@crystaldesign/web-planner-logic 26.12.0-beta.6 → 26.12.0-beta.7

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 (89) hide show
  1. package/build/cjs/{DivaBoxPlanner-e772f6a3.js → DivaBoxPlanner-143d6027.js} +12 -9
  2. package/build/cjs/{DivaStandardPlanner-d6cb5f39.js → DivaStandardPlanner-85b2b3ec.js} +2 -2
  3. package/build/cjs/{DoorPlanner-9ea7a6aa.js → DoorPlanner-2350aacc.js} +1 -1
  4. package/build/cjs/{Host3DSignalR-9710fc4e.js → Host3DSignalR-dad3c3fd.js} +1 -1
  5. package/build/cjs/{LiviqueWWSHandler-fbc83326.js → LiviqueWWSHandler-1efa9da7.js} +1 -1
  6. package/build/cjs/{PfisterWWSHandler-1a240ebf.js → PfisterWWSHandler-be3ebeaa.js} +1 -1
  7. package/build/cjs/{PlannerHandler2D-1d75a95f.js → PlannerHandler2D-1b4b06b0.js} +1 -1
  8. package/build/cjs/{SeriousBasketHandler-f492ea60.js → SeriousBasketHandler-6d4d921a.js} +1 -1
  9. package/build/cjs/{ShelfPlanner-65f4da8e.js → ShelfPlanner-8fa17486.js} +7 -7
  10. package/build/cjs/{StandardWWSHandler-6187c7c9.js → StandardWWSHandler-c84a70a7.js} +1 -1
  11. package/build/cjs/{index-34ea53f6.js → index-9358200e.js} +2189 -756
  12. package/build/cjs/index.js +8 -1
  13. package/build/esm/{DivaBoxPlanner-2ba492c3.js → DivaBoxPlanner-8c20358a.js} +12 -9
  14. package/build/esm/{DivaStandardPlanner-19e1f3d9.js → DivaStandardPlanner-75808b6c.js} +2 -2
  15. package/build/esm/{DoorPlanner-dd3a1b18.js → DoorPlanner-b74f2c6a.js} +1 -1
  16. package/build/esm/{Host3DSignalR-d5d5d7f3.js → Host3DSignalR-5af3fdc7.js} +1 -1
  17. package/build/esm/{LiviqueWWSHandler-1634b15e.js → LiviqueWWSHandler-12e6cecf.js} +1 -1
  18. package/build/esm/{PfisterWWSHandler-1ba9df74.js → PfisterWWSHandler-670a6f34.js} +1 -1
  19. package/build/esm/{PlannerHandler2D-8b9dbf35.js → PlannerHandler2D-24994f37.js} +1 -1
  20. package/build/esm/{SeriousBasketHandler-f0ccbf97.js → SeriousBasketHandler-dbf84292.js} +1 -1
  21. package/build/esm/{ShelfPlanner-b7d908ec.js → ShelfPlanner-c3b5b34f.js} +7 -7
  22. package/build/esm/{StandardWWSHandler-2a205527.js → StandardWWSHandler-2193dbc6.js} +1 -1
  23. package/build/esm/{index-0e729418.js → index-a2f44a31.js} +2183 -757
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/index.d.ts +9 -0
  26. package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts +1 -0
  28. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/interface/Articles/PartListArticleToLoadType.d.ts +3 -0
  30. package/build/types/web-planner-logic/src/interface/Articles/PartListArticleToLoadType.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/interface/FunctionTypes/index.d.ts +1 -0
  32. package/build/types/web-planner-logic/src/interface/FunctionTypes/index.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/interface/IDM/ArticleApi.d.ts +2 -1
  34. package/build/types/web-planner-logic/src/interface/IDM/ArticleApi.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/logic/Article/ArticleOptionState.d.ts +5 -0
  36. package/build/types/web-planner-logic/src/logic/Article/ArticleOptionState.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts +40 -0
  38. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts.map +1 -1
  39. package/build/types/web-planner-logic/src/logic/Article/DivaArticleHandler.d.ts +4 -0
  40. package/build/types/web-planner-logic/src/logic/Article/DivaArticleHandler.d.ts.map +1 -1
  41. package/build/types/web-planner-logic/src/logic/Article/Engine/ArticleEngine.d.ts +2 -0
  42. package/build/types/web-planner-logic/src/logic/Article/Engine/ArticleEngine.d.ts.map +1 -1
  43. package/build/types/web-planner-logic/src/logic/Article/Engine/IDMArticleEngine.d.ts +17 -1
  44. package/build/types/web-planner-logic/src/logic/Article/Engine/IDMArticleEngine.d.ts.map +1 -1
  45. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTree.d.ts +10 -0
  46. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTree.d.ts.map +1 -1
  47. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTreeHandler.d.ts +31 -0
  48. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTreeHandler.d.ts.map +1 -1
  49. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts +2 -2
  50. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts.map +1 -1
  51. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts +7 -0
  52. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts.map +1 -1
  53. package/build/types/web-planner-logic/src/logic/DivaCatalogHandler.d.ts +2 -0
  54. package/build/types/web-planner-logic/src/logic/DivaCatalogHandler.d.ts.map +1 -1
  55. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +22 -6
  56. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  57. package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/ConstructionRulesHandler.d.ts.map +1 -1
  58. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  59. package/build/types/web-planner-logic/src/model/Articles/Article/IDMCatalogArticle.d.ts +9 -2
  60. package/build/types/web-planner-logic/src/model/Articles/Article/IDMCatalogArticle.d.ts.map +1 -1
  61. package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts.map +1 -1
  62. package/build/types/web-planner-logic/src/model/Options/ArticleOptionValueData.d.ts.map +1 -1
  63. package/build/types/web-planner-logic/src/model/Properties/propertySchemaRegistry.d.ts +31 -0
  64. package/build/types/web-planner-logic/src/model/Properties/propertySchemaRegistry.d.ts.map +1 -0
  65. package/build/types/web-planner-logic/src/model/Properties/propertyValueCodec.d.ts +34 -0
  66. package/build/types/web-planner-logic/src/model/Properties/propertyValueCodec.d.ts.map +1 -0
  67. package/build/types/web-planner-logic/src/test/cloneArticle.test.d.ts +2 -0
  68. package/build/types/web-planner-logic/src/test/cloneArticle.test.d.ts.map +1 -0
  69. package/build/types/web-planner-logic/src/test/configTreeStepArticle.test.d.ts +2 -0
  70. package/build/types/web-planner-logic/src/test/configTreeStepArticle.test.d.ts.map +1 -0
  71. package/build/types/web-planner-logic/src/test/eanFormula.test.d.ts +2 -0
  72. package/build/types/web-planner-logic/src/test/eanFormula.test.d.ts.map +1 -0
  73. package/build/types/web-planner-logic/src/test/fallbackRowWarning.test.d.ts +2 -0
  74. package/build/types/web-planner-logic/src/test/fallbackRowWarning.test.d.ts.map +1 -0
  75. package/build/types/web-planner-logic/src/test/idmOpgParentNames.test.d.ts +2 -0
  76. package/build/types/web-planner-logic/src/test/idmOpgParentNames.test.d.ts.map +1 -0
  77. package/build/types/web-planner-logic/src/test/idmSerieStaleId.test.d.ts +2 -0
  78. package/build/types/web-planner-logic/src/test/idmSerieStaleId.test.d.ts.map +1 -0
  79. package/build/types/web-planner-logic/src/test/mergeOptionGroupConnectedSteps.test.d.ts +2 -0
  80. package/build/types/web-planner-logic/src/test/mergeOptionGroupConnectedSteps.test.d.ts.map +1 -0
  81. package/build/types/web-planner-logic/src/test/partlistChildInit.test.d.ts +2 -0
  82. package/build/types/web-planner-logic/src/test/partlistChildInit.test.d.ts.map +1 -0
  83. package/build/types/web-planner-logic/src/test/propertyEncodingsKnowhow.test.d.ts +2 -0
  84. package/build/types/web-planner-logic/src/test/propertyEncodingsKnowhow.test.d.ts.map +1 -0
  85. package/build/types/web-planner-logic/src/test/propertyValueCodec.test.d.ts +2 -0
  86. package/build/types/web-planner-logic/src/test/propertyValueCodec.test.d.ts.map +1 -0
  87. package/build/types/web-planner-logic/src/test/staticVisibleOptionValues.test.d.ts +2 -0
  88. package/build/types/web-planner-logic/src/test/staticVisibleOptionValues.test.d.ts.map +1 -0
  89. package/package.json +3 -3
@@ -285,6 +285,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
285
285
  data,
286
286
  _response$headers,
287
287
  _e$response,
288
+ _e$response2,
288
289
  _args = arguments;
289
290
  return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
290
291
  while (1) switch (_context.prev = _context.next) {
@@ -366,8 +367,11 @@ var DivaApiHandler = /*#__PURE__*/function () {
366
367
  _context.t5 = _context["catch"](6);
367
368
  // Check if this is a rate limiting error (429)
368
369
  this.notifyEnricherError(url, dontLogError);
369
- throw Error('fetch failed! ' + url + ' Error: ' + _context.t5, {
370
+ // The status rides along: callers that recover from ONE status (a stale id 404) cannot parse it back out of the message.
371
+ throw Object.assign(Error('fetch failed! ' + url + ' Error: ' + _context.t5, {
370
372
  cause: _context.t5 === null || _context.t5 === void 0 || (_e$response = _context.t5.response) === null || _e$response === void 0 || (_e$response = _e$response.data) === null || _e$response === void 0 ? void 0 : _e$response.error
373
+ }), {
374
+ status: _context.t5 === null || _context.t5 === void 0 || (_e$response2 = _context.t5.response) === null || _e$response2 === void 0 ? void 0 : _e$response2.status
371
375
  });
372
376
  case 43:
373
377
  _context.prev = 43;
@@ -394,6 +398,15 @@ var DivaApiHandler = /*#__PURE__*/function () {
394
398
  * feedback instead of a silently broken UI. Optional enricher calls (e.g. the catalog mask) pass
395
399
  * `dontLogError` and are skipped. Only one modal is shown at a time to avoid stacking on parallel failures.
396
400
  */
401
+ /**
402
+ * Same as the failure path of `getDataCache`, for a caller that fetched with `dontLogError` to recover from
403
+ * ONE status itself (a stale-id 404) and found the failure to be something else.
404
+ */
405
+ }, {
406
+ key: "notifyEnricherErrorForQuery",
407
+ value: function notifyEnricherErrorForQuery(queryString, useWebServiceApi) {
408
+ this.notifyEnricherError(this.apiUrl(queryString, useWebServiceApi));
409
+ }
397
410
  }, {
398
411
  key: "notifyEnricherError",
399
412
  value: function notifyEnricherError(url, dontLogError) {
@@ -1362,6 +1375,13 @@ var DivaApiHandler = /*#__PURE__*/function () {
1362
1375
  value: function getIDMSerieByNo(packageId, serieId, serieNo) {
1363
1376
  return this.idmPrefix + (this.isSeller ? '/packages/' : '/catalogs/') + packageId + '/series/' + (this.useIDMService ? serieId : serieNo);
1364
1377
  }
1378
+
1379
+ /** Series list of a catalog or package, trimmed to the ids a stale-serieId lookup needs. */
1380
+ }, {
1381
+ key: "getIDMSeriesList",
1382
+ value: function getIDMSeriesList(packageId) {
1383
+ return this.idmPrefix + (this.isSeller ? '/packages/' : '/catalogs/') + packageId + '/series?fields=_id;serieNo';
1384
+ }
1365
1385
  }, {
1366
1386
  key: "getIDMItems",
1367
1387
  value: function getIDMItems(packageId, serieId, serieNo, typeNos) {
@@ -1610,7 +1630,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1610
1630
  key: "createLeadKey",
1611
1631
  value: function () {
1612
1632
  var _createLeadKey = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee12(email) {
1613
- var url, headers, response, _e$response2, _e$response3, status, body, apiMessage;
1633
+ var url, headers, response, _e$response3, _e$response4, status, body, apiMessage;
1614
1634
  return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context12) {
1615
1635
  while (1) switch (_context12.prev = _context12.next) {
1616
1636
  case 0:
@@ -1629,8 +1649,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
1629
1649
  case 9:
1630
1650
  _context12.prev = 9;
1631
1651
  _context12.t0 = _context12["catch"](2);
1632
- status = _context12.t0 === null || _context12.t0 === void 0 || (_e$response2 = _context12.t0.response) === null || _e$response2 === void 0 ? void 0 : _e$response2.status;
1633
- body = _context12.t0 === null || _context12.t0 === void 0 || (_e$response3 = _context12.t0.response) === null || _e$response3 === void 0 ? void 0 : _e$response3.data;
1652
+ status = _context12.t0 === null || _context12.t0 === void 0 || (_e$response3 = _context12.t0.response) === null || _e$response3 === void 0 ? void 0 : _e$response3.status;
1653
+ body = _context12.t0 === null || _context12.t0 === void 0 || (_e$response4 = _context12.t0.response) === null || _e$response4 === void 0 ? void 0 : _e$response4.data;
1634
1654
  apiMessage = typeof (body === null || body === void 0 ? void 0 : body.error) === 'string' ? body.error : _context12.t0 === null || _context12.t0 === void 0 ? void 0 : _context12.t0.message;
1635
1655
  LOG$q.error(new Error("Failed to create lead key for email ".concat(email, ": ").concat(apiMessage)));
1636
1656
  throw new DivaUtils.DivaError(apiMessage || 'Failed to create lead key', {
@@ -18722,7 +18742,8 @@ var ArticleOptionValueData = /*#__PURE__*/function () {
18722
18742
  var _this$opv$catalogOPV$,
18723
18743
  _this = this;
18724
18744
  if (this.opv.propertyObj.isNotRelevant !== undefined) return this.opv.propertyObj.isNotRelevant;
18725
- return (_this$opv$catalogOPV$ = this.opv.catalogOPV.isNotRelevant) !== null && _this$opv$catalogOPV$ !== void 0 ? _this$opv$catalogOPV$ : ['OPV_NICHT_RELEVANT', 'OPV_NICHT_RELEVANT', 'OPVNR', 'OPVNRR', 'OPVNR_0'].find(function (codex) {
18745
+ // Legacy codices are OPV-prefixed; IDM optionKeys are bare — NICHT_RELEVANT is the standardized IDM key.
18746
+ return (_this$opv$catalogOPV$ = this.opv.catalogOPV.isNotRelevant) !== null && _this$opv$catalogOPV$ !== void 0 ? _this$opv$catalogOPV$ : ['NICHT_RELEVANT', 'OPVNR'].find(function (codex) {
18726
18747
  var _this$ocd;
18727
18748
  return ((_this$ocd = _this.ocd) !== null && _this$ocd !== void 0 ? _this$ocd : _this.codex).includes(codex);
18728
18749
  });
@@ -20062,7 +20083,14 @@ var LOG$l = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC'
20062
20083
  //a decision enabled by an action may itself enable further ones; the cap keeps a cyclic catalog from looping
20063
20084
  var MAX_DECISION_REFERENCE_ROUNDS = 5;
20064
20085
 
20065
- /** Loads the IDM data these articles need; missing price feature groups, features and decisions are reported, never fatal. */
20086
+ /**
20087
+ * Loads the IDM data these articles need; missing price feature groups, features and decisions are reported, never fatal.
20088
+ *
20089
+ * @param catalogData the catalog the articles BELONG to. Everything loaded here (items, decisions,
20090
+ * price feature groups, feature classes, features, options) is stored on AND read from this instance —
20091
+ * a partlist may load components from another serie (serie-0 component library), and those live in
20092
+ * their own catalog data. Defaults to the set's catalog, so same-serie articles behave unchanged.
20093
+ */
20066
20094
  function loadMoreFromIDMArticles(_x, _x2) {
20067
20095
  return _loadMoreFromIDMArticles.apply(this, arguments);
20068
20096
  }
@@ -20070,15 +20098,49 @@ function loadMoreFromIDMArticles(_x, _x2) {
20070
20098
  /** One additional-item reference of an item - the mandatory and optional sides of the same accessory merged. */
20071
20099
  function _loadMoreFromIDMArticles() {
20072
20100
  _loadMoreFromIDMArticles = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(catalogArticleDatas, set) {
20073
- var items, _loop3, i, toLoadDecisionIds, toLoadPFGroups, toLoadFeatureClassRefNo, promises, _yield$Promise$all, _yield$Promise$all2, featureClasses, priceFeatureGroups, decisions, _i5, _decisions$map, loadedIds, missingIds, _i6, _iterator6, _step6, _loop7, _i7, _catalogArticleData$d2, catalogArticleData, toLoadFeatures, features, _loop4, _i8, _iterator7, _step7, _loop8, _loop6, _i9;
20101
+ var catalogData,
20102
+ items,
20103
+ _loop3,
20104
+ i,
20105
+ toLoadDecisionIds,
20106
+ toLoadPFGroups,
20107
+ toLoadFeatureClassRefNo,
20108
+ promises,
20109
+ _yield$Promise$all,
20110
+ _yield$Promise$all2,
20111
+ featureClasses,
20112
+ priceFeatureGroups,
20113
+ decisions,
20114
+ _i5,
20115
+ _decisions$map,
20116
+ loadedIds,
20117
+ missingIds,
20118
+ _i6,
20119
+ _iterator6,
20120
+ _step6,
20121
+ _loop7,
20122
+ _i7,
20123
+ _catalogArticleData$d2,
20124
+ catalogArticleData,
20125
+ toLoadFeatures,
20126
+ features,
20127
+ _loop4,
20128
+ _i8,
20129
+ _iterator7,
20130
+ _step7,
20131
+ _loop8,
20132
+ _loop6,
20133
+ _i9,
20134
+ _args8 = arguments;
20074
20135
  return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context8) {
20075
20136
  while (1) switch (_context8.prev = _context8.next) {
20076
20137
  case 0:
20077
- _context8.next = 2;
20078
- return set.api.getDataCache(set.api.getIDMItems(set.CatalogData.accountGuid, set.CatalogData.serieId, set.CatalogData.catalogCodex, catalogArticleDatas.map(function (a) {
20138
+ catalogData = _args8.length > 2 && _args8[2] !== undefined ? _args8[2] : set.CatalogData;
20139
+ _context8.next = 3;
20140
+ return set.api.getDataCache(set.api.getIDMItems(catalogData.accountGuid, catalogData.serieId, catalogData.catalogCodex, catalogArticleDatas.map(function (a) {
20079
20141
  return a.articleCodex;
20080
20142
  })), undefined, undefined, 'enricher');
20081
- case 2:
20143
+ case 3:
20082
20144
  items = _context8.sent;
20083
20145
  _loop3 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop3() {
20084
20146
  var catalogArticleData, item;
@@ -20098,7 +20160,7 @@ function _loadMoreFromIDMArticles() {
20098
20160
  catalogArticleData.decisionsRefs = item.decisionRefs;
20099
20161
  catalogArticleData.idmPartlist = item.partlist;
20100
20162
  catalogArticleData.idmPrices = item.prices;
20101
- initIDMArticleRelations(item, catalogArticleData, set.CatalogData);
20163
+ initIDMArticleRelations(item, catalogArticleData, catalogData);
20102
20164
  case 8:
20103
20165
  case "end":
20104
20166
  return _context4.stop();
@@ -20106,28 +20168,28 @@ function _loadMoreFromIDMArticles() {
20106
20168
  }, _loop3);
20107
20169
  });
20108
20170
  i = 0;
20109
- case 5:
20171
+ case 6:
20110
20172
  if (!(i < catalogArticleDatas.length)) {
20111
- _context8.next = 10;
20173
+ _context8.next = 11;
20112
20174
  break;
20113
20175
  }
20114
- return _context8.delegateYield(_loop3(), "t0", 7);
20115
- case 7:
20176
+ return _context8.delegateYield(_loop3(), "t0", 8);
20177
+ case 8:
20116
20178
  i++;
20117
- _context8.next = 5;
20179
+ _context8.next = 6;
20118
20180
  break;
20119
- case 10:
20120
- toLoadDecisionIds = getToLoadDecisionIds(catalogArticleDatas, set);
20121
- toLoadPFGroups = getPriceFeatureGroups(catalogArticleDatas, set);
20181
+ case 11:
20182
+ toLoadDecisionIds = getToLoadDecisionIds(catalogArticleDatas, catalogData);
20183
+ toLoadPFGroups = getPriceFeatureGroups(catalogArticleDatas, catalogData);
20122
20184
  toLoadFeatureClassRefNo = _toConsumableArray__default["default"](new Set(catalogArticleDatas.filter(function (a) {
20123
20185
  return a.featureClassRefNo !== undefined;
20124
20186
  }).map(function (a) {
20125
20187
  return a.featureClassRefNo;
20126
20188
  })));
20127
- promises = [set.api.getDataCache(set.api.getIDMFeatureClass(set.CatalogData.accountGuid, toLoadFeatureClassRefNo), undefined, undefined, 'enricher'), toLoadPFGroups.length ? set.api.getDataCache(set.api.getIDMPriceFeatureGroups(set.CatalogData.accountGuid, toLoadPFGroups), undefined, undefined, 'enricher') : undefined, toLoadDecisionIds.length ? fetchDecisions(set, toLoadDecisionIds) : undefined];
20128
- _context8.next = 16;
20189
+ promises = [set.api.getDataCache(set.api.getIDMFeatureClass(catalogData.accountGuid, toLoadFeatureClassRefNo), undefined, undefined, 'enricher'), toLoadPFGroups.length ? set.api.getDataCache(set.api.getIDMPriceFeatureGroups(catalogData.accountGuid, toLoadPFGroups), undefined, undefined, 'enricher') : undefined, toLoadDecisionIds.length ? fetchDecisions(set, catalogData, toLoadDecisionIds) : undefined];
20190
+ _context8.next = 17;
20129
20191
  return Promise.all(promises);
20130
- case 16:
20192
+ case 17:
20131
20193
  _yield$Promise$all = _context8.sent;
20132
20194
  _yield$Promise$all2 = _slicedToArray__default["default"](_yield$Promise$all, 3);
20133
20195
  featureClasses = _yield$Promise$all2[0];
@@ -20135,11 +20197,11 @@ function _loadMoreFromIDMArticles() {
20135
20197
  decisions = _yield$Promise$all2[2];
20136
20198
  if (decisions) {
20137
20199
  for (_i5 = 0; _i5 < decisions.length; _i5++) {
20138
- set.CatalogData.loadedDecisions.push(initializeDecision(decisions[_i5], set.CatalogData.idmOptionGroups));
20200
+ catalogData.loadedDecisions.push(initializeDecision(decisions[_i5], catalogData.idmOptionGroups));
20139
20201
  }
20140
20202
  }
20141
20203
  if (!(toLoadDecisionIds.length !== 0 && toLoadDecisionIds.length != (decisions === null || decisions === void 0 ? void 0 : decisions.length))) {
20142
- _context8.next = 26;
20204
+ _context8.next = 27;
20143
20205
  break;
20144
20206
  }
20145
20207
  loadedIds = new Set((_decisions$map = decisions === null || decisions === void 0 ? void 0 : decisions.map(function (d) {
@@ -20149,17 +20211,17 @@ function _loadMoreFromIDMArticles() {
20149
20211
  return !loadedIds.has(id);
20150
20212
  });
20151
20213
  throw new Error("loading decisions failed \u2013 missing: [".concat(missingIds.join(', '), "]"));
20152
- case 26:
20153
- _context8.next = 28;
20154
- return loadDecisionsReferencedByActions(set);
20155
- case 28:
20214
+ case 27:
20215
+ _context8.next = 29;
20216
+ return loadDecisionsReferencedByActions(set, catalogData);
20217
+ case 29:
20156
20218
  if (priceFeatureGroups) {
20157
20219
  for (_i6 = 0; _i6 < priceFeatureGroups.length; _i6++) {
20158
- set.CatalogData.loadedPriceFeaturegroups.push(initializePriceFeatureGroups(priceFeatureGroups[_i6], set.CatalogData.idmOptionGroups));
20220
+ catalogData.loadedPriceFeaturegroups.push(initializePriceFeatureGroups(priceFeatureGroups[_i6], catalogData.idmOptionGroups));
20159
20221
  }
20160
20222
  }
20161
20223
  _iterator6 = _createForOfIteratorHelper$j(toLoadPFGroups);
20162
- _context8.prev = 30;
20224
+ _context8.prev = 31;
20163
20225
  _loop7 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop7() {
20164
20226
  var prfgNo, askedBy;
20165
20227
  return _regeneratorRuntime__default["default"].wrap(function _loop7$(_context5) {
@@ -20188,50 +20250,50 @@ function _loadMoreFromIDMArticles() {
20188
20250
  }, _loop7);
20189
20251
  });
20190
20252
  _iterator6.s();
20191
- case 33:
20253
+ case 34:
20192
20254
  if ((_step6 = _iterator6.n()).done) {
20193
- _context8.next = 39;
20255
+ _context8.next = 40;
20194
20256
  break;
20195
20257
  }
20196
- return _context8.delegateYield(_loop7(), "t1", 35);
20197
- case 35:
20258
+ return _context8.delegateYield(_loop7(), "t1", 36);
20259
+ case 36:
20198
20260
  if (!_context8.t1) {
20199
- _context8.next = 37;
20261
+ _context8.next = 38;
20200
20262
  break;
20201
20263
  }
20202
- return _context8.abrupt("continue", 37);
20203
- case 37:
20204
- _context8.next = 33;
20264
+ return _context8.abrupt("continue", 38);
20265
+ case 38:
20266
+ _context8.next = 34;
20205
20267
  break;
20206
- case 39:
20207
- _context8.next = 44;
20268
+ case 40:
20269
+ _context8.next = 45;
20208
20270
  break;
20209
- case 41:
20210
- _context8.prev = 41;
20211
- _context8.t2 = _context8["catch"](30);
20271
+ case 42:
20272
+ _context8.prev = 42;
20273
+ _context8.t2 = _context8["catch"](31);
20212
20274
  _iterator6.e(_context8.t2);
20213
- case 44:
20214
- _context8.prev = 44;
20275
+ case 45:
20276
+ _context8.prev = 45;
20215
20277
  _iterator6.f();
20216
- return _context8.finish(44);
20217
- case 47:
20278
+ return _context8.finish(45);
20279
+ case 48:
20218
20280
  for (_i7 = 0; _i7 < catalogArticleDatas.length; _i7++) {
20219
20281
  catalogArticleData = catalogArticleDatas[_i7];
20220
- catalogArticleData.articleIDMDecisions = sortDecisions(set.CatalogData.getDecisionsByNo(_toConsumableArray__default["default"](new Set([].concat(_toConsumableArray__default["default"](set.CatalogData.globalDecisions.map(function (g) {
20282
+ catalogArticleData.articleIDMDecisions = sortDecisions(catalogData.getDecisionsByNo(_toConsumableArray__default["default"](new Set([].concat(_toConsumableArray__default["default"](catalogData.globalDecisions.map(function (g) {
20221
20283
  return g.decisionNo;
20222
- })), _toConsumableArray__default["default"](set.CatalogData.serieDecisionRefs), _toConsumableArray__default["default"]((_catalogArticleData$d2 = catalogArticleData.decisionsRefs) !== null && _catalogArticleData$d2 !== void 0 ? _catalogArticleData$d2 : []))))));
20284
+ })), _toConsumableArray__default["default"](catalogData.serieDecisionRefs), _toConsumableArray__default["default"]((_catalogArticleData$d2 = catalogArticleData.decisionsRefs) !== null && _catalogArticleData$d2 !== void 0 ? _catalogArticleData$d2 : []))))));
20223
20285
  }
20224
20286
  featureClasses.map(function (fc) {
20225
- return set.CatalogData.loadedFeatureClasses.push(fc);
20287
+ return catalogData.loadedFeatureClasses.push(fc);
20226
20288
  });
20227
- toLoadFeatures = getFeatures(set, featureClasses);
20289
+ toLoadFeatures = getFeatures(catalogData, featureClasses);
20228
20290
  if (!toLoadFeatures.length) {
20229
- _context8.next = 61;
20291
+ _context8.next = 62;
20230
20292
  break;
20231
20293
  }
20232
- _context8.next = 53;
20233
- return set.api.getDataCache(set.api.getIDMFeatures(set.CatalogData.accountGuid, toLoadFeatures), undefined, undefined, 'enricher');
20234
- case 53:
20294
+ _context8.next = 54;
20295
+ return set.api.getDataCache(set.api.getIDMFeatures(catalogData.accountGuid, toLoadFeatures), undefined, undefined, 'enricher');
20296
+ case 54:
20235
20297
  features = _context8.sent;
20236
20298
  _loop4 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop4() {
20237
20299
  var feature, insertIndex, k, _loop5, j;
@@ -20239,14 +20301,14 @@ function _loadMoreFromIDMArticles() {
20239
20301
  while (1) switch (_context3.prev = _context3.next) {
20240
20302
  case 0:
20241
20303
  feature = features[_i8];
20242
- insertIndex = set.CatalogData.loadedFeatures.length;
20304
+ insertIndex = catalogData.loadedFeatures.length;
20243
20305
  k = 0;
20244
20306
  case 3:
20245
- if (!(k < set.CatalogData.loadedFeatures.length)) {
20307
+ if (!(k < catalogData.loadedFeatures.length)) {
20246
20308
  _context3.next = 10;
20247
20309
  break;
20248
20310
  }
20249
- if (!(set.CatalogData.loadedFeatures[k].sequenceNo > feature.sequenceNo)) {
20311
+ if (!(catalogData.loadedFeatures[k].sequenceNo > feature.sequenceNo)) {
20250
20312
  _context3.next = 7;
20251
20313
  break;
20252
20314
  }
@@ -20257,27 +20319,27 @@ function _loadMoreFromIDMArticles() {
20257
20319
  _context3.next = 3;
20258
20320
  break;
20259
20321
  case 10:
20260
- set.CatalogData.loadedFeatures.splice(insertIndex, 0, feature);
20322
+ catalogData.loadedFeatures.splice(insertIndex, 0, feature);
20261
20323
  _loop5 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop5(j) {
20262
20324
  var option, _insertIndex, _k;
20263
20325
  return _regeneratorRuntime__default["default"].wrap(function _loop5$(_context2) {
20264
20326
  while (1) switch (_context2.prev = _context2.next) {
20265
20327
  case 0:
20266
- if (set.CatalogData.loadedOptions.find(function (o) {
20328
+ if (catalogData.loadedOptions.find(function (o) {
20267
20329
  return o.optionKey == feature.options[j].optionKey;
20268
20330
  })) {
20269
20331
  _context2.next = 12;
20270
20332
  break;
20271
20333
  }
20272
20334
  option = feature.options[j];
20273
- _insertIndex = set.CatalogData.loadedOptions.length;
20335
+ _insertIndex = catalogData.loadedOptions.length;
20274
20336
  _k = 0;
20275
20337
  case 4:
20276
- if (!(_k < set.CatalogData.loadedOptions.length)) {
20338
+ if (!(_k < catalogData.loadedOptions.length)) {
20277
20339
  _context2.next = 11;
20278
20340
  break;
20279
20341
  }
20280
- if (!(set.CatalogData.loadedOptions[_k].sequenceNo > option.sequenceNo)) {
20342
+ if (!(catalogData.loadedOptions[_k].sequenceNo > option.sequenceNo)) {
20281
20343
  _context2.next = 8;
20282
20344
  break;
20283
20345
  }
@@ -20288,7 +20350,7 @@ function _loadMoreFromIDMArticles() {
20288
20350
  _context2.next = 4;
20289
20351
  break;
20290
20352
  case 11:
20291
- set.CatalogData.loadedOptions.splice(_insertIndex, 0, option);
20353
+ catalogData.loadedOptions.splice(_insertIndex, 0, option);
20292
20354
  case 12:
20293
20355
  case "end":
20294
20356
  return _context2.stop();
@@ -20313,19 +20375,19 @@ function _loadMoreFromIDMArticles() {
20313
20375
  }, _loop4);
20314
20376
  });
20315
20377
  _i8 = 0;
20316
- case 56:
20378
+ case 57:
20317
20379
  if (!(_i8 < features.length)) {
20318
- _context8.next = 61;
20380
+ _context8.next = 62;
20319
20381
  break;
20320
20382
  }
20321
- return _context8.delegateYield(_loop4(), "t3", 58);
20322
- case 58:
20383
+ return _context8.delegateYield(_loop4(), "t3", 59);
20384
+ case 59:
20323
20385
  _i8++;
20324
- _context8.next = 56;
20386
+ _context8.next = 57;
20325
20387
  break;
20326
- case 61:
20388
+ case 62:
20327
20389
  _iterator7 = _createForOfIteratorHelper$j(toLoadFeatures);
20328
- _context8.prev = 62;
20390
+ _context8.prev = 63;
20329
20391
  _loop8 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop8() {
20330
20392
  var featureNo, askedBy;
20331
20393
  return _regeneratorRuntime__default["default"].wrap(function _loop8$(_context6) {
@@ -20355,33 +20417,33 @@ function _loadMoreFromIDMArticles() {
20355
20417
  }, _loop8);
20356
20418
  });
20357
20419
  _iterator7.s();
20358
- case 65:
20420
+ case 66:
20359
20421
  if ((_step7 = _iterator7.n()).done) {
20360
- _context8.next = 71;
20422
+ _context8.next = 72;
20361
20423
  break;
20362
20424
  }
20363
- return _context8.delegateYield(_loop8(), "t4", 67);
20364
- case 67:
20425
+ return _context8.delegateYield(_loop8(), "t4", 68);
20426
+ case 68:
20365
20427
  if (!_context8.t4) {
20366
- _context8.next = 69;
20428
+ _context8.next = 70;
20367
20429
  break;
20368
20430
  }
20369
- return _context8.abrupt("continue", 69);
20370
- case 69:
20371
- _context8.next = 65;
20431
+ return _context8.abrupt("continue", 70);
20432
+ case 70:
20433
+ _context8.next = 66;
20372
20434
  break;
20373
- case 71:
20374
- _context8.next = 76;
20435
+ case 72:
20436
+ _context8.next = 77;
20375
20437
  break;
20376
- case 73:
20377
- _context8.prev = 73;
20378
- _context8.t5 = _context8["catch"](62);
20438
+ case 74:
20439
+ _context8.prev = 74;
20440
+ _context8.t5 = _context8["catch"](63);
20379
20441
  _iterator7.e(_context8.t5);
20380
- case 76:
20381
- _context8.prev = 76;
20442
+ case 77:
20443
+ _context8.prev = 77;
20382
20444
  _iterator7.f();
20383
- return _context8.finish(76);
20384
- case 79:
20445
+ return _context8.finish(77);
20446
+ case 80:
20385
20447
  _loop6 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop6() {
20386
20448
  var catalogArticleData, featureClass, features, j;
20387
20449
  return _regeneratorRuntime__default["default"].wrap(function _loop6$(_context7) {
@@ -20397,9 +20459,9 @@ function _loadMoreFromIDMArticles() {
20397
20459
  }
20398
20460
  throw new Error('featureClassRefNo ' + catalogArticleData.featureClassRefNo + ' not found');
20399
20461
  case 4:
20400
- features = set.CatalogData.getFeatures(getFeaturesByFeatureClass(featureClass));
20462
+ features = catalogData.getFeatures(getFeaturesByFeatureClass(featureClass));
20401
20463
  for (j = 0; j < features.length; j++) {
20402
- initFeature(features[j], catalogArticleData, set);
20464
+ initFeature(features[j], catalogArticleData, set, catalogData);
20403
20465
  }
20404
20466
  case 6:
20405
20467
  case "end":
@@ -20408,25 +20470,25 @@ function _loadMoreFromIDMArticles() {
20408
20470
  }, _loop6);
20409
20471
  });
20410
20472
  _i9 = 0;
20411
- case 81:
20473
+ case 82:
20412
20474
  if (!(_i9 < catalogArticleDatas.length)) {
20413
- _context8.next = 86;
20475
+ _context8.next = 87;
20414
20476
  break;
20415
20477
  }
20416
- return _context8.delegateYield(_loop6(), "t6", 83);
20417
- case 83:
20478
+ return _context8.delegateYield(_loop6(), "t6", 84);
20479
+ case 84:
20418
20480
  _i9++;
20419
- _context8.next = 81;
20481
+ _context8.next = 82;
20420
20482
  break;
20421
- case 86:
20483
+ case 87:
20422
20484
  catalogArticleDatas.map(function (c) {
20423
20485
  return c.areOptionsLoaded = true;
20424
20486
  });
20425
- case 87:
20487
+ case 88:
20426
20488
  case "end":
20427
20489
  return _context8.stop();
20428
20490
  }
20429
- }, _callee2, null, [[30, 41, 44, 47], [62, 73, 76, 79]]);
20491
+ }, _callee2, null, [[31, 42, 45, 48], [63, 74, 77, 80]]);
20430
20492
  }));
20431
20493
  return _loadMoreFromIDMArticles.apply(this, arguments);
20432
20494
  }
@@ -20549,10 +20611,12 @@ function initIDMArticleRelations(item, catalogArticleData, catalog) {
20549
20611
  }
20550
20612
  catalogArticle.hasArticleRelations = catalogArticle.articleRelations.length > 0;
20551
20613
  }
20552
- var fetchDecisions = function fetchDecisions(set, decisionNos) {
20553
- var getUrl = set.api.getIDMDecisions(set.CatalogData.accountGuid, decisionNos);
20614
+
20615
+ /** Load IDM decisions by number; a list too long for one GET url goes through the POST query endpoint. */
20616
+ var fetchDecisions = function fetchDecisions(set, catalogData, decisionNos) {
20617
+ var getUrl = set.api.getIDMDecisions(catalogData.accountGuid, decisionNos);
20554
20618
  if (getUrl.length > 2000) {
20555
- return set.api.getDataCache(set.api.getIDMDecisionsQueryUrl(set.CatalogData.accountGuid), undefined, undefined, 'enricher', 'POST', {
20619
+ return set.api.getDataCache(set.api.getIDMDecisionsQueryUrl(catalogData.accountGuid), undefined, undefined, 'enricher', 'POST', {
20556
20620
  decisionNos: decisionNos.join(';')
20557
20621
  });
20558
20622
  }
@@ -20567,7 +20631,7 @@ var fetchDecisions = function fetchDecisions(set, decisionNos) {
20567
20631
  * apply while that action matches. References are followed transitively.
20568
20632
  */
20569
20633
  var loadDecisionsReferencedByActions = /*#__PURE__*/function () {
20570
- var _ref3 = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(set) {
20634
+ var _ref3 = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(set, catalogData) {
20571
20635
  var round, toLoad, _iterator3, _step3, _decision$optionCombi, decision, _iterator4, _step4, _combination$projectA, _combination$projectA2, _combination$projectA3, _combination$projectA4, combination, refs, _iterator5, _step5, ref, decisionNo, decisions, i, _decisions$length, stillMissing;
20572
20636
  return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
20573
20637
  while (1) switch (_context.prev = _context.next) {
@@ -20579,7 +20643,7 @@ var loadDecisionsReferencedByActions = /*#__PURE__*/function () {
20579
20643
  break;
20580
20644
  }
20581
20645
  toLoad = new Set();
20582
- _iterator3 = _createForOfIteratorHelper$j(set.CatalogData.loadedDecisions);
20646
+ _iterator3 = _createForOfIteratorHelper$j(catalogData.loadedDecisions);
20583
20647
  try {
20584
20648
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
20585
20649
  decision = _step3.value;
@@ -20593,7 +20657,7 @@ var loadDecisionsReferencedByActions = /*#__PURE__*/function () {
20593
20657
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
20594
20658
  ref = _step5.value;
20595
20659
  decisionNo = Number(ref.decisionNo);
20596
- if (!isNaN(decisionNo) && !set.CatalogData.getDecisionByNo(decisionNo)) toLoad.add(decisionNo);
20660
+ if (!isNaN(decisionNo) && !catalogData.getDecisionByNo(decisionNo)) toLoad.add(decisionNo);
20597
20661
  }
20598
20662
  } catch (err) {
20599
20663
  _iterator5.e(err);
@@ -20619,14 +20683,14 @@ var loadDecisionsReferencedByActions = /*#__PURE__*/function () {
20619
20683
  return _context.abrupt("return");
20620
20684
  case 7:
20621
20685
  _context.next = 9;
20622
- return fetchDecisions(set, _toConsumableArray__default["default"](toLoad));
20686
+ return fetchDecisions(set, catalogData, _toConsumableArray__default["default"](toLoad));
20623
20687
  case 9:
20624
20688
  decisions = _context.sent;
20625
20689
  for (i = 0; i < ((_decisions$length = decisions === null || decisions === void 0 ? void 0 : decisions.length) !== null && _decisions$length !== void 0 ? _decisions$length : 0); i++) {
20626
- set.CatalogData.loadedDecisions.push(initializeDecision(decisions[i], set.CatalogData.idmOptionGroups));
20690
+ catalogData.loadedDecisions.push(initializeDecision(decisions[i], catalogData.idmOptionGroups));
20627
20691
  }
20628
20692
  stillMissing = _toConsumableArray__default["default"](toLoad).filter(function (decisionNo) {
20629
- return !set.CatalogData.getDecisionByNo(decisionNo);
20693
+ return !catalogData.getDecisionByNo(decisionNo);
20630
20694
  });
20631
20695
  if (!stillMissing.length) {
20632
20696
  _context.next = 15;
@@ -20645,11 +20709,13 @@ var loadDecisionsReferencedByActions = /*#__PURE__*/function () {
20645
20709
  }
20646
20710
  }, _callee);
20647
20711
  }));
20648
- return function loadDecisionsReferencedByActions(_x3) {
20712
+ return function loadDecisionsReferencedByActions(_x3, _x4) {
20649
20713
  return _ref3.apply(this, arguments);
20650
20714
  };
20651
20715
  }();
20652
- var getToLoadDecisionIds = function getToLoadDecisionIds(catalogArticleDatas, set) {
20716
+
20717
+ /** Decision numbers the articles, their media items, the serie and the globals reference that the catalog has not loaded yet. */
20718
+ var getToLoadDecisionIds = function getToLoadDecisionIds(catalogArticleDatas, catalogData) {
20653
20719
  var allArticleDecisions = [];
20654
20720
  for (var i = 0; i < catalogArticleDatas.length; i++) {
20655
20721
  var _catalogArticleData$s, _catalogArticleData$s2, _catalogArticleData$i, _catalogArticleData$i2, _catalogArticleData$i3, _catalogArticleData$d;
@@ -20663,26 +20729,28 @@ var getToLoadDecisionIds = function getToLoadDecisionIds(catalogArticleDatas, se
20663
20729
  })) !== null && _catalogArticleData$i !== void 0 ? _catalogArticleData$i : []));
20664
20730
  allArticleDecisions = [].concat(_toConsumableArray__default["default"](allArticleDecisions), _toConsumableArray__default["default"]((_catalogArticleData$i3 = catalogArticleData.idmPartlistDecisions) !== null && _catalogArticleData$i3 !== void 0 ? _catalogArticleData$i3 : []), _toConsumableArray__default["default"]((_catalogArticleData$d = catalogArticleData.decisionsRefs) !== null && _catalogArticleData$d !== void 0 ? _catalogArticleData$d : []), _toConsumableArray__default["default"](decisionsOfMediaItems));
20665
20731
  }
20666
- var neededDecisionsIds = _toConsumableArray__default["default"](new Set([].concat(_toConsumableArray__default["default"](set.CatalogData.globalDecisions.map(function (g) {
20732
+ var neededDecisionsIds = _toConsumableArray__default["default"](new Set([].concat(_toConsumableArray__default["default"](catalogData.globalDecisions.map(function (g) {
20667
20733
  return g.decisionNo;
20668
- })), _toConsumableArray__default["default"](set.CatalogData.serieDecisionRefs), _toConsumableArray__default["default"](allArticleDecisions))));
20734
+ })), _toConsumableArray__default["default"](catalogData.serieDecisionRefs), _toConsumableArray__default["default"](allArticleDecisions))));
20669
20735
  var toLoadDecisionIds = [];
20670
20736
  for (var _i2 = 0; _i2 < neededDecisionsIds.length; _i2++) {
20671
- var found = set.CatalogData.getDecisionByNo(neededDecisionsIds[_i2]);
20737
+ var found = catalogData.getDecisionByNo(neededDecisionsIds[_i2]);
20672
20738
  if (found) ; else {
20673
20739
  toLoadDecisionIds.push(neededDecisionsIds[_i2]);
20674
20740
  }
20675
20741
  }
20676
20742
  return toLoadDecisionIds;
20677
20743
  };
20678
- var getFeatures = function getFeatures(set, featureClasses) {
20744
+
20745
+ /** Feature numbers the feature classes reference that the catalog has not loaded yet. */
20746
+ var getFeatures = function getFeatures(catalogData, featureClasses) {
20679
20747
  var neededFeatures = [];
20680
20748
  for (var i = 0; i < featureClasses.length; i++) {
20681
20749
  var featureClass = featureClasses[i];
20682
20750
  neededFeatures = [].concat(_toConsumableArray__default["default"](neededFeatures), _toConsumableArray__default["default"](getFeaturesByFeatureClass(featureClass)));
20683
20751
  }
20684
20752
  neededFeatures = _toConsumableArray__default["default"](new Set(neededFeatures)); // remove duplicates
20685
- var alreadyLoadedFeatures = set.CatalogData.loadedFeatures;
20753
+ var alreadyLoadedFeatures = catalogData.loadedFeatures;
20686
20754
  var toLoadFeatures = [];
20687
20755
  var loadedFeatures = [];
20688
20756
  var _loop = function _loop(_i3) {
@@ -20710,7 +20778,9 @@ var getFeaturesByFeatureClass = function getFeaturesByFeatureClass(featureClass)
20710
20778
  }
20711
20779
  return neededFeatures;
20712
20780
  };
20713
- var getPriceFeatureGroups = function getPriceFeatureGroups(catalogArticleDatas, set) {
20781
+
20782
+ /** Price feature group numbers the articles reference that the catalog has not loaded yet. */
20783
+ var getPriceFeatureGroups = function getPriceFeatureGroups(catalogArticleDatas, catalogData) {
20714
20784
  var neededPriceFeatureGroupNos = [];
20715
20785
  for (var i = 0; i < catalogArticleDatas.length; i++) {
20716
20786
  var _catalogArticleDatas$;
@@ -20719,7 +20789,7 @@ var getPriceFeatureGroups = function getPriceFeatureGroups(catalogArticleDatas,
20719
20789
  var toLoadPriceFeatureGroups = [];
20720
20790
  neededPriceFeatureGroupNos = _toConsumableArray__default["default"](new Set(neededPriceFeatureGroupNos));
20721
20791
  for (var _i4 = 0; _i4 < neededPriceFeatureGroupNos.length; _i4++) {
20722
- var found = set.CatalogData.getPricefeaturegroup(neededPriceFeatureGroupNos[_i4]);
20792
+ var found = catalogData.getPricefeaturegroup(neededPriceFeatureGroupNos[_i4]);
20723
20793
  if (found) ; else {
20724
20794
  toLoadPriceFeatureGroups.push(neededPriceFeatureGroupNos[_i4]);
20725
20795
  }
@@ -20823,21 +20893,25 @@ var sortDecisions = function sortDecisions(decisions) {
20823
20893
  }
20824
20894
  return sortedDecisions;
20825
20895
  };
20826
- var initFeature = function initFeature(feature, catalogArticleData, set) {
20827
- var catFeature = set.CatalogData.getOption(feature.featureNo);
20896
+
20897
+ /** Register the feature once as a catalog option and attach it to the article as an article option. */
20898
+ var initFeature = function initFeature(feature, catalogArticleData, set, catalogData) {
20899
+ var catFeature = catalogData.getOption(feature.featureNo);
20828
20900
  if (!catFeature) {
20829
- catFeature = new OptionCatalogData(getCatalogFeatureType(feature, catalogArticleData, set), set.CatalogData);
20830
- set.CatalogData.setOption(catFeature);
20901
+ catFeature = new OptionCatalogData(getCatalogFeatureType(feature, catalogArticleData, set, catalogData), catalogData);
20902
+ catalogData.setOption(catFeature);
20831
20903
  }
20832
- var newArticleFeature = new ArticleOptionData(getArticleFeatureType(feature, catalogArticleData, catFeature, set), set.CatalogData);
20833
- initOption(feature, newArticleFeature, catalogArticleData, set);
20904
+ var newArticleFeature = new ArticleOptionData(getArticleFeatureType(feature, catalogArticleData, catFeature, set, catalogData), catalogData);
20905
+ initOption(feature, newArticleFeature, catalogArticleData, set, catalogData);
20834
20906
  catalogArticleData.articleOptions[newArticleFeature.codex] = newArticleFeature;
20835
20907
  };
20836
- function getCatalogFeatureType(feature, catalogArticleData, set) {
20837
- var _set$CatalogData$cata, _set$CatalogData$cata2, _set$CatalogData$cata3, _feature$detailInfos, _optionMask$hidden;
20838
- var featureClass = set.CatalogData.getFeatureClass(catalogArticleData.featureClassRefNo);
20839
- var optionMask = (_set$CatalogData$cata = set.CatalogData.catalogMask) === null || _set$CatalogData$cata === void 0 || (_set$CatalogData$cata = _set$CatalogData$cata.options) === null || _set$CatalogData$cata === void 0 ? void 0 : _set$CatalogData$cata[feature.featureNo];
20840
- var maskProperties = getPropertiesForFeatureNo((_set$CatalogData$cata2 = (_set$CatalogData$cata3 = set.CatalogData.catalogMask) === null || _set$CatalogData$cata3 === void 0 ? void 0 : _set$CatalogData$cata3.properties) !== null && _set$CatalogData$cata2 !== void 0 ? _set$CatalogData$cata2 : [], undefined, feature.featureNo, set.CatalogData.api.getLanguage());
20908
+
20909
+ /** Catalog-level option data of an IDM feature: localized texts plus the feature's and the mask's properties. */
20910
+ function getCatalogFeatureType(feature, catalogArticleData, set, catalogData) {
20911
+ var _catalogData$catalogM, _catalogData$catalogM2, _catalogData$catalogM3, _feature$detailInfos, _optionMask$hidden;
20912
+ var featureClass = catalogData.getFeatureClass(catalogArticleData.featureClassRefNo);
20913
+ var optionMask = (_catalogData$catalogM = catalogData.catalogMask) === null || _catalogData$catalogM === void 0 || (_catalogData$catalogM = _catalogData$catalogM.options) === null || _catalogData$catalogM === void 0 ? void 0 : _catalogData$catalogM[feature.featureNo];
20914
+ var maskProperties = getPropertiesForFeatureNo((_catalogData$catalogM2 = (_catalogData$catalogM3 = catalogData.catalogMask) === null || _catalogData$catalogM3 === void 0 ? void 0 : _catalogData$catalogM3.properties) !== null && _catalogData$catalogM2 !== void 0 ? _catalogData$catalogM2 : [], undefined, feature.featureNo, catalogData.api.getLanguage());
20841
20915
  var properties = [].concat(_toConsumableArray__default["default"](convertProperties(feature.properties, set.api.getLanguageLowercase())), _toConsumableArray__default["default"](maskProperties !== null && maskProperties !== void 0 ? maskProperties : []));
20842
20916
  return {
20843
20917
  name: DivaUtils__default["default"].getLocals(feature.featureText, set.api.getLanguageLowercase()),
@@ -20859,16 +20933,16 @@ function getCatalogFeatureType(feature, catalogArticleData, set) {
20859
20933
  propertyObj: {}
20860
20934
  };
20861
20935
  }
20862
- function getArticleFeatureType(feature, catalogArticleData, catOPT, set) {
20863
- var _catalogArticleData$f, _catalogArticleData$f2, _set$CatalogData$tabG, _set$CatalogData$cata4, _set$CatalogData$cata5;
20936
+ function getArticleFeatureType(feature, catalogArticleData, catOPT, set, catalogData) {
20937
+ var _catalogArticleData$f, _catalogArticleData$f2, _catalogData$tabGroup, _catalogData$catalogM4, _catalogData$catalogM5;
20864
20938
  var props = (_catalogArticleData$f = (_catalogArticleData$f2 = catalogArticleData.featureProperties) === null || _catalogArticleData$f2 === void 0 ? void 0 : _catalogArticleData$f2.filter(function (p) {
20865
20939
  return p.FeatureNos.includes(feature.featureNo);
20866
20940
  })) !== null && _catalogArticleData$f !== void 0 ? _catalogArticleData$f : [];
20867
- var featureClass = set.CatalogData.getFeatureClass(catalogArticleData.featureClassRefNo);
20868
- var tabgroup = (_set$CatalogData$tabG = set.CatalogData.tabGroups) === null || _set$CatalogData$tabG === void 0 ? void 0 : _set$CatalogData$tabG.find(function (t) {
20941
+ var featureClass = catalogData.getFeatureClass(catalogArticleData.featureClassRefNo);
20942
+ var tabgroup = (_catalogData$tabGroup = catalogData.tabGroups) === null || _catalogData$tabGroup === void 0 ? void 0 : _catalogData$tabGroup.find(function (t) {
20869
20943
  return t.featureNos.includes(feature.featureNo);
20870
20944
  });
20871
- var maskProperties = getPropertiesForFeatureNo((_set$CatalogData$cata4 = (_set$CatalogData$cata5 = set.CatalogData.catalogMask) === null || _set$CatalogData$cata5 === void 0 ? void 0 : _set$CatalogData$cata5.properties) !== null && _set$CatalogData$cata4 !== void 0 ? _set$CatalogData$cata4 : [], catalogArticleData.articleCodex, feature.featureNo, set.CatalogData.api.getLanguage());
20945
+ var maskProperties = getPropertiesForFeatureNo((_catalogData$catalogM4 = (_catalogData$catalogM5 = catalogData.catalogMask) === null || _catalogData$catalogM5 === void 0 ? void 0 : _catalogData$catalogM5.properties) !== null && _catalogData$catalogM4 !== void 0 ? _catalogData$catalogM4 : [], catalogArticleData.articleCodex, feature.featureNo, catalogData.api.getLanguage());
20872
20946
  var opt = {
20873
20947
  codex: feature.featureNo,
20874
20948
  catalogOPT: catOPT,
@@ -20886,17 +20960,17 @@ function getArticleFeatureType(feature, catalogArticleData, catOPT, set) {
20886
20960
  }
20887
20961
 
20888
20962
  //option in IDM language so in Diva World its OptionValue
20889
- function initOption(feature, articleFeature, catalogArticle, set) {
20963
+ function initOption(feature, articleFeature, catalogArticle, set, catalogData) {
20890
20964
  var options = feature.options;
20891
20965
  var allOptionsOfFeature = new Map();
20892
20966
  //Items initalisieren
20893
20967
  var _loop2 = function _loop2() {
20894
20968
  var option = options[j];
20895
- var catOption = set.CatalogData.getOptionValues().find(function (o) {
20969
+ var catOption = catalogData.getOptionValues().find(function (o) {
20896
20970
  return o.codex == option.optionKey;
20897
20971
  });
20898
- if (!catOption) catOption = getCatalogOptionType(option, set);
20899
- var articleIDMOption = new ArticleOptionValueData(getArticleOption(set, option, catOption, articleFeature, catalogArticle), set.CatalogData);
20972
+ if (!catOption) catOption = getCatalogOptionType(option, set, catalogData);
20973
+ var articleIDMOption = new ArticleOptionValueData(getArticleOption(set, option, catOption, articleFeature, catalogArticle, catalogData), catalogData);
20900
20974
  allOptionsOfFeature.set(articleIDMOption.codex, articleIDMOption);
20901
20975
  };
20902
20976
  for (var j = 0; j < options.length; j++) {
@@ -20905,12 +20979,13 @@ function initOption(feature, articleFeature, catalogArticle, set) {
20905
20979
  articleFeature.initOPVsInOPT(allOptionsOfFeature);
20906
20980
  catalogArticle.articleOptions[articleFeature.codex];
20907
20981
  }
20908
- function getCatalogOptionType(option, set) {
20909
- var _catalogData$catalogM, _catalogData$catalogM2, _option$detailInfos, _option$detailInfos2, _option$measureValue;
20910
- var catalogData = set.CatalogData;
20982
+
20983
+ /** Catalog-level option-value data of an IDM option: localized texts, properties from option and mask, media. */
20984
+ function getCatalogOptionType(option, set, catalogData) {
20985
+ var _catalogData$catalogM6, _catalogData$catalogM7, _option$detailInfos, _option$detailInfos2, _option$measureValue;
20911
20986
  var name = DivaUtils__default["default"].getLocals(option.optionText, set.api.getLanguageLowercase());
20912
- var maskProperties = getPropertiesForOptionKey((_catalogData$catalogM = (_catalogData$catalogM2 = catalogData.catalogMask) === null || _catalogData$catalogM2 === void 0 ? void 0 : _catalogData$catalogM2.properties) !== null && _catalogData$catalogM !== void 0 ? _catalogData$catalogM : [], undefined, option.optionKey, set.CatalogData.api.getLanguage());
20913
- var properties = [].concat(_toConsumableArray__default["default"](convertProperties(option.properties, set.CatalogData.api.getLanguageLowercase())), _toConsumableArray__default["default"](maskProperties !== null && maskProperties !== void 0 ? maskProperties : []));
20987
+ var maskProperties = getPropertiesForOptionKey((_catalogData$catalogM6 = (_catalogData$catalogM7 = catalogData.catalogMask) === null || _catalogData$catalogM7 === void 0 ? void 0 : _catalogData$catalogM7.properties) !== null && _catalogData$catalogM6 !== void 0 ? _catalogData$catalogM6 : [], undefined, option.optionKey, catalogData.api.getLanguage());
20988
+ var properties = [].concat(_toConsumableArray__default["default"](convertProperties(option.properties, catalogData.api.getLanguageLowercase())), _toConsumableArray__default["default"](maskProperties !== null && maskProperties !== void 0 ? maskProperties : []));
20914
20989
  var opiton = {
20915
20990
  codex: option.optionKey,
20916
20991
  name: name,
@@ -20980,12 +21055,12 @@ function getCatalogOptionType(option, set) {
20980
21055
  }
20981
21056
  return new OptionValueCatalogData(opiton, catalogData);
20982
21057
  }
20983
- function getArticleOption(set, option, catalogOption, feature, catalogArticleData) {
20984
- var _catalogArticleData$o, _set$CatalogData$cata6, _set$CatalogData$cata7;
21058
+ function getArticleOption(set, option, catalogOption, feature, catalogArticleData, catalogData) {
21059
+ var _catalogArticleData$o, _catalogData$catalogM8, _catalogData$catalogM9;
20985
21060
  var props = (_catalogArticleData$o = catalogArticleData.optionProperties) === null || _catalogArticleData$o === void 0 ? void 0 : _catalogArticleData$o.filter(function (p) {
20986
21061
  return p.OptionKeys.includes(option.optionKey);
20987
21062
  });
20988
- var maskProperties = getPropertiesForOptionKey((_set$CatalogData$cata6 = (_set$CatalogData$cata7 = set.CatalogData.catalogMask) === null || _set$CatalogData$cata7 === void 0 ? void 0 : _set$CatalogData$cata7.properties) !== null && _set$CatalogData$cata6 !== void 0 ? _set$CatalogData$cata6 : [], undefined, option.optionKey, set.api.getLanguage());
21063
+ var maskProperties = getPropertiesForOptionKey((_catalogData$catalogM8 = (_catalogData$catalogM9 = catalogData.catalogMask) === null || _catalogData$catalogM9 === void 0 ? void 0 : _catalogData$catalogM9.properties) !== null && _catalogData$catalogM8 !== void 0 ? _catalogData$catalogM8 : [], undefined, option.optionKey, set.api.getLanguage());
20989
21064
  //TODO add these props that are articleSpecific
20990
21065
  var opv = {
20991
21066
  codex: option.optionKey,
@@ -21599,7 +21674,7 @@ var DivaCatalogData = /*#__PURE__*/function () {
21599
21674
  break;
21600
21675
  }
21601
21676
  _context.next = 3;
21602
- return loadMoreFromIDMArticles(catalogArticles, set);
21677
+ return loadMoreFromIDMArticles(catalogArticles, set, this);
21603
21678
  case 3:
21604
21679
  _context.next = 9;
21605
21680
  break;
@@ -23117,7 +23192,12 @@ var DivaCatalogData = /*#__PURE__*/function () {
23117
23192
  }, {
23118
23193
  key: "checkIfArticleCodexExists",
23119
23194
  value: function checkIfArticleCodexExists(articleCodex) {
23120
- return !!this.catalogArticles[articleCodex];
23195
+ if (this.catalogArticles[articleCodex]) return true;
23196
+ // same resolution as getCatalogArticleByArticleCodex, but without logging WC_0006
23197
+ if (this.isIDMFormat) return Object.values(this.catalogArticles).some(function (a) {
23198
+ return a.configArticleCodex === articleCodex;
23199
+ });
23200
+ return false;
23121
23201
  }
23122
23202
  }, {
23123
23203
  key: "getCatalogArticleByArticleCodex",
@@ -23430,35 +23510,67 @@ var DivaCatalogHandler = /*#__PURE__*/function () {
23430
23510
  key: "loadIDMCatalog",
23431
23511
  value: function () {
23432
23512
  var _loadIDMCatalog = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(state, serieNo, serieId, accountId, orderSet) {
23433
- var promises, _yield$Promise$all3, _yield$Promise$all4, catalogApiData, serieData, itemsList, catalogData;
23513
+ var staleSafe, promises, _yield$Promise$all3, _yield$Promise$all4, catalogApiData, serieData, itemsList, resolvedSerieId, _yield$Promise$all5, _yield$Promise$all6, catalogData;
23434
23514
  return _regeneratorRuntime__default["default"].wrap(function _callee4$(_context4) {
23435
23515
  while (1) switch (_context4.prev = _context4.next) {
23436
23516
  case 0:
23437
- promises = [state.api.getDataCache(state.api.getIDMCatalog(accountId), undefined, undefined, 'enricher'), state.api.getDataCache(state.api.getIDMSerieByNo(accountId, serieId, serieNo), undefined, undefined, 'enricher'), state.api.getDataCache(state.api.getIDMItems(accountId, serieId, serieNo), undefined, undefined, 'enricher')
23517
+ // A stale serieId 404s these fetches (fetchData THROWS) — swallow ONLY that, so the re-resolve below gets its
23518
+ // chance; every other failure (500, timeout, auth) stays an error instead of passing as 'serie not found', and
23519
+ // still surfaces the enricher error modal that `dontLogError` skipped for the 404's sake.
23520
+ staleSafe = function staleSafe(queryString) {
23521
+ return state.api.useIDMService ? state.api.getDataCache(queryString, undefined, undefined, 'enricher', undefined, undefined, true)["catch"](function (error) {
23522
+ if ((error === null || error === void 0 ? void 0 : error.status) === 404) return undefined;
23523
+ state.api.notifyEnricherErrorForQuery(queryString, 'enricher');
23524
+ throw error;
23525
+ }) : state.api.getDataCache(queryString, undefined, undefined, 'enricher');
23526
+ };
23527
+ promises = [state.api.getDataCache(state.api.getIDMCatalog(accountId), undefined, undefined, 'enricher'), staleSafe(state.api.getIDMSerieByNo(accountId, serieId, serieNo)), staleSafe(state.api.getIDMItems(accountId, serieId, serieNo))
23438
23528
  //!state.api.dontLoadAdditionalModelInfos ? this.getAdditionalModeInfos(state, serieId, accountId) : undefined,
23439
23529
  ];
23440
- _context4.next = 3;
23530
+ _context4.next = 4;
23441
23531
  return Promise.all(promises);
23442
- case 3:
23532
+ case 4:
23443
23533
  _yield$Promise$all3 = _context4.sent;
23444
23534
  _yield$Promise$all4 = _slicedToArray__default["default"](_yield$Promise$all3, 3);
23445
23535
  catalogApiData = _yield$Promise$all4[0];
23446
23536
  serieData = _yield$Promise$all4[1];
23447
23537
  itemsList /*additionalModelInfos*/ = _yield$Promise$all4[2];
23538
+ if (!(state.api.useIDMService && (!serieData || !itemsList || "".concat(serieData.serieNo) !== "".concat(serieNo)))) {
23539
+ _context4.next = 21;
23540
+ break;
23541
+ }
23542
+ _context4.next = 12;
23543
+ return this.resolveIDMSerieIdByNo(state, accountId, serieNo);
23544
+ case 12:
23545
+ resolvedSerieId = _context4.sent;
23546
+ if (resolvedSerieId) {
23547
+ _context4.next = 15;
23548
+ break;
23549
+ }
23550
+ throw new Error('Serie not found: ' + serieNo);
23551
+ case 15:
23552
+ _context4.next = 17;
23553
+ return Promise.all([state.api.getDataCache(state.api.getIDMSerieByNo(accountId, resolvedSerieId, serieNo), undefined, undefined, 'enricher'), state.api.getDataCache(state.api.getIDMItems(accountId, resolvedSerieId, serieNo), undefined, undefined, 'enricher')]);
23554
+ case 17:
23555
+ _yield$Promise$all5 = _context4.sent;
23556
+ _yield$Promise$all6 = _slicedToArray__default["default"](_yield$Promise$all5, 2);
23557
+ serieData = _yield$Promise$all6[0];
23558
+ itemsList = _yield$Promise$all6[1];
23559
+ case 21:
23448
23560
  if (serieData) {
23449
- _context4.next = 10;
23561
+ _context4.next = 23;
23450
23562
  break;
23451
23563
  }
23452
23564
  throw new Error('Serie not found: ' + serieNo);
23453
- case 10:
23565
+ case 23:
23454
23566
  catalogData = new DivaCatalogData(_objectSpread$m(_objectSpread$m({}, serieData), {}, {
23455
23567
  catalogData: catalogApiData
23456
23568
  }), serieNo, orderSet, state.api, itemsList, undefined, true, undefined /*additionalModelInfos*/);
23457
- _context4.next = 13;
23569
+ _context4.next = 26;
23458
23570
  return this.loadCatalogXml(state, catalogData);
23459
- case 13:
23571
+ case 26:
23460
23572
  return _context4.abrupt("return", catalogData);
23461
- case 14:
23573
+ case 27:
23462
23574
  case "end":
23463
23575
  return _context4.stop();
23464
23576
  }
@@ -23468,48 +23580,77 @@ var DivaCatalogHandler = /*#__PURE__*/function () {
23468
23580
  return _loadIDMCatalog.apply(this, arguments);
23469
23581
  }
23470
23582
  return loadIDMCatalog;
23471
- }()
23583
+ }() /** Resolves a serieNo to the serie's `_id` via the catalog's series list; undefined when no serie carries that number. */
23584
+ }, {
23585
+ key: "resolveIDMSerieIdByNo",
23586
+ value: (function () {
23587
+ var _resolveIDMSerieIdByNo = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee5(state, accountId, serieNo) {
23588
+ var _response$data, _series$find;
23589
+ var response, payload, series;
23590
+ return _regeneratorRuntime__default["default"].wrap(function _callee5$(_context5) {
23591
+ while (1) switch (_context5.prev = _context5.next) {
23592
+ case 0:
23593
+ _context5.next = 2;
23594
+ return state.api.getDataCache(state.api.getIDMSeriesList(accountId), undefined, undefined, 'enricher');
23595
+ case 2:
23596
+ response = _context5.sent;
23597
+ payload = (_response$data = response === null || response === void 0 ? void 0 : response.data) !== null && _response$data !== void 0 ? _response$data : response;
23598
+ series = Array.isArray(payload) ? payload : [];
23599
+ return _context5.abrupt("return", (_series$find = series.find(function (serie) {
23600
+ return "".concat(serie.serieNo) === "".concat(serieNo);
23601
+ })) === null || _series$find === void 0 ? void 0 : _series$find._id);
23602
+ case 6:
23603
+ case "end":
23604
+ return _context5.stop();
23605
+ }
23606
+ }, _callee5);
23607
+ }));
23608
+ function resolveIDMSerieIdByNo(_x15, _x16, _x17) {
23609
+ return _resolveIDMSerieIdByNo.apply(this, arguments);
23610
+ }
23611
+ return resolveIDMSerieIdByNo;
23612
+ }())
23472
23613
  }, {
23473
23614
  key: "loadCatalogXml",
23474
23615
  value: function () {
23475
- var _loadCatalogXml = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee5(state, catalogData) {
23616
+ var _loadCatalogXml = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee6(state, catalogData) {
23476
23617
  var constructorServiceUrl, iln, xml;
23477
- return _regeneratorRuntime__default["default"].wrap(function _callee5$(_context5) {
23478
- while (1) switch (_context5.prev = _context5.next) {
23618
+ return _regeneratorRuntime__default["default"].wrap(function _callee6$(_context6) {
23619
+ while (1) switch (_context6.prev = _context6.next) {
23479
23620
  case 0:
23480
23621
  // Loaded even when the HQS is assembled remotely: the catalog XML's GEO names are needed for the
23481
23622
  // accessory variant-family mesh swap (FreePlacesOnGrids.geo3DName), not just for local assembly.
23482
23623
  constructorServiceUrl = state.api.getConstructorServiceUrl();
23483
23624
  iln = catalogData.supplierILN;
23484
23625
  if (!(!constructorServiceUrl || !iln)) {
23485
- _context5.next = 4;
23626
+ _context6.next = 4;
23486
23627
  break;
23487
23628
  }
23488
- return _context5.abrupt("return");
23629
+ return _context6.abrupt("return");
23489
23630
  case 4:
23490
23631
  bootMark('catalog-xml start');
23491
- _context5.prev = 5;
23492
- _context5.next = 8;
23632
+ _context6.prev = 5;
23633
+ _context6.next = 8;
23493
23634
  return state.api.getCatalogXml(iln, catalogData.catalogCodex);
23494
23635
  case 8:
23495
- xml = _context5.sent;
23636
+ xml = _context6.sent;
23496
23637
  if (xml) catalogData.catalogXml = xml;
23497
23638
  bootMark('catalog-xml done', {
23498
23639
  chars: xml ? xml.length : 0
23499
23640
  });
23500
- _context5.next = 16;
23641
+ _context6.next = 16;
23501
23642
  break;
23502
23643
  case 13:
23503
- _context5.prev = 13;
23504
- _context5.t0 = _context5["catch"](5);
23505
- LOG$i.debug('Failed to pre-load catalogXml: ' + _context5.t0);
23644
+ _context6.prev = 13;
23645
+ _context6.t0 = _context6["catch"](5);
23646
+ LOG$i.debug('Failed to pre-load catalogXml: ' + _context6.t0);
23506
23647
  case 16:
23507
23648
  case "end":
23508
- return _context5.stop();
23649
+ return _context6.stop();
23509
23650
  }
23510
- }, _callee5, null, [[5, 13]]);
23651
+ }, _callee6, null, [[5, 13]]);
23511
23652
  }));
23512
- function loadCatalogXml(_x15, _x16) {
23653
+ function loadCatalogXml(_x18, _x19) {
23513
23654
  return _loadCatalogXml.apply(this, arguments);
23514
23655
  }
23515
23656
  return loadCatalogXml;
@@ -23517,27 +23658,27 @@ var DivaCatalogHandler = /*#__PURE__*/function () {
23517
23658
  }, {
23518
23659
  key: "getAdditionalModeInfos",
23519
23660
  value: function () {
23520
- var _getAdditionalModeInfos = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee6(state, serieId, accountId) {
23521
- return _regeneratorRuntime__default["default"].wrap(function _callee6$(_context6) {
23522
- while (1) switch (_context6.prev = _context6.next) {
23661
+ var _getAdditionalModeInfos = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee7(state, serieId, accountId) {
23662
+ return _regeneratorRuntime__default["default"].wrap(function _callee7$(_context7) {
23663
+ while (1) switch (_context7.prev = _context7.next) {
23523
23664
  case 0:
23524
- _context6.prev = 0;
23525
- _context6.next = 3;
23665
+ _context7.prev = 0;
23666
+ _context7.next = 3;
23526
23667
  return state.api.getDataCache(state.api.getAdditionalModelInfosQS(accountId, serieId, state.api.OrganizationId), undefined, undefined, 'catalog');
23527
23668
  case 3:
23528
- return _context6.abrupt("return", _context6.sent);
23669
+ return _context7.abrupt("return", _context7.sent);
23529
23670
  case 6:
23530
- _context6.prev = 6;
23531
- _context6.t0 = _context6["catch"](0);
23671
+ _context7.prev = 6;
23672
+ _context7.t0 = _context7["catch"](0);
23532
23673
  LOG$i.debug('additional ModelInfo not found');
23533
- return _context6.abrupt("return", undefined);
23674
+ return _context7.abrupt("return", undefined);
23534
23675
  case 10:
23535
23676
  case "end":
23536
- return _context6.stop();
23677
+ return _context7.stop();
23537
23678
  }
23538
- }, _callee6, null, [[0, 6]]);
23679
+ }, _callee7, null, [[0, 6]]);
23539
23680
  }));
23540
- function getAdditionalModeInfos(_x17, _x18, _x19) {
23681
+ function getAdditionalModeInfos(_x20, _x21, _x22) {
23541
23682
  return _getAdditionalModeInfos.apply(this, arguments);
23542
23683
  }
23543
23684
  return getAdditionalModeInfos;
@@ -23896,11 +24037,21 @@ var ArticleOptionStateData = /*#__PURE__*/function () {
23896
24037
  key: "isInvisible",
23897
24038
  get: function get() {
23898
24039
  return this.articleOptionState.invisible;
23899
- },
24040
+ }
24041
+ /**
24042
+ * Restore the load-time visibility defaults (catalog + mask). IDM visibility is re-derived on
24043
+ * every decision evaluation — a SET_FEATURE_INVISIBLE only holds while its condition matches.
24044
+ */,
23900
24045
  set: function set(isInvisible) {
23901
24046
  this.articleOptionState.invisible = isInvisible;
23902
24047
  this.articleOptionState.invisibleWithoutMaskeInfluence = isInvisible;
23903
24048
  }
24049
+ }, {
24050
+ key: "resetVisibilityToOptionDefaults",
24051
+ value: function resetVisibilityToOptionDefaults() {
24052
+ this.articleOptionState.invisible = this.option.isInvisible;
24053
+ this.articleOptionState.invisibleWithoutMaskeInfluence = this.option.isInvisibleWithoutMaskeInfluence;
24054
+ }
23904
24055
  }, {
23905
24056
  key: "invisibleWithoutMaskeInfluence",
23906
24057
  get: function get() {
@@ -26449,7 +26600,9 @@ var IDMEngine = /*#__PURE__*/function () {
26449
26600
  var beforeHash = undefined;
26450
26601
  var afterHash = undefined;
26451
26602
  var count = 0;
26452
- var startTime = Date.now();
26603
+ // Same gate as the per-decision line below: the string is built before LOG.debug is called.
26604
+ var timeEval = this.article.set.logDecisions;
26605
+ var startTime = timeEval ? Date.now() : 0;
26453
26606
  this.article.decisionDebugStacks = [];
26454
26607
  if (this.article.set.logDecisions) this.article.dataCreationErrors = [];
26455
26608
  do {
@@ -26459,8 +26612,7 @@ var IDMEngine = /*#__PURE__*/function () {
26459
26612
  afterHash = JSON.stringify(this.article.snapshot);
26460
26613
  count++;
26461
26614
  } while (afterHash !== beforeHash && count < 50 && !onlyUpdateOnce);
26462
- var endTime = Date.now();
26463
- LOG$g.debug('eval Decisions total time in ' + (endTime - startTime) + ' of ' + count);
26615
+ if (timeEval) LOG$g.debug('eval Decisions total time in ' + (Date.now() - startTime) + ' of ' + count);
26464
26616
  }
26465
26617
  }, {
26466
26618
  key: "decisions",
@@ -26564,6 +26716,7 @@ var IDMEngine = /*#__PURE__*/function () {
26564
26716
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
26565
26717
  var ops = _step4.value;
26566
26718
  ops.updateVisibleOptionValues(ops.option.articleOptionValues);
26719
+ ops.resetVisibilityToOptionDefaults();
26567
26720
  if (!ops.val) this.updateArtOPV(this.article.getDefaultOpv(ops.visibleOptionValues), ops.optionCodex, ops, undefined);
26568
26721
  ops.definedBySetFeatureFixed = false;
26569
26722
  }
@@ -26586,6 +26739,7 @@ var IDMEngine = /*#__PURE__*/function () {
26586
26739
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
26587
26740
  var _ops = _step5.value;
26588
26741
  _ops.updateVisibleOptionValues(_ops.option.articleOptionValues);
26742
+ _ops.resetVisibilityToOptionDefaults();
26589
26743
  if (!_ops.val) this.updateArtOPV(this.article.getDefaultOpv(_ops.visibleOptionValues), _ops.optionCodex, _ops, undefined);
26590
26744
  _ops.definedBySetFeatureFixed = false;
26591
26745
  }
@@ -26597,8 +26751,10 @@ var IDMEngine = /*#__PURE__*/function () {
26597
26751
  this.decisionDebugStack = [];
26598
26752
  var beforeSnapshot = this.article.set.logDecisions ? this.article.snapshot : undefined;
26599
26753
  var beforeDecisionState = this.article.set.logDecisions ? this.decisionStateSnapshot(decisions) : undefined;
26754
+ // Gated on the same flag as the snapshots above — the Date.now() calls and string concatenation must not run with logging off.
26755
+ var timeDecisions = this.article.set.logDecisions;
26600
26756
  for (var m = 0; m < decisions.length; m++) {
26601
- var startTime = Date.now();
26757
+ var startTime = timeDecisions ? Date.now() : 0;
26602
26758
  //Alle Optionen Mit DOC Type 1 ermitten - diese zunächst alle ausblenden, werden dann später über Formeln wieder eingeschaltets
26603
26759
  var decision = decisions[m];
26604
26760
  if (decision.enabled && decision.optionCombinations.length) {
@@ -26622,8 +26778,7 @@ var IDMEngine = /*#__PURE__*/function () {
26622
26778
  var pushed = this.pushDecisionDebug(decision, decisions, beforeSnapshot, beforeDecisionState);
26623
26779
  beforeSnapshot = pushed === null || pushed === void 0 ? void 0 : pushed.afterSnapshot;
26624
26780
  beforeDecisionState = pushed === null || pushed === void 0 ? void 0 : pushed.afterDecisionState;
26625
- var endTime = Date.now();
26626
- LOG$g.debug('decision ' + decision.decisionNo + ' time ' + (endTime - startTime));
26781
+ if (timeDecisions) LOG$g.debug('decision ' + decision.decisionNo + ' time ' + (Date.now() - startTime));
26627
26782
  }
26628
26783
  this.article.decisionDebugStacks.push({
26629
26784
  stack: this.decisionDebugStack,
@@ -26794,6 +26949,145 @@ var IDMEngine = /*#__PURE__*/function () {
26794
26949
  }
26795
26950
  return (_this$article$getArti = this.article.getArticleOptionStateFlat(targetFeatureNo)) === null || _this$article$getArti === void 0 ? void 0 : _this$article$getArti.visibleOptionValues;
26796
26951
  }
26952
+
26953
+ /**
26954
+ * Statically derives the visible option values of `targetFeatureNo` under the hypothetical selection
26955
+ * `groupFeatureNo = groupValueCodex` from the type-1 decision ROWS (no clone, no mutation) — exact only for
26956
+ * the two-group-families standard shape; any other shape returns undefined and the caller falls back.
26957
+ */
26958
+ }, {
26959
+ key: "staticVisibleOptionValuesForFeature",
26960
+ value: function staticVisibleOptionValuesForFeature(targetFeatureNo, groupFeatureNo, groupValueCodex) {
26961
+ var targetOps = this.article.getArticleOptionStateFlat(targetFeatureNo);
26962
+ if (!targetOps || !this.article.getArticleOptionStateFlat(groupFeatureNo)) return undefined;
26963
+ var decisions = this.decisions;
26964
+ // type 0/1 decisions restrict every feature in their featureRefs — only the pure group→target shape is derivable
26965
+ var influencing = decisions.filter(function (decision) {
26966
+ var _decision$featureRefs3;
26967
+ return decision.decisionType != 2 && ((_decision$featureRefs3 = decision.featureRefs) === null || _decision$featureRefs3 === void 0 ? void 0 : _decision$featureRefs3.includes(targetFeatureNo));
26968
+ });
26969
+ var _iterator11 = _createForOfIteratorHelper$e(influencing),
26970
+ _step11;
26971
+ try {
26972
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
26973
+ var decision = _step11.value;
26974
+ if (decision.decisionType != 1) return undefined;
26975
+ if (decision.featureRefs.some(function (featureNo) {
26976
+ return featureNo != targetFeatureNo && featureNo != groupFeatureNo;
26977
+ })) return undefined;
26978
+ if (this.sortFeatures(_toConsumableArray__default["default"](decision.featureRefs))[0] != groupFeatureNo) return undefined;
26979
+ }
26980
+ // A type-2 is judged by its ACTIONS: it interferes only when one SETS/FIXES/HIDES the target or toggles an influencing decision.
26981
+ } catch (err) {
26982
+ _iterator11.e(err);
26983
+ } finally {
26984
+ _iterator11.f();
26985
+ }
26986
+ var influencingNos = influencing.map(function (decision) {
26987
+ return decision.decisionNo;
26988
+ });
26989
+ var targetNo = Number(targetFeatureNo);
26990
+ var groupNo = Number(groupFeatureNo);
26991
+ var type2Interferes = decisions.some(function (decision) {
26992
+ var _decision$optionCombi3;
26993
+ return decision.decisionType == 2 && ((_decision$optionCombi3 = decision.optionCombinations) === null || _decision$optionCombi3 === void 0 ? void 0 : _decision$optionCombi3.some(function (combination) {
26994
+ var _actions$disableDecis, _actions$enableDecisi, _actions$setFeature, _actions$setFeatureDe, _actions$setFeatureDe2, _actions$setFeatureFi, _actions$setFeatureIn, _actions$setFeatureVi;
26995
+ var actions = combination.projectActions;
26996
+ var togglesInfluencing = [].concat(_toConsumableArray__default["default"]((_actions$disableDecis = actions === null || actions === void 0 ? void 0 : actions.disableDecision) !== null && _actions$disableDecis !== void 0 ? _actions$disableDecis : []), _toConsumableArray__default["default"]((_actions$enableDecisi = actions === null || actions === void 0 ? void 0 : actions.enableDecision) !== null && _actions$enableDecisi !== void 0 ? _actions$enableDecisi : [])).some(function (ref) {
26997
+ return influencingNos.includes(Number(ref.decisionNo));
26998
+ });
26999
+ // An action on the GROUP feature overrides the hypothesized value — bail to the full-reconfiguration fallback.
27000
+ var touchesTargetOrGroup = [].concat(_toConsumableArray__default["default"]((_actions$setFeature = actions === null || actions === void 0 ? void 0 : actions.setFeature) !== null && _actions$setFeature !== void 0 ? _actions$setFeature : []), _toConsumableArray__default["default"]((_actions$setFeatureDe = actions === null || actions === void 0 ? void 0 : actions.setFeatureDefault) !== null && _actions$setFeatureDe !== void 0 ? _actions$setFeatureDe : []), _toConsumableArray__default["default"]((_actions$setFeatureDe2 = actions === null || actions === void 0 ? void 0 : actions.setFeatureDefaultNull) !== null && _actions$setFeatureDe2 !== void 0 ? _actions$setFeatureDe2 : []), _toConsumableArray__default["default"]((_actions$setFeatureFi = actions === null || actions === void 0 ? void 0 : actions.setFeatureFixed) !== null && _actions$setFeatureFi !== void 0 ? _actions$setFeatureFi : []), _toConsumableArray__default["default"]((_actions$setFeatureIn = actions === null || actions === void 0 ? void 0 : actions.setFeatureInvisible) !== null && _actions$setFeatureIn !== void 0 ? _actions$setFeatureIn : []), _toConsumableArray__default["default"]((_actions$setFeatureVi = actions === null || actions === void 0 ? void 0 : actions.setFeatureVisible) !== null && _actions$setFeatureVi !== void 0 ? _actions$setFeatureVi : [])).some(function (action) {
27001
+ return Number(action.featureNo) == targetNo || Number(action.featureNo) == groupNo;
27002
+ });
27003
+ return togglesInfluencing || touchesTargetOrGroup;
27004
+ }));
27005
+ });
27006
+ if (type2Interferes) return undefined;
27007
+
27008
+ // Pool per decision = UNION of matching rows' target options; successive decisions INTERSECT (mirrors evalType1Decision).
27009
+ var pool = undefined;
27010
+ var _iterator12 = _createForOfIteratorHelper$e(influencing),
27011
+ _step12;
27012
+ try {
27013
+ for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
27014
+ var _decision3$optionComb;
27015
+ var _decision3 = _step12.value;
27016
+ var decisionPool = new Set();
27017
+ var anyRowMatched = false;
27018
+ var _iterator14 = _createForOfIteratorHelper$e((_decision3$optionComb = _decision3.optionCombinations) !== null && _decision3$optionComb !== void 0 ? _decision3$optionComb : []),
27019
+ _step14;
27020
+ try {
27021
+ for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
27022
+ var _combination$projectO, _combination$projectO2, _groupRef$options, _targetRef$options;
27023
+ var combination = _step14.value;
27024
+ var groupRef = this.getOptionListOfRef((_combination$projectO = combination.projectOptionsSetRefs) === null || _combination$projectO === void 0 ? void 0 : _combination$projectO.find(function (ref) {
27025
+ return ref.featureNo == Number(groupFeatureNo);
27026
+ }));
27027
+ var targetRef = this.getOptionListOfRef((_combination$projectO2 = combination.projectOptionsSetRefs) === null || _combination$projectO2 === void 0 ? void 0 : _combination$projectO2.find(function (ref) {
27028
+ return ref.featureNo == Number(targetFeatureNo);
27029
+ }));
27030
+ if (!groupRef || !targetRef) return undefined;
27031
+ if (![0, 2].includes(groupRef.operator) || ![0, 2].includes(targetRef.operator)) return undefined;
27032
+ if (!((_groupRef$options = groupRef.options) !== null && _groupRef$options !== void 0 && _groupRef$options.includes(groupValueCodex))) continue;
27033
+ // evalType1Decision treats a matching row with NO target options as "unrestricted", not as "nothing allowed" -
27034
+ // the static pool cannot express that, so leave this feature to the reconfiguration fallback.
27035
+ if (!((_targetRef$options = targetRef.options) !== null && _targetRef$options !== void 0 && _targetRef$options.length)) return undefined;
27036
+ anyRowMatched = true;
27037
+ var _iterator15 = _createForOfIteratorHelper$e(targetRef.options),
27038
+ _step15;
27039
+ try {
27040
+ for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
27041
+ var option = _step15.value;
27042
+ decisionPool.add(option);
27043
+ }
27044
+ } catch (err) {
27045
+ _iterator15.e(err);
27046
+ } finally {
27047
+ _iterator15.f();
27048
+ }
27049
+ }
27050
+ } catch (err) {
27051
+ _iterator14.e(err);
27052
+ } finally {
27053
+ _iterator14.f();
27054
+ }
27055
+ if (!anyRowMatched) continue;
27056
+ pool = pool == undefined ? decisionPool : new Set(_toConsumableArray__default["default"](decisionPool).filter(function (key) {
27057
+ var _pool;
27058
+ return (_pool = pool) === null || _pool === void 0 ? void 0 : _pool.has(key);
27059
+ }));
27060
+ }
27061
+ } catch (err) {
27062
+ _iterator12.e(err);
27063
+ } finally {
27064
+ _iterator12.f();
27065
+ }
27066
+ var allValues = targetOps.option.articleOptionValues;
27067
+ if (pool == undefined) return new Map(allValues);
27068
+ // A grouped target keys `articleOptionValues` by its OPG codices and nests the values inside them, while the
27069
+ // decision rows name the nested values — filtering by key would silently yield an empty pool, and the caller
27070
+ // reads an empty map as "nothing selectable" instead of falling back. Leave that shape to the reconfiguration.
27071
+ if (targetOps.option.hasOPG && _toConsumableArray__default["default"](pool).some(function (key) {
27072
+ return !allValues.has(key);
27073
+ })) return undefined;
27074
+ var result = new Map();
27075
+ var _iterator13 = _createForOfIteratorHelper$e(allValues),
27076
+ _step13;
27077
+ try {
27078
+ for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
27079
+ var _step13$value = _slicedToArray__default["default"](_step13.value, 2),
27080
+ key = _step13$value[0],
27081
+ value = _step13$value[1];
27082
+ if (pool.has(key)) result.set(key, value);
27083
+ }
27084
+ } catch (err) {
27085
+ _iterator13.e(err);
27086
+ } finally {
27087
+ _iterator13.f();
27088
+ }
27089
+ return result;
27090
+ }
26797
27091
  }, {
26798
27092
  key: "presetFeatureValues",
26799
27093
  value: function presetFeatureValues(presetValues) {
@@ -26826,11 +27120,11 @@ var IDMEngine = /*#__PURE__*/function () {
26826
27120
  }, {
26827
27121
  key: "evalType1Decision",
26828
27122
  value: function evalType1Decision(decision) {
26829
- var _decision$featureRefs3,
27123
+ var _decision$featureRefs4,
26830
27124
  _this4 = this;
26831
27125
  var validOptions = {};
26832
27126
  var doAlsoCheckFeatureNos = [];
26833
- if (!decision.optionCombinations.length || !((_decision$featureRefs3 = decision.featureRefs) !== null && _decision$featureRefs3 !== void 0 && _decision$featureRefs3.length)) return;
27127
+ if (!decision.optionCombinations.length || !((_decision$featureRefs4 = decision.featureRefs) !== null && _decision$featureRefs4 !== void 0 && _decision$featureRefs4.length)) return;
26834
27128
  var sortedDeatureRefs = this.sortFeatures(decision.featureRefs);
26835
27129
  var _loop2 = function _loop2() {
26836
27130
  var featureNo = sortedDeatureRefs[p];
@@ -26942,13 +27236,13 @@ var IDMEngine = /*#__PURE__*/function () {
26942
27236
  }, {
26943
27237
  key: "evalType0Decision",
26944
27238
  value: function evalType0Decision(decision) {
26945
- var _decision$optionCombi3,
26946
- _decision$featureRefs4,
27239
+ var _decision$optionCombi4,
26947
27240
  _decision$featureRefs5,
27241
+ _decision$featureRefs6,
26948
27242
  _this5 = this;
26949
27243
  var invalidOptions = {},
26950
27244
  doAlsoCheckFeature = [];
26951
- if (!((_decision$optionCombi3 = decision.optionCombinations) !== null && _decision$optionCombi3 !== void 0 && _decision$optionCombi3.length) || ((_decision$featureRefs4 = (_decision$featureRefs5 = decision.featureRefs) === null || _decision$featureRefs5 === void 0 ? void 0 : _decision$featureRefs5.length) !== null && _decision$featureRefs4 !== void 0 ? _decision$featureRefs4 : 0) <= 1) return;
27245
+ if (!((_decision$optionCombi4 = decision.optionCombinations) !== null && _decision$optionCombi4 !== void 0 && _decision$optionCombi4.length) || ((_decision$featureRefs5 = (_decision$featureRefs6 = decision.featureRefs) === null || _decision$featureRefs6 === void 0 ? void 0 : _decision$featureRefs6.length) !== null && _decision$featureRefs5 !== void 0 ? _decision$featureRefs5 : 0) <= 1) return;
26952
27246
  var sortedDeatureRefs = this.sortFeatures(decision.featureRefs);
26953
27247
  var _loop4 = function _loop4() {
26954
27248
  var featureNo = sortedDeatureRefs[p];
@@ -27065,9 +27359,9 @@ var IDMEngine = /*#__PURE__*/function () {
27065
27359
  }, {
27066
27360
  key: "evalType2Decision",
27067
27361
  value: function evalType2Decision(decision, allDecisions) {
27068
- var _decision$optionCombi4;
27362
+ var _decision$optionCombi5;
27069
27363
  var hasSetFeatureInvisible = {};
27070
- if (!((_decision$optionCombi4 = decision.optionCombinations) !== null && _decision$optionCombi4 !== void 0 && _decision$optionCombi4.length)) return;
27364
+ if (!((_decision$optionCombi5 = decision.optionCombinations) !== null && _decision$optionCombi5 !== void 0 && _decision$optionCombi5.length)) return;
27071
27365
  var _ref5 = this.getMatchingOptionCombination(decision.optionCombinations, decision.decisionNo),
27072
27366
  _ref6 = _slicedToArray__default["default"](_ref5, 1),
27073
27367
  combination = _ref6[0];
@@ -27087,12 +27381,12 @@ var IDMEngine = /*#__PURE__*/function () {
27087
27381
  key: "evalDisableDecision",
27088
27382
  value: function evalDisableDecision(actions, decision, allDecisions, disable) {
27089
27383
  var verb = disable ? 'disabled' : 'enabled';
27090
- var _iterator11 = _createForOfIteratorHelper$e(actions),
27091
- _step11;
27384
+ var _iterator16 = _createForOfIteratorHelper$e(actions),
27385
+ _step16;
27092
27386
  try {
27093
27387
  var _loop6 = function _loop6() {
27094
27388
  var _dec$disableHistory;
27095
- var action = _step11.value;
27389
+ var action = _step16.value;
27096
27390
  var dec = allDecisions.find(function (d) {
27097
27391
  return d.decisionNo == Number(action.decisionNo);
27098
27392
  });
@@ -27103,42 +27397,42 @@ var IDMEngine = /*#__PURE__*/function () {
27103
27397
  dec.enabled = !disable;
27104
27398
  (_dec$disableHistory = dec.disableHistory) === null || _dec$disableHistory === void 0 || _dec$disableHistory.push(verb + ' By ' + decision.decisionNo);
27105
27399
  };
27106
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
27400
+ for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
27107
27401
  if (_loop6()) continue;
27108
27402
  }
27109
27403
  } catch (err) {
27110
- _iterator11.e(err);
27404
+ _iterator16.e(err);
27111
27405
  } finally {
27112
- _iterator11.f();
27406
+ _iterator16.f();
27113
27407
  }
27114
27408
  }
27115
27409
  }, {
27116
27410
  key: "evalSetFeatureVisible",
27117
27411
  value: function evalSetFeatureVisible(actions, hasSetFeatureInvisible, invisible) {
27118
- var _iterator12 = _createForOfIteratorHelper$e(actions),
27119
- _step12;
27412
+ var _iterator17 = _createForOfIteratorHelper$e(actions),
27413
+ _step17;
27120
27414
  try {
27121
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
27122
- var action = _step12.value;
27415
+ for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
27416
+ var action = _step17.value;
27123
27417
  if (!this.article.getArticleOptionState(action.featureNo.toString()) || !action.featureNo) continue;
27124
27418
  var ops = this.article.getArticleOptionState(action.featureNo.toString());
27125
27419
  if (invisible) hasSetFeatureInvisible[action.featureNo.toString()] = invisible;
27126
27420
  if (ops) ops.isInvisible = invisible;
27127
27421
  }
27128
27422
  } catch (err) {
27129
- _iterator12.e(err);
27423
+ _iterator17.e(err);
27130
27424
  } finally {
27131
- _iterator12.f();
27425
+ _iterator17.f();
27132
27426
  }
27133
27427
  }
27134
27428
  }, {
27135
27429
  key: "evalSetFeatureDefault",
27136
27430
  value: function evalSetFeatureDefault(actions, decision, isNull) {
27137
- var _iterator13 = _createForOfIteratorHelper$e(actions),
27138
- _step13;
27431
+ var _iterator18 = _createForOfIteratorHelper$e(actions),
27432
+ _step18;
27139
27433
  try {
27140
- for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
27141
- var action = _step13.value;
27434
+ for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
27435
+ var action = _step18.value;
27142
27436
  var ops = this.article.getArticleOptionState(action.featureNo.toString());
27143
27437
  if (ops && (isNull && ops.val === undefined || !isNull && (ops.val === undefined || !ops.valueWasSet))) {
27144
27438
  if (action.formulaRef) {
@@ -27163,20 +27457,20 @@ var IDMEngine = /*#__PURE__*/function () {
27163
27457
  break;
27164
27458
  }
27165
27459
  } catch (err) {
27166
- _iterator13.e(err);
27460
+ _iterator18.e(err);
27167
27461
  } finally {
27168
- _iterator13.f();
27462
+ _iterator18.f();
27169
27463
  }
27170
27464
  }
27171
27465
  }, {
27172
27466
  key: "evalSetFeature",
27173
27467
  value: function evalSetFeature(actions, decision, isFixed) {
27174
- var _iterator14 = _createForOfIteratorHelper$e(actions),
27175
- _step14;
27468
+ var _iterator19 = _createForOfIteratorHelper$e(actions),
27469
+ _step19;
27176
27470
  try {
27177
- for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
27471
+ for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
27178
27472
  var _action$featureNo2;
27179
- var action = _step14.value;
27473
+ var action = _step19.value;
27180
27474
  if (!this.article.getArticleOptionState((_action$featureNo2 = action.featureNo) === null || _action$featureNo2 === void 0 ? void 0 : _action$featureNo2.toString()) || !action.featureNo) {
27181
27475
  //usecase is that it want to be set on partlistarticle that is not currently loaded so its not found
27182
27476
  LOG$g.debug('evalSetFeature decision ' + decision.decisionNo + ' (isFixed=' + isFixed + '): target feature ' + action.featureNo + ' has no option state on article ' + this.article.articleCodex + ' - action skipped');
@@ -27221,9 +27515,9 @@ var IDMEngine = /*#__PURE__*/function () {
27221
27515
  }
27222
27516
  }
27223
27517
  } catch (err) {
27224
- _iterator14.e(err);
27518
+ _iterator19.e(err);
27225
27519
  } finally {
27226
- _iterator14.f();
27520
+ _iterator19.f();
27227
27521
  }
27228
27522
  }
27229
27523
  }, {
@@ -27302,7 +27596,7 @@ var IDMEngine = /*#__PURE__*/function () {
27302
27596
  for (var i = 0; i < priceFeatureGroups.length; i++) {
27303
27597
  var priceFeatureGroup = priceFeatureGroups[i];
27304
27598
  this.checkPriceGroupAllZeros(priceFeatureGroup);
27305
- var _this$getMatchingOpti = this.getMatchingOptionCombination(priceFeatureGroup.projectFinishes),
27599
+ var _this$getMatchingOpti = this.getMatchingOptionCombination(priceFeatureGroup.projectFinishes, undefined, "price feature group ".concat(priceFeatureGroup.priceFeatureGroupNo, " finishes")),
27306
27600
  _this$getMatchingOpti2 = _slicedToArray__default["default"](_this$getMatchingOpti, 2);
27307
27601
  _this$getMatchingOpti2[0];
27308
27602
  var index = _this$getMatchingOpti2[1];
@@ -27335,7 +27629,7 @@ var IDMEngine = /*#__PURE__*/function () {
27335
27629
  var _priceFeatureGroup$pr;
27336
27630
  var _priceFeatureGroup = priceFeatureGroups[_i];
27337
27631
  if ((_priceFeatureGroup$pr = _priceFeatureGroup.projectPercentageSurcharges) !== null && _priceFeatureGroup$pr !== void 0 && _priceFeatureGroup$pr.length) {
27338
- var _this$getMatchingOpti3 = this.getMatchingOptionCombination(_priceFeatureGroup.projectPercentageSurcharges),
27632
+ var _this$getMatchingOpti3 = this.getMatchingOptionCombination(_priceFeatureGroup.projectPercentageSurcharges, undefined, "price feature group ".concat(_priceFeatureGroup.priceFeatureGroupNo, " percentage surcharges")),
27339
27633
  _this$getMatchingOpti4 = _slicedToArray__default["default"](_this$getMatchingOpti3, 2),
27340
27634
  ps = _this$getMatchingOpti4[0],
27341
27635
  indexPs = _this$getMatchingOpti4[1];
@@ -27385,7 +27679,7 @@ var IDMEngine = /*#__PURE__*/function () {
27385
27679
  var _priceFeatureGroup2$p;
27386
27680
  var _priceFeatureGroup2 = priceFeatureGroups[_i2];
27387
27681
  if ((_priceFeatureGroup2$p = _priceFeatureGroup2.projectPercentageSurcharges) !== null && _priceFeatureGroup2$p !== void 0 && _priceFeatureGroup2$p.length) {
27388
- var _this$getMatchingOpti5 = this.getMatchingOptionCombination(_priceFeatureGroup2.projectPercentageSurcharges),
27682
+ var _this$getMatchingOpti5 = this.getMatchingOptionCombination(_priceFeatureGroup2.projectPercentageSurcharges, undefined, "price feature group ".concat(_priceFeatureGroup2.priceFeatureGroupNo, " percentage surcharges")),
27389
27683
  _this$getMatchingOpti6 = _slicedToArray__default["default"](_this$getMatchingOpti5, 2),
27390
27684
  _ps = _this$getMatchingOpti6[0],
27391
27685
  _indexPs = _this$getMatchingOpti6[1];
@@ -27600,18 +27894,18 @@ var IDMEngine = /*#__PURE__*/function () {
27600
27894
  for (var c = 0; c < decisions.length; c++) {
27601
27895
  var decision = decisions[c];
27602
27896
  lastTriedDecisionNo = decision.decisionNo;
27603
- var relationTypeNone = myPartListPos.decisionPosCount !== decision.decisionNo;
27604
- var isValidDOC = relationTypeNone ? undefined : this.checkDecisionNumber(decision.decisionNo);
27605
- if (!isValidDOC && !relationTypeNone) {
27606
- continue;
27607
- }
27897
+ // Only the position's COUNT decision gates loading; the other attached decisions are pass-down payload.
27898
+ if (myPartListPos.decisionPosCount !== decision.decisionNo) continue;
27899
+ if (!this.checkDecisionNumber(decision.decisionNo)) continue;
27608
27900
  partlistAdded = true;
27609
- partlistArticlesToLoad = this.addPartilstToPartlistArticlesToLoad(myPartListPos, partlistArticlesToLoad, partlistGroup, newConfigValues, undefined, !relationTypeNone ? decision.decisionNo : undefined, 'Decision matched');
27901
+ partlistArticlesToLoad = this.addPartilstToPartlistArticlesToLoad(myPartListPos, partlistArticlesToLoad, partlistGroup, newConfigValues, undefined, decision.decisionNo, 'Decision matched');
27610
27902
  break;
27611
27903
  }
27612
- if (decisions.length === 0 && !partlistAdded) {
27613
- LOG$g.log('partlistarticle loaded for haveing 0 decisions: ', myPartListPos.itemRefTypeNo);
27614
- partlistArticlesToLoad = this.addPartilstToPartlistArticlesToLoad(myPartListPos, partlistArticlesToLoad, partlistGroup, newConfigValues, undefined, undefined, 'No decisions');
27904
+ // Without a COUNT decision nothing gates the position: attached pass-down decisions are payload, so such a
27905
+ // position loads like one with no decisions at all (it did before the pass-down decisions stopped gating).
27906
+ if (!myPartListPos.decisionPosCount && !partlistAdded) {
27907
+ LOG$g.log('partlistarticle loaded for having no count decision: ', myPartListPos.itemRefTypeNo);
27908
+ partlistArticlesToLoad = this.addPartilstToPartlistArticlesToLoad(myPartListPos, partlistArticlesToLoad, partlistGroup, newConfigValues, undefined, undefined, decisions.length ? 'No count decision' : 'No decisions');
27615
27909
  } else if (!partlistAdded && myPartListPos.posCountValue > 0) {
27616
27910
  LOG$g.log('partlistarticle loaded for having default PosCountValue ', myPartListPos.itemRefTypeNo);
27617
27911
  partlistArticlesToLoad = this.addPartilstToPartlistArticlesToLoad(myPartListPos, partlistArticlesToLoad, partlistGroup, newConfigValues, undefined, undefined, 'Default posCountValue');
@@ -27697,9 +27991,9 @@ var IDMEngine = /*#__PURE__*/function () {
27697
27991
  _loop8(i);
27698
27992
  }
27699
27993
  if (quanitity >= 1) {
27700
- var _catalogCodex$toStrin, _ref7;
27994
+ var _ref7;
27701
27995
  partlistArticlesToLoad.push({
27702
- CatalogCodex: (_catalogCodex$toStrin = catalogCodex.toString()) !== null && _catalogCodex$toStrin !== void 0 ? _catalogCodex$toStrin : this.article.catalogCodex,
27996
+ CatalogCodex: catalogCodex != null ? catalogCodex.toString() : this.article.catalogCodex,
27703
27997
  BasketID: previousPartlistArticle === null || previousPartlistArticle === void 0 ? void 0 : previousPartlistArticle.basketId,
27704
27998
  ArticleCodex: articleCodex,
27705
27999
  Quantity: quanitity,
@@ -27713,6 +28007,9 @@ var IDMEngine = /*#__PURE__*/function () {
27713
28007
  ConfigurationMode: myPartListPos.configurationMode,
27714
28008
  VariantValues: this.article.variantValuesForPla(myPartListPos.configurationMode, previousPartlistArticle === null || previousPartlistArticle === void 0 ? void 0 : previousPartlistArticle.VariantValues, newConfigValues),
27715
28009
  VariantItemData: previousPartlistArticle === null || previousPartlistArticle === void 0 ? void 0 : previousPartlistArticle.VariantItemData,
28010
+ // the replaced instance's own children seed the new instance's previous-map, so selections
28011
+ // deeper than one level survive a parent reload (same contract as the order-restore seed)
28012
+ PreviousPartlistArticles: previousPartlistArticle !== null && previousPartlistArticle !== void 0 && previousPartlistArticle.partlistArticles && Object.keys(previousPartlistArticle.partlistArticles).length ? previousPartlistArticle.partlistArticles : undefined,
27716
28013
  optionsForPrint: featuresForPrint,
27717
28014
  RetailArticleNr: myPartListPos.retailArticleNr && myPartListPos.retailArticleNr !== '' ? myPartListPos.retailArticleNr : undefined,
27718
28015
  RetailPrefix: (_ref7 = myPartListPos.retailPrefix) !== null && _ref7 !== void 0 ? _ref7 : undefined
@@ -27724,22 +28021,33 @@ var IDMEngine = /*#__PURE__*/function () {
27724
28021
  }
27725
28022
  return partlistArticlesToLoad;
27726
28023
  }
28024
+
28025
+ /**
28026
+ * The first rule row whose conditions hold, with its index - a conditionless row matches unconditionally, which
28027
+ * makes it the documented fallback when it is the LAST row and a fault when rows follow it. That fault is reported
28028
+ * as WC_0012 for decisions and price rule sets alike; `ruleSet` names the set in the message where no decisionNo does.
28029
+ */
27727
28030
  }, {
27728
28031
  key: "getMatchingOptionCombination",
27729
- value: function getMatchingOptionCombination(combinations, decisionNo) {
28032
+ value: function getMatchingOptionCombination(combinations, decisionNo, ruleSet) {
27730
28033
  for (var i = 0; i < combinations.length; i++) {
27731
28034
  var _ref8, _ref9, _projectOptionsSetRef;
27732
28035
  var combination = combinations[i];
27733
28036
  var optionSetRefs = (_ref8 = (_ref9 = (_projectOptionsSetRef = combination.projectOptionsSetRefs) !== null && _projectOptionsSetRef !== void 0 ? _projectOptionsSetRef : combination.optionsSetRef) !== null && _ref9 !== void 0 ? _ref9 : combination.optionsSetRef) !== null && _ref8 !== void 0 ? _ref8 : [];
27734
28037
  if (optionSetRefs.length === 0) {
27735
- if (decisionNo !== undefined) {
28038
+ // A conditionless LAST row is the documented fallback; a conditionless row with rows AFTER it is the fault (first match wins).
28039
+ var shadowsLaterRows = i < combinations.length - 1;
28040
+ if ((decisionNo !== undefined || ruleSet !== undefined) && shadowsLaterRows && !this.isShadowedRowReported(decisionNo, ruleSet, i)) {
28041
+ var where = ruleSet !== null && ruleSet !== void 0 ? ruleSet : "decision ".concat(decisionNo);
27736
28042
  this.article.pushDataCreationError({
27737
28043
  code: 'WC_0012',
27738
- message: 'Rule with no conditions - always true, not useful',
28044
+ message: "Rule row ".concat(i + 1, " of ").concat(where, " has no conditions but is not the last row - it always matches, so the ").concat(combinations.length - i - 1, " row(s) after it can never be reached"),
27739
28045
  severity: 'warning',
27740
28046
  custom: {
27741
28047
  decisionNo: decisionNo,
28048
+ ruleSet: ruleSet,
27742
28049
  combinationIndex: i,
28050
+ shadowedRows: combinations.length - i - 1,
27743
28051
  catalogCodex: this.article.catalogCodex,
27744
28052
  articleCodex: this.article.articleCodex
27745
28053
  }
@@ -27751,6 +28059,19 @@ var IDMEngine = /*#__PURE__*/function () {
27751
28059
  }
27752
28060
  return [undefined, undefined];
27753
28061
  }
28062
+
28063
+ /**
28064
+ * Whether WC_0012 was already recorded for this row: evalDecisions clears the errors once and then converges over
28065
+ * several passes, so the same matching row would otherwise report the same fault once per pass.
28066
+ */
28067
+ }, {
28068
+ key: "isShadowedRowReported",
28069
+ value: function isShadowedRowReported(decisionNo, ruleSet, combinationIndex) {
28070
+ return this.article.dataCreationErrors.some(function (error) {
28071
+ var _error$custom, _error$custom2, _error$custom3;
28072
+ return error.code === 'WC_0012' && ((_error$custom = error.custom) === null || _error$custom === void 0 ? void 0 : _error$custom.decisionNo) === decisionNo && ((_error$custom2 = error.custom) === null || _error$custom2 === void 0 ? void 0 : _error$custom2.ruleSet) === ruleSet && ((_error$custom3 = error.custom) === null || _error$custom3 === void 0 ? void 0 : _error$custom3.combinationIndex) === combinationIndex;
28073
+ });
28074
+ }
27754
28075
  }, {
27755
28076
  key: "evalCombi",
27756
28077
  value: function evalCombi(optionSetRefs) {
@@ -27810,25 +28131,25 @@ var IDMEngine = /*#__PURE__*/function () {
27810
28131
  var cached = this.featureDefaultIndex;
27811
28132
  if (cached && cached.sources[0] === sources[0] && cached.sources[1] === sources[1]) return cached.byFeature;
27812
28133
  var byFeature = new Map();
27813
- var _iterator15 = _createForOfIteratorHelper$e(this.decisions),
27814
- _step15;
28134
+ var _iterator20 = _createForOfIteratorHelper$e(this.decisions),
28135
+ _step20;
27815
28136
  try {
27816
- for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
27817
- var _decision$optionCombi5;
27818
- var decision = _step15.value;
28137
+ for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
28138
+ var _decision$optionCombi6;
28139
+ var decision = _step20.value;
27819
28140
  if (decision.decisionType !== 2) continue;
27820
- var _iterator16 = _createForOfIteratorHelper$e((_decision$optionCombi5 = decision.optionCombinations) !== null && _decision$optionCombi5 !== void 0 ? _decision$optionCombi5 : []),
27821
- _step16;
28141
+ var _iterator21 = _createForOfIteratorHelper$e((_decision$optionCombi6 = decision.optionCombinations) !== null && _decision$optionCombi6 !== void 0 ? _decision$optionCombi6 : []),
28142
+ _step21;
27822
28143
  try {
27823
- for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
28144
+ for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {
27824
28145
  var _combination$projectA10, _combination$projectA11;
27825
- var combination = _step16.value;
27826
- var _iterator17 = _createForOfIteratorHelper$e((_combination$projectA10 = (_combination$projectA11 = combination.projectActions) === null || _combination$projectA11 === void 0 ? void 0 : _combination$projectA11.setFeatureDefault) !== null && _combination$projectA10 !== void 0 ? _combination$projectA10 : []),
27827
- _step17;
28146
+ var combination = _step21.value;
28147
+ var _iterator22 = _createForOfIteratorHelper$e((_combination$projectA10 = (_combination$projectA11 = combination.projectActions) === null || _combination$projectA11 === void 0 ? void 0 : _combination$projectA11.setFeatureDefault) !== null && _combination$projectA10 !== void 0 ? _combination$projectA10 : []),
28148
+ _step22;
27828
28149
  try {
27829
- for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
28150
+ for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {
27830
28151
  var _action$featureNo4, _byFeature$get;
27831
- var action = _step17.value;
28152
+ var action = _step22.value;
27832
28153
  var featureNo = (_action$featureNo4 = action.featureNo) === null || _action$featureNo4 === void 0 ? void 0 : _action$featureNo4.toString();
27833
28154
  if (!featureNo) continue;
27834
28155
  var list = (_byFeature$get = byFeature.get(featureNo)) !== null && _byFeature$get !== void 0 ? _byFeature$get : [];
@@ -27836,21 +28157,21 @@ var IDMEngine = /*#__PURE__*/function () {
27836
28157
  byFeature.set(featureNo, list);
27837
28158
  }
27838
28159
  } catch (err) {
27839
- _iterator17.e(err);
28160
+ _iterator22.e(err);
27840
28161
  } finally {
27841
- _iterator17.f();
28162
+ _iterator22.f();
27842
28163
  }
27843
28164
  }
27844
28165
  } catch (err) {
27845
- _iterator16.e(err);
28166
+ _iterator21.e(err);
27846
28167
  } finally {
27847
- _iterator16.f();
28168
+ _iterator21.f();
27848
28169
  }
27849
28170
  }
27850
28171
  } catch (err) {
27851
- _iterator15.e(err);
28172
+ _iterator20.e(err);
27852
28173
  } finally {
27853
- _iterator15.f();
28174
+ _iterator20.f();
27854
28175
  }
27855
28176
  this.featureDefaultIndex = {
27856
28177
  sources: sources,
@@ -27865,13 +28186,15 @@ var IDMEngine = /*#__PURE__*/function () {
27865
28186
  value: function setFeatureDefaultKey(featureNo) {
27866
28187
  var decisions = this.type2DefaultsByFeature().get(featureNo);
27867
28188
  if (!decisions) return undefined;
27868
- var _iterator18 = _createForOfIteratorHelper$e(decisions),
27869
- _step18;
28189
+ var _iterator23 = _createForOfIteratorHelper$e(decisions),
28190
+ _step23;
27870
28191
  try {
27871
- for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
28192
+ for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {
27872
28193
  var _combination$projectA12;
27873
- var decision = _step18.value;
27874
- var _ref12 = this.getMatchingOptionCombination(decision.optionCombinations, decision.decisionNo),
28194
+ var decision = _step23.value;
28195
+ // A decision evalType2Decision also visits would report WC_0012 twice per convergence pass — a DISABLED one it skips
28196
+ // entirely, so there the warning has to come from here.
28197
+ var _ref12 = this.getMatchingOptionCombination(decision.optionCombinations, decision.enabled === false ? decision.decisionNo : undefined),
27875
28198
  _ref13 = _slicedToArray__default["default"](_ref12, 1),
27876
28199
  combination = _ref13[0];
27877
28200
  var key = combination === null || combination === void 0 || (_combination$projectA12 = combination.projectActions) === null || _combination$projectA12 === void 0 || (_combination$projectA12 = _combination$projectA12.setFeatureDefault) === null || _combination$projectA12 === void 0 || (_combination$projectA12 = _combination$projectA12.find(function (a) {
@@ -27881,9 +28204,9 @@ var IDMEngine = /*#__PURE__*/function () {
27881
28204
  if (key) return key;
27882
28205
  }
27883
28206
  } catch (err) {
27884
- _iterator18.e(err);
28207
+ _iterator23.e(err);
27885
28208
  } finally {
27886
- _iterator18.f();
28209
+ _iterator23.f();
27887
28210
  }
27888
28211
  return undefined;
27889
28212
  }
@@ -27904,11 +28227,11 @@ var IDMEngine = /*#__PURE__*/function () {
27904
28227
  key: "updateIDMSpecificFeatures",
27905
28228
  value: function updateIDMSpecificFeatures() {
27906
28229
  //updaten idm planner specific options
27907
- var _iterator19 = _createForOfIteratorHelper$e(this.article.articleOptionStates.values()),
27908
- _step19;
28230
+ var _iterator24 = _createForOfIteratorHelper$e(this.article.articleOptionStates.values()),
28231
+ _step24;
27909
28232
  try {
27910
- for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
27911
- var ops = _step19.value;
28233
+ for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
28234
+ var ops = _step24.value;
27912
28235
  //when an option has no decisions the first visible optionValue has to be selected per default
27913
28236
  if (ops.val === undefined && ops.visibleCount) {
27914
28237
  // Prefer an authored type-2 default (when visible) over the arbitrary first-visible pick.
@@ -27931,9 +28254,9 @@ var IDMEngine = /*#__PURE__*/function () {
27931
28254
  }
27932
28255
  }
27933
28256
  } catch (err) {
27934
- _iterator19.e(err);
28257
+ _iterator24.e(err);
27935
28258
  } finally {
27936
- _iterator19.f();
28259
+ _iterator24.f();
27937
28260
  }
27938
28261
  }
27939
28262
  }, {
@@ -28020,11 +28343,11 @@ var IDMEngine = /*#__PURE__*/function () {
28020
28343
  key: "getConditionValuesOfCombination",
28021
28344
  value: function getConditionValuesOfCombination(combination, featureNo, optionKey) {
28022
28345
  var variantValues = {};
28023
- var _iterator20 = _createForOfIteratorHelper$e(combination.projectOptionsSetRefs),
28024
- _step20;
28346
+ var _iterator25 = _createForOfIteratorHelper$e(combination.projectOptionsSetRefs),
28347
+ _step25;
28025
28348
  try {
28026
- for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
28027
- var optionSetRef = _step20.value;
28349
+ for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {
28350
+ var optionSetRef = _step25.value;
28028
28351
  var optionList = this.getOptionListOfRef(optionSetRef);
28029
28352
  if (optionSetRef.featureNo.toString() == featureNo) {
28030
28353
  return optionKey && !(optionList !== null && optionList !== void 0 && optionList.options.includes(optionKey)) ? undefined : variantValues;
@@ -28033,9 +28356,9 @@ var IDMEngine = /*#__PURE__*/function () {
28033
28356
  variantValues[optionSetRef.featureNo.toString()] = optionList.options[0];
28034
28357
  }
28035
28358
  } catch (err) {
28036
- _iterator20.e(err);
28359
+ _iterator25.e(err);
28037
28360
  } finally {
28038
- _iterator20.f();
28361
+ _iterator25.f();
28039
28362
  }
28040
28363
  return variantValues;
28041
28364
  }
@@ -28061,18 +28384,18 @@ var IDMEngine = /*#__PURE__*/function () {
28061
28384
  })) return false;
28062
28385
  return _this8.decisionRemovesOption(restriction, featureNo, optionKey);
28063
28386
  };
28064
- var _iterator21 = _createForOfIteratorHelper$e(articleDecisions),
28065
- _step21;
28387
+ var _iterator26 = _createForOfIteratorHelper$e(articleDecisions),
28388
+ _step26;
28066
28389
  try {
28067
- for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {
28068
- var gate = _step21.value;
28390
+ for (_iterator26.s(); !(_step26 = _iterator26.n()).done;) {
28391
+ var gate = _step26.value;
28069
28392
  if (gate.decisionType != 2) continue;
28070
- var _iterator22 = _createForOfIteratorHelper$e(gate.optionCombinations),
28071
- _step22;
28393
+ var _iterator27 = _createForOfIteratorHelper$e(gate.optionCombinations),
28394
+ _step27;
28072
28395
  try {
28073
- for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {
28396
+ for (_iterator27.s(); !(_step27 = _iterator27.n()).done;) {
28074
28397
  var _combination$projectA13, _combination$projectA14;
28075
- var combination = _step22.value;
28398
+ var combination = _step27.value;
28076
28399
  var enabled = (_combination$projectA13 = (_combination$projectA14 = combination.projectActions) === null || _combination$projectA14 === void 0 ? void 0 : _combination$projectA14.enableDecision) !== null && _combination$projectA13 !== void 0 ? _combination$projectA13 : [];
28077
28400
  if (!enabled.some(function (ref) {
28078
28401
  return isGatedRestriction(Number(ref.decisionNo));
@@ -28080,15 +28403,15 @@ var IDMEngine = /*#__PURE__*/function () {
28080
28403
  variantValuesArr.push.apply(variantValuesArr, _toConsumableArray__default["default"](this.getValuesNotMatchingCombination(combination)));
28081
28404
  }
28082
28405
  } catch (err) {
28083
- _iterator22.e(err);
28406
+ _iterator27.e(err);
28084
28407
  } finally {
28085
- _iterator22.f();
28408
+ _iterator27.f();
28086
28409
  }
28087
28410
  }
28088
28411
  } catch (err) {
28089
- _iterator21.e(err);
28412
+ _iterator26.e(err);
28090
28413
  } finally {
28091
- _iterator21.f();
28414
+ _iterator26.f();
28092
28415
  }
28093
28416
  return variantValuesArr;
28094
28417
  }
@@ -28113,34 +28436,34 @@ var IDMEngine = /*#__PURE__*/function () {
28113
28436
  key: "getValuesNotMatchingCombination",
28114
28437
  value: function getValuesNotMatchingCombination(combination) {
28115
28438
  var variantValuesArr = [];
28116
- var _iterator23 = _createForOfIteratorHelper$e(combination.projectOptionsSetRefs),
28117
- _step23;
28439
+ var _iterator28 = _createForOfIteratorHelper$e(combination.projectOptionsSetRefs),
28440
+ _step28;
28118
28441
  try {
28119
- for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {
28120
- var optionSetRef = _step23.value;
28442
+ for (_iterator28.s(); !(_step28 = _iterator28.n()).done;) {
28443
+ var optionSetRef = _step28.value;
28121
28444
  var optionList = this.getOptionListOfRef(optionSetRef);
28122
28445
  if (!(optionList !== null && optionList !== void 0 && optionList.options.length) || ![0, 1, 2, 3].includes(optionList.operator)) continue;
28123
28446
  var conditionFeatureNo = optionSetRef.featureNo.toString();
28124
28447
  var ops = this.article.getArticleOptionState(conditionFeatureNo);
28125
28448
  if (!ops) continue;
28126
- var _iterator24 = _createForOfIteratorHelper$e(ops.visibleOPVKeys),
28127
- _step24;
28449
+ var _iterator29 = _createForOfIteratorHelper$e(ops.visibleOPVKeys),
28450
+ _step29;
28128
28451
  try {
28129
- for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
28130
- var candidate = _step24.value;
28452
+ for (_iterator29.s(); !(_step29 = _iterator29.n()).done;) {
28453
+ var candidate = _step29.value;
28131
28454
  if (this.evalValueWithOperator(optionList.operator, optionList.options, candidate)) continue;
28132
28455
  variantValuesArr.push(_defineProperty__default["default"]({}, conditionFeatureNo, candidate));
28133
28456
  }
28134
28457
  } catch (err) {
28135
- _iterator24.e(err);
28458
+ _iterator29.e(err);
28136
28459
  } finally {
28137
- _iterator24.f();
28460
+ _iterator29.f();
28138
28461
  }
28139
28462
  }
28140
28463
  } catch (err) {
28141
- _iterator23.e(err);
28464
+ _iterator28.e(err);
28142
28465
  } finally {
28143
- _iterator23.f();
28466
+ _iterator28.f();
28144
28467
  }
28145
28468
  return variantValuesArr;
28146
28469
  }
@@ -28240,18 +28563,18 @@ var IDMEngine = /*#__PURE__*/function () {
28240
28563
  }
28241
28564
 
28242
28565
  // this functions updates the images of OPVs that depend on rules
28243
- var _iterator25 = _createForOfIteratorHelper$e(this.article.articleOptionStates.values()),
28244
- _step25;
28566
+ var _iterator30 = _createForOfIteratorHelper$e(this.article.articleOptionStates.values()),
28567
+ _step30;
28245
28568
  try {
28246
- for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {
28247
- var ops = _step25.value;
28248
- var _iterator26 = _createForOfIteratorHelper$e(ops.visibleOptionValues),
28249
- _step26;
28569
+ for (_iterator30.s(); !(_step30 = _iterator30.n()).done;) {
28570
+ var ops = _step30.value;
28571
+ var _iterator31 = _createForOfIteratorHelper$e(ops.visibleOptionValues),
28572
+ _step31;
28250
28573
  try {
28251
- for (_iterator26.s(); !(_step26 = _iterator26.n()).done;) {
28252
- var _step26$value = _slicedToArray__default["default"](_step26.value, 2),
28253
- jKey = _step26$value[0],
28254
- opv = _step26$value[1];
28574
+ for (_iterator31.s(); !(_step31 = _iterator31.n()).done;) {
28575
+ var _step31$value = _slicedToArray__default["default"](_step31.value, 2),
28576
+ jKey = _step31$value[0],
28577
+ opv = _step31$value[1];
28255
28578
  if (opv.images) {
28256
28579
  var imageFound = false;
28257
28580
  for (var _i5 = 0; _i5 < opv.images.length; _i5++) {
@@ -28260,9 +28583,9 @@ var IDMEngine = /*#__PURE__*/function () {
28260
28583
  var _doUse = !((_image$decisionNos2 = _image.decisionNos) !== null && _image$decisionNos2 !== void 0 && _image$decisionNos2.length);
28261
28584
  if ((_image$decisionNos3 = _image.decisionNos) !== null && _image$decisionNos3 !== void 0 && _image$decisionNos3.length) {
28262
28585
  for (var _j2 = 0; _j2 < _image.decisionNos.length; _j2++) {
28263
- var _decision4 = catalogData.getDecisionsByNo([_image.decisionNos[_j2]])[0];
28264
- if (!_decision4) continue;
28265
- var _ref25 = this.getMatchingOptionCombination(_decision4.optionCombinations, _decision4.decisionNo),
28586
+ var _decision5 = catalogData.getDecisionsByNo([_image.decisionNos[_j2]])[0];
28587
+ if (!_decision5) continue;
28588
+ var _ref25 = this.getMatchingOptionCombination(_decision5.optionCombinations, _decision5.decisionNo),
28266
28589
  _ref26 = _slicedToArray__default["default"](_ref25, 1),
28267
28590
  _combination2 = _ref26[0];
28268
28591
  if (_combination2) {
@@ -28281,18 +28604,18 @@ var IDMEngine = /*#__PURE__*/function () {
28281
28604
  }
28282
28605
  }
28283
28606
  } catch (err) {
28284
- _iterator26.e(err);
28607
+ _iterator31.e(err);
28285
28608
  } finally {
28286
- _iterator26.f();
28609
+ _iterator31.f();
28287
28610
  }
28288
28611
  }
28289
28612
 
28290
28613
  // this function calculates an Svg to the current configuration if neccessary (SVG Tausch)
28291
28614
  // if the Article has no SVG Tausch nothing is done
28292
28615
  } catch (err) {
28293
- _iterator25.e(err);
28616
+ _iterator30.e(err);
28294
28617
  } finally {
28295
- _iterator25.f();
28618
+ _iterator30.f();
28296
28619
  }
28297
28620
  var newSVGFile = null;
28298
28621
  var svgChangedViaSvgTausch = false;
@@ -28307,6 +28630,9 @@ var IDMEngine = /*#__PURE__*/function () {
28307
28630
  }
28308
28631
  }
28309
28632
  return;
28633
+ } else if (!this.article.actPlannerData) {
28634
+ // An item with SVGs that is NOT a planner article has no actPlannerData — legal data (e.g. a partlist component), nothing to swap.
28635
+ return;
28310
28636
  } else {
28311
28637
  var plannerCatArt = this.article.catalogArticle.catalogPlannerArticle;
28312
28638
  var svgs = this.article.catalogArticle.svgs;
@@ -28317,13 +28643,13 @@ var IDMEngine = /*#__PURE__*/function () {
28317
28643
  var svgValid = !((_svg$decisionNos = svg.decisionNos) !== null && _svg$decisionNos !== void 0 && _svg$decisionNos.length);
28318
28644
  if ((_svg$decisionNos2 = svg.decisionNos) !== null && _svg$decisionNos2 !== void 0 && _svg$decisionNos2.length) {
28319
28645
  for (var _j = 0; _j < svg.decisionNos.length; _j++) {
28320
- var _decision3 = catalogData.getDecisionsByNo([svg.decisionNos[_j]])[0];
28321
- if (!_decision3) continue;
28322
- var _ref23 = this.getMatchingOptionCombination(_decision3.optionCombinations, _decision3.decisionNo),
28646
+ var _decision4 = catalogData.getDecisionsByNo([svg.decisionNos[_j]])[0];
28647
+ if (!_decision4) continue;
28648
+ var _ref23 = this.getMatchingOptionCombination(_decision4.optionCombinations, _decision4.decisionNo),
28323
28649
  _ref24 = _slicedToArray__default["default"](_ref23, 1),
28324
28650
  _combination = _ref24[0];
28325
28651
  if (_combination) {
28326
- svgValid = _decision3;
28652
+ svgValid = _decision4;
28327
28653
  break;
28328
28654
  }
28329
28655
  }
@@ -28399,6 +28725,138 @@ function _arrayLikeToArray$d(r, a) { (null == a || a > r.length) && (a = r.lengt
28399
28725
  function ownKeys$i(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
28400
28726
  function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$i(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
28401
28727
  var LOG$f = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
28728
+
28729
+ /**
28730
+ * Output formats a COMPUTED NUMBER field can request through its prefix. The computation itself is
28731
+ * generic (placeholder substitution + integer arithmetic, see evaluateComputedNumber); a format only
28732
+ * decides how the resulting number is rendered. Add a prefix here to support another number scheme.
28733
+ */
28734
+ var COMPUTED_NUMBER_FORMATS = {
28735
+ // EAN-14: 12-digit body, GS1 check digit, leading packaging indicator '0'.
28736
+ 'EAN14:': function EAN14(value) {
28737
+ var body = String(value).padStart(12, '0');
28738
+ return '0' + body + gs1CheckDigit(body);
28739
+ }
28740
+ };
28741
+
28742
+ /** The format prefix this value carries, or undefined when it is a literal rather than a formula. */
28743
+ function computedNumberFormatOf(value) {
28744
+ if (typeof value !== 'string') return undefined;
28745
+ return Object.keys(COMPUTED_NUMBER_FORMATS).find(function (prefix) {
28746
+ return value.startsWith(prefix);
28747
+ });
28748
+ }
28749
+
28750
+ /** True when this field holds a computed-number FORMULA instead of a literal number. */
28751
+ function isComputedNumber(value) {
28752
+ return computedNumberFormatOf(value) !== undefined;
28753
+ }
28754
+
28755
+ /**
28756
+ * Reads a property the CATALOG names (template placeholders like `{article.typeNr}`) off an object — the one
28757
+ * place where a runtime string indexes typed instances, so the dynamic access is not scattered as casts.
28758
+ */
28759
+ function dynamicProperty(source, key) {
28760
+ return Reflect.get(source, key);
28761
+ }
28762
+
28763
+ /** The option key of a group member, which may carry an assigned number as `<optionKey>=<number>`. */
28764
+ function optionGroupMemberKey(member) {
28765
+ return member.split('=')[0].trim();
28766
+ }
28767
+
28768
+ /** GS1 check digit over a 12/13-digit body: weights 3 and 1 from the left, complement to the next ten. */
28769
+ function gs1CheckDigit(body) {
28770
+ var digits = body.padStart(13, '0');
28771
+ var sum = 0;
28772
+ for (var i = 0; i < digits.length; i++) sum += Number(digits[i]) * (i % 2 === 0 ? 3 : 1);
28773
+ return (10 - sum % 10) % 10;
28774
+ }
28775
+
28776
+ /**
28777
+ * Evaluates `+`, `-`, `*` and parentheses over integers — no identifiers, no properties, no function calls,
28778
+ * so a catalog-authored expression can only ever produce a number. Undefined on anything unparseable.
28779
+ */
28780
+ function evaluateIntegerExpression(expression) {
28781
+ var tokens = expression.match(/\d+|[+\-*()]/g);
28782
+ if (!tokens || tokens.join('') !== expression.replace(/\s+/g, '')) return undefined;
28783
+ var position = 0;
28784
+ /** The next token without consuming it. */
28785
+ var peek = function peek() {
28786
+ return tokens[position];
28787
+ };
28788
+ /** sum := product (('+' | '-') product)* */
28789
+ var parseSum = function parseSum() {
28790
+ var left = parseProduct();
28791
+ if (left === undefined) return undefined;
28792
+ while (peek() === '+' || peek() === '-') {
28793
+ var operator = tokens[position++];
28794
+ var right = parseProduct();
28795
+ if (right === undefined) return undefined;
28796
+ left = operator === '+' ? left + right : left - right;
28797
+ // Past 2^53 the arithmetic silently loses precision — a wrong EAN is worse than none.
28798
+ if (!Number.isSafeInteger(left)) return undefined;
28799
+ }
28800
+ return left;
28801
+ };
28802
+ /** product := atom ('*' atom)* */
28803
+ var parseProduct = function parseProduct() {
28804
+ var left = parseAtom();
28805
+ if (left === undefined) return undefined;
28806
+ while (peek() === '*') {
28807
+ position++;
28808
+ var right = parseAtom();
28809
+ if (right === undefined) return undefined;
28810
+ left *= right;
28811
+ if (!Number.isSafeInteger(left)) return undefined;
28812
+ }
28813
+ return left;
28814
+ };
28815
+ /** atom := integer | '(' sum ')' */
28816
+ var parseAtom = function parseAtom() {
28817
+ var token = tokens[position];
28818
+ if (token === undefined) return undefined;
28819
+ if (token === '(') {
28820
+ position++;
28821
+ var inner = parseSum();
28822
+ if (inner === undefined || tokens[position] !== ')') return undefined;
28823
+ position++;
28824
+ return inner;
28825
+ }
28826
+ if (!/^\d+$/.test(token)) return undefined;
28827
+ position++;
28828
+ var literal = Number(token);
28829
+ // An oversized literal would already be rounded here (and print as 1e+21 downstream).
28830
+ return Number.isSafeInteger(literal) ? literal : undefined;
28831
+ };
28832
+ var result = parseSum();
28833
+ return result === undefined || position !== tokens.length || !Number.isFinite(result) ? undefined : result;
28834
+ }
28835
+
28836
+ /** Comparison for a template token's optional operator: numeric when both sides are numeric, else by string. */
28837
+ function compareTemplateValues(left, right, operator) {
28838
+ var leftNumber = Number(left);
28839
+ var rightNumber = Number(right);
28840
+ var numeric = right !== undefined && left !== null && left !== '' && Number.isFinite(leftNumber) && Number.isFinite(rightNumber);
28841
+ var a = numeric ? leftNumber : String(left !== null && left !== void 0 ? left : '');
28842
+ var b = numeric ? rightNumber : String(right !== null && right !== void 0 ? right : '');
28843
+ switch (operator) {
28844
+ case '==':
28845
+ return a === b;
28846
+ case '!=':
28847
+ return a !== b;
28848
+ case '>=':
28849
+ return a >= b;
28850
+ case '<=':
28851
+ return a <= b;
28852
+ case '>':
28853
+ return a > b;
28854
+ case '<':
28855
+ return a < b;
28856
+ default:
28857
+ return false;
28858
+ }
28859
+ }
28402
28860
  var DivaArticle = /*#__PURE__*/function () {
28403
28861
  function DivaArticle(set, _basketId, initParams, articleData, catalogData) {
28404
28862
  var _this = this,
@@ -28433,6 +28891,8 @@ var DivaArticle = /*#__PURE__*/function () {
28433
28891
  }
28434
28892
  return undefined;
28435
28893
  });
28894
+ /** `{article.x}` reads currently being resolved — a template-evaluating getter (articleEAN, typeNr) must not re-enter itself. */
28895
+ _defineProperty__default["default"](this, "resolvingTemplateKeys", void 0);
28436
28896
  this.article = {
28437
28897
  set: set,
28438
28898
  basketId: _basketId,
@@ -28745,10 +29205,21 @@ var DivaArticle = /*#__PURE__*/function () {
28745
29205
  key: "deleted",
28746
29206
  get: function get() {
28747
29207
  return !!this.article.deleted;
28748
- },
29208
+ }
29209
+
29210
+ /** True only while this article runs its after-load init — see loadPartlistArticle. */,
28749
29211
  set: function set(deleted) {
28750
29212
  this.article.deleted = deleted;
28751
29213
  }
29214
+ }, {
29215
+ key: "loadingPartlistChild",
29216
+ get: /** Whether this article is still running its after-load init as a partlist child. */
29217
+ function get() {
29218
+ return !!this.article.loadingPartlistChild;
29219
+ },
29220
+ set: function set(loading) {
29221
+ this.article.loadingPartlistChild = loading;
29222
+ }
28752
29223
  }, {
28753
29224
  key: "toDeleteAfterInit",
28754
29225
  get: function get() {
@@ -29314,7 +29785,28 @@ var DivaArticle = /*#__PURE__*/function () {
29314
29785
  }, {
29315
29786
  key: "articleEAN",
29316
29787
  get: function get() {
29317
- return this.article.catalogArticle.articleEAN;
29788
+ var ean = this.article.catalogArticle.articleEAN;
29789
+ // A variant article's EAN is a function of the selected axes — such articles hold a FORMULA instead; plain EANs pass untouched.
29790
+ return isComputedNumber(ean) ? this.evaluateComputedNumber(ean) : ean;
29791
+ }
29792
+
29793
+ /**
29794
+ * Evaluates a computed-number formula `<FORMAT>:<integer arithmetic over {token} placeholders>`, e.g.
29795
+ * `EAN14:407142261118 + {1095.indexIn:EAN_S1_W}*1` — a counter over the variant axes; the FORMAT prefix only
29796
+ * renders the number (EAN14: zero-pad + GS1 check digit). Unresolvable parts return a visible `___…___` marker.
29797
+ */
29798
+ }, {
29799
+ key: "evaluateComputedNumber",
29800
+ value: function evaluateComputedNumber(formula) {
29801
+ var prefix = computedNumberFormatOf(formula);
29802
+ if (!prefix) return formula;
29803
+ var body = formula.slice(prefix.length);
29804
+ var resolved = this.convertTemplateToCodex(body);
29805
+ var value = evaluateIntegerExpression(resolved);
29806
+ if (value === undefined || value < 0) return '___' + prefix + ' not computable: "' + body.trim() + '" -> "' + resolved.trim() + '"___';
29807
+ var digits = Math.trunc(value).toString();
29808
+ if (digits.length > 12) return '___' + prefix + ' overflow: ' + digits + ' exceeds 12 digits___';
29809
+ return COMPUTED_NUMBER_FORMATS[prefix](value);
29318
29810
  }
29319
29811
  }, {
29320
29812
  key: "getArticleOptionStateFlat",
@@ -29494,7 +29986,13 @@ var DivaArticle = /*#__PURE__*/function () {
29494
29986
  } finally {
29495
29987
  _iterator7.f();
29496
29988
  }
29497
- return this.article.typeNr;
29989
+ return this.evaluatedArticleTypeNr;
29990
+ }
29991
+ /** The record's typeNr — on IDM it falls back to eanNumber, which may hold a computed-number FORMULA, evaluated here. */
29992
+ }, {
29993
+ key: "evaluatedArticleTypeNr",
29994
+ get: function get() {
29995
+ return isComputedNumber(this.article.typeNr) ? this.evaluateComputedNumber(this.article.typeNr) : this.article.typeNr;
29498
29996
  }
29499
29997
  }, {
29500
29998
  key: "articlePrices",
@@ -30022,6 +30520,8 @@ var DivaArticle = /*#__PURE__*/function () {
30022
30520
  }, {
30023
30521
  key: "configArticleCodex",
30024
30522
  get: function get() {
30523
+ var _this$article$configA;
30524
+ if ((_this$article$configA = this.article.configArticleCodex) !== null && _this$article$configA !== void 0 && _this$article$configA.includes('{')) return this.convertTemplateToCodex(this.article.configArticleCodex);
30025
30525
  return this.article.configArticleCodex;
30026
30526
  },
30027
30527
  set: function set(codex) {
@@ -30437,6 +30937,15 @@ var DivaArticle = /*#__PURE__*/function () {
30437
30937
  newPartlistArticle.hasPartlistArticleInitialized = this.hasPartlistArticleInitialized;
30438
30938
  this.article.partlistArticles[newPartlistArticle.basketId] = newPartlistArticle;
30439
30939
  }
30940
+ /**
30941
+ * Drops one partlist child (and with it its own subtree) from this article again — used when the child's
30942
+ * after-load init fails after it was registered, so no half-initialized child stays in the tree.
30943
+ */
30944
+ }, {
30945
+ key: "removePartlistArticle",
30946
+ value: function removePartlistArticle(basketId) {
30947
+ delete this.article.partlistArticles[basketId];
30948
+ }
30440
30949
  }, {
30441
30950
  key: "deletePartlistArticles",
30442
30951
  value: function deletePartlistArticles() {
@@ -31192,7 +31701,7 @@ var DivaArticle = /*#__PURE__*/function () {
31192
31701
  break;
31193
31702
  }
31194
31703
  _context.next = 4;
31195
- return Promise.resolve().then(function () { return require('./ShelfPlanner-65f4da8e.js'); });
31704
+ return Promise.resolve().then(function () { return require('./ShelfPlanner-8fa17486.js'); });
31196
31705
  case 4:
31197
31706
  _yield$import = _context.sent;
31198
31707
  ShelfPlanner = _yield$import["default"];
@@ -31544,7 +32053,7 @@ var DivaArticle = /*#__PURE__*/function () {
31544
32053
  codex: this.articleCodex,
31545
32054
  singlePrice: this.price,
31546
32055
  image: this.image ? catalogData.getCatImageURL(this.image, '') : undefined,
31547
- typeNr: this.article.typeNr,
32056
+ typeNr: this.evaluatedArticleTypeNr,
31548
32057
  width: this.calcWidth,
31549
32058
  height: this.calcHeight,
31550
32059
  depth: this.calcDepth,
@@ -31814,39 +32323,97 @@ var DivaArticle = /*#__PURE__*/function () {
31814
32323
  get: function get() {
31815
32324
  return this._engine;
31816
32325
  }
32326
+
32327
+ /**
32328
+ * Substitutes `{identifier.accessor}` placeholders in a catalog-authored template (order codices, retail
32329
+ * article numbers, EAN formulas). `identifier` is `article`, `parent` or a featureNo; `accessor` is a property
32330
+ * name, optionally with a comparison (`==`, `!=`, …) that substitutes the comparison RESULT instead.
32331
+ */
31817
32332
  }, {
31818
32333
  key: "convertTemplateToCodex",
31819
32334
  value: function convertTemplateToCodex(codex) {
31820
- var evaluatedOrderCodex = codex;
31821
- var array = _toConsumableArray__default["default"](evaluatedOrderCodex.matchAll(/\{(.*?)\}/g));
31822
- var toRepace = [];
31823
- for (var i = 0; i < array.length; i++) {
31824
- var expressions = array[i][1].split('.');
31825
- var identifier = expressions[0];
31826
- var _this$parseOperator = this.parseOperator(expressions[1]),
31827
- operator = _this$parseOperator.operator;
31828
- _this$parseOperator.key;
31829
- var value = _this$parseOperator.value;
31830
- var ruleExtension = operator ? ' ' + operator + ' ' + value : '';
31831
- if (identifier === 'article') {
31832
- toRepace.push(eval('this[key]' + ruleExtension));
31833
- } else if (identifier === 'parent') {
31834
- toRepace.push(eval('this[key]' + ruleExtension));
31835
- } else {
31836
- // IDM option codexes carry no 'OPT' prefix — the eval must look up the same codex the guard checked.
31837
- var optionStateCodex = (!this.CatalogData.isIDMFormat ? 'OPT' : '') + identifier;
31838
- if (this.getArticleOptionState(optionStateCodex)) {
31839
- toRepace.push(eval('this.getArticleOptionState(optionStateCodex)[key]' + ruleExtension));
31840
- } else {
31841
- toRepace.push('___Option: "' + identifier + '" not found!___');
31842
- }
32335
+ var _this5 = this;
32336
+ return codex.replace(/\{(.*?)\}/g, function (_match, expression) {
32337
+ return _this5.resolveTemplateToken(String(expression));
32338
+ });
32339
+ }
32340
+ }, {
32341
+ key: "resolveTemplateToken",
32342
+ value: /** Resolves ONE `{…}` template token to its replacement text ('' when the value is absent). */
32343
+ function resolveTemplateToken(expression) {
32344
+ var _expressions$;
32345
+ var expressions = expression.split('.');
32346
+ var identifier = expressions[0];
32347
+ var _this$parseOperator = this.parseOperator((_expressions$ = expressions[1]) !== null && _expressions$ !== void 0 ? _expressions$ : ''),
32348
+ operator = _this$parseOperator.operator,
32349
+ key = _this$parseOperator.key,
32350
+ value = _this$parseOperator.value;
32351
+ var resolved;
32352
+ if (identifier === 'article') {
32353
+ var _this$resolvingTempla;
32354
+ // Lazily built: prototype-only instances (tests, clones) never run the field initializers.
32355
+ var resolving = (_this$resolvingTempla = this.resolvingTemplateKeys) !== null && _this$resolvingTempla !== void 0 ? _this$resolvingTempla : this.resolvingTemplateKeys = new Set();
32356
+ if (resolving.has(key)) return '___article: "' + key + '" refers to itself!___';
32357
+ resolving.add(key);
32358
+ try {
32359
+ resolved = dynamicProperty(this, key);
32360
+ } finally {
32361
+ resolving["delete"](key);
31843
32362
  }
31844
- }
31845
- for (var _i7 = 0; _i7 < toRepace.length; _i7++) {
31846
- var _toRepace$_i;
31847
- evaluatedOrderCodex = evaluatedOrderCodex.replace(/\{(.*?)\}/, (_toRepace$_i = toRepace[_i7]) !== null && _toRepace$_i !== void 0 ? _toRepace$_i : '');
31848
- }
31849
- return evaluatedOrderCodex;
32363
+ } else if (identifier === 'parent') {
32364
+ // The EMBEDDING article of a partlist component.
32365
+ var parent = this.partListParentArticle;
32366
+ if (!parent) return '___parent: "' + key + '" — this article has no partlist parent!___';
32367
+ resolved = dynamicProperty(parent, key);
32368
+ } else {
32369
+ var optionStateKey = (!this.CatalogData.isIDMFormat ? 'OPT' : '') + identifier;
32370
+ var optionState = this.getArticleOptionState(optionStateKey);
32371
+ if (!optionState) return '___Option: "' + identifier + '" not found!___';
32372
+ var _key$split = key.split(':'),
32373
+ _key$split2 = _slicedToArray__default["default"](_key$split, 2),
32374
+ accessor = _key$split2[0],
32375
+ groupKey = _key$split2[1];
32376
+ if (accessor.trim() === 'indexIn') resolved = this.resolveIndexInOptionGroup(optionState.valCodex, groupKey === null || groupKey === void 0 ? void 0 : groupKey.trim());else if (accessor.trim() === 'valueIn') resolved = this.resolveValueInOptionGroup(optionState.valCodex, groupKey === null || groupKey === void 0 ? void 0 : groupKey.trim());else resolved = dynamicProperty(optionState, accessor.trim());
32377
+ }
32378
+ if (operator === undefined) return resolved === undefined || resolved === null ? '' : String(resolved);
32379
+ return String(compareTemplateValues(resolved, value, operator));
32380
+ }
32381
+
32382
+ /**
32383
+ * Position of `optionKey` within the ordered option group `groupKey`. The GROUP — not the feature's own
32384
+ * value list — is the source of truth: positions differ per article family, and dependency decisions
32385
+ * narrow the visible list at runtime.
32386
+ */
32387
+ }, {
32388
+ key: "resolveIndexInOptionGroup",
32389
+ value: function resolveIndexInOptionGroup(optionKey, groupKey) {
32390
+ var _this$CatalogData$idm, _members$findIndex;
32391
+ if (!optionKey || !groupKey) return undefined;
32392
+ var members = (_this$CatalogData$idm = this.CatalogData.idmOptionGroups) === null || _this$CatalogData$idm === void 0 ? void 0 : _this$CatalogData$idm[groupKey];
32393
+ var index = (_members$findIndex = members === null || members === void 0 ? void 0 : members.findIndex(function (member) {
32394
+ return optionGroupMemberKey(member) === optionKey;
32395
+ })) !== null && _members$findIndex !== void 0 ? _members$findIndex : -1;
32396
+ return index < 0 ? undefined : index;
32397
+ }
32398
+
32399
+ /**
32400
+ * The NUMBER a group assigns to `optionKey` (`<optionKey>=<number>` on the member) — supplier numbering has
32401
+ * holes no single stride reproduces; a member without `=` falls back to its position. Returned as the
32402
+ * WRITTEN string because codex digits may carry leading zeros ('06').
32403
+ */
32404
+ }, {
32405
+ key: "resolveValueInOptionGroup",
32406
+ value: function resolveValueInOptionGroup(optionKey, groupKey) {
32407
+ var _this$CatalogData$idm2, _members$findIndex2, _members$index$split$;
32408
+ if (!optionKey || !groupKey) return undefined;
32409
+ var members = (_this$CatalogData$idm2 = this.CatalogData.idmOptionGroups) === null || _this$CatalogData$idm2 === void 0 ? void 0 : _this$CatalogData$idm2[groupKey];
32410
+ var index = (_members$findIndex2 = members === null || members === void 0 ? void 0 : members.findIndex(function (member) {
32411
+ return optionGroupMemberKey(member) === optionKey;
32412
+ })) !== null && _members$findIndex2 !== void 0 ? _members$findIndex2 : -1;
32413
+ if (!members || index < 0) return undefined;
32414
+ var assigned = (_members$index$split$ = members[index].split('=')[1]) === null || _members$index$split$ === void 0 ? void 0 : _members$index$split$.trim();
32415
+ if (assigned === undefined) return index;
32416
+ return assigned !== '' && Number.isFinite(Number(assigned)) ? assigned : undefined;
31850
32417
  }
31851
32418
  }, {
31852
32419
  key: "parseOperator",
@@ -31861,16 +32428,6 @@ var DivaArticle = /*#__PURE__*/function () {
31861
32428
  key: expression.split('!=')[0].trim(),
31862
32429
  value: expression.split('!=')[1].trim()
31863
32430
  };
31864
- if (expression.includes('>')) return {
31865
- operator: '>',
31866
- key: expression.split('>')[0].trim(),
31867
- value: expression.split('>')[1].trim()
31868
- };
31869
- if (expression.includes('<')) return {
31870
- operator: '<',
31871
- key: expression.split('<')[0].trim(),
31872
- value: expression.split('<')[1].trim()
31873
- };
31874
32431
  if (expression.includes('>=')) return {
31875
32432
  operator: '>=',
31876
32433
  key: expression.split('>=')[0].trim(),
@@ -31881,6 +32438,16 @@ var DivaArticle = /*#__PURE__*/function () {
31881
32438
  key: expression.split('<=')[0].trim(),
31882
32439
  value: expression.split('<=')[1].trim()
31883
32440
  };
32441
+ if (expression.includes('>')) return {
32442
+ operator: '>',
32443
+ key: expression.split('>')[0].trim(),
32444
+ value: expression.split('>')[1].trim()
32445
+ };
32446
+ if (expression.includes('<')) return {
32447
+ operator: '<',
32448
+ key: expression.split('<')[0].trim(),
32449
+ value: expression.split('<')[1].trim()
32450
+ };
31884
32451
  return {
31885
32452
  operator: undefined,
31886
32453
  key: expression.trim(),
@@ -31911,7 +32478,11 @@ var DivaArticle = /*#__PURE__*/function () {
31911
32478
  clonedArticle.article.partlistArticles = {};
31912
32479
  clonedArticle.article.previousPartlistArticles = {};
31913
32480
  for (var key in this.partlistArticles) {
31914
- clonedArticle.article.partlistArticles[key] = this.partlistArticles[key].cloneArticle(set);
32481
+ var clonedChild = this.partlistArticles[key].cloneArticle(set);
32482
+ // `{ ...this.article }` copied the LIVE parent reference — a sandbox that reconfigures the clone's parent
32483
+ // (merged option groups, variant sweeps) would otherwise write into the user's real configuration.
32484
+ clonedChild.article.partListParentArticle = clonedArticle;
32485
+ clonedArticle.article.partlistArticles[key] = clonedChild;
31915
32486
  }
31916
32487
  return clonedArticle;
31917
32488
  }
@@ -32022,7 +32593,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32022
32593
  break;
32023
32594
  case 20:
32024
32595
  _loop = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop() {
32025
- var articlesObj, catalog, articles, _i, _set$actions, _set$actions$openModa, index, articleCodex, articlesToLoadMore;
32596
+ var articlesObj, catalog, articles, _i, _set$actions, _set$actions$openModa, _set$api$getI18n$t, _set$api$getI18n, index, articleCodex, articlesToLoadMore;
32026
32597
  return _regeneratorRuntime__default["default"].wrap(function _loop$(_context2) {
32027
32598
  while (1) switch (_context2.prev = _context2.next) {
32028
32599
  case 0:
@@ -32056,7 +32627,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32056
32627
  });
32057
32628
  articleCodex = articles[index].articleCodex;
32058
32629
  (_set$actions = set.actions) === null || _set$actions === void 0 || (_set$actions$openModa = _set$actions.openModal) === null || _set$actions$openModa === void 0 || _set$actions$openModa.call(_set$actions, {
32059
- title: set.api.getI18n().t('configurator.article_not_found'),
32630
+ title: (_set$api$getI18n$t = (_set$api$getI18n = set.api.getI18n()) === null || _set$api$getI18n === void 0 ? void 0 : _set$api$getI18n.t('configurator.article_not_found')) !== null && _set$api$getI18n$t !== void 0 ? _set$api$getI18n$t : 'configurator.article_not_found',
32060
32631
  content: articleCodex,
32061
32632
  accept: true
32062
32633
  });
@@ -32191,11 +32762,26 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32191
32762
  case 0:
32192
32763
  newEDOExtraArticles = [];
32193
32764
  partlistArticlesToLoad = [];
32194
- valuesArray = [];
32765
+ valuesArray = []; // A partlist child's after-load init (toDoAfterArticleLoaded) has already initialized its config, evaluated
32766
+ // its own partlist and filled its empty options while registered in the tree - there is nothing left for
32767
+ // this pass to do for it. It MUST NOT run the set-wide sibling update from inside a child init either: with
32768
+ // two top-level articles that each own visible partlist children, that pass reloads the OTHER parent, whose
32769
+ // children's inits reload this parent again, and so on without end. Before the child was registered ahead
32770
+ // of its init this call was a no-op for it (an unregistered target was dropped above); keep it that way.
32771
+ if (!(from === 'initializingPartlist')) {
32772
+ _context6.next = 5;
32773
+ break;
32774
+ }
32775
+ return _context6.abrupt("return", {
32776
+ newEDOExtraArticles: newEDOExtraArticles,
32777
+ targetArticlesToUpdate: [],
32778
+ partlistArticlesToLoad: partlistArticlesToLoad
32779
+ });
32780
+ case 5:
32195
32781
  i = 0;
32196
- case 4:
32782
+ case 6:
32197
32783
  if (!(i < targetArticlesToUpdate.length)) {
32198
- _context6.next = 40;
32784
+ _context6.next = 42;
32199
32785
  break;
32200
32786
  }
32201
32787
  valuesArray[i] = {};
@@ -32204,13 +32790,13 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32204
32790
  actArticle = actArticle.partListParentArticle.partlistArticles[actArticle.basketId];
32205
32791
  }
32206
32792
  if (!(!actArticle || actArticle.deleted)) {
32207
- _context6.next = 12;
32793
+ _context6.next = 14;
32208
32794
  break;
32209
32795
  }
32210
32796
  targetArticlesToUpdate.splice(i, 1);
32211
32797
  i--;
32212
- return _context6.abrupt("continue", 37);
32213
- case 12:
32798
+ return _context6.abrupt("continue", 39);
32799
+ case 14:
32214
32800
  if (targetArticlesWithNewValues.includes(targetArticlesToUpdate[i])) {
32215
32801
  valuesArray[i] = actArticle.getValidValues(_objectSpread$h({}, myValues), actArticle.CatalogData.mergeOptionsToSameOption);
32216
32802
  // Remember what the USER picked: a rule may hide that value for a while, and it has to come back when the rule frees it again.
@@ -32228,56 +32814,56 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32228
32814
  //only set config if valuesArray are not empty or the article is initializing
32229
32815
  newPLATL = void 0; // partlistarticle to load
32230
32816
  if (!(Object.entries(valuesArray[i]).length > 0 || from !== null && from !== void 0 && from.startsWith('initializing'))) {
32231
- _context6.next = 29;
32817
+ _context6.next = 31;
32232
32818
  break;
32233
32819
  }
32234
- _context6.next = 17;
32820
+ _context6.next = 19;
32235
32821
  return this.updateCfgValues(actArticle, valuesArray[i], {}, undefined, undefined, from == 'calcVariant');
32236
- case 17:
32822
+ case 19:
32237
32823
  newPLATL = _context6.sent;
32238
32824
  _actArticle$checkDefa = actArticle.checkDefaultGlobalOpt(valuesArray[i]), variantValues = _actArticle$checkDefa.variantValues, triggerUpdate = _actArticle$checkDefa.triggerUpdate;
32239
32825
  valuesArray[i] = variantValues;
32240
- _context6.next = 22;
32826
+ _context6.next = 24;
32241
32827
  return this.updateAccessoriesFromGlobalOption(valuesArray[i], actArticle);
32242
- case 22:
32828
+ case 24:
32243
32829
  if (!triggerUpdate) {
32244
- _context6.next = 26;
32830
+ _context6.next = 28;
32245
32831
  break;
32246
32832
  }
32247
- _context6.next = 25;
32833
+ _context6.next = 27;
32248
32834
  return this.updateCfgValues(actArticle, valuesArray[i], {}, undefined, undefined, from == 'calcVariant');
32249
- case 25:
32835
+ case 27:
32250
32836
  newPLATL = _context6.sent;
32251
- case 26:
32837
+ case 28:
32252
32838
  newEDOExtraArticles = this.checkEDOArticles(articles);
32253
- _context6.next = 32;
32839
+ _context6.next = 34;
32254
32840
  break;
32255
- case 29:
32256
- _context6.next = 31;
32257
- return this.updateCfgValues(actArticle, {}, {}, undefined, undefined, from == 'calcVariant');
32258
32841
  case 31:
32842
+ _context6.next = 33;
32843
+ return this.updateCfgValues(actArticle, {}, {}, undefined, undefined, from == 'calcVariant');
32844
+ case 33:
32259
32845
  newPLATL = _context6.sent;
32260
- case 32:
32261
- _context6.next = 34;
32262
- return this.updateEmptyOption(actArticle);
32263
32846
  case 34:
32847
+ _context6.next = 36;
32848
+ return this.updateEmptyOption(actArticle);
32849
+ case 36:
32264
32850
  pla = _context6.sent;
32265
32851
  if (pla !== undefined) newPLATL = pla;
32266
32852
  partlistArticlesToLoad = partlistArticlesToLoad.concat(newPLATL);
32267
- case 37:
32853
+ case 39:
32268
32854
  i++;
32269
- _context6.next = 4;
32855
+ _context6.next = 6;
32270
32856
  break;
32271
- case 40:
32272
- _context6.next = 42;
32273
- return this.triggerUpdateOnVisiblePartilstArticles(targetArticlesToUpdate, articles);
32274
32857
  case 42:
32858
+ _context6.next = 44;
32859
+ return this.triggerUpdateOnVisiblePartilstArticles(targetArticlesToUpdate, articles);
32860
+ case 44:
32275
32861
  return _context6.abrupt("return", {
32276
32862
  newEDOExtraArticles: newEDOExtraArticles,
32277
32863
  targetArticlesToUpdate: targetArticlesToUpdate,
32278
32864
  partlistArticlesToLoad: partlistArticlesToLoad
32279
32865
  });
32280
- case 43:
32866
+ case 45:
32281
32867
  case "end":
32282
32868
  return _context6.stop();
32283
32869
  }
@@ -32298,13 +32884,13 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32298
32884
  while (1) switch (_context7.prev = _context7.next) {
32299
32885
  case 0:
32300
32886
  if (!((_articles$targetArtic = articles[targetArticlesToUpdate[0]]) !== null && _articles$targetArtic !== void 0 && _articles$targetArtic.hasPartlistArticleVisibleInTree)) {
32301
- _context7.next = 13;
32887
+ _context7.next = 15;
32302
32888
  break;
32303
32889
  }
32304
32890
  _context7.t0 = _regeneratorRuntime__default["default"].keys(articles);
32305
32891
  case 2:
32306
32892
  if ((_context7.t1 = _context7.t0()).done) {
32307
- _context7.next = 13;
32893
+ _context7.next = 15;
32308
32894
  break;
32309
32895
  }
32310
32896
  key = _context7.t1.value;
@@ -32316,13 +32902,21 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32316
32902
  }
32317
32903
  return _context7.abrupt("continue", 2);
32318
32904
  case 8:
32319
- actArticle = articles[key];
32320
- _context7.next = 11;
32321
- return this.updateCfgValues(actArticle, {}, {});
32905
+ actArticle = articles[key]; // A reload has replaced this instance; updating the dead one loads articles into a detached branch.
32906
+ // An article still running its own after-load init must be skipped too — re-entering it here
32907
+ // restarts its partlist load and never terminates.
32908
+ if (!(actArticle.deleted || actArticle.loadingPartlistChild)) {
32909
+ _context7.next = 11;
32910
+ break;
32911
+ }
32912
+ return _context7.abrupt("continue", 2);
32322
32913
  case 11:
32914
+ _context7.next = 13;
32915
+ return this.updateCfgValues(actArticle, {}, {});
32916
+ case 13:
32323
32917
  _context7.next = 2;
32324
32918
  break;
32325
- case 13:
32919
+ case 15:
32326
32920
  case "end":
32327
32921
  return _context7.stop();
32328
32922
  }
@@ -32905,32 +33499,63 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32905
33499
  return _regeneratorRuntime__default["default"].wrap(function _callee15$(_context16) {
32906
33500
  while (1) switch (_context16.prev = _context16.next) {
32907
33501
  case 0:
32908
- this.checkPartlistDepth(article, doLoadItem);
32909
- //jeder neue Artikel sollte im Warenkorb als Zubehörartikel gelistet werden - es können auch mehrere sein
32910
- _context16.next = 3;
33502
+ if (this.checkPartlistDepth(article, doLoadItem)) {
33503
+ _context16.next = 2;
33504
+ break;
33505
+ }
33506
+ return _context16.abrupt("return");
33507
+ case 2:
33508
+ _context16.next = 4;
32911
33509
  return this.loadArticle(article.set, doLoadItem.ArticleCodex, this.partlistArticleInitData(article, doLoadItem));
32912
- case 3:
33510
+ case 4:
32913
33511
  nArticle = _context16.sent;
32914
33512
  if (!nArticle) {
32915
- _context16.next = 9;
33513
+ _context16.next = 21;
32916
33514
  break;
32917
33515
  }
32918
33516
  doLoadItem.BasketID = nArticle.basketId;
32919
- _context16.next = 8;
32920
- return this.toDoAfterArticleLoaded(nArticle, {}, nArticle.variantValuesForPla(nArticle.partlistArticleStandalone, (_doLoadItem$VariantVa = doLoadItem.VariantValues) !== null && _doLoadItem$VariantVa !== void 0 ? _doLoadItem$VariantVa : {}, newConfigValues !== null && newConfigValues !== void 0 ? newConfigValues : {}), 'initializingPartlist', doLoadItem.VariantItemData, true);
32921
- case 8:
33517
+
33518
+ // Register the child BEFORE its after-load init: the init evaluates the child's OWN partlist,
33519
+ // and those position gates resolve their condition through the article tree — an unregistered
33520
+ // child is invisible there, so every conditioned grandchild dropped on each parent reload.
33521
+ // The `loadingPartlistChild` flag keeps it out of the set-wide pass in
33522
+ // triggerUpdateOnVisiblePartilstArticles for exactly that window: without it, that pass walks
33523
+ // into the in-flight child, re-evaluates its partlist and re-enters this method — an endless
33524
+ // load loop (both measured 2026-09-03).
32922
33525
  article.addPartlistArticle(nArticle);
32923
- case 9:
33526
+ nArticle.loadingPartlistChild = true;
33527
+ _context16.prev = 9;
33528
+ _context16.next = 12;
33529
+ return this.toDoAfterArticleLoaded(nArticle, {}, nArticle.variantValuesForPla(nArticle.partlistArticleStandalone, (_doLoadItem$VariantVa = doLoadItem.VariantValues) !== null && _doLoadItem$VariantVa !== void 0 ? _doLoadItem$VariantVa : {}, newConfigValues !== null && newConfigValues !== void 0 ? newConfigValues : {}), 'initializingPartlist', doLoadItem.VariantItemData, true);
33530
+ case 12:
33531
+ _context16.next = 18;
33532
+ break;
33533
+ case 14:
33534
+ _context16.prev = 14;
33535
+ _context16.t0 = _context16["catch"](9);
33536
+ // Registered early only for the init's sake — a child whose init failed must not stay in the tree,
33537
+ // where tree evaluation and order lines would pick up its half-initialized state.
33538
+ article.removePartlistArticle(nArticle.basketId);
33539
+ throw _context16.t0;
33540
+ case 18:
33541
+ _context16.prev = 18;
33542
+ nArticle.loadingPartlistChild = false;
33543
+ return _context16.finish(18);
33544
+ case 21:
32924
33545
  case "end":
32925
33546
  return _context16.stop();
32926
33547
  }
32927
- }, _callee15, this);
33548
+ }, _callee15, this, [[9, 14, 18, 21]]);
32928
33549
  }));
32929
33550
  function loadPartlistArticle(_x47, _x48, _x49) {
32930
33551
  return _loadPartlistArticle.apply(this, arguments);
32931
33552
  }
32932
33553
  return loadPartlistArticle;
32933
33554
  }()
33555
+ /**
33556
+ * Whether the child may still be loaded. FALSE means the nesting limit is reached — the caller must stop, because
33557
+ * a cyclic partlist re-enters `loadPartlistArticle` and this is the only thing that ends the recursion.
33558
+ */
32934
33559
  }, {
32935
33560
  key: "checkPartlistDepth",
32936
33561
  value: function checkPartlistDepth(article, doLoadItem) {
@@ -32963,12 +33588,13 @@ var DivaArticleHandler = /*#__PURE__*/function () {
32963
33588
  text: "Aborted loading partlist article \"".concat(doLoadItem.ArticleCodex, "\" because the partlist nesting exceeded the maximum allowed depth of ").concat(PARTLIST_MAX_DEPTH, ". ") + "This usually means an article references itself or an ancestor as a partlist child. " + "Parent article: ".concat(article.articleCodex, ". Ancestor chain: ").concat(ancestorChain.join(' -> '), "."),
32964
33589
  accept: true
32965
33590
  });
32966
- return;
33591
+ return false;
32967
33592
  } else {
32968
33593
  article.set.getSetState.errorHandler(new DivaUtils.DivaError('Partlist nesting exceeded the maximum allowed depth – aborting load'));
32969
- return;
33594
+ return false;
32970
33595
  }
32971
33596
  }
33597
+ return true;
32972
33598
  }
32973
33599
  }, {
32974
33600
  key: "collectAncestorChain",
@@ -33011,7 +33637,8 @@ var DivaArticleHandler = /*#__PURE__*/function () {
33011
33637
  partlistGroupPrefix: doLoadItem.partlistGroupPrefix,
33012
33638
  optionsForPrint: doLoadItem.optionsForPrint,
33013
33639
  optionImgForPrint: doLoadItem.optionImgForPrint,
33014
- catalogCodex: doLoadItem.CatalogCodex
33640
+ catalogCodex: doLoadItem.CatalogCodex,
33641
+ PreviousPartlistArticles: doLoadItem.PreviousPartlistArticles
33015
33642
  };
33016
33643
  }
33017
33644
  /**************************************** Querkontrollen über mehrere Article deshalb hier im ArticleHandler ********************************************************************************/
@@ -34582,6 +35209,7 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34582
35209
  } finally {
34583
35210
  _iterator20.f();
34584
35211
  }
35212
+ this.mergeOptionGroupConnectedSteps(myTabGroup, catalog);
34585
35213
  }
34586
35214
  } catch (err) {
34587
35215
  _iterator19.e(err);
@@ -34590,36 +35218,131 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34590
35218
  }
34591
35219
  }
34592
35220
 
34593
- /** Returns the codex of the OPG option a merged option's step was merged into by mergeIDMToOPG, or undefined when it is not merged. */
35221
+ /**
35222
+ * Auto-merges two visible option steps that are CONNECTED VIA IDM OPTION GROUPS, so a
35223
+ * group feature + value feature pair (e.g. Bezugsgruppe + Bezug) collapses into one OPG-style
35224
+ * step without variantenArt pairs or a mergeIDMToOPG property. Connection convention: EVERY
35225
+ * option value codex of the group step is the key of an option group whose members are all
35226
+ * option values of the value step. Steps already merged (explicitly or by variantenArt) are
35227
+ * left untouched, and any ambiguity — a group step matching several value steps, a value step
35228
+ * claimed by several group steps, or a mutual match — suppresses the merge instead of guessing.
35229
+ */
34594
35230
  }, {
34595
- key: "getMergesToOPGParentCodex",
34596
- value: function getMergesToOPGParentCodex(optionCodex) {
34597
- var _iterator22 = _createForOfIteratorHelper$b(this.tabGroups),
35231
+ key: "mergeOptionGroupConnectedSteps",
35232
+ value: function mergeOptionGroupConnectedSteps(myTabGroup, catalog) {
35233
+ var optionGroups = catalog.idmOptionGroups;
35234
+ if (!optionGroups) return;
35235
+ var candidates = [];
35236
+ var _iterator22 = _createForOfIteratorHelper$b(myTabGroup.options),
34598
35237
  _step22;
34599
35238
  try {
34600
35239
  for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {
34601
- var _myTabGroup$options$g;
35240
+ var _step$configSteps$val;
34602
35241
  var _step22$value = _slicedToArray__default["default"](_step22.value, 2),
34603
- myTabGroup = _step22$value[1];
34604
- if (((_myTabGroup$options$g = myTabGroup.options.get(optionCodex)) === null || _myTabGroup$options$g === void 0 ? void 0 : _myTabGroup$options$g.mergesToOPG) !== true) continue;
34605
- var _iterator23 = _createForOfIteratorHelper$b(myTabGroup.options),
35242
+ step = _step22$value[1];
35243
+ if (step.mergesToOPG !== undefined) continue;
35244
+ var ops = (_step$configSteps$val = step.configSteps.values().next().value) === null || _step$configSteps$val === void 0 ? void 0 : _step$configSteps$val.optionstate;
35245
+ // invisible steps only exist in inspect mode — the raw structure stays unmerged there
35246
+ if (!ops || ops.isInvisible) continue;
35247
+ var values = ops.option.articleOptionValues;
35248
+ if (!(values !== null && values !== void 0 && values.size)) continue;
35249
+ candidates.push({
35250
+ step: step,
35251
+ keys: new Set(values.keys())
35252
+ });
35253
+ }
35254
+ } catch (err) {
35255
+ _iterator22.e(err);
35256
+ } finally {
35257
+ _iterator22.f();
35258
+ }
35259
+ var connections = [];
35260
+ var _loop = function _loop() {
35261
+ var candidate = _candidates[_i];
35262
+ var everyOpvIsAGroup = true;
35263
+ var memberKeys = [];
35264
+ var _iterator23 = _createForOfIteratorHelper$b(candidate.keys),
34606
35265
  _step23;
34607
35266
  try {
34608
35267
  for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {
34609
- var _step23$value = _slicedToArray__default["default"](_step23.value, 2),
34610
- myOption = _step23$value[1];
34611
- if (myOption.mergesToOPG === optionCodex) return myOption.codex;
35268
+ var opvCodex = _step23.value;
35269
+ var members = optionGroups[opvCodex];
35270
+ if (!(members !== null && members !== void 0 && members.length)) {
35271
+ everyOpvIsAGroup = false;
35272
+ break;
35273
+ }
35274
+ memberKeys.push.apply(memberKeys, _toConsumableArray__default["default"](members.map(optionGroupMemberKey)));
34612
35275
  }
34613
35276
  } catch (err) {
34614
35277
  _iterator23.e(err);
34615
35278
  } finally {
34616
35279
  _iterator23.f();
34617
35280
  }
35281
+ if (!everyOpvIsAGroup) return 0; // continue
35282
+ var targets = candidates.filter(function (other) {
35283
+ return other.step !== candidate.step && memberKeys.every(function (key) {
35284
+ return other.keys.has(key);
35285
+ });
35286
+ });
35287
+ if (targets.length !== 1) return 0; // continue
35288
+ connections.push({
35289
+ group: candidate.step,
35290
+ target: targets[0].step
35291
+ });
35292
+ },
35293
+ _ret;
35294
+ for (var _i = 0, _candidates = candidates; _i < _candidates.length; _i++) {
35295
+ _ret = _loop();
35296
+ if (_ret === 0) continue;
35297
+ }
35298
+ var _loop2 = function _loop2() {
35299
+ var connection = _connections[_i2];
35300
+ var claims = connections.filter(function (other) {
35301
+ return other.target === connection.target;
35302
+ });
35303
+ // a step that is group and target at once (chain or mutual match) would overwrite its own merge state
35304
+ var chained = connections.some(function (other) {
35305
+ return other !== connection && (other.group === connection.target || other.target === connection.group);
35306
+ });
35307
+ if (claims.length !== 1 || chained) return 1; // continue
35308
+ connection.group.mergesToOPG = connection.target.codex;
35309
+ connection.target.mergesToOPG = true;
35310
+ };
35311
+ for (var _i2 = 0, _connections = connections; _i2 < _connections.length; _i2++) {
35312
+ if (_loop2()) continue;
35313
+ }
35314
+ }
35315
+
35316
+ /** Returns the codex of the OPG option a merged option's step was merged into by mergeIDMToOPG, or undefined when it is not merged. */
35317
+ }, {
35318
+ key: "getMergesToOPGParentCodex",
35319
+ value: function getMergesToOPGParentCodex(optionCodex) {
35320
+ var _iterator24 = _createForOfIteratorHelper$b(this.tabGroups),
35321
+ _step24;
35322
+ try {
35323
+ for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
35324
+ var _myTabGroup$options$g;
35325
+ var _step24$value = _slicedToArray__default["default"](_step24.value, 2),
35326
+ myTabGroup = _step24$value[1];
35327
+ if (((_myTabGroup$options$g = myTabGroup.options.get(optionCodex)) === null || _myTabGroup$options$g === void 0 ? void 0 : _myTabGroup$options$g.mergesToOPG) !== true) continue;
35328
+ var _iterator25 = _createForOfIteratorHelper$b(myTabGroup.options),
35329
+ _step25;
35330
+ try {
35331
+ for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {
35332
+ var _step25$value = _slicedToArray__default["default"](_step25.value, 2),
35333
+ myOption = _step25$value[1];
35334
+ if (myOption.mergesToOPG === optionCodex) return myOption.codex;
35335
+ }
35336
+ } catch (err) {
35337
+ _iterator25.e(err);
35338
+ } finally {
35339
+ _iterator25.f();
35340
+ }
34618
35341
  }
34619
35342
  } catch (err) {
34620
- _iterator22.e(err);
35343
+ _iterator24.e(err);
34621
35344
  } finally {
34622
- _iterator22.f();
35345
+ _iterator24.f();
34623
35346
  }
34624
35347
  return undefined;
34625
35348
  }
@@ -34628,20 +35351,20 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34628
35351
  value: function getOptionWhereIDMVariantIs(tabKey, variant) {
34629
35352
  var myTabGroup = this.tabGroups.get(tabKey);
34630
35353
  if (!myTabGroup) return false;
34631
- var _iterator24 = _createForOfIteratorHelper$b(myTabGroup.options),
34632
- _step24;
35354
+ var _iterator26 = _createForOfIteratorHelper$b(myTabGroup.options),
35355
+ _step26;
34633
35356
  try {
34634
- for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
34635
- var _step24$value = _slicedToArray__default["default"](_step24.value, 2),
34636
- option = _step24$value[1];
35357
+ for (_iterator26.s(); !(_step26 = _iterator26.n()).done;) {
35358
+ var _step26$value = _slicedToArray__default["default"](_step26.value, 2),
35359
+ option = _step26$value[1];
34637
35360
  if (option.idmVariantType == variant) {
34638
35361
  return option;
34639
35362
  }
34640
35363
  }
34641
35364
  } catch (err) {
34642
- _iterator24.e(err);
35365
+ _iterator26.e(err);
34643
35366
  } finally {
34644
- _iterator24.f();
35367
+ _iterator26.f();
34645
35368
  }
34646
35369
  return false;
34647
35370
  }
@@ -34650,13 +35373,13 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34650
35373
  value: function sortConfigStepsInConfigTree(targetArticlesSorted) {
34651
35374
  var configStepCounter = 1;
34652
35375
  var configStepKeysPos = {};
34653
- var _iterator25 = _createForOfIteratorHelper$b(this.tabGroups),
34654
- _step25;
35376
+ var _iterator27 = _createForOfIteratorHelper$b(this.tabGroups),
35377
+ _step27;
34655
35378
  try {
34656
- for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {
34657
- var _step25$value = _slicedToArray__default["default"](_step25.value, 2),
34658
- iKey = _step25$value[0],
34659
- myTabGroup = _step25$value[1];
35379
+ for (_iterator27.s(); !(_step27 = _iterator27.n()).done;) {
35380
+ var _step27$value = _slicedToArray__default["default"](_step27.value, 2),
35381
+ iKey = _step27$value[0],
35382
+ myTabGroup = _step27$value[1];
34660
35383
  var tabSingleOPVOnly = true;
34661
35384
  var tabhidden = true;
34662
35385
  if (iKey == 'Summary') {
@@ -34680,18 +35403,18 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34680
35403
  } else {
34681
35404
  var articlesInTabGroup = this.getTargetArticlesInTabGroup(myTabGroup, targetArticlesSorted);
34682
35405
  for (var i = 0; i < articlesInTabGroup.length; i++) {
34683
- var _iterator26 = _createForOfIteratorHelper$b(myTabGroup.options),
34684
- _step26;
35406
+ var _iterator28 = _createForOfIteratorHelper$b(myTabGroup.options),
35407
+ _step28;
34685
35408
  try {
34686
- for (_iterator26.s(); !(_step26 = _iterator26.n()).done;) {
34687
- var _step26$value = _slicedToArray__default["default"](_step26.value, 2),
34688
- myOption = _step26$value[1];
34689
- var _iterator27 = _createForOfIteratorHelper$b(myOption.configSteps),
34690
- _step27;
35409
+ for (_iterator28.s(); !(_step28 = _iterator28.n()).done;) {
35410
+ var _step28$value = _slicedToArray__default["default"](_step28.value, 2),
35411
+ myOption = _step28$value[1];
35412
+ var _iterator29 = _createForOfIteratorHelper$b(myOption.configSteps),
35413
+ _step29;
34691
35414
  try {
34692
- for (_iterator27.s(); !(_step27 = _iterator27.n()).done;) {
34693
- var _step27$value = _slicedToArray__default["default"](_step27.value, 2),
34694
- myConfigStep = _step27$value[1];
35415
+ for (_iterator29.s(); !(_step29 = _iterator29.n()).done;) {
35416
+ var _step29$value = _slicedToArray__default["default"](_step29.value, 2),
35417
+ myConfigStep = _step29$value[1];
34695
35418
  if (!myConfigStep.singleOPVOnly) {
34696
35419
  tabSingleOPVOnly = false;
34697
35420
  }
@@ -34704,24 +35427,24 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34704
35427
  configStepCounter++;
34705
35428
  if (myConfigStep.key.startsWith('SHELFARTICLE_')) {
34706
35429
  var steps = this.getChildsOfShelfStep(myTabGroup, myConfigStep.key);
34707
- for (var _i = 0; _i < steps.length; _i++) {
34708
- steps[_i].posNr = configStepCounter;
34709
- configStepKeysPos[steps[_i].key] = configStepCounter;
35430
+ for (var _i3 = 0; _i3 < steps.length; _i3++) {
35431
+ steps[_i3].posNr = configStepCounter;
35432
+ configStepKeysPos[steps[_i3].key] = configStepCounter;
34710
35433
  configStepCounter++;
34711
35434
  }
34712
35435
  }
34713
35436
  }
34714
35437
  }
34715
35438
  } catch (err) {
34716
- _iterator27.e(err);
35439
+ _iterator29.e(err);
34717
35440
  } finally {
34718
- _iterator27.f();
35441
+ _iterator29.f();
34719
35442
  }
34720
35443
  }
34721
35444
  } catch (err) {
34722
- _iterator26.e(err);
35445
+ _iterator28.e(err);
34723
35446
  } finally {
34724
- _iterator26.f();
35447
+ _iterator28.f();
34725
35448
  }
34726
35449
  }
34727
35450
  if (tabSingleOPVOnly) {
@@ -34733,41 +35456,41 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34733
35456
  }
34734
35457
  }
34735
35458
  } catch (err) {
34736
- _iterator25.e(err);
35459
+ _iterator27.e(err);
34737
35460
  } finally {
34738
- _iterator25.f();
35461
+ _iterator27.f();
34739
35462
  }
34740
35463
  }
34741
35464
  }, {
34742
35465
  key: "getChildsOfShelfStep",
34743
35466
  value: function getChildsOfShelfStep(tabGroup, shelfId) {
34744
35467
  var ret = [];
34745
- var _iterator28 = _createForOfIteratorHelper$b(tabGroup.options),
34746
- _step28;
35468
+ var _iterator30 = _createForOfIteratorHelper$b(tabGroup.options),
35469
+ _step30;
34747
35470
  try {
34748
- for (_iterator28.s(); !(_step28 = _iterator28.n()).done;) {
34749
- var _step28$value = _slicedToArray__default["default"](_step28.value, 2),
34750
- option = _step28$value[1];
34751
- var _iterator29 = _createForOfIteratorHelper$b(option.configSteps),
34752
- _step29;
35471
+ for (_iterator30.s(); !(_step30 = _iterator30.n()).done;) {
35472
+ var _step30$value = _slicedToArray__default["default"](_step30.value, 2),
35473
+ option = _step30$value[1];
35474
+ var _iterator31 = _createForOfIteratorHelper$b(option.configSteps),
35475
+ _step31;
34753
35476
  try {
34754
- for (_iterator29.s(); !(_step29 = _iterator29.n()).done;) {
34755
- var _step29$value = _slicedToArray__default["default"](_step29.value, 2),
34756
- configStep = _step29$value[1];
35477
+ for (_iterator31.s(); !(_step31 = _iterator31.n()).done;) {
35478
+ var _step31$value = _slicedToArray__default["default"](_step31.value, 2),
35479
+ configStep = _step31$value[1];
34757
35480
  if (configStep.parentShelfId == shelfId) {
34758
35481
  ret.push(configStep);
34759
35482
  }
34760
35483
  }
34761
35484
  } catch (err) {
34762
- _iterator29.e(err);
35485
+ _iterator31.e(err);
34763
35486
  } finally {
34764
- _iterator29.f();
35487
+ _iterator31.f();
34765
35488
  }
34766
35489
  }
34767
35490
  } catch (err) {
34768
- _iterator28.e(err);
35491
+ _iterator30.e(err);
34769
35492
  } finally {
34770
- _iterator28.f();
35493
+ _iterator30.f();
34771
35494
  }
34772
35495
  return ret;
34773
35496
  }
@@ -34777,12 +35500,12 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34777
35500
  if (catalogData.hasAlternateRenderings) {
34778
35501
  for (var i = 0; i < catalogData.alternateRenderings.length; i++) {
34779
35502
  var onOptions = catalogData.alternateRenderings[i].onOptions;
34780
- var _iterator30 = _createForOfIteratorHelper$b(this.tabGroups),
34781
- _step30;
35503
+ var _iterator32 = _createForOfIteratorHelper$b(this.tabGroups),
35504
+ _step32;
34782
35505
  try {
34783
- var _loop = function _loop() {
34784
- var _step30$value = _slicedToArray__default["default"](_step30.value, 2),
34785
- tabGroup = _step30$value[1];
35506
+ var _loop3 = function _loop3() {
35507
+ var _step32$value = _slicedToArray__default["default"](_step32.value, 2),
35508
+ tabGroup = _step32$value[1];
34786
35509
  var matched = onOptions.some(function (onOption) {
34787
35510
  return onOption.startsWith('SHELFARTICLE_') ? _toConsumableArray__default["default"](tabGroup.options.keys()).some(function (key) {
34788
35511
  return key.startsWith(onOption);
@@ -34792,13 +35515,13 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34792
35515
  tabGroup.alternateRenderings.push(catalogData.alternateRenderings[i]);
34793
35516
  }
34794
35517
  };
34795
- for (_iterator30.s(); !(_step30 = _iterator30.n()).done;) {
34796
- _loop();
35518
+ for (_iterator32.s(); !(_step32 = _iterator32.n()).done;) {
35519
+ _loop3();
34797
35520
  }
34798
35521
  } catch (err) {
34799
- _iterator30.e(err);
35522
+ _iterator32.e(err);
34800
35523
  } finally {
34801
- _iterator30.f();
35524
+ _iterator32.f();
34802
35525
  }
34803
35526
  }
34804
35527
  }
@@ -34807,30 +35530,30 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34807
35530
  key: "getTargetArticlesInTabGroup",
34808
35531
  value: function getTargetArticlesInTabGroup(myTabGroup, allTargetArticlesSorted) {
34809
35532
  var articlesInTabGroup = [];
34810
- var _iterator31 = _createForOfIteratorHelper$b(myTabGroup.options),
34811
- _step31;
35533
+ var _iterator33 = _createForOfIteratorHelper$b(myTabGroup.options),
35534
+ _step33;
34812
35535
  try {
34813
- for (_iterator31.s(); !(_step31 = _iterator31.n()).done;) {
34814
- var _step31$value = _slicedToArray__default["default"](_step31.value, 2),
34815
- myOption = _step31$value[1];
34816
- var _iterator32 = _createForOfIteratorHelper$b(myOption.configSteps),
34817
- _step32;
35536
+ for (_iterator33.s(); !(_step33 = _iterator33.n()).done;) {
35537
+ var _step33$value = _slicedToArray__default["default"](_step33.value, 2),
35538
+ myOption = _step33$value[1];
35539
+ var _iterator34 = _createForOfIteratorHelper$b(myOption.configSteps),
35540
+ _step34;
34818
35541
  try {
34819
- for (_iterator32.s(); !(_step32 = _iterator32.n()).done;) {
34820
- var _step32$value = _slicedToArray__default["default"](_step32.value, 2),
34821
- configStep = _step32$value[1];
35542
+ for (_iterator34.s(); !(_step34 = _iterator34.n()).done;) {
35543
+ var _step34$value = _slicedToArray__default["default"](_step34.value, 2),
35544
+ configStep = _step34$value[1];
34822
35545
  articlesInTabGroup = articlesInTabGroup.concat(configStep.targetArticles);
34823
35546
  }
34824
35547
  } catch (err) {
34825
- _iterator32.e(err);
35548
+ _iterator34.e(err);
34826
35549
  } finally {
34827
- _iterator32.f();
35550
+ _iterator34.f();
34828
35551
  }
34829
35552
  }
34830
35553
  } catch (err) {
34831
- _iterator31.e(err);
35554
+ _iterator33.e(err);
34832
35555
  } finally {
34833
- _iterator31.f();
35556
+ _iterator33.f();
34834
35557
  }
34835
35558
  var basketIds = _toConsumableArray__default["default"](new Set(articlesInTabGroup));
34836
35559
  var basketIdsSorted = [];
@@ -34848,44 +35571,44 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34848
35571
  key: "getConfigStepKeyOfAccessoire",
34849
35572
  value: function getConfigStepKeyOfAccessoire(articleCodex, targetArticle) {
34850
35573
  var configStepKeys = [];
34851
- var _iterator33 = _createForOfIteratorHelper$b(this.tabGroups),
34852
- _step33;
35574
+ var _iterator35 = _createForOfIteratorHelper$b(this.tabGroups),
35575
+ _step35;
34853
35576
  try {
34854
- for (_iterator33.s(); !(_step33 = _iterator33.n()).done;) {
34855
- var _step33$value = _slicedToArray__default["default"](_step33.value, 2),
34856
- tabGroup = _step33$value[1];
34857
- var _iterator34 = _createForOfIteratorHelper$b(tabGroup.options),
34858
- _step34;
35577
+ for (_iterator35.s(); !(_step35 = _iterator35.n()).done;) {
35578
+ var _step35$value = _slicedToArray__default["default"](_step35.value, 2),
35579
+ tabGroup = _step35$value[1];
35580
+ var _iterator36 = _createForOfIteratorHelper$b(tabGroup.options),
35581
+ _step36;
34859
35582
  try {
34860
- for (_iterator34.s(); !(_step34 = _iterator34.n()).done;) {
34861
- var _step34$value = _slicedToArray__default["default"](_step34.value, 2),
34862
- option = _step34$value[1];
34863
- var _iterator35 = _createForOfIteratorHelper$b(option.configSteps),
34864
- _step35;
35583
+ for (_iterator36.s(); !(_step36 = _iterator36.n()).done;) {
35584
+ var _step36$value = _slicedToArray__default["default"](_step36.value, 2),
35585
+ option = _step36$value[1];
35586
+ var _iterator37 = _createForOfIteratorHelper$b(option.configSteps),
35587
+ _step37;
34865
35588
  try {
34866
- for (_iterator35.s(); !(_step35 = _iterator35.n()).done;) {
34867
- var _step35$value = _slicedToArray__default["default"](_step35.value, 2),
34868
- configStep = _step35$value[1];
35589
+ for (_iterator37.s(); !(_step37 = _iterator37.n()).done;) {
35590
+ var _step37$value = _slicedToArray__default["default"](_step37.value, 2),
35591
+ configStep = _step37$value[1];
34869
35592
  if (configStep.accessoireArticleCodex == articleCodex && configStep.targetArticles.includes(targetArticle)) {
34870
35593
  configStepKeys.push(configStep.key);
34871
35594
  }
34872
35595
  }
34873
35596
  } catch (err) {
34874
- _iterator35.e(err);
35597
+ _iterator37.e(err);
34875
35598
  } finally {
34876
- _iterator35.f();
35599
+ _iterator37.f();
34877
35600
  }
34878
35601
  }
34879
35602
  } catch (err) {
34880
- _iterator34.e(err);
35603
+ _iterator36.e(err);
34881
35604
  } finally {
34882
- _iterator34.f();
35605
+ _iterator36.f();
34883
35606
  }
34884
35607
  }
34885
35608
  } catch (err) {
34886
- _iterator33.e(err);
35609
+ _iterator35.e(err);
34887
35610
  } finally {
34888
- _iterator33.f();
35611
+ _iterator35.f();
34889
35612
  }
34890
35613
  return configStepKeys;
34891
35614
  }
@@ -34910,12 +35633,12 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34910
35633
  }, {
34911
35634
  key: "getFirstConfigStepKey",
34912
35635
  value: function getFirstConfigStepKey() {
34913
- var _iterator36 = _createForOfIteratorHelper$b(this.tabGroups),
34914
- _step36;
35636
+ var _iterator38 = _createForOfIteratorHelper$b(this.tabGroups),
35637
+ _step38;
34915
35638
  try {
34916
- for (_iterator36.s(); !(_step36 = _iterator36.n()).done;) {
34917
- var _step36$value = _slicedToArray__default["default"](_step36.value, 2),
34918
- tabGroup = _step36$value[1];
35639
+ for (_iterator38.s(); !(_step38 = _iterator38.n()).done;) {
35640
+ var _step38$value = _slicedToArray__default["default"](_step38.value, 2),
35641
+ tabGroup = _step38$value[1];
34919
35642
  if (['ACC', 'OPTION', 'ACC_PLANNER'].includes(tabGroup.type)) {
34920
35643
  var firstOption = tabGroup.options.values().next().value;
34921
35644
  var firstConfigStep = firstOption === null || firstOption === void 0 ? void 0 : firstOption.configSteps.values().next().value;
@@ -34923,9 +35646,9 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
34923
35646
  }
34924
35647
  }
34925
35648
  } catch (err) {
34926
- _iterator36.e(err);
35649
+ _iterator38.e(err);
34927
35650
  } finally {
34928
- _iterator36.f();
35651
+ _iterator38.f();
34929
35652
  }
34930
35653
  return undefined;
34931
35654
  }
@@ -36564,17 +37287,42 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
36564
37287
  }();
36565
37288
  var favoritesHandlerInstance = new DivaFavoritesHandler();
36566
37289
 
36567
- function ownKeys$f(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
36568
- function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
36569
37290
  function _createForOfIteratorHelper$9(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$9(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
36570
37291
  function _unsupportedIterableToArray$9(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$9(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$9(r, a) : void 0; } }
36571
37292
  function _arrayLikeToArray$9(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
37293
+ function ownKeys$f(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
37294
+ function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
36572
37295
 
36573
37296
  //Diese Klasse beinhaltet die Logik wie eine aktuelle Konfiguration mit allen möglicheen Ausprägungen mit Preisen in einem Set aussieht.
36574
37297
  //Der in einem Set gemergte Optionsbaum
36575
37298
  //er ist die logik welche sich beim alten Code im oberen Teil vom plArticleConfigWeb befindet
36576
37299
  //dort ist es die Funktionen: InitSetConfigOptionsData -> bauen des Configbaums
36577
37300
  var LOG$c = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
37301
+ /**
37302
+ * The article a config STEP belongs to: a partlist child that shows its options in the MAIN tree contributes
37303
+ * them to its PARENT's step, everything else stands for itself. Returns the parent OBJECT — never a lookup in
37304
+ * the caller's `articles` map, which holds only VISIBLE articles (an invisible shell with visible children is
37305
+ * not a key of it); a child whose parent is missing falls back to itself.
37306
+ */
37307
+ function resolveStepArticle(article) {
37308
+ var _ref;
37309
+ return (_ref = article.partlistArticleVisibleInTree ? article.partListParentArticle : undefined) !== null && _ref !== void 0 ? _ref : article;
37310
+ }
37311
+
37312
+ /**
37313
+ * `articles` plus every step article one of its members resolves to. A config step's `targetArticles` carry the
37314
+ * basketId of `resolveStepArticle`, which may be an INVISIBLE parent the visible map does not hold — code that
37315
+ * looks target articles up by basketId needs this map, code that iterates the visible articles does not.
37316
+ */
37317
+ function withStepArticles(articles) {
37318
+ var extended = _objectSpread$f({}, articles);
37319
+ for (var _i = 0, _Object$values = Object.values(articles); _i < _Object$values.length; _i++) {
37320
+ var article = _Object$values[_i];
37321
+ var stepArticle = resolveStepArticle(article);
37322
+ if (!extended[stepArticle.basketId]) extended[stepArticle.basketId] = stepArticle;
37323
+ }
37324
+ return extended;
37325
+ }
36578
37326
  var DivaConfigTreeHandler = /*#__PURE__*/function () {
36579
37327
  function DivaConfigTreeHandler() {
36580
37328
  _classCallCheck__default["default"](this, DivaConfigTreeHandler);
@@ -36890,9 +37638,10 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
36890
37638
  }, {
36891
37639
  key: "addOptionsStateToConfigTree",
36892
37640
  value: function addOptionsStateToConfigTree(set, configTree, articles, b, ops, optionCodex, selectionmode, visible, addToTabGroup) {
36893
- var _article$partListPare, _set$ViewConfig4;
37641
+ var _set$ViewConfig4;
36894
37642
  var article = articles[b];
36895
- var basketId = article.partlistArticleVisibleInTree ? (_article$partListPare = article.partListParentArticle) === null || _article$partListPare === void 0 ? void 0 : _article$partListPare.basketId : article.basketId;
37643
+ var stepArticle = resolveStepArticle(article);
37644
+ var basketId = stepArticle.basketId;
36896
37645
  var tabGroupCodex;
36897
37646
  var tabGroupTitel;
36898
37647
  if (ops.optionTabGroup) {
@@ -36930,7 +37679,7 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
36930
37679
  }
36931
37680
  configStepKey = configStepKey + '_' + 'acc' + (set.CatalogData.forceConfigAllAccessoires ? article.articleCodex : basketId);
36932
37681
  }
36933
- var plaBasketIds = Object.keys(articles[basketId].getRecursivePartlistArticles(true, true));
37682
+ var plaBasketIds = Object.keys(stepArticle.getRecursivePartlistArticles(true, true));
36934
37683
  var singleOPVOnly = ops.visibleCount == 1 && !ops.isFreeText && !set.CatalogData.dontHideOption.includes(ops.option.codex) && !((_set$ViewConfig4 = set.ViewConfig) !== null && _set$ViewConfig4 !== void 0 && _set$ViewConfig4.showSingleOPVOnly);
36935
37684
  var isAccessoire = isRelatedAccessoire ? article.articleCodex : false;
36936
37685
  if (!configTree.getTabGroupByCodex(tabGroupCodex)) {
@@ -37184,44 +37933,44 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37184
37933
  key: "getConifgItemsForView",
37185
37934
  value: function () {
37186
37935
  var _getConifgItemsForView = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(set, configStepKey) {
37187
- var articles, step, retValues, optionCodex, configItems, selectedItems, optionState, _iterator12, _step12, _configItem$parent$oc, key, configItem, configItemsInOPG, retVal, _retVal, clonedSet, clonedArticles, configStepOPG, configStepOPV, targetArticle, opg, ops, selectedOpv, originalVariantValues, mergedOptionOnPartlistArticle, useFastPath, fastPathValidated, variantValues, _iterator13, _step13, _clonedSet$favorites$, _clonedSet$favorites, _step13$value, opgValue, alreadyCalcedVisibleOPVs, _loop5, _i, _targetArticle$engine, _targetArticle$engine2, _ops$optionOcd2, visibleOptionValues, updatedOps, fastPathKeys, fullKeys, _retVal2, clonedConfigItemsForView, _loop4, i;
37188
- return _regeneratorRuntime__default["default"].wrap(function _callee$(_context3) {
37189
- while (1) switch (_context3.prev = _context3.next) {
37936
+ var articles, step, retValues, optionCodex, configItems, selectedItems, optionState, _iterator12, _step12, _configItem$parent$oc, key, configItem, configItemsInOPG, retVal, _retVal, configStepOPG, configStepOPV, staticItems;
37937
+ return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
37938
+ while (1) switch (_context.prev = _context.next) {
37190
37939
  case 0:
37191
- articles = set.getDivaArticles(true);
37940
+ articles = withStepArticles(set.getDivaArticles(true));
37192
37941
  step = set.configTree.getAllByKey(configStepKey);
37193
37942
  retValues = this.getConfigItems(configStepKey, articles, set.configTree);
37194
37943
  optionCodex = undefined;
37195
37944
  if (!(retValues && step != null)) {
37196
- _context3.next = 111;
37945
+ _context.next = 55;
37197
37946
  break;
37198
37947
  }
37199
37948
  configItems = [];
37200
37949
  selectedItems = retValues.selectedVals;
37201
37950
  optionState = articles[retValues.targetArticles[0]].getArticleOptionState(retValues.optionCodex);
37202
37951
  if (optionState) {
37203
- _context3.next = 10;
37952
+ _context.next = 10;
37204
37953
  break;
37205
37954
  }
37206
37955
  throw new Error('myOptionState ' + retValues.optionCodex + ' is undefined');
37207
37956
  case 10:
37208
37957
  optionCodex = optionState.optionCodex;
37209
37958
  if (!retValues.isOPG) {
37210
- _context3.next = 36;
37959
+ _context.next = 36;
37211
37960
  break;
37212
37961
  }
37213
37962
  _iterator12 = _createForOfIteratorHelper$9(retValues.configItems.keys());
37214
- _context3.prev = 13;
37963
+ _context.prev = 13;
37215
37964
  _iterator12.s();
37216
37965
  case 15:
37217
37966
  if ((_step12 = _iterator12.n()).done) {
37218
- _context3.next = 26;
37967
+ _context.next = 26;
37219
37968
  break;
37220
37969
  }
37221
37970
  key = _step12.value;
37222
37971
  configItem = retValues.configItems.get(key);
37223
37972
  if (configItem) {
37224
- _context3.next = 20;
37973
+ _context.next = 20;
37225
37974
  break;
37226
37975
  }
37227
37976
  throw new Error('configItem ' + key + ' not found in retValues.configItems');
@@ -37239,132 +37988,318 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37239
37988
  });
37240
37989
  }
37241
37990
  case 24:
37242
- _context3.next = 15;
37991
+ _context.next = 15;
37243
37992
  break;
37244
37993
  case 26:
37245
- _context3.next = 31;
37994
+ _context.next = 31;
37246
37995
  break;
37247
37996
  case 28:
37248
- _context3.prev = 28;
37249
- _context3.t0 = _context3["catch"](13);
37250
- _iterator12.e(_context3.t0);
37997
+ _context.prev = 28;
37998
+ _context.t0 = _context["catch"](13);
37999
+ _iterator12.e(_context.t0);
37251
38000
  case 31:
37252
- _context3.prev = 31;
38001
+ _context.prev = 31;
37253
38002
  _iterator12.f();
37254
- return _context3.finish(31);
38003
+ return _context.finish(31);
37255
38004
  case 34:
37256
- _context3.next = 108;
38005
+ _context.next = 52;
37257
38006
  break;
37258
38007
  case 36:
37259
38008
  if (!(step.optionStep.mergesToOPG == undefined)) {
37260
- _context3.next = 41;
38009
+ _context.next = 41;
37261
38010
  break;
37262
38011
  }
37263
- _retVal = this.prepareConfigItemsForView(set, optionState, retValues.configItems, retValues.constructionRules, selectedItems, step.configStep.targetArticles, undefined, undefined, undefined, undefined, retValues.freeTextValue, retValues.freeTextLang);
38012
+ _retVal = this.prepareConfigItemsForView(set, optionState, retValues.configItems, retValues.constructionRules, selectedItems, step.configStep.targetArticles, undefined, undefined, undefined, undefined, undefined, retValues.freeTextValue, retValues.freeTextLang);
37264
38013
  configItems = _retVal.myConfigItemsForView;
37265
- _context3.next = 108;
38014
+ _context.next = 52;
37266
38015
  break;
37267
38016
  case 41:
37268
38017
  if (!(typeof step.optionStep.mergesToOPG == 'string' && step.tabGroup.options.has(step.optionStep.mergesToOPG))) {
37269
- _context3.next = 108;
38018
+ _context.next = 52;
37270
38019
  break;
37271
38020
  }
37272
- clonedSet = set.cloneSet();
37273
- clonedArticles = clonedSet.getDivaArticles(true); //IDM Bezugschritte werden zusammengefasst zu OPG und OPV
38021
+ //IDM Bezugschritte werden zusammengefasst zu OPG und OPV
37274
38022
  configStepOPG = step.configStep, configStepOPV = set.configTree.getConfigStepBasketIdAndOptionCodex(configStepOPG.targetArticles[0], step.optionStep.mergesToOPG); //falls mehrere Artikel im Schritt sind werden trotzdem nur die Values des erster verwendet um die z.B. OPT2 und OPT3 zu vereinen
37275
38023
  if (!configStepOPV) {
37276
- _context3.next = 108;
38024
+ _context.next = 52;
38025
+ break;
38026
+ }
38027
+ // Two-group-families standard: pools come from the type-1 decision rows alone — no clone, no reconfiguration per group.
38028
+ staticItems = this.mergeOPGItemsFromDecisionRows(set, articles, configStepOPG, configStepOPV, optionState, retValues.constructionRules, selectedItems);
38029
+ if (!staticItems) {
38030
+ _context.next = 49;
38031
+ break;
38032
+ }
38033
+ configItems = staticItems;
38034
+ _context.next = 52;
38035
+ break;
38036
+ case 49:
38037
+ _context.next = 51;
38038
+ return this.mergeOPGItemsByReconfiguration(set, step, configStepOPG, configStepOPV, optionState, retValues.constructionRules, selectedItems);
38039
+ case 51:
38040
+ configItems = _context.sent;
38041
+ case 52:
38042
+ return _context.abrupt("return", {
38043
+ configItems: configItems,
38044
+ option: optionCodex ? optionState.option : undefined,
38045
+ selectedItems: selectedItems.map(function (sel) {
38046
+ return configItems.find(function (c) {
38047
+ return c.codex === sel;
38048
+ });
38049
+ }),
38050
+ notTotallyMatichingOPVs: !set.CatalogData.articleConfigAll ? retValues.notTotallyMatichingOPVs : undefined
38051
+ });
38052
+ case 55:
38053
+ return _context.abrupt("return", {
38054
+ configItems: [],
38055
+ selectedItems: []
38056
+ });
38057
+ case 56:
38058
+ case "end":
38059
+ return _context.stop();
38060
+ }
38061
+ }, _callee, this, [[13, 28, 31, 34]]);
38062
+ }));
38063
+ function getConifgItemsForView(_x, _x2) {
38064
+ return _getConifgItemsForView.apply(this, arguments);
38065
+ }
38066
+ return getConifgItemsForView;
38067
+ }()
38068
+ /**
38069
+ * The dropdown headers of a merged OPG step: when an INVISIBLE second group family spans the same value
38070
+ * feature via option groups, every visible group maps to the parent whose option group contains all its
38071
+ * members (the parent OPV's name becomes parentName). Undefined when no such family exists; an ambiguous
38072
+ * group gets no header rather than a wrong one.
38073
+ */
38074
+ }, {
38075
+ key: "idmOpgParentNames",
38076
+ value: function idmOpgParentNames(targetArticle, opg, ops) {
38077
+ var optionGroups = targetArticle.CatalogData.idmOptionGroups;
38078
+ if (!optionGroups) return undefined;
38079
+ var valueKeys = new Set(ops.option.articleOptionValues.keys());
38080
+ var _iterator13 = _createForOfIteratorHelper$9(targetArticle.articleOptionStates.values()),
38081
+ _step13;
38082
+ try {
38083
+ for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
38084
+ var state = _step13.value;
38085
+ if (state.optionCodex === opg.optionCodex || state.optionCodex === ops.optionCodex || !state.isInvisible) continue;
38086
+ var parentValues = state.option.articleOptionValues;
38087
+ if (!(parentValues !== null && parentValues !== void 0 && parentValues.size)) continue;
38088
+
38089
+ // a parent family: EVERY option value of the invisible feature is an option group over the value feature
38090
+ var parentMembers = new Map();
38091
+ var isFamily = true;
38092
+ var _iterator14 = _createForOfIteratorHelper$9(parentValues.keys()),
38093
+ _step14;
38094
+ try {
38095
+ for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
38096
+ var _optionGroups$parentC;
38097
+ var parentCodex = _step14.value;
38098
+ var members = (_optionGroups$parentC = optionGroups[parentCodex]) === null || _optionGroups$parentC === void 0 ? void 0 : _optionGroups$parentC.map(optionGroupMemberKey);
38099
+ if (!(members !== null && members !== void 0 && members.length) || !members.every(function (key) {
38100
+ return valueKeys.has(key);
38101
+ })) {
38102
+ isFamily = false;
37277
38103
  break;
37278
38104
  }
38105
+ parentMembers.set(parentCodex, new Set(members));
38106
+ }
38107
+ } catch (err) {
38108
+ _iterator14.e(err);
38109
+ } finally {
38110
+ _iterator14.f();
38111
+ }
38112
+ if (!isFamily) continue;
38113
+ var parentNames = new Map();
38114
+ var _iterator15 = _createForOfIteratorHelper$9(opg.visibleOptionValues),
38115
+ _step15;
38116
+ try {
38117
+ var _loop4 = function _loop4() {
38118
+ var _optionGroups$opgValu, _parentValues$get;
38119
+ var _step15$value = _slicedToArray__default["default"](_step15.value, 2),
38120
+ opgValue = _step15$value[1];
38121
+ var groupMembers = (_optionGroups$opgValu = optionGroups[opgValue.codex]) === null || _optionGroups$opgValu === void 0 ? void 0 : _optionGroups$opgValu.map(optionGroupMemberKey);
38122
+ if (!(groupMembers !== null && groupMembers !== void 0 && groupMembers.length)) return 0; // continue
38123
+ var parent = _toConsumableArray__default["default"](parentMembers.entries()).find(function (_ref2) {
38124
+ var _ref3 = _slicedToArray__default["default"](_ref2, 2),
38125
+ memberSet = _ref3[1];
38126
+ return groupMembers.every(function (key) {
38127
+ return memberSet.has(key);
38128
+ });
38129
+ });
38130
+ if (!parent) return 0; // continue
38131
+ var parentName = (_parentValues$get = parentValues.get(parent[0])) === null || _parentValues$get === void 0 ? void 0 : _parentValues$get.name;
38132
+ if (parentName) parentNames.set(opgValue.codex, parentName);
38133
+ },
38134
+ _ret;
38135
+ for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
38136
+ _ret = _loop4();
38137
+ if (_ret === 0) continue;
38138
+ }
38139
+ } catch (err) {
38140
+ _iterator15.e(err);
38141
+ } finally {
38142
+ _iterator15.f();
38143
+ }
38144
+ if (parentNames.size) return parentNames;
38145
+ }
38146
+ } catch (err) {
38147
+ _iterator13.e(err);
38148
+ } finally {
38149
+ _iterator13.f();
38150
+ }
38151
+ return undefined;
38152
+ }
38153
+
38154
+ /**
38155
+ * Merged-OPG view via the static decision-row path — a read-only lookup on the original set. Undefined as
38156
+ * soon as one pool is not statically derivable; the caller then falls back to the clone-based flow.
38157
+ */
38158
+ }, {
38159
+ key: "mergeOPGItemsFromDecisionRows",
38160
+ value: function mergeOPGItemsFromDecisionRows(set, articles, configStepOPG, configStepOPV, optionState, constructionRules, selectedItems) {
38161
+ var targetArticle = articles[configStepOPG.targetArticles[0]];
38162
+ var opg = targetArticle === null || targetArticle === void 0 ? void 0 : targetArticle.getArticleOptionState(configStepOPG.option);
38163
+ var ops = targetArticle === null || targetArticle === void 0 ? void 0 : targetArticle.getArticleOptionState(configStepOPV.option);
38164
+ if (!opg || !ops) return undefined;
38165
+ var parentNames = this.idmOpgParentNames(targetArticle, opg, ops);
38166
+ var configItems = [];
38167
+ var _iterator16 = _createForOfIteratorHelper$9(opg.visibleOptionValues),
38168
+ _step16;
38169
+ try {
38170
+ for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
38171
+ var _targetArticle$engine, _targetArticle$engine2, _ops$optionOcd2;
38172
+ var _step16$value = _slicedToArray__default["default"](_step16.value, 2),
38173
+ opgValue = _step16$value[1];
38174
+ var pool = (_targetArticle$engine = (_targetArticle$engine2 = targetArticle.engine).staticVisibleOptionValuesForFeature) === null || _targetArticle$engine === void 0 ? void 0 : _targetArticle$engine.call(_targetArticle$engine2, ops.optionCodex, opg.optionCodex, opgValue.codex);
38175
+ if (!pool) return undefined;
38176
+ var retVal = this.prepareConfigItemsForView(set, optionState, pool, constructionRules, [], configStepOPG.targetArticles, (_ops$optionOcd2 = ops.optionOcd) !== null && _ops$optionOcd2 !== void 0 ? _ops$optionOcd2 : ops.optionCodex, opgValue.name, opgValue.codex, opg.optionCodex, parentNames === null || parentNames === void 0 ? void 0 : parentNames.get(opgValue.codex));
38177
+ configItems = configItems.concat(retVal.myConfigItemsForView);
38178
+ }
38179
+ } catch (err) {
38180
+ _iterator16.e(err);
38181
+ } finally {
38182
+ _iterator16.f();
38183
+ }
38184
+ var _loop5 = function _loop5() {
38185
+ var _articles$configStepO;
38186
+ var valCodex = (_articles$configStepO = articles[configStepOPG.targetArticles[i]]) === null || _articles$configStepO === void 0 || (_articles$configStepO = _articles$configStepO.getArticleOptionState(configStepOPV.option)) === null || _articles$configStepO === void 0 ? void 0 : _articles$configStepO.valCodex;
38187
+ var sel = configItems.find(function (c) {
38188
+ return c.codex == valCodex;
38189
+ });
38190
+ if (sel) {
38191
+ sel.sel = true;
38192
+ if (!selectedItems.includes(sel.codex)) selectedItems.push(sel.codex);
38193
+ }
38194
+ };
38195
+ for (var i = 0; i < configStepOPG.targetArticles.length; i++) {
38196
+ _loop5();
38197
+ }
38198
+ return configItems;
38199
+ }
38200
+
38201
+ /** Merged-OPG view via per-group reconfiguration on a cloned set — the pre-existing flow, used when the static decision-row path does not apply. */
38202
+ }, {
38203
+ key: "mergeOPGItemsByReconfiguration",
38204
+ value: (function () {
38205
+ var _mergeOPGItemsByReconfiguration = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(set, step, configStepOPG, configStepOPV, optionState, constructionRules, selectedItems) {
38206
+ var configItems, clonedSet, clonedArticles, targetArticle, opg, ops, selectedOpv, originalVariantValues, parentNames, mergedOptionOnPartlistArticle, useFastPath, fastPathValidated, variantValues, _iterator17, _step17, _clonedSet$favorites$, _clonedSet$favorites, _step17$value, opgValue, alreadyCalcedVisibleOPVs, _loop7, _i2, _targetArticle$engine3, _targetArticle$engine4, _ops$optionOcd3, visibleOptionValues, updatedOps, fastPathKeys, fullKeys, retVal, clonedConfigItemsForView, _loop6, i;
38207
+ return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context4) {
38208
+ while (1) switch (_context4.prev = _context4.next) {
38209
+ case 0:
38210
+ configItems = [];
38211
+ clonedSet = set.cloneSet(); // Same lookup contract as the static path: a step may target an INVISIBLE parent the visible map does not hold.
38212
+ clonedArticles = withStepArticles(clonedSet.getDivaArticles(true));
37279
38213
  targetArticle = clonedArticles[configStepOPG.targetArticles[0]];
37280
38214
  opg = targetArticle.getArticleOptionState(configStepOPG.option);
37281
38215
  ops = targetArticle.getArticleOptionState(configStepOPV.option);
37282
38216
  if (opg) {
37283
- _context3.next = 51;
38217
+ _context4.next = 8;
37284
38218
  break;
37285
38219
  }
37286
38220
  throw new Error('myOptionState ' + configStepOPG.option + ' is undefined');
37287
- case 51:
38221
+ case 8:
37288
38222
  if (ops) {
37289
- _context3.next = 53;
38223
+ _context4.next = 10;
37290
38224
  break;
37291
38225
  }
37292
38226
  throw new Error('myOptionState ' + configStepOPV.option + ' is undefined');
37293
- case 53:
38227
+ case 10:
37294
38228
  selectedOpv = ops.valCodex;
37295
38229
  originalVariantValues = targetArticle.VariantValues;
38230
+ parentNames = this.idmOpgParentNames(targetArticle, opg, ops);
37296
38231
  mergedOptionOnPartlistArticle = !targetArticle.getArticleOptionStateFlat(ops.optionCodex);
37297
38232
  useFastPath = true, fastPathValidated = false;
37298
38233
  variantValues = {};
37299
- _iterator13 = _createForOfIteratorHelper$9(opg.visibleOptionValues);
37300
- _context3.prev = 59;
37301
- _iterator13.s();
37302
- case 61:
37303
- if ((_step13 = _iterator13.n()).done) {
37304
- _context3.next = 93;
38234
+ _iterator17 = _createForOfIteratorHelper$9(opg.visibleOptionValues);
38235
+ _context4.prev = 17;
38236
+ _iterator17.s();
38237
+ case 19:
38238
+ if ((_step17 = _iterator17.n()).done) {
38239
+ _context4.next = 51;
37305
38240
  break;
37306
38241
  }
37307
- _step13$value = _slicedToArray__default["default"](_step13.value, 2), opgValue = _step13$value[1];
37308
- //die sichtbaren gruppen werden nun nacheinander beim Artikel gesetzt und die Validen bezüge jeder gruppe geholt -> visibleOptionValues;
38242
+ _step17$value = _slicedToArray__default["default"](_step17.value, 2), opgValue = _step17$value[1];
38243
+ // The visible groups are set on the article one after another and each group's valid values fetched -> visibleOptionValues.
37309
38244
  variantValues[opg.optionCodex] = opgValue.codex;
37310
38245
  alreadyCalcedVisibleOPVs = targetArticle.getMergesToOPG(opg.optionCodex + '_' + opgValue.codex, JSON.stringify(targetArticle.getVariantValuesTillOPT(opg.optionCodex)));
37311
38246
  if (!(alreadyCalcedVisibleOPVs != undefined && Object.keys((_clonedSet$favorites$ = (_clonedSet$favorites = clonedSet.favorites) === null || _clonedSet$favorites === void 0 ? void 0 : _clonedSet$favorites.VariantValues) !== null && _clonedSet$favorites$ !== void 0 ? _clonedSet$favorites$ : {}).length == 0)) {
37312
- _context3.next = 77;
38247
+ _context4.next = 35;
37313
38248
  break;
37314
38249
  }
37315
38250
  if (!((originalVariantValues === null || originalVariantValues === void 0 ? void 0 : originalVariantValues[opg.optionCodex]) == opgValue.codex)) {
37316
- _context3.next = 74;
38251
+ _context4.next = 32;
37317
38252
  break;
37318
38253
  }
37319
- _loop5 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop5() {
38254
+ _loop7 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop7() {
37320
38255
  var _clonedArticles$confi;
37321
38256
  var valCodex, sel;
37322
- return _regeneratorRuntime__default["default"].wrap(function _loop5$(_context) {
37323
- while (1) switch (_context.prev = _context.next) {
38257
+ return _regeneratorRuntime__default["default"].wrap(function _loop7$(_context2) {
38258
+ while (1) switch (_context2.prev = _context2.next) {
37324
38259
  case 0:
37325
- valCodex = (_clonedArticles$confi = clonedArticles[configStepOPG.targetArticles[_i]].getArticleOptionState(configStepOPV.option)) === null || _clonedArticles$confi === void 0 ? void 0 : _clonedArticles$confi.valCodex;
38260
+ valCodex = (_clonedArticles$confi = clonedArticles[configStepOPG.targetArticles[_i2]].getArticleOptionState(configStepOPV.option)) === null || _clonedArticles$confi === void 0 ? void 0 : _clonedArticles$confi.valCodex;
37326
38261
  sel = alreadyCalcedVisibleOPVs.find(function (c) {
37327
38262
  return c.codex == valCodex;
37328
38263
  });
37329
38264
  if (sel) sel.sel = true;
37330
38265
  case 3:
37331
38266
  case "end":
37332
- return _context.stop();
38267
+ return _context2.stop();
37333
38268
  }
37334
- }, _loop5);
38269
+ }, _loop7);
37335
38270
  });
37336
- _i = 0;
37337
- case 69:
37338
- if (!(_i < configStepOPG.targetArticles.length)) {
37339
- _context3.next = 74;
38271
+ _i2 = 0;
38272
+ case 27:
38273
+ if (!(_i2 < configStepOPG.targetArticles.length)) {
38274
+ _context4.next = 32;
37340
38275
  break;
37341
38276
  }
37342
- return _context3.delegateYield(_loop5(), "t1", 71);
37343
- case 71:
37344
- _i++;
37345
- _context3.next = 69;
38277
+ return _context4.delegateYield(_loop7(), "t0", 29);
38278
+ case 29:
38279
+ _i2++;
38280
+ _context4.next = 27;
37346
38281
  break;
37347
- case 74:
38282
+ case 32:
37348
38283
  configItems = configItems.concat(alreadyCalcedVisibleOPVs);
37349
- _context3.next = 91;
38284
+ _context4.next = 49;
37350
38285
  break;
37351
- case 77:
37352
- visibleOptionValues = useFastPath ? (_targetArticle$engine = (_targetArticle$engine2 = targetArticle.engine).evalVisibleOptionValuesForFeature) === null || _targetArticle$engine === void 0 ? void 0 : _targetArticle$engine.call(_targetArticle$engine2, ops.optionCodex, _defineProperty__default["default"]({}, opg.optionCodex, opgValue.codex)) : undefined;
38286
+ case 35:
38287
+ visibleOptionValues = useFastPath ? (_targetArticle$engine3 = (_targetArticle$engine4 = targetArticle.engine).evalVisibleOptionValuesForFeature) === null || _targetArticle$engine3 === void 0 ? void 0 : _targetArticle$engine3.call(_targetArticle$engine4, ops.optionCodex, _defineProperty__default["default"]({}, opg.optionCodex, opgValue.codex)) : undefined;
37353
38288
  if (!(!visibleOptionValues || !fastPathValidated)) {
37354
- _context3.next = 87;
38289
+ _context4.next = 45;
37355
38290
  break;
37356
38291
  }
37357
- _context3.next = 81;
38292
+ _context4.next = 39;
37358
38293
  return articleHandlerInstance.updateCfgValues(targetArticle, variantValues, {}, true, !mergedOptionOnPartlistArticle, true, true);
37359
- case 81:
38294
+ case 39:
37360
38295
  updatedOps = targetArticle.getArticleOptionState(ops.optionCodex);
37361
38296
  if (updatedOps) {
37362
- _context3.next = 85;
38297
+ _context4.next = 43;
37363
38298
  break;
37364
38299
  }
37365
38300
  LOG$c.warn('[mergesToOPG] option state ' + ops.optionCodex + ' not found after setting ' + opg.optionCodex + '=' + opgValue.codex);
37366
- return _context3.abrupt("continue", 91);
37367
- case 85:
38301
+ return _context4.abrupt("continue", 49);
38302
+ case 43:
37368
38303
  if (visibleOptionValues) {
37369
38304
  fastPathKeys = JSON.stringify(Array.from(visibleOptionValues.keys()));
37370
38305
  fullKeys = JSON.stringify(Array.from(updatedOps.visibleOptionValues.keys()));
@@ -37375,31 +38310,31 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37375
38310
  }
37376
38311
  }
37377
38312
  visibleOptionValues = updatedOps.visibleOptionValues;
37378
- case 87:
37379
- _retVal2 = this.prepareConfigItemsForView(clonedSet, optionState, visibleOptionValues, retValues.constructionRules, [], step.configStep.targetArticles, (_ops$optionOcd2 = ops.optionOcd) !== null && _ops$optionOcd2 !== void 0 ? _ops$optionOcd2 : ops.optionCodex, opgValue.name, opgValue.codex, opg.optionCodex);
37380
- configItems = configItems.concat(_retVal2.myConfigItemsForView);
37381
- clonedConfigItemsForView = JSON.parse(JSON.stringify(_retVal2.myConfigItemsForView));
38313
+ case 45:
38314
+ retVal = this.prepareConfigItemsForView(clonedSet, optionState, visibleOptionValues, constructionRules, [], step.configStep.targetArticles, (_ops$optionOcd3 = ops.optionOcd) !== null && _ops$optionOcd3 !== void 0 ? _ops$optionOcd3 : ops.optionCodex, opgValue.name, opgValue.codex, opg.optionCodex, parentNames === null || parentNames === void 0 ? void 0 : parentNames.get(opgValue.codex));
38315
+ configItems = configItems.concat(retVal.myConfigItemsForView);
38316
+ clonedConfigItemsForView = JSON.parse(JSON.stringify(retVal.myConfigItemsForView));
37382
38317
  targetArticle.addMergesToOPG(opg.optionCodex + '_' + opgValue.codex, JSON.stringify(targetArticle.getVariantValuesTillOPT(opg.optionCodex)), clonedConfigItemsForView);
37383
- case 91:
37384
- _context3.next = 61;
38318
+ case 49:
38319
+ _context4.next = 19;
37385
38320
  break;
37386
- case 93:
37387
- _context3.next = 98;
38321
+ case 51:
38322
+ _context4.next = 56;
37388
38323
  break;
37389
- case 95:
37390
- _context3.prev = 95;
37391
- _context3.t2 = _context3["catch"](59);
37392
- _iterator13.e(_context3.t2);
37393
- case 98:
37394
- _context3.prev = 98;
37395
- _iterator13.f();
37396
- return _context3.finish(98);
37397
- case 101:
37398
- _loop4 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop4() {
38324
+ case 53:
38325
+ _context4.prev = 53;
38326
+ _context4.t1 = _context4["catch"](17);
38327
+ _iterator17.e(_context4.t1);
38328
+ case 56:
38329
+ _context4.prev = 56;
38330
+ _iterator17.f();
38331
+ return _context4.finish(56);
38332
+ case 59:
38333
+ _loop6 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop6() {
37399
38334
  var _clonedArticles$confi2;
37400
38335
  var valCodex, sel;
37401
- return _regeneratorRuntime__default["default"].wrap(function _loop4$(_context2) {
37402
- while (1) switch (_context2.prev = _context2.next) {
38336
+ return _regeneratorRuntime__default["default"].wrap(function _loop6$(_context3) {
38337
+ while (1) switch (_context3.prev = _context3.next) {
37403
38338
  case 0:
37404
38339
  valCodex = i == 0 ? selectedOpv : (_clonedArticles$confi2 = clonedArticles[configStepOPG.targetArticles[i]].getArticleOptionState(configStepOPV.option)) === null || _clonedArticles$confi2 === void 0 ? void 0 : _clonedArticles$confi2.valCodex;
37405
38340
  sel = configItems.find(function (c) {
@@ -37411,48 +38346,34 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37411
38346
  }
37412
38347
  case 3:
37413
38348
  case "end":
37414
- return _context2.stop();
38349
+ return _context3.stop();
37415
38350
  }
37416
- }, _loop4);
38351
+ }, _loop6);
37417
38352
  });
37418
38353
  i = 0;
37419
- case 103:
38354
+ case 61:
37420
38355
  if (!(i < configStepOPG.targetArticles.length)) {
37421
- _context3.next = 108;
38356
+ _context4.next = 66;
37422
38357
  break;
37423
38358
  }
37424
- return _context3.delegateYield(_loop4(), "t3", 105);
37425
- case 105:
38359
+ return _context4.delegateYield(_loop6(), "t2", 63);
38360
+ case 63:
37426
38361
  i++;
37427
- _context3.next = 103;
38362
+ _context4.next = 61;
37428
38363
  break;
37429
- case 108:
37430
- return _context3.abrupt("return", {
37431
- configItems: configItems,
37432
- option: optionCodex ? optionState.option : undefined,
37433
- selectedItems: selectedItems.map(function (sel) {
37434
- return configItems.find(function (c) {
37435
- return c.codex === sel;
37436
- });
37437
- }),
37438
- notTotallyMatichingOPVs: !set.CatalogData.articleConfigAll ? retValues.notTotallyMatichingOPVs : undefined
37439
- });
37440
- case 111:
37441
- return _context3.abrupt("return", {
37442
- configItems: [],
37443
- selectedItems: []
37444
- });
37445
- case 112:
38364
+ case 66:
38365
+ return _context4.abrupt("return", configItems);
38366
+ case 67:
37446
38367
  case "end":
37447
- return _context3.stop();
38368
+ return _context4.stop();
37448
38369
  }
37449
- }, _callee, this, [[13, 28, 31, 34], [59, 95, 98, 101]]);
38370
+ }, _callee2, this, [[17, 53, 56, 59]]);
37450
38371
  }));
37451
- function getConifgItemsForView(_x, _x2) {
37452
- return _getConifgItemsForView.apply(this, arguments);
38372
+ function mergeOPGItemsByReconfiguration(_x3, _x4, _x5, _x6, _x7, _x8, _x9) {
38373
+ return _mergeOPGItemsByReconfiguration.apply(this, arguments);
37453
38374
  }
37454
- return getConifgItemsForView;
37455
- }()
38375
+ return mergeOPGItemsByReconfiguration;
38376
+ }())
37456
38377
  }, {
37457
38378
  key: "getConfigItems",
37458
38379
  value: function getConfigItems(key, articles, configTree) {
@@ -37490,11 +38411,11 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37490
38411
  constructionRules = myOptionState.constructionRules;
37491
38412
  configItems = new Map(myOptionState.visibleOptionValues);
37492
38413
  } else {
37493
- var _iterator14 = _createForOfIteratorHelper$9(configItems.keys()),
37494
- _step14;
38414
+ var _iterator18 = _createForOfIteratorHelper$9(configItems.keys()),
38415
+ _step18;
37495
38416
  try {
37496
- var _loop6 = function _loop6() {
37497
- var key = _step14.value;
38417
+ var _loop8 = function _loop8() {
38418
+ var key = _step18.value;
37498
38419
  if (!myOptionState.visibleOptionValues.get(key) && !myOptionState.visibleOptionValues.values().find(function (v) {
37499
38420
  var _configItems$get;
37500
38421
  return v.sameopv && v.sameopv == ((_configItems$get = configItems.get(key)) === null || _configItems$get === void 0 ? void 0 : _configItems$get.sameopv);
@@ -37502,13 +38423,13 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37502
38423
  configItems["delete"](key);
37503
38424
  }
37504
38425
  };
37505
- for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
37506
- _loop6();
38426
+ for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
38427
+ _loop8();
37507
38428
  }
37508
38429
  } catch (err) {
37509
- _iterator14.e(err);
38430
+ _iterator18.e(err);
37510
38431
  } finally {
37511
- _iterator14.f();
38432
+ _iterator18.f();
37512
38433
  }
37513
38434
  }
37514
38435
  } else if (i == 0 && configStep.targetArticles.length == 1) {
@@ -37530,12 +38451,12 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37530
38451
  }
37531
38452
  if (visibleOptionValuesOfArticles.length > 0) {
37532
38453
  configItems = new Map(visibleOptionValuesOfArticles[0]);
37533
- var _loop7 = function _loop7(_i2) {
38454
+ var _loop9 = function _loop9(_i3) {
37534
38455
  var _article$getArticleOp2;
37535
- var article = articles[configStep.targetArticles[_i2]];
38456
+ var article = articles[configStep.targetArticles[_i3]];
37536
38457
  if ((_article$getArticleOp2 = article.getArticleOptionStateFlat(configStep.option)) !== null && _article$getArticleOp2 !== void 0 && _article$getArticleOp2.definedBySetFeatureFixed) return 1; // continue
37537
38458
  var keys = Array.from(configItems.keys());
37538
- var newKeys = Array.from(visibleOptionValuesOfArticles[_i2].keys());
38459
+ var newKeys = Array.from(visibleOptionValuesOfArticles[_i3].keys());
37539
38460
  var opvsOnlyInA = keys.filter(function (x) {
37540
38461
  return !newKeys.includes(x);
37541
38462
  });
@@ -37543,12 +38464,12 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37543
38464
  return !keys.includes(x);
37544
38465
  });
37545
38466
  if (opvsOnlyInA.length && opvsOnlyInB.length) {
37546
- var _loop8 = function _loop8() {
38467
+ var _loop10 = function _loop10() {
37547
38468
  var opva = configItems.get(opvsOnlyInA[j]);
37548
38469
  if (!opva) return 1; // continue
37549
38470
  var sameOPVExists = opvsOnlyInB.find(function (opvb) {
37550
38471
  var _visibleOptionValuesO;
37551
- return opva.sameopv && opva.sameopv == ((_visibleOptionValuesO = visibleOptionValuesOfArticles[_i2].get(opvb)) === null || _visibleOptionValuesO === void 0 ? void 0 : _visibleOptionValuesO.sameopv);
38472
+ return opva.sameopv && opva.sameopv == ((_visibleOptionValuesO = visibleOptionValuesOfArticles[_i3].get(opvb)) === null || _visibleOptionValuesO === void 0 ? void 0 : _visibleOptionValuesO.sameopv);
37552
38473
  });
37553
38474
  if (sameOPVExists) {
37554
38475
  opvsOnlyInA.splice(j, 1);
@@ -37556,37 +38477,37 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37556
38477
  }
37557
38478
  };
37558
38479
  for (var j = opvsOnlyInA.length - 1; j >= 0; j--) {
37559
- if (_loop8()) continue;
38480
+ if (_loop10()) continue;
37560
38481
  }
37561
38482
  } else if (opvsOnlyInA.length) {
37562
- var _loop9 = function _loop9() {
38483
+ var _loop11 = function _loop11() {
37563
38484
  var opva = configItems.get(opvsOnlyInA[_j]);
37564
38485
  if (!opva) return 1; // continue
37565
38486
  var sameOPVExists = newKeys.find(function (opvb) {
37566
38487
  var _visibleOptionValuesO2;
37567
- return opva.sameopv && opva.sameopv == ((_visibleOptionValuesO2 = visibleOptionValuesOfArticles[_i2].get(opvb)) === null || _visibleOptionValuesO2 === void 0 ? void 0 : _visibleOptionValuesO2.sameopv);
38488
+ return opva.sameopv && opva.sameopv == ((_visibleOptionValuesO2 = visibleOptionValuesOfArticles[_i3].get(opvb)) === null || _visibleOptionValuesO2 === void 0 ? void 0 : _visibleOptionValuesO2.sameopv);
37568
38489
  });
37569
38490
  if (sameOPVExists) {
37570
38491
  opvsOnlyInA.splice(_j, 1);
37571
38492
  }
37572
38493
  };
37573
38494
  for (var _j = opvsOnlyInA.length - 1; _j >= 0; _j--) {
37574
- if (_loop9()) continue;
38495
+ if (_loop11()) continue;
37575
38496
  }
37576
38497
  } else if (opvsOnlyInB.length) {
37577
- var _loop10 = function _loop10() {
38498
+ var _loop12 = function _loop12() {
37578
38499
  var opva = configItems.get(opvsOnlyInB[_j2]);
37579
38500
  if (!opva) return 1; // continue
37580
38501
  var sameOPVExists = keys.find(function (opvb) {
37581
38502
  var _visibleOptionValuesO3;
37582
- return opva.sameopv && opva.sameopv == ((_visibleOptionValuesO3 = visibleOptionValuesOfArticles[_i2].get(opvb)) === null || _visibleOptionValuesO3 === void 0 ? void 0 : _visibleOptionValuesO3.sameopv);
38503
+ return opva.sameopv && opva.sameopv == ((_visibleOptionValuesO3 = visibleOptionValuesOfArticles[_i3].get(opvb)) === null || _visibleOptionValuesO3 === void 0 ? void 0 : _visibleOptionValuesO3.sameopv);
37583
38504
  });
37584
38505
  if (sameOPVExists) {
37585
38506
  opvsOnlyInB.splice(_j2, 1);
37586
38507
  }
37587
38508
  };
37588
38509
  for (var _j2 = opvsOnlyInB.length - 1; _j2 >= 0; _j2--) {
37589
- if (_loop10()) continue;
38510
+ if (_loop12()) continue;
37590
38511
  }
37591
38512
  }
37592
38513
  var differentOPVs = opvsOnlyInA.concat(opvsOnlyInB);
@@ -37594,8 +38515,8 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37594
38515
  notTotallyMatichingOPVs = true;
37595
38516
  }
37596
38517
  };
37597
- for (var _i2 = 1; _i2 < visibleOptionValuesOfArticles.length; _i2++) {
37598
- if (_loop7(_i2)) continue;
38518
+ for (var _i3 = 1; _i3 < visibleOptionValuesOfArticles.length; _i3++) {
38519
+ if (_loop9(_i3)) continue;
37599
38520
  }
37600
38521
  }
37601
38522
  return {
@@ -37624,11 +38545,11 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37624
38545
  ret = false;
37625
38546
  var articles = set.getDivaArticles();
37626
38547
  for (var basketId in articles) {
37627
- var _iterator15 = _createForOfIteratorHelper$9(articles[basketId].articleOptionStates.values()),
37628
- _step15;
38548
+ var _iterator19 = _createForOfIteratorHelper$9(articles[basketId].articleOptionStates.values()),
38549
+ _step19;
37629
38550
  try {
37630
- for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
37631
- var ops = _step15.value;
38551
+ for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
38552
+ var ops = _step19.value;
37632
38553
  if (ops.headerPosVariationType == 'K') {
37633
38554
  if (optionValues[ops.optionCodex] == undefined) {
37634
38555
  optionValues[ops.optionCodex] = ops.valCodex ? ops.valCodex : null;
@@ -37641,9 +38562,9 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37641
38562
  }
37642
38563
  }
37643
38564
  } catch (err) {
37644
- _iterator15.e(err);
38565
+ _iterator19.e(err);
37645
38566
  } finally {
37646
- _iterator15.f();
38567
+ _iterator19.f();
37647
38568
  }
37648
38569
  if (ret == true) break;
37649
38570
  }
@@ -37667,8 +38588,8 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37667
38588
  var visibleHistory = [];
37668
38589
  var lastVisible = !((_this$getSnapshotOpt$ = (_this$getSnapshotOpt = this.getSnapshotOpt(stack[0].snapshots.before, ops.optionCodex)) === null || _this$getSnapshotOpt === void 0 ? void 0 : _this$getSnapshotOpt.invisible) !== null && _this$getSnapshotOpt$ !== void 0 ? _this$getSnapshotOpt$ : true);
37669
38590
  var toDecisionNo = function toDecisionNo(entry) {
37670
- var _ref, _Number, _entry$decision, _entry$decision2;
37671
- var nr = (_ref = (_Number = (_entry$decision = entry.decision) === null || _entry$decision === void 0 ? void 0 : _entry$decision.Number) !== null && _Number !== void 0 ? _Number : (_entry$decision2 = entry.decision) === null || _entry$decision2 === void 0 ? void 0 : _entry$decision2.decisionNo) !== null && _ref !== void 0 ? _ref : entry.nr;
38591
+ var _ref4, _Number, _entry$decision, _entry$decision2;
38592
+ var nr = (_ref4 = (_Number = (_entry$decision = entry.decision) === null || _entry$decision === void 0 ? void 0 : _entry$decision.Number) !== null && _Number !== void 0 ? _Number : (_entry$decision2 = entry.decision) === null || _entry$decision2 === void 0 ? void 0 : _entry$decision2.decisionNo) !== null && _ref4 !== void 0 ? _ref4 : entry.nr;
37672
38593
  return typeof nr === 'number' ? nr : Number(nr) || 0;
37673
38594
  };
37674
38595
  for (var i = 0; i < stack.length; i++) {
@@ -37737,11 +38658,11 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37737
38658
  var lastVisible = (_this$getSnapshotOpt$2 = (_this$getSnapshotOpt2 = this.getSnapshotOpt(stack[0].snapshots.before, optionCodex)) === null || _this$getSnapshotOpt2 === void 0 || (_this$getSnapshotOpt2 = _this$getSnapshotOpt2.visibleOPVs) === null || _this$getSnapshotOpt2 === void 0 ? void 0 : _this$getSnapshotOpt2.includes(opvCodex)) !== null && _this$getSnapshotOpt$2 !== void 0 ? _this$getSnapshotOpt$2 : false;
37738
38659
  var lastSel = (_this$getSnapshotOpt$3 = (_this$getSnapshotOpt3 = this.getSnapshotOpt(stack[0].snapshots.before, optionCodex)) === null || _this$getSnapshotOpt3 === void 0 ? void 0 : _this$getSnapshotOpt3.selOPV) !== null && _this$getSnapshotOpt$3 !== void 0 ? _this$getSnapshotOpt$3 : '';
37739
38660
  var toDecisionNo = function toDecisionNo(entry) {
37740
- var _ref2, _Number2, _entry$decision3, _entry$decision4;
37741
- var nr = (_ref2 = (_Number2 = (_entry$decision3 = entry.decision) === null || _entry$decision3 === void 0 ? void 0 : _entry$decision3.Number) !== null && _Number2 !== void 0 ? _Number2 : (_entry$decision4 = entry.decision) === null || _entry$decision4 === void 0 ? void 0 : _entry$decision4.decisionNo) !== null && _ref2 !== void 0 ? _ref2 : entry.nr;
38661
+ var _ref5, _Number2, _entry$decision3, _entry$decision4;
38662
+ var nr = (_ref5 = (_Number2 = (_entry$decision3 = entry.decision) === null || _entry$decision3 === void 0 ? void 0 : _entry$decision3.Number) !== null && _Number2 !== void 0 ? _Number2 : (_entry$decision4 = entry.decision) === null || _entry$decision4 === void 0 ? void 0 : _entry$decision4.decisionNo) !== null && _ref5 !== void 0 ? _ref5 : entry.nr;
37742
38663
  return typeof nr === 'number' ? nr : Number(nr) || 0;
37743
38664
  };
37744
- var _loop11 = function _loop11() {
38665
+ var _loop13 = function _loop13() {
37745
38666
  var _before$visibleOPVs, _after$visibleOPVs$in, _after$visibleOPVs2, _after$selOPV;
37746
38667
  var entry = stack[i];
37747
38668
  var before = _this.getSnapshotOpt(entry.snapshots.before, optionCodex);
@@ -37762,7 +38683,7 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37762
38683
  lastSel = newSel;
37763
38684
  };
37764
38685
  for (var i = 0; i < stack.length; i++) {
37765
- _loop11();
38686
+ _loop13();
37766
38687
  }
37767
38688
  result.visible = lastVisible;
37768
38689
  return result;
@@ -37771,7 +38692,9 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37771
38692
  key: "prepareConfigItemsForView",
37772
38693
  value: function prepareConfigItemsForView(set, ops, myConfigItems, constructionRules, selectedVals, targetArticles, optionCodex,
37773
38694
  //bei einer OPG wird hier dessen hauptoptionCodex Übergeben
37774
- idmOpgGroupName, idmOpgValCodex, idmOpgOptionCodex, freeTextValue, freeTextLang) {
38695
+ idmOpgGroupName, idmOpgValCodex, idmOpgOptionCodex, idmOpgParentName,
38696
+ //dropdown header above the group: the invisible parent family's OPV name (e.g. Preisgruppe)
38697
+ freeTextValue, freeTextLang) {
37775
38698
  var _this2 = this;
37776
38699
  var myConfigItemsForView = [];
37777
38700
  var objectKeys = Array.from(myConfigItems.keys());
@@ -37780,8 +38703,8 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37780
38703
  myConfigItems = new Map(ops.option.articleOptionValues);
37781
38704
  }
37782
38705
  var groupContentItemIdObject = this.getGroupContentItemIdObject(Array.from(myConfigItems.values()), idmOpgGroupName);
37783
- var _loop12 = function _loop12() {
37784
- var _ops$optionOcd3, _item$images, _item$colorGroups, _item$pdfUrl, _item$url, _ops$option$checkForR;
38706
+ var _loop14 = function _loop14() {
38707
+ var _ops$optionOcd4, _item$images, _item$colorGroups, _item$pdfUrl, _item$url, _ops$option$checkForR;
37785
38708
  var item = myConfigItems.get(objectKeys[i]);
37786
38709
  if (!item) throw new Error('item ' + objectKeys[i] + ' not found in myConfigItems');
37787
38710
  var key = objectKeys[i];
@@ -37800,7 +38723,7 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37800
38723
  if (imageFromVisibleOPVsImages) {
37801
38724
  image = imageFromVisibleOPVsImages;
37802
38725
  }
37803
- var isFav = favoritesHandlerInstance.isFavorite(set, targetArticles, item, (_ops$optionOcd3 = ops.optionOcd) !== null && _ops$optionOcd3 !== void 0 ? _ops$optionOcd3 : optionCodex);
38726
+ var isFav = favoritesHandlerInstance.isFavorite(set, targetArticles, item, (_ops$optionOcd4 = ops.optionOcd) !== null && _ops$optionOcd4 !== void 0 ? _ops$optionOcd4 : optionCodex);
37804
38727
  var isSelected = !!selectedVals.find(function (opv) {
37805
38728
  return opv == item.codex;
37806
38729
  });
@@ -37818,7 +38741,7 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37818
38741
  zoomImage: zoomImage,
37819
38742
  hexColor: item.hexColor,
37820
38743
  groupName: groupName,
37821
- parentName: !idmOpgOptionCodex && (!set.CatalogData.hidePriceGroupsOfOPGs || !item.isParentOPVG) ? item.parentName : undefined,
38744
+ parentName: idmOpgOptionCodex ? !set.CatalogData.hidePriceGroupsOfOPGs ? idmOpgParentName : undefined : !set.CatalogData.hidePriceGroupsOfOPGs || !item.isParentOPVG ? item.parentName : undefined,
37822
38745
  longDescription: item.description,
37823
38746
  text: item.name + (item.isFreeText && freeTextToUse ? ': ' + freeTextToUse : ''),
37824
38747
  rals: item.rals,
@@ -37855,7 +38778,7 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37855
38778
  });
37856
38779
  };
37857
38780
  for (var i = 0; i < objectKeys.length; i++) {
37858
- if (_loop12()) continue;
38781
+ if (_loop14()) continue;
37859
38782
  }
37860
38783
  return {
37861
38784
  myConfigItemsForView: myConfigItemsForView
@@ -37889,12 +38812,12 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37889
38812
  for (var iKey in optionStatesOfArticles) {
37890
38813
  //hier evtl. die Article mit einer gewissen reihenfolge durchlaufen!
37891
38814
  var optionsStates = optionStatesOfArticles[iKey];
37892
- var _iterator16 = _createForOfIteratorHelper$9(optionsStates.values()),
37893
- _step16;
38815
+ var _iterator20 = _createForOfIteratorHelper$9(optionsStates.values()),
38816
+ _step20;
37894
38817
  try {
37895
- for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
38818
+ for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
37896
38819
  var _ops$addToMeasure2;
37897
- var ops = _step16.value;
38820
+ var ops = _step20.value;
37898
38821
  var selectionmode = ops.selectionmode;
37899
38822
  if (set.CatalogData.forceConfigSingle && (selectionmode == 1 || selectionmode == 2)) selectionmode = 3;
37900
38823
  if (ops.isInvisible || selectionmode == 0 || !ops.isDoShow || ops.visibleCount == 0 || !!((_ops$addToMeasure2 = ops.addToMeasure) !== null && _ops$addToMeasure2 !== void 0 && _ops$addToMeasure2.length)) {
@@ -37902,9 +38825,9 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
37902
38825
  }
37903
38826
  }
37904
38827
  } catch (err) {
37905
- _iterator16.e(err);
38828
+ _iterator20.e(err);
37906
38829
  } finally {
37907
- _iterator16.f();
38830
+ _iterator20.f();
37908
38831
  }
37909
38832
  }
37910
38833
  return configTree;
@@ -38396,7 +39319,7 @@ var DivaSet = /*#__PURE__*/function () {
38396
39319
  var allAccs = [];
38397
39320
  var articles = this.getDivaArticles();
38398
39321
  var article = articles[basketId];
38399
- if (!article) throw new Error('article ' + basketId + ' does not exist');
39322
+ if (!article) return curNum;
38400
39323
  var myParentArticle = article.getBaseParent();
38401
39324
  var _this$getSplitPlanned = this.getSplitPlannedAccessoiresOfBasketId(basketId),
38402
39325
  notPlannedAcc = _this$getSplitPlanned.notPlannedAcc,
@@ -39305,7 +40228,7 @@ var DivaSet = /*#__PURE__*/function () {
39305
40228
  break;
39306
40229
  }
39307
40230
  _context5.next = 3;
39308
- return Promise.resolve().then(function () { return require('./DoorPlanner-9ea7a6aa.js'); });
40231
+ return Promise.resolve().then(function () { return require('./DoorPlanner-2350aacc.js'); });
39309
40232
  case 3:
39310
40233
  _yield$import = _context5.sent;
39311
40234
  DoorPlanner = _yield$import["default"];
@@ -42695,7 +43618,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
42695
43618
  newArticle.accessoireParentArticle = set.getArticleByBasketId(newArticle.relatedToBasketId);
42696
43619
  }
42697
43620
  //holt die bereits gesetzten Option welche beim neuen Article übernommen werden könnten
42698
- defaultHeaderValues = articleHandlerInstance.getDefaultValuesOfArticles(set.getDivaArticles()); //falls die SVGs im frontend ausmultipliziert wurden hier die regel des SVGs als VariantValues anwenden
43621
+ defaultHeaderValues = initParams.dontInheritSetValues ? {} : articleHandlerInstance.getDefaultValuesOfArticles(set.getDivaArticles()); //falls die SVGs im frontend ausmultipliziert wurden hier die regel des SVGs als VariantValues anwenden
42699
43622
  if (initParams.svgJsonFormula && newArticle.catalogArticle.svgsAreMultiplied) {
42700
43623
  defaultHeaderValues = DivaUtils__default["default"].getVariantValuesFromRule(initParams.svgJsonFormula, defaultHeaderValues);
42701
43624
  }
@@ -44543,7 +45466,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
44543
45466
  value: (function () {
44544
45467
  var _updateArticlesOptionStatesOfActSet = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee35(set, myValues, targetArticlesWithNewValues, ignorePlanner, from, partlistDiff, forceUpdate) {
44545
45468
  var _resultPlannerUpdate;
44546
- var elementsToDeleteById, targetArticlesToUpdateOnly, previousValues, articles, article, optState, retValues, diff, resultPlannerUpdate, targetElementIds, i, articleToDel, index, result, articleCopyRelation, newArticle, rpu, copyIndex;
45469
+ var elementsToDeleteById, targetArticlesToUpdateOnly, previousValues, mayNeedRollback, articles, article, optState, retValues, diff, resultPlannerUpdate, targetElementIds, i, articleToDel, index, result, articleCopyRelation, newArticle, rpu, copyIndex;
44547
45470
  return _regeneratorRuntime__default["default"].wrap(function _callee35$(_context37) {
44548
45471
  while (1) switch (_context37.prev = _context37.next) {
44549
45472
  case 0:
@@ -44558,63 +45481,71 @@ var DivaSetHandler = /*#__PURE__*/function () {
44558
45481
  targetArticlesToUpdateOnly = targetArticlesWithNewValues;
44559
45482
  }
44560
45483
  previousValues = {};
45484
+ /**
45485
+ * The ONLY reader of `previousValues` is the planner-rollback below, and that whole block is
45486
+ * skipped for `ignorePlanner` / `from === 'calcVariant'` callers. Snapshotting the article for
45487
+ * them meant a `getArticleJsonVariantValues()` plus a `structuredClone()` per call whose result
45488
+ * could never be read — and those callers are the hot ones: every variant sweep and every
45489
+ * catalog-test combination goes through 'calcVariant'.
45490
+ */
45491
+ mayNeedRollback = !ignorePlanner && from !== 'calcVariant';
44561
45492
  articles = set.getDivaArticles();
44562
- if (articles && targetArticlesWithNewValues && targetArticlesWithNewValues.length > 0 && myValues) {
45493
+ if (mayNeedRollback && articles && targetArticlesWithNewValues && targetArticlesWithNewValues.length > 0 && myValues) {
44563
45494
  article = articles[targetArticlesWithNewValues[0]];
44564
45495
  optState = article === null || article === void 0 ? void 0 : article.getArticleJsonVariantValues();
44565
45496
  previousValues = structuredClone(optState);
44566
45497
  }
44567
- _context37.next = 8;
45498
+ _context37.next = 9;
44568
45499
  return articleHandlerInstance.updateArticlesOptionStates(myValues, targetArticlesWithNewValues, targetArticlesToUpdateOnly, set.getDivaArticles(true), from);
44569
- case 8:
45500
+ case 9:
44570
45501
  retValues = _context37.sent;
44571
45502
  targetArticlesWithNewValues = retValues.targetArticlesToUpdate;
44572
45503
  if (!(retValues.partlistArticlesToLoad.length > 0)) {
44573
- _context37.next = 19;
45504
+ _context37.next = 20;
44574
45505
  break;
44575
45506
  }
44576
45507
  diff = targetArticlesToUpdateOnly.length - Object.keys(set.getDivaArticles()).length;
44577
45508
  if (!(diff == 0 || partlistDiff == diff)) {
44578
- _context37.next = 17;
45509
+ _context37.next = 18;
44579
45510
  break;
44580
45511
  }
44581
- _context37.next = 15;
45512
+ _context37.next = 16;
44582
45513
  return articleHandlerInstance.correctPartlistArticlesByGlobalRules(set, retValues.partlistArticlesToLoad, set.CatalogData.bundleRules, {
44583
45514
  doChange: false
44584
45515
  });
44585
- case 15:
44586
- _context37.next = 19;
45516
+ case 16:
45517
+ _context37.next = 20;
44587
45518
  break;
44588
- case 17:
44589
- _context37.next = 19;
45519
+ case 18:
45520
+ _context37.next = 20;
44590
45521
  return this.updateArticlesOptionStatesOfActSet(set, {}, targetArticlesWithNewValues, ignorePlanner, from, diff);
44591
- case 19:
45522
+ case 20:
44592
45523
  if (!(from !== 'initializingPartlist')) {
44593
- _context37.next = 22;
45524
+ _context37.next = 23;
44594
45525
  break;
44595
45526
  }
44596
- _context37.next = 22;
45527
+ _context37.next = 23;
44597
45528
  return this.updateEdoArticles(set, retValues.newEDOExtraArticles);
44598
- case 22:
45529
+ case 23:
44599
45530
  if (set.CatalogData.hasAlternateRenderings) set.CatalogData.updateAlternativeRenderings(set.getDivaArticles());
44600
45531
 
44601
45532
  //Update Planner - check if planner data changed
44602
45533
  if (!(!ignorePlanner && from != 'calcVariant')) {
44603
- _context37.next = 64;
45534
+ _context37.next = 65;
44604
45535
  break;
44605
45536
  }
44606
45537
  targetElementIds = this.getElementIdsOfArticles(set, targetArticlesWithNewValues);
44607
- _context37.next = 27;
45538
+ _context37.next = 28;
44608
45539
  return set.plannerHandler.updatePlanner(set.getSetId(), myValues, targetElementIds, forceUpdate);
44609
- case 27:
45540
+ case 28:
44610
45541
  resultPlannerUpdate = _context37.sent;
44611
45542
  if (!resultPlannerUpdate.failed) {
44612
- _context37.next = 31;
45543
+ _context37.next = 32;
44613
45544
  break;
44614
45545
  }
44615
- _context37.next = 31;
45546
+ _context37.next = 32;
44616
45547
  return articleHandlerInstance.updateArticlesOptionStates(previousValues, targetArticlesWithNewValues, targetArticlesToUpdateOnly, set.getDivaArticles(true), from);
44617
- case 31:
45548
+ case 32:
44618
45549
  elementsToDeleteById = resultPlannerUpdate.elemIdsToDelete;
44619
45550
  for (i = 0; i < resultPlannerUpdate.elemIdsToDelete.length; i++) {
44620
45551
  articleToDel = set.getArticleByElementId(resultPlannerUpdate.elemIdsToDelete[i]);
@@ -44624,58 +45555,58 @@ var DivaSetHandler = /*#__PURE__*/function () {
44624
45555
  }
44625
45556
  }
44626
45557
  if (!resultPlannerUpdate.doDeleteBackGrid) {
44627
- _context37.next = 40;
45558
+ _context37.next = 41;
44628
45559
  break;
44629
45560
  }
44630
- _context37.next = 36;
45561
+ _context37.next = 37;
44631
45562
  return this.deleteElementFromSetByElemId(set, resultPlannerUpdate.elemIdsToDelete[0], false, resultPlannerUpdate.deletionType);
44632
- case 36:
45563
+ case 37:
44633
45564
  result = _context37.sent;
44634
45565
  //Others are deleted recursive
44635
45566
  if (result.selectElementId) {
44636
45567
  resultPlannerUpdate.elementIdsToUpdateSelection = [result.selectElementId];
44637
45568
  }
44638
- _context37.next = 47;
45569
+ _context37.next = 48;
44639
45570
  break;
44640
- case 40:
44641
- i = 0;
44642
45571
  case 41:
45572
+ i = 0;
45573
+ case 42:
44643
45574
  if (!(i < resultPlannerUpdate.elemIdsToDelete.length)) {
44644
- _context37.next = 47;
45575
+ _context37.next = 48;
44645
45576
  break;
44646
45577
  }
44647
- _context37.next = 44;
45578
+ _context37.next = 45;
44648
45579
  return this.deleteElementFromSetByElemId(set, resultPlannerUpdate.elemIdsToDelete[i], false, resultPlannerUpdate.deletionType);
44649
- case 44:
45580
+ case 45:
44650
45581
  i++;
44651
- _context37.next = 41;
45582
+ _context37.next = 42;
44652
45583
  break;
44653
- case 47:
45584
+ case 48:
44654
45585
  if (!(resultPlannerUpdate.elementIdToCopy && resultPlannerUpdate.elementIdToCopy.length > 0)) {
44655
- _context37.next = 63;
45586
+ _context37.next = 64;
44656
45587
  break;
44657
45588
  }
44658
45589
  //Todo copy these elements
44659
45590
  articleCopyRelation = [];
44660
45591
  i = 0;
44661
- case 50:
45592
+ case 51:
44662
45593
  if (!(i < resultPlannerUpdate.elementIdToCopy.length)) {
44663
- _context37.next = 58;
45594
+ _context37.next = 59;
44664
45595
  break;
44665
45596
  }
44666
- _context37.next = 53;
45597
+ _context37.next = 54;
44667
45598
  return this.copyArticleByElementId(set, resultPlannerUpdate.elementIdToCopy[i], resultPlannerUpdate.ignoreOptionsToCopy);
44668
- case 53:
45599
+ case 54:
44669
45600
  newArticle = _context37.sent;
44670
45601
  articleCopyRelation.push({
44671
45602
  key: resultPlannerUpdate.elementIdToCopy[i],
44672
45603
  value: newArticle.basketId
44673
45604
  });
44674
- case 55:
45605
+ case 56:
44675
45606
  i++;
44676
- _context37.next = 50;
45607
+ _context37.next = 51;
44677
45608
  break;
44678
- case 58:
45609
+ case 59:
44679
45610
  rpu = resultPlannerUpdate;
44680
45611
  copyIndex = {
44681
45612
  x: rpu.copyDPType == 'AVL' ? -1 : rpu.copyDPType == 'AVR' ? 1 : 0,
@@ -44683,25 +45614,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
44683
45614
  z: rpu.copyType == 'BoxPlanner_backside' ? -1 : 0
44684
45615
  };
44685
45616
  if (!(resultPlannerUpdate.copyType == 'BoxPlanner_backside')) {
44686
- _context37.next = 63;
45617
+ _context37.next = 64;
44687
45618
  break;
44688
45619
  }
44689
- _context37.next = 63;
45620
+ _context37.next = 64;
44690
45621
  return set.plannerHandler.copyPlannerElements(set.getSetId(), articleCopyRelation, {
44691
45622
  copyIndex: copyIndex,
44692
45623
  copyType: resultPlannerUpdate.copyType,
44693
45624
  changedOPT: resultPlannerUpdate.changedOPT,
44694
45625
  targetElements: resultPlannerUpdate.targetElements
44695
45626
  });
44696
- case 63:
44697
- this.updatePosNrOfAccessoiresOfTargetArticles(set, targetArticlesWithNewValues);
44698
45627
  case 64:
45628
+ this.updatePosNrOfAccessoiresOfTargetArticles(set, targetArticlesWithNewValues);
45629
+ case 65:
44699
45630
  return _context37.abrupt("return", {
44700
45631
  articleCountChanged: elementsToDeleteById.length > 0,
44701
45632
  elementIdsToUpdateSelection: (_resultPlannerUpdate = resultPlannerUpdate) === null || _resultPlannerUpdate === void 0 ? void 0 : _resultPlannerUpdate.elementIdsToUpdateSelection,
44702
45633
  setId: set.getSetId()
44703
45634
  });
44704
- case 65:
45635
+ case 66:
44705
45636
  case "end":
44706
45637
  return _context37.stop();
44707
45638
  }
@@ -47133,7 +48064,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
47133
48064
  break;
47134
48065
  case 3:
47135
48066
  _context12.next = 5;
47136
- return Promise.resolve().then(function () { return require('./PfisterWWSHandler-1a240ebf.js'); });
48067
+ return Promise.resolve().then(function () { return require('./PfisterWWSHandler-be3ebeaa.js'); });
47137
48068
  case 5:
47138
48069
  _yield$import = _context12.sent;
47139
48070
  PfisterWWSHandler = _yield$import["default"];
@@ -47141,7 +48072,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
47141
48072
  return _context12.abrupt("break", 27);
47142
48073
  case 9:
47143
48074
  _context12.next = 11;
47144
- return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-fbc83326.js'); });
48075
+ return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-1efa9da7.js'); });
47145
48076
  case 11:
47146
48077
  _yield$import2 = _context12.sent;
47147
48078
  LiviqueWWSHandler = _yield$import2["default"];
@@ -47149,7 +48080,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
47149
48080
  return _context12.abrupt("break", 27);
47150
48081
  case 15:
47151
48082
  _context12.next = 17;
47152
- return Promise.resolve().then(function () { return require('./SeriousBasketHandler-f492ea60.js'); });
48083
+ return Promise.resolve().then(function () { return require('./SeriousBasketHandler-6d4d921a.js'); });
47153
48084
  case 17:
47154
48085
  _yield$import3 = _context12.sent;
47155
48086
  SeriousWWSHandler = _yield$import3["default"];
@@ -47157,7 +48088,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
47157
48088
  return _context12.abrupt("break", 27);
47158
48089
  case 21:
47159
48090
  _context12.next = 23;
47160
- return Promise.resolve().then(function () { return require('./StandardWWSHandler-6187c7c9.js'); });
48091
+ return Promise.resolve().then(function () { return require('./StandardWWSHandler-c84a70a7.js'); });
47161
48092
  case 23:
47162
48093
  _yield$import4 = _context12.sent;
47163
48094
  StandardWWSHandler = _yield$import4["default"];
@@ -48544,7 +49475,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
48544
49475
  //If we need real time rendering initialize the SignalR and 3D host connection Handler
48545
49476
  bootMark('signalr: chunk import start');
48546
49477
  _context3.next = 3;
48547
- return Promise.resolve().then(function () { return require('./Host3DSignalR-9710fc4e.js'); });
49478
+ return Promise.resolve().then(function () { return require('./Host3DSignalR-dad3c3fd.js'); });
48548
49479
  case 3:
48549
49480
  _yield$import = _context3.sent;
48550
49481
  Host3DSignalR = _yield$import["default"];
@@ -50276,7 +51207,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
50276
51207
  break;
50277
51208
  case 8:
50278
51209
  _context5.next = 10;
50279
- return Promise.resolve().then(function () { return require('./DivaStandardPlanner-d6cb5f39.js'); });
51210
+ return Promise.resolve().then(function () { return require('./DivaStandardPlanner-85b2b3ec.js'); });
50280
51211
  case 10:
50281
51212
  _yield$import = _context5.sent;
50282
51213
  DivaStandardPlanner = _yield$import["default"];
@@ -50287,7 +51218,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
50287
51218
  return _context5.abrupt("break", 21);
50288
51219
  case 15:
50289
51220
  _context5.next = 17;
50290
- return Promise.resolve().then(function () { return require('./DivaBoxPlanner-e772f6a3.js'); });
51221
+ return Promise.resolve().then(function () { return require('./DivaBoxPlanner-143d6027.js'); });
50291
51222
  case 17:
50292
51223
  _yield$import2 = _context5.sent;
50293
51224
  DivaBoxPlanner = _yield$import2["default"];
@@ -54631,13 +55562,6 @@ var DivaWebPlanner = /*#__PURE__*/function () {
54631
55562
  }()
54632
55563
  /*********************************END Functions in Logik called From View END *************************************/
54633
55564
  /*********************************** View attachment (Logik -> View) ***************************************/
54634
- /** True while a view is attached; false = headless (backoffice DIVA agent, artifact passes). */
54635
- }, {
54636
- key: "isViewAttached",
54637
- get: function get() {
54638
- return !!this.view;
54639
- }
54640
-
54641
55565
  /** Attach the view (initial mount or adoption of an existing, possibly headless instance). */
54642
55566
  }, {
54643
55567
  key: "attachView",
@@ -54663,15 +55587,39 @@ var DivaWebPlanner = /*#__PURE__*/function () {
54663
55587
 
54664
55588
  /**
54665
55589
  * Bring the view to a config step (and optionally one option value): the view does the
54666
- * actual navigation/scrolling. Used by the diva agent after it drives the configuration.
54667
- * No-op when headless.
55590
+ * actual navigation/scrolling. Used by the diva agent after it drives the configuration
55591
+ * and to point a step out to the user.
55592
+ *
55593
+ * Returns FALSE when headless — nothing was shown to anyone. Callers must report that
55594
+ * instead of assuming the user saw it; a silent no-op reads as success.
54668
55595
  */
54669
55596
  }, {
54670
55597
  key: "revealConfigStepInView",
54671
55598
  value: function revealConfigStepInView(configStepKey, optionValueCodex) {
54672
- var _this$view97, _this$view98;
54673
- (_this$view97 = this.view) === null || _this$view97 === void 0 || _this$view97.navigateToConfigStep(configStepKey, false);
54674
- if (optionValueCodex) (_this$view98 = this.view) === null || _this$view98 === void 0 || _this$view98.scrollToOptionValueInView(configStepKey, optionValueCodex);
55599
+ if (!this.view) return false;
55600
+ this.view.navigateToConfigStep(configStepKey, false);
55601
+ if (optionValueCodex) this.view.scrollToOptionValueInView(configStepKey, optionValueCodex);
55602
+ return true;
55603
+ }
55604
+
55605
+ /** Is a view attached — i.e. can a user actually see this instance? False = headless. */
55606
+ }, {
55607
+ key: "hasAttachedView",
55608
+ get: function get() {
55609
+ return !!this.view;
55610
+ }
55611
+
55612
+ /**
55613
+ * The config step the attached view currently shows. The read-back for
55614
+ * {@link revealConfigStepInView}: the view may land somewhere else (a step bound to
55615
+ * another option redirects to its group) or nowhere at all, so a caller that wants to
55616
+ * claim "the user is now looking at X" has to compare instead of trusting the call.
55617
+ */
55618
+ }, {
55619
+ key: "getCurConfigStepKeyInView",
55620
+ value: function getCurConfigStepKeyInView() {
55621
+ var _this$view97, _this$view97$getCurCo;
55622
+ return (_this$view97 = this.view) === null || _this$view97 === void 0 || (_this$view97$getCurCo = _this$view97.getCurConfigStepKey) === null || _this$view97$getCurCo === void 0 ? void 0 : _this$view97$getCurCo.call(_this$view97);
54675
55623
  }
54676
55624
 
54677
55625
  /***********************************Outside events the webPlanner subscribes to ******************************************/
@@ -57002,6 +57950,484 @@ var PlannerElementData = /*#__PURE__*/function () {
57002
57950
  }]);
57003
57951
  }();
57004
57952
 
57953
+ /**
57954
+ * The VALUE ENCODING of every catalog/article/option/option-value property, keyed by codex.
57955
+ *
57956
+ * A property's `Value` travels as a STRING and each property decides how that string is read - '1' for one flag,
57957
+ * 'true' for the next, a ';' list for a third. This table records which, so an editor can offer the right control
57958
+ * and write back exactly what the parser reads, and so a caller can validate a value before storing it.
57959
+ *
57960
+ * GENERATED from the four parsers - do not hand-edit; regenerate when a `case` is added there:
57961
+ * CatalogData.ts | CatalogArticleData.ts | CatalogOptionData.ts | CatalogOptionValueData.ts
57962
+ * `propertyValueCodec.test.ts` fails when a parser case has no entry here.
57963
+ */
57964
+
57965
+ /** The entity a property hangs on; the same codex can mean different things on different entities. */
57966
+
57967
+ /**
57968
+ * How the raw string is turned into a value. The boolean variants are NOT interchangeable: writing 'true' where
57969
+ * the parser tests `== '1'` silently yields false, and `boolean:present` treats EVERY non-empty string as true,
57970
+ * so its off-state is an ABSENT value rather than '0'.
57971
+ */
57972
+
57973
+ /** The encoding per property codex, for one entity. */
57974
+
57975
+ /** 95 properties parsed on the catalog entity. */
57976
+ var CATALOG_PROPERTIES = {
57977
+ '3D_COMPATIBLE_WITH_IMAGE_CACHE': 'boolean:1',
57978
+ ACCESSOIRE_STEP_AS_PLANNER: 'boolean:1',
57979
+ ADD_NEW_LINE_BEFOR_RULEDESC: 'boolean:1',
57980
+ ADD_PA_ON_EDO: 'opaque',
57981
+ ADD_POS_INVISIBILITY_TO_OL: 'boolean:1',
57982
+ ARTICLECONFIGALL: 'boolean:1',
57983
+ ARTICLECONFIGSINGLE: 'boolean:1',
57984
+ ARTICLE_NR: 'string',
57985
+ AUTO_OPEN_CONTENTITEM: 'all-or-list:;',
57986
+ BANNER: 'json',
57987
+ BUNDLE_RULES: 'json',
57988
+ CHECK_COLLISION_DIFFERENT_LAYERS: 'list:;',
57989
+ CONFIG_ACCESSOIRES: 'boolean:1',
57990
+ CONFIG_ONLY_ACCESSOIRES: 'boolean:1',
57991
+ DEFAULT_DO_SHOW_3DDIMENSIONS: 'boolean:1|true',
57992
+ DEFAULT_GROUPS_CLOSED: 'boolean-or-list:;',
57993
+ DIMENSION_CONFIG: 'json',
57994
+ DIVA3D_AR_FORCERTV: 'boolean:1',
57995
+ DIVA3D_AR_READY: 'boolean:1',
57996
+ DIVA3D_DISABLE_3DEXPORT: 'boolean:1',
57997
+ DIVA3D_PLANER_DIGITS: 'number',
57998
+ DIVA3D_PLANER_SHOW_ARTICLE_SVG: 'boolean:1',
57999
+ DIVA3D_RENDERING: 'boolean:1|true',
58000
+ DIVA3D_ROOM: 'string',
58001
+ DIVA3D_STATIC_BG_IMAGE_ROOMLIST: 'list:;',
58002
+ DIVA3D_USE_RTV_NEXT: 'boolean:1',
58003
+ DIVA_KI_READY: 'boolean:1|true',
58004
+ DOCKACCONAVOONLY: 'boolean:1',
58005
+ DONTCALCBASEPRICE: 'boolean:1',
58006
+ DONTHIDEOPTION: 'list:,',
58007
+ DONT_SAVE_ALTERNATIVERENDERINGS: 'boolean:1',
58008
+ DONT_SET_POSNR_FROM_PLANNER: 'boolean:1',
58009
+ DONT_SHOW_ACC_STEP: 'boolean:1',
58010
+ DONT_USE_VCODEX_FOR_BASKET: 'boolean:1',
58011
+ DO_SHOW_MAIN_DIMENSIONS: 'boolean:1|true',
58012
+ DO_USE_RULEDESC_FOR_PARTLIST: 'boolean:1',
58013
+ ELEMENT_COPY_AVLR: 'all-or-list:;',
58014
+ ENABLE_DO_SHOW_3DDIMENSIONS: 'boolean:1|true',
58015
+ FILTER_FOR_CHECKOUT_BUTTONS: 'list:;',
58016
+ FORCECONSTRUCTIONWARNINGARTICLES: 'list:;',
58017
+ FORCE_CONFIG_ALL_ACCESSOIRES: 'boolean:1',
58018
+ FORCE_CONFIG_SINGLE: 'boolean:1',
58019
+ HEADER_DIMENSION_IDS: 'list:;',
58020
+ HIDECOMPLETENESSWARNING: 'boolean:1',
58021
+ HIDECONSTRUCTIONWARNING: 'opaque',
58022
+ HIDE_2D_PLANNER: 'boolean:1',
58023
+ HIDE_AV_BUTTONS: 'string',
58024
+ HIDE_PLANNER_UI_ICONS: 'boolean:1',
58025
+ HIDE_PRICEPREVIEW_ON_OPTIONS: 'list:;',
58026
+ HIDE_PRICE_GROUPS_OF_OPGS: 'boolean:1',
58027
+ HIDE_SUBPOS_ARTICLECODEX_EKTEXT: 'boolean:1',
58028
+ IDM3D_CAT_CODEX: 'string',
58029
+ IDM3D_ENVIRONMENT: 'string',
58030
+ IGNOREDOCKINGNUMBER: 'boolean:1',
58031
+ IGNORELAYERAVC: 'boolean:1',
58032
+ IGNORELAYERAVNAVS: 'boolean:1',
58033
+ IGNORELAYERAVOAVU: 'boolean:1',
58034
+ IGNORE_ARTICLERELATIONS: 'boolean:1',
58035
+ IGNORE_ISDEFINED_CHECK: 'boolean:1',
58036
+ IGNORE_MAX_PRICE_AS_BASEPRICE: 'boolean:1',
58037
+ INIT_OPTIONTREE_TWICE: 'boolean:1',
58038
+ IS_IDM3D_CAT: 'boolean:1|true',
58039
+ MERGE_OPTIONS_TO_SAME_OPTION: 'list:;',
58040
+ NOTIFICATIONS: 'json',
58041
+ ONCONFIG_SINGLE_DONT_GENERALIZE: 'boolean:1',
58042
+ PARTLIST_POSTFIX: 'list:;',
58043
+ PLANNERTYPE: 'string',
58044
+ PLANNER_2DOT0: 'boolean:1',
58045
+ PLANNER_REPLACE_MODE: 'boolean:1',
58046
+ PLAN_2D_FONT_URL: 'string',
58047
+ PROGRAM_NR: 'string',
58048
+ RECONFIG_AFTER_ARTICLE_DOCKED: 'boolean:1',
58049
+ REPAIR_VARIANT_VALUES: 'opaque',
58050
+ RTV_PRESET: 'json',
58051
+ SHOWACCESSOIREONLASTTAB: 'boolean:1',
58052
+ SHOWACCONDPONLY: 'boolean:1',
58053
+ SHOWTYPENRINPLANNER: 'boolean:1',
58054
+ SHOW_AI_ROOM_RENDERING_IN_SUMMARY: 'boolean:1',
58055
+ SHOW_AI_ROOM_RENDERING_SUMMARY: 'boolean:1',
58056
+ SHOW_ALL_ITEMS_IN_PLANNER: 'boolean:1',
58057
+ SHOW_PRICEPREVIEW_ON_OPTIONS: 'list:;',
58058
+ STARTFILTERPARAMS: 'string',
58059
+ STARTHIDEARTICLES: 'list:;',
58060
+ START_PLANNER_ARTICLE: 'string',
58061
+ SUMMARY_TABGROUP_POSITION: 'list:;',
58062
+ USEBOXPLANNER: 'all-or-list:;',
58063
+ USEGLOBALSVGSCALE: 'boolean:1',
58064
+ USEPOSCOUNTVALUE: 'boolean:1',
58065
+ USEPRGASOPVARTICLENR: 'boolean:1',
58066
+ USE_DECISION_POS_COUNT_VALUE: 'boolean:1',
58067
+ USE_DIOMEX_CONFIG_LOGIC: 'boolean:1',
58068
+ USE_SHELFPLANNER_RTV: 'boolean:1',
58069
+ USE_SHORT_NAME_AS_NAME: 'boolean:1',
58070
+ USE_TYPENR_AS_ARTICLENR_EKTEXT: 'boolean:1',
58071
+ WARNINGS: 'json'
58072
+ };
58073
+
58074
+ /** 30 properties parsed on the article entity. */
58075
+ var ARTICLE_PROPERTIES = {
58076
+ '3DMODELNAME': 'string',
58077
+ ACCESSOIRE_POS_PRIO: 'number',
58078
+ ADD_AS_ZKAT: 'boolean:1|true',
58079
+ BASIC_UNIT_PRICE: 'number',
58080
+ BUNDLE_RULES: 'json',
58081
+ CONTENT_ITEM: 'string',
58082
+ DEPTH_HAS_PRICE: 'string',
58083
+ DO_NOT_DEL_ACC_IF_NOT_DOCKED: 'string',
58084
+ GROUP_CONTENT_ITEM: 'string',
58085
+ HAS3D: 'string',
58086
+ HEIGHTGRIDABOVE: 'number',
58087
+ HEIGHTGRIDBELOW: 'number',
58088
+ HEIGHTGRIDUSED: 'number',
58089
+ HEIGHT_HAS_PRICE: 'string',
58090
+ HIDE_IN_PLANNERSTEP: 'boolean:present',
58091
+ INVALID_ACCESSORIES: 'list:,',
58092
+ MAX_PLANNING_COUNT: 'number',
58093
+ ON_CONFIG_OPTION: 'string',
58094
+ ON_SET_CONFIG_OPTION: 'string',
58095
+ OPTIONS_FOR_PRINT: 'list:;',
58096
+ ORDER_POSNR: 'string',
58097
+ OVERWRITE_PARENT_DEPTH: 'string',
58098
+ OVERWRITE_PARENT_HEIGHT: 'string',
58099
+ OVERWRITE_PARENT_WIDTH: 'string',
58100
+ RETAIL_PREFIX: 'string',
58101
+ TABGROUP: 'string',
58102
+ TABGROUP_OPTIONS: 'string',
58103
+ TYPE_NO: 'string',
58104
+ WIDTH_HAS_PRICE: 'string',
58105
+ ZUBEHOER_FAMILIE: 'string'
58106
+ };
58107
+
58108
+ /** 40 properties parsed on the option entity. */
58109
+ var OPTION_PROPERTIES = {
58110
+ ADDITIONAL_GROUP_FILTER: 'json',
58111
+ ADD_OPT_TO_TABGROUP_IN_PL_SUM: 'string',
58112
+ ADD_TO_WWS: 'boolean:present',
58113
+ CHECK_FOR_REVERSE_CHANGES: 'list:;',
58114
+ CONTENT_ITEM: 'string',
58115
+ CONTENT_ITEM_TEASER: 'json',
58116
+ CUSTOM_DIMENSION: 'boolean:present',
58117
+ CUSTOM_DIMENSION_TEXT: 'string',
58118
+ DEFAULT_SIBLING_OPTION: 'string',
58119
+ DESCRIPTION: 'string',
58120
+ DIAMETER: 'boolean:present',
58121
+ EshopCategoryMapping: 'ignored',
58122
+ EshopSearchRelevant: 'ignored',
58123
+ FEATURE_TYPE: 'ignored',
58124
+ FREETEXT_DEFAULT_VALUE: 'string',
58125
+ GROUP_OPTIONS_LEFT_AND_RIGHT: 'list:;',
58126
+ HIDE_OPTION_IN_CONFIGURATOR: 'boolean:present',
58127
+ IGNORE_GROUPS: 'boolean:1',
58128
+ IGNORE_PGR_GROUP_POSITION: 'boolean:1',
58129
+ INFO_PDF: 'string',
58130
+ INFO_URL: 'string',
58131
+ ION_COMMENT_TEXT: 'ignored',
58132
+ ISDEFAULTVALUEFOROPTIONS: 'string',
58133
+ IS_MAIN_COLOR: 'boolean:present',
58134
+ IS_STATE: 'boolean:present',
58135
+ IsArtName: 'ignored',
58136
+ IsSalesText: 'ignored',
58137
+ MERGE_IDM_TO_OPG: 'string',
58138
+ ONLY_VISIBLE_IF_CONFIG_ALL: 'string',
58139
+ ONLY_VISIBLE_IF_CONFIG_SINGLE: 'string',
58140
+ ONLY_VISIBLE_IF_NOT_UNDOCK: 'string',
58141
+ REQUIRED_OPTION: 'boolean:present',
58142
+ REQUIRES_USER_INPUT: 'boolean:present',
58143
+ SETNAME: 'boolean:present',
58144
+ SHOW_FILTER: 'boolean:1',
58145
+ SHOW_IN_BASKET_WHEN_HAS_PRICE: 'ignored',
58146
+ SHOW_IN_VARIANTDESC: 'string',
58147
+ SHOW_SEARCHBAR: 'boolean:1',
58148
+ SHOW_SEPARAT_ON_TABGROUP: 'string',
58149
+ SUGGESTED_OPTION: 'boolean:present'
58150
+ };
58151
+
58152
+ /** 30 properties parsed on the optionValue entity. */
58153
+ var OPTIONVALUE_PROPERTIES = {
58154
+ ADD_TO_MEASURE: 'list:;',
58155
+ CONTENT_ITEM: 'string',
58156
+ CUSTOM_DIMENSION: 'opaque',
58157
+ DEFAULT_VALUE: 'string',
58158
+ EshopCategoryMapping: 'ignored',
58159
+ GROUP_CONTENT_ITEM: 'string',
58160
+ HIDE_IN_SUMMARY: 'boolean:present',
58161
+ INFO_PDF: 'string',
58162
+ INFO_URL: 'string',
58163
+ ION_COMMENT_TEXT: 'ignored',
58164
+ IS_NOT_RELEVANT: 'boolean:present',
58165
+ IsArtName: 'ignored',
58166
+ IsVariantAttribute: 'boolean:1',
58167
+ MEASURE_MAXIMUM: 'string',
58168
+ MEASURE_MINIMUM: 'string',
58169
+ MEASURE_STEP: 'string',
58170
+ MEASURE_UNIT: 'string',
58171
+ ONLY_VISIBLE_IF_NOT_UNDOCK: 'string',
58172
+ ON_RULE: 'string',
58173
+ OPTION_FREE_TEXT: 'boolean:present',
58174
+ PIMFlatValues: 'boolean:1',
58175
+ PRICE_UNIT: 'string',
58176
+ PriceTageRelevant: 'ignored',
58177
+ SAME_OPV: 'string',
58178
+ SETNAME: 'string',
58179
+ SET_BY_RULE: 'string',
58180
+ SET_CONFIG: 'string',
58181
+ SUMMARY_CODEX: 'string',
58182
+ TopFilterAttribute: 'ignored',
58183
+ VIEWPOINTNAME: 'string'
58184
+ };
58185
+ var PROPERTY_SCHEMAS = {
58186
+ catalog: CATALOG_PROPERTIES,
58187
+ article: ARTICLE_PROPERTIES,
58188
+ option: OPTION_PROPERTIES,
58189
+ optionValue: OPTIONVALUE_PROPERTIES
58190
+ };
58191
+
58192
+ /**
58193
+ * The encoding of one property, or undefined when the codex is not one the engine parses - an organization's own
58194
+ * key, which stays free text. A catalog-prefixed codex ('MYCAT__USEBOXPLANNER') resolves to its bare form, the
58195
+ * same way the parsers strip it.
58196
+ */
58197
+ function propertyEncodingOf(codex, entity) {
58198
+ var bare = codex.includes('__') ? codex.slice(codex.indexOf('__') + 2) : codex;
58199
+ var entities = entity ? [entity] : ['catalog', 'article', 'option', 'optionValue'];
58200
+ for (var _i = 0, _entities = entities; _i < _entities.length; _i++) {
58201
+ var candidate = _entities[_i];
58202
+ // Own keys only: a codex like 'constructor' or 'toString' would otherwise resolve to an inherited function.
58203
+ if (Object.prototype.hasOwnProperty.call(PROPERTY_SCHEMAS[candidate], bare)) return PROPERTY_SCHEMAS[candidate][bare];
58204
+ }
58205
+ return undefined;
58206
+ }
58207
+
58208
+ /**
58209
+ * Reading and writing a property VALUE in the encoding its own parser expects.
58210
+ *
58211
+ * Every property travels as a string and each one decides how that string is read (see propertySchemaRegistry).
58212
+ * An editor therefore cannot write "a boolean" - it has to write the dialect of THAT property, or the parser reads
58213
+ * the opposite of what the user chose. These two functions are that translation:
58214
+ *
58215
+ * - `decodePropertyValue` is DELIBERATELY TOLERANT. Stored values are a decade of history: the raw strings the
58216
+ * parsers document, real booleans and numbers written by editors that typed them natively, and the '.ToString()'
58217
+ * spellings those turn into on the way out ('True'). All of them must display as what they mean, or an editor
58218
+ * would show a flag as off and silently turn it off on the next save.
58219
+ * - `encodePropertyValue` is STRICT. It emits exactly one spelling per encoding - the one the parser reads.
58220
+ */
58221
+
58222
+ /** What a decoded property value can be, before an editor renders it. */
58223
+
58224
+ /** The raw string a stored value amounts to - what `.ToString()` would hand the parser. */
58225
+ function rawStringOf(stored) {
58226
+ if (stored === undefined || stored === null) return '';
58227
+ if (typeof stored === 'string') return stored;
58228
+ // A real boolean stored natively reaches the parser as .NET spells it, capital included.
58229
+ if (typeof stored === 'boolean') return stored ? 'True' : 'False';
58230
+ if (typeof stored === 'number') return String(stored);
58231
+ return JSON.stringify(stored);
58232
+ }
58233
+
58234
+ /**
58235
+ * Reads a stored boolean EXACTLY the way the property's parser does - the editor must show what the engine sees.
58236
+ * A `== '1'` property holding 'true' (or a natively stored True) is OFF in the engine; showing it as on would let
58237
+ * the next save switch the flag on for real. `boolean:present` is the odd one out, see the first branch.
58238
+ */
58239
+ function decodeBoolean(raw, encoding) {
58240
+ // ANY non-empty string is true here, '0' and 'false' included - the parser does `!!Value`. Reading it as a
58241
+ // normal boolean would show 'off' for a flag that is on, and the next save would write the user's wrong idea back.
58242
+ if (encoding === 'boolean:present') return raw !== '';
58243
+ var token = raw.trim();
58244
+ // The `'true'` parsers mostly lower-case before comparing, the `'1'` parsers compare the digit as is.
58245
+ var isOne = token === '1';
58246
+ var isTrue = token.toLowerCase() === 'true';
58247
+ if (encoding === 'boolean:1') return isOne;
58248
+ if (encoding === 'boolean:true') return isTrue;
58249
+ return isOne || isTrue;
58250
+ }
58251
+
58252
+ /** Splits a delimited list, dropping the empty segments a trailing delimiter leaves behind. */
58253
+ function decodeList(raw, separator) {
58254
+ return raw.split(separator).map(function (entry) {
58255
+ return entry.trim();
58256
+ }).filter(function (entry) {
58257
+ return entry !== '';
58258
+ });
58259
+ }
58260
+
58261
+ /**
58262
+ * Joins list entries, or removes the property when nothing is left: '' would reach the parser's `split` and come
58263
+ * back as the single entry '' - a cleared list must not turn into a list of one nameless group.
58264
+ */
58265
+ function encodeList(value, separator) {
58266
+ if (Array.isArray(value)) {
58267
+ var entries = value.map(function (entry) {
58268
+ return String(entry).trim();
58269
+ }).filter(function (entry) {
58270
+ return entry !== '';
58271
+ });
58272
+ return entries.length === 0 ? undefined : entries.join(separator);
58273
+ }
58274
+ // A boolean has no list spelling: 'True' would come back as a list of one entry literally named 'True'.
58275
+ if (typeof value === 'boolean') return undefined;
58276
+ var raw = rawStringOf(value);
58277
+ return raw === '' ? undefined : raw;
58278
+ }
58279
+
58280
+ /**
58281
+ * The value an editor should show for a stored property. `stored` is what the record holds - a string in the
58282
+ * normal case, or a natively-typed value from an editor that wrote one.
58283
+ */
58284
+ function decodePropertyValue(encoding, stored) {
58285
+ var raw = rawStringOf(stored);
58286
+ switch (encoding) {
58287
+ case 'boolean:1':
58288
+ case 'boolean:1|true':
58289
+ case 'boolean:true':
58290
+ case 'boolean:present':
58291
+ return decodeBoolean(raw, encoding);
58292
+ case 'number':
58293
+ {
58294
+ if (raw.trim() === '') return undefined;
58295
+ // German decimal commas reach these fields through spreadsheets and locale-formatted writers.
58296
+ var parsed = Number(raw.trim().replace(',', '.'));
58297
+ return Number.isFinite(parsed) ? parsed : undefined;
58298
+ }
58299
+ case 'list:;':
58300
+ return decodeList(raw, ';');
58301
+ case 'list:,':
58302
+ return decodeList(raw, ',');
58303
+
58304
+ // '1' means EVERYTHING; any other value is a list. Kept as the literal '1' so an editor can offer the two
58305
+ // states as a choice rather than making the user know the convention.
58306
+ case 'all-or-list:;':
58307
+ return raw.trim() === '1' ? true : decodeList(raw, ';');
58308
+
58309
+ // Three states, not two: '1' is ALL, '0' is NONE, and anything else is the list of the ones that apply.
58310
+ // '0' must NOT read as a one-entry list - that is how an off-state turns into the group literally named '0'.
58311
+ case 'boolean-or-list:;':
58312
+ {
58313
+ var token = raw.trim();
58314
+ if (token === '1') return true;
58315
+ if (token === '0') return false;
58316
+ return decodeList(raw, ';');
58317
+ }
58318
+ case 'json':
58319
+ {
58320
+ if (raw.trim() === '') return undefined;
58321
+ try {
58322
+ return JSON.parse(raw);
58323
+ } catch (_unused) {
58324
+ // Invalid JSON is still the user's text - hand it back so the editor can show and repair it rather than
58325
+ // replacing their work with an empty object.
58326
+ return raw;
58327
+ }
58328
+ }
58329
+ default:
58330
+ return raw === '' ? undefined : raw;
58331
+ }
58332
+ }
58333
+
58334
+ /**
58335
+ * The string to store for an edited value - exactly the spelling the property's parser reads.
58336
+ * `undefined` means the property should be REMOVED rather than written empty, which is how a `boolean:present`
58337
+ * flag is switched off.
58338
+ */
58339
+ function encodePropertyValue(encoding, value) {
58340
+ switch (encoding) {
58341
+ case 'boolean:1':
58342
+ case 'boolean:1|true':
58343
+ return value ? '1' : '0';
58344
+ case 'boolean:true':
58345
+ return value ? 'true' : 'false';
58346
+
58347
+ // Off is the ABSENCE of a value: this parser reads every non-empty string as true, so writing '0' or 'false'
58348
+ // would leave the flag ON.
58349
+ case 'boolean:present':
58350
+ return value ? '1' : undefined;
58351
+ case 'number':
58352
+ {
58353
+ // Blank input (including whitespace) clears the property; Number('') would be 0.
58354
+ if (value === undefined || value === null || String(value).trim() === '') return undefined;
58355
+ var parsed = typeof value === 'number' ? value : Number(String(value).trim().replace(',', '.'));
58356
+ // A decimal point, never a comma - the parsers run Number() on this string.
58357
+ return Number.isFinite(parsed) ? String(parsed) : undefined;
58358
+ }
58359
+ case 'list:;':
58360
+ return encodeList(value, ';');
58361
+ case 'list:,':
58362
+ return encodeList(value, ',');
58363
+
58364
+ // '1' is ALL; there is no spelling for OFF, so `false` removes the property (the list branch would otherwise
58365
+ // store the text 'False' as a one-entry list).
58366
+ case 'all-or-list:;':
58367
+ if (value === true) return '1';
58368
+ if (value === false) return undefined;
58369
+ return encodeList(value, ';');
58370
+ case 'boolean-or-list:;':
58371
+ if (value === true) return '1';
58372
+ // The off-state has its own spelling here, so it is written rather than left to the list branch, which
58373
+ // would REMOVE the property for an empty list instead of switching the state off.
58374
+ if (value === false) return '0';
58375
+ return encodeList(value, ';');
58376
+ case 'json':
58377
+ {
58378
+ if (value === undefined || value === '') return undefined;
58379
+ // Already-text stays text: it is either JSON the user typed or something they are still repairing.
58380
+ return typeof value === 'string' ? value : JSON.stringify(value);
58381
+ }
58382
+ default:
58383
+ {
58384
+ var raw = rawStringOf(value);
58385
+ return raw === '' ? undefined : raw;
58386
+ }
58387
+ }
58388
+ }
58389
+
58390
+ /** Whether a value can be stored for this encoding at all - what an editor blocks saving on. */
58391
+ function propertyValueProblem(encoding, value) {
58392
+ if (encoding === 'json' && typeof value === 'string' && value.trim() !== '') {
58393
+ try {
58394
+ JSON.parse(value);
58395
+ } catch (_unused2) {
58396
+ return 'invalidJson';
58397
+ }
58398
+ }
58399
+ if (encoding === 'number' && value !== undefined && String(value).trim() !== '') {
58400
+ var parsed = typeof value === 'number' ? value : Number(String(value).trim().replace(',', '.'));
58401
+ if (!Number.isFinite(parsed)) return 'notANumber';
58402
+ }
58403
+
58404
+ // A ';' inside a ';'-list entry would split it into two on the way back in - and every encoding that JOINS on
58405
+ // ';' is exposed to it, not just the plain list.
58406
+ var joinsOnSemicolon = encoding === 'list:;' || encoding === 'all-or-list:;' || encoding === 'boolean-or-list:;';
58407
+ if (joinsOnSemicolon && Array.isArray(value) && value.some(function (entry) {
58408
+ return String(entry).includes(';');
58409
+ })) {
58410
+ return 'separatorInEntry';
58411
+ }
58412
+ if (encoding === 'list:,' && Array.isArray(value) && value.some(function (entry) {
58413
+ return String(entry).includes(',');
58414
+ })) {
58415
+ return 'separatorInEntry';
58416
+ }
58417
+ return undefined;
58418
+ }
58419
+
58420
+ /** The control an editor should render for an encoding. */
58421
+ function editorKindOf(encoding) {
58422
+ if (encoding.startsWith('boolean:')) return 'checkbox';
58423
+ if (encoding === 'number') return 'number';
58424
+ if (encoding === 'list:;' || encoding === 'list:,') return 'list';
58425
+ if (encoding === 'all-or-list:;') return 'allOrList';
58426
+ if (encoding === 'boolean-or-list:;') return 'boolOrList';
58427
+ if (encoding === 'json') return 'json';
58428
+ return 'text';
58429
+ }
58430
+
57005
58431
  /**
57006
58432
  * Placeholder for the set name in the Serious checkout. API2 bed catalogs yield "<headboard> - <width> X <length>" from the
57007
58433
  * OPTBR / OPTLAE options and the headboard partlist article. IDM catalogs have none of these, so the selected values of the
@@ -74250,6 +75676,7 @@ exports.Grid = Grid;
74250
75676
  exports.HQRenderScript = HQRenderScript;
74251
75677
  exports.JsonDataCache = JsonDataCache;
74252
75678
  exports.OptionCatalogData = OptionCatalogData;
75679
+ exports.PROPERTY_SCHEMAS = PROPERTY_SCHEMAS;
74253
75680
  exports.PlannerElementData = PlannerElementData;
74254
75681
  exports.Rendering = Rendering;
74255
75682
  exports.Vector2 = Vector2;
@@ -74263,10 +75690,16 @@ exports.bootNow = bootNow;
74263
75690
  exports.bootRequestName = bootRequestName;
74264
75691
  exports.collectStructureStepKeys = collectStructureStepKeys;
74265
75692
  exports.creatRenderOrders = creatRenderOrders;
75693
+ exports.decodePropertyValue = decodePropertyValue;
75694
+ exports.editorKindOf = editorKindOf;
75695
+ exports.encodePropertyValue = encodePropertyValue;
74266
75696
  exports.getOrigProductId = getOrigProductId;
74267
75697
  exports.getSeriousSetNamePlaceholder = getSeriousSetNamePlaceholder;
74268
75698
  exports.headlessSession = headlessSession;
74269
75699
  exports.loadAndRepairBasket = loadAndRepairBasket;
75700
+ exports.propertyEncodingOf = propertyEncodingOf;
75701
+ exports.propertyValueProblem = propertyValueProblem;
75702
+ exports.rawStringOf = rawStringOf;
74270
75703
  exports.runHeadlessArtifactPass = runHeadlessArtifactPass;
74271
75704
  exports.runHeadlessArtifactPassBatch = runHeadlessArtifactPassBatch;
74272
75705
  exports.setHandlerInstance = setHandlerInstance;