@veloceapps/sdk 4.0.21-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/README.md +3 -0
  2. package/bundles/veloceapps-sdk-cms.umd.js +1946 -0
  3. package/bundles/veloceapps-sdk-cms.umd.js.map +1 -0
  4. package/bundles/veloceapps-sdk-core.umd.js +1671 -0
  5. package/bundles/veloceapps-sdk-core.umd.js.map +1 -0
  6. package/bundles/veloceapps-sdk-runtime.umd.js +4414 -0
  7. package/bundles/veloceapps-sdk-runtime.umd.js.map +1 -0
  8. package/bundles/veloceapps-sdk.umd.js +3043 -0
  9. package/bundles/veloceapps-sdk.umd.js.map +1 -0
  10. package/cms/cms.actions.d.ts +22 -0
  11. package/cms/cms.default.d.ts +5 -0
  12. package/cms/cms.elements.d.ts +4 -0
  13. package/cms/components/element-children/element-children.component.d.ts +10 -0
  14. package/cms/components/element-children/element-children.module.d.ts +8 -0
  15. package/cms/components/element-renderer/element-renderer.component.d.ts +35 -0
  16. package/cms/components/element-renderer/element-renderer.module.d.ts +7 -0
  17. package/cms/components/element.component.d.ts +17 -0
  18. package/cms/components/index.d.ts +1 -0
  19. package/cms/components/plugin.component.d.ts +15 -0
  20. package/cms/components/preview/index.d.ts +2 -0
  21. package/cms/components/preview/preview.component.d.ts +34 -0
  22. package/cms/components/preview/preview.module.d.ts +11 -0
  23. package/cms/decorators/element.decorator.d.ts +2 -0
  24. package/cms/decorators/index.d.ts +1 -0
  25. package/cms/directives/custom-template.directive.d.ts +12 -0
  26. package/cms/engine/models/entity.d.ts +11 -0
  27. package/cms/engine/models/plugin.d.ts +5 -0
  28. package/cms/index.d.ts +11 -0
  29. package/cms/injection-tokens.d.ts +11 -0
  30. package/cms/launcher.module.d.ts +10 -0
  31. package/cms/modules/federated/default-options.d.ts +4 -0
  32. package/cms/modules/federated/export.d.ts +1 -0
  33. package/cms/modules/federated/federated.component.d.ts +26 -0
  34. package/cms/modules/federated/federated.module.d.ts +9 -0
  35. package/cms/modules/federated/federated.types.d.ts +30 -0
  36. package/cms/modules/federated/federated.utils.d.ts +1 -0
  37. package/cms/package.json +10 -0
  38. package/cms/plugins/configuration.plugin.d.ts +23 -0
  39. package/cms/plugins/io.plugin.d.ts +9 -0
  40. package/cms/plugins/script.plugin.d.ts +13 -0
  41. package/cms/services/dynamic-module.service.d.ts +15 -0
  42. package/cms/services/element-context.service.d.ts +8 -0
  43. package/cms/services/index.d.ts +3 -0
  44. package/cms/services/integration.state.d.ts +17 -0
  45. package/cms/services/io-provider.service.d.ts +15 -0
  46. package/cms/services/launcher.service.d.ts +18 -0
  47. package/cms/services/templates.service.d.ts +14 -0
  48. package/cms/types/common.types.d.ts +103 -0
  49. package/cms/types/configuration.types.d.ts +20 -0
  50. package/cms/types/elements.types.d.ts +2 -0
  51. package/cms/types/index.d.ts +5 -0
  52. package/cms/types/integration.types.d.ts +4 -0
  53. package/cms/types/path.types.d.ts +11 -0
  54. package/cms/utils/element.utils.d.ts +15 -0
  55. package/cms/utils/elements-resolver.d.ts +20 -0
  56. package/cms/utils/index.d.ts +3 -0
  57. package/cms/utils/path.utils.d.ts +5 -0
  58. package/cms/veloceapps-sdk-cms.d.ts +5 -0
  59. package/cms/vendor-map.d.ts +707 -0
  60. package/core/core.module.d.ts +8 -0
  61. package/core/index.d.ts +6 -0
  62. package/core/modules/configuration/configuration.module.d.ts +7 -0
  63. package/core/modules/configuration/helpers.d.ts +3 -0
  64. package/core/modules/configuration/index.d.ts +4 -0
  65. package/core/modules/configuration/services/configuration-runtime.service.d.ts +29 -0
  66. package/core/modules/configuration/services/configuration.service.d.ts +45 -0
  67. package/core/modules/configuration/services/runtime-context.service.d.ts +12 -0
  68. package/core/modules/configuration/types/configuration-runtime.types.d.ts +7 -0
  69. package/core/modules/flow-configuration/flow-configuration.module.d.ts +6 -0
  70. package/core/modules/flow-configuration/index.d.ts +4 -0
  71. package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +38 -0
  72. package/core/modules/flow-configuration/services/flow-update.service.d.ts +12 -0
  73. package/core/modules/flow-configuration/types/update.types.d.ts +12 -0
  74. package/core/modules/index.d.ts +2 -0
  75. package/core/package.json +10 -0
  76. package/core/services/context.service.d.ts +18 -0
  77. package/core/services/index.d.ts +3 -0
  78. package/core/services/product-images.service.d.ts +12 -0
  79. package/core/services/quote-draft.service.d.ts +60 -0
  80. package/core/types/index.d.ts +3 -0
  81. package/core/types/quote-states.types.d.ts +6 -0
  82. package/core/types/runtime.types.d.ts +31 -0
  83. package/core/types/ui-definition.types.d.ts +26 -0
  84. package/core/utils/index.d.ts +2 -0
  85. package/core/utils/line-item.utils.d.ts +26 -0
  86. package/core/utils/line-item.worker.d.ts +12 -0
  87. package/core/veloceapps-sdk-core.d.ts +5 -0
  88. package/esm2015/cms/cms.actions.js +37 -0
  89. package/esm2015/cms/cms.default.js +6 -0
  90. package/esm2015/cms/cms.elements.js +29 -0
  91. package/esm2015/cms/components/element-children/element-children.component.js +23 -0
  92. package/esm2015/cms/components/element-children/element-children.module.js +18 -0
  93. package/esm2015/cms/components/element-renderer/element-renderer.component.js +143 -0
  94. package/esm2015/cms/components/element-renderer/element-renderer.module.js +16 -0
  95. package/esm2015/cms/components/element.component.js +44 -0
  96. package/esm2015/cms/components/index.js +2 -0
  97. package/esm2015/cms/components/plugin.component.js +16 -0
  98. package/esm2015/cms/components/preview/index.js +3 -0
  99. package/esm2015/cms/components/preview/preview.component.js +105 -0
  100. package/esm2015/cms/components/preview/preview.module.js +23 -0
  101. package/esm2015/cms/decorators/element.decorator.js +6 -0
  102. package/esm2015/cms/decorators/index.js +2 -0
  103. package/esm2015/cms/directives/custom-template.directive.js +25 -0
  104. package/esm2015/cms/engine/models/entity.js +18 -0
  105. package/esm2015/cms/engine/models/plugin.js +6 -0
  106. package/esm2015/cms/index.js +11 -0
  107. package/esm2015/cms/injection-tokens.js +8 -0
  108. package/esm2015/cms/launcher.module.js +23 -0
  109. package/esm2015/cms/modules/federated/default-options.js +5 -0
  110. package/esm2015/cms/modules/federated/export.js +2 -0
  111. package/esm2015/cms/modules/federated/federated.component.js +82 -0
  112. package/esm2015/cms/modules/federated/federated.module.js +19 -0
  113. package/esm2015/cms/modules/federated/federated.types.js +2 -0
  114. package/esm2015/cms/modules/federated/federated.utils.js +37 -0
  115. package/esm2015/cms/plugins/configuration.plugin.js +98 -0
  116. package/esm2015/cms/plugins/io.plugin.js +37 -0
  117. package/esm2015/cms/plugins/script.plugin.js +66 -0
  118. package/esm2015/cms/services/dynamic-module.service.js +33 -0
  119. package/esm2015/cms/services/element-context.service.js +10 -0
  120. package/esm2015/cms/services/index.js +4 -0
  121. package/esm2015/cms/services/integration.state.js +40 -0
  122. package/esm2015/cms/services/io-provider.service.js +51 -0
  123. package/esm2015/cms/services/launcher.service.js +57 -0
  124. package/esm2015/cms/services/templates.service.js +31 -0
  125. package/esm2015/cms/types/common.types.js +2 -0
  126. package/esm2015/cms/types/configuration.types.js +2 -0
  127. package/esm2015/cms/types/elements.types.js +2 -0
  128. package/esm2015/cms/types/index.js +6 -0
  129. package/esm2015/cms/types/integration.types.js +2 -0
  130. package/esm2015/cms/types/path.types.js +2 -0
  131. package/esm2015/cms/utils/element.utils.js +149 -0
  132. package/esm2015/cms/utils/elements-resolver.js +108 -0
  133. package/esm2015/cms/utils/index.js +4 -0
  134. package/esm2015/cms/utils/path.utils.js +67 -0
  135. package/esm2015/cms/veloceapps-sdk-cms.js +5 -0
  136. package/esm2015/cms/vendor-map.js +39 -0
  137. package/esm2015/core/core.module.js +18 -0
  138. package/esm2015/core/index.js +7 -0
  139. package/esm2015/core/modules/configuration/configuration.module.js +34 -0
  140. package/esm2015/core/modules/configuration/helpers.js +10 -0
  141. package/esm2015/core/modules/configuration/index.js +5 -0
  142. package/esm2015/core/modules/configuration/services/configuration-runtime.service.js +92 -0
  143. package/esm2015/core/modules/configuration/services/configuration.service.js +173 -0
  144. package/esm2015/core/modules/configuration/services/runtime-context.service.js +51 -0
  145. package/esm2015/core/modules/configuration/types/configuration-runtime.types.js +2 -0
  146. package/esm2015/core/modules/flow-configuration/flow-configuration.module.js +18 -0
  147. package/esm2015/core/modules/flow-configuration/index.js +5 -0
  148. package/esm2015/core/modules/flow-configuration/services/flow-configuration.service.js +135 -0
  149. package/esm2015/core/modules/flow-configuration/services/flow-update.service.js +129 -0
  150. package/esm2015/core/modules/flow-configuration/types/update.types.js +2 -0
  151. package/esm2015/core/modules/index.js +3 -0
  152. package/esm2015/core/services/context.service.js +50 -0
  153. package/esm2015/core/services/index.js +4 -0
  154. package/esm2015/core/services/product-images.service.js +30 -0
  155. package/esm2015/core/services/quote-draft.service.js +201 -0
  156. package/esm2015/core/types/index.js +4 -0
  157. package/esm2015/core/types/quote-states.types.js +2 -0
  158. package/esm2015/core/types/runtime.types.js +16 -0
  159. package/esm2015/core/types/ui-definition.types.js +2 -0
  160. package/esm2015/core/utils/index.js +3 -0
  161. package/esm2015/core/utils/line-item.utils.js +100 -0
  162. package/esm2015/core/utils/line-item.worker.js +19 -0
  163. package/esm2015/core/veloceapps-sdk-core.js +5 -0
  164. package/esm2015/index.js +2 -0
  165. package/esm2015/runtime/components/component-preview/component-preview.component.js +125 -0
  166. package/esm2015/runtime/components/index.js +5 -0
  167. package/esm2015/runtime/components/section-renderer/section-renderer.component.js +71 -0
  168. package/esm2015/runtime/components/ui-runtime/runtime.component.js +427 -0
  169. package/esm2015/runtime/components/ui-runtime-preview/runtime-preview.component.js +109 -0
  170. package/esm2015/runtime/execution/components/children-placeholder/children-placeholder.component.js +68 -0
  171. package/esm2015/runtime/execution/components/context-provider/context-provider.component.js +36 -0
  172. package/esm2015/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.js +72 -0
  173. package/esm2015/runtime/execution/components/federated/federated.component.js +81 -0
  174. package/esm2015/runtime/execution/components/velo-attribute/velo-attribute.component.js +65 -0
  175. package/esm2015/runtime/execution/components/velo-multiselect/velo-multiselect.component.js +136 -0
  176. package/esm2015/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.js +80 -0
  177. package/esm2015/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.js +101 -0
  178. package/esm2015/runtime/execution/components/velo-port-radio/velo-port-radio.component.js +150 -0
  179. package/esm2015/runtime/execution/components/velo-type/velo-type.component.js +121 -0
  180. package/esm2015/runtime/execution/directives/section-script.directive.js +242 -0
  181. package/esm2015/runtime/execution/directives/sf-query.directive.js +34 -0
  182. package/esm2015/runtime/execution/directives/velo-attribute.directive.js +86 -0
  183. package/esm2015/runtime/execution/directives/velo-port.directive.js +373 -0
  184. package/esm2015/runtime/execution/directives/vl-approval.directive.js +22 -0
  185. package/esm2015/runtime/execution/directives/vl-document-attachments.directive.js +35 -0
  186. package/esm2015/runtime/execution/directives/vl-document-templates.directive.js +59 -0
  187. package/esm2015/runtime/execution/directives/vl-quote.directive.js +41 -0
  188. package/esm2015/runtime/execution/directives/vl-ramp.directive.js +51 -0
  189. package/esm2015/runtime/execution/runtime-execution.module.js +163 -0
  190. package/esm2015/runtime/execution/utils/federated.util.js +37 -0
  191. package/esm2015/runtime/index.js +5 -0
  192. package/esm2015/runtime/runtime.module.js +104 -0
  193. package/esm2015/runtime/services/cart.service.js +27 -0
  194. package/esm2015/runtime/services/collapsible-state.service.js +34 -0
  195. package/esm2015/runtime/services/configuration.service.js +102 -0
  196. package/esm2015/runtime/services/current-state.service.js +17 -0
  197. package/esm2015/runtime/services/form-scope.service.js +30 -0
  198. package/esm2015/runtime/services/index.js +4 -0
  199. package/esm2015/runtime/services/product-model-cache.service.js +30 -0
  200. package/esm2015/runtime/services/runtime-context.service.js +56 -0
  201. package/esm2015/runtime/services/runtime-form.service.js +224 -0
  202. package/esm2015/runtime/services/runtime.service.js +108 -0
  203. package/esm2015/runtime/services/section-helper.service.js +27 -0
  204. package/esm2015/runtime/services/section-scope.service.js +36 -0
  205. package/esm2015/runtime/services/section-store.service.js +22 -0
  206. package/esm2015/runtime/services/section.service.js +124 -0
  207. package/esm2015/runtime/types/bound-data.types.js +7 -0
  208. package/esm2015/runtime/types/index.js +2 -0
  209. package/esm2015/runtime/types/runtime.types.js +2 -0
  210. package/esm2015/runtime/types/script-registry.types.js +51 -0
  211. package/esm2015/runtime/utils/line-item.util.js +273 -0
  212. package/esm2015/runtime/utils/section.utils.js +26 -0
  213. package/esm2015/runtime/utils/sections-binder.helper.js +105 -0
  214. package/esm2015/runtime/veloceapps-sdk-runtime.js +5 -0
  215. package/esm2015/src/components/dialog/dialog.component.js +30 -0
  216. package/esm2015/src/components/dialog/dialog.module.js +19 -0
  217. package/esm2015/src/components/dialog/dialog.types.js +2 -0
  218. package/esm2015/src/components/doc-gen/doc-gen.component.js +109 -0
  219. package/esm2015/src/components/doc-gen/doc-gen.module.js +19 -0
  220. package/esm2015/src/components/header/cart-overlay/cart-preview.component.js +122 -0
  221. package/esm2015/src/components/header/cart-overlay/cart-preview.module.js +46 -0
  222. package/esm2015/src/components/header/header.component.js +284 -0
  223. package/esm2015/src/components/header/header.module.js +46 -0
  224. package/esm2015/src/components/header/header.types.js +2 -0
  225. package/esm2015/src/constants.js +2 -0
  226. package/esm2015/src/flow-routing.module.js +137 -0
  227. package/esm2015/src/flow.component.js +45 -0
  228. package/esm2015/src/flow.module.js +60 -0
  229. package/esm2015/src/guards/context.guard.js +84 -0
  230. package/esm2015/src/guards/index.js +2 -0
  231. package/esm2015/src/guards/product-unload.guard.js +43 -0
  232. package/esm2015/src/guards/root.guard.js +41 -0
  233. package/esm2015/src/index.js +7 -0
  234. package/esm2015/src/pages/catalog/catalog.component.js +117 -0
  235. package/esm2015/src/pages/catalog/catalog.module.js +20 -0
  236. package/esm2015/src/pages/debug/debug.component.js +61 -0
  237. package/esm2015/src/pages/debug/debug.module.js +48 -0
  238. package/esm2015/src/pages/empty-account/empty-account.component.js +17 -0
  239. package/esm2015/src/pages/empty-account/empty-account.module.js +20 -0
  240. package/esm2015/src/pages/legacy-product/legacy-product.component.js +132 -0
  241. package/esm2015/src/pages/legacy-product/legacy-product.module.js +21 -0
  242. package/esm2015/src/pages/product/product.component.js +108 -0
  243. package/esm2015/src/pages/product/product.module.js +20 -0
  244. package/esm2015/src/pages/record-not-found/record-not-found.component.js +29 -0
  245. package/esm2015/src/pages/record-not-found/record-not-found.module.js +20 -0
  246. package/esm2015/src/pages/remote/remote.component.js +353 -0
  247. package/esm2015/src/pages/remote/remote.module.js +20 -0
  248. package/esm2015/src/pages/remote/remote.types.js +2 -0
  249. package/esm2015/src/pages/shopping-cart/shopping-cart.component.js +117 -0
  250. package/esm2015/src/pages/shopping-cart/shopping-cart.module.js +20 -0
  251. package/esm2015/src/resolvers/flow.resolver.js +62 -0
  252. package/esm2015/src/resolvers/quote.resolver.js +74 -0
  253. package/esm2015/src/services/doc-gen.service.js +33 -0
  254. package/esm2015/src/services/flow-dialog.service.js +123 -0
  255. package/esm2015/src/services/flow-router.service.js +124 -0
  256. package/esm2015/src/services/flow.service.js +71 -0
  257. package/esm2015/src/services/index.js +2 -0
  258. package/esm2015/src/types/context-route.types.js +2 -0
  259. package/esm2015/src/types/flow-customization.types.js +3 -0
  260. package/esm2015/src/types/index.js +3 -0
  261. package/esm2015/src/types/route.types.js +2 -0
  262. package/esm2015/src/utils/flow.utils.js +22 -0
  263. package/esm2015/src/utils/index.js +2 -0
  264. package/esm2015/veloceapps-sdk.js +5 -0
  265. package/fesm2015/veloceapps-sdk-cms.js +1357 -0
  266. package/fesm2015/veloceapps-sdk-cms.js.map +1 -0
  267. package/fesm2015/veloceapps-sdk-core.js +1029 -0
  268. package/fesm2015/veloceapps-sdk-core.js.map +1 -0
  269. package/fesm2015/veloceapps-sdk-runtime.js +3894 -0
  270. package/fesm2015/veloceapps-sdk-runtime.js.map +1 -0
  271. package/fesm2015/veloceapps-sdk.js +2449 -0
  272. package/fesm2015/veloceapps-sdk.js.map +1 -0
  273. package/index.d.ts +1 -0
  274. package/package.json +50 -0
  275. package/runtime/components/component-preview/component-preview.component.d.ts +27 -0
  276. package/runtime/components/index.d.ts +4 -0
  277. package/runtime/components/section-renderer/section-renderer.component.d.ts +25 -0
  278. package/runtime/components/ui-runtime/runtime.component.d.ts +53 -0
  279. package/runtime/components/ui-runtime-preview/runtime-preview.component.d.ts +27 -0
  280. package/runtime/execution/components/children-placeholder/children-placeholder.component.d.ts +30 -0
  281. package/runtime/execution/components/context-provider/context-provider.component.d.ts +14 -0
  282. package/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.d.ts +25 -0
  283. package/runtime/execution/components/federated/federated.component.d.ts +36 -0
  284. package/runtime/execution/components/velo-attribute/velo-attribute.component.d.ts +19 -0
  285. package/runtime/execution/components/velo-multiselect/velo-multiselect.component.d.ts +35 -0
  286. package/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.d.ts +22 -0
  287. package/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.d.ts +22 -0
  288. package/runtime/execution/components/velo-port-radio/velo-port-radio.component.d.ts +28 -0
  289. package/runtime/execution/components/velo-type/velo-type.component.d.ts +31 -0
  290. package/runtime/execution/directives/section-script.directive.d.ts +59 -0
  291. package/runtime/execution/directives/sf-query.directive.d.ts +15 -0
  292. package/runtime/execution/directives/velo-attribute.directive.d.ts +26 -0
  293. package/runtime/execution/directives/velo-port.directive.d.ts +74 -0
  294. package/runtime/execution/directives/vl-approval.directive.d.ts +10 -0
  295. package/runtime/execution/directives/vl-document-attachments.directive.d.ts +15 -0
  296. package/runtime/execution/directives/vl-document-templates.directive.d.ts +33 -0
  297. package/runtime/execution/directives/vl-quote.directive.d.ts +14 -0
  298. package/runtime/execution/directives/vl-ramp.directive.d.ts +15 -0
  299. package/runtime/execution/runtime-execution.module.d.ts +27 -0
  300. package/runtime/execution/utils/federated.util.d.ts +6 -0
  301. package/runtime/index.d.ts +4 -0
  302. package/runtime/package.json +10 -0
  303. package/runtime/runtime.module.d.ts +18 -0
  304. package/runtime/services/cart.service.d.ts +15 -0
  305. package/runtime/services/collapsible-state.service.d.ts +15 -0
  306. package/runtime/services/configuration.service.d.ts +19 -0
  307. package/runtime/services/current-state.service.d.ts +8 -0
  308. package/runtime/services/form-scope.service.d.ts +20 -0
  309. package/runtime/services/index.d.ts +3 -0
  310. package/runtime/services/product-model-cache.service.d.ts +14 -0
  311. package/runtime/services/runtime-context.service.d.ts +16 -0
  312. package/runtime/services/runtime-form.service.d.ts +24 -0
  313. package/runtime/services/runtime.service.d.ts +43 -0
  314. package/runtime/services/section-helper.service.d.ts +8 -0
  315. package/runtime/services/section-scope.service.d.ts +14 -0
  316. package/runtime/services/section-store.service.d.ts +11 -0
  317. package/runtime/services/section.service.d.ts +30 -0
  318. package/runtime/types/bound-data.types.d.ts +13 -0
  319. package/runtime/types/index.d.ts +1 -0
  320. package/runtime/types/runtime.types.d.ts +19 -0
  321. package/runtime/types/script-registry.types.d.ts +13 -0
  322. package/runtime/utils/line-item.util.d.ts +34 -0
  323. package/runtime/utils/section.utils.d.ts +2 -0
  324. package/runtime/utils/sections-binder.helper.d.ts +16 -0
  325. package/runtime/veloceapps-sdk-runtime.d.ts +5 -0
  326. package/src/components/dialog/dialog.component.d.ts +13 -0
  327. package/src/components/dialog/dialog.module.d.ts +9 -0
  328. package/src/components/dialog/dialog.types.d.ts +6 -0
  329. package/src/components/doc-gen/doc-gen.component.d.ts +26 -0
  330. package/src/components/doc-gen/doc-gen.module.d.ts +9 -0
  331. package/src/components/header/cart-overlay/cart-preview.component.d.ts +36 -0
  332. package/src/components/header/cart-overlay/cart-preview.module.d.ts +14 -0
  333. package/src/components/header/header.component.d.ts +63 -0
  334. package/src/components/header/header.module.d.ts +14 -0
  335. package/src/components/header/header.types.d.ts +20 -0
  336. package/src/constants.d.ts +1 -0
  337. package/src/flow-routing.module.d.ts +13 -0
  338. package/src/flow.component.d.ts +23 -0
  339. package/src/flow.module.d.ts +16 -0
  340. package/src/guards/context.guard.d.ts +19 -0
  341. package/src/guards/index.d.ts +1 -0
  342. package/src/guards/product-unload.guard.d.ts +16 -0
  343. package/src/guards/root.guard.d.ts +15 -0
  344. package/src/index.d.ts +6 -0
  345. package/src/pages/catalog/catalog.component.d.ts +32 -0
  346. package/src/pages/catalog/catalog.module.d.ts +10 -0
  347. package/src/pages/debug/debug.component.d.ts +25 -0
  348. package/src/pages/debug/debug.module.d.ts +14 -0
  349. package/src/pages/empty-account/empty-account.component.d.ts +5 -0
  350. package/src/pages/empty-account/empty-account.module.d.ts +10 -0
  351. package/src/pages/legacy-product/legacy-product.component.d.ts +37 -0
  352. package/src/pages/legacy-product/legacy-product.module.d.ts +10 -0
  353. package/src/pages/product/product.component.d.ts +32 -0
  354. package/src/pages/product/product.module.d.ts +10 -0
  355. package/src/pages/record-not-found/record-not-found.component.d.ts +11 -0
  356. package/src/pages/record-not-found/record-not-found.module.d.ts +9 -0
  357. package/src/pages/remote/remote.component.d.ts +47 -0
  358. package/src/pages/remote/remote.module.d.ts +10 -0
  359. package/src/pages/remote/remote.types.d.ts +4 -0
  360. package/src/pages/shopping-cart/shopping-cart.component.d.ts +32 -0
  361. package/src/pages/shopping-cart/shopping-cart.module.d.ts +10 -0
  362. package/src/resolvers/flow.resolver.d.ts +16 -0
  363. package/src/resolvers/quote.resolver.d.ts +20 -0
  364. package/src/services/doc-gen.service.d.ts +13 -0
  365. package/src/services/flow-dialog.service.d.ts +26 -0
  366. package/src/services/flow-router.service.d.ts +35 -0
  367. package/src/services/flow.service.d.ts +17 -0
  368. package/src/services/index.d.ts +1 -0
  369. package/src/types/context-route.types.d.ts +5 -0
  370. package/src/types/flow-customization.types.d.ts +11 -0
  371. package/src/types/index.d.ts +2 -0
  372. package/src/types/route.types.d.ts +9 -0
  373. package/src/utils/flow.utils.d.ts +8 -0
  374. package/src/utils/index.d.ts +1 -0
  375. package/veloceapps-sdk.d.ts +5 -0
@@ -0,0 +1,1357 @@
1
+ import { __decorate, __param, __awaiter, __rest } from 'tslib';
2
+ import * as i0 from '@angular/core';
3
+ import { InjectionToken, Component, ChangeDetectionStrategy, Inject, Injector, Injectable, Directive, ViewContainerRef, SkipSelf, ViewChild, Input, NgModule, ViewEncapsulation } from '@angular/core';
4
+ import * as rxjs from 'rxjs';
5
+ import { BehaviorSubject, Subject, takeUntil, map, filter, from, tap, of, switchMap, forkJoin, catchError } from 'rxjs';
6
+ import * as lodash from 'lodash';
7
+ import { compact, isArray, pull, flatten, set } from 'lodash';
8
+ import * as i7 from '@angular/common';
9
+ import { DOCUMENT, CommonModule } from '@angular/common';
10
+ import { UUID, CoreModule } from '@veloceapps/core';
11
+ import { DragDropModule } from '@angular/cdk/drag-drop';
12
+ import * as angularForms from '@angular/forms';
13
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
14
+ import * as i2 from '@veloceapps/sdk/core';
15
+ import { ConfigurationService, LineItemWorker, generateLineItem, getAttributeValue, QuoteDraftService, FlowConfigurationService, ProductImagesService, lineItemUtils, SdkCoreModule } from '@veloceapps/sdk/core';
16
+ import * as i1 from '@veloceapps/components';
17
+ import { LoaderModule } from '@veloceapps/components';
18
+ import { transform } from '@babel/standalone';
19
+ import { SalesforceApiService, QuoteApiService, DocumentTemplatesApiService, DocumentAttachmentApiService, RampApiService, CatalogApiService, DeltaApiService, PicklistsApiService, PriceApiService, ApiModule } from '@veloceapps/api';
20
+ import * as rxjsOperators from 'rxjs/operators';
21
+ import * as i3 from 'primeng/api';
22
+ import { DialogService } from 'primeng/dynamicdialog';
23
+
24
+ var FlowAction;
25
+ (function (FlowAction) {
26
+ FlowAction["FLOW_CONFIGURE_PRODUCT"] = "FLOW_CONFIGURE_PRODUCT";
27
+ FlowAction["FLOW_NAVIGATE_BACK"] = "FLOW_NAVIGATE_BACK";
28
+ FlowAction["FLOW_NAVIGATE_TO_CATALOG"] = "FLOW_NAVIGATE_TO_CATALOG";
29
+ FlowAction["FLOW_APPLY_PRODUCT_CONFIGURATION"] = "FLOW_APPLY_PRODUCT_CONFIGURATION";
30
+ FlowAction["FLOW_OPEN_DOC_GEN"] = "FLOW_OPEN_DOC_GEN";
31
+ FlowAction["FLOW_CLOSE_DOC_GEN"] = "FLOW_CLOSE_DOC_GEN";
32
+ FlowAction["REMOTE_APPLY"] = "REMOTE_APPLY";
33
+ FlowAction["REMOTE_CANCEL"] = "REMOTE_CANCEL";
34
+ })(FlowAction || (FlowAction = {}));
35
+ const ConfigureProductAction = ({ lineItemId, productId, }) => ({
36
+ type: FlowAction.FLOW_CONFIGURE_PRODUCT,
37
+ payload: { lineItemId, productId },
38
+ });
39
+ const NavigateBackAction = () => ({
40
+ type: FlowAction.FLOW_NAVIGATE_BACK,
41
+ });
42
+ const NavigateToCatalogAction = () => ({
43
+ type: FlowAction.FLOW_NAVIGATE_TO_CATALOG,
44
+ });
45
+ const ApplyProductConfigurationAction = () => ({
46
+ type: FlowAction.FLOW_APPLY_PRODUCT_CONFIGURATION,
47
+ });
48
+ const OpenDocGenAction = () => ({
49
+ type: FlowAction.FLOW_OPEN_DOC_GEN,
50
+ });
51
+ const CloseDocGenAction = () => ({
52
+ type: FlowAction.FLOW_CLOSE_DOC_GEN,
53
+ });
54
+ const RemoteApplyAction = () => ({
55
+ type: FlowAction.REMOTE_APPLY,
56
+ });
57
+ const RemoteCancelAction = () => ({
58
+ type: FlowAction.REMOTE_CANCEL,
59
+ });
60
+
61
+ var cmsActions = /*#__PURE__*/Object.freeze({
62
+ __proto__: null,
63
+ get FlowAction () { return FlowAction; },
64
+ ConfigureProductAction: ConfigureProductAction,
65
+ NavigateBackAction: NavigateBackAction,
66
+ NavigateToCatalogAction: NavigateToCatalogAction,
67
+ ApplyProductConfigurationAction: ApplyProductConfigurationAction,
68
+ OpenDocGenAction: OpenDocGenAction,
69
+ CloseDocGenAction: CloseDocGenAction,
70
+ RemoteApplyAction: RemoteApplyAction,
71
+ RemoteCancelAction: RemoteCancelAction
72
+ });
73
+
74
+ const DEFAULT_PLUGINS_TOKEN = new InjectionToken('DEFAULT_PLUGINS_TOKEN');
75
+ const UI_DEFINITION_METADATA = new InjectionToken('UI_DEFINITION_METADATA_TOKEN');
76
+ const ELEMENT_METADATA = new InjectionToken('ELEMENT_METADATA_TOKEN');
77
+ const SHARED_ELEMENT_METADATA = new InjectionToken('SHARED_ELEMENT_METADATA_TOKEN');
78
+ const ELEMENT_CONFIG = new InjectionToken('ELEMENT_CONFIG_TOKEN');
79
+ const VENDOR_MAP = new InjectionToken('VENDOR_MAP');
80
+
81
+ var cmsInjectionTokens = /*#__PURE__*/Object.freeze({
82
+ __proto__: null,
83
+ DEFAULT_PLUGINS_TOKEN: DEFAULT_PLUGINS_TOKEN,
84
+ UI_DEFINITION_METADATA: UI_DEFINITION_METADATA,
85
+ ELEMENT_METADATA: ELEMENT_METADATA,
86
+ SHARED_ELEMENT_METADATA: SHARED_ELEMENT_METADATA,
87
+ ELEMENT_CONFIG: ELEMENT_CONFIG,
88
+ VENDOR_MAP: VENDOR_MAP
89
+ });
90
+
91
+ class Entity {
92
+ constructor(injector) {
93
+ this.injector = injector;
94
+ this.plugins = [];
95
+ this.config = this.injector.get(ELEMENT_CONFIG);
96
+ this.defaultPlugins = this.injector.get(DEFAULT_PLUGINS_TOKEN);
97
+ }
98
+ initPlugins() {
99
+ var _a;
100
+ this.defaultPlugins.forEach(plugin => this.registerPlugin(new plugin(this)));
101
+ (_a = this.config.plugins) === null || _a === void 0 ? void 0 : _a.forEach(plugin => this.registerPlugin(new plugin(this)));
102
+ }
103
+ registerPlugin(plugin) {
104
+ this.plugins.push(plugin);
105
+ }
106
+ }
107
+
108
+ let ElementComponent = class ElementComponent extends Entity {
109
+ constructor(injector) {
110
+ super(injector);
111
+ this.injector = injector;
112
+ this.model$ = new BehaviorSubject(undefined);
113
+ super.initPlugins();
114
+ }
115
+ ngOnChanges(changes) {
116
+ this.plugins.forEach(plugin => { var _a; return (_a = plugin.ngOnChanges) === null || _a === void 0 ? void 0 : _a.call(plugin, changes); });
117
+ }
118
+ ngOnInit() {
119
+ this.plugins.forEach(plugin => { var _a; return (_a = plugin.ngOnInit) === null || _a === void 0 ? void 0 : _a.call(plugin); });
120
+ }
121
+ ngDoCheck() {
122
+ this.plugins.forEach(plugin => { var _a; return (_a = plugin.ngDoCheck) === null || _a === void 0 ? void 0 : _a.call(plugin); });
123
+ }
124
+ ngAfterContentInit() {
125
+ this.plugins.forEach(plugin => { var _a; return (_a = plugin.ngAfterContentInit) === null || _a === void 0 ? void 0 : _a.call(plugin); });
126
+ }
127
+ ngAfterViewInit() {
128
+ this.plugins.forEach(plugin => { var _a; return (_a = plugin.ngAfterViewInit) === null || _a === void 0 ? void 0 : _a.call(plugin); });
129
+ }
130
+ ngAfterViewChecked() {
131
+ this.plugins.forEach(plugin => { var _a; return (_a = plugin.ngAfterViewChecked) === null || _a === void 0 ? void 0 : _a.call(plugin); });
132
+ }
133
+ ngOnDestroy() {
134
+ this.plugins.forEach(plugin => { var _a; return (_a = plugin.ngOnDestroy) === null || _a === void 0 ? void 0 : _a.call(plugin); });
135
+ }
136
+ };
137
+ ElementComponent = __decorate([
138
+ Component({
139
+ template: '',
140
+ changeDetection: ChangeDetectionStrategy.OnPush,
141
+ jit: true,
142
+ }),
143
+ __param(0, Inject(Injector))
144
+ ], ElementComponent);
145
+
146
+ const parseBoundPath = (path) => {
147
+ var _a, _b;
148
+ const regexp = new RegExp(`(?:\\/)(?:\\w+)(?:\\/)(?:ports|attributes)(?:\\/)(?:\\w+)|(?:\\/)(?:\\w+)`, 'g');
149
+ const blocks = (_b = (_a = path.match(regexp)) === null || _a === void 0 ? void 0 : _a.map(match => {
150
+ const [type, property, name] = compact(match.split('/'));
151
+ return { type, property, name };
152
+ })) !== null && _b !== void 0 ? _b : [];
153
+ return blocks;
154
+ };
155
+ const parsePath = (path) => {
156
+ var _a, _b, _c, _d;
157
+ const segments = path.split('/');
158
+ let module;
159
+ let variable;
160
+ if ((_a = segments[0]) === null || _a === void 0 ? void 0 : _a.startsWith('@')) {
161
+ module = (_b = segments.shift()) === null || _b === void 0 ? void 0 : _b.substring(1);
162
+ }
163
+ if (((_c = segments[segments.length - 1]) === null || _c === void 0 ? void 0 : _c[0]) === ':') {
164
+ variable = (_d = segments.pop()) === null || _d === void 0 ? void 0 : _d.substring(1);
165
+ }
166
+ const isAbsolute = !segments[0];
167
+ const nonEmptySegments = segments.filter(Boolean);
168
+ if (!isAbsolute && nonEmptySegments[0] === '.') {
169
+ nonEmptySegments.shift();
170
+ }
171
+ return {
172
+ isAbsolute,
173
+ segments: nonEmptySegments,
174
+ module,
175
+ variable,
176
+ };
177
+ };
178
+ const findElementByModule = (elements, module, elementName) => {
179
+ for (const el of elements) {
180
+ if (el.module === module && el.name === elementName) {
181
+ return el;
182
+ }
183
+ const child = findElementByModule(el.children, module, elementName);
184
+ if (child) {
185
+ return child;
186
+ }
187
+ }
188
+ return;
189
+ };
190
+ const getAbsolutePath = (elements, subject, path) => {
191
+ var _a, _b, _c;
192
+ if (path.module) {
193
+ return (_a = findElementByModule(elements, path.module, path.segments[0])) === null || _a === void 0 ? void 0 : _a.path;
194
+ }
195
+ const subjectSegments = (_c = (_b = subject.path) === null || _b === void 0 ? void 0 : _b.split('/')) !== null && _c !== void 0 ? _c : [];
196
+ const segments = [...path.segments];
197
+ if (path.isAbsolute) {
198
+ return segments.join('/');
199
+ }
200
+ while (segments.length) {
201
+ const segment = segments.shift();
202
+ if (segment === '..') {
203
+ subjectSegments.pop();
204
+ }
205
+ else if (segment) {
206
+ subjectSegments.push(segment);
207
+ }
208
+ }
209
+ return subjectSegments.join('/');
210
+ };
211
+
212
+ class DynamicModuleService {
213
+ constructor() {
214
+ this._elementsTree = [];
215
+ this._componentFactories = [];
216
+ }
217
+ set componentFactories(data) {
218
+ this._componentFactories = data;
219
+ }
220
+ get componentFactories() {
221
+ return this._componentFactories;
222
+ }
223
+ getComponentFactory(element) {
224
+ return this.componentFactories.find(f => f.componentType.path === element.path);
225
+ }
226
+ get elementsTree() {
227
+ return this._elementsTree;
228
+ }
229
+ set elementsTree(tree) {
230
+ this._elementsTree = tree;
231
+ }
232
+ clear() {
233
+ this._elementsTree = [];
234
+ this.componentFactories = [];
235
+ }
236
+ }
237
+ DynamicModuleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DynamicModuleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
238
+ DynamicModuleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DynamicModuleService });
239
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DynamicModuleService, decorators: [{
240
+ type: Injectable
241
+ }] });
242
+
243
+ class IOProviderService {
244
+ constructor(dynamicModuleService) {
245
+ this.dynamicModuleService = dynamicModuleService;
246
+ this.inputs = {};
247
+ }
248
+ connect(el, name, target) {
249
+ var _a;
250
+ return (_a = this.resolveTarget(el, name, target)) === null || _a === void 0 ? void 0 : _a.asObservable();
251
+ }
252
+ provide(el, name, target) {
253
+ return this.resolveTarget(el, name, target);
254
+ }
255
+ resolveTarget(el, name, target) {
256
+ var _a, _b;
257
+ const isHost = !target;
258
+ if (isHost) {
259
+ return this.createSubjectSafe((_a = el.path) !== null && _a !== void 0 ? _a : '', name);
260
+ }
261
+ const elPath = parsePath(target);
262
+ const pathIsValue = elPath.segments.length === 1 && elPath.segments[0].startsWith('"') && elPath.segments[0].endsWith('"');
263
+ const finalName = (_b = elPath.variable) !== null && _b !== void 0 ? _b : name;
264
+ const value = pathIsValue ? new BehaviorSubject(elPath.segments[0].slice(1, -1)) : undefined;
265
+ const absolutePath = !pathIsValue ? getAbsolutePath(this.dynamicModuleService.elementsTree, el, elPath) : el.path;
266
+ return this.createSubjectSafe(absolutePath !== null && absolutePath !== void 0 ? absolutePath : '', finalName, value);
267
+ }
268
+ createSubjectSafe(path, name, subject) {
269
+ if (!this.inputs[path]) {
270
+ this.inputs[path] = {};
271
+ }
272
+ const subjectAlreadyExists = Boolean(this.inputs[path][name]);
273
+ if (!this.inputs[path][name]) {
274
+ this.inputs[path][name] = subject !== null && subject !== void 0 ? subject : new BehaviorSubject(undefined);
275
+ }
276
+ if (subject && subjectAlreadyExists) {
277
+ // push delayed value to workaround 'changed after it was checked' issue
278
+ setTimeout(() => this.inputs[path][name].next(subject.value));
279
+ }
280
+ return this.inputs[path][name];
281
+ }
282
+ }
283
+ IOProviderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IOProviderService, deps: [{ token: DynamicModuleService }], target: i0.ɵɵFactoryTarget.Injectable });
284
+ IOProviderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IOProviderService });
285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IOProviderService, decorators: [{
286
+ type: Injectable
287
+ }], ctorParameters: function () { return [{ type: DynamicModuleService }]; } });
288
+
289
+ class TemplatesService {
290
+ constructor() {
291
+ this.templates = {};
292
+ }
293
+ register(name, templateRef) {
294
+ this.ensureStorage(name);
295
+ this.templates[name].next(templateRef);
296
+ }
297
+ get(name) {
298
+ this.ensureStorage(name);
299
+ return this.templates[name].value;
300
+ }
301
+ get$(name) {
302
+ this.ensureStorage(name);
303
+ return this.templates[name].asObservable();
304
+ }
305
+ ensureStorage(name) {
306
+ if (!this.templates[name]) {
307
+ this.templates[name] = new BehaviorSubject(undefined);
308
+ }
309
+ }
310
+ }
311
+ TemplatesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TemplatesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
312
+ TemplatesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TemplatesService });
313
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TemplatesService, decorators: [{
314
+ type: Injectable
315
+ }] });
316
+
317
+ class IOPlugin {
318
+ constructor(host) {
319
+ var _a, _b;
320
+ this.host = host;
321
+ const elementMetadata = this.host.injector.get(ELEMENT_METADATA);
322
+ const inputProvider = this.host.injector.get(IOProviderService);
323
+ const inputs = Object.entries((_a = elementMetadata.inputs) !== null && _a !== void 0 ? _a : {});
324
+ const outputs = Object.entries((_b = elementMetadata.outputs) !== null && _b !== void 0 ? _b : {});
325
+ inputs.forEach(([key, path]) => {
326
+ var _a;
327
+ if (path && typeof path !== 'string') {
328
+ console.error(`The value of '${key}' input should be a string`);
329
+ }
330
+ if (((_a = elementMetadata.outputs) === null || _a === void 0 ? void 0 : _a[key]) !== undefined) {
331
+ console.warn(`'${key}' appears both in inputs and outputs. To prevent inconsistent behavior please keep them unique `);
332
+ }
333
+ this.host[key] = inputProvider.connect(elementMetadata, key, path);
334
+ });
335
+ outputs.forEach(([key, path]) => {
336
+ if (path && typeof path !== 'string') {
337
+ console.error(`The value of '${key}' output should be a string`);
338
+ }
339
+ this.host[key] = inputProvider.provide(elementMetadata, key, path);
340
+ });
341
+ }
342
+ }
343
+ IOPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IOPlugin, deps: [{ token: ElementComponent }], target: i0.ɵɵFactoryTarget.Directive });
344
+ IOPlugin.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: IOPlugin, ngImport: i0 });
345
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IOPlugin, decorators: [{
346
+ type: Directive
347
+ }], ctorParameters: function () { return [{ type: ElementComponent }]; } });
348
+
349
+ class ScriptPlugin {
350
+ constructor(host) {
351
+ this.host = host;
352
+ this.normalizeImports = (script, elementPath) => {
353
+ const 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');
354
+ const result = script.replace(regexp, (match, g1, g2, src) => {
355
+ const imports = g1
356
+ .trim()
357
+ .slice(1, -1)
358
+ .split(',')
359
+ .map(item => item.trim());
360
+ imports.forEach(item => {
361
+ var _a;
362
+ if (!((_a = this.vendorMap[src]) === null || _a === void 0 ? void 0 : _a[item])) {
363
+ throw new Error(`Failed to import ${item} from '${src}' in ${elementPath}/script.ts`);
364
+ }
365
+ });
366
+ return `const ${g1} = vendor['${src}'];`;
367
+ });
368
+ return result;
369
+ };
370
+ this.document = this.host.injector.get(DOCUMENT);
371
+ this.vendorMap = this.host.injector.get(VENDOR_MAP);
372
+ const elementMetadata = this.host.injector.get(ELEMENT_METADATA);
373
+ const sharedElementMetadata = this.host.injector.get(SHARED_ELEMENT_METADATA);
374
+ this.addScript(sharedElementMetadata);
375
+ this.addScript(elementMetadata);
376
+ }
377
+ addScript(metadata) {
378
+ var _a;
379
+ if (!(metadata === null || metadata === void 0 ? void 0 : metadata.script)) {
380
+ return;
381
+ }
382
+ const id = btoa(UUID.UUID());
383
+ const script = this.document.createElement('script');
384
+ script.type = `text/javascript`;
385
+ let scriptContent = this.normalizeImports(metadata.script, (_a = metadata.path) !== null && _a !== void 0 ? _a : metadata.name);
386
+ const classMatch = /export class (\S+)/.exec(scriptContent);
387
+ const className = classMatch === null || classMatch === void 0 ? void 0 : classMatch[1];
388
+ if (!classMatch || !className) {
389
+ console.error("Script doesn't have exported class");
390
+ return;
391
+ }
392
+ scriptContent = scriptContent.replace(classMatch[0], `class ${className}`);
393
+ script.text = `var ${id} = function(vendor) {${scriptContent}
394
+ return ${className}; };`;
395
+ this.document.body.appendChild(script);
396
+ const ScriptClass = window[id](this.vendorMap);
397
+ if (ScriptClass instanceof Object) {
398
+ this.host.registerPlugin(new ScriptClass(this.host));
399
+ }
400
+ this.document.body.removeChild(script);
401
+ }
402
+ }
403
+ ScriptPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ScriptPlugin, deps: [{ token: ElementComponent }], target: i0.ɵɵFactoryTarget.Directive });
404
+ ScriptPlugin.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: ScriptPlugin, ngImport: i0 });
405
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ScriptPlugin, decorators: [{
406
+ type: Directive
407
+ }], ctorParameters: function () { return [{ type: ElementComponent }]; } });
408
+
409
+ /*
410
+ * ScriptPlugin must always be the last plugin in the list to make sure user code is running after all pre-initializers.
411
+ */
412
+ const CONFIG = {
413
+ CUSTOM: {
414
+ component: ElementComponent,
415
+ plugins: [IOPlugin, ScriptPlugin],
416
+ },
417
+ CONTAINER: {
418
+ component: ElementComponent,
419
+ defaultTemplate: '<element-children></element-children>',
420
+ plugins: [ScriptPlugin],
421
+ },
422
+ SERVICE: {
423
+ component: ElementComponent,
424
+ plugins: [IOPlugin, ScriptPlugin],
425
+ suppressTemplate: true,
426
+ suppressStyles: true,
427
+ },
428
+ REFERENCE: {
429
+ component: ElementComponent,
430
+ plugins: [IOPlugin, ScriptPlugin],
431
+ suppressTemplate: true,
432
+ },
433
+ };
434
+
435
+ const EXPORTED_CLASS_REGEX = /export class (\S+)/;
436
+ const METADATA_DECORATOR_REGEX = /@ElementDefinition\(([\s\S]+)\)(\n|\r\n|.)*export class/g;
437
+ class UiBuildError extends Error {
438
+ constructor(message, affectedMetadata) {
439
+ super(message);
440
+ this.name = this.constructor.name;
441
+ this.affectedMetadata = affectedMetadata;
442
+ }
443
+ }
444
+ const elementToMetadata = (el, parentPath) => {
445
+ var _a;
446
+ const script = el.script && window.atob(el.script);
447
+ const template = el.template && window.atob(el.template);
448
+ const styles = el.styles && window.atob(el.styles);
449
+ const exportedClassName = script && ((_a = EXPORTED_CLASS_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
450
+ if (!exportedClassName) {
451
+ throw new Error("Script doesn't have exported class");
452
+ }
453
+ const elementMetadata = extractElementMetadata(script || '');
454
+ const path = (parentPath ? parentPath + '/' : '') + elementMetadata.name;
455
+ return Object.assign(Object.assign({}, elementMetadata), { path, script: script === null || script === void 0 ? void 0 : script.replace(METADATA_DECORATOR_REGEX, 'export class'), template,
456
+ styles, children: el.children.map(child => elementToMetadata(child, path)) });
457
+ };
458
+ const metadataToElement = (metadata, recursive = true) => {
459
+ const elMetadata = {
460
+ name: metadata.name,
461
+ isShared: metadata.isShared,
462
+ type: metadata.type,
463
+ model: metadata.model,
464
+ module: metadata.module,
465
+ reference: metadata.reference,
466
+ inputs: metadata.inputs,
467
+ outputs: metadata.outputs,
468
+ children: metadata.children.map(({ name }) => name),
469
+ };
470
+ const normalizedElMetadata = normalizeElementMetadata(elMetadata);
471
+ if (!metadata.script || !EXPORTED_CLASS_REGEX.test(metadata.script)) {
472
+ throw new UiBuildError(`'${metadata.name}' component script is missing an exported class`, metadata);
473
+ }
474
+ const script = metadata.script &&
475
+ window.btoa(metadata.script.replace(EXPORTED_CLASS_REGEX, `@ElementDefinition(${stringifyElementMetadata(normalizedElMetadata)})\nexport class Script`));
476
+ const template = metadata.template && window.btoa(metadata.template);
477
+ const styles = metadata.styles && window.btoa(metadata.styles);
478
+ return {
479
+ script,
480
+ template,
481
+ styles,
482
+ children: recursive ? metadata.children.map(meta => metadataToElement(meta)) : [],
483
+ };
484
+ };
485
+ const normalizeElementMetadata = (elementMetadata) => {
486
+ var _a, _b, _c, _d;
487
+ const metadata = Object.assign({}, elementMetadata);
488
+ // model
489
+ const { lineItem, path } = (_a = metadata.model) !== null && _a !== void 0 ? _a : {};
490
+ const model = lineItem ? { lineItem } : path ? { path } : undefined;
491
+ if (model) {
492
+ metadata.model = model;
493
+ }
494
+ else {
495
+ delete metadata.model;
496
+ }
497
+ // module
498
+ if (!metadata.module) {
499
+ delete metadata.module;
500
+ }
501
+ // reference
502
+ if (!metadata.reference) {
503
+ delete metadata.reference;
504
+ }
505
+ // inputs
506
+ const inputs = Object.entries((_b = metadata.inputs) !== null && _b !== void 0 ? _b : {}).reduce((acc, [key, value]) => {
507
+ return Object.assign(Object.assign({}, acc), { [key]: value || null });
508
+ }, {});
509
+ if (inputs && Object.keys(inputs).length > 0) {
510
+ metadata.inputs = inputs;
511
+ }
512
+ else {
513
+ delete metadata.inputs;
514
+ }
515
+ // outputs
516
+ const outputs = Object.entries((_c = metadata.outputs) !== null && _c !== void 0 ? _c : {}).reduce((acc, [key, value]) => {
517
+ return Object.assign(Object.assign({}, acc), { [key]: value || null });
518
+ }, {});
519
+ if (outputs && Object.keys(outputs).length > 0) {
520
+ metadata.outputs = outputs;
521
+ }
522
+ else {
523
+ delete metadata.outputs;
524
+ }
525
+ // children
526
+ if (!((_d = metadata.children) === null || _d === void 0 ? void 0 : _d.length)) {
527
+ delete metadata.children;
528
+ }
529
+ // isShared
530
+ if (!metadata.isShared) {
531
+ delete metadata.isShared;
532
+ }
533
+ return metadata;
534
+ };
535
+ const extractElementMetadata = (script) => {
536
+ var _a;
537
+ const metadataString = ((_a = METADATA_DECORATOR_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
538
+ // need to reset regex last index to prevent null result for next execution
539
+ METADATA_DECORATOR_REGEX.lastIndex = 0;
540
+ return new Function(`return ${metadataString}`)();
541
+ };
542
+ const extendElementMetadata = (script, extend) => {
543
+ var _a;
544
+ const metadataString = ((_a = METADATA_DECORATOR_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
545
+ // need to reset regex last index to prevent null result for next execution
546
+ METADATA_DECORATOR_REGEX.lastIndex = 0;
547
+ if (!metadataString) {
548
+ return script;
549
+ }
550
+ const updated = Object.assign(Object.assign({}, new Function(`return ${metadataString}`)()), extend);
551
+ return script.replace(metadataString, stringifyElementMetadata(updated));
552
+ };
553
+ const getElementConfig = (type) => {
554
+ return CONFIG[type];
555
+ };
556
+ const doesElementSupportIO = (type) => {
557
+ var _a, _b;
558
+ return (_b = (_a = getElementConfig(type).plugins) === null || _a === void 0 ? void 0 : _a.includes(IOPlugin)) !== null && _b !== void 0 ? _b : false;
559
+ };
560
+ function stringifyElementMetadata(elementMetadata) {
561
+ const cleaned = JSON.stringify(elementMetadata, null, 2);
562
+ return cleaned.replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm, function (match) {
563
+ return match.replace(/"/g, '');
564
+ });
565
+ }
566
+ const isValidScript = (script) => {
567
+ var _a;
568
+ if (!script) {
569
+ return false;
570
+ }
571
+ const exportedClassName = script && ((_a = EXPORTED_CLASS_REGEX.exec(script)) !== null && _a !== void 0 ? _a : [])[1];
572
+ if (!exportedClassName) {
573
+ return false;
574
+ }
575
+ const meta = extractElementMetadata(script);
576
+ if (!meta.name || !meta.type) {
577
+ return false;
578
+ }
579
+ return true;
580
+ };
581
+
582
+ class ElementContextService {
583
+ }
584
+ ElementContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
585
+ ElementContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementContextService });
586
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementContextService, decorators: [{
587
+ type: Injectable
588
+ }] });
589
+
590
+ class ElementRendererComponent {
591
+ constructor(parentInjector, dynamicModuleService, elementContext, ioProviderService, configurationService, elementRef, cdr) {
592
+ this.parentInjector = parentInjector;
593
+ this.dynamicModuleService = dynamicModuleService;
594
+ this.elementContext = elementContext;
595
+ this.ioProviderService = ioProviderService;
596
+ this.configurationService = configurationService;
597
+ this.elementRef = elementRef;
598
+ this.cdr = cdr;
599
+ this.refs = {};
600
+ this.destroy$ = new Subject();
601
+ }
602
+ ngOnInit() {
603
+ this.elementContext.metadata = this.meta;
604
+ this.factory = this.dynamicModuleService.getComponentFactory(this.meta);
605
+ this.createComponents();
606
+ }
607
+ ngOnDestroy() {
608
+ this.destroyComponents();
609
+ this.destroy$.next();
610
+ this.destroy$.complete();
611
+ }
612
+ createComponents() {
613
+ const modelMeta = this.meta.model;
614
+ if (!modelMeta) {
615
+ this.refs[UUID.UUID()] = this.createComponent();
616
+ return;
617
+ }
618
+ if (modelMeta.lineItem) {
619
+ this.createFromLineItem(modelMeta.lineItem);
620
+ }
621
+ else if (modelMeta.path) {
622
+ this.createFromPath(modelMeta.path);
623
+ }
624
+ }
625
+ createFromPath(path) {
626
+ const array$ = this.ioProviderService.connect(this.meta, 'children$', path);
627
+ array$ === null || array$ === void 0 ? void 0 : array$.pipe(takeUntil(this.destroy$)).subscribe(children => {
628
+ if (!isArray(children)) {
629
+ return;
630
+ }
631
+ this.processChildren(children);
632
+ });
633
+ }
634
+ createFromLineItem(path) {
635
+ var _a, _b;
636
+ const parentComp = this.parentInjector.get(ElementRendererComponent, null);
637
+ const parentPath = (_a = parentComp === null || parentComp === void 0 ? void 0 : parentComp.meta.model) === null || _a === void 0 ? void 0 : _a.lineItem;
638
+ const pathBlocks = parseBoundPath(path).reverse();
639
+ const { property, name } = (_b = pathBlocks[1]) !== null && _b !== void 0 ? _b : {};
640
+ const finalPath = pathBlocks[0];
641
+ const children$ = this.getParentLineItem$(parentComp).pipe(map(model => {
642
+ var _a;
643
+ if (property === 'ports' && !finalPath.property && parentPath !== path) {
644
+ return (_a = model.lineItems.filter(({ port }) => port === name)) !== null && _a !== void 0 ? _a : [];
645
+ }
646
+ return [model];
647
+ }));
648
+ children$.pipe(takeUntil(this.destroy$)).subscribe(children => {
649
+ this.processChildren(children);
650
+ });
651
+ }
652
+ processChildren(children) {
653
+ const refs = children.reduce((acc, data) => {
654
+ var _a;
655
+ const key = String((_a = data === null || data === void 0 ? void 0 : data.id) !== null && _a !== void 0 ? _a : UUID.UUID());
656
+ const ref = this.refs[key] ? this.updateComponent(key, data) : this.createComponent(data);
657
+ return ref ? Object.assign(Object.assign({}, acc), { [key]: ref }) : acc;
658
+ }, {});
659
+ const existingKeys = Object.keys(this.refs);
660
+ const newKeys = Object.keys(refs);
661
+ pull(existingKeys, ...newKeys).forEach(key => {
662
+ this.destroyComponent(key);
663
+ });
664
+ this.refs = refs;
665
+ this.cdr.detectChanges();
666
+ }
667
+ getParentLineItem$(parentComp) {
668
+ var _a;
669
+ const parentRefs = Object.values((_a = parentComp === null || parentComp === void 0 ? void 0 : parentComp.refs) !== null && _a !== void 0 ? _a : {});
670
+ const parentRef = parentRefs.find(ref => { var _a; return (_a = ref === null || ref === void 0 ? void 0 : ref.location.nativeElement) === null || _a === void 0 ? void 0 : _a.contains(this.elementRef.nativeElement); });
671
+ const parentModel$ = parentRef === null || parentRef === void 0 ? void 0 : parentRef.instance.model$;
672
+ return parentModel$ !== null && parentModel$ !== void 0 ? parentModel$ : this.configurationService.get();
673
+ }
674
+ createComponent(data) {
675
+ var _a, _b;
676
+ if (!this.factory) {
677
+ return;
678
+ }
679
+ const componentRef = (_a = this.el) === null || _a === void 0 ? void 0 : _a.createComponent(this.factory);
680
+ if (componentRef) {
681
+ componentRef.location.nativeElement.setAttribute('name', this.meta.name);
682
+ componentRef.location.nativeElement.setAttribute('path', this.meta.path);
683
+ (_b = componentRef.instance) === null || _b === void 0 ? void 0 : _b.model$.next(data);
684
+ }
685
+ return componentRef;
686
+ }
687
+ updateComponent(key, data) {
688
+ const ref = this.refs[key];
689
+ ref === null || ref === void 0 ? void 0 : ref.instance.model$.next(data);
690
+ return ref;
691
+ }
692
+ destroyComponent(key) {
693
+ var _a;
694
+ (_a = this.refs[key]) === null || _a === void 0 ? void 0 : _a.destroy();
695
+ delete this.refs[key];
696
+ }
697
+ destroyComponents() {
698
+ Object.values(this.refs).forEach(ref => ref === null || ref === void 0 ? void 0 : ref.destroy());
699
+ this.refs = {};
700
+ }
701
+ }
702
+ ElementRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementRendererComponent, deps: [{ token: i0.Injector, skipSelf: true }, { token: DynamicModuleService }, { token: ElementContextService }, { token: IOProviderService }, { token: i2.ConfigurationService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
703
+ ElementRendererComponent.ɵcmp = i0.ɵɵ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: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-template #el></ng-template>\n", styles: [":host{display:contents}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
704
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementRendererComponent, decorators: [{
705
+ type: Component,
706
+ args: [{
707
+ selector: 'vl-cms-element-renderer',
708
+ templateUrl: './element-renderer.component.html',
709
+ styleUrls: ['./element-renderer.component.scss'],
710
+ changeDetection: ChangeDetectionStrategy.OnPush,
711
+ providers: [ElementContextService],
712
+ }]
713
+ }], ctorParameters: function () { return [{ type: i0.Injector, decorators: [{
714
+ type: SkipSelf
715
+ }] }, { type: DynamicModuleService }, { type: ElementContextService }, { type: IOProviderService }, { type: i2.ConfigurationService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { el: [{
716
+ type: ViewChild,
717
+ args: ['el', { read: ViewContainerRef, static: true }]
718
+ }], meta: [{
719
+ type: Input
720
+ }] } });
721
+
722
+ class ElementChildrenComponent {
723
+ constructor(elementContext) {
724
+ this.elementContext = elementContext;
725
+ this.metadata = this.elementContext.metadata;
726
+ }
727
+ }
728
+ ElementChildrenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementChildrenComponent, deps: [{ token: ElementContextService }], target: i0.ɵɵFactoryTarget.Component });
729
+ ElementChildrenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ElementChildrenComponent, selector: "element-children", ngImport: i0, 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.ChangeDetectionStrategy.OnPush });
730
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementChildrenComponent, decorators: [{
731
+ type: Component,
732
+ args: [{
733
+ // eslint-disable-next-line @angular-eslint/component-selector
734
+ selector: 'element-children',
735
+ templateUrl: 'element-children.component.html',
736
+ styleUrls: ['./element-children.component.scss'],
737
+ changeDetection: ChangeDetectionStrategy.OnPush,
738
+ }]
739
+ }], ctorParameters: function () { return [{ type: ElementContextService }]; } });
740
+
741
+ // eslint-disable-next-line @angular-eslint/directive-selector
742
+ class CustomTemplateDirective {
743
+ constructor(templateRef, templatesService) {
744
+ this.templateRef = templateRef;
745
+ this.templatesService = templatesService;
746
+ }
747
+ ngAfterViewInit() {
748
+ if (!this.customTemplate) {
749
+ return;
750
+ }
751
+ this.templatesService.register(this.customTemplate, this.templateRef);
752
+ }
753
+ }
754
+ CustomTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomTemplateDirective, deps: [{ token: i0.TemplateRef }, { token: TemplatesService }], target: i0.ɵɵFactoryTarget.Directive });
755
+ CustomTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: CustomTemplateDirective, selector: "[customTemplate]", inputs: { customTemplate: "customTemplate" }, ngImport: i0 });
756
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomTemplateDirective, decorators: [{
757
+ type: Directive,
758
+ args: [{ selector: '[customTemplate]' }]
759
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: TemplatesService }]; }, propDecorators: { customTemplate: [{
760
+ type: Input
761
+ }] } });
762
+
763
+ const defaultOptions = {
764
+ suppressLoading: false,
765
+ loadingLabel: 'LOADING',
766
+ };
767
+
768
+ const moduleMap = {};
769
+ function loadRemoteEntry(remoteEntry) {
770
+ return new Promise((resolve, reject) => {
771
+ if (moduleMap[remoteEntry]) {
772
+ resolve();
773
+ return;
774
+ }
775
+ const script = document.createElement('script');
776
+ script.src = remoteEntry;
777
+ script.onerror = reject;
778
+ script.onload = () => {
779
+ moduleMap[remoteEntry] = true;
780
+ resolve(); // window is the global namespace
781
+ };
782
+ document.body.append(script);
783
+ });
784
+ }
785
+ function lookupExposedModule(remoteName, exposedModule) {
786
+ return __awaiter(this, void 0, void 0, function* () {
787
+ // Initializes the share scope. This fills it with known provided modules from this build and all remotes
788
+ yield __webpack_init_sharing__('default');
789
+ const container = window[remoteName]; // or get the container somewhere else
790
+ // Initialize the container, it may provide shared modules
791
+ yield container.init(__webpack_share_scopes__.default);
792
+ const factory = yield container.get(exposedModule);
793
+ const Module = factory();
794
+ return Module;
795
+ });
796
+ }
797
+ function loadRemoteModule(remoteEntry, remoteName, exposedModule) {
798
+ return __awaiter(this, void 0, void 0, function* () {
799
+ yield loadRemoteEntry(remoteEntry);
800
+ return yield lookupExposedModule(remoteName, exposedModule);
801
+ });
802
+ }
803
+
804
+ class FederatedComponent {
805
+ constructor(injector, compiler, appRef, renderer) {
806
+ this.injector = injector;
807
+ this.compiler = compiler;
808
+ this.appRef = appRef;
809
+ this.renderer = renderer;
810
+ this.isLoading$ = new BehaviorSubject(false);
811
+ // configs
812
+ this.suppressLoading = defaultOptions.suppressLoading;
813
+ this.loadingLabel = defaultOptions.loadingLabel;
814
+ }
815
+ ngOnChanges(changes) {
816
+ var _a, _b, _c, _d;
817
+ if (changes.data && this.instance) {
818
+ this.instance.data = this.data;
819
+ }
820
+ if (changes.options) {
821
+ this.suppressLoading = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.suppressLoading) !== null && _b !== void 0 ? _b : defaultOptions.suppressLoading;
822
+ this.loadingLabel = (_d = (_c = this.options) === null || _c === void 0 ? void 0 : _c.loadingLabel) !== null && _d !== void 0 ? _d : defaultOptions.loadingLabel;
823
+ }
824
+ }
825
+ ngOnInit() {
826
+ this.isLoading$.next(true);
827
+ }
828
+ ngAfterViewInit() {
829
+ var _a, _b, _c, _d, _e, _f;
830
+ const remoteEntry = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.remoteEntry) !== null && _b !== void 0 ? _b : this.remoteEntry;
831
+ const remoteName = (_d = (_c = this.options) === null || _c === void 0 ? void 0 : _c.remoteName) !== null && _d !== void 0 ? _d : this.remoteName;
832
+ const exposedModule = (_f = (_e = this.options) === null || _e === void 0 ? void 0 : _e.exposedModule) !== null && _f !== void 0 ? _f : this.exposedModule;
833
+ if (!remoteEntry || !remoteName || !exposedModule) {
834
+ return;
835
+ }
836
+ loadRemoteModule(remoteEntry, remoteName, exposedModule).then(federated => {
837
+ this.compiler.compileModuleAsync(federated[exposedModule]).then(moduleFactory => {
838
+ var _a, _b, _c;
839
+ const rootModuleRef = moduleFactory.create(this.injector);
840
+ const rootComponentFactory = rootModuleRef.componentFactoryResolver.resolveComponentFactory(federated[exposedModule].rootComponent);
841
+ const node = document.createElement('div');
842
+ const { instance, hostView } = rootComponentFactory.create(this.injector, [], node);
843
+ this.instance = instance;
844
+ this.instance.data = this.data;
845
+ this.renderer.appendChild((_a = this.moduleHostRef) === null || _a === void 0 ? void 0 : _a.nativeElement, node);
846
+ this.appRef.attachView(hostView);
847
+ (_c = (_b = this.options) === null || _b === void 0 ? void 0 : _b.onReady) === null || _c === void 0 ? void 0 : _c.call(_b);
848
+ this.isLoading$.next(false);
849
+ });
850
+ });
851
+ }
852
+ }
853
+ FederatedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FederatedComponent, deps: [{ token: i0.Injector }, { token: i0.Compiler }, { token: i0.ApplicationRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
854
+ FederatedComponent.ɵcmp = i0.ɵɵ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, 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.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i7.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
855
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FederatedComponent, decorators: [{
856
+ type: Component,
857
+ args: [{
858
+ // eslint-disable-next-line @angular-eslint/component-selector
859
+ selector: 'veloce-host-federated',
860
+ templateUrl: './federated.component.html',
861
+ styleUrls: ['./federated.component.scss'],
862
+ changeDetection: ChangeDetectionStrategy.OnPush,
863
+ }]
864
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }, { type: i0.ApplicationRef }, { type: i0.Renderer2 }]; }, propDecorators: { moduleHostRef: [{
865
+ type: ViewChild,
866
+ args: ['moduleHost', { static: false }]
867
+ }], remoteEntry: [{
868
+ type: Input
869
+ }], remoteName: [{
870
+ type: Input
871
+ }], exposedModule: [{
872
+ type: Input
873
+ }], data: [{
874
+ type: Input
875
+ }], options: [{
876
+ type: Input
877
+ }] } });
878
+
879
+ class FederatedModule {
880
+ }
881
+ FederatedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FederatedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
882
+ FederatedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FederatedModule, declarations: [FederatedComponent], imports: [CommonModule, LoaderModule], exports: [FederatedComponent] });
883
+ FederatedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FederatedModule, imports: [[CommonModule, LoaderModule]] });
884
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FederatedModule, decorators: [{
885
+ type: NgModule,
886
+ args: [{
887
+ declarations: [FederatedComponent],
888
+ imports: [CommonModule, LoaderModule],
889
+ exports: [FederatedComponent],
890
+ }]
891
+ }] });
892
+
893
+ class ConfigurationPlugin {
894
+ constructor(host) {
895
+ var _a, _b;
896
+ this.host = host;
897
+ this.destroy$ = new Subject();
898
+ this.elementMetadata = this.host.injector.get(ELEMENT_METADATA);
899
+ this.configurationService = this.host.injector.get(ConfigurationService);
900
+ if ((_a = this.elementMetadata.model) === null || _a === void 0 ? void 0 : _a.lineItem) {
901
+ this.host.model$.pipe(takeUntil(this.destroy$)).subscribe(model => (this.modelSnapshot = model));
902
+ const pathBlocks = parseBoundPath((_b = this.elementMetadata.model) === null || _b === void 0 ? void 0 : _b.lineItem);
903
+ const { type, property, name } = pathBlocks.reverse()[0];
904
+ this.host.boundName = name !== null && name !== void 0 ? name : type;
905
+ this.register(type, property, name);
906
+ }
907
+ }
908
+ ngOnDestroy() {
909
+ this.destroy$.next();
910
+ this.destroy$.complete();
911
+ }
912
+ register(type, property, name) {
913
+ if (!type) {
914
+ return;
915
+ }
916
+ if (!property) {
917
+ this.registerType();
918
+ }
919
+ else if (property === 'ports' && name) {
920
+ this.registerPort(name);
921
+ }
922
+ else if (property === 'attributes' && name) {
923
+ this.registerAttribute(name);
924
+ }
925
+ }
926
+ registerType() {
927
+ const remove = (id) => {
928
+ const rootLineItem = this.configurationService.getSnapshot();
929
+ if (!rootLineItem) {
930
+ return;
931
+ }
932
+ this.configurationService.patch(new LineItemWorker(rootLineItem).remove(id).li);
933
+ };
934
+ this.typeHost.remove = remove;
935
+ }
936
+ registerPort(name) {
937
+ const model$ = this.host.model$;
938
+ const portItems$ = model$.pipe(map(model => { var _a; return (_a = model === null || model === void 0 ? void 0 : model.lineItems.filter(li => li.port === this.host.boundName)) !== null && _a !== void 0 ? _a : []; }));
939
+ const portDomain$ = model$.pipe(map(model => model === null || model === void 0 ? void 0 : model.portDomains[this.host.boundName]));
940
+ const add = (type, attributes = []) => {
941
+ if (!this.modelSnapshot) {
942
+ return;
943
+ }
944
+ const portDomain = this.modelSnapshot.portDomains[name];
945
+ if (!portDomain) {
946
+ return;
947
+ }
948
+ const generated = generateLineItem(portDomain.name, type, this.modelSnapshot.id, attributes);
949
+ this.configurationService.patch(new LineItemWorker(this.modelSnapshot).insert(this.modelSnapshot.id, generated).li);
950
+ };
951
+ this.portHost.portItems$ = portItems$;
952
+ this.portHost.portDomain$ = portDomain$;
953
+ this.portHost.addPortItem = add;
954
+ }
955
+ registerAttribute(name) {
956
+ if (!this.host.model$) {
957
+ return;
958
+ }
959
+ const value$ = this.host.model$.pipe(map(model => { var _a; return getAttributeValue((_a = model === null || model === void 0 ? void 0 : model.attributes) !== null && _a !== void 0 ? _a : [], name); }));
960
+ const patch = (value) => {
961
+ if (!this.modelSnapshot) {
962
+ return;
963
+ }
964
+ this.configurationService.patch(new LineItemWorker(this.modelSnapshot).patchAttribute([{ name, value }]).li);
965
+ };
966
+ this.attributeHost.value$ = value$;
967
+ this.attributeHost.patch = patch;
968
+ }
969
+ get attributeHost() {
970
+ return this.host;
971
+ }
972
+ get typeHost() {
973
+ return this.host;
974
+ }
975
+ get portHost() {
976
+ return this.host;
977
+ }
978
+ }
979
+ ConfigurationPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConfigurationPlugin, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
980
+ ConfigurationPlugin.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: ConfigurationPlugin, ngImport: i0 });
981
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConfigurationPlugin, decorators: [{
982
+ type: Directive
983
+ }], ctorParameters: function () { return [{ type: undefined }]; } });
984
+
985
+ const DEFAULT_PLUGINS = {
986
+ CONFIGURATION: [ConfigurationPlugin],
987
+ DEFAULT: [],
988
+ };
989
+
990
+ const InitAction = { type: 'INIT' };
991
+ const ClearAction = { type: 'CLEAR' };
992
+ class IntegrationState {
993
+ constructor() {
994
+ this.stateSubj$ = new BehaviorSubject({});
995
+ this.action$ = new BehaviorSubject(InitAction);
996
+ }
997
+ get state$() {
998
+ return this.stateSubj$.asObservable();
999
+ }
1000
+ get state() {
1001
+ return this.stateSubj$.getValue();
1002
+ }
1003
+ patchState(update) {
1004
+ this.stateSubj$.next(Object.assign(Object.assign({}, this.stateSubj$.getValue()), update));
1005
+ }
1006
+ dispatch(action) {
1007
+ this.action$.next(action);
1008
+ }
1009
+ listen$(actionType) {
1010
+ return this.action$.pipe(filter(action => action.type === actionType), map(action => action.payload));
1011
+ }
1012
+ listenAll$() {
1013
+ return this.action$.asObservable();
1014
+ }
1015
+ clear() {
1016
+ this.stateSubj$.next({});
1017
+ this.action$.next(ClearAction);
1018
+ }
1019
+ }
1020
+ IntegrationState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IntegrationState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1021
+ IntegrationState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IntegrationState, providedIn: 'root' });
1022
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IntegrationState, decorators: [{
1023
+ type: Injectable,
1024
+ args: [{ providedIn: 'root' }]
1025
+ }] });
1026
+
1027
+ const VELOCE_LIBS = {
1028
+ '@veloceapps/sdk/core': Object.assign({ ConfigurationService,
1029
+ QuoteDraftService,
1030
+ FlowConfigurationService,
1031
+ LineItemWorker,
1032
+ ProductImagesService }, lineItemUtils),
1033
+ '@veloceapps/sdk/cms': Object.assign(Object.assign(Object.assign({}, cmsInjectionTokens), cmsActions), { TemplatesService,
1034
+ IntegrationState }),
1035
+ '@veloceapps/api': {
1036
+ SalesforceApiService,
1037
+ QuoteApiService,
1038
+ DocumentTemplatesApiService,
1039
+ DocumentAttachmentApiService,
1040
+ RampApiService,
1041
+ CatalogApiService,
1042
+ DeltaApiService,
1043
+ PicklistsApiService,
1044
+ PriceApiService,
1045
+ },
1046
+ '@angular/core': i0,
1047
+ '@angular/forms': angularForms,
1048
+ rxjs: rxjs,
1049
+ 'rxjs/operators': rxjsOperators,
1050
+ lodash: lodash,
1051
+ };
1052
+ const VELOCE_LIBS_BACKWARDS_COMPATIBLE = Object.entries(VELOCE_LIBS).reduce((trunk, [key, value]) => (Object.assign(Object.assign({}, trunk), { [key.replace('@veloceapps/', '@veloce/')]: value })), {});
1053
+ const vendorMap = Object.assign(Object.assign(Object.assign({}, VELOCE_LIBS), VELOCE_LIBS_BACKWARDS_COMPATIBLE), { '@angular/core': i0, '@angular/forms': angularForms, rxjs: rxjs, 'rxjs/operators': rxjsOperators, lodash: lodash });
1054
+
1055
+ class ElementsResolver {
1056
+ constructor(uiDef, elements) {
1057
+ this.uiDef = uiDef;
1058
+ this.renderableElements = [];
1059
+ this.sharedElements = [];
1060
+ this.elements = this.transpileScripts(elements);
1061
+ const flatElements = this.flattenElements(this.elements);
1062
+ for (const el of flatElements) {
1063
+ if (this.isSharedElement(el)) {
1064
+ this.sharedElements.push(el);
1065
+ }
1066
+ else {
1067
+ this.renderableElements.push(el);
1068
+ }
1069
+ }
1070
+ }
1071
+ transpile(el) {
1072
+ var _a;
1073
+ if (!el.script) {
1074
+ return;
1075
+ }
1076
+ const transformed = transform(el.script, {
1077
+ filename: el.name + '.ts',
1078
+ presets: ['typescript'],
1079
+ sourceMaps: 'inline',
1080
+ });
1081
+ return (_a = transformed.code) !== null && _a !== void 0 ? _a : undefined;
1082
+ }
1083
+ transpileScripts(elements) {
1084
+ return elements.map(el => (Object.assign(Object.assign({}, el), { script: this.transpile(el), children: this.transpileScripts(el.children) })));
1085
+ }
1086
+ flattenElements(elements) {
1087
+ return flatten(elements.map(el => [el, ...this.flattenElements(el.children)]));
1088
+ }
1089
+ isSharedElement(el) {
1090
+ return Boolean(el.isShared) && el.type !== 'REFERENCE';
1091
+ }
1092
+ getSharedElement(element) {
1093
+ if (element.type !== 'REFERENCE') {
1094
+ return;
1095
+ }
1096
+ return this.sharedElements.find(el => element.reference === el.name);
1097
+ }
1098
+ resolveElementTemplate(element) {
1099
+ const config = CONFIG[element.type];
1100
+ const template = !config.suppressTemplate ? element.template : '';
1101
+ return template || config.defaultTemplate || '';
1102
+ }
1103
+ resolveElementStyles(element) {
1104
+ var _a;
1105
+ const config = CONFIG[element.type];
1106
+ return !config.suppressStyles ? (_a = element.styles) !== null && _a !== void 0 ? _a : '' : '';
1107
+ }
1108
+ processElementMetadata(sourceElement) {
1109
+ var _a, _b;
1110
+ const sharedElement = this.getSharedElement(sourceElement);
1111
+ let finalElement;
1112
+ if (sourceElement.type === 'REFERENCE') {
1113
+ if (!sharedElement) {
1114
+ console.warn(`Shared element "${sourceElement.reference}" not found`);
1115
+ return;
1116
+ }
1117
+ finalElement = Object.assign(Object.assign({}, sourceElement), { type: sharedElement.type, template: sharedElement.template, styles: ((_a = sharedElement.styles) !== null && _a !== void 0 ? _a : '') + '\n' + ((_b = sourceElement.styles) !== null && _b !== void 0 ? _b : ''), inputs: Object.assign(Object.assign({}, sharedElement.inputs), sourceElement.inputs), outputs: Object.assign(Object.assign({}, sharedElement.outputs), sourceElement.outputs) });
1118
+ }
1119
+ else {
1120
+ finalElement = sourceElement;
1121
+ }
1122
+ finalElement.template = this.resolveElementTemplate(finalElement);
1123
+ finalElement.styles = this.resolveElementStyles(finalElement);
1124
+ return finalElement;
1125
+ }
1126
+ resolveElement(sourceElement) {
1127
+ var _a;
1128
+ const element = this.processElementMetadata(sourceElement);
1129
+ if (!element) {
1130
+ return;
1131
+ }
1132
+ const config = CONFIG[element.type];
1133
+ const defaultPlugins = (_a = DEFAULT_PLUGINS[this.uiDef.type]) !== null && _a !== void 0 ? _a : [];
1134
+ if (!config) {
1135
+ console.warn(`Unknown element type "${element.type}"`);
1136
+ return;
1137
+ }
1138
+ const component = Object.assign(Object.assign({ selector: 'vl-element', template: element.template }, (element.styles ? { styles: [element.styles] } : {})), { providers: [
1139
+ { provide: DEFAULT_PLUGINS_TOKEN, useValue: defaultPlugins },
1140
+ { provide: UI_DEFINITION_METADATA, useValue: this.uiDef },
1141
+ { provide: ELEMENT_METADATA, useValue: element },
1142
+ { provide: SHARED_ELEMENT_METADATA, useValue: this.getSharedElement(sourceElement) },
1143
+ { provide: ELEMENT_CONFIG, useValue: config },
1144
+ { provide: VENDOR_MAP, useValue: vendorMap },
1145
+ ] });
1146
+ const cmp = Component(component)(class C extends config.component {
1147
+ });
1148
+ set(cmp, 'path', element.path);
1149
+ return cmp;
1150
+ }
1151
+ getNgComponents() {
1152
+ return this.renderableElements.map(el => this.resolveElement(el)).filter(Boolean);
1153
+ }
1154
+ }
1155
+
1156
+ class LauncherService {
1157
+ constructor(compiler, dynamicModuleService) {
1158
+ this.compiler = compiler;
1159
+ this.dynamicModuleService = dynamicModuleService;
1160
+ }
1161
+ compileModule(elements, uiDefs) {
1162
+ this.module = this.getModule(elements, uiDefs);
1163
+ return from(this.compiler.compileModuleAndAllComponentsAsync(this.module)).pipe(tap(m => {
1164
+ this.dynamicModuleService.componentFactories = m.componentFactories;
1165
+ this.moduleInstance = m;
1166
+ }));
1167
+ }
1168
+ destroy() {
1169
+ if (this.moduleInstance) {
1170
+ this.dynamicModuleService.clear();
1171
+ this.moduleInstance = undefined;
1172
+ }
1173
+ if (this.module) {
1174
+ this.compiler.clearCacheFor(this.module);
1175
+ this.module = undefined;
1176
+ }
1177
+ }
1178
+ getModule(elements, uiDef) {
1179
+ const staticComponents = [ElementChildrenComponent, ElementRendererComponent, CustomTemplateDirective];
1180
+ const elementsResolver = new ElementsResolver(uiDef, elements);
1181
+ this.dynamicModuleService.elementsTree = elementsResolver.elements;
1182
+ let DynamicModule = class DynamicModule {
1183
+ };
1184
+ DynamicModule = __decorate([
1185
+ NgModule({
1186
+ imports: [CommonModule, FormsModule, ReactiveFormsModule, FederatedModule, DragDropModule],
1187
+ declarations: [...staticComponents, ...elementsResolver.getNgComponents()],
1188
+ jit: true,
1189
+ })
1190
+ ], DynamicModule);
1191
+ return DynamicModule;
1192
+ }
1193
+ }
1194
+ LauncherService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LauncherService, deps: [{ token: i0.Compiler }, { token: DynamicModuleService }], target: i0.ɵɵFactoryTarget.Injectable });
1195
+ LauncherService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LauncherService });
1196
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LauncherService, decorators: [{
1197
+ type: Injectable
1198
+ }], ctorParameters: function () { return [{ type: i0.Compiler }, { type: DynamicModuleService }]; } });
1199
+
1200
+ class PreviewComponent {
1201
+ constructor(launcherService, configurationService, messageService, runtimeService, integrationState) {
1202
+ this.launcherService = launcherService;
1203
+ this.configurationService = configurationService;
1204
+ this.messageService = messageService;
1205
+ this.runtimeService = runtimeService;
1206
+ this.integrationState = integrationState;
1207
+ this.clearState = false;
1208
+ this.state$ = new BehaviorSubject({ loading: true, failure: false });
1209
+ this.elements = [];
1210
+ this.destroy$ = new Subject();
1211
+ }
1212
+ ngOnInit() {
1213
+ if (this.clearState) {
1214
+ this.integrationState.clear();
1215
+ }
1216
+ this.startPreview();
1217
+ }
1218
+ ngOnDestroy() {
1219
+ this.destroy$.next();
1220
+ this.destroy$.complete();
1221
+ this.configurationService.reset();
1222
+ }
1223
+ initializeConfiguration$() {
1224
+ const isAlreadyInitialized = this.runtimeService.isInitialized;
1225
+ if (!this.uiDefinition || this.uiDefinition.type !== 'CONFIGURATION' || isAlreadyInitialized) {
1226
+ return of({});
1227
+ }
1228
+ if (!this.modelId) {
1229
+ console.warn(`No modelId is given for uiDefinition with '${this.uiDefinition.type}' type`);
1230
+ return of({});
1231
+ }
1232
+ // If still not initialized - init configuration in Test mode
1233
+ return this.runtimeService
1234
+ .initTestMode(this.modelId, this.uiDefinition)
1235
+ .pipe(switchMap(() => this.configurationService.configure()));
1236
+ }
1237
+ elementToMetadataSafe(elements) {
1238
+ var _a, _b;
1239
+ try {
1240
+ return elements.map(element => elementToMetadata(element));
1241
+ }
1242
+ catch (e) {
1243
+ console.error(e);
1244
+ if (!((_b = (_a = this.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.suppressToastMessages)) {
1245
+ this.messageService.add({ severity: 'error', summary: String(e) });
1246
+ }
1247
+ return [];
1248
+ }
1249
+ }
1250
+ startPreview() {
1251
+ if (!this.uiDefinition) {
1252
+ return;
1253
+ }
1254
+ const _a = this.uiDefinition, { children } = _a, uiDefinitionMeta = __rest(_a, ["children"]);
1255
+ this.elements = this.elementToMetadataSafe(children);
1256
+ const compilation$ = this.launcherService.compileModule(this.elements, uiDefinitionMeta);
1257
+ forkJoin([compilation$, this.initializeConfiguration$()])
1258
+ .pipe(tap(() => this.state$.next({ loading: false, failure: false })), catchError(error => {
1259
+ var _a, _b;
1260
+ console.error(error);
1261
+ if (!((_b = (_a = this.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.suppressToastMessages)) {
1262
+ this.messageService.add({ severity: 'error', summary: error });
1263
+ }
1264
+ this.state$.next({ loading: false, failure: true });
1265
+ return of();
1266
+ }), takeUntil(this.destroy$))
1267
+ .subscribe();
1268
+ }
1269
+ }
1270
+ PreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PreviewComponent, deps: [{ token: LauncherService }, { token: i2.ConfigurationService }, { token: i3.MessageService }, { token: i2.ConfigurationRuntimeService }, { token: IntegrationState }], target: i0.ɵɵFactoryTarget.Component });
1271
+ PreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: PreviewComponent, selector: "vl-cms-preview", inputs: { modelId: "modelId", uiDefinition: "uiDefinition", clearState: "clearState" }, providers: [IOProviderService, TemplatesService], ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-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.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: ["meta"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i7.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom });
1272
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PreviewComponent, decorators: [{
1273
+ type: Component,
1274
+ args: [{
1275
+ selector: 'vl-cms-preview',
1276
+ templateUrl: './preview.component.html',
1277
+ styleUrls: ['./preview.component.scss'],
1278
+ changeDetection: ChangeDetectionStrategy.OnPush,
1279
+ providers: [IOProviderService, TemplatesService],
1280
+ // use shadow DOM to prevent UI from being affected by global styles
1281
+ encapsulation: ViewEncapsulation.ShadowDom,
1282
+ }]
1283
+ }], ctorParameters: function () { return [{ type: LauncherService }, { type: i2.ConfigurationService }, { type: i3.MessageService }, { type: i2.ConfigurationRuntimeService }, { type: IntegrationState }]; }, propDecorators: { modelId: [{
1284
+ type: Input
1285
+ }], uiDefinition: [{
1286
+ type: Input
1287
+ }], clearState: [{
1288
+ type: Input
1289
+ }] } });
1290
+
1291
+ class ElementRendererModule {
1292
+ }
1293
+ ElementRendererModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementRendererModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1294
+ ElementRendererModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementRendererModule, declarations: [ElementRendererComponent], exports: [ElementRendererComponent] });
1295
+ ElementRendererModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementRendererModule });
1296
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementRendererModule, decorators: [{
1297
+ type: NgModule,
1298
+ args: [{
1299
+ declarations: [ElementRendererComponent],
1300
+ exports: [ElementRendererComponent],
1301
+ }]
1302
+ }] });
1303
+
1304
+ class ElementChildrenModule {
1305
+ }
1306
+ ElementChildrenModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementChildrenModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1307
+ ElementChildrenModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementChildrenModule, declarations: [ElementChildrenComponent], imports: [ElementRendererModule], exports: [ElementChildrenComponent] });
1308
+ ElementChildrenModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementChildrenModule, imports: [[ElementRendererModule]] });
1309
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ElementChildrenModule, decorators: [{
1310
+ type: NgModule,
1311
+ args: [{
1312
+ declarations: [ElementChildrenComponent],
1313
+ imports: [ElementRendererModule],
1314
+ exports: [ElementChildrenComponent],
1315
+ }]
1316
+ }] });
1317
+
1318
+ class PreviewModule {
1319
+ }
1320
+ PreviewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PreviewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1321
+ PreviewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PreviewModule, declarations: [PreviewComponent], imports: [CommonModule, LoaderModule, ElementRendererModule, ElementChildrenModule], exports: [PreviewComponent] });
1322
+ PreviewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PreviewModule, providers: [IntegrationState], imports: [[CommonModule, LoaderModule, ElementRendererModule, ElementChildrenModule]] });
1323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PreviewModule, decorators: [{
1324
+ type: NgModule,
1325
+ args: [{
1326
+ declarations: [PreviewComponent],
1327
+ imports: [CommonModule, LoaderModule, ElementRendererModule, ElementChildrenModule],
1328
+ providers: [IntegrationState],
1329
+ exports: [PreviewComponent],
1330
+ }]
1331
+ }] });
1332
+
1333
+ function ElementDefinition(definition) {
1334
+ return function (constructor) {
1335
+ return constructor;
1336
+ };
1337
+ }
1338
+
1339
+ class LauncherModule {
1340
+ }
1341
+ LauncherModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LauncherModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1342
+ LauncherModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LauncherModule, imports: [CommonModule, CoreModule, ApiModule, SdkCoreModule] });
1343
+ LauncherModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LauncherModule, providers: [LauncherService, IntegrationState, DynamicModuleService, DialogService], imports: [[CommonModule, CoreModule, ApiModule, SdkCoreModule]] });
1344
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LauncherModule, decorators: [{
1345
+ type: NgModule,
1346
+ args: [{
1347
+ imports: [CommonModule, CoreModule, ApiModule, SdkCoreModule],
1348
+ providers: [LauncherService, IntegrationState, DynamicModuleService, DialogService],
1349
+ }]
1350
+ }] });
1351
+
1352
+ /**
1353
+ * Generated bundle index. Do not edit.
1354
+ */
1355
+
1356
+ export { ApplyProductConfigurationAction, CloseDocGenAction, ConfigureProductAction, DEFAULT_PLUGINS_TOKEN, ELEMENT_CONFIG, ELEMENT_METADATA, ElementComponent, ElementDefinition, ElementsResolver, FlowAction, IntegrationState, LauncherModule, LauncherService, NavigateBackAction, NavigateToCatalogAction, OpenDocGenAction, PreviewComponent, PreviewModule, RemoteApplyAction, RemoteCancelAction, SHARED_ELEMENT_METADATA, TemplatesService, UI_DEFINITION_METADATA, UiBuildError, VENDOR_MAP, doesElementSupportIO, elementToMetadata, extendElementMetadata, extractElementMetadata, findElementByModule, getAbsolutePath, getElementConfig, isValidScript, metadataToElement, normalizeElementMetadata, parseBoundPath, parsePath, stringifyElementMetadata };
1357
+ //# sourceMappingURL=veloceapps-sdk-cms.js.map