UNPKG

@universis/common

Version:

Universis - common directives and services

1 lines 120 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("bootstrap/js/dist/modal"),require("jquery"),require("bootstrap/js/dist/toast"),require("numeral"),require("numeral/locales"),require("lodash"),require("jsrsasign"),require("ngx-bootstrap/modal"),require("file-saver"),require("xlsx"),require("rxjs"),require("event-source-polyfill"),require("@angular/common/http"),require("@themost/client"),require("rxjs/operators"),require("@themost/angular"),require("@angular/router"),require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("@ngx-translate/core"),require("crypto-js")):"function"==typeof define&&define.amd?define("@universis/common",["exports","bootstrap/js/dist/modal","jquery","bootstrap/js/dist/toast","numeral","numeral/locales","lodash","jsrsasign","ngx-bootstrap/modal","file-saver","xlsx","rxjs","event-source-polyfill","@angular/common/http","@themost/client","rxjs/operators","@themost/angular","@angular/router","@angular/core","@angular/common","@angular/forms","@ngx-translate/core","crypto-js"],t):t((e.universis=e.universis||{},e.universis.common={}),null,e.jQuery,e.Toast,e._numeral,null,e._,e.jsrsasign,e.modal$1,e.FileSaver,e.XLSX,e.rxjs,e.eventSourcePolyfill,e.ng.common.http,e.client,e.rxjs.operators,e.angular,e.ng.router,e.ng.core,e.ng.common,e.ng.forms,e.i1,e.cryptoJs)}(this,function(a,e,t,n,r,i,c,o,s,u,l,p,d,h,f,g,m,v,y,b,S,w,I){"use strict";var x="default"in r?r["default"]:r,_=function(e,t){return(_=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 E(e,t){function n(){this.constructor=e}_(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var k=function(){return(k=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function C(e,s,a,c){return new(a||(a=Promise))(function(t,n){function r(e){try{o(c.next(e))}catch(t){n(t)}}function i(e){try{o(c["throw"](e))}catch(t){n(t)}}function o(e){e.done?t(e.value):function n(t){return t instanceof a?t:new a(function(e){e(t)})}(e.value).then(r,i)}o((c=c.apply(e,s||[])).next())})}function A(r,i){var o,s,a,e,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),"throw":t(1),"return":t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function n(e){if(o)throw new TypeError("Generator is already executing.");for(;c;)try{if(o=1,s&&(a=2&e[0]?s["return"]:e[0]?s["throw"]||((a=s["return"])&&a.call(s),0):s.next)&&!(a=a.call(s,e[1])).done)return a;switch(s=0,a&&(e=[2&e[0],a.value]),e[0]){case 0:case 1:a=e;break;case 4:return c.label++,{value:e[1],done:!1};case 5:c.label++,s=e[1],e=[0];continue;case 7:e=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){c=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){c.label=e[1];break}if(6===e[0]&&c.label<a[1]){c.label=a[1],a=e;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(e);break}a[2]&&c.ops.pop(),c.trys.pop();continue}e=i.call(r,c)}catch(t){e=[6,t],s=0}finally{o=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([t,e])}}}function T(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function P(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return s}function R(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(P(arguments[t]));return e}var j,O=new y.InjectionToken("app.configuration"),N=function(){function e(e,t,n){this._translateService=e,this._injector=t,this._http=n,this.loaded=new y.EventEmitter(null)}return e.prototype.load=function(){return C(this,void 0,void 0,function(){var t,n;return A(this,function(e){switch(e.label){case 0:if(this.config)return[2,!0];t=y.isDevMode()?"development":"production",e.label=1;case 1:return e.trys.push([1,3,,6]),[4,this.loadFrom("assets/config/app."+t+".json")];case 2:return[2,e.sent()];case 3:return 404!==(n=e.sent()).status?[3,5]:[4,this.loadFrom("assets/config/app.json")];case 4:return[2,e.sent()];case 5:throw n;case 6:return[2]}})})},e.prototype.loadFrom=function(i){return C(this,void 0,void 0,function(){var t,r=this;return A(this,function(e){switch(e.label){case 0:return t=this,[4,new Promise(function(t,n){r._http.get(i).subscribe(function(e){return t(e)},function(e){return n(e)})})];case 1:return t.config=e.sent(),this._injector.get(m.DATA_CONTEXT_CONFIG).base=this.config.settings.remote.server,this._translateService.use(this.currentLocale),this.loaded.emit(this.config),[2,!0]}})})},Object.defineProperty(e.prototype,"settings",{get:function(){return this.config&&this.config.settings},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentLocale",{get:function(){var e=localStorage.getItem("currentLang");return e||(this.settings&&this.settings.i18n&&this.settings.i18n.defaultLocale?this.settings.i18n.defaultLocale:"en")},set:function(e){localStorage.setItem("currentLang",e),this._translateService.use(e)},enumerable:!0,configurable:!0}),e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[{type:w.TranslateService},{type:y.Injector},{type:h.HttpClient}]},e}(),L=t;(j=a.DIALOG_BUTTONS||(a.DIALOG_BUTTONS={}))[j.Ok=1]="Ok",j[j.Yes=2]="Yes",j[j.No=4]="No",j[j.Abort=8]="Abort",j[j.Retry=16]="Retry",j[j.Ignore=32]="Ignore",j[j.Cancel=64]="Cancel",j[j.YesNo=6]="YesNo",j[j.AbortRetryIgnore=54]="AbortRetryIgnore",j[j.OkCancel=65]="OkCancel",j[j.YesNoCancel=70]="YesNoCancel";var U=function(){function e(e,t){this._element=e,this._translateService=t,this.buttons=a.DIALOG_BUTTONS.Ok,this.language="en",this.language=this._translateService.currentLang}return e.prototype.bitwiseAnd=function(e,t){return e&t},e.prototype.show=function(){var r=this;return new Promise(function(n,e){r.modalRef?(r.modalRef.one("hide.bs.modal",function(e){var t=r.modalRef.data("result");return n(t)}),r.modalRef.modal("show")):e("Modal element may not be empty at this context")})},e.prototype.hide=function(e){this.modalRef.data("result",e),this.modalRef.modal("hide")},e.prototype.classListToButtons=function(e){return e.map(function(e){return/^modal(-ok)?(-yes)?(-no)?(-abort)?(-retry)?(-ignore)?(-cancel)?/gi.exec(e)}).filter(function(e){return null!=e}).map(function(e){return e.map(function(e,t){return e&&0<t?Math.pow(2,t-1):0}).reduce(function(e,t){return e+t})}).reduce(function(e,t){return e|t})},e.prototype.ngOnInit=function(){return C(this,void 0,void 0,function(){var t,n;return A(this,function(e){return t=Array.from(this._element.nativeElement.classList),(n=this.classListToButtons(t))&&(this.buttons=n),this.modalRef=L(this._element.nativeElement),this.modalRef.modal({backdrop:"static",focus:!0,keyboard:!1,show:!1}),[2]})})},e.decorators=[{type:y.Component,args:[{selector:"universis-dialog.modal",template:'\n <div class="modal-dialog" [ngClass]="theme" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h4 class="modal-title">{{title | translate}}</h4>\n </div>\n <div class="modal-body" [innerHTML]="message"></div>\n <div class="modal-footer">\n <button [lang]="language" type="button" *ngIf="bitwiseAnd(buttons, 1)"\n (click)="hide(\'ok\')" class="btn btn-theme btn-ok" [translate]="\'OK\'"></button>\n <button [lang]="language" type="button" *ngIf="bitwiseAnd(buttons, 2)"\n (click)="hide(\'yes\')" class="btn btn-theme btn-yes" [translate]="\'Yes\'"></button>\n <button [lang]="language" type="button" *ngIf="bitwiseAnd(buttons, 4)"\n (click)="hide(\'no\')" class="btn btn-gray-100 btn-no" [translate]="\'No\'"></button>\n <button [lang]="language" type="button" *ngIf="bitwiseAnd(buttons, 8)"\n (click)="hide(\'abort\')" class="btn btn-danger btn-abort" [translate]="\'Abort\'"></button>\n <button [lang]="language" type="button" *ngIf="bitwiseAnd(buttons, 16)"\n (click)="hide(\'retry\')" class="btn btn-gray-100 btn-retry" [translate]="\'Retry\'"></button>\n <button [lang]="language" type="button" *ngIf="bitwiseAnd(buttons, 32)"\n (click)="hide(\'ignore\')" class="btn btn-gray-100 btn-ignore" [translate]="\'Ignore\'"></button>\n <button [lang]="language" type="button" *ngIf="bitwiseAnd(buttons, 64)"\n (click)="hide(\'cancel\')" class="btn btn-gray-100 btn-cancel" [translate]="\'Cancel\'"></button>\n </div>\n </div>\n </div>\n ',styles:["\n .modal-dialog .modal-body {\n margin-top: 0;\n margin-bottom: 0;\n }\n .modal-footer {\n border-top: 0;\n }\n .modal-ok {\n //\n }\n .modal-ok-cancel {\n //\n }\n .modal-yes-no {\n //\n }\n .modal-yes-no-cancel {\n //\n }\n .modal-abort-ignore-retry {\n //\n }\n .btn {\n text-transform: uppercase;\n font-size: 16px;\n }\n "]}]}],e.ctorParameters=function(){return[{type:y.ElementRef},{type:w.TranslateService}]},e.propDecorators={title:[{type:y.Input}],message:[{type:y.Input}],theme:[{type:y.Input}]},e}(),D=function(){function e(e,t,n,r){this.componentFactoryResolver=e,this.appRef=t,this.injector=n,this.modalService=r,this.config={ignoreBackdropClick:!0,keyboard:!1,initialState:null,"class":"modal-content-base"}}return e.prototype.showDialog=function(e,t,n,r){var i=this;void 0===n&&(n=a.DIALOG_BUTTONS.Ok);var o=this.componentFactoryResolver.resolveComponentFactory(U).create(this.injector);o.instance.title=e,o.instance.message=t,o.instance.buttons=n,r&&(o.instance.theme=r.theme),this.appRef.attachView(o.hostView);var s=o.hostView.rootNodes[0];return document.body.appendChild(s),o.instance.ngOnInit().then(function(){return o.instance.show().then(function(e){return i.appRef.detachView(o.hostView),o.destroy(),Promise.resolve(e)})})},e.prototype.showWarningDialog=function(e,t,n,r){return void 0===n&&(n=a.DIALOG_BUTTONS.OkCancel),this.showDialog(null,'<div class="text-center">\n <div class="icon-circle icon-circle-warning">\n <i class="'+(r||"fa fa-exclamation")+'"></i>\n </div>\n <div class="font-2xl font-weight-bold mt-2">\n '+e+'\n </div>\n <p class="mt-2">\n '+t+"\n </p>\n </div>\n ",n,{theme:"modal-dialog-warning"})},e.prototype.showSuccessDialog=function(e,t,n,r){return void 0===n&&(n=a.DIALOG_BUTTONS.Ok),this.showDialog(null,'<div class="text-center">\n <div class="icon-circle icon-circle-success">\n <i class="'+(r||"fa fa-check")+'"></i>\n </div>\n <div class="font-2xl font-weight-bold mt-2">\n '+e+'\n </div>\n <p class="mt-2">\n '+t+"\n </p>\n </div>\n ",n,{theme:"modal-dialog-success"})},e.prototype.showErrorDialog=function(e,t,n,r){return void 0===n&&(n=a.DIALOG_BUTTONS.Ok),this.showDialog(null,'<div class="text-center">\n <div class="icon-circle icon-circle-danger">\n <i class="'+(r||"fa fa-times")+'"></i>\n </div>\n <div class="font-2xl font-weight-bold mt-2">\n '+e+'\n </div>\n <p class="mt-2">\n '+t+"\n </p>\n </div>\n ",n,{theme:"modal-dialog-danger"})},e.prototype.showDangerDialog=function(e,t,n,r){return void 0===n&&(n=a.DIALOG_BUTTONS.Ok),this.showDialog(null,'<div class="text-center">\n <div class="icon-circle icon-circle-danger">\n <i class="'+(r||"fa fa-exclamation")+'"></i>\n </div>\n <div class="font-2xl font-weight-bold mt-2">\n '+e+'\n </div>\n <p class="mt-2">\n '+t+"\n </p>\n </div>\n ",n,{theme:"modal-dialog-danger"})},e.prototype.showInfoDialog=function(e,t,n,r){return void 0===n&&(n=a.DIALOG_BUTTONS.Ok),this.showDialog(null,'<div class="text-center">\n <div class="icon-circle icon-circle-info">\n <i class="'+(r||"fa fa-info")+'"></i>\n </div>\n <div class="font-2xl font-weight-bold mt-2">\n '+e+'\n </div>\n <p class="mt-2">\n '+t+"\n </p>\n </div>\n ",n,{theme:"modal-dialog-info"})},e.prototype.openModal=function(e,t){var n;return t?(n=JSON.parse(JSON.stringify(this.config)))["class"]=t:n=this.config,this.modalRef=this.modalService.show(e,n)},e.prototype.openModalComponent=function(e,t){return this.modalRef=this.modalService.show(e,t)},e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[{type:y.ComponentFactoryResolver},{type:y.ApplicationRef},{type:y.Injector},{type:s.BsModalService}]},e}(),M=function(){function e(){this.buttonClass="btn-success",this.action=new y.EventEmitter}return e.prototype.clicked=function(){this.action.emit()},e.decorators=[{type:y.Component,args:[{selector:"universis-msgbox",template:'<div class="card">\n <div class="msgbox_main-container">\n <div class="msgbox_icon">\n <span class="fa-4x far {{icon}}" style="color:#678898;"></span>\n </div>\n <div class="msgbox_details">\n <div *ngIf="title && !title.includes(\'title\')" class="msgbox_title" id="title">{{title}}</div>\n <div class="font pt-3 msgbox_item" id="message">{{message}}</div>\n <div class="pt-3 msgbox_item" *ngIf="extraMessage && !extraMessage.includes(\'extraMessage\')">{{extraMessage}}</div>\n <div>\n <div class="pt-3 msgbox_item" *ngIf="actionButton && !actionButton.includes(\'actionButton\')">\n <button type="button" class="btn s--btn" [ngClass]="buttonClass" [disabled]="disableBut" (click)="clicked()">{{actionButton}}</button>\n </div>\n <div class="pt-3 msgbox_item" *ngIf="actionText && !actionText.includes(\'actionText\')" id="text">\n <span><span class="fa-1x icon-arrow-right"></span>{{actionText}}</span>\n </div>\n </div>\n </div>\n </div>\n</div>\n',styles:[".msgbox_main-container{display:flex;margin:30px 40px}.msgbox_title{text-transform:uppercase;color:#536c79}.msgbox_details{display:flex;flex-direction:column;justify-content:center}.msgbox_icon{padding-right:60px;padding-left:20px;display:flex;align-items:center}.msgbox_item{display:flex}@media screen and (max-width:600px){.msgbox_main-container{flex-direction:column;align-items:center}.msgbox_title{text-align:center;justify-content:center;padding:1rem 5px 0}.msgbox_item{justify-content:center;text-align:center}.msgbox_icon{padding-right:0;padding-left:0;justify-content:center}}"]}]}],e.propDecorators={title:[{type:y.Input}],icon:[{type:y.Input}],info:[{type:y.Input}],message:[{type:y.Input}],extraMessage:[{type:y.Input}],actionButton:[{type:y.Input}],actionText:[{type:y.Input}],disableBut:[{type:y.Input}],buttonClass:[{type:y.Input}],action:[{type:y.Output}]},e}(),q=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:y.Component,args:[{selector:"universis-spinner",template:'\n <div class="s--spinner">\n <div class="sk-three-bounce">\n <div class="sk-child sk-bounce1"></div>\n <div class="sk-child sk-bounce2"></div>\n <div class="sk-child sk-bounce3"></div>\n </div>\n </div>\n ',styles:[".s--spinner{position:fixed;width:100%;height:100%;top:0;background-color:rgba(127,127,127,.5);z-index:10000;display:flex!important;justify-content:center!important;align-items:center!important}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.s--spinner .sk-three-bounce{display:table-cell}}.sk-three-bounce{margin:40px auto;width:80px;text-align:center}.sk-three-bounce .sk-child{width:20px;height:20px;background-color:#333;border-radius:100%;display:inline-block;animation:1.4s ease-in-out infinite both sk-three-bounce}.sk-three-bounce .sk-bounce1{animation-delay:-.32s}.sk-three-bounce .sk-bounce2{animation-delay:-.16s}@keyframes sk-three-bounce{0%,100%,80%{transform:scale(0)}40%{transform:scale(1)}}"]}]}],e.ctorParameters=function(){return[]},e}(),V=function(){function e(e){this._element=e,this.autoHide=!0,this.delay=5e3,this.dateCreated=new Date}return e.prototype.ngOnInit=function(){},e.prototype.ngAfterViewInit=function(){return this.toast=new n(this._element.nativeElement,{animation:!1,autohide:this.autoHide,delay:this.delay}),this.toast.show()},e.prototype.show=function(){this.toast&&this.toast.show()},e.prototype.hide=function(){var e=document.body.getElementsByClassName("universis-toast-container")[0];1===e.getElementsByClassName("show").length&&e.classList.add("hidden"),this.toast&&this.toast.hide()},e.decorators=[{type:y.Component,args:[{selector:"universis-toast.toast",template:'\n <div class="toast-header d-flex p-0">\n <strong class="mr-auto">{{ title }}</strong>\n <button type="button" class="ml-2 mb-1 align-self-start close" data-dismiss="toast" (click)="hide();" aria-label="Close">\n <span aria-hidden="true">&times;</span>\n </button>\n </div>\n <div class="toast-body p-0">\n <div class="toast-body-content" [innerHTML]="message"></div>\n </div>\n <div class="toast-header p-0">\n <small class="toast-date">{{ dateCreated | date: \'shortTime\'}}</small>\n </div>\n ',styles:[":host {\n z-index: auto;\n }"]}]}],e.ctorParameters=function(){return[{type:y.ElementRef}]},e.propDecorators={title:[{type:y.Input}],message:[{type:y.Input}],autoHide:[{type:y.Input}],delay:[{type:y.Input}]},e}(),z=function(){function e(e,t,n){this.componentFactoryResolver=e,this.appRef=t,this.injector=n}return e.prototype.show=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=5e3);var i=document.body.getElementsByClassName("universis-toast-container")[0];null==i&&((i=document.createElement("div")).classList.add("universis-toast-container","p-3"),document.body.appendChild(i));var o=this.componentFactoryResolver.resolveComponentFactory(V).create(this.injector);o.instance.title=e,o.instance.message=t,o.instance.autoHide=n,o.instance.delay=r,o.location.nativeElement.classList.add("ml-auto"),this.appRef.attachView(o.hostView);var s=o.hostView.rootNodes[0];i.appendChild(s),i.classList.remove("hidden"),setTimeout(function(){o.instance.hide()},r)},e.prototype.clear=function(){var e=document.body.getElementsByClassName("universis-toast-container")[0];if(e)for(;e.firstChild;)e.removeChild(e.firstChild)},e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[{type:y.ComponentFactoryResolver},{type:y.ApplicationRef},{type:y.Injector}]},e}();function B(e,t){return"number"!=typeof e?0:t?parseFloat(e.toFixed(t)):Math.round(e)}var F=function(){function e(e,t){void 0===t&&(t=null),this._locale=e,this.scale=t,this.formatPrecision=2,this.scalePrecision=2,this._formatter=new b.DecimalPipe(this._locale),this._decimalCharRegExp=new RegExp("\\"+this._formatter.transform(.1,"1.1-1").substr(1,1),"ig"),t&&(this.id=t.id,this.name=t.name,this.scaleType=t.scaleType,this.scaleFactor=t.scaleFactor,this.scaleBase=t.scaleBase,this.formatPrecision=t.formatPrecision,this.scalePrecision=t.scalePrecision,this.values=t.values)}return e.prototype.format=function(e){if(0===this.scaleType){if("number"!=typeof this.scaleFactor)throw new TypeError("Grade scale factor must be a number.");if(this.scaleFactor<=0)throw new TypeError("Grade scale factor must greater than zero.");if("number"!=typeof e)return;var t=B(B(e/this.scaleFactor,6),this.formatPrecision);return this._formatter.transform(t,"1."+this.formatPrecision+"-"+this.formatPrecision)}if(1!==this.scaleType&&3!==this.scaleType)throw new Error("Not yet implemented");var n=B(e,this.scalePrecision),r=this.values.find(function(e){return n>=e.valueFrom&&n<=e.valueTo});if(r)return r.name;throw new RangeError("Out of range value for grade")},e.prototype.convert=function(t){if(0===this.scaleType){var e=void 0;if(null==t)return;if("number"==typeof t)e=t;else if("string"==typeof t&&(e=parseFloat(t.replace(this._decimalCharRegExp,".")),isNaN(e)))return;if("number"!=typeof this.scaleFactor)throw new TypeError("Grade scale factor must be a number.");if(this.scaleFactor<=0)throw new TypeError("Grade scale factor must greater than zero.");var n=B(e*this.scaleFactor,this.formatPrecision+1);if(n<0||1<n)throw new Error("Grade is out of range. It must be between 0 to 1.");return n}if(1!==this.scaleType&&3!==this.scaleType)throw new Error("Not yet implemented");var r=this.values.find(function(e){return e.name===t||e.alternateName===t});if(r)return r.exactValue;throw new RangeError("Out of range value for grade")},e}(),H=function(){function e(e,t){this._context=e,this._configurationService=t}return e.prototype.getGradeScales=function(){var n=this;return this._gradeScales?Promise.resolve(this._gradeScales):this._context.model("GradeScales").getItems().then(function(e){var t=n._configurationService.currentLocale;return n._gradeScales=e.map(function(e){return Object.assign(new F(t),e)}),Promise.resolve(n._gradeScales)},function(e){return console.log(e),null})},e.prototype.getGradeScale=function(t){return this._gradeScales?Promise.resolve(this._gradeScales.find(function(e){return e.id===t})):this.getGradeScales().then(function(e){return Promise.resolve(e.find(function(e){return e.id===t}))})},e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[{type:m.AngularDataContext},{type:N}]},e}(),G=function(){function e(e){this._gradeScaleService=e}return e.prototype.transform=function(t,e){return e instanceof F?Promise.resolve(e.format(t)):this._gradeScaleService.getGradeScale(e).then(function(e){return void 0===e?Promise.reject(new Error("The specified grade scale cannot be found or is inaccessible")):Promise.resolve(e.format(t))})},e.decorators=[{type:y.Pipe,args:[{name:"grade"}]}],e.ctorParameters=function(){return[{type:H}]},e}(),K=function(){function e(e,t,n){this.componentFactoryResolver=e,this.appRef=t,this.injector=n}return e.prototype.appendComponentToBody=function(e){if(!this.componentRef){this.componentRef=this.componentFactoryResolver.resolveComponentFactory(e).create(this.injector),this.appRef.attachView(this.componentRef.hostView);var t=this.componentRef.hostView.rootNodes[0];document.body.appendChild(t)}},e.prototype.toggle=function(){this.componentRef?this.hideLoading():this.showLoading()},e.prototype.showLoading=function(){null==this.componentRef&&this.appendComponentToBody(q)},e.prototype.hideLoading=function(){this.componentRef&&(this.appRef.detachView(this.componentRef.hostView),this.componentRef.destroy(),this.componentRef=null)},e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[{type:y.ComponentFactoryResolver},{type:y.ApplicationRef},{type:y.Injector}]},e}(),J=function(){function e(e){this.translateService=e}return e.prototype.transform=function(e,t){void 0===t&&(t="mediumDate");var n=new b.DatePipe(this.translateService.currentLang);return"string"==typeof e&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{2}$/.test(e)?n.transform(new Date(e+":00"),t):n.transform(e,t)},e.decorators=[{type:y.Pipe,args:[{name:"localizedDate",pure:!1}]}],e.ctorParameters=function(){return[{type:w.TranslateService}]},e}();var Y,X=x||r,Z=function(){function e(e){var t=this;this._translateService=e,X.locales.el===undefined&&function n(t){return C(this,void 0,void 0,function(){return A(this,function(e){switch(e.label){case 0:return[4,t.register("locale","el",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"χιλ",million:"εκ",billion:"δισ",trillion:"τρισ"},ordinal:function(e){return"ο"},currency:{symbol:"€"}})];case 1:return e.sent(),[4,t.register("locale","el-gr",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"χιλ",million:"εκ",billion:"δισ",trillion:"τρισ"},ordinal:function(e){return"ο"},currency:{symbol:"€"}})];case 2:return e.sent(),[4,t.register("locale","cy",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"χιλ",million:"εκ",billion:"δισ",trillion:"τρισ"},ordinal:function(e){return"ο"},currency:{symbol:"€"}})];case 3:return e.sent(),[4,t.register("locale","cy-cy",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"χιλ",million:"εκ",billion:"δισ",trillion:"τρισ"},ordinal:function(e){return"ο"},currency:{symbol:"€"}})];case 4:return e.sent(),[2]}})})}(r).then(function(){return C(t,void 0,void 0,function(){return A(this,function(e){switch(e.label){case 0:return[4,Promise.resolve()];case 1:return e.sent(),[2]}})})})}return e.prototype.transform=function(e,t){return void 0===t&&(t="long"),"object"==typeof e&&(e=e.id),250<=e?this._translateService.instant("Semester.full."+e):(X.locale(this._translateService.currentLang),this._translateService.instant("Semester."+t,{value:e,ordinal:X(e).format("o")}))},e.decorators=[{type:y.Pipe,args:[{name:"semester",pure:!1}]}],e.ctorParameters=function(){return[{type:w.TranslateService}]},e}(),W=function(){function e(){}return e.prototype.transform=function(e,t,n){var r;delete(r=n!==undefined?c.template(e,n):c.template(e)).source;var i=r(t);return r=null,i},e.decorators=[{type:y.Pipe,args:[{name:"template",pure:!1}]}],e.ctorParameters=function(){return[]},e}(),Q=function(){function e(){}return Object.defineProperty(e.prototype,"assign",{set:function(e){e&&Object.assign(this,{$implicit:e})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.$implicit},set:function(e){this.$implicit=e},enumerable:!0,configurable:!0}),e.decorators=[{type:y.Directive,args:[{selector:"[ngVar]",exportAs:"ngVar"}]}],e.ctorParameters=function(){return[]},e.propDecorators={assign:[{type:y.Input,args:["ngVar"]}]},e}(),ee="currentProfile",te="currentUser",ne=function(){function e(e,t){this._context=e,this._configurationService=t}return e.prototype.checkLogin=function(){var e=this._configurationService.settings.auth;$("<iframe>",{src:e.authorizeURL+"?response_type=token&client_id="+e.oauth2.clientID+"&redirect_uri="+e.oauth2.callbackURL+"&prompt=none",id:"openid",frameborder:1,scrolling:"no",onload:function(){}}).hide().appendTo("body")},e.prototype.getUser=function(){return C(this,void 0,void 0,function(){return A(this,function(e){return[2,this.getUserSync()]})})},e.prototype.getUserSync=function(){if(this._user)return this._user;if(sessionStorage.getItem(te)){var e=JSON.parse(sessionStorage.getItem(te));return this._user=Object.assign({},e),Object.defineProperty(this._user,"context",{configurable:!0,enumerable:!1,value:this._context}),this._context.setBearerAuthorization(this._user.token.access_token),this._context.getService().setHeader("accept-language",this._configurationService.currentLocale),this._user}return null},e.prototype.setProfile=function(e){return void 0===e||null==e?sessionStorage.removeItem(ee):sessionStorage.setItem(ee,JSON.stringify(e)),this},e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[{type:m.AngularDataContext},{type:N}]},e}(),re=function(){function e(e,t){var n=this;this.configurationService=e,this.userService=t,this.user=new p.BehaviorSubject(null),this.configurationService.loaded.subscribe(function(){n.user.next(n.activatedUser)})}return Object.defineProperty(e.prototype,"activatedUser",{get:function(){return this.userService.getUserSync()},enumerable:!0,configurable:!0}),e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[{type:N},{type:ne}]},e}(),ie=function(){function e(e,t,n){this._translateService=e,this.bsModalRef=t,this._router=n,this.continueLink="/",this.iconClass="far fa-frown",this.buttonText="Error.Continue",this.language=this._translateService.currentLang}return e.prototype.hide=function(){return this.bsModalRef.hide(),null==this.continueLink?Promise.resolve():"."===this.continueLink?Promise.resolve():this._router.navigate([this.continueLink])},e.prototype.ngOnInit=function(){var n=this,e=this.error;e&&"string"==typeof e.code?this.code=e.code:e&&"number"==typeof(e.status||e.statusCode)?this.code="E"+(e.status||e.statusCode):this.code="E500",e&&"string"==typeof e["continue"]&&(this.continueLink=e["continue"]),this._translateService.get(this.code).subscribe(function(t){t?(n.title=t.title,n.message=n.error instanceof h.HttpErrorResponse&&n.error.error&&n.error.error.message?n.error.error.message:t.message):n._translateService.get("E500").subscribe(function(e){n.title=e.title,n.message=n.error instanceof h.HttpErrorResponse&&n.error.error&&n.error.error.message?n.error.error.message:t.message})})},e.decorators=[{type:y.Component,args:[{selector:"universis-error-modal",template:'\n <div class="modal-header text-center">\n <button type="button" class="close pull-right" aria-label="Close" (click)="hide()">\n <span aria-hidden="true">&times;</span>\n </button>\n </div>\n <div class="modal-body mt-0 mb-0 text-center">\n <div class="text-center">\n <div class="icon-circle icon-circle-danger">\n <i class="fa fa-times"></i>\n </div>\n <div class="font-2xl font-weight-bold mt-2">\n {{title}}\n </div>\n <p class="mt-2">\n {{message}}\n </p>\n </div>\n </div>\n <div class="modal-footer">\n <button [lang]="language" type="button" (click)="hide()"\n class="btn btn-gray-100 btn-ok text-uppercase" [translate]="buttonText"></button>\n </div>\n ',styles:["\n .btn-ok {\n font-size: 16px;\n }\n "]}]}],e.ctorParameters=function(){return[{type:w.TranslateService},{type:s.BsModalRef},{type:v.Router}]},e.propDecorators={continueLink:[{type:y.Input}],message:[{type:y.Input}],title:[{type:y.Input}],iconClass:[{type:y.Input}],buttonText:[{type:y.Input}],error:[{type:y.Input}]},e}(),oe=function(){function e(e,t){this._router=e,this._modalService=t}return e.prototype.navigateToError=function(e){return this.setLastError(e),e instanceof h.HttpErrorResponse?e&&e.error&&e.error.statusCode?this._router.navigate(["/error",e.error.statusCode]):this._router.navigate(["/error",e.status]):this._router.navigate(["/error"])},e.prototype.showError=function(e,t){var n=Object.assign({error:e},t);this._modalService.show(ie,{initialState:n})},e.prototype.setLastError=function(e){return this._lastError=e,this},e.prototype.getLastError=function(){return this._lastError},e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[{type:v.Router},{type:s.BsModalService}]},e}(),se=new y.InjectionToken("app.locations"),ae=[{privilege:"Location",target:{url:"^/auth/"},mask:1},{privilege:"Location",target:{url:"^/error"},mask:1}],ce=function(){function e(e,t,n,r,i){if(this._router=e,this._locations=t,this._errorService=n,this._configurationService=r,this._userService=i,this._configurationService.settings&&this._configurationService.settings.auth){var o=this._configurationService.settings.auth.locations;Array.isArray(o)&&this._locations&&this._locations.unshift.apply(this._locations,o)}this._locations.forEach(function(e){"undefined"!=typeof e.target.pattern&&null!==e.target.pattern||(e.target.pattern=new RegExp(e.target.url,"i"))})}return e.prototype.canActivateLocation=function(t,n){var r=[];return n&&n.groups&&(r=n.groups.map(function(e){return e.name})),this._locations.find(function(e){return e.target.pattern.test(t)&&("undefined"==typeof e.account||0<=r.indexOf(e.account.name))&&(0===e.mask||1==(1&e.mask))&&n})},e.prototype.canActivate=function(e,t){return this._canActivate(t)},e.prototype.canActivateChild=function(e,t){return this._canActivate(t)},e.prototype._canActivate=function(r){var i=this;return new p.Observable(function(n){i._userService.getUser().then(function(e){var t=i.canActivateLocation(r.url,e);return t&&"undefined"==typeof t.account?n.next(!0):e?t&&1==(1&t.mask)?n.next(!0):(t&&t.redirectTo?i._router.navigate([t.redirectTo]):i._router.navigate(["/error/403.1"],{queryParams:{action:"Error.LoginAsDiffrentUser","continue":"/auth/loginAs"}}),n.next(!1)):(i._router.navigate(["/auth/login"],{queryParams:{"continue":r.url}}),n.next(!1))})})},e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[{type:v.Router},{type:Array,decorators:[{type:y.Inject,args:[se]}]},{type:oe},{type:N},{type:ne}]},e}(),ue=function(){function e(e,t,n,r){this.activateUser=e,this.view=t,this.authGuard=n,this.template=r}return e.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},Object.defineProperty(e.prototype,"assign",{set:function(e){e&&Object.assign(this,{$implicit:e})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.$implicit},set:function(e){this.$implicit=e},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var n=this;this.subscription=this.activateUser.user.subscribe(function(e){var t=n.authGuard.canActivateLocation(n.$implicit,e);0==(1&(t&&t.mask))?n.view.clear():n.view.createEmbeddedView(n.template)})},e.decorators=[{type:y.Directive,args:[{selector:"[if-location]"}]}],e.ctorParameters=function(){return[{type:re},{type:y.ViewContainerRef},{type:ce},{type:y.TemplateRef}]},e.propDecorators={assign:[{type:y.Input,args:["if-location"]}]},e}(),le=function(){function e(e){this.context=e}return e.prototype.getStatus=function(){return this.context.getService().execute({method:"GET",url:"diagnostics/status",headers:{},data:null})},e.prototype.getServices=function(){return C(this,void 0,void 0,function(){var t;return A(this,function(e){switch(e.label){case 0:return this._services?[2,this._services]:[4,this.context.getService().execute({method:"GET",url:"diagnostics/services",headers:{},data:null})];case 1:return t=e.sent(),[2,this._services=t]}})})},e.prototype.refresh=function(){delete this._services},e.prototype.hasService=function(t){return C(this,void 0,void 0,function(){return A(this,function(e){switch(e.label){case 0:return[4,this.getServices()];case 1:return[2,-1<e.sent().findIndex(function(e){return e.serviceType===t})]}})})},e.prototype.hasStrategy=function(t,n){return C(this,void 0,void 0,function(){return A(this,function(e){switch(e.label){case 0:return[4,this.getServices()];case 1:return[2,-1<e.sent().findIndex(function(e){return e.serviceType===t&&e.strategyType===n})]}})})},e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[{type:m.AngularDataContext}]},e}(),pe=function(){function e(e,t,n){this.view=e,this.template=t,this.diagnosticsService=n}return e.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},Object.defineProperty(e.prototype,"assign",{set:function(e){e&&Object.assign(this,{$implicit:e})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.$implicit},set:function(e){this.$implicit=e},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var t=this;this.diagnosticsService.hasService(this.$implicit).then(function(e){1==e?t.view.createEmbeddedView(t.template):t.view.clear()})},e.decorators=[{type:y.Directive,args:[{selector:"[if-service]"}]}],e.ctorParameters=function(){return[{type:y.ViewContainerRef},{type:y.TemplateRef},{type:le}]},e.propDecorators={assign:[{type:y.Input,args:["if-service"]}]},e}(),de=function(){function e(e){this.translateService=e}return e.prototype.transform=function(e,t){return e.locale&&e.locale.inLanguage==this.translateService.currentLang&&e.locale[t]?e.locale[t]:e[t]||undefined},e.decorators=[{type:y.Pipe,args:[{name:"localize",pure:!0}]}],e.ctorParameters=function(){return[{type:w.TranslateService}]},e}(),he=function(){function e(e){this.context=e}return e.prototype.hasUserStorage=function(){return C(this,void 0,void 0,function(){var t;return A(this,function(e){switch(e.label){case 0:return null!=this._hasUserStorage?[3,2]:[4,this.context.getService().execute({method:"GET",url:"diagnostics/services",headers:{},data:null})];case 1:if(t=e.sent(),Array.isArray(t))return this._hasUserStorage=null!=t.find(function(e){return"UserStorageService"===e.serviceType}),[2,this._hasUserStorage];this._hasUserStorage=!1,e.label=2;case 2:return[2,this._hasUserStorage]}})})},e.prototype.getItem=function(t){return C(this,void 0,void 0,function(){return A(this,function(e){switch(e.label){case 0:return[4,this.hasUserStorage()];case 1:if(!e.sent())throw new Error("API server configuration does not support user storage service.");return[4,this.context.getService().execute({method:"POST",url:"users/me/storage/get",headers:{},data:{key:t}})];case 2:return[2,e.sent()]}})})},e.prototype.setItem=function(t,n){return C(this,void 0,void 0,function(){return A(this,function(e){switch(e.label){case 0:return[4,this.hasUserStorage()];case 1:if(!e.sent())throw new Error("API server configuration does not support user storage service.");return[4,this.context.getService().execute({method:"POST",url:"users/me/storage/set",headers:{},data:{key:t,value:n}})];case 2:return[2,e.sent()]}})})},e.prototype.removeItem=function(t){return C(this,void 0,void 0,function(){return A(this,function(e){switch(e.label){case 0:return[4,this.hasUserStorage()];case 1:if(!e.sent())throw new Error("API server configuration does not support user storage service.");return[4,this.context.getService().execute({method:"POST",url:"users/me/storage/set",headers:{},data:{key:t,value:null}})];case 2:return[2,e.sent()]}})})},e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[{type:m.AngularDataContext}]},e}(),fe=function(){function e(){this.maxItems=10,this.list=[],this.userActivityEntries$=new p.BehaviorSubject([])}return e.prototype.setItem=function(i){return C(this,void 0,void 0,function(){var t,n,r;return A(this,function(e){if(!i)throw new Error("Entry may not be null");if(!i.url)throw new Error("Entry URL may not be empty");return(t=R(this.list)).unshift(i),n=c.uniqBy(t,function(e){return e.url}),r=c.slice(n,0,this.maxItems),this.list=r,this.userActivityEntries$&&this.userActivityEntries$.next(r),[2]})})},e.prototype.getItems=function(){return C(this,void 0,void 0,function(){return A(this,function(e){return[2,this.list]})})},e.prototype.getItemsAsObservable=function(){return C(this,void 0,void 0,function(){return A(this,function(e){return[2,this.userActivityEntries$.asObservable()]})})},e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[]},e}(),ge=function(r){function e(){var e=r.call(this)||this,t=sessionStorage.getItem("userActivity");if(t){var n=JSON.parse(t);e.list=n.map(function(e){return k({},e,{dateCreated:new Date(e.dateCreated)})})}return e}return E(e,r),e.prototype.setItem=function(e){var t=this;return r.prototype.setItem.call(this,e).then(function(){sessionStorage.setItem("userActivity",JSON.stringify(t.list))})},e}(fe),me=function(n){function e(e){var t=n.call(this)||this;return t.userStorage=e,t.initialized=!1,t}return E(e,n),e.prototype.initialize=function(){return C(this,void 0,void 0,function(){var t;return A(this,function(e){switch(e.label){case 0:return[4,this.userStorage.hasUserStorage()];case 1:if(!e.sent())throw new Error("UserStorage is not found.");return[4,this.userStorage.getItem("registrar/userActivity")];case 2:return(t=e.sent())&&t.value&&(this.list=t.value,this.userActivityEntries$.next(this.list),this.initialized=!0),[2]}})})},e.prototype.setItem=function(e){var t=this;return this.isInitialized()?n.prototype.setItem.call(this,e).then(function(){return t.userStorage.setItem("registrar/userActivity",t.list)}):this.initialize().then(function(){return n.prototype.setItem.call(t,e).then(function(){return t.userStorage.setItem("registrar/userActivity",t.list)})})},e.prototype.getItems=function(){return C(this,void 0,void 0,function(){return A(this,function(e){switch(e.label){case 0:return this.isInitialized()?[3,2]:[4,this.initialize()];case 1:e.sent(),e.label=2;case 2:return[2,this.list]}})})},e.prototype.isInitialized=function(){return this.initialized},e.prototype.getItemsAsObservable=function(){return C(this,void 0,void 0,function(){return A(this,function(e){switch(e.label){case 0:return this.isInitialized()?[3,2]:[4,this.initialize()];case 1:e.sent(),e.label=2;case 2:return[2,this.userActivityEntries$.asObservable()]}})})},e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[{type:he}]},e}(fe),ve=function(){function e(){this.requestTypes=[]}return e.prototype.add=function(e){f.Args.notNull(e,"RequestTypeItem"),f.Args.notNull(e.name,"RequestTypeItem name"),f.Args.notNull(e.alternateName,"RequestTypeItem alternateName"),f.Args.notNull(e.category,"RequestTypeItem category"),f.Args.notNull(e.entryPoint,"RequestTypeItem entryPoint");var t=new RegExp("^"+e.alternateName+"$","ig");this.requestTypes.some(function(e){return t.test(e.alternateName)})||this.requestTypes.push(e)},e.prototype.addRange=function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{for(var i=T(n),o=i.next();!o.done;o=i.next()){var s=o.value;this.add(s)}}catch(a){e={error:a}}finally{try{o&&!o.done&&(t=i["return"])&&t.call(i)}finally{if(e)throw e.error}}},e.prototype.remove=function(e){f.Args.notNull(e,"RequestTypeItem");var t=new RegExp("^"+e.alternateName+"$","ig"),n=this.requestTypes.findIndex(function(e){return t.test(e.alternateName)});return n<0?null:this.requestTypes.splice(n,1)[0]},e.prototype.removeByName=function(e){var t=new RegExp("^"+e+"$","ig"),n=this.requestTypes.find(function(e){return t.test(e.alternateName)});return n?this.remove(n):null},e.prototype.getItems=function(){return R(this.requestTypes)},e.decorators=[{type:y.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[]},e.ngInjectableDef=y.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}(),ye=new y.InjectionToken("app.sidebar.locations"),be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return E(t,e),t.prototype.checkNoChanges=function(){},t.prototype.detach=function(){},t.prototype.detectChanges=function(){},t.prototype.markForCheck=function(){},t.prototype.reattach=function(){},t}(y.ChangeDetectorRef),Se=function(){function e(e,t){this._translateService=e,this.sidebarLocations=t,this.navigationItems=[],this._changeDetector=new be}return e.prototype.loadConfig=function(){var n=this;return new Promise(function(e,t){return n.addRange(n.sidebarLocations),e()})},e.prototype.add=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=new w.TranslatePipe(this._translateService,this._changeDetector);this.navigationItems.push.apply(this.navigationItems,e.map(function(e){var t=Object.assign(e,{name:n.transform(e.key)});return Array.isArray(t.children)&&(t.children=t.children.map(function(e){return Object.assign(e,{name:n.transform(e.key)})})),t}))},e.prototype.addRange=function(e){return this.add.apply(this,e)},e.prototype.remove=function(t){var e=this.navigationItems.findIndex(function(e){return e.name===t.name||e.url===t.url||e.key===t.key});-1!==e&&this.navigationItems.splice(e,1)},e.prototype.removeRange=function(e){var t,n;try{for(var r=T(e),i=r.next();!i.done;i=r.next()){var o=i.value;this.remove(o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.addChild=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=new w.TranslatePipe(this._translateService,this._changeDetector),i=e.map(function(e){var t=Object.assign(e,{name:r.transform(e.key)});return Array.isArray(t.children)&&(t.children=t.children.map(function(e){return Object.assign(e,{name:r.transform(e.key)})})),t}),o=this.navigationItems.findIndex(function(e){return e.name===t.name||e.url===t.url||e.key===t.key});if(o){var s=this.navigationItems[o],a=s.children||[];a.push.apply(a,i),s.children=a,this.navigationItems.splice(o,1,s)}},e.prototype.addChildren=function(e,t){return this.addChild.apply(this,R([e],t))},e.decorators=[{type:y.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:w.TranslateService},{type:Array,decorators:[{type:y.Inject,args:[ye]}]}]},e.ngInjectableDef=y.defineInjectable({factory:function(){return new e(y.inject(w.TranslateService),y.inject(ye))},token:e,providedIn:"root"}),e}(),we=new y.InjectionToken("app.guest-sidebar.locations"),Ie=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return E(t,e),t.prototype.checkNoChanges=function(){},t.prototype.detach=function(){},t.prototype.detectChanges=function(){},t.prototype.markForCheck=function(){},t.prototype.reattach=function(){},t}(y.ChangeDetectorRef),xe=function(){function e(e,t){this._translateService=e,this.sidebarLocations=t,this.navigationItems=[],this._changeDetector=new Ie}return e.prototype.loadConfig=function(){var n=this;return new Promise(function(e,t){return n.addRange(n.sidebarLocations),e()})},e.prototype.add=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=new w.TranslatePipe(this._translateService,this._changeDetector);this.navigationItems.push.apply(this.navigationItems,e.map(function(e){var t=Object.assign(e,{name:n.transform(e.key)});return Array.isArray(t.children)&&(t.children=t.children.map(function(e){return Object.assign(e,{name:n.transform(e.key)})})),t}))},e.prototype.addRange=function(e){return this.add.apply(this,e)},e.prototype.remove=function(t){var e=this.navigationItems.findIndex(function(e){return e.name===t.name||e.url===t.url||e.key===t.key});-1!==e&&this.navigationItems.splice(e,1)},e.prototype.removeRange=function(e){var t,n;try{for(var r=T(e),i=r.next();!i.done;i=r.next()){var o=i.value;this.remove(o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.addChild=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=new w.TranslatePipe(this._translateService,this._changeDetector),i=e.map(function(e){var t=Object.assign(e,{name:r.transform(e.key)});return Array.isArray(t.children)&&(t.children=t.children.map(function(e){return Object.assign(e,{name:r.transform(e.key)})})),t}),o=this.navigationItems.findIndex(function(e){return e.name===t.name||e.url===t.url||e.key===t.key});if(o){var s=this.navigationItems[o],a=s.children||[];a.push.apply(a,i),s.children=a,this.navigationItems.splice(o,1,s)}},e.prototype.addChildren=function(e,t){return this.addChild.apply(this,R([e],t))},e.decorators=[{type:y.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:w.TranslateService},{type:Array,decorators:[{type:y.Inject,args:[we]}]}]},e.ngInjectableDef=y.defineInjectable({factory:function(){return new e(y.inject(w.TranslateService),y.inject(we))},token:e,providedIn:"root"}),e}(),_e=function(){function e(e){this.context=e}return e.prototype.hasUserStorage=function(){return!!localStorage},e.prototype.getItem=function(o){return C(this,void 0,void 0,function(){var t,n,r,i;return A(this,function(e){switch(e.label){case 0:return t=localStorage.getItem("userLocalStorage"),n={},t&&(n=JSON.parse(t)),r=o.replace(/\//g,"."),i={key:o},[4,c.get(n,r,null)];case 1:return[2,(i.value=e.sent(),i)]}})})},e.prototype.setItem=function(s,a){return C(this,void 0,void 0,function(){var t,n,r,i,o;return A(this,function(e){switch(e.label){case 0:return[4,localStorage.getItem("userLocalStorage")];case 1:return t=e.sent(),n={},t&&(n=JSON.parse(t)),r=s.replace(/\//g,"."),(i=c.has(n,r))?(o=a,[4,this.getItem(r)]):[3,3];case 2:i=o===e.sent().value,e.label=3;case 3:return i?[2]:(c.set(n,r,a),[4,localStorage.setItem("userLocalStorage",JSON.stringify(n))]);case 4:return e.sent(),[2]}})})},e.prototype.removeItem=function(i){return C(this,void 0,void 0,function(){var t,n,r;return A(this,function(e){return t=localStorage.getItem("userLocalStorage"),n={},t&&(n=JSON.parse(t)),r=i.replace(/\//g,"."),c.has(n,r)?c.unset(n,r)?(localStorage.setItem("userLocalStorage",JSON.stringify(n)),[2,Promise.resolve()]):[2,Promise.reject("Key could not be removed")]:[2,Promise.reject("Key was not found in the object")]})})},e.decorators=[{type:y.Injectable}],e.ctorParameters=function(){return[{type:m.AngularDataContext}]},e}(),Ee=function(){function e(e){this.context=e}return e.prototype.getItem=function(o){return C(this,void 0,void 0,function(){var t,n,r,i;return A(this,function(e){switch(e.label){case 0:return t=sessionStorage.getItem("userSessionStorage"),n={},t&&(n=JSON.parse(t)),r=o.replace(/\//g,"."),i={key:o},[4,c.get(n,r,null)];case 1:return[2,(i.value=e.sent(),i)]}})})},e.prototype.setItem=function(s,a){return C(this,void 0,void 0,function(){var t,n,r,i,o;return A(this,function(e){switch(e.label){case 0:return t=sessionStorage.getItem("userSessionStorage"),n={},t&&(n=JSON.parse(t)),r=s.replace(/\//g,"."),(i=c.has(n,r))?(o=a,[4,this.getItem(r)]):[3,2];case 1:i=o===e.sent().value,e.label=2;case 2:return i?[2]:(c.set(n,r,a),[4,sessionStorage.setItem("userSessionStorage",JSON.stringify(n))]);case 3:return e.sent(),[2]}})})},e.prototype.removeItem=function(i){return C(this,void 0,void 0,function(){var t,n,r;return A(thi