@veloceapps/sdk 11.0.0-12 → 11.0.0-121

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 (160) hide show
  1. package/cms/cms.actions.d.ts +94 -29
  2. package/cms/components/element-renderer/element-renderer.component.d.ts +3 -10
  3. package/cms/components/preview/preview.component.d.ts +5 -6
  4. package/cms/components/preview/preview.types.d.ts +0 -4
  5. package/cms/services/element-context.service.d.ts +0 -1
  6. package/cms/types/common.types.d.ts +2 -0
  7. package/cms/types/index.d.ts +0 -1
  8. package/cms/utils/path.utils.d.ts +1 -2
  9. package/cms/vendor-map.d.ts +17 -40
  10. package/core/index.d.ts +1 -1
  11. package/core/modules/configuration/index.d.ts +4 -4
  12. package/core/modules/configuration/services/configuration-runtime.service.d.ts +8 -17
  13. package/core/modules/configuration/services/configuration-state.service.d.ts +3 -3
  14. package/core/modules/configuration/services/configuration.service.d.ts +24 -47
  15. package/core/modules/configuration/services/guided-selling.service.d.ts +15 -0
  16. package/core/modules/configuration/services/test-mode-configuration.service.d.ts +26 -0
  17. package/core/modules/configuration/types/configuration-runtime.types.d.ts +0 -5
  18. package/core/modules/configuration/types/configuration.types.d.ts +4 -2
  19. package/core/modules/configuration/types/index.d.ts +2 -0
  20. package/core/modules/flow-configuration/index.d.ts +0 -3
  21. package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +11 -17
  22. package/core/operators/filter-successful-execute.operator.d.ts +3 -0
  23. package/core/operators/index.d.ts +1 -0
  24. package/core/services/flow-info.service.d.ts +7 -5
  25. package/core/services/flow-state-configuration.service.d.ts +9 -8
  26. package/core/services/flow-state.service.d.ts +6 -15
  27. package/core/services/index.d.ts +1 -1
  28. package/core/services/integration.state.d.ts +1 -1
  29. package/core/services/product-images.service.d.ts +3 -3
  30. package/core/services/runtime-settings.service.d.ts +1 -1
  31. package/core/services/sales-transaction.service.d.ts +9 -10
  32. package/core/types/flow-customization.types.d.ts +2 -2
  33. package/core/types/index.d.ts +0 -1
  34. package/core/utils/index.d.ts +2 -2
  35. package/core/utils/transaction-item.utils.d.ts +7 -0
  36. package/core/utils/transaction-item.worker.d.ts +8 -0
  37. package/esm2020/cms/cms.actions.mjs +93 -71
  38. package/esm2020/cms/cms.default.mjs +2 -3
  39. package/esm2020/cms/components/element-renderer/element-renderer.component.mjs +7 -64
  40. package/esm2020/cms/components/element-tools-panel/element-tools-panel.component.mjs +3 -3
  41. package/esm2020/cms/components/preview/preview.component.mjs +19 -28
  42. package/esm2020/cms/components/preview/preview.types.mjs +1 -1
  43. package/esm2020/cms/services/element-context.service.mjs +1 -1
  44. package/esm2020/cms/types/common.types.mjs +1 -1
  45. package/esm2020/cms/types/index.mjs +1 -2
  46. package/esm2020/cms/utils/element.utils.mjs +3 -3
  47. package/esm2020/cms/utils/elements-resolver.mjs +16 -5
  48. package/esm2020/cms/utils/path.utils.mjs +1 -10
  49. package/esm2020/cms/vendor-map.mjs +17 -18
  50. package/esm2020/core/core.module.mjs +3 -6
  51. package/esm2020/core/index.mjs +2 -2
  52. package/esm2020/core/modules/configuration/configuration.module.mjs +17 -4
  53. package/esm2020/core/modules/configuration/index.mjs +5 -5
  54. package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +16 -64
  55. package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +58 -58
  56. package/esm2020/core/modules/configuration/services/configuration.service.mjs +125 -229
  57. package/esm2020/core/modules/configuration/services/guided-selling.service.mjs +62 -0
  58. package/esm2020/core/modules/configuration/services/test-mode-configuration.service.mjs +97 -0
  59. package/esm2020/core/modules/configuration/types/configuration-runtime.types.mjs +1 -1
  60. package/esm2020/core/modules/configuration/types/configuration.types.mjs +1 -1
  61. package/esm2020/core/modules/configuration/types/index.mjs +3 -0
  62. package/esm2020/core/modules/flow-configuration/flow-configuration.module.mjs +3 -4
  63. package/esm2020/core/modules/flow-configuration/index.mjs +1 -4
  64. package/esm2020/core/modules/flow-configuration/services/flow-configuration.service.mjs +31 -39
  65. package/esm2020/core/operators/filter-successful-execute.operator.mjs +5 -0
  66. package/esm2020/core/operators/index.mjs +2 -0
  67. package/esm2020/core/services/flow-info.service.mjs +20 -11
  68. package/esm2020/core/services/flow-state-configuration.service.mjs +55 -25
  69. package/esm2020/core/services/flow-state.service.mjs +34 -82
  70. package/esm2020/core/services/index.mjs +2 -2
  71. package/esm2020/core/services/integration.state.mjs +2 -2
  72. package/esm2020/core/services/product-images.service.mjs +8 -8
  73. package/esm2020/core/services/runtime-settings.service.mjs +3 -3
  74. package/esm2020/core/services/sales-transaction.service.mjs +18 -13
  75. package/esm2020/core/types/flow-customization.types.mjs +1 -1
  76. package/esm2020/core/types/index.mjs +1 -2
  77. package/esm2020/core/utils/index.mjs +3 -3
  78. package/esm2020/core/utils/transaction-item.utils.mjs +60 -0
  79. package/esm2020/core/utils/transaction-item.worker.mjs +16 -0
  80. package/esm2020/src/components/flow-header/flow-header.component.mjs +7 -8
  81. package/esm2020/src/components/guided-selling/guided-selling.component.mjs +7 -8
  82. package/esm2020/src/flow-routing.module.mjs +10 -8
  83. package/esm2020/src/guards/flow.guard.mjs +5 -7
  84. package/esm2020/src/guards/product-unload.guard.mjs +7 -7
  85. package/esm2020/src/index.mjs +1 -2
  86. package/esm2020/src/pages/assets/assets.component.mjs +7 -8
  87. package/esm2020/src/pages/catalog/catalog.component.mjs +7 -8
  88. package/esm2020/src/pages/debug/debug.component.mjs +12 -17
  89. package/esm2020/src/pages/product/product.component.mjs +16 -70
  90. package/esm2020/src/pages/record-not-found/record-not-found.component.mjs +5 -6
  91. package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +7 -8
  92. package/esm2020/src/resolvers/pcm-model.resolver.mjs +12 -0
  93. package/esm2020/src/resolvers/sales-transaction.resolver.mjs +64 -0
  94. package/esm2020/src/resolvers/ui-definition.resolver.mjs +44 -0
  95. package/esm2020/src/services/flow-dialog.service.mjs +3 -24
  96. package/esm2020/src/services/flow-router.service.mjs +17 -24
  97. package/esm2020/src/services/flow.service.mjs +11 -17
  98. package/esm2020/src/types/index.mjs +2 -3
  99. package/esm2020/src/types/route.types.mjs +1 -1
  100. package/fesm2015/veloceapps-sdk-cms.mjs +162 -309
  101. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  102. package/fesm2015/veloceapps-sdk-core.mjs +571 -1166
  103. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  104. package/fesm2015/veloceapps-sdk.mjs +161 -242
  105. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  106. package/fesm2020/veloceapps-sdk-cms.mjs +158 -300
  107. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  108. package/fesm2020/veloceapps-sdk-core.mjs +631 -1197
  109. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  110. package/fesm2020/veloceapps-sdk.mjs +161 -239
  111. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  112. package/package.json +1 -1
  113. package/src/components/flow-header/flow-header.component.d.ts +3 -3
  114. package/src/components/guided-selling/guided-selling.component.d.ts +3 -3
  115. package/src/guards/product-unload.guard.d.ts +3 -3
  116. package/src/index.d.ts +0 -1
  117. package/src/pages/assets/assets.component.d.ts +3 -3
  118. package/src/pages/catalog/catalog.component.d.ts +3 -3
  119. package/src/pages/debug/debug.component.d.ts +2 -4
  120. package/src/pages/product/product.component.d.ts +5 -12
  121. package/src/pages/record-not-found/record-not-found.component.d.ts +2 -3
  122. package/src/pages/shopping-cart/shopping-cart.component.d.ts +3 -3
  123. package/src/resolvers/pcm-model.resolver.d.ts +3 -0
  124. package/src/resolvers/sales-transaction.resolver.d.ts +18 -0
  125. package/src/resolvers/ui-definition.resolver.d.ts +3 -0
  126. package/src/services/flow-dialog.service.d.ts +3 -5
  127. package/src/services/flow-router.service.d.ts +5 -5
  128. package/src/services/flow.service.d.ts +3 -3
  129. package/src/types/index.d.ts +1 -2
  130. package/src/types/route.types.d.ts +0 -5
  131. package/cms/plugins/configuration.plugin.d.ts +0 -23
  132. package/cms/types/configuration.types.d.ts +0 -21
  133. package/core/modules/configuration/helpers.d.ts +0 -7
  134. package/core/modules/configuration/services/runtime-context.service.d.ts +0 -12
  135. package/core/modules/flow-configuration/services/flow-update.service.d.ts +0 -13
  136. package/core/modules/flow-configuration/types/update.types.d.ts +0 -12
  137. package/core/services/quote-draft.service.d.ts +0 -50
  138. package/core/types/runtime.types.d.ts +0 -30
  139. package/core/utils/line-item.utils.d.ts +0 -25
  140. package/core/utils/line-item.worker.d.ts +0 -9
  141. package/esm2020/cms/plugins/configuration.plugin.mjs +0 -109
  142. package/esm2020/cms/types/configuration.types.mjs +0 -2
  143. package/esm2020/core/modules/configuration/helpers.mjs +0 -67
  144. package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +0 -45
  145. package/esm2020/core/modules/flow-configuration/services/flow-update.service.mjs +0 -138
  146. package/esm2020/core/modules/flow-configuration/types/update.types.mjs +0 -2
  147. package/esm2020/core/services/quote-draft.service.mjs +0 -174
  148. package/esm2020/core/types/runtime.types.mjs +0 -16
  149. package/esm2020/core/utils/line-item.utils.mjs +0 -187
  150. package/esm2020/core/utils/line-item.worker.mjs +0 -19
  151. package/esm2020/src/resolvers/quote.resolver.mjs +0 -82
  152. package/esm2020/src/types/context-route.types.mjs +0 -2
  153. package/esm2020/src/types/metrics.types.mjs +0 -2
  154. package/esm2020/src/utils/flow.utils.mjs +0 -14
  155. package/esm2020/src/utils/index.mjs +0 -2
  156. package/src/resolvers/quote.resolver.d.ts +0 -18
  157. package/src/types/context-route.types.d.ts +0 -5
  158. package/src/types/metrics.types.d.ts +0 -5
  159. package/src/utils/flow.utils.d.ts +0 -1
  160. package/src/utils/index.d.ts +0 -1
@@ -2,30 +2,30 @@ import * as i4 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
4
  import { Component, ChangeDetectionStrategy, NgModule, Optional, Inject, Injectable, inject } from '@angular/core';
5
- import * as i1$3 from '@veloceapps/api';
6
5
  import { ApiModule } from '@veloceapps/api';
7
- import * as i2$1 from '@veloceapps/components';
6
+ import * as i2 from '@veloceapps/components';
8
7
  import { ToastType, LoaderModule, LetDirectiveModule } from '@veloceapps/components';
9
8
  import * as i5 from '@veloceapps/sdk/cms';
10
9
  import { btoaSafe, PreviewModule, FlowAction, LauncherModule } from '@veloceapps/sdk/cms';
11
- import * as i2 from '@veloceapps/sdk/core';
12
- import { FLOW_CUSTOMIZATION, RuntimeSettingsService, FlowStateService, FlowInfoService, QuoteDraftService, SalesTransactionService, ConfigurationService, IntegrationState, SdkCoreModule } from '@veloceapps/sdk/core';
10
+ import * as i3$1 from '@veloceapps/sdk/core';
11
+ import { FLOW_CUSTOMIZATION, RuntimeSettingsService, FlowStateService, FlowInfoService, SalesTransactionService, ConfigurationService, IntegrationState, ConfigurationRuntimeService, SdkCoreModule } from '@veloceapps/sdk/core';
13
12
  import * as i3 from 'primeng/button';
14
13
  import { ButtonModule } from 'primeng/button';
15
14
  import * as i1 from 'primeng/dynamicdialog';
16
15
  import * as i1$1 from '@veloceapps/api/v2';
17
- import { BehaviorSubject, Subject, filter, first, tap, takeUntil, catchError, of, map, switchMap, shareReplay, startWith, distinctUntilChanged, from, take, combineLatest, timer, noop } from 'rxjs';
16
+ import { UIDefinitionsAdminApiService } from '@veloceapps/api/v2';
17
+ import { BehaviorSubject, Subject, filter, first, tap, takeUntil, catchError, of, map, switchMap, shareReplay, startWith, distinctUntilChanged, from, take, combineLatest } from 'rxjs';
18
18
  import { DomHandler } from 'primeng/dom';
19
19
  import * as i1$2 from '@angular/router';
20
20
  import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
21
- import { mapShoppingCartSettings, getMaxRenewalTermsValue, UITemplateType, SalesforceIdUtils, isVeloceError, extractErrorDetails, ConfigurationContextMode } from '@veloceapps/core';
21
+ import { mapShoppingCartSettings, getMaxRenewalTermsValue, SalesforceIdUtils, UITemplateType, isVeloceError, extractErrorDetails } from '@veloceapps/core';
22
22
  import { HttpErrorResponse, HttpParams } from '@angular/common/http';
23
- import * as i5$1 from '@angular/forms';
23
+ import * as i4$1 from '@angular/forms';
24
24
  import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
25
25
  import { DropdownModule } from 'primeng/dropdown';
26
- import * as i8 from 'primeng/inputtext';
26
+ import * as i7 from 'primeng/inputtext';
27
27
  import { InputTextModule } from 'primeng/inputtext';
28
- import * as i6 from 'primeng/radiobutton';
28
+ import * as i5$1 from 'primeng/radiobutton';
29
29
  import { RadioButtonModule } from 'primeng/radiobutton';
30
30
  import { catchError as catchError$1 } from 'rxjs/operators';
31
31
 
@@ -76,8 +76,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
76
76
  }] });
77
77
 
78
78
  class FlowHeaderComponent {
79
- constructor(templatesApi, flowStateService, flowInfo, toastService, customizationService) {
80
- this.templatesApi = templatesApi;
79
+ constructor(templatesAdminApiService, flowStateService, flowInfo, toastService, customizationService) {
80
+ this.templatesAdminApiService = templatesAdminApiService;
81
81
  this.flowStateService = flowStateService;
82
82
  this.flowInfo = flowInfo;
83
83
  this.toastService = toastService;
@@ -131,7 +131,7 @@ class FlowHeaderComponent {
131
131
  if (!template) {
132
132
  return of(undefined);
133
133
  }
134
- return this.templatesApi.fetchComponentsAttachments$(template.id);
134
+ return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
135
135
  }
136
136
  generateUIDefinition$() {
137
137
  return of(undefined).pipe(tap(() => {
@@ -145,7 +145,6 @@ class FlowHeaderComponent {
145
145
  const uiDef = {
146
146
  name: '',
147
147
  createdTimestamp: 0,
148
- primary: true,
149
148
  type: 'DEFAULT',
150
149
  version: 2,
151
150
  children: metaList.map(meta => ({
@@ -159,12 +158,12 @@ class FlowHeaderComponent {
159
158
  }));
160
159
  }
161
160
  }
162
- FlowHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, deps: [{ token: i1$1.UITemplatesApiService }, { token: i2.FlowStateService }, { token: i2.FlowInfoService }, { token: i2$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
161
+ FlowHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i3$1.FlowStateService }, { token: i3$1.FlowInfoService }, { token: i2.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
163
162
  FlowHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowHeaderComponent, selector: "vl-flow-new-header", ngImport: i0, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
164
163
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, decorators: [{
165
164
  type: Component,
166
165
  args: [{ selector: 'vl-flow-new-header', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"] }]
167
- }], ctorParameters: function () { return [{ type: i1$1.UITemplatesApiService }, { type: i2.FlowStateService }, { type: i2.FlowInfoService }, { type: i2$1.ToastService }, { type: undefined, decorators: [{
166
+ }], ctorParameters: function () { return [{ type: i1$1.UITemplatesAdminApiService }, { type: i3$1.FlowStateService }, { type: i3$1.FlowInfoService }, { type: i2.ToastService }, { type: undefined, decorators: [{
168
167
  type: Optional
169
168
  }, {
170
169
  type: Inject,
@@ -186,8 +185,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
186
185
  }] });
187
186
 
188
187
  class GuidedSellingComponent {
189
- constructor(templatesApi, flowStateService, flowInfo, toastService, customizationService) {
190
- this.templatesApi = templatesApi;
188
+ constructor(templatesAdminApiService, flowStateService, flowInfo, toastService, customizationService) {
189
+ this.templatesAdminApiService = templatesAdminApiService;
191
190
  this.flowStateService = flowStateService;
192
191
  this.flowInfo = flowInfo;
193
192
  this.toastService = toastService;
@@ -241,7 +240,7 @@ class GuidedSellingComponent {
241
240
  if (!template) {
242
241
  return of(undefined);
243
242
  }
244
- return this.templatesApi.fetchComponentsAttachments$(template.id);
243
+ return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
245
244
  }
246
245
  generateUIDefinition$() {
247
246
  return of(undefined).pipe(tap(() => {
@@ -255,7 +254,6 @@ class GuidedSellingComponent {
255
254
  const uiDef = {
256
255
  name: '',
257
256
  createdTimestamp: 0,
258
- primary: true,
259
257
  type: 'DEFAULT',
260
258
  version: 2,
261
259
  children: metaList.map(meta => ({
@@ -269,12 +267,12 @@ class GuidedSellingComponent {
269
267
  }));
270
268
  }
271
269
  }
272
- GuidedSellingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingComponent, deps: [{ token: i1$1.UITemplatesApiService }, { token: i2.FlowStateService }, { token: i2.FlowInfoService }, { token: i2$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
270
+ GuidedSellingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i3$1.FlowStateService }, { token: i3$1.FlowInfoService }, { token: i2.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
273
271
  GuidedSellingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: GuidedSellingComponent, selector: "vl-flow-guided-selling", ngImport: i0, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
274
272
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingComponent, decorators: [{
275
273
  type: Component,
276
274
  args: [{ selector: 'vl-flow-guided-selling', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"] }]
277
- }], ctorParameters: function () { return [{ type: i1$1.UITemplatesApiService }, { type: i2.FlowStateService }, { type: i2.FlowInfoService }, { type: i2$1.ToastService }, { type: undefined, decorators: [{
275
+ }], ctorParameters: function () { return [{ type: i1$1.UITemplatesAdminApiService }, { type: i3$1.FlowStateService }, { type: i3$1.FlowInfoService }, { type: i2.ToastService }, { type: undefined, decorators: [{
278
276
  type: Optional
279
277
  }, {
280
278
  type: Inject,
@@ -367,10 +365,10 @@ class FlowDialogService {
367
365
  primaryButton: 'Ok',
368
366
  });
369
367
  }
370
- showQuoteOutsideShoppingCartDialog() {
368
+ showQuoteInConfiguratorDialog() {
371
369
  return this.show({
372
370
  title: 'Quote Cannot be Saved',
373
- description: 'It is only possible to save quotes from the Shopping Cart. To proceed, go to the Shopping Cart.',
371
+ description: 'It not possible to save quotes from the Configurator. To proceed, finish configuring product.',
374
372
  primaryButton: 'Ok',
375
373
  });
376
374
  }
@@ -390,27 +388,6 @@ class FlowDialogService {
390
388
  oppositeButtonActions: true,
391
389
  });
392
390
  }
393
- showReadonlyQuoteSubmitFailureDialog() {
394
- return this.show({
395
- title: 'Cannot Submit for Approval',
396
- description: 'It is only possible to submit for approval quotes with the “Draft“ status. Please create a new quote to proceed.',
397
- primaryButton: 'Ok',
398
- });
399
- }
400
- showOutsideShoppingCartQuoteSubmitFailureDialog() {
401
- return this.show({
402
- title: 'Cannot Submit for Approval',
403
- description: 'It is only possible to submit quotes for approval from the Shopping Cart. To proceed, go to the Shopping Cart.',
404
- primaryButton: 'Ok',
405
- });
406
- }
407
- showAccountSubmitFailureDialog() {
408
- return this.show({
409
- title: 'Save Changes',
410
- description: 'To submit for approval, save the quote first, and then submit it for approval from the Shopping Cart.',
411
- primaryButton: 'Ok',
412
- });
413
- }
414
391
  showTermsLimitReachedDialog() {
415
392
  const shoppingCartSettings = mapShoppingCartSettings(this.runtimeSettings.getShoppingCartSettings() || []);
416
393
  const maxRenewalTerms = getMaxRenewalTermsValue(shoppingCartSettings);
@@ -425,18 +402,18 @@ class FlowDialogService {
425
402
  return dialogFunction(dialog);
426
403
  }
427
404
  }
428
- FlowDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, deps: [{ token: i1.DialogService }, { token: i2.RuntimeSettingsService }, { token: i2.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
405
+ FlowDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, deps: [{ token: i1.DialogService }, { token: i3$1.RuntimeSettingsService }, { token: i3$1.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
429
406
  FlowDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService });
430
407
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, decorators: [{
431
408
  type: Injectable
432
- }], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i2.RuntimeSettingsService }, { type: i2.FlowInfoService }]; } });
409
+ }], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i3$1.RuntimeSettingsService }, { type: i3$1.FlowInfoService }]; } });
433
410
 
434
411
  class FlowRouterService {
435
- constructor(router, route, integrationState, flowStateService) {
412
+ constructor(router, route, integrationState, flowInfoService) {
436
413
  this.router = router;
437
414
  this.route = route;
438
415
  this.integrationState = integrationState;
439
- this.flowStateService = flowStateService;
416
+ this.flowInfoService = flowInfoService;
440
417
  this.urlHistory = [];
441
418
  this.getLastChildRoute = (route) => {
442
419
  return route.firstChild ? this.getLastChildRoute(route.firstChild) : route;
@@ -530,7 +507,7 @@ class FlowRouterService {
530
507
  this.router.navigateByUrl(prevUrl);
531
508
  }
532
509
  }
533
- navigateTo(path, productId, lineItemId) {
510
+ navigateTo(path, productId, transactionItemId) {
534
511
  if (path === 'shopping-cart') {
535
512
  this.navigateToShoppingCart();
536
513
  }
@@ -541,23 +518,16 @@ class FlowRouterService {
541
518
  this.navigateToAssets();
542
519
  }
543
520
  else if (path === 'product' && productId) {
544
- this.navigateToProductConfiguration(productId, lineItemId);
521
+ this.navigateToProductConfiguration(productId, transactionItemId);
545
522
  }
546
523
  }
547
- navigateToProductConfiguration(productId, lineItemId) {
548
- this.flowStateService
549
- .dispatch$(UITemplateType.FLOW_ENGINE, 'UPDATE_CONTEXT_PROPERTIES', {
550
- productId,
551
- lineItemId: lineItemId ?? '',
552
- })
553
- .pipe(tap(() => {
554
- const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
555
- const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
556
- this.router.navigate([flowRouteUrl, 'product'], {
557
- queryParams: { ...routeSnapshot.queryParams, productId },
558
- });
559
- }))
560
- .subscribe();
524
+ navigateToProductConfiguration(productId, transactionItemId) {
525
+ this.flowInfoService.updateContext({ productId, transactionItemId });
526
+ const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
527
+ const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
528
+ this.router.navigate([flowRouteUrl, 'product'], {
529
+ queryParams: { ...routeSnapshot.queryParams, productId, transactionItemId },
530
+ });
561
531
  }
562
532
  navigateToShoppingCart() {
563
533
  const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
@@ -594,21 +564,22 @@ class FlowRouterService {
594
564
  this.router.navigate([], { relativeTo: route, queryParams: { ...routeSnapshot.queryParams, ...queryParams } });
595
565
  }
596
566
  }
597
- FlowRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: i2.IntegrationState }, { token: i2.FlowStateService }], target: i0.ɵɵFactoryTarget.Injectable });
567
+ FlowRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: i3$1.IntegrationState }, { token: i3$1.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
598
568
  FlowRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, providedIn: 'root' });
599
569
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, decorators: [{
600
570
  type: Injectable,
601
571
  args: [{ providedIn: 'root' }]
602
- }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: i2.IntegrationState }, { type: i2.FlowStateService }]; } });
572
+ }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: i3$1.IntegrationState }, { type: i3$1.FlowInfoService }]; } });
603
573
 
604
574
  class FlowService {
605
- constructor(integrationState, flowRouterService, configurationService, configurationStateService, flowDialogService, flowStateService) {
575
+ constructor(integrationState, flowRouterService, configurationService, configurationStateService, flowDialogService, flowStateService, flowInfoService) {
606
576
  this.integrationState = integrationState;
607
577
  this.flowRouterService = flowRouterService;
608
578
  this.configurationService = configurationService;
609
579
  this.configurationStateService = configurationStateService;
610
580
  this.flowDialogService = flowDialogService;
611
581
  this.flowStateService = flowStateService;
582
+ this.flowInfoService = flowInfoService;
612
583
  this.cleanup$ = new Subject();
613
584
  }
614
585
  cleanup() {
@@ -617,9 +588,10 @@ class FlowService {
617
588
  initSubscriptions() {
618
589
  this.integrationState
619
590
  .listen$(FlowAction.FLOW_CONFIGURE_PRODUCT)
620
- .pipe(switchMap(payload => this.prepareConfiguration$(payload.lineItemId).pipe(map(() => payload))), tap(payload => {
591
+ .pipe(tap(payload => {
621
592
  if (payload.productId) {
622
- this.flowRouterService.navigateToProductConfiguration(payload.productId, payload.lineItemId);
593
+ this.flowInfoService.updateContext({ newProductQty: payload.qty });
594
+ this.flowRouterService.navigateToProductConfiguration(payload.productId, payload.transactionItemId);
623
595
  }
624
596
  else {
625
597
  console.warn("Parameter 'productId' is needed to start configuration");
@@ -643,7 +615,7 @@ class FlowService {
643
615
  this.integrationState.dispatch(FlowAction.ConfigureProductAction(payload));
644
616
  }
645
617
  else {
646
- this.flowRouterService.navigateTo(payload.path, payload.productId, payload.lineItemId);
618
+ this.flowRouterService.navigateTo(payload.path, payload.productId, payload.transactionItemId);
647
619
  }
648
620
  }), takeUntil(this.cleanup$))
649
621
  .subscribe();
@@ -682,20 +654,12 @@ class FlowService {
682
654
  .pipe(map(path => path.queryParams['productId']), takeUntil(this.cleanup$))
683
655
  .subscribe(productId => this.integrationState.patchState({ productId }));
684
656
  }
685
- prepareConfiguration$(lineItemId) {
686
- if (!lineItemId) {
687
- return of(undefined);
688
- }
689
- return this.flowStateService.dispatch$(UITemplateType.FLOW_ENGINE, 'UPDATE_PRICE_LIST', {
690
- lineItemId,
691
- });
692
- }
693
657
  }
694
- FlowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, deps: [{ token: i5.IntegrationState }, { token: FlowRouterService }, { token: i2.ConfigurationService }, { token: i2.ConfigurationStateService }, { token: FlowDialogService }, { token: i2.FlowStateService }], target: i0.ɵɵFactoryTarget.Injectable });
658
+ FlowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, deps: [{ token: i5.IntegrationState }, { token: FlowRouterService }, { token: i3$1.ConfigurationService }, { token: i3$1.ConfigurationStateService }, { token: FlowDialogService }, { token: i3$1.FlowStateService }, { token: i3$1.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
695
659
  FlowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService });
696
660
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, decorators: [{
697
661
  type: Injectable
698
- }], ctorParameters: function () { return [{ type: i5.IntegrationState }, { type: FlowRouterService }, { type: i2.ConfigurationService }, { type: i2.ConfigurationStateService }, { type: FlowDialogService }, { type: i2.FlowStateService }]; } });
662
+ }], ctorParameters: function () { return [{ type: i5.IntegrationState }, { type: FlowRouterService }, { type: i3$1.ConfigurationService }, { type: i3$1.ConfigurationStateService }, { type: FlowDialogService }, { type: i3$1.FlowStateService }, { type: i3$1.FlowInfoService }]; } });
699
663
 
700
664
  class FlowGuidedSellingService {
701
665
  constructor(integrationState) {
@@ -719,11 +683,11 @@ class FlowGuidedSellingService {
719
683
  .subscribe();
720
684
  }
721
685
  }
722
- FlowGuidedSellingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, deps: [{ token: i2.IntegrationState }], target: i0.ɵɵFactoryTarget.Injectable });
686
+ FlowGuidedSellingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, deps: [{ token: i3$1.IntegrationState }], target: i0.ɵɵFactoryTarget.Injectable });
723
687
  FlowGuidedSellingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService });
724
688
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, decorators: [{
725
689
  type: Injectable
726
- }], ctorParameters: function () { return [{ type: i2.IntegrationState }]; } });
690
+ }], ctorParameters: function () { return [{ type: i3$1.IntegrationState }]; } });
727
691
 
728
692
  class FlowComponent {
729
693
  constructor(routerService, flowService, flowInfoService, guidedSellingService) {
@@ -741,19 +705,18 @@ class FlowComponent {
741
705
  this.flowService.cleanup();
742
706
  }
743
707
  }
744
- FlowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, deps: [{ token: FlowRouterService }, { token: FlowService }, { token: i2.FlowInfoService }, { token: FlowGuidedSellingService }], target: i0.ɵɵFactoryTarget.Component });
745
- FlowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowComponent, selector: "vl-flow", ngImport: i0, template: "<vl-flow-new-header *ngIf=\"showHeader$ | async\"></vl-flow-new-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n\n <div class=\"guided-selling\" [ngClass]=\"{ hidden: (guidedSellingVisible$ | async) === false }\">\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column;width:100%;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;inset:0;background-color:#fff;z-index:999}.guided-selling{position:absolute;top:0;width:100%;height:100%;z-index:100}.hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: i2$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "component", type: FlowHeaderComponent, selector: "vl-flow-new-header" }, { kind: "component", type: GuidedSellingComponent, selector: "vl-flow-guided-selling" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
708
+ FlowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, deps: [{ token: FlowRouterService }, { token: FlowService }, { token: i3$1.FlowInfoService }, { token: FlowGuidedSellingService }], target: i0.ɵɵFactoryTarget.Component });
709
+ FlowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowComponent, selector: "vl-flow", ngImport: i0, template: "<vl-flow-new-header *ngIf=\"showHeader$ | async\"></vl-flow-new-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n\n <div class=\"guided-selling\" [ngClass]=\"{ hidden: (guidedSellingVisible$ | async) === false }\">\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column;width:100%;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;inset:0;background-color:#fff;z-index:999}.guided-selling{position:absolute;top:0;width:100%;height:100%;z-index:100}.hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: i2.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "component", type: FlowHeaderComponent, selector: "vl-flow-new-header" }, { kind: "component", type: GuidedSellingComponent, selector: "vl-flow-guided-selling" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
746
710
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, decorators: [{
747
711
  type: Component,
748
712
  args: [{ selector: 'vl-flow', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-flow-new-header *ngIf=\"showHeader$ | async\"></vl-flow-new-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n\n <div class=\"guided-selling\" [ngClass]=\"{ hidden: (guidedSellingVisible$ | async) === false }\">\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column;width:100%;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;inset:0;background-color:#fff;z-index:999}.guided-selling{position:absolute;top:0;width:100%;height:100%;z-index:100}.hidden{display:none}\n"] }]
749
- }], ctorParameters: function () { return [{ type: FlowRouterService }, { type: FlowService }, { type: i2.FlowInfoService }, { type: FlowGuidedSellingService }]; } });
713
+ }], ctorParameters: function () { return [{ type: FlowRouterService }, { type: FlowService }, { type: i3$1.FlowInfoService }, { type: FlowGuidedSellingService }]; } });
750
714
 
751
715
  const keepFlowInitialized = (route) => {
752
716
  const routerService = inject(FlowRouterService);
753
717
  const runtimeSettingsService = inject(RuntimeSettingsService);
754
718
  const flowState = inject(FlowStateService);
755
719
  const flowInfoService = inject(FlowInfoService);
756
- const quoteDraft = inject(QuoteDraftService);
757
720
  const salesTrasnsactionService = inject(SalesTransactionService);
758
721
  const configurationService = inject(ConfigurationService);
759
722
  const integrationState = inject(IntegrationState);
@@ -762,12 +725,11 @@ const keepFlowInitialized = (route) => {
762
725
  return true;
763
726
  }
764
727
  // Cleanup
765
- flowState.cleanup();
766
- quoteDraft.reset();
728
+ flowState.reset();
767
729
  salesTrasnsactionService.reset();
768
730
  configurationService.reset();
769
- integrationState.clear();
770
- flowInfoService.cleanup();
731
+ integrationState.reset();
732
+ flowInfoService.reset();
771
733
  if (!flowId) {
772
734
  return true;
773
735
  }
@@ -780,15 +742,15 @@ const keepFlowInitialized = (route) => {
780
742
  };
781
743
 
782
744
  class ProductUnloadGuard {
783
- constructor(router, quoteDraftService, configurationService, flowDialogService) {
745
+ constructor(router, flowInfoService, configurationService, flowDialogService) {
784
746
  this.router = router;
785
- this.quoteDraftService = quoteDraftService;
747
+ this.flowInfoService = flowInfoService;
786
748
  this.configurationService = configurationService;
787
749
  this.flowDialogService = flowDialogService;
788
750
  }
789
751
  canDeactivate(_, route, currentState, nextState) {
790
752
  let observable = of(true);
791
- if (!this.quoteDraftService.isStandalone && this.configurationService.hasUnsavedChanges) {
753
+ if (!this.flowInfoService.flow.properties.standalone && this.configurationService.hasUnsavedChanges) {
792
754
  observable = this.flowDialogService.showUnsavedChangesDialog();
793
755
  }
794
756
  return observable.pipe(map(unload => {
@@ -811,11 +773,11 @@ class ProductUnloadGuard {
811
773
  }));
812
774
  }
813
775
  }
814
- ProductUnloadGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, deps: [{ token: i1$2.Router }, { token: i2.QuoteDraftService }, { token: i2.ConfigurationService }, { token: FlowDialogService }], target: i0.ɵɵFactoryTarget.Injectable });
776
+ ProductUnloadGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, deps: [{ token: i1$2.Router }, { token: i3$1.FlowInfoService }, { token: i3$1.ConfigurationService }, { token: FlowDialogService }], target: i0.ɵɵFactoryTarget.Injectable });
815
777
  ProductUnloadGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard });
816
778
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, decorators: [{
817
779
  type: Injectable
818
- }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i2.QuoteDraftService }, { type: i2.ConfigurationService }, { type: FlowDialogService }]; } });
780
+ }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i3$1.FlowInfoService }, { type: i3$1.ConfigurationService }, { type: FlowDialogService }]; } });
819
781
 
820
782
  class RootGuard {
821
783
  constructor(router, routerService) {
@@ -858,8 +820,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
858
820
  }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }]; } });
859
821
 
860
822
  class AssetsComponent {
861
- constructor(templatesApi, cdr, toastService, flowInfo, customizationService) {
862
- this.templatesApi = templatesApi;
823
+ constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
824
+ this.templatesAdminApiService = templatesAdminApiService;
863
825
  this.cdr = cdr;
864
826
  this.toastService = toastService;
865
827
  this.flowInfo = flowInfo;
@@ -912,7 +874,7 @@ class AssetsComponent {
912
874
  if (!template) {
913
875
  return of(undefined);
914
876
  }
915
- return this.templatesApi.fetchComponentsAttachments$(template.id);
877
+ return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
916
878
  }
917
879
  generateUIDefinition$() {
918
880
  return of(undefined).pipe(tap(() => {
@@ -926,7 +888,6 @@ class AssetsComponent {
926
888
  const uiDef = {
927
889
  name: '',
928
890
  createdTimestamp: 0,
929
- primary: true,
930
891
  type: 'DEFAULT',
931
892
  version: 2,
932
893
  children: metaList.map(meta => ({
@@ -940,12 +901,12 @@ class AssetsComponent {
940
901
  }));
941
902
  }
942
903
  }
943
- AssetsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, deps: [{ token: i1$1.UITemplatesApiService }, { token: i0.ChangeDetectorRef }, { token: i2$1.ToastService }, { token: i2.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
944
- AssetsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: AssetsComponent, selector: "vl-flow-assets", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
904
+ AssetsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i0.ChangeDetectorRef }, { token: i2.ToastService }, { token: i3$1.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
905
+ AssetsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: AssetsComponent, selector: "vl-flow-assets", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
945
906
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, decorators: [{
946
907
  type: Component,
947
908
  args: [{ selector: 'vl-flow-assets', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
948
- }], ctorParameters: function () { return [{ type: i1$1.UITemplatesApiService }, { type: i0.ChangeDetectorRef }, { type: i2$1.ToastService }, { type: i2.FlowInfoService }, { type: undefined, decorators: [{
909
+ }], ctorParameters: function () { return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
949
910
  type: Optional
950
911
  }, {
951
912
  type: Inject,
@@ -967,8 +928,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
967
928
  }] });
968
929
 
969
930
  class CatalogComponent {
970
- constructor(templatesApi, cdr, toastService, flowInfo, customizationService) {
971
- this.templatesApi = templatesApi;
931
+ constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
932
+ this.templatesAdminApiService = templatesAdminApiService;
972
933
  this.cdr = cdr;
973
934
  this.toastService = toastService;
974
935
  this.flowInfo = flowInfo;
@@ -1021,7 +982,7 @@ class CatalogComponent {
1021
982
  if (!template) {
1022
983
  return of(undefined);
1023
984
  }
1024
- return this.templatesApi.fetchComponentsAttachments$(template.id);
985
+ return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
1025
986
  }
1026
987
  generateUIDefinition$() {
1027
988
  return of(undefined).pipe(tap(() => {
@@ -1035,7 +996,6 @@ class CatalogComponent {
1035
996
  const uiDef = {
1036
997
  name: '',
1037
998
  createdTimestamp: 0,
1038
- primary: true,
1039
999
  type: 'DEFAULT',
1040
1000
  version: 2,
1041
1001
  children: metaList.map(meta => ({
@@ -1049,12 +1009,12 @@ class CatalogComponent {
1049
1009
  }));
1050
1010
  }
1051
1011
  }
1052
- CatalogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, deps: [{ token: i1$1.UITemplatesApiService }, { token: i0.ChangeDetectorRef }, { token: i2$1.ToastService }, { token: i2.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1053
- CatalogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CatalogComponent, selector: "vl-flow-catalog", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1012
+ CatalogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i0.ChangeDetectorRef }, { token: i2.ToastService }, { token: i3$1.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1013
+ CatalogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CatalogComponent, selector: "vl-flow-catalog", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1054
1014
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, decorators: [{
1055
1015
  type: Component,
1056
1016
  args: [{ selector: 'vl-flow-catalog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
1057
- }], ctorParameters: function () { return [{ type: i1$1.UITemplatesApiService }, { type: i0.ChangeDetectorRef }, { type: i2$1.ToastService }, { type: i2.FlowInfoService }, { type: undefined, decorators: [{
1017
+ }], ctorParameters: function () { return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
1058
1018
  type: Optional
1059
1019
  }, {
1060
1020
  type: Inject,
@@ -1076,11 +1036,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1076
1036
  }] });
1077
1037
 
1078
1038
  class DebugComponent {
1079
- constructor(flowsApiService, router, activatedRoute, quoteDraftService) {
1039
+ constructor(flowsApiService, router, activatedRoute) {
1080
1040
  this.flowsApiService = flowsApiService;
1081
1041
  this.router = router;
1082
1042
  this.activatedRoute = activatedRoute;
1083
- this.quoteDraftService = quoteDraftService;
1084
1043
  this.form = new FormGroup({
1085
1044
  id: new FormControl(''),
1086
1045
  });
@@ -1091,8 +1050,6 @@ class DebugComponent {
1091
1050
  if (!id || !this.selectedFlow) {
1092
1051
  return;
1093
1052
  }
1094
- // Delete context before starting a new flow
1095
- this.quoteDraftService.reset();
1096
1053
  this.router.navigate(['..', 'flows'], {
1097
1054
  queryParams: {
1098
1055
  flowId: this.selectedFlow.id,
@@ -1106,12 +1063,12 @@ class DebugComponent {
1106
1063
  return new HttpParams({ fromObject: params }).toString();
1107
1064
  }
1108
1065
  }
1109
- DebugComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, deps: [{ token: i1$3.FlowsApiService }, { token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: i2.QuoteDraftService }], target: i0.ɵɵFactoryTarget.Component });
1110
- DebugComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: DebugComponent, selector: "vl-flow-debug", ngImport: i0, template: "<form [formGroup]=\"form\">\n <div class=\"fields-container\">\n <div class=\"field\">\n <label>SF Object ID</label>\n <input formControlName=\"id\" pInputText type=\"text\" />\n </div>\n </div>\n\n <p-button\n styleClass=\"p-button-primary\"\n label=\"Run Flow\"\n [disabled]=\"!form.value.id || !selectedFlow\"\n (onClick)=\"runFlow()\"\n ></p-button>\n</form>\n\n<table>\n <thead>\n <tr>\n <th [width]=\"30\"></th>\n <th [width]=\"160\">ID</th>\n <th [width]=\"160\">Entry Path</th>\n <th>QueryParams</th>\n <th [width]=\"100\">Standalone</th>\n <th [width]=\"100\">Stateful</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let flow of flows$ | async\" (click)=\"selectedFlow = flow\">\n <td><p-radioButton [inputId]=\"flow.id\" name=\"flow\" [value]=\"flow\" [(ngModel)]=\"selectedFlow\"></p-radioButton></td>\n <td>{{ flow.id }}</td>\n <td>{{ flow.properties.entryPath }}</td>\n <td class=\"cell-query-params\">{{ getQueryParamsString(flow.properties.queryParams) }}</td>\n <td>{{ flow.properties.standalone }}</td>\n <td>{{ flow.properties.stateful }}</td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;padding:24px 54px}form{display:flex;align-items:center;justify-content:space-between}.fields-container{display:flex;gap:24px}.field{display:flex;flex-direction:column;width:200px;flex-shrink:0}:host ::ng-deep .p-dropdown{width:100%}table{width:100%;border-collapse:collapse;table-layout:fixed}tbody>tr{cursor:pointer}tbody>tr:hover{background-color:#f0f5fa}th{text-align:left;font-weight:600}th,td{padding:0 10px;height:30px;border-bottom:1px solid var(--vl-border-color);margin-right:16px;line-height:18px}.cell-query-params{word-break:break-all}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i6.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i8.InputText, selector: "[pInputText]" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1066
+ DebugComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, deps: [{ token: i1$1.FlowsApiService }, { token: i1$2.Router }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
1067
+ DebugComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: DebugComponent, selector: "vl-flow-debug", ngImport: i0, template: "<form [formGroup]=\"form\">\n <div class=\"fields-container\">\n <div class=\"field\">\n <label>SF Object ID</label>\n <input formControlName=\"id\" pInputText type=\"text\" />\n </div>\n </div>\n\n <p-button\n styleClass=\"p-button-primary\"\n label=\"Run Flow\"\n [disabled]=\"!form.value.id || !selectedFlow\"\n (onClick)=\"runFlow()\"\n ></p-button>\n</form>\n\n<table>\n <thead>\n <tr>\n <th [width]=\"30\"></th>\n <th [width]=\"160\">ID</th>\n <th [width]=\"160\">Entry Path</th>\n <th>QueryParams</th>\n <th [width]=\"100\">Standalone</th>\n <th [width]=\"100\">Stateful</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let flow of flows$ | async\" (click)=\"selectedFlow = flow\">\n <td><p-radioButton [inputId]=\"flow.id\" name=\"flow\" [value]=\"flow\" [(ngModel)]=\"selectedFlow\"></p-radioButton></td>\n <td>{{ flow.id }}</td>\n <td>{{ flow.properties.entryPath }}</td>\n <td class=\"cell-query-params\">{{ getQueryParamsString(flow.properties.queryParams) }}</td>\n <td>{{ flow.properties.standalone }}</td>\n <td>{{ flow.properties.stateful }}</td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;padding:24px 54px}form{display:flex;align-items:center;justify-content:space-between}.fields-container{display:flex;gap:24px}.field{display:flex;flex-direction:column;width:200px;flex-shrink:0}:host ::ng-deep .p-dropdown{width:100%}table{width:100%;border-collapse:collapse;table-layout:fixed}tbody>tr{cursor:pointer}tbody>tr:hover{background-color:#f0f5fa}th{text-align:left;font-weight:600}th,td{padding:0 10px;height:30px;border-bottom:1px solid var(--vl-border-color);margin-right:16px;line-height:18px}.cell-query-params{word-break:break-all}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5$1.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i7.InputText, selector: "[pInputText]" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1111
1068
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, decorators: [{
1112
1069
  type: Component,
1113
1070
  args: [{ selector: 'vl-flow-debug', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"form\">\n <div class=\"fields-container\">\n <div class=\"field\">\n <label>SF Object ID</label>\n <input formControlName=\"id\" pInputText type=\"text\" />\n </div>\n </div>\n\n <p-button\n styleClass=\"p-button-primary\"\n label=\"Run Flow\"\n [disabled]=\"!form.value.id || !selectedFlow\"\n (onClick)=\"runFlow()\"\n ></p-button>\n</form>\n\n<table>\n <thead>\n <tr>\n <th [width]=\"30\"></th>\n <th [width]=\"160\">ID</th>\n <th [width]=\"160\">Entry Path</th>\n <th>QueryParams</th>\n <th [width]=\"100\">Standalone</th>\n <th [width]=\"100\">Stateful</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let flow of flows$ | async\" (click)=\"selectedFlow = flow\">\n <td><p-radioButton [inputId]=\"flow.id\" name=\"flow\" [value]=\"flow\" [(ngModel)]=\"selectedFlow\"></p-radioButton></td>\n <td>{{ flow.id }}</td>\n <td>{{ flow.properties.entryPath }}</td>\n <td class=\"cell-query-params\">{{ getQueryParamsString(flow.properties.queryParams) }}</td>\n <td>{{ flow.properties.standalone }}</td>\n <td>{{ flow.properties.stateful }}</td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;padding:24px 54px}form{display:flex;align-items:center;justify-content:space-between}.fields-container{display:flex;gap:24px}.field{display:flex;flex-direction:column;width:200px;flex-shrink:0}:host ::ng-deep .p-dropdown{width:100%}table{width:100%;border-collapse:collapse;table-layout:fixed}tbody>tr{cursor:pointer}tbody>tr:hover{background-color:#f0f5fa}th{text-align:left;font-weight:600}th,td{padding:0 10px;height:30px;border-bottom:1px solid var(--vl-border-color);margin-right:16px;line-height:18px}.cell-query-params{word-break:break-all}\n"] }]
1114
- }], ctorParameters: function () { return [{ type: i1$3.FlowsApiService }, { type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: i2.QuoteDraftService }]; } });
1071
+ }], ctorParameters: function () { return [{ type: i1$1.FlowsApiService }, { type: i1$2.Router }, { type: i1$2.ActivatedRoute }]; } });
1115
1072
 
1116
1073
  const routes$1 = [{ path: '', component: DebugComponent }];
1117
1074
  class DebugModule {
@@ -1149,80 +1106,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1149
1106
  }] });
1150
1107
 
1151
1108
  class ProductComponent {
1152
- constructor(
1153
- // private configurationRuntimeService: ConfigurationRuntimeService,
1154
- configurationService, configurationStateService, salesTransactionService, flowInfoService, integrationState, uiDefinitionsApiService, customizationService) {
1155
- this.configurationService = configurationService;
1109
+ constructor(configurationRuntimeService, configurationStateService) {
1110
+ this.configurationRuntimeService = configurationRuntimeService;
1156
1111
  this.configurationStateService = configurationStateService;
1157
- this.salesTransactionService = salesTransactionService;
1158
- this.flowInfoService = flowInfoService;
1159
- this.integrationState = integrationState;
1160
- this.uiDefinitionsApiService = uiDefinitionsApiService;
1161
- this.customizationService = customizationService;
1162
1112
  this.uiDefinitionContainer$ = new BehaviorSubject(null);
1113
+ this.showNotFound$ = new BehaviorSubject(false);
1114
+ this.uiDefinitionContainer$.next(this.configurationRuntimeService.uiDefinitionContainer);
1163
1115
  this.config = {
1164
1116
  init$: () => this.init$(),
1165
1117
  };
1166
1118
  }
1167
- customizeUI$() {
1168
- const { productId } = this.flowInfoService.context;
1169
- if (!productId || !this.customizationService?.getUiDefinition) {
1170
- return of(undefined);
1171
- }
1172
- return this.customizationService.getUiDefinition(productId).pipe(map(uiDefinitionContainer => {
1173
- this.uiDefinitionContainer$.next(uiDefinitionContainer);
1174
- }));
1175
- }
1176
- fetchUIDefinition$() {
1177
- const flowContext = this.flowInfoService.context;
1178
- if (flowContext.requiredUIDefinitionId) {
1179
- return this.uiDefinitionsApiService
1180
- .fetchUIDefinition$(flowContext.requiredUIDefinitionId)
1181
- .pipe(map((uiDefContainer) => this.uiDefinitionContainer$.next(uiDefContainer)));
1182
- }
1183
- return this.uiDefinitionsApiService
1184
- .fetchUIDefinitions$({
1185
- productId: flowContext.productId,
1186
- defaultUIDefinitionId: flowContext.defaultUIDefinitionId,
1187
- })
1188
- .pipe(map((uiDefinitionContainers) => {
1189
- const uiDefContainer = uiDefinitionContainers[0];
1190
- if (uiDefContainer) {
1191
- this.uiDefinitionContainer$.next(uiDefContainer);
1192
- }
1193
- }));
1194
- }
1195
1119
  init$() {
1196
- let state$;
1197
- if (!this.flowInfoService.isStateful) {
1198
- state$ = this.salesTransactionService.state$;
1199
- }
1200
- else {
1201
- state$ = of(undefined);
1202
- }
1203
- return state$.pipe(first(), tap(() => {
1204
- if (!this.flowInfoService.context.productId) {
1205
- throw new Error(`Unable to start configuration for 'productId == null'`);
1206
- }
1207
- }), switchMap(() => this.customizeUI$()), switchMap(() => (this.uiDefinitionContainer$.value ? of(undefined) : this.fetchUIDefinition$())), tap(() => {
1208
- if (!this.uiDefinitionContainer$.value) {
1209
- throw new Error('Product does not have Configuration UI');
1210
- }
1211
- }), switchMap(() => this.configurationStateService.init$()), switchMap(() => timer(1)), // wait until updates inputs on child components
1212
- map(noop));
1120
+ return this.configurationStateService.init$().pipe(tap(() => {
1121
+ this.showNotFound$.next(Boolean(!this.uiDefinitionContainer$.value));
1122
+ }));
1213
1123
  }
1214
1124
  }
1215
- ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, deps: [{ token: i2.ConfigurationService }, { token: i2.ConfigurationStateService }, { token: i2.SalesTransactionService }, { token: i2.FlowInfoService }, { token: i2.IntegrationState }, { token: i1$1.UIDefinitionsApiService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1216
- ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ProductComponent, selector: "vl-flow-product", ngImport: i0, template: "<vl-cms-preview [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\" [config]=\"config\"></vl-cms-preview>\n", styles: [""], dependencies: [{ kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1125
+ ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, deps: [{ token: i3$1.ConfigurationRuntimeService }, { token: i3$1.ConfigurationStateService }], target: i0.ɵɵFactoryTarget.Component });
1126
+ ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ProductComponent, selector: "vl-flow-product", ngImport: i0, template: "<vl-cms-preview [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\" [config]=\"config\"></vl-cms-preview>\n\n<div *ngIf=\"showNotFound$ | async\" class=\"not-found-wrapper\">\n <div class=\"not-found\">\n <div class=\"icon\"></div>\n <div class=\"message\">\n This product doesn't have a linked Configuration UI. <br />\n Please contact your system administrator for further assistance.\n </div>\n </div>\n</div>\n", styles: [".not-found-wrapper{position:absolute;top:0;display:flex;width:100%;height:100%;justify-content:center;align-items:center;background-color:#fff;z-index:1000}.not-found{display:flex;align-items:center;padding:16px;border-radius:8px;gap:8px;background-color:#f5f5f5}.not-found .icon{width:48px;height:42px;background-image:url(\"data:image/svg+xml,%3Csvg width='48' height='42' viewBox='0 0 48 42' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cellipse cx='24.0798' cy='32.6052' rx='2.85714' ry='2.63158' fill='%231F2029'/%3E%3Cpath d='M22.285 3.35831C23.0618 2.06363 24.9382 2.06363 25.715 3.35831L46.1826 37.471C46.9824 38.8041 46.0222 40.5 44.4676 40.5L3.53238 40.5C1.97779 40.5 1.01757 38.8041 1.8174 37.471L22.285 3.35831Z' stroke='%23141414' stroke-width='2'/%3E%3Cpath d='M24 17.342V26.8157' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E%0A\")}.not-found .message{font-size:14px;color:#141414;font-weight:300}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1217
1127
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, decorators: [{
1218
1128
  type: Component,
1219
- args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-cms-preview [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\" [config]=\"config\"></vl-cms-preview>\n" }]
1220
- }], ctorParameters: function () { return [{ type: i2.ConfigurationService }, { type: i2.ConfigurationStateService }, { type: i2.SalesTransactionService }, { type: i2.FlowInfoService }, { type: i2.IntegrationState }, { type: i1$1.UIDefinitionsApiService }, { type: undefined, decorators: [{
1221
- type: Optional
1222
- }, {
1223
- type: Inject,
1224
- args: [FLOW_CUSTOMIZATION]
1225
- }] }]; } });
1129
+ args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-cms-preview [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\" [config]=\"config\"></vl-cms-preview>\n\n<div *ngIf=\"showNotFound$ | async\" class=\"not-found-wrapper\">\n <div class=\"not-found\">\n <div class=\"icon\"></div>\n <div class=\"message\">\n This product doesn't have a linked Configuration UI. <br />\n Please contact your system administrator for further assistance.\n </div>\n </div>\n</div>\n", styles: [".not-found-wrapper{position:absolute;top:0;display:flex;width:100%;height:100%;justify-content:center;align-items:center;background-color:#fff;z-index:1000}.not-found{display:flex;align-items:center;padding:16px;border-radius:8px;gap:8px;background-color:#f5f5f5}.not-found .icon{width:48px;height:42px;background-image:url(\"data:image/svg+xml,%3Csvg width='48' height='42' viewBox='0 0 48 42' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cellipse cx='24.0798' cy='32.6052' rx='2.85714' ry='2.63158' fill='%231F2029'/%3E%3Cpath d='M22.285 3.35831C23.0618 2.06363 24.9382 2.06363 25.715 3.35831L46.1826 37.471C46.9824 38.8041 46.0222 40.5 44.4676 40.5L3.53238 40.5C1.97779 40.5 1.01757 38.8041 1.8174 37.471L22.285 3.35831Z' stroke='%23141414' stroke-width='2'/%3E%3Cpath d='M24 17.342V26.8157' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E%0A\")}.not-found .message{font-size:14px;color:#141414;font-weight:300}\n"] }]
1130
+ }], ctorParameters: function () { return [{ type: i3$1.ConfigurationRuntimeService }, { type: i3$1.ConfigurationStateService }]; } });
1226
1131
 
1227
1132
  class ProductModule {
1228
1133
  }
@@ -1239,9 +1144,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1239
1144
  }] });
1240
1145
 
1241
1146
  class RecordNotFoundComponent {
1242
- constructor(router, route) {
1147
+ constructor(router) {
1243
1148
  this.router = router;
1244
- this.route = route;
1245
1149
  this.subMessage = '';
1246
1150
  this.type = '';
1247
1151
  const navigation = this.router.getCurrentNavigation();
@@ -1254,12 +1158,12 @@ class RecordNotFoundComponent {
1254
1158
  }
1255
1159
  }
1256
1160
  }
1257
- RecordNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
1161
+ RecordNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, deps: [{ token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component });
1258
1162
  RecordNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: RecordNotFoundComponent, selector: "vl-flow-record-not-found", ngImport: i0, template: "<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"message-wrapper\">\n <div *ngIf=\"message; else defaultMessage\">\n <p class=\"text message-text\" [class]=\"type\">{{ message }}</p>\n\n <p *ngIf=\"subMessage\" class=\"text\">{{ subMessage }}</p>\n\n <div *ngIf=\"details && details.length > 0\">\n <div *ngFor=\"let detail of details\" class=\"text\">{{ detail }}</div>\n </div>\n </div>\n\n <ng-template #defaultMessage>Record not found</ng-template>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;padding:24px 54px}:host .text{white-space:pre-line;word-break:break-word}:host .message-text.error{color:var(--vl-error-text-color)}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1259
1163
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, decorators: [{
1260
1164
  type: Component,
1261
1165
  args: [{ selector: 'vl-flow-record-not-found', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"message-wrapper\">\n <div *ngIf=\"message; else defaultMessage\">\n <p class=\"text message-text\" [class]=\"type\">{{ message }}</p>\n\n <p *ngIf=\"subMessage\" class=\"text\">{{ subMessage }}</p>\n\n <div *ngIf=\"details && details.length > 0\">\n <div *ngFor=\"let detail of details\" class=\"text\">{{ detail }}</div>\n </div>\n </div>\n\n <ng-template #defaultMessage>Record not found</ng-template>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;padding:24px 54px}:host .text{white-space:pre-line;word-break:break-word}:host .message-text.error{color:var(--vl-error-text-color)}\n"] }]
1262
- }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }]; } });
1166
+ }], ctorParameters: function () { return [{ type: i1$2.Router }]; } });
1263
1167
 
1264
1168
  const routes = [{ path: '', component: RecordNotFoundComponent }];
1265
1169
  class RecordNotFoundModule {
@@ -1276,8 +1180,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1276
1180
  }] });
1277
1181
 
1278
1182
  class ShoppingCartComponent {
1279
- constructor(templatesApi, cdr, toastService, flowInfo, customizationService) {
1280
- this.templatesApi = templatesApi;
1183
+ constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
1184
+ this.templatesAdminApiService = templatesAdminApiService;
1281
1185
  this.cdr = cdr;
1282
1186
  this.toastService = toastService;
1283
1187
  this.flowInfo = flowInfo;
@@ -1330,7 +1234,7 @@ class ShoppingCartComponent {
1330
1234
  if (!template) {
1331
1235
  return of(undefined);
1332
1236
  }
1333
- return this.templatesApi.fetchComponentsAttachments$(template.id);
1237
+ return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
1334
1238
  }
1335
1239
  generateUIDefinition$() {
1336
1240
  return of(undefined).pipe(tap(() => {
@@ -1344,7 +1248,6 @@ class ShoppingCartComponent {
1344
1248
  const uiDef = {
1345
1249
  name: '',
1346
1250
  createdTimestamp: 0,
1347
- primary: true,
1348
1251
  type: 'DEFAULT',
1349
1252
  version: 2,
1350
1253
  children: metaList.map(meta => ({
@@ -1358,12 +1261,12 @@ class ShoppingCartComponent {
1358
1261
  }));
1359
1262
  }
1360
1263
  }
1361
- ShoppingCartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, deps: [{ token: i1$1.UITemplatesApiService }, { token: i0.ChangeDetectorRef }, { token: i2$1.ToastService }, { token: i2.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1362
- ShoppingCartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ShoppingCartComponent, selector: "vl-flow-shopping-cart", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1264
+ ShoppingCartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i0.ChangeDetectorRef }, { token: i2.ToastService }, { token: i3$1.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1265
+ ShoppingCartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ShoppingCartComponent, selector: "vl-flow-shopping-cart", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1363
1266
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, decorators: [{
1364
1267
  type: Component,
1365
1268
  args: [{ selector: 'vl-flow-shopping-cart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
1366
- }], ctorParameters: function () { return [{ type: i1$1.UITemplatesApiService }, { type: i0.ChangeDetectorRef }, { type: i2$1.ToastService }, { type: i2.FlowInfoService }, { type: undefined, decorators: [{
1269
+ }], ctorParameters: function () { return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
1367
1270
  type: Optional
1368
1271
  }, {
1369
1272
  type: Inject,
@@ -1416,19 +1319,29 @@ class FlowResolver {
1416
1319
  }));
1417
1320
  }
1418
1321
  }
1419
- FlowResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, deps: [{ token: i1$2.Router }, { token: FlowRouterService }, { token: i2.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
1322
+ FlowResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, deps: [{ token: i1$2.Router }, { token: FlowRouterService }, { token: i3$1.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
1420
1323
  FlowResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver });
1421
1324
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, decorators: [{
1422
1325
  type: Injectable
1423
- }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i2.FlowInfoService }]; } });
1326
+ }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i3$1.FlowInfoService }]; } });
1327
+
1328
+ const resolvePCMModel = () => {
1329
+ const flowInfoService = inject(FlowInfoService);
1330
+ const configurationRuntimeService = inject(ConfigurationRuntimeService);
1331
+ const { productId } = flowInfoService.context;
1332
+ if (!productId) {
1333
+ throw new Error(`Unable to start configuration for 'productId == null'`);
1334
+ }
1335
+ return configurationRuntimeService.init$({ productId });
1336
+ };
1424
1337
 
1425
- class QuoteResolver {
1426
- constructor(router, quoteDraftService, routerService, flowInfoService, flowStateService) {
1338
+ class SalesTransactionResolver {
1339
+ constructor(router, routerService, flowInfoService, flowStateService, salesTransactionService) {
1427
1340
  this.router = router;
1428
- this.quoteDraftService = quoteDraftService;
1429
1341
  this.routerService = routerService;
1430
1342
  this.flowInfoService = flowInfoService;
1431
1343
  this.flowStateService = flowStateService;
1344
+ this.salesTransactionService = salesTransactionService;
1432
1345
  }
1433
1346
  resolve(route) {
1434
1347
  const flow = this.flowInfoService.flow;
@@ -1465,33 +1378,55 @@ class QuoteResolver {
1465
1378
  }));
1466
1379
  }
1467
1380
  getNavigateTo() {
1468
- const flow = this.flowInfoService.flow;
1469
- let navigateTo;
1470
- if (flow?.properties.stateful) {
1471
- return this.flowStateService.select$(UITemplateType.FLOW_ENGINE, 'NAVIGATE_TO').pipe(map(r => {
1472
- if (r.success) {
1473
- return r.result;
1474
- }
1475
- return '';
1476
- }));
1477
- }
1478
- else {
1479
- const isAccountMode = this.flowInfoService.context.mode === ConfigurationContextMode.ACCOUNT;
1480
- if (isAccountMode || this.quoteDraftService.hasAssets) {
1481
- navigateTo = '/assets';
1482
- }
1483
- else if (this.quoteDraftService.hasProducts) {
1484
- navigateTo = '/cart';
1485
- }
1486
- }
1487
- return of(navigateTo);
1381
+ // Implement when needed
1382
+ return of('');
1488
1383
  }
1489
1384
  }
1490
- QuoteResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteResolver, deps: [{ token: i1$2.Router }, { token: i2.QuoteDraftService }, { token: FlowRouterService }, { token: i2.FlowInfoService }, { token: i2.FlowStateService }], target: i0.ɵɵFactoryTarget.Injectable });
1491
- QuoteResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteResolver });
1492
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: QuoteResolver, decorators: [{
1385
+ SalesTransactionResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionResolver, deps: [{ token: i1$2.Router }, { token: FlowRouterService }, { token: i3$1.FlowInfoService }, { token: i3$1.FlowStateService }, { token: i3$1.SalesTransactionService }], target: i0.ɵɵFactoryTarget.Injectable });
1386
+ SalesTransactionResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionResolver });
1387
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionResolver, decorators: [{
1493
1388
  type: Injectable
1494
- }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i2.QuoteDraftService }, { type: FlowRouterService }, { type: i2.FlowInfoService }, { type: i2.FlowStateService }]; } });
1389
+ }], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i3$1.FlowInfoService }, { type: i3$1.FlowStateService }, { type: i3$1.SalesTransactionService }]; } });
1390
+
1391
+ const resolveUIDefinition = () => {
1392
+ const customizationService = inject(FLOW_CUSTOMIZATION, { optional: true });
1393
+ const flowInfoService = inject(FlowInfoService);
1394
+ const uiDefinitionsAdminApiService = inject(UIDefinitionsAdminApiService);
1395
+ const configurationRuntimeService = inject(ConfigurationRuntimeService);
1396
+ const { productId } = flowInfoService.context;
1397
+ if (!productId) {
1398
+ throw new Error(`Unable to start configuration for 'productId == null'`);
1399
+ }
1400
+ return of(undefined).pipe(switchMap(() => {
1401
+ // Try resolving via customization service
1402
+ if (!productId || !customizationService?.getUiDefinition) {
1403
+ return of(undefined);
1404
+ }
1405
+ return customizationService.getUiDefinition(flowInfoService.context);
1406
+ }), switchMap(uiDefContainer => {
1407
+ // Resolve UIDefinition from the org
1408
+ if (uiDefContainer) {
1409
+ return of(uiDefContainer);
1410
+ }
1411
+ if (flowInfoService.context.requiredUIDefinitionId) {
1412
+ return uiDefinitionsAdminApiService.fetch$(flowInfoService.context.requiredUIDefinitionId, {
1413
+ skipErrorHandler: true,
1414
+ });
1415
+ }
1416
+ return uiDefinitionsAdminApiService
1417
+ .fetchAll$({
1418
+ productId,
1419
+ defaultUIDefinitionId: flowInfoService.context.defaultUIDefinitionId,
1420
+ }, { skipErrorHandler: true })
1421
+ .pipe(map((uiDefinitionContainers) => {
1422
+ const uiDefContainer = uiDefinitionContainers[0];
1423
+ if (!uiDefContainer) {
1424
+ throw new Error(`UI Definition for productId=${productId} is not resolved`);
1425
+ }
1426
+ return uiDefContainer;
1427
+ }));
1428
+ }), catchError(() => of(null)), tap(uiDefContainer => (configurationRuntimeService.uiDefinitionContainer = uiDefContainer)));
1429
+ };
1495
1430
 
1496
1431
  const rootRoute = {
1497
1432
  id: VELOCE_FLOW_ROOT_ROUTE,
@@ -1515,7 +1450,7 @@ const rootRoute = {
1515
1450
  path: 'product',
1516
1451
  component: ProductComponent,
1517
1452
  runGuardsAndResolvers: 'paramsOrQueryParamsChange',
1518
- resolve: { quote: QuoteResolver },
1453
+ resolve: { salesTransaction: SalesTransactionResolver, uiDef: resolveUIDefinition, pcm: resolvePCMModel },
1519
1454
  canDeactivate: [ProductUnloadGuard],
1520
1455
  data: { showHeader: true },
1521
1456
  },
@@ -1523,21 +1458,21 @@ const rootRoute = {
1523
1458
  path: 'cart',
1524
1459
  component: ShoppingCartComponent,
1525
1460
  runGuardsAndResolvers: 'paramsOrQueryParamsChange',
1526
- resolve: { quote: QuoteResolver },
1461
+ resolve: { salesTransaction: SalesTransactionResolver },
1527
1462
  data: { showHeader: true },
1528
1463
  },
1529
1464
  {
1530
1465
  path: 'catalog',
1531
1466
  component: CatalogComponent,
1532
1467
  runGuardsAndResolvers: 'paramsOrQueryParamsChange',
1533
- resolve: { quote: QuoteResolver },
1468
+ resolve: { salesTransaction: SalesTransactionResolver },
1534
1469
  data: { showHeader: true },
1535
1470
  },
1536
1471
  {
1537
1472
  path: 'assets',
1538
1473
  component: AssetsComponent,
1539
1474
  runGuardsAndResolvers: 'paramsOrQueryParamsChange',
1540
- resolve: { quote: QuoteResolver },
1475
+ resolve: { salesTransaction: SalesTransactionResolver },
1541
1476
  data: { showHeader: true },
1542
1477
  },
1543
1478
  {
@@ -1556,13 +1491,13 @@ class FlowRoutingModule {
1556
1491
  }
1557
1492
  FlowRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1558
1493
  FlowRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, imports: [i1$2.RouterModule, ProductModule, ShoppingCartModule, CatalogModule, AssetsModule], exports: [RouterModule] });
1559
- FlowRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver, QuoteResolver], imports: [RouterModule.forChild([rootRoute]), ProductModule, ShoppingCartModule, CatalogModule, AssetsModule, RouterModule] });
1494
+ FlowRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver, SalesTransactionResolver], imports: [RouterModule.forChild([rootRoute]), ProductModule, ShoppingCartModule, CatalogModule, AssetsModule, RouterModule] });
1560
1495
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, decorators: [{
1561
1496
  type: NgModule,
1562
1497
  args: [{
1563
1498
  imports: [RouterModule.forChild([rootRoute]), ProductModule, ShoppingCartModule, CatalogModule, AssetsModule],
1564
1499
  exports: [RouterModule],
1565
- providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver, QuoteResolver],
1500
+ providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver, SalesTransactionResolver],
1566
1501
  }]
1567
1502
  }] });
1568
1503
 
@@ -1610,22 +1545,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1610
1545
  }]
1611
1546
  }] });
1612
1547
 
1613
- const getFlowObjectIdPropertyName = (id) => {
1614
- const objectName = SalesforceIdUtils.getSfObjectNameById(id);
1615
- switch (objectName) {
1616
- case 'Account':
1617
- return 'accountId';
1618
- case 'Order':
1619
- return 'orderId';
1620
- case 'Quote':
1621
- default:
1622
- return 'quoteId';
1623
- }
1624
- };
1625
-
1626
1548
  /**
1627
1549
  * Generated bundle index. Do not edit.
1628
1550
  */
1629
1551
 
1630
- export { FlowDialogService, FlowModule, FlowRouterService, FlowService, VELOCE_FLOW_ROOT_ROUTE, getFlowObjectIdPropertyName };
1552
+ export { FlowDialogService, FlowModule, FlowRouterService, FlowService, VELOCE_FLOW_ROOT_ROUTE };
1631
1553
  //# sourceMappingURL=veloceapps-sdk.mjs.map