@veloceapps/sdk 6.0.0-6 → 6.0.0-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. package/bundles/veloceapps-sdk-cms.umd.js +1248 -823
  2. package/bundles/veloceapps-sdk-cms.umd.js.map +1 -1
  3. package/bundles/veloceapps-sdk-core.umd.js +803 -696
  4. package/bundles/veloceapps-sdk-core.umd.js.map +1 -1
  5. package/bundles/veloceapps-sdk-runtime.umd.js +209 -142
  6. package/bundles/veloceapps-sdk-runtime.umd.js.map +1 -1
  7. package/bundles/veloceapps-sdk.umd.js +371 -299
  8. package/bundles/veloceapps-sdk.umd.js.map +1 -1
  9. package/cms/components/element-children/element-children.component.d.ts +13 -3
  10. package/cms/components/element-children/element-children.module.d.ts +4 -2
  11. package/cms/components/element-drop-handle/element-drop-handle.component.d.ts +12 -0
  12. package/cms/components/element-drop-handle/element-drop-handle.module.d.ts +9 -0
  13. package/cms/components/element-renderer/element-renderer.component.d.ts +3 -3
  14. package/cms/components/preview/index.d.ts +1 -0
  15. package/cms/components/preview/preview.component.d.ts +9 -8
  16. package/cms/components/preview/preview.module.d.ts +2 -1
  17. package/cms/components/preview/preview.types.d.ts +11 -0
  18. package/cms/index.d.ts +2 -0
  19. package/cms/launcher.module.d.ts +3 -1
  20. package/cms/modules/migrations/index.d.ts +2 -0
  21. package/cms/modules/migrations/migrations.d.ts +2 -0
  22. package/cms/modules/migrations/migrations.module.d.ts +6 -0
  23. package/cms/modules/migrations/services/migrations.service.d.ts +10 -0
  24. package/cms/modules/migrations/types/migrations.types.d.ts +2 -0
  25. package/cms/modules/runtime/index.d.ts +2 -0
  26. package/cms/modules/runtime/runtime.module.d.ts +8 -0
  27. package/cms/modules/runtime/services/compilation.service.d.ts +18 -0
  28. package/cms/modules/runtime/services/runtime-editor.service.d.ts +18 -0
  29. package/cms/modules/runtime/services/runtime.service.d.ts +27 -0
  30. package/cms/modules/runtime/tokens.d.ts +3 -0
  31. package/cms/{types → modules/runtime/types}/compilation.types.d.ts +1 -1
  32. package/cms/modules/runtime/types/runtime.actions.d.ts +9 -0
  33. package/cms/services/index.d.ts +0 -1
  34. package/cms/services/io-provider.service.d.ts +3 -3
  35. package/cms/types/common.types.d.ts +1 -1
  36. package/cms/types/configuration.types.d.ts +1 -0
  37. package/cms/types/index.d.ts +1 -1
  38. package/cms/utils/elements-resolver.d.ts +3 -2
  39. package/cms/utils/index.d.ts +1 -0
  40. package/cms/utils/path.utils.d.ts +0 -1
  41. package/cms/utils/ui-definition.utils.d.ts +6 -0
  42. package/cms/vendor-map.d.ts +40 -25
  43. package/core/modules/configuration/services/configuration-runtime.service.d.ts +2 -4
  44. package/core/modules/configuration/services/configuration.service.d.ts +6 -4
  45. package/core/modules/configuration/types/configuration-runtime.types.d.ts +0 -2
  46. package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +3 -2
  47. package/core/services/metric-calculation/metric-calculation.service.d.ts +5 -1
  48. package/core/services/quote-draft.service.d.ts +2 -2
  49. package/core/types/index.d.ts +0 -1
  50. package/core/types/ui-definition.types.d.ts +19 -4
  51. package/core/utils/index.d.ts +1 -0
  52. package/core/utils/line-item.utils.d.ts +2 -0
  53. package/core/utils/ui-definition.utils.d.ts +2 -0
  54. package/esm2015/cms/components/element-children/element-children.component.js +24 -8
  55. package/esm2015/cms/components/element-children/element-children.module.js +8 -6
  56. package/esm2015/cms/components/element-drop-handle/element-drop-handle.component.js +32 -0
  57. package/esm2015/cms/components/element-drop-handle/element-drop-handle.module.js +19 -0
  58. package/esm2015/cms/components/element-renderer/element-renderer.component.js +9 -9
  59. package/esm2015/cms/components/element-renderer/element-renderer.module.js +4 -4
  60. package/esm2015/cms/components/plugin.component.js +3 -3
  61. package/esm2015/cms/components/preview/index.js +2 -1
  62. package/esm2015/cms/components/preview/preview.component.js +21 -36
  63. package/esm2015/cms/components/preview/preview.module.js +7 -6
  64. package/esm2015/cms/components/preview/preview.types.js +2 -0
  65. package/esm2015/cms/directives/custom-template.directive.js +3 -3
  66. package/esm2015/cms/index.js +3 -1
  67. package/esm2015/cms/launcher.module.js +10 -9
  68. package/esm2015/cms/modules/federated/federated.component.js +3 -3
  69. package/esm2015/cms/modules/federated/federated.module.js +4 -4
  70. package/esm2015/cms/modules/migrations/index.js +3 -0
  71. package/esm2015/cms/modules/migrations/migrations.js +11 -0
  72. package/esm2015/cms/modules/migrations/migrations.module.js +15 -0
  73. package/esm2015/cms/modules/migrations/services/migrations.service.js +43 -0
  74. package/esm2015/cms/modules/migrations/types/migrations.types.js +2 -0
  75. package/esm2015/cms/modules/runtime/index.js +3 -0
  76. package/esm2015/cms/modules/runtime/runtime.module.js +32 -0
  77. package/esm2015/cms/modules/runtime/services/compilation.service.js +84 -0
  78. package/esm2015/cms/modules/runtime/services/runtime-editor.service.js +27 -0
  79. package/esm2015/cms/modules/runtime/services/runtime.service.js +74 -0
  80. package/esm2015/cms/modules/runtime/tokens.js +3 -0
  81. package/esm2015/cms/modules/runtime/types/compilation.types.js +2 -0
  82. package/esm2015/cms/modules/runtime/types/runtime.actions.js +2 -0
  83. package/esm2015/cms/plugins/configuration.plugin.js +12 -4
  84. package/esm2015/cms/plugins/io.plugin.js +3 -3
  85. package/esm2015/cms/plugins/script.plugin.js +3 -3
  86. package/esm2015/cms/services/element-context.service.js +3 -3
  87. package/esm2015/cms/services/index.js +1 -2
  88. package/esm2015/cms/services/integration.state.js +3 -3
  89. package/esm2015/cms/services/io-provider.service.js +9 -9
  90. package/esm2015/cms/services/templates.service.js +3 -3
  91. package/esm2015/cms/types/common.types.js +1 -1
  92. package/esm2015/cms/types/configuration.types.js +1 -1
  93. package/esm2015/cms/types/index.js +2 -2
  94. package/esm2015/cms/utils/elements-resolver.js +18 -8
  95. package/esm2015/cms/utils/index.js +2 -1
  96. package/esm2015/cms/utils/path.utils.js +2 -13
  97. package/esm2015/cms/utils/ui-definition.utils.js +82 -0
  98. package/esm2015/cms/vendor-map.js +21 -10
  99. package/esm2015/core/core.module.js +4 -4
  100. package/esm2015/core/modules/configuration/configuration.module.js +4 -4
  101. package/esm2015/core/modules/configuration/services/configuration-runtime.service.js +5 -10
  102. package/esm2015/core/modules/configuration/services/configuration.service.js +27 -24
  103. package/esm2015/core/modules/configuration/services/runtime-context.service.js +3 -3
  104. package/esm2015/core/modules/configuration/types/configuration-runtime.types.js +1 -1
  105. package/esm2015/core/modules/flow-configuration/flow-configuration.module.js +4 -4
  106. package/esm2015/core/modules/flow-configuration/services/flow-configuration.service.js +10 -9
  107. package/esm2015/core/modules/flow-configuration/services/flow-update.service.js +3 -3
  108. package/esm2015/core/services/context.service.js +3 -3
  109. package/esm2015/core/services/metric-calculation/metric-calculation.service.js +18 -9
  110. package/esm2015/core/services/product-images.service.js +3 -3
  111. package/esm2015/core/services/quote-draft.service.js +7 -7
  112. package/esm2015/core/types/index.js +1 -2
  113. package/esm2015/core/types/ui-definition.types.js +2 -2
  114. package/esm2015/core/utils/index.js +2 -1
  115. package/esm2015/core/utils/line-item.utils.js +27 -11
  116. package/esm2015/core/utils/ui-definition.utils.js +9 -0
  117. package/esm2015/runtime/components/component-preview/component-preview.component.js +4 -4
  118. package/esm2015/runtime/components/section-renderer/section-renderer.component.js +3 -3
  119. package/esm2015/runtime/components/ui-runtime/runtime.component.js +3 -3
  120. package/esm2015/runtime/components/ui-runtime-preview/runtime-preview.component.js +3 -3
  121. package/esm2015/runtime/execution/components/children-placeholder/children-placeholder.component.js +6 -6
  122. package/esm2015/runtime/execution/components/context-provider/context-provider.component.js +3 -3
  123. package/esm2015/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.js +3 -3
  124. package/esm2015/runtime/execution/components/federated/federated.component.js +3 -3
  125. package/esm2015/runtime/execution/components/velo-attribute/velo-attribute.component.js +3 -3
  126. package/esm2015/runtime/execution/components/velo-multiselect/velo-multiselect.component.js +3 -3
  127. package/esm2015/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.js +3 -3
  128. package/esm2015/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.js +3 -3
  129. package/esm2015/runtime/execution/components/velo-port-radio/velo-port-radio.component.js +3 -3
  130. package/esm2015/runtime/execution/components/velo-type/velo-type.component.js +3 -3
  131. package/esm2015/runtime/execution/directives/section-script.directive.js +3 -3
  132. package/esm2015/runtime/execution/directives/sf-query.directive.js +3 -3
  133. package/esm2015/runtime/execution/directives/velo-attribute.directive.js +3 -3
  134. package/esm2015/runtime/execution/directives/velo-port.directive.js +18 -18
  135. package/esm2015/runtime/execution/directives/vl-approval.directive.js +3 -3
  136. package/esm2015/runtime/execution/directives/vl-document-attachments.directive.js +3 -3
  137. package/esm2015/runtime/execution/directives/vl-document-templates.directive.js +3 -3
  138. package/esm2015/runtime/execution/directives/vl-quote.directive.js +4 -4
  139. package/esm2015/runtime/execution/directives/vl-ramp.directive.js +3 -3
  140. package/esm2015/runtime/execution/runtime-execution.module.js +4 -4
  141. package/esm2015/runtime/runtime.module.js +4 -4
  142. package/esm2015/runtime/services/cart.service.js +3 -3
  143. package/esm2015/runtime/services/collapsible-state.service.js +3 -3
  144. package/esm2015/runtime/services/configuration.service.js +4 -4
  145. package/esm2015/runtime/services/current-state.service.js +3 -3
  146. package/esm2015/runtime/services/form-scope.service.js +3 -3
  147. package/esm2015/runtime/services/product-model-cache.service.js +3 -3
  148. package/esm2015/runtime/services/runtime-context.service.js +3 -3
  149. package/esm2015/runtime/services/runtime-form.service.js +3 -3
  150. package/esm2015/runtime/services/runtime.service.js +4 -4
  151. package/esm2015/runtime/services/section-helper.service.js +3 -3
  152. package/esm2015/runtime/services/section-scope.service.js +3 -3
  153. package/esm2015/runtime/services/section-store.service.js +3 -3
  154. package/esm2015/runtime/services/section.service.js +6 -6
  155. package/esm2015/runtime/types/index.js +2 -1
  156. package/esm2015/runtime/types/quote-states.types.js +2 -0
  157. package/esm2015/src/components/dialog/dialog.component.js +3 -3
  158. package/esm2015/src/components/dialog/dialog.module.js +4 -4
  159. package/esm2015/src/components/doc-gen/doc-gen.component.js +3 -3
  160. package/esm2015/src/components/doc-gen/doc-gen.module.js +4 -4
  161. package/esm2015/src/components/header/cart-overlay/cart-preview.component.js +3 -3
  162. package/esm2015/src/components/header/cart-overlay/cart-preview.module.js +4 -4
  163. package/esm2015/src/components/header/header.component.js +20 -12
  164. package/esm2015/src/components/header/header.module.js +4 -4
  165. package/esm2015/src/components/header/metrics/metrics.component.js +79 -67
  166. package/esm2015/src/components/header/metrics/metrics.definitions.js +1 -8
  167. package/esm2015/src/components/header/metrics/metrics.module.js +4 -4
  168. package/esm2015/src/flow-routing.module.js +4 -4
  169. package/esm2015/src/flow.component.js +3 -3
  170. package/esm2015/src/flow.module.js +4 -4
  171. package/esm2015/src/guards/context.guard.js +3 -3
  172. package/esm2015/src/guards/product-unload.guard.js +3 -3
  173. package/esm2015/src/guards/root.guard.js +3 -3
  174. package/esm2015/src/pages/catalog/catalog.component.js +3 -3
  175. package/esm2015/src/pages/catalog/catalog.module.js +4 -4
  176. package/esm2015/src/pages/debug/debug.component.js +3 -3
  177. package/esm2015/src/pages/debug/debug.module.js +4 -4
  178. package/esm2015/src/pages/empty-account/empty-account.component.js +3 -3
  179. package/esm2015/src/pages/empty-account/empty-account.module.js +4 -4
  180. package/esm2015/src/pages/legacy-product/legacy-product.component.js +4 -4
  181. package/esm2015/src/pages/legacy-product/legacy-product.module.js +4 -4
  182. package/esm2015/src/pages/product/product.component.js +5 -12
  183. package/esm2015/src/pages/product/product.module.js +4 -4
  184. package/esm2015/src/pages/record-not-found/record-not-found.component.js +3 -3
  185. package/esm2015/src/pages/record-not-found/record-not-found.module.js +4 -4
  186. package/esm2015/src/pages/remote/remote.component.js +5 -8
  187. package/esm2015/src/pages/remote/remote.module.js +4 -4
  188. package/esm2015/src/pages/shopping-cart/shopping-cart.component.js +3 -3
  189. package/esm2015/src/pages/shopping-cart/shopping-cart.module.js +4 -4
  190. package/esm2015/src/resolvers/flow.resolver.js +3 -3
  191. package/esm2015/src/resolvers/quote.resolver.js +8 -8
  192. package/esm2015/src/services/doc-gen.service.js +3 -3
  193. package/esm2015/src/services/flow-dialog.service.js +3 -3
  194. package/esm2015/src/services/flow-router.service.js +3 -3
  195. package/esm2015/src/services/flow.service.js +3 -3
  196. package/esm2015/src/utils/flow.utils.js +3 -3
  197. package/fesm2015/veloceapps-sdk-cms.js +1041 -731
  198. package/fesm2015/veloceapps-sdk-cms.js.map +1 -1
  199. package/fesm2015/veloceapps-sdk-core.js +554 -521
  200. package/fesm2015/veloceapps-sdk-core.js.map +1 -1
  201. package/fesm2015/veloceapps-sdk-runtime.js +138 -138
  202. package/fesm2015/veloceapps-sdk-runtime.js.map +1 -1
  203. package/fesm2015/veloceapps-sdk.js +256 -252
  204. package/fesm2015/veloceapps-sdk.js.map +1 -1
  205. package/package.json +5 -3
  206. package/runtime/services/configuration.service.d.ts +2 -1
  207. package/runtime/services/runtime.service.d.ts +2 -1
  208. package/runtime/types/index.d.ts +1 -0
  209. package/src/components/header/header.component.d.ts +4 -2
  210. package/src/components/header/metrics/metrics.component.d.ts +15 -6
  211. package/src/components/header/metrics/metrics.definitions.d.ts +0 -3
  212. package/src/pages/product/product.component.d.ts +0 -1
  213. package/cms/services/dynamic-module.service.d.ts +0 -15
  214. package/cms/services/launcher.service.d.ts +0 -18
  215. package/esm2015/cms/services/dynamic-module.service.js +0 -33
  216. package/esm2015/cms/services/launcher.service.js +0 -58
  217. package/esm2015/cms/types/compilation.types.js +0 -2
  218. package/esm2015/core/types/quote-states.types.js +0 -2
  219. /package/{core → runtime}/types/quote-states.types.d.ts +0 -0
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('lodash'), require('@angular/common'), require('@veloceapps/core'), require('@angular/cdk/drag-drop'), require('@angular/cdk/scrolling'), require('@angular/forms'), require('@veloceapps/sdk/core'), require('@veloceapps/components'), require('@babel/standalone'), require('@veloceapps/api'), require('rxjs/operators'), require('primeng/api'), require('primeng/dynamicdialog')) :
3
- typeof define === 'function' && define.amd ? define('@veloceapps/sdk/cms', ['exports', '@angular/core', 'rxjs', 'lodash', '@angular/common', '@veloceapps/core', '@angular/cdk/drag-drop', '@angular/cdk/scrolling', '@angular/forms', '@veloceapps/sdk/core', '@veloceapps/components', '@babel/standalone', '@veloceapps/api', 'rxjs/operators', 'primeng/api', 'primeng/dynamicdialog'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.veloceapps = global.veloceapps || {}, global.veloceapps.sdk = global.veloceapps.sdk || {}, global.veloceapps.sdk.cms = {}), global.ng.core, global.rxjs, global.lodash, global.ng.common, global["@veloceapps/core"], global.ng.cdk.dragDrop, global.ng.cdk.scrolling, global.ng.forms, global.veloceapps.sdk.core, global["@veloceapps/components"], global["@babel/standalone"], global["@veloceapps/api"], global.rxjs.operators, global["primeng/api"], global["primeng/dynamicdialog"]));
5
- })(this, (function (exports, i0, rxjs, lodash, i7, core, dragDrop, scrolling, angularForms, i2, i1, standalone, api, rxjsOperators, i3, dynamicdialog) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('lodash'), require('rfc6902'), require('@veloceapps/sdk/core'), require('primeng/api'), require('@veloceapps/components'), require('@veloceapps/core'), require('@angular/common'), require('ngx-drag-drop'), require('@veloceapps/api'), require('primeng/dynamicdialog'), require('@angular/cdk/drag-drop'), require('@angular/cdk/scrolling'), require('@angular/forms'), require('@babel/standalone'), require('rxjs/operators')) :
3
+ typeof define === 'function' && define.amd ? define('@veloceapps/sdk/cms', ['exports', '@angular/core', 'rxjs', 'lodash', 'rfc6902', '@veloceapps/sdk/core', 'primeng/api', '@veloceapps/components', '@veloceapps/core', '@angular/common', 'ngx-drag-drop', '@veloceapps/api', 'primeng/dynamicdialog', '@angular/cdk/drag-drop', '@angular/cdk/scrolling', '@angular/forms', '@babel/standalone', 'rxjs/operators'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.veloceapps = global.veloceapps || {}, global.veloceapps.sdk = global.veloceapps.sdk || {}, global.veloceapps.sdk.cms = {}), global.ng.core, global.rxjs, global.lodash, global.rfc6902, global.veloceapps.sdk.core, global["primeng/api"], global["@veloceapps/components"], global["@veloceapps/core"], global.ng.common, global["ngx-drag-drop"], global["@veloceapps/api"], global["primeng/dynamicdialog"], global.ng.cdk.dragDrop, global.ng.cdk.scrolling, global.ng.forms, global["@babel/standalone"], global.rxjs.operators));
5
+ })(this, (function (exports, i0, rxjs, lodash, rfc6902, i2, i3, i1, core, i7, i2$1, api, dynamicdialog, dragDrop, scrolling, angularForms, standalone, rxjsOperators) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -25,12 +25,13 @@
25
25
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
26
  var rxjs__namespace = /*#__PURE__*/_interopNamespace(rxjs);
27
27
  var lodash__namespace = /*#__PURE__*/_interopNamespace(lodash);
28
- var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
29
- var angularForms__namespace = /*#__PURE__*/_interopNamespace(angularForms);
30
28
  var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
29
+ var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
31
30
  var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
31
+ var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
32
+ var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
33
+ var angularForms__namespace = /*#__PURE__*/_interopNamespace(angularForms);
32
34
  var rxjsOperators__namespace = /*#__PURE__*/_interopNamespace(rxjsOperators);
33
- var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
34
35
 
35
36
  exports.FlowAction = void 0;
36
37
  (function (FlowAction) {
@@ -97,7 +98,7 @@
97
98
  SetDefaultMetrics: SetDefaultMetrics
98
99
  });
99
100
 
100
- /*! *****************************************************************************
101
+ /******************************************************************************
101
102
  Copyright (c) Microsoft Corporation.
102
103
 
103
104
  Permission to use, copy, modify, and/or distribute this software for any
@@ -164,6 +165,64 @@
164
165
  function __param(paramIndex, decorator) {
165
166
  return function (target, key) { decorator(target, key, paramIndex); };
166
167
  }
168
+ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
169
+ function accept(f) { if (f !== void 0 && typeof f !== "function")
170
+ throw new TypeError("Function expected"); return f; }
171
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
172
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
173
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
174
+ var _, done = false;
175
+ for (var i = decorators.length - 1; i >= 0; i--) {
176
+ var context = {};
177
+ for (var p in contextIn)
178
+ context[p] = p === "access" ? {} : contextIn[p];
179
+ for (var p in contextIn.access)
180
+ context.access[p] = contextIn.access[p];
181
+ context.addInitializer = function (f) { if (done)
182
+ throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
183
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
184
+ if (kind === "accessor") {
185
+ if (result === void 0)
186
+ continue;
187
+ if (result === null || typeof result !== "object")
188
+ throw new TypeError("Object expected");
189
+ if (_ = accept(result.get))
190
+ descriptor.get = _;
191
+ if (_ = accept(result.set))
192
+ descriptor.set = _;
193
+ if (_ = accept(result.init))
194
+ initializers.push(_);
195
+ }
196
+ else if (_ = accept(result)) {
197
+ if (kind === "field")
198
+ initializers.push(_);
199
+ else
200
+ descriptor[key] = _;
201
+ }
202
+ }
203
+ if (target)
204
+ Object.defineProperty(target, contextIn.name, descriptor);
205
+ done = true;
206
+ }
207
+ ;
208
+ function __runInitializers(thisArg, initializers, value) {
209
+ var useValue = arguments.length > 2;
210
+ for (var i = 0; i < initializers.length; i++) {
211
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
212
+ }
213
+ return useValue ? value : void 0;
214
+ }
215
+ ;
216
+ function __propKey(x) {
217
+ return typeof x === "symbol" ? x : "".concat(x);
218
+ }
219
+ ;
220
+ function __setFunctionName(f, name, prefix) {
221
+ if (typeof name === "symbol")
222
+ name = name.description ? "[".concat(name.description, "]") : "";
223
+ return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
224
+ }
225
+ ;
167
226
  function __metadata(metadataKey, metadataValue) {
168
227
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
169
228
  return Reflect.metadata(metadataKey, metadataValue);
@@ -195,7 +254,7 @@
195
254
  function step(op) {
196
255
  if (f)
197
256
  throw new TypeError("Generator is already executing.");
198
- while (_)
257
+ while (g && (g = 0, op[0] && (_ = 0)), _)
199
258
  try {
200
259
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
201
260
  return t;
@@ -259,7 +318,11 @@
259
318
  var __createBinding = Object.create ? (function (o, m, k, k2) {
260
319
  if (k2 === undefined)
261
320
  k2 = k;
262
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
321
+ var desc = Object.getOwnPropertyDescriptor(m, k);
322
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
323
+ desc = { enumerable: true, get: function () { return m[k]; } };
324
+ }
325
+ Object.defineProperty(o, k2, desc);
263
326
  }) : (function (o, m, k, k2) {
264
327
  if (k2 === undefined)
265
328
  k2 = k;
@@ -359,7 +422,7 @@
359
422
  function __asyncDelegator(o) {
360
423
  var i, p;
361
424
  return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
362
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
425
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
363
426
  }
364
427
  function __asyncValues(o) {
365
428
  if (!Symbol.asyncIterator)
@@ -414,6 +477,11 @@
414
477
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
415
478
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
416
479
  }
480
+ function __classPrivateFieldIn(state, receiver) {
481
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
482
+ throw new TypeError("Cannot use 'in' operator on non-object");
483
+ return typeof state === "function" ? receiver === state : state.has(receiver);
484
+ }
417
485
 
418
486
  var DEFAULT_PLUGINS_TOKEN = new i0.InjectionToken('DEFAULT_PLUGINS_TOKEN');
419
487
  var UI_DEFINITION_METADATA = new i0.InjectionToken('UI_DEFINITION_METADATA_TOKEN');
@@ -492,6 +560,110 @@
492
560
  __param(0, i0.Inject(i0.Injector))
493
561
  ], exports.ElementComponent);
494
562
 
563
+ function getElementUniqueName(collection, name, comparator) {
564
+ var result = '';
565
+ var index = 0;
566
+ while (!result) {
567
+ var candidate = name + (index ? " (" + index + ")" : '');
568
+ var exists = collection.some(comparator(candidate));
569
+ if (!exists) {
570
+ result = candidate;
571
+ }
572
+ else {
573
+ index++;
574
+ }
575
+ }
576
+ return result;
577
+ }
578
+ var insertElementAt = function (source, target, parentPath, index) {
579
+ var result = __spreadArray([], __read(source));
580
+ var name = getElementUniqueName(result, target.name, function (name) { return function (el) { return el.name === name; }; });
581
+ var path = parentPath ? parentPath + "/" + name : name;
582
+ result.splice(index, 0, Object.assign(Object.assign({}, target), { path: path, name: name }));
583
+ return result;
584
+ };
585
+ var insertElement = function (source, target, path, index) {
586
+ if (!path) {
587
+ return insertElementAt(source, target, '', index);
588
+ }
589
+ return source.map(function (element) {
590
+ var _a;
591
+ if (element.path === path) {
592
+ return Object.assign(Object.assign({}, element), { children: insertElementAt(element.children, target, element.path, index) });
593
+ }
594
+ else if ((_a = element.path) === null || _a === void 0 ? void 0 : _a.startsWith(path)) {
595
+ return Object.assign(Object.assign({}, element), { children: insertElement(element.children, target, path, index) });
596
+ }
597
+ else {
598
+ return element;
599
+ }
600
+ });
601
+ };
602
+ var removeElement = function (source, path) {
603
+ return source.reduce(function (trunk, element) {
604
+ if (path === element.path) {
605
+ return trunk;
606
+ }
607
+ if (element.path) {
608
+ if (path.startsWith(element.path)) {
609
+ trunk.push(Object.assign(Object.assign({}, element), { children: removeElement(element.children, path) }));
610
+ }
611
+ else {
612
+ trunk.push(element);
613
+ }
614
+ }
615
+ return trunk;
616
+ }, []);
617
+ };
618
+ var findElementByPath = function (source, path) {
619
+ var e_1, _b;
620
+ try {
621
+ for (var source_1 = __values(source), source_1_1 = source_1.next(); !source_1_1.done; source_1_1 = source_1.next()) {
622
+ var el = source_1_1.value;
623
+ if (el.path === path) {
624
+ return el;
625
+ }
626
+ if (el.path && path.startsWith(el.path)) {
627
+ var found = findElementByPath(el.children, path);
628
+ if (found) {
629
+ return found;
630
+ }
631
+ }
632
+ }
633
+ }
634
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
635
+ finally {
636
+ try {
637
+ if (source_1_1 && !source_1_1.done && (_b = source_1.return)) _b.call(source_1);
638
+ }
639
+ finally { if (e_1) throw e_1.error; }
640
+ }
641
+ return;
642
+ };
643
+ var findElementByModule = function (elements, module, elementName) {
644
+ var e_2, _b;
645
+ try {
646
+ for (var elements_1 = __values(elements), elements_1_1 = elements_1.next(); !elements_1_1.done; elements_1_1 = elements_1.next()) {
647
+ var el = elements_1_1.value;
648
+ if (el.module === module && el.name === elementName) {
649
+ return el;
650
+ }
651
+ var child = findElementByModule(el.children, module, elementName);
652
+ if (child) {
653
+ return child;
654
+ }
655
+ }
656
+ }
657
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
658
+ finally {
659
+ try {
660
+ if (elements_1_1 && !elements_1_1.done && (_b = elements_1.return)) _b.call(elements_1);
661
+ }
662
+ finally { if (e_2) throw e_2.error; }
663
+ }
664
+ return;
665
+ };
666
+
495
667
  var parseBoundPath = function (path) {
496
668
  var _a, _b;
497
669
  var regexp = new RegExp("(?:\\/)(?:\\w+)(?:\\/)(?:ports|attributes)(?:\\/)(?:\\w+)|(?:\\/)(?:\\w+)", 'g');
@@ -524,29 +696,6 @@
524
696
  variable: variable,
525
697
  };
526
698
  };
527
- var findElementByModule = function (elements, module, elementName) {
528
- var e_1, _e;
529
- try {
530
- for (var elements_1 = __values(elements), elements_1_1 = elements_1.next(); !elements_1_1.done; elements_1_1 = elements_1.next()) {
531
- var el = elements_1_1.value;
532
- if (el.module === module && el.name === elementName) {
533
- return el;
534
- }
535
- var child = findElementByModule(el.children, module, elementName);
536
- if (child) {
537
- return child;
538
- }
539
- }
540
- }
541
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
542
- finally {
543
- try {
544
- if (elements_1_1 && !elements_1_1.done && (_e = elements_1.return)) _e.call(elements_1);
545
- }
546
- finally { if (e_1) throw e_1.error; }
547
- }
548
- return;
549
- };
550
699
  var getAbsolutePath = function (elements, subject, path) {
551
700
  var _a, _b, _c;
552
701
  if (path.module) {
@@ -569,49 +718,85 @@
569
718
  return subjectSegments.join('/');
570
719
  };
571
720
 
572
- var DynamicModuleService = /** @class */ (function () {
573
- function DynamicModuleService() {
574
- this._elementsTree = [];
575
- this._componentFactories = [];
721
+ var CMS_COMPILATION_SERVICE = new i0.InjectionToken('VENDOR_MAP');
722
+
723
+ var RuntimeService = /** @class */ (function () {
724
+ function RuntimeService(injector) {
725
+ this.injector = injector;
726
+ this.modules = [];
727
+ this.componentFactories = {};
728
+ this.applicationTree = [];
729
+ this.isInitialized$ = new rxjs.BehaviorSubject(false);
730
+ this.updated$ = new rxjs.Subject();
731
+ this.compilationService = this.injector.get(CMS_COMPILATION_SERVICE);
576
732
  }
577
- Object.defineProperty(DynamicModuleService.prototype, "componentFactories", {
578
- get: function () {
579
- return this._componentFactories;
580
- },
581
- set: function (data) {
582
- this._componentFactories = data;
583
- },
584
- enumerable: false,
585
- configurable: true
586
- });
587
- DynamicModuleService.prototype.getComponentFactory = function (element) {
588
- return this.componentFactories.find(function (f) { return f.componentType.path === element.path; });
733
+ RuntimeService.prototype.initialize$ = function (uiDefinition, config) {
734
+ var _this = this;
735
+ this.config = config;
736
+ if (!uiDefinition) {
737
+ return rxjs.of([]);
738
+ }
739
+ return this.compilationService.compileUIDefinition$(uiDefinition).pipe(rxjs.map(function (result) {
740
+ _this.applicationTree = result.elements;
741
+ _this.addComponentFactories(result.module.componentFactories);
742
+ return result.elements;
743
+ }), rxjs.tap(function () { return _this.isInitialized$.next(true); }));
589
744
  };
590
- Object.defineProperty(DynamicModuleService.prototype, "elementsTree", {
591
- get: function () {
592
- return this._elementsTree;
593
- },
594
- set: function (tree) {
595
- this._elementsTree = tree;
596
- },
597
- enumerable: false,
598
- configurable: true
599
- });
600
- DynamicModuleService.prototype.clear = function () {
601
- this._elementsTree = [];
602
- this.componentFactories = [];
745
+ RuntimeService.prototype.applyPatch$ = function (patch) {
746
+ var _this = this;
747
+ var observable$ = rxjs.of(undefined);
748
+ patch.forEach(function (operation) {
749
+ switch (operation.op) {
750
+ case 'add': {
751
+ observable$ = observable$.pipe(rxjs.switchMap(function () { return _this.addElement$(operation); }));
752
+ break;
753
+ }
754
+ case 'remove': {
755
+ observable$ = observable$.pipe(rxjs.map(function () { return _this.deleteElement(operation); }));
756
+ break;
757
+ }
758
+ default:
759
+ observable$ = rxjs.of();
760
+ }
761
+ });
762
+ return observable$.pipe(rxjs.tap(function () { return _this.updated$.next(); }));
763
+ };
764
+ RuntimeService.prototype.getCompiledElement$ = function (path) {
765
+ var _this = this;
766
+ return this.updated$.pipe(rxjs.startWith(undefined), rxjs.map(function () { return findElementByPath(_this.applicationTree, path); }), rxjs.distinctUntilChanged());
767
+ };
768
+ RuntimeService.prototype.clear = function () {
769
+ this.compilationService.clearModuleCache(this.modules);
770
+ this.modules = [];
771
+ this.applicationTree = [];
772
+ this.componentFactories = {};
773
+ this.isInitialized$.next(false);
774
+ };
775
+ RuntimeService.prototype.addElement$ = function (operation) {
776
+ var _this = this;
777
+ return this.compilationService.compileElement$(operation.value).pipe(rxjs.map(function (result) {
778
+ _this.addComponentFactories(result.module.componentFactories);
779
+ rfc6902.applyPatch(_this.applicationTree, [Object.assign(Object.assign({}, operation), { value: result.elements[0] })]);
780
+ }));
781
+ };
782
+ RuntimeService.prototype.deleteElement = function (operation) {
783
+ rfc6902.applyPatch(this.applicationTree, [operation]);
784
+ };
785
+ RuntimeService.prototype.addComponentFactories = function (list) {
786
+ var _this = this;
787
+ list.forEach(function (item) { return (_this.componentFactories[item.componentType.path] = item); });
603
788
  };
604
- return DynamicModuleService;
789
+ return RuntimeService;
605
790
  }());
606
- DynamicModuleService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: DynamicModuleService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
607
- DynamicModuleService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: DynamicModuleService });
608
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: DynamicModuleService, decorators: [{
791
+ RuntimeService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeService, deps: [{ token: i0__namespace.Injector }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
792
+ RuntimeService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeService });
793
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeService, decorators: [{
609
794
  type: i0.Injectable
610
- }] });
795
+ }], ctorParameters: function () { return [{ type: i0__namespace.Injector }]; } });
611
796
 
612
797
  var IOProviderService = /** @class */ (function () {
613
- function IOProviderService(dynamicModuleService) {
614
- this.dynamicModuleService = dynamicModuleService;
798
+ function IOProviderService(runtimeService) {
799
+ this.runtimeService = runtimeService;
615
800
  this.inputs = {};
616
801
  }
617
802
  IOProviderService.prototype.connect = function (el, name, target) {
@@ -631,7 +816,7 @@
631
816
  var pathIsValue = elPath.segments.length === 1 && elPath.segments[0].startsWith('"') && elPath.segments[0].endsWith('"');
632
817
  var finalName = (_b = elPath.variable) !== null && _b !== void 0 ? _b : name;
633
818
  var value = pathIsValue ? new rxjs.BehaviorSubject(elPath.segments[0].slice(1, -1)) : undefined;
634
- var absolutePath = !pathIsValue ? getAbsolutePath(this.dynamicModuleService.elementsTree, el, elPath) : el.path;
819
+ var absolutePath = !pathIsValue ? getAbsolutePath(this.runtimeService.applicationTree, el, elPath) : el.path;
635
820
  return this.createSubjectSafe(absolutePath !== null && absolutePath !== void 0 ? absolutePath : '', finalName, value);
636
821
  };
637
822
  IOProviderService.prototype.createSubjectSafe = function (path, name, subject) {
@@ -651,11 +836,11 @@
651
836
  };
652
837
  return IOProviderService;
653
838
  }());
654
- IOProviderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: IOProviderService, deps: [{ token: DynamicModuleService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
655
- IOProviderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: IOProviderService });
656
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: IOProviderService, decorators: [{
839
+ IOProviderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IOProviderService, deps: [{ token: RuntimeService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
840
+ IOProviderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IOProviderService });
841
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IOProviderService, decorators: [{
657
842
  type: i0.Injectable
658
- }], ctorParameters: function () { return [{ type: DynamicModuleService }]; } });
843
+ }], ctorParameters: function () { return [{ type: RuntimeService }]; } });
659
844
 
660
845
  var TemplatesService = /** @class */ (function () {
661
846
  function TemplatesService() {
@@ -680,318 +865,73 @@
680
865
  };
681
866
  return TemplatesService;
682
867
  }());
683
- TemplatesService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TemplatesService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
684
- TemplatesService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TemplatesService });
685
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TemplatesService, decorators: [{
868
+ TemplatesService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TemplatesService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
869
+ TemplatesService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TemplatesService });
870
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TemplatesService, decorators: [{
686
871
  type: i0.Injectable
687
872
  }] });
688
873
 
689
- var IOPlugin = /** @class */ (function () {
690
- function IOPlugin(host) {
691
- var _this = this;
692
- var _a, _b;
693
- this.host = host;
694
- var elementMetadata = this.host.injector.get(ELEMENT_METADATA);
695
- var inputProvider = this.host.injector.get(IOProviderService);
696
- var inputs = Object.entries((_a = elementMetadata.inputs) !== null && _a !== void 0 ? _a : {});
697
- var outputs = Object.entries((_b = elementMetadata.outputs) !== null && _b !== void 0 ? _b : {});
698
- inputs.forEach(function (_c) {
699
- var _d = __read(_c, 2), key = _d[0], path = _d[1];
700
- var _a;
701
- if (path && typeof path !== 'string') {
702
- console.error("The value of '" + key + "' input should be a string");
703
- }
704
- if (((_a = elementMetadata.outputs) === null || _a === void 0 ? void 0 : _a[key]) !== undefined) {
705
- console.warn("'" + key + "' appears both in inputs and outputs. To prevent inconsistent behavior please keep them unique ");
706
- }
707
- _this.host[key] = inputProvider.connect(elementMetadata, key, path);
708
- });
709
- outputs.forEach(function (_c) {
710
- var _d = __read(_c, 2), key = _d[0], path = _d[1];
711
- if (path && typeof path !== 'string') {
712
- console.error("The value of '" + key + "' output should be a string");
713
- }
714
- _this.host[key] = inputProvider.provide(elementMetadata, key, path);
715
- });
874
+ var InitAction = { type: 'INIT' };
875
+ var ClearAction = { type: 'CLEAR' };
876
+ var IntegrationState = /** @class */ (function () {
877
+ function IntegrationState() {
878
+ this.stateSubj$ = new rxjs.BehaviorSubject({});
879
+ this.action$ = new rxjs.BehaviorSubject(InitAction);
716
880
  }
717
- return IOPlugin;
881
+ Object.defineProperty(IntegrationState.prototype, "state$", {
882
+ get: function () {
883
+ return this.stateSubj$.asObservable();
884
+ },
885
+ enumerable: false,
886
+ configurable: true
887
+ });
888
+ Object.defineProperty(IntegrationState.prototype, "state", {
889
+ get: function () {
890
+ return this.stateSubj$.getValue();
891
+ },
892
+ enumerable: false,
893
+ configurable: true
894
+ });
895
+ IntegrationState.prototype.patchState = function (update) {
896
+ this.stateSubj$.next(Object.assign(Object.assign({}, this.stateSubj$.getValue()), update));
897
+ };
898
+ IntegrationState.prototype.dispatch = function (action) {
899
+ this.action$.next(action);
900
+ };
901
+ IntegrationState.prototype.listen$ = function (actionType) {
902
+ return this.action$.pipe(rxjs.filter(function (action) { return action.type === actionType; }), rxjs.map(function (action) { return action.payload; }));
903
+ };
904
+ IntegrationState.prototype.listenAll$ = function () {
905
+ return this.action$.asObservable();
906
+ };
907
+ IntegrationState.prototype.clear = function () {
908
+ this.stateSubj$.next({});
909
+ this.action$.next(ClearAction);
910
+ };
911
+ return IntegrationState;
718
912
  }());
719
- IOPlugin.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: IOPlugin, deps: [{ token: exports.ElementComponent }], target: i0__namespace.ɵɵFactoryTarget.Directive });
720
- IOPlugindir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: IOPlugin, ngImport: i0__namespace });
721
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: IOPlugin, decorators: [{
722
- type: i0.Directive
723
- }], ctorParameters: function () { return [{ type: exports.ElementComponent }]; } });
913
+ IntegrationState.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IntegrationState, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
914
+ IntegrationStateprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IntegrationState, providedIn: 'root' });
915
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IntegrationState, decorators: [{
916
+ type: i0.Injectable,
917
+ args: [{ providedIn: 'root' }]
918
+ }] });
724
919
 
725
- var ScriptPlugin = /** @class */ (function () {
726
- function ScriptPlugin(host) {
727
- var _this = this;
728
- this.host = host;
729
- this.normalizeImports = function (script, elementPath) {
730
- var regexp = new RegExp("import([ \\n\\t]*(?:[^ \\n\\t\\{\\}]+[ \\n\\t]*,?)?(?:[ \\n\\t]*\\{(?:[ \\n\\t]*[^ \\n\\t\"'\\{\\}]+[ \\n\\t]*,?)+\\})?[ \\n\\t]*)from[ \\n\\t]*(['\"])([^'\"\\n]+)(?:['\"]);", 'g');
731
- var result = script.replace(regexp, function (match, g1, g2, src) {
732
- var imports = g1
733
- .trim()
734
- .slice(1, -1)
735
- .split(',')
736
- .map(function (item) { return item.trim(); });
737
- imports.forEach(function (item) {
738
- var _a;
739
- if (!((_a = _this.vendorMap[src]) === null || _a === void 0 ? void 0 : _a[item])) {
740
- throw new Error("Failed to import " + item + " from '" + src + "' in " + elementPath + "/script.ts");
741
- }
742
- });
743
- return "const " + g1 + " = vendor['" + src + "'];";
744
- });
745
- return result;
746
- };
747
- this.document = this.host.injector.get(i7.DOCUMENT);
748
- this.vendorMap = this.host.injector.get(VENDOR_MAP);
749
- var elementMetadata = this.host.injector.get(ELEMENT_METADATA);
750
- var sharedElementMetadata = this.host.injector.get(SHARED_ELEMENT_METADATA);
751
- this.addScript(sharedElementMetadata);
752
- this.addScript(elementMetadata);
920
+ var ElementContextService = /** @class */ (function () {
921
+ function ElementContextService() {
753
922
  }
754
- ScriptPlugin.prototype.addScript = function (metadata) {
755
- var _a;
756
- if (!(metadata === null || metadata === void 0 ? void 0 : metadata.script)) {
757
- return;
758
- }
759
- var id = btoa(core.UUID.UUID());
760
- var script = this.document.createElement('script');
761
- script.type = "text/javascript";
762
- var scriptContent = this.normalizeImports(metadata.script, (_a = metadata.path) !== null && _a !== void 0 ? _a : metadata.name);
763
- var classMatch = /export class (\S+)/.exec(scriptContent);
764
- var className = classMatch === null || classMatch === void 0 ? void 0 : classMatch[1];
765
- if (!classMatch || !className) {
766
- console.error("Script doesn't have exported class");
767
- return;
768
- }
769
- scriptContent = scriptContent.replace(classMatch[0], "class " + className);
770
- script.text = "var " + id + " = function(vendor) {" + scriptContent + "\n return " + className + "; };";
771
- this.document.body.appendChild(script);
772
- var ScriptClass = window[id](this.vendorMap);
773
- if (ScriptClass instanceof Object) {
774
- this.host.registerPlugin(new ScriptClass(this.host));
775
- }
776
- this.document.body.removeChild(script);
777
- };
778
- return ScriptPlugin;
923
+ return ElementContextService;
779
924
  }());
780
- ScriptPlugin.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ScriptPlugin, deps: [{ token: exports.ElementComponent }], target: i0__namespace.ɵɵFactoryTarget.Directive });
781
- ScriptPlugindir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: ScriptPlugin, ngImport: i0__namespace });
782
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ScriptPlugin, decorators: [{
783
- type: i0.Directive
784
- }], ctorParameters: function () { return [{ type: exports.ElementComponent }]; } });
785
-
786
- /*
787
- * ScriptPlugin must always be the last plugin in the list to make sure user code is running after all pre-initializers.
788
- */
789
- var CONFIG = {
790
- CUSTOM: {
791
- component: exports.ElementComponent,
792
- plugins: [IOPlugin, ScriptPlugin],
793
- },
794
- CONTAINER: {
795
- component: exports.ElementComponent,
796
- defaultTemplate: '<element-children></element-children>',
797
- plugins: [ScriptPlugin],
798
- },
799
- SERVICE: {
800
- component: exports.ElementComponent,
801
- plugins: [IOPlugin, ScriptPlugin],
802
- suppressTemplate: true,
803
- suppressStyles: true,
804
- },
805
- REFERENCE: {
806
- component: exports.ElementComponent,
807
- plugins: [IOPlugin, ScriptPlugin],
808
- suppressTemplate: true,
809
- },
810
- };
811
-
812
- var EXPORTED_CLASS_REGEX = /export class (\S+)/;
813
- var METADATA_DECORATOR_REGEX = /@ElementDefinition\(([\s\S]+)\)(\n|\r\n|.)*export class/g;
814
- var UiBuildError = /** @class */ (function (_super) {
815
- __extends(UiBuildError, _super);
816
- function UiBuildError(message, affectedMetadata) {
817
- var _this = _super.call(this, message) || this;
818
- _this.name = _this.constructor.name;
819
- _this.affectedMetadata = affectedMetadata;
820
- return _this;
821
- }
822
- return UiBuildError;
823
- }(Error));
824
- var elementToMetadata = function (el, parentPath) {
825
- var _a;
826
- var script = el.script && window.atob(el.script);
827
- var template = el.template && window.atob(el.template);
828
- var styles = el.styles && window.atob(el.styles);
829
- var exportedClassName = script && ((_a = EXPORTED_CLASS_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
830
- if (!exportedClassName) {
831
- throw new Error("Script doesn't have exported class");
832
- }
833
- var elementMetadata = extractElementMetadata(script || '');
834
- var path = (parentPath ? parentPath + '/' : '') + elementMetadata.name;
835
- return Object.assign(Object.assign({}, elementMetadata), { path: path, script: script === null || script === void 0 ? void 0 : script.replace(METADATA_DECORATOR_REGEX, 'export class'), template: template, styles: styles, children: el.children.map(function (child) { return elementToMetadata(child, path); }) });
836
- };
837
- var metadataToElement = function (metadata, recursive) {
838
- if (recursive === void 0) { recursive = true; }
839
- var elMetadata = {
840
- name: metadata.name,
841
- isShared: metadata.isShared,
842
- type: metadata.type,
843
- model: metadata.model,
844
- module: metadata.module,
845
- reference: metadata.reference,
846
- inputs: metadata.inputs,
847
- outputs: metadata.outputs,
848
- children: metadata.children.map(function (_e) {
849
- var name = _e.name;
850
- return name;
851
- }),
852
- configuredStyles: metadata.configuredStyles,
853
- };
854
- var normalizedElMetadata = normalizeElementMetadata(elMetadata);
855
- if (!metadata.script || !EXPORTED_CLASS_REGEX.test(metadata.script)) {
856
- throw new UiBuildError("'" + metadata.name + "' component script is missing an exported class", metadata);
857
- }
858
- var script = metadata.script &&
859
- window.btoa(metadata.script.replace(EXPORTED_CLASS_REGEX, "@ElementDefinition(" + stringifyElementMetadata(normalizedElMetadata) + ")\nexport class Script"));
860
- var template = metadata.template && window.btoa(metadata.template);
861
- var styles = metadata.styles && window.btoa(metadata.styles);
862
- return {
863
- script: script,
864
- template: template,
865
- styles: styles,
866
- children: recursive ? metadata.children.map(function (meta) { return metadataToElement(meta); }) : [],
867
- };
868
- };
869
- var normalizeElementMetadata = function (elementMetadata) {
870
- var _a, _b, _c, _d;
871
- var metadata = Object.assign({}, elementMetadata);
872
- // model
873
- var _e = (_a = metadata.model) !== null && _a !== void 0 ? _a : {}, lineItem = _e.lineItem, path = _e.path;
874
- var model = lineItem ? { lineItem: lineItem } : path ? { path: path } : undefined;
875
- if (model) {
876
- metadata.model = model;
877
- }
878
- else {
879
- delete metadata.model;
880
- }
881
- // module
882
- if (!metadata.module) {
883
- delete metadata.module;
884
- }
885
- // reference
886
- if (!metadata.reference) {
887
- delete metadata.reference;
888
- }
889
- // inputs
890
- var inputs = Object.entries((_b = metadata.inputs) !== null && _b !== void 0 ? _b : {}).reduce(function (acc, _e) {
891
- var _f;
892
- var _g = __read(_e, 2), key = _g[0], value = _g[1];
893
- return Object.assign(Object.assign({}, acc), (_f = {}, _f[key] = value || null, _f));
894
- }, {});
895
- if (inputs && Object.keys(inputs).length > 0) {
896
- metadata.inputs = inputs;
897
- }
898
- else {
899
- delete metadata.inputs;
900
- }
901
- // outputs
902
- var outputs = Object.entries((_c = metadata.outputs) !== null && _c !== void 0 ? _c : {}).reduce(function (acc, _e) {
903
- var _f;
904
- var _g = __read(_e, 2), key = _g[0], value = _g[1];
905
- return Object.assign(Object.assign({}, acc), (_f = {}, _f[key] = value || null, _f));
906
- }, {});
907
- if (outputs && Object.keys(outputs).length > 0) {
908
- metadata.outputs = outputs;
909
- }
910
- else {
911
- delete metadata.outputs;
912
- }
913
- // children
914
- if (!((_d = metadata.children) === null || _d === void 0 ? void 0 : _d.length)) {
915
- delete metadata.children;
916
- }
917
- // isShared
918
- if (!metadata.isShared) {
919
- delete metadata.isShared;
920
- }
921
- // configuredStyles
922
- if (!metadata.configuredStyles) {
923
- delete metadata.configuredStyles;
924
- }
925
- return metadata;
926
- };
927
- var extractElementMetadata = function (script) {
928
- var _a;
929
- var metadataString = ((_a = METADATA_DECORATOR_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
930
- // need to reset regex last index to prevent null result for next execution
931
- METADATA_DECORATOR_REGEX.lastIndex = 0;
932
- return new Function("return " + metadataString)();
933
- };
934
- var extendElementMetadata = function (script, extend) {
935
- var _a;
936
- var metadataString = ((_a = METADATA_DECORATOR_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
937
- // need to reset regex last index to prevent null result for next execution
938
- METADATA_DECORATOR_REGEX.lastIndex = 0;
939
- if (!metadataString) {
940
- return script;
941
- }
942
- var updated = Object.assign(Object.assign({}, new Function("return " + metadataString)()), extend);
943
- return script.replace(metadataString, stringifyElementMetadata(updated));
944
- };
945
- var getElementConfig = function (type) {
946
- return CONFIG[type];
947
- };
948
- var doesElementSupportIO = function (type) {
949
- var _a, _b;
950
- return (_b = (_a = getElementConfig(type).plugins) === null || _a === void 0 ? void 0 : _a.includes(IOPlugin)) !== null && _b !== void 0 ? _b : false;
951
- };
952
- function stringifyElementMetadata(elementMetadata) {
953
- var cleaned = JSON.stringify(elementMetadata, null, 2);
954
- return cleaned.replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm, function (match) {
955
- return match.replace(/"/g, '');
956
- });
957
- }
958
- var isValidScript = function (script) {
959
- var _a;
960
- if (!script) {
961
- return false;
962
- }
963
- var exportedClassName = script && ((_a = EXPORTED_CLASS_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
964
- if (!exportedClassName) {
965
- return false;
966
- }
967
- var meta = extractElementMetadata(script);
968
- if (!meta.name || !meta.type) {
969
- return false;
970
- }
971
- return true;
972
- };
973
- function flattenElements(elements) {
974
- return lodash.flatten(elements.map(function (el) { return __spreadArray([el], __read(flattenElements(el.children))); }));
975
- }
976
- function isSharedElement(el) {
977
- return Boolean(el.isShared) && el.type !== 'REFERENCE';
978
- }
979
-
980
- var ElementContextService = /** @class */ (function () {
981
- function ElementContextService() {
982
- }
983
- return ElementContextService;
984
- }());
985
- ElementContextService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementContextService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
986
- ElementContextService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementContextService });
987
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementContextService, decorators: [{
925
+ ElementContextService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementContextService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
926
+ ElementContextServiceprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementContextService });
927
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementContextService, decorators: [{
988
928
  type: i0.Injectable
989
929
  }] });
990
930
 
991
931
  var ElementRendererComponent = /** @class */ (function () {
992
- function ElementRendererComponent(parentInjector, dynamicModuleService, elementContext, ioProviderService, configurationService, elementRef, cdr) {
932
+ function ElementRendererComponent(parentInjector, runtimeService, elementContext, ioProviderService, configurationService, elementRef, cdr) {
993
933
  this.parentInjector = parentInjector;
994
- this.dynamicModuleService = dynamicModuleService;
934
+ this.runtimeService = runtimeService;
995
935
  this.elementContext = elementContext;
996
936
  this.ioProviderService = ioProviderService;
997
937
  this.configurationService = configurationService;
@@ -1002,7 +942,7 @@
1002
942
  }
1003
943
  ElementRendererComponent.prototype.ngOnInit = function () {
1004
944
  this.elementContext.metadata = this.meta;
1005
- this.factory = this.dynamicModuleService.getComponentFactory(this.meta);
945
+ this.factory = this.meta.path ? this.runtimeService.componentFactories[this.meta.path] : undefined;
1006
946
  this.createComponents();
1007
947
  };
1008
948
  ElementRendererComponent.prototype.ngOnDestroy = function () {
@@ -1135,9 +1075,9 @@
1135
1075
  };
1136
1076
  return ElementRendererComponent;
1137
1077
  }());
1138
- ElementRendererComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementRendererComponent, deps: [{ token: i0__namespace.Injector, skipSelf: true }, { token: DynamicModuleService }, { token: ElementContextService }, { token: IOProviderService }, { token: i2__namespace.ConfigurationService }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1139
- ElementRendererComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: { meta: "meta" }, providers: [ElementContextService], viewQueries: [{ propertyName: "el", first: true, predicate: ["el"], descendants: true, read: i0.ViewContainerRef, static: true }], ngImport: i0__namespace, template: "<ng-template #el></ng-template>\n", styles: [":host{display:contents}\n"], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1140
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementRendererComponent, decorators: [{
1078
+ ElementRendererComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementRendererComponent, deps: [{ token: i0__namespace.Injector, skipSelf: true }, { token: RuntimeService }, { token: ElementContextService }, { token: IOProviderService }, { token: i2__namespace.ConfigurationService }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1079
+ ElementRendererComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: { meta: "meta" }, providers: [ElementContextService], viewQueries: [{ propertyName: "el", first: true, predicate: ["el"], descendants: true, read: i0.ViewContainerRef, static: true }], ngImport: i0__namespace, template: "<ng-template #el></ng-template>\n", styles: [":host{display:contents}\n"], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1080
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementRendererComponent, decorators: [{
1141
1081
  type: i0.Component,
1142
1082
  args: [{
1143
1083
  selector: 'vl-cms-element-renderer',
@@ -1149,7 +1089,7 @@
1149
1089
  }], ctorParameters: function () {
1150
1090
  return [{ type: i0__namespace.Injector, decorators: [{
1151
1091
  type: i0.SkipSelf
1152
- }] }, { type: DynamicModuleService }, { type: ElementContextService }, { type: IOProviderService }, { type: i2__namespace.ConfigurationService }, { type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }];
1092
+ }] }, { type: RuntimeService }, { type: ElementContextService }, { type: IOProviderService }, { type: i2__namespace.ConfigurationService }, { type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }];
1153
1093
  }, propDecorators: { el: [{
1154
1094
  type: i0.ViewChild,
1155
1095
  args: ['el', { read: i0.ViewContainerRef, static: true }]
@@ -1157,204 +1097,566 @@
1157
1097
  type: i0.Input
1158
1098
  }] } });
1159
1099
 
1160
- var ElementChildrenComponent = /** @class */ (function () {
1161
- function ElementChildrenComponent(elementContext) {
1162
- this.elementContext = elementContext;
1163
- this.metadata = this.elementContext.metadata;
1164
- }
1165
- return ElementChildrenComponent;
1166
- }());
1167
- ElementChildrenComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementChildrenComponent, deps: [{ token: ElementContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1168
- ElementChildrenComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: ElementChildrenComponent, selector: "element-children", ngImport: i0__namespace, template: "<ng-container *ngIf=\"metadata?.children.length\">\n <ng-container *ngFor=\"let child of metadata.children\">\n <vl-cms-element-renderer [meta]=\"child\"></vl-cms-element-renderer>\n </ng-container>\n</ng-container>\n", styles: [":host{display:contents}\n"], components: [{ type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: ["meta"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1169
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementChildrenComponent, decorators: [{
1170
- type: i0.Component,
1171
- args: [{
1172
- // eslint-disable-next-line @angular-eslint/component-selector
1173
- selector: 'element-children',
1174
- templateUrl: 'element-children.component.html',
1175
- styleUrls: ['./element-children.component.scss'],
1176
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1177
- }]
1178
- }], ctorParameters: function () { return [{ type: ElementContextService }]; } });
1179
-
1180
- // eslint-disable-next-line @angular-eslint/directive-selector
1181
- var CustomTemplateDirective = /** @class */ (function () {
1182
- function CustomTemplateDirective(templateRef, templatesService) {
1183
- this.templateRef = templateRef;
1184
- this.templatesService = templatesService;
1100
+ var PreviewComponent = /** @class */ (function () {
1101
+ function PreviewComponent(runtimeService, configurationService, messageService, configurationRuntimeService, integrationState, cdr) {
1102
+ var _this = this;
1103
+ this.runtimeService = runtimeService;
1104
+ this.configurationService = configurationService;
1105
+ this.messageService = messageService;
1106
+ this.configurationRuntimeService = configurationRuntimeService;
1107
+ this.integrationState = integrationState;
1108
+ this.cdr = cdr;
1109
+ this.state$ = new rxjs.BehaviorSubject({ loading: true, failure: false });
1110
+ this.elements = [];
1111
+ this.destroy$ = new rxjs.Subject();
1112
+ this.runtimeService.updated$.pipe(rxjs.takeUntil(this.destroy$)).subscribe(function () { return _this.cdr.detectChanges(); });
1185
1113
  }
1186
- CustomTemplateDirective.prototype.ngAfterViewInit = function () {
1187
- if (!this.customTemplate) {
1188
- return;
1114
+ PreviewComponent.prototype.ngOnInit = function () {
1115
+ var _a;
1116
+ if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.suppressClearState)) {
1117
+ this.integrationState.clear();
1189
1118
  }
1190
- this.templatesService.register(this.customTemplate, this.templateRef);
1119
+ this.startPreview();
1191
1120
  };
1192
- return CustomTemplateDirective;
1193
- }());
1194
- CustomTemplateDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CustomTemplateDirective, deps: [{ token: i0__namespace.TemplateRef }, { token: TemplatesService }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1195
- CustomTemplateDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: CustomTemplateDirective, selector: "[customTemplate]", inputs: { customTemplate: "customTemplate" }, ngImport: i0__namespace });
1196
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CustomTemplateDirective, decorators: [{
1197
- type: i0.Directive,
1198
- args: [{ selector: '[customTemplate]' }]
1199
- }], ctorParameters: function () { return [{ type: i0__namespace.TemplateRef }, { type: TemplatesService }]; }, propDecorators: { customTemplate: [{
1200
- type: i0.Input
1201
- }] } });
1202
-
1203
- var defaultOptions = {
1204
- suppressLoading: false,
1205
- loadingLabel: 'LOADING',
1206
- };
1207
-
1208
- var moduleMap = {};
1209
- function loadRemoteEntry(remoteEntry) {
1210
- return new Promise(function (resolve, reject) {
1211
- if (moduleMap[remoteEntry]) {
1212
- resolve();
1121
+ PreviewComponent.prototype.ngOnDestroy = function () {
1122
+ this.destroy$.next();
1123
+ this.destroy$.complete();
1124
+ this.configurationService.reset();
1125
+ this.runtimeService.clear();
1126
+ };
1127
+ PreviewComponent.prototype.initializeConfiguration$ = function () {
1128
+ var _this = this;
1129
+ var isAlreadyInitialized = this.configurationRuntimeService.isInitialized;
1130
+ if (!this.uiDefinition || this.uiDefinition.type !== 'CONFIGURATION' || isAlreadyInitialized) {
1131
+ return rxjs.of({});
1132
+ }
1133
+ if (!this.modelId) {
1134
+ console.warn("No modelId is given for uiDefinition with '" + this.uiDefinition.type + "' type");
1135
+ return rxjs.of({});
1136
+ }
1137
+ // If still not initialized - init configuration in Test mode
1138
+ return this.configurationRuntimeService
1139
+ .initTestMode(this.modelId, this.uiDefinition)
1140
+ .pipe(rxjs.switchMap(function () { return _this.configurationService.configure(); }));
1141
+ };
1142
+ PreviewComponent.prototype.startPreview = function () {
1143
+ var _this = this;
1144
+ if (!this.uiDefinition) {
1213
1145
  return;
1214
1146
  }
1215
- var script = document.createElement('script');
1216
- script.src = remoteEntry;
1217
- script.onerror = reject;
1218
- script.onload = function () {
1219
- moduleMap[remoteEntry] = true;
1220
- resolve(); // window is the global namespace
1221
- };
1222
- document.body.append(script);
1223
- });
1224
- }
1225
- function lookupExposedModule(remoteName, exposedModule) {
1226
- return __awaiter(this, void 0, void 0, function () {
1227
- var container, factory, Module;
1228
- return __generator(this, function (_a) {
1229
- switch (_a.label) {
1230
- case 0:
1231
- // Initializes the share scope. This fills it with known provided modules from this build and all remotes
1232
- return [4 /*yield*/, __webpack_init_sharing__('default')];
1233
- case 1:
1234
- // Initializes the share scope. This fills it with known provided modules from this build and all remotes
1235
- _a.sent();
1236
- container = window[remoteName];
1237
- // Initialize the container, it may provide shared modules
1238
- return [4 /*yield*/, container.init(__webpack_share_scopes__.default)];
1239
- case 2:
1240
- // Initialize the container, it may provide shared modules
1241
- _a.sent();
1242
- return [4 /*yield*/, container.get(exposedModule)];
1243
- case 3:
1244
- factory = _a.sent();
1245
- Module = factory();
1246
- return [2 /*return*/, Module];
1147
+ rxjs.forkJoin([this.runtimeService.initialize$(this.uiDefinition, this.config), this.initializeConfiguration$()])
1148
+ .pipe(rxjs.tap(function (_c) {
1149
+ var _d = __read(_c, 1), elements = _d[0];
1150
+ _this.elements = elements;
1151
+ _this.state$.next({ loading: false, failure: false });
1152
+ }), rxjs.catchError(function (error) {
1153
+ var _a, _b;
1154
+ console.error(error);
1155
+ if (!((_b = (_a = _this.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.suppressToastMessages)) {
1156
+ _this.messageService.add({ severity: 'error', summary: error });
1247
1157
  }
1158
+ _this.state$.next({ loading: false, failure: true });
1159
+ return rxjs.of();
1160
+ }), rxjs.takeUntil(this.destroy$))
1161
+ .subscribe();
1162
+ };
1163
+ return PreviewComponent;
1164
+ }());
1165
+ PreviewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PreviewComponent, deps: [{ token: RuntimeService }, { token: i2__namespace.ConfigurationService }, { token: i3__namespace.MessageService }, { token: i2__namespace.ConfigurationRuntimeService }, { token: IntegrationState }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1166
+ PreviewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: PreviewComponent, selector: "vl-cms-preview", inputs: { modelId: "modelId", uiDefinition: "uiDefinition", config: "config" }, providers: [IOProviderService, TemplatesService], ngImport: i0__namespace, 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-element-renderer *ngFor=\"let el of elements\" [meta]=\"el\"></vl-cms-element-renderer>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [":host{flex-grow:1;display:flex;flex-direction:column;height:100%}\n"], components: [{ type: i1__namespace.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: ["meta"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i7__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.ShadowDom });
1167
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PreviewComponent, decorators: [{
1168
+ type: i0.Component,
1169
+ args: [{
1170
+ selector: 'vl-cms-preview',
1171
+ templateUrl: './preview.component.html',
1172
+ styleUrls: ['./preview.component.scss'],
1173
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1174
+ providers: [IOProviderService, TemplatesService],
1175
+ // use shadow DOM to prevent UI from being affected by global styles
1176
+ encapsulation: i0.ViewEncapsulation.ShadowDom,
1177
+ }]
1178
+ }], ctorParameters: function () { return [{ type: RuntimeService }, { type: i2__namespace.ConfigurationService }, { type: i3__namespace.MessageService }, { type: i2__namespace.ConfigurationRuntimeService }, { type: IntegrationState }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { modelId: [{
1179
+ type: i0.Input
1180
+ }], uiDefinition: [{
1181
+ type: i0.Input
1182
+ }], config: [{
1183
+ type: i0.Input
1184
+ }] } });
1185
+
1186
+ var RuntimeEditorService = /** @class */ (function () {
1187
+ function RuntimeEditorService(runtimeService) {
1188
+ var _this = this;
1189
+ this.runtimeService = runtimeService;
1190
+ this.editorModeSubj$ = new rxjs.BehaviorSubject(false);
1191
+ this.dragMode$ = new rxjs.BehaviorSubject(false);
1192
+ this.elementDropped$ = new rxjs.ReplaySubject();
1193
+ this.elementDeleted$ = new rxjs.ReplaySubject();
1194
+ this.editorMode$ = this.editorModeSubj$.asObservable();
1195
+ this.runtimeService.isInitialized$.subscribe(function () { var _a; return _this.editorModeSubj$.next(Boolean((_a = _this.runtimeService.config) === null || _a === void 0 ? void 0 : _a.uiBuilderMode)); });
1196
+ }
1197
+ RuntimeEditorService.prototype.applyPatch$ = function (patch) {
1198
+ return this.runtimeService.applyPatch$(patch);
1199
+ };
1200
+ RuntimeEditorService.prototype.toggleEditorMode = function () {
1201
+ this.editorModeSubj$.next(!this.editorModeSubj$.value);
1202
+ };
1203
+ return RuntimeEditorService;
1204
+ }());
1205
+ RuntimeEditorService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeEditorService, deps: [{ token: RuntimeService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1206
+ RuntimeEditorService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeEditorService });
1207
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeEditorService, decorators: [{
1208
+ type: i0.Injectable
1209
+ }], ctorParameters: function () { return [{ type: RuntimeService }]; } });
1210
+
1211
+ var ElementDropHandleComponent = /** @class */ (function () {
1212
+ function ElementDropHandleComponent(runtimeService) {
1213
+ this.runtimeService = runtimeService;
1214
+ }
1215
+ ElementDropHandleComponent.prototype.handleDrop = function (e) {
1216
+ this.runtimeService.elementDropped$.next({
1217
+ element: e.data,
1218
+ index: this.index,
1219
+ path: this.parentPath,
1248
1220
  });
1249
- });
1221
+ };
1222
+ return ElementDropHandleComponent;
1223
+ }());
1224
+ ElementDropHandleComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementDropHandleComponent, deps: [{ token: RuntimeEditorService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1225
+ ElementDropHandleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ElementDropHandleComponent, selector: "vl-element-drop-handle", inputs: { index: "index", parentPath: "parentPath" }, ngImport: i0__namespace, template: "<div class=\"container\" dndDropzone (dndDrop)=\"handleDrop($event)\">\n <div class=\"handle\"></div>\n</div>\n", styles: [":host{width:0;position:relative}.container{width:40px;height:100%;position:absolute;transform:translate(-50%);display:flex;justify-content:center;align-items:center}.handle{display:none;background:red;height:calc(100% - 10px);width:2px;pointer-events:none}.container.dndDragover .handle{display:block}\n"], directives: [{ type: i2__namespace$1.DndDropzoneDirective, selector: "[dndDropzone]", inputs: ["dndDropzone", "dndEffectAllowed", "dndAllowExternal", "dndHorizontal", "dndDragoverClass", "dndDropzoneDisabledClass", "dndDisableIf", "dndDisableDropIf"], outputs: ["dndDragover", "dndDrop"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1226
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementDropHandleComponent, decorators: [{
1227
+ type: i0.Component,
1228
+ args: [{
1229
+ selector: 'vl-element-drop-handle',
1230
+ templateUrl: './element-drop-handle.component.html',
1231
+ styleUrls: ['./element-drop-handle.component.scss'],
1232
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1233
+ }]
1234
+ }], ctorParameters: function () { return [{ type: RuntimeEditorService }]; }, propDecorators: { index: [{
1235
+ type: i0.Input
1236
+ }], parentPath: [{
1237
+ type: i0.Input
1238
+ }] } });
1239
+
1240
+ var ElementDropHandleModule = /** @class */ (function () {
1241
+ function ElementDropHandleModule() {
1242
+ }
1243
+ return ElementDropHandleModule;
1244
+ }());
1245
+ ElementDropHandleModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementDropHandleModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1246
+ ElementDropHandleModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementDropHandleModule, declarations: [ElementDropHandleComponent], imports: [i7.CommonModule, i2$1.DndModule], exports: [ElementDropHandleComponent] });
1247
+ ElementDropHandleModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementDropHandleModule, imports: [[i7.CommonModule, i2$1.DndModule]] });
1248
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementDropHandleModule, decorators: [{
1249
+ type: i0.NgModule,
1250
+ args: [{
1251
+ declarations: [ElementDropHandleComponent],
1252
+ imports: [i7.CommonModule, i2$1.DndModule],
1253
+ exports: [ElementDropHandleComponent],
1254
+ }]
1255
+ }] });
1256
+
1257
+ var ElementRendererModule = /** @class */ (function () {
1258
+ function ElementRendererModule() {
1259
+ }
1260
+ return ElementRendererModule;
1261
+ }());
1262
+ ElementRendererModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementRendererModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1263
+ ElementRendererModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementRendererModule, declarations: [ElementRendererComponent], exports: [ElementRendererComponent] });
1264
+ ElementRendererModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementRendererModule });
1265
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementRendererModule, decorators: [{
1266
+ type: i0.NgModule,
1267
+ args: [{
1268
+ declarations: [ElementRendererComponent],
1269
+ exports: [ElementRendererComponent],
1270
+ }]
1271
+ }] });
1272
+
1273
+ var ElementChildrenComponent = /** @class */ (function () {
1274
+ function ElementChildrenComponent(elementContext, runtimeService, runtimeEditorService, cdr) {
1275
+ var _this = this;
1276
+ var _a, _b;
1277
+ this.elementContext = elementContext;
1278
+ this.runtimeService = runtimeService;
1279
+ this.runtimeEditorService = runtimeEditorService;
1280
+ this.cdr = cdr;
1281
+ this.destroyed$ = new rxjs.Subject();
1282
+ var path = (_b = (_a = this.elementContext) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.path;
1283
+ this.metadata$ = path ? this.runtimeService.getCompiledElement$(path) : rxjs.of(undefined);
1284
+ this.dragMode$ = rxjs.combineLatest([this.runtimeEditorService.editorMode$, this.runtimeEditorService.dragMode$]).pipe(rxjs.map(function (flags) { return flags.every(Boolean); }));
1285
+ this.runtimeService.updated$.pipe(rxjs.takeUntil(this.destroyed$)).subscribe(function () { return _this.cdr.detectChanges(); });
1286
+ }
1287
+ ElementChildrenComponent.prototype.ngOnDestroy = function () {
1288
+ this.destroyed$.next();
1289
+ this.destroyed$.complete();
1290
+ };
1291
+ return ElementChildrenComponent;
1292
+ }());
1293
+ ElementChildrenComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementChildrenComponent, deps: [{ token: ElementContextService }, { token: RuntimeService }, { token: RuntimeEditorService }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1294
+ ElementChildrenComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ElementChildrenComponent, selector: "element-children", ngImport: i0__namespace, template: "<ng-container *ngIf=\"metadata$ | async as metadata\">\n <vl-element-drop-handle *ngIf=\"dragMode$ | async\" [index]=\"0\" [parentPath]=\"metadata.path\"></vl-element-drop-handle>\n <ng-container *ngFor=\"let child of metadata.children; let i = index\">\n <vl-cms-element-renderer [meta]=\"child\"></vl-cms-element-renderer>\n <vl-element-drop-handle\n *ngIf=\"dragMode$ | async\"\n [index]=\"i + 1\"\n [parentPath]=\"metadata.path\"\n ></vl-element-drop-handle>\n </ng-container>\n</ng-container>\n", styles: [":host{display:contents}\n"], components: [{ type: ElementDropHandleComponent, selector: "vl-element-drop-handle", inputs: ["index", "parentPath"] }, { type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: ["meta"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1295
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementChildrenComponent, decorators: [{
1296
+ type: i0.Component,
1297
+ args: [{
1298
+ // eslint-disable-next-line @angular-eslint/component-selector
1299
+ selector: 'element-children',
1300
+ templateUrl: 'element-children.component.html',
1301
+ styleUrls: ['./element-children.component.scss'],
1302
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
1303
+ }]
1304
+ }], ctorParameters: function () { return [{ type: ElementContextService }, { type: RuntimeService }, { type: RuntimeEditorService }, { type: i0__namespace.ChangeDetectorRef }]; } });
1305
+
1306
+ var ElementChildrenModule = /** @class */ (function () {
1307
+ function ElementChildrenModule() {
1308
+ }
1309
+ return ElementChildrenModule;
1310
+ }());
1311
+ ElementChildrenModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementChildrenModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1312
+ ElementChildrenModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementChildrenModule, declarations: [ElementChildrenComponent], imports: [i1.LetDirectiveModule, ElementRendererModule, ElementDropHandleModule], exports: [ElementChildrenComponent] });
1313
+ ElementChildrenModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementChildrenModule, imports: [[i1.LetDirectiveModule, ElementRendererModule, ElementDropHandleModule]] });
1314
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ElementChildrenModule, decorators: [{
1315
+ type: i0.NgModule,
1316
+ args: [{
1317
+ declarations: [ElementChildrenComponent],
1318
+ imports: [i1.LetDirectiveModule, ElementRendererModule, ElementDropHandleModule],
1319
+ exports: [ElementChildrenComponent],
1320
+ }]
1321
+ }] });
1322
+
1323
+ var PreviewModule = /** @class */ (function () {
1324
+ function PreviewModule() {
1325
+ }
1326
+ return PreviewModule;
1327
+ }());
1328
+ PreviewModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PreviewModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1329
+ PreviewModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PreviewModule, declarations: [PreviewComponent], imports: [i7.CommonModule, i1.LoaderModule, ElementRendererModule, ElementChildrenModule, ElementDropHandleModule], exports: [PreviewComponent] });
1330
+ PreviewModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PreviewModule, providers: [IntegrationState], imports: [[i7.CommonModule, i1.LoaderModule, ElementRendererModule, ElementChildrenModule, ElementDropHandleModule]] });
1331
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PreviewModule, decorators: [{
1332
+ type: i0.NgModule,
1333
+ args: [{
1334
+ declarations: [PreviewComponent],
1335
+ imports: [i7.CommonModule, i1.LoaderModule, ElementRendererModule, ElementChildrenModule, ElementDropHandleModule],
1336
+ providers: [IntegrationState],
1337
+ exports: [PreviewComponent],
1338
+ }]
1339
+ }] });
1340
+
1341
+ function ElementDefinition(definition) {
1342
+ return function (constructor) {
1343
+ return constructor;
1344
+ };
1250
1345
  }
1251
- function loadRemoteModule(remoteEntry, remoteName, exposedModule) {
1252
- return __awaiter(this, void 0, void 0, function () {
1253
- return __generator(this, function (_a) {
1254
- switch (_a.label) {
1255
- case 0: return [4 /*yield*/, loadRemoteEntry(remoteEntry)];
1256
- case 1:
1257
- _a.sent();
1258
- return [4 /*yield*/, lookupExposedModule(remoteName, exposedModule)];
1259
- case 2: return [2 /*return*/, _a.sent()];
1346
+
1347
+ // eslint-disable-next-line @angular-eslint/directive-selector
1348
+ var CustomTemplateDirective = /** @class */ (function () {
1349
+ function CustomTemplateDirective(templateRef, templatesService) {
1350
+ this.templateRef = templateRef;
1351
+ this.templatesService = templatesService;
1352
+ }
1353
+ CustomTemplateDirective.prototype.ngAfterViewInit = function () {
1354
+ if (!this.customTemplate) {
1355
+ return;
1356
+ }
1357
+ this.templatesService.register(this.customTemplate, this.templateRef);
1358
+ };
1359
+ return CustomTemplateDirective;
1360
+ }());
1361
+ CustomTemplateDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomTemplateDirective, deps: [{ token: i0__namespace.TemplateRef }, { token: TemplatesService }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1362
+ CustomTemplateDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: CustomTemplateDirective, selector: "[customTemplate]", inputs: { customTemplate: "customTemplate" }, ngImport: i0__namespace });
1363
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomTemplateDirective, decorators: [{
1364
+ type: i0.Directive,
1365
+ args: [{ selector: '[customTemplate]' }]
1366
+ }], ctorParameters: function () { return [{ type: i0__namespace.TemplateRef }, { type: TemplatesService }]; }, propDecorators: { customTemplate: [{
1367
+ type: i0.Input
1368
+ }] } });
1369
+
1370
+ var IOPlugin = /** @class */ (function () {
1371
+ function IOPlugin(host) {
1372
+ var _this = this;
1373
+ var _a, _b;
1374
+ this.host = host;
1375
+ var elementMetadata = this.host.injector.get(ELEMENT_METADATA);
1376
+ var inputProvider = this.host.injector.get(IOProviderService);
1377
+ var inputs = Object.entries((_a = elementMetadata.inputs) !== null && _a !== void 0 ? _a : {});
1378
+ var outputs = Object.entries((_b = elementMetadata.outputs) !== null && _b !== void 0 ? _b : {});
1379
+ inputs.forEach(function (_c) {
1380
+ var _d = __read(_c, 2), key = _d[0], path = _d[1];
1381
+ var _a;
1382
+ if (path && typeof path !== 'string') {
1383
+ console.error("The value of '" + key + "' input should be a string");
1384
+ }
1385
+ if (((_a = elementMetadata.outputs) === null || _a === void 0 ? void 0 : _a[key]) !== undefined) {
1386
+ console.warn("'" + key + "' appears both in inputs and outputs. To prevent inconsistent behavior please keep them unique ");
1387
+ }
1388
+ _this.host[key] = inputProvider.connect(elementMetadata, key, path);
1389
+ });
1390
+ outputs.forEach(function (_c) {
1391
+ var _d = __read(_c, 2), key = _d[0], path = _d[1];
1392
+ if (path && typeof path !== 'string') {
1393
+ console.error("The value of '" + key + "' output should be a string");
1260
1394
  }
1395
+ _this.host[key] = inputProvider.provide(elementMetadata, key, path);
1261
1396
  });
1397
+ }
1398
+ return IOPlugin;
1399
+ }());
1400
+ IOPlugin.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IOPlugin, deps: [{ token: exports.ElementComponent }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1401
+ IOPlugin.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: IOPlugin, ngImport: i0__namespace });
1402
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: IOPlugin, decorators: [{
1403
+ type: i0.Directive
1404
+ }], ctorParameters: function () { return [{ type: exports.ElementComponent }]; } });
1405
+
1406
+ var ScriptPlugin = /** @class */ (function () {
1407
+ function ScriptPlugin(host) {
1408
+ var _this = this;
1409
+ this.host = host;
1410
+ this.normalizeImports = function (script, elementPath) {
1411
+ var regexp = new RegExp("import([ \\n\\t]*(?:[^ \\n\\t\\{\\}]+[ \\n\\t]*,?)?(?:[ \\n\\t]*\\{(?:[ \\n\\t]*[^ \\n\\t\"'\\{\\}]+[ \\n\\t]*,?)+\\})?[ \\n\\t]*)from[ \\n\\t]*(['\"])([^'\"\\n]+)(?:['\"]);", 'g');
1412
+ var result = script.replace(regexp, function (match, g1, g2, src) {
1413
+ var imports = g1
1414
+ .trim()
1415
+ .slice(1, -1)
1416
+ .split(',')
1417
+ .map(function (item) { return item.trim(); });
1418
+ imports.forEach(function (item) {
1419
+ var _a;
1420
+ if (!((_a = _this.vendorMap[src]) === null || _a === void 0 ? void 0 : _a[item])) {
1421
+ throw new Error("Failed to import " + item + " from '" + src + "' in " + elementPath + "/script.ts");
1422
+ }
1423
+ });
1424
+ return "const " + g1 + " = vendor['" + src + "'];";
1425
+ });
1426
+ return result;
1427
+ };
1428
+ this.document = this.host.injector.get(i7.DOCUMENT);
1429
+ this.vendorMap = this.host.injector.get(VENDOR_MAP);
1430
+ var elementMetadata = this.host.injector.get(ELEMENT_METADATA);
1431
+ var sharedElementMetadata = this.host.injector.get(SHARED_ELEMENT_METADATA);
1432
+ this.addScript(sharedElementMetadata);
1433
+ this.addScript(elementMetadata);
1434
+ }
1435
+ ScriptPlugin.prototype.addScript = function (metadata) {
1436
+ var _a;
1437
+ if (!(metadata === null || metadata === void 0 ? void 0 : metadata.script)) {
1438
+ return;
1439
+ }
1440
+ var id = btoa(core.UUID.UUID());
1441
+ var script = this.document.createElement('script');
1442
+ script.type = "text/javascript";
1443
+ var scriptContent = this.normalizeImports(metadata.script, (_a = metadata.path) !== null && _a !== void 0 ? _a : metadata.name);
1444
+ var classMatch = /export class (\S+)/.exec(scriptContent);
1445
+ var className = classMatch === null || classMatch === void 0 ? void 0 : classMatch[1];
1446
+ if (!classMatch || !className) {
1447
+ console.error("Script doesn't have exported class");
1448
+ return;
1449
+ }
1450
+ scriptContent = scriptContent.replace(classMatch[0], "class " + className);
1451
+ script.text = "var " + id + " = function(vendor) {" + scriptContent + "\n return " + className + "; };";
1452
+ this.document.body.appendChild(script);
1453
+ var ScriptClass = window[id](this.vendorMap);
1454
+ if (ScriptClass instanceof Object) {
1455
+ this.host.registerPlugin(new ScriptClass(this.host));
1456
+ }
1457
+ this.document.body.removeChild(script);
1458
+ };
1459
+ return ScriptPlugin;
1460
+ }());
1461
+ ScriptPlugin.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ScriptPlugin, deps: [{ token: exports.ElementComponent }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1462
+ ScriptPlugin.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: ScriptPlugin, ngImport: i0__namespace });
1463
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ScriptPlugin, decorators: [{
1464
+ type: i0.Directive
1465
+ }], ctorParameters: function () { return [{ type: exports.ElementComponent }]; } });
1466
+
1467
+ /*
1468
+ * ScriptPlugin must always be the last plugin in the list to make sure user code is running after all pre-initializers.
1469
+ */
1470
+ var CONFIG = {
1471
+ CUSTOM: {
1472
+ component: exports.ElementComponent,
1473
+ plugins: [IOPlugin, ScriptPlugin],
1474
+ },
1475
+ CONTAINER: {
1476
+ component: exports.ElementComponent,
1477
+ defaultTemplate: '<element-children></element-children>',
1478
+ plugins: [ScriptPlugin],
1479
+ },
1480
+ SERVICE: {
1481
+ component: exports.ElementComponent,
1482
+ plugins: [IOPlugin, ScriptPlugin],
1483
+ suppressTemplate: true,
1484
+ suppressStyles: true,
1485
+ },
1486
+ REFERENCE: {
1487
+ component: exports.ElementComponent,
1488
+ plugins: [IOPlugin, ScriptPlugin],
1489
+ suppressTemplate: true,
1490
+ },
1491
+ };
1492
+
1493
+ var EXPORTED_CLASS_REGEX = /export class (\S+)/;
1494
+ var METADATA_DECORATOR_REGEX = /@ElementDefinition\(([\s\S]+)\)(\n|\r\n|.)*export class/g;
1495
+ var UiBuildError = /** @class */ (function (_super) {
1496
+ __extends(UiBuildError, _super);
1497
+ function UiBuildError(message, affectedMetadata) {
1498
+ var _this = _super.call(this, message) || this;
1499
+ _this.name = _this.constructor.name;
1500
+ _this.affectedMetadata = affectedMetadata;
1501
+ return _this;
1502
+ }
1503
+ return UiBuildError;
1504
+ }(Error));
1505
+ var elementToMetadata = function (el, parentPath) {
1506
+ var _a;
1507
+ var script = el.script && window.atob(el.script);
1508
+ var template = el.template && window.atob(el.template);
1509
+ var styles = el.styles && window.atob(el.styles);
1510
+ var exportedClassName = script && ((_a = EXPORTED_CLASS_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
1511
+ if (!exportedClassName) {
1512
+ throw new Error("Script doesn't have exported class");
1513
+ }
1514
+ var elementMetadata = extractElementMetadata(script || '');
1515
+ var path = (parentPath ? parentPath + '/' : '') + elementMetadata.name;
1516
+ return Object.assign(Object.assign({}, elementMetadata), { path: path, script: script === null || script === void 0 ? void 0 : script.replace(METADATA_DECORATOR_REGEX, 'export class'), template: template, styles: styles, children: el.children.map(function (child) { return elementToMetadata(child, path); }) });
1517
+ };
1518
+ var metadataToElement = function (metadata, recursive) {
1519
+ if (recursive === void 0) { recursive = true; }
1520
+ var elMetadata = {
1521
+ name: metadata.name,
1522
+ isShared: metadata.isShared,
1523
+ type: metadata.type,
1524
+ model: metadata.model,
1525
+ module: metadata.module,
1526
+ reference: metadata.reference,
1527
+ inputs: metadata.inputs,
1528
+ outputs: metadata.outputs,
1529
+ children: metadata.children.map(function (_e) {
1530
+ var name = _e.name;
1531
+ return name;
1532
+ }),
1533
+ configuredStyles: metadata.configuredStyles,
1534
+ };
1535
+ var normalizedElMetadata = normalizeElementMetadata(elMetadata);
1536
+ if (!metadata.script || !EXPORTED_CLASS_REGEX.test(metadata.script)) {
1537
+ throw new UiBuildError("'" + metadata.name + "' component script is missing an exported class", metadata);
1538
+ }
1539
+ var script = metadata.script &&
1540
+ window.btoa(metadata.script.replace(EXPORTED_CLASS_REGEX, "@ElementDefinition(" + stringifyElementMetadata(normalizedElMetadata) + ")\nexport class Script"));
1541
+ var template = metadata.template && window.btoa(metadata.template);
1542
+ var styles = metadata.styles && window.btoa(metadata.styles);
1543
+ return {
1544
+ script: script,
1545
+ template: template,
1546
+ styles: styles,
1547
+ children: recursive ? metadata.children.map(function (meta) { return metadataToElement(meta); }) : [],
1548
+ };
1549
+ };
1550
+ var normalizeElementMetadata = function (elementMetadata) {
1551
+ var _a, _b, _c, _d;
1552
+ var metadata = Object.assign({}, elementMetadata);
1553
+ // model
1554
+ var _e = (_a = metadata.model) !== null && _a !== void 0 ? _a : {}, lineItem = _e.lineItem, path = _e.path;
1555
+ var model = lineItem ? { lineItem: lineItem } : path ? { path: path } : undefined;
1556
+ if (model) {
1557
+ metadata.model = model;
1558
+ }
1559
+ else {
1560
+ delete metadata.model;
1561
+ }
1562
+ // module
1563
+ if (!metadata.module) {
1564
+ delete metadata.module;
1565
+ }
1566
+ // reference
1567
+ if (!metadata.reference) {
1568
+ delete metadata.reference;
1569
+ }
1570
+ // inputs
1571
+ var inputs = Object.entries((_b = metadata.inputs) !== null && _b !== void 0 ? _b : {}).reduce(function (acc, _e) {
1572
+ var _f;
1573
+ var _g = __read(_e, 2), key = _g[0], value = _g[1];
1574
+ return Object.assign(Object.assign({}, acc), (_f = {}, _f[key] = value || null, _f));
1575
+ }, {});
1576
+ if (inputs && Object.keys(inputs).length > 0) {
1577
+ metadata.inputs = inputs;
1578
+ }
1579
+ else {
1580
+ delete metadata.inputs;
1581
+ }
1582
+ // outputs
1583
+ var outputs = Object.entries((_c = metadata.outputs) !== null && _c !== void 0 ? _c : {}).reduce(function (acc, _e) {
1584
+ var _f;
1585
+ var _g = __read(_e, 2), key = _g[0], value = _g[1];
1586
+ return Object.assign(Object.assign({}, acc), (_f = {}, _f[key] = value || null, _f));
1587
+ }, {});
1588
+ if (outputs && Object.keys(outputs).length > 0) {
1589
+ metadata.outputs = outputs;
1590
+ }
1591
+ else {
1592
+ delete metadata.outputs;
1593
+ }
1594
+ // children
1595
+ if (!((_d = metadata.children) === null || _d === void 0 ? void 0 : _d.length)) {
1596
+ delete metadata.children;
1597
+ }
1598
+ // isShared
1599
+ if (!metadata.isShared) {
1600
+ delete metadata.isShared;
1601
+ }
1602
+ // configuredStyles
1603
+ if (!metadata.configuredStyles) {
1604
+ delete metadata.configuredStyles;
1605
+ }
1606
+ return metadata;
1607
+ };
1608
+ var extractElementMetadata = function (script) {
1609
+ var _a;
1610
+ var metadataString = ((_a = METADATA_DECORATOR_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
1611
+ // need to reset regex last index to prevent null result for next execution
1612
+ METADATA_DECORATOR_REGEX.lastIndex = 0;
1613
+ return new Function("return " + metadataString)();
1614
+ };
1615
+ var extendElementMetadata = function (script, extend) {
1616
+ var _a;
1617
+ var metadataString = ((_a = METADATA_DECORATOR_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
1618
+ // need to reset regex last index to prevent null result for next execution
1619
+ METADATA_DECORATOR_REGEX.lastIndex = 0;
1620
+ if (!metadataString) {
1621
+ return script;
1622
+ }
1623
+ var updated = Object.assign(Object.assign({}, new Function("return " + metadataString)()), extend);
1624
+ return script.replace(metadataString, stringifyElementMetadata(updated));
1625
+ };
1626
+ var getElementConfig = function (type) {
1627
+ return CONFIG[type];
1628
+ };
1629
+ var doesElementSupportIO = function (type) {
1630
+ var _a, _b;
1631
+ return (_b = (_a = getElementConfig(type).plugins) === null || _a === void 0 ? void 0 : _a.includes(IOPlugin)) !== null && _b !== void 0 ? _b : false;
1632
+ };
1633
+ function stringifyElementMetadata(elementMetadata) {
1634
+ var cleaned = JSON.stringify(elementMetadata, null, 2);
1635
+ return cleaned.replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm, function (match) {
1636
+ return match.replace(/"/g, '');
1262
1637
  });
1263
1638
  }
1264
-
1265
- var FederatedComponent = /** @class */ (function () {
1266
- function FederatedComponent(injector, compiler, appRef, renderer) {
1267
- this.injector = injector;
1268
- this.compiler = compiler;
1269
- this.appRef = appRef;
1270
- this.renderer = renderer;
1271
- this.isLoading$ = new rxjs.BehaviorSubject(false);
1272
- // configs
1273
- this.suppressLoading = defaultOptions.suppressLoading;
1274
- this.loadingLabel = defaultOptions.loadingLabel;
1639
+ var isValidScript = function (script) {
1640
+ var _a;
1641
+ if (!script) {
1642
+ return false;
1275
1643
  }
1276
- FederatedComponent.prototype.ngOnChanges = function (changes) {
1277
- var _a, _b, _c, _d;
1278
- if (changes.data && this.instance) {
1279
- this.instance.data = this.data;
1280
- }
1281
- if (changes.options) {
1282
- this.suppressLoading = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.suppressLoading) !== null && _b !== void 0 ? _b : defaultOptions.suppressLoading;
1283
- this.loadingLabel = (_d = (_c = this.options) === null || _c === void 0 ? void 0 : _c.loadingLabel) !== null && _d !== void 0 ? _d : defaultOptions.loadingLabel;
1284
- }
1285
- };
1286
- FederatedComponent.prototype.ngOnInit = function () {
1287
- this.isLoading$.next(true);
1288
- };
1289
- FederatedComponent.prototype.ngAfterViewInit = function () {
1290
- var _this = this;
1291
- var _a, _b, _c, _d, _e, _f;
1292
- var remoteEntry = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.remoteEntry) !== null && _b !== void 0 ? _b : this.remoteEntry;
1293
- var remoteName = (_d = (_c = this.options) === null || _c === void 0 ? void 0 : _c.remoteName) !== null && _d !== void 0 ? _d : this.remoteName;
1294
- var exposedModule = (_f = (_e = this.options) === null || _e === void 0 ? void 0 : _e.exposedModule) !== null && _f !== void 0 ? _f : this.exposedModule;
1295
- if (!remoteEntry || !remoteName || !exposedModule) {
1296
- return;
1297
- }
1298
- loadRemoteModule(remoteEntry, remoteName, exposedModule).then(function (federated) {
1299
- _this.compiler.compileModuleAsync(federated[exposedModule]).then(function (moduleFactory) {
1300
- var _a, _b, _c;
1301
- var rootModuleRef = moduleFactory.create(_this.injector);
1302
- var rootComponentFactory = rootModuleRef.componentFactoryResolver.resolveComponentFactory(federated[exposedModule].rootComponent);
1303
- var node = document.createElement('div');
1304
- var _g = rootComponentFactory.create(_this.injector, [], node), instance = _g.instance, hostView = _g.hostView;
1305
- _this.instance = instance;
1306
- _this.instance.data = _this.data;
1307
- _this.renderer.appendChild((_a = _this.moduleHostRef) === null || _a === void 0 ? void 0 : _a.nativeElement, node);
1308
- _this.appRef.attachView(hostView);
1309
- (_c = (_b = _this.options) === null || _b === void 0 ? void 0 : _b.onReady) === null || _c === void 0 ? void 0 : _c.call(_b);
1310
- _this.isLoading$.next(false);
1311
- });
1312
- });
1313
- };
1314
- return FederatedComponent;
1315
- }());
1316
- FederatedComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FederatedComponent, deps: [{ token: i0__namespace.Injector }, { token: i0__namespace.Compiler }, { token: i0__namespace.ApplicationRef }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Component });
1317
- FederatedComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: FederatedComponent, selector: "veloce-host-federated", inputs: { remoteEntry: "remoteEntry", remoteName: "remoteName", exposedModule: "exposedModule", data: "data", options: "options" }, viewQueries: [{ propertyName: "moduleHostRef", first: true, predicate: ["moduleHost"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div #moduleHost></div>\n\n<vl-loader *ngIf=\"!suppressLoading && (isLoading$ | async)\" [label]=\"loadingLabel\"></vl-loader>\n", styles: [":host{display:block}div{height:100%}\n"], components: [{ type: i1__namespace.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i7__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
1318
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FederatedComponent, decorators: [{
1319
- type: i0.Component,
1320
- args: [{
1321
- // eslint-disable-next-line @angular-eslint/component-selector
1322
- selector: 'veloce-host-federated',
1323
- templateUrl: './federated.component.html',
1324
- styleUrls: ['./federated.component.scss'],
1325
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1326
- }]
1327
- }], ctorParameters: function () { return [{ type: i0__namespace.Injector }, { type: i0__namespace.Compiler }, { type: i0__namespace.ApplicationRef }, { type: i0__namespace.Renderer2 }]; }, propDecorators: { moduleHostRef: [{
1328
- type: i0.ViewChild,
1329
- args: ['moduleHost', { static: false }]
1330
- }], remoteEntry: [{
1331
- type: i0.Input
1332
- }], remoteName: [{
1333
- type: i0.Input
1334
- }], exposedModule: [{
1335
- type: i0.Input
1336
- }], data: [{
1337
- type: i0.Input
1338
- }], options: [{
1339
- type: i0.Input
1340
- }] } });
1341
-
1342
- var FederatedModule = /** @class */ (function () {
1343
- function FederatedModule() {
1644
+ var exportedClassName = script && ((_a = EXPORTED_CLASS_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
1645
+ if (!exportedClassName) {
1646
+ return false;
1344
1647
  }
1345
- return FederatedModule;
1346
- }());
1347
- FederatedModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FederatedModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1348
- FederatedModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FederatedModule, declarations: [FederatedComponent], imports: [i7.CommonModule, i1.LoaderModule], exports: [FederatedComponent] });
1349
- FederatedModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FederatedModule, imports: [[i7.CommonModule, i1.LoaderModule]] });
1350
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FederatedModule, decorators: [{
1351
- type: i0.NgModule,
1352
- args: [{
1353
- declarations: [FederatedComponent],
1354
- imports: [i7.CommonModule, i1.LoaderModule],
1355
- exports: [FederatedComponent],
1356
- }]
1357
- }] });
1648
+ var meta = extractElementMetadata(script);
1649
+ if (!meta.name || !meta.type) {
1650
+ return false;
1651
+ }
1652
+ return true;
1653
+ };
1654
+ function flattenElements(elements) {
1655
+ return lodash.flatten(elements.map(function (el) { return __spreadArray([el], __read(flattenElements(el.children))); }));
1656
+ }
1657
+ function isSharedElement(el) {
1658
+ return Boolean(el.isShared) && el.type !== 'REFERENCE';
1659
+ }
1358
1660
 
1359
1661
  var ConfigurationPlugin = /** @class */ (function () {
1360
1662
  function ConfigurationPlugin(host) {
@@ -1399,7 +1701,15 @@
1399
1701
  }
1400
1702
  _this.configurationService.patch(new i2.LineItemWorker(rootLineItem).remove(_this.modelSnapshot.id).li);
1401
1703
  };
1704
+ var updateQty = function (qty) {
1705
+ var rootLineItem = _this.configurationService.getSnapshot();
1706
+ if (!rootLineItem || !_this.modelSnapshot) {
1707
+ return;
1708
+ }
1709
+ _this.configurationService.patch(new i2.LineItemWorker(rootLineItem).replace(Object.assign(Object.assign({}, _this.modelSnapshot), { qty: qty })).li);
1710
+ };
1402
1711
  this.typeHost.remove = remove;
1712
+ this.typeHost.updateQty = updateQty;
1403
1713
  };
1404
1714
  ConfigurationPlugin.prototype.registerPort = function (name) {
1405
1715
  var _this = this;
@@ -1460,9 +1770,9 @@
1460
1770
  });
1461
1771
  return ConfigurationPlugin;
1462
1772
  }());
1463
- ConfigurationPlugin.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ConfigurationPlugin, deps: "invalid", target: i0__namespace.ɵɵFactoryTarget.Directive });
1464
- ConfigurationPlugin.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: ConfigurationPlugin, ngImport: i0__namespace });
1465
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ConfigurationPlugin, decorators: [{
1773
+ ConfigurationPlugin.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ConfigurationPlugin, deps: "invalid", target: i0__namespace.ɵɵFactoryTarget.Directive });
1774
+ ConfigurationPlugin.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: ConfigurationPlugin, ngImport: i0__namespace });
1775
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ConfigurationPlugin, decorators: [{
1466
1776
  type: i0.Directive
1467
1777
  }], ctorParameters: function () { return [{ type: undefined }]; } });
1468
1778
 
@@ -1471,55 +1781,13 @@
1471
1781
  DEFAULT: [],
1472
1782
  };
1473
1783
 
1474
- var InitAction = { type: 'INIT' };
1475
- var ClearAction = { type: 'CLEAR' };
1476
- var IntegrationState = /** @class */ (function () {
1477
- function IntegrationState() {
1478
- this.stateSubj$ = new rxjs.BehaviorSubject({});
1479
- this.action$ = new rxjs.BehaviorSubject(InitAction);
1480
- }
1481
- Object.defineProperty(IntegrationState.prototype, "state$", {
1482
- get: function () {
1483
- return this.stateSubj$.asObservable();
1484
- },
1485
- enumerable: false,
1486
- configurable: true
1487
- });
1488
- Object.defineProperty(IntegrationState.prototype, "state", {
1489
- get: function () {
1490
- return this.stateSubj$.getValue();
1491
- },
1492
- enumerable: false,
1493
- configurable: true
1494
- });
1495
- IntegrationState.prototype.patchState = function (update) {
1496
- this.stateSubj$.next(Object.assign(Object.assign({}, this.stateSubj$.getValue()), update));
1497
- };
1498
- IntegrationState.prototype.dispatch = function (action) {
1499
- this.action$.next(action);
1500
- };
1501
- IntegrationState.prototype.listen$ = function (actionType) {
1502
- return this.action$.pipe(rxjs.filter(function (action) { return action.type === actionType; }), rxjs.map(function (action) { return action.payload; }));
1503
- };
1504
- IntegrationState.prototype.listenAll$ = function () {
1505
- return this.action$.asObservable();
1506
- };
1507
- IntegrationState.prototype.clear = function () {
1508
- this.stateSubj$.next({});
1509
- this.action$.next(ClearAction);
1510
- };
1511
- return IntegrationState;
1512
- }());
1513
- IntegrationState.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: IntegrationState, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1514
- IntegrationState.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: IntegrationState, providedIn: 'root' });
1515
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: IntegrationState, decorators: [{
1516
- type: i0.Injectable,
1517
- args: [{ providedIn: 'root' }]
1518
- }] });
1519
-
1520
1784
  var VELOCE_LIBS = {
1521
- '@veloceapps/sdk/core': Object.assign({ ConfigurationService: i2.ConfigurationService, QuoteDraftService: i2.QuoteDraftService, FlowConfigurationService: i2.FlowConfigurationService, LineItemWorker: i2.LineItemWorker, ProductImagesService: i2.ProductImagesService }, i2.lineItemUtils),
1522
- '@veloceapps/sdk/cms': Object.assign(Object.assign(Object.assign({}, cmsInjectionTokens), cmsActions), { TemplatesService: TemplatesService, IntegrationState: IntegrationState }),
1785
+ '@veloceapps/core': {
1786
+ isDefined: core.isDefined,
1787
+ },
1788
+ '@veloceapps/components': {
1789
+ ToastService: i1.ToastService,
1790
+ },
1523
1791
  '@veloceapps/api': {
1524
1792
  SalesforceApiService: api.SalesforceApiService,
1525
1793
  QuoteApiService: api.QuoteApiService,
@@ -1530,7 +1798,11 @@
1530
1798
  DeltaApiService: api.DeltaApiService,
1531
1799
  PicklistsApiService: api.PicklistsApiService,
1532
1800
  PriceApiService: api.PriceApiService,
1801
+ ShoppingCartSettingsApiService: api.ShoppingCartSettingsApiService,
1802
+ ConfigurationSettingsApiService: api.ConfigurationSettingsApiService,
1533
1803
  },
1804
+ '@veloceapps/sdk/core': Object.assign({ ConfigurationService: i2.ConfigurationService, QuoteDraftService: i2.QuoteDraftService, FlowConfigurationService: i2.FlowConfigurationService, LineItemWorker: i2.LineItemWorker, ProductImagesService: i2.ProductImagesService, ContextService: i2.ContextService }, i2.lineItemUtils),
1805
+ '@veloceapps/sdk/cms': Object.assign(Object.assign(Object.assign({}, cmsInjectionTokens), cmsActions), { TemplatesService: TemplatesService, IntegrationState: IntegrationState }),
1534
1806
  };
1535
1807
  var VELOCE_LIBS_BACKWARDS_COMPATIBLE = Object.entries(VELOCE_LIBS).reduce(function (trunk, _a) {
1536
1808
  var _b;
@@ -1540,19 +1812,32 @@
1540
1812
  var vendorMap = Object.assign(Object.assign(Object.assign({}, VELOCE_LIBS), VELOCE_LIBS_BACKWARDS_COMPATIBLE), { '@angular/core': i0__namespace, '@angular/forms': angularForms__namespace, rxjs: rxjs__namespace, 'rxjs/operators': rxjsOperators__namespace, lodash: lodash__namespace });
1541
1813
 
1542
1814
  var ElementsResolver = /** @class */ (function () {
1543
- function ElementsResolver(uiDef, elements) {
1815
+ function ElementsResolver(uiDef, elements, sharedElements) {
1544
1816
  var _this = this;
1817
+ if (sharedElements === void 0) { sharedElements = []; }
1545
1818
  this.uiDef = uiDef;
1546
1819
  this.renderableElements = [];
1547
1820
  this.sharedElements = [];
1548
1821
  var transpiledElements = this.transpileScripts(elements);
1549
- this.sharedElements = this.flattenElements(transpiledElements).filter(function (el) { return _this.isSharedElement(el); });
1550
- this.elements = transpiledElements.map(function (el) { return _this.processElementMetadata(el); }).filter(Boolean);
1822
+ var transpiledSharedElements = this.transpileScripts(sharedElements);
1823
+ this.sharedElements = this.flattenElements(transpiledElements)
1824
+ .filter(function (el) { return _this.isSharedElement(el); })
1825
+ .concat(transpiledSharedElements);
1826
+ this.elements = transpiledElements.map(function (el) { return _this.processElementMetadata(el); }).filter(core.isDefined);
1551
1827
  this.renderableElements = this.getRenderableElements(this.elements);
1552
1828
  }
1829
+ ElementsResolver.prototype.addElement = function (element) {
1830
+ var _this = this;
1831
+ if (element.isShared) {
1832
+ return;
1833
+ }
1834
+ var transpiledElements = this.transpileScripts([element]);
1835
+ this.elements = transpiledElements.map(function (el) { return _this.processElementMetadata(el); }).filter(core.isDefined);
1836
+ this.renderableElements = this.getRenderableElements(this.elements);
1837
+ };
1553
1838
  ElementsResolver.prototype.getNgComponents = function () {
1554
1839
  var _this = this;
1555
- return this.renderableElements.map(function (el) { return _this.resolveElement(el); }).filter(Boolean);
1840
+ return this.renderableElements.map(function (el) { return _this.resolveElement(el); }).filter(core.isDefined);
1556
1841
  };
1557
1842
  ElementsResolver.prototype.transpile = function (el) {
1558
1843
  var _a;
@@ -1634,9 +1919,7 @@
1634
1919
  }
1635
1920
  finalElement.template = this.resolveElementTemplate(finalElement);
1636
1921
  finalElement.styles = this.resolveElementStyles(finalElement);
1637
- return Object.assign(Object.assign({}, finalElement), { children: finalElement.children
1638
- .map(function (child) { return _this.processElementMetadata(child); })
1639
- .filter(Boolean) });
1922
+ return Object.assign(Object.assign({}, finalElement), { children: finalElement.children.map(function (child) { return _this.processElementMetadata(child); }).filter(core.isDefined) });
1640
1923
  };
1641
1924
  ElementsResolver.prototype.getSharedChildren = function (children, parentPath) {
1642
1925
  var _this = this;
@@ -1671,256 +1954,391 @@
1671
1954
  function C() {
1672
1955
  return _super !== null && _super.apply(this, arguments) || this;
1673
1956
  }
1674
- return C;
1675
- }(config.component)));
1676
- lodash.set(cmp, 'path', element.path);
1677
- return cmp;
1678
- };
1679
- ElementsResolver.prototype.getElementStyles = function (element) {
1680
- var result = '';
1681
- var configuredStyles = this.convertInlineStylesToCSS(element.configuredStyles);
1682
- if (configuredStyles) {
1683
- // order is important: styles written by user in CSS code should has higher priority
1684
- result += configuredStyles;
1685
- }
1686
- if (element.styles) {
1687
- result += element.styles;
1688
- }
1689
- return result || undefined;
1690
- };
1691
- ElementsResolver.prototype.convertInlineStylesToCSS = function (styles) {
1692
- if (!styles) {
1693
- return '';
1694
- }
1695
- var entries = Object.entries(styles);
1696
- var result = ':host {\n';
1697
- entries.forEach(function (_c) {
1698
- var _d = __read(_c, 2), style = _d[0], value = _d[1];
1699
- result += " " + lodash.kebabCase(style) + ":" + value + ";\n";
1957
+ return C;
1958
+ }(config.component)));
1959
+ lodash.set(cmp, 'path', element.path);
1960
+ return cmp;
1961
+ };
1962
+ ElementsResolver.prototype.getElementStyles = function (element) {
1963
+ var result = '';
1964
+ var configuredStyles = this.convertInlineStylesToCSS(element.configuredStyles);
1965
+ if (configuredStyles) {
1966
+ // order is important: styles written by user in CSS code should has higher priority
1967
+ result += configuredStyles;
1968
+ }
1969
+ if (element.styles) {
1970
+ result += element.styles;
1971
+ }
1972
+ return result || undefined;
1973
+ };
1974
+ ElementsResolver.prototype.convertInlineStylesToCSS = function (styles) {
1975
+ if (!styles) {
1976
+ return '';
1977
+ }
1978
+ var entries = Object.entries(styles);
1979
+ var result = ':host {\n';
1980
+ entries.forEach(function (_c) {
1981
+ var _d = __read(_c, 2), style = _d[0], value = _d[1];
1982
+ result += " " + lodash.kebabCase(style) + ":" + value + ";\n";
1983
+ });
1984
+ result += '}\n';
1985
+ return result;
1986
+ };
1987
+ return ElementsResolver;
1988
+ }());
1989
+
1990
+ var defaultOptions = {
1991
+ suppressLoading: false,
1992
+ loadingLabel: 'LOADING',
1993
+ };
1994
+
1995
+ var moduleMap = {};
1996
+ function loadRemoteEntry(remoteEntry) {
1997
+ return new Promise(function (resolve, reject) {
1998
+ if (moduleMap[remoteEntry]) {
1999
+ resolve();
2000
+ return;
2001
+ }
2002
+ var script = document.createElement('script');
2003
+ script.src = remoteEntry;
2004
+ script.onerror = reject;
2005
+ script.onload = function () {
2006
+ moduleMap[remoteEntry] = true;
2007
+ resolve(); // window is the global namespace
2008
+ };
2009
+ document.body.append(script);
2010
+ });
2011
+ }
2012
+ function lookupExposedModule(remoteName, exposedModule) {
2013
+ return __awaiter(this, void 0, void 0, function () {
2014
+ var container, factory, Module;
2015
+ return __generator(this, function (_a) {
2016
+ switch (_a.label) {
2017
+ case 0:
2018
+ // Initializes the share scope. This fills it with known provided modules from this build and all remotes
2019
+ return [4 /*yield*/, __webpack_init_sharing__('default')];
2020
+ case 1:
2021
+ // Initializes the share scope. This fills it with known provided modules from this build and all remotes
2022
+ _a.sent();
2023
+ container = window[remoteName];
2024
+ // Initialize the container, it may provide shared modules
2025
+ return [4 /*yield*/, container.init(__webpack_share_scopes__.default)];
2026
+ case 2:
2027
+ // Initialize the container, it may provide shared modules
2028
+ _a.sent();
2029
+ return [4 /*yield*/, container.get(exposedModule)];
2030
+ case 3:
2031
+ factory = _a.sent();
2032
+ Module = factory();
2033
+ return [2 /*return*/, Module];
2034
+ }
1700
2035
  });
1701
- result += '}\n';
1702
- return result;
1703
- };
1704
- return ElementsResolver;
1705
- }());
1706
-
1707
- var LauncherService = /** @class */ (function () {
1708
- function LauncherService(compiler, dynamicModuleService) {
1709
- this.compiler = compiler;
1710
- this.dynamicModuleService = dynamicModuleService;
1711
- }
1712
- LauncherService.prototype.compileModule = function (uiDef, elements) {
1713
- var _this = this;
1714
- var elementsResolver = new ElementsResolver(uiDef, elements);
1715
- this.dynamicModuleService.elementsTree = elementsResolver.elements;
1716
- this.module = this.getModule(elementsResolver.getNgComponents());
1717
- return rxjs.from(this.compiler.compileModuleAndAllComponentsAsync(this.module)).pipe(rxjs.tap(function (m) {
1718
- _this.dynamicModuleService.componentFactories = m.componentFactories;
1719
- _this.moduleInstance = m;
1720
- }), rxjs.map(function (m) { return ({ module: m, elements: elementsResolver.elements }); }));
1721
- };
1722
- LauncherService.prototype.destroy = function () {
1723
- if (this.moduleInstance) {
1724
- this.dynamicModuleService.clear();
1725
- this.moduleInstance = undefined;
1726
- }
1727
- if (this.module) {
1728
- this.compiler.clearCacheFor(this.module);
1729
- this.module = undefined;
1730
- }
1731
- };
1732
- LauncherService.prototype.getModule = function (components) {
1733
- var staticComponents = [ElementChildrenComponent, ElementRendererComponent, CustomTemplateDirective];
1734
- var DynamicModule = /** @class */ (function () {
1735
- function DynamicModule() {
2036
+ });
2037
+ }
2038
+ function loadRemoteModule(remoteEntry, remoteName, exposedModule) {
2039
+ return __awaiter(this, void 0, void 0, function () {
2040
+ return __generator(this, function (_a) {
2041
+ switch (_a.label) {
2042
+ case 0: return [4 /*yield*/, loadRemoteEntry(remoteEntry)];
2043
+ case 1:
2044
+ _a.sent();
2045
+ return [4 /*yield*/, lookupExposedModule(remoteName, exposedModule)];
2046
+ case 2: return [2 /*return*/, _a.sent()];
1736
2047
  }
1737
- return DynamicModule;
1738
- }());
1739
- DynamicModule = __decorate([
1740
- i0.NgModule({
1741
- imports: [i7.CommonModule, angularForms.FormsModule, angularForms.ReactiveFormsModule, FederatedModule, dragDrop.DragDropModule, scrolling.ScrollingModule],
1742
- declarations: __spreadArray(__spreadArray([], __read(staticComponents)), __read(components)),
1743
- jit: true,
1744
- })
1745
- ], DynamicModule);
1746
- return DynamicModule;
1747
- };
1748
- return LauncherService;
1749
- }());
1750
- LauncherService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherService, deps: [{ token: i0__namespace.Compiler }, { token: DynamicModuleService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1751
- LauncherService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherService });
1752
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherService, decorators: [{
1753
- type: i0.Injectable
1754
- }], ctorParameters: function () { return [{ type: i0__namespace.Compiler }, { type: DynamicModuleService }]; } });
2048
+ });
2049
+ });
2050
+ }
1755
2051
 
1756
- var PreviewComponent = /** @class */ (function () {
1757
- function PreviewComponent(launcherService, configurationService, messageService, runtimeService, integrationState) {
1758
- this.launcherService = launcherService;
1759
- this.configurationService = configurationService;
1760
- this.messageService = messageService;
1761
- this.runtimeService = runtimeService;
1762
- this.integrationState = integrationState;
1763
- this.clearState = false;
1764
- this.state$ = new rxjs.BehaviorSubject({ loading: true, failure: false });
1765
- this.elements = [];
1766
- this.destroy$ = new rxjs.Subject();
2052
+ var FederatedComponent = /** @class */ (function () {
2053
+ function FederatedComponent(injector, compiler, appRef, renderer) {
2054
+ this.injector = injector;
2055
+ this.compiler = compiler;
2056
+ this.appRef = appRef;
2057
+ this.renderer = renderer;
2058
+ this.isLoading$ = new rxjs.BehaviorSubject(false);
2059
+ // configs
2060
+ this.suppressLoading = defaultOptions.suppressLoading;
2061
+ this.loadingLabel = defaultOptions.loadingLabel;
1767
2062
  }
1768
- PreviewComponent.prototype.ngOnInit = function () {
1769
- if (this.clearState) {
1770
- this.integrationState.clear();
1771
- }
1772
- this.startPreview();
1773
- };
1774
- PreviewComponent.prototype.ngOnDestroy = function () {
1775
- this.destroy$.next();
1776
- this.destroy$.complete();
1777
- this.configurationService.reset();
1778
- };
1779
- PreviewComponent.prototype.initializeConfiguration$ = function () {
1780
- var _this = this;
1781
- var isAlreadyInitialized = this.runtimeService.isInitialized;
1782
- if (!this.uiDefinition || this.uiDefinition.type !== 'CONFIGURATION' || isAlreadyInitialized) {
1783
- return rxjs.of({});
2063
+ FederatedComponent.prototype.ngOnChanges = function (changes) {
2064
+ var _a, _b, _c, _d;
2065
+ if (changes.data && this.instance) {
2066
+ this.instance.data = this.data;
1784
2067
  }
1785
- if (!this.modelId) {
1786
- console.warn("No modelId is given for uiDefinition with '" + this.uiDefinition.type + "' type");
1787
- return rxjs.of({});
2068
+ if (changes.options) {
2069
+ this.suppressLoading = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.suppressLoading) !== null && _b !== void 0 ? _b : defaultOptions.suppressLoading;
2070
+ this.loadingLabel = (_d = (_c = this.options) === null || _c === void 0 ? void 0 : _c.loadingLabel) !== null && _d !== void 0 ? _d : defaultOptions.loadingLabel;
1788
2071
  }
1789
- // If still not initialized - init configuration in Test mode
1790
- return this.runtimeService
1791
- .initTestMode(this.modelId, this.uiDefinition)
1792
- .pipe(rxjs.switchMap(function () { return _this.configurationService.configure(); }));
1793
2072
  };
1794
- PreviewComponent.prototype.elementToMetadataSafe = function (elements) {
1795
- var _a, _b;
1796
- try {
1797
- return elements.map(function (element) { return elementToMetadata(element); });
1798
- }
1799
- catch (e) {
1800
- console.error(e);
1801
- if (!((_b = (_a = this.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.suppressToastMessages)) {
1802
- this.messageService.add({ severity: 'error', summary: String(e) });
1803
- }
1804
- return [];
1805
- }
2073
+ FederatedComponent.prototype.ngOnInit = function () {
2074
+ this.isLoading$.next(true);
1806
2075
  };
1807
- PreviewComponent.prototype.startPreview = function () {
2076
+ FederatedComponent.prototype.ngAfterViewInit = function () {
1808
2077
  var _this = this;
1809
- if (!this.uiDefinition) {
2078
+ var _a, _b, _c, _d, _e, _f;
2079
+ var remoteEntry = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.remoteEntry) !== null && _b !== void 0 ? _b : this.remoteEntry;
2080
+ var remoteName = (_d = (_c = this.options) === null || _c === void 0 ? void 0 : _c.remoteName) !== null && _d !== void 0 ? _d : this.remoteName;
2081
+ var exposedModule = (_f = (_e = this.options) === null || _e === void 0 ? void 0 : _e.exposedModule) !== null && _f !== void 0 ? _f : this.exposedModule;
2082
+ if (!remoteEntry || !remoteName || !exposedModule) {
1810
2083
  return;
1811
2084
  }
1812
- var _a = this.uiDefinition, children = _a.children, uiDefinitionMeta = __rest(_a, ["children"]);
1813
- var elements = this.elementToMetadataSafe(children);
1814
- var compilation$ = this.launcherService.compileModule(uiDefinitionMeta, elements);
1815
- rxjs.forkJoin([compilation$, this.initializeConfiguration$()])
1816
- .pipe(rxjs.tap(function (_c) {
1817
- var _d = __read(_c, 1), result = _d[0];
1818
- _this.elements = result.elements;
1819
- _this.state$.next({ loading: false, failure: false });
1820
- }), rxjs.catchError(function (error) {
1821
- var _a, _b;
1822
- console.error(error);
1823
- if (!((_b = (_a = _this.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.suppressToastMessages)) {
1824
- _this.messageService.add({ severity: 'error', summary: error });
1825
- }
1826
- _this.state$.next({ loading: false, failure: true });
1827
- return rxjs.of();
1828
- }), rxjs.takeUntil(this.destroy$))
1829
- .subscribe();
2085
+ loadRemoteModule(remoteEntry, remoteName, exposedModule).then(function (federated) {
2086
+ _this.compiler.compileModuleAsync(federated[exposedModule]).then(function (moduleFactory) {
2087
+ var _a, _b, _c;
2088
+ var rootModuleRef = moduleFactory.create(_this.injector);
2089
+ var rootComponentFactory = rootModuleRef.componentFactoryResolver.resolveComponentFactory(federated[exposedModule].rootComponent);
2090
+ var node = document.createElement('div');
2091
+ var _g = rootComponentFactory.create(_this.injector, [], node), instance = _g.instance, hostView = _g.hostView;
2092
+ _this.instance = instance;
2093
+ _this.instance.data = _this.data;
2094
+ _this.renderer.appendChild((_a = _this.moduleHostRef) === null || _a === void 0 ? void 0 : _a.nativeElement, node);
2095
+ _this.appRef.attachView(hostView);
2096
+ (_c = (_b = _this.options) === null || _b === void 0 ? void 0 : _b.onReady) === null || _c === void 0 ? void 0 : _c.call(_b);
2097
+ _this.isLoading$.next(false);
2098
+ });
2099
+ });
1830
2100
  };
1831
- return PreviewComponent;
2101
+ return FederatedComponent;
1832
2102
  }());
1833
- PreviewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewComponent, deps: [{ token: LauncherService }, { token: i2__namespace.ConfigurationService }, { token: i3__namespace.MessageService }, { token: i2__namespace.ConfigurationRuntimeService }, { token: IntegrationState }], target: i0__namespace.ɵɵFactoryTarget.Component });
1834
- PreviewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: PreviewComponent, selector: "vl-cms-preview", inputs: { modelId: "modelId", uiDefinition: "uiDefinition", clearState: "clearState" }, providers: [IOProviderService, TemplatesService], ngImport: i0__namespace, 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-element-renderer *ngFor=\"let el of elements\" [meta]=\"el\"></vl-cms-element-renderer>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [":host{flex-grow:1;display:flex;flex-direction:column;height:100%}\n"], components: [{ type: i1__namespace.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: ["meta"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i7__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.ShadowDom });
1835
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewComponent, decorators: [{
2103
+ FederatedComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FederatedComponent, deps: [{ token: i0__namespace.Injector }, { token: i0__namespace.Compiler }, { token: i0__namespace.ApplicationRef }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Component });
2104
+ FederatedComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FederatedComponent, selector: "veloce-host-federated", inputs: { remoteEntry: "remoteEntry", remoteName: "remoteName", exposedModule: "exposedModule", data: "data", options: "options" }, viewQueries: [{ propertyName: "moduleHostRef", first: true, predicate: ["moduleHost"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div #moduleHost></div>\n\n<vl-loader *ngIf=\"!suppressLoading && (isLoading$ | async)\" [label]=\"loadingLabel\"></vl-loader>\n", styles: [":host{display:block}div{height:100%}\n"], components: [{ type: i1__namespace.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }], directives: [{ type: i7__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i7__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2105
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FederatedComponent, decorators: [{
1836
2106
  type: i0.Component,
1837
2107
  args: [{
1838
- selector: 'vl-cms-preview',
1839
- templateUrl: './preview.component.html',
1840
- styleUrls: ['./preview.component.scss'],
2108
+ // eslint-disable-next-line @angular-eslint/component-selector
2109
+ selector: 'veloce-host-federated',
2110
+ templateUrl: './federated.component.html',
2111
+ styleUrls: ['./federated.component.scss'],
1841
2112
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1842
- providers: [IOProviderService, TemplatesService],
1843
- // use shadow DOM to prevent UI from being affected by global styles
1844
- encapsulation: i0.ViewEncapsulation.ShadowDom,
1845
2113
  }]
1846
- }], ctorParameters: function () { return [{ type: LauncherService }, { type: i2__namespace.ConfigurationService }, { type: i3__namespace.MessageService }, { type: i2__namespace.ConfigurationRuntimeService }, { type: IntegrationState }]; }, propDecorators: { modelId: [{
2114
+ }], ctorParameters: function () { return [{ type: i0__namespace.Injector }, { type: i0__namespace.Compiler }, { type: i0__namespace.ApplicationRef }, { type: i0__namespace.Renderer2 }]; }, propDecorators: { moduleHostRef: [{
2115
+ type: i0.ViewChild,
2116
+ args: ['moduleHost', { static: false }]
2117
+ }], remoteEntry: [{
1847
2118
  type: i0.Input
1848
- }], uiDefinition: [{
2119
+ }], remoteName: [{
2120
+ type: i0.Input
2121
+ }], exposedModule: [{
1849
2122
  type: i0.Input
1850
- }], clearState: [{
2123
+ }], data: [{
2124
+ type: i0.Input
2125
+ }], options: [{
1851
2126
  type: i0.Input
1852
2127
  }] } });
1853
2128
 
1854
- var ElementRendererModule = /** @class */ (function () {
1855
- function ElementRendererModule() {
2129
+ var FederatedModule = /** @class */ (function () {
2130
+ function FederatedModule() {
1856
2131
  }
1857
- return ElementRendererModule;
2132
+ return FederatedModule;
1858
2133
  }());
1859
- ElementRendererModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementRendererModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1860
- ElementRendererModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementRendererModule, declarations: [ElementRendererComponent], exports: [ElementRendererComponent] });
1861
- ElementRendererModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementRendererModule });
1862
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementRendererModule, decorators: [{
2134
+ FederatedModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FederatedModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
2135
+ FederatedModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FederatedModule, declarations: [FederatedComponent], imports: [i7.CommonModule, i1.LoaderModule], exports: [FederatedComponent] });
2136
+ FederatedModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FederatedModule, imports: [[i7.CommonModule, i1.LoaderModule]] });
2137
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FederatedModule, decorators: [{
1863
2138
  type: i0.NgModule,
1864
2139
  args: [{
1865
- declarations: [ElementRendererComponent],
1866
- exports: [ElementRendererComponent],
2140
+ declarations: [FederatedComponent],
2141
+ imports: [i7.CommonModule, i1.LoaderModule],
2142
+ exports: [FederatedComponent],
1867
2143
  }]
1868
2144
  }] });
1869
2145
 
1870
- var ElementChildrenModule = /** @class */ (function () {
1871
- function ElementChildrenModule() {
2146
+ var CompilationService = /** @class */ (function () {
2147
+ function CompilationService(compiler) {
2148
+ this.compiler = compiler;
1872
2149
  }
1873
- return ElementChildrenModule;
2150
+ CompilationService.prototype.compileUIDefinition$ = function (uiDefinition) {
2151
+ var _this = this;
2152
+ return rxjs.of([]).pipe(rxjs.switchMap(function () {
2153
+ var children = uiDefinition.children, pages = uiDefinition.pages, components = uiDefinition.components, uiDefinitionMeta = __rest(uiDefinition, ["children", "pages", "components"]);
2154
+ _this.uiDefinitionMeta = uiDefinitionMeta;
2155
+ var elements = __spreadArray(__spreadArray([], __read((children !== null && children !== void 0 ? children : []))), __read((pages !== null && pages !== void 0 ? pages : [])));
2156
+ var sharedElements = components !== null && components !== void 0 ? components : [];
2157
+ var metadata = elements.map(function (element) { return elementToMetadata(element); });
2158
+ var sharedMetadata = sharedElements.map(function (element) { return elementToMetadata(element); });
2159
+ _this.elementsResolver = new ElementsResolver(uiDefinition, metadata, sharedMetadata);
2160
+ var module = _this.getModule(_this.elementsResolver.getNgComponents());
2161
+ return rxjs.combineLatest([
2162
+ rxjs.from(_this.compiler.compileModuleAndAllComponentsAsync(module)),
2163
+ rxjs.of(_this.elementsResolver),
2164
+ ]);
2165
+ }), rxjs.map(function (_b) {
2166
+ var _c = __read(_b, 2), module = _c[0], elementsResolver = _c[1];
2167
+ return ({ module: module, elements: elementsResolver.elements });
2168
+ }));
2169
+ };
2170
+ CompilationService.prototype.compileElement$ = function (element) {
2171
+ var _this = this;
2172
+ if (!this.uiDefinitionMeta) {
2173
+ throw 'No UI Definition context';
2174
+ }
2175
+ return rxjs.of(this.uiDefinitionMeta).pipe(rxjs.switchMap(function (uiDefinition) {
2176
+ var _a;
2177
+ var elementsResolver = (_a = _this.elementsResolver) !== null && _a !== void 0 ? _a : new ElementsResolver(uiDefinition, []);
2178
+ elementsResolver.addElement(element);
2179
+ var module = _this.getModule(elementsResolver.getNgComponents());
2180
+ return rxjs.combineLatest([rxjs.from(_this.compiler.compileModuleAndAllComponentsAsync(module)), rxjs.of(elementsResolver)]);
2181
+ }), rxjs.map(function (_b) {
2182
+ var _c = __read(_b, 2), module = _c[0], elementsResolver = _c[1];
2183
+ return ({ module: module, elements: elementsResolver.elements });
2184
+ }));
2185
+ };
2186
+ CompilationService.prototype.clearModuleCache = function (modules) {
2187
+ var _this = this;
2188
+ modules.forEach(function (module) { return _this.compiler.clearCacheFor(module); });
2189
+ this.uiDefinitionMeta = undefined;
2190
+ };
2191
+ CompilationService.prototype.getModule = function (components) {
2192
+ var staticComponents = [
2193
+ ElementChildrenComponent,
2194
+ ElementRendererComponent,
2195
+ ElementDropHandleComponent,
2196
+ CustomTemplateDirective,
2197
+ ];
2198
+ var DynamicModule = /** @class */ (function () {
2199
+ function DynamicModule() {
2200
+ }
2201
+ return DynamicModule;
2202
+ }());
2203
+ DynamicModule = __decorate([
2204
+ i0.NgModule({
2205
+ imports: [
2206
+ i7.CommonModule,
2207
+ angularForms.FormsModule,
2208
+ angularForms.ReactiveFormsModule,
2209
+ FederatedModule,
2210
+ dragDrop.DragDropModule,
2211
+ i2$1.DndModule,
2212
+ scrolling.ScrollingModule,
2213
+ ],
2214
+ declarations: __spreadArray(__spreadArray([], __read(staticComponents)), __read(components)),
2215
+ jit: true,
2216
+ })
2217
+ ], DynamicModule);
2218
+ return DynamicModule;
2219
+ };
2220
+ return CompilationService;
2221
+ }());
2222
+ CompilationService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CompilationService, deps: [{ token: i0__namespace.Compiler }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2223
+ CompilationService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CompilationService });
2224
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CompilationService, decorators: [{
2225
+ type: i0.Injectable
2226
+ }], ctorParameters: function () { return [{ type: i0__namespace.Compiler }]; } });
2227
+
2228
+ var RuntimeModule = /** @class */ (function () {
2229
+ function RuntimeModule() {
2230
+ }
2231
+ return RuntimeModule;
1874
2232
  }());
1875
- ElementChildrenModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementChildrenModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1876
- ElementChildrenModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementChildrenModule, declarations: [ElementChildrenComponent], imports: [ElementRendererModule], exports: [ElementChildrenComponent] });
1877
- ElementChildrenModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementChildrenModule, imports: [[ElementRendererModule]] });
1878
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ElementChildrenModule, decorators: [{
2233
+ RuntimeModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
2234
+ RuntimeModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeModule, imports: [i7.CommonModule, core.CoreModule] });
2235
+ RuntimeModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeModule, providers: [
2236
+ dynamicdialog.DialogService,
2237
+ RuntimeService,
2238
+ RuntimeEditorService,
2239
+ { provide: CMS_COMPILATION_SERVICE, useClass: CompilationService },
2240
+ ], imports: [[i7.CommonModule, core.CoreModule]] });
2241
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RuntimeModule, decorators: [{
1879
2242
  type: i0.NgModule,
1880
2243
  args: [{
1881
- declarations: [ElementChildrenComponent],
1882
- imports: [ElementRendererModule],
1883
- exports: [ElementChildrenComponent],
2244
+ imports: [i7.CommonModule, core.CoreModule],
2245
+ providers: [
2246
+ dynamicdialog.DialogService,
2247
+ RuntimeService,
2248
+ RuntimeEditorService,
2249
+ { provide: CMS_COMPILATION_SERVICE, useClass: CompilationService },
2250
+ ],
1884
2251
  }]
1885
2252
  }] });
1886
2253
 
1887
- var PreviewModule = /** @class */ (function () {
1888
- function PreviewModule() {
2254
+ var LauncherModule = /** @class */ (function () {
2255
+ function LauncherModule() {
1889
2256
  }
1890
- return PreviewModule;
2257
+ return LauncherModule;
1891
2258
  }());
1892
- PreviewModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1893
- PreviewModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewModule, declarations: [PreviewComponent], imports: [i7.CommonModule, i1.LoaderModule, ElementRendererModule, ElementChildrenModule], exports: [PreviewComponent] });
1894
- PreviewModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewModule, providers: [IntegrationState], imports: [[i7.CommonModule, i1.LoaderModule, ElementRendererModule, ElementChildrenModule]] });
1895
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PreviewModule, decorators: [{
2259
+ LauncherModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: LauncherModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
2260
+ LauncherModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: LauncherModule, imports: [i7.CommonModule, core.CoreModule, api.ApiModule, i2.SdkCoreModule, RuntimeModule, PreviewModule], exports: [PreviewModule] });
2261
+ LauncherModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: LauncherModule, providers: [IntegrationState, dynamicdialog.DialogService], imports: [[i7.CommonModule, core.CoreModule, api.ApiModule, i2.SdkCoreModule, RuntimeModule, PreviewModule], PreviewModule] });
2262
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: LauncherModule, decorators: [{
1896
2263
  type: i0.NgModule,
1897
2264
  args: [{
1898
- declarations: [PreviewComponent],
1899
- imports: [i7.CommonModule, i1.LoaderModule, ElementRendererModule, ElementChildrenModule],
1900
- providers: [IntegrationState],
1901
- exports: [PreviewComponent],
2265
+ imports: [i7.CommonModule, core.CoreModule, api.ApiModule, i2.SdkCoreModule, RuntimeModule, PreviewModule],
2266
+ providers: [IntegrationState, dynamicdialog.DialogService],
2267
+ exports: [PreviewModule],
1902
2268
  }]
1903
2269
  }] });
1904
2270
 
1905
- function ElementDefinition(definition) {
1906
- return function (constructor) {
1907
- return constructor;
2271
+ var migrations = {
2272
+ 2: function () {
2273
+ throw 'Migration from Legacy UI definition is not possible';
2274
+ },
2275
+ 3: function (uiDef) {
2276
+ var _a;
2277
+ var children = (_a = uiDef.children) !== null && _a !== void 0 ? _a : [];
2278
+ return Object.assign(Object.assign({}, uiDef), { children: undefined, pages: children, version: 3 });
2279
+ },
2280
+ };
2281
+
2282
+ var MigrationsService = /** @class */ (function () {
2283
+ function MigrationsService(toastService) {
2284
+ this.toastService = toastService;
2285
+ }
2286
+ MigrationsService.prototype.migrateUIDefinition = function (uiDef) {
2287
+ var e_1, _a;
2288
+ var currentVersion = uiDef.version;
2289
+ var targetVersion = i2.UI_DEFINITION_VERSION;
2290
+ var migrateVersions = Object.keys(migrations)
2291
+ .reduce(function (acc, version) {
2292
+ var v = Number(version);
2293
+ if (v > currentVersion && v <= targetVersion) {
2294
+ acc.push(v);
2295
+ }
2296
+ return acc;
2297
+ }, [])
2298
+ .sort();
2299
+ try {
2300
+ var result = lodash.cloneDeep(uiDef);
2301
+ try {
2302
+ for (var migrateVersions_1 = __values(migrateVersions), migrateVersions_1_1 = migrateVersions_1.next(); !migrateVersions_1_1.done; migrateVersions_1_1 = migrateVersions_1.next()) {
2303
+ var version = migrateVersions_1_1.value;
2304
+ result = migrations[version](result);
2305
+ }
2306
+ }
2307
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
2308
+ finally {
2309
+ try {
2310
+ if (migrateVersions_1_1 && !migrateVersions_1_1.done && (_a = migrateVersions_1.return)) _a.call(migrateVersions_1);
2311
+ }
2312
+ finally { if (e_1) throw e_1.error; }
2313
+ }
2314
+ return result;
2315
+ }
2316
+ catch (e) {
2317
+ this.toastService.add({ summary: String(e), severity: i1.ToastType.error });
2318
+ return;
2319
+ }
1908
2320
  };
1909
- }
2321
+ return MigrationsService;
2322
+ }());
2323
+ MigrationsService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsService, deps: [{ token: i1__namespace.ToastService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2324
+ MigrationsService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsService, providedIn: 'root' });
2325
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsService, decorators: [{
2326
+ type: i0.Injectable,
2327
+ args: [{ providedIn: 'root' }]
2328
+ }], ctorParameters: function () { return [{ type: i1__namespace.ToastService }]; } });
1910
2329
 
1911
- var LauncherModule = /** @class */ (function () {
1912
- function LauncherModule() {
2330
+ var MigrationsModule = /** @class */ (function () {
2331
+ function MigrationsModule() {
1913
2332
  }
1914
- return LauncherModule;
2333
+ return MigrationsModule;
1915
2334
  }());
1916
- LauncherModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1917
- LauncherModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, imports: [i7.CommonModule, core.CoreModule, api.ApiModule, i2.SdkCoreModule] });
1918
- LauncherModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, providers: [LauncherService, IntegrationState, DynamicModuleService, dynamicdialog.DialogService], imports: [[i7.CommonModule, core.CoreModule, api.ApiModule, i2.SdkCoreModule]] });
1919
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LauncherModule, decorators: [{
2335
+ MigrationsModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
2336
+ MigrationsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsModule });
2337
+ MigrationsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsModule, providers: [MigrationsService] });
2338
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MigrationsModule, decorators: [{
1920
2339
  type: i0.NgModule,
1921
2340
  args: [{
1922
- imports: [i7.CommonModule, core.CoreModule, api.ApiModule, i2.SdkCoreModule],
1923
- providers: [LauncherService, IntegrationState, DynamicModuleService, dynamicdialog.DialogService],
2341
+ providers: [MigrationsService],
1924
2342
  }]
1925
2343
  }] });
1926
2344
 
@@ -1938,7 +2356,8 @@
1938
2356
  exports.ElementsResolver = ElementsResolver;
1939
2357
  exports.IntegrationState = IntegrationState;
1940
2358
  exports.LauncherModule = LauncherModule;
1941
- exports.LauncherService = LauncherService;
2359
+ exports.MigrationsModule = MigrationsModule;
2360
+ exports.MigrationsService = MigrationsService;
1942
2361
  exports.NavigateBackAction = NavigateBackAction;
1943
2362
  exports.NavigateToCatalogAction = NavigateToCatalogAction;
1944
2363
  exports.OpenDocGenAction = OpenDocGenAction;
@@ -1946,6 +2365,8 @@
1946
2365
  exports.PreviewModule = PreviewModule;
1947
2366
  exports.RemoteApplyAction = RemoteApplyAction;
1948
2367
  exports.RemoteCancelAction = RemoteCancelAction;
2368
+ exports.RuntimeEditorService = RuntimeEditorService;
2369
+ exports.RuntimeModule = RuntimeModule;
1949
2370
  exports.SHARED_ELEMENT_METADATA = SHARED_ELEMENT_METADATA;
1950
2371
  exports.SetDefaultMetrics = SetDefaultMetrics;
1951
2372
  exports.SwitchObjectAction = SwitchObjectAction;
@@ -1958,15 +2379,19 @@
1958
2379
  exports.extendElementMetadata = extendElementMetadata;
1959
2380
  exports.extractElementMetadata = extractElementMetadata;
1960
2381
  exports.findElementByModule = findElementByModule;
2382
+ exports.findElementByPath = findElementByPath;
1961
2383
  exports.flattenElements = flattenElements;
1962
2384
  exports.getAbsolutePath = getAbsolutePath;
1963
2385
  exports.getElementConfig = getElementConfig;
2386
+ exports.getElementUniqueName = getElementUniqueName;
2387
+ exports.insertElement = insertElement;
1964
2388
  exports.isSharedElement = isSharedElement;
1965
2389
  exports.isValidScript = isValidScript;
1966
2390
  exports.metadataToElement = metadataToElement;
1967
2391
  exports.normalizeElementMetadata = normalizeElementMetadata;
1968
2392
  exports.parseBoundPath = parseBoundPath;
1969
2393
  exports.parsePath = parsePath;
2394
+ exports.removeElement = removeElement;
1970
2395
  exports.stringifyElementMetadata = stringifyElementMetadata;
1971
2396
 
1972
2397
  Object.defineProperty(exports, '__esModule', { value: true });