@sunbird-cb/utils 1.0.9 → 1.0.12
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.
- package/bundles/sunbird-cb-utils.umd.js +1546 -1545
- package/bundles/sunbird-cb-utils.umd.js.map +1 -1
- package/bundles/sunbird-cb-utils.umd.min.js +2 -2
- package/bundles/sunbird-cb-utils.umd.min.js.map +1 -1
- package/esm2015/lib/helpers/logout/logout.component.js +8 -8
- package/esm2015/lib/services/auth-keycloak.service.js +12 -1
- package/esm2015/lib/services/configurations.model.js +1 -12
- package/esm5/lib/helpers/logout/logout.component.js +8 -8
- package/esm5/lib/services/auth-keycloak.service.js +14 -2
- package/esm5/lib/services/configurations.model.js +1 -12
- package/fesm2015/sunbird-cb-utils.js +1131 -1131
- package/fesm2015/sunbird-cb-utils.js.map +1 -1
- package/fesm5/sunbird-cb-utils.js +1547 -1546
- package/fesm5/sunbird-cb-utils.js.map +1 -1
- package/lib/helpers/logout/logout.component.d.ts +3 -3
- package/lib/services/configurations.model.d.ts +0 -9
- package/package.json +1 -1
- package/sunbird-cb-utils.metadata.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/dialog'), require('@angular/material/snack-bar'), require('rxjs'), require('@angular/cdk/layout'), require('rxjs/operators'), require('@angular/common'), require('@angular/material'), require('ngx-image-cropper'), require('@angular/
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@sunbird-cb/utils', ['exports', '@angular/core', '@angular/material/dialog', '@angular/material/snack-bar', 'rxjs', '@angular/cdk/layout', 'rxjs/operators', '@angular/common', '@angular/material', 'ngx-image-cropper', '@angular/
|
|
4
|
-
(global = global || self, factory((global['sunbird-cb'] = global['sunbird-cb'] || {}, global['sunbird-cb'].utils = {}), global.ng.core, global.ng.material.dialog, global.ng.material['snack-bar'], global.rxjs, global.ng.cdk.layout, global.rxjs.operators, global.ng.common, global.ng.material, global.ngxImageCropper, global.ng.
|
|
5
|
-
}(this, (function (exports, core, dialog, snackBar, rxjs, layout, operators, common, material, ngxImageCropper,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/dialog'), require('@angular/material/snack-bar'), require('rxjs'), require('@angular/cdk/layout'), require('rxjs/operators'), require('@angular/common'), require('@angular/material'), require('ngx-image-cropper'), require('@angular/common/http'), require('keycloak-angular'), require('@angular/cdk/platform'), require('@angular/router'), require('moment'), require('lodash'), require('@angular/platform-browser')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@sunbird-cb/utils', ['exports', '@angular/core', '@angular/material/dialog', '@angular/material/snack-bar', 'rxjs', '@angular/cdk/layout', 'rxjs/operators', '@angular/common', '@angular/material', 'ngx-image-cropper', '@angular/common/http', 'keycloak-angular', '@angular/cdk/platform', '@angular/router', 'moment', 'lodash', '@angular/platform-browser'], factory) :
|
|
4
|
+
(global = global || self, factory((global['sunbird-cb'] = global['sunbird-cb'] || {}, global['sunbird-cb'].utils = {}), global.ng.core, global.ng.material.dialog, global.ng.material['snack-bar'], global.rxjs, global.ng.cdk.layout, global.rxjs.operators, global.ng.common, global.ng.material, global.ngxImageCropper, global.ng.common.http, global['keycloak-angular'], global.ng.cdk.platform, global.ng.router, global.moment, global._, global.ng.platformBrowser));
|
|
5
|
+
}(this, (function (exports, core, dialog, snackBar, rxjs, layout, operators, common, material, ngxImageCropper, http, keycloakAngular, platform, router, moment, _, platformBrowser) { 'use strict';
|
|
6
6
|
|
|
7
7
|
moment = moment && moment.hasOwnProperty('default') ? moment['default'] : moment;
|
|
8
8
|
var ___default = 'default' in _ ? _['default'] : _;
|
|
@@ -1696,1771 +1696,1783 @@
|
|
|
1696
1696
|
return HorizontalScrollerModule;
|
|
1697
1697
|
}());
|
|
1698
1698
|
|
|
1699
|
-
function
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
IRecursiveData.prototype.identifier;
|
|
1708
|
-
IRecursiveData.prototype.children;
|
|
1709
|
-
}
|
|
1710
|
-
var UtilityService = (function () {
|
|
1711
|
-
function UtilityService(http, platform, router$1, route) {
|
|
1712
|
-
var _this = this;
|
|
1713
|
-
this.http = http;
|
|
1714
|
-
this.platform = platform;
|
|
1715
|
-
this.router = router$1;
|
|
1716
|
-
this.route = route;
|
|
1717
|
-
this.currentRouteData = [];
|
|
1718
|
-
this.router.events.subscribe((function (event) {
|
|
1719
|
-
if (event instanceof router.NavigationEnd) {
|
|
1720
|
-
var snapshot = _this.route.snapshot;
|
|
1721
|
-
var firstChild = snapshot.root.firstChild;
|
|
1722
|
-
_this.getChildRouteData(snapshot, firstChild);
|
|
1723
|
-
}
|
|
1724
|
-
}));
|
|
1699
|
+
var LoggerService = (function () {
|
|
1700
|
+
function LoggerService(configSvc) {
|
|
1701
|
+
this.configSvc = configSvc;
|
|
1702
|
+
this.consoleError = console.error;
|
|
1703
|
+
this.consoleInfo = console.info;
|
|
1704
|
+
this.consoleLog = console.log;
|
|
1705
|
+
this.consoleWarn = console.warn;
|
|
1706
|
+
this.noConsole = (function () { });
|
|
1725
1707
|
}
|
|
1726
|
-
|
|
1727
|
-
if (firstChild) {
|
|
1728
|
-
if (firstChild.data) {
|
|
1729
|
-
this.currentRouteData.push(firstChild.data);
|
|
1730
|
-
}
|
|
1731
|
-
if (firstChild.firstChild) {
|
|
1732
|
-
this.getChildRouteData(snapshot, firstChild.firstChild);
|
|
1733
|
-
}
|
|
1734
|
-
}
|
|
1735
|
-
};
|
|
1736
|
-
Object.defineProperty(UtilityService.prototype, "randomId", {
|
|
1737
|
-
get: function () {
|
|
1738
|
-
return RANDOM_ID_PER_USER + 1;
|
|
1739
|
-
},
|
|
1740
|
-
enumerable: true,
|
|
1741
|
-
configurable: true
|
|
1742
|
-
});
|
|
1743
|
-
UtilityService.prototype.getJson = function (url) {
|
|
1744
|
-
return this.http.get(url);
|
|
1745
|
-
};
|
|
1746
|
-
UtilityService.prototype.getLeafNodes = function (node, nodes) {
|
|
1747
|
-
var _this = this;
|
|
1748
|
-
if ((node.children || []).length === 0) {
|
|
1749
|
-
nodes.push(node);
|
|
1750
|
-
}
|
|
1751
|
-
else {
|
|
1752
|
-
if (node.children) {
|
|
1753
|
-
node.children.forEach((function (child) {
|
|
1754
|
-
_this.getLeafNodes(child, nodes);
|
|
1755
|
-
}));
|
|
1756
|
-
}
|
|
1757
|
-
}
|
|
1758
|
-
return nodes;
|
|
1759
|
-
};
|
|
1760
|
-
UtilityService.prototype.getPath = function (node, id) {
|
|
1761
|
-
var path = [];
|
|
1762
|
-
this.hasPath(node, path, id);
|
|
1763
|
-
return path;
|
|
1764
|
-
};
|
|
1765
|
-
UtilityService.prototype.hasPath = function (node, pathArr, id) {
|
|
1766
|
-
var _this = this;
|
|
1767
|
-
if (node == null) {
|
|
1768
|
-
return false;
|
|
1769
|
-
}
|
|
1770
|
-
pathArr.push(node);
|
|
1771
|
-
if (node.identifier === id) {
|
|
1772
|
-
return true;
|
|
1773
|
-
}
|
|
1774
|
-
var children = node.children || [];
|
|
1775
|
-
if (children.some((function (u) { return _this.hasPath(u, pathArr, id); }))) {
|
|
1776
|
-
return true;
|
|
1777
|
-
}
|
|
1778
|
-
pathArr.pop();
|
|
1779
|
-
return false;
|
|
1780
|
-
};
|
|
1781
|
-
Object.defineProperty(UtilityService.prototype, "isMobile", {
|
|
1782
|
-
get: function () {
|
|
1783
|
-
if (this.isIos || this.isAndroid) {
|
|
1784
|
-
return true;
|
|
1785
|
-
}
|
|
1786
|
-
return false;
|
|
1787
|
-
},
|
|
1788
|
-
enumerable: true,
|
|
1789
|
-
configurable: true
|
|
1790
|
-
});
|
|
1791
|
-
Object.defineProperty(UtilityService.prototype, "isIos", {
|
|
1708
|
+
Object.defineProperty(LoggerService.prototype, "error", {
|
|
1792
1709
|
get: function () {
|
|
1793
|
-
return this.
|
|
1710
|
+
return this.consoleError;
|
|
1794
1711
|
},
|
|
1795
1712
|
enumerable: true,
|
|
1796
1713
|
configurable: true
|
|
1797
1714
|
});
|
|
1798
|
-
Object.defineProperty(
|
|
1715
|
+
Object.defineProperty(LoggerService.prototype, "info", {
|
|
1799
1716
|
get: function () {
|
|
1800
|
-
return this.
|
|
1717
|
+
return this.configSvc.isProduction ? this.noConsole : this.consoleInfo;
|
|
1801
1718
|
},
|
|
1802
1719
|
enumerable: true,
|
|
1803
1720
|
configurable: true
|
|
1804
1721
|
});
|
|
1805
|
-
Object.defineProperty(
|
|
1722
|
+
Object.defineProperty(LoggerService.prototype, "log", {
|
|
1806
1723
|
get: function () {
|
|
1807
|
-
return
|
|
1724
|
+
return this.configSvc.isProduction ? this.noConsole : this.consoleLog;
|
|
1808
1725
|
},
|
|
1809
1726
|
enumerable: true,
|
|
1810
1727
|
configurable: true
|
|
1811
1728
|
});
|
|
1812
|
-
Object.defineProperty(
|
|
1729
|
+
Object.defineProperty(LoggerService.prototype, "warn", {
|
|
1813
1730
|
get: function () {
|
|
1814
|
-
|
|
1815
|
-
window.webkit.messageHandlers &&
|
|
1816
|
-
window.webkit.messageHandlers.appRef) {
|
|
1817
|
-
return window.webkit.messageHandlers.appRef;
|
|
1818
|
-
}
|
|
1819
|
-
return null;
|
|
1731
|
+
return this.configSvc.isProduction ? this.noConsole : this.consoleWarn;
|
|
1820
1732
|
},
|
|
1821
1733
|
enumerable: true,
|
|
1822
1734
|
configurable: true
|
|
1823
1735
|
});
|
|
1824
|
-
|
|
1825
|
-
this.
|
|
1736
|
+
LoggerService.prototype.removeConsoleAccess = function () {
|
|
1737
|
+
if (this.configSvc.isProduction) {
|
|
1738
|
+
return;
|
|
1739
|
+
}
|
|
1740
|
+
var noConsoleWithError = (function () {
|
|
1741
|
+
throw new Error('Console Functions Usage Are Not Allowed.');
|
|
1742
|
+
});
|
|
1743
|
+
console.warn = noConsoleWithError;
|
|
1744
|
+
console.info = noConsoleWithError;
|
|
1745
|
+
console.error = noConsoleWithError;
|
|
1826
1746
|
};
|
|
1827
|
-
|
|
1828
|
-
get: function () {
|
|
1829
|
-
var data = {
|
|
1830
|
-
module: '',
|
|
1831
|
-
pageId: '',
|
|
1832
|
-
};
|
|
1833
|
-
this.currentRouteData.map((function (rd) {
|
|
1834
|
-
if (rd.pageId) {
|
|
1835
|
-
data.pageId = data.pageId + "/" + rd.pageId;
|
|
1836
|
-
}
|
|
1837
|
-
if (rd.module) {
|
|
1838
|
-
data.module = rd.module;
|
|
1839
|
-
}
|
|
1840
|
-
}));
|
|
1841
|
-
return data;
|
|
1842
|
-
},
|
|
1843
|
-
enumerable: true,
|
|
1844
|
-
configurable: true
|
|
1845
|
-
});
|
|
1846
|
-
UtilityService.decorators = [
|
|
1747
|
+
LoggerService.decorators = [
|
|
1847
1748
|
{ type: core.Injectable, args: [{
|
|
1848
1749
|
providedIn: 'root',
|
|
1849
1750
|
},] }
|
|
1850
1751
|
];
|
|
1851
|
-
|
|
1852
|
-
{ type:
|
|
1853
|
-
{ type: platform.Platform },
|
|
1854
|
-
{ type: router.Router },
|
|
1855
|
-
{ type: router.ActivatedRoute }
|
|
1752
|
+
LoggerService.ctorParameters = function () { return [
|
|
1753
|
+
{ type: ConfigurationsService }
|
|
1856
1754
|
]; };
|
|
1857
|
-
/** @nocollapse */
|
|
1858
|
-
return
|
|
1755
|
+
/** @nocollapse */ LoggerService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function LoggerService_Factory() { return new LoggerService(core.ɵɵinject(ConfigurationsService)); }, token: LoggerService, providedIn: "root" });
|
|
1756
|
+
return LoggerService;
|
|
1859
1757
|
}());
|
|
1860
1758
|
if (false) {
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1759
|
+
LoggerService.prototype.consoleError;
|
|
1760
|
+
LoggerService.prototype.consoleInfo;
|
|
1761
|
+
LoggerService.prototype.consoleLog;
|
|
1762
|
+
LoggerService.prototype.consoleWarn;
|
|
1763
|
+
LoggerService.prototype.noConsole;
|
|
1764
|
+
LoggerService.prototype.configSvc;
|
|
1866
1765
|
}
|
|
1867
1766
|
|
|
1868
|
-
var
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
this.
|
|
1767
|
+
var msTokenExpiryDuration = 600;
|
|
1768
|
+
var storageKey = 'msLoginRequested';
|
|
1769
|
+
var storage = localStorage;
|
|
1770
|
+
var API_ENDPOINTS = {
|
|
1771
|
+
sharePointToken: '/apis/protected/v8/user/token',
|
|
1772
|
+
};
|
|
1773
|
+
var AuthMicrosoftService = (function () {
|
|
1774
|
+
function AuthMicrosoftService(loggerSvc, http) {
|
|
1775
|
+
this.loggerSvc = loggerSvc;
|
|
1776
|
+
this.http = http;
|
|
1777
|
+
this.msConfig = {
|
|
1778
|
+
clientId: '',
|
|
1779
|
+
tenant: '',
|
|
1780
|
+
defaultEmailId: '',
|
|
1781
|
+
validEmailExtensions: [],
|
|
1782
|
+
isConfigured: false,
|
|
1783
|
+
};
|
|
1784
|
+
this.emailUsed = null;
|
|
1785
|
+
this.code = null;
|
|
1786
|
+
this.msToken = {
|
|
1787
|
+
accessToken: '',
|
|
1788
|
+
expiresOn: '',
|
|
1789
|
+
resource: '',
|
|
1790
|
+
tokenType: '',
|
|
1791
|
+
};
|
|
1877
1792
|
}
|
|
1878
|
-
|
|
1879
|
-
if (this.configSvc.restrictedFeatures) {
|
|
1880
|
-
this.isDownloadableIos = !this.configSvc.restrictedFeatures.has('iosDownload');
|
|
1881
|
-
this.isDownloadableAndroid = !this.configSvc.restrictedFeatures.has('androidDownload');
|
|
1882
|
-
}
|
|
1883
|
-
};
|
|
1884
|
-
LogoutComponent.prototype.confirmed = function () {
|
|
1885
|
-
this.disabled = true;
|
|
1886
|
-
this.dialogRef.close();
|
|
1887
|
-
this.router.navigate(['public', 'logout']);
|
|
1888
|
-
};
|
|
1889
|
-
Object.defineProperty(LogoutComponent.prototype, "isDownloadable", {
|
|
1793
|
+
Object.defineProperty(AuthMicrosoftService.prototype, "isLogoutRequired", {
|
|
1890
1794
|
get: function () {
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1795
|
+
return Boolean(this.msConfig.isConfigured && this.msConfig.clientId && this.emailUsed);
|
|
1796
|
+
},
|
|
1797
|
+
enumerable: true,
|
|
1798
|
+
configurable: true
|
|
1799
|
+
});
|
|
1800
|
+
Object.defineProperty(AuthMicrosoftService.prototype, "loginUrl", {
|
|
1801
|
+
get: function () {
|
|
1802
|
+
if (this.msConfig.isConfigured && this.msConfig.clientId) {
|
|
1803
|
+
var base = 'https://login.windows.net/common/oauth2/authorize';
|
|
1804
|
+
var searchParam = new URLSearchParams({
|
|
1805
|
+
response_type: 'code',
|
|
1806
|
+
client_id: this.msConfig.clientId,
|
|
1807
|
+
redirect_uri: window.location.href,
|
|
1808
|
+
});
|
|
1809
|
+
var fragment = location.search.substring(1);
|
|
1810
|
+
if (fragment) {
|
|
1811
|
+
return base + "?" + searchParam.toString() + "#" + fragment;
|
|
1812
|
+
}
|
|
1813
|
+
return base + "?" + searchParam.toString();
|
|
1894
1814
|
}
|
|
1895
|
-
return
|
|
1815
|
+
return null;
|
|
1896
1816
|
},
|
|
1897
1817
|
enumerable: true,
|
|
1898
1818
|
configurable: true
|
|
1899
1819
|
});
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1820
|
+
AuthMicrosoftService.prototype.logoutUrl = function (redirectUrl) {
|
|
1821
|
+
if (this.isValidEmail(this.emailUsed || '')) {
|
|
1822
|
+
return "https://login.microsoftonline.com/common/oauth2/logout?post_logout_redirect_uri=" + redirectUrl;
|
|
1823
|
+
}
|
|
1824
|
+
return redirectUrl;
|
|
1825
|
+
};
|
|
1826
|
+
AuthMicrosoftService.prototype.init = function (config) {
|
|
1827
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1828
|
+
var queryParams, url;
|
|
1829
|
+
return __generator(this, function (_a) {
|
|
1830
|
+
switch (_a.label) {
|
|
1831
|
+
case 0:
|
|
1832
|
+
if (!config || !config.microsoft || !config.microsoft.isConfigured) {
|
|
1833
|
+
this.loggerSvc.warn('Empty/No Configuration passed, ignoring Microsoft Authentication');
|
|
1834
|
+
}
|
|
1835
|
+
this.msConfig = config.microsoft;
|
|
1836
|
+
queryParams = new URLSearchParams(location.search);
|
|
1837
|
+
if (!(queryParams.has('code') && queryParams.has('session_state'))) return [3, 2];
|
|
1838
|
+
this.code = queryParams.get('code');
|
|
1839
|
+
if (!this.code) {
|
|
1840
|
+
return [2];
|
|
1841
|
+
}
|
|
1842
|
+
url = location.origin + location.pathname;
|
|
1843
|
+
return [4, this.exchangeTokenForCode(this.code, url)];
|
|
1844
|
+
case 1:
|
|
1845
|
+
_a.sent();
|
|
1846
|
+
if (location.hash) {
|
|
1847
|
+
url += location.hash.substring(1);
|
|
1848
|
+
}
|
|
1849
|
+
history.replaceState(null, '', url);
|
|
1850
|
+
_a.label = 2;
|
|
1851
|
+
case 2: return [2];
|
|
1852
|
+
}
|
|
1853
|
+
});
|
|
1854
|
+
});
|
|
1855
|
+
};
|
|
1856
|
+
AuthMicrosoftService.prototype.login = function (email) {
|
|
1857
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1858
|
+
var loginUrl;
|
|
1859
|
+
return __generator(this, function (_a) {
|
|
1860
|
+
if (!this.isValidEmail(email)) {
|
|
1861
|
+
this.loggerSvc.warn("Microsoft Login is not allowed for your emailId (" + email + ")");
|
|
1862
|
+
return [2];
|
|
1863
|
+
}
|
|
1864
|
+
loginUrl = this.loginUrl;
|
|
1865
|
+
if (loginUrl) {
|
|
1866
|
+
location.assign(loginUrl);
|
|
1867
|
+
}
|
|
1868
|
+
else {
|
|
1869
|
+
this.loggerSvc.warn('Unable to identify Office Login URL, Ignoring login request');
|
|
1870
|
+
}
|
|
1871
|
+
return [2];
|
|
1872
|
+
});
|
|
1873
|
+
});
|
|
1874
|
+
};
|
|
1875
|
+
AuthMicrosoftService.prototype.getToken = function (email) {
|
|
1876
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1877
|
+
var _a, error_1, _b, error_2;
|
|
1878
|
+
return __generator(this, function (_c) {
|
|
1879
|
+
switch (_c.label) {
|
|
1880
|
+
case 0:
|
|
1881
|
+
if (this.msToken &&
|
|
1882
|
+
this.isValid(this.msToken.accessToken, this.msToken.expiresOn) &&
|
|
1883
|
+
this.msToken.accessToken) {
|
|
1884
|
+
return [2, this.msToken.accessToken];
|
|
1885
|
+
}
|
|
1886
|
+
if (!this.isValidEmail(email)) return [3, 4];
|
|
1887
|
+
_c.label = 1;
|
|
1888
|
+
case 1:
|
|
1889
|
+
_c.trys.push([1, 3, , 4]);
|
|
1890
|
+
_a = this;
|
|
1891
|
+
return [4, this.getTokenForEmail(email)];
|
|
1892
|
+
case 2:
|
|
1893
|
+
_a.msToken = _c.sent();
|
|
1894
|
+
if (this.msToken.accessToken) {
|
|
1895
|
+
this.emailUsed = email;
|
|
1896
|
+
return [2, this.msToken.accessToken];
|
|
1897
|
+
}
|
|
1898
|
+
return [3, 4];
|
|
1899
|
+
case 3:
|
|
1900
|
+
error_1 = _c.sent();
|
|
1901
|
+
if (!this.code) {
|
|
1902
|
+
this.login(email);
|
|
1903
|
+
}
|
|
1904
|
+
return [3, 4];
|
|
1905
|
+
case 4:
|
|
1906
|
+
if (!(this.msConfig.defaultEmailId && this.isValidEmail(this.msConfig.defaultEmailId))) return [3, 8];
|
|
1907
|
+
_c.label = 5;
|
|
1908
|
+
case 5:
|
|
1909
|
+
_c.trys.push([5, 7, , 8]);
|
|
1910
|
+
_b = this;
|
|
1911
|
+
return [4, this.getTokenForEmail(this.msConfig.defaultEmailId)];
|
|
1912
|
+
case 6:
|
|
1913
|
+
_b.msToken = _c.sent();
|
|
1914
|
+
if (this.msToken.accessToken) {
|
|
1915
|
+
this.emailUsed = this.msConfig.defaultEmailId;
|
|
1916
|
+
return [2, this.msToken.accessToken];
|
|
1917
|
+
}
|
|
1918
|
+
return [3, 8];
|
|
1919
|
+
case 7:
|
|
1920
|
+
error_2 = _c.sent();
|
|
1921
|
+
return [3, 8];
|
|
1922
|
+
case 8: throw new Error('UNABLE TO FETCH MS AUTH TOKEN');
|
|
1923
|
+
}
|
|
1924
|
+
});
|
|
1925
|
+
});
|
|
1926
|
+
};
|
|
1927
|
+
AuthMicrosoftService.prototype.loginForSSOEnabledEmbed = function (email) {
|
|
1928
|
+
if (!this.isValidEmail(email)) {
|
|
1929
|
+
this.loggerSvc.warn('SSO Login request Ignored. Invalid Email Id for SSO Enabled Content');
|
|
1930
|
+
}
|
|
1931
|
+
var msPrevTS = 0;
|
|
1952
1932
|
try {
|
|
1953
|
-
|
|
1954
|
-
var prefix = void 0;
|
|
1955
|
-
var suffix = void 0;
|
|
1956
|
-
var fromDate = new Date(dateRange.fromDate);
|
|
1957
|
-
var toDate = new Date(dateRange.toDate);
|
|
1958
|
-
var fromDateObj = {
|
|
1959
|
-
day: fromDate.getDate(),
|
|
1960
|
-
month: fromDate.toLocaleString('default', { month: 'short' }),
|
|
1961
|
-
year: fromDate.getFullYear(),
|
|
1962
|
-
time: fromDate.getTime(),
|
|
1963
|
-
};
|
|
1964
|
-
var toDateObj = {
|
|
1965
|
-
day: toDate.getDate(),
|
|
1966
|
-
month: toDate.toLocaleString('default', { month: 'short' }),
|
|
1967
|
-
year: toDate.getFullYear(),
|
|
1968
|
-
time: toDate.getTime(),
|
|
1969
|
-
};
|
|
1970
|
-
if (fromDateObj.time === toDateObj.time) {
|
|
1971
|
-
conciseRange = fromDateObj.day + " " + fromDateObj.month + " " + fromDateObj.year;
|
|
1972
|
-
return conciseRange;
|
|
1973
|
-
}
|
|
1974
|
-
if (fromDateObj.year !== fromDateObj.year) {
|
|
1975
|
-
prefix = fromDateObj.day + " " + fromDateObj.month + " " + fromDateObj.year;
|
|
1976
|
-
suffix = toDateObj.day + " " + toDateObj.month + " " + toDateObj.year;
|
|
1977
|
-
conciseRange = prefix + " - " + suffix;
|
|
1978
|
-
return conciseRange;
|
|
1979
|
-
}
|
|
1980
|
-
if (fromDateObj.month === toDateObj.month) {
|
|
1981
|
-
prefix = "" + fromDateObj.day;
|
|
1982
|
-
suffix = toDateObj.day + " " + toDateObj.month + " " + toDateObj.year;
|
|
1983
|
-
}
|
|
1984
|
-
else {
|
|
1985
|
-
prefix = fromDateObj.day + " " + fromDateObj.month;
|
|
1986
|
-
suffix = toDateObj.day + " " + toDateObj.month + " " + toDateObj.year;
|
|
1987
|
-
}
|
|
1988
|
-
conciseRange = prefix + " - " + suffix;
|
|
1989
|
-
return conciseRange;
|
|
1933
|
+
msPrevTS = parseInt(storage.getItem(storageKey) || '0', 10);
|
|
1990
1934
|
}
|
|
1991
|
-
catch (
|
|
1992
|
-
|
|
1935
|
+
catch (error) { }
|
|
1936
|
+
if (!msPrevTS || (msPrevTS && (Date.now() - msPrevTS) / 1000 > msTokenExpiryDuration)) {
|
|
1937
|
+
this.loggerSvc.info("last login exceeded " + msTokenExpiryDuration + " duration. Redirecting to O365 login");
|
|
1938
|
+
storage.setItem(storageKey, Date.now().toString());
|
|
1939
|
+
this.login(email);
|
|
1993
1940
|
}
|
|
1994
1941
|
};
|
|
1995
|
-
|
|
1996
|
-
{
|
|
1997
|
-
|
|
1942
|
+
AuthMicrosoftService.prototype.isValidEmail = function (email) {
|
|
1943
|
+
return this.msConfig.validEmailExtensions.some((function (ext) { return email.endsWith(ext); }));
|
|
1944
|
+
};
|
|
1945
|
+
AuthMicrosoftService.prototype.isValid = function (accessToken, expiresOn) {
|
|
1946
|
+
if (accessToken && expiresOn) {
|
|
1947
|
+
return true;
|
|
1948
|
+
}
|
|
1949
|
+
return false;
|
|
1950
|
+
};
|
|
1951
|
+
AuthMicrosoftService.prototype.exchangeTokenForCode = function (code, redirectUrl) {
|
|
1952
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1953
|
+
var response;
|
|
1954
|
+
return __generator(this, function (_a) {
|
|
1955
|
+
switch (_a.label) {
|
|
1956
|
+
case 0: return [4, this.http
|
|
1957
|
+
.get(API_ENDPOINTS + "?code=" + code + "&redirectUrl=" + redirectUrl)
|
|
1958
|
+
.toPromise()];
|
|
1959
|
+
case 1:
|
|
1960
|
+
response = _a.sent();
|
|
1961
|
+
return [2, this.getInstanceFromResponse(response)];
|
|
1962
|
+
}
|
|
1963
|
+
});
|
|
1964
|
+
});
|
|
1965
|
+
};
|
|
1966
|
+
AuthMicrosoftService.prototype.getTokenForEmail = function (email) {
|
|
1967
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1968
|
+
var response;
|
|
1969
|
+
return __generator(this, function (_a) {
|
|
1970
|
+
switch (_a.label) {
|
|
1971
|
+
case 0: return [4, this.http
|
|
1972
|
+
.get(API_ENDPOINTS.sharePointToken + "?email=" + email)
|
|
1973
|
+
.toPromise()];
|
|
1974
|
+
case 1:
|
|
1975
|
+
response = _a.sent();
|
|
1976
|
+
return [2, this.getInstanceFromResponse(response)];
|
|
1977
|
+
}
|
|
1978
|
+
});
|
|
1979
|
+
});
|
|
1980
|
+
};
|
|
1981
|
+
AuthMicrosoftService.prototype.getInstanceFromResponse = function (token) {
|
|
1982
|
+
return {
|
|
1983
|
+
accessToken: token.accessToken,
|
|
1984
|
+
expiresOn: token.expiresOn,
|
|
1985
|
+
resource: token.resource,
|
|
1986
|
+
tokenType: token.tokenType,
|
|
1987
|
+
};
|
|
1988
|
+
};
|
|
1989
|
+
AuthMicrosoftService.decorators = [
|
|
1990
|
+
{ type: core.Injectable, args: [{
|
|
1991
|
+
providedIn: 'root',
|
|
1998
1992
|
},] }
|
|
1999
1993
|
];
|
|
2000
|
-
return
|
|
1994
|
+
AuthMicrosoftService.ctorParameters = function () { return [
|
|
1995
|
+
{ type: LoggerService },
|
|
1996
|
+
{ type: http.HttpClient }
|
|
1997
|
+
]; };
|
|
1998
|
+
/** @nocollapse */ AuthMicrosoftService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function AuthMicrosoftService_Factory() { return new AuthMicrosoftService(core.ɵɵinject(LoggerService), core.ɵɵinject(http.HttpClient)); }, token: AuthMicrosoftService, providedIn: "root" });
|
|
1999
|
+
return AuthMicrosoftService;
|
|
2001
2000
|
}());
|
|
2002
|
-
|
|
2003
|
-
var PipeConciseDateRangeModule = (function () {
|
|
2004
|
-
function PipeConciseDateRangeModule() {
|
|
2005
|
-
}
|
|
2006
|
-
PipeConciseDateRangeModule.decorators = [
|
|
2007
|
-
{ type: core.NgModule, args: [{
|
|
2008
|
-
declarations: [PipeConciseDateRangePipe],
|
|
2009
|
-
imports: [common.CommonModule],
|
|
2010
|
-
exports: [PipeConciseDateRangePipe],
|
|
2011
|
-
},] }
|
|
2012
|
-
];
|
|
2013
|
-
return PipeConciseDateRangeModule;
|
|
2014
|
-
}());
|
|
2015
|
-
|
|
2016
|
-
var PipeCountTransformPipe = (function () {
|
|
2017
|
-
function PipeCountTransformPipe() {
|
|
2018
|
-
}
|
|
2019
|
-
PipeCountTransformPipe.prototype.transform = function (value) {
|
|
2020
|
-
var thousand = 1000;
|
|
2021
|
-
var million = 1000000;
|
|
2022
|
-
if (value > 0) {
|
|
2023
|
-
if (value < thousand) {
|
|
2024
|
-
return String(value);
|
|
2025
|
-
}
|
|
2026
|
-
if (value >= thousand && value < million) {
|
|
2027
|
-
var views = (value / thousand).toFixed(1);
|
|
2028
|
-
if (views.endsWith('0')) {
|
|
2029
|
-
return views.split('.')[0] + "K";
|
|
2030
|
-
}
|
|
2031
|
-
return views + "K";
|
|
2032
|
-
}
|
|
2033
|
-
{
|
|
2034
|
-
var views = (value / million).toFixed(1);
|
|
2035
|
-
if (views.endsWith('0')) {
|
|
2036
|
-
return views.split('.')[0] + "M";
|
|
2037
|
-
}
|
|
2038
|
-
return views + "M";
|
|
2039
|
-
}
|
|
2040
|
-
}
|
|
2041
|
-
return '0';
|
|
2042
|
-
};
|
|
2043
|
-
PipeCountTransformPipe.decorators = [
|
|
2044
|
-
{ type: core.Pipe, args: [{
|
|
2045
|
-
name: 'pipeCountTransform',
|
|
2046
|
-
},] }
|
|
2047
|
-
];
|
|
2048
|
-
return PipeCountTransformPipe;
|
|
2049
|
-
}());
|
|
2050
|
-
|
|
2051
|
-
var PipeCountTransformModule = (function () {
|
|
2052
|
-
function PipeCountTransformModule() {
|
|
2053
|
-
}
|
|
2054
|
-
PipeCountTransformModule.decorators = [
|
|
2055
|
-
{ type: core.NgModule, args: [{
|
|
2056
|
-
declarations: [PipeCountTransformPipe],
|
|
2057
|
-
imports: [
|
|
2058
|
-
common.CommonModule,
|
|
2059
|
-
],
|
|
2060
|
-
exports: [PipeCountTransformPipe],
|
|
2061
|
-
},] }
|
|
2062
|
-
];
|
|
2063
|
-
return PipeCountTransformModule;
|
|
2064
|
-
}());
|
|
2065
|
-
|
|
2066
|
-
function ICertificationDate() { }
|
|
2067
2001
|
if (false) {
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2002
|
+
AuthMicrosoftService.prototype.msConfig;
|
|
2003
|
+
AuthMicrosoftService.prototype.emailUsed;
|
|
2004
|
+
AuthMicrosoftService.prototype.code;
|
|
2005
|
+
AuthMicrosoftService.prototype.msToken;
|
|
2006
|
+
AuthMicrosoftService.prototype.loggerSvc;
|
|
2007
|
+
AuthMicrosoftService.prototype.http;
|
|
2072
2008
|
}
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
this.months = [
|
|
2076
|
-
'Jan',
|
|
2077
|
-
'Feb',
|
|
2078
|
-
'Mar',
|
|
2079
|
-
'Apr',
|
|
2080
|
-
'May',
|
|
2081
|
-
'Jun',
|
|
2082
|
-
'Jul',
|
|
2083
|
-
'Aug',
|
|
2084
|
-
'Sep',
|
|
2085
|
-
'Oct',
|
|
2086
|
-
'Nov',
|
|
2087
|
-
'Dec',
|
|
2088
|
-
];
|
|
2089
|
-
}
|
|
2090
|
-
PipeDateConcatPipe.prototype.transform = function (value) {
|
|
2091
|
-
var dateStr = value.day + " " + this.months[value.month - 1] + " " + value.year;
|
|
2092
|
-
if (value.timeZone) {
|
|
2093
|
-
dateStr += " " + value.timeZone;
|
|
2094
|
-
}
|
|
2095
|
-
return dateStr;
|
|
2096
|
-
};
|
|
2097
|
-
PipeDateConcatPipe.decorators = [
|
|
2098
|
-
{ type: core.Pipe, args: [{
|
|
2099
|
-
name: 'pipeDateConcat',
|
|
2100
|
-
},] }
|
|
2101
|
-
];
|
|
2102
|
-
PipeDateConcatPipe.ctorParameters = function () { return []; };
|
|
2103
|
-
return PipeDateConcatPipe;
|
|
2104
|
-
}());
|
|
2009
|
+
|
|
2010
|
+
function IParsedToken() { }
|
|
2105
2011
|
if (false) {
|
|
2106
|
-
|
|
2012
|
+
IParsedToken.prototype.email;
|
|
2013
|
+
IParsedToken.prototype.encEmail;
|
|
2014
|
+
IParsedToken.prototype.name;
|
|
2015
|
+
IParsedToken.prototype.preferred_username;
|
|
2107
2016
|
}
|
|
2108
|
-
|
|
2109
|
-
var
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2017
|
+
var storage$1 = localStorage;
|
|
2018
|
+
var storageKey$1 = 'kc';
|
|
2019
|
+
var AuthKeycloakService = (function () {
|
|
2020
|
+
function AuthKeycloakService(http, configSvc, keycloakSvc, msAuthSvc) {
|
|
2021
|
+
var _this = this;
|
|
2022
|
+
this.http = http;
|
|
2023
|
+
this.configSvc = configSvc;
|
|
2024
|
+
this.keycloakSvc = keycloakSvc;
|
|
2025
|
+
this.msAuthSvc = msAuthSvc;
|
|
2026
|
+
this.loginChangeSubject = new rxjs.ReplaySubject(1);
|
|
2027
|
+
this.loginChangeSubject.subscribe((function (isLoggedIn) {
|
|
2028
|
+
_this.configSvc.isAuthenticated = isLoggedIn;
|
|
2029
|
+
if (isLoggedIn &&
|
|
2030
|
+
_this.configSvc.instanceConfig &&
|
|
2031
|
+
Boolean(_this.configSvc.instanceConfig.disablePidCheck)) {
|
|
2032
|
+
_this.configSvc.userProfile = {
|
|
2033
|
+
email: _this.userEmail,
|
|
2034
|
+
userName: _this.userName,
|
|
2035
|
+
userId: _this.userId || '',
|
|
2036
|
+
};
|
|
2037
|
+
}
|
|
2038
|
+
}));
|
|
2126
2039
|
}
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
return
|
|
2130
|
-
}
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2040
|
+
Object.defineProperty(AuthKeycloakService.prototype, "isLoggedIn$", {
|
|
2041
|
+
get: function () {
|
|
2042
|
+
return this.loginChangeSubject.asObservable();
|
|
2043
|
+
},
|
|
2044
|
+
enumerable: true,
|
|
2045
|
+
configurable: true
|
|
2046
|
+
});
|
|
2047
|
+
Object.defineProperty(AuthKeycloakService.prototype, "isLoggedIn", {
|
|
2048
|
+
get: function () {
|
|
2049
|
+
return this.keycloakSvc.isLoggedIn();
|
|
2050
|
+
},
|
|
2051
|
+
enumerable: true,
|
|
2052
|
+
configurable: true
|
|
2053
|
+
});
|
|
2054
|
+
Object.defineProperty(AuthKeycloakService.prototype, "isAuthenticated", {
|
|
2055
|
+
get: function () {
|
|
2056
|
+
return this.keycloakSvc.getKeycloakInstance().authenticated;
|
|
2057
|
+
},
|
|
2058
|
+
enumerable: true,
|
|
2059
|
+
configurable: true
|
|
2060
|
+
});
|
|
2061
|
+
Object.defineProperty(AuthKeycloakService.prototype, "token", {
|
|
2062
|
+
get: function () {
|
|
2063
|
+
return this.keycloakSvc.getKeycloakInstance().token;
|
|
2064
|
+
},
|
|
2065
|
+
enumerable: true,
|
|
2066
|
+
configurable: true
|
|
2067
|
+
});
|
|
2068
|
+
Object.defineProperty(AuthKeycloakService.prototype, "sessionId", {
|
|
2069
|
+
get: function () {
|
|
2070
|
+
return this.keycloakSvc.getKeycloakInstance().sessionId;
|
|
2071
|
+
},
|
|
2072
|
+
enumerable: true,
|
|
2073
|
+
configurable: true
|
|
2074
|
+
});
|
|
2075
|
+
Object.defineProperty(AuthKeycloakService.prototype, "userId", {
|
|
2076
|
+
get: function () {
|
|
2077
|
+
var kc = this.keycloakSvc.getKeycloakInstance();
|
|
2078
|
+
if (!kc) {
|
|
2079
|
+
return;
|
|
2080
|
+
}
|
|
2081
|
+
return (kc.tokenParsed && kc.tokenParsed.sub) || (kc.idTokenParsed && kc.idTokenParsed.sub);
|
|
2082
|
+
},
|
|
2083
|
+
enumerable: true,
|
|
2084
|
+
configurable: true
|
|
2085
|
+
});
|
|
2086
|
+
Object.defineProperty(AuthKeycloakService.prototype, "userEmail", {
|
|
2087
|
+
get: function () {
|
|
2088
|
+
var kc = this.keycloakSvc.getKeycloakInstance();
|
|
2089
|
+
var tokenParsed = ((kc.tokenParsed));
|
|
2090
|
+
var idTokenParsed = ((kc.idTokenParsed));
|
|
2091
|
+
return ((tokenParsed && tokenParsed.email) ||
|
|
2092
|
+
(idTokenParsed && idTokenParsed.email) ||
|
|
2093
|
+
(idTokenParsed && idTokenParsed.encEmail) ||
|
|
2094
|
+
(tokenParsed && tokenParsed.preferred_username) ||
|
|
2095
|
+
(idTokenParsed && idTokenParsed.preferred_username));
|
|
2096
|
+
},
|
|
2097
|
+
enumerable: true,
|
|
2098
|
+
configurable: true
|
|
2099
|
+
});
|
|
2100
|
+
Object.defineProperty(AuthKeycloakService.prototype, "userName", {
|
|
2101
|
+
get: function () {
|
|
2102
|
+
var kc = this.keycloakSvc.getKeycloakInstance();
|
|
2103
|
+
return ((kc.tokenParsed && (((kc.tokenParsed))).name) ||
|
|
2104
|
+
(kc.idTokenParsed && (((kc.idTokenParsed))).name));
|
|
2105
|
+
},
|
|
2106
|
+
enumerable: true,
|
|
2107
|
+
configurable: true
|
|
2108
|
+
});
|
|
2109
|
+
AuthKeycloakService.prototype.initAuth = function () {
|
|
2110
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2111
|
+
var instanceConfig, err_1;
|
|
2112
|
+
return __generator(this, function (_a) {
|
|
2113
|
+
switch (_a.label) {
|
|
2114
|
+
case 0:
|
|
2115
|
+
if (!this.configSvc.instanceConfig) {
|
|
2116
|
+
return [2, false];
|
|
2117
|
+
}
|
|
2118
|
+
instanceConfig = this.configSvc.instanceConfig;
|
|
2119
|
+
if (instanceConfig.microsoft.isConfigured) {
|
|
2120
|
+
this.msAuthSvc.init({ microsoft: instanceConfig.microsoft });
|
|
2121
|
+
}
|
|
2122
|
+
_a.label = 1;
|
|
2123
|
+
case 1:
|
|
2124
|
+
_a.trys.push([1, 3, , 4]);
|
|
2125
|
+
this.setupGlobalAuthResponder();
|
|
2126
|
+
this.addKeycloakEventListener();
|
|
2127
|
+
return [4, this.keycloakSvc.init({
|
|
2128
|
+
config: {
|
|
2129
|
+
url: instanceConfig.keycloak.url,
|
|
2130
|
+
realm: instanceConfig.keycloak.realm,
|
|
2131
|
+
clientId: instanceConfig.keycloak.clientId,
|
|
2132
|
+
},
|
|
2133
|
+
initOptions: __assign({}, this.getSavedKcConfig(), { onLoad: instanceConfig.keycloak.onLoad || 'check-sso', checkLoginIframe: false }),
|
|
2134
|
+
enableBearerInterceptor: true,
|
|
2135
|
+
loadUserProfileAtStartUp: false,
|
|
2136
|
+
bearerExcludedUrls: instanceConfig.keycloak.bearerExcludedUrls,
|
|
2137
|
+
})];
|
|
2138
|
+
case 2: return [2, _a.sent()];
|
|
2139
|
+
case 3:
|
|
2140
|
+
err_1 = _a.sent();
|
|
2141
|
+
return [2, false];
|
|
2142
|
+
case 4: return [2];
|
|
2162
2143
|
}
|
|
2163
|
-
|
|
2164
|
-
|
|
2144
|
+
});
|
|
2145
|
+
});
|
|
2146
|
+
};
|
|
2147
|
+
AuthKeycloakService.prototype.login = function (idpHint, redirectUrl) {
|
|
2148
|
+
if (idpHint === void 0) { idpHint = 'E'; }
|
|
2149
|
+
if (redirectUrl === void 0) { redirectUrl = this.defaultRedirectUrl; }
|
|
2150
|
+
return this.keycloakSvc.login({
|
|
2151
|
+
idpHint: idpHint,
|
|
2152
|
+
redirectUri: redirectUrl,
|
|
2153
|
+
});
|
|
2154
|
+
};
|
|
2155
|
+
AuthKeycloakService.prototype.register = function (redirectUrl) {
|
|
2156
|
+
if (redirectUrl === void 0) { redirectUrl = this.defaultRedirectUrl; }
|
|
2157
|
+
return this.keycloakSvc.register({
|
|
2158
|
+
redirectUri: redirectUrl,
|
|
2159
|
+
});
|
|
2160
|
+
};
|
|
2161
|
+
AuthKeycloakService.prototype.logout = function (_redirectUrl) {
|
|
2162
|
+
if (_redirectUrl === void 0) { _redirectUrl = this.defaultRedirectUrl; }
|
|
2163
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2164
|
+
return __generator(this, function (_a) {
|
|
2165
|
+
window.location.href = _redirectUrl + "apis/reset";
|
|
2166
|
+
return [2];
|
|
2167
|
+
});
|
|
2168
|
+
});
|
|
2169
|
+
};
|
|
2170
|
+
AuthKeycloakService.prototype.force_logout = function () {
|
|
2171
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2172
|
+
return __generator(this, function (_a) {
|
|
2173
|
+
switch (_a.label) {
|
|
2174
|
+
case 0:
|
|
2175
|
+
if (storage$1.getItem('telemetrySessionId')) {
|
|
2176
|
+
storage$1.removeItem('telemetrySessionId');
|
|
2177
|
+
}
|
|
2178
|
+
try {
|
|
2179
|
+
sessionStorage.clear();
|
|
2180
|
+
localStorage.clear();
|
|
2181
|
+
}
|
|
2182
|
+
catch (_b) {
|
|
2183
|
+
}
|
|
2184
|
+
storage$1.removeItem(storageKey$1);
|
|
2185
|
+
window.location.href = '/public/logout';
|
|
2186
|
+
return [4, this.http.get('/apis/reset').toPromise()];
|
|
2187
|
+
case 1:
|
|
2188
|
+
_a.sent();
|
|
2189
|
+
return [2];
|
|
2165
2190
|
}
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
return this.defaultDuration(h, m, s);
|
|
2169
|
-
}
|
|
2191
|
+
});
|
|
2192
|
+
});
|
|
2170
2193
|
};
|
|
2171
|
-
|
|
2172
|
-
var
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2194
|
+
AuthKeycloakService.prototype.addKeycloakEventListener = function () {
|
|
2195
|
+
var _this = this;
|
|
2196
|
+
this.keycloakSvc.keycloakEvents$.subscribe((function (event) {
|
|
2197
|
+
switch (event.type) {
|
|
2198
|
+
case keycloakAngular.KeycloakEventType.OnAuthError:
|
|
2199
|
+
_this.loginChangeSubject.next(false);
|
|
2200
|
+
break;
|
|
2201
|
+
case keycloakAngular.KeycloakEventType.OnAuthLogout:
|
|
2202
|
+
_this.loginChangeSubject.next(false);
|
|
2203
|
+
storage$1.removeItem(storageKey$1);
|
|
2204
|
+
break;
|
|
2205
|
+
case keycloakAngular.KeycloakEventType.OnAuthRefreshError:
|
|
2206
|
+
break;
|
|
2207
|
+
case keycloakAngular.KeycloakEventType.OnAuthRefreshSuccess:
|
|
2208
|
+
break;
|
|
2209
|
+
case keycloakAngular.KeycloakEventType.OnAuthSuccess:
|
|
2210
|
+
break;
|
|
2211
|
+
case keycloakAngular.KeycloakEventType.OnReady:
|
|
2212
|
+
_this.loginChangeSubject.next(event.args);
|
|
2213
|
+
if (event.args) {
|
|
2214
|
+
_this.saveKeycloakConfig();
|
|
2215
|
+
}
|
|
2216
|
+
break;
|
|
2217
|
+
case keycloakAngular.KeycloakEventType.OnTokenExpired:
|
|
2218
|
+
_this.keycloakSvc.updateToken(60);
|
|
2219
|
+
break;
|
|
2220
|
+
}
|
|
2221
|
+
}));
|
|
2177
2222
|
};
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2223
|
+
AuthKeycloakService.prototype.setupGlobalAuthResponder = function () {
|
|
2224
|
+
var _this = this;
|
|
2225
|
+
rxjs.fromEvent(window, 'message')
|
|
2226
|
+
.pipe(operators.filter((function (event) {
|
|
2227
|
+
return Boolean(event) &&
|
|
2228
|
+
Boolean(event.data) &&
|
|
2229
|
+
event.data.type === 'AUTH_REQUEST' &&
|
|
2230
|
+
Boolean(event.source && typeof event.source.postMessage === 'function');
|
|
2231
|
+
})))
|
|
2232
|
+
.subscribe((function (event) { return __awaiter(_this, void 0, void 0, function () {
|
|
2233
|
+
var contentWindow, token, response;
|
|
2234
|
+
return __generator(this, function (_a) {
|
|
2235
|
+
switch (_a.label) {
|
|
2236
|
+
case 0:
|
|
2237
|
+
contentWindow = ((event.source));
|
|
2238
|
+
return [4, this.keycloakSvc.getToken()];
|
|
2239
|
+
case 1:
|
|
2240
|
+
token = _a.sent();
|
|
2241
|
+
response = {
|
|
2242
|
+
app: 'WEB_PORTAL',
|
|
2243
|
+
type: 'AUTH_RESPONSE',
|
|
2244
|
+
state: 'NONE',
|
|
2245
|
+
plugin: 'NONE',
|
|
2246
|
+
data: {
|
|
2247
|
+
token: token,
|
|
2248
|
+
id: event.data && event.data.data && event.data.data.id,
|
|
2249
|
+
},
|
|
2250
|
+
};
|
|
2251
|
+
contentWindow.postMessage(response, '*');
|
|
2252
|
+
return [2];
|
|
2253
|
+
}
|
|
2254
|
+
});
|
|
2255
|
+
}); }));
|
|
2206
2256
|
};
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
function PipeHtmlTagRemovalModule() {
|
|
2217
|
-
}
|
|
2218
|
-
PipeHtmlTagRemovalModule.decorators = [
|
|
2219
|
-
{ type: core.NgModule, args: [{
|
|
2220
|
-
declarations: [PipeHtmlTagRemovalPipe],
|
|
2221
|
-
imports: [
|
|
2222
|
-
common.CommonModule,
|
|
2223
|
-
],
|
|
2224
|
-
exports: [PipeHtmlTagRemovalPipe],
|
|
2225
|
-
},] }
|
|
2226
|
-
];
|
|
2227
|
-
return PipeHtmlTagRemovalModule;
|
|
2228
|
-
}());
|
|
2229
|
-
|
|
2230
|
-
var PipeFilterPipe = (function () {
|
|
2231
|
-
function PipeFilterPipe() {
|
|
2232
|
-
}
|
|
2233
|
-
PipeFilterPipe.prototype.transform = function (value, keys, term) {
|
|
2234
|
-
if (!term) {
|
|
2235
|
-
return value;
|
|
2236
|
-
}
|
|
2237
|
-
return (value || []).filter((function (item) { return keys.split(',')
|
|
2238
|
-
.some((function (key) { return item.hasOwnProperty(key) && new RegExp("^" + term + "$", 'gi').test(item[key]); })); }));
|
|
2257
|
+
AuthKeycloakService.prototype.saveKeycloakConfig = function () {
|
|
2258
|
+
var kc = this.keycloakSvc.getKeycloakInstance();
|
|
2259
|
+
var kcInitOptions = {
|
|
2260
|
+
idToken: kc.idToken,
|
|
2261
|
+
refreshToken: kc.refreshToken,
|
|
2262
|
+
timeSkew: kc.timeSkew,
|
|
2263
|
+
token: kc.token,
|
|
2264
|
+
};
|
|
2265
|
+
storage$1.setItem(storageKey$1, JSON.stringify(kcInitOptions));
|
|
2239
2266
|
};
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2267
|
+
AuthKeycloakService.prototype.getSavedKcConfig = function () {
|
|
2268
|
+
try {
|
|
2269
|
+
var lastSaved = storage$1.getItem(storageKey$1);
|
|
2270
|
+
if (lastSaved) {
|
|
2271
|
+
var processed = JSON.parse(lastSaved);
|
|
2272
|
+
if ('idToken' in processed &&
|
|
2273
|
+
'refreshToken' in processed &&
|
|
2274
|
+
'timeSkew' in processed &&
|
|
2275
|
+
'token' in processed) {
|
|
2276
|
+
return processed;
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
catch (e) { }
|
|
2281
|
+
return {};
|
|
2282
|
+
};
|
|
2283
|
+
Object.defineProperty(AuthKeycloakService.prototype, "defaultRedirectUrl", {
|
|
2284
|
+
get: function () {
|
|
2285
|
+
try {
|
|
2286
|
+
var baseUrl = document.baseURI;
|
|
2287
|
+
return baseUrl || location.origin;
|
|
2288
|
+
}
|
|
2289
|
+
catch (error) {
|
|
2290
|
+
return location.origin;
|
|
2291
|
+
}
|
|
2292
|
+
},
|
|
2293
|
+
enumerable: true,
|
|
2294
|
+
configurable: true
|
|
2295
|
+
});
|
|
2296
|
+
AuthKeycloakService.decorators = [
|
|
2297
|
+
{ type: core.Injectable, args: [{
|
|
2298
|
+
providedIn: 'root',
|
|
2258
2299
|
},] }
|
|
2259
2300
|
];
|
|
2260
|
-
return
|
|
2301
|
+
AuthKeycloakService.ctorParameters = function () { return [
|
|
2302
|
+
{ type: http.HttpClient },
|
|
2303
|
+
{ type: ConfigurationsService },
|
|
2304
|
+
{ type: keycloakAngular.KeycloakService },
|
|
2305
|
+
{ type: AuthMicrosoftService }
|
|
2306
|
+
]; };
|
|
2307
|
+
/** @nocollapse */ AuthKeycloakService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function AuthKeycloakService_Factory() { return new AuthKeycloakService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(ConfigurationsService), core.ɵɵinject(keycloakAngular.KeycloakService), core.ɵɵinject(AuthMicrosoftService)); }, token: AuthKeycloakService, providedIn: "root" });
|
|
2308
|
+
return AuthKeycloakService;
|
|
2261
2309
|
}());
|
|
2310
|
+
if (false) {
|
|
2311
|
+
AuthKeycloakService.prototype.loginChangeSubject;
|
|
2312
|
+
AuthKeycloakService.prototype.http;
|
|
2313
|
+
AuthKeycloakService.prototype.configSvc;
|
|
2314
|
+
AuthKeycloakService.prototype.keycloakSvc;
|
|
2315
|
+
AuthKeycloakService.prototype.msAuthSvc;
|
|
2316
|
+
}
|
|
2262
2317
|
|
|
2263
|
-
|
|
2264
|
-
|
|
2318
|
+
function IWindowMobileAppModified() { }
|
|
2319
|
+
if (false) {
|
|
2320
|
+
IWindowMobileAppModified.prototype.appRef;
|
|
2321
|
+
IWindowMobileAppModified.prototype.webkit;
|
|
2322
|
+
}
|
|
2323
|
+
var RANDOM_ID_PER_USER = 0;
|
|
2324
|
+
function IRecursiveData() { }
|
|
2325
|
+
if (false) {
|
|
2326
|
+
IRecursiveData.prototype.identifier;
|
|
2327
|
+
IRecursiveData.prototype.children;
|
|
2328
|
+
}
|
|
2329
|
+
var UtilityService = (function () {
|
|
2330
|
+
function UtilityService(http, platform, router$1, route) {
|
|
2331
|
+
var _this = this;
|
|
2332
|
+
this.http = http;
|
|
2333
|
+
this.platform = platform;
|
|
2334
|
+
this.router = router$1;
|
|
2335
|
+
this.route = route;
|
|
2336
|
+
this.currentRouteData = [];
|
|
2337
|
+
this.router.events.subscribe((function (event) {
|
|
2338
|
+
if (event instanceof router.NavigationEnd) {
|
|
2339
|
+
var snapshot = _this.route.snapshot;
|
|
2340
|
+
var firstChild = snapshot.root.firstChild;
|
|
2341
|
+
_this.getChildRouteData(snapshot, firstChild);
|
|
2342
|
+
}
|
|
2343
|
+
}));
|
|
2265
2344
|
}
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2345
|
+
UtilityService.prototype.getChildRouteData = function (snapshot, firstChild) {
|
|
2346
|
+
if (firstChild) {
|
|
2347
|
+
if (firstChild.data) {
|
|
2348
|
+
this.currentRouteData.push(firstChild.data);
|
|
2349
|
+
}
|
|
2350
|
+
if (firstChild.firstChild) {
|
|
2351
|
+
this.getChildRouteData(snapshot, firstChild.firstChild);
|
|
2352
|
+
}
|
|
2273
2353
|
}
|
|
2274
|
-
|
|
2275
|
-
|
|
2354
|
+
};
|
|
2355
|
+
Object.defineProperty(UtilityService.prototype, "randomId", {
|
|
2356
|
+
get: function () {
|
|
2357
|
+
return RANDOM_ID_PER_USER + 1;
|
|
2358
|
+
},
|
|
2359
|
+
enumerable: true,
|
|
2360
|
+
configurable: true
|
|
2361
|
+
});
|
|
2362
|
+
UtilityService.prototype.getJson = function (url) {
|
|
2363
|
+
return this.http.get(url);
|
|
2364
|
+
};
|
|
2365
|
+
UtilityService.prototype.getLeafNodes = function (node, nodes) {
|
|
2366
|
+
var _this = this;
|
|
2367
|
+
if ((node.children || []).length === 0) {
|
|
2368
|
+
nodes.push(node);
|
|
2276
2369
|
}
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
if (result && result.length <= 0) {
|
|
2283
|
-
return [-1];
|
|
2370
|
+
else {
|
|
2371
|
+
if (node.children) {
|
|
2372
|
+
node.children.forEach((function (child) {
|
|
2373
|
+
_this.getLeafNodes(child, nodes);
|
|
2374
|
+
}));
|
|
2284
2375
|
}
|
|
2285
|
-
return result;
|
|
2286
2376
|
}
|
|
2287
|
-
return
|
|
2288
|
-
return it.title.toLowerCase().includes(searchTextLowerCase);
|
|
2289
|
-
}));
|
|
2377
|
+
return nodes;
|
|
2290
2378
|
};
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
function PipeFilterSearchModule() {
|
|
2301
|
-
}
|
|
2302
|
-
PipeFilterSearchModule.decorators = [
|
|
2303
|
-
{ type: core.NgModule, args: [{
|
|
2304
|
-
declarations: [PipeFilterSearchPipe],
|
|
2305
|
-
imports: [
|
|
2306
|
-
common.CommonModule,
|
|
2307
|
-
],
|
|
2308
|
-
exports: [PipeFilterSearchPipe],
|
|
2309
|
-
},] }
|
|
2310
|
-
];
|
|
2311
|
-
return PipeFilterSearchModule;
|
|
2312
|
-
}());
|
|
2313
|
-
|
|
2314
|
-
var PipeListFilterPipe = (function () {
|
|
2315
|
-
function PipeListFilterPipe() {
|
|
2316
|
-
}
|
|
2317
|
-
PipeListFilterPipe.prototype.transform = function (value, keys, term) {
|
|
2318
|
-
if (!term) {
|
|
2319
|
-
return value;
|
|
2379
|
+
UtilityService.prototype.getPath = function (node, id) {
|
|
2380
|
+
var path = [];
|
|
2381
|
+
this.hasPath(node, path, id);
|
|
2382
|
+
return path;
|
|
2383
|
+
};
|
|
2384
|
+
UtilityService.prototype.hasPath = function (node, pathArr, id) {
|
|
2385
|
+
var _this = this;
|
|
2386
|
+
if (node == null) {
|
|
2387
|
+
return false;
|
|
2320
2388
|
}
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2389
|
+
pathArr.push(node);
|
|
2390
|
+
if (node.identifier === id) {
|
|
2391
|
+
return true;
|
|
2392
|
+
}
|
|
2393
|
+
var children = node.children || [];
|
|
2394
|
+
if (children.some((function (u) { return _this.hasPath(u, pathArr, id); }))) {
|
|
2395
|
+
return true;
|
|
2396
|
+
}
|
|
2397
|
+
pathArr.pop();
|
|
2398
|
+
return false;
|
|
2324
2399
|
};
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2400
|
+
Object.defineProperty(UtilityService.prototype, "isMobile", {
|
|
2401
|
+
get: function () {
|
|
2402
|
+
if (this.isIos || this.isAndroid) {
|
|
2403
|
+
return true;
|
|
2404
|
+
}
|
|
2405
|
+
return false;
|
|
2406
|
+
},
|
|
2407
|
+
enumerable: true,
|
|
2408
|
+
configurable: true
|
|
2409
|
+
});
|
|
2410
|
+
Object.defineProperty(UtilityService.prototype, "isIos", {
|
|
2411
|
+
get: function () {
|
|
2412
|
+
return this.platform.IOS;
|
|
2413
|
+
},
|
|
2414
|
+
enumerable: true,
|
|
2415
|
+
configurable: true
|
|
2416
|
+
});
|
|
2417
|
+
Object.defineProperty(UtilityService.prototype, "isAndroid", {
|
|
2418
|
+
get: function () {
|
|
2419
|
+
return this.platform.ANDROID;
|
|
2420
|
+
},
|
|
2421
|
+
enumerable: true,
|
|
2422
|
+
configurable: true
|
|
2423
|
+
});
|
|
2424
|
+
Object.defineProperty(UtilityService.prototype, "isAndroidApp", {
|
|
2425
|
+
get: function () {
|
|
2426
|
+
return Boolean(window.appRef);
|
|
2427
|
+
},
|
|
2428
|
+
enumerable: true,
|
|
2429
|
+
configurable: true
|
|
2430
|
+
});
|
|
2431
|
+
Object.defineProperty(UtilityService.prototype, "iOsAppRef", {
|
|
2432
|
+
get: function () {
|
|
2433
|
+
if (window.webkit &&
|
|
2434
|
+
window.webkit.messageHandlers &&
|
|
2435
|
+
window.webkit.messageHandlers.appRef) {
|
|
2436
|
+
return window.webkit.messageHandlers.appRef;
|
|
2437
|
+
}
|
|
2438
|
+
return null;
|
|
2439
|
+
},
|
|
2440
|
+
enumerable: true,
|
|
2441
|
+
configurable: true
|
|
2442
|
+
});
|
|
2443
|
+
UtilityService.prototype.setRouteData = function (data) {
|
|
2444
|
+
this.currentRouteData = data;
|
|
2445
|
+
};
|
|
2446
|
+
Object.defineProperty(UtilityService.prototype, "routeData", {
|
|
2447
|
+
get: function () {
|
|
2448
|
+
var data = {
|
|
2449
|
+
module: '',
|
|
2450
|
+
pageId: '',
|
|
2451
|
+
};
|
|
2452
|
+
this.currentRouteData.map((function (rd) {
|
|
2453
|
+
if (rd.pageId) {
|
|
2454
|
+
data.pageId = data.pageId + "/" + rd.pageId;
|
|
2455
|
+
}
|
|
2456
|
+
if (rd.module) {
|
|
2457
|
+
data.module = rd.module;
|
|
2458
|
+
}
|
|
2459
|
+
}));
|
|
2460
|
+
return data;
|
|
2461
|
+
},
|
|
2462
|
+
enumerable: true,
|
|
2463
|
+
configurable: true
|
|
2464
|
+
});
|
|
2465
|
+
UtilityService.decorators = [
|
|
2466
|
+
{ type: core.Injectable, args: [{
|
|
2467
|
+
providedIn: 'root',
|
|
2343
2468
|
},] }
|
|
2344
2469
|
];
|
|
2345
|
-
return
|
|
2470
|
+
UtilityService.ctorParameters = function () { return [
|
|
2471
|
+
{ type: http.HttpClient },
|
|
2472
|
+
{ type: platform.Platform },
|
|
2473
|
+
{ type: router.Router },
|
|
2474
|
+
{ type: router.ActivatedRoute }
|
|
2475
|
+
]; };
|
|
2476
|
+
/** @nocollapse */ UtilityService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function UtilityService_Factory() { return new UtilityService(core.ɵɵinject(http.HttpClient), core.ɵɵinject(platform.Platform), core.ɵɵinject(router.Router), core.ɵɵinject(router.ActivatedRoute)); }, token: UtilityService, providedIn: "root" });
|
|
2477
|
+
return UtilityService;
|
|
2346
2478
|
}());
|
|
2479
|
+
if (false) {
|
|
2480
|
+
UtilityService.prototype.currentRouteData;
|
|
2481
|
+
UtilityService.prototype.http;
|
|
2482
|
+
UtilityService.prototype.platform;
|
|
2483
|
+
UtilityService.prototype.router;
|
|
2484
|
+
UtilityService.prototype.route;
|
|
2485
|
+
}
|
|
2347
2486
|
|
|
2348
|
-
var
|
|
2349
|
-
function
|
|
2487
|
+
var LogoutComponent = (function () {
|
|
2488
|
+
function LogoutComponent(dialogRef, authSvc, configSvc, utilitySvc) {
|
|
2489
|
+
this.dialogRef = dialogRef;
|
|
2490
|
+
this.authSvc = authSvc;
|
|
2491
|
+
this.configSvc = configSvc;
|
|
2492
|
+
this.utilitySvc = utilitySvc;
|
|
2493
|
+
this.disabled = false;
|
|
2494
|
+
this.isDownloadableIos = false;
|
|
2495
|
+
this.isDownloadableAndroid = false;
|
|
2350
2496
|
}
|
|
2351
|
-
|
|
2352
|
-
if (
|
|
2353
|
-
|
|
2497
|
+
LogoutComponent.prototype.ngOnInit = function () {
|
|
2498
|
+
if (this.configSvc.restrictedFeatures) {
|
|
2499
|
+
this.isDownloadableIos = !this.configSvc.restrictedFeatures.has('iosDownload');
|
|
2500
|
+
this.isDownloadableAndroid = !this.configSvc.restrictedFeatures.has('androidDownload');
|
|
2354
2501
|
}
|
|
2355
|
-
return moment().startOf('hour').fromNow();
|
|
2356
2502
|
};
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2503
|
+
LogoutComponent.prototype.confirmed = function () {
|
|
2504
|
+
this.disabled = true;
|
|
2505
|
+
this.dialogRef.close();
|
|
2506
|
+
this.authSvc.force_logout();
|
|
2507
|
+
};
|
|
2508
|
+
Object.defineProperty(LogoutComponent.prototype, "isDownloadable", {
|
|
2509
|
+
get: function () {
|
|
2510
|
+
if (this.configSvc.instanceConfig && this.configSvc.instanceConfig.isContentDownloadAvailable &&
|
|
2511
|
+
(this.utilitySvc.iOsAppRef || this.utilitySvc.isAndroidApp)) {
|
|
2512
|
+
return true;
|
|
2513
|
+
}
|
|
2514
|
+
return false;
|
|
2515
|
+
},
|
|
2516
|
+
enumerable: true,
|
|
2517
|
+
configurable: true
|
|
2518
|
+
});
|
|
2519
|
+
LogoutComponent.decorators = [
|
|
2520
|
+
{ type: core.Component, args: [{
|
|
2521
|
+
selector: 'ws-utils-logout',
|
|
2522
|
+
template: "<h1 mat-dialog-title i18n>Logout Now</h1>\r\n<div class=\"ws-mat-primary-text text-base pb-2 title-text\" *ngIf=\"isDownloadable\" i18n>\r\n Note: On logging out all the downloaded content will be deleted.\r\n</div>\r\n<div mat-dialog-content class=\"text-base hide-overflow\" i18n>\r\n Are you sure?\r\n</div>\r\n<div mat-dialog-actions class=\"flex-row-reverse\">\r\n <button mat-flat-button color=\"warn\" [disabled]=\"disabled\" (click)=\"confirmed()\" i18n>\r\n Yes\r\n </button>\r\n <button mat-button class=\"margin-right-xs\" [mat-dialog-close] cdkFocusInitial i18n>No</button>\r\n</div>",
|
|
2523
|
+
styles: [".hide-overflow{overflow:hidden}"]
|
|
2524
|
+
}] }
|
|
2361
2525
|
];
|
|
2362
|
-
return
|
|
2526
|
+
LogoutComponent.ctorParameters = function () { return [
|
|
2527
|
+
{ type: material.MatDialogRef },
|
|
2528
|
+
{ type: AuthKeycloakService },
|
|
2529
|
+
{ type: ConfigurationsService },
|
|
2530
|
+
{ type: UtilityService }
|
|
2531
|
+
]; };
|
|
2532
|
+
return LogoutComponent;
|
|
2363
2533
|
}());
|
|
2534
|
+
if (false) {
|
|
2535
|
+
LogoutComponent.prototype.disabled;
|
|
2536
|
+
LogoutComponent.prototype.isDownloadableIos;
|
|
2537
|
+
LogoutComponent.prototype.isDownloadableAndroid;
|
|
2538
|
+
LogoutComponent.prototype.dialogRef;
|
|
2539
|
+
LogoutComponent.prototype.authSvc;
|
|
2540
|
+
LogoutComponent.prototype.configSvc;
|
|
2541
|
+
LogoutComponent.prototype.utilitySvc;
|
|
2542
|
+
}
|
|
2364
2543
|
|
|
2365
|
-
var
|
|
2366
|
-
function
|
|
2544
|
+
var LogoutModule = (function () {
|
|
2545
|
+
function LogoutModule() {
|
|
2367
2546
|
}
|
|
2368
|
-
|
|
2547
|
+
LogoutModule.decorators = [
|
|
2369
2548
|
{ type: core.NgModule, args: [{
|
|
2370
|
-
declarations: [
|
|
2549
|
+
declarations: [LogoutComponent],
|
|
2371
2550
|
imports: [
|
|
2372
2551
|
common.CommonModule,
|
|
2552
|
+
material.MatButtonModule,
|
|
2553
|
+
material.MatDialogModule,
|
|
2373
2554
|
],
|
|
2374
|
-
|
|
2555
|
+
entryComponents: [LogoutComponent],
|
|
2375
2556
|
},] }
|
|
2376
2557
|
];
|
|
2377
|
-
return
|
|
2558
|
+
return LogoutModule;
|
|
2378
2559
|
}());
|
|
2379
2560
|
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2561
|
+
function IDateRange() { }
|
|
2562
|
+
if (false) {
|
|
2563
|
+
IDateRange.prototype.fromDate;
|
|
2564
|
+
IDateRange.prototype.toDate;
|
|
2565
|
+
IDateRange.prototype.timeZone;
|
|
2566
|
+
}
|
|
2567
|
+
var PipeConciseDateRangePipe = (function () {
|
|
2568
|
+
function PipeConciseDateRangePipe() {
|
|
2383
2569
|
}
|
|
2384
|
-
|
|
2570
|
+
PipeConciseDateRangePipe.prototype.transform = function (dateRange) {
|
|
2571
|
+
try {
|
|
2572
|
+
var conciseRange = void 0;
|
|
2573
|
+
var prefix = void 0;
|
|
2574
|
+
var suffix = void 0;
|
|
2575
|
+
var fromDate = new Date(dateRange.fromDate);
|
|
2576
|
+
var toDate = new Date(dateRange.toDate);
|
|
2577
|
+
var fromDateObj = {
|
|
2578
|
+
day: fromDate.getDate(),
|
|
2579
|
+
month: fromDate.toLocaleString('default', { month: 'short' }),
|
|
2580
|
+
year: fromDate.getFullYear(),
|
|
2581
|
+
time: fromDate.getTime(),
|
|
2582
|
+
};
|
|
2583
|
+
var toDateObj = {
|
|
2584
|
+
day: toDate.getDate(),
|
|
2585
|
+
month: toDate.toLocaleString('default', { month: 'short' }),
|
|
2586
|
+
year: toDate.getFullYear(),
|
|
2587
|
+
time: toDate.getTime(),
|
|
2588
|
+
};
|
|
2589
|
+
if (fromDateObj.time === toDateObj.time) {
|
|
2590
|
+
conciseRange = fromDateObj.day + " " + fromDateObj.month + " " + fromDateObj.year;
|
|
2591
|
+
return conciseRange;
|
|
2592
|
+
}
|
|
2593
|
+
if (fromDateObj.year !== fromDateObj.year) {
|
|
2594
|
+
prefix = fromDateObj.day + " " + fromDateObj.month + " " + fromDateObj.year;
|
|
2595
|
+
suffix = toDateObj.day + " " + toDateObj.month + " " + toDateObj.year;
|
|
2596
|
+
conciseRange = prefix + " - " + suffix;
|
|
2597
|
+
return conciseRange;
|
|
2598
|
+
}
|
|
2599
|
+
if (fromDateObj.month === toDateObj.month) {
|
|
2600
|
+
prefix = "" + fromDateObj.day;
|
|
2601
|
+
suffix = toDateObj.day + " " + toDateObj.month + " " + toDateObj.year;
|
|
2602
|
+
}
|
|
2603
|
+
else {
|
|
2604
|
+
prefix = fromDateObj.day + " " + fromDateObj.month;
|
|
2605
|
+
suffix = toDateObj.day + " " + toDateObj.month + " " + toDateObj.year;
|
|
2606
|
+
}
|
|
2607
|
+
conciseRange = prefix + " - " + suffix;
|
|
2608
|
+
return conciseRange;
|
|
2609
|
+
}
|
|
2610
|
+
catch (e) {
|
|
2611
|
+
return dateRange.fromDate + " - " + dateRange.toDate;
|
|
2612
|
+
}
|
|
2613
|
+
};
|
|
2614
|
+
PipeConciseDateRangePipe.decorators = [
|
|
2385
2615
|
{ type: core.Pipe, args: [{
|
|
2386
|
-
name: '
|
|
2616
|
+
name: 'pipeConciseDateRange',
|
|
2387
2617
|
},] }
|
|
2388
2618
|
];
|
|
2389
|
-
return
|
|
2619
|
+
return PipeConciseDateRangePipe;
|
|
2390
2620
|
}());
|
|
2391
|
-
if (false) {
|
|
2392
|
-
OrderByPipe.prototype.transform;
|
|
2393
|
-
}
|
|
2394
2621
|
|
|
2395
|
-
var
|
|
2396
|
-
function
|
|
2622
|
+
var PipeConciseDateRangeModule = (function () {
|
|
2623
|
+
function PipeConciseDateRangeModule() {
|
|
2397
2624
|
}
|
|
2398
|
-
|
|
2625
|
+
PipeConciseDateRangeModule.decorators = [
|
|
2399
2626
|
{ type: core.NgModule, args: [{
|
|
2400
|
-
declarations: [
|
|
2401
|
-
imports: [
|
|
2402
|
-
|
|
2403
|
-
],
|
|
2404
|
-
exports: [OrderByPipe],
|
|
2627
|
+
declarations: [PipeConciseDateRangePipe],
|
|
2628
|
+
imports: [common.CommonModule],
|
|
2629
|
+
exports: [PipeConciseDateRangePipe],
|
|
2405
2630
|
},] }
|
|
2406
2631
|
];
|
|
2407
|
-
return
|
|
2632
|
+
return PipeConciseDateRangeModule;
|
|
2408
2633
|
}());
|
|
2409
2634
|
|
|
2410
|
-
var
|
|
2411
|
-
function
|
|
2635
|
+
var PipeCountTransformPipe = (function () {
|
|
2636
|
+
function PipeCountTransformPipe() {
|
|
2412
2637
|
}
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2638
|
+
PipeCountTransformPipe.prototype.transform = function (value) {
|
|
2639
|
+
var thousand = 1000;
|
|
2640
|
+
var million = 1000000;
|
|
2641
|
+
if (value > 0) {
|
|
2642
|
+
if (value < thousand) {
|
|
2643
|
+
return String(value);
|
|
2644
|
+
}
|
|
2645
|
+
if (value >= thousand && value < million) {
|
|
2646
|
+
var views = (value / thousand).toFixed(1);
|
|
2647
|
+
if (views.endsWith('0')) {
|
|
2648
|
+
return views.split('.')[0] + "K";
|
|
2649
|
+
}
|
|
2650
|
+
return views + "K";
|
|
2651
|
+
}
|
|
2652
|
+
{
|
|
2653
|
+
var views = (value / million).toFixed(1);
|
|
2654
|
+
if (views.endsWith('0')) {
|
|
2655
|
+
return views.split('.')[0] + "M";
|
|
2656
|
+
}
|
|
2657
|
+
return views + "M";
|
|
2425
2658
|
}
|
|
2426
|
-
return slicedString;
|
|
2427
2659
|
}
|
|
2428
|
-
return
|
|
2660
|
+
return '0';
|
|
2429
2661
|
};
|
|
2430
|
-
|
|
2662
|
+
PipeCountTransformPipe.decorators = [
|
|
2431
2663
|
{ type: core.Pipe, args: [{
|
|
2432
|
-
name: '
|
|
2664
|
+
name: 'pipeCountTransform',
|
|
2433
2665
|
},] }
|
|
2434
2666
|
];
|
|
2435
|
-
return
|
|
2667
|
+
return PipeCountTransformPipe;
|
|
2436
2668
|
}());
|
|
2437
2669
|
|
|
2438
|
-
var
|
|
2439
|
-
function
|
|
2670
|
+
var PipeCountTransformModule = (function () {
|
|
2671
|
+
function PipeCountTransformModule() {
|
|
2440
2672
|
}
|
|
2441
|
-
|
|
2673
|
+
PipeCountTransformModule.decorators = [
|
|
2442
2674
|
{ type: core.NgModule, args: [{
|
|
2443
|
-
declarations: [
|
|
2675
|
+
declarations: [PipeCountTransformPipe],
|
|
2444
2676
|
imports: [
|
|
2445
2677
|
common.CommonModule,
|
|
2446
2678
|
],
|
|
2447
|
-
exports: [
|
|
2679
|
+
exports: [PipeCountTransformPipe],
|
|
2448
2680
|
},] }
|
|
2449
2681
|
];
|
|
2450
|
-
return
|
|
2682
|
+
return PipeCountTransformModule;
|
|
2451
2683
|
}());
|
|
2452
2684
|
|
|
2453
|
-
function
|
|
2685
|
+
function ICertificationDate() { }
|
|
2454
2686
|
if (false) {
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2687
|
+
ICertificationDate.prototype.day;
|
|
2688
|
+
ICertificationDate.prototype.month;
|
|
2689
|
+
ICertificationDate.prototype.year;
|
|
2690
|
+
ICertificationDate.prototype.timeZone;
|
|
2458
2691
|
}
|
|
2459
|
-
var
|
|
2460
|
-
function
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2692
|
+
var PipeDateConcatPipe = (function () {
|
|
2693
|
+
function PipeDateConcatPipe() {
|
|
2694
|
+
this.months = [
|
|
2695
|
+
'Jan',
|
|
2696
|
+
'Feb',
|
|
2697
|
+
'Mar',
|
|
2698
|
+
'Apr',
|
|
2699
|
+
'May',
|
|
2700
|
+
'Jun',
|
|
2701
|
+
'Jul',
|
|
2702
|
+
'Aug',
|
|
2703
|
+
'Sep',
|
|
2704
|
+
'Oct',
|
|
2705
|
+
'Nov',
|
|
2706
|
+
'Dec',
|
|
2707
|
+
];
|
|
2708
|
+
}
|
|
2709
|
+
PipeDateConcatPipe.prototype.transform = function (value) {
|
|
2710
|
+
var dateStr = value.day + " " + this.months[value.month - 1] + " " + value.year;
|
|
2711
|
+
if (value.timeZone) {
|
|
2712
|
+
dateStr += " " + value.timeZone;
|
|
2475
2713
|
}
|
|
2476
|
-
return
|
|
2714
|
+
return dateStr;
|
|
2477
2715
|
};
|
|
2478
|
-
|
|
2716
|
+
PipeDateConcatPipe.decorators = [
|
|
2479
2717
|
{ type: core.Pipe, args: [{
|
|
2480
|
-
name: '
|
|
2718
|
+
name: 'pipeDateConcat',
|
|
2481
2719
|
},] }
|
|
2482
2720
|
];
|
|
2483
|
-
return
|
|
2721
|
+
PipeDateConcatPipe.ctorParameters = function () { return []; };
|
|
2722
|
+
return PipeDateConcatPipe;
|
|
2484
2723
|
}());
|
|
2724
|
+
if (false) {
|
|
2725
|
+
PipeDateConcatPipe.prototype.months;
|
|
2726
|
+
}
|
|
2485
2727
|
|
|
2486
|
-
var
|
|
2487
|
-
function
|
|
2728
|
+
var PipeDateConcatModule = (function () {
|
|
2729
|
+
function PipeDateConcatModule() {
|
|
2488
2730
|
}
|
|
2489
|
-
|
|
2731
|
+
PipeDateConcatModule.decorators = [
|
|
2490
2732
|
{ type: core.NgModule, args: [{
|
|
2491
|
-
declarations: [
|
|
2733
|
+
declarations: [PipeDateConcatPipe],
|
|
2492
2734
|
imports: [
|
|
2493
2735
|
common.CommonModule,
|
|
2494
2736
|
],
|
|
2495
|
-
exports: [
|
|
2737
|
+
exports: [PipeDateConcatPipe],
|
|
2496
2738
|
},] }
|
|
2497
2739
|
];
|
|
2498
|
-
return
|
|
2740
|
+
return PipeDateConcatModule;
|
|
2499
2741
|
}());
|
|
2500
2742
|
|
|
2501
|
-
var
|
|
2502
|
-
function
|
|
2743
|
+
var PipeDurationTransformPipe = (function () {
|
|
2744
|
+
function PipeDurationTransformPipe() {
|
|
2503
2745
|
}
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
try {
|
|
2508
|
-
for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
|
|
2509
|
-
var key = keys_1_1.value;
|
|
2510
|
-
if (value[key]) {
|
|
2511
|
-
result[key] = value[key];
|
|
2512
|
-
}
|
|
2513
|
-
}
|
|
2746
|
+
PipeDurationTransformPipe.prototype.transform = function (data, type) {
|
|
2747
|
+
if (data <= 0) {
|
|
2748
|
+
return '';
|
|
2514
2749
|
}
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2750
|
+
var h = Math.floor(data / 3600);
|
|
2751
|
+
var m = Math.floor((data % 3600) / 60);
|
|
2752
|
+
var s = Math.floor((data % 3600) % 60);
|
|
2753
|
+
var duration = '';
|
|
2754
|
+
var space = '';
|
|
2755
|
+
switch (type) {
|
|
2756
|
+
case 'time24':
|
|
2757
|
+
return this.defaultDuration(h, m, s);
|
|
2758
|
+
case 'hms':
|
|
2759
|
+
if (h > 0) {
|
|
2760
|
+
duration += type === 'hms' ? h + "h" : h + " hr";
|
|
2761
|
+
}
|
|
2762
|
+
if (m > 0) {
|
|
2763
|
+
if (h > 0) {
|
|
2764
|
+
space = ' ';
|
|
2765
|
+
}
|
|
2766
|
+
duration += type === 'hms' ? "" + space + m + "m" : "" + space + m + " min";
|
|
2767
|
+
}
|
|
2768
|
+
if (s > 0 && h === 0) {
|
|
2769
|
+
if (m > 0) {
|
|
2770
|
+
space = ' ';
|
|
2771
|
+
}
|
|
2772
|
+
duration += type === 'hms' ? "" + space + s + "s" : "" + space + s + " sec";
|
|
2773
|
+
}
|
|
2774
|
+
return duration;
|
|
2775
|
+
case 'hour':
|
|
2776
|
+
if (h === 0) {
|
|
2777
|
+
duration += 'less than an hour';
|
|
2778
|
+
}
|
|
2779
|
+
if (h === 1) {
|
|
2780
|
+
duration += h + " hour";
|
|
2781
|
+
}
|
|
2782
|
+
if (h > 1) {
|
|
2783
|
+
duration += h + " hours";
|
|
2784
|
+
}
|
|
2785
|
+
return duration;
|
|
2786
|
+
default:
|
|
2787
|
+
return this.defaultDuration(h, m, s);
|
|
2521
2788
|
}
|
|
2522
|
-
return result;
|
|
2523
2789
|
};
|
|
2524
|
-
|
|
2790
|
+
PipeDurationTransformPipe.prototype.defaultDuration = function (h, m, s) {
|
|
2791
|
+
var duration = '';
|
|
2792
|
+
duration += h > 0 ? h.toString().padStart(2) + ":" : '';
|
|
2793
|
+
duration += m > 0 ? m.toString().padStart(2) + ":" : '00:';
|
|
2794
|
+
duration += s > 0 ? s.toString().padStart(2) : '00';
|
|
2795
|
+
return duration;
|
|
2796
|
+
};
|
|
2797
|
+
PipeDurationTransformPipe.decorators = [
|
|
2525
2798
|
{ type: core.Pipe, args: [{
|
|
2526
|
-
name: '
|
|
2799
|
+
name: 'pipeDurationTransform',
|
|
2527
2800
|
},] }
|
|
2528
2801
|
];
|
|
2529
|
-
return
|
|
2802
|
+
return PipeDurationTransformPipe;
|
|
2530
2803
|
}());
|
|
2531
2804
|
|
|
2532
|
-
var
|
|
2533
|
-
function
|
|
2805
|
+
var PipeDurationTransformModule = (function () {
|
|
2806
|
+
function PipeDurationTransformModule() {
|
|
2534
2807
|
}
|
|
2535
|
-
|
|
2808
|
+
PipeDurationTransformModule.decorators = [
|
|
2536
2809
|
{ type: core.NgModule, args: [{
|
|
2537
|
-
declarations: [
|
|
2810
|
+
declarations: [PipeDurationTransformPipe],
|
|
2538
2811
|
imports: [
|
|
2539
2812
|
common.CommonModule,
|
|
2540
2813
|
],
|
|
2541
|
-
exports: [
|
|
2814
|
+
exports: [PipeDurationTransformPipe],
|
|
2542
2815
|
},] }
|
|
2543
2816
|
];
|
|
2544
|
-
return
|
|
2817
|
+
return PipeDurationTransformModule;
|
|
2545
2818
|
}());
|
|
2546
2819
|
|
|
2547
|
-
var
|
|
2548
|
-
function
|
|
2549
|
-
this.sanitizer = sanitizer;
|
|
2820
|
+
var PipeHtmlTagRemovalPipe = (function () {
|
|
2821
|
+
function PipeHtmlTagRemovalPipe() {
|
|
2550
2822
|
}
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
switch (type) {
|
|
2554
|
-
case 'html':
|
|
2555
|
-
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
2556
|
-
case 'style':
|
|
2557
|
-
return this.sanitizer.bypassSecurityTrustStyle(value);
|
|
2558
|
-
case 'script':
|
|
2559
|
-
return this.sanitizer.bypassSecurityTrustScript(value);
|
|
2560
|
-
case 'url':
|
|
2561
|
-
return this.sanitizer.bypassSecurityTrustUrl(value);
|
|
2562
|
-
case 'resourceUrl':
|
|
2563
|
-
return this.sanitizer.bypassSecurityTrustResourceUrl(value);
|
|
2564
|
-
default:
|
|
2565
|
-
throw new Error("Invalid safe type specified: " + type);
|
|
2566
|
-
}
|
|
2823
|
+
PipeHtmlTagRemovalPipe.prototype.transform = function (htmlString) {
|
|
2824
|
+
return htmlString ? String(htmlString).replace(/<[^>]+>/gm, '') : '';
|
|
2567
2825
|
};
|
|
2568
|
-
|
|
2826
|
+
PipeHtmlTagRemovalPipe.decorators = [
|
|
2569
2827
|
{ type: core.Pipe, args: [{
|
|
2570
|
-
name: '
|
|
2828
|
+
name: 'pipeHtmlTagRemoval',
|
|
2571
2829
|
},] }
|
|
2572
2830
|
];
|
|
2573
|
-
|
|
2574
|
-
{ type: platformBrowser.DomSanitizer }
|
|
2575
|
-
]; };
|
|
2576
|
-
return PipeSafeSanitizerPipe;
|
|
2831
|
+
return PipeHtmlTagRemovalPipe;
|
|
2577
2832
|
}());
|
|
2578
|
-
if (false) {
|
|
2579
|
-
PipeSafeSanitizerPipe.prototype.sanitizer;
|
|
2580
|
-
}
|
|
2581
2833
|
|
|
2582
|
-
var
|
|
2583
|
-
function
|
|
2834
|
+
var PipeHtmlTagRemovalModule = (function () {
|
|
2835
|
+
function PipeHtmlTagRemovalModule() {
|
|
2584
2836
|
}
|
|
2585
|
-
|
|
2837
|
+
PipeHtmlTagRemovalModule.decorators = [
|
|
2586
2838
|
{ type: core.NgModule, args: [{
|
|
2587
|
-
declarations: [
|
|
2839
|
+
declarations: [PipeHtmlTagRemovalPipe],
|
|
2588
2840
|
imports: [
|
|
2589
2841
|
common.CommonModule,
|
|
2590
2842
|
],
|
|
2591
|
-
exports: [
|
|
2592
|
-
},] }
|
|
2593
|
-
];
|
|
2594
|
-
return PipeSafeSanitizerModule;
|
|
2595
|
-
}());
|
|
2596
|
-
|
|
2597
|
-
var ExploreDetailResolve = (function () {
|
|
2598
|
-
function ExploreDetailResolve(http, configSvc, utilitySvc) {
|
|
2599
|
-
this.http = http;
|
|
2600
|
-
this.configSvc = configSvc;
|
|
2601
|
-
this.utilitySvc = utilitySvc;
|
|
2602
|
-
this.baseUrl = this.configSvc.sitePath;
|
|
2603
|
-
this.isIntranetAllowedSettings = false;
|
|
2604
|
-
}
|
|
2605
|
-
ExploreDetailResolve.prototype.resolve = function (route, _state) {
|
|
2606
|
-
var _this = this;
|
|
2607
|
-
this.isIntranetAllowedSettings = this.configSvc.isIntranetAllowed;
|
|
2608
|
-
var tag = decodeURIComponent(route.params.tags);
|
|
2609
|
-
var url = '';
|
|
2610
|
-
if (route.data.pageUrl) {
|
|
2611
|
-
url = route.data.pageUrl;
|
|
2612
|
-
}
|
|
2613
|
-
if (route.data.pageType === 'page' && route.data.pageKey) {
|
|
2614
|
-
url = this.baseUrl + "/page/" + route.data.pageKey + ".json";
|
|
2615
|
-
}
|
|
2616
|
-
return this.http.get(url).pipe(operators.map((function (pageData) { return ({ data: _this.transformPageData(pageData, tag), error: null }); })), operators.catchError((function (err) { return rxjs.of({ data: null, error: err }); })));
|
|
2617
|
-
};
|
|
2618
|
-
ExploreDetailResolve.prototype.transformPageData = function (pageData, tag) {
|
|
2619
|
-
var _this = this;
|
|
2620
|
-
var DELIMITER = '>';
|
|
2621
|
-
var path = tag.split(DELIMITER);
|
|
2622
|
-
pageData.pageLayout.widgetData.widgets = pageData.pageLayout.widgetData.widgets.map((function (widget) {
|
|
2623
|
-
if (pageData.navigationBar && pageData.navigationBar.links) {
|
|
2624
|
-
pageData.navigationBar.links = pageData.navigationBar.links
|
|
2625
|
-
.filter((function (link) { return link.widgetData.tags === tag; }));
|
|
2626
|
-
}
|
|
2627
|
-
if (widget.widgetSubType === 'cardBreadcrumb') {
|
|
2628
|
-
widget.widgetData.path = [{
|
|
2629
|
-
text: pageData.navigationBar.pageTitle,
|
|
2630
|
-
clickUrl: pageData.navigationBar.pageBackLink,
|
|
2631
|
-
}].concat(path.map((function (edge, idx) { return ({
|
|
2632
|
-
text: edge,
|
|
2633
|
-
clickUrl: "/page/explore/" + path.slice(0, idx + 1).join(DELIMITER),
|
|
2634
|
-
}); })));
|
|
2635
|
-
}
|
|
2636
|
-
if (widget.widgetSubType === 'contentStripMultiple') {
|
|
2637
|
-
widget.widgetData.strips = widget.widgetData.strips.map((function (strip) {
|
|
2638
|
-
strip.request.searchV6.filters[0].andFilters.push({ catalogPaths: [tag] });
|
|
2639
|
-
if (_this.utilitySvc.isMobile && !_this.isIntranetAllowedSettings) {
|
|
2640
|
-
strip.request.searchV6.filters[0].andFilters.push({ isInIntranet: ['false'] });
|
|
2641
|
-
}
|
|
2642
|
-
return strip;
|
|
2643
|
-
}));
|
|
2644
|
-
if (widget.widgetData.noDataWidget && widget.widgetData.noDataWidget.widgetData.strips) {
|
|
2645
|
-
widget.widgetData.noDataWidget.widgetData.strips = widget.widgetData.noDataWidget.widgetData.strips.map((function (strip) {
|
|
2646
|
-
strip.request.searchV6.filters[0].andFilters.push({ catalogPaths: [tag] });
|
|
2647
|
-
if (_this.utilitySvc.isMobile && !_this.isIntranetAllowedSettings) {
|
|
2648
|
-
strip.request.searchV6.filters[0].andFilters.push({ isInIntranet: ['false'] });
|
|
2649
|
-
}
|
|
2650
|
-
return strip;
|
|
2651
|
-
}));
|
|
2652
|
-
}
|
|
2653
|
-
}
|
|
2654
|
-
return widget;
|
|
2655
|
-
}));
|
|
2656
|
-
return pageData;
|
|
2657
|
-
};
|
|
2658
|
-
ExploreDetailResolve.decorators = [
|
|
2659
|
-
{ type: core.Injectable, args: [{
|
|
2660
|
-
providedIn: 'root',
|
|
2843
|
+
exports: [PipeHtmlTagRemovalPipe],
|
|
2661
2844
|
},] }
|
|
2662
2845
|
];
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
{ type: ConfigurationsService },
|
|
2666
|
-
{ type: UtilityService }
|
|
2667
|
-
]; };
|
|
2668
|
-
/** @nocollapse */ ExploreDetailResolve.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function ExploreDetailResolve_Factory() { return new ExploreDetailResolve(core.ɵɵinject(http.HttpClient), core.ɵɵinject(ConfigurationsService), core.ɵɵinject(UtilityService)); }, token: ExploreDetailResolve, providedIn: "root" });
|
|
2669
|
-
return ExploreDetailResolve;
|
|
2670
|
-
}());
|
|
2671
|
-
if (false) {
|
|
2672
|
-
ExploreDetailResolve.prototype.baseUrl;
|
|
2673
|
-
ExploreDetailResolve.prototype.isIntranetAllowedSettings;
|
|
2674
|
-
ExploreDetailResolve.prototype.http;
|
|
2675
|
-
ExploreDetailResolve.prototype.configSvc;
|
|
2676
|
-
ExploreDetailResolve.prototype.utilitySvc;
|
|
2677
|
-
}
|
|
2846
|
+
return PipeHtmlTagRemovalModule;
|
|
2847
|
+
}());
|
|
2678
2848
|
|
|
2679
|
-
var
|
|
2680
|
-
function
|
|
2681
|
-
this.http = http;
|
|
2849
|
+
var PipeFilterPipe = (function () {
|
|
2850
|
+
function PipeFilterPipe() {
|
|
2682
2851
|
}
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
pageData.pageLayout.widgetData.widgets = pageData.pageLayout.widgetData.widgets.map((function (widget) {
|
|
2690
|
-
if (widget.widgetSubType === 'contentStripMultiple') {
|
|
2691
|
-
widget.widgetData.strips = widget.widgetData.strips.map((function (strip) {
|
|
2692
|
-
strip.request.search.filters.catalogPaths = [decodeURIComponent(tag)];
|
|
2693
|
-
return strip;
|
|
2694
|
-
}));
|
|
2695
|
-
}
|
|
2696
|
-
return widget;
|
|
2697
|
-
}));
|
|
2698
|
-
return pageData;
|
|
2852
|
+
PipeFilterPipe.prototype.transform = function (value, keys, term) {
|
|
2853
|
+
if (!term) {
|
|
2854
|
+
return value;
|
|
2855
|
+
}
|
|
2856
|
+
return (value || []).filter((function (item) { return keys.split(',')
|
|
2857
|
+
.some((function (key) { return item.hasOwnProperty(key) && new RegExp("^" + term + "$", 'gi').test(item[key]); })); }));
|
|
2699
2858
|
};
|
|
2700
|
-
|
|
2701
|
-
{ type: core.
|
|
2702
|
-
|
|
2859
|
+
PipeFilterPipe.decorators = [
|
|
2860
|
+
{ type: core.Pipe, args: [{
|
|
2861
|
+
name: 'pipeFilter',
|
|
2703
2862
|
},] }
|
|
2704
2863
|
];
|
|
2705
|
-
|
|
2706
|
-
{ type: http.HttpClient }
|
|
2707
|
-
]; };
|
|
2708
|
-
/** @nocollapse */ MarketingOfferingResolve.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function MarketingOfferingResolve_Factory() { return new MarketingOfferingResolve(core.ɵɵinject(http.HttpClient)); }, token: MarketingOfferingResolve, providedIn: "root" });
|
|
2709
|
-
return MarketingOfferingResolve;
|
|
2864
|
+
return PipeFilterPipe;
|
|
2710
2865
|
}());
|
|
2711
|
-
if (false) {
|
|
2712
|
-
MarketingOfferingResolve.prototype.http;
|
|
2713
|
-
}
|
|
2714
2866
|
|
|
2715
|
-
var
|
|
2716
|
-
|
|
2717
|
-
function IPage() { }
|
|
2718
|
-
NsPage.IPage = IPage;
|
|
2719
|
-
if (false) {
|
|
2720
|
-
IPage.prototype.contentType;
|
|
2721
|
-
IPage.prototype.navigationBar;
|
|
2722
|
-
IPage.prototype.pageLayout;
|
|
2723
|
-
IPage.prototype.tourGuide;
|
|
2724
|
-
}
|
|
2725
|
-
function INavBar() { }
|
|
2726
|
-
NsPage.INavBar = INavBar;
|
|
2727
|
-
if (false) {
|
|
2728
|
-
INavBar.prototype.links;
|
|
2729
|
-
INavBar.prototype.xsmallNonMenuLinks;
|
|
2730
|
-
INavBar.prototype.pageBackLink;
|
|
2731
|
-
INavBar.prototype.pageTitle;
|
|
2732
|
-
INavBar.prototype.background;
|
|
2733
|
-
}
|
|
2734
|
-
function INavBackground() { }
|
|
2735
|
-
NsPage.INavBackground = INavBackground;
|
|
2736
|
-
if (false) {
|
|
2737
|
-
INavBackground.prototype.color;
|
|
2738
|
-
INavBackground.prototype.styles;
|
|
2739
|
-
}
|
|
2740
|
-
function INavLink() { }
|
|
2741
|
-
NsPage.INavLink = INavLink;
|
|
2742
|
-
if (false) {
|
|
2743
|
-
INavLink.prototype.config;
|
|
2744
|
-
INavLink.prototype.actionBtnId;
|
|
2745
|
-
INavLink.prototype.actionBtn;
|
|
2746
|
-
INavLink.prototype.actionBtnName;
|
|
2747
|
-
}
|
|
2748
|
-
function INavLinkConfig() { }
|
|
2749
|
-
NsPage.INavLinkConfig = INavLinkConfig;
|
|
2750
|
-
if (false) {
|
|
2751
|
-
INavLinkConfig.prototype.type;
|
|
2752
|
-
INavLinkConfig.prototype.hideIcon;
|
|
2753
|
-
INavLinkConfig.prototype.hideTitle;
|
|
2754
|
-
INavLinkConfig.prototype.hideStatus;
|
|
2755
|
-
INavLinkConfig.prototype.hidePin;
|
|
2756
|
-
INavLinkConfig.prototype.iconColor;
|
|
2757
|
-
INavLinkConfig.prototype.treatAsCard;
|
|
2758
|
-
INavLinkConfig.prototype.useShortName;
|
|
2867
|
+
var PipeFilterModule = (function () {
|
|
2868
|
+
function PipeFilterModule() {
|
|
2759
2869
|
}
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2870
|
+
PipeFilterModule.decorators = [
|
|
2871
|
+
{ type: core.NgModule, args: [{
|
|
2872
|
+
declarations: [PipeFilterPipe],
|
|
2873
|
+
imports: [
|
|
2874
|
+
common.CommonModule,
|
|
2875
|
+
],
|
|
2876
|
+
exports: [PipeFilterPipe],
|
|
2877
|
+
},] }
|
|
2878
|
+
];
|
|
2879
|
+
return PipeFilterModule;
|
|
2880
|
+
}());
|
|
2765
2881
|
|
|
2766
|
-
var
|
|
2767
|
-
function
|
|
2768
|
-
this.configSvc = configSvc;
|
|
2769
|
-
this.http = http;
|
|
2770
|
-
this.locale = locale;
|
|
2771
|
-
this.baseUrl = this.configSvc.sitePath;
|
|
2882
|
+
var PipeFilterSearchPipe = (function () {
|
|
2883
|
+
function PipeFilterSearchPipe() {
|
|
2772
2884
|
}
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
if (route.data.pageType === 'feature' && route.data.pageKey) {
|
|
2778
|
-
return this.getData(this.baseUrl + "/feature/" + route.data.pageKey);
|
|
2779
|
-
}
|
|
2780
|
-
if (route.data.pageType === 'page' &&
|
|
2781
|
-
route.data.pageKey &&
|
|
2782
|
-
route.paramMap.has(route.data.pageKey)) {
|
|
2783
|
-
return this.getData(this.baseUrl + "/page/" + route.paramMap.get(route.data.pageKey));
|
|
2885
|
+
PipeFilterSearchPipe.prototype.transform = function (items, searchText) {
|
|
2886
|
+
var keys = [];
|
|
2887
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
2888
|
+
keys[_i - 2] = arguments[_i];
|
|
2784
2889
|
}
|
|
2785
|
-
if (
|
|
2786
|
-
|
|
2787
|
-
route.data.pageKey === 'toc') {
|
|
2788
|
-
return this.getData(this.baseUrl + "/page/" + route.data.pageKey);
|
|
2890
|
+
if (!items) {
|
|
2891
|
+
return [];
|
|
2789
2892
|
}
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
error: 'CONFIGURATION_ERROR_PAGE_URL_NOT_FORMED',
|
|
2793
|
-
};
|
|
2794
|
-
};
|
|
2795
|
-
PageResolve.prototype.setS3Cookie = function (contentId) {
|
|
2796
|
-
return this.http.post("/apis/protected/v8/content/setCookie", { contentId: contentId }).pipe(operators.catchError((function (_err) { return rxjs.of(true); })));
|
|
2797
|
-
};
|
|
2798
|
-
PageResolve.prototype.getContent = function (id) {
|
|
2799
|
-
return this.http
|
|
2800
|
-
.post("/apis/protected/v8/content/" + id + "?hierarchyType=minimal", ['status', 'artifactUrl']);
|
|
2801
|
-
};
|
|
2802
|
-
PageResolve.prototype.getData = function (url) {
|
|
2803
|
-
var _this = this;
|
|
2804
|
-
var id = (((url.split('/').pop()))).split('.')[0] || '';
|
|
2805
|
-
var equivalentId = id.startsWith('lex_auth_') ? id : JSON_MAP[id];
|
|
2806
|
-
if (equivalentId) {
|
|
2807
|
-
return rxjs.forkJoin([this.setS3Cookie(equivalentId), this.getContent(equivalentId)]).pipe(operators.mergeMap((function (_a) {
|
|
2808
|
-
var _b = __read(_a, 2), _ = _b[0], v = _b[1];
|
|
2809
|
-
if (v.status === 'Expired' || v.status === 'Deleted' || !v.artifactUrl) {
|
|
2810
|
-
return rxjs.of({ data: null, error: 'NoContent' });
|
|
2811
|
-
}
|
|
2812
|
-
return _this.http
|
|
2813
|
-
.get(v.artifactUrl + "?ts=" + new Date().getTime())
|
|
2814
|
-
.pipe(operators.map((function (data) { return ({ data: data, error: null }); })), operators.catchError((function (err) { return rxjs.of({ data: null, error: err }); })));
|
|
2815
|
-
})), operators.catchError((function (err) { return rxjs.of({ data: null, error: err }); })));
|
|
2893
|
+
if (!searchText) {
|
|
2894
|
+
return items;
|
|
2816
2895
|
}
|
|
2817
|
-
var
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
];
|
|
2825
|
-
return rxjs.forkJoin(pageRequest).pipe(operators.map((function (_a) {
|
|
2826
|
-
var _b = __read(_a, 2), general = _b[0], withLocale = _b[1];
|
|
2827
|
-
if (withLocale.data) {
|
|
2828
|
-
return withLocale;
|
|
2896
|
+
var searchTextLowerCase = searchText.toLowerCase();
|
|
2897
|
+
if (keys && keys.length) {
|
|
2898
|
+
var result = items.filter((function (it) {
|
|
2899
|
+
return it['personalDetails'][keys[0]].toLowerCase().includes(searchTextLowerCase);
|
|
2900
|
+
}));
|
|
2901
|
+
if (result && result.length <= 0) {
|
|
2902
|
+
return [-1];
|
|
2829
2903
|
}
|
|
2830
|
-
return
|
|
2831
|
-
}
|
|
2904
|
+
return result;
|
|
2905
|
+
}
|
|
2906
|
+
return items.filter((function (it) {
|
|
2907
|
+
return it.title.toLowerCase().includes(searchTextLowerCase);
|
|
2908
|
+
}));
|
|
2832
2909
|
};
|
|
2833
|
-
|
|
2834
|
-
{ type: core.
|
|
2835
|
-
|
|
2910
|
+
PipeFilterSearchPipe.decorators = [
|
|
2911
|
+
{ type: core.Pipe, args: [{
|
|
2912
|
+
name: 'pipeFilterSearch',
|
|
2836
2913
|
},] }
|
|
2837
2914
|
];
|
|
2838
|
-
|
|
2839
|
-
{ type: ConfigurationsService },
|
|
2840
|
-
{ type: http.HttpClient },
|
|
2841
|
-
{ type: String, decorators: [{ type: core.Inject, args: [core.LOCALE_ID,] }] }
|
|
2842
|
-
]; };
|
|
2843
|
-
/** @nocollapse */ PageResolve.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PageResolve_Factory() { return new PageResolve(core.ɵɵinject(ConfigurationsService), core.ɵɵinject(http.HttpClient), core.ɵɵinject(core.LOCALE_ID)); }, token: PageResolve, providedIn: "root" });
|
|
2844
|
-
return PageResolve;
|
|
2915
|
+
return PipeFilterSearchPipe;
|
|
2845
2916
|
}());
|
|
2846
|
-
if (false) {
|
|
2847
|
-
PageResolve.prototype.baseUrl;
|
|
2848
|
-
PageResolve.prototype.configSvc;
|
|
2849
|
-
PageResolve.prototype.http;
|
|
2850
|
-
PageResolve.prototype.locale;
|
|
2851
|
-
}
|
|
2852
2917
|
|
|
2853
|
-
function
|
|
2854
|
-
|
|
2855
|
-
IResolveResponse.prototype.data;
|
|
2856
|
-
IResolveResponse.prototype.error;
|
|
2857
|
-
}
|
|
2858
|
-
|
|
2859
|
-
var LoggerService = (function () {
|
|
2860
|
-
function LoggerService(configSvc) {
|
|
2861
|
-
this.configSvc = configSvc;
|
|
2862
|
-
this.consoleError = console.error;
|
|
2863
|
-
this.consoleInfo = console.info;
|
|
2864
|
-
this.consoleLog = console.log;
|
|
2865
|
-
this.consoleWarn = console.warn;
|
|
2866
|
-
this.noConsole = (function () { });
|
|
2918
|
+
var PipeFilterSearchModule = (function () {
|
|
2919
|
+
function PipeFilterSearchModule() {
|
|
2867
2920
|
}
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
enumerable: true,
|
|
2887
|
-
configurable: true
|
|
2888
|
-
});
|
|
2889
|
-
Object.defineProperty(LoggerService.prototype, "warn", {
|
|
2890
|
-
get: function () {
|
|
2891
|
-
return this.configSvc.isProduction ? this.noConsole : this.consoleWarn;
|
|
2892
|
-
},
|
|
2893
|
-
enumerable: true,
|
|
2894
|
-
configurable: true
|
|
2895
|
-
});
|
|
2896
|
-
LoggerService.prototype.removeConsoleAccess = function () {
|
|
2897
|
-
if (this.configSvc.isProduction) {
|
|
2898
|
-
return;
|
|
2921
|
+
PipeFilterSearchModule.decorators = [
|
|
2922
|
+
{ type: core.NgModule, args: [{
|
|
2923
|
+
declarations: [PipeFilterSearchPipe],
|
|
2924
|
+
imports: [
|
|
2925
|
+
common.CommonModule,
|
|
2926
|
+
],
|
|
2927
|
+
exports: [PipeFilterSearchPipe],
|
|
2928
|
+
},] }
|
|
2929
|
+
];
|
|
2930
|
+
return PipeFilterSearchModule;
|
|
2931
|
+
}());
|
|
2932
|
+
|
|
2933
|
+
var PipeListFilterPipe = (function () {
|
|
2934
|
+
function PipeListFilterPipe() {
|
|
2935
|
+
}
|
|
2936
|
+
PipeListFilterPipe.prototype.transform = function (value, keys, term) {
|
|
2937
|
+
if (!term) {
|
|
2938
|
+
return value;
|
|
2899
2939
|
}
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
console.warn = noConsoleWithError;
|
|
2904
|
-
console.info = noConsoleWithError;
|
|
2905
|
-
console.error = noConsoleWithError;
|
|
2940
|
+
return (value || []).filter((function (item) { return keys.split(',')
|
|
2941
|
+
.some((function (key) { return item.hasOwnProperty(key)
|
|
2942
|
+
&& item[key] && (item[key] + " ").toLocaleLowerCase().includes(term.toLocaleLowerCase()); })); }));
|
|
2906
2943
|
};
|
|
2907
|
-
|
|
2908
|
-
{ type: core.
|
|
2909
|
-
|
|
2944
|
+
PipeListFilterPipe.decorators = [
|
|
2945
|
+
{ type: core.Pipe, args: [{
|
|
2946
|
+
name: 'pipeListFilter',
|
|
2910
2947
|
},] }
|
|
2911
2948
|
];
|
|
2912
|
-
|
|
2913
|
-
{ type: ConfigurationsService }
|
|
2914
|
-
]; };
|
|
2915
|
-
/** @nocollapse */ LoggerService.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function LoggerService_Factory() { return new LoggerService(core.ɵɵinject(ConfigurationsService)); }, token: LoggerService, providedIn: "root" });
|
|
2916
|
-
return LoggerService;
|
|
2949
|
+
return PipeListFilterPipe;
|
|
2917
2950
|
}());
|
|
2918
|
-
if (false) {
|
|
2919
|
-
LoggerService.prototype.consoleError;
|
|
2920
|
-
LoggerService.prototype.consoleInfo;
|
|
2921
|
-
LoggerService.prototype.consoleLog;
|
|
2922
|
-
LoggerService.prototype.consoleWarn;
|
|
2923
|
-
LoggerService.prototype.noConsole;
|
|
2924
|
-
LoggerService.prototype.configSvc;
|
|
2925
|
-
}
|
|
2926
2951
|
|
|
2927
|
-
var
|
|
2928
|
-
|
|
2929
|
-
var storage = localStorage;
|
|
2930
|
-
var API_ENDPOINTS = {
|
|
2931
|
-
sharePointToken: '/apis/protected/v8/user/token',
|
|
2932
|
-
};
|
|
2933
|
-
var AuthMicrosoftService = (function () {
|
|
2934
|
-
function AuthMicrosoftService(loggerSvc, http) {
|
|
2935
|
-
this.loggerSvc = loggerSvc;
|
|
2936
|
-
this.http = http;
|
|
2937
|
-
this.msConfig = {
|
|
2938
|
-
clientId: '',
|
|
2939
|
-
tenant: '',
|
|
2940
|
-
defaultEmailId: '',
|
|
2941
|
-
validEmailExtensions: [],
|
|
2942
|
-
isConfigured: false,
|
|
2943
|
-
};
|
|
2944
|
-
this.emailUsed = null;
|
|
2945
|
-
this.code = null;
|
|
2946
|
-
this.msToken = {
|
|
2947
|
-
accessToken: '',
|
|
2948
|
-
expiresOn: '',
|
|
2949
|
-
resource: '',
|
|
2950
|
-
tokenType: '',
|
|
2951
|
-
};
|
|
2952
|
+
var PipeListFilterModule = (function () {
|
|
2953
|
+
function PipeListFilterModule() {
|
|
2952
2954
|
}
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
return base + "?" + searchParam.toString() + "#" + fragment;
|
|
2972
|
-
}
|
|
2973
|
-
return base + "?" + searchParam.toString();
|
|
2974
|
-
}
|
|
2975
|
-
return null;
|
|
2976
|
-
},
|
|
2977
|
-
enumerable: true,
|
|
2978
|
-
configurable: true
|
|
2979
|
-
});
|
|
2980
|
-
AuthMicrosoftService.prototype.logoutUrl = function (redirectUrl) {
|
|
2981
|
-
if (this.isValidEmail(this.emailUsed || '')) {
|
|
2982
|
-
return "https://login.microsoftonline.com/common/oauth2/logout?post_logout_redirect_uri=" + redirectUrl;
|
|
2955
|
+
PipeListFilterModule.decorators = [
|
|
2956
|
+
{ type: core.NgModule, args: [{
|
|
2957
|
+
declarations: [PipeListFilterPipe],
|
|
2958
|
+
imports: [
|
|
2959
|
+
common.CommonModule,
|
|
2960
|
+
],
|
|
2961
|
+
exports: [PipeListFilterPipe],
|
|
2962
|
+
},] }
|
|
2963
|
+
];
|
|
2964
|
+
return PipeListFilterModule;
|
|
2965
|
+
}());
|
|
2966
|
+
|
|
2967
|
+
var PipeRelativeTimePipe = (function () {
|
|
2968
|
+
function PipeRelativeTimePipe() {
|
|
2969
|
+
}
|
|
2970
|
+
PipeRelativeTimePipe.prototype.transform = function (value) {
|
|
2971
|
+
if (value) {
|
|
2972
|
+
return moment((new Date(value))).fromNow();
|
|
2983
2973
|
}
|
|
2984
|
-
return
|
|
2985
|
-
};
|
|
2986
|
-
AuthMicrosoftService.prototype.init = function (config) {
|
|
2987
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
2988
|
-
var queryParams, url;
|
|
2989
|
-
return __generator(this, function (_a) {
|
|
2990
|
-
switch (_a.label) {
|
|
2991
|
-
case 0:
|
|
2992
|
-
if (!config || !config.microsoft || !config.microsoft.isConfigured) {
|
|
2993
|
-
this.loggerSvc.warn('Empty/No Configuration passed, ignoring Microsoft Authentication');
|
|
2994
|
-
}
|
|
2995
|
-
this.msConfig = config.microsoft;
|
|
2996
|
-
queryParams = new URLSearchParams(location.search);
|
|
2997
|
-
if (!(queryParams.has('code') && queryParams.has('session_state'))) return [3, 2];
|
|
2998
|
-
this.code = queryParams.get('code');
|
|
2999
|
-
if (!this.code) {
|
|
3000
|
-
return [2];
|
|
3001
|
-
}
|
|
3002
|
-
url = location.origin + location.pathname;
|
|
3003
|
-
return [4, this.exchangeTokenForCode(this.code, url)];
|
|
3004
|
-
case 1:
|
|
3005
|
-
_a.sent();
|
|
3006
|
-
if (location.hash) {
|
|
3007
|
-
url += location.hash.substring(1);
|
|
3008
|
-
}
|
|
3009
|
-
history.replaceState(null, '', url);
|
|
3010
|
-
_a.label = 2;
|
|
3011
|
-
case 2: return [2];
|
|
3012
|
-
}
|
|
3013
|
-
});
|
|
3014
|
-
});
|
|
3015
|
-
};
|
|
3016
|
-
AuthMicrosoftService.prototype.login = function (email) {
|
|
3017
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3018
|
-
var loginUrl;
|
|
3019
|
-
return __generator(this, function (_a) {
|
|
3020
|
-
if (!this.isValidEmail(email)) {
|
|
3021
|
-
this.loggerSvc.warn("Microsoft Login is not allowed for your emailId (" + email + ")");
|
|
3022
|
-
return [2];
|
|
3023
|
-
}
|
|
3024
|
-
loginUrl = this.loginUrl;
|
|
3025
|
-
if (loginUrl) {
|
|
3026
|
-
location.assign(loginUrl);
|
|
3027
|
-
}
|
|
3028
|
-
else {
|
|
3029
|
-
this.loggerSvc.warn('Unable to identify Office Login URL, Ignoring login request');
|
|
3030
|
-
}
|
|
3031
|
-
return [2];
|
|
3032
|
-
});
|
|
3033
|
-
});
|
|
3034
|
-
};
|
|
3035
|
-
AuthMicrosoftService.prototype.getToken = function (email) {
|
|
3036
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3037
|
-
var _a, error_1, _b, error_2;
|
|
3038
|
-
return __generator(this, function (_c) {
|
|
3039
|
-
switch (_c.label) {
|
|
3040
|
-
case 0:
|
|
3041
|
-
if (this.msToken &&
|
|
3042
|
-
this.isValid(this.msToken.accessToken, this.msToken.expiresOn) &&
|
|
3043
|
-
this.msToken.accessToken) {
|
|
3044
|
-
return [2, this.msToken.accessToken];
|
|
3045
|
-
}
|
|
3046
|
-
if (!this.isValidEmail(email)) return [3, 4];
|
|
3047
|
-
_c.label = 1;
|
|
3048
|
-
case 1:
|
|
3049
|
-
_c.trys.push([1, 3, , 4]);
|
|
3050
|
-
_a = this;
|
|
3051
|
-
return [4, this.getTokenForEmail(email)];
|
|
3052
|
-
case 2:
|
|
3053
|
-
_a.msToken = _c.sent();
|
|
3054
|
-
if (this.msToken.accessToken) {
|
|
3055
|
-
this.emailUsed = email;
|
|
3056
|
-
return [2, this.msToken.accessToken];
|
|
3057
|
-
}
|
|
3058
|
-
return [3, 4];
|
|
3059
|
-
case 3:
|
|
3060
|
-
error_1 = _c.sent();
|
|
3061
|
-
if (!this.code) {
|
|
3062
|
-
this.login(email);
|
|
3063
|
-
}
|
|
3064
|
-
return [3, 4];
|
|
3065
|
-
case 4:
|
|
3066
|
-
if (!(this.msConfig.defaultEmailId && this.isValidEmail(this.msConfig.defaultEmailId))) return [3, 8];
|
|
3067
|
-
_c.label = 5;
|
|
3068
|
-
case 5:
|
|
3069
|
-
_c.trys.push([5, 7, , 8]);
|
|
3070
|
-
_b = this;
|
|
3071
|
-
return [4, this.getTokenForEmail(this.msConfig.defaultEmailId)];
|
|
3072
|
-
case 6:
|
|
3073
|
-
_b.msToken = _c.sent();
|
|
3074
|
-
if (this.msToken.accessToken) {
|
|
3075
|
-
this.emailUsed = this.msConfig.defaultEmailId;
|
|
3076
|
-
return [2, this.msToken.accessToken];
|
|
3077
|
-
}
|
|
3078
|
-
return [3, 8];
|
|
3079
|
-
case 7:
|
|
3080
|
-
error_2 = _c.sent();
|
|
3081
|
-
return [3, 8];
|
|
3082
|
-
case 8: throw new Error('UNABLE TO FETCH MS AUTH TOKEN');
|
|
3083
|
-
}
|
|
3084
|
-
});
|
|
3085
|
-
});
|
|
2974
|
+
return moment().startOf('hour').fromNow();
|
|
3086
2975
|
};
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
2976
|
+
PipeRelativeTimePipe.decorators = [
|
|
2977
|
+
{ type: core.Pipe, args: [{
|
|
2978
|
+
name: 'pipeRelativeTime',
|
|
2979
|
+
},] }
|
|
2980
|
+
];
|
|
2981
|
+
return PipeRelativeTimePipe;
|
|
2982
|
+
}());
|
|
2983
|
+
|
|
2984
|
+
var PipeRelativeTimeModule = (function () {
|
|
2985
|
+
function PipeRelativeTimeModule() {
|
|
2986
|
+
}
|
|
2987
|
+
PipeRelativeTimeModule.decorators = [
|
|
2988
|
+
{ type: core.NgModule, args: [{
|
|
2989
|
+
declarations: [PipeRelativeTimePipe],
|
|
2990
|
+
imports: [
|
|
2991
|
+
common.CommonModule,
|
|
2992
|
+
],
|
|
2993
|
+
exports: [PipeRelativeTimePipe],
|
|
2994
|
+
},] }
|
|
2995
|
+
];
|
|
2996
|
+
return PipeRelativeTimeModule;
|
|
2997
|
+
}());
|
|
2998
|
+
|
|
2999
|
+
var OrderByPipe = (function () {
|
|
3000
|
+
function OrderByPipe() {
|
|
3001
|
+
this.transform = _.orderBy;
|
|
3002
|
+
}
|
|
3003
|
+
OrderByPipe.decorators = [
|
|
3004
|
+
{ type: core.Pipe, args: [{
|
|
3005
|
+
name: 'orderBy',
|
|
3006
|
+
},] }
|
|
3007
|
+
];
|
|
3008
|
+
return OrderByPipe;
|
|
3009
|
+
}());
|
|
3010
|
+
if (false) {
|
|
3011
|
+
OrderByPipe.prototype.transform;
|
|
3012
|
+
}
|
|
3013
|
+
|
|
3014
|
+
var PipeOrderByModule = (function () {
|
|
3015
|
+
function PipeOrderByModule() {
|
|
3016
|
+
}
|
|
3017
|
+
PipeOrderByModule.decorators = [
|
|
3018
|
+
{ type: core.NgModule, args: [{
|
|
3019
|
+
declarations: [OrderByPipe],
|
|
3020
|
+
imports: [
|
|
3021
|
+
common.CommonModule,
|
|
3022
|
+
],
|
|
3023
|
+
exports: [OrderByPipe],
|
|
3024
|
+
},] }
|
|
3025
|
+
];
|
|
3026
|
+
return PipeOrderByModule;
|
|
3027
|
+
}());
|
|
3028
|
+
|
|
3029
|
+
var PipeLimitToPipe = (function () {
|
|
3030
|
+
function PipeLimitToPipe() {
|
|
3031
|
+
}
|
|
3032
|
+
PipeLimitToPipe.prototype.transform = function (data, limit) {
|
|
3033
|
+
if (limit === void 0) { limit = 5; }
|
|
3034
|
+
if (!data || !data.length) {
|
|
3035
|
+
return null;
|
|
3090
3036
|
}
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
msPrevTS = parseInt(storage.getItem(storageKey) || '0', 10);
|
|
3037
|
+
if (Array.isArray(data)) {
|
|
3038
|
+
return data.slice(0, limit);
|
|
3094
3039
|
}
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3040
|
+
if (typeof data === 'string') {
|
|
3041
|
+
var slicedString = data.substr(0, limit);
|
|
3042
|
+
if (limit < data.length) {
|
|
3043
|
+
return slicedString + "...";
|
|
3044
|
+
}
|
|
3045
|
+
return slicedString;
|
|
3100
3046
|
}
|
|
3047
|
+
return null;
|
|
3101
3048
|
};
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3049
|
+
PipeLimitToPipe.decorators = [
|
|
3050
|
+
{ type: core.Pipe, args: [{
|
|
3051
|
+
name: 'pipeLimitTo',
|
|
3052
|
+
},] }
|
|
3053
|
+
];
|
|
3054
|
+
return PipeLimitToPipe;
|
|
3055
|
+
}());
|
|
3056
|
+
|
|
3057
|
+
var PipeLimitToModule = (function () {
|
|
3058
|
+
function PipeLimitToModule() {
|
|
3059
|
+
}
|
|
3060
|
+
PipeLimitToModule.decorators = [
|
|
3061
|
+
{ type: core.NgModule, args: [{
|
|
3062
|
+
declarations: [PipeLimitToPipe],
|
|
3063
|
+
imports: [
|
|
3064
|
+
common.CommonModule,
|
|
3065
|
+
],
|
|
3066
|
+
exports: [PipeLimitToPipe],
|
|
3067
|
+
},] }
|
|
3068
|
+
];
|
|
3069
|
+
return PipeLimitToModule;
|
|
3070
|
+
}());
|
|
3071
|
+
|
|
3072
|
+
function IUserName() { }
|
|
3073
|
+
if (false) {
|
|
3074
|
+
IUserName.prototype.firstName;
|
|
3075
|
+
IUserName.prototype.lastName;
|
|
3076
|
+
IUserName.prototype.email;
|
|
3077
|
+
}
|
|
3078
|
+
var PipeNameTransformPipe = (function () {
|
|
3079
|
+
function PipeNameTransformPipe() {
|
|
3080
|
+
}
|
|
3081
|
+
PipeNameTransformPipe.prototype.transform = function (value) {
|
|
3082
|
+
var result = '';
|
|
3083
|
+
if (value.firstName) {
|
|
3084
|
+
result += value.firstName;
|
|
3108
3085
|
}
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
case 1:
|
|
3120
|
-
response = _a.sent();
|
|
3121
|
-
return [2, this.getInstanceFromResponse(response)];
|
|
3122
|
-
}
|
|
3123
|
-
});
|
|
3124
|
-
});
|
|
3086
|
+
if (value.lastName && value.lastName !== value.firstName) {
|
|
3087
|
+
result += " " + value.lastName;
|
|
3088
|
+
}
|
|
3089
|
+
if (result.trim() !== '') {
|
|
3090
|
+
return result;
|
|
3091
|
+
}
|
|
3092
|
+
if (value.email) {
|
|
3093
|
+
return value.email;
|
|
3094
|
+
}
|
|
3095
|
+
return 'Anonymous User';
|
|
3125
3096
|
};
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3097
|
+
PipeNameTransformPipe.decorators = [
|
|
3098
|
+
{ type: core.Pipe, args: [{
|
|
3099
|
+
name: 'pipeNameTransform',
|
|
3100
|
+
},] }
|
|
3101
|
+
];
|
|
3102
|
+
return PipeNameTransformPipe;
|
|
3103
|
+
}());
|
|
3104
|
+
|
|
3105
|
+
var PipeNameTransformModule = (function () {
|
|
3106
|
+
function PipeNameTransformModule() {
|
|
3107
|
+
}
|
|
3108
|
+
PipeNameTransformModule.decorators = [
|
|
3109
|
+
{ type: core.NgModule, args: [{
|
|
3110
|
+
declarations: [PipeNameTransformPipe],
|
|
3111
|
+
imports: [
|
|
3112
|
+
common.CommonModule,
|
|
3113
|
+
],
|
|
3114
|
+
exports: [PipeNameTransformPipe],
|
|
3115
|
+
},] }
|
|
3116
|
+
];
|
|
3117
|
+
return PipeNameTransformModule;
|
|
3118
|
+
}());
|
|
3119
|
+
|
|
3120
|
+
var PipePartialContentPipe = (function () {
|
|
3121
|
+
function PipePartialContentPipe() {
|
|
3122
|
+
}
|
|
3123
|
+
PipePartialContentPipe.prototype.transform = function (value, keys) {
|
|
3124
|
+
var e_1, _a;
|
|
3125
|
+
var result = {};
|
|
3126
|
+
try {
|
|
3127
|
+
for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
|
|
3128
|
+
var key = keys_1_1.value;
|
|
3129
|
+
if (value[key]) {
|
|
3130
|
+
result[key] = value[key];
|
|
3137
3131
|
}
|
|
3138
|
-
}
|
|
3139
|
-
}
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
3135
|
+
finally {
|
|
3136
|
+
try {
|
|
3137
|
+
if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);
|
|
3138
|
+
}
|
|
3139
|
+
finally { if (e_1) throw e_1.error; }
|
|
3140
|
+
}
|
|
3141
|
+
return result;
|
|
3140
3142
|
};
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3143
|
+
PipePartialContentPipe.decorators = [
|
|
3144
|
+
{ type: core.Pipe, args: [{
|
|
3145
|
+
name: 'pipePartialContent',
|
|
3146
|
+
},] }
|
|
3147
|
+
];
|
|
3148
|
+
return PipePartialContentPipe;
|
|
3149
|
+
}());
|
|
3150
|
+
|
|
3151
|
+
var PipePartialContentModule = (function () {
|
|
3152
|
+
function PipePartialContentModule() {
|
|
3153
|
+
}
|
|
3154
|
+
PipePartialContentModule.decorators = [
|
|
3155
|
+
{ type: core.NgModule, args: [{
|
|
3156
|
+
declarations: [PipePartialContentPipe],
|
|
3157
|
+
imports: [
|
|
3158
|
+
common.CommonModule,
|
|
3159
|
+
],
|
|
3160
|
+
exports: [PipePartialContentPipe],
|
|
3161
|
+
},] }
|
|
3162
|
+
];
|
|
3163
|
+
return PipePartialContentModule;
|
|
3164
|
+
}());
|
|
3165
|
+
|
|
3166
|
+
var PipeSafeSanitizerPipe = (function () {
|
|
3167
|
+
function PipeSafeSanitizerPipe(sanitizer) {
|
|
3168
|
+
this.sanitizer = sanitizer;
|
|
3169
|
+
}
|
|
3170
|
+
PipeSafeSanitizerPipe.prototype.transform = function (value, type) {
|
|
3171
|
+
if (type === void 0) { type = 'html'; }
|
|
3172
|
+
switch (type) {
|
|
3173
|
+
case 'html':
|
|
3174
|
+
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
3175
|
+
case 'style':
|
|
3176
|
+
return this.sanitizer.bypassSecurityTrustStyle(value);
|
|
3177
|
+
case 'script':
|
|
3178
|
+
return this.sanitizer.bypassSecurityTrustScript(value);
|
|
3179
|
+
case 'url':
|
|
3180
|
+
return this.sanitizer.bypassSecurityTrustUrl(value);
|
|
3181
|
+
case 'resourceUrl':
|
|
3182
|
+
return this.sanitizer.bypassSecurityTrustResourceUrl(value);
|
|
3183
|
+
default:
|
|
3184
|
+
throw new Error("Invalid safe type specified: " + type);
|
|
3185
|
+
}
|
|
3148
3186
|
};
|
|
3149
|
-
|
|
3150
|
-
{ type: core.
|
|
3151
|
-
|
|
3187
|
+
PipeSafeSanitizerPipe.decorators = [
|
|
3188
|
+
{ type: core.Pipe, args: [{
|
|
3189
|
+
name: 'pipeSafeSanitizer',
|
|
3152
3190
|
},] }
|
|
3153
3191
|
];
|
|
3154
|
-
|
|
3155
|
-
{ type:
|
|
3156
|
-
{ type: http.HttpClient }
|
|
3192
|
+
PipeSafeSanitizerPipe.ctorParameters = function () { return [
|
|
3193
|
+
{ type: platformBrowser.DomSanitizer }
|
|
3157
3194
|
]; };
|
|
3158
|
-
|
|
3159
|
-
return AuthMicrosoftService;
|
|
3195
|
+
return PipeSafeSanitizerPipe;
|
|
3160
3196
|
}());
|
|
3161
3197
|
if (false) {
|
|
3162
|
-
|
|
3163
|
-
AuthMicrosoftService.prototype.emailUsed;
|
|
3164
|
-
AuthMicrosoftService.prototype.code;
|
|
3165
|
-
AuthMicrosoftService.prototype.msToken;
|
|
3166
|
-
AuthMicrosoftService.prototype.loggerSvc;
|
|
3167
|
-
AuthMicrosoftService.prototype.http;
|
|
3198
|
+
PipeSafeSanitizerPipe.prototype.sanitizer;
|
|
3168
3199
|
}
|
|
3169
3200
|
|
|
3170
|
-
function
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3201
|
+
var PipeSafeSanitizerModule = (function () {
|
|
3202
|
+
function PipeSafeSanitizerModule() {
|
|
3203
|
+
}
|
|
3204
|
+
PipeSafeSanitizerModule.decorators = [
|
|
3205
|
+
{ type: core.NgModule, args: [{
|
|
3206
|
+
declarations: [PipeSafeSanitizerPipe],
|
|
3207
|
+
imports: [
|
|
3208
|
+
common.CommonModule,
|
|
3209
|
+
],
|
|
3210
|
+
exports: [PipeSafeSanitizerPipe],
|
|
3211
|
+
},] }
|
|
3212
|
+
];
|
|
3213
|
+
return PipeSafeSanitizerModule;
|
|
3214
|
+
}());
|
|
3215
|
+
|
|
3216
|
+
var ExploreDetailResolve = (function () {
|
|
3217
|
+
function ExploreDetailResolve(http, configSvc, utilitySvc) {
|
|
3182
3218
|
this.http = http;
|
|
3183
3219
|
this.configSvc = configSvc;
|
|
3184
|
-
this.
|
|
3185
|
-
this.
|
|
3186
|
-
this.
|
|
3187
|
-
this.loginChangeSubject.subscribe((function (isLoggedIn) {
|
|
3188
|
-
_this.configSvc.isAuthenticated = isLoggedIn;
|
|
3189
|
-
if (isLoggedIn &&
|
|
3190
|
-
_this.configSvc.instanceConfig &&
|
|
3191
|
-
Boolean(_this.configSvc.instanceConfig.disablePidCheck)) {
|
|
3192
|
-
_this.configSvc.userProfile = {
|
|
3193
|
-
email: _this.userEmail,
|
|
3194
|
-
userName: _this.userName,
|
|
3195
|
-
userId: _this.userId || '',
|
|
3196
|
-
};
|
|
3197
|
-
}
|
|
3198
|
-
}));
|
|
3220
|
+
this.utilitySvc = utilitySvc;
|
|
3221
|
+
this.baseUrl = this.configSvc.sitePath;
|
|
3222
|
+
this.isIntranetAllowedSettings = false;
|
|
3199
3223
|
}
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
}
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
Object.defineProperty(AuthKeycloakService.prototype, "token", {
|
|
3222
|
-
get: function () {
|
|
3223
|
-
return this.keycloakSvc.getKeycloakInstance().token;
|
|
3224
|
-
},
|
|
3225
|
-
enumerable: true,
|
|
3226
|
-
configurable: true
|
|
3227
|
-
});
|
|
3228
|
-
Object.defineProperty(AuthKeycloakService.prototype, "sessionId", {
|
|
3229
|
-
get: function () {
|
|
3230
|
-
return this.keycloakSvc.getKeycloakInstance().sessionId;
|
|
3231
|
-
},
|
|
3232
|
-
enumerable: true,
|
|
3233
|
-
configurable: true
|
|
3234
|
-
});
|
|
3235
|
-
Object.defineProperty(AuthKeycloakService.prototype, "userId", {
|
|
3236
|
-
get: function () {
|
|
3237
|
-
var kc = this.keycloakSvc.getKeycloakInstance();
|
|
3238
|
-
if (!kc) {
|
|
3239
|
-
return;
|
|
3224
|
+
ExploreDetailResolve.prototype.resolve = function (route, _state) {
|
|
3225
|
+
var _this = this;
|
|
3226
|
+
this.isIntranetAllowedSettings = this.configSvc.isIntranetAllowed;
|
|
3227
|
+
var tag = decodeURIComponent(route.params.tags);
|
|
3228
|
+
var url = '';
|
|
3229
|
+
if (route.data.pageUrl) {
|
|
3230
|
+
url = route.data.pageUrl;
|
|
3231
|
+
}
|
|
3232
|
+
if (route.data.pageType === 'page' && route.data.pageKey) {
|
|
3233
|
+
url = this.baseUrl + "/page/" + route.data.pageKey + ".json";
|
|
3234
|
+
}
|
|
3235
|
+
return this.http.get(url).pipe(operators.map((function (pageData) { return ({ data: _this.transformPageData(pageData, tag), error: null }); })), operators.catchError((function (err) { return rxjs.of({ data: null, error: err }); })));
|
|
3236
|
+
};
|
|
3237
|
+
ExploreDetailResolve.prototype.transformPageData = function (pageData, tag) {
|
|
3238
|
+
var _this = this;
|
|
3239
|
+
var DELIMITER = '>';
|
|
3240
|
+
var path = tag.split(DELIMITER);
|
|
3241
|
+
pageData.pageLayout.widgetData.widgets = pageData.pageLayout.widgetData.widgets.map((function (widget) {
|
|
3242
|
+
if (pageData.navigationBar && pageData.navigationBar.links) {
|
|
3243
|
+
pageData.navigationBar.links = pageData.navigationBar.links
|
|
3244
|
+
.filter((function (link) { return link.widgetData.tags === tag; }));
|
|
3240
3245
|
}
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
return ((kc.tokenParsed && (((kc.tokenParsed))).name) ||
|
|
3264
|
-
(kc.idTokenParsed && (((kc.idTokenParsed))).name));
|
|
3265
|
-
},
|
|
3266
|
-
enumerable: true,
|
|
3267
|
-
configurable: true
|
|
3268
|
-
});
|
|
3269
|
-
AuthKeycloakService.prototype.initAuth = function () {
|
|
3270
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3271
|
-
var instanceConfig, err_1;
|
|
3272
|
-
return __generator(this, function (_a) {
|
|
3273
|
-
switch (_a.label) {
|
|
3274
|
-
case 0:
|
|
3275
|
-
if (!this.configSvc.instanceConfig) {
|
|
3276
|
-
return [2, false];
|
|
3277
|
-
}
|
|
3278
|
-
instanceConfig = this.configSvc.instanceConfig;
|
|
3279
|
-
if (instanceConfig.microsoft.isConfigured) {
|
|
3280
|
-
this.msAuthSvc.init({ microsoft: instanceConfig.microsoft });
|
|
3246
|
+
if (widget.widgetSubType === 'cardBreadcrumb') {
|
|
3247
|
+
widget.widgetData.path = [{
|
|
3248
|
+
text: pageData.navigationBar.pageTitle,
|
|
3249
|
+
clickUrl: pageData.navigationBar.pageBackLink,
|
|
3250
|
+
}].concat(path.map((function (edge, idx) { return ({
|
|
3251
|
+
text: edge,
|
|
3252
|
+
clickUrl: "/page/explore/" + path.slice(0, idx + 1).join(DELIMITER),
|
|
3253
|
+
}); })));
|
|
3254
|
+
}
|
|
3255
|
+
if (widget.widgetSubType === 'contentStripMultiple') {
|
|
3256
|
+
widget.widgetData.strips = widget.widgetData.strips.map((function (strip) {
|
|
3257
|
+
strip.request.searchV6.filters[0].andFilters.push({ catalogPaths: [tag] });
|
|
3258
|
+
if (_this.utilitySvc.isMobile && !_this.isIntranetAllowedSettings) {
|
|
3259
|
+
strip.request.searchV6.filters[0].andFilters.push({ isInIntranet: ['false'] });
|
|
3260
|
+
}
|
|
3261
|
+
return strip;
|
|
3262
|
+
}));
|
|
3263
|
+
if (widget.widgetData.noDataWidget && widget.widgetData.noDataWidget.widgetData.strips) {
|
|
3264
|
+
widget.widgetData.noDataWidget.widgetData.strips = widget.widgetData.noDataWidget.widgetData.strips.map((function (strip) {
|
|
3265
|
+
strip.request.searchV6.filters[0].andFilters.push({ catalogPaths: [tag] });
|
|
3266
|
+
if (_this.utilitySvc.isMobile && !_this.isIntranetAllowedSettings) {
|
|
3267
|
+
strip.request.searchV6.filters[0].andFilters.push({ isInIntranet: ['false'] });
|
|
3281
3268
|
}
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
_a.trys.push([1, 3, , 4]);
|
|
3285
|
-
this.setupGlobalAuthResponder();
|
|
3286
|
-
this.addKeycloakEventListener();
|
|
3287
|
-
return [4, this.keycloakSvc.init({
|
|
3288
|
-
config: {
|
|
3289
|
-
url: instanceConfig.keycloak.url,
|
|
3290
|
-
realm: instanceConfig.keycloak.realm,
|
|
3291
|
-
clientId: instanceConfig.keycloak.clientId,
|
|
3292
|
-
},
|
|
3293
|
-
initOptions: __assign({}, this.getSavedKcConfig(), { onLoad: instanceConfig.keycloak.onLoad || 'check-sso', checkLoginIframe: false }),
|
|
3294
|
-
enableBearerInterceptor: true,
|
|
3295
|
-
loadUserProfileAtStartUp: false,
|
|
3296
|
-
bearerExcludedUrls: instanceConfig.keycloak.bearerExcludedUrls,
|
|
3297
|
-
})];
|
|
3298
|
-
case 2: return [2, _a.sent()];
|
|
3299
|
-
case 3:
|
|
3300
|
-
err_1 = _a.sent();
|
|
3301
|
-
return [2, false];
|
|
3302
|
-
case 4: return [2];
|
|
3303
|
-
}
|
|
3304
|
-
});
|
|
3305
|
-
});
|
|
3306
|
-
};
|
|
3307
|
-
AuthKeycloakService.prototype.login = function (idpHint, redirectUrl) {
|
|
3308
|
-
if (idpHint === void 0) { idpHint = 'E'; }
|
|
3309
|
-
if (redirectUrl === void 0) { redirectUrl = this.defaultRedirectUrl; }
|
|
3310
|
-
return this.keycloakSvc.login({
|
|
3311
|
-
idpHint: idpHint,
|
|
3312
|
-
redirectUri: redirectUrl,
|
|
3313
|
-
});
|
|
3314
|
-
};
|
|
3315
|
-
AuthKeycloakService.prototype.register = function (redirectUrl) {
|
|
3316
|
-
if (redirectUrl === void 0) { redirectUrl = this.defaultRedirectUrl; }
|
|
3317
|
-
return this.keycloakSvc.register({
|
|
3318
|
-
redirectUri: redirectUrl,
|
|
3319
|
-
});
|
|
3320
|
-
};
|
|
3321
|
-
AuthKeycloakService.prototype.logout = function (_redirectUrl) {
|
|
3322
|
-
if (_redirectUrl === void 0) { _redirectUrl = this.defaultRedirectUrl; }
|
|
3323
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3324
|
-
return __generator(this, function (_a) {
|
|
3325
|
-
window.location.href = _redirectUrl + "apis/reset";
|
|
3326
|
-
return [2];
|
|
3327
|
-
});
|
|
3328
|
-
});
|
|
3329
|
-
};
|
|
3330
|
-
AuthKeycloakService.prototype.force_logout = function () {
|
|
3331
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3332
|
-
return __generator(this, function (_a) {
|
|
3333
|
-
switch (_a.label) {
|
|
3334
|
-
case 0: return [4, this.http.get('/apis/reset').toPromise()];
|
|
3335
|
-
case 1:
|
|
3336
|
-
_a.sent();
|
|
3337
|
-
return [2];
|
|
3269
|
+
return strip;
|
|
3270
|
+
}));
|
|
3338
3271
|
}
|
|
3339
|
-
}
|
|
3340
|
-
|
|
3272
|
+
}
|
|
3273
|
+
return widget;
|
|
3274
|
+
}));
|
|
3275
|
+
return pageData;
|
|
3341
3276
|
};
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3277
|
+
ExploreDetailResolve.decorators = [
|
|
3278
|
+
{ type: core.Injectable, args: [{
|
|
3279
|
+
providedIn: 'root',
|
|
3280
|
+
},] }
|
|
3281
|
+
];
|
|
3282
|
+
ExploreDetailResolve.ctorParameters = function () { return [
|
|
3283
|
+
{ type: http.HttpClient },
|
|
3284
|
+
{ type: ConfigurationsService },
|
|
3285
|
+
{ type: UtilityService }
|
|
3286
|
+
]; };
|
|
3287
|
+
/** @nocollapse */ ExploreDetailResolve.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function ExploreDetailResolve_Factory() { return new ExploreDetailResolve(core.ɵɵinject(http.HttpClient), core.ɵɵinject(ConfigurationsService), core.ɵɵinject(UtilityService)); }, token: ExploreDetailResolve, providedIn: "root" });
|
|
3288
|
+
return ExploreDetailResolve;
|
|
3289
|
+
}());
|
|
3290
|
+
if (false) {
|
|
3291
|
+
ExploreDetailResolve.prototype.baseUrl;
|
|
3292
|
+
ExploreDetailResolve.prototype.isIntranetAllowedSettings;
|
|
3293
|
+
ExploreDetailResolve.prototype.http;
|
|
3294
|
+
ExploreDetailResolve.prototype.configSvc;
|
|
3295
|
+
ExploreDetailResolve.prototype.utilitySvc;
|
|
3296
|
+
}
|
|
3297
|
+
|
|
3298
|
+
var MarketingOfferingResolve = (function () {
|
|
3299
|
+
function MarketingOfferingResolve(http) {
|
|
3300
|
+
this.http = http;
|
|
3301
|
+
}
|
|
3302
|
+
MarketingOfferingResolve.prototype.resolve = function (route, _state) {
|
|
3303
|
+
var _this = this;
|
|
3304
|
+
var tag = route.params.tag;
|
|
3305
|
+
return this.http.get(route.data.pageUrl).pipe(operators.map((function (pageData) { return ({ data: _this.transformPageData(pageData, tag), error: null }); })), operators.catchError((function (err) { return rxjs.of({ data: null, error: err }); })));
|
|
3306
|
+
};
|
|
3307
|
+
MarketingOfferingResolve.prototype.transformPageData = function (pageData, tag) {
|
|
3308
|
+
pageData.pageLayout.widgetData.widgets = pageData.pageLayout.widgetData.widgets.map((function (widget) {
|
|
3309
|
+
if (widget.widgetSubType === 'contentStripMultiple') {
|
|
3310
|
+
widget.widgetData.strips = widget.widgetData.strips.map((function (strip) {
|
|
3311
|
+
strip.request.search.filters.catalogPaths = [decodeURIComponent(tag)];
|
|
3312
|
+
return strip;
|
|
3313
|
+
}));
|
|
3368
3314
|
}
|
|
3315
|
+
return widget;
|
|
3369
3316
|
}));
|
|
3317
|
+
return pageData;
|
|
3370
3318
|
};
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
}
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3319
|
+
MarketingOfferingResolve.decorators = [
|
|
3320
|
+
{ type: core.Injectable, args: [{
|
|
3321
|
+
providedIn: 'root',
|
|
3322
|
+
},] }
|
|
3323
|
+
];
|
|
3324
|
+
MarketingOfferingResolve.ctorParameters = function () { return [
|
|
3325
|
+
{ type: http.HttpClient }
|
|
3326
|
+
]; };
|
|
3327
|
+
/** @nocollapse */ MarketingOfferingResolve.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function MarketingOfferingResolve_Factory() { return new MarketingOfferingResolve(core.ɵɵinject(http.HttpClient)); }, token: MarketingOfferingResolve, providedIn: "root" });
|
|
3328
|
+
return MarketingOfferingResolve;
|
|
3329
|
+
}());
|
|
3330
|
+
if (false) {
|
|
3331
|
+
MarketingOfferingResolve.prototype.http;
|
|
3332
|
+
}
|
|
3333
|
+
|
|
3334
|
+
var NsPage;
|
|
3335
|
+
(function (NsPage) {
|
|
3336
|
+
function IPage() { }
|
|
3337
|
+
NsPage.IPage = IPage;
|
|
3338
|
+
if (false) {
|
|
3339
|
+
IPage.prototype.contentType;
|
|
3340
|
+
IPage.prototype.navigationBar;
|
|
3341
|
+
IPage.prototype.pageLayout;
|
|
3342
|
+
IPage.prototype.tourGuide;
|
|
3343
|
+
}
|
|
3344
|
+
function INavBar() { }
|
|
3345
|
+
NsPage.INavBar = INavBar;
|
|
3346
|
+
if (false) {
|
|
3347
|
+
INavBar.prototype.links;
|
|
3348
|
+
INavBar.prototype.xsmallNonMenuLinks;
|
|
3349
|
+
INavBar.prototype.pageBackLink;
|
|
3350
|
+
INavBar.prototype.pageTitle;
|
|
3351
|
+
INavBar.prototype.background;
|
|
3352
|
+
}
|
|
3353
|
+
function INavBackground() { }
|
|
3354
|
+
NsPage.INavBackground = INavBackground;
|
|
3355
|
+
if (false) {
|
|
3356
|
+
INavBackground.prototype.color;
|
|
3357
|
+
INavBackground.prototype.styles;
|
|
3358
|
+
}
|
|
3359
|
+
function INavLink() { }
|
|
3360
|
+
NsPage.INavLink = INavLink;
|
|
3361
|
+
if (false) {
|
|
3362
|
+
INavLink.prototype.config;
|
|
3363
|
+
INavLink.prototype.actionBtnId;
|
|
3364
|
+
INavLink.prototype.actionBtn;
|
|
3365
|
+
INavLink.prototype.actionBtnName;
|
|
3366
|
+
}
|
|
3367
|
+
function INavLinkConfig() { }
|
|
3368
|
+
NsPage.INavLinkConfig = INavLinkConfig;
|
|
3369
|
+
if (false) {
|
|
3370
|
+
INavLinkConfig.prototype.type;
|
|
3371
|
+
INavLinkConfig.prototype.hideIcon;
|
|
3372
|
+
INavLinkConfig.prototype.hideTitle;
|
|
3373
|
+
INavLinkConfig.prototype.hideStatus;
|
|
3374
|
+
INavLinkConfig.prototype.hidePin;
|
|
3375
|
+
INavLinkConfig.prototype.iconColor;
|
|
3376
|
+
INavLinkConfig.prototype.treatAsCard;
|
|
3377
|
+
INavLinkConfig.prototype.useShortName;
|
|
3378
|
+
}
|
|
3379
|
+
})(NsPage || (NsPage = {}));
|
|
3380
|
+
|
|
3381
|
+
var JSON_MAP = {
|
|
3382
|
+
pagename: 'lexid',
|
|
3383
|
+
};
|
|
3384
|
+
|
|
3385
|
+
var PageResolve = (function () {
|
|
3386
|
+
function PageResolve(configSvc, http, locale) {
|
|
3387
|
+
this.configSvc = configSvc;
|
|
3388
|
+
this.http = http;
|
|
3389
|
+
this.locale = locale;
|
|
3390
|
+
this.baseUrl = this.configSvc.sitePath;
|
|
3391
|
+
}
|
|
3392
|
+
PageResolve.prototype.resolve = function (route) {
|
|
3393
|
+
if (route.data.pageUrl) {
|
|
3394
|
+
return this.getData(route.data.pageUrl);
|
|
3395
|
+
}
|
|
3396
|
+
if (route.data.pageType === 'feature' && route.data.pageKey) {
|
|
3397
|
+
return this.getData(this.baseUrl + "/feature/" + route.data.pageKey);
|
|
3398
|
+
}
|
|
3399
|
+
if (route.data.pageType === 'page' &&
|
|
3400
|
+
route.data.pageKey &&
|
|
3401
|
+
route.paramMap.has(route.data.pageKey)) {
|
|
3402
|
+
return this.getData(this.baseUrl + "/page/" + route.paramMap.get(route.data.pageKey));
|
|
3403
|
+
}
|
|
3404
|
+
if (route.data.pageType === 'page' &&
|
|
3405
|
+
route.data.pageKey &&
|
|
3406
|
+
route.data.pageKey === 'toc') {
|
|
3407
|
+
return this.getData(this.baseUrl + "/page/" + route.data.pageKey);
|
|
3408
|
+
}
|
|
3409
|
+
return {
|
|
3410
|
+
data: null,
|
|
3411
|
+
error: 'CONFIGURATION_ERROR_PAGE_URL_NOT_FORMED',
|
|
3412
3412
|
};
|
|
3413
|
-
storage$1.setItem(storageKey$1, JSON.stringify(kcInitOptions));
|
|
3414
3413
|
};
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3414
|
+
PageResolve.prototype.setS3Cookie = function (contentId) {
|
|
3415
|
+
return this.http.post("/apis/protected/v8/content/setCookie", { contentId: contentId }).pipe(operators.catchError((function (_err) { return rxjs.of(true); })));
|
|
3416
|
+
};
|
|
3417
|
+
PageResolve.prototype.getContent = function (id) {
|
|
3418
|
+
return this.http
|
|
3419
|
+
.post("/apis/protected/v8/content/" + id + "?hierarchyType=minimal", ['status', 'artifactUrl']);
|
|
3420
|
+
};
|
|
3421
|
+
PageResolve.prototype.getData = function (url) {
|
|
3422
|
+
var _this = this;
|
|
3423
|
+
var id = (((url.split('/').pop()))).split('.')[0] || '';
|
|
3424
|
+
var equivalentId = id.startsWith('lex_auth_') ? id : JSON_MAP[id];
|
|
3425
|
+
if (equivalentId) {
|
|
3426
|
+
return rxjs.forkJoin([this.setS3Cookie(equivalentId), this.getContent(equivalentId)]).pipe(operators.mergeMap((function (_a) {
|
|
3427
|
+
var _b = __read(_a, 2), _ = _b[0], v = _b[1];
|
|
3428
|
+
if (v.status === 'Expired' || v.status === 'Deleted' || !v.artifactUrl) {
|
|
3429
|
+
return rxjs.of({ data: null, error: 'NoContent' });
|
|
3425
3430
|
}
|
|
3426
|
-
|
|
3431
|
+
return _this.http
|
|
3432
|
+
.get(v.artifactUrl + "?ts=" + new Date().getTime())
|
|
3433
|
+
.pipe(operators.map((function (data) { return ({ data: data, error: null }); })), operators.catchError((function (err) { return rxjs.of({ data: null, error: err }); })));
|
|
3434
|
+
})), operators.catchError((function (err) { return rxjs.of({ data: null, error: err }); })));
|
|
3427
3435
|
}
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3436
|
+
var pageRequest = [
|
|
3437
|
+
(equivalentId ? this.setS3Cookie(equivalentId) : rxjs.of(true)).pipe(operators.mergeMap((function () {
|
|
3438
|
+
return _this.http.get(url + ".json").pipe(operators.map((function (data) { return ({ data: data, error: null }); })), operators.catchError((function (err) { return rxjs.of({ data: null, error: err }); })));
|
|
3439
|
+
}))),
|
|
3440
|
+
this.locale === 'en' || this.locale === 'en-US' ?
|
|
3441
|
+
rxjs.of({ data: ((undefined)), error: null }) :
|
|
3442
|
+
this.http.get(url + "." + this.locale + ".json").pipe(operators.map((function (data) { return ({ data: data, error: null }); })), operators.catchError((function (err) { return rxjs.of({ data: null, error: err }); }))),
|
|
3443
|
+
];
|
|
3444
|
+
return rxjs.forkJoin(pageRequest).pipe(operators.map((function (_a) {
|
|
3445
|
+
var _b = __read(_a, 2), general = _b[0], withLocale = _b[1];
|
|
3446
|
+
if (withLocale.data) {
|
|
3447
|
+
return withLocale;
|
|
3439
3448
|
}
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
AuthKeycloakService.decorators = [
|
|
3449
|
+
return general;
|
|
3450
|
+
})));
|
|
3451
|
+
};
|
|
3452
|
+
PageResolve.decorators = [
|
|
3445
3453
|
{ type: core.Injectable, args: [{
|
|
3446
3454
|
providedIn: 'root',
|
|
3447
3455
|
},] }
|
|
3448
3456
|
];
|
|
3449
|
-
|
|
3450
|
-
{ type: http.HttpClient },
|
|
3457
|
+
PageResolve.ctorParameters = function () { return [
|
|
3451
3458
|
{ type: ConfigurationsService },
|
|
3452
|
-
{ type:
|
|
3453
|
-
{ type:
|
|
3459
|
+
{ type: http.HttpClient },
|
|
3460
|
+
{ type: String, decorators: [{ type: core.Inject, args: [core.LOCALE_ID,] }] }
|
|
3454
3461
|
]; };
|
|
3455
|
-
/** @nocollapse */
|
|
3456
|
-
return
|
|
3462
|
+
/** @nocollapse */ PageResolve.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function PageResolve_Factory() { return new PageResolve(core.ɵɵinject(ConfigurationsService), core.ɵɵinject(http.HttpClient), core.ɵɵinject(core.LOCALE_ID)); }, token: PageResolve, providedIn: "root" });
|
|
3463
|
+
return PageResolve;
|
|
3457
3464
|
}());
|
|
3458
3465
|
if (false) {
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3466
|
+
PageResolve.prototype.baseUrl;
|
|
3467
|
+
PageResolve.prototype.configSvc;
|
|
3468
|
+
PageResolve.prototype.http;
|
|
3469
|
+
PageResolve.prototype.locale;
|
|
3470
|
+
}
|
|
3471
|
+
|
|
3472
|
+
function IResolveResponse() { }
|
|
3473
|
+
if (false) {
|
|
3474
|
+
IResolveResponse.prototype.data;
|
|
3475
|
+
IResolveResponse.prototype.error;
|
|
3464
3476
|
}
|
|
3465
3477
|
|
|
3466
3478
|
var NsInstanceConfig;
|
|
@@ -3506,17 +3518,6 @@
|
|
|
3506
3518
|
IConfig.prototype.forgotPasswordConfig;
|
|
3507
3519
|
IConfig.prototype.hubs;
|
|
3508
3520
|
IConfig.prototype.courseContentPath;
|
|
3509
|
-
IConfig.prototype.portalUrls;
|
|
3510
|
-
}
|
|
3511
|
-
function IPortalUrls() { }
|
|
3512
|
-
NsInstanceConfig.IPortalUrls = IPortalUrls;
|
|
3513
|
-
if (false) {
|
|
3514
|
-
IPortalUrls.prototype.igot;
|
|
3515
|
-
IPortalUrls.prototype.spv;
|
|
3516
|
-
IPortalUrls.prototype.mdo;
|
|
3517
|
-
IPortalUrls.prototype.cbc;
|
|
3518
|
-
IPortalUrls.prototype.cbp;
|
|
3519
|
-
IPortalUrls.prototype.frac;
|
|
3520
3521
|
}
|
|
3521
3522
|
function IForgotPassword() { }
|
|
3522
3523
|
NsInstanceConfig.IForgotPassword = IForgotPassword;
|