@c8y/ngx-components 1010.0.17 → 1010.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,5 +13,5 @@
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- var yc=function(e,t){return(yc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function vc(e,t){function n(){this.constructor=e}yc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var bc=function(){return(bc=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function jc(e,t,n,a){var o,s=arguments.length,r=s<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,a);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}function wc(e,t){return function(n,a){t(n,a,e)}}function Sc(e,t,n,a){return new(n||(n=Promise))((function(o,s){function r(e){try{i(a.next(e))}catch(e){s(e)}}function l(e){try{i(a.throw(e))}catch(e){s(e)}}function i(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}i((a=a.apply(e,t||[])).next())}))}function Cc(e,t){var n,a,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function l(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(o=2&s[0]?a.return:s[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,s[1])).done)return o;switch(a=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,a=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e],a=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function Ic(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],a=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pc(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a,o,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(a=s.next()).done;)r.push(a.value)}catch(e){o={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return r}function Oc(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Pc(arguments[t]));return e}function xc(e,t,a){return e.events.pipe(o.filter((function(e){return e instanceof n.NavigationEnd})),o.merge(t),o.startWith(1),o.switchMap((function(){return Ec(a,e)})))}function Ec(e,t,n){return void 0===n&&(n=!0),!Array.isArray(e)||e.length<1?a.of([]):a.defer((function(){var r=kc(e).map((function(e){return function(e,t){var n;if(!e)return a.of([]);if("function"==typeof e.then||a.isObservable(e))if(t){var s=a.from(e),r=s.pipe(o.startWith([]));n=a.race(s,r)}else n=a.from(e);else n=a.of(e);return n.pipe(o.map((function(e){return(Array.isArray(e)?e:[e]).filter((function(e){return!!e}))})))}(Array.isArray(e)?e:e&&s.isFunction(e.get)?e.get(_c(t)):[e],n)}));return a.combineLatest.apply(void 0,Oc(r))})).pipe(o.map((function(e){return Ac([].concat.apply([],Oc(e)))})))}function kc(e){return s.flatten(e.map((function(e){return s.isFunction(e)?e():[e]})))}function Tc(e){var t=e.pipe(o.map((function(e){return Array.from(e)})));return{get:function(){return t}}}function Ac(e){return s.sortBy(e,"priority")}function _c(e){if(e&&e.routerState&&e.routerState.root){for(var t=e.routerState.root;t.firstChild;)t=t.firstChild;return t}}var Nc=function(){function e(){}return e.prototype.map=function(e){return this.state$.pipe(o.map(e),o.distinctUntilChanged())},e.prototype.emitNewState=function(){this.state$.next(this.state)},e}(),Dc=new t.InjectionToken("ActionBarFactory"),Lc=function(e){function s(t,n){var s=e.call(this)||this;return s.injector=t,s.refreshTrigger=new a.Subject,s.state$=new a.BehaviorSubject(new Set),s.items$=xc(n,s.refreshTrigger,[function(){return s.injector.get(Dc,[])},Tc(s.state$)]).pipe(o.map((function(e){return Ac(e)})),o.shareReplay(1)),s}return vc(s,e),Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.refresh=function(){this.refreshTrigger.next()},s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),Mc=function(){function e(e){this.actionBarService=e,this.placement="left",this.priority=0,this.itemClass=""}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.actionBarService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.actionBarService.remove(this)},e.ctorParameters=function(){return[{type:Lc}]},jc([t.Input()],e.prototype,"placement",void 0),jc([t.Input()],e.prototype,"priority",void 0),jc([t.Input()],e.prototype,"itemClass",void 0),jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=jc([t.Component({selector:"c8y-action-bar-item",template:'<ng-template #template>\n <li class="{{itemClass}}">\n <ng-content></ng-content>\n </li>\n</ng-template>'})],e)}(),Rc=function(){},qc=new t.InjectionToken("App options"),$c=function(e){function n(t,n,a){var o=e.call(this)||this;return o.systemOptionsService=n,o.tenantOptionService=a,o.setupOptions(t),o}return vc(n,e),n.prototype.get=function(e,t){var n=this[e];return void 0===n&&(n=this[s.camelCase(e)]),void 0!==n?n:t},n.prototype.set=function(e,t){this[s.camelCase(e)]=t},n.prototype.getSupportUrl=function(){return Sc(this,void 0,void 0,(function(){var e,t,n;return Cc(this,(function(a){switch(a.label){case 0:return[4,this.getTenantOption("configuration","system.support.url")];case 1:return e=a.sent(),s.isUndefined(e)&&(e=this.supportUrl),t=this,s.isUndefined(e)?[4,this.getSystemOption("support","url")]:[3,3];case 2:return n=a.sent()||!1,[3,4];case 3:n=e,a.label=4;case 4:return t.supportUrl=n,[2,this.supportUrl]}}))}))},n.prototype.getActivateSupportUser=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return[4,this.getSystemOption("support-user","enabled",!0)];case 1:return[2,!e.sent()]}}))}))},n.prototype.getSystemOption=function(e,t,n){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(a){return[2,this.getOptionFromService(e,t,this.systemOptionsService,n)]}))}))},n.prototype.getTenantOption=function(e,t,n){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(a){return[2,this.getOptionFromService(e,t,this.tenantOptionService,n)]}))}))},n.prototype.setupOptions=function(e){var t=this;e&&(Array.isArray(e)||(e=[e]),e.forEach((function(e){e&&Object.keys(e).forEach((function(n){t[s.camelCase(n)]=e[n]}))})))},n.prototype.getOptionFromService=function(e,t,n,a){return Sc(this,void 0,void 0,(function(){var o;return Cc(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,n.detail({category:e,key:t})];case 1:return o=s.sent().data,[2,this.parseOptionRawValue(o.value,a)];case 2:return s.sent(),[2,a];case 3:return[2]}}))}))},n.prototype.parseOptionRawValue=function(e,t){var n;try{n=JSON.parse(e)}catch(a){n=s.isUndefined(e)?t:e}return n},n.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[qc]}]},{type:c.SystemOptionsService},{type:c.TenantOptionsService}]},n=jc([t.Injectable(),wc(0,t.Optional()),wc(0,t.Inject(qc))],n)}(Rc);function Fc(e,t){return function(n,a,o){var r=o.value;o.value=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var l="_"+a+"Throttled";return this[l]||(this[l]=s.throttle(r,e,t)),this[l].apply(this,n)}}}var Uc=function(e){function n(t,n,s,r,l){var i=e.call(this)||this;return i.applicationService=t,i.apiService=n,i.options=s,i.fetchClient=r,i.tenantLoginOptionsService=l,i.state$=new a.BehaviorSubject({app:{name:i.options.name,contextPath:i.getCurrentContextPath()||i.options.contextPath},supportUrl:i.options.supportUrl,lang:i.options.get("defaultLanguage","en"),langs:i.getLangs(),langsDetail:i.options.languages,loginOptions:i.options.loginOptions,activateSupportUserAvailable:void 0,versions:{backend:void 0,ui:i.options.versions||{ngx:void 0}},hidePowered:i.options.hidePowered,isLoading:!1,showRightDrawer:i.options.rightDrawer,loginExtraLink:i.options.get("login_extra_link"),newsletter:i.options.newsletter}),i.currentSupportUserName=new a.BehaviorSubject(null),i.currentUser=new a.BehaviorSubject(null),i.currentTenant=new a.BehaviorSubject(null),i.apiService.calls.pipe(o.filter((function(e){var t=e.url;return!/notification\/realtime/.test(t)})),o.map((function(e){return"start"===e.phase?1:-1})),o.scan((function(e,t){return e+t}),0),o.map((function(e){return e>0})),o.distinctUntilChanged()).subscribe((function(e){return i.state.isLoading=e})),i.assignApplicationKeyToDefaultHeaders(),i}return vc(n,e),n.prototype.assignApplicationKeyToDefaultHeaders=function(){t.isDevMode()||(this.fetchClient.defaultHeaders=bc({},this.fetchClient.defaultHeaders||{},{"X-Cumulocity-Application-Key":this.options.key}))},Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),n.prototype.getLangs=function(){var e=this.options.languages;return e?s.keys(e).filter((function(t){return e[t]})):[]},Object.defineProperty(n.prototype,"uiVersion",{get:function(){var e=this.state.versions.ui;return e.ngx||e.ng1},enumerable:!0,configurable:!0}),n.prototype.loadManifest=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.applicationService.detail(this.state.app.contextPath+"/manifest")];case 1:return e=t.sent().data.application,this.state.app.manifest=e,this.loadDefaultOptions(),[3,3];case 2:throw t.sent();case 3:return[2]}}))}))},n.prototype.refreshLoginOptions=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return[4,this.tenantLoginOptionsService.detail()];case 1:return e=t.sent().data.loginOptions,this.state$.next(bc({},this.state,{loginOptions:e})),[2]}}))}))},n.prototype.isApplicationAvailable=function(e){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){switch(t.label){case 0:return[4,this.applicationService.listByUser(void 0,{pageSize:100})];case 1:return[2,t.sent().data.some((function(t){return t.name===e}))]}}))}))},n.prototype.setUser=function(e){this.currentSupportUserName.next(e.supportUserName||null),this.currentUser.next(e.user)},n.prototype.getCurrentContextPath=function(){var e=window.location.pathname.match(/\/apps\/(public\/){0,1}(.+?)(\/|\?|#|$)/);return e&&e[2]},n.prototype.loadDefaultOptions=function(){return Sc(this,void 0,void 0,(function(){var e,t,n;return Cc(this,(function(a){switch(a.label){case 0:return e=this.state,[4,this.options.getSupportUrl()];case 1:return e.supportUrl=a.sent(),t=this.state,[4,this.options.getActivateSupportUser()];case 2:return t.activateSupportUserAvailable=a.sent(),n=this.state.versions,[4,this.options.getSystemOption("system","version")];case 3:n.backend=a.sent();try{this.showIncompatibleVersionsError()}catch(e){}return this.emitNewState(),[2]}}))}))},n.prototype.showIncompatibleVersionsError=function(){var e=this.state.versions.ui.ngx,t=this.state.versions.backend,n=e.replace(/[^\d.]/g,"").split(".").map(Number),a=t.replace(/[^\d.]/g,"").split(".").map(Number),o=Math.pow(10,Math.ceil(Math.log10(Math.max.apply(Math,Oc(n,a))+1))),s=function(e,t){return e+t},r=function(e,t){return e*(o/Math.pow(10,t))};if(n.map(r).reduce(s)>a.map(r).reduce(s)){var l="You are running version "+e+" of the UI and version "+t+" of backend!";console.log("%c "+l,"font-weight: bold; font-size: 30px; color: red;")}},n.ctorParameters=function(){return[{type:m.ApplicationService},{type:c.ApiService},{type:$c},{type:m.FetchClient},{type:m.TenantLoginOptionsService}]},jc([Fc(600,{trailing:!1})],n.prototype,"refreshLoginOptions",null),n=jc([t.Injectable()],n)}(Nc),Bc=new t.InjectionToken("Languages"),Gc=new t.InjectionToken("Locale path"),Hc=new t.InjectionToken("Pattern Messages"),zc=function(){function e(e){var t=this;this.patterns={},this.pipes={absoluteDate:function(e){return i.formatDate(e,"medium",t.translateService.currentLang)},translate:function(e){return t.translateService.instant(e)}},s.each(e,(function(e){Object.assign(t.patterns,e)}))}return e.prototype.translate=function(e){var t=this.translateWithPatterns(e);return t!==e?t:""},e.prototype.translateWithPatterns=function(e,t){var n=this;void 0===t&&(t=this.patterns);var a=e;return s.each(t,(function(e,t){var o,r=new RegExp(t,"g");if(r.test(a)){r.test(""),o=r.exec(a);for(var l=function(){var l=Pc(o,1)[0],i=s.mapValues(e.placeholders,(function(e){var a=e.capture||e,o=l.replace(new RegExp(t,"g"),a);return e.translate&&(o=n.translateWithPatterns(o,e.translate)),o}));a=a.replace(l,n.translateWithParams(e,i)),o=r.exec(a)};null!==o;)l()}})),a},e.prototype.translateWithParams=function(e,t){void 0===t&&(t={});var n=this.translateService,a=n.defaultLang,o=n.currentLang,s=n.compiler,r=this.translateService.store.translations[o],l=this.translateService.store.translations[a],i=e.gettext,c=i;r&&(r[i]?c=r[i]:l&&l[i]&&(c=l[i]));for(var u,d=i,p=c,m=bc({},t,{noPatternMessages:!0}),h=RegExp("{{\\s*([^\\s]+)\\s*\\|\\s*([^\\s]+)\\s*}}","g");null!==(u=h.exec(i));){var f=Pc(u,3),g=f[0],y=f[1],v=f[2];this.pipes[v]&&(d=d.replace(g,"{{"+y+"}}"),p=p.replace(g,"{{"+y+"}}"),m[y]=this.pipes[v](t[y]))}return r&&(r[d]=s.compile(p,o)),this.translateService.instant(d,m)},e.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[Hc]}]}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(Hc))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"}),wc(0,t.Inject(Hc))],e)}(),Vc=function(){function e(e,t){this.parser=e,this.patternMessagesService=t,this.cache={}}return e.prototype.handle=function(e){var t=e.key,n=e.interpolateParams,a=e.translateService;this.translateService=a;var o=this.getFromCache(t,n);if(!o){var s=this.getPatternMessageTranslation(t,n);o=s||this.parser.interpolate(t,n),this.addToCache(t,n,o)}return o},e.prototype.getFromCache=function(e,t){var n=this.translateService.currentLang;return(this.cache[n]||{})[this.getCacheKey(e,t)]},e.prototype.addToCache=function(e,t,n){var a=this.translateService.currentLang;(this.cache[a]=this.cache[a]||{})[this.getCacheKey(e,t)]=n},e.prototype.getCacheKey=function(e,t){return t?e+" "+JSON.stringify(t):e},e.prototype.getPatternMessageTranslation=function(e,t){if(!t||!t.noPatternMessages)return this.patternMessagesService.translateService||(this.patternMessagesService.translateService=this.translateService),this.patternMessagesService.translate(e)},e.ctorParameters=function(){return[{type:p.TranslateParser},{type:zc}]},e=jc([t.Injectable()],e)}();function Kc(e){return e}var Wc={updatesList:{capture:"$1",translate:{"status='(.+?)'":{gettext:'status: "{{ status | translate }}"',placeholders:{status:"$1"}},"generalStatus='(.+?)'":{gettext:'general status: "{{ generalStatus | translate }}"',placeholders:{generalStatus:"$1"}},"progress='(.+?)'":{gettext:'progress: "{{ progress }}"',placeholders:{progress:"$1"}},"note=(.+?)":{gettext:'note: "{{ note }}"',placeholders:{note:"$1"}}}}},Yc={"^Access is denied$":{gettext:"Access denied."},"^Alarm created$":{gettext:"Alarm created"},"^Alarm updated$":{gettext:"Alarm updated"},"^API is not available with the new domain$":{gettext:"Could not activate custom domain. DNS setup is incorrect."},"^Application with given name already exist$":{gettext:"Application with given name already exists."},"^Application with id (.+?) is already assigned to the tenant (.+?)$":{gettext:'This application is already assigned to tenant "{{tenant}}".',placeholders:{tenant:"$2"}},"^Apply software changes: (.+?)\\.?$":{gettext:"Apply software changes: {{ softwareChanges }}",placeholders:{softwareChanges:{capture:"$1",translate:{'install "(.+?)" \\(version: (.+?)\\)':{gettext:'install "{{ softwareName }}" (version: {{ softwareVersion }})',placeholders:{softwareName:"$1",softwareVersion:"$2"}},'install "([^"]+)"(?! \\(version: .+?\\))':{gettext:'install "{{ softwareName }}"',placeholders:{softwareName:"$1"}},'delete "(.+?)" \\(version: (.+?)\\)':{gettext:'delete "{{ softwareName }}" (version: {{ softwareVersion }})',placeholders:{softwareName:"$1",softwareVersion:"$2"}},'delete "([^"]+)"(?! \\(version: .+?\\))':{gettext:'delete "{{ softwareName }}"',placeholders:{softwareName:"$1"}}}}}},"^Assign device profile (.+?) to device (.+?)$":{gettext:"Assign device profile {{profileName}} to device {{deviceName}}",placeholders:{profileName:"$1",deviceName:"$2"}},"^(.+)pplication for tenant (.+) with properties \\( (.+?) \\) already exists$":{gettext:'Application for tenant "{{tenant}}" with the following values ({{valuesList}}) already exists.',placeholders:{tenant:"$2",valuesList:"$3"}},"^Authentication failed! : User account is locked$":{gettext:"Authentication failed due to: user account is locked."},"^Availability monitoring record$":{gettext:"Availability monitoring record"},"^Can not activate a certificate which is either expired or not yet valid$":{gettext:"Cannot activate a certificate which is either expired or not yet valid."},"^Cannot add certificate - certificate with (.+?) fingerprint already exists. : Certificate with (.+?) fingerprint already exists.":{gettext:"Could not add certificate. Certificate with {{fingerprint}} fingerprint already exists.",placeholders:{fingerprint:"$1"}},"^Cannot change password. : Provided token does not exist.$":{gettext:"Cannot change password: provided token is invalid."},"^Cannot deploy module (.*)$":{gettext:'Cannot deploy module due to error: "{{ errorMessage | translate }}".',placeholders:{errorMessage:"$1"}},"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+) \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": incorrect syntax near "{{incorrectExpression}}" at line {{line}} column {{column}}.',placeholders:{moduleName:"$1",expression:"$3",incorrectExpression:"$4",line:"$5",column:"$6"}},"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+) near reserved keyword '(.+?)' \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": incorrect syntax near "{{incorrectExpression}}" at line {{line}} column {{column}} near reserved keyword "{{keyword}}".',placeholders:{moduleName:"$1",expression:"$3",incorrectExpression:"$4",line:"$5",column:"$6",keyword:"$7"}},"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+), please check the where clause \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": incorrect syntax near "{{incorrectExpression}}" at line {{line}} column {{column}}, check "where" clause.',placeholders:{moduleName:"$1",expression:"$3",incorrectExpression:"$4",line:"$5",column:"$6"}},"^Cannot deploy module (.+?)! : Deployment failed in module '(.+?)' in expression '(.+?)' : Exception compiling script '(.+?)' of dialect '(.+?)': missing (.+?) before statement \\((.+?)\\) \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": exception compiling script "{{scriptName}}" of dialect "{{scriptDialect}}": missing "{{missingSyntax}}" before statement "{{affectedStatement}}".',placeholders:{moduleName:"$1",expression:"$3",scriptName:"$4",scriptDialect:"$5",missingSyntax:"$6",affectedStatement:"$7"}},"^Cannot execute bulk operation on empty group. Group with id='(\\d+?)' doesn't have child assets.$":{gettext:'Could not execute bulk operation on an empty group. Group with ID "{{groupId}}" has no child assets.',placeholders:{groupId:"$1"}},"^Cannot execute bulk operation on empty group. DynamicGroup with id='(\\d+?)' doesn't have child assets$":{gettext:'Could not execute bulk operation on an empty group. Smart group with ID "{{groupId}}" has no child assets.',placeholders:{groupId:"$1"}},"^Cannot parse X509 certificate. : Could not parse certificate: (.+?)$":{gettext:"Could not parse X.509 certificate: {{ failureReason | translate }}.",placeholders:{failureReason:"$1"}},"^Cannot reschedule bulk operation. All its operations are successful$":{gettext:"Cannot reschedule bulk operation. All its operations are already successful."},"^Cannot reset user password : Cannot find user with such email.$":{gettext:"Cannot reset password for user with such email: email not found."},"^Cannot update/delete application binary via this endpoint$":{gettext:"Cannot update/delete application binary via this endpoint"},"^Can't delete user because it is used by another managed object$":{gettext:"Cannot delete device with associated device owner because this owner is still assigned to other device(s). Try to remove only the device."},"^Cep module created$":{gettext:"CEP module created"},"^Cep module updated$":{gettext:"CEP module updated"},"^Cep module deleted$":{gettext:"CEP module deleted"},'^Cep module "(.+?)" created$':{gettext:'CEP module "{{name}}" created',placeholders:{name:"$1"}},'^Cep module "(.+?)" updated$':{gettext:'CEP module "{{name}}" updated',placeholders:{name:"$1"}},'^Cep module "(.+?)" deleted$':{gettext:'CEP module "{{name}}" deleted',placeholders:{name:"$1"}},"^Command state is invalid: (.+)$":{gettext:"Command state is invalid: {{violations}}",placeholders:{violations:{capture:"$1",translate:{"(\\w+?) - may not be null":{gettext:'"{{field}}" must not be null',placeholders:{field:"$1"}}}}}},"^Could not connect to endpoint (.+)\\. Could not verify `(.+)` host key with fingerprint `(.+)` for `(.+)` on port (.+)\\. If you expected that key, please remove the previous one from configuration to allow for connection\\.$":{gettext:'Could not connect to endpoint "{{endpointName}}". Could not verify {{keyType}} host key with fingerprint {{fingerprint}} for host {{host}} on port {{port}}. If you expected this key, please remove the previous one from configuration to allow for connection.',placeholders:{endpointName:"$1",keyType:"$2",fingerprint:"$3",host:"$4",port:"$5"}},'^Could not login to ssh server on endpoint "(.+)"\\. Provided credential for user "(.+)" is incorrect\\.$':{gettext:'Could not access SSH server on endpoint "{{endpointName}}". Provided credentials for user "{{userName}}" are incorrect.',placeholders:{endpointName:"$1",userName:"$2"}},"^Could not save object remoteAccessUpdate: (.+)$":{gettext:"{{errorMessages}}",placeholders:{errorMessages:{capture:"$1",translate:{"Could not recognize host-key format":{gettext:'Could not recognize "Host key" format'},"Could not recognize key-pair format":{gettext:'Could not recognize the format of "Public key" or "Private key"'}}}}},"^Could not update user. : Error persisting user (.+?)!$":{gettext:'Could not update user "{{username}}".',placeholders:{username:"$1"}},"ˆCreate bulk operation$":{gettext:"Create bulk operation"},"^Create bulk operation: (.+)$":{gettext:"Create bulk operation: {{updatesList}}",placeholders:Wc},"^Creation ramp must be greater than (\\d+?)$":{gettext:"Bulk operation delay must be greater than {{minSeconds}} seconds.",placeholders:{minSeconds:"$1"}},"^Created container$":{gettext:"Container created."},"^Created pod: (.+)$":{gettext:'Pod "{{imageName}}" created.',placeholders:{imageName:"$1"}},"^CSV file contained empty dataset$":{gettext:"No entries found in uploaded CSV file."},"^Cycle detected for route (.+?)!$":{gettext:"Cycle detected for route {{route}}.",placeholders:{route:"$1"}},"^Data broker processing is currently overloaded and may stop forwarding your data\\. Please contact support\\.$":{gettext:"Data broker processing is currently overloaded and may stop forwarding your data. Please contact support."},"^Data broker processing is not able to connect do destination tenant, thus data forwarding is not working\\. Please contact support\\.$":{gettext:"Data broker processing is not able to connect to destination tenant, thus data forwarding is not working. Please contact support."},"^Delete bulk operation$":{gettext:"Delete bulk operation"},"^Delete bulk operation: (.+)$":{gettext:"Delete bulk operation: {{updatesList}}",placeholders:Wc},"^Device id '(.+?)' contains '(.+?)' character which is not permitted.$":{gettext:'ID "{{deviceId}}" contains invalid character: "{{invalidCharacter}}".',placeholders:{deviceId:"$1",invalidCharacter:"$2"}},"^Device name: '(.+?)', alarm text: '(.+?)'$":{gettext:'Device name: "{{deviceName}}", alarm text: "{{alarmText | translate}}"',placeholders:{deviceName:"$1",alarmText:"$2"}},"^Display name$":{gettext:"Login alias"},"^Domain name in uploaded certificate differs from the one in use$":{gettext:"Domain name in uploaded certificate differs from the one in use. Please deactivate the custom domain before uploading new certificate."},"^Domain name is already in use by another tenant!$":{gettext:"Domain name is already used by another tenant."},"^Duplicated connector for instanceUrl (.+?)!$":{gettext:"Target URL {{targetUrl}} already used by another connector.",placeholders:{targetUrl:"$1"}},"^Duplicated connector for name (.+?)!$":{gettext:'Connector name "{{name}}" already used by another connector.',placeholders:{name:"$1"}},"^Entry is outside of the target dir: (.+)$":{gettext:'File entry outside of the target directory: "{{path}}".',placeholders:{path:"$1"}},"^Error during password validation. : Password must have at least (\\d+?) characters and no more than (\\d+?) and must contain only Latin1 characters.$":{gettext:"Password is invalid. It must have at least {{minCharactersCount}} and no more than {{maxCharactersCount}} characters.",placeholders:{minCharactersCount:"$1",maxCharactersCount:"$2"}},"^Error during password validation. : Your password has been used already. Choose another.$":{gettext:"This password has already been used earlier. Use a different one."},"^Error in statement (.+?):(.+?)! : Incorrect syntax near '(.+?)' near reserved keyword '(.+?)' \\[([\\S\\s]+?)\\]$":{gettext:'Error in statement {{moduleName}}:{{statementNumber}}. Incorrect syntax near expression "{{expression}}" near reserved keyword "{{keyword}}".',placeholders:{moduleName:"$1",statementNumber:"$2",expression:"$3",keyword:"$4"}},"^External id not found; external id = ID \\[type=(.+?), value=(.+?)\\]$":{gettext:'External ID not found for type "{{type}}" and value "{{value}}".',placeholders:{type:"$1",value:"$2"}},"^Error occurred when trying to find an Application for id ID (.+) : Could not find application by ID (\\d+)$":{gettext:"Could not find application by ID {{applicationId}}.",placeholders:{applicationId:"$2"}},'^Http status code: 404\n{error="options/Not Found",message="Unable to find option by given key: sigfox-agent/provider.token",info="https://www.cumulocity.com/guides/reference-guide/#error_reporting",details="null"}':{gettext:"Unable to find option by given key: sigfox-agent/provider.token"},"^Failed to delete application. : Cannot remove application assigned to other tenants.$":{gettext:"Could not delete application assigned to other tenants."},"^Failed to extract certificate from PKCS12$":{gettext:"Failed to extract certificate from PKCS12."},"^Failed to update domain at the platform$":{gettext:"Failed to update domain at the platform."},"^Finding device data from database failed : No managedObject for id '(.+?)'!$":{gettext:'Could not find managed object with ID "{{deviceId}}".',placeholders:{deviceId:"$1"}},"^Following mandatory fields should be included: (.+?)$":{gettext:"Following mandatory fields should be included: {{fields}}",placeholders:{fields:"$1"}},"^Global Role updated$":{gettext:"Global role updated"},"^Global Role (.+?) updated$":{gettext:'Global role "{{name}}" updated',placeholders:{name:"$1"}},"^Global Role (.+?) updated: (.+)$":{gettext:'Global role "{{name}}" updated: {{updatesList}}',placeholders:{name:"$1",updatesList:{capture:"$2",translate:{"applications \\[([^\\]]+?)\\] added":{gettext:"applications {{list}} added",placeholders:{list:"$1"}},"applications \\[([^\\]]+?)\\] removed":{gettext:"applications {{list}} removed",placeholders:{list:"$1"}},"roles \\[([^\\]]+?)\\] added":{gettext:"roles {{list}} added",placeholders:{list:"$1"}},"roles \\[([^\\]]+?)\\] removed":{gettext:"roles {{list}} removed",placeholders:{list:"$1"}}}}}},"^Global Roles$":{gettext:"Global roles"},"^Operation updated: (.+)$":{gettext:"Operation updated: {{updatesList}}",placeholders:{updatesList:{capture:"$1",translate:{"status='(.+?)'":{gettext:'status: "{{ status | translate }}"',placeholders:{status:"$1"}},"description='(.+?)'":{gettext:'description: "{{ description | translate }}"',placeholders:{description:"$1"}},"device name='(.+?)'":{gettext:'device name: "{{ deviceName }}"',placeholders:{deviceName:"$1"}},"failure reason='(.+?)'":{gettext:'failure reason: "{{ failureReason | translate }}"',placeholders:{failureReason:"$1"}}}}}},"^ID \\[type=(.+?), value=(.+?)\\] was already bound to different Global ID.$":{gettext:'External ID "{{value}}" of the type "{{type}}" already exists.',placeholders:{type:"$1",value:"$2"}},"^Invalid credentials! : Bad credentials$":{gettext:"Invalid credentials."},"^Invalid credentials! : No phone number provided$":{gettext:"Log into the management tenant first and enter your phone number."},"^Inventory Role removed$":{gettext:"Inventory role removed"},"^Inventory Role (.+?) removed":{gettext:'Inventory role "{{name}}" deleted.',placeholders:{name:"$1"}},"^Inventory Role updated$":{gettext:"Inventory role updated"},"^Inventory Role (.+?) updated":{gettext:'Inventory role "{{name}}" updated.',placeholders:{name:"$1"}},"^I/O error: Connection refused; nested exception is Connection refused : Connection refused":{gettext:"Connection refused"},"^I/O error: Read timed out; nested exception is Read timed out : Read timed out":{gettext:"Read timed out"},"^Log file requested$":{gettext:"Log file requested."},"^Managed object deleted$":{gettext:"Managed object deleted"},'^Managed object "(.+?)" deleted$':{gettext:'Managed object "{{name}}" deleted',placeholders:{name:"$1"}},"^Maximum file size exceeded$":{gettext:"Maximum file size exceeded."},"^Message with ID (.+?) doesn't exist in smart rest template (.+?)$":{gettext:'Message with ID "{{messageId}}" doesn\'t exist in SmartREST template with ID "{{templateId}}"',placeholders:{messageId:"$1",templateId:"$2"}},"^NewDeviceRequest for id = (.+?) already exists.$":{gettext:"Device registration request with ID {{id}} already exists.",placeholders:{id:"$1"}},"^No communication with device since (.+?)$":{gettext:"No communication with device since {{timestamp | absoluteDate}}.",placeholders:{timestamp:"$1"}},"^No data received from device within required interval.$":{gettext:"No data received from device within required interval."},"^No LoRa provider settings are found. Please configure the connectivity settings.$":{gettext:"No LoRa provider settings are found. Please configure the connectivity settings."},"^Not within any context!$":{gettext:"A problem occurred with microservice subscription."},"^Maximum age cannot be bigger than 10 years.$":{gettext:"Maximum age cannot be bigger than 10 years."},"^Microservice application name incorrect. Please use only lower-case letters, digits and dashes. Maximum length is (\\d+) characters.$":{gettext:"Microservice application name is incorrect: only lower case letters, digits and dashes allowed. Maximum length: {{maxLength}}.",placeholders:{maxLength:"$1"}},"^Microservice not available.*$":{gettext:"Microservice is not available."},"^Operation created$":{gettext:"Operation created."},"^Operation updated$":{gettext:"Operation updated."},"^Operation created: status='(.+?)'.":{gettext:'Operation created: status: "{{ status | translate }}".',placeholders:{status:"$1"}},"^Option created$":{gettext:"Option created."},'^Option "(.+?)" created$':{gettext:'Option "{{option}}" created.',placeholders:{option:"$1"}},"^Option deleted$":{gettext:"Option deleted."},'^Option "(.+?)" deleted$':{gettext:'Option "{{option}}" deleted.',placeholders:{option:"$1"}},"^Owner field error. : Cannot introduce cyclic dependency.":{gettext:"Could not introduce cyclic ownership dependency."},"^Password change is temporary blocked.$":{gettext:"Password change is temporarily blocked."},"^Password cipher does not match":{gettext:"Password cipher does not match."},"^Platform application cannot be added to, nor removed from any tenant.$":{gettext:"Platform application cannot be added to, nor removed from any tenant."},"^Private key must be provided in KEY_PAIR credentials$":{gettext:'Private key must be provided when "Public/private keys" option is selected.'},"^Private key cipher does not match":{gettext:"Private key cipher does not match"},'^Protocol "(.+?)" does not support "(.+?)" credentials type$':{gettext:'Protocol "{{protocol}}" does not support "{{credentialsType}}" credentials type.',placeholders:{protocol:"$1",credentialsType:"$2"}},'^pulling image "(.+)"$':{gettext:'Pulling image: "{{imageName}}".',placeholders:{imageName:"$1"}},"^Real-time event processing is currently overloaded and may stop processing your events\\. Please contact support\\.$":{gettext:"Real-time event processing is currently overloaded and may stop processing your events. Please contact support."},"^Resource ID \\[type=com_cumulocity_model_idtype_GId, value=(.+?)\\] for this request not found.$":{gettext:'Could not find the resource with ID "{{id}}".',placeholders:{id:"$1"}},"^Retrieve configuration snapshot from device (.+?)":{gettext:"Retrieve configuration snapshot from device {{deviceName}}",placeholders:{deviceName:"$1"}},"^Retrieve (.+?) configuration snapshot from device (.+?)":{gettext:"Retrieve {{configurationType}} configuration snapshot from device {{deviceName}}",placeholders:{configurationType:"$1",deviceName:"$2"}},"^Scaled up replica set (.+) to (\\d+)$":{gettext:'Replica set "{{replicaSetName}}" scaled up to "{{scaleNumber}}".',placeholders:{replicaSetName:"$1",scaleNumber:"$2"}},"^Send configuration snapshot (.+?) of configuration type (.+?) to device (.+?)":{gettext:"Send configuration snapshot {{snapshotName}} of configuration type {{configurationType}} to device {{deviceName}}",placeholders:{snapshotName:"$1",configurationType:"$2",deviceName:"$3"}},"^Send configuration snapshot (.+?) to device (.+?)":{gettext:"Send configuration snapshot {{snapshotName}} to device {{deviceName}}",placeholders:{snapshotName:"$1",deviceName:"$2"}},"^Simulator state is invalid: (.+)$":{gettext:"Simulator state is invalid: {{violations}}",placeholders:{violations:{capture:"$1",translate:{"(\\w+?) - may not be null":{gettext:'"{{field}}" should not be null',placeholders:{field:"$1"}},"(\\w+?) - must be less than or equal to (\\d+)":{gettext:'"{{field}}" must be less than or equal to {{maxValue}}',placeholders:{field:"$1",maxValue:"$2"}},"(\\w+?) - should not contain null values":{gettext:'"{{field}}" should not contain null values',placeholders:{field:"$1"}}}}}},"^Smart rest template (.+?) doesn't exist$":{gettext:'SmartREST template with id "{{templateId}}" doesn\'t exist',placeholders:{templateId:"$1"}},"^Smart rule created$":{gettext:"Smart rule created."},"^Smart rule updated$":{gettext:"Smart rule updated."},"^Smart rule enabled$":{gettext:"Smart rule activated."},"^Smart rule disabled$":{gettext:"Smart rule deactivated."},"^Smart rule deleted$":{gettext:"Smart rule deleted."},'^Smart rule "(.+?)" created$':{gettext:'Smart rule "{{name}}" created.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" updated$':{gettext:'Smart rule "{{name}}" updated.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" enabled$':{gettext:'Smart rule "{{name}}" activated.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" disabled$':{gettext:'Smart rule "{{name}}" deactivated.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" deleted$':{gettext:'Smart rule "{{name}}" deleted.',placeholders:{name:"$1"}},"^Started container$":{gettext:"Container started."},"^Successfully assigned (.+) to (.+)$":{gettext:'"{{imageName}}" assigned to "{{address}}".',placeholders:{imageName:"$1",address:"$2"}},'^Successfully pulled image "(.+)"$':{gettext:'Image "{{imageName}}" pulled.',placeholders:{imageName:"$1"}},"^Tenant creation failed. : Tenant with given id already exists.$":{gettext:"Could not create a tenant. Tenant with given domain/URL already exists."},'^Tenant id cannot be a reserved sql keyword "(.+?)".$':{gettext:'Could not use a reserved SQL keyword "{{tenantId}}" as a domain name.',placeholders:{tenantId:"$1"}},'^Tenant "(.+?)" activated$':{gettext:'Tenant "{{tenant}}" activated.',placeholders:{tenant:"$1"}},"^Tenant (.+?) has sub-tenants, please remove them first!$":{gettext:'Could not remove tenant "{{tenant}}". Remove its subtenants first.',placeholders:{tenant:"$1"}},"^Tenant activated$":{gettext:"Tenant activated"},'^Tenant "(.+?)" created$':{gettext:'Tenant "{{tenant}}" created.',placeholders:{tenant:"$1"}},"^Tenant created$":{gettext:"Tenant created"},'^Tenant "(.+?)" deleted$':{gettext:'Tenant "{{tenant}}" deleted.',placeholders:{tenant:"$1"}},"^Tenant deleted$":{gettext:"Tenant deleted"},'^Tenant "(.+?)" suspended$':{gettext:'Tenant "{{tenant}}" suspended.',placeholders:{tenant:"$1"}},"^Tenant suspended$":{gettext:"Tenant suspended"},'^Tenant "(.+?)" updated: (.+?)$':{gettext:'Tenant "{{tenant}}" updated: {{properties}}.',placeholders:{tenant:"$1",properties:"$2"}},"^Tenant updated$":{gettext:"Tenant updated"},"^Too Many Requests$":{gettext:"Too many requests. Try again later."},"^User alias equals username '(.+)'$":{gettext:"Username and login alias must be different."},"^User created$":{gettext:"User created"},"^User (.+?) created$":{gettext:'User "{{name}}" created',placeholders:{name:"$1"}},"^User deleted$":{gettext:"User deleted"},"^User (.+?) deleted$":{gettext:'User "{{name}}" deleted',placeholders:{name:"$1"}},"^User updated$":{gettext:"User updated"},"^User (.+?) updated: (.+)$":{gettext:'User "{{name}}" updated: {{updatesList}}',placeholders:{name:"$1",updatesList:{capture:"$2",translate:{"delegatedBy='(.+?)'":{gettext:'delegated by: "{{delegate}}"',placeholders:{delegate:"$1"}},"owner='(.+?)'":{gettext:'owner: "{{owner}}"',placeholders:{owner:"$1"}},"inventory assignment \\[(.+?)\\] added":{gettext:"inventory assignment [{{inventoryAssignment}}] added",placeholders:{inventoryAssignment:"$1"}},"inventory assignment \\[(.+?)\\] removed":{gettext:"inventory assignment [{{inventoryAssignment}}] removed",placeholders:{inventoryAssignment:"$1"}},"applications \\[(.+?)\\] added$":{gettext:"applications [{{applicationsList}}] added",placeholders:{applicationsList:"$1"}},"applications \\[(.+?)\\] removed$":{gettext:"applications [{{applicationsList}}] removed",placeholders:{applicationsList:"$1"}},"global roles \\[(.+?)\\] added$":{gettext:"global roles [{{globalRolesList}}] added",placeholders:{globalRolesList:"$1"}},"global roles \\[(.+?)\\] removed$":{gettext:"global roles [{{globalRolesList}}] removed",placeholders:{globalRolesList:"$1"}}}}}},"^User with username '(.+?)' already exists! : Duplicated: (.+?)$":{gettext:'User "{{username}}" already exists.',placeholders:{username:"$1"}},"^User with username or alias '(.+)' already exists! : Duplicated: (.+)$":{gettext:'User with username or login alias "{{usernameOrAlias}}" already exists.',placeholders:{usernameOrAlias:"$1"}},"^User with email '(.+?)' already exists! : Duplicated: (.+?)$":{gettext:'User with email "{{email}}" already exists.',placeholders:{email:"$1"}},"^unable to find option with given key (.+?) : Could not find entity Option by ID (.+?)!$":{gettext:'Unable to get tenant option: "{{option}}".',placeholders:{option:"$2"}},"^unable to find option with given key (.+?) : There is no system property for key (.+?)$":{gettext:'Unable to get system option: "{{option}}".',placeholders:{option:"$2"}},"^Write failed with error code 16733 and error message 'trying to index text where term list is too big, max is 4mb _id: \"(.+?)\"'$":{gettext:"The uploaded image cannot be bigger than 4 MB. Please upload a smaller one."},"^Write failed with error code 17280 and error message 'WiredTigerIndex::insert: key too large to index, failing (.+?) { : \"(.+?)\" }'$":{gettext:"The chosen name is too long. Please try a shorter one."},"^You have reached devices limit. No more devices can be registered.$":{gettext:"You reached devices limit. No more devices can be registered."},'^(.+) succeeded for volume "(.+)"':{gettext:'Operation "{{operation}}" succeeded for volume "{{volume}}".',placeholders:{operation:"$1",volume:"$2"}},"^Exception on tenant (.+) in statement '(.+)': Invocation exception when invoking method '(.+)' of class '(.+)' passing parameters \\[(.+)\\] for statement '(.+)': (.+) : (.+)$":{gettext:'Exception on tenant {{tenantId}} in statement "{{moduleName}}": Invocation exception when invoking method "{{methodName}}" of class "{{classPath}}" passing parameters [{{parameters}}] for statement "{{statement}}": {{exceptionType}} : {{exceptionMessage}}.',placeholders:{tenantId:"$1",moduleName:"$2",methodName:"$3",classPath:"$4",parameters:"$5",statement:"$6",exceptionType:"$7",exceptionMessage:"$8"}},"^No nodes are available that match all of the predicates: (.+).$":{gettext:"No nodes are available that match all of the predicates: [{{predicates}}].",placeholders:{predicates:"$1"}},"^Readiness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\(Client.Timeout exceeded while awaiting headers\\)$":{gettext:"Readiness probe failed: {{requestMethod}} {{uri}}: {{protocol}}: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).",placeholders:{requestMethod:"$1",uri:"$2",protocol:"$3"}},"^Liveness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\(Client.Timeout exceeded while awaiting headers\\)$":{gettext:"Liveness probe failed: {{requestMethod}} {{uri}}: {{protocol}}: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).",placeholders:{requestMethod:"$1",uri:"$2",protocol:"$3"}},"^Error syncing pod$":{gettext:"Pod synchronization error."},"^Failed create pod sandbox.$":{gettext:"Pod sandbox creation failed."},'^Exception on tenant (.+) in statement \'(.+)\': Http status code: (\\d+) \\{error="alarm/Unprocessable Entity",message="(.+)",info="https://www.cumulocity.com/guides/reference-guide/#error_reporting",details="null"\\}$':{gettext:'Exception on tenant {{tenantId}} in statement "{{statement}}": HTTP status code: {{httpStatusCode}} : {{message | translate}}',placeholders:{tenantId:"$1",statement:"$2",httpStatusCode:"$3",message:"$4"}},"^User '(.+)' is managed by a remote identity management service defined by an administrator, direct update is forbidden$":{gettext:'User "{{userName}}" is managed by a remote identity management service defined by an administrator, direct update is forbidden.',placeholders:{userName:"$1"}},'^Added new child device to "(.+)" \\(ID: (.+)\\).$':{gettext:'Added new child device to "{{parentDeviceName}}" (ID: {{parentDeviceId}}).',placeholders:{parentDeviceName:"$1",parentDeviceId:"$2"}},'^Updated child device of "(.+)" \\(ID: (.+)\\).$':{gettext:'Updated child device of "{{parentDeviceName}}" (ID: {{parentDeviceId}}).',placeholders:{parentDeviceName:"$1",parentDeviceId:"$2"}},'^Added child device "(.+)" \\(ID: (.+)\\).$':{gettext:'Added child device "{{name}}" (ID: {{id}}).',placeholders:{name:"$1",id:"$2"}},'^Removed child device "(.+)" \\(ID: (.+)\\).$':{gettext:'Removed child device "{{name}}" (ID: {{id}}).',placeholders:{name:"$1",id:"$2"}},'^Change value of "(.+)" to (.+) (.+).$':{gettext:'Change value of "{{name}}" to {{value}}{{unit}}.',placeholders:{name:"$1",value:"$2",unit:"$3"}},'^Change value of "(.+)" to (.+).$':{gettext:'Change value of "{{name}}" to {{value}}.',placeholders:{name:"$1",value:"$2"}},'^Change status of "(.+)" to "(.+)".$':{gettext:'Change status of "{{name}}" to "{{label}}".',placeholders:{name:"$1",label:"$2"}},'^Send message "(.+)".$':{gettext:'Send message "{{str}}".',placeholders:{str:"$1"}},"^Close relay (.+).$":{gettext:"Close relay {{number}}.",placeholders:{number:"$1"}},"^Open relay (.+).$":{gettext:"Open relay {{number}}.",placeholders:{number:"$1"}},"^Change trace status to (.+).$":{gettext:"Change trace status to {{state | translate}}.",placeholders:{state:"$1"}},"^Change relay status to (.+).$":{gettext:"Change relay status to {{status | translate}}.",placeholders:{status:"$1"}},"^Closing relay (.+).$":{gettext:"Closing relay {{number}}.",placeholders:{number:"$1"}},"^Opening relay (.+).$":{gettext:"Opening relay {{number}}.",placeholders:{number:"$1"}},"^Update bulk operation$":{gettext:"Update bulk operation"},"^Update bulk operation: (.+)$":{gettext:"Update bulk operation: {{updatesList}}",placeholders:Wc},'^Update firmware to: "?(.+?)"? \\(version: (.+)\\)\\.?$':{gettext:'Update firmware to: "{{ name }}" (version: {{ version }})',placeholders:{name:"$1",version:"$2"}},'^Update firmware to: "?(.+?)"?\\.?$':{gettext:'Update firmware to: "{{ name }}"',placeholders:{name:"$1"}},"^Update configuration to (.+).$":{gettext:"Update configuration to: {{ name }}.",placeholders:{name:"$1"}},"^Apply device profile: (.+).?$":{gettext:"Apply device profile: {{ name }}",placeholders:{name:"$1"}},"^Execute generic command: (.+).?$":{gettext:"Execute generic command: {{command}}",placeholders:{command:"$1"}},"^Failed to refresh application. : Cannot refresh non local-hosted application.$":{gettext:"Could not reactivate the application as it is not hosted locally."},"^Failed to refresh application. : Cannot refresh application without active version id.$":{gettext:"Could not reactivate the application as it has no active version."},"^Scaled down replica set (.+) to (\\d+)$":{gettext:'Replica set "{{replicaSetName}}" scaled down to "{{scaleNumber}}".',placeholders:{replicaSetName:"$1",scaleNumber:"$2"}},"^Deleted pod: (.+)$":{gettext:'Pod "{{imageName}}" deleted.',placeholders:{imageName:"$1"}},'^Container image "(.+)" already present on machine$':{gettext:'Container image "{{imageName}}" already exists.',placeholders:{imageName:"$1"}},"^Error updating tenant! Cannot insert second configuration for Password code grant internal/Bad Request$":{gettext:"This login mode was already set by another administrator. Refresh the page to update the data."}},Zc=function(){function e(){this.cachedDictionary={}}return e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"})],e)}(),Jc=function(){function e(e,t,n,a,o){void 0===a&&(a=null),void 0===o&&(o=null),this.http=e,this.optionsService=t,this.cachedLocaleDictionaryService=n,this.path=a,this.languages=o}return e.prototype.getTranslation=function(e){var t=this,n=""+(this.path||"")+e+".json";return this.languages&&this.languages[e]&&this.languages[e].url&&(n=this.languages[e].url),this.http.get(n).pipe(o.map((function(n){return t.optionsService.langsDetails&&t.optionsService.langsDetails[e]?bc({},n[e],t.optionsService.langsDetails[e]):n[e]})),o.tap((function(n){t.cachedLocaleDictionaryService.cachedDictionary[e]=n})),o.map((function(e){return t.getDictionaryWithTrimmedKeys(e)})),o.catchError((function(){return a.of({})})))},e.prototype.getDictionaryWithTrimmedKeys=function(e){return s.mapKeys(e,(function(e,t){return Xc(t)}))},e.ctorParameters=function(){return[{type:d.HttpClient},{type:$c},{type:Zc},{type:String,decorators:[{type:t.Inject,args:[Gc]}]},{type:void 0,decorators:[{type:t.Inject,args:[Bc]}]}]},e=jc([t.Injectable(),wc(3,t.Inject(Gc)),wc(4,t.Inject(Bc))],e)}();function Xc(e){return e.replace(/(\r\n|\n|\r)/gm,"").replace(/\s{2,}/g," ").trim()}var Qc=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return vc(n,e),n.prototype.getValue=function(e,t){var n=Xc(t),a=s.get(e,[n]);a||t.split(".").length>1&&(a=s.get(e,t));return a},n=jc([t.Injectable()],n)}(p.TranslateDefaultParser),eu=function(e){function n(n,a,o){var s=e.call(this,n,a,o)||this;return s.htmlUpdateEvent=new t.EventEmitter,s}return vc(n,e),Object.defineProperty(n.prototype,"_elementRef",{get:function(){return this.element},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_translateService",{get:function(){return this.translateService},enumerable:!0,configurable:!0}),n.prototype.checkNodes=function(t,n){void 0===t&&(t=!1),this.isElementSimpleTextType()||this.isElementInnerHtmlEmpty()?e.prototype.checkNodes.call(this,t,n):(this.isLookupKeyMissing()&&(this._elementRef.nativeElement.lookupKey=this.getLookupKey()),this.translateAndUpdateHtmlContent(),this.htmlUpdateEvent.emit())},n.prototype.ngOnDestroy=function(){this.htmlUpdateEvent.complete(),e.prototype.ngOnDestroy.call(this)},n.prototype.getLookupKey=function(){return this._elementRef.nativeElement.innerHTML.replace(/<!--.*?-->/gs,"").trim()},n.prototype.isElementSimpleTextType=function(){return 1===this._elementRef.nativeElement.childNodes.length&&3===this._elementRef.nativeElement.childNodes[0].nodeType},n.prototype.isElementInnerHtmlEmpty=function(){return!this._elementRef.nativeElement.innerHTML},n.prototype.isLookupKeyMissing=function(){return!this._elementRef.nativeElement.lookupKey},n.prototype.lookupKeyExist=function(){return this._elementRef.nativeElement.lookupKey},n.prototype.translateAndUpdateHtmlContent=function(){this.lookupKeyExist()&&(this._elementRef.nativeElement.innerHTML=this._translateService.instant(this._elementRef.nativeElement.lookupKey,this.currentParams||{}))},n.ctorParameters=function(){return[{type:p.TranslateService},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},n=jc([t.Directive({selector:"[translate],[ngx-translate]"})],n)}(p.TranslateDirective),tu=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return vc(n,e),n=jc([t.Injectable(),t.Pipe({name:"translate",pure:!1})],n)}(p.TranslatePipe),nu=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return vc(n,e),n=jc([t.NgModule({declarations:[tu,eu],exports:[tu,eu]})],n)}(p.TranslateModule);try{require("@c8y/ngx-components/locales/de.po"),require("@c8y/ngx-components/locales/en.po"),require("@c8y/ngx-components/locales/es.po"),require("@c8y/ngx-components/locales/fr.po"),require("@c8y/ngx-components/locales/ja_JP.po")}catch(e){}var au={en:"en-GB","en-EN":"en-GB"};function ou(e,t,n,a,o){return new Jc(e,t,n,a,o)}function su(e){return e.localePath}function ru(e){return e.languages}function lu(e){return{get lang(){return iu(e.state.lang||"en")},toLowerCase:function(){return this.lang.toLowerCase()},toString:function(){return this.lang}}}function iu(e){return au[e]||e}var cu=function(){function e(){}var n;return n=e,e.providers=function(){return[{provide:t.LOCALE_ID,useFactory:lu,deps:[Uc]},{provide:Hc,useValue:Yc,multi:!0},{provide:Gc,useFactory:su,deps:[$c]},{provide:Bc,useFactory:ru,deps:[$c]},{provide:p.TranslateLoader,useFactory:ou,deps:[d.HttpClient,$c,Zc,Gc,Bc]},{provide:p.TranslateCompiler,useClass:p.TranslateFakeCompiler},{provide:p.TranslateParser,useClass:Qc},{provide:p.MissingTranslationHandler,useClass:Vc},p.TranslateStore,p.TranslateService,{provide:p.USE_STORE,useValue:void 0},{provide:p.USE_DEFAULT_LANG,useValue:void 0},{provide:p.USE_EXTEND,useValue:!1},{provide:p.DEFAULT_LANGUAGE,useValue:void 0}]},e.forRoot=function(){return{ngModule:n,providers:n.providers()}},e=n=jc([t.NgModule({exports:[nu],imports:[d.HttpClientModule]})],e)}();function uu(e){var t=e.split(/\n/).map((function(e){return e.trim()})).filter(Boolean).filter((function(e){return!e.match(/^\/?\*/)&&!e.match(/^\/\//)})).join("\n");return new Function("var exports = {};\nvar module = { exports: exports };\n"+t+"\nreturn exports;")()}var du=new Map;function pu(e){return new Promise((function(t,n){du.has(e)?t(du.get(e)):fetch("assets/locales/angular/"+e+".js").then((function(e){return e.text()})).then((function(n){var a=uu(n);du.set(e,a),t(a)})).catch(n)}))}var mu=function(){function e(e,t,n){var a=this;this.ngxTranslate=e,this.ui=t,this.options=n,this.langsDetail=this.options.get("languages",{}),this.langs=s.keys(this.langsDetail).filter((function(e){return a.langsDetail[e]})),this.DEFAULT_SEPARATOR="_";var o=this.queryStringLang();o&&this.saveInLocalStorage(o)}var n;return n=e,e.defaultLang=function(){return window.localStorage.getItem(n.SAVE_LANGUAGE_KEY)},e.prototype.switchToLanguage=function(e){return Sc(this,void 0,void 0,(function(){var t,n,a;return Cc(this,(function(o){switch(o.label){case 0:t=e.replace("_","-"),o.label=1;case 1:return o.trys.push([1,3,,7]),[4,this.loadLocales(t)];case 2:return o.sent(),[3,7];case 3:return n=o.sent(),(a=t.split("-").shift())===t?[3,5]:[4,this.loadLocales(a)];case 4:return o.sent(),[3,6];case 5:throw n;case 6:return[3,7];case 7:return this.setLanguage(e),[2]}}))}))},e.prototype.loadLocales=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return[4,pu(iu(e))];case 1:return t=n.sent(),i.registerLocaleData(t.default),[2]}}))}))},e.prototype.setLanguage=function(e){var t=this;this.ngxTranslate.setDefaultLang(this.options.get("defaultLanguage","en")),this.ngxTranslate.use(e).subscribe((function(){t.ui.state$.next(bc({},t.ui.state,{lang:e}))}))},e.prototype.firstSupportedLanguage=function(){var e=this,t=[this.queryStringLang(),this.localStorageLang()].concat([this.options.get("defaultLanguage")]).concat(this.browserLangs()).concat(["en"]).filter(Boolean).map((function(e){return e.toLowerCase()})).find((function(t){return e.getSupported(t)}));return this.getSupported(t)},e.prototype.convertToLanguageCodePO=function(e){var t=e.indexOf("-")>-1?"-":this.DEFAULT_SEPARATOR,n=Pc(e.split(t),2),a=n[0],o=n[1];return""+a+(o?""+this.DEFAULT_SEPARATOR+o:"")},e.prototype.getNativeLanguage=function(e){return((this.langsDetail||{})[e]||{}).nativeName||e},e.prototype.saveInLocalStorage=function(e){window.localStorage.setItem(n.SAVE_LANGUAGE_KEY,e)},e.prototype.getSupported=function(e){var t=this,n=this.langs.find((function(t){return t.toLowerCase()===e}));return n||this.langs.find((function(n){return t.getLessSpecific(n.toLowerCase())===t.getLessSpecific(e)||n.startsWith(e)}))},e.prototype.queryStringLang=function(){return this.getQueryParameter("lang")},e.prototype.getLessSpecific=function(e){return s.isString(e)?e.replace("-",this.DEFAULT_SEPARATOR).split(this.DEFAULT_SEPARATOR)[0]:""},e.prototype.localStorageLang=function(){return window.localStorage.getItem(n.SAVE_LANGUAGE_KEY)},e.prototype.browserLangs=function(){var e=window.navigator;return["languages","language","browserLanguage","systemLanguage","userLanguage"].reduce((function(t,n){var a=e[n];return"string"==typeof a?t.push(a):Array.isArray(a)&&(t=t.concat(a)),t}),[])},e.prototype.getQueryParameter=function(e){var t;return window.location.search.substring(1).split("&").find((function(n){var a=Pc(n.split("="),2),o=a[0],s=a[1];return o===e&&(t=s),t})),t},e.SAVE_LANGUAGE_KEY="c8y_language",e.ctorParameters=function(){return[{type:p.TranslateService},{type:Uc},{type:$c}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(p.TranslateService),t.ɵɵinject(Uc),t.ɵɵinject($c))},token:e,providedIn:"root"}),e=n=jc([t.Injectable({providedIn:"root"})],e)}(),hu=function(e){function n(t,n){var a=e.call(this,t)||this;return a.translateService=n,a}return vc(n,e),n.prototype.transform=function(t,n,a,o){void 0===n&&(n="medium");var s=t,r=!1,l=!1;"number"!=typeof t||isNaN(t)||(s=Math.min(t,864e13),s=Math.max(s,-864e13),r=t<-864e13,l=t>864e13);var i=e.prototype.transform.call(this,s,n,a,o);return r?i=this.translateService.instant("before {{date}}",{date:i}):l&&(i=this.translateService.instant("after {{date}}",{date:i})),i},n.ctorParameters=function(){return[{type:String,decorators:[{type:t.Inject,args:[t.LOCALE_ID]}]},{type:p.TranslateService}]},n=jc([t.Pipe({name:"c8yDate"}),wc(0,t.Inject(t.LOCALE_ID))],n)}(i.DatePipe),fu=function(){function e(e){this.element=e,this.useIntersection=!0,this.hidden=!1,this.class="c8y-list__item p-0",this.maxIterations=10,this.hideNoMoreDataHint=!1,this.onLoad=new t.EventEmitter,this.isLoading=!1,this.counter=0,this.hasNoMoreData=!1,this.LOAD_SAME_PAGE_THRESHOLD=50,this.destroyed=!1}return Object.defineProperty(e.prototype,"hostClass",{get:function(){return this.hidden||!this.hasMore&&!this.hasNoMoreData?"":this.class},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasMore",{get:function(){return this.paging&&(this.paging.totalPages>this.paging.currentPage||!!this.paging.nextPage)},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this.destroyed=!1,this.useIntersection&&"IntersectionObserver"in window&&(this.intersectionObserver=new IntersectionObserver((function(t){return e.buttonInView(t[0])}),{root:this.container?this.container.nativeElement:null}),this.intersectionObserver.observe(this.element.nativeElement)),this.hasNoMoreData=this.shouldShowNoMoreDataHint()},e.prototype.ngOnDestroy=function(){this.destroyed=!0,this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver.unobserve(this.element.nativeElement),clearTimeout(this.loadUntilIntersected))},e.prototype.loadMore=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return this.destroyed?[3,3]:(this.isLoading=!0,e&&e.stopPropagation(),this.hasMore?[4,this.paging.next()]:[3,2]);case 1:return t=n.sent(),this.paging=t.paging,this.onLoad.emit(t.data),this.intersectionLoading(),this.hasNoMoreData=this.shouldShowNoMoreDataHint(),[3,3];case 2:this.counter=0,this.isLoading=!1,n.label=3;case 3:return[2]}}))}))},e.prototype.intersectionLoading=function(){var e=this;this.useIntersection&&this.hasMore&&null!==this.loadUntilIntersected?(this.loadUntilIntersected=setTimeout((function(){return e.loadMore()}),this.getLoadingThreshold()),this.useIntersection=this.shouldSwitchMode()):(this.isLoading=!1,this.loadUntilIntersected=void 0)},e.prototype.getLoadingThreshold=function(){return this.LOAD_SAME_PAGE_THRESHOLD*this.counter++},e.prototype.shouldShowNoMoreDataHint=function(){return(0!==this.counter||this.noMoreDataHint)&&!this.hasMore&&!this.hidden},e.prototype.shouldSwitchMode=function(){return this.counter<this.maxIterations||this.hidden},e.prototype.buttonInView=function(e){e.isIntersecting?this.loadMore():this.loadUntilIntersected?(clearTimeout(this.loadUntilIntersected),this.loadUntilIntersected=null,this.isLoading=!1):this.loadUntilIntersected=null},e.ctorParameters=function(){return[{type:t.ElementRef}]},jc([t.Input()],e.prototype,"paging",void 0),jc([t.Input()],e.prototype,"useIntersection",void 0),jc([t.Input()],e.prototype,"hidden",void 0),jc([t.Input()],e.prototype,"container",void 0),jc([t.Input()],e.prototype,"class",void 0),jc([t.Input()],e.prototype,"maxIterations",void 0),jc([t.Input()],e.prototype,"noMoreDataHint",void 0),jc([t.Input()],e.prototype,"loadingTemplate",void 0),jc([t.Input()],e.prototype,"hideNoMoreDataHint",void 0),jc([t.Input()],e.prototype,"loadNextLabel",void 0),jc([t.Input()],e.prototype,"loadingLabel",void 0),jc([t.Output()],e.prototype,"onLoad",void 0),jc([t.HostBinding("class")],e.prototype,"hostClass",null),e=jc([t.Component({selector:"c8y-load-more",template:'<button\n class="btn btn-default btn-block text-center"\n (click)="loadMore($event)"\n [ngClass]="{ \'btn-pending\': isLoading }"\n *ngIf="hasMore && !(loadingTemplate && isLoading)"\n [style.visibility]="hidden ? \'hidden\' : \'visible\'"\n [style.height]="hidden ? \'1px\' : null"\n title="{{ \'Load more\' | translate }}"\n>\n <ng-container *ngIf="!isLoading">\n <span *ngIf="loadNextLabel; else loadPage" [innerHTML]="loadNextLabel | translate"></span>\n <ng-template #loadPage>\n <span translate ngNonBindable [translateParams]="{ pageNo: paging.currentPage + 1 }">\n Load page {{ pageNo }}</span\n >\n </ng-template>\n </ng-container>\n <ng-container *ngIf="isLoading">\n <span *ngIf="loadingLabel; else loading" [innerHTML]="loadingLabel | translate"></span>\n <ng-template #loading>\n <span translate ngNonBindable [translateParams]="{ pageNo: paging.currentPage + 1 }">\n Page {{ pageNo }} is loading…\n </span>\n </ng-template>\n </ng-container>\n</button>\n\n<ng-container *ngIf="hasNoMoreData && !hideNoMoreDataHint && !isLoading">\n <ng-container *ngTemplateOutlet="noMoreDataHint || finishHint"></ng-container>\n</ng-container>\n\n<ng-template #finishHint>\n <div class="legend form-block center last-record" title="{{ \'Last record\' | translate }}">\n <i [c8yIcon]="\'circle\'"></i>\n </div>\n</ng-template>\n\n<ng-container *ngIf="loadingTemplate && isLoading">\n <ng-container *ngTemplateOutlet="loadingTemplate"></ng-container>\n</ng-container>\n'})],e)}(),gu=function(){function e(e,t,n){this.tpl=e,this.vcr=t,this.componentFactoryResolver=n,this.cachedData=[],this.loadMoreMode="auto",this.dataPipe=a.pipe(o.tap()),this.maxIterations=10,this.unsubscribe$=new a.Subject}return Object.defineProperty(e.prototype,"shouldUseLoadMoreButton",{get:function(){return"auto"===this.loadMoreMode||"show"===this.loadMoreMode||"hidden"===this.loadMoreMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasMoreData",{get:function(){return this.loadMore&&this.loadMore.hasMore},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.cachedData.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForOf",{set:function(e){var t=this;e&&(this.obs$=(a.isObservable(e)?e:a.of(e)).pipe(o.map((function(e){if(null===e)return t.paging=null,[];var n=e.paging,a=e.data;return t.paging=n,a}))))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForLoadMore",{set:function(e){this.loadMoreMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForPipe",{set:function(e){e&&(this.dataPipe=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForNotFound",{set:function(e){this.notFoundTemplate=e,this.loadMore&&(this.loadMore.noMoreDataHint=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForMaxIterations",{set:function(e){this.maxIterations=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForLoadingTemplate",{set:function(e){this.loadingTemplate=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForLoadNextLabel",{set:function(e){this.loadNextLabel=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForRealtime",{set:function(e){this.realtime=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForComparator",{set:function(e){this.comparator=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.handleRealtime()},e.prototype.ngOnChanges=function(e){var t=this;if(this.obs$&&(e.c8yForPipe||e.c8yForOf)){this.unsubscribePaging();var n=!this.hasMoreData&&!!e.c8yForPipe&&!e.c8yForOf;n&&(this.obs$=a.of(this.cachedData)),this.pagingSub=this.obs$.pipe(o.tap((function(e){n||(t.cachedData=e)}))).pipe((function(e){return t.dataPipe(e)})).subscribe((function(e){t.render(e,n)}))}},e.prototype.ngOnDestroy=function(){this.unsubscribePaging(),this.unsubscribe$.next(),this.unsubscribe$.complete()},e.prototype.handleRealtime=function(){var e=this;this.realtime&&(this.realtime.onCreate$().pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(t){return e.insert(t)})),this.realtime.onUpdate$().pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(t){return e.update(t)})),this.realtime.onDelete$().pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(t){return e.remove(ec.coerceNumberProperty(t))})))},e.prototype.render=function(e,t){var n=this;void 0===t&&(t=!1),this.vcr.clear(),e.forEach((function(e,t){var a={$implicit:e,index:t,length:n.length,hasMore:n.hasMoreData,loadMoreComponent:n.loadMore};n.vcr.createEmbeddedView(n.tpl,a)})),this.shouldUseLoadMoreButton&&(this.loadMore=this.createLoadMoreButtonComponent(t))},e.prototype.append=function(e){var t=this;e.forEach((function(e){var n=t.shouldUseLoadMoreButton?t.vcr.length-1:t.vcr.length,a={$implicit:e,index:n,length:t.length,hasMore:t.hasMoreData,loadMoreComponent:t.loadMore};t.vcr.createEmbeddedView(t.tpl,a,n)}))},e.prototype.loadMoreData=function(e){e.length>0&&this.append(e)},e.prototype.createLoadMoreButtonComponent=function(e){var t=this,n=this.componentFactoryResolver.resolveComponentFactory(fu),a=this.vcr.createComponent(n).instance;return a.paging=this.paging,a.useIntersection="auto"===this.loadMoreMode||"hidden"===this.loadMoreMode,a.hidden="hidden"===this.loadMoreMode,a.maxIterations=this.maxIterations,a.noMoreDataHint=this.notFoundTemplate,a.loadingTemplate=this.loadingTemplate,a.loadNextLabel=this.loadNextLabel,this.pagingSub=a.onLoad.pipe(o.map((function(e){return t.checkForDuplicates(e)})),o.tap((function(e){t.cachedData=t.cachedData.concat(e)}))).pipe((function(e){return t.dataPipe(e)})).subscribe((function(e){return t.loadMoreData(e)})),e&&s.assign(a,this.loadMore),a},e.prototype.insert=function(e){var t=0;if(this.comparator&&this.cachedData.length){var n=void 0;do{var a=this.vcr.get(t),o=s.get(a,"context.$implicit");(n=e&&o?this.comparator(e,o):0)<=0&&t++}while(n<=0&&t<this.cachedData.length)}if(t<this.cachedData.length||0===this.cachedData.length){var r={$implicit:e,index:t,length:this.length,hasMore:this.hasMoreData};this.cachedData.splice(t,0,e);var l=this.tpl.createEmbeddedView(r);this.vcr.insert(l,t)}},e.prototype.update=function(e){this.forMatchingEmbeddedViewRef((function(t){return t&&e&&t.id===e.id}),(function(t){t.context.$implicit=e,t.markForCheck()}))},e.prototype.remove=function(e){this.forMatchingEmbeddedViewRef((function(t){return t&&ec.coerceNumberProperty(t.id,NaN)===e}),(function(e){return e.destroy()}))},e.prototype.forMatchingEmbeddedViewRef=function(e,t){for(var n=0;n<this.vcr.length;n++){var a=this.vcr.get(n);e(s.get(a,"context.$implicit"))&&t(a)}},e.prototype.checkForDuplicates=function(e){var t=this;return this.realtime?e.filter((function(e){return!t.cachedData.some((function(t){return t.id===e.id}))})):e},e.prototype.unsubscribePaging=function(){this.pagingSub&&this.pagingSub.unsubscribe()},e.ctorParameters=function(){return[{type:t.TemplateRef},{type:t.ViewContainerRef},{type:t.ComponentFactoryResolver}]},jc([t.Input()],e.prototype,"c8yForOf",null),jc([t.Input()],e.prototype,"c8yForLoadMore",null),jc([t.Input()],e.prototype,"c8yForPipe",null),jc([t.Input()],e.prototype,"c8yForNotFound",null),jc([t.Input()],e.prototype,"c8yForMaxIterations",null),jc([t.Input()],e.prototype,"c8yForLoadingTemplate",null),jc([t.Input()],e.prototype,"c8yForLoadNextLabel",null),jc([t.Input()],e.prototype,"c8yForRealtime",null),jc([t.Input()],e.prototype,"c8yForComparator",null),e=jc([t.Directive({selector:"[c8yFor]"})],e)}(),yu=function(){function e(e){this.translateService=e,this.internalApps={administration:"Administration",cockpit:"Cockpit",devicemanagement:"Device management"}}return e.prototype.transform=function(e){void 0===e&&(e="Cumulocity");var t,n=this.getAppName(e);return t=this.isPublicApp(e)?"{{ appName | translate }} (public)":n,this.translateService.stream(t,{appName:n})},e.prototype.getAppName=function(e){var t=this.getFirstDefined([tc.get(e,"name"),tc.get(e,"contextPath"),e])||"";return this.internalApps[t]||t},e.prototype.getFirstDefined=function(e){return tc.find(e,tc.negate(tc.isUndefined))},e.prototype.isPublicApp=function(e){return Boolean(tc.get(e,"public"))},e.ctorParameters=function(){return[{type:p.TranslateService}]},e=jc([t.Pipe({name:"humanizeAppName"})],e)}(),vu=function(){function e(){}var n;return n=e,e.humanize=function(e){return void 0===e&&(e=""),e=e.replace(/\./g," ").replace(/c8y[\s,_]*/gi,"").replace(/_/g," ").replace(/([A-Z][a-z])/g," $1").replace(/^\$\.?/,"").replace(/^\s*/,"").replace(/\s*$/,"").replace(/\s+/g," "),s.upperFirst(e)},e.prototype.transform=function(e){return n.humanize(e)},e=n=jc([t.Pipe({name:"humanize"})],e)}(),bu=function(){function e(e,t){this.el=e,this.renderer=t,this.c8yMatch=/^c8y-/,this.klasses=[],this.currentClasses=""}return Object.defineProperty(e.prototype,"c8yIcon",{set:function(e){this.updateIcon(e)},enumerable:!0,configurable:!0}),e.prototype.isC8y=function(e){return this.c8yMatch.test(e)},e.prototype.getClasses=function(e){void 0===e&&(e="");var t="";if(e){var n=e.trim(),a=this.isC8y(n);t=(a?"c8y-icon":"")+" "+(a?n.replace(this.c8yMatch,"c8y-icon-"):"dlt-c8y-icon-"+n)}return t},e.prototype.updateIcon=function(e){var t=this,n=this.getClasses(e);n!==this.currentClasses&&(this.currentClasses.split(/\s/).filter((function(e){return e})).forEach((function(e){t.renderer.removeClass(t.el.nativeElement,e)})),n.split(/\s/).filter((function(e){return e})).forEach((function(e){t.renderer.addClass(t.el.nativeElement,e)})),this.currentClasses=n)},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},jc([t.Input()],e.prototype,"c8yIcon",null),e=jc([t.Directive({selector:"[c8yIcon]"})],e)}(),ju=["home","th","bar-chart-o","tasks","tachometer","bell","puzzle-piece","map-marker","location-arrow","globe","power-off","desktop","laptop","mobile","signal","qrcode","file","file-text","folder","folder-open","archive","ssd","book","bookmark","tag","flag","search","heart","star","bolt","cog","cogs","wrench","ban","user","users","sign-in","sign-out","upload","download","cloud-upload","cloud-download","cloud","hourglass","refresh","repeat","undo","lock","unlock","info","question-circle","exclamation-circle","bug","calendar","random","asterisk","key","link","chain-broken","external-link","picture-o","comment","bullhorn","phone","lightbulb-o","flask","cloud-network","exchange","code-fork","keyboard-o","terminal","code","clipboard","pencil","envelope","inbox","reply","share","thumbs-up","thumbs-down","check","plus","expand","compress","arrows","arrow-up","arrow-down","arrow-left","arrow-right","th-list","bars","table","columns","filter","sort","sort-up","sort-down","ellipsis-h","ellipsis-v","rss"];function wu(e){return function(t,n,a){var o=a.value;a.value=function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];var r="_"+n+"Memoized";return this[r]||(this[r]=s.memoize(o,e)),this[r].apply(this,t)}}}var Su=function(){function e(e,t,n){this.appState=e,this.inventory=t,this.user=n}return e.prototype.canEdit=function(e,t){return this.checkIfCanEdit(e,t)},e.prototype.hasRole=function(e){var t=this.appState.currentUser.value;if(!t)throw new Error("Roles can only be requested if the user is logged in.");return this.user.hasRole(t,e)},e.prototype.hasAllRoles=function(e){var t=this.appState.currentUser.value;if(!t)throw new Error("Roles can only be requested if the user is logged in.");return this.user.hasAllRoles(t,e)},e.prototype.hasAnyRole=function(e){var t=this.appState.currentUser.value;if(!t)throw new Error("Roles can only be requested if the user is logged in.");return this.user.hasAnyRole(t,e)},e.prototype.checkIfOwner=function(e){return Sc(this,void 0,void 0,(function(){var t,n,a;return Cc(this,(function(o){switch(o.label){case 0:return[4,this.appState.currentUser.value.userName];case 1:return t=o.sent(),[4,this.inventory.detail(e.id)];case 2:return n=o.sent(),a=n.data,n.res,[2,t===a.owner]}}))}))},e.prototype.checkWithRequest=function(e){var t=e.name,n={id:e.id,name:t};return this.inventory.update(n).then((function(e){return!0})).catch((function(e){return!1}))},e.prototype.checkIfCanEdit=function(e,t){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(n){switch(n.label){case 0:return[4,this.hasAnyRole(e)];case 1:return n.sent()?[2,!0]:[3,2];case 2:return[4,this.checkIfOwner(t)];case 3:return n.sent()?[2,!0]:[3,4];case 4:return[4,this.checkWithRequest(t)];case 5:if(n.sent())return[2,!0];n.label=6;case 6:return[2,!1]}}))}))},e.ctorParameters=function(){return[{type:Uc},{type:m.InventoryService},{type:m.UserService}]},jc([wu(s.property("id"))],e.prototype,"checkIfOwner",null),jc([wu(s.property("id"))],e.prototype,"checkWithRequest",null),e=jc([t.Injectable()],e)}(),Cu=function(){function e(e,t,n){this.template=e,this.container=t,this.permissions=n,this.allowAny=!1}return Object.defineProperty(e.prototype,"c8yIfAllowed",{set:function(e){this.rolesIds=Array.isArray(e)?e:e?[e]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yIfAllowedAllowAny",{set:function(e){this.allowAny=null===e||e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.rolesIds&&this.rolesIds.length&&!(this.allowAny?this.permissions.hasAnyRole(this.rolesIds):this.permissions.hasAllRoles(this.rolesIds))||this.container.createEmbeddedView(this.template)},e.ctorParameters=function(){return[{type:t.TemplateRef},{type:t.ViewContainerRef},{type:Su}]},jc([t.Input()],e.prototype,"c8yIfAllowed",null),jc([t.Input()],e.prototype,"c8yIfAllowedAllowAny",null),e=jc([t.Directive({selector:"[c8yIfAllowed]"})],e)}(),Iu=function(){function e(){}return e=jc([t.Component({selector:"c8y-loading",template:'\n <div class="p-24 p-relative d-inline-block" >\n <div class="spinner">\n <div class="rect1"></div>\n <div class="rect2"></div>\n <div class="rect3"></div>\n <div class="rect4"></div>\n <div class="rect5"></div>\n </div>\n </div>\n '})],e)}(),Pu=function(){function e(){}return e.prototype.transform=function(e,t,n){return t.apply(n||this,Array.isArray(e)?e:[e])},e=jc([t.Pipe({name:"map"})],e)}(),Ou=function(){function e(e,t,n,a){this.viewContainer=e,this.resolver=t,this.renderer=n,this.el=a,this.properties={}}return Object.defineProperty(e.prototype,"c8yOutlet",{set:function(e){if(e)if(this._element instanceof Element&&this.renderer.removeChild(this._element.parentElement,this._element),this.viewContainer.clear(),e instanceof t.TemplateRef)this.viewContainer.createEmbeddedView(e);else if(e instanceof Element){var n=this.renderer.parentNode(this.el.nativeElement);this.destroy(),this._element=e,this.renderer.insertBefore(n,this._element,this.el.nativeElement)}else{var a=this.resolver.resolveComponentFactory(e),o=this.viewContainer.createComponent(a);s.assign(o.instance,this.properties)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yOutletProperties",{set:function(e){this.properties=e},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.destroy()},e.prototype.destroy=function(){if(this._element){var e=this.renderer.parentNode(this._element);this.renderer.removeChild(e,this._element)}},e.ctorParameters=function(){return[{type:t.ViewContainerRef},{type:t.ComponentFactoryResolver},{type:t.Renderer2},{type:t.ElementRef}]},jc([t.Input()],e.prototype,"c8yOutlet",null),jc([t.Input()],e.prototype,"c8yOutletProperties",null),e=jc([t.Directive({selector:"[c8yOutlet]"})],e)}(),xu=function(){function e(){this.message="Loading…",this.progress=null}return jc([t.Input()],e.prototype,"message",void 0),jc([t.Input()],e.prototype,"progress",void 0),e=jc([t.Component({selector:"c8y-progress-bar",template:'<div>\n <p *ngIf="message">\n {{ message | translate }}\n </p>\n <div class="progress progress-striped active" *ngIf="progress !== null">\n <div\n class="progress-bar"\n role="progressbar"\n [attr.aria-valuenow]="progress"\n aria-valuemin="0"\n aria-valuemax="100"\n [style.width]="progress + \'%\'"\n ></div>\n </div>\n <div class="spinner p-relative" *ngIf="progress === null">\n <div class="rect1"></div>\n <div class="rect2"></div>\n <div class="rect3"></div>\n <div class="rect4"></div>\n <div class="rect5"></div>\n </div>\n</div>\n'})],e)}(),Eu=function(){function e(){}return e.prototype.transform=function(e){var t=e.firstName,n=void 0===t?"":t,a=e.lastName,o=void 0===a?"":a,s=e.userName,r=void 0===s?"":s,l=n.trim().split(/\s+/).shift().substr(0,1),i=o.trim().split(/\s+/).pop();return(l=i?l?l+". ":"":n.split(/\s+/).shift())||i?l+i:r},e=jc([t.Pipe({name:"shortenUserName"})],e)}(),ku=function(){function e(e,t){this.tenantService=e,this.applicationService=t}return e.prototype.isManagementTenant=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return[4,this.tenantService.current()];case 1:return[2,"management"===e.sent().data.name]}}))}))},e.prototype.isEnterpriseTenant=function(){return Sc(this,void 0,void 0,(function(){var e,t,n,a,o;return Cc(this,(function(s){switch(s.label){case 0:return[4,this.hasApp({name:"branding"})];case 1:return(t=s.sent())?[3,3]:[4,this.hasApp({name:"feature-branding"})];case 2:t=s.sent(),s.label=3;case 3:return e=t,[4,this.hasApp({name:"sslmanagement"})];case 4:return n=s.sent(),[4,this.hasApp({name:"feature-user-hierarchy"})];case 5:return a=s.sent(),[4,this.hasApp({name:"feature-broker"})];case 6:return o=s.sent(),[2,e&&n&&a&&o]}}))}))},e.prototype.hasApp=function(e){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){switch(t.label){case 0:return[4,this.applicationService.isAvailable(e)];case 1:return[2,t.sent().data]}}))}))},e.ctorParameters=function(){return[{type:m.TenantService},{type:m.ApplicationService}]},e=jc([t.Injectable()],e)}(),Tu=function(){function e(){this.LOCAL_STORAGE_KEY="userPreferences",this.store={};try{var e=window.localStorage.getItem(this.LOCAL_STORAGE_KEY);e&&(this.store=JSON.parse(e)||{})}catch(e){}}return e.prototype.get=function(e){return a.of(this.store[e])},e.prototype.set=function(e,t){return this.store[e]=t,this.saveJsonStore()},e.prototype.saveJsonStore=function(){return window.localStorage.setItem(this.LOCAL_STORAGE_KEY,JSON.stringify(this.store))},e}(),Au=function(){function e(e){this.inventory=e,this.TYPE="c8y_UserPreference"}return e.prototype.get=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return[4,this.inventory.list({fragmentType:e})];case 1:return[2,(t=n.sent().data).length?t[0][e]:void 0]}}))}))},e.prototype.set=function(e,t){return Sc(this,void 0,void 0,(function(){var n,a,o,s;return Cc(this,(function(r){switch(r.label){case 0:return[4,this.inventory.list({fragmentType:e})];case 1:return n=r.sent().data,(s={})[e]=t,s.type=this.TYPE,a=s,n.length?(a.id=n[0].id,o=this.inventory.update(a)):o=this.inventory.create(a),[2,o]}}))}))},e}(),_u=function(){function e(e,t,n){this.user=e,this.inventory=t,this.appState=n,this.LOCAL_STORAGE_KEY="userPreferences",this.storage={local:new Tu,inventory:new Au(this.inventory)},this.currentUser=this.appState.currentUser}return e.prototype.get=function(e){var t=this;return this.currentUser.pipe(o.first(),o.switchMap((function(n){return t.getForUser(e,n)})))},e.prototype.set=function(e,t){var n=this;return new Promise((function(a,s){n.currentUser.pipe(o.first()).subscribe((function(o){a(n.setForUser(e,t,o))}),s)}))},e.prototype.getForUser=function(e,t){var n=this.getRawKey(e,t),o=this.getStorage(t);return a.from(o.get(n))},e.prototype.setForUser=function(e,t,n){var a=this.getRawKey(e,n),o=this.getStorage(n);return Promise.resolve(o.set(a,t))},e.prototype.getRawKey=function(e,t){return""+e+t.userName.replace(/\./g,"__")},e.prototype.getStorage=function(e){return this.user.hasAllRoles(e,["ROLE_INVENTORY_READ","ROLE_INVENTORY_ADMIN"])?this.storage.inventory:this.storage.local},e.ctorParameters=function(){return[{type:m.UserService},{type:m.InventoryService},{type:Uc}]},e=jc([t.Injectable()],e)}();function Nu(e,t,n){return function(){var a=e.queryStringLang(),s=e.firstSupportedLanguage();a&&e.getSupported(a)?e.switchToLanguage(a):t.currentUser.pipe(o.map((function(e){return e&&e.userName})),o.filter((function(e){return!!e})),o.distinctUntilChanged(),o.switchMap((function(){return n.get("language")})),o.startWith(s),o.filter((function(e){return!!e})),o.distinctUntilChanged()).subscribe((function(t){e.switchToLanguage(t)}))}}var Du,Lu,Mu,Ru,qu,$u,Fu=new t.InjectionToken("iconList"),Uu=function(){function e(){}var n;return n=e,e.providers=function(){return Oc(c.DataModule.providers(),[{provide:qc,useValue:window.C8Y_APP||{},multi:!0},{provide:t.APP_INITIALIZER,useFactory:Nu,deps:[mu,Uc,_u],multi:!0},{provide:Fu,useValue:ju,multi:!1}],cu.providers(),[_u,$c,Uc,Su,ku,vu,yu,Eu,Pu,hu])},e.forRoot=function(){return{ngModule:n,providers:n.providers()}},e=n=jc([t.NgModule({imports:[i.CommonModule,cu,u.TooltipModule],exports:[bu,Ou,cu,i.CommonModule,yu,vu,Cu,Eu,gu,fu,Pu,xu,hu,Iu],declarations:[bu,Ou,vu,yu,Cu,Eu,gu,fu,Pu,xu,hu,Iu],entryComponents:[fu,Iu]})],e)}(),Bu=function(){function e(){this.navigatorOpen=!1,this.hasTabs=!1,this.isTabsHorizontal=!1,this.isPageToolbarExpanded=!1,this.uiActionBar=!0,this.items=[]}return Object.defineProperty(e.prototype,"hidden",{get:function(){return!(this.items&&this.items.length)},enumerable:!0,configurable:!0}),e.prototype.getSortedItems=function(e){return s.sortBy(s.filter(this.items,{placement:e}),this.byPriority)},e.prototype.byPriority=function(e){return-e.priority},jc([t.Input(),t.HostBinding("class.navigator-open")],e.prototype,"navigatorOpen",void 0),jc([t.Input(),t.HostBinding("class.has-tabs")],e.prototype,"hasTabs",void 0),jc([t.Input(),t.HostBinding("class.horizontal-tabs")],e.prototype,"isTabsHorizontal",void 0),jc([t.HostBinding("class.c8y-ui-action-bar")],e.prototype,"uiActionBar",void 0),jc([t.Input()],e.prototype,"items",void 0),jc([t.HostBinding()],e.prototype,"hidden",null),e=jc([t.Component({selector:"c8y-action-bar",template:'<div class="navbar-header">\n <button\n type="button"\n class="navbar-toggle collapsed"\n (click)="isPageToolbarExpanded = !isPageToolbarExpanded"\n >\n <span class="sr-only" translate>Toggle toolbar</span>\n <span class="icon-bar"></span>\n <span class="icon-bar"></span>\n <span class="icon-bar"></span>\n </button>\n</div>\n\n<div id="page-toolbar" class="navbar-collapse" [collapse]="!isPageToolbarExpanded">\n <ul class="nav navbar-nav navbar-left">\n <ng-container *ngFor="let item of getSortedItems(\'left\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n </ul>\n <ul class="nav navbar-nav navbar-right">\n <ng-container *ngFor="let item of getSortedItems(\'right\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n <li class="no-remove more-wrapper" *ngIf="getSortedItems(\'more\').length > 0">\n <div class="dropdown" dropdown>\n <button\n title="{{ \'More\' | translate }}…"\n class="dropdown-toggle c8y-dropdown d-flex"\n dropdownToggle\n aria-haspopup="true"\n aria-expanded="false"\n >\n <span class="text-truncate" translate>More…</span>\n <i [c8yIcon]="\'caret-down\'"></i>\n </button>\n <ul class="dropdown-menu dropdown-menu-right" *dropdownMenu>\n <ng-container *ngFor="let item of getSortedItems(\'more\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n </ul>\n <ul class="dropdown-menu visible-xs"> \n <ng-container *ngFor="let item of getSortedItems(\'more\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n </ul>\n </div>\n </li>\n </ul>\n</div>\n',host:{class:"c8y-ui-action-bar"}})],e)}(),Gu=function(){function e(){}return e=jc([t.NgModule({declarations:[Bu,Mc],imports:[l.BsDropdownModule,Uu,r.CollapseModule,n.RouterModule.forChild([])],exports:[Bu,Mc]})],e)}(),Hu=new t.InjectionToken("ActionFactory"),zu=function(e){function s(t,n){var s=e.call(this)||this;return s.injector=t,s.refreshTrigger=new a.Subject,s.state$=new a.BehaviorSubject(new Set),s.items$=xc(n,s.refreshTrigger,[function(){return s.injector.get(Hu,[])},Tc(s.state$)]).pipe(o.map((function(e){return Ac(e)})),o.shareReplay(1)),s}return vc(s,e),s.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),Vu=function(){function e(){this.isPageToolbarExpanded=!1,this.items=[]}return e.prototype.getByPriority=function(){return s.sortBy(this.items,this.byPriority)},e.prototype.invoke=function(e){e.action&&e.action.call()},e.prototype.byPriority=function(e){return-e.priority},jc([t.Input()],e.prototype,"items",void 0),e=jc([t.Component({selector:"c8y-action-outlet",template:'<div class="dropdown" dropdown *ngIf="items && items.length > 0">\n <button\n type="button"\n class="main-header-button dropdown-toggle c8y-dropdown"\n dropdownToggle\n aria-haspopup="true"\n aria-expanded="true">\n <i [c8yIcon]="\'plus-circle\'" class="icon-2x"></i>\n </button>\n\n <ul class="dropdown-menu cog-dropdown" *dropdownMenu>\n <ng-container *ngFor="let item of getByPriority()">\n <ng-container *c8yOutlet="item.template"></ng-container>\n <li *ngIf="item.label">\n <button title="{{ item.label | translate }}" [attr.disabled]="item.disabled ? \'disabled\' : null" (click)="invoke(item)">\n <i *ngIf="item.icon" [c8yIcon]="item.icon"></i>{{item.label | translate}}\n </button>\n </li>\n </ng-container>\n </ul>\n</div>\n'})],e)}(),Ku=function(){function e(e){this.actionService=e,this.disabled=!1,this.priority=0}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.actionService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.actionService.remove(this)},e.ctorParameters=function(){return[{type:zu}]},jc([t.Input()],e.prototype,"disabled",void 0),jc([t.Input()],e.prototype,"label",void 0),jc([t.Input()],e.prototype,"priority",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=jc([t.Component({selector:"c8y-action",template:"<ng-template #template>\n <li>\n <ng-content></ng-content>\n </li>\n</ng-template>"})],e)}(),Wu=function(){function e(){}return e=jc([t.NgModule({declarations:[Vu,Ku],imports:[Uu,l.BsDropdownModule,n.RouterModule.forChild([])],exports:[Vu,Ku]})],e)}(),Yu=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.state$=new a.BehaviorSubject([]),t.MAX_ALERTS=3,t.ALERT_TIMEOUT=3e3,t}return vc(n,e),Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),n.prototype.add=function(e){this.addAlert(e)},n.prototype.addByText=function(e,t,n){this.addAlert({text:t,type:e,detailedData:n})},n.prototype.list=function(){return this.state},n.prototype.remove=function(e){var t=this;this.changeAlerts(this.state.filter((function(n){return!t.areSame(e,n)})))},n.prototype.update=function(e,t){var n=this;this.changeAlerts(this.state.map((function(a){return n.areSame(e,a)&&Object.assign(a,t),a})))},n.prototype.removeLastDanger=function(){var e=this.state.reverse().find((function(e){return"danger"===e.type}));this.changeAlerts(this.state.filter((function(t){return t!==e})))},n.prototype.saveSuccess=function(e){var t=this;return function(){var n=e+" saved successfully";t.addByText("success",n)}},n.prototype.createSuccess=function(e){var t=this;return function(){var n=e+" created successfully";t.addByText("success",n)}},n.prototype.clearAll=function(){this.changeAlerts([])},n.prototype.success=function(e,t){this.addByText("success",e,t)},n.prototype.danger=function(e,t){this.addByText("danger",e,t)},n.prototype.info=function(e,t){this.addByText("info",e,t)},n.prototype.warning=function(e,t){this.addByText("warning",e,t)},n.prototype.addServerFailure=function(e,t){void 0===t&&(t="danger");var n,a=e.data,o=e.res,s=a&&a.message?a.message:null;a&&("object"==typeof a?n=a.exceptionMessage:"string"==typeof a&&(n=a));var r=!(!s&&!n);s||(s="A server error occurred."),r||(n={status:o.status,statusText:o.statusText,url:o.url}),this.addAlert({type:t,text:s,detailedData:n})},n.prototype.areSame=function(e,t){return e.text===t.text&&e.type===t.type&&s.isEqual(e.detailedData,t.detailedData)&&e.onClose===t.onClose&&e.onDetail===t.onDetail},n.prototype.changeAlerts=function(e){this.state$.next(e)},n.prototype.addAlert=function(e){var t=this;if(!e.text&&!e.type)throw new Error("Cannot add empty alert");this.state.find((function(n){return t.areSame(e,n)}))||(this.changeAlerts(Oc(this.state,[e])),this.hideAutomaticallyIfNeeded(e),this.removeOldestIfMax())},n.prototype.hideAutomaticallyIfNeeded=function(e){var t=this,n="success"===e.type,a=!e.detailedData,o=n&&a?this.ALERT_TIMEOUT:0;void 0!==e.timeout&&(o=e.timeout),o&&setTimeout((function(){return t.remove(e)}),o)},n.prototype.removeOldestIfMax=function(){if(this.state.length>this.MAX_ALERTS){var e=Pc(this.state).slice(1);this.changeAlerts(e)}},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n},token:n,providedIn:"root"}),n=jc([t.Injectable({providedIn:"root"})],n)}(Nc),Zu=function(){function e(){}return e=jc([t.Component({selector:"c8y-alert-details",template:"<ng-content></ng-content>"})],e)}(),Ju=function(){function e(e){this.alertService=e}return e.prototype.ngAfterViewInit=function(){var e=this;this.containDetailsComponent||(this.detailedData=null),this.viewInitTimeout=setTimeout((function(){return e.alertService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.alertService.remove(this)},e.ctorParameters=function(){return[{type:Yu}]},jc([t.Input()],e.prototype,"type",void 0),jc([t.Input()],e.prototype,"onDetail",void 0),jc([t.Input()],e.prototype,"onClose",void 0),jc([t.ViewChild("detailedData",{static:!1})],e.prototype,"detailedData",void 0),jc([t.ViewChild("text",{static:!1})],e.prototype,"text",void 0),jc([t.ContentChild(Zu,{static:!1})],e.prototype,"containDetailsComponent",void 0),e=jc([t.Component({selector:"c8y-alert",template:'<ng-template #text>\r\n <ng-content select="c8y-alert-text"></ng-content>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n<ng-template #detailedData>\r\n <ng-content select="c8y-alert-details"></ng-content>\r\n</ng-template>'})],e)}(),Xu=function(){function e(e,t){this.position=e,this.alertService=t,this.detailDisplayedAlert={},this.isStatic=!1,this.isStatic="static"===this.position}return Object.defineProperty(e.prototype,"alerts",{get:function(){return this.alertService.state$},enumerable:!0,configurable:!0}),e.prototype.getClass=function(e){var t=[];return"danger"!==e.type&&t.push("interact"),t.push("alert-"+e.type),t.join(" ")},e.prototype.close=function(e){e.onClose&&e.onClose(),this.alertService.remove(e)},e.prototype.showDetails=function(e){if(e.onDetail)return e.onDetail();this.detailDisplayedAlert=Object.assign({},e),this.detailDisplayedAlert.mode="raw",this.setDetailsContent(e)},e.prototype.hasDetails=function(e){return e.detailedData||e.onDetail},e.prototype.closeDetails=function(){this.detailDisplayedAlert={}},e.prototype.isDetailsShow=function(e){return this.alertService.areSame(e,this.detailDisplayedAlert)},e.prototype.isTemplateRef=function(e){return e instanceof t.TemplateRef},e.prototype.template=function(e){return this.isTemplateRef(e)?e:void 0},e.prototype.setDetailsContent=function(e){this.isTemplateRef(e.detailedData)||"string"==typeof e.detailedData?this.detailDisplayedAlert.contents=e.detailedData:this.detailDisplayedAlert.contents=JSON.stringify(e.detailedData,null,2)},e.ctorParameters=function(){return[{type:String,decorators:[{type:t.Attribute,args:["position"]}]},{type:Yu}]},jc([t.HostBinding("class.static")],e.prototype,"isStatic",void 0),e=jc([t.Component({selector:"c8y-alert-outlet",template:'<div\n class="alert animated fadeInRightBig m-t-16"\n *ngFor="let alert of alerts | async"\n [ngClass]="[getClass(alert), isDetailsShow(alert) ? \'expanded\' : \'\']"\n>\n <button title="{{ \'Close\' | translate }}" type="button" class="close" (click)="close(alert)">\n <span aria-hidden="true">&times;</span>\n <span class="sr-only">{{ \'Close\' | translate }}</span>\n </button>\n\n <div *ngIf="!isTemplateRef(alert.text); else template(alert.text)">\n <strong *ngIf="!alert.allowHtml" [innerText]="alert.text | translate" class="message"></strong>\n <strong *ngIf="alert.allowHtml" [innerHTML]="alert.text | translate" class="message"></strong>\n </div>\n <p *ngIf="hasDetails(alert) && !isDetailsShow(alert)" class="text-muted m-t-8">\n <button\n title="{{ \'Show details\' | translate }}"\n class="btn btn-clean"\n (click)="showDetails(alert)"\n >\n <i c8yIcon="chevron-down"></i>\n {{ \'Show details\' | translate }}\n </button>\n </p>\n <p *ngIf="hasDetails(alert) && isDetailsShow(alert)" class="text-muted m-t-8">\n <button title="{{ \'Hide details\' | translate }}" class="btn btn-clean" (click)="closeDetails()">\n <i c8yIcon="chevron-up"></i>\n {{ \'Hide details\' | translate }}\n </button>\n </p>\n <div *ngIf="isDetailsShow(alert)">\n <div *ngIf="!isTemplateRef(detailDisplayedAlert.contents); else template(alert.detailedData)">\n <pre><code [innerText]="detailDisplayedAlert.contents | translate"></code></pre>\n </div>\n </div>\n</div>\n'}),wc(0,t.Attribute("position"))],e)}(),Qu=function(){function e(){}return e=jc([t.Component({selector:"c8y-alert-text",template:"<ng-content></ng-content>"})],e)}(),ed=function(){function e(){}return e=jc([t.NgModule({imports:[Uu],exports:[Xu,Ju,Zu,Qu],declarations:[Xu,Ju,Zu,Qu]})],e)}(),td=function(){function e(e){this.children=[],this.parents=[],this.routerLinkExact=!0,this.open=!1,this.hidden=!1,this.draggable=!1,this.droppable=!1,this.dragged=!1,this.draggedHover=!1,this.confirm=void 0,this._priority=0,this.update(e)}return Object.defineProperty(e.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return"navigator_node_"+s.snakeCase(this.label)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"priority",{get:function(){if(this._priority)return this._priority;var e=this.children.map((function(e){return e.priority||0}));return e.length&&e.length?Math.max.apply(Math,Oc(e)):0},set:function(e){this._priority=e},enumerable:!0,configurable:!0}),e.prototype.openOnStart=function(e){return!1},e.prototype.add=function(e){if(e===this)throw new Error("Adding node to itself");-1===this.children.indexOf(e)&&this.children.push(e),-1===e.parents.indexOf(this)&&e.parents.push(this),this.updateChildren()},e.prototype.remove=function(e){var t=this.children.indexOf(e),n=e.parents.indexOf(this);t>-1&&this.children.splice(t,1),n>-1&&e.parents.splice(n,1),this.updateChildren()},e.prototype.update=function(e){e&&(Object.assign(this,e),void 0!==e.hidden&&this.parents.forEach((function(e){e.updateHidden()})))},e.prototype.find=function(e){if("string"==typeof e){var t=e.toLocaleLowerCase();e=function(e){var n=e.label;return t===n.toLowerCase()}}if("object"==typeof e&&(e=s.matches(e)),"function"!=typeof e)throw new Error("Invalid search predicate");return this.children.reduce((function(t,n){return t||n.find(e)}),this.children.find(e))},e.prototype.empty=function(){this.children.length=0},e.prototype.click=function(e){void 0===e&&(e={})},e.prototype.drop=function(e){e.stopPropagation(),clearTimeout(this.expandDragTimeout)},e.prototype.dragStart=function(e){e.stopPropagation(),e.dataTransfer.setData("node","node"),this.dragged=!0},e.prototype.dragEnd=function(e){e.stopPropagation(),this.dragged=!1,e.dataTransfer.clearData()},Object.defineProperty(e.prototype,"canDrop",{get:function(){return this.droppable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canNavigate",{get:function(){return void 0!==this.path},enumerable:!0,configurable:!0}),e.prototype.dragEnter=function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.draggedHover=!0,this.open||(this.expandDragTimeout=setTimeout((function(){return t.expand()}),1e3))},e.prototype.dragLeave=function(e){e.preventDefault(),e.stopPropagation(),this.draggedHover=!1,clearTimeout(this.expandDragTimeout)},e.prototype.expand=function(){this.open||(this.open=!0,this.click({open:!0,expander:!0}))},e.prototype.traverse=function(e){this.children&&this.children.forEach((function(t){e(t),t.traverse(e)}))},e.prototype.destroy=function(){},e.prototype.updateChildren=function(){this.sort(),this.updateHidden()},e.prototype.sort=function(){this.children.sort((function(e,t){return e.priority>t.priority?-1:e.priority<t.priority?1:(e.label||"").toLowerCase()<(t.label||"").toLowerCase()?-1:(e.label||"").toLowerCase()>(t.label||"").toLowerCase()?1:0}))},e.prototype.updateHidden=function(){void 0===this.path&&(this.hidden=!this.children.some((function(e){return!e.hidden})))},e}(),nd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vc(t,e),t.prototype.addRoot=function(e){var t;if(e.preventDuplicates&&(t=this.find((function(t){var n=t.path,a=t.parents,o=t.label;return n===e.path&&o===e.label&&a.some((function(t){return t.label===e.parent}))})))&&!t.hidden)return t.routerLinkExact=!1,t;var n,a=e.parent,o=this.createNode(e);return a&&("object"==typeof a?(n=this.find(a.label))&&n.update(a):"string"!=typeof a&&"function"!=typeof a||(n=this.find(a)),n||(n=this.createNode(a),this.find((function(e){return n===e}))||this.add(n))),(n||this).add(o),o},t.prototype.createNode=function(e){if(e instanceof td)return e;if("string"==typeof e)return new td({label:e});if("object"==typeof e)return new td(bc({},e,{parent:void 0}));throw new Error("Wrong type of node data")},t}(td),ad=new t.InjectionToken("NavigatorNodesFactory"),od=function(e){function s(t,n){var s=e.call(this)||this;s.injector=t,s.router=n,s.refreshTrigger=new a.Subject,s.state$=new a.BehaviorSubject(new Set),s.firstUrl=!0;var r=new nd;return s.items$=xc(n,s.refreshTrigger,[function(){return s.injector.get(ad,[])},Tc(s.state$)]).pipe(o.map((function(e){var t=e.filter((function(e){return!e.parent})),n=e.filter((function(e){return e.parent})),a=Ac(t).concat(Ac(n));return r.empty(),a.forEach((function(e){return r.addRoot(e)})),r.children})),o.shareReplay(1)),s}return vc(s,e),s.prototype.openOnFirstUrl=function(e){return!(!this.firstUrl||!e.path)&&(this.router.isActive(e.path,e.routerLinkExact)||e.openOnStart(this.router.url))},Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.refresh=function(){this.refreshTrigger.next(1)},s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),sd=function(e){function n(t,n){var s=e.call(this)||this;s.navigatorService=t,s.options=n,s.DELAY_TO_AVOID_FLICKERING_ON_ASYNC_NODES=1e3,s.hasItemsInNavigator$=s.navigatorService.items$.pipe(o.delay(s.DELAY_TO_AVOID_FLICKERING_ON_ASYNC_NODES),o.map((function(e){return!!e.length})),o.distinctUntilChanged()),s.state$=new a.BehaviorSubject({title:void 0,nav:{open:!1}}),s.title=void 0,s.header$=s.map((function(e){return e})),s.navigatorOpen$=s.map((function(e){return e.nav.open})).pipe(o.combineLatest(s.hasItemsInNavigator$),o.map((function(e){var t=Pc(e,2),n=t[0],a=t[1];return n&&a})));var r=document.querySelector("title");return s.title={elementRef:r,originalValue:r&&r.innerText},s}return vc(n,e),Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"navigatorHiddenOnStartup",{get:function(){return this.options.hideNavigator},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"largeWidth",{get:function(){return document.documentElement.clientWidth>1200},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldToggle",{get:function(){return this.largeWidth&&!this.navigatorHiddenOnStartup&&!this.state.nav.open},enumerable:!0,configurable:!0}),n.prototype.toggleNavigator=function(){this.state.nav.open=!this.state.nav.open,this.emitNewState()},n.prototype.closeNavigator=function(){this.state.nav.open=!1,this.emitNewState()},n.prototype.configNavigator=function(e){void 0===e&&(e={}),this.state.nav=Object.assign(this.state.nav,e),this.emitNewState()},n.prototype.changeTitle=function(e,t){void 0===t&&(t=!0),this.state.title=e,this.state.pageTitleUpdate=t,this.emitNewState()},n.prototype.changePageTitle=function(e){this.title.elementRef.innerText=e?e+" / "+this.title.originalValue:""+this.title.originalValue},n.prototype.verifyIfNavOpen=function(){var e=this;this.hasItemsInNavigator$.pipe(o.debounceTime(300)).subscribe((function(t){return t&&e.shouldToggle&&e.toggleNavigator()}))},n.prototype.shouldShowBreadcrumbs=function(){return this.options.breadcrumbs},n.ctorParameters=function(){return[{type:od},{type:$c}]},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n(t.ɵɵinject(od),t.ɵɵinject($c))},token:n,providedIn:"root"}),n=jc([t.Injectable({providedIn:"root"})],n)}(Nc),rd=new t.InjectionToken("TabsFactory"),ld=function(e){function s(t,n,s,r){var l=e.call(this)||this;return l.injector=t,l.translateService=s,l.options=r,l.refreshTrigger=new a.Subject,l.state$=new a.BehaviorSubject(new Set),l.items$=xc(n,l.refreshTrigger,[function(){return l.injector.get(rd,[])},Tc(l.state$)]).pipe(o.map((function(e){return l.prepareTabs(e)})),o.shareReplay(1),o.distinctUntilChanged()),l.orientation$=l.items$.pipe(o.map((function(e){var t=e.find((function(e){return e.orientation}));return t?t.orientation:l.options.tabsHorizontal?"horizontal":"vertical"})),o.distinctUntilChanged()),l}return vc(s,e),s.prototype.prepareTabs=function(e){return this.sortTabs(e.map((function(e){return bc({},e,{template:e.template instanceof t.ViewContainerRef?e.template:void 0})})).filter((function(e,t,n){return t===n.findIndex((function(t){return t.path===e.path}))})))},s.prototype.sortTabs=function(e){var t=this;return e.sort((function(e,n){var a=(n.priority||0)-(e.priority||0),o=t.translateService.instant(e.label),s=t.translateService.instant(n.label),r=o.localeCompare(s);return a||r}))},s.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},Object.defineProperty(s.prototype,"firstTab$",{get:function(){return this.items$.pipe(o.map((function(e){return e[0]})),o.filter(Boolean),o.first())},enumerable:!0,configurable:!0}),s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router},{type:p.TranslateService},{type:$c}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router),t.ɵɵinject(p.TranslateService),t.ɵɵinject($c))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),id=function(){function e(e,t,n,a,s,r){var l=this;this.tabs=e,this.ui=t,this.navigator=n,this.actionBar=a,this.options=s,this.headerService=r,this.showPoweredBy=!0,this.noAppsMargin$=this.headerService.map((function(e){var t=e.nav;return!t.open&&t.hiddenOnStartup})),this.tabsOrientation=this.options.tabsHorizontal?"horizontal":"vertical",this.ui.map((function(e){return e.lang})).pipe(o.distinctUntilChanged()).subscribe((function(){l.actionBar.refresh()})),this.showPoweredBy=!this.options.get("hidePowered")}return e.ctorParameters=function(){return[{type:ld},{type:Uc},{type:od},{type:Lc},{type:$c},{type:sd}]},e=jc([t.Component({selector:"c8y-bootstrap",template:'<c8y-login *ngIf="!(ui.currentUser | async)"></c8y-login>\n\n<div *ngIf="ui.currentUser | async" [class.head-open]="header.headerOpen">\n <c8y-header-bar #header></c8y-header-bar>\n <c8y-navigator-outlet\n [nodes]="navigator.items$ | async"\n [open]="headerService.navigatorOpen$ | async"\n >\n <header class="title navigator-slot-top">\n <div class="tenant-brand"></div>\n <c8y-app-icon\n [name]="(ui.state$ | async).app.name"\n [contextPath]="(ui.state$ | async).app.contextPath"\n ></c8y-app-icon>\n <span>{{ (ui.state$ | async).app | humanizeAppName | async }}</span>\n </header>\n <div class="powered-by navigator-slot-bottom" *ngIf="showPoweredBy">\n <p translate>powered by Cumulocity</p>\n </div>\n </c8y-navigator-outlet>\n\n <div class="alerts">\n <c8y-alert-outlet></c8y-alert-outlet>\n </div>\n <c8y-tabs-outlet\n #tabsComponent\n [tabs]="tabs.items$ | async"\n [navigatorOpen]="headerService.navigatorOpen$ | async"\n [orientation]="tabs.orientation$ | async"\n >\n </c8y-tabs-outlet>\n <c8y-action-bar\n #actionBarComponent\n [navigatorOpen]="headerService.navigatorOpen$ | async"\n [hasTabs]="tabsComponent.hasTabs"\n [isTabsHorizontal]="tabsComponent.isHorizontal"\n [items]="actionBar.items$ | async"\n >\n </c8y-action-bar>\n\n <div\n class="mcontainer"\n [ngClass]="{\n open: headerService.navigatorOpen$ | async,\n \'no-apps-margin\': noAppsMargin$ | async,\n \'horizontal-tabs\': tabsComponent.isHorizontal,\n \'vertical-tabs\': !tabsComponent.isHorizontal,\n \'has-tabs\': tabsComponent.hasTabs,\n \'has-action-bar\': !actionBarComponent.hidden\n }"\n >\n <div class="container-fluid">\n <router-outlet></router-outlet>\n <ng-content select="#c8y-legacy-view"></ng-content>\n \x3c!-- legacy ng-view, will not be migrated atm --\x3e\n </div>\n </div>\n</div>\n<c8y-cookie-banner></c8y-cookie-banner>\n'})],e)}(),cd=function(){function e(){}return jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"translate",void 0),jc([t.Input()],e.prototype,"label",void 0),jc([t.Input()],e.prototype,"path",void 0),jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=jc([t.Component({selector:"c8y-breadcrumb-item",template:"<ng-template #template>\n <ng-content></ng-content>\n</ng-template>"})],e)}(),ud=function(){function e(){this.showAll=!1,this.breadcrumbs=[]}return e.prototype.normalizePath=function(e){return e.replace(/^#\/?/,"")},jc([t.Input()],e.prototype,"breadcrumbs",void 0),e=jc([t.Component({selector:"c8y-breadcrumb-outlet",template:'<div\n class="breadcrumbs-container"\n [ngClass]="{\n multiple: breadcrumbs.length > 1,\n open: showAll\n }"\n *ngIf="breadcrumbs && breadcrumbs.length > 0"\n>\n <button\n *ngIf="breadcrumbs.length > 1"\n class="btn-show-all-breadcrumbs pull-left"\n (click)="showAll = !showAll"\n >\n <i\n *ngIf="!showAll"\n [c8yIcon]="\'caret-right\'"\n tooltip="{{ \'Show all breadcrumbs\' | translate }}"\n container="body"\n placement="top"\n ></i>\n <i\n *ngIf="showAll"\n [c8yIcon]="\'caret-down\'"\n tooltip="{{ \'Collapse breadcrumbs\' | translate }}"\n container="body"\n placement="top"\n ></i>\n </button>\n\n <ul class="breadcrumbs text-muted" *ngFor="let breadcrumb of breadcrumbs; let first = first">\n <ng-container *ngIf="first || showAll">\n <li class="text-muted" *ngFor="let item of breadcrumb.items; let firstItem = first">\n <span *ngIf="!firstItem"> > </span>\n <ng-container *c8yOutlet="item.template"></ng-container>\n <ng-container *ngIf="item.label">\n <a\n [routerLink]="normalizePath(item.path)"\n class="word-break"\n title="{{ item.label | translate }}"\n >\n <i [c8yIcon]="item.icon" *ngIf="firstItem" class="m-r-4"></i>\n <span>{{ item.label | translate }}</span>\n </a>\n </ng-container>\n </li>\n </ng-container>\n </ul>\n</div>\n'})],e)}(),dd=new t.InjectionToken("BreadcrumbFactory"),pd=function(e){function s(t,n){var s=e.call(this)||this;return s.injector=t,s.refreshTrigger=new a.Subject,s.state$=new a.BehaviorSubject(new Set),s.items$=xc(n,s.refreshTrigger,[function(){return s.injector.get(dd,[])},Tc(s.state$)]).pipe(o.map((function(e){return s.sortByPreferredPath(e)})),o.shareReplay(1)),s}return vc(s,e),Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},s.prototype.refresh=function(){this.refreshTrigger.next(1)},s.prototype.selectPreferredByPath=function(e){this.preferredPath=e,this.refresh()},s.prototype.sortByPreferredPath=function(e){var t=this;return this.preferredPath?e.sort((function(e){return e.items.find((function(e){return!!e.path.match(t.preferredPath)}))?-1:1})):e},s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),md=function(){function e(e){this.breadcrumbService=e}return e.prototype.ngAfterViewInit=function(){var e=this;this.items=this.contentChildItems.toArray(),this.viewInitTimeout=setTimeout((function(){return e.breadcrumbService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.breadcrumbService.remove(this)},e.ctorParameters=function(){return[{type:pd}]},jc([t.ContentChildren(cd)],e.prototype,"contentChildItems",void 0),e=jc([t.Component({selector:"c8y-breadcrumb",template:"<ng-template>\n <ng-content></ng-content>\n</ng-template>"})],e)}(),hd=function(){function e(){}return e=jc([t.NgModule({declarations:[md,cd,ud],imports:[n.RouterModule.forChild([]),Uu,u.TooltipModule.forRoot()],exports:[md,cd,ud]})],e)}(),fd=function(){function e(e){this.service=e,this.priority=0,this.nodeData=new td}return e.prototype.ngOnInit=function(){var e=this;this.ngOnChanges(),setTimeout((function(){return e.service.add(e.nodeData)}))},e.prototype.ngOnChanges=function(){this.nodeData.icon=this.icon,this.nodeData.label=this.label,this.nodeData.path=this.path,this.nodeData.priority=this.priority,this.nodeData.iconTemplate=this.icon?void 0:this.template,this.nodeData.icon=this.icon},e.prototype.ngOnDestroy=function(){this.service.remove(this.nodeData)},e.ctorParameters=function(){return[{type:od}]},jc([t.ViewChild("iconTpl",{static:!0})],e.prototype,"template",void 0),jc([t.Input()],e.prototype,"label",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"path",void 0),jc([t.Input()],e.prototype,"priority",void 0),e=jc([t.Component({selector:"c8y-navigator-item",template:"<ng-template #iconTpl><ng-content></ng-content></ng-template>"})],e)}(),gd=function(){function e(){}return Object.defineProperty(e.prototype,"icon",{get:function(){return this.node.icon||"cog"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconClass",{get:function(){return"dlt-c8y-icon-"+this.icon},enumerable:!0,configurable:!0}),jc([t.Input()],e.prototype,"node",void 0),e=jc([t.Component({selector:"c8y-navigator-icon",template:'<i class="icon" [c8yIcon]="icon"></i>'})],e)}(),yd=function(){function e(){this.buttons=[{label:"cancel",action:function(){return Promise.reject()}}],this.isOpen=!1,this.containerClass="",this.placement="right",this.outsideClick=!1}return e.prototype.show=function(e){return Sc(this,void 0,void 0,(function(){var t,n=this;return Cc(this,(function(a){switch(a.label){case 0:this.buttons=e||this.buttons,this.isOpen=!0,a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,new Promise((function(e,t){return n.click=function(n){return n().then(e).catch(t)}}))];case 2:return t=a.sent(),[3,5];case 3:throw a.sent();case 4:return this.isOpen=!1,[7];case 5:return[2,t]}}))}))},e.prototype.buttonStatus=function(e){return e?"btn-"+e:"btn-link btn-clean"},e.prototype.handleOutsideClick=function(){this.click((function(){return Promise.reject()}))},jc([t.ViewChild(ac.PopoverDirective,{static:!1})],e.prototype,"popover",void 0),jc([t.Input()],e.prototype,"buttons",void 0),jc([t.Input()],e.prototype,"message",void 0),jc([t.Input()],e.prototype,"title",void 0),jc([t.Input()],e.prototype,"isOpen",void 0),jc([t.Input()],e.prototype,"containerClass",void 0),jc([t.Input()],e.prototype,"placement",void 0),jc([t.Input()],e.prototype,"outsideClick",void 0),e=jc([t.Component({selector:"c8y-popover-confirm",template:'<span\n [popover]="popover"\n container="body"\n [isOpen]="isOpen"\n [popoverTitle]="title | translate"\n [placement]="placement"\n [containerClass]="containerClass"\n [outsideClick]="outsideClick"\n (onHidden)="handleOutsideClick()"\n></span>\n<ng-template #popover>\n <p class="m-b-8">\n {{ message | translate }}\n </p>\n <div class="popover-footer">\n <ng-container *ngFor="let button of buttons">\n <button\n title="{{ button.label | translate }}"\n class="btn btn-sm m-r-16"\n [ngClass]="buttonStatus(button.status)"\n (click)="click(button.action)"\n >\n {{ button.label | translate }}\n </button>\n </ng-container>\n </div>\n</ng-template>\n'})],e)}(),vd=function(){function e(e,n){this.componentFactoryResolver=e,this.navigator=n,this.nodeClick=new t.EventEmitter}var a;return a=e,e.prototype.ngAfterViewInit=function(){var e=this;this.childrenNodes.forEach((function(t){return t.parentNode=e})),this.viewInitTimeout=setTimeout((function(){e.updateIcon(),e.openOnFirstUrl(),e.expandParentIfActive(),e.node.confirm=e.confirm}))},e.prototype.openOnFirstUrl=function(){this.navigator.openOnFirstUrl(this.node)&&!this.node.open&&this.expandCollapse(!0)},Object.defineProperty(e.prototype,"expandTitle",{get:function(){return this.node.open?"Collapse":"Expand"},enumerable:!0,configurable:!0}),e.prototype.click=function(e,t){var n;switch(void 0===e&&(e="link"),e){case"expander":t&&(t.stopPropagation(),t.preventDefault()),n=!this.node.open;break;case"icon":case"link":n=!(!this.routerLinkActive||!this.routerLinkActive.isActive)||!this.node.open}this.handleExpandCollapse(n,e,t),this.nodeClick.emit(e)},e.prototype.expandCollapse=function(e,t,n){void 0===n&&(n={}),this.node.open=e,t&&this.childrenNodes.forEach((function(n){return n.expandCollapse(e,t)})),n.open=e,this.node.click(n)},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.node&&this.node.destroy()},e.prototype.handleExpandCollapse=function(e,t,n){var a;e===this.node.open||this.node.path&&!e&&"expander"!==t||this.expandCollapse(e,!1,((a={})[t]=!0,a.$event=n,a))},e.prototype.expandParentIfActive=function(){this.routerLinkActive&&this.routerLinkActive.isActive&&this.parentNode&&this.parentNode.expandCollapse(!0)},e.prototype.updateIcon=function(){this.node.iconTemplate?this.updateIconTemplate():this.updateIconComponent()},e.prototype.updateIconComponent=function(){var e=gd;this.node&&this.node.iconComponent&&(e=this.node.iconComponent),this.iconSlot.clear();var t=this.componentFactoryResolver.resolveComponentFactory(e);this.iconSlot.createComponent(t).instance.node=this.node},e.prototype.updateIconTemplate=function(){this.iconSlot.clear(),this.iconSlot.createEmbeddedView(this.node.iconTemplate)},e.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:od}]},jc([t.ViewChild("icon",{read:t.ViewContainerRef,static:!1})],e.prototype,"iconSlot",void 0),jc([t.Input()],e.prototype,"node",void 0),jc([t.Input()],e.prototype,"isRoot",void 0),jc([t.ViewChild(n.RouterLinkActive,{static:!1})],e.prototype,"routerLinkActive",void 0),jc([t.ViewChildren(a)],e.prototype,"childrenNodes",void 0),jc([t.Output()],e.prototype,"nodeClick",void 0),jc([t.ViewChild(yd,{static:!1})],e.prototype,"confirm",void 0),e=a=jc([t.Component({selector:"c8y-navigator-node-display",template:'<div\n class="slot"\n [hidden]="node.hidden"\n (dragstart)="node.dragStart($event)"\n (dragend)="node.dragEnd($event)"\n (drop)="node.drop($event)"\n [draggable]="node.draggable"\n [ngClass]="{ dragged: node.dragged }"\n>\n <ng-container>\n <a\n class="link"\n draggable="false"\n (dragover)="node.canDrop && $event.preventDefault()"\n (dragenter)="node.canDrop && node.dragEnter($event)"\n (dragleave)="node.canDrop && node.dragLeave($event)"\n title="{{node.label | translate}}"\n [attr.id]="isRoot ? node.id : undefined"\n [routerLink]="node.canNavigate ? node.path : undefined"\n [routerLinkActive]="node.canNavigate ? \'active\' : \'\'"\n [routerLinkActiveOptions]="{exact:node.routerLinkExact}"\n (click)="click(node.canNavigate ? \'link\' : \'expander\', $event)"\n [ngClass]="{\'root-link\':isRoot, open: node.open, parent: node.hasChildren, \'dragged-hover\': node.draggedHover && !node.dragged}"\n >\n <ng-container *ngTemplateOutlet="inner"></ng-container>\n </a>\n </ng-container>\n\n <div\n class="children panel-expand expand"\n *ngIf="node.children.length"\n [collapse]="!node.open"\n [isAnimated]="true"\n >\n <c8y-navigator-node-display\n *ngFor="let childNode of node.children"\n [node]="childNode"\n (nodeClick)="nodeClick.emit($event)"\n >\n </c8y-navigator-node-display>\n </div>\n</div>\n\n<ng-template #inner>\n \x3c!-- loader --\x3e\n <i\n class="icon-spin loadingIndicator"\n [c8yIcon]="\'circle-o-notch\'"\n *ngIf="node.loading && !isRoot"\n >\n </i>\n\n \x3c!-- icon --\x3e\n <div (click)="click(\'icon\', $event)">\n <ng-container #icon></ng-container>\n </div>\n\n \x3c!--title --\x3e\n <span>{{node.label | translate}}</span>\n\n <i\n class="expander"\n [c8yIcon]="\'chevron-down\'"\n *ngIf="node.hasChildren"\n (click)="click(\'expander\', $event)"\n title="{{expandTitle}}"\n >\n </i>\n\n <c8y-popover-confirm\n outsideClick="true"\n containerClass="navigator-popover"\n ></c8y-popover-confirm>\n</ng-template>\n'})],e)}(),bd=function(){function e(){this.quickLinks=[],this.helpAndSupport=[]}return Object.defineProperty(e.prototype,"_quickLinks",{set:function(e){e&&(this.quickLinks=e.filter((function(e){return"quicklink"===e.type})))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_helpAndSupport",{set:function(e){e&&(this.helpAndSupport=e.filter((function(e){return"doc"===e.type})))},enumerable:!0,configurable:!0}),jc([t.Input("quickLinks")],e.prototype,"_quickLinks",null),jc([t.Input("helpAndSupport")],e.prototype,"_helpAndSupport",null),jc([t.Input()],e.prototype,"app",void 0),e=jc([t.Component({selector:"c8y-right-drawer",template:'<div class="c8y-right-drawer">\n <div class="summary">\n <h4 class="text-light">\n {{ \'Welcome to\' | translate }} {{ app | humanizeAppName | async }}\n </h4>\n </div>\n\n <div *ngIf="quickLinks.length">\n <div class="legend form-block" translate>Quick links</div>\n <div class="quick-links-drawer">\n <ng-container *ngFor="let quickLink of quickLinks">\n <a\n class="quick-link"\n [href]="quickLink.url || \'#\'"\n (click)="quickLink.click && $event.preventDefault(); quickLink.click();"\n >\n <h2 *ngIf="quickLink.icon"><i class="{{ quickLink.icon }}"></i></h2>\n <img\n *ngIf="quickLink.iconSrc"\n [src]="quickLink.iconSrc"\n style="max-width:50px;"\n class="img-responsive center-block"\n onerror="this.style.display = \'none\'">\n {{ quickLink.label | translate }}\n </a>\n </ng-container>\n </div>\n </div>\n\n <div *ngIf="helpAndSupport.length">\n <div class="legend form-block m-t-24" translate>Help &amp; support</div>\n <div class="help-support" *ngFor="let link of helpAndSupport">\n <a\n class="help-and-support-link text-truncate"\n target="_blank"\n rel="noopener noreferrer"\n [href]="link.url"\n >\n <i [c8yIcon]="link.icon"></i>\n <span title="{{ link.label | translate }}" class="d-inline">\n {{ link.label | translate }}\n </span>\n </a>\n </div>\n </div>\n</div>\n'})],e)}(),jd=function(){function e(e,t,n){var a=this;this.headerService=e,this.element=t,this.zone=n,this.title=void 0,this.pageTitleUpdate=!0,this.headerService.map((function(e){return e.title})).subscribe((function(e){return a.title=e})),this.headerService.map((function(e){return e.pageTitleUpdate})).subscribe((function(e){return a.pageTitleUpdate=e})),this.zone.runOutsideAngular((function(){a.headerService.state$.pipe(o.debounceTime(100),o.filter((function(e){return e.pageTitleUpdate})),o.debounceTime(100),o.map((function(){return a.element.nativeElement.querySelector("h1")})),o.filter((function(e){return null!==e})),o.map((function(e){return e.innerText})),o.filter(Boolean)).subscribe((function(t){return e.changePageTitle(t)}))}))}return e.ctorParameters=function(){return[{type:sd},{type:t.ElementRef},{type:t.NgZone}]},e=jc([t.Component({selector:"c8y-title-outlet",template:'<div class="c8y-ui-title">\n <div class="title" *c8yOutlet="title"></div>\n</div>\n'})],e)}(),wd=function(){function e(e){this.headerService=e,this.pageTitleUpdate=!0}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.headerService.changeTitle(e.template,e.pageTitleUpdate)}))},e.prototype.ngOnDestroy=function(){this.headerService.state.title===this.template&&(clearTimeout(this.viewInitTimeout),this.headerService.changeTitle())},e.ctorParameters=function(){return[{type:sd}]},jc([t.Input()],e.prototype,"pageTitleUpdate",void 0),jc([t.ViewChild("template",{static:!0})],e.prototype,"template",void 0),e=jc([t.Component({selector:"c8y-title",template:'<ng-template #template>\n <h1 class="text-truncate">\n <ng-content></ng-content>\n </h1>\n</ng-template>\n\n'})],e)}(),Sd=new t.InjectionToken("SearchFactory"),Cd=function(e){function s(t,n){var s=e.call(this)||this;return s.injector=t,s.refreshTrigger=new a.Subject,s.state$=new a.BehaviorSubject(new Set),s.items$=xc(n,s.refreshTrigger,[function(){return s.injector.get(Sd,[])},Tc(s.state$)]).pipe(o.map((function(e){return Ac(e)})),o.shareReplay(1)),s}return vc(s,e),s.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),Id=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.state$=new a.BehaviorSubject({userMenuItems:new Set}),t}return vc(n,e),Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),n.prototype.add=function(e){this.state.userMenuItems.add(e),this.emitNewState()},n.prototype.remove=function(e){this.state.userMenuItems.delete(e),this.emitNewState()},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n},token:n,providedIn:"root"}),n=jc([t.Injectable({providedIn:"root"})],n)}(Nc),Pd=[{icon:"c8y-c8y-data",label:"Concepts guide`KEEP_ORIGINAL`",url:"/concepts/introduction",type:"doc"},{icon:"c8y-user",label:"User guide`KEEP_ORIGINAL`",url:"/users-guide/getting-started",type:"doc"},{icon:"c8y-device-management",label:"Device guides`KEEP_ORIGINAL`",url:"/devices/overview",type:"doc"},{icon:"c8y-book",label:"Cumulocity IoT Edge`KEEP_ORIGINAL`",url:"/edge/overview",type:"doc"},{icon:"c8y-tools",label:"Microservice SDK guide`KEEP_ORIGINAL`",url:"/microservice-sdk/introduction",type:"doc"},{icon:"c8y-tools",label:"Device SDK guide`KEEP_ORIGINAL`",url:"/device-sdk/introduction",type:"doc"},{icon:"c8y-smart-rest",label:"Web SDK guide`KEEP_ORIGINAL`",url:"/web/introduction",type:"doc"},{icon:"c8y-data-explorer",label:"Streaming analytics guide`KEEP_ORIGINAL`",url:"/apama/introduction",type:"doc"},{icon:"c8y-bookmark",label:"Reference guide`KEEP_ORIGINAL`",url:"/reference/rest-implementation",type:"doc"},{icon:"gavel",label:"Legal notices",url:"https://documentation.softwareag.com/legal/",type:"doc"}],Od=new t.InjectionToken("Hook docs"),xd=function(){function e(e,t,n,a){void 0===n&&(n=[]),this.options=e,this.app=t,n||(n=[]),n.push(this);var s=this.app.map((function(e){return e.supportUrl}));this.items$=xc(a,s,n).pipe(o.startWith([]),o.shareReplay(1))}return e.prototype.getBaseUrl=function(){return this.options.get("docsBaseUrl","https://www.cumulocity.com/guides")},Object.defineProperty(e.prototype,"templateStr",{get:function(){return this.options.get("guideHrefTemplate","${docsBaseUrl}${partialUrl}")},enumerable:!0,configurable:!0}),e.prototype.getUserGuideLink=function(e){return/^https?:/.test(e)?e:null===this.getBaseUrl?null:this.getLink(this.templateStr,e)},e.prototype.list=function(){return this.items$.pipe(o.filter((function(e){return!!e.length})),o.first()).toPromise()},e.prototype.refresh=function(){},e.prototype.get=function(){var e=this,t=this.options.get("docs",{}),n=t.links,a=t.noDefault,o=t.excludeDefault,r=void 0===o?[]:o,l=this.app.state.supportUrl,i=a?[]:Pd.map((function(t){return bc({},t,{url:e.getUserGuideLink(t.url)})})).filter((function(e){var t=e.url;return!r.some((function(e){return new RegExp(e).test(t)}))}));return n&&(n.map((function(e){if(s.isUndefined(e.type))return e.type="doc",e})),i=i.concat(n)),l&&i.push({icon:"comments",label:"Forum support",url:l,type:"doc"}),i},e.prototype.getLink=function(e,t){if(e)return e.replace(/\${docsBaseUrl}/,this.getBaseUrl()).replace(/\${partialUrl}/,this.prefixWithSlash(t))},e.prototype.prefixWithSlash=function(e){return void 0===e&&(e=""),""+(!(e&&/^\//.test(e))?"/":"")+e},e.ctorParameters=function(){return[{type:$c},{type:Uc},{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[Od]}]},{type:n.Router}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject($c),t.ɵɵinject(Uc),t.ɵɵinject(Od,8),t.ɵɵinject(n.Router))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"}),wc(2,t.Optional()),wc(2,t.Inject(Od))],e)}(),Ed=function(){function e(e,t,n,a,o,s,r){this.headerService=e,this.actionService=t,this.breadcrumbService=n,this.searchService=a,this.appState=o,this.userMenuService=s,this.docs=r,this.canToggle$=this.headerService.hasItemsInNavigator$,this.appState$=this.appState.state$,this.drawerOpen=!1,this.headerOpen=!1}return e.prototype.ngAfterViewInit=function(){this.headerService.verifyIfNavOpen()},e.prototype.toggle=function(){this.headerOpen=!this.headerOpen},e.ctorParameters=function(){return[{type:sd},{type:zu},{type:pd},{type:Cd},{type:Uc},{type:Id},{type:xd}]},e=jc([t.Component({selector:"c8y-header-bar",template:'<div\n class="app-main-header"\n [ngClass]="{\n open: headerService.navigatorOpen$ | async,\n drawerOpen: drawerOpen\n }"\n>\n <div class="header-bar">\n <button\n *ngIf="canToggle$ | async"\n type="button"\n class="navigator-toggle main-header-button"\n title="{{ \'Toggle navigator\' | translate }}"\n (click)="headerService.toggleNavigator()"\n > \n <i [c8yIcon]="\'outdent\'" *ngIf="!(headerService.navigatorOpen$ | async)"></i>\n <i [c8yIcon]="\'dedent-right\'" *ngIf="headerService.navigatorOpen$ | async"></i>\n </button>\n <div class="app-view">\n <c8y-app-icon\n [name]="(appState$ | async).app.name"\n [contextPath]="(appState$ | async).app.contextPath"\n ></c8y-app-icon>\n\n <span class="page-header">\n <c8y-title-outlet></c8y-title-outlet>\n <c8y-breadcrumb-outlet\n [breadcrumbs]="breadcrumbService.items$ | async"\n class="app-breadcrumbs"\n ></c8y-breadcrumb-outlet>\n </span>\n </div>\n <c8y-search-outlet\n title="{{ \'Search\' | translate }}"\n [search]="searchService.items$ | async"\n class="main-header-item"\n ></c8y-search-outlet>\n <c8y-action-outlet\n title="{{ \'Add\' | translate }}"\n [items]="actionService.items$ | async"\n class="main-header-item"\n ></c8y-action-outlet>\n <c8y-app-switcher\n title="{{ \'Application switcher\' | translate }}"\n class="main-header-item"\n ></c8y-app-switcher>\n <c8y-user-menu-outlet\n [items]="(userMenuService.state$ | async).userMenuItems"\n class="main-header-item"\n ></c8y-user-menu-outlet>\n\n <button\n title="{{ \'Toggle side drawer\' | translate }}"\n class="drawer-toggle main-header-button"\n *ngIf="(appState$ | async).showRightDrawer"\n (click)="drawerOpen = !drawerOpen"\n >\n <i [c8yIcon]="\'indent\'" *ngIf="drawerOpen"></i>\n <i [c8yIcon]="\'dedent\'" *ngIf="!drawerOpen"></i>\n </button>\n </div>\n <div class="head-toggler">\n <button title="{{ \'Toggle\' | translate }}" type="button" (click)="toggle()">\n <i [c8yIcon]="\'dedent-right\'"></i>\n </button>\n </div>\n <c8y-right-drawer\n *ngIf="(appState$ | async).showRightDrawer"\n [app]="(appState$ | async).app"\n [quickLinks]="docs.items$ | async"\n [helpAndSupport]="docs.items$ | async"\n >\n </c8y-right-drawer>\n <div class="loading-bar" [ngClass]="{ active: (appState$ | async).isLoading }"></div>\n</div>\n'})],e)}(),kd=function(){function e(e,t){var n=this;this.ui=e,this.applications=t;var s=this.ui,r=s.currentUser,l=s.currentTenant;a.combineLatest(r,l).pipe(o.first()).subscribe((function(e){var t=Pc(e,2),a=t[0],o=t[1];n.tenant=o,n.listAppsForUser(a)}))}return Object.defineProperty(e.prototype,"hideCloudApps",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype.isActive=function(e){return e.contextPath===this.ui.state.app.contextPath},e.prototype.getHref=function(e){return this.applications.getHref(e)},e.prototype.listAppsForUser=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return e?[4,this.applications.listByUser(e,{pageSize:1e3})]:[3,2];case 1:t=n.sent().data,this.apps=this.orderApps(this.filterApps(t)),n.label=2;case 2:return[2]}}))}))},e.prototype.filterApps=function(e){return e=this.filterVisible(e),e=this.filterCloud(e),e=this.filterDuplicates(e)},e.prototype.filterVisible=function(e){var t=["HOSTED","EXTERNAL"];return e.filter((function(e){return s.includes(t,e.type)&&!e.noAppSwitcher&&!s.get(e,"manifest.noAppSwitcher")}))},e.prototype.filterCloud=function(e){var t=this.hideCloudApps,n=function(e){return!!e.cloud};return t||(this.oneCloudApps=this.orderApps(e.filter(n))),e.filter((function(e){return!n(e)}))},e.prototype.filterDuplicates=function(e){var t=this;return e.filter((function(n){return!e.some((function(e){return n!==e&&n.contextPath&&n.contextPath===e.contextPath&&n.owner.tenant.id!==t.tenant.name}))}))},e.prototype.orderApps=function(e){return s.orderBy(e,(function(e){return e.name.toLowerCase()}))},e.ctorParameters=function(){return[{type:Uc},{type:m.ApplicationService}]},e=jc([t.Component({selector:"c8y-app-switcher",template:'<div class="app-switcher-dropdown" dropdown>\n <button\n class="main-header-button c8y-dropdown dropdown-toggle"\n id="appSwitcherDropdown"\n dropdownToggle\n >\n <i c8yIcon="th" class="icon-2x"></i>\n </button>\n <div\n *dropdownMenu\n class="app-switcher-dropdown-menu dropdown-menu"\n aria-labelledby="appSwitcherDropdown"\n >\n <div class="app-switcher-sagcloud" *ngIf="oneCloudApps && oneCloudApps.length > 0">\n <a\n title="{{ app.name | humanizeAppName | async }}"\n class="appLink"\n *ngFor="let app of oneCloudApps"\n [href]="getHref(app)"\n >\n <c8y-app-icon [app]="app" [name]="app.name" [contextPath]="app.contextPath"></c8y-app-icon>\n <span class="text-truncate-wrap">{{ app | humanizeAppName | async }}</span>\n </a>\n </div>\n <div class="app-switcher">\n <a\n title="{{ app.name | humanizeAppName | async }}"\n class="appLink"\n [ngClass]="isActive(app) ? \'active\' : \'\'"\n *ngFor="let app of apps"\n [href]="getHref(app)"\n c8yProductExperience\n [actionName]="\'appSwitched\'"\n [actionData]="{ applicationName: app && app.name }"\n >\n <c8y-app-icon [app]="app" [name]="app.name" [contextPath]="app.contextPath"></c8y-app-icon>\n <span class="text-truncate-wrap">{{ app | humanizeAppName | async }}</span>\n </a>\n </div>\n </div>\n</div>\n'})],e)}(),Td=function(){function e(e){this.options=e,this.name="",this.model={appIcon:"",showIcon:!0,iconClass:["c8y-icon"],appNameAbbr:"",iconStyle:{}},this.c8yAppIconsList={analyticsbuilder:"analytics-builder","analytics-builder":"analytics-builder",cockpit:"cockpit",devicemanagement:"device-management",administration:"administration",apamaepl:"apama-epl"},this.white=!1,this.defaultIconStyle={"background-repeat":"no-repeat","background-size":"contain",height:"36px",width:"36px"}}return e.prototype.ngOnInit=function(){this.model.appIcon=this.iconFromAppDefinition()||this.findStaticIcon();var e=this.iconUrlFromAppDefinition();e&&(this.model.iconStyle=s.assign(this.defaultIconStyle,{"background-image":e})),this.model.showIcon=!!this.model.appIcon||!s.isEmpty(this.model.iconStyle),this.model.iconClass=["c8y-icon",this.mapFontAwesomeToDelightIcons(this.model.appIcon),this.white?"c8y-icon-white":"c8y-icon-duocolor"].filter((function(e){return!!e})),this.model.appNameAbbr=this.name.substr(0,2)},e.prototype.findStaticIcon=function(){var e=this.contextPath||this.name,t=s.find(s.keys(this.c8yAppIconsList),(function(t){return e.indexOf(t)>-1})),n=this.c8yAppIconsList[t];return n?"c8y-icon-"+n:void 0},e.prototype.iconFromAppDefinition=function(){var e=this.app||this.options,t=["icon","class"];return s.get(e,t)||s.get(e,Oc(["manifest"],t))},e.prototype.iconUrlFromAppDefinition=function(){var e=this.app||this.options,t=["icon","url"];return s.get(e,t)||s.get(e,Oc(["manifest"],t))},e.prototype.mapFontAwesomeToDelightIcons=function(e){if(e){return e.replace(/fa-/gi,"dlt-c8y-icon-")}},e.ctorParameters=function(){return[{type:$c}]},jc([t.Input()],e.prototype,"contextPath",void 0),jc([t.Input()],e.prototype,"name",void 0),jc([t.Input()],e.prototype,"app",void 0),e=jc([t.Component({selector:"c8y-app-icon",template:'<i *ngIf="model.showIcon" [ngClass]="model.iconClass" [ngStyle]="model.iconStyle"></i>\n<span *ngIf="!model.showIcon" class="app-noicon"> {{model.appNameAbbr}}</span>\n',host:{class:"c8y-app-icon"}})],e)}(),Ad=function(){function e(e){this.headerService=e,this.open=!0,this.isShown$=new a.BehaviorSubject(!1)}return e.prototype.ngOnChanges=function(){this.isShown$.next(this.nodes&&this.nodes.length>0)},e.prototype.collapseNavigator=function(e){"link"!==e||this.headerService.largeWidth||this.headerService.closeNavigator()},e.prototype.trackByPathOrLabel=function(e,t){return t.path?t.path:t.label},e.ctorParameters=function(){return[{type:sd}]},jc([t.Input()],e.prototype,"nodes",void 0),jc([t.Input()],e.prototype,"open",void 0),e=jc([t.Component({selector:"c8y-navigator-outlet, c8y-ui-navigator",template:'<nav class="navigator" *ngIf="isShown$ | async" [ngClass]="{ open: open }">\n <ng-content select=".navigator-slot-top"></ng-content>\n <ul class="navigatorContent">\n <c8y-navigator-node-display (nodeClick)="collapseNavigator($event)" [node]="node" *ngFor="let node of nodes trackBy trackByPathOrLabel" [isRoot]="true"></c8y-navigator-node-display>\n </ul>\n <ng-content select=".navigator-slot-bottom"></ng-content>\n</nav>\n'})],e)}();($u=e.Status||(e.Status={})).SUCCESS="success",$u.WARNING="warning",$u.DANGER="danger",$u.INFO="info";var _d,Nd=((Du={})[e.Status.SUCCESS]="check-circle",Du[e.Status.WARNING]="exclamation-triangle",Du[e.Status.DANGER]="exclamation-circle",Du[e.Status.INFO]="info-circle",Du),Dd=((Lu={})[e.Status.SUCCESS]="text-"+e.Status.SUCCESS,Lu[e.Status.WARNING]="text-"+e.Status.WARNING,Lu[e.Status.DANGER]="text-"+e.Status.DANGER,Lu[e.Status.INFO]="text-"+e.Status.INFO,Lu),Ld=((Mu={})[e.Status.SUCCESS]="alert-"+e.Status.SUCCESS,Mu[e.Status.WARNING]="alert-"+e.Status.WARNING,Mu[e.Status.DANGER]="alert-"+e.Status.DANGER,Mu[e.Status.INFO]="alert-"+e.Status.INFO,Mu),Md=((Ru={})[m.OperationStatus.PENDING]="clock-o",Ru[m.OperationStatus.EXECUTING]="refresh",Ru[m.OperationStatus.SUCCESSFUL]="check-circle",Ru[m.OperationStatus.FAILED]="exclamation-circle",Ru),Rd=((qu={})[m.OperationStatus.PENDING]="text-info",qu[m.OperationStatus.EXECUTING]="text-info",qu[m.OperationStatus.SUCCESSFUL]="text-success",qu[m.OperationStatus.FAILED]="text-danger",qu),qd=function(){function n(t){var n=this;this.modal=t,this.status=e.Status.INFO,this._labels={ok:"OK",cancel:"Cancel"},this.result=new Promise((function(e,t){n.dismiss=function(){t(),n.modal.hide()},n.close=function(){e(!0),n.modal.hide()}}))}return Object.defineProperty(n.prototype,"labels",{get:function(){return this._labels},set:function(e){var t=e||{},n=t.ok,a=void 0===n?"OK":n,o=t.cancel,s=void 0===o?"Cancel":o;this._labels={ok:a,cancel:s}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"classIcon",{get:function(){return"dlt-c8y-icon-"+Nd[this.status]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"classAlert",{get:function(){return Ld[this.status]},enumerable:!0,configurable:!0}),n.prototype.ngOnDestroy=function(){this.dismiss()},n.ctorParameters=function(){return[{type:oc.BsModalRef}]},jc([t.Input()],n.prototype,"title",void 0),jc([t.Input()],n.prototype,"body",void 0),jc([t.Input()],n.prototype,"status",void 0),jc([t.Input()],n.prototype,"labels",null),n=jc([t.Component({selector:"c8y-confirm-modal",template:'<div class="c8y-prompt alert" [ngClass]="[classAlert]">\n <h3 class="m-b-16" *ngIf="title">\n <i class="dlt-c8y-icon" [ngClass]="[classIcon]"></i>\n <span *ngIf="title">{{ title | translate }}</span>\n </h3>\n <p class="text-break-word">{{ body | translate }}</p>\n <ng-content></ng-content>\n <div class="alert-footer">\n <button\n title="{{ labels.cancel | translate }}"\n class="btn btn-default"\n *ngIf="labels.cancel !== null"\n (click)="dismiss()"\n >\n {{ labels.cancel | translate }}\n </button>\n <button title="{{ labels.ok | translate }}" class="btn btn-primary" (click)="close()">\n {{ labels.ok | translate }}\n </button>\n </div>\n</div>\n'})],n)}(),$d=function(){function e(e){this.modal=e,this.onDismiss=new t.EventEmitter,this.onClose=new t.EventEmitter,this.disabled=!1,this.customFooter=!1,this._labels={ok:"OK",cancel:"Cancel"}}return Object.defineProperty(e.prototype,"labels",{get:function(){return this._labels},set:function(e){var t=e.ok,n=e.cancel;this._labels={ok:t,cancel:n}},enumerable:!0,configurable:!0}),e.prototype._dismiss=function(){var e=this,t=this.dismiss;!t&&this.modal&&(t=function(){return e.modal.hide()}),t&&t(),this.onDismiss.emit(!0)},e.prototype._close=function(){var e=this,t=this.close;!t&&this.modal&&(t=function(){return e.modal.hide()}),t&&t(),this.onClose.emit(!0)},e.prototype.onEnterKeyDown=function(e){var t=tc.isEmpty(this.labels.ok)!==tc.isEmpty(this.labels.cancel),n=!this.customFooter&&this.labels.cancel,a=!this.customFooter&&!this.disabled&&this.labels.ok;t&&n&&this._dismiss(),t&&a&&this._close()},e.ctorParameters=function(){return[{type:oc.BsModalRef,decorators:[{type:t.Optional}]}]},jc([t.Output()],e.prototype,"onDismiss",void 0),jc([t.Output()],e.prototype,"onClose",void 0),jc([t.Input()],e.prototype,"disabled",void 0),jc([t.Input()],e.prototype,"close",void 0),jc([t.Input()],e.prototype,"dismiss",void 0),jc([t.Input()],e.prototype,"title",void 0),jc([t.Input()],e.prototype,"body",void 0),jc([t.Input()],e.prototype,"customFooter",void 0),jc([t.Input()],e.prototype,"labels",null),jc([t.HostListener("document:keydown.enter",["$event"])],e.prototype,"onEnterKeyDown",null),e=jc([t.Component({selector:"c8y-modal",template:'<div class="modal-header">\n <ng-content select="[c8y-modal-title]"></ng-content>\n <h3 [hidden]="!title">\n {{ title | translate }}\n </h3>\n</div>\n<div class="modal-body">\n <p [hidden]="!title" class="text-center text-break-word">\n {{ body }}\n </p>\n <ng-content></ng-content>\n</div>\n<div\n class="modal-footer"\n *ngIf="!customFooter">\n <ng-content select="[c8y-modal-footer]"></ng-content>\n <button\n title="{{ labels.cancel | translate }}"\n *ngIf="labels.cancel"\n class="btn btn-default"\n (click)="_dismiss()"\n >\n {{ labels.cancel | translate }}\n </button>\n <button\n title="{{ labels.ok | translate }}"\n *ngIf="labels.ok"\n class="btn btn-primary"\n (click)="_close()"\n [disabled]="disabled"\n >\n {{ labels.ok | translate }}\n </button>\n</div>\n'}),wc(0,t.Optional())],e)}(),Fd=function(){function n(e){this.modalService=e}return n.prototype.confirm=function(t,n,a,o){return void 0===a&&(a=e.Status.INFO),void 0===o&&(o={}),Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(s){switch(s.label){case 0:return e={ok:o.ok||"Confirm",cancel:o.cancel||"Cancel"},[4,this.modalService.show(qd,{initialState:{title:t,body:n,labels:e,status:a}}).content.result];case 1:return[2,s.sent()]}}))}))},n.prototype.acknowledge=function(t,n,a,o){return void 0===a&&(a=e.Status.INFO),void 0===o&&(o="Confirm"),Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(s){switch(s.label){case 0:return e={ok:o,cancel:null},[4,this.modalService.show(qd,{initialState:{title:t,body:n,labels:e,status:a}}).content.result];case 1:return[2,s.sent()]}}))}))},n.ctorParameters=function(){return[{type:oc.BsModalService}]},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n(t.ɵɵinject(oc.BsModalService))},token:n,providedIn:"root"}),n=jc([t.Injectable({providedIn:"root"})],n)}(),Ud=function(){function e(){}return e=jc([t.NgModule({imports:[oc.ModalModule.forRoot(),Uu,ac.PopoverModule.forRoot()],exports:[qd,$d,yd],declarations:[qd,$d,yd],providers:[Fd],entryComponents:[qd]})],e)}(),Bd=function(){function e(){}return e=jc([t.NgModule({declarations:[Ad,vd,fd,gd],imports:[n.RouterModule,r.CollapseModule.forRoot(),Uu,Ud],exports:[Ad,fd],entryComponents:[gd]})],e)}(),Gd=function(){function e(e){this.options=e,this.STORAGE_KEY="acceptCookieNotice",this.COOKIE_BANNER="cookieBanner",this.COOKIE_PREFERENCES_CONFIG="cookiePreferences",this.isCookieBannerShowed$=new a.Subject,this.cookieDescriptions={required:"These cookies are required to enable core site functionality. They perform a task or operation without which a site's functionality would not be possible.",functional:"These cookies are used to track site usage and to process my personal data to measure and improve usability and performance. We will neither forward this data to any third party nor use this data for direct marketing purposes. I recognize that I can opt in and out of these cookies at any time.",marketing:"These cookies are used to target advertising to a user."}}return e.prototype.getCookiePreferencesConfig=function(){return this.options.get(this.COOKIE_PREFERENCES_CONFIG)},e.prototype.getCookieBannerSettings=function(){return this.options.get(this.COOKIE_BANNER)||{}},e.prototype.setCookies=function(e){var t=bc({},e);Object.entries(t).forEach((function(e){var n=Pc(e,2),a=n[0],o=n[1];t[a]="string"==typeof o||o})),localStorage.setItem(this.STORAGE_KEY,JSON.stringify(t))},e.prototype.shouldShowCookieBanner=function(){return!!this.getCookieBannerSettings().cookieBannerText&&!this.getUserCookiePreferences()},e.prototype.getUserCookiePreferences=function(){return JSON.parse(localStorage.getItem(this.STORAGE_KEY))},e.prototype.isConfigCookiePreferencesDefined=function(){return!!this.getCookiePreferencesConfig()},e.prototype.isFunctionalCookieEnabled=function(){return!0===(this.getUserCookiePreferences()||{}).functional},e.prototype.getCookieDescription=function(e){var t=this.getCookiePreferencesConfig();return"string"==typeof t[e]?t[e]:this.cookieDescriptions[e]},e.prototype.transformCookiePreferencesToList=function(e){return Object.entries(e).map((function(e){var t=Pc(e,2),n=t[0];return{name:n,value:t[1],isReadonly:"required"===n}}))},e.prototype.transformCookiePreferencesListToCookiePreferences=function(e){return e.reduce((function(e,t){return e[t.name]=t.value,e}),{})},e.ctorParameters=function(){return[{type:$c}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject($c))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"})],e)}(),Hd=function(){function e(e,t,n,o){this.appState=e,this.options=t,this.cookieBannerService=n,this.userPreferencesService=o,this.tagFunction$=new a.BehaviorSubject(null),this.USER_PREFERENCES_KEY="gainsightEnabled",this.GAINSIGHT_URL="web-sdk.aptrinsic.com/api/aptrinsic.js?a=",this.GAINSIGHT_GLOBAL_SCOPE="aptrinsic",this.SCRIPT_EXECUTION_WAIT_TIME=500,this.OPTIONS_KEY_CATEGORY="gainsight",this.OPTIONS_KEY_NAME="api.key",this.isScriptLoaded=!1}return e.prototype.isGainsightDisabledInUserPreferences=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return[4,this.userPreferencesService.get(this.USER_PREFERENCES_KEY).toPromise()];case 1:return[2,!1===e.sent()]}}))}))},e.prototype.setFunctionalCookie=function(e){var t=this.cookieBannerService.getUserCookiePreferences();t&&(Object.keys(t).forEach((function(n){"functional"!==n||(t[n]=e)})),localStorage.setItem("acceptCookieNotice",JSON.stringify(t)))},e.prototype.getGainsightKey=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return e=this,(t=this.options.gainsightKey)?[3,2]:[4,this.options.getSystemOption(this.OPTIONS_KEY_CATEGORY,this.OPTIONS_KEY_NAME)];case 1:t=n.sent(),n.label=2;case 2:return e.gainsightKey=t,[2,this.gainsightKey]}}))}))},Object.defineProperty(e.prototype,"tagFunction",{get:function(){return window[this.GAINSIGHT_GLOBAL_SCOPE]},enumerable:!0,configurable:!0}),e.prototype.loadTag=function(e,t){return void 0===t&&(t=!0),Sc(this,void 0,void 0,(function(){var n,s,r=this;return Cc(this,(function(l){switch(l.label){case 0:return n=document.createElement("script"),[4,this.getGainsightKey()];case 1:return(s=l.sent())&&!this.isScriptLoaded&&(this.loadScriptTag(n,s),a.combineLatest(this.appState.currentUser,a.fromEvent(n,"load"),this.appState.state$.pipe(o.filter((function(e){return e.versions.backend})),o.map((function(e){return e.versions})),o.take(1))).pipe(o.delay(this.SCRIPT_EXECUTION_WAIT_TIME),o.filter((function(e){var t=Pc(e,2),n=t[0];return!(!t[1]||!n)}))).subscribe((function(n){var a=Pc(n,3),o=a[0],s=(a[1],a[2]),l=r.getInstanceIdFromUrl();t&&r.identify(o,e,l,s.ui.ngx,s.backend),r.isScriptLoaded=!0,r.tagFunction$.next(r.tagFunction)}))),[2]}}))}))},e.prototype.identify=function(e,t,n,a,o){var s=window,r=e.id,l=e.email,i=e.userName,c=e.firstName,u=e.lastName,d=t.name,p=t.customProperties,m=p&&p.externalReference;s[this.GAINSIGHT_GLOBAL_SCOPE]("identify",{id:r+"_"+d+"_"+n,email:l,userName:i,firstName:c,lastName:u,versionUI:a,versionBE:o,userLanguage:mu.defaultLang(),instanceId:n,externalReference:m},{id:d+"_"+n,instanceId:n})},e.prototype.triggerEvent=function(e,t){this.tagFunction&&e&&(e=e.replace(/ /g,"_"),this.tagFunction("track",e,t))},e.prototype.shouldLoadGainsightTag=function(e){return this.cookieBannerService.isConfigCookiePreferencesDefined()&&this.cookieBannerService.isFunctionalCookieEnabled()&&!this.isGainsightDisabled(e)},e.prototype.canEditProductExperienceSettings=function(){return Sc(this,void 0,void 0,(function(){var e,t,n;return Cc(this,(function(a){switch(a.label){case 0:return e=this.appState.currentTenant.value,t=e.customProperties,(n=!!this.gainsightKey)?[3,2]:[4,this.getGainsightKey()];case 1:n=a.sent()&&this.cookieBannerService.isConfigCookiePreferencesDefined()&&!this.isGainsightDisabled(t)&&!!this.cookieBannerService.getUserCookiePreferences(),a.label=2;case 2:return[2,n]}}))}))},e.prototype.isGainsightDisabled=function(e){return!1===(e&&e.gainsightEnabled)},e.prototype.loadScriptTag=function(e,t){try{var n=window,a=document.getElementsByTagName("script")[0],o=location.protocol,s=this.GAINSIGHT_GLOBAL_SCOPE;e.src=o+"//"+this.GAINSIGHT_URL+t,n[this.GAINSIGHT_GLOBAL_SCOPE]=n[this.GAINSIGHT_GLOBAL_SCOPE]||function(){(n[s].q=n[s].q||[]).push(arguments)},n[s].p=t,e.async=!0,a.parentNode.insertBefore(e,a)}catch(e){console.warn("Failed to load Gainsight PX",e)}},e.prototype.getInstanceIdFromUrl=function(){var e=location.hostname;return e.substring(e.indexOf(".")+1)},e.ctorParameters=function(){return[{type:Uc},{type:$c},{type:Gd},{type:_u}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(Uc),t.ɵɵinject($c),t.ɵɵinject(Gd),t.ɵɵinject(_u))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"})],e)}(),zd=function(){function e(e){this.gainsightService=e}return e.prototype.onClick=function(){this.actionName&&this.gainsightService.triggerEvent(this.actionName,this.actionData)},e.ctorParameters=function(){return[{type:Hd}]},jc([t.Input()],e.prototype,"actionName",void 0),jc([t.Input()],e.prototype,"actionData",void 0),jc([t.HostListener("click")],e.prototype,"onClick",null),e=jc([t.Directive({selector:"[c8yProductExperience]"})],e)}(),Vd=function(){function e(e,t,n){var s=this;this.appState=e,this.gainsightService=t,this.cookieBannerService=n,a.combineLatest([this.appState.currentTenant.pipe(o.filter(Boolean)),this.cookieBannerService.isCookieBannerShowed$]).subscribe((function(e){var t=Pc(e,2),n=t[0],a=t[1];return Sc(s,void 0,void 0,(function(){var e,t;return Cc(this,(function(o){switch(o.label){case 0:return a?[2]:(e=n.customProperties,n.name,(t=this.gainsightService.shouldLoadGainsightTag(e))?[4,this.gainsightService.isGainsightDisabledInUserPreferences()]:[3,2]);case 1:t=!o.sent(),o.label=2;case 2:return t&&this.gainsightService.loadTag(n),[2]}}))}))}))}return e.ctorParameters=function(){return[{type:Uc},{type:Hd},{type:Gd}]},e=jc([t.NgModule({declarations:[zd],exports:[zd],providers:[Hd]})],e)}(),Kd=function(){function e(e){this.alertService=e,this.search=[]}return e.prototype.getByPriority=function(){return tc.sortBy(this.search,this.byPriority)},e.prototype.byPriority=function(e){return-e.priority},e.ctorParameters=function(){return[{type:Yu}]},jc([t.Input()],e.prototype,"search",void 0),e=jc([t.Component({selector:"c8y-search-outlet",template:'<ng-container *ngFor="let item of getByPriority()">\n <ng-container *c8yOutlet="item.template"></ng-container>\n</ng-container>\n'})],e)}(),Wd=function(){function e(e){this.searchService=e,this.icon="search",this.priority=0,this.search=new t.EventEmitter,this.term=""}return e.prototype.onSearch=function(){this.search.emit(this)},e.prototype.ngAfterViewInit=function(){var e=this;this.template=void 0,this.viewInitTimeout=setTimeout((function(){return e.searchService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.searchService.remove(this)},e.ctorParameters=function(){return[{type:Cd}]},jc([t.Input()],e.prototype,"name",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"priority",void 0),jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),jc([t.Output()],e.prototype,"search",void 0),jc([t.Input()],e.prototype,"term",void 0),e=jc([t.Component({selector:"c8y-search",template:"<ng-template #template>\n <ng-content></ng-content>\n</ng-template>"})],e)}(),Yd=function(){function e(){this.pattern="",this.text="",this.elementClass="text-info",this.highlightedText=""}return e.prototype.ngOnChanges=function(){var e=s.escape(this.text||""),t=s.escape(this.pattern||""),n=s.escapeRegExp(t).replace(/\\\*/g,".*");this.highlightedText=e.replace(new RegExp(n,"i"),'<strong class="'+this.elementClass+'">$&</strong>')},jc([t.ViewChild("text",{read:t.ElementRef,static:!0})],e.prototype,"container",void 0),jc([t.Input()],e.prototype,"pattern",void 0),jc([t.Input()],e.prototype,"text",void 0),jc([t.Input()],e.prototype,"elementClass",void 0),e=jc([t.Component({selector:"c8y-highlight",template:'<span [innerHTML]="highlightedText"></span>'})],e)}(),Zd=function(){function e(){this.NO_RESULT_FOUND="No results found.",this.msg=this.NO_RESULT_FOUND}return Object.defineProperty(e.prototype,"_message",{set:function(e){e&&e.length>0?this.msg=e:this.msg=this.NO_RESULT_FOUND},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this.msg},enumerable:!0,configurable:!0}),jc([t.Input("message")],e.prototype,"_message",null),e=jc([t.Component({selector:"c8y-search-result-empty",template:'<div class="no-results">\n <div class="c8y-empty-state">\n <h1 c8yIcon="search"></h1>\n <div class="p-t-8">\n <p><strong>{{ message | translate }}</strong></p>\n <small translate>Refine your search terms.</small>\n </div>\n </div>\n</div>\n'})],e)}(),Jd=function(){function e(){}return e=jc([t.NgModule({declarations:[Kd,Wd,Yd,Zd],imports:[nc.FormsModule,l.BsDropdownModule,Uu,n.RouterModule.forChild([])],exports:[Kd,Wd,Yd,Zd]})],e)}(),Xd=function(){function e(e){this.userService=e,this.priority=0,this.click=new t.EventEmitter}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.userService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.userService.remove(this)},e.prototype.onClick=function(){this.click.emit(this)},e.ctorParameters=function(){return[{type:Id}]},jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"label",void 0),jc([t.Input()],e.prototype,"link",void 0),jc([t.Input()],e.prototype,"target",void 0),jc([t.Input()],e.prototype,"priority",void 0),jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),jc([t.Output()],e.prototype,"click",void 0),e=jc([t.Component({selector:"c8y-user-menu-item",template:'<ng-template #template>\n <li (click)="onClick()">\n <a class="interact" [attr.href]="link" [attr.target]="target">\n <i [c8yIcon]="icon"></i>\n {{ label | translate }}\n <ng-content></ng-content>\n </a>\n </li>\n</ng-template>\n'})],e)}(),Qd=function(){function n(e,t,n,a,s,r,l,i,c,u,d,p){var m=this;this.modal=e,this.user=t,this.ui=n,this.auth=a,this.client=s,this.alert=r,this.translate=l,this.userPreferences=i,this.modalService=c,this.c8yModalService=u,this.gainsightService=d,this.cookieBannerService=p,this.loading=!1,this.showProductUsageSetting=!1,this.lang=this.ui.state.lang,this.modalService.onHide.pipe(o.take(1)).subscribe((function(e){null!==e&&void 0!==m.changedLang&&m.translate.switchToLanguage(m.lang)}))}return n.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return this.updateUserInAppState(),e=this,[4,this.gainsightService.canEditProductExperienceSettings()];case 1:return e.showProductUsageSetting=n.sent(),this.showProductUsageSetting?(t=this,[4,this.gainsightService.isGainsightDisabledInUserPreferences()]):[3,3];case 2:t.currentUsageTrackingState=!n.sent()&&this.cookieBannerService.isFunctionalCookieEnabled(),n.label=3;case 3:return[2]}}))}))},n.prototype.onDismiss=function(){void 0!==this.changedLang&&this.translate.switchToLanguage(this.lang),this.modal.hide()},n.prototype.onLanguage=function(e){this.changedLang=e,this.translate.switchToLanguage(this.changedLang)},n.prototype.onProductExperience=function(e){this.usageTrackingState=e},n.prototype.updateAndClose=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:this.loading=!0,n.label=1;case 1:return n.trys.push([1,12,13,14]),this.changedLang&&this.changedLang!==this.lang?[4,this.persistLanguage(this.changedLang)]:[3,3];case 2:n.sent(),n.label=3;case 3:return this.currentUsageTrackingState===this.usageTrackingState?[3,8]:[4,this.userPreferences.set(this.gainsightService.USER_PREFERENCES_KEY,this.usageTrackingState)];case 4:return n.sent(),this.gainsightService.setFunctionalCookie(this.usageTrackingState),this.usageTrackingState?(this.gainsightService.loadTag(this.client.tenant),[3,7]):[3,5];case 5:return[4,this.gainsightTrackingAppReload()];case 6:n.sent(),n.label=7;case 7:n.label=8;case 8:return"OAUTH2"===e.customProperties.userOrigin?[3,11]:[4,this.user.updateCurrent(e)];case 9:return n.sent(),e.password&&this.updateCredentials(e.password),[4,this.updateUserInAppState()];case 10:n.sent(),n.label=11;case 11:return this.modal.hide(),this.alert.success("User saved."),[3,14];case 12:return t=n.sent(),this.alert.addServerFailure(t),[3,14];case 13:return this.loading=!1,[7];case 14:return[2]}}))}))},n.prototype.persistLanguage=function(t){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,5]),[4,this.c8yModalService.confirm("Reload recommended","To change the language in the entire application, we recommend you to reload the page. If you have any unsaved changes, you can reload later. What would you like to do?",e.Status.WARNING,{ok:"Reload now",cancel:"Reload later"})];case 1:return n.sent(),this.translate.saveInLocalStorage(t),[4,this.userPreferences.set("language",t)];case 2:return n.sent(),location.reload(),this.lang=t,[3,5];case 3:return n.sent(),this.translate.saveInLocalStorage(t),[4,this.userPreferences.set("language",t)];case 4:return n.sent(),this.lang=t,[3,5];case 5:return[2]}}))}))},n.prototype.gainsightTrackingAppReload=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.c8yModalService.confirm("Reload required","To change the tracking option in the entire application, you need to reload the page. If you have any unsaved changes, you can reload later. What would you like to do?",e.Status.WARNING,{ok:"Reload now",cancel:"Reload later"})];case 1:return t.sent(),location.reload(),[3,3];case 2:return t.sent(),[3,3];case 3:return[2]}}))}))},n.prototype.updateUserInAppState=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return[4,this.user.current()];case 1:return e=t.sent(),this.ui.currentUser.next(e.data),[2]}}))}))},n.prototype.updateCredentials=function(e){var t={password:e,user:this.ui.currentUser.value.id,tenant:this.client.tenant};this.auth.updateCredentials(t)},n.ctorParameters=function(){return[{type:oc.BsModalRef},{type:m.UserService},{type:Uc},{type:m.BasicAuth},{type:m.FetchClient},{type:Yu},{type:mu},{type:_u},{type:oc.BsModalService},{type:Fd},{type:Hd},{type:Gd}]},n=jc([t.Component({selector:"c8y-user-edit-modal",template:'<c8y-modal [customFooter]="true" [title]="\'Edit user\' | translate" (onDismiss)="onDismiss()">\n <c8y-user-edit\n [lang]="lang"\n [user]="ui.currentUser | async"\n [loading]="loading"\n [isUsageTrackingEnabled]="currentUsageTrackingState"\n [showProductUsageSetting]="showProductUsageSetting"\n (onLanguage)="onLanguage($event)"\n (onProductExperience)="onProductExperience($event)"\n (onUser)="updateAndClose($event)"\n (onCancel)="onDismiss()"\n >\n </c8y-user-edit>\n</c8y-modal>\n'})],n)}(),ep=function(){function e(e,t,n,a,o,s,r,l,i,c){this.client=e,this.basicAuth=t,this.cookieAuth=n,this.ui=a,this.user=o,this.tenant=s,this.realtime=r,this.alert=l,this.api=i,this.location=c,this.rememberMe=!1,this.TOKEN_KEY="_tcy8",this.TFATOKEN_KEY="TFAToken",this.isFirstLogin=!0,this.GREEN_MIN_LENGTH_DEFAULT=8,this.ERROR_MESSAGES={minlength:"Password must have at least 8 characters and no more than 32.",password_missmatch:"Password confirmation does not match.",maxlength:"Password must have at least 8 characters and no more than 32.",password_strength:"Your password is not strong enough. Please include numbers, lower and upper case characters",remote_error:"Server error occurred.",email:"Invalid email address.",password_change:"Your password is expired. Please set a new password.",password_reset_token_expired:"Password reset link expired. Please enter your email address to receive a new one.",tfa_pin_invalid:"The code you entered is invalid. Please try again.",pattern_phonenumber:'Invalid phone number format. Only digits, spaces, slashes ("/") and dashes ("-") allowed.',pattern_newPassword:"Password must have at least 8 characters and no more than 32 and can only contain letters, numbers and following symbols: `~!@#$%^&*()_|+-=?;:'\",.<>{}[]\\/",international_number_required:"International phone number required, in the format +49 9 876 543 210.",phone_number_error:"Could not update phone number.",pinAlreadySent:"The verification code was already sent. For a new verification code, please click on the link above.",passwordConfirm:"Password confirmation does not match.",tfaExpired:"Two-factor authentication token expired."},this.SUCCESS_MESSAGES={password_changed:"Password changed. You can now log in using new password.",password_reset_requested:"Password reset request has been sent. Please check your email.",resend_sms:"Verification code SMS resent.",send_sms:"Verification code SMS sent."},this.passwordStrengthSetting={enforcePasswordStrength:!1,greenMinLength:this.GREEN_MIN_LENGTH_DEFAULT,passwordStrengthValidity:!1},this.loginModeFilters={isOauth2Internal:function(e){var t=e.type,n=e.visibleOnLoginPage;return t===m.TenantLoginOptionType.OAUTH2_INTERNAL&&n},isBasic:function(e){var t=e.type,n=e.visibleOnLoginPage;return t===m.TenantLoginOptionType.BASIC&&n},isOauth2:function(e){var t=e.type,n=e.visibleOnLoginPage,a=e.grantType;return t===m.TenantLoginOptionType.OAUTH2&&n&&"AUTHORIZATION_CODE"===a}},this.localhostRegExp=new RegExp("localhost"),this.localhostIpRegExp=new RegExp("127.0.0.1"),this.showTenantRegExp=new RegExp("showTenant"),this.autoLogout(),this.initLoginOptions()}return e.prototype.getTenant=function(){return this.client.tenant},e.prototype.initLoginOptions=function(){var e=this.ui.state.loginOptions||[];this.loginMode=e.find(this.loginModeFilters.isOauth2Internal)||e.find(this.loginModeFilters.isBasic)||e.find(this.loginModeFilters.isOauth2)||{type:m.TenantLoginOptionType.BASIC},this.oauthOptions=e.find(this.loginModeFilters.isOauth2)||{}},e.prototype.redirectToOauth=function(){var e=this.oauthOptions.initRequest,t=(this.location?this.location._platformLocation:window).location.href,n=encodeURIComponent(t),a=(e.includes("?")?"&":"?")+"originUri="+n;window.location.href=""+e+a},e.prototype.autoLogout=function(){var e=this,t=/invalid\scredentials.*pin.*generate/i,n=function(e){return e&&"string"==typeof e.message&&t.test(e.message)};this.ui.currentUser.pipe(o.switchMap((function(t){return t?e.api.hookResponse((function(e){return 401===e.response.status})):a.EMPTY}))).subscribe((function(t){return Sc(e,void 0,void 0,(function(){var e,a,o,s=this;return Cc(this,(function(r){switch(r.label){case 0:return e=t.response,a=!1,n(e.data)?(a=!0,[3,3]):[3,1];case 1:return"function"!=typeof e.json?[3,3]:[4,e.clone().json()];case 2:o=r.sent(),n(o)&&(a=!0),r.label=3;case 3:return a&&(this.logout(!1),setTimeout((function(){return s.alert.danger(s.ERROR_MESSAGES.tfaExpired)}),500)),[2]}}))}))}))},e.prototype.getGreenMinLength=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return[4,this.getBasicAuthLoginOption()];case 1:return e=(t.sent()||{greenMinLength:null}).greenMinLength,this.passwordStrengthSetting.greenMinLength=e||this.GREEN_MIN_LENGTH_DEFAULT,[2,this.passwordStrengthSetting.greenMinLength]}}))}))},e.prototype.getEnforcePasswordStrength=function(e){return Sc(this,void 0,void 0,(function(){var t=this;return Cc(this,(function(n){return[2,this.getBasicAuthLoginOption(e).then((function(e){var n=s.get(e,"enforceStrength");return s.isString(n)?t.passwordStrengthSetting.enforcePasswordStrength="true"===n:t.passwordStrengthSetting.enforcePasswordStrength=!!n,t.passwordStrengthSetting.enforcePasswordStrength}))]}))}))},e.prototype.getPasswordStrengthValidity=function(e){return Sc(this,void 0,void 0,(function(){var t=this;return Cc(this,(function(n){return[2,this.getBasicAuthLoginOption(e).then((function(e){var n=s.get(e,"strengthValidity");return s.isString(n)?t.passwordStrengthSetting.passwordStrengthValidity="true"===n:t.passwordStrengthSetting.passwordStrengthValidity=!!n,t.passwordStrengthSetting.passwordStrengthValidity}))]}))}))},e.prototype.getPasswordStrengthEnforced=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){return t=e&&e.refresh,[2,Promise.all([this.getEnforcePasswordStrength(t),this.getPasswordStrengthValidity(t)]).then((function(e){var t=Pc(e,2),n=t[0],a=t[1];return n||a}))]}))}))},e.prototype.cleanMessages=function(){this.alert.clearAll()},e.prototype.addSuccessMessage=function(e){var t=this.SUCCESS_MESSAGES[e];t&&this.alert.add({text:t,type:"success",timeout:0})},e.prototype.getAuthStrategy=function(){var e=this.cookieAuth,t=this.getStoredToken(),n=this.getStoredTfaToken();return t&&(e=this.basicAuth,this.setCredentials({token:t,tfa:n},this.basicAuth)),e},e.prototype.useBasicAuth=function(e){return this.setCredentials(e,this.basicAuth),this.basicAuth},e.prototype.login=function(e,t){return void 0===e&&(e=this.getAuthStrategy()),Sc(this,void 0,void 0,(function(){var n,a,o,s,r,l;return Cc(this,(function(i){switch(i.label){case 0:return this.client.setAuth(e),[4,this.tenant.current()];case 1:return n=i.sent(),a=n.data,[4,this.switchLoginMode(t)];case 2:return i.sent()&&(e=this.cookieAuth),[4,this.user.current()];case 3:return o=i.sent(),s=o.data,[4,this.verifyAppAccess()];case 4:return i.sent(),r=this.getSupportUserName(t),(l=this.setCredentials({tenant:a.name,user:(r?r+"$":"")+s.userName},e))&&this.storeBasicAuthToken(l),[4,this.authFulfilled(a,s,r)];case 5:return i.sent(),[2]}}))}))},e.prototype.authFulfilled=function(e,t,n){return Sc(this,void 0,void 0,(function(){var a;return Cc(this,(function(o){switch(o.label){case 0:return e?[3,2]:[4,this.tenant.current()];case 1:a=o.sent().data,e=a,this.client.tenant=e.name,o.label=2;case 2:return t?[3,4]:[4,this.user.current()];case 3:a=o.sent().data,t=a,o.label=4;case 4:return n||(n=null),this.ui.setUser({user:t,supportUserName:n}),this.ui.currentTenant.next(e),[2]}}))}))},e.prototype.switchLoginMode=function(e){return Sc(this,void 0,void 0,(function(){var t,n,a;return Cc(this,(function(o){switch(o.label){case 0:return(t=this.isPasswordGrantLogin(e))&&e?[4,this.generateOauthToken(e)]:[3,6];case 1:if((n=o.sent()).ok)return[3,5];o.label=2;case 2:return o.trys.push([2,4,,5]),[4,n.json()];case 3:throw a=o.sent(),{res:n,data:a};case 4:throw o.sent();case 5:this.client.setAuth(this.cookieAuth),this.cleanLocalStorage(),this.basicAuth.logout(),o.label=6;case 6:return[2,t]}}))}))},e.prototype.generateOauthToken=function(e){return Sc(this,void 0,void 0,(function(){var t,n;return Cc(this,(function(a){switch(a.label){case 0:return this.isPasswordGrantLogin(e)&&e?(t=new URLSearchParams({grant_type:"PASSWORD",username:e.user,password:e.password,tfa_code:e.tfa}),n=new URLSearchParams(this.loginMode.initRequest.split("?").pop()),e.tenant=n.get("tenant_id"),[4,this.client.fetch("tenant/oauth?"+n.toString(),{method:"POST",body:t.toString(),headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8"}})]):[3,2];case 1:return[2,a.sent()];case 2:return[2]}}))}))},e.prototype.isPasswordGrantLogin=function(e){return!(this.isSupportUser(e)||!this.loginMode||this.loginMode.type!==m.TenantLoginOptionType.OAUTH2_INTERNAL)},e.prototype.isSupportUser=function(e){return e&&e.user.includes("$")},e.prototype.showTenant=function(){return!this.ui.state.loginOptions||this.isLocal()||this.isShowTenant()},e.prototype.logout=function(e){return void 0===e&&(e=!0),Sc(this,void 0,void 0,(function(){var t,n;return Cc(this,(function(a){switch(a.label){case 0:t=null,a.label=1;case 1:return a.trys.push([1,4,5,6]),[4,this.reset()];case 2:return n=Pc.apply(void 0,[a.sent(),2]),n[0],[4,n[1].json()];case 3:return t=a.sent(),[3,6];case 4:return a.sent(),this.alert.removeLastDanger(),[3,6];case 5:return t&&t.url?this.redirect(t.url):e&&(this.location.replaceState({},"","",""),window.location.reload()),[7];case 6:return[2]}}))}))},e.prototype.reset=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){return this.cleanLocalStorage(),this.cleanSessionStorage(),this.realtime.disconnect(),this.ui.currentUser.next(null),[2,Promise.all([this.basicAuth.logout(),this.cookieAuth.logout()])]}))}))},e.prototype.saveTFAToken=function(e,t){t.setItem(this.TFATOKEN_KEY,e)},e.prototype.verifyAppAccess=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.ui.loadManifest()];case 1:return t.sent(),[3,3];case 2:if(!(e=t.sent()).res||404!==e.res.status||!this.isLocal())throw e;return[3,3];case 3:return[2]}}))}))},e.prototype.setCredentials=function(e,t){e.tenant&&(this.client.tenant=e.tenant);var n=this.basicAuth.updateCredentials({tenant:e.tenant,user:e.user}),a=bc({token:n},e);return t.updateCredentials(a)},e.prototype.isLocal=function(){var e=window.location.hostname;return this.localhostIpRegExp.test(e)||this.localhostRegExp.test(e)},e.prototype.saveToken=function(e,t){t.setItem(this.TOKEN_KEY,e)},e.prototype.storeBasicAuthToken=function(e){this.saveToken(e,sessionStorage),this.rememberMe&&this.saveToken(e,localStorage)},e.prototype.cleanLocalStorage=function(){localStorage.removeItem(this.TOKEN_KEY),localStorage.removeItem(this.TFATOKEN_KEY)},e.prototype.cleanSessionStorage=function(){sessionStorage.removeItem(this.TOKEN_KEY),sessionStorage.removeItem(this.TFATOKEN_KEY)},e.prototype.isShowTenant=function(){return this.showTenantRegExp.test(window.location.href)},e.prototype.redirect=function(e){window.location.href=e},e.prototype.getBasicAuthLoginOption=function(e){return Sc(this,void 0,void 0,(function(){var t,n;return Cc(this,(function(a){switch(a.label){case 0:return e?[4,this.ui.refreshLoginOptions()]:[3,2];case 1:a.sent(),a.label=2;case 2:return t=this.ui.state.loginOptions||[],n=t.find((function(e){return"BASIC"===e.type})),[2,Promise.resolve(n)]}}))}))},e.prototype.getSupportUserName=function(e){return void 0===e&&(e=this.getStoredCredentials()),e?e.user.match(/^(.+\/)?((.+)\$)?(.+)?$/)[3]:null},e.prototype.getStoredCredentials=function(){var e=this.getStoredToken();return e?this.decodeToken(e):null},e.prototype.getStoredToken=function(){return localStorage.getItem(this.TOKEN_KEY)||sessionStorage.getItem(this.TOKEN_KEY)},e.prototype.getStoredTfaToken=function(){return localStorage.getItem(this.TFATOKEN_KEY)||sessionStorage.getItem(this.TFATOKEN_KEY)},e.prototype.decodeToken=function(e){var t=decodeURIComponent(escape(window.atob(e))).match(/(([^/]*)\/)?([^/:]+):(.+)/);return{tenant:t[2],user:t[3],password:t[4]}},e.ctorParameters=function(){return[{type:m.FetchClient},{type:m.BasicAuth},{type:m.CookieAuth},{type:Uc},{type:m.UserService},{type:m.TenantService},{type:m.Realtime},{type:Yu},{type:c.ApiService},{type:i.LocationStrategy,decorators:[{type:t.Optional}]}]},e=jc([t.Injectable(),wc(9,t.Optional())],e)}(),tp=function(){function e(e,n,a,o,s){this.user=e,this.ui=n,this.client=a,this.alert=o,this.loginService=s,this.passwordConfirmedEmitter=new t.EventEmitter,this.loading=!1}return e.prototype.passwordConfirm=function(){return Sc(this,void 0,void 0,(function(){var e,t,n,a,o;return Cc(this,(function(r){switch(r.label){case 0:if(!this.password)return[3,5];e=this.ui.currentSupportUserName.value,t=this.ui.currentUser.value.id,n={password:this.password,user:(e?e+"$":"")+t,tenant:this.client.tenant},r.label=1;case 1:return r.trys.push([1,3,4,5]),this.loading=!0,a=s.clone(this.loginService.useBasicAuth({})),delete n.tfa,a.updateCredentials(n),[4,this.createNewClient(a,this.client.baseUrl).user.current()];case 2:return r.sent(),this.emitSuccessAndClose(),[3,5];case 3:return(o=r.sent()).res&&401===o.res.status&&o.data&&/pin|totp/i.test(o.data.message)?this.emitSuccessAndClose():this.alert.danger("Provided password doesn't match your current one."),[3,5];case 4:return this.loading=!1,[7];case 5:return[2]}}))}))},e.prototype.cancel=function(){this.passwordConfirmedEmitter.emit(!1),this.modal._dismiss()},e.prototype.createNewClient=function(e,t){return new m.Client(e,t)},e.prototype.emitSuccessAndClose=function(){this.passwordConfirmedEmitter.emit(!0),this.modal._dismiss()},e.ctorParameters=function(){return[{type:m.UserService},{type:Uc},{type:m.FetchClient},{type:Yu},{type:ep}]},jc([t.Output()],e.prototype,"passwordConfirmedEmitter",void 0),jc([t.ViewChild("modal",{static:!1})],e.prototype,"modal",void 0),e=jc([t.Component({selector:"c8y-password-confirm-modal",template:'<c8y-modal [customFooter]="true" [title]="\'Confirm your current password\' | translate" #modal>\r\n <form #confirmForm="ngForm" (ngSubmit)="confirmForm.form.valid && passwordConfirm()">\r\n <c8y-form-group [hasWarning]="true">\r\n <label translate for="currentPassword">Enter your password</label>\r\n <input\r\n id="currentPassword"\r\n [(ngModel)]="password"\r\n type="password"\r\n name="password"\r\n class="form-control"\r\n placeholder="{{ \'Enter your password\' | translate }}"\r\n required\r\n />\r\n <c8y-messages>\r\n <c8y-message translate>\r\n Enter the password of the user that you are currently logged in with.\r\n </c8y-message>\r\n </c8y-messages>\r\n </c8y-form-group>\r\n\r\n <div class="modal-footer">\r\n <button\r\n title="{{ \'Cancel\' | translate }}"\r\n class="btn btn-default"\r\n type="button"\r\n (click)="cancel()"\r\n translate\r\n >\r\n Cancel\r\n </button>\r\n <button\r\n title="{{ \'Save\' | translate }}"\r\n class="btn btn-primary"\r\n type="submit"\r\n [disabled]="!confirmForm.form.valid || loading"\r\n translate\r\n >\r\n Save\r\n </button>\r\n </div>\r\n </form>\r\n</c8y-modal>\r\n'})],e)}(),np=function(){function e(e){this.modalService=e,this.DEFAULT_PASSWORD_MIN_LENGTH=8,this.GREEN={colorName:"green",color:"rgb(0, 128, 0)",description:"strong",passwordStrength:m.PasswordStrength.GREEN},this.YELLOW={colorName:"yellow",color:"rgb(255, 204, 51)",description:"medium",passwordStrength:m.PasswordStrength.YELLOW},this.RED={colorName:"red",color:"rgb(170, 0, 51)",description:"weak",passwordStrength:m.PasswordStrength.RED}}return e.prototype.confirmPassword=function(){return this.modalService.show(tp).content.passwordConfirmedEmitter.pipe(o.take(1))},e.prototype.hasLowerCase=function(e){return-1!==e.search(/[a-z]/)},e.prototype.hasUpperCase=function(e){return-1!==e.search(/[A-Z]/)},e.prototype.hasNumbers=function(e){return-1!==e.search(/[0-9]/)},e.prototype.hasSpecialChars=function(e){return-1!==e.search(/[^0-9a-zA-Z]+/)},e.prototype.getStrengthColor=function(e){var t=s.filter([this.hasLowerCase(e),this.hasUpperCase(e),this.hasNumbers(e),this.hasSpecialChars(e)]).length;return t>3?this.GREEN:t>=3?this.YELLOW:this.RED},e.prototype.getDefaultPasswordMinLength=function(){return this.DEFAULT_PASSWORD_MIN_LENGTH},e.ctorParameters=function(){return[{type:oc.BsModalService}]},e=jc([t.Injectable()],e)}(),ap=function(){function n(e,t,n,a){this.user=e,this.modalService=t,this.modal=n,this.loginService=a}return n.prototype.totpSetupVerified=function(t){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){switch(t.label){case 0:return[4,this.user.activateTotp()];case 1:t.sent(),this.modal.hide(),t.label=2;case 2:return t.trys.push([2,5,,6]),[4,this.modalService.acknowledge("Logout required","You must log out in order to apply your changes",e.Status.WARNING,"Log out")];case 3:return t.sent(),[4,this.loginService.logout()];case 4:return t.sent(),[3,6];case 5:return t.sent(),[3,6];case 6:return[2]}}))}))},n.prototype.close=function(){this.modal.hide()},n.ctorParameters=function(){return[{type:m.UserService},{type:Fd},{type:oc.BsModalRef},{type:ep}]},n=jc([t.Component({selector:"c8y-user-totp-setup",template:'<c8y-modal [customFooter]="true">\n <ng-container c8y-modal-title>\n <button\n title="{{ \'Close\' | translate }}"\n (click)="close()"\n type="button"\n class="close"\n ><span aria-hidden="true">×</span></button>\n <h3 class="text-center" translate>Set up two-factor authentication</h3>\n </ng-container>\n <c8y-totp-setup></c8y-totp-setup>\n <c8y-totp-challenge (onSuccess)="totpSetupVerified($event)"></c8y-totp-challenge>\n</c8y-modal>\n'})],n)}(),op=function(){function e(e,n,a,o,s,r,l,i,c,u){this.state=e,this.translate=n,this.passwordService=a,this.modalConfirmService=o,this.bsModalService=s,this.alert=r,this.userService=l,this.tenantLoginOptionsService=i,this.tenantService=c,this.userPreferencesService=u,this.loading=!1,this.showProductUsageSetting=!1,this.isUsageTrackingEnabled=!0,this.onUser=new t.EventEmitter,this.onLanguage=new t.EventEmitter,this.onProductExperience=new t.EventEmitter,this.onCancel=new t.EventEmitter,this.userHasActiveTotp=!1,this.userCanSetupTotp=!1,this.isPhoneRequired=!1}return Object.defineProperty(e.prototype,"user",{get:function(){return this._user},set:function(e){this._user=s.clone(e),this.userIsExternal="OAUTH2"===e.customProperties.userOrigin,this.isPhoneRequired=this.isPhoneRequired&&e.twoFactorAuthenticationEnabled},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){var e,t,n,a;return Cc(this,(function(o){switch(o.label){case 0:return[4,this.tenantService.current()];case 1:return e=o.sent().data,[4,this.tenantService.getTfaSettings(e)];case 2:return t=o.sent(),n=t.enabledOnSystemLevel,a=t.enabledOnTenantLevel,this.isTfaEnabled=n||a,[4,this.initializeTotpSettings()];case 3:return o.sent(),this.user.twoFactorAuthenticationEnabled&&!this.userCanSetupTotp&&(this.isPhoneRequired=!0),[2]}}))}))},Object.defineProperty(e.prototype,"langs",{get:function(){return this.state.state.langs},enumerable:!0,configurable:!0}),e.prototype.setupTotp=function(){this.bsModalService.show(ap,{class:"modal-sm"}),this.cancel()},e.prototype.cancel=function(){this.onCancel.emit()},e.prototype.save=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){return this.loading||(this.showProductUsageSetting&&(this.onProductExperience.emit(this.isUsageTrackingEnabled),this.userPreferencesService.set("gainsightEnabled",this.isUsageTrackingEnabled)),this._user.password?this.saveAfterPasswordConfirmation():this.onUser.emit(this._user)),[2]}))}))},e.prototype.onNewPasswordChanged=function(e){this._user.password=e.password},e.prototype.initializeTotpSettings=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=this,[4,this.canUserSetupTotp()];case 1:return e.userCanSetupTotp=n.sent(),this.userCanSetupTotp?[4,this.userService.getActivityTotp()]:[3,3];case 2:t=n.sent().data,this.userHasActiveTotp=t.isActive,n.label=3;case 3:return[3,5];case 4:return n.sent(),this.alert.removeLastDanger(),[3,5];case 5:return[2]}}))}))},e.prototype.canUserSetupTotp=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return[4,this.tenantLoginOptionsService.detail()];case 1:return[2,e.sent().data.loginOptions.some((function(e){var t=e.tfaStrategy;return"totp"===(void 0===t?"":t).toLowerCase()}))]}}))}))},e.prototype.saveAfterPasswordConfirmation=function(){var e=this;this.passwordService.confirmPassword().subscribe((function(t){t&&e.onUser.emit(e._user)}))},e.ctorParameters=function(){return[{type:Uc},{type:mu},{type:np},{type:Fd},{type:oc.BsModalService},{type:Yu},{type:m.UserService},{type:m.TenantLoginOptionsService},{type:m.TenantService},{type:_u}]},jc([t.Input()],e.prototype,"lang",void 0),jc([t.Input()],e.prototype,"loading",void 0),jc([t.Input()],e.prototype,"user",null),jc([t.Input()],e.prototype,"showProductUsageSetting",void 0),jc([t.Input()],e.prototype,"isUsageTrackingEnabled",void 0),jc([t.Output()],e.prototype,"onUser",void 0),jc([t.Output()],e.prototype,"onLanguage",void 0),jc([t.Output()],e.prototype,"onProductExperience",void 0),jc([t.Output()],e.prototype,"onCancel",void 0),e=jc([t.Component({selector:"c8y-user-edit",template:'<form #userForm="ngForm" (ngSubmit)="userForm.form.valid && save()">\n <div class="alert alert-warning" role="alert" *ngIf="userIsExternal" translate>\n Some of the user settings are not editable here because they are managed via your authorization\n server.\n </div>\n <c8y-form-group>\n <label translate for="userName">Username (e.g. email)</label>\n <input\n id="userName"\n class="form-control"\n [(ngModel)]="user.userName"\n name="userName"\n autocomplete="off"\n required\n maxlength="254"\n placeholder="{{ \'e.g. joe.doe@example.com`LOCALIZE`\' | translate }}"\n [disabled]="user.id"\n c8yDefaultValidation="user"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate for="displayName">Login alias</label>\n <input\n id="displayName"\n class="form-control"\n [(ngModel)]="user.displayName"\n name="displayName"\n autocomplete="off"\n maxlength="254"\n placeholder="{{ \'e.g. joe.doe`LOCALIZE`\' | translate }}"\n [disabled]="userIsExternal"\n c8yDefaultValidation="loginAlias"\n />\n </c8y-form-group>\n\n <c8y-form-group [hasWarning]="!user.email">\n <label translate for="userEmail">Email</label>\n <input\n id="userEmail"\n class="form-control"\n type="email"\n name="email"\n [maxlength]="254"\n autocomplete="off"\n placeholder="{{ \'e.g. joe.doe@example.com`LOCALIZE`\' | translate }}"\n [(ngModel)]="user.email"\n email\n [required]="user.newsletter"\n [disabled]="userIsExternal"\n />\n <c8y-messages>\n <c8y-message *ngIf="!user.email" translate\n >Note that email is required to reset password.</c8y-message\n >\n </c8y-messages>\n </c8y-form-group>\n\n <div class="row" style="margin-left:-15px; margin-right:-15px">\n <div class="col-sm-6">\n <c8y-form-group>\n <label translate for="userFirstName">First name</label>\n <input\n id="userFirstName"\n class="form-control"\n autocomplete="off"\n maxlength="50"\n name="firstName"\n [(ngModel)]="user.firstName"\n [disabled]="userIsExternal"\n />\n </c8y-form-group>\n </div>\n <div class="col-sm-6">\n <c8y-form-group>\n <label translate for="userLastName">Last name</label>\n <input\n id="userLastName"\n class="form-control"\n autocomplete="off"\n maxlength="50"\n name="lastName"\n [(ngModel)]="user.lastName"\n [disabled]="userIsExternal"\n />\n </c8y-form-group>\n </div>\n </div>\n\n <c8y-form-group>\n <label translate for="userTelephone">Telephone</label>\n <input\n id="userTelephone"\n class="form-control"\n autocomplete="off"\n name="phone"\n maxlength="254"\n [(ngModel)]="user.phone"\n placeholder="{{ \'e.g. +49 9 876 543 210`LOCALIZE`\' | translate }}"\n c8yPhoneValidation\n c8yDefaultValidation="phoneNumber"\n [required]="isPhoneRequired"\n [disabled]="userIsExternal"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate for="userLang">Language</label>\n <div class="c8y-select-wrapper">\n <select\n id="userLang"\n class="form-control"\n #selectLang\n name="lang"\n [(ngModel)]="lang"\n (change)="onLanguage.emit(selectLang.value)"\n >\n <option *ngFor="let lang of langs" [value]="lang">{{\n translate.getNativeLanguage(lang)\n }}</option>\n </select>\n <span></span>\n </div>\n </c8y-form-group>\n\n <c8y-form-group class="p-t-8 p-b-8 separator-top" *ngIf="showProductUsageSetting">\n <strong translate>Product experience</strong>\n <label class="c8y-switch" for="productUsageTracking">\n <input\n id="productUsageTracking"\n name="productUsageTracking"\n type="checkbox"\n [(ngModel)]="isUsageTrackingEnabled"\n />\n <span></span>\n {{ \'Enable anonymous tracking to enhance the product experience\' | translate }}\n </label>\n </c8y-form-group>\n\n <div class="form-group" *ngIf="!userIsExternal">\n <label class="control-label">{{ \'Login options\' | translate }}</label>\n <c8y-new-password (password)="onNewPasswordChanged($event)"></c8y-new-password>\n <button\n title="{{ \'Set up two-factor authentication\' | translate }}"\n class="btn btn-default"\n type="button"\n (click)="setupTotp()"\n *ngIf="userCanSetupTotp && !userHasActiveTotp && isTfaEnabled"\n >\n {{ \'Set up two-factor authentication\' | translate }}\n </button>\n </div>\n\n <c8y-form-group *ngIf="!!(state.state$ | async).newsletter">\n <label translate>Newsletter</label>\n <label\n title="{{ \'Send me information about outages, maintenance or updates.\' | translate }}"\n class="c8y-checkbox"\n >\n <input\n type="checkbox"\n name="newsletter"\n [(ngModel)]="user.newsletter"\n [disabled]="userIsExternal"\n />\n <span></span>\n <span>\n {{ \'Send me information about outages, maintenance or updates.\' | translate }}\n </span>\n </label>\n </c8y-form-group>\n\n <div class="modal-footer">\n <button\n title="{{ \'Cancel\' | translate }}"\n class="btn btn-default"\n type="button"\n (click)="cancel()"\n >\n {{ \'Cancel\' | translate }}\n </button>\n <button\n title="{{ \'Save\' | translate }}"\n class="btn btn-primary"\n type="submit"\n [disabled]="!userForm.form.valid || userForm.form.pristine || loading"\n >\n {{ \'Save\' | translate }}\n </button>\n </div>\n</form>\n'})],e)}(),sp=function(){function n(e,t,n,a,o,s,r,l,i){this.ui=e,this.bsModalService=t,this.modalService=n,this.loginService=a,this.translateService=o,this.tenantService=s,this.alertService=r,this.user=l,this.optionsService=i}return n.prototype.copyIt=function(e){var t,n={handleEvent:function(t){t.clipboardData.setData("text/plain",e),t.preventDefault()}};document.addEventListener("copy",n);try{t=document.execCommand("copy")}catch(e){t=!1}t?this.alertService.addByText("success","Copied to clipboard."):this.alertService.addByText("danger","Could not copy to clipboard."),document.removeEventListener("copy",n)},n.prototype.editUser=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){return this.bsModalService.show(Qd),[2]}))}))},n.prototype.logout=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return[4,this.loginService.logout()];case 1:return e.sent(),[2]}}))}))},n.prototype.activateSupportAccess=function(){return Sc(this,void 0,void 0,(function(){var t,n,a,o,s;return Cc(this,(function(r){switch(r.label){case 0:t="Activate support user access",n=this.optionsService.get("companyName","Cumulocity"),"You are about to allow a support user from {{companyName}} to access your tenant to help you with your issue.","You are about to allow a support user to access your tenant to help you with your issue.","Do you want to proceed?",a=[this.translateService.instant(n?"You are about to allow a support user from {{companyName}} to access your tenant to help you with your issue.":"You are about to allow a support user to access your tenant to help you with your issue.",{companyName:n}),this.translateService.instant("Do you want to proceed?")].join(" "),o={ok:"Activate access",cancel:"Cancel"},s="Support user access activated.",r.label=1;case 1:return r.trys.push([1,5,,6]),[4,this.modalService.confirm(t,a,e.Status.DANGER,o)];case 2:return r.sent(),[4,this.tenantService.enableSupportUser()];case 3:return r.sent(),[4,this.refreshCurrentUser()];case 4:return r.sent(),this.alertService.success(s),[3,6];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},n.prototype.deactivateSupportAccess=function(){return Sc(this,void 0,void 0,(function(){var t,n,a,o,s,r,l,i,c;return Cc(this,(function(u){switch(u.label){case 0:return t="Deactivate support user access",n=this.optionsService.get("companyName","Cumulocity"),a="You are about to block a support user from {{companyName}} from accessing your tenant to help you with your issue.",o="You are about to block a support user from accessing your tenant to help you with your issue.",[4,this.user.current()];case 1:return s=u.sent().data,[4,this.user.hasRole(s,"ROLE_TENANT_ADMIN")];case 2:r=u.sent(),"Deactivating support access as tenant admin will disable all other support requests on your tenant.","Do you want to proceed?",l=[this.translateService.instant(n?a:o,{companyName:n}),r?this.translateService.instant("Deactivating support access as tenant admin will disable all other support requests on your tenant."):"",this.translateService.instant("Do you want to proceed?")].filter(Boolean).join(" "),i={ok:"Deactivate access",cancel:"Cancel"},c="Support user access deactivated.",u.label=3;case 3:return u.trys.push([3,7,,8]),[4,this.modalService.confirm(t,l,e.Status.DANGER,i)];case 4:return u.sent(),[4,this.tenantService.disableSupportUser()];case 5:return u.sent(),[4,this.refreshCurrentUser()];case 6:return u.sent(),this.alertService.success(c),[3,8];case 7:return u.sent(),[3,8];case 8:return[2]}}))}))},n.prototype.getSortedItems=function(){return s.sortBy(Array.from(this.items),this.byPriority)},n.prototype.refreshCurrentUser=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return[4,this.user.current()];case 1:return e=t.sent(),this.ui.currentUser.next(e.data),[2]}}))}))},n.prototype.byPriority=function(e){return-e.priority},n.ctorParameters=function(){return[{type:Uc},{type:oc.BsModalService},{type:Fd},{type:ep},{type:p.TranslateService},{type:m.TenantService},{type:Yu},{type:m.UserService},{type:$c}]},jc([t.Input()],n.prototype,"items",void 0),n=jc([t.Component({selector:"c8y-user-menu-outlet",template:'<div\n dropdown\n class="dropdown"\n>\n <button\n class="main-header-button c8y-dropdown dropdown-toggle text-nowrap"\n dropdownToggle\n >\n <span\n class="d-inline-block hidden-xs text-truncate m-r-8"\n style="vertical-align: text-bottom; max-width: 104px;"\n title="{{ui.currentUser | async | shortenUserName}}"\n >\n {{ui.currentUser | async | shortenUserName}}\n </span>\n <i\n [c8yIcon]="\'c8y-user\'"\n class="icon-2x"\n ></i>\n </button>\n <ul\n *dropdownMenu\n class="dropdown-menu dropdown-menu-right"\n style="max-width: 240px;"\n >\n <ng-container *ngFor="let item of getSortedItems()">\n <ng-container *ngIf="item.template">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n <ng-container *ngIf="!item.template">\n <li (click)="item.click()">\n <a class="interact" [attr.href]="item.link" [attr.target]="item.target">\n <i [c8yIcon]="item.icon"></i>\n {{item.label | translate}}\n </a>\n </li>\n </ng-container>\n </ng-container>\n <li\n *ngIf="!(ui.state$ | async).hidePowered"\n role="separator"\n class="divider"\n ></li>\n <li\n class="dropdown-header bg-gray-white text-pre-normal"\n style="margin-top: -1px;"\n *ngIf="!(ui.state$ | async).hidePowered"\n >\n <div class="flex-row">\n <i\n [c8yIcon]="\'info-circle\'"\n class="text-info flex-item-v-start text-14"\n style="margin: 1px 6px 0 -3px;"\n ></i>\n <span class="text-muted text-truncate">\n {{\'Tenant ID\' | translate}}: <strong>\n <span class="text-primary interact" (click)="$event.stopPropagation(); copyIt(ui.currentTenant.value.name)">\n {{ui.currentTenant.value.name}}&nbsp;\n <i [c8yIcon]="\'clipboard\'"></i>\n </span>\n </strong><br>\n {{\'Backend\' | translate}}: <strong>{{(ui.state$ | async).versions.backend}}</strong><br>\n {{\'UI\' | translate }}: <strong>{{ui.uiVersion}}</strong>\n </span>\n </div>\n </li>\n </ul>\n</div>\n\n\x3c!-- the default items --\x3e\n<c8y-user-menu-item\n [icon]="\'user-menu-male\'"\n [label]="\'User settings\' | translate"\n [priority]="20"\n (click)="editUser()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n [icon]="\'sign-out\'"\n [label]="\'Logout\' | translate"\n (click)="logout()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n *ngIf="!(ui.currentUser | async).supportUserEnabled && ((ui.state$ | async).activateSupportUserAvailable)"\n [icon]="\'c8y-c8y-support\'"\n [label]="\'Activate support\' | translate"\n (click)="activateSupportAccess()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n *ngIf="(ui.currentUser | async).supportUserEnabled && ((ui.state$ | async).activateSupportUserAvailable)"\n [icon]="\'c8y-c8y-support\'"\n [label]="\'Deactivate support\' | translate"\n (click)="deactivateSupportAccess()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n *ngIf="(ui.state$ | async).supportUrl"\n [icon]="\'question-circle\'"\n [link]="(ui.state$ | async).supportUrl"\n [target]="\'_blank\'"\n [label]="\'Request support\' | translate"\n></c8y-user-menu-item>\n'})],n)}(),rp=function(){function e(e,t,n){var a=this;this.loginService=e,this.passwordStrengthChecker=t,this.passwordService=n,this.minGreenLength=0,this.checklist=[{label:"Include lowercase characters (e.g. abcdef)",check:this.passwordStrengthChecker.hasLowerCase,icon:"",contextualColor:""},{label:"Include uppercase characters (e.g. ABCDEF)",check:this.passwordStrengthChecker.hasUpperCase,icon:"",contextualColor:""},{label:"Include numbers (e.g. 123456)",check:this.passwordStrengthChecker.hasNumbers,icon:"",contextualColor:""},{label:"Include symbols (e.g. !@#$%^)",check:this.passwordStrengthChecker.hasSpecialChars,icon:"",contextualColor:""},{label:"Must have at least {{length}} characters",check:function(e){return e.length>=a.minGreenLength},icon:"",contextualColor:""}]}return Object.defineProperty(e.prototype,"password",{set:function(e){"string"==typeof e&&this.onPasswordChange(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return e=this,[4,this.loginService.getGreenMinLength()];case 1:return e.minGreenLength=t.sent(),this.minGreenLength||(this.minGreenLength=this.passwordService.getDefaultPasswordMinLength()),[2]}}))}))},Object.defineProperty(e.prototype,"translateParams",{get:function(){return{length:this.minGreenLength}},enumerable:!0,configurable:!0}),e.prototype.onPasswordChange=function(e){this.checklist=s.map(this.checklist,(function(t){var n=t.check(e);return s.assign(t,{icon:n?"check-circle":"",contextualColor:n?"":"text-muted"}),t}))},e.ctorParameters=function(){return[{type:ep},{type:np},{type:np}]},jc([t.Input("password")],e.prototype,"password",null),e=jc([t.Component({selector:"c8y-password-check-list",template:'<div>\n <span class="small">{{ \'Please meet 5 out of the 5 conditions below\' | translate }}:</span>\n <ul class="list-unstyled">\n <li class="small" *ngFor="let requirement of checklist">\n <i [c8yIcon]="requirement.icon" class="text-success"></i>\n <span\n class="small {{ requirement.contextualColor }}"\n [translate]="requirement.label"\n [translateParams]="this.translateParams"\n ></span>\n </li>\n </ul>\n</div>\n'})],e)}(),lp=function(){function e(e){this.passwordConfirm=e}var n;return n=e,e.prototype.validate=function(e){var t=e.value,n=e.root.get(this.passwordConfirm);return n&&t!==n.value?{passwordConfirm:!0}:null},e.ctorParameters=function(){return[{type:String,decorators:[{type:t.Attribute,args:["passwordConfirm"]}]}]},e=n=jc([t.Directive({selector:"[passwordConfirm]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]}),wc(0,t.Attribute("passwordConfirm"))],e)}(),ip=function(){function e(){this.GREEN={colorName:"green",color:"rgb(0, 128, 0)",description:"strong",passwordStrength:m.PasswordStrength.GREEN},this.YELLOW={colorName:"yellow",color:"rgb(255, 204, 51)",description:"medium",passwordStrength:m.PasswordStrength.YELLOW},this.RED={colorName:"red",color:"rgb(170, 0, 51)",description:"weak",passwordStrength:m.PasswordStrength.RED}}return e.prototype.hasLowerCase=function(e){return-1!==e.search(/[a-z]/)},e.prototype.hasUpperCase=function(e){return-1!==e.search(/[A-Z]/)},e.prototype.hasNumbers=function(e){return-1!==e.search(/[0-9]/)},e.prototype.hasSpecialChars=function(e){return-1!==e.search(/[^0-9a-zA-Z]+/)},e.prototype.getStrengthColor=function(e){var t=s.filter([this.hasLowerCase(e),this.hasUpperCase(e),this.hasNumbers(e),this.hasSpecialChars(e)]).length;return t>3?this.GREEN:t>=3?this.YELLOW:this.RED},e=jc([t.Injectable()],e)}(),cp=function(){function e(e){this.passwordStrengthCheckerService=e,this.strength=new t.EventEmitter,this.password=""}return Object.defineProperty(e.prototype,"password",{set:function(e){"string"==typeof e&&(this.model=this.passwordStrengthCheckerService.getStrengthColor(e),this.strength.emit(this.model))},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:np}]},jc([t.Input("password")],e.prototype,"password",null),jc([t.Output()],e.prototype,"strength",void 0),e=jc([t.Component({selector:"c8y-password-strength",template:'<div class="password-strength password-{{ model.colorName }}">\r\n <label class="password-strength-label small" translate>\r\n Password strength\r\n </label>\r\n <div>\r\n <div class="password-bar"></div>\r\n </div>\r\n <span class="small">\r\n {{ model.description | translate }}\r\n </span>\r\n</div>\r\n'})],e)}(),up=function(){function e(e){this.loginService=e,this.password=new t.EventEmitter,this.model={},this.changePassword=!1,this.passwordEnforced=!1}return e.prototype.ngOnInit=function(){var e=this;this.loadPasswordStrengthSettings(),this.loginService.getGreenMinLength().then((function(t){e.minlength=t}))},e.prototype.newPasswordChanged=function(){this.password.emit({password:this.model.newPassword,passwordStrength:this.model.strength})},e.prototype.loadPasswordStrengthSettings=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return e=this,[4,this.loginService.getPasswordStrengthEnforced({refresh:!0})];case 1:return e.passwordEnforced=t.sent(),[2]}}))}))},e.prototype.showPasswordStrength=function(){return this.model.newPassword&&this.model.newPassword.length>=this.minlength},e.prototype.toggleChangePassword=function(){this.changePassword=!this.changePassword,this.changePassword||(this.password.emit({}),this.model={})},e.ctorParameters=function(){return[{type:ep}]},jc([t.Output()],e.prototype,"password",void 0),e=jc([t.Component({selector:"c8y-new-password",template:'<div class="form-group">\n <button type="button" class="btn btn-default" (click)="toggleChangePassword()">\n <ng-container *ngIf="!changePassword">\n {{ \'Change password\' | translate }}\n </ng-container>\n <ng-container *ngIf="changePassword">\n {{ \'Cancel password change\' | translate }}\n </ng-container>\n </button>\n</div>\n\n<div *ngIf="changePassword" class="row content-flex-50">\n <div class="col-7">\n <c8y-form-group>\n <label for="newPassword" translate>Password</label>\n <input\n id="newPassword"\n name="newPassword"\n type="password"\n #newPassword="ngModel"\n class="form-control"\n [(ngModel)]="model.newPassword"\n (change)="newPasswordChanged()"\n (input)="newPasswordConfirm.control.updateValueAndValidity()"\n required\n c8yDefaultValidation="password"\n autocomplete="new-password"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label for="newConfirmPassword" translate>Confirm password</label>\n <input\n id="newConfirmPassword"\n name="newPasswordConfirm"\n type="password"\n #newPasswordConfirm="ngModel"\n class="form-control"\n [(ngModel)]="model.newPasswordConfirm"\n required\n passwordConfirm="newPassword"\n autocomplete="new-password"\n />\n </c8y-form-group>\n </div>\n <div class="col-5">\n <c8y-password-strength\n [password]="model.newPassword"\n (strength)="model.strength = $event"\n ></c8y-password-strength>\n\n <c8y-password-check-list\n class="m-t-32"\n [password]="model.newPassword"\n [hidden]="!passwordEnforced"\n ></c8y-password-check-list>\n </div>\n</div>\n',viewProviders:[{provide:nc.ControlContainer,useExisting:nc.NgForm}]})],e)}(),dp=function(){function e(){}var n;return n=e,e.prototype.validate=function(e){return this.validateInternationalPhoneNumber(e)?null:{internationalPhoneNumber:!0}},e.prototype.validateInternationalPhoneNumber=function(e){var t;try{var n=sc.parsePhoneNumberFromString(e.value);(t=n.isValid())&&e.value!==n.format("E.164")&&e.setValue(n.format("E.164"),{emitEvent:!1,emitModelToViewChange:!1})}catch(n){t=!e.value}return t},e=n=jc([t.Directive({selector:"[c8yPhoneValidation]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),pp=function(){function e(){}return e.get=function(e){return this.rules[e]},e.messages={deviceId:'Device ID must not contain spaces or slashes ("/").',domain:"Only lowercase letters, digits and hyphens allowed in the first part of the URI. Must start with a letter; hyphens only allowed in the middle. Must be a valid URI.",email:"Invalid email address.",emails:"Invalid email addresses.",internationalPhoneNumber:"International phone number required, in the format +49 9 876 543 210.",loginAlias:'Login alias must not contain slashes ("/", "\\") nor ("+"), (":"), ("$") signs.',max:"Max value: {{ value }}",min:"Min value: {{ value }}",opcuaBrowsePath:"Invalid OPC UA URI.",password:"Password must have at least 8 characters and no more than 32 and can only contain letters, numbers and following symbols: `~!@#$%^&*()_|+-=?;:'\",.<>{}[]\\/",passwordConfirm:"Passwords do not match.",passwordStrength:"Password not good enough, password must be stronger (green).",phoneNumber:'Invalid phone number format. Only digits, spaces, slashes ("/") and dashes ("-") allowed.',required:"This field is required.",tenantId:"May contain lowercase letters, digits, and hyphens. Must start with a letter; hyphens only allowed in the middle; minimum 2 characters.",urlSegment:"Slash, single or double dots and white space not allowed.",user:'Username must not contain spaces nor slashes ("/", "\\") nor ("+"), (":"), ("$") signs.'},e.rules={deviceId:{pattern:/^[^\s/]*$/},domain:{pattern:/^[a-z]+[a-z0-9-]*[a-z0-9]+\.{1}.+$/},groupName:{maxLength:254},hostname:{pattern:/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/},ip:{pattern:/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/},opcuaBrowsePath:{pattern:/^(opc.tcp|http|https):\/\/[^ "]+$/},password:{pattern:/^[a-zA-Z0-9`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]{8,32}$/},phoneNumber:{pattern:/^$|^(\+|0{2})[\d\s/-]{1,30}$/},tenantId:{pattern:/^[a-z]+[a-z0-9-]*[a-z0-9]+$/},user:{pattern:/^[^\\/\s$:+]*$/},urlSegment:{pattern:/^(([.]{1,2})|([/])+|(([/]*)([.]{1,2})([/]*))|((.*)([/]|[ ]+)(.*))|(\s+))$/},loginAlias:{pattern:/^[^\\/$:+]*$/}},e}(),mp=function(){function e(){this.c8yDefaultValidation=""}var n;return n=e,e.prototype.validate=function(e){var t;if(!e.value)return null;var n=pp.get(this.c8yDefaultValidation);if(!n)throw new Error("Pattern "+this.c8yDefaultValidation+" not found.");var a=!0;return n.pattern&&(a=n.pattern.test(e.value)),n.maxLength&&(a=e.value.length<n.maxLength),n.minLength&&(a=e.value.length>=n.minLength),a?null:((t={})[this.c8yDefaultValidation]=!0,t)},jc([t.Input()],e.prototype,"c8yDefaultValidation",void 0),e=n=jc([t.Directive({selector:"[c8yDefaultValidation]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),hp=function(){function e(){this.min=""}var n;return n=e,e.prototype.validate=function(e){var t=parseInt(this.min,10);if(s.isUndefined(e.value)||!this.min)return null;return null===e.value||!(e.value<t)?null:{min:{value:t}}},jc([t.Input()],e.prototype,"min",void 0),e=n=jc([t.Directive({selector:"[min]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),fp=function(){function e(){this.max=""}var n;return n=e,e.prototype.validate=function(e){var t=parseInt(this.max,10);if(s.isUndefined(e.value)||!this.max)return null;return!(e.value>t)?null:{max:{value:t}}},jc([t.Input()],e.prototype,"max",void 0),e=n=jc([t.Directive({selector:"[max]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),gp=function(){function e(){}return jc([t.Input()],e.prototype,"name",void 0),jc([t.Input()],e.prototype,"text",void 0),e=jc([t.Directive({selector:"c8y-message"})],e)}(),yp=function(){function e(e){this.translateService=e,this.show={},this.defaults=pp.messages,this.messages=[],this.messageMap={}}return e.prototype.ngAfterContentInit=function(){this.messageMap=Object.assign({},this.defaults,this.customMessages.reduce((function(e,t){return e[t.name]=t.text,e}),{}))},e.prototype.changVisibility=function(e){this.show=e,this.ngOnChanges()},e.prototype.ngOnChanges=function(){var e=this;this.show?this.messages=Object.keys(this.show).map((function(t){return e.toMessage(t,e.show[t])})):this.messages=[]},e.prototype.toMessage=function(e,t){return this.translateService.instant(this.messageMap[e],t)},e.ctorParameters=function(){return[{type:p.TranslateService}]},jc([t.Input()],e.prototype,"show",void 0),jc([t.Input()],e.prototype,"defaults",void 0),jc([t.ContentChildren(gp)],e.prototype,"customMessages",void 0),e=jc([t.Component({selector:"c8y-messages",template:'<small class="form-control-feedback-message">\n <div class="d-block" *ngFor="let msg of messages">\n {{msg | translate}}\n </div>\n <ng-content></ng-content>\n</small>\n'})],e)}(),vp=function(){function e(){this.hasError=!1,this.hasWarning=!1,this.hasSuccess=!1,this.novalidation=!1,this.VALIDATION_DEBOUNCE_MS=1e3}return Object.defineProperty(e.prototype,"error",{get:function(){return"error"===this.status||this.hasError},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"warning",{get:function(){return"warning"===this.status||this.hasWarning},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"success",{get:function(){return"success"===this.status||this.hasSuccess},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this.initNgModel()},e.prototype.initNgModel=function(){var e=this;this.model&&(this.model.valueAccessor.registerOnTouched((function(){e.model.control&&!e.model.control.dirty&&(e.model.control.markAsDirty(),e.model.control.updateValueAndValidity({onlySelf:!0}))})),this.subscription=a.merge(this.model.valueChanges,this.model.statusChanges).pipe(o.filter((function(){return e.model.dirty&&!e.novalidation})),o.debounce((function(){return e.hasError?a.timer(10):a.timer(e.VALIDATION_DEBOUNCE_MS)}))).subscribe((function(){return e.update()})))},e.prototype.update=function(){this.hasError="INVALID"===this.model.status,this.customErrorMessage?this.customErrorMessage.changVisibility(this.model.errors):this.errors=this.model.errors},e.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},jc([t.Input()],e.prototype,"hasError",void 0),jc([t.Input()],e.prototype,"hasWarning",void 0),jc([t.Input()],e.prototype,"hasSuccess",void 0),jc([t.Input()],e.prototype,"novalidation",void 0),jc([t.Input()],e.prototype,"status",void 0),jc([t.HostBinding("class.has-error")],e.prototype,"error",null),jc([t.HostBinding("class.has-warning")],e.prototype,"warning",null),jc([t.HostBinding("class.has-success")],e.prototype,"success",null),jc([t.ContentChild(yp,{static:!1})],e.prototype,"customErrorMessage",void 0),jc([t.ContentChild(nc.NgModel,{static:!0})],e.prototype,"model",void 0),e=jc([t.Component({selector:"c8y-form-group",template:'<ng-content></ng-content>\n<c8y-messages *ngIf="!customErrorMessage" [show]="errors"></c8y-messages>\n',host:{class:"form-group"}})],e)}(),bp=function(){function e(){this.plus=!0,this.minus=!0,this.onRemove=new t.EventEmitter,this.onAdd=new t.EventEmitter}return e.prototype.add=function(){this.onAdd.emit(this.index)},e.prototype.remove=function(){this.onRemove.emit(this.index)},jc([t.Input()],e.prototype,"plus",void 0),jc([t.Input()],e.prototype,"minus",void 0),jc([t.Input()],e.prototype,"index",void 0),jc([t.Output()],e.prototype,"onRemove",void 0),jc([t.Output()],e.prototype,"onAdd",void 0),e=jc([t.Component({selector:"c8y-input-group-list",template:'<ng-container>\n <div class="input-group">\n <ng-content></ng-content>\n <div class="input-group-btn">\n <button\n *ngIf="minus"\n title="{{ \'Remove\' | translate }}"\n class="btn btn-clean text-primary"\n (click)="remove()"\n >\n <i c8yIcon="minus-circle" class="text-danger"></i>\n </button>\n <button\n *ngIf="plus"\n title="{{ \'Add\' | translate }}"\n class="btn btn-clean text-primary"\n (click)="add()"\n >\n <i c8yIcon="plus-circle"></i>\n </button>\n </div>\n </div>\n</ng-container>\n'})],e)}(),jp=function(){function e(){}return e.prototype.ngAfterContentInit=function(){var e=this;this.listProjections.map((function(t){t!==e.listProjections.last&&setTimeout((function(){t.plus=!1}))})),this.listProjections.changes.subscribe((function(e){1!==e.length?e.map((function(t){setTimeout((function(){t.minus=!0})),t!==e.last&&setTimeout((function(){t.plus=!1})),t===e.last&&setTimeout((function(){t.plus=!0}))})):setTimeout((function(){e.first.plus=!0,e.first.minus=!1}))}))},jc([t.ContentChildren(bp)],e.prototype,"listProjections",void 0),e=jc([t.Directive({selector:"[c8yInputGroupListContainer]"})],e)}(),wp=function(){function e(e){this.invalidJSON=new t.EventEmitter,this.message="Must be a valid JSON object.",this.debounceTimeInMs=1e3,this.abstractCtrl=e.control}return e.prototype.ngOnInit=function(){var e=this;this.subscription=this.abstractCtrl.valueChanges.pipe(o.tap((function(){return e.clearValidationMessage()})),o.debounceTime(this.debounceTimeInMs),o.distinctUntilChanged()).subscribe((function(t){e.validateInputAndPrettify(t)}))},e.prototype.ngOnDestroy=function(){this.subscription&&!this.subscription.closed&&this.subscription.unsubscribe()},e.prototype.validateInputAndPrettify=function(e){if(e)try{var t=JSON.parse(e),n=JSON.stringify(t,void 0,2);this.abstractCtrl.setValue(n)}catch(e){this.setErrorAndValidationMessage()}},e.prototype.setErrorAndValidationMessage=function(){this.abstractCtrl.setErrors({invalidBodyTemplate:!0}),this.invalidJSON.emit(this.message)},e.prototype.clearValidationMessage=function(){this.invalidJSON.emit(void 0)},e.ctorParameters=function(){return[{type:nc.NgControl}]},jc([t.Output()],e.prototype,"invalidJSON",void 0),e=jc([t.Directive({selector:"textarea[prettyValidJson]"})],e)}(),Sp=function(){function e(e,t){this.elem=e,this.renderer=t,this.rows=1,this.minHeightPerRow=20}return e.prototype.ngAfterViewInit=function(){var e=Number(this.heightPerRow);this.heightPerRow&&e&&e>this.minHeightPerRow?this.setHeight(this.rows*e+"px"):this.setHeight(this.rows*this.minHeightPerRow+"px")},e.prototype.setHeight=function(e){this.renderer.setStyle(this.elem.nativeElement,"height",e)},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},jc([t.Input(),t.HostBinding("rows")],e.prototype,"rows",void 0),jc([t.Input("heightPerRow")],e.prototype,"heightPerRow",void 0),e=jc([t.Directive({selector:"textarea[heightPerRow]"})],e)}(),Cp=function(){function e(e,t,n){this.el=e,this.renderer=t,this.translationService=n,this.shouldSkipRequiredHint=!1,this.shouldSkipRequiredHint=!!this.el.nativeElement.closest("[placeholder-no-required-hint]")}return e.prototype.ngAfterViewChecked=function(){if(this.el&&this.el.nativeElement&&void 0!==this.el.nativeElement.required){var e=this.el.nativeElement.required&&!this.shouldSkipRequiredHint,t=this.el.nativeElement.placeholder;this.placeholder===t&&this.req===e||this.updatePlaceholder(this.getTextForPlaceholder(t,e))}},e.prototype.getTextForPlaceholder=function(e,t){void 0===e&&(e=""),void 0===t&&(t=!1),this.req=t;var n="("+this.translationService.instant("required")+")",a=e.lastIndexOf(n);return a>0&&(e=e.slice(0,a-1)),0===a&&(e=""),t?e.trim()?e+" "+n:n:e},e.prototype.updatePlaceholder=function(e){this.renderer.setAttribute(this.el.nativeElement,"placeholder",e),this.placeholder=e},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:p.TranslateService}]},e=jc([t.Directive({selector:"input[required]"})],e)}(),Ip=function(){function e(){}return Object.defineProperty(e.prototype,"data",{get:function(){return this.ipRangeList},set:function(e){this.ipRangeList=e,0===this.ipRangeList.length&&this.add()},enumerable:!0,configurable:!0}),e.prototype.add=function(){this.ipRangeList.push({ip:"",cidr:void 0})},e.prototype.remove=function(e){this.ipRangeList.splice(e,1)},jc([t.Input()],e.prototype,"data",null),e=jc([t.Component({selector:"c8y-ip-range-input-list",template:'<c8y-form-group class="m-t-8 m-b-8">\n <ul c8yInputGroupListContainer class="list-unstyled">\n <li class="m-b-8" *ngFor="let item of data; let i = index">\n <c8y-input-group-list [index]="i" (onAdd)="add()" (onRemove)="remove($event)">\n <input\n type="text"\n name="ipAddress"\n class="form-control m-r-4"\n placeholder="{{ \'IP range start, e.g.\' | translate }} 192.168.0.1"\n style="flex-grow: 2;"\n [(ngModel)]="item.ip"\n [required]="true"\n #ipAddress\n />\n <input\n type="number"\n name="cidr"\n [min]="0"\n class="form-control"\n placeholder="{{ \'e.g.\' | translate }} 20"\n [(ngModel)]="item.cidr"\n [required]="true"\n #cidr\n />\n </c8y-input-group-list>\n </li>\n </ul>\n</c8y-form-group>\n'})],e)}(),Pp=function(){function e(){this.onSearch=new t.EventEmitter,this.filterChange$=new a.Subject,this.filterTerm="",this.CARRIAGE_RETURN_KEY=13,this.CARRIAGE_RETURN_CODE="Enter"}return e.prototype.ngOnInit=function(){var e=this;this.reset(),this.filterChange$.pipe(o.debounce((function(t){return t.code===e.CARRIAGE_RETURN_CODE||t.keyCode===e.CARRIAGE_RETURN_KEY?a.timer(10):a.timer(300)})),o.map((function(e){return e.target.value})),o.distinctUntilChanged()).subscribe((function(t){e.filterTerm=t,e.onSearch.emit(t)}))},e.prototype.reset=function(){this.filterTerm="",this.onSearch.emit("")},e.prototype.ngOnDestroy=function(){this.filterChange$.complete()},jc([t.Input()],e.prototype,"icon",void 0),jc([t.Output()],e.prototype,"onSearch",void 0),e=jc([t.Component({selector:"c8y-filter",template:'<div class="input-group input-group-search">\n <input\n class="form-control"\n placeholder="{{ \'Filter…\' | translate }}"\n type="text"\n [value]="filterTerm"\n (keyup)="filterChange$.next($event)"\n />\n <span class="input-group-btn">\n <button class="btn btn-clean" (click)="reset()">\n <i [c8yIcon]="filterTerm.length === 0 ? icon : \'close\'"></i>\n </button>\n </span>\n</div>\n'})],e)}(),Op=function(){function e(){this._enabled=!1,this.separator=","}var n;return n=e,Object.defineProperty(e.prototype,"emails",{set:function(e){this._enabled=""===e||!0===e||"true"===e,this._onChange&&this._onChange()},enumerable:!0,configurable:!0}),e.prototype.validate=function(e){return this._enabled&&(e.value||"").split(this.separator).map((function(e){return e.trim()})).some((function(e){return nc.Validators.email(new nc.FormControl(e))}))?{emails:!0}:null},e.prototype.registerOnValidatorChange=function(e){this._onChange=e},jc([t.Input()],e.prototype,"emails",null),e=n=jc([t.Directive({selector:"[emails][formControlName],[emails][formControl],[emails][ngModel]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),xp=function(){function e(){}return e=jc([t.NgModule({imports:[Uu,nc.FormsModule],exports:[dp,mp,hp,fp,nc.FormsModule,vp,gp,yp,bp,jp,wp,Sp,Cp,Ip,Pp,Op],declarations:[dp,mp,hp,fp,vp,gp,yp,bp,jp,wp,Sp,Cp,Ip,Pp,Op]})],e)}(),Ep=function(){function e(e,n,a){this.loginService=e,this.users=n,this.alert=a,this.verify=!0,this.onSuccess=new t.EventEmitter,this.model={token:""},this.loading=!1,this.hasError=!1}return e.prototype.verifyCode=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.loading=!0,this.hasError=!1,this.verify?[4,this.users.verifyTotpCode(this.model.token)]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.onSuccess.emit(this.model.token),[3,4];case 3:return e.sent(),this.hasError=!0,this.alert.removeLastDanger(),this.loading=!1,[3,4];case 4:return[2]}}))}))},e.ctorParameters=function(){return[{type:ep},{type:m.UserService},{type:Yu}]},jc([t.Input()],e.prototype,"verify",void 0),jc([t.Output()],e.prototype,"onSuccess",void 0),jc([t.Input()],e.prototype,"loading",void 0),jc([t.Input()],e.prototype,"hasError",void 0),e=jc([t.Component({selector:"c8y-totp-challenge",template:'<form #totpForm="ngForm" role="form" class="loginForm" (ngSubmit)="verifyCode()" novalidate>\n <c8y-form-group [hasError]="hasError" [novalidation]="true" [ngClass]="hasError ? \'p-b-24\' : \'\'">\n <label translate for="totpToken">\n Verification code\n </label>\n\n <input\n id="totpToken"\n [(ngModel)]="model.token"\n name="totpToken"\n type="text"\n autocapitalize="off"\n autocorrect="off"\n autocomplete="off"\n class="form-control"\n placeholder="{{ \'e.g.\' | translate }} 624327"\n required\n />\n\n <c8y-messages>\n <c8y-message *ngIf="hasError" translate>\n Invalid verification code. In case of key loss, please contact your platform administrator.\n </c8y-message>\n </c8y-messages>\n <p id="helpinput" *ngIf="!hasError" class="help-block" translate>\n In case of key loss, please contact your platform administrator.\n </p>\n </c8y-form-group>\n <button *ngIf="!loading"\n title="{{ \'Verify\' | translate }}"\n [disabled]="!totpForm.form.valid"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n >\n {{ \'Verify\' | translate }}\n </button>\n\n <button *ngIf="loading"\n title="{{ \'Verifying…\' | translate }}"\n type="submit"\n class="btn btn-primary btn-lg btn-block btn-pending"\n >\n {{ \'Verifying…\' | translate }}\n </button>\n</form>\n',viewProviders:[{provide:nc.ControlContainer,useExisting:nc.NgForm}]})],e)}(),kp=function(){function e(e,n,a){this.loginService=e,this.users=n,this.alert=a,this.onCancel=new t.EventEmitter,this.model={smsToken:""},this.isLoading=!1,this.resendTfa="0"}return e.prototype.verifyTFACode=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return this.isLoading=!0,this.useOAuthInternal()?[4,this.verifyCodeWithOauth()]:[3,2];case 1:return e.sent(),[3,4];case 2:return[4,this.verifyCodeWithBasicAuth()];case 3:e.sent(),e.label=4;case 4:return this.isLoading=!1,[2]}}))}))},e.prototype.resendTFASms=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,3,4]),this.isLoading=!0,[4,this.users.verifyTFACode(this.resendTfa)];case 1:return t.sent(),[3,4];case 2:return 403===(e=t.sent()).res.status?(this.loginService.cleanMessages(),this.loginService.addSuccessMessage("resend_sms")):this.alert.addServerFailure(e),[3,4];case 3:return this.isLoading=!1,[7];case 4:return[2]}}))}))},e.prototype.useOAuthInternal=function(){return this.loginService.isPasswordGrantLogin(this.credentials)},e.prototype.verifyCodeWithOauth=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=this.credentials,[4,this.loginService.switchLoginMode(bc({},e,{tfa:this.model.smsToken}))];case 1:return n.sent(),[4,this.loginService.verifyAppAccess()];case 2:return n.sent(),[4,this.loginService.authFulfilled()];case 3:return n.sent(),[3,5];case 4:return t=n.sent(),401===(t.res&&t.res.status)?this.alert.danger("Invalid code"):this.alert.addServerFailure(t),[3,5];case 5:return[2]}}))}))},e.prototype.verifyCodeWithBasicAuth=function(){return Sc(this,void 0,void 0,(function(){var e,t,n;return Cc(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.users.verifyTFACode(this.model.smsToken)];case 1:return e=a.sent().res,t=e.headers.get("tfatoken"),this.credentials.tfa=t,this.loginWithTFA(t),[3,3];case 2:return n=a.sent(),403===(n.res&&n.res.status)?this.alert.danger("Invalid code"):this.alert.addServerFailure(n),[3,3];case 3:return[2]}}))}))},e.prototype.loginWithTFA=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.loginService.login(this.loginService.useBasicAuth({tfa:e}),this.credentials)];case 1:return n.sent(),this.loginService.saveTFAToken(e,sessionStorage),this.loginService.rememberMe&&this.loginService.saveTFAToken(e,localStorage),[3,3];case 2:return t=n.sent(),this.alert.addServerFailure(t),[3,3];case 3:return[2]}}))}))},e.ctorParameters=function(){return[{type:ep},{type:m.UserService},{type:Yu}]},jc([t.Input()],e.prototype,"credentials",void 0),jc([t.Output()],e.prototype,"onCancel",void 0),e=jc([t.Component({selector:"c8y-sms-challenge",template:'<form #twoFactorForm="ngForm" role="form" class="loginForm" (ngSubmit)="verifyTFACode()" novalidate>\n <div class="legend form-block center" translate>\n Two-factor authentication\n </div>\n\n <c8y-form-group>\n <label translate>Verification code</label>\n <input\n [(ngModel)]="model.smsToken"\n #sms_token="ngModel"\n type="text"\n name="sms_token"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'e.g.\' | translate }} 624327"\n required\n />\n <p *ngIf="!twoFactorForm.form.valid || isLoading " class="help-block" translate>\n Insert the code received via SMS.\n </p>\n </c8y-form-group>\n\n <button\n title="{{ \'Verify\' | translate }}"\n [disabled]="!twoFactorForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >\n Verify\n </button>\n\n <div class="d-flex m-t-8">\n <a\n title="{{ \'Send new code\' | translate }}"\n [ngClass]="{ disabled: isLoading }"\n class="small pointer m-r-auto"\n (click)="resendTFASms()"\n translate\n >\n Send new code\n </a>\n <a\n title="{{ \'Log in\' | translate }}"\n class="small pointer m-l-auto"\n (click)="onCancel.emit()"\n translate\n >\n Log in\n </a>\n </div>\n</form>\n'})],e)}(),Tp=function(){function e(e,t){this.user=e,this.alert=t}return Object.defineProperty(e.prototype,"qrCodeImage",{get:function(){return this.totpSecret?this.totpSecret.secretQrUrl:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"secret",{get:function(){return this.totpSecret?this.totpSecret.rawSecret:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qrData",{get:function(){var e=this.qrCodeImage.split("chl=")[1];return e?decodeURIComponent(e):(this.alert.danger("Failed to generate a QR code."),"")},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.user.generateTotpSecret()];case 1:return e=n.sent().data,this.totpSecret=e,[3,3];case 2:return t=n.sent(),this.alert.addServerFailure(t),[3,3];case 3:return[2]}}))}))},e.ctorParameters=function(){return[{type:m.UserService},{type:Yu}]},e=jc([t.Component({selector:"c8y-totp-setup",template:'<div class="text-center">\n <p\n class="lead m-b-16"\n translate\n >\n Scan this QR code with your smartphone using the Google Authenticator app.\n </p>\n\n\n <qrcode\n *ngIf="totpSecret"\n [width]="300"\n [qrdata]="qrData"\n [cssClass]="\'m-b-16\'"\n [errorCorrectionLevel]="\'M\'"\n ></qrcode>\n <p class="text-center text-muted">\n {{secret}}\n </p>\n</div>\n'})],e)}();(_d=e.LoginViews||(e.LoginViews={}))[_d.None=0]="None",_d[_d.Credentials=1]="Credentials",_d[_d.RecoverPassword=2]="RecoverPassword",_d[_d.SmsChallenge=3]="SmsChallenge",_d[_d.ChangePassword=4]="ChangePassword",_d[_d.TotpChallenge=5]="TotpChallenge",_d[_d.TotpSetup=6]="TotpSetup",_d[_d.ProvidePhoneNumber=7]="ProvidePhoneNumber";var Ap,_p=function(){function n(e,n,a){this.loginService=e,this.alert=n,this.userService=a,this.onCancel=new t.EventEmitter,this.onChangeView=new t.EventEmitter,this.requestInProgress=!1,this.sendTfa="0"}return n.prototype.save=function(){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),this.requestInProgress=!0,[4,this.userService.savePhoneNumber(this.phoneNumber)];case 1:return n.sent(),[4,this.sendTFASms()];case 2:return n.sent(),this.onChangeView.emit({view:e.LoginViews.SmsChallenge,credentials:this.credentials}),[3,5];case 3:return t=n.sent(),this.alert.addServerFailure(t),[3,5];case 4:return this.requestInProgress=!1,[7];case 5:return[2]}}))}))},n.prototype.sendTFASms=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.userService.verifyTFACode(this.sendTfa)];case 1:return t.sent(),[3,3];case 2:if(403!==(e=t.sent()).res.status)throw e;return this.loginService.cleanMessages(),this.loginService.addSuccessMessage("send_sms"),[3,3];case 3:return[2]}}))}))},n.ctorParameters=function(){return[{type:ep},{type:Yu},{type:m.UserService}]},jc([t.Input()],n.prototype,"credentials",void 0),jc([t.Output()],n.prototype,"onCancel",void 0),jc([t.Output()],n.prototype,"onChangeView",void 0),n=jc([t.Component({selector:"c8y-provide-phone-number",template:'<form #twoFactorForm="ngForm" role="form" class="loginForm" (ngSubmit)="save()" novalidate>\n <div class="legend form-block center" translate>\n Two-factor authentication\n </div>\n\n <c8y-form-group [ngClass]="requestInProgress || twoFactorForm.invalid ? \'p-b-8\' : \'\'">\n <label translate>Provide your phone number</label>\n\n <input\n class="form-control"\n [(ngModel)]="phoneNumber"\n #contactPhone="ngModel"\n type="text"\n name="phone"\n autocomplete="off"\n placeholder="{{ \'e.g. +49 9 876 543 210`LOCALIZE`\' | translate }}"\n c8yPhoneValidation\n c8yDefaultValidation="phoneNumber"\n required\n />\n </c8y-form-group>\n\n <button\n title="{{ \'Save and continue\' | translate }}"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n [disabled]="requestInProgress || twoFactorForm.invalid"\n >\n {{ \'Save and continue\' | translate }}\n </button>\n\n <div class="d-flex m-t-8">\n <a\n title="{{ \'Login\' | translate }}"\n class="small pointer m-l-auto"\n href="#"\n (click)="onCancel.emit()"\n >\n {{ \'Login\' | translate }}\n </a>\n </div>\n</form>\n'})],n)}(),Np=function(){function e(){}return e=jc([t.NgModule({declarations:[Ep,lp,cp,rp,up,tp,kp,Tp,_p],imports:[xp,u.TooltipModule,Uu,Ud,rc.QRCodeModule],exports:[Ep,cp,rp,lp,up,tp,kp,Tp,_p],entryComponents:[tp],providers:[ip,np]})],e)}(),Dp=function(){function e(e,n){this.users=e,this.alert=n,this.revokeEmitter=new t.EventEmitter}return e.prototype.revoke=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.users.totpRevokeSecret(this.user)];case 1:return t.sent(),this.alert.success("User TOTP secret revoked."),this.revokeEmitter.next(),[3,3];case 2:return e=t.sent(),this.alert.addServerFailure(e),[3,3];case 3:return[2]}}))}))},e.ctorParameters=function(){return[{type:m.UserService},{type:Yu}]},jc([t.Input()],e.prototype,"user",void 0),jc([t.Output("revoke")],e.prototype,"revokeEmitter",void 0),e=jc([t.Component({selector:"c8y-user-totp-revoke",template:'<button\n type="button"\n class="btn btn-default"\n [popover]="confirm"\n [popoverTitle]="\'Revoke TOTP secret\' | translate"\n #popover="bs-popover"\n placement="right"\n>\n <i c8yIcon="key"></i> {{ \'Revoke TOTP secret\' | translate }}\n</button>\n\n<ng-template #confirm>\n <p class="m-b-16" translate>\n This action will revoke the user\'s stored TOTP secret which will require a new setup.\n </p>\n <button\n title="{{ \'Revoke\' | translate }}"\n type="button"\n class="btn btn-danger"\n (click)="revoke(); popover.hide()"\n translate\n >\n Revoke\n </button>\n <button\n title="{{ \'Cancel\' | translate }}"\n type="button"\n class="btn btn-default"\n (click)="popover.hide()"\n translate\n >\n Cancel\n </button>\n</ng-template>\n'})],e)}(),Lp=function(){function e(){}return e=jc([t.NgModule({declarations:[sp,op,Qd,Xd,ap,Dp],imports:[xp,Uu,Ud,l.BsDropdownModule,Np,ed,n.RouterModule,u.TooltipModule.forRoot(),ac.PopoverModule],exports:[sp,Xd,op,Qd,ap,Dp],entryComponents:[Qd,ap,Dp]})],e)}(),Mp=function(){function e(){}return e=jc([t.NgModule({declarations:[wd,Ed,jd,Td,kd,bd],imports:[l.BsDropdownModule,Lp,Jd,Uu,Wu,hd,Bd,Vd],exports:[Ed,wd,jd,Td,kd,bd]})],e)}(),Rp=function(){function n(e,n,a,o,s){this.loginService=e,this.users=n,this.passwordStrengthCheckerService=a,this.options=o,this.alert=s,this.onChangeView=new t.EventEmitter,this.passwordPattern=/^[a-zA-Z0-9`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]{8,32}$/,this.isLoading=!1,this.model={tenantId:"",email:"",newPassword:"",newPasswordConfirm:""},this.emailReadOnly=!1,this.passwordStrengthEnforced=!1,this.TOKEN_PARAM="token",this.EMAIL_PARAM="email"}return n.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return this.model.tenantId=this.loginService.getTenant(),this.model.email=this.options.get(this.EMAIL_PARAM,""),this.emailReadOnly=!!this.model.email,e=this,[4,this.loginService.getPasswordStrengthEnforced()];case 1:return e.passwordStrengthEnforced=t.sent(),[2]}}))}))},n.prototype.changePassword=function(){return Sc(this,void 0,void 0,(function(){var t,n,a;return Cc(this,(function(o){switch(o.label){case 0:t=this.passwordStrengthCheckerService.getStrengthColor(this.model.newPassword),n={token:this.credentials.token,email:this.model.email,newPassword:this.model.newPassword,passwordStrength:t.passwordStrength},o.label=1;case 1:return o.trys.push([1,3,4,5]),this.isLoading=!0,[4,this.users.resetPassword(n,this.model.tenantId)];case 2:return 200===o.sent().res.status&&(this.loginService.addSuccessMessage("password_changed"),this.credentials.token=void 0,this.options.set(this.TOKEN_PARAM,void 0),this.onChangeView.emit({view:e.LoginViews.Credentials})),[3,5];case 3:return a=o.sent(),this.alert.addServerFailure(a),[3,5];case 4:return this.loginService.reset(),this.isLoading=!1,[7];case 5:return[2]}}))}))},n.ctorParameters=function(){return[{type:ep},{type:m.UserService},{type:np},{type:$c},{type:Yu}]},jc([t.Input()],n.prototype,"credentials",void 0),jc([t.Output()],n.prototype,"onChangeView",void 0),n=jc([t.Component({selector:"c8y-change-password",template:'<form\n role="form"\n class="loginForm"\n (ngSubmit)="changePassword()"\n #changePasswordForm="ngForm"\n novalidate\n>\n\n <div\n class="legend form-block center"\n translate\n >\n Change password\n </div>\n\n <c8y-form-group class="tenantField" id="tenantField" *ngIf="loginService.showTenant()">\n <label translate>Tenant ID</label>\n <input\n [(ngModel)]="model.tenantId"\n #tenantId="ngModel"\n type="text"\n name="tenantId"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Tenant ID\' | translate }}"\n required\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Email address</label>\n <input\n [(ngModel)]="model.email"\n #email="ngModel"\n type="text"\n name="email"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Email address\' | translate }}"\n email\n required\n [readonly]="emailReadOnly"\n />\n </c8y-form-group>\n\n <div class="row content-flex-50">\n <div class="col-7">\n <c8y-form-group>\n <label translate>New password</label>\n <input\n [(ngModel)]="model.newPassword"\n #newPassword="ngModel"\n type="password"\n name="newPassword"\n class="form-control"\n placeholder="{{ \'New password\' | translate }}"\n [pattern]="passwordPattern"\n autocomplete="new-password"\n [passwordStrengthEnforced]=\'passwordStrengthEnforced\'\n required\n />\n <c8y-messages>\n <c8y-message\n name="pattern"\n [text]="loginService.ERROR_MESSAGES.pattern_newPassword"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Confirm password</label>\n <input\n [(ngModel)]="model.newPasswordConfirm"\n #newPasswordConfirm="ngModel"\n type="password"\n name="newPasswordConfirm"\n class="form-control"\n placeholder="{{ \'Confirm password\' | translate }}"\n passwordConfirm="newPassword"\n autocomplete="new-password"\n required\n />\n <c8y-messages>\n <c8y-message\n name="passwordConfirm"\n [text]="loginService.ERROR_MESSAGES.passwordConfirm"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n </div>\n <div class="col-5">\n <c8y-password-strength\n [password]="model.newPassword"\n [hidden]="!model.newPassword"\n ></c8y-password-strength>\n <c8y-password-check-list\n class="m-t-32"\n [password]="model.newPassword"\n [hidden]="!model.newPassword || !passwordStrengthEnforced"\n ></c8y-password-check-list>\n </div>\n </div>\n\n <button\n title="{{ \'Set password\' | translate }}"\n [disabled]="!changePasswordForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >\n Set password\n </button>\n</form>\n'})],n)}(),qp=function(){function n(n,a,o){this.loginService=n,this.alert=a,this.ui=o,this.onChangeView=new t.EventEmitter,this.LOGIN_VIEWS=e.LoginViews,this.model={},this.isLoading=!1,this.showLoginForm=!1,this.showBasicAuth=!1,this.oauthOptions={},this.PASSWORD_RESET_HEADER_NAME="passwordresettoken",this.NO_PHONE_HEADER_NAME="NoPhoneHeader"}return n.prototype.ngOnInit=function(){var e=this.loginService,t=e.oauthOptions,n=e.loginMode;this.model.tenant=this.loginService.getTenant(),this.showLoginForm=void 0===n.visibleOnLoginPage||n.visibleOnLoginPage,this.showBasicAuth="BASIC"===n.type,this.oauthOptions=t},n.prototype.redirectToOauth=function(){this.loginService.redirectToOauth()},n.prototype.login=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),this.isLoading=!0,e=this.loginService.useBasicAuth(this.model),[4,this.loginService.login(e,this.model)];case 1:return n.sent(),[3,4];case 2:return(t=n.sent()).res&&t.res.headers&&t.res.headers.get(this.PASSWORD_RESET_HEADER_NAME)?this.handlePasswordReset(t.res):t.res&&401===t.res.status&&/pin/i.test(t.data.message)?this.handleSmsChallenge(t.data.message):t.res&&401===t.res.status&&/TOTP/i.test(t.data.message)?this.handleTotpChallenge(t.data.message):t.res&&t.res.headers&&t.res.headers.get(this.NO_PHONE_HEADER_NAME)&&!this.loginService.isSupportUser(this.model)?this.handleNoPhoneNumberProvided():(this.loginService.generateOauthToken(this.model),this.loginService.reset(),this.alert.addServerFailure(t)),[3,4];case 3:return this.isLoading=!1,[7];case 4:return[2]}}))}))},n.prototype.handlePasswordReset=function(t){this.alert.removeLastDanger(),this.model.token=t.headers.get(this.PASSWORD_RESET_HEADER_NAME),this.onChangeView.emit({view:e.LoginViews.ChangePassword,credentials:this.model})},n.prototype.handleTotpChallenge=function(t){/TOTP setup required/i.test(t)?this.onChangeView.emit({view:e.LoginViews.TotpSetup,credentials:this.model}):this.onChangeView.emit({view:e.LoginViews.TotpChallenge,credentials:this.model})},n.prototype.handleSmsChallenge=function(t){/pin has already been generated/i.test(t)&&this.alert.warning("The verification code was already sent. For a new verification code, please click on the link above."),this.alert.removeLastDanger(),this.onChangeView.emit({view:e.LoginViews.SmsChallenge,credentials:this.model})},n.prototype.handleNoPhoneNumberProvided=function(){this.onChangeView.emit({view:e.LoginViews.ProvidePhoneNumber,credentials:this.model}),this.alert.warning("Two-factor authentication has been turned on for this account. Provide your phone number above to save it in your user profile and start receiving verification codes via SMS.")},n.ctorParameters=function(){return[{type:ep},{type:Yu},{type:Uc}]},jc([t.Output()],n.prototype,"onChangeView",void 0),n=jc([t.Component({selector:"c8y-credentials",template:'<div id="oauth" *ngIf="oauthOptions.initRequest && oauthOptions.visibleOnLoginPage">\n <button\n title="{{ oauthOptions.buttonName | translate }}"\n (click)="redirectToOauth()"\n class="btn btn-block btn-lg form-group"\n >\n <i [c8yIcon]="\'sign-in\'" class="pull-left"></i>\n {{ oauthOptions.buttonName | translate }}\n </button>\n</div>\n\n<form\n role="form"\n class="loginForm"\n (ngSubmit)="login()"\n #loginForm="ngForm"\n *ngIf="showLoginForm"\n novalidate\n>\n <div\n class="legend form-block center"\n *ngIf="!(oauthOptions.initRequest && oauthOptions.visibleOnLoginPage); else orLegend"\n translate\n >\n Login\n </div>\n <ng-template #orLegend>\n <div class="legend form-block center" translate>or</div>\n </ng-template>\n\n <c8y-form-group class="tenantField" id="tenantField" *ngIf="loginService.showTenant()">\n <label for="tenant" translate>Tenant ID</label>\n <input\n [(ngModel)]="model.tenant"\n #tenant="ngModel"\n type="text"\n name="tenant"\n id="tenant"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'e.g.\' | translate }} t12345"\n placeholder-no-required-hint\n required\n />\n </c8y-form-group>\n <c8y-form-group>\n <label for="user" translate>Username</label>\n <input\n [(ngModel)]="model.user"\n #user="ngModel"\n type="text"\n name="user"\n id="user"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'e.g. joe or joe.doe@example.com`LOCALIZE`\' | translate }}"\n placeholder-no-required-hint\n required\n />\n </c8y-form-group>\n <c8y-form-group>\n <label for="password" translate>Password</label>\n <input\n [(ngModel)]="model.password"\n #password="ngModel"\n type="password"\n name="password"\n id="password"\n class="form-control"\n placeholder-no-required-hint\n required\n />\n </c8y-form-group>\n <div class="form-group" *ngIf="showBasicAuth">\n <label title="{{ \'Remember me\' | translate }}" class="c8y-checkbox">\n <input type="checkbox" name="remember" [(ngModel)]="loginService.rememberMe" />\n <span></span>\n <span>{{ \'Remember me\' | translate }}</span>\n </label>\n </div>\n <button\n title="{{ \'Log in\' | translate }}"\n [disabled]="!loginForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n >\n {{ \'Log in\' | translate }}\n </button>\n <div class="text-center m-t-8">\n <a\n title="{{ \'Forgot password?\' | translate }}"\n class="btn btn-link btn-sm"\n (click)="onChangeView.emit({ view: LOGIN_VIEWS.RecoverPassword })"\n >{{ \'Forgot password?\' | translate }}</a\n >\n </div>\n <div class="text-center m-t-8" *ngIf="!!(ui.state$ | async).loginExtraLink">\n <a\n title="{{ (ui.state$ | async).loginExtraLink.label }}"\n [href]="(ui.state$ | async).loginExtraLink.url"\n class="btn btn-link btn-sm"\n >\n {{ (ui.state$ | async).loginExtraLink.label }}</a\n >\n </div>\n</form>\n'})],n)}(),$p=function(){function n(t,n,a){this.loginService=t,this.options=n,this.alert=a,this.currentView=e.LoginViews.None,this.LOGIN_VIEWS=e.LoginViews,this.disabled=!1,this.credentials={},this.displayAlerts=!1,this.TOKEN_PARAM="token"}return n.prototype.ngOnInit=function(){var e=this.getResetPasswordToken();this.loginService.isFirstLogin&&(e?(this.credentials.token=e,this.reset()):this.loginAutomatically()),this.loginService.isFirstLogin=!1},n.prototype.handleLoginTemplate=function(e){this.currentView=e.view,this.credentials=e.credentials||{}},n.prototype.onkeyup=function(e){"Enter"!==e.key&&this.loginService.cleanMessages()},n.prototype.reset=function(){this.loginService.reset(),this.setView(),this.loginService.cleanMessages()},n.prototype.loginAutomatically=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.loginService.login()];case 1:return n.sent(),[3,3];case 2:return e=n.sent(),"OAUTH2"===(t=this.loginService.loginMode.type)?this.loginService.redirectToOauth():(this.reset(),"OAUTH2_INTERNAL"===t&&"https:"!==window.location.protocol?this.alert.danger("Current login mode only supports HTTPS."):e.res&&403===e.res.status&&this.alert.addServerFailure(e)),[3,3];case 3:return[2]}}))}))},n.prototype.setView=function(){this.credentials&&this.credentials.token?this.handleLoginTemplate({view:e.LoginViews.ChangePassword,credentials:this.credentials}):this.handleLoginTemplate({view:e.LoginViews.Credentials})},n.prototype.getResetPasswordToken=function(){var e=this.options.get(this.TOKEN_PARAM);return e&&this.options.set(this.TOKEN_PARAM,void 0),e},n.ctorParameters=function(){return[{type:ep},{type:$c},{type:Yu}]},jc([t.Input()],n.prototype,"name",void 0),jc([t.HostListener("keyup",["$event"])],n.prototype,"onkeyup",null),n=jc([t.Component({selector:"c8y-login",template:'<div\n class="loading card fadeInUp animated shadow5"\n *ngIf="currentView !== LOGIN_VIEWS.None"\n [ngSwitch]="currentView"\n>\n <div class="card-block p-b-0">\n <img class="mainlogo">\n <c8y-credentials\n *ngSwitchCase="LOGIN_VIEWS.Credentials"\n (onChangeView)="handleLoginTemplate($event)"\n ></c8y-credentials>\n <c8y-recover-password\n *ngSwitchCase="LOGIN_VIEWS.RecoverPassword"\n (onChangeView)="handleLoginTemplate($event)"\n ></c8y-recover-password>\n <c8y-change-password\n *ngSwitchCase="LOGIN_VIEWS.ChangePassword"\n (onChangeView)="handleLoginTemplate($event)"\n [credentials]="credentials"\n ></c8y-change-password>\n <c8y-totp-auth\n *ngSwitchCase="LOGIN_VIEWS.TotpChallenge"\n (onCancel)="reset()"\n [view]="currentView"\n [credentials]="credentials"\n >\n </c8y-totp-auth>\n <c8y-totp-auth\n *ngSwitchCase="LOGIN_VIEWS.TotpSetup"\n (onCancel)="reset()"\n [view]="currentView"\n [credentials]="credentials"\n >\n </c8y-totp-auth>\n <c8y-sms-challenge\n *ngSwitchCase="LOGIN_VIEWS.SmsChallenge"\n (onCancel)="reset()"\n [credentials]="credentials"\n ></c8y-sms-challenge>\n\n <c8y-provide-phone-number\n *ngSwitchCase="LOGIN_VIEWS.ProvidePhoneNumber"\n (onCancel)="reset()"\n (onChangeView)="handleLoginTemplate($event)"\n [credentials]="credentials"\n ></c8y-provide-phone-number>\n\n <c8y-alert-outlet position="static"></c8y-alert-outlet>\n </div>\n</div>\n'})],n)}(),Fp=function(){function n(n,a){this.users=n,this.loginService=a,this.onChangeView=new t.EventEmitter,this.LOGIN_VIEWS=e.LoginViews,this.isLoading=!1,this.model={email:"",tenantId:""}}return n.prototype.ngOnInit=function(){this.model.tenantId=this.loginService.getTenant()},n.prototype.resetPassword=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return e.trys.push([0,,2,3]),this.isLoading=!0,[4,this.users.sendPasswordResetMail(this.model.email,this.model.tenantId)];case 1:return 200===e.sent().res.status&&this.loginService.addSuccessMessage("password_reset_requested"),[3,3];case 2:return this.loginService.reset(),this.isLoading=!1,[7];case 3:return[2]}}))}))},n.ctorParameters=function(){return[{type:m.UserService},{type:ep}]},jc([t.Output()],n.prototype,"onChangeView",void 0),n=jc([t.Component({selector:"c8y-recover-password",template:'<form #resetForm="ngForm" role="form" class="loginForm" (ngSubmit)="resetPassword()" novalidate>\n <div class="legend form-block center" translate>\n Forgot password?\n </div>\n <c8y-form-group class="tenantField" id="tenantField" *ngIf="loginService.showTenant()">\n <label translate>Tenant ID</label>\n <input\n [(ngModel)]="model.tenantId"\n #tenantId="ngModel"\n type="text"\n name="tenantId"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Tenant ID\' | translate }}"\n required\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Email address</label>\n <input\n [(ngModel)]="model.email"\n #email="ngModel"\n type="text"\n name="email"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Email address\' | translate }}"\n email\n required\n />\n </c8y-form-group>\n\n <button\n title="{{ \'Reset password\' | translate }}"\n [disabled]="!resetForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >\n Reset password\n </button>\n <div class="text-center m-t-8">\n <p>\n <a\n title="{{ \'Login\' | translate }}"\n class="btn btn-link btn-sm"\n (click)="onChangeView.emit({ view: LOGIN_VIEWS.Credentials })"\n translate\n >\n Login\n </a>\n </p>\n </div>\n</form>\n'})],n)}(),Up=function(){function n(n,a,o){this.loginService=n,this.userService=a,this.alert=o,this.onCancel=new t.EventEmitter,this.LOGIN_VIEWS=e.LoginViews,this.loading=!1,this.hasError=!1}return Object.defineProperty(n.prototype,"isSetup",{get:function(){return this.view===e.LoginViews.TotpSetup},enumerable:!0,configurable:!0}),n.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return this.view!==this.LOGIN_VIEWS.TotpSetup?[3,2]:[4,this.loginService.switchLoginMode(this.credentials)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},n.prototype.onTotpSuccess=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,6,7,8]),this.loading=!0,this.hasError=!1,this.credentials.tfa=e,this.isSetup?[4,this.userService.activateTotp()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[4,this.loginService.switchLoginMode(this.credentials)];case 3:return n.sent(),[4,this.loginService.verifyAppAccess()];case 4:return n.sent(),[4,this.loginService.authFulfilled()];case 5:return n.sent(),[3,8];case 6:return t=n.sent(),this.alert.removeLastDanger(),t.data&&"Access is denied"===t.data.message&&this.alert.addServerFailure(t),t.data&&"Authentication failed! : User account is locked"===t.data.message?this.alert.warning("Authentication failed due to: user account is locked."):this.hasError=!0,[3,8];case 7:return this.loading=!1,[7];case 8:return[2]}}))}))},n.ctorParameters=function(){return[{type:ep},{type:m.UserService},{type:Yu}]},jc([t.Input()],n.prototype,"credentials",void 0),jc([t.Input()],n.prototype,"view",void 0),jc([t.Output()],n.prototype,"onCancel",void 0),n=jc([t.Component({selector:"c8y-totp-auth",template:'<div\n class="legend form-block center"\n translate\n>\n Two-factor authentication\n</div>\n\n<c8y-totp-setup *ngIf="isSetup">\n</c8y-totp-setup>\n<c8y-totp-challenge\n [loading]="loading"\n [hasError]="hasError"\n [verify]="view === LOGIN_VIEWS.TotpSetup"\n (onSuccess)="onTotpSuccess($event)"\n></c8y-totp-challenge>\n\n<div class="text-center m-t-8">\n <a\n title="{{ \'Cancel\' | translate }}"\n class="btn btn-link btn-sm"\n (click)="onCancel.emit()"\n translate\n >\n Cancel\n </a>\n</div>\n'})],n)}(),Bp=function(){function e(e){this.passwordService=e}return e.prototype.isStrong=function(e){return this.isPasswordGreen(this.passwordService.getStrengthColor(e).passwordStrength)},e.prototype.isPasswordGreen=function(e){return e===m.PasswordStrength.GREEN},e.ctorParameters=function(){return[{type:np}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(np))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"})],e)}(),Gp=function(){function e(e){this.passwordService=e}var n;return n=e,Object.defineProperty(e.prototype,"passwordStrengthEnforced",{set:function(e){this.forced=e},enumerable:!0,configurable:!0}),e.prototype.validate=function(e){var t=this.passwordService.isStrong(e.value||"");return this.forced&&!t?{passwordStrength:!0}:null},e.ctorParameters=function(){return[{type:Bp}]},jc([t.Input()],e.prototype,"passwordStrengthEnforced",null),e=n=jc([t.Directive({selector:"[passwordStrengthEnforced]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),Hp=function(){function e(){}var n;return n=e,e.forRoot=function(){return{ngModule:n,providers:n.providers()}},e.providers=function(){return[ep]},e=n=jc([t.NgModule({declarations:[$p,Fp,Rp,qp,Up,Gp],imports:[nc.FormsModule,u.TooltipModule,Uu,Np,ed,xp],exports:[$p]})],e)}(),zp=function(){function e(e){this.tabs=e,this.label=""}return e.prototype.ngAfterContentInit=function(){var e=this;setTimeout((function(){return e.tabs.add(e)}))},e.prototype.ngOnDestroy=function(){this.tabs.remove(this)},e.ctorParameters=function(){return[{type:ld}]},jc([t.ViewChild("tpl",{static:!1})],e.prototype,"template",void 0),jc([t.Input()],e.prototype,"path",void 0),jc([t.Input()],e.prototype,"label",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"priority",void 0),jc([t.Input()],e.prototype,"orientation",void 0),e=jc([t.Component({selector:"c8y-tab",template:"<ng-template #tpl><ng-content></ng-content></ng-template>"})],e)}(),Vp=function(){function e(e,t,n){this.router=e,this.renderer=t,this.el=n,this.tabs=[],this.orientation="vertical",this.navigatorOpen=!1,this.showLeft=!1,this.showRight=!1}return Object.defineProperty(e.prototype,"isNavigatorOpen",{get:function(){return this.navigatorOpen},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasTabs",{get:function(){var e=[];return this.tabs&&(e=this.tabs.filter((function(e){return!0!==e.hide}))),e.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHorizontal",{get:function(){return"horizontal"===this.orientation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return"horizontal"!==this.orientation},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.scrollSubscription&&this.scrollSubscription.unsubscribe()},e.prototype.ngAfterContentInit=function(){"horizontal"===this.orientation&&this.scrollSubscribe()},e.prototype.isActive=function(e){return!(!e||!e.path)&&this.router.isActive(e.path,!1)},e.prototype.navigateTo=function(e){this.router.navigate([e])},e.prototype.scroll=function(e){void 0===e&&(e="right");var t=this.getDimensions(),n=t.widthScroll,a=t.width,o=t.scrollLeft+a*("left"===e?-1:1);o<0&&(o=0),o>n-a&&(o=n-a),this.container.nativeElement.scrollLeft=o},e.prototype.scrollSubscribe=function(){var e,t=this;this.scrollSubscription=a.merge(a.fromEvent(this.container.nativeElement,"scroll"),a.fromEventPattern((function(n){e=t.renderer.listen("window","resize",n)}),(function(){return e()}))).pipe(o.debounceTime(250)).subscribe((function(){return t.updateScroll()}))},e.prototype.updateScroll=function(){var e=this.getDimensions(),t=e.widthScroll,n=e.width,a=e.scrollLeft;this.showLeft=!!a,this.showRight=t>n+a},e.prototype.getDimensions=function(){var e=this.tabsContainer.nativeElement,t=this.container.nativeElement;return{widthScroll:e.scrollWidth,width:t.clientWidth,scrollLeft:t.scrollLeft}},e.ctorParameters=function(){return[{type:n.Router},{type:t.Renderer2},{type:t.ElementRef}]},jc([t.Input()],e.prototype,"tabs",void 0),jc([t.Input()],e.prototype,"orientation",void 0),jc([t.Input()],e.prototype,"navigatorOpen",void 0),jc([t.HostBinding("class.navigator-open")],e.prototype,"isNavigatorOpen",null),jc([t.HostBinding("class.page-tabs")],e.prototype,"hasTabs",null),jc([t.HostBinding("class.page-tabs-horizontal")],e.prototype,"isHorizontal",null),jc([t.HostBinding("class.page-tabs-vertical")],e.prototype,"isVertical",null),jc([t.ViewChild("container",{read:t.ElementRef,static:!0})],e.prototype,"container",void 0),jc([t.ViewChild("left",{read:t.ElementRef,static:!1})],e.prototype,"leftBtn",void 0),jc([t.ViewChild("right",{read:t.ElementRef,static:!1})],e.prototype,"rightBtn",void 0),jc([t.ViewChild("tabsContainer",{read:t.ElementRef,static:!1})],e.prototype,"tabsContainer",void 0),e=jc([t.Component({selector:"c8y-tabs-outlet,c8y-ui-tabs",template:'<div #container class="tabContainer hidden-xs">\n <button class="tabs-slider tabs-slider-left" #left *ngIf="showLeft" (click)="scroll(\'left\')">\n <i [c8yIcon]="\'chevron-left\'"></i>\n </button>\n <button class="tabs-slider tabs-slider-right" #right *ngIf="showRight" (click)="scroll(\'right\')">\n <i [c8yIcon]="\'chevron-right\'"></i>\n </button>\n <ul class="nav nav-tabs nav-tabsc8y" #tabsContainer>\n <li [ngClass]="{\'active\': rla.isActive}" *ngFor="let tab of tabs">\n <a [routerLink]="tab.path" routerLinkActive #rla="routerLinkActive" title="{{tab?.label | translate}}">\n <i [c8yIcon]="tab?.icon" *ngIf="!tab.template && tab?.icon"></i>\n <span class="txt" *ngIf="!tab.template">{{tab?.label | translate}}</span>\n <ng-container *ngTemplateOutlet="tab.template"></ng-container>\n </a>\n </li>\n </ul>\n</div>\n\n<div class="visible-xs mobile-tabs">\n <div class="c8y-select-wrapper">\n <select (change)="navigateTo($event.target.value)" #select>\n <option *ngFor="let tab of tabs" [value]="tab.path" [selected]="isActive(tab)">\n {{tab?.label | translate}}\n </option>\n </select>\n </div>\n</div>\n'})],e)}(),Kp=function(){function e(e,t){this.tabsService=e,this.router=t,this.endSubscriptions$=new a.Subject}return e.prototype.ngOnInit=function(){var e=this;this.tabsService.firstTab$.pipe(o.takeUntil(this.endSubscriptions$)).subscribe((function(t){t&&e.router.navigateByUrl(t.path,{replaceUrl:!0})}))},e.prototype.ngOnDestroy=function(){this.endSubscriptions$.next(),this.endSubscriptions$.complete()},e.ctorParameters=function(){return[{type:ld},{type:n.Router}]},e=jc([t.Component({selector:"c8y-conditional-tabs-outlet",template:"\n <router-outlet></router-outlet>\n "})],e)}(),Wp=function(){function e(){}return e=jc([t.NgModule({declarations:[Kp,Vp,zp],imports:[Uu,n.RouterModule.forChild([])],exports:[Kp,Vp,zp]})],e)}(),Yp=function(){function n(t){this.cookieBannerService=t,this.closeSubject=new a.Subject,this.title="Cookie preferences",this.labels={ok:"Save settings",cancel:"Cancel"},this.status=e.Status.INFO}return n.prototype.ngOnInit=function(){this.configCookiePreferencesList=this.cookieBannerService.transformCookiePreferencesToList(this.configCookiePreferences)},n.prototype.ngAfterViewInit=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.modalRef.result];case 1:return e.sent(),this.onClose(),[3,3];case 2:return e.sent(),this.onDismiss(),[3,3];case 3:return[2]}}))}))},n.prototype.onClose=function(){var e=this.cookieBannerService.transformCookiePreferencesListToCookiePreferences(this.configCookiePreferencesList);this.closeSubject.next(e),this.closeSubject.complete()},n.prototype.onDismiss=function(){this.closeSubject.next(void 0),this.closeSubject.complete()},n.prototype.getCookieDescription=function(e){return this.cookieBannerService.getCookieDescription(e)},n.ctorParameters=function(){return[{type:Gd}]},jc([t.ViewChild("modalRef",{static:!1})],n.prototype,"modalRef",void 0),n=jc([t.Component({selector:"c8y-cookie-banner-preferences-modal",template:'<c8y-confirm-modal [title]="title" [status]="status" [labels]="labels" #modalRef>\n\n <div *ngFor="let item of configCookiePreferencesList" class="row p-t-8 p-b-8 separator-top">\n <div class="col-xs-2">\n <div class="text-center">\n <label class="c8y-switch">\n <input\n name="{{ item.name }}"\n type="checkbox"\n [(ngModel)]="item.value"\n [disabled]="item.isReadonly"\n />\n <span></span>\n </label>\n </div>\n </div>\n <div class="col-xs-10">\n <h4 class="text-medium">\n {{ item.name | translate | humanize }}\n </h4>\n <p>\n {{ getCookieDescription(item.name) | translate }}\n </p>\n </div>\n </div>\n</c8y-confirm-modal>\n'})],n)}(),Zp=function(){function e(e,t){this.bsModalService=e,this.cookieBannerService=t,this.shouldDisable=!1}return e.prototype.ngOnInit=function(){this.settings=this.cookieBannerService.getCookieBannerSettings(),this.cookiePreferences=this.cookieBannerService.getCookiePreferencesConfig(),this.shouldShowCookieBanner()},e.prototype.onConfigurePreferences=function(){var e=this;this.disableButtons(!0);var t={configCookiePreferences:this.cookiePreferences};this.bsModalService.show(Yp,{initialState:t}).content.closeSubject.subscribe((function(t){e.disableButtons(!1),t&&(e.cookieBannerService.setCookies(t),e.setCookieBannerVisibility(!1))}))},e.prototype.acceptCookies=function(){this.cookieBannerService.setCookies(this.cookiePreferences||{required:!0}),this.setCookieBannerVisibility(!1)},e.prototype.shouldShowCookieBanner=function(){this.setCookieBannerVisibility(this.cookieBannerService.shouldShowCookieBanner())},e.prototype.disableButtons=function(e){this.shouldDisable=e},e.prototype.setCookieBannerVisibility=function(e){this.showBanner=e,this.cookieBannerService.isCookieBannerShowed$.next(e)},e.ctorParameters=function(){return[{type:oc.BsModalService},{type:Gd}]},e=jc([t.Component({selector:"c8y-cookie-banner",template:'<div class="c8y-cookie-banner">\n <div class="container">\n <div class="row p-t-16 p-b-16" *ngIf="showBanner">\n <div class="col-md-2" *ngIf="settings.cookieBannerTitle">\n <h3>{{ settings.cookieBannerTitle | translate }}</h3>\n <div class="p-b-16 visible-sm visible-xs"></div>\n </div>\n <div class="col-md-7">\n <div class="cookie-banner-content text-pre-line">\n {{ settings.cookieBannerText | translate }}\n </div>\n </div>\n <div class="col-md-3">\n <div class="row">\n <div class="col-sm-6 col-md-12">\n <div class="p-b-16 visible-sm visible-xs"></div>\n <button\n class="btn btn-primary btn-block"\n (click)="acceptCookies()"\n [disabled]="shouldDisable"\n >\n {{ \'Agree and proceed\' | translate }}\n </button>\n </div>\n <div class="col-sm-6 col-md-12" *ngIf="!!cookiePreferences">\n <div class="p-b-16"></div>\n <button\n class="btn btn-default btn-block"\n (click)="onConfigurePreferences()"\n [disabled]="shouldDisable"\n >\n {{ \'Configure preferences\' | translate }}\n </button>\n </div>\n <div class="col-sm-6 col-md-12">\n <div class="p-b-16"></div>\n <a\n class="btn btn-default btn-block"\n href="{{ settings.policyUrl }}"\n target="_blank"\n *ngIf="settings.policyUrl"\n >\n {{ \'Privacy policy\' | translate }}\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n'})],e)}(),Jp=function(){function e(){}return e=jc([t.NgModule({declarations:[id,Zp,Yp],imports:[nc.FormsModule,Uu,Mp,Hp,n.RouterModule,Wp,Gu,ed,Bd,u.TooltipModule,Ud],exports:[id],entryComponents:[id,Yp],providers:[Gd]})],e)}(),Xp=function(){function e(e){this.cd=e,this.title="Upload file",this.message="Drop file here",this.icon="plus-square",this.loadingMessage="Uploading…",this.alwaysShow=!1,this.clickToOpen=!0,this.loading=!1,this.progress=-1,this.dropped=new t.EventEmitter,this.maxAllowedFiles=1/0,this.isOver=!1,this.errors=!1,this.onChange=function(e){},this.onTouched=function(){}}var n;return n=e,e.prototype.ngOnInit=function(){this.alwaysShow=this.alwaysShow||0===this.area.nativeElement.children.length,this.files&&this.files.length>0&&this.onFilesSelected(this.files)},e.prototype.toggle=function(e){this.zone.nativeElement.style.height=this.area.nativeElement.offsetHeight+"px",this.onOver()},e.prototype.showPicker=function(e){this.preventDefault(e),this.picker.nativeElement.value="",this.picker.nativeElement.click()},e.prototype.onOver=function(){this.isOver||(this.isOver=!0,document.addEventListener("dragover",this.preventDefault),document.addEventListener("drop",this.preventDefault))},e.prototype.onPick=function(e){this.errors=!1,this.preventDefault(e),this.onFilesSelected(e.target.files)},e.prototype.onDrop=function(e){this.preventDefault(e),this.onFilesSelected(e.dataTransfer.files),this.stopDragging()},e.prototype.shouldShowFilesList=function(){return this.alwaysShow&&!this.isFilesArrayEmpty()&&!this.hasEmptyFiles()&&!this.isTooManyFiles()},e.prototype.stopDragging=function(){document.removeEventListener("dragover",this.preventDefault),document.removeEventListener("drop",this.preventDefault),this.isOver=!1},e.prototype.onDelete=function(){delete this.files,delete this.filesNameString,this.clearErrors(),this.dropped.emit(void 0),this.onChange(void 0)},e.prototype.writeValue=function(e){this.files=e,e||this.onDelete(),this.cd.detectChanges()},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.onFilesSelected=function(e){if(this.files=e,this.filesNameString=this.getFilesNamesAsString(e),this.errors=!1,this.isFilesArrayEmpty()||this.isTooManyFiles())this.errors=!0,this.errorMessage="Too many files selected.";else if(this.hasEmptyFiles())this.errors=!0,this.errorMessage="File must not be empty, select another one.";else{var t=this.compose(e);this.dropped.emit(t),this.onChange(t)}},e.prototype.getFilesNamesAsString=function(e){return s.map(e,(function(e){return e.name})).join(", ")},e.prototype.isFilesArrayEmpty=function(){return 0===s.get(this,"files.length",0)},e.prototype.isTooManyFiles=function(){return s.get(this,"files.length",0)>this.maxAllowedFiles},e.prototype.hasEmptyFiles=function(){var e=!0;return this.isFilesArrayEmpty()||(e=this.isAnyFileEmpty()),e},e.prototype.isAnyFileEmpty=function(){return s.some(Array.from(this.files),["size",0])},e.prototype.clearErrors=function(){delete this.errorMessage,this.errors=!1},e.prototype.preventDefault=function(e){e&&e.preventDefault()},e.prototype.compose=function(e){var t=this;return Array.from(e).map((function(e){return{file:e,readAsJson:function(){return Sc(t,void 0,void 0,(function(){var t,n;return Cc(this,(function(a){switch(a.label){case 0:return n=(t=JSON).parse,[4,this.read(e,Ap.TEXT)];case 1:return[2,n.apply(t,[a.sent()])]}}))}))},readAsText:function(){return Sc(t,void 0,void 0,(function(){return Cc(this,(function(t){return[2,this.read(e,Ap.TEXT)]}))}))},readAsArrayBuffer:function(){return Sc(t,void 0,void 0,(function(){return Cc(this,(function(t){return[2,this.read(e,Ap.ARRAY_BUFFER)]}))}))},readAsBinaryString:function(){return Sc(t,void 0,void 0,(function(){return Cc(this,(function(t){return[2,this.read(e,Ap.BINARY_STRING)]}))}))},readAsDataURL:function(){return Sc(t,void 0,void 0,(function(){return Cc(this,(function(t){return[2,this.read(e,Ap.DATA_URL)]}))}))}}}))},e.prototype.read=function(e,t){return Sc(this,void 0,void 0,(function(){var n=this;return Cc(this,(function(a){return[2,new Promise((function(a,o){var s=new FileReader;switch(t){case Ap.TEXT:s.readAsText(e);break;case Ap.ARRAY_BUFFER:s.readAsArrayBuffer(e);break;case Ap.BINARY_STRING:s.readAsBinaryString(e);break;case Ap.DATA_URL:s.readAsDataURL(e)}s.onload=function(){return n.onLoad(s,a,o)}}))]}))}))},e.prototype.onLoad=function(e,t,n){2===e.readyState&&(e.error&&n(e.error),t(e.result))},e.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},jc([t.Input()],e.prototype,"title",void 0),jc([t.Input()],e.prototype,"message",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"loadingMessage",void 0),jc([t.Input()],e.prototype,"alwaysShow",void 0),jc([t.Input()],e.prototype,"clickToOpen",void 0),jc([t.Input()],e.prototype,"loading",void 0),jc([t.Input()],e.prototype,"progress",void 0),jc([t.Output()],e.prototype,"dropped",void 0),jc([t.Input()],e.prototype,"maxAllowedFiles",void 0),jc([t.Input()],e.prototype,"files",void 0),jc([t.Input()],e.prototype,"accept",void 0),jc([t.ViewChild("area",{static:!0})],e.prototype,"area",void 0),jc([t.ViewChild("zone",{static:!1})],e.prototype,"zone",void 0),jc([t.ViewChild("picker",{static:!1})],e.prototype,"picker",void 0),e=n=jc([t.Component({selector:"c8y-drop-area",template:'<div\n class="drop-zone"\n *ngIf="!shouldShowFilesList()"\n [ngClass]="{ \'has-errors\': errors }"\n [style.pointerEvents]="loading ? \'none\' : \'auto\'"\n #zone\n (dragleave)="stopDragging()"\n (drop)="onDrop($event)"\n (dragover)="onOver()"\n [style.display]="isOver || alwaysShow || loading ? \'block\' : \'none\'"\n (click)="showPicker($event)"\n>\n <div class="file-placeholder" [ngClass]="{ \'drag-over\': isOver }">\n <div *ngIf="loading" class="d-flex p-4 flex-center">\n <p class="flex-item-middle m-r-8">\n {{ loadingMessage | translate }}\n </p>\n <div class="progress progress-striped active m-0" *ngIf="progress !== -1"\n style="min-width: 50%;">\n <div\n class="progress-bar"\n role="progressbar"\n aria-valuenow="0"\n aria-valuemin="0"\n aria-valuemax="100"\n [style.width]="progress + \'%\'"\n ></div>\n </div>\n <div class="spinner p-relative m-0" *ngIf="progress === -1">\n <div class="rect1"></div>\n <div class="rect2"></div>\n <div class="rect3"></div>\n <div class="rect4"></div>\n <div class="rect5"></div>\n </div>\n </div>\n\n <div *ngIf="!loading" class="hint-placeholder pointer">\n <i class="dlt-c8y-icon-{{ icon }}"></i>\n <p *ngIf="!errors">\n <b>{{ message | translate }}</b>\n <br />\n <span *ngIf="alwaysShow && clickToOpen" translate>or click to browse your computer.</span>\n </p>\n <div *ngIf="errors" class="has-errors">\n <p class="form-control-feedback-message">\n {{ errorMessage | translate }}\n </p>\n </div>\n </div>\n </div>\n</div>\n\n<div class="drop-zone" *ngIf="shouldShowFilesList()"\n [style.display]="isOver || alwaysShow || loading ? \'block\' : \'none\'">\n <div *ngIf="loading" class="d-flex p-4 flex-center">\n <p class="flex-item-middle m-r-8">\n {{ loadingMessage | translate }}\n </p>\n <div class="progress progress-striped active m-0" *ngIf="progress !== -1"\n style="min-width: 50%;">\n <div\n class="progress-bar"\n role="progressbar"\n aria-valuenow="0"\n aria-valuemin="0"\n aria-valuemax="100"\n [style.width]="progress + \'%\'"\n ></div>\n </div>\n <div class="spinner p-relative m-0" *ngIf="progress === -1">\n <div class="rect1"></div>\n <div class="rect2"></div>\n <div class="rect3"></div>\n <div class="rect4"></div>\n <div class="rect5"></div>\n </div>\n </div>\n <div *ngIf="!loading" class="file-placeholder p-4">\n <div class="flex-row p-4">\n <i c8yIcon="file-o" class="m-r-8"></i>\n <span title="{{ filesNameString }}" class="text-truncate">\n {{ filesNameString }}\n </span>\n <button\n title="{{ \'Remove\' | translate }}"\n class="btn btn-clean showOnHover flex-item-right"\n >\n <i c8yIcon="minus-circle" class="text-danger" (click)="onDelete()"></i>\n </button>\n </div>\n </div>\n</div>\n\n<input\n #picker\n *ngIf="clickToOpen"\n (change)="onPick($event)"\n (click)="picker.focus()"\n (blur)="onTouched()"\n [accept]="accept"\n [multiple]="maxAllowedFiles > 1"\n type="file"\n style="opacity: 0; filter: alpha(opacity = 0); height: 0px"\n/>\n<div #area [hidden]="isOver || loading" (dragover)="toggle($event)">\n <ng-content></ng-content>\n</div>\n',providers:[{provide:nc.NG_VALUE_ACCESSOR,useExisting:n,multi:!0}]})],e)}();!function(e){e[e.TEXT=0]="TEXT",e[e.DATA_URL=1]="DATA_URL",e[e.ARRAY_BUFFER=2]="ARRAY_BUFFER",e[e.BINARY_STRING=3]="BINARY_STRING"}(Ap||(Ap={}));var Qp,em=function(){function e(){}return e=jc([t.NgModule({imports:[Uu],exports:[Xp],declarations:[Xp]})],e)}(),tm=function(){function e(){this.onFilesPicked=new t.EventEmitter,this.maxAllowedFiles=1/0,this.uploadChoice="uploadBinary"}return e.prototype.ngOnInit=function(){this.fileBinary&&(this.droppedFiles=[this.fileBinary])},e.prototype.onFileDropped=function(e){this.onFilesPicked.emit({droppedFiles:e})},e.prototype.clearInputFromUrl=function(){delete this.fileUrl,this.fileToSave={url:void 0},this.onFilesPicked.emit(this.fileToSave)},e.prototype.clearSelectedFiles=function(){this.dropArea.onDelete(),this.fileToSave={droppedFiles:void 0},this.onFilesPicked.emit(this.fileToSave)},e.prototype.onFileUrlChange=function(e){this.fileToSave={url:e},this.onFilesPicked.emit(this.fileToSave)},jc([t.ViewChild(Xp,{static:!0})],e.prototype,"dropArea",void 0),jc([t.Output()],e.prototype,"onFilesPicked",void 0),jc([t.Input()],e.prototype,"maxAllowedFiles",void 0),jc([t.Input()],e.prototype,"uploadChoice",void 0),jc([t.Input()],e.prototype,"fileUrl",void 0),jc([t.Input()],e.prototype,"fileBinary",void 0),e=jc([t.Component({selector:"c8y-file-picker",template:'<div class="form-group">\n <label title="{{ \'Upload a binary\' | translate }}" class="c8y-radio radio-inline">\n <input\n #radio\n type="radio"\n value="uploadBinary"\n name="uploadChoice"\n [(ngModel)]="uploadChoice"\n (click)="clearInputFromUrl()"\n />\n <span></span>\n <span>{{ \'Upload a binary\' | translate }}</span>\n </label>\n <label title="{{ \'Use a URL\' | translate }}" class="c8y-radio radio-inline">\n <input\n #radio\n type="radio"\n value="uploadUrl"\n name="uploadChoice"\n [(ngModel)]="uploadChoice"\n (click)="clearSelectedFiles()"\n />\n <span></span>\n <span>{{ \'Use a URL\' | translate }}</span>\n </label>\n</div>\n\n<div [hidden]="uploadChoice !== \'uploadBinary\'">\n <c8y-form-group class="m-0">\n <c8y-drop-area\n class="drop-area-sm"\n (dropped)="onFileDropped($event)"\n [title]="\'Drop file or click to browse\' | translate"\n [maxAllowedFiles]="maxAllowedFiles"\n [files]="droppedFiles"\n >\n </c8y-drop-area>\n </c8y-form-group>\n</div>\n\n<div [hidden]="uploadChoice !== \'uploadUrl\'">\n <c8y-form-group class="m-0">\n <div class="m-b-4 p-b-8">\n <div class="input-group">\n <span class="input-group-addon">\n <i c8yIcon="globe"></i>\n </span>\n <input\n type="text"\n class="form-control"\n name="fileUrl"\n [(ngModel)]="fileUrl"\n (ngModelChange)="onFileUrlChange($event)"\n placeholder="{{ \'e.g.\' | translate }} http://example.com/binary.zip"\n required\n />\n </div>\n </div>\n </c8y-form-group>\n</div>\n'})],e)}(),nm=function(){function e(){}return e=jc([t.NgModule({imports:[xp,i.CommonModule,em,nc.FormsModule,Uu],exports:[tm],declarations:[tm]})],e)}(),am=function(){function e(){this.onDateSelected=new t.EventEmitter}return e.prototype.ngOnInit=function(){this.fgDatePicker=new nc.FormGroup({dateFrom:new nc.FormControl,dateTo:new nc.FormControl})},e.prototype.filter=function(){this.onDateSelected.emit(this.fgDatePicker.value),this.dateFrom=this.fgDatePicker.get("dateFrom").value,this.dateTo=this.fgDatePicker.get("dateTo").value},e.prototype.clearFilter=function(){this.fgDatePicker.setValue({dateFrom:null,dateTo:null}),this.onDateSelected.emit(null),this.dateFrom=null,this.dateTo=null},jc([t.Output()],e.prototype,"onDateSelected",void 0),e=jc([t.Component({selector:"c8y-date-picker",template:'<div\n dropdown\n class="c8y-child-assets-selector"\n #datefilter="bs-dropdown"\n placement="bottom left"\n [autoClose]="false"\n>\n <button\n id="date-range"\n dropdownToggle\n title="{{ \'Date filter\' | translate }}"\n type="button"\n class="btn dropdown-toggle d-flex a-i-center c8y-dropdown"\n aria-controls="dropdown-date-range"\n >\n <i c8yIcon="calendar-o" class="m-r-4 text-primary"></i>\n <span class="text-truncate">\n <span *ngIf="dateFrom">\n <span class="text-label-small">{{ \'From`date`\' | translate }}</span>\n {{ dateFrom | date }}\n </span>\n <span *ngIf="dateTo">\n <span class="text-label-small">{{ \'To`date`\' | translate }}</span>\n {{ dateTo | date }}\n </span>\n <span *ngIf="!dateFrom && !dateTo">\n {{ \'Filter by date\' | translate }}\n </span>\n </span>\n </button>\n <div\n id="dropdown-date-range"\n *dropdownMenu\n class="dropdown-menu"\n role="menu"\n aria-labelledby="date-range"\n >\n <form [formGroup]="fgDatePicker" class="dropdown-form">\n <span class="text-medium m-b-4" translate>Date from</span>\n <c8y-form-group class="datepicker d-block m-b-16" style="max-height: 32px;">\n <input\n formControlName="dateFrom"\n class="form-control fit-w text-left"\n placeholder="{{ \'Date from\' | translate }}"\n bsDatepicker\n [bsConfig]="{ customTodayClass: \'today\', returnFocusToInput: true }"\n />\n </c8y-form-group>\n <span class="text-medium m-b-4" translate>Date to</span>\n <c8y-form-group class="datepicker m-l-0 d-block" style="max-height: 32px;">\n <input\n formControlName="dateTo"\n class="form-control fit-w text-left"\n placeholder="{{ \'Date to\' | translate }}"\n bsDatepicker\n [bsConfig]="{ customTodayClass: \'today\', returnFocusToInput: true }"\n />\n </c8y-form-group>\n <div class="p-t-24">\n <button\n title="{{ \'Clear selection\' | translate }}"\n type="button"\n class="btn btn-default btn-sm"\n (click)="clearFilter(); datefilter.isOpen = !datefilter.isOpen"\n >\n {{ \'Clear`selection`\' | translate }}\n </button>\n <button\n [disabled]="!fgDatePicker.get(\'dateFrom\').value && !fgDatePicker.get(\'dateTo\').value"\n title="{{ \'Apply selection\' | translate }}"\n type="submit"\n class="btn btn-primary btn-sm"\n (click)="filter(); datefilter.isOpen = !datefilter.isOpen"\n >\n {{ \'Apply`selection`\' | translate }}\n </button>\n </div>\n </form>\n </div>\n</div>\n'})],e)}(),om=function(){function e(){}return e=jc([t.NgModule({imports:[xp,i.CommonModule,nc.FormsModule,nc.ReactiveFormsModule,l.BsDropdownModule.forRoot(),lc.BsDatepickerModule.forRoot(),Uu],exports:[am],declarations:[am]})],e)}();(Qp=e.ViewContext||(e.ViewContext={})).Device="device/:id",Qp.Group="group/:id",Qp.User="users/:id",Qp.Application="applications/:id",Qp.SubscribedApplications="subscribedApplications/:id",Qp.Tenant="tenants/:id",Qp.Report="reports/:id";var sm=function(){function e(e,t){this.injector=e,this.router=t}return Object.defineProperty(e.prototype,"routerStateSnapshot",{get:function(){return this.router.routerState.snapshot},enumerable:!0,configurable:!0}),e.prototype.resolve=function(e){var t=this,n=this.router.config.find((function(t){return e.routeConfig.path===t.path})).children;return a.from(n||[]).pipe(o.mergeMap((function(n){return a.from(t.getGuards(n)).pipe(o.map((function(n){return n.canActivate(e,t.routerStateSnapshot)})),o.mergeMap((function(e){return a.isObservable(e)?e:e&&"function"==typeof e.then?a.from(e):a.of(e)})),o.tap((function(e){Array.isArray(e)&&(n.tabs=e)})),o.every((function(e){return!!e})),o.filter((function(e){return e})),o.mergeMap((function(){return Array.isArray(n.tabs)?a.from(n.tabs):a.of(n)})),o.map((function(t){return t.label||t.path?{label:t.label,icon:t.icon,path:decodeURIComponent(e.url.join("/"))+"/"+t.path,priority:t.priority,hide:t.hide}:void 0})))})),o.filter((function(e){return!!e})),o.toArray())},e.prototype.getGuards=function(e){var t=this,n=(e.canActivate||[]).map((function(e){return t.injector.get(e)}));return e.data&&e.data.showIf&&n.push({canActivate:e.data.showIf}),n},e.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},e=jc([t.Injectable()],e)}(),rm=function(){function t(){}return t.contextToService=function(e){return t.services.get(e)},t.services=new Map([[e.ViewContext.Device,m.InventoryService],[e.ViewContext.Group,m.InventoryService],[e.ViewContext.User,m.UserService],[e.ViewContext.Application,m.ApplicationService],[e.ViewContext.SubscribedApplications,m.ApplicationService],[e.ViewContext.Tenant,m.TenantService],[e.ViewContext.Report,m.InventoryService]]),t}(),lm=function(){function e(e,t,n,o,s){this.tabsResolver=e,this.tabsService=t,this.router=n,this.apiService=o,this.injector=s,this.lastAddedTabs=[],this.refreshTrigger=new a.Subject}return e.prototype.init=function(e){var t=this;this.routerSubscription=this.router.events.pipe(o.filter((function(e){return e instanceof n.NavigationEnd}))).subscribe((function(){return t.redirectToFirstTab()})),this.dataSubscription=e.data.pipe(o.merge(this.updatedContext(e),this.refreshTrigger),o.switchMap((function(){return t.tabsResolver.resolve(e.snapshot)}))).subscribe((function(e){return t.updateTabs(e)}))},e.prototype.destroy=function(){var e=this;this.dataSubscription.unsubscribe(),this.routerSubscription.unsubscribe(),this.lastAddedTabs.forEach((function(t){return e.tabsService.remove(t)}))},e.prototype.refreshContext=function(){this.refreshTrigger.next()},e.prototype.updatedContext=function(e){var t=e.snapshot.data,n=rm.contextToService(t.context);if(n){var o=this.injector.get(n).getDetailUrl(t.contextData).replace(/\d+/g,"?\\d*"),s=new RegExp(o,"i"),r=new RegExp(o+"/child","i");return this.apiService.hookResponse((function(e){var t=e.url,n=e.method,a=s.test(t)&&["POST","PUT"].includes(n),o=r.test(t)&&["POST","DELETE"].includes(n);return a||o}))}return a.NEVER},e.prototype.updateTabs=function(e){var t=this;void 0===e&&(e=[]),this.lastAddedTabs.forEach((function(e){return t.tabsService.remove(e)})),this.lastAddedTabs=e,e.forEach((function(e){return t.tabsService.add(e)})),this.redirectToFirstTab()},e.prototype.redirectToFirstTab=function(){var e=this;this.needsRedirect()&&this.tabsService.firstTab$.subscribe((function(t){t&&e.router.navigateByUrl(t.path,{replaceUrl:!0})}))},e.prototype.needsRedirect=function(){return 2===this.router.parseUrl(this.router.url).root.children[n.PRIMARY_OUTLET].segments.length},e.ctorParameters=function(){return[{type:sm},{type:ld},{type:n.Router},{type:c.ApiService},{type:t.Injector}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(sm),t.ɵɵinject(ld),t.ɵɵinject(n.Router),t.ɵɵinject(c.ApiService),t.ɵɵinject(t.INJECTOR))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"})],e)}(),im=new t.InjectionToken("RouteFactory"),cm=function(){function e(e,t,n,a){var o=this;this.router=t,this.tabsService=n,this.contextRouteService=a,Ec(e).subscribe((function(e){o.addRoute(e)}))}return e.prototype.refresh=function(){this.contextRouteService.refreshContext()},e.prototype.addRoute=function(e){this.addRoutes(Array.isArray(e)?e:[e])},e.prototype.addRoutes=function(e){var t=this,n=this.router.config.find((function(e){return"**"===e.path}));this.router.resetConfig(Oc(this.router.config.filter((function(e){return"**"!==e.path})),e.map((function(e){return t.convertRoute(t.router.config,e)})),[n]).filter(Boolean))},e.prototype.convertRoute=function(e,t){if(!t.context)return t;e.forEach((function(e){e.data&&e.data.context===t.context&&(e.children=Oc([t],e.children||[]))}))},e.ctorParameters=function(){return[{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[im]}]},{type:n.Router},{type:ld},{type:lm}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(im,8),t.ɵɵinject(n.Router),t.ɵɵinject(ld),t.ɵɵinject(lm))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"}),wc(0,t.Optional()),wc(0,t.Inject(im))],e)}(),um=function(){function e(e,t){this.route=e,this.contextRouteService=t}return e.prototype.ngOnInit=function(){this.contextRouteService.init(this.route)},e.prototype.ngOnDestroy=function(){this.contextRouteService.destroy()},e.prototype.refreshTabs=function(){this.contextRouteService.refreshContext()},e.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:lm}]},e=jc([t.Component({selector:"c8y-context-route",template:"<router-outlet></router-outlet>\n"})],e)}(),dm=function(){function e(e){this.client=e,this.callsSubject=new a.Subject,this.calls=this.callsSubject.asObservable(),this.hookIntoClientFetch()}return e.prototype.hookResponse=function(e){return this.callsSubject.pipe(o.filter((function(e){return"finish"===e.phase})),o.filter(e))},e.prototype.hookRequest=function(e){return this.callsSubject.pipe(o.filter((function(e){return"start"===e.phase})),o.filter(e))},e.prototype.onFinish=function(e){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){return this.callsSubject.next(bc({phase:"finish"},e)),[2]}))}))},e.prototype.onStart=function(e){this.callsSubject.next(bc({phase:"start"},e))},e.prototype.resolveData=function(e){return Sc(this,void 0,void 0,(function(){var t,n,a;return Cc(this,(function(o){return t=e.response,n=e.method,"data"in t?[2,Promise.resolve({data:t.data,method:n})]:(a=function(e){return{data:e,method:n}},[2,t.clone().json().then(a,a)])}))}))},e.prototype.hookIntoClientFetch=function(){var e=this,t=this.client.fetch.bind(this.client);this.client.fetch=function(n,a){return void 0===a&&(a={method:"GET"}),Sc(e,void 0,void 0,(function(){var e,o,s=this;return Cc(this,(function(r){return e=a.method,this.onStart({options:a,method:e,url:n}),o=t(n,a),"function"==typeof a.responseInterceptor&&(o=o.then(a.responseInterceptor)),o.then((function(t){return s.onFinish({response:t,url:n,options:a,method:e})}),(function(t){return s.onFinish({response:t,url:n,options:a,method:e})})),[2,o]}))}))}},e.ctorParameters=function(){return[{type:m.FetchClient}]},e=jc([t.Injectable()],e)}(),pm=Object.freeze({__proto__:null,FetchClient:m.FetchClient,BasicAuth:m.BasicAuth,CookieAuth:m.CookieAuth,Realtime:m.Realtime,EventBinaryService:m.EventBinaryService,EventService:m.EventService,InventoryService:m.InventoryService,MeasurementService:m.MeasurementService,AlarmService:m.AlarmService,OperationBulkService:m.OperationBulkService,OperationService:m.OperationService,ApplicationService:m.ApplicationService,UserService:m.UserService,TenantService:m.TenantService,SystemOptionsService:m.SystemOptionsService,TenantOptionsService:m.TenantOptionsService,TenantSecurityOptionsService:m.TenantSecurityOptionsService,TenantLoginOptionsService:m.TenantLoginOptionsService,AuditService:m.AuditService,InventoryRoleService:m.InventoryRoleService,InventoryBinaryService:m.InventoryBinaryService,DeviceRegistrationService:m.DeviceRegistrationService,DeviceRegistrationBulkService:m.DeviceRegistrationBulkService,UserRoleService:m.UserRoleService,UserGroupService:m.UserGroupService,IdentityService:m.IdentityService,TrustedCertificateService:m.TrustedCertificateService,SmartGroupsService:m.SmartGroupsService,SmartRulesService:m.SmartRulesService});var mm=Object.keys(pm).map((function(e){return t=pm[e],n=[m.FetchClient,m.Realtime],t===m.FetchClient&&(n=[m.CookieAuth]),t!==m.BasicAuth&&t!==m.CookieAuth||(n=[]),t===m.Realtime&&(n=[m.FetchClient]),{provide:t,useClass:t,deps:n};var t,n})).concat([{provide:dm,useClass:dm,deps:[m.FetchClient]}]),hm=(function(){function e(){}var n;n=e,e.providers=function(){return mm},e.forRoot=function(){return{ngModule:n,providers:mm}},e=n=jc([t.NgModule()],e)}(),function(){function e(e){this.injector=e,this.caches=new Map}return e.prototype.canActivate=function(e){var t=e.paramMap.get("id"),n=this.service(e);return this.clearDetailCached(n,t),this.detailCached(n,t).pipe(o.tap((function(t){return e.data=bc({},e.data,{contextData:t})})),o.map((function(){return!0})),o.catchError((function(e){return a.of(!1)})))},e.prototype.service=function(e){var t=rm.contextToService(e.data.context);return this.injector.get(t)},e.prototype.detailCached=function(e,t){var n=this.getCache(e),s=n[t];if(!s){var r=e instanceof m.InventoryService?{withChildren:!1}:void 0;s=a.from(e.detail(t,r)).pipe(o.map((function(e){return e.data})),o.shareReplay(1)),n[t]=s}return s},e.prototype.clearDetailCached=function(e,t){delete this.getCache(e)[t]},e.prototype.getCache=function(e){var t=this.caches.get(e);return t||(t={},this.caches.set(e,t)),t},e.ctorParameters=function(){return[{type:t.Injector}]},e=jc([t.Injectable()],e)}()),fm=function(){function e(){}return e=jc([t.Component({selector:"empty",template:""})],e)}(),gm=[{path:"users/new",component:fm},{path:"tenants/new",component:fm}];for(var ym in e.ViewContext){var vm=e.ViewContext[ym];gm.push({path:vm,component:um,canActivate:[hm],data:{context:vm,contextData:{}},resolve:{tabs:sm}})}var bm,jm,wm,Sm,Cm,Im,Pm=function(){function e(e){}var a;return a=e,e.providers=function(){return[hm,sm,cm]},e.forRoot=function(){return{ngModule:a,providers:a.providers()}},e.ctorParameters=function(){return[{type:cm}]},e=a=jc([t.NgModule({declarations:[um,fm],imports:[n.RouterModule.forRoot(gm),Mp,Uu],entryComponents:[um,fm]})],e)}();(wm=e.SendStatus||(e.SendStatus={})).AVAILABLE="AVAILABLE",wm.UNAVAILABLE="UNAVAILABLE",wm.UNKNOWN="UNKNOWN",wm.MAINTENANCE="MAINTENANCE",wm.NOT_MONITORED="NOT_MONITORED",(Sm=e.PushStatus||(e.PushStatus={})).CONNECTED="CONNECTED",Sm.DISCONNECTED="DISCONNECTED",Sm.UNKNOWN="UNKNOWN",Sm.MAINTENANCE="MAINTENANCE",(Cm=e.SendStatusLabels||(e.SendStatusLabels={}))[Cm.AVAILABLE="Send connection: online"]="AVAILABLE",Cm[Cm.NOT_MONITORED="Send connection: not monitored"]="NOT_MONITORED",Cm[Cm.UNAVAILABLE="Send connection: offline"]="UNAVAILABLE",Cm[Cm.UNKNOWN="Send connection status unknown"]="UNKNOWN",Cm[Cm.MAINTENANCE="Device is under maintenance"]="MAINTENANCE",(Im=e.PushStatusLabels||(e.PushStatusLabels={}))[Im.CONNECTED="Push connection: active"]="CONNECTED",Im[Im.DISCONNECTED="Push connection: inactive"]="DISCONNECTED",Im[Im.UNKNOWN="Push connection: inactive"]="UNKNOWN",Im[Im.MAINTENANCE="Device is under maintenance"]="MAINTENANCE";var Om={sendData:(bm={},bm[e.SendStatus.AVAILABLE]={icon:"long-arrow-right",class:"statusOk"},bm[e.SendStatus.UNAVAILABLE]={icon:"long-arrow-right",class:"statusNok"},bm[e.SendStatus.UNKNOWN]={icon:"long-arrow-right",class:"statusUnknown"},bm[e.SendStatus.NOT_MONITORED]={icon:"long-arrow-right",class:"statusUnknown"},bm),push:(jm={},jm[e.PushStatus.CONNECTED]={icon:"long-arrow-left",class:"statusOk"},jm[e.PushStatus.DISCONNECTED]={icon:"long-arrow-left",class:"statusUnknown"},jm[e.PushStatus.UNKNOWN]={icon:"long-arrow-left",class:"statusUnknown"},jm[e.PushStatus.MAINTENANCE]={icon:"wrench",class:"statusAlert"},jm),device:{MAINTENANCE:{icon:"wrench",class:"statusAlert"}}},xm=function(e,t){var n=i.formatDate(new Date(e),"medium",t.currentLang);return t.instant("Device last request:\n{{date}}",{date:n})},Em={sendStatusConnected:xm,sendStatusDisconnected:"Connection not monitored",pushStatusConnected:"Connection to device established",pushStatusDisconnected:"Connection to device not established (not supported by device or no connectivity)",maintenance:"Device is under maintenance"},km=function(){function n(e){this.translateService=e}return Object.defineProperty(n.prototype,"node",{set:function(e){this._mo=e.mo||e},enumerable:!0,configurable:!0}),n.prototype.get=function(){return this._mo},n.prototype.ngOnChanges=function(){this.setStatusProperites()},n.prototype.ngAfterContentInit=function(){this.setStatusProperites()},n.prototype.setStatusProperites=function(){this.requiredAvailability=s.get(this._mo,"c8y_RequiredAvailability"),this.availabilityStatus=s.get(this._mo,"c8y_Availability.status"),this.pushStatus=s.get(this._mo,"c8y_Connection.status")||"UNKNOWN",this.sendStatus=this.availabilityStatus||(this.requiredAvailability?"UNKNOWN":"NOT_MONITORED")},n.prototype.status=function(){return"MAINTENANCE"===this.availabilityStatus||"MAINTENANCE"===this.pushStatus?this.getMaintenanceStatus():this.getSendPushStatus()},n.prototype.getMaintenanceStatus=function(){return{sendStatus:!1,pushStatus:!1,maintenanceStatus:{icon:Om.device.MAINTENANCE.icon,class:Om.device.MAINTENANCE.class,tooltip:Em.maintenance}}},n.prototype.getSendPushStatus=function(){return{sendStatus:{icon:Om.sendData[this.sendStatus].icon,class:Om.sendData[this.sendStatus].class,status:this.sendStatus,label:e.SendStatusLabels[this.sendStatus],tooltip:this.getSendStatusTooltip(this._mo)},pushStatus:{icon:Om.push[this.pushStatus].icon,class:Om.push[this.pushStatus].class,status:this.pushStatus,label:e.PushStatusLabels[this.pushStatus],tooltip:this.getPushStatusTooltip("CONNECTED"===this.pushStatus)},maintenanceStatus:!1}},n.prototype.getSendStatusTooltip=function(e){var t=e&&e.c8y_Availability,n=t&&t.lastMessage;return n?Em.sendStatusConnected(n,this.translateService):Em.sendStatusDisconnected},n.prototype.getPushStatusTooltip=function(e){return e?Em.pushStatusConnected:Em.pushStatusDisconnected},n.ctorParameters=function(){return[{type:p.TranslateService}]},jc([t.Input("mo")],n.prototype,"node",null),n=jc([t.Component({selector:"device-status",template:'\x3c!-- ATTENTION: keep text format in `tooltip` attribute --\x3e\n<div class="statusContainer"\n title="{{status().sendStatus.tooltip | translate}}\n{{status().pushStatus.tooltip | translate}}"\n placement="left"\n >\n <div\n *ngIf="!!status().sendStatus"\n class="sendStatus"\n [c8yIcon]="status().sendStatus.icon"\n [ngClass]="status().sendStatus.class"\n ></div>\n <div\n *ngIf="!!status().pushStatus"\n class="pushStatus"\n [c8yIcon]="status().pushStatus.icon"\n [ngClass]="status().pushStatus.class"\n >\n </div>\n\n <div *ngIf="!!status().maintenanceStatus"\n class="maintenanceStatus"\n tooltip="{{status().maintenanceStatus.tooltip | translate}}"\n container="body"\n placement="auto"\n [c8yIcon]="status().maintenanceStatus.icon"\n [ngClass]="status().maintenanceStatus.class"></div>\n</div>\n'})],n)}(),Tm=function(){function e(){}return e=jc([t.NgModule({imports:[Uu,u.TooltipModule],exports:[km],declarations:[km]})],e)}(),Am=function(){function e(e){this.elementRef=e,this.htmlAnchor=this.elementRef.nativeElement,this.htmlAnchor.hasAttribute("target")||this.htmlAnchor.setAttribute("target","_blank")}return Object.defineProperty(e.prototype,"baseHref",{set:function(e){this.htmlAnchor.href=e+"/"+this.c8yGuideHref},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:t.ElementRef}]},jc([t.Input("c8y-guide-href")],e.prototype,"c8yGuideHref",void 0),e=jc([t.Directive({selector:"[c8y-guide-href]"})],e)}(),_m=function(){function e(e,t,n){this.docs=e,this.el=t,this.renderer=n,this.destroyed$=new a.ReplaySubject(1)}return e.prototype.ngOnInit=function(){this.baseUrl=this.docs.getBaseUrl()},e.prototype.ngAfterContentInit=function(){var e=this;this.translateDirective?this.translateDirective.htmlUpdateEvent.pipe(o.takeUntil(this.destroyed$)).subscribe((function(){e.replaceAnchorAttributes()})):this.replaceAnchorAttributes()},e.prototype.replaceAnchorAttributes=function(){var e=this;this.findGuideAnchors(this.el.nativeElement).forEach((function(t){var n=e.baseUrl+"/"+t.getAttribute("c8y-guide-href");e.renderer.setAttribute(t,"href",n),t.hasAttribute("target")||e.renderer.setAttribute(t,"target","_blank")}))},e.prototype.findGuideAnchors=function(e){var t=this,n=[];return"A"===e.nodeName&&e.attributes.getNamedItem("c8y-guide-href")?n.push(e):e.childNodes&&e.childNodes.length>0&&e.childNodes.forEach((function(e){var a=t.findGuideAnchors(e);a&&(n=Oc(n,a))})),n},e.prototype.ngAfterViewInit=function(){var e=this;this.links.forEach((function(t){t.baseHref=e.baseUrl}))},e.prototype.ngOnDestroy=function(){this.destroyed$.next(!0),this.destroyed$.complete()},e.ctorParameters=function(){return[{type:xd},{type:t.ElementRef},{type:t.Renderer2}]},jc([t.ContentChildren(Am,{descendants:!0})],e.prototype,"links",void 0),jc([t.ContentChild(eu,{static:!1})],e.prototype,"translateDirective",void 0),e=jc([t.Component({selector:"[c8y-guide-docs]",template:'<ng-container *ngIf="!!baseUrl">\n <ng-content></ng-content>\n</ng-container>\n'})],e)}(),Nm=function(){function e(){}return e=jc([t.NgModule({declarations:[Am,_m],imports:[i.CommonModule],exports:[Am,_m],providers:[xd]})],e)}(),Dm=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}var a;return vc(n,e),a=n,n.prototype.ngOnInit=function(){this.to.required&&!this.field.fieldGroup.length&&this.add()},n.CONFIG={types:[{name:"array",component:a}]},n=a=jc([t.Component({selector:"c8y-array-type",template:'<div role="group"\n [attr.aria-labelledby]="id + \'-fieldset\'"\n>\n <div id="{{id + \'-fieldset\'}}"\n class="legend form-block"\n *ngIf="to.label || to.description"\n >\n {{ to.label }}\n <button\n *ngIf="to.description"\n class="btn-clean text-14 m-l-4 flex-item-middle"\n [popover]="to.description"\n placement="right"\n outsideClick="true"\n type="button"\n >\n <i c8yIcon="question-circle-o" class="text-primary"></i>\n </button>\n </div>\n\n <div class="form-control-feedback-message has-error"\n role="alert"\n *ngIf="showError && formControl.errors"\n >\n <formly-validation-message [field]="field"></formly-validation-message>\n </div>\n\n <div *ngFor="let field of field.fieldGroup; let i = index" class="input-group-array">\n <formly-field [field]="field">\n </formly-field>\n <div class="input-group-btn">\n <button\n class="btn btn-clean flex-item-right"\n title="{{ \'Delete\' | translate }}"\n (click)="remove(i)"\n >\n <i c8yIcon="minus-circle" class="text-danger"></i>\n </button>\n </div>\n </div>\n\n <div class="p-t-8">\n <button\n title="{{ \'Add \\{\\{ label \\}\\}\' | translate: field?.fieldArray?.templateOptions }}"\n class="btn-add-block"\n (click)="add()"\n >\n <i c8yIcon="plus-square"></i>\n <span ngNonBindable translate [translateParams]="field?.fieldArray?.templateOptions"\n >Add {{ label }}</span\n >\n </button>\n </div>\n</div>\n'})],n)}(ic.FieldArrayType),Lm=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.defaultOptions={templateOptions:{indeterminate:!0,formCheck:"custom"}},t}var a;return vc(n,e),a=n,n.CONFIG={types:[{name:"checkbox",component:a},{name:"boolean",extends:"checkbox"}]},n=a=jc([t.Component({selector:"c8y-field-checkbox",template:' <label class="c8y-checkbox" [class.has-error]="showError">\n <input\n type="checkbox"\n [class.is-invalid]="showError"\n [class.form-check-input]="to.formCheck.indexOf(\'custom\') === -1"\n [class.position-static]="to.formCheck === \'nolabel\'"\n [class.custom-control-input]="to.formCheck.indexOf(\'custom\') === 0"\n [indeterminate]="to.indeterminate && formControl.value == null"\n [formControl]="formControl"\n [formlyAttributes]="field"\n /><span></span><span> {{ to.label }} </span>\n <span *ngIf="to.required && to.hideRequiredMarker !== true"><em class="m-l-4" translate>(required)</em></span>\n <button\n *ngIf="!!to.description"\n class="btn-clean m-l-4 flex-item-middle"\n [popover]="to.description"\n placement="auto"\n outsideClick="true"\n type="button"\n >\n <i c8yIcon="question-circle-o" class="text-primary"></i>\n </button>\n </label>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],n)}(ic.FieldType),Mm=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.dropAreaInputs=["title","message","icon","loadingMessage","alwaysShow","clickToOpen","loading","progress","maxAllowedFiles","files","accept"],t}var a;return vc(n,e),a=n,n.prototype.ngOnInit=function(){var e=this;this.dropAreaInputs.filter((function(t){return void 0!==e.to[t]})).forEach((function(t){return e.dropArea[t]=e.to[t]}))},n.CONFIG={types:[{name:"file",component:a}]},jc([t.ViewChild("dropArea",{static:!0})],n.prototype,"dropArea",void 0),n=a=jc([t.Component({selector:"c8y-field-file",template:'<div class="form-group" role="group" [attr.aria-labelledby]="id + \'-fieldset\'">\n <div id="{{ id + \'-fieldset\' }}" class="legend form-block" *ngIf="to.label || to.description">\n {{ to.label }}\n <button\n *ngIf="to.description"\n class="btn-clean text-14 m-l-4"\n [popover]="to.description"\n placement="right"\n outsideClick="true"\n type="button"\n >\n <i c8yIcon="question-circle-o" class="text-primary"></i>\n </button>\n </div>\n\n <c8y-drop-area #dropArea class="drop-area-sm" [formControl]="formControl"> </c8y-drop-area>\n\n <div\n class="form-control-feedback-message has-error"\n role="alert"\n *ngIf="showError && formControl.errors"\n >\n <formly-validation-message [field]="field"></formly-validation-message>\n </div>\n</div>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],n)}(ic.FieldType),Rm=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.maxHelpBlockLength=64,t}var a;return vc(n,e),a=n,n.prototype.ngOnInit=function(){this.showDescriptionAsPopup="radio"===this.field.type||this.to.description&&this.to.description.length>this.maxHelpBlockLength},n.CONFIG={wrappers:[{name:"c8y-form-field",component:a}]},n=a=jc([t.Component({selector:"c8y-wrapper-form-field",template:'<div class="form-group" [class.has-error]="showError">\n <label *ngIf="to.label && to.hideLabel !== true" [attr.for]="id">\n {{ to.label }}\n <button\n *ngIf="to.description && showDescriptionAsPopup"\n class="btn-clean m-l-4 flex-item-middle"\n [popover]="to.description"\n placement="auto"\n outsideClick="true"\n type="button"\n >\n <i c8yIcon="question-circle-o" class="text-primary"></i>\n </button>\n </label>\n\n <ng-template #fieldComponent></ng-template>\n\n <div *ngIf="showError" class="c8y-messages">\n <formly-validation-message\n class="form-control-feedback-message"\n [field]="field"\n ></formly-validation-message>\n </div>\n\n <div class="help-block" *ngIf="!showError && to.description && !showDescriptionAsPopup">\n {{ to.description }}\n </div>\n</div>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],n)}(ic.FieldWrapper),qm=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}var a;return vc(n,e),a=n,Object.defineProperty(n.prototype,"type",{get:function(){return this.to.type||"text"},enumerable:!0,configurable:!0}),n.CONFIG={types:[{name:"input",component:a,wrappers:["c8y-form-field"]},{name:"string",extends:"input"},{name:"number",extends:"input",defaultOptions:{templateOptions:{type:"number"}}},{name:"integer",extends:"input",defaultOptions:{templateOptions:{type:"number"}}}]},n=a=jc([t.Component({selector:"c8y-field-input",template:'<input\n *ngIf="type !== \'number\'; else numberTmp"\n [type]="type"\n [formControl]="formControl"\n class="form-control"\n [formlyAttributes]="field"\n [required]="to.required"\n [attr.autocomplete]="to.autocomplete ? to.autocomplete : null"\n [class.is-invalid]="showError"\n/>\n<ng-template #numberTmp>\n <input\n type="number"\n [formControl]="formControl"\n class="form-control"\n [formlyAttributes]="field"\n [required]="to.required"\n [attr.autocomplete]="to.autocomplete ? to.autocomplete : null"\n [class.is-invalid]="showError"\n />\n</ng-template>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],n)}(ic.FieldType),$m=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}var a;return vc(n,e),a=n,n.CONFIG={types:[{name:"object",component:a}]},n=a=jc([t.Component({selector:"c8y-object-type",template:'<div role="group"\n [attr.aria-labelledby]="id + \'-fieldset\'" \n>\n <div id="{{id + \'-fieldset\'}}" \n class="legend form-block" \n *ngIf="to.label"\n >{{ to.label }}</div>\n <p *ngIf="to.description">{{ to.description }}</p>\n <div class="form-control-feedback-message has-error" \n role="alert" \n *ngIf="showError && formControl.errors"\n >\n <formly-validation-message [field]="field"></formly-validation-message>\n </div>\n <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>\n</div>\n'})],n)}(ic.FieldType),Fm=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.defaultOptions={templateOptions:{options:[],formCheck:"custom"}},t}var a;return vc(n,e),a=n,n.CONFIG={types:[{name:"radio",component:a,wrappers:["c8y-form-field"]}]},n=a=jc([t.Component({selector:"c8y-field-radio",template:'<label\n *ngFor="let option of to.options | formlySelectOptions: field | async; let i = index"\n [title]="option.label"\n class="c8y-radio"\n>\n <input\n type="radio"\n [id]="id + \'_\' + i"\n [name]="field.name || id"\n [attr.value]="option.value"\n [value]="option.value"\n [formControl]="formControl"\n [formlyAttributes]="field"\n [attr.disabled]="option.disabled || formControl.disabled ? true : null"\n />\n <span></span>\n <span>{{ option.label }}</span>\n</label>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],n)}(ic.FieldType),Um=[Lm,Dm,Rm,Mm,qm,Fm,$m];function Bm(){return Um.map((function(e){return e.CONFIG})).reduce((function(e,t){return bc({},e,{types:Oc(e.types,t.types||[]),wrappers:Oc(e.wrappers,t.wrappers||[])})}),{types:[],wrappers:[]})}var Gm=function(){function e(){}return e=jc([t.NgModule({declarations:Oc(Um),entryComponents:Oc(Um),imports:[i.CommonModule,ac.PopoverModule,nc.ReactiveFormsModule,nu,em,xp,ic.FormlyModule,cc.FormlySelectModule],providers:[{provide:ic.FORMLY_CONFIG,useFactory:Bm,multi:!0}]})],e)}(),Hm=function(){function e(e,t){this.translate=e,this.parser=t}return e.prototype.prePopulate=function(e){var t=this,n=e.templateOptions||{};n.label&&!n._translated&&(n._translated=!0,e.expressionProperties=bc({},e.expressionProperties||{},{"templateOptions.label":n.label?this.translate.stream(n.label):n.label,"templateOptions.description":n.description?this.translate.stream(n.description):n.description,"templateOptions.placeholder":n.placeholder?a.combineLatest([this.translate.stream(n.placeholder),this.translate.stream("e.g. {{ example }}")]).pipe(o.map((function(e){var n=Pc(e,2),a=n[0],o=n[1];return t.parser.interpolate(o,{example:a})}))):n.placeholder,"templateOptions.options":(a.isObservable(n.options)?n.options:a.of(n.options)).pipe(o.map((function(e){return(e||[]).map((function(e){return bc({},e,{label:t.translate.instant(e.label)})}))})))}))},e}();function zm(e,t){return{extensions:[{name:"translate",extension:new Hm(e,t)}]}}var Vm=zm,Km=function(){function e(){}return e=jc([t.NgModule({imports:[ic.FormlyModule,nu],providers:[{provide:ic.FORMLY_CONFIG,multi:!0,useFactory:Vm,deps:[p.TranslateService,p.TranslateParser]}]})],e)}(),Wm=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return vc(n,e),n.prototype.toFieldConfig=function(t,n){return e.prototype.toFieldConfig.call(this,t,this.c8yOptions((n||{}).map))},n.prototype.c8yOptions=function(e){return{map:function(t,n){var a=t;return n.const&&(a=bc({},a,{defaultValue:n.const,templateOptions:bc({},a.templateOptions,{type:"hidden"})})),n.writeOnly&&(a=bc({},a,{templateOptions:bc({},a.templateOptions,{type:"password",autocomplete:"off"})})),n.examples&&(a=bc({},a,{templateOptions:bc({},a.templateOptions,{placeholder:n.examples.join(", ")})})),n.enum&&(a=bc({},a,{type:"radio"})),(n.contentMediaType||n.contentEncoding)&&(a=bc({},a,{type:"file",templateOptions:bc({},a.templateOptions,{accept:n.contentMediaType,maxAllowedFiles:1,contentEncoding:n.contentEncoding})})),e?e(a,n):a}}},n=jc([t.Injectable()],n)}(uc.FormlyJsonschema);function Ym(e){return{validationMessages:[{name:"required",message:function(){return e.stream("This field is required.")}},{name:"pattern",message:function(t,n){return e.stream("Does not match pattern {{ requiredPattern }}",t)}}]}}var Zm,Jm=Ym,Xm=function(){function e(){}return e=jc([t.NgModule({imports:[nu,ic.FormlyModule],providers:[{provide:ic.FORMLY_CONFIG,multi:!0,useFactory:Jm,deps:[p.TranslateService]}]})],e)}(),Qm=function(){function e(){}return e=jc([t.NgModule({imports:[i.CommonModule,nc.ReactiveFormsModule,Km,Xm,Gm,ic.FormlyModule.forRoot()],providers:[Wm],exports:[ic.FormlyModule,nc.ReactiveFormsModule]})],e)}(),eh=new t.InjectionToken("Hook Dynamic Component"),th=new t.InjectionToken("Hook Dynamic Component @deprecated"),nh=function(e){function s(t,n){var o=e.call(this)||this;return o.injector=t,o.refreshTrigger=new a.Subject,o.state$=new a.BehaviorSubject(new Set),o.items$=Ec([function(){return o.injector.get(eh,[])},function(){return o.getComponentsViaDeprecatedHook()}],n,!1),o.items$.subscribe((function(e){e.forEach((function(e){o.state.add(e)})),o.emitNewState()})),o}return vc(s,e),s.prototype.getComponentsViaDeprecatedHook=function(){var e=this.injector.get(th,[]);return e&&e.length&&"production"!==__MODE__&&console.warn("HOOK_COMPONENT is now deprecated. Use HOOK_COMPONENTS instead."),e},s.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.getById$=function(e){return this.state$.pipe(o.filter((function(e){return e.size>0})),o.mergeMap((function(t){return a.of(Array.from(t).find((function(t){return t.id===e})))})),o.take(1))},s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),ah=function(){function e(e,t){this.componentFactoryResolver=e,this.dynamicComponentService=t,this.mode="component",this.notFoundError=!0,this.expandErrorDetails=!1}return e.prototype.callLifeCycleHooks=function(){return this.callOnBeforeSaveHook()},e.prototype.ngOnChanges=function(){var e=this;this.dynamicComponentService.getById$(this.componentId).subscribe((function(t){return e.loadComponent(t)}))},e.prototype.loadComponent=function(e){try{this.error=void 0;var t=this.componentFactoryResolver.resolveComponentFactory("component"===this.mode?e.component:e.configComponent);this.host.clear(),this.componentRef=this.host.createComponent(t),this.componentRef.instance.config=this.config}catch(e){this.error=e}},e.prototype.callOnBeforeSaveHook=function(){if(!this.componentRef)return a.of(!0);var e=this.componentRef.instance.onBeforeSave;if(e){var t=e.call(this.componentRef.instance,this.config);return s.isUndefined(t)?a.of(!0):a.isObservable(t)?t:a.of(t)}return a.of(!0)},e.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:nh}]},jc([t.Input()],e.prototype,"componentId",void 0),jc([t.Input()],e.prototype,"config",void 0),jc([t.Input()],e.prototype,"mode",void 0),jc([t.Input()],e.prototype,"notFoundError",void 0),jc([t.ViewChild("host",{read:t.ViewContainerRef,static:!0})],e.prototype,"host",void 0),e=jc([t.Component({selector:"c8y-dynamic-component",template:'<ng-template #host></ng-template>\n\n<div class="alert alert-warning m-8" role="alert" *ngIf="notFoundError && error">\n <strong class="message">\n {{\n \'This widget cannot be rendered because the current application does not support the following component:\'\n | translate\n }}\n {{ componentId }}.\n </strong>\n <p class="text-muted m-t-8">\n <button class="btn btn-clean" (click)="expandErrorDetails = !expandErrorDetails">\n <i c8yIcon="chevron-down"></i>\n <span *ngIf="!expandErrorDetails" translate>Show details</span>\n <span *ngIf="expandErrorDetails" translate>Hide details</span>\n </button>\n </p>\n <div [collapse]="!expandErrorDetails" [isAnimated]="true">\n <pre>\n {{ error }}\n </pre>\n </div>\n</div>\n'})],e)}(),oh=function(){function e(){}return e=jc([t.NgModule({declarations:[ah],imports:[i.CommonModule,r.CollapseModule,n.RouterModule.forChild([]),cu],exports:[ah],providers:[nh]})],e)}(),sh=function(){function e(){}return jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=jc([t.Component({selector:"c8y-dashboard-child-action",template:"<ng-template #template>\n <li>\n <ng-content></ng-content>\n </li>\n</ng-template>\n"})],e)}(),rh=function(){function e(){}return e=jc([t.Component({selector:"c8y-dashboard-child-title",template:'<div class="card-title">\n <ng-content></ng-content>\n</div>\n'})],e)}(),lh=function(){function e(e,n){this.element=e,this.sanitizer=n,this.columns=12,this.gap=12,this.rows="auto",this.dashboardChange=new t.EventEmitter,this.lastRow=1,this.DEFAULT_ROW_SIZE=68}return Object.defineProperty(e.prototype,"columnSize",{get:function(){return this.dashboardRect.width/this.columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSize",{get:function(){return"auto"===this.rows?this.DEFAULT_ROW_SIZE:this.calculateRowSize()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inlineStyle",{get:function(){return this.sanitizer.bypassSecurityTrustStyle("\n -ms-grid-columns: (1fr)["+this.columns+"];\n grid-template-columns: repeat("+this.columns+", 1fr);\n "+("auto"!==this.rows?"grid-template-rows: repeat("+this.rows+", 1fr);":"")+"\n grid-auto-rows: "+(this.rowSize+this.gap)+"px;\n -ms-grid-rows: ("+(this.rowSize+this.gap)+"px)["+("auto"===this.rows?this.lastRow:this.rows)+"];\n margin: -"+this.gap+"px;\n ")},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this.onResize(),this.getLastRow()},e.prototype.onResize=function(){this.updateRectSize()},e.prototype.getLastRow=function(){var e=1;this.children.forEach((function(t){e<t.y+t.width&&(e=t.y+t.width)})),this.lastRow=e+1},e.prototype.updateRectSize=function(){var e=this.element.nativeElement;this.dashboardRect=e.getBoundingClientRect()},e.prototype.emitChange=function(e){this.dashboardChange.emit({source:e,children:this.children.toArray()})},e.prototype.calculateRowSize=function(){return this.dashboardRect.height/this.rows},e.ctorParameters=function(){return[{type:t.ElementRef},{type:pc.DomSanitizer}]},jc([t.ContentChildren(t.forwardRef((function(){return ch})))],e.prototype,"children",void 0),jc([t.Input()],e.prototype,"columns",void 0),jc([t.Input()],e.prototype,"gap",void 0),jc([t.Input()],e.prototype,"rows",void 0),jc([t.Output()],e.prototype,"dashboardChange",void 0),jc([t.HostBinding("attr.style")],e.prototype,"inlineStyle",null),jc([t.HostListener("window:resize")],e.prototype,"onResize",null),e=jc([t.Component({selector:"c8y-dashboard",template:"<ng-content></ng-content>\n",host:{class:"c8y-grid-dashboard dashboard-grid"},changeDetection:t.ChangeDetectionStrategy.OnPush})],e)}(),ih=function(){function e(e){this.MIN_WIDTH=2,this.MIN_HEIGHT=1,this.PIXEL_SIZE_THRESHOLD=10,this.diffX=0,this.diffY=0,this.dashboard=e.dashboard,this.children=e.dashboard.children?e.dashboard.children.filter((function(t){return e!==t})):[],this.child=e}return Object.defineProperty(e.prototype,"resize$",{get:function(){var e=this;return this.child.dragSource.moved.pipe(o.map((function(t){return e.getPixelSize(t)})),o.tap((function(t){return e.setPixelSize(t)})),o.map((function(t){return e.getDimensionSize(t)})),o.distinctUntilChanged((function(e,t){return e.width===t.width&&e.height===t.height})),o.map((function(t){return e.setDimension(t)})),this.arrangePipe())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drag$",{get:function(){var e=this;return this.child.dragSource.moved.pipe(o.map((function(t){return e.getDimensionPosition(t)})),o.filter((function(t){return t.x>=0&&t.x<=e.dashboard.columns-e.child.width&&t.y>=0})),o.distinctUntilChanged((function(e,t){return e.x===t.x&&e.y===t.y})),this.arrangePipe())},enumerable:!0,configurable:!0}),e.prototype.findFreeDimension=function(){var e=-1,t=0,n=!1,a=this.child,o=a.width,s=a.height;if(o>this.dashboard.columns)throw new Error("The child does not fit on the current dashboard.");do{for(t=0,e++;t+o<=this.dashboard.columns;){if(0===this.getCollided({x:t,y:e,width:o,height:s}).length){n=!0;break}t++}}while(!n);return{x:t,y:e,width:o,height:s}},e.prototype.collapseUpAll=function(){return s.sortBy(Oc([this.child],this.children),["y"]).forEach((function(t){var n=new e(t),a=n.collapseUp(t);n.setDimension(a)}))},e.prototype.arrangeAll=function(t){var n=t.current,a=t.scan,o=t.spacing,r=t.origin;return this.getCollided(n,s.sortBy(a,["y"])).map((function(t){return new e(t).setDimension(bc({},t,{y:o})),{current:t,scan:a.filter((function(e){return e!==t})),spacing:t.y+t.height,origin:r}}))},e.prototype.arrangePipe=function(){var e=this;return a.pipe(o.map((function(t){return{current:t,scan:e.children,spacing:t.y+t.height,origin:bc({},t)}})),o.expand((function(t){return e.arrangeAll(t)})),o.map((function(e){return e.origin})),o.map((function(t){return e.setDimension(t,!0)})),o.tap((function(){return e.collapseUpAll()})),o.tap((function(){return e.dashboard.getLastRow()})))},e.prototype.collapseUp=function(e){for(var t=e.y;t>0&&0===this.getCollided(bc({},e,{y:t-1})).length;)t--;return bc({},e,{y:t})},e.prototype.setDimension=function(e,t){if(void 0===t&&(t=!1),!(t&&this.getCollided(e).length>0))return this.child.x=e.x,this.child.y=e.y,e.width>=this.MIN_WIDTH&&e.x+e.width<=this.dashboard.columns?this.child.width=e.width:e.width<this.MIN_WIDTH?e.width=this.MIN_WIDTH:e.width=this.dashboard.columns-e.x,e.height>=this.MIN_HEIGHT?this.child.height=e.height:e.height=this.MIN_WIDTH,e},e.prototype.setPixelSize=function(e){var t=e.width,n=e.height;t>=this.dashboard.columnSize*this.MIN_WIDTH-this.dashboard.gap&&(this.child.pxWidth=t+this.PIXEL_SIZE_THRESHOLD),n>=this.dashboard.rowSize*this.MIN_HEIGHT-this.dashboard.gap&&(this.child.pxHeight=n+this.PIXEL_SIZE_THRESHOLD)},e.prototype.getPixelSize=function(e){var t=e.source.element.nativeElement.parentNode;if(!this.diffX){var n=t.getBoundingClientRect();this.diffX=n.left,this.diffY=n.top}var a=e.pointerPosition,o=a.x,s=a.y;return{width:Math.round(o-this.diffX),height:Math.round(s-this.diffY),pointer:{x:o,y:s}}},e.prototype.getDimensionSize=function(e){var t=this.child,n=t.x,a=t.y,o=this.dashboard.dashboardRect,s=this.dashboard.columnSize,r=this.dashboard.rowSize+this.dashboard.gap;return{x:n,y:a,width:Math.round((e.pointer.x-o.left+this.dashboard.gap)/s)-n,height:Math.round((e.pointer.y-o.top+this.dashboard.gap)/r)-a}},e.prototype.getDimensionPosition=function(e){var t=e.source.element.nativeElement.nextElementSibling;if(!this.diffX){var n=t.getBoundingClientRect();this.diffX=e.pointerPosition.x-n.left,this.diffY=e.pointerPosition.y-n.top}var a=e.pointerPosition.x-this.diffX,o=e.pointerPosition.y-this.diffY,s=this.child,r=s.width,l=s.height,i=this.dashboard.dashboardRect,c=this.dashboard.columnSize,u=this.dashboard.rowSize+this.dashboard.gap/2;return{x:Math.round((a-i.left)/c),y:Math.round((o-i.top)/u),width:r,height:l}},e.prototype.doesCollide=function(e,t){return void 0!==t.x&&!(e.y+e.height-1<t.y||e.y>t.y+t.height-1||e.x+e.width-1<t.x||e.x>t.x+t.width-1)},e.prototype.getCollided=function(e,t){var n=this;return void 0===t&&(t=this.children),t.filter((function(t){return n.doesCollide(e,t)}))},e}(),ch=function(){function e(e,n,a){this.dashboard=e,this.sanitizer=n,this.element=a,this.actions=[],this.isResize=!1,this.isDragging=!1,this.klasses={},this._pxWidth="100%",this._pxHeight="100%",this.width=1,this.height=1,this.margin=12,this.isFrozen=!1,this.useIntersection=!1,this.changeStart=new t.EventEmitter,this.changeEnd=new t.EventEmitter,this.class={},this.intersected=!1}return Object.defineProperty(e.prototype,"pxWidth",{set:function(e){this._pxWidth=e+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pxHeight",{set:function(e){this._pxHeight=e+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inlineStyle",{get:function(){return this.sanitizer.bypassSecurityTrustStyle("\n grid-column-start: "+(this.x+1)+";\n -ms-grid-column: "+(this.x+1)+";\n grid-row-start: "+(this.y+1)+";\n -ms-grid-row: "+(this.y+1)+";\n grid-column-end: span "+this.width+";\n -ms-grid-column-span: "+this.width+";\n grid-row-end: span "+this.height+";\n -ms-grid-row-span: "+this.height+";\n display: block;\n margin: "+(this.margin||12)+"px;\n order: "+this.getOrder()+";\n ")},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){this.klasses=bc({card:!0,"card-dashboard":!0,disabled:this.isFrozen,"on-resize":this.isResize},this.class)},e.prototype.ngOnInit=function(){var e=this;if(void 0!==this.x&&void 0!==this.y||setTimeout((function(){return e.setDynamicDimension()})),this.useIntersection&&"IntersectionObserver"in window){var t=new IntersectionObserver((function(n){return e.intersected=e.childInView(n[0],t)}));t.observe(this.element.nativeElement)}else this.intersected=!0},e.prototype.setDynamicDimension=function(){var e=new ih(this).findFreeDimension(),t=e.x,n=e.y;this.x=t,this.y=n,this.dashboard.emitChange(this)},e.prototype.resizeStarted=function(e){this.isResize=!0,this.dashboard.updateRectSize(),this.dragSource=e.source;var t=new ih(this);this.changeSubscription=t.resize$.subscribe(),this.changeStart.emit(this),this.ngOnChanges()},e.prototype.dragStarted=function(e){this.isDragging=!0,this.dashboard.updateRectSize(),this.dragSource=e.source;var t=new ih(this);this.changeSubscription=t.drag$.subscribe(),this.changeStart.emit(this)},e.prototype.reset=function(e){this.isResize=!1,this.isDragging=!1,this._pxWidth="100%",this._pxHeight="100%",this.ngOnChanges(),e&&e.source.reset(),this.changeSubscription&&(this.changeSubscription.unsubscribe(),this.dashboard.emitChange(this),this.changeEnd.emit(this))},e.prototype.getOrder=function(){return""+Math.round(100*(this.y+(this.x+1)/100))},e.prototype.childInView=function(e,t){return!!e.isIntersecting&&(t.unobserve(e.target),!0)},e.ctorParameters=function(){return[{type:lh,decorators:[{type:t.Inject,args:[t.forwardRef((function(){return lh}))]}]},{type:pc.DomSanitizer},{type:t.ElementRef}]},jc([t.ContentChildren(sh)],e.prototype,"actions",void 0),jc([t.Input()],e.prototype,"x",void 0),jc([t.Input()],e.prototype,"y",void 0),jc([t.Input()],e.prototype,"width",void 0),jc([t.Input()],e.prototype,"height",void 0),jc([t.Input()],e.prototype,"data",void 0),jc([t.Input()],e.prototype,"margin",void 0),jc([t.Input()],e.prototype,"isFrozen",void 0),jc([t.Input()],e.prototype,"useIntersection",void 0),jc([t.Output()],e.prototype,"changeStart",void 0),jc([t.Output()],e.prototype,"changeEnd",void 0),jc([t.Input()],e.prototype,"class",void 0),jc([t.HostBinding("attr.style")],e.prototype,"inlineStyle",null),e=jc([t.Component({selector:"c8y-dashboard-child",template:'<div cdkDropList>\n <div *ngIf="isResize" class="card-placeholder"></div>\n <div\n [ngClass]="klasses"\n cdkDrag\n [ngStyle]="{ width: _pxWidth, height: _pxHeight }"\n (cdkDragStarted)="dragStarted($event)"\n (cdkDragEnded)="reset($event)"\n [cdkDragDisabled]="isFrozen"\n >\n <div\n class="card-header-actions card-header-grid"\n [ngClass]="{ \'drag-handle\': !isFrozen, draggableCursor: !isFrozen }"\n cdkDragHandle\n >\n <ng-content select="c8y-dashboard-child-title"></ng-content>\n <div class="header-actions" *ngIf="!isFrozen && actions.length > 0">\n <div class="optionsBtn dropdown" dropdown container="body">\n <a\n title="{{ \'Settings\' | translate }}"\n href=""\n class="btnIcon c8y-dropdown"\n (click)="(false)"\n dropdownToggle\n >\n <i [c8yIcon]="\'cog\'"></i>\n </a>\n <ul\n class="dropdown-menu dropdown-menu-right"\n style="right: -41px;top: 3px;"\n *dropdownMenu\n >\n <ng-container *ngFor="let action of actions">\n <ng-container *ngTemplateOutlet="action.template"></ng-container>\n </ng-container>\n </ul>\n </div>\n </div>\n </div>\n <div class="card-inner-scroll">\n <ng-content></ng-content>\n </div>\n <div\n *ngIf="!isFrozen && !isDragging"\n class="resize-handle"\n cdkDrag\n [cdkDragDisabled]="isFrozen"\n (cdkDragStarted)="resizeStarted($event)"\n (cdkDragEnded)="reset($event)"\n ></div>\n <div class="resize-icon" *ngIf="!isFrozen && !isDragging"></div>\n\n <div *cdkDragPlaceholder class="card-placeholder"></div>\n </div>\n</div>\n',host:{class:"dashboard-grid-child"}}),wc(0,t.Inject(t.forwardRef((function(){return lh}))))],e)}(),uh=function(){function e(){this.settings={isFrozen:!1,isDisabled:!1,widgetMargin:12,translateWidgetTitle:!1,defaultHeight:4,defaultWidth:4,allowFullscreen:!1,canDelete:!0,isLoading:!1},this.onAddWidget=new t.EventEmitter,this.onEditWidget=new t.EventEmitter,this.onDeleteWidget=new t.EventEmitter,this.onChangeDashboard=new t.EventEmitter,this.onEditDashboard=new t.EventEmitter,this.onDeleteDashboard=new t.EventEmitter,this.onFreeze=new t.EventEmitter,this.onChangeStart=new t.EventEmitter,this.onChangeEnd=new t.EventEmitter}return Object.defineProperty(e.prototype,"_settings",{set:function(e){this.settings=bc({},this.settings,e)},enumerable:!0,configurable:!0}),e.prototype.toggleFullscreen=function(){var e=document.body,t=document;this.fullScreen()?t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.webkitExitFullscreen&&t.webkitExitFullscreen():e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)},e.prototype.fullScreen=function(){var e=document;return!!(e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement)},jc([t.Input()],e.prototype,"widgets",void 0),jc([t.Input()],e.prototype,"context",void 0),jc([t.Input()],e.prototype,"contextDashboard",void 0),jc([t.Input("settings")],e.prototype,"_settings",null),jc([t.Input()],e.prototype,"breadcrumb",void 0),jc([t.Output()],e.prototype,"onAddWidget",void 0),jc([t.Output()],e.prototype,"onEditWidget",void 0),jc([t.Output()],e.prototype,"onDeleteWidget",void 0),jc([t.Output()],e.prototype,"onChangeDashboard",void 0),jc([t.Output()],e.prototype,"onEditDashboard",void 0),jc([t.Output()],e.prototype,"onDeleteDashboard",void 0),jc([t.Output()],e.prototype,"onFreeze",void 0),jc([t.Output()],e.prototype,"onChangeStart",void 0),jc([t.Output()],e.prototype,"onChangeEnd",void 0),e=jc([t.Component({selector:"c8y-widgets-dashboard",template:'<c8y-title *ngIf="!!settings.title">\n {{ settings.title | translate }}\n</c8y-title>\n\n<c8y-breadcrumb *ngIf="!!breadcrumb">\n <c8y-breadcrumb-item\n [icon]="breadcrumb.icon"\n [label]="breadcrumb.label"\n [path]="breadcrumb.path"\n ></c8y-breadcrumb-item>\n</c8y-breadcrumb>\n\n<c8y-action-bar-item [placement]="\'right\'" *ngIf="onAddWidget.observers.length">\n <button\n class="btn btn-link"\n [disabled]="settings.isFrozen || settings.isDisabled"\n (click)="onAddWidget.emit()"\n >\n <i c8yIcon="plus-circle"></i> {{ \'Add widget\' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]="\'right\'" *ngIf="onEditDashboard.observers.length">\n <button\n class="btn btn-link"\n [disabled]="settings.isFrozen || settings.isDisabled"\n (click)="onEditDashboard.emit()"\n >\n <i c8yIcon="pencil"></i> {{ \'Edit\' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]="\'right\'" *ngIf="settings.allowFullscreen">\n <button class="btn btn-link" (click)="toggleFullscreen()">\n <i [c8yIcon]="fullScreen() ? \'compress\' : \'expand\'"></i> {{ \'Full screen\' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]="\'right\'"\n itemClass="navbar-form"\n *ngIf="onFreeze.observers.length"\n>\n <button\n title="{{ \'Lock/unlock this dashboard\' | translate }}"\n class="btn btn-default"\n [ngClass]="{ active: settings.isFrozen }"\n (click)="onFreeze.emit(settings)"\n [disabled]="settings.isDisabled"\n uib-btn-checkbox\n >\n <i [c8yIcon]="settings.isFrozen ? \'lock\' : \'unlock\'"></i>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]="\'more\'"\n [priority]="-3000"\n *ngIf="settings.canDelete && onDeleteDashboard.observers.length"\n>\n <button (click)="onDeleteDashboard.emit()" [disabled]="settings.isFrozen || settings.isDisabled">\n <i c8yIcon="trash"></i>&nbsp;<span translate>Delete dashboard</span>\n </button>\n</c8y-action-bar-item>\n\n\x3c!-- empty state --\x3e\n<div class="c8y-empty-state text-center" *ngIf="!settings.isLoading && widgets.length === 0">\n <h1 class="c8y-icon c8y-icon-device c8y-icon-duocolor"></h1>\n <h3 translate>No widgets to display.</h3>\n <div *ngIf="!settings.isFrozen && onAddWidget.observers.length">\n <p translate>Add widgets to this dashboard.</p>\n <div>\n <button\n [disabled]="settings.isFrozen || settings.isDisabled"\n (click)="onAddWidget.emit()"\n class="btn btn-primary"\n translate\n >\n Add widget\n </button>\n </div>\n <p c8y-guide-docs>\n <small translate ngNonBindable\n >Find out more in the\n <a c8y-guide-href="users-guide/cockpit/#dashboards">User guide`KEEP_ORIGINAL`</a>.</small\n >\n </p>\n </div>\n</div>\n\x3c!-- /.empty settings --\x3e\n\n<div class="col-xs-12 text-center" *ngIf="settings.isLoading">\n <div class="spinner p-relative">\n <div class="rect1"></div>\n <div class="rect2"></div>\n <div class="rect3"></div>\n <div class="rect4"></div>\n <div class="rect5"></div>\n </div>\n</div>\n\n<c8y-dashboard\n (dashboardChange)="onChangeDashboard.emit($event)"\n #dashboard\n *ngIf="!settings.isLoading"\n>\n <c8y-dashboard-child\n *ngFor="let widget of widgets"\n [x]="widget._x"\n [y]="widget._y"\n [width]="widget._width || settings.defaultWidth"\n [height]="widget._height || settings.defaultHeight"\n [margin]="settings.widgetMargin"\n [isFrozen]="settings.isFrozen || settings.isDisabled"\n [class]="widget.classes"\n [data]="widget"\n [useIntersection]="true"\n (changeStart)="onChangeStart.emit({ widget: widget, source: child, dashboard: dashboard })"\n (changeEnd)="onChangeEnd.emit({ widget: widget, source: child, dashboard: dashboard })"\n #child\n >\n <c8y-dashboard-child-title>\n <span *ngIf="settings.translateWidgetTitle"> {{ widget.title | translate }}</span>\n <span *ngIf="!settings.translateWidgetTitle">\n {{ widget.title }}\n </span>\n </c8y-dashboard-child-title>\n <c8y-dashboard-child-action *ngIf="onEditWidget.observers.length">\n <button (click)="onEditWidget.emit({ widget: widget, source: child, dashboard: dashboard })">\n <i c8yIcon="pencil"></i>&nbsp;<span translate>Edit</span>\n </button>\n </c8y-dashboard-child-action>\n <c8y-dashboard-child-action *ngIf="onDeleteWidget.observers.length">\n <button\n (click)="onDeleteWidget.emit({ widget: widget, source: child, dashboard: dashboard })"\n >\n <i c8yIcon="trash"></i>&nbsp;<span translate>Remove</span>\n </button>\n </c8y-dashboard-child-action>\n <c8y-dynamic-component\n [componentId]="widget.componentId || widget.name"\n [config]="\n widget.templateUrl || widget.widgetComponent\n ? { child: widget, dashboard: contextDashboard, context: context }\n : widget.config\n "\n *ngIf="child.intersected"\n ></c8y-dynamic-component>\n </c8y-dashboard-child>\n</c8y-dashboard>\n',host:{style:"\n display: block;\n ",class:"dashboard c8y-grid-dashboard"}})],e)}(),dh=function(){function e(){}return e=jc([t.NgModule({declarations:[ch,lh,rh,sh,uh],imports:[Uu,Gu,oh,dc.DragDropModule,l.BsDropdownModule.forRoot(),Mp,Nm,hd],exports:[lh,ch,rh,sh,uh]})],e)}(),ph=function(){function e(e){this.templateRef=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},jc([t.Input("c8yStepperIcon")],e.prototype,"name",void 0),e=jc([t.Directive({selector:"ng-template[c8yStepperIcon]"})],e)}(),mh=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.disableDefaultIcons={edit:!0,done:!0},n.onStepChange=new t.EventEmitter,n._iconOverrides={},n._stepIndex=new a.Subject,n}var o;return vc(n,e),o=n,n.prototype.ngAfterContentInit=function(){var e=this;this._icons.forEach((function(t){var n=t.name,a=t.templateRef;return e._iconOverrides[n]=a})),this._stepIndexSubscription=this._stepIndex.subscribe((function(t){return e.onStepChange.emit(t)}))},n.prototype.ngOnDestroy=function(){this._stepIndexSubscription&&!this._stepIndexSubscription.closed&&this._stepIndexSubscription.unsubscribe()},n.prototype.getIndicatorType=function(e,t){var n=t;switch(this._getIndicatorType(e,t)){case mc.STEP_STATE.EDIT:this.disableDefaultIcons.edit||(n=mc.STEP_STATE.EDIT);break;case mc.STEP_STATE.DONE:n=this.disableDefaultIcons.done?"_done":mc.STEP_STATE.DONE}return n},n.prototype.setIndex=function(e){this._stepIndex.next(e)},jc([t.Input()],n.prototype,"disableDefaultIcons",void 0),jc([t.Input()],n.prototype,"customClasses",void 0),jc([t.Output()],n.prototype,"onStepChange",void 0),jc([t.ContentChildren(ph,{descendants:!0})],n.prototype,"_icons",void 0),n=o=jc([t.Component({selector:"c8y-stepper",template:'<ul class="c8y-stepper" [ngClass]="customClasses">\n <li *ngFor="let step of steps; let i = index">\n <c8y-stepper-progress\n [iconOverrides]="_iconOverrides"\n [state]="getIndicatorType(i, step.state)"\n [index]="i"\n [selected]="selectedIndex === i"\n (onStepClicked)="setIndex($event)"\n title="{{ step.label | translate }}"\n [ngClass]="{\'active\': selectedIndex === i}"\n >\n </c8y-stepper-progress>\n <div class="c8y-step__label" title="{{ step.label | translate }}">\n {{ step.label | translate }}\n </div>\n </li>\n</ul>\n<ng-container [ngTemplateOutlet]="selected.content"></ng-container>\n',providers:[{provide:mc.CdkStepper,useExisting:o}]})],n)}(mc.CdkStepper),hh=function(){function e(){this.onStepClicked=new t.EventEmitter}return e.prototype.stepSelected=function(){this.onStepClicked.emit(this.index)},jc([t.Input()],e.prototype,"iconOverrides",void 0),jc([t.Input()],e.prototype,"index",void 0),jc([t.Input()],e.prototype,"selected",void 0),jc([t.Input()],e.prototype,"state",void 0),jc([t.Output()],e.prototype,"onStepClicked",void 0),e=jc([t.Component({selector:"c8y-stepper-progress",template:'<button\n type="button"\n class="c8y-step"\n [ngClass]="{ active: selected, \'step-done\': state === \'done\' || state === \'_done\' }"\n [ngSwitch]="!!(iconOverrides && iconOverrides[state])"\n (click)="stepSelected()"\n>\n <ng-container *ngSwitchCase="true" [ngTemplateOutlet]="iconOverrides[state]"></ng-container>\n <ng-container *ngSwitchDefault [ngSwitch]="state">\n <span *ngSwitchCase="\'edit\'">\n <span [c8yIcon]="\'edit\'"></span>\n </span>\n <span *ngSwitchCase="\'done\'">\n <span [c8yIcon]="\'check\'"></span>\n </span>\n <span *ngSwitchDefault> {{ index + 1 }} </span>\n </ng-container>\n</button>\n'})],e)}(),fh=function(){function e(e,n){this.stepper=e,this.step=n,this.pending=!1,this.disabled=!1,this.onCancel=new t.EventEmitter,this.onNext=new t.EventEmitter,this.onBack=new t.EventEmitter,this.onCustom=new t.EventEmitter,this.showBtns={cancel:!1,back:!1,next:!1,custom:!1}}return e.prototype.ngAfterContentInit=function(){var e=this;this.showBtns.cancel=this.onCancel.observers.length>0,this.showBtns.custom=this.onCustom.observers.length>0,this.stepper&&this.stepper.steps&&this.step&&(this.showBtns.back=this.stepper.steps.first!==this.step,this.showBtns.next=this.stepper.steps.last!==this.step),this.step&&this.step.stepControl&&(this.disabled=this.step.stepControl.invalid,this.statusChangeSubscription=this.step.stepControl.statusChanges.subscribe((function(t){e.disabled=e.step.stepControl.invalid})))},e.prototype.ngOnChanges=function(e){e&&e.pending&&(this.disabled=e.pending.currentValue)},e.prototype.ngOnDestroy=function(){this.statusChangeSubscription&&!this.statusChangeSubscription.closed&&this.statusChangeSubscription.unsubscribe()},e.prototype.cancel=function(){this.onCancel.emit()},e.prototype.next=function(){this.onNext.observers.length>0?this.onNext.emit({stepper:this.stepper,step:this.step}):this.stepper.next()},e.prototype.back=function(){this.stepper.selected.completed=!1,this.onBack.observers.length>0?this.onBack.emit({stepper:this.stepper,step:this.step}):this.stepper.previous()},e.prototype.custom=function(){this.onCustom.emit()},e.ctorParameters=function(){return[{type:mh,decorators:[{type:t.Host}]},{type:mc.CdkStep,decorators:[{type:t.Host}]}]},jc([t.Input()],e.prototype,"labels",void 0),jc([t.Input()],e.prototype,"pending",void 0),jc([t.Input()],e.prototype,"disabled",void 0),jc([t.Output()],e.prototype,"onCancel",void 0),jc([t.Output()],e.prototype,"onNext",void 0),jc([t.Output()],e.prototype,"onBack",void 0),jc([t.Output()],e.prototype,"onCustom",void 0),e=jc([t.Component({selector:"c8y-stepper-buttons",template:'<div class="text-center">\n <button *ngIf="showBtns.cancel" (click)="cancel()" type="button" class="btn btn-default">\n <span *ngIf="labels?.cancel; else cancelLabel" title="{{ labels?.cancel | translate }}">{{\n labels?.cancel | translate\n }}</span>\n <ng-template #cancelLabel>\n <span title="{{ \'Cancel\' | translate }}">{{ \'Cancel\' | translate }}</span>\n </ng-template>\n </button>\n <button\n *ngIf="showBtns.back"\n type="button"\n (click)="back()"\n class="btn btn-default"\n [disabled]="pending"\n >\n <span *ngIf="labels?.back; else backLabel" title="{{ labels?.back | translate }}">{{\n labels?.back | translate\n }}</span>\n <ng-template #backLabel>\n <span title="{{ \'Back\' | translate }}">{{ \'Back\' | translate }}</span>\n </ng-template>\n </button>\n <button\n *ngIf="showBtns.custom"\n (click)="custom()"\n type="button"\n class="btn"\n [ngClass]="{\n \'btn-default\': showBtns.next,\n \'btn-primary\': !showBtns.next,\n \'btn-pending\': pending\n }"\n [disabled]="pending || disabled"\n >\n <span *ngIf="labels?.custom; else customLabel" title="{{ labels?.custom | translate }}">{{\n labels?.custom | translate\n }}</span>\n <ng-template #customLabel>\n <span title="{{ \'Complete\' | translate }}">{{ \'Complete\' | translate }}</span>\n </ng-template>\n </button>\n <button\n (click)="next()"\n *ngIf="showBtns.next"\n type="button"\n class="btn btn-primary"\n [ngClass]="{ \'btn-pending\': pending }"\n [disabled]="disabled"\n >\n <span *ngIf="labels?.next; else nextLabel" title="{{ labels?.next | translate }}">{{\n labels?.next | translate\n }}</span>\n <ng-template #nextLabel>\n <span title="{{ \'Next\' | translate }}">{{ \'Next\' | translate }}</span>\n </ng-template>\n </button>\n</div>\n'}),wc(0,t.Host()),wc(1,t.Host())],e)}(),gh={displayDefaultIndicatorType:!1},yh=function(){function e(){}return e=jc([t.NgModule({imports:[Uu,mc.CdkStepperModule,u.TooltipModule],declarations:[mh,ph,hh,fh],exports:[mh,mc.CdkStep,ph,fh],providers:[{provide:mc.STEPPER_GLOBAL_OPTIONS,useValue:gh}]})],e)}(),vh=function(){function e(){this.click=new t.EventEmitter}return jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),jc([t.Input()],e.prototype,"label",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.Output()],e.prototype,"click",void 0),e=jc([t.Component({selector:"c8y-list-item-action, c8y-li-action",template:'<ng-template #template>\n <li>\n <button title="{{ label | translate }}" (click)="click.emit($event)">\n <i [c8yIcon]="icon" *ngIf="icon"></i>&nbsp;\n <span *ngIf="label">{{ label | translate }}</span>\n <ng-content></ng-content>\n </button>\n </li>\n</ng-template>\n'})],e)}(),bh=function(){function e(){this.collapseWay="button"}return jc([t.Input()],e.prototype,"collapseWay",void 0),e=jc([t.Component({selector:"c8y-list-item-collapse, c8y-li-collapse",template:"<ng-content></ng-content>\n"})],e)}(),jh=function(){function e(){}return jc([t.Input()],e.prototype,"footer",void 0),e=jc([t.Component({selector:"c8y-list-item-footer, c8y-li-footer",template:'<span *ngIf="footer">{{footer}}</span>\n<ng-content></ng-content>\n'})],e)}(),wh=function(){function e(e){this.element=e,this.active=!1,this.collapsed=!0,this.selectable=!0,this.collapsedChange=new t.EventEmitter,this.showFooter=!1,this.showActions=!1,this.showCollapse=!1,this.dropdownUp=!1,this.pulse$=new a.Subject,this.destroy$=new a.Subject,this.ACTION_ITEM_HEIGHT=40}return e.prototype.ngOnInit=function(){var e=this;this.pulse$.pipe(o.filter((function(e){return!!e})),o.tap((function(){return e.element.nativeElement.classList.remove("c8y-list--pulse")})),o.delay(100),o.tap((function(){return e.element.nativeElement.classList.add("c8y-list--pulse")})),o.takeUntil(this.destroy$)).subscribe()},e.prototype.ngAfterContentChecked=function(){this.actions=this.itemActions.toArray(),this.showFooter=null!=this.itemFooter,this.showActions=this.itemActions.length>0,this.showCollapse=null!=this.itemCollapse},e.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},e.prototype.showDropdownUp=function(){var e=this.element.nativeElement.getBoundingClientRect().top+(1+this.itemActions.length)*this.ACTION_ITEM_HEIGHT<=window.innerHeight;this.dropdownUp=!e},e.prototype.toggleCollapsed=function(e){e&&e.stopPropagation(),this.collapsed=!this.collapsed,this.collapsedChange.emit(this.collapsed)},e.prototype.pulse=function(){this.pulse$.next(!0)},e.ctorParameters=function(){return[{type:t.ElementRef}]},jc([t.Input(),t.HostBinding("class.active")],e.prototype,"active",void 0),jc([t.Input()],e.prototype,"collapsed",void 0),jc([t.Input()],e.prototype,"selectable",void 0),jc([t.Output()],e.prototype,"collapsedChange",void 0),jc([t.ContentChild(jh,{static:!1})],e.prototype,"itemFooter",void 0),jc([t.ContentChildren(vh)],e.prototype,"itemActions",void 0),jc([t.ContentChild(bh,{static:!1})],e.prototype,"itemCollapse",void 0),e=jc([t.Component({selector:"c8y-list-item, c8y-li",template:'<div [ngClass]="{ \'expanded\': !collapsed, interact: (itemCollapse && itemCollapse.collapseWay === \'row\')}">\n <div class="c8y-list__item__block">\n <ng-content select="c8y-list-item-radio, c8y-li-radio"></ng-content>\n <ng-content select="c8y-list-item-checkbox, c8y-li-checkbox"></ng-content>\n\n <ng-content select="c8y-list-item-icon, c8y-li-icon"></ng-content>\n\n <div class="c8y-list__item__body text-truncate-wrap" (click)="(itemCollapse && itemCollapse.collapseWay === \'row\') && toggleCollapsed()">\n <ng-content select="c8y-list-item-body, c8y-li-body"></ng-content>\n <ng-content></ng-content>\n <div class="c8y-list__item__footer" *ngIf="showFooter">\n <ng-content select="c8y-list-item-footer, c8y-li-footer"></ng-content>\n </div>\n </div>\n\n <div class="c8y-list__item__actions" *ngIf="(showCollapse && (itemCollapse && itemCollapse.collapseWay === \'button\')) || showActions">\n <button\n class="collapse-btn"\n title="{{ \'Expand\' | translate }}"\n type="button"\n (click)="toggleCollapsed($event)"\n [attr.aria-expanded]="!collapsed"\n *ngIf="showCollapse && itemCollapse.collapseWay === \'button\'"\n >\n <i [c8yIcon]="\'chevron-down\'"></i>\n </button>\n <div\n class="dropdown"\n dropdown\n [dropup]="dropdownUp"\n *ngIf="showActions"\n (onShown)="showDropdownUp()"\n >\n <button\n class="dropdown-toggle c8y-dropdown"\n dropdownToggle\n title="{{ \'Actions\' | translate }}"\n type="button"\n aria-haspopup="true"\n >\n <i [c8yIcon]="\'ellipsis-v\'"></i>\n </button>\n <ul class="dropdown-menu dropdown-menu-right" *dropdownMenu>\n <ng-content select="c8y-list-item-action, c8y-li-action"></ng-content>\n <ng-container *ngFor="let action of actions">\n <ng-container *ngTemplateOutlet="action.template"></ng-container>\n </ng-container>\n </ul>\n </div>\n\n <ng-content select="c8y-list-item-action, c8y-li-action" *ngIf="showActions"></ng-content>\n </div>\n </div>\n\n <div *ngIf="showCollapse" [collapse]="collapsed" [isAnimated]="true">\n <div class="c8y-list__item__collapse--container">\n <ng-content select="c8y-list-item-collapse, c8y-li-collapse"></ng-content>\n </div>\n </div>\n</div>\n',host:{class:"c8y-list__item"}})],e)}(),Sh=function(){function e(){}return jc([t.Input()],e.prototype,"body",void 0),e=jc([t.Component({selector:"c8y-list-item-body, c8y-li-body",template:'<span *ngIf="body">{{body}}</span>\n<ng-content></ng-content>\n'})],e)}(),Ch=function(){function e(){this.selected=!1,this.name="list_item_radio",this.disabled=!1,this.onSelect=new t.EventEmitter}var n;return n=e,e.prototype.reset=function(){this.radio.nativeElement.checked=!1},e.prototype.ngOnChanges=function(e){e.selected&&!e.selected.firstChange&&this.onSelect.emit(e.selected.currentValue)},e.prototype.change=function(e){this.onSelect.emit(e),this.model=this.value,this.onChange&&this.onChange(this.model),this.onTouched&&this.onTouched()},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.writeValue=function(e){this.model=e},jc([t.ViewChild("radio",{static:!0})],e.prototype,"radio",void 0),jc([t.Input()],e.prototype,"selected",void 0),jc([t.Input()],e.prototype,"name",void 0),jc([t.Input()],e.prototype,"disabled",void 0),jc([t.Output()],e.prototype,"onSelect",void 0),jc([t.Input()],e.prototype,"value",void 0),e=n=jc([t.Component({selector:"c8y-list-item-radio, c8y-li-radio",template:'<label class="c8y-radio">\n <input\n #radio\n type="radio"\n [name]="name"\n [checked]="selected"\n (change)="change($event.target.checked); (false)"\n [disabled]="disabled"\n />\n <span></span>\n</label>\n<ng-content></ng-content>\n',host:{class:"c8y-list__item__radio"},providers:[{provide:nc.NG_VALUE_ACCESSOR,multi:!0,useExisting:t.forwardRef((function(){return n}))}]})],e)}(),Ih=function(){function e(){}return e=jc([t.Component({selector:"c8y-list-item-timeline, c8y-li-timeline",template:'<small class="c8y-list--timeline__item__date">\n <ng-content></ng-content>\n</small>\n<ng-content select="c8y-li, c8y-list-item"></ng-content>\n',host:{class:"c8y-list--timeline__item"}})],e)}(),Ph=function(){function e(){this.timeline=!1}return e.prototype.ngAfterContentChecked=function(){this.timeline=!!this.timelineComponent},jc([t.HostBinding("class.c8y-list--timeline")],e.prototype,"timeline",void 0),jc([t.ContentChild(Ih,{static:!1})],e.prototype,"timelineComponent",void 0),e=jc([t.Component({selector:"c8y-list-group",template:"<ng-content></ng-content>\n\n",host:{class:"c8y-list__group"}})],e)}(),Oh=function(){function e(){}return jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"status",void 0),e=jc([t.Component({selector:"c8y-list-item-icon, c8y-li-icon",template:'<i [c8yIcon]="icon" [ngClass]="status" *ngIf="icon"></i>\n<ng-content></ng-content>',host:{class:"c8y-list__item__icon"}})],e)}(),xh=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.selected=!1,n.disabled=!1,n.onSelect=new t.EventEmitter,n}var a;return vc(n,e),a=n,n.prototype.ngOnChanges=function(e){e.selected&&!e.selected.firstChange&&this.onSelect.emit(e.selected.currentValue)},n.prototype.select=function(e){this.onSelect.emit(e),this.onChange(e)},jc([t.Input()],n.prototype,"selected",void 0),jc([t.Input()],n.prototype,"disabled",void 0),jc([t.Output()],n.prototype,"onSelect",void 0),n=a=jc([t.Component({selector:"c8y-list-item-checkbox, c8y-li-checkbox",template:'<label class="c8y-checkbox">\n <input\n type="checkbox"\n class="form-control"\n [disabled]="disabled"\n [checked]="selected"\n (change)="select($event.target.checked); (false)"\n />\n <span></span>\n</label>\n<ng-content></ng-content>\n',host:{class:"c8y-list__item__check"},providers:[{provide:nc.NG_VALUE_ACCESSOR,multi:!0,useExisting:t.forwardRef((function(){return a}))}]})],n)}(nc.CheckboxControlValueAccessor),Eh=function(){function e(){}return e=jc([t.NgModule({imports:[Uu,r.CollapseModule.forRoot(),l.BsDropdownModule],declarations:[Ph,wh,Oh,Sh,jh,vh,bh,xh,Ch,Ih],exports:[Ph,wh,Oh,Sh,jh,vh,bh,xh,Ch,Ih]})],e)}(),kh=function(){function e(e){this.audit=e}return e.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return this.source?(e=this,[4,this.audit.list({withTotalPages:!0,source:this.source})]):[3,2];case 1:e.records=t.sent(),t.label=2;case 2:return[2]}}))}))},e.ctorParameters=function(){return[{type:m.AuditService}]},jc([t.Input()],e.prototype,"source",void 0),e=jc([t.Component({selector:"c8y-audit-log",template:'<div class="inner-scroll">\n <ul class="timeline-list list-condensed m-t-16">\n <li class="timeline-list-item flex-row" *c8yFor="let record of records">\n <small class="timeline-item-date text-right">\n <span>{{ record.time | c8yDate }}</span>\n </small>\n <div class="timeline-item-content flex-row">\n <div class="list-item-body">\n <div class="row text-break-word">\n <div class="col-md-5">\n <span class="text-truncate">{{ record.activity | translate }}</span>\n <small class="text-muted">{{ record.user }}</small>\n </div>\n <div class="col-md-7">\n <div class="small text-truncate-wrap">{{ record.text | translate }}</div>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n</div>\n'})],e)}(),Th=function(){function e(){}return e=jc([t.NgModule({declarations:[kh],imports:[Uu],exports:[kh]})],e)}(),Ah=function(){},_h=function(){function e(e){this.template=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},e=jc([t.Directive({selector:"[c8yCellRendererDef]"})],e)}(),Nh=function(){function e(e){this.template=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},e=jc([t.Directive({selector:"[c8yHeaderCellRendererDef]"})],e)}(),Dh=function(){},Lh=function(){function e(e){this.template=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},e=jc([t.Directive({selector:"[c8yFilteringFormRendererDef]"})],e)}(),Mh=function(){function e(){}return jc([t.Input()],e.prototype,"name",void 0),jc([t.ContentChild(_h,{static:!1})],e.prototype,"cellRendererDef",void 0),jc([t.ContentChild(Nh,{static:!1})],e.prototype,"headerCellRendererDef",void 0),jc([t.ContentChild(Lh,{static:!1})],e.prototype,"filteringFormRendererDef",void 0),e=jc([t.Directive({selector:"c8y-column"})],e)}(),Rh={icon:1,numeric:1,"text-short":1.67,"text-long":3.33};(Zm=e.FilteringActionType||(e.FilteringActionType={})).ApplyFilter="APPLY_FILTER",Zm.ResetFilter="RESET_FILTER";var qh=function(){function e(){this.loadingSubject=new a.BehaviorSubject(!0),this.dataSourceSubject=new a.BehaviorSubject([]),this.dataStatsSubject=new a.BehaviorSubject({size:0,filteredSize:0,currentPage:0,currentPageSize:0,firstPageSize:0}),this.dataSelectionSubject=new a.BehaviorSubject({filteredDataIds:[]}),this.resultListSubject=new a.Subject,this.loading$=this.loadingSubject.asObservable(),this.data$=this.dataSourceSubject.asObservable(),this.stats$=this.dataStatsSubject.asObservable(),this.selection$=this.dataSelectionSubject.asObservable(),this.resultList$=this.resultListSubject.asObservable()}return e.prototype.connect=function(e){return this.data$},e.prototype.disconnect=function(e){this.loadingSubject.complete(),this.dataSourceSubject.complete(),this.dataStatsSubject.complete(),this.dataSelectionSubject.complete()},e.prototype.loadData=function(e){var t=this,n=e.rows,r=e.columns,l=e.pagination,i=e.searchText,c=e.serverSideDataCallback,u=e.selectable,d=e.selectionPrimaryKey,p=e.infiniteScroll,m=e.reload,h=void 0!==m&&m,f=this.toObservable(n).pipe(o.map((function(e){var n=0,a=[],o=s.flow((function(e){return t.doClientSideSearch({data:e,columns:r,searchText:i})}),(function(e){return t.doClientSideFiltering({data:e,columns:r})}),(function(e){return t.doClientSideSorting({data:e,columns:r})}),(function(e){return n=e.length,a=u?e.map((function(e){return e[d]})):a,e}),(function(e){return t.doClientSidePagination({data:e,pagination:l})}))(e);return t.dataStatsSubject.next({size:e.length,filteredSize:n,currentPage:l.currentPage,currentPageSize:o.length,firstPageSize:l.pageSize}),t.dataSelectionSubject.next({filteredDataIds:a}),o}))),g=a.defer((function(){return t.toObservable(c({columns:r,searchText:i,pagination:l,selection:{enabled:u,primaryKey:d}}))})).pipe(o.map((function(e){var n=e.data,a=e.paging,o=e.size,s=e.filteredSize,r=e.filteredDataIds;return t.dataStatsSubject.next({size:o,filteredSize:s,currentPage:a.currentPage,currentPageSize:n.length,nextPage:a.nextPage,firstPageSize:a.pageSize}),t.dataSelectionSubject.next({filteredDataIds:r||[]}),t.resultListSubject.next(e),n}))),y="function"==typeof c?g:f;a.of([]).pipe(o.tap((function(){return t.loadingSubject.next(!0)})),o.switchMap((function(){return y})),o.catchError((function(e){return t.dataStatsSubject.next({size:0,filteredSize:0,currentPage:0,currentPageSize:0,firstPageSize:0}),t.dataSelectionSubject.next({filteredDataIds:[]}),a.of([])})),o.finalize((function(){return t.loadingSubject.next(!1)}))).subscribe((function(e){var n=p&&!h?Oc(t.dataSourceSubject.value,e):e;t.dataSourceSubject.next(n)}))},e.prototype.resolveValue=function(e,t){return s.get(e,t)},e.prototype.resolveFunction=function(e){return"function"==typeof e?e():e},e.prototype.normalizeNil=function(e){return s.isNil(e)?"":e},e.prototype.doClientSideFiltering=function(e){var t=this,n=e.data;return e.columns.reduce((function(e,n){var a=n.filterPredicate;return"string"==typeof a?t.doClientSideSearch({data:e,columns:[n],searchText:a}):"function"==typeof a?e.filter((function(e){return a(e,n.path)})):e}),n)},e.prototype.doClientSideSearch=function(e){var t=this,n=e.data,a=e.columns,o=e.searchText,r=a.map((function(e){return e.path})).filter((function(e){return!s.isNil(e)})),l=this.createRegexSearch(o);return n.filter((function(e){var n=s.flow((function(e){return s.pick(e,r)}),(function(e){return s.mapValues(e,t.resolveFunction)}),(function(e){return s.omitBy(e,s.isNil)}))(e);return Object.values(n).some((function(e){return l.test(e.toString())}))}))},e.prototype.doClientSideSorting=function(e){var t=e.data,n=e.columns.filter((function(e){return!!e.sortOrder})),a={paths:n.map((function(e){return e.path})),orders:n.map((function(e){return e.sortOrder}))};return s.orderBy(t,a.paths,a.orders)},e.prototype.doClientSidePagination=function(e){var t=e.data,n=e.pagination;return n?s.get(s.chunk(t,n.pageSize),n.currentPage-1,[]):t},e.prototype.createRegexSearch=function(e){return RegExp(function(e){void 0===e&&(e="");return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"i")},e.prototype.toObservable=function(e){return a.isObservable(e)?e:e instanceof Promise?a.from(e):a.of(e)},e}();var $h,Fh=function(){function n(e,n,o,s){this.sanitizer=e,this.hostRef=n,this.cd=o,this.cfr=s,this.title="Items",this.loadMoreItemsLabel="Load more items",this.loadingItemsLabel="Loading items…",this.showSearch=!1,this.showChildDevices={},this.dataSource=new qh,this.filteringLabelsParams={filteredItemsCount:0,allItemsCount:0},this.paginationLabelParams={pageFirstItemIdx:0,pageLastItemIdx:0,itemsTotal:0},this.possiblePageSizes=[10,15,20,30,50],this.minPossiblePageSize=Math.min.apply(Math,Oc(this.possiblePageSizes)),this.selectable=!1,this.selectionPrimaryKey="id",this.displayOptions={striped:!0,bordered:!1,gridHeader:!0,filter:!0},this.searchText="",this.rowMouseOver=new t.EventEmitter,this.rowMouseLeave=new t.EventEmitter,this.rowClick=new t.EventEmitter,this.onConfigChange=new t.EventEmitter,this.onFilter=new t.EventEmitter,this.itemsSelect=new t.EventEmitter,this.onChildDevices=new t.EventEmitter,this.columnNames=[],this.styles={tableCursor:"auto",gridTemplateColumns:void 0,gridInfiniteScrollColumn:void 0},this.searchText$=new t.EventEmitter,this.filteringApplied=!1,this.totalPagesCount=1/0,this.selectedItemIds=[],this.currentPageSelectionState={allSelected:!1,allDeselected:!0},this.builtInActionType={Edit:"EDIT",Delete:"DELETE",Export:"EXPORT"},this.resizeHandleMouseDown$=new t.EventEmitter,this.resizeHandleContainerMouseMove$=new t.EventEmitter,this.resizeHandleContainerMouseUp$=new t.EventEmitter,this.unsubscribe$=new a.Subject}return Object.defineProperty(n.prototype,"_columns",{set:function(e){this.columns=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_rows",{set:function(e){this.rows=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_pagination",{set:function(e){this.pagination=e;var t=s.get(this.pagination,"pageSize");t&&!this.possiblePageSizes.find((function(e){return e===t}))&&(this.pagination=bc({},this.pagination,{pageSize:10}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_infiniteScroll",{set:function(e){this.infiniteScroll=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_serverSideDataCallback",{set:function(e){this.serverSideDataCallback=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_selectable",{set:function(e){this.selectable=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_selectionPrimaryKey",{set:function(e){this.selectionPrimaryKey=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_displayOptions",{set:function(e){this.displayOptions=bc({},this.displayOptions,e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_actionControls",{set:function(e){this.actionControls=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_bulkActionControls",{set:function(e){this.bulkActionControls=e||[]},enumerable:!0,configurable:!0}),n.prototype.ngOnInit=function(){var e=this;this.searchText$.pipe(o.takeUntil(this.unsubscribe$),o.debounceTime(300),o.distinctUntilChanged(),o.tap((function(t){e.searchText=t}))).subscribe((function(){e.reload()})),this.selectable&&a.combineLatest(this.dataSource.data$,this.itemsSelect.asObservable()).pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(t){var n=Pc(t,1)[0],a=0===n.length;e.currentPageSelectionState={allSelected:!a&&n.every((function(t){return e.isItemSelected(t)})),allDeselected:!!a||n.every((function(t){return!e.isItemSelected(t)}))}})),this.dataSource.stats$.pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(t){e.createLoadMoreComponent(t),e.updateFilteringLabelsParams(t),e.updatePaginationLabelParams(t)})),this.refresh&&this.refresh.pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(){e.cancel(),e.reload()}))},n.prototype.ngOnChanges=function(e){e._actionControls&&!e._actionControls.firstChange||this.loadData(),this.updateColumns()},n.prototype.ngAfterViewInit=function(){this.updateGridColumnsSize(),this.thEls=this.thRefs.toArray().map((function(e){return e.nativeElement})),this.setupResizeHandle()},n.prototype.ngOnDestroy=function(){this.unsubscribe$.next(),this.unsubscribe$.complete()},n.prototype.trackByName=function(e,t){return t.name},n.prototype.resolveCellValue=function(e,t){var n=this;return s.flow([function(e){return n.dataSource.resolveValue(e,t)},this.dataSource.resolveFunction,this.dataSource.normalizeNil])(e)},n.prototype.changeSortOrder=function(e){var t=this.columns.find((function(t){return t.name===e}));if(t){var n=t.sortOrder;n?"asc"===n?this.updateSorting([e],"desc"):this.updateSorting([e],""):this.updateSorting([e],"asc")}},n.prototype.updateSorting=function(e,t){this.columns=this.columns.map((function(n){return e.includes(n.name)?bc({},n,{sortOrder:t}):n})),this.emitConfigChange(),this.reload()},n.prototype.applyFilter=function(t,n,a){this.updateFiltering([t],{type:e.FilteringActionType.ApplyFilter,payload:{filteringModifier:a}}),n.hide(),this.onFilter.emit({columnName:t,dropdown:n,filteringModifier:a})},n.prototype.resetFilter=function(t,n){this.updateFiltering([t],{type:e.FilteringActionType.ResetFilter}),n.hide()},n.prototype.clearFilters=function(){this.updateFiltering(this.columns.map((function(e){return e.name})),{type:e.FilteringActionType.ResetFilter})},n.prototype.updateFiltering=function(t,n){this.columns=this.columns.map((function(a){return t.includes(a.name)?bc({},a,n.type===e.FilteringActionType.ApplyFilter?n.payload.filteringModifier:{filterPredicate:void 0,externalFilterQuery:void 0}):a})),this.updateFilteringApplied(),this.reload()},n.prototype.updateFilteringApplied=function(){this.filteringApplied=this.columns.some(this.isColumnFilteringApplied)},n.prototype.isColumnFilteringApplied=function(e){var t=e.filterable,n=e.filterPredicate,a=e.externalFilterQuery;return!(!t||!n&&!a)},n.prototype.updatePagination=function(e){var t=e.itemsPerPage,n=e.page;this.pagination=bc({},this.pagination,{pageSize:t,currentPage:n}),this.loadData(),this.emitConfigChange()},n.prototype.reload=function(){this.pagination=bc({},this.pagination,{currentPage:1}),this.recreateLoadMoreComponent=!0,this.loadData(!0),this.scrollToTop()},n.prototype.loadNextPage=function(){var e=this;return this.pagination=bc({},this.pagination,{currentPage:this.pagination.nextPage}),this.loadData(),this.dataSource.resultList$.pipe(o.take(1)).toPromise().then((function(t){return bc({},t,{paging:bc({},t.paging,{next:e.loadNextPage.bind(e)})})}))},n.prototype.getCellRendererSpec=function(e){var t=e.value,n=e.row,a=e.columnName;return this._getCellRendererSpec({type:"CELL",value:t,row:n,columnName:a})},n.prototype.getHeaderCellRendererSpec=function(e){var t=e.value,n=e.columnName;return this._getCellRendererSpec({type:"HEADER",value:t,row:void 0,columnName:n})},n.prototype.getFilteringFormRendererSpec=function(e){var t=e.column,n=e.dropdown;return{renderer:s.get(this.getColumnRenderer(t),"filteringFormRendererDef.template")||t.filteringFormRendererComponent,context:{property:t,applyFilter:this.applyFilter.bind(this,t.name,n),resetFilter:this.resetFilter.bind(this,t.name,n)}}},n.prototype.setAllItemsSelected=function(e){var t=this;this.dataSource.selection$.pipe(o.first()).subscribe((function(n){var a=n.filteredDataIds;return t.setItemsSelected(a,e)}))},n.prototype.setAllItemsInCurrentPageSelected=function(e){var t=this;this.dataSource.data$.pipe(o.first()).subscribe((function(n){return t.setItemsSelected(n,e)}))},n.prototype.setItemsSelected=function(e,t){var n=this,a=e.map((function(e){return"object"==typeof e?e[n.selectionPrimaryKey]:e}));this.selectedItemIds=t?s.union(this.selectedItemIds,a):s.without.apply(void 0,Oc([this.selectedItemIds],a)),this.itemsSelect.emit(this.selectedItemIds)},n.prototype.cancel=function(){this.selectedItemIds=[],this.itemsSelect.emit(this.selectedItemIds)},n.prototype.isItemSelected=function(e){return this.selectedItemIds.includes(e[this.selectionPrimaryKey])},n.prototype.onColumnDrop=function(e){var t=e.previousIndex,n=e.currentIndex;if(t!==n){var a=this.columns.splice(t,1);this.columns.splice(n,0,a[0])}this.updateColumnNames(),this.updateGridColumnsSize()},n.prototype.updateGridColumnsSize=function(){this.styles=bc({},this.styles,{gridTemplateColumns:this.sanitizer.bypassSecurityTrustStyle(this.columns.filter((function(e){return e.visible})).map((function(e){return e.gridTrackSize})).join(" ")),gridInfiniteScrollColumn:this.sanitizer.bypassSecurityTrustStyle("1 / span "+this.columns.filter((function(e){return e.visible})).length)}),this.emitConfigChange()},n.prototype.loadChildDevices=function(){this.showChildDevices.value=!this.showChildDevices.value,this.onChildDevices.emit(this.showChildDevices.value)},n.prototype.emitConfigChange=function(){var e=this.columns.map((function(e){return{visible:e.visible,sortOrder:e.sortOrder,name:e.name}}));this.onConfigChange.emit({columns:e,pagination:this.pagination})},n.prototype.updateColumns=function(){var e={gridTrackSize:"minmax(42px, 82px)",sortable:!1,positionFixed:!0},t=Oc([this.selectable?bc({},e,{name:"checkbox"}):void 0],this.columns,[this.actionControls.length>0?bc({},e,{name:"actions"}):void 0]).filter(Boolean).map(this.withColumnDefaults);this.columns=s.uniqBy(t,"name"),this.updateColumnNames(),this.updateGridColumnsSize(),this.updateFilteringApplied()},n.prototype.withColumnDefaults=function(e){var t=e.dataType||"text-short",n=e.headerCSSClassName,a=e.cellCSSClassName;return bc({visible:!0,positionFixed:!1,sortable:!0,sortOrder:"",filterable:!1},e,{dataType:t,gridTrackSize:e.gridTrackSize||"minmax(80px, "+Rh[t]+"fr)",headerCSSClassName:("string"==typeof n?n.split(" "):n)||[],cellCSSClassName:("string"==typeof a?a.split(" "):a)||[]})},n.prototype.updateColumnNames=function(){this.columnNames=this.columns.map((function(e){return e.name}))},n.prototype.setupResizeHandle=function(){var e=this;this.resizeHandleMouseDown$.pipe(o.takeUntil(this.unsubscribe$),o.tap((function(){return e.clearMouseHighlights()})),o.mergeMap((function(t){var n=t.event,a=t.targetColumnName;return e.columns=e.columns.map((function(e){return e.name===a?bc({},e,{headerCSSClassName:s.union(e.headerCSSClassName,["header--being-resized"])}):e})),e.headerBeingResized={columnName:a,el:n.target.parentNode},e.styles=bc({},e.styles,{tableCursor:"col-resize"}),e.resizeHandleContainerMouseMove$.pipe(o.tap((function(){return e.clearMouseHighlights()})),o.takeUntil(e.resizeHandleContainerMouseUp$))}))).subscribe((function(t){requestAnimationFrame((function(){e.columns=e.columns.map((function(n,a){if(n.name===e.headerBeingResized.columnName){var o=e.hostRef.nativeElement,r=o.getBoundingClientRect().left,l=o.scrollLeft-r+t.clientX-(e.headerBeingResized.el.offsetLeft||0);return bc({},n,{gridTrackSize:Math.max(80,l)+"px"})}return n.gridTrackSize.startsWith("minmax")?bc({},n,{gridTrackSize:s.parseInt(e.thEls[a].clientWidth)+"px"}):n})),e.updateGridColumnsSize()}))})),this.resizeHandleContainerMouseUp$.pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(){e.headerBeingResized&&(e.columns=e.columns.map((function(t){return t.name===e.headerBeingResized.columnName?bc({},t,{headerCSSClassName:s.without(t.headerCSSClassName,"header--being-resized")}):t})),e.headerBeingResized=void 0,e.styles=bc({},e.styles,{tableCursor:"auto"}))}))},n.prototype.clearMouseHighlights=function(){window.getSelection&&window.getSelection().removeAllRanges()},n.prototype._getCellRendererSpec=function(e){var t=e.type,n=e.value,a=e.row,o=e.columnName,r=this.columns.find((function(e){return e.name===o})),l=this.getColumnRenderer(r),i=s.get(l,("HEADER"===t?"headerCellRendererDef":"cellRendererDef")+".template"),c=r.cellRendererComponent,u=r.headerCellRendererComponent;return{renderer:i||("HEADER"===t?u:c),context:{value:n,item:a,property:r}}},n.prototype.getColumnRenderer=function(e){return this.columnRenderers.toArray().find((function(t){return t.name===e.name}))},n.prototype.loadData=function(e){void 0===e&&(e=!1);var t=this,n=t.rows,a=t.columns,o=t.pagination,s=t.searchText,r=t.serverSideDataCallback,l=t.selectable,i=t.selectionPrimaryKey,c=t.infiniteScroll;this.dataSource.loadData({rows:n,columns:a,pagination:o,searchText:s,serverSideDataCallback:r,selectable:l,selectionPrimaryKey:i,infiniteScroll:c,reload:e})},n.prototype.updateFilteringLabelsParams=function(e){this.filteringLabelsParams={filteredItemsCount:e.filteredSize,allItemsCount:e.size}},n.prototype.updatePaginationLabelParams=function(e){this.pagination.nextPage=e.nextPage;var t=(e.currentPage-1)*e.firstPageSize+1;this.paginationLabelParams={pageFirstItemIdx:t,pageLastItemIdx:t+(e.currentPageSize-1),itemsTotal:e.filteredSize}},n.prototype.createLoadMoreComponent=function(e){if(this.infiniteScroll&&e&&e.nextPage&&(!this.loadMoreComponent||this.recreateLoadMoreComponent)){this.recreateLoadMoreComponent=!1,this.infiniteScrollContainer.clear();var t=this.cfr.resolveComponentFactory(fu),n=this.infiniteScrollContainer.createComponent(t).instance;n.useIntersection="auto"===this.infiniteScroll||"hidden"===this.infiniteScroll,n.hidden="hidden"===this.infiniteScroll,n.paging={nextPage:e.nextPage,next:this.loadNextPage.bind(this)},n.loadNextLabel=this.loadMoreItemsLabel,n.loadingLabel=this.loadingItemsLabel,this.loadMoreComponent=n}else this.loadMoreComponent&&!e.nextPage&&(this.loadMoreComponent.paging={nextPage:null})},n.prototype.scrollToTop=function(){this.infiniteScroll&&(this.scrollContainer.nativeElement.scrollTop=0)},n.ctorParameters=function(){return[{type:pc.DomSanitizer},{type:t.ElementRef},{type:t.ChangeDetectorRef},{type:t.ComponentFactoryResolver}]},jc([t.Input()],n.prototype,"title",void 0),jc([t.Input()],n.prototype,"loadMoreItemsLabel",void 0),jc([t.Input()],n.prototype,"loadingItemsLabel",void 0),jc([t.Input()],n.prototype,"showSearch",void 0),jc([t.Input()],n.prototype,"refresh",void 0),jc([t.Input()],n.prototype,"showChildDevices",void 0),jc([t.Input("columns")],n.prototype,"_columns",null),jc([t.Input("rows")],n.prototype,"_rows",null),jc([t.Input("pagination")],n.prototype,"_pagination",null),jc([t.Input("infiniteScroll")],n.prototype,"_infiniteScroll",null),jc([t.Input("serverSideDataCallback")],n.prototype,"_serverSideDataCallback",null),jc([t.Input("selectable")],n.prototype,"_selectable",null),jc([t.Input("selectionPrimaryKey")],n.prototype,"_selectionPrimaryKey",null),jc([t.Input("displayOptions")],n.prototype,"_displayOptions",null),jc([t.Input("actionControls")],n.prototype,"_actionControls",null),jc([t.Input("bulkActionControls")],n.prototype,"_bulkActionControls",null),jc([t.Input()],n.prototype,"searchText",void 0),jc([t.Input()],n.prototype,"itemsSelectLimit",void 0),jc([t.Output()],n.prototype,"rowMouseOver",void 0),jc([t.Output()],n.prototype,"rowMouseLeave",void 0),jc([t.Output()],n.prototype,"rowClick",void 0),jc([t.Output()],n.prototype,"onConfigChange",void 0),jc([t.Output()],n.prototype,"onFilter",void 0),jc([t.Output()],n.prototype,"itemsSelect",void 0),jc([t.Output()],n.prototype,"onChildDevices",void 0),jc([t.ContentChildren(Mh)],n.prototype,"columnRenderers",void 0),jc([t.ViewChild("scroll",{static:!0})],n.prototype,"scrollContainer",void 0),jc([t.ViewChild("infiniteScrollContainer",{static:!1,read:t.ViewContainerRef})],n.prototype,"infiniteScrollContainer",void 0),jc([t.ViewChildren(hc.CdkHeaderCell,{read:t.ElementRef})],n.prototype,"thRefs",void 0),jc([Fc(500,{trailing:!0,leading:!1})],n.prototype,"loadData",null),n=jc([t.Component({selector:"c8y-data-grid",template:'<div class="table-data-grid-scroll" #scroll>\n <div *ngIf="displayOptions.gridHeader" class="table-data-grid-header separator large-padding">\n <h4 class="m-r-16">{{ title | translate }}</h4>\n\n <ng-container *ngIf="displayOptions.filter">\n <span *ngIf="!filteringApplied">\n <span class="label label-warning m-r-4" translate>No filters</span>\n <small\n *ngIf="!!filteringLabelsParams.allItemsCount"\n class="m-r-4"\n ngNonBindable\n translate\n [translateParams]="filteringLabelsParams"\n >{{ filteredItemsCount }} of {{ allItemsCount }} items</small\n >\n </span>\n <span *ngIf="filteringApplied">\n <ng-container *ngIf="!!filteringLabelsParams.allItemsCount">\n <span class="badge badge-info m-r-4">\n {{ (dataSource.stats$ | async).filteredSize }}\n </span>\n <small ngNonBindable translate [translateParams]="filteringLabelsParams"\n >of {{ allItemsCount }} items</small\n >\n </ng-container>\n <button\n title=" {{ \'Clear filters\' | translate }}"\n class="m-l-8 btn btn-xs btn-default m-r-4"\n (click)="clearFilters()"\n >\n {{ \'Clear filters\' | translate }}\n </button>\n </span>\n <span class="hidden-xs hidden-sm">\n <button\n class="btn-clean text-primary"\n popover="{{ \'Click the column headers to apply filters.\' | translate }}"\n placement="right"\n triggers="focus"\n >\n <i c8yIcon="question-circle-o"></i>\n </button> </span\n ></ng-container>\n\n <div class="flex-item-right">\n <div class="btnbar flex-row">\n <label class="c8y-switch" *ngIf="showChildDevices.show">\n <input type="checkbox" [(ngModel)]="showChildDevices.value" (click)="loadChildDevices()"/>\n <span></span>\n {{ \'Show child devices\' | translate }}\n </label>\n\n <div\n class="dropdown"\n dropdown\n [insideClick]="true"\n container="body"\n placement="bottom left"\n >\n <button\n title="{{ \'Configure columns\' | translate }}"\n class="btnbar-btn c8y-dropdown"\n dropdownToggle\n >\n <i c8yIcon="columns" class="m-r-4"></i>\n <span>{{ \'Configure columns\' | translate }}</span>\n </button>\n\n <ul *dropdownMenu class="dropdown-menu" (click)="$event.stopPropagation()">\n <li class="bg-white">\n <div cdkDropList (cdkDropListDropped)="onColumnDrop($event)" class="list-group m-0">\n <div *ngFor="let column of columns" cdkDrag cdkDragLockAxis="y">\n <ng-container *ngIf="!column.positionFixed">\n <div class="list-group-item draggable-after p-0 ">\n <label\n title="{{ (column.header | translate) || column.name }}"\n class="c8y-checkbox p-l-16 p-r-32 p-t-8 p-b-8 flex-item-v-stretch"\n >\n <input\n type="checkbox"\n [(ngModel)]="column.visible"\n (change)="updateGridColumnsSize()"\n />\n <span></span>\n <span>{{ (column.header | translate) || column.name }}</span>\n </label>\n </div>\n </ng-container>\n </div>\n </div>\n </li>\n </ul>\n </div>\n\n <button\n title="{{ \'Reload\' | translate }}"\n class="btnbar-btn btn-link"\n [disabled]="dataSource.loading$ | async"\n (click)="searchText = \'\'; reload()"\n >\n <i c8yIcon="refresh" class="m-r-4"></i>\n <span>{{ \'Reload\' | translate }}</span>\n </button>\n\n <div *ngIf="!serverSideDataCallback || showSearch" class="input-group input-group-search m-l-sm-32">\n <input\n type="search"\n class="form-control"\n placeholder="{{ \'Search…\' | translate }}"\n [ngModel]="searchText"\n (input)="searchText$.emit($event.target.value)"\n />\n <div class="input-group-addon">\n <i c8yIcon="search" *ngIf="searchText.length === 0"></i>\n <i\n c8yIcon="times"\n class="pointer"\n *ngIf="searchText.length > 0"\n (click)="searchText = \'\'; searchText$.emit(\'\')"\n ></i>\n </div>\n </div>\n </div>\n </div>\n <div\n class="table-data-grid-header-bulk-actions animated slideInDown fast"\n *ngIf="selectedItemIds.length !== 0"\n >\n <h4>\n <span\n *ngIf="!itemsSelectLimit; else limit"\n ngNonBindable\n translate\n [translateParams]="{ count: selectedItemIds.length }"\n >\n {{ count }} selected items.\n </span>\n <ng-template #limit>\n <span\n ngNonBindable\n translate\n [translateParams]="{ count: selectedItemIds.length, limit: itemsSelectLimit }"\n >\n {{ count }} selected items out of {{ limit }} allowed\n </span>\n </ng-template>\n\n <br class="visible-xs" />\n <small *ngIf="selectedItemIds.length >= pagination.pageSize && !itemsSelectLimit">\n <a (click)="setAllItemsSelected(true)" class="interact" >\n <span\n ngNonBindable\n translate\n [translateParams]="{ count: (dataSource.stats$ | async).filteredSize }"\n >\n Select all {{ count }} items\n </span>\n </a>\n </small>\n </h4>\n <div class="flex-item-right">\n <div class="btnbar flex-row">\n <ng-container\n *ngFor="let bulkActionControl of bulkActionControls"\n [ngSwitch]="bulkActionControl.type"\n >\n <button\n title="{{ \'Export\' | translate }}"\n *ngSwitchCase="builtInActionType.Export"\n class="btnbar-btn"\n (click)="bulkActionControl.callback(selectedItemIds, reload.bind(this))"\n >\n <i c8yIcon="sign-out"></i>\n <span>{{ \'Export\' | translate }}</span>\n </button>\n\n <button\n title="{{ \'Delete\' | translate }}"\n *ngSwitchCase="builtInActionType.Delete"\n class="btnbar-btn"\n (click)="bulkActionControl.callback(selectedItemIds, reload.bind(this))"\n >\n <i c8yIcon="trash"></i>\n <span>{{ \'Delete\' | translate }}</span>\n </button>\n\n <button\n title="{{ bulkActionControl.text | translate }}"\n *ngSwitchDefault\n class="btnbar-btn"\n (click)="bulkActionControl.callback(selectedItemIds, reload.bind(this))"\n >\n <i c8yIcon="{{ bulkActionControl.icon }}"></i>\n <span>{{ bulkActionControl.text | translate }}</span>\n </button>\n </ng-container>\n\n <button title="{{ \'Cancel\' | translate }}" class="btnbar-btn" (click)="cancel()">\n <i c8yIcon="times"></i>\n <span>{{ \'Cancel\' | translate }}</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <table\n class="table table-hover table-filtered-sorted table-data-grid large-padding"\n cdk-table\n [dataSource]="dataSource"\n [trackBy]="trackByName"\n [class.table-striped]="displayOptions.striped"\n [class.table-bordered]="displayOptions.bordered"\n [class.table-data-grid-with-checkboxes]="selectable"\n [class.table-data-grid-with-actions]="actionControls.length > 0"\n [style.grid-template-columns]="styles.gridTemplateColumns"\n (mousemove)="resizeHandleContainerMouseMove$.emit($event)"\n (mouseup)="resizeHandleContainerMouseUp$.emit($event)"\n >\n <ng-container *ngFor="let column of columns; trackBy: trackByName" [cdkColumnDef]="column.name">\n <ng-container [ngSwitch]="column.name">\n <ng-container *ngSwitchCase="\'checkbox\'">\n <th cdk-header-cell *cdkHeaderCellDef data-type="icon">\n <div *ngIf="!itemsSelectLimit">\n <label class="c8y-checkbox">\n <input\n type="checkbox"\n [checked]="currentPageSelectionState.allSelected"\n [indeterminate]="\n !(\n currentPageSelectionState.allSelected ||\n currentPageSelectionState.allDeselected\n )\n "\n (change)="setAllItemsInCurrentPageSelected($event.target.checked)"\n />\n <span></span>\n </label>\n </div>\n </th>\n\n <td cdk-cell *cdkCellDef="let row">\n <label class="c8y-checkbox">\n <input\n type="checkbox"\n [checked]="isItemSelected(row)"\n (change)="setItemsSelected([row], $event.target.checked)"\n [disabled]="selectedItemIds.length >= itemsSelectLimit && !isItemSelected(row)"\n />\n <span></span>\n </label>\n </td>\n </ng-container>\n\n <ng-container *ngSwitchCase="\'actions\'">\n <th cdk-header-cell *cdkHeaderCellDef data-type="icon"></th>\n\n <td cdk-cell *cdkCellDef="let row">\n <ng-container *ngIf="actionControls.length <= 2">\n <ng-container\n *ngFor="let actionControl of actionControls"\n [ngSwitch]="actionControl.type"\n >\n <ng-container *ngIf="actionControl.showIf ? actionControl.showIf(row) : true">\n <button\n *ngSwitchCase="builtInActionType.Edit"\n class="btn btn-icon btn-xs btn-default"\n title="{{ \'Edit\' | translate }}"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="pencil"></i>\n </button>\n <button\n *ngSwitchCase="builtInActionType.Delete"\n class="btn btn-dot showOnHover"\n title="{{ \'Delete\' | translate }}"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i class="text-danger" c8yIcon="minus-circle"></i>\n </button>\n <button\n *ngSwitchDefault\n class="btn btn-icon btn-xs btn-default"\n title="{{ actionControl.text | translate }}"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="{{ actionControl.icon }}"></i>\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <div *ngIf="actionControls.length > 2" class="dropdown" dropdown>\n <button\n title="{{ \'Actions\' | translate }}"\n class="dropdown-toggle c8y-dropdown"\n dropdownToggle\n >\n <i c8yIcon="ellipsis-v"></i>\n </button>\n <ul class="dropdown-menu dropdown-menu-right" *dropdownMenu>\n <li *ngFor="let actionControl of actionControls" [ngSwitch]="actionControl.type">\n <ng-container *ngIf="actionControl.showIf ? actionControl.showIf(row) : true">\n <button\n title="{{ \'Edit\' | translate }}"\n *ngSwitchCase="builtInActionType.Edit"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="pencil"></i>\n {{ \'Edit\' | translate }}\n </button>\n <button\n title="{{ \'Delete\' | translate }}"\n *ngSwitchCase="builtInActionType.Delete"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="trash"></i>\n {{ \'Delete\' | translate }}\n </button>\n <button\n title="{{ \'Export\' | translate }}"\n *ngSwitchCase="builtInActionType.Export"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="download"></i>\n {{ \'Export\' | translate }}\n </button>\n <button\n title="{{ actionControl.text | translate }}"\n *ngSwitchDefault\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="{{ actionControl.icon }}"></i>\n {{ actionControl.text | translate }}\n </button>\n </ng-container>\n </li>\n </ul>\n </div>\n </td>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <th\n cdk-header-cell\n *cdkHeaderCellDef\n [ngClass]="column.headerCSSClassName"\n [attr.data-type]="column.dataType"\n [class.sorted]="column.sortOrder"\n [class.filtered]="column | map: isColumnFilteringApplied"\n [class.hidden]="!column.visible"\n >\n <div *ngIf="!column.filterable" [title]="(column.header | translate) || column.name">\n <ng-container\n *ngIf="\n (\n [{\n columnName: column.name,\n value: ((column.header | translate) || column.name)\n }]\n | map:getHeaderCellRendererSpec:this\n ) as cellRendererSpec\n "\n >\n <c8y-cell-renderer [spec]="cellRendererSpec"></c8y-cell-renderer>\n </ng-container>\n </div>\n\n <div\n *ngIf="column.filterable"\n class="dropdown"\n dropdown\n #dropdown="bs-dropdown"\n container="body"\n placement="bottom left"\n [insideClick]="true"\n >\n <button\n class="btn-header c8y-dropdown"\n dropdownToggle\n [title]="(column.header | translate) || column.name"\n >\n <ng-container\n *ngIf="\n (\n [{\n columnName: column.name,\n value: ((column.header | translate) || column.name)\n }]\n | map:getHeaderCellRendererSpec:this\n ) as cellRendererSpec\n "\n >\n <c8y-cell-renderer [spec]="cellRendererSpec"></c8y-cell-renderer>\n </ng-container>\n <i c8yIcon="filter" title="{{ \'Filter\' | translate }}"></i>\n </button>\n\n <ul *dropdownMenu class="dropdown-menu" (click)="$event.stopPropagation()">\n <li class="data-grid__dropdown">\n <ng-container\n *ngIf="\n (\n [{\n column: column,\n dropdown: dropdown\n }]\n | map:getFilteringFormRendererSpec:this\n ) as filteringFormRendererSpec\n "\n >\n <c8y-filtering-form-renderer [spec]="filteringFormRendererSpec">\n </c8y-filtering-form-renderer>\n </ng-container>\n </li>\n </ul>\n </div>\n\n <button\n *ngIf="column.sortable"\n class="btn-sort"\n title="{{ \'Sort\' | translate }}"\n (click)="changeSortOrder(column.name)"\n >\n <ng-container [ngSwitch]="column.sortOrder">\n <i *ngSwitchCase="\'asc\'" c8yIcon="long-arrow-up"></i>\n <i *ngSwitchCase="\'desc\'" c8yIcon="long-arrow-down"></i>\n <i *ngSwitchDefault c8yIcon="exchange"></i>\n </ng-container>\n </button>\n\n <span\n class="resize-handle"\n (mousedown)="\n resizeHandleMouseDown$.emit({ event: $event, targetColumnName: column.name })\n "\n >\n </span>\n </th>\n\n <td\n cdk-cell\n *cdkCellDef="let row"\n [ngClass]="column.cellCSSClassName"\n [attr.data-cell-title]="column.header | translate"\n [class.hidden]="!column.visible"\n >\n <ng-container\n *ngIf="\n (\n [{\n value: resolveCellValue(row, column.path),\n row: row,\n columnName: column.name\n }]\n | map:getCellRendererSpec:this\n ) as cellRendererSpec\n "\n >\n <c8y-cell-renderer [spec]="cellRendererSpec"></c8y-cell-renderer>\n </ng-container>\n </td>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <ng-container cdkColumnDef="infiniteScrollFooter">\n <td cdk-footer-cell *cdkFooterCellDef [style.grid-column]="styles.gridInfiniteScrollColumn">\n <template #infiniteScrollContainer></template>\n </td>\n </ng-container>\n\n <tr cdk-header-row *cdkHeaderRowDef="columnNames"></tr>\n\n <tr\n cdk-row\n *cdkRowDef="let row; columns: columnNames"\n (mouseover)="rowMouseOver.emit(row)"\n (mouseleave)="rowMouseLeave.emit(row)"\n (click)="rowClick.emit(row)"\n ></tr>\n\n <ng-container *ngIf="infiniteScroll">\n <tr cdk-footer-row *cdkFooterRowDef="[\'infiniteScrollFooter\']"></tr>\n </ng-container>\n </table>\n\n <div *ngIf="(dataSource.loading$ | async) && !loadMoreComponent" class="text-center">\n <c8y-progress-bar [message]="loadingItemsLabel"></c8y-progress-bar>\n </div>\n\n <div\n class="row m-0 p-t-40 p-b-40"\n *ngIf="!(dataSource.loading$ | async) && (dataSource.stats$ | async).filteredSize === 0"\n >\n <div class="col-md-4 col-md-offset-4">\n <ng-content select=".c8y-empty-state"></ng-content>\n </div>\n </div>\n\n <div *ngIf="pagination && !infiniteScroll" class="table-data-grid-footer separator large-padding">\n <div class="col-sm-4 no-gutter">\n <div *ngIf="(dataSource.stats$ | async).currentPageSize > 0" class="counter">\n <span class="text-muted" ngNonBindable translate [translateParams]="paginationLabelParams"\n >{{ pageFirstItemIdx }} - {{ pageLastItemIdx }} of {{ itemsTotal }}</span\n >\n </div>\n </div>\n\n <div class="col-sm-4 no-gutter text-center">\n <div\n *ngIf="(dataSource.stats$ | async).filteredSize > minPossiblePageSize"\n class="form-group form-inline"\n >\n <label class="m-r-4">{{ \'Items per page\' | translate }}</label>\n <div class="c8y-select-wrapper">\n <select\n class="form-control"\n [ngModel]="pagination.pageSize"\n (ngModelChange)="\n updatePagination({ itemsPerPage: $event, page: pagination.currentPage })\n "\n >\n <option *ngFor="let pageSize of possiblePageSizes" [ngValue]="pageSize">\n {{ pageSize }}\n </option>\n </select>\n </div>\n </div>\n </div>\n\n <div class="col-sm-4 no-gutter text-right">\n <pagination\n [class.hidden]="totalPagesCount <= 1"\n [ngModel]="pagination.currentPage"\n (pageChanged)="updatePagination($event)"\n [totalItems]="(dataSource.stats$ | async).filteredSize"\n [itemsPerPage]="pagination.pageSize"\n (numPages)="totalPagesCount = $event"\n [maxSize]="5"\n [boundaryLinks]="false"\n previousText=" "\n nextText=" "\n ></pagination>\n </div>\n </div>\n</div>\n'})],n)}(),Uh=function(){function e(e,t){this.injector=e,this.cd=t}return Object.defineProperty(e.prototype,"_spec",{set:function(e){this.spec=e},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){this.prevSpec||(this.prevSpec=this.spec);var e=this.spec.renderer;e instanceof t.TemplateRef?this.rendererType="TEMPLATE":e instanceof t.Type&&(this.rendererType="COMPONENT",this.rendererInjector=t.Injector.create({providers:[{provide:Ah,useValue:this.spec.context}],parent:this.injector}))},e.prototype.ngDoCheck=function(){!this.spec.context.value===this.prevSpec.context.value&&(this.prevSpec=this.spec,this.cd.markForCheck())},e.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef}]},jc([t.Input("spec")],e.prototype,"_spec",null),e=jc([t.Component({selector:"c8y-cell-renderer",template:'<ng-container *ngIf="spec.renderer">\n <ng-container\n *ngIf="rendererType === \'TEMPLATE\'"\n [ngTemplateOutlet]="spec.renderer"\n [ngTemplateOutletContext]="{ $implicit: spec.context }"\n >\n </ng-container>\n\n <ng-container\n *ngIf="rendererType === \'COMPONENT\'"\n [ngComponentOutlet]="spec.renderer"\n [ngComponentOutletInjector]="rendererInjector"\n >\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf="!spec.renderer">\n {{ spec.context.value }}\n</ng-container>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],e)}(),Bh=function(){function e(e,t){this.injector=e,this.cd=t,this.defaultRendererFilterText=""}return Object.defineProperty(e.prototype,"_spec",{set:function(e){this.spec=e},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){var e=this.spec,n=e.renderer,a=e.context;n instanceof t.TemplateRef?this.rendererType="TEMPLATE":n instanceof t.Type&&(this.rendererType="COMPONENT",this.rendererInjector=t.Injector.create({providers:[{provide:Dh,useValue:this.spec.context}],parent:this.injector}));var o=a.property.filterPredicate;"string"==typeof o&&(this.defaultRendererFilterText=o)},e.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef}]},jc([t.Input("spec")],e.prototype,"_spec",null),e=jc([t.Component({selector:"c8y-filtering-form-renderer",template:'<ng-container *ngIf="spec.renderer">\n <ng-container\n *ngIf="rendererType === \'TEMPLATE\'"\n [ngTemplateOutlet]="spec.renderer"\n [ngTemplateOutletContext]="{ $implicit: spec.context }"\n >\n </ng-container>\n\n <ng-container\n *ngIf="rendererType === \'COMPONENT\'"\n [ngComponentOutlet]="spec.renderer"\n [ngComponentOutletInjector]="rendererInjector"\n >\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf="!spec.renderer">\n <div class="form-group">\n <label translate>Filter text</label>\n <input\n class="form-control"\n [(ngModel)]="defaultRendererFilterText"\n (keyup.enter)="\n spec.context.applyFilter({\n filterPredicate: defaultRendererFilterText\n })\n "\n />\n </div>\n <div class="flex-row">\n <button\n class="btn btn-default btn-sm flex-grow m-r-8"\n (click)="defaultRendererFilterText = \'\'; spec.context.resetFilter()"\n translate\n >\n Reset\n </button>\n <button\n class="btn btn-primary btn-sm flex-grow"\n (click)="\n spec.context.applyFilter({\n filterPredicate: defaultRendererFilterText\n })\n "\n translate\n >\n Apply\n </button>\n </div>\n</ng-container>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],e)}(),Gh=function(){function e(){}return e=jc([t.NgModule({imports:[i.CommonModule,hc.CdkTableModule,dc.DragDropModule,nc.FormsModule,nc.ReactiveFormsModule,Uu,l.BsDropdownModule.forRoot(),ac.PopoverModule.forRoot(),fc.PaginationModule.forRoot()],declarations:[_h,Nh,Uh,Lh,Bh,Mh,Fh],exports:[_h,Nh,Lh,Mh,Fh],entryComponents:[Fh]})],e)}(),Hh=function(){function e(e,t,n){this.docsService=e,this.appState=t,this.translateService=n,this.src="",this.isCollapsed=!0,this.priority=1/0,this.title="",this.content=[],this.isLoading=!0,this.hasError=!1,this.SUPPORTED_LANGUAGES=["en"]}return Object.defineProperty(e.prototype,"isSupportedLanguage",{get:function(){return this.SUPPORTED_LANGUAGES.indexOf(this.translateService.currentLang)>-1},enumerable:!0,configurable:!0}),e.prototype.getUrl=function(e){void 0===e&&(e="");var t=this.parseVersion(this.appState.uiVersion),n=this.docsService.getBaseUrl();return n+(n.endsWith("/")?"":"/")+t+(e.startsWith("/")?e:"/"+e)},e.prototype.toggle=function(){this.isCollapsed?this.open():this.close()},e.prototype.close=function(){this.isCollapsed=!0,this.clean()},e.prototype.open=function(){this.isCollapsed=!1,this.isLoading=!0,this.requestContent(),this.icon||(this.icon=this.resolveIcon())},e.prototype.ngAfterContentChecked=function(){var e=this;this.content.length>0&&this.helpContent&&this.content.forEach((function(t){e.helpContent.nativeElement.append(t)}))},e.prototype.requestContent=function(){var e=this,t=new XMLHttpRequest;t.onreadystatechange=function(){return e.render(t)},t.addEventListener("load",(function(){return e.render(t)})),t.open("GET",this.getUrl(this.src)),t.responseType="document",t.setRequestHeader("Accept","text/html"),t.send()},e.prototype.clean=function(){this.title="",this.isLoading=!0,this.hasError=!1,this.content=[],this.helpContent&&(this.helpContent.nativeElement.innerHTML="")},e.prototype.parseVersion=function(e){var t=e.split(".")[0],n=Math.floor(parseInt(t,10)/100);return n+"."+(parseInt(t,10)-100*n)+".0"},e.prototype.resolveIcon=function(){try{return Array.from(document.querySelector("nav .active i").classList).find((function(e){return e.startsWith("c8y-")||e.startsWith("dlt-c8y-icon-")})).replace("dlt-c8y-icon-","")}catch(e){return"question-circle-o"}},e.prototype.render=function(e){var t,n;if(4===e.readyState)if(this.isLoading=!1,200===e.status){var a=this.src.split("#"),o="#"+a[a.length-1]+" h2",s=e.response.querySelector(o),r=Array.from(s.parentElement.children).slice(1);this.title=s.innerText.trim();try{for(var l=Ic(r),i=l.next();!i.done;i=l.next()){var c=i.value;if("h3"===c.tagName.toLowerCase())break;this.content.push(c)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}}else this.hasError=!0},e.ctorParameters=function(){return[{type:xd},{type:Uc},{type:p.TranslateService}]},jc([t.Input()],e.prototype,"src",void 0),jc([t.Input()],e.prototype,"isCollapsed",void 0),jc([t.Input()],e.prototype,"priority",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.ViewChild("helpContent",{static:!1,read:t.ElementRef})],e.prototype,"helpContent",void 0),e=jc([t.Component({selector:"c8y-help",template:'<c8y-action-bar-item\n [placement]="\'right\'"\n itemClass="pull-right"\n [priority]="priority"\n *ngIf="isSupportedLanguage"\n>\n <button\n class="btn btn-help"\n [title]="\'Open help\' | translate"\n (click)="toggle()"\n [attr.aria-expanded]="!isCollapsed"\n aria-controls="collapseHelp"\n >\n <i\n [c8yIcon]="\'question-circle-o\'"\n class="text-info text-16"\n ></i>\n </button>\n</c8y-action-bar-item>\n\n<div\n id="collapseHelp"\n class="c8y-help-drawer"\n [collapse]="isCollapsed"\n [isAnimated]="true"\n>\n <div\n class="p-24"\n #docOutlet\n >\n <div\n *ngIf="isLoading"\n >\n <c8y-loading></c8y-loading>\n </div>\n\n <div *ngIf="!isLoading">\n <div class="d-flex">\n <i\n [c8yIcon]="icon"\n class="c8y-icon-duocolor icon-48"\n ></i>\n <div\n class="p-l-16 flex-grow"\n *ngIf="!hasError"\n >\n <h3 class="text-light m-b-16">{{title}}</h3>\n <div\n id="helpContent"\n class="help-content"\n #helpContent\n ></div>\n\n <button\n class="btn btn-default"\n (click)="toggle()"\n [title]="\'Close help\' | translate"\n [attr.aria-expanded]="!isCollapsed"\n aria-controls="collapseHelp"\n >Close</button>\n <a\n href="{{getUrl(src)}}"\n class="btn btn-primary"\n target="_blank"\n translate\n >\n Check the <span>User guide`KEEP_ORIGINAL`</span>\n </a>\n </div>\n\n <div\n class="p-l-16 flex-grow"\n *ngIf="hasError"\n >\n <h3\n class="text-light m-b-16"\n translate\n >Sorry, that didn\'t work</h3>\n <div class="help-content">\n <p translate>The content couldn\'t be loaded.</p>\n </div>\n\n <button\n class="btn btn-default"\n (click)="toggle()"\n [title]="\'Close help\' | translate"\n [attr.aria-expanded]="!isCollapsed"\n aria-controls="collapseHelp"\n translate\n >Close</button>\n <a\n href="{{getUrl()}}"\n class="btn btn-primary"\n target="_blank"\n translate\n >\n Open the <span>User guide`KEEP_ORIGINAL`</span>\n </a>\n\n </div>\n </div>\n </div>\n\n </div>\n</div>\n'})],e)}(),zh=function(){function e(){}return e=jc([t.NgModule({declarations:[Hh],imports:[Uu,r.CollapseModule.forRoot(),Gu],exports:[Hh],providers:[]})],e)}(),Vh=function(){function e(){}return Object.defineProperty(e.prototype,"active",{get:function(){return!!this.service&&this.service.active},enumerable:!0,configurable:!0}),e.prototype.toggle=function(){this.service&&(this.active?this.service.stop():this.service.start())},jc([t.Input()],e.prototype,"service",void 0),e=jc([t.Component({selector:"c8y-realtime-btn",template:'<button\n type="button"\n class="btn btn-link c8y-realtime"\n title="{{ \'Toggle realtime\' | translate }}"\n (click)="toggle()"\n>\n <span class="c8y-pulse" [ngClass]="{ active: active, inactive: !active }"></span>\n <span translate>Realtime</span>\n</button>\n'})],e)}(),Kh=function(){function e(){}return e=jc([t.NgModule({imports:[Uu],declarations:[Vh],exports:[Vh]})],e)}();($h=e.ModalSelectionMode||(e.ModalSelectionMode={})).SINGLE="single",$h.MULTI="multi";var Wh=function(){function n(n){var s=this;this.bsModalRef=n,this.subTitle="Select from the list of items matching the device type",this.mode=e.ModalSelectionMode.MULTI,this.disableSelected=!0,this.showFilter=!0,this.areMoreEntries=!1,this.result=new t.EventEmitter,this.search=new t.EventEmitter,this.selected=!1,this.filterTerm="",this.listItems=[],this.debouncer=new a.Subject,this._labels={ok:"Confirm",cancel:"Cancel"},this.debouncer.pipe(o.debounceTime(500)).subscribe((function(e){s.search.emit(e)}))}return Object.defineProperty(n.prototype,"labels",{get:function(){return this._labels},set:function(e){var t=e||{},n=t.ok,a=void 0===n?this.labels.ok:n,o=t.cancel,s=void 0===o?this.labels.cancel:o;this._labels={ok:a,cancel:s}},enumerable:!0,configurable:!0}),n.prototype.ngOnChanges=function(e){return Sc(this,void 0,void 0,(function(){var t,n,a=this;return Cc(this,(function(o){switch(o.label){case 0:return e.items&&e.items.currentValue?(t=e.items.currentValue.map((function(e){return Sc(a,void 0,void 0,(function(){var t,n;return Cc(this,(function(a){switch(a.label){case 0:return t=e,[4,e.options];case 1:return t.options=a.sent(),(n=e.options.find((function(e){return e.selected})))&&(e.selectedId=n.obj.id,this.disableSelected&&e.options.map((function(e){return s.assign(e,{disabled:!0})}))),[2,e]}}))}))})),n=this,[4,Promise.all(t)]):[3,2];case 1:n.listItems=o.sent(),o.label=2;case 2:return[2]}}))}))},n.prototype.updatePipe=function(e){this.debouncer.next(e),this.filterTerm=e},n.prototype.updateChoice=function(e){var t=e.item,n=e.id;"single"===this.mode&&this.listItems.map((function(e){return e.selectedId=void 0})),t.selectedId=n,this.selected=!0},n.prototype.dismiss=function(){this.bsModalRef.hide()},n.prototype.select=function(){this.result.emit(this.getOutput()),this.bsModalRef.hide()},n.prototype.ngOnDestroy=function(){this.debouncer.complete(),this.result.complete(),this.search.complete()},n.prototype.getOutput=function(){return this.listItems.filter((function(e){return e.selectedId})).map((function(e){return e.options.find((function(t){return e.selectedId===t.obj.id}))})).filter((function(e){return!e.selected})).map((function(e){return e.obj}))},n.ctorParameters=function(){return[{type:oc.BsModalRef}]},jc([t.Input()],n.prototype,"icon",void 0),jc([t.Input()],n.prototype,"title",void 0),jc([t.Input()],n.prototype,"subTitle",void 0),jc([t.Input()],n.prototype,"items",void 0),jc([t.Input()],n.prototype,"mode",void 0),jc([t.Input()],n.prototype,"disableSelected",void 0),jc([t.Input()],n.prototype,"showFilter",void 0),jc([t.Input()],n.prototype,"areMoreEntries",void 0),jc([t.Input()],n.prototype,"labels",null),jc([t.Output()],n.prototype,"result",void 0),jc([t.Output()],n.prototype,"search",void 0),n=jc([t.Component({selector:"c8y-select-modal",template:'<div class="viewport-modal">\n <div class="modal-header dialog-header">\n <span c8yIcon="{{ icon }}"></span>\n <h4 class="text-uppercase">\n {{ title | translate }}\n </h4>\n </div>\n <div class="p-16 text-center separator-bottom">\n <p class="m-b-8">{{ subTitle | translate }}</p>\n <c8y-filter *ngIf="showFilter" [icon]="\'search\'" (onSearch)="updatePipe($event)"></c8y-filter>\n </div>\n <div class="modal-inner-scroll">\n <div class="p-l-16 p-r-16">\n <div class="panel m-t-8 m-b-8" *ngIf="!items || items.length === 0">\n <div class="c8y-empty-state text-left">\n <h1 c8yIcon="{{ icon }} " class="c8y-icon-duocolor"></h1>\n <p translate>No items to display.</p>\n </div>\n </div>\n </div>\n <c8y-list-group>\n <c8y-li *ngFor="let item of listItems | selectModalFilterPipe: filterTerm">\n <c8y-li-icon>\n <i c8yIcon="{{ icon }}"></i>\n </c8y-li-icon>\n\n <c8y-li-body class="content-flex-30">\n <div class="col-9">\n <div *ngFor="let bodyPart of item.body" [ngClass]="bodyPart.class">\n <c8y-highlight\n [title]="bodyPart.value"\n [pattern]="filterTerm"\n [text]="bodyPart.value"\n ></c8y-highlight>\n </div>\n </div>\n\n <div class="col-3 text-right" *ngIf="item.additionalInformation">\n <div [ngClass]="item.additionalInformation.class">\n {{ item.additionalInformation.value }}\n </div>\n </div>\n </c8y-li-body>\n\n <c8y-li-collapse>\n <c8y-list-group>\n <c8y-li *ngFor="let option of item.options">\n <c8y-li-radio\n [name]="mode === \'single\' ? \'single\' : item.groupId"\n (onSelect)="updateChoice({ item: item, id: option.obj.id })"\n [disabled]="option.disabled"\n [selected]="option.selected"\n >\n </c8y-li-radio>\n <c8y-li-body class="content-flex-50">\n <div\n *ngFor="let optionPart of option.body; let i = index"\n [ngClass]="optionPart.class"\n >\n <c8y-highlight [pattern]="filterTerm" [text]="optionPart.value"></c8y-highlight>\n </div>\n </c8y-li-body>\n </c8y-li>\n </c8y-list-group>\n </c8y-li-collapse>\n </c8y-li>\n <div *ngIf="areMoreEntries">\n <div class="alert alert-info m-t-16 m-r-8 m-l-8" translate>\n Some entries might not be shown. Try narrowing search criteria.\n </div>\n </div>\n </c8y-list-group>\n </div>\n\n <div class="modal-footer">\n <button\n title="{{ labels.cancel | translate }}"\n *ngIf="labels.cancel"\n class="btn btn-default"\n (click)="dismiss()"\n >\n {{ labels.cancel | translate }}\n </button>\n <button\n title="{{ labels.ok | translate }}"\n class="btn btn-primary"\n (click)="select()"\n [disabled]="!selected"\n >\n {{ labels.ok | translate }}\n </button>\n </div>\n</div>\n'})],n)}(),Yh=function(){function e(){}return e.prototype.transform=function(e,t){var n=this;return 0===t.trim().length?e:e.filter((function(e){return n.extractValues(e).filter((function(e){return n.filterContainString(e,t)})).length>0}))},e.prototype.filterContainString=function(e,t){var n=t.toLowerCase().trim();return e&&e.toLowerCase().indexOf(n)>-1},e.prototype.extractValues=function(e){var t=this,n=[];return e.value&&n.push(e.value),Object.keys(e).forEach((function(a){Array.isArray(e[a])&&e[a].forEach((function(e){return n.concat(t.extractValues(e))})),e[a]instanceof Object&&(n=n.concat(t.extractValues(e[a])))})),n},e=jc([t.Pipe({name:"selectModalFilterPipe"})],e)}(),Zh=function(){function e(){}return e=jc([t.NgModule({imports:[l.BsDropdownModule.forRoot(),Uu,Eh,Jd,xp],exports:[Wh,Yh],declarations:[Wh,Yh]})],e)}(),Jh=function(){function e(){this.placeholder="Select item",this.applyLabel="Apply",this.disableApplyOnNoSelection=!1,this.onChange=new t.EventEmitter,this.textFilter="",this.labelText="",this.isOpen=!1,this.filteredItems=[],this.searchFilter=null,this.sizeToShowFilter=5,this.labelsForSelectAll={all:"All",allFiltered:"All filtered"},this.showAllLabel=!1,this.itemsSelected=new Set,this.stopClicks=!1}return e.prototype.preventClick=function(e){this.stopClicks&&e.stopPropagation(),this.stopClicks=this.isOpen},e.prototype.isOpenChange=function(e){this.isOpen=e,e?(this.updateSelected(),this.searchFilter=null):this.stopClicks=!1},e.prototype.outterSelected=function(e){var t=this.selected,n=function(){return!1};return"function"==typeof t?n=t:Array.isArray(t)&&(n=function(e){return t.indexOf(e)>-1}),n(e)},e.prototype.isSelected=function(e){return this.itemsSelected.has(e)},e.prototype.isAllItemsSelected=function(){return this.itemsSelected.size===this.items.length},e.prototype.isAllFilteredSelected=function(){return this.itemsSelected.size===this.filteredItems.length},e.prototype.isNoItemSelected=function(){return!this.itemsSelected.size},e.prototype.applyChanges=function(){var e=Array.from(this.itemsSelected.values());this.onChange.emit(e),this.dropdown.hide()},e.prototype.selectAll=function(e){var t=this;this.filteredItems.forEach((function(n){return t.onChangeItem(e,n)}))},e.prototype.ngOnInit=function(){var e=this;this.updateItems&&this.updateItems.subscribe((function(){e.updateSelected(),e.updateLabel(),e.showAllLabel=e.isAllItemsSelected()}))},e.prototype.onChangeItem=function(e,t){e?this.itemsSelected.add(t):this.itemsSelected.delete(t)},e.prototype.updateFiltered=function(e){if(e){var t=new RegExp(e,"i");this.filteredItems=this.items.filter((function(e){var n=e.name;return t.test(n)}))}else this.filteredItems=this.items},e.prototype.getSelectAllToggleStatus=function(){var e=this.getLabel(),t=this.isAllSelected();return{label:e,checked:t,indeterminate:!t&&this.itemsSelected.size>0}},e.prototype.ngOnChanges=function(e){this.isOpen||(e.items||e.selected||e.applyLabel)&&(this.updateSelected(),this.updateLabel(),this.showAllLabel=this.isAllItemsSelected())},e.prototype.ngOnDestroy=function(){this.updateItems&&!this.updateItems.closed&&this.updateItems.unsubscribe()},e.prototype.updateLabel=function(){var e=this,t=this.items.filter((function(t){return e.outterSelected(t)}));"string"==typeof this.selectedLabel?this.labelText=this.selectedLabel:"function"==typeof this.selectedLabel?this.labelText=this.selectedLabel(t):this.labelText=t.map((function(e){return e.name})).join(", ")},e.prototype.updateSelected=function(){var e=this,t=this.itemsSelected,n=this.items;t.clear(),n.forEach((function(n){e.outterSelected(n)&&t.add(n)})),this.filteredItems=n},e.prototype.isAllSelected=function(){return this.getLabel()===this.labelsForSelectAll.allFiltered?this.isAllFilteredSelected():this.isAllItemsSelected()},e.prototype.getLabel=function(){return this.searchFilter?this.labelsForSelectAll.allFiltered:this.labelsForSelectAll.all},jc([t.Input()],e.prototype,"placeholder",void 0),jc([t.Input()],e.prototype,"selectedLabel",void 0),jc([t.Input()],e.prototype,"applyLabel",void 0),jc([t.Input()],e.prototype,"items",void 0),jc([t.Input()],e.prototype,"selected",void 0),jc([t.Input()],e.prototype,"updateItems",void 0),jc([t.Input()],e.prototype,"disableApplyOnNoSelection",void 0),jc([t.Output()],e.prototype,"onChange",void 0),jc([t.ViewChild(l.BsDropdownDirective,{static:!1})],e.prototype,"dropdown",void 0),jc([t.ContentChildren(wh)],e.prototype,"liChildren",void 0),jc([t.HostListener("click",["$event"])],e.prototype,"preventClick",null),e=jc([t.Component({selector:"c8y-select",template:'<div\n class="c8y-child-assets-selector dropdown fit-w"\n (isOpenChange)="isOpenChange($event)"\n dropdown\n #dropdown\n>\n <button\n type="button"\n class="btn dropdown-toggle c8y-dropdown"\n title="{{ labelText || placeholder | translate }}"\n dropdownToggle\n >\n <span class="text-truncate" *ngIf="labelText">\n <ng-container *ngIf="showAllLabel">{{ \'All\' | translate }}</ng-container>\n <ng-container *ngIf="!showAllLabel">{{ labelText | translate }}</ng-container>\n </span>\n <span class="text-truncate text-muted" *ngIf="!labelText">\n {{ placeholder | translate }}\n </span>\n </button>\n\n <ul class="dropdown-menu multiselect-container" *dropdownMenu>\n <ng-content select="c8y-li"></ng-content>\n <ng-container *ngIf="liChildren.length === 0">\n <li *ngIf="items.length > sizeToShowFilter" class="multiselect-item">\n <div class="input-group input-group-search">\n <input\n type="search"\n class="form-control"\n placeholder="{{ \'Filter\' | translate }}…"\n (keyup)="updateFiltered($event.target.value)"\n [(ngModel)]="searchFilter"\n />\n <span class="input-group-addon">\n <i c8yIcon="search" *ngIf="!textFilter"></i>\n <i c8yIcon="times" class="text-muted" *ngIf="textFilter" (click)="textFilter = \'\'"></i>\n </span>\n </div>\n </li>\n\n <li class="multiselect-item">\n <label\n [title]="getSelectAllToggleStatus().label"\n class="c8y-checkbox input-sm"\n ng-click="vm.toggleSelectAll(); $event.preventDefault()"\n >\n <input\n type="checkbox"\n [checked]="getSelectAllToggleStatus().checked"\n (change)="selectAll($event.target.checked)"\n [indeterminate]="getSelectAllToggleStatus().indeterminate"\n class="m-t-0"\n />\n <span></span>\n <span class="label-text">\n {{ getSelectAllToggleStatus().label }}\n </span>\n </label>\n </li>\n\n <li class="multiselect-item-container">\n <ul class="list-unstyled">\n <li class="multiselect-item" *ngFor="let item of filteredItems">\n <label title="{{ item.name | translate }}" class="c8y-checkbox input-sm text-truncate">\n <input\n type="checkbox"\n [checked]="isSelected(item)"\n (change)="onChangeItem($event.target.checked, item)"\n class="m-t-0"\n />\n <span></span>\n <span class="label-text">\n {{ item.name | translate }}\n </span>\n </label>\n </li>\n </ul>\n </li>\n <li class="divider"></li>\n <li class="bg-white">\n <button\n title="{{ applyLabel | translate }}"\n class="btn btn-primary btn-block"\n [disabled]="disableApplyOnNoSelection && isNoItemSelected()"\n (click)="applyChanges()"\n >\n {{ applyLabel | translate }}\n </button>\n </li>\n </ng-container>\n </ul>\n</div>\n'})],e)}(),Xh=function(){function e(){this.required=!1,this.disabled=!1,this.allowFreeEntries=!0,this.displayProperty="name",this.icon="caret-down",this.name=this.displayProperty,this.autoClose=!0,this.container="",this.selected={id:null},this.onSearch=new t.EventEmitter,this.onIconClick=new t.EventEmitter,this.KEYCODE_UP=38,this.KEYCODE_DOWN=40,this.KEYCODE_TAB=9,this.KEYCODE_ENTER=13,this.KEYCODE_ESC=27}var n;return n=e,e.prototype.writeValue=function(e){this.selected=e},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.doBlur=function(){this.onTouched&&this.onTouched()},e.prototype.getDisplayProperty=function(){return s.get(this.selected,this.displayProperty,"")},e.prototype.onShown=function(){this.searchControl.nativeElement.focus()},e.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},e.prototype.ngAfterViewInit=function(){var e=this;this.subscription=a.fromEvent(this.searchControl.nativeElement,"keydown").pipe(o.map((function(t){return e.handleKeyboard(t)})),o.filter((function(e){return e})),o.debounceTime(200),o.map((function(e){return e.target.value})),o.distinctUntilChanged()).subscribe((function(t){e.selected={id:null},s.set(e.selected,e.displayProperty,t||""),e.onChange(e.selected),e.onSearch.emit(t)}))},e.prototype.handleKeyboard=function(e){var t=e.keyCode;if(![this.KEYCODE_ENTER,this.KEYCODE_DOWN,this.KEYCODE_TAB,this.KEYCODE_UP].includes(t))return t===this.KEYCODE_ESC&&this.autoClose?(e.stopPropagation(),this.dropdown.hide(),void this.searchControl.nativeElement.blur()):(this.dropdown.show(),e);var n=this.list.toArray(),a=s.findIndex(n,(function(e){return e.active}));if(t===this.KEYCODE_ENTER||t===this.KEYCODE_TAB)a>-1&&(e.preventDefault(),n[a].element.nativeElement.click()),this.dropdown.hide(),this.searchControl.nativeElement.blur();else{this.dropdown.show();var o=t===this.KEYCODE_DOWN?1:-1;a>-1&&(n[a].active=!1),this.selectNextItemOnKeyboardMove(n,a,o)}},e.prototype.validate=function(e){return this.required&&!this.getDisplayProperty()?{required:!0}:!this.allowFreeEntries&&this.selected&&null===this.selected.id?{notExisting:!0}:null},e.prototype.selectNextItemOnKeyboardMove=function(e,t,n){if(e[t+n]){if(!e[t+n].selectable)return void this.selectNextItemOnKeyboardMove(e,t+n,n);e[t+n].active=!0}},jc([t.ViewChild("searchControl",{static:!1})],e.prototype,"searchControl",void 0),jc([t.ViewChild("dropdown",{static:!1})],e.prototype,"dropdown",void 0),jc([t.ContentChildren(wh)],e.prototype,"list",void 0),jc([t.Input()],e.prototype,"required",void 0),jc([t.Input()],e.prototype,"disabled",void 0),jc([t.Input()],e.prototype,"allowFreeEntries",void 0),jc([t.Input()],e.prototype,"placeholder",void 0),jc([t.Input()],e.prototype,"displayProperty",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"name",void 0),jc([t.Input()],e.prototype,"autoClose",void 0),jc([t.Input()],e.prototype,"container",void 0),jc([t.Input()],e.prototype,"selected",void 0),jc([t.Output()],e.prototype,"onSearch",void 0),jc([t.Output()],e.prototype,"onIconClick",void 0),e=n=jc([t.Component({selector:"c8y-typeahead",template:'<div\n class="c8y-child-assets-selector dropdown"\n dropdown\n [container]="container"\n placement="bottom left"\n #dropdown="bs-dropdown"\n [autoClose]="true"\n (onShown)="onShown()"\n [isDisabled]="disabled"\n>\n <div class="input-group input-group-dropdown" dropdownToggle>\n <input\n #searchControl\n type="text"\n class="form-control text-truncate p-r-24"\n [required]="required"\n [ngModel]="selected ? getDisplayProperty() : \'\'"\n [placeholder]="placeholder | translate"\n (blur)="doBlur()"\n [name]="name"\n [disabled]="disabled"\n title="{{ placeholder | translate }}"\n />\n\n <span\n class="label label-info p-absolute"\n style="top: 10px; right: 40px; z-index: 10;"\n translate\n *ngIf="\n selected\n ? selected.id === null && getDisplayProperty()?.length > 0 && allowFreeEntries\n : false\n "\n >\n New\n </span>\n\n <span class="input-group-btn">\n <button\n type="button"\n class="btn btn-clean"\n [disabled]="disabled"\n (click)="onIconClick.emit(icon)"\n >\n <i [c8yIcon]="icon"></i>\n </button>\n </span>\n </div>\n\n <c8y-list-group class="dropdown-menu dropdown-menu--modal" *dropdownMenu>\n <ng-content select="div, c8y-li, c8y-list-item, button, a"></ng-content>\n </c8y-list-group>\n</div>\n',providers:[{provide:nc.NG_VALUE_ACCESSOR,multi:!0,useExisting:t.forwardRef((function(){return n}))},{provide:nc.NG_VALIDATORS,useExisting:t.forwardRef((function(){return n})),multi:!0}]})],e)}(),Qh=function(){function e(){}return e=jc([t.NgModule({imports:[l.BsDropdownModule.forRoot(),Uu,Eh,xp],exports:[Jh,Xh],declarations:[Jh,Xh]})],e)}(),ef=function(){function e(e){this.sanitizer=e,this.config={}}return Object.defineProperty(e.prototype,"inlineStyle",{get:function(){return this.config=this.config||{},this.config.min||(this.config.min=0),this.config.max||(this.config.max=100),this.config.fractionSize&&(this.config.current=parseFloat(this.config.current.toFixed(this.config.fractionSize))),this.sanitizer.bypassSecurityTrustStyle("\n --range-min: "+this.config.min+";\n --range-max: "+this.config.max+";\n --full-range: "+(this.config.max-this.config.min)+";\n --measurement-target: "+100*(this.config.target-this.config.min)/(this.config.max-this.config.min)+"%;\n --measurement-current: "+100*(this.config.current-this.config.min)/(this.config.max-this.config.min)+"%;\n --range-y-min: "+100*(this.config.yellowRangeMin-this.config.min)/(this.config.max-this.config.min)+"%;\n --range-y-max: "+(this.config.yellowRangeMax-this.config.min)/(this.config.max-this.config.min)*100+"%;\n --range-r-min: "+100*(this.config.redRangeMin-this.config.min)/(this.config.max-this.config.min)+"%;\n --range-r-max: "+(this.config.redRangeMax-this.config.min)/(this.config.max-this.config.min)*100+"%;\n ")},enumerable:!0,configurable:!0}),e.prototype.checkTarget=function(){return void 0!==this.config.target&&this.config.target>=this.config.min&&this.config.target<=this.config.max},e.prototype.rulerCalc=function(e){var t=this.config.min+(this.config.max-this.config.min)/10*e;return this.config.fractionSize?parseFloat(t.toFixed(this.config.fractionSize)):parseFloat(t.toFixed(2))},e.prototype.trackByIndex=function(e,t){return e},e.prototype.isRedRangeDisplayed=function(){var e=this.config,t=e.redRangeMin,n=e.redRangeMax;return this.isRangeDisplayed(t,n)},e.prototype.isYellowRangeDisplayed=function(){var e=this.config,t=e.yellowRangeMin,n=e.yellowRangeMax;return this.isRangeDisplayed(t,n)},e.prototype.isRangeDisplayed=function(e,t){return 0===e||0===t||e&&t},e.ctorParameters=function(){return[{type:pc.DomSanitizer}]},jc([t.Input()],e.prototype,"config",void 0),jc([t.HostBinding("attr.style")],e.prototype,"inlineStyle",null),e=jc([t.Component({selector:"c8y-range-display",template:'<div [ngClass]="{ \'range-display--vertical\': config.orientation === \'vertical\' }">\n <div class="range-display">\n <div class="range-display__range">\n <div class="range-display__range__unit">\n {{ config.unit }}\n </div>\n <div *ngIf="isRedRangeDisplayed()" class="range-display__range__max"></div>\n <div\n *ngIf="isYellowRangeDisplayed()"\n class="range-display__range__min"\n ></div>\n <div\n *ngIf="checkTarget()"\n class="range-display__range__target"\n attr.data-label="{{ config.target }} {{ config.unit }}"\n title="{{ \'Target\' | translate }}: {{ config.target }} {{ config.unit }}"\n ></div>\n <div\n *ngIf="\n config.current != undefined &&\n config.current >= config.min &&\n config.current <= config.max\n "\n class="range-display__range__current"\n attr.data-label="{{ config.current }} {{ config.unit }} &#xa; {{ config.time | c8yDate }}"\n title="{{ \'Current\' | translate }}: {{ config.current }} {{ config.unit }} | {{ config.time | c8yDate }}"\n ></div>\n </div>\n <div class="range-display__ruler">\n <div\n *ngFor="let x of [].constructor(10); let index = index; trackBy: trackByIndex"\n attr.data-label="{{rulerCalc(index)}}"\n class="range-display__tick"\n ></div>\n <div attr.data-label="{{ config.max || 100 | number }}" class="range-display__tick"></div>\n </div>\n </div>\n</div>'})],e)}(),tf=function(){function e(){}return e=jc([t.NgModule({imports:[Uu],exports:[ef],declarations:[ef],entryComponents:[ef]})],e)}(),nf=function(){function e(){}var n;return n=e,e.forRoot=function(){return{ngModule:n,providers:Oc(Uu.providers(),Hp.providers())}},e=n=jc([t.NgModule({exports:[Gu,Wu,ed,Th,Jp,hd,Uu,Gh,em,Mp,Hp,Ud,Bd,Np,Jd,Qh,Wp,Lp,xp,Tm,Nm,yh,oh,dh,Eh,Zh,nm,om,Vd,zh,Kh,tf]})],e)}(),af=function(){function e(){this.classes=""}return e.prototype.ngOnInit=function(){this.classes="card-block text-center "+s.kebabCase(this.label)},jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"label",void 0),e=jc([t.Component({selector:"c8y-quick-link",template:'<div [class]="classes" title="{{ label | translate }}">\r\n <h1 class="text-gray-darker">\r\n <i [c8yIcon]="icon" class="c8y-icon-duocolor"></i>\r\n </h1>\r\n <p class="text-muted">{{ label | translate }}</p>\r\n</div>\r\n'})],e)}(),of=function(){function e(){}return e=jc([t.NgModule({declarations:[af],imports:[nf],exports:[af],providers:[]})],e)}(),sf=new t.InjectionToken("Dynamic Provider Config"),rf=function(){function e(e,t){this.injector=t,this.config=s.flatten(e)}return e.prototype.get=function(){var e=this;if(this.config&&this.config.length){if(!this.nodes){var t=this.config.map((function(t){return t.navigation.canActivate&&t.navigation.canActivate.length?e.getGuards(t):void 0})).map(this.checkCanActivate.bind(this));return a.forkJoin(t).pipe(o.map((function(t){return e.config.map((function(e,n){return t[n]?new td(e.navigation):void 0})).filter((function(e){return!!e}))})),o.tap((function(t){return e.nodes=t})))}return this.nodes}},e.prototype.checkCanActivate=function(e){if(e&&e.length){var t=e.map((function(e){return e.canActivate(void 0,void 0)})).map(this.wrapIntoObservable.bind(this));return a.forkJoin(t).pipe(o.map((function(e){return e.reduce((function(e,t){return e&&t}))})))}return a.of(!0)},e.prototype.isPromise=function(e){return!!e&&"function"==typeof e.then},e.prototype.wrapIntoObservable=function(e){return a.isObservable(e)?e:this.isPromise(e)?a.from(e):a.of(e)},e.prototype.getGuards=function(e){var t=this;return e.tab&&e.tab.canActivate&&e.tab.canActivate.length?Oc(e.navigation.canActivate.map((function(e){return t.injector.get(e)})),e.tab.canActivate.map((function(e){return t.injector.get(e)}))):e.navigation.canActivate.map((function(e){return t.injector.get(e)}))},e.prototype.getNodeTabPath=function(e,t){return e.replace(/^\/|\/$/g,"")+"/"+t.replace(/^\/|\/$/g,"")},e.ctorParameters=function(){return[{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[sf]}]},{type:t.Injector}]},e=jc([t.Injectable(),wc(0,t.Optional()),wc(0,t.Inject(sf))],e)}(),lf=function(e){function a(t,n){var a=e.call(this,t)||this;return a.baseUrl=s.get(n,"snapshot.data.endpoint.configurationEndpoint.baseUrl"),a.listUrl=s.get(n,"snapshot.data.endpoint.configurationEndpoint.listUrl"),a}var o;return vc(a,e),o=a,a.prototype.detail=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){return[2,e.prototype.detail.call(this,o.NO_DETAIL_ID)]}))}))},a.prototype.update=function(t){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(n){return[2,e.prototype.update.call(this,t)]}))}))},a.prototype.delete=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){return[2,e.prototype.delete.call(this,o.NO_DETAIL_ID)]}))}))},a.prototype.getDetailUrl=function(e){return this.listUrl},a.NO_DETAIL_ID=null,a.ctorParameters=function(){return[{type:m.FetchClient},{type:n.ActivatedRoute}]},a=o=jc([t.Injectable()],a)}(m.Service),cf=function(e){function a(t,n){var a=e.call(this,t)||this;return a.baseUrl=s.get(n,"snapshot.data.endpoint.definitionsEndpoint.baseUrl"),a.listUrl=s.get(n,"snapshot.data.endpoint.definitionsEndpoint.listUrl"),a}return vc(a,e),a.prototype.list=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){return[2,e.prototype.list.call(this)]}))}))},a.ctorParameters=function(){return[{type:m.FetchClient},{type:n.ActivatedRoute}]},a=jc([t.Injectable()],a)}(m.Service),uf=function(){function r(e,t,n,s,r,l,i){var c=this;this.permissions=e,this.activatedRoute=t,this.modalService=n,this.alertService=s,this.providerDefinitionsService=r,this.providerConfigurationService=l,this.jsonschema=i,this.layout$=this.activatedRoute.data.pipe(o.map((function(e){return e.layout})),o.tap((function(e){return c.layout=e})),o.tap((function(e){c.options.formState.disabled=!c.permissions.hasAllRoles(e.saveRoles),c.beforeSaveHook=e.beforeSaveHook}))),this.allRoles$=this.layout$.pipe(o.map((function(e){return Oc(e.deleteRoles||[],e.saveRoles||[])}))),this.changeProvider$=new a.BehaviorSubject(null),this.providerInput$=new a.BehaviorSubject(""),this.form=new nc.FormGroup({}),this.fields=[],this.options={formState:{disabled:!1}},this.reload$=new a.BehaviorSubject(null),this.updatedConfiguration$=new a.Subject}return r.prototype.ngOnInit=function(){var e=this,t=a.from(this.providerDefinitionsService.list()).pipe(o.map((function(e){return e.data})),o.shareReplay(1));this.providers$=a.combineLatest(t,this.providerInput$).pipe(o.map((function(e){var t=Pc(e,2),n=t[0],a=t[1];return a?n.filter((function(e){return e.displayName.toLowerCase().indexOf(a.toLowerCase())>=0})):n})),o.shareReplay(1)),this.configuration$=a.merge(this.updatedConfiguration$,this.reload$.pipe(o.switchMap((function(){return a.from(e.providerConfigurationService.detail()).pipe(o.catchError((function(){return a.of({})})))})),o.map((function(e){return e.data})))).pipe(o.map(this.removeEncryptedValues),o.shareReplay(1)),this.selectedProvider$=a.combineLatest(t,this.configuration$,this.changeProvider$).pipe(o.tap((function(t){var n=Pc(t,3),a=(n[0],n[1]),o=n[2];return e.model=o?s.pick(e.model,"sms.senderName","sms.senderAddress"):a})),o.map((function(t){var n=Pc(t,3),a=n[0],o=n[1];return n[2]||s.find(a,(function(t){return e.matchProvider(t,o)}))})),o.tap((function(t){if(t){var n=e.jsonschema.toFieldConfig(s.get(t,"schema"));n.fieldGroup&&n.fieldGroup.forEach((function(e){ic.ɵdefineHiddenProp(e,"_keyPath",{key:e.key,path:[e.key]}),e.expressionProperties={"templateOptions.disabled":"formState.disabled"}})),e.fields=[n],e.form=new nc.FormGroup({})}})),o.shareReplay(1))},r.prototype.saveProviderConfiguration=function(){return Sc(this,void 0,void 0,(function(){var e,t,n,a;return Cc(this,(function(o){switch(o.label){case 0:return this.beforeSaveHook?[4,this.beforeSaveHook(this.model,this.fields)]:[3,2];case 1:return t=o.sent(),[3,3];case 2:t=this.model,o.label=3;case 3:e=t,o.label=4;case 4:return o.trys.push([4,6,,7]),[4,this.providerConfigurationService.update(e)];case 5:return n=o.sent(),this.changeProvider$.next(null),this.updatedConfiguration$.next(n.data),this.alertService.success(this.layout.configurationUpdatedSuccessMsg),this.form.markAsPristine(),[3,7];case 6:return a=o.sent(),this.alertService.addServerFailure(a),[3,7];case 7:return[2]}}))}))},r.prototype.deleteProviderConfiguration=function(){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,this.modalService.confirm(this.layout.deleteConfigurationModalTitle,this.layout.deleteConfigurationModalBody,e.Status.DANGER,{ok:this.layout.deleteConfigurationModalOkBtnLabel,cancel:this.layout.deleteConfigurationModalCancelBtnLabel})];case 1:return n.sent(),[4,this.providerConfigurationService.delete()];case 2:return n.sent(),this.reload$.next(),this.alertService.success(this.layout.configurationDeletedSuccessMsg),[3,4];case 3:return(t=n.sent())&&this.alertService.addServerFailure(t),[3,4];case 4:return[2]}}))}))},r.prototype.removeEncryptedValues=function(e){return s.mapValues(e,(function(e){return"<<Encrypted>>"===e?void 0:e}))},r.prototype.matchProvider=function(e,t){return s.get(t,"provider")===e.id||s.get(t,"providerName")===e.id},r.ctorParameters=function(){return[{type:Su},{type:n.ActivatedRoute},{type:Fd},{type:Yu},{type:cf},{type:lf},{type:Wm}]},r=jc([t.Component({selector:"c8y-sms-gateway",template:'<c8y-title>\n {{ (layout$ | async).pageTitle | translate }}\n</c8y-title>\n\n<div class="row">\n <div class="col-md-8 col-xs-12">\n <form class="card card--fullpage" (ngSubmit)="saveProviderConfiguration()">\n <div class="card-header separator">\n <h4 class="card-title">\n {{ (layout$ | async).cardTitle | translate }}\n </h4>\n </div>\n <div class="inner-scroll">\n <div class="card-block">\n <p *ngIf="!!(layout$ | async).description" class="m-b-8">\n {{ (layout$ | async).description | translate }}\n </p>\n <c8y-form-group>\n <label for="providerName">{{ (layout$ | async).providerName | translate }}</label>\n <c8y-typeahead\n [disabled]="!permissions.hasAllRoles((layout$ | async).saveRoles)"\n [ngModel]="selectedProvider$ | async"\n [displayProperty]="\'displayName\'"\n name="providerName"\n placeholder="{{ (layout$ | async).providerNamePlaceholder | translate }}"\n (onSearch)="providerInput$.next($event)"\n [allowFreeEntries]="false"\n [required]="true"\n [container]="\'body\'"\n >\n <c8y-li\n *ngFor="let provider of providers$ | async"\n class="p-l-8 p-r-8 c8y-list__item--link"\n (click)="changeProvider$.next(provider); providerInput$.next(\'\')"\n [active]="(selectedProvider$ | async) === provider"\n >\n <c8y-highlight\n [text]="provider.displayName || \'--\'"\n [pattern]="providerInput$ | async"\n ></c8y-highlight>\n </c8y-li>\n </c8y-typeahead>\n <c8y-messages\n ><c8y-message\n name="notExisting"\n [text]="(layout$ | async).providerNameNoMatchesHint | translate"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <formly-form\n *ngIf="selectedProvider$ | async"\n [form]="form"\n [fields]="fields"\n [model]="model"\n [options]="options"\n ></formly-form>\n </div>\n </div>\n <div class="card-footer separator" *c8yIfAllowed="allRoles$ | async; allowAny">\n <button\n *c8yIfAllowed="(layout$ | async).deleteRoles"\n class="btn btn-default"\n type="button"\n (click)="deleteProviderConfiguration()"\n [disabled]="\n !(configuration$ | async)?.provider && !(configuration$ | async)?.providerName\n "\n title="{{ (layout$ | async).deleteBtnLabel | translate }}"\n >\n {{ (layout$ | async).deleteBtnLabel | translate }}\n </button>\n <button\n *c8yIfAllowed="(layout$ | async).saveRoles"\n class="btn btn-primary"\n type="submit"\n [disabled]="form.invalid || form.pristine"\n title="{{ (layout$ | async).saveBtnLabel | translate }}"\n >\n {{ (layout$ | async).saveBtnLabel | translate }}\n </button>\n </div>\n </form>\n </div>\n</div>\n',providers:[lf,cf]})],r)}(),df=function(){function e(e){this.config=s.flatten(e)}return e.prototype.get=function(){var e=s.uniqBy(this.config.filter((function(e){return e.tab})),"navigation.path").map((function(e){return{path:e.navigation.path,component:gc.ConditionalTabsOutletComponent}})),t=this.config.map((function(e){return{path:e.tab?e.navigation.path.replace(/^\/|\/$/g,"")+"/"+e.tab.path.replace(/^\/|\/$/g,""):e.navigation.path,component:uf,canActivate:Oc(e.navigation.canActivate||[],s.get(e,"tab.canActivate")||[]).filter((function(e){return!!e})),data:{layout:e.layout,endpoint:e.endpoint}}}));return Oc(e,t)},e.ctorParameters=function(){return[{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[sf]}]}]},e=jc([t.Injectable(),wc(0,t.Optional()),wc(0,t.Inject(sf))],e)}(),pf=function(){function e(e,t,n){this.router=t,this.injector=n,this.config=s.flatten(e)}return e.prototype.get=function(){var e=this;if(this.config&&this.config.length){var t=this.config.find((function(t){return!!t.tab&&(e.router.url==="/"+e.getNodeTabPath(t.navigation.path,t.tab.path)||e.router.url.startsWith("/"+t.navigation.path.replace(/^\/|\/$/g,"")))})),n=t?this.config.filter((function(e){return e.navigation.path.replace(/^\/|\/$/g,"")===t.navigation.path.replace(/^\/|\/$/g,"")&&e.tab})):[],s=n.map((function(t){return t.tab.canActivate&&t.tab.canActivate.length?t.tab.canActivate.map((function(t){return e.injector.get(t)})):void 0})).map(this.checkCanActivate.bind(this));return s.length>0?a.forkJoin(s).pipe(o.map((function(t){return n.map((function(n,a){var o=bc({},n.tab,{path:e.getNodeTabPath(n.navigation.path,n.tab.path)});return t[a]?o:void 0})).filter((function(e){return!!e}))}))):[]}},e.prototype.checkCanActivate=function(e){if(e&&e.length){var t=e.map((function(e){return e.canActivate(void 0,void 0)})).map(this.wrapIntoObservable.bind(this));return a.forkJoin(t).pipe(o.map((function(e){return e.reduce((function(e,t){return e&&t}))})))}return a.of(!0)},e.prototype.isPromise=function(e){return!!e&&"function"==typeof e.then},e.prototype.wrapIntoObservable=function(e){return a.isObservable(e)?e:this.isPromise(e)?a.from(e):a.of(e)},e.prototype.getNodeTabPath=function(e,t){return e.replace(/^\/|\/$/g,"")+"/"+t.replace(/^\/|\/$/g,"")},e.ctorParameters=function(){return[{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[sf]}]},{type:n.Router},{type:t.Injector}]},e=jc([t.Injectable(),wc(0,t.Optional()),wc(0,t.Inject(sf))],e)}(),mf=function(){function e(){}var n;return n=e,e.config=function(e){return{ngModule:n,providers:[{provide:sf,useValue:e,multi:!0}]}},e=n=jc([t.NgModule({declarations:[uf],exports:[uf],imports:[nf,Uu,Qm],entryComponents:[uf],providers:[{provide:im,useClass:t.forwardRef((function(){return df})),multi:!0},{provide:ad,useClass:t.forwardRef((function(){return rf})),multi:!0},{provide:rd,useClass:t.forwardRef((function(){return pf})),multi:!0}]})],e)}(),hf=function(){},ff=function(){function e(e){this.realtime=e,this.subjects$=new Map,this.isActive=!0}return Object.defineProperty(e.prototype,"active",{get:function(){return this.isActive},enumerable:!0,configurable:!0}),e.prototype.onAll$=function(e){var t=this,n=this.getSubjectForChannel(e);return n.pipe(o.finalize((function(){1===n.observers.length&&n.observers[0].closed&&(n.stop(),t.subjects$.delete(n.channel))})))},e.prototype.start=function(){this.isActive||(this.subjects$.forEach((function(e){e.start()})),this.isActive=!0)},e.prototype.stop=function(){this.isActive&&(this.subjects$.forEach((function(e){e.stop()})),this.isActive=!1)},e.prototype.onCreate$=function(){return this.onAll$().pipe(o.filter((function(e){return"CREATE"===e.realtimeAction})),o.map((function(e){return e.data})))},e.prototype.onUpdate$=function(e){return this.onAll$(e).pipe(o.filter((function(e){return"UPDATE"===e.realtimeAction})),o.map((function(e){return e.data})))},e.prototype.onDelete$=function(e){return this.onAll$(e).pipe(o.filter((function(e){return"DELETE"===e.realtimeAction})),o.map((function(e){return ec.coerceNumberProperty(e.data)})))},e.prototype.getIdString=function(e){var t;return t="object"==typeof e?e.id:e,String(t)},e.prototype.getChannel=function(e){return e?this.channel().replace("*",this.getIdString(e)):this.channel()},e.prototype.getSubjectForChannel=function(e){var t,n=this.getChannel(e);return this.subjects$.has(n)?t=this.subjects$.get(n):(t=new gf(n,this.realtime),this.subjects$.set(n,t)),t},e}(),gf=function(e){function t(t,n){var a=e.call(this)||this;return a.realtimeChannel=t,a.realtime=n,a.start(),a}return vc(t,e),Object.defineProperty(t.prototype,"channel",{get:function(){return this.realtimeChannel},enumerable:!0,configurable:!0}),t.prototype.start=function(){var e=this;this.realtimeSubscription||(this.realtimeSubscription=this.realtime.subscribe(this.realtimeChannel,(function(t){var n={channel:t.channel,data:t.data.data,id:t.id,realtimeAction:t.data.realtimeAction};e.next(n)})))},t.prototype.stop=function(){this.realtimeSubscription&&(this.realtime.unsubscribe(this.realtimeSubscription),this.realtimeSubscription=null)},t}(a.Subject),yf=function(e){function n(t){return e.call(this,t)||this}return vc(n,e),n.prototype.channel=function(){return"/bulkOperations/*"},n.ctorParameters=function(){return[{type:m.Realtime}]},n=jc([t.Injectable()],n)}(ff),vf=function(e){function n(t){return e.call(this,t)||this}return vc(n,e),n.prototype.channel=function(){return"/managedobjects/*"},n.ctorParameters=function(){return[{type:m.Realtime}]},n=jc([t.Injectable()],n)}(ff);e.ActionBarComponent=Bu,e.ActionBarItemComponent=Mc,e.ActionBarModule=Gu,e.ActionBarService=Lc,e.ActionComponent=Ku,e.ActionModule=Wu,e.ActionOutletComponent=Vu,e.ActionService=zu,e.AlertComponent=Ju,e.AlertDetailsComponent=Zu,e.AlertModule=ed,e.AlertOutletComponent=Xu,e.AlertService=Yu,e.AlertTextComponent=Qu,e.AppIconComponent=Td,e.AppStateService=Uc,e.AppSwitcherComponent=kd,e.ApplicationOptions=Rc,e.AuthenticationModule=Np,e.BootstrapComponent=id,e.BootstrapModule=Jp,e.BreadcrumbComponent=md,e.BreadcrumbItemComponent=cd,e.BreadcrumbModule=hd,e.BreadcrumbOutletComponent=ud,e.BreadcrumbService=pd,e.C8yJSONSchema=Wm,e.C8yStepper=mh,e.C8yStepperButtons=fh,e.C8yStepperIcon=ph,e.C8yStepperProgress=hh,e.C8yTranslateDirective=eu,e.C8yTranslateModule=nu,e.C8yTranslatePipe=tu,e.CachedLocaleDictionaryService=Zc,e.CellRendererComponent=Uh,e.CellRendererContext=Ah,e.CellRendererDefDirective=_h,e.ChangePasswordComponent=Rp,e.ColumnDirective=Mh,e.CommonModule=Uu,e.ConditionalTabsOutletComponent=Kp,e.ConfirmModalComponent=qd,e.ContextRouteComponent=um,e.ContextRouteGuard=hm,e.ContextRouteService=lm,e.CookieBannerComponent=Zp,e.CoreModule=nf,e.CredentialsComponent=qp,e.DashboardChildActionComponent=sh,e.DashboardChildChange=ih,e.DashboardChildComponent=ch,e.DashboardChildTitleComponent=rh,e.DashboardComponent=lh,e.DashboardModule=dh,e.DataGridComponent=Fh,e.DataGridModule=Gh,e.DatePickerComponent=am,e.DatePickerModule=om,e.DatePipe=hu,e.DefaultValidationDirective=mp,e.DeviceStatusComponent=km,e.DeviceStatusModule=Tm,e.DocsModule=Nm,e.DocsService=xd,e.DropAreaComponent=Xp,e.DropAreaModule=em,e.DynamicComponentComponent=ah,e.DynamicComponentModule=oh,e.DynamicComponentService=nh,e.DynamicFormsModule=Qm,e.ES_MAX_TIME_MILLISECONDS=864e13,e.EmptyComponent=fm,e.FilePickerComponent=tm,e.FilePickerModule=nm,e.FilterInputComponent=Pp,e.FilteringFormRendererComponent=Bh,e.FilteringFormRendererContext=Dh,e.FilteringFormRendererDefDirective=Lh,e.ForOfDirective=gu,e.FormGroupComponent=vp,e.FormsModule=xp,e.GainsightService=Hd,e.GridDataSource=qh,e.GuideDocsComponent=_m,e.GuideHrefDirective=Am,e.HOOK_ACTION=Hu,e.HOOK_ACTION_BAR=Dc,e.HOOK_BREADCRUMB=dd,e.HOOK_COMPONENT=th,e.HOOK_COMPONENTS=eh,e.HOOK_DOCS=Od,e.HOOK_DYNAMIC_PROVIDER_CONFIG=sf,e.HOOK_NAVIGATOR_NODES=ad,e.HOOK_ONCE_ROUTE=im,e.HOOK_OPTIONS=qc,e.HOOK_PATTERN_MESSAGES=Hc,e.HOOK_SEARCH=Sd,e.HOOK_TABS=rd,e.HeaderBarComponent=Ed,e.HeaderCellRendererDefDirective=Nh,e.HeaderModule=Mp,e.HeaderService=sd,e.HelpComponent=Hh,e.HelpModule=zh,e.HighlightComponent=Yd,e.HumanizeAppNamePipe=yu,e.HumanizePipe=vu,e.I18nModule=cu,e.ICONS=ju,e.ICON_LIST=Fu,e.IconDirective=bu,e.InputGroupListComponent=bp,e.InputGroupListContainerDirective=jp,e.IpRangeInputListComponent=Ip,e.JsonValidationPrettifierDirective=wp,e.LANGUAGES=Bc,e.LOCALE_PATH=Gc,e.ListGroupComponent=Ph,e.ListGroupModule=Eh,e.ListItemActionComponent=vh,e.ListItemBodyComponent=Sh,e.ListItemCheckboxComponent=xh,e.ListItemCollapseComponent=bh,e.ListItemComponent=wh,e.ListItemFooterComponent=jh,e.ListItemIconComponent=Oh,e.ListItemRadioComponent=Ch,e.ListItemTimelineComponent=Ih,e.LoadMoreComponent=fu,e.LoadingComponent=Iu,e.LoginComponent=$p,e.LoginModule=Hp,e.LoginService=ep,e.MESSAGES=Yc,e.ManagedObjectRealtimeService=vf,e.MapFunctionPipe=Pu,e.MaxValidationDirective=fp,e.MessageDirective=gp,e.MessagesComponent=yp,e.MinValidationDirective=hp,e.MissingTranslationCustomHandler=Vc,e.ModalComponent=$d,e.ModalModule=Ud,e.ModalService=Fd,e.NavigatorIconComponent=gd,e.NavigatorItemComponent=fd,e.NavigatorModule=Bd,e.NavigatorNode=td,e.NavigatorNodeComponent=vd,e.NavigatorNodeRoot=nd,e.NavigatorOutletComponent=Ad,e.NavigatorService=od,e.NewPasswordComponent=up,e.OperationBulkRealtimeService=yf,e.OptionsService=$c,e.OutletDirective=Ou,e.PasswordCheckListComponent=rp,e.PasswordConfirm=lp,e.PasswordConfirmModalComponent=tp,e.PasswordService=np,e.PasswordStrengthCheckerService=ip,e.PasswordStrengthComponent=cp,e.PasswordStrengthValidatorDirective=Gp,e.PatternMessagesService=zc,e.Permissions=Su,e.PhoneValidationDirective=dp,e.PopoverConfirmComponent=yd,e.ProductExperienceDirective=zd,e.ProductExperienceModule=Vd,e.ProgressBarComponent=xu,e.ProviderConfigurationComponent=uf,e.ProviderConfigurationModule=mf,e.ProviderConfigurationNodeFactory=rf,e.ProviderConfigurationRouteFactory=df,e.ProviderConfigurationService=lf,e.ProviderDefinitionsService=cf,e.QuickLinkComponent=af,e.QuickLinkModule=of,e.RangeDisplayComponent=ef,e.RangeDisplayModule=tf,e.RealtimeButtonComponent=Vh,e.RealtimeMessage=hf,e.RealtimeModule=Kh,e.RealtimeService=ff,e.RecoverPasswordComponent=Fp,e.RequiredInputPlaceholderDirective=Cp,e.RightDrawerComponent=bd,e.RouterModule=Pm,e.RouterService=cm,e.RouterTabsResolver=sm,e.SearchComponent=Wd,e.SearchModule=Jd,e.SearchOutletComponent=Kd,e.SearchResultEmptyComponent=Zd,e.SearchService=Cd,e.SelectComponent=Jh,e.SelectModalComponent=Wh,e.SelectModalFilterPipe=Yh,e.SelectModalModule=Zh,e.SelectModule=Qh,e.ShortenUserNamePipe=Eu,e.SmsChallengeComponent=kp,e.StateService=Nc,e.StepperModule=yh,e.StrengthValidatorService=Bp,e.TabComponent=zp,e.TabsModule=Wp,e.TabsOutletComponent=Vp,e.TabsService=ld,e.TenantUiService=ku,e.TextAreaRowHeightDirective=Sp,e.TitleComponent=wd,e.TitleOutletComponent=jd,e.TotpAuthComponent=Up,e.TotpChallengeComponent=Ep,e.TotpSetupComponent=Tp,e.TranslateCustomLoader=Jc,e.TranslateParserCustom=Qc,e.TranslateService=mu,e.TypeaheadComponent=Xh,e.UserEditComponent=op,e.UserEditModalComponent=Qd,e.UserMenuItemComponent=Xd,e.UserMenuOutletComponent=sp,e.UserMenuService=Id,e.UserModule=Lp,e.UserPreferencesService=_u,e.UserPreferencesStorageInventory=Au,e.UserPreferencesStorageLocal=Tu,e.UserTotpRevokeComponent=Dp,e.UserTotpSetupComponent=ap,e.ValidationPattern=pp,e.ViewContextServices=rm,e.WidgetsDashboardComponent=uh,e._=function(e){return e},e.deviceAvailabilityIconMap=Om,e.fromFactories=Ec,e.fromTrigger=xc,e.getActivatedRoute=_c,e.getAngularLocalesLanguageString=iu,e.gettext=Kc,e.initializeServices=Nu,e.languagesFactory=ru,e.loadLocale=pu,e.localeId=lu,e.localePathFactory=su,e.memoize=wu,e.minColumnGridTrackSize=80,e.operationStatusClasses=Rd,e.operationStatusIcons=Md,e.parse=uu,e.ratiosByColumnTypes=Rh,e.resolveInjectedFactories=kc,e.routes=gm,e.sortByPriority=Ac,e.stateToFactory=Tc,e.statusAlert=Ld,e.statusClasses=Dd,e.statusIcons=Nd,e.throttle=Fc,e.tooltips=Em,e.translateLoaderFactory=ou,e.trimTranslationKey=Xc,e.ɵ0=xm,e.ɵa=Cu,e.ɵb=Gd,e.ɵba=pf,e.ɵc=Yp,e.ɵd=Op,e.ɵe=_p,e.ɵf=np,e.ɵg=Km,e.ɵh=Hm,e.ɵi=zm,e.ɵj=Xm,e.ɵk=Ym,e.ɵl=Um,e.ɵm=Bm,e.ɵn=Gm,e.ɵo=Lm,e.ɵp=Dm,e.ɵq=Rm,e.ɵr=Mm,e.ɵs=qm,e.ɵt=Fm,e.ɵu=$m,e.ɵv=Th,e.ɵw=kh,e.ɵx=im,e.ɵy=ad,e.ɵz=rd,Object.defineProperty(e,"__esModule",{value:!0})}));
16
+ var yc=function(e,t){return(yc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function vc(e,t){function n(){this.constructor=e}yc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var bc=function(){return(bc=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function jc(e,t,n,a){var o,s=arguments.length,r=s<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,a);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(s<3?o(r):s>3?o(t,n,r):o(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r}function wc(e,t){return function(n,a){t(n,a,e)}}function Sc(e,t,n,a){return new(n||(n=Promise))((function(o,s){function r(e){try{i(a.next(e))}catch(e){s(e)}}function l(e){try{i(a.throw(e))}catch(e){s(e)}}function i(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}i((a=a.apply(e,t||[])).next())}))}function Cc(e,t){var n,a,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function l(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(o=2&s[0]?a.return:s[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,s[1])).done)return o;switch(a=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,a=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e],a=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function Ic(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],a=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pc(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a,o,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(a=s.next()).done;)r.push(a.value)}catch(e){o={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return r}function Oc(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Pc(arguments[t]));return e}function xc(e,t,a){return e.events.pipe(o.filter((function(e){return e instanceof n.NavigationEnd})),o.merge(t),o.startWith(1),o.switchMap((function(){return Ec(a,e)})))}function Ec(e,t,n){return void 0===n&&(n=!0),!Array.isArray(e)||e.length<1?a.of([]):a.defer((function(){var r=kc(e).map((function(e){return function(e,t){var n;if(!e)return a.of([]);if("function"==typeof e.then||a.isObservable(e))if(t){var s=a.from(e),r=s.pipe(o.startWith([]));n=a.race(s,r)}else n=a.from(e);else n=a.of(e);return n.pipe(o.map((function(e){return(Array.isArray(e)?e:[e]).filter((function(e){return!!e}))})))}(Array.isArray(e)?e:e&&s.isFunction(e.get)?e.get(_c(t)):[e],n)}));return a.combineLatest.apply(void 0,Oc(r))})).pipe(o.map((function(e){return Ac([].concat.apply([],Oc(e)))})))}function kc(e){return s.flatten(e.map((function(e){return s.isFunction(e)?e():[e]})))}function Tc(e){var t=e.pipe(o.map((function(e){return Array.from(e)})));return{get:function(){return t}}}function Ac(e){return s.sortBy(e,"priority")}function _c(e){if(e&&e.routerState&&e.routerState.root){for(var t=e.routerState.root;t.firstChild;)t=t.firstChild;return t}}var Nc=function(){function e(){}return e.prototype.map=function(e){return this.state$.pipe(o.map(e),o.distinctUntilChanged())},e.prototype.emitNewState=function(){this.state$.next(this.state)},e}(),Dc=new t.InjectionToken("ActionBarFactory"),Lc=function(e){function s(t,n){var s=e.call(this)||this;return s.injector=t,s.refreshTrigger=new a.Subject,s.state$=new a.BehaviorSubject(new Set),s.items$=xc(n,s.refreshTrigger,[function(){return s.injector.get(Dc,[])},Tc(s.state$)]).pipe(o.map((function(e){return Ac(e)})),o.shareReplay(1)),s}return vc(s,e),Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.refresh=function(){this.refreshTrigger.next()},s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),Mc=function(){function e(e){this.actionBarService=e,this.placement="left",this.priority=0,this.itemClass=""}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.actionBarService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.actionBarService.remove(this)},e.ctorParameters=function(){return[{type:Lc}]},jc([t.Input()],e.prototype,"placement",void 0),jc([t.Input()],e.prototype,"priority",void 0),jc([t.Input()],e.prototype,"itemClass",void 0),jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=jc([t.Component({selector:"c8y-action-bar-item",template:'<ng-template #template>\n <li class="{{itemClass}}">\n <ng-content></ng-content>\n </li>\n</ng-template>'})],e)}(),Rc=function(){},qc=new t.InjectionToken("App options"),$c=function(e){function n(t,n,a){var o=e.call(this)||this;return o.systemOptionsService=n,o.tenantOptionService=a,o.setupOptions(t),o}return vc(n,e),n.prototype.get=function(e,t){var n=this[e];return void 0===n&&(n=this[s.camelCase(e)]),void 0!==n?n:t},n.prototype.set=function(e,t){this[s.camelCase(e)]=t},n.prototype.getSupportUrl=function(){return Sc(this,void 0,void 0,(function(){var e,t,n;return Cc(this,(function(a){switch(a.label){case 0:return[4,this.getTenantOption("configuration","system.support.url")];case 1:return e=a.sent(),s.isUndefined(e)&&(e=this.supportUrl),t=this,s.isUndefined(e)?[4,this.getSystemOption("support","url")]:[3,3];case 2:return n=a.sent()||!1,[3,4];case 3:n=e,a.label=4;case 4:return t.supportUrl=n,[2,this.supportUrl]}}))}))},n.prototype.getActivateSupportUser=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return[4,this.getSystemOption("support-user","enabled",!0)];case 1:return[2,!e.sent()]}}))}))},n.prototype.getSystemOption=function(e,t,n){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(a){return[2,this.getOptionFromService(e,t,this.systemOptionsService,n)]}))}))},n.prototype.getTenantOption=function(e,t,n){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(a){return[2,this.getOptionFromService(e,t,this.tenantOptionService,n)]}))}))},n.prototype.setupOptions=function(e){var t=this;e&&(Array.isArray(e)||(e=[e]),e.forEach((function(e){e&&Object.keys(e).forEach((function(n){t[s.camelCase(n)]=e[n]}))})))},n.prototype.getOptionFromService=function(e,t,n,a){return Sc(this,void 0,void 0,(function(){var o;return Cc(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,n.detail({category:e,key:t})];case 1:return o=s.sent().data,[2,this.parseOptionRawValue(o.value,a)];case 2:return s.sent(),[2,a];case 3:return[2]}}))}))},n.prototype.parseOptionRawValue=function(e,t){var n;try{n=JSON.parse(e)}catch(a){n=s.isUndefined(e)?t:e}return n},n.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[qc]}]},{type:c.SystemOptionsService},{type:c.TenantOptionsService}]},n=jc([t.Injectable(),wc(0,t.Optional()),wc(0,t.Inject(qc))],n)}(Rc);function Fc(e,t){return function(n,a,o){var r=o.value;o.value=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var l="_"+a+"Throttled";return this[l]||(this[l]=s.throttle(r,e,t)),this[l].apply(this,n)}}}var Uc=function(e){function n(t,n,s,r,l){var i=e.call(this)||this;return i.applicationService=t,i.apiService=n,i.options=s,i.fetchClient=r,i.tenantLoginOptionsService=l,i.state$=new a.BehaviorSubject({app:{name:i.options.name,contextPath:i.getCurrentContextPath()||i.options.contextPath},supportUrl:i.options.supportUrl,lang:i.options.get("defaultLanguage","en"),langs:i.getLangs(),langsDetail:i.options.languages,loginOptions:i.options.loginOptions,activateSupportUserAvailable:void 0,versions:{backend:void 0,ui:i.options.versions||{ngx:void 0}},hidePowered:i.options.hidePowered,isLoading:!1,showRightDrawer:i.options.rightDrawer,loginExtraLink:i.options.get("login_extra_link"),newsletter:i.options.newsletter}),i.currentSupportUserName=new a.BehaviorSubject(null),i.currentUser=new a.BehaviorSubject(null),i.currentTenant=new a.BehaviorSubject(null),i.apiService.calls.pipe(o.filter((function(e){var t=e.url;return!/notification\/realtime/.test(t)})),o.map((function(e){return"start"===e.phase?1:-1})),o.scan((function(e,t){return e+t}),0),o.map((function(e){return e>0})),o.distinctUntilChanged()).subscribe((function(e){return i.state.isLoading=e})),i.assignApplicationKeyToDefaultHeaders(),i}return vc(n,e),n.prototype.assignApplicationKeyToDefaultHeaders=function(){t.isDevMode()||(this.fetchClient.defaultHeaders=bc({},this.fetchClient.defaultHeaders||{},{"X-Cumulocity-Application-Key":this.options.key}))},Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),n.prototype.getLangs=function(){var e=this.options.languages;return e?s.keys(e).filter((function(t){return e[t]})):[]},Object.defineProperty(n.prototype,"uiVersion",{get:function(){var e=this.state.versions.ui;return e.ngx||e.ng1},enumerable:!0,configurable:!0}),n.prototype.loadManifest=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.applicationService.detail(this.state.app.contextPath+"/manifest")];case 1:return e=t.sent().data.application,this.state.app.manifest=e,this.loadDefaultOptions(),[3,3];case 2:throw t.sent();case 3:return[2]}}))}))},n.prototype.refreshLoginOptions=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return[4,this.tenantLoginOptionsService.detail()];case 1:return e=t.sent().data.loginOptions,this.state$.next(bc({},this.state,{loginOptions:e})),[2]}}))}))},n.prototype.isApplicationAvailable=function(e){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){switch(t.label){case 0:return[4,this.applicationService.listByUser(void 0,{pageSize:100})];case 1:return[2,t.sent().data.some((function(t){return t.name===e}))]}}))}))},n.prototype.setUser=function(e){this.currentSupportUserName.next(e.supportUserName||null),this.currentUser.next(e.user)},n.prototype.getCurrentContextPath=function(){var e=window.location.pathname.match(/\/apps\/(public\/){0,1}(.+?)(\/|\?|#|$)/);return e&&e[2]},n.prototype.loadDefaultOptions=function(){return Sc(this,void 0,void 0,(function(){var e,t,n;return Cc(this,(function(a){switch(a.label){case 0:return e=this.state,[4,this.options.getSupportUrl()];case 1:return e.supportUrl=a.sent(),t=this.state,[4,this.options.getActivateSupportUser()];case 2:return t.activateSupportUserAvailable=a.sent(),n=this.state.versions,[4,this.options.getSystemOption("system","version")];case 3:n.backend=a.sent();try{this.showIncompatibleVersionsError()}catch(e){}return this.emitNewState(),[2]}}))}))},n.prototype.showIncompatibleVersionsError=function(){var e=this.state.versions.ui.ngx,t=this.state.versions.backend,n=e.replace(/[^\d.]/g,"").split(".").map(Number),a=t.replace(/[^\d.]/g,"").split(".").map(Number),o=Math.pow(10,Math.ceil(Math.log10(Math.max.apply(Math,Oc(n,a))+1))),s=function(e,t){return e+t},r=function(e,t){return e*(o/Math.pow(10,t))};if(n.map(r).reduce(s)>a.map(r).reduce(s)){var l="You are running version "+e+" of the UI and version "+t+" of backend!";console.log("%c "+l,"font-weight: bold; font-size: 30px; color: red;")}},n.ctorParameters=function(){return[{type:m.ApplicationService},{type:c.ApiService},{type:$c},{type:m.FetchClient},{type:m.TenantLoginOptionsService}]},jc([Fc(600,{trailing:!1})],n.prototype,"refreshLoginOptions",null),n=jc([t.Injectable()],n)}(Nc),Bc=new t.InjectionToken("Languages"),Gc=new t.InjectionToken("Locale path"),Hc=new t.InjectionToken("Pattern Messages"),zc=function(){function e(e){var t=this;this.patterns={},this.pipes={absoluteDate:function(e){return i.formatDate(e,"medium",t.translateService.currentLang)},translate:function(e){return t.translateService.instant(e)}},s.each(e,(function(e){Object.assign(t.patterns,e)}))}return e.prototype.translate=function(e){var t=this.translateWithPatterns(e);return t!==e?t:""},e.prototype.translateWithPatterns=function(e,t){var n=this;void 0===t&&(t=this.patterns);var a=e;return s.each(t,(function(e,t){var o,r=new RegExp(t,"g");if(r.test(a)){r.test(""),o=r.exec(a);for(var l=function(){var l=Pc(o,1)[0],i=s.mapValues(e.placeholders,(function(e){var a=e.capture||e,o=l.replace(new RegExp(t,"g"),a);return e.translate&&(o=n.translateWithPatterns(o,e.translate)),o}));a=a.replace(l,n.translateWithParams(e,i)),o=r.exec(a)};null!==o;)l()}})),a},e.prototype.translateWithParams=function(e,t){void 0===t&&(t={});var n=this.translateService,a=n.defaultLang,o=n.currentLang,s=n.compiler,r=this.translateService.store.translations[o],l=this.translateService.store.translations[a],i=e.gettext,c=i;r&&(r[i]?c=r[i]:l&&l[i]&&(c=l[i]));for(var u,d=i,p=c,m=bc({},t,{noPatternMessages:!0}),h=RegExp("{{\\s*([^\\s]+)\\s*\\|\\s*([^\\s]+)\\s*}}","g");null!==(u=h.exec(i));){var f=Pc(u,3),g=f[0],y=f[1],v=f[2];this.pipes[v]&&(d=d.replace(g,"{{"+y+"}}"),p=p.replace(g,"{{"+y+"}}"),m[y]=this.pipes[v](t[y]))}return r&&(r[d]=s.compile(p,o)),this.translateService.instant(d,m)},e.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[Hc]}]}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(Hc))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"}),wc(0,t.Inject(Hc))],e)}(),Vc=function(){function e(e,t){this.parser=e,this.patternMessagesService=t,this.cache={}}return e.prototype.handle=function(e){var t=e.key,n=e.interpolateParams,a=e.translateService;this.translateService=a;var o=this.getFromCache(t,n);if(!o){var s=this.getPatternMessageTranslation(t,n);o=s||this.parser.interpolate(t,n),this.addToCache(t,n,o)}return o},e.prototype.getFromCache=function(e,t){var n=this.translateService.currentLang;return(this.cache[n]||{})[this.getCacheKey(e,t)]},e.prototype.addToCache=function(e,t,n){var a=this.translateService.currentLang;(this.cache[a]=this.cache[a]||{})[this.getCacheKey(e,t)]=n},e.prototype.getCacheKey=function(e,t){return t?e+" "+JSON.stringify(t):e},e.prototype.getPatternMessageTranslation=function(e,t){if(!t||!t.noPatternMessages)return this.patternMessagesService.translateService||(this.patternMessagesService.translateService=this.translateService),this.patternMessagesService.translate(e)},e.ctorParameters=function(){return[{type:p.TranslateParser},{type:zc}]},e=jc([t.Injectable()],e)}();function Kc(e){return e}var Wc={updatesList:{capture:"$1",translate:{"status='(.+?)'":{gettext:'status: "{{ status | translate }}"',placeholders:{status:"$1"}},"generalStatus='(.+?)'":{gettext:'general status: "{{ generalStatus | translate }}"',placeholders:{generalStatus:"$1"}},"progress='(.+?)'":{gettext:'progress: "{{ progress }}"',placeholders:{progress:"$1"}},"note=(.+?)":{gettext:'note: "{{ note }}"',placeholders:{note:"$1"}}}}},Yc={"^Access is denied$":{gettext:"Access denied."},"^Alarm created$":{gettext:"Alarm created"},"^Alarm updated$":{gettext:"Alarm updated"},"^API is not available with the new domain$":{gettext:"Could not activate custom domain. DNS setup is incorrect."},"^Application with given name already exist$":{gettext:"Application with given name already exists."},"^Application with id (.+?) is already assigned to the tenant (.+?)$":{gettext:'This application is already assigned to tenant "{{tenant}}".',placeholders:{tenant:"$2"}},"^Apply software changes: (.+?)\\.?$":{gettext:"Apply software changes: {{ softwareChanges }}",placeholders:{softwareChanges:{capture:"$1",translate:{'install "(.+?)" \\(version: (.+?)\\)':{gettext:'install "{{ softwareName }}" (version: {{ softwareVersion }})',placeholders:{softwareName:"$1",softwareVersion:"$2"}},'install "([^"]+)"(?! \\(version: .+?\\))':{gettext:'install "{{ softwareName }}"',placeholders:{softwareName:"$1"}},'delete "(.+?)" \\(version: (.+?)\\)':{gettext:'delete "{{ softwareName }}" (version: {{ softwareVersion }})',placeholders:{softwareName:"$1",softwareVersion:"$2"}},'delete "([^"]+)"(?! \\(version: .+?\\))':{gettext:'delete "{{ softwareName }}"',placeholders:{softwareName:"$1"}}}}}},"^Assign device profile (.+?) to device (.+?)$":{gettext:"Assign device profile {{profileName}} to device {{deviceName}}",placeholders:{profileName:"$1",deviceName:"$2"}},"^(.+)pplication for tenant (.+) with properties \\( (.+?) \\) already exists$":{gettext:'Application for tenant "{{tenant}}" with the following values ({{valuesList}}) already exists.',placeholders:{tenant:"$2",valuesList:"$3"}},"^Authentication failed! : User account is locked$":{gettext:"Authentication failed due to: user account is locked."},"^Availability monitoring record$":{gettext:"Availability monitoring record"},"^Can not activate a certificate which is either expired or not yet valid$":{gettext:"Cannot activate a certificate which is either expired or not yet valid."},"^Cannot add certificate - certificate with (.+?) fingerprint already exists. : Certificate with (.+?) fingerprint already exists.":{gettext:"Could not add certificate. Certificate with {{fingerprint}} fingerprint already exists.",placeholders:{fingerprint:"$1"}},"^Cannot change password. : Provided token does not exist.$":{gettext:"Cannot change password: provided token is invalid."},"^Cannot deploy module (.*)$":{gettext:'Cannot deploy module due to error: "{{ errorMessage | translate }}".',placeholders:{errorMessage:"$1"}},"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+) \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": incorrect syntax near "{{incorrectExpression}}" at line {{line}} column {{column}}.',placeholders:{moduleName:"$1",expression:"$3",incorrectExpression:"$4",line:"$5",column:"$6"}},"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+) near reserved keyword '(.+?)' \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": incorrect syntax near "{{incorrectExpression}}" at line {{line}} column {{column}} near reserved keyword "{{keyword}}".',placeholders:{moduleName:"$1",expression:"$3",incorrectExpression:"$4",line:"$5",column:"$6",keyword:"$7"}},"^Cannot deploy module (.+?)! : Compilation failed in module '(.+?)' in expression '(.+?)' : Incorrect syntax near '(.+?)' at line (\\d+) column (\\d+), please check the where clause \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": incorrect syntax near "{{incorrectExpression}}" at line {{line}} column {{column}}, check "where" clause.',placeholders:{moduleName:"$1",expression:"$3",incorrectExpression:"$4",line:"$5",column:"$6"}},"^Cannot deploy module (.+?)! : Deployment failed in module '(.+?)' in expression '(.+?)' : Exception compiling script '(.+?)' of dialect '(.+?)': missing (.+?) before statement \\((.+?)\\) \\[([\\S\\s]+?)\\]$":{gettext:'Could not deploy module "{{moduleName}}". Compilation failed in expression "{{expression}}": exception compiling script "{{scriptName}}" of dialect "{{scriptDialect}}": missing "{{missingSyntax}}" before statement "{{affectedStatement}}".',placeholders:{moduleName:"$1",expression:"$3",scriptName:"$4",scriptDialect:"$5",missingSyntax:"$6",affectedStatement:"$7"}},"^Cannot execute bulk operation on empty group. Group with id='(\\d+?)' doesn't have child assets.$":{gettext:'Could not execute bulk operation on an empty group. Group with ID "{{groupId}}" has no child assets.',placeholders:{groupId:"$1"}},"^Cannot execute bulk operation on empty group. DynamicGroup with id='(\\d+?)' doesn't have child assets$":{gettext:'Could not execute bulk operation on an empty group. Smart group with ID "{{groupId}}" has no child assets.',placeholders:{groupId:"$1"}},"^Cannot parse X509 certificate. : Could not parse certificate: (.+?)$":{gettext:"Could not parse X.509 certificate: {{ failureReason | translate }}.",placeholders:{failureReason:"$1"}},"^Cannot reschedule bulk operation. All its operations are successful$":{gettext:"Cannot reschedule bulk operation. All its operations are already successful."},"^Cannot reset user password : Cannot find user with such email.$":{gettext:"Cannot reset password for user with such email: email not found."},"^Cannot update/delete application binary via this endpoint$":{gettext:"Cannot update/delete application binary via this endpoint"},"^Can't delete user because it is used by another managed object$":{gettext:"Cannot delete device with associated device owner because this owner is still assigned to other device(s). Try to remove only the device."},"^Cep module created$":{gettext:"CEP module created"},"^Cep module updated$":{gettext:"CEP module updated"},"^Cep module deleted$":{gettext:"CEP module deleted"},'^Cep module "(.+?)" created$':{gettext:'CEP module "{{name}}" created',placeholders:{name:"$1"}},'^Cep module "(.+?)" updated$':{gettext:'CEP module "{{name}}" updated',placeholders:{name:"$1"}},'^Cep module "(.+?)" deleted$':{gettext:'CEP module "{{name}}" deleted',placeholders:{name:"$1"}},"^Command state is invalid: (.+)$":{gettext:"Command state is invalid: {{violations}}",placeholders:{violations:{capture:"$1",translate:{"(\\w+?) - may not be null":{gettext:'"{{field}}" must not be null',placeholders:{field:"$1"}}}}}},"^Could not connect to endpoint (.+)\\. Could not verify `(.+)` host key with fingerprint `(.+)` for `(.+)` on port (.+)\\. If you expected that key, please remove the previous one from configuration to allow for connection\\.$":{gettext:'Could not connect to endpoint "{{endpointName}}". Could not verify {{keyType}} host key with fingerprint {{fingerprint}} for host {{host}} on port {{port}}. If you expected this key, please remove the previous one from configuration to allow for connection.',placeholders:{endpointName:"$1",keyType:"$2",fingerprint:"$3",host:"$4",port:"$5"}},'^Could not login to ssh server on endpoint "(.+)"\\. Provided credential for user "(.+)" is incorrect\\.$':{gettext:'Could not access SSH server on endpoint "{{endpointName}}". Provided credentials for user "{{userName}}" are incorrect.',placeholders:{endpointName:"$1",userName:"$2"}},"^Could not save object remoteAccessUpdate: (.+)$":{gettext:"{{errorMessages}}",placeholders:{errorMessages:{capture:"$1",translate:{"Could not recognize host-key format":{gettext:'Could not recognize "Host key" format'},"Could not recognize key-pair format":{gettext:'Could not recognize the format of "Public key" or "Private key"'}}}}},"^Could not update user. : Error persisting user (.+?)!$":{gettext:'Could not update user "{{username}}".',placeholders:{username:"$1"}},"ˆCreate bulk operation$":{gettext:"Create bulk operation"},"^Create bulk operation: (.+)$":{gettext:"Create bulk operation: {{updatesList}}",placeholders:Wc},"^Creation ramp must be greater than (\\d+?)$":{gettext:"Bulk operation delay must be greater than {{minSeconds}} seconds.",placeholders:{minSeconds:"$1"}},"^Created container$":{gettext:"Container created."},"^Created pod: (.+)$":{gettext:'Pod "{{imageName}}" created.',placeholders:{imageName:"$1"}},"^CSV file contained empty dataset$":{gettext:"No entries found in uploaded CSV file."},"^Cycle detected for route (.+?)!$":{gettext:"Cycle detected for route {{route}}.",placeholders:{route:"$1"}},"^Data broker processing is currently overloaded and may stop forwarding your data\\. Please contact support\\.$":{gettext:"Data broker processing is currently overloaded and may stop forwarding your data. Please contact support."},"^Data broker processing is not able to connect do destination tenant, thus data forwarding is not working\\. Please contact support\\.$":{gettext:"Data broker processing is not able to connect to destination tenant, thus data forwarding is not working. Please contact support."},"^Delete bulk operation$":{gettext:"Delete bulk operation"},"^Delete bulk operation: (.+)$":{gettext:"Delete bulk operation: {{updatesList}}",placeholders:Wc},"^Device id '(.+?)' contains '(.+?)' character which is not permitted.$":{gettext:'ID "{{deviceId}}" contains invalid character: "{{invalidCharacter}}".',placeholders:{deviceId:"$1",invalidCharacter:"$2"}},"^Device name: '(.+?)', alarm text: '(.+?)'$":{gettext:'Device name: "{{deviceName}}", alarm text: "{{alarmText | translate}}"',placeholders:{deviceName:"$1",alarmText:"$2"}},"^Display name$":{gettext:"Login alias"},"^Domain name in uploaded certificate differs from the one in use$":{gettext:"Domain name in uploaded certificate differs from the one in use. Please deactivate the custom domain before uploading new certificate."},"^Domain name is already in use by another tenant!$":{gettext:"Domain name is already used by another tenant."},"^Duplicated connector for instanceUrl (.+?)!$":{gettext:"Target URL {{targetUrl}} already used by another connector.",placeholders:{targetUrl:"$1"}},"^Duplicated connector for name (.+?)!$":{gettext:'Connector name "{{name}}" already used by another connector.',placeholders:{name:"$1"}},"^Entry is outside of the target dir: (.+)$":{gettext:'File entry outside of the target directory: "{{path}}".',placeholders:{path:"$1"}},"^Error during password validation. : Password must have at least (\\d+?) characters and no more than (\\d+?) and must contain only Latin1 characters.$":{gettext:"Password is invalid. It must have at least {{minCharactersCount}} and no more than {{maxCharactersCount}} characters.",placeholders:{minCharactersCount:"$1",maxCharactersCount:"$2"}},"^Error during password validation. : Your password has been used already. Choose another.$":{gettext:"This password has already been used earlier. Use a different one."},"^Error in statement (.+?):(.+?)! : Incorrect syntax near '(.+?)' near reserved keyword '(.+?)' \\[([\\S\\s]+?)\\]$":{gettext:'Error in statement {{moduleName}}:{{statementNumber}}. Incorrect syntax near expression "{{expression}}" near reserved keyword "{{keyword}}".',placeholders:{moduleName:"$1",statementNumber:"$2",expression:"$3",keyword:"$4"}},"^External id not found; external id = ID \\[type=(.+?), value=(.+?)\\]$":{gettext:'External ID not found for type "{{type}}" and value "{{value}}".',placeholders:{type:"$1",value:"$2"}},"^Error occurred when trying to find an Application for id ID (.+) : Could not find application by ID (\\d+)$":{gettext:"Could not find application by ID {{applicationId}}.",placeholders:{applicationId:"$2"}},'^Http status code: 404\n{error="options/Not Found",message="Unable to find option by given key: sigfox-agent/provider.token",info="https://www.cumulocity.com/guides/reference-guide/#error_reporting",details="null"}':{gettext:"Unable to find option by given key: sigfox-agent/provider.token"},"^Failed to delete application. : Cannot remove application assigned to other tenants.$":{gettext:"Could not delete application assigned to other tenants."},"^Failed to extract certificate from PKCS12$":{gettext:"Failed to extract certificate from PKCS12."},"^Failed to update domain at the platform$":{gettext:"Failed to update domain at the platform."},"^Finding device data from database failed : No managedObject for id '(.+?)'!$":{gettext:'Could not find managed object with ID "{{deviceId}}".',placeholders:{deviceId:"$1"}},"^Following mandatory fields should be included: (.+?)$":{gettext:"Following mandatory fields should be included: {{fields}}",placeholders:{fields:"$1"}},"^Global Role updated$":{gettext:"Global role updated"},"^Global Role (.+?) updated$":{gettext:'Global role "{{name}}" updated',placeholders:{name:"$1"}},"^Global Role (.+?) updated: (.+)$":{gettext:'Global role "{{name}}" updated: {{updatesList}}',placeholders:{name:"$1",updatesList:{capture:"$2",translate:{"applications \\[([^\\]]+?)\\] added":{gettext:"applications {{list}} added",placeholders:{list:"$1"}},"applications \\[([^\\]]+?)\\] removed":{gettext:"applications {{list}} removed",placeholders:{list:"$1"}},"roles \\[([^\\]]+?)\\] added":{gettext:"roles {{list}} added",placeholders:{list:"$1"}},"roles \\[([^\\]]+?)\\] removed":{gettext:"roles {{list}} removed",placeholders:{list:"$1"}}}}}},"^Global Roles$":{gettext:"Global roles"},"^Operation updated: (.+)$":{gettext:"Operation updated: {{updatesList}}",placeholders:{updatesList:{capture:"$1",translate:{"status='(.+?)'":{gettext:'status: "{{ status | translate }}"',placeholders:{status:"$1"}},"description='(.+?)'":{gettext:'description: "{{ description | translate }}"',placeholders:{description:"$1"}},"device name='(.+?)'":{gettext:'device name: "{{ deviceName }}"',placeholders:{deviceName:"$1"}},"failure reason='(.+?)'":{gettext:'failure reason: "{{ failureReason | translate }}"',placeholders:{failureReason:"$1"}}}}}},"^ID \\[type=(.+?), value=(.+?)\\] was already bound to different Global ID.$":{gettext:'External ID "{{value}}" of the type "{{type}}" already exists.',placeholders:{type:"$1",value:"$2"}},"^Invalid credentials! : Bad credentials$":{gettext:"Invalid credentials."},"^Invalid credentials! : No phone number provided$":{gettext:"Log into the management tenant first and enter your phone number."},"^Inventory Role removed$":{gettext:"Inventory role removed"},"^Inventory Role (.+?) removed":{gettext:'Inventory role "{{name}}" deleted.',placeholders:{name:"$1"}},"^Inventory Role updated$":{gettext:"Inventory role updated"},"^Inventory Role (.+?) updated":{gettext:'Inventory role "{{name}}" updated.',placeholders:{name:"$1"}},"^I/O error: Connection refused; nested exception is Connection refused : Connection refused":{gettext:"Connection refused"},"^I/O error: Read timed out; nested exception is Read timed out : Read timed out":{gettext:"Read timed out"},"^Log file requested$":{gettext:"Log file requested."},"^Managed object deleted$":{gettext:"Managed object deleted"},'^Managed object "(.+?)" deleted$':{gettext:'Managed object "{{name}}" deleted',placeholders:{name:"$1"}},"^Maximum file size exceeded$":{gettext:"Maximum file size exceeded."},"^Message with ID (.+?) doesn't exist in smart rest template (.+?)$":{gettext:'Message with ID "{{messageId}}" doesn\'t exist in SmartREST template with ID "{{templateId}}"',placeholders:{messageId:"$1",templateId:"$2"}},"^NewDeviceRequest for id = (.+?) already exists.$":{gettext:"Device registration request with ID {{id}} already exists.",placeholders:{id:"$1"}},"^No communication with device since (.+?)$":{gettext:"No communication with device since {{timestamp | absoluteDate}}.",placeholders:{timestamp:"$1"}},"^No data received from device within required interval.$":{gettext:"No data received from device within required interval."},"^No LoRa provider settings are found. Please configure the connectivity settings.$":{gettext:"No LoRa provider settings are found. Please configure the connectivity settings."},"^Not within any context!$":{gettext:"A problem occurred with microservice subscription."},"^Maximum age cannot be bigger than 10 years.$":{gettext:"Maximum age cannot be bigger than 10 years."},"^Microservice application name incorrect. Please use only lower-case letters, digits and dashes. Maximum length is (\\d+) characters.$":{gettext:"Microservice application name is incorrect: only lower case letters, digits and dashes allowed. Maximum length: {{maxLength}}.",placeholders:{maxLength:"$1"}},"^Microservice not available.*$":{gettext:"Microservice is not available."},"^Operation created$":{gettext:"Operation created."},"^Operation updated$":{gettext:"Operation updated."},"^Operation created: status='(.+?)'.":{gettext:'Operation created: status: "{{ status | translate }}".',placeholders:{status:"$1"}},"^Option created$":{gettext:"Option created."},'^Option "(.+?)" created$':{gettext:'Option "{{option}}" created.',placeholders:{option:"$1"}},"^Option deleted$":{gettext:"Option deleted."},'^Option "(.+?)" deleted$':{gettext:'Option "{{option}}" deleted.',placeholders:{option:"$1"}},"^Owner field error. : Cannot introduce cyclic dependency.":{gettext:"Could not introduce cyclic ownership dependency."},"^Password change is temporary blocked.$":{gettext:"Password change is temporarily blocked."},"^Password cipher does not match":{gettext:"Password cipher does not match."},"^Platform application cannot be added to, nor removed from any tenant.$":{gettext:"Platform application cannot be added to, nor removed from any tenant."},"^Private key must be provided in KEY_PAIR credentials$":{gettext:'Private key must be provided when "Public/private keys" option is selected.'},"^Private key cipher does not match":{gettext:"Private key cipher does not match"},'^Protocol "(.+?)" does not support "(.+?)" credentials type$':{gettext:'Protocol "{{protocol}}" does not support "{{credentialsType}}" credentials type.',placeholders:{protocol:"$1",credentialsType:"$2"}},'^pulling image "(.+)"$':{gettext:'Pulling image: "{{imageName}}".',placeholders:{imageName:"$1"}},"^Real-time event processing is currently overloaded and may stop processing your events\\. Please contact support\\.$":{gettext:"Real-time event processing is currently overloaded and may stop processing your events. Please contact support."},"^Resource ID \\[type=com_cumulocity_model_idtype_GId, value=(.+?)\\] for this request not found.$":{gettext:'Could not find the resource with ID "{{id}}".',placeholders:{id:"$1"}},"^Retrieve configuration snapshot from device (.+?)":{gettext:"Retrieve configuration snapshot from device {{deviceName}}",placeholders:{deviceName:"$1"}},"^Retrieve (.+?) configuration snapshot from device (.+?)":{gettext:"Retrieve {{configurationType}} configuration snapshot from device {{deviceName}}",placeholders:{configurationType:"$1",deviceName:"$2"}},"^Scaled up replica set (.+) to (\\d+)$":{gettext:'Replica set "{{replicaSetName}}" scaled up to "{{scaleNumber}}".',placeholders:{replicaSetName:"$1",scaleNumber:"$2"}},"^Send configuration snapshot (.+?) of configuration type (.+?) to device (.+?)":{gettext:"Send configuration snapshot {{snapshotName}} of configuration type {{configurationType}} to device {{deviceName}}",placeholders:{snapshotName:"$1",configurationType:"$2",deviceName:"$3"}},"^Send configuration snapshot (.+?) to device (.+?)":{gettext:"Send configuration snapshot {{snapshotName}} to device {{deviceName}}",placeholders:{snapshotName:"$1",deviceName:"$2"}},"^Simulator state is invalid: (.+)$":{gettext:"Simulator state is invalid: {{violations}}",placeholders:{violations:{capture:"$1",translate:{"(\\w+?) - may not be null":{gettext:'"{{field}}" should not be null',placeholders:{field:"$1"}},"(\\w+?) - must be less than or equal to (\\d+)":{gettext:'"{{field}}" must be less than or equal to {{maxValue}}',placeholders:{field:"$1",maxValue:"$2"}},"(\\w+?) - should not contain null values":{gettext:'"{{field}}" should not contain null values',placeholders:{field:"$1"}}}}}},"^Smart rest template (.+?) doesn't exist$":{gettext:'SmartREST template with id "{{templateId}}" doesn\'t exist',placeholders:{templateId:"$1"}},"^Smart rule created$":{gettext:"Smart rule created."},"^Smart rule updated$":{gettext:"Smart rule updated."},"^Smart rule enabled$":{gettext:"Smart rule activated."},"^Smart rule disabled$":{gettext:"Smart rule deactivated."},"^Smart rule deleted$":{gettext:"Smart rule deleted."},'^Smart rule "(.+?)" created$':{gettext:'Smart rule "{{name}}" created.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" updated$':{gettext:'Smart rule "{{name}}" updated.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" enabled$':{gettext:'Smart rule "{{name}}" activated.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" disabled$':{gettext:'Smart rule "{{name}}" deactivated.',placeholders:{name:"$1"}},'^Smart rule "(.+?)" deleted$':{gettext:'Smart rule "{{name}}" deleted.',placeholders:{name:"$1"}},"^Started container$":{gettext:"Container started."},"^Successfully assigned (.+) to (.+)$":{gettext:'"{{imageName}}" assigned to "{{address}}".',placeholders:{imageName:"$1",address:"$2"}},'^Successfully pulled image "(.+)"$':{gettext:'Image "{{imageName}}" pulled.',placeholders:{imageName:"$1"}},"^Tenant creation failed. : Tenant with given id already exists.$":{gettext:"Could not create a tenant. Tenant with given domain/URL already exists."},'^Tenant id cannot be a reserved sql keyword "(.+?)".$':{gettext:'Could not use a reserved SQL keyword "{{tenantId}}" as a domain name.',placeholders:{tenantId:"$1"}},'^Tenant "(.+?)" activated$':{gettext:'Tenant "{{tenant}}" activated.',placeholders:{tenant:"$1"}},"^Tenant (.+?) has sub-tenants, please remove them first!$":{gettext:'Could not remove tenant "{{tenant}}". Remove its subtenants first.',placeholders:{tenant:"$1"}},"^Tenant activated$":{gettext:"Tenant activated"},'^Tenant "(.+?)" created$':{gettext:'Tenant "{{tenant}}" created.',placeholders:{tenant:"$1"}},"^Tenant created$":{gettext:"Tenant created"},'^Tenant "(.+?)" deleted$':{gettext:'Tenant "{{tenant}}" deleted.',placeholders:{tenant:"$1"}},"^Tenant deleted$":{gettext:"Tenant deleted"},'^Tenant "(.+?)" suspended$':{gettext:'Tenant "{{tenant}}" suspended.',placeholders:{tenant:"$1"}},"^Tenant suspended$":{gettext:"Tenant suspended"},'^Tenant "(.+?)" updated: (.+?)$':{gettext:'Tenant "{{tenant}}" updated: {{properties}}.',placeholders:{tenant:"$1",properties:"$2"}},"^Tenant updated$":{gettext:"Tenant updated"},"^Too Many Requests$":{gettext:"Too many requests. Try again later."},"^User alias equals username '(.+)'$":{gettext:"Username and login alias must be different."},"^User created$":{gettext:"User created"},"^User (.+?) created$":{gettext:'User "{{name}}" created',placeholders:{name:"$1"}},"^User deleted$":{gettext:"User deleted"},"^User (.+?) deleted$":{gettext:'User "{{name}}" deleted',placeholders:{name:"$1"}},"^User updated$":{gettext:"User updated"},"^User (.+?) updated: (.+)$":{gettext:'User "{{name}}" updated: {{updatesList}}',placeholders:{name:"$1",updatesList:{capture:"$2",translate:{"delegatedBy='(.+?)'":{gettext:'delegated by: "{{delegate}}"',placeholders:{delegate:"$1"}},"owner='(.+?)'":{gettext:'owner: "{{owner}}"',placeholders:{owner:"$1"}},"inventory assignment \\[(.+?)\\] added":{gettext:"inventory assignment [{{inventoryAssignment}}] added",placeholders:{inventoryAssignment:"$1"}},"inventory assignment \\[(.+?)\\] removed":{gettext:"inventory assignment [{{inventoryAssignment}}] removed",placeholders:{inventoryAssignment:"$1"}},"applications \\[(.+?)\\] added$":{gettext:"applications [{{applicationsList}}] added",placeholders:{applicationsList:"$1"}},"applications \\[(.+?)\\] removed$":{gettext:"applications [{{applicationsList}}] removed",placeholders:{applicationsList:"$1"}},"global roles \\[(.+?)\\] added$":{gettext:"global roles [{{globalRolesList}}] added",placeholders:{globalRolesList:"$1"}},"global roles \\[(.+?)\\] removed$":{gettext:"global roles [{{globalRolesList}}] removed",placeholders:{globalRolesList:"$1"}}}}}},"^User with username '(.+?)' already exists! : Duplicated: (.+?)$":{gettext:'User "{{username}}" already exists.',placeholders:{username:"$1"}},"^User with username or alias '(.+)' already exists! : Duplicated: (.+)$":{gettext:'User with username or login alias "{{usernameOrAlias}}" already exists.',placeholders:{usernameOrAlias:"$1"}},"^User with email '(.+?)' already exists! : Duplicated: (.+?)$":{gettext:'User with email "{{email}}" already exists.',placeholders:{email:"$1"}},"^unable to find option with given key (.+?) : Could not find entity Option by ID (.+?)!$":{gettext:'Unable to get tenant option: "{{option}}".',placeholders:{option:"$2"}},"^unable to find option with given key (.+?) : There is no system property for key (.+?)$":{gettext:'Unable to get system option: "{{option}}".',placeholders:{option:"$2"}},"^Write failed with error code 16733 and error message 'trying to index text where term list is too big, max is 4mb _id: \"(.+?)\"'$":{gettext:"The uploaded image cannot be bigger than 4 MB. Please upload a smaller one."},"^Write failed with error code 17280 and error message 'WiredTigerIndex::insert: key too large to index, failing (.+?) { : \"(.+?)\" }'$":{gettext:"The chosen name is too long. Please try a shorter one."},"^You have reached devices limit. No more devices can be registered.$":{gettext:"You reached devices limit. No more devices can be registered."},'^(.+) succeeded for volume "(.+)"':{gettext:'Operation "{{operation}}" succeeded for volume "{{volume}}".',placeholders:{operation:"$1",volume:"$2"}},"^Exception on tenant (.+) in statement '(.+)': Invocation exception when invoking method '(.+)' of class '(.+)' passing parameters \\[(.+)\\] for statement '(.+)': (.+) : (.+)$":{gettext:'Exception on tenant {{tenantId}} in statement "{{moduleName}}": Invocation exception when invoking method "{{methodName}}" of class "{{classPath}}" passing parameters [{{parameters}}] for statement "{{statement}}": {{exceptionType}} : {{exceptionMessage}}.',placeholders:{tenantId:"$1",moduleName:"$2",methodName:"$3",classPath:"$4",parameters:"$5",statement:"$6",exceptionType:"$7",exceptionMessage:"$8"}},"^No nodes are available that match all of the predicates: (.+).$":{gettext:"No nodes are available that match all of the predicates: [{{predicates}}].",placeholders:{predicates:"$1"}},"^Readiness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\(Client.Timeout exceeded while awaiting headers\\)$":{gettext:"Readiness probe failed: {{requestMethod}} {{uri}}: {{protocol}}: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).",placeholders:{requestMethod:"$1",uri:"$2",protocol:"$3"}},"^Liveness probe failed: (.+) (.+): (.+): request canceled while waiting for connection \\(Client.Timeout exceeded while awaiting headers\\)$":{gettext:"Liveness probe failed: {{requestMethod}} {{uri}}: {{protocol}}: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).",placeholders:{requestMethod:"$1",uri:"$2",protocol:"$3"}},"^Error syncing pod$":{gettext:"Pod synchronization error."},"^Failed create pod sandbox.$":{gettext:"Pod sandbox creation failed."},'^Exception on tenant (.+) in statement \'(.+)\': Http status code: (\\d+) \\{error="alarm/Unprocessable Entity",message="(.+)",info="https://www.cumulocity.com/guides/reference-guide/#error_reporting",details="null"\\}$':{gettext:'Exception on tenant {{tenantId}} in statement "{{statement}}": HTTP status code: {{httpStatusCode}} : {{message | translate}}',placeholders:{tenantId:"$1",statement:"$2",httpStatusCode:"$3",message:"$4"}},"^User '(.+)' is managed by a remote identity management service defined by an administrator, direct update is forbidden$":{gettext:'User "{{userName}}" is managed by a remote identity management service defined by an administrator, direct update is forbidden.',placeholders:{userName:"$1"}},'^Added new child device to "(.+)" \\(ID: (.+)\\).$':{gettext:'Added new child device to "{{parentDeviceName}}" (ID: {{parentDeviceId}}).',placeholders:{parentDeviceName:"$1",parentDeviceId:"$2"}},'^Updated child device of "(.+)" \\(ID: (.+)\\).$':{gettext:'Updated child device of "{{parentDeviceName}}" (ID: {{parentDeviceId}}).',placeholders:{parentDeviceName:"$1",parentDeviceId:"$2"}},'^Added child device "(.+)" \\(ID: (.+)\\).$':{gettext:'Added child device "{{name}}" (ID: {{id}}).',placeholders:{name:"$1",id:"$2"}},'^Removed child device "(.+)" \\(ID: (.+)\\).$':{gettext:'Removed child device "{{name}}" (ID: {{id}}).',placeholders:{name:"$1",id:"$2"}},'^Change value of "(.+)" to (.+) (.+).$':{gettext:'Change value of "{{name}}" to {{value}}{{unit}}.',placeholders:{name:"$1",value:"$2",unit:"$3"}},'^Change value of "(.+)" to (.+).$':{gettext:'Change value of "{{name}}" to {{value}}.',placeholders:{name:"$1",value:"$2"}},'^Change status of "(.+)" to "(.+)".$':{gettext:'Change status of "{{name}}" to "{{label}}".',placeholders:{name:"$1",label:"$2"}},'^Send message "(.+)".$':{gettext:'Send message "{{str}}".',placeholders:{str:"$1"}},"^Close relay (.+).$":{gettext:"Close relay {{number}}.",placeholders:{number:"$1"}},"^Open relay (.+).$":{gettext:"Open relay {{number}}.",placeholders:{number:"$1"}},"^Change trace status to (.+).$":{gettext:"Change trace status to {{state | translate}}.",placeholders:{state:"$1"}},"^Change relay status to (.+).$":{gettext:"Change relay status to {{status | translate}}.",placeholders:{status:"$1"}},"^Closing relay (.+).$":{gettext:"Closing relay {{number}}.",placeholders:{number:"$1"}},"^Opening relay (.+).$":{gettext:"Opening relay {{number}}.",placeholders:{number:"$1"}},"^Update bulk operation$":{gettext:"Update bulk operation"},"^Update bulk operation: (.+)$":{gettext:"Update bulk operation: {{updatesList}}",placeholders:Wc},'^Update firmware to: "?(.+?)"? \\(version: (.+)\\)\\.?$':{gettext:'Update firmware to: "{{ name }}" (version: {{ version }})',placeholders:{name:"$1",version:"$2"}},'^Update firmware to: "?(.+?)"?\\.?$':{gettext:'Update firmware to: "{{ name }}"',placeholders:{name:"$1"}},"^Update configuration to (.+).$":{gettext:"Update configuration to: {{ name }}.",placeholders:{name:"$1"}},"^Apply device profile: (.+).?$":{gettext:"Apply device profile: {{ name }}",placeholders:{name:"$1"}},"^Execute generic command: (.+).?$":{gettext:"Execute generic command: {{command}}",placeholders:{command:"$1"}},"^Failed to refresh application. : Cannot refresh non local-hosted application.$":{gettext:"Could not reactivate the application as it is not hosted locally."},"^Failed to refresh application. : Cannot refresh application without active version id.$":{gettext:"Could not reactivate the application as it has no active version."},"^Scaled down replica set (.+) to (\\d+)$":{gettext:'Replica set "{{replicaSetName}}" scaled down to "{{scaleNumber}}".',placeholders:{replicaSetName:"$1",scaleNumber:"$2"}},"^Deleted pod: (.+)$":{gettext:'Pod "{{imageName}}" deleted.',placeholders:{imageName:"$1"}},'^Container image "(.+)" already present on machine$':{gettext:'Container image "{{imageName}}" already exists.',placeholders:{imageName:"$1"}},"^Error updating tenant! Cannot insert second configuration for Password code grant internal/Bad Request$":{gettext:"This login mode was already set by another administrator. Refresh the page to update the data."}},Zc=function(){function e(){this.cachedDictionary={}}return e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"})],e)}(),Jc=function(){function e(e,t,n,a,o){void 0===a&&(a=null),void 0===o&&(o=null),this.http=e,this.optionsService=t,this.cachedLocaleDictionaryService=n,this.path=a,this.languages=o}return e.prototype.getTranslation=function(e){var t=this,n=""+(this.path||"")+e+".json";return this.languages&&this.languages[e]&&this.languages[e].url&&(n=this.languages[e].url),this.http.get(n).pipe(o.map((function(n){return t.optionsService.langsDetails&&t.optionsService.langsDetails[e]?bc({},n[e],t.optionsService.langsDetails[e]):n[e]})),o.tap((function(n){t.cachedLocaleDictionaryService.cachedDictionary[e]=n})),o.map((function(e){return t.getDictionaryWithTrimmedKeys(e)})),o.catchError((function(){return a.of({})})))},e.prototype.getDictionaryWithTrimmedKeys=function(e){return s.mapKeys(e,(function(e,t){return Xc(t)}))},e.ctorParameters=function(){return[{type:d.HttpClient},{type:$c},{type:Zc},{type:String,decorators:[{type:t.Inject,args:[Gc]}]},{type:void 0,decorators:[{type:t.Inject,args:[Bc]}]}]},e=jc([t.Injectable(),wc(3,t.Inject(Gc)),wc(4,t.Inject(Bc))],e)}();function Xc(e){return e.replace(/(\r\n|\n|\r)/gm,"").replace(/\s{2,}/g," ").trim()}var Qc=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return vc(n,e),n.prototype.getValue=function(e,t){var n=Xc(t),a=s.get(e,[n]);a||t.split(".").length>1&&(a=s.get(e,t));return a},n=jc([t.Injectable()],n)}(p.TranslateDefaultParser),eu=function(e){function n(n,a,o){var s=e.call(this,n,a,o)||this;return s.htmlUpdateEvent=new t.EventEmitter,s}return vc(n,e),Object.defineProperty(n.prototype,"_elementRef",{get:function(){return this.element},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_translateService",{get:function(){return this.translateService},enumerable:!0,configurable:!0}),n.prototype.checkNodes=function(t,n){void 0===t&&(t=!1),this.isElementSimpleTextType()||this.isElementInnerHtmlEmpty()?e.prototype.checkNodes.call(this,t,n):(this.isLookupKeyMissing()&&(this._elementRef.nativeElement.lookupKey=this.getLookupKey()),this.translateAndUpdateHtmlContent(),this.htmlUpdateEvent.emit())},n.prototype.ngOnDestroy=function(){this.htmlUpdateEvent.complete(),e.prototype.ngOnDestroy.call(this)},n.prototype.getLookupKey=function(){return this._elementRef.nativeElement.innerHTML.replace(/<!--.*?-->/gs,"").trim()},n.prototype.isElementSimpleTextType=function(){return 1===this._elementRef.nativeElement.childNodes.length&&3===this._elementRef.nativeElement.childNodes[0].nodeType},n.prototype.isElementInnerHtmlEmpty=function(){return!this._elementRef.nativeElement.innerHTML},n.prototype.isLookupKeyMissing=function(){return!this._elementRef.nativeElement.lookupKey},n.prototype.lookupKeyExist=function(){return this._elementRef.nativeElement.lookupKey},n.prototype.translateAndUpdateHtmlContent=function(){this.lookupKeyExist()&&(this._elementRef.nativeElement.innerHTML=this._translateService.instant(this._elementRef.nativeElement.lookupKey,this.currentParams||{}))},n.ctorParameters=function(){return[{type:p.TranslateService},{type:t.ElementRef},{type:t.ChangeDetectorRef}]},n=jc([t.Directive({selector:"[translate],[ngx-translate]"})],n)}(p.TranslateDirective),tu=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return vc(n,e),n=jc([t.Injectable(),t.Pipe({name:"translate",pure:!1})],n)}(p.TranslatePipe),nu=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return vc(n,e),n=jc([t.NgModule({declarations:[tu,eu],exports:[tu,eu]})],n)}(p.TranslateModule);try{require("@c8y/ngx-components/locales/de.po"),require("@c8y/ngx-components/locales/en.po"),require("@c8y/ngx-components/locales/es.po"),require("@c8y/ngx-components/locales/fr.po"),require("@c8y/ngx-components/locales/ja_JP.po")}catch(e){}var au={en:"en-GB","en-EN":"en-GB"};function ou(e,t,n,a,o){return new Jc(e,t,n,a,o)}function su(e){return e.localePath}function ru(e){return e.languages}function lu(e){return{get lang(){return iu(e.state.lang||"en")},toLowerCase:function(){return this.lang.toLowerCase()},toString:function(){return this.lang}}}function iu(e){return au[e]||e}var cu=function(){function e(){}var n;return n=e,e.providers=function(){return[{provide:t.LOCALE_ID,useFactory:lu,deps:[Uc]},{provide:Hc,useValue:Yc,multi:!0},{provide:Gc,useFactory:su,deps:[$c]},{provide:Bc,useFactory:ru,deps:[$c]},{provide:p.TranslateLoader,useFactory:ou,deps:[d.HttpClient,$c,Zc,Gc,Bc]},{provide:p.TranslateCompiler,useClass:p.TranslateFakeCompiler},{provide:p.TranslateParser,useClass:Qc},{provide:p.MissingTranslationHandler,useClass:Vc},p.TranslateStore,p.TranslateService,{provide:p.USE_STORE,useValue:void 0},{provide:p.USE_DEFAULT_LANG,useValue:void 0},{provide:p.USE_EXTEND,useValue:!1},{provide:p.DEFAULT_LANGUAGE,useValue:void 0}]},e.forRoot=function(){return{ngModule:n,providers:n.providers()}},e=n=jc([t.NgModule({exports:[nu],imports:[d.HttpClientModule]})],e)}();function uu(e){var t=e.split(/\n/).map((function(e){return e.trim()})).filter(Boolean).filter((function(e){return!e.match(/^\/?\*/)&&!e.match(/^\/\//)})).join("\n");return new Function("var exports = {};\nvar module = { exports: exports };\n"+t+"\nreturn exports;")()}var du=new Map;function pu(e){return new Promise((function(t,n){du.has(e)?t(du.get(e)):fetch("assets/locales/angular/"+e+".js").then((function(e){return e.text()})).then((function(n){var a=uu(n);du.set(e,a),t(a)})).catch(n)}))}var mu=function(){function e(e,t,n){var a=this;this.ngxTranslate=e,this.ui=t,this.options=n,this.langsDetail=this.options.get("languages",{}),this.langs=s.keys(this.langsDetail).filter((function(e){return a.langsDetail[e]})),this.DEFAULT_SEPARATOR="_";var o=this.queryStringLang();o&&this.saveInLocalStorage(o)}var n;return n=e,e.defaultLang=function(){return window.localStorage.getItem(n.SAVE_LANGUAGE_KEY)},e.prototype.switchToLanguage=function(e){return Sc(this,void 0,void 0,(function(){var t,n,a;return Cc(this,(function(o){switch(o.label){case 0:t=e.replace("_","-"),o.label=1;case 1:return o.trys.push([1,3,,7]),[4,this.loadLocales(t)];case 2:return o.sent(),[3,7];case 3:return n=o.sent(),(a=t.split("-").shift())===t?[3,5]:[4,this.loadLocales(a)];case 4:return o.sent(),[3,6];case 5:throw n;case 6:return[3,7];case 7:return this.setLanguage(e),[2]}}))}))},e.prototype.loadLocales=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return[4,pu(iu(e))];case 1:return t=n.sent(),i.registerLocaleData(t.default),[2]}}))}))},e.prototype.setLanguage=function(e){var t=this;this.ngxTranslate.setDefaultLang(this.options.get("defaultLanguage","en")),this.ngxTranslate.use(e).subscribe((function(){t.ui.state$.next(bc({},t.ui.state,{lang:e}))}))},e.prototype.firstSupportedLanguage=function(){var e=this,t=[this.queryStringLang(),this.localStorageLang()].concat([this.options.get("defaultLanguage")]).concat(this.browserLangs()).concat(["en"]).filter(Boolean).map((function(e){return e.toLowerCase()})).find((function(t){return e.getSupported(t)}));return this.getSupported(t)},e.prototype.convertToLanguageCodePO=function(e){var t=e.indexOf("-")>-1?"-":this.DEFAULT_SEPARATOR,n=Pc(e.split(t),2),a=n[0],o=n[1];return""+a+(o?""+this.DEFAULT_SEPARATOR+o:"")},e.prototype.getNativeLanguage=function(e){return((this.langsDetail||{})[e]||{}).nativeName||e},e.prototype.saveInLocalStorage=function(e){window.localStorage.setItem(n.SAVE_LANGUAGE_KEY,e)},e.prototype.getSupported=function(e){var t=this,n=this.langs.find((function(t){return t.toLowerCase()===e}));return n||this.langs.find((function(n){return t.getLessSpecific(n.toLowerCase())===t.getLessSpecific(e)||n.startsWith(e)}))},e.prototype.queryStringLang=function(){return this.getQueryParameter("lang")},e.prototype.getLessSpecific=function(e){return s.isString(e)?e.replace("-",this.DEFAULT_SEPARATOR).split(this.DEFAULT_SEPARATOR)[0]:""},e.prototype.localStorageLang=function(){return window.localStorage.getItem(n.SAVE_LANGUAGE_KEY)},e.prototype.browserLangs=function(){var e=window.navigator;return["languages","language","browserLanguage","systemLanguage","userLanguage"].reduce((function(t,n){var a=e[n];return"string"==typeof a?t.push(a):Array.isArray(a)&&(t=t.concat(a)),t}),[])},e.prototype.getQueryParameter=function(e){var t;return window.location.search.substring(1).split("&").find((function(n){var a=Pc(n.split("="),2),o=a[0],s=a[1];return o===e&&(t=s),t})),t},e.SAVE_LANGUAGE_KEY="c8y_language",e.ctorParameters=function(){return[{type:p.TranslateService},{type:Uc},{type:$c}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(p.TranslateService),t.ɵɵinject(Uc),t.ɵɵinject($c))},token:e,providedIn:"root"}),e=n=jc([t.Injectable({providedIn:"root"})],e)}(),hu=function(e){function n(t,n){var a=e.call(this,t)||this;return a.translateService=n,a}return vc(n,e),n.prototype.transform=function(t,n,a,o){void 0===n&&(n="medium");var s=t,r=!1,l=!1;"number"!=typeof t||isNaN(t)||(s=Math.min(t,864e13),s=Math.max(s,-864e13),r=t<-864e13,l=t>864e13);var i=e.prototype.transform.call(this,s,n,a,o);return r?i=this.translateService.instant("before {{date}}",{date:i}):l&&(i=this.translateService.instant("after {{date}}",{date:i})),i},n.ctorParameters=function(){return[{type:String,decorators:[{type:t.Inject,args:[t.LOCALE_ID]}]},{type:p.TranslateService}]},n=jc([t.Pipe({name:"c8yDate"}),wc(0,t.Inject(t.LOCALE_ID))],n)}(i.DatePipe),fu=function(){function e(e){this.element=e,this.useIntersection=!0,this.hidden=!1,this.class="c8y-list__item p-0",this.maxIterations=10,this.hideNoMoreDataHint=!1,this.onLoad=new t.EventEmitter,this.isLoading=!1,this.counter=0,this.hasNoMoreData=!1,this.LOAD_SAME_PAGE_THRESHOLD=50,this.destroyed=!1}return Object.defineProperty(e.prototype,"hostClass",{get:function(){return this.hidden||!this.hasMore&&!this.hasNoMoreData?"":this.class},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasMore",{get:function(){return this.paging&&(this.paging.totalPages>this.paging.currentPage||!!this.paging.nextPage)},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this.destroyed=!1,this.useIntersection&&"IntersectionObserver"in window&&(this.intersectionObserver=new IntersectionObserver((function(t){return e.buttonInView(t[0])}),{root:this.container?this.container.nativeElement:null}),this.intersectionObserver.observe(this.element.nativeElement)),this.hasNoMoreData=this.shouldShowNoMoreDataHint()},e.prototype.ngOnDestroy=function(){this.destroyed=!0,this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver.unobserve(this.element.nativeElement),clearTimeout(this.loadUntilIntersected))},e.prototype.loadMore=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return this.destroyed?[3,3]:(this.isLoading=!0,e&&e.stopPropagation(),this.hasMore?[4,this.paging.next()]:[3,2]);case 1:return t=n.sent(),this.paging=t.paging,this.onLoad.emit(t.data),this.intersectionLoading(),this.hasNoMoreData=this.shouldShowNoMoreDataHint(),[3,3];case 2:this.counter=0,this.isLoading=!1,n.label=3;case 3:return[2]}}))}))},e.prototype.intersectionLoading=function(){var e=this;this.useIntersection&&this.hasMore&&null!==this.loadUntilIntersected?(this.loadUntilIntersected=setTimeout((function(){return e.loadMore()}),this.getLoadingThreshold()),this.useIntersection=this.shouldSwitchMode()):(this.isLoading=!1,this.loadUntilIntersected=void 0)},e.prototype.getLoadingThreshold=function(){return this.LOAD_SAME_PAGE_THRESHOLD*this.counter++},e.prototype.shouldShowNoMoreDataHint=function(){return(0!==this.counter||this.noMoreDataHint)&&!this.hasMore&&!this.hidden},e.prototype.shouldSwitchMode=function(){return this.counter<this.maxIterations||this.hidden},e.prototype.buttonInView=function(e){e.isIntersecting?this.loadMore():this.loadUntilIntersected?(clearTimeout(this.loadUntilIntersected),this.loadUntilIntersected=null,this.isLoading=!1):this.loadUntilIntersected=null},e.ctorParameters=function(){return[{type:t.ElementRef}]},jc([t.Input()],e.prototype,"paging",void 0),jc([t.Input()],e.prototype,"useIntersection",void 0),jc([t.Input()],e.prototype,"hidden",void 0),jc([t.Input()],e.prototype,"container",void 0),jc([t.Input()],e.prototype,"class",void 0),jc([t.Input()],e.prototype,"maxIterations",void 0),jc([t.Input()],e.prototype,"noMoreDataHint",void 0),jc([t.Input()],e.prototype,"loadingTemplate",void 0),jc([t.Input()],e.prototype,"hideNoMoreDataHint",void 0),jc([t.Input()],e.prototype,"loadNextLabel",void 0),jc([t.Input()],e.prototype,"loadingLabel",void 0),jc([t.Output()],e.prototype,"onLoad",void 0),jc([t.HostBinding("class")],e.prototype,"hostClass",null),e=jc([t.Component({selector:"c8y-load-more",template:'<button\n class="btn btn-default btn-block text-center"\n (click)="loadMore($event)"\n [ngClass]="{ \'btn-pending\': isLoading }"\n *ngIf="hasMore && !(loadingTemplate && isLoading)"\n [style.visibility]="hidden ? \'hidden\' : \'visible\'"\n [style.height]="hidden ? \'1px\' : null"\n title="{{ \'Load more\' | translate }}"\n>\n <ng-container *ngIf="!isLoading">\n <span *ngIf="loadNextLabel; else loadPage" [innerHTML]="loadNextLabel | translate"></span>\n <ng-template #loadPage>\n <span translate ngNonBindable [translateParams]="{ pageNo: paging.currentPage + 1 }">\n Load page {{ pageNo }}</span\n >\n </ng-template>\n </ng-container>\n <ng-container *ngIf="isLoading">\n <span *ngIf="loadingLabel; else loading" [innerHTML]="loadingLabel | translate"></span>\n <ng-template #loading>\n <span translate ngNonBindable [translateParams]="{ pageNo: paging.currentPage + 1 }">\n Page {{ pageNo }} is loading…\n </span>\n </ng-template>\n </ng-container>\n</button>\n\n<ng-container *ngIf="hasNoMoreData && !hideNoMoreDataHint && !isLoading">\n <ng-container *ngTemplateOutlet="noMoreDataHint || finishHint"></ng-container>\n</ng-container>\n\n<ng-template #finishHint>\n <div class="legend form-block center last-record" title="{{ \'Last record\' | translate }}">\n <i [c8yIcon]="\'circle\'"></i>\n </div>\n</ng-template>\n\n<ng-container *ngIf="loadingTemplate && isLoading">\n <ng-container *ngTemplateOutlet="loadingTemplate"></ng-container>\n</ng-container>\n'})],e)}(),gu=function(){function e(e,t,n){this.tpl=e,this.vcr=t,this.componentFactoryResolver=n,this.cachedData=[],this.loadMoreMode="auto",this.dataPipe=a.pipe(o.tap()),this.maxIterations=10,this.unsubscribe$=new a.Subject}return Object.defineProperty(e.prototype,"shouldUseLoadMoreButton",{get:function(){return"auto"===this.loadMoreMode||"show"===this.loadMoreMode||"hidden"===this.loadMoreMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasMoreData",{get:function(){return this.loadMore&&this.loadMore.hasMore},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.cachedData.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForOf",{set:function(e){var t=this;e&&(this.obs$=(a.isObservable(e)?e:a.of(e)).pipe(o.map((function(e){if(null===e)return t.paging=null,[];var n=e.paging,a=e.data;return t.paging=n,a}))))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForLoadMore",{set:function(e){this.loadMoreMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForPipe",{set:function(e){e&&(this.dataPipe=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForNotFound",{set:function(e){this.notFoundTemplate=e,this.loadMore&&(this.loadMore.noMoreDataHint=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForMaxIterations",{set:function(e){this.maxIterations=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForLoadingTemplate",{set:function(e){this.loadingTemplate=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForLoadNextLabel",{set:function(e){this.loadNextLabel=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForRealtime",{set:function(e){this.realtime=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yForComparator",{set:function(e){this.comparator=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.handleRealtime()},e.prototype.ngOnChanges=function(e){var t=this;if(this.obs$&&(e.c8yForPipe||e.c8yForOf)){this.unsubscribePaging();var n=!this.hasMoreData&&!!e.c8yForPipe&&!e.c8yForOf;n&&(this.obs$=a.of(this.cachedData)),this.pagingSub=this.obs$.pipe(o.tap((function(e){n||(t.cachedData=e)}))).pipe((function(e){return t.dataPipe(e)})).subscribe((function(e){t.render(e,n)}))}},e.prototype.ngOnDestroy=function(){this.unsubscribePaging(),this.unsubscribe$.next(),this.unsubscribe$.complete()},e.prototype.handleRealtime=function(){var e=this;this.realtime&&(this.realtime.onCreate$().pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(t){return e.insert(t)})),this.realtime.onUpdate$().pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(t){return e.update(t)})),this.realtime.onDelete$().pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(t){return e.remove(ec.coerceNumberProperty(t))})))},e.prototype.render=function(e,t){var n=this;void 0===t&&(t=!1),this.vcr.clear(),e.forEach((function(e,t){var a={$implicit:e,index:t,length:n.length,hasMore:n.hasMoreData,loadMoreComponent:n.loadMore};n.vcr.createEmbeddedView(n.tpl,a)})),this.shouldUseLoadMoreButton&&(this.loadMore=this.createLoadMoreButtonComponent(t))},e.prototype.append=function(e){var t=this;e.forEach((function(e){var n=t.shouldUseLoadMoreButton?t.vcr.length-1:t.vcr.length,a={$implicit:e,index:n,length:t.length,hasMore:t.hasMoreData,loadMoreComponent:t.loadMore};t.vcr.createEmbeddedView(t.tpl,a,n)}))},e.prototype.loadMoreData=function(e){e.length>0&&this.append(e)},e.prototype.createLoadMoreButtonComponent=function(e){var t=this,n=this.componentFactoryResolver.resolveComponentFactory(fu),a=this.vcr.createComponent(n).instance;return a.paging=this.paging,a.useIntersection="auto"===this.loadMoreMode||"hidden"===this.loadMoreMode,a.hidden="hidden"===this.loadMoreMode,a.maxIterations=this.maxIterations,a.noMoreDataHint=this.notFoundTemplate,a.loadingTemplate=this.loadingTemplate,a.loadNextLabel=this.loadNextLabel,this.pagingSub=a.onLoad.pipe(o.map((function(e){return t.checkForDuplicates(e)})),o.tap((function(e){t.cachedData=t.cachedData.concat(e)}))).pipe((function(e){return t.dataPipe(e)})).subscribe((function(e){return t.loadMoreData(e)})),e&&s.assign(a,this.loadMore),a},e.prototype.insert=function(e){var t=0;if(this.comparator&&this.cachedData.length){var n=void 0;do{var a=this.vcr.get(t),o=s.get(a,"context.$implicit");(n=e&&o?this.comparator(e,o):0)<=0&&t++}while(n<=0&&t<this.cachedData.length)}if(t<this.cachedData.length||0===this.cachedData.length){var r={$implicit:e,index:t,length:this.length,hasMore:this.hasMoreData};this.cachedData.splice(t,0,e);var l=this.tpl.createEmbeddedView(r);this.vcr.insert(l,t)}},e.prototype.update=function(e){this.forMatchingEmbeddedViewRef((function(t){return t&&e&&t.id===e.id}),(function(t){t.context.$implicit=e,t.markForCheck()}))},e.prototype.remove=function(e){this.forMatchingEmbeddedViewRef((function(t){return t&&ec.coerceNumberProperty(t.id,NaN)===e}),(function(e){return e.destroy()}))},e.prototype.forMatchingEmbeddedViewRef=function(e,t){for(var n=0;n<this.vcr.length;n++){var a=this.vcr.get(n);e(s.get(a,"context.$implicit"))&&t(a)}},e.prototype.checkForDuplicates=function(e){var t=this;return this.realtime?e.filter((function(e){return!t.cachedData.some((function(t){return t.id===e.id}))})):e},e.prototype.unsubscribePaging=function(){this.pagingSub&&this.pagingSub.unsubscribe()},e.ctorParameters=function(){return[{type:t.TemplateRef},{type:t.ViewContainerRef},{type:t.ComponentFactoryResolver}]},jc([t.Input()],e.prototype,"c8yForOf",null),jc([t.Input()],e.prototype,"c8yForLoadMore",null),jc([t.Input()],e.prototype,"c8yForPipe",null),jc([t.Input()],e.prototype,"c8yForNotFound",null),jc([t.Input()],e.prototype,"c8yForMaxIterations",null),jc([t.Input()],e.prototype,"c8yForLoadingTemplate",null),jc([t.Input()],e.prototype,"c8yForLoadNextLabel",null),jc([t.Input()],e.prototype,"c8yForRealtime",null),jc([t.Input()],e.prototype,"c8yForComparator",null),e=jc([t.Directive({selector:"[c8yFor]"})],e)}(),yu=function(){function e(e){this.translateService=e,this.internalApps={administration:"Administration",cockpit:"Cockpit",devicemanagement:"Device management"}}return e.prototype.transform=function(e){void 0===e&&(e="Cumulocity");var t,n=this.getAppName(e);return t=this.isPublicApp(e)?"{{ appName | translate }} (public)":n,this.translateService.stream(t,{appName:n})},e.prototype.getAppName=function(e){var t=this.getFirstDefined([tc.get(e,"name"),tc.get(e,"contextPath"),e])||"";return this.internalApps[t]||t},e.prototype.getFirstDefined=function(e){return tc.find(e,tc.negate(tc.isUndefined))},e.prototype.isPublicApp=function(e){return Boolean(tc.get(e,"public"))},e.ctorParameters=function(){return[{type:p.TranslateService}]},e=jc([t.Pipe({name:"humanizeAppName"})],e)}(),vu=function(){function e(){}var n;return n=e,e.humanize=function(e){return void 0===e&&(e=""),e=e.replace(/\./g," ").replace(/c8y[\s,_]*/gi,"").replace(/_/g," ").replace(/([A-Z][a-z])/g," $1").replace(/^\$\.?/,"").replace(/^\s*/,"").replace(/\s*$/,"").replace(/\s+/g," "),s.upperFirst(e)},e.prototype.transform=function(e){return n.humanize(e)},e=n=jc([t.Pipe({name:"humanize"})],e)}(),bu=function(){function e(e,t){this.el=e,this.renderer=t,this.c8yMatch=/^c8y-/,this.klasses=[],this.currentClasses=""}return Object.defineProperty(e.prototype,"c8yIcon",{set:function(e){this.updateIcon(e)},enumerable:!0,configurable:!0}),e.prototype.isC8y=function(e){return this.c8yMatch.test(e)},e.prototype.getClasses=function(e){void 0===e&&(e="");var t="";if(e){var n=e.trim(),a=this.isC8y(n);t=(a?"c8y-icon":"")+" "+(a?n.replace(this.c8yMatch,"c8y-icon-"):"dlt-c8y-icon-"+n)}return t},e.prototype.updateIcon=function(e){var t=this,n=this.getClasses(e);n!==this.currentClasses&&(this.currentClasses.split(/\s/).filter((function(e){return e})).forEach((function(e){t.renderer.removeClass(t.el.nativeElement,e)})),n.split(/\s/).filter((function(e){return e})).forEach((function(e){t.renderer.addClass(t.el.nativeElement,e)})),this.currentClasses=n)},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},jc([t.Input()],e.prototype,"c8yIcon",null),e=jc([t.Directive({selector:"[c8yIcon]"})],e)}(),ju=["home","th","bar-chart-o","tasks","tachometer","bell","puzzle-piece","map-marker","location-arrow","globe","power-off","desktop","laptop","mobile","signal","qrcode","file","file-text","folder","folder-open","archive","ssd","book","bookmark","tag","flag","search","heart","star","bolt","cog","cogs","wrench","ban","user","users","sign-in","sign-out","upload","download","cloud-upload","cloud-download","cloud","hourglass","refresh","repeat","undo","lock","unlock","info","question-circle","exclamation-circle","bug","calendar","random","asterisk","key","link","chain-broken","external-link","picture-o","comment","bullhorn","phone","lightbulb-o","flask","cloud-network","exchange","code-fork","keyboard-o","terminal","code","clipboard","pencil","envelope","inbox","reply","share","thumbs-up","thumbs-down","check","plus","expand","compress","arrows","arrow-up","arrow-down","arrow-left","arrow-right","th-list","bars","table","columns","filter","sort","sort-up","sort-down","ellipsis-h","ellipsis-v","rss"];function wu(e){return function(t,n,a){var o=a.value;a.value=function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];var r="_"+n+"Memoized";return this[r]||(this[r]=s.memoize(o,e)),this[r].apply(this,t)}}}var Su=function(){function e(e,t,n){this.appState=e,this.inventory=t,this.user=n}return e.prototype.canEdit=function(e,t){return this.checkIfCanEdit(e,t)},e.prototype.hasRole=function(e){var t=this.appState.currentUser.value;if(!t)throw new Error("Roles can only be requested if the user is logged in.");return this.user.hasRole(t,e)},e.prototype.hasAllRoles=function(e){var t=this.appState.currentUser.value;if(!t)throw new Error("Roles can only be requested if the user is logged in.");return this.user.hasAllRoles(t,e)},e.prototype.hasAnyRole=function(e){var t=this.appState.currentUser.value;if(!t)throw new Error("Roles can only be requested if the user is logged in.");return this.user.hasAnyRole(t,e)},e.prototype.checkIfOwner=function(e){return Sc(this,void 0,void 0,(function(){var t,n,a;return Cc(this,(function(o){switch(o.label){case 0:return[4,this.appState.currentUser.value.userName];case 1:return t=o.sent(),[4,this.inventory.detail(e.id)];case 2:return n=o.sent(),a=n.data,n.res,[2,t===a.owner]}}))}))},e.prototype.checkWithRequest=function(e){var t=e.name,n={id:e.id,name:t};return this.inventory.update(n).then((function(e){return!0})).catch((function(e){return!1}))},e.prototype.checkIfCanEdit=function(e,t){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(n){switch(n.label){case 0:return[4,this.hasAnyRole(e)];case 1:return n.sent()?[2,!0]:[3,2];case 2:return[4,this.checkIfOwner(t)];case 3:return n.sent()?[2,!0]:[3,4];case 4:return[4,this.checkWithRequest(t)];case 5:if(n.sent())return[2,!0];n.label=6;case 6:return[2,!1]}}))}))},e.ctorParameters=function(){return[{type:Uc},{type:m.InventoryService},{type:m.UserService}]},jc([wu(s.property("id"))],e.prototype,"checkIfOwner",null),jc([wu(s.property("id"))],e.prototype,"checkWithRequest",null),e=jc([t.Injectable()],e)}(),Cu=function(){function e(e,t,n){this.template=e,this.container=t,this.permissions=n,this.allowAny=!1}return Object.defineProperty(e.prototype,"c8yIfAllowed",{set:function(e){this.rolesIds=Array.isArray(e)?e:e?[e]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yIfAllowedAllowAny",{set:function(e){this.allowAny=null===e||e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.rolesIds&&this.rolesIds.length&&!(this.allowAny?this.permissions.hasAnyRole(this.rolesIds):this.permissions.hasAllRoles(this.rolesIds))||this.container.createEmbeddedView(this.template)},e.ctorParameters=function(){return[{type:t.TemplateRef},{type:t.ViewContainerRef},{type:Su}]},jc([t.Input()],e.prototype,"c8yIfAllowed",null),jc([t.Input()],e.prototype,"c8yIfAllowedAllowAny",null),e=jc([t.Directive({selector:"[c8yIfAllowed]"})],e)}(),Iu=function(){function e(){}return e=jc([t.Component({selector:"c8y-loading",template:'\n <div class="p-24 p-relative d-inline-block" >\n <div class="spinner">\n <div class="rect1"></div>\n <div class="rect2"></div>\n <div class="rect3"></div>\n <div class="rect4"></div>\n <div class="rect5"></div>\n </div>\n </div>\n '})],e)}(),Pu=function(){function e(){}return e.prototype.transform=function(e,t,n){return t.apply(n||this,Array.isArray(e)?e:[e])},e=jc([t.Pipe({name:"map"})],e)}(),Ou=function(){function e(e,t,n,a){this.viewContainer=e,this.resolver=t,this.renderer=n,this.el=a,this.properties={}}return Object.defineProperty(e.prototype,"c8yOutlet",{set:function(e){if(e)if(this._element instanceof Element&&this.renderer.removeChild(this._element.parentElement,this._element),this.viewContainer.clear(),e instanceof t.TemplateRef)this.viewContainer.createEmbeddedView(e);else if(e instanceof Element){var n=this.renderer.parentNode(this.el.nativeElement);this.destroy(),this._element=e,this.renderer.insertBefore(n,this._element,this.el.nativeElement)}else{var a=this.resolver.resolveComponentFactory(e),o=this.viewContainer.createComponent(a);s.assign(o.instance,this.properties)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c8yOutletProperties",{set:function(e){this.properties=e},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.destroy()},e.prototype.destroy=function(){if(this._element){var e=this.renderer.parentNode(this._element);this.renderer.removeChild(e,this._element)}},e.ctorParameters=function(){return[{type:t.ViewContainerRef},{type:t.ComponentFactoryResolver},{type:t.Renderer2},{type:t.ElementRef}]},jc([t.Input()],e.prototype,"c8yOutlet",null),jc([t.Input()],e.prototype,"c8yOutletProperties",null),e=jc([t.Directive({selector:"[c8yOutlet]"})],e)}(),xu=function(){function e(){this.message="Loading…",this.progress=null}return jc([t.Input()],e.prototype,"message",void 0),jc([t.Input()],e.prototype,"progress",void 0),e=jc([t.Component({selector:"c8y-progress-bar",template:'<div>\n <p *ngIf="message">\n {{ message | translate }}\n </p>\n <div class="progress progress-striped active" *ngIf="progress !== null">\n <div\n class="progress-bar"\n role="progressbar"\n [attr.aria-valuenow]="progress"\n aria-valuemin="0"\n aria-valuemax="100"\n [style.width]="progress + \'%\'"\n ></div>\n </div>\n <div class="spinner p-relative" *ngIf="progress === null">\n <div class="rect1"></div>\n <div class="rect2"></div>\n <div class="rect3"></div>\n <div class="rect4"></div>\n <div class="rect5"></div>\n </div>\n</div>\n'})],e)}(),Eu=function(){function e(){}return e.prototype.transform=function(e){var t=e.firstName,n=void 0===t?"":t,a=e.lastName,o=void 0===a?"":a,s=e.userName,r=void 0===s?"":s,l=n.trim().split(/\s+/).shift().substr(0,1),i=o.trim().split(/\s+/).pop();return(l=i?l?l+". ":"":n.split(/\s+/).shift())||i?l+i:r},e=jc([t.Pipe({name:"shortenUserName"})],e)}(),ku=function(){function e(e,t){this.tenantService=e,this.applicationService=t}return e.prototype.isManagementTenant=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return[4,this.tenantService.current()];case 1:return[2,"management"===e.sent().data.name]}}))}))},e.prototype.isEnterpriseTenant=function(){return Sc(this,void 0,void 0,(function(){var e,t,n,a,o;return Cc(this,(function(s){switch(s.label){case 0:return[4,this.hasApp({name:"branding"})];case 1:return(t=s.sent())?[3,3]:[4,this.hasApp({name:"feature-branding"})];case 2:t=s.sent(),s.label=3;case 3:return e=t,[4,this.hasApp({name:"sslmanagement"})];case 4:return n=s.sent(),[4,this.hasApp({name:"feature-user-hierarchy"})];case 5:return a=s.sent(),[4,this.hasApp({name:"feature-broker"})];case 6:return o=s.sent(),[2,e&&n&&a&&o]}}))}))},e.prototype.hasApp=function(e){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){switch(t.label){case 0:return[4,this.applicationService.isAvailable(e)];case 1:return[2,t.sent().data]}}))}))},e.ctorParameters=function(){return[{type:m.TenantService},{type:m.ApplicationService}]},e=jc([t.Injectable()],e)}(),Tu=function(){function e(){this.LOCAL_STORAGE_KEY="userPreferences",this.store={};try{var e=window.localStorage.getItem(this.LOCAL_STORAGE_KEY);e&&(this.store=JSON.parse(e)||{})}catch(e){}}return e.prototype.get=function(e){return a.of(this.store[e])},e.prototype.set=function(e,t){return this.store[e]=t,this.saveJsonStore()},e.prototype.saveJsonStore=function(){return window.localStorage.setItem(this.LOCAL_STORAGE_KEY,JSON.stringify(this.store))},e}(),Au=function(){function e(e){this.inventory=e,this.TYPE="c8y_UserPreference"}return e.prototype.get=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return[4,this.inventory.list({fragmentType:e})];case 1:return[2,(t=n.sent().data).length?t[0][e]:void 0]}}))}))},e.prototype.set=function(e,t){return Sc(this,void 0,void 0,(function(){var n,a,o,s;return Cc(this,(function(r){switch(r.label){case 0:return[4,this.inventory.list({fragmentType:e})];case 1:return n=r.sent().data,(s={})[e]=t,s.type=this.TYPE,a=s,n.length?(a.id=n[0].id,o=this.inventory.update(a)):o=this.inventory.create(a),[2,o]}}))}))},e}(),_u=function(){function e(e,t,n){this.user=e,this.inventory=t,this.appState=n,this.LOCAL_STORAGE_KEY="userPreferences",this.storage={local:new Tu,inventory:new Au(this.inventory)},this.currentUser=this.appState.currentUser}return e.prototype.get=function(e){var t=this;return this.currentUser.pipe(o.first(),o.switchMap((function(n){return t.getForUser(e,n)})))},e.prototype.set=function(e,t){var n=this;return new Promise((function(a,s){n.currentUser.pipe(o.first()).subscribe((function(o){a(n.setForUser(e,t,o))}),s)}))},e.prototype.getForUser=function(e,t){var n=this.getRawKey(e,t),o=this.getStorage(t);return a.from(o.get(n))},e.prototype.setForUser=function(e,t,n){var a=this.getRawKey(e,n),o=this.getStorage(n);return Promise.resolve(o.set(a,t))},e.prototype.getRawKey=function(e,t){return""+e+t.userName.replace(/\./g,"__")},e.prototype.getStorage=function(e){return this.user.hasAllRoles(e,["ROLE_INVENTORY_READ","ROLE_INVENTORY_ADMIN"])?this.storage.inventory:this.storage.local},e.ctorParameters=function(){return[{type:m.UserService},{type:m.InventoryService},{type:Uc}]},e=jc([t.Injectable()],e)}();function Nu(e,t,n){return function(){var a=e.queryStringLang(),s=e.firstSupportedLanguage();a&&e.getSupported(a)?e.switchToLanguage(a):t.currentUser.pipe(o.map((function(e){return e&&e.userName})),o.filter((function(e){return!!e})),o.distinctUntilChanged(),o.switchMap((function(){return n.get("language")})),o.startWith(s),o.filter((function(e){return!!e})),o.distinctUntilChanged()).subscribe((function(t){e.switchToLanguage(t)}))}}var Du,Lu,Mu,Ru,qu,$u,Fu=new t.InjectionToken("iconList"),Uu=function(){function e(){}var n;return n=e,e.providers=function(){return Oc(c.DataModule.providers(),[{provide:qc,useValue:window.C8Y_APP||{},multi:!0},{provide:t.APP_INITIALIZER,useFactory:Nu,deps:[mu,Uc,_u],multi:!0},{provide:Fu,useValue:ju,multi:!1}],cu.providers(),[_u,$c,Uc,Su,ku,vu,yu,Eu,Pu,hu])},e.forRoot=function(){return{ngModule:n,providers:n.providers()}},e=n=jc([t.NgModule({imports:[i.CommonModule,cu,u.TooltipModule],exports:[bu,Ou,cu,i.CommonModule,yu,vu,Cu,Eu,gu,fu,Pu,xu,hu,Iu],declarations:[bu,Ou,vu,yu,Cu,Eu,gu,fu,Pu,xu,hu,Iu],entryComponents:[fu,Iu]})],e)}(),Bu=function(){function e(){this.navigatorOpen=!1,this.hasTabs=!1,this.isTabsHorizontal=!1,this.isPageToolbarExpanded=!1,this.uiActionBar=!0,this.items=[]}return Object.defineProperty(e.prototype,"hidden",{get:function(){return!(this.items&&this.items.length)},enumerable:!0,configurable:!0}),e.prototype.getSortedItems=function(e){return s.sortBy(s.filter(this.items,{placement:e}),this.byPriority)},e.prototype.byPriority=function(e){return-e.priority},jc([t.Input(),t.HostBinding("class.navigator-open")],e.prototype,"navigatorOpen",void 0),jc([t.Input(),t.HostBinding("class.has-tabs")],e.prototype,"hasTabs",void 0),jc([t.Input(),t.HostBinding("class.horizontal-tabs")],e.prototype,"isTabsHorizontal",void 0),jc([t.HostBinding("class.c8y-ui-action-bar")],e.prototype,"uiActionBar",void 0),jc([t.Input()],e.prototype,"items",void 0),jc([t.HostBinding()],e.prototype,"hidden",null),e=jc([t.Component({selector:"c8y-action-bar",template:'<div class="navbar-header">\n <button\n type="button"\n class="navbar-toggle collapsed"\n (click)="isPageToolbarExpanded = !isPageToolbarExpanded"\n >\n <span class="sr-only" translate>Toggle toolbar</span>\n <span class="icon-bar"></span>\n <span class="icon-bar"></span>\n <span class="icon-bar"></span>\n </button>\n</div>\n\n<div id="page-toolbar" class="navbar-collapse" [collapse]="!isPageToolbarExpanded">\n <ul class="nav navbar-nav navbar-left">\n <ng-container *ngFor="let item of getSortedItems(\'left\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n </ul>\n <ul class="nav navbar-nav navbar-right">\n <ng-container *ngFor="let item of getSortedItems(\'right\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n <li class="no-remove more-wrapper" *ngIf="getSortedItems(\'more\').length > 0">\n <div class="dropdown" dropdown>\n <button\n title="{{ \'More\' | translate }}…"\n class="dropdown-toggle c8y-dropdown d-flex"\n dropdownToggle\n aria-haspopup="true"\n aria-expanded="false"\n >\n <span class="text-truncate" translate>More…</span>\n <i [c8yIcon]="\'caret-down\'"></i>\n </button>\n <ul class="dropdown-menu dropdown-menu-right" *dropdownMenu>\n <ng-container *ngFor="let item of getSortedItems(\'more\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n </ul>\n <ul class="dropdown-menu visible-xs"> \n <ng-container *ngFor="let item of getSortedItems(\'more\')">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n </ul>\n </div>\n </li>\n </ul>\n</div>\n',host:{class:"c8y-ui-action-bar"}})],e)}(),Gu=function(){function e(){}return e=jc([t.NgModule({declarations:[Bu,Mc],imports:[l.BsDropdownModule,Uu,r.CollapseModule,n.RouterModule.forChild([])],exports:[Bu,Mc]})],e)}(),Hu=new t.InjectionToken("ActionFactory"),zu=function(e){function s(t,n){var s=e.call(this)||this;return s.injector=t,s.refreshTrigger=new a.Subject,s.state$=new a.BehaviorSubject(new Set),s.items$=xc(n,s.refreshTrigger,[function(){return s.injector.get(Hu,[])},Tc(s.state$)]).pipe(o.map((function(e){return Ac(e)})),o.shareReplay(1)),s}return vc(s,e),s.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),Vu=function(){function e(){this.isPageToolbarExpanded=!1,this.items=[]}return e.prototype.getByPriority=function(){return s.sortBy(this.items,this.byPriority)},e.prototype.invoke=function(e){e.action&&e.action.call()},e.prototype.byPriority=function(e){return-e.priority},jc([t.Input()],e.prototype,"items",void 0),e=jc([t.Component({selector:"c8y-action-outlet",template:'<div class="dropdown" dropdown *ngIf="items && items.length > 0">\n <button\n type="button"\n class="main-header-button dropdown-toggle c8y-dropdown"\n dropdownToggle\n aria-haspopup="true"\n aria-expanded="true">\n <i [c8yIcon]="\'plus-circle\'" class="icon-2x"></i>\n </button>\n\n <ul class="dropdown-menu cog-dropdown" *dropdownMenu>\n <ng-container *ngFor="let item of getByPriority()">\n <ng-container *c8yOutlet="item.template"></ng-container>\n <li *ngIf="item.label">\n <button title="{{ item.label | translate }}" [attr.disabled]="item.disabled ? \'disabled\' : null" (click)="invoke(item)">\n <i *ngIf="item.icon" [c8yIcon]="item.icon"></i>{{item.label | translate}}\n </button>\n </li>\n </ng-container>\n </ul>\n</div>\n'})],e)}(),Ku=function(){function e(e){this.actionService=e,this.disabled=!1,this.priority=0}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.actionService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.actionService.remove(this)},e.ctorParameters=function(){return[{type:zu}]},jc([t.Input()],e.prototype,"disabled",void 0),jc([t.Input()],e.prototype,"label",void 0),jc([t.Input()],e.prototype,"priority",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=jc([t.Component({selector:"c8y-action",template:"<ng-template #template>\n <li>\n <ng-content></ng-content>\n </li>\n</ng-template>"})],e)}(),Wu=function(){function e(){}return e=jc([t.NgModule({declarations:[Vu,Ku],imports:[Uu,l.BsDropdownModule,n.RouterModule.forChild([])],exports:[Vu,Ku]})],e)}(),Yu=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.state$=new a.BehaviorSubject([]),t.MAX_ALERTS=3,t.ALERT_TIMEOUT=3e3,t}return vc(n,e),Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),n.prototype.add=function(e){this.addAlert(e)},n.prototype.addByText=function(e,t,n){this.addAlert({text:t,type:e,detailedData:n})},n.prototype.list=function(){return this.state},n.prototype.remove=function(e){var t=this;this.changeAlerts(this.state.filter((function(n){return!t.areSame(e,n)})))},n.prototype.update=function(e,t){var n=this;this.changeAlerts(this.state.map((function(a){return n.areSame(e,a)&&Object.assign(a,t),a})))},n.prototype.removeLastDanger=function(){var e=this.state.reverse().find((function(e){return"danger"===e.type}));this.changeAlerts(this.state.filter((function(t){return t!==e})))},n.prototype.saveSuccess=function(e){var t=this;return function(){var n=e+" saved successfully";t.addByText("success",n)}},n.prototype.createSuccess=function(e){var t=this;return function(){var n=e+" created successfully";t.addByText("success",n)}},n.prototype.clearAll=function(){this.changeAlerts([])},n.prototype.success=function(e,t){this.addByText("success",e,t)},n.prototype.danger=function(e,t){this.addByText("danger",e,t)},n.prototype.info=function(e,t){this.addByText("info",e,t)},n.prototype.warning=function(e,t){this.addByText("warning",e,t)},n.prototype.addServerFailure=function(e,t){void 0===t&&(t="danger");var n,a=e.data,o=e.res,s=a&&a.message?a.message:null;a&&("object"==typeof a?n=a.exceptionMessage:"string"==typeof a&&(n=a));var r=!(!s&&!n);s||(s="A server error occurred."),r||(n={status:o.status,statusText:o.statusText,url:o.url}),this.addAlert({type:t,text:s,detailedData:n})},n.prototype.areSame=function(e,t){return e.text===t.text&&e.type===t.type&&s.isEqual(e.detailedData,t.detailedData)&&e.onClose===t.onClose&&e.onDetail===t.onDetail},n.prototype.changeAlerts=function(e){this.state$.next(e)},n.prototype.addAlert=function(e){var t=this;if(!e.text&&!e.type)throw new Error("Cannot add empty alert");this.state.find((function(n){return t.areSame(e,n)}))||(this.changeAlerts(Oc(this.state,[e])),this.hideAutomaticallyIfNeeded(e),this.removeOldestIfMax())},n.prototype.hideAutomaticallyIfNeeded=function(e){var t=this,n="success"===e.type,a=!e.detailedData,o=n&&a?this.ALERT_TIMEOUT:0;void 0!==e.timeout&&(o=e.timeout),o&&setTimeout((function(){return t.remove(e)}),o)},n.prototype.removeOldestIfMax=function(){if(this.state.length>this.MAX_ALERTS){var e=Pc(this.state).slice(1);this.changeAlerts(e)}},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n},token:n,providedIn:"root"}),n=jc([t.Injectable({providedIn:"root"})],n)}(Nc),Zu=function(){function e(){}return e=jc([t.Component({selector:"c8y-alert-details",template:"<ng-content></ng-content>"})],e)}(),Ju=function(){function e(e){this.alertService=e}return e.prototype.ngAfterViewInit=function(){var e=this;this.containDetailsComponent||(this.detailedData=null),this.viewInitTimeout=setTimeout((function(){return e.alertService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.alertService.remove(this)},e.ctorParameters=function(){return[{type:Yu}]},jc([t.Input()],e.prototype,"type",void 0),jc([t.Input()],e.prototype,"onDetail",void 0),jc([t.Input()],e.prototype,"onClose",void 0),jc([t.ViewChild("detailedData",{static:!1})],e.prototype,"detailedData",void 0),jc([t.ViewChild("text",{static:!1})],e.prototype,"text",void 0),jc([t.ContentChild(Zu,{static:!1})],e.prototype,"containDetailsComponent",void 0),e=jc([t.Component({selector:"c8y-alert",template:'<ng-template #text>\r\n <ng-content select="c8y-alert-text"></ng-content>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n<ng-template #detailedData>\r\n <ng-content select="c8y-alert-details"></ng-content>\r\n</ng-template>'})],e)}(),Xu=function(){function e(e,t){this.position=e,this.alertService=t,this.detailDisplayedAlert={},this.isStatic=!1,this.isStatic="static"===this.position}return Object.defineProperty(e.prototype,"alerts",{get:function(){return this.alertService.state$},enumerable:!0,configurable:!0}),e.prototype.getClass=function(e){var t=[];return"danger"!==e.type&&t.push("interact"),t.push("alert-"+e.type),t.join(" ")},e.prototype.close=function(e){e.onClose&&e.onClose(),this.alertService.remove(e)},e.prototype.showDetails=function(e){if(e.onDetail)return e.onDetail();this.detailDisplayedAlert=Object.assign({},e),this.detailDisplayedAlert.mode="raw",this.setDetailsContent(e)},e.prototype.hasDetails=function(e){return e.detailedData||e.onDetail},e.prototype.closeDetails=function(){this.detailDisplayedAlert={}},e.prototype.isDetailsShow=function(e){return this.alertService.areSame(e,this.detailDisplayedAlert)},e.prototype.isTemplateRef=function(e){return e instanceof t.TemplateRef},e.prototype.template=function(e){return this.isTemplateRef(e)?e:void 0},e.prototype.setDetailsContent=function(e){this.isTemplateRef(e.detailedData)||"string"==typeof e.detailedData?this.detailDisplayedAlert.contents=e.detailedData:this.detailDisplayedAlert.contents=JSON.stringify(e.detailedData,null,2)},e.ctorParameters=function(){return[{type:String,decorators:[{type:t.Attribute,args:["position"]}]},{type:Yu}]},jc([t.HostBinding("class.static")],e.prototype,"isStatic",void 0),e=jc([t.Component({selector:"c8y-alert-outlet",template:'<div\n class="alert animated fadeInRightBig m-t-16"\n *ngFor="let alert of alerts | async"\n [ngClass]="[getClass(alert), isDetailsShow(alert) ? \'expanded\' : \'\']"\n>\n <button title="{{ \'Close\' | translate }}" type="button" class="close" (click)="close(alert)">\n <span aria-hidden="true">&times;</span>\n <span class="sr-only">{{ \'Close\' | translate }}</span>\n </button>\n\n <div *ngIf="!isTemplateRef(alert.text); else template(alert.text)">\n <strong *ngIf="!alert.allowHtml" [innerText]="alert.text | translate" class="message"></strong>\n <strong *ngIf="alert.allowHtml" [innerHTML]="alert.text | translate" class="message"></strong>\n </div>\n <p *ngIf="hasDetails(alert) && !isDetailsShow(alert)" class="text-muted m-t-8">\n <button\n title="{{ \'Show details\' | translate }}"\n class="btn btn-clean"\n (click)="showDetails(alert)"\n >\n <i c8yIcon="chevron-down"></i>\n {{ \'Show details\' | translate }}\n </button>\n </p>\n <p *ngIf="hasDetails(alert) && isDetailsShow(alert)" class="text-muted m-t-8">\n <button title="{{ \'Hide details\' | translate }}" class="btn btn-clean" (click)="closeDetails()">\n <i c8yIcon="chevron-up"></i>\n {{ \'Hide details\' | translate }}\n </button>\n </p>\n <div *ngIf="isDetailsShow(alert)">\n <div *ngIf="!isTemplateRef(detailDisplayedAlert.contents); else template(alert.detailedData)">\n <pre><code [innerText]="detailDisplayedAlert.contents | translate"></code></pre>\n </div>\n </div>\n</div>\n'}),wc(0,t.Attribute("position"))],e)}(),Qu=function(){function e(){}return e=jc([t.Component({selector:"c8y-alert-text",template:"<ng-content></ng-content>"})],e)}(),ed=function(){function e(){}return e=jc([t.NgModule({imports:[Uu],exports:[Xu,Ju,Zu,Qu],declarations:[Xu,Ju,Zu,Qu]})],e)}(),td=function(){function e(e){this.children=[],this.parents=[],this.routerLinkExact=!0,this.open=!1,this.hidden=!1,this.draggable=!1,this.droppable=!1,this.dragged=!1,this.draggedHover=!1,this.confirm=void 0,this._priority=0,this.update(e)}return Object.defineProperty(e.prototype,"hasChildren",{get:function(){return this.children.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return"navigator_node_"+s.snakeCase(this.label)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"priority",{get:function(){if(this._priority)return this._priority;var e=this.children.map((function(e){return e.priority||0}));return e.length&&e.length?Math.max.apply(Math,Oc(e)):0},set:function(e){this._priority=e},enumerable:!0,configurable:!0}),e.prototype.openOnStart=function(e){return!1},e.prototype.add=function(e){if(e===this)throw new Error("Adding node to itself");-1===this.children.indexOf(e)&&this.children.push(e),-1===e.parents.indexOf(this)&&e.parents.push(this),this.updateChildren()},e.prototype.remove=function(e){var t=this.children.indexOf(e),n=e.parents.indexOf(this);t>-1&&this.children.splice(t,1),n>-1&&e.parents.splice(n,1),this.updateChildren()},e.prototype.update=function(e){e&&(Object.assign(this,e),void 0!==e.hidden&&this.parents.forEach((function(e){e.updateHidden()})))},e.prototype.find=function(e){if("string"==typeof e){var t=e.toLocaleLowerCase();e=function(e){var n=e.label;return t===n.toLowerCase()}}if("object"==typeof e&&(e=s.matches(e)),"function"!=typeof e)throw new Error("Invalid search predicate");return this.children.reduce((function(t,n){return t||n.find(e)}),this.children.find(e))},e.prototype.empty=function(){this.children.length=0},e.prototype.click=function(e){void 0===e&&(e={})},e.prototype.drop=function(e){e.stopPropagation(),clearTimeout(this.expandDragTimeout)},e.prototype.dragStart=function(e){e.stopPropagation(),e.dataTransfer.setData("node","node"),this.dragged=!0},e.prototype.dragEnd=function(e){e.stopPropagation(),this.dragged=!1,e.dataTransfer.clearData()},Object.defineProperty(e.prototype,"canDrop",{get:function(){return this.droppable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canNavigate",{get:function(){return void 0!==this.path},enumerable:!0,configurable:!0}),e.prototype.dragEnter=function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.draggedHover=!0,this.open||(this.expandDragTimeout=setTimeout((function(){return t.expand()}),1e3))},e.prototype.dragLeave=function(e){e.preventDefault(),e.stopPropagation(),this.draggedHover=!1,clearTimeout(this.expandDragTimeout)},e.prototype.expand=function(){this.open||(this.open=!0,this.click({open:!0,expander:!0}))},e.prototype.traverse=function(e){this.children&&this.children.forEach((function(t){e(t),t.traverse(e)}))},e.prototype.destroy=function(){},e.prototype.updateChildren=function(){this.sort(),this.updateHidden()},e.prototype.sort=function(){this.children.sort((function(e,t){return e.priority>t.priority?-1:e.priority<t.priority?1:(e.label||"").toLowerCase()<(t.label||"").toLowerCase()?-1:(e.label||"").toLowerCase()>(t.label||"").toLowerCase()?1:0}))},e.prototype.updateHidden=function(){void 0===this.path&&(this.hidden=!this.children.some((function(e){return!e.hidden})))},e}(),nd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vc(t,e),t.prototype.addRoot=function(e){var t;if(e.preventDuplicates&&(t=this.find((function(t){var n=t.path,a=t.parents,o=t.label;return n===e.path&&o===e.label&&a.some((function(t){return t.label===e.parent}))})))&&!t.hidden)return t.routerLinkExact=!1,t;var n,a=e.parent,o=this.createNode(e);return a&&("object"==typeof a?(n=this.find(a.label))&&n.update(a):"string"!=typeof a&&"function"!=typeof a||(n=this.find(a)),n||(n=this.createNode(a),this.find((function(e){return n===e}))||this.add(n))),(n||this).add(o),o},t.prototype.createNode=function(e){if(e instanceof td)return e;if("string"==typeof e)return new td({label:e});if("object"==typeof e)return new td(bc({},e,{parent:void 0}));throw new Error("Wrong type of node data")},t}(td),ad=new t.InjectionToken("NavigatorNodesFactory"),od=function(e){function s(t,n){var s=e.call(this)||this;s.injector=t,s.router=n,s.refreshTrigger=new a.Subject,s.state$=new a.BehaviorSubject(new Set),s.firstUrl=!0;var r=new nd;return s.items$=xc(n,s.refreshTrigger,[function(){return s.injector.get(ad,[])},Tc(s.state$)]).pipe(o.map((function(e){var t=e.filter((function(e){return!e.parent})),n=e.filter((function(e){return e.parent})),a=Ac(t).concat(Ac(n));return r.empty(),a.forEach((function(e){return r.addRoot(e)})),r.children})),o.shareReplay(1)),s}return vc(s,e),s.prototype.openOnFirstUrl=function(e){return!(!this.firstUrl||!e.path)&&(this.router.isActive(e.path,e.routerLinkExact)||e.openOnStart(this.router.url))},Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.refresh=function(){this.refreshTrigger.next(1)},s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),sd=function(e){function n(t,n){var s=e.call(this)||this;s.navigatorService=t,s.options=n,s.DELAY_TO_AVOID_FLICKERING_ON_ASYNC_NODES=1e3,s.hasItemsInNavigator$=s.navigatorService.items$.pipe(o.delay(s.DELAY_TO_AVOID_FLICKERING_ON_ASYNC_NODES),o.map((function(e){return!!e.length})),o.distinctUntilChanged()),s.state$=new a.BehaviorSubject({title:void 0,nav:{open:!1}}),s.title=void 0,s.header$=s.map((function(e){return e})),s.navigatorOpen$=s.map((function(e){return e.nav.open})).pipe(o.combineLatest(s.hasItemsInNavigator$),o.map((function(e){var t=Pc(e,2),n=t[0],a=t[1];return n&&a})));var r=document.querySelector("title");return s.title={elementRef:r,originalValue:r&&r.innerText},s}return vc(n,e),Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"navigatorHiddenOnStartup",{get:function(){return this.options.hideNavigator},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"largeWidth",{get:function(){return document.documentElement.clientWidth>1200},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldToggle",{get:function(){return this.largeWidth&&!this.navigatorHiddenOnStartup&&!this.state.nav.open},enumerable:!0,configurable:!0}),n.prototype.toggleNavigator=function(){this.state.nav.open=!this.state.nav.open,this.emitNewState()},n.prototype.closeNavigator=function(){this.state.nav.open=!1,this.emitNewState()},n.prototype.configNavigator=function(e){void 0===e&&(e={}),this.state.nav=Object.assign(this.state.nav,e),this.emitNewState()},n.prototype.changeTitle=function(e,t){void 0===t&&(t=!0),this.state.title=e,this.state.pageTitleUpdate=t,this.emitNewState()},n.prototype.changePageTitle=function(e){this.title.elementRef.innerText=e?e+" / "+this.title.originalValue:""+this.title.originalValue},n.prototype.verifyIfNavOpen=function(){var e=this;this.hasItemsInNavigator$.pipe(o.debounceTime(300)).subscribe((function(t){return t&&e.shouldToggle&&e.toggleNavigator()}))},n.prototype.shouldShowBreadcrumbs=function(){return this.options.breadcrumbs},n.ctorParameters=function(){return[{type:od},{type:$c}]},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n(t.ɵɵinject(od),t.ɵɵinject($c))},token:n,providedIn:"root"}),n=jc([t.Injectable({providedIn:"root"})],n)}(Nc),rd=new t.InjectionToken("TabsFactory"),ld=function(e){function s(t,n,s,r){var l=e.call(this)||this;return l.injector=t,l.translateService=s,l.options=r,l.refreshTrigger=new a.Subject,l.state$=new a.BehaviorSubject(new Set),l.items$=xc(n,l.refreshTrigger,[function(){return l.injector.get(rd,[])},Tc(l.state$)]).pipe(o.map((function(e){return l.prepareTabs(e)})),o.shareReplay(1),o.distinctUntilChanged()),l.orientation$=l.items$.pipe(o.map((function(e){var t=e.find((function(e){return e.orientation}));return t?t.orientation:l.options.tabsHorizontal?"horizontal":"vertical"})),o.distinctUntilChanged()),l}return vc(s,e),s.prototype.prepareTabs=function(e){return this.sortTabs(e.map((function(e){return bc({},e,{template:e.template instanceof t.ViewContainerRef?e.template:void 0})})).filter((function(e,t,n){return t===n.findIndex((function(t){return t.path===e.path}))})))},s.prototype.sortTabs=function(e){var t=this;return e.sort((function(e,n){var a=(n.priority||0)-(e.priority||0),o=t.translateService.instant(e.label),s=t.translateService.instant(n.label),r=o.localeCompare(s);return a||r}))},s.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},Object.defineProperty(s.prototype,"firstTab$",{get:function(){return this.items$.pipe(o.map((function(e){return e[0]})),o.filter(Boolean),o.first())},enumerable:!0,configurable:!0}),s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router},{type:p.TranslateService},{type:$c}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router),t.ɵɵinject(p.TranslateService),t.ɵɵinject($c))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),id=function(){function e(e,t,n,a,s,r){var l=this;this.tabs=e,this.ui=t,this.navigator=n,this.actionBar=a,this.options=s,this.headerService=r,this.showPoweredBy=!0,this.noAppsMargin$=this.headerService.map((function(e){var t=e.nav;return!t.open&&t.hiddenOnStartup})),this.tabsOrientation=this.options.tabsHorizontal?"horizontal":"vertical",this.ui.map((function(e){return e.lang})).pipe(o.distinctUntilChanged()).subscribe((function(){l.actionBar.refresh()})),this.showPoweredBy=!this.options.get("hidePowered")}return e.ctorParameters=function(){return[{type:ld},{type:Uc},{type:od},{type:Lc},{type:$c},{type:sd}]},e=jc([t.Component({selector:"c8y-bootstrap",template:'<c8y-login *ngIf="!(ui.currentUser | async)"></c8y-login>\n\n<div *ngIf="ui.currentUser | async" [class.head-open]="header.headerOpen">\n <c8y-header-bar #header></c8y-header-bar>\n <c8y-navigator-outlet\n [nodes]="navigator.items$ | async"\n [open]="headerService.navigatorOpen$ | async"\n >\n <header class="title navigator-slot-top">\n <div class="tenant-brand"></div>\n <c8y-app-icon\n [name]="(ui.state$ | async).app.name"\n [contextPath]="(ui.state$ | async).app.contextPath"\n ></c8y-app-icon>\n <span>{{ (ui.state$ | async).app | humanizeAppName | async }}</span>\n </header>\n <div class="powered-by navigator-slot-bottom" *ngIf="showPoweredBy">\n <p translate>powered by Cumulocity</p>\n </div>\n </c8y-navigator-outlet>\n\n <div class="alerts">\n <c8y-alert-outlet></c8y-alert-outlet>\n </div>\n <c8y-tabs-outlet\n #tabsComponent\n [tabs]="tabs.items$ | async"\n [navigatorOpen]="headerService.navigatorOpen$ | async"\n [orientation]="tabs.orientation$ | async"\n >\n </c8y-tabs-outlet>\n <c8y-action-bar\n #actionBarComponent\n [navigatorOpen]="headerService.navigatorOpen$ | async"\n [hasTabs]="tabsComponent.hasTabs"\n [isTabsHorizontal]="tabsComponent.isHorizontal"\n [items]="actionBar.items$ | async"\n >\n </c8y-action-bar>\n\n <div\n class="mcontainer"\n [ngClass]="{\n open: headerService.navigatorOpen$ | async,\n \'no-apps-margin\': noAppsMargin$ | async,\n \'horizontal-tabs\': tabsComponent.isHorizontal,\n \'vertical-tabs\': !tabsComponent.isHorizontal,\n \'has-tabs\': tabsComponent.hasTabs,\n \'has-action-bar\': !actionBarComponent.hidden\n }"\n >\n <div class="container-fluid">\n <router-outlet></router-outlet>\n <ng-content select="#c8y-legacy-view"></ng-content>\n \x3c!-- legacy ng-view, will not be migrated atm --\x3e\n </div>\n </div>\n</div>\n<c8y-cookie-banner></c8y-cookie-banner>\n'})],e)}(),cd=function(){function e(){}return jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"translate",void 0),jc([t.Input()],e.prototype,"label",void 0),jc([t.Input()],e.prototype,"path",void 0),jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=jc([t.Component({selector:"c8y-breadcrumb-item",template:"<ng-template #template>\n <ng-content></ng-content>\n</ng-template>"})],e)}(),ud=function(){function e(){this.showAll=!1,this.breadcrumbs=[]}return e.prototype.normalizePath=function(e){return e.replace(/^#\/?/,"")},jc([t.Input()],e.prototype,"breadcrumbs",void 0),e=jc([t.Component({selector:"c8y-breadcrumb-outlet",template:'<div\n class="breadcrumbs-container"\n [ngClass]="{\n multiple: breadcrumbs.length > 1,\n open: showAll\n }"\n *ngIf="breadcrumbs && breadcrumbs.length > 0"\n>\n <button\n *ngIf="breadcrumbs.length > 1"\n class="btn-show-all-breadcrumbs pull-left"\n (click)="showAll = !showAll"\n >\n <i\n *ngIf="!showAll"\n [c8yIcon]="\'caret-right\'"\n tooltip="{{ \'Show all breadcrumbs\' | translate }}"\n container="body"\n placement="top"\n ></i>\n <i\n *ngIf="showAll"\n [c8yIcon]="\'caret-down\'"\n tooltip="{{ \'Collapse breadcrumbs\' | translate }}"\n container="body"\n placement="top"\n ></i>\n </button>\n\n <ul class="breadcrumbs text-muted" *ngFor="let breadcrumb of breadcrumbs; let first = first">\n <ng-container *ngIf="first || showAll">\n <li class="text-muted" *ngFor="let item of breadcrumb.items; let firstItem = first">\n <span *ngIf="!firstItem"> > </span>\n <ng-container *c8yOutlet="item.template"></ng-container>\n <ng-container *ngIf="item.label">\n <a\n [routerLink]="normalizePath(item.path)"\n class="word-break"\n title="{{ item.label | translate }}"\n >\n <i [c8yIcon]="item.icon" *ngIf="firstItem" class="m-r-4"></i>\n <span>{{ item.label | translate }}</span>\n </a>\n </ng-container>\n </li>\n </ng-container>\n </ul>\n</div>\n'})],e)}(),dd=new t.InjectionToken("BreadcrumbFactory"),pd=function(e){function s(t,n){var s=e.call(this)||this;return s.injector=t,s.refreshTrigger=new a.Subject,s.state$=new a.BehaviorSubject(new Set),s.items$=xc(n,s.refreshTrigger,[function(){return s.injector.get(dd,[])},Tc(s.state$)]).pipe(o.map((function(e){return s.sortByPreferredPath(e)})),o.shareReplay(1)),s}return vc(s,e),Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},s.prototype.refresh=function(){this.refreshTrigger.next(1)},s.prototype.selectPreferredByPath=function(e){this.preferredPath=e,this.refresh()},s.prototype.sortByPreferredPath=function(e){var t=this;return this.preferredPath?e.sort((function(e){return e.items.find((function(e){return!!e.path.match(t.preferredPath)}))?-1:1})):e},s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),md=function(){function e(e){this.breadcrumbService=e}return e.prototype.ngAfterViewInit=function(){var e=this;this.items=this.contentChildItems.toArray(),this.viewInitTimeout=setTimeout((function(){return e.breadcrumbService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.breadcrumbService.remove(this)},e.ctorParameters=function(){return[{type:pd}]},jc([t.ContentChildren(cd)],e.prototype,"contentChildItems",void 0),e=jc([t.Component({selector:"c8y-breadcrumb",template:"<ng-template>\n <ng-content></ng-content>\n</ng-template>"})],e)}(),hd=function(){function e(){}return e=jc([t.NgModule({declarations:[md,cd,ud],imports:[n.RouterModule.forChild([]),Uu,u.TooltipModule.forRoot()],exports:[md,cd,ud]})],e)}(),fd=function(){function e(e){this.service=e,this.priority=0,this.nodeData=new td}return e.prototype.ngOnInit=function(){var e=this;this.ngOnChanges(),setTimeout((function(){return e.service.add(e.nodeData)}))},e.prototype.ngOnChanges=function(){this.nodeData.icon=this.icon,this.nodeData.label=this.label,this.nodeData.path=this.path,this.nodeData.priority=this.priority,this.nodeData.iconTemplate=this.icon?void 0:this.template,this.nodeData.icon=this.icon},e.prototype.ngOnDestroy=function(){this.service.remove(this.nodeData)},e.ctorParameters=function(){return[{type:od}]},jc([t.ViewChild("iconTpl",{static:!0})],e.prototype,"template",void 0),jc([t.Input()],e.prototype,"label",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"path",void 0),jc([t.Input()],e.prototype,"priority",void 0),e=jc([t.Component({selector:"c8y-navigator-item",template:"<ng-template #iconTpl><ng-content></ng-content></ng-template>"})],e)}(),gd=function(){function e(){}return Object.defineProperty(e.prototype,"icon",{get:function(){return this.node.icon||"cog"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconClass",{get:function(){return"dlt-c8y-icon-"+this.icon},enumerable:!0,configurable:!0}),jc([t.Input()],e.prototype,"node",void 0),e=jc([t.Component({selector:"c8y-navigator-icon",template:'<i class="icon" [c8yIcon]="icon"></i>'})],e)}(),yd=function(){function e(){this.buttons=[{label:"cancel",action:function(){return Promise.reject()}}],this.isOpen=!1,this.containerClass="",this.placement="right",this.outsideClick=!1}return e.prototype.show=function(e){return Sc(this,void 0,void 0,(function(){var t,n=this;return Cc(this,(function(a){switch(a.label){case 0:this.buttons=e||this.buttons,this.isOpen=!0,a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,new Promise((function(e,t){return n.click=function(n){return n().then(e).catch(t)}}))];case 2:return t=a.sent(),[3,5];case 3:throw a.sent();case 4:return this.isOpen=!1,[7];case 5:return[2,t]}}))}))},e.prototype.buttonStatus=function(e){return e?"btn-"+e:"btn-link btn-clean"},e.prototype.handleOutsideClick=function(){this.click((function(){return Promise.reject()}))},jc([t.ViewChild(ac.PopoverDirective,{static:!1})],e.prototype,"popover",void 0),jc([t.Input()],e.prototype,"buttons",void 0),jc([t.Input()],e.prototype,"message",void 0),jc([t.Input()],e.prototype,"title",void 0),jc([t.Input()],e.prototype,"isOpen",void 0),jc([t.Input()],e.prototype,"containerClass",void 0),jc([t.Input()],e.prototype,"placement",void 0),jc([t.Input()],e.prototype,"outsideClick",void 0),e=jc([t.Component({selector:"c8y-popover-confirm",template:'<span\n [popover]="popover"\n container="body"\n [isOpen]="isOpen"\n [popoverTitle]="title | translate"\n [placement]="placement"\n [containerClass]="containerClass"\n [outsideClick]="outsideClick"\n (onHidden)="handleOutsideClick()"\n></span>\n<ng-template #popover>\n <p class="m-b-8">\n {{ message | translate }}\n </p>\n <div class="popover-footer">\n <ng-container *ngFor="let button of buttons">\n <button\n title="{{ button.label | translate }}"\n class="btn btn-sm m-r-16"\n [ngClass]="buttonStatus(button.status)"\n (click)="click(button.action)"\n >\n {{ button.label | translate }}\n </button>\n </ng-container>\n </div>\n</ng-template>\n'})],e)}(),vd=function(){function e(e,n){this.componentFactoryResolver=e,this.navigator=n,this.nodeClick=new t.EventEmitter}var a;return a=e,e.prototype.ngAfterViewInit=function(){var e=this;this.childrenNodes.forEach((function(t){return t.parentNode=e})),this.viewInitTimeout=setTimeout((function(){e.updateIcon(),e.openOnFirstUrl(),e.expandParentIfActive(),e.node.confirm=e.confirm}))},e.prototype.openOnFirstUrl=function(){this.navigator.openOnFirstUrl(this.node)&&!this.node.open&&this.expandCollapse(!0)},Object.defineProperty(e.prototype,"expandTitle",{get:function(){return this.node.open?"Collapse":"Expand"},enumerable:!0,configurable:!0}),e.prototype.click=function(e,t){var n;switch(void 0===e&&(e="link"),e){case"expander":t&&(t.stopPropagation(),t.preventDefault()),n=!this.node.open;break;case"icon":case"link":n=!(!this.routerLinkActive||!this.routerLinkActive.isActive)||!this.node.open}this.handleExpandCollapse(n,e,t),this.nodeClick.emit(e)},e.prototype.expandCollapse=function(e,t,n){void 0===n&&(n={}),this.node.open=e,t&&this.childrenNodes.forEach((function(n){return n.expandCollapse(e,t)})),n.open=e,this.node.click(n)},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.node&&this.node.destroy()},e.prototype.handleExpandCollapse=function(e,t,n){var a;e===this.node.open||this.node.path&&!e&&"expander"!==t||this.expandCollapse(e,!1,((a={})[t]=!0,a.$event=n,a))},e.prototype.expandParentIfActive=function(){this.routerLinkActive&&this.routerLinkActive.isActive&&this.parentNode&&this.parentNode.expandCollapse(!0)},e.prototype.updateIcon=function(){this.node.iconTemplate?this.updateIconTemplate():this.updateIconComponent()},e.prototype.updateIconComponent=function(){var e=gd;this.node&&this.node.iconComponent&&(e=this.node.iconComponent),this.iconSlot.clear();var t=this.componentFactoryResolver.resolveComponentFactory(e);this.iconSlot.createComponent(t).instance.node=this.node},e.prototype.updateIconTemplate=function(){this.iconSlot.clear(),this.iconSlot.createEmbeddedView(this.node.iconTemplate)},e.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:od}]},jc([t.ViewChild("icon",{read:t.ViewContainerRef,static:!1})],e.prototype,"iconSlot",void 0),jc([t.Input()],e.prototype,"node",void 0),jc([t.Input()],e.prototype,"isRoot",void 0),jc([t.ViewChild(n.RouterLinkActive,{static:!1})],e.prototype,"routerLinkActive",void 0),jc([t.ViewChildren(a)],e.prototype,"childrenNodes",void 0),jc([t.Output()],e.prototype,"nodeClick",void 0),jc([t.ViewChild(yd,{static:!1})],e.prototype,"confirm",void 0),e=a=jc([t.Component({selector:"c8y-navigator-node-display",template:'<div\n class="slot"\n [hidden]="node.hidden"\n (dragstart)="node.dragStart($event)"\n (dragend)="node.dragEnd($event)"\n (drop)="node.drop($event)"\n [draggable]="node.draggable"\n [ngClass]="{ dragged: node.dragged }"\n>\n <ng-container>\n <a\n class="link"\n draggable="false"\n (dragover)="node.canDrop && $event.preventDefault()"\n (dragenter)="node.canDrop && node.dragEnter($event)"\n (dragleave)="node.canDrop && node.dragLeave($event)"\n title="{{node.label | translate}}"\n [attr.id]="isRoot ? node.id : undefined"\n [routerLink]="node.canNavigate ? node.path : undefined"\n [routerLinkActive]="node.canNavigate ? \'active\' : \'\'"\n [routerLinkActiveOptions]="{exact:node.routerLinkExact}"\n (click)="click(node.canNavigate ? \'link\' : \'expander\', $event)"\n [ngClass]="{\'root-link\':isRoot, open: node.open, parent: node.hasChildren, \'dragged-hover\': node.draggedHover && !node.dragged}"\n >\n <ng-container *ngTemplateOutlet="inner"></ng-container>\n </a>\n </ng-container>\n\n <div\n class="children panel-expand expand"\n *ngIf="node.children.length"\n [collapse]="!node.open"\n [isAnimated]="true"\n >\n <c8y-navigator-node-display\n *ngFor="let childNode of node.children"\n [node]="childNode"\n (nodeClick)="nodeClick.emit($event)"\n >\n </c8y-navigator-node-display>\n </div>\n</div>\n\n<ng-template #inner>\n \x3c!-- loader --\x3e\n <i\n class="icon-spin loadingIndicator"\n [c8yIcon]="\'circle-o-notch\'"\n *ngIf="node.loading && !isRoot"\n >\n </i>\n\n \x3c!-- icon --\x3e\n <div (click)="click(\'icon\', $event)">\n <ng-container #icon></ng-container>\n </div>\n\n \x3c!--title --\x3e\n <span>{{node.label | translate}}</span>\n\n <i\n class="expander"\n [c8yIcon]="\'chevron-down\'"\n *ngIf="node.hasChildren"\n (click)="click(\'expander\', $event)"\n title="{{expandTitle}}"\n >\n </i>\n\n <c8y-popover-confirm\n outsideClick="true"\n containerClass="navigator-popover"\n ></c8y-popover-confirm>\n</ng-template>\n'})],e)}(),bd=function(){function e(){this.quickLinks=[],this.helpAndSupport=[]}return Object.defineProperty(e.prototype,"_quickLinks",{set:function(e){e&&(this.quickLinks=e.filter((function(e){return"quicklink"===e.type})))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_helpAndSupport",{set:function(e){e&&(this.helpAndSupport=e.filter((function(e){return"doc"===e.type})))},enumerable:!0,configurable:!0}),jc([t.Input("quickLinks")],e.prototype,"_quickLinks",null),jc([t.Input("helpAndSupport")],e.prototype,"_helpAndSupport",null),jc([t.Input()],e.prototype,"app",void 0),e=jc([t.Component({selector:"c8y-right-drawer",template:'<div class="c8y-right-drawer">\n <div class="summary">\n <h4 class="text-light">\n {{ \'Welcome to\' | translate }} {{ app | humanizeAppName | async }}\n </h4>\n </div>\n\n <div *ngIf="quickLinks.length">\n <div class="legend form-block" translate>Quick links</div>\n <div class="quick-links-drawer">\n <ng-container *ngFor="let quickLink of quickLinks">\n <a\n class="quick-link"\n [href]="quickLink.url || \'#\'"\n (click)="quickLink.click && $event.preventDefault(); quickLink.click();"\n >\n <h2 *ngIf="quickLink.icon"><i class="{{ quickLink.icon }}"></i></h2>\n <img\n *ngIf="quickLink.iconSrc"\n [src]="quickLink.iconSrc"\n style="max-width:50px;"\n class="img-responsive center-block"\n onerror="this.style.display = \'none\'">\n {{ quickLink.label | translate }}\n </a>\n </ng-container>\n </div>\n </div>\n\n <div *ngIf="helpAndSupport.length">\n <div class="legend form-block m-t-24" translate>Help &amp; support</div>\n <div class="help-support" *ngFor="let link of helpAndSupport">\n <a\n class="help-and-support-link text-truncate"\n target="_blank"\n rel="noopener noreferrer"\n [href]="link.url"\n >\n <i [c8yIcon]="link.icon"></i>\n <span title="{{ link.label | translate }}" class="d-inline">\n {{ link.label | translate }}\n </span>\n </a>\n </div>\n </div>\n</div>\n'})],e)}(),jd=function(){function e(e,t,n){var a=this;this.headerService=e,this.element=t,this.zone=n,this.title=void 0,this.pageTitleUpdate=!0,this.headerService.map((function(e){return e.title})).subscribe((function(e){return a.title=e})),this.headerService.map((function(e){return e.pageTitleUpdate})).subscribe((function(e){return a.pageTitleUpdate=e})),this.zone.runOutsideAngular((function(){a.headerService.state$.pipe(o.debounceTime(100),o.filter((function(e){return e.pageTitleUpdate})),o.debounceTime(100),o.map((function(){return a.element.nativeElement.querySelector("h1")})),o.filter((function(e){return null!==e})),o.map((function(e){return e.innerText})),o.filter(Boolean)).subscribe((function(t){return e.changePageTitle(t)}))}))}return e.ctorParameters=function(){return[{type:sd},{type:t.ElementRef},{type:t.NgZone}]},e=jc([t.Component({selector:"c8y-title-outlet",template:'<div class="c8y-ui-title">\n <div class="title" *c8yOutlet="title"></div>\n</div>\n'})],e)}(),wd=function(){function e(e){this.headerService=e,this.pageTitleUpdate=!0}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.headerService.changeTitle(e.template,e.pageTitleUpdate)}))},e.prototype.ngOnDestroy=function(){this.headerService.state.title===this.template&&(clearTimeout(this.viewInitTimeout),this.headerService.changeTitle())},e.ctorParameters=function(){return[{type:sd}]},jc([t.Input()],e.prototype,"pageTitleUpdate",void 0),jc([t.ViewChild("template",{static:!0})],e.prototype,"template",void 0),e=jc([t.Component({selector:"c8y-title",template:'<ng-template #template>\n <h1 class="text-truncate">\n <ng-content></ng-content>\n </h1>\n</ng-template>\n\n'})],e)}(),Sd=new t.InjectionToken("SearchFactory"),Cd=function(e){function s(t,n){var s=e.call(this)||this;return s.injector=t,s.refreshTrigger=new a.Subject,s.state$=new a.BehaviorSubject(new Set),s.items$=xc(n,s.refreshTrigger,[function(){return s.injector.get(Sd,[])},Tc(s.state$)]).pipe(o.map((function(e){return Ac(e)})),o.shareReplay(1)),s}return vc(s,e),s.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),Id=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.state$=new a.BehaviorSubject({userMenuItems:new Set}),t}return vc(n,e),Object.defineProperty(n.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),n.prototype.add=function(e){this.state.userMenuItems.add(e),this.emitNewState()},n.prototype.remove=function(e){this.state.userMenuItems.delete(e),this.emitNewState()},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n},token:n,providedIn:"root"}),n=jc([t.Injectable({providedIn:"root"})],n)}(Nc),Pd=[{icon:"c8y-c8y-data",label:"Concepts guide`KEEP_ORIGINAL`",url:"/concepts/introduction",type:"doc"},{icon:"c8y-user",label:"User guide`KEEP_ORIGINAL`",url:"/users-guide/getting-started",type:"doc"},{icon:"c8y-device-management",label:"Device guides`KEEP_ORIGINAL`",url:"/devices/overview",type:"doc"},{icon:"c8y-book",label:"Cumulocity IoT Edge`KEEP_ORIGINAL`",url:"/edge/overview",type:"doc"},{icon:"c8y-tools",label:"Microservice SDK guide`KEEP_ORIGINAL`",url:"/microservice-sdk/introduction",type:"doc"},{icon:"c8y-tools",label:"Device SDK guide`KEEP_ORIGINAL`",url:"/device-sdk/introduction",type:"doc"},{icon:"c8y-smart-rest",label:"Web SDK guide`KEEP_ORIGINAL`",url:"/web/introduction",type:"doc"},{icon:"c8y-data-explorer",label:"Streaming analytics guide`KEEP_ORIGINAL`",url:"/apama/introduction",type:"doc"},{icon:"c8y-bookmark",label:"Reference guide`KEEP_ORIGINAL`",url:"/reference/rest-implementation",type:"doc"},{icon:"gavel",label:"Legal notices",url:"https://documentation.softwareag.com/legal/",type:"doc"}],Od=new t.InjectionToken("Hook docs"),xd=function(){function e(e,t,n,a){void 0===n&&(n=[]),this.options=e,this.app=t,n||(n=[]),n.push(this);var s=this.app.map((function(e){return e.supportUrl}));this.items$=xc(a,s,n).pipe(o.startWith([]),o.shareReplay(1))}return e.prototype.getBaseUrl=function(){return this.options.get("docsBaseUrl","https://www.cumulocity.com/guides")},Object.defineProperty(e.prototype,"templateStr",{get:function(){return this.options.get("guideHrefTemplate","${docsBaseUrl}${partialUrl}")},enumerable:!0,configurable:!0}),e.prototype.getUserGuideLink=function(e){return/^https?:/.test(e)?e:null===this.getBaseUrl?null:this.getLink(this.templateStr,e)},e.prototype.list=function(){return this.items$.pipe(o.filter((function(e){return!!e.length})),o.first()).toPromise()},e.prototype.refresh=function(){},e.prototype.get=function(){var e=this,t=this.options.get("docs",{}),n=t.links,a=t.noDefault,o=t.excludeDefault,r=void 0===o?[]:o,l=this.app.state.supportUrl,i=a?[]:Pd.map((function(t){return bc({},t,{url:e.getUserGuideLink(t.url)})})).filter((function(e){var t=e.url;return!r.some((function(e){return new RegExp(e).test(t)}))}));return n&&(n.map((function(e){if(s.isUndefined(e.type))return e.type="doc",e})),i=i.concat(n)),l&&i.push({icon:"comments",label:"Forum support",url:l,type:"doc"}),i},e.prototype.getLink=function(e,t){if(e)return e.replace(/\${docsBaseUrl}/,this.getBaseUrl()).replace(/\${partialUrl}/,this.prefixWithSlash(t))},e.prototype.prefixWithSlash=function(e){return void 0===e&&(e=""),""+(!(e&&/^\//.test(e))?"/":"")+e},e.ctorParameters=function(){return[{type:$c},{type:Uc},{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[Od]}]},{type:n.Router}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject($c),t.ɵɵinject(Uc),t.ɵɵinject(Od,8),t.ɵɵinject(n.Router))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"}),wc(2,t.Optional()),wc(2,t.Inject(Od))],e)}(),Ed=function(){function e(e,t,n,a,o,s,r){this.headerService=e,this.actionService=t,this.breadcrumbService=n,this.searchService=a,this.appState=o,this.userMenuService=s,this.docs=r,this.canToggle$=this.headerService.hasItemsInNavigator$,this.appState$=this.appState.state$,this.drawerOpen=!1,this.headerOpen=!1}return e.prototype.ngAfterViewInit=function(){this.headerService.verifyIfNavOpen()},e.prototype.toggle=function(){this.headerOpen=!this.headerOpen},e.ctorParameters=function(){return[{type:sd},{type:zu},{type:pd},{type:Cd},{type:Uc},{type:Id},{type:xd}]},e=jc([t.Component({selector:"c8y-header-bar",template:'<div\n class="app-main-header"\n [ngClass]="{\n open: headerService.navigatorOpen$ | async,\n drawerOpen: drawerOpen\n }"\n>\n <div class="header-bar">\n <button\n *ngIf="canToggle$ | async"\n type="button"\n class="navigator-toggle main-header-button"\n title="{{ \'Toggle navigator\' | translate }}"\n (click)="headerService.toggleNavigator()"\n > \n <i [c8yIcon]="\'outdent\'" *ngIf="!(headerService.navigatorOpen$ | async)"></i>\n <i [c8yIcon]="\'dedent-right\'" *ngIf="headerService.navigatorOpen$ | async"></i>\n </button>\n <div class="app-view">\n <c8y-app-icon\n [name]="(appState$ | async).app.name"\n [contextPath]="(appState$ | async).app.contextPath"\n ></c8y-app-icon>\n\n <span class="page-header">\n <c8y-title-outlet></c8y-title-outlet>\n <c8y-breadcrumb-outlet\n [breadcrumbs]="breadcrumbService.items$ | async"\n class="app-breadcrumbs"\n ></c8y-breadcrumb-outlet>\n </span>\n </div>\n <c8y-search-outlet\n title="{{ \'Search\' | translate }}"\n [search]="searchService.items$ | async"\n class="main-header-item"\n ></c8y-search-outlet>\n <c8y-action-outlet\n title="{{ \'Add\' | translate }}"\n [items]="actionService.items$ | async"\n class="main-header-item"\n ></c8y-action-outlet>\n <c8y-app-switcher\n title="{{ \'Application switcher\' | translate }}"\n class="main-header-item"\n ></c8y-app-switcher>\n <c8y-user-menu-outlet\n [items]="(userMenuService.state$ | async).userMenuItems"\n class="main-header-item"\n ></c8y-user-menu-outlet>\n\n <button\n title="{{ \'Toggle side drawer\' | translate }}"\n class="drawer-toggle main-header-button"\n *ngIf="(appState$ | async).showRightDrawer"\n (click)="drawerOpen = !drawerOpen"\n >\n <i [c8yIcon]="\'indent\'" *ngIf="drawerOpen"></i>\n <i [c8yIcon]="\'dedent\'" *ngIf="!drawerOpen"></i>\n </button>\n </div>\n <div class="head-toggler">\n <button title="{{ \'Toggle\' | translate }}" type="button" (click)="toggle()">\n <i [c8yIcon]="\'dedent-right\'"></i>\n </button>\n </div>\n <c8y-right-drawer\n *ngIf="(appState$ | async).showRightDrawer"\n [app]="(appState$ | async).app"\n [quickLinks]="docs.items$ | async"\n [helpAndSupport]="docs.items$ | async"\n >\n </c8y-right-drawer>\n <div class="loading-bar" [ngClass]="{ active: (appState$ | async).isLoading }"></div>\n</div>\n'})],e)}(),kd=function(){function e(e,t){var n=this;this.ui=e,this.applications=t;var s=this.ui,r=s.currentUser,l=s.currentTenant;a.combineLatest(r,l).pipe(o.first()).subscribe((function(e){var t=Pc(e,2),a=t[0],o=t[1];n.tenant=o,n.listAppsForUser(a)}))}return Object.defineProperty(e.prototype,"hideCloudApps",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype.isActive=function(e){return e.contextPath===this.ui.state.app.contextPath},e.prototype.getHref=function(e){return this.applications.getHref(e)},e.prototype.listAppsForUser=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return e?[4,this.applications.listByUser(e,{pageSize:1e3})]:[3,2];case 1:t=n.sent().data,this.apps=this.orderApps(this.filterApps(t)),n.label=2;case 2:return[2]}}))}))},e.prototype.filterApps=function(e){return e=this.filterVisible(e),e=this.filterCloud(e),e=this.filterDuplicates(e)},e.prototype.filterVisible=function(e){var t=["HOSTED","EXTERNAL"];return e.filter((function(e){return s.includes(t,e.type)&&!e.noAppSwitcher&&!s.get(e,"manifest.noAppSwitcher")}))},e.prototype.filterCloud=function(e){var t=this.hideCloudApps,n=function(e){return!!e.cloud};return t||(this.oneCloudApps=this.orderApps(e.filter(n))),e.filter((function(e){return!n(e)}))},e.prototype.filterDuplicates=function(e){var t=this;return e.filter((function(n){return!e.some((function(e){return n!==e&&n.contextPath&&n.contextPath===e.contextPath&&n.owner.tenant.id!==t.tenant.name}))}))},e.prototype.orderApps=function(e){return s.orderBy(e,(function(e){return e.name.toLowerCase()}))},e.ctorParameters=function(){return[{type:Uc},{type:m.ApplicationService}]},e=jc([t.Component({selector:"c8y-app-switcher",template:'<div class="app-switcher-dropdown" dropdown>\n <button\n class="main-header-button c8y-dropdown dropdown-toggle"\n id="appSwitcherDropdown"\n dropdownToggle\n >\n <i c8yIcon="th" class="icon-2x"></i>\n </button>\n <div\n *dropdownMenu\n class="app-switcher-dropdown-menu dropdown-menu"\n aria-labelledby="appSwitcherDropdown"\n >\n <div class="app-switcher-sagcloud" *ngIf="oneCloudApps && oneCloudApps.length > 0">\n <a\n title="{{ app.name | humanizeAppName | async }}"\n class="appLink"\n *ngFor="let app of oneCloudApps"\n [href]="getHref(app)"\n >\n <c8y-app-icon [app]="app" [name]="app.name" [contextPath]="app.contextPath"></c8y-app-icon>\n <span class="text-truncate-wrap">{{ app | humanizeAppName | async }}</span>\n </a>\n </div>\n <div class="app-switcher">\n <a\n title="{{ app.name | humanizeAppName | async }}"\n class="appLink"\n [ngClass]="isActive(app) ? \'active\' : \'\'"\n *ngFor="let app of apps"\n [href]="getHref(app)"\n c8yProductExperience\n [actionName]="\'appSwitched\'"\n [actionData]="{ applicationName: app && app.name }"\n >\n <c8y-app-icon [app]="app" [name]="app.name" [contextPath]="app.contextPath"></c8y-app-icon>\n <span class="text-truncate-wrap">{{ app | humanizeAppName | async }}</span>\n </a>\n </div>\n </div>\n</div>\n'})],e)}(),Td=function(){function e(e){this.options=e,this.name="",this.model={appIcon:"",showIcon:!0,iconClass:["c8y-icon"],appNameAbbr:"",iconStyle:{}},this.c8yAppIconsList={analyticsbuilder:"analytics-builder","analytics-builder":"analytics-builder",cockpit:"cockpit",devicemanagement:"device-management",administration:"administration",apamaepl:"apama-epl"},this.white=!1,this.defaultIconStyle={"background-repeat":"no-repeat","background-size":"contain",height:"36px",width:"36px"}}return e.prototype.ngOnInit=function(){this.model.appIcon=this.iconFromAppDefinition()||this.findStaticIcon();var e=this.iconUrlFromAppDefinition();e&&(this.model.iconStyle=s.assign(this.defaultIconStyle,{"background-image":e})),this.model.showIcon=!!this.model.appIcon||!s.isEmpty(this.model.iconStyle),this.model.iconClass=["c8y-icon",this.mapFontAwesomeToDelightIcons(this.model.appIcon),this.white?"c8y-icon-white":"c8y-icon-duocolor"].filter((function(e){return!!e})),this.model.appNameAbbr=this.name.substr(0,2)},e.prototype.findStaticIcon=function(){var e=this.contextPath||this.name,t=s.find(s.keys(this.c8yAppIconsList),(function(t){return e.indexOf(t)>-1})),n=this.c8yAppIconsList[t];return n?"c8y-icon-"+n:void 0},e.prototype.iconFromAppDefinition=function(){var e=this.app||this.options,t=["icon","class"];return s.get(e,t)||s.get(e,Oc(["manifest"],t))},e.prototype.iconUrlFromAppDefinition=function(){var e=this.app||this.options,t=["icon","url"];return s.get(e,t)||s.get(e,Oc(["manifest"],t))},e.prototype.mapFontAwesomeToDelightIcons=function(e){if(e){return e.replace(/fa-/gi,"dlt-c8y-icon-")}},e.ctorParameters=function(){return[{type:$c}]},jc([t.Input()],e.prototype,"contextPath",void 0),jc([t.Input()],e.prototype,"name",void 0),jc([t.Input()],e.prototype,"app",void 0),e=jc([t.Component({selector:"c8y-app-icon",template:'<i *ngIf="model.showIcon" [ngClass]="model.iconClass" [ngStyle]="model.iconStyle"></i>\n<span *ngIf="!model.showIcon" class="app-noicon"> {{model.appNameAbbr}}</span>\n',host:{class:"c8y-app-icon"}})],e)}(),Ad=function(){function e(e){this.headerService=e,this.open=!0,this.isShown$=new a.BehaviorSubject(!1)}return e.prototype.ngOnChanges=function(){this.isShown$.next(this.nodes&&this.nodes.length>0)},e.prototype.collapseNavigator=function(e){"link"!==e||this.headerService.largeWidth||this.headerService.closeNavigator()},e.prototype.trackByPathOrLabel=function(e,t){return t.path?t.path:t.label},e.ctorParameters=function(){return[{type:sd}]},jc([t.Input()],e.prototype,"nodes",void 0),jc([t.Input()],e.prototype,"open",void 0),e=jc([t.Component({selector:"c8y-navigator-outlet, c8y-ui-navigator",template:'<nav class="navigator" *ngIf="isShown$ | async" [ngClass]="{ open: open }">\n <ng-content select=".navigator-slot-top"></ng-content>\n <ul class="navigatorContent">\n <c8y-navigator-node-display (nodeClick)="collapseNavigator($event)" [node]="node" *ngFor="let node of nodes trackBy trackByPathOrLabel" [isRoot]="true"></c8y-navigator-node-display>\n </ul>\n <ng-content select=".navigator-slot-bottom"></ng-content>\n</nav>\n'})],e)}();($u=e.Status||(e.Status={})).SUCCESS="success",$u.WARNING="warning",$u.DANGER="danger",$u.INFO="info";var _d,Nd=((Du={})[e.Status.SUCCESS]="check-circle",Du[e.Status.WARNING]="exclamation-triangle",Du[e.Status.DANGER]="exclamation-circle",Du[e.Status.INFO]="info-circle",Du),Dd=((Lu={})[e.Status.SUCCESS]="text-"+e.Status.SUCCESS,Lu[e.Status.WARNING]="text-"+e.Status.WARNING,Lu[e.Status.DANGER]="text-"+e.Status.DANGER,Lu[e.Status.INFO]="text-"+e.Status.INFO,Lu),Ld=((Mu={})[e.Status.SUCCESS]="alert-"+e.Status.SUCCESS,Mu[e.Status.WARNING]="alert-"+e.Status.WARNING,Mu[e.Status.DANGER]="alert-"+e.Status.DANGER,Mu[e.Status.INFO]="alert-"+e.Status.INFO,Mu),Md=((Ru={})[m.OperationStatus.PENDING]="clock-o",Ru[m.OperationStatus.EXECUTING]="refresh",Ru[m.OperationStatus.SUCCESSFUL]="check-circle",Ru[m.OperationStatus.FAILED]="exclamation-circle",Ru),Rd=((qu={})[m.OperationStatus.PENDING]="text-info",qu[m.OperationStatus.EXECUTING]="text-info",qu[m.OperationStatus.SUCCESSFUL]="text-success",qu[m.OperationStatus.FAILED]="text-danger",qu),qd=function(){function n(t){var n=this;this.modal=t,this.status=e.Status.INFO,this._labels={ok:"OK",cancel:"Cancel"},this.result=new Promise((function(e,t){n.dismiss=function(){t(),n.modal.hide()},n.close=function(){e(!0),n.modal.hide()}}))}return Object.defineProperty(n.prototype,"labels",{get:function(){return this._labels},set:function(e){var t=e||{},n=t.ok,a=void 0===n?"OK":n,o=t.cancel,s=void 0===o?"Cancel":o;this._labels={ok:a,cancel:s}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"classIcon",{get:function(){return"dlt-c8y-icon-"+Nd[this.status]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"classAlert",{get:function(){return Ld[this.status]},enumerable:!0,configurable:!0}),n.prototype.ngOnDestroy=function(){this.dismiss()},n.ctorParameters=function(){return[{type:oc.BsModalRef}]},jc([t.Input()],n.prototype,"title",void 0),jc([t.Input()],n.prototype,"body",void 0),jc([t.Input()],n.prototype,"status",void 0),jc([t.Input()],n.prototype,"labels",null),n=jc([t.Component({selector:"c8y-confirm-modal",template:'<div class="c8y-prompt alert" [ngClass]="[classAlert]">\n <h3 class="m-b-16" *ngIf="title">\n <i class="dlt-c8y-icon" [ngClass]="[classIcon]"></i>\n <span *ngIf="title">{{ title | translate }}</span>\n </h3>\n <p class="text-break-word">{{ body | translate }}</p>\n <ng-content></ng-content>\n <div class="alert-footer">\n <button\n title="{{ labels.cancel | translate }}"\n class="btn btn-default"\n *ngIf="labels.cancel !== null"\n (click)="dismiss()"\n >\n {{ labels.cancel | translate }}\n </button>\n <button title="{{ labels.ok | translate }}" class="btn btn-primary" (click)="close()">\n {{ labels.ok | translate }}\n </button>\n </div>\n</div>\n'})],n)}(),$d=function(){function e(e){this.modal=e,this.onDismiss=new t.EventEmitter,this.onClose=new t.EventEmitter,this.disabled=!1,this.customFooter=!1,this._labels={ok:"OK",cancel:"Cancel"}}return Object.defineProperty(e.prototype,"labels",{get:function(){return this._labels},set:function(e){var t=e.ok,n=e.cancel;this._labels={ok:t,cancel:n}},enumerable:!0,configurable:!0}),e.prototype._dismiss=function(){var e=this,t=this.dismiss;!t&&this.modal&&(t=function(){return e.modal.hide()}),t&&t(),this.onDismiss.emit(!0)},e.prototype._close=function(){var e=this,t=this.close;!t&&this.modal&&(t=function(){return e.modal.hide()}),t&&t(),this.onClose.emit(!0)},e.prototype.onEnterKeyDown=function(e){var t=tc.isEmpty(this.labels.ok)!==tc.isEmpty(this.labels.cancel),n=!this.customFooter&&this.labels.cancel,a=!this.customFooter&&!this.disabled&&this.labels.ok;t&&n&&this._dismiss(),t&&a&&this._close()},e.ctorParameters=function(){return[{type:oc.BsModalRef,decorators:[{type:t.Optional}]}]},jc([t.Output()],e.prototype,"onDismiss",void 0),jc([t.Output()],e.prototype,"onClose",void 0),jc([t.Input()],e.prototype,"disabled",void 0),jc([t.Input()],e.prototype,"close",void 0),jc([t.Input()],e.prototype,"dismiss",void 0),jc([t.Input()],e.prototype,"title",void 0),jc([t.Input()],e.prototype,"body",void 0),jc([t.Input()],e.prototype,"customFooter",void 0),jc([t.Input()],e.prototype,"labels",null),jc([t.HostListener("document:keydown.enter",["$event"])],e.prototype,"onEnterKeyDown",null),e=jc([t.Component({selector:"c8y-modal",template:'<div class="modal-header">\n <ng-content select="[c8y-modal-title]"></ng-content>\n <h3 [hidden]="!title">\n {{ title | translate }}\n </h3>\n</div>\n<div class="modal-body">\n <p [hidden]="!title" class="text-center text-break-word">\n {{ body }}\n </p>\n <ng-content></ng-content>\n</div>\n<div\n class="modal-footer"\n *ngIf="!customFooter">\n <ng-content select="[c8y-modal-footer]"></ng-content>\n <button\n title="{{ labels.cancel | translate }}"\n *ngIf="labels.cancel"\n class="btn btn-default"\n (click)="_dismiss()"\n >\n {{ labels.cancel | translate }}\n </button>\n <button\n title="{{ labels.ok | translate }}"\n *ngIf="labels.ok"\n class="btn btn-primary"\n (click)="_close()"\n [disabled]="disabled"\n >\n {{ labels.ok | translate }}\n </button>\n</div>\n'}),wc(0,t.Optional())],e)}(),Fd=function(){function n(e){this.modalService=e}return n.prototype.confirm=function(t,n,a,o){return void 0===a&&(a=e.Status.INFO),void 0===o&&(o={}),Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(s){switch(s.label){case 0:return e={ok:o.ok||"Confirm",cancel:o.cancel||"Cancel"},[4,this.modalService.show(qd,{initialState:{title:t,body:n,labels:e,status:a}}).content.result];case 1:return[2,s.sent()]}}))}))},n.prototype.acknowledge=function(t,n,a,o){return void 0===a&&(a=e.Status.INFO),void 0===o&&(o="Confirm"),Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(s){switch(s.label){case 0:return e={ok:o,cancel:null},[4,this.modalService.show(qd,{initialState:{title:t,body:n,labels:e,status:a}}).content.result];case 1:return[2,s.sent()]}}))}))},n.ctorParameters=function(){return[{type:oc.BsModalService}]},n.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new n(t.ɵɵinject(oc.BsModalService))},token:n,providedIn:"root"}),n=jc([t.Injectable({providedIn:"root"})],n)}(),Ud=function(){function e(){}return e=jc([t.NgModule({imports:[oc.ModalModule.forRoot(),Uu,ac.PopoverModule.forRoot()],exports:[qd,$d,yd],declarations:[qd,$d,yd],providers:[Fd],entryComponents:[qd]})],e)}(),Bd=function(){function e(){}return e=jc([t.NgModule({declarations:[Ad,vd,fd,gd],imports:[n.RouterModule,r.CollapseModule.forRoot(),Uu,Ud],exports:[Ad,fd],entryComponents:[gd]})],e)}(),Gd=function(){function e(e){this.options=e,this.STORAGE_KEY="acceptCookieNotice",this.COOKIE_BANNER="cookieBanner",this.COOKIE_PREFERENCES_CONFIG="cookiePreferences",this.isCookieBannerShowed$=new a.Subject,this.cookieDescriptions={required:"These cookies are required to enable core site functionality. They perform a task or operation without which a site's functionality would not be possible.",functional:"These cookies are used to track site usage and to process my personal data to measure and improve usability and performance. We will neither forward this data to any third party nor use this data for direct marketing purposes. I recognize that I can opt in and out of these cookies at any time.",marketing:"These cookies are used to target advertising to a user."}}return e.prototype.getCookiePreferencesConfig=function(){return this.options.get(this.COOKIE_PREFERENCES_CONFIG)},e.prototype.getCookieBannerSettings=function(){return this.options.get(this.COOKIE_BANNER)||{}},e.prototype.setCookies=function(e){var t=bc({},e);Object.entries(t).forEach((function(e){var n=Pc(e,2),a=n[0],o=n[1];t[a]="string"==typeof o||o})),localStorage.setItem(this.STORAGE_KEY,JSON.stringify(t))},e.prototype.shouldShowCookieBanner=function(){return!!this.getCookieBannerSettings().cookieBannerText&&!this.getUserCookiePreferences()},e.prototype.getUserCookiePreferences=function(){return JSON.parse(localStorage.getItem(this.STORAGE_KEY))},e.prototype.isConfigCookiePreferencesDefined=function(){return!!this.getCookiePreferencesConfig()},e.prototype.isFunctionalCookieEnabled=function(){return!0===(this.getUserCookiePreferences()||{}).functional},e.prototype.getCookieDescription=function(e){var t=this.getCookiePreferencesConfig();return"string"==typeof t[e]?t[e]:this.cookieDescriptions[e]},e.prototype.transformCookiePreferencesToList=function(e){return Object.entries(e).map((function(e){var t=Pc(e,2),n=t[0];return{name:n,value:t[1],isReadonly:"required"===n}}))},e.prototype.transformCookiePreferencesListToCookiePreferences=function(e){return e.reduce((function(e,t){return e[t.name]=t.value,e}),{})},e.ctorParameters=function(){return[{type:$c}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject($c))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"})],e)}(),Hd=function(){function e(e,t,n,o){this.appState=e,this.options=t,this.cookieBannerService=n,this.userPreferencesService=o,this.tagFunction$=new a.BehaviorSubject(null),this.USER_PREFERENCES_KEY="gainsightEnabled",this.GAINSIGHT_URL="web-sdk.aptrinsic.com/api/aptrinsic.js?a=",this.GAINSIGHT_GLOBAL_SCOPE="aptrinsic",this.SCRIPT_EXECUTION_WAIT_TIME=500,this.OPTIONS_KEY_CATEGORY="gainsight",this.OPTIONS_KEY_NAME="api.key",this.isScriptLoaded=!1}return e.prototype.isGainsightDisabledInUserPreferences=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return[4,this.userPreferencesService.get(this.USER_PREFERENCES_KEY).toPromise()];case 1:return[2,!1===e.sent()]}}))}))},e.prototype.setFunctionalCookie=function(e){var t=this.cookieBannerService.getUserCookiePreferences();t&&(Object.keys(t).forEach((function(n){"functional"!==n||(t[n]=e)})),localStorage.setItem("acceptCookieNotice",JSON.stringify(t)))},e.prototype.getGainsightKey=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return e=this,(t=this.options.gainsightKey)?[3,2]:[4,this.options.getSystemOption(this.OPTIONS_KEY_CATEGORY,this.OPTIONS_KEY_NAME)];case 1:t=n.sent(),n.label=2;case 2:return e.gainsightKey=t,[2,this.gainsightKey]}}))}))},Object.defineProperty(e.prototype,"tagFunction",{get:function(){return window[this.GAINSIGHT_GLOBAL_SCOPE]},enumerable:!0,configurable:!0}),e.prototype.loadTag=function(e,t){return void 0===t&&(t=!0),Sc(this,void 0,void 0,(function(){var n,s,r=this;return Cc(this,(function(l){switch(l.label){case 0:return n=document.createElement("script"),[4,this.getGainsightKey()];case 1:return(s=l.sent())&&!this.isScriptLoaded&&(this.loadScriptTag(n,s),a.combineLatest(this.appState.currentUser,a.fromEvent(n,"load"),this.appState.state$.pipe(o.filter((function(e){return e.versions.backend})),o.map((function(e){return e.versions})),o.take(1))).pipe(o.delay(this.SCRIPT_EXECUTION_WAIT_TIME),o.filter((function(e){var t=Pc(e,2),n=t[0];return!(!t[1]||!n)}))).subscribe((function(n){var a=Pc(n,3),o=a[0],s=(a[1],a[2]),l=r.getInstanceIdFromUrl();t&&r.identify(o,e,l,s.ui.ngx,s.backend),r.isScriptLoaded=!0,r.tagFunction$.next(r.tagFunction)}))),[2]}}))}))},e.prototype.identify=function(e,t,n,a,o){var s=window,r=e.id,l=e.email,i=e.userName,c=e.firstName,u=e.lastName,d=t.name,p=t.customProperties,m=p&&p.externalReference;s[this.GAINSIGHT_GLOBAL_SCOPE]("identify",{id:r+"_"+d+"_"+n,email:l,userName:i,firstName:c,lastName:u,versionUI:a,versionBE:o,userLanguage:mu.defaultLang(),instanceId:n,externalReference:m},{id:d+"_"+n,instanceId:n})},e.prototype.triggerEvent=function(e,t){this.tagFunction&&e&&(e=e.replace(/ /g,"_"),this.tagFunction("track",e,t))},e.prototype.shouldLoadGainsightTag=function(e){return this.cookieBannerService.isConfigCookiePreferencesDefined()&&this.cookieBannerService.isFunctionalCookieEnabled()&&!this.isGainsightDisabled(e)},e.prototype.canEditProductExperienceSettings=function(){return Sc(this,void 0,void 0,(function(){var e,t,n;return Cc(this,(function(a){switch(a.label){case 0:return e=this.appState.currentTenant.value,t=e.customProperties,(n=!!this.gainsightKey)?[3,2]:[4,this.getGainsightKey()];case 1:n=a.sent()&&this.cookieBannerService.isConfigCookiePreferencesDefined()&&!this.isGainsightDisabled(t)&&!!this.cookieBannerService.getUserCookiePreferences(),a.label=2;case 2:return[2,n]}}))}))},e.prototype.isGainsightDisabled=function(e){return!1===(e&&e.gainsightEnabled)},e.prototype.loadScriptTag=function(e,t){try{var n=window,a=document.getElementsByTagName("script")[0],o=location.protocol,s=this.GAINSIGHT_GLOBAL_SCOPE;e.src=o+"//"+this.GAINSIGHT_URL+t,n[this.GAINSIGHT_GLOBAL_SCOPE]=n[this.GAINSIGHT_GLOBAL_SCOPE]||function(){(n[s].q=n[s].q||[]).push(arguments)},n[s].p=t,e.async=!0,a.parentNode.insertBefore(e,a)}catch(e){console.warn("Failed to load Gainsight PX",e)}},e.prototype.getInstanceIdFromUrl=function(){var e=location.hostname;return e.substring(e.indexOf(".")+1)},e.ctorParameters=function(){return[{type:Uc},{type:$c},{type:Gd},{type:_u}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(Uc),t.ɵɵinject($c),t.ɵɵinject(Gd),t.ɵɵinject(_u))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"})],e)}(),zd=function(){function e(e){this.gainsightService=e}return e.prototype.onClick=function(){this.actionName&&this.gainsightService.triggerEvent(this.actionName,this.actionData)},e.ctorParameters=function(){return[{type:Hd}]},jc([t.Input()],e.prototype,"actionName",void 0),jc([t.Input()],e.prototype,"actionData",void 0),jc([t.HostListener("click")],e.prototype,"onClick",null),e=jc([t.Directive({selector:"[c8yProductExperience]"})],e)}(),Vd=function(){function e(e,t,n){var s=this;this.appState=e,this.gainsightService=t,this.cookieBannerService=n,a.combineLatest([this.appState.currentTenant.pipe(o.filter(Boolean)),this.cookieBannerService.isCookieBannerShowed$]).subscribe((function(e){var t=Pc(e,2),n=t[0],a=t[1];return Sc(s,void 0,void 0,(function(){var e,t;return Cc(this,(function(o){switch(o.label){case 0:return a?[2]:(e=n.customProperties,n.name,(t=this.gainsightService.shouldLoadGainsightTag(e))?[4,this.gainsightService.isGainsightDisabledInUserPreferences()]:[3,2]);case 1:t=!o.sent(),o.label=2;case 2:return t&&this.gainsightService.loadTag(n),[2]}}))}))}))}return e.ctorParameters=function(){return[{type:Uc},{type:Hd},{type:Gd}]},e=jc([t.NgModule({declarations:[zd],exports:[zd],providers:[Hd]})],e)}(),Kd=function(){function e(e){this.alertService=e,this.search=[]}return e.prototype.getByPriority=function(){return tc.sortBy(this.search,this.byPriority)},e.prototype.byPriority=function(e){return-e.priority},e.ctorParameters=function(){return[{type:Yu}]},jc([t.Input()],e.prototype,"search",void 0),e=jc([t.Component({selector:"c8y-search-outlet",template:'<ng-container *ngFor="let item of getByPriority()">\n <ng-container *c8yOutlet="item.template"></ng-container>\n</ng-container>\n'})],e)}(),Wd=function(){function e(e){this.searchService=e,this.icon="search",this.priority=0,this.search=new t.EventEmitter,this.term=""}return e.prototype.onSearch=function(){this.search.emit(this)},e.prototype.ngAfterViewInit=function(){var e=this;this.template=void 0,this.viewInitTimeout=setTimeout((function(){return e.searchService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.searchService.remove(this)},e.ctorParameters=function(){return[{type:Cd}]},jc([t.Input()],e.prototype,"name",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"priority",void 0),jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),jc([t.Output()],e.prototype,"search",void 0),jc([t.Input()],e.prototype,"term",void 0),e=jc([t.Component({selector:"c8y-search",template:"<ng-template #template>\n <ng-content></ng-content>\n</ng-template>"})],e)}(),Yd=function(){function e(){this.pattern="",this.text="",this.elementClass="text-info",this.highlightedText=""}return e.prototype.ngOnChanges=function(){var e=s.escape(this.text||""),t=s.escape(this.pattern||""),n=s.escapeRegExp(t).replace(/\\\*/g,".*");this.highlightedText=e.replace(new RegExp(n,"i"),'<strong class="'+this.elementClass+'">$&</strong>')},jc([t.ViewChild("text",{read:t.ElementRef,static:!0})],e.prototype,"container",void 0),jc([t.Input()],e.prototype,"pattern",void 0),jc([t.Input()],e.prototype,"text",void 0),jc([t.Input()],e.prototype,"elementClass",void 0),e=jc([t.Component({selector:"c8y-highlight",template:'<span [innerHTML]="highlightedText"></span>'})],e)}(),Zd=function(){function e(){this.NO_RESULT_FOUND="No results found.",this.msg=this.NO_RESULT_FOUND}return Object.defineProperty(e.prototype,"_message",{set:function(e){e&&e.length>0?this.msg=e:this.msg=this.NO_RESULT_FOUND},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this.msg},enumerable:!0,configurable:!0}),jc([t.Input("message")],e.prototype,"_message",null),e=jc([t.Component({selector:"c8y-search-result-empty",template:'<div class="no-results">\n <div class="c8y-empty-state">\n <h1 c8yIcon="search"></h1>\n <div class="p-t-8">\n <p><strong>{{ message | translate }}</strong></p>\n <small translate>Refine your search terms.</small>\n </div>\n </div>\n</div>\n'})],e)}(),Jd=function(){function e(){}return e=jc([t.NgModule({declarations:[Kd,Wd,Yd,Zd],imports:[nc.FormsModule,l.BsDropdownModule,Uu,n.RouterModule.forChild([])],exports:[Kd,Wd,Yd,Zd]})],e)}(),Xd=function(){function e(e){this.userService=e,this.priority=0,this.click=new t.EventEmitter}return e.prototype.ngAfterViewInit=function(){var e=this;this.viewInitTimeout=setTimeout((function(){return e.userService.add(e)}))},e.prototype.ngOnDestroy=function(){clearTimeout(this.viewInitTimeout),this.userService.remove(this)},e.prototype.onClick=function(){this.click.emit(this)},e.ctorParameters=function(){return[{type:Id}]},jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"label",void 0),jc([t.Input()],e.prototype,"link",void 0),jc([t.Input()],e.prototype,"target",void 0),jc([t.Input()],e.prototype,"priority",void 0),jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),jc([t.Output()],e.prototype,"click",void 0),e=jc([t.Component({selector:"c8y-user-menu-item",template:'<ng-template #template>\n <li (click)="onClick()">\n <a class="interact" [attr.href]="link" [attr.target]="target">\n <i [c8yIcon]="icon"></i>\n {{ label | translate }}\n <ng-content></ng-content>\n </a>\n </li>\n</ng-template>\n'})],e)}(),Qd=function(){function n(e,t,n,a,s,r,l,i,c,u,d,p){var m=this;this.modal=e,this.user=t,this.ui=n,this.auth=a,this.client=s,this.alert=r,this.translate=l,this.userPreferences=i,this.modalService=c,this.c8yModalService=u,this.gainsightService=d,this.cookieBannerService=p,this.loading=!1,this.showProductUsageSetting=!1,this.lang=this.ui.state.lang,this.modalService.onHide.pipe(o.take(1)).subscribe((function(e){null!==e&&void 0!==m.changedLang&&m.translate.switchToLanguage(m.lang)}))}return n.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return this.updateUserInAppState(),e=this,[4,this.gainsightService.canEditProductExperienceSettings()];case 1:return e.showProductUsageSetting=n.sent(),this.showProductUsageSetting?(t=this,[4,this.gainsightService.isGainsightDisabledInUserPreferences()]):[3,3];case 2:t.currentUsageTrackingState=!n.sent()&&this.cookieBannerService.isFunctionalCookieEnabled(),n.label=3;case 3:return[2]}}))}))},n.prototype.onDismiss=function(){void 0!==this.changedLang&&this.translate.switchToLanguage(this.lang),this.modal.hide()},n.prototype.onLanguage=function(e){this.changedLang=e,this.translate.switchToLanguage(this.changedLang)},n.prototype.onProductExperience=function(e){this.usageTrackingState=e},n.prototype.updateAndClose=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:this.loading=!0,n.label=1;case 1:return n.trys.push([1,12,13,14]),this.changedLang&&this.changedLang!==this.lang?[4,this.persistLanguage(this.changedLang)]:[3,3];case 2:n.sent(),n.label=3;case 3:return this.currentUsageTrackingState===this.usageTrackingState?[3,8]:[4,this.userPreferences.set(this.gainsightService.USER_PREFERENCES_KEY,this.usageTrackingState)];case 4:return n.sent(),this.gainsightService.setFunctionalCookie(this.usageTrackingState),this.usageTrackingState?(this.gainsightService.loadTag(this.client.tenant),[3,7]):[3,5];case 5:return[4,this.gainsightTrackingAppReload()];case 6:n.sent(),n.label=7;case 7:n.label=8;case 8:return"OAUTH2"===e.customProperties.userOrigin?[3,11]:[4,this.user.updateCurrent(e)];case 9:return n.sent(),e.password&&this.updateCredentials(e.password),[4,this.updateUserInAppState()];case 10:n.sent(),n.label=11;case 11:return this.modal.hide(),this.alert.success("User saved."),[3,14];case 12:return t=n.sent(),this.alert.addServerFailure(t),[3,14];case 13:return this.loading=!1,[7];case 14:return[2]}}))}))},n.prototype.persistLanguage=function(t){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,5]),[4,this.c8yModalService.confirm("Reload recommended","To change the language in the entire application, we recommend you to reload the page. If you have any unsaved changes, you can reload later. What would you like to do?",e.Status.WARNING,{ok:"Reload now",cancel:"Reload later"})];case 1:return n.sent(),this.translate.saveInLocalStorage(t),[4,this.userPreferences.set("language",t)];case 2:return n.sent(),location.reload(),this.lang=t,[3,5];case 3:return n.sent(),this.translate.saveInLocalStorage(t),[4,this.userPreferences.set("language",t)];case 4:return n.sent(),this.lang=t,[3,5];case 5:return[2]}}))}))},n.prototype.gainsightTrackingAppReload=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.c8yModalService.confirm("Reload required","To change the tracking option in the entire application, you need to reload the page. If you have any unsaved changes, you can reload later. What would you like to do?",e.Status.WARNING,{ok:"Reload now",cancel:"Reload later"})];case 1:return t.sent(),location.reload(),[3,3];case 2:return t.sent(),[3,3];case 3:return[2]}}))}))},n.prototype.updateUserInAppState=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return[4,this.user.current()];case 1:return e=t.sent(),this.ui.currentUser.next(e.data),[2]}}))}))},n.prototype.updateCredentials=function(e){var t={password:e,user:this.ui.currentUser.value.id,tenant:this.client.tenant};this.auth.updateCredentials(t)},n.ctorParameters=function(){return[{type:oc.BsModalRef},{type:m.UserService},{type:Uc},{type:m.BasicAuth},{type:m.FetchClient},{type:Yu},{type:mu},{type:_u},{type:oc.BsModalService},{type:Fd},{type:Hd},{type:Gd}]},n=jc([t.Component({selector:"c8y-user-edit-modal",template:'<c8y-modal [customFooter]="true" [title]="\'Edit user\' | translate" (onDismiss)="onDismiss()">\n <c8y-user-edit\n [lang]="lang"\n [user]="ui.currentUser | async"\n [loading]="loading"\n [isUsageTrackingEnabled]="currentUsageTrackingState"\n [showProductUsageSetting]="showProductUsageSetting"\n (onLanguage)="onLanguage($event)"\n (onProductExperience)="onProductExperience($event)"\n (onUser)="updateAndClose($event)"\n (onCancel)="onDismiss()"\n >\n </c8y-user-edit>\n</c8y-modal>\n'})],n)}(),ep=function(){function e(e,t,n,a,o,s,r,l,i,c){this.client=e,this.basicAuth=t,this.cookieAuth=n,this.ui=a,this.user=o,this.tenant=s,this.realtime=r,this.alert=l,this.api=i,this.location=c,this.rememberMe=!1,this.TOKEN_KEY="_tcy8",this.TFATOKEN_KEY="TFAToken",this.isFirstLogin=!0,this.GREEN_MIN_LENGTH_DEFAULT=8,this.ERROR_MESSAGES={minlength:"Password must have at least 8 characters and no more than 32.",password_missmatch:"Password confirmation does not match.",maxlength:"Password must have at least 8 characters and no more than 32.",password_strength:"Your password is not strong enough. Please include numbers, lower and upper case characters",remote_error:"Server error occurred.",email:"Invalid email address.",password_change:"Your password is expired. Please set a new password.",password_reset_token_expired:"Password reset link expired. Please enter your email address to receive a new one.",tfa_pin_invalid:"The code you entered is invalid. Please try again.",pattern_phonenumber:'Invalid phone number format. Only digits, spaces, slashes ("/") and dashes ("-") allowed.',pattern_newPassword:"Password must have at least 8 characters and no more than 32 and can only contain letters, numbers and following symbols: `~!@#$%^&*()_|+-=?;:'\",.<>{}[]\\/",international_number_required:"International phone number required, in the format +49 9 876 543 210.",phone_number_error:"Could not update phone number.",pinAlreadySent:"The verification code was already sent. For a new verification code, please click on the link above.",passwordConfirm:"Password confirmation does not match.",tfaExpired:"Two-factor authentication token expired."},this.SUCCESS_MESSAGES={password_changed:"Password changed. You can now log in using new password.",password_reset_requested:"Password reset request has been sent. Please check your email.",resend_sms:"Verification code SMS resent.",send_sms:"Verification code SMS sent."},this.passwordStrengthSetting={enforcePasswordStrength:!1,greenMinLength:this.GREEN_MIN_LENGTH_DEFAULT,passwordStrengthValidity:!1},this.loginModeFilters={isOauth2Internal:function(e){var t=e.type,n=e.visibleOnLoginPage;return t===m.TenantLoginOptionType.OAUTH2_INTERNAL&&n},isBasic:function(e){var t=e.type,n=e.visibleOnLoginPage;return t===m.TenantLoginOptionType.BASIC&&n},isOauth2:function(e){var t=e.type,n=e.visibleOnLoginPage,a=e.grantType;return t===m.TenantLoginOptionType.OAUTH2&&n&&"AUTHORIZATION_CODE"===a}},this.localhostRegExp=new RegExp("localhost"),this.localhostIpRegExp=new RegExp("127.0.0.1"),this.showTenantRegExp=new RegExp("showTenant"),this.autoLogout(),this.initLoginOptions()}return e.prototype.getTenant=function(){return this.client.tenant},e.prototype.initLoginOptions=function(){var e=this.ui.state.loginOptions||[];this.loginMode=e.find(this.loginModeFilters.isOauth2Internal)||e.find(this.loginModeFilters.isBasic)||e.find(this.loginModeFilters.isOauth2)||{type:m.TenantLoginOptionType.BASIC},this.oauthOptions=e.find(this.loginModeFilters.isOauth2)||{}},e.prototype.redirectToOauth=function(){var e=this.oauthOptions.initRequest,t=(this.location?this.location._platformLocation:window).location.href,n=encodeURIComponent(t),a=(e.includes("?")?"&":"?")+"originUri="+n;window.location.href=""+e+a},e.prototype.autoLogout=function(){var e=this,t=/invalid\scredentials.*pin.*generate/i,n=function(e){return e&&"string"==typeof e.message&&t.test(e.message)};this.ui.currentUser.pipe(o.switchMap((function(t){return t?e.api.hookResponse((function(e){return 401===e.response.status})):a.EMPTY}))).subscribe((function(t){return Sc(e,void 0,void 0,(function(){var e,a,o,s=this;return Cc(this,(function(r){switch(r.label){case 0:return e=t.response,a=!1,n(e.data)?(a=!0,[3,3]):[3,1];case 1:return"function"!=typeof e.json?[3,3]:[4,e.clone().json()];case 2:o=r.sent(),n(o)&&(a=!0),r.label=3;case 3:return a&&(this.logout(!1),setTimeout((function(){return s.alert.danger(s.ERROR_MESSAGES.tfaExpired)}),500)),[2]}}))}))}))},e.prototype.getGreenMinLength=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return[4,this.getBasicAuthLoginOption()];case 1:return e=(t.sent()||{greenMinLength:null}).greenMinLength,this.passwordStrengthSetting.greenMinLength=e||this.GREEN_MIN_LENGTH_DEFAULT,[2,this.passwordStrengthSetting.greenMinLength]}}))}))},e.prototype.getEnforcePasswordStrength=function(e){return Sc(this,void 0,void 0,(function(){var t=this;return Cc(this,(function(n){return[2,this.getBasicAuthLoginOption(e).then((function(e){var n=s.get(e,"enforceStrength");return s.isString(n)?t.passwordStrengthSetting.enforcePasswordStrength="true"===n:t.passwordStrengthSetting.enforcePasswordStrength=!!n,t.passwordStrengthSetting.enforcePasswordStrength}))]}))}))},e.prototype.getPasswordStrengthValidity=function(e){return Sc(this,void 0,void 0,(function(){var t=this;return Cc(this,(function(n){return[2,this.getBasicAuthLoginOption(e).then((function(e){var n=s.get(e,"strengthValidity");return s.isString(n)?t.passwordStrengthSetting.passwordStrengthValidity="true"===n:t.passwordStrengthSetting.passwordStrengthValidity=!!n,t.passwordStrengthSetting.passwordStrengthValidity}))]}))}))},e.prototype.getPasswordStrengthEnforced=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){return t=e&&e.refresh,[2,Promise.all([this.getEnforcePasswordStrength(t),this.getPasswordStrengthValidity(t)]).then((function(e){var t=Pc(e,2),n=t[0],a=t[1];return n||a}))]}))}))},e.prototype.cleanMessages=function(){this.alert.clearAll()},e.prototype.addSuccessMessage=function(e){var t=this.SUCCESS_MESSAGES[e];t&&this.alert.add({text:t,type:"success",timeout:0})},e.prototype.getAuthStrategy=function(){var e=this.cookieAuth,t=this.getStoredToken(),n=this.getStoredTfaToken();return t&&(e=this.basicAuth,this.setCredentials({token:t,tfa:n},this.basicAuth)),e},e.prototype.useBasicAuth=function(e){return this.setCredentials(e,this.basicAuth),this.basicAuth},e.prototype.login=function(e,t){return void 0===e&&(e=this.getAuthStrategy()),Sc(this,void 0,void 0,(function(){var n,a,o,s,r,l;return Cc(this,(function(i){switch(i.label){case 0:return this.client.setAuth(e),[4,this.tenant.current()];case 1:return n=i.sent(),a=n.data,[4,this.switchLoginMode(t)];case 2:return i.sent()&&(e=this.cookieAuth),[4,this.user.current()];case 3:return o=i.sent(),s=o.data,[4,this.verifyAppAccess()];case 4:return i.sent(),r=this.getSupportUserName(t),(l=this.setCredentials({tenant:a.name,user:(r?r+"$":"")+s.userName},e))&&this.storeBasicAuthToken(l),[4,this.authFulfilled(a,s,r)];case 5:return i.sent(),[2]}}))}))},e.prototype.authFulfilled=function(e,t,n){return Sc(this,void 0,void 0,(function(){var a;return Cc(this,(function(o){switch(o.label){case 0:return e?[3,2]:[4,this.tenant.current()];case 1:a=o.sent().data,e=a,this.client.tenant=e.name,o.label=2;case 2:return t?[3,4]:[4,this.user.current()];case 3:a=o.sent().data,t=a,o.label=4;case 4:return n||(n=null),this.ui.setUser({user:t,supportUserName:n}),this.ui.currentTenant.next(e),[2]}}))}))},e.prototype.switchLoginMode=function(e){return Sc(this,void 0,void 0,(function(){var t,n,a;return Cc(this,(function(o){switch(o.label){case 0:return(t=this.isPasswordGrantLogin(e))&&e?[4,this.generateOauthToken(e)]:[3,6];case 1:if((n=o.sent()).ok)return[3,5];o.label=2;case 2:return o.trys.push([2,4,,5]),[4,n.json()];case 3:throw a=o.sent(),{res:n,data:a};case 4:throw o.sent();case 5:this.client.setAuth(this.cookieAuth),this.cleanLocalStorage(),this.basicAuth.logout(),o.label=6;case 6:return[2,t]}}))}))},e.prototype.generateOauthToken=function(e){return Sc(this,void 0,void 0,(function(){var t,n;return Cc(this,(function(a){switch(a.label){case 0:return this.isPasswordGrantLogin(e)&&e?(t=new URLSearchParams({grant_type:"PASSWORD",username:e.user,password:e.password,tfa_code:e.tfa}),n=new URLSearchParams(this.loginMode.initRequest.split("?").pop()),e.tenant=n.get("tenant_id"),[4,this.client.fetch("tenant/oauth?"+n.toString(),{method:"POST",body:t.toString(),headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8"}})]):[3,2];case 1:return[2,a.sent()];case 2:return[2]}}))}))},e.prototype.isPasswordGrantLogin=function(e){return!(this.isSupportUser(e)||!this.loginMode||this.loginMode.type!==m.TenantLoginOptionType.OAUTH2_INTERNAL)},e.prototype.isSupportUser=function(e){return e&&e.user.includes("$")},e.prototype.showTenant=function(){return!this.ui.state.loginOptions||this.isLocal()||this.isShowTenant()},e.prototype.logout=function(e){return void 0===e&&(e=!0),Sc(this,void 0,void 0,(function(){var t,n;return Cc(this,(function(a){switch(a.label){case 0:t=null,a.label=1;case 1:return a.trys.push([1,4,5,6]),[4,this.reset()];case 2:return n=Pc.apply(void 0,[a.sent(),2]),n[0],[4,n[1].json()];case 3:return t=a.sent(),[3,6];case 4:return a.sent(),this.alert.removeLastDanger(),[3,6];case 5:return t&&t.url?this.redirect(t.url):e&&(this.location.replaceState({},"","",""),window.location.reload()),[7];case 6:return[2]}}))}))},e.prototype.reset=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){return this.cleanLocalStorage(),this.cleanSessionStorage(),this.realtime.disconnect(),this.ui.currentUser.next(null),[2,Promise.all([this.basicAuth.logout(),this.cookieAuth.logout()])]}))}))},e.prototype.saveTFAToken=function(e,t){t.setItem(this.TFATOKEN_KEY,e)},e.prototype.verifyAppAccess=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.ui.loadManifest()];case 1:return t.sent(),[3,3];case 2:if(!(e=t.sent()).res||404!==e.res.status||!this.isLocal())throw e;return[3,3];case 3:return[2]}}))}))},e.prototype.setCredentials=function(e,t){e.tenant&&(this.client.tenant=e.tenant);var n=this.basicAuth.updateCredentials({tenant:e.tenant,user:e.user}),a=bc({token:n},e);return t.updateCredentials(a)},e.prototype.isLocal=function(){var e=window.location.hostname;return this.localhostIpRegExp.test(e)||this.localhostRegExp.test(e)},e.prototype.saveToken=function(e,t){t.setItem(this.TOKEN_KEY,e)},e.prototype.storeBasicAuthToken=function(e){this.saveToken(e,sessionStorage),this.rememberMe&&this.saveToken(e,localStorage)},e.prototype.cleanLocalStorage=function(){localStorage.removeItem(this.TOKEN_KEY),localStorage.removeItem(this.TFATOKEN_KEY)},e.prototype.cleanSessionStorage=function(){sessionStorage.removeItem(this.TOKEN_KEY),sessionStorage.removeItem(this.TFATOKEN_KEY)},e.prototype.isShowTenant=function(){return this.showTenantRegExp.test(window.location.href)},e.prototype.redirect=function(e){window.location.href=e},e.prototype.getBasicAuthLoginOption=function(e){return Sc(this,void 0,void 0,(function(){var t,n;return Cc(this,(function(a){switch(a.label){case 0:return e?[4,this.ui.refreshLoginOptions()]:[3,2];case 1:a.sent(),a.label=2;case 2:return t=this.ui.state.loginOptions||[],n=t.find((function(e){return"BASIC"===e.type})),[2,Promise.resolve(n)]}}))}))},e.prototype.getSupportUserName=function(e){return void 0===e&&(e=this.getStoredCredentials()),e?e.user.match(/^(.+\/)?((.+)\$)?(.+)?$/)[3]:null},e.prototype.getStoredCredentials=function(){var e=this.getStoredToken();return e?this.decodeToken(e):null},e.prototype.getStoredToken=function(){return localStorage.getItem(this.TOKEN_KEY)||sessionStorage.getItem(this.TOKEN_KEY)},e.prototype.getStoredTfaToken=function(){return localStorage.getItem(this.TFATOKEN_KEY)||sessionStorage.getItem(this.TFATOKEN_KEY)},e.prototype.decodeToken=function(e){var t=decodeURIComponent(escape(window.atob(e))).match(/(([^/]*)\/)?([^/:]+):(.+)/);return{tenant:t[2],user:t[3],password:t[4]}},e.ctorParameters=function(){return[{type:m.FetchClient},{type:m.BasicAuth},{type:m.CookieAuth},{type:Uc},{type:m.UserService},{type:m.TenantService},{type:m.Realtime},{type:Yu},{type:c.ApiService},{type:i.LocationStrategy,decorators:[{type:t.Optional}]}]},e=jc([t.Injectable(),wc(9,t.Optional())],e)}(),tp=function(){function e(e,n,a,o,s){this.user=e,this.ui=n,this.client=a,this.alert=o,this.loginService=s,this.passwordConfirmedEmitter=new t.EventEmitter,this.loading=!1}return e.prototype.passwordConfirm=function(){return Sc(this,void 0,void 0,(function(){var e,t,n,a,o;return Cc(this,(function(r){switch(r.label){case 0:if(!this.password)return[3,5];e=this.ui.currentSupportUserName.value,t=this.ui.currentUser.value.id,n={password:this.password,user:(e?e+"$":"")+t,tenant:this.client.tenant},r.label=1;case 1:return r.trys.push([1,3,4,5]),this.loading=!0,a=s.clone(this.loginService.useBasicAuth({})),delete n.tfa,a.updateCredentials(n),[4,this.createNewClient(a,this.client.baseUrl).user.current()];case 2:return r.sent(),this.emitSuccessAndClose(),[3,5];case 3:return(o=r.sent()).res&&401===o.res.status&&o.data&&/pin|totp/i.test(o.data.message)?this.emitSuccessAndClose():this.alert.danger("Provided password doesn't match your current one."),[3,5];case 4:return this.loading=!1,[7];case 5:return[2]}}))}))},e.prototype.cancel=function(){this.passwordConfirmedEmitter.emit(!1),this.modal._dismiss()},e.prototype.createNewClient=function(e,t){return new m.Client(e,t)},e.prototype.emitSuccessAndClose=function(){this.passwordConfirmedEmitter.emit(!0),this.modal._dismiss()},e.ctorParameters=function(){return[{type:m.UserService},{type:Uc},{type:m.FetchClient},{type:Yu},{type:ep}]},jc([t.Output()],e.prototype,"passwordConfirmedEmitter",void 0),jc([t.ViewChild("modal",{static:!1})],e.prototype,"modal",void 0),e=jc([t.Component({selector:"c8y-password-confirm-modal",template:'<c8y-modal [customFooter]="true" [title]="\'Confirm your current password\' | translate" #modal>\r\n <form #confirmForm="ngForm" (ngSubmit)="confirmForm.form.valid && passwordConfirm()">\r\n <c8y-form-group [hasWarning]="true">\r\n <label translate for="currentPassword">Enter your password</label>\r\n <input\r\n id="currentPassword"\r\n [(ngModel)]="password"\r\n type="password"\r\n name="password"\r\n class="form-control"\r\n placeholder="{{ \'Enter your password\' | translate }}"\r\n required\r\n />\r\n <c8y-messages>\r\n <c8y-message translate>\r\n Enter the password of the user that you are currently logged in with.\r\n </c8y-message>\r\n </c8y-messages>\r\n </c8y-form-group>\r\n\r\n <div class="modal-footer">\r\n <button\r\n title="{{ \'Cancel\' | translate }}"\r\n class="btn btn-default"\r\n type="button"\r\n (click)="cancel()"\r\n translate\r\n >\r\n Cancel\r\n </button>\r\n <button\r\n title="{{ \'Save\' | translate }}"\r\n class="btn btn-primary"\r\n type="submit"\r\n [disabled]="!confirmForm.form.valid || loading"\r\n translate\r\n >\r\n Save\r\n </button>\r\n </div>\r\n </form>\r\n</c8y-modal>\r\n'})],e)}(),np=function(){function e(e){this.modalService=e,this.DEFAULT_PASSWORD_MIN_LENGTH=8,this.GREEN={colorName:"green",color:"rgb(0, 128, 0)",description:"strong",passwordStrength:m.PasswordStrength.GREEN},this.YELLOW={colorName:"yellow",color:"rgb(255, 204, 51)",description:"medium",passwordStrength:m.PasswordStrength.YELLOW},this.RED={colorName:"red",color:"rgb(170, 0, 51)",description:"weak",passwordStrength:m.PasswordStrength.RED}}return e.prototype.confirmPassword=function(){return this.modalService.show(tp).content.passwordConfirmedEmitter.pipe(o.take(1))},e.prototype.hasLowerCase=function(e){return-1!==e.search(/[a-z]/)},e.prototype.hasUpperCase=function(e){return-1!==e.search(/[A-Z]/)},e.prototype.hasNumbers=function(e){return-1!==e.search(/[0-9]/)},e.prototype.hasSpecialChars=function(e){return-1!==e.search(/[^0-9a-zA-Z]+/)},e.prototype.getStrengthColor=function(e){var t=s.filter([this.hasLowerCase(e),this.hasUpperCase(e),this.hasNumbers(e),this.hasSpecialChars(e)]).length;return t>3?this.GREEN:t>=3?this.YELLOW:this.RED},e.prototype.getDefaultPasswordMinLength=function(){return this.DEFAULT_PASSWORD_MIN_LENGTH},e.ctorParameters=function(){return[{type:oc.BsModalService}]},e=jc([t.Injectable()],e)}(),ap=function(){function n(e,t,n,a){this.user=e,this.modalService=t,this.modal=n,this.loginService=a}return n.prototype.totpSetupVerified=function(t){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){switch(t.label){case 0:return[4,this.user.activateTotp()];case 1:t.sent(),this.modal.hide(),t.label=2;case 2:return t.trys.push([2,5,,6]),[4,this.modalService.acknowledge("Logout required","You must log out in order to apply your changes",e.Status.WARNING,"Log out")];case 3:return t.sent(),[4,this.loginService.logout()];case 4:return t.sent(),[3,6];case 5:return t.sent(),[3,6];case 6:return[2]}}))}))},n.prototype.close=function(){this.modal.hide()},n.ctorParameters=function(){return[{type:m.UserService},{type:Fd},{type:oc.BsModalRef},{type:ep}]},n=jc([t.Component({selector:"c8y-user-totp-setup",template:'<c8y-modal [customFooter]="true">\n <ng-container c8y-modal-title>\n <button\n title="{{ \'Close\' | translate }}"\n (click)="close()"\n type="button"\n class="close"\n ><span aria-hidden="true">×</span></button>\n <h3 class="text-center" translate>Set up two-factor authentication</h3>\n </ng-container>\n <c8y-totp-setup></c8y-totp-setup>\n <c8y-totp-challenge (onSuccess)="totpSetupVerified($event)"></c8y-totp-challenge>\n</c8y-modal>\n'})],n)}(),op=function(){function e(e,n,a,o,s,r,l,i,c,u){this.state=e,this.translate=n,this.passwordService=a,this.modalConfirmService=o,this.bsModalService=s,this.alert=r,this.userService=l,this.tenantLoginOptionsService=i,this.tenantService=c,this.userPreferencesService=u,this.loading=!1,this.showProductUsageSetting=!1,this.isUsageTrackingEnabled=!0,this.onUser=new t.EventEmitter,this.onLanguage=new t.EventEmitter,this.onProductExperience=new t.EventEmitter,this.onCancel=new t.EventEmitter,this.userHasActiveTotp=!1,this.userCanSetupTotp=!1,this.isPhoneRequired=!1}return Object.defineProperty(e.prototype,"user",{get:function(){return this._user},set:function(e){this._user=s.clone(e),this.userIsExternal="OAUTH2"===e.customProperties.userOrigin,this.isPhoneRequired=this.isPhoneRequired&&e.twoFactorAuthenticationEnabled},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){var e,t,n,a;return Cc(this,(function(o){switch(o.label){case 0:return[4,this.tenantService.current()];case 1:return e=o.sent().data,[4,this.tenantService.getTfaSettings(e)];case 2:return t=o.sent(),n=t.enabledOnSystemLevel,a=t.enabledOnTenantLevel,this.isTfaEnabled=n||a,[4,this.initializeTotpSettings()];case 3:return o.sent(),this.user.twoFactorAuthenticationEnabled&&!this.userCanSetupTotp&&(this.isPhoneRequired=!0),[2]}}))}))},Object.defineProperty(e.prototype,"langs",{get:function(){return this.state.state.langs},enumerable:!0,configurable:!0}),e.prototype.setupTotp=function(){this.bsModalService.show(ap,{class:"modal-sm"}),this.cancel()},e.prototype.cancel=function(){this.onCancel.emit()},e.prototype.save=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){return this.loading||(this.showProductUsageSetting&&(this.onProductExperience.emit(this.isUsageTrackingEnabled),this.userPreferencesService.set("gainsightEnabled",this.isUsageTrackingEnabled)),this._user.password?this.saveAfterPasswordConfirmation():this.onUser.emit(this._user)),[2]}))}))},e.prototype.onNewPasswordChanged=function(e){this._user.password=e.password},e.prototype.initializeTotpSettings=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=this,[4,this.canUserSetupTotp()];case 1:return e.userCanSetupTotp=n.sent(),this.userCanSetupTotp?[4,this.userService.getActivityTotp()]:[3,3];case 2:t=n.sent().data,this.userHasActiveTotp=t.isActive,n.label=3;case 3:return[3,5];case 4:return n.sent(),this.alert.removeLastDanger(),[3,5];case 5:return[2]}}))}))},e.prototype.canUserSetupTotp=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return[4,this.tenantLoginOptionsService.detail()];case 1:return[2,e.sent().data.loginOptions.some((function(e){var t=e.tfaStrategy;return"totp"===(void 0===t?"":t).toLowerCase()}))]}}))}))},e.prototype.saveAfterPasswordConfirmation=function(){var e=this;this.passwordService.confirmPassword().subscribe((function(t){t&&e.onUser.emit(e._user)}))},e.ctorParameters=function(){return[{type:Uc},{type:mu},{type:np},{type:Fd},{type:oc.BsModalService},{type:Yu},{type:m.UserService},{type:m.TenantLoginOptionsService},{type:m.TenantService},{type:_u}]},jc([t.Input()],e.prototype,"lang",void 0),jc([t.Input()],e.prototype,"loading",void 0),jc([t.Input()],e.prototype,"user",null),jc([t.Input()],e.prototype,"showProductUsageSetting",void 0),jc([t.Input()],e.prototype,"isUsageTrackingEnabled",void 0),jc([t.Output()],e.prototype,"onUser",void 0),jc([t.Output()],e.prototype,"onLanguage",void 0),jc([t.Output()],e.prototype,"onProductExperience",void 0),jc([t.Output()],e.prototype,"onCancel",void 0),e=jc([t.Component({selector:"c8y-user-edit",template:'<form #userForm="ngForm" (ngSubmit)="userForm.form.valid && save()">\n <div class="alert alert-warning" role="alert" *ngIf="userIsExternal" translate>\n Some of the user settings are not editable here because they are managed via your authorization\n server.\n </div>\n <c8y-form-group>\n <label translate for="userName">Username (e.g. email)</label>\n <input\n id="userName"\n class="form-control"\n [(ngModel)]="user.userName"\n name="userName"\n autocomplete="off"\n required\n maxlength="254"\n placeholder="{{ \'e.g. joe.doe@example.com`LOCALIZE`\' | translate }}"\n [disabled]="user.id"\n c8yDefaultValidation="user"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate for="displayName">Login alias</label>\n <input\n id="displayName"\n class="form-control"\n [(ngModel)]="user.displayName"\n name="displayName"\n autocomplete="off"\n maxlength="254"\n placeholder="{{ \'e.g. joe.doe`LOCALIZE`\' | translate }}"\n [disabled]="userIsExternal"\n c8yDefaultValidation="loginAlias"\n />\n </c8y-form-group>\n\n <c8y-form-group [hasWarning]="!user.email">\n <label translate for="userEmail">Email</label>\n <input\n id="userEmail"\n class="form-control"\n type="email"\n name="email"\n [maxlength]="254"\n autocomplete="off"\n placeholder="{{ \'e.g. joe.doe@example.com`LOCALIZE`\' | translate }}"\n [(ngModel)]="user.email"\n email\n [required]="user.newsletter"\n [disabled]="userIsExternal"\n />\n <c8y-messages>\n <c8y-message *ngIf="!user.email" translate\n >Note that email is required to reset password.</c8y-message\n >\n </c8y-messages>\n </c8y-form-group>\n\n <div class="row" style="margin-left:-15px; margin-right:-15px">\n <div class="col-sm-6">\n <c8y-form-group>\n <label translate for="userFirstName">First name</label>\n <input\n id="userFirstName"\n class="form-control"\n autocomplete="off"\n maxlength="50"\n name="firstName"\n [(ngModel)]="user.firstName"\n [disabled]="userIsExternal"\n />\n </c8y-form-group>\n </div>\n <div class="col-sm-6">\n <c8y-form-group>\n <label translate for="userLastName">Last name</label>\n <input\n id="userLastName"\n class="form-control"\n autocomplete="off"\n maxlength="50"\n name="lastName"\n [(ngModel)]="user.lastName"\n [disabled]="userIsExternal"\n />\n </c8y-form-group>\n </div>\n </div>\n\n <c8y-form-group>\n <label translate for="userTelephone">Telephone</label>\n <input\n id="userTelephone"\n class="form-control"\n autocomplete="off"\n name="phone"\n maxlength="254"\n [(ngModel)]="user.phone"\n placeholder="{{ \'e.g. +49 9 876 543 210`LOCALIZE`\' | translate }}"\n c8yPhoneValidation\n c8yDefaultValidation="phoneNumber"\n [required]="isPhoneRequired"\n [disabled]="userIsExternal"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate for="userLang">Language</label>\n <div class="c8y-select-wrapper">\n <select\n id="userLang"\n class="form-control"\n #selectLang\n name="lang"\n [(ngModel)]="lang"\n (change)="onLanguage.emit(selectLang.value)"\n >\n <option *ngFor="let lang of langs" [value]="lang">{{\n translate.getNativeLanguage(lang)\n }}</option>\n </select>\n <span></span>\n </div>\n </c8y-form-group>\n\n <c8y-form-group class="p-t-8 p-b-8 separator-top" *ngIf="showProductUsageSetting">\n <strong translate>Product experience</strong>\n <label class="c8y-switch" for="productUsageTracking">\n <input\n id="productUsageTracking"\n name="productUsageTracking"\n type="checkbox"\n [(ngModel)]="isUsageTrackingEnabled"\n />\n <span></span>\n {{ \'Enable anonymous tracking to enhance the product experience\' | translate }}\n </label>\n </c8y-form-group>\n\n <div class="form-group" *ngIf="!userIsExternal">\n <label class="control-label">{{ \'Login options\' | translate }}</label>\n <c8y-new-password (password)="onNewPasswordChanged($event)"></c8y-new-password>\n <button\n title="{{ \'Set up two-factor authentication\' | translate }}"\n class="btn btn-default"\n type="button"\n (click)="setupTotp()"\n *ngIf="userCanSetupTotp && !userHasActiveTotp && isTfaEnabled"\n >\n {{ \'Set up two-factor authentication\' | translate }}\n </button>\n </div>\n\n <c8y-form-group *ngIf="!!(state.state$ | async).newsletter">\n <label translate>Newsletter</label>\n <label\n title="{{ \'Send me information about outages, maintenance or updates.\' | translate }}"\n class="c8y-checkbox"\n >\n <input\n type="checkbox"\n name="newsletter"\n [(ngModel)]="user.newsletter"\n [disabled]="userIsExternal"\n />\n <span></span>\n <span>\n {{ \'Send me information about outages, maintenance or updates.\' | translate }}\n </span>\n </label>\n </c8y-form-group>\n\n <div class="modal-footer">\n <button\n title="{{ \'Cancel\' | translate }}"\n class="btn btn-default"\n type="button"\n (click)="cancel()"\n >\n {{ \'Cancel\' | translate }}\n </button>\n <button\n title="{{ \'Save\' | translate }}"\n class="btn btn-primary"\n type="submit"\n [disabled]="!userForm.form.valid || userForm.form.pristine || loading"\n >\n {{ \'Save\' | translate }}\n </button>\n </div>\n</form>\n'})],e)}(),sp=function(){function n(e,t,n,a,o,s,r,l,i){this.ui=e,this.bsModalService=t,this.modalService=n,this.loginService=a,this.translateService=o,this.tenantService=s,this.alertService=r,this.user=l,this.optionsService=i}return n.prototype.copyIt=function(e){var t,n={handleEvent:function(t){t.clipboardData.setData("text/plain",e),t.preventDefault()}};document.addEventListener("copy",n);try{t=document.execCommand("copy")}catch(e){t=!1}t?this.alertService.addByText("success","Copied to clipboard."):this.alertService.addByText("danger","Could not copy to clipboard."),document.removeEventListener("copy",n)},n.prototype.editUser=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){return this.bsModalService.show(Qd),[2]}))}))},n.prototype.logout=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return[4,this.loginService.logout()];case 1:return e.sent(),[2]}}))}))},n.prototype.activateSupportAccess=function(){return Sc(this,void 0,void 0,(function(){var t,n,a,o,s;return Cc(this,(function(r){switch(r.label){case 0:t="Activate support user access",n=this.optionsService.get("companyName","Cumulocity"),"You are about to allow a support user from {{companyName}} to access your tenant to help you with your issue.","You are about to allow a support user to access your tenant to help you with your issue.","Do you want to proceed?",a=[this.translateService.instant(n?"You are about to allow a support user from {{companyName}} to access your tenant to help you with your issue.":"You are about to allow a support user to access your tenant to help you with your issue.",{companyName:n}),this.translateService.instant("Do you want to proceed?")].join(" "),o={ok:"Activate access",cancel:"Cancel"},s="Support user access activated.",r.label=1;case 1:return r.trys.push([1,5,,6]),[4,this.modalService.confirm(t,a,e.Status.DANGER,o)];case 2:return r.sent(),[4,this.tenantService.enableSupportUser()];case 3:return r.sent(),[4,this.refreshCurrentUser()];case 4:return r.sent(),this.alertService.success(s),[3,6];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))},n.prototype.deactivateSupportAccess=function(){return Sc(this,void 0,void 0,(function(){var t,n,a,o,s,r,l,i,c;return Cc(this,(function(u){switch(u.label){case 0:return t="Deactivate support user access",n=this.optionsService.get("companyName","Cumulocity"),a="You are about to block a support user from {{companyName}} from accessing your tenant to help you with your issue.",o="You are about to block a support user from accessing your tenant to help you with your issue.",[4,this.user.current()];case 1:return s=u.sent().data,[4,this.user.hasRole(s,"ROLE_TENANT_ADMIN")];case 2:r=u.sent(),"Deactivating support access as tenant admin will disable all other support requests on your tenant.","Do you want to proceed?",l=[this.translateService.instant(n?a:o,{companyName:n}),r?this.translateService.instant("Deactivating support access as tenant admin will disable all other support requests on your tenant."):"",this.translateService.instant("Do you want to proceed?")].filter(Boolean).join(" "),i={ok:"Deactivate access",cancel:"Cancel"},c="Support user access deactivated.",u.label=3;case 3:return u.trys.push([3,7,,8]),[4,this.modalService.confirm(t,l,e.Status.DANGER,i)];case 4:return u.sent(),[4,this.tenantService.disableSupportUser()];case 5:return u.sent(),[4,this.refreshCurrentUser()];case 6:return u.sent(),this.alertService.success(c),[3,8];case 7:return u.sent(),[3,8];case 8:return[2]}}))}))},n.prototype.getSortedItems=function(){return s.sortBy(Array.from(this.items),this.byPriority)},n.prototype.refreshCurrentUser=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return[4,this.user.current()];case 1:return e=t.sent(),this.ui.currentUser.next(e.data),[2]}}))}))},n.prototype.byPriority=function(e){return-e.priority},n.ctorParameters=function(){return[{type:Uc},{type:oc.BsModalService},{type:Fd},{type:ep},{type:p.TranslateService},{type:m.TenantService},{type:Yu},{type:m.UserService},{type:$c}]},jc([t.Input()],n.prototype,"items",void 0),n=jc([t.Component({selector:"c8y-user-menu-outlet",template:'<div\n dropdown\n class="dropdown"\n>\n <button\n class="main-header-button c8y-dropdown dropdown-toggle text-nowrap"\n dropdownToggle\n >\n <span\n class="d-inline-block hidden-xs text-truncate m-r-8"\n style="vertical-align: text-bottom; max-width: 104px;"\n title="{{ui.currentUser | async | shortenUserName}}"\n >\n {{ui.currentUser | async | shortenUserName}}\n </span>\n <i\n [c8yIcon]="\'c8y-user\'"\n class="icon-2x"\n ></i>\n </button>\n <ul\n *dropdownMenu\n class="dropdown-menu dropdown-menu-right"\n style="max-width: 240px;"\n >\n <ng-container *ngFor="let item of getSortedItems()">\n <ng-container *ngIf="item.template">\n <ng-container *c8yOutlet="item.template"></ng-container>\n </ng-container>\n <ng-container *ngIf="!item.template">\n <li (click)="item.click()">\n <a class="interact" [attr.href]="item.link" [attr.target]="item.target">\n <i [c8yIcon]="item.icon"></i>\n {{item.label | translate}}\n </a>\n </li>\n </ng-container>\n </ng-container>\n <li\n *ngIf="!(ui.state$ | async).hidePowered"\n role="separator"\n class="divider"\n ></li>\n <li\n class="dropdown-header bg-gray-white text-pre-normal"\n style="margin-top: -1px;"\n *ngIf="!(ui.state$ | async).hidePowered"\n >\n <div class="flex-row">\n <i\n [c8yIcon]="\'info-circle\'"\n class="text-info flex-item-v-start text-14"\n style="margin: 1px 6px 0 -3px;"\n ></i>\n <span class="text-muted text-truncate">\n {{\'Tenant ID\' | translate}}: <strong>\n <span class="text-primary interact" (click)="$event.stopPropagation(); copyIt(ui.currentTenant.value.name)">\n {{ui.currentTenant.value.name}}&nbsp;\n <i [c8yIcon]="\'clipboard\'"></i>\n </span>\n </strong><br>\n {{\'Backend\' | translate}}: <strong>{{(ui.state$ | async).versions.backend}}</strong><br>\n {{\'UI\' | translate }}: <strong>{{ui.uiVersion}}</strong>\n </span>\n </div>\n </li>\n </ul>\n</div>\n\n\x3c!-- the default items --\x3e\n<c8y-user-menu-item\n [icon]="\'user-menu-male\'"\n [label]="\'User settings\' | translate"\n [priority]="20"\n (click)="editUser()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n [icon]="\'sign-out\'"\n [label]="\'Logout\' | translate"\n (click)="logout()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n *ngIf="!(ui.currentUser | async).supportUserEnabled && ((ui.state$ | async).activateSupportUserAvailable)"\n [icon]="\'c8y-c8y-support\'"\n [label]="\'Activate support\' | translate"\n (click)="activateSupportAccess()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n *ngIf="(ui.currentUser | async).supportUserEnabled && ((ui.state$ | async).activateSupportUserAvailable)"\n [icon]="\'c8y-c8y-support\'"\n [label]="\'Deactivate support\' | translate"\n (click)="deactivateSupportAccess()"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n *ngIf="(ui.state$ | async).supportUrl"\n [icon]="\'question-circle\'"\n [link]="(ui.state$ | async).supportUrl"\n [target]="\'_blank\'"\n [label]="\'Request support\' | translate"\n></c8y-user-menu-item>\n'})],n)}(),rp=function(){function e(e,t,n){var a=this;this.loginService=e,this.passwordStrengthChecker=t,this.passwordService=n,this.minGreenLength=0,this.checklist=[{label:"Include lowercase characters (e.g. abcdef)",check:this.passwordStrengthChecker.hasLowerCase,icon:"",contextualColor:""},{label:"Include uppercase characters (e.g. ABCDEF)",check:this.passwordStrengthChecker.hasUpperCase,icon:"",contextualColor:""},{label:"Include numbers (e.g. 123456)",check:this.passwordStrengthChecker.hasNumbers,icon:"",contextualColor:""},{label:"Include symbols (e.g. !@#$%^)",check:this.passwordStrengthChecker.hasSpecialChars,icon:"",contextualColor:""},{label:"Must have at least {{length}} characters",check:function(e){return e.length>=a.minGreenLength},icon:"",contextualColor:""}]}return Object.defineProperty(e.prototype,"password",{set:function(e){"string"==typeof e&&this.onPasswordChange(e)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return e=this,[4,this.loginService.getGreenMinLength()];case 1:return e.minGreenLength=t.sent(),this.minGreenLength||(this.minGreenLength=this.passwordService.getDefaultPasswordMinLength()),[2]}}))}))},Object.defineProperty(e.prototype,"translateParams",{get:function(){return{length:this.minGreenLength}},enumerable:!0,configurable:!0}),e.prototype.onPasswordChange=function(e){this.checklist=s.map(this.checklist,(function(t){var n=t.check(e);return s.assign(t,{icon:n?"check-circle":"",contextualColor:n?"":"text-muted"}),t}))},e.ctorParameters=function(){return[{type:ep},{type:np},{type:np}]},jc([t.Input("password")],e.prototype,"password",null),e=jc([t.Component({selector:"c8y-password-check-list",template:'<div>\n <span class="small">{{ \'Please meet 5 out of the 5 conditions below\' | translate }}:</span>\n <ul class="list-unstyled">\n <li class="small" *ngFor="let requirement of checklist">\n <i [c8yIcon]="requirement.icon" class="text-success"></i>\n <span\n class="small {{ requirement.contextualColor }}"\n [translate]="requirement.label"\n [translateParams]="this.translateParams"\n ></span>\n </li>\n </ul>\n</div>\n'})],e)}(),lp=function(){function e(e){this.passwordConfirm=e}var n;return n=e,e.prototype.validate=function(e){var t=e.value,n=e.root.get(this.passwordConfirm);return n&&t!==n.value?{passwordConfirm:!0}:null},e.ctorParameters=function(){return[{type:String,decorators:[{type:t.Attribute,args:["passwordConfirm"]}]}]},e=n=jc([t.Directive({selector:"[passwordConfirm]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]}),wc(0,t.Attribute("passwordConfirm"))],e)}(),ip=function(){function e(){this.GREEN={colorName:"green",color:"rgb(0, 128, 0)",description:"strong",passwordStrength:m.PasswordStrength.GREEN},this.YELLOW={colorName:"yellow",color:"rgb(255, 204, 51)",description:"medium",passwordStrength:m.PasswordStrength.YELLOW},this.RED={colorName:"red",color:"rgb(170, 0, 51)",description:"weak",passwordStrength:m.PasswordStrength.RED}}return e.prototype.hasLowerCase=function(e){return-1!==e.search(/[a-z]/)},e.prototype.hasUpperCase=function(e){return-1!==e.search(/[A-Z]/)},e.prototype.hasNumbers=function(e){return-1!==e.search(/[0-9]/)},e.prototype.hasSpecialChars=function(e){return-1!==e.search(/[^0-9a-zA-Z]+/)},e.prototype.getStrengthColor=function(e){var t=s.filter([this.hasLowerCase(e),this.hasUpperCase(e),this.hasNumbers(e),this.hasSpecialChars(e)]).length;return t>3?this.GREEN:t>=3?this.YELLOW:this.RED},e=jc([t.Injectable()],e)}(),cp=function(){function e(e){this.passwordStrengthCheckerService=e,this.strength=new t.EventEmitter,this.password=""}return Object.defineProperty(e.prototype,"password",{set:function(e){"string"==typeof e&&(this.model=this.passwordStrengthCheckerService.getStrengthColor(e),this.strength.emit(this.model))},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:np}]},jc([t.Input("password")],e.prototype,"password",null),jc([t.Output()],e.prototype,"strength",void 0),e=jc([t.Component({selector:"c8y-password-strength",template:'<div class="password-strength password-{{ model.colorName }}">\r\n <label class="password-strength-label small" translate>\r\n Password strength\r\n </label>\r\n <div>\r\n <div class="password-bar"></div>\r\n </div>\r\n <span class="small">\r\n {{ model.description | translate }}\r\n </span>\r\n</div>\r\n'})],e)}(),up=function(){function e(e){this.loginService=e,this.password=new t.EventEmitter,this.model={},this.changePassword=!1,this.passwordEnforced=!1}return e.prototype.ngOnInit=function(){var e=this;this.loadPasswordStrengthSettings(),this.loginService.getGreenMinLength().then((function(t){e.minlength=t}))},e.prototype.newPasswordChanged=function(){this.password.emit({password:this.model.newPassword,passwordStrength:this.model.strength})},e.prototype.loadPasswordStrengthSettings=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return e=this,[4,this.loginService.getPasswordStrengthEnforced({refresh:!0})];case 1:return e.passwordEnforced=t.sent(),[2]}}))}))},e.prototype.showPasswordStrength=function(){return this.model.newPassword&&this.model.newPassword.length>=this.minlength},e.prototype.toggleChangePassword=function(){this.changePassword=!this.changePassword,this.changePassword||(this.password.emit({}),this.model={})},e.ctorParameters=function(){return[{type:ep}]},jc([t.Output()],e.prototype,"password",void 0),e=jc([t.Component({selector:"c8y-new-password",template:'<div class="form-group">\n <button type="button" class="btn btn-default" (click)="toggleChangePassword()">\n <ng-container *ngIf="!changePassword">\n {{ \'Change password\' | translate }}\n </ng-container>\n <ng-container *ngIf="changePassword">\n {{ \'Cancel password change\' | translate }}\n </ng-container>\n </button>\n</div>\n\n<div *ngIf="changePassword" class="row content-flex-50">\n <div class="col-7">\n <c8y-form-group>\n <label for="newPassword" translate>Password</label>\n <input\n id="newPassword"\n name="newPassword"\n type="password"\n #newPassword="ngModel"\n class="form-control"\n [(ngModel)]="model.newPassword"\n (change)="newPasswordChanged()"\n (input)="newPasswordConfirm.control.updateValueAndValidity()"\n required\n c8yDefaultValidation="password"\n autocomplete="new-password"\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label for="newConfirmPassword" translate>Confirm password</label>\n <input\n id="newConfirmPassword"\n name="newPasswordConfirm"\n type="password"\n #newPasswordConfirm="ngModel"\n class="form-control"\n [(ngModel)]="model.newPasswordConfirm"\n required\n passwordConfirm="newPassword"\n autocomplete="new-password"\n />\n </c8y-form-group>\n </div>\n <div class="col-5">\n <c8y-password-strength\n [password]="model.newPassword"\n (strength)="model.strength = $event"\n ></c8y-password-strength>\n\n <c8y-password-check-list\n class="m-t-32"\n [password]="model.newPassword"\n [hidden]="!passwordEnforced"\n ></c8y-password-check-list>\n </div>\n</div>\n',viewProviders:[{provide:nc.ControlContainer,useExisting:nc.NgForm}]})],e)}(),dp=function(){function e(){}var n;return n=e,e.prototype.validate=function(e){return this.validateInternationalPhoneNumber(e)?null:{internationalPhoneNumber:!0}},e.prototype.validateInternationalPhoneNumber=function(e){var t;try{var n=sc.parsePhoneNumberFromString(e.value);(t=n.isValid())&&e.value!==n.format("E.164")&&e.setValue(n.format("E.164"),{emitEvent:!1,emitModelToViewChange:!1})}catch(n){t=!e.value}return t},e=n=jc([t.Directive({selector:"[c8yPhoneValidation]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),pp=function(){function e(){}return e.get=function(e){return this.rules[e]},e.messages={deviceId:'Device ID must not contain spaces or slashes ("/").',domain:"Only lowercase letters, digits and hyphens allowed in the first part of the URI. Must start with a letter; hyphens only allowed in the middle. Must be a valid URI.",email:"Invalid email address.",emails:"Invalid email addresses.",internationalPhoneNumber:"International phone number required, in the format +49 9 876 543 210.",loginAlias:'Login alias must not contain slashes ("/", "\\") nor ("+"), (":"), ("$") signs.',max:"Max value: {{ value }}",min:"Min value: {{ value }}",opcuaBrowsePath:"Invalid OPC UA URI.",password:"Password must have at least 8 characters and no more than 32 and can only contain letters, numbers and following symbols: `~!@#$%^&*()_|+-=?;:'\",.<>{}[]\\/",passwordConfirm:"Passwords do not match.",passwordStrength:"Password not good enough, password must be stronger (green).",phoneNumber:'Invalid phone number format. Only digits, spaces, slashes ("/") and dashes ("-") allowed.',required:"This field is required.",tenantId:"May contain lowercase letters, digits, and hyphens. Must start with a letter; hyphens only allowed in the middle; minimum 2 characters.",urlSegment:"Slash, single or double dots and white space not allowed.",user:'Username must not contain spaces nor slashes ("/", "\\") nor ("+"), (":"), ("$") signs.'},e.rules={deviceId:{pattern:/^[^\s/]*$/},domain:{pattern:/^[a-z]+[a-z0-9-]*[a-z0-9]+\.{1}.+$/},groupName:{maxLength:254},hostname:{pattern:/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/},ip:{pattern:/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/},opcuaBrowsePath:{pattern:/^(opc.tcp|http|https):\/\/[^ "]+$/},password:{pattern:/^[a-zA-Z0-9`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]{8,32}$/},phoneNumber:{pattern:/^$|^(\+|0{2})[\d\s/-]{1,30}$/},tenantId:{pattern:/^[a-z]+[a-z0-9-]*[a-z0-9]+$/},user:{pattern:/^[^\\/\s$:+]*$/},urlSegment:{pattern:/^(([.]{1,2})|([/])+|(([/]*)([.]{1,2})([/]*))|((.*)([/]|[ ]+)(.*))|(\s+))$/},loginAlias:{pattern:/^[^\\/$:+]*$/}},e}(),mp=function(){function e(){this.c8yDefaultValidation=""}var n;return n=e,e.prototype.validate=function(e){var t;if(!e.value)return null;var n=pp.get(this.c8yDefaultValidation);if(!n)throw new Error("Pattern "+this.c8yDefaultValidation+" not found.");var a=!0;return n.pattern&&(a=n.pattern.test(e.value)),n.maxLength&&(a=e.value.length<n.maxLength),n.minLength&&(a=e.value.length>=n.minLength),a?null:((t={})[this.c8yDefaultValidation]=!0,t)},jc([t.Input()],e.prototype,"c8yDefaultValidation",void 0),e=n=jc([t.Directive({selector:"[c8yDefaultValidation]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),hp=function(){function e(){this.min=""}var n;return n=e,e.prototype.validate=function(e){var t=parseInt(this.min,10);if(s.isUndefined(e.value)||!this.min)return null;return null===e.value||!(e.value<t)?null:{min:{value:t}}},jc([t.Input()],e.prototype,"min",void 0),e=n=jc([t.Directive({selector:"[min]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),fp=function(){function e(){this.max=""}var n;return n=e,e.prototype.validate=function(e){var t=parseInt(this.max,10);if(s.isUndefined(e.value)||!this.max)return null;return!(e.value>t)?null:{max:{value:t}}},jc([t.Input()],e.prototype,"max",void 0),e=n=jc([t.Directive({selector:"[max]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),gp=function(){function e(){}return jc([t.Input()],e.prototype,"name",void 0),jc([t.Input()],e.prototype,"text",void 0),e=jc([t.Directive({selector:"c8y-message"})],e)}(),yp=function(){function e(e){this.translateService=e,this.show={},this.defaults=pp.messages,this.messages=[],this.messageMap={}}return e.prototype.ngAfterContentInit=function(){this.messageMap=Object.assign({},this.defaults,this.customMessages.reduce((function(e,t){return e[t.name]=t.text,e}),{}))},e.prototype.changVisibility=function(e){this.show=e,this.ngOnChanges()},e.prototype.ngOnChanges=function(){var e=this;this.show?this.messages=Object.keys(this.show).map((function(t){return e.toMessage(t,e.show[t])})):this.messages=[]},e.prototype.toMessage=function(e,t){return this.translateService.instant(this.messageMap[e],t)},e.ctorParameters=function(){return[{type:p.TranslateService}]},jc([t.Input()],e.prototype,"show",void 0),jc([t.Input()],e.prototype,"defaults",void 0),jc([t.ContentChildren(gp)],e.prototype,"customMessages",void 0),e=jc([t.Component({selector:"c8y-messages",template:'<small class="form-control-feedback-message">\n <div class="d-block" *ngFor="let msg of messages">\n {{msg | translate}}\n </div>\n <ng-content></ng-content>\n</small>\n'})],e)}(),vp=function(){function e(){this.hasError=!1,this.hasWarning=!1,this.hasSuccess=!1,this.novalidation=!1,this.VALIDATION_DEBOUNCE_MS=1e3}return Object.defineProperty(e.prototype,"error",{get:function(){return"error"===this.status||this.hasError},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"warning",{get:function(){return"warning"===this.status||this.hasWarning},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"success",{get:function(){return"success"===this.status||this.hasSuccess},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this.initNgModel()},e.prototype.initNgModel=function(){var e=this;this.model&&(this.model.valueAccessor.registerOnTouched((function(){e.model.control&&!e.model.control.dirty&&(e.model.control.markAsDirty(),e.model.control.updateValueAndValidity({onlySelf:!0}))})),this.subscription=a.merge(this.model.valueChanges,this.model.statusChanges).pipe(o.filter((function(){return e.model.dirty&&!e.novalidation})),o.debounce((function(){return e.hasError?a.timer(10):a.timer(e.VALIDATION_DEBOUNCE_MS)}))).subscribe((function(){return e.update()})))},e.prototype.update=function(){this.hasError="INVALID"===this.model.status,this.customErrorMessage?this.customErrorMessage.changVisibility(this.model.errors):this.errors=this.model.errors},e.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},jc([t.Input()],e.prototype,"hasError",void 0),jc([t.Input()],e.prototype,"hasWarning",void 0),jc([t.Input()],e.prototype,"hasSuccess",void 0),jc([t.Input()],e.prototype,"novalidation",void 0),jc([t.Input()],e.prototype,"status",void 0),jc([t.HostBinding("class.has-error")],e.prototype,"error",null),jc([t.HostBinding("class.has-warning")],e.prototype,"warning",null),jc([t.HostBinding("class.has-success")],e.prototype,"success",null),jc([t.ContentChild(yp,{static:!1})],e.prototype,"customErrorMessage",void 0),jc([t.ContentChild(nc.NgModel,{static:!0})],e.prototype,"model",void 0),e=jc([t.Component({selector:"c8y-form-group",template:'<ng-content></ng-content>\n<c8y-messages *ngIf="!customErrorMessage" [show]="errors"></c8y-messages>\n',host:{class:"form-group"}})],e)}(),bp=function(){function e(){this.plus=!0,this.minus=!0,this.onRemove=new t.EventEmitter,this.onAdd=new t.EventEmitter}return e.prototype.add=function(){this.onAdd.emit(this.index)},e.prototype.remove=function(){this.onRemove.emit(this.index)},jc([t.Input()],e.prototype,"plus",void 0),jc([t.Input()],e.prototype,"minus",void 0),jc([t.Input()],e.prototype,"index",void 0),jc([t.Output()],e.prototype,"onRemove",void 0),jc([t.Output()],e.prototype,"onAdd",void 0),e=jc([t.Component({selector:"c8y-input-group-list",template:'<ng-container>\n <div class="input-group">\n <ng-content></ng-content>\n <div class="input-group-btn">\n <button\n *ngIf="minus"\n title="{{ \'Remove\' | translate }}"\n class="btn btn-clean text-primary"\n (click)="remove()"\n >\n <i c8yIcon="minus-circle" class="text-danger"></i>\n </button>\n <button\n *ngIf="plus"\n title="{{ \'Add\' | translate }}"\n class="btn btn-clean text-primary"\n (click)="add()"\n >\n <i c8yIcon="plus-circle"></i>\n </button>\n </div>\n </div>\n</ng-container>\n'})],e)}(),jp=function(){function e(){}return e.prototype.ngAfterContentInit=function(){var e=this;this.listProjections.map((function(t){t!==e.listProjections.last&&setTimeout((function(){t.plus=!1}))})),this.listProjections.changes.subscribe((function(e){1!==e.length?e.map((function(t){setTimeout((function(){t.minus=!0})),t!==e.last&&setTimeout((function(){t.plus=!1})),t===e.last&&setTimeout((function(){t.plus=!0}))})):setTimeout((function(){e.first.plus=!0,e.first.minus=!1}))}))},jc([t.ContentChildren(bp)],e.prototype,"listProjections",void 0),e=jc([t.Directive({selector:"[c8yInputGroupListContainer]"})],e)}(),wp=function(){function e(e){this.invalidJSON=new t.EventEmitter,this.message="Must be a valid JSON object.",this.debounceTimeInMs=1e3,this.abstractCtrl=e.control}return e.prototype.ngOnInit=function(){var e=this;this.subscription=this.abstractCtrl.valueChanges.pipe(o.tap((function(){return e.clearValidationMessage()})),o.debounceTime(this.debounceTimeInMs),o.distinctUntilChanged()).subscribe((function(t){e.validateInputAndPrettify(t)}))},e.prototype.ngOnDestroy=function(){this.subscription&&!this.subscription.closed&&this.subscription.unsubscribe()},e.prototype.validateInputAndPrettify=function(e){if(e)try{var t=JSON.parse(e),n=JSON.stringify(t,void 0,2);this.abstractCtrl.setValue(n)}catch(e){this.setErrorAndValidationMessage()}},e.prototype.setErrorAndValidationMessage=function(){this.abstractCtrl.setErrors({invalidBodyTemplate:!0}),this.invalidJSON.emit(this.message)},e.prototype.clearValidationMessage=function(){this.invalidJSON.emit(void 0)},e.ctorParameters=function(){return[{type:nc.NgControl}]},jc([t.Output()],e.prototype,"invalidJSON",void 0),e=jc([t.Directive({selector:"textarea[prettyValidJson]"})],e)}(),Sp=function(){function e(e,t){this.elem=e,this.renderer=t,this.rows=1,this.minHeightPerRow=20}return e.prototype.ngAfterViewInit=function(){var e=Number(this.heightPerRow);this.heightPerRow&&e&&e>this.minHeightPerRow?this.setHeight(this.rows*e+"px"):this.setHeight(this.rows*this.minHeightPerRow+"px")},e.prototype.setHeight=function(e){this.renderer.setStyle(this.elem.nativeElement,"height",e)},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2}]},jc([t.Input(),t.HostBinding("rows")],e.prototype,"rows",void 0),jc([t.Input("heightPerRow")],e.prototype,"heightPerRow",void 0),e=jc([t.Directive({selector:"textarea[heightPerRow]"})],e)}(),Cp=function(){function e(e,t,n){this.el=e,this.renderer=t,this.translationService=n,this.shouldSkipRequiredHint=!1,this.shouldSkipRequiredHint=!!this.el.nativeElement.closest("[placeholder-no-required-hint]")}return e.prototype.ngAfterViewChecked=function(){if(this.el&&this.el.nativeElement&&void 0!==this.el.nativeElement.required){var e=this.el.nativeElement.required&&!this.shouldSkipRequiredHint,t=this.el.nativeElement.placeholder;this.placeholder===t&&this.req===e||this.updatePlaceholder(this.getTextForPlaceholder(t,e))}},e.prototype.getTextForPlaceholder=function(e,t){void 0===e&&(e=""),void 0===t&&(t=!1),this.req=t;var n="("+this.translationService.instant("required")+")",a=e.lastIndexOf(n);return a>0&&(e=e.slice(0,a-1)),0===a&&(e=""),t?e.trim()?e+" "+n:n:e},e.prototype.updatePlaceholder=function(e){this.renderer.setAttribute(this.el.nativeElement,"placeholder",e),this.placeholder=e},e.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:p.TranslateService}]},e=jc([t.Directive({selector:"input[required]"})],e)}(),Ip=function(){function e(){}return Object.defineProperty(e.prototype,"data",{get:function(){return this.ipRangeList},set:function(e){this.ipRangeList=e,0===this.ipRangeList.length&&this.add()},enumerable:!0,configurable:!0}),e.prototype.add=function(){this.ipRangeList.push({ip:"",cidr:void 0})},e.prototype.remove=function(e){this.ipRangeList.splice(e,1)},jc([t.Input()],e.prototype,"data",null),e=jc([t.Component({selector:"c8y-ip-range-input-list",template:'<c8y-form-group class="m-t-8 m-b-8">\n <ul c8yInputGroupListContainer class="list-unstyled">\n <li class="m-b-8" *ngFor="let item of data; let i = index">\n <c8y-input-group-list [index]="i" (onAdd)="add()" (onRemove)="remove($event)">\n <input\n type="text"\n name="ipAddress"\n class="form-control m-r-4"\n placeholder="{{ \'IP range start, e.g.\' | translate }} 192.168.0.1"\n style="flex-grow: 2;"\n [(ngModel)]="item.ip"\n [required]="true"\n #ipAddress\n />\n <input\n type="number"\n name="cidr"\n [min]="0"\n class="form-control"\n placeholder="{{ \'e.g.\' | translate }} 20"\n [(ngModel)]="item.cidr"\n [required]="true"\n #cidr\n />\n </c8y-input-group-list>\n </li>\n </ul>\n</c8y-form-group>\n'})],e)}(),Pp=function(){function e(){this.onSearch=new t.EventEmitter,this.filterChange$=new a.Subject,this.filterTerm="",this.CARRIAGE_RETURN_KEY=13,this.CARRIAGE_RETURN_CODE="Enter"}return e.prototype.ngOnInit=function(){var e=this;this.reset(),this.filterChange$.pipe(o.debounce((function(t){return t.code===e.CARRIAGE_RETURN_CODE||t.keyCode===e.CARRIAGE_RETURN_KEY?a.timer(10):a.timer(300)})),o.map((function(e){return e.target.value})),o.distinctUntilChanged()).subscribe((function(t){e.filterTerm=t,e.onSearch.emit(t)}))},e.prototype.reset=function(){this.filterTerm="",this.onSearch.emit("")},e.prototype.ngOnDestroy=function(){this.filterChange$.complete()},jc([t.Input()],e.prototype,"icon",void 0),jc([t.Output()],e.prototype,"onSearch",void 0),e=jc([t.Component({selector:"c8y-filter",template:'<div class="input-group input-group-search">\n <input\n class="form-control"\n placeholder="{{ \'Filter…\' | translate }}"\n type="text"\n [value]="filterTerm"\n (keyup)="filterChange$.next($event)"\n />\n <span class="input-group-btn">\n <button class="btn btn-clean" (click)="reset()">\n <i [c8yIcon]="filterTerm.length === 0 ? icon : \'close\'"></i>\n </button>\n </span>\n</div>\n'})],e)}(),Op=function(){function e(){this._enabled=!1,this.separator=","}var n;return n=e,Object.defineProperty(e.prototype,"emails",{set:function(e){this._enabled=""===e||!0===e||"true"===e,this._onChange&&this._onChange()},enumerable:!0,configurable:!0}),e.prototype.validate=function(e){return this._enabled&&(e.value||"").split(this.separator).map((function(e){return e.trim()})).some((function(e){return nc.Validators.email(new nc.FormControl(e))}))?{emails:!0}:null},e.prototype.registerOnValidatorChange=function(e){this._onChange=e},jc([t.Input()],e.prototype,"emails",null),e=n=jc([t.Directive({selector:"[emails][formControlName],[emails][formControl],[emails][ngModel]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),xp=function(){function e(){}return e=jc([t.NgModule({imports:[Uu,nc.FormsModule],exports:[dp,mp,hp,fp,nc.FormsModule,vp,gp,yp,bp,jp,wp,Sp,Cp,Ip,Pp,Op],declarations:[dp,mp,hp,fp,vp,gp,yp,bp,jp,wp,Sp,Cp,Ip,Pp,Op]})],e)}(),Ep=function(){function e(e,n,a){this.loginService=e,this.users=n,this.alert=a,this.verify=!0,this.onSuccess=new t.EventEmitter,this.model={token:""},this.loading=!1,this.hasError=!1}return e.prototype.verifyCode=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.loading=!0,this.hasError=!1,this.verify?[4,this.users.verifyTotpCode(this.model.token)]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.onSuccess.emit(this.model.token),[3,4];case 3:return e.sent(),this.hasError=!0,this.alert.removeLastDanger(),this.loading=!1,[3,4];case 4:return[2]}}))}))},e.ctorParameters=function(){return[{type:ep},{type:m.UserService},{type:Yu}]},jc([t.Input()],e.prototype,"verify",void 0),jc([t.Output()],e.prototype,"onSuccess",void 0),jc([t.Input()],e.prototype,"loading",void 0),jc([t.Input()],e.prototype,"hasError",void 0),e=jc([t.Component({selector:"c8y-totp-challenge",template:'<form #totpForm="ngForm" role="form" class="loginForm" (ngSubmit)="verifyCode()" novalidate>\n <c8y-form-group [hasError]="hasError" [novalidation]="true" [ngClass]="hasError ? \'p-b-24\' : \'\'">\n <label translate for="totpToken">\n Verification code\n </label>\n\n <input\n id="totpToken"\n [(ngModel)]="model.token"\n name="totpToken"\n type="text"\n autocapitalize="off"\n autocorrect="off"\n autocomplete="off"\n class="form-control"\n placeholder="{{ \'e.g.\' | translate }} 624327"\n required\n />\n\n <c8y-messages>\n <c8y-message *ngIf="hasError" translate>\n Invalid verification code. In case of key loss, please contact your platform administrator.\n </c8y-message>\n </c8y-messages>\n <p id="helpinput" *ngIf="!hasError" class="help-block" translate>\n In case of key loss, please contact your platform administrator.\n </p>\n </c8y-form-group>\n <button *ngIf="!loading"\n title="{{ \'Verify\' | translate }}"\n [disabled]="!totpForm.form.valid"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n >\n {{ \'Verify\' | translate }}\n </button>\n\n <button *ngIf="loading"\n title="{{ \'Verifying…\' | translate }}"\n type="submit"\n class="btn btn-primary btn-lg btn-block btn-pending"\n >\n {{ \'Verifying…\' | translate }}\n </button>\n</form>\n',viewProviders:[{provide:nc.ControlContainer,useExisting:nc.NgForm}]})],e)}(),kp=function(){function e(e,n,a){this.loginService=e,this.users=n,this.alert=a,this.onCancel=new t.EventEmitter,this.model={smsToken:""},this.isLoading=!1,this.resendTfa="0"}return e.prototype.verifyTFACode=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return this.isLoading=!0,this.useOAuthInternal()?[4,this.verifyCodeWithOauth()]:[3,2];case 1:return e.sent(),[3,4];case 2:return[4,this.verifyCodeWithBasicAuth()];case 3:e.sent(),e.label=4;case 4:return this.isLoading=!1,[2]}}))}))},e.prototype.resendTFASms=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,3,4]),this.isLoading=!0,[4,this.users.verifyTFACode(this.resendTfa)];case 1:return t.sent(),[3,4];case 2:return 403===(e=t.sent()).res.status?(this.loginService.cleanMessages(),this.loginService.addSuccessMessage("resend_sms")):this.alert.addServerFailure(e),[3,4];case 3:return this.isLoading=!1,[7];case 4:return[2]}}))}))},e.prototype.useOAuthInternal=function(){return this.loginService.isPasswordGrantLogin(this.credentials)},e.prototype.verifyCodeWithOauth=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=this.credentials,[4,this.loginService.switchLoginMode(bc({},e,{tfa:this.model.smsToken}))];case 1:return n.sent(),[4,this.loginService.verifyAppAccess()];case 2:return n.sent(),[4,this.loginService.authFulfilled()];case 3:return n.sent(),[3,5];case 4:return t=n.sent(),401===(t.res&&t.res.status)?this.alert.danger("Invalid code"):this.alert.addServerFailure(t),[3,5];case 5:return[2]}}))}))},e.prototype.verifyCodeWithBasicAuth=function(){return Sc(this,void 0,void 0,(function(){var e,t,n;return Cc(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.users.verifyTFACode(this.model.smsToken)];case 1:return e=a.sent().res,t=e.headers.get("tfatoken"),this.credentials.tfa=t,this.loginWithTFA(t),[3,3];case 2:return n=a.sent(),403===(n.res&&n.res.status)?this.alert.danger("Invalid code"):this.alert.addServerFailure(n),[3,3];case 3:return[2]}}))}))},e.prototype.loginWithTFA=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.loginService.login(this.loginService.useBasicAuth({tfa:e}),this.credentials)];case 1:return n.sent(),this.loginService.saveTFAToken(e,sessionStorage),this.loginService.rememberMe&&this.loginService.saveTFAToken(e,localStorage),[3,3];case 2:return t=n.sent(),this.alert.addServerFailure(t),[3,3];case 3:return[2]}}))}))},e.ctorParameters=function(){return[{type:ep},{type:m.UserService},{type:Yu}]},jc([t.Input()],e.prototype,"credentials",void 0),jc([t.Output()],e.prototype,"onCancel",void 0),e=jc([t.Component({selector:"c8y-sms-challenge",template:'<form #twoFactorForm="ngForm" role="form" class="loginForm" (ngSubmit)="verifyTFACode()" novalidate>\n <div class="legend form-block center" translate>\n Two-factor authentication\n </div>\n\n <c8y-form-group>\n <label translate>Verification code</label>\n <input\n [(ngModel)]="model.smsToken"\n #sms_token="ngModel"\n type="text"\n name="sms_token"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'e.g.\' | translate }} 624327"\n required\n />\n <p *ngIf="!twoFactorForm.form.valid || isLoading " class="help-block" translate>\n Insert the code received via SMS.\n </p>\n </c8y-form-group>\n\n <button\n title="{{ \'Verify\' | translate }}"\n [disabled]="!twoFactorForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >\n Verify\n </button>\n\n <div class="d-flex m-t-8">\n <a\n title="{{ \'Send new code\' | translate }}"\n [ngClass]="{ disabled: isLoading }"\n class="small pointer m-r-auto"\n (click)="resendTFASms()"\n translate\n >\n Send new code\n </a>\n <a\n title="{{ \'Log in\' | translate }}"\n class="small pointer m-l-auto"\n (click)="onCancel.emit()"\n translate\n >\n Log in\n </a>\n </div>\n</form>\n'})],e)}(),Tp=function(){function e(e,t){this.user=e,this.alert=t}return Object.defineProperty(e.prototype,"qrCodeImage",{get:function(){return this.totpSecret?this.totpSecret.secretQrUrl:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"secret",{get:function(){return this.totpSecret?this.totpSecret.rawSecret:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qrData",{get:function(){var e=this.qrCodeImage.split("chl=")[1];return e?decodeURIComponent(e):(this.alert.danger("Failed to generate a QR code."),"")},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.user.generateTotpSecret()];case 1:return e=n.sent().data,this.totpSecret=e,[3,3];case 2:return t=n.sent(),this.alert.addServerFailure(t),[3,3];case 3:return[2]}}))}))},e.ctorParameters=function(){return[{type:m.UserService},{type:Yu}]},e=jc([t.Component({selector:"c8y-totp-setup",template:'<div class="text-center">\n <p\n class="lead m-b-16"\n translate\n >\n Scan this QR code with your smartphone using the Google Authenticator app.\n </p>\n\n\n <qrcode\n *ngIf="totpSecret"\n [width]="300"\n [qrdata]="qrData"\n [cssClass]="\'m-b-16\'"\n [errorCorrectionLevel]="\'M\'"\n ></qrcode>\n <p class="text-center text-muted">\n {{secret}}\n </p>\n</div>\n'})],e)}();(_d=e.LoginViews||(e.LoginViews={}))[_d.None=0]="None",_d[_d.Credentials=1]="Credentials",_d[_d.RecoverPassword=2]="RecoverPassword",_d[_d.SmsChallenge=3]="SmsChallenge",_d[_d.ChangePassword=4]="ChangePassword",_d[_d.TotpChallenge=5]="TotpChallenge",_d[_d.TotpSetup=6]="TotpSetup",_d[_d.ProvidePhoneNumber=7]="ProvidePhoneNumber";var Ap,_p=function(){function n(e,n,a){this.loginService=e,this.alert=n,this.userService=a,this.onCancel=new t.EventEmitter,this.onChangeView=new t.EventEmitter,this.requestInProgress=!1,this.sendTfa="0"}return n.prototype.save=function(){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),this.requestInProgress=!0,[4,this.userService.savePhoneNumber(this.phoneNumber)];case 1:return n.sent(),[4,this.sendTFASms()];case 2:return n.sent(),this.onChangeView.emit({view:e.LoginViews.SmsChallenge,credentials:this.credentials}),[3,5];case 3:return t=n.sent(),this.alert.addServerFailure(t),[3,5];case 4:return this.requestInProgress=!1,[7];case 5:return[2]}}))}))},n.prototype.sendTFASms=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.userService.verifyTFACode(this.sendTfa)];case 1:return t.sent(),[3,3];case 2:if(403!==(e=t.sent()).res.status)throw e;return this.loginService.cleanMessages(),this.loginService.addSuccessMessage("send_sms"),[3,3];case 3:return[2]}}))}))},n.ctorParameters=function(){return[{type:ep},{type:Yu},{type:m.UserService}]},jc([t.Input()],n.prototype,"credentials",void 0),jc([t.Output()],n.prototype,"onCancel",void 0),jc([t.Output()],n.prototype,"onChangeView",void 0),n=jc([t.Component({selector:"c8y-provide-phone-number",template:'<form #twoFactorForm="ngForm" role="form" class="loginForm" (ngSubmit)="save()" novalidate>\n <div class="legend form-block center" translate>\n Two-factor authentication\n </div>\n\n <c8y-form-group [ngClass]="requestInProgress || twoFactorForm.invalid ? \'p-b-8\' : \'\'">\n <label translate>Provide your phone number</label>\n\n <input\n class="form-control"\n [(ngModel)]="phoneNumber"\n #contactPhone="ngModel"\n type="text"\n name="phone"\n autocomplete="off"\n placeholder="{{ \'e.g. +49 9 876 543 210`LOCALIZE`\' | translate }}"\n c8yPhoneValidation\n c8yDefaultValidation="phoneNumber"\n required\n />\n </c8y-form-group>\n\n <button\n title="{{ \'Save and continue\' | translate }}"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n [disabled]="requestInProgress || twoFactorForm.invalid"\n >\n {{ \'Save and continue\' | translate }}\n </button>\n\n <div class="d-flex m-t-8">\n <a\n title="{{ \'Login\' | translate }}"\n class="small pointer m-l-auto"\n href="#"\n (click)="onCancel.emit()"\n >\n {{ \'Login\' | translate }}\n </a>\n </div>\n</form>\n'})],n)}(),Np=function(){function e(){}return e=jc([t.NgModule({declarations:[Ep,lp,cp,rp,up,tp,kp,Tp,_p],imports:[xp,u.TooltipModule,Uu,Ud,rc.QRCodeModule],exports:[Ep,cp,rp,lp,up,tp,kp,Tp,_p],entryComponents:[tp],providers:[ip,np]})],e)}(),Dp=function(){function e(e,n){this.users=e,this.alert=n,this.revokeEmitter=new t.EventEmitter}return e.prototype.revoke=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.users.totpRevokeSecret(this.user)];case 1:return t.sent(),this.alert.success("User TOTP secret revoked."),this.revokeEmitter.next(),[3,3];case 2:return e=t.sent(),this.alert.addServerFailure(e),[3,3];case 3:return[2]}}))}))},e.ctorParameters=function(){return[{type:m.UserService},{type:Yu}]},jc([t.Input()],e.prototype,"user",void 0),jc([t.Output("revoke")],e.prototype,"revokeEmitter",void 0),e=jc([t.Component({selector:"c8y-user-totp-revoke",template:'<button\n type="button"\n class="btn btn-default"\n [popover]="confirm"\n [popoverTitle]="\'Revoke TOTP secret\' | translate"\n #popover="bs-popover"\n placement="right"\n>\n <i c8yIcon="key"></i> {{ \'Revoke TOTP secret\' | translate }}\n</button>\n\n<ng-template #confirm>\n <p class="m-b-16" translate>\n This action will revoke the user\'s stored TOTP secret which will require a new setup.\n </p>\n <button\n title="{{ \'Revoke\' | translate }}"\n type="button"\n class="btn btn-danger"\n (click)="revoke(); popover.hide()"\n translate\n >\n Revoke\n </button>\n <button\n title="{{ \'Cancel\' | translate }}"\n type="button"\n class="btn btn-default"\n (click)="popover.hide()"\n translate\n >\n Cancel\n </button>\n</ng-template>\n'})],e)}(),Lp=function(){function e(){}return e=jc([t.NgModule({declarations:[sp,op,Qd,Xd,ap,Dp],imports:[xp,Uu,Ud,l.BsDropdownModule,Np,ed,n.RouterModule,u.TooltipModule.forRoot(),ac.PopoverModule],exports:[sp,Xd,op,Qd,ap,Dp],entryComponents:[Qd,ap,Dp]})],e)}(),Mp=function(){function e(){}return e=jc([t.NgModule({declarations:[wd,Ed,jd,Td,kd,bd],imports:[l.BsDropdownModule,Lp,Jd,Uu,Wu,hd,Bd,Vd],exports:[Ed,wd,jd,Td,kd,bd]})],e)}(),Rp=function(){function n(e,n,a,o,s){this.loginService=e,this.users=n,this.passwordStrengthCheckerService=a,this.options=o,this.alert=s,this.onChangeView=new t.EventEmitter,this.passwordPattern=/^[a-zA-Z0-9`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]{8,32}$/,this.isLoading=!1,this.model={tenantId:"",email:"",newPassword:"",newPasswordConfirm:""},this.emailReadOnly=!1,this.passwordStrengthEnforced=!1,this.TOKEN_PARAM="token",this.EMAIL_PARAM="email"}return n.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return this.model.tenantId=this.loginService.getTenant(),this.model.email=this.options.get(this.EMAIL_PARAM,""),this.emailReadOnly=!!this.model.email,e=this,[4,this.loginService.getPasswordStrengthEnforced()];case 1:return e.passwordStrengthEnforced=t.sent(),[2]}}))}))},n.prototype.changePassword=function(){return Sc(this,void 0,void 0,(function(){var t,n,a;return Cc(this,(function(o){switch(o.label){case 0:t=this.passwordStrengthCheckerService.getStrengthColor(this.model.newPassword),n={token:this.credentials.token,email:this.model.email,newPassword:this.model.newPassword,passwordStrength:t.passwordStrength},o.label=1;case 1:return o.trys.push([1,3,4,5]),this.isLoading=!0,[4,this.users.resetPassword(n,this.model.tenantId)];case 2:return 200===o.sent().res.status&&(this.loginService.addSuccessMessage("password_changed"),this.credentials.token=void 0,this.options.set(this.TOKEN_PARAM,void 0),this.onChangeView.emit({view:e.LoginViews.Credentials})),[3,5];case 3:return a=o.sent(),this.alert.addServerFailure(a),[3,5];case 4:return this.loginService.reset(),this.isLoading=!1,[7];case 5:return[2]}}))}))},n.ctorParameters=function(){return[{type:ep},{type:m.UserService},{type:np},{type:$c},{type:Yu}]},jc([t.Input()],n.prototype,"credentials",void 0),jc([t.Output()],n.prototype,"onChangeView",void 0),n=jc([t.Component({selector:"c8y-change-password",template:'<form\n role="form"\n class="loginForm"\n (ngSubmit)="changePassword()"\n #changePasswordForm="ngForm"\n novalidate\n>\n\n <div\n class="legend form-block center"\n translate\n >\n Change password\n </div>\n\n <c8y-form-group class="tenantField" id="tenantField" *ngIf="loginService.showTenant()">\n <label translate>Tenant ID</label>\n <input\n [(ngModel)]="model.tenantId"\n #tenantId="ngModel"\n type="text"\n name="tenantId"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Tenant ID\' | translate }}"\n required\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Email address</label>\n <input\n [(ngModel)]="model.email"\n #email="ngModel"\n type="text"\n name="email"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Email address\' | translate }}"\n email\n required\n [readonly]="emailReadOnly"\n />\n </c8y-form-group>\n\n <div class="row content-flex-50">\n <div class="col-7">\n <c8y-form-group>\n <label translate>New password</label>\n <input\n [(ngModel)]="model.newPassword"\n #newPassword="ngModel"\n type="password"\n name="newPassword"\n class="form-control"\n placeholder="{{ \'New password\' | translate }}"\n [pattern]="passwordPattern"\n autocomplete="new-password"\n [passwordStrengthEnforced]=\'passwordStrengthEnforced\'\n required\n />\n <c8y-messages>\n <c8y-message\n name="pattern"\n [text]="loginService.ERROR_MESSAGES.pattern_newPassword"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Confirm password</label>\n <input\n [(ngModel)]="model.newPasswordConfirm"\n #newPasswordConfirm="ngModel"\n type="password"\n name="newPasswordConfirm"\n class="form-control"\n placeholder="{{ \'Confirm password\' | translate }}"\n passwordConfirm="newPassword"\n autocomplete="new-password"\n required\n />\n <c8y-messages>\n <c8y-message\n name="passwordConfirm"\n [text]="loginService.ERROR_MESSAGES.passwordConfirm"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n </div>\n <div class="col-5">\n <c8y-password-strength\n [password]="model.newPassword"\n [hidden]="!model.newPassword"\n ></c8y-password-strength>\n <c8y-password-check-list\n class="m-t-32"\n [password]="model.newPassword"\n [hidden]="!model.newPassword || !passwordStrengthEnforced"\n ></c8y-password-check-list>\n </div>\n </div>\n\n <button\n title="{{ \'Set password\' | translate }}"\n [disabled]="!changePasswordForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >\n Set password\n </button>\n</form>\n'})],n)}(),qp=function(){function n(n,a,o){this.loginService=n,this.alert=a,this.ui=o,this.onChangeView=new t.EventEmitter,this.LOGIN_VIEWS=e.LoginViews,this.model={},this.isLoading=!1,this.showLoginForm=!1,this.showBasicAuth=!1,this.oauthOptions={},this.PASSWORD_RESET_HEADER_NAME="passwordresettoken",this.NO_PHONE_HEADER_NAME="NoPhoneHeader"}return n.prototype.ngOnInit=function(){var e=this.loginService,t=e.oauthOptions,n=e.loginMode;this.model.tenant=this.loginService.getTenant(),this.showLoginForm=void 0===n.visibleOnLoginPage||n.visibleOnLoginPage,this.showBasicAuth="BASIC"===n.type,this.oauthOptions=t},n.prototype.redirectToOauth=function(){this.loginService.redirectToOauth()},n.prototype.login=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),this.isLoading=!0,e=this.loginService.useBasicAuth(this.model),[4,this.loginService.login(e,this.model)];case 1:return n.sent(),[3,4];case 2:return(t=n.sent()).res&&t.res.headers&&t.res.headers.get(this.PASSWORD_RESET_HEADER_NAME)?this.handlePasswordReset(t.res):t.res&&401===t.res.status&&/pin/i.test(t.data.message)?this.handleSmsChallenge(t.data.message):t.res&&401===t.res.status&&/TOTP/i.test(t.data.message)?this.handleTotpChallenge(t.data.message):t.res&&t.res.headers&&t.res.headers.get(this.NO_PHONE_HEADER_NAME)&&!this.loginService.isSupportUser(this.model)?this.handleNoPhoneNumberProvided():(this.loginService.generateOauthToken(this.model),this.loginService.reset(),this.alert.addServerFailure(t)),[3,4];case 3:return this.isLoading=!1,[7];case 4:return[2]}}))}))},n.prototype.handlePasswordReset=function(t){this.alert.removeLastDanger(),this.model.token=t.headers.get(this.PASSWORD_RESET_HEADER_NAME),this.onChangeView.emit({view:e.LoginViews.ChangePassword,credentials:this.model})},n.prototype.handleTotpChallenge=function(t){/TOTP setup required/i.test(t)?this.onChangeView.emit({view:e.LoginViews.TotpSetup,credentials:this.model}):this.onChangeView.emit({view:e.LoginViews.TotpChallenge,credentials:this.model})},n.prototype.handleSmsChallenge=function(t){/pin has already been generated/i.test(t)&&this.alert.warning("The verification code was already sent. For a new verification code, please click on the link above."),this.alert.removeLastDanger(),this.onChangeView.emit({view:e.LoginViews.SmsChallenge,credentials:this.model})},n.prototype.handleNoPhoneNumberProvided=function(){this.onChangeView.emit({view:e.LoginViews.ProvidePhoneNumber,credentials:this.model}),this.alert.warning("Two-factor authentication has been turned on for this account. Provide your phone number above to save it in your user profile and start receiving verification codes via SMS.")},n.ctorParameters=function(){return[{type:ep},{type:Yu},{type:Uc}]},jc([t.Output()],n.prototype,"onChangeView",void 0),n=jc([t.Component({selector:"c8y-credentials",template:'<div id="oauth" *ngIf="oauthOptions.initRequest && oauthOptions.visibleOnLoginPage">\n <button\n title="{{ oauthOptions.buttonName | translate }}"\n (click)="redirectToOauth()"\n class="btn btn-block btn-lg form-group"\n >\n <i [c8yIcon]="\'sign-in\'" class="pull-left"></i>\n {{ oauthOptions.buttonName | translate }}\n </button>\n</div>\n\n<form\n role="form"\n class="loginForm"\n (ngSubmit)="login()"\n #loginForm="ngForm"\n *ngIf="showLoginForm"\n novalidate\n>\n <div\n class="legend form-block center"\n *ngIf="!(oauthOptions.initRequest && oauthOptions.visibleOnLoginPage); else orLegend"\n translate\n >\n Login\n </div>\n <ng-template #orLegend>\n <div class="legend form-block center" translate>or</div>\n </ng-template>\n\n <c8y-form-group class="tenantField" id="tenantField" *ngIf="loginService.showTenant()">\n <label for="tenant" translate>Tenant ID</label>\n <input\n [(ngModel)]="model.tenant"\n #tenant="ngModel"\n type="text"\n name="tenant"\n id="tenant"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'e.g.\' | translate }} t12345"\n placeholder-no-required-hint\n required\n />\n </c8y-form-group>\n <c8y-form-group>\n <label for="user" translate>Username</label>\n <input\n [(ngModel)]="model.user"\n #user="ngModel"\n type="text"\n name="user"\n id="user"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'e.g. joe or joe.doe@example.com`LOCALIZE`\' | translate }}"\n placeholder-no-required-hint\n required\n />\n </c8y-form-group>\n <c8y-form-group>\n <label for="password" translate>Password</label>\n <input\n [(ngModel)]="model.password"\n #password="ngModel"\n type="password"\n name="password"\n id="password"\n class="form-control"\n placeholder-no-required-hint\n required\n />\n </c8y-form-group>\n <div class="form-group" *ngIf="showBasicAuth">\n <label title="{{ \'Remember me\' | translate }}" class="c8y-checkbox">\n <input type="checkbox" name="remember" [(ngModel)]="loginService.rememberMe" />\n <span></span>\n <span>{{ \'Remember me\' | translate }}</span>\n </label>\n </div>\n <button\n title="{{ \'Log in\' | translate }}"\n [disabled]="!loginForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n >\n {{ \'Log in\' | translate }}\n </button>\n <div class="text-center m-t-8">\n <a\n title="{{ \'Forgot password?\' | translate }}"\n class="btn btn-link btn-sm"\n (click)="onChangeView.emit({ view: LOGIN_VIEWS.RecoverPassword })"\n >{{ \'Forgot password?\' | translate }}</a\n >\n </div>\n <div class="text-center m-t-8" *ngIf="!!(ui.state$ | async).loginExtraLink">\n <a\n title="{{ (ui.state$ | async).loginExtraLink.label }}"\n [href]="(ui.state$ | async).loginExtraLink.url"\n class="btn btn-link btn-sm"\n >\n {{ (ui.state$ | async).loginExtraLink.label }}</a\n >\n </div>\n</form>\n'})],n)}(),$p=function(){function n(t,n,a){this.loginService=t,this.options=n,this.alert=a,this.currentView=e.LoginViews.None,this.LOGIN_VIEWS=e.LoginViews,this.disabled=!1,this.credentials={},this.displayAlerts=!1,this.TOKEN_PARAM="token"}return n.prototype.ngOnInit=function(){var e=this.getResetPasswordToken();this.loginService.isFirstLogin&&(e?(this.credentials.token=e,this.reset()):this.loginAutomatically()),this.loginService.isFirstLogin=!1},n.prototype.handleLoginTemplate=function(e){this.currentView=e.view,this.credentials=e.credentials||{}},n.prototype.onkeyup=function(e){"Enter"!==e.key&&this.loginService.cleanMessages()},n.prototype.reset=function(){this.loginService.reset(),this.setView(),this.loginService.cleanMessages()},n.prototype.loginAutomatically=function(){return Sc(this,void 0,void 0,(function(){var e,t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.loginService.login()];case 1:return n.sent(),[3,3];case 2:return e=n.sent(),"OAUTH2"===(t=this.loginService.loginMode.type)?this.loginService.redirectToOauth():(this.reset(),"OAUTH2_INTERNAL"===t&&"https:"!==window.location.protocol?this.alert.danger("Current login mode only supports HTTPS."):e.res&&403===e.res.status&&this.alert.addServerFailure(e)),[3,3];case 3:return[2]}}))}))},n.prototype.setView=function(){this.credentials&&this.credentials.token?this.handleLoginTemplate({view:e.LoginViews.ChangePassword,credentials:this.credentials}):this.handleLoginTemplate({view:e.LoginViews.Credentials})},n.prototype.getResetPasswordToken=function(){var e=this.options.get(this.TOKEN_PARAM);return e&&this.options.set(this.TOKEN_PARAM,void 0),e},n.ctorParameters=function(){return[{type:ep},{type:$c},{type:Yu}]},jc([t.Input()],n.prototype,"name",void 0),jc([t.HostListener("keyup",["$event"])],n.prototype,"onkeyup",null),n=jc([t.Component({selector:"c8y-login",template:'<div\n class="loading card fadeInUp animated shadow5"\n *ngIf="currentView !== LOGIN_VIEWS.None"\n [ngSwitch]="currentView"\n>\n <div class="card-block p-b-0">\n <img class="mainlogo">\n <c8y-credentials\n *ngSwitchCase="LOGIN_VIEWS.Credentials"\n (onChangeView)="handleLoginTemplate($event)"\n ></c8y-credentials>\n <c8y-recover-password\n *ngSwitchCase="LOGIN_VIEWS.RecoverPassword"\n (onChangeView)="handleLoginTemplate($event)"\n ></c8y-recover-password>\n <c8y-change-password\n *ngSwitchCase="LOGIN_VIEWS.ChangePassword"\n (onChangeView)="handleLoginTemplate($event)"\n [credentials]="credentials"\n ></c8y-change-password>\n <c8y-totp-auth\n *ngSwitchCase="LOGIN_VIEWS.TotpChallenge"\n (onCancel)="reset()"\n [view]="currentView"\n [credentials]="credentials"\n >\n </c8y-totp-auth>\n <c8y-totp-auth\n *ngSwitchCase="LOGIN_VIEWS.TotpSetup"\n (onCancel)="reset()"\n [view]="currentView"\n [credentials]="credentials"\n >\n </c8y-totp-auth>\n <c8y-sms-challenge\n *ngSwitchCase="LOGIN_VIEWS.SmsChallenge"\n (onCancel)="reset()"\n [credentials]="credentials"\n ></c8y-sms-challenge>\n\n <c8y-provide-phone-number\n *ngSwitchCase="LOGIN_VIEWS.ProvidePhoneNumber"\n (onCancel)="reset()"\n (onChangeView)="handleLoginTemplate($event)"\n [credentials]="credentials"\n ></c8y-provide-phone-number>\n\n <c8y-alert-outlet position="static"></c8y-alert-outlet>\n </div>\n</div>\n'})],n)}(),Fp=function(){function n(n,a){this.users=n,this.loginService=a,this.onChangeView=new t.EventEmitter,this.LOGIN_VIEWS=e.LoginViews,this.isLoading=!1,this.model={email:"",tenantId:""}}return n.prototype.ngOnInit=function(){this.model.tenantId=this.loginService.getTenant()},n.prototype.resetPassword=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return e.trys.push([0,,2,3]),this.isLoading=!0,[4,this.users.sendPasswordResetMail(this.model.email,this.model.tenantId)];case 1:return 200===e.sent().res.status&&this.loginService.addSuccessMessage("password_reset_requested"),[3,3];case 2:return this.loginService.reset(),this.isLoading=!1,[7];case 3:return[2]}}))}))},n.ctorParameters=function(){return[{type:m.UserService},{type:ep}]},jc([t.Output()],n.prototype,"onChangeView",void 0),n=jc([t.Component({selector:"c8y-recover-password",template:'<form #resetForm="ngForm" role="form" class="loginForm" (ngSubmit)="resetPassword()" novalidate>\n <div class="legend form-block center" translate>\n Forgot password?\n </div>\n <c8y-form-group class="tenantField" id="tenantField" *ngIf="loginService.showTenant()">\n <label translate>Tenant ID</label>\n <input\n [(ngModel)]="model.tenantId"\n #tenantId="ngModel"\n type="text"\n name="tenantId"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Tenant ID\' | translate }}"\n required\n />\n </c8y-form-group>\n\n <c8y-form-group>\n <label translate>Email address</label>\n <input\n [(ngModel)]="model.email"\n #email="ngModel"\n type="text"\n name="email"\n autocapitalize="off"\n autocorrect="off"\n class="form-control"\n placeholder="{{ \'Email address\' | translate }}"\n email\n required\n />\n </c8y-form-group>\n\n <button\n title="{{ \'Reset password\' | translate }}"\n [disabled]="!resetForm.form.valid || isLoading"\n type="submit"\n class="btn btn-primary btn-lg btn-block form-group"\n translate\n >\n Reset password\n </button>\n <div class="text-center m-t-8">\n <p>\n <a\n title="{{ \'Login\' | translate }}"\n class="btn btn-link btn-sm"\n (click)="onChangeView.emit({ view: LOGIN_VIEWS.Credentials })"\n translate\n >\n Login\n </a>\n </p>\n </div>\n</form>\n'})],n)}(),Up=function(){function n(n,a,o){this.loginService=n,this.userService=a,this.alert=o,this.onCancel=new t.EventEmitter,this.LOGIN_VIEWS=e.LoginViews,this.loading=!1,this.hasError=!1}return Object.defineProperty(n.prototype,"isSetup",{get:function(){return this.view===e.LoginViews.TotpSetup},enumerable:!0,configurable:!0}),n.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return this.view!==this.LOGIN_VIEWS.TotpSetup?[3,2]:[4,this.loginService.switchLoginMode(this.credentials)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},n.prototype.onTotpSuccess=function(e){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,6,7,8]),this.loading=!0,this.hasError=!1,this.credentials.tfa=e,this.isSetup?[4,this.userService.activateTotp()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[4,this.loginService.switchLoginMode(this.credentials)];case 3:return n.sent(),[4,this.loginService.verifyAppAccess()];case 4:return n.sent(),[4,this.loginService.authFulfilled()];case 5:return n.sent(),[3,8];case 6:return t=n.sent(),this.alert.removeLastDanger(),t.data&&"Access is denied"===t.data.message&&this.alert.addServerFailure(t),t.data&&"Authentication failed! : User account is locked"===t.data.message?this.alert.warning("Authentication failed due to: user account is locked."):this.hasError=!0,[3,8];case 7:return this.loading=!1,[7];case 8:return[2]}}))}))},n.ctorParameters=function(){return[{type:ep},{type:m.UserService},{type:Yu}]},jc([t.Input()],n.prototype,"credentials",void 0),jc([t.Input()],n.prototype,"view",void 0),jc([t.Output()],n.prototype,"onCancel",void 0),n=jc([t.Component({selector:"c8y-totp-auth",template:'<div\n class="legend form-block center"\n translate\n>\n Two-factor authentication\n</div>\n\n<c8y-totp-setup *ngIf="isSetup">\n</c8y-totp-setup>\n<c8y-totp-challenge\n [loading]="loading"\n [hasError]="hasError"\n [verify]="view === LOGIN_VIEWS.TotpSetup"\n (onSuccess)="onTotpSuccess($event)"\n></c8y-totp-challenge>\n\n<div class="text-center m-t-8">\n <a\n title="{{ \'Cancel\' | translate }}"\n class="btn btn-link btn-sm"\n (click)="onCancel.emit()"\n translate\n >\n Cancel\n </a>\n</div>\n'})],n)}(),Bp=function(){function e(e){this.passwordService=e}return e.prototype.isStrong=function(e){return this.isPasswordGreen(this.passwordService.getStrengthColor(e).passwordStrength)},e.prototype.isPasswordGreen=function(e){return e===m.PasswordStrength.GREEN},e.ctorParameters=function(){return[{type:np}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(np))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"})],e)}(),Gp=function(){function e(e){this.passwordService=e}var n;return n=e,Object.defineProperty(e.prototype,"passwordStrengthEnforced",{set:function(e){this.forced=e},enumerable:!0,configurable:!0}),e.prototype.validate=function(e){var t=this.passwordService.isStrong(e.value||"");return this.forced&&!t?{passwordStrength:!0}:null},e.ctorParameters=function(){return[{type:Bp}]},jc([t.Input()],e.prototype,"passwordStrengthEnforced",null),e=n=jc([t.Directive({selector:"[passwordStrengthEnforced]",providers:[{provide:nc.NG_VALIDATORS,useExisting:n,multi:!0}]})],e)}(),Hp=function(){function e(){}var n;return n=e,e.forRoot=function(){return{ngModule:n,providers:n.providers()}},e.providers=function(){return[ep]},e=n=jc([t.NgModule({declarations:[$p,Fp,Rp,qp,Up,Gp],imports:[nc.FormsModule,u.TooltipModule,Uu,Np,ed,xp],exports:[$p]})],e)}(),zp=function(){function e(e){this.tabs=e,this.label=""}return e.prototype.ngAfterContentInit=function(){var e=this;setTimeout((function(){return e.tabs.add(e)}))},e.prototype.ngOnDestroy=function(){this.tabs.remove(this)},e.ctorParameters=function(){return[{type:ld}]},jc([t.ViewChild("tpl",{static:!1})],e.prototype,"template",void 0),jc([t.Input()],e.prototype,"path",void 0),jc([t.Input()],e.prototype,"label",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"priority",void 0),jc([t.Input()],e.prototype,"orientation",void 0),e=jc([t.Component({selector:"c8y-tab",template:"<ng-template #tpl><ng-content></ng-content></ng-template>"})],e)}(),Vp=function(){function e(e,t,n){this.router=e,this.renderer=t,this.el=n,this.tabs=[],this.orientation="vertical",this.navigatorOpen=!1,this.showLeft=!1,this.showRight=!1}return Object.defineProperty(e.prototype,"isNavigatorOpen",{get:function(){return this.navigatorOpen},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasTabs",{get:function(){var e=[];return this.tabs&&(e=this.tabs.filter((function(e){return!0!==e.hide}))),e.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHorizontal",{get:function(){return"horizontal"===this.orientation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return"horizontal"!==this.orientation},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.scrollSubscription&&this.scrollSubscription.unsubscribe()},e.prototype.ngAfterContentInit=function(){"horizontal"===this.orientation&&this.scrollSubscribe()},e.prototype.isActive=function(e){return!(!e||!e.path)&&this.router.isActive(e.path,!1)},e.prototype.navigateTo=function(e){this.router.navigate([e])},e.prototype.scroll=function(e){void 0===e&&(e="right");var t=this.getDimensions(),n=t.widthScroll,a=t.width,o=t.scrollLeft+a*("left"===e?-1:1);o<0&&(o=0),o>n-a&&(o=n-a),this.container.nativeElement.scrollLeft=o},e.prototype.scrollSubscribe=function(){var e,t=this;this.scrollSubscription=a.merge(a.fromEvent(this.container.nativeElement,"scroll"),a.fromEventPattern((function(n){e=t.renderer.listen("window","resize",n)}),(function(){return e()}))).pipe(o.debounceTime(250)).subscribe((function(){return t.updateScroll()}))},e.prototype.updateScroll=function(){var e=this.getDimensions(),t=e.widthScroll,n=e.width,a=e.scrollLeft;this.showLeft=!!a,this.showRight=t>n+a},e.prototype.getDimensions=function(){var e=this.tabsContainer.nativeElement,t=this.container.nativeElement;return{widthScroll:e.scrollWidth,width:t.clientWidth,scrollLeft:t.scrollLeft}},e.ctorParameters=function(){return[{type:n.Router},{type:t.Renderer2},{type:t.ElementRef}]},jc([t.Input()],e.prototype,"tabs",void 0),jc([t.Input()],e.prototype,"orientation",void 0),jc([t.Input()],e.prototype,"navigatorOpen",void 0),jc([t.HostBinding("class.navigator-open")],e.prototype,"isNavigatorOpen",null),jc([t.HostBinding("class.page-tabs")],e.prototype,"hasTabs",null),jc([t.HostBinding("class.page-tabs-horizontal")],e.prototype,"isHorizontal",null),jc([t.HostBinding("class.page-tabs-vertical")],e.prototype,"isVertical",null),jc([t.ViewChild("container",{read:t.ElementRef,static:!0})],e.prototype,"container",void 0),jc([t.ViewChild("left",{read:t.ElementRef,static:!1})],e.prototype,"leftBtn",void 0),jc([t.ViewChild("right",{read:t.ElementRef,static:!1})],e.prototype,"rightBtn",void 0),jc([t.ViewChild("tabsContainer",{read:t.ElementRef,static:!1})],e.prototype,"tabsContainer",void 0),e=jc([t.Component({selector:"c8y-tabs-outlet,c8y-ui-tabs",template:'<div #container class="tabContainer hidden-xs">\n <button class="tabs-slider tabs-slider-left" #left *ngIf="showLeft" (click)="scroll(\'left\')">\n <i [c8yIcon]="\'chevron-left\'"></i>\n </button>\n <button class="tabs-slider tabs-slider-right" #right *ngIf="showRight" (click)="scroll(\'right\')">\n <i [c8yIcon]="\'chevron-right\'"></i>\n </button>\n <ul class="nav nav-tabs nav-tabsc8y" #tabsContainer>\n <li [ngClass]="{\'active\': rla.isActive}" *ngFor="let tab of tabs">\n <a [routerLink]="tab.path" routerLinkActive #rla="routerLinkActive" title="{{tab?.label | translate}}">\n <i [c8yIcon]="tab?.icon" *ngIf="!tab.template && tab?.icon"></i>\n <span class="txt" *ngIf="!tab.template">{{tab?.label | translate}}</span>\n <ng-container *ngTemplateOutlet="tab.template"></ng-container>\n </a>\n </li>\n </ul>\n</div>\n\n<div class="visible-xs mobile-tabs">\n <div class="c8y-select-wrapper">\n <select (change)="navigateTo($event.target.value)" #select>\n <option *ngFor="let tab of tabs" [value]="tab.path" [selected]="isActive(tab)">\n {{tab?.label | translate}}\n </option>\n </select>\n </div>\n</div>\n'})],e)}(),Kp=function(){function e(e,t){this.tabsService=e,this.router=t,this.endSubscriptions$=new a.Subject}return e.prototype.ngOnInit=function(){var e=this;this.tabsService.firstTab$.pipe(o.takeUntil(this.endSubscriptions$)).subscribe((function(t){t&&e.router.navigateByUrl(t.path,{replaceUrl:!0})}))},e.prototype.ngOnDestroy=function(){this.endSubscriptions$.next(),this.endSubscriptions$.complete()},e.ctorParameters=function(){return[{type:ld},{type:n.Router}]},e=jc([t.Component({selector:"c8y-conditional-tabs-outlet",template:"\n <router-outlet></router-outlet>\n "})],e)}(),Wp=function(){function e(){}return e=jc([t.NgModule({declarations:[Kp,Vp,zp],imports:[Uu,n.RouterModule.forChild([])],exports:[Kp,Vp,zp]})],e)}(),Yp=function(){function n(t){this.cookieBannerService=t,this.closeSubject=new a.Subject,this.title="Cookie preferences",this.labels={ok:"Save settings",cancel:"Cancel"},this.status=e.Status.INFO}return n.prototype.ngOnInit=function(){this.configCookiePreferencesList=this.cookieBannerService.transformCookiePreferencesToList(this.configCookiePreferences)},n.prototype.ngAfterViewInit=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.modalRef.result];case 1:return e.sent(),this.onClose(),[3,3];case 2:return e.sent(),this.onDismiss(),[3,3];case 3:return[2]}}))}))},n.prototype.onClose=function(){var e=this.cookieBannerService.transformCookiePreferencesListToCookiePreferences(this.configCookiePreferencesList);this.closeSubject.next(e),this.closeSubject.complete()},n.prototype.onDismiss=function(){this.closeSubject.next(void 0),this.closeSubject.complete()},n.prototype.getCookieDescription=function(e){return this.cookieBannerService.getCookieDescription(e)},n.ctorParameters=function(){return[{type:Gd}]},jc([t.ViewChild("modalRef",{static:!1})],n.prototype,"modalRef",void 0),n=jc([t.Component({selector:"c8y-cookie-banner-preferences-modal",template:'<c8y-confirm-modal [title]="title" [status]="status" [labels]="labels" #modalRef>\n\n <div *ngFor="let item of configCookiePreferencesList" class="row p-t-8 p-b-8 separator-top">\n <div class="col-xs-2">\n <div class="text-center">\n <label class="c8y-switch">\n <input\n name="{{ item.name }}"\n type="checkbox"\n [(ngModel)]="item.value"\n [disabled]="item.isReadonly"\n />\n <span></span>\n </label>\n </div>\n </div>\n <div class="col-xs-10">\n <h4 class="text-medium">\n {{ item.name | translate | humanize }}\n </h4>\n <p>\n {{ getCookieDescription(item.name) | translate }}\n </p>\n </div>\n </div>\n</c8y-confirm-modal>\n'})],n)}(),Zp=function(){function e(e,t){this.bsModalService=e,this.cookieBannerService=t,this.shouldDisable=!1}return e.prototype.ngOnInit=function(){this.settings=this.cookieBannerService.getCookieBannerSettings(),this.cookiePreferences=this.cookieBannerService.getCookiePreferencesConfig(),this.shouldShowCookieBanner()},e.prototype.onConfigurePreferences=function(){var e=this;this.disableButtons(!0);var t={configCookiePreferences:this.cookiePreferences};this.bsModalService.show(Yp,{initialState:t}).content.closeSubject.subscribe((function(t){e.disableButtons(!1),t&&(e.cookieBannerService.setCookies(t),e.setCookieBannerVisibility(!1))}))},e.prototype.acceptCookies=function(){this.cookieBannerService.setCookies(this.cookiePreferences||{required:!0}),this.setCookieBannerVisibility(!1)},e.prototype.shouldShowCookieBanner=function(){this.setCookieBannerVisibility(this.cookieBannerService.shouldShowCookieBanner())},e.prototype.disableButtons=function(e){this.shouldDisable=e},e.prototype.setCookieBannerVisibility=function(e){this.showBanner=e,this.cookieBannerService.isCookieBannerShowed$.next(e)},e.ctorParameters=function(){return[{type:oc.BsModalService},{type:Gd}]},e=jc([t.Component({selector:"c8y-cookie-banner",template:'<div class="c8y-cookie-banner">\n <div class="container">\n <div class="row p-t-16 p-b-16" *ngIf="showBanner">\n <div class="col-md-2" *ngIf="settings.cookieBannerTitle">\n <h3>{{ settings.cookieBannerTitle | translate }}</h3>\n <div class="p-b-16 visible-sm visible-xs"></div>\n </div>\n <div class="col-md-7">\n <div class="cookie-banner-content text-pre-line">\n {{ settings.cookieBannerText | translate }}\n </div>\n </div>\n <div class="col-md-3">\n <div class="row">\n <div class="col-sm-6 col-md-12">\n <div class="p-b-16 visible-sm visible-xs"></div>\n <button\n class="btn btn-primary btn-block"\n (click)="acceptCookies()"\n [disabled]="shouldDisable"\n >\n {{ \'Agree and proceed\' | translate }}\n </button>\n </div>\n <div class="col-sm-6 col-md-12" *ngIf="!!cookiePreferences">\n <div class="p-b-16"></div>\n <button\n class="btn btn-default btn-block"\n (click)="onConfigurePreferences()"\n [disabled]="shouldDisable"\n >\n {{ \'Configure preferences\' | translate }}\n </button>\n </div>\n <div class="col-sm-6 col-md-12">\n <div class="p-b-16"></div>\n <a\n class="btn btn-default btn-block"\n href="{{ settings.policyUrl }}"\n target="_blank"\n *ngIf="settings.policyUrl"\n >\n {{ \'Privacy policy\' | translate }}\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n'})],e)}(),Jp=function(){function e(){}return e=jc([t.NgModule({declarations:[id,Zp,Yp],imports:[nc.FormsModule,Uu,Mp,Hp,n.RouterModule,Wp,Gu,ed,Bd,u.TooltipModule,Ud],exports:[id],entryComponents:[id,Yp],providers:[Gd]})],e)}(),Xp=function(){function e(e){this.cd=e,this.title="Upload file",this.message="Drop file here",this.icon="plus-square",this.loadingMessage="Uploading…",this.alwaysShow=!1,this.clickToOpen=!0,this.loading=!1,this.progress=-1,this.dropped=new t.EventEmitter,this.maxAllowedFiles=1/0,this.isOver=!1,this.errors=!1,this.onChange=function(e){},this.onTouched=function(){}}var n;return n=e,e.prototype.ngOnInit=function(){this.alwaysShow=this.alwaysShow||0===this.area.nativeElement.children.length,this.files&&this.files.length>0&&this.onFilesSelected(this.files)},e.prototype.toggle=function(e){this.zone.nativeElement.style.height=this.area.nativeElement.offsetHeight+"px",this.onOver()},e.prototype.showPicker=function(e){this.preventDefault(e),this.picker.nativeElement.value="",this.picker.nativeElement.click()},e.prototype.onOver=function(){this.isOver||(this.isOver=!0,document.addEventListener("dragover",this.preventDefault),document.addEventListener("drop",this.preventDefault))},e.prototype.onPick=function(e){this.errors=!1,this.preventDefault(e),this.onFilesSelected(e.target.files)},e.prototype.onDrop=function(e){this.preventDefault(e),this.onFilesSelected(e.dataTransfer.files),this.stopDragging()},e.prototype.shouldShowFilesList=function(){return this.alwaysShow&&!this.isFilesArrayEmpty()&&!this.hasEmptyFiles()&&!this.isTooManyFiles()},e.prototype.stopDragging=function(){document.removeEventListener("dragover",this.preventDefault),document.removeEventListener("drop",this.preventDefault),this.isOver=!1},e.prototype.onDelete=function(){delete this.files,delete this.filesNameString,this.clearErrors(),this.dropped.emit(void 0),this.onChange(void 0)},e.prototype.writeValue=function(e){this.files=e,e||this.onDelete(),this.cd.detectChanges()},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.onFilesSelected=function(e){if(this.files=e,this.filesNameString=this.getFilesNamesAsString(e),this.errors=!1,this.isFilesArrayEmpty()||this.isTooManyFiles())this.errors=!0,this.errorMessage="Too many files selected.";else if(this.hasEmptyFiles())this.errors=!0,this.errorMessage="File must not be empty, select another one.";else{var t=this.compose(e);this.dropped.emit(t),this.onChange(t)}},e.prototype.getFilesNamesAsString=function(e){return s.map(e,(function(e){return e.name})).join(", ")},e.prototype.isFilesArrayEmpty=function(){return 0===s.get(this,"files.length",0)},e.prototype.isTooManyFiles=function(){return s.get(this,"files.length",0)>this.maxAllowedFiles},e.prototype.hasEmptyFiles=function(){var e=!0;return this.isFilesArrayEmpty()||(e=this.isAnyFileEmpty()),e},e.prototype.isAnyFileEmpty=function(){return s.some(Array.from(this.files),["size",0])},e.prototype.clearErrors=function(){delete this.errorMessage,this.errors=!1},e.prototype.preventDefault=function(e){e&&e.preventDefault()},e.prototype.compose=function(e){var t=this;return Array.from(e).map((function(e){return{file:e,readAsJson:function(){return Sc(t,void 0,void 0,(function(){var t,n;return Cc(this,(function(a){switch(a.label){case 0:return n=(t=JSON).parse,[4,this.read(e,Ap.TEXT)];case 1:return[2,n.apply(t,[a.sent()])]}}))}))},readAsText:function(){return Sc(t,void 0,void 0,(function(){return Cc(this,(function(t){return[2,this.read(e,Ap.TEXT)]}))}))},readAsArrayBuffer:function(){return Sc(t,void 0,void 0,(function(){return Cc(this,(function(t){return[2,this.read(e,Ap.ARRAY_BUFFER)]}))}))},readAsBinaryString:function(){return Sc(t,void 0,void 0,(function(){return Cc(this,(function(t){return[2,this.read(e,Ap.BINARY_STRING)]}))}))},readAsDataURL:function(){return Sc(t,void 0,void 0,(function(){return Cc(this,(function(t){return[2,this.read(e,Ap.DATA_URL)]}))}))}}}))},e.prototype.read=function(e,t){return Sc(this,void 0,void 0,(function(){var n=this;return Cc(this,(function(a){return[2,new Promise((function(a,o){var s=new FileReader;switch(t){case Ap.TEXT:s.readAsText(e);break;case Ap.ARRAY_BUFFER:s.readAsArrayBuffer(e);break;case Ap.BINARY_STRING:s.readAsBinaryString(e);break;case Ap.DATA_URL:s.readAsDataURL(e)}s.onload=function(){return n.onLoad(s,a,o)}}))]}))}))},e.prototype.onLoad=function(e,t,n){2===e.readyState&&(e.error&&n(e.error),t(e.result))},e.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},jc([t.Input()],e.prototype,"title",void 0),jc([t.Input()],e.prototype,"message",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"loadingMessage",void 0),jc([t.Input()],e.prototype,"alwaysShow",void 0),jc([t.Input()],e.prototype,"clickToOpen",void 0),jc([t.Input()],e.prototype,"loading",void 0),jc([t.Input()],e.prototype,"progress",void 0),jc([t.Output()],e.prototype,"dropped",void 0),jc([t.Input()],e.prototype,"maxAllowedFiles",void 0),jc([t.Input()],e.prototype,"files",void 0),jc([t.Input()],e.prototype,"accept",void 0),jc([t.ViewChild("area",{static:!0})],e.prototype,"area",void 0),jc([t.ViewChild("zone",{static:!1})],e.prototype,"zone",void 0),jc([t.ViewChild("picker",{static:!1})],e.prototype,"picker",void 0),e=n=jc([t.Component({selector:"c8y-drop-area",template:'<div\n class="drop-zone"\n *ngIf="!shouldShowFilesList()"\n [ngClass]="{ \'has-errors\': errors }"\n [style.pointerEvents]="loading ? \'none\' : \'auto\'"\n #zone\n (dragleave)="stopDragging()"\n (drop)="onDrop($event)"\n (dragover)="onOver()"\n [style.display]="isOver || alwaysShow || loading ? \'block\' : \'none\'"\n (click)="showPicker($event)"\n>\n <div class="file-placeholder" [ngClass]="{ \'drag-over\': isOver }">\n <div *ngIf="loading" class="d-flex p-4 flex-center">\n <p class="flex-item-middle m-r-8">\n {{ loadingMessage | translate }}\n </p>\n <div class="progress progress-striped active m-0" *ngIf="progress !== -1"\n style="min-width: 50%;">\n <div\n class="progress-bar"\n role="progressbar"\n aria-valuenow="0"\n aria-valuemin="0"\n aria-valuemax="100"\n [style.width]="progress + \'%\'"\n ></div>\n </div>\n <div class="spinner p-relative m-0" *ngIf="progress === -1">\n <div class="rect1"></div>\n <div class="rect2"></div>\n <div class="rect3"></div>\n <div class="rect4"></div>\n <div class="rect5"></div>\n </div>\n </div>\n\n <div *ngIf="!loading" class="hint-placeholder pointer">\n <i class="dlt-c8y-icon-{{ icon }}"></i>\n <p *ngIf="!errors">\n <b>{{ message | translate }}</b>\n <br />\n <span *ngIf="alwaysShow && clickToOpen" translate>or click to browse your computer.</span>\n </p>\n <div *ngIf="errors" class="has-errors">\n <p class="form-control-feedback-message">\n {{ errorMessage | translate }}\n </p>\n </div>\n </div>\n </div>\n</div>\n\n<div class="drop-zone" *ngIf="shouldShowFilesList()"\n [style.display]="isOver || alwaysShow || loading ? \'block\' : \'none\'">\n <div *ngIf="loading" class="d-flex p-4 flex-center">\n <p class="flex-item-middle m-r-8">\n {{ loadingMessage | translate }}\n </p>\n <div class="progress progress-striped active m-0" *ngIf="progress !== -1"\n style="min-width: 50%;">\n <div\n class="progress-bar"\n role="progressbar"\n aria-valuenow="0"\n aria-valuemin="0"\n aria-valuemax="100"\n [style.width]="progress + \'%\'"\n ></div>\n </div>\n <div class="spinner p-relative m-0" *ngIf="progress === -1">\n <div class="rect1"></div>\n <div class="rect2"></div>\n <div class="rect3"></div>\n <div class="rect4"></div>\n <div class="rect5"></div>\n </div>\n </div>\n <div *ngIf="!loading" class="file-placeholder p-4">\n <div class="flex-row p-4">\n <i c8yIcon="file-o" class="m-r-8"></i>\n <span title="{{ filesNameString }}" class="text-truncate">\n {{ filesNameString }}\n </span>\n <button\n title="{{ \'Remove\' | translate }}"\n class="btn btn-clean showOnHover flex-item-right"\n >\n <i c8yIcon="minus-circle" class="text-danger" (click)="onDelete()"></i>\n </button>\n </div>\n </div>\n</div>\n\n<input\n #picker\n *ngIf="clickToOpen"\n (change)="onPick($event)"\n (click)="picker.focus()"\n (blur)="onTouched()"\n [accept]="accept"\n [multiple]="maxAllowedFiles > 1"\n type="file"\n style="opacity: 0; filter: alpha(opacity = 0); height: 0px"\n/>\n<div #area [hidden]="isOver || loading" (dragover)="toggle($event)">\n <ng-content></ng-content>\n</div>\n',providers:[{provide:nc.NG_VALUE_ACCESSOR,useExisting:n,multi:!0}]})],e)}();!function(e){e[e.TEXT=0]="TEXT",e[e.DATA_URL=1]="DATA_URL",e[e.ARRAY_BUFFER=2]="ARRAY_BUFFER",e[e.BINARY_STRING=3]="BINARY_STRING"}(Ap||(Ap={}));var Qp,em=function(){function e(){}return e=jc([t.NgModule({imports:[Uu],exports:[Xp],declarations:[Xp]})],e)}(),tm=function(){function e(){this.onFilesPicked=new t.EventEmitter,this.maxAllowedFiles=1/0,this.uploadChoice="uploadBinary"}return e.prototype.ngOnInit=function(){this.fileBinary&&(this.droppedFiles=[this.fileBinary])},e.prototype.onFileDropped=function(e){this.onFilesPicked.emit({droppedFiles:e})},e.prototype.clearInputFromUrl=function(){delete this.fileUrl,this.fileToSave={url:void 0},this.onFilesPicked.emit(this.fileToSave)},e.prototype.clearSelectedFiles=function(){this.dropArea.onDelete(),this.fileToSave={droppedFiles:void 0},this.onFilesPicked.emit(this.fileToSave)},e.prototype.onFileUrlChange=function(e){this.fileToSave={url:e},this.onFilesPicked.emit(this.fileToSave)},jc([t.ViewChild(Xp,{static:!0})],e.prototype,"dropArea",void 0),jc([t.Output()],e.prototype,"onFilesPicked",void 0),jc([t.Input()],e.prototype,"maxAllowedFiles",void 0),jc([t.Input()],e.prototype,"uploadChoice",void 0),jc([t.Input()],e.prototype,"fileUrl",void 0),jc([t.Input()],e.prototype,"fileBinary",void 0),e=jc([t.Component({selector:"c8y-file-picker",template:'<div class="form-group">\n <label title="{{ \'Upload a binary\' | translate }}" class="c8y-radio radio-inline">\n <input\n #radio\n type="radio"\n value="uploadBinary"\n name="uploadChoice"\n [(ngModel)]="uploadChoice"\n (click)="clearInputFromUrl()"\n />\n <span></span>\n <span>{{ \'Upload a binary\' | translate }}</span>\n </label>\n <label title="{{ \'Use a URL\' | translate }}" class="c8y-radio radio-inline">\n <input\n #radio\n type="radio"\n value="uploadUrl"\n name="uploadChoice"\n [(ngModel)]="uploadChoice"\n (click)="clearSelectedFiles()"\n />\n <span></span>\n <span>{{ \'Use a URL\' | translate }}</span>\n </label>\n</div>\n\n<div [hidden]="uploadChoice !== \'uploadBinary\'">\n <c8y-form-group class="m-0">\n <c8y-drop-area\n class="drop-area-sm"\n (dropped)="onFileDropped($event)"\n [title]="\'Drop file or click to browse\' | translate"\n [maxAllowedFiles]="maxAllowedFiles"\n [files]="droppedFiles"\n >\n </c8y-drop-area>\n </c8y-form-group>\n</div>\n\n<div [hidden]="uploadChoice !== \'uploadUrl\'">\n <c8y-form-group class="m-0">\n <div class="m-b-4 p-b-8">\n <div class="input-group">\n <span class="input-group-addon">\n <i c8yIcon="globe"></i>\n </span>\n <input\n type="text"\n class="form-control"\n name="fileUrl"\n [(ngModel)]="fileUrl"\n (ngModelChange)="onFileUrlChange($event)"\n placeholder="{{ \'e.g.\' | translate }} http://example.com/binary.zip"\n required\n />\n </div>\n </div>\n </c8y-form-group>\n</div>\n'})],e)}(),nm=function(){function e(){}return e=jc([t.NgModule({imports:[xp,i.CommonModule,em,nc.FormsModule,Uu],exports:[tm],declarations:[tm]})],e)}(),am=function(){function e(){this.onDateSelected=new t.EventEmitter}return e.prototype.ngOnInit=function(){this.fgDatePicker=new nc.FormGroup({dateFrom:new nc.FormControl,dateTo:new nc.FormControl})},e.prototype.filter=function(){this.onDateSelected.emit(this.fgDatePicker.value),this.dateFrom=this.fgDatePicker.get("dateFrom").value,this.dateTo=this.fgDatePicker.get("dateTo").value},e.prototype.clearFilter=function(){this.fgDatePicker.setValue({dateFrom:null,dateTo:null}),this.onDateSelected.emit(null),this.dateFrom=null,this.dateTo=null},jc([t.Output()],e.prototype,"onDateSelected",void 0),e=jc([t.Component({selector:"c8y-date-picker",template:'<div\n dropdown\n class="c8y-child-assets-selector"\n #datefilter="bs-dropdown"\n placement="bottom left"\n [autoClose]="false"\n>\n <button\n id="date-range"\n dropdownToggle\n title="{{ \'Date filter\' | translate }}"\n type="button"\n class="btn dropdown-toggle d-flex a-i-center c8y-dropdown"\n aria-controls="dropdown-date-range"\n >\n <i c8yIcon="calendar-o" class="m-r-4 text-primary"></i>\n <span class="text-truncate">\n <span *ngIf="dateFrom">\n <span class="text-label-small">{{ \'From`date`\' | translate }}</span>\n {{ dateFrom | date }}\n </span>\n <span *ngIf="dateTo">\n <span class="text-label-small">{{ \'To`date`\' | translate }}</span>\n {{ dateTo | date }}\n </span>\n <span *ngIf="!dateFrom && !dateTo">\n {{ \'Filter by date\' | translate }}\n </span>\n </span>\n </button>\n <div\n id="dropdown-date-range"\n *dropdownMenu\n class="dropdown-menu"\n role="menu"\n aria-labelledby="date-range"\n >\n <form [formGroup]="fgDatePicker" class="dropdown-form">\n <span class="text-medium m-b-4" translate>Date from</span>\n <c8y-form-group class="datepicker d-block m-b-16" style="max-height: 32px;">\n <input\n formControlName="dateFrom"\n class="form-control fit-w text-left"\n placeholder="{{ \'Date from\' | translate }}"\n bsDatepicker\n [bsConfig]="{ customTodayClass: \'today\', returnFocusToInput: true }"\n />\n </c8y-form-group>\n <span class="text-medium m-b-4" translate>Date to</span>\n <c8y-form-group class="datepicker m-l-0 d-block" style="max-height: 32px;">\n <input\n formControlName="dateTo"\n class="form-control fit-w text-left"\n placeholder="{{ \'Date to\' | translate }}"\n bsDatepicker\n [bsConfig]="{ customTodayClass: \'today\', returnFocusToInput: true }"\n />\n </c8y-form-group>\n <div class="p-t-24">\n <button\n title="{{ \'Clear selection\' | translate }}"\n type="button"\n class="btn btn-default btn-sm"\n (click)="clearFilter(); datefilter.isOpen = !datefilter.isOpen"\n >\n {{ \'Clear`selection`\' | translate }}\n </button>\n <button\n [disabled]="!fgDatePicker.get(\'dateFrom\').value && !fgDatePicker.get(\'dateTo\').value"\n title="{{ \'Apply selection\' | translate }}"\n type="submit"\n class="btn btn-primary btn-sm"\n (click)="filter(); datefilter.isOpen = !datefilter.isOpen"\n >\n {{ \'Apply`selection`\' | translate }}\n </button>\n </div>\n </form>\n </div>\n</div>\n'})],e)}(),om=function(){function e(){}return e=jc([t.NgModule({imports:[xp,i.CommonModule,nc.FormsModule,nc.ReactiveFormsModule,l.BsDropdownModule.forRoot(),lc.BsDatepickerModule.forRoot(),Uu],exports:[am],declarations:[am]})],e)}();(Qp=e.ViewContext||(e.ViewContext={})).Device="device/:id",Qp.Group="group/:id",Qp.User="users/:id",Qp.Application="applications/:id",Qp.SubscribedApplications="subscribedApplications/:id",Qp.Tenant="tenants/:id",Qp.Report="reports/:id";var sm=function(){function e(e,t){this.injector=e,this.router=t}return Object.defineProperty(e.prototype,"routerStateSnapshot",{get:function(){return this.router.routerState.snapshot},enumerable:!0,configurable:!0}),e.prototype.resolve=function(e){var t=this,n=this.router.config.find((function(t){return e.routeConfig.path===t.path})).children;return a.from(n||[]).pipe(o.mergeMap((function(n){return a.from(t.getGuards(n)).pipe(o.map((function(n){return n.canActivate(e,t.routerStateSnapshot)})),o.mergeMap((function(e){return a.isObservable(e)?e:e&&"function"==typeof e.then?a.from(e):a.of(e)})),o.tap((function(e){Array.isArray(e)&&(n.tabs=e)})),o.every((function(e){return!!e})),o.filter((function(e){return e})),o.mergeMap((function(){return Array.isArray(n.tabs)?a.from(n.tabs):a.of(n)})),o.map((function(t){return t.label||t.path?{label:t.label,icon:t.icon,path:decodeURIComponent(e.url.join("/"))+"/"+t.path,priority:t.priority,hide:t.hide}:void 0})))})),o.filter((function(e){return!!e})),o.toArray())},e.prototype.getGuards=function(e){var t=this,n=(e.canActivate||[]).map((function(e){return t.injector.get(e)}));return e.data&&e.data.showIf&&n.push({canActivate:e.data.showIf}),n},e.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},e=jc([t.Injectable()],e)}(),rm=function(){function t(){}return t.contextToService=function(e){return t.services.get(e)},t.services=new Map([[e.ViewContext.Device,m.InventoryService],[e.ViewContext.Group,m.InventoryService],[e.ViewContext.User,m.UserService],[e.ViewContext.Application,m.ApplicationService],[e.ViewContext.SubscribedApplications,m.ApplicationService],[e.ViewContext.Tenant,m.TenantService],[e.ViewContext.Report,m.InventoryService]]),t}(),lm=function(){function e(e,t,n,o,s){this.tabsResolver=e,this.tabsService=t,this.router=n,this.apiService=o,this.injector=s,this.lastAddedTabs=[],this.refreshTrigger=new a.Subject}return e.prototype.init=function(e){var t=this;this.routerSubscription=this.router.events.pipe(o.filter((function(e){return e instanceof n.NavigationEnd}))).subscribe((function(){return t.redirectToFirstTab()})),this.dataSubscription=e.data.pipe(o.merge(this.updatedContext(e),this.refreshTrigger),o.switchMap((function(){return t.tabsResolver.resolve(e.snapshot)}))).subscribe((function(e){return t.updateTabs(e)}))},e.prototype.destroy=function(){var e=this;this.dataSubscription.unsubscribe(),this.routerSubscription.unsubscribe(),this.lastAddedTabs.forEach((function(t){return e.tabsService.remove(t)}))},e.prototype.refreshContext=function(){this.refreshTrigger.next()},e.prototype.updatedContext=function(e){var t=e.snapshot.data,n=rm.contextToService(t.context);if(n){var o=this.injector.get(n).getDetailUrl(t.contextData).replace(/\d+/g,"?\\d*"),s=new RegExp(o,"i"),r=new RegExp(o+"/child","i");return this.apiService.hookResponse((function(e){var t=e.url,n=e.method,a=s.test(t)&&["POST","PUT"].includes(n),o=r.test(t)&&["POST","DELETE"].includes(n);return a||o}))}return a.NEVER},e.prototype.updateTabs=function(e){var t=this;void 0===e&&(e=[]),this.lastAddedTabs.forEach((function(e){return t.tabsService.remove(e)})),this.lastAddedTabs=e,e.forEach((function(e){return t.tabsService.add(e)})),this.redirectToFirstTab()},e.prototype.redirectToFirstTab=function(){var e=this;this.needsRedirect()&&this.tabsService.firstTab$.subscribe((function(t){t&&e.router.navigateByUrl(t.path,{replaceUrl:!0})}))},e.prototype.needsRedirect=function(){return 2===this.router.parseUrl(this.router.url).root.children[n.PRIMARY_OUTLET].segments.length},e.ctorParameters=function(){return[{type:sm},{type:ld},{type:n.Router},{type:c.ApiService},{type:t.Injector}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(sm),t.ɵɵinject(ld),t.ɵɵinject(n.Router),t.ɵɵinject(c.ApiService),t.ɵɵinject(t.INJECTOR))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"})],e)}(),im=new t.InjectionToken("RouteFactory"),cm=function(){function e(e,t,n,a){var o=this;this.router=t,this.tabsService=n,this.contextRouteService=a,Ec(e).subscribe((function(e){o.addRoute(e)}))}return e.prototype.refresh=function(){this.contextRouteService.refreshContext()},e.prototype.addRoute=function(e){this.addRoutes(Array.isArray(e)?e:[e])},e.prototype.addRoutes=function(e){var t=this,n=this.router.config.find((function(e){return"**"===e.path}));this.router.resetConfig(Oc(this.router.config.filter((function(e){return"**"!==e.path})),e.map((function(e){return t.convertRoute(t.router.config,e)})),[n]).filter(Boolean))},e.prototype.convertRoute=function(e,t){if(!t.context)return t;e.forEach((function(e){e.data&&e.data.context===t.context&&(e.children=Oc([t],e.children||[]))}))},e.ctorParameters=function(){return[{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[im]}]},{type:n.Router},{type:ld},{type:lm}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(im,8),t.ɵɵinject(n.Router),t.ɵɵinject(ld),t.ɵɵinject(lm))},token:e,providedIn:"root"}),e=jc([t.Injectable({providedIn:"root"}),wc(0,t.Optional()),wc(0,t.Inject(im))],e)}(),um=function(){function e(e,t){this.route=e,this.contextRouteService=t}return e.prototype.ngOnInit=function(){this.contextRouteService.init(this.route)},e.prototype.ngOnDestroy=function(){this.contextRouteService.destroy()},e.prototype.refreshTabs=function(){this.contextRouteService.refreshContext()},e.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:lm}]},e=jc([t.Component({selector:"c8y-context-route",template:"<router-outlet></router-outlet>\n"})],e)}(),dm=function(){function e(e){this.client=e,this.callsSubject=new a.Subject,this.calls=this.callsSubject.asObservable(),this.hookIntoClientFetch()}return e.prototype.hookResponse=function(e){return this.callsSubject.pipe(o.filter((function(e){return"finish"===e.phase})),o.filter(e))},e.prototype.hookRequest=function(e){return this.callsSubject.pipe(o.filter((function(e){return"start"===e.phase})),o.filter(e))},e.prototype.onFinish=function(e){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){return this.callsSubject.next(bc({phase:"finish"},e)),[2]}))}))},e.prototype.onStart=function(e){this.callsSubject.next(bc({phase:"start"},e))},e.prototype.resolveData=function(e){return Sc(this,void 0,void 0,(function(){var t,n,a;return Cc(this,(function(o){return t=e.response,n=e.method,"data"in t?[2,Promise.resolve({data:t.data,method:n})]:(a=function(e){return{data:e,method:n}},[2,t.clone().json().then(a,a)])}))}))},e.prototype.hookIntoClientFetch=function(){var e=this,t=this.client.fetch.bind(this.client);this.client.fetch=function(n,a){return void 0===a&&(a={method:"GET"}),Sc(e,void 0,void 0,(function(){var e,o,s=this;return Cc(this,(function(r){return e=a.method,this.onStart({options:a,method:e,url:n}),o=t(n,a),"function"==typeof a.responseInterceptor&&(o=o.then(a.responseInterceptor)),o.then((function(t){return s.onFinish({response:t,url:n,options:a,method:e})}),(function(t){return s.onFinish({response:t,url:n,options:a,method:e})})),[2,o]}))}))}},e.ctorParameters=function(){return[{type:m.FetchClient}]},e=jc([t.Injectable()],e)}(),pm=Object.freeze({__proto__:null,FetchClient:m.FetchClient,BasicAuth:m.BasicAuth,CookieAuth:m.CookieAuth,Realtime:m.Realtime,EventBinaryService:m.EventBinaryService,EventService:m.EventService,InventoryService:m.InventoryService,MeasurementService:m.MeasurementService,AlarmService:m.AlarmService,OperationBulkService:m.OperationBulkService,OperationService:m.OperationService,ApplicationService:m.ApplicationService,UserService:m.UserService,TenantService:m.TenantService,SystemOptionsService:m.SystemOptionsService,TenantOptionsService:m.TenantOptionsService,TenantSecurityOptionsService:m.TenantSecurityOptionsService,TenantLoginOptionsService:m.TenantLoginOptionsService,AuditService:m.AuditService,InventoryRoleService:m.InventoryRoleService,InventoryBinaryService:m.InventoryBinaryService,DeviceRegistrationService:m.DeviceRegistrationService,DeviceRegistrationBulkService:m.DeviceRegistrationBulkService,UserRoleService:m.UserRoleService,UserGroupService:m.UserGroupService,IdentityService:m.IdentityService,TrustedCertificateService:m.TrustedCertificateService,SmartGroupsService:m.SmartGroupsService,SmartRulesService:m.SmartRulesService});var mm=Object.keys(pm).map((function(e){return t=pm[e],n=[m.FetchClient,m.Realtime],t===m.FetchClient&&(n=[m.CookieAuth]),t!==m.BasicAuth&&t!==m.CookieAuth||(n=[]),t===m.Realtime&&(n=[m.FetchClient]),{provide:t,useClass:t,deps:n};var t,n})).concat([{provide:dm,useClass:dm,deps:[m.FetchClient]}]),hm=(function(){function e(){}var n;n=e,e.providers=function(){return mm},e.forRoot=function(){return{ngModule:n,providers:mm}},e=n=jc([t.NgModule()],e)}(),function(){function e(e){this.injector=e,this.caches=new Map}return e.prototype.canActivate=function(e){var t=e.paramMap.get("id"),n=this.service(e);return this.clearDetailCached(n,t),this.detailCached(n,t).pipe(o.tap((function(t){return e.data=bc({},e.data,{contextData:t})})),o.map((function(){return!0})),o.catchError((function(e){return a.of(!1)})))},e.prototype.service=function(e){var t=rm.contextToService(e.data.context);return this.injector.get(t)},e.prototype.detailCached=function(e,t){var n=this.getCache(e),s=n[t];if(!s){var r=e instanceof m.InventoryService?{withChildren:!1}:void 0;s=a.from(e.detail(t,r)).pipe(o.map((function(e){return e.data})),o.shareReplay(1)),n[t]=s}return s},e.prototype.clearDetailCached=function(e,t){delete this.getCache(e)[t]},e.prototype.getCache=function(e){var t=this.caches.get(e);return t||(t={},this.caches.set(e,t)),t},e.ctorParameters=function(){return[{type:t.Injector}]},e=jc([t.Injectable()],e)}()),fm=function(){function e(){}return e=jc([t.Component({selector:"empty",template:""})],e)}(),gm=[{path:"users/new",component:fm},{path:"tenants/new",component:fm}];for(var ym in e.ViewContext){var vm=e.ViewContext[ym];gm.push({path:vm,component:um,canActivate:[hm],data:{context:vm,contextData:{}},resolve:{tabs:sm}})}var bm,jm,wm,Sm,Cm,Im,Pm=function(){function e(e){}var a;return a=e,e.providers=function(){return[hm,sm,cm]},e.forRoot=function(){return{ngModule:a,providers:a.providers()}},e.ctorParameters=function(){return[{type:cm}]},e=a=jc([t.NgModule({declarations:[um,fm],imports:[n.RouterModule.forRoot(gm),Mp,Uu],entryComponents:[um,fm]})],e)}();(wm=e.SendStatus||(e.SendStatus={})).AVAILABLE="AVAILABLE",wm.UNAVAILABLE="UNAVAILABLE",wm.UNKNOWN="UNKNOWN",wm.MAINTENANCE="MAINTENANCE",wm.NOT_MONITORED="NOT_MONITORED",(Sm=e.PushStatus||(e.PushStatus={})).CONNECTED="CONNECTED",Sm.DISCONNECTED="DISCONNECTED",Sm.UNKNOWN="UNKNOWN",Sm.MAINTENANCE="MAINTENANCE",(Cm=e.SendStatusLabels||(e.SendStatusLabels={}))[Cm.AVAILABLE="Send connection: online"]="AVAILABLE",Cm[Cm.NOT_MONITORED="Send connection: not monitored"]="NOT_MONITORED",Cm[Cm.UNAVAILABLE="Send connection: offline"]="UNAVAILABLE",Cm[Cm.UNKNOWN="Send connection status unknown"]="UNKNOWN",Cm[Cm.MAINTENANCE="Device is under maintenance"]="MAINTENANCE",(Im=e.PushStatusLabels||(e.PushStatusLabels={}))[Im.CONNECTED="Push connection: active"]="CONNECTED",Im[Im.DISCONNECTED="Push connection: inactive"]="DISCONNECTED",Im[Im.UNKNOWN="Push connection: inactive"]="UNKNOWN",Im[Im.MAINTENANCE="Device is under maintenance"]="MAINTENANCE";var Om={sendData:(bm={},bm[e.SendStatus.AVAILABLE]={icon:"long-arrow-right",class:"statusOk"},bm[e.SendStatus.UNAVAILABLE]={icon:"long-arrow-right",class:"statusNok"},bm[e.SendStatus.UNKNOWN]={icon:"long-arrow-right",class:"statusUnknown"},bm[e.SendStatus.NOT_MONITORED]={icon:"long-arrow-right",class:"statusUnknown"},bm),push:(jm={},jm[e.PushStatus.CONNECTED]={icon:"long-arrow-left",class:"statusOk"},jm[e.PushStatus.DISCONNECTED]={icon:"long-arrow-left",class:"statusUnknown"},jm[e.PushStatus.UNKNOWN]={icon:"long-arrow-left",class:"statusUnknown"},jm[e.PushStatus.MAINTENANCE]={icon:"wrench",class:"statusAlert"},jm),device:{MAINTENANCE:{icon:"wrench",class:"statusAlert"}}},xm=function(e,t){var n=i.formatDate(new Date(e),"medium",t.currentLang);return t.instant("Device last request:\n{{date}}",{date:n})},Em={sendStatusConnected:xm,sendStatusDisconnected:"Connection not monitored",pushStatusConnected:"Connection to device established",pushStatusDisconnected:"Connection to device not established (not supported by device or no connectivity)",maintenance:"Device is under maintenance"},km=function(){function n(e){this.translateService=e}return Object.defineProperty(n.prototype,"node",{set:function(e){this._mo=e.mo||e},enumerable:!0,configurable:!0}),n.prototype.get=function(){return this._mo},n.prototype.ngOnChanges=function(){this.setStatusProperites()},n.prototype.ngAfterContentInit=function(){this.setStatusProperites()},n.prototype.setStatusProperites=function(){this.requiredAvailability=s.get(this._mo,"c8y_RequiredAvailability"),this.availabilityStatus=s.get(this._mo,"c8y_Availability.status"),this.pushStatus=s.get(this._mo,"c8y_Connection.status")||"UNKNOWN",this.sendStatus=this.availabilityStatus||(this.requiredAvailability?"UNKNOWN":"NOT_MONITORED")},n.prototype.status=function(){return"MAINTENANCE"===this.availabilityStatus||"MAINTENANCE"===this.pushStatus?this.getMaintenanceStatus():this.getSendPushStatus()},n.prototype.getMaintenanceStatus=function(){return{sendStatus:!1,pushStatus:!1,maintenanceStatus:{icon:Om.device.MAINTENANCE.icon,class:Om.device.MAINTENANCE.class,tooltip:Em.maintenance}}},n.prototype.getSendPushStatus=function(){return{sendStatus:{icon:Om.sendData[this.sendStatus].icon,class:Om.sendData[this.sendStatus].class,status:this.sendStatus,label:e.SendStatusLabels[this.sendStatus],tooltip:this.getSendStatusTooltip(this._mo)},pushStatus:{icon:Om.push[this.pushStatus].icon,class:Om.push[this.pushStatus].class,status:this.pushStatus,label:e.PushStatusLabels[this.pushStatus],tooltip:this.getPushStatusTooltip("CONNECTED"===this.pushStatus)},maintenanceStatus:!1}},n.prototype.getSendStatusTooltip=function(e){var t=e&&e.c8y_Availability,n=t&&t.lastMessage;return n?Em.sendStatusConnected(n,this.translateService):Em.sendStatusDisconnected},n.prototype.getPushStatusTooltip=function(e){return e?Em.pushStatusConnected:Em.pushStatusDisconnected},n.ctorParameters=function(){return[{type:p.TranslateService}]},jc([t.Input("mo")],n.prototype,"node",null),n=jc([t.Component({selector:"device-status",template:'\x3c!-- ATTENTION: keep text format in `tooltip` attribute --\x3e\n<div class="statusContainer"\n title="{{status().sendStatus.tooltip | translate}}\n{{status().pushStatus.tooltip | translate}}"\n placement="left"\n >\n <div\n *ngIf="!!status().sendStatus"\n class="sendStatus"\n [c8yIcon]="status().sendStatus.icon"\n [ngClass]="status().sendStatus.class"\n ></div>\n <div\n *ngIf="!!status().pushStatus"\n class="pushStatus"\n [c8yIcon]="status().pushStatus.icon"\n [ngClass]="status().pushStatus.class"\n >\n </div>\n\n <div *ngIf="!!status().maintenanceStatus"\n class="maintenanceStatus"\n tooltip="{{status().maintenanceStatus.tooltip | translate}}"\n container="body"\n placement="auto"\n [c8yIcon]="status().maintenanceStatus.icon"\n [ngClass]="status().maintenanceStatus.class"></div>\n</div>\n'})],n)}(),Tm=function(){function e(){}return e=jc([t.NgModule({imports:[Uu,u.TooltipModule],exports:[km],declarations:[km]})],e)}(),Am=function(){function e(e){this.elementRef=e,this.htmlAnchor=this.elementRef.nativeElement,this.htmlAnchor.hasAttribute("target")||this.htmlAnchor.setAttribute("target","_blank")}return Object.defineProperty(e.prototype,"baseHref",{set:function(e){this.htmlAnchor.href=e+"/"+this.c8yGuideHref},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:t.ElementRef}]},jc([t.Input("c8y-guide-href")],e.prototype,"c8yGuideHref",void 0),e=jc([t.Directive({selector:"[c8y-guide-href]"})],e)}(),_m=function(){function e(e,t,n){this.docs=e,this.el=t,this.renderer=n,this.destroyed$=new a.ReplaySubject(1)}return e.prototype.ngOnInit=function(){this.baseUrl=this.docs.getBaseUrl()},e.prototype.ngAfterContentInit=function(){var e=this;this.translateDirective?this.translateDirective.htmlUpdateEvent.pipe(o.takeUntil(this.destroyed$)).subscribe((function(){e.replaceAnchorAttributes()})):this.replaceAnchorAttributes()},e.prototype.replaceAnchorAttributes=function(){var e=this;this.findGuideAnchors(this.el.nativeElement).forEach((function(t){var n=e.baseUrl+"/"+t.getAttribute("c8y-guide-href");e.renderer.setAttribute(t,"href",n),t.hasAttribute("target")||e.renderer.setAttribute(t,"target","_blank")}))},e.prototype.findGuideAnchors=function(e){var t=this,n=[];return"A"===e.nodeName&&e.attributes.getNamedItem("c8y-guide-href")?n.push(e):e.childNodes&&e.childNodes.length>0&&e.childNodes.forEach((function(e){var a=t.findGuideAnchors(e);a&&(n=Oc(n,a))})),n},e.prototype.ngAfterViewInit=function(){var e=this;this.links.forEach((function(t){t.baseHref=e.baseUrl}))},e.prototype.ngOnDestroy=function(){this.destroyed$.next(!0),this.destroyed$.complete()},e.ctorParameters=function(){return[{type:xd},{type:t.ElementRef},{type:t.Renderer2}]},jc([t.ContentChildren(Am,{descendants:!0})],e.prototype,"links",void 0),jc([t.ContentChild(eu,{static:!1})],e.prototype,"translateDirective",void 0),e=jc([t.Component({selector:"[c8y-guide-docs]",template:'<ng-container *ngIf="!!baseUrl">\n <ng-content></ng-content>\n</ng-container>\n'})],e)}(),Nm=function(){function e(){}return e=jc([t.NgModule({declarations:[Am,_m],imports:[i.CommonModule],exports:[Am,_m],providers:[xd]})],e)}(),Dm=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}var a;return vc(n,e),a=n,n.prototype.ngOnInit=function(){this.to.required&&!this.field.fieldGroup.length&&this.add()},n.CONFIG={types:[{name:"array",component:a}]},n=a=jc([t.Component({selector:"c8y-array-type",template:'<div role="group"\n [attr.aria-labelledby]="id + \'-fieldset\'"\n>\n <div id="{{id + \'-fieldset\'}}"\n class="legend form-block"\n *ngIf="to.label || to.description"\n >\n {{ to.label }}\n <button\n *ngIf="to.description"\n class="btn-clean text-14 m-l-4 flex-item-middle"\n [popover]="to.description"\n placement="right"\n outsideClick="true"\n type="button"\n >\n <i c8yIcon="question-circle-o" class="text-primary"></i>\n </button>\n </div>\n\n <div class="form-control-feedback-message has-error"\n role="alert"\n *ngIf="showError && formControl.errors"\n >\n <formly-validation-message [field]="field"></formly-validation-message>\n </div>\n\n <div *ngFor="let field of field.fieldGroup; let i = index" class="input-group-array">\n <formly-field [field]="field">\n </formly-field>\n <div class="input-group-btn">\n <button\n class="btn btn-clean flex-item-right"\n title="{{ \'Delete\' | translate }}"\n (click)="remove(i)"\n >\n <i c8yIcon="minus-circle" class="text-danger"></i>\n </button>\n </div>\n </div>\n\n <div class="p-t-8">\n <button\n title="{{ \'Add \\{\\{ label \\}\\}\' | translate: field?.fieldArray?.templateOptions }}"\n class="btn-add-block"\n (click)="add()"\n >\n <i c8yIcon="plus-square"></i>\n <span ngNonBindable translate [translateParams]="field?.fieldArray?.templateOptions"\n >Add {{ label }}</span\n >\n </button>\n </div>\n</div>\n'})],n)}(ic.FieldArrayType),Lm=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.defaultOptions={templateOptions:{indeterminate:!0,formCheck:"custom"}},t}var a;return vc(n,e),a=n,n.CONFIG={types:[{name:"checkbox",component:a},{name:"boolean",extends:"checkbox"}]},n=a=jc([t.Component({selector:"c8y-field-checkbox",template:' <label class="c8y-checkbox" [class.has-error]="showError">\n <input\n type="checkbox"\n [class.is-invalid]="showError"\n [class.form-check-input]="to.formCheck.indexOf(\'custom\') === -1"\n [class.position-static]="to.formCheck === \'nolabel\'"\n [class.custom-control-input]="to.formCheck.indexOf(\'custom\') === 0"\n [indeterminate]="to.indeterminate && formControl.value == null"\n [formControl]="formControl"\n [formlyAttributes]="field"\n /><span></span><span> {{ to.label }} </span>\n <span *ngIf="to.required && to.hideRequiredMarker !== true"><em class="m-l-4" translate>(required)</em></span>\n <button\n *ngIf="!!to.description"\n class="btn-clean m-l-4 flex-item-middle"\n [popover]="to.description"\n placement="auto"\n outsideClick="true"\n type="button"\n >\n <i c8yIcon="question-circle-o" class="text-primary"></i>\n </button>\n </label>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],n)}(ic.FieldType),Mm=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.dropAreaInputs=["title","message","icon","loadingMessage","alwaysShow","clickToOpen","loading","progress","maxAllowedFiles","files","accept"],t}var a;return vc(n,e),a=n,n.prototype.ngOnInit=function(){var e=this;this.dropAreaInputs.filter((function(t){return void 0!==e.to[t]})).forEach((function(t){return e.dropArea[t]=e.to[t]}))},n.CONFIG={types:[{name:"file",component:a}]},jc([t.ViewChild("dropArea",{static:!0})],n.prototype,"dropArea",void 0),n=a=jc([t.Component({selector:"c8y-field-file",template:'<div class="form-group" role="group" [attr.aria-labelledby]="id + \'-fieldset\'">\n <div id="{{ id + \'-fieldset\' }}" class="legend form-block" *ngIf="to.label || to.description">\n {{ to.label }}\n <button\n *ngIf="to.description"\n class="btn-clean text-14 m-l-4"\n [popover]="to.description"\n placement="right"\n outsideClick="true"\n type="button"\n >\n <i c8yIcon="question-circle-o" class="text-primary"></i>\n </button>\n </div>\n\n <c8y-drop-area #dropArea class="drop-area-sm" [formControl]="formControl"> </c8y-drop-area>\n\n <div\n class="form-control-feedback-message has-error"\n role="alert"\n *ngIf="showError && formControl.errors"\n >\n <formly-validation-message [field]="field"></formly-validation-message>\n </div>\n</div>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],n)}(ic.FieldType),Rm=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.maxHelpBlockLength=64,t}var a;return vc(n,e),a=n,n.prototype.ngOnInit=function(){this.showDescriptionAsPopup="radio"===this.field.type||this.to.description&&this.to.description.length>this.maxHelpBlockLength},n.CONFIG={wrappers:[{name:"c8y-form-field",component:a}]},n=a=jc([t.Component({selector:"c8y-wrapper-form-field",template:'<div class="form-group" [class.has-error]="showError">\n <label *ngIf="to.label && to.hideLabel !== true" [attr.for]="id">\n {{ to.label }}\n <button\n *ngIf="to.description && showDescriptionAsPopup"\n class="btn-clean m-l-4 flex-item-middle"\n [popover]="to.description"\n placement="auto"\n outsideClick="true"\n type="button"\n >\n <i c8yIcon="question-circle-o" class="text-primary"></i>\n </button>\n </label>\n\n <ng-template #fieldComponent></ng-template>\n\n <div *ngIf="showError" class="c8y-messages">\n <formly-validation-message\n class="form-control-feedback-message"\n [field]="field"\n ></formly-validation-message>\n </div>\n\n <div class="help-block" *ngIf="!showError && to.description && !showDescriptionAsPopup">\n {{ to.description }}\n </div>\n</div>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],n)}(ic.FieldWrapper),qm=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}var a;return vc(n,e),a=n,Object.defineProperty(n.prototype,"type",{get:function(){return this.to.type||"text"},enumerable:!0,configurable:!0}),n.CONFIG={types:[{name:"input",component:a,wrappers:["c8y-form-field"]},{name:"string",extends:"input"},{name:"number",extends:"input",defaultOptions:{templateOptions:{type:"number"}}},{name:"integer",extends:"input",defaultOptions:{templateOptions:{type:"number"}}}]},n=a=jc([t.Component({selector:"c8y-field-input",template:'<input\n *ngIf="type !== \'number\'; else numberTmp"\n [type]="type"\n [formControl]="formControl"\n class="form-control"\n [formlyAttributes]="field"\n [required]="to.required"\n [attr.autocomplete]="to.autocomplete ? to.autocomplete : null"\n [class.is-invalid]="showError"\n/>\n<ng-template #numberTmp>\n <input\n type="number"\n [formControl]="formControl"\n class="form-control"\n [formlyAttributes]="field"\n [required]="to.required"\n [attr.autocomplete]="to.autocomplete ? to.autocomplete : null"\n [class.is-invalid]="showError"\n />\n</ng-template>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],n)}(ic.FieldType),$m=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}var a;return vc(n,e),a=n,n.CONFIG={types:[{name:"object",component:a}]},n=a=jc([t.Component({selector:"c8y-object-type",template:'<div role="group"\n [attr.aria-labelledby]="id + \'-fieldset\'" \n>\n <div id="{{id + \'-fieldset\'}}" \n class="legend form-block" \n *ngIf="to.label"\n >{{ to.label }}</div>\n <p *ngIf="to.description">{{ to.description }}</p>\n <div class="form-control-feedback-message has-error" \n role="alert" \n *ngIf="showError && formControl.errors"\n >\n <formly-validation-message [field]="field"></formly-validation-message>\n </div>\n <formly-field *ngFor="let f of field.fieldGroup" [field]="f"></formly-field>\n</div>\n'})],n)}(ic.FieldType),Fm=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.defaultOptions={templateOptions:{options:[],formCheck:"custom"}},t}var a;return vc(n,e),a=n,n.CONFIG={types:[{name:"radio",component:a,wrappers:["c8y-form-field"]}]},n=a=jc([t.Component({selector:"c8y-field-radio",template:'<label\n *ngFor="let option of to.options | formlySelectOptions: field | async; let i = index"\n [title]="option.label"\n class="c8y-radio"\n>\n <input\n type="radio"\n [id]="id + \'_\' + i"\n [name]="field.name || id"\n [attr.value]="option.value"\n [value]="option.value"\n [formControl]="formControl"\n [formlyAttributes]="field"\n [attr.disabled]="option.disabled || formControl.disabled ? true : null"\n />\n <span></span>\n <span>{{ option.label }}</span>\n</label>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],n)}(ic.FieldType),Um=[Lm,Dm,Rm,Mm,qm,Fm,$m];function Bm(){return Um.map((function(e){return e.CONFIG})).reduce((function(e,t){return bc({},e,{types:Oc(e.types,t.types||[]),wrappers:Oc(e.wrappers,t.wrappers||[])})}),{types:[],wrappers:[]})}var Gm=function(){function e(){}return e=jc([t.NgModule({declarations:Oc(Um),entryComponents:Oc(Um),imports:[i.CommonModule,ac.PopoverModule,nc.ReactiveFormsModule,nu,em,xp,ic.FormlyModule,cc.FormlySelectModule],providers:[{provide:ic.FORMLY_CONFIG,useFactory:Bm,multi:!0}]})],e)}(),Hm=function(){function e(e,t){this.translate=e,this.parser=t}return e.prototype.prePopulate=function(e){var t=this,n=e.templateOptions||{};n.label&&!n._translated&&(n._translated=!0,e.expressionProperties=bc({},e.expressionProperties||{},{"templateOptions.label":n.label?this.translate.stream(n.label):n.label,"templateOptions.description":n.description?this.translate.stream(n.description):n.description,"templateOptions.placeholder":n.placeholder?a.combineLatest([this.translate.stream(n.placeholder),this.translate.stream("e.g. {{ example }}")]).pipe(o.map((function(e){var n=Pc(e,2),a=n[0],o=n[1];return t.parser.interpolate(o,{example:a})}))):n.placeholder,"templateOptions.options":(a.isObservable(n.options)?n.options:a.of(n.options)).pipe(o.map((function(e){return(e||[]).map((function(e){return bc({},e,{label:t.translate.instant(e.label)})}))})))}))},e}();function zm(e,t){return{extensions:[{name:"translate",extension:new Hm(e,t)}]}}var Vm=zm,Km=function(){function e(){}return e=jc([t.NgModule({imports:[ic.FormlyModule,nu],providers:[{provide:ic.FORMLY_CONFIG,multi:!0,useFactory:Vm,deps:[p.TranslateService,p.TranslateParser]}]})],e)}(),Wm=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return vc(n,e),n.prototype.toFieldConfig=function(t,n){return e.prototype.toFieldConfig.call(this,t,this.c8yOptions((n||{}).map))},n.prototype.c8yOptions=function(e){return{map:function(t,n){var a=t;return n.const&&(a=bc({},a,{defaultValue:n.const,templateOptions:bc({},a.templateOptions,{type:"hidden"})})),n.writeOnly&&(a=bc({},a,{templateOptions:bc({},a.templateOptions,{type:"password",autocomplete:"off"})})),n.examples&&(a=bc({},a,{templateOptions:bc({},a.templateOptions,{placeholder:n.examples.join(", ")})})),n.enum&&(a=bc({},a,{type:"radio"})),(n.contentMediaType||n.contentEncoding)&&(a=bc({},a,{type:"file",templateOptions:bc({},a.templateOptions,{accept:n.contentMediaType,maxAllowedFiles:1,contentEncoding:n.contentEncoding})})),e?e(a,n):a}}},n=jc([t.Injectable()],n)}(uc.FormlyJsonschema);function Ym(e){return{validationMessages:[{name:"required",message:function(){return e.stream("This field is required.")}},{name:"pattern",message:function(t,n){return e.stream("Does not match pattern {{ requiredPattern }}",t)}}]}}var Zm,Jm=Ym,Xm=function(){function e(){}return e=jc([t.NgModule({imports:[nu,ic.FormlyModule],providers:[{provide:ic.FORMLY_CONFIG,multi:!0,useFactory:Jm,deps:[p.TranslateService]}]})],e)}(),Qm=function(){function e(){}return e=jc([t.NgModule({imports:[i.CommonModule,nc.ReactiveFormsModule,Km,Xm,Gm,ic.FormlyModule.forRoot()],providers:[Wm],exports:[ic.FormlyModule,nc.ReactiveFormsModule]})],e)}(),eh=new t.InjectionToken("Hook Dynamic Component"),th=new t.InjectionToken("Hook Dynamic Component @deprecated"),nh=function(e){function s(t,n){var o=e.call(this)||this;return o.injector=t,o.refreshTrigger=new a.Subject,o.state$=new a.BehaviorSubject(new Set),o.items$=Ec([function(){return o.injector.get(eh,[])},function(){return o.getComponentsViaDeprecatedHook()}],n,!1),o.items$.subscribe((function(e){e.forEach((function(e){o.state.add(e)})),o.emitNewState()})),o}return vc(s,e),s.prototype.getComponentsViaDeprecatedHook=function(){var e=this.injector.get(th,[]);return e&&e.length&&"production"!==__MODE__&&console.warn("HOOK_COMPONENT is now deprecated. Use HOOK_COMPONENTS instead."),e},s.prototype.refresh=function(){this.refreshTrigger.next(1)},Object.defineProperty(s.prototype,"state",{get:function(){return this.state$.value},enumerable:!0,configurable:!0}),s.prototype.getById$=function(e){return this.state$.pipe(o.filter((function(e){return e.size>0})),o.mergeMap((function(t){return a.of(Array.from(t).find((function(t){return t.id===e})))})),o.take(1))},s.prototype.add=function(e){this.state.add(e),this.emitNewState()},s.prototype.remove=function(e){this.state.delete(e),this.emitNewState()},s.ctorParameters=function(){return[{type:t.Injector},{type:n.Router}]},s.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(t.INJECTOR),t.ɵɵinject(n.Router))},token:s,providedIn:"root"}),s=jc([t.Injectable({providedIn:"root"})],s)}(Nc),ah=function(){function e(e,t){this.componentFactoryResolver=e,this.dynamicComponentService=t,this.mode="component",this.notFoundError=!0,this.expandErrorDetails=!1}return e.prototype.callLifeCycleHooks=function(){return this.callOnBeforeSaveHook()},e.prototype.ngOnChanges=function(){var e=this;this.dynamicComponentService.getById$(this.componentId).subscribe((function(t){return e.loadComponent(t)}))},e.prototype.loadComponent=function(e){try{this.error=void 0;var t=this.componentFactoryResolver.resolveComponentFactory("component"===this.mode?e.component:e.configComponent);this.host.clear(),this.componentRef=this.host.createComponent(t),this.componentRef.instance.config=this.config}catch(e){this.error=e}},e.prototype.callOnBeforeSaveHook=function(){if(!this.componentRef)return a.of(!0);var e=this.componentRef.instance.onBeforeSave;if(e){var t=e.call(this.componentRef.instance,this.config);return s.isUndefined(t)?a.of(!0):a.isObservable(t)?t:a.of(t)}return a.of(!0)},e.ctorParameters=function(){return[{type:t.ComponentFactoryResolver},{type:nh}]},jc([t.Input()],e.prototype,"componentId",void 0),jc([t.Input()],e.prototype,"config",void 0),jc([t.Input()],e.prototype,"mode",void 0),jc([t.Input()],e.prototype,"notFoundError",void 0),jc([t.ViewChild("host",{read:t.ViewContainerRef,static:!0})],e.prototype,"host",void 0),e=jc([t.Component({selector:"c8y-dynamic-component",template:'<ng-template #host></ng-template>\n\n<div class="alert alert-warning m-8" role="alert" *ngIf="notFoundError && error">\n <strong class="message">\n {{\n \'This widget cannot be rendered because the current application does not support the following component:\'\n | translate\n }}\n {{ componentId }}.\n </strong>\n <p class="text-muted m-t-8">\n <button class="btn btn-clean" (click)="expandErrorDetails = !expandErrorDetails">\n <i c8yIcon="chevron-down"></i>\n <span *ngIf="!expandErrorDetails" translate>Show details</span>\n <span *ngIf="expandErrorDetails" translate>Hide details</span>\n </button>\n </p>\n <div [collapse]="!expandErrorDetails" [isAnimated]="true">\n <pre>\n {{ error }}\n </pre>\n </div>\n</div>\n'})],e)}(),oh=function(){function e(){}return e=jc([t.NgModule({declarations:[ah],imports:[i.CommonModule,r.CollapseModule,n.RouterModule.forChild([]),cu],exports:[ah],providers:[nh]})],e)}(),sh=function(){function e(){}return jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),e=jc([t.Component({selector:"c8y-dashboard-child-action",template:"<ng-template #template>\n <li>\n <ng-content></ng-content>\n </li>\n</ng-template>\n"})],e)}(),rh=function(){function e(){}return e=jc([t.Component({selector:"c8y-dashboard-child-title",template:'<div class="card-title">\n <ng-content></ng-content>\n</div>\n'})],e)}(),lh=function(){function e(e,n){this.element=e,this.sanitizer=n,this.columns=12,this.gap=12,this.rows="auto",this.dashboardChange=new t.EventEmitter,this.lastRow=1,this.DEFAULT_ROW_SIZE=68}return Object.defineProperty(e.prototype,"columnSize",{get:function(){return this.dashboardRect.width/this.columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSize",{get:function(){return"auto"===this.rows?this.DEFAULT_ROW_SIZE:this.calculateRowSize()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inlineStyle",{get:function(){return this.sanitizer.bypassSecurityTrustStyle("\n -ms-grid-columns: (1fr)["+this.columns+"];\n grid-template-columns: repeat("+this.columns+", 1fr);\n "+("auto"!==this.rows?"grid-template-rows: repeat("+this.rows+", 1fr);":"")+"\n grid-auto-rows: "+(this.rowSize+this.gap)+"px;\n -ms-grid-rows: ("+(this.rowSize+this.gap)+"px)["+("auto"===this.rows?this.lastRow:this.rows)+"];\n margin: -"+this.gap+"px;\n ")},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this.onResize(),this.getLastRow()},e.prototype.onResize=function(){this.updateRectSize()},e.prototype.getLastRow=function(){var e=1;this.children.forEach((function(t){e<t.y+t.width&&(e=t.y+t.width)})),this.lastRow=e+1},e.prototype.updateRectSize=function(){var e=this.element.nativeElement;this.dashboardRect=e.getBoundingClientRect()},e.prototype.emitChange=function(e){this.dashboardChange.emit({source:e,children:this.children.toArray()})},e.prototype.calculateRowSize=function(){return this.dashboardRect.height/this.rows},e.ctorParameters=function(){return[{type:t.ElementRef},{type:pc.DomSanitizer}]},jc([t.ContentChildren(t.forwardRef((function(){return ch})))],e.prototype,"children",void 0),jc([t.Input()],e.prototype,"columns",void 0),jc([t.Input()],e.prototype,"gap",void 0),jc([t.Input()],e.prototype,"rows",void 0),jc([t.Output()],e.prototype,"dashboardChange",void 0),jc([t.HostBinding("attr.style")],e.prototype,"inlineStyle",null),jc([t.HostListener("window:resize")],e.prototype,"onResize",null),e=jc([t.Component({selector:"c8y-dashboard",template:"<ng-content></ng-content>\n",host:{class:"c8y-grid-dashboard dashboard-grid"},changeDetection:t.ChangeDetectionStrategy.OnPush})],e)}(),ih=function(){function e(e){this.MIN_WIDTH=2,this.MIN_HEIGHT=1,this.PIXEL_SIZE_THRESHOLD=10,this.diffX=0,this.diffY=0,this.dashboard=e.dashboard,this.children=e.dashboard.children?e.dashboard.children.filter((function(t){return e!==t})):[],this.child=e}return Object.defineProperty(e.prototype,"resize$",{get:function(){var e=this;return this.child.dragSource.moved.pipe(o.map((function(t){return e.getPixelSize(t)})),o.tap((function(t){return e.setPixelSize(t)})),o.map((function(t){return e.getDimensionSize(t)})),o.distinctUntilChanged((function(e,t){return e.width===t.width&&e.height===t.height})),o.map((function(t){return e.setDimension(t)})),this.arrangePipe())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drag$",{get:function(){var e=this;return this.child.dragSource.moved.pipe(o.map((function(t){return e.getDimensionPosition(t)})),o.filter((function(t){return t.x>=0&&t.x<=e.dashboard.columns-e.child.width&&t.y>=0})),o.distinctUntilChanged((function(e,t){return e.x===t.x&&e.y===t.y})),this.arrangePipe())},enumerable:!0,configurable:!0}),e.prototype.findFreeDimension=function(){var e=-1,t=0,n=!1,a=this.child,o=a.width,s=a.height;if(o>this.dashboard.columns)throw new Error("The child does not fit on the current dashboard.");do{for(t=0,e++;t+o<=this.dashboard.columns;){if(0===this.getCollided({x:t,y:e,width:o,height:s}).length){n=!0;break}t++}}while(!n);return{x:t,y:e,width:o,height:s}},e.prototype.collapseUpAll=function(){return s.sortBy(Oc([this.child],this.children),["y"]).forEach((function(t){var n=new e(t),a=n.collapseUp(t);n.setDimension(a)}))},e.prototype.arrangeAll=function(t){var n=t.current,a=t.scan,o=t.spacing,r=t.origin;return this.getCollided(n,s.sortBy(a,["y"])).map((function(t){return new e(t).setDimension(bc({},t,{y:o})),{current:t,scan:a.filter((function(e){return e!==t})),spacing:t.y+t.height,origin:r}}))},e.prototype.arrangePipe=function(){var e=this;return a.pipe(o.map((function(t){return{current:t,scan:e.children,spacing:t.y+t.height,origin:bc({},t)}})),o.expand((function(t){return e.arrangeAll(t)})),o.map((function(e){return e.origin})),o.map((function(t){return e.setDimension(t,!0)})),o.tap((function(){return e.collapseUpAll()})),o.tap((function(){return e.dashboard.getLastRow()})))},e.prototype.collapseUp=function(e){for(var t=e.y;t>0&&0===this.getCollided(bc({},e,{y:t-1})).length;)t--;return bc({},e,{y:t})},e.prototype.setDimension=function(e,t){if(void 0===t&&(t=!1),!(t&&this.getCollided(e).length>0))return this.child.x=e.x,this.child.y=e.y,e.width>=this.MIN_WIDTH&&e.x+e.width<=this.dashboard.columns?this.child.width=e.width:e.width<this.MIN_WIDTH?e.width=this.MIN_WIDTH:e.width=this.dashboard.columns-e.x,e.height>=this.MIN_HEIGHT?this.child.height=e.height:e.height=this.MIN_WIDTH,e},e.prototype.setPixelSize=function(e){var t=e.width,n=e.height;t>=this.dashboard.columnSize*this.MIN_WIDTH-this.dashboard.gap&&(this.child.pxWidth=t+this.PIXEL_SIZE_THRESHOLD),n>=this.dashboard.rowSize*this.MIN_HEIGHT-this.dashboard.gap&&(this.child.pxHeight=n+this.PIXEL_SIZE_THRESHOLD)},e.prototype.getPixelSize=function(e){var t=e.source.element.nativeElement.parentNode;if(!this.diffX){var n=t.getBoundingClientRect();this.diffX=n.left,this.diffY=n.top}var a=e.pointerPosition,o=a.x,s=a.y;return{width:Math.round(o-this.diffX),height:Math.round(s-this.diffY),pointer:{x:o,y:s}}},e.prototype.getDimensionSize=function(e){var t=this.child,n=t.x,a=t.y,o=this.dashboard.dashboardRect,s=this.dashboard.columnSize,r=this.dashboard.rowSize+this.dashboard.gap;return{x:n,y:a,width:Math.round((e.pointer.x-o.left+this.dashboard.gap)/s)-n,height:Math.round((e.pointer.y-o.top+this.dashboard.gap)/r)-a}},e.prototype.getDimensionPosition=function(e){var t=e.source.element.nativeElement.nextElementSibling;if(!this.diffX){var n=t.getBoundingClientRect();this.diffX=e.pointerPosition.x-n.left,this.diffY=e.pointerPosition.y-n.top}var a=e.pointerPosition.x-this.diffX,o=e.pointerPosition.y-this.diffY,s=this.child,r=s.width,l=s.height,i=this.dashboard.dashboardRect,c=this.dashboard.columnSize,u=this.dashboard.rowSize+this.dashboard.gap/2;return{x:Math.round((a-i.left)/c),y:Math.round((o-i.top)/u),width:r,height:l}},e.prototype.doesCollide=function(e,t){return void 0!==t.x&&!(e.y+e.height-1<t.y||e.y>t.y+t.height-1||e.x+e.width-1<t.x||e.x>t.x+t.width-1)},e.prototype.getCollided=function(e,t){var n=this;return void 0===t&&(t=this.children),t.filter((function(t){return n.doesCollide(e,t)}))},e}(),ch=function(){function e(e,n,a){this.dashboard=e,this.sanitizer=n,this.element=a,this.actions=[],this.isResize=!1,this.isDragging=!1,this.klasses={},this._pxWidth="100%",this._pxHeight="100%",this.width=1,this.height=1,this.margin=12,this.isFrozen=!1,this.useIntersection=!1,this.changeStart=new t.EventEmitter,this.changeEnd=new t.EventEmitter,this.class={},this.intersected=!1}return Object.defineProperty(e.prototype,"pxWidth",{set:function(e){this._pxWidth=e+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pxHeight",{set:function(e){this._pxHeight=e+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inlineStyle",{get:function(){return this.sanitizer.bypassSecurityTrustStyle("\n grid-column-start: "+(this.x+1)+";\n -ms-grid-column: "+(this.x+1)+";\n grid-row-start: "+(this.y+1)+";\n -ms-grid-row: "+(this.y+1)+";\n grid-column-end: span "+this.width+";\n -ms-grid-column-span: "+this.width+";\n grid-row-end: span "+this.height+";\n -ms-grid-row-span: "+this.height+";\n display: block;\n margin: "+(this.margin||12)+"px;\n order: "+this.getOrder()+";\n ")},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){this.klasses=bc({card:!0,"card-dashboard":!0,disabled:this.isFrozen,"on-resize":this.isResize},this.class)},e.prototype.ngOnInit=function(){var e=this;if(void 0!==this.x&&void 0!==this.y||setTimeout((function(){return e.setDynamicDimension()})),this.useIntersection&&"IntersectionObserver"in window){var t=new IntersectionObserver((function(n){return e.intersected=e.childInView(n[0],t)}));t.observe(this.element.nativeElement)}else this.intersected=!0},e.prototype.setDynamicDimension=function(){var e=new ih(this).findFreeDimension(),t=e.x,n=e.y;this.x=t,this.y=n,this.dashboard.emitChange(this)},e.prototype.resizeStarted=function(e){this.isResize=!0,this.dashboard.updateRectSize(),this.dragSource=e.source;var t=new ih(this);this.changeSubscription=t.resize$.subscribe(),this.changeStart.emit(this),this.ngOnChanges()},e.prototype.dragStarted=function(e){this.isDragging=!0,this.dashboard.updateRectSize(),this.dragSource=e.source;var t=new ih(this);this.changeSubscription=t.drag$.subscribe(),this.changeStart.emit(this)},e.prototype.reset=function(e){this.isResize=!1,this.isDragging=!1,this._pxWidth="100%",this._pxHeight="100%",this.ngOnChanges(),e&&e.source.reset(),this.changeSubscription&&(this.changeSubscription.unsubscribe(),this.dashboard.emitChange(this),this.changeEnd.emit(this))},e.prototype.getOrder=function(){return""+Math.round(100*(this.y+(this.x+1)/100))},e.prototype.childInView=function(e,t){return!!e.isIntersecting&&(t.unobserve(e.target),!0)},e.ctorParameters=function(){return[{type:lh,decorators:[{type:t.Inject,args:[t.forwardRef((function(){return lh}))]}]},{type:pc.DomSanitizer},{type:t.ElementRef}]},jc([t.ContentChildren(sh)],e.prototype,"actions",void 0),jc([t.Input()],e.prototype,"x",void 0),jc([t.Input()],e.prototype,"y",void 0),jc([t.Input()],e.prototype,"width",void 0),jc([t.Input()],e.prototype,"height",void 0),jc([t.Input()],e.prototype,"data",void 0),jc([t.Input()],e.prototype,"margin",void 0),jc([t.Input()],e.prototype,"isFrozen",void 0),jc([t.Input()],e.prototype,"useIntersection",void 0),jc([t.Output()],e.prototype,"changeStart",void 0),jc([t.Output()],e.prototype,"changeEnd",void 0),jc([t.Input()],e.prototype,"class",void 0),jc([t.HostBinding("attr.style")],e.prototype,"inlineStyle",null),e=jc([t.Component({selector:"c8y-dashboard-child",template:'<div cdkDropList>\n <div *ngIf="isResize" class="card-placeholder"></div>\n <div\n [ngClass]="klasses"\n cdkDrag\n [ngStyle]="{ width: _pxWidth, height: _pxHeight }"\n (cdkDragStarted)="dragStarted($event)"\n (cdkDragEnded)="reset($event)"\n [cdkDragDisabled]="isFrozen"\n >\n <div\n class="card-header-actions card-header-grid"\n [ngClass]="{ \'drag-handle\': !isFrozen, draggableCursor: !isFrozen }"\n cdkDragHandle\n >\n <ng-content select="c8y-dashboard-child-title"></ng-content>\n <div class="header-actions" *ngIf="!isFrozen && actions.length > 0">\n <div class="optionsBtn dropdown" dropdown container="body">\n <a\n title="{{ \'Settings\' | translate }}"\n href=""\n class="btnIcon c8y-dropdown"\n (click)="(false)"\n dropdownToggle\n >\n <i [c8yIcon]="\'cog\'"></i>\n </a>\n <ul\n class="dropdown-menu dropdown-menu-right"\n style="right: -41px;top: 3px;"\n *dropdownMenu\n >\n <ng-container *ngFor="let action of actions">\n <ng-container *ngTemplateOutlet="action.template"></ng-container>\n </ng-container>\n </ul>\n </div>\n </div>\n </div>\n <div class="card-inner-scroll">\n <ng-content></ng-content>\n </div>\n <div\n *ngIf="!isFrozen && !isDragging"\n class="resize-handle"\n cdkDrag\n [cdkDragDisabled]="isFrozen"\n (cdkDragStarted)="resizeStarted($event)"\n (cdkDragEnded)="reset($event)"\n ></div>\n <div class="resize-icon" *ngIf="!isFrozen && !isDragging"></div>\n\n <div *cdkDragPlaceholder class="card-placeholder"></div>\n </div>\n</div>\n',host:{class:"dashboard-grid-child"}}),wc(0,t.Inject(t.forwardRef((function(){return lh}))))],e)}(),uh=function(){function e(){this.settings={isFrozen:!1,isDisabled:!1,widgetMargin:12,translateWidgetTitle:!1,defaultHeight:4,defaultWidth:4,allowFullscreen:!1,canDelete:!0,isLoading:!1},this.onAddWidget=new t.EventEmitter,this.onEditWidget=new t.EventEmitter,this.onDeleteWidget=new t.EventEmitter,this.onChangeDashboard=new t.EventEmitter,this.onEditDashboard=new t.EventEmitter,this.onDeleteDashboard=new t.EventEmitter,this.onFreeze=new t.EventEmitter,this.onChangeStart=new t.EventEmitter,this.onChangeEnd=new t.EventEmitter}return Object.defineProperty(e.prototype,"_settings",{set:function(e){this.settings=bc({},this.settings,e)},enumerable:!0,configurable:!0}),e.prototype.toggleFullscreen=function(){var e=document.body,t=document;this.fullScreen()?t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.webkitExitFullscreen&&t.webkitExitFullscreen():e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)},e.prototype.fullScreen=function(){var e=document;return!!(e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement)},jc([t.Input()],e.prototype,"widgets",void 0),jc([t.Input()],e.prototype,"context",void 0),jc([t.Input()],e.prototype,"contextDashboard",void 0),jc([t.Input("settings")],e.prototype,"_settings",null),jc([t.Input()],e.prototype,"breadcrumb",void 0),jc([t.Output()],e.prototype,"onAddWidget",void 0),jc([t.Output()],e.prototype,"onEditWidget",void 0),jc([t.Output()],e.prototype,"onDeleteWidget",void 0),jc([t.Output()],e.prototype,"onChangeDashboard",void 0),jc([t.Output()],e.prototype,"onEditDashboard",void 0),jc([t.Output()],e.prototype,"onDeleteDashboard",void 0),jc([t.Output()],e.prototype,"onFreeze",void 0),jc([t.Output()],e.prototype,"onChangeStart",void 0),jc([t.Output()],e.prototype,"onChangeEnd",void 0),e=jc([t.Component({selector:"c8y-widgets-dashboard",template:'<c8y-title *ngIf="!!settings.title">\n {{ settings.title | translate }}\n</c8y-title>\n\n<c8y-breadcrumb *ngIf="!!breadcrumb">\n <c8y-breadcrumb-item\n [icon]="breadcrumb.icon"\n [label]="breadcrumb.label"\n [path]="breadcrumb.path"\n ></c8y-breadcrumb-item>\n</c8y-breadcrumb>\n\n<c8y-action-bar-item [placement]="\'right\'" *ngIf="onAddWidget.observers.length">\n <button\n class="btn btn-link"\n [disabled]="settings.isFrozen || settings.isDisabled"\n (click)="onAddWidget.emit()"\n >\n <i c8yIcon="plus-circle"></i> {{ \'Add widget\' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]="\'right\'" *ngIf="onEditDashboard.observers.length">\n <button\n class="btn btn-link"\n [disabled]="settings.isFrozen || settings.isDisabled"\n (click)="onEditDashboard.emit()"\n >\n <i c8yIcon="pencil"></i> {{ \'Edit\' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item [placement]="\'right\'" *ngIf="settings.allowFullscreen">\n <button class="btn btn-link" (click)="toggleFullscreen()">\n <i [c8yIcon]="fullScreen() ? \'compress\' : \'expand\'"></i> {{ \'Full screen\' | translate }}\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]="\'right\'"\n itemClass="navbar-form"\n *ngIf="onFreeze.observers.length"\n>\n <button\n title="{{ \'Lock/unlock this dashboard\' | translate }}"\n class="btn btn-default"\n [ngClass]="{ active: settings.isFrozen }"\n (click)="onFreeze.emit(settings)"\n [disabled]="settings.isDisabled"\n uib-btn-checkbox\n >\n <i [c8yIcon]="settings.isFrozen ? \'lock\' : \'unlock\'"></i>\n </button>\n</c8y-action-bar-item>\n\n<c8y-action-bar-item\n [placement]="\'more\'"\n [priority]="-3000"\n *ngIf="settings.canDelete && onDeleteDashboard.observers.length"\n>\n <button (click)="onDeleteDashboard.emit()" [disabled]="settings.isFrozen || settings.isDisabled">\n <i c8yIcon="trash"></i>&nbsp;<span translate>Delete dashboard</span>\n </button>\n</c8y-action-bar-item>\n\n\x3c!-- empty state --\x3e\n<div class="c8y-empty-state text-center" *ngIf="!settings.isLoading && widgets.length === 0">\n <h1 class="c8y-icon c8y-icon-device c8y-icon-duocolor"></h1>\n <h3 translate>No widgets to display.</h3>\n <div *ngIf="!settings.isFrozen && onAddWidget.observers.length">\n <p translate>Add widgets to this dashboard.</p>\n <div>\n <button\n [disabled]="settings.isFrozen || settings.isDisabled"\n (click)="onAddWidget.emit()"\n class="btn btn-primary"\n translate\n >\n Add widget\n </button>\n </div>\n <p c8y-guide-docs>\n <small translate ngNonBindable\n >Find out more in the\n <a c8y-guide-href="users-guide/cockpit/#dashboards">User guide`KEEP_ORIGINAL`</a>.</small\n >\n </p>\n </div>\n</div>\n\x3c!-- /.empty settings --\x3e\n\n<div class="col-xs-12 text-center" *ngIf="settings.isLoading">\n <div class="spinner p-relative">\n <div class="rect1"></div>\n <div class="rect2"></div>\n <div class="rect3"></div>\n <div class="rect4"></div>\n <div class="rect5"></div>\n </div>\n</div>\n\n<c8y-dashboard\n (dashboardChange)="onChangeDashboard.emit($event)"\n #dashboard\n *ngIf="!settings.isLoading"\n>\n <c8y-dashboard-child\n *ngFor="let widget of widgets"\n [x]="widget._x"\n [y]="widget._y"\n [width]="widget._width || settings.defaultWidth"\n [height]="widget._height || settings.defaultHeight"\n [margin]="settings.widgetMargin"\n [isFrozen]="settings.isFrozen || settings.isDisabled"\n [class]="widget.classes"\n [data]="widget"\n [useIntersection]="true"\n (changeStart)="onChangeStart.emit({ widget: widget, source: child, dashboard: dashboard })"\n (changeEnd)="onChangeEnd.emit({ widget: widget, source: child, dashboard: dashboard })"\n #child\n >\n <c8y-dashboard-child-title>\n <span *ngIf="settings.translateWidgetTitle"> {{ widget.title | translate }}</span>\n <span *ngIf="!settings.translateWidgetTitle">\n {{ widget.title }}\n </span>\n </c8y-dashboard-child-title>\n <c8y-dashboard-child-action *ngIf="onEditWidget.observers.length">\n <button (click)="onEditWidget.emit({ widget: widget, source: child, dashboard: dashboard })">\n <i c8yIcon="pencil"></i>&nbsp;<span translate>Edit</span>\n </button>\n </c8y-dashboard-child-action>\n <c8y-dashboard-child-action *ngIf="onDeleteWidget.observers.length">\n <button\n (click)="onDeleteWidget.emit({ widget: widget, source: child, dashboard: dashboard })"\n >\n <i c8yIcon="trash"></i>&nbsp;<span translate>Remove</span>\n </button>\n </c8y-dashboard-child-action>\n <c8y-dynamic-component\n [componentId]="widget.componentId || widget.name"\n [config]="\n widget.templateUrl || widget.widgetComponent\n ? { child: widget, dashboard: contextDashboard, context: context }\n : widget.config\n "\n *ngIf="child.intersected"\n ></c8y-dynamic-component>\n </c8y-dashboard-child>\n</c8y-dashboard>\n',host:{style:"\n display: block;\n ",class:"dashboard c8y-grid-dashboard"}})],e)}(),dh=function(){function e(){}return e=jc([t.NgModule({declarations:[ch,lh,rh,sh,uh],imports:[Uu,Gu,oh,dc.DragDropModule,l.BsDropdownModule.forRoot(),Mp,Nm,hd],exports:[lh,ch,rh,sh,uh]})],e)}(),ph=function(){function e(e){this.templateRef=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},jc([t.Input("c8yStepperIcon")],e.prototype,"name",void 0),e=jc([t.Directive({selector:"ng-template[c8yStepperIcon]"})],e)}(),mh=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.disableDefaultIcons={edit:!0,done:!0},n.onStepChange=new t.EventEmitter,n._iconOverrides={},n._stepIndex=new a.Subject,n}var o;return vc(n,e),o=n,n.prototype.ngAfterContentInit=function(){var e=this;this._icons.forEach((function(t){var n=t.name,a=t.templateRef;return e._iconOverrides[n]=a})),this._stepIndexSubscription=this._stepIndex.subscribe((function(t){return e.onStepChange.emit(t)}))},n.prototype.ngOnDestroy=function(){this._stepIndexSubscription&&!this._stepIndexSubscription.closed&&this._stepIndexSubscription.unsubscribe()},n.prototype.getIndicatorType=function(e,t){var n=t;switch(this._getIndicatorType(e,t)){case mc.STEP_STATE.EDIT:this.disableDefaultIcons.edit||(n=mc.STEP_STATE.EDIT);break;case mc.STEP_STATE.DONE:n=this.disableDefaultIcons.done?"_done":mc.STEP_STATE.DONE}return n},n.prototype.setIndex=function(e){this._stepIndex.next(e)},jc([t.Input()],n.prototype,"disableDefaultIcons",void 0),jc([t.Input()],n.prototype,"customClasses",void 0),jc([t.Output()],n.prototype,"onStepChange",void 0),jc([t.ContentChildren(ph,{descendants:!0})],n.prototype,"_icons",void 0),n=o=jc([t.Component({selector:"c8y-stepper",template:'<ul class="c8y-stepper" [ngClass]="customClasses">\n <li *ngFor="let step of steps; let i = index">\n <c8y-stepper-progress\n [iconOverrides]="_iconOverrides"\n [state]="getIndicatorType(i, step.state)"\n [index]="i"\n [selected]="selectedIndex === i"\n (onStepClicked)="setIndex($event)"\n title="{{ step.label | translate }}"\n [ngClass]="{\'active\': selectedIndex === i}"\n >\n </c8y-stepper-progress>\n <div class="c8y-step__label" title="{{ step.label | translate }}">\n {{ step.label | translate }}\n </div>\n </li>\n</ul>\n<ng-container [ngTemplateOutlet]="selected.content"></ng-container>\n',providers:[{provide:mc.CdkStepper,useExisting:o}]})],n)}(mc.CdkStepper),hh=function(){function e(){this.onStepClicked=new t.EventEmitter}return e.prototype.stepSelected=function(){this.onStepClicked.emit(this.index)},jc([t.Input()],e.prototype,"iconOverrides",void 0),jc([t.Input()],e.prototype,"index",void 0),jc([t.Input()],e.prototype,"selected",void 0),jc([t.Input()],e.prototype,"state",void 0),jc([t.Output()],e.prototype,"onStepClicked",void 0),e=jc([t.Component({selector:"c8y-stepper-progress",template:'<button\n type="button"\n class="c8y-step"\n [ngClass]="{ active: selected, \'step-done\': state === \'done\' || state === \'_done\' }"\n [ngSwitch]="!!(iconOverrides && iconOverrides[state])"\n (click)="stepSelected()"\n>\n <ng-container *ngSwitchCase="true" [ngTemplateOutlet]="iconOverrides[state]"></ng-container>\n <ng-container *ngSwitchDefault [ngSwitch]="state">\n <span *ngSwitchCase="\'edit\'">\n <span [c8yIcon]="\'edit\'"></span>\n </span>\n <span *ngSwitchCase="\'done\'">\n <span [c8yIcon]="\'check\'"></span>\n </span>\n <span *ngSwitchDefault> {{ index + 1 }} </span>\n </ng-container>\n</button>\n'})],e)}(),fh=function(){function e(e,n){this.stepper=e,this.step=n,this.pending=!1,this.disabled=!1,this.onCancel=new t.EventEmitter,this.onNext=new t.EventEmitter,this.onBack=new t.EventEmitter,this.onCustom=new t.EventEmitter,this.showBtns={cancel:!1,back:!1,next:!1,custom:!1}}return e.prototype.ngAfterContentInit=function(){var e=this;this.showBtns.cancel=this.onCancel.observers.length>0,this.showBtns.custom=this.onCustom.observers.length>0,this.stepper&&this.stepper.steps&&this.step&&(this.showBtns.back=this.stepper.steps.first!==this.step,this.showBtns.next=this.stepper.steps.last!==this.step),this.step&&this.step.stepControl&&(this.disabled=this.step.stepControl.invalid,this.statusChangeSubscription=this.step.stepControl.statusChanges.subscribe((function(t){e.disabled=e.step.stepControl.invalid})))},e.prototype.ngOnChanges=function(e){e&&e.pending&&(this.disabled=e.pending.currentValue)},e.prototype.ngOnDestroy=function(){this.statusChangeSubscription&&!this.statusChangeSubscription.closed&&this.statusChangeSubscription.unsubscribe()},e.prototype.cancel=function(){this.onCancel.emit()},e.prototype.next=function(){this.onNext.observers.length>0?this.onNext.emit({stepper:this.stepper,step:this.step}):this.stepper.next()},e.prototype.back=function(){this.stepper.selected.completed=!1,this.onBack.observers.length>0?this.onBack.emit({stepper:this.stepper,step:this.step}):this.stepper.previous()},e.prototype.custom=function(){this.onCustom.emit()},e.ctorParameters=function(){return[{type:mh,decorators:[{type:t.Host}]},{type:mc.CdkStep,decorators:[{type:t.Host}]}]},jc([t.Input()],e.prototype,"labels",void 0),jc([t.Input()],e.prototype,"pending",void 0),jc([t.Input()],e.prototype,"disabled",void 0),jc([t.Output()],e.prototype,"onCancel",void 0),jc([t.Output()],e.prototype,"onNext",void 0),jc([t.Output()],e.prototype,"onBack",void 0),jc([t.Output()],e.prototype,"onCustom",void 0),e=jc([t.Component({selector:"c8y-stepper-buttons",template:'<div class="text-center">\n <button *ngIf="showBtns.cancel" (click)="cancel()" type="button" class="btn btn-default">\n <span *ngIf="labels?.cancel; else cancelLabel" title="{{ labels?.cancel | translate }}">{{\n labels?.cancel | translate\n }}</span>\n <ng-template #cancelLabel>\n <span title="{{ \'Cancel\' | translate }}">{{ \'Cancel\' | translate }}</span>\n </ng-template>\n </button>\n <button\n *ngIf="showBtns.back"\n type="button"\n (click)="back()"\n class="btn btn-default"\n [disabled]="pending"\n >\n <span *ngIf="labels?.back; else backLabel" title="{{ labels?.back | translate }}">{{\n labels?.back | translate\n }}</span>\n <ng-template #backLabel>\n <span title="{{ \'Back\' | translate }}">{{ \'Back\' | translate }}</span>\n </ng-template>\n </button>\n <button\n *ngIf="showBtns.custom"\n (click)="custom()"\n type="button"\n class="btn"\n [ngClass]="{\n \'btn-default\': showBtns.next,\n \'btn-primary\': !showBtns.next,\n \'btn-pending\': pending\n }"\n [disabled]="pending || disabled"\n >\n <span *ngIf="labels?.custom; else customLabel" title="{{ labels?.custom | translate }}">{{\n labels?.custom | translate\n }}</span>\n <ng-template #customLabel>\n <span title="{{ \'Complete\' | translate }}">{{ \'Complete\' | translate }}</span>\n </ng-template>\n </button>\n <button\n (click)="next()"\n *ngIf="showBtns.next"\n type="button"\n class="btn btn-primary"\n [ngClass]="{ \'btn-pending\': pending }"\n [disabled]="disabled"\n >\n <span *ngIf="labels?.next; else nextLabel" title="{{ labels?.next | translate }}">{{\n labels?.next | translate\n }}</span>\n <ng-template #nextLabel>\n <span title="{{ \'Next\' | translate }}">{{ \'Next\' | translate }}</span>\n </ng-template>\n </button>\n</div>\n'}),wc(0,t.Host()),wc(1,t.Host())],e)}(),gh={displayDefaultIndicatorType:!1},yh=function(){function e(){}return e=jc([t.NgModule({imports:[Uu,mc.CdkStepperModule,u.TooltipModule],declarations:[mh,ph,hh,fh],exports:[mh,mc.CdkStep,ph,fh],providers:[{provide:mc.STEPPER_GLOBAL_OPTIONS,useValue:gh}]})],e)}(),vh=function(){function e(){this.click=new t.EventEmitter}return jc([t.ViewChild("template",{static:!1})],e.prototype,"template",void 0),jc([t.Input()],e.prototype,"label",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.Output()],e.prototype,"click",void 0),e=jc([t.Component({selector:"c8y-list-item-action, c8y-li-action",template:'<ng-template #template>\n <li>\n <button title="{{ label | translate }}" (click)="click.emit($event)">\n <i [c8yIcon]="icon" *ngIf="icon"></i>&nbsp;\n <span *ngIf="label">{{ label | translate }}</span>\n <ng-content></ng-content>\n </button>\n </li>\n</ng-template>\n'})],e)}(),bh=function(){function e(){this.collapseWay="button"}return jc([t.Input()],e.prototype,"collapseWay",void 0),e=jc([t.Component({selector:"c8y-list-item-collapse, c8y-li-collapse",template:"<ng-content></ng-content>\n"})],e)}(),jh=function(){function e(){}return jc([t.Input()],e.prototype,"footer",void 0),e=jc([t.Component({selector:"c8y-list-item-footer, c8y-li-footer",template:'<span *ngIf="footer">{{footer}}</span>\n<ng-content></ng-content>\n'})],e)}(),wh=function(){function e(e){this.element=e,this.active=!1,this.collapsed=!0,this.selectable=!0,this.collapsedChange=new t.EventEmitter,this.showFooter=!1,this.showActions=!1,this.showCollapse=!1,this.dropdownUp=!1,this.pulse$=new a.Subject,this.destroy$=new a.Subject,this.ACTION_ITEM_HEIGHT=40}return e.prototype.ngOnInit=function(){var e=this;this.pulse$.pipe(o.filter((function(e){return!!e})),o.tap((function(){return e.element.nativeElement.classList.remove("c8y-list--pulse")})),o.delay(100),o.tap((function(){return e.element.nativeElement.classList.add("c8y-list--pulse")})),o.takeUntil(this.destroy$)).subscribe()},e.prototype.ngAfterContentChecked=function(){this.actions=this.itemActions.toArray(),this.showFooter=null!=this.itemFooter,this.showActions=this.itemActions.length>0,this.showCollapse=null!=this.itemCollapse},e.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},e.prototype.showDropdownUp=function(){var e=this.element.nativeElement.getBoundingClientRect().top+(1+this.itemActions.length)*this.ACTION_ITEM_HEIGHT<=window.innerHeight;this.dropdownUp=!e},e.prototype.toggleCollapsed=function(e){e&&e.stopPropagation(),this.collapsed=!this.collapsed,this.collapsedChange.emit(this.collapsed)},e.prototype.pulse=function(){this.pulse$.next(!0)},e.ctorParameters=function(){return[{type:t.ElementRef}]},jc([t.Input(),t.HostBinding("class.active")],e.prototype,"active",void 0),jc([t.Input()],e.prototype,"collapsed",void 0),jc([t.Input()],e.prototype,"selectable",void 0),jc([t.Output()],e.prototype,"collapsedChange",void 0),jc([t.ContentChild(jh,{static:!1})],e.prototype,"itemFooter",void 0),jc([t.ContentChildren(vh)],e.prototype,"itemActions",void 0),jc([t.ContentChild(bh,{static:!1})],e.prototype,"itemCollapse",void 0),e=jc([t.Component({selector:"c8y-list-item, c8y-li",template:'<div [ngClass]="{ \'expanded\': !collapsed, interact: (itemCollapse && itemCollapse.collapseWay === \'row\')}">\n <div class="c8y-list__item__block">\n <ng-content select="c8y-list-item-radio, c8y-li-radio"></ng-content>\n <ng-content select="c8y-list-item-checkbox, c8y-li-checkbox"></ng-content>\n\n <ng-content select="c8y-list-item-icon, c8y-li-icon"></ng-content>\n\n <div class="c8y-list__item__body text-truncate-wrap" (click)="(itemCollapse && itemCollapse.collapseWay === \'row\') && toggleCollapsed()">\n <ng-content select="c8y-list-item-body, c8y-li-body"></ng-content>\n <ng-content></ng-content>\n <div class="c8y-list__item__footer" *ngIf="showFooter">\n <ng-content select="c8y-list-item-footer, c8y-li-footer"></ng-content>\n </div>\n </div>\n\n <div class="c8y-list__item__actions" *ngIf="(showCollapse && (itemCollapse && itemCollapse.collapseWay === \'button\')) || showActions">\n <button\n class="collapse-btn"\n title="{{ \'Expand\' | translate }}"\n type="button"\n (click)="toggleCollapsed($event)"\n [attr.aria-expanded]="!collapsed"\n *ngIf="showCollapse && itemCollapse.collapseWay === \'button\'"\n >\n <i [c8yIcon]="\'chevron-down\'"></i>\n </button>\n <div\n class="dropdown"\n dropdown\n [dropup]="dropdownUp"\n *ngIf="showActions"\n (onShown)="showDropdownUp()"\n >\n <button\n class="dropdown-toggle c8y-dropdown"\n dropdownToggle\n title="{{ \'Actions\' | translate }}"\n type="button"\n aria-haspopup="true"\n >\n <i [c8yIcon]="\'ellipsis-v\'"></i>\n </button>\n <ul class="dropdown-menu dropdown-menu-right" *dropdownMenu>\n <ng-content select="c8y-list-item-action, c8y-li-action"></ng-content>\n <ng-container *ngFor="let action of actions">\n <ng-container *ngTemplateOutlet="action.template"></ng-container>\n </ng-container>\n </ul>\n </div>\n\n <ng-content select="c8y-list-item-action, c8y-li-action" *ngIf="showActions"></ng-content>\n </div>\n </div>\n\n <div *ngIf="showCollapse" [collapse]="collapsed" [isAnimated]="true">\n <div class="c8y-list__item__collapse--container">\n <ng-content select="c8y-list-item-collapse, c8y-li-collapse"></ng-content>\n </div>\n </div>\n</div>\n',host:{class:"c8y-list__item"}})],e)}(),Sh=function(){function e(){}return jc([t.Input()],e.prototype,"body",void 0),e=jc([t.Component({selector:"c8y-list-item-body, c8y-li-body",template:'<span *ngIf="body">{{body}}</span>\n<ng-content></ng-content>\n'})],e)}(),Ch=function(){function e(){this.selected=!1,this.name="list_item_radio",this.disabled=!1,this.onSelect=new t.EventEmitter}var n;return n=e,e.prototype.reset=function(){this.radio.nativeElement.checked=!1},e.prototype.ngOnChanges=function(e){e.selected&&!e.selected.firstChange&&this.onSelect.emit(e.selected.currentValue)},e.prototype.change=function(e){this.onSelect.emit(e),this.model=this.value,this.onChange&&this.onChange(this.model),this.onTouched&&this.onTouched()},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.writeValue=function(e){this.model=e},jc([t.ViewChild("radio",{static:!0})],e.prototype,"radio",void 0),jc([t.Input()],e.prototype,"selected",void 0),jc([t.Input()],e.prototype,"name",void 0),jc([t.Input()],e.prototype,"disabled",void 0),jc([t.Output()],e.prototype,"onSelect",void 0),jc([t.Input()],e.prototype,"value",void 0),e=n=jc([t.Component({selector:"c8y-list-item-radio, c8y-li-radio",template:'<label class="c8y-radio">\n <input\n #radio\n type="radio"\n [name]="name"\n [checked]="selected"\n (change)="change($event.target.checked); (false)"\n [disabled]="disabled"\n />\n <span></span>\n</label>\n<ng-content></ng-content>\n',host:{class:"c8y-list__item__radio"},providers:[{provide:nc.NG_VALUE_ACCESSOR,multi:!0,useExisting:t.forwardRef((function(){return n}))}]})],e)}(),Ih=function(){function e(){}return e=jc([t.Component({selector:"c8y-list-item-timeline, c8y-li-timeline",template:'<small class="c8y-list--timeline__item__date">\n <ng-content></ng-content>\n</small>\n<ng-content select="c8y-li, c8y-list-item"></ng-content>\n',host:{class:"c8y-list--timeline__item"}})],e)}(),Ph=function(){function e(){this.timeline=!1}return e.prototype.ngAfterContentChecked=function(){this.timeline=!!this.timelineComponent},jc([t.HostBinding("class.c8y-list--timeline")],e.prototype,"timeline",void 0),jc([t.ContentChild(Ih,{static:!1})],e.prototype,"timelineComponent",void 0),e=jc([t.Component({selector:"c8y-list-group",template:"<ng-content></ng-content>\n\n",host:{class:"c8y-list__group"}})],e)}(),Oh=function(){function e(){}return jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"status",void 0),e=jc([t.Component({selector:"c8y-list-item-icon, c8y-li-icon",template:'<i [c8yIcon]="icon" [ngClass]="status" *ngIf="icon"></i>\n<ng-content></ng-content>',host:{class:"c8y-list__item__icon"}})],e)}(),xh=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.selected=!1,n.disabled=!1,n.onSelect=new t.EventEmitter,n}var a;return vc(n,e),a=n,n.prototype.ngOnChanges=function(e){e.selected&&!e.selected.firstChange&&this.onSelect.emit(e.selected.currentValue)},n.prototype.select=function(e){this.onSelect.emit(e),this.onChange(e)},jc([t.Input()],n.prototype,"selected",void 0),jc([t.Input()],n.prototype,"disabled",void 0),jc([t.Output()],n.prototype,"onSelect",void 0),n=a=jc([t.Component({selector:"c8y-list-item-checkbox, c8y-li-checkbox",template:'<label class="c8y-checkbox">\n <input\n type="checkbox"\n class="form-control"\n [disabled]="disabled"\n [checked]="selected"\n (change)="select($event.target.checked); (false)"\n />\n <span></span>\n</label>\n<ng-content></ng-content>\n',host:{class:"c8y-list__item__check"},providers:[{provide:nc.NG_VALUE_ACCESSOR,multi:!0,useExisting:t.forwardRef((function(){return a}))}]})],n)}(nc.CheckboxControlValueAccessor),Eh=function(){function e(){}return e=jc([t.NgModule({imports:[Uu,r.CollapseModule.forRoot(),l.BsDropdownModule],declarations:[Ph,wh,Oh,Sh,jh,vh,bh,xh,Ch,Ih],exports:[Ph,wh,Oh,Sh,jh,vh,bh,xh,Ch,Ih]})],e)}(),kh=function(){function e(e){this.audit=e}return e.prototype.ngOnInit=function(){return Sc(this,void 0,void 0,(function(){var e;return Cc(this,(function(t){switch(t.label){case 0:return this.source?(e=this,[4,this.audit.list({withTotalPages:!0,source:this.source})]):[3,2];case 1:e.records=t.sent(),t.label=2;case 2:return[2]}}))}))},e.ctorParameters=function(){return[{type:m.AuditService}]},jc([t.Input()],e.prototype,"source",void 0),e=jc([t.Component({selector:"c8y-audit-log",template:'<div class="inner-scroll">\n <ul class="timeline-list list-condensed m-t-16">\n <li class="timeline-list-item flex-row" *c8yFor="let record of records">\n <small class="timeline-item-date text-right">\n <span>{{ record.time | c8yDate }}</span>\n </small>\n <div class="timeline-item-content flex-row">\n <div class="list-item-body">\n <div class="row text-break-word">\n <div class="col-md-5">\n <span class="text-truncate">{{ record.activity | translate }}</span>\n <small class="text-muted">{{ record.user }}</small>\n </div>\n <div class="col-md-7">\n <div class="small text-truncate-wrap">{{ record.text | translate }}</div>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n</div>\n'})],e)}(),Th=function(){function e(){}return e=jc([t.NgModule({declarations:[kh],imports:[Uu],exports:[kh]})],e)}(),Ah=function(){},_h=function(){function e(e){this.template=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},e=jc([t.Directive({selector:"[c8yCellRendererDef]"})],e)}(),Nh=function(){function e(e){this.template=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},e=jc([t.Directive({selector:"[c8yHeaderCellRendererDef]"})],e)}(),Dh=function(){},Lh=function(){function e(e){this.template=e}return e.ctorParameters=function(){return[{type:t.TemplateRef}]},e=jc([t.Directive({selector:"[c8yFilteringFormRendererDef]"})],e)}(),Mh=function(){function e(){}return jc([t.Input()],e.prototype,"name",void 0),jc([t.ContentChild(_h,{static:!1})],e.prototype,"cellRendererDef",void 0),jc([t.ContentChild(Nh,{static:!1})],e.prototype,"headerCellRendererDef",void 0),jc([t.ContentChild(Lh,{static:!1})],e.prototype,"filteringFormRendererDef",void 0),e=jc([t.Directive({selector:"c8y-column"})],e)}(),Rh={icon:1,numeric:1,"text-short":1.67,"text-long":3.33};(Zm=e.FilteringActionType||(e.FilteringActionType={})).ApplyFilter="APPLY_FILTER",Zm.ResetFilter="RESET_FILTER";var qh=function(){function e(){this.loadingSubject=new a.BehaviorSubject(!0),this.dataSourceSubject=new a.BehaviorSubject([]),this.dataStatsSubject=new a.BehaviorSubject({size:0,filteredSize:0,currentPage:0,currentPageSize:0,firstPageSize:0}),this.dataSelectionSubject=new a.BehaviorSubject({filteredDataIds:[]}),this.resultListSubject=new a.Subject,this.loading$=this.loadingSubject.asObservable(),this.data$=this.dataSourceSubject.asObservable(),this.stats$=this.dataStatsSubject.asObservable(),this.selection$=this.dataSelectionSubject.asObservable(),this.resultList$=this.resultListSubject.asObservable()}return e.prototype.connect=function(e){return this.data$},e.prototype.disconnect=function(e){this.loadingSubject.complete(),this.dataSourceSubject.complete(),this.dataStatsSubject.complete(),this.dataSelectionSubject.complete()},e.prototype.loadData=function(e){var t=this,n=e.rows,r=e.columns,l=e.pagination,i=e.searchText,c=e.serverSideDataCallback,u=e.selectable,d=e.selectionPrimaryKey,p=e.infiniteScroll,m=e.reload,h=void 0!==m&&m,f=this.toObservable(n).pipe(o.map((function(e){var n=0,a=[],o=s.flow((function(e){return t.doClientSideSearch({data:e,columns:r,searchText:i})}),(function(e){return t.doClientSideFiltering({data:e,columns:r})}),(function(e){return t.doClientSideSorting({data:e,columns:r})}),(function(e){return n=e.length,a=u?e.map((function(e){return e[d]})):a,e}),(function(e){return t.doClientSidePagination({data:e,pagination:l})}))(e);return t.dataStatsSubject.next({size:e.length,filteredSize:n,currentPage:l.currentPage,currentPageSize:o.length,firstPageSize:l.pageSize}),t.dataSelectionSubject.next({filteredDataIds:a}),o}))),g=a.defer((function(){return t.toObservable(c({columns:r,searchText:i,pagination:l,selection:{enabled:u,primaryKey:d}}))})).pipe(o.map((function(e){var n=e.data,a=e.paging,o=e.size,s=e.filteredSize,r=e.filteredDataIds;return t.dataStatsSubject.next({size:o,filteredSize:s,currentPage:a.currentPage,currentPageSize:n.length,nextPage:a.nextPage,firstPageSize:a.pageSize}),t.dataSelectionSubject.next({filteredDataIds:r||[]}),t.resultListSubject.next(e),n}))),y="function"==typeof c?g:f;a.of([]).pipe(o.tap((function(){return t.loadingSubject.next(!0)})),o.switchMap((function(){return y})),o.catchError((function(e){return t.dataStatsSubject.next({size:0,filteredSize:0,currentPage:0,currentPageSize:0,firstPageSize:0}),t.dataSelectionSubject.next({filteredDataIds:[]}),a.of([])})),o.finalize((function(){return t.loadingSubject.next(!1)}))).subscribe((function(e){var n=p&&!h?Oc(t.dataSourceSubject.value,e):e;t.dataSourceSubject.next(n)}))},e.prototype.resolveValue=function(e,t){return s.get(e,t)},e.prototype.resolveFunction=function(e){return"function"==typeof e?e():e},e.prototype.normalizeNil=function(e){return s.isNil(e)?"":e},e.prototype.doClientSideFiltering=function(e){var t=this,n=e.data;return e.columns.reduce((function(e,n){var a=n.filterPredicate;return"string"==typeof a?t.doClientSideSearch({data:e,columns:[n],searchText:a}):"function"==typeof a?e.filter((function(e){return a(e,n.path)})):e}),n)},e.prototype.doClientSideSearch=function(e){var t=this,n=e.data,a=e.columns,o=e.searchText,r=a.map((function(e){return e.path})).filter((function(e){return!s.isNil(e)})),l=this.createRegexSearch(o);return n.filter((function(e){var n=s.flow((function(e){return s.pick(e,r)}),(function(e){return s.mapValues(e,t.resolveFunction)}),(function(e){return s.omitBy(e,s.isNil)}))(e);return Object.values(n).some((function(e){return l.test(e.toString())}))}))},e.prototype.doClientSideSorting=function(e){var t=e.data,n=e.columns.filter((function(e){return!!e.sortOrder})),a={paths:n.map((function(e){return e.path})),orders:n.map((function(e){return e.sortOrder}))};return s.orderBy(t,a.paths,a.orders)},e.prototype.doClientSidePagination=function(e){var t=e.data,n=e.pagination;return n?s.get(s.chunk(t,n.pageSize),n.currentPage-1,[]):t},e.prototype.createRegexSearch=function(e){return RegExp(function(e){void 0===e&&(e="");return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"i")},e.prototype.toObservable=function(e){return a.isObservable(e)?e:e instanceof Promise?a.from(e):a.of(e)},e}();var $h,Fh=function(){function n(e,n,o,s){this.sanitizer=e,this.hostRef=n,this.cd=o,this.cfr=s,this.title="Items",this.loadMoreItemsLabel="Load more items",this.loadingItemsLabel="Loading items…",this.showSearch=!1,this.showChildDevices={},this.dataSource=new qh,this.filteringLabelsParams={filteredItemsCount:0,allItemsCount:0},this.paginationLabelParams={pageFirstItemIdx:0,pageLastItemIdx:0,itemsTotal:0},this.possiblePageSizes=[10,15,20,30,50],this.minPossiblePageSize=Math.min.apply(Math,Oc(this.possiblePageSizes)),this.selectable=!1,this.selectionPrimaryKey="id",this.displayOptions={striped:!0,bordered:!1,gridHeader:!0,filter:!0},this.searchText="",this.rowMouseOver=new t.EventEmitter,this.rowMouseLeave=new t.EventEmitter,this.rowClick=new t.EventEmitter,this.onConfigChange=new t.EventEmitter,this.onFilter=new t.EventEmitter,this.itemsSelect=new t.EventEmitter,this.onChildDevices=new t.EventEmitter,this.columnNames=[],this.styles={tableCursor:"auto",gridTemplateColumns:void 0,gridInfiniteScrollColumn:void 0},this.searchText$=new t.EventEmitter,this.filteringApplied=!1,this.totalPagesCount=1/0,this.selectedItemIds=[],this.currentPageSelectionState={allSelected:!1,allDeselected:!0},this.builtInActionType={Edit:"EDIT",Delete:"DELETE",Export:"EXPORT"},this.resizeHandleMouseDown$=new t.EventEmitter,this.resizeHandleContainerMouseMove$=new t.EventEmitter,this.resizeHandleContainerMouseUp$=new t.EventEmitter,this.unsubscribe$=new a.Subject}return Object.defineProperty(n.prototype,"_columns",{set:function(e){this.columns=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_rows",{set:function(e){this.rows=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_pagination",{set:function(e){this.pagination=e;var t=s.get(this.pagination,"pageSize");t&&!this.possiblePageSizes.find((function(e){return e===t}))&&(this.pagination=bc({},this.pagination,{pageSize:10}))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_infiniteScroll",{set:function(e){this.infiniteScroll=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_serverSideDataCallback",{set:function(e){this.serverSideDataCallback=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_selectable",{set:function(e){this.selectable=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_selectionPrimaryKey",{set:function(e){this.selectionPrimaryKey=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_displayOptions",{set:function(e){this.displayOptions=bc({},this.displayOptions,e)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_actionControls",{set:function(e){this.actionControls=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"_bulkActionControls",{set:function(e){this.bulkActionControls=e||[]},enumerable:!0,configurable:!0}),n.prototype.ngOnInit=function(){var e=this;this.searchText$.pipe(o.takeUntil(this.unsubscribe$),o.debounceTime(300),o.distinctUntilChanged(),o.tap((function(t){e.searchText=t}))).subscribe((function(){e.reload()})),this.selectable&&a.combineLatest(this.dataSource.data$,this.itemsSelect.asObservable()).pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(t){var n=Pc(t,1)[0],a=0===n.length;e.currentPageSelectionState={allSelected:!a&&n.every((function(t){return e.isItemSelected(t)})),allDeselected:!!a||n.every((function(t){return!e.isItemSelected(t)}))}})),this.dataSource.stats$.pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(t){e.createLoadMoreComponent(t),e.updateFilteringLabelsParams(t),e.updatePaginationLabelParams(t)})),this.refresh&&this.refresh.pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(){e.cancel(),e.reload()}))},n.prototype.ngOnChanges=function(e){e._actionControls&&!e._actionControls.firstChange||this.loadData(),this.updateColumns()},n.prototype.ngAfterViewInit=function(){this.updateGridColumnsSize(),this.thEls=this.thRefs.toArray().map((function(e){return e.nativeElement})),this.setupResizeHandle()},n.prototype.ngOnDestroy=function(){this.unsubscribe$.next(),this.unsubscribe$.complete()},n.prototype.trackByName=function(e,t){return t.name},n.prototype.resolveCellValue=function(e,t){var n=this;return s.flow([function(e){return n.dataSource.resolveValue(e,t)},this.dataSource.resolveFunction,this.dataSource.normalizeNil])(e)},n.prototype.changeSortOrder=function(e){var t=this.columns.find((function(t){return t.name===e}));if(t){var n=t.sortOrder;n?"asc"===n?this.updateSorting([e],"desc"):this.updateSorting([e],""):this.updateSorting([e],"asc")}},n.prototype.updateSorting=function(e,t){this.columns=this.columns.map((function(n){return e.includes(n.name)?bc({},n,{sortOrder:t}):n})),this.emitConfigChange(),this.reload()},n.prototype.applyFilter=function(t,n,a){this.updateFiltering([t],{type:e.FilteringActionType.ApplyFilter,payload:{filteringModifier:a}}),n.hide(),this.onFilter.emit({columnName:t,dropdown:n,filteringModifier:a})},n.prototype.resetFilter=function(t,n){this.updateFiltering([t],{type:e.FilteringActionType.ResetFilter}),n.hide()},n.prototype.clearFilters=function(){this.updateFiltering(this.columns.map((function(e){return e.name})),{type:e.FilteringActionType.ResetFilter})},n.prototype.updateFiltering=function(t,n){this.columns=this.columns.map((function(a){return t.includes(a.name)?bc({},a,n.type===e.FilteringActionType.ApplyFilter?n.payload.filteringModifier:{filterPredicate:void 0,externalFilterQuery:void 0}):a})),this.updateFilteringApplied(),this.reload()},n.prototype.updateFilteringApplied=function(){this.filteringApplied=this.columns.some(this.isColumnFilteringApplied)},n.prototype.isColumnFilteringApplied=function(e){var t=e.filterable,n=e.filterPredicate,a=e.externalFilterQuery;return!(!t||!n&&!a)},n.prototype.updatePagination=function(e){var t=e.itemsPerPage,n=e.page;this.pagination=bc({},this.pagination,{pageSize:t,currentPage:n}),this.loadData(),this.emitConfigChange()},n.prototype.reload=function(){this.pagination=bc({},this.pagination,{currentPage:1}),this.recreateLoadMoreComponent=!0,this.loadData(!0),this.scrollToTop()},n.prototype.loadNextPage=function(){var e=this;return this.pagination=bc({},this.pagination,{currentPage:this.pagination.nextPage}),this.loadData(),this.dataSource.resultList$.pipe(o.take(1)).toPromise().then((function(t){return bc({},t,{paging:bc({},t.paging,{next:e.loadNextPage.bind(e)})})}))},n.prototype.getCellRendererSpec=function(e){var t=e.value,n=e.row,a=e.columnName;return this._getCellRendererSpec({type:"CELL",value:t,row:n,columnName:a})},n.prototype.getHeaderCellRendererSpec=function(e){var t=e.value,n=e.columnName;return this._getCellRendererSpec({type:"HEADER",value:t,row:void 0,columnName:n})},n.prototype.getFilteringFormRendererSpec=function(e){var t=e.column,n=e.dropdown;return{renderer:s.get(this.getColumnRenderer(t),"filteringFormRendererDef.template")||t.filteringFormRendererComponent,context:{property:t,applyFilter:this.applyFilter.bind(this,t.name,n),resetFilter:this.resetFilter.bind(this,t.name,n)}}},n.prototype.setAllItemsSelected=function(e){var t=this;this.dataSource.selection$.pipe(o.first()).subscribe((function(n){var a=n.filteredDataIds;return t.setItemsSelected(a,e)}))},n.prototype.setAllItemsInCurrentPageSelected=function(e){var t=this;this.dataSource.data$.pipe(o.first()).subscribe((function(n){return t.setItemsSelected(n,e)}))},n.prototype.setItemsSelected=function(e,t){var n=this,a=e.map((function(e){return"object"==typeof e?e[n.selectionPrimaryKey]:e}));this.selectedItemIds=t?s.union(this.selectedItemIds,a):s.without.apply(void 0,Oc([this.selectedItemIds],a)),this.itemsSelect.emit(this.selectedItemIds)},n.prototype.cancel=function(){this.selectedItemIds=[],this.itemsSelect.emit(this.selectedItemIds)},n.prototype.isItemSelected=function(e){return this.selectedItemIds.includes(e[this.selectionPrimaryKey])},n.prototype.onColumnDrop=function(e){var t=e.previousIndex,n=e.currentIndex;if(t!==n){var a=this.columns.splice(t,1);this.columns.splice(n,0,a[0])}this.updateColumnNames(),this.updateGridColumnsSize()},n.prototype.updateGridColumnsSize=function(){this.styles=bc({},this.styles,{gridTemplateColumns:this.sanitizer.bypassSecurityTrustStyle(this.columns.filter((function(e){return e.visible})).map((function(e){return e.gridTrackSize})).join(" ")),gridInfiniteScrollColumn:this.sanitizer.bypassSecurityTrustStyle("1 / span "+this.columns.filter((function(e){return e.visible})).length)}),this.emitConfigChange()},n.prototype.loadChildDevices=function(){this.showChildDevices.value=!this.showChildDevices.value,this.onChildDevices.emit(this.showChildDevices.value)},n.prototype.emitConfigChange=function(){var e=this.columns.map((function(e){return{visible:e.visible,sortOrder:e.sortOrder,name:e.name}}));this.onConfigChange.emit({columns:e,pagination:this.pagination})},n.prototype.updateColumns=function(){var e={gridTrackSize:"minmax(42px, 82px)",sortable:!1,positionFixed:!0},t=Oc([this.selectable?bc({},e,{name:"checkbox"}):void 0],this.columns,[this.actionControls.length>0?bc({},e,{name:"actions"}):void 0]).filter(Boolean).map(this.withColumnDefaults);this.columns=s.uniqBy(t,"name"),this.updateColumnNames(),this.updateGridColumnsSize(),this.updateFilteringApplied()},n.prototype.withColumnDefaults=function(e){var t=e.dataType||"text-short",n=e.headerCSSClassName,a=e.cellCSSClassName;return bc({visible:!0,positionFixed:!1,sortable:!0,sortOrder:"",filterable:!1},e,{dataType:t,gridTrackSize:e.gridTrackSize||"minmax(80px, "+Rh[t]+"fr)",headerCSSClassName:("string"==typeof n?n.split(" "):n)||[],cellCSSClassName:("string"==typeof a?a.split(" "):a)||[]})},n.prototype.updateColumnNames=function(){this.columnNames=this.columns.map((function(e){return e.name}))},n.prototype.setupResizeHandle=function(){var e=this;this.resizeHandleMouseDown$.pipe(o.takeUntil(this.unsubscribe$),o.tap((function(){return e.clearMouseHighlights()})),o.mergeMap((function(t){var n=t.event,a=t.targetColumnName;return e.columns=e.columns.map((function(e){return e.name===a?bc({},e,{headerCSSClassName:s.union(e.headerCSSClassName,["header--being-resized"])}):e})),e.headerBeingResized={columnName:a,el:n.target.parentNode},e.styles=bc({},e.styles,{tableCursor:"col-resize"}),e.resizeHandleContainerMouseMove$.pipe(o.tap((function(){return e.clearMouseHighlights()})),o.takeUntil(e.resizeHandleContainerMouseUp$))}))).subscribe((function(t){requestAnimationFrame((function(){e.columns=e.columns.map((function(n,a){if(n.name===e.headerBeingResized.columnName){var o=e.hostRef.nativeElement,r=o.getBoundingClientRect().left,l=o.scrollLeft-r+t.clientX-(e.headerBeingResized.el.offsetLeft||0);return bc({},n,{gridTrackSize:Math.max(80,l)+"px"})}return n.gridTrackSize.startsWith("minmax")?bc({},n,{gridTrackSize:s.parseInt(e.thEls[a].clientWidth)+"px"}):n})),e.updateGridColumnsSize()}))})),this.resizeHandleContainerMouseUp$.pipe(o.takeUntil(this.unsubscribe$)).subscribe((function(){e.headerBeingResized&&(e.columns=e.columns.map((function(t){return t.name===e.headerBeingResized.columnName?bc({},t,{headerCSSClassName:s.without(t.headerCSSClassName,"header--being-resized")}):t})),e.headerBeingResized=void 0,e.styles=bc({},e.styles,{tableCursor:"auto"}))}))},n.prototype.clearMouseHighlights=function(){window.getSelection&&window.getSelection().removeAllRanges()},n.prototype._getCellRendererSpec=function(e){var t=e.type,n=e.value,a=e.row,o=e.columnName,r=this.columns.find((function(e){return e.name===o})),l=this.getColumnRenderer(r),i=s.get(l,("HEADER"===t?"headerCellRendererDef":"cellRendererDef")+".template"),c=r.cellRendererComponent,u=r.headerCellRendererComponent;return{renderer:i||("HEADER"===t?u:c),context:{value:n,item:a,property:r}}},n.prototype.getColumnRenderer=function(e){return this.columnRenderers.toArray().find((function(t){return t.name===e.name}))},n.prototype.loadData=function(e){void 0===e&&(e=!1);var t=this,n=t.rows,a=t.columns,o=t.pagination,s=t.searchText,r=t.serverSideDataCallback,l=t.selectable,i=t.selectionPrimaryKey,c=t.infiniteScroll;this.dataSource.loadData({rows:n,columns:a,pagination:o,searchText:s,serverSideDataCallback:r,selectable:l,selectionPrimaryKey:i,infiniteScroll:c,reload:e})},n.prototype.updateFilteringLabelsParams=function(e){this.filteringLabelsParams={filteredItemsCount:e.filteredSize,allItemsCount:e.size}},n.prototype.updatePaginationLabelParams=function(e){this.pagination.nextPage=e.nextPage;var t=(e.currentPage-1)*e.firstPageSize+1;this.paginationLabelParams={pageFirstItemIdx:t,pageLastItemIdx:t+(e.currentPageSize-1),itemsTotal:e.filteredSize}},n.prototype.createLoadMoreComponent=function(e){if(this.infiniteScroll&&e&&e.nextPage&&(!this.loadMoreComponent||this.recreateLoadMoreComponent)){this.recreateLoadMoreComponent=!1,this.infiniteScrollContainer.clear();var t=this.cfr.resolveComponentFactory(fu),n=this.infiniteScrollContainer.createComponent(t).instance;n.useIntersection="auto"===this.infiniteScroll||"hidden"===this.infiniteScroll,n.hidden="hidden"===this.infiniteScroll,n.paging={nextPage:e.nextPage,next:this.loadNextPage.bind(this)},n.loadNextLabel=this.loadMoreItemsLabel,n.loadingLabel=this.loadingItemsLabel,this.loadMoreComponent=n}else this.loadMoreComponent&&!e.nextPage&&(this.loadMoreComponent.paging={nextPage:null})},n.prototype.scrollToTop=function(){this.infiniteScroll&&(this.scrollContainer.nativeElement.scrollTop=0)},n.ctorParameters=function(){return[{type:pc.DomSanitizer},{type:t.ElementRef},{type:t.ChangeDetectorRef},{type:t.ComponentFactoryResolver}]},jc([t.Input()],n.prototype,"title",void 0),jc([t.Input()],n.prototype,"loadMoreItemsLabel",void 0),jc([t.Input()],n.prototype,"loadingItemsLabel",void 0),jc([t.Input()],n.prototype,"showSearch",void 0),jc([t.Input()],n.prototype,"refresh",void 0),jc([t.Input()],n.prototype,"showChildDevices",void 0),jc([t.Input("columns")],n.prototype,"_columns",null),jc([t.Input("rows")],n.prototype,"_rows",null),jc([t.Input("pagination")],n.prototype,"_pagination",null),jc([t.Input("infiniteScroll")],n.prototype,"_infiniteScroll",null),jc([t.Input("serverSideDataCallback")],n.prototype,"_serverSideDataCallback",null),jc([t.Input("selectable")],n.prototype,"_selectable",null),jc([t.Input("selectionPrimaryKey")],n.prototype,"_selectionPrimaryKey",null),jc([t.Input("displayOptions")],n.prototype,"_displayOptions",null),jc([t.Input("actionControls")],n.prototype,"_actionControls",null),jc([t.Input("bulkActionControls")],n.prototype,"_bulkActionControls",null),jc([t.Input()],n.prototype,"searchText",void 0),jc([t.Input()],n.prototype,"itemsSelectLimit",void 0),jc([t.Output()],n.prototype,"rowMouseOver",void 0),jc([t.Output()],n.prototype,"rowMouseLeave",void 0),jc([t.Output()],n.prototype,"rowClick",void 0),jc([t.Output()],n.prototype,"onConfigChange",void 0),jc([t.Output()],n.prototype,"onFilter",void 0),jc([t.Output()],n.prototype,"itemsSelect",void 0),jc([t.Output()],n.prototype,"onChildDevices",void 0),jc([t.ContentChildren(Mh)],n.prototype,"columnRenderers",void 0),jc([t.ViewChild("scroll",{static:!0})],n.prototype,"scrollContainer",void 0),jc([t.ViewChild("infiniteScrollContainer",{static:!1,read:t.ViewContainerRef})],n.prototype,"infiniteScrollContainer",void 0),jc([t.ViewChildren(hc.CdkHeaderCell,{read:t.ElementRef})],n.prototype,"thRefs",void 0),jc([Fc(500,{trailing:!0,leading:!1})],n.prototype,"loadData",null),n=jc([t.Component({selector:"c8y-data-grid",template:'<div class="table-data-grid-scroll" #scroll>\n <div *ngIf="displayOptions.gridHeader" class="table-data-grid-header separator large-padding">\n <h4 class="m-r-16">{{ title | translate }}</h4>\n\n <ng-container *ngIf="displayOptions.filter">\n <span *ngIf="!filteringApplied">\n <span class="label label-warning m-r-4" translate>No filters</span>\n <small\n *ngIf="!!filteringLabelsParams.allItemsCount"\n class="m-r-4"\n ngNonBindable\n translate\n [translateParams]="filteringLabelsParams"\n >{{ filteredItemsCount }} of {{ allItemsCount }} items</small\n >\n </span>\n <span *ngIf="filteringApplied">\n <ng-container *ngIf="!!filteringLabelsParams.allItemsCount">\n <span class="badge badge-info m-r-4">\n {{ (dataSource.stats$ | async).filteredSize }}\n </span>\n <small ngNonBindable translate [translateParams]="filteringLabelsParams"\n >of {{ allItemsCount }} items</small\n >\n </ng-container>\n <button\n title=" {{ \'Clear filters\' | translate }}"\n class="m-l-8 btn btn-xs btn-default m-r-4"\n (click)="clearFilters()"\n >\n {{ \'Clear filters\' | translate }}\n </button>\n </span>\n <span class="hidden-xs hidden-sm">\n <button\n class="btn-clean text-primary"\n popover="{{ \'Click the column headers to apply filters.\' | translate }}"\n placement="right"\n triggers="focus"\n >\n <i c8yIcon="question-circle-o"></i>\n </button> </span\n ></ng-container>\n\n <div class="flex-item-right">\n <div class="btnbar flex-row">\n <label class="c8y-switch" *ngIf="showChildDevices.show">\n <input type="checkbox" [(ngModel)]="showChildDevices.value" (click)="loadChildDevices()"/>\n <span></span>\n {{ \'Show child devices\' | translate }}\n </label>\n\n <div\n class="dropdown"\n dropdown\n [insideClick]="true"\n container="body"\n placement="bottom left"\n >\n <button\n title="{{ \'Configure columns\' | translate }}"\n class="btnbar-btn c8y-dropdown"\n dropdownToggle\n >\n <i c8yIcon="columns" class="m-r-4"></i>\n <span>{{ \'Configure columns\' | translate }}</span>\n </button>\n\n <ul *dropdownMenu class="dropdown-menu" (click)="$event.stopPropagation()">\n <li class="bg-white">\n <div cdkDropList (cdkDropListDropped)="onColumnDrop($event)" class="list-group m-0">\n <div *ngFor="let column of columns" cdkDrag cdkDragLockAxis="y">\n <ng-container *ngIf="!column.positionFixed">\n <div class="list-group-item draggable-after p-0 ">\n <label\n title="{{ (column.header | translate) || column.name }}"\n class="c8y-checkbox p-l-16 p-r-32 p-t-8 p-b-8 flex-item-v-stretch"\n >\n <input\n type="checkbox"\n [(ngModel)]="column.visible"\n (change)="updateGridColumnsSize()"\n />\n <span></span>\n <span>{{ (column.header | translate) || column.name }}</span>\n </label>\n </div>\n </ng-container>\n </div>\n </div>\n </li>\n </ul>\n </div>\n\n <button\n title="{{ \'Reload\' | translate }}"\n class="btnbar-btn btn-link"\n [disabled]="dataSource.loading$ | async"\n (click)="searchText = \'\'; reload()"\n >\n <i c8yIcon="refresh" class="m-r-4"></i>\n <span>{{ \'Reload\' | translate }}</span>\n </button>\n\n <div *ngIf="!serverSideDataCallback || showSearch" class="input-group input-group-search m-l-sm-32">\n <input\n type="search"\n class="form-control"\n placeholder="{{ \'Search…\' | translate }}"\n [ngModel]="searchText"\n (input)="searchText$.emit($event.target.value)"\n />\n <div class="input-group-addon">\n <i c8yIcon="search" *ngIf="searchText.length === 0"></i>\n <i\n c8yIcon="times"\n class="pointer"\n *ngIf="searchText.length > 0"\n (click)="searchText = \'\'; searchText$.emit(\'\')"\n ></i>\n </div>\n </div>\n </div>\n </div>\n <div\n class="table-data-grid-header-bulk-actions animated slideInDown fast"\n *ngIf="selectedItemIds.length !== 0"\n >\n <h4>\n <span\n *ngIf="!itemsSelectLimit; else limit"\n ngNonBindable\n translate\n [translateParams]="{ count: selectedItemIds.length }"\n >\n {{ count }} selected items.\n </span>\n <ng-template #limit>\n <span\n ngNonBindable\n translate\n [translateParams]="{ count: selectedItemIds.length, limit: itemsSelectLimit }"\n >\n {{ count }} selected items out of {{ limit }} allowed\n </span>\n </ng-template>\n\n <br class="visible-xs" />\n <small *ngIf="selectedItemIds.length >= pagination.pageSize && !itemsSelectLimit">\n <a (click)="setAllItemsSelected(true)" class="interact" >\n <span\n ngNonBindable\n translate\n [translateParams]="{ count: (dataSource.stats$ | async).filteredSize }"\n >\n Select all {{ count }} items\n </span>\n </a>\n </small>\n </h4>\n <div class="flex-item-right">\n <div class="btnbar flex-row">\n <ng-container\n *ngFor="let bulkActionControl of bulkActionControls"\n [ngSwitch]="bulkActionControl.type"\n >\n <button\n title="{{ \'Export\' | translate }}"\n *ngSwitchCase="builtInActionType.Export"\n class="btnbar-btn"\n (click)="bulkActionControl.callback(selectedItemIds, reload.bind(this))"\n >\n <i c8yIcon="sign-out"></i>\n <span>{{ \'Export\' | translate }}</span>\n </button>\n\n <button\n title="{{ \'Delete\' | translate }}"\n *ngSwitchCase="builtInActionType.Delete"\n class="btnbar-btn"\n (click)="bulkActionControl.callback(selectedItemIds, reload.bind(this))"\n >\n <i c8yIcon="trash"></i>\n <span>{{ \'Delete\' | translate }}</span>\n </button>\n\n <button\n title="{{ bulkActionControl.text | translate }}"\n *ngSwitchDefault\n class="btnbar-btn"\n (click)="bulkActionControl.callback(selectedItemIds, reload.bind(this))"\n >\n <i c8yIcon="{{ bulkActionControl.icon }}"></i>\n <span>{{ bulkActionControl.text | translate }}</span>\n </button>\n </ng-container>\n\n <button title="{{ \'Cancel\' | translate }}" class="btnbar-btn" (click)="cancel()">\n <i c8yIcon="times"></i>\n <span>{{ \'Cancel\' | translate }}</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <table\n class="table table-hover table-filtered-sorted table-data-grid large-padding"\n cdk-table\n [dataSource]="dataSource"\n [trackBy]="trackByName"\n [class.table-striped]="displayOptions.striped"\n [class.table-bordered]="displayOptions.bordered"\n [class.table-data-grid-with-checkboxes]="selectable"\n [class.table-data-grid-with-actions]="actionControls.length > 0"\n [style.grid-template-columns]="styles.gridTemplateColumns"\n (mousemove)="resizeHandleContainerMouseMove$.emit($event)"\n (mouseup)="resizeHandleContainerMouseUp$.emit($event)"\n >\n <ng-container *ngFor="let column of columns; trackBy: trackByName" [cdkColumnDef]="column.name">\n <ng-container [ngSwitch]="column.name">\n <ng-container *ngSwitchCase="\'checkbox\'">\n <th cdk-header-cell *cdkHeaderCellDef data-type="icon">\n <div *ngIf="!itemsSelectLimit">\n <label class="c8y-checkbox">\n <input\n type="checkbox"\n [checked]="currentPageSelectionState.allSelected"\n [indeterminate]="\n !(\n currentPageSelectionState.allSelected ||\n currentPageSelectionState.allDeselected\n )\n "\n (change)="setAllItemsInCurrentPageSelected($event.target.checked)"\n />\n <span></span>\n </label>\n </div>\n </th>\n\n <td cdk-cell *cdkCellDef="let row">\n <label class="c8y-checkbox">\n <input\n type="checkbox"\n [checked]="isItemSelected(row)"\n (change)="setItemsSelected([row], $event.target.checked)"\n [disabled]="selectedItemIds.length >= itemsSelectLimit && !isItemSelected(row)"\n />\n <span></span>\n </label>\n </td>\n </ng-container>\n\n <ng-container *ngSwitchCase="\'actions\'">\n <th cdk-header-cell *cdkHeaderCellDef data-type="icon"></th>\n\n <td cdk-cell *cdkCellDef="let row">\n <ng-container *ngIf="actionControls.length <= 2">\n <ng-container\n *ngFor="let actionControl of actionControls"\n [ngSwitch]="actionControl.type"\n >\n <ng-container *ngIf="actionControl.showIf ? actionControl.showIf(row) : true">\n <button\n *ngSwitchCase="builtInActionType.Edit"\n class="btn btn-icon btn-xs btn-default"\n title="{{ \'Edit\' | translate }}"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="pencil"></i>\n </button>\n <button\n *ngSwitchCase="builtInActionType.Delete"\n class="btn btn-dot showOnHover"\n title="{{ \'Delete\' | translate }}"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i class="text-danger" c8yIcon="minus-circle"></i>\n </button>\n <button\n *ngSwitchDefault\n class="btn btn-icon btn-xs btn-default"\n title="{{ actionControl.text | translate }}"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="{{ actionControl.icon }}"></i>\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <div *ngIf="actionControls.length > 2" class="dropdown" dropdown>\n <button\n title="{{ \'Actions\' | translate }}"\n class="dropdown-toggle c8y-dropdown"\n dropdownToggle\n >\n <i c8yIcon="ellipsis-v"></i>\n </button>\n <ul class="dropdown-menu dropdown-menu-right" *dropdownMenu>\n <li *ngFor="let actionControl of actionControls" [ngSwitch]="actionControl.type">\n <ng-container *ngIf="actionControl.showIf ? actionControl.showIf(row) : true">\n <button\n title="{{ \'Edit\' | translate }}"\n *ngSwitchCase="builtInActionType.Edit"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="pencil"></i>\n {{ \'Edit\' | translate }}\n </button>\n <button\n title="{{ \'Delete\' | translate }}"\n *ngSwitchCase="builtInActionType.Delete"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="trash"></i>\n {{ \'Delete\' | translate }}\n </button>\n <button\n title="{{ \'Export\' | translate }}"\n *ngSwitchCase="builtInActionType.Export"\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="download"></i>\n {{ \'Export\' | translate }}\n </button>\n <button\n title="{{ actionControl.text | translate }}"\n *ngSwitchDefault\n (click)="actionControl.callback(row, reload.bind(this))"\n >\n <i c8yIcon="{{ actionControl.icon }}"></i>\n {{ actionControl.text | translate }}\n </button>\n </ng-container>\n </li>\n </ul>\n </div>\n </td>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <th\n cdk-header-cell\n *cdkHeaderCellDef\n [ngClass]="column.headerCSSClassName"\n [attr.data-type]="column.dataType"\n [class.sorted]="column.sortOrder"\n [class.filtered]="column | map: isColumnFilteringApplied"\n [class.hidden]="!column.visible"\n >\n <div *ngIf="!column.filterable" [title]="(column.header | translate) || column.name">\n <ng-container\n *ngIf="\n (\n [{\n columnName: column.name,\n value: ((column.header | translate) || column.name)\n }]\n | map:getHeaderCellRendererSpec:this\n ) as cellRendererSpec\n "\n >\n <c8y-cell-renderer [spec]="cellRendererSpec"></c8y-cell-renderer>\n </ng-container>\n </div>\n\n <div\n *ngIf="column.filterable"\n class="dropdown"\n dropdown\n #dropdown="bs-dropdown"\n container="body"\n placement="bottom left"\n [insideClick]="true"\n >\n <button\n class="btn-header c8y-dropdown"\n dropdownToggle\n [title]="(column.header | translate) || column.name"\n >\n <ng-container\n *ngIf="\n (\n [{\n columnName: column.name,\n value: ((column.header | translate) || column.name)\n }]\n | map:getHeaderCellRendererSpec:this\n ) as cellRendererSpec\n "\n >\n <c8y-cell-renderer [spec]="cellRendererSpec"></c8y-cell-renderer>\n </ng-container>\n <i c8yIcon="filter" title="{{ \'Filter\' | translate }}"></i>\n </button>\n\n <ul *dropdownMenu class="dropdown-menu" (click)="$event.stopPropagation()">\n <li class="data-grid__dropdown">\n <ng-container\n *ngIf="\n (\n [{\n column: column,\n dropdown: dropdown\n }]\n | map:getFilteringFormRendererSpec:this\n ) as filteringFormRendererSpec\n "\n >\n <c8y-filtering-form-renderer [spec]="filteringFormRendererSpec">\n </c8y-filtering-form-renderer>\n </ng-container>\n </li>\n </ul>\n </div>\n\n <button\n *ngIf="column.sortable"\n class="btn-sort"\n title="{{ \'Sort\' | translate }}"\n (click)="changeSortOrder(column.name)"\n >\n <ng-container [ngSwitch]="column.sortOrder">\n <i *ngSwitchCase="\'asc\'" c8yIcon="long-arrow-up"></i>\n <i *ngSwitchCase="\'desc\'" c8yIcon="long-arrow-down"></i>\n <i *ngSwitchDefault c8yIcon="exchange"></i>\n </ng-container>\n </button>\n\n <span\n class="resize-handle"\n (mousedown)="\n resizeHandleMouseDown$.emit({ event: $event, targetColumnName: column.name })\n "\n >\n </span>\n </th>\n\n <td\n cdk-cell\n *cdkCellDef="let row"\n [ngClass]="column.cellCSSClassName"\n [attr.data-cell-title]="column.header | translate"\n [class.hidden]="!column.visible"\n >\n <ng-container\n *ngIf="\n (\n [{\n value: resolveCellValue(row, column.path),\n row: row,\n columnName: column.name\n }]\n | map:getCellRendererSpec:this\n ) as cellRendererSpec\n "\n >\n <c8y-cell-renderer [spec]="cellRendererSpec"></c8y-cell-renderer>\n </ng-container>\n </td>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <ng-container cdkColumnDef="infiniteScrollFooter">\n <td cdk-footer-cell *cdkFooterCellDef [style.grid-column]="styles.gridInfiniteScrollColumn">\n <template #infiniteScrollContainer></template>\n </td>\n </ng-container>\n\n <tr cdk-header-row *cdkHeaderRowDef="columnNames"></tr>\n\n <tr\n cdk-row\n *cdkRowDef="let row; columns: columnNames"\n (mouseover)="rowMouseOver.emit(row)"\n (mouseleave)="rowMouseLeave.emit(row)"\n (click)="rowClick.emit(row)"\n ></tr>\n\n <ng-container *ngIf="infiniteScroll">\n <tr cdk-footer-row *cdkFooterRowDef="[\'infiniteScrollFooter\']"></tr>\n </ng-container>\n </table>\n\n <div *ngIf="(dataSource.loading$ | async) && !loadMoreComponent" class="text-center">\n <c8y-progress-bar [message]="loadingItemsLabel"></c8y-progress-bar>\n </div>\n\n <div\n class="row m-0 p-t-40 p-b-40"\n *ngIf="!(dataSource.loading$ | async) && (dataSource.stats$ | async).filteredSize === 0"\n >\n <div class="col-md-4 col-md-offset-4">\n <ng-content select=".c8y-empty-state"></ng-content>\n </div>\n </div>\n\n <div *ngIf="pagination && !infiniteScroll" class="table-data-grid-footer separator large-padding">\n <div class="col-sm-4 no-gutter">\n <div *ngIf="(dataSource.stats$ | async).currentPageSize > 0" class="counter">\n <span class="text-muted" ngNonBindable translate [translateParams]="paginationLabelParams"\n >{{ pageFirstItemIdx }} - {{ pageLastItemIdx }} of {{ itemsTotal }}</span\n >\n </div>\n </div>\n\n <div class="col-sm-4 no-gutter text-center">\n <div\n *ngIf="(dataSource.stats$ | async).filteredSize > minPossiblePageSize"\n class="form-group form-inline"\n >\n <label class="m-r-4">{{ \'Items per page\' | translate }}</label>\n <div class="c8y-select-wrapper">\n <select\n class="form-control"\n [ngModel]="pagination.pageSize"\n (ngModelChange)="\n updatePagination({ itemsPerPage: $event, page: pagination.currentPage })\n "\n >\n <option *ngFor="let pageSize of possiblePageSizes" [ngValue]="pageSize">\n {{ pageSize }}\n </option>\n </select>\n </div>\n </div>\n </div>\n\n <div class="col-sm-4 no-gutter text-right">\n <pagination\n [class.hidden]="totalPagesCount <= 1"\n [ngModel]="pagination.currentPage"\n (pageChanged)="updatePagination($event)"\n [totalItems]="(dataSource.stats$ | async).filteredSize"\n [itemsPerPage]="pagination.pageSize"\n (numPages)="totalPagesCount = $event"\n [maxSize]="5"\n [boundaryLinks]="false"\n previousText=" "\n nextText=" "\n ></pagination>\n </div>\n </div>\n</div>\n'})],n)}(),Uh=function(){function e(e,t){this.injector=e,this.cd=t}return Object.defineProperty(e.prototype,"_spec",{set:function(e){this.spec=e},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){this.prevSpec||(this.prevSpec=this.spec);var e=this.spec.renderer;e instanceof t.TemplateRef?this.rendererType="TEMPLATE":e instanceof t.Type&&(this.rendererType="COMPONENT",this.rendererInjector=t.Injector.create({providers:[{provide:Ah,useValue:this.spec.context}],parent:this.injector}))},e.prototype.ngDoCheck=function(){!this.spec.context.value===this.prevSpec.context.value&&(this.prevSpec=this.spec,this.cd.markForCheck())},e.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef}]},jc([t.Input("spec")],e.prototype,"_spec",null),e=jc([t.Component({selector:"c8y-cell-renderer",template:'<ng-container *ngIf="spec.renderer">\n <ng-container\n *ngIf="rendererType === \'TEMPLATE\'"\n [ngTemplateOutlet]="spec.renderer"\n [ngTemplateOutletContext]="{ $implicit: spec.context }"\n >\n </ng-container>\n\n <ng-container\n *ngIf="rendererType === \'COMPONENT\'"\n [ngComponentOutlet]="spec.renderer"\n [ngComponentOutletInjector]="rendererInjector"\n >\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf="!spec.renderer">\n {{ spec.context.value }}\n</ng-container>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],e)}(),Bh=function(){function e(e,t){this.injector=e,this.cd=t,this.defaultRendererFilterText=""}return Object.defineProperty(e.prototype,"_spec",{set:function(e){this.spec=e},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){var e=this.spec,n=e.renderer,a=e.context;n instanceof t.TemplateRef?this.rendererType="TEMPLATE":n instanceof t.Type&&(this.rendererType="COMPONENT",this.rendererInjector=t.Injector.create({providers:[{provide:Dh,useValue:this.spec.context}],parent:this.injector}));var o=a.property.filterPredicate;"string"==typeof o&&(this.defaultRendererFilterText=o)},e.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef}]},jc([t.Input("spec")],e.prototype,"_spec",null),e=jc([t.Component({selector:"c8y-filtering-form-renderer",template:'<ng-container *ngIf="spec.renderer">\n <ng-container\n *ngIf="rendererType === \'TEMPLATE\'"\n [ngTemplateOutlet]="spec.renderer"\n [ngTemplateOutletContext]="{ $implicit: spec.context }"\n >\n </ng-container>\n\n <ng-container\n *ngIf="rendererType === \'COMPONENT\'"\n [ngComponentOutlet]="spec.renderer"\n [ngComponentOutletInjector]="rendererInjector"\n >\n </ng-container>\n</ng-container>\n\n<ng-container *ngIf="!spec.renderer">\n <div class="form-group">\n <label translate>Filter text</label>\n <input\n class="form-control"\n [(ngModel)]="defaultRendererFilterText"\n (keyup.enter)="\n spec.context.applyFilter({\n filterPredicate: defaultRendererFilterText\n })\n "\n />\n </div>\n <div class="flex-row">\n <button\n class="btn btn-default btn-sm flex-grow m-r-8"\n (click)="defaultRendererFilterText = \'\'; spec.context.resetFilter()"\n translate\n >\n Reset\n </button>\n <button\n class="btn btn-primary btn-sm flex-grow"\n (click)="\n spec.context.applyFilter({\n filterPredicate: defaultRendererFilterText\n })\n "\n translate\n >\n Apply\n </button>\n </div>\n</ng-container>\n',changeDetection:t.ChangeDetectionStrategy.OnPush})],e)}(),Gh=function(){function e(){}return e=jc([t.NgModule({imports:[i.CommonModule,hc.CdkTableModule,dc.DragDropModule,nc.FormsModule,nc.ReactiveFormsModule,Uu,l.BsDropdownModule.forRoot(),ac.PopoverModule.forRoot(),fc.PaginationModule.forRoot()],declarations:[_h,Nh,Uh,Lh,Bh,Mh,Fh],exports:[_h,Nh,Lh,Mh,Fh],entryComponents:[Fh]})],e)}(),Hh=function(){function e(e,t,n){this.docsService=e,this.appState=t,this.translateService=n,this.src="",this.isCollapsed=!0,this.priority=1/0,this.title="",this.content=[],this.isLoading=!0,this.hasError=!1,this.SUPPORTED_LANGUAGES=["en"]}return Object.defineProperty(e.prototype,"isSupportedLanguage",{get:function(){return this.SUPPORTED_LANGUAGES.indexOf(this.translateService.currentLang)>-1},enumerable:!0,configurable:!0}),e.prototype.getUrl=function(e){void 0===e&&(e="");var t=this.parseVersion(this.appState.uiVersion),n=this.docsService.getBaseUrl();return n+(n.endsWith("/")?"":"/")+t+(e.startsWith("/")?e:"/"+e)},e.prototype.toggle=function(){this.isCollapsed?this.open():this.close()},e.prototype.close=function(){this.isCollapsed=!0,this.clean()},e.prototype.open=function(){this.isCollapsed=!1,this.isLoading=!0,this.requestContent(),this.icon||(this.icon=this.resolveIcon())},e.prototype.ngAfterContentChecked=function(){var e=this;this.content.length>0&&this.helpContent&&this.content.forEach((function(t){e.helpContent.nativeElement.append(t)}))},e.prototype.requestContent=function(){var e=this,t=new XMLHttpRequest;t.onreadystatechange=function(){return e.render(t)},t.addEventListener("load",(function(){return e.render(t)})),t.open("GET",this.getUrl(this.src)),t.responseType="document",t.setRequestHeader("Accept","text/html"),t.send()},e.prototype.clean=function(){this.title="",this.isLoading=!0,this.hasError=!1,this.content=[],this.helpContent&&(this.helpContent.nativeElement.innerHTML="")},e.prototype.parseVersion=function(e){var t=e.split(".")[0],n=Math.floor(parseInt(t,10)/100);return n+"."+(parseInt(t,10)-100*n)+".0"},e.prototype.resolveIcon=function(){try{return Array.from(document.querySelector("nav .active i").classList).find((function(e){return e.startsWith("c8y-")||e.startsWith("dlt-c8y-icon-")})).replace("dlt-c8y-icon-","")}catch(e){return"question-circle-o"}},e.prototype.render=function(e){var t,n;if(4===e.readyState)if(this.isLoading=!1,200===e.status){var a=this.src.split("#"),o="#"+a[a.length-1]+" h2",s=e.response.querySelector(o),r=Array.from(s.parentElement.children).slice(1);this.title=s.innerText.trim();try{for(var l=Ic(r),i=l.next();!i.done;i=l.next()){var c=i.value;if("h3"===c.tagName.toLowerCase())break;this.content.push(c)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}}else this.hasError=!0},e.ctorParameters=function(){return[{type:xd},{type:Uc},{type:p.TranslateService}]},jc([t.Input()],e.prototype,"src",void 0),jc([t.Input()],e.prototype,"isCollapsed",void 0),jc([t.Input()],e.prototype,"priority",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.ViewChild("helpContent",{static:!1,read:t.ElementRef})],e.prototype,"helpContent",void 0),e=jc([t.Component({selector:"c8y-help",template:'<c8y-action-bar-item\n [placement]="\'right\'"\n itemClass="pull-right"\n [priority]="priority"\n *ngIf="isSupportedLanguage"\n>\n <button\n class="btn btn-help"\n [title]="\'Open help\' | translate"\n (click)="toggle()"\n [attr.aria-expanded]="!isCollapsed"\n aria-controls="collapseHelp"\n >\n <i\n [c8yIcon]="\'question-circle-o\'"\n class="text-info text-16"\n ></i>\n </button>\n</c8y-action-bar-item>\n\n<div\n id="collapseHelp"\n class="c8y-help-drawer"\n [collapse]="isCollapsed"\n [isAnimated]="true"\n>\n <div\n class="p-24"\n #docOutlet\n >\n <div\n *ngIf="isLoading"\n >\n <c8y-loading></c8y-loading>\n </div>\n\n <div *ngIf="!isLoading">\n <div class="d-flex">\n <i\n [c8yIcon]="icon"\n class="c8y-icon-duocolor icon-48"\n ></i>\n <div\n class="p-l-16 flex-grow"\n *ngIf="!hasError"\n >\n <h3 class="text-light m-b-16">{{title}}</h3>\n <div\n id="helpContent"\n class="help-content"\n #helpContent\n ></div>\n\n <button\n class="btn btn-default"\n (click)="toggle()"\n [title]="\'Close help\' | translate"\n [attr.aria-expanded]="!isCollapsed"\n aria-controls="collapseHelp"\n >Close</button>\n <a\n href="{{getUrl(src)}}"\n class="btn btn-primary"\n target="_blank"\n translate\n >\n Check the <span>User guide`KEEP_ORIGINAL`</span>\n </a>\n </div>\n\n <div\n class="p-l-16 flex-grow"\n *ngIf="hasError"\n >\n <h3\n class="text-light m-b-16"\n translate\n >Sorry, that didn\'t work</h3>\n <div class="help-content">\n <p translate>The content couldn\'t be loaded.</p>\n </div>\n\n <button\n class="btn btn-default"\n (click)="toggle()"\n [title]="\'Close help\' | translate"\n [attr.aria-expanded]="!isCollapsed"\n aria-controls="collapseHelp"\n translate\n >Close</button>\n <a\n href="{{getUrl()}}"\n class="btn btn-primary"\n target="_blank"\n translate\n >\n Open the <span>User guide`KEEP_ORIGINAL`</span>\n </a>\n\n </div>\n </div>\n </div>\n\n </div>\n</div>\n'})],e)}(),zh=function(){function e(){}return e=jc([t.NgModule({declarations:[Hh],imports:[Uu,r.CollapseModule.forRoot(),Gu],exports:[Hh],providers:[]})],e)}(),Vh=function(){function e(){}return Object.defineProperty(e.prototype,"active",{get:function(){return!!this.service&&this.service.active},enumerable:!0,configurable:!0}),e.prototype.toggle=function(){this.service&&(this.active?this.service.stop():this.service.start())},jc([t.Input()],e.prototype,"service",void 0),e=jc([t.Component({selector:"c8y-realtime-btn",template:'<button\n type="button"\n class="btn btn-link c8y-realtime"\n title="{{ \'Toggle realtime\' | translate }}"\n (click)="toggle()"\n>\n <span class="c8y-pulse" [ngClass]="{ active: active, inactive: !active }"></span>\n <span translate>Realtime</span>\n</button>\n'})],e)}(),Kh=function(){function e(){}return e=jc([t.NgModule({imports:[Uu],declarations:[Vh],exports:[Vh]})],e)}();($h=e.ModalSelectionMode||(e.ModalSelectionMode={})).SINGLE="single",$h.MULTI="multi";var Wh=function(){function n(n){var s=this;this.bsModalRef=n,this.subTitle="Select from the list of items matching the device type",this.mode=e.ModalSelectionMode.MULTI,this.disableSelected=!0,this.showFilter=!0,this.areMoreEntries=!1,this.result=new t.EventEmitter,this.search=new t.EventEmitter,this.selected=!1,this.filterTerm="",this.listItems=[],this.debouncer=new a.Subject,this._labels={ok:"Confirm",cancel:"Cancel"},this.debouncer.pipe(o.debounceTime(500)).subscribe((function(e){s.search.emit(e)}))}return Object.defineProperty(n.prototype,"labels",{get:function(){return this._labels},set:function(e){var t=e||{},n=t.ok,a=void 0===n?this.labels.ok:n,o=t.cancel,s=void 0===o?this.labels.cancel:o;this._labels={ok:a,cancel:s}},enumerable:!0,configurable:!0}),n.prototype.ngOnChanges=function(e){return Sc(this,void 0,void 0,(function(){var t,n,a=this;return Cc(this,(function(o){switch(o.label){case 0:return e.items&&e.items.currentValue?(t=e.items.currentValue.map((function(e){return Sc(a,void 0,void 0,(function(){var t,n;return Cc(this,(function(a){switch(a.label){case 0:return t=e,[4,e.options];case 1:return t.options=a.sent(),(n=e.options.find((function(e){return e.selected})))&&(e.selectedId=n.obj.id,this.disableSelected&&e.options.map((function(e){return s.assign(e,{disabled:!0})}))),[2,e]}}))}))})),n=this,[4,Promise.all(t)]):[3,2];case 1:n.listItems=o.sent(),o.label=2;case 2:return[2]}}))}))},n.prototype.updatePipe=function(e){this.debouncer.next(e),this.filterTerm=e},n.prototype.updateChoice=function(e){var t=e.item,n=e.id;"single"===this.mode&&this.listItems.map((function(e){return e.selectedId=void 0})),t.selectedId=n,this.selected=!0},n.prototype.dismiss=function(){this.bsModalRef.hide()},n.prototype.select=function(){this.result.emit(this.getOutput()),this.bsModalRef.hide()},n.prototype.ngOnDestroy=function(){this.debouncer.complete(),this.result.complete(),this.search.complete()},n.prototype.getOutput=function(){return this.listItems.filter((function(e){return e.selectedId})).map((function(e){return e.options.find((function(t){return e.selectedId===t.obj.id}))})).filter((function(e){return!e.selected})).map((function(e){return e.obj}))},n.ctorParameters=function(){return[{type:oc.BsModalRef}]},jc([t.Input()],n.prototype,"icon",void 0),jc([t.Input()],n.prototype,"title",void 0),jc([t.Input()],n.prototype,"subTitle",void 0),jc([t.Input()],n.prototype,"items",void 0),jc([t.Input()],n.prototype,"mode",void 0),jc([t.Input()],n.prototype,"disableSelected",void 0),jc([t.Input()],n.prototype,"showFilter",void 0),jc([t.Input()],n.prototype,"areMoreEntries",void 0),jc([t.Input()],n.prototype,"labels",null),jc([t.Output()],n.prototype,"result",void 0),jc([t.Output()],n.prototype,"search",void 0),n=jc([t.Component({selector:"c8y-select-modal",template:'<div class="viewport-modal">\n <div class="modal-header dialog-header">\n <span c8yIcon="{{ icon }}"></span>\n <h4 class="text-uppercase">\n {{ title | translate }}\n </h4>\n </div>\n <div class="p-16 text-center separator-bottom">\n <p class="m-b-8">{{ subTitle | translate }}</p>\n <c8y-filter *ngIf="showFilter" [icon]="\'search\'" (onSearch)="updatePipe($event)"></c8y-filter>\n </div>\n <div class="modal-inner-scroll">\n <div class="p-l-16 p-r-16">\n <div class="panel m-t-8 m-b-8" *ngIf="!items || items.length === 0">\n <div class="c8y-empty-state text-left">\n <h1 c8yIcon="{{ icon }} " class="c8y-icon-duocolor"></h1>\n <p translate>No items to display.</p>\n </div>\n </div>\n </div>\n <c8y-list-group>\n <c8y-li *ngFor="let item of listItems | selectModalFilterPipe: filterTerm">\n <c8y-li-icon>\n <i c8yIcon="{{ icon }}"></i>\n </c8y-li-icon>\n\n <c8y-li-body class="content-flex-30">\n <div class="col-9">\n <div *ngFor="let bodyPart of item.body" [ngClass]="bodyPart.class">\n <c8y-highlight\n [title]="bodyPart.value"\n [pattern]="filterTerm"\n [text]="bodyPart.value"\n ></c8y-highlight>\n </div>\n </div>\n\n <div class="col-3 text-right" *ngIf="item.additionalInformation">\n <div [ngClass]="item.additionalInformation.class">\n {{ item.additionalInformation.value }}\n </div>\n </div>\n </c8y-li-body>\n\n <c8y-li-collapse>\n <c8y-list-group>\n <c8y-li *ngFor="let option of item.options">\n <c8y-li-radio\n [name]="mode === \'single\' ? \'single\' : item.groupId"\n (onSelect)="updateChoice({ item: item, id: option.obj.id })"\n [disabled]="option.disabled"\n [selected]="option.selected"\n >\n </c8y-li-radio>\n <c8y-li-body class="content-flex-50">\n <div\n *ngFor="let optionPart of option.body; let i = index"\n [ngClass]="optionPart.class"\n >\n <c8y-highlight [pattern]="filterTerm" [text]="optionPart.value"></c8y-highlight>\n </div>\n </c8y-li-body>\n </c8y-li>\n </c8y-list-group>\n </c8y-li-collapse>\n </c8y-li>\n <div *ngIf="areMoreEntries">\n <div class="alert alert-info m-t-16 m-r-8 m-l-8" translate>\n Some entries might not be shown. Try narrowing search criteria.\n </div>\n </div>\n </c8y-list-group>\n </div>\n\n <div class="modal-footer">\n <button\n title="{{ labels.cancel | translate }}"\n *ngIf="labels.cancel"\n class="btn btn-default"\n (click)="dismiss()"\n >\n {{ labels.cancel | translate }}\n </button>\n <button\n title="{{ labels.ok | translate }}"\n class="btn btn-primary"\n (click)="select()"\n [disabled]="!selected"\n >\n {{ labels.ok | translate }}\n </button>\n </div>\n</div>\n'})],n)}(),Yh=function(){function e(){}return e.prototype.transform=function(e,t){var n=this;return 0===t.trim().length?e:e.filter((function(e){return n.extractValues(e).filter((function(e){return n.filterContainString(e,t)})).length>0}))},e.prototype.filterContainString=function(e,t){var n=t.toLowerCase().trim();return e&&e.toLowerCase().indexOf(n)>-1},e.prototype.extractValues=function(e){var t=this,n=[];return e.value&&n.push(e.value),Object.keys(e).forEach((function(a){Array.isArray(e[a])&&e[a].forEach((function(e){return n.concat(t.extractValues(e))})),e[a]instanceof Object&&(n=n.concat(t.extractValues(e[a])))})),n},e=jc([t.Pipe({name:"selectModalFilterPipe"})],e)}(),Zh=function(){function e(){}return e=jc([t.NgModule({imports:[l.BsDropdownModule.forRoot(),Uu,Eh,Jd,xp],exports:[Wh,Yh],declarations:[Wh,Yh]})],e)}(),Jh=function(){function e(){this.placeholder="Select item",this.applyLabel="Apply",this.disableApplyOnNoSelection=!1,this.onChange=new t.EventEmitter,this.textFilter="",this.labelText="",this.isOpen=!1,this.filteredItems=[],this.searchFilter=null,this.sizeToShowFilter=5,this.labelsForSelectAll={all:"All",allFiltered:"All filtered"},this.showAllLabel=!1,this.itemsSelected=new Set,this.stopClicks=!1}return e.prototype.preventClick=function(e){this.stopClicks&&e.stopPropagation(),this.stopClicks=this.isOpen},e.prototype.isOpenChange=function(e){this.isOpen=e,e?(this.updateSelected(),this.searchFilter=null):this.stopClicks=!1},e.prototype.outterSelected=function(e){var t=this.selected,n=function(){return!1};return"function"==typeof t?n=t:Array.isArray(t)&&(n=function(e){return t.indexOf(e)>-1}),n(e)},e.prototype.isSelected=function(e){return this.itemsSelected.has(e)},e.prototype.isAllItemsSelected=function(){return this.itemsSelected.size===this.items.length},e.prototype.isAllFilteredSelected=function(){return this.itemsSelected.size===this.filteredItems.length},e.prototype.isNoItemSelected=function(){return!this.itemsSelected.size},e.prototype.applyChanges=function(){var e=Array.from(this.itemsSelected.values());this.onChange.emit(e),this.dropdown.hide()},e.prototype.selectAll=function(e){var t=this;this.filteredItems.forEach((function(n){return t.onChangeItem(e,n)}))},e.prototype.ngOnInit=function(){var e=this;this.updateItems&&this.updateItems.subscribe((function(){e.updateSelected(),e.updateLabel(),e.showAllLabel=e.isAllItemsSelected()}))},e.prototype.onChangeItem=function(e,t){e?this.itemsSelected.add(t):this.itemsSelected.delete(t)},e.prototype.updateFiltered=function(e){if(e){var t=new RegExp(e,"i");this.filteredItems=this.items.filter((function(e){var n=e.name;return t.test(n)}))}else this.filteredItems=this.items},e.prototype.getSelectAllToggleStatus=function(){var e=this.getLabel(),t=this.isAllSelected();return{label:e,checked:t,indeterminate:!t&&this.itemsSelected.size>0}},e.prototype.ngOnChanges=function(e){this.isOpen||(e.items||e.selected||e.applyLabel)&&(this.updateSelected(),this.updateLabel(),this.showAllLabel=this.isAllItemsSelected())},e.prototype.ngOnDestroy=function(){this.updateItems&&!this.updateItems.closed&&this.updateItems.unsubscribe()},e.prototype.updateLabel=function(){var e=this,t=this.items.filter((function(t){return e.outterSelected(t)}));"string"==typeof this.selectedLabel?this.labelText=this.selectedLabel:"function"==typeof this.selectedLabel?this.labelText=this.selectedLabel(t):this.labelText=t.map((function(e){return e.name})).join(", ")},e.prototype.updateSelected=function(){var e=this,t=this.itemsSelected,n=this.items;t.clear(),n.forEach((function(n){e.outterSelected(n)&&t.add(n)})),this.filteredItems=n},e.prototype.isAllSelected=function(){return this.getLabel()===this.labelsForSelectAll.allFiltered?this.isAllFilteredSelected():this.isAllItemsSelected()},e.prototype.getLabel=function(){return this.searchFilter?this.labelsForSelectAll.allFiltered:this.labelsForSelectAll.all},jc([t.Input()],e.prototype,"placeholder",void 0),jc([t.Input()],e.prototype,"selectedLabel",void 0),jc([t.Input()],e.prototype,"applyLabel",void 0),jc([t.Input()],e.prototype,"items",void 0),jc([t.Input()],e.prototype,"selected",void 0),jc([t.Input()],e.prototype,"updateItems",void 0),jc([t.Input()],e.prototype,"disableApplyOnNoSelection",void 0),jc([t.Output()],e.prototype,"onChange",void 0),jc([t.ViewChild(l.BsDropdownDirective,{static:!1})],e.prototype,"dropdown",void 0),jc([t.ContentChildren(wh)],e.prototype,"liChildren",void 0),jc([t.HostListener("click",["$event"])],e.prototype,"preventClick",null),e=jc([t.Component({selector:"c8y-select",template:'<div\n class="c8y-child-assets-selector dropdown fit-w"\n (isOpenChange)="isOpenChange($event)"\n dropdown\n #dropdown\n>\n <button\n type="button"\n class="btn dropdown-toggle c8y-dropdown"\n title="{{ labelText || placeholder | translate }}"\n dropdownToggle\n >\n <span class="text-truncate" *ngIf="labelText">\n <ng-container *ngIf="showAllLabel">{{ \'All\' | translate }}</ng-container>\n <ng-container *ngIf="!showAllLabel">{{ labelText | translate }}</ng-container>\n </span>\n <span class="text-truncate text-muted" *ngIf="!labelText">\n {{ placeholder | translate }}\n </span>\n </button>\n\n <ul class="dropdown-menu multiselect-container" *dropdownMenu>\n <ng-content select="c8y-li"></ng-content>\n <ng-container *ngIf="liChildren.length === 0">\n <li *ngIf="items.length > sizeToShowFilter" class="multiselect-item">\n <div class="input-group input-group-search">\n <input\n type="search"\n class="form-control"\n placeholder="{{ \'Filter\' | translate }}…"\n (keyup)="updateFiltered($event.target.value)"\n [(ngModel)]="searchFilter"\n />\n <span class="input-group-addon">\n <i c8yIcon="search" *ngIf="!textFilter"></i>\n <i c8yIcon="times" class="text-muted" *ngIf="textFilter" (click)="textFilter = \'\'"></i>\n </span>\n </div>\n </li>\n\n <li class="multiselect-item">\n <label\n [title]="getSelectAllToggleStatus().label"\n class="c8y-checkbox input-sm"\n ng-click="vm.toggleSelectAll(); $event.preventDefault()"\n >\n <input\n type="checkbox"\n [checked]="getSelectAllToggleStatus().checked"\n (change)="selectAll($event.target.checked)"\n [indeterminate]="getSelectAllToggleStatus().indeterminate"\n class="m-t-0"\n />\n <span></span>\n <span class="label-text">\n {{ getSelectAllToggleStatus().label }}\n </span>\n </label>\n </li>\n\n <li class="multiselect-item-container">\n <ul class="list-unstyled">\n <li class="multiselect-item" *ngFor="let item of filteredItems">\n <label title="{{ item.name | translate }}" class="c8y-checkbox input-sm text-truncate">\n <input\n type="checkbox"\n [checked]="isSelected(item)"\n (change)="onChangeItem($event.target.checked, item)"\n class="m-t-0"\n />\n <span></span>\n <span class="label-text">\n {{ item.name | translate }}\n </span>\n </label>\n </li>\n </ul>\n </li>\n <li class="divider"></li>\n <li class="bg-white">\n <button\n title="{{ applyLabel | translate }}"\n class="btn btn-primary btn-block"\n [disabled]="disableApplyOnNoSelection && isNoItemSelected()"\n (click)="applyChanges()"\n >\n {{ applyLabel | translate }}\n </button>\n </li>\n </ng-container>\n </ul>\n</div>\n'})],e)}(),Xh=function(){function e(){this.required=!1,this.disabled=!1,this.allowFreeEntries=!0,this.displayProperty="name",this.icon="caret-down",this.name=this.displayProperty,this.autoClose=!0,this.container="",this.selected={id:null},this.onSearch=new t.EventEmitter,this.onIconClick=new t.EventEmitter,this.KEYCODE_UP=38,this.KEYCODE_DOWN=40,this.KEYCODE_TAB=9,this.KEYCODE_ENTER=13,this.KEYCODE_ESC=27}var n;return n=e,e.prototype.writeValue=function(e){this.selected=e},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.doBlur=function(){this.onTouched&&this.onTouched()},e.prototype.getDisplayProperty=function(){return s.get(this.selected,this.displayProperty,"")},e.prototype.onShown=function(){this.searchControl.nativeElement.focus()},e.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},e.prototype.ngAfterViewInit=function(){var e=this;this.subscription=a.fromEvent(this.searchControl.nativeElement,"keydown").pipe(o.map((function(t){return e.handleKeyboard(t)})),o.filter((function(e){return e})),o.debounceTime(200),o.map((function(e){return e.target.value})),o.distinctUntilChanged()).subscribe((function(t){e.selected={id:null},s.set(e.selected,e.displayProperty,t||""),e.onChange(e.selected),e.onSearch.emit(t)}))},e.prototype.handleKeyboard=function(e){var t=e.keyCode;if(![this.KEYCODE_ENTER,this.KEYCODE_DOWN,this.KEYCODE_TAB,this.KEYCODE_UP].includes(t))return t===this.KEYCODE_ESC&&this.autoClose?(e.stopPropagation(),this.dropdown.hide(),void this.searchControl.nativeElement.blur()):(this.dropdown.show(),e);var n=this.list.toArray(),a=s.findIndex(n,(function(e){return e.active}));if(t===this.KEYCODE_ENTER||t===this.KEYCODE_TAB)a>-1&&(e.preventDefault(),n[a].element.nativeElement.click()),this.dropdown.hide(),this.searchControl.nativeElement.blur();else{this.dropdown.show();var o=t===this.KEYCODE_DOWN?1:-1;a>-1&&(n[a].active=!1),this.selectNextItemOnKeyboardMove(n,a,o)}},e.prototype.validate=function(e){return this.required&&!this.getDisplayProperty()?{required:!0}:!this.allowFreeEntries&&this.selected&&null===this.selected.id?{notExisting:!0}:null},e.prototype.selectNextItemOnKeyboardMove=function(e,t,n){if(e[t+n]){if(!e[t+n].selectable)return void this.selectNextItemOnKeyboardMove(e,t+n,n);e[t+n].active=!0}},jc([t.ViewChild("searchControl",{static:!1})],e.prototype,"searchControl",void 0),jc([t.ViewChild("dropdown",{static:!1})],e.prototype,"dropdown",void 0),jc([t.ContentChildren(wh)],e.prototype,"list",void 0),jc([t.Input()],e.prototype,"required",void 0),jc([t.Input()],e.prototype,"disabled",void 0),jc([t.Input()],e.prototype,"allowFreeEntries",void 0),jc([t.Input()],e.prototype,"placeholder",void 0),jc([t.Input()],e.prototype,"displayProperty",void 0),jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"name",void 0),jc([t.Input()],e.prototype,"autoClose",void 0),jc([t.Input()],e.prototype,"container",void 0),jc([t.Input()],e.prototype,"selected",void 0),jc([t.Output()],e.prototype,"onSearch",void 0),jc([t.Output()],e.prototype,"onIconClick",void 0),e=n=jc([t.Component({selector:"c8y-typeahead",template:'<div\n class="c8y-child-assets-selector dropdown"\n dropdown\n [container]="container"\n placement="bottom left"\n #dropdown="bs-dropdown"\n [autoClose]="true"\n (onShown)="onShown()"\n [isDisabled]="disabled"\n>\n <div class="input-group input-group-dropdown" dropdownToggle>\n <input\n #searchControl\n type="text"\n class="form-control text-truncate p-r-24"\n [required]="required"\n [ngModel]="selected ? getDisplayProperty() : \'\'"\n [placeholder]="placeholder | translate"\n (blur)="doBlur()"\n [name]="name"\n [disabled]="disabled"\n title="{{ placeholder | translate }}"\n />\n\n <span\n class="label label-info p-absolute"\n style="top: 10px; right: 40px; z-index: 10;"\n translate\n *ngIf="\n selected\n ? selected.id === null && getDisplayProperty()?.length > 0 && allowFreeEntries\n : false\n "\n >\n New\n </span>\n\n <span class="input-group-btn">\n <button\n type="button"\n class="btn btn-clean"\n [disabled]="disabled"\n (click)="onIconClick.emit(icon)"\n >\n <i [c8yIcon]="icon"></i>\n </button>\n </span>\n </div>\n\n <c8y-list-group class="dropdown-menu dropdown-menu--modal" *dropdownMenu>\n <ng-content select="div, c8y-li, c8y-list-item, button, a"></ng-content>\n </c8y-list-group>\n</div>\n',providers:[{provide:nc.NG_VALUE_ACCESSOR,multi:!0,useExisting:t.forwardRef((function(){return n}))},{provide:nc.NG_VALIDATORS,useExisting:t.forwardRef((function(){return n})),multi:!0}]})],e)}(),Qh=function(){function e(){}return e=jc([t.NgModule({imports:[l.BsDropdownModule.forRoot(),Uu,Eh,xp],exports:[Jh,Xh],declarations:[Jh,Xh]})],e)}(),ef=function(){function e(e){this.sanitizer=e,this.config={}}return Object.defineProperty(e.prototype,"inlineStyle",{get:function(){return this.config=this.config||{},this.config.min||(this.config.min=0),this.config.max||(this.config.max=100),void 0!==this.config.fractionSize&&(this.config.current=parseFloat(this.config.current.toFixed(this.config.fractionSize))),this.sanitizer.bypassSecurityTrustStyle("\n --range-min: "+this.config.min+";\n --range-max: "+this.config.max+";\n --full-range: "+(this.config.max-this.config.min)+";\n --measurement-target: "+100*(this.config.target-this.config.min)/(this.config.max-this.config.min)+"%;\n --measurement-current: "+100*(this.config.current-this.config.min)/(this.config.max-this.config.min)+"%;\n --range-y-min: "+100*(this.config.yellowRangeMin-this.config.min)/(this.config.max-this.config.min)+"%;\n --range-y-max: "+(this.config.yellowRangeMax-this.config.min)/(this.config.max-this.config.min)*100+"%;\n --range-r-min: "+100*(this.config.redRangeMin-this.config.min)/(this.config.max-this.config.min)+"%;\n --range-r-max: "+(this.config.redRangeMax-this.config.min)/(this.config.max-this.config.min)*100+"%;\n ")},enumerable:!0,configurable:!0}),e.prototype.checkTarget=function(){return void 0!==this.config.target&&this.config.target>=this.config.min&&this.config.target<=this.config.max},e.prototype.rulerCalc=function(e){var t=this.config.min+(this.config.max-this.config.min)/10*e;return void 0!==this.config.fractionSize?parseFloat(t.toFixed(this.config.fractionSize)):parseFloat(t.toFixed(2))},e.prototype.trackByIndex=function(e,t){return e},e.prototype.isRedRangeDisplayed=function(){var e=this.config,t=e.redRangeMin,n=e.redRangeMax;return this.isRangeDisplayed(t,n)},e.prototype.isYellowRangeDisplayed=function(){var e=this.config,t=e.yellowRangeMin,n=e.yellowRangeMax;return this.isRangeDisplayed(t,n)},e.prototype.isRangeDisplayed=function(e,t){return 0===e||0===t||e&&t},e.ctorParameters=function(){return[{type:pc.DomSanitizer}]},jc([t.Input()],e.prototype,"config",void 0),jc([t.HostBinding("attr.style")],e.prototype,"inlineStyle",null),e=jc([t.Component({selector:"c8y-range-display",template:'<div [ngClass]="{ \'range-display--vertical\': config.orientation === \'vertical\' }">\n <div class="range-display">\n <div class="range-display__range">\n <div class="range-display__range__unit">\n {{ config.unit }}\n </div>\n <div *ngIf="isRedRangeDisplayed()" class="range-display__range__max"></div>\n <div\n *ngIf="isYellowRangeDisplayed()"\n class="range-display__range__min"\n ></div>\n <div\n *ngIf="checkTarget()"\n class="range-display__range__target"\n attr.data-label="{{ config.target }} {{ config.unit }}"\n title="{{ \'Target\' | translate }}: {{ config.target }} {{ config.unit }}"\n ></div>\n <div\n *ngIf="\n config.current != undefined &&\n config.current >= config.min &&\n config.current <= config.max\n "\n class="range-display__range__current"\n attr.data-label="{{ config.current }} {{ config.unit }} &#xa; {{ config.time | c8yDate }}"\n title="{{ \'Current\' | translate }}: {{ config.current }} {{ config.unit }} | {{ config.time | c8yDate }}"\n ></div>\n </div>\n <div class="range-display__ruler">\n <div\n *ngFor="let x of [].constructor(10); let index = index; trackBy: trackByIndex"\n attr.data-label="{{rulerCalc(index)}}"\n class="range-display__tick"\n ></div>\n <div attr.data-label="{{ config.max || 100 | number }}" class="range-display__tick"></div>\n </div>\n </div>\n</div>'})],e)}(),tf=function(){function e(){}return e=jc([t.NgModule({imports:[Uu],exports:[ef],declarations:[ef],entryComponents:[ef]})],e)}(),nf=function(){function e(){}var n;return n=e,e.forRoot=function(){return{ngModule:n,providers:Oc(Uu.providers(),Hp.providers())}},e=n=jc([t.NgModule({exports:[Gu,Wu,ed,Th,Jp,hd,Uu,Gh,em,Mp,Hp,Ud,Bd,Np,Jd,Qh,Wp,Lp,xp,Tm,Nm,yh,oh,dh,Eh,Zh,nm,om,Vd,zh,Kh,tf]})],e)}(),af=function(){function e(){this.classes=""}return e.prototype.ngOnInit=function(){this.classes="card-block text-center "+s.kebabCase(this.label)},jc([t.Input()],e.prototype,"icon",void 0),jc([t.Input()],e.prototype,"label",void 0),e=jc([t.Component({selector:"c8y-quick-link",template:'<div [class]="classes" title="{{ label | translate }}">\r\n <h1 class="text-gray-darker">\r\n <i [c8yIcon]="icon" class="c8y-icon-duocolor"></i>\r\n </h1>\r\n <p class="text-muted">{{ label | translate }}</p>\r\n</div>\r\n'})],e)}(),of=function(){function e(){}return e=jc([t.NgModule({declarations:[af],imports:[nf],exports:[af],providers:[]})],e)}(),sf=new t.InjectionToken("Dynamic Provider Config"),rf=function(){function e(e,t){this.injector=t,this.config=s.flatten(e)}return e.prototype.get=function(){var e=this;if(this.config&&this.config.length){if(!this.nodes){var t=this.config.map((function(t){return t.navigation.canActivate&&t.navigation.canActivate.length?e.getGuards(t):void 0})).map(this.checkCanActivate.bind(this));return a.forkJoin(t).pipe(o.map((function(t){return e.config.map((function(e,n){return t[n]?new td(e.navigation):void 0})).filter((function(e){return!!e}))})),o.tap((function(t){return e.nodes=t})))}return this.nodes}},e.prototype.checkCanActivate=function(e){if(e&&e.length){var t=e.map((function(e){return e.canActivate(void 0,void 0)})).map(this.wrapIntoObservable.bind(this));return a.forkJoin(t).pipe(o.map((function(e){return e.reduce((function(e,t){return e&&t}))})))}return a.of(!0)},e.prototype.isPromise=function(e){return!!e&&"function"==typeof e.then},e.prototype.wrapIntoObservable=function(e){return a.isObservable(e)?e:this.isPromise(e)?a.from(e):a.of(e)},e.prototype.getGuards=function(e){var t=this;return e.tab&&e.tab.canActivate&&e.tab.canActivate.length?Oc(e.navigation.canActivate.map((function(e){return t.injector.get(e)})),e.tab.canActivate.map((function(e){return t.injector.get(e)}))):e.navigation.canActivate.map((function(e){return t.injector.get(e)}))},e.prototype.getNodeTabPath=function(e,t){return e.replace(/^\/|\/$/g,"")+"/"+t.replace(/^\/|\/$/g,"")},e.ctorParameters=function(){return[{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[sf]}]},{type:t.Injector}]},e=jc([t.Injectable(),wc(0,t.Optional()),wc(0,t.Inject(sf))],e)}(),lf=function(e){function a(t,n){var a=e.call(this,t)||this;return a.baseUrl=s.get(n,"snapshot.data.endpoint.configurationEndpoint.baseUrl"),a.listUrl=s.get(n,"snapshot.data.endpoint.configurationEndpoint.listUrl"),a}var o;return vc(a,e),o=a,a.prototype.detail=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){return[2,e.prototype.detail.call(this,o.NO_DETAIL_ID)]}))}))},a.prototype.update=function(t){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(n){return[2,e.prototype.update.call(this,t)]}))}))},a.prototype.delete=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){return[2,e.prototype.delete.call(this,o.NO_DETAIL_ID)]}))}))},a.prototype.getDetailUrl=function(e){return this.listUrl},a.NO_DETAIL_ID=null,a.ctorParameters=function(){return[{type:m.FetchClient},{type:n.ActivatedRoute}]},a=o=jc([t.Injectable()],a)}(m.Service),cf=function(e){function a(t,n){var a=e.call(this,t)||this;return a.baseUrl=s.get(n,"snapshot.data.endpoint.definitionsEndpoint.baseUrl"),a.listUrl=s.get(n,"snapshot.data.endpoint.definitionsEndpoint.listUrl"),a}return vc(a,e),a.prototype.list=function(){return Sc(this,void 0,void 0,(function(){return Cc(this,(function(t){return[2,e.prototype.list.call(this)]}))}))},a.ctorParameters=function(){return[{type:m.FetchClient},{type:n.ActivatedRoute}]},a=jc([t.Injectable()],a)}(m.Service),uf=function(){function r(e,t,n,s,r,l,i){var c=this;this.permissions=e,this.activatedRoute=t,this.modalService=n,this.alertService=s,this.providerDefinitionsService=r,this.providerConfigurationService=l,this.jsonschema=i,this.layout$=this.activatedRoute.data.pipe(o.map((function(e){return e.layout})),o.tap((function(e){return c.layout=e})),o.tap((function(e){c.options.formState.disabled=!c.permissions.hasAllRoles(e.saveRoles),c.beforeSaveHook=e.beforeSaveHook}))),this.allRoles$=this.layout$.pipe(o.map((function(e){return Oc(e.deleteRoles||[],e.saveRoles||[])}))),this.changeProvider$=new a.BehaviorSubject(null),this.providerInput$=new a.BehaviorSubject(""),this.form=new nc.FormGroup({}),this.fields=[],this.options={formState:{disabled:!1}},this.reload$=new a.BehaviorSubject(null),this.updatedConfiguration$=new a.Subject}return r.prototype.ngOnInit=function(){var e=this,t=a.from(this.providerDefinitionsService.list()).pipe(o.map((function(e){return e.data})),o.shareReplay(1));this.providers$=a.combineLatest(t,this.providerInput$).pipe(o.map((function(e){var t=Pc(e,2),n=t[0],a=t[1];return a?n.filter((function(e){return e.displayName.toLowerCase().indexOf(a.toLowerCase())>=0})):n})),o.shareReplay(1)),this.configuration$=a.merge(this.updatedConfiguration$,this.reload$.pipe(o.switchMap((function(){return a.from(e.providerConfigurationService.detail()).pipe(o.catchError((function(){return a.of({})})))})),o.map((function(e){return e.data})))).pipe(o.map(this.removeEncryptedValues),o.shareReplay(1)),this.selectedProvider$=a.combineLatest(t,this.configuration$,this.changeProvider$).pipe(o.tap((function(t){var n=Pc(t,3),a=(n[0],n[1]),o=n[2];return e.model=o?s.pick(e.model,"sms.senderName","sms.senderAddress"):a})),o.map((function(t){var n=Pc(t,3),a=n[0],o=n[1];return n[2]||s.find(a,(function(t){return e.matchProvider(t,o)}))})),o.tap((function(t){if(t){var n=e.jsonschema.toFieldConfig(s.get(t,"schema"));n.fieldGroup&&n.fieldGroup.forEach((function(e){ic.ɵdefineHiddenProp(e,"_keyPath",{key:e.key,path:[e.key]}),e.expressionProperties={"templateOptions.disabled":"formState.disabled"}})),e.fields=[n],e.form=new nc.FormGroup({})}})),o.shareReplay(1))},r.prototype.saveProviderConfiguration=function(){return Sc(this,void 0,void 0,(function(){var e,t,n,a;return Cc(this,(function(o){switch(o.label){case 0:return this.beforeSaveHook?[4,this.beforeSaveHook(this.model,this.fields)]:[3,2];case 1:return t=o.sent(),[3,3];case 2:t=this.model,o.label=3;case 3:e=t,o.label=4;case 4:return o.trys.push([4,6,,7]),[4,this.providerConfigurationService.update(e)];case 5:return n=o.sent(),this.changeProvider$.next(null),this.updatedConfiguration$.next(n.data),this.alertService.success(this.layout.configurationUpdatedSuccessMsg),this.form.markAsPristine(),[3,7];case 6:return a=o.sent(),this.alertService.addServerFailure(a),[3,7];case 7:return[2]}}))}))},r.prototype.deleteProviderConfiguration=function(){return Sc(this,void 0,void 0,(function(){var t;return Cc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,this.modalService.confirm(this.layout.deleteConfigurationModalTitle,this.layout.deleteConfigurationModalBody,e.Status.DANGER,{ok:this.layout.deleteConfigurationModalOkBtnLabel,cancel:this.layout.deleteConfigurationModalCancelBtnLabel})];case 1:return n.sent(),[4,this.providerConfigurationService.delete()];case 2:return n.sent(),this.reload$.next(),this.alertService.success(this.layout.configurationDeletedSuccessMsg),[3,4];case 3:return(t=n.sent())&&this.alertService.addServerFailure(t),[3,4];case 4:return[2]}}))}))},r.prototype.removeEncryptedValues=function(e){return s.mapValues(e,(function(e){return"<<Encrypted>>"===e?void 0:e}))},r.prototype.matchProvider=function(e,t){return s.get(t,"provider")===e.id||s.get(t,"providerName")===e.id},r.ctorParameters=function(){return[{type:Su},{type:n.ActivatedRoute},{type:Fd},{type:Yu},{type:cf},{type:lf},{type:Wm}]},r=jc([t.Component({selector:"c8y-sms-gateway",template:'<c8y-title>\n {{ (layout$ | async).pageTitle | translate }}\n</c8y-title>\n\n<div class="row">\n <div class="col-md-8 col-xs-12">\n <form class="card card--fullpage" (ngSubmit)="saveProviderConfiguration()">\n <div class="card-header separator">\n <h4 class="card-title">\n {{ (layout$ | async).cardTitle | translate }}\n </h4>\n </div>\n <div class="inner-scroll">\n <div class="card-block">\n <p *ngIf="!!(layout$ | async).description" class="m-b-8">\n {{ (layout$ | async).description | translate }}\n </p>\n <c8y-form-group>\n <label for="providerName">{{ (layout$ | async).providerName | translate }}</label>\n <c8y-typeahead\n [disabled]="!permissions.hasAllRoles((layout$ | async).saveRoles)"\n [ngModel]="selectedProvider$ | async"\n [displayProperty]="\'displayName\'"\n name="providerName"\n placeholder="{{ (layout$ | async).providerNamePlaceholder | translate }}"\n (onSearch)="providerInput$.next($event)"\n [allowFreeEntries]="false"\n [required]="true"\n [container]="\'body\'"\n >\n <c8y-li\n *ngFor="let provider of providers$ | async"\n class="p-l-8 p-r-8 c8y-list__item--link"\n (click)="changeProvider$.next(provider); providerInput$.next(\'\')"\n [active]="(selectedProvider$ | async) === provider"\n >\n <c8y-highlight\n [text]="provider.displayName || \'--\'"\n [pattern]="providerInput$ | async"\n ></c8y-highlight>\n </c8y-li>\n </c8y-typeahead>\n <c8y-messages\n ><c8y-message\n name="notExisting"\n [text]="(layout$ | async).providerNameNoMatchesHint | translate"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <formly-form\n *ngIf="selectedProvider$ | async"\n [form]="form"\n [fields]="fields"\n [model]="model"\n [options]="options"\n ></formly-form>\n </div>\n </div>\n <div class="card-footer separator" *c8yIfAllowed="allRoles$ | async; allowAny">\n <button\n *c8yIfAllowed="(layout$ | async).deleteRoles"\n class="btn btn-default"\n type="button"\n (click)="deleteProviderConfiguration()"\n [disabled]="\n !(configuration$ | async)?.provider && !(configuration$ | async)?.providerName\n "\n title="{{ (layout$ | async).deleteBtnLabel | translate }}"\n >\n {{ (layout$ | async).deleteBtnLabel | translate }}\n </button>\n <button\n *c8yIfAllowed="(layout$ | async).saveRoles"\n class="btn btn-primary"\n type="submit"\n [disabled]="form.invalid || form.pristine"\n title="{{ (layout$ | async).saveBtnLabel | translate }}"\n >\n {{ (layout$ | async).saveBtnLabel | translate }}\n </button>\n </div>\n </form>\n </div>\n</div>\n',providers:[lf,cf]})],r)}(),df=function(){function e(e){this.config=s.flatten(e)}return e.prototype.get=function(){var e=s.uniqBy(this.config.filter((function(e){return e.tab})),"navigation.path").map((function(e){return{path:e.navigation.path,component:gc.ConditionalTabsOutletComponent}})),t=this.config.map((function(e){return{path:e.tab?e.navigation.path.replace(/^\/|\/$/g,"")+"/"+e.tab.path.replace(/^\/|\/$/g,""):e.navigation.path,component:uf,canActivate:Oc(e.navigation.canActivate||[],s.get(e,"tab.canActivate")||[]).filter((function(e){return!!e})),data:{layout:e.layout,endpoint:e.endpoint}}}));return Oc(e,t)},e.ctorParameters=function(){return[{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[sf]}]}]},e=jc([t.Injectable(),wc(0,t.Optional()),wc(0,t.Inject(sf))],e)}(),pf=function(){function e(e,t,n){this.router=t,this.injector=n,this.config=s.flatten(e)}return e.prototype.get=function(){var e=this;if(this.config&&this.config.length){var t=this.config.find((function(t){return!!t.tab&&(e.router.url==="/"+e.getNodeTabPath(t.navigation.path,t.tab.path)||e.router.url.startsWith("/"+t.navigation.path.replace(/^\/|\/$/g,"")))})),n=t?this.config.filter((function(e){return e.navigation.path.replace(/^\/|\/$/g,"")===t.navigation.path.replace(/^\/|\/$/g,"")&&e.tab})):[],s=n.map((function(t){return t.tab.canActivate&&t.tab.canActivate.length?t.tab.canActivate.map((function(t){return e.injector.get(t)})):void 0})).map(this.checkCanActivate.bind(this));return s.length>0?a.forkJoin(s).pipe(o.map((function(t){return n.map((function(n,a){var o=bc({},n.tab,{path:e.getNodeTabPath(n.navigation.path,n.tab.path)});return t[a]?o:void 0})).filter((function(e){return!!e}))}))):[]}},e.prototype.checkCanActivate=function(e){if(e&&e.length){var t=e.map((function(e){return e.canActivate(void 0,void 0)})).map(this.wrapIntoObservable.bind(this));return a.forkJoin(t).pipe(o.map((function(e){return e.reduce((function(e,t){return e&&t}))})))}return a.of(!0)},e.prototype.isPromise=function(e){return!!e&&"function"==typeof e.then},e.prototype.wrapIntoObservable=function(e){return a.isObservable(e)?e:this.isPromise(e)?a.from(e):a.of(e)},e.prototype.getNodeTabPath=function(e,t){return e.replace(/^\/|\/$/g,"")+"/"+t.replace(/^\/|\/$/g,"")},e.ctorParameters=function(){return[{type:Array,decorators:[{type:t.Optional},{type:t.Inject,args:[sf]}]},{type:n.Router},{type:t.Injector}]},e=jc([t.Injectable(),wc(0,t.Optional()),wc(0,t.Inject(sf))],e)}(),mf=function(){function e(){}var n;return n=e,e.config=function(e){return{ngModule:n,providers:[{provide:sf,useValue:e,multi:!0}]}},e=n=jc([t.NgModule({declarations:[uf],exports:[uf],imports:[nf,Uu,Qm],entryComponents:[uf],providers:[{provide:im,useClass:t.forwardRef((function(){return df})),multi:!0},{provide:ad,useClass:t.forwardRef((function(){return rf})),multi:!0},{provide:rd,useClass:t.forwardRef((function(){return pf})),multi:!0}]})],e)}(),hf=function(){},ff=function(){function e(e){this.realtime=e,this.subjects$=new Map,this.isActive=!0}return Object.defineProperty(e.prototype,"active",{get:function(){return this.isActive},enumerable:!0,configurable:!0}),e.prototype.onAll$=function(e){var t=this,n=this.getSubjectForChannel(e);return n.pipe(o.finalize((function(){1===n.observers.length&&n.observers[0].closed&&(n.stop(),t.subjects$.delete(n.channel))})))},e.prototype.start=function(){this.isActive||(this.subjects$.forEach((function(e){e.start()})),this.isActive=!0)},e.prototype.stop=function(){this.isActive&&(this.subjects$.forEach((function(e){e.stop()})),this.isActive=!1)},e.prototype.onCreate$=function(){return this.onAll$().pipe(o.filter((function(e){return"CREATE"===e.realtimeAction})),o.map((function(e){return e.data})))},e.prototype.onUpdate$=function(e){return this.onAll$(e).pipe(o.filter((function(e){return"UPDATE"===e.realtimeAction})),o.map((function(e){return e.data})))},e.prototype.onDelete$=function(e){return this.onAll$(e).pipe(o.filter((function(e){return"DELETE"===e.realtimeAction})),o.map((function(e){return ec.coerceNumberProperty(e.data)})))},e.prototype.getIdString=function(e){var t;return t="object"==typeof e?e.id:e,String(t)},e.prototype.getChannel=function(e){return e?this.channel().replace("*",this.getIdString(e)):this.channel()},e.prototype.getSubjectForChannel=function(e){var t,n=this.getChannel(e);return this.subjects$.has(n)?t=this.subjects$.get(n):(t=new gf(n,this.realtime),this.subjects$.set(n,t)),t},e}(),gf=function(e){function t(t,n){var a=e.call(this)||this;return a.realtimeChannel=t,a.realtime=n,a.start(),a}return vc(t,e),Object.defineProperty(t.prototype,"channel",{get:function(){return this.realtimeChannel},enumerable:!0,configurable:!0}),t.prototype.start=function(){var e=this;this.realtimeSubscription||(this.realtimeSubscription=this.realtime.subscribe(this.realtimeChannel,(function(t){var n={channel:t.channel,data:t.data.data,id:t.id,realtimeAction:t.data.realtimeAction};e.next(n)})))},t.prototype.stop=function(){this.realtimeSubscription&&(this.realtime.unsubscribe(this.realtimeSubscription),this.realtimeSubscription=null)},t}(a.Subject),yf=function(e){function n(t){return e.call(this,t)||this}return vc(n,e),n.prototype.channel=function(){return"/bulkOperations/*"},n.ctorParameters=function(){return[{type:m.Realtime}]},n=jc([t.Injectable()],n)}(ff),vf=function(e){function n(t){return e.call(this,t)||this}return vc(n,e),n.prototype.channel=function(){return"/managedobjects/*"},n.ctorParameters=function(){return[{type:m.Realtime}]},n=jc([t.Injectable()],n)}(ff);e.ActionBarComponent=Bu,e.ActionBarItemComponent=Mc,e.ActionBarModule=Gu,e.ActionBarService=Lc,e.ActionComponent=Ku,e.ActionModule=Wu,e.ActionOutletComponent=Vu,e.ActionService=zu,e.AlertComponent=Ju,e.AlertDetailsComponent=Zu,e.AlertModule=ed,e.AlertOutletComponent=Xu,e.AlertService=Yu,e.AlertTextComponent=Qu,e.AppIconComponent=Td,e.AppStateService=Uc,e.AppSwitcherComponent=kd,e.ApplicationOptions=Rc,e.AuthenticationModule=Np,e.BootstrapComponent=id,e.BootstrapModule=Jp,e.BreadcrumbComponent=md,e.BreadcrumbItemComponent=cd,e.BreadcrumbModule=hd,e.BreadcrumbOutletComponent=ud,e.BreadcrumbService=pd,e.C8yJSONSchema=Wm,e.C8yStepper=mh,e.C8yStepperButtons=fh,e.C8yStepperIcon=ph,e.C8yStepperProgress=hh,e.C8yTranslateDirective=eu,e.C8yTranslateModule=nu,e.C8yTranslatePipe=tu,e.CachedLocaleDictionaryService=Zc,e.CellRendererComponent=Uh,e.CellRendererContext=Ah,e.CellRendererDefDirective=_h,e.ChangePasswordComponent=Rp,e.ColumnDirective=Mh,e.CommonModule=Uu,e.ConditionalTabsOutletComponent=Kp,e.ConfirmModalComponent=qd,e.ContextRouteComponent=um,e.ContextRouteGuard=hm,e.ContextRouteService=lm,e.CookieBannerComponent=Zp,e.CoreModule=nf,e.CredentialsComponent=qp,e.DashboardChildActionComponent=sh,e.DashboardChildChange=ih,e.DashboardChildComponent=ch,e.DashboardChildTitleComponent=rh,e.DashboardComponent=lh,e.DashboardModule=dh,e.DataGridComponent=Fh,e.DataGridModule=Gh,e.DatePickerComponent=am,e.DatePickerModule=om,e.DatePipe=hu,e.DefaultValidationDirective=mp,e.DeviceStatusComponent=km,e.DeviceStatusModule=Tm,e.DocsModule=Nm,e.DocsService=xd,e.DropAreaComponent=Xp,e.DropAreaModule=em,e.DynamicComponentComponent=ah,e.DynamicComponentModule=oh,e.DynamicComponentService=nh,e.DynamicFormsModule=Qm,e.ES_MAX_TIME_MILLISECONDS=864e13,e.EmptyComponent=fm,e.FilePickerComponent=tm,e.FilePickerModule=nm,e.FilterInputComponent=Pp,e.FilteringFormRendererComponent=Bh,e.FilteringFormRendererContext=Dh,e.FilteringFormRendererDefDirective=Lh,e.ForOfDirective=gu,e.FormGroupComponent=vp,e.FormsModule=xp,e.GainsightService=Hd,e.GridDataSource=qh,e.GuideDocsComponent=_m,e.GuideHrefDirective=Am,e.HOOK_ACTION=Hu,e.HOOK_ACTION_BAR=Dc,e.HOOK_BREADCRUMB=dd,e.HOOK_COMPONENT=th,e.HOOK_COMPONENTS=eh,e.HOOK_DOCS=Od,e.HOOK_DYNAMIC_PROVIDER_CONFIG=sf,e.HOOK_NAVIGATOR_NODES=ad,e.HOOK_ONCE_ROUTE=im,e.HOOK_OPTIONS=qc,e.HOOK_PATTERN_MESSAGES=Hc,e.HOOK_SEARCH=Sd,e.HOOK_TABS=rd,e.HeaderBarComponent=Ed,e.HeaderCellRendererDefDirective=Nh,e.HeaderModule=Mp,e.HeaderService=sd,e.HelpComponent=Hh,e.HelpModule=zh,e.HighlightComponent=Yd,e.HumanizeAppNamePipe=yu,e.HumanizePipe=vu,e.I18nModule=cu,e.ICONS=ju,e.ICON_LIST=Fu,e.IconDirective=bu,e.InputGroupListComponent=bp,e.InputGroupListContainerDirective=jp,e.IpRangeInputListComponent=Ip,e.JsonValidationPrettifierDirective=wp,e.LANGUAGES=Bc,e.LOCALE_PATH=Gc,e.ListGroupComponent=Ph,e.ListGroupModule=Eh,e.ListItemActionComponent=vh,e.ListItemBodyComponent=Sh,e.ListItemCheckboxComponent=xh,e.ListItemCollapseComponent=bh,e.ListItemComponent=wh,e.ListItemFooterComponent=jh,e.ListItemIconComponent=Oh,e.ListItemRadioComponent=Ch,e.ListItemTimelineComponent=Ih,e.LoadMoreComponent=fu,e.LoadingComponent=Iu,e.LoginComponent=$p,e.LoginModule=Hp,e.LoginService=ep,e.MESSAGES=Yc,e.ManagedObjectRealtimeService=vf,e.MapFunctionPipe=Pu,e.MaxValidationDirective=fp,e.MessageDirective=gp,e.MessagesComponent=yp,e.MinValidationDirective=hp,e.MissingTranslationCustomHandler=Vc,e.ModalComponent=$d,e.ModalModule=Ud,e.ModalService=Fd,e.NavigatorIconComponent=gd,e.NavigatorItemComponent=fd,e.NavigatorModule=Bd,e.NavigatorNode=td,e.NavigatorNodeComponent=vd,e.NavigatorNodeRoot=nd,e.NavigatorOutletComponent=Ad,e.NavigatorService=od,e.NewPasswordComponent=up,e.OperationBulkRealtimeService=yf,e.OptionsService=$c,e.OutletDirective=Ou,e.PasswordCheckListComponent=rp,e.PasswordConfirm=lp,e.PasswordConfirmModalComponent=tp,e.PasswordService=np,e.PasswordStrengthCheckerService=ip,e.PasswordStrengthComponent=cp,e.PasswordStrengthValidatorDirective=Gp,e.PatternMessagesService=zc,e.Permissions=Su,e.PhoneValidationDirective=dp,e.PopoverConfirmComponent=yd,e.ProductExperienceDirective=zd,e.ProductExperienceModule=Vd,e.ProgressBarComponent=xu,e.ProviderConfigurationComponent=uf,e.ProviderConfigurationModule=mf,e.ProviderConfigurationNodeFactory=rf,e.ProviderConfigurationRouteFactory=df,e.ProviderConfigurationService=lf,e.ProviderDefinitionsService=cf,e.QuickLinkComponent=af,e.QuickLinkModule=of,e.RangeDisplayComponent=ef,e.RangeDisplayModule=tf,e.RealtimeButtonComponent=Vh,e.RealtimeMessage=hf,e.RealtimeModule=Kh,e.RealtimeService=ff,e.RecoverPasswordComponent=Fp,e.RequiredInputPlaceholderDirective=Cp,e.RightDrawerComponent=bd,e.RouterModule=Pm,e.RouterService=cm,e.RouterTabsResolver=sm,e.SearchComponent=Wd,e.SearchModule=Jd,e.SearchOutletComponent=Kd,e.SearchResultEmptyComponent=Zd,e.SearchService=Cd,e.SelectComponent=Jh,e.SelectModalComponent=Wh,e.SelectModalFilterPipe=Yh,e.SelectModalModule=Zh,e.SelectModule=Qh,e.ShortenUserNamePipe=Eu,e.SmsChallengeComponent=kp,e.StateService=Nc,e.StepperModule=yh,e.StrengthValidatorService=Bp,e.TabComponent=zp,e.TabsModule=Wp,e.TabsOutletComponent=Vp,e.TabsService=ld,e.TenantUiService=ku,e.TextAreaRowHeightDirective=Sp,e.TitleComponent=wd,e.TitleOutletComponent=jd,e.TotpAuthComponent=Up,e.TotpChallengeComponent=Ep,e.TotpSetupComponent=Tp,e.TranslateCustomLoader=Jc,e.TranslateParserCustom=Qc,e.TranslateService=mu,e.TypeaheadComponent=Xh,e.UserEditComponent=op,e.UserEditModalComponent=Qd,e.UserMenuItemComponent=Xd,e.UserMenuOutletComponent=sp,e.UserMenuService=Id,e.UserModule=Lp,e.UserPreferencesService=_u,e.UserPreferencesStorageInventory=Au,e.UserPreferencesStorageLocal=Tu,e.UserTotpRevokeComponent=Dp,e.UserTotpSetupComponent=ap,e.ValidationPattern=pp,e.ViewContextServices=rm,e.WidgetsDashboardComponent=uh,e._=function(e){return e},e.deviceAvailabilityIconMap=Om,e.fromFactories=Ec,e.fromTrigger=xc,e.getActivatedRoute=_c,e.getAngularLocalesLanguageString=iu,e.gettext=Kc,e.initializeServices=Nu,e.languagesFactory=ru,e.loadLocale=pu,e.localeId=lu,e.localePathFactory=su,e.memoize=wu,e.minColumnGridTrackSize=80,e.operationStatusClasses=Rd,e.operationStatusIcons=Md,e.parse=uu,e.ratiosByColumnTypes=Rh,e.resolveInjectedFactories=kc,e.routes=gm,e.sortByPriority=Ac,e.stateToFactory=Tc,e.statusAlert=Ld,e.statusClasses=Dd,e.statusIcons=Nd,e.throttle=Fc,e.tooltips=Em,e.translateLoaderFactory=ou,e.trimTranslationKey=Xc,e.ɵ0=xm,e.ɵa=Cu,e.ɵb=Gd,e.ɵba=pf,e.ɵc=Yp,e.ɵd=Op,e.ɵe=_p,e.ɵf=np,e.ɵg=Km,e.ɵh=Hm,e.ɵi=zm,e.ɵj=Xm,e.ɵk=Ym,e.ɵl=Um,e.ɵm=Bm,e.ɵn=Gm,e.ɵo=Lm,e.ɵp=Dm,e.ɵq=Rm,e.ɵr=Mm,e.ɵs=qm,e.ɵt=Fm,e.ɵu=$m,e.ɵv=Th,e.ɵw=kh,e.ɵx=im,e.ɵy=ad,e.ɵz=rd,Object.defineProperty(e,"__esModule",{value:!0})}));
17
17
  //# sourceMappingURL=c8y-ngx-components.umd.min.js.map