@hmcts/ccd-case-ui-toolkit 7.3.89-pofcc-156 → 7.3.90

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.
@@ -12,11 +12,11 @@ import { BehaviorSubject, throwError, Subject, EMPTY, concat, defer, timer, Obse
12
12
  import { distinctUntilChanged, catchError, map, switchMap, repeat, retry, publish, refCount, debounceTime, delay, finalize, timeout, mergeMap, retryWhen, tap, delayWhen, publishReplay, take, first, takeUntil, filter } from 'rxjs/operators';
13
13
  import * as i1$2 from '@angular/common/http';
14
14
  import { HttpErrorResponse, HttpHeaders, HttpParams, HttpStatusCode } from '@angular/common/http';
15
- import { __decorate, __metadata } from 'tslib';
16
15
  import { Type, Exclude, Expose, plainToClassFromExist, plainToClass } from 'class-transformer';
16
+ import moment from 'moment';
17
+ import { __decorate, __metadata } from 'tslib';
17
18
  import * as _ from 'underscore';
18
19
  import 'reflect-metadata';
19
- import moment from 'moment';
20
20
  import { StateMachine } from '@edium/fsm';
21
21
  import * as i1$3 from '@angular/material/legacy-dialog';
22
22
  import { MAT_LEGACY_DIALOG_DATA, MatLegacyDialogModule } from '@angular/material/legacy-dialog';
@@ -1860,1084 +1860,259 @@ class SessionStorageGuard {
1860
1860
  args: [SessionJsonErrorLogger]
1861
1861
  }] }], null); })();
1862
1862
 
1863
- // tslint:disable:variable-name
1864
- class AddressModel {
1865
- AddressLine1 = '';
1866
- AddressLine2 = '';
1867
- AddressLine3 = '';
1868
- PostTown = '';
1869
- County = '';
1870
- PostCode = '';
1871
- Country = '';
1872
- }
1873
-
1874
- class Alert {
1875
- level;
1876
- message;
1877
- }
1878
-
1879
- // tslint:disable:variable-name
1880
- class CaseDetails {
1881
- id;
1882
- jurisdiction;
1883
- case_type_id;
1884
- state;
1885
- created_date;
1886
- last_modified;
1887
- locked_by_user_id;
1888
- security_level;
1889
- case_data;
1890
- }
1891
-
1892
- // tslint:disable:variable-name
1893
- class CaseEventData {
1894
- event;
1895
- data;
1896
- event_data; // full event data
1897
- event_token;
1898
- ignore_warning;
1899
- draft_id;
1900
- case_reference;
1901
- }
1902
-
1903
- class WizardPageField {
1904
- case_field_id;
1905
- order;
1906
- page_column_no;
1907
- complex_field_overrides;
1863
+ const USER_DETAILS = 'userDetails';
1864
+ const PUI_CASE_MANAGER = 'pui-case-manager';
1865
+ const JUDGE = 'judge';
1866
+ function getUserDetails(sessionStorageService) {
1867
+ const item = sessionStorageService?.getItem(USER_DETAILS);
1868
+ return safeJsonParse(item, null);
1908
1869
  }
1909
-
1910
- class FixedListItem {
1911
- code;
1912
- label;
1913
- order;
1870
+ function isInternalUser(sessionStorageService) {
1871
+ const userDetails = getUserDetails(sessionStorageService);
1872
+ return !!userDetails?.roles
1873
+ && !(userDetails.roles.includes(PUI_CASE_MANAGER)
1874
+ || userDetails.roles.some((role) => role.toLowerCase().includes(JUDGE)));
1914
1875
  }
1915
-
1916
- // @dynamic
1917
- class FieldType {
1918
- id;
1919
- type;
1920
- min;
1921
- max;
1922
- regular_expression;
1923
- fixed_list_items;
1924
- complex_fields;
1925
- collection_field_type;
1876
+ function isJudiciaryUser(sessionStorageService) {
1877
+ const userDetails = getUserDetails(sessionStorageService);
1878
+ return !!userDetails?.roles
1879
+ && (userDetails.roles.some((role) => role.toLowerCase().includes(JUDGE)));
1926
1880
  }
1927
- __decorate([
1928
- Type(() => FixedListItem),
1929
- __metadata("design:type", Array)
1930
- ], FieldType.prototype, "fixed_list_items", void 0);
1931
- __decorate([
1932
- Type(() => CaseField),
1933
- __metadata("design:type", Array)
1934
- ], FieldType.prototype, "complex_fields", void 0);
1935
- __decorate([
1936
- Type(() => FieldType),
1937
- __metadata("design:type", FieldType)
1938
- ], FieldType.prototype, "collection_field_type", void 0);
1939
1881
 
1940
1882
  // @dynamic
1941
- class CaseField {
1942
- static logger = new StructuredLoggerService();
1943
- id;
1944
- hidden;
1945
- hiddenCannotChange;
1946
- label;
1947
- originalLabel;
1948
- noCacheLabel;
1949
- order;
1950
- parent;
1951
- field_type;
1952
- hint_text;
1953
- security_label;
1954
- display_context;
1955
- display_context_parameter;
1956
- month_format;
1957
- show_condition;
1958
- show_summary_change_option;
1959
- show_summary_content_option;
1960
- acls;
1961
- metadata;
1962
- formatted_value;
1963
- retain_hidden_value;
1964
- wizardProps;
1965
- _value;
1966
- _list_items = [];
1967
- isTranslatedFlag = false;
1968
- get value() {
1969
- if (this.field_type && (this.field_type.type === 'DynamicList' || this.field_type.type === 'DynamicRadioList')) {
1970
- return this._value && this._value.value ? this._value.value.code : this._value;
1971
- }
1972
- else if (this.field_type && this.field_type.type === 'DynamicMultiSelectList') {
1973
- return this._value && this._value.value ? this._value.value : this._value;
1974
- }
1975
- else {
1976
- return this._value;
1977
- }
1883
+ class ActivityService {
1884
+ http;
1885
+ appConfig;
1886
+ sessionStorageService;
1887
+ static get ACTIVITY_VIEW() { return 'view'; }
1888
+ static get ACTIVITY_EDIT() { return 'edit'; }
1889
+ logger = new StructuredLoggerService();
1890
+ constructor(http, appConfig, sessionStorageService) {
1891
+ this.http = http;
1892
+ this.appConfig = appConfig;
1893
+ this.sessionStorageService = sessionStorageService;
1978
1894
  }
1979
- set value(value) {
1980
- if (this.isDynamic()) {
1981
- if (value && value instanceof Object && value.list_items) {
1982
- this._list_items = value.list_items;
1983
- }
1984
- else if (!this._list_items || this._list_items.length === 0) {
1985
- // Extract the list items from the current value if that's the only place they exist.
1986
- this._list_items = this.list_items;
1987
- if (!value || !value.value) {
1988
- value = null;
1989
- }
1990
- }
1991
- }
1992
- this._value = value;
1895
+ get isEnabled() {
1896
+ return this.activityUrl() && this.userAuthorised;
1993
1897
  }
1994
- get list_items() {
1995
- if (this.isDynamic()) {
1996
- return this._value && this._value.list_items ? this._value.list_items : this._list_items;
1997
- }
1998
- else {
1999
- return this.field_type.fixed_list_items;
1898
+ static DUMMY_CASE_REFERENCE = '0';
1899
+ userAuthorised = undefined;
1900
+ static handleHttpError(response) {
1901
+ const error = HttpErrorService.convertToHttpError(response);
1902
+ if (response?.status !== error.status) {
1903
+ error.status = response.status;
2000
1904
  }
1905
+ return error;
2001
1906
  }
2002
- set list_items(items) {
2003
- if ((items && !this._list_items) || (items?.length > this._list_items?.length)) {
2004
- this._list_items = items;
1907
+ getOptions() {
1908
+ const userDetails = safeJsonParse(this.sessionStorageService.getItem(USER_DETAILS));
1909
+ let headers = new HttpHeaders().set('Content-Type', 'application/json');
1910
+ if (userDetails?.token) {
1911
+ headers = headers.set('Authorization', userDetails.token);
2005
1912
  }
1913
+ return {
1914
+ headers,
1915
+ withCredentials: true,
1916
+ observe: 'body',
1917
+ };
2006
1918
  }
2007
- get dateTimeEntryFormat() {
2008
- if (this.isComplexDisplay()) {
2009
- return null;
1919
+ getActivities(...caseId) {
1920
+ try {
1921
+ const options = this.getOptions();
1922
+ const url = `${this.activityUrl()}/cases/${caseId.join(',')}/activity`;
1923
+ return this.http
1924
+ .get(url, options, false, ActivityService.handleHttpError)
1925
+ .pipe(map(response => response));
2010
1926
  }
2011
- if (this.display_context_parameter) {
2012
- return this.extractBracketValue(this.display_context_parameter, '#DATETIMEENTRY');
1927
+ catch (error) {
1928
+ this.logUserMayNotBeAuthenticated(error);
2013
1929
  }
2014
- return null;
2015
1930
  }
2016
- get dateTimeDisplayFormat() {
2017
- if (this.isComplexEntry()) {
2018
- return null;
1931
+ postActivity(caseId, activity) {
1932
+ try {
1933
+ const options = this.getOptions();
1934
+ const url = `${this.activityUrl()}/cases/${caseId}/activity`;
1935
+ const body = { activity };
1936
+ return this.http
1937
+ .post(url, body, options, false)
1938
+ .pipe(map(response => response));
2019
1939
  }
2020
- if (this.display_context_parameter) {
2021
- return this.extractBracketValue(this.display_context_parameter, '#DATETIMEDISPLAY');
1940
+ catch (error) {
1941
+ this.logUserMayNotBeAuthenticated(error);
2022
1942
  }
2023
- return null;
2024
1943
  }
2025
- isComplexDisplay() {
2026
- return (this.isComplex() || this.isCollection()) && this.isReadonly();
1944
+ verifyUserIsAuthorized() {
1945
+ if (this.sessionStorageService.getItem(USER_DETAILS) && this.activityUrl() && this.userAuthorised === undefined) {
1946
+ this.getActivities(ActivityService.DUMMY_CASE_REFERENCE).subscribe(() => this.userAuthorised = true, error => {
1947
+ this.userAuthorised = [401, 403].indexOf(error.status) <= -1;
1948
+ });
1949
+ }
2027
1950
  }
2028
- isComplexEntry() {
2029
- return (this.isComplex() || this.isCollection()) && (this.isOptional() || this.isMandatory());
1951
+ activityUrl() {
1952
+ return this.appConfig.getActivityUrl();
2030
1953
  }
2031
- isReadonly() {
2032
- return !_.isEmpty(this.display_context)
2033
- && this.display_context.toUpperCase() === 'READONLY';
1954
+ logUserMayNotBeAuthenticated(error) {
1955
+ this.logger.error('User may not be authenticated. Activity request was not sent.', { error });
2034
1956
  }
2035
- isOptional() {
2036
- return !_.isEmpty(this.display_context)
2037
- && this.display_context.toUpperCase() === 'OPTIONAL';
1957
+ static ɵfac = function ActivityService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(SessionStorageService)); };
1958
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac });
1959
+ }
1960
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityService, [{
1961
+ type: Injectable
1962
+ }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: SessionStorageService }], null); })();
1963
+
1964
+ // @dynamic
1965
+ class ActivityPollingService {
1966
+ activityService;
1967
+ ngZone;
1968
+ config;
1969
+ logger = new StructuredLoggerService();
1970
+ pendingRequests = new Map();
1971
+ currentTimeoutHandle;
1972
+ pollActivitiesSubscription;
1973
+ pollConfig;
1974
+ batchCollectionDelayMs;
1975
+ maxRequestsPerBatch;
1976
+ constructor(activityService, ngZone, config) {
1977
+ this.activityService = activityService;
1978
+ this.ngZone = ngZone;
1979
+ this.config = config;
1980
+ this.pollConfig = {
1981
+ interval: config.getActivityNexPollRequestMs(),
1982
+ attempts: config.getActivityRetry()
1983
+ };
1984
+ this.batchCollectionDelayMs = config.getActivityBatchCollectionDelayMs();
1985
+ this.maxRequestsPerBatch = config.getActivityMaxRequestPerBatch();
2038
1986
  }
2039
- isMandatory() {
2040
- return !_.isEmpty(this.display_context)
2041
- && this.display_context.toUpperCase() === 'MANDATORY';
1987
+ get isEnabled() {
1988
+ return this.activityService.isEnabled;
2042
1989
  }
2043
- isCollection() {
2044
- return this.field_type && this.field_type.type === 'Collection';
1990
+ subscribeToActivity(caseId, done) {
1991
+ if (!this.isEnabled) {
1992
+ return new Subject();
1993
+ }
1994
+ let subject = this.pendingRequests.get(caseId);
1995
+ if (subject) {
1996
+ subject.subscribe(done);
1997
+ }
1998
+ else {
1999
+ // Only the first pending request should start the batch collection timer.
2000
+ const wasEmpty = this.pendingRequests.size === 0;
2001
+ subject = new Subject();
2002
+ subject.subscribe(done);
2003
+ this.addPendingRequest(caseId, subject);
2004
+ if (wasEmpty) {
2005
+ this.ngZone.runOutsideAngular(() => {
2006
+ this.currentTimeoutHandle = setTimeout(() => this.ngZone.run(() => {
2007
+ this.flushRequests();
2008
+ }), this.batchCollectionDelayMs);
2009
+ });
2010
+ }
2011
+ }
2012
+ if (this.pendingRequests.size >= this.maxRequestsPerBatch) {
2013
+ this.flushRequests();
2014
+ }
2015
+ return subject;
2045
2016
  }
2046
- isComplex() {
2047
- return this.field_type && this.field_type.type === 'Complex';
2017
+ stopPolling() {
2018
+ if (this.pollActivitiesSubscription) {
2019
+ this.pollActivitiesSubscription.unsubscribe();
2020
+ }
2048
2021
  }
2049
- isDynamic() {
2050
- const dynamicFieldTypes = ['DynamicList', 'DynamicRadioList', 'DynamicMultiSelectList'];
2051
- if (!this.field_type) {
2052
- return false;
2022
+ flushRequests() {
2023
+ if (this.currentTimeoutHandle) {
2024
+ clearTimeout(this.currentTimeoutHandle);
2025
+ this.currentTimeoutHandle = undefined;
2053
2026
  }
2054
- return dynamicFieldTypes.some(t => t === this.field_type.type);
2027
+ if (!this.pendingRequests.size) {
2028
+ return;
2029
+ }
2030
+ const requests = new Map(this.pendingRequests);
2031
+ this.pendingRequests.clear();
2032
+ this.performBatchRequest(requests);
2055
2033
  }
2056
- isCaseLink() {
2057
- return this.isComplex()
2058
- && this.field_type.id === 'CaseLink'
2059
- && this.field_type.complex_fields.some(cf => cf.id === 'CaseReference');
2034
+ pollActivities(...caseIds) {
2035
+ if (!this.isEnabled) {
2036
+ return EMPTY;
2037
+ }
2038
+ return this.polling(this.activityService.getActivities(...caseIds), this.pollConfig);
2060
2039
  }
2061
- extractBracketValue(fmt, paramName, leftBracket = '(', rightBracket = ')') {
2062
- fmt = fmt.split(',')
2063
- .find(a => a.trim().startsWith(paramName));
2064
- if (fmt) {
2065
- const s = fmt.indexOf(leftBracket) + 1;
2066
- const e = fmt.indexOf(rightBracket, s);
2067
- if (e > s && s >= 0) {
2068
- return fmt.substr(s, (e - s));
2069
- }
2040
+ postViewActivity(caseId) {
2041
+ return this.postActivity(caseId, ActivityService.ACTIVITY_VIEW);
2042
+ }
2043
+ postEditActivity(caseId) {
2044
+ return this.postActivity(caseId, ActivityService.ACTIVITY_EDIT);
2045
+ }
2046
+ performBatchRequest(requests) {
2047
+ const caseIds = Array.from(requests.keys()).join();
2048
+ this.ngZone.runOutsideAngular(() => {
2049
+ // run polling outside angular zone so it does not trigger change detection
2050
+ this.pollActivitiesSubscription = this.pollActivities(caseIds).subscribe({
2051
+ // process activity inside zone so it triggers change detection for activity.component.ts
2052
+ next: (activities) => this.ngZone.run(() => {
2053
+ activities.forEach((activity) => {
2054
+ // Ignore activities returned for cases outside this local batch.
2055
+ requests.get(activity.caseId)?.next(activity);
2056
+ });
2057
+ }),
2058
+ error: (err) => this.ngZone.run(() => {
2059
+ this.logger.error('Error while polling activities.', { error: err });
2060
+ Array.from(requests.values()).forEach((subject) => subject.error(err));
2061
+ })
2062
+ });
2063
+ });
2064
+ }
2065
+ postActivity(caseId, activityType) {
2066
+ if (!this.isEnabled) {
2067
+ return EMPTY;
2070
2068
  }
2071
- return null;
2069
+ const pollingConfig = {
2070
+ ...this.pollConfig,
2071
+ interval: 5000 // inline with CCD Backend
2072
+ };
2073
+ return this.polling(this.activityService.postActivity(caseId, activityType), pollingConfig);
2072
2074
  }
2073
- // Ascend the hierarchy to get the full path of the field
2074
- getHierachicalId(curr) {
2075
- const prefix = curr ? curr + "_" : "";
2076
- if (prefix.length < 1024) {
2077
- if (this.parent) {
2078
- return this.parent.getHierachicalId(prefix + this.id);
2079
- }
2080
- else {
2081
- return prefix + this.id;
2082
- }
2075
+ addPendingRequest(caseId, subject) {
2076
+ this.pendingRequests.set(caseId, subject);
2077
+ // Components complete their returned Subject on destroy; remove it so a later same-case subscription gets a fresh Subject.
2078
+ subject.subscribe({
2079
+ complete: () => this.removePendingRequest(caseId, subject),
2080
+ error: () => this.removePendingRequest(caseId, subject)
2081
+ });
2082
+ }
2083
+ removePendingRequest(caseId, subject) {
2084
+ if (this.pendingRequests.get(caseId) !== subject) {
2085
+ return;
2083
2086
  }
2084
- else {
2085
- CaseField.logger.error('Path too long, possible circular reference in case field hierarchy.');
2086
- return this.id;
2087
+ this.pendingRequests.delete(caseId);
2088
+ if (!this.pendingRequests.size && this.currentTimeoutHandle) {
2089
+ clearTimeout(this.currentTimeoutHandle);
2090
+ this.currentTimeoutHandle = undefined;
2087
2091
  }
2088
2092
  }
2089
- set isTranslated(val) {
2090
- this.isTranslatedFlag = val;
2093
+ polling(request$, options) {
2094
+ const pollingOptions = {
2095
+ interval: options.interval,
2096
+ attempts: options.attempts ?? 9,
2097
+ exponentialUnit: options.exponentialUnit ?? 1000
2098
+ };
2099
+ return concat(request$, defer(() => timer(pollingOptions.interval).pipe(switchMap(() => request$))).pipe(repeat())).pipe(
2100
+ // Preserve consecutive-failure retry behaviour using the current RxJS retry config.
2101
+ retry({
2102
+ count: pollingOptions.attempts,
2103
+ delay: (_error, retryCount) => timer(this.getExponentialRetryDelay(retryCount, pollingOptions.exponentialUnit)),
2104
+ resetOnSuccess: true
2105
+ }));
2091
2106
  }
2092
- get isTranslated() {
2093
- return this.isTranslatedFlag;
2107
+ getExponentialRetryDelay(consecutiveErrorsCount, exponentialUnit) {
2108
+ return Math.pow(2, consecutiveErrorsCount - 1) * exponentialUnit;
2094
2109
  }
2110
+ static ɵfac = function ActivityPollingService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityPollingService)(i0.ɵɵinject(ActivityService), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(AbstractAppConfig)); };
2111
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityPollingService, factory: ActivityPollingService.ɵfac });
2095
2112
  }
2096
- __decorate([
2097
- Exclude(),
2098
- __metadata("design:type", CaseField)
2099
- ], CaseField.prototype, "parent", void 0);
2100
- __decorate([
2101
- Type(() => FieldType),
2102
- __metadata("design:type", FieldType)
2103
- ], CaseField.prototype, "field_type", void 0);
2104
- __decorate([
2105
- Type(() => WizardPageField),
2106
- __metadata("design:type", WizardPageField)
2107
- ], CaseField.prototype, "wizardProps", void 0);
2108
- __decorate([
2109
- Expose(),
2110
- __metadata("design:type", Object),
2111
- __metadata("design:paramtypes", [Object])
2112
- ], CaseField.prototype, "value", null);
2113
- __decorate([
2114
- Expose(),
2115
- __metadata("design:type", Object),
2116
- __metadata("design:paramtypes", [Object])
2117
- ], CaseField.prototype, "list_items", null);
2118
- __decorate([
2119
- Expose(),
2120
- __metadata("design:type", String),
2121
- __metadata("design:paramtypes", [])
2122
- ], CaseField.prototype, "dateTimeEntryFormat", null);
2123
- __decorate([
2124
- Expose(),
2125
- __metadata("design:type", String),
2126
- __metadata("design:paramtypes", [])
2127
- ], CaseField.prototype, "dateTimeDisplayFormat", null);
2128
- __decorate([
2129
- Expose(),
2130
- __metadata("design:type", Function),
2131
- __metadata("design:paramtypes", []),
2132
- __metadata("design:returntype", void 0)
2133
- ], CaseField.prototype, "isComplexDisplay", null);
2134
- __decorate([
2135
- Expose(),
2136
- __metadata("design:type", Function),
2137
- __metadata("design:paramtypes", []),
2138
- __metadata("design:returntype", void 0)
2139
- ], CaseField.prototype, "isComplexEntry", null);
2140
- __decorate([
2141
- Expose(),
2142
- __metadata("design:type", Function),
2143
- __metadata("design:paramtypes", []),
2144
- __metadata("design:returntype", void 0)
2145
- ], CaseField.prototype, "isReadonly", null);
2146
- __decorate([
2147
- Expose(),
2148
- __metadata("design:type", Function),
2149
- __metadata("design:paramtypes", []),
2150
- __metadata("design:returntype", void 0)
2151
- ], CaseField.prototype, "isOptional", null);
2152
- __decorate([
2153
- Expose(),
2154
- __metadata("design:type", Function),
2155
- __metadata("design:paramtypes", []),
2156
- __metadata("design:returntype", void 0)
2157
- ], CaseField.prototype, "isMandatory", null);
2158
- __decorate([
2159
- Expose(),
2160
- __metadata("design:type", Function),
2161
- __metadata("design:paramtypes", []),
2162
- __metadata("design:returntype", Boolean)
2163
- ], CaseField.prototype, "isCollection", null);
2164
- __decorate([
2165
- Expose(),
2166
- __metadata("design:type", Function),
2167
- __metadata("design:paramtypes", []),
2168
- __metadata("design:returntype", Boolean)
2169
- ], CaseField.prototype, "isComplex", null);
2170
- __decorate([
2171
- Expose(),
2172
- __metadata("design:type", Function),
2173
- __metadata("design:paramtypes", []),
2174
- __metadata("design:returntype", Boolean)
2175
- ], CaseField.prototype, "isDynamic", null);
2176
- __decorate([
2177
- Expose(),
2178
- __metadata("design:type", Function),
2179
- __metadata("design:paramtypes", []),
2180
- __metadata("design:returntype", Boolean)
2181
- ], CaseField.prototype, "isCaseLink", null);
2182
- __decorate([
2183
- Expose(),
2184
- __metadata("design:type", Function),
2185
- __metadata("design:paramtypes", [String]),
2186
- __metadata("design:returntype", String)
2187
- ], CaseField.prototype, "getHierachicalId", null);
2188
-
2189
- // @dynamic
2190
- class WizardPage {
2191
- id;
2192
- label;
2193
- order;
2194
- wizard_page_fields;
2195
- case_fields;
2196
- show_condition;
2197
- parsedShowCondition;
2198
- getCol1Fields() {
2199
- return this.case_fields?.filter(f => !f.wizardProps.page_column_no || f.wizardProps.page_column_no === 1);
2200
- }
2201
- getCol2Fields() {
2202
- return this.case_fields?.filter(f => f.wizardProps.page_column_no === 2);
2203
- }
2204
- isMultiColumn() {
2205
- return this.getCol2Fields()?.length > 0;
2206
- }
2207
- }
2208
- __decorate([
2209
- Type(() => WizardPageField),
2210
- __metadata("design:type", Array)
2211
- ], WizardPage.prototype, "wizard_page_fields", void 0);
2212
- __decorate([
2213
- Type(() => CaseField),
2214
- __metadata("design:type", Array)
2215
- ], WizardPage.prototype, "case_fields", void 0);
2216
-
2217
- // @dynamic
2218
- class CaseEventTrigger {
2219
- id;
2220
- name;
2221
- description;
2222
- case_id;
2223
- case_fields;
2224
- event_token;
2225
- wizard_pages;
2226
- show_summary;
2227
- show_event_notes;
2228
- end_button_label;
2229
- can_save_draft;
2230
- hasFields() {
2231
- return this.case_fields && this.case_fields.length !== 0;
2232
- }
2233
- hasPages() {
2234
- return this.wizard_pages && this.wizard_pages.length !== 0;
2235
- }
2236
- }
2237
- __decorate([
2238
- Type(() => CaseField),
2239
- __metadata("design:type", Array)
2240
- ], CaseEventTrigger.prototype, "case_fields", void 0);
2241
- __decorate([
2242
- Type(() => WizardPage),
2243
- __metadata("design:type", Array)
2244
- ], CaseEventTrigger.prototype, "wizard_pages", void 0);
2245
-
2246
- // tslint:disable:variable-name
2247
- class CaseViewEvent {
2248
- id;
2249
- timestamp;
2250
- summary;
2251
- comment;
2252
- event_id;
2253
- event_name;
2254
- state_id;
2255
- state_name;
2256
- user_id;
2257
- user_last_name;
2258
- user_first_name;
2259
- significant_item;
2260
- }
2261
-
2262
- class CaseViewTrigger {
2263
- id;
2264
- name;
2265
- description;
2266
- order;
2267
- }
2268
-
2269
- class CaseEvent {
2270
- id;
2271
- name;
2272
- post_state;
2273
- pre_states;
2274
- case_fields;
2275
- description;
2276
- order;
2277
- acls;
2278
- }
2279
-
2280
- class CaseState {
2281
- id;
2282
- name;
2283
- description;
2284
- order;
2285
- }
2286
-
2287
- // Light clone of CaseType to be used in Jurisdiction class
2288
- // to avoid cyclic dependency
2289
- class CaseTypeLite {
2290
- id;
2291
- name;
2292
- events;
2293
- states;
2294
- description;
2295
- }
2296
-
2297
- // @dynamics
2298
- class CaseType {
2299
- id;
2300
- name;
2301
- events;
2302
- states;
2303
- case_fields;
2304
- description;
2305
- jurisdiction;
2306
- printEnabled;
2307
- }
2308
- __decorate([
2309
- Type(() => CaseField),
2310
- __metadata("design:type", Array)
2311
- ], CaseType.prototype, "case_fields", void 0);
2312
-
2313
- // tslint:disable:variable-name
2314
- class EventCaseField {
2315
- case_field_id;
2316
- showCondition;
2317
- }
2318
-
2319
- class Jurisdiction {
2320
- id;
2321
- name;
2322
- description;
2323
- caseTypes;
2324
- currentCaseType;
2325
- }
2326
-
2327
- class Banner {
2328
- bannerDescription;
2329
- bannerUrlText;
2330
- bannerUrl;
2331
- bannerViewed;
2332
- bannerEnabled;
2333
- }
2334
-
2335
- // @dynamic
2336
- class CaseTab {
2337
- id;
2338
- label;
2339
- order;
2340
- fields;
2341
- show_condition;
2342
- }
2343
- __decorate([
2344
- Type(() => CaseField),
2345
- __metadata("design:type", Array)
2346
- ], CaseTab.prototype, "fields", void 0);
2347
-
2348
- // @dynamic
2349
- class CaseView {
2350
- case_id;
2351
- case_type;
2352
- state;
2353
- channels;
2354
- tabs;
2355
- triggers;
2356
- events;
2357
- metadataFields;
2358
- basicFields;
2359
- case_flag;
2360
- }
2361
- __decorate([
2362
- Type(() => CaseTab),
2363
- __metadata("design:type", Array)
2364
- ], CaseView.prototype, "tabs", void 0);
2365
- __decorate([
2366
- Type(() => CaseField),
2367
- __metadata("design:type", Array)
2368
- ], CaseView.prototype, "metadataFields", void 0);
2369
-
2370
- class CasePrintDocument {
2371
- name;
2372
- type;
2373
- url;
2374
- }
2375
-
2376
- var RoleCategory;
2377
- (function (RoleCategory) {
2378
- RoleCategory["JUDICIAL"] = "JUDICIAL";
2379
- RoleCategory["LEGAL_OPERATIONS"] = "LEGAL_OPERATIONS";
2380
- RoleCategory["ADMIN"] = "ADMIN";
2381
- RoleCategory["CTSC"] = "CTSC";
2382
- RoleCategory["PROFESSIONAL"] = "PROFESSIONAL";
2383
- RoleCategory["CITIZEN"] = "CITIZEN";
2384
- RoleCategory["ENFORCEMENT"] = "ENFORCEMENT";
2385
- })(RoleCategory || (RoleCategory = {}));
2386
- var AMRoleSuffix;
2387
- (function (AMRoleSuffix) {
2388
- AMRoleSuffix["JUDICIARY"] = "judiciary";
2389
- AMRoleSuffix["ADMIN"] = "admin";
2390
- AMRoleSuffix["PROFESSIONAL"] = "professional";
2391
- AMRoleSuffix["LEGAL_OPERATIONS"] = "legal-ops";
2392
- AMRoleSuffix["CITIZEN"] = "citizen";
2393
- AMRoleSuffix["CTSC"] = "ctsc";
2394
- AMRoleSuffix["ENFORCEMENT"] = "enforcement";
2395
- })(AMRoleSuffix || (AMRoleSuffix = {}));
2396
- var RoleKeyword;
2397
- (function (RoleKeyword) {
2398
- RoleKeyword["JUDGE"] = "judge";
2399
- RoleKeyword["ADMIN"] = "admin";
2400
- RoleKeyword["SOLICITOR"] = "solicitor";
2401
- RoleKeyword["CITIZEN"] = "citizen";
2402
- RoleKeyword["CTSC"] = "ctsc";
2403
- RoleKeyword["CASEWORKER"] = "caseworker";
2404
- RoleKeyword["ENFORCEMENT"] = "enforcement";
2405
- })(RoleKeyword || (RoleKeyword = {}));
2406
-
2407
- // tslint:disable:variable-name
2408
- class HRef {
2409
- href;
2410
- }
2411
- class DocumentLinks {
2412
- self;
2413
- binary;
2414
- }
2415
- class Document {
2416
- _links;
2417
- originalDocumentName;
2418
- hashToken;
2419
- }
2420
- class Embedded {
2421
- documents;
2422
- }
2423
- class DocumentData {
2424
- _embedded;
2425
- documents;
2426
- }
2427
- class FormDocument {
2428
- document_url;
2429
- document_binary_url;
2430
- document_filename;
2431
- document_hash;
2432
- upload_timestamp;
2433
- }
2434
-
2435
- const DRAFT_PREFIX = 'DRAFT';
2436
- const DRAFT_QUERY_PARAM = 'draft';
2437
- class Draft {
2438
- id;
2439
- document;
2440
- type;
2441
- created;
2442
- updated;
2443
- static stripDraftId(draftId) {
2444
- return draftId.slice(DRAFT_PREFIX.length);
2445
- }
2446
- static isDraft(id) {
2447
- return String(id).startsWith(DRAFT_PREFIX);
2448
- }
2449
- }
2450
-
2451
- class OrganisationConverter {
2452
- static toSimpleAddress(organisationModel) {
2453
- let simpleAddress = '';
2454
- if (organisationModel.addressLine1) {
2455
- simpleAddress += `${organisationModel.addressLine1}<br>`;
2456
- }
2457
- if (organisationModel.addressLine2) {
2458
- simpleAddress += `${organisationModel.addressLine2}<br>`;
2459
- }
2460
- if (organisationModel.addressLine3) {
2461
- simpleAddress += `${organisationModel.addressLine3}<br>`;
2462
- }
2463
- if (organisationModel.townCity) {
2464
- simpleAddress += `${organisationModel.townCity}<br>`;
2465
- }
2466
- if (organisationModel.county) {
2467
- simpleAddress += `${organisationModel.county}<br>`;
2468
- }
2469
- if (organisationModel.country) {
2470
- simpleAddress += `${organisationModel.country}<br>`;
2471
- }
2472
- if (organisationModel.postCode) {
2473
- simpleAddress += `${organisationModel.postCode}<br>`;
2474
- }
2475
- return simpleAddress;
2476
- }
2477
- toSimpleOrganisationModel(organisationModel) {
2478
- return {
2479
- organisationIdentifier: organisationModel.organisationIdentifier,
2480
- name: organisationModel.name,
2481
- address: OrganisationConverter.toSimpleAddress(organisationModel)
2482
- };
2483
- }
2484
- static ɵfac = function OrganisationConverter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OrganisationConverter)(); };
2485
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: OrganisationConverter, factory: OrganisationConverter.ɵfac });
2486
- }
2487
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OrganisationConverter, [{
2488
- type: Injectable
2489
- }], null, null); })();
2490
-
2491
- class PaginationMetadata {
2492
- totalResultsCount;
2493
- totalPagesCount;
2494
- }
2495
-
2496
- function hasRoles(profile) {
2497
- if (profile.user && profile.user.idam && Array.isArray(profile.user.idam.roles)) {
2498
- return profile.user.idam.roles.length > 0;
2499
- }
2500
- return false;
2501
- }
2502
- // @dynamic
2503
- class Profile {
2504
- user;
2505
- channels;
2506
- jurisdictions;
2507
- default;
2508
- isSolicitor() {
2509
- if (hasRoles(this)) {
2510
- return this.user.idam.roles.find(r => r.endsWith('-solicitor')) !== undefined;
2511
- }
2512
- return false;
2513
- }
2514
- isCourtAdmin() {
2515
- if (hasRoles(this)) {
2516
- return this.user.idam.roles.find(r => r.endsWith('-courtadmin')) !== undefined;
2517
- }
2518
- return false;
2519
- }
2520
- }
2521
- __decorate([
2522
- Type(() => Jurisdiction),
2523
- __metadata("design:type", Array)
2524
- ], Profile.prototype, "jurisdictions", void 0);
2525
-
2526
- class Field {
2527
- id;
2528
- field_type;
2529
- elementPath;
2530
- value;
2531
- label;
2532
- metadata;
2533
- constructor(id, field_type, elementPath, value, label, metadata) {
2534
- this.id = id;
2535
- this.field_type = field_type;
2536
- this.elementPath = elementPath;
2537
- this.value = value;
2538
- this.label = label;
2539
- this.metadata = metadata;
2540
- }
2541
- }
2542
-
2543
- class SearchResultViewColumn {
2544
- case_field_id;
2545
- case_field_type;
2546
- display_context;
2547
- display_context_parameter;
2548
- label;
2549
- order;
2550
- }
2551
-
2552
- // @dynamic
2553
- class SearchResultViewItem {
2554
- case_id;
2555
- case_fields;
2556
- hydrated_case_fields;
2557
- columns;
2558
- supplementary_data;
2559
- display_context_parameter;
2560
- }
2561
- __decorate([
2562
- Type(() => CaseField),
2563
- __metadata("design:type", Array)
2564
- ], SearchResultViewItem.prototype, "hydrated_case_fields", void 0);
2565
-
2566
- // @dynamic
2567
- class SearchResultView {
2568
- columns;
2569
- results;
2570
- result_error;
2571
- hasDrafts() {
2572
- return this.results[0]
2573
- && this.results[0].case_id
2574
- && Draft.isDraft(this.results[0].case_id);
2575
- }
2576
- }
2577
- __decorate([
2578
- Type(() => SearchResultViewColumn),
2579
- __metadata("design:type", Array)
2580
- ], SearchResultView.prototype, "columns", void 0);
2581
- __decorate([
2582
- Type(() => SearchResultViewItem),
2583
- __metadata("design:type", Array)
2584
- ], SearchResultView.prototype, "results", void 0);
2585
-
2586
- class SortParameters {
2587
- comparator;
2588
- sortOrder;
2589
- constructor(comparator, sortOrder) {
2590
- this.comparator = comparator;
2591
- this.sortOrder = sortOrder;
2592
- }
2593
- }
2594
-
2595
- var SortOrder$1;
2596
- (function (SortOrder) {
2597
- SortOrder[SortOrder["ASCENDING"] = 0] = "ASCENDING";
2598
- SortOrder[SortOrder["DESCENDING"] = 1] = "DESCENDING";
2599
- SortOrder[SortOrder["UNSORTED"] = 2] = "UNSORTED";
2600
- })(SortOrder$1 || (SortOrder$1 = {}));
2601
-
2602
- class WorkbasketInputModel {
2603
- label;
2604
- order;
2605
- field;
2606
- metadata;
2607
- display_context_parameter;
2608
- }
2609
- class WorkbasketInput {
2610
- workbasketInputs;
2611
- }
2612
-
2613
- const USER_DETAILS = 'userDetails';
2614
- const PUI_CASE_MANAGER = 'pui-case-manager';
2615
- function getUserDetails(sessionStorageService) {
2616
- const item = sessionStorageService?.getItem(USER_DETAILS);
2617
- return safeJsonParse(item, null);
2618
- }
2619
- function isInternalUser(sessionStorageService) {
2620
- const userDetails = getUserDetails(sessionStorageService);
2621
- if (!userDetails?.roles) {
2622
- return false;
2623
- }
2624
- else if (userDetails?.roleCategories?.includes(RoleCategory.ENFORCEMENT)) {
2625
- return true;
2626
- }
2627
- else {
2628
- return !(userDetails.roles.includes(PUI_CASE_MANAGER) ||
2629
- userDetails.roles.some((role) => role.toLowerCase().includes(RoleKeyword.JUDGE)));
2630
- }
2631
- }
2632
- function isJudiciaryUser(sessionStorageService) {
2633
- const userDetails = getUserDetails(sessionStorageService);
2634
- return !!userDetails?.roles
2635
- && (userDetails.roles.some((role) => role.toLowerCase().includes(RoleKeyword.JUDGE)));
2636
- }
2637
- function roleHasKeyword(keyword, roleWords) {
2638
- return roleWords.includes(keyword);
2639
- }
2640
- function isWorkAllocationUser(sessionStorageService) {
2641
- const userDetails = getUserDetails(sessionStorageService);
2642
- return userDetails?.roles
2643
- && !userDetails.roles.includes(PUI_CASE_MANAGER)
2644
- &&
2645
- (userDetails.roles.includes('caseworker-ia-iacjudge')
2646
- || userDetails.roles.includes('caseworker-ia-caseofficer')
2647
- || userDetails.roles.includes('caseworker-ia-admofficer')
2648
- || userDetails.roles.includes('caseworker-civil')
2649
- || userDetails.roles.includes('caseworker-privatelaw')
2650
- || userDetails?.roleCategories?.includes(RoleCategory.ENFORCEMENT));
2651
- }
2652
- // fallback purely if roleCategories is not available in
2653
- function getMappedRoleCategories(roles = []) {
2654
- const roleKeywords = roles.join().split('-').join().split(',');
2655
- const roleCategoryList = [];
2656
- if (roleHasKeyword(RoleKeyword.JUDGE, roleKeywords)) {
2657
- roleCategoryList.push(RoleCategory.JUDICIAL);
2658
- }
2659
- if (roleHasKeyword(RoleKeyword.SOLICITOR, roleKeywords)) {
2660
- roleCategoryList.push(RoleCategory.PROFESSIONAL);
2661
- }
2662
- if (roleHasKeyword(RoleKeyword.CITIZEN, roleKeywords)) {
2663
- roleCategoryList.push(RoleCategory.CITIZEN);
2664
- }
2665
- if (roleHasKeyword(RoleKeyword.ADMIN, roleKeywords)) {
2666
- roleCategoryList.push(RoleCategory.ADMIN);
2667
- }
2668
- if (roleHasKeyword(RoleKeyword.CTSC, roleKeywords)) {
2669
- roleCategoryList.push(RoleCategory.CTSC);
2670
- }
2671
- if (roleHasKeyword(RoleKeyword.CASEWORKER, roleKeywords)) {
2672
- roleCategoryList.push(RoleCategory.LEGAL_OPERATIONS);
2673
- }
2674
- if (roleHasKeyword(RoleKeyword.ENFORCEMENT, roleKeywords)) {
2675
- roleCategoryList.push(RoleCategory.ENFORCEMENT);
2676
- }
2677
- return roleCategoryList;
2678
- }
2679
- function getAMRoleName(accessType, aMRole) {
2680
- let roleName = '';
2681
- switch (aMRole) {
2682
- case RoleCategory.JUDICIAL:
2683
- roleName = `${accessType}-access-${AMRoleSuffix.JUDICIARY}`;
2684
- break;
2685
- case RoleCategory.PROFESSIONAL:
2686
- roleName = `${accessType}-access-${AMRoleSuffix.PROFESSIONAL}`;
2687
- break;
2688
- case RoleCategory.CITIZEN:
2689
- roleName = `${accessType}-access-${AMRoleSuffix.CITIZEN}`;
2690
- break;
2691
- case RoleCategory.ADMIN:
2692
- roleName = `${accessType}-access-${AMRoleSuffix.ADMIN}`;
2693
- break;
2694
- case RoleCategory.CTSC:
2695
- roleName = `${accessType}-access-${AMRoleSuffix.CTSC}`;
2696
- break;
2697
- case RoleCategory.ENFORCEMENT:
2698
- roleName = `${accessType}-access-${AMRoleSuffix.ENFORCEMENT}`;
2699
- break;
2700
- default:
2701
- roleName = `${accessType}-access-${AMRoleSuffix.LEGAL_OPERATIONS}`;
2702
- break;
2703
- }
2704
- return roleName;
2705
- }
2706
-
2707
- // @dynamic
2708
- class ActivityService {
2709
- http;
2710
- appConfig;
2711
- sessionStorageService;
2712
- static get ACTIVITY_VIEW() { return 'view'; }
2713
- static get ACTIVITY_EDIT() { return 'edit'; }
2714
- logger = new StructuredLoggerService();
2715
- constructor(http, appConfig, sessionStorageService) {
2716
- this.http = http;
2717
- this.appConfig = appConfig;
2718
- this.sessionStorageService = sessionStorageService;
2719
- }
2720
- get isEnabled() {
2721
- return this.activityUrl() && this.userAuthorised;
2722
- }
2723
- static DUMMY_CASE_REFERENCE = '0';
2724
- userAuthorised = undefined;
2725
- static handleHttpError(response) {
2726
- const error = HttpErrorService.convertToHttpError(response);
2727
- if (response?.status !== error.status) {
2728
- error.status = response.status;
2729
- }
2730
- return error;
2731
- }
2732
- getOptions() {
2733
- const userDetails = safeJsonParse(this.sessionStorageService.getItem(USER_DETAILS));
2734
- let headers = new HttpHeaders().set('Content-Type', 'application/json');
2735
- if (userDetails?.token) {
2736
- headers = headers.set('Authorization', userDetails.token);
2737
- }
2738
- return {
2739
- headers,
2740
- withCredentials: true,
2741
- observe: 'body',
2742
- };
2743
- }
2744
- getActivities(...caseId) {
2745
- try {
2746
- const options = this.getOptions();
2747
- const url = `${this.activityUrl()}/cases/${caseId.join(',')}/activity`;
2748
- return this.http
2749
- .get(url, options, false, ActivityService.handleHttpError)
2750
- .pipe(map(response => response));
2751
- }
2752
- catch (error) {
2753
- this.logUserMayNotBeAuthenticated(error);
2754
- }
2755
- }
2756
- postActivity(caseId, activity) {
2757
- try {
2758
- const options = this.getOptions();
2759
- const url = `${this.activityUrl()}/cases/${caseId}/activity`;
2760
- const body = { activity };
2761
- return this.http
2762
- .post(url, body, options, false)
2763
- .pipe(map(response => response));
2764
- }
2765
- catch (error) {
2766
- this.logUserMayNotBeAuthenticated(error);
2767
- }
2768
- }
2769
- verifyUserIsAuthorized() {
2770
- if (this.sessionStorageService.getItem(USER_DETAILS) && this.activityUrl() && this.userAuthorised === undefined) {
2771
- this.getActivities(ActivityService.DUMMY_CASE_REFERENCE).subscribe(() => this.userAuthorised = true, error => {
2772
- this.userAuthorised = [401, 403].indexOf(error.status) <= -1;
2773
- });
2774
- }
2775
- }
2776
- activityUrl() {
2777
- return this.appConfig.getActivityUrl();
2778
- }
2779
- logUserMayNotBeAuthenticated(error) {
2780
- this.logger.error('User may not be authenticated. Activity request was not sent.', { error });
2781
- }
2782
- static ɵfac = function ActivityService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(SessionStorageService)); };
2783
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac });
2784
- }
2785
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityService, [{
2786
- type: Injectable
2787
- }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: SessionStorageService }], null); })();
2788
-
2789
- // @dynamic
2790
- class ActivityPollingService {
2791
- activityService;
2792
- ngZone;
2793
- config;
2794
- logger = new StructuredLoggerService();
2795
- pendingRequests = new Map();
2796
- currentTimeoutHandle;
2797
- pollActivitiesSubscription;
2798
- pollConfig;
2799
- batchCollectionDelayMs;
2800
- maxRequestsPerBatch;
2801
- constructor(activityService, ngZone, config) {
2802
- this.activityService = activityService;
2803
- this.ngZone = ngZone;
2804
- this.config = config;
2805
- this.pollConfig = {
2806
- interval: config.getActivityNexPollRequestMs(),
2807
- attempts: config.getActivityRetry()
2808
- };
2809
- this.batchCollectionDelayMs = config.getActivityBatchCollectionDelayMs();
2810
- this.maxRequestsPerBatch = config.getActivityMaxRequestPerBatch();
2811
- }
2812
- get isEnabled() {
2813
- return this.activityService.isEnabled;
2814
- }
2815
- subscribeToActivity(caseId, done) {
2816
- if (!this.isEnabled) {
2817
- return new Subject();
2818
- }
2819
- let subject = this.pendingRequests.get(caseId);
2820
- if (subject) {
2821
- subject.subscribe(done);
2822
- }
2823
- else {
2824
- // Only the first pending request should start the batch collection timer.
2825
- const wasEmpty = this.pendingRequests.size === 0;
2826
- subject = new Subject();
2827
- subject.subscribe(done);
2828
- this.addPendingRequest(caseId, subject);
2829
- if (wasEmpty) {
2830
- this.ngZone.runOutsideAngular(() => {
2831
- this.currentTimeoutHandle = setTimeout(() => this.ngZone.run(() => {
2832
- this.flushRequests();
2833
- }), this.batchCollectionDelayMs);
2834
- });
2835
- }
2836
- }
2837
- if (this.pendingRequests.size >= this.maxRequestsPerBatch) {
2838
- this.flushRequests();
2839
- }
2840
- return subject;
2841
- }
2842
- stopPolling() {
2843
- if (this.pollActivitiesSubscription) {
2844
- this.pollActivitiesSubscription.unsubscribe();
2845
- }
2846
- }
2847
- flushRequests() {
2848
- if (this.currentTimeoutHandle) {
2849
- clearTimeout(this.currentTimeoutHandle);
2850
- this.currentTimeoutHandle = undefined;
2851
- }
2852
- if (!this.pendingRequests.size) {
2853
- return;
2854
- }
2855
- const requests = new Map(this.pendingRequests);
2856
- this.pendingRequests.clear();
2857
- this.performBatchRequest(requests);
2858
- }
2859
- pollActivities(...caseIds) {
2860
- if (!this.isEnabled) {
2861
- return EMPTY;
2862
- }
2863
- return this.polling(this.activityService.getActivities(...caseIds), this.pollConfig);
2864
- }
2865
- postViewActivity(caseId) {
2866
- return this.postActivity(caseId, ActivityService.ACTIVITY_VIEW);
2867
- }
2868
- postEditActivity(caseId) {
2869
- return this.postActivity(caseId, ActivityService.ACTIVITY_EDIT);
2870
- }
2871
- performBatchRequest(requests) {
2872
- const caseIds = Array.from(requests.keys()).join();
2873
- this.ngZone.runOutsideAngular(() => {
2874
- // run polling outside angular zone so it does not trigger change detection
2875
- this.pollActivitiesSubscription = this.pollActivities(caseIds).subscribe({
2876
- // process activity inside zone so it triggers change detection for activity.component.ts
2877
- next: (activities) => this.ngZone.run(() => {
2878
- activities.forEach((activity) => {
2879
- // Ignore activities returned for cases outside this local batch.
2880
- requests.get(activity.caseId)?.next(activity);
2881
- });
2882
- }),
2883
- error: (err) => this.ngZone.run(() => {
2884
- this.logger.error('Error while polling activities.', { error: err });
2885
- Array.from(requests.values()).forEach((subject) => subject.error(err));
2886
- })
2887
- });
2888
- });
2889
- }
2890
- postActivity(caseId, activityType) {
2891
- if (!this.isEnabled) {
2892
- return EMPTY;
2893
- }
2894
- const pollingConfig = {
2895
- ...this.pollConfig,
2896
- interval: 5000 // inline with CCD Backend
2897
- };
2898
- return this.polling(this.activityService.postActivity(caseId, activityType), pollingConfig);
2899
- }
2900
- addPendingRequest(caseId, subject) {
2901
- this.pendingRequests.set(caseId, subject);
2902
- // Components complete their returned Subject on destroy; remove it so a later same-case subscription gets a fresh Subject.
2903
- subject.subscribe({
2904
- complete: () => this.removePendingRequest(caseId, subject),
2905
- error: () => this.removePendingRequest(caseId, subject)
2906
- });
2907
- }
2908
- removePendingRequest(caseId, subject) {
2909
- if (this.pendingRequests.get(caseId) !== subject) {
2910
- return;
2911
- }
2912
- this.pendingRequests.delete(caseId);
2913
- if (!this.pendingRequests.size && this.currentTimeoutHandle) {
2914
- clearTimeout(this.currentTimeoutHandle);
2915
- this.currentTimeoutHandle = undefined;
2916
- }
2917
- }
2918
- polling(request$, options) {
2919
- const pollingOptions = {
2920
- interval: options.interval,
2921
- attempts: options.attempts ?? 9,
2922
- exponentialUnit: options.exponentialUnit ?? 1000
2923
- };
2924
- return concat(request$, defer(() => timer(pollingOptions.interval).pipe(switchMap(() => request$))).pipe(repeat())).pipe(
2925
- // Preserve consecutive-failure retry behaviour using the current RxJS retry config.
2926
- retry({
2927
- count: pollingOptions.attempts,
2928
- delay: (_error, retryCount) => timer(this.getExponentialRetryDelay(retryCount, pollingOptions.exponentialUnit)),
2929
- resetOnSuccess: true
2930
- }));
2931
- }
2932
- getExponentialRetryDelay(consecutiveErrorsCount, exponentialUnit) {
2933
- return Math.pow(2, consecutiveErrorsCount - 1) * exponentialUnit;
2934
- }
2935
- static ɵfac = function ActivityPollingService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActivityPollingService)(i0.ɵɵinject(ActivityService), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(AbstractAppConfig)); };
2936
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityPollingService, factory: ActivityPollingService.ɵfac });
2937
- }
2938
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityPollingService, [{
2939
- type: Injectable
2940
- }], () => [{ type: ActivityService }, { type: i0.NgZone }, { type: AbstractAppConfig }], null); })();
2113
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityPollingService, [{
2114
+ type: Injectable
2115
+ }], () => [{ type: ActivityService }, { type: i0.NgZone }, { type: AbstractAppConfig }], null); })();
2941
2116
 
2942
2117
  function ActivityComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
2943
2118
  i0.ɵɵelementStart(0, "div");
@@ -3277,6 +2452,22 @@ class AlertService {
3277
2452
  type: Injectable
3278
2453
  }], () => [{ type: i1$1.Router }, { type: i1.RpxTranslationService }], null); })();
3279
2454
 
2455
+ const DRAFT_PREFIX = 'DRAFT';
2456
+ const DRAFT_QUERY_PARAM = 'draft';
2457
+ class Draft {
2458
+ id;
2459
+ document;
2460
+ type;
2461
+ created;
2462
+ updated;
2463
+ static stripDraftId(draftId) {
2464
+ return draftId.slice(DRAFT_PREFIX.length);
2465
+ }
2466
+ static isDraft(id) {
2467
+ return String(id).startsWith(DRAFT_PREFIX);
2468
+ }
2469
+ }
2470
+
3280
2471
  class DraftService {
3281
2472
  http;
3282
2473
  appConfig;
@@ -3556,739 +2747,1442 @@ var SelectFlagTypeErrorMessage;
3556
2747
  SelectFlagTypeErrorMessage["FLAG_TYPE_LIMIT_EXCEEDED"] = "You can enter up to 80 characters only";
3557
2748
  })(SelectFlagTypeErrorMessage || (SelectFlagTypeErrorMessage = {}));
3558
2749
 
3559
- var UpdateFlagAddTranslationErrorMessage;
3560
- (function (UpdateFlagAddTranslationErrorMessage) {
3561
- UpdateFlagAddTranslationErrorMessage["DESCRIPTION_CHAR_LIMIT_EXCEEDED"] = "Original description or translation must be 200 characters or fewer";
3562
- UpdateFlagAddTranslationErrorMessage["COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Original comments or translation must be 200 characters or fewer";
3563
- })(UpdateFlagAddTranslationErrorMessage || (UpdateFlagAddTranslationErrorMessage = {}));
2750
+ var UpdateFlagAddTranslationErrorMessage;
2751
+ (function (UpdateFlagAddTranslationErrorMessage) {
2752
+ UpdateFlagAddTranslationErrorMessage["DESCRIPTION_CHAR_LIMIT_EXCEEDED"] = "Original description or translation must be 200 characters or fewer";
2753
+ UpdateFlagAddTranslationErrorMessage["COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Original comments or translation must be 200 characters or fewer";
2754
+ })(UpdateFlagAddTranslationErrorMessage || (UpdateFlagAddTranslationErrorMessage = {}));
2755
+
2756
+ var UpdateFlagAddTranslationStep;
2757
+ (function (UpdateFlagAddTranslationStep) {
2758
+ UpdateFlagAddTranslationStep["HINT_TEXT"] = "Write translation for flag description or comments in the boxes provided.";
2759
+ UpdateFlagAddTranslationStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
2760
+ })(UpdateFlagAddTranslationStep || (UpdateFlagAddTranslationStep = {}));
2761
+
2762
+ var UpdateFlagErrorMessage;
2763
+ (function (UpdateFlagErrorMessage) {
2764
+ UpdateFlagErrorMessage["FLAG_COMMENTS_NOT_ENTERED"] = "Please enter comments for this flag";
2765
+ UpdateFlagErrorMessage["FLAG_COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Comments for this flag must be 200 characters or fewer";
2766
+ UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED"] = "Comments and/or the name of the person approving the decision should be entered";
2767
+ UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED_EXTERNAL"] = "You must explain why the support is no longer needed";
2768
+ UpdateFlagErrorMessage["STATUS_REASON_CHAR_LIMIT_EXCEEDED"] = "Comments must be 200 characters or fewer";
2769
+ UpdateFlagErrorMessage["NONE"] = "";
2770
+ })(UpdateFlagErrorMessage || (UpdateFlagErrorMessage = {}));
2771
+
2772
+ var UpdateFlagStep;
2773
+ (function (UpdateFlagStep) {
2774
+ UpdateFlagStep["COMMENT_HINT_TEXT_INTERNAL"] = "Explain why you are updating this flag. Do not include any sensitive information such as personal details.";
2775
+ UpdateFlagStep["COMMENT_HINT_TEXT_INTERNAL_2_POINT_1"] = "Update the comments describing the user's support needs or flag description. Do not include any sensitive information such as personal details.";
2776
+ UpdateFlagStep["COMMENT_HINT_TEXT_EXTERNAL"] = "Do not include any sensitive information such as personal details.";
2777
+ UpdateFlagStep["COMMENT_FIELD_LABEL_EXTERNAL"] = "Please provide your comments below";
2778
+ UpdateFlagStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
2779
+ UpdateFlagStep["STATUS_HINT_TEXT"] = "Describe reason for status change.";
2780
+ UpdateFlagStep["WARNING_TEXT"] = "The details entered here MAY be visible to the party in the future.";
2781
+ })(UpdateFlagStep || (UpdateFlagStep = {}));
2782
+
2783
+ var CaseFlagFieldState;
2784
+ (function (CaseFlagFieldState) {
2785
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_LOCATION"] = 0] = "FLAG_LOCATION";
2786
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_TYPE"] = 1] = "FLAG_TYPE";
2787
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_LANGUAGE_INTERPRETER"] = 2] = "FLAG_LANGUAGE_INTERPRETER";
2788
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_COMMENTS"] = 3] = "FLAG_COMMENTS";
2789
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_STATUS"] = 4] = "FLAG_STATUS";
2790
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_MANAGE_CASE_FLAGS"] = 5] = "FLAG_MANAGE_CASE_FLAGS";
2791
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE"] = 6] = "FLAG_UPDATE";
2792
+ CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE_WELSH_TRANSLATION"] = 7] = "FLAG_UPDATE_WELSH_TRANSLATION";
2793
+ })(CaseFlagFieldState || (CaseFlagFieldState = {}));
2794
+ var CaseFlagErrorMessage;
2795
+ (function (CaseFlagErrorMessage) {
2796
+ CaseFlagErrorMessage["NO_EXTERNAL_FLAGS_COLLECTION"] = "External collection for storing this case flag has not been configured for this case type";
2797
+ CaseFlagErrorMessage["NO_INTERNAL_FLAGS_COLLECTION"] = "Internal collection for storing this case flag has not been configured for this case type";
2798
+ })(CaseFlagErrorMessage || (CaseFlagErrorMessage = {}));
2799
+
2800
+ class DashPipe {
2801
+ transform(value) {
2802
+ return value ? value : '-';
2803
+ }
2804
+ static ɵfac = function DashPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DashPipe)(); };
2805
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDash", type: DashPipe, pure: true, standalone: false });
2806
+ }
2807
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DashPipe, [{
2808
+ type: Pipe,
2809
+ args: [{
2810
+ name: 'ccdDash',
2811
+ standalone: false
2812
+ }]
2813
+ }], null, null); })();
2814
+
2815
+ /*
2816
+ Translate a date time format string from the Java format provided by CCD to the format supported by Angular formatDate()
2817
+ Very simple translator that maps unsupported chars to the nearest equivalent.
2818
+ If there is no equivalent puts ***x*** into the output where x is the unsupported character
2819
+
2820
+ Java format
2821
+ G era text AD; Anno Domini; A
2822
+ u year year 2004; 04
2823
+ y year-of-era year 2004; 04
2824
+ D day-of-year number 189
2825
+ M/L month-of-year number/text 7; 07; Jul; July; J
2826
+ d day-of-month number 10
2827
+
2828
+ Q/q quarter-of-year number/text 3; 03; Q3; 3rd quarter
2829
+ Y week-based-year year 1996; 96
2830
+ w week-of-week-based-year number 27
2831
+ W week-of-month number 4
2832
+ E day-of-week text Tue; Tuesday; T
2833
+ e/c localized day-of-week number/text 2; 02; Tue; Tuesday; T
2834
+ F week-of-month number 3
2835
+
2836
+ a am-pm-of-day text PM
2837
+ h clock-hour-of-am-pm (1-12) number 12
2838
+ K hour-of-am-pm (0-11) number 0
2839
+ k clock-hour-of-am-pm (1-24) number 0
2840
+
2841
+ H hour-of-day (0-23) number 0
2842
+ m minute-of-hour number 30
2843
+ s second-of-minute number 55
2844
+ S fraction-of-second fraction 978
2845
+ A milli-of-day number 1234
2846
+ n nano-of-second number 987654321
2847
+ N nano-of-day number 1234000000
2848
+
2849
+ V time-zone ID zone-id America/Los_Angeles; Z; -08:30
2850
+ z time-zone name zone-name Pacific Standard Time; PST
2851
+ O localized zone-offset offset-O GMT+8; GMT+08:00; UTC-08:00;
2852
+ X zone-offset 'Z' for zero offset-X Z; -08; -0830; -08:30; -083015; -08:30:15;
2853
+ x zone-offset offset-x +0000; -08; -0830; -08:30; -083015; -08:30:15;
2854
+ Z zone-offset offset-Z +0000; -0800; -08:00;
2855
+
2856
+ p pad next pad modifier 1
2857
+
2858
+ ' escape for text delimiter
2859
+ '' single quote literal '
2860
+ [ optional section start
2861
+ ] optional section end
2862
+ # reserved for future use
2863
+ { reserved for future use
2864
+ } reserved for future use
2865
+
2866
+ Angular dateFormat characters
2867
+ Era G, GG & GGG Abbreviated AD
2868
+ GGGG Wide Anno Domini
2869
+ GGGGG Narrow A
2870
+ Year y Numeric: minimum digits 2, 20, 201, 2017, 20173
2871
+ yy Numeric: 2 digits + zero padded 02, 20, 01, 17, 73
2872
+ yyy Numeric: 3 digits + zero padded 002, 020, 201, 2017, 20173
2873
+ yyyy Numeric: 4 digits or more + zero padded 0002, 0020, 0201, 2017, 20173
2874
+ Month M Numeric: 1 digit 9, 12
2875
+ MM Numeric: 2 digits + zero padded 09, 12
2876
+ MMM Abbreviated Sep
2877
+ MMMM Wide September
2878
+ MMMMM Narrow S
2879
+ Month standalone L Numeric: 1 digit 9, 12
2880
+ LL Numeric: 2 digits + zero padded 09, 12
2881
+ LLL Abbreviated Sep
2882
+ LLLL Wide September
2883
+ LLLLL Narrow S
2884
+ Week of year w Numeric: minimum digits 1... 53
2885
+ ww Numeric: 2 digits + zero padded 01... 53
2886
+ Week of month W Numeric: 1 digit 1... 5
2887
+ Day of month d Numeric: minimum digits 1
2888
+ dd Numeric: 2 digits + zero padded 01
2889
+ Week day E, EE & EEE Abbreviated Tue
2890
+ EEEE Wide Tuesday
2891
+ EEEEE Narrow T
2892
+ EEEEEE Short Tu
2893
+ Period a, aa & aaa Abbreviated am/pm or AM/PM
2894
+ aaaa Wide (fallback to a when missing) ante meridiem/post meridiem
2895
+ aaaaa Narrow a/p
2896
+ Period* B, BB & BBB Abbreviated mid.
2897
+ BBBB Wide am, pm, midnight, noon, morning, afternoon, evening, night
2898
+ BBBBB Narrow md
2899
+ Period standalone* b, bb & bbb Abbreviated mid.
2900
+ bbbb Wide am, pm, midnight, noon, morning, afternoon, evening, night
2901
+ bbbbb Narrow md
2902
+ Hour 1-12 h Numeric: minimum digits 1, 12
2903
+ hh Numeric: 2 digits + zero padded 01, 12
2904
+ Hour 0-23 H Numeric: minimum digits 0, 23
2905
+ HH Numeric: 2 digits + zero padded 00, 23
2906
+ Minute m Numeric: minimum digits 8, 59
2907
+ mm Numeric: 2 digits + zero padded 08, 59
2908
+ Second s Numeric: minimum digits 0... 59
2909
+ ss Numeric: 2 digits + zero padded 00... 59
2910
+ Fractional seconds S Numeric: 1 digit 0... 9
2911
+ SS Numeric: 2 digits + zero padded 00... 99
2912
+ SSS Numeric: 3 digits + zero padded (= milliseconds) 000... 999
2913
+ Zone z, zz & zzz Short specific non location format (fallback to O) GMT-8
2914
+ zzzz Long specific non location format (fallback to OOOO) GMT-08:00
2915
+ Z, ZZ & ZZZ ISO8601 basic format -0800
2916
+ ZZZZ Long localized GMT format GMT-8:00
2917
+ ZZZZZ ISO8601 extended format + Z indicator for offset 0 (= XXXXX) -08:00
2918
+ O, OO & OOO Short localized GMT format GMT-8
2919
+ OOOO Long localized GMT format GMT-08:00
2920
+ */
2921
+ class FormatTranslatorService {
2922
+ translate(javaFormat) {
2923
+ const result = [];
2924
+ let prev = '\0';
2925
+ let inQuote = false;
2926
+ const maybePush = (target, obj, flag) => {
2927
+ if (!flag) {
2928
+ target.push(obj);
2929
+ }
2930
+ };
2931
+ for (const c of javaFormat) {
2932
+ switch (c) {
2933
+ case '\'':
2934
+ if (prev === '\'') {
2935
+ // literal single quote - ignore
2936
+ inQuote = false;
2937
+ }
2938
+ else {
2939
+ inQuote = !inQuote;
2940
+ }
2941
+ break;
2942
+ // Due to formatting constraints on the webapp, all 'd' characters should be replaced with 'D' (for Moment library)
2943
+ // This is because we want the date, not the day (this format will need to be converted back)
2944
+ case 'd':
2945
+ maybePush(result, 'D', inQuote);
2946
+ break;
2947
+ // moment library defines year as capital y
2948
+ case 'y':
2949
+ maybePush(result, 'Y', inQuote);
2950
+ break;
2951
+ case 'e':
2952
+ case 'c':
2953
+ maybePush(result, 'E', inQuote); // no lower case E
2954
+ break;
2955
+ case 'F':
2956
+ maybePush(result, 'W', inQuote);
2957
+ break;
2958
+ case 'K':
2959
+ maybePush(result, 'H', inQuote);
2960
+ break;
2961
+ case 'k':
2962
+ maybePush(result, 'h', inQuote);
2963
+ break;
2964
+ // commented out A change to '***' due to use in moment library for AM/PM
2965
+ // added 'a' specification to stop discrepancy in am/AM pm/PM formatting
2966
+ case 'a':
2967
+ maybePush(result, 'A', inQuote);
2968
+ break;
2969
+ case 'n':
2970
+ case 'N':
2971
+ maybePush(result, `***${c}***`, inQuote); // No way to support A - millisec of day, n - nano of second, N - nano of Day
2972
+ break;
2973
+ case 'V':
2974
+ case 'O':
2975
+ maybePush(result, 'z', inQuote);
2976
+ break;
2977
+ case 'x':
2978
+ case 'X':
2979
+ maybePush(result, 'Z', inQuote);
2980
+ break;
2981
+ default:
2982
+ maybePush(result, c, inQuote);
2983
+ }
2984
+ prev = c;
2985
+ }
2986
+ return result.join('');
2987
+ }
2988
+ showOnlyDates(dateFormat) {
2989
+ // replace 'd' character with 'D' for the moment library
2990
+ // This ensures only dates allowed
2991
+ while (dateFormat.includes('d')) {
2992
+ dateFormat = dateFormat.replace('d', 'D');
2993
+ }
2994
+ while (dateFormat.includes('y')) {
2995
+ dateFormat = dateFormat.replace('y', 'Y');
2996
+ }
2997
+ return dateFormat;
2998
+ }
2999
+ removeTime(dateFormat) {
3000
+ // remove hours irrelevant of whether 12 or 24 hour clock
3001
+ while (dateFormat.includes('H') || dateFormat.includes('h')) {
3002
+ dateFormat = dateFormat.replace('H', '');
3003
+ dateFormat = dateFormat.replace('h', '');
3004
+ }
3005
+ // remove minutes
3006
+ while (dateFormat.includes('m')) {
3007
+ dateFormat = dateFormat.replace('m', '');
3008
+ }
3009
+ // remove seconds (s) and micro seconds (S)
3010
+ while (dateFormat.includes('S') || dateFormat.includes('s')) {
3011
+ dateFormat = dateFormat.replace('S', '');
3012
+ dateFormat = dateFormat.replace('s', '');
3013
+ }
3014
+ // because there is time removal algorithm can make reasonable assumption to remove colons
3015
+ while (dateFormat.includes(':')) {
3016
+ dateFormat = dateFormat.replace(':', '');
3017
+ }
3018
+ return dateFormat.trim();
3019
+ }
3020
+ hasDate(value) {
3021
+ return this.translate(value).length &&
3022
+ value.toLowerCase().indexOf('d') >= 0 &&
3023
+ value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3024
+ }
3025
+ is24Hour(value) {
3026
+ return this.translate(value).length &&
3027
+ value.indexOf('H') >= 0;
3028
+ }
3029
+ hasNoDay(value) {
3030
+ return this.translate(value).length && value.toLowerCase().indexOf('d') === -1 &&
3031
+ value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3032
+ }
3033
+ hasNoDayAndMonth(value) {
3034
+ return this.translate(value).length &&
3035
+ value.toLowerCase().indexOf('d') === -1 &&
3036
+ value.indexOf('M') === -1 &&
3037
+ value.toLowerCase().indexOf('y') >= 0;
3038
+ }
3039
+ hasHours(value) {
3040
+ return this.translate(value).length && value.toLowerCase().indexOf('h') >= 0 && value.indexOf('m') === -1;
3041
+ }
3042
+ hasMinutes(value) {
3043
+ return this.translate(value).length && value.indexOf('m') >= 0 && value.toLowerCase().indexOf('h') >= 0;
3044
+ }
3045
+ hasSeconds(value) {
3046
+ return this.translate(value).length && value.toLowerCase().indexOf('s') >= 0;
3047
+ }
3048
+ static ɵfac = function FormatTranslatorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FormatTranslatorService)(); };
3049
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FormatTranslatorService, factory: FormatTranslatorService.ɵfac });
3050
+ }
3051
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FormatTranslatorService, [{
3052
+ type: Injectable
3053
+ }], null, null); })();
3054
+
3055
+ class DatePipe {
3056
+ formatTrans;
3057
+ static DATE_FORMAT_REGEXP = new RegExp('^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?|Z)?$');
3058
+ // 1 2 3 4 5 6 7 8 9 10 11
3059
+ static MONTHS = [
3060
+ ['Jan'], ['Feb'], ['Mar'], ['Apr'], ['May'], ['Jun'], ['Jul'], ['Aug'], ['Sep'], ['Oct'], ['Nov'], ['Dec'],
3061
+ ];
3062
+ /**
3063
+ * constructor to allow format translator to be injected
3064
+ * @param formatTrans format translator
3065
+ */
3066
+ constructor(formatTrans) {
3067
+ this.formatTrans = formatTrans;
3068
+ }
3069
+ transform(value, zone, format) {
3070
+ let resultDate = null;
3071
+ const ISO_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
3072
+ if (value) {
3073
+ // included to avoid editing the hour twice on second pass through
3074
+ // this occurs on case details when datepipe is applied twice
3075
+ if (!value.includes('T')) {
3076
+ zone = 'utc';
3077
+ }
3078
+ const match = value.match(DatePipe.DATE_FORMAT_REGEXP);
3079
+ // Make sure we actually have a match.
3080
+ if (match) {
3081
+ let offsetDate = null;
3082
+ const date = this.getDate(match);
3083
+ if (zone === 'local') {
3084
+ offsetDate = this.getOffsetDate(date);
3085
+ }
3086
+ else {
3087
+ offsetDate = this.getDate(match);
3088
+ }
3089
+ // 'short' format is meaningful to formatDate, but not the same meaning as in the unit tests
3090
+ if (this.formatTrans && format && format !== 'short') {
3091
+ // support for java style formatting strings for dates
3092
+ format = this.translateDateFormat(format);
3093
+ resultDate = moment(offsetDate).format(format);
3094
+ }
3095
+ else {
3096
+ // RDM-1149 changed the pipe logic so that it doesn't add an hour to 'Summer Time' dates on DateTime field type
3097
+ resultDate = `${offsetDate.getDate()} ${DatePipe.MONTHS[offsetDate.getMonth()]} ${offsetDate.getFullYear()}`;
3098
+ if (match[4] && match[5] && match[6] && format !== 'short') {
3099
+ resultDate += ', ';
3100
+ resultDate += `${this.getHour(offsetDate.getHours().toString())}:`;
3101
+ resultDate += `${this.pad(offsetDate.getMinutes())}:`;
3102
+ resultDate += `${this.pad(offsetDate.getSeconds())} `;
3103
+ resultDate += (this.toInt(offsetDate.getHours().toString()) >= 12) ? 'PM' : 'AM';
3104
+ }
3105
+ }
3106
+ }
3107
+ else {
3108
+ // EUI-2667. See if what we've been given is actually a formatted date that
3109
+ // we could attempt to do something with.
3110
+ const parsedDate = Date.parse(value);
3111
+ // We successfully parsed it so let's use it.
3112
+ if (!isNaN(parsedDate)) {
3113
+ const d = new Date(parsedDate);
3114
+ // If what we received didn't include time, don't include it here either.
3115
+ if (value.indexOf(':') < 0) {
3116
+ const shortDate = d.toLocaleDateString('en-GB');
3117
+ const shortISO = shortDate.split('/').reverse().join('-');
3118
+ return this.transform(shortISO, zone, format);
3119
+ }
3120
+ // If it did include time, we want a full ISO string.
3121
+ const thisMoment = moment(d).format(ISO_FORMAT);
3122
+ return this.transform(thisMoment, zone, format);
3123
+ }
3124
+ }
3125
+ }
3126
+ return resultDate;
3127
+ }
3128
+ translateDateFormat(format) {
3129
+ if (this.formatTrans) {
3130
+ return this.formatTrans.translate(format);
3131
+ }
3132
+ else {
3133
+ return format;
3134
+ }
3135
+ }
3136
+ getOffsetDate(date) {
3137
+ const localOffset = -date.getTimezoneOffset() / 60;
3138
+ return new Date(date.getTime() + localOffset * 3600 * 1000);
3139
+ }
3140
+ getDate(match) {
3141
+ const year = this.toInt(match[1]);
3142
+ const month = this.toInt(match[2]) - 1;
3143
+ const day = this.toInt(match[3]);
3144
+ let resultDate;
3145
+ if (match[4] && match[5] && match[6]) {
3146
+ const hour = this.toInt(match[4]);
3147
+ const minutes = this.toInt(match[5]);
3148
+ const seconds = this.toInt(match[6]);
3149
+ resultDate = new Date(year, month, day, hour, minutes, seconds, 0);
3150
+ }
3151
+ else {
3152
+ resultDate = new Date(year, month, day);
3153
+ }
3154
+ return resultDate;
3155
+ }
3156
+ getHour(hourStr) {
3157
+ let hourNum = this.toInt(hourStr);
3158
+ if (hourNum > 12) {
3159
+ hourNum = hourNum - 12;
3160
+ }
3161
+ else if (hourNum === 0) {
3162
+ hourNum = 12;
3163
+ }
3164
+ return hourNum;
3165
+ }
3166
+ toInt(str) {
3167
+ return parseInt(str, 10);
3168
+ }
3169
+ pad(num, padNum = 2) {
3170
+ const val = num !== undefined ? num.toString() : '';
3171
+ return val.length >= padNum ? val : new Array(padNum - val.length + 1).join('0') + val;
3172
+ }
3173
+ static ɵfac = function DatePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DatePipe)(i0.ɵɵdirectiveInject(FormatTranslatorService, 16)); };
3174
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDate", type: DatePipe, pure: true, standalone: false });
3175
+ }
3176
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DatePipe, [{
3177
+ type: Pipe,
3178
+ args: [{
3179
+ name: 'ccdDate',
3180
+ standalone: false
3181
+ }]
3182
+ }], () => [{ type: FormatTranslatorService }], null); })();
3183
+
3184
+ class FieldLabelPipe {
3185
+ rpxTranslationPipe;
3186
+ constructor(rpxTranslationPipe) {
3187
+ this.rpxTranslationPipe = rpxTranslationPipe;
3188
+ }
3189
+ transform(field) {
3190
+ if (!field || !field.label) {
3191
+ return '';
3192
+ }
3193
+ else if (!field.display_context) {
3194
+ return this.getTranslatedLabel(field);
3195
+ }
3196
+ return this.getTranslatedLabel(field) + (field.display_context.toUpperCase() === 'OPTIONAL' ?
3197
+ ' (' + this.rpxTranslationPipe.transform('Optional') + ')' : '');
3198
+ }
3199
+ getTranslatedLabel(field) {
3200
+ if (!field.isTranslated) {
3201
+ return this.rpxTranslationPipe.transform(field.label);
3202
+ }
3203
+ else {
3204
+ return field.label;
3205
+ }
3206
+ }
3207
+ getOriginalLabelForYesNoTranslation(field) {
3208
+ return field.originalLabel || field.label;
3209
+ }
3210
+ static ɵfac = function FieldLabelPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FieldLabelPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslatePipe, 16)); };
3211
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFieldLabel", type: FieldLabelPipe, pure: false, standalone: false });
3212
+ }
3213
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FieldLabelPipe, [{
3214
+ type: Pipe,
3215
+ args: [{
3216
+ name: 'ccdFieldLabel',
3217
+ pure: false,
3218
+ standalone: false
3219
+ }]
3220
+ }], () => [{ type: i1.RpxTranslatePipe }], null); })();
3221
+
3222
+ class FirstErrorPipe {
3223
+ rpxTranslationService;
3224
+ injector;
3225
+ asyncPipe;
3226
+ constructor(rpxTranslationService, injector) {
3227
+ this.rpxTranslationService = rpxTranslationService;
3228
+ this.injector = injector;
3229
+ this.asyncPipe = new AsyncPipe(this.injector.get(ChangeDetectorRef));
3230
+ }
3231
+ transform(value, args) {
3232
+ if (!value) {
3233
+ return '';
3234
+ }
3235
+ if (!args) {
3236
+ args = 'Field';
3237
+ }
3238
+ const keys = Object.keys(value);
3239
+ if (!keys.length) {
3240
+ return '';
3241
+ }
3242
+ let errorMessage;
3243
+ if (keys[0] === 'required') {
3244
+ errorMessage = '%FIELDLABEL% is required';
3245
+ }
3246
+ else if (keys[0] === 'pattern') {
3247
+ errorMessage = 'The data entered is not valid for %FIELDLABEL%';
3248
+ }
3249
+ else if (keys[0] === 'markDownPattern') {
3250
+ errorMessage = 'The data entered is not valid for %FIELDLABEL%. Link mark up characters are not allowed in this field';
3251
+ }
3252
+ else if (keys[0] === 'unsafeRichText') {
3253
+ errorMessage = 'The data entered is not valid for %FIELDLABEL%. Potentially unsafe HTML content is not allowed in this field';
3254
+ }
3255
+ else if (keys[0] === 'minlength') {
3256
+ errorMessage = '%FIELDLABEL% is below the minimum length';
3257
+ }
3258
+ else if (keys[0] === 'maxlength') {
3259
+ errorMessage = '%FIELDLABEL% exceeds the maximum length';
3260
+ }
3261
+ else if (value.hasOwnProperty('matDatetimePickerParse')) {
3262
+ errorMessage = 'The date entered is not valid. Please provide a valid date';
3263
+ }
3264
+ else {
3265
+ errorMessage = value[keys[0]];
3266
+ }
3267
+ const o = this.rpxTranslationService.getTranslation$(args).pipe(switchMap(fieldLabel => this.rpxTranslationService.getTranslationWithReplacements$(errorMessage, { FIELDLABEL: fieldLabel })));
3268
+ return this.asyncPipe.transform(o);
3269
+ }
3270
+ ngOnDestroy() {
3271
+ this.asyncPipe.ngOnDestroy();
3272
+ }
3273
+ static ɵfac = function FirstErrorPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FirstErrorPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslationService, 16), i0.ɵɵdirectiveInject(i0.Injector, 16)); };
3274
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFirstError", type: FirstErrorPipe, pure: false, standalone: false });
3275
+ }
3276
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FirstErrorPipe, [{
3277
+ type: Pipe,
3278
+ args: [{
3279
+ name: 'ccdFirstError',
3280
+ pure: false,
3281
+ standalone: false
3282
+ }]
3283
+ }], () => [{ type: i1.RpxTranslationService }, { type: i0.Injector }], null); })();
3564
3284
 
3565
- var UpdateFlagAddTranslationStep;
3566
- (function (UpdateFlagAddTranslationStep) {
3567
- UpdateFlagAddTranslationStep["HINT_TEXT"] = "Write translation for flag description or comments in the boxes provided.";
3568
- UpdateFlagAddTranslationStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
3569
- })(UpdateFlagAddTranslationStep || (UpdateFlagAddTranslationStep = {}));
3285
+ class IsCompoundPipe {
3286
+ static COMPOUND_TYPES = [
3287
+ 'Complex',
3288
+ 'Label',
3289
+ 'AddressGlobal',
3290
+ 'AddressUK',
3291
+ 'AddressGlobalUK',
3292
+ 'CasePaymentHistoryViewer',
3293
+ 'CaseHistoryViewer',
3294
+ 'Organisation',
3295
+ 'WaysToPay',
3296
+ 'ComponentLauncher',
3297
+ 'FlagLauncher',
3298
+ 'CaseFlag'
3299
+ ];
3300
+ static EXCLUDE = [
3301
+ 'CaseLink',
3302
+ 'JudicialUser'
3303
+ ];
3304
+ transform(field) {
3305
+ if (!field || !field.field_type || !field.field_type.type) {
3306
+ return false;
3307
+ }
3308
+ if (IsCompoundPipe.COMPOUND_TYPES.indexOf(field.field_type.type) !== -1) {
3309
+ if (IsCompoundPipe.EXCLUDE.indexOf(field.field_type.id) !== -1) {
3310
+ return false;
3311
+ }
3312
+ return true;
3313
+ }
3314
+ return false;
3315
+ }
3316
+ static ɵfac = function IsCompoundPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsCompoundPipe)(); };
3317
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsCompound", type: IsCompoundPipe, pure: true, standalone: false });
3318
+ }
3319
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsCompoundPipe, [{
3320
+ type: Pipe,
3321
+ args: [{
3322
+ name: 'ccdIsCompound',
3323
+ standalone: false
3324
+ }]
3325
+ }], null, null); })();
3570
3326
 
3571
- var UpdateFlagErrorMessage;
3572
- (function (UpdateFlagErrorMessage) {
3573
- UpdateFlagErrorMessage["FLAG_COMMENTS_NOT_ENTERED"] = "Please enter comments for this flag";
3574
- UpdateFlagErrorMessage["FLAG_COMMENTS_CHAR_LIMIT_EXCEEDED"] = "Comments for this flag must be 200 characters or fewer";
3575
- UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED"] = "Comments and/or the name of the person approving the decision should be entered";
3576
- UpdateFlagErrorMessage["STATUS_REASON_NOT_ENTERED_EXTERNAL"] = "You must explain why the support is no longer needed";
3577
- UpdateFlagErrorMessage["STATUS_REASON_CHAR_LIMIT_EXCEEDED"] = "Comments must be 200 characters or fewer";
3578
- UpdateFlagErrorMessage["NONE"] = "";
3579
- })(UpdateFlagErrorMessage || (UpdateFlagErrorMessage = {}));
3327
+ class CaseFieldService {
3328
+ isOptional(field) {
3329
+ if (!field || !field.display_context) {
3330
+ return false;
3331
+ }
3332
+ return field.display_context.toUpperCase() === 'OPTIONAL';
3333
+ }
3334
+ isReadOnly(field) {
3335
+ if (!field || !field.display_context) {
3336
+ return false;
3337
+ }
3338
+ return field.display_context.toUpperCase() === 'READONLY';
3339
+ }
3340
+ isMandatory(field) {
3341
+ if (!field || !field.display_context) {
3342
+ return false;
3343
+ }
3344
+ return field.display_context.toUpperCase() === 'MANDATORY';
3345
+ }
3346
+ isLabel(field) {
3347
+ if (!field || !field.field_type) {
3348
+ return false;
3349
+ }
3350
+ return field.field_type.type === 'Label';
3351
+ }
3352
+ static ɵfac = function CaseFieldService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseFieldService)(); };
3353
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseFieldService, factory: CaseFieldService.ɵfac });
3354
+ }
3355
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFieldService, [{
3356
+ type: Injectable
3357
+ }], null, null); })();
3580
3358
 
3581
- var UpdateFlagStep;
3582
- (function (UpdateFlagStep) {
3583
- UpdateFlagStep["COMMENT_HINT_TEXT_INTERNAL"] = "Explain why you are updating this flag. Do not include any sensitive information such as personal details.";
3584
- UpdateFlagStep["COMMENT_HINT_TEXT_INTERNAL_2_POINT_1"] = "Update the comments describing the user's support needs or flag description. Do not include any sensitive information such as personal details.";
3585
- UpdateFlagStep["COMMENT_HINT_TEXT_EXTERNAL"] = "Do not include any sensitive information such as personal details.";
3586
- UpdateFlagStep["COMMENT_FIELD_LABEL_EXTERNAL"] = "Please provide your comments below";
3587
- UpdateFlagStep["CHARACTER_LIMIT_INFO"] = "You can enter up to 200 characters";
3588
- UpdateFlagStep["STATUS_HINT_TEXT"] = "Describe reason for status change.";
3589
- UpdateFlagStep["WARNING_TEXT"] = "The details entered here MAY be visible to the party in the future.";
3590
- })(UpdateFlagStep || (UpdateFlagStep = {}));
3359
+ class IsMandatoryPipe {
3360
+ caseFieldService;
3361
+ constructor(caseFieldService) {
3362
+ this.caseFieldService = caseFieldService;
3363
+ }
3364
+ transform(field) {
3365
+ return this.caseFieldService.isMandatory(field);
3366
+ }
3367
+ static ɵfac = function IsMandatoryPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsMandatoryPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
3368
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsMandatory", type: IsMandatoryPipe, pure: true, standalone: false });
3369
+ }
3370
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsMandatoryPipe, [{
3371
+ type: Pipe,
3372
+ args: [{
3373
+ name: 'ccdIsMandatory',
3374
+ standalone: false
3375
+ }]
3376
+ }], () => [{ type: CaseFieldService }], null); })();
3591
3377
 
3592
- var CaseFlagFieldState;
3593
- (function (CaseFlagFieldState) {
3594
- CaseFlagFieldState[CaseFlagFieldState["FLAG_LOCATION"] = 0] = "FLAG_LOCATION";
3595
- CaseFlagFieldState[CaseFlagFieldState["FLAG_TYPE"] = 1] = "FLAG_TYPE";
3596
- CaseFlagFieldState[CaseFlagFieldState["FLAG_LANGUAGE_INTERPRETER"] = 2] = "FLAG_LANGUAGE_INTERPRETER";
3597
- CaseFlagFieldState[CaseFlagFieldState["FLAG_COMMENTS"] = 3] = "FLAG_COMMENTS";
3598
- CaseFlagFieldState[CaseFlagFieldState["FLAG_STATUS"] = 4] = "FLAG_STATUS";
3599
- CaseFlagFieldState[CaseFlagFieldState["FLAG_MANAGE_CASE_FLAGS"] = 5] = "FLAG_MANAGE_CASE_FLAGS";
3600
- CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE"] = 6] = "FLAG_UPDATE";
3601
- CaseFlagFieldState[CaseFlagFieldState["FLAG_UPDATE_WELSH_TRANSLATION"] = 7] = "FLAG_UPDATE_WELSH_TRANSLATION";
3602
- })(CaseFlagFieldState || (CaseFlagFieldState = {}));
3603
- var CaseFlagErrorMessage;
3604
- (function (CaseFlagErrorMessage) {
3605
- CaseFlagErrorMessage["NO_EXTERNAL_FLAGS_COLLECTION"] = "External collection for storing this case flag has not been configured for this case type";
3606
- CaseFlagErrorMessage["NO_INTERNAL_FLAGS_COLLECTION"] = "Internal collection for storing this case flag has not been configured for this case type";
3607
- })(CaseFlagErrorMessage || (CaseFlagErrorMessage = {}));
3378
+ class IsReadOnlyPipe {
3379
+ caseFieldService;
3380
+ constructor(caseFieldService) {
3381
+ this.caseFieldService = caseFieldService;
3382
+ }
3383
+ transform(field) {
3384
+ return this.caseFieldService.isReadOnly(field);
3385
+ }
3386
+ static ɵfac = function IsReadOnlyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
3387
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnly", type: IsReadOnlyPipe, pure: true, standalone: false });
3388
+ }
3389
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyPipe, [{
3390
+ type: Pipe,
3391
+ args: [{
3392
+ name: 'ccdIsReadOnly',
3393
+ standalone: false
3394
+ }]
3395
+ }], () => [{ type: CaseFieldService }], null); })();
3608
3396
 
3609
- class DashPipe {
3610
- transform(value) {
3611
- return value ? value : '-';
3397
+ class IsReadOnlyAndNotCollectionPipe {
3398
+ caseFieldService;
3399
+ constructor(caseFieldService) {
3400
+ this.caseFieldService = caseFieldService;
3612
3401
  }
3613
- static ɵfac = function DashPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DashPipe)(); };
3614
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDash", type: DashPipe, pure: true, standalone: false });
3402
+ transform(field) {
3403
+ if (!field || !field.field_type || !field.field_type.type) {
3404
+ return false;
3405
+ }
3406
+ if (this.isCollection(field)) {
3407
+ return false;
3408
+ }
3409
+ return this.caseFieldService.isReadOnly(field);
3410
+ }
3411
+ // CaseField @Expose() doesn't work with the pipe in here, so leaving the manual check
3412
+ isCollection(field) {
3413
+ return field.field_type && field.field_type.type === 'Collection';
3414
+ }
3415
+ static ɵfac = function IsReadOnlyAndNotCollectionPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyAndNotCollectionPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
3416
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnlyAndNotCollection", type: IsReadOnlyAndNotCollectionPipe, pure: true, standalone: false });
3615
3417
  }
3616
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DashPipe, [{
3418
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyAndNotCollectionPipe, [{
3617
3419
  type: Pipe,
3618
3420
  args: [{
3619
- name: 'ccdDash',
3421
+ name: 'ccdIsReadOnlyAndNotCollection',
3620
3422
  standalone: false
3621
3423
  }]
3622
- }], null, null); })();
3424
+ }], () => [{ type: CaseFieldService }], null); })();
3623
3425
 
3624
- /*
3625
- Translate a date time format string from the Java format provided by CCD to the format supported by Angular formatDate()
3626
- Very simple translator that maps unsupported chars to the nearest equivalent.
3627
- If there is no equivalent puts ***x*** into the output where x is the unsupported character
3426
+ class PaletteUtilsModule {
3427
+ static ɵfac = function PaletteUtilsModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PaletteUtilsModule)(); };
3428
+ static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: PaletteUtilsModule });
3429
+ static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
3430
+ IsCompoundPipe,
3431
+ RpxTranslatePipe
3432
+ ], imports: [CommonModule,
3433
+ RpxTranslationModule.forChild()] });
3434
+ }
3435
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaletteUtilsModule, [{
3436
+ type: NgModule,
3437
+ args: [{
3438
+ imports: [
3439
+ CommonModule,
3440
+ RpxTranslationModule.forChild()
3441
+ ],
3442
+ declarations: [
3443
+ DatePipe,
3444
+ FieldLabelPipe,
3445
+ FirstErrorPipe,
3446
+ IsCompoundPipe,
3447
+ IsMandatoryPipe,
3448
+ IsReadOnlyPipe,
3449
+ IsReadOnlyAndNotCollectionPipe,
3450
+ DashPipe
3451
+ ],
3452
+ exports: [
3453
+ DatePipe,
3454
+ FieldLabelPipe,
3455
+ FirstErrorPipe,
3456
+ IsCompoundPipe,
3457
+ IsMandatoryPipe,
3458
+ IsReadOnlyPipe,
3459
+ IsReadOnlyAndNotCollectionPipe,
3460
+ DashPipe
3461
+ ],
3462
+ providers: [
3463
+ IsCompoundPipe,
3464
+ RpxTranslatePipe
3465
+ ]
3466
+ }]
3467
+ }], null, null); })();
3468
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PaletteUtilsModule, { declarations: [DatePipe,
3469
+ FieldLabelPipe,
3470
+ FirstErrorPipe,
3471
+ IsCompoundPipe,
3472
+ IsMandatoryPipe,
3473
+ IsReadOnlyPipe,
3474
+ IsReadOnlyAndNotCollectionPipe,
3475
+ DashPipe], imports: [CommonModule, i1.RpxTranslationModule], exports: [DatePipe,
3476
+ FieldLabelPipe,
3477
+ FirstErrorPipe,
3478
+ IsCompoundPipe,
3479
+ IsMandatoryPipe,
3480
+ IsReadOnlyPipe,
3481
+ IsReadOnlyAndNotCollectionPipe,
3482
+ DashPipe] }); })();
3628
3483
 
3629
- Java format
3630
- G era text AD; Anno Domini; A
3631
- u year year 2004; 04
3632
- y year-of-era year 2004; 04
3633
- D day-of-year number 189
3634
- M/L month-of-year number/text 7; 07; Jul; July; J
3635
- d day-of-month number 10
3484
+ // tslint:disable:variable-name
3485
+ class AddressModel {
3486
+ AddressLine1 = '';
3487
+ AddressLine2 = '';
3488
+ AddressLine3 = '';
3489
+ PostTown = '';
3490
+ County = '';
3491
+ PostCode = '';
3492
+ Country = '';
3493
+ }
3636
3494
 
3637
- Q/q quarter-of-year number/text 3; 03; Q3; 3rd quarter
3638
- Y week-based-year year 1996; 96
3639
- w week-of-week-based-year number 27
3640
- W week-of-month number 4
3641
- E day-of-week text Tue; Tuesday; T
3642
- e/c localized day-of-week number/text 2; 02; Tue; Tuesday; T
3643
- F week-of-month number 3
3495
+ class Alert {
3496
+ level;
3497
+ message;
3498
+ }
3644
3499
 
3645
- a am-pm-of-day text PM
3646
- h clock-hour-of-am-pm (1-12) number 12
3647
- K hour-of-am-pm (0-11) number 0
3648
- k clock-hour-of-am-pm (1-24) number 0
3500
+ // tslint:disable:variable-name
3501
+ class CaseDetails {
3502
+ id;
3503
+ jurisdiction;
3504
+ case_type_id;
3505
+ state;
3506
+ created_date;
3507
+ last_modified;
3508
+ locked_by_user_id;
3509
+ security_level;
3510
+ case_data;
3511
+ }
3649
3512
 
3650
- H hour-of-day (0-23) number 0
3651
- m minute-of-hour number 30
3652
- s second-of-minute number 55
3653
- S fraction-of-second fraction 978
3654
- A milli-of-day number 1234
3655
- n nano-of-second number 987654321
3656
- N nano-of-day number 1234000000
3513
+ // tslint:disable:variable-name
3514
+ class CaseEventData {
3515
+ event;
3516
+ data;
3517
+ event_data; // full event data
3518
+ event_token;
3519
+ ignore_warning;
3520
+ draft_id;
3521
+ case_reference;
3522
+ }
3657
3523
 
3658
- V time-zone ID zone-id America/Los_Angeles; Z; -08:30
3659
- z time-zone name zone-name Pacific Standard Time; PST
3660
- O localized zone-offset offset-O GMT+8; GMT+08:00; UTC-08:00;
3661
- X zone-offset 'Z' for zero offset-X Z; -08; -0830; -08:30; -083015; -08:30:15;
3662
- x zone-offset offset-x +0000; -08; -0830; -08:30; -083015; -08:30:15;
3663
- Z zone-offset offset-Z +0000; -0800; -08:00;
3524
+ class WizardPageField {
3525
+ case_field_id;
3526
+ order;
3527
+ page_column_no;
3528
+ complex_field_overrides;
3529
+ }
3664
3530
 
3665
- p pad next pad modifier 1
3531
+ class FixedListItem {
3532
+ code;
3533
+ label;
3534
+ order;
3535
+ }
3666
3536
 
3667
- ' escape for text delimiter
3668
- '' single quote literal '
3669
- [ optional section start
3670
- ] optional section end
3671
- # reserved for future use
3672
- { reserved for future use
3673
- } reserved for future use
3537
+ // @dynamic
3538
+ class FieldType {
3539
+ id;
3540
+ type;
3541
+ min;
3542
+ max;
3543
+ regular_expression;
3544
+ fixed_list_items;
3545
+ complex_fields;
3546
+ collection_field_type;
3547
+ }
3548
+ __decorate([
3549
+ Type(() => FixedListItem),
3550
+ __metadata("design:type", Array)
3551
+ ], FieldType.prototype, "fixed_list_items", void 0);
3552
+ __decorate([
3553
+ Type(() => CaseField),
3554
+ __metadata("design:type", Array)
3555
+ ], FieldType.prototype, "complex_fields", void 0);
3556
+ __decorate([
3557
+ Type(() => FieldType),
3558
+ __metadata("design:type", FieldType)
3559
+ ], FieldType.prototype, "collection_field_type", void 0);
3674
3560
 
3675
- Angular dateFormat characters
3676
- Era G, GG & GGG Abbreviated AD
3677
- GGGG Wide Anno Domini
3678
- GGGGG Narrow A
3679
- Year y Numeric: minimum digits 2, 20, 201, 2017, 20173
3680
- yy Numeric: 2 digits + zero padded 02, 20, 01, 17, 73
3681
- yyy Numeric: 3 digits + zero padded 002, 020, 201, 2017, 20173
3682
- yyyy Numeric: 4 digits or more + zero padded 0002, 0020, 0201, 2017, 20173
3683
- Month M Numeric: 1 digit 9, 12
3684
- MM Numeric: 2 digits + zero padded 09, 12
3685
- MMM Abbreviated Sep
3686
- MMMM Wide September
3687
- MMMMM Narrow S
3688
- Month standalone L Numeric: 1 digit 9, 12
3689
- LL Numeric: 2 digits + zero padded 09, 12
3690
- LLL Abbreviated Sep
3691
- LLLL Wide September
3692
- LLLLL Narrow S
3693
- Week of year w Numeric: minimum digits 1... 53
3694
- ww Numeric: 2 digits + zero padded 01... 53
3695
- Week of month W Numeric: 1 digit 1... 5
3696
- Day of month d Numeric: minimum digits 1
3697
- dd Numeric: 2 digits + zero padded 01
3698
- Week day E, EE & EEE Abbreviated Tue
3699
- EEEE Wide Tuesday
3700
- EEEEE Narrow T
3701
- EEEEEE Short Tu
3702
- Period a, aa & aaa Abbreviated am/pm or AM/PM
3703
- aaaa Wide (fallback to a when missing) ante meridiem/post meridiem
3704
- aaaaa Narrow a/p
3705
- Period* B, BB & BBB Abbreviated mid.
3706
- BBBB Wide am, pm, midnight, noon, morning, afternoon, evening, night
3707
- BBBBB Narrow md
3708
- Period standalone* b, bb & bbb Abbreviated mid.
3709
- bbbb Wide am, pm, midnight, noon, morning, afternoon, evening, night
3710
- bbbbb Narrow md
3711
- Hour 1-12 h Numeric: minimum digits 1, 12
3712
- hh Numeric: 2 digits + zero padded 01, 12
3713
- Hour 0-23 H Numeric: minimum digits 0, 23
3714
- HH Numeric: 2 digits + zero padded 00, 23
3715
- Minute m Numeric: minimum digits 8, 59
3716
- mm Numeric: 2 digits + zero padded 08, 59
3717
- Second s Numeric: minimum digits 0... 59
3718
- ss Numeric: 2 digits + zero padded 00... 59
3719
- Fractional seconds S Numeric: 1 digit 0... 9
3720
- SS Numeric: 2 digits + zero padded 00... 99
3721
- SSS Numeric: 3 digits + zero padded (= milliseconds) 000... 999
3722
- Zone z, zz & zzz Short specific non location format (fallback to O) GMT-8
3723
- zzzz Long specific non location format (fallback to OOOO) GMT-08:00
3724
- Z, ZZ & ZZZ ISO8601 basic format -0800
3725
- ZZZZ Long localized GMT format GMT-8:00
3726
- ZZZZZ ISO8601 extended format + Z indicator for offset 0 (= XXXXX) -08:00
3727
- O, OO & OOO Short localized GMT format GMT-8
3728
- OOOO Long localized GMT format GMT-08:00
3729
- */
3730
- class FormatTranslatorService {
3731
- translate(javaFormat) {
3732
- const result = [];
3733
- let prev = '\0';
3734
- let inQuote = false;
3735
- const maybePush = (target, obj, flag) => {
3736
- if (!flag) {
3737
- target.push(obj);
3561
+ // @dynamic
3562
+ class CaseField {
3563
+ static logger = new StructuredLoggerService();
3564
+ id;
3565
+ hidden;
3566
+ hiddenCannotChange;
3567
+ label;
3568
+ originalLabel;
3569
+ noCacheLabel;
3570
+ order;
3571
+ parent;
3572
+ field_type;
3573
+ hint_text;
3574
+ security_label;
3575
+ display_context;
3576
+ display_context_parameter;
3577
+ month_format;
3578
+ show_condition;
3579
+ show_summary_change_option;
3580
+ show_summary_content_option;
3581
+ acls;
3582
+ metadata;
3583
+ formatted_value;
3584
+ retain_hidden_value;
3585
+ wizardProps;
3586
+ _value;
3587
+ _list_items = [];
3588
+ isTranslatedFlag = false;
3589
+ get value() {
3590
+ if (this.field_type && (this.field_type.type === 'DynamicList' || this.field_type.type === 'DynamicRadioList')) {
3591
+ return this._value && this._value.value ? this._value.value.code : this._value;
3592
+ }
3593
+ else if (this.field_type && this.field_type.type === 'DynamicMultiSelectList') {
3594
+ return this._value && this._value.value ? this._value.value : this._value;
3595
+ }
3596
+ else {
3597
+ return this._value;
3598
+ }
3599
+ }
3600
+ set value(value) {
3601
+ if (this.isDynamic()) {
3602
+ if (value && value instanceof Object && value.list_items) {
3603
+ this._list_items = value.list_items;
3738
3604
  }
3739
- };
3740
- for (const c of javaFormat) {
3741
- switch (c) {
3742
- case '\'':
3743
- if (prev === '\'') {
3744
- // literal single quote - ignore
3745
- inQuote = false;
3746
- }
3747
- else {
3748
- inQuote = !inQuote;
3749
- }
3750
- break;
3751
- // Due to formatting constraints on the webapp, all 'd' characters should be replaced with 'D' (for Moment library)
3752
- // This is because we want the date, not the day (this format will need to be converted back)
3753
- case 'd':
3754
- maybePush(result, 'D', inQuote);
3755
- break;
3756
- // moment library defines year as capital y
3757
- case 'y':
3758
- maybePush(result, 'Y', inQuote);
3759
- break;
3760
- case 'e':
3761
- case 'c':
3762
- maybePush(result, 'E', inQuote); // no lower case E
3763
- break;
3764
- case 'F':
3765
- maybePush(result, 'W', inQuote);
3766
- break;
3767
- case 'K':
3768
- maybePush(result, 'H', inQuote);
3769
- break;
3770
- case 'k':
3771
- maybePush(result, 'h', inQuote);
3772
- break;
3773
- // commented out A change to '***' due to use in moment library for AM/PM
3774
- // added 'a' specification to stop discrepancy in am/AM pm/PM formatting
3775
- case 'a':
3776
- maybePush(result, 'A', inQuote);
3777
- break;
3778
- case 'n':
3779
- case 'N':
3780
- maybePush(result, `***${c}***`, inQuote); // No way to support A - millisec of day, n - nano of second, N - nano of Day
3781
- break;
3782
- case 'V':
3783
- case 'O':
3784
- maybePush(result, 'z', inQuote);
3785
- break;
3786
- case 'x':
3787
- case 'X':
3788
- maybePush(result, 'Z', inQuote);
3789
- break;
3790
- default:
3791
- maybePush(result, c, inQuote);
3605
+ else if (!this._list_items || this._list_items.length === 0) {
3606
+ // Extract the list items from the current value if that's the only place they exist.
3607
+ this._list_items = this.list_items;
3608
+ if (!value || !value.value) {
3609
+ value = null;
3610
+ }
3792
3611
  }
3793
- prev = c;
3794
3612
  }
3795
- return result.join('');
3613
+ this._value = value;
3796
3614
  }
3797
- showOnlyDates(dateFormat) {
3798
- // replace 'd' character with 'D' for the moment library
3799
- // This ensures only dates allowed
3800
- while (dateFormat.includes('d')) {
3801
- dateFormat = dateFormat.replace('d', 'D');
3615
+ get list_items() {
3616
+ if (this.isDynamic()) {
3617
+ return this._value && this._value.list_items ? this._value.list_items : this._list_items;
3802
3618
  }
3803
- while (dateFormat.includes('y')) {
3804
- dateFormat = dateFormat.replace('y', 'Y');
3619
+ else {
3620
+ return this.field_type.fixed_list_items;
3805
3621
  }
3806
- return dateFormat;
3807
3622
  }
3808
- removeTime(dateFormat) {
3809
- // remove hours irrelevant of whether 12 or 24 hour clock
3810
- while (dateFormat.includes('H') || dateFormat.includes('h')) {
3811
- dateFormat = dateFormat.replace('H', '');
3812
- dateFormat = dateFormat.replace('h', '');
3623
+ set list_items(items) {
3624
+ if ((items && !this._list_items) || (items?.length > this._list_items?.length)) {
3625
+ this._list_items = items;
3813
3626
  }
3814
- // remove minutes
3815
- while (dateFormat.includes('m')) {
3816
- dateFormat = dateFormat.replace('m', '');
3627
+ }
3628
+ get dateTimeEntryFormat() {
3629
+ if (this.isComplexDisplay()) {
3630
+ return null;
3817
3631
  }
3818
- // remove seconds (s) and micro seconds (S)
3819
- while (dateFormat.includes('S') || dateFormat.includes('s')) {
3820
- dateFormat = dateFormat.replace('S', '');
3821
- dateFormat = dateFormat.replace('s', '');
3632
+ if (this.display_context_parameter) {
3633
+ return this.extractBracketValue(this.display_context_parameter, '#DATETIMEENTRY');
3822
3634
  }
3823
- // because there is time removal algorithm can make reasonable assumption to remove colons
3824
- while (dateFormat.includes(':')) {
3825
- dateFormat = dateFormat.replace(':', '');
3635
+ return null;
3636
+ }
3637
+ get dateTimeDisplayFormat() {
3638
+ if (this.isComplexEntry()) {
3639
+ return null;
3826
3640
  }
3827
- return dateFormat.trim();
3641
+ if (this.display_context_parameter) {
3642
+ return this.extractBracketValue(this.display_context_parameter, '#DATETIMEDISPLAY');
3643
+ }
3644
+ return null;
3828
3645
  }
3829
- hasDate(value) {
3830
- return this.translate(value).length &&
3831
- value.toLowerCase().indexOf('d') >= 0 &&
3832
- value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3646
+ isComplexDisplay() {
3647
+ return (this.isComplex() || this.isCollection()) && this.isReadonly();
3833
3648
  }
3834
- is24Hour(value) {
3835
- return this.translate(value).length &&
3836
- value.indexOf('H') >= 0;
3649
+ isComplexEntry() {
3650
+ return (this.isComplex() || this.isCollection()) && (this.isOptional() || this.isMandatory());
3837
3651
  }
3838
- hasNoDay(value) {
3839
- return this.translate(value).length && value.toLowerCase().indexOf('d') === -1 &&
3840
- value.indexOf('M') >= 0 && value.toLowerCase().indexOf('y') >= 0;
3652
+ isReadonly() {
3653
+ return !_.isEmpty(this.display_context)
3654
+ && this.display_context.toUpperCase() === 'READONLY';
3841
3655
  }
3842
- hasNoDayAndMonth(value) {
3843
- return this.translate(value).length &&
3844
- value.toLowerCase().indexOf('d') === -1 &&
3845
- value.indexOf('M') === -1 &&
3846
- value.toLowerCase().indexOf('y') >= 0;
3656
+ isOptional() {
3657
+ return !_.isEmpty(this.display_context)
3658
+ && this.display_context.toUpperCase() === 'OPTIONAL';
3847
3659
  }
3848
- hasHours(value) {
3849
- return this.translate(value).length && value.toLowerCase().indexOf('h') >= 0 && value.indexOf('m') === -1;
3660
+ isMandatory() {
3661
+ return !_.isEmpty(this.display_context)
3662
+ && this.display_context.toUpperCase() === 'MANDATORY';
3850
3663
  }
3851
- hasMinutes(value) {
3852
- return this.translate(value).length && value.indexOf('m') >= 0 && value.toLowerCase().indexOf('h') >= 0;
3664
+ isCollection() {
3665
+ return this.field_type && this.field_type.type === 'Collection';
3853
3666
  }
3854
- hasSeconds(value) {
3855
- return this.translate(value).length && value.toLowerCase().indexOf('s') >= 0;
3667
+ isComplex() {
3668
+ return this.field_type && this.field_type.type === 'Complex';
3856
3669
  }
3857
- static ɵfac = function FormatTranslatorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FormatTranslatorService)(); };
3858
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: FormatTranslatorService, factory: FormatTranslatorService.ɵfac });
3859
- }
3860
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FormatTranslatorService, [{
3861
- type: Injectable
3862
- }], null, null); })();
3863
-
3864
- class DatePipe {
3865
- formatTrans;
3866
- static DATE_FORMAT_REGEXP = new RegExp('^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?|Z)?$');
3867
- // 1 2 3 4 5 6 7 8 9 10 11
3868
- static MONTHS = [
3869
- ['Jan'], ['Feb'], ['Mar'], ['Apr'], ['May'], ['Jun'], ['Jul'], ['Aug'], ['Sep'], ['Oct'], ['Nov'], ['Dec'],
3870
- ];
3871
- /**
3872
- * constructor to allow format translator to be injected
3873
- * @param formatTrans format translator
3874
- */
3875
- constructor(formatTrans) {
3876
- this.formatTrans = formatTrans;
3670
+ isDynamic() {
3671
+ const dynamicFieldTypes = ['DynamicList', 'DynamicRadioList', 'DynamicMultiSelectList'];
3672
+ if (!this.field_type) {
3673
+ return false;
3674
+ }
3675
+ return dynamicFieldTypes.some(t => t === this.field_type.type);
3877
3676
  }
3878
- transform(value, zone, format) {
3879
- let resultDate = null;
3880
- const ISO_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
3881
- if (value) {
3882
- // included to avoid editing the hour twice on second pass through
3883
- // this occurs on case details when datepipe is applied twice
3884
- if (!value.includes('T')) {
3885
- zone = 'utc';
3677
+ isCaseLink() {
3678
+ return this.isComplex()
3679
+ && this.field_type.id === 'CaseLink'
3680
+ && this.field_type.complex_fields.some(cf => cf.id === 'CaseReference');
3681
+ }
3682
+ extractBracketValue(fmt, paramName, leftBracket = '(', rightBracket = ')') {
3683
+ fmt = fmt.split(',')
3684
+ .find(a => a.trim().startsWith(paramName));
3685
+ if (fmt) {
3686
+ const s = fmt.indexOf(leftBracket) + 1;
3687
+ const e = fmt.indexOf(rightBracket, s);
3688
+ if (e > s && s >= 0) {
3689
+ return fmt.substr(s, (e - s));
3886
3690
  }
3887
- const match = value.match(DatePipe.DATE_FORMAT_REGEXP);
3888
- // Make sure we actually have a match.
3889
- if (match) {
3890
- let offsetDate = null;
3891
- const date = this.getDate(match);
3892
- if (zone === 'local') {
3893
- offsetDate = this.getOffsetDate(date);
3894
- }
3895
- else {
3896
- offsetDate = this.getDate(match);
3897
- }
3898
- // 'short' format is meaningful to formatDate, but not the same meaning as in the unit tests
3899
- if (this.formatTrans && format && format !== 'short') {
3900
- // support for java style formatting strings for dates
3901
- format = this.translateDateFormat(format);
3902
- resultDate = moment(offsetDate).format(format);
3903
- }
3904
- else {
3905
- // RDM-1149 changed the pipe logic so that it doesn't add an hour to 'Summer Time' dates on DateTime field type
3906
- resultDate = `${offsetDate.getDate()} ${DatePipe.MONTHS[offsetDate.getMonth()]} ${offsetDate.getFullYear()}`;
3907
- if (match[4] && match[5] && match[6] && format !== 'short') {
3908
- resultDate += ', ';
3909
- resultDate += `${this.getHour(offsetDate.getHours().toString())}:`;
3910
- resultDate += `${this.pad(offsetDate.getMinutes())}:`;
3911
- resultDate += `${this.pad(offsetDate.getSeconds())} `;
3912
- resultDate += (this.toInt(offsetDate.getHours().toString()) >= 12) ? 'PM' : 'AM';
3913
- }
3914
- }
3691
+ }
3692
+ return null;
3693
+ }
3694
+ // Ascend the hierarchy to get the full path of the field
3695
+ getHierachicalId(curr) {
3696
+ const prefix = curr ? curr + "_" : "";
3697
+ if (prefix.length < 1024) {
3698
+ if (this.parent) {
3699
+ return this.parent.getHierachicalId(prefix + this.id);
3915
3700
  }
3916
3701
  else {
3917
- // EUI-2667. See if what we've been given is actually a formatted date that
3918
- // we could attempt to do something with.
3919
- const parsedDate = Date.parse(value);
3920
- // We successfully parsed it so let's use it.
3921
- if (!isNaN(parsedDate)) {
3922
- const d = new Date(parsedDate);
3923
- // If what we received didn't include time, don't include it here either.
3924
- if (value.indexOf(':') < 0) {
3925
- const shortDate = d.toLocaleDateString('en-GB');
3926
- const shortISO = shortDate.split('/').reverse().join('-');
3927
- return this.transform(shortISO, zone, format);
3928
- }
3929
- // If it did include time, we want a full ISO string.
3930
- const thisMoment = moment(d).format(ISO_FORMAT);
3931
- return this.transform(thisMoment, zone, format);
3932
- }
3702
+ return prefix + this.id;
3933
3703
  }
3934
3704
  }
3935
- return resultDate;
3936
- }
3937
- translateDateFormat(format) {
3938
- if (this.formatTrans) {
3939
- return this.formatTrans.translate(format);
3940
- }
3941
3705
  else {
3942
- return format;
3706
+ CaseField.logger.error('Path too long, possible circular reference in case field hierarchy.');
3707
+ return this.id;
3943
3708
  }
3944
3709
  }
3945
- getOffsetDate(date) {
3946
- const localOffset = -date.getTimezoneOffset() / 60;
3947
- return new Date(date.getTime() + localOffset * 3600 * 1000);
3710
+ set isTranslated(val) {
3711
+ this.isTranslatedFlag = val;
3948
3712
  }
3949
- getDate(match) {
3950
- const year = this.toInt(match[1]);
3951
- const month = this.toInt(match[2]) - 1;
3952
- const day = this.toInt(match[3]);
3953
- let resultDate;
3954
- if (match[4] && match[5] && match[6]) {
3955
- const hour = this.toInt(match[4]);
3956
- const minutes = this.toInt(match[5]);
3957
- const seconds = this.toInt(match[6]);
3958
- resultDate = new Date(year, month, day, hour, minutes, seconds, 0);
3959
- }
3960
- else {
3961
- resultDate = new Date(year, month, day);
3962
- }
3963
- return resultDate;
3713
+ get isTranslated() {
3714
+ return this.isTranslatedFlag;
3964
3715
  }
3965
- getHour(hourStr) {
3966
- let hourNum = this.toInt(hourStr);
3967
- if (hourNum > 12) {
3968
- hourNum = hourNum - 12;
3969
- }
3970
- else if (hourNum === 0) {
3971
- hourNum = 12;
3972
- }
3973
- return hourNum;
3716
+ }
3717
+ __decorate([
3718
+ Exclude(),
3719
+ __metadata("design:type", CaseField)
3720
+ ], CaseField.prototype, "parent", void 0);
3721
+ __decorate([
3722
+ Type(() => FieldType),
3723
+ __metadata("design:type", FieldType)
3724
+ ], CaseField.prototype, "field_type", void 0);
3725
+ __decorate([
3726
+ Type(() => WizardPageField),
3727
+ __metadata("design:type", WizardPageField)
3728
+ ], CaseField.prototype, "wizardProps", void 0);
3729
+ __decorate([
3730
+ Expose(),
3731
+ __metadata("design:type", Object),
3732
+ __metadata("design:paramtypes", [Object])
3733
+ ], CaseField.prototype, "value", null);
3734
+ __decorate([
3735
+ Expose(),
3736
+ __metadata("design:type", Object),
3737
+ __metadata("design:paramtypes", [Object])
3738
+ ], CaseField.prototype, "list_items", null);
3739
+ __decorate([
3740
+ Expose(),
3741
+ __metadata("design:type", String),
3742
+ __metadata("design:paramtypes", [])
3743
+ ], CaseField.prototype, "dateTimeEntryFormat", null);
3744
+ __decorate([
3745
+ Expose(),
3746
+ __metadata("design:type", String),
3747
+ __metadata("design:paramtypes", [])
3748
+ ], CaseField.prototype, "dateTimeDisplayFormat", null);
3749
+ __decorate([
3750
+ Expose(),
3751
+ __metadata("design:type", Function),
3752
+ __metadata("design:paramtypes", []),
3753
+ __metadata("design:returntype", void 0)
3754
+ ], CaseField.prototype, "isComplexDisplay", null);
3755
+ __decorate([
3756
+ Expose(),
3757
+ __metadata("design:type", Function),
3758
+ __metadata("design:paramtypes", []),
3759
+ __metadata("design:returntype", void 0)
3760
+ ], CaseField.prototype, "isComplexEntry", null);
3761
+ __decorate([
3762
+ Expose(),
3763
+ __metadata("design:type", Function),
3764
+ __metadata("design:paramtypes", []),
3765
+ __metadata("design:returntype", void 0)
3766
+ ], CaseField.prototype, "isReadonly", null);
3767
+ __decorate([
3768
+ Expose(),
3769
+ __metadata("design:type", Function),
3770
+ __metadata("design:paramtypes", []),
3771
+ __metadata("design:returntype", void 0)
3772
+ ], CaseField.prototype, "isOptional", null);
3773
+ __decorate([
3774
+ Expose(),
3775
+ __metadata("design:type", Function),
3776
+ __metadata("design:paramtypes", []),
3777
+ __metadata("design:returntype", void 0)
3778
+ ], CaseField.prototype, "isMandatory", null);
3779
+ __decorate([
3780
+ Expose(),
3781
+ __metadata("design:type", Function),
3782
+ __metadata("design:paramtypes", []),
3783
+ __metadata("design:returntype", Boolean)
3784
+ ], CaseField.prototype, "isCollection", null);
3785
+ __decorate([
3786
+ Expose(),
3787
+ __metadata("design:type", Function),
3788
+ __metadata("design:paramtypes", []),
3789
+ __metadata("design:returntype", Boolean)
3790
+ ], CaseField.prototype, "isComplex", null);
3791
+ __decorate([
3792
+ Expose(),
3793
+ __metadata("design:type", Function),
3794
+ __metadata("design:paramtypes", []),
3795
+ __metadata("design:returntype", Boolean)
3796
+ ], CaseField.prototype, "isDynamic", null);
3797
+ __decorate([
3798
+ Expose(),
3799
+ __metadata("design:type", Function),
3800
+ __metadata("design:paramtypes", []),
3801
+ __metadata("design:returntype", Boolean)
3802
+ ], CaseField.prototype, "isCaseLink", null);
3803
+ __decorate([
3804
+ Expose(),
3805
+ __metadata("design:type", Function),
3806
+ __metadata("design:paramtypes", [String]),
3807
+ __metadata("design:returntype", String)
3808
+ ], CaseField.prototype, "getHierachicalId", null);
3809
+
3810
+ // @dynamic
3811
+ class WizardPage {
3812
+ id;
3813
+ label;
3814
+ order;
3815
+ wizard_page_fields;
3816
+ case_fields;
3817
+ show_condition;
3818
+ parsedShowCondition;
3819
+ getCol1Fields() {
3820
+ return this.case_fields?.filter(f => !f.wizardProps.page_column_no || f.wizardProps.page_column_no === 1);
3974
3821
  }
3975
- toInt(str) {
3976
- return parseInt(str, 10);
3822
+ getCol2Fields() {
3823
+ return this.case_fields?.filter(f => f.wizardProps.page_column_no === 2);
3977
3824
  }
3978
- pad(num, padNum = 2) {
3979
- const val = num !== undefined ? num.toString() : '';
3980
- return val.length >= padNum ? val : new Array(padNum - val.length + 1).join('0') + val;
3825
+ isMultiColumn() {
3826
+ return this.getCol2Fields()?.length > 0;
3981
3827
  }
3982
- static ɵfac = function DatePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DatePipe)(i0.ɵɵdirectiveInject(FormatTranslatorService, 16)); };
3983
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdDate", type: DatePipe, pure: true, standalone: false });
3984
3828
  }
3985
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DatePipe, [{
3986
- type: Pipe,
3987
- args: [{
3988
- name: 'ccdDate',
3989
- standalone: false
3990
- }]
3991
- }], () => [{ type: FormatTranslatorService }], null); })();
3829
+ __decorate([
3830
+ Type(() => WizardPageField),
3831
+ __metadata("design:type", Array)
3832
+ ], WizardPage.prototype, "wizard_page_fields", void 0);
3833
+ __decorate([
3834
+ Type(() => CaseField),
3835
+ __metadata("design:type", Array)
3836
+ ], WizardPage.prototype, "case_fields", void 0);
3837
+
3838
+ // @dynamic
3839
+ class CaseEventTrigger {
3840
+ id;
3841
+ name;
3842
+ description;
3843
+ case_id;
3844
+ case_fields;
3845
+ event_token;
3846
+ wizard_pages;
3847
+ show_summary;
3848
+ show_event_notes;
3849
+ end_button_label;
3850
+ can_save_draft;
3851
+ hasFields() {
3852
+ return this.case_fields && this.case_fields.length !== 0;
3853
+ }
3854
+ hasPages() {
3855
+ return this.wizard_pages && this.wizard_pages.length !== 0;
3856
+ }
3857
+ }
3858
+ __decorate([
3859
+ Type(() => CaseField),
3860
+ __metadata("design:type", Array)
3861
+ ], CaseEventTrigger.prototype, "case_fields", void 0);
3862
+ __decorate([
3863
+ Type(() => WizardPage),
3864
+ __metadata("design:type", Array)
3865
+ ], CaseEventTrigger.prototype, "wizard_pages", void 0);
3866
+
3867
+ // tslint:disable:variable-name
3868
+ class CaseViewEvent {
3869
+ id;
3870
+ timestamp;
3871
+ summary;
3872
+ comment;
3873
+ event_id;
3874
+ event_name;
3875
+ state_id;
3876
+ state_name;
3877
+ user_id;
3878
+ user_last_name;
3879
+ user_first_name;
3880
+ significant_item;
3881
+ }
3882
+
3883
+ class CaseViewTrigger {
3884
+ id;
3885
+ name;
3886
+ description;
3887
+ order;
3888
+ }
3889
+
3890
+ class CaseEvent {
3891
+ id;
3892
+ name;
3893
+ post_state;
3894
+ pre_states;
3895
+ case_fields;
3896
+ description;
3897
+ order;
3898
+ acls;
3899
+ }
3900
+
3901
+ class CaseState {
3902
+ id;
3903
+ name;
3904
+ description;
3905
+ order;
3906
+ }
3907
+
3908
+ // Light clone of CaseType to be used in Jurisdiction class
3909
+ // to avoid cyclic dependency
3910
+ class CaseTypeLite {
3911
+ id;
3912
+ name;
3913
+ events;
3914
+ states;
3915
+ description;
3916
+ }
3917
+
3918
+ // @dynamics
3919
+ class CaseType {
3920
+ id;
3921
+ name;
3922
+ events;
3923
+ states;
3924
+ case_fields;
3925
+ description;
3926
+ jurisdiction;
3927
+ printEnabled;
3928
+ }
3929
+ __decorate([
3930
+ Type(() => CaseField),
3931
+ __metadata("design:type", Array)
3932
+ ], CaseType.prototype, "case_fields", void 0);
3992
3933
 
3993
- class FieldLabelPipe {
3994
- rpxTranslationPipe;
3995
- constructor(rpxTranslationPipe) {
3996
- this.rpxTranslationPipe = rpxTranslationPipe;
3997
- }
3998
- transform(field) {
3999
- if (!field || !field.label) {
4000
- return '';
4001
- }
4002
- else if (!field.display_context) {
4003
- return this.getTranslatedLabel(field);
4004
- }
4005
- return this.getTranslatedLabel(field) + (field.display_context.toUpperCase() === 'OPTIONAL' ?
4006
- ' (' + this.rpxTranslationPipe.transform('Optional') + ')' : '');
4007
- }
4008
- getTranslatedLabel(field) {
4009
- if (!field.isTranslated) {
4010
- return this.rpxTranslationPipe.transform(field.label);
4011
- }
4012
- else {
4013
- return field.label;
4014
- }
4015
- }
4016
- getOriginalLabelForYesNoTranslation(field) {
4017
- return field.originalLabel || field.label;
4018
- }
4019
- static ɵfac = function FieldLabelPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FieldLabelPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslatePipe, 16)); };
4020
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFieldLabel", type: FieldLabelPipe, pure: false, standalone: false });
3934
+ // tslint:disable:variable-name
3935
+ class EventCaseField {
3936
+ case_field_id;
3937
+ showCondition;
4021
3938
  }
4022
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FieldLabelPipe, [{
4023
- type: Pipe,
4024
- args: [{
4025
- name: 'ccdFieldLabel',
4026
- pure: false,
4027
- standalone: false
4028
- }]
4029
- }], () => [{ type: i1.RpxTranslatePipe }], null); })();
4030
3939
 
4031
- class FirstErrorPipe {
4032
- rpxTranslationService;
4033
- injector;
4034
- asyncPipe;
4035
- constructor(rpxTranslationService, injector) {
4036
- this.rpxTranslationService = rpxTranslationService;
4037
- this.injector = injector;
4038
- this.asyncPipe = new AsyncPipe(this.injector.get(ChangeDetectorRef));
4039
- }
4040
- transform(value, args) {
4041
- if (!value) {
4042
- return '';
4043
- }
4044
- if (!args) {
4045
- args = 'Field';
4046
- }
4047
- const keys = Object.keys(value);
4048
- if (!keys.length) {
4049
- return '';
4050
- }
4051
- let errorMessage;
4052
- if (keys[0] === 'required') {
4053
- errorMessage = '%FIELDLABEL% is required';
4054
- }
4055
- else if (keys[0] === 'pattern') {
4056
- errorMessage = 'The data entered is not valid for %FIELDLABEL%';
3940
+ class Jurisdiction {
3941
+ id;
3942
+ name;
3943
+ description;
3944
+ caseTypes;
3945
+ currentCaseType;
3946
+ }
3947
+
3948
+ class Banner {
3949
+ bannerDescription;
3950
+ bannerUrlText;
3951
+ bannerUrl;
3952
+ bannerViewed;
3953
+ bannerEnabled;
3954
+ }
3955
+
3956
+ // @dynamic
3957
+ class CaseTab {
3958
+ id;
3959
+ label;
3960
+ order;
3961
+ fields;
3962
+ show_condition;
3963
+ }
3964
+ __decorate([
3965
+ Type(() => CaseField),
3966
+ __metadata("design:type", Array)
3967
+ ], CaseTab.prototype, "fields", void 0);
3968
+
3969
+ // @dynamic
3970
+ class CaseView {
3971
+ case_id;
3972
+ case_type;
3973
+ state;
3974
+ channels;
3975
+ tabs;
3976
+ triggers;
3977
+ events;
3978
+ metadataFields;
3979
+ basicFields;
3980
+ case_flag;
3981
+ }
3982
+ __decorate([
3983
+ Type(() => CaseTab),
3984
+ __metadata("design:type", Array)
3985
+ ], CaseView.prototype, "tabs", void 0);
3986
+ __decorate([
3987
+ Type(() => CaseField),
3988
+ __metadata("design:type", Array)
3989
+ ], CaseView.prototype, "metadataFields", void 0);
3990
+
3991
+ class CasePrintDocument {
3992
+ name;
3993
+ type;
3994
+ url;
3995
+ }
3996
+
3997
+ // tslint:disable:variable-name
3998
+ class HRef {
3999
+ href;
4000
+ }
4001
+ class DocumentLinks {
4002
+ self;
4003
+ binary;
4004
+ }
4005
+ class Document {
4006
+ _links;
4007
+ originalDocumentName;
4008
+ hashToken;
4009
+ }
4010
+ class Embedded {
4011
+ documents;
4012
+ }
4013
+ class DocumentData {
4014
+ _embedded;
4015
+ documents;
4016
+ }
4017
+ class FormDocument {
4018
+ document_url;
4019
+ document_binary_url;
4020
+ document_filename;
4021
+ document_hash;
4022
+ upload_timestamp;
4023
+ }
4024
+
4025
+ class OrganisationConverter {
4026
+ static toSimpleAddress(organisationModel) {
4027
+ let simpleAddress = '';
4028
+ if (organisationModel.addressLine1) {
4029
+ simpleAddress += `${organisationModel.addressLine1}<br>`;
4057
4030
  }
4058
- else if (keys[0] === 'markDownPattern') {
4059
- errorMessage = 'The data entered is not valid for %FIELDLABEL%. Link mark up characters are not allowed in this field';
4031
+ if (organisationModel.addressLine2) {
4032
+ simpleAddress += `${organisationModel.addressLine2}<br>`;
4060
4033
  }
4061
- else if (keys[0] === 'unsafeRichText') {
4062
- errorMessage = 'The data entered is not valid for %FIELDLABEL%. Potentially unsafe HTML content is not allowed in this field';
4034
+ if (organisationModel.addressLine3) {
4035
+ simpleAddress += `${organisationModel.addressLine3}<br>`;
4063
4036
  }
4064
- else if (keys[0] === 'minlength') {
4065
- errorMessage = '%FIELDLABEL% is below the minimum length';
4037
+ if (organisationModel.townCity) {
4038
+ simpleAddress += `${organisationModel.townCity}<br>`;
4066
4039
  }
4067
- else if (keys[0] === 'maxlength') {
4068
- errorMessage = '%FIELDLABEL% exceeds the maximum length';
4040
+ if (organisationModel.county) {
4041
+ simpleAddress += `${organisationModel.county}<br>`;
4069
4042
  }
4070
- else if (value.hasOwnProperty('matDatetimePickerParse')) {
4071
- errorMessage = 'The date entered is not valid. Please provide a valid date';
4043
+ if (organisationModel.country) {
4044
+ simpleAddress += `${organisationModel.country}<br>`;
4072
4045
  }
4073
- else {
4074
- errorMessage = value[keys[0]];
4046
+ if (organisationModel.postCode) {
4047
+ simpleAddress += `${organisationModel.postCode}<br>`;
4075
4048
  }
4076
- const o = this.rpxTranslationService.getTranslation$(args).pipe(switchMap(fieldLabel => this.rpxTranslationService.getTranslationWithReplacements$(errorMessage, { FIELDLABEL: fieldLabel })));
4077
- return this.asyncPipe.transform(o);
4049
+ return simpleAddress;
4078
4050
  }
4079
- ngOnDestroy() {
4080
- this.asyncPipe.ngOnDestroy();
4051
+ toSimpleOrganisationModel(organisationModel) {
4052
+ return {
4053
+ organisationIdentifier: organisationModel.organisationIdentifier,
4054
+ name: organisationModel.name,
4055
+ address: OrganisationConverter.toSimpleAddress(organisationModel)
4056
+ };
4081
4057
  }
4082
- static ɵfac = function FirstErrorPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FirstErrorPipe)(i0.ɵɵdirectiveInject(i1.RpxTranslationService, 16), i0.ɵɵdirectiveInject(i0.Injector, 16)); };
4083
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdFirstError", type: FirstErrorPipe, pure: false, standalone: false });
4058
+ static ɵfac = function OrganisationConverter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OrganisationConverter)(); };
4059
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: OrganisationConverter, factory: OrganisationConverter.ɵfac });
4084
4060
  }
4085
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FirstErrorPipe, [{
4086
- type: Pipe,
4087
- args: [{
4088
- name: 'ccdFirstError',
4089
- pure: false,
4090
- standalone: false
4091
- }]
4092
- }], () => [{ type: i1.RpxTranslationService }, { type: i0.Injector }], null); })();
4061
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OrganisationConverter, [{
4062
+ type: Injectable
4063
+ }], null, null); })();
4093
4064
 
4094
- class IsCompoundPipe {
4095
- static COMPOUND_TYPES = [
4096
- 'Complex',
4097
- 'Label',
4098
- 'AddressGlobal',
4099
- 'AddressUK',
4100
- 'AddressGlobalUK',
4101
- 'CasePaymentHistoryViewer',
4102
- 'CaseHistoryViewer',
4103
- 'Organisation',
4104
- 'WaysToPay',
4105
- 'ComponentLauncher',
4106
- 'FlagLauncher',
4107
- 'CaseFlag'
4108
- ];
4109
- static EXCLUDE = [
4110
- 'CaseLink',
4111
- 'JudicialUser'
4112
- ];
4113
- transform(field) {
4114
- if (!field || !field.field_type || !field.field_type.type) {
4115
- return false;
4116
- }
4117
- if (IsCompoundPipe.COMPOUND_TYPES.indexOf(field.field_type.type) !== -1) {
4118
- if (IsCompoundPipe.EXCLUDE.indexOf(field.field_type.id) !== -1) {
4119
- return false;
4120
- }
4121
- return true;
4122
- }
4123
- return false;
4124
- }
4125
- static ɵfac = function IsCompoundPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsCompoundPipe)(); };
4126
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsCompound", type: IsCompoundPipe, pure: true, standalone: false });
4065
+ class PaginationMetadata {
4066
+ totalResultsCount;
4067
+ totalPagesCount;
4127
4068
  }
4128
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsCompoundPipe, [{
4129
- type: Pipe,
4130
- args: [{
4131
- name: 'ccdIsCompound',
4132
- standalone: false
4133
- }]
4134
- }], null, null); })();
4135
4069
 
4136
- class CaseFieldService {
4137
- isOptional(field) {
4138
- if (!field || !field.display_context) {
4139
- return false;
4140
- }
4141
- return field.display_context.toUpperCase() === 'OPTIONAL';
4142
- }
4143
- isReadOnly(field) {
4144
- if (!field || !field.display_context) {
4145
- return false;
4146
- }
4147
- return field.display_context.toUpperCase() === 'READONLY';
4070
+ function hasRoles(profile) {
4071
+ if (profile.user && profile.user.idam && Array.isArray(profile.user.idam.roles)) {
4072
+ return profile.user.idam.roles.length > 0;
4148
4073
  }
4149
- isMandatory(field) {
4150
- if (!field || !field.display_context) {
4151
- return false;
4074
+ return false;
4075
+ }
4076
+ // @dynamic
4077
+ class Profile {
4078
+ user;
4079
+ channels;
4080
+ jurisdictions;
4081
+ default;
4082
+ isSolicitor() {
4083
+ if (hasRoles(this)) {
4084
+ return this.user.idam.roles.find(r => r.endsWith('-solicitor')) !== undefined;
4152
4085
  }
4153
- return field.display_context.toUpperCase() === 'MANDATORY';
4086
+ return false;
4154
4087
  }
4155
- isLabel(field) {
4156
- if (!field || !field.field_type) {
4157
- return false;
4088
+ isCourtAdmin() {
4089
+ if (hasRoles(this)) {
4090
+ return this.user.idam.roles.find(r => r.endsWith('-courtadmin')) !== undefined;
4158
4091
  }
4159
- return field.field_type.type === 'Label';
4092
+ return false;
4160
4093
  }
4161
- static ɵfac = function CaseFieldService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseFieldService)(); };
4162
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseFieldService, factory: CaseFieldService.ɵfac });
4163
4094
  }
4164
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFieldService, [{
4165
- type: Injectable
4166
- }], null, null); })();
4095
+ __decorate([
4096
+ Type(() => Jurisdiction),
4097
+ __metadata("design:type", Array)
4098
+ ], Profile.prototype, "jurisdictions", void 0);
4167
4099
 
4168
- class IsMandatoryPipe {
4169
- caseFieldService;
4170
- constructor(caseFieldService) {
4171
- this.caseFieldService = caseFieldService;
4172
- }
4173
- transform(field) {
4174
- return this.caseFieldService.isMandatory(field);
4100
+ class Field {
4101
+ id;
4102
+ field_type;
4103
+ elementPath;
4104
+ value;
4105
+ label;
4106
+ metadata;
4107
+ constructor(id, field_type, elementPath, value, label, metadata) {
4108
+ this.id = id;
4109
+ this.field_type = field_type;
4110
+ this.elementPath = elementPath;
4111
+ this.value = value;
4112
+ this.label = label;
4113
+ this.metadata = metadata;
4175
4114
  }
4176
- static ɵfac = function IsMandatoryPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsMandatoryPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
4177
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsMandatory", type: IsMandatoryPipe, pure: true, standalone: false });
4178
4115
  }
4179
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsMandatoryPipe, [{
4180
- type: Pipe,
4181
- args: [{
4182
- name: 'ccdIsMandatory',
4183
- standalone: false
4184
- }]
4185
- }], () => [{ type: CaseFieldService }], null); })();
4186
4116
 
4187
- class IsReadOnlyPipe {
4188
- caseFieldService;
4189
- constructor(caseFieldService) {
4190
- this.caseFieldService = caseFieldService;
4191
- }
4192
- transform(field) {
4193
- return this.caseFieldService.isReadOnly(field);
4194
- }
4195
- static ɵfac = function IsReadOnlyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
4196
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnly", type: IsReadOnlyPipe, pure: true, standalone: false });
4117
+ class SearchResultViewColumn {
4118
+ case_field_id;
4119
+ case_field_type;
4120
+ display_context;
4121
+ display_context_parameter;
4122
+ label;
4123
+ order;
4197
4124
  }
4198
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyPipe, [{
4199
- type: Pipe,
4200
- args: [{
4201
- name: 'ccdIsReadOnly',
4202
- standalone: false
4203
- }]
4204
- }], () => [{ type: CaseFieldService }], null); })();
4205
4125
 
4206
- class IsReadOnlyAndNotCollectionPipe {
4207
- caseFieldService;
4208
- constructor(caseFieldService) {
4209
- this.caseFieldService = caseFieldService;
4210
- }
4211
- transform(field) {
4212
- if (!field || !field.field_type || !field.field_type.type) {
4213
- return false;
4214
- }
4215
- if (this.isCollection(field)) {
4216
- return false;
4217
- }
4218
- return this.caseFieldService.isReadOnly(field);
4126
+ // @dynamic
4127
+ class SearchResultViewItem {
4128
+ case_id;
4129
+ case_fields;
4130
+ hydrated_case_fields;
4131
+ columns;
4132
+ supplementary_data;
4133
+ display_context_parameter;
4134
+ }
4135
+ __decorate([
4136
+ Type(() => CaseField),
4137
+ __metadata("design:type", Array)
4138
+ ], SearchResultViewItem.prototype, "hydrated_case_fields", void 0);
4139
+
4140
+ // @dynamic
4141
+ class SearchResultView {
4142
+ columns;
4143
+ results;
4144
+ result_error;
4145
+ hasDrafts() {
4146
+ return this.results[0]
4147
+ && this.results[0].case_id
4148
+ && Draft.isDraft(this.results[0].case_id);
4219
4149
  }
4220
- // CaseField @Expose() doesn't work with the pipe in here, so leaving the manual check
4221
- isCollection(field) {
4222
- return field.field_type && field.field_type.type === 'Collection';
4150
+ }
4151
+ __decorate([
4152
+ Type(() => SearchResultViewColumn),
4153
+ __metadata("design:type", Array)
4154
+ ], SearchResultView.prototype, "columns", void 0);
4155
+ __decorate([
4156
+ Type(() => SearchResultViewItem),
4157
+ __metadata("design:type", Array)
4158
+ ], SearchResultView.prototype, "results", void 0);
4159
+
4160
+ class SortParameters {
4161
+ comparator;
4162
+ sortOrder;
4163
+ constructor(comparator, sortOrder) {
4164
+ this.comparator = comparator;
4165
+ this.sortOrder = sortOrder;
4223
4166
  }
4224
- static ɵfac = function IsReadOnlyAndNotCollectionPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || IsReadOnlyAndNotCollectionPipe)(i0.ɵɵdirectiveInject(CaseFieldService, 16)); };
4225
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "ccdIsReadOnlyAndNotCollection", type: IsReadOnlyAndNotCollectionPipe, pure: true, standalone: false });
4226
4167
  }
4227
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IsReadOnlyAndNotCollectionPipe, [{
4228
- type: Pipe,
4229
- args: [{
4230
- name: 'ccdIsReadOnlyAndNotCollection',
4231
- standalone: false
4232
- }]
4233
- }], () => [{ type: CaseFieldService }], null); })();
4234
4168
 
4235
- class PaletteUtilsModule {
4236
- static ɵfac = function PaletteUtilsModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PaletteUtilsModule)(); };
4237
- static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: PaletteUtilsModule });
4238
- static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
4239
- IsCompoundPipe,
4240
- RpxTranslatePipe
4241
- ], imports: [CommonModule,
4242
- RpxTranslationModule.forChild()] });
4169
+ var SortOrder$1;
4170
+ (function (SortOrder) {
4171
+ SortOrder[SortOrder["ASCENDING"] = 0] = "ASCENDING";
4172
+ SortOrder[SortOrder["DESCENDING"] = 1] = "DESCENDING";
4173
+ SortOrder[SortOrder["UNSORTED"] = 2] = "UNSORTED";
4174
+ })(SortOrder$1 || (SortOrder$1 = {}));
4175
+
4176
+ class WorkbasketInputModel {
4177
+ label;
4178
+ order;
4179
+ field;
4180
+ metadata;
4181
+ display_context_parameter;
4182
+ }
4183
+ class WorkbasketInput {
4184
+ workbasketInputs;
4243
4185
  }
4244
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaletteUtilsModule, [{
4245
- type: NgModule,
4246
- args: [{
4247
- imports: [
4248
- CommonModule,
4249
- RpxTranslationModule.forChild()
4250
- ],
4251
- declarations: [
4252
- DatePipe,
4253
- FieldLabelPipe,
4254
- FirstErrorPipe,
4255
- IsCompoundPipe,
4256
- IsMandatoryPipe,
4257
- IsReadOnlyPipe,
4258
- IsReadOnlyAndNotCollectionPipe,
4259
- DashPipe
4260
- ],
4261
- exports: [
4262
- DatePipe,
4263
- FieldLabelPipe,
4264
- FirstErrorPipe,
4265
- IsCompoundPipe,
4266
- IsMandatoryPipe,
4267
- IsReadOnlyPipe,
4268
- IsReadOnlyAndNotCollectionPipe,
4269
- DashPipe
4270
- ],
4271
- providers: [
4272
- IsCompoundPipe,
4273
- RpxTranslatePipe
4274
- ]
4275
- }]
4276
- }], null, null); })();
4277
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(PaletteUtilsModule, { declarations: [DatePipe,
4278
- FieldLabelPipe,
4279
- FirstErrorPipe,
4280
- IsCompoundPipe,
4281
- IsMandatoryPipe,
4282
- IsReadOnlyPipe,
4283
- IsReadOnlyAndNotCollectionPipe,
4284
- DashPipe], imports: [CommonModule, i1.RpxTranslationModule], exports: [DatePipe,
4285
- FieldLabelPipe,
4286
- FirstErrorPipe,
4287
- IsCompoundPipe,
4288
- IsMandatoryPipe,
4289
- IsReadOnlyPipe,
4290
- IsReadOnlyAndNotCollectionPipe,
4291
- DashPipe] }); })();
4292
4186
 
4293
4187
  // @dynamic
4294
4188
  class FieldsUtils {
@@ -9660,6 +9554,76 @@ class BrowserService {
9660
9554
  }], null, null); })();
9661
9555
 
9662
9556
  class CaseAccessUtils {
9557
+ // User role mapping
9558
+ static JUDGE_ROLE = 'judge';
9559
+ static JUDGE_ROLE_CATEGORY = 'JUDICIAL';
9560
+ static JUDGE_ROLE_NAME = 'judiciary';
9561
+ static ADMIN_ROLE = 'admin';
9562
+ static ADMIN_ROLE_CATEGORY = 'ADMIN';
9563
+ static ADMIN_ROLE_NAME = 'admin';
9564
+ static PROFESSIONAL_ROLE = 'solicitor';
9565
+ static PROFESSIONAL_ROLE_CATEGORY = 'PROFESSIONAL';
9566
+ static PROFESSIONAL_ROLE_NAME = 'professional';
9567
+ static LEGAL_OPERATIONS_ROLE = 'caseworker';
9568
+ static LEGAL_OPERATIONS_ROLE_CATEGORY = 'LEGAL_OPERATIONS';
9569
+ static LEGAL_OPERATIONS_ROLE_NAME = 'legal-ops';
9570
+ static CITIZEN_ROLE = 'citizen';
9571
+ static CITIZEN_ROLE_CATEGORY = 'CITIZEN';
9572
+ static CITIZEN_ROLE_NAME = 'citizen';
9573
+ static CTSC_ROLE = 'ctsc';
9574
+ static CTSC_ROLE_CATEGORY = 'CTSC';
9575
+ static CTSC_ROLE_NAME = 'ctsc';
9576
+ // fallback purely if roleCategories is not available in
9577
+ getMappedRoleCategories(roles = []) {
9578
+ const roleKeywords = roles.join().split('-').join().split(',');
9579
+ const roleCategoryList = [];
9580
+ if (this.roleHasKeyword(CaseAccessUtils.JUDGE_ROLE, roleKeywords)) {
9581
+ roleCategoryList.push(CaseAccessUtils.JUDGE_ROLE_CATEGORY);
9582
+ }
9583
+ if (this.roleHasKeyword(CaseAccessUtils.PROFESSIONAL_ROLE, roleKeywords)) {
9584
+ roleCategoryList.push(CaseAccessUtils.PROFESSIONAL_ROLE_CATEGORY);
9585
+ }
9586
+ if (this.roleHasKeyword(CaseAccessUtils.CITIZEN_ROLE, roleKeywords)) {
9587
+ roleCategoryList.push(CaseAccessUtils.CITIZEN_ROLE_CATEGORY);
9588
+ }
9589
+ if (this.roleHasKeyword(CaseAccessUtils.ADMIN_ROLE, roleKeywords)) {
9590
+ roleCategoryList.push(CaseAccessUtils.ADMIN_ROLE_CATEGORY);
9591
+ }
9592
+ if (this.roleHasKeyword(CaseAccessUtils.CTSC_ROLE, roleKeywords)) {
9593
+ roleCategoryList.push(CaseAccessUtils.CTSC_ROLE_CATEGORY);
9594
+ }
9595
+ if (this.roleHasKeyword(CaseAccessUtils.LEGAL_OPERATIONS_ROLE, roleKeywords)) {
9596
+ roleCategoryList.push(CaseAccessUtils.LEGAL_OPERATIONS_ROLE_CATEGORY);
9597
+ }
9598
+ return roleCategoryList;
9599
+ }
9600
+ roleHasKeyword(keyword, roleWords) {
9601
+ return roleWords.includes(keyword);
9602
+ }
9603
+ getAMRoleName(accessType, aMRole) {
9604
+ let roleName = '';
9605
+ switch (aMRole) {
9606
+ case CaseAccessUtils.JUDGE_ROLE_CATEGORY:
9607
+ roleName = `${accessType}-access-${CaseAccessUtils.JUDGE_ROLE_NAME}`;
9608
+ break;
9609
+ case CaseAccessUtils.PROFESSIONAL_ROLE_CATEGORY:
9610
+ roleName = `${accessType}-access-${CaseAccessUtils.PROFESSIONAL_ROLE_NAME}`;
9611
+ break;
9612
+ case CaseAccessUtils.CITIZEN_ROLE_CATEGORY:
9613
+ roleName = `${accessType}-access-${CaseAccessUtils.CITIZEN_ROLE_NAME}`;
9614
+ break;
9615
+ case CaseAccessUtils.ADMIN_ROLE_CATEGORY:
9616
+ roleName = `${accessType}-access-${CaseAccessUtils.ADMIN_ROLE_NAME}`;
9617
+ break;
9618
+ case CaseAccessUtils.CTSC_ROLE_CATEGORY:
9619
+ roleName = `${accessType}-access-${CaseAccessUtils.CTSC_ROLE_NAME}`;
9620
+ break;
9621
+ default:
9622
+ roleName = `${accessType}-access-${CaseAccessUtils.LEGAL_OPERATIONS_ROLE_NAME}`;
9623
+ break;
9624
+ }
9625
+ return roleName;
9626
+ }
9663
9627
  getAMPayload(assignerId, actorId, roleName, roleCategory, grantType, caseId, details, beginTime = null, endTime = null, isNew = false) {
9664
9628
  const process = details.caseReference !== undefined ? 'challenged-access' : 'specific-access';
9665
9629
  const payload = {
@@ -11528,9 +11492,9 @@ class CasesService {
11528
11492
  }
11529
11493
  // EXUI-4758 - getMappedRoleCategories no longer returns a single string, checks all roles to get the most likely roleCategory
11530
11494
  // Unsure whether we should be using mapped role categories any more - should trust the roleCategories from userInfo if they exist
11531
- const roleCategories = userInfo.roleCategories || getMappedRoleCategories(userInfo.roles);
11495
+ const roleCategories = userInfo.roleCategories || camUtils.getMappedRoleCategories(userInfo.roles);
11532
11496
  // If user has no role categories, default to LEGAL_OPERATIONS
11533
- const roleName = getAMRoleName('challenged', roleCategories?.length > 0 ? roleCategories[0] : RoleCategory.LEGAL_OPERATIONS);
11497
+ const roleName = camUtils.getAMRoleName('challenged', roleCategories?.length > 0 ? roleCategories[0] : "LEGAL_OPERATIONS");
11534
11498
  const beginTime = new Date();
11535
11499
  const endTime = new Date(new Date().setUTCHours(23, 59, 59, 999));
11536
11500
  const id = userInfo.id ? userInfo.id : userInfo.uid;
@@ -11547,10 +11511,10 @@ class CasesService {
11547
11511
  return throwError(() => new Error('User info not found in session storage'));
11548
11512
  }
11549
11513
  // EXUI-4758 - See above comment
11550
- const roleCategories = userInfo.roleCategories || getMappedRoleCategories(userInfo.roles);
11514
+ const roleCategories = userInfo.roleCategories || camUtils.getMappedRoleCategories(userInfo.roles);
11551
11515
  // EXUI-4758 - Return first roleCategory as the roleCategory for now, unless not present, in which case default to LEGAL_OPERATIONS
11552
- const roleCategory = roleCategories?.length > 0 ? roleCategories[0] : RoleCategory.LEGAL_OPERATIONS;
11553
- const roleName = getAMRoleName('specific', roleCategory);
11516
+ const roleCategory = roleCategories?.length > 0 ? roleCategories[0] : "LEGAL_OPERATIONS";
11517
+ const roleName = camUtils.getAMRoleName('specific', roleCategory);
11554
11518
  const id = userInfo.id ? userInfo.id : userInfo.uid;
11555
11519
  const payload = camUtils.getAMPayload(null, id, roleName, roleCategory, 'SPECIFIC', caseId, sar, null, null, true);
11556
11520
  payload.roleRequest = {
@@ -38437,8 +38401,16 @@ class CaseResolver {
38437
38401
  }
38438
38402
  // as discussed for EUI-5456, need functionality to go to default page
38439
38403
  goToDefaultPage() {
38440
- isWorkAllocationUser(this.sessionStorage) ?
38441
- this.router.navigate([CaseResolver.defaultWAPage]) : this.router.navigate([CaseResolver.defaultPage]);
38404
+ const userDetails = safeJsonParse(this.sessionStorage.getItem(USER_DETAILS));
38405
+ userDetails && userDetails.roles
38406
+ && !userDetails.roles.includes(PUI_CASE_MANAGER)
38407
+ &&
38408
+ (userDetails.roles.includes('caseworker-ia-iacjudge')
38409
+ || userDetails.roles.includes('caseworker-ia-caseofficer')
38410
+ || userDetails.roles.includes('caseworker-ia-admofficer')
38411
+ || userDetails.roles.includes('caseworker-civil')
38412
+ || userDetails.roles.includes('caseworker-privatelaw'))
38413
+ ? this.router.navigate([CaseResolver.defaultWAPage]) : this.router.navigate([CaseResolver.defaultPage]);
38442
38414
  }
38443
38415
  static ɵfac = function CaseResolver_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseResolver)(i0.ɵɵinject(CaseNotifier), i0.ɵɵinject(DraftService), i0.ɵɵinject(NavigationNotifierService), i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(SessionStorageService)); };
38444
38416
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseResolver, factory: CaseResolver.ɵfac });
@@ -44511,5 +44483,5 @@ class TestRouteSnapshotBuilder {
44511
44483
  * Generated bundle index. Do not edit.
44512
44484
  */
44513
44485
 
44514
- export { AMRoleSuffix, AbstractAppConfig, AbstractFieldReadComponent, AbstractFieldWriteComponent, AbstractFieldWriteJourneyComponent, AbstractJourneyComponent, Activity, ActivityBannerComponent, ActivityComponent, ActivityIconComponent, ActivityInfo, ActivityModule, ActivityPollingService, ActivityService, AddCommentsComponent, AddCommentsErrorMessage, AddCommentsStep, AddressModel, AddressOption, AddressesService, Alert, AlertComponent, AlertIconClassPipe, AlertMessageType, AlertModule, AlertService, AuthService, Banner, BannersService, BeforeYouStartComponent, BodyComponent, BrowserService, CCDCaseLinkType, COMPONENT_PORTAL_INJECTION_TOKEN, CallbackErrorsComponent, CallbackErrorsContext, CaseAccessUtils, CaseBasicAccessViewComponent, CaseChallengedAccessRequestComponent, CaseChallengedAccessSuccessComponent, CaseCreateComponent, CaseDetails, CaseEditComponent, CaseEditConfirmComponent, CaseEditDataModule, CaseEditDataService, CaseEditFormComponent, CaseEditPageComponent, CaseEditSubmitComponent, CaseEditWizardGuard, CaseEditorConfig, CaseEditorModule, CaseEvent, CaseEventCompletionComponent, CaseEventCompletionTaskCancelledComponent, CaseEventCompletionTaskReassignedComponent, CaseEventData, CaseEventTrigger, CaseEventTriggerComponent, CaseField, CaseFieldService, CaseFileViewFieldComponent, CaseFileViewFolderComponent, CaseFileViewFolderDocumentActionsComponent, CaseFileViewFolderSelectorComponent, CaseFileViewFolderSortComponent, CaseFileViewFolderToggleComponent, CaseFileViewOverlayMenuComponent, CaseFileViewService, CaseFlagCheckYourAnswersPageStep, CaseFlagDisplayContextParameter, CaseFlagErrorMessage, CaseFlagFieldState, CaseFlagFormFields, CaseFlagRefdataService, CaseFlagStatus, CaseFlagSummaryListComponent, CaseFlagSummaryListDisplayMode, CaseFlagTableComponent, CaseFlagWizardStepTitle, CaseFullAccessViewComponent, CaseHeaderComponent, CaseHeaderModule, CaseHistoryViewerFieldComponent, CaseLink, CaseLinkResponse, CaseListComponent, CaseListFiltersComponent, CaseListFiltersModule, CaseListModule, CaseNotifier, CasePaymentHistoryViewerFieldComponent, CasePrintDocument, CasePrinterComponent, CaseProgressComponent, CaseReferencePipe, CaseResolver, CaseSpecificAccessRequestComponent, CaseSpecificAccessSuccessComponent, CaseState, CaseTab, CaseTimelineComponent, CaseTimelineDisplayMode, CaseTimelineModule, CaseType, CaseTypeLite, CaseView, CaseViewComponent, CaseViewEvent, CaseViewTrigger, CaseViewerComponent, CaseViewerModule, CasesService, CaseworkerService, CcdCYAPageLabelFilterPipe, CcdCaseTitlePipe, CcdCollectionTableCaseFieldsFilterPipe, CcdPageFieldsPipe, CcdTabFieldsPipe, CheckYourAnswersComponent, CloseQueryComponent, ConditionalShowFormDirective, ConditionalShowModule, ConditionalShowRegistrarService, ConfirmFlagStatusComponent, ConfirmStatusErrorMessage, ConfirmStatusStep, Confirmation, ConvertHrefToRouterService, CreateCaseFiltersComponent, CreateCaseFiltersModule, CreateCaseFiltersSelection, DRAFT_PREFIX, DRAFT_QUERY_PARAM, DashPipe, DateInputComponent, DatePipe, DateTimeFormatUtils, DatetimePickerComponent, DefinitionsModule, DefinitionsService, DeleteOrCancelDialogComponent, DialogsModule, DisplayMode, Document, DocumentData, DocumentDialogComponent, DocumentLinks, DocumentManagementService, DocumentUrlPipe, Draft, DraftService, DynamicListPipe, DynamicRadioListPipe, ESQueryType, Embedded, EnumDisplayDescriptionPipe, ErrorMessageComponent, ErrorNotifierService, EventCaseField, EventCompletionReturnStates, EventCompletionStateMachineService, EventCompletionStates, EventLogComponent, EventLogDetailsComponent, EventLogTableComponent, EventMessageModule, EventStartComponent, EventStartModule, EventStartStateMachineService, EventStatusService, EventTriggerResolver, EventTriggerService, Fee, FeeValue, Field, FieldLabelPipe, FieldReadComponent, FieldReadLabelComponent, FieldType, FieldTypeSanitiser, FieldWriteComponent, FieldsFilterPipe, FieldsPurger, FieldsUtils, FirstErrorPipe, FixedListItem, FixedListPipe, FixedRadioListPipe, FlagFieldDisplayPipe, FocusElementDirective, FocusElementModule, FocusService, FooterComponent, FormDocument, FormErrorService, FormValidatorsService, FormValueService, FormatTranslatorService, GreyBarService, HRef, HeaderBarComponent, HeadersModule, HttpError, HttpErrorService, HttpService, IsCompoundPipe, IsMandatoryPipe, IsReadOnlyAndNotCollectionPipe, IsReadOnlyPipe, JudicialworkerService, Jurisdiction, JurisdictionService, LabelFieldComponent, LabelSubstitutorDirective, LabelSubstitutorModule, LanguageInterpreterDisplayPipe, LinkCaseReason, LinkCasesComponent, LinkCasesFromReasonValuePipe, LinkCasesReasonValuePipe, LinkDetails, LinkFromReason, LinkReason, LinkedCasesErrorMessages, LinkedCasesEventTriggers, LinkedCasesFromTableComponent, LinkedCasesPages, LinkedCasesResponse, LinkedCasesToTableComponent, LoadingModule, LoadingService, LoadingSpinnerComponent, LoadingSpinnerModule, MEDIA_VIEWER_LOCALSTORAGE_KEY, MULTIPLE_TASKS_FOUND, ManageCaseFlagsComponent, ManageCaseFlagsLabelDisplayPipe, MarkdownComponent, MarkdownComponentModule, MoneyGbpInputComponent, MultipageComponentStateService, MultipleTasksExistComponent, NavigationComponent, NavigationItemComponent, NavigationNotifierService, NavigationOrigin, NoLinkedCasesComponent, NoTasksAvailableComponent, NotificationBannerComponent, NotificationBannerHeaderClass, NotificationBannerType, OrderService, OrderSummary, OrganisationConverter, OrganisationService, PageValidationService, PaginationComponent, PaginationMetadata, PaginationModule, PaletteContext, PaletteModule, PaletteService, PaletteUtilsModule, Patterns, PaymentField, PhaseComponent, PipesModule, PlaceholderService, PrintUrlPipe, Profile, ProfileNotifier, ProfileService, QualifyingQuestionDetailComponent, QualifyingQuestionOptionsComponent, QualifyingQuestionService, QualifyingQuestionsErrorMessage, QueryAttachmentsReadComponent, QueryCaseDetailsHeaderComponent, QueryCheckYourAnswersComponent, QueryConfirmationComponent, QueryCreateContext, QueryDetailsComponent, QueryEventCompletionComponent, QueryItemResponseStatus, QueryListComponent, QueryListData, QueryListItem, QueryManagementService, QueryWriteAddDocumentsComponent, QueryWriteDateInputComponent, QueryWriteRaiseQueryComponent, QueryWriteRespondToQueryComponent, RaiseQueryErrorMessage, ReadCaseFlagFieldComponent, ReadCaseLinkFieldComponent, ReadCollectionFieldComponent, ReadComplexFieldCollectionTableComponent, ReadComplexFieldComponent, ReadComplexFieldRawComponent, ReadComplexFieldTableComponent, ReadCookieService, ReadDateFieldComponent, ReadDocumentFieldComponent, ReadDynamicListFieldComponent, ReadDynamicMultiSelectListFieldComponent, ReadDynamicRadioListFieldComponent, ReadEmailFieldComponent, ReadFieldsFilterPipe, ReadFixedListFieldComponent, ReadFixedRadioListFieldComponent, ReadJudicialUserFieldComponent, ReadLinkedCasesFieldComponent, ReadMoneyGbpFieldComponent, ReadMultiSelectListFieldComponent, ReadNumberFieldComponent, ReadOrderSummaryFieldComponent, ReadOrderSummaryRowComponent, ReadOrganisationFieldComponent, ReadOrganisationFieldRawComponent, ReadOrganisationFieldTableComponent, ReadPhoneUKFieldComponent, ReadQueryManagementFieldComponent, ReadRichTextAreaFieldComponent, ReadTextAreaFieldComponent, ReadTextFieldComponent, ReadYesNoFieldComponent, RefdataCaseFlagType, RemoveDialogComponent, RequestOptionsBuilder, RespondToQueryErrorMessages, RetryUtil, RoleCategory, RoleKeyword, RouterHelperService, RouterLinkComponent, SaveOrDiscardDialogComponent, SearchFiltersComponent, SearchFiltersModule, SearchFiltersWrapperComponent, SearchInput, SearchLanguageInterpreterComponent, SearchLanguageInterpreterErrorMessage, SearchLanguageInterpreterStep, SearchResultComponent, SearchResultModule, SearchResultView, SearchResultViewColumn, SearchResultViewItem, SearchResultViewItemComparatorFactory, SearchService, SelectFlagErrorMessage, SelectFlagLocationComponent, SelectFlagLocationErrorMessage, SelectFlagTypeComponent, SelectFlagTypeErrorMessage, SessionErrorPageComponent, SessionErrorRoute, SessionJsonErrorLogger, SessionStorageGuard, SessionStorageService, ShowCondition, SortOrder$1 as SortOrder, SortParameters, SortSearchResultPipe, StructuredLoggerService, TabComponent, TableColumnConfig, TableConfig, TabsComponent, TabsModule, TaskAssignedComponent, TaskCancelledComponent, TaskConflictComponent, TaskUnassignedComponent, Terms, TestRouteSnapshotBuilder, TranslatedMarkdownDirective, TranslatedMarkdownModule, UnLinkCasesComponent, UnsupportedFieldComponent, UpdateFlagAddTranslationErrorMessage, UpdateFlagAddTranslationFormComponent, UpdateFlagAddTranslationStep, UpdateFlagComponent, UpdateFlagErrorMessage, UpdateFlagStep, UpdateFlagTitleDisplayPipe, WaysToPayFieldComponent, WindowService, Wizard, WizardFactoryService, WizardPage, WizardPageField, WorkAllocationService, WorkbasketFiltersComponent, WorkbasketFiltersModule, WorkbasketInput, WorkbasketInputFilterService, WorkbasketInputModel, WriteAddressFieldComponent, WriteCaseFlagFieldComponent, WriteCaseLinkFieldComponent, WriteCollectionFieldComponent, WriteComplexFieldComponent, WriteDateContainerFieldComponent, WriteDateFieldComponent, WriteDocumentFieldComponent, WriteDynamicListFieldComponent, WriteDynamicMultiSelectListFieldComponent, WriteDynamicRadioListFieldComponent, WriteEmailFieldComponent, WriteFixedListFieldComponent, WriteFixedRadioListFieldComponent, WriteJudicialUserFieldComponent, WriteLinkedCasesFieldComponent, WriteMoneyGbpFieldComponent, WriteMultiSelectListFieldComponent, WriteNumberFieldComponent, WriteOrderSummaryFieldComponent, WriteOrganisationComplexFieldComponent, WriteOrganisationFieldComponent, WritePhoneUKFieldComponent, WriteRichTextAreaFieldComponent, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, caseMessagesMockData, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, safeJsonParse, textFieldType, viewerRouting };
44486
+ export { AbstractAppConfig, AbstractFieldReadComponent, AbstractFieldWriteComponent, AbstractFieldWriteJourneyComponent, AbstractJourneyComponent, Activity, ActivityBannerComponent, ActivityComponent, ActivityIconComponent, ActivityInfo, ActivityModule, ActivityPollingService, ActivityService, AddCommentsComponent, AddCommentsErrorMessage, AddCommentsStep, AddressModel, AddressOption, AddressesService, Alert, AlertComponent, AlertIconClassPipe, AlertMessageType, AlertModule, AlertService, AuthService, Banner, BannersService, BeforeYouStartComponent, BodyComponent, BrowserService, CCDCaseLinkType, COMPONENT_PORTAL_INJECTION_TOKEN, CallbackErrorsComponent, CallbackErrorsContext, CaseAccessUtils, CaseBasicAccessViewComponent, CaseChallengedAccessRequestComponent, CaseChallengedAccessSuccessComponent, CaseCreateComponent, CaseDetails, CaseEditComponent, CaseEditConfirmComponent, CaseEditDataModule, CaseEditDataService, CaseEditFormComponent, CaseEditPageComponent, CaseEditSubmitComponent, CaseEditWizardGuard, CaseEditorConfig, CaseEditorModule, CaseEvent, CaseEventCompletionComponent, CaseEventCompletionTaskCancelledComponent, CaseEventCompletionTaskReassignedComponent, CaseEventData, CaseEventTrigger, CaseEventTriggerComponent, CaseField, CaseFieldService, CaseFileViewFieldComponent, CaseFileViewFolderComponent, CaseFileViewFolderDocumentActionsComponent, CaseFileViewFolderSelectorComponent, CaseFileViewFolderSortComponent, CaseFileViewFolderToggleComponent, CaseFileViewOverlayMenuComponent, CaseFileViewService, CaseFlagCheckYourAnswersPageStep, CaseFlagDisplayContextParameter, CaseFlagErrorMessage, CaseFlagFieldState, CaseFlagFormFields, CaseFlagRefdataService, CaseFlagStatus, CaseFlagSummaryListComponent, CaseFlagSummaryListDisplayMode, CaseFlagTableComponent, CaseFlagWizardStepTitle, CaseFullAccessViewComponent, CaseHeaderComponent, CaseHeaderModule, CaseHistoryViewerFieldComponent, CaseLink, CaseLinkResponse, CaseListComponent, CaseListFiltersComponent, CaseListFiltersModule, CaseListModule, CaseNotifier, CasePaymentHistoryViewerFieldComponent, CasePrintDocument, CasePrinterComponent, CaseProgressComponent, CaseReferencePipe, CaseResolver, CaseSpecificAccessRequestComponent, CaseSpecificAccessSuccessComponent, CaseState, CaseTab, CaseTimelineComponent, CaseTimelineDisplayMode, CaseTimelineModule, CaseType, CaseTypeLite, CaseView, CaseViewComponent, CaseViewEvent, CaseViewTrigger, CaseViewerComponent, CaseViewerModule, CasesService, CaseworkerService, CcdCYAPageLabelFilterPipe, CcdCaseTitlePipe, CcdCollectionTableCaseFieldsFilterPipe, CcdPageFieldsPipe, CcdTabFieldsPipe, CheckYourAnswersComponent, CloseQueryComponent, ConditionalShowFormDirective, ConditionalShowModule, ConditionalShowRegistrarService, ConfirmFlagStatusComponent, ConfirmStatusErrorMessage, ConfirmStatusStep, Confirmation, ConvertHrefToRouterService, CreateCaseFiltersComponent, CreateCaseFiltersModule, CreateCaseFiltersSelection, DRAFT_PREFIX, DRAFT_QUERY_PARAM, DashPipe, DateInputComponent, DatePipe, DateTimeFormatUtils, DatetimePickerComponent, DefinitionsModule, DefinitionsService, DeleteOrCancelDialogComponent, DialogsModule, DisplayMode, Document, DocumentData, DocumentDialogComponent, DocumentLinks, DocumentManagementService, DocumentUrlPipe, Draft, DraftService, DynamicListPipe, DynamicRadioListPipe, ESQueryType, Embedded, EnumDisplayDescriptionPipe, ErrorMessageComponent, ErrorNotifierService, EventCaseField, EventCompletionReturnStates, EventCompletionStateMachineService, EventCompletionStates, EventLogComponent, EventLogDetailsComponent, EventLogTableComponent, EventMessageModule, EventStartComponent, EventStartModule, EventStartStateMachineService, EventStatusService, EventTriggerResolver, EventTriggerService, Fee, FeeValue, Field, FieldLabelPipe, FieldReadComponent, FieldReadLabelComponent, FieldType, FieldTypeSanitiser, FieldWriteComponent, FieldsFilterPipe, FieldsPurger, FieldsUtils, FirstErrorPipe, FixedListItem, FixedListPipe, FixedRadioListPipe, FlagFieldDisplayPipe, FocusElementDirective, FocusElementModule, FocusService, FooterComponent, FormDocument, FormErrorService, FormValidatorsService, FormValueService, FormatTranslatorService, GreyBarService, HRef, HeaderBarComponent, HeadersModule, HttpError, HttpErrorService, HttpService, IsCompoundPipe, IsMandatoryPipe, IsReadOnlyAndNotCollectionPipe, IsReadOnlyPipe, JudicialworkerService, Jurisdiction, JurisdictionService, LabelFieldComponent, LabelSubstitutorDirective, LabelSubstitutorModule, LanguageInterpreterDisplayPipe, LinkCaseReason, LinkCasesComponent, LinkCasesFromReasonValuePipe, LinkCasesReasonValuePipe, LinkDetails, LinkFromReason, LinkReason, LinkedCasesErrorMessages, LinkedCasesEventTriggers, LinkedCasesFromTableComponent, LinkedCasesPages, LinkedCasesResponse, LinkedCasesToTableComponent, LoadingModule, LoadingService, LoadingSpinnerComponent, LoadingSpinnerModule, MEDIA_VIEWER_LOCALSTORAGE_KEY, MULTIPLE_TASKS_FOUND, ManageCaseFlagsComponent, ManageCaseFlagsLabelDisplayPipe, MarkdownComponent, MarkdownComponentModule, MoneyGbpInputComponent, MultipageComponentStateService, MultipleTasksExistComponent, NavigationComponent, NavigationItemComponent, NavigationNotifierService, NavigationOrigin, NoLinkedCasesComponent, NoTasksAvailableComponent, NotificationBannerComponent, NotificationBannerHeaderClass, NotificationBannerType, OrderService, OrderSummary, OrganisationConverter, OrganisationService, PageValidationService, PaginationComponent, PaginationMetadata, PaginationModule, PaletteContext, PaletteModule, PaletteService, PaletteUtilsModule, Patterns, PaymentField, PhaseComponent, PipesModule, PlaceholderService, PrintUrlPipe, Profile, ProfileNotifier, ProfileService, QualifyingQuestionDetailComponent, QualifyingQuestionOptionsComponent, QualifyingQuestionService, QualifyingQuestionsErrorMessage, QueryAttachmentsReadComponent, QueryCaseDetailsHeaderComponent, QueryCheckYourAnswersComponent, QueryConfirmationComponent, QueryCreateContext, QueryDetailsComponent, QueryEventCompletionComponent, QueryItemResponseStatus, QueryListComponent, QueryListData, QueryListItem, QueryManagementService, QueryWriteAddDocumentsComponent, QueryWriteDateInputComponent, QueryWriteRaiseQueryComponent, QueryWriteRespondToQueryComponent, RaiseQueryErrorMessage, ReadCaseFlagFieldComponent, ReadCaseLinkFieldComponent, ReadCollectionFieldComponent, ReadComplexFieldCollectionTableComponent, ReadComplexFieldComponent, ReadComplexFieldRawComponent, ReadComplexFieldTableComponent, ReadCookieService, ReadDateFieldComponent, ReadDocumentFieldComponent, ReadDynamicListFieldComponent, ReadDynamicMultiSelectListFieldComponent, ReadDynamicRadioListFieldComponent, ReadEmailFieldComponent, ReadFieldsFilterPipe, ReadFixedListFieldComponent, ReadFixedRadioListFieldComponent, ReadJudicialUserFieldComponent, ReadLinkedCasesFieldComponent, ReadMoneyGbpFieldComponent, ReadMultiSelectListFieldComponent, ReadNumberFieldComponent, ReadOrderSummaryFieldComponent, ReadOrderSummaryRowComponent, ReadOrganisationFieldComponent, ReadOrganisationFieldRawComponent, ReadOrganisationFieldTableComponent, ReadPhoneUKFieldComponent, ReadQueryManagementFieldComponent, ReadRichTextAreaFieldComponent, ReadTextAreaFieldComponent, ReadTextFieldComponent, ReadYesNoFieldComponent, RefdataCaseFlagType, RemoveDialogComponent, RequestOptionsBuilder, RespondToQueryErrorMessages, RetryUtil, RouterHelperService, RouterLinkComponent, SaveOrDiscardDialogComponent, SearchFiltersComponent, SearchFiltersModule, SearchFiltersWrapperComponent, SearchInput, SearchLanguageInterpreterComponent, SearchLanguageInterpreterErrorMessage, SearchLanguageInterpreterStep, SearchResultComponent, SearchResultModule, SearchResultView, SearchResultViewColumn, SearchResultViewItem, SearchResultViewItemComparatorFactory, SearchService, SelectFlagErrorMessage, SelectFlagLocationComponent, SelectFlagLocationErrorMessage, SelectFlagTypeComponent, SelectFlagTypeErrorMessage, SessionErrorPageComponent, SessionErrorRoute, SessionJsonErrorLogger, SessionStorageGuard, SessionStorageService, ShowCondition, SortOrder$1 as SortOrder, SortParameters, SortSearchResultPipe, StructuredLoggerService, TabComponent, TableColumnConfig, TableConfig, TabsComponent, TabsModule, TaskAssignedComponent, TaskCancelledComponent, TaskConflictComponent, TaskUnassignedComponent, Terms, TestRouteSnapshotBuilder, TranslatedMarkdownDirective, TranslatedMarkdownModule, UnLinkCasesComponent, UnsupportedFieldComponent, UpdateFlagAddTranslationErrorMessage, UpdateFlagAddTranslationFormComponent, UpdateFlagAddTranslationStep, UpdateFlagComponent, UpdateFlagErrorMessage, UpdateFlagStep, UpdateFlagTitleDisplayPipe, WaysToPayFieldComponent, WindowService, Wizard, WizardFactoryService, WizardPage, WizardPageField, WorkAllocationService, WorkbasketFiltersComponent, WorkbasketFiltersModule, WorkbasketInput, WorkbasketInputFilterService, WorkbasketInputModel, WriteAddressFieldComponent, WriteCaseFlagFieldComponent, WriteCaseLinkFieldComponent, WriteCollectionFieldComponent, WriteComplexFieldComponent, WriteDateContainerFieldComponent, WriteDateFieldComponent, WriteDocumentFieldComponent, WriteDynamicListFieldComponent, WriteDynamicMultiSelectListFieldComponent, WriteDynamicRadioListFieldComponent, WriteEmailFieldComponent, WriteFixedListFieldComponent, WriteFixedRadioListFieldComponent, WriteJudicialUserFieldComponent, WriteLinkedCasesFieldComponent, WriteMoneyGbpFieldComponent, WriteMultiSelectListFieldComponent, WriteNumberFieldComponent, WriteOrderSummaryFieldComponent, WriteOrganisationComplexFieldComponent, WriteOrganisationFieldComponent, WritePhoneUKFieldComponent, WriteRichTextAreaFieldComponent, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, caseMessagesMockData, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, safeJsonParse, textFieldType, viewerRouting };
44515
44487
  //# sourceMappingURL=hmcts-ccd-case-ui-toolkit.mjs.map