@hmcts/ccd-case-ui-toolkit 7.0.63 → 7.0.64-ungrey-back-button

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.
Files changed (99) hide show
  1. package/esm2022/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.mjs +85 -33
  2. package/esm2022/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.mjs +49 -37
  3. package/esm2022/lib/shared/components/case-editor/case-editor.module.mjs +7 -4
  4. package/esm2022/lib/shared/components/case-editor/services/case-flag-state.service.mjs +3 -1
  5. package/esm2022/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.mjs +14 -4
  6. package/esm2022/lib/shared/components/palette/base-field/abstract-field-write-journey.component.mjs +92 -0
  7. package/esm2022/lib/shared/components/palette/base-field/abstract-journey.component.mjs +82 -0
  8. package/esm2022/lib/shared/components/palette/base-field/index.mjs +3 -1
  9. package/esm2022/lib/shared/components/palette/case-file-view/case-file-view-field.component.mjs +8 -7
  10. package/esm2022/lib/shared/components/palette/case-flag/components/add-comments/add-comments.component.mjs +21 -21
  11. package/esm2022/lib/shared/components/palette/case-flag/components/confirm-flag-status/confirm-flag-status.component.mjs +22 -22
  12. package/esm2022/lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.mjs +28 -28
  13. package/esm2022/lib/shared/components/palette/case-flag/components/search-language-interpreter/search-language-interpreter.component.mjs +32 -29
  14. package/esm2022/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.mjs +21 -28
  15. package/esm2022/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.mjs +128 -63
  16. package/esm2022/lib/shared/components/palette/case-flag/components/update-flag/update-flag-add-translation-form/update-flag-add-translation-form.component.mjs +28 -28
  17. package/esm2022/lib/shared/components/palette/case-flag/components/update-flag/update-flag.component.mjs +107 -105
  18. package/esm2022/lib/shared/components/palette/case-flag/write-case-flag-field.component.mjs +107 -31
  19. package/esm2022/lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.mjs +27 -18
  20. package/esm2022/lib/shared/components/palette/linked-cases/components/check-your-answers/check-your-answers.component.mjs +19 -7
  21. package/esm2022/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.mjs +57 -45
  22. package/esm2022/lib/shared/components/palette/linked-cases/components/no-linked-cases/no-linked-cases.component.mjs +13 -9
  23. package/esm2022/lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.mjs +45 -39
  24. package/esm2022/lib/shared/components/palette/linked-cases/services/linked-cases.service.mjs +11 -1
  25. package/esm2022/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.mjs +69 -23
  26. package/esm2022/lib/shared/domain/index.mjs +2 -1
  27. package/esm2022/lib/shared/domain/journey/index.mjs +3 -0
  28. package/esm2022/lib/shared/domain/journey/journey-instigator.model.mjs +2 -0
  29. package/esm2022/lib/shared/domain/journey/journey.model.mjs +2 -0
  30. package/esm2022/lib/shared/pipes/complex/ccd-page-fields.pipe.mjs +2 -2
  31. package/esm2022/lib/shared/services/index.mjs +2 -1
  32. package/esm2022/lib/shared/services/journey/index.mjs +2 -0
  33. package/esm2022/lib/shared/services/journey/multipage-component-state.service.mjs +114 -0
  34. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +1270 -713
  35. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
  36. package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts +14 -3
  37. package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts.map +1 -1
  38. package/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.d.ts +7 -2
  39. package/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.d.ts.map +1 -1
  40. package/lib/shared/components/case-editor/case-editor.module.d.ts.map +1 -1
  41. package/lib/shared/components/case-editor/services/case-flag-state.service.d.ts +1 -0
  42. package/lib/shared/components/case-editor/services/case-flag-state.service.d.ts.map +1 -1
  43. package/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.d.ts +2 -1
  44. package/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.d.ts.map +1 -1
  45. package/lib/shared/components/palette/base-field/abstract-field-write-journey.component.d.ts +30 -0
  46. package/lib/shared/components/palette/base-field/abstract-field-write-journey.component.d.ts.map +1 -0
  47. package/lib/shared/components/palette/base-field/abstract-journey.component.d.ts +27 -0
  48. package/lib/shared/components/palette/base-field/abstract-journey.component.d.ts.map +1 -0
  49. package/lib/shared/components/palette/base-field/index.d.ts +2 -0
  50. package/lib/shared/components/palette/base-field/index.d.ts.map +1 -1
  51. package/lib/shared/components/palette/case-file-view/case-file-view-field.component.d.ts +1 -0
  52. package/lib/shared/components/palette/case-file-view/case-file-view-field.component.d.ts.map +1 -1
  53. package/lib/shared/components/palette/case-flag/components/add-comments/add-comments.component.d.ts +4 -2
  54. package/lib/shared/components/palette/case-flag/components/add-comments/add-comments.component.d.ts.map +1 -1
  55. package/lib/shared/components/palette/case-flag/components/confirm-flag-status/confirm-flag-status.component.d.ts +4 -2
  56. package/lib/shared/components/palette/case-flag/components/confirm-flag-status/confirm-flag-status.component.d.ts.map +1 -1
  57. package/lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.d.ts +5 -3
  58. package/lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.d.ts.map +1 -1
  59. package/lib/shared/components/palette/case-flag/components/search-language-interpreter/search-language-interpreter.component.d.ts +6 -3
  60. package/lib/shared/components/palette/case-flag/components/search-language-interpreter/search-language-interpreter.component.d.ts.map +1 -1
  61. package/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.d.ts +4 -2
  62. package/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.d.ts.map +1 -1
  63. package/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.d.ts +12 -5
  64. package/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.d.ts.map +1 -1
  65. package/lib/shared/components/palette/case-flag/components/update-flag/update-flag-add-translation-form/update-flag-add-translation-form.component.d.ts +4 -2
  66. package/lib/shared/components/palette/case-flag/components/update-flag/update-flag-add-translation-form/update-flag-add-translation-form.component.d.ts.map +1 -1
  67. package/lib/shared/components/palette/case-flag/components/update-flag/update-flag.component.d.ts +6 -3
  68. package/lib/shared/components/palette/case-flag/components/update-flag/update-flag.component.d.ts.map +1 -1
  69. package/lib/shared/components/palette/case-flag/write-case-flag-field.component.d.ts +10 -5
  70. package/lib/shared/components/palette/case-flag/write-case-flag-field.component.d.ts.map +1 -1
  71. package/lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.d.ts +6 -3
  72. package/lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.d.ts.map +1 -1
  73. package/lib/shared/components/palette/linked-cases/components/check-your-answers/check-your-answers.component.d.ts +6 -2
  74. package/lib/shared/components/palette/linked-cases/components/check-your-answers/check-your-answers.component.d.ts.map +1 -1
  75. package/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.d.ts +6 -3
  76. package/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.d.ts.map +1 -1
  77. package/lib/shared/components/palette/linked-cases/components/no-linked-cases/no-linked-cases.component.d.ts +5 -2
  78. package/lib/shared/components/palette/linked-cases/components/no-linked-cases/no-linked-cases.component.d.ts.map +1 -1
  79. package/lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.d.ts +6 -3
  80. package/lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.d.ts.map +1 -1
  81. package/lib/shared/components/palette/linked-cases/services/linked-cases.service.d.ts +4 -0
  82. package/lib/shared/components/palette/linked-cases/services/linked-cases.service.d.ts.map +1 -1
  83. package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts +6 -3
  84. package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts.map +1 -1
  85. package/lib/shared/domain/index.d.ts +1 -0
  86. package/lib/shared/domain/index.d.ts.map +1 -1
  87. package/lib/shared/domain/journey/index.d.ts +3 -0
  88. package/lib/shared/domain/journey/index.d.ts.map +1 -0
  89. package/lib/shared/domain/journey/journey-instigator.model.d.ts +5 -0
  90. package/lib/shared/domain/journey/journey-instigator.model.d.ts.map +1 -0
  91. package/lib/shared/domain/journey/journey.model.d.ts +16 -0
  92. package/lib/shared/domain/journey/journey.model.d.ts.map +1 -0
  93. package/lib/shared/services/index.d.ts +1 -0
  94. package/lib/shared/services/index.d.ts.map +1 -1
  95. package/lib/shared/services/journey/index.d.ts +2 -0
  96. package/lib/shared/services/journey/index.d.ts.map +1 -0
  97. package/lib/shared/services/journey/multipage-component-state.service.d.ts +25 -0
  98. package/lib/shared/services/journey/multipage-component-state.service.d.ts.map +1 -0
  99. package/package.json +1 -1
@@ -8,7 +8,7 @@ import * as i1$1 from '@angular/router';
8
8
  import { RouterModule, NavigationStart, NavigationEnd } from '@angular/router';
9
9
  import * as i4 from '@angular/forms';
10
10
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormArray, FormGroup, FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
11
- import { throwError, Subject, EMPTY, Observable, BehaviorSubject, of, timer, fromEvent, forkJoin, Subscription, combineLatest } from 'rxjs';
11
+ import { throwError, Subject, EMPTY, Observable, BehaviorSubject, of, timer, forkJoin, fromEvent, Subscription, combineLatest } from 'rxjs';
12
12
  import * as i1$2 from '@angular/common/http';
13
13
  import { HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
14
14
  import { catchError, map, publish, refCount, switchMap, debounceTime, delay, distinctUntilChanged, finalize, timeout, mergeMap, retryWhen, tap, delayWhen, publishReplay, take, first, takeUntil, filter } from 'rxjs/operators';
@@ -58,7 +58,7 @@ import * as i10 from '@angular/material/legacy-tabs';
58
58
  import { MatLegacyTabsModule } from '@angular/material/legacy-tabs';
59
59
  import { decompressFromUTF16, compressToUTF16 } from 'lz-string';
60
60
 
61
- const _c0$14 = [[["", "footerSolsNavLinks", ""]], [["", "footerCaseWorkerNavLinks", ""]]];
61
+ const _c0$16 = [[["", "footerSolsNavLinks", ""]], [["", "footerCaseWorkerNavLinks", ""]]];
62
62
  const _c1$u = ["[footerSolsNavLinks]", "[footerCaseWorkerNavLinks]"];
63
63
  function FooterComponent_div_2_Template(rf, ctx) { if (rf & 1) {
64
64
  i0.ɵɵelementStart(0, "div", 3)(1, "div", 4);
@@ -136,7 +136,7 @@ class FooterComponent {
136
136
  workhours;
137
137
  static ɵfac = function FooterComponent_Factory(t) { return new (t || FooterComponent)(); };
138
138
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FooterComponent, selectors: [["cut-footer-bar"]], inputs: { email: "email", isSolicitor: "isSolicitor", phone: "phone", workhours: "workhours" }, ngContentSelectors: _c1$u, decls: 4, vars: 4, consts: [["id", "footer", "role", "footer", 1, "group", "js-footer"], [1, "footer-wrapper"], ["class", "footer-meta", 4, "ngIf"], [1, "footer-meta"], [1, "footer-meta-inner"], [1, "open-government-licence"], [1, "logo"], ["href", "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/", "rel", "license"], [1, "copyright"], ["href", "https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/"], [1, "title"], [1, "footer-text"], [1, "email"], [3, "href"], [1, "phone"], [1, "work-hours"]], template: function FooterComponent_Template(rf, ctx) { if (rf & 1) {
139
- i0.ɵɵprojectionDef(_c0$14);
139
+ i0.ɵɵprojectionDef(_c0$16);
140
140
  i0.ɵɵelementStart(0, "footer", 0)(1, "div", 1);
141
141
  i0.ɵɵtemplate(2, FooterComponent_div_2_Template, 20, 15, "div", 2)(3, FooterComponent_div_3_Template, 20, 16, "div", 2);
142
142
  i0.ɵɵelementEnd()();
@@ -163,7 +163,7 @@ class FooterComponent {
163
163
  }] }); })();
164
164
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FooterComponent, { className: "FooterComponent", filePath: "lib/components/footer/footer.component.ts", lineNumber: 8 }); })();
165
165
 
166
- const _c0$13 = [[["", "headerNavigation", ""]]];
166
+ const _c0$15 = [[["", "headerNavigation", ""]]];
167
167
  const _c1$t = ["[headerNavigation]"];
168
168
  function HeaderBarComponent_div_3_Template(rf, ctx) { if (rf & 1) {
169
169
  i0.ɵɵelementStart(0, "div")(1, "a", 12);
@@ -207,7 +207,7 @@ class HeaderBarComponent {
207
207
  }
208
208
  static ɵfac = function HeaderBarComponent_Factory(t) { return new (t || HeaderBarComponent)(); };
209
209
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HeaderBarComponent, selectors: [["cut-header-bar"]], inputs: { title: "title", isSolicitor: "isSolicitor", username: "username" }, outputs: { signOutRequest: "signOutRequest" }, ngContentSelectors: _c1$t, decls: 17, vars: 14, consts: [["role", "banner", "id", "global-header", 1, "with-proposition"], [1, "header-wrapper"], [1, "header-global"], [4, "ngIf"], ["class", "global-header", 4, "ngIf"], [1, "header-proposition"], [1, "content"], ["href", "#proposition-links", 1, "js-header-toggle", "menu"], ["id", "proposition-menu", 4, "ngIf"], [1, "proposition-right"], ["id", "user-name"], ["id", "sign-out", "href", "javascript:void(0)", 3, "click"], ["href", "https://www.gov.uk", "title", "Go to the GOV.UK homepage", "id", "logo", 1, "content", 2, "margin-left", "0px"], ["src", "/img/gov.uk_logotype_crown_invert_trans.png?0.23.0", "width", "36", "height", "32", "alt", ""], [1, "global-header"], [1, "title"], ["id", "proposition-menu"], [1, "title-solicitor"], ["id", "proposition-name"]], template: function HeaderBarComponent_Template(rf, ctx) { if (rf & 1) {
210
- i0.ɵɵprojectionDef(_c0$13);
210
+ i0.ɵɵprojectionDef(_c0$15);
211
211
  i0.ɵɵelementStart(0, "header", 0)(1, "div", 1)(2, "div", 2);
212
212
  i0.ɵɵtemplate(3, HeaderBarComponent_div_3_Template, 5, 3, "div", 3)(4, HeaderBarComponent_div_4_Template, 5, 3, "div", 4);
213
213
  i0.ɵɵelementEnd();
@@ -257,13 +257,13 @@ class HeaderBarComponent {
257
257
  }] }); })();
258
258
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HeaderBarComponent, { className: "HeaderBarComponent", filePath: "lib/components/header/header-bar/header-bar.component.ts", lineNumber: 8 }); })();
259
259
 
260
- const _c0$12 = [[["", "leftNavLinks", ""]], [["", "rightNavLinks", ""]]];
260
+ const _c0$14 = [[["", "leftNavLinks", ""]], [["", "rightNavLinks", ""]]];
261
261
  const _c1$s = ["[leftNavLinks]", "[rightNavLinks]"];
262
262
  class NavigationComponent {
263
263
  isSolicitor;
264
264
  static ɵfac = function NavigationComponent_Factory(t) { return new (t || NavigationComponent)(); };
265
265
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NavigationComponent, selectors: [["cut-nav-bar"]], inputs: { isSolicitor: "isSolicitor" }, ngContentSelectors: _c1$s, decls: 4, vars: 2, consts: [[1, "cut-nav-bar"]], template: function NavigationComponent_Template(rf, ctx) { if (rf & 1) {
266
- i0.ɵɵprojectionDef(_c0$12);
266
+ i0.ɵɵprojectionDef(_c0$14);
267
267
  i0.ɵɵelementStart(0, "div")(1, "nav", 0);
268
268
  i0.ɵɵprojection(2);
269
269
  i0.ɵɵprojection(3, 1);
@@ -382,12 +382,12 @@ class HeadersModule {
382
382
  }], null, null); })();
383
383
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(HeadersModule, { declarations: [PhaseComponent, HeaderBarComponent, NavigationComponent, NavigationItemComponent], imports: [CommonModule, RouterModule, i1.RpxTranslationModule], exports: [PhaseComponent, HeaderBarComponent, NavigationComponent, NavigationItemComponent] }); })();
384
384
 
385
- const _c0$11 = [[["", "topBody", ""]], [["", "leftBody", ""]], [["", "rightBody", ""]]];
385
+ const _c0$13 = [[["", "topBody", ""]], [["", "leftBody", ""]], [["", "rightBody", ""]]];
386
386
  const _c1$r = ["[topBody]", "[leftBody]", "[rightBody]"];
387
387
  class BodyComponent {
388
388
  static ɵfac = function BodyComponent_Factory(t) { return new (t || BodyComponent)(); };
389
389
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BodyComponent, selectors: [["cut-body"]], ngContentSelectors: _c1$r, decls: 4, vars: 0, consts: [[1, "global-display"]], template: function BodyComponent_Template(rf, ctx) { if (rf & 1) {
390
- i0.ɵɵprojectionDef(_c0$11);
390
+ i0.ɵɵprojectionDef(_c0$13);
391
391
  i0.ɵɵelementStart(0, "div", 0);
392
392
  i0.ɵɵprojection(1);
393
393
  i0.ɵɵprojection(2, 1);
@@ -401,7 +401,7 @@ class BodyComponent {
401
401
  }], null, null); })();
402
402
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BodyComponent, { className: "BodyComponent", filePath: "lib/components/body/body.component.ts", lineNumber: 9 }); })();
403
403
 
404
- const _c0$10 = a0 => ({ "govuk-input--error": a0 });
404
+ const _c0$12 = a0 => ({ "govuk-input--error": a0 });
405
405
  function DateInputComponent_div_19_Template(rf, ctx) { if (rf & 1) {
406
406
  const _r5 = i0.ɵɵgetCurrentView();
407
407
  i0.ɵɵelementStart(0, "div", 15)(1, "label", 8);
@@ -418,7 +418,7 @@ function DateInputComponent_div_19_Template(rf, ctx) { if (rf & 1) {
418
418
  i0.ɵɵadvance();
419
419
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 6, "Hour"));
420
420
  i0.ɵɵadvance(2);
421
- i0.ɵɵproperty("id", ctx_r6.hourId())("name", ctx_r6.hourId())("value", ctx_r6.displayHour)("ngClass", i0.ɵɵpureFunction1(8, _c0$10, ctx_r6.isInvalid));
421
+ i0.ɵɵproperty("id", ctx_r6.hourId())("name", ctx_r6.hourId())("value", ctx_r6.displayHour)("ngClass", i0.ɵɵpureFunction1(8, _c0$12, ctx_r6.isInvalid));
422
422
  } }
423
423
  function DateInputComponent_div_20_Template(rf, ctx) { if (rf & 1) {
424
424
  const _r8 = i0.ɵɵgetCurrentView();
@@ -436,7 +436,7 @@ function DateInputComponent_div_20_Template(rf, ctx) { if (rf & 1) {
436
436
  i0.ɵɵadvance();
437
437
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 6, "Minute"));
438
438
  i0.ɵɵadvance(2);
439
- i0.ɵɵproperty("id", ctx_r6.minuteId())("name", ctx_r6.minuteId())("value", ctx_r6.displayMinute)("ngClass", i0.ɵɵpureFunction1(8, _c0$10, ctx_r6.isInvalid));
439
+ i0.ɵɵproperty("id", ctx_r6.minuteId())("name", ctx_r6.minuteId())("value", ctx_r6.displayMinute)("ngClass", i0.ɵɵpureFunction1(8, _c0$12, ctx_r6.isInvalid));
440
440
  } }
441
441
  function DateInputComponent_div_21_Template(rf, ctx) { if (rf & 1) {
442
442
  const _r10 = i0.ɵɵgetCurrentView();
@@ -454,7 +454,7 @@ function DateInputComponent_div_21_Template(rf, ctx) { if (rf & 1) {
454
454
  i0.ɵɵadvance();
455
455
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 6, "Second"));
456
456
  i0.ɵɵadvance(2);
457
- i0.ɵɵproperty("id", ctx_r6.secondId())("name", ctx_r6.secondId())("value", ctx_r6.displaySecond)("ngClass", i0.ɵɵpureFunction1(8, _c0$10, ctx_r6.isInvalid));
457
+ i0.ɵɵproperty("id", ctx_r6.secondId())("name", ctx_r6.secondId())("value", ctx_r6.displaySecond)("ngClass", i0.ɵɵpureFunction1(8, _c0$12, ctx_r6.isInvalid));
458
458
  } }
459
459
  class DateInputComponent {
460
460
  id;
@@ -689,19 +689,19 @@ class DateInputComponent {
689
689
  i0.ɵɵadvance();
690
690
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 21, "Day"));
691
691
  i0.ɵɵadvance(2);
692
- i0.ɵɵproperty("id", ctx.dayId())("name", ctx.dayId())("value", ctx.displayDay)("ngClass", i0.ɵɵpureFunction1(27, _c0$10, ctx.isInvalid));
692
+ i0.ɵɵproperty("id", ctx.dayId())("name", ctx.dayId())("value", ctx.displayDay)("ngClass", i0.ɵɵpureFunction1(27, _c0$12, ctx.isInvalid));
693
693
  i0.ɵɵadvance(3);
694
694
  i0.ɵɵproperty("for", ctx.monthId());
695
695
  i0.ɵɵadvance();
696
696
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(10, 23, "Month"));
697
697
  i0.ɵɵadvance(2);
698
- i0.ɵɵproperty("id", ctx.monthId())("name", ctx.monthId())("value", ctx.displayMonth)("ngClass", i0.ɵɵpureFunction1(29, _c0$10, ctx.isInvalid));
698
+ i0.ɵɵproperty("id", ctx.monthId())("name", ctx.monthId())("value", ctx.displayMonth)("ngClass", i0.ɵɵpureFunction1(29, _c0$12, ctx.isInvalid));
699
699
  i0.ɵɵadvance(3);
700
700
  i0.ɵɵproperty("for", ctx.yearId());
701
701
  i0.ɵɵadvance();
702
702
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(16, 25, "Year"));
703
703
  i0.ɵɵadvance(2);
704
- i0.ɵɵproperty("id", ctx.yearId())("name", ctx.yearId())("value", ctx.displayYear)("ngClass", i0.ɵɵpureFunction1(31, _c0$10, ctx.isInvalid));
704
+ i0.ɵɵproperty("id", ctx.yearId())("name", ctx.yearId())("value", ctx.displayYear)("ngClass", i0.ɵɵpureFunction1(31, _c0$12, ctx.isInvalid));
705
705
  i0.ɵɵadvance(2);
706
706
  i0.ɵɵproperty("ngIf", ctx.isDateTime);
707
707
  i0.ɵɵadvance();
@@ -737,7 +737,7 @@ class DateInputComponent {
737
737
  }] }); })();
738
738
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DateInputComponent, { className: "DateInputComponent", filePath: "lib/components/form/date-input/date-input.component.ts", lineNumber: 20 }); })();
739
739
 
740
- const _c0$$ = ["*"];
740
+ const _c0$11 = ["*"];
741
741
  function AlertComponent_ng_container_2_Template(rf, ctx) { if (rf & 1) {
742
742
  i0.ɵɵelementContainerStart(0);
743
743
  i0.ɵɵnamespaceSVG();
@@ -787,7 +787,7 @@ class AlertComponent {
787
787
  showIcon = true;
788
788
  alertMessageType = AlertMessageType;
789
789
  static ɵfac = function AlertComponent_Factory(t) { return new (t || AlertComponent)(); };
790
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AlertComponent, selectors: [["cut-alert"]], inputs: { type: "type", showIcon: "showIcon" }, ngContentSelectors: _c0$$, decls: 11, vars: 12, consts: [[1, "hmcts-banner"], [3, "ngSwitch"], [4, "ngSwitchCase"], [1, "hmcts-banner__message"], [1, "hmcts-banner__assistive"], ["fill", "currentColor", "role", "presentation", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "25", "width", "25", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], ["d", "M25,6.2L8.7,23.2L0,14.1l4-4.2l4.7,4.9L21,2L25,6.2z"], ["d", "M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8\n C13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z"]], template: function AlertComponent_Template(rf, ctx) { if (rf & 1) {
790
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AlertComponent, selectors: [["cut-alert"]], inputs: { type: "type", showIcon: "showIcon" }, ngContentSelectors: _c0$11, decls: 11, vars: 12, consts: [[1, "hmcts-banner"], [3, "ngSwitch"], [4, "ngSwitchCase"], [1, "hmcts-banner__message"], [1, "hmcts-banner__assistive"], ["fill", "currentColor", "role", "presentation", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "25", "width", "25", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], ["d", "M25,6.2L8.7,23.2L0,14.1l4-4.2l4.7,4.9L21,2L25,6.2z"], ["d", "M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8\n C13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z"]], template: function AlertComponent_Template(rf, ctx) { if (rf & 1) {
791
791
  i0.ɵɵprojectionDef();
792
792
  i0.ɵɵelementStart(0, "div", 0);
793
793
  i0.ɵɵelementContainerStart(1, 1);
@@ -1000,14 +1000,14 @@ class NotificationBannerComponent {
1000
1000
  }] }); })();
1001
1001
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(NotificationBannerComponent, { className: "NotificationBannerComponent", filePath: "lib/components/banners/notification-banner/notification-banner.component.ts", lineNumber: 10 }); })();
1002
1002
 
1003
- const _c0$_ = ["*"];
1003
+ const _c0$10 = ["*"];
1004
1004
  const _c1$q = a0 => ({ "js-hidden": a0 });
1005
1005
  class TabComponent {
1006
1006
  id;
1007
1007
  title;
1008
1008
  selected;
1009
1009
  static ɵfac = function TabComponent_Factory(t) { return new (t || TabComponent)(); };
1010
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TabComponent, selectors: [["cut-tab"]], inputs: { id: "id", title: "title", selected: "selected" }, ngContentSelectors: _c0$_, decls: 2, vars: 5, consts: [["role", "tabpanel", 1, "tabs-panel", 3, "id", "ngClass"]], template: function TabComponent_Template(rf, ctx) { if (rf & 1) {
1010
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TabComponent, selectors: [["cut-tab"]], inputs: { id: "id", title: "title", selected: "selected" }, ngContentSelectors: _c0$10, decls: 2, vars: 5, consts: [["role", "tabpanel", 1, "tabs-panel", 3, "id", "ngClass"]], template: function TabComponent_Template(rf, ctx) { if (rf & 1) {
1011
1011
  i0.ɵɵprojectionDef();
1012
1012
  i0.ɵɵelementStart(0, "div", 0);
1013
1013
  i0.ɵɵprojection(1);
@@ -1029,7 +1029,7 @@ class TabComponent {
1029
1029
  }] }); })();
1030
1030
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TabComponent, { className: "TabComponent", filePath: "lib/components/tabs/tab.component.ts", lineNumber: 10 }); })();
1031
1031
 
1032
- const _c0$Z = ["tab"];
1032
+ const _c0$$ = ["tab"];
1033
1033
  const _c1$p = ["*"];
1034
1034
  const _c2$4 = () => ["."];
1035
1035
  const _c3 = a0 => ({ "tabs-toggle-selected": a0 });
@@ -1076,7 +1076,7 @@ class TabsComponent {
1076
1076
  let _t;
1077
1077
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.panels = _t);
1078
1078
  } }, viewQuery: function TabsComponent_Query(rf, ctx) { if (rf & 1) {
1079
- i0.ɵɵviewQuery(_c0$Z, 5);
1079
+ i0.ɵɵviewQuery(_c0$$, 5);
1080
1080
  } if (rf & 2) {
1081
1081
  let _t;
1082
1082
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tabs = _t);
@@ -1135,7 +1135,7 @@ class TabsModule {
1135
1135
  RouterModule, i1.RpxTranslationModule], exports: [TabsComponent,
1136
1136
  TabComponent] }); })();
1137
1137
 
1138
- const _c0$Y = (a0, a1) => ({ caseLocked: a0, someoneViewing: a1 });
1138
+ const _c0$_ = (a0, a1) => ({ caseLocked: a0, someoneViewing: a1 });
1139
1139
  class ActivityBannerComponent {
1140
1140
  bannerType;
1141
1141
  description;
@@ -1154,7 +1154,7 @@ class ActivityBannerComponent {
1154
1154
  i0.ɵɵpipe(6, "rpxTranslate");
1155
1155
  i0.ɵɵelementEnd()();
1156
1156
  } if (rf & 2) {
1157
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(8, _c0$Y, ctx.bannerType === "editor", ctx.bannerType === "viewer"));
1157
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(8, _c0$_, ctx.bannerType === "editor", ctx.bannerType === "viewer"));
1158
1158
  i0.ɵɵadvance(2);
1159
1159
  i0.ɵɵpropertyInterpolate("alt", i0.ɵɵpipeBind1(3, 4, ctx.description));
1160
1160
  i0.ɵɵpropertyInterpolate("src", ctx.imageLink, i0.ɵɵsanitizeUrl);
@@ -7053,6 +7053,118 @@ class FormErrorService {
7053
7053
  type: Injectable
7054
7054
  }], null, null); })();
7055
7055
 
7056
+ class MultipageComponentStateService {
7057
+ //is journey at start will help keep track of the progress through the journey.
7058
+ isJourneyAtStart = false;
7059
+ //journey collection references an upto date list of all the journey components currently rendered!!!!
7060
+ journeyCollection = new Array();
7061
+ //the instigator references the case-edit-page component that will invoke the next and previous methods
7062
+ instigator = null;
7063
+ //each journey will store its state here. this could include form data if needed
7064
+ journeyState = new Map();
7065
+ //setJourneyComponent will be called by the app component to update the journey collection
7066
+ setJourneyCollection(journeyCollection) {
7067
+ this.journeyCollection = journeyCollection;
7068
+ }
7069
+ //getJourneyCollection will be called by the app component to get the journey collection
7070
+ getJourneyCollection() {
7071
+ return this.journeyCollection;
7072
+ }
7073
+ //addToJourneyCollection will be called from the journey
7074
+ addTojourneyCollection(journey) {
7075
+ this.journeyCollection.push(journey);
7076
+ }
7077
+ //resetJourneyCollection will be called
7078
+ resetJourneyCollection() {
7079
+ this.journeyCollection = [];
7080
+ }
7081
+ //setInstigator will be called by the app component to update the instigator
7082
+ setInstigator(instigator) {
7083
+ this.instigator = instigator;
7084
+ }
7085
+ //getInstigator will be called by the app component to get the instigator
7086
+ getInstigator() {
7087
+ return this.instigator;
7088
+ }
7089
+ //setJourneyState will be called by the journey component to update the journey state
7090
+ setJourneyState(journey) {
7091
+ this.journeyState.set(journey.journeyId, journey);
7092
+ }
7093
+ //getJourneyState will be called by the journey component to get the journey state
7094
+ getJourneyState(journey) {
7095
+ return this.journeyState.get(journey.journeyId) || null;
7096
+ }
7097
+ //resetJourneyState will be called by the journey component to reset the journey state
7098
+ resetJourneyState() {
7099
+ this.journeyState.clear();
7100
+ }
7101
+ //reset will be called to ensure that the entire state is reset
7102
+ reset() {
7103
+ this.isJourneyAtStart = false;
7104
+ this.journeyState.clear();
7105
+ this.instigator = null;
7106
+ this.journeyCollection = [];
7107
+ }
7108
+ //next will be called by the instigator that will invoke the next method of the journey component that will invoke the next method of the childpage component
7109
+ next() {
7110
+ if (this.journeyCollection.length <= 0) {
7111
+ this.instigator?.onFinalNext();
7112
+ return;
7113
+ }
7114
+ const isAnyObjectNotFinished = this.journeyCollection.some((journey) => !journey.isFinished());
7115
+ if (!isAnyObjectNotFinished) {
7116
+ this.instigator?.onFinalNext();
7117
+ return;
7118
+ }
7119
+ for (const journey of this.journeyCollection) {
7120
+ if (!journey) {
7121
+ continue;
7122
+ }
7123
+ if (!journey?.isFinished()) {
7124
+ journey?.next();
7125
+ break;
7126
+ }
7127
+ }
7128
+ }
7129
+ //previous will be called by the instigator that will invoke the previous method of the journey component that will invoke the previous method of the childpage component
7130
+ previous() {
7131
+ if (this.journeyCollection.length <= 0) {
7132
+ this.instigator?.onFinalPrevious();
7133
+ return;
7134
+ }
7135
+ const isAnyObjectNotAtStart = this.journeyCollection.some((journey) => !journey.isStart());
7136
+ if (!isAnyObjectNotAtStart) {
7137
+ this.instigator?.onFinalPrevious();
7138
+ return;
7139
+ }
7140
+ for (const journey of this.journeyCollection.slice().reverse()) {
7141
+ if (!journey) {
7142
+ continue;
7143
+ }
7144
+ if (!journey?.isStart()) {
7145
+ journey?.previous();
7146
+ break;
7147
+ }
7148
+ }
7149
+ }
7150
+ //isAtStart can be used to inform the instigator if we're at the start.
7151
+ get isAtStart() {
7152
+ return this.isJourneyAtStart;
7153
+ }
7154
+ //isAtStart can be used to update the value from a journey object, so the instigator knows.
7155
+ set isAtStart(isAtStart) {
7156
+ this.isJourneyAtStart = isAtStart;
7157
+ }
7158
+ static ɵfac = function MultipageComponentStateService_Factory(t) { return new (t || MultipageComponentStateService)(); };
7159
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MultipageComponentStateService, factory: MultipageComponentStateService.ɵfac, providedIn: 'root' });
7160
+ }
7161
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MultipageComponentStateService, [{
7162
+ type: Injectable,
7163
+ args: [{
7164
+ providedIn: 'root'
7165
+ }]
7166
+ }], null, null); })();
7167
+
7056
7168
  class JurisdictionService {
7057
7169
  httpService;
7058
7170
  // We retain the Subject observable because subscribing code couldn't happen a null value
@@ -10076,6 +10188,149 @@ function initDialog() {
10076
10188
  return dialogConfig;
10077
10189
  }
10078
10190
 
10191
+ class LinkedCasesService {
10192
+ jurisdictionService;
10193
+ searchService;
10194
+ static CASE_NAME_MISSING_TEXT = 'Case name missing';
10195
+ caseFieldValue = [];
10196
+ isLinkedCasesEventTrigger = false;
10197
+ caseDetails;
10198
+ caseId;
10199
+ caseName;
10200
+ linkCaseReasons = [];
10201
+ linkedCases = [];
10202
+ initialCaseLinks = [];
10203
+ editMode = false;
10204
+ jurisdictionsResponse = [];
10205
+ serverJurisdictionError;
10206
+ serverError = null;
10207
+ serverLinkedApiError = null;
10208
+ isServerReasonCodeError = false;
10209
+ caseJurisdictionID = null;
10210
+ storedCaseNumber = '';
10211
+ cameFromFinalStep = false;
10212
+ hasNavigatedInJourney = false;
10213
+ constructor(jurisdictionService, searchService) {
10214
+ this.jurisdictionService = jurisdictionService;
10215
+ this.searchService = searchService;
10216
+ this.jurisdictionService.getJurisdictions().subscribe((jurisdictions) => {
10217
+ this.jurisdictionsResponse = jurisdictions;
10218
+ }, (error) => {
10219
+ this.serverJurisdictionError = true;
10220
+ });
10221
+ }
10222
+ groupLinkedCasesByCaseType = (arrObj, key) => {
10223
+ return arrObj.reduce((rv, x) => {
10224
+ (rv[x.value[key]] = rv[x.value[key]] || []).push(x.value['CaseReference']);
10225
+ return rv;
10226
+ }, {});
10227
+ };
10228
+ constructElasticSearchQuery(caseIds, size) {
10229
+ return {
10230
+ query: {
10231
+ terms: {
10232
+ reference: caseIds,
10233
+ },
10234
+ },
10235
+ size,
10236
+ };
10237
+ }
10238
+ resetLinkedCaseData() {
10239
+ this.caseFieldValue = [];
10240
+ this.linkedCases = [];
10241
+ this.storedCaseNumber = '';
10242
+ this.cameFromFinalStep = false;
10243
+ this.hasNavigatedInJourney = false;
10244
+ }
10245
+ mapResponse(esSearchCasesResponse) {
10246
+ const caseInfo = this.caseFieldValue.find(item => item.value && item.value.CaseReference === esSearchCasesResponse.case_id);
10247
+ return caseInfo && {
10248
+ caseReference: esSearchCasesResponse.case_id,
10249
+ caseName: esSearchCasesResponse.case_fields.caseNameHmctsInternal || LinkedCasesService.CASE_NAME_MISSING_TEXT,
10250
+ caseType: this.mapLookupIDToValueFromJurisdictions('CASE_TYPE', esSearchCasesResponse.case_fields['[CASE_TYPE]']),
10251
+ service: this.mapLookupIDToValueFromJurisdictions('JURISDICTION', esSearchCasesResponse.case_fields['[JURISDICTION]']),
10252
+ state: this.mapLookupIDToValueFromJurisdictions('STATE', esSearchCasesResponse.case_fields['[STATE]']),
10253
+ reasons: caseInfo?.value?.ReasonForLink
10254
+ };
10255
+ }
10256
+ searchCasesByCaseIds(searchCasesResponse) {
10257
+ return forkJoin(searchCasesResponse);
10258
+ }
10259
+ getAllLinkedCaseInformation() {
10260
+ const searchCasesResponse = [];
10261
+ const linkedCaseIds = this.groupLinkedCasesByCaseType(this.caseFieldValue, 'CaseType');
10262
+ Object.keys(linkedCaseIds).forEach(key => {
10263
+ const esQuery = this.constructElasticSearchQuery(linkedCaseIds[key], 100);
10264
+ const query = this.searchService.searchCasesByIds(key, esQuery, SearchService.VIEW_WORKBASKET);
10265
+ searchCasesResponse.push(query);
10266
+ });
10267
+ if (searchCasesResponse.length) {
10268
+ this.searchCasesByCaseIds(searchCasesResponse).subscribe((searchCases) => {
10269
+ const casesResponse = [];
10270
+ searchCases.forEach(response => {
10271
+ response.results.forEach((result) => {
10272
+ casesResponse.push(this.mapResponse(result));
10273
+ });
10274
+ });
10275
+ this.linkedCases = casesResponse.map(item => {
10276
+ return {
10277
+ caseReference: item.caseReference,
10278
+ caseName: item.caseName,
10279
+ caseService: item.service,
10280
+ caseType: item.caseType,
10281
+ unlink: false,
10282
+ reasons: item.reasons && item.reasons.map(reason => {
10283
+ return {
10284
+ Reason: reason
10285
+ };
10286
+ }),
10287
+ };
10288
+ });
10289
+ this.serverLinkedApiError = null;
10290
+ }, err => {
10291
+ this.serverLinkedApiError = {
10292
+ id: 'backendError', message: 'Some case information is not available at the moment'
10293
+ };
10294
+ });
10295
+ }
10296
+ }
10297
+ mapLookupIDToValueFromJurisdictions(fieldName, fieldValue) {
10298
+ const selectedJurisdiction = this.jurisdictionsResponse &&
10299
+ this.jurisdictionsResponse.find(item => item.id === this.caseDetails.case_type.jurisdiction.id);
10300
+ const selectedCaseType = selectedJurisdiction && selectedJurisdiction.caseTypes.find(item => item.id === this.caseDetails.case_type.id);
10301
+ const state = selectedCaseType && selectedCaseType.states.find(item => item.id === fieldValue);
10302
+ switch (fieldName) {
10303
+ case 'JURISDICTION':
10304
+ return selectedJurisdiction && selectedJurisdiction.description;
10305
+ case 'CASE_TYPE':
10306
+ return selectedCaseType && selectedCaseType.name;
10307
+ case 'CASE_TYPE_DESCRIPTION':
10308
+ return selectedCaseType && selectedCaseType.description;
10309
+ case 'STATE':
10310
+ return state && state.name || fieldValue;
10311
+ case 'STATE_DESCRIPTION':
10312
+ return state && state.description || fieldValue;
10313
+ default:
10314
+ break;
10315
+ }
10316
+ }
10317
+ getCaseName(searchCasesResponse) {
10318
+ let caseName = LinkedCasesService.CASE_NAME_MISSING_TEXT;
10319
+ const tabs = searchCasesResponse.tabs.filter(tab => {
10320
+ const caseNameHmctsInternalField = tab.fields.find(field => field.id === 'caseNameHmctsInternal');
10321
+ if (caseNameHmctsInternalField) {
10322
+ caseName = caseNameHmctsInternalField.value;
10323
+ }
10324
+ });
10325
+ return caseName;
10326
+ }
10327
+ static ɵfac = function LinkedCasesService_Factory(t) { return new (t || LinkedCasesService)(i0.ɵɵinject(JurisdictionService), i0.ɵɵinject(SearchService)); };
10328
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LinkedCasesService, factory: LinkedCasesService.ɵfac });
10329
+ }
10330
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LinkedCasesService, [{
10331
+ type: Injectable
10332
+ }], () => [{ type: JurisdictionService }, { type: SearchService }], null); })();
10333
+
10079
10334
  function CaseEditPageComponent_ng_container_0_h1_1_Template(rf, ctx) { if (rf & 1) {
10080
10335
  i0.ɵɵelementStart(0, "h1", 11);
10081
10336
  i0.ɵɵtext(1);
@@ -10192,28 +10447,37 @@ function CaseEditPageComponent_form_10_div_4_Template(rf, ctx) { if (rf & 1) {
10192
10447
  i0.ɵɵadvance(2);
10193
10448
  i0.ɵɵproperty("fields", ctx_r1.currentPage.getCol2Fields())("formGroup", ctx_r1.editForm.controls["data"])("caseFields", ctx_r1.caseFields);
10194
10449
  } }
10450
+ function CaseEditPageComponent_form_10_button_6_Template(rf, ctx) { if (rf & 1) {
10451
+ const _r7 = i0.ɵɵgetCurrentView();
10452
+ i0.ɵɵelementStart(0, "button", 38);
10453
+ i0.ɵɵlistener("click", function CaseEditPageComponent_form_10_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.toPreviousPage()); });
10454
+ i0.ɵɵtext(1);
10455
+ i0.ɵɵpipe(2, "rpxTranslate");
10456
+ i0.ɵɵelementEnd();
10457
+ } if (rf & 2) {
10458
+ const ctx_r1 = i0.ɵɵnextContext(2);
10459
+ i0.ɵɵproperty("disabled", ctx_r1.isAtStart());
10460
+ i0.ɵɵadvance();
10461
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 2, "Previous"), " ");
10462
+ } }
10195
10463
  function CaseEditPageComponent_form_10_Template(rf, ctx) { if (rf & 1) {
10196
10464
  const _r5 = i0.ɵɵgetCurrentView();
10197
10465
  i0.ɵɵelementStart(0, "form", 22);
10198
- i0.ɵɵlistener("submit", function CaseEditPageComponent_form_10_Template_form_submit_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.submit()); });
10466
+ i0.ɵɵlistener("submit", function CaseEditPageComponent_form_10_Template_form_submit_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.nextStep()); });
10199
10467
  i0.ɵɵelementStart(1, "fieldset", 23);
10200
10468
  i0.ɵɵelement(2, "legend", 24);
10201
10469
  i0.ɵɵtemplate(3, CaseEditPageComponent_form_10_ccd_case_edit_form_3_Template, 1, 4, "ccd-case-edit-form", 25)(4, CaseEditPageComponent_form_10_div_4_Template, 5, 6, "div", 26);
10202
10470
  i0.ɵɵelementEnd();
10203
- i0.ɵɵelementStart(5, "div", 27)(6, "button", 28);
10204
- i0.ɵɵpipe(7, "async");
10205
- i0.ɵɵlistener("click", function CaseEditPageComponent_form_10_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.toPreviousPage()); });
10471
+ i0.ɵɵelementStart(5, "div", 27);
10472
+ i0.ɵɵtemplate(6, CaseEditPageComponent_form_10_button_6_Template, 3, 4, "button", 28);
10473
+ i0.ɵɵelementStart(7, "button", 29);
10206
10474
  i0.ɵɵtext(8);
10207
10475
  i0.ɵɵpipe(9, "rpxTranslate");
10208
- i0.ɵɵelementEnd();
10209
- i0.ɵɵelementStart(10, "button", 29);
10210
- i0.ɵɵtext(11);
10211
- i0.ɵɵpipe(12, "rpxTranslate");
10212
10476
  i0.ɵɵelementEnd()();
10213
- i0.ɵɵelementStart(13, "p", 30)(14, "a", 31);
10214
- i0.ɵɵlistener("click", function CaseEditPageComponent_form_10_Template_a_click_14_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.cancel()); });
10215
- i0.ɵɵtext(15);
10216
- i0.ɵɵpipe(16, "rpxTranslate");
10477
+ i0.ɵɵelementStart(10, "p", 30)(11, "a", 31);
10478
+ i0.ɵɵlistener("click", function CaseEditPageComponent_form_10_Template_a_click_11_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.cancel()); });
10479
+ i0.ɵɵtext(12);
10480
+ i0.ɵɵpipe(13, "rpxTranslate");
10217
10481
  i0.ɵɵelementEnd()()();
10218
10482
  } if (rf & 2) {
10219
10483
  const ctx_r1 = i0.ɵɵnextContext();
@@ -10223,20 +10487,18 @@ function CaseEditPageComponent_form_10_Template(rf, ctx) { if (rf & 1) {
10223
10487
  i0.ɵɵadvance();
10224
10488
  i0.ɵɵproperty("ngIf", ctx_r1.currentPage.isMultiColumn());
10225
10489
  i0.ɵɵadvance(2);
10226
- i0.ɵɵproperty("disabled", !i0.ɵɵpipeBind1(7, 8, ctx_r1.hasPreviousPage$));
10227
- i0.ɵɵadvance(2);
10228
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(9, 10, "Previous"), " ");
10229
- i0.ɵɵadvance(2);
10490
+ i0.ɵɵproperty("ngIf", !ctx_r1.isAtStart());
10491
+ i0.ɵɵadvance();
10230
10492
  i0.ɵɵproperty("disabled", ctx_r1.submitting());
10231
10493
  i0.ɵɵadvance();
10232
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(12, 12, ctx_r1.triggerText));
10494
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(9, 7, ctx_r1.triggerText));
10233
10495
  i0.ɵɵadvance(4);
10234
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(16, 14, ctx_r1.getCancelText()));
10496
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(13, 9, ctx_r1.getCancelText()));
10235
10497
  } }
10236
10498
  function CaseEditPageComponent_ccd_case_event_completion_11_Template(rf, ctx) { if (rf & 1) {
10237
- const _r7 = i0.ɵɵgetCurrentView();
10238
- i0.ɵɵelementStart(0, "ccd-case-event-completion", 38);
10239
- i0.ɵɵlistener("eventCanBeCompleted", function CaseEditPageComponent_ccd_case_event_completion_11_Template_ccd_case_event_completion_eventCanBeCompleted_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onEventCanBeCompleted($event)); });
10499
+ const _r8 = i0.ɵɵgetCurrentView();
10500
+ i0.ɵɵelementStart(0, "ccd-case-event-completion", 39);
10501
+ i0.ɵɵlistener("eventCanBeCompleted", function CaseEditPageComponent_ccd_case_event_completion_11_Template_ccd_case_event_completion_eventCanBeCompleted_0_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onEventCanBeCompleted($event)); });
10240
10502
  i0.ɵɵelementEnd();
10241
10503
  } if (rf & 2) {
10242
10504
  const ctx_r1 = i0.ɵɵnextContext();
@@ -10254,7 +10516,9 @@ class CaseEditPageComponent {
10254
10516
  caseEditDataService;
10255
10517
  loadingService;
10256
10518
  validPageListCaseFieldsService;
10519
+ multipageComponentStateService;
10257
10520
  addressService;
10521
+ linkedCasesService;
10258
10522
  static RESUMED_FORM_DISCARD = 'RESUMED_FORM_DISCARD';
10259
10523
  static NEW_FORM_DISCARD = 'NEW_FORM_DISCARD';
10260
10524
  static NEW_FORM_SAVE = 'NEW_FORM_CHANGED_SAVE';
@@ -10295,7 +10559,7 @@ class CaseEditPageComponent {
10295
10559
  topContainer.focus();
10296
10560
  }
10297
10561
  }
10298
- constructor(caseEdit, route, formValueService, formErrorService, cdRef, pageValidationService, dialog, caseFieldService, caseEditDataService, loadingService, validPageListCaseFieldsService, addressService) {
10562
+ constructor(caseEdit, route, formValueService, formErrorService, cdRef, pageValidationService, dialog, caseFieldService, caseEditDataService, loadingService, validPageListCaseFieldsService, multipageComponentStateService, addressService, linkedCasesService) {
10299
10563
  this.caseEdit = caseEdit;
10300
10564
  this.route = route;
10301
10565
  this.formValueService = formValueService;
@@ -10307,7 +10571,30 @@ class CaseEditPageComponent {
10307
10571
  this.caseEditDataService = caseEditDataService;
10308
10572
  this.loadingService = loadingService;
10309
10573
  this.validPageListCaseFieldsService = validPageListCaseFieldsService;
10574
+ this.multipageComponentStateService = multipageComponentStateService;
10310
10575
  this.addressService = addressService;
10576
+ this.linkedCasesService = linkedCasesService;
10577
+ this.multipageComponentStateService.setInstigator(this);
10578
+ }
10579
+ onFinalNext() {
10580
+ this.submit();
10581
+ }
10582
+ onFinalPrevious() {
10583
+ this.cancel();
10584
+ }
10585
+ isAtStart() {
10586
+ return this.multipageComponentStateService.getJourneyCollection()[0]?.journeyPageNumber === this.multipageComponentStateService.getJourneyCollection()[0]?.journeyStartPageNumber;
10587
+ }
10588
+ isAtEnd() {
10589
+ return this.multipageComponentStateService.getJourneyCollection()[0]?.journeyPageNumber === this.multipageComponentStateService.getJourneyCollection()[0]?.journeyEndPageNumber;
10590
+ }
10591
+ // This method will be triggered by the next button in the app component
10592
+ nextStep() {
10593
+ this.multipageComponentStateService.next();
10594
+ }
10595
+ // This method will be triggered by the previous button in the app component
10596
+ previousStep() {
10597
+ this.multipageComponentStateService.previous();
10311
10598
  }
10312
10599
  ngOnInit() {
10313
10600
  initDialog();
@@ -10366,6 +10653,7 @@ class CaseEditPageComponent {
10366
10653
  this.dialogRefAfterClosedSub?.unsubscribe();
10367
10654
  this.saveDraftSub?.unsubscribe();
10368
10655
  this.caseFormValidationErrorsSub?.unsubscribe();
10656
+ this.multipageComponentStateService.reset();
10369
10657
  }
10370
10658
  applyValuesChanged(valuesChanged) {
10371
10659
  this.formValuesChanged = valuesChanged;
@@ -10392,6 +10680,7 @@ class CaseEditPageComponent {
10392
10680
  caseEventData.data = caseEventData.event_data;
10393
10681
  this.updateFormData(caseEventData);
10394
10682
  this.previous();
10683
+ this.previousStep();
10395
10684
  CaseEditPageComponent.setFocusToTop();
10396
10685
  }
10397
10686
  // Adding validation message to show it as Error Summary
@@ -10510,8 +10799,20 @@ class CaseEditPageComponent {
10510
10799
  }
10511
10800
  }
10512
10801
  }
10802
+ checkForStagesCompleted() {
10803
+ const dataControls = this.editForm.controls['data'];
10804
+ if (dataControls) {
10805
+ const flagLauncher = dataControls.get('flagLauncherInternal');
10806
+ if (flagLauncher) {
10807
+ if (flagLauncher.hasError('notAllCaseFlagStagesCompleted') && this.isAtEnd()) {
10808
+ flagLauncher.setErrors(null);
10809
+ }
10810
+ }
10811
+ }
10812
+ }
10513
10813
  submit() {
10514
10814
  this.caseEditDataService.clearFormValidationErrors();
10815
+ this.checkForStagesCompleted();
10515
10816
  if (this.currentPageIsNotValid()) {
10516
10817
  // The generateErrorMessage method filters out the hidden fields.
10517
10818
  // The error message for LinkedCases journey will never get displayed because the
@@ -10642,6 +10943,9 @@ class CaseEditPageComponent {
10642
10943
  return this.caseEdit.hasPrevious(this.currentPage.id);
10643
10944
  }
10644
10945
  cancel() {
10946
+ if (this.isLinkedCasesJourney()) {
10947
+ this.linkedCasesService.resetLinkedCaseData();
10948
+ }
10645
10949
  if (this.eventTrigger.can_save_draft) {
10646
10950
  if (this.formValuesChanged) {
10647
10951
  const dialogRef = this.dialog.open(SaveOrDiscardDialogComponent, this.dialogConfig);
@@ -10668,6 +10972,7 @@ class CaseEditPageComponent {
10668
10972
  this.caseEdit.cancelled.emit();
10669
10973
  }
10670
10974
  this.caseEditDataService.clearFormValidationErrors();
10975
+ this.multipageComponentStateService.reset();
10671
10976
  }
10672
10977
  submitting() {
10673
10978
  return this.caseEdit.isSubmitting;
@@ -10820,8 +11125,8 @@ class CaseEditPageComponent {
10820
11125
  }
10821
11126
  });
10822
11127
  }
10823
- static ɵfac = function CaseEditPageComponent_Factory(t) { return new (t || CaseEditPageComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(PageValidationService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(AddressesService)); };
10824
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditPageComponent, selectors: [["ccd-case-edit-page"]], decls: 12, vars: 11, consts: [["titleBlock", ""], ["idBlock", ""], [4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "callbackErrorsContext", "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject"], [1, "width-50"], ["class", "form", 3, "formGroup", "submit", 4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], ["class", "govuk-heading-l", 4, "ngIf"], [1, "govuk-heading-l"], [1, "govuk-caption-l"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form", 3, "submit", "formGroup"], ["id", "fieldset-case-data"], [2, "display", "none"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["href", "javascript:void(0)", 3, "click"], ["id", "caseEditForm", 3, "valuesChanged", "fields", "formGroup", "caseFields", "pageChangeSubject"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditPageComponent_Template(rf, ctx) { if (rf & 1) {
11128
+ static ɵfac = function CaseEditPageComponent_Factory(t) { return new (t || CaseEditPageComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(PageValidationService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(MultipageComponentStateService), i0.ɵɵdirectiveInject(AddressesService), i0.ɵɵdirectiveInject(LinkedCasesService)); };
11129
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditPageComponent, selectors: [["ccd-case-edit-page"]], decls: 12, vars: 11, consts: [["titleBlock", ""], ["idBlock", ""], [4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "callbackErrorsContext", "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject"], [1, "width-50"], ["class", "form", 3, "formGroup", "submit", 4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], ["class", "govuk-heading-l", 4, "ngIf"], [1, "govuk-heading-l"], [1, "govuk-caption-l"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form", 3, "submit", "formGroup"], ["id", "fieldset-case-data"], [2, "display", "none"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["href", "javascript:void(0)", 3, "click"], ["id", "caseEditForm", 3, "valuesChanged", "fields", "formGroup", "caseFields", "pageChangeSubject"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditPageComponent_Template(rf, ctx) { if (rf & 1) {
10825
11130
  const _r1 = i0.ɵɵgetCurrentView();
10826
11131
  i0.ɵɵtemplate(0, CaseEditPageComponent_ng_container_0_Template, 3, 2, "ng-container", 2)(1, CaseEditPageComponent_div_1_Template, 1, 0, "div", 3)(2, CaseEditPageComponent_ng_template_2_Template, 2, 5, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(4, CaseEditPageComponent_ng_template_4_Template, 1, 1, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor)(6, CaseEditPageComponent_div_6_Template, 5, 4, "div", 4);
10827
11132
  i0.ɵɵelement(7, "ccd-case-edit-generic-errors", 5);
@@ -10829,15 +11134,15 @@ class CaseEditPageComponent {
10829
11134
  i0.ɵɵlistener("callbackErrorsContext", function CaseEditPageComponent_Template_ccd_callback_errors_callbackErrorsContext_8_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.callbackErrorsNotify($event)); });
10830
11135
  i0.ɵɵelementEnd();
10831
11136
  i0.ɵɵelementStart(9, "div", 7);
10832
- i0.ɵɵtemplate(10, CaseEditPageComponent_form_10_Template, 17, 16, "form", 8);
11137
+ i0.ɵɵtemplate(10, CaseEditPageComponent_form_10_Template, 14, 11, "form", 8);
10833
11138
  i0.ɵɵelementEnd();
10834
11139
  i0.ɵɵtemplate(11, CaseEditPageComponent_ccd_case_event_completion_11_Template, 1, 1, "ccd-case-event-completion", 9);
10835
11140
  } if (rf & 2) {
10836
- const titleBlock_r8 = i0.ɵɵreference(3);
10837
- const idBlock_r9 = i0.ɵɵreference(5);
11141
+ const titleBlock_r9 = i0.ɵɵreference(3);
11142
+ const idBlock_r10 = i0.ɵɵreference(5);
10838
11143
  i0.ɵɵproperty("ngIf", ctx.currentPage);
10839
11144
  i0.ɵɵadvance();
10840
- i0.ɵɵproperty("ngIf", ctx.getCaseTitle())("ngIfThen", titleBlock_r8)("ngIfElse", idBlock_r9);
11145
+ i0.ɵɵproperty("ngIf", ctx.getCaseTitle())("ngIfThen", titleBlock_r9)("ngIfElse", idBlock_r10);
10841
11146
  i0.ɵɵadvance(5);
10842
11147
  i0.ɵɵproperty("ngIf", ctx.validationErrors.length > 0);
10843
11148
  i0.ɵɵadvance();
@@ -10852,9 +11157,9 @@ class CaseEditPageComponent {
10852
11157
  }
10853
11158
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditPageComponent, [{
10854
11159
  type: Component,
10855
- args: [{ selector: 'ccd-case-edit-page', template: "<ng-container *ngIf=\"currentPage\">\n <h1 *ngIf=\"!currentPage.label\" class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n <ng-container *ngIf=\"currentPage.label\">\n <span class=\"govuk-caption-l\">{{ eventTrigger.name | rpxTranslate}}</span>\n <h1 class=\"govuk-heading-l\">{{currentPage.label | rpxTranslate}}</h1>\n </ng-container>\n</ng-container>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data']\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<!-- Error message summary -->\n<div *ngIf=\"validationErrors.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let validationError of validationErrors\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(validationError.id)\" class=\"validation-error\">\n {{ validationError.message | rpxTranslate: getRpxTranslatePipeArgs(validationError.label | rpxTranslate): null }}\n </a>\n </li>\n </ul>\n </div>\n</div>\n\n<ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<div class=\"width-50\">\n <form *ngIf=\"currentPage\" class=\"form\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <fieldset id=\"fieldset-case-data\">\n <legend style=\"display: none;\"></legend>\n <!-- single column -->\n <ccd-case-edit-form id='caseEditForm' *ngIf=\"!currentPage.isMultiColumn()\" [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"\n [pageChangeSubject]=\"pageChangeSubject\"\n (valuesChanged)=\"applyValuesChanged($event)\"></ccd-case-edit-form>\n <!-- two columns -->\n <div *ngIf=\"currentPage.isMultiColumn()\" class=\"grid-row\">\n <div class=\"column-two-thirds rightBorderSeparator\">\n <ccd-case-edit-form id='caseEditForm1' [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n <div class=\"column-one-third\">\n <ccd-case-edit-form id='caseEditForm2' [fields]=\"currentPage.getCol2Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n </div>\n </fieldset>\n\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" [disabled]=\"!(hasPreviousPage$ | async)\" (click)=\"toPreviousPage()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button class=\"button\" type=\"submit\" [disabled]=\"submitting()\">{{triggerText | rpxTranslate}}</button>\n </div>\n\n <p class=\"cancel\"><a (click)=\"cancel()\" href=\"javascript:void(0)\">{{getCancelText() | rpxTranslate}}</a></p>\n </form>\n</div>\n\n<ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n</ccd-case-event-completion>\n", styles: [".rightBorderSeparator{border-right-width:4px;border-right-color:#ffcc02;border-right-style:solid}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
10856
- }], () => [{ type: CaseEditComponent }, { type: i1$1.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatLegacyDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: AddressesService }], null); })();
10857
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 31 }); })();
11160
+ args: [{ selector: 'ccd-case-edit-page', template: "<ng-container *ngIf=\"currentPage\">\n <h1 *ngIf=\"!currentPage.label\" class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n <ng-container *ngIf=\"currentPage.label\">\n <span class=\"govuk-caption-l\">{{ eventTrigger.name | rpxTranslate}}</span>\n <h1 class=\"govuk-heading-l\">{{currentPage.label | rpxTranslate}}</h1>\n </ng-container>\n</ng-container>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data']\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<!-- Error message summary -->\n<div *ngIf=\"validationErrors.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let validationError of validationErrors\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(validationError.id)\" class=\"validation-error\">\n {{ validationError.message | rpxTranslate: getRpxTranslatePipeArgs(validationError.label | rpxTranslate): null }}\n </a>\n </li>\n </ul>\n </div>\n</div>\n\n<ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<div class=\"width-50\">\n <form *ngIf=\"currentPage\" class=\"form\" [formGroup]=\"editForm\" (submit)=\"nextStep()\">\n <fieldset id=\"fieldset-case-data\">\n <legend style=\"display: none;\"></legend>\n <!-- single column -->\n <ccd-case-edit-form id='caseEditForm' *ngIf=\"!currentPage.isMultiColumn()\" [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"\n [pageChangeSubject]=\"pageChangeSubject\"\n (valuesChanged)=\"applyValuesChanged($event)\"></ccd-case-edit-form>\n <!-- two columns -->\n <div *ngIf=\"currentPage.isMultiColumn()\" class=\"grid-row\">\n <div class=\"column-two-thirds rightBorderSeparator\">\n <ccd-case-edit-form id='caseEditForm1' [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n <div class=\"column-one-third\">\n <ccd-case-edit-form id='caseEditForm2' [fields]=\"currentPage.getCol2Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n </div>\n </fieldset>\n\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"toPreviousPage()\" *ngIf=\"!isAtStart()\" [disabled]=\"isAtStart()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button class=\"button\" type=\"submit\" [disabled]=\"submitting()\">{{triggerText | rpxTranslate}}</button>\n </div>\n\n <p class=\"cancel\"><a (click)=\"cancel()\" href=\"javascript:void(0)\">{{getCancelText() | rpxTranslate}}</a></p>\n </form>\n</div>\n\n<ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n</ccd-case-event-completion>\n", styles: [".rightBorderSeparator{border-right-width:4px;border-right-color:#ffcc02;border-right-style:solid}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
11161
+ }], () => [{ type: CaseEditComponent }, { type: i1$1.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatLegacyDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: MultipageComponentStateService }, { type: AddressesService }, { type: LinkedCasesService }], null); })();
11162
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 33 }); })();
10858
11163
 
10859
11164
  class CallbackErrorsContext {
10860
11165
  triggerText;
@@ -11003,7 +11308,7 @@ class CallbackErrorsComponent {
11003
11308
  }] }); })();
11004
11309
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CallbackErrorsComponent, { className: "CallbackErrorsComponent", filePath: "lib/shared/components/error/callback-errors.component.ts", lineNumber: 10 }); })();
11005
11310
 
11006
- const _c0$X = a0 => ["/", "cases", "case-details", a0, "tasks"];
11311
+ const _c0$Z = a0 => ["/", "cases", "case-details", a0, "tasks"];
11007
11312
  class CaseEventCompletionTaskCancelledComponent {
11008
11313
  parentComponent;
11009
11314
  caseId;
@@ -11066,7 +11371,7 @@ class CaseEventCompletionTaskCancelledComponent {
11066
11371
  i0.ɵɵadvance(4);
11067
11372
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(27, 21, "Continue"), " ");
11068
11373
  i0.ɵɵadvance(2);
11069
- i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction1(25, _c0$X, ctx.caseId));
11374
+ i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction1(25, _c0$Z, ctx.caseId));
11070
11375
  i0.ɵɵadvance();
11071
11376
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(30, 23, "Cancel"), " ");
11072
11377
  } }, dependencies: [i1$1.RouterLink, i1.RpxTranslatePipe], encapsulation: 2 });
@@ -11080,7 +11385,7 @@ class CaseEventCompletionTaskCancelledComponent {
11080
11385
  }] }], null); })();
11081
11386
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventCompletionTaskCancelledComponent, { className: "CaseEventCompletionTaskCancelledComponent", filePath: "lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-cancelled/case-event-completion-task-cancelled.component.ts", lineNumber: 8 }); })();
11082
11387
 
11083
- const _c0$W = a0 => ["/", "cases", "case-details", a0, "tasks"];
11388
+ const _c0$Y = a0 => ["/", "cases", "case-details", a0, "tasks"];
11084
11389
  function CaseEventCompletionTaskReassignedComponent_div_0_Template(rf, ctx) { if (rf & 1) {
11085
11390
  const _r1 = i0.ɵɵgetCurrentView();
11086
11391
  i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "h2", 3);
@@ -11133,7 +11438,7 @@ function CaseEventCompletionTaskReassignedComponent_div_0_Template(rf, ctx) { if
11133
11438
  i0.ɵɵadvance(4);
11134
11439
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(27, 22, "Continue"), " ");
11135
11440
  i0.ɵɵadvance(2);
11136
- i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction1(26, _c0$W, ctx_r1.caseId));
11441
+ i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction1(26, _c0$Y, ctx_r1.caseId));
11137
11442
  i0.ɵɵadvance();
11138
11443
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(30, 24, "Cancel"), " ");
11139
11444
  } }
@@ -11609,7 +11914,7 @@ class WriteComplexFieldComponent extends AbstractFieldWriteComponent {
11609
11914
  }] }); })();
11610
11915
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteComplexFieldComponent, { className: "WriteComplexFieldComponent", filePath: "lib/shared/components/palette/complex/write-complex-field.component.ts", lineNumber: 21 }); })();
11611
11916
 
11612
- const _c0$V = ["writeComplexFieldComponent"];
11917
+ const _c0$X = ["writeComplexFieldComponent"];
11613
11918
  const _c1$o = a0 => ({ "form-group-error": a0 });
11614
11919
  const _c2$3 = a0 => ({ "govuk-input--error": a0 });
11615
11920
  function WriteAddressFieldComponent_div_1_div_4_span_5_Template(rf, ctx) { if (rf & 1) {
@@ -11851,7 +12156,7 @@ class WriteAddressFieldComponent extends AbstractFieldWriteComponent {
11851
12156
  }
11852
12157
  static ɵfac = function WriteAddressFieldComponent_Factory(t) { return new (t || WriteAddressFieldComponent)(i0.ɵɵdirectiveInject(AddressesService), i0.ɵɵdirectiveInject(IsCompoundPipe)); };
11853
12158
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteAddressFieldComponent, selectors: [["ccd-write-address-field"]], viewQuery: function WriteAddressFieldComponent_Query(rf, ctx) { if (rf & 1) {
11854
- i0.ɵɵviewQuery(_c0$V, 5);
12159
+ i0.ɵɵviewQuery(_c0$X, 5);
11855
12160
  i0.ɵɵviewQuery(FocusElementDirective, 5);
11856
12161
  } if (rf & 2) {
11857
12162
  let _t;
@@ -11914,6 +12219,171 @@ class AbstractFieldReadComponent extends AbstractFormFieldComponent {
11914
12219
  type: Input
11915
12220
  }] }); })();
11916
12221
 
12222
+ const _c0$W = ["journeyChild"];
12223
+ class AbstractFieldWriteJourneyComponent extends AbstractFieldWriteComponent {
12224
+ multipageComponentStateService;
12225
+ journeyStartPageNumber = 0;
12226
+ journeyEndPageNumber = 0;
12227
+ journeyPageNumber = 0;
12228
+ journeyPreviousPageNumber = 0;
12229
+ journeyId = 'journey';
12230
+ // todo...
12231
+ childJourney;
12232
+ constructor(multipageComponentStateService) {
12233
+ super();
12234
+ this.multipageComponentStateService = multipageComponentStateService;
12235
+ this.multipageComponentStateService.addTojourneyCollection(this);
12236
+ this.journeyPageNumber = this.journeyStartPageNumber;
12237
+ }
12238
+ next() {
12239
+ if (!this.hasNext()) {
12240
+ return;
12241
+ }
12242
+ this.childJourney.next();
12243
+ }
12244
+ previous() {
12245
+ if (!this.hasPrevious()) {
12246
+ return;
12247
+ }
12248
+ if (this.childJourney['cachedFlagType'] && this.childJourney['subJourneyIndex'] !== 0) {
12249
+ this.childJourney.previous();
12250
+ }
12251
+ else {
12252
+ this.previousPage();
12253
+ }
12254
+ }
12255
+ previousPage() {
12256
+ if (this.hasPrevious()) {
12257
+ this.journeyPageNumber--;
12258
+ this.onPageChange();
12259
+ }
12260
+ }
12261
+ nextPage() {
12262
+ if (this.hasNext()) {
12263
+ this.journeyPageNumber++;
12264
+ this.onPageChange();
12265
+ }
12266
+ }
12267
+ ngOnInit() {
12268
+ this.journeyPageNumber = this.journeyStartPageNumber;
12269
+ const state = this.multipageComponentStateService.getJourneyState(this);
12270
+ if (state) {
12271
+ const { journeyPageNumber, journeyStartPageNumber, journeyEndPageNumber } = state;
12272
+ this.journeyPageNumber = journeyPageNumber;
12273
+ this.journeyStartPageNumber = journeyStartPageNumber;
12274
+ this.journeyEndPageNumber = journeyEndPageNumber;
12275
+ }
12276
+ }
12277
+ ngOnDestroy() {
12278
+ this.multipageComponentStateService.setJourneyState(this);
12279
+ }
12280
+ hasNext() { return this.journeyPageNumber < this.journeyEndPageNumber; }
12281
+ ;
12282
+ hasPrevious() { return this.journeyPageNumber > this.journeyStartPageNumber; }
12283
+ ;
12284
+ isFinished() { return this.journeyPageNumber === this.journeyEndPageNumber; }
12285
+ ;
12286
+ isStart() { return this.journeyPageNumber === this.journeyStartPageNumber; }
12287
+ ;
12288
+ getId() { return this.journeyId; }
12289
+ ;
12290
+ onPageChange() { }
12291
+ ;
12292
+ static ɵfac = function AbstractFieldWriteJourneyComponent_Factory(t) { return new (t || AbstractFieldWriteJourneyComponent)(i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
12293
+ static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: AbstractFieldWriteJourneyComponent, viewQuery: function AbstractFieldWriteJourneyComponent_Query(rf, ctx) { if (rf & 1) {
12294
+ i0.ɵɵviewQuery(_c0$W, 5);
12295
+ } if (rf & 2) {
12296
+ let _t;
12297
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.childJourney = _t.first);
12298
+ } }, inputs: { journeyId: "journeyId" }, features: [i0.ɵɵInheritDefinitionFeature] });
12299
+ }
12300
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AbstractFieldWriteJourneyComponent, [{
12301
+ type: Directive
12302
+ }], () => [{ type: MultipageComponentStateService }], { journeyId: [{
12303
+ type: Input
12304
+ }], childJourney: [{
12305
+ type: ViewChild,
12306
+ args: ['journeyChild']
12307
+ }] }); })();
12308
+
12309
+ const _c0$V = ["journeyChild"];
12310
+ class AbstractJourneyComponent {
12311
+ multipageComponentStateService;
12312
+ journeyStartPageNumber = 0;
12313
+ journeyEndPageNumber = 0;
12314
+ journeyPageNumber = 0;
12315
+ journeyPreviousPageNumber;
12316
+ journeyId = 'journey';
12317
+ // todo...
12318
+ childJourney;
12319
+ constructor(multipageComponentStateService) {
12320
+ this.multipageComponentStateService = multipageComponentStateService;
12321
+ this.multipageComponentStateService.addTojourneyCollection(this);
12322
+ this.journeyPageNumber = this.journeyStartPageNumber;
12323
+ }
12324
+ next() {
12325
+ if (!this.hasNext()) {
12326
+ return;
12327
+ }
12328
+ this.childJourney.next();
12329
+ }
12330
+ previous() {
12331
+ if (!this.hasPrevious()) {
12332
+ return;
12333
+ }
12334
+ this.previousPage();
12335
+ }
12336
+ previousPage() {
12337
+ if (this.hasPrevious()) {
12338
+ this.journeyPageNumber--;
12339
+ }
12340
+ }
12341
+ ngOnInit() {
12342
+ this.journeyPageNumber = this.journeyStartPageNumber;
12343
+ const state = this.multipageComponentStateService.getJourneyState(this);
12344
+ if (state) {
12345
+ const { journeyPageNumber, journeyStartPageNumber, journeyEndPageNumber } = state;
12346
+ this.journeyPageNumber = journeyPageNumber;
12347
+ this.journeyStartPageNumber = journeyStartPageNumber;
12348
+ this.journeyEndPageNumber = journeyEndPageNumber;
12349
+ }
12350
+ }
12351
+ ngOnDestroy() {
12352
+ this.multipageComponentStateService.setJourneyState(this);
12353
+ }
12354
+ hasNext() {
12355
+ return this.journeyPageNumber < this.journeyEndPageNumber;
12356
+ }
12357
+ hasPrevious() {
12358
+ return this.journeyPageNumber > this.journeyStartPageNumber;
12359
+ }
12360
+ isFinished() {
12361
+ return this.journeyPageNumber === this.journeyEndPageNumber;
12362
+ }
12363
+ isStart() {
12364
+ return this.journeyPageNumber === this.journeyStartPageNumber;
12365
+ }
12366
+ getId() {
12367
+ return this.journeyId;
12368
+ }
12369
+ onPageChange() { }
12370
+ static ɵfac = function AbstractJourneyComponent_Factory(t) { return new (t || AbstractJourneyComponent)(i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
12371
+ static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: AbstractJourneyComponent, viewQuery: function AbstractJourneyComponent_Query(rf, ctx) { if (rf & 1) {
12372
+ i0.ɵɵviewQuery(_c0$V, 5);
12373
+ } if (rf & 2) {
12374
+ let _t;
12375
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.childJourney = _t.first);
12376
+ } }, inputs: { journeyId: "journeyId" } });
12377
+ }
12378
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AbstractJourneyComponent, [{
12379
+ type: Directive
12380
+ }], () => [{ type: MultipageComponentStateService }], { journeyId: [{
12381
+ type: Input
12382
+ }], childJourney: [{
12383
+ type: ViewChild,
12384
+ args: ['journeyChild']
12385
+ }] }); })();
12386
+
11917
12387
  var DisplayContextParameter;
11918
12388
  (function (DisplayContextParameter) {
11919
12389
  DisplayContextParameter["Read"] = "READ";
@@ -11966,7 +12436,7 @@ function CaseFileViewFieldComponent_div_2_ng_container_8_Template(rf, ctx) { if
11966
12436
  } if (rf & 2) {
11967
12437
  const ctx_r1 = i0.ɵɵnextContext(2);
11968
12438
  i0.ɵɵadvance();
11969
- i0.ɵɵproperty("url", ctx_r1.currentDocument.document_binary_url)("downloadFileName", ctx_r1.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r1.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true)("height", "94.5vh")("enableICP", ctx_r1.isIcpEnabled());
12439
+ i0.ɵɵproperty("url", ctx_r1.currentDocument.document_binary_url)("downloadFileName", ctx_r1.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r1.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true)("height", "94.5vh")("caseId", ctx_r1.caseId)("enableICP", ctx_r1.isIcpEnabled());
11970
12440
  } }
11971
12441
  function CaseFileViewFieldComponent_div_2_Template(rf, ctx) { if (rf & 1) {
11972
12442
  const _r3 = i0.ɵɵgetCurrentView();
@@ -11978,7 +12448,7 @@ function CaseFileViewFieldComponent_div_2_Template(rf, ctx) { if (rf & 1) {
11978
12448
  i0.ɵɵelementEnd()();
11979
12449
  i0.ɵɵelement(6, "div", 16);
11980
12450
  i0.ɵɵelementStart(7, "div", 17);
11981
- i0.ɵɵtemplate(8, CaseFileViewFieldComponent_div_2_ng_container_8_Template, 2, 8, "ng-container", 0);
12451
+ i0.ɵɵtemplate(8, CaseFileViewFieldComponent_div_2_ng_container_8_Template, 2, 9, "ng-container", 0);
11982
12452
  i0.ɵɵelementEnd()()();
11983
12453
  } if (rf & 2) {
11984
12454
  const ctx_r1 = i0.ɵɵnextContext();
@@ -12007,6 +12477,7 @@ class CaseFileViewFieldComponent {
12007
12477
  caseField;
12008
12478
  icp_jurisdictions = [];
12009
12479
  icpEnabled = false;
12480
+ caseId;
12010
12481
  constructor(elementRef, route, caseFileViewService, documentManagementService, loadingService, sessionStorageService, caseNotifier, abstractConfig) {
12011
12482
  this.elementRef = elementRef;
12012
12483
  this.route = route;
@@ -12018,8 +12489,8 @@ class CaseFileViewFieldComponent {
12018
12489
  this.abstractConfig = abstractConfig;
12019
12490
  }
12020
12491
  ngOnInit() {
12021
- const cid = this.route.snapshot.paramMap.get(CaseFileViewFieldComponent.PARAM_CASE_ID);
12022
- this.categoriesAndDocuments$ = this.caseFileViewService.getCategoriesAndDocuments(cid);
12492
+ this.caseId = this.route.snapshot.paramMap.get(CaseFileViewFieldComponent.PARAM_CASE_ID);
12493
+ this.categoriesAndDocuments$ = this.caseFileViewService.getCategoriesAndDocuments(this.caseId);
12023
12494
  this.categoriesAndDocumentsSubscription = this.categoriesAndDocuments$.subscribe({
12024
12495
  next: data => {
12025
12496
  this.caseVersion = data.case_version;
@@ -12096,7 +12567,7 @@ class CaseFileViewFieldComponent {
12096
12567
  return this.icpEnabled && ((this.icp_jurisdictions?.length < 1) || this.icp_jurisdictions.includes(this.caseNotifier?.cachedCaseView?.case_type?.jurisdiction.id));
12097
12568
  }
12098
12569
  static ɵfac = function CaseFileViewFieldComponent_Factory(t) { return new (t || CaseFileViewFieldComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CaseFileViewService), i0.ɵɵdirectiveInject(DocumentManagementService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
12099
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseFileViewFieldComponent, selectors: [["ccd-case-file-view-field"]], decls: 3, vars: 3, consts: [[4, "ngIf"], ["class", "govuk-grid-column-two-thirds", 4, "ngIf"], ["id", "case-file-view-field-errors", "data-module", "govuk-error-summary", 1, "govuk-error-summary", "govuk-!-margin-bottom-4"], ["role", "alert"], [1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [4, "ngFor", "ngForOf"], ["href", "javascript:void(0);"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "clickedDocument", "moveDocument", "categoriesAndDocuments", "allowMoving"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions", "height", "enableICP"]], template: function CaseFileViewFieldComponent_Template(rf, ctx) { if (rf & 1) {
12570
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseFileViewFieldComponent, selectors: [["ccd-case-file-view-field"]], decls: 3, vars: 3, consts: [[4, "ngIf"], ["class", "govuk-grid-column-two-thirds", 4, "ngIf"], ["id", "case-file-view-field-errors", "data-module", "govuk-error-summary", 1, "govuk-error-summary", "govuk-!-margin-bottom-4"], ["role", "alert"], [1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [4, "ngFor", "ngForOf"], ["href", "javascript:void(0);"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "clickedDocument", "moveDocument", "categoriesAndDocuments", "allowMoving"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions", "height", "caseId", "enableICP"]], template: function CaseFileViewFieldComponent_Template(rf, ctx) { if (rf & 1) {
12100
12571
  i0.ɵɵtemplate(0, CaseFileViewFieldComponent_ng_container_0_Template, 8, 1, "ng-container", 0)(1, CaseFileViewFieldComponent_div_1_Template, 5, 0, "div", 1)(2, CaseFileViewFieldComponent_div_2_Template, 9, 3, "div", 0);
12101
12572
  } if (rf & 2) {
12102
12573
  i0.ɵɵproperty("ngIf", ctx.errorMessages == null ? null : ctx.errorMessages.length);
@@ -12108,7 +12579,7 @@ class CaseFileViewFieldComponent {
12108
12579
  }
12109
12580
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFileViewFieldComponent, [{
12110
12581
  type: Component,
12111
- args: [{ selector: 'ccd-case-file-view-field', template: "<ng-container *ngIf=\"errorMessages?.length\">\n <div\n id=\"case-file-view-field-errors\"\n class=\"govuk-error-summary govuk-!-margin-bottom-4\" data-module=\"govuk-error-summary\">\n <div role=\"alert\">\n <h2 class=\"govuk-error-summary__title\">\n There is a problem\n </h2>\n <div class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li *ngFor=\"let errorMessage of errorMessages\">\n <a href=\"javascript:void(0);\">{{ errorMessage }}</a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n</ng-container>\n\n<div *ngIf=\"getCategoriesAndDocumentsError\" class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-xl\">Sorry, there is a problem with the service</h1>\n <p class=\"govuk-body\">Try again later.</p>\n</div>\n<div *ngIf=\"!getCategoriesAndDocumentsError\">\n <h2 class=\"govuk-heading-l\">Case file</h2>\n <div class=\"govuk-form-group\" id=\"case-file-view\">\n <!-- Document tree -->\n <div class=\"document-tree-container\">\n <ccd-case-file-view-folder\n class=\"document-tree-container__tree\"\n [categoriesAndDocuments]=\"categoriesAndDocuments$\"\n (clickedDocument)=\"setMediaViewerFile($event); resetErrorMessages()\"\n (moveDocument)=\"moveDocument($event)\"\n [allowMoving]=\"allowMoving\"\n ></ccd-case-file-view-folder>\n </div>\n <!-- Slider -->\n <div class=\"slider\"></div>\n <!-- Media viewer -->\n <div class=\"media-viewer-container\">\n <ng-container *ngIf=\"currentDocument\">\n <mv-media-viewer [url]=\"currentDocument.document_binary_url\"\n [downloadFileName]=\"currentDocument.document_filename\"\n [showToolbar]=\"true\"\n [contentType]=\"currentDocument.content_type\"\n [enableAnnotations]=\"true\"\n [enableRedactions]=\"true\"\n [height]=\"'94.5vh'\"\n [enableICP]=\"isIcpEnabled()\">\n </mv-media-viewer>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: ["#case-file-view{display:flex;border:2px solid #C9C9C9;height:100vh;position:relative}#case-file-view .document-tree-container{background-color:#faf8f8;width:30%;min-height:400px;min-width:10%}#case-file-view .slider{width:.2%;background-color:#6b6b6b}#case-file-view .slider:hover,#case-file-view .slider:focus{cursor:col-resize}#case-file-view .media-viewer-container{background-color:#dee0e2;flex:1 1 0;overflow:hidden}\n"] }]
12582
+ args: [{ selector: 'ccd-case-file-view-field', template: "<ng-container *ngIf=\"errorMessages?.length\">\n <div\n id=\"case-file-view-field-errors\"\n class=\"govuk-error-summary govuk-!-margin-bottom-4\" data-module=\"govuk-error-summary\">\n <div role=\"alert\">\n <h2 class=\"govuk-error-summary__title\">\n There is a problem\n </h2>\n <div class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li *ngFor=\"let errorMessage of errorMessages\">\n <a href=\"javascript:void(0);\">{{ errorMessage }}</a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n</ng-container>\n\n<div *ngIf=\"getCategoriesAndDocumentsError\" class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-xl\">Sorry, there is a problem with the service</h1>\n <p class=\"govuk-body\">Try again later.</p>\n</div>\n<div *ngIf=\"!getCategoriesAndDocumentsError\">\n <h2 class=\"govuk-heading-l\">Case file</h2>\n <div class=\"govuk-form-group\" id=\"case-file-view\">\n <!-- Document tree -->\n <div class=\"document-tree-container\">\n <ccd-case-file-view-folder\n class=\"document-tree-container__tree\"\n [categoriesAndDocuments]=\"categoriesAndDocuments$\"\n (clickedDocument)=\"setMediaViewerFile($event); resetErrorMessages()\"\n (moveDocument)=\"moveDocument($event)\"\n [allowMoving]=\"allowMoving\"\n ></ccd-case-file-view-folder>\n </div>\n <!-- Slider -->\n <div class=\"slider\"></div>\n <!-- Media viewer -->\n <div class=\"media-viewer-container\">\n <ng-container *ngIf=\"currentDocument\">\n <mv-media-viewer [url]=\"currentDocument.document_binary_url\"\n [downloadFileName]=\"currentDocument.document_filename\"\n [showToolbar]=\"true\"\n [contentType]=\"currentDocument.content_type\"\n [enableAnnotations]=\"true\"\n [enableRedactions]=\"true\"\n [height]=\"'94.5vh'\"\n [caseId]=\"caseId\"\n [enableICP]=\"isIcpEnabled()\">\n </mv-media-viewer>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: ["#case-file-view{display:flex;border:2px solid #C9C9C9;height:100vh;position:relative}#case-file-view .document-tree-container{background-color:#faf8f8;width:30%;min-height:400px;min-width:10%}#case-file-view .slider{width:.2%;background-color:#6b6b6b}#case-file-view .slider:hover,#case-file-view .slider:focus{cursor:col-resize}#case-file-view .media-viewer-container{background-color:#dee0e2;flex:1 1 0;overflow:hidden}\n"] }]
12112
12583
  }], () => [{ type: i0.ElementRef }, { type: i1$1.ActivatedRoute }, { type: CaseFileViewService }, { type: DocumentManagementService }, { type: LoadingService }, { type: SessionStorageService }, { type: CaseNotifier }, { type: AbstractAppConfig }], null); })();
12113
12584
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFileViewFieldComponent, { className: "CaseFileViewFieldComponent", filePath: "lib/shared/components/palette/case-file-view/case-file-view-field.component.ts", lineNumber: 17 }); })();
12114
12585
 
@@ -12116,10 +12587,12 @@ class CaseFlagStateService {
12116
12587
  formGroup = new FormGroup({});
12117
12588
  pageLocation;
12118
12589
  fieldStateToNavigate;
12590
+ lastPageFieldState;
12119
12591
  resetCache(pageLocation) {
12120
12592
  this.formGroup = new FormGroup({});
12121
12593
  this.fieldStateToNavigate = undefined;
12122
12594
  this.pageLocation = pageLocation;
12595
+ this.lastPageFieldState = 0;
12123
12596
  }
12124
12597
  static ɵfac = function CaseFlagStateService_Factory(t) { return new (t || CaseFlagStateService)(); };
12125
12598
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseFlagStateService, factory: CaseFlagStateService.ɵfac });
@@ -12373,7 +12846,7 @@ class ReadCaseFlagFieldComponent extends AbstractFieldReadComponent {
12373
12846
 
12374
12847
  function WriteCaseFlagFieldComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
12375
12848
  const _r1 = i0.ɵɵgetCurrentView();
12376
- i0.ɵɵelementStart(0, "div", 5)(1, "ul", 6)(2, "li")(3, "a", 7);
12849
+ i0.ɵɵelementStart(0, "div", 6)(1, "ul", 7)(2, "li")(3, "a", 8);
12377
12850
  i0.ɵɵlistener("click", function WriteCaseFlagFieldComponent_div_0_div_4_Template_a_click_3_listener() { const errorMessage_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.navigateToErrorElement(errorMessage_r2.fieldId)); });
12378
12851
  i0.ɵɵtext(4);
12379
12852
  i0.ɵɵpipe(5, "rpxTranslate");
@@ -12384,11 +12857,11 @@ function WriteCaseFlagFieldComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1)
12384
12857
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(5, 1, errorMessage_r2.description));
12385
12858
  } }
12386
12859
  function WriteCaseFlagFieldComponent_div_0_Template(rf, ctx) { if (rf & 1) {
12387
- i0.ɵɵelementStart(0, "div", 2)(1, "h2", 3);
12860
+ i0.ɵɵelementStart(0, "div", 3)(1, "h2", 4);
12388
12861
  i0.ɵɵtext(2);
12389
12862
  i0.ɵɵpipe(3, "rpxTranslate");
12390
12863
  i0.ɵɵelementEnd();
12391
- i0.ɵɵtemplate(4, WriteCaseFlagFieldComponent_div_0_div_4_Template, 6, 3, "div", 4);
12864
+ i0.ɵɵtemplate(4, WriteCaseFlagFieldComponent_div_0_div_4_Template, 6, 3, "div", 5);
12392
12865
  i0.ɵɵelementEnd();
12393
12866
  } if (rf & 2) {
12394
12867
  const ctx_r2 = i0.ɵɵnextContext();
@@ -12400,7 +12873,7 @@ function WriteCaseFlagFieldComponent_div_0_Template(rf, ctx) { if (rf & 1) {
12400
12873
  function WriteCaseFlagFieldComponent_div_1_ng_container_2_Template(rf, ctx) { if (rf & 1) {
12401
12874
  const _r4 = i0.ɵɵgetCurrentView();
12402
12875
  i0.ɵɵelementContainerStart(0);
12403
- i0.ɵɵelementStart(1, "ccd-select-flag-location", 11);
12876
+ i0.ɵɵelementStart(1, "ccd-select-flag-location", 12, 0);
12404
12877
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_1_ng_container_2_Template_ccd_select_flag_location_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12405
12878
  i0.ɵɵelementEnd();
12406
12879
  i0.ɵɵelementContainerEnd();
@@ -12412,7 +12885,7 @@ function WriteCaseFlagFieldComponent_div_1_ng_container_2_Template(rf, ctx) { if
12412
12885
  function WriteCaseFlagFieldComponent_div_1_ng_container_3_Template(rf, ctx) { if (rf & 1) {
12413
12886
  const _r5 = i0.ɵɵgetCurrentView();
12414
12887
  i0.ɵɵelementContainerStart(0);
12415
- i0.ɵɵelementStart(1, "ccd-select-flag-type", 12);
12888
+ i0.ɵɵelementStart(1, "ccd-select-flag-type", 13, 0);
12416
12889
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_1_ng_container_3_Template_ccd_select_flag_type_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); })("flagCommentsOptionalEmitter", function WriteCaseFlagFieldComponent_div_1_ng_container_3_Template_ccd_select_flag_type_flagCommentsOptionalEmitter_1_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onFlagCommentsOptionalEmitted($event)); });
12417
12890
  i0.ɵɵelementEnd();
12418
12891
  i0.ɵɵelementContainerEnd();
@@ -12424,7 +12897,7 @@ function WriteCaseFlagFieldComponent_div_1_ng_container_3_Template(rf, ctx) { if
12424
12897
  function WriteCaseFlagFieldComponent_div_1_ng_container_4_Template(rf, ctx) { if (rf & 1) {
12425
12898
  const _r6 = i0.ɵɵgetCurrentView();
12426
12899
  i0.ɵɵelementContainerStart(0);
12427
- i0.ɵɵelementStart(1, "ccd-search-language-interpreter", 13);
12900
+ i0.ɵɵelementStart(1, "ccd-search-language-interpreter", 14, 0);
12428
12901
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_1_ng_container_4_Template_ccd_search_language_interpreter_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12429
12902
  i0.ɵɵelementEnd();
12430
12903
  i0.ɵɵelementContainerEnd();
@@ -12436,7 +12909,7 @@ function WriteCaseFlagFieldComponent_div_1_ng_container_4_Template(rf, ctx) { if
12436
12909
  function WriteCaseFlagFieldComponent_div_1_ng_container_5_Template(rf, ctx) { if (rf & 1) {
12437
12910
  const _r7 = i0.ɵɵgetCurrentView();
12438
12911
  i0.ɵɵelementContainerStart(0);
12439
- i0.ɵɵelementStart(1, "ccd-add-comments", 14);
12912
+ i0.ɵɵelementStart(1, "ccd-add-comments", 15, 0);
12440
12913
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_1_ng_container_5_Template_ccd_add_comments_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12441
12914
  i0.ɵɵelementEnd();
12442
12915
  i0.ɵɵelementContainerEnd();
@@ -12448,7 +12921,7 @@ function WriteCaseFlagFieldComponent_div_1_ng_container_5_Template(rf, ctx) { if
12448
12921
  function WriteCaseFlagFieldComponent_div_1_ng_container_6_Template(rf, ctx) { if (rf & 1) {
12449
12922
  const _r8 = i0.ɵɵgetCurrentView();
12450
12923
  i0.ɵɵelementContainerStart(0);
12451
- i0.ɵɵelementStart(1, "ccd-confirm-flag-status", 15);
12924
+ i0.ɵɵelementStart(1, "ccd-confirm-flag-status", 16, 0);
12452
12925
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_1_ng_container_6_Template_ccd_confirm_flag_status_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12453
12926
  i0.ɵɵelementEnd();
12454
12927
  i0.ɵɵelementContainerEnd();
@@ -12458,8 +12931,8 @@ function WriteCaseFlagFieldComponent_div_1_ng_container_6_Template(rf, ctx) { if
12458
12931
  i0.ɵɵproperty("formGroup", ctx_r2.caseFlagParentFormGroup)("defaultStatus", ctx_r2.flagType.defaultStatus);
12459
12932
  } }
12460
12933
  function WriteCaseFlagFieldComponent_div_1_Template(rf, ctx) { if (rf & 1) {
12461
- i0.ɵɵelementStart(0, "div", 8)(1, "div", 9);
12462
- i0.ɵɵtemplate(2, WriteCaseFlagFieldComponent_div_1_ng_container_2_Template, 2, 3, "ng-container", 10)(3, WriteCaseFlagFieldComponent_div_1_ng_container_3_Template, 2, 7, "ng-container", 10)(4, WriteCaseFlagFieldComponent_div_1_ng_container_4_Template, 2, 2, "ng-container", 10)(5, WriteCaseFlagFieldComponent_div_1_ng_container_5_Template, 2, 4, "ng-container", 10)(6, WriteCaseFlagFieldComponent_div_1_ng_container_6_Template, 2, 2, "ng-container", 10);
12934
+ i0.ɵɵelementStart(0, "div", 9)(1, "div", 10);
12935
+ i0.ɵɵtemplate(2, WriteCaseFlagFieldComponent_div_1_ng_container_2_Template, 3, 3, "ng-container", 11)(3, WriteCaseFlagFieldComponent_div_1_ng_container_3_Template, 3, 7, "ng-container", 11)(4, WriteCaseFlagFieldComponent_div_1_ng_container_4_Template, 3, 2, "ng-container", 11)(5, WriteCaseFlagFieldComponent_div_1_ng_container_5_Template, 3, 4, "ng-container", 11)(6, WriteCaseFlagFieldComponent_div_1_ng_container_6_Template, 3, 2, "ng-container", 11);
12463
12936
  i0.ɵɵelementEnd()();
12464
12937
  } if (rf & 2) {
12465
12938
  const ctx_r2 = i0.ɵɵnextContext();
@@ -12480,7 +12953,7 @@ function WriteCaseFlagFieldComponent_div_1_Template(rf, ctx) { if (rf & 1) {
12480
12953
  function WriteCaseFlagFieldComponent_div_2_ng_container_2_Template(rf, ctx) { if (rf & 1) {
12481
12954
  const _r9 = i0.ɵɵgetCurrentView();
12482
12955
  i0.ɵɵelementContainerStart(0);
12483
- i0.ɵɵelementStart(1, "ccd-manage-case-flags", 16);
12956
+ i0.ɵɵelementStart(1, "ccd-manage-case-flags", 17, 0);
12484
12957
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_2_ng_container_2_Template_ccd_manage_case_flags_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12485
12958
  i0.ɵɵelementEnd();
12486
12959
  i0.ɵɵelementContainerEnd();
@@ -12492,7 +12965,7 @@ function WriteCaseFlagFieldComponent_div_2_ng_container_2_Template(rf, ctx) { if
12492
12965
  function WriteCaseFlagFieldComponent_div_2_ng_container_3_Template(rf, ctx) { if (rf & 1) {
12493
12966
  const _r10 = i0.ɵɵgetCurrentView();
12494
12967
  i0.ɵɵelementContainerStart(0);
12495
- i0.ɵɵelementStart(1, "ccd-update-flag", 17);
12968
+ i0.ɵɵelementStart(1, "ccd-update-flag", 18, 0);
12496
12969
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_2_ng_container_3_Template_ccd_update_flag_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r10); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12497
12970
  i0.ɵɵelementEnd();
12498
12971
  i0.ɵɵelementContainerEnd();
@@ -12504,7 +12977,7 @@ function WriteCaseFlagFieldComponent_div_2_ng_container_3_Template(rf, ctx) { if
12504
12977
  function WriteCaseFlagFieldComponent_div_2_ng_container_4_Template(rf, ctx) { if (rf & 1) {
12505
12978
  const _r11 = i0.ɵɵgetCurrentView();
12506
12979
  i0.ɵɵelementContainerStart(0);
12507
- i0.ɵɵelementStart(1, "ccd-update-flag-add-translation-form", 18);
12980
+ i0.ɵɵelementStart(1, "ccd-update-flag-add-translation-form", 19, 0);
12508
12981
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_2_ng_container_4_Template_ccd_update_flag_add_translation_form_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r11); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12509
12982
  i0.ɵɵelementEnd();
12510
12983
  i0.ɵɵelementContainerEnd();
@@ -12514,8 +12987,8 @@ function WriteCaseFlagFieldComponent_div_2_ng_container_4_Template(rf, ctx) { if
12514
12987
  i0.ɵɵproperty("formGroup", ctx_r2.caseFlagParentFormGroup);
12515
12988
  } }
12516
12989
  function WriteCaseFlagFieldComponent_div_2_Template(rf, ctx) { if (rf & 1) {
12517
- i0.ɵɵelementStart(0, "div", 8)(1, "div", 9);
12518
- i0.ɵɵtemplate(2, WriteCaseFlagFieldComponent_div_2_ng_container_2_Template, 2, 4, "ng-container", 10)(3, WriteCaseFlagFieldComponent_div_2_ng_container_3_Template, 2, 2, "ng-container", 10)(4, WriteCaseFlagFieldComponent_div_2_ng_container_4_Template, 2, 1, "ng-container", 10);
12990
+ i0.ɵɵelementStart(0, "div", 9)(1, "div", 10);
12991
+ i0.ɵɵtemplate(2, WriteCaseFlagFieldComponent_div_2_ng_container_2_Template, 3, 4, "ng-container", 11)(3, WriteCaseFlagFieldComponent_div_2_ng_container_3_Template, 3, 2, "ng-container", 11)(4, WriteCaseFlagFieldComponent_div_2_ng_container_4_Template, 3, 1, "ng-container", 11);
12519
12992
  i0.ɵɵelementEnd()();
12520
12993
  } if (rf & 2) {
12521
12994
  const ctx_r2 = i0.ɵɵnextContext();
@@ -12529,11 +13002,12 @@ function WriteCaseFlagFieldComponent_div_2_Template(rf, ctx) { if (rf & 1) {
12529
13002
  i0.ɵɵadvance();
12530
13003
  i0.ɵɵproperty("ngSwitchCase", ctx_r2.caseFlagFieldState.FLAG_UPDATE_WELSH_TRANSLATION);
12531
13004
  } }
12532
- class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
13005
+ class WriteCaseFlagFieldComponent extends AbstractFieldWriteJourneyComponent {
12533
13006
  route;
12534
13007
  caseEditDataService;
12535
13008
  caseFlagStateService;
12536
13009
  rpxTranslationService;
13010
+ //public formGroup: FormGroup;
12537
13011
  fieldState;
12538
13012
  caseFlagFieldState = CaseFlagFieldState;
12539
13013
  errorMessages = [];
@@ -12552,6 +13026,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12552
13026
  displayContextParameter;
12553
13027
  determinedLocation;
12554
13028
  allCaseFlagStagesCompleted = false;
13029
+ navigatedTo = false;
12555
13030
  // Code for "Other" flag type as defined in Reference Data
12556
13031
  otherFlagTypeCode = 'OT0001';
12557
13032
  selectedManageCaseLocation = 'selectedManageCaseLocation';
@@ -12567,8 +13042,8 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12567
13042
  this.caseFlagParentFormGroup.value.selectedLocation = selectedLocation;
12568
13043
  }
12569
13044
  }
12570
- constructor(route, caseEditDataService, caseFlagStateService, rpxTranslationService) {
12571
- super();
13045
+ constructor(route, caseEditDataService, caseFlagStateService, rpxTranslationService, multipageComponentStateService) {
13046
+ super(multipageComponentStateService);
12572
13047
  this.route = route;
12573
13048
  this.caseEditDataService = caseEditDataService;
12574
13049
  this.caseFlagStateService = caseFlagStateService;
@@ -12578,13 +13053,14 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12578
13053
  // If it is start of the journey or navigation from check your answers page then fieldStateToNavigate property
12579
13054
  // in case flag state service will contain the field state to navigate based on create or manage journey
12580
13055
  this.fieldState = this.caseFlagStateService.fieldStateToNavigate;
12581
- if (this.fieldState === undefined ||
12582
- this.fieldState === CaseFlagFieldState.FLAG_LOCATION ||
12583
- this.fieldState === CaseFlagFieldState.FLAG_MANAGE_CASE_FLAGS) {
13056
+ if (this.fieldState === undefined) {
12584
13057
  const params = this.route.snapshot.params;
12585
13058
  // Clear the form group, field state to navigate and set the page location
12586
13059
  this.caseFlagStateService.resetCache(`../${params['eid']}/${params['page']}`);
12587
13060
  }
13061
+ else {
13062
+ this.navigatedTo = true;
13063
+ }
12588
13064
  // Reassign the form group from the case flag state service
12589
13065
  this.caseFlagParentFormGroup = this.caseFlagStateService.formGroup;
12590
13066
  // Clear form validation errors as a new page will be rendered based on field state
@@ -12623,11 +13099,14 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12623
13099
  this.hmctsServiceId = this.route.snapshot.data.eventTrigger.supplementary_data.HMCTSServiceId;
12624
13100
  }
12625
13101
  if (this.route.snapshot.data.eventTrigger.case_fields) {
12626
- this.flagsData = (this.route.snapshot.data.eventTrigger.case_fields)
13102
+ // there is an edge case in the navigation when going back, sometimes the case_fileds will lose values in the values which causes the flow to break before CYA
13103
+ // below funciton ensures all data is correctly set.
13104
+ const flagData = this.validateCaseFields(this.route.snapshot.data.eventTrigger.case_fields);
13105
+ this.flagsData = (flagData)
12627
13106
  .reduce((flags, caseField) => FieldsUtils.extractFlagsDataFromCaseField(flags, caseField, caseField.id, caseField), []);
12628
13107
  // Set displayContextParameter (to be passed as an input to ManageCaseFlagsComponent for setting correct title)
12629
13108
  this.displayContextParameter =
12630
- this.setDisplayContextParameter(this.route.snapshot.data.eventTrigger.case_fields);
13109
+ this.setDisplayContextParameter(flagData);
12631
13110
  // Set boolean indicating the display_context_parameter is "update"
12632
13111
  this.isDisplayContextParameterUpdate = this.setDisplayContextParameterUpdate(this.displayContextParameter);
12633
13112
  // Set boolean indicating the display_context_parameter is "external"
@@ -12646,6 +13125,58 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12646
13125
  });
12647
13126
  }
12648
13127
  }
13128
+ // CSFD-16.
13129
+ // Setup the page number to initially be the same value as
13130
+ // the start page number. Provided that some state exists within
13131
+ // the page state service, use that instaead.
13132
+ //
13133
+ // If isDisplayContextParameterUpdate is true, then the starting page must be
13134
+ // the value of 4. Otherwise, it's 0. However, we're using an enum to simplify
13135
+ // this process.
13136
+ //
13137
+ // It might help to take a look at the template file.
13138
+ if (this.isDisplayContextParameterUpdate) {
13139
+ this.journeyStartPageNumber = CaseFlagFieldState.FLAG_MANAGE_CASE_FLAGS;
13140
+ this.journeyEndPageNumber = CaseFlagFieldState.FLAG_UPDATE_WELSH_TRANSLATION;
13141
+ }
13142
+ else {
13143
+ this.journeyStartPageNumber = CaseFlagFieldState.FLAG_LOCATION;
13144
+ this.journeyEndPageNumber = CaseFlagFieldState.FLAG_STATUS;
13145
+ }
13146
+ // Now that we've set the start page number, let's set the current page number.
13147
+ this.journeyPageNumber = this.journeyStartPageNumber;
13148
+ // If we've navigated to this page, then we know by default, we want to set the
13149
+ // journey page number to the field state.
13150
+ if (this.navigatedTo) {
13151
+ const pageNo = this.fieldState === CaseFlagFieldState.FLAG_STATUS ? this.fieldState - 1 : this.fieldState;
13152
+ this.journeyPageNumber = pageNo;
13153
+ this.journeyPreviousPageNumber = pageNo;
13154
+ }
13155
+ // Provided we have some stored state, i.e. when going backwards, we want
13156
+ // to get the last visited page, etc.
13157
+ const state = this.multipageComponentStateService.getJourneyState(this);
13158
+ if (state) {
13159
+ const { journeyPageNumber, journeyStartPageNumber, journeyEndPageNumber } = state;
13160
+ this.journeyPageNumber = journeyPageNumber;
13161
+ this.journeyStartPageNumber = journeyStartPageNumber;
13162
+ this.journeyEndPageNumber = journeyEndPageNumber;
13163
+ }
13164
+ this.multipageComponentStateService.isAtStart = this.journeyPageNumber === this.journeyStartPageNumber;
13165
+ }
13166
+ validateCaseFields(caseFields) {
13167
+ caseFields.forEach((field) => {
13168
+ if (field.formatted_value) {
13169
+ Object.keys(field.formatted_value).forEach((valueKey) => {
13170
+ if (field.formatted_value[valueKey] !== field.value[valueKey]) {
13171
+ field.value[valueKey] = field.formatted_value[valueKey];
13172
+ }
13173
+ });
13174
+ }
13175
+ });
13176
+ return caseFields;
13177
+ }
13178
+ onPageChange() {
13179
+ this.multipageComponentStateService.isAtStart = this.fieldState === this.caseFlagFieldState.FLAG_LOCATION;
12649
13180
  }
12650
13181
  setDisplayContextParameterUpdate(displayContextParameter) {
12651
13182
  return displayContextParameter === CaseFlagDisplayContextParameter.UPDATE ||
@@ -12701,6 +13232,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12701
13232
  }
12702
13233
  proceedToNextState() {
12703
13234
  if (!this.isAtFinalState()) {
13235
+ this.journeyPreviousPageNumber = this.fieldState;
12704
13236
  // Skip the "language interpreter" state if current state is CaseFlagFieldState.FLAG_TYPE and the flag type doesn't
12705
13237
  // have a "list of values" - currently, this is present only for those flag types that require language interpreter
12706
13238
  // selection
@@ -12710,6 +13242,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12710
13242
  else {
12711
13243
  this.fieldState++;
12712
13244
  }
13245
+ this.nextPage();
12713
13246
  }
12714
13247
  }
12715
13248
  setFlagsCaseFieldValue() {
@@ -12728,6 +13261,18 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12728
13261
  break;
12729
13262
  }
12730
13263
  }
13264
+ previousPage() {
13265
+ // if we are navigating away from the page, we should set the error messages to empty so the message dissapears
13266
+ this.errorMessages = [];
13267
+ this.journeyPreviousPageNumber = this.fieldState;
13268
+ if (this.hasPrevious() && this.fieldState === CaseFlagFieldState.FLAG_COMMENTS && !this.flagType?.listOfValues) {
13269
+ this.fieldState = CaseFlagFieldState.FLAG_TYPE;
13270
+ }
13271
+ else if (this.hasPrevious()) {
13272
+ this.fieldState--;
13273
+ }
13274
+ super.previousPage();
13275
+ }
12731
13276
  addFlagToCollection() {
12732
13277
  // Ensure no more than one new flag is being added at a time, by iterating through each Flags case field and removing
12733
13278
  // any previous entry from the details array where that entry has no id (hence it is new - and there should be only
@@ -13012,6 +13557,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
13012
13557
  };
13013
13558
  }
13014
13559
  moveToFinalReviewStage() {
13560
+ this.caseFlagStateService.lastPageFieldState = this.fieldState;
13015
13561
  this.setFlagsCaseFieldValue();
13016
13562
  // Check that no errors have been set on caseFlagParentFormGroup (by determineLocationForFlag()); prevent moving to
13017
13563
  // final review stage if errors exist
@@ -13026,6 +13572,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
13026
13572
  }
13027
13573
  }
13028
13574
  ngOnDestroy() {
13575
+ this.multipageComponentStateService.setJourneyState(this);
13029
13576
  // Reset the fieldstateToNavigate as the write journey completes at this point
13030
13577
  this.caseFlagStateService.fieldStateToNavigate = undefined;
13031
13578
  this.caseTitleSubscription?.unsubscribe();
@@ -13037,9 +13584,9 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
13037
13584
  setDisplayContextParameter(caseFields) {
13038
13585
  return caseFields.find(caseField => FieldsUtils.isCaseFieldOfType(caseField, ['FlagLauncher']))?.display_context_parameter;
13039
13586
  }
13040
- static ɵfac = function WriteCaseFlagFieldComponent_Factory(t) { return new (t || WriteCaseFlagFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(CaseFlagStateService), i0.ɵɵdirectiveInject(i1.RpxTranslationService)); };
13041
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteCaseFlagFieldComponent, selectors: [["ccd-write-case-flag-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 3, consts: [["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "form-group", 3, "formGroup", 4, "ngIf"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], [4, "ngSwitchCase"], [3, "caseFlagStateEmitter", "formGroup", "flagsData", "isDisplayContextParameterExternal"], [3, "caseFlagStateEmitter", "flagCommentsOptionalEmitter", "formGroup", "jurisdiction", "caseTypeId", "hmctsServiceId", "isDisplayContextParameterExternal", "isDisplayContextParameter2Point1Enabled", "selectedFlagsLocation"], [3, "caseFlagStateEmitter", "formGroup", "flagType"], [3, "caseFlagStateEmitter", "formGroup", "optional", "isDisplayContextParameterExternal", "isDisplayContextParameter2Point1Enabled"], [3, "caseFlagStateEmitter", "formGroup", "defaultStatus"], [3, "caseFlagStateEmitter", "formGroup", "flagsData", "caseTitle", "displayContextParameter"], [3, "caseFlagStateEmitter", "formGroup", "displayContextParameter"], [3, "caseFlagStateEmitter", "formGroup"]], template: function WriteCaseFlagFieldComponent_Template(rf, ctx) { if (rf & 1) {
13042
- i0.ɵɵtemplate(0, WriteCaseFlagFieldComponent_div_0_Template, 5, 4, "div", 0)(1, WriteCaseFlagFieldComponent_div_1_Template, 7, 7, "div", 1)(2, WriteCaseFlagFieldComponent_div_2_Template, 5, 5, "div", 1);
13587
+ static ɵfac = function WriteCaseFlagFieldComponent_Factory(t) { return new (t || WriteCaseFlagFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(CaseFlagStateService), i0.ɵɵdirectiveInject(i1.RpxTranslationService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
13588
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteCaseFlagFieldComponent, selectors: [["ccd-write-case-flag-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 3, consts: [["journeyChild", ""], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "form-group", 3, "formGroup", 4, "ngIf"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], [4, "ngSwitchCase"], [3, "caseFlagStateEmitter", "formGroup", "flagsData", "isDisplayContextParameterExternal"], [3, "caseFlagStateEmitter", "flagCommentsOptionalEmitter", "formGroup", "jurisdiction", "caseTypeId", "hmctsServiceId", "isDisplayContextParameterExternal", "isDisplayContextParameter2Point1Enabled", "selectedFlagsLocation"], [3, "caseFlagStateEmitter", "formGroup", "flagType"], [3, "caseFlagStateEmitter", "formGroup", "optional", "isDisplayContextParameterExternal", "isDisplayContextParameter2Point1Enabled"], [3, "caseFlagStateEmitter", "formGroup", "defaultStatus"], [3, "caseFlagStateEmitter", "formGroup", "flagsData", "caseTitle", "displayContextParameter"], [3, "caseFlagStateEmitter", "formGroup", "displayContextParameter"], [3, "caseFlagStateEmitter", "formGroup"]], template: function WriteCaseFlagFieldComponent_Template(rf, ctx) { if (rf & 1) {
13589
+ i0.ɵɵtemplate(0, WriteCaseFlagFieldComponent_div_0_Template, 5, 4, "div", 1)(1, WriteCaseFlagFieldComponent_div_1_Template, 7, 7, "div", 2)(2, WriteCaseFlagFieldComponent_div_2_Template, 5, 5, "div", 2);
13043
13590
  } if (rf & 2) {
13044
13591
  i0.ɵɵproperty("ngIf", ctx.errorMessages.length > 0);
13045
13592
  i0.ɵɵadvance();
@@ -13050,9 +13597,9 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
13050
13597
  }
13051
13598
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteCaseFlagFieldComponent, [{
13052
13599
  type: Component,
13053
- args: [{ selector: 'ccd-write-case-flag-field', template: "<!-- Error message summary -->\n<div *ngIf=\"errorMessages.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let errorMessage of errorMessages\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(errorMessage.fieldId)\" class=\"validation-error\">{{errorMessage.description | rpxTranslate}}</a>\n </li>\n </ul>\n </div>\n</div>\n<div *ngIf=\"!isDisplayContextParameterUpdate\" class=\"form-group\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"fieldState\">\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_LOCATION\">\n <ccd-select-flag-location\n [formGroup]=\"caseFlagParentFormGroup\" [flagsData]=\"flagsData\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"\n [isDisplayContextParameterExternal]=\"isDisplayContextParameterExternal\"\n ></ccd-select-flag-location>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_TYPE\">\n <ccd-select-flag-type [formGroup]=\"caseFlagParentFormGroup\" [jurisdiction]=\"jurisdiction\" [caseTypeId]=\"caseTypeId\"\n [hmctsServiceId]=\"hmctsServiceId\" [isDisplayContextParameterExternal]=\"isDisplayContextParameterExternal\"\n [isDisplayContextParameter2Point1Enabled]=\"isDisplayContextParameter2Point1Enabled\"\n [selectedFlagsLocation]=\"selectedFlagsLocation\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"\n (flagCommentsOptionalEmitter)=\"onFlagCommentsOptionalEmitted($event)\"></ccd-select-flag-type>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_LANGUAGE_INTERPRETER\">\n <ccd-search-language-interpreter [formGroup]=\"caseFlagParentFormGroup\"\n [flagType]=\"flagType\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-search-language-interpreter>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_COMMENTS\">\n <ccd-add-comments [formGroup]=\"caseFlagParentFormGroup\" [optional]=\"flagCommentsOptional\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"\n [isDisplayContextParameterExternal]=\"isDisplayContextParameterExternal\"\n [isDisplayContextParameter2Point1Enabled]=\"isDisplayContextParameter2Point1Enabled\">\n </ccd-add-comments>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_STATUS\">\n <ccd-confirm-flag-status [formGroup]=\"caseFlagParentFormGroup\" [defaultStatus]=\"flagType.defaultStatus\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"></ccd-confirm-flag-status>\n </ng-container>\n </div>\n</div>\n<div *ngIf=\"isDisplayContextParameterUpdate\" class=\"form-group\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"fieldState\">\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_MANAGE_CASE_FLAGS\">\n <ccd-manage-case-flags [formGroup]=\"caseFlagParentFormGroup\" [flagsData]=\"flagsData\" [caseTitle]=\"caseTitle\"\n [displayContextParameter]=\"displayContextParameter\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"></ccd-manage-case-flags>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_UPDATE\">\n <ccd-update-flag [formGroup]=\"caseFlagParentFormGroup\"\n [displayContextParameter]=\"displayContextParameter\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"></ccd-update-flag>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_UPDATE_WELSH_TRANSLATION\">\n <ccd-update-flag-add-translation-form\n [formGroup]=\"caseFlagParentFormGroup\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"\n ></ccd-update-flag-add-translation-form>\n </ng-container>\n </div>\n</div>\n", styles: [".validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
13054
- }], () => [{ type: i1$1.ActivatedRoute }, { type: CaseEditDataService }, { type: CaseFlagStateService }, { type: i1.RpxTranslationService }], null); })();
13055
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteCaseFlagFieldComponent, { className: "WriteCaseFlagFieldComponent", filePath: "lib/shared/components/palette/case-flag/write-case-flag-field.component.ts", lineNumber: 20 }); })();
13600
+ args: [{ selector: 'ccd-write-case-flag-field', template: "<!-- Error message summary -->\n<div *ngIf=\"errorMessages.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\"\n tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let errorMessage of errorMessages\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(errorMessage.fieldId)\" class=\"validation-error\">{{errorMessage.description |\n rpxTranslate}}</a>\n </li>\n </ul>\n </div>\n</div>\n<div *ngIf=\"!isDisplayContextParameterUpdate\" class=\"form-group\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"fieldState\">\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_LOCATION\">\n <ccd-select-flag-location \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\" \n [flagsData]=\"flagsData\"\n [isDisplayContextParameterExternal]=\"isDisplayContextParameterExternal\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-select-flag-location>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_TYPE\">\n <ccd-select-flag-type \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\" \n [jurisdiction]=\"jurisdiction\"\n [caseTypeId]=\"caseTypeId\" \n [hmctsServiceId]=\"hmctsServiceId\"\n [isDisplayContextParameterExternal]=\"isDisplayContextParameterExternal\"\n [isDisplayContextParameter2Point1Enabled]=\"isDisplayContextParameter2Point1Enabled\"\n [selectedFlagsLocation]=\"selectedFlagsLocation\" \n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"\n (flagCommentsOptionalEmitter)=\"onFlagCommentsOptionalEmitted($event)\">\n </ccd-select-flag-type>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_LANGUAGE_INTERPRETER\">\n <ccd-search-language-interpreter \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\" \n [flagType]=\"flagType\" \n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-search-language-interpreter>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_COMMENTS\">\n <ccd-add-comments \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\" \n [optional]=\"flagCommentsOptional\"\n [isDisplayContextParameterExternal]=\"isDisplayContextParameterExternal\"\n [isDisplayContextParameter2Point1Enabled]=\"isDisplayContextParameter2Point1Enabled\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-add-comments>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_STATUS\">\n <ccd-confirm-flag-status \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\"\n [defaultStatus]=\"flagType.defaultStatus\" \n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-confirm-flag-status>\n </ng-container>\n </div>\n</div>\n<div *ngIf=\"isDisplayContextParameterUpdate\" class=\"form-group\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"fieldState\">\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_MANAGE_CASE_FLAGS\">\n <ccd-manage-case-flags \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\" \n [flagsData]=\"flagsData\"\n [caseTitle]=\"caseTitle\" \n [displayContextParameter]=\"displayContextParameter\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-manage-case-flags>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_UPDATE\">\n <ccd-update-flag \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\"\n [displayContextParameter]=\"displayContextParameter\" \n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-update-flag>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_UPDATE_WELSH_TRANSLATION\">\n <ccd-update-flag-add-translation-form \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-update-flag-add-translation-form>\n </ng-container>\n </div>\n</div>", styles: [".validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
13601
+ }], () => [{ type: i1$1.ActivatedRoute }, { type: CaseEditDataService }, { type: CaseFlagStateService }, { type: i1.RpxTranslationService }, { type: MultipageComponentStateService }], null); })();
13602
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteCaseFlagFieldComponent, { className: "WriteCaseFlagFieldComponent", filePath: "lib/shared/components/palette/case-flag/write-case-flag-field.component.ts", lineNumber: 21 }); })();
13056
13603
 
13057
13604
  class CaseReferencePipe {
13058
13605
  transform(caseReference) {
@@ -15790,139 +16337,6 @@ var Patterns;
15790
16337
  Patterns["CASE_REF"] = "((([0-9]{4})(?: |-)?)){4}";
15791
16338
  })(Patterns || (Patterns = {}));
15792
16339
 
15793
- class LinkedCasesService {
15794
- jurisdictionService;
15795
- searchService;
15796
- static CASE_NAME_MISSING_TEXT = 'Case name missing';
15797
- caseFieldValue = [];
15798
- isLinkedCasesEventTrigger = false;
15799
- caseDetails;
15800
- caseId;
15801
- caseName;
15802
- linkCaseReasons = [];
15803
- linkedCases = [];
15804
- initialCaseLinks = [];
15805
- editMode = false;
15806
- jurisdictionsResponse = [];
15807
- serverJurisdictionError;
15808
- serverError = null;
15809
- serverLinkedApiError = null;
15810
- isServerReasonCodeError = false;
15811
- caseJurisdictionID = null;
15812
- constructor(jurisdictionService, searchService) {
15813
- this.jurisdictionService = jurisdictionService;
15814
- this.searchService = searchService;
15815
- this.jurisdictionService.getJurisdictions().subscribe((jurisdictions) => {
15816
- this.jurisdictionsResponse = jurisdictions;
15817
- }, (error) => {
15818
- this.serverJurisdictionError = true;
15819
- });
15820
- }
15821
- groupLinkedCasesByCaseType = (arrObj, key) => {
15822
- return arrObj.reduce((rv, x) => {
15823
- (rv[x.value[key]] = rv[x.value[key]] || []).push(x.value['CaseReference']);
15824
- return rv;
15825
- }, {});
15826
- };
15827
- constructElasticSearchQuery(caseIds, size) {
15828
- return {
15829
- query: {
15830
- terms: {
15831
- reference: caseIds,
15832
- },
15833
- },
15834
- size,
15835
- };
15836
- }
15837
- mapResponse(esSearchCasesResponse) {
15838
- const caseInfo = this.caseFieldValue.find(item => item.value && item.value.CaseReference === esSearchCasesResponse.case_id);
15839
- return caseInfo && {
15840
- caseReference: esSearchCasesResponse.case_id,
15841
- caseName: esSearchCasesResponse.case_fields.caseNameHmctsInternal || LinkedCasesService.CASE_NAME_MISSING_TEXT,
15842
- caseType: this.mapLookupIDToValueFromJurisdictions('CASE_TYPE', esSearchCasesResponse.case_fields['[CASE_TYPE]']),
15843
- service: this.mapLookupIDToValueFromJurisdictions('JURISDICTION', esSearchCasesResponse.case_fields['[JURISDICTION]']),
15844
- state: this.mapLookupIDToValueFromJurisdictions('STATE', esSearchCasesResponse.case_fields['[STATE]']),
15845
- reasons: caseInfo?.value?.ReasonForLink
15846
- };
15847
- }
15848
- searchCasesByCaseIds(searchCasesResponse) {
15849
- return forkJoin(searchCasesResponse);
15850
- }
15851
- getAllLinkedCaseInformation() {
15852
- const searchCasesResponse = [];
15853
- const linkedCaseIds = this.groupLinkedCasesByCaseType(this.caseFieldValue, 'CaseType');
15854
- Object.keys(linkedCaseIds).forEach(key => {
15855
- const esQuery = this.constructElasticSearchQuery(linkedCaseIds[key], 100);
15856
- const query = this.searchService.searchCasesByIds(key, esQuery, SearchService.VIEW_WORKBASKET);
15857
- searchCasesResponse.push(query);
15858
- });
15859
- if (searchCasesResponse.length) {
15860
- this.searchCasesByCaseIds(searchCasesResponse).subscribe((searchCases) => {
15861
- const casesResponse = [];
15862
- searchCases.forEach(response => {
15863
- response.results.forEach((result) => {
15864
- casesResponse.push(this.mapResponse(result));
15865
- });
15866
- });
15867
- this.linkedCases = casesResponse.map(item => {
15868
- return {
15869
- caseReference: item.caseReference,
15870
- caseName: item.caseName,
15871
- caseService: item.service,
15872
- caseType: item.caseType,
15873
- unlink: false,
15874
- reasons: item.reasons && item.reasons.map(reason => {
15875
- return {
15876
- Reason: reason
15877
- };
15878
- }),
15879
- };
15880
- });
15881
- this.serverLinkedApiError = null;
15882
- }, err => {
15883
- this.serverLinkedApiError = {
15884
- id: 'backendError', message: 'Some case information is not available at the moment'
15885
- };
15886
- });
15887
- }
15888
- }
15889
- mapLookupIDToValueFromJurisdictions(fieldName, fieldValue) {
15890
- const selectedJurisdiction = this.jurisdictionsResponse &&
15891
- this.jurisdictionsResponse.find(item => item.id === this.caseDetails.case_type.jurisdiction.id);
15892
- const selectedCaseType = selectedJurisdiction && selectedJurisdiction.caseTypes.find(item => item.id === this.caseDetails.case_type.id);
15893
- const state = selectedCaseType && selectedCaseType.states.find(item => item.id === fieldValue);
15894
- switch (fieldName) {
15895
- case 'JURISDICTION':
15896
- return selectedJurisdiction && selectedJurisdiction.description;
15897
- case 'CASE_TYPE':
15898
- return selectedCaseType && selectedCaseType.name;
15899
- case 'CASE_TYPE_DESCRIPTION':
15900
- return selectedCaseType && selectedCaseType.description;
15901
- case 'STATE':
15902
- return state && state.name || fieldValue;
15903
- case 'STATE_DESCRIPTION':
15904
- return state && state.description || fieldValue;
15905
- default:
15906
- break;
15907
- }
15908
- }
15909
- getCaseName(searchCasesResponse) {
15910
- let caseName = LinkedCasesService.CASE_NAME_MISSING_TEXT;
15911
- const tabs = searchCasesResponse.tabs.filter(tab => {
15912
- const caseNameHmctsInternalField = tab.fields.find(field => field.id === 'caseNameHmctsInternal');
15913
- if (caseNameHmctsInternalField) {
15914
- caseName = caseNameHmctsInternalField.value;
15915
- }
15916
- });
15917
- return caseName;
15918
- }
15919
- static ɵfac = function LinkedCasesService_Factory(t) { return new (t || LinkedCasesService)(i0.ɵɵinject(JurisdictionService), i0.ɵɵinject(SearchService)); };
15920
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LinkedCasesService, factory: LinkedCasesService.ɵfac });
15921
- }
15922
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LinkedCasesService, [{
15923
- type: Injectable
15924
- }], () => [{ type: JurisdictionService }, { type: SearchService }], null); })();
15925
-
15926
16340
  function BeforeYouStartComponent_div_1_p_3_Template(rf, ctx) { if (rf & 1) {
15927
16341
  i0.ɵɵelementStart(0, "p", 5)(1, "span", 6);
15928
16342
  i0.ɵɵtext(2, "Error:");
@@ -15950,7 +16364,7 @@ function BeforeYouStartComponent_div_1_Template(rf, ctx) { if (rf & 1) {
15950
16364
  i0.ɵɵproperty("ngIf", ctx_r1.serverLinkedApiError);
15951
16365
  } }
15952
16366
  function BeforeYouStartComponent_div_2_div_3_Template(rf, ctx) { if (rf & 1) {
15953
- i0.ɵɵelementStart(0, "div", 11)(1, "p", 3);
16367
+ i0.ɵɵelementStart(0, "div", 9)(1, "p", 3);
15954
16368
  i0.ɵɵtext(2, "If a group of linked cases has a lead case, you must start from the lead case.");
15955
16369
  i0.ɵɵelementEnd();
15956
16370
  i0.ɵɵelementStart(3, "p", 3);
@@ -15958,20 +16372,16 @@ function BeforeYouStartComponent_div_2_div_3_Template(rf, ctx) { if (rf & 1) {
15958
16372
  i0.ɵɵelementEnd()();
15959
16373
  } }
15960
16374
  function BeforeYouStartComponent_div_2_div_4_Template(rf, ctx) { if (rf & 1) {
15961
- i0.ɵɵelementStart(0, "div", 12)(1, "p", 3);
16375
+ i0.ɵɵelementStart(0, "div", 10)(1, "p", 3);
15962
16376
  i0.ɵɵtext(2, "If there are linked hearings for the case you need to un-link then you must unlink the hearing first.");
15963
16377
  i0.ɵɵelementEnd()();
15964
16378
  } }
15965
16379
  function BeforeYouStartComponent_div_2_Template(rf, ctx) { if (rf & 1) {
15966
- const _r3 = i0.ɵɵgetCurrentView();
15967
16380
  i0.ɵɵelementStart(0, "div")(1, "h1", 1);
15968
16381
  i0.ɵɵtext(2, "Before you start");
15969
16382
  i0.ɵɵelementEnd();
15970
16383
  i0.ɵɵtemplate(3, BeforeYouStartComponent_div_2_div_3_Template, 5, 0, "div", 7)(4, BeforeYouStartComponent_div_2_div_4_Template, 3, 0, "div", 8);
15971
- i0.ɵɵelementStart(5, "div", 9)(6, "button", 10);
15972
- i0.ɵɵlistener("click", function BeforeYouStartComponent_div_2_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onNext()); });
15973
- i0.ɵɵtext(7, "Next");
15974
- i0.ɵɵelementEnd()()();
16384
+ i0.ɵɵelementEnd();
15975
16385
  } if (rf & 2) {
15976
16386
  const ctx_r1 = i0.ɵɵnextContext();
15977
16387
  i0.ɵɵadvance(3);
@@ -15979,14 +16389,15 @@ function BeforeYouStartComponent_div_2_Template(rf, ctx) { if (rf & 1) {
15979
16389
  i0.ɵɵadvance();
15980
16390
  i0.ɵɵproperty("ngIf", !ctx_r1.isLinkCasesJourney);
15981
16391
  } }
15982
- class BeforeYouStartComponent {
16392
+ class BeforeYouStartComponent extends AbstractJourneyComponent {
15983
16393
  router;
15984
16394
  linkedCasesService;
15985
16395
  linkedCasesStateEmitter = new EventEmitter();
15986
16396
  isLinkCasesJourney = false;
15987
16397
  errorMessages;
15988
16398
  serverLinkedApiError;
15989
- constructor(router, linkedCasesService) {
16399
+ constructor(router, linkedCasesService, multipageComponentStateService) {
16400
+ super(multipageComponentStateService);
15990
16401
  this.router = router;
15991
16402
  this.linkedCasesService = linkedCasesService;
15992
16403
  this.isLinkCasesJourney = this.linkedCasesService.isLinkedCasesEventTrigger;
@@ -16003,13 +16414,22 @@ class BeforeYouStartComponent {
16003
16414
  navigateToNextPage: true
16004
16415
  });
16005
16416
  }
16417
+ next() {
16418
+ this.onNext();
16419
+ const isAnArray = Array.isArray(this.errorMessages);
16420
+ const isNotAnArray = !isAnArray;
16421
+ const isValid = (isAnArray && this.errorMessages.length === 0) || isNotAnArray;
16422
+ if (isValid) {
16423
+ super.next();
16424
+ }
16425
+ }
16006
16426
  onBack() {
16007
16427
  this.router.navigate(['cases', 'case-details', this.linkedCasesService.caseId], { fragment: 'Linked cases' });
16008
16428
  }
16009
- static ɵfac = function BeforeYouStartComponent_Factory(t) { return new (t || BeforeYouStartComponent)(i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(LinkedCasesService)); };
16010
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BeforeYouStartComponent, selectors: [["ccd-linked-cases-before-you-start"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter" }, decls: 3, vars: 2, consts: [[4, "ngIf"], [1, "govuk-heading-xl"], ["id", "unlink-cases-error", "class", "govuk-error-message", 4, "ngIf"], [1, "govuk-body"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], ["id", "unlink-cases-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "link-cases-journey", 4, "ngIf"], ["id", "manage-link-cases-journey", 4, "ngIf"], [1, "govuk-button-group"], ["type", "button", "id", "next-button", 1, "button", "button-primary", 3, "click"], ["id", "link-cases-journey"], ["id", "manage-link-cases-journey"]], template: function BeforeYouStartComponent_Template(rf, ctx) { if (rf & 1) {
16429
+ static ɵfac = function BeforeYouStartComponent_Factory(t) { return new (t || BeforeYouStartComponent)(i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
16430
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BeforeYouStartComponent, selectors: [["ccd-linked-cases-before-you-start"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 2, consts: [[4, "ngIf"], [1, "govuk-heading-xl"], ["id", "unlink-cases-error", "class", "govuk-error-message", 4, "ngIf"], [1, "govuk-body"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], ["id", "unlink-cases-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "link-cases-journey", 4, "ngIf"], ["id", "manage-link-cases-journey", 4, "ngIf"], ["id", "link-cases-journey"], ["id", "manage-link-cases-journey"]], template: function BeforeYouStartComponent_Template(rf, ctx) { if (rf & 1) {
16011
16431
  i0.ɵɵelementStart(0, "div");
16012
- i0.ɵɵtemplate(1, BeforeYouStartComponent_div_1_Template, 7, 1, "div", 0)(2, BeforeYouStartComponent_div_2_Template, 8, 2, "div", 0);
16432
+ i0.ɵɵtemplate(1, BeforeYouStartComponent_div_1_Template, 7, 1, "div", 0)(2, BeforeYouStartComponent_div_2_Template, 5, 2, "div", 0);
16013
16433
  i0.ɵɵelementEnd();
16014
16434
  } if (rf & 2) {
16015
16435
  i0.ɵɵadvance();
@@ -16020,11 +16440,11 @@ class BeforeYouStartComponent {
16020
16440
  }
16021
16441
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BeforeYouStartComponent, [{
16022
16442
  type: Component,
16023
- args: [{ selector: 'ccd-linked-cases-before-you-start', template: "<div>\n <div *ngIf=\"serverLinkedApiError\">\n <h1 class=\"govuk-heading-xl\">There is a problem</h1>\n <p id=\"unlink-cases-error\" class=\"govuk-error-message\" *ngIf=\"serverLinkedApiError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{serverLinkedApiError.message}}\n </p>\n <p class=\"govuk-body\">\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">Go back to the Linked cases tab</a>\n </p>\n </div>\n <div *ngIf=\"!serverLinkedApiError\">\n <h1 class=\"govuk-heading-xl\">Before you start</h1>\n <div id=\"link-cases-journey\" *ngIf=\"isLinkCasesJourney\">\n <p class=\"govuk-body\">If a group of linked cases has a lead case, you must start from the lead case.</p>\n <p class=\"govuk-body\">If the cases to be linked has no lead, you can start the linking journey from any of those\n cases.</p>\n </div>\n <div id=\"manage-link-cases-journey\" *ngIf=\"!isLinkCasesJourney\">\n <p class=\"govuk-body\">If there are linked hearings for the case you need to un-link then you must unlink the\n hearing first.</p>\n </div>\n <div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" id=\"next-button\" (click)=\"onNext()\">Next</button>\n </div>\n </div>\n</div>\n" }]
16024
- }], () => [{ type: i1$1.Router }, { type: LinkedCasesService }], { linkedCasesStateEmitter: [{
16443
+ args: [{ selector: 'ccd-linked-cases-before-you-start', template: "<div>\n <div *ngIf=\"serverLinkedApiError\">\n <h1 class=\"govuk-heading-xl\">There is a problem</h1>\n <p id=\"unlink-cases-error\" class=\"govuk-error-message\" *ngIf=\"serverLinkedApiError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{serverLinkedApiError.message}}\n </p>\n <p class=\"govuk-body\">\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">Go back to the Linked cases tab</a>\n </p>\n </div>\n <div *ngIf=\"!serverLinkedApiError\">\n <h1 class=\"govuk-heading-xl\">Before you start</h1>\n <div id=\"link-cases-journey\" *ngIf=\"isLinkCasesJourney\">\n <p class=\"govuk-body\">If a group of linked cases has a lead case, you must start from the lead case.</p>\n <p class=\"govuk-body\">If the cases to be linked has no lead, you can start the linking journey from any of those\n cases.</p>\n </div>\n <div id=\"manage-link-cases-journey\" *ngIf=\"!isLinkCasesJourney\">\n <p class=\"govuk-body\">If there are linked hearings for the case you need to un-link then you must unlink the\n hearing first.</p>\n </div>\n </div>\n</div>\n" }]
16444
+ }], () => [{ type: i1$1.Router }, { type: LinkedCasesService }, { type: MultipageComponentStateService }], { linkedCasesStateEmitter: [{
16025
16445
  type: Output
16026
16446
  }] }); })();
16027
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BeforeYouStartComponent, { className: "BeforeYouStartComponent", filePath: "lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.ts", lineNumber: 12 }); })();
16447
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BeforeYouStartComponent, { className: "BeforeYouStartComponent", filePath: "lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.ts", lineNumber: 14 }); })();
16028
16448
 
16029
16449
  function CheckYourAnswersComponent_table_4_tr_9_Template(rf, ctx) { if (rf & 1) {
16030
16450
  const _r1 = i0.ɵɵgetCurrentView();
@@ -16146,14 +16566,15 @@ function CheckYourAnswersComponent_tr_18_Template(rf, ctx) { if (rf & 1) {
16146
16566
  i0.ɵɵtext(2, " None ");
16147
16567
  i0.ɵɵelementEnd()();
16148
16568
  } }
16149
- class CheckYourAnswersComponent {
16569
+ class CheckYourAnswersComponent extends AbstractJourneyComponent {
16150
16570
  linkedCasesService;
16151
16571
  linkedCasesStateEmitter = new EventEmitter();
16152
16572
  linkedCases;
16153
16573
  casesToUnlink;
16154
16574
  isLinkCasesJourney;
16155
16575
  linkedCasesTableCaption;
16156
- constructor(linkedCasesService) {
16576
+ constructor(linkedCasesService, multipageComponentStateService) {
16577
+ super(multipageComponentStateService);
16157
16578
  this.linkedCasesService = linkedCasesService;
16158
16579
  }
16159
16580
  ngOnInit() {
@@ -16170,8 +16591,16 @@ class CheckYourAnswersComponent {
16170
16591
  navigateToNextPage: true
16171
16592
  });
16172
16593
  }
16173
- static ɵfac = function CheckYourAnswersComponent_Factory(t) { return new (t || CheckYourAnswersComponent)(i0.ɵɵdirectiveInject(LinkedCasesService)); };
16174
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CheckYourAnswersComponent, selectors: [["ccd-linked-cases-check-your-answers"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter" }, decls: 19, vars: 5, consts: [[1, "govuk-grid-row"], [1, "govuk-grid-column-full"], [1, "govuk-heading-xl"], ["id", "cases-to-unlink-table", "class", "govuk-table", 4, "ngIf"], ["id", "linked-cases-table", 1, "govuk-table"], [1, "govuk-table__caption", "govuk-table__caption--m"], [1, "govuk-table__head"], [1, "govuk-table__row"], ["scope", "col", 1, "govuk-table__header"], ["scope", "col", "class", "govuk-table__header", 4, "ngIf"], [1, "govuk-table__body"], ["class", "govuk-table__row", 4, "ngFor", "ngForOf"], ["class", "govuk-table__row", 4, "ngIf"], ["id", "cases-to-unlink-table", 1, "govuk-table"], [1, "govuk-table__cell"], ["href", "javascript:void(0)", 1, "govuk-link", "govuk-link--no-visited-state", "float-right", 3, "click"], ["colspan", "2", 1, "govuk-table__cell"], [4, "ngFor", "ngForOf"], ["class", "govuk-table__cell", 4, "ngIf"], [4, "ngIf"], ["colspan", "4", 1, "govuk-table__cell"]], template: function CheckYourAnswersComponent_Template(rf, ctx) { if (rf & 1) {
16594
+ next() {
16595
+ this.linkedCasesStateEmitter.emit({
16596
+ currentLinkedCasesPage: LinkedCasesPages.CHECK_YOUR_ANSWERS,
16597
+ navigateToPreviousPage: false,
16598
+ navigateToNextPage: true
16599
+ });
16600
+ super.next();
16601
+ }
16602
+ static ɵfac = function CheckYourAnswersComponent_Factory(t) { return new (t || CheckYourAnswersComponent)(i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
16603
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CheckYourAnswersComponent, selectors: [["ccd-linked-cases-check-your-answers"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 19, vars: 5, consts: [[1, "govuk-grid-row"], [1, "govuk-grid-column-full"], [1, "govuk-heading-xl"], ["id", "cases-to-unlink-table", "class", "govuk-table", 4, "ngIf"], ["id", "linked-cases-table", 1, "govuk-table"], [1, "govuk-table__caption", "govuk-table__caption--m"], [1, "govuk-table__head"], [1, "govuk-table__row"], ["scope", "col", 1, "govuk-table__header"], ["scope", "col", "class", "govuk-table__header", 4, "ngIf"], [1, "govuk-table__body"], ["class", "govuk-table__row", 4, "ngFor", "ngForOf"], ["class", "govuk-table__row", 4, "ngIf"], ["id", "cases-to-unlink-table", 1, "govuk-table"], [1, "govuk-table__cell"], ["href", "javascript:void(0)", 1, "govuk-link", "govuk-link--no-visited-state", "float-right", 3, "click"], ["colspan", "2", 1, "govuk-table__cell"], [4, "ngFor", "ngForOf"], ["class", "govuk-table__cell", 4, "ngIf"], [4, "ngIf"], ["colspan", "4", 1, "govuk-table__cell"]], template: function CheckYourAnswersComponent_Template(rf, ctx) { if (rf & 1) {
16175
16604
  i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h1", 2);
16176
16605
  i0.ɵɵtext(3, "Check your answers");
16177
16606
  i0.ɵɵelementEnd();
@@ -16207,10 +16636,10 @@ class CheckYourAnswersComponent {
16207
16636
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckYourAnswersComponent, [{
16208
16637
  type: Component,
16209
16638
  args: [{ selector: 'ccd-linked-cases-check-your-answers', template: "<div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <h1 class=\"govuk-heading-xl\">Check your answers</h1>\n <!-- Top table for manage link cases journey -->\n <table id=\"cases-to-unlink-table\" class=\"govuk-table\" *ngIf=\"!isLinkCasesJourney\">\n <caption class=\"govuk-table__caption govuk-table__caption--m\">Cases to unlink</caption>\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th scope=\"col\" class=\"govuk-table__header\">Case name and number</th>\n <th scope=\"col\" class=\"govuk-table__header\"></th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let case of casesToUnlink\">\n <td class=\"govuk-table__cell\">\n {{case.caseName}} <br> {{case.caseReference | ccdCaseReference}}\n </td>\n <td class=\"govuk-table__cell\">\n <a href=\"javascript:void(0)\" class=\"govuk-link govuk-link--no-visited-state float-right\" (click)=\"onChange()\">Change</a>\n </td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"!casesToUnlink.length\">\n <td class=\"govuk-table__cell\" colspan=\"2\">\n None\n </td>\n </tr>\n </tbody>\n </table>\n <!-- Table for both link case and manage link case journeys -->\n <table id=\"linked-cases-table\" class=\"govuk-table\">\n <caption class=\"govuk-table__caption govuk-table__caption--m\">{{linkedCasesTableCaption}}</caption>\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th scope=\"col\" class=\"govuk-table__header\">Case name and number</th>\n <th scope=\"col\" class=\"govuk-table__header\">Reasons for case link</th>\n <th scope=\"col\" class=\"govuk-table__header\"></th>\n <th scope=\"col\" class=\"govuk-table__header\" *ngIf=\"isLinkCasesJourney\"></th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let case of linkedCases\">\n <td class=\"govuk-table__cell\">\n <span>{{case.caseName}} <br> {{case.caseReference | ccdCaseReference}} </span>\n </td>\n <td class=\"govuk-table__cell\">\n <span *ngFor=\"let reason of case.reasons; last as isLast\">\n <span *ngIf=\"isLinkCasesJourney\">\n {{reason | ccdLinkCasesReasonValue}}\n </span>\n <span *ngIf=\"!isLinkCasesJourney\">\n {{reason.Reason.value | ccdLinkCasesReasonValue}}\n </span>\n <br *ngIf=\"!isLast\">\n </span>\n </td>\n <td class=\"govuk-table__cell\"></td>\n <td class=\"govuk-table__cell\" *ngIf=\"isLinkCasesJourney\">\n <a href=\"javascript:void(0)\" class=\"govuk-link govuk-link--no-visited-state float-right\" (click)=\"onChange()\">Change</a>\n </td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"!linkedCases.length\">\n <td class=\"govuk-table__cell\" colspan=\"4\">\n None\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</div>\n", styles: [".float-right{float:right}\n"] }]
16210
- }], () => [{ type: LinkedCasesService }], { linkedCasesStateEmitter: [{
16639
+ }], () => [{ type: LinkedCasesService }, { type: MultipageComponentStateService }], { linkedCasesStateEmitter: [{
16211
16640
  type: Output
16212
16641
  }] }); })();
16213
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CheckYourAnswersComponent, { className: "CheckYourAnswersComponent", filePath: "lib/shared/components/palette/linked-cases/components/check-your-answers/check-your-answers.component.ts", lineNumber: 11 }); })();
16642
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CheckYourAnswersComponent, { className: "CheckYourAnswersComponent", filePath: "lib/shared/components/palette/linked-cases/components/check-your-answers/check-your-answers.component.ts", lineNumber: 14 }); })();
16214
16643
 
16215
16644
  class ValidatorsUtils {
16216
16645
  numberLengthValidator(inputLength) {
@@ -16240,7 +16669,7 @@ class ValidatorsUtils {
16240
16669
  const _c0$J = a0 => ({ "govuk-form-group--error": a0 });
16241
16670
  const _c1$g = a0 => ({ "table-group-error": a0 });
16242
16671
  function LinkCasesComponent_div_8_span_4_Template(rf, ctx) { if (rf & 1) {
16243
- i0.ɵɵelementStart(0, "span", 30)(1, "span", 31);
16672
+ i0.ɵɵelementStart(0, "span", 28)(1, "span", 29);
16244
16673
  i0.ɵɵtext(2, "Error:");
16245
16674
  i0.ɵɵelementEnd();
16246
16675
  i0.ɵɵtext(3);
@@ -16251,7 +16680,7 @@ function LinkCasesComponent_div_8_span_4_Template(rf, ctx) { if (rf & 1) {
16251
16680
  i0.ɵɵtextInterpolate1(" ", ctx_r1.caseNumberError, " ");
16252
16681
  } }
16253
16682
  function LinkCasesComponent_div_8_span_11_Template(rf, ctx) { if (rf & 1) {
16254
- i0.ɵɵelementStart(0, "span", 30)(1, "span", 31);
16683
+ i0.ɵɵelementStart(0, "span", 28)(1, "span", 29);
16255
16684
  i0.ɵɵtext(2, "Error:");
16256
16685
  i0.ɵɵelementEnd();
16257
16686
  i0.ɵɵtext(3);
@@ -16263,10 +16692,10 @@ function LinkCasesComponent_div_8_span_11_Template(rf, ctx) { if (rf & 1) {
16263
16692
  } }
16264
16693
  function LinkCasesComponent_div_8_div_13_Template(rf, ctx) { if (rf & 1) {
16265
16694
  const _r3 = i0.ɵɵgetCurrentView();
16266
- i0.ɵɵelementStart(0, "div", 32)(1, "input", 33);
16695
+ i0.ɵɵelementStart(0, "div", 30)(1, "input", 31);
16267
16696
  i0.ɵɵlistener("change", function LinkCasesComponent_div_8_div_13_Template_input_change_1_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.toggleLinkCaseReasonOtherComments($event)); });
16268
16697
  i0.ɵɵelementEnd();
16269
- i0.ɵɵelementStart(2, "label", 34);
16698
+ i0.ɵɵelementStart(2, "label", 32);
16270
16699
  i0.ɵɵtext(3);
16271
16700
  i0.ɵɵelementEnd()();
16272
16701
  } if (rf & 2) {
@@ -16282,7 +16711,7 @@ function LinkCasesComponent_div_8_div_13_Template(rf, ctx) { if (rf & 1) {
16282
16711
  i0.ɵɵtextInterpolate(reason_r4.value_en);
16283
16712
  } }
16284
16713
  function LinkCasesComponent_div_8_div_14_span_3_Template(rf, ctx) { if (rf & 1) {
16285
- i0.ɵɵelementStart(0, "span", 30)(1, "span", 31);
16714
+ i0.ɵɵelementStart(0, "span", 28)(1, "span", 29);
16286
16715
  i0.ɵɵtext(2, "Error:");
16287
16716
  i0.ɵɵelementEnd();
16288
16717
  i0.ɵɵtext(3);
@@ -16293,14 +16722,14 @@ function LinkCasesComponent_div_8_div_14_span_3_Template(rf, ctx) { if (rf & 1)
16293
16722
  i0.ɵɵtextInterpolate1(" ", ctx_r1.caseReasonCommentsError, " ");
16294
16723
  } }
16295
16724
  function LinkCasesComponent_div_8_div_14_Template(rf, ctx) { if (rf & 1) {
16296
- i0.ɵɵelementStart(0, "div", 35)(1, "h3", 22);
16725
+ i0.ɵɵelementStart(0, "div", 33)(1, "h3", 20);
16297
16726
  i0.ɵɵtext(2, "Comments");
16298
16727
  i0.ɵɵelementEnd();
16299
16728
  i0.ɵɵtemplate(3, LinkCasesComponent_div_8_div_14_span_3_Template, 4, 1, "span", 6);
16300
- i0.ɵɵelementStart(4, "textarea", 36);
16729
+ i0.ɵɵelementStart(4, "textarea", 34);
16301
16730
  i0.ɵɵtext(5, " ");
16302
16731
  i0.ɵɵelementEnd();
16303
- i0.ɵɵelementStart(6, "div", 37);
16732
+ i0.ɵɵelementStart(6, "div", 35);
16304
16733
  i0.ɵɵtext(7, " You can enter up to 100 characters ");
16305
16734
  i0.ɵɵelementEnd()();
16306
16735
  } if (rf & 2) {
@@ -16310,7 +16739,7 @@ function LinkCasesComponent_div_8_div_14_Template(rf, ctx) { if (rf & 1) {
16310
16739
  i0.ɵɵproperty("ngIf", ctx_r1.caseReasonCommentsError);
16311
16740
  } }
16312
16741
  function LinkCasesComponent_div_8_span_17_Template(rf, ctx) { if (rf & 1) {
16313
- i0.ɵɵelementStart(0, "span", 30)(1, "span", 31);
16742
+ i0.ɵɵelementStart(0, "span", 28)(1, "span", 29);
16314
16743
  i0.ɵɵtext(2, "Error:");
16315
16744
  i0.ɵɵelementEnd();
16316
16745
  i0.ɵɵtext(3);
@@ -16322,26 +16751,26 @@ function LinkCasesComponent_div_8_span_17_Template(rf, ctx) { if (rf & 1) {
16322
16751
  } }
16323
16752
  function LinkCasesComponent_div_8_Template(rf, ctx) { if (rf & 1) {
16324
16753
  const _r1 = i0.ɵɵgetCurrentView();
16325
- i0.ɵɵelementStart(0, "div", 21)(1, "div", 5)(2, "h3", 22);
16754
+ i0.ɵɵelementStart(0, "div", 19)(1, "div", 5)(2, "h3", 20);
16326
16755
  i0.ɵɵtext(3, "Enter case reference");
16327
16756
  i0.ɵɵelementEnd();
16328
16757
  i0.ɵɵtemplate(4, LinkCasesComponent_div_8_span_4_Template, 4, 1, "span", 6);
16329
- i0.ɵɵelement(5, "input", 23);
16758
+ i0.ɵɵelement(5, "input", 21);
16330
16759
  i0.ɵɵelementEnd();
16331
- i0.ɵɵelementStart(6, "div", 24)(7, "h3", 22);
16760
+ i0.ɵɵelementStart(6, "div", 22)(7, "h3", 20);
16332
16761
  i0.ɵɵtext(8, "Why should these cases be linked?");
16333
16762
  i0.ɵɵelementEnd();
16334
- i0.ɵɵelementStart(9, "div", 25);
16763
+ i0.ɵɵelementStart(9, "div", 23);
16335
16764
  i0.ɵɵtext(10, " Select all that apply. ");
16336
16765
  i0.ɵɵelementEnd();
16337
16766
  i0.ɵɵtemplate(11, LinkCasesComponent_div_8_span_11_Template, 4, 1, "span", 6);
16338
- i0.ɵɵelementStart(12, "div", 26);
16339
- i0.ɵɵtemplate(13, LinkCasesComponent_div_8_div_13_Template, 4, 5, "div", 27);
16767
+ i0.ɵɵelementStart(12, "div", 24);
16768
+ i0.ɵɵtemplate(13, LinkCasesComponent_div_8_div_13_Template, 4, 5, "div", 25);
16340
16769
  i0.ɵɵelementEnd()();
16341
- i0.ɵɵtemplate(14, LinkCasesComponent_div_8_div_14_Template, 8, 4, "div", 28);
16770
+ i0.ɵɵtemplate(14, LinkCasesComponent_div_8_div_14_Template, 8, 4, "div", 26);
16342
16771
  i0.ɵɵelement(15, "br")(16, "br");
16343
16772
  i0.ɵɵtemplate(17, LinkCasesComponent_div_8_span_17_Template, 4, 1, "span", 6);
16344
- i0.ɵɵelementStart(18, "button", 29);
16773
+ i0.ɵɵelementStart(18, "button", 27);
16345
16774
  i0.ɵɵlistener("click", function LinkCasesComponent_div_8_Template_button_click_18_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.submitCaseInfo()); });
16346
16775
  i0.ɵɵtext(19, "Propose case link");
16347
16776
  i0.ɵɵelementEnd()();
@@ -16364,7 +16793,7 @@ function LinkCasesComponent_div_8_Template(rf, ctx) { if (rf & 1) {
16364
16793
  i0.ɵɵproperty("ngIf", ctx_r1.caseSelectionError);
16365
16794
  } }
16366
16795
  function LinkCasesComponent_span_13_Template(rf, ctx) { if (rf & 1) {
16367
- i0.ɵɵelementStart(0, "span", 30)(1, "span", 31);
16796
+ i0.ɵɵelementStart(0, "span", 28)(1, "span", 29);
16368
16797
  i0.ɵɵtext(2, "Error:");
16369
16798
  i0.ɵɵelementEnd();
16370
16799
  i0.ɵɵtext(3);
@@ -16387,27 +16816,27 @@ function LinkCasesComponent_tr_31_span_15_Template(rf, ctx) { if (rf & 1) {
16387
16816
  } }
16388
16817
  function LinkCasesComponent_tr_31_Template(rf, ctx) { if (rf & 1) {
16389
16818
  const _r6 = i0.ɵɵgetCurrentView();
16390
- i0.ɵɵelementStart(0, "tr", 10)(1, "td", 38);
16391
- i0.ɵɵelement(2, "div", 39);
16819
+ i0.ɵɵelementStart(0, "tr", 10)(1, "td", 36);
16820
+ i0.ɵɵelement(2, "div", 37);
16392
16821
  i0.ɵɵelementStart(3, "span");
16393
16822
  i0.ɵɵtext(4);
16394
16823
  i0.ɵɵelement(5, "br");
16395
16824
  i0.ɵɵtext(6);
16396
16825
  i0.ɵɵpipe(7, "ccdCaseReference");
16397
16826
  i0.ɵɵelementEnd()();
16398
- i0.ɵɵelementStart(8, "td", 40);
16827
+ i0.ɵɵelementStart(8, "td", 38);
16399
16828
  i0.ɵɵtext(9);
16400
16829
  i0.ɵɵelementEnd();
16401
- i0.ɵɵelementStart(10, "td", 38);
16830
+ i0.ɵɵelementStart(10, "td", 36);
16402
16831
  i0.ɵɵtext(11);
16403
16832
  i0.ɵɵelementEnd();
16404
- i0.ɵɵelementStart(12, "td", 40);
16833
+ i0.ɵɵelementStart(12, "td", 38);
16405
16834
  i0.ɵɵtext(13);
16406
16835
  i0.ɵɵelementEnd();
16407
- i0.ɵɵelementStart(14, "td", 38);
16408
- i0.ɵɵtemplate(15, LinkCasesComponent_tr_31_span_15_Template, 4, 3, "span", 41);
16836
+ i0.ɵɵelementStart(14, "td", 36);
16837
+ i0.ɵɵtemplate(15, LinkCasesComponent_tr_31_span_15_Template, 4, 3, "span", 39);
16409
16838
  i0.ɵɵelementEnd();
16410
- i0.ɵɵelementStart(16, "td", 38)(17, "a", 42);
16839
+ i0.ɵɵelementStart(16, "td", 36)(17, "a", 40);
16411
16840
  i0.ɵɵlistener("click", function LinkCasesComponent_tr_31_Template_a_click_17_listener() { const ctx_r7 = i0.ɵɵrestoreView(_r6); const case_r9 = ctx_r7.$implicit; const pos_r10 = ctx_r7.index; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onSelectedLinkedCaseRemove(pos_r10, case_r9.caseReference)); });
16412
16841
  i0.ɵɵtext(18, "Remove");
16413
16842
  i0.ɵɵelementEnd()()();
@@ -16436,11 +16865,11 @@ function LinkCasesComponent_tr_31_Template(rf, ctx) { if (rf & 1) {
16436
16865
  i0.ɵɵattribute("id", case_r9.caseReference);
16437
16866
  } }
16438
16867
  function LinkCasesComponent_tr_32_Template(rf, ctx) { if (rf & 1) {
16439
- i0.ɵɵelementStart(0, "tr", 10)(1, "td", 43);
16868
+ i0.ɵɵelementStart(0, "tr", 10)(1, "td", 41);
16440
16869
  i0.ɵɵtext(2, " None ");
16441
16870
  i0.ɵɵelementEnd()();
16442
16871
  } }
16443
- class LinkCasesComponent {
16872
+ class LinkCasesComponent extends AbstractJourneyComponent {
16444
16873
  casesService;
16445
16874
  fb;
16446
16875
  validatorsUtils;
@@ -16459,7 +16888,8 @@ class LinkCasesComponent {
16459
16888
  linkCaseReasons;
16460
16889
  showComments = false;
16461
16890
  ISO_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSS';
16462
- constructor(casesService, fb, validatorsUtils, linkedCasesService) {
16891
+ constructor(casesService, fb, validatorsUtils, linkedCasesService, multipageComponentStateService) {
16892
+ super(multipageComponentStateService);
16463
16893
  this.casesService = casesService;
16464
16894
  this.fb = fb;
16465
16895
  this.validatorsUtils = validatorsUtils;
@@ -16470,7 +16900,11 @@ class LinkCasesComponent {
16470
16900
  this.caseName = this.linkedCasesService.caseName;
16471
16901
  this.linkCaseReasons = this.linkedCasesService.linkCaseReasons;
16472
16902
  this.initForm();
16473
- if (this.linkedCasesService.editMode) {
16903
+ if (!this.linkedCasesService.hasNavigatedInJourney) {
16904
+ this.linkedCasesService.linkedCases = [];
16905
+ this.linkedCasesService.caseFieldValue = [];
16906
+ }
16907
+ if (this.linkedCasesService.editMode || this.linkedCasesService.linkedCases.length) {
16474
16908
  // this may have includes the currently added one but yet to be submitted.
16475
16909
  this.selectedCases = this.linkedCasesService.linkedCases;
16476
16910
  }
@@ -16479,8 +16913,9 @@ class LinkCasesComponent {
16479
16913
  }
16480
16914
  }
16481
16915
  initForm() {
16916
+ const caseNumber = this.linkedCasesService.storedCaseNumber ?? '';
16482
16917
  this.linkCaseForm = this.fb.group({
16483
- caseNumber: ['', [Validators.minLength(16), this.validatorsUtils.regexPattern(Patterns.CASE_REF)]],
16918
+ caseNumber: [caseNumber, [Validators.minLength(16), this.validatorsUtils.regexPattern(Patterns.CASE_REF)]],
16484
16919
  reasonType: this.getReasonTypeFormArray,
16485
16920
  otherDescription: ['', [Validators.maxLength(100)]]
16486
16921
  });
@@ -16513,6 +16948,8 @@ class LinkCasesComponent {
16513
16948
  !this.isCaseSelected(this.linkedCasesService.linkedCases) &&
16514
16949
  !this.isCaseSelectedSameAsCurrentCase() &&
16515
16950
  !this.isOtherOptionSelectedButOtherDescriptionNotEntered()) {
16951
+ this.linkedCasesService.storedCaseNumber = '';
16952
+ this.linkedCasesService.hasNavigatedInJourney = true;
16516
16953
  this.getCaseInfo();
16517
16954
  }
16518
16955
  else {
@@ -16617,9 +17054,7 @@ class LinkCasesComponent {
16617
17054
  CreatedDateTime: moment(new Date()).format(this.ISO_FORMAT),
16618
17055
  ReasonForLink: this.getSelectedCCDTypeCaseReason()
16619
17056
  };
16620
- if (!this.linkedCasesService.caseFieldValue) {
16621
- this.linkedCasesService.caseFieldValue = [];
16622
- }
17057
+ this.linkedCasesService.caseFieldValue = [];
16623
17058
  this.linkedCasesService.caseFieldValue.push({ id: caseView.case_id.toString(), value: ccdApiCaseLinkData });
16624
17059
  this.selectedCases.push(caseLink);
16625
17060
  this.linkCaseReasons.forEach(reason => reason.selected = false);
@@ -16690,6 +17125,7 @@ class LinkCasesComponent {
16690
17125
  this.caseSelectionError = null;
16691
17126
  this.noSelectedCaseError = null;
16692
17127
  let navigateToNextPage = true;
17128
+ this.linkedCasesService.storedCaseNumber = this.linkCaseForm.value.caseNumber ?? '';
16693
17129
  if (this.selectedCases.length) {
16694
17130
  this.linkedCasesService.linkedCases = this.selectedCases;
16695
17131
  }
@@ -16704,8 +17140,14 @@ class LinkCasesComponent {
16704
17140
  }
16705
17141
  this.emitLinkedCasesState(navigateToNextPage);
16706
17142
  }
16707
- static ɵfac = function LinkCasesComponent_Factory(t) { return new (t || LinkCasesComponent)(i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(ValidatorsUtils), i0.ɵɵdirectiveInject(LinkedCasesService)); };
16708
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LinkCasesComponent, selectors: [["ccd-link-cases"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter" }, decls: 36, vars: 11, consts: [[1, "govuk-grid-row"], [1, "govuk-grid-column-full"], [1, "govuk-caption-l"], [1, "govuk-heading-xl"], ["class", "form-group", 3, "formGroup", 4, "ngIf"], ["id", "caseNumber", 1, "govuk-form-group", 3, "ngClass"], ["class", "govuk-error-message", 4, "ngIf"], [1, "govuk-table"], [1, "govuk-table__caption", "govuk-table__caption--m"], [1, "govuk-table__head"], [1, "govuk-table__row"], ["scope", "col", "width", "300", 1, "govuk-table__header"], ["scope", "col", "width", "150", 1, "govuk-table__header"], ["scope", "col", "width", "200", 1, "govuk-table__header"], ["scope", "col", "width", "400", 1, "govuk-table__header"], ["scope", "col", "width", "50", 1, "govuk-table__header"], [1, "govuk-table__body"], ["class", "govuk-table__row", 4, "ngFor", "ngForOf"], ["class", "govuk-table__row", 4, "ngIf"], [1, "govuk-button-group"], ["type", "button", "id", "next-button", 1, "button", "button-primary", 3, "click"], [1, "form-group", 3, "formGroup"], [1, "govuk-heading-s"], ["formControlName", "caseNumber", "id", "width-20", "name", "width-20", "type", "text", 1, "govuk-input", "govuk-input--width-20"], [1, "govuk-!-margin-top-3", 3, "ngClass"], ["id", "waste-hint", 1, "govuk-hint"], ["data-module", "govuk-checkboxes", "formArrayName", "reasonType", "id", "caseReason", 1, "govuk-checkboxes"], ["class", "govuk-checkboxes__item", 3, "formGroupName", 4, "ngFor", "ngForOf"], ["id", "other-description-char-limit-error", "class", "govuk-!-margin-top-3", 3, "ngClass", 4, "ngIf"], ["id", "propose", "type", "button", "data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", 3, "click"], [1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-checkboxes__item", 3, "formGroupName"], ["formControlName", "selected", "name", "pos", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "change", "id", "value"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"], ["id", "other-description-char-limit-error", 1, "govuk-!-margin-top-3", 3, "ngClass"], ["id", "otherDescription", "name", "otherDescription", "formControlName", "otherDescription", "rows", "5", "aria-describedby", "other-description-hint other-description-char-limit-info other-description-char-limit-error", 1, "govuk-textarea", "govuk-input--width-30"], ["id", "other-description-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-table__cell"], [1, "govuk-form-group--error", 3, "ngClass"], [1, "govuk-table__cell", 3, "title"], [4, "ngFor", "ngForOf"], [1, "govuk-link", "no-visited-state", 3, "click"], ["colspan", "6", 1, "govuk-table__cell"]], template: function LinkCasesComponent_Template(rf, ctx) { if (rf & 1) {
17143
+ next() {
17144
+ this.onNext();
17145
+ if (this.errorMessages.length === 0) {
17146
+ super.next();
17147
+ }
17148
+ }
17149
+ static ɵfac = function LinkCasesComponent_Factory(t) { return new (t || LinkCasesComponent)(i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(ValidatorsUtils), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
17150
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LinkCasesComponent, selectors: [["ccd-link-cases"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 33, vars: 11, consts: [[1, "govuk-grid-row"], [1, "govuk-grid-column-full"], [1, "govuk-caption-l"], [1, "govuk-heading-xl"], ["class", "form-group", 3, "formGroup", 4, "ngIf"], ["id", "caseNumber", 1, "govuk-form-group", 3, "ngClass"], ["class", "govuk-error-message", 4, "ngIf"], [1, "govuk-table"], [1, "govuk-table__caption", "govuk-table__caption--m"], [1, "govuk-table__head"], [1, "govuk-table__row"], ["scope", "col", "width", "300", 1, "govuk-table__header"], ["scope", "col", "width", "150", 1, "govuk-table__header"], ["scope", "col", "width", "200", 1, "govuk-table__header"], ["scope", "col", "width", "400", 1, "govuk-table__header"], ["scope", "col", "width", "50", 1, "govuk-table__header"], [1, "govuk-table__body"], ["class", "govuk-table__row", 4, "ngFor", "ngForOf"], ["class", "govuk-table__row", 4, "ngIf"], [1, "form-group", 3, "formGroup"], [1, "govuk-heading-s"], ["formControlName", "caseNumber", "id", "width-20", "name", "width-20", "type", "text", 1, "govuk-input", "govuk-input--width-20"], [1, "govuk-!-margin-top-3", 3, "ngClass"], ["id", "waste-hint", 1, "govuk-hint"], ["data-module", "govuk-checkboxes", "formArrayName", "reasonType", "id", "caseReason", 1, "govuk-checkboxes"], ["class", "govuk-checkboxes__item", 3, "formGroupName", 4, "ngFor", "ngForOf"], ["id", "other-description-char-limit-error", "class", "govuk-!-margin-top-3", 3, "ngClass", 4, "ngIf"], ["id", "propose", "type", "button", "data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", 3, "click"], [1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-checkboxes__item", 3, "formGroupName"], ["formControlName", "selected", "name", "pos", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "change", "id", "value"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"], ["id", "other-description-char-limit-error", 1, "govuk-!-margin-top-3", 3, "ngClass"], ["id", "otherDescription", "name", "otherDescription", "formControlName", "otherDescription", "rows", "5", "aria-describedby", "other-description-hint other-description-char-limit-info other-description-char-limit-error", 1, "govuk-textarea", "govuk-input--width-30"], ["id", "other-description-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-table__cell"], [1, "govuk-form-group--error", 3, "ngClass"], [1, "govuk-table__cell", 3, "title"], [4, "ngFor", "ngForOf"], [1, "govuk-link", "no-visited-state", 3, "click"], ["colspan", "6", 1, "govuk-table__cell"]], template: function LinkCasesComponent_Template(rf, ctx) { if (rf & 1) {
16709
17151
  i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div")(3, "span", 2);
16710
17152
  i0.ɵɵtext(4);
16711
17153
  i0.ɵɵpipe(5, "ccdCaseReference");
@@ -16739,11 +17181,7 @@ class LinkCasesComponent {
16739
17181
  i0.ɵɵelementEnd()();
16740
17182
  i0.ɵɵelementStart(30, "tbody", 16);
16741
17183
  i0.ɵɵtemplate(31, LinkCasesComponent_tr_31_Template, 19, 14, "tr", 17)(32, LinkCasesComponent_tr_32_Template, 3, 0, "tr", 18);
16742
- i0.ɵɵelementEnd()()();
16743
- i0.ɵɵelementStart(33, "div", 19)(34, "button", 20);
16744
- i0.ɵɵlistener("click", function LinkCasesComponent_Template_button_click_34_listener() { return ctx.onNext(); });
16745
- i0.ɵɵtext(35, "Next");
16746
- i0.ɵɵelementEnd()()()()();
17184
+ i0.ɵɵelementEnd()()()()()();
16747
17185
  } if (rf & 2) {
16748
17186
  i0.ɵɵadvance(4);
16749
17187
  i0.ɵɵtextInterpolate2("Link cases to ", ctx.caseName, " ", i0.ɵɵpipeBind1(5, 7, ctx.caseId), "");
@@ -16761,11 +17199,11 @@ class LinkCasesComponent {
16761
17199
  }
16762
17200
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LinkCasesComponent, [{
16763
17201
  type: Component,
16764
- args: [{ selector: 'ccd-link-cases', template: "<div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <div>\n <span class=\"govuk-caption-l\">Link cases to {{caseName}} {{caseId | ccdCaseReference}}</span>\n <h1 class=\"govuk-heading-xl\">Select a&nbsp;case you want to link to this case</h1>\n <div class=\"form-group\" [formGroup]=\"linkCaseForm\" *ngIf=\"linkCaseForm\">\n <div class=\"govuk-form-group\" id=\"caseNumber\" [ngClass]=\"{'govuk-form-group--error': !!caseNumberError}\">\n <h3 class=\"govuk-heading-s\">Enter case reference</h3>\n <span class=\"govuk-error-message\" *ngIf=\"caseNumberError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseNumberError}}\n </span>\n <input class=\"govuk-input govuk-input--width-20\" formControlName=\"caseNumber\" id=\"width-20\" name=\"width-20\"\n type=\"text\">\n </div>\n <div [ngClass]=\"{'govuk-form-group--error': !!caseReasonError}\" class=\"govuk-!-margin-top-3\">\n <h3 class=\"govuk-heading-s\">Why should these cases be linked?</h3>\n <div id=\"waste-hint\" class=\"govuk-hint\">\n Select all that apply.\n </div>\n <span class=\"govuk-error-message\" *ngIf=\"caseReasonError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseReasonError}}\n </span>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\" formArrayName=\"reasonType\" id=\"caseReason\">\n <div class=\"govuk-checkboxes__item\" *ngFor=\"let reason of linkCaseReasons;index as pos\" [formGroupName]=\"pos\">\n <input class=\"govuk-checkboxes__input\" id=\"{{reason.key}}\" formControlName=\"selected\" name=\"pos\"\n type=\"checkbox\" [value]=\"reason.value_en\" (change)=\"toggleLinkCaseReasonOtherComments($event)\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"{{reason.key}}\">{{reason.value_en}}</label>\n </div>\n </div>\n </div>\n <div id=\"other-description-char-limit-error\" [ngClass]=\"{'govuk-form-group--error': !!caseReasonCommentsError}\" class=\"govuk-!-margin-top-3\" *ngIf=\"showComments\">\n <h3 class=\"govuk-heading-s\">Comments</h3>\n <span class=\"govuk-error-message\" *ngIf=\"caseReasonCommentsError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseReasonCommentsError}}\n </span>\n <textarea class=\"govuk-textarea govuk-input--width-30\" id=\"otherDescription\"\n name=\"otherDescription\" formControlName=\"otherDescription\" rows=\"5\"\n aria-describedby=\"other-description-hint other-description-char-limit-info other-description-char-limit-error\">\n </textarea>\n <div id=\"other-description-char-limit-info\" aria-live=\"polite\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 100 characters\n </div>\n </div>\n <br><br>\n <span class=\"govuk-error-message\" *ngIf=\"caseSelectionError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseSelectionError}}\n </span>\n <button id=\"propose\" type=\"button\" class=\"govuk-button govuk-button--secondary\" data-module=\"govuk-button\"\n (click)=\"submitCaseInfo()\">Propose case link</button>\n </div>\n <hr>\n <br><br>\n <div class=\"govuk-form-group\" id=\"caseNumber\" [ngClass]=\"{'govuk-form-group--error': !!noSelectedCaseError}\">\n <span class=\"govuk-error-message\" *ngIf=\"noSelectedCaseError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{noSelectedCaseError}}\n </span>\n <table class=\"govuk-table\">\n <caption class=\"govuk-table__caption govuk-table__caption--m\">Proposed case links </caption>\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th scope=\"col\" class=\"govuk-table__header\" width=\"300\">Case name and number</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"150\">Case type </th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"200\">Service</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"200\">State</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"400\">Reasons for case link</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"50\"></th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let case of selectedCases; let pos = index\">\n <td class=\"govuk-table__cell\">\n <div class=\"govuk-form-group--error\"\n [ngClass]=\"{'table-group-error':caseSelectionError && case.caseReference === linkCaseForm.value.caseNumber}\">\n </div>\n <span>{{case.caseName}} <br> {{case.caseReference | ccdCaseReference}}</span>\n </td>\n <td class=\"govuk-table__cell\" [title]=\"case.caseTypeDescription\">{{case.caseType}}</td>\n <td class=\"govuk-table__cell\">{{case.caseService}}</td>\n <td class=\"govuk-table__cell\" [title]=\"case.caseStateDescription\">{{case.caseState}}</td>\n <td class=\"govuk-table__cell\"><span\n *ngFor=\"let reason of case.reasons\">{{reason | ccdLinkCasesReasonValue}}<br></span></td>\n <td class=\"govuk-table__cell\"><a [attr.id]=\"case.caseReference\" (click)=\"onSelectedLinkedCaseRemove(pos, case.caseReference);\"\n class=\"govuk-link no-visited-state\">Remove</a></td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"!selectedCases.length\">\n <td class=\"govuk-table__cell\" colspan=\"6\">\n None\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" id=\"next-button\" (click)=\"onNext()\">Next</button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".no-visited-state{color:#1d70b8;cursor:pointer}.no-visited-state:hover{color:#003078}.govuk-checkboxes{display:flex;flex-direction:column;flex-wrap:wrap;max-height:500px;width:100%;overflow-x:auto;overflow-y:hidden;padding-top:5px}.govuk-checkboxes .govuk-checkboxes__item{display:flex}::ng-deep .govuk-width-container .screen-990 .width-50{width:100%}.govuk-table__row{position:relative}.govuk-table__row .table-group-error{position:absolute;height:calc(100% - 20px);margin-left:-15px}\n"] }]
16765
- }], () => [{ type: CasesService }, { type: i4.FormBuilder }, { type: ValidatorsUtils }, { type: LinkedCasesService }], { linkedCasesStateEmitter: [{
17202
+ args: [{ selector: 'ccd-link-cases', template: "<div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <div>\n <span class=\"govuk-caption-l\">Link cases to {{caseName}} {{caseId | ccdCaseReference}}</span>\n <h1 class=\"govuk-heading-xl\">Select a&nbsp;case you want to link to this case</h1>\n <div class=\"form-group\" [formGroup]=\"linkCaseForm\" *ngIf=\"linkCaseForm\">\n <div class=\"govuk-form-group\" id=\"caseNumber\" [ngClass]=\"{'govuk-form-group--error': !!caseNumberError}\">\n <h3 class=\"govuk-heading-s\">Enter case reference</h3>\n <span class=\"govuk-error-message\" *ngIf=\"caseNumberError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseNumberError}}\n </span>\n <input class=\"govuk-input govuk-input--width-20\" formControlName=\"caseNumber\" id=\"width-20\" name=\"width-20\"\n type=\"text\">\n </div>\n <div [ngClass]=\"{'govuk-form-group--error': !!caseReasonError}\" class=\"govuk-!-margin-top-3\">\n <h3 class=\"govuk-heading-s\">Why should these cases be linked?</h3>\n <div id=\"waste-hint\" class=\"govuk-hint\">\n Select all that apply.\n </div>\n <span class=\"govuk-error-message\" *ngIf=\"caseReasonError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseReasonError}}\n </span>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\" formArrayName=\"reasonType\" id=\"caseReason\">\n <div class=\"govuk-checkboxes__item\" *ngFor=\"let reason of linkCaseReasons;index as pos\" [formGroupName]=\"pos\">\n <input class=\"govuk-checkboxes__input\" id=\"{{reason.key}}\" formControlName=\"selected\" name=\"pos\"\n type=\"checkbox\" [value]=\"reason.value_en\" (change)=\"toggleLinkCaseReasonOtherComments($event)\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"{{reason.key}}\">{{reason.value_en}}</label>\n </div>\n </div>\n </div>\n <div id=\"other-description-char-limit-error\" [ngClass]=\"{'govuk-form-group--error': !!caseReasonCommentsError}\" class=\"govuk-!-margin-top-3\" *ngIf=\"showComments\">\n <h3 class=\"govuk-heading-s\">Comments</h3>\n <span class=\"govuk-error-message\" *ngIf=\"caseReasonCommentsError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseReasonCommentsError}}\n </span>\n <textarea class=\"govuk-textarea govuk-input--width-30\" id=\"otherDescription\"\n name=\"otherDescription\" formControlName=\"otherDescription\" rows=\"5\"\n aria-describedby=\"other-description-hint other-description-char-limit-info other-description-char-limit-error\">\n </textarea>\n <div id=\"other-description-char-limit-info\" aria-live=\"polite\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 100 characters\n </div>\n </div>\n <br><br>\n <span class=\"govuk-error-message\" *ngIf=\"caseSelectionError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseSelectionError}}\n </span>\n <button id=\"propose\" type=\"button\" class=\"govuk-button govuk-button--secondary\" data-module=\"govuk-button\"\n (click)=\"submitCaseInfo()\">Propose case link</button>\n </div>\n <hr>\n <br><br>\n <div class=\"govuk-form-group\" id=\"caseNumber\" [ngClass]=\"{'govuk-form-group--error': !!noSelectedCaseError}\">\n <span class=\"govuk-error-message\" *ngIf=\"noSelectedCaseError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{noSelectedCaseError}}\n </span>\n <table class=\"govuk-table\">\n <caption class=\"govuk-table__caption govuk-table__caption--m\">Proposed case links </caption>\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th scope=\"col\" class=\"govuk-table__header\" width=\"300\">Case name and number</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"150\">Case type </th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"200\">Service</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"200\">State</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"400\">Reasons for case link</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"50\"></th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let case of selectedCases; let pos = index\">\n <td class=\"govuk-table__cell\">\n <div class=\"govuk-form-group--error\"\n [ngClass]=\"{'table-group-error':caseSelectionError && case.caseReference === linkCaseForm.value.caseNumber}\">\n </div>\n <span>{{case.caseName}} <br> {{case.caseReference | ccdCaseReference}}</span>\n </td>\n <td class=\"govuk-table__cell\" [title]=\"case.caseTypeDescription\">{{case.caseType}}</td>\n <td class=\"govuk-table__cell\">{{case.caseService}}</td>\n <td class=\"govuk-table__cell\" [title]=\"case.caseStateDescription\">{{case.caseState}}</td>\n <td class=\"govuk-table__cell\"><span\n *ngFor=\"let reason of case.reasons\">{{reason | ccdLinkCasesReasonValue}}<br></span></td>\n <td class=\"govuk-table__cell\"><a [attr.id]=\"case.caseReference\" (click)=\"onSelectedLinkedCaseRemove(pos, case.caseReference);\"\n class=\"govuk-link no-visited-state\">Remove</a></td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"!selectedCases.length\">\n <td class=\"govuk-table__cell\" colspan=\"6\">\n None\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n</div>\n", styles: [".no-visited-state{color:#1d70b8;cursor:pointer}.no-visited-state:hover{color:#003078}.govuk-checkboxes{display:flex;flex-direction:column;flex-wrap:wrap;max-height:500px;width:100%;overflow-x:auto;overflow-y:hidden;padding-top:5px}.govuk-checkboxes .govuk-checkboxes__item{display:flex}::ng-deep .govuk-width-container .screen-990 .width-50{width:100%}.govuk-table__row{position:relative}.govuk-table__row .table-group-error{position:absolute;height:calc(100% - 20px);margin-left:-15px}\n"] }]
17203
+ }], () => [{ type: CasesService }, { type: i4.FormBuilder }, { type: ValidatorsUtils }, { type: LinkedCasesService }, { type: MultipageComponentStateService }], { linkedCasesStateEmitter: [{
16766
17204
  type: Output
16767
17205
  }] }); })();
16768
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LinkCasesComponent, { className: "LinkCasesComponent", filePath: "lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.ts", lineNumber: 24 }); })();
17206
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LinkCasesComponent, { className: "LinkCasesComponent", filePath: "lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.ts", lineNumber: 26 }); })();
16769
17207
 
16770
17208
  function LinkedCasesFromTableComponent_a_0_Template(rf, ctx) { if (rf & 1) {
16771
17209
  const _r1 = i0.ɵɵgetCurrentView();
@@ -17301,11 +17739,12 @@ function NoLinkedCasesComponent_ng_template_4_Template(rf, ctx) { if (rf & 1) {
17301
17739
  i0.ɵɵtext(1, "There are no cases linked to this one.");
17302
17740
  i0.ɵɵelementEnd();
17303
17741
  } }
17304
- class NoLinkedCasesComponent {
17742
+ class NoLinkedCasesComponent extends AbstractJourneyComponent {
17305
17743
  router;
17306
17744
  linkedCasesService;
17307
17745
  serverLinkedApiError;
17308
- constructor(router, linkedCasesService) {
17746
+ constructor(router, linkedCasesService, multipageComponentStateService) {
17747
+ super(multipageComponentStateService);
17309
17748
  this.router = router;
17310
17749
  this.linkedCasesService = linkedCasesService;
17311
17750
  }
@@ -17315,8 +17754,8 @@ class NoLinkedCasesComponent {
17315
17754
  onBack() {
17316
17755
  this.router.navigate(['cases', 'case-details', this.linkedCasesService.caseId], { fragment: 'Linked cases' });
17317
17756
  }
17318
- static ɵfac = function NoLinkedCasesComponent_Factory(t) { return new (t || NoLinkedCasesComponent)(i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(LinkedCasesService)); };
17319
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NoLinkedCasesComponent, selectors: [["ccd-no-linked-cases"]], decls: 12, vars: 3, consts: [["noLinkedCases", ""], [1, "govuk-grid-row"], [1, "govuk-grid-column-full"], ["class", "govuk-heading-xl", 4, "ngIf"], ["id", "unlink-cases-error", "class", "govuk-error-message", 4, "ngIf", "ngIfElse"], [1, "govuk-body"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], [1, "govuk-button-group"], ["type", "button", "id", "back-button", 1, "button", "button-primary", 3, "click"], [1, "govuk-heading-xl"], ["id", "unlink-cases-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"]], template: function NoLinkedCasesComponent_Template(rf, ctx) { if (rf & 1) {
17757
+ static ɵfac = function NoLinkedCasesComponent_Factory(t) { return new (t || NoLinkedCasesComponent)(i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
17758
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NoLinkedCasesComponent, selectors: [["ccd-no-linked-cases"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 12, vars: 3, consts: [["noLinkedCases", ""], [1, "govuk-grid-row"], [1, "govuk-grid-column-full"], ["class", "govuk-heading-xl", 4, "ngIf"], ["id", "unlink-cases-error", "class", "govuk-error-message", 4, "ngIf", "ngIfElse"], [1, "govuk-body"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], [1, "govuk-button-group"], ["type", "button", "id", "back-button", 1, "button", "button-primary", 3, "click"], [1, "govuk-heading-xl"], ["id", "unlink-cases-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"]], template: function NoLinkedCasesComponent_Template(rf, ctx) { if (rf & 1) {
17320
17759
  const _r1 = i0.ɵɵgetCurrentView();
17321
17760
  i0.ɵɵelementStart(0, "div", 1)(1, "div", 2);
17322
17761
  i0.ɵɵtemplate(2, NoLinkedCasesComponent_h1_2_Template, 2, 0, "h1", 3)(3, NoLinkedCasesComponent_p_3_Template, 4, 1, "p", 4)(4, NoLinkedCasesComponent_ng_template_4_Template, 2, 0, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
@@ -17339,70 +17778,66 @@ class NoLinkedCasesComponent {
17339
17778
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NoLinkedCasesComponent, [{
17340
17779
  type: Component,
17341
17780
  args: [{ selector: 'ccd-no-linked-cases', template: "<div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <h1 class=\"govuk-heading-xl\" *ngIf=\"serverLinkedApiError\">There is a problem</h1>\n <p id=\"unlink-cases-error\" class=\"govuk-error-message\"\n *ngIf=\"serverLinkedApiError;else noLinkedCases;\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{serverLinkedApiError.message}}\n </p>\n <ng-template #noLinkedCases>\n <p class=\"govuk-body\">There are no cases linked to this one.</p>\n </ng-template>\n <p class=\"govuk-body\">\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">Go back to the Linked cases tab</a>\n </p>\n <div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" id=\"back-button\" (click)=\"onBack()\">Back</button>\n </div>\n </div>\n</div>\n" }]
17342
- }], () => [{ type: i1$1.Router }, { type: LinkedCasesService }], null); })();
17343
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(NoLinkedCasesComponent, { className: "NoLinkedCasesComponent", filePath: "lib/shared/components/palette/linked-cases/components/no-linked-cases/no-linked-cases.component.ts", lineNumber: 9 }); })();
17781
+ }], () => [{ type: i1$1.Router }, { type: LinkedCasesService }, { type: MultipageComponentStateService }], null); })();
17782
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(NoLinkedCasesComponent, { className: "NoLinkedCasesComponent", filePath: "lib/shared/components/palette/linked-cases/components/no-linked-cases/no-linked-cases.component.ts", lineNumber: 12 }); })();
17344
17783
 
17345
17784
  const _c0$I = a0 => ({ "govuk-form-group--error": a0 });
17346
17785
  function UnLinkCasesComponent_div_0_div_4_p_1_Template(rf, ctx) { if (rf & 1) {
17347
- i0.ɵɵelementStart(0, "p", 11)(1, "span", 12);
17786
+ i0.ɵɵelementStart(0, "p", 9)(1, "span", 10);
17348
17787
  i0.ɵɵtext(2, "Error:");
17349
17788
  i0.ɵɵelementEnd();
17350
17789
  i0.ɵɵtext(3);
17351
17790
  i0.ɵɵelementEnd();
17352
17791
  } if (rf & 2) {
17353
- const ctx_r1 = i0.ɵɵnextContext(3);
17792
+ const ctx_r0 = i0.ɵɵnextContext(3);
17354
17793
  i0.ɵɵadvance(3);
17355
- i0.ɵɵtextInterpolate1(" ", ctx_r1.unlinkErrorMessage, " ");
17794
+ i0.ɵɵtextInterpolate1(" ", ctx_r0.unlinkErrorMessage, " ");
17356
17795
  } }
17357
17796
  function UnLinkCasesComponent_div_0_div_4_div_3_Template(rf, ctx) { if (rf & 1) {
17358
- const _r3 = i0.ɵɵgetCurrentView();
17359
- i0.ɵɵelementStart(0, "div", 13)(1, "input", 14);
17360
- i0.ɵɵlistener("change", function UnLinkCasesComponent_div_0_div_4_div_3_Template_input_change_1_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onChange($event.target)); });
17797
+ const _r2 = i0.ɵɵgetCurrentView();
17798
+ i0.ɵɵelementStart(0, "div", 11)(1, "input", 12);
17799
+ i0.ɵɵlistener("change", function UnLinkCasesComponent_div_0_div_4_div_3_Template_input_change_1_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.onChange($event.target)); });
17361
17800
  i0.ɵɵelementEnd();
17362
- i0.ɵɵelementStart(2, "label", 15);
17801
+ i0.ɵɵelementStart(2, "label", 13);
17363
17802
  i0.ɵɵtext(3);
17364
17803
  i0.ɵɵpipe(4, "ccdCaseReference");
17365
17804
  i0.ɵɵelementEnd()();
17366
17805
  } if (rf & 2) {
17367
- const case_r4 = ctx.$implicit;
17806
+ const case_r3 = ctx.$implicit;
17368
17807
  i0.ɵɵadvance();
17369
- i0.ɵɵpropertyInterpolate1("id", "case-reference-", case_r4.caseReference, "");
17370
- i0.ɵɵproperty("value", case_r4.caseReference)("checked", case_r4.unlink);
17808
+ i0.ɵɵpropertyInterpolate1("id", "case-reference-", case_r3.caseReference, "");
17809
+ i0.ɵɵproperty("value", case_r3.caseReference)("checked", case_r3.unlink);
17371
17810
  i0.ɵɵadvance();
17372
- i0.ɵɵpropertyInterpolate("for", case_r4.caseReference);
17811
+ i0.ɵɵpropertyInterpolate("for", case_r3.caseReference);
17373
17812
  i0.ɵɵadvance();
17374
- i0.ɵɵtextInterpolate2(" ", case_r4.caseName, " ", i0.ɵɵpipeBind1(4, 7, case_r4.caseReference), " ");
17813
+ i0.ɵɵtextInterpolate2(" ", case_r3.caseName, " ", i0.ɵɵpipeBind1(4, 7, case_r3.caseReference), " ");
17375
17814
  } }
17376
17815
  function UnLinkCasesComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
17377
- i0.ɵɵelementStart(0, "div", 7);
17378
- i0.ɵɵtemplate(1, UnLinkCasesComponent_div_0_div_4_p_1_Template, 4, 1, "p", 8);
17379
- i0.ɵɵelementStart(2, "div", 9);
17380
- i0.ɵɵtemplate(3, UnLinkCasesComponent_div_0_div_4_div_3_Template, 5, 9, "div", 10);
17816
+ i0.ɵɵelementStart(0, "div", 5);
17817
+ i0.ɵɵtemplate(1, UnLinkCasesComponent_div_0_div_4_p_1_Template, 4, 1, "p", 6);
17818
+ i0.ɵɵelementStart(2, "div", 7);
17819
+ i0.ɵɵtemplate(3, UnLinkCasesComponent_div_0_div_4_div_3_Template, 5, 9, "div", 8);
17381
17820
  i0.ɵɵelementEnd()();
17382
17821
  } if (rf & 2) {
17383
- const ctx_r1 = i0.ɵɵnextContext(2);
17384
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(4, _c0$I, ctx_r1.unlinkErrorMessage))("formGroup", ctx_r1.unlinkCaseForm);
17822
+ const ctx_r0 = i0.ɵɵnextContext(2);
17823
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(4, _c0$I, ctx_r0.unlinkErrorMessage))("formGroup", ctx_r0.unlinkCaseForm);
17385
17824
  i0.ɵɵadvance();
17386
- i0.ɵɵproperty("ngIf", ctx_r1.unlinkErrorMessage);
17825
+ i0.ɵɵproperty("ngIf", ctx_r0.unlinkErrorMessage);
17387
17826
  i0.ɵɵadvance(2);
17388
- i0.ɵɵproperty("ngForOf", ctx_r1.linkedCases);
17827
+ i0.ɵɵproperty("ngForOf", ctx_r0.linkedCases);
17389
17828
  } }
17390
17829
  function UnLinkCasesComponent_div_0_Template(rf, ctx) { if (rf & 1) {
17391
- const _r1 = i0.ɵɵgetCurrentView();
17392
17830
  i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "h1", 3);
17393
17831
  i0.ɵɵtext(3, "Select the cases you want to unlink from this case");
17394
17832
  i0.ɵɵelementEnd();
17395
17833
  i0.ɵɵtemplate(4, UnLinkCasesComponent_div_0_div_4_Template, 4, 6, "div", 4);
17396
- i0.ɵɵelementStart(5, "div", 5)(6, "button", 6);
17397
- i0.ɵɵlistener("click", function UnLinkCasesComponent_div_0_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onNext()); });
17398
- i0.ɵɵtext(7, "Next");
17399
- i0.ɵɵelementEnd()()()();
17834
+ i0.ɵɵelementEnd()();
17400
17835
  } if (rf & 2) {
17401
- const ctx_r1 = i0.ɵɵnextContext();
17836
+ const ctx_r0 = i0.ɵɵnextContext();
17402
17837
  i0.ɵɵadvance(4);
17403
- i0.ɵɵproperty("ngIf", ctx_r1.unlinkCaseForm);
17838
+ i0.ɵɵproperty("ngIf", ctx_r0.unlinkCaseForm);
17404
17839
  } }
17405
- class UnLinkCasesComponent {
17840
+ class UnLinkCasesComponent extends AbstractFieldWriteJourneyComponent {
17406
17841
  fb;
17407
17842
  casesService;
17408
17843
  linkedCasesService;
@@ -17417,7 +17852,8 @@ class UnLinkCasesComponent {
17417
17852
  unlinkErrorMessage;
17418
17853
  isLoaded;
17419
17854
  isServerError = false;
17420
- constructor(fb, casesService, linkedCasesService) {
17855
+ constructor(fb, casesService, linkedCasesService, multipageComponentStateService) {
17856
+ super(multipageComponentStateService);
17421
17857
  this.fb = fb;
17422
17858
  this.casesService = casesService;
17423
17859
  this.linkedCasesService = linkedCasesService;
@@ -17510,6 +17946,12 @@ class UnLinkCasesComponent {
17510
17946
  // Return linked cases state and error messages to the parent
17511
17947
  this.emitLinkedCasesState(navigateToNextPage);
17512
17948
  }
17949
+ next() {
17950
+ this.onNext();
17951
+ if (this.errorMessages.length === 0) {
17952
+ super.next();
17953
+ }
17954
+ }
17513
17955
  // Return linked cases state and error messages to the parent
17514
17956
  emitLinkedCasesState(isNavigateToNextPage) {
17515
17957
  this.linkedCasesStateEmitter.emit({
@@ -17522,22 +17964,22 @@ class UnLinkCasesComponent {
17522
17964
  this.errorMessages = [];
17523
17965
  this.unlinkErrorMessage = null;
17524
17966
  }
17525
- static ɵfac = function UnLinkCasesComponent_Factory(t) { return new (t || UnLinkCasesComponent)(i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(LinkedCasesService)); };
17526
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UnLinkCasesComponent, selectors: [["ccd-unlink-cases"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter", notifyAPIFailure: "notifyAPIFailure" }, decls: 1, vars: 1, consts: [["class", "govuk-grid-row", 4, "ngIf"], [1, "govuk-grid-row"], [1, "govuk-grid-column-full"], [1, "govuk-heading-xl"], ["class", "govuk-form-group form-group", 3, "ngClass", "formGroup", 4, "ngIf"], [1, "govuk-button-group"], ["type", "button", "id", "next-button", 1, "button", "button-primary", 3, "click"], [1, "govuk-form-group", "form-group", 3, "ngClass", "formGroup"], ["id", "unlink-cases-error", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-checkboxes", 1, "govuk-checkboxes"], ["class", "govuk-checkboxes__item", 4, "ngFor", "ngForOf"], ["id", "unlink-cases-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-checkboxes__item"], ["formArrayName", "linkedCases", "name", "linkedCases", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "change", "id", "value", "checked"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"]], template: function UnLinkCasesComponent_Template(rf, ctx) { if (rf & 1) {
17527
- i0.ɵɵtemplate(0, UnLinkCasesComponent_div_0_Template, 8, 1, "div", 0);
17967
+ static ɵfac = function UnLinkCasesComponent_Factory(t) { return new (t || UnLinkCasesComponent)(i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
17968
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UnLinkCasesComponent, selectors: [["ccd-unlink-cases"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter", notifyAPIFailure: "notifyAPIFailure" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "govuk-grid-row", 4, "ngIf"], [1, "govuk-grid-row"], [1, "govuk-grid-column-full"], [1, "govuk-heading-xl"], ["class", "govuk-form-group form-group", 3, "ngClass", "formGroup", 4, "ngIf"], [1, "govuk-form-group", "form-group", 3, "ngClass", "formGroup"], ["id", "unlink-cases-error", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-checkboxes", 1, "govuk-checkboxes"], ["class", "govuk-checkboxes__item", 4, "ngFor", "ngForOf"], ["id", "unlink-cases-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-checkboxes__item"], ["formArrayName", "linkedCases", "name", "linkedCases", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "change", "id", "value", "checked"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"]], template: function UnLinkCasesComponent_Template(rf, ctx) { if (rf & 1) {
17969
+ i0.ɵɵtemplate(0, UnLinkCasesComponent_div_0_Template, 5, 1, "div", 0);
17528
17970
  } if (rf & 2) {
17529
17971
  i0.ɵɵproperty("ngIf", ctx.linkedCases.length > 0);
17530
17972
  } }, dependencies: [i5.NgClass, i5.NgForOf, i5.NgIf, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormArrayName, CaseReferencePipe], encapsulation: 2 });
17531
17973
  }
17532
17974
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UnLinkCasesComponent, [{
17533
17975
  type: Component,
17534
- args: [{ selector: 'ccd-unlink-cases', template: "<div class=\"govuk-grid-row\" *ngIf=\"linkedCases.length > 0\">\n <div class=\"govuk-grid-column-full\">\n <h1 class=\"govuk-heading-xl\">Select the cases you want to unlink from this case</h1>\n <div class=\"govuk-form-group form-group\" [ngClass]=\"{'govuk-form-group--error': unlinkErrorMessage}\" [formGroup]=\"unlinkCaseForm\" *ngIf=\"unlinkCaseForm\">\n <p id=\"unlink-cases-error\" class=\"govuk-error-message\" *ngIf=\"unlinkErrorMessage\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{unlinkErrorMessage}}\n </p>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\" *ngFor=\"let case of linkedCases\">\n <input class=\"govuk-checkboxes__input\" id=\"case-reference-{{case.caseReference}}\" formArrayName=\"linkedCases\" name=\"linkedCases\"\n type=\"checkbox\" [value]=\"case.caseReference\" [checked]=\"case.unlink\" (change)=\"onChange($event.target)\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"{{case.caseReference}}\">\n {{case.caseName }} {{case.caseReference | ccdCaseReference}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" id=\"next-button\" (click)=\"onNext()\">Next</button>\n </div>\n </div>\n</div>\n" }]
17535
- }], () => [{ type: i4.FormBuilder }, { type: CasesService }, { type: LinkedCasesService }], { linkedCasesStateEmitter: [{
17976
+ args: [{ selector: 'ccd-unlink-cases', template: "<div class=\"govuk-grid-row\" *ngIf=\"linkedCases.length > 0\">\n <div class=\"govuk-grid-column-full\">\n <h1 class=\"govuk-heading-xl\">Select the cases you want to unlink from this case</h1>\n <div class=\"govuk-form-group form-group\" [ngClass]=\"{'govuk-form-group--error': unlinkErrorMessage}\" [formGroup]=\"unlinkCaseForm\" *ngIf=\"unlinkCaseForm\">\n <p id=\"unlink-cases-error\" class=\"govuk-error-message\" *ngIf=\"unlinkErrorMessage\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{unlinkErrorMessage}}\n </p>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\" *ngFor=\"let case of linkedCases\">\n <input class=\"govuk-checkboxes__input\" id=\"case-reference-{{case.caseReference}}\" formArrayName=\"linkedCases\" name=\"linkedCases\"\n type=\"checkbox\" [value]=\"case.caseReference\" [checked]=\"case.unlink\" (change)=\"onChange($event.target)\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"{{case.caseReference}}\">\n {{case.caseName }} {{case.caseReference | ccdCaseReference}}\n </label>\n </div>\n </div>\n </div>\n </div>\n</div>\n" }]
17977
+ }], () => [{ type: i4.FormBuilder }, { type: CasesService }, { type: LinkedCasesService }, { type: MultipageComponentStateService }], { linkedCasesStateEmitter: [{
17536
17978
  type: Output
17537
17979
  }], notifyAPIFailure: [{
17538
17980
  type: Output
17539
17981
  }] }); })();
17540
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UnLinkCasesComponent, { className: "UnLinkCasesComponent", filePath: "lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.ts", lineNumber: 14 }); })();
17982
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UnLinkCasesComponent, { className: "UnLinkCasesComponent", filePath: "lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.ts", lineNumber: 16 }); })();
17541
17983
 
17542
17984
  // tslint:disable:variable-name
17543
17985
  class LinkCaseReason {
@@ -17791,7 +18233,7 @@ class ReadLinkedCasesFieldComponent {
17791
18233
  function WriteLinkedCasesFieldComponent_ng_container_2_Template(rf, ctx) { if (rf & 1) {
17792
18234
  const _r1 = i0.ɵɵgetCurrentView();
17793
18235
  i0.ɵɵelementContainerStart(0);
17794
- i0.ɵɵelementStart(1, "ccd-linked-cases-before-you-start", 3);
18236
+ i0.ɵɵelementStart(1, "ccd-linked-cases-before-you-start", 4, 0);
17795
18237
  i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_2_Template_ccd_linked_cases_before_you_start_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onLinkedCasesStateEmitted($event)); });
17796
18238
  i0.ɵɵelementEnd();
17797
18239
  i0.ɵɵelementContainerEnd();
@@ -17799,7 +18241,7 @@ function WriteLinkedCasesFieldComponent_ng_container_2_Template(rf, ctx) { if (r
17799
18241
  function WriteLinkedCasesFieldComponent_ng_container_3_Template(rf, ctx) { if (rf & 1) {
17800
18242
  const _r3 = i0.ɵɵgetCurrentView();
17801
18243
  i0.ɵɵelementContainerStart(0);
17802
- i0.ɵɵelementStart(1, "ccd-no-linked-cases", 3);
18244
+ i0.ɵɵelementStart(1, "ccd-no-linked-cases", 4, 0);
17803
18245
  i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_3_Template_ccd_no_linked_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onLinkedCasesStateEmitted($event)); });
17804
18246
  i0.ɵɵelementEnd();
17805
18247
  i0.ɵɵelementContainerEnd();
@@ -17807,7 +18249,7 @@ function WriteLinkedCasesFieldComponent_ng_container_3_Template(rf, ctx) { if (r
17807
18249
  function WriteLinkedCasesFieldComponent_ng_container_4_Template(rf, ctx) { if (rf & 1) {
17808
18250
  const _r4 = i0.ɵɵgetCurrentView();
17809
18251
  i0.ɵɵelementContainerStart(0);
17810
- i0.ɵɵelementStart(1, "ccd-link-cases", 3);
18252
+ i0.ɵɵelementStart(1, "ccd-link-cases", 4, 0);
17811
18253
  i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_4_Template_ccd_link_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onLinkedCasesStateEmitted($event)); });
17812
18254
  i0.ɵɵelementEnd();
17813
18255
  i0.ɵɵelementContainerEnd();
@@ -17815,7 +18257,7 @@ function WriteLinkedCasesFieldComponent_ng_container_4_Template(rf, ctx) { if (r
17815
18257
  function WriteLinkedCasesFieldComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
17816
18258
  const _r5 = i0.ɵɵgetCurrentView();
17817
18259
  i0.ɵɵelementContainerStart(0);
17818
- i0.ɵɵelementStart(1, "ccd-unlink-cases", 3);
18260
+ i0.ɵɵelementStart(1, "ccd-unlink-cases", 4, 0);
17819
18261
  i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_5_Template_ccd_unlink_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onLinkedCasesStateEmitted($event)); });
17820
18262
  i0.ɵɵelementEnd();
17821
18263
  i0.ɵɵelementContainerEnd();
@@ -17823,12 +18265,12 @@ function WriteLinkedCasesFieldComponent_ng_container_5_Template(rf, ctx) { if (r
17823
18265
  function WriteLinkedCasesFieldComponent_ng_container_6_Template(rf, ctx) { if (rf & 1) {
17824
18266
  const _r6 = i0.ɵɵgetCurrentView();
17825
18267
  i0.ɵɵelementContainerStart(0);
17826
- i0.ɵɵelementStart(1, "ccd-linked-cases-check-your-answers", 3);
18268
+ i0.ɵɵelementStart(1, "ccd-linked-cases-check-your-answers", 4, 0);
17827
18269
  i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_6_Template_ccd_linked_cases_check_your_answers_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onLinkedCasesStateEmitted($event)); });
17828
18270
  i0.ɵɵelementEnd();
17829
18271
  i0.ɵɵelementContainerEnd();
17830
18272
  } }
17831
- class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
18273
+ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteJourneyComponent {
17832
18274
  appConfig;
17833
18275
  commonDataService;
17834
18276
  casesService;
@@ -17841,8 +18283,8 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
17841
18283
  linkedCasesEventTriggers = LinkedCasesEventTriggers;
17842
18284
  linkedCases = [];
17843
18285
  subscriptions = new Subscription();
17844
- constructor(appConfig, commonDataService, casesService, linkedCasesService, caseEditDataService) {
17845
- super();
18286
+ constructor(appConfig, commonDataService, casesService, linkedCasesService, caseEditDataService, multipageComponentStateService) {
18287
+ super(multipageComponentStateService);
17846
18288
  this.appConfig = appConfig;
17847
18289
  this.commonDataService = commonDataService;
17848
18290
  this.casesService = casesService;
@@ -17867,6 +18309,18 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
17867
18309
  this.subscriptions.add(this.caseEditDataService.caseEditForm$.subscribe({
17868
18310
  next: editForm => this.caseEditForm = editForm
17869
18311
  }));
18312
+ this.journeyPageNumber = this.journeyStartPageNumber = LinkedCasesPages.BEFORE_YOU_START;
18313
+ this.journeyEndPageNumber = LinkedCasesPages.CHECK_YOUR_ANSWERS;
18314
+ if (this.linkedCasesService.cameFromFinalStep) {
18315
+ this.linkedCasesPage = LinkedCasesPages.CHECK_YOUR_ANSWERS;
18316
+ this.journeyPageNumber = LinkedCasesPages.CHECK_YOUR_ANSWERS;
18317
+ this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(true);
18318
+ }
18319
+ this.multipageComponentStateService.isAtStart = this.journeyPageNumber === this.journeyStartPageNumber;
18320
+ }
18321
+ onPageChange() {
18322
+ const isAtStart = this.journeyPageNumber === this.journeyStartPageNumber || this.linkedCasesPage === LinkedCasesPages.BEFORE_YOU_START;
18323
+ this.multipageComponentStateService.isAtStart = isAtStart;
17870
18324
  }
17871
18325
  initialiseCaseDetails(caseDetails) {
17872
18326
  if (caseDetails) {
@@ -17924,6 +18378,8 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
17924
18378
  }
17925
18379
  proceedToNextPage() {
17926
18380
  if (this.isAtFinalPage()) {
18381
+ // Set the journey page to the end page.
18382
+ this.journeyPageNumber = this.journeyEndPageNumber;
17927
18383
  // Continue button event must be allowed in final page
17928
18384
  this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(true);
17929
18385
  // Trigger validation to clear the "notAtFinalPage" error if now at the final state
@@ -17935,6 +18391,7 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
17935
18391
  // Continue button event must not be allowed if not in final page
17936
18392
  this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(false);
17937
18393
  }
18394
+ this.nextPage();
17938
18395
  }
17939
18396
  submitLinkedCases() {
17940
18397
  if (!this.linkedCasesService.isLinkedCasesEventTrigger) {
@@ -17965,24 +18422,53 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
17965
18422
  });
17966
18423
  if (caseViewFiltered) {
17967
18424
  const caseLinkFieldValue = caseViewFiltered.map(filtered => filtered.fields?.length > 0 && filtered.fields.filter(field => field.id === 'caseLinks')[0].value);
17968
- this.linkedCasesService.caseFieldValue = caseLinkFieldValue.length ? caseLinkFieldValue[0] : [];
17969
- this.linkedCasesService.getAllLinkedCaseInformation();
18425
+ if (!this.linkedCasesService.caseFieldValue.length) {
18426
+ this.linkedCasesService.caseFieldValue = caseLinkFieldValue.length ? caseLinkFieldValue[0] : [];
18427
+ this.linkedCasesService.getAllLinkedCaseInformation();
18428
+ }
17970
18429
  }
17971
18430
  // Initialise the first page to display
17972
- this.linkedCasesPage = this.linkedCasesService.isLinkedCasesEventTrigger ||
17973
- (this.linkedCasesService.caseFieldValue && this.linkedCasesService.caseFieldValue.length > 0
17974
- && !this.linkedCasesService.serverLinkedApiError)
17975
- ? LinkedCasesPages.BEFORE_YOU_START
17976
- : LinkedCasesPages.NO_LINKED_CASES;
18431
+ if (!this.linkedCasesService.cameFromFinalStep) {
18432
+ this.linkedCasesPage = this.linkedCasesService.isLinkedCasesEventTrigger ||
18433
+ (this.linkedCasesService.caseFieldValue && this.linkedCasesService.caseFieldValue.length > 0
18434
+ && !this.linkedCasesService.serverLinkedApiError)
18435
+ ? LinkedCasesPages.BEFORE_YOU_START
18436
+ : LinkedCasesPages.NO_LINKED_CASES;
18437
+ }
17977
18438
  });
17978
18439
  }
17979
18440
  ngOnDestroy() {
17980
18441
  this.subscriptions.unsubscribe();
17981
18442
  }
17982
- static ɵfac = function WriteLinkedCasesFieldComponent_Factory(t) { return new (t || WriteLinkedCasesFieldComponent)(i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CommonDataService), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(CaseEditDataService)); };
17983
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteLinkedCasesFieldComponent, selectors: [["ccd-write-linked-cases-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 7, vars: 7, consts: [[1, "form-group", "govuk-!-margin-bottom-2", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], [4, "ngSwitchCase"], [3, "linkedCasesStateEmitter"]], template: function WriteLinkedCasesFieldComponent_Template(rf, ctx) { if (rf & 1) {
17984
- i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
17985
- i0.ɵɵtemplate(2, WriteLinkedCasesFieldComponent_ng_container_2_Template, 2, 0, "ng-container", 2)(3, WriteLinkedCasesFieldComponent_ng_container_3_Template, 2, 0, "ng-container", 2)(4, WriteLinkedCasesFieldComponent_ng_container_4_Template, 2, 0, "ng-container", 2)(5, WriteLinkedCasesFieldComponent_ng_container_5_Template, 2, 0, "ng-container", 2)(6, WriteLinkedCasesFieldComponent_ng_container_6_Template, 2, 0, "ng-container", 2);
18443
+ previousPage() {
18444
+ if (this.linkedCasesService.isLinkedCasesEventTrigger) {
18445
+ if (this.linkedCasesPage === LinkedCasesPages.CHECK_YOUR_ANSWERS) {
18446
+ this.linkedCasesPage = LinkedCasesPages.LINK_CASE;
18447
+ }
18448
+ else if (this.linkedCasesPage === LinkedCasesPages.LINK_CASE) {
18449
+ this.linkedCasesPage = LinkedCasesPages.BEFORE_YOU_START;
18450
+ }
18451
+ else {
18452
+ this.linkedCasesPage--;
18453
+ }
18454
+ }
18455
+ else {
18456
+ if (this.linkedCasesPage === LinkedCasesPages.UNLINK_CASE) {
18457
+ this.linkedCasesPage = this.linkedCasesPages.BEFORE_YOU_START;
18458
+ }
18459
+ else if (this.linkedCasesPage === LinkedCasesPages.CHECK_YOUR_ANSWERS) {
18460
+ this.linkedCasesPage = this.linkedCasesPages.UNLINK_CASE;
18461
+ }
18462
+ else {
18463
+ this.linkedCasesPage--;
18464
+ }
18465
+ }
18466
+ super.previousPage();
18467
+ }
18468
+ static ɵfac = function WriteLinkedCasesFieldComponent_Factory(t) { return new (t || WriteLinkedCasesFieldComponent)(i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CommonDataService), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
18469
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteLinkedCasesFieldComponent, selectors: [["ccd-write-linked-cases-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 7, vars: 7, consts: [["journeyChild", ""], [1, "form-group", "govuk-!-margin-bottom-2", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], [4, "ngSwitchCase"], [3, "linkedCasesStateEmitter"]], template: function WriteLinkedCasesFieldComponent_Template(rf, ctx) { if (rf & 1) {
18470
+ i0.ɵɵelementStart(0, "div", 1)(1, "div", 2);
18471
+ i0.ɵɵtemplate(2, WriteLinkedCasesFieldComponent_ng_container_2_Template, 3, 0, "ng-container", 3)(3, WriteLinkedCasesFieldComponent_ng_container_3_Template, 3, 0, "ng-container", 3)(4, WriteLinkedCasesFieldComponent_ng_container_4_Template, 3, 0, "ng-container", 3)(5, WriteLinkedCasesFieldComponent_ng_container_5_Template, 3, 0, "ng-container", 3)(6, WriteLinkedCasesFieldComponent_ng_container_6_Template, 3, 0, "ng-container", 3);
17986
18472
  i0.ɵɵelementEnd()();
17987
18473
  } if (rf & 2) {
17988
18474
  i0.ɵɵproperty("formGroup", ctx.formGroup);
@@ -18002,8 +18488,8 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
18002
18488
  }
18003
18489
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteLinkedCasesFieldComponent, [{
18004
18490
  type: Component,
18005
- args: [{ selector: 'ccd-write-linked-cases-field', template: "<div class=\"form-group govuk-!-margin-bottom-2\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"linkedCasesPage\">\n <ng-container *ngSwitchCase=\"linkedCasesPages.BEFORE_YOU_START\">\n <ccd-linked-cases-before-you-start\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-linked-cases-before-you-start>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.NO_LINKED_CASES\">\n <ccd-no-linked-cases\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-no-linked-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.LINK_CASE\">\n <ccd-link-cases\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-link-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.UNLINK_CASE\">\n <ccd-unlink-cases\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-unlink-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.CHECK_YOUR_ANSWERS\">\n <ccd-linked-cases-check-your-answers\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-linked-cases-check-your-answers>\n </ng-container>\n </div>\n</div>\n" }]
18006
- }], () => [{ type: AbstractAppConfig }, { type: CommonDataService }, { type: CasesService }, { type: LinkedCasesService }, { type: CaseEditDataService }], null); })();
18491
+ args: [{ selector: 'ccd-write-linked-cases-field', template: "<div class=\"form-group govuk-!-margin-bottom-2\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"linkedCasesPage\">\n <ng-container *ngSwitchCase=\"linkedCasesPages.BEFORE_YOU_START\">\n <ccd-linked-cases-before-you-start\n #journeyChild \n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\">\n </ccd-linked-cases-before-you-start>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.NO_LINKED_CASES\">\n <ccd-no-linked-cases\n #journeyChild \n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\">\n </ccd-no-linked-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.LINK_CASE\">\n <ccd-link-cases\n #journeyChild \n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\">\n </ccd-link-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.UNLINK_CASE\">\n <ccd-unlink-cases\n #journeyChild \n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\">\n </ccd-unlink-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.CHECK_YOUR_ANSWERS\">\n <ccd-linked-cases-check-your-answers\n #journeyChild \n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\">\n </ccd-linked-cases-check-your-answers>\n </ng-container>\n </div>\n</div>\n" }]
18492
+ }], () => [{ type: AbstractAppConfig }, { type: CommonDataService }, { type: CasesService }, { type: LinkedCasesService }, { type: CaseEditDataService }, { type: MultipageComponentStateService }], null); })();
18007
18493
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteLinkedCasesFieldComponent, { className: "WriteLinkedCasesFieldComponent", filePath: "lib/shared/components/palette/linked-cases/write-linked-cases-field.component.ts", lineNumber: 19 }); })();
18008
18494
 
18009
18495
  function ReadMoneyGbpFieldComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
@@ -22766,10 +23252,10 @@ function AddCommentsComponent_span_7_Template(rf, ctx) { if (rf & 1) {
22766
23252
  i0.ɵɵtextInterpolate1(" (", i0.ɵɵpipeBind1(2, 1, "optional"), ")");
22767
23253
  } }
22768
23254
  function AddCommentsComponent_div_11_Template(rf, ctx) { if (rf & 1) {
22769
- i0.ɵɵelementStart(0, "div", 14)(1, "span", 15);
23255
+ i0.ɵɵelementStart(0, "div", 12)(1, "span", 13);
22770
23256
  i0.ɵɵtext(2, "!");
22771
23257
  i0.ɵɵelementEnd();
22772
- i0.ɵɵelementStart(3, "strong", 16)(4, "span", 17);
23258
+ i0.ɵɵelementStart(3, "strong", 14)(4, "span", 15);
22773
23259
  i0.ɵɵtext(5);
22774
23260
  i0.ɵɵpipe(6, "rpxTranslate");
22775
23261
  i0.ɵɵelementEnd();
@@ -22784,7 +23270,7 @@ function AddCommentsComponent_div_11_Template(rf, ctx) { if (rf & 1) {
22784
23270
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 4, ctx_r0.addCommentsStepEnum.WARNING_TEXT), " ");
22785
23271
  } }
22786
23272
  function AddCommentsComponent_div_12_Template(rf, ctx) { if (rf & 1) {
22787
- i0.ɵɵelementStart(0, "div", 18)(1, "span", 19);
23273
+ i0.ɵɵelementStart(0, "div", 16)(1, "span", 17);
22788
23274
  i0.ɵɵtext(2);
22789
23275
  i0.ɵɵpipe(3, "rpxTranslate");
22790
23276
  i0.ɵɵelementEnd();
@@ -22799,7 +23285,7 @@ function AddCommentsComponent_div_12_Template(rf, ctx) { if (rf & 1) {
22799
23285
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.flagCommentsNotEnteredErrorMessage), " ");
22800
23286
  } }
22801
23287
  function AddCommentsComponent_div_13_Template(rf, ctx) { if (rf & 1) {
22802
- i0.ɵɵelementStart(0, "div", 20)(1, "span", 19);
23288
+ i0.ɵɵelementStart(0, "div", 18)(1, "span", 17);
22803
23289
  i0.ɵɵtext(2);
22804
23290
  i0.ɵɵpipe(3, "rpxTranslate");
22805
23291
  i0.ɵɵelementEnd();
@@ -22813,7 +23299,7 @@ function AddCommentsComponent_div_13_Template(rf, ctx) { if (rf & 1) {
22813
23299
  i0.ɵɵadvance(2);
22814
23300
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.flagCommentsCharLimitErrorMessage), " ");
22815
23301
  } }
22816
- class AddCommentsComponent {
23302
+ class AddCommentsComponent extends AbstractJourneyComponent {
22817
23303
  formGroup;
22818
23304
  optional = false;
22819
23305
  isDisplayContextParameterExternal = false;
@@ -22872,8 +23358,14 @@ class AddCommentsComponent {
22872
23358
  });
22873
23359
  }
22874
23360
  }
22875
- static ɵfac = function AddCommentsComponent_Factory(t) { return new (t || AddCommentsComponent)(); };
22876
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AddCommentsComponent, selectors: [["ccd-add-comments"]], inputs: { formGroup: "formGroup", optional: "optional", isDisplayContextParameterExternal: "isDisplayContextParameterExternal", isDisplayContextParameter2Point1Enabled: "isDisplayContextParameter2Point1Enabled" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 22, vars: 24, consts: [[3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper"], [1, "govuk-label", "govuk-label--m", 3, "for"], [4, "ngIf"], ["id", "add-comments-hint", 1, "govuk-hint"], ["class", "govuk-warning-text", 4, "ngIf"], ["id", "flag-comments-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-comments-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "add-comments-hint add-comments-char-limit-info add-comments-char-limit-error", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "add-comments-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-warning-text__assistive"], ["id", "flag-comments-not-entered-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "add-comments-char-limit-error", 1, "govuk-error-message"]], template: function AddCommentsComponent_Template(rf, ctx) { if (rf & 1) {
23361
+ next() {
23362
+ this.onNext();
23363
+ if (this.errorMessages.length === 0) {
23364
+ super.next();
23365
+ }
23366
+ }
23367
+ static ɵfac = /*@__PURE__*/ (() => { let ɵAddCommentsComponent_BaseFactory; return function AddCommentsComponent_Factory(t) { return (ɵAddCommentsComponent_BaseFactory || (ɵAddCommentsComponent_BaseFactory = i0.ɵɵgetInheritedFactory(AddCommentsComponent)))(t || AddCommentsComponent); }; })();
23368
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AddCommentsComponent, selectors: [["ccd-add-comments"]], inputs: { formGroup: "formGroup", optional: "optional", isDisplayContextParameterExternal: "isDisplayContextParameterExternal", isDisplayContextParameter2Point1Enabled: "isDisplayContextParameter2Point1Enabled" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 18, vars: 21, consts: [[3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper"], [1, "govuk-label", "govuk-label--m", 3, "for"], [4, "ngIf"], ["id", "add-comments-hint", 1, "govuk-hint"], ["class", "govuk-warning-text", 4, "ngIf"], ["id", "flag-comments-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-comments-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "add-comments-hint add-comments-char-limit-info add-comments-char-limit-error", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "add-comments-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-warning-text__assistive"], ["id", "flag-comments-not-entered-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "add-comments-char-limit-error", 1, "govuk-error-message"]], template: function AddCommentsComponent_Template(rf, ctx) { if (rf & 1) {
22877
23369
  i0.ɵɵelementContainerStart(0, 0);
22878
23370
  i0.ɵɵelementStart(1, "div", 1)(2, "div", 2)(3, "h1", 3)(4, "label", 4);
22879
23371
  i0.ɵɵtext(5);
@@ -22891,23 +23383,18 @@ class AddCommentsComponent {
22891
23383
  i0.ɵɵpipe(17, "rpxTranslate");
22892
23384
  i0.ɵɵelementEnd()()();
22893
23385
  i0.ɵɵelementContainerEnd();
22894
- i0.ɵɵelementStart(18, "div", 12)(19, "button", 13);
22895
- i0.ɵɵlistener("click", function AddCommentsComponent_Template_button_click_19_listener() { return ctx.onNext(); });
22896
- i0.ɵɵtext(20);
22897
- i0.ɵɵpipe(21, "rpxTranslate");
22898
- i0.ɵɵelementEnd()();
22899
23386
  } if (rf & 2) {
22900
23387
  i0.ɵɵproperty("formGroup", ctx.formGroup);
22901
23388
  i0.ɵɵadvance(2);
22902
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(22, _c0$s, ctx.errorMessages.length > 0));
23389
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(19, _c0$s, ctx.errorMessages.length > 0));
22903
23390
  i0.ɵɵadvance(2);
22904
23391
  i0.ɵɵproperty("for", ctx.flagCommentsControlName);
22905
23392
  i0.ɵɵadvance();
22906
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 14, ctx.addCommentsTitle), "");
23393
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 13, ctx.addCommentsTitle), "");
22907
23394
  i0.ɵɵadvance(2);
22908
23395
  i0.ɵɵproperty("ngIf", ctx.optional);
22909
23396
  i0.ɵɵadvance(2);
22910
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(10, 16, ctx.addCommentsHint), " ");
23397
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(10, 15, ctx.addCommentsHint), " ");
22911
23398
  i0.ɵɵadvance(2);
22912
23399
  i0.ɵɵproperty("ngIf", !ctx.isDisplayContextParameterExternal && ctx.isDisplayContextParameter2Point1Enabled && !ctx.otherInternalFlagTypeSelected);
22913
23400
  i0.ɵɵadvance();
@@ -22917,14 +23404,12 @@ class AddCommentsComponent {
22917
23404
  i0.ɵɵadvance();
22918
23405
  i0.ɵɵproperty("id", ctx.flagCommentsControlName)("name", ctx.flagCommentsControlName)("formControlName", ctx.flagCommentsControlName);
22919
23406
  i0.ɵɵadvance(2);
22920
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(17, 18, ctx.addCommentsStepEnum.CHARACTER_LIMIT_INFO), " ");
22921
- i0.ɵɵadvance(4);
22922
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(21, 20, "Next"));
23407
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(17, 17, ctx.addCommentsStepEnum.CHARACTER_LIMIT_INFO), " ");
22923
23408
  } }, dependencies: [i5.NgClass, i5.NgIf, i4.DefaultValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormControlName, i1.RpxTranslatePipe], encapsulation: 2 });
22924
23409
  }
22925
23410
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AddCommentsComponent, [{
22926
23411
  type: Component,
22927
- args: [{ selector: 'ccd-add-comments', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <h1 class=\"govuk-label-wrapper\"><label class=\"govuk-label govuk-label--m\" [for]=\"flagCommentsControlName\">\n {{addCommentsTitle | rpxTranslate}}<span *ngIf=\"optional\"> ({{'optional' | rpxTranslate}})</span>\n </label>\n </h1>\n <div id=\"add-comments-hint\" class=\"govuk-hint\">\n {{addCommentsHint | rpxTranslate}}\n </div>\n <div class=\"govuk-warning-text\"\n *ngIf=\"!isDisplayContextParameterExternal && isDisplayContextParameter2Point1Enabled && !otherInternalFlagTypeSelected\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">{{'Warning' | rpxTranslate}}</span>\n {{addCommentsStepEnum.WARNING_TEXT | rpxTranslate}}\n </strong>\n </div>\n <div id=\"flag-comments-not-entered-error-message\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"add-comments-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\" [id]=\"flagCommentsControlName\"\n [name]=\"flagCommentsControlName\" [formControlName]=\"flagCommentsControlName\" rows=\"5\"\n aria-describedby=\"add-comments-hint add-comments-char-limit-info add-comments-char-limit-error\"></textarea>\n <div id=\"add-comments-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{addCommentsStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" (click)=\"onNext()\">{{'Next' | rpxTranslate}}</button>\n</div>\n" }]
23412
+ args: [{ selector: 'ccd-add-comments', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <h1 class=\"govuk-label-wrapper\"><label class=\"govuk-label govuk-label--m\" [for]=\"flagCommentsControlName\">\n {{addCommentsTitle | rpxTranslate}}<span *ngIf=\"optional\"> ({{'optional' | rpxTranslate}})</span>\n </label>\n </h1>\n <div id=\"add-comments-hint\" class=\"govuk-hint\">\n {{addCommentsHint | rpxTranslate}}\n </div>\n <div class=\"govuk-warning-text\"\n *ngIf=\"!isDisplayContextParameterExternal && isDisplayContextParameter2Point1Enabled && !otherInternalFlagTypeSelected\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">{{'Warning' | rpxTranslate}}</span>\n {{addCommentsStepEnum.WARNING_TEXT | rpxTranslate}}\n </strong>\n </div>\n <div id=\"flag-comments-not-entered-error-message\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"add-comments-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\" [id]=\"flagCommentsControlName\"\n [name]=\"flagCommentsControlName\" [formControlName]=\"flagCommentsControlName\" rows=\"5\"\n aria-describedby=\"add-comments-hint add-comments-char-limit-info add-comments-char-limit-error\"></textarea>\n <div id=\"add-comments-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{addCommentsStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n </div>\n</ng-container>" }]
22928
23413
  }], null, { formGroup: [{
22929
23414
  type: Input
22930
23415
  }], optional: [{
@@ -22936,7 +23421,7 @@ class AddCommentsComponent {
22936
23421
  }], caseFlagStateEmitter: [{
22937
23422
  type: Output
22938
23423
  }] }); })();
22939
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AddCommentsComponent, { className: "AddCommentsComponent", filePath: "lib/shared/components/palette/case-flag/components/add-comments/add-comments.component.ts", lineNumber: 11 }); })();
23424
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AddCommentsComponent, { className: "AddCommentsComponent", filePath: "lib/shared/components/palette/case-flag/components/add-comments/add-comments.component.ts", lineNumber: 12 }); })();
22940
23425
 
22941
23426
  function CaseFlagSummaryListComponent_dl_0_div_28_Template(rf, ctx) { if (rf & 1) {
22942
23427
  const _r3 = i0.ɵɵgetCurrentView();
@@ -23438,7 +23923,7 @@ class CaseFlagTableComponent {
23438
23923
 
23439
23924
  const _c0$r = a0 => ({ "form-group-error": a0 });
23440
23925
  function ManageCaseFlagsComponent_div_7_Template(rf, ctx) { if (rf & 1) {
23441
- i0.ɵɵelementStart(0, "div", 9)(1, "span", 10);
23926
+ i0.ɵɵelementStart(0, "div", 8)(1, "span", 9);
23442
23927
  i0.ɵɵtext(2);
23443
23928
  i0.ɵɵpipe(3, "rpxTranslate");
23444
23929
  i0.ɵɵelementEnd();
@@ -23453,8 +23938,8 @@ function ManageCaseFlagsComponent_div_7_Template(rf, ctx) { if (rf & 1) {
23453
23938
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.manageCaseFlagSelectedErrorMessage), " ");
23454
23939
  } }
23455
23940
  function ManageCaseFlagsComponent_div_9_Template(rf, ctx) { if (rf & 1) {
23456
- i0.ɵɵelementStart(0, "div", 11);
23457
- i0.ɵɵelement(1, "input", 12)(2, "label", 13);
23941
+ i0.ɵɵelementStart(0, "div", 10);
23942
+ i0.ɵɵelement(1, "input", 11)(2, "label", 12);
23458
23943
  i0.ɵɵpipe(3, "manageCaseFlagsLabelDisplay");
23459
23944
  i0.ɵɵelementEnd();
23460
23945
  } if (rf & 2) {
@@ -23468,18 +23953,7 @@ function ManageCaseFlagsComponent_div_9_Template(rf, ctx) { if (rf & 1) {
23468
23953
  i0.ɵɵpropertyInterpolate1("for", "flag-selection-", i_r3, "");
23469
23954
  i0.ɵɵproperty("innerHtml", i0.ɵɵpipeBind1(3, 8, flagDisplay_r2), i0.ɵɵsanitizeHtml);
23470
23955
  } }
23471
- function ManageCaseFlagsComponent_div_10_Template(rf, ctx) { if (rf & 1) {
23472
- const _r4 = i0.ɵɵgetCurrentView();
23473
- i0.ɵɵelementStart(0, "div", 14)(1, "button", 15);
23474
- i0.ɵɵlistener("click", function ManageCaseFlagsComponent_div_10_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onNext()); });
23475
- i0.ɵɵtext(2);
23476
- i0.ɵɵpipe(3, "rpxTranslate");
23477
- i0.ɵɵelementEnd()();
23478
- } if (rf & 2) {
23479
- i0.ɵɵadvance(2);
23480
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 1, "Next"));
23481
- } }
23482
- class ManageCaseFlagsComponent {
23956
+ class ManageCaseFlagsComponent extends AbstractJourneyComponent {
23483
23957
  formGroup;
23484
23958
  flagsData;
23485
23959
  caseTitle;
@@ -23495,6 +23969,12 @@ class ManageCaseFlagsComponent {
23495
23969
  excludedFlagStatuses = [CaseFlagStatus.INACTIVE, CaseFlagStatus.NOT_APPROVED];
23496
23970
  ngOnInit() {
23497
23971
  this.manageCaseFlagTitle = this.setManageCaseFlagTitle(this.displayContextParameter);
23972
+ let originalStatus;
23973
+ // if the user has progressed to CYA and then navigated away, the flag they selected will be set as inactive, we need to reset this
23974
+ if (this.formGroup.get('selectedManageCaseLocation')) {
23975
+ const locationControl = this.formGroup.get('selectedManageCaseLocation');
23976
+ originalStatus = locationControl.value?.originalStatus;
23977
+ }
23498
23978
  // Map flags instances to objects for display, filtering out any where the original status is either "Inactive" or
23499
23979
  // "Not approved"
23500
23980
  /* istanbul ignore else */
@@ -23504,7 +23984,7 @@ class ManageCaseFlagsComponent {
23504
23984
  if (flagsInstance.flags.details && flagsInstance.flags.details.length > 0) {
23505
23985
  displayData = [
23506
23986
  ...displayData,
23507
- ...flagsInstance.flags.details.map((detail) => this.mapFlagDetailForDisplay(detail, flagsInstance))
23987
+ ...flagsInstance.flags.details.map((detail) => this.mapFlagDetailForDisplay(detail, flagsInstance, originalStatus))
23508
23988
  ];
23509
23989
  }
23510
23990
  return displayData;
@@ -23520,7 +24000,7 @@ class ManageCaseFlagsComponent {
23520
24000
  this.onNoFlagsError();
23521
24001
  }
23522
24002
  }
23523
- mapFlagDetailForDisplay(flagDetail, flagsInstance) {
24003
+ mapFlagDetailForDisplay(flagDetail, flagsInstance, originalStatusFromFG) {
23524
24004
  // Reset the flag status with the original persisted status. This is needed because ngOnInit() needs to filter
23525
24005
  // out any "Inactive" or "Not approved" flags based on their status *before* modification. If the user changes a
23526
24006
  // flag's status then decides to return to the start of the flag update journey, the flag's status would no
@@ -23543,8 +24023,9 @@ class ManageCaseFlagsComponent {
23543
24023
  }
23544
24024
  if (formattedValue && FieldsUtils.isNonEmptyObject(formattedValue)) {
23545
24025
  const originalFlagDetail = formattedValue.details?.find((detail) => detail.id === flagDetail.id);
24026
+ const statusToUse = originalStatusFromFG ? (originalStatusFromFG === originalFlagDetail.value?.status ? originalFlagDetail.value?.status : originalStatusFromFG) : originalFlagDetail.value?.status;
23546
24027
  if (originalFlagDetail) {
23547
- originalStatus = originalFlagDetail.value?.status;
24028
+ originalStatus = statusToUse;
23548
24029
  flagDetail.flagComment = originalFlagDetail.value?.flagComment;
23549
24030
  flagDetail.flagComment_cy = originalFlagDetail.value?.flagComment_cy;
23550
24031
  flagDetail.otherDescription = originalFlagDetail.value?.otherDescription;
@@ -23613,8 +24094,14 @@ class ManageCaseFlagsComponent {
23613
24094
  errorMessages: this.errorMessages
23614
24095
  });
23615
24096
  }
23616
- static ɵfac = function ManageCaseFlagsComponent_Factory(t) { return new (t || ManageCaseFlagsComponent)(); };
23617
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ManageCaseFlagsComponent, selectors: [["ccd-manage-case-flags"]], inputs: { formGroup: "formGroup", flagsData: "flagsData", caseTitle: "caseTitle", displayContextParameter: "displayContextParameter" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 11, vars: 10, consts: [[3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "manage-case-flag-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "manage-case-flag-heading", 1, "govuk-fieldset__heading"], ["id", "manage-case-flag-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["class", "govuk-button-group", 4, "ngIf"], ["id", "manage-case-flag-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for", "innerHtml"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"]], template: function ManageCaseFlagsComponent_Template(rf, ctx) { if (rf & 1) {
24097
+ next() {
24098
+ this.onNext();
24099
+ if (this.errorMessages.length === 0) {
24100
+ super.next();
24101
+ }
24102
+ }
24103
+ static ɵfac = /*@__PURE__*/ (() => { let ɵManageCaseFlagsComponent_BaseFactory; return function ManageCaseFlagsComponent_Factory(t) { return (ɵManageCaseFlagsComponent_BaseFactory || (ɵManageCaseFlagsComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ManageCaseFlagsComponent)))(t || ManageCaseFlagsComponent); }; })();
24104
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ManageCaseFlagsComponent, selectors: [["ccd-manage-case-flags"]], inputs: { formGroup: "formGroup", flagsData: "flagsData", caseTitle: "caseTitle", displayContextParameter: "displayContextParameter" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 10, vars: 9, consts: [[3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "manage-case-flag-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "manage-case-flag-heading", 1, "govuk-fieldset__heading"], ["id", "manage-case-flag-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "manage-case-flag-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for", "innerHtml"]], template: function ManageCaseFlagsComponent_Template(rf, ctx) { if (rf & 1) {
23618
24105
  i0.ɵɵelementContainerStart(0, 0);
23619
24106
  i0.ɵɵelementStart(1, "div", 1)(2, "fieldset", 2)(3, "legend", 3)(4, "h1", 4);
23620
24107
  i0.ɵɵtext(5);
@@ -23625,24 +24112,21 @@ class ManageCaseFlagsComponent {
23625
24112
  i0.ɵɵtemplate(9, ManageCaseFlagsComponent_div_9_Template, 4, 10, "div", 7);
23626
24113
  i0.ɵɵelementEnd()()();
23627
24114
  i0.ɵɵelementContainerEnd();
23628
- i0.ɵɵtemplate(10, ManageCaseFlagsComponent_div_10_Template, 4, 3, "div", 8);
23629
24115
  } if (rf & 2) {
23630
24116
  i0.ɵɵproperty("formGroup", ctx.formGroup);
23631
24117
  i0.ɵɵadvance();
23632
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$r, ctx.errorMessages.length > 0));
24118
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c0$r, ctx.errorMessages.length > 0));
23633
24119
  i0.ɵɵadvance(4);
23634
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 6, ctx.manageCaseFlagTitle), " ");
24120
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 5, ctx.manageCaseFlagTitle), " ");
23635
24121
  i0.ɵɵadvance(2);
23636
24122
  i0.ɵɵproperty("ngIf", ctx.manageCaseFlagSelectedErrorMessage);
23637
24123
  i0.ɵɵadvance(2);
23638
24124
  i0.ɵɵproperty("ngForOf", ctx.flagsDisplayData);
23639
- i0.ɵɵadvance();
23640
- i0.ɵɵproperty("ngIf", !ctx.noFlagsError);
23641
24125
  } }, styles: [".flag-name-and-description{font-weight:700}\n"], encapsulation: 2 });
23642
24126
  }
23643
24127
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ManageCaseFlagsComponent, [{
23644
24128
  type: Component,
23645
- args: [{ selector: 'ccd-manage-case-flags', encapsulation: ViewEncapsulation.None, template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"manage-case-flag-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"manage-case-flag-heading\" class=\"govuk-fieldset__heading\">\n {{manageCaseFlagTitle | rpxTranslate}}\n </h1>\n </legend>\n <div id=\"manage-case-flag-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"manageCaseFlagSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{manageCaseFlagSelectedErrorMessage | rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagDisplay of flagsDisplayData; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-selection-{{i}}\" [name]=\"selectedControlName\"\n type=\"radio\" [value]=\"flagDisplay\" [formControlName]=\"selectedControlName\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-selection-{{i}}\" [innerHtml]=\"flagDisplay | manageCaseFlagsLabelDisplay\"></label>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\" *ngIf=\"!noFlagsError\">\n <button class=\"button button-primary\" type=\"button\" (click)=\"onNext()\">{{'Next' | rpxTranslate}}</button>\n</div>\n", styles: [".flag-name-and-description{font-weight:700}\n"] }]
24129
+ args: [{ selector: 'ccd-manage-case-flags', encapsulation: ViewEncapsulation.None, template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"manage-case-flag-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"manage-case-flag-heading\" class=\"govuk-fieldset__heading\">\n {{manageCaseFlagTitle | rpxTranslate}}\n </h1>\n </legend>\n <div id=\"manage-case-flag-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"manageCaseFlagSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{manageCaseFlagSelectedErrorMessage | rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagDisplay of flagsDisplayData; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-selection-{{i}}\" [name]=\"selectedControlName\"\n type=\"radio\" [value]=\"flagDisplay\" [formControlName]=\"selectedControlName\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-selection-{{i}}\" [innerHtml]=\"flagDisplay | manageCaseFlagsLabelDisplay\"></label>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>", styles: [".flag-name-and-description{font-weight:700}\n"] }]
23646
24130
  }], null, { formGroup: [{
23647
24131
  type: Input
23648
24132
  }], flagsData: [{
@@ -23654,7 +24138,7 @@ class ManageCaseFlagsComponent {
23654
24138
  }], caseFlagStateEmitter: [{
23655
24139
  type: Output
23656
24140
  }] }); })();
23657
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ManageCaseFlagsComponent, { className: "ManageCaseFlagsComponent", filePath: "lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.ts", lineNumber: 14 }); })();
24141
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ManageCaseFlagsComponent, { className: "ManageCaseFlagsComponent", filePath: "lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.ts", lineNumber: 15 }); })();
23658
24142
 
23659
24143
  // tslint:disable:variable-name
23660
24144
  /**
@@ -23719,7 +24203,7 @@ var SearchLanguageInterpreterControlNames;
23719
24203
 
23720
24204
  const _c0$q = a0 => ({ "form-group-error": a0 });
23721
24205
  function SearchLanguageInterpreterComponent_div_10_Template(rf, ctx) { if (rf & 1) {
23722
- i0.ɵɵelementStart(0, "div", 20)(1, "span", 21);
24206
+ i0.ɵɵelementStart(0, "div", 18)(1, "span", 19);
23723
24207
  i0.ɵɵtext(2);
23724
24208
  i0.ɵɵpipe(3, "rpxTranslate");
23725
24209
  i0.ɵɵelementEnd();
@@ -23734,7 +24218,7 @@ function SearchLanguageInterpreterComponent_div_10_Template(rf, ctx) { if (rf &
23734
24218
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.languageNotSelectedErrorMessage), " ");
23735
24219
  } }
23736
24220
  function SearchLanguageInterpreterComponent_div_11_Template(rf, ctx) { if (rf & 1) {
23737
- i0.ɵɵelementStart(0, "div", 22)(1, "span", 21);
24221
+ i0.ɵɵelementStart(0, "div", 20)(1, "span", 19);
23738
24222
  i0.ɵɵtext(2);
23739
24223
  i0.ɵɵpipe(3, "rpxTranslate");
23740
24224
  i0.ɵɵelementEnd();
@@ -23749,7 +24233,7 @@ function SearchLanguageInterpreterComponent_div_11_Template(rf, ctx) { if (rf &
23749
24233
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.languageEnteredInBothFieldsErrorMessage), " ");
23750
24234
  } }
23751
24235
  function SearchLanguageInterpreterComponent_mat_option_15_Template(rf, ctx) { if (rf & 1) {
23752
- i0.ɵɵelementStart(0, "mat-option", 23);
24236
+ i0.ɵɵelementStart(0, "mat-option", 21);
23753
24237
  i0.ɵɵtext(1);
23754
24238
  i0.ɵɵpipe(2, "languageInterpreterDisplay");
23755
24239
  i0.ɵɵelementEnd();
@@ -23760,7 +24244,7 @@ function SearchLanguageInterpreterComponent_mat_option_15_Template(rf, ctx) { if
23760
24244
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 2, language_r3), " ");
23761
24245
  } }
23762
24246
  function SearchLanguageInterpreterComponent_mat_option_17_Template(rf, ctx) { if (rf & 1) {
23763
- i0.ɵɵelementStart(0, "mat-option", 24);
24247
+ i0.ɵɵelementStart(0, "mat-option", 22);
23764
24248
  i0.ɵɵtext(1);
23765
24249
  i0.ɵɵpipe(2, "rpxTranslate");
23766
24250
  i0.ɵɵelementEnd();
@@ -23769,7 +24253,7 @@ function SearchLanguageInterpreterComponent_mat_option_17_Template(rf, ctx) { if
23769
24253
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "No results found"));
23770
24254
  } }
23771
24255
  function SearchLanguageInterpreterComponent_div_24_div_5_Template(rf, ctx) { if (rf & 1) {
23772
- i0.ɵɵelementStart(0, "div", 30)(1, "span", 21);
24256
+ i0.ɵɵelementStart(0, "div", 28)(1, "span", 19);
23773
24257
  i0.ɵɵtext(2);
23774
24258
  i0.ɵɵpipe(3, "rpxTranslate");
23775
24259
  i0.ɵɵelementEnd();
@@ -23784,7 +24268,7 @@ function SearchLanguageInterpreterComponent_div_24_div_5_Template(rf, ctx) { if
23784
24268
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.languageNotEnteredErrorMessage), " ");
23785
24269
  } }
23786
24270
  function SearchLanguageInterpreterComponent_div_24_div_6_Template(rf, ctx) { if (rf & 1) {
23787
- i0.ɵɵelementStart(0, "div", 31)(1, "span", 21);
24271
+ i0.ɵɵelementStart(0, "div", 29)(1, "span", 19);
23788
24272
  i0.ɵɵtext(2);
23789
24273
  i0.ɵɵpipe(3, "rpxTranslate");
23790
24274
  i0.ɵɵelementEnd();
@@ -23799,12 +24283,12 @@ function SearchLanguageInterpreterComponent_div_24_div_6_Template(rf, ctx) { if
23799
24283
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.languageCharLimitErrorMessage), " ");
23800
24284
  } }
23801
24285
  function SearchLanguageInterpreterComponent_div_24_Template(rf, ctx) { if (rf & 1) {
23802
- i0.ɵɵelementStart(0, "div", 25)(1, "div", 2)(2, "label", 26);
24286
+ i0.ɵɵelementStart(0, "div", 23)(1, "div", 2)(2, "label", 24);
23803
24287
  i0.ɵɵtext(3);
23804
24288
  i0.ɵɵpipe(4, "rpxTranslate");
23805
24289
  i0.ɵɵelementEnd();
23806
- i0.ɵɵtemplate(5, SearchLanguageInterpreterComponent_div_24_div_5_Template, 6, 6, "div", 27)(6, SearchLanguageInterpreterComponent_div_24_div_6_Template, 6, 6, "div", 28);
23807
- i0.ɵɵelement(7, "input", 29);
24290
+ i0.ɵɵtemplate(5, SearchLanguageInterpreterComponent_div_24_div_5_Template, 6, 6, "div", 25)(6, SearchLanguageInterpreterComponent_div_24_div_6_Template, 6, 6, "div", 26);
24291
+ i0.ɵɵelement(7, "input", 27);
23808
24292
  i0.ɵɵelementEnd()();
23809
24293
  } if (rf & 2) {
23810
24294
  const ctx_r1 = i0.ɵɵnextContext();
@@ -23819,7 +24303,7 @@ function SearchLanguageInterpreterComponent_div_24_Template(rf, ctx) { if (rf &
23819
24303
  i0.ɵɵadvance();
23820
24304
  i0.ɵɵproperty("name", ctx_r1.SearchLanguageInterpreterControlNames.MANUAL_LANGUAGE_ENTRY)("formControlName", ctx_r1.SearchLanguageInterpreterControlNames.MANUAL_LANGUAGE_ENTRY);
23821
24305
  } }
23822
- class SearchLanguageInterpreterComponent {
24306
+ class SearchLanguageInterpreterComponent extends AbstractJourneyComponent {
23823
24307
  rpxTranslationService;
23824
24308
  get searchLanguageInterpreterStep() {
23825
24309
  return SearchLanguageInterpreterStep;
@@ -23841,7 +24325,8 @@ class SearchLanguageInterpreterComponent {
23841
24325
  noResults = false;
23842
24326
  languageMaxCharLimit = 80;
23843
24327
  signLanguageFlagCode = 'RA0042';
23844
- constructor(rpxTranslationService) {
24328
+ constructor(rpxTranslationService, multipageComponentStateService) {
24329
+ super(multipageComponentStateService);
23845
24330
  this.rpxTranslationService = rpxTranslationService;
23846
24331
  }
23847
24332
  ngOnInit() {
@@ -23941,8 +24426,14 @@ class SearchLanguageInterpreterComponent {
23941
24426
  !language.value && language.value_cy.toLowerCase().includes(searchTerm.toLowerCase(), 0))
23942
24427
  : [];
23943
24428
  }
23944
- static ɵfac = function SearchLanguageInterpreterComponent_Factory(t) { return new (t || SearchLanguageInterpreterComponent)(i0.ɵɵdirectiveInject(i1.RpxTranslationService)); };
23945
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SearchLanguageInterpreterComponent, selectors: [["ccd-search-language-interpreter"]], inputs: { formGroup: "formGroup", flagType: "flagType" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 29, vars: 28, consts: [["autoSearchLanguage", "matAutocomplete"], [3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper"], [1, "govuk-label", "govuk-label--m", 3, "for"], ["id", "language-search-box-hint", 1, "govuk-hint"], [1, "auto-complete-container"], ["id", "language-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "language-entered-in-both-fields-error-message", "class", "govuk-error-message", 4, "ngIf"], ["aria-label", "Language search box", "matInput", "", "type", "text", 1, "govuk-input", "search-language__input", 3, "formControlName", "matAutocomplete"], ["autoActiveFirstOption", "", 1, "mat-autocomplete-panel-extend", 3, "displayWith"], [3, "value", 4, "ngFor", "ngForOf"], ["disabled", "", 4, "ngIf"], ["data-module", "govuk-checkboxes", 1, "govuk-checkboxes", "govuk-checkboxes--small", "govuk-checkboxes--conditional"], [1, "govuk-radios__item"], ["id", "enter-language-manually", "name", "enter-language-manually", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "change"], ["for", "enter-language-manually", 1, "govuk-label", "govuk-checkboxes__label"], ["class", "govuk-radios__conditional", 4, "ngIf"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"], ["id", "language-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "language-entered-in-both-fields-error-message", 1, "govuk-error-message"], [3, "value"], ["disabled", ""], [1, "govuk-radios__conditional"], ["for", "manual-language-entry", 1, "govuk-label"], ["id", "language-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "language-char-limit-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "manual-language-entry", "type", "text", 1, "govuk-input", "govuk-input--width-20", 3, "name", "formControlName"], ["id", "language-not-entered-error-message", 1, "govuk-error-message"], ["id", "language-char-limit-error-message", 1, "govuk-error-message"]], template: function SearchLanguageInterpreterComponent_Template(rf, ctx) { if (rf & 1) {
24429
+ next() {
24430
+ this.onNext();
24431
+ if (this.errorMessages.length === 0) {
24432
+ super.next();
24433
+ }
24434
+ }
24435
+ static ɵfac = function SearchLanguageInterpreterComponent_Factory(t) { return new (t || SearchLanguageInterpreterComponent)(i0.ɵɵdirectiveInject(i1.RpxTranslationService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
24436
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SearchLanguageInterpreterComponent, selectors: [["ccd-search-language-interpreter"]], inputs: { formGroup: "formGroup", flagType: "flagType" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 25, vars: 25, consts: [["autoSearchLanguage", "matAutocomplete"], [3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper"], [1, "govuk-label", "govuk-label--m", 3, "for"], ["id", "language-search-box-hint", 1, "govuk-hint"], [1, "auto-complete-container"], ["id", "language-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "language-entered-in-both-fields-error-message", "class", "govuk-error-message", 4, "ngIf"], ["aria-label", "Language search box", "matInput", "", "type", "text", 1, "govuk-input", "search-language__input", 3, "formControlName", "matAutocomplete"], ["autoActiveFirstOption", "", 1, "mat-autocomplete-panel-extend", 3, "displayWith"], [3, "value", 4, "ngFor", "ngForOf"], ["disabled", "", 4, "ngIf"], ["data-module", "govuk-checkboxes", 1, "govuk-checkboxes", "govuk-checkboxes--small", "govuk-checkboxes--conditional"], [1, "govuk-radios__item"], ["id", "enter-language-manually", "name", "enter-language-manually", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "change"], ["for", "enter-language-manually", 1, "govuk-label", "govuk-checkboxes__label"], ["class", "govuk-radios__conditional", 4, "ngIf"], ["id", "language-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "language-entered-in-both-fields-error-message", 1, "govuk-error-message"], [3, "value"], ["disabled", ""], [1, "govuk-radios__conditional"], ["for", "manual-language-entry", 1, "govuk-label"], ["id", "language-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "language-char-limit-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "manual-language-entry", "type", "text", 1, "govuk-input", "govuk-input--width-20", 3, "name", "formControlName"], ["id", "language-not-entered-error-message", 1, "govuk-error-message"], ["id", "language-char-limit-error-message", 1, "govuk-error-message"]], template: function SearchLanguageInterpreterComponent_Template(rf, ctx) { if (rf & 1) {
23946
24437
  const _r1 = i0.ɵɵgetCurrentView();
23947
24438
  i0.ɵɵelementContainerStart(0, 1);
23948
24439
  i0.ɵɵelementStart(1, "div", 2)(2, "h1", 3)(3, "label", 4);
@@ -23971,22 +24462,17 @@ class SearchLanguageInterpreterComponent {
23971
24462
  i0.ɵɵtemplate(24, SearchLanguageInterpreterComponent_div_24_Template, 8, 10, "div", 17);
23972
24463
  i0.ɵɵelementEnd()();
23973
24464
  i0.ɵɵelementContainerEnd();
23974
- i0.ɵɵelementStart(25, "div", 18)(26, "button", 19);
23975
- i0.ɵɵlistener("click", function SearchLanguageInterpreterComponent_Template_button_click_26_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onNext()); });
23976
- i0.ɵɵtext(27);
23977
- i0.ɵɵpipe(28, "rpxTranslate");
23978
- i0.ɵɵelementEnd()();
23979
24465
  } if (rf & 2) {
23980
24466
  const autoSearchLanguage_r4 = i0.ɵɵreference(14);
23981
24467
  i0.ɵɵproperty("formGroup", ctx.formGroup);
23982
24468
  i0.ɵɵadvance();
23983
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(26, _c0$q, ctx.languageNotSelectedErrorMessage || ctx.languageEnteredInBothFieldsErrorMessage));
24469
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(23, _c0$q, ctx.languageNotSelectedErrorMessage || ctx.languageEnteredInBothFieldsErrorMessage));
23984
24470
  i0.ɵɵadvance(2);
23985
24471
  i0.ɵɵproperty("for", ctx.SearchLanguageInterpreterControlNames.LANGUAGE_SEARCH_TERM);
23986
24472
  i0.ɵɵadvance();
23987
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(5, 15, ctx.flagType, "name"), " ");
24473
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(5, 14, ctx.flagType, "name"), " ");
23988
24474
  i0.ɵɵadvance(3);
23989
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 18, ctx.searchLanguageInterpreterHint), " ");
24475
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 17, ctx.searchLanguageInterpreterHint), " ");
23990
24476
  i0.ɵɵadvance(3);
23991
24477
  i0.ɵɵproperty("ngIf", ctx.languageNotSelectedErrorMessage);
23992
24478
  i0.ɵɵadvance();
@@ -23996,32 +24482,30 @@ class SearchLanguageInterpreterComponent {
23996
24482
  i0.ɵɵadvance();
23997
24483
  i0.ɵɵproperty("displayWith", ctx.displayLanguage);
23998
24484
  i0.ɵɵadvance(2);
23999
- i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(16, 20, ctx.filteredLanguages$));
24485
+ i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(16, 19, ctx.filteredLanguages$));
24000
24486
  i0.ɵɵadvance(2);
24001
24487
  i0.ɵɵproperty("ngIf", ctx.noResults && ctx.searchTerm && ctx.searchTerm.length >= ctx.minSearchCharacters);
24002
24488
  i0.ɵɵadvance(5);
24003
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(23, 22, ctx.searchLanguageInterpreterStep.CHECKBOX_LABEL), " ");
24489
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(23, 21, ctx.searchLanguageInterpreterStep.CHECKBOX_LABEL), " ");
24004
24490
  i0.ɵɵadvance(2);
24005
24491
  i0.ɵɵproperty("ngIf", ctx.isCheckboxEnabled);
24006
- i0.ɵɵadvance(3);
24007
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(28, 24, "Next"));
24008
24492
  } }, styles: [".autocomplete__input--show-all-values[_ngcontent-%COMP%]{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down[_ngcontent-%COMP%]{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu[_ngcontent-%COMP%]{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible[_ngcontent-%COMP%]{display:block}.autocomplete__menu--hidden[_ngcontent-%COMP%]{display:none}.autocomplete__menu--overlay[_ngcontent-%COMP%]{box-shadow:#00000042 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline[_ngcontent-%COMP%]{position:relative}.autocomplete__option[_ngcontent-%COMP%]{border-bottom:solid #b1b4b6;border-width:1px 0;cursor:pointer;display:block;position:relative}.autocomplete__option[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{pointer-events:none}.autocomplete__option[_ngcontent-%COMP%]:first-of-type{border-top-width:0}.autocomplete__option[_ngcontent-%COMP%]:last-of-type{border-bottom-width:0}.autocomplete__option--odd[_ngcontent-%COMP%]{background-color:#fafafa}.autocomplete__option--focused[_ngcontent-%COMP%], .autocomplete__option[_ngcontent-%COMP%]:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results[_ngcontent-%COMP%]{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint[_ngcontent-%COMP%], .autocomplete__input[_ngcontent-%COMP%], .autocomplete__option[_ngcontent-%COMP%]{font-size:13px;line-height:1.25}.autocomplete__hint[_ngcontent-%COMP%], .autocomplete__option[_ngcontent-%COMP%]{padding:5px}@media (min-width: 641px){.autocomplete__hint[_ngcontent-%COMP%], .autocomplete__input[_ngcontent-%COMP%], .autocomplete__option[_ngcontent-%COMP%]{font-size:13px;line-height:1.31579}}.div-action[_ngcontent-%COMP%]{display:inline-block}.add-location[_ngcontent-%COMP%]{display:inline}.remove-location-button[_ngcontent-%COMP%]{margin:5px}.hide-autocomplete[_ngcontent-%COMP%]{display:none}.auto-complete-container[_ngcontent-%COMP%]{min-width:550px;display:inline-block;margin-right:4px}.autocomplete__input[_ngcontent-%COMP%]{line-height:24px;font-size:19px}.hidden[_ngcontent-%COMP%]{display:none}.search-language__input[_ngcontent-%COMP%]{position:relative;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='40' height='40'%3E%3Cpath d='M25.7 24.8L21.9 21c.7-1 1.1-2.2 1.1-3.5 0-3.6-2.9-6.5-6.5-6.5S10 13.9 10 17.5s2.9 6.5 6.5 6.5c1.6 0 3-.6 4.1-1.5l3.7 3.7 1.4-1.4zM12 17.5c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z' fill='%23505a5f'%3E%3C/path%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:center left -2px;background-size:40px 40px;padding-left:35px}"] });
24009
24493
  }
24010
24494
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SearchLanguageInterpreterComponent, [{
24011
24495
  type: Component,
24012
- args: [{ selector: 'ccd-search-language-interpreter', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': languageNotSelectedErrorMessage || languageEnteredInBothFieldsErrorMessage}\">\n <h1 class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--m\" [for]=\"SearchLanguageInterpreterControlNames.LANGUAGE_SEARCH_TERM\">\n {{flagType | flagFieldDisplay:'name'}}\n </label>\n </h1>\n <div id=\"language-search-box-hint\" class=\"govuk-hint\">\n {{searchLanguageInterpreterHint | rpxTranslate}}\n </div>\n <div class=\"auto-complete-container\">\n <div id=\"language-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageNotSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageNotSelectedErrorMessage | rpxTranslate}}\n </div>\n <div id=\"language-entered-in-both-fields-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageEnteredInBothFieldsErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageEnteredInBothFieldsErrorMessage | rpxTranslate}}\n </div>\n <input aria-label=\"Language search box\" matInput [formControlName]=\"SearchLanguageInterpreterControlNames.LANGUAGE_SEARCH_TERM\" [matAutocomplete]=\"autoSearchLanguage\"\n class=\"govuk-input search-language__input\" type=\"text\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchLanguage=\"matAutocomplete\"\n [displayWith]=\"displayLanguage\">\n <mat-option *ngFor=\"let language of filteredLanguages$ | async\" [value]=\"language\">\n {{language | languageInterpreterDisplay}}\n </mat-option>\n <mat-option *ngIf=\"noResults && searchTerm && searchTerm.length >= minSearchCharacters\" disabled>{{'No results found' | rpxTranslate}}</mat-option>\n </mat-autocomplete>\n </div>\n <div class=\"govuk-checkboxes govuk-checkboxes--small govuk-checkboxes--conditional\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-radios__item\">\n <input class=\"govuk-checkboxes__input\" id=\"enter-language-manually\" name=\"enter-language-manually\" type=\"checkbox\"\n (change)=\"onEnterLanguageManually($event)\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"enter-language-manually\">\n {{searchLanguageInterpreterStep.CHECKBOX_LABEL | rpxTranslate}}\n </label>\n </div>\n <div class=\"govuk-radios__conditional\" *ngIf=\"isCheckboxEnabled\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': languageNotEnteredErrorMessage || languageCharLimitErrorMessage }\">\n <label class=\"govuk-label\" for=\"manual-language-entry\">{{searchLanguageInterpreterStep.INPUT_LABEL | rpxTranslate}}</label>\n <div id=\"language-not-entered-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"language-char-limit-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageCharLimitErrorMessage | rpxTranslate}}\n </div>\n <input class=\"govuk-input govuk-input--width-20\" id=\"manual-language-entry\" [name]=\"SearchLanguageInterpreterControlNames.MANUAL_LANGUAGE_ENTRY\" type=\"text\"\n [formControlName]=\"SearchLanguageInterpreterControlNames.MANUAL_LANGUAGE_ENTRY\">\n </div>\n </div>\n </div>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" (click)=\"onNext()\">{{'Next' | rpxTranslate}}</button>\n</div>\n", styles: [".autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:#00000042 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:solid #b1b4b6;border-width:1px 0;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width: 641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{min-width:550px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}.hidden{display:none}.search-language__input{position:relative;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='40' height='40'%3E%3Cpath d='M25.7 24.8L21.9 21c.7-1 1.1-2.2 1.1-3.5 0-3.6-2.9-6.5-6.5-6.5S10 13.9 10 17.5s2.9 6.5 6.5 6.5c1.6 0 3-.6 4.1-1.5l3.7 3.7 1.4-1.4zM12 17.5c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z' fill='%23505a5f'%3E%3C/path%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:center left -2px;background-size:40px 40px;padding-left:35px}\n"] }]
24013
- }], () => [{ type: i1.RpxTranslationService }], { formGroup: [{
24496
+ args: [{ selector: 'ccd-search-language-interpreter', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': languageNotSelectedErrorMessage || languageEnteredInBothFieldsErrorMessage}\">\n <h1 class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--m\" [for]=\"SearchLanguageInterpreterControlNames.LANGUAGE_SEARCH_TERM\">\n {{flagType | flagFieldDisplay:'name'}}\n </label>\n </h1>\n <div id=\"language-search-box-hint\" class=\"govuk-hint\">\n {{searchLanguageInterpreterHint | rpxTranslate}}\n </div>\n <div class=\"auto-complete-container\">\n <div id=\"language-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageNotSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageNotSelectedErrorMessage | rpxTranslate}}\n </div>\n <div id=\"language-entered-in-both-fields-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageEnteredInBothFieldsErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageEnteredInBothFieldsErrorMessage | rpxTranslate}}\n </div>\n <input aria-label=\"Language search box\" matInput [formControlName]=\"SearchLanguageInterpreterControlNames.LANGUAGE_SEARCH_TERM\" [matAutocomplete]=\"autoSearchLanguage\"\n class=\"govuk-input search-language__input\" type=\"text\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchLanguage=\"matAutocomplete\"\n [displayWith]=\"displayLanguage\">\n <mat-option *ngFor=\"let language of filteredLanguages$ | async\" [value]=\"language\">\n {{language | languageInterpreterDisplay}}\n </mat-option>\n <mat-option *ngIf=\"noResults && searchTerm && searchTerm.length >= minSearchCharacters\" disabled>{{'No results found' | rpxTranslate}}</mat-option>\n </mat-autocomplete>\n </div>\n <div class=\"govuk-checkboxes govuk-checkboxes--small govuk-checkboxes--conditional\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-radios__item\">\n <input class=\"govuk-checkboxes__input\" id=\"enter-language-manually\" name=\"enter-language-manually\" type=\"checkbox\"\n (change)=\"onEnterLanguageManually($event)\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"enter-language-manually\">\n {{searchLanguageInterpreterStep.CHECKBOX_LABEL | rpxTranslate}}\n </label>\n </div>\n <div class=\"govuk-radios__conditional\" *ngIf=\"isCheckboxEnabled\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': languageNotEnteredErrorMessage || languageCharLimitErrorMessage }\">\n <label class=\"govuk-label\" for=\"manual-language-entry\">{{searchLanguageInterpreterStep.INPUT_LABEL | rpxTranslate}}</label>\n <div id=\"language-not-entered-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"language-char-limit-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageCharLimitErrorMessage | rpxTranslate}}\n </div>\n <input class=\"govuk-input govuk-input--width-20\" id=\"manual-language-entry\" [name]=\"SearchLanguageInterpreterControlNames.MANUAL_LANGUAGE_ENTRY\" type=\"text\"\n [formControlName]=\"SearchLanguageInterpreterControlNames.MANUAL_LANGUAGE_ENTRY\">\n </div>\n </div>\n </div>\n </div>\n</ng-container>\n", styles: [".autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:#00000042 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:solid #b1b4b6;border-width:1px 0;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width: 641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{min-width:550px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}.hidden{display:none}.search-language__input{position:relative;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='40' height='40'%3E%3Cpath d='M25.7 24.8L21.9 21c.7-1 1.1-2.2 1.1-3.5 0-3.6-2.9-6.5-6.5-6.5S10 13.9 10 17.5s2.9 6.5 6.5 6.5c1.6 0 3-.6 4.1-1.5l3.7 3.7 1.4-1.4zM12 17.5c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z' fill='%23505a5f'%3E%3C/path%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:center left -2px;background-size:40px 40px;padding-left:35px}\n"] }]
24497
+ }], () => [{ type: i1.RpxTranslationService }, { type: MultipageComponentStateService }], { formGroup: [{
24014
24498
  type: Input
24015
24499
  }], flagType: [{
24016
24500
  type: Input
24017
24501
  }], caseFlagStateEmitter: [{
24018
24502
  type: Output
24019
24503
  }] }); })();
24020
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SearchLanguageInterpreterComponent, { className: "SearchLanguageInterpreterComponent", filePath: "lib/shared/components/palette/case-flag/components/search-language-interpreter/search-language-interpreter.component.ts", lineNumber: 17 }); })();
24504
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SearchLanguageInterpreterComponent, { className: "SearchLanguageInterpreterComponent", filePath: "lib/shared/components/palette/case-flag/components/search-language-interpreter/search-language-interpreter.component.ts", lineNumber: 20 }); })();
24021
24505
 
24022
24506
  const _c0$p = a0 => ({ "form-group-error": a0 });
24023
24507
  function SelectFlagLocationComponent_div_7_Template(rf, ctx) { if (rf & 1) {
24024
- i0.ɵɵelementStart(0, "div", 9)(1, "span", 10);
24508
+ i0.ɵɵelementStart(0, "div", 8)(1, "span", 9);
24025
24509
  i0.ɵɵtext(2);
24026
24510
  i0.ɵɵpipe(3, "rpxTranslate");
24027
24511
  i0.ɵɵelementEnd();
@@ -24048,7 +24532,7 @@ function SelectFlagLocationComponent_div_9_ng_container_3_ng_container_2_Templat
24048
24532
  function SelectFlagLocationComponent_div_9_ng_container_3_Template(rf, ctx) { if (rf & 1) {
24049
24533
  i0.ɵɵelementContainerStart(0);
24050
24534
  i0.ɵɵtext(1);
24051
- i0.ɵɵtemplate(2, SelectFlagLocationComponent_div_9_ng_container_3_ng_container_2_Template, 3, 3, "ng-container", 14);
24535
+ i0.ɵɵtemplate(2, SelectFlagLocationComponent_div_9_ng_container_3_ng_container_2_Template, 3, 3, "ng-container", 13);
24052
24536
  i0.ɵɵelementContainerEnd();
24053
24537
  } if (rf & 2) {
24054
24538
  const flagsInstance_r2 = i0.ɵɵnextContext().$implicit;
@@ -24068,10 +24552,10 @@ function SelectFlagLocationComponent_div_9_ng_container_4_Template(rf, ctx) { if
24068
24552
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, ctx_r0.caseLevelFlagLabel), " ");
24069
24553
  } }
24070
24554
  function SelectFlagLocationComponent_div_9_Template(rf, ctx) { if (rf & 1) {
24071
- i0.ɵɵelementStart(0, "div", 11);
24072
- i0.ɵɵelement(1, "input", 12);
24073
- i0.ɵɵelementStart(2, "label", 13);
24074
- i0.ɵɵtemplate(3, SelectFlagLocationComponent_div_9_ng_container_3_Template, 3, 2, "ng-container", 14)(4, SelectFlagLocationComponent_div_9_ng_container_4_Template, 3, 3, "ng-container", 14);
24555
+ i0.ɵɵelementStart(0, "div", 10);
24556
+ i0.ɵɵelement(1, "input", 11);
24557
+ i0.ɵɵelementStart(2, "label", 12);
24558
+ i0.ɵɵtemplate(3, SelectFlagLocationComponent_div_9_ng_container_3_Template, 3, 2, "ng-container", 13)(4, SelectFlagLocationComponent_div_9_ng_container_4_Template, 3, 3, "ng-container", 13);
24075
24559
  i0.ɵɵelementEnd()();
24076
24560
  } if (rf & 2) {
24077
24561
  const flagsInstance_r2 = ctx.$implicit;
@@ -24087,18 +24571,7 @@ function SelectFlagLocationComponent_div_9_Template(rf, ctx) { if (rf & 1) {
24087
24571
  i0.ɵɵadvance();
24088
24572
  i0.ɵɵproperty("ngIf", !flagsInstance_r2.flags.partyName);
24089
24573
  } }
24090
- function SelectFlagLocationComponent_div_10_Template(rf, ctx) { if (rf & 1) {
24091
- const _r4 = i0.ɵɵgetCurrentView();
24092
- i0.ɵɵelementStart(0, "div", 15)(1, "button", 16);
24093
- i0.ɵɵlistener("click", function SelectFlagLocationComponent_div_10_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onNext()); });
24094
- i0.ɵɵtext(2);
24095
- i0.ɵɵpipe(3, "rpxTranslate");
24096
- i0.ɵɵelementEnd()();
24097
- } if (rf & 2) {
24098
- i0.ɵɵadvance(2);
24099
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 1, "Next"));
24100
- } }
24101
- class SelectFlagLocationComponent {
24574
+ class SelectFlagLocationComponent extends AbstractJourneyComponent {
24102
24575
  formGroup;
24103
24576
  flagsData;
24104
24577
  isDisplayContextParameterExternal = false;
@@ -24173,8 +24646,14 @@ class SelectFlagLocationComponent {
24173
24646
  // Return case flag field state and error messages to the parent
24174
24647
  this.caseFlagStateEmitter.emit({ currentCaseFlagFieldState: CaseFlagFieldState.FLAG_TYPE, errorMessages: this.errorMessages });
24175
24648
  }
24176
- static ɵfac = function SelectFlagLocationComponent_Factory(t) { return new (t || SelectFlagLocationComponent)(); };
24177
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SelectFlagLocationComponent, selectors: [["ccd-select-flag-location"]], inputs: { formGroup: "formGroup", flagsData: "flagsData", isDisplayContextParameterExternal: "isDisplayContextParameterExternal" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 11, vars: 10, consts: [[3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "flag-location-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "flag-location-heading", 1, "govuk-fieldset__heading"], ["id", "flag-location-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["class", "govuk-button-group", 4, "ngIf"], ["id", "flag-location-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for"], [4, "ngIf"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"]], template: function SelectFlagLocationComponent_Template(rf, ctx) { if (rf & 1) {
24649
+ next() {
24650
+ this.onNext();
24651
+ if (this.errorMessages.length === 0) {
24652
+ super.next();
24653
+ }
24654
+ }
24655
+ static ɵfac = /*@__PURE__*/ (() => { let ɵSelectFlagLocationComponent_BaseFactory; return function SelectFlagLocationComponent_Factory(t) { return (ɵSelectFlagLocationComponent_BaseFactory || (ɵSelectFlagLocationComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SelectFlagLocationComponent)))(t || SelectFlagLocationComponent); }; })();
24656
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SelectFlagLocationComponent, selectors: [["ccd-select-flag-location"]], inputs: { formGroup: "formGroup", flagsData: "flagsData", isDisplayContextParameterExternal: "isDisplayContextParameterExternal" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 10, vars: 9, consts: [[3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "flag-location-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "flag-location-heading", 1, "govuk-fieldset__heading"], ["id", "flag-location-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "flag-location-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for"], [4, "ngIf"]], template: function SelectFlagLocationComponent_Template(rf, ctx) { if (rf & 1) {
24178
24657
  i0.ɵɵelementContainerStart(0, 0);
24179
24658
  i0.ɵɵelementStart(1, "div", 1)(2, "fieldset", 2)(3, "legend", 3)(4, "h1", 4);
24180
24659
  i0.ɵɵtext(5);
@@ -24185,24 +24664,21 @@ class SelectFlagLocationComponent {
24185
24664
  i0.ɵɵtemplate(9, SelectFlagLocationComponent_div_9_Template, 5, 9, "div", 7);
24186
24665
  i0.ɵɵelementEnd()()();
24187
24666
  i0.ɵɵelementContainerEnd();
24188
- i0.ɵɵtemplate(10, SelectFlagLocationComponent_div_10_Template, 4, 3, "div", 8);
24189
24667
  } if (rf & 2) {
24190
24668
  i0.ɵɵproperty("formGroup", ctx.formGroup);
24191
24669
  i0.ɵɵadvance();
24192
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$p, ctx.errorMessages.length > 0));
24670
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c0$p, ctx.errorMessages.length > 0));
24193
24671
  i0.ɵɵadvance(4);
24194
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 6, ctx.flagLocationTitle), " ");
24672
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 5, ctx.flagLocationTitle), " ");
24195
24673
  i0.ɵɵadvance(2);
24196
24674
  i0.ɵɵproperty("ngIf", ctx.flagLocationNotSelectedErrorMessage);
24197
24675
  i0.ɵɵadvance(2);
24198
24676
  i0.ɵɵproperty("ngForOf", ctx.filteredFlagsData);
24199
- i0.ɵɵadvance();
24200
- i0.ɵɵproperty("ngIf", !ctx.caseFlagsConfigError);
24201
24677
  } }, dependencies: [i5.NgClass, i5.NgForOf, i5.NgIf, i4.DefaultValueAccessor, i4.RadioControlValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormControlName, i1.RpxTranslatePipe], encapsulation: 2 });
24202
24678
  }
24203
24679
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SelectFlagLocationComponent, [{
24204
24680
  type: Component,
24205
- args: [{ selector: 'ccd-select-flag-location', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"flag-location-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"flag-location-heading\" class=\"govuk-fieldset__heading\">\n {{flagLocationTitle | rpxTranslate}}\n </h1>\n </legend>\n <div id=\"flag-location-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"flagLocationNotSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagLocationNotSelectedErrorMessage | rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagsInstance of filteredFlagsData; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-location-{{i}}\" [name]=\"selectedLocationControlName\"\n type=\"radio\" [value]=\"flagsInstance\" [formControlName]=\"selectedLocationControlName\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-location-{{i}}\">\n <ng-container *ngIf=\"flagsInstance.flags.partyName\">\n {{flagsInstance.flags.partyName}}\n <ng-container *ngIf=\"flagsInstance.flags.roleOnCase\">\n ({{flagsInstance.flags.roleOnCase | rpxTranslate}})\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!flagsInstance.flags.partyName\">\n {{caseLevelFlagLabel | rpxTranslate}}\n </ng-container>\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\" *ngIf=\"!caseFlagsConfigError\">\n <button class=\"button button-primary\" type=\"button\" (click)=\"onNext()\">{{'Next' | rpxTranslate}}</button>\n</div>\n" }]
24681
+ args: [{ selector: 'ccd-select-flag-location', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"flag-location-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"flag-location-heading\" class=\"govuk-fieldset__heading\">\n {{flagLocationTitle | rpxTranslate}}\n </h1>\n </legend>\n <div id=\"flag-location-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"flagLocationNotSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagLocationNotSelectedErrorMessage | rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagsInstance of filteredFlagsData; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-location-{{i}}\" [name]=\"selectedLocationControlName\"\n type=\"radio\" [value]=\"flagsInstance\" [formControlName]=\"selectedLocationControlName\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-location-{{i}}\">\n <ng-container *ngIf=\"flagsInstance.flags.partyName\">\n {{flagsInstance.flags.partyName}}\n <ng-container *ngIf=\"flagsInstance.flags.roleOnCase\">\n ({{flagsInstance.flags.roleOnCase | rpxTranslate}})\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!flagsInstance.flags.partyName\">\n {{caseLevelFlagLabel | rpxTranslate}}\n </ng-container>\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>" }]
24206
24682
  }], null, { formGroup: [{
24207
24683
  type: Input
24208
24684
  }], flagsData: [{
@@ -24212,7 +24688,7 @@ class SelectFlagLocationComponent {
24212
24688
  }], caseFlagStateEmitter: [{
24213
24689
  type: Output
24214
24690
  }] }); })();
24215
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SelectFlagLocationComponent, { className: "SelectFlagLocationComponent", filePath: "lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.ts", lineNumber: 11 }); })();
24691
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SelectFlagLocationComponent, { className: "SelectFlagLocationComponent", filePath: "lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.ts", lineNumber: 12 }); })();
24216
24692
 
24217
24693
  const _c0$o = a0 => ({ "form-group-error": a0 });
24218
24694
  const _c1$8 = a0 => ({ "govuk-input--error": a0 });
@@ -24235,7 +24711,7 @@ function SelectFlagTypeComponent_ng_container_0_ng_template_6_Template(rf, ctx)
24235
24711
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(1, 1, ctx_r0.cachedFlagType, "name"), " ");
24236
24712
  } }
24237
24713
  function SelectFlagTypeComponent_ng_container_0_div_8_Template(rf, ctx) { if (rf & 1) {
24238
- i0.ɵɵelementStart(0, "div", 13)(1, "span", 14);
24714
+ i0.ɵɵelementStart(0, "div", 12)(1, "span", 13);
24239
24715
  i0.ɵɵtext(2);
24240
24716
  i0.ɵɵpipe(3, "rpxTranslate");
24241
24717
  i0.ɵɵelementEnd();
@@ -24250,9 +24726,9 @@ function SelectFlagTypeComponent_ng_container_0_div_8_Template(rf, ctx) { if (rf
24250
24726
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.flagTypeNotSelectedErrorMessage), " ");
24251
24727
  } }
24252
24728
  function SelectFlagTypeComponent_ng_container_0_div_10_Template(rf, ctx) { if (rf & 1) {
24253
- i0.ɵɵelementStart(0, "div", 15);
24254
- i0.ɵɵelement(1, "input", 16);
24255
- i0.ɵɵelementStart(2, "label", 17);
24729
+ i0.ɵɵelementStart(0, "div", 14);
24730
+ i0.ɵɵelement(1, "input", 15);
24731
+ i0.ɵɵelementStart(2, "label", 16);
24256
24732
  i0.ɵɵtext(3);
24257
24733
  i0.ɵɵpipe(4, "flagFieldDisplay");
24258
24734
  i0.ɵɵelementEnd()();
@@ -24269,7 +24745,7 @@ function SelectFlagTypeComponent_ng_container_0_div_10_Template(rf, ctx) { if (r
24269
24745
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(4, 8, flagType_r2, "name"), " ");
24270
24746
  } }
24271
24747
  function SelectFlagTypeComponent_ng_container_0_div_11_div_6_Template(rf, ctx) { if (rf & 1) {
24272
- i0.ɵɵelementStart(0, "div", 23)(1, "span", 14);
24748
+ i0.ɵɵelementStart(0, "div", 22)(1, "span", 13);
24273
24749
  i0.ɵɵtext(2);
24274
24750
  i0.ɵɵpipe(3, "rpxTranslate");
24275
24751
  i0.ɵɵelementEnd();
@@ -24284,9 +24760,9 @@ function SelectFlagTypeComponent_ng_container_0_div_11_div_6_Template(rf, ctx) {
24284
24760
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.flagTypeErrorMessage), " ");
24285
24761
  } }
24286
24762
  function SelectFlagTypeComponent_ng_container_0_div_11_div_8_Template(rf, ctx) { if (rf & 1) {
24287
- i0.ɵɵelementStart(0, "div", 24);
24288
- i0.ɵɵelement(1, "input", 25);
24289
- i0.ɵɵelementStart(2, "label", 26);
24763
+ i0.ɵɵelementStart(0, "div", 23);
24764
+ i0.ɵɵelement(1, "input", 24);
24765
+ i0.ɵɵelementStart(2, "label", 25);
24290
24766
  i0.ɵɵtext(3);
24291
24767
  i0.ɵɵpipe(4, "rpxTranslate");
24292
24768
  i0.ɵɵelementEnd()();
@@ -24298,14 +24774,14 @@ function SelectFlagTypeComponent_ng_container_0_div_11_div_8_Template(rf, ctx) {
24298
24774
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 3, "This flag should only be visible to HMCTS Staff"), " ");
24299
24775
  } }
24300
24776
  function SelectFlagTypeComponent_ng_container_0_div_11_Template(rf, ctx) { if (rf & 1) {
24301
- i0.ɵɵelementStart(0, "div", 18)(1, "div", 4)(2, "label", 19);
24777
+ i0.ɵɵelementStart(0, "div", 17)(1, "div", 3)(2, "label", 18);
24302
24778
  i0.ɵɵtext(3);
24303
24779
  i0.ɵɵpipe(4, "rpxTranslate");
24304
24780
  i0.ɵɵpipe(5, "rpxTranslate");
24305
24781
  i0.ɵɵelementEnd();
24306
- i0.ɵɵtemplate(6, SelectFlagTypeComponent_ng_container_0_div_11_div_6_Template, 6, 6, "div", 20);
24307
- i0.ɵɵelement(7, "input", 21);
24308
- i0.ɵɵtemplate(8, SelectFlagTypeComponent_ng_container_0_div_11_div_8_Template, 5, 5, "div", 22);
24782
+ i0.ɵɵtemplate(6, SelectFlagTypeComponent_ng_container_0_div_11_div_6_Template, 6, 6, "div", 19);
24783
+ i0.ɵɵelement(7, "input", 20);
24784
+ i0.ɵɵtemplate(8, SelectFlagTypeComponent_ng_container_0_div_11_div_8_Template, 5, 5, "div", 21);
24309
24785
  i0.ɵɵelementEnd()();
24310
24786
  } if (rf & 2) {
24311
24787
  const ctx_r0 = i0.ɵɵnextContext(2);
@@ -24321,13 +24797,13 @@ function SelectFlagTypeComponent_ng_container_0_div_11_Template(rf, ctx) { if (r
24321
24797
  i0.ɵɵproperty("ngIf", !ctx_r0.isDisplayContextParameterExternal && !ctx_r0.isCaseLevelFlag && ctx_r0.isDisplayContextParameter2Point1Enabled);
24322
24798
  } }
24323
24799
  function SelectFlagTypeComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
24324
- i0.ɵɵelementContainerStart(0, 3);
24325
- i0.ɵɵelementStart(1, "div", 4)(2, "fieldset", 5)(3, "legend", 6)(4, "h1", 7);
24326
- i0.ɵɵtemplate(5, SelectFlagTypeComponent_ng_container_0_ng_container_5_Template, 4, 5, "ng-container", 8)(6, SelectFlagTypeComponent_ng_container_0_ng_template_6_Template, 2, 4, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
24800
+ i0.ɵɵelementContainerStart(0, 2);
24801
+ i0.ɵɵelementStart(1, "div", 3)(2, "fieldset", 4)(3, "legend", 5)(4, "h1", 6);
24802
+ i0.ɵɵtemplate(5, SelectFlagTypeComponent_ng_container_0_ng_container_5_Template, 4, 5, "ng-container", 7)(6, SelectFlagTypeComponent_ng_container_0_ng_template_6_Template, 2, 4, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
24327
24803
  i0.ɵɵelementEnd()();
24328
- i0.ɵɵtemplate(8, SelectFlagTypeComponent_ng_container_0_div_8_Template, 6, 6, "div", 9);
24329
- i0.ɵɵelementStart(9, "div", 10);
24330
- i0.ɵɵtemplate(10, SelectFlagTypeComponent_ng_container_0_div_10_Template, 5, 11, "div", 11)(11, SelectFlagTypeComponent_ng_container_0_div_11_Template, 9, 15, "div", 12);
24804
+ i0.ɵɵtemplate(8, SelectFlagTypeComponent_ng_container_0_div_8_Template, 6, 6, "div", 8);
24805
+ i0.ɵɵelementStart(9, "div", 9);
24806
+ i0.ɵɵtemplate(10, SelectFlagTypeComponent_ng_container_0_div_10_Template, 5, 11, "div", 10)(11, SelectFlagTypeComponent_ng_container_0_div_11_Template, 9, 15, "div", 11);
24331
24807
  i0.ɵɵelementEnd()()();
24332
24808
  i0.ɵɵelementContainerEnd();
24333
24809
  } if (rf & 2) {
@@ -24337,7 +24813,7 @@ function SelectFlagTypeComponent_ng_container_0_Template(rf, ctx) { if (rf & 1)
24337
24813
  i0.ɵɵadvance();
24338
24814
  i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$o, ctx_r0.flagTypeNotSelectedErrorMessage.length > 0));
24339
24815
  i0.ɵɵadvance(4);
24340
- i0.ɵɵproperty("ngIf", !ctx_r0.cachedFlagType)("ngIfElse", priorFlagTypeSelected_r4);
24816
+ i0.ɵɵproperty("ngIf", !ctx_r0.cachedFlagType || ctx_r0.subJourneyIndex == 0)("ngIfElse", priorFlagTypeSelected_r4);
24341
24817
  i0.ɵɵadvance(3);
24342
24818
  i0.ɵɵproperty("ngIf", ctx_r0.flagTypeNotSelectedErrorMessage.length > 0);
24343
24819
  i0.ɵɵadvance(2);
@@ -24345,18 +24821,7 @@ function SelectFlagTypeComponent_ng_container_0_Template(rf, ctx) { if (rf & 1)
24345
24821
  i0.ɵɵadvance();
24346
24822
  i0.ɵɵproperty("ngIf", ctx_r0.otherFlagTypeSelected);
24347
24823
  } }
24348
- function SelectFlagTypeComponent_div_1_Template(rf, ctx) { if (rf & 1) {
24349
- const _r5 = i0.ɵɵgetCurrentView();
24350
- i0.ɵɵelementStart(0, "div", 27)(1, "button", 28);
24351
- i0.ɵɵlistener("click", function SelectFlagTypeComponent_div_1_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onNext()); });
24352
- i0.ɵɵtext(2);
24353
- i0.ɵɵpipe(3, "rpxTranslate");
24354
- i0.ɵɵelementEnd()();
24355
- } if (rf & 2) {
24356
- i0.ɵɵadvance(2);
24357
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 1, "Next"));
24358
- } }
24359
- class SelectFlagTypeComponent {
24824
+ class SelectFlagTypeComponent extends AbstractJourneyComponent {
24360
24825
  caseFlagRefdataService;
24361
24826
  formGroup;
24362
24827
  jurisdiction;
@@ -24378,6 +24843,8 @@ class SelectFlagTypeComponent {
24378
24843
  flagTypeControlChangesSubscription;
24379
24844
  caseFlagFormField = CaseFlagFormFields;
24380
24845
  isCaseLevelFlag = false;
24846
+ cachedRDFlagTypes;
24847
+ subJourneyIndex = 0;
24381
24848
  maxCharactersForOtherFlagType = 80;
24382
24849
  // Code for "Other" flag type as defined in Reference Data
24383
24850
  otherFlagTypeCode = 'OT0001';
@@ -24385,15 +24852,16 @@ class SelectFlagTypeComponent {
24385
24852
  get caseFlagWizardStepTitle() {
24386
24853
  return CaseFlagWizardStepTitle;
24387
24854
  }
24855
+ constructor(caseFlagRefdataService, pageStateService) {
24856
+ super(pageStateService);
24857
+ this.caseFlagRefdataService = caseFlagRefdataService;
24858
+ }
24388
24859
  get selectedFlagType() {
24389
24860
  return this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.value;
24390
24861
  }
24391
24862
  get otherFlagTypeSelected() {
24392
24863
  return this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.value?.flagCode === this.otherFlagTypeCode;
24393
24864
  }
24394
- constructor(caseFlagRefdataService) {
24395
- this.caseFlagRefdataService = caseFlagRefdataService;
24396
- }
24397
24865
  ngOnInit() {
24398
24866
  this.isCaseLevelFlag = this.selectedFlagsLocation?.flags?.flagsCaseFieldId === this.caseLevelCaseFlagsFieldId;
24399
24867
  this.flagTypes = [];
@@ -24404,7 +24872,7 @@ class SelectFlagTypeComponent {
24404
24872
  this.formGroup.addControl(CaseFlagFormFields.IS_VISIBLE_INTERNALLY_ONLY, new FormControl(false));
24405
24873
  // Should clear descriptionControlName if flagTypeControlName is changed
24406
24874
  this.flagTypeControlChangesSubscription = this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.valueChanges
24407
- .subscribe(_ => {
24875
+ .subscribe((_) => {
24408
24876
  this.formGroup.get(CaseFlagFormFields.OTHER_FLAG_DESCRIPTION)?.setValue('');
24409
24877
  this.cachedPath = [];
24410
24878
  // required to clear language interpreter
@@ -24418,8 +24886,8 @@ class SelectFlagTypeComponent {
24418
24886
  this.flagRefdata$ = this.caseFlagRefdataService
24419
24887
  .getCaseFlagsRefdata(this.hmctsServiceId, flagType, true, this.isDisplayContextParameterExternal)
24420
24888
  .subscribe({
24421
- next: flagTypes => this.processFlagTypes(flagTypes),
24422
- error: error => this.onRefdataError(error)
24889
+ next: (flagTypes) => this.processFlagTypes(flagTypes),
24890
+ error: (error) => this.onRefdataError(error)
24423
24891
  });
24424
24892
  }
24425
24893
  else {
@@ -24427,19 +24895,36 @@ class SelectFlagTypeComponent {
24427
24895
  this.flagRefdata$ = this.caseFlagRefdataService.getHmctsServiceDetailsByCaseType(this.caseTypeId)
24428
24896
  .pipe(
24429
24897
  // If an error occurs retrieving HMCTS service details by case type ID, try by service name instead
24430
- catchError(_ => this.caseFlagRefdataService.getHmctsServiceDetailsByServiceName(this.jurisdiction)),
24898
+ catchError((_) => this.caseFlagRefdataService.getHmctsServiceDetailsByServiceName(this.jurisdiction)),
24431
24899
  // Use switchMap to return an inner Observable of the flag types data, having received the service details
24432
24900
  // including service_code. This avoids having nested `subscribe`s, which is an anti-pattern!
24433
- switchMap(serviceDetails => this.caseFlagRefdataService.getCaseFlagsRefdata(serviceDetails[0].service_code, flagType, true, this.isDisplayContextParameterExternal)))
24901
+ switchMap((serviceDetails) => this.caseFlagRefdataService.getCaseFlagsRefdata(serviceDetails[0].service_code, flagType, true, this.isDisplayContextParameterExternal)))
24434
24902
  .subscribe({
24435
- next: flagTypes => this.processFlagTypes(flagTypes),
24436
- error: error => this.onRefdataError(error)
24903
+ next: (flagTypes) => this.processFlagTypes(flagTypes),
24904
+ error: (error) => this.onRefdataError(error)
24437
24905
  });
24438
24906
  }
24439
24907
  }
24440
24908
  ngOnDestroy() {
24441
24909
  this.flagRefdata$?.unsubscribe();
24442
24910
  this.flagTypeControlChangesSubscription?.unsubscribe();
24911
+ // check if the user has an existing path when navigating away from the page
24912
+ // if so we may need to ensure the values are set correctly.
24913
+ this.checkForExistingPath();
24914
+ }
24915
+ checkForExistingPath() {
24916
+ // Restore values from cachedPath
24917
+ if (this.subJourneyIndex <= 0) {
24918
+ // check if the user is navigating to the previous page in the jounrey.
24919
+ // in this situation we need to restore the full path for data retention across pages.
24920
+ if (this.cachedPath && this.cachedPath.length > 0) {
24921
+ this.cachedPath.forEach((flagType) => {
24922
+ if (flagType) {
24923
+ this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.setValue(flagType, { emitEvent: false });
24924
+ }
24925
+ });
24926
+ }
24927
+ }
24443
24928
  }
24444
24929
  onNext() {
24445
24930
  // Validate form
@@ -24461,10 +24946,40 @@ class SelectFlagTypeComponent {
24461
24946
  // when displaying the next set of child flags
24462
24947
  this.cachedFlagType = this.selectedFlagType;
24463
24948
  this.flagTypes = this.selectedFlagType.childFlags;
24464
- this.cachedPath?.shift();
24465
- this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.setValue(this.cachedPath?.length ? this.cachedPath[0] : null, { emitEvent: false });
24949
+ if (this.cachedPath.length !== 0 && this.cachedPath[this.subJourneyIndex] === this.selectedFlagType) {
24950
+ this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.setValue(this.cachedPath[this.subJourneyIndex + 1], { emitEvent: false });
24951
+ }
24952
+ else {
24953
+ this.cachedPath?.shift();
24954
+ const value = this.cachedPath?.length ? this.cachedPath[0] : null;
24955
+ this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.setValue(value, { emitEvent: false });
24956
+ }
24957
+ this.subJourneyIndex++;
24466
24958
  }
24467
24959
  }
24960
+ // Simplified version of the onPrevious method with optimized code
24961
+ onPrevious() {
24962
+ if (this.cachedFlagType) {
24963
+ if (this.cachedFlagType.Path.length === 1) {
24964
+ this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.setValue(this.cachedFlagType, { emitEvent: false });
24965
+ this.flagTypes = this.cachedRDFlagTypes[0].childFlags;
24966
+ }
24967
+ else {
24968
+ let currentPath = this.cachedRDFlagTypes[0];
24969
+ const pathToSearch = this.cachedFlagType.Path.slice(1);
24970
+ for (const pathElement of pathToSearch) {
24971
+ const foundFlag = currentPath.childFlags.find((flag) => flag.name === pathElement);
24972
+ if (foundFlag) {
24973
+ currentPath = foundFlag;
24974
+ }
24975
+ }
24976
+ this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.setValue(this.cachedFlagType, { emitEvent: false });
24977
+ this.flagTypes = currentPath.childFlags;
24978
+ this.cachedFlagType = currentPath;
24979
+ }
24980
+ }
24981
+ this.subJourneyIndex = Math.max(0, this.subJourneyIndex - 1);
24982
+ }
24468
24983
  // Identity function for trackBy use by *ngFor for flagTypes in HTML template
24469
24984
  identifyFlagType(_, flagType) {
24470
24985
  return `${flagType.flagCode}_${flagType.name}_${flagType.name_cy}`;
@@ -24502,18 +25017,33 @@ class SelectFlagTypeComponent {
24502
25017
  }
24503
25018
  }
24504
25019
  processFlagTypes(flagTypes) {
24505
- // First (and only) object in the returned array should be the top-level "Party" flag type
24506
- // The "Other" flag type should be removed from the top level if the user is external
24507
- this.flagTypes = flagTypes[0].childFlags.filter((flag) => this.isDisplayContextParameterExternal ? flag.flagCode !== this.otherFlagTypeCode : true);
25020
+ const prevJourneyPage = this.multipageComponentStateService.getJourneyCollection()[0];
25021
+ const { journeyPreviousPageNumber, journeyPageNumber } = prevJourneyPage;
25022
+ this.cachedRDFlagTypes = flagTypes;
25023
+ if (this.selectedFlagType && (journeyPreviousPageNumber > journeyPageNumber)) {
25024
+ const selectedFlagType = this.selectedFlagType;
25025
+ const pathToSearch = selectedFlagType.Path.slice(1);
25026
+ let currentPath = flagTypes[0];
25027
+ for (const pathElement of pathToSearch) {
25028
+ const foundFlag = currentPath.childFlags.find((flag) => flag.name === pathElement);
25029
+ if (foundFlag) {
25030
+ currentPath = foundFlag;
25031
+ }
25032
+ }
25033
+ this.flagTypes = currentPath.childFlags;
25034
+ this.cachedFlagType = currentPath;
25035
+ }
25036
+ else {
25037
+ this.flagTypes = flagTypes[0].childFlags.filter((flag) => this.isDisplayContextParameterExternal ? flag.flagCode !== this.otherFlagTypeCode : true);
25038
+ }
24508
25039
  const formControl = this.formGroup.get(CaseFlagFormFields.FLAG_TYPE);
24509
25040
  if (formControl?.value) {
24510
- // Cache Path based on existing flagCode -- needed for nested choices
24511
- const [foundFlagType, path] = FlagType.searchPathByFlagTypeObject(formControl.value, this.flagTypes);
24512
- this.cachedPath = [
24513
- ...path,
24514
- foundFlagType
24515
- ];
24516
- formControl.setValue(this.cachedPath[0], { emitEvent: false });
25041
+ const [foundFlagType, path] = FlagType.searchPathByFlagTypeObject(formControl.value, this.cachedRDFlagTypes[0].childFlags);
25042
+ this.cachedPath = [...path, foundFlagType];
25043
+ formControl.setValue((this.selectedFlagType && (journeyPreviousPageNumber > journeyPageNumber)) ? this.cachedPath[this.cachedPath.length - 1] : this.cachedPath[0], { emitEvent: false });
25044
+ if (this.cachedPath.length !== 0 && (journeyPreviousPageNumber > journeyPageNumber)) {
25045
+ this.subJourneyIndex = this.cachedPath.length - 1;
25046
+ }
24517
25047
  }
24518
25048
  }
24519
25049
  onRefdataError(error) {
@@ -24524,19 +25054,29 @@ class SelectFlagTypeComponent {
24524
25054
  // Return case flag field state and error messages to the parent
24525
25055
  this.caseFlagStateEmitter.emit({ currentCaseFlagFieldState: CaseFlagFieldState.FLAG_TYPE, errorMessages: this.errorMessages });
24526
25056
  }
24527
- static ɵfac = function SelectFlagTypeComponent_Factory(t) { return new (t || SelectFlagTypeComponent)(i0.ɵɵdirectiveInject(CaseFlagRefdataService)); };
24528
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SelectFlagTypeComponent, selectors: [["ccd-select-flag-type"]], inputs: { formGroup: "formGroup", jurisdiction: "jurisdiction", caseTypeId: "caseTypeId", hmctsServiceId: "hmctsServiceId", isDisplayContextParameterExternal: "isDisplayContextParameterExternal", isDisplayContextParameter2Point1Enabled: "isDisplayContextParameter2Point1Enabled", selectedFlagsLocation: "selectedFlagsLocation" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter", flagCommentsOptionalEmitter: "flagCommentsOptionalEmitter" }, decls: 2, vars: 2, consts: [["priorFlagTypeSelected", ""], [3, "formGroup", 4, "ngIf"], ["class", "govuk-button-group", 4, "ngIf"], [3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "flag-type-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "flag-type-heading", 1, "govuk-fieldset__heading", "govuk-!-margin-bottom-1"], [4, "ngIf", "ngIfElse"], ["id", "flag-type-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf", "ngForTrackBy"], ["class", "govuk-radios__conditional", "id", "conditional-flagType", 4, "ngIf"], ["id", "flag-type-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "conditional-flagType", 1, "govuk-radios__conditional"], ["for", "other-flag-type-description", 1, "govuk-label"], ["id", "flag-type-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "other-flag-type-description", "type", "text", 1, "govuk-input", "govuk-!-width-one-half", 3, "ngClass", "name", "formControlName"], ["class", "govuk-checkboxes__item govuk-!-margin-top-4", 4, "ngIf"], ["id", "flag-type-error-message", 1, "govuk-error-message"], [1, "govuk-checkboxes__item", "govuk-!-margin-top-4"], ["id", "is-visible-externally", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "name", "formControlName"], ["for", "is-visible-externally", 1, "govuk-label", "govuk-checkboxes__label"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"]], template: function SelectFlagTypeComponent_Template(rf, ctx) { if (rf & 1) {
24529
- i0.ɵɵtemplate(0, SelectFlagTypeComponent_ng_container_0_Template, 12, 10, "ng-container", 1)(1, SelectFlagTypeComponent_div_1_Template, 4, 3, "div", 2);
25057
+ next() {
25058
+ this.onNext();
25059
+ if (this.errorMessages.length === 0) {
25060
+ super.next();
25061
+ }
25062
+ }
25063
+ previous() {
25064
+ this.onPrevious();
25065
+ if (this.subJourneyIndex <= 0) {
25066
+ super.previous();
25067
+ }
25068
+ }
25069
+ static ɵfac = function SelectFlagTypeComponent_Factory(t) { return new (t || SelectFlagTypeComponent)(i0.ɵɵdirectiveInject(CaseFlagRefdataService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
25070
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SelectFlagTypeComponent, selectors: [["ccd-select-flag-type"]], inputs: { formGroup: "formGroup", jurisdiction: "jurisdiction", caseTypeId: "caseTypeId", hmctsServiceId: "hmctsServiceId", isDisplayContextParameterExternal: "isDisplayContextParameterExternal", isDisplayContextParameter2Point1Enabled: "isDisplayContextParameter2Point1Enabled", selectedFlagsLocation: "selectedFlagsLocation" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter", flagCommentsOptionalEmitter: "flagCommentsOptionalEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["priorFlagTypeSelected", ""], [3, "formGroup", 4, "ngIf"], [3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "flag-type-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "flag-type-heading", 1, "govuk-fieldset__heading", "govuk-!-margin-bottom-1"], [4, "ngIf", "ngIfElse"], ["id", "flag-type-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf", "ngForTrackBy"], ["class", "govuk-radios__conditional", "id", "conditional-flagType", 4, "ngIf"], ["id", "flag-type-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "conditional-flagType", 1, "govuk-radios__conditional"], ["for", "other-flag-type-description", 1, "govuk-label"], ["id", "flag-type-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "other-flag-type-description", "type", "text", 1, "govuk-input", "govuk-!-width-one-half", 3, "ngClass", "name", "formControlName"], ["class", "govuk-checkboxes__item govuk-!-margin-top-4", 4, "ngIf"], ["id", "flag-type-error-message", 1, "govuk-error-message"], [1, "govuk-checkboxes__item", "govuk-!-margin-top-4"], ["id", "is-visible-externally", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "name", "formControlName"], ["for", "is-visible-externally", 1, "govuk-label", "govuk-checkboxes__label"]], template: function SelectFlagTypeComponent_Template(rf, ctx) { if (rf & 1) {
25071
+ i0.ɵɵtemplate(0, SelectFlagTypeComponent_ng_container_0_Template, 12, 10, "ng-container", 1);
24530
25072
  } if (rf & 2) {
24531
25073
  i0.ɵɵproperty("ngIf", ctx.flagTypes == null ? null : ctx.flagTypes.length);
24532
- i0.ɵɵadvance();
24533
- i0.ɵɵproperty("ngIf", !ctx.refdataError);
24534
25074
  } }, styles: [".hidden[_ngcontent-%COMP%]{display:none}.validation-error[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:#d4351c}"] });
24535
25075
  }
24536
25076
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SelectFlagTypeComponent, [{
24537
25077
  type: Component,
24538
- args: [{ selector: 'ccd-select-flag-type', template: "<ng-container *ngIf=\"flagTypes?.length\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': flagTypeNotSelectedErrorMessage.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"flag-type-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"flag-type-heading\" class=\"govuk-fieldset__heading govuk-!-margin-bottom-1\">\n <ng-container *ngIf=\"!cachedFlagType; else priorFlagTypeSelected\">\n {{\n isDisplayContextParameterExternal\n ? (caseFlagWizardStepTitle.SELECT_CASE_FLAG_EXTERNAL | rpxTranslate)\n : (caseFlagWizardStepTitle.SELECT_CASE_FLAG | rpxTranslate)\n }}\n </ng-container>\n <ng-template #priorFlagTypeSelected>\n {{cachedFlagType | flagFieldDisplay:'name'}}\n </ng-template>\n </h1>\n </legend>\n <div id=\"flag-type-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"flagTypeNotSelectedErrorMessage.length > 0\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagTypeNotSelectedErrorMessage | rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagType of flagTypes; index as i; trackBy: identifyFlagType\">\n <input class=\"govuk-radios__input\" id=\"flag-type-{{i}}\" [name]=\"caseFlagFormField.FLAG_TYPE\"\n type=\"radio\" [value]=\"flagType\"\n [formControlName]=\"caseFlagFormField.FLAG_TYPE\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-type-{{i}}\">\n {{flagType | flagFieldDisplay:'name'}}\n </label>\n </div>\n <div class=\"govuk-radios__conditional\" *ngIf=\"otherFlagTypeSelected\" id=\"conditional-flagType\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': flagTypeErrorMessage.length > 0}\">\n <label class=\"govuk-label\" for=\"other-flag-type-description\">\n {{\n isDisplayContextParameterExternal\n ? (caseFlagWizardStepTitle.OTHER_FLAG_TYPE_DESCRIPTION_EXTERNAL | rpxTranslate)\n : (caseFlagWizardStepTitle.OTHER_FLAG_TYPE_DESCRIPTION | rpxTranslate)\n }}\n </label>\n <div id=\"flag-type-error-message\" class=\"govuk-error-message\" *ngIf=\"flagTypeErrorMessage.length > 0\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagTypeErrorMessage | rpxTranslate}}\n </div>\n <input class=\"govuk-input govuk-!-width-one-half\"\n [ngClass]=\"{'govuk-input--error': flagTypeErrorMessage.length > 0}\"\n id=\"other-flag-type-description\" [name]=\"caseFlagFormField.OTHER_FLAG_DESCRIPTION\" type=\"text\"\n [formControlName]=\"caseFlagFormField.OTHER_FLAG_DESCRIPTION\"/>\n <div class=\"govuk-checkboxes__item govuk-!-margin-top-4\"\n *ngIf=\"!isDisplayContextParameterExternal && !isCaseLevelFlag && isDisplayContextParameter2Point1Enabled\">\n <input class=\"govuk-checkboxes__input\" id=\"is-visible-externally\" type=\"checkbox\"\n [name]=\"caseFlagFormField.IS_VISIBLE_INTERNALLY_ONLY\" [formControlName]=\"caseFlagFormField.IS_VISIBLE_INTERNALLY_ONLY\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"is-visible-externally\">\n {{'This flag should only be visible to HMCTS Staff' | rpxTranslate}}\n </label>\n </div>\n </div>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\" *ngIf=\"!refdataError\">\n <button class=\"button button-primary\" type=\"button\" (click)=\"onNext()\">{{'Next' | rpxTranslate}}</button>\n</div>\n", styles: [".hidden{display:none}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
24539
- }], () => [{ type: CaseFlagRefdataService }], { formGroup: [{
25078
+ args: [{ selector: 'ccd-select-flag-type', template: "<ng-container *ngIf=\"flagTypes?.length\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': flagTypeNotSelectedErrorMessage.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"flag-type-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"flag-type-heading\" class=\"govuk-fieldset__heading govuk-!-margin-bottom-1\">\n <ng-container *ngIf=\"!cachedFlagType || subJourneyIndex == 0; else priorFlagTypeSelected\">\n {{\n isDisplayContextParameterExternal\n ? (caseFlagWizardStepTitle.SELECT_CASE_FLAG_EXTERNAL | rpxTranslate)\n : (caseFlagWizardStepTitle.SELECT_CASE_FLAG | rpxTranslate)\n }}\n </ng-container>\n <ng-template #priorFlagTypeSelected>\n {{cachedFlagType | flagFieldDisplay:'name'}}\n </ng-template>\n </h1>\n </legend>\n <div id=\"flag-type-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"flagTypeNotSelectedErrorMessage.length > 0\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagTypeNotSelectedErrorMessage |\n rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagType of flagTypes; index as i; trackBy: identifyFlagType\">\n <input class=\"govuk-radios__input\" id=\"flag-type-{{i}}\" [name]=\"caseFlagFormField.FLAG_TYPE\" type=\"radio\"\n [value]=\"flagType\" [formControlName]=\"caseFlagFormField.FLAG_TYPE\" />\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-type-{{i}}\">\n {{flagType | flagFieldDisplay:'name'}}\n </label>\n </div>\n <div class=\"govuk-radios__conditional\" *ngIf=\"otherFlagTypeSelected\" id=\"conditional-flagType\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': flagTypeErrorMessage.length > 0}\">\n <label class=\"govuk-label\" for=\"other-flag-type-description\">\n {{\n isDisplayContextParameterExternal\n ? (caseFlagWizardStepTitle.OTHER_FLAG_TYPE_DESCRIPTION_EXTERNAL | rpxTranslate)\n : (caseFlagWizardStepTitle.OTHER_FLAG_TYPE_DESCRIPTION | rpxTranslate)\n }}\n </label>\n <div id=\"flag-type-error-message\" class=\"govuk-error-message\" *ngIf=\"flagTypeErrorMessage.length > 0\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagTypeErrorMessage |\n rpxTranslate}}\n </div>\n <input class=\"govuk-input govuk-!-width-one-half\"\n [ngClass]=\"{'govuk-input--error': flagTypeErrorMessage.length > 0}\" id=\"other-flag-type-description\"\n [name]=\"caseFlagFormField.OTHER_FLAG_DESCRIPTION\" type=\"text\"\n [formControlName]=\"caseFlagFormField.OTHER_FLAG_DESCRIPTION\" />\n <div class=\"govuk-checkboxes__item govuk-!-margin-top-4\"\n *ngIf=\"!isDisplayContextParameterExternal && !isCaseLevelFlag && isDisplayContextParameter2Point1Enabled\">\n <input class=\"govuk-checkboxes__input\" id=\"is-visible-externally\" type=\"checkbox\"\n [name]=\"caseFlagFormField.IS_VISIBLE_INTERNALLY_ONLY\"\n [formControlName]=\"caseFlagFormField.IS_VISIBLE_INTERNALLY_ONLY\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"is-visible-externally\">\n {{'This flag should only be visible to HMCTS Staff' | rpxTranslate}}\n </label>\n </div>\n </div>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>", styles: [".hidden{display:none}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
25079
+ }], () => [{ type: CaseFlagRefdataService }, { type: MultipageComponentStateService }], { formGroup: [{
24540
25080
  type: Input
24541
25081
  }], jurisdiction: [{
24542
25082
  type: Input
@@ -24555,35 +25095,35 @@ class SelectFlagTypeComponent {
24555
25095
  }], flagCommentsOptionalEmitter: [{
24556
25096
  type: Output
24557
25097
  }] }); })();
24558
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SelectFlagTypeComponent, { className: "SelectFlagTypeComponent", filePath: "lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.ts", lineNumber: 18 }); })();
25098
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SelectFlagTypeComponent, { className: "SelectFlagTypeComponent", filePath: "lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.ts", lineNumber: 19 }); })();
24559
25099
 
24560
25100
  const _c0$n = a0 => ({ "form-group-error": a0 });
24561
25101
  const _c1$7 = a0 => ({ "govuk-tag--grey": a0 });
24562
25102
  function UpdateFlagComponent_div_7_Template(rf, ctx) { if (rf & 1) {
24563
- i0.ɵɵelementStart(0, "div", 17);
25103
+ i0.ɵɵelementStart(0, "div", 15);
24564
25104
  i0.ɵɵtext(1);
24565
25105
  i0.ɵɵpipe(2, "updateFlagTitleDisplay");
24566
25106
  i0.ɵɵelementEnd();
24567
25107
  } if (rf & 2) {
24568
- const ctx_r1 = i0.ɵɵnextContext();
25108
+ const ctx_r0 = i0.ɵɵnextContext();
24569
25109
  i0.ɵɵadvance();
24570
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, ctx_r1.selectedFlag == null ? null : ctx_r1.selectedFlag.flagDetailDisplay == null ? null : ctx_r1.selectedFlag.flagDetailDisplay.flagDetail), " ");
25110
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, ctx_r0.selectedFlag == null ? null : ctx_r0.selectedFlag.flagDetailDisplay == null ? null : ctx_r0.selectedFlag.flagDetailDisplay.flagDetail), " ");
24571
25111
  } }
24572
25112
  function UpdateFlagComponent_div_14_Template(rf, ctx) { if (rf & 1) {
24573
- i0.ɵɵelementStart(0, "div", 18);
25113
+ i0.ɵɵelementStart(0, "div", 16);
24574
25114
  i0.ɵɵtext(1);
24575
25115
  i0.ɵɵpipe(2, "rpxTranslate");
24576
25116
  i0.ɵɵelementEnd();
24577
25117
  } if (rf & 2) {
24578
- const ctx_r1 = i0.ɵɵnextContext();
25118
+ const ctx_r0 = i0.ɵɵnextContext();
24579
25119
  i0.ɵɵadvance();
24580
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, ctx_r1.updateFlagStepEnum.COMMENT_HINT_TEXT_EXTERNAL), " ");
25120
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, ctx_r0.updateFlagStepEnum.COMMENT_HINT_TEXT_EXTERNAL), " ");
24581
25121
  } }
24582
25122
  function UpdateFlagComponent_ng_container_15_div_5_Template(rf, ctx) { if (rf & 1) {
24583
- i0.ɵɵelementStart(0, "div", 25)(1, "span", 26);
25123
+ i0.ɵɵelementStart(0, "div", 23)(1, "span", 24);
24584
25124
  i0.ɵɵtext(2, "!");
24585
25125
  i0.ɵɵelementEnd();
24586
- i0.ɵɵelementStart(3, "strong", 27)(4, "span", 28);
25126
+ i0.ɵɵelementStart(3, "strong", 25)(4, "span", 26);
24587
25127
  i0.ɵɵtext(5);
24588
25128
  i0.ɵɵpipe(6, "rpxTranslate");
24589
25129
  i0.ɵɵelementEnd();
@@ -24591,14 +25131,14 @@ function UpdateFlagComponent_ng_container_15_div_5_Template(rf, ctx) { if (rf &
24591
25131
  i0.ɵɵpipe(8, "rpxTranslate");
24592
25132
  i0.ɵɵelementEnd()();
24593
25133
  } if (rf & 2) {
24594
- const ctx_r1 = i0.ɵɵnextContext(2);
25134
+ const ctx_r0 = i0.ɵɵnextContext(2);
24595
25135
  i0.ɵɵadvance(5);
24596
25136
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 2, "Warning"));
24597
25137
  i0.ɵɵadvance(2);
24598
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 4, ctx_r1.updateFlagStepEnum.WARNING_TEXT), " ");
25138
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 4, ctx_r0.updateFlagStepEnum.WARNING_TEXT), " ");
24599
25139
  } }
24600
25140
  function UpdateFlagComponent_ng_container_15_div_6_Template(rf, ctx) { if (rf & 1) {
24601
- i0.ɵɵelementStart(0, "div", 29)(1, "span", 30);
25141
+ i0.ɵɵelementStart(0, "div", 27)(1, "span", 28);
24602
25142
  i0.ɵɵtext(2);
24603
25143
  i0.ɵɵpipe(3, "rpxTranslate");
24604
25144
  i0.ɵɵelementEnd();
@@ -24606,14 +25146,14 @@ function UpdateFlagComponent_ng_container_15_div_6_Template(rf, ctx) { if (rf &
24606
25146
  i0.ɵɵpipe(5, "rpxTranslate");
24607
25147
  i0.ɵɵelementEnd();
24608
25148
  } if (rf & 2) {
24609
- const ctx_r1 = i0.ɵɵnextContext(2);
25149
+ const ctx_r0 = i0.ɵɵnextContext(2);
24610
25150
  i0.ɵɵadvance(2);
24611
25151
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "Error:"));
24612
25152
  i0.ɵɵadvance(2);
24613
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.commentsNotEnteredErrorMessage), " ");
25153
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.commentsNotEnteredErrorMessage), " ");
24614
25154
  } }
24615
25155
  function UpdateFlagComponent_ng_container_15_div_7_Template(rf, ctx) { if (rf & 1) {
24616
- i0.ɵɵelementStart(0, "div", 31)(1, "span", 30);
25156
+ i0.ɵɵelementStart(0, "div", 29)(1, "span", 28);
24617
25157
  i0.ɵɵtext(2);
24618
25158
  i0.ɵɵpipe(3, "rpxTranslate");
24619
25159
  i0.ɵɵelementEnd();
@@ -24621,64 +25161,64 @@ function UpdateFlagComponent_ng_container_15_div_7_Template(rf, ctx) { if (rf &
24621
25161
  i0.ɵɵpipe(5, "rpxTranslate");
24622
25162
  i0.ɵɵelementEnd();
24623
25163
  } if (rf & 2) {
24624
- const ctx_r1 = i0.ɵɵnextContext(2);
25164
+ const ctx_r0 = i0.ɵɵnextContext(2);
24625
25165
  i0.ɵɵadvance(2);
24626
25166
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "Error:"));
24627
25167
  i0.ɵɵadvance(2);
24628
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.commentsCharLimitErrorMessage), " ");
25168
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.commentsCharLimitErrorMessage), " ");
24629
25169
  } }
24630
25170
  function UpdateFlagComponent_ng_container_15_Template(rf, ctx) { if (rf & 1) {
24631
25171
  i0.ɵɵelementContainerStart(0);
24632
- i0.ɵɵelementStart(1, "div", 19);
25172
+ i0.ɵɵelementStart(1, "div", 17);
24633
25173
  i0.ɵɵtext(2);
24634
25174
  i0.ɵɵpipe(3, "rpxTranslate");
24635
25175
  i0.ɵɵpipe(4, "rpxTranslate");
24636
25176
  i0.ɵɵelementEnd();
24637
- i0.ɵɵtemplate(5, UpdateFlagComponent_ng_container_15_div_5_Template, 9, 6, "div", 20)(6, UpdateFlagComponent_ng_container_15_div_6_Template, 6, 6, "div", 21)(7, UpdateFlagComponent_ng_container_15_div_7_Template, 6, 6, "div", 22);
24638
- i0.ɵɵelementStart(8, "textarea", 23);
25177
+ i0.ɵɵtemplate(5, UpdateFlagComponent_ng_container_15_div_5_Template, 9, 6, "div", 18)(6, UpdateFlagComponent_ng_container_15_div_6_Template, 6, 6, "div", 19)(7, UpdateFlagComponent_ng_container_15_div_7_Template, 6, 6, "div", 20);
25178
+ i0.ɵɵelementStart(8, "textarea", 21);
24639
25179
  i0.ɵɵtext(9, " ");
24640
25180
  i0.ɵɵelementEnd();
24641
- i0.ɵɵelementStart(10, "div", 24);
25181
+ i0.ɵɵelementStart(10, "div", 22);
24642
25182
  i0.ɵɵtext(11);
24643
25183
  i0.ɵɵpipe(12, "rpxTranslate");
24644
25184
  i0.ɵɵelementEnd();
24645
25185
  i0.ɵɵelementContainerEnd();
24646
25186
  } if (rf & 2) {
24647
- const ctx_r1 = i0.ɵɵnextContext();
25187
+ const ctx_r0 = i0.ɵɵnextContext();
24648
25188
  i0.ɵɵadvance(2);
24649
- i0.ɵɵtextInterpolate1(" ", ctx_r1.internalUserUpdate ? i0.ɵɵpipeBind1(3, 8, ctx_r1.updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL) : i0.ɵɵpipeBind1(4, 10, ctx_r1.updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL_2_POINT_1), " ");
25189
+ i0.ɵɵtextInterpolate1(" ", ctx_r0.internalUserUpdate ? i0.ɵɵpipeBind1(3, 8, ctx_r0.updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL) : i0.ɵɵpipeBind1(4, 10, ctx_r0.updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL_2_POINT_1), " ");
24650
25190
  i0.ɵɵadvance(3);
24651
- i0.ɵɵproperty("ngIf", ctx_r1.internalUser2Point1EnabledUpdate && ctx_r1.externallyVisibleFlag);
25191
+ i0.ɵɵproperty("ngIf", ctx_r0.internalUser2Point1EnabledUpdate && ctx_r0.externallyVisibleFlag);
24652
25192
  i0.ɵɵadvance();
24653
- i0.ɵɵproperty("ngIf", ctx_r1.commentsNotEnteredErrorMessage);
25193
+ i0.ɵɵproperty("ngIf", ctx_r0.commentsNotEnteredErrorMessage);
24654
25194
  i0.ɵɵadvance();
24655
- i0.ɵɵproperty("ngIf", ctx_r1.commentsCharLimitErrorMessage);
25195
+ i0.ɵɵproperty("ngIf", ctx_r0.commentsCharLimitErrorMessage);
24656
25196
  i0.ɵɵadvance();
24657
- i0.ɵɵproperty("id", ctx_r1.caseFlagFormFields.COMMENTS)("name", ctx_r1.caseFlagFormFields.COMMENTS)("formControlName", ctx_r1.caseFlagFormFields.COMMENTS);
25197
+ i0.ɵɵproperty("id", ctx_r0.caseFlagFormFields.COMMENTS)("name", ctx_r0.caseFlagFormFields.COMMENTS)("formControlName", ctx_r0.caseFlagFormFields.COMMENTS);
24658
25198
  i0.ɵɵadvance(3);
24659
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(12, 12, ctx_r1.updateFlagStepEnum.CHARACTER_LIMIT_INFO), " ");
25199
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(12, 12, ctx_r0.updateFlagStepEnum.CHARACTER_LIMIT_INFO), " ");
24660
25200
  } }
24661
25201
  function UpdateFlagComponent_ng_template_16_ng_container_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
24662
25202
  i0.ɵɵelementContainer(0);
24663
25203
  } }
24664
25204
  function UpdateFlagComponent_ng_template_16_ng_container_0_Template(rf, ctx) { if (rf & 1) {
24665
25205
  i0.ɵɵelementContainerStart(0);
24666
- i0.ɵɵtemplate(1, UpdateFlagComponent_ng_template_16_ng_container_0_ng_container_1_Template, 1, 0, "ng-container", 33);
25206
+ i0.ɵɵtemplate(1, UpdateFlagComponent_ng_template_16_ng_container_0_ng_container_1_Template, 1, 0, "ng-container", 31);
24667
25207
  i0.ɵɵelementContainerEnd();
24668
25208
  } if (rf & 2) {
24669
25209
  i0.ɵɵnextContext(2);
24670
- const updateFlagStatusReason_r3 = i0.ɵɵreference(19);
25210
+ const updateFlagStatusReason_r2 = i0.ɵɵreference(19);
24671
25211
  i0.ɵɵadvance();
24672
- i0.ɵɵproperty("ngTemplateOutlet", updateFlagStatusReason_r3);
25212
+ i0.ɵɵproperty("ngTemplateOutlet", updateFlagStatusReason_r2);
24673
25213
  } }
24674
25214
  function UpdateFlagComponent_ng_template_16_Template(rf, ctx) { if (rf & 1) {
24675
- i0.ɵɵtemplate(0, UpdateFlagComponent_ng_template_16_ng_container_0_Template, 2, 1, "ng-container", 32);
25215
+ i0.ɵɵtemplate(0, UpdateFlagComponent_ng_template_16_ng_container_0_Template, 2, 1, "ng-container", 30);
24676
25216
  } if (rf & 2) {
24677
- const ctx_r1 = i0.ɵɵnextContext();
24678
- i0.ɵɵproperty("ngIf", ctx_r1.externalUserUpdate);
25217
+ const ctx_r0 = i0.ɵɵnextContext();
25218
+ i0.ɵɵproperty("ngIf", ctx_r0.externalUserUpdate);
24679
25219
  } }
24680
25220
  function UpdateFlagComponent_ng_template_18_div_0_Template(rf, ctx) { if (rf & 1) {
24681
- i0.ɵɵelementStart(0, "div", 38)(1, "span", 30);
25221
+ i0.ɵɵelementStart(0, "div", 36)(1, "span", 28);
24682
25222
  i0.ɵɵtext(2);
24683
25223
  i0.ɵɵpipe(3, "rpxTranslate");
24684
25224
  i0.ɵɵelementEnd();
@@ -24686,14 +25226,14 @@ function UpdateFlagComponent_ng_template_18_div_0_Template(rf, ctx) { if (rf & 1
24686
25226
  i0.ɵɵpipe(5, "rpxTranslate");
24687
25227
  i0.ɵɵelementEnd();
24688
25228
  } if (rf & 2) {
24689
- const ctx_r1 = i0.ɵɵnextContext(2);
25229
+ const ctx_r0 = i0.ɵɵnextContext(2);
24690
25230
  i0.ɵɵadvance(2);
24691
25231
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "Error:"));
24692
25232
  i0.ɵɵadvance(2);
24693
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.statusReasonNotEnteredErrorMessage), " ");
25233
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.statusReasonNotEnteredErrorMessage), " ");
24694
25234
  } }
24695
25235
  function UpdateFlagComponent_ng_template_18_div_1_Template(rf, ctx) { if (rf & 1) {
24696
- i0.ɵɵelementStart(0, "div", 39)(1, "span", 30);
25236
+ i0.ɵɵelementStart(0, "div", 37)(1, "span", 28);
24697
25237
  i0.ɵɵtext(2);
24698
25238
  i0.ɵɵpipe(3, "rpxTranslate");
24699
25239
  i0.ɵɵelementEnd();
@@ -24701,100 +25241,100 @@ function UpdateFlagComponent_ng_template_18_div_1_Template(rf, ctx) { if (rf & 1
24701
25241
  i0.ɵɵpipe(5, "rpxTranslate");
24702
25242
  i0.ɵɵelementEnd();
24703
25243
  } if (rf & 2) {
24704
- const ctx_r1 = i0.ɵɵnextContext(2);
25244
+ const ctx_r0 = i0.ɵɵnextContext(2);
24705
25245
  i0.ɵɵadvance(2);
24706
25246
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "Error:"));
24707
25247
  i0.ɵɵadvance(2);
24708
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.statusReasonCharLimitErrorMessage), " ");
25248
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.statusReasonCharLimitErrorMessage), " ");
24709
25249
  } }
24710
25250
  function UpdateFlagComponent_ng_template_18_Template(rf, ctx) { if (rf & 1) {
24711
- i0.ɵɵtemplate(0, UpdateFlagComponent_ng_template_18_div_0_Template, 6, 6, "div", 34)(1, UpdateFlagComponent_ng_template_18_div_1_Template, 6, 6, "div", 35);
24712
- i0.ɵɵelementStart(2, "textarea", 36);
25251
+ i0.ɵɵtemplate(0, UpdateFlagComponent_ng_template_18_div_0_Template, 6, 6, "div", 32)(1, UpdateFlagComponent_ng_template_18_div_1_Template, 6, 6, "div", 33);
25252
+ i0.ɵɵelementStart(2, "textarea", 34);
24713
25253
  i0.ɵɵtext(3, " ");
24714
25254
  i0.ɵɵelementEnd();
24715
- i0.ɵɵelementStart(4, "div", 37);
25255
+ i0.ɵɵelementStart(4, "div", 35);
24716
25256
  i0.ɵɵtext(5);
24717
25257
  i0.ɵɵpipe(6, "rpxTranslate");
24718
25258
  i0.ɵɵelementEnd();
24719
25259
  } if (rf & 2) {
24720
- const ctx_r1 = i0.ɵɵnextContext();
24721
- i0.ɵɵproperty("ngIf", ctx_r1.statusReasonNotEnteredErrorMessage);
25260
+ const ctx_r0 = i0.ɵɵnextContext();
25261
+ i0.ɵɵproperty("ngIf", ctx_r0.statusReasonNotEnteredErrorMessage);
24722
25262
  i0.ɵɵadvance();
24723
- i0.ɵɵproperty("ngIf", ctx_r1.statusReasonCharLimitErrorMessage);
25263
+ i0.ɵɵproperty("ngIf", ctx_r0.statusReasonCharLimitErrorMessage);
24724
25264
  i0.ɵɵadvance();
24725
- i0.ɵɵproperty("id", ctx_r1.caseFlagFormFields.STATUS_CHANGE_REASON)("name", ctx_r1.caseFlagFormFields.STATUS_CHANGE_REASON)("formControlName", ctx_r1.caseFlagFormFields.STATUS_CHANGE_REASON);
25265
+ i0.ɵɵproperty("id", ctx_r0.caseFlagFormFields.STATUS_CHANGE_REASON)("name", ctx_r0.caseFlagFormFields.STATUS_CHANGE_REASON)("formControlName", ctx_r0.caseFlagFormFields.STATUS_CHANGE_REASON);
24726
25266
  i0.ɵɵadvance(3);
24727
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 6, ctx_r1.updateFlagStepEnum.CHARACTER_LIMIT_INFO), " ");
25267
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 6, ctx_r0.updateFlagStepEnum.CHARACTER_LIMIT_INFO), " ");
24728
25268
  } }
24729
25269
  function UpdateFlagComponent_div_20_div_8_Template(rf, ctx) { if (rf & 1) {
24730
- i0.ɵɵelementStart(0, "div", 47);
24731
- i0.ɵɵelement(1, "input", 48);
24732
- i0.ɵɵelementStart(2, "label", 49);
25270
+ i0.ɵɵelementStart(0, "div", 45);
25271
+ i0.ɵɵelement(1, "input", 46);
25272
+ i0.ɵɵelementStart(2, "label", 47);
24733
25273
  i0.ɵɵtext(3);
24734
25274
  i0.ɵɵpipe(4, "rpxTranslate");
24735
25275
  i0.ɵɵelementEnd()();
24736
25276
  } if (rf & 2) {
24737
- const status_r4 = ctx.$implicit;
24738
- const ctx_r1 = i0.ɵɵnextContext(2);
25277
+ const status_r3 = ctx.$implicit;
25278
+ const ctx_r0 = i0.ɵɵnextContext(2);
24739
25279
  i0.ɵɵadvance();
24740
- i0.ɵɵproperty("id", ctx_r1.caseFlagFormFields.STATUS + "_" + status_r4)("name", ctx_r1.caseFlagFormFields.STATUS)("formControlName", ctx_r1.caseFlagFormFields.STATUS)("value", status_r4);
25280
+ i0.ɵɵproperty("id", ctx_r0.caseFlagFormFields.STATUS + "_" + status_r3)("name", ctx_r0.caseFlagFormFields.STATUS)("formControlName", ctx_r0.caseFlagFormFields.STATUS)("value", status_r3);
24741
25281
  i0.ɵɵadvance();
24742
- i0.ɵɵproperty("for", ctx_r1.caseFlagFormFields.STATUS + "_" + status_r4);
25282
+ i0.ɵɵproperty("for", ctx_r0.caseFlagFormFields.STATUS + "_" + status_r3);
24743
25283
  i0.ɵɵadvance();
24744
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 6, ctx_r1.caseFlagStatusEnum[status_r4]), " ");
25284
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 6, ctx_r0.caseFlagStatusEnum[status_r3]), " ");
24745
25285
  } }
24746
25286
  function UpdateFlagComponent_div_20_ng_container_12_Template(rf, ctx) { if (rf & 1) {
24747
25287
  i0.ɵɵelementContainer(0);
24748
25288
  } }
24749
25289
  function UpdateFlagComponent_div_20_Template(rf, ctx) { if (rf & 1) {
24750
- i0.ɵɵelementStart(0, "div", 40)(1, "fieldset", 41)(2, "legend", 42)(3, "h1", 43);
25290
+ i0.ɵɵelementStart(0, "div", 38)(1, "fieldset", 39)(2, "legend", 40)(3, "h1", 41);
24751
25291
  i0.ɵɵtext(4);
24752
25292
  i0.ɵɵpipe(5, "rpxTranslate");
24753
25293
  i0.ɵɵpipe(6, "rpxTranslate");
24754
25294
  i0.ɵɵelementEnd()();
24755
- i0.ɵɵelementStart(7, "div", 44);
24756
- i0.ɵɵtemplate(8, UpdateFlagComponent_div_20_div_8_Template, 5, 8, "div", 45);
25295
+ i0.ɵɵelementStart(7, "div", 42);
25296
+ i0.ɵɵtemplate(8, UpdateFlagComponent_div_20_div_8_Template, 5, 8, "div", 43);
24757
25297
  i0.ɵɵelementEnd()();
24758
- i0.ɵɵelementStart(9, "div", 46);
25298
+ i0.ɵɵelementStart(9, "div", 44);
24759
25299
  i0.ɵɵtext(10);
24760
25300
  i0.ɵɵpipe(11, "rpxTranslate");
24761
25301
  i0.ɵɵelementEnd();
24762
- i0.ɵɵtemplate(12, UpdateFlagComponent_div_20_ng_container_12_Template, 1, 0, "ng-container", 33);
25302
+ i0.ɵɵtemplate(12, UpdateFlagComponent_div_20_ng_container_12_Template, 1, 0, "ng-container", 31);
24763
25303
  i0.ɵɵelementEnd();
24764
25304
  } if (rf & 2) {
24765
- const ctx_r1 = i0.ɵɵnextContext();
24766
- const updateFlagStatusReason_r3 = i0.ɵɵreference(19);
25305
+ const ctx_r0 = i0.ɵɵnextContext();
25306
+ const updateFlagStatusReason_r2 = i0.ɵɵreference(19);
24767
25307
  i0.ɵɵadvance(4);
24768
- i0.ɵɵtextInterpolate2(" ", i0.ɵɵpipeBind1(5, 6, ctx_r1.updateFlagTitle), " ", i0.ɵɵpipeBind1(6, 8, "status"), " ");
25308
+ i0.ɵɵtextInterpolate2(" ", i0.ɵɵpipeBind1(5, 6, ctx_r0.updateFlagTitle), " ", i0.ɵɵpipeBind1(6, 8, "status"), " ");
24769
25309
  i0.ɵɵadvance(3);
24770
- i0.ɵɵproperty("id", ctx_r1.caseFlagFormFields.STATUS);
25310
+ i0.ɵɵproperty("id", ctx_r0.caseFlagFormFields.STATUS);
24771
25311
  i0.ɵɵadvance();
24772
- i0.ɵɵproperty("ngForOf", ctx_r1.validStatusProgressions);
25312
+ i0.ɵɵproperty("ngForOf", ctx_r0.validStatusProgressions);
24773
25313
  i0.ɵɵadvance(2);
24774
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(11, 10, ctx_r1.updateFlagStepEnum.STATUS_HINT_TEXT), " ");
25314
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(11, 10, ctx_r0.updateFlagStepEnum.STATUS_HINT_TEXT), " ");
24775
25315
  i0.ɵɵadvance(2);
24776
- i0.ɵɵproperty("ngTemplateOutlet", updateFlagStatusReason_r3);
25316
+ i0.ɵɵproperty("ngTemplateOutlet", updateFlagStatusReason_r2);
24777
25317
  } }
24778
25318
  function UpdateFlagComponent_div_21_Template(rf, ctx) { if (rf & 1) {
24779
- i0.ɵɵelementStart(0, "div", 50)(1, "div", 51)(2, "div", 52);
24780
- i0.ɵɵelement(3, "input", 53);
24781
- i0.ɵɵelementStart(4, "label", 54);
25319
+ i0.ɵɵelementStart(0, "div", 48)(1, "div", 49)(2, "div", 50);
25320
+ i0.ɵɵelement(3, "input", 51);
25321
+ i0.ɵɵelementStart(4, "label", 52);
24782
25322
  i0.ɵɵtext(5);
24783
25323
  i0.ɵɵpipe(6, "rpxTranslate");
24784
25324
  i0.ɵɵelementEnd()()()();
24785
25325
  } if (rf & 2) {
24786
- const ctx_r1 = i0.ɵɵnextContext();
25326
+ const ctx_r0 = i0.ɵɵnextContext();
24787
25327
  i0.ɵɵadvance(3);
24788
- i0.ɵɵproperty("formControlName", ctx_r1.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED)("id", ctx_r1.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED)("name", ctx_r1.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED);
25328
+ i0.ɵɵproperty("formControlName", ctx_r0.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED)("id", ctx_r0.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED)("name", ctx_r0.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED);
24789
25329
  i0.ɵɵadvance();
24790
- i0.ɵɵproperty("for", ctx_r1.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED);
25330
+ i0.ɵɵproperty("for", ctx_r0.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED);
24791
25331
  i0.ɵɵadvance();
24792
25332
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 5, "I need to add a translation"), " ");
24793
25333
  } }
24794
25334
  function UpdateFlagComponent_div_22_button_10_Template(rf, ctx) { if (rf & 1) {
24795
- const _r5 = i0.ɵɵgetCurrentView();
24796
- i0.ɵɵelementStart(0, "button", 59);
24797
- i0.ɵɵlistener("click", function UpdateFlagComponent_div_22_button_10_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onMakeInactive()); });
25335
+ const _r4 = i0.ɵɵgetCurrentView();
25336
+ i0.ɵɵelementStart(0, "button", 57);
25337
+ i0.ɵɵlistener("click", function UpdateFlagComponent_div_22_button_10_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onMakeInactive()); });
24798
25338
  i0.ɵɵtext(1);
24799
25339
  i0.ɵɵpipe(2, "rpxTranslate");
24800
25340
  i0.ɵɵelementEnd();
@@ -24803,28 +25343,28 @@ function UpdateFlagComponent_div_22_button_10_Template(rf, ctx) { if (rf & 1) {
24803
25343
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, "Make inactive"), " ");
24804
25344
  } }
24805
25345
  function UpdateFlagComponent_div_22_Template(rf, ctx) { if (rf & 1) {
24806
- i0.ɵɵelementStart(0, "div", 55)(1, "div", 56)(2, "p");
25346
+ i0.ɵɵelementStart(0, "div", 53)(1, "div", 54)(2, "p");
24807
25347
  i0.ɵɵtext(3);
24808
25348
  i0.ɵɵpipe(4, "rpxTranslate");
24809
- i0.ɵɵelementStart(5, "span")(6, "strong", 57);
25349
+ i0.ɵɵelementStart(5, "span")(6, "strong", 55);
24810
25350
  i0.ɵɵtext(7);
24811
25351
  i0.ɵɵpipe(8, "rpxTranslate");
24812
25352
  i0.ɵɵelementEnd()()()();
24813
- i0.ɵɵelementStart(9, "div", 56);
24814
- i0.ɵɵtemplate(10, UpdateFlagComponent_div_22_button_10_Template, 3, 3, "button", 58);
25353
+ i0.ɵɵelementStart(9, "div", 54);
25354
+ i0.ɵɵtemplate(10, UpdateFlagComponent_div_22_button_10_Template, 3, 3, "button", 56);
24815
25355
  i0.ɵɵelementEnd()();
24816
25356
  } if (rf & 2) {
24817
- const ctx_r1 = i0.ɵɵnextContext();
25357
+ const ctx_r0 = i0.ɵɵnextContext();
24818
25358
  i0.ɵɵadvance(3);
24819
25359
  i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(4, 4, "Flag status:"), " ");
24820
25360
  i0.ɵɵadvance(3);
24821
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c1$7, ctx_r1.selectedFlag.flagDetailDisplay.flagDetail.status === "Inactive"));
25361
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c1$7, ctx_r0.selectedFlag.flagDetailDisplay.flagDetail.status === "Inactive"));
24822
25362
  i0.ɵɵadvance();
24823
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 6, ctx_r1.selectedFlag == null ? null : ctx_r1.selectedFlag.flagDetailDisplay == null ? null : ctx_r1.selectedFlag.flagDetailDisplay.flagDetail == null ? null : ctx_r1.selectedFlag.flagDetailDisplay.flagDetail.status), " ");
25363
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 6, ctx_r0.selectedFlag == null ? null : ctx_r0.selectedFlag.flagDetailDisplay == null ? null : ctx_r0.selectedFlag.flagDetailDisplay.flagDetail == null ? null : ctx_r0.selectedFlag.flagDetailDisplay.flagDetail.status), " ");
24824
25364
  i0.ɵɵadvance(3);
24825
- i0.ɵɵproperty("ngIf", ctx_r1.selectedFlag.flagDetailDisplay.flagDetail.status === "Active");
25365
+ i0.ɵɵproperty("ngIf", ctx_r0.selectedFlag.flagDetailDisplay.flagDetail.status === "Active");
24826
25366
  } }
24827
- class UpdateFlagComponent {
25367
+ class UpdateFlagComponent extends AbstractJourneyComponent {
24828
25368
  rpxTranslationService;
24829
25369
  formGroup;
24830
25370
  displayContextParameter;
@@ -24850,7 +25390,8 @@ class UpdateFlagComponent {
24850
25390
  get externallyVisibleFlag() {
24851
25391
  return this.selectedFlag.flagDetailDisplay.visibility?.toLowerCase() === 'external';
24852
25392
  }
24853
- constructor(rpxTranslationService) {
25393
+ constructor(rpxTranslationService, multipageComponentStateService) {
25394
+ super(multipageComponentStateService);
24854
25395
  this.rpxTranslationService = rpxTranslationService;
24855
25396
  }
24856
25397
  ngOnInit() {
@@ -24997,9 +25538,14 @@ class UpdateFlagComponent {
24997
25538
  });
24998
25539
  }
24999
25540
  }
25000
- static ɵfac = function UpdateFlagComponent_Factory(t) { return new (t || UpdateFlagComponent)(i0.ɵɵdirectiveInject(i1.RpxTranslationService)); };
25001
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UpdateFlagComponent, selectors: [["ccd-update-flag"]], inputs: { formGroup: "formGroup", displayContextParameter: "displayContextParameter" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 27, vars: 25, consts: [["externalUser", ""], ["updateFlagStatusReason", ""], [3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper", "govuk-!-margin-bottom-4"], [1, "govuk-label", "govuk-label--m"], ["id", "update-flag-hint-external", "class", "govuk-hint", 4, "ngIf"], [1, "govuk-!-margin-bottom-4"], [1, "govuk-label", "govuk-label--s", 3, "for"], ["id", "update-flag-comments-hint-external", "class", "govuk-hint", 4, "ngIf"], [4, "ngIf", "ngIfElse"], ["id", "flag-status-container-v2_1", "class", "govuk-!-margin-bottom-4", 4, "ngIf"], ["id", "translation-checkbox-container", "class", "govuk-!-margin-bottom-6", 4, "ngIf"], ["id", "flag-status-container-v1", "class", "govuk-grid-row", 4, "ngIf"], [1, "govuk-button-group"], ["id", "updateFlagNextButton", "type", "button", 1, "govuk-button", 3, "click"], ["id", "update-flag-hint-external", 1, "govuk-hint"], ["id", "update-flag-comments-hint-external", 1, "govuk-hint"], ["id", "update-flag-comments-hint", 1, "govuk-hint"], ["class", "govuk-warning-text", 4, "ngIf"], ["id", "update-flag-comments-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "update-flag-comments-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "update-flag-comments-hint update-flag-comments-char-limit-info update-flag-comments-char-limit-error", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "update-flag-comments-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-warning-text__assistive"], ["id", "update-flag-comments-not-entered-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "update-flag-comments-char-limit-error", 1, "govuk-error-message"], [4, "ngIf"], [4, "ngTemplateOutlet"], ["id", "update-flag-status-reason-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "update-flag-status-reason-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "update-flag-comments-hint-external update-flag-status-hint update-flag-status-reason-char-limit-info\n update-flag-status-reason-char-limit-error", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "update-flag-status-reason-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "update-flag-status-reason-not-entered-error-message", 1, "govuk-error-message"], ["id", "update-flag-status-reason-char-limit-error", 1, "govuk-error-message"], ["id", "flag-status-container-v2_1", 1, "govuk-!-margin-bottom-4"], ["aria-describedby", "update-flag-status-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--s"], ["id", "update-flag-status-heading", 1, "govuk-fieldset__heading"], ["data-module", "govuk-radios", 1, "govuk-radios", "govuk-radios--conditional", "govuk-!-margin-bottom-4", 3, "id"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "update-flag-status-hint", 1, "govuk-hint"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "formControlName", "value"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "translation-checkbox-container", 1, "govuk-!-margin-bottom-6"], ["data-module", "govuk-checkboxes", 1, "govuk-checkboxes"], [1, "govuk-checkboxes__item"], ["type", "checkbox", 1, "govuk-checkboxes__input", 3, "formControlName", "id", "name"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"], ["id", "flag-status-container-v1", 1, "govuk-grid-row"], [1, "govuk-grid-column-one-half"], [1, "govuk-tag", 3, "ngClass"], ["class", "button button-secondary", "type", "button", 3, "click", 4, "ngIf"], ["type", "button", 1, "button", "button-secondary", 3, "click"]], template: function UpdateFlagComponent_Template(rf, ctx) { if (rf & 1) {
25002
- const _r1 = i0.ɵɵgetCurrentView();
25541
+ next() {
25542
+ this.onNext();
25543
+ if (this.errorMessages.length === 0) {
25544
+ super.next();
25545
+ }
25546
+ }
25547
+ static ɵfac = function UpdateFlagComponent_Factory(t) { return new (t || UpdateFlagComponent)(i0.ɵɵdirectiveInject(i1.RpxTranslationService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
25548
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UpdateFlagComponent, selectors: [["ccd-update-flag"]], inputs: { formGroup: "formGroup", displayContextParameter: "displayContextParameter" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 23, vars: 22, consts: [["externalUser", ""], ["updateFlagStatusReason", ""], [3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper", "govuk-!-margin-bottom-4"], [1, "govuk-label", "govuk-label--m"], ["id", "update-flag-hint-external", "class", "govuk-hint", 4, "ngIf"], [1, "govuk-!-margin-bottom-4"], [1, "govuk-label", "govuk-label--s", 3, "for"], ["id", "update-flag-comments-hint-external", "class", "govuk-hint", 4, "ngIf"], [4, "ngIf", "ngIfElse"], ["id", "flag-status-container-v2_1", "class", "govuk-!-margin-bottom-4", 4, "ngIf"], ["id", "translation-checkbox-container", "class", "govuk-!-margin-bottom-6", 4, "ngIf"], ["id", "flag-status-container-v1", "class", "govuk-grid-row", 4, "ngIf"], ["id", "update-flag-hint-external", 1, "govuk-hint"], ["id", "update-flag-comments-hint-external", 1, "govuk-hint"], ["id", "update-flag-comments-hint", 1, "govuk-hint"], ["class", "govuk-warning-text", 4, "ngIf"], ["id", "update-flag-comments-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "update-flag-comments-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "update-flag-comments-hint update-flag-comments-char-limit-info update-flag-comments-char-limit-error", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "update-flag-comments-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-warning-text__assistive"], ["id", "update-flag-comments-not-entered-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "update-flag-comments-char-limit-error", 1, "govuk-error-message"], [4, "ngIf"], [4, "ngTemplateOutlet"], ["id", "update-flag-status-reason-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "update-flag-status-reason-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "update-flag-comments-hint-external update-flag-status-hint update-flag-status-reason-char-limit-info\n update-flag-status-reason-char-limit-error", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "update-flag-status-reason-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "update-flag-status-reason-not-entered-error-message", 1, "govuk-error-message"], ["id", "update-flag-status-reason-char-limit-error", 1, "govuk-error-message"], ["id", "flag-status-container-v2_1", 1, "govuk-!-margin-bottom-4"], ["aria-describedby", "update-flag-status-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--s"], ["id", "update-flag-status-heading", 1, "govuk-fieldset__heading"], ["data-module", "govuk-radios", 1, "govuk-radios", "govuk-radios--conditional", "govuk-!-margin-bottom-4", 3, "id"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "update-flag-status-hint", 1, "govuk-hint"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "formControlName", "value"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "translation-checkbox-container", 1, "govuk-!-margin-bottom-6"], ["data-module", "govuk-checkboxes", 1, "govuk-checkboxes"], [1, "govuk-checkboxes__item"], ["type", "checkbox", 1, "govuk-checkboxes__input", 3, "formControlName", "id", "name"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"], ["id", "flag-status-container-v1", 1, "govuk-grid-row"], [1, "govuk-grid-column-one-half"], [1, "govuk-tag", 3, "ngClass"], ["class", "button button-secondary", "type", "button", 3, "click", 4, "ngIf"], ["type", "button", 1, "button", "button-secondary", 3, "click"]], template: function UpdateFlagComponent_Template(rf, ctx) { if (rf & 1) {
25003
25549
  i0.ɵɵelementContainerStart(0, 2);
25004
25550
  i0.ɵɵelementStart(1, "div", 3)(2, "div", 4)(3, "h1", 5)(4, "label", 6);
25005
25551
  i0.ɵɵtext(5);
@@ -25017,53 +25563,46 @@ class UpdateFlagComponent {
25017
25563
  i0.ɵɵtemplate(18, UpdateFlagComponent_ng_template_18_Template, 7, 8, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor)(20, UpdateFlagComponent_div_20_Template, 13, 12, "div", 12)(21, UpdateFlagComponent_div_21_Template, 7, 7, "div", 13)(22, UpdateFlagComponent_div_22_Template, 11, 10, "div", 14);
25018
25564
  i0.ɵɵelementEnd()();
25019
25565
  i0.ɵɵelementContainerEnd();
25020
- i0.ɵɵelementStart(23, "div", 15)(24, "button", 16);
25021
- i0.ɵɵlistener("click", function UpdateFlagComponent_Template_button_click_24_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onNext()); });
25022
- i0.ɵɵtext(25);
25023
- i0.ɵɵpipe(26, "rpxTranslate");
25024
- i0.ɵɵelementEnd()();
25025
25566
  } if (rf & 2) {
25026
- const externalUser_r6 = i0.ɵɵreference(17);
25567
+ const externalUser_r5 = i0.ɵɵreference(17);
25027
25568
  i0.ɵɵproperty("formGroup", ctx.formGroup);
25028
25569
  i0.ɵɵadvance(2);
25029
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(23, _c0$n, ctx.errorMessages.length > 0));
25570
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(20, _c0$n, ctx.errorMessages.length > 0));
25030
25571
  i0.ɵɵadvance(3);
25031
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 13, ctx.updateFlagTitle), " ");
25572
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 12, ctx.updateFlagTitle), " ");
25032
25573
  i0.ɵɵadvance(2);
25033
25574
  i0.ɵɵproperty("ngIf", ctx.externalUserUpdate);
25034
25575
  i0.ɵɵadvance(2);
25035
25576
  i0.ɵɵproperty("for", ctx.caseFlagFormFields.COMMENTS);
25036
25577
  i0.ɵɵadvance();
25037
- i0.ɵɵtextInterpolate1(" ", ctx.externalUserUpdate ? i0.ɵɵpipeBind1(11, 15, ctx.updateFlagStepEnum.COMMENT_FIELD_LABEL_EXTERNAL) : i0.ɵɵpipeBind1(12, 17, ctx.updateFlagTitle) + i0.ɵɵpipeBind1(13, 19, " comments"), " ");
25578
+ i0.ɵɵtextInterpolate1(" ", ctx.externalUserUpdate ? i0.ɵɵpipeBind1(11, 14, ctx.updateFlagStepEnum.COMMENT_FIELD_LABEL_EXTERNAL) : i0.ɵɵpipeBind1(12, 16, ctx.updateFlagTitle) + i0.ɵɵpipeBind1(13, 18, " comments"), " ");
25038
25579
  i0.ɵɵadvance(4);
25039
25580
  i0.ɵɵproperty("ngIf", ctx.externalUserUpdate);
25040
25581
  i0.ɵɵadvance();
25041
- i0.ɵɵproperty("ngIf", ctx.internalUserUpdate || ctx.internalUser2Point1EnabledUpdate || ctx.displayContextParameter === "")("ngIfElse", externalUser_r6);
25582
+ i0.ɵɵproperty("ngIf", ctx.internalUserUpdate || ctx.internalUser2Point1EnabledUpdate || ctx.displayContextParameter === "")("ngIfElse", externalUser_r5);
25042
25583
  i0.ɵɵadvance(5);
25043
25584
  i0.ɵɵproperty("ngIf", ctx.internalUser2Point1EnabledUpdate);
25044
25585
  i0.ɵɵadvance();
25045
25586
  i0.ɵɵproperty("ngIf", ctx.internalUser2Point1EnabledUpdate);
25046
25587
  i0.ɵɵadvance();
25047
25588
  i0.ɵɵproperty("ngIf", ctx.internalUserUpdate);
25048
- i0.ɵɵadvance(3);
25049
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(26, 21, "Next"), " ");
25050
25589
  } }, encapsulation: 2 });
25051
25590
  }
25052
25591
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UpdateFlagComponent, [{
25053
25592
  type: Component,
25054
- args: [{ selector: 'ccd-update-flag', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <h1 class=\"govuk-label-wrapper govuk-!-margin-bottom-4\">\n <label class=\"govuk-label govuk-label--m\">\n {{updateFlagTitle | rpxTranslate}}\n </label>\n </h1>\n <div id=\"update-flag-hint-external\" class=\"govuk-hint\" *ngIf=\"externalUserUpdate\">\n {{selectedFlag?.flagDetailDisplay?.flagDetail | updateFlagTitleDisplay}}\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label class=\"govuk-label govuk-label--s\" [for]=\"caseFlagFormFields.COMMENTS\">\n {{\n externalUserUpdate\n ? (updateFlagStepEnum.COMMENT_FIELD_LABEL_EXTERNAL | rpxTranslate)\n : (updateFlagTitle | rpxTranslate) + (' comments' | rpxTranslate)\n }}\n </label>\n <div id=\"update-flag-comments-hint-external\" class=\"govuk-hint\" *ngIf=\"externalUserUpdate\">\n {{updateFlagStepEnum.COMMENT_HINT_TEXT_EXTERNAL | rpxTranslate}}\n </div>\n <ng-container *ngIf=\"internalUserUpdate || internalUser2Point1EnabledUpdate || displayContextParameter === '';\n else externalUser\">\n <div id=\"update-flag-comments-hint\" class=\"govuk-hint\">\n {{\n internalUserUpdate\n ? (updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL | rpxTranslate)\n : (updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL_2_POINT_1 | rpxTranslate)\n }}\n </div>\n <div class=\"govuk-warning-text\" *ngIf=\"internalUser2Point1EnabledUpdate && externallyVisibleFlag\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">{{'Warning' | rpxTranslate}}</span>\n {{updateFlagStepEnum.WARNING_TEXT | rpxTranslate}}\n </strong>\n </div>\n <div id=\"update-flag-comments-not-entered-error-message\" class=\"govuk-error-message\" *ngIf=\"commentsNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{commentsNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"update-flag-comments-char-limit-error\" class=\"govuk-error-message\" *ngIf=\"commentsCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{commentsCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\"\n [id]=\"caseFlagFormFields.COMMENTS\"\n [name]=\"caseFlagFormFields.COMMENTS\"\n [formControlName]=\"caseFlagFormFields.COMMENTS\"\n rows=\"5\"\n aria-describedby=\"update-flag-comments-hint update-flag-comments-char-limit-info update-flag-comments-char-limit-error\">\n </textarea>\n <div id=\"update-flag-comments-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </ng-container>\n <ng-template #externalUser>\n <ng-container *ngIf=\"externalUserUpdate\">\n <ng-container *ngTemplateOutlet=\"updateFlagStatusReason\"></ng-container>\n </ng-container>\n </ng-template>\n </div>\n\n <ng-template #updateFlagStatusReason>\n <div id=\"update-flag-status-reason-not-entered-error-message\" class=\"govuk-error-message\" *ngIf=\"statusReasonNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"update-flag-status-reason-char-limit-error\" class=\"govuk-error-message\" *ngIf=\"statusReasonCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\"\n [id]=\"caseFlagFormFields.STATUS_CHANGE_REASON\"\n [name]=\"caseFlagFormFields.STATUS_CHANGE_REASON\"\n [formControlName]=\"caseFlagFormFields.STATUS_CHANGE_REASON\"\n rows=\"5\"\n aria-describedby=\"update-flag-comments-hint-external update-flag-status-hint update-flag-status-reason-char-limit-info\n update-flag-status-reason-char-limit-error\">\n </textarea>\n <div id=\"update-flag-status-reason-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </ng-template>\n\n <div id=\"flag-status-container-v2_1\" class=\"govuk-!-margin-bottom-4\" *ngIf=\"internalUser2Point1EnabledUpdate\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"update-flag-status-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--s\">\n <h1 id=\"update-flag-status-heading\" class=\"govuk-fieldset__heading\">\n {{updateFlagTitle | rpxTranslate}} {{'status' | rpxTranslate}}\n </h1>\n </legend>\n <div class=\"govuk-radios govuk-radios--conditional govuk-!-margin-bottom-4\" data-module=\"govuk-radios\" [id]=\"caseFlagFormFields.STATUS\">\n <div class=\"govuk-radios__item\" *ngFor=\"let status of validStatusProgressions\">\n <input class=\"govuk-radios__input\" type=\"radio\"\n [id]=\"caseFlagFormFields.STATUS + '_' + status\"\n [name]=\"caseFlagFormFields.STATUS\"\n [formControlName]=\"caseFlagFormFields.STATUS\"\n [value]=\"status\">\n <label class=\"govuk-label govuk-radios__label\" [for]=\"caseFlagFormFields.STATUS + '_' + status\">\n {{caseFlagStatusEnum[status] | rpxTranslate}}\n </label>\n </div>\n </div>\n </fieldset>\n\n <div id=\"update-flag-status-hint\" class=\"govuk-hint\">\n {{updateFlagStepEnum.STATUS_HINT_TEXT | rpxTranslate}}\n </div>\n <ng-container *ngTemplateOutlet=\"updateFlagStatusReason\"></ng-container>\n </div>\n\n <div id=\"translation-checkbox-container\" class=\"govuk-!-margin-bottom-6\" *ngIf=\"internalUser2Point1EnabledUpdate\">\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" type=\"checkbox\"\n [formControlName]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\"\n [id]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\"\n [name]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\">\n <label class=\"govuk-label govuk-checkboxes__label\"\n [for]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\">\n {{'I need to add a translation' | rpxTranslate}}\n </label>\n </div>\n </div>\n </div>\n\n <div id=\"flag-status-container-v1\" class=\"govuk-grid-row\" *ngIf=\"internalUserUpdate\">\n <div class=\"govuk-grid-column-one-half\">\n <p>{{'Flag status:' | rpxTranslate}}\n <span>\n <strong class=\"govuk-tag\" [ngClass]=\"{'govuk-tag--grey': selectedFlag.flagDetailDisplay.flagDetail.status === 'Inactive'}\">\n {{selectedFlag?.flagDetailDisplay?.flagDetail?.status | rpxTranslate}}\n </strong>\n </span>\n </p>\n </div>\n <div class=\"govuk-grid-column-one-half\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"onMakeInactive()\" *ngIf=\"selectedFlag.flagDetailDisplay.flagDetail.status === 'Active'\">\n {{'Make inactive' | rpxTranslate}}\n </button>\n </div>\n </div>\n </div>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\">\n <button id=\"updateFlagNextButton\" class=\"govuk-button\" type=\"button\" (click)=\"onNext()\">\n {{'Next' | rpxTranslate}}\n </button>\n</div>\n" }]
25055
- }], () => [{ type: i1.RpxTranslationService }], { formGroup: [{
25593
+ args: [{ selector: 'ccd-update-flag', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <h1 class=\"govuk-label-wrapper govuk-!-margin-bottom-4\">\n <label class=\"govuk-label govuk-label--m\">\n {{updateFlagTitle | rpxTranslate}}\n </label>\n </h1>\n <div id=\"update-flag-hint-external\" class=\"govuk-hint\" *ngIf=\"externalUserUpdate\">\n {{selectedFlag?.flagDetailDisplay?.flagDetail | updateFlagTitleDisplay}}\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label class=\"govuk-label govuk-label--s\" [for]=\"caseFlagFormFields.COMMENTS\">\n {{\n externalUserUpdate\n ? (updateFlagStepEnum.COMMENT_FIELD_LABEL_EXTERNAL | rpxTranslate)\n : (updateFlagTitle | rpxTranslate) + (' comments' | rpxTranslate)\n }}\n </label>\n <div id=\"update-flag-comments-hint-external\" class=\"govuk-hint\" *ngIf=\"externalUserUpdate\">\n {{updateFlagStepEnum.COMMENT_HINT_TEXT_EXTERNAL | rpxTranslate}}\n </div>\n <ng-container *ngIf=\"internalUserUpdate || internalUser2Point1EnabledUpdate || displayContextParameter === '';\n else externalUser\">\n <div id=\"update-flag-comments-hint\" class=\"govuk-hint\">\n {{\n internalUserUpdate\n ? (updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL | rpxTranslate)\n : (updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL_2_POINT_1 | rpxTranslate)\n }}\n </div>\n <div class=\"govuk-warning-text\" *ngIf=\"internalUser2Point1EnabledUpdate && externallyVisibleFlag\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">{{'Warning' | rpxTranslate}}</span>\n {{updateFlagStepEnum.WARNING_TEXT | rpxTranslate}}\n </strong>\n </div>\n <div id=\"update-flag-comments-not-entered-error-message\" class=\"govuk-error-message\" *ngIf=\"commentsNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{commentsNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"update-flag-comments-char-limit-error\" class=\"govuk-error-message\" *ngIf=\"commentsCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{commentsCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\"\n [id]=\"caseFlagFormFields.COMMENTS\"\n [name]=\"caseFlagFormFields.COMMENTS\"\n [formControlName]=\"caseFlagFormFields.COMMENTS\"\n rows=\"5\"\n aria-describedby=\"update-flag-comments-hint update-flag-comments-char-limit-info update-flag-comments-char-limit-error\">\n </textarea>\n <div id=\"update-flag-comments-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </ng-container>\n <ng-template #externalUser>\n <ng-container *ngIf=\"externalUserUpdate\">\n <ng-container *ngTemplateOutlet=\"updateFlagStatusReason\"></ng-container>\n </ng-container>\n </ng-template>\n </div>\n\n <ng-template #updateFlagStatusReason>\n <div id=\"update-flag-status-reason-not-entered-error-message\" class=\"govuk-error-message\" *ngIf=\"statusReasonNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"update-flag-status-reason-char-limit-error\" class=\"govuk-error-message\" *ngIf=\"statusReasonCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\"\n [id]=\"caseFlagFormFields.STATUS_CHANGE_REASON\"\n [name]=\"caseFlagFormFields.STATUS_CHANGE_REASON\"\n [formControlName]=\"caseFlagFormFields.STATUS_CHANGE_REASON\"\n rows=\"5\"\n aria-describedby=\"update-flag-comments-hint-external update-flag-status-hint update-flag-status-reason-char-limit-info\n update-flag-status-reason-char-limit-error\">\n </textarea>\n <div id=\"update-flag-status-reason-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </ng-template>\n\n <div id=\"flag-status-container-v2_1\" class=\"govuk-!-margin-bottom-4\" *ngIf=\"internalUser2Point1EnabledUpdate\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"update-flag-status-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--s\">\n <h1 id=\"update-flag-status-heading\" class=\"govuk-fieldset__heading\">\n {{updateFlagTitle | rpxTranslate}} {{'status' | rpxTranslate}}\n </h1>\n </legend>\n <div class=\"govuk-radios govuk-radios--conditional govuk-!-margin-bottom-4\" data-module=\"govuk-radios\" [id]=\"caseFlagFormFields.STATUS\">\n <div class=\"govuk-radios__item\" *ngFor=\"let status of validStatusProgressions\">\n <input class=\"govuk-radios__input\" type=\"radio\"\n [id]=\"caseFlagFormFields.STATUS + '_' + status\"\n [name]=\"caseFlagFormFields.STATUS\"\n [formControlName]=\"caseFlagFormFields.STATUS\"\n [value]=\"status\">\n <label class=\"govuk-label govuk-radios__label\" [for]=\"caseFlagFormFields.STATUS + '_' + status\">\n {{caseFlagStatusEnum[status] | rpxTranslate}}\n </label>\n </div>\n </div>\n </fieldset>\n\n <div id=\"update-flag-status-hint\" class=\"govuk-hint\">\n {{updateFlagStepEnum.STATUS_HINT_TEXT | rpxTranslate}}\n </div>\n <ng-container *ngTemplateOutlet=\"updateFlagStatusReason\"></ng-container>\n </div>\n\n <div id=\"translation-checkbox-container\" class=\"govuk-!-margin-bottom-6\" *ngIf=\"internalUser2Point1EnabledUpdate\">\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" type=\"checkbox\"\n [formControlName]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\"\n [id]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\"\n [name]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\">\n <label class=\"govuk-label govuk-checkboxes__label\"\n [for]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\">\n {{'I need to add a translation' | rpxTranslate}}\n </label>\n </div>\n </div>\n </div>\n\n <div id=\"flag-status-container-v1\" class=\"govuk-grid-row\" *ngIf=\"internalUserUpdate\">\n <div class=\"govuk-grid-column-one-half\">\n <p>{{'Flag status:' | rpxTranslate}}\n <span>\n <strong class=\"govuk-tag\" [ngClass]=\"{'govuk-tag--grey': selectedFlag.flagDetailDisplay.flagDetail.status === 'Inactive'}\">\n {{selectedFlag?.flagDetailDisplay?.flagDetail?.status | rpxTranslate}}\n </strong>\n </span>\n </p>\n </div>\n <div class=\"govuk-grid-column-one-half\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"onMakeInactive()\" *ngIf=\"selectedFlag.flagDetailDisplay.flagDetail.status === 'Active'\">\n {{'Make inactive' | rpxTranslate}}\n </button>\n </div>\n </div>\n </div>\n </div>\n</ng-container>" }]
25594
+ }], () => [{ type: i1.RpxTranslationService }, { type: MultipageComponentStateService }], { formGroup: [{
25056
25595
  type: Input
25057
25596
  }], displayContextParameter: [{
25058
25597
  type: Input
25059
25598
  }], caseFlagStateEmitter: [{
25060
25599
  type: Output
25061
25600
  }] }); })();
25062
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UpdateFlagComponent, { className: "UpdateFlagComponent", filePath: "lib/shared/components/palette/case-flag/components/update-flag/update-flag.component.ts", lineNumber: 20 }); })();
25601
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UpdateFlagComponent, { className: "UpdateFlagComponent", filePath: "lib/shared/components/palette/case-flag/components/update-flag/update-flag.component.ts", lineNumber: 22 }); })();
25063
25602
 
25064
25603
  const _c0$m = a0 => ({ "form-group-error": a0 });
25065
25604
  function UpdateFlagAddTranslationFormComponent_div_14_Template(rf, ctx) { if (rf & 1) {
25066
- i0.ɵɵelementStart(0, "div", 19)(1, "span", 20);
25605
+ i0.ɵɵelementStart(0, "div", 17)(1, "span", 18);
25067
25606
  i0.ɵɵtext(2);
25068
25607
  i0.ɵɵpipe(3, "rpxTranslate");
25069
25608
  i0.ɵɵelementEnd();
@@ -25078,7 +25617,7 @@ function UpdateFlagAddTranslationFormComponent_div_14_Template(rf, ctx) { if (rf
25078
25617
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.otherFlagDescriptionCharLimitErrorMessage), " ");
25079
25618
  } }
25080
25619
  function UpdateFlagAddTranslationFormComponent_div_24_Template(rf, ctx) { if (rf & 1) {
25081
- i0.ɵɵelementStart(0, "div", 21)(1, "span", 20);
25620
+ i0.ɵɵelementStart(0, "div", 19)(1, "span", 18);
25082
25621
  i0.ɵɵtext(2);
25083
25622
  i0.ɵɵpipe(3, "rpxTranslate");
25084
25623
  i0.ɵɵelementEnd();
@@ -25093,7 +25632,7 @@ function UpdateFlagAddTranslationFormComponent_div_24_Template(rf, ctx) { if (rf
25093
25632
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.otherFlagDescriptionWelshCharLimitErrorMessage), " ");
25094
25633
  } }
25095
25634
  function UpdateFlagAddTranslationFormComponent_div_34_Template(rf, ctx) { if (rf & 1) {
25096
- i0.ɵɵelementStart(0, "div", 22)(1, "span", 20);
25635
+ i0.ɵɵelementStart(0, "div", 20)(1, "span", 18);
25097
25636
  i0.ɵɵtext(2);
25098
25637
  i0.ɵɵpipe(3, "rpxTranslate");
25099
25638
  i0.ɵɵelementEnd();
@@ -25108,7 +25647,7 @@ function UpdateFlagAddTranslationFormComponent_div_34_Template(rf, ctx) { if (rf
25108
25647
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.flagCommentsCharLimitErrorMessage), " ");
25109
25648
  } }
25110
25649
  function UpdateFlagAddTranslationFormComponent_div_44_Template(rf, ctx) { if (rf & 1) {
25111
- i0.ɵɵelementStart(0, "div", 23)(1, "span", 20);
25650
+ i0.ɵɵelementStart(0, "div", 21)(1, "span", 18);
25112
25651
  i0.ɵɵtext(2);
25113
25652
  i0.ɵɵpipe(3, "rpxTranslate");
25114
25653
  i0.ɵɵelementEnd();
@@ -25122,7 +25661,7 @@ function UpdateFlagAddTranslationFormComponent_div_44_Template(rf, ctx) { if (rf
25122
25661
  i0.ɵɵadvance(2);
25123
25662
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.flagCommentsWelshCharLimitErrorMessage), " ");
25124
25663
  } }
25125
- class UpdateFlagAddTranslationFormComponent {
25664
+ class UpdateFlagAddTranslationFormComponent extends AbstractJourneyComponent {
25126
25665
  formGroup;
25127
25666
  caseFlagStateEmitter = new EventEmitter();
25128
25667
  selectedFlag;
@@ -25196,8 +25735,14 @@ class UpdateFlagAddTranslationFormComponent {
25196
25735
  });
25197
25736
  }
25198
25737
  }
25199
- static ɵfac = function UpdateFlagAddTranslationFormComponent_Factory(t) { return new (t || UpdateFlagAddTranslationFormComponent)(); };
25200
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UpdateFlagAddTranslationFormComponent, selectors: [["ccd-update-flag-add-translation-form"]], inputs: { formGroup: "formGroup" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 54, vars: 57, consts: [[3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper", "govuk-!-margin-bottom-6"], [1, "govuk-label", "govuk-label--m"], ["id", "add-translation-form-hint", 1, "govuk-hint"], [1, "govuk-!-margin-bottom-4"], [1, "govuk-label", "govuk-label--s", 3, "for"], ["id", "add-translation-other-flag-description-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "add-translation-other-flag-description-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-other-flag-description-welsh-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-translation-other-flag-description-welsh-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-flag-comments-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-translation-flag-comments-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-flag-comments-welsh-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-translation-flag-comments-welsh-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-button-group"], ["id", "updateFlagNextButton", "type", "button", 1, "govuk-button", 3, "click"], ["id", "add-translation-other-flag-description-char-limit-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "add-translation-other-flag-description-welsh-char-limit-error", 1, "govuk-error-message"], ["id", "add-translation-flag-comments-char-limit-error", 1, "govuk-error-message"], ["id", "add-translation-flag-comments-welsh-char-limit-error", 1, "govuk-error-message"]], template: function UpdateFlagAddTranslationFormComponent_Template(rf, ctx) { if (rf & 1) {
25738
+ next() {
25739
+ this.onNext();
25740
+ if (this.errorMessages.length === 0) {
25741
+ super.next();
25742
+ }
25743
+ }
25744
+ static ɵfac = /*@__PURE__*/ (() => { let ɵUpdateFlagAddTranslationFormComponent_BaseFactory; return function UpdateFlagAddTranslationFormComponent_Factory(t) { return (ɵUpdateFlagAddTranslationFormComponent_BaseFactory || (ɵUpdateFlagAddTranslationFormComponent_BaseFactory = i0.ɵɵgetInheritedFactory(UpdateFlagAddTranslationFormComponent)))(t || UpdateFlagAddTranslationFormComponent); }; })();
25745
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UpdateFlagAddTranslationFormComponent, selectors: [["ccd-update-flag-add-translation-form"]], inputs: { formGroup: "formGroup" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 50, vars: 54, consts: [[3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper", "govuk-!-margin-bottom-6"], [1, "govuk-label", "govuk-label--m"], ["id", "add-translation-form-hint", 1, "govuk-hint"], [1, "govuk-!-margin-bottom-4"], [1, "govuk-label", "govuk-label--s", 3, "for"], ["id", "add-translation-other-flag-description-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "add-translation-other-flag-description-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-other-flag-description-welsh-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-translation-other-flag-description-welsh-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-flag-comments-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-translation-flag-comments-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-flag-comments-welsh-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-translation-flag-comments-welsh-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-other-flag-description-char-limit-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "add-translation-other-flag-description-welsh-char-limit-error", 1, "govuk-error-message"], ["id", "add-translation-flag-comments-char-limit-error", 1, "govuk-error-message"], ["id", "add-translation-flag-comments-welsh-char-limit-error", 1, "govuk-error-message"]], template: function UpdateFlagAddTranslationFormComponent_Template(rf, ctx) { if (rf & 1) {
25201
25746
  i0.ɵɵelementContainerStart(0, 0);
25202
25747
  i0.ɵɵelementStart(1, "div", 1)(2, "div", 2)(3, "h1", 3)(4, "label", 4);
25203
25748
  i0.ɵɵtext(5);
@@ -25256,78 +25801,71 @@ class UpdateFlagAddTranslationFormComponent {
25256
25801
  i0.ɵɵpipe(49, "rpxTranslate");
25257
25802
  i0.ɵɵelementEnd()()()();
25258
25803
  i0.ɵɵelementContainerEnd();
25259
- i0.ɵɵelementStart(50, "div", 17)(51, "button", 18);
25260
- i0.ɵɵlistener("click", function UpdateFlagAddTranslationFormComponent_Template_button_click_51_listener() { return ctx.onNext(); });
25261
- i0.ɵɵtext(52);
25262
- i0.ɵɵpipe(53, "rpxTranslate");
25263
- i0.ɵɵelementEnd()();
25264
25804
  } if (rf & 2) {
25265
25805
  i0.ɵɵproperty("formGroup", ctx.formGroup);
25266
25806
  i0.ɵɵadvance(2);
25267
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(55, _c0$m, ctx.errorMessages.length > 0));
25807
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(52, _c0$m, ctx.errorMessages.length > 0));
25268
25808
  i0.ɵɵadvance(3);
25269
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 33, ctx.updateFlagAddTranslationTitle), " ");
25809
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 32, ctx.updateFlagAddTranslationTitle), " ");
25270
25810
  i0.ɵɵadvance(3);
25271
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(9, 35, ctx.updateFlagAddTranslationStepEnum.HINT_TEXT), " ");
25811
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(9, 34, ctx.updateFlagAddTranslationStepEnum.HINT_TEXT), " ");
25272
25812
  i0.ɵɵadvance(3);
25273
25813
  i0.ɵɵproperty("for", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION);
25274
25814
  i0.ɵɵadvance();
25275
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(13, 37, "Other description"));
25815
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(13, 36, "Other description"));
25276
25816
  i0.ɵɵadvance(2);
25277
25817
  i0.ɵɵproperty("ngIf", ctx.otherFlagDescriptionCharLimitErrorMessage);
25278
25818
  i0.ɵɵadvance();
25279
25819
  i0.ɵɵproperty("id", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION)("name", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION)("formControlName", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION);
25280
25820
  i0.ɵɵadvance(3);
25281
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(19, 39, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25821
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(19, 38, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25282
25822
  i0.ɵɵadvance(3);
25283
25823
  i0.ɵɵproperty("for", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH);
25284
25824
  i0.ɵɵadvance();
25285
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(23, 41, "Other description (Welsh)"));
25825
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(23, 40, "Other description (Welsh)"));
25286
25826
  i0.ɵɵadvance(2);
25287
25827
  i0.ɵɵproperty("ngIf", ctx.otherFlagDescriptionWelshCharLimitErrorMessage);
25288
25828
  i0.ɵɵadvance();
25289
25829
  i0.ɵɵproperty("id", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH)("name", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH)("formControlName", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH);
25290
25830
  i0.ɵɵadvance(3);
25291
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(29, 43, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25831
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(29, 42, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25292
25832
  i0.ɵɵadvance(3);
25293
25833
  i0.ɵɵproperty("for", ctx.caseFlagFormFields.COMMENTS);
25294
25834
  i0.ɵɵadvance();
25295
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(33, 45, "Flag comments"));
25835
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(33, 44, "Flag comments"));
25296
25836
  i0.ɵɵadvance(2);
25297
25837
  i0.ɵɵproperty("ngIf", ctx.flagCommentsCharLimitErrorMessage);
25298
25838
  i0.ɵɵadvance();
25299
25839
  i0.ɵɵproperty("id", ctx.caseFlagFormFields.COMMENTS)("name", ctx.caseFlagFormFields.COMMENTS)("formControlName", ctx.caseFlagFormFields.COMMENTS);
25300
25840
  i0.ɵɵadvance(3);
25301
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(39, 47, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25841
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(39, 46, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25302
25842
  i0.ɵɵadvance(3);
25303
25843
  i0.ɵɵproperty("for", ctx.caseFlagFormFields.COMMENTS_WELSH);
25304
25844
  i0.ɵɵadvance();
25305
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(43, 49, "Flag comments (Welsh)"));
25845
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(43, 48, "Flag comments (Welsh)"));
25306
25846
  i0.ɵɵadvance(2);
25307
25847
  i0.ɵɵproperty("ngIf", ctx.flagCommentsWelshCharLimitErrorMessage);
25308
25848
  i0.ɵɵadvance();
25309
25849
  i0.ɵɵproperty("id", ctx.caseFlagFormFields.COMMENTS_WELSH)("name", ctx.caseFlagFormFields.COMMENTS_WELSH)("formControlName", ctx.caseFlagFormFields.COMMENTS_WELSH);
25310
25850
  i0.ɵɵadvance(3);
25311
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(49, 51, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25312
- i0.ɵɵadvance(4);
25313
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(53, 53, "Next"), " ");
25851
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(49, 50, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25314
25852
  } }, dependencies: [i5.NgClass, i5.NgIf, i4.DefaultValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormControlName, i1.RpxTranslatePipe], encapsulation: 2 });
25315
25853
  }
25316
25854
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UpdateFlagAddTranslationFormComponent, [{
25317
25855
  type: Component,
25318
- args: [{ selector: 'ccd-update-flag-add-translation-form', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <h1 class=\"govuk-label-wrapper govuk-!-margin-bottom-6\">\n <label class=\"govuk-label govuk-label--m\">\n {{ updateFlagAddTranslationTitle | rpxTranslate}}\n </label>\n </h1>\n <div id=\"add-translation-form-hint\" class=\"govuk-hint\">\n {{ updateFlagAddTranslationStepEnum.HINT_TEXT | rpxTranslate}}\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\" class=\"govuk-label govuk-label--s\">{{'Other description' | rpxTranslate}}</label>\n <div id=\"add-translation-other-flag-description-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"otherFlagDescriptionCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{otherFlagDescriptionCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\"\n [name]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\"\n [formControlName]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\">\n </textarea>\n <div id=\"add-translation-other-flag-description-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\" class=\"govuk-label govuk-label--s\">{{'Other description (Welsh)' | rpxTranslate}}</label>\n <div id=\"add-translation-other-flag-description-welsh-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"otherFlagDescriptionWelshCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{otherFlagDescriptionWelshCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\"\n [name]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\"\n [formControlName]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\">\n </textarea>\n <div id=\"add-translation-other-flag-description-welsh-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.COMMENTS\" class=\"govuk-label govuk-label--s\">{{'Flag comments' | rpxTranslate}}</label>\n <div id=\"add-translation-flag-comments-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.COMMENTS\"\n [name]=\"caseFlagFormFields.COMMENTS\"\n [formControlName]=\"caseFlagFormFields.COMMENTS\">\n </textarea>\n <div id=\"add-translation-flag-comments-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.COMMENTS_WELSH\" class=\"govuk-label govuk-label--s\">{{'Flag comments (Welsh)' | rpxTranslate}}</label>\n <div id=\"add-translation-flag-comments-welsh-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsWelshCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsWelshCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.COMMENTS_WELSH\"\n [name]=\"caseFlagFormFields.COMMENTS_WELSH\"\n [formControlName]=\"caseFlagFormFields.COMMENTS_WELSH\">\n </textarea>\n <div id=\"add-translation-flag-comments-welsh-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n </div>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\">\n <button id=\"updateFlagNextButton\" class=\"govuk-button\" type=\"button\" (click)=\"onNext()\">\n {{'Next' | rpxTranslate}}\n </button>\n</div>\n" }]
25856
+ args: [{ selector: 'ccd-update-flag-add-translation-form', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <h1 class=\"govuk-label-wrapper govuk-!-margin-bottom-6\">\n <label class=\"govuk-label govuk-label--m\">\n {{ updateFlagAddTranslationTitle | rpxTranslate}}\n </label>\n </h1>\n <div id=\"add-translation-form-hint\" class=\"govuk-hint\">\n {{ updateFlagAddTranslationStepEnum.HINT_TEXT | rpxTranslate}}\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\" class=\"govuk-label govuk-label--s\">{{'Other description' | rpxTranslate}}</label>\n <div id=\"add-translation-other-flag-description-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"otherFlagDescriptionCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{otherFlagDescriptionCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\"\n [name]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\"\n [formControlName]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\">\n </textarea>\n <div id=\"add-translation-other-flag-description-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\" class=\"govuk-label govuk-label--s\">{{'Other description (Welsh)' | rpxTranslate}}</label>\n <div id=\"add-translation-other-flag-description-welsh-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"otherFlagDescriptionWelshCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{otherFlagDescriptionWelshCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\"\n [name]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\"\n [formControlName]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\">\n </textarea>\n <div id=\"add-translation-other-flag-description-welsh-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.COMMENTS\" class=\"govuk-label govuk-label--s\">{{'Flag comments' | rpxTranslate}}</label>\n <div id=\"add-translation-flag-comments-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.COMMENTS\"\n [name]=\"caseFlagFormFields.COMMENTS\"\n [formControlName]=\"caseFlagFormFields.COMMENTS\">\n </textarea>\n <div id=\"add-translation-flag-comments-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.COMMENTS_WELSH\" class=\"govuk-label govuk-label--s\">{{'Flag comments (Welsh)' | rpxTranslate}}</label>\n <div id=\"add-translation-flag-comments-welsh-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsWelshCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsWelshCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.COMMENTS_WELSH\"\n [name]=\"caseFlagFormFields.COMMENTS_WELSH\"\n [formControlName]=\"caseFlagFormFields.COMMENTS_WELSH\">\n </textarea>\n <div id=\"add-translation-flag-comments-welsh-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n </div>\n </div>\n</ng-container>" }]
25319
25857
  }], null, { formGroup: [{
25320
25858
  type: Input
25321
25859
  }], caseFlagStateEmitter: [{
25322
25860
  type: Output
25323
25861
  }] }); })();
25324
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UpdateFlagAddTranslationFormComponent, { className: "UpdateFlagAddTranslationFormComponent", filePath: "lib/shared/components/palette/case-flag/components/update-flag/update-flag-add-translation-form/update-flag-add-translation-form.component.ts", lineNumber: 17 }); })();
25862
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UpdateFlagAddTranslationFormComponent, { className: "UpdateFlagAddTranslationFormComponent", filePath: "lib/shared/components/palette/case-flag/components/update-flag/update-flag-add-translation-form/update-flag-add-translation-form.component.ts", lineNumber: 18 }); })();
25325
25863
 
25326
25864
  const _c0$l = a0 => ({ "form-group-error": a0 });
25327
25865
  function ConfirmFlagStatusComponent_div_9_Template(rf, ctx) { if (rf & 1) {
25328
- i0.ɵɵelementStart(0, "div", 15);
25329
- i0.ɵɵelement(1, "input", 16);
25330
- i0.ɵɵelementStart(2, "label", 17);
25866
+ i0.ɵɵelementStart(0, "div", 13);
25867
+ i0.ɵɵelement(1, "input", 14);
25868
+ i0.ɵɵelementStart(2, "label", 15);
25331
25869
  i0.ɵɵtext(3);
25332
25870
  i0.ɵɵpipe(4, "rpxTranslate");
25333
25871
  i0.ɵɵelementEnd()();
@@ -25344,7 +25882,7 @@ function ConfirmFlagStatusComponent_div_9_Template(rf, ctx) { if (rf & 1) {
25344
25882
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 8, ctx_r2.caseFlagStatusEnum[status_r1]), " ");
25345
25883
  } }
25346
25884
  function ConfirmFlagStatusComponent_div_13_Template(rf, ctx) { if (rf & 1) {
25347
- i0.ɵɵelementStart(0, "div", 18)(1, "span", 19);
25885
+ i0.ɵɵelementStart(0, "div", 16)(1, "span", 17);
25348
25886
  i0.ɵɵtext(2);
25349
25887
  i0.ɵɵpipe(3, "rpxTranslate");
25350
25888
  i0.ɵɵelementEnd();
@@ -25359,7 +25897,7 @@ function ConfirmFlagStatusComponent_div_13_Template(rf, ctx) { if (rf & 1) {
25359
25897
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r2.statusReasonNotEnteredErrorMessage), " ");
25360
25898
  } }
25361
25899
  function ConfirmFlagStatusComponent_div_14_Template(rf, ctx) { if (rf & 1) {
25362
- i0.ɵɵelementStart(0, "div", 20)(1, "span", 19);
25900
+ i0.ɵɵelementStart(0, "div", 18)(1, "span", 17);
25363
25901
  i0.ɵɵtext(2);
25364
25902
  i0.ɵɵpipe(3, "rpxTranslate");
25365
25903
  i0.ɵɵelementEnd();
@@ -25373,7 +25911,7 @@ function ConfirmFlagStatusComponent_div_14_Template(rf, ctx) { if (rf & 1) {
25373
25911
  i0.ɵɵadvance(2);
25374
25912
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r2.statusReasonCharLimitErrorMessage), " ");
25375
25913
  } }
25376
- class ConfirmFlagStatusComponent {
25914
+ class ConfirmFlagStatusComponent extends AbstractJourneyComponent {
25377
25915
  formGroup;
25378
25916
  defaultStatus;
25379
25917
  caseFlagStateEmitter = new EventEmitter();
@@ -25402,6 +25940,12 @@ class ConfirmFlagStatusComponent {
25402
25940
  // Return case flag field state and error messages to the parent
25403
25941
  this.caseFlagStateEmitter.emit({ currentCaseFlagFieldState: CaseFlagFieldState.FLAG_STATUS, errorMessages: this.errorMessages });
25404
25942
  }
25943
+ next() {
25944
+ this.onNext();
25945
+ if (this.errorMessages.length === 0) {
25946
+ super.next();
25947
+ }
25948
+ }
25405
25949
  validateTextEntry() {
25406
25950
  this.statusReasonNotEnteredErrorMessage = null;
25407
25951
  this.statusReasonCharLimitErrorMessage = null;
@@ -25425,8 +25969,8 @@ class ConfirmFlagStatusComponent {
25425
25969
  });
25426
25970
  }
25427
25971
  }
25428
- static ɵfac = function ConfirmFlagStatusComponent_Factory(t) { return new (t || ConfirmFlagStatusComponent)(); };
25429
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ConfirmFlagStatusComponent, selectors: [["ccd-confirm-flag-status"]], inputs: { formGroup: "formGroup", defaultStatus: "defaultStatus" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 23, vars: 22, consts: [[3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "confirm-flag-status-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "confirm-flag-status-heading", 1, "govuk-fieldset__heading"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional", "govuk-!-margin-bottom-4"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "status-reason-hint", 1, "govuk-hint"], ["id", "status-reason-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "status-reason-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "status-reason-hint status-reason-char-limit-info", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "status-reason-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "status-reason-not-entered-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "status-reason-char-limit-error", 1, "govuk-error-message"]], template: function ConfirmFlagStatusComponent_Template(rf, ctx) { if (rf & 1) {
25972
+ static ɵfac = /*@__PURE__*/ (() => { let ɵConfirmFlagStatusComponent_BaseFactory; return function ConfirmFlagStatusComponent_Factory(t) { return (ɵConfirmFlagStatusComponent_BaseFactory || (ɵConfirmFlagStatusComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ConfirmFlagStatusComponent)))(t || ConfirmFlagStatusComponent); }; })();
25973
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ConfirmFlagStatusComponent, selectors: [["ccd-confirm-flag-status"]], inputs: { formGroup: "formGroup", defaultStatus: "defaultStatus" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 19, vars: 19, consts: [[3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "confirm-flag-status-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "confirm-flag-status-heading", 1, "govuk-fieldset__heading"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional", "govuk-!-margin-bottom-4"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "status-reason-hint", 1, "govuk-hint"], ["id", "status-reason-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "status-reason-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "status-reason-hint status-reason-char-limit-info", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "status-reason-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "status-reason-not-entered-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "status-reason-char-limit-error", 1, "govuk-error-message"]], template: function ConfirmFlagStatusComponent_Template(rf, ctx) { if (rf & 1) {
25430
25974
  i0.ɵɵelementContainerStart(0, 0);
25431
25975
  i0.ɵɵelementStart(1, "div", 1)(2, "div", 2)(3, "fieldset", 3)(4, "legend", 4)(5, "h1", 5);
25432
25976
  i0.ɵɵtext(6);
@@ -25446,21 +25990,16 @@ class ConfirmFlagStatusComponent {
25446
25990
  i0.ɵɵpipe(18, "rpxTranslate");
25447
25991
  i0.ɵɵelementEnd()()();
25448
25992
  i0.ɵɵelementContainerEnd();
25449
- i0.ɵɵelementStart(19, "div", 13)(20, "button", 14);
25450
- i0.ɵɵlistener("click", function ConfirmFlagStatusComponent_Template_button_click_20_listener() { return ctx.onNext(); });
25451
- i0.ɵɵtext(21);
25452
- i0.ɵɵpipe(22, "rpxTranslate");
25453
- i0.ɵɵelementEnd()();
25454
25993
  } if (rf & 2) {
25455
25994
  i0.ɵɵproperty("formGroup", ctx.formGroup);
25456
25995
  i0.ɵɵadvance(2);
25457
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(20, _c0$l, ctx.errorMessages.length > 0));
25996
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(17, _c0$l, ctx.errorMessages.length > 0));
25458
25997
  i0.ɵɵadvance(4);
25459
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(7, 12, ctx.confirmFlagStatusTitle), " ");
25998
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(7, 11, ctx.confirmFlagStatusTitle), " ");
25460
25999
  i0.ɵɵadvance(3);
25461
26000
  i0.ɵɵproperty("ngForOf", ctx.flagCreationStatuses);
25462
26001
  i0.ɵɵadvance(2);
25463
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(12, 14, ctx.statusReasonHint), " ");
26002
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(12, 13, ctx.statusReasonHint), " ");
25464
26003
  i0.ɵɵadvance(2);
25465
26004
  i0.ɵɵproperty("ngIf", ctx.statusReasonNotEnteredErrorMessage);
25466
26005
  i0.ɵɵadvance();
@@ -25468,14 +26007,12 @@ class ConfirmFlagStatusComponent {
25468
26007
  i0.ɵɵadvance();
25469
26008
  i0.ɵɵproperty("id", ctx.statusReasonControlName)("name", ctx.statusReasonControlName)("formControlName", ctx.statusReasonControlName);
25470
26009
  i0.ɵɵadvance(2);
25471
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(18, 16, ctx.statusReasonCharLimitInfo), " ");
25472
- i0.ɵɵadvance(4);
25473
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(22, 18, "Next"));
26010
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(18, 15, ctx.statusReasonCharLimitInfo), " ");
25474
26011
  } }, dependencies: [i5.NgClass, i5.NgForOf, i5.NgIf, i4.DefaultValueAccessor, i4.RadioControlValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormControlName, i1.RpxTranslatePipe], encapsulation: 2 });
25475
26012
  }
25476
26013
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConfirmFlagStatusComponent, [{
25477
26014
  type: Component,
25478
- args: [{ selector: 'ccd-confirm-flag-status', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"confirm-flag-status-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"confirm-flag-status-heading\" class=\"govuk-fieldset__heading\">\n {{confirmFlagStatusTitle | rpxTranslate}}\n </h1>\n </legend>\n <div class=\"govuk-radios govuk-radios--conditional govuk-!-margin-bottom-4\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let status of flagCreationStatuses; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-status-{{i}}\" [name]=\"selectedStatusControlName\"\n type=\"radio\" [value]=\"status\" [formControlName]=\"selectedStatusControlName\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-status-{{i}}\">\n {{caseFlagStatusEnum[status] | rpxTranslate}}\n </label>\n </div>\n </div>\n </fieldset>\n <div id=\"status-reason-hint\" class=\"govuk-hint\">\n {{statusReasonHint | rpxTranslate}}\n </div>\n <div id=\"status-reason-not-entered-error-message\" class=\"govuk-error-message\"\n *ngIf=\"statusReasonNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"status-reason-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"statusReasonCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\" [id]=\"statusReasonControlName\"\n [name]=\"statusReasonControlName\" [formControlName]=\"statusReasonControlName\" rows=\"5\"\n aria-describedby=\"status-reason-hint status-reason-char-limit-info\"></textarea>\n <div id=\"status-reason-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{statusReasonCharLimitInfo | rpxTranslate}}\n </div>\n </div>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" (click)=\"onNext()\">{{'Next' | rpxTranslate}}</button>\n</div>\n" }]
26015
+ args: [{ selector: 'ccd-confirm-flag-status', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"confirm-flag-status-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"confirm-flag-status-heading\" class=\"govuk-fieldset__heading\">\n {{confirmFlagStatusTitle | rpxTranslate}}\n </h1>\n </legend>\n <div class=\"govuk-radios govuk-radios--conditional govuk-!-margin-bottom-4\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let status of flagCreationStatuses; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-status-{{i}}\" [name]=\"selectedStatusControlName\"\n type=\"radio\" [value]=\"status\" [formControlName]=\"selectedStatusControlName\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-status-{{i}}\">\n {{caseFlagStatusEnum[status] | rpxTranslate}}\n </label>\n </div>\n </div>\n </fieldset>\n <div id=\"status-reason-hint\" class=\"govuk-hint\">\n {{statusReasonHint | rpxTranslate}}\n </div>\n <div id=\"status-reason-not-entered-error-message\" class=\"govuk-error-message\"\n *ngIf=\"statusReasonNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"status-reason-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"statusReasonCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\" [id]=\"statusReasonControlName\"\n [name]=\"statusReasonControlName\" [formControlName]=\"statusReasonControlName\" rows=\"5\"\n aria-describedby=\"status-reason-hint status-reason-char-limit-info\"></textarea>\n <div id=\"status-reason-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{statusReasonCharLimitInfo | rpxTranslate}}\n </div>\n </div>\n </div>\n</ng-container>" }]
25479
26016
  }], null, { formGroup: [{
25480
26017
  type: Input
25481
26018
  }], defaultStatus: [{
@@ -25483,7 +26020,7 @@ class ConfirmFlagStatusComponent {
25483
26020
  }], caseFlagStateEmitter: [{
25484
26021
  type: Output
25485
26022
  }] }); })();
25486
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ConfirmFlagStatusComponent, { className: "ConfirmFlagStatusComponent", filePath: "lib/shared/components/palette/case-flag/components/confirm-flag-status/confirm-flag-status.component.ts", lineNumber: 17 }); })();
26023
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ConfirmFlagStatusComponent, { className: "ConfirmFlagStatusComponent", filePath: "lib/shared/components/palette/case-flag/components/confirm-flag-status/confirm-flag-status.component.ts", lineNumber: 18 }); })();
25487
26024
 
25488
26025
  class FlagFieldDisplayPipe extends AsyncPipe {
25489
26026
  translationService;
@@ -27299,7 +27836,7 @@ class CcdPageFieldsPipe {
27299
27836
  const control = dataFormGroup.controls['data'].get(key);
27300
27837
  return control['caseField'];
27301
27838
  }).filter(field => {
27302
- return !!page.case_fields.find(pcf => pcf.id === field.id);
27839
+ return field && !!page.case_fields.find(pcf => pcf.id === field.id);
27303
27840
  }).sort((a, b) => a.order - b.order);
27304
27841
  const rawValue = dataFormGroup.value;
27305
27842
  const value = page.case_fields.reduce((acc, field) => {
@@ -28831,19 +29368,6 @@ function CaseEditSubmitComponent_ccd_case_event_completion_13_Template(rf, ctx)
28831
29368
  const ctx_r1 = i0.ɵɵnextContext();
28832
29369
  i0.ɵɵproperty("eventCompletionParams", ctx_r1.caseEdit.eventCompletionParams);
28833
29370
  } }
28834
- function CaseEditSubmitComponent_button_15_Template(rf, ctx) { if (rf & 1) {
28835
- const _r8 = i0.ɵɵgetCurrentView();
28836
- i0.ɵɵelementStart(0, "button", 50);
28837
- i0.ɵɵlistener("click", function CaseEditSubmitComponent_button_15_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.previous()); });
28838
- i0.ɵɵtext(1);
28839
- i0.ɵɵpipe(2, "rpxTranslate");
28840
- i0.ɵɵelementEnd();
28841
- } if (rf & 2) {
28842
- const ctx_r1 = i0.ɵɵnextContext();
28843
- i0.ɵɵproperty("disabled", !ctx_r1.hasPrevious() || ctx_r1.caseEdit.isSubmitting);
28844
- i0.ɵɵadvance();
28845
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 2, "Previous"), " ");
28846
- } }
28847
29371
  // @dynamic
28848
29372
  class CaseEditSubmitComponent {
28849
29373
  caseEdit;
@@ -28852,7 +29376,10 @@ class CaseEditSubmitComponent {
28852
29376
  route;
28853
29377
  orderService;
28854
29378
  profileNotifier;
29379
+ multipageComponentStateService;
28855
29380
  formValidatorsService;
29381
+ caseFlagStateService;
29382
+ linkedCasesService;
28856
29383
  eventTrigger;
28857
29384
  editForm;
28858
29385
  triggerText;
@@ -28888,14 +29415,17 @@ class CaseEditSubmitComponent {
28888
29415
  // not been disabled.
28889
29416
  return this.caseEdit.isSubmitting || this.hasErrors;
28890
29417
  }
28891
- constructor(caseEdit, fieldsUtils, caseFieldService, route, orderService, profileNotifier, formValidatorsService) {
29418
+ constructor(caseEdit, fieldsUtils, caseFieldService, route, orderService, profileNotifier, multipageComponentStateService, formValidatorsService, caseFlagStateService, linkedCasesService) {
28892
29419
  this.caseEdit = caseEdit;
28893
29420
  this.fieldsUtils = fieldsUtils;
28894
29421
  this.caseFieldService = caseFieldService;
28895
29422
  this.route = route;
28896
29423
  this.orderService = orderService;
28897
29424
  this.profileNotifier = profileNotifier;
29425
+ this.multipageComponentStateService = multipageComponentStateService;
28898
29426
  this.formValidatorsService = formValidatorsService;
29427
+ this.caseFlagStateService = caseFlagStateService;
29428
+ this.linkedCasesService = linkedCasesService;
28899
29429
  }
28900
29430
  ngOnInit() {
28901
29431
  this.profileSubscription = this.profileNotifier.profile.subscribe((_) => this.profile = _);
@@ -28976,6 +29506,9 @@ class CaseEditSubmitComponent {
28976
29506
  return cloneField;
28977
29507
  }
28978
29508
  cancel() {
29509
+ if (this.caseEdit.isLinkedCasesSubmission) {
29510
+ this.linkedCasesService.resetLinkedCaseData();
29511
+ }
28979
29512
  if (this.eventTrigger.can_save_draft) {
28980
29513
  if (this.route.snapshot.queryParamMap.get(CaseEditComponent.ORIGIN_QUERY_PARAM) === 'viewDraft') {
28981
29514
  this.caseEdit.cancelled.emit({ status: CaseEditPageComponent.RESUMED_FORM_DISCARD });
@@ -29040,6 +29573,13 @@ class CaseEditSubmitComponent {
29040
29573
  return lastPage;
29041
29574
  }
29042
29575
  previous() {
29576
+ if (this.caseEdit.isCaseFlagSubmission) {
29577
+ // if we are in the caseflag journey we need to store the last page index so that the previous button on CYA will take to correct page
29578
+ this.caseFlagStateService.fieldStateToNavigate = this.caseFlagStateService.lastPageFieldState;
29579
+ }
29580
+ if (this.caseEdit.isLinkedCasesSubmission) {
29581
+ this.linkedCasesService.cameFromFinalStep = true;
29582
+ }
29043
29583
  /* istanbul ignore else */
29044
29584
  if (this.hasPrevious()) {
29045
29585
  this.navigateToPage(this.getLastPageShown().id);
@@ -29080,8 +29620,8 @@ class CaseEditSubmitComponent {
29080
29620
  }
29081
29621
  return 'Cancel';
29082
29622
  }
29083
- static ɵfac = function CaseEditSubmitComponent_Factory(t) { return new (t || CaseEditSubmitComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ProfileNotifier), i0.ɵɵdirectiveInject(FormValidatorsService)); };
29084
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditSubmitComponent, selectors: [["ccd-case-edit-submit"]], decls: 23, vars: 21, consts: [["titleBlock", ""], ["idBlock", ""], [1, "govuk-heading-l"], [4, "ngIf", "ngIfThen", "ngIfElse"], [3, "error"], [3, "callbackErrorsContext", "callbackErrorsSubject"], [1, "check-your-answers", 3, "submit", "formGroup"], [4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], [1, "form-group", "form-group-related"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["href", "javascript:void(0)", 3, "click"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["class", "text-16", 4, "ngIf"], ["aria-describedby", "check your answers table", 1, "form-table"], [4, "ngFor", "ngForOf"], [1, "text-16"], ["ccdLabelSubstitutor", "", 3, "caseField", "hidden", "formGroup", "contextFields"], ["class", "valign-top case-field-label", 4, "ngIf"], [1, "form-cell", "case-field-content"], [3, "formGroup", "topLevelFormGroup", "caseField", "context", "caseFields"], [1, "valign-top", "case-field-label"], [1, "valign-top", "check-your-answers__change", "case-field-change"], ["href", "javascript:void(0)", 3, "click", 4, "ngIf"], ["aria-describedby", "summary fields table", 1, "summary-fields"], [3, "ngSwitch"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["class", "compound-field", "ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields"], ["id", "summary-field-label"], [1, "form-cell"], [3, "formGroup", "caseField"], ["ccdLabelSubstitutor", "", 1, "compound-field", 3, "caseField", "formGroup", "contextFields"], ["colspan", "2"], [3, "formGroup", "caseField", "caseFields"], ["id", "fieldset-event", "formGroupName", "event"], [2, "display", "none"], [1, "form-group", 3, "ngClass"], ["for", "field-trigger-summary", 1, "form-label"], [1, "form-hint"], ["class", "error-message", 4, "ngIf"], ["type", "text", "id", "field-trigger-summary", "formControlName", "summary", "maxlength", "1024", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], ["for", "field-trigger-description", 1, "form-label"], ["id", "field-trigger-description", "formControlName", "description", "maxlength", "65536", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], [1, "error-message"], [3, "eventCanBeCompleted", "eventCompletionParams"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"]], template: function CaseEditSubmitComponent_Template(rf, ctx) { if (rf & 1) {
29623
+ static ɵfac = function CaseEditSubmitComponent_Factory(t) { return new (t || CaseEditSubmitComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ProfileNotifier), i0.ɵɵdirectiveInject(MultipageComponentStateService), i0.ɵɵdirectiveInject(FormValidatorsService), i0.ɵɵdirectiveInject(CaseFlagStateService), i0.ɵɵdirectiveInject(LinkedCasesService)); };
29624
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditSubmitComponent, selectors: [["ccd-case-edit-submit"]], decls: 25, vars: 24, consts: [["titleBlock", ""], ["idBlock", ""], [1, "govuk-heading-l"], [4, "ngIf", "ngIfThen", "ngIfElse"], [3, "error"], [3, "callbackErrorsContext", "callbackErrorsSubject"], [1, "check-your-answers", 3, "submit", "formGroup"], [4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], [1, "form-group", "form-group-related"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["href", "javascript:void(0)", 3, "click"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["class", "text-16", 4, "ngIf"], ["aria-describedby", "check your answers table", 1, "form-table"], [4, "ngFor", "ngForOf"], [1, "text-16"], ["ccdLabelSubstitutor", "", 3, "caseField", "hidden", "formGroup", "contextFields"], ["class", "valign-top case-field-label", 4, "ngIf"], [1, "form-cell", "case-field-content"], [3, "formGroup", "topLevelFormGroup", "caseField", "context", "caseFields"], [1, "valign-top", "case-field-label"], [1, "valign-top", "check-your-answers__change", "case-field-change"], ["href", "javascript:void(0)", 3, "click", 4, "ngIf"], ["aria-describedby", "summary fields table", 1, "summary-fields"], [3, "ngSwitch"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["class", "compound-field", "ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields"], ["id", "summary-field-label"], [1, "form-cell"], [3, "formGroup", "caseField"], ["ccdLabelSubstitutor", "", 1, "compound-field", 3, "caseField", "formGroup", "contextFields"], ["colspan", "2"], [3, "formGroup", "caseField", "caseFields"], ["id", "fieldset-event", "formGroupName", "event"], [2, "display", "none"], [1, "form-group", 3, "ngClass"], ["for", "field-trigger-summary", 1, "form-label"], [1, "form-hint"], ["class", "error-message", 4, "ngIf"], ["type", "text", "id", "field-trigger-summary", "formControlName", "summary", "maxlength", "1024", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], ["for", "field-trigger-description", 1, "form-label"], ["id", "field-trigger-description", "formControlName", "description", "maxlength", "65536", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], [1, "error-message"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditSubmitComponent_Template(rf, ctx) { if (rf & 1) {
29085
29625
  const _r1 = i0.ɵɵgetCurrentView();
29086
29626
  i0.ɵɵelementStart(0, "div")(1, "h1", 2);
29087
29627
  i0.ɵɵtext(2);
@@ -29095,24 +29635,27 @@ class CaseEditSubmitComponent {
29095
29635
  i0.ɵɵelementStart(11, "form", 6);
29096
29636
  i0.ɵɵlistener("submit", function CaseEditSubmitComponent_Template_form_submit_11_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.submit()); });
29097
29637
  i0.ɵɵtemplate(12, CaseEditSubmitComponent_div_12_Template, 4, 3, "div", 7)(13, CaseEditSubmitComponent_ccd_case_event_completion_13_Template, 1, 1, "ccd-case-event-completion", 8);
29098
- i0.ɵɵelementStart(14, "div", 9);
29099
- i0.ɵɵtemplate(15, CaseEditSubmitComponent_button_15_Template, 3, 4, "button", 10);
29100
- i0.ɵɵelementStart(16, "button", 11);
29101
- i0.ɵɵtext(17);
29102
- i0.ɵɵpipe(18, "rpxTranslate");
29638
+ i0.ɵɵelementStart(14, "div", 9)(15, "button", 10);
29639
+ i0.ɵɵlistener("click", function CaseEditSubmitComponent_Template_button_click_15_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.previous()); });
29640
+ i0.ɵɵtext(16);
29641
+ i0.ɵɵpipe(17, "rpxTranslate");
29642
+ i0.ɵɵelementEnd();
29643
+ i0.ɵɵelementStart(18, "button", 11);
29644
+ i0.ɵɵtext(19);
29645
+ i0.ɵɵpipe(20, "rpxTranslate");
29103
29646
  i0.ɵɵelementEnd()();
29104
- i0.ɵɵelementStart(19, "p", 12)(20, "a", 13);
29105
- i0.ɵɵlistener("click", function CaseEditSubmitComponent_Template_a_click_20_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.cancel()); });
29106
- i0.ɵɵtext(21);
29107
- i0.ɵɵpipe(22, "rpxTranslate");
29647
+ i0.ɵɵelementStart(21, "p", 12)(22, "a", 13);
29648
+ i0.ɵɵlistener("click", function CaseEditSubmitComponent_Template_a_click_22_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.cancel()); });
29649
+ i0.ɵɵtext(23);
29650
+ i0.ɵɵpipe(24, "rpxTranslate");
29108
29651
  i0.ɵɵelementEnd()()()();
29109
29652
  } if (rf & 2) {
29110
- const titleBlock_r9 = i0.ɵɵreference(6);
29111
- const idBlock_r10 = i0.ɵɵreference(8);
29653
+ const titleBlock_r8 = i0.ɵɵreference(6);
29654
+ const idBlock_r9 = i0.ɵɵreference(8);
29112
29655
  i0.ɵɵadvance(2);
29113
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 15, ctx.eventTrigger.name));
29656
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 16, ctx.eventTrigger.name));
29114
29657
  i0.ɵɵadvance(2);
29115
- i0.ɵɵproperty("ngIf", ctx.getCaseTitle())("ngIfThen", titleBlock_r9)("ngIfElse", idBlock_r10);
29658
+ i0.ɵɵproperty("ngIf", ctx.getCaseTitle())("ngIfThen", titleBlock_r8)("ngIfElse", idBlock_r9);
29116
29659
  i0.ɵɵadvance(5);
29117
29660
  i0.ɵɵproperty("error", ctx.caseEdit.error);
29118
29661
  i0.ɵɵadvance();
@@ -29124,22 +29667,24 @@ class CaseEditSubmitComponent {
29124
29667
  i0.ɵɵadvance();
29125
29668
  i0.ɵɵproperty("ngIf", ctx.caseEdit.isEventCompletionChecksRequired);
29126
29669
  i0.ɵɵadvance(2);
29127
- i0.ɵɵproperty("ngIf", !ctx.caseEdit.isCaseFlagSubmission);
29670
+ i0.ɵɵproperty("disabled", !ctx.hasPrevious() || ctx.caseEdit.isSubmitting);
29128
29671
  i0.ɵɵadvance();
29672
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(17, 18, "Previous"), " ");
29673
+ i0.ɵɵadvance(2);
29129
29674
  i0.ɵɵproperty("disabled", ctx.isDisabled);
29130
29675
  i0.ɵɵadvance();
29131
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(18, 17, ctx.triggerText), " ");
29676
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(20, 20, ctx.triggerText), " ");
29132
29677
  i0.ɵɵadvance(3);
29133
29678
  i0.ɵɵclassProp("disabled", ctx.caseEdit.isSubmitting);
29134
29679
  i0.ɵɵadvance();
29135
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(22, 19, ctx.getCancelText()));
29680
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(24, 22, ctx.getCancelText()));
29136
29681
  } }, styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}"] });
29137
29682
  }
29138
29683
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditSubmitComponent, [{
29139
29684
  type: Component,
29140
- args: [{ selector: 'ccd-case-edit-submit', template: "<div>\n <!-- Event trigger name -->\n <h1 class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n\n <!--Case ID or Title -->\n <div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n <ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: contextFields : editForm.controls['data']\"></ccd-markdown>\n </ng-template>\n <ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n </ng-template>\n\n <ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n <ccd-callback-errors [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\"></ccd-callback-errors>\n\n <form class=\"check-your-answers\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <div *ngIf=\"!caseEdit.isEventCompletionChecksRequired\">\n <ng-container *ngIf=\"checkYourAnswerFieldsToDisplayExists()\">\n <h2 class=\"heading-h2\">{{pageTitle | rpxTranslate }}</h2>\n <span class=\"text-16\" *ngIf=\"!caseEdit.isCaseFlagSubmission\">{{'Check the information below carefully.' | rpxTranslate}}</span>\n\n <table class=\"form-table\" aria-describedby=\"check your answers table\">\n <tbody>\n <ng-container *ngFor=\"let page of wizard.pages\">\n <ng-container *ngIf=\"isShown(page)\">\n <ng-container *ngFor=\"let field of page\n | ccdPageFields: editForm\n | ccdReadFieldsFilter: false :undefined :true :allFieldsValues\n | ccdCYAPageLabelFilter\">\n <ng-container *ngIf=\"canShowFieldInCYA(field)\">\n <tr ccdLabelSubstitutor [caseField]=\"field\" [hidden]=\"field.hidden\"\n [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th *ngIf=\"!isLabel(field) && !caseEdit.isCaseFlagSubmission\" class=\"valign-top case-field-label\">\n <span class=\"text-16\">{{field.label | rpxTranslate}}</span>\n </th>\n <td class=\"form-cell case-field-content\" [attr.colspan]=\"isLabel(field) ? '2' : '1'\">\n <ccd-field-read\n [formGroup]=\"editForm.controls['data']\" [topLevelFormGroup]=\"editForm.controls['data']\"\n [caseField]=\"summaryCaseField(field)\" [context]=\"paletteContext\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n <ng-container *ngIf=\"!caseEdit.isCaseFlagSubmission\">\n <td class=\"valign-top check-your-answers__change case-field-change\">\n <a *ngIf=\"isChangeAllowed(field)\" (click)=\"navigateToPage(page.id)\"\n href=\"javascript:void(0)\">\n <span class=\"text-16\" attr.aria-label=\"{{'Change' | rpxTranslate}} {{ field.label | rpxTranslate }}\">\n {{'Change' | rpxTranslate}}\n </span>\n </a>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"readOnlySummaryFieldsToDisplayExists()\">\n\n <table class=\"summary-fields\" aria-describedby=\"summary fields table\">\n <tbody>\n <ng-container *ngFor=\"let field of showSummaryFields\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th id=\"summary-field-label\">{{field.label}}</th>\n <td class=\"form-cell\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <td colspan=\"2\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"showEventNotes()\">\n <fieldset id=\"fieldset-event\" formGroupName=\"event\">\n <legend style=\"display: none;\"></legend>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!summary && !summary.valid && (summary.dirty || summary.touched)}\">\n <label for=\"field-trigger-summary\" class=\"form-label\">\n Event summary (optional)\n <span class=\"form-hint\">A few words describing the purpose of the event.</span>\n </label>\n <span class=\"error-message\" *ngIf=\"summary?.errors && (summary.dirty || summary.touched)\">\n {{summary.errors | ccdFirstError: eventSummaryLabel | rpxTranslate}}\n </span>\n <input type=\"text\" id=\"field-trigger-summary\" class=\"form-control bottom-30 width-50\"\n [ngClass]=\"{'govuk-input--error': summary?.errors && (summary.dirty || summary.touched)}\" formControlName=\"summary\" maxlength=\"1024\">\n </div>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!description && !description.valid && (description.dirty || description.touched)}\">\n <label for=\"field-trigger-description\" class=\"form-label\">Event description (optional)</label>\n <span class=\"error-message\" *ngIf=\"description?.errors && (description.dirty || description.touched)\">\n {{description.errors | ccdFirstError: eventDescriptionLabel | rpxTranslate}}\n </span>\n <textarea id=\"field-trigger-description\" class=\"form-control bottom-30 width-50\" formControlName=\"description\"\n [ngClass]=\"{'govuk-input--error': description?.errors && (description.dirty || description.touched)}\" maxlength=\"65536\"></textarea>\n </div>\n </fieldset>\n </ng-container>\n </div>\n <ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n </ccd-case-event-completion>\n <div class=\"form-group form-group-related\">\n <button *ngIf=\"!caseEdit.isCaseFlagSubmission\" class=\"button button-secondary\" type=\"button\" [disabled]=\"!hasPrevious() || caseEdit.isSubmitting\" (click)=\"previous()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button type=\"submit\" [disabled]=\"isDisabled\" class=\"button\">\n {{triggerText | rpxTranslate}}\n </button>\n </div>\n <p class=\"cancel\">\n <a (click)=\"cancel()\" href=\"javascript:void(0)\" [class.disabled]=\"caseEdit.isSubmitting\">{{getCancelText() | rpxTranslate}}</a>\n </p>\n </form>\n</div>\n\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
29141
- }], () => [{ type: CaseEditComponent }, { type: FieldsUtils }, { type: CaseFieldService }, { type: i1$1.ActivatedRoute }, { type: OrderService }, { type: ProfileNotifier }, { type: FormValidatorsService }], null); })();
29142
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditSubmitComponent, { className: "CaseEditSubmitComponent", filePath: "lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.ts", lineNumber: 27 }); })();
29685
+ args: [{ selector: 'ccd-case-edit-submit', template: "<div>\n <!-- Event trigger name -->\n <h1 class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n\n <!--Case ID or Title -->\n <div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n <ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: contextFields : editForm.controls['data']\"></ccd-markdown>\n </ng-template>\n <ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n </ng-template>\n\n <ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n <ccd-callback-errors [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\"></ccd-callback-errors>\n\n <form class=\"check-your-answers\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <div *ngIf=\"!caseEdit.isEventCompletionChecksRequired\">\n <ng-container *ngIf=\"checkYourAnswerFieldsToDisplayExists()\">\n <h2 class=\"heading-h2\">{{pageTitle | rpxTranslate }}</h2>\n <span class=\"text-16\" *ngIf=\"!caseEdit.isCaseFlagSubmission\">{{'Check the information below carefully.' | rpxTranslate}}</span>\n\n <table class=\"form-table\" aria-describedby=\"check your answers table\">\n <tbody>\n <ng-container *ngFor=\"let page of wizard.pages\">\n <ng-container *ngIf=\"isShown(page)\">\n <ng-container *ngFor=\"let field of page\n | ccdPageFields: editForm\n | ccdReadFieldsFilter: false :undefined :true :allFieldsValues\n | ccdCYAPageLabelFilter\">\n <ng-container *ngIf=\"canShowFieldInCYA(field)\">\n <tr ccdLabelSubstitutor [caseField]=\"field\" [hidden]=\"field.hidden\"\n [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th *ngIf=\"!isLabel(field) && !caseEdit.isCaseFlagSubmission\" class=\"valign-top case-field-label\">\n <span class=\"text-16\">{{field.label | rpxTranslate}}</span>\n </th>\n <td class=\"form-cell case-field-content\" [attr.colspan]=\"isLabel(field) ? '2' : '1'\">\n <ccd-field-read\n [formGroup]=\"editForm.controls['data']\" [topLevelFormGroup]=\"editForm.controls['data']\"\n [caseField]=\"summaryCaseField(field)\" [context]=\"paletteContext\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n <ng-container *ngIf=\"!caseEdit.isCaseFlagSubmission\">\n <td class=\"valign-top check-your-answers__change case-field-change\">\n <a *ngIf=\"isChangeAllowed(field)\" (click)=\"navigateToPage(page.id)\"\n href=\"javascript:void(0)\">\n <span class=\"text-16\" attr.aria-label=\"{{'Change' | rpxTranslate}} {{ field.label | rpxTranslate }}\">\n {{'Change' | rpxTranslate}}\n </span>\n </a>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"readOnlySummaryFieldsToDisplayExists()\">\n\n <table class=\"summary-fields\" aria-describedby=\"summary fields table\">\n <tbody>\n <ng-container *ngFor=\"let field of showSummaryFields\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th id=\"summary-field-label\">{{field.label}}</th>\n <td class=\"form-cell\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <td colspan=\"2\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"showEventNotes()\">\n <fieldset id=\"fieldset-event\" formGroupName=\"event\">\n <legend style=\"display: none;\"></legend>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!summary && !summary.valid && (summary.dirty || summary.touched)}\">\n <label for=\"field-trigger-summary\" class=\"form-label\">\n Event summary (optional)\n <span class=\"form-hint\">A few words describing the purpose of the event.</span>\n </label>\n <span class=\"error-message\" *ngIf=\"summary?.errors && (summary.dirty || summary.touched)\">\n {{summary.errors | ccdFirstError: eventSummaryLabel | rpxTranslate}}\n </span>\n <input type=\"text\" id=\"field-trigger-summary\" class=\"form-control bottom-30 width-50\"\n [ngClass]=\"{'govuk-input--error': summary?.errors && (summary.dirty || summary.touched)}\" formControlName=\"summary\" maxlength=\"1024\">\n </div>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!description && !description.valid && (description.dirty || description.touched)}\">\n <label for=\"field-trigger-description\" class=\"form-label\">Event description (optional)</label>\n <span class=\"error-message\" *ngIf=\"description?.errors && (description.dirty || description.touched)\">\n {{description.errors | ccdFirstError: eventDescriptionLabel | rpxTranslate}}\n </span>\n <textarea id=\"field-trigger-description\" class=\"form-control bottom-30 width-50\" formControlName=\"description\"\n [ngClass]=\"{'govuk-input--error': description?.errors && (description.dirty || description.touched)}\" maxlength=\"65536\"></textarea>\n </div>\n </fieldset>\n </ng-container>\n </div>\n <ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n </ccd-case-event-completion>\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" [disabled]=\"!hasPrevious() || caseEdit.isSubmitting\" (click)=\"previous()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button type=\"submit\" [disabled]=\"isDisabled\" class=\"button\">\n {{triggerText | rpxTranslate}}\n </button>\n </div>\n <p class=\"cancel\">\n <a (click)=\"cancel()\" href=\"javascript:void(0)\" [class.disabled]=\"caseEdit.isSubmitting\">{{getCancelText() | rpxTranslate}}</a>\n </p>\n </form>\n</div>\n\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
29686
+ }], () => [{ type: CaseEditComponent }, { type: FieldsUtils }, { type: CaseFieldService }, { type: i1$1.ActivatedRoute }, { type: OrderService }, { type: ProfileNotifier }, { type: MultipageComponentStateService }, { type: FormValidatorsService }, { type: CaseFlagStateService }, { type: LinkedCasesService }], null); })();
29687
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditSubmitComponent, { className: "CaseEditSubmitComponent", filePath: "lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.ts", lineNumber: 30 }); })();
29143
29688
 
29144
29689
  function CaseProgressComponent_div_0_Template(rf, ctx) { if (rf & 1) {
29145
29690
  const _r1 = i0.ɵɵgetCurrentView();
@@ -29387,7 +29932,8 @@ class CaseEditorModule {
29387
29932
  SessionStorageService,
29388
29933
  EventCompletionStateMachineService,
29389
29934
  CaseFlagStateService,
29390
- ValidPageListCaseFieldsService
29935
+ ValidPageListCaseFieldsService,
29936
+ MultipageComponentStateService
29391
29937
  ], imports: [CommonModule,
29392
29938
  RouterModule,
29393
29939
  FormsModule,
@@ -29469,7 +30015,8 @@ class CaseEditorModule {
29469
30015
  SessionStorageService,
29470
30016
  EventCompletionStateMachineService,
29471
30017
  CaseFlagStateService,
29472
- ValidPageListCaseFieldsService
30018
+ ValidPageListCaseFieldsService,
30019
+ MultipageComponentStateService
29473
30020
  ]
29474
30021
  }]
29475
30022
  }], null, null); })();
@@ -29501,7 +30048,7 @@ class CaseEditorModule {
29501
30048
  CallbackErrorsComponent] }); })();
29502
30049
  i0.ɵɵsetComponentScope(CaseEditConfirmComponent, function () { return [i5.NgIf, i4.ɵNgNoValidate, i4.NgControlStatusGroup, i4.FormGroupDirective, MarkdownComponent]; }, function () { return [CaseReferencePipe, CcdCaseTitlePipe, i1.RpxTranslatePipe]; });
29503
30050
  i0.ɵɵsetComponentScope(CaseEditPageComponent, function () { return [i5.NgForOf, i5.NgIf, i4.ɵNgNoValidate, i4.NgControlStatusGroup, i4.FormGroupDirective, CallbackErrorsComponent, MarkdownComponent, CaseEventCompletionComponent, CaseEditFormComponent,
29504
- CaseEditGenericErrorsComponent]; }, function () { return [i5.AsyncPipe, CaseReferencePipe, CcdCaseTitlePipe, i1.RpxTranslatePipe]; });
30051
+ CaseEditGenericErrorsComponent]; }, function () { return [CaseReferencePipe, CcdCaseTitlePipe, i1.RpxTranslatePipe]; });
29505
30052
  i0.ɵɵsetComponentScope(CaseEditFormComponent, function () { return [i5.NgForOf, i5.NgIf, i5.NgSwitch, i5.NgSwitchCase, i4.NgControlStatusGroup, i4.FormGroupDirective, LabelSubstitutorDirective, ConditionalShowFormDirective, FieldReadComponent, FieldWriteComponent]; }, function () { return [IsCompoundPipe, IsReadOnlyAndNotCollectionPipe]; });
29506
30053
  i0.ɵɵsetComponentScope(CaseEditSubmitComponent, function () { return [i5.NgClass, i5.NgForOf, i5.NgIf, i5.NgSwitch, i5.NgSwitchCase, i4.ɵNgNoValidate, i4.DefaultValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.MaxLengthValidator, i4.FormGroupDirective, i4.FormControlName, i4.FormGroupName, LabelSubstitutorDirective, CallbackErrorsComponent, MarkdownComponent, FieldReadComponent, CaseEventCompletionComponent, CaseEditGenericErrorsComponent]; }, function () { return [FirstErrorPipe, IsCompoundPipe, CaseReferencePipe, CcdCaseTitlePipe, CcdCYAPageLabelFilterPipe, ReadFieldsFilterPipe, CcdPageFieldsPipe, i1.RpxTranslatePipe]; });
29507
30054
  i0.ɵɵsetComponentScope(CaseCreateComponent, function () { return [i5.NgIf, CaseEditComponent]; }, []);
@@ -31639,6 +32186,7 @@ class CaseEventTriggerComponent {
31639
32186
  activitySubscription;
31640
32187
  caseSubscription;
31641
32188
  parentUrl;
32189
+ routerCurrentNavigation;
31642
32190
  constructor(ngZone, casesService, caseNotifier, router, alertService, route, caseReferencePipe, activityPollingService, sessionStorageService) {
31643
32191
  this.ngZone = ngZone;
31644
32192
  this.casesService = casesService;
@@ -31649,6 +32197,7 @@ class CaseEventTriggerComponent {
31649
32197
  this.caseReferencePipe = caseReferencePipe;
31650
32198
  this.activityPollingService = activityPollingService;
31651
32199
  this.sessionStorageService = sessionStorageService;
32200
+ this.routerCurrentNavigation = this.router.getCurrentNavigation();
31652
32201
  }
31653
32202
  ngOnInit() {
31654
32203
  if (this.route.snapshot.data.case) {
@@ -31727,8 +32276,16 @@ class CaseEventTriggerComponent {
31727
32276
  });
31728
32277
  }
31729
32278
  cancel() {
31730
- if (this.router.url && this.router.url.includes('linkCases')) {
31731
- this.router.navigate(['cases', 'case-details', this.caseDetails.case_id], { fragment: 'Linked cases' });
32279
+ const previousUrl = this.routerCurrentNavigation?.previousNavigation?.finalUrl?.toString();
32280
+ if (previousUrl) {
32281
+ if (previousUrl.indexOf('#') > -1) {
32282
+ const url = previousUrl.split('#')[0];
32283
+ const fragment = previousUrl.split('#')[1].replace('%20', ' ');
32284
+ return this.router.navigate([url], { fragment: fragment });
32285
+ }
32286
+ else {
32287
+ return this.router.navigate([previousUrl]);
32288
+ }
31732
32289
  }
31733
32290
  else {
31734
32291
  return this.router.navigate([this.parentUrl]);
@@ -37266,5 +37823,5 @@ class TestRouteSnapshotBuilder {
37266
37823
  * Generated bundle index. Do not edit.
37267
37824
  */
37268
37825
 
37269
- export { AbstractAppConfig, AbstractFieldReadComponent, AbstractFieldWriteComponent, 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, 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, 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, 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, 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, QualifyingQuestionsErrorMessage, QueryAttachmentsReadComponent, QueryCaseDetailsHeaderComponent, QueryCheckYourAnswersComponent, QueryCreateContext, QueryDetailsComponent, QueryEventCompletionComponent, QueryItemResponseStatus, QueryListComponent, QueryListData, QueryListItem, QueryWriteAddDocumentsComponent, QueryWriteDateInputComponent, QueryWriteRaiseQueryComponent, QueryWriteRespondToQueryComponent, RaiseQueryErrorMessage, ReadCaseFlagFieldComponent, ReadCaseLinkFieldComponent, ReadCollectionFieldComponent, ReadComplexFieldCollectionTableComponent, ReadComplexFieldComponent, ReadComplexFieldRawComponent, ReadComplexFieldTableComponent, ReadDateFieldComponent, ReadDocumentFieldComponent, ReadDynamicListFieldComponent, ReadDynamicMultiSelectListFieldComponent, ReadDynamicRadioListFieldComponent, ReadEmailFieldComponent, ReadFieldsFilterPipe, ReadFixedListFieldComponent, ReadFixedRadioListFieldComponent, ReadJudicialUserFieldComponent, ReadLinkedCasesFieldComponent, ReadMoneyGbpFieldComponent, ReadMultiSelectListFieldComponent, ReadNumberFieldComponent, ReadOrderSummaryFieldComponent, ReadOrderSummaryRowComponent, ReadOrganisationFieldComponent, ReadOrganisationFieldRawComponent, ReadOrganisationFieldTableComponent, ReadPhoneUKFieldComponent, ReadQueryManagementFieldComponent, 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, SessionStorageService, ShowCondition, SortOrder$1 as SortOrder, SortParameters, SortSearchResultPipe, TabComponent, TableColumnConfig, TableConfig, TabsComponent, TabsModule, TaskAssignedComponent, TaskCancelledComponent, TaskConflictComponent, TaskUnassignedComponent, Terms, TestRouteSnapshotBuilder, 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, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, caseMessagesMockData, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, textFieldType, viewerRouting };
37826
+ 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, 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, 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, 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, QualifyingQuestionsErrorMessage, QueryAttachmentsReadComponent, QueryCaseDetailsHeaderComponent, QueryCheckYourAnswersComponent, QueryCreateContext, QueryDetailsComponent, QueryEventCompletionComponent, QueryItemResponseStatus, QueryListComponent, QueryListData, QueryListItem, QueryWriteAddDocumentsComponent, QueryWriteDateInputComponent, QueryWriteRaiseQueryComponent, QueryWriteRespondToQueryComponent, RaiseQueryErrorMessage, ReadCaseFlagFieldComponent, ReadCaseLinkFieldComponent, ReadCollectionFieldComponent, ReadComplexFieldCollectionTableComponent, ReadComplexFieldComponent, ReadComplexFieldRawComponent, ReadComplexFieldTableComponent, ReadDateFieldComponent, ReadDocumentFieldComponent, ReadDynamicListFieldComponent, ReadDynamicMultiSelectListFieldComponent, ReadDynamicRadioListFieldComponent, ReadEmailFieldComponent, ReadFieldsFilterPipe, ReadFixedListFieldComponent, ReadFixedRadioListFieldComponent, ReadJudicialUserFieldComponent, ReadLinkedCasesFieldComponent, ReadMoneyGbpFieldComponent, ReadMultiSelectListFieldComponent, ReadNumberFieldComponent, ReadOrderSummaryFieldComponent, ReadOrderSummaryRowComponent, ReadOrganisationFieldComponent, ReadOrganisationFieldRawComponent, ReadOrganisationFieldTableComponent, ReadPhoneUKFieldComponent, ReadQueryManagementFieldComponent, 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, SessionStorageService, ShowCondition, SortOrder$1 as SortOrder, SortParameters, SortSearchResultPipe, TabComponent, TableColumnConfig, TableConfig, TabsComponent, TabsModule, TaskAssignedComponent, TaskCancelledComponent, TaskConflictComponent, TaskUnassignedComponent, Terms, TestRouteSnapshotBuilder, 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, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, caseMessagesMockData, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, textFieldType, viewerRouting };
37270
37827
  //# sourceMappingURL=hmcts-ccd-case-ui-toolkit.mjs.map