@crystaldesign/web-planner-logic 26.12.0-beta.27 → 26.12.0-beta.29

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 (40) hide show
  1. package/build/cjs/{DivaBoxPlanner-69dd68ba.js → DivaBoxPlanner-0f7e2078.js} +3 -3
  2. package/build/cjs/{DivaStandardPlanner-1e17ea12.js → DivaStandardPlanner-ebfa66c4.js} +2 -2
  3. package/build/cjs/{DoorPlanner-602a86f3.js → DoorPlanner-15cb0430.js} +2 -2
  4. package/build/cjs/{Host3DSignalR-09d9efe0.js → Host3DSignalR-5aede7a4.js} +2 -2
  5. package/build/cjs/{LiviqueWWSHandler-9497b33d.js → LiviqueWWSHandler-1f3f4217.js} +2 -2
  6. package/build/cjs/{PfisterWWSHandler-14686c6d.js → PfisterWWSHandler-185178ce.js} +2 -2
  7. package/build/cjs/{PlannerHandler2D-a22115ce.js → PlannerHandler2D-5a38f064.js} +5 -272
  8. package/build/cjs/{SeriousBasketHandler-acfb2f40.js → SeriousBasketHandler-e1ce56b0.js} +2 -2
  9. package/build/cjs/{ShelfPlanner-bd6038e1.js → ShelfPlanner-c7248511.js} +2 -2
  10. package/build/cjs/{StandardWWSHandler-bafafa71.js → StandardWWSHandler-e88dfbcf.js} +2 -2
  11. package/build/cjs/{index-cca37a97.js → index-0f7a7e3c.js} +696 -115
  12. package/build/cjs/index.js +1 -1
  13. package/build/esm/{DivaBoxPlanner-50d29c59.js → DivaBoxPlanner-3e72a31d.js} +3 -3
  14. package/build/esm/{DivaStandardPlanner-e1831308.js → DivaStandardPlanner-7afa7053.js} +2 -2
  15. package/build/esm/{DoorPlanner-598af141.js → DoorPlanner-531a001e.js} +2 -2
  16. package/build/esm/{Host3DSignalR-bc77d0ab.js → Host3DSignalR-61a6d882.js} +2 -2
  17. package/build/esm/{LiviqueWWSHandler-ace695dc.js → LiviqueWWSHandler-3c11a396.js} +2 -2
  18. package/build/esm/{PfisterWWSHandler-ebf67f99.js → PfisterWWSHandler-120f8933.js} +2 -2
  19. package/build/esm/{PlannerHandler2D-cb6781eb.js → PlannerHandler2D-91e383db.js} +3 -268
  20. package/build/esm/{SeriousBasketHandler-14961eb6.js → SeriousBasketHandler-070e3447.js} +2 -2
  21. package/build/esm/{ShelfPlanner-6f2b92a1.js → ShelfPlanner-29be7e07.js} +2 -2
  22. package/build/esm/{StandardWWSHandler-1c478a3c.js → StandardWWSHandler-359cb15b.js} +2 -2
  23. package/build/esm/{index-a201dfa2.js → index-16d95e66.js} +696 -116
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/interface/Planner/DockingPointDataType.d.ts +10 -0
  26. package/build/types/web-planner-logic/src/interface/Planner/DockingPointDataType.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/logic/Planner/PlannerUtils/SVGUtils.d.ts +8 -1
  28. package/build/types/web-planner-logic/src/logic/Planner/PlannerUtils/SVGUtils.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  30. package/build/types/web-planner-logic/src/model/Articles/Article/DivaCatalogArticle.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/model/Articles/Article/IDMCatalogArticle.d.ts +7 -0
  32. package/build/types/web-planner-logic/src/model/Articles/Article/IDMCatalogArticle.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/model/Articles/CatalogPlannerArticleData.d.ts +6 -0
  34. package/build/types/web-planner-logic/src/model/Articles/CatalogPlannerArticleData.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/model/Planner/PlannerElementData.d.ts.map +1 -1
  36. package/build/types/web-planner-logic/src/test/accessoryWithoutDocking.test.d.ts +2 -0
  37. package/build/types/web-planner-logic/src/test/accessoryWithoutDocking.test.d.ts.map +1 -0
  38. package/build/types/web-planner-logic/src/test/countDockingPoints.test.d.ts +2 -0
  39. package/build/types/web-planner-logic/src/test/countDockingPoints.test.d.ts.map +1 -0
  40. package/package.json +3 -3
@@ -8,6 +8,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
8
8
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
9
9
  import axios$1 from 'axios';
10
10
  import DivaUtils, { DivaError, md5, nanoid } from '@crystaldesign/diva-utils';
11
+ import { parseXml, serializeXml, removeMask, stretchArticleSvg } from '@crystaldesign/planner-2d-core';
11
12
  import { PriceObjectData, VariantItemData, JsonConfigPriceData, OrderLineData, CompactOrderLineData, GroupsData, Favorites, Favorite, ConfigVariantData, BASKET_UPLOAD_FUNCTION_TYPES, BASKET_UPLOAD_MEDIA_TYPES, OrderSetData, BasketData } from '@crystaldesign/basket-model';
12
13
  import _typeof from '@babel/runtime/helpers/typeof';
13
14
  import { XMLParser } from 'fast-xml-parser';
@@ -17,7 +18,6 @@ import _inherits from '@babel/runtime/helpers/inherits';
17
18
  import _wrapNativeSuper from '@babel/runtime/helpers/wrapNativeSuper';
18
19
  import BasketHandler from '@crystaldesign/basket-handler';
19
20
  import { io } from 'socket.io-client';
20
- import '@crystaldesign/planner-2d-core';
21
21
 
22
22
  (function() {
23
23
  const env = {"STAGE":"production"};
@@ -144,7 +144,7 @@ function _objectSpread$r(e) { for (var r = 1; r < arguments.length; r++) { var t
144
144
 
145
145
  // Import types from AI service
146
146
 
147
- var LOG$q = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
147
+ var LOG$r = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
148
148
 
149
149
  /**
150
150
  * Deadline for the optional catalog XML preload. Axios has no default timeout, and planner start-up
@@ -210,7 +210,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
210
210
  if (plannerConfig.settings) {
211
211
  this.initalizeWebConfigData(plannerConfig);
212
212
  } else {
213
- LOG$q.error(new DivaError('Fehler beim laden der WebConfig', {
213
+ LOG$r.error(new DivaError('Fehler beim laden der WebConfig', {
214
214
  code: 'WC_0001'
215
215
  }));
216
216
  throw Error('Initalize failed!');
@@ -271,7 +271,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
271
271
  case 0:
272
272
  skip = _args.length > 2 && _args[2] !== undefined ? _args[2] : 0;
273
273
  dontLogError = _args.length > 3 ? _args[3] : undefined;
274
- LOG$q.debug('DivaApiHandler.fetchData ' + url, 'DivaApiHandler, fetchData');
274
+ LOG$r.debug('DivaApiHandler.fetchData ' + url, 'DivaApiHandler, fetchData');
275
275
  if (init) {
276
276
  _context.next = 5;
277
277
  break;
@@ -312,7 +312,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
312
312
  netBytes = typeof data === 'string' ? data.length : Number((_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers['content-length']) || undefined;
313
313
  }
314
314
  if (data !== null && data !== void 0 && data.Error) {
315
- if (dontLogError) LOG$q.warn(data.Error + ' ' + url);else LOG$q.error(new DivaError(data.Error, {
315
+ if (dontLogError) LOG$r.warn(data.Error + ' ' + url);else LOG$r.error(new DivaError(data.Error, {
316
316
  code: 'WC_0001',
317
317
  custom: {
318
318
  url: url
@@ -434,7 +434,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
434
434
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
435
435
  while (1) switch (_context2.prev = _context2.next) {
436
436
  case 0:
437
- LOG$q.debug('getDataWithoutCache: ', {
437
+ LOG$r.debug('getDataWithoutCache: ', {
438
438
  queryString: queryString,
439
439
  init: init,
440
440
  useWebServiceApi: useWebServiceApi
@@ -512,7 +512,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
512
512
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
513
513
  while (1) switch (_context3.prev = _context3.next) {
514
514
  case 0:
515
- LOG$q.debug('getDataCache: ', {
515
+ LOG$r.debug('getDataCache: ', {
516
516
  queryString: queryString,
517
517
  cacheMD5: cacheMD5,
518
518
  accountSessionGuid: accountSessionGuid,
@@ -533,14 +533,14 @@ var DivaApiHandler = /*#__PURE__*/function () {
533
533
  _context3.next = 9;
534
534
  break;
535
535
  }
536
- LOG$q.debug('getDataFromInternalCache: ' + queryString);
536
+ LOG$r.debug('getDataFromInternalCache: ' + queryString);
537
537
  return _context3.abrupt("return", cacheHit);
538
538
  case 9:
539
539
  if (!(cacheMD5 && this.jsonDataCache.get(cacheMD5) && !((_this$divaWebConfigDa2 = this.divaWebConfigData) !== null && _this$divaWebConfigDa2 !== void 0 && _this$divaWebConfigDa2.addOrganizationIdToCacheKey))) {
540
540
  _context3.next = 12;
541
541
  break;
542
542
  }
543
- LOG$q.debug('getDataFromInternalCache: ' + queryString);
543
+ LOG$r.debug('getDataFromInternalCache: ' + queryString);
544
544
  return _context3.abrupt("return", this.jsonDataCache.get(cacheMD5));
545
545
  case 12:
546
546
  if (!addSession) {
@@ -590,7 +590,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
590
590
  // SHOULD have been authenticated against an account, the planner ends up using a
591
591
  // visitor sessionGuid (cached per organization in DataStore). Surface it so we
592
592
  // can spot regressions instead of silently sending the wrong GUID.
593
- LOG$q.warn('[SESSION-GUID][API] visitor fallback used for api2 call (no accountSessionGuid passed)', {
593
+ LOG$r.warn('[SESSION-GUID][API] visitor fallback used for api2 call (no accountSessionGuid passed)', {
594
594
  callTag: "api#".concat(this.instanceId, "/call#").concat(this.apiCallCount),
595
595
  queryString: queryString,
596
596
  organizationId: this.OrganizationId
@@ -612,7 +612,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
612
612
  this.jsonDataCache.set(myQS, result);
613
613
  if (cacheMD5 && !((_this$divaWebConfigDa3 = this.divaWebConfigData) !== null && _this$divaWebConfigDa3 !== void 0 && _this$divaWebConfigDa3.addOrganizationIdToCacheKey)) this.jsonDataCache.set(cacheMD5, result);
614
614
  }
615
- LOG$q.debug('getDataFromApi: ' + queryString);
615
+ LOG$r.debug('getDataFromApi: ' + queryString);
616
616
  return _context3.abrupt("return", result);
617
617
  case 41:
618
618
  case "end":
@@ -648,7 +648,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
648
648
  case 5:
649
649
  _context4.prev = 5;
650
650
  _context4.t0 = _context4["catch"](1);
651
- LOG$q.error(new DivaError('could not create product in Configurator', {
651
+ LOG$r.error(new DivaError('could not create product in Configurator', {
652
652
  cause: _context4.t0
653
653
  }));
654
654
  return _context4.abrupt("return", false);
@@ -1633,7 +1633,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1633
1633
  status = _context12.t0 === null || _context12.t0 === void 0 || (_e$response3 = _context12.t0.response) === null || _e$response3 === void 0 ? void 0 : _e$response3.status;
1634
1634
  body = _context12.t0 === null || _context12.t0 === void 0 || (_e$response4 = _context12.t0.response) === null || _e$response4 === void 0 ? void 0 : _e$response4.data;
1635
1635
  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;
1636
- LOG$q.error(new Error("Failed to create lead key for email ".concat(email, ": ").concat(apiMessage)));
1636
+ LOG$r.error(new Error("Failed to create lead key for email ".concat(email, ": ").concat(apiMessage)));
1637
1637
  throw new DivaError(apiMessage || 'Failed to create lead key', {
1638
1638
  code: 'LEAD_KEY_REQUEST_FAILED',
1639
1639
  custom: {
@@ -1729,7 +1729,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1729
1729
  case 9:
1730
1730
  _context14.prev = 9;
1731
1731
  _context14.t0 = _context14["catch"](4);
1732
- LOG$q.error(new DivaError('Error Connecting to Support-Service-LivePlanner', {
1732
+ LOG$r.error(new DivaError('Error Connecting to Support-Service-LivePlanner', {
1733
1733
  cause: _context14.t0
1734
1734
  }));
1735
1735
  case 12:
@@ -1776,7 +1776,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1776
1776
  case 10:
1777
1777
  _context15.prev = 10;
1778
1778
  _context15.t0 = _context15["catch"](3);
1779
- LOG$q.error({
1779
+ LOG$r.error({
1780
1780
  message: 'Could not fetch dimension',
1781
1781
  name: 'get dimension error'
1782
1782
  });
@@ -1834,7 +1834,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1834
1834
  case 9:
1835
1835
  _context16.prev = 9;
1836
1836
  _context16.t0 = _context16["catch"](3);
1837
- LOG$q.error({
1837
+ LOG$r.error({
1838
1838
  message: 'Could not fetch catalogXml',
1839
1839
  name: 'get catalogXml error'
1840
1840
  });
@@ -1913,7 +1913,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1913
1913
  case 14:
1914
1914
  _context17.prev = 14;
1915
1915
  _context17.t0 = _context17["catch"](6);
1916
- LOG$q.error(new DivaError('Error Connecting to Report Service', {
1916
+ LOG$r.error(new DivaError('Error Connecting to Report Service', {
1917
1917
  cause: _context17.t0
1918
1918
  }));
1919
1919
  case 17:
@@ -2436,6 +2436,22 @@ var CatalogPlannerArticleData = /*#__PURE__*/function () {
2436
2436
  }
2437
2437
  return false;
2438
2438
  }
2439
+
2440
+ /**
2441
+ * Overwrites the docking point counts of the top svg. For IDM articles whose detail info delivered no
2442
+ * counts, so their svg was counted instead - without counts an article is not dockable (see isDockable).
2443
+ */
2444
+ }, {
2445
+ key: "applyDockingPointCounts",
2446
+ value: function applyDockingPointCounts(counts) {
2447
+ this.catPlanArt.topAVC = counts.avc;
2448
+ this.catPlanArt.topAVN = counts.avn;
2449
+ this.catPlanArt.topAVO = counts.avo;
2450
+ this.catPlanArt.topAVS = counts.avs;
2451
+ this.catPlanArt.topAVU = counts.avu;
2452
+ this.catPlanArt.topHasAVL = counts.avl > 0;
2453
+ this.catPlanArt.topHasAVR = counts.avr > 0;
2454
+ }
2439
2455
  }, {
2440
2456
  key: "filterType",
2441
2457
  get: function get() {
@@ -2447,7 +2463,7 @@ var CatalogPlannerArticleData = /*#__PURE__*/function () {
2447
2463
  }]);
2448
2464
  }();
2449
2465
 
2450
- var LOG$p = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
2466
+ var LOG$q = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
2451
2467
  var OptionCatalogData = /*#__PURE__*/function () {
2452
2468
  function OptionCatalogData(opt, catalogData) {
2453
2469
  var _this$opt$property;
@@ -2878,7 +2894,7 @@ var setOptionsProperties = function setOptionsProperties(catalogData, opt, prope
2878
2894
  case 'IsArtName':
2879
2895
  break;
2880
2896
  default:
2881
- LOG$p.debug('implement mapping for these props for options: ' + prop.Codex);
2897
+ LOG$q.debug('implement mapping for these props for options: ' + prop.Codex);
2882
2898
  break;
2883
2899
  }
2884
2900
  }
@@ -16673,7 +16689,7 @@ var ralClassics = [{
16673
16689
  rgb: '#7E8182'
16674
16690
  }];
16675
16691
 
16676
- var LOG$o = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
16692
+ var LOG$p = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
16677
16693
  var OptionValueCatalogData = /*#__PURE__*/function () {
16678
16694
  function OptionValueCatalogData(opv, catalogData) {
16679
16695
  var _this = this,
@@ -17165,7 +17181,7 @@ var setOptionValueProperties = function setOptionValueProperties(catalogData, op
17165
17181
  break;
17166
17182
  default:
17167
17183
  if (key.includes('__')) break;
17168
- LOG$o.debug('implement mapping for these props for optionValue: ' + prop.Codex);
17184
+ LOG$p.debug('implement mapping for these props for optionValue: ' + prop.Codex);
17169
17185
  var values_locales = [];
17170
17186
  if (prop.Value_locales) {
17171
17187
  var _prop$Value_locales;
@@ -17191,9 +17207,9 @@ var setOptionValueProperties = function setOptionValueProperties(catalogData, op
17191
17207
  return metaDatas;
17192
17208
  };
17193
17209
 
17194
- function _createForOfIteratorHelper$l(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$l(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; } } }; }
17195
- function _unsupportedIterableToArray$l(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$l(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$l(r, a) : void 0; } }
17196
- function _arrayLikeToArray$l(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; }
17210
+ function _createForOfIteratorHelper$n(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$n(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; } } }; }
17211
+ function _unsupportedIterableToArray$n(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$n(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$n(r, a) : void 0; } }
17212
+ function _arrayLikeToArray$n(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; }
17197
17213
  //kaufmännischer Artikel
17198
17214
  var CatalogArticleData = /*#__PURE__*/function () {
17199
17215
  function CatalogArticleData(catalogArticle, catalogData) {
@@ -17979,7 +17995,7 @@ var CatalogArticleData = /*#__PURE__*/function () {
17979
17995
  value: function getOptionValueFromOption(opt, opv) {
17980
17996
  if (this._catalogArticle.articleOptions[opt] && this._catalogArticle.articleOptions[opt].hasOPG) {
17981
17997
  var myOPGs = this._catalogArticle.articleOptions[opt].articleOptionValues;
17982
- var _iterator = _createForOfIteratorHelper$l(myOPGs),
17998
+ var _iterator = _createForOfIteratorHelper$n(myOPGs),
17983
17999
  _step;
17984
18000
  try {
17985
18001
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -18046,7 +18062,7 @@ var CatalogArticleData = /*#__PURE__*/function () {
18046
18062
  }]);
18047
18063
  }();
18048
18064
 
18049
- var LOG$n = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
18065
+ var LOG$o = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
18050
18066
  function initDivaCatalogData(json, orderSet, api) {
18051
18067
  var _json$MainCategory;
18052
18068
  var catalogData = {
@@ -18105,7 +18121,7 @@ function initDivaArticles(articleJson, plannerElementsJson, catalogData) {
18105
18121
  }
18106
18122
  } else {
18107
18123
  DivaUtils.endSpanOfApm('Catalog initialize');
18108
- LOG$n.error(new DivaError('Catalog ' + catalogData.catalogName + ' not listed', {
18124
+ LOG$o.error(new DivaError('Catalog ' + catalogData.catalogName + ' not listed', {
18109
18125
  code: 'WC_0002'
18110
18126
  }));
18111
18127
  throw new Error('Articles of Catalog: ' + catalogData.catalogCodex + ' are empty');
@@ -19128,9 +19144,9 @@ var ArticleOptionValueData = /*#__PURE__*/function () {
19128
19144
  }]);
19129
19145
  }();
19130
19146
 
19131
- function _createForOfIteratorHelper$k(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$k(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; } } }; }
19132
- function _unsupportedIterableToArray$k(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$k(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$k(r, a) : void 0; } }
19133
- function _arrayLikeToArray$k(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; }
19147
+ function _createForOfIteratorHelper$m(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$m(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; } } }; }
19148
+ function _unsupportedIterableToArray$m(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$m(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$m(r, a) : void 0; } }
19149
+ function _arrayLikeToArray$m(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; }
19134
19150
  var ArticleOptionData = /*#__PURE__*/function () {
19135
19151
  function ArticleOptionData(opt, catalogData) {
19136
19152
  var _this$opt$property;
@@ -19230,7 +19246,7 @@ var ArticleOptionData = /*#__PURE__*/function () {
19230
19246
  }, {
19231
19247
  key: "getOpvByOcd",
19232
19248
  value: function getOpvByOcd(codex) {
19233
- var _iterator = _createForOfIteratorHelper$k(this.opt.articleOptionValues),
19249
+ var _iterator = _createForOfIteratorHelper$m(this.opt.articleOptionValues),
19234
19250
  _step;
19235
19251
  try {
19236
19252
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -19571,7 +19587,10 @@ var ArticleOptionData = /*#__PURE__*/function () {
19571
19587
  }]);
19572
19588
  }();
19573
19589
 
19574
- var LOG$m = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
19590
+ function _createForOfIteratorHelper$l(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$l(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; } } }; }
19591
+ function _unsupportedIterableToArray$l(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$l(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$l(r, a) : void 0; } }
19592
+ function _arrayLikeToArray$l(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; }
19593
+ var LOG$n = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
19575
19594
  function addSupplierColors(set, catalogArticleData, allOPVsOfOPT, supplierColors, catalog, newOPT, rule) {
19576
19595
  var lang = catalog.api.getLanguage();
19577
19596
  // the palette group shows "<GroupName> (<OPG name>)", so both carry the same translated label
@@ -19778,12 +19797,12 @@ function loadArticleOptions(json, catalogArticleData, set) {
19778
19797
  var myOPV = new ArticleOptionValueData(getArticleOptionValueType(set, tmpOPV.Codex, tmpOPV, catOPV, catalogArticleData, true, newOPG, multiselectOptions), set.CatalogData);
19779
19798
  allOPVsOfOPG.set(tmpOPV.Codex, myOPV);
19780
19799
  } else {
19781
- LOG$m.error(new Error('OPV not found: ' + tmpOPV.Codex));
19800
+ LOG$n.error(new Error('OPV not found: ' + tmpOPV.Codex));
19782
19801
  }
19783
19802
  }
19784
19803
  newOPG.initOPVsInOPG(allOPVsOfOPG);
19785
19804
  } else {
19786
- LOG$m.error(new Error('OPG not found: ' + tmpOPG.Codex));
19805
+ LOG$n.error(new Error('OPG not found: ' + tmpOPG.Codex));
19787
19806
  }
19788
19807
  }
19789
19808
  if ((_myOPT$OPV = myOPT.OPV) !== null && _myOPT$OPV !== void 0 && _myOPT$OPV.length) {
@@ -19799,11 +19818,11 @@ function loadArticleOptions(json, catalogArticleData, set) {
19799
19818
  var _myOPV = new ArticleOptionValueData(getArticleOptionValueType(set, _tmpOPG.Codex, _tmpOPG, _catOPV, catalogArticleData, true, _newOPG, multiselectOptions), set.CatalogData);
19800
19819
  _allOPVsOfOPG.set(_tmpOPG.Codex, _myOPV);
19801
19820
  } else {
19802
- LOG$m.error(new Error('OPV not found: ' + _tmpOPG.Codex));
19821
+ LOG$n.error(new Error('OPV not found: ' + _tmpOPG.Codex));
19803
19822
  }
19804
19823
  _newOPG.initOPVsInOPG(_allOPVsOfOPG);
19805
19824
  } else {
19806
- LOG$m.error(new Error('OPG not found: ' + _tmpOPG.Codex));
19825
+ LOG$n.error(new Error('OPG not found: ' + _tmpOPG.Codex));
19807
19826
  }
19808
19827
  }
19809
19828
  }
@@ -19815,7 +19834,7 @@ function loadArticleOptions(json, catalogArticleData, set) {
19815
19834
  var _myOPV2 = new ArticleOptionValueData(getArticleOptionValueType(set, _tmpOPV.Codex, _tmpOPV, _catOPV2, catalogArticleData, true, newOPT, multiselectOptions), set.CatalogData);
19816
19835
  allOPVsOfOPT.set(_tmpOPV.Codex, _myOPV2);
19817
19836
  } else {
19818
- LOG$m.error(new Error('OPV not found: ' + _tmpOPV.Codex));
19837
+ LOG$n.error(new Error('OPV not found: ' + _tmpOPV.Codex));
19819
19838
  }
19820
19839
  }
19821
19840
  }
@@ -19903,12 +19922,12 @@ function initDecisions(catalog, catalogArticleData, decisionRefs) {
19903
19922
  articleCodex: catalogArticle.articleCodex
19904
19923
  };
19905
19924
  if (myDecision.Type == '0') {
19906
- LOG$m.error(new DivaError(text, {
19925
+ LOG$n.error(new DivaError(text, {
19907
19926
  code: 'WC_0011',
19908
19927
  custom: stack
19909
19928
  }));
19910
19929
  } else {
19911
- LOG$m.warn(text, undefined, stack);
19930
+ LOG$n.warn(text, undefined, stack);
19912
19931
  }
19913
19932
  myDecision.Options.splice(m, 1);
19914
19933
  m--;
@@ -19932,9 +19951,81 @@ function initDecisions(catalog, catalogArticleData, decisionRefs) {
19932
19951
  }
19933
19952
  }
19934
19953
  }
19935
- catalogArticle.articleReferencedDecisions = catalogArticle.decisions.filter(function (d) {
19936
- return decisionRefs == undefined || decisionRefs.includes(d.Number.toString());
19954
+ catalogArticle.articleReferencedDecisions = getReferencedDecisions(catalogArticle.decisions, decisionRefs);
19955
+ }
19956
+
19957
+ /** The decisions an article evaluates, in prio order: its DecisionRefs plus what they switch off and no ENABLE_DECISION switches on. */
19958
+ function getReferencedDecisions(decisions, decisionRefs) {
19959
+ if (decisionRefs == undefined) return _toConsumableArray(decisions);
19960
+ var evaluated = decisions.filter(function (d) {
19961
+ return decisionRefs.includes(String(d.Number));
19937
19962
  });
19963
+ var enableTargets = getActionTargets(decisions, 'ENABLE_DECISION');
19964
+ for (var i = 0; i < evaluated.length; i++) {
19965
+ var _iterator = _createForOfIteratorHelper$l(getActionTargets([evaluated[i]], 'DISABLE_DECISION')),
19966
+ _step;
19967
+ try {
19968
+ var _loop = function _loop() {
19969
+ var decisionNr = _step.value;
19970
+ var target = decisions.find(function (d) {
19971
+ return String(d.Number) == decisionNr;
19972
+ });
19973
+ if (target && !enableTargets.has(decisionNr) && !evaluated.includes(target)) evaluated.push(target);
19974
+ };
19975
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
19976
+ _loop();
19977
+ }
19978
+ } catch (err) {
19979
+ _iterator.e(err);
19980
+ } finally {
19981
+ _iterator.f();
19982
+ }
19983
+ }
19984
+ return evaluated.sort(function (a, b) {
19985
+ return Number(a.Prio) - Number(b.Prio);
19986
+ });
19987
+ }
19988
+
19989
+ /** Numbers of the decisions an action of the given type points at. */
19990
+ function getActionTargets(decisions, type) {
19991
+ var targets = new Set();
19992
+ var _iterator2 = _createForOfIteratorHelper$l(decisions),
19993
+ _step2;
19994
+ try {
19995
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
19996
+ var _decision$DOC;
19997
+ var decision = _step2.value;
19998
+ var _iterator3 = _createForOfIteratorHelper$l((_decision$DOC = decision.DOC) !== null && _decision$DOC !== void 0 ? _decision$DOC : []),
19999
+ _step3;
20000
+ try {
20001
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
20002
+ var _combination$DA;
20003
+ var combination = _step3.value;
20004
+ var _iterator4 = _createForOfIteratorHelper$l((_combination$DA = combination.DA) !== null && _combination$DA !== void 0 ? _combination$DA : []),
20005
+ _step4;
20006
+ try {
20007
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
20008
+ var action = _step4.value;
20009
+ if (action.Type == type && action.DecisionNr) targets.add(String(action.DecisionNr));
20010
+ }
20011
+ } catch (err) {
20012
+ _iterator4.e(err);
20013
+ } finally {
20014
+ _iterator4.f();
20015
+ }
20016
+ }
20017
+ } catch (err) {
20018
+ _iterator3.e(err);
20019
+ } finally {
20020
+ _iterator3.f();
20021
+ }
20022
+ }
20023
+ } catch (err) {
20024
+ _iterator2.e(err);
20025
+ } finally {
20026
+ _iterator2.f();
20027
+ }
20028
+ return targets;
19938
20029
  }
19939
20030
  function getArticleOptionType(myOPT, set, articleCodex) {
19940
20031
  var _set$CatalogData$cata, _set$CatalogData$cata2, _set$CatalogData$cata3, _set$CatalogData$cata4, _set$CatalogData$cata5, _myOPT$Properties;
@@ -20064,6 +20155,313 @@ function getArticleOptionValueType(set, codex, jsonOPV, catalogOPV, myArticle, i
20064
20155
  return opv;
20065
20156
  }
20066
20157
 
20158
+ function _createForOfIteratorHelper$k(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$k(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; } } }; }
20159
+ function _unsupportedIterableToArray$k(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$k(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$k(r, a) : void 0; } }
20160
+ function _arrayLikeToArray$k(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; }
20161
+ var LOG$m = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
20162
+ var COUNT_KEY_BY_DOCKING_TYPE = {
20163
+ AVC: 'avc',
20164
+ AVN: 'avn',
20165
+ AVO: 'avo',
20166
+ AVR: 'avr',
20167
+ AVS: 'avs',
20168
+ AVU: 'avu',
20169
+ AVL: 'avl'
20170
+ };
20171
+ var SVGUtils = /*#__PURE__*/function () {
20172
+ function SVGUtils() {
20173
+ _classCallCheck(this, SVGUtils);
20174
+ }
20175
+ /**
20176
+ * This function removes all VIF and OLF information from the SVG. This is used for displaying only the OLT information
20177
+ * @param content The svg with OLF and OLT
20178
+ * @returns SVG with only OLT information
20179
+ */
20180
+ return _createClass(SVGUtils, [{
20181
+ key: "removeOLFFromSvg",
20182
+ value: function removeOLFFromSvg(content) {
20183
+ var xmlDocument = parseXml(content);
20184
+ var vifObjs = xmlDocument.evaluate("//*[starts-with(@id,'VIF')]", xmlDocument, null, 7, null);
20185
+ if (vifObjs.snapshotLength > 0) {
20186
+ for (var i = 0; i < vifObjs.snapshotLength; i++) {
20187
+ var _parentElement;
20188
+ (_parentElement = vifObjs.snapshotItem(i).parentElement) === null || _parentElement === void 0 || _parentElement.removeChild(vifObjs.snapshotItem(i));
20189
+ }
20190
+ }
20191
+ var olfObjs = xmlDocument.evaluate("//*[starts-with(@id,'OLF')]", xmlDocument, null, 7, null);
20192
+ if (olfObjs.snapshotLength > 0) {
20193
+ for (var i = 0; i < olfObjs.snapshotLength; i++) {
20194
+ var _parentElement2;
20195
+ (_parentElement2 = olfObjs.snapshotItem(i).parentElement) === null || _parentElement2 === void 0 || _parentElement2.removeChild(olfObjs.snapshotItem(i));
20196
+ }
20197
+ }
20198
+ return serializeXml(xmlDocument);
20199
+ }
20200
+
20201
+ /**
20202
+ * This function returns the DPs of an svg
20203
+ * @param content The svg with OLF and OLT
20204
+ * @returns SVG with only OLT information
20205
+ */
20206
+ }, {
20207
+ key: "getDPsInSVG",
20208
+ value: function getDPsInSVG(content) {
20209
+ var dockingpointsSvgLine = [];
20210
+ var xmlDocument = parseXml(content);
20211
+ var dpObjs = xmlDocument.evaluate("//*[starts-with(@id,'AV')]", xmlDocument, null, 7, null);
20212
+ if (dpObjs.snapshotLength > 0) {
20213
+ for (var i = 0; i < dpObjs.snapshotLength; i++) {
20214
+ var obj = dpObjs.snapshotItem(i);
20215
+ if ((obj === null || obj === void 0 ? void 0 : obj.nodeName) === 'line') {
20216
+ dockingpointsSvgLine.push({
20217
+ x1: Number(obj.getAttribute('x1')),
20218
+ y1: Number(obj.getAttribute('y1')),
20219
+ x2: Number(obj.getAttribute('x2')),
20220
+ y2: Number(obj.getAttribute('y2')),
20221
+ dockingName: obj.getAttribute('id'),
20222
+ dockingType: obj.getAttribute('id').substring(0, 3)
20223
+ });
20224
+ } else {
20225
+ throw new Error('nodename type: ' + obj.nodeName + ' not implemented');
20226
+ }
20227
+ }
20228
+ }
20229
+ dockingpointsSvgLine.sort(function (a, b) {
20230
+ if (a.dockingType === 'AVL') return -1;
20231
+ if (a.dockingType === 'AVR' && ['AVR', 'AVC', 'AVU', 'AVO', 'AVS', 'AVN'].includes(b.dockingType)) return -1;
20232
+ return 0;
20233
+ });
20234
+ return dockingpointsSvgLine;
20235
+ }
20236
+
20237
+ /**
20238
+ * Counts the docking points of an svg per connector type - the numbers an IDM detail info carries
20239
+ * when the media service analyzed the upload. Throws like getDPsInSVG on an AV element that is no line.
20240
+ * @param content The svg
20241
+ * @returns How many AV lines of each type the svg draws
20242
+ */
20243
+ }, {
20244
+ key: "countDockingPoints",
20245
+ value: function countDockingPoints(content) {
20246
+ var counts = {
20247
+ avc: 0,
20248
+ avn: 0,
20249
+ avo: 0,
20250
+ avr: 0,
20251
+ avs: 0,
20252
+ avu: 0,
20253
+ avl: 0
20254
+ };
20255
+ var _iterator = _createForOfIteratorHelper$k(this.getDPsInSVG(content)),
20256
+ _step;
20257
+ try {
20258
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
20259
+ var dockingType = _step.value.dockingType;
20260
+ // getDPsInSVG takes every id starting with 'AV', so an id like 'AVATAR' yields a type without a count
20261
+ var key = COUNT_KEY_BY_DOCKING_TYPE[dockingType];
20262
+ if (key) counts[key]++;
20263
+ }
20264
+ } catch (err) {
20265
+ _iterator.e(err);
20266
+ } finally {
20267
+ _iterator.f();
20268
+ }
20269
+ return counts;
20270
+ }
20271
+
20272
+ /**
20273
+ * This function returns the DPs of an svg
20274
+ * @param content The svg with OLF and OLT
20275
+ * @returns SVG with only OLT information
20276
+ */
20277
+ }, {
20278
+ key: "getPointOfPoligonById",
20279
+ value: function getPointOfPoligonById(content, id) {
20280
+ var points = [];
20281
+ var xmlDocument = parseXml(content);
20282
+ var dpObjs = xmlDocument.evaluate("//*[starts-with(@id,'" + id + "')]", xmlDocument, null, 7, null);
20283
+ if (dpObjs.snapshotLength > 1 || dpObjs.snapshotLength == 0) return undefined;
20284
+ for (var i = 0; i < dpObjs.snapshotLength; i++) {
20285
+ var obj = dpObjs.snapshotItem(i);
20286
+ if ((obj === null || obj === void 0 ? void 0 : obj.nodeName) === 'polygon') {
20287
+ var pointsAsString = obj.getAttribute('points');
20288
+ if (pointsAsString) {
20289
+ var pointsFromString = pointsAsString.split(' ');
20290
+ for (var j = 0; j < pointsFromString.length; j++) {
20291
+ var xandY = pointsFromString[j].split(',');
20292
+ if (xandY.length !== 2) continue;
20293
+ points.push(new Vector2(Number(xandY[0]), Number(xandY[1])));
20294
+ }
20295
+ } else {
20296
+ return undefined;
20297
+ }
20298
+ }
20299
+ }
20300
+ return points;
20301
+ }
20302
+ }, {
20303
+ key: "getBoundingBoxOfPoints",
20304
+ value: function getBoundingBoxOfPoints(points) {
20305
+ var xArr = points.map(function (c) {
20306
+ return c.x;
20307
+ });
20308
+ var yArr = points.map(function (c) {
20309
+ return c.y;
20310
+ });
20311
+ var minX = Math.min.apply(Math, _toConsumableArray(xArr));
20312
+ var maxX = Math.max.apply(Math, _toConsumableArray(xArr));
20313
+ var minY = Math.min.apply(Math, _toConsumableArray(yArr));
20314
+ var maxY = Math.max.apply(Math, _toConsumableArray(yArr));
20315
+ var width = maxX - minX;
20316
+ var height = maxY - minY;
20317
+ return {
20318
+ width: width,
20319
+ height: height,
20320
+ minX: minX,
20321
+ minY: minY
20322
+ };
20323
+ }
20324
+
20325
+ /**
20326
+ * Returns OLF geometry (minX, minY, width, height) from SVG - supports rect and polygon.
20327
+ * Iterates through matches to find first rect/polygon (handles Illustrator group wrappers).
20328
+ */
20329
+ }, {
20330
+ key: "getOLFGeometryFromSvg",
20331
+ value: function getOLFGeometryFromSvg(content) {
20332
+ var xmlDocument = parseXml(content);
20333
+ var olfObjs = xmlDocument.evaluate("//*[starts-with(@id,'OLF')]", xmlDocument, null, 7, null);
20334
+ for (var i = 0; i < olfObjs.snapshotLength; i++) {
20335
+ var obj = olfObjs.snapshotItem(i);
20336
+ if ((obj === null || obj === void 0 ? void 0 : obj.nodeName) === 'rect') {
20337
+ var _obj$getAttribute, _obj$getAttribute2, _obj$getAttribute3, _obj$getAttribute4;
20338
+ var x = parseFloat((_obj$getAttribute = obj.getAttribute('x')) !== null && _obj$getAttribute !== void 0 ? _obj$getAttribute : '0');
20339
+ var y = parseFloat((_obj$getAttribute2 = obj.getAttribute('y')) !== null && _obj$getAttribute2 !== void 0 ? _obj$getAttribute2 : '0');
20340
+ var width = parseFloat((_obj$getAttribute3 = obj.getAttribute('width')) !== null && _obj$getAttribute3 !== void 0 ? _obj$getAttribute3 : '0');
20341
+ var height = parseFloat((_obj$getAttribute4 = obj.getAttribute('height')) !== null && _obj$getAttribute4 !== void 0 ? _obj$getAttribute4 : '0');
20342
+ return {
20343
+ minX: x,
20344
+ minY: y,
20345
+ width: width,
20346
+ height: height
20347
+ };
20348
+ }
20349
+ if ((obj === null || obj === void 0 ? void 0 : obj.nodeName) === 'polygon') {
20350
+ var pts = obj.getAttribute('points');
20351
+ if (pts) {
20352
+ var points = pts.split(/\s+/).reduce(function (acc, p) {
20353
+ var _p$split = p.split(','),
20354
+ _p$split2 = _slicedToArray(_p$split, 2),
20355
+ x = _p$split2[0],
20356
+ y = _p$split2[1];
20357
+ if (x != null && y != null) acc.push(new Vector2(Number(x), Number(y)));
20358
+ return acc;
20359
+ }, []);
20360
+ if (points.length) {
20361
+ var bbox = this.getBoundingBoxOfPoints(points);
20362
+ return {
20363
+ minX: bbox.minX,
20364
+ minY: bbox.minY,
20365
+ width: bbox.width,
20366
+ height: bbox.height
20367
+ };
20368
+ }
20369
+ }
20370
+ }
20371
+ }
20372
+ return undefined;
20373
+ }
20374
+
20375
+ /**
20376
+ * Returns OLT geometry (x, y, width, height) from SVG attributes - untransformed coords.
20377
+ * Iterates through matches to find first rect/polygon (handles Illustrator group wrappers).
20378
+ */
20379
+ }, {
20380
+ key: "getOLTGeometryFromSvg",
20381
+ value: function getOLTGeometryFromSvg(content) {
20382
+ var xmlDocument = parseXml(content);
20383
+ var oltObjs = xmlDocument.evaluate("//*[starts-with(@id,'OLT')]", xmlDocument, null, 7, null);
20384
+ for (var i = 0; i < oltObjs.snapshotLength; i++) {
20385
+ var obj = oltObjs.snapshotItem(i);
20386
+ if ((obj === null || obj === void 0 ? void 0 : obj.nodeName) === 'rect') {
20387
+ var _obj$getAttribute5, _obj$getAttribute6, _obj$getAttribute7, _obj$getAttribute8;
20388
+ var x = parseFloat((_obj$getAttribute5 = obj.getAttribute('x')) !== null && _obj$getAttribute5 !== void 0 ? _obj$getAttribute5 : '0');
20389
+ var y = parseFloat((_obj$getAttribute6 = obj.getAttribute('y')) !== null && _obj$getAttribute6 !== void 0 ? _obj$getAttribute6 : '0');
20390
+ var width = parseFloat((_obj$getAttribute7 = obj.getAttribute('width')) !== null && _obj$getAttribute7 !== void 0 ? _obj$getAttribute7 : '0');
20391
+ var height = parseFloat((_obj$getAttribute8 = obj.getAttribute('height')) !== null && _obj$getAttribute8 !== void 0 ? _obj$getAttribute8 : '0');
20392
+ return {
20393
+ x: x,
20394
+ y: y,
20395
+ width: width,
20396
+ height: height
20397
+ };
20398
+ }
20399
+ if ((obj === null || obj === void 0 ? void 0 : obj.nodeName) === 'polygon') {
20400
+ var pts = obj.getAttribute('points');
20401
+ if (pts) {
20402
+ var points = pts.split(/\s+/).reduce(function (acc, p) {
20403
+ var _p$split3 = p.split(','),
20404
+ _p$split4 = _slicedToArray(_p$split3, 2),
20405
+ x = _p$split4[0],
20406
+ y = _p$split4[1];
20407
+ if (x != null && y != null) acc.push(new Vector2(Number(x), Number(y)));
20408
+ return acc;
20409
+ }, []);
20410
+ if (points.length) {
20411
+ var bbox = this.getBoundingBoxOfPoints(points);
20412
+ return {
20413
+ x: bbox.minX,
20414
+ y: bbox.minY,
20415
+ width: bbox.width,
20416
+ height: bbox.height
20417
+ };
20418
+ }
20419
+ }
20420
+ }
20421
+ }
20422
+ return undefined;
20423
+ }
20424
+
20425
+ /**
20426
+ * This function looks if the svg has a Mask HTML element. If so it removes all masks from SVG
20427
+ * @param content
20428
+ */
20429
+ }, {
20430
+ key: "removeMaskFromSvg",
20431
+ value: function removeMaskFromSvg(content) {
20432
+ return removeMask(content);
20433
+ }
20434
+
20435
+ /**
20436
+ * Stretches the SVG to the target OLT size and passes the result to the callback.
20437
+ * @param svgSourceUrl optional URL / path of the loaded SVG for diagnostics
20438
+ */
20439
+ }, {
20440
+ key: "ccCheckStretchAreas",
20441
+ value: function ccCheckStretchAreas(content, newWidthCM, newHeightCM, useglobalSvgScale, svgMinBorderXVal, svgMinBorderYVal, callback, svgSourceUrl) {
20442
+ var result = stretchArticleSvg(content, newWidthCM, newHeightCM, {
20443
+ useGlobalScale: useglobalSvgScale,
20444
+ minBorderX: svgMinBorderXVal,
20445
+ minBorderY: svgMinBorderYVal
20446
+ });
20447
+ var _iterator2 = _createForOfIteratorHelper$k(result.warnings),
20448
+ _step2;
20449
+ try {
20450
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
20451
+ var warning = _step2.value;
20452
+ LOG$m.warn('[SVGUtils] ccCheckStretchAreas: ' + warning + (svgSourceUrl ? ' (svg: ' + svgSourceUrl + ')' : ''));
20453
+ }
20454
+ } catch (err) {
20455
+ _iterator2.e(err);
20456
+ } finally {
20457
+ _iterator2.f();
20458
+ }
20459
+ callback(result.svg);
20460
+ return result.sizes;
20461
+ }
20462
+ }]);
20463
+ }();
20464
+
20067
20465
  function ownKeys$q(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; }
20068
20466
  function _objectSpread$q(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$q(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$q(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20069
20467
  function _createForOfIteratorHelper$j(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$j(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; } } }; }
@@ -20133,6 +20531,9 @@ function _loadMoreFromIDMArticles() {
20133
20531
  })), undefined, undefined, 'enricher');
20134
20532
  case 3:
20135
20533
  items = _context8.sent;
20534
+ _context8.next = 6;
20535
+ return fillMissingDockingPointCounts(items, set, catalogData);
20536
+ case 6:
20136
20537
  _loop3 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop3() {
20137
20538
  var catalogArticleData, item;
20138
20539
  return _regeneratorRuntime.wrap(function _loop3$(_context4) {
@@ -20159,17 +20560,17 @@ function _loadMoreFromIDMArticles() {
20159
20560
  }, _loop3);
20160
20561
  });
20161
20562
  i = 0;
20162
- case 6:
20563
+ case 8:
20163
20564
  if (!(i < catalogArticleDatas.length)) {
20164
- _context8.next = 11;
20565
+ _context8.next = 13;
20165
20566
  break;
20166
20567
  }
20167
- return _context8.delegateYield(_loop3(), "t0", 8);
20168
- case 8:
20568
+ return _context8.delegateYield(_loop3(), "t0", 10);
20569
+ case 10:
20169
20570
  i++;
20170
- _context8.next = 6;
20571
+ _context8.next = 8;
20171
20572
  break;
20172
- case 11:
20573
+ case 13:
20173
20574
  toLoadDecisionIds = getToLoadDecisionIds(catalogArticleDatas, catalogData);
20174
20575
  toLoadPFGroups = getPriceFeatureGroups(catalogArticleDatas, catalogData);
20175
20576
  toLoadFeatureClassRefNo = _toConsumableArray(new Set(catalogArticleDatas.filter(function (a) {
@@ -20178,9 +20579,9 @@ function _loadMoreFromIDMArticles() {
20178
20579
  return a.featureClassRefNo;
20179
20580
  })));
20180
20581
  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];
20181
- _context8.next = 17;
20582
+ _context8.next = 19;
20182
20583
  return Promise.all(promises);
20183
- case 17:
20584
+ case 19:
20184
20585
  _yield$Promise$all = _context8.sent;
20185
20586
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);
20186
20587
  featureClasses = _yield$Promise$all2[0];
@@ -20192,7 +20593,7 @@ function _loadMoreFromIDMArticles() {
20192
20593
  }
20193
20594
  }
20194
20595
  if (!(toLoadDecisionIds.length !== 0 && toLoadDecisionIds.length != (decisions === null || decisions === void 0 ? void 0 : decisions.length))) {
20195
- _context8.next = 27;
20596
+ _context8.next = 29;
20196
20597
  break;
20197
20598
  }
20198
20599
  loadedIds = new Set((_decisions$map = decisions === null || decisions === void 0 ? void 0 : decisions.map(function (d) {
@@ -20202,17 +20603,17 @@ function _loadMoreFromIDMArticles() {
20202
20603
  return !loadedIds.has(id);
20203
20604
  });
20204
20605
  throw new Error("loading decisions failed \u2013 missing: [".concat(missingIds.join(', '), "]"));
20205
- case 27:
20206
- _context8.next = 29;
20207
- return loadDecisionsReferencedByActions(set, catalogData);
20208
20606
  case 29:
20607
+ _context8.next = 31;
20608
+ return loadDecisionsReferencedByActions(set, catalogData);
20609
+ case 31:
20209
20610
  if (priceFeatureGroups) {
20210
20611
  for (_i6 = 0; _i6 < priceFeatureGroups.length; _i6++) {
20211
20612
  catalogData.loadedPriceFeaturegroups.push(initializePriceFeatureGroups(priceFeatureGroups[_i6], catalogData.idmOptionGroups));
20212
20613
  }
20213
20614
  }
20214
20615
  _iterator6 = _createForOfIteratorHelper$j(toLoadPFGroups);
20215
- _context8.prev = 31;
20616
+ _context8.prev = 33;
20216
20617
  _loop7 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop7() {
20217
20618
  var prfgNo, askedBy;
20218
20619
  return _regeneratorRuntime.wrap(function _loop7$(_context5) {
@@ -20241,33 +20642,33 @@ function _loadMoreFromIDMArticles() {
20241
20642
  }, _loop7);
20242
20643
  });
20243
20644
  _iterator6.s();
20244
- case 34:
20645
+ case 36:
20245
20646
  if ((_step6 = _iterator6.n()).done) {
20246
- _context8.next = 40;
20647
+ _context8.next = 42;
20247
20648
  break;
20248
20649
  }
20249
- return _context8.delegateYield(_loop7(), "t1", 36);
20250
- case 36:
20650
+ return _context8.delegateYield(_loop7(), "t1", 38);
20651
+ case 38:
20251
20652
  if (!_context8.t1) {
20252
- _context8.next = 38;
20653
+ _context8.next = 40;
20253
20654
  break;
20254
20655
  }
20255
- return _context8.abrupt("continue", 38);
20256
- case 38:
20257
- _context8.next = 34;
20258
- break;
20656
+ return _context8.abrupt("continue", 40);
20259
20657
  case 40:
20260
- _context8.next = 45;
20658
+ _context8.next = 36;
20261
20659
  break;
20262
20660
  case 42:
20263
- _context8.prev = 42;
20264
- _context8.t2 = _context8["catch"](31);
20661
+ _context8.next = 47;
20662
+ break;
20663
+ case 44:
20664
+ _context8.prev = 44;
20665
+ _context8.t2 = _context8["catch"](33);
20265
20666
  _iterator6.e(_context8.t2);
20266
- case 45:
20267
- _context8.prev = 45;
20667
+ case 47:
20668
+ _context8.prev = 47;
20268
20669
  _iterator6.f();
20269
- return _context8.finish(45);
20270
- case 48:
20670
+ return _context8.finish(47);
20671
+ case 50:
20271
20672
  for (_i7 = 0; _i7 < catalogArticleDatas.length; _i7++) {
20272
20673
  catalogArticleData = catalogArticleDatas[_i7];
20273
20674
  catalogArticleData.articleIDMDecisions = sortDecisions(catalogData.getDecisionsByNo(_toConsumableArray(new Set([].concat(_toConsumableArray(catalogData.globalDecisions.map(function (g) {
@@ -20279,12 +20680,12 @@ function _loadMoreFromIDMArticles() {
20279
20680
  });
20280
20681
  toLoadFeatures = getFeatures(catalogData, featureClasses);
20281
20682
  if (!toLoadFeatures.length) {
20282
- _context8.next = 62;
20683
+ _context8.next = 64;
20283
20684
  break;
20284
20685
  }
20285
- _context8.next = 54;
20686
+ _context8.next = 56;
20286
20687
  return set.api.getDataCache(set.api.getIDMFeatures(catalogData.accountGuid, toLoadFeatures), undefined, undefined, 'enricher');
20287
- case 54:
20688
+ case 56:
20288
20689
  features = _context8.sent;
20289
20690
  _loop4 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop4() {
20290
20691
  var feature, insertIndex, k, _loop5, j;
@@ -20366,19 +20767,19 @@ function _loadMoreFromIDMArticles() {
20366
20767
  }, _loop4);
20367
20768
  });
20368
20769
  _i8 = 0;
20369
- case 57:
20770
+ case 59:
20370
20771
  if (!(_i8 < features.length)) {
20371
- _context8.next = 62;
20772
+ _context8.next = 64;
20372
20773
  break;
20373
20774
  }
20374
- return _context8.delegateYield(_loop4(), "t3", 59);
20375
- case 59:
20775
+ return _context8.delegateYield(_loop4(), "t3", 61);
20776
+ case 61:
20376
20777
  _i8++;
20377
- _context8.next = 57;
20778
+ _context8.next = 59;
20378
20779
  break;
20379
- case 62:
20780
+ case 64:
20380
20781
  _iterator7 = _createForOfIteratorHelper$j(toLoadFeatures);
20381
- _context8.prev = 63;
20782
+ _context8.prev = 65;
20382
20783
  _loop8 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop8() {
20383
20784
  var featureNo, askedBy;
20384
20785
  return _regeneratorRuntime.wrap(function _loop8$(_context6) {
@@ -20408,33 +20809,33 @@ function _loadMoreFromIDMArticles() {
20408
20809
  }, _loop8);
20409
20810
  });
20410
20811
  _iterator7.s();
20411
- case 66:
20812
+ case 68:
20412
20813
  if ((_step7 = _iterator7.n()).done) {
20413
- _context8.next = 72;
20814
+ _context8.next = 74;
20414
20815
  break;
20415
20816
  }
20416
- return _context8.delegateYield(_loop8(), "t4", 68);
20417
- case 68:
20817
+ return _context8.delegateYield(_loop8(), "t4", 70);
20818
+ case 70:
20418
20819
  if (!_context8.t4) {
20419
- _context8.next = 70;
20820
+ _context8.next = 72;
20420
20821
  break;
20421
20822
  }
20422
- return _context8.abrupt("continue", 70);
20423
- case 70:
20424
- _context8.next = 66;
20425
- break;
20823
+ return _context8.abrupt("continue", 72);
20426
20824
  case 72:
20427
- _context8.next = 77;
20825
+ _context8.next = 68;
20428
20826
  break;
20429
20827
  case 74:
20430
- _context8.prev = 74;
20431
- _context8.t5 = _context8["catch"](63);
20828
+ _context8.next = 79;
20829
+ break;
20830
+ case 76:
20831
+ _context8.prev = 76;
20832
+ _context8.t5 = _context8["catch"](65);
20432
20833
  _iterator7.e(_context8.t5);
20433
- case 77:
20434
- _context8.prev = 77;
20834
+ case 79:
20835
+ _context8.prev = 79;
20435
20836
  _iterator7.f();
20436
- return _context8.finish(77);
20437
- case 80:
20837
+ return _context8.finish(79);
20838
+ case 82:
20438
20839
  _loop6 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop6() {
20439
20840
  var catalogArticleData, featureClass, features, j;
20440
20841
  return _regeneratorRuntime.wrap(function _loop6$(_context7) {
@@ -20461,25 +20862,25 @@ function _loadMoreFromIDMArticles() {
20461
20862
  }, _loop6);
20462
20863
  });
20463
20864
  _i9 = 0;
20464
- case 82:
20865
+ case 84:
20465
20866
  if (!(_i9 < catalogArticleDatas.length)) {
20466
- _context8.next = 87;
20867
+ _context8.next = 89;
20467
20868
  break;
20468
20869
  }
20469
- return _context8.delegateYield(_loop6(), "t6", 84);
20470
- case 84:
20870
+ return _context8.delegateYield(_loop6(), "t6", 86);
20871
+ case 86:
20471
20872
  _i9++;
20472
- _context8.next = 82;
20873
+ _context8.next = 84;
20473
20874
  break;
20474
- case 87:
20875
+ case 89:
20475
20876
  catalogArticleDatas.map(function (c) {
20476
20877
  return c.areOptionsLoaded = true;
20477
20878
  });
20478
- case 88:
20879
+ case 90:
20479
20880
  case "end":
20480
20881
  return _context8.stop();
20481
20882
  }
20482
- }, _callee2, null, [[31, 42, 45, 48], [63, 74, 77, 80]]);
20883
+ }, _callee2, null, [[33, 44, 47, 50], [65, 76, 79, 82]]);
20483
20884
  }));
20484
20885
  return _loadMoreFromIDMArticles.apply(this, arguments);
20485
20886
  }
@@ -20603,7 +21004,179 @@ function initIDMArticleRelations(item, catalogArticleData, catalog) {
20603
21004
  catalogArticle.hasArticleRelations = catalogArticle.articleRelations.length > 0;
20604
21005
  }
20605
21006
 
21007
+ /** True when IDM delivered no docking point counts for this svg at all - a delivered 0 is a real count. */
21008
+ function lacksDockingPointCounts(svg) {
21009
+ return [svg.avc, svg.avn, svg.avo, svg.avr, svg.avs, svg.avu, svg.avl].every(function (count) {
21010
+ return count === undefined;
21011
+ });
21012
+ }
21013
+
21014
+ /**
21015
+ * Counts the docking points of accessory svgs whose IDM detail info delivered none - the frontend counterpart
21016
+ * of api2's FillAVsIfMissing for CE catalogs. Without counts an accessory is not dockable, so the accessory
21017
+ * step adds it without its svg and the planner palette never offers it. Has to run before the relations are
21018
+ * mapped, because they and the planner palette take a snapshot of the counts.
21019
+ */
21020
+ function fillMissingDockingPointCounts(_x3, _x4, _x5) {
21021
+ return _fillMissingDockingPointCounts.apply(this, arguments);
21022
+ }
21023
+
20606
21024
  /** Load IDM decisions by number; a list too long for one GET url goes through the POST query endpoint. */
21025
+ function _fillMissingDockingPointCounts() {
21026
+ _fillMissingDockingPointCounts = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(items, set, catalogData) {
21027
+ var accessories, _iterator8, _step8, item, _iterator9, _step9, ref, accessory, svgUtils, countsByUrl, countSvg;
21028
+ return _regeneratorRuntime.wrap(function _callee4$(_context10) {
21029
+ while (1) switch (_context10.prev = _context10.next) {
21030
+ case 0:
21031
+ if (!catalogData.ignoreArticleRelations) {
21032
+ _context10.next = 2;
21033
+ break;
21034
+ }
21035
+ return _context10.abrupt("return");
21036
+ case 2:
21037
+ accessories = new Set();
21038
+ _iterator8 = _createForOfIteratorHelper$j(items);
21039
+ _context10.prev = 4;
21040
+ _iterator8.s();
21041
+ case 6:
21042
+ if ((_step8 = _iterator8.n()).done) {
21043
+ _context10.next = 29;
21044
+ break;
21045
+ }
21046
+ item = _step8.value;
21047
+ _iterator9 = _createForOfIteratorHelper$j(readAdditionalItemRefs(item));
21048
+ _context10.prev = 9;
21049
+ _iterator9.s();
21050
+ case 11:
21051
+ if ((_step9 = _iterator9.n()).done) {
21052
+ _context10.next = 19;
21053
+ break;
21054
+ }
21055
+ ref = _step9.value;
21056
+ if (!(ref.serieNo != catalogData.catalogCodex)) {
21057
+ _context10.next = 15;
21058
+ break;
21059
+ }
21060
+ return _context10.abrupt("continue", 17);
21061
+ case 15:
21062
+ accessory = catalogData.getCatalogArticle(ref.typeNo);
21063
+ if (accessory && !accessory.isHidden && accessory.catalogPlannerArticle) accessories.add(accessory);
21064
+ case 17:
21065
+ _context10.next = 11;
21066
+ break;
21067
+ case 19:
21068
+ _context10.next = 24;
21069
+ break;
21070
+ case 21:
21071
+ _context10.prev = 21;
21072
+ _context10.t0 = _context10["catch"](9);
21073
+ _iterator9.e(_context10.t0);
21074
+ case 24:
21075
+ _context10.prev = 24;
21076
+ _iterator9.f();
21077
+ return _context10.finish(24);
21078
+ case 27:
21079
+ _context10.next = 6;
21080
+ break;
21081
+ case 29:
21082
+ _context10.next = 34;
21083
+ break;
21084
+ case 31:
21085
+ _context10.prev = 31;
21086
+ _context10.t1 = _context10["catch"](4);
21087
+ _iterator8.e(_context10.t1);
21088
+ case 34:
21089
+ _context10.prev = 34;
21090
+ _iterator8.f();
21091
+ return _context10.finish(34);
21092
+ case 37:
21093
+ svgUtils = new SVGUtils(); // accessories may share a drawing - fetch and count each url once
21094
+ countsByUrl = new Map();
21095
+ countSvg = function countSvg(url) {
21096
+ var counts = countsByUrl.get(url);
21097
+ if (!counts) {
21098
+ counts = set.api.fetchData(url, {
21099
+ method: 'GET',
21100
+ config: {},
21101
+ data: {}
21102
+ }).then(function (svgContent) {
21103
+ return svgUtils.countDockingPoints(svgContent);
21104
+ })["catch"](function (e) {
21105
+ LOG$l.warn('docking points of the accessory svg ' + url + ' could not be counted', e);
21106
+ return undefined;
21107
+ });
21108
+ countsByUrl.set(url, counts);
21109
+ }
21110
+ return counts;
21111
+ };
21112
+ _context10.next = 42;
21113
+ return Promise.all(_toConsumableArray(accessories).map(/*#__PURE__*/function () {
21114
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(accessory) {
21115
+ var _accessory$svgs, _accessory$catalogPla12;
21116
+ var svgs, uncounted, counts, topCounts, paletteView;
21117
+ return _regeneratorRuntime.wrap(function _callee3$(_context9) {
21118
+ while (1) switch (_context9.prev = _context9.next) {
21119
+ case 0:
21120
+ svgs = (_accessory$svgs = accessory.svgs) !== null && _accessory$svgs !== void 0 ? _accessory$svgs : [];
21121
+ uncounted = svgs.filter(lacksDockingPointCounts);
21122
+ if (uncounted.length) {
21123
+ _context9.next = 4;
21124
+ break;
21125
+ }
21126
+ return _context9.abrupt("return");
21127
+ case 4:
21128
+ _context9.next = 6;
21129
+ return Promise.all(uncounted.map(function (svg) {
21130
+ return countSvg(svg.url);
21131
+ }));
21132
+ case 6:
21133
+ counts = _context9.sent;
21134
+ // every svg gets its counts, so an svg swap (IDMArticleEngine) reads real ones too
21135
+ uncounted.forEach(function (svg, i) {
21136
+ if (counts[i]) Object.assign(svg, counts[i]);
21137
+ });
21138
+
21139
+ // the planner article took its top values from the first svg (IDMCatalogData.getCatalogPlanner)
21140
+ topCounts = uncounted[0] === svgs[0] ? counts[0] : undefined;
21141
+ if (topCounts) {
21142
+ _context9.next = 11;
21143
+ break;
21144
+ }
21145
+ return _context9.abrupt("return");
21146
+ case 11:
21147
+ (_accessory$catalogPla12 = accessory.catalogPlannerArticle) === null || _accessory$catalogPla12 === void 0 || _accessory$catalogPla12.applyDockingPointCounts(topCounts);
21148
+ paletteView = catalogData.plannerPaletteViewInfo.catalogPlannerArticles.find(function (view) {
21149
+ return view.articleCodex == accessory.articleCodex;
21150
+ });
21151
+ if (paletteView) {
21152
+ Object.assign(paletteView, {
21153
+ hasAVC: topCounts.avc > 0,
21154
+ hasAVN: topCounts.avn > 0,
21155
+ hasAVO: topCounts.avo > 0,
21156
+ hasAVS: topCounts.avs > 0,
21157
+ hasAVU: topCounts.avu > 0,
21158
+ hasAVL: topCounts.avl > 0,
21159
+ hasAVR: topCounts.avr > 0
21160
+ });
21161
+ }
21162
+ case 14:
21163
+ case "end":
21164
+ return _context9.stop();
21165
+ }
21166
+ }, _callee3);
21167
+ }));
21168
+ return function (_x8) {
21169
+ return _ref4.apply(this, arguments);
21170
+ };
21171
+ }()));
21172
+ case 42:
21173
+ case "end":
21174
+ return _context10.stop();
21175
+ }
21176
+ }, _callee4, null, [[4, 31, 34, 37], [9, 21, 24, 27]]);
21177
+ }));
21178
+ return _fillMissingDockingPointCounts.apply(this, arguments);
21179
+ }
20607
21180
  var fetchDecisions = function fetchDecisions(set, catalogData, decisionNos) {
20608
21181
  var getUrl = set.api.getIDMDecisions(catalogData.accountGuid, decisionNos);
20609
21182
  if (getUrl.length > 2000) {
@@ -20700,7 +21273,7 @@ var loadDecisionsReferencedByActions = /*#__PURE__*/function () {
20700
21273
  }
20701
21274
  }, _callee);
20702
21275
  }));
20703
- return function loadDecisionsReferencedByActions(_x3, _x4) {
21276
+ return function loadDecisionsReferencedByActions(_x6, _x7) {
20704
21277
  return _ref3.apply(this, arguments);
20705
21278
  };
20706
21279
  }();
@@ -31695,7 +32268,7 @@ var DivaArticle = /*#__PURE__*/function () {
31695
32268
  break;
31696
32269
  }
31697
32270
  _context.next = 4;
31698
- return import('./ShelfPlanner-6f2b92a1.js');
32271
+ return import('./ShelfPlanner-29be7e07.js');
31699
32272
  case 4:
31700
32273
  _yield$import = _context.sent;
31701
32274
  ShelfPlanner = _yield$import["default"];
@@ -40289,7 +40862,7 @@ var DivaSet = /*#__PURE__*/function () {
40289
40862
  break;
40290
40863
  }
40291
40864
  _context5.next = 3;
40292
- return import('./DoorPlanner-598af141.js');
40865
+ return import('./DoorPlanner-531a001e.js');
40293
40866
  case 3:
40294
40867
  _yield$import = _context5.sent;
40295
40868
  DoorPlanner = _yield$import["default"];
@@ -43675,7 +44248,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
43675
44248
  case 6:
43676
44249
  //falls ein Accessoire verplant wurde wird das Accessoire beim Parent auch hinterlegt
43677
44250
  if (newArticle.relatedToBasketId) {
43678
- if (!newArticle.isDockable) (_set$getArticleByBask2 = set.getArticleByBasketId(newArticle.relatedToBasketId)) === null || _set$getArticleByBask2 === void 0 || _set$getArticleByBask2.addAccessoire(newArticle);
44251
+ // a dockable accessory is registered by the docking callback - one added without docking never gets there
44252
+ if (!newArticle.isDockable || initParams.notDocking) (_set$getArticleByBask2 = set.getArticleByBasketId(newArticle.relatedToBasketId)) === null || _set$getArticleByBask2 === void 0 || _set$getArticleByBask2.addAccessoire(newArticle);
43679
44253
  newArticle.accessoireParentArticle = set.getArticleByBasketId(newArticle.relatedToBasketId);
43680
44254
  }
43681
44255
  //holt die bereits gesetzten Option welche beim neuen Article übernommen werden könnten
@@ -48133,7 +48707,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
48133
48707
  break;
48134
48708
  case 3:
48135
48709
  _context12.next = 5;
48136
- return import('./PfisterWWSHandler-ebf67f99.js');
48710
+ return import('./PfisterWWSHandler-120f8933.js');
48137
48711
  case 5:
48138
48712
  _yield$import = _context12.sent;
48139
48713
  PfisterWWSHandler = _yield$import["default"];
@@ -48141,7 +48715,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
48141
48715
  return _context12.abrupt("break", 27);
48142
48716
  case 9:
48143
48717
  _context12.next = 11;
48144
- return import('./LiviqueWWSHandler-ace695dc.js');
48718
+ return import('./LiviqueWWSHandler-3c11a396.js');
48145
48719
  case 11:
48146
48720
  _yield$import2 = _context12.sent;
48147
48721
  LiviqueWWSHandler = _yield$import2["default"];
@@ -48149,7 +48723,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
48149
48723
  return _context12.abrupt("break", 27);
48150
48724
  case 15:
48151
48725
  _context12.next = 17;
48152
- return import('./SeriousBasketHandler-14961eb6.js');
48726
+ return import('./SeriousBasketHandler-070e3447.js');
48153
48727
  case 17:
48154
48728
  _yield$import3 = _context12.sent;
48155
48729
  SeriousWWSHandler = _yield$import3["default"];
@@ -48157,7 +48731,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
48157
48731
  return _context12.abrupt("break", 27);
48158
48732
  case 21:
48159
48733
  _context12.next = 23;
48160
- return import('./StandardWWSHandler-1c478a3c.js');
48734
+ return import('./StandardWWSHandler-359cb15b.js');
48161
48735
  case 23:
48162
48736
  _yield$import4 = _context12.sent;
48163
48737
  StandardWWSHandler = _yield$import4["default"];
@@ -49544,7 +50118,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
49544
50118
  //If we need real time rendering initialize the SignalR and 3D host connection Handler
49545
50119
  bootMark('signalr: chunk import start');
49546
50120
  _context3.next = 3;
49547
- return import('./Host3DSignalR-bc77d0ab.js');
50121
+ return import('./Host3DSignalR-61a6d882.js');
49548
50122
  case 3:
49549
50123
  _yield$import = _context3.sent;
49550
50124
  Host3DSignalR = _yield$import["default"];
@@ -51276,7 +51850,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
51276
51850
  break;
51277
51851
  case 8:
51278
51852
  _context5.next = 10;
51279
- return import('./DivaStandardPlanner-e1831308.js');
51853
+ return import('./DivaStandardPlanner-7afa7053.js');
51280
51854
  case 10:
51281
51855
  _yield$import = _context5.sent;
51282
51856
  DivaStandardPlanner = _yield$import["default"];
@@ -51287,7 +51861,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
51287
51861
  return _context5.abrupt("break", 21);
51288
51862
  case 15:
51289
51863
  _context5.next = 17;
51290
- return import('./DivaBoxPlanner-50d29c59.js');
51864
+ return import('./DivaBoxPlanner-3e72a31d.js');
51291
51865
  case 17:
51292
51866
  _yield$import2 = _context5.sent;
51293
51867
  DivaBoxPlanner = _yield$import2["default"];
@@ -57355,6 +57929,12 @@ var PlannerElementData = /*#__PURE__*/function () {
57355
57929
  set: function set(cornerPos) {
57356
57930
  var _this$planElement$olt3, _this$planElement$olt4;
57357
57931
  if (!this.planElement.plannerData) return;
57932
+ // Mirrors the getter: without an OLF there is no OLF/OLT split. Deriving the center from the OLT size would shift an
57933
+ // element whose OLT is smaller than its canvas (an accessory's margin for its AV lines) by half the difference.
57934
+ if (!this.HasOLFPolygon) {
57935
+ this.WorldPosCorner = cornerPos;
57936
+ return;
57937
+ }
57358
57938
  var w = (_this$planElement$olt3 = this.planElement.oltWidth) !== null && _this$planElement$olt3 !== void 0 ? _this$planElement$olt3 : this.planElement.plannerData.width;
57359
57939
  var d = (_this$planElement$olt4 = this.planElement.oltDepth) !== null && _this$planElement$olt4 !== void 0 ? _this$planElement$olt4 : this.planElement.plannerData.depth;
57360
57940
  var oltCenterDir = new Vector2(w / 2, d / 2);
@@ -75734,4 +76314,4 @@ function _withTimeout() {
75734
76314
  return _withTimeout.apply(this, arguments);
75735
76315
  }
75736
76316
 
75737
- export { collectStructureStepKeys as A, BoundingBox as B, Cell as C, DivaWebPlanner as D, runHeadlessArtifactPass as E, runHeadlessArtifactPassBatch as F, Grid as G, HQRenderScript as H, ArtifactGenerationError as I, JsonDataCache as J, OptionCatalogData as O, PlannerElementData as P, Rendering as R, Vector3 as V, articleHandlerInstance as a, setHandlerInstance as b, Vector2 as c, bootMark as d, DivaArticle as e, DivaCatalogData as f, DivaBasketHandler as g, CatalogPlannerArticleData as h, PROPERTY_SCHEMAS as i, decodePropertyValue as j, encodePropertyValue as k, loadAndRepairBasket as l, propertyValueProblem as m, editorKindOf as n, getSeriousSetNamePlaceholder as o, propertyEncodingOf as p, bootMarksEnabled as q, rawStringOf as r, summaryHandlerInstance as s, bootNetworkMark as t, bootNow as u, bootRequestName as v, Vector4 as w, creatRenderOrders as x, getOrigProductId as y, headlessSession as z };
76317
+ export { collectStructureStepKeys as A, BoundingBox as B, Cell as C, DivaWebPlanner as D, runHeadlessArtifactPass as E, runHeadlessArtifactPassBatch as F, Grid as G, HQRenderScript as H, ArtifactGenerationError as I, JsonDataCache as J, OptionCatalogData as O, PlannerElementData as P, Rendering as R, SVGUtils as S, Vector3 as V, articleHandlerInstance as a, setHandlerInstance as b, Vector2 as c, bootMark as d, DivaArticle as e, DivaCatalogData as f, DivaBasketHandler as g, CatalogPlannerArticleData as h, PROPERTY_SCHEMAS as i, decodePropertyValue as j, encodePropertyValue as k, loadAndRepairBasket as l, propertyValueProblem as m, editorKindOf as n, getSeriousSetNamePlaceholder as o, propertyEncodingOf as p, bootMarksEnabled as q, rawStringOf as r, summaryHandlerInstance as s, bootNetworkMark as t, bootNow as u, bootRequestName as v, Vector4 as w, creatRenderOrders as x, getOrigProductId as y, headlessSession as z };