@crystaldesign/web-planner-logic 26.4.4-rc.0 → 26.4.4

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-81b38167.js → DivaBoxPlanner-c26b6af8.js} +70 -29
  2. package/build/cjs/{DivaStandardPlanner-d25766e8.js → DivaStandardPlanner-45fc2811.js} +2 -2
  3. package/build/cjs/{DoorPlanner-cfade061.js → DoorPlanner-c834365e.js} +1 -1
  4. package/build/cjs/{Host3DSignalR-ea1e0367.js → Host3DSignalR-9b1c799f.js} +1 -1
  5. package/build/cjs/{LiviqueWWSHandler-85bdb39f.js → LiviqueWWSHandler-16d85641.js} +1 -1
  6. package/build/cjs/{PfisterWWSHandler-0c9a7bc9.js → PfisterWWSHandler-b96ff95f.js} +1 -1
  7. package/build/cjs/{PlannerHandler2D-e4116910.js → PlannerHandler2D-840395ec.js} +1 -1
  8. package/build/cjs/{SeriousBasketHandler-be748102.js → SeriousBasketHandler-542935f8.js} +1 -1
  9. package/build/cjs/{ShelfPlanner-b7c0f561.js → ShelfPlanner-9cd1049a.js} +1 -1
  10. package/build/cjs/{StandardWWSHandler-eb3d2e0a.js → StandardWWSHandler-fe3133ba.js} +1 -1
  11. package/build/cjs/{index-6117bdcb.js → index-5c59e38f.js} +24 -33
  12. package/build/cjs/index.js +1 -1
  13. package/build/esm/{DivaBoxPlanner-efd8d3d3.js → DivaBoxPlanner-dfe7850d.js} +70 -29
  14. package/build/esm/{DivaStandardPlanner-a5cab2d5.js → DivaStandardPlanner-717682bc.js} +2 -2
  15. package/build/esm/{DoorPlanner-121b6e03.js → DoorPlanner-d9b122c9.js} +1 -1
  16. package/build/esm/{Host3DSignalR-87513a5c.js → Host3DSignalR-10605d1e.js} +1 -1
  17. package/build/esm/{LiviqueWWSHandler-1e23241c.js → LiviqueWWSHandler-27b41478.js} +1 -1
  18. package/build/esm/{PfisterWWSHandler-33bf4219.js → PfisterWWSHandler-09aa290f.js} +1 -1
  19. package/build/esm/{PlannerHandler2D-c3dc0774.js → PlannerHandler2D-caedde6a.js} +1 -1
  20. package/build/esm/{SeriousBasketHandler-58e6f4a9.js → SeriousBasketHandler-bd9384a1.js} +1 -1
  21. package/build/esm/{ShelfPlanner-d6bb56d4.js → ShelfPlanner-17457f21.js} +1 -1
  22. package/build/esm/{StandardWWSHandler-449deae9.js → StandardWWSHandler-3ba1bd02.js} +1 -1
  23. package/build/esm/{index-42e97b44.js → index-4070d7a2.js} +24 -33
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/index.d.ts +1 -1
  26. package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/API/Checkout.d.ts +1 -27
  28. package/build/types/web-planner-logic/src/interface/API/Checkout.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/interface/API/ViewConfigDataType.d.ts +0 -2
  30. package/build/types/web-planner-logic/src/interface/API/ViewConfigDataType.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts +1 -3
  32. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts +1 -1
  34. package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts.map +1 -1
  36. package/build/types/web-planner-logic/src/logic/ConfigTree/DivaConfigTree.d.ts +1 -1
  37. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  38. package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/BoxPlannerGrid.d.ts.map +1 -1
  39. package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/ConstructionRulesHandler.d.ts.map +1 -1
  40. package/package.json +2 -2
@@ -5,11 +5,11 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
5
5
  var _createClass = require('@babel/runtime/helpers/createClass');
6
6
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
7
7
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
8
- var index = require('./index-6117bdcb.js');
8
+ var index = require('./index-5c59e38f.js');
9
9
  var DivaUtils = require('@crystaldesign/diva-utils');
10
10
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
11
11
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
12
- var PlannerHandler2D = require('./PlannerHandler2D-e4116910.js');
12
+ var PlannerHandler2D = require('./PlannerHandler2D-840395ec.js');
13
13
  require('@babel/runtime/helpers/objectWithoutProperties');
14
14
  require('axios');
15
15
  require('@crystaldesign/basket-model');
@@ -2694,12 +2694,27 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
2694
2694
  }, {
2695
2695
  key: "correctFoot",
2696
2696
  value: function correctFoot(boxPlannerGrid, optionHandler) {
2697
- var _this3 = this;
2697
+ var _bottomElements$map$f,
2698
+ _this3 = this;
2698
2699
  var elements = boxPlannerGrid.getAllElementsInFrontGrid();
2700
+ var bottomElements = boxPlannerGrid.getAllElementsInRow(0, false);
2701
+ var selectedFootSystem = (_bottomElements$map$f = bottomElements.map(function (element) {
2702
+ return _this3.getOptionVal(element.ElementId, 'OPTFUSS_SYS', optionHandler);
2703
+ }).find(function (optionValue) {
2704
+ return optionValue !== '' && optionValue !== 'OPVOHNE';
2705
+ })) !== null && _bottomElements$map$f !== void 0 ? _bottomElements$map$f : bottomElements.map(function (element) {
2706
+ return _this3.getOptionVal(element.ElementId, 'OPTFUSS_SYS', optionHandler);
2707
+ }).find(function (optionValue) {
2708
+ return optionValue !== '';
2709
+ });
2699
2710
  elements.forEach(function (e) {
2700
2711
  if (boxPlannerGrid.getElementHasBottomElement(e.ElementId)) {
2701
2712
  _this3.setOptionValue(e.ElementId, 'OPTFUSS_SYS', 'OPVOHNE', optionHandler);
2702
2713
  _this3.setOptionValue(e.ElementId, 'OPTPOSSIBILITY_FUSS_OHNE', 'OPVTRUE', optionHandler);
2714
+ } else {
2715
+ if (selectedFootSystem) {
2716
+ _this3.setOptionValue(e.ElementId, 'OPTFUSS_SYS', selectedFootSystem, optionHandler);
2717
+ }
2703
2718
  }
2704
2719
  });
2705
2720
  }
@@ -3640,22 +3655,31 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
3640
3655
  if (curGrid[cell.index.x].length == 0) curGrid.splice(cell.index.x, 1);
3641
3656
  });
3642
3657
  var refreshedGrid = [];
3658
+ var elementAreaById = new Map();
3643
3659
  curGrid.forEach(function (row, x) {
3644
3660
  refreshedGrid[x] = [];
3645
3661
  row.forEach(function (column, y) {
3646
- var area = column.plannedElement.area;
3662
+ var plannedElement = column.plannedElement;
3663
+ var elementId = plannedElement.elementId;
3664
+ var areaSpanX = plannedElement.area.toX - plannedElement.area.fromX;
3665
+ var areaSpanY = plannedElement.area.toY - plannedElement.area.fromY;
3666
+ var refreshedArea = elementAreaById.get(elementId);
3667
+ if (!refreshedArea) {
3668
+ refreshedArea = {
3669
+ fromX: x,
3670
+ fromY: y,
3671
+ toX: x + areaSpanX,
3672
+ toY: y + areaSpanY
3673
+ };
3674
+ elementAreaById.set(elementId, refreshedArea);
3675
+ }
3647
3676
  refreshedGrid[x][y] = {
3648
3677
  index: {
3649
3678
  x: x,
3650
3679
  y: y
3651
3680
  },
3652
- plannedElement: _objectSpread(_objectSpread({}, column.plannedElement), {}, {
3653
- area: {
3654
- fromX: x,
3655
- fromY: y,
3656
- toX: x + (area.toX - area.fromX),
3657
- toY: y + (area.toY - area.fromY)
3658
- }
3681
+ plannedElement: _objectSpread(_objectSpread({}, plannedElement), {}, {
3682
+ area: refreshedArea
3659
3683
  })
3660
3684
  };
3661
3685
  });
@@ -4192,7 +4216,10 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
4192
4216
  var endHeight = 0;
4193
4217
  for (var y = 0; y < currentRow.length;) {
4194
4218
  var cell = currentRow[y];
4195
- if (!cell || !cell.plannedElement) continue;
4219
+ if (!cell || !cell.plannedElement) {
4220
+ y += 1;
4221
+ continue;
4222
+ }
4196
4223
  if (cell.index.y < res.startRowIndex) startHeight = Math.round((startHeight + cell.plannedElement.size.height) * 1000) / 1000;
4197
4224
  if (cell.index.y < res.endRowIndex) endHeight = Math.round((endHeight + cell.plannedElement.size.height) * 1000) / 1000;
4198
4225
  y = cell.plannedElement.area.toY;
@@ -4204,12 +4231,15 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
4204
4231
  // only clean neighbours (for docking) add property if you also need clean ones
4205
4232
 
4206
4233
  for (var x = plannedElement.area.toX; x < curGrid.length;) {
4207
- var _neighbourRow$0$plann, _neighbourRow$0$plann2;
4234
+ var _neighbourRow$0$plann, _neighbourRow$;
4208
4235
  var neighbourRow = curGrid[x];
4209
4236
  for (var _y = 0; _y < (neighbourRow === null || neighbourRow === void 0 ? void 0 : neighbourRow.length);) {
4210
4237
  var _cell5$plannedElement, _cell5$plannedElement2;
4211
4238
  var _cell5 = neighbourRow[_y];
4212
- if (!_cell5 || neighbours.includes(_cell5)) continue;
4239
+ if (!_cell5 || neighbours.includes(_cell5)) {
4240
+ _y += 1;
4241
+ continue;
4242
+ }
4213
4243
 
4214
4244
  // cubo has ladders that cause the first box to range all to the top, therefore the height computation won't work
4215
4245
  if (plannedElement.area.fromY == _y && this.gridSetupParams.forceSingleCellPerElement && plannedElement.area.toX == x) neighbours.push(_cell5);else if (clean && !this.gridSetupParams.forceSingleCellPerElement && neighbourSize == startHeight) neighbours.push(_cell5);else if (!clean && neighbourSize >= startHeight && neighbourSize <= endHeight) neighbours.push(_cell5);
@@ -4217,7 +4247,7 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
4217
4247
  _y = (_cell5$plannedElement = (_cell5$plannedElement2 = _cell5.plannedElement) === null || _cell5$plannedElement2 === void 0 ? void 0 : _cell5$plannedElement2.area.toY) !== null && _cell5$plannedElement !== void 0 ? _cell5$plannedElement : _y + 1;
4218
4248
  }
4219
4249
  neighbourSize = 0;
4220
- x = (_neighbourRow$0$plann = (_neighbourRow$0$plann2 = neighbourRow[0].plannedElement) === null || _neighbourRow$0$plann2 === void 0 ? void 0 : _neighbourRow$0$plann2.area.toX) !== null && _neighbourRow$0$plann !== void 0 ? _neighbourRow$0$plann : x + 1;
4250
+ x = (_neighbourRow$0$plann = (_neighbourRow$ = neighbourRow[0]) === null || _neighbourRow$ === void 0 || (_neighbourRow$ = _neighbourRow$.plannedElement) === null || _neighbourRow$ === void 0 ? void 0 : _neighbourRow$.area.toX) !== null && _neighbourRow$0$plann !== void 0 ? _neighbourRow$0$plann : x + 1;
4221
4251
  }
4222
4252
  neighbours.forEach(function (n) {
4223
4253
  return !result.find(function (r) {
@@ -4227,17 +4257,21 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
4227
4257
  break;
4228
4258
  case 'LEFT':
4229
4259
  for (var _x2 = plannedElement.area.fromX - 1; _x2 >= 0;) {
4260
+ var _neighbourRow$2;
4230
4261
  var _neighbourRow = curGrid[_x2];
4231
4262
  for (var _y2 = 0; _y2 < (_neighbourRow === null || _neighbourRow === void 0 ? void 0 : _neighbourRow.length);) {
4232
4263
  var _cell6$plannedElement, _cell6$plannedElement2;
4233
4264
  var _cell6 = _neighbourRow[_y2];
4234
- if (!_cell6 || neighbours.includes(_cell6)) continue;
4265
+ if (!_cell6 || neighbours.includes(_cell6)) {
4266
+ _y2 += 1;
4267
+ continue;
4268
+ }
4235
4269
  if (plannedElement.area.fromY == _y2 && this.gridSetupParams.forceSingleCellPerElement && plannedElement.area.fromX - 1 == _x2) neighbours.push(_cell6);else if (clean && !this.gridSetupParams.forceSingleCellPerElement && neighbourSize == startHeight) neighbours.push(_cell6);else if (!clean && neighbourSize >= startHeight && neighbourSize <= endHeight) neighbours.push(_cell6);
4236
4270
  neighbourSize = Math.round((neighbourSize + _cell6.plannedElement.size.height) * 1000) / 1000;
4237
4271
  _y2 = (_cell6$plannedElement = (_cell6$plannedElement2 = _cell6.plannedElement) === null || _cell6$plannedElement2 === void 0 ? void 0 : _cell6$plannedElement2.area.toY) !== null && _cell6$plannedElement !== void 0 ? _cell6$plannedElement : _y2 + 1;
4238
4272
  }
4239
4273
  neighbourSize = 0;
4240
- _x2 = _neighbourRow[0].plannedElement ? _neighbourRow[0].plannedElement.area.fromX - 1 : _x2 + 1;
4274
+ _x2 = (_neighbourRow$2 = _neighbourRow[0]) !== null && _neighbourRow$2 !== void 0 && _neighbourRow$2.plannedElement ? _neighbourRow[0].plannedElement.area.fromX - 1 : _x2 + 1;
4241
4275
  }
4242
4276
  neighbours.forEach(function (n) {
4243
4277
  return !result.find(function (r) {
@@ -4442,7 +4476,7 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
4442
4476
  //columns and rows are swapped don't ask me why
4443
4477
  var element = curPos.cells[0].plannedElement;
4444
4478
  var index = {
4445
- x: dir == 'LEFT' ? curPos.startColIndex : curPos.endColIndex - 1,
4479
+ x: dir == 'LEFT' ? curPos.startColIndex - 1 : curPos.endColIndex,
4446
4480
  y: curPos.startRowIndex
4447
4481
  };
4448
4482
  var curGrid = curPos.backside ? this.generalPlanningState.grids[1].matrix : this.generalPlanningState.grids[0].matrix;
@@ -4454,9 +4488,21 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
4454
4488
  fromX: element.area.fromX + d,
4455
4489
  toX: element.area.toX + d
4456
4490
  });
4491
+
4492
+ // Neighbor column left/right of the copy (where support width is checked). At the grid edge that column does not exist
4493
+ // (LEFT: startColIndex === 0 → index.x === -1; RIGHT: endColIndex === curGrid.length → past last column).
4494
+ // Then scan along an in-grid column of this element so we still collect the full vertical stack to copy.
4495
+ var supportColX = index.x;
4496
+ if (!curGrid[supportColX]) {
4497
+ supportColX = dir === 'LEFT' ? curPos.startColIndex : curPos.endColIndex - 1;
4498
+ }
4457
4499
  var _loop = function _loop(_y3) {
4458
- var _curGrid$index$x$_y, _Width, _Width2;
4459
- var supportElement = (_curGrid$index$x$_y = curGrid[index.x][_y3]) === null || _curGrid$index$x$_y === void 0 ? void 0 : _curGrid$index$x$_y.plannedElement;
4500
+ var _curGrid$supportColX$, _Width, _Width2;
4501
+ if (!curGrid[supportColX]) {
4502
+ y = _y3;
4503
+ return 0;
4504
+ } // break
4505
+ var supportElement = (_curGrid$supportColX$ = curGrid[supportColX][_y3]) === null || _curGrid$supportColX$ === void 0 ? void 0 : _curGrid$supportColX$.plannedElement;
4460
4506
  if (!supportElement) {
4461
4507
  y = _y3;
4462
4508
  return 0;
@@ -4696,27 +4742,22 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
4696
4742
  var curGrid = this.generalPlanningState.grids[0].matrix;
4697
4743
  var cells = undefined;
4698
4744
  if (absoluteIndex.x < 0 && absoluteIndex.y == 0) {
4699
- var dir = deletedCells.endColIndex >= absoluteIndex.x;
4700
4745
  if (deletedCells.startColIndex <= absoluteIndex.x) absoluteIndex.x -= deletedCells.endColIndex - deletedCells.startColIndex;
4701
4746
  if (absoluteIndex.x < 0) absoluteIndex.x = 0;
4702
4747
  cells = this.createNewCells(elementData, absoluteIndex.x, absoluteIndex.y, false);
4703
4748
  var movedGrid = [];
4704
4749
  var element = cells[0].plannedElement;
4750
+ var shiftBy = element.area.toX - element.area.fromX;
4705
4751
  curGrid.forEach(function (_, x) {
4706
4752
  _.forEach(function (_, y) {
4707
- var newX = x;
4708
- var shiftX = 0;
4709
- if (y == absoluteIndex.y || absoluteIndex.y == 0) {
4710
- newX += dir ? element.area.toX - element.area.fromX : 0;
4711
- shiftX = dir ? element.area.toX - element.area.fromX : 0;
4712
- }
4753
+ var newX = x + shiftBy;
4713
4754
  if (!movedGrid[newX]) movedGrid[newX] = [];
4714
4755
  var cellElem = curGrid[x][y].plannedElement;
4715
4756
  var newCell = {
4716
4757
  plannedElement: _objectSpread(_objectSpread({}, cellElem), {}, {
4717
4758
  area: {
4718
- fromX: newX,
4719
- toX: cellElem.area.toX + shiftX,
4759
+ fromX: cellElem.area.fromX + shiftBy,
4760
+ toX: cellElem.area.toX + shiftBy,
4720
4761
  fromY: cellElem.area.fromY,
4721
4762
  toY: cellElem.area.toY
4722
4763
  }
@@ -5,9 +5,9 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
5
5
  var _createClass = require('@babel/runtime/helpers/createClass');
6
6
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
7
7
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
8
- var index = require('./index-6117bdcb.js');
8
+ var index = require('./index-5c59e38f.js');
9
9
  var DivaUtils = require('@crystaldesign/diva-utils');
10
- var PlannerHandler2D = require('./PlannerHandler2D-e4116910.js');
10
+ var PlannerHandler2D = require('./PlannerHandler2D-840395ec.js');
11
11
  require('@babel/runtime/helpers/slicedToArray');
12
12
  require('@babel/runtime/helpers/objectWithoutProperties');
13
13
  require('@babel/runtime/helpers/toConsumableArray');
@@ -3,7 +3,7 @@
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
5
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
- require('./index-6117bdcb.js');
6
+ require('./index-5c59e38f.js');
7
7
  var DivaUtils = require('@crystaldesign/diva-utils');
8
8
  require('@babel/runtime/helpers/slicedToArray');
9
9
  require('@babel/runtime/helpers/asyncToGenerator');
@@ -5,7 +5,7 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
5
5
  var _createClass = require('@babel/runtime/helpers/createClass');
6
6
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
7
7
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
8
- var index = require('./index-6117bdcb.js');
8
+ var index = require('./index-5c59e38f.js');
9
9
  var DivaUtils = require('@crystaldesign/diva-utils');
10
10
  var signalr = require('@microsoft/signalr');
11
11
  var io = require('socket.io-client');
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
- require('./index-6117bdcb.js');
5
+ require('./index-5c59e38f.js');
6
6
  require('@babel/runtime/helpers/slicedToArray');
7
7
  require('@babel/runtime/helpers/asyncToGenerator');
8
8
  require('@babel/runtime/helpers/defineProperty');
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
- var index = require('./index-6117bdcb.js');
5
+ var index = require('./index-5c59e38f.js');
6
6
  var basketModel = require('@crystaldesign/basket-model');
7
7
  var DivaUtils = require('@crystaldesign/diva-utils');
8
8
  require('@babel/runtime/helpers/slicedToArray');
@@ -5,7 +5,7 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
5
5
  var _createClass = require('@babel/runtime/helpers/createClass');
6
6
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
7
7
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
8
- var index = require('./index-6117bdcb.js');
8
+ var index = require('./index-5c59e38f.js');
9
9
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
10
10
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
11
11
  var fabric = require('fabric');
@@ -3,7 +3,7 @@
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
5
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
- var index = require('./index-6117bdcb.js');
6
+ var index = require('./index-5c59e38f.js');
7
7
  var DivaUtils = require('@crystaldesign/diva-utils');
8
8
  require('@babel/runtime/helpers/slicedToArray');
9
9
  require('@babel/runtime/helpers/asyncToGenerator');
@@ -6,7 +6,7 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
6
6
  var _createClass = require('@babel/runtime/helpers/createClass');
7
7
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
8
8
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
9
- var index = require('./index-6117bdcb.js');
9
+ var index = require('./index-5c59e38f.js');
10
10
  var DivaUtils = require('@crystaldesign/diva-utils');
11
11
  require('@babel/runtime/helpers/slicedToArray');
12
12
  require('@babel/runtime/helpers/objectWithoutProperties');
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
4
4
  var _createClass = require('@babel/runtime/helpers/createClass');
5
- require('./index-6117bdcb.js');
5
+ require('./index-5c59e38f.js');
6
6
  require('@babel/runtime/helpers/slicedToArray');
7
7
  require('@babel/runtime/helpers/asyncToGenerator');
8
8
  require('@babel/runtime/helpers/defineProperty');
@@ -29441,7 +29441,7 @@ var DivaArticle = /*#__PURE__*/function () {
29441
29441
  break;
29442
29442
  }
29443
29443
  _context.next = 4;
29444
- return Promise.resolve().then(function () { return require('./ShelfPlanner-b7c0f561.js'); });
29444
+ return Promise.resolve().then(function () { return require('./ShelfPlanner-9cd1049a.js'); });
29445
29445
  case 4:
29446
29446
  _yield$import = _context.sent;
29447
29447
  ShelfPlanner = _yield$import["default"];
@@ -33072,10 +33072,10 @@ var DivaConfigTreeData = /*#__PURE__*/function () {
33072
33072
  value: function getNewConfigStepKeyByBasketId(curConfigStepKey, basketId) {
33073
33073
  var steps = this.getAllByKey(curConfigStepKey);
33074
33074
  if (steps) {
33075
- var _Array$from$find;
33076
- return (_Array$from$find = Array.from(steps.optionStep.configSteps.values()).find(function (step) {
33075
+ var _Object$values$find;
33076
+ return (_Object$values$find = Object.values(steps.optionStep.configSteps).find(function (step) {
33077
33077
  return step.targetArticles.includes(basketId);
33078
- })) === null || _Array$from$find === void 0 ? void 0 : _Array$from$find.key;
33078
+ })) === null || _Object$values$find === void 0 ? void 0 : _Object$values$find.key;
33079
33079
  }
33080
33080
  return undefined;
33081
33081
  }
@@ -37378,7 +37378,7 @@ var DivaSet = /*#__PURE__*/function () {
37378
37378
  break;
37379
37379
  }
37380
37380
  _context5.next = 3;
37381
- return Promise.resolve().then(function () { return require('./DoorPlanner-cfade061.js'); });
37381
+ return Promise.resolve().then(function () { return require('./DoorPlanner-c834365e.js'); });
37382
37382
  case 3:
37383
37383
  _yield$import = _context5.sent;
37384
37384
  DoorPlanner = _yield$import["default"];
@@ -41410,7 +41410,6 @@ var DivaBasketHandler = /*#__PURE__*/function () {
41410
41410
  key: "initProductId",
41411
41411
  value: function () {
41412
41412
  var _initProductId = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(api, productId) {
41413
- var _this$plannerConfig$c4;
41414
41413
  var result, successful;
41415
41414
  return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
41416
41415
  while (1) switch (_context2.prev = _context2.next) {
@@ -41422,9 +41421,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
41422
41421
  this.assignNewDivaNr = true;
41423
41422
  _context2.next = 6;
41424
41423
  return this.initBasket(api, result.divaNr, {
41425
- basket: _objectSpread$9(_objectSpread$9({}, result.configuration), {}, {
41426
- OrganizationId: (_this$plannerConfig$c4 = this.plannerConfig.currentOrganization) === null || _this$plannerConfig$c4 === void 0 ? void 0 : _this$plannerConfig$c4._id
41427
- })
41424
+ basket: result.configuration
41428
41425
  }, false, productId);
41429
41426
  case 6:
41430
41427
  successful = _context2.sent;
@@ -41642,7 +41639,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
41642
41639
  _context5.next = 36;
41643
41640
  break;
41644
41641
  case 44:
41645
- this.baskets[newDivaNr] = new basketModel.BasketData(_objectSpread$9({}, basket));
41642
+ this.baskets[newDivaNr] = new basketModel.BasketData(basket);
41646
41643
  this.baskets[newDivaNr].clearRenderData();
41647
41644
  if (!keepOldDivaNr) this.divaNr = newDivaNr;
41648
41645
  if (this.assignNewDivaNr) {
@@ -41785,7 +41782,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
41785
41782
  key: "loadBasketByCustomProductId",
41786
41783
  value: function () {
41787
41784
  var _loadBasketByCustomProductId = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee8(api, key, productId, fields) {
41788
- var variantData, _this$plannerConfig$c5;
41785
+ var variantData;
41789
41786
  return _regeneratorRuntime__default["default"].wrap(function _callee8$(_context8) {
41790
41787
  while (1) switch (_context8.prev = _context8.next) {
41791
41788
  case 0:
@@ -41815,11 +41812,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
41815
41812
  if (variantData.productGroup) {
41816
41813
  this.analyticsRelevantData.productGroup = variantData.productGroup;
41817
41814
  }
41818
- return _context8.abrupt("return", this.initBasket(api, variantData.basket.DivaNr, {
41819
- basket: _objectSpread$9(_objectSpread$9({}, variantData.basket), {}, {
41820
- OrganizationId: (_this$plannerConfig$c5 = this.plannerConfig.currentOrganization) === null || _this$plannerConfig$c5 === void 0 ? void 0 : _this$plannerConfig$c5._id
41821
- })
41822
- }, undefined, productId));
41815
+ return _context8.abrupt("return", this.initBasket(api, variantData.basket.DivaNr, variantData, undefined, productId));
41823
41816
  case 12:
41824
41817
  _context8.next = 18;
41825
41818
  break;
@@ -41946,7 +41939,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
41946
41939
  key: "saveToBasket",
41947
41940
  value: function () {
41948
41941
  var _saveToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee11(api, actBasket, returnTo, arReady) {
41949
- var _this$plannerConfig$s10, _this$plannerConfig$c6, _this$_basketHandler, _api$getJwt, _URLSearchParams$get;
41942
+ var _this$plannerConfig$s10, _this$plannerConfig$c4, _this$_basketHandler, _api$getJwt, _URLSearchParams$get;
41950
41943
  var response;
41951
41944
  return _regeneratorRuntime__default["default"].wrap(function _callee11$(_context11) {
41952
41945
  while (1) switch (_context11.prev = _context11.next) {
@@ -41961,12 +41954,12 @@ var DivaBasketHandler = /*#__PURE__*/function () {
41961
41954
  return DivaUtils__default["default"].updateBasketOrgInfo(actBasket, this.plannerConfig.currentOrganization, this.plannerConfig.currentUser, (_this$plannerConfig$s10 = this.plannerConfig.settings) === null || _this$plannerConfig$s10 === void 0 ? void 0 : _this$plannerConfig$s10.keepSalesPersonDataInBasket);
41962
41955
  case 8:
41963
41956
  actBasket.UserLanguage = api.getLanguage();
41964
- actBasket.PrintRetailLogo = (_this$plannerConfig$c6 = this.plannerConfig.currentOrganization) === null || _this$plannerConfig$c6 === void 0 ? void 0 : _this$plannerConfig$c6.logoUrl;
41957
+ actBasket.PrintRetailLogo = (_this$plannerConfig$c4 = this.plannerConfig.currentOrganization) === null || _this$plannerConfig$c4 === void 0 ? void 0 : _this$plannerConfig$c4.logoUrl;
41965
41958
  _context11.next = 12;
41966
41959
  return (_this$_basketHandler = this._basketHandler) === null || _this$_basketHandler === void 0 ? void 0 : _this$_basketHandler.saveBasket({
41967
41960
  jwt: (_api$getJwt = api.getJwt()) !== null && _api$getJwt !== void 0 ? _api$getJwt : undefined,
41968
41961
  basket: actBasket,
41969
- awaitPDF: returnTo == 'SAVE_BASKET_ASYNC' ? false : true,
41962
+ awaitPDF: true,
41970
41963
  utmCampaign: (_URLSearchParams$get = new URLSearchParams(window.location.search).get('utm_campaign')) !== null && _URLSearchParams$get !== void 0 ? _URLSearchParams$get : undefined,
41971
41964
  saveToApi2: false,
41972
41965
  apiKey: api.getApiKey()
@@ -42149,7 +42142,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
42149
42142
  break;
42150
42143
  case 3:
42151
42144
  _context12.next = 5;
42152
- return Promise.resolve().then(function () { return require('./PfisterWWSHandler-0c9a7bc9.js'); });
42145
+ return Promise.resolve().then(function () { return require('./PfisterWWSHandler-b96ff95f.js'); });
42153
42146
  case 5:
42154
42147
  _yield$import = _context12.sent;
42155
42148
  PfisterWWSHandler = _yield$import["default"];
@@ -42157,7 +42150,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
42157
42150
  return _context12.abrupt("break", 27);
42158
42151
  case 9:
42159
42152
  _context12.next = 11;
42160
- return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-85bdb39f.js'); });
42153
+ return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-16d85641.js'); });
42161
42154
  case 11:
42162
42155
  _yield$import2 = _context12.sent;
42163
42156
  LiviqueWWSHandler = _yield$import2["default"];
@@ -42165,7 +42158,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
42165
42158
  return _context12.abrupt("break", 27);
42166
42159
  case 15:
42167
42160
  _context12.next = 17;
42168
- return Promise.resolve().then(function () { return require('./SeriousBasketHandler-be748102.js'); });
42161
+ return Promise.resolve().then(function () { return require('./SeriousBasketHandler-542935f8.js'); });
42169
42162
  case 17:
42170
42163
  _yield$import3 = _context12.sent;
42171
42164
  SeriousWWSHandler = _yield$import3["default"];
@@ -42173,7 +42166,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
42173
42166
  return _context12.abrupt("break", 27);
42174
42167
  case 21:
42175
42168
  _context12.next = 23;
42176
- return Promise.resolve().then(function () { return require('./StandardWWSHandler-eb3d2e0a.js'); });
42169
+ return Promise.resolve().then(function () { return require('./StandardWWSHandler-fe3133ba.js'); });
42177
42170
  case 23:
42178
42171
  _yield$import4 = _context12.sent;
42179
42172
  StandardWWSHandler = _yield$import4["default"];
@@ -43597,7 +43590,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
43597
43590
  while (1) switch (_context3.prev = _context3.next) {
43598
43591
  case 0:
43599
43592
  _context3.next = 2;
43600
- return Promise.resolve().then(function () { return require('./Host3DSignalR-ea1e0367.js'); });
43593
+ return Promise.resolve().then(function () { return require('./Host3DSignalR-9b1c799f.js'); });
43601
43594
  case 2:
43602
43595
  _yield$import = _context3.sent;
43603
43596
  Host3DSignalR = _yield$import["default"];
@@ -45350,7 +45343,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
45350
45343
  break;
45351
45344
  case 8:
45352
45345
  _context4.next = 10;
45353
- return Promise.resolve().then(function () { return require('./DivaStandardPlanner-d25766e8.js'); });
45346
+ return Promise.resolve().then(function () { return require('./DivaStandardPlanner-45fc2811.js'); });
45354
45347
  case 10:
45355
45348
  _yield$import = _context4.sent;
45356
45349
  DivaStandardPlanner = _yield$import["default"];
@@ -45361,7 +45354,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
45361
45354
  return _context4.abrupt("break", 21);
45362
45355
  case 15:
45363
45356
  _context4.next = 17;
45364
- return Promise.resolve().then(function () { return require('./DivaBoxPlanner-81b38167.js'); });
45357
+ return Promise.resolve().then(function () { return require('./DivaBoxPlanner-c26b6af8.js'); });
45365
45358
  case 17:
45366
45359
  _yield$import2 = _context4.sent;
45367
45360
  DivaBoxPlanner = _yield$import2["default"];
@@ -47211,7 +47204,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
47211
47204
  this.api.setState(this.state);
47212
47205
  this.ReturnTo = this.plannerConfig.returnTo;
47213
47206
  LOG$1.startTransaction({
47214
- event: cache !== undefined ? 'onReinitializeConfigurator' : 'onInitializeConfigurator',
47207
+ event: 'onInitializeConfigurator',
47215
47208
  message: 'Loading Basket',
47216
47209
  eventId: 'LOADING_BASKET',
47217
47210
  warningTime: 2000,
@@ -47226,13 +47219,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
47226
47219
  return this.divaBasketHandler.initializeBasket(this.api);
47227
47220
  case 12:
47228
47221
  loadSuccessful = _context14.sent;
47229
- if (this.plannerConfig.configuratorSessionId) {
47222
+ if (this.plannerConfig.configuratorSessionId === undefined && (!this.divaBasketHandler.hasConfiguratorSessionIdGetter || DivaUtils__default["default"].businessMetrics.getConfiguratorSessionId() === undefined)) {
47223
+ DivaUtils__default["default"].businessMetrics.setConfiguratorSessionId();
47224
+ } else if (this.plannerConfig.configuratorSessionId) {
47230
47225
  //force new configurator session id - Landingpage case
47231
47226
  DivaUtils__default["default"].businessMetrics.setConfiguratorSessionId(this.plannerConfig.configuratorSessionId);
47232
- } else {
47233
- // Only create a new configurator session if we don't already have one. This keeps the analytics
47234
- // session stable across re-inits (e.g. switching products inside the same catalog).
47235
- DivaUtils__default["default"].businessMetrics.setConfiguratorSessionId(undefined, true);
47236
47227
  }
47237
47228
  if (!loadSuccessful) {
47238
47229
  _context14.next = 31;
@@ -48475,7 +48466,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
48475
48466
  break;
48476
48467
  }
48477
48468
  _context28.t3 = returnTo;
48478
- _context28.next = _context28.t3 === 'OPEN_SELLER_PRODUCTCREATOR' ? 27 : _context28.t3 === 'OPEN_SELLER_BASKET' ? 29 : _context28.t3 === 'OPEN_PDF' ? 32 : _context28.t3 === 'SAVE_BASKET_WITH_MODAL' ? 32 : _context28.t3 === 'SAVE_BASKET' ? 32 : _context28.t3 === 'SAVE_BASKET_SYNC' ? 32 : _context28.t3 === 'SAVE_BASKET_ASYNC' ? 32 : 52;
48469
+ _context28.next = _context28.t3 === 'OPEN_SELLER_PRODUCTCREATOR' ? 27 : _context28.t3 === 'OPEN_SELLER_BASKET' ? 29 : _context28.t3 === 'OPEN_PDF' ? 32 : _context28.t3 === 'SAVE_BASKET_WITH_MODAL' ? 32 : _context28.t3 === 'SAVE_BASKET' ? 32 : _context28.t3 === 'SAVE_BASKET_SYNC' ? 32 : 52;
48479
48470
  break;
48480
48471
  case 27:
48481
48472
  (_this$actions34 = this.actions) === null || _this$actions34 === void 0 || _this$actions34.openComponent({
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-6117bdcb.js');
5
+ var index = require('./index-5c59e38f.js');
6
6
  require('@babel/runtime/helpers/slicedToArray');
7
7
  require('@babel/runtime/helpers/asyncToGenerator');
8
8
  require('@babel/runtime/helpers/classCallCheck');