@crystaldesign/web-planner-logic 24.12.0-beta.24 → 24.12.0-beta.26

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 (79) hide show
  1. package/build/cjs/{DivaBoxPlanner-13d3daa2.js → DivaBoxPlanner-6fa732f4.js} +2 -2
  2. package/build/cjs/{DivaStandardPlanner-4f6be897.js → DivaStandardPlanner-15808d2b.js} +2 -2
  3. package/build/cjs/{DoorPlanner-40c989b0.js → DoorPlanner-22fb3b12.js} +1 -1
  4. package/build/cjs/{Host3DSignalR-f9b0c4f0.js → Host3DSignalR-bb33f234.js} +15 -14
  5. package/build/cjs/{LiviqueWWSHandler-84f677cc.js → LiviqueWWSHandler-086d6c7f.js} +2 -2
  6. package/build/cjs/{PfisterWWSHandler-c542faae.js → PfisterWWSHandler-57aec18d.js} +2 -2
  7. package/build/cjs/{PlannerHandler2D-cf6f5b31.js → PlannerHandler2D-8d51fc0d.js} +1 -1
  8. package/build/cjs/{SeriousBasketHandler-cf892a55.js → SeriousBasketHandler-f799c493.js} +2 -2
  9. package/build/cjs/{ShelfPlanner-7177a33a.js → ShelfPlanner-2c734526.js} +1 -1
  10. package/build/cjs/{StandardWWSHandler-c4d2c718.js → StandardWWSHandler-d4a1c639.js} +2 -2
  11. package/build/cjs/{index-c9a480dc.js → index-25dd2b0f.js} +746 -1438
  12. package/build/cjs/index.js +1 -2
  13. package/build/esm/{DivaBoxPlanner-cc074c2d.js → DivaBoxPlanner-e34a256a.js} +2 -2
  14. package/build/esm/{DivaStandardPlanner-8eef31dd.js → DivaStandardPlanner-633a4688.js} +2 -2
  15. package/build/esm/{DoorPlanner-08904ad6.js → DoorPlanner-309fbb7f.js} +1 -1
  16. package/build/esm/{Host3DSignalR-3a1b12e0.js → Host3DSignalR-1f18aa3a.js} +15 -14
  17. package/build/esm/{LiviqueWWSHandler-50bd57bb.js → LiviqueWWSHandler-838c27e1.js} +2 -2
  18. package/build/esm/{PfisterWWSHandler-4a918d83.js → PfisterWWSHandler-45fc8115.js} +2 -2
  19. package/build/esm/{PlannerHandler2D-2e7fe819.js → PlannerHandler2D-89e0e7d2.js} +1 -1
  20. package/build/esm/{SeriousBasketHandler-4d4fd122.js → SeriousBasketHandler-d5a2b64f.js} +2 -2
  21. package/build/esm/{ShelfPlanner-26990450.js → ShelfPlanner-4277ee30.js} +1 -1
  22. package/build/esm/{StandardWWSHandler-572f394d.js → StandardWWSHandler-5d42af7c.js} +2 -2
  23. package/build/esm/{index-0d565477.js → index-c2899bda.js} +748 -1438
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/index.d.ts +1 -2
  26. package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts +1 -2
  28. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/interface/Articles/ArticleInfoType.d.ts +1 -2
  30. package/build/types/web-planner-logic/src/interface/Articles/ArticleInfoType.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/interface/Articles/InitArticleType.d.ts +2 -2
  32. package/build/types/web-planner-logic/src/interface/Articles/InitArticleType.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/interface/Basket/IDivaWWSHandler.d.ts +1 -3
  34. package/build/types/web-planner-logic/src/interface/Basket/IDivaWWSHandler.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/interface/Configuration.d.ts +0 -1
  36. package/build/types/web-planner-logic/src/interface/Configuration.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts +2 -0
  38. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts.map +1 -1
  39. package/build/types/web-planner-logic/src/interface/Products/index.d.ts +6 -1
  40. package/build/types/web-planner-logic/src/interface/Products/index.d.ts.map +1 -1
  41. package/build/types/web-planner-logic/src/interface/ShelfPlanner/plannerData.d.ts +1 -1
  42. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts +6 -6
  43. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts.map +1 -1
  44. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts +4 -11
  45. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts.map +1 -1
  46. package/build/types/web-planner-logic/src/logic/Basket/LiviqueWWSHandler.d.ts +1 -3
  47. package/build/types/web-planner-logic/src/logic/Basket/LiviqueWWSHandler.d.ts.map +1 -1
  48. package/build/types/web-planner-logic/src/logic/Basket/PfisterWWSHandler.d.ts +1 -3
  49. package/build/types/web-planner-logic/src/logic/Basket/PfisterWWSHandler.d.ts.map +1 -1
  50. package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts +1 -3
  51. package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts.map +1 -1
  52. package/build/types/web-planner-logic/src/logic/Basket/StandardWWSHandler.d.ts +1 -3
  53. package/build/types/web-planner-logic/src/logic/Basket/StandardWWSHandler.d.ts.map +1 -1
  54. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts +2 -2
  55. package/build/types/web-planner-logic/src/logic/ConfigTree/SummaryHandler.d.ts +1 -2
  56. package/build/types/web-planner-logic/src/logic/ConfigTree/SummaryHandler.d.ts.map +1 -1
  57. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts +1 -2
  58. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts.map +1 -1
  59. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +5 -6
  60. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  61. package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts +8 -8
  62. package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts.map +1 -1
  63. package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts +3 -44
  64. package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts.map +1 -1
  65. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts +3 -3
  66. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts.map +1 -1
  67. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +1 -4
  68. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  69. package/build/types/web-planner-logic/src/logic/Set/FavoritesHandler.d.ts.map +1 -1
  70. package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts +2 -2
  71. package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts.map +1 -1
  72. package/build/types/web-planner-logic/src/test/scripts/productHandlerMoc.d.ts.map +1 -1
  73. package/package.json +2 -2
  74. package/build/cjs/ProductBasketHandler-8cfcadcd.js +0 -62
  75. package/build/esm/ProductBasketHandler-92131aa4.js +0 -55
  76. package/build/types/web-planner-logic/src/logic/Basket/ProductBasketHandler.d.ts +0 -14
  77. package/build/types/web-planner-logic/src/logic/Basket/ProductBasketHandler.d.ts.map +0 -1
  78. package/build/types/web-planner-logic/src/logic/Product/Product.d.ts +0 -71
  79. package/build/types/web-planner-logic/src/logic/Product/Product.d.ts.map +0 -1
@@ -431,7 +431,6 @@ var DivaApiHandler = /*#__PURE__*/function () {
431
431
  mediaServiceApiKey: data.divaMediaServiceApiKey,
432
432
  language: lang !== null && lang !== void 0 ? lang : this.getLanguage(),
433
433
  abTestCases: data.abTestCases !== undefined ? data.abTestCases : [],
434
- checkForProductsInStock: data.checkForProductsInStock,
435
434
  checkForProductsPrice: data.checkForProductsPrice,
436
435
  doDisablePlanner2D: data.doDisablePlanner2D,
437
436
  diva3dStaticBGImage: data.diva3dStaticBGImage != undefined ? data.diva3dStaticBGImage : false,
@@ -503,29 +502,23 @@ var DivaApiHandler = /*#__PURE__*/function () {
503
502
  var _this$apiConfig$host, _this$apiConfig10;
504
503
  return (_this$apiConfig$host = (_this$apiConfig10 = this.apiConfig) === null || _this$apiConfig10 === void 0 ? void 0 : _this$apiConfig10.host3d) !== null && _this$apiConfig$host !== void 0 ? _this$apiConfig$host : '';
505
504
  }
506
- }, {
507
- key: "doCheckForProductsInStock",
508
- value: function doCheckForProductsInStock() {
509
- var _this$divaWebConfigDa4;
510
- return (_this$divaWebConfigDa4 = this.divaWebConfigData) === null || _this$divaWebConfigDa4 === void 0 ? void 0 : _this$divaWebConfigDa4.checkForProductsInStock;
511
- }
512
505
  }, {
513
506
  key: "doCheckForProductsPrice",
514
507
  value: function doCheckForProductsPrice() {
515
- var _this$divaWebConfigDa5;
516
- return this.doCheckForProductsInStock() || ((_this$divaWebConfigDa5 = this.divaWebConfigData) === null || _this$divaWebConfigDa5 === void 0 ? void 0 : _this$divaWebConfigDa5.checkForProductsPrice);
508
+ var _this$divaWebConfigDa4;
509
+ return (_this$divaWebConfigDa4 = this.divaWebConfigData) === null || _this$divaWebConfigDa4 === void 0 ? void 0 : _this$divaWebConfigDa4.checkForProductsPrice;
517
510
  }
518
511
  }, {
519
512
  key: "getReportConfigIdentifier",
520
513
  value: function getReportConfigIdentifier() {
521
- var _this$divaWebConfigDa6;
522
- return (_this$divaWebConfigDa6 = this.divaWebConfigData) === null || _this$divaWebConfigDa6 === void 0 ? void 0 : _this$divaWebConfigDa6.reportConfigIdentifier;
514
+ var _this$divaWebConfigDa5;
515
+ return (_this$divaWebConfigDa5 = this.divaWebConfigData) === null || _this$divaWebConfigDa5 === void 0 ? void 0 : _this$divaWebConfigDa5.reportConfigIdentifier;
523
516
  }
524
517
  }, {
525
518
  key: "getPrintOptions",
526
519
  value: function getPrintOptions() {
527
- var _this$divaWebConfigDa7;
528
- var reportConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (_this$divaWebConfigDa7 = this.divaWebConfigData) === null || _this$divaWebConfigDa7 === void 0 ? void 0 : _this$divaWebConfigDa7.reportConfig;
520
+ var _this$divaWebConfigDa6;
521
+ var reportConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (_this$divaWebConfigDa6 = this.divaWebConfigData) === null || _this$divaWebConfigDa6 === void 0 ? void 0 : _this$divaWebConfigDa6.reportConfig;
529
522
  return {
530
523
  Gdpr: !!(reportConfig !== null && reportConfig !== void 0 && reportConfig.printWithGDPR),
531
524
  PlanningSketch: !!(reportConfig !== null && reportConfig !== void 0 && reportConfig.printWithPlanningSketch),
@@ -545,8 +538,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
545
538
  }, {
546
539
  key: "get3DRenderGroup",
547
540
  value: function get3DRenderGroup() {
548
- var _this$divaWebConfigDa8, _this$divaWebConfigDa9;
549
- return (_this$divaWebConfigDa8 = (_this$divaWebConfigDa9 = this.divaWebConfigData) === null || _this$divaWebConfigDa9 === void 0 ? void 0 : _this$divaWebConfigDa9.diva3dRenderGroup) !== null && _this$divaWebConfigDa8 !== void 0 ? _this$divaWebConfigDa8 : '';
541
+ var _this$divaWebConfigDa7, _this$divaWebConfigDa8;
542
+ return (_this$divaWebConfigDa7 = (_this$divaWebConfigDa8 = this.divaWebConfigData) === null || _this$divaWebConfigDa8 === void 0 ? void 0 : _this$divaWebConfigDa8.diva3dRenderGroup) !== null && _this$divaWebConfigDa7 !== void 0 ? _this$divaWebConfigDa7 : '';
550
543
  }
551
544
  }, {
552
545
  key: "getServerId",
@@ -583,86 +576,86 @@ var DivaApiHandler = /*#__PURE__*/function () {
583
576
  }, {
584
577
  key: "getDiva3dStaticBGImage",
585
578
  value: function getDiva3dStaticBGImage() {
586
- var _this$divaWebConfigDa10;
587
- return (_this$divaWebConfigDa10 = this.divaWebConfigData) === null || _this$divaWebConfigDa10 === void 0 ? void 0 : _this$divaWebConfigDa10.diva3dStaticBGImage;
579
+ var _this$divaWebConfigDa9;
580
+ return (_this$divaWebConfigDa9 = this.divaWebConfigData) === null || _this$divaWebConfigDa9 === void 0 ? void 0 : _this$divaWebConfigDa9.diva3dStaticBGImage;
588
581
  }
589
582
  }, {
590
583
  key: "getDiva3dStaticBGImage_DefaultRoomList",
591
584
  value: function getDiva3dStaticBGImage_DefaultRoomList() {
592
- var _this$divaWebConfigDa11, _this$divaWebConfigDa12;
593
- return ((_this$divaWebConfigDa11 = this.divaWebConfigData) === null || _this$divaWebConfigDa11 === void 0 ? void 0 : _this$divaWebConfigDa11.diva3dStaticBGImage_DefaultRoomList) == '' ? '3D_STATBG_ROOMLIST' : (_this$divaWebConfigDa12 = this.divaWebConfigData) === null || _this$divaWebConfigDa12 === void 0 ? void 0 : _this$divaWebConfigDa12.diva3dStaticBGImage_DefaultRoomList;
585
+ var _this$divaWebConfigDa10, _this$divaWebConfigDa11;
586
+ return ((_this$divaWebConfigDa10 = this.divaWebConfigData) === null || _this$divaWebConfigDa10 === void 0 ? void 0 : _this$divaWebConfigDa10.diva3dStaticBGImage_DefaultRoomList) == '' ? '3D_STATBG_ROOMLIST' : (_this$divaWebConfigDa11 = this.divaWebConfigData) === null || _this$divaWebConfigDa11 === void 0 ? void 0 : _this$divaWebConfigDa11.diva3dStaticBGImage_DefaultRoomList;
594
587
  }
595
588
  }, {
596
589
  key: "getDiva3DAllowDefaultCatRoomList",
597
590
  value: function getDiva3DAllowDefaultCatRoomList() {
598
- var _this$divaWebConfigDa13;
599
- return (_this$divaWebConfigDa13 = this.divaWebConfigData) === null || _this$divaWebConfigDa13 === void 0 ? void 0 : _this$divaWebConfigDa13.diva3DAllowDefaultCatRoomList;
591
+ var _this$divaWebConfigDa12;
592
+ return (_this$divaWebConfigDa12 = this.divaWebConfigData) === null || _this$divaWebConfigDa12 === void 0 ? void 0 : _this$divaWebConfigDa12.diva3DAllowDefaultCatRoomList;
600
593
  }
601
594
  }, {
602
595
  key: "doAllowSetPlanner",
603
596
  value: function doAllowSetPlanner() {
604
- var _this$divaWebConfigDa14;
605
- return (_this$divaWebConfigDa14 = this.divaWebConfigData) === null || _this$divaWebConfigDa14 === void 0 ? void 0 : _this$divaWebConfigDa14.doAllowSetPlanner;
597
+ var _this$divaWebConfigDa13;
598
+ return (_this$divaWebConfigDa13 = this.divaWebConfigData) === null || _this$divaWebConfigDa13 === void 0 ? void 0 : _this$divaWebConfigDa13.doAllowSetPlanner;
606
599
  }
607
600
  }, {
608
601
  key: "getHidePlanner",
609
602
  value: function getHidePlanner() {
610
- var _this$divaWebConfigDa15;
611
- return !!((_this$divaWebConfigDa15 = this.divaWebConfigData) !== null && _this$divaWebConfigDa15 !== void 0 && (_this$divaWebConfigDa15 = _this$divaWebConfigDa15.viewConfig) !== null && _this$divaWebConfigDa15 !== void 0 && _this$divaWebConfigDa15.hidePlanner);
603
+ var _this$divaWebConfigDa14;
604
+ return !!((_this$divaWebConfigDa14 = this.divaWebConfigData) !== null && _this$divaWebConfigDa14 !== void 0 && (_this$divaWebConfigDa14 = _this$divaWebConfigDa14.viewConfig) !== null && _this$divaWebConfigDa14 !== void 0 && _this$divaWebConfigDa14.hidePlanner);
612
605
  }
613
606
  }, {
614
607
  key: "getDoShowAR",
615
608
  value: function getDoShowAR() {
616
- var _this$divaWebConfigDa16;
617
- return (_this$divaWebConfigDa16 = this.divaWebConfigData) === null || _this$divaWebConfigDa16 === void 0 || (_this$divaWebConfigDa16 = _this$divaWebConfigDa16.viewConfig) === null || _this$divaWebConfigDa16 === void 0 ? void 0 : _this$divaWebConfigDa16.enableAR;
609
+ var _this$divaWebConfigDa15;
610
+ return (_this$divaWebConfigDa15 = this.divaWebConfigData) === null || _this$divaWebConfigDa15 === void 0 || (_this$divaWebConfigDa15 = _this$divaWebConfigDa15.viewConfig) === null || _this$divaWebConfigDa15 === void 0 ? void 0 : _this$divaWebConfigDa15.enableAR;
618
611
  }
619
612
  }, {
620
613
  key: "forceShowRTV",
621
614
  value: function forceShowRTV() {
622
- var _this$divaWebConfigDa17;
623
- return (_this$divaWebConfigDa17 = this.divaWebConfigData) === null || _this$divaWebConfigDa17 === void 0 || (_this$divaWebConfigDa17 = _this$divaWebConfigDa17.viewConfig) === null || _this$divaWebConfigDa17 === void 0 ? void 0 : _this$divaWebConfigDa17.forceRTV;
615
+ var _this$divaWebConfigDa16;
616
+ return (_this$divaWebConfigDa16 = this.divaWebConfigData) === null || _this$divaWebConfigDa16 === void 0 || (_this$divaWebConfigDa16 = _this$divaWebConfigDa16.viewConfig) === null || _this$divaWebConfigDa16 === void 0 ? void 0 : _this$divaWebConfigDa16.forceRTV;
624
617
  }
625
618
  }, {
626
619
  key: "getDoShowRTV",
627
620
  value: function getDoShowRTV() {
628
- var _this$divaWebConfigDa18;
629
- return (_this$divaWebConfigDa18 = this.divaWebConfigData) === null || _this$divaWebConfigDa18 === void 0 || (_this$divaWebConfigDa18 = _this$divaWebConfigDa18.viewConfig) === null || _this$divaWebConfigDa18 === void 0 ? void 0 : _this$divaWebConfigDa18.enableRTV;
621
+ var _this$divaWebConfigDa17;
622
+ return (_this$divaWebConfigDa17 = this.divaWebConfigData) === null || _this$divaWebConfigDa17 === void 0 || (_this$divaWebConfigDa17 = _this$divaWebConfigDa17.viewConfig) === null || _this$divaWebConfigDa17 === void 0 ? void 0 : _this$divaWebConfigDa17.enableRTV;
630
623
  }
631
624
  }, {
632
625
  key: "getEnableRTVUnityKombi",
633
626
  value: function getEnableRTVUnityKombi() {
634
- var _this$divaWebConfigDa19;
635
- return !!((_this$divaWebConfigDa19 = this.divaWebConfigData) !== null && _this$divaWebConfigDa19 !== void 0 && _this$divaWebConfigDa19.viewConfig.enableRtvUnityKombi);
627
+ var _this$divaWebConfigDa18;
628
+ return !!((_this$divaWebConfigDa18 = this.divaWebConfigData) !== null && _this$divaWebConfigDa18 !== void 0 && _this$divaWebConfigDa18.viewConfig.enableRtvUnityKombi);
636
629
  }
637
630
  }, {
638
631
  key: "getDoDisablePlanner2D",
639
632
  value: function getDoDisablePlanner2D() {
640
- var _this$divaWebConfigDa20;
641
- return !!((_this$divaWebConfigDa20 = this.divaWebConfigData) !== null && _this$divaWebConfigDa20 !== void 0 && _this$divaWebConfigDa20.doDisablePlanner2D);
633
+ var _this$divaWebConfigDa19;
634
+ return !!((_this$divaWebConfigDa19 = this.divaWebConfigData) !== null && _this$divaWebConfigDa19 !== void 0 && _this$divaWebConfigDa19.doDisablePlanner2D);
642
635
  }
643
636
  }, {
644
637
  key: "getRoomListInProduct",
645
638
  value: function getRoomListInProduct() {
646
- var _this$divaWebConfigDa21;
647
- return !!((_this$divaWebConfigDa21 = this.divaWebConfigData) !== null && _this$divaWebConfigDa21 !== void 0 && (_this$divaWebConfigDa21 = _this$divaWebConfigDa21.viewConfig) !== null && _this$divaWebConfigDa21 !== void 0 && _this$divaWebConfigDa21.roomListInProduct);
639
+ var _this$divaWebConfigDa20;
640
+ return !!((_this$divaWebConfigDa20 = this.divaWebConfigData) !== null && _this$divaWebConfigDa20 !== void 0 && (_this$divaWebConfigDa20 = _this$divaWebConfigDa20.viewConfig) !== null && _this$divaWebConfigDa20 !== void 0 && _this$divaWebConfigDa20.roomListInProduct);
648
641
  }
649
642
  }, {
650
643
  key: "getPlannerType",
651
644
  value: function getPlannerType() {
652
- var _this$divaWebConfigDa22;
653
- return (_this$divaWebConfigDa22 = this.divaWebConfigData) === null || _this$divaWebConfigDa22 === void 0 || (_this$divaWebConfigDa22 = _this$divaWebConfigDa22.viewConfig) === null || _this$divaWebConfigDa22 === void 0 ? void 0 : _this$divaWebConfigDa22.plannerType;
645
+ var _this$divaWebConfigDa21;
646
+ return (_this$divaWebConfigDa21 = this.divaWebConfigData) === null || _this$divaWebConfigDa21 === void 0 || (_this$divaWebConfigDa21 = _this$divaWebConfigDa21.viewConfig) === null || _this$divaWebConfigDa21 === void 0 ? void 0 : _this$divaWebConfigDa21.plannerType;
654
647
  }
655
648
  }, {
656
649
  key: "getLoadSupplierColors",
657
650
  value: function getLoadSupplierColors() {
658
- var _this$divaWebConfigDa23;
659
- return !!((_this$divaWebConfigDa23 = this.divaWebConfigData) !== null && _this$divaWebConfigDa23 !== void 0 && _this$divaWebConfigDa23.loadSupplierColors);
651
+ var _this$divaWebConfigDa22;
652
+ return !!((_this$divaWebConfigDa22 = this.divaWebConfigData) !== null && _this$divaWebConfigDa22 !== void 0 && _this$divaWebConfigDa22.loadSupplierColors);
660
653
  }
661
654
  }, {
662
655
  key: "showSelectionModeZero",
663
656
  value: function showSelectionModeZero() {
664
- var _this$divaWebConfigDa24;
665
- return !!((_this$divaWebConfigDa24 = this.divaWebConfigData) !== null && _this$divaWebConfigDa24 !== void 0 && _this$divaWebConfigDa24.showSelectionModeZero);
657
+ var _this$divaWebConfigDa23;
658
+ return !!((_this$divaWebConfigDa23 = this.divaWebConfigData) !== null && _this$divaWebConfigDa23 !== void 0 && _this$divaWebConfigDa23.showSelectionModeZero);
666
659
  }
667
660
  }, {
668
661
  key: "ruleDescSeperator",
@@ -682,8 +675,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
682
675
  }, {
683
676
  key: "getDoCheckVariantData",
684
677
  value: function getDoCheckVariantData() {
685
- var _this$divaWebConfigDa25;
686
- return (_this$divaWebConfigDa25 = this.divaWebConfigData) === null || _this$divaWebConfigDa25 === void 0 ? void 0 : _this$divaWebConfigDa25.doCheckVariantData;
678
+ var _this$divaWebConfigDa24;
679
+ return (_this$divaWebConfigDa24 = this.divaWebConfigData) === null || _this$divaWebConfigDa24 === void 0 ? void 0 : _this$divaWebConfigDa24.doCheckVariantData;
687
680
  }
688
681
  }, {
689
682
  key: "setI18n",
@@ -776,50 +769,50 @@ var DivaApiHandler = /*#__PURE__*/function () {
776
769
  }, {
777
770
  key: "getViewConfig",
778
771
  value: function getViewConfig() {
779
- var _this$divaWebConfigDa26;
780
- return (_this$divaWebConfigDa26 = this.divaWebConfigData) === null || _this$divaWebConfigDa26 === void 0 ? void 0 : _this$divaWebConfigDa26.viewConfig;
772
+ var _this$divaWebConfigDa25;
773
+ return (_this$divaWebConfigDa25 = this.divaWebConfigData) === null || _this$divaWebConfigDa25 === void 0 ? void 0 : _this$divaWebConfigDa25.viewConfig;
781
774
  }
782
775
  }, {
783
776
  key: "getEmailConfig",
784
777
  value: function getEmailConfig() {
785
- var _this$divaWebConfigDa27;
786
- return (_this$divaWebConfigDa27 = this.divaWebConfigData) === null || _this$divaWebConfigDa27 === void 0 ? void 0 : _this$divaWebConfigDa27.emailConfig;
778
+ var _this$divaWebConfigDa26;
779
+ return (_this$divaWebConfigDa26 = this.divaWebConfigData) === null || _this$divaWebConfigDa26 === void 0 ? void 0 : _this$divaWebConfigDa26.emailConfig;
787
780
  }
788
781
  }, {
789
782
  key: "getABTestCases",
790
783
  value: function getABTestCases() {
791
- var _this$divaWebConfigDa28, _this$divaWebConfigDa29;
792
- return (_this$divaWebConfigDa28 = (_this$divaWebConfigDa29 = this.divaWebConfigData) === null || _this$divaWebConfigDa29 === void 0 ? void 0 : _this$divaWebConfigDa29.abTestCases) !== null && _this$divaWebConfigDa28 !== void 0 ? _this$divaWebConfigDa28 : [];
784
+ var _this$divaWebConfigDa27, _this$divaWebConfigDa28;
785
+ return (_this$divaWebConfigDa27 = (_this$divaWebConfigDa28 = this.divaWebConfigData) === null || _this$divaWebConfigDa28 === void 0 ? void 0 : _this$divaWebConfigDa28.abTestCases) !== null && _this$divaWebConfigDa27 !== void 0 ? _this$divaWebConfigDa27 : [];
793
786
  }
794
787
  }, {
795
788
  key: "getBarrierConfig",
796
789
  value: function getBarrierConfig() {
797
- var _this$divaWebConfigDa30;
798
- return (_this$divaWebConfigDa30 = this.divaWebConfigData) === null || _this$divaWebConfigDa30 === void 0 ? void 0 : _this$divaWebConfigDa30.barrierConfig;
790
+ var _this$divaWebConfigDa29;
791
+ return (_this$divaWebConfigDa29 = this.divaWebConfigData) === null || _this$divaWebConfigDa29 === void 0 ? void 0 : _this$divaWebConfigDa29.barrierConfig;
799
792
  }
800
793
  }, {
801
794
  key: "getTemplateConfig",
802
795
  value: function getTemplateConfig() {
803
- var _this$divaWebConfigDa31;
804
- return (_this$divaWebConfigDa31 = this.divaWebConfigData) === null || _this$divaWebConfigDa31 === void 0 ? void 0 : _this$divaWebConfigDa31.templateConfig;
796
+ var _this$divaWebConfigDa30;
797
+ return (_this$divaWebConfigDa30 = this.divaWebConfigData) === null || _this$divaWebConfigDa30 === void 0 ? void 0 : _this$divaWebConfigDa30.templateConfig;
805
798
  }
806
799
  }, {
807
800
  key: "showDivaNr",
808
801
  value: function showDivaNr() {
809
- var _this$divaWebConfigDa32;
810
- return (_this$divaWebConfigDa32 = this.divaWebConfigData) === null || _this$divaWebConfigDa32 === void 0 ? void 0 : _this$divaWebConfigDa32.showDivaNr;
802
+ var _this$divaWebConfigDa31;
803
+ return (_this$divaWebConfigDa31 = this.divaWebConfigData) === null || _this$divaWebConfigDa31 === void 0 ? void 0 : _this$divaWebConfigDa31.showDivaNr;
811
804
  }
812
805
  }, {
813
806
  key: "onErrorHandling",
814
807
  value: function onErrorHandling() {
815
- var _this$divaWebConfigDa33;
816
- return (_this$divaWebConfigDa33 = this.divaWebConfigData) === null || _this$divaWebConfigDa33 === void 0 ? void 0 : _this$divaWebConfigDa33.onErrorHandling;
808
+ var _this$divaWebConfigDa32;
809
+ return (_this$divaWebConfigDa32 = this.divaWebConfigData) === null || _this$divaWebConfigDa32 === void 0 ? void 0 : _this$divaWebConfigDa32.onErrorHandling;
817
810
  }
818
811
  }, {
819
812
  key: "diva3DRenderingDefault",
820
813
  value: function diva3DRenderingDefault() {
821
- var _this$divaWebConfigDa34;
822
- return (_this$divaWebConfigDa34 = this.divaWebConfigData) === null || _this$divaWebConfigDa34 === void 0 ? void 0 : _this$divaWebConfigDa34.diva3DRenderingDefault;
814
+ var _this$divaWebConfigDa33;
815
+ return (_this$divaWebConfigDa33 = this.divaWebConfigData) === null || _this$divaWebConfigDa33 === void 0 ? void 0 : _this$divaWebConfigDa33.diva3DRenderingDefault;
823
816
  }
824
817
  }, {
825
818
  key: "getJwt",
@@ -834,8 +827,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
834
827
  }, {
835
828
  key: "getUseMask",
836
829
  value: function getUseMask() {
837
- var _this$divaWebConfigDa35;
838
- return (_this$divaWebConfigDa35 = this.divaWebConfigData) === null || _this$divaWebConfigDa35 === void 0 ? void 0 : _this$divaWebConfigDa35.useMask;
830
+ var _this$divaWebConfigDa34;
831
+ return (_this$divaWebConfigDa34 = this.divaWebConfigData) === null || _this$divaWebConfigDa34 === void 0 ? void 0 : _this$divaWebConfigDa34.useMask;
839
832
  }
840
833
  }, {
841
834
  key: "apiUrl",
@@ -895,22 +888,10 @@ var DivaApiHandler = /*#__PURE__*/function () {
895
888
  }, {
896
889
  key: "getBasketDataUrl",
897
890
  value: function getBasketDataUrl(divaNr) {
898
- //if divaNr is a variant of a divaNr (saves with favorites) divaNr looks like: "Diva-123456_0001". Here we got do build the querystring differently
899
- if (divaNr.includes('_') && divaNr.substring(divaNr.indexOf('_') + 1).length == 4) {
900
- var _divaNr$split = divaNr.split('_'),
901
- _divaNr$split2 = _slicedToArray__default["default"](_divaNr$split, 2),
902
- DivaNrAndDoc = _divaNr$split2[0],
903
- variantId = _divaNr$split2[1];
904
- var _DivaNrAndDoc$split = DivaNrAndDoc.split('-'),
905
- _DivaNrAndDoc$split2 = _slicedToArray__default["default"](_DivaNrAndDoc$split, 3),
906
- _onlyDivaNr = _DivaNrAndDoc$split2[1],
907
- _version = _DivaNrAndDoc$split2[2];
908
- return '/baskets/configuration?divaNr=' + 'DIVA-' + _onlyDivaNr + (_version ? '&version=' + _version : '') + '&variantId=' + Number(variantId) + '&dontRepairBasket=true';
909
- }
910
- var _divaNr$split3 = divaNr.split('-'),
911
- _divaNr$split4 = _slicedToArray__default["default"](_divaNr$split3, 3),
912
- onlyDivaNr = _divaNr$split4[1],
913
- version = _divaNr$split4[2];
891
+ var _divaNr$split = divaNr.split('-'),
892
+ _divaNr$split2 = _slicedToArray__default["default"](_divaNr$split, 3),
893
+ onlyDivaNr = _divaNr$split2[1],
894
+ version = _divaNr$split2[2];
914
895
  return '/baskets/configuration?divaNr=' + 'DIVA-' + onlyDivaNr + (version ? '&version=' + version : '') + '&dontRepairBasket=true';
915
896
  }
916
897
  }, {
@@ -1040,9 +1021,9 @@ var DivaApiHandler = /*#__PURE__*/function () {
1040
1021
  return '/baskets/uniqueDivaNr';
1041
1022
  }
1042
1023
  }, {
1043
- key: "fillBasketEkText",
1044
- value: function fillBasketEkText() {
1045
- return '/baskets/fillektext';
1024
+ key: "checkMatchingProducts",
1025
+ value: function checkMatchingProducts() {
1026
+ return '/v1/products/matching';
1046
1027
  }
1047
1028
  }, {
1048
1029
  key: "getAccountList",
@@ -1367,14 +1348,14 @@ var DivaApiHandler = /*#__PURE__*/function () {
1367
1348
  }, {
1368
1349
  key: "dontLoadAdditionalModelInfos",
1369
1350
  get: function get() {
1370
- var _this$divaWebConfigDa36;
1371
- return (_this$divaWebConfigDa36 = this.divaWebConfigData) === null || _this$divaWebConfigDa36 === void 0 ? void 0 : _this$divaWebConfigDa36.dontLoadAdditionalModelInfos;
1351
+ var _this$divaWebConfigDa35;
1352
+ return (_this$divaWebConfigDa35 = this.divaWebConfigData) === null || _this$divaWebConfigDa35 === void 0 ? void 0 : _this$divaWebConfigDa35.dontLoadAdditionalModelInfos;
1372
1353
  }
1373
1354
  }, {
1374
1355
  key: "dontLoadCatalogEditorLiteMask",
1375
1356
  get: function get() {
1376
- var _this$divaWebConfigDa37;
1377
- return (_this$divaWebConfigDa37 = this.divaWebConfigData) === null || _this$divaWebConfigDa37 === void 0 ? void 0 : _this$divaWebConfigDa37.dontLoadCatalogEditorLiteMask;
1357
+ var _this$divaWebConfigDa36;
1358
+ return (_this$divaWebConfigDa36 = this.divaWebConfigData) === null || _this$divaWebConfigDa36 === void 0 ? void 0 : _this$divaWebConfigDa36.dontLoadCatalogEditorLiteMask;
1378
1359
  }
1379
1360
  }, {
1380
1361
  key: "OrganizationId",
@@ -20491,7 +20472,7 @@ var DivaArticle = /*#__PURE__*/function () {
20491
20472
  ruleDesc_locales: initParams.RuleDesc_locales,
20492
20473
  toDeleteAfterInit: false,
20493
20474
  doUpdatePlannerSize: false,
20494
- shelfPlanData: initParams.ShelfPlanData ? DivaUtils__default["default"].DecodeBasketJson(initParams.ShelfPlanData) : undefined,
20475
+ shelfPlanData: initParams.ShelfPlandata ? DivaUtils__default["default"].DecodeBasketJson(initParams.ShelfPlandata) : undefined,
20495
20476
  typeNr: articleData.typeNr,
20496
20477
  initDecisions: initParams.initDecisions,
20497
20478
  previousPartlistArticles: initParams.PreviousPartlistArticles,
@@ -21808,6 +21789,18 @@ var DivaArticle = /*#__PURE__*/function () {
21808
21789
  get: function get() {
21809
21790
  return DivaUtils.md5(this.CatalogData.catalogGuid + '_' + this.articleCodex + '_' + JSON.stringify(this.VariantValuesWithoutOPTandOPV).replace(/"/g, '@'));
21810
21791
  }
21792
+ }, {
21793
+ key: "articleProductHash",
21794
+ get: function get() {
21795
+ var hash = this.catalogCodex + '_' + this.articleCodex + '_' + this.quantity + '_';
21796
+ for (var key in this.articleOptionStates) {
21797
+ var myArtOption = this.articleOptionStates[key];
21798
+ if (myArtOption.isDoShow && (!(myArtOption.idmVariantenArt == 95 || myArtOption.idmVariantenArt == 96 || myArtOption.idmVariantenArt == 97) || myArtOption.isVisibleFreeText) && myArtOption.val && myArtOption.visibleCount > 0 && !myArtOption.isDescribingState) {
21799
+ hash = hash + myArtOption.optionCodex.substring(3) + '_' + myArtOption.val.codex.substring(3) + (myArtOption.measureUnit && myArtOption.freeText !== undefined ? '_' + myArtOption.freeText : '') + (!myArtOption.measureUnit && myArtOption.isFreeText ? '_' + myArtOption.isFreeText : '');
21800
+ }
21801
+ }
21802
+ return DivaUtils.md5(hash);
21803
+ }
21811
21804
  }, {
21812
21805
  key: "VariantValuesWithoutOPTandOPV",
21813
21806
  get: function get() {
@@ -22880,6 +22873,8 @@ var DivaArticle = /*#__PURE__*/function () {
22880
22873
  optionImgForPrint: optionImgForPrint,
22881
22874
  optionsForPrint: optionsForPrint
22882
22875
  });
22876
+ } else {
22877
+ LOG$c.debug('not loading partlistarticle: ' + articleCodex + ' cause quantity is zero');
22883
22878
  }
22884
22879
  }
22885
22880
  return partlistArticlesToLoad;
@@ -23576,7 +23571,7 @@ var DivaArticle = /*#__PURE__*/function () {
23576
23571
  break;
23577
23572
  }
23578
23573
  _context.next = 4;
23579
- return Promise.resolve().then(function () { return require('./ShelfPlanner-7177a33a.js'); });
23574
+ return Promise.resolve().then(function () { return require('./ShelfPlanner-2c734526.js'); });
23580
23575
  case 4:
23581
23576
  _yield$import = _context.sent;
23582
23577
  ShelfPlanner = _yield$import["default"];
@@ -24348,12 +24343,12 @@ var DivaArticle = /*#__PURE__*/function () {
24348
24343
  }
24349
24344
  var myOptItem = {
24350
24345
  BasketID: this.basketId,
24351
- OPTCodex: OP.substring(3),
24346
+ OPT: OP.substring(3),
24352
24347
  OPTName: myArtOption.optionOrigName,
24353
24348
  OPTName_locales: myArtOption.optionName_locales,
24354
24349
  OptionOCD: myArtOption.optionOcd,
24355
24350
  OCD: myArtOption.ocd,
24356
- OPVCodex: myArtOption.val.codex.substring(3),
24351
+ OPV: myArtOption.val.codex.substring(3),
24357
24352
  vOPV: !this.CatalogData.dontUseVCodexInBasket ? myArtOption.vCodex : undefined,
24358
24353
  OPVName: DivaUtils__default["default"].stripTags(myArtOption.name),
24359
24354
  OPVName_locales: DivaUtils__default["default"].stripTagsFromDict((_myArtOption$valName_ = myArtOption.valName_locales) !== null && _myArtOption$valName_ !== void 0 ? _myArtOption$valName_ : {}),
@@ -24389,7 +24384,7 @@ var DivaArticle = /*#__PURE__*/function () {
24389
24384
  }
24390
24385
  }, {
24391
24386
  key: "getConfigPriceData",
24392
- value: function getConfigPriceData(VariantBasketData) {
24387
+ value: function getConfigPriceData(VariantBasketDatas) {
24393
24388
  var myPriceData = new basketModel.JsonConfigPriceData();
24394
24389
  myPriceData.BasePrices = [];
24395
24390
  if (this.price != 0) {
@@ -24415,12 +24410,12 @@ var DivaArticle = /*#__PURE__*/function () {
24415
24410
  } else {
24416
24411
  if (checkPrice.IsPercentage) {
24417
24412
  //Check if variantBasketdata is set as addPercentage
24418
- //TODO klären mit Franz - ist das schon der richtige Ort? In dem Fall wird VariantBasketData nicht als AddPercentage gekennzeichnet und im Checkout 1 wird CHF stattt % angezeigt.
24419
- for (var _i10 = 0; _i10 < VariantBasketData.length; _i10++) {
24413
+ //TODO klären mit Franz - ist das schon der richtige Ort? In dem Fall wird VariantBasketDatas nicht als AddPercentage gekennzeichnet und im Checkout 1 wird CHF stattt % angezeigt.
24414
+ for (var _i10 = 0; _i10 < VariantBasketDatas.length; _i10++) {
24420
24415
  var priceOPT = checkPrice.OPT.startsWith('OPT') ? checkPrice.OPT.substring(3) : checkPrice;
24421
- if (VariantBasketData[_i10].OPT == priceOPT) {
24416
+ if (VariantBasketDatas[_i10].OPT == priceOPT) {
24422
24417
  if (!isNaN(checkPrice.Price)) {
24423
- VariantBasketData[_i10].AddPercentage = checkPrice.Price * 100;
24418
+ VariantBasketDatas[_i10].AddPercentage = checkPrice.Price * 100;
24424
24419
  }
24425
24420
  }
24426
24421
  }
@@ -24436,18 +24431,18 @@ var DivaArticle = /*#__PURE__*/function () {
24436
24431
  var maxPrice = 0,
24437
24432
  maxPriceOPT = '';
24438
24433
  if (!myPriceData.BasePrice && !this.CatalogData.ignoreMaxPriceAsBP) {
24439
- for (var _i11 = 0; _i11 < VariantBasketData.length; _i11++) {
24440
- var variant = VariantBasketData[_i11];
24434
+ for (var _i11 = 0; _i11 < VariantBasketDatas.length; _i11++) {
24435
+ var variant = VariantBasketDatas[_i11];
24441
24436
  if (variant.AddPrice && (!variant.AddPrice || variant.AddPrice > maxPrice)) {
24442
24437
  maxPrice = variant.AddPrice;
24443
24438
  maxPriceOPT = variant.OPT;
24444
24439
  }
24445
24440
  }
24446
24441
  }
24447
- for (var _i12 = 0; _i12 < VariantBasketData.length; _i12++) {
24442
+ for (var _i12 = 0; _i12 < VariantBasketDatas.length; _i12++) {
24448
24443
  //WCTODO Prio 2 bei Maßauswahl
24449
24444
  var CalcPrice = void 0,
24450
- _variant = VariantBasketData[_i12],
24445
+ _variant = VariantBasketDatas[_i12],
24451
24446
  isPercentage = false;
24452
24447
  if (_variant.AddPercentage) {
24453
24448
  isPercentage = true;
@@ -25062,7 +25057,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
25062
25057
  }
25063
25058
  }
25064
25059
  }
25065
- if (value == undefined) {
25060
+ if (value == undefined && myArtOPS.isFreeText && !variantValues[_key + '_val']) {
25066
25061
  val = myArtOPS.option.freetextDefaultValue;
25067
25062
  if (val) {
25068
25063
  value = val;
@@ -26937,7 +26932,9 @@ var DivaSet = /*#__PURE__*/function () {
26937
26932
  _defineProperty__default["default"](this, "_supplierColors", void 0);
26938
26933
  /**Favorits state */
26939
26934
  _defineProperty__default["default"](this, "_handlelingCurrentFavorites", false);
26940
- _defineProperty__default["default"](this, "_favorites", void 0);
26935
+ _defineProperty__default["default"](this, "_favorites", {
26936
+ VariantValues: {}
26937
+ });
26941
26938
  //disabledVariants holds the state for explicitly variants that the user did not like so they got unselected in der summary
26942
26939
  _defineProperty__default["default"](this, "_disabledVariants", []);
26943
26940
  //for viewSummarylist to not always calc all the different valid variants we cache them and reset them when favoritesselection is changes
@@ -28106,7 +28103,7 @@ var DivaSet = /*#__PURE__*/function () {
28106
28103
  break;
28107
28104
  }
28108
28105
  _context4.next = 3;
28109
- return Promise.resolve().then(function () { return require('./DoorPlanner-40c989b0.js'); });
28106
+ return Promise.resolve().then(function () { return require('./DoorPlanner-22fb3b12.js'); });
28110
28107
  case 3:
28111
28108
  _yield$import = _context4.sent;
28112
28109
  DoorPlanner = _yield$import["default"];
@@ -28150,8 +28147,6 @@ var DivaSet = /*#__PURE__*/function () {
28150
28147
  set: function set(favorites) {
28151
28148
  this._favorites = favorites;
28152
28149
  }
28153
-
28154
- //private disabledVariants: number[] = [];
28155
28150
  }, {
28156
28151
  key: "disabledVariants",
28157
28152
  get: function get() {
@@ -28160,7 +28155,6 @@ var DivaSet = /*#__PURE__*/function () {
28160
28155
  set: function set(val) {
28161
28156
  this._disabledVariants = val;
28162
28157
  }
28163
- //private allVariantsCache FavoritesVariants[]
28164
28158
  }, {
28165
28159
  key: "allVariantsCache",
28166
28160
  get: function get() {
@@ -28283,558 +28277,6 @@ var DivaSet = /*#__PURE__*/function () {
28283
28277
  }]);
28284
28278
  }();
28285
28279
 
28286
- //Diese Klasse verwaltet Productlogiken
28287
- var Product = /*#__PURE__*/function () {
28288
- function Product(id, divaNr, articles, price, image, shortDescription, childProducts, dockingPointInfos, affiliate, retailerArticleNr, minQuantity, increments) {
28289
- _classCallCheck__default["default"](this, Product);
28290
- _defineProperty__default["default"](this, "id", void 0);
28291
- _defineProperty__default["default"](this, "productPrice", void 0);
28292
- _defineProperty__default["default"](this, "_divaNr", void 0);
28293
- _defineProperty__default["default"](this, "shortDescriptionData", void 0);
28294
- _defineProperty__default["default"](this, "imageData", void 0);
28295
- _defineProperty__default["default"](this, "articles", void 0);
28296
- _defineProperty__default["default"](this, "families", []);
28297
- _defineProperty__default["default"](this, "childProductsData", void 0);
28298
- _defineProperty__default["default"](this, "childProductsGroupedData", void 0);
28299
- _defineProperty__default["default"](this, "dockingPointInfos", void 0);
28300
- _defineProperty__default["default"](this, "_affiliate", void 0);
28301
- _defineProperty__default["default"](this, "_retailerArticleNr", void 0);
28302
- _defineProperty__default["default"](this, "_minQuantity", void 0);
28303
- _defineProperty__default["default"](this, "_increments", void 0);
28304
- _defineProperty__default["default"](this, "_curTargetArticles", void 0);
28305
- this.id = id;
28306
- this._divaNr = divaNr;
28307
- this.articles = articles;
28308
- this.productPrice = price;
28309
- this.childProductsData = childProducts;
28310
- this.shortDescriptionData = shortDescription;
28311
- this.imageData = image;
28312
- this.dockingPointInfos = dockingPointInfos;
28313
- this._affiliate = affiliate;
28314
- this._retailerArticleNr = retailerArticleNr;
28315
- this._minQuantity = minQuantity === 1 ? undefined : minQuantity;
28316
- this._increments = increments === 1 ? undefined : increments;
28317
- this._curTargetArticles = [];
28318
- if (this.childProductsData) {
28319
- this.childProductsGroupedData = {};
28320
- for (var i = 0; i < this.childProductsData.length; i++) {
28321
- if (!this.childProductsGroupedData[this.childProductsData[i]]) this.childProductsGroupedData[this.childProductsData[i]] = 0;
28322
- this.childProductsGroupedData[this.childProductsData[i]]++;
28323
- }
28324
- }
28325
- }
28326
- return _createClass__default["default"](Product, [{
28327
- key: "initFamilies",
28328
- value: function initFamilies(families) {
28329
- for (var i = 0; i < families.length; i++) {
28330
- var _families$i$childProd;
28331
- if ((_families$i$childProd = families[i].childProducts) !== null && _families$i$childProd !== void 0 && _families$i$childProd.includes(this.id)) this.families.push();
28332
- }
28333
- this.families = families;
28334
- }
28335
- }, {
28336
- key: "price",
28337
- get: function get() {
28338
- return this.productPrice;
28339
- }
28340
- }, {
28341
- key: "productId",
28342
- get: function get() {
28343
- return this.id;
28344
- }
28345
- }, {
28346
- key: "divaNr",
28347
- get: function get() {
28348
- return this._divaNr;
28349
- }
28350
- }, {
28351
- key: "isFamily",
28352
- get: function get() {
28353
- return this.childProducts !== undefined;
28354
- }
28355
- }, {
28356
- key: "variantValues",
28357
- get: function get() {
28358
- return this.articles[0].variantValues;
28359
- }
28360
- }, {
28361
- key: "childProducts",
28362
- get: function get() {
28363
- return this.childProductsData;
28364
- }
28365
- }, {
28366
- key: "childProductsGrouped",
28367
- get: function get() {
28368
- return this.childProductsGroupedData;
28369
- }
28370
- }, {
28371
- key: "shortDescription",
28372
- get: function get() {
28373
- return this.shortDescriptionData;
28374
- }
28375
- }, {
28376
- key: "image",
28377
- get: function get() {
28378
- return this.imageData;
28379
- }
28380
- }, {
28381
- key: "affiliate",
28382
- get: function get() {
28383
- return this._affiliate;
28384
- }
28385
- }, {
28386
- key: "retailerArticleNr",
28387
- get: function get() {
28388
- return this._retailerArticleNr;
28389
- }
28390
- }, {
28391
- key: "increments",
28392
- get: function get() {
28393
- // return 2;
28394
- return this._increments;
28395
- }
28396
- }, {
28397
- key: "minQuantity",
28398
- get: function get() {
28399
- // return 3;
28400
- return this._minQuantity;
28401
- }
28402
- }, {
28403
- key: "curTargetArticles",
28404
- get: function get() {
28405
- return this._curTargetArticles;
28406
- },
28407
- set: function set(targentArticles) {
28408
- this._curTargetArticles = targentArticles;
28409
- }
28410
- }, {
28411
- key: "DockingPointInfos",
28412
- get: function get() {
28413
- return this.dockingPointInfos;
28414
- }
28415
- }, {
28416
- key: "CatalogCodexes",
28417
- get: function get() {
28418
- var catalogCodexes = [];
28419
- for (var i = 0; i < this.articles.length; i++) {
28420
- catalogCodexes.push(this.articles[i].catalogCodex);
28421
- }
28422
- return catalogCodexes;
28423
- }
28424
- }, {
28425
- key: "findOPVCodexInVariantValues",
28426
- value: function findOPVCodexInVariantValues(opt, opv) {
28427
- return this.articles.find(function (article) {
28428
- return article.variantValues.find(function (variant) {
28429
- return variant.OPT === opt && variant.OPV === opv;
28430
- });
28431
- });
28432
- }
28433
- }]);
28434
- }();
28435
-
28436
- var DivaProductHandler = /*#__PURE__*/function () {
28437
- function DivaProductHandler() {
28438
- _classCallCheck__default["default"](this, DivaProductHandler);
28439
- _defineProperty__default["default"](this, "singleProducts", {});
28440
- _defineProperty__default["default"](this, "familyProducts", {});
28441
- _defineProperty__default["default"](this, "singleProductsGrouped", {});
28442
- // key is CatalogCodex and ArticleCodex
28443
- //the number is the qunaitity of the current loaded product
28444
- _defineProperty__default["default"](this, "currentFamilies", {});
28445
- _defineProperty__default["default"](this, "currentSingleProducts", {});
28446
- }
28447
- return _createClass__default["default"](DivaProductHandler, [{
28448
- key: "addProducts",
28449
- value: function addProducts(variants, families) {
28450
- var newProducts = [];
28451
- var newFamilies = [];
28452
- for (var i = 0; i < variants.length; i++) {
28453
- var _variant$discountedPr;
28454
- var article = variants[i].articles[0];
28455
- var variant = variants[i];
28456
- var codex = article.catalogCodex + '_' + article.articleCodex;
28457
- if (!this.singleProductsGrouped[codex]) this.singleProductsGrouped[codex] = {};
28458
- this.singleProductsGrouped[codex][variants[i]._id] = new Product(variant._id, variant.divaNr, variant.articles, (_variant$discountedPr = variant.discountedPrice) !== null && _variant$discountedPr !== void 0 ? _variant$discountedPr : variant.addedPrice, variant.image, variant.shortDescription, undefined, variant.dockingPointInfos, variant.affiliate, variant.retailerArticleNr, variant.minQuantity, variant.increments);
28459
- this.singleProducts[variant._id] = this.singleProductsGrouped[codex][variant._id];
28460
- newProducts.push(this.singleProductsGrouped[codex][variant._id]);
28461
- }
28462
- if (families !== null && families !== void 0 && families.length) for (var _i = 0; _i < families.length; _i++) {
28463
- var _family$discountedPri;
28464
- var family = families[_i];
28465
- this.familyProducts[family._id] = new Product(family._id, family.divaNr, family.articles, (_family$discountedPri = family.discountedPrice) !== null && _family$discountedPri !== void 0 ? _family$discountedPri : family.addedPrice, family.image, family.shortDescription, family.childProducts, family.dockingPointInfos, family.affiliate, family.retailerArticleNr, family.minQuantity, family.increments);
28466
- newFamilies.push(this.familyProducts[family._id]);
28467
- }
28468
- for (var _i2 = 0; _i2 < newProducts.length; _i2++) {
28469
- newProducts[_i2].initFamilies(newFamilies);
28470
- }
28471
- }
28472
- }, {
28473
- key: "loadProductsOfSets",
28474
- value: function () {
28475
- var _loadProductsOfSets = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(orderSets, involvedSetIds) {
28476
- return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
28477
- while (1) switch (_context.prev = _context.next) {
28478
- case 0:
28479
- case "end":
28480
- return _context.stop();
28481
- }
28482
- }, _callee);
28483
- }));
28484
- function loadProductsOfSets(_x, _x2) {
28485
- return _loadProductsOfSets.apply(this, arguments);
28486
- }
28487
- return loadProductsOfSets;
28488
- }()
28489
- }, {
28490
- key: "updateProducts",
28491
- value: function () {
28492
- var _updateProducts = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(set, from, productId) {
28493
- return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
28494
- while (1) switch (_context2.prev = _context2.next) {
28495
- case 0:
28496
- case "end":
28497
- return _context2.stop();
28498
- }
28499
- }, _callee2);
28500
- }));
28501
- function updateProducts(_x3, _x4, _x5) {
28502
- return _updateProducts.apply(this, arguments);
28503
- }
28504
- return updateProducts;
28505
- }()
28506
- }, {
28507
- key: "updateArticleProducts",
28508
- value: function updateArticleProducts(set) {
28509
- var articles = set.getDivaArticles();
28510
- var targetArticles = Object.keys(articles);
28511
- for (var i = 0; i < targetArticles.length; i++) {
28512
- var article = articles[targetArticles[i]];
28513
- var productVariants = this.singleProductsGrouped[article.catalogCodex + '_' + article.articleCodex];
28514
- for (var key in productVariants) {
28515
- var product = productVariants[key];
28516
- product.curTargetArticles = [];
28517
- }
28518
- }
28519
- for (var _i3 = 0; _i3 < targetArticles.length; _i3++) {
28520
- var _article = articles[targetArticles[_i3]];
28521
- if (!_article) continue;
28522
- var _productVariants = this.singleProductsGrouped[_article.catalogCodex + '_' + _article.articleCodex];
28523
- var newProduct = undefined;
28524
- var _loop = function _loop() {
28525
- var product = _productVariants[_key];
28526
- var productVariantValues = _article.VariantValuesWithoutOPTandOPVInObject;
28527
- var notFound = false;
28528
- var _loop2 = function _loop2(j) {
28529
- if (!productVariantValues.find(function (item) {
28530
- return item.OPT == product.variantValues[j].OPT && item.OPV == product.variantValues[j].OPV;
28531
- })) {
28532
- //only notFound set to true when the opt in general does exist in the productVariants only the value of it is different
28533
- if (productVariantValues.find(function (item) {
28534
- return item.OPT == product.variantValues[j].OPT;
28535
- })) {
28536
- notFound = true;
28537
- return 1; // break
28538
- }
28539
- }
28540
- };
28541
- for (var j = 0; j < product.variantValues.length; j++) {
28542
- if (_loop2(j)) break;
28543
- }
28544
- if (!notFound) {
28545
- newProduct = product;
28546
- newProduct.curTargetArticles.push(_article.basketId);
28547
- return 1; // break
28548
- }
28549
- };
28550
- for (var _key in _productVariants) {
28551
- if (_loop()) break;
28552
- }
28553
- _article.curProduct = newProduct;
28554
- }
28555
- }
28556
- }, {
28557
- key: "updateFamilyProducts",
28558
- value: function updateFamilyProducts() {
28559
- this.currentFamilies = {};
28560
- var familiesToCheck = this.getFamiliesToCheck();
28561
- var biggestFamily;
28562
- do {
28563
- biggestFamily = this.findBiggestFamily(familiesToCheck);
28564
- if (biggestFamily) {
28565
- if (!this.currentFamilies[biggestFamily.productId]) this.currentFamilies[biggestFamily.productId] = 0;
28566
- this.currentFamilies[biggestFamily.productId]++;
28567
- }
28568
- } while (biggestFamily);
28569
- }
28570
- }, {
28571
- key: "getFamiliesToCheck",
28572
- value: function getFamiliesToCheck() {
28573
- var familiesToCheck = {};
28574
- for (var key in this.familyProducts) {
28575
- var familiy = this.familyProducts[key];
28576
- if (!familiy.childProducts) continue;
28577
- for (var i = 0; i < familiy.childProducts.length; i++) {
28578
- if (this.currentSingleProducts[familiy.childProducts[i]]) {
28579
- familiesToCheck[familiy.productId] = familiy;
28580
- break;
28581
- }
28582
- }
28583
- }
28584
- return familiesToCheck;
28585
- }
28586
- }, {
28587
- key: "findBiggestFamily",
28588
- value: function findBiggestFamily(familiesToCheck) {
28589
- var matchingFamilies = [];
28590
- var biggestFamily = false;
28591
- for (var iKey in familiesToCheck) {
28592
- var family = familiesToCheck[iKey];
28593
- var notFit = false;
28594
- for (var jKey in family.childProductsGrouped) {
28595
- //if product does not currently exist or the quantity is to small
28596
- if (!this.currentSingleProducts[jKey] || this.currentSingleProducts[jKey] < family.childProductsGrouped[jKey]) {
28597
- notFit = true;
28598
- break;
28599
- }
28600
- }
28601
- if (!notFit) matchingFamilies.push(family);
28602
- }
28603
-
28604
- //from all the matching families find the bigges one
28605
- for (var i = 0; i < matchingFamilies.length; i++) {
28606
- if (!biggestFamily || biggestFamily.childProducts.length > matchingFamilies[i].childProducts.length) {
28607
- biggestFamily = matchingFamilies[i];
28608
- }
28609
- }
28610
- if (biggestFamily) {
28611
- //we found a final bigges familiy. Now subtract the familiy products quantity in the dictionary products for the next run
28612
- for (var key in biggestFamily.childProductsGrouped) {
28613
- biggestFamily.childProductsGrouped;
28614
- this.currentSingleProducts[key] = this.currentSingleProducts[key] - biggestFamily.childProductsGrouped[key];
28615
- }
28616
- }
28617
- return biggestFamily;
28618
- }
28619
- }, {
28620
- key: "checkQuantitySteps",
28621
- value: function () {
28622
- var _checkQuantitySteps = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(set, from, productId) {
28623
- var articles, somethingChanged, key, product, currentQuantity, deltaQuantity, whatToDo, article;
28624
- return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context3) {
28625
- while (1) switch (_context3.prev = _context3.next) {
28626
- case 0:
28627
- articles = set.getDivaArticles();
28628
- somethingChanged = false;
28629
- _context3.t0 = _regeneratorRuntime__default["default"].keys(this.currentSingleProducts);
28630
- case 3:
28631
- if ((_context3.t1 = _context3.t0()).done) {
28632
- _context3.next = 38;
28633
- break;
28634
- }
28635
- key = _context3.t1.value;
28636
- product = this.singleProducts[key];
28637
- currentQuantity = this.currentSingleProducts[key];
28638
- deltaQuantity = 0;
28639
- whatToDo = undefined;
28640
- if (product.minQuantity !== undefined) {
28641
- if (product.minQuantity > currentQuantity || product.increments !== undefined && product.increments > currentQuantity) {
28642
- if (from == 'onDelete') {
28643
- whatToDo = 'deleteArticle';
28644
- deltaQuantity = currentQuantity;
28645
- } else {
28646
- whatToDo = 'increaseQunatity';
28647
- deltaQuantity = product.minQuantity - currentQuantity;
28648
- }
28649
- somethingChanged = 'byMinQuantity';
28650
- }
28651
- }
28652
- if (!(product.increments && whatToDo !== 'deleteArticle')) {
28653
- _context3.next = 22;
28654
- break;
28655
- }
28656
- case 11:
28657
- if (!((currentQuantity + deltaQuantity) % product.increments !== 0 || from == 'onDelete' && productId == key)) {
28658
- _context3.next = 22;
28659
- break;
28660
- }
28661
- deltaQuantity++;
28662
- somethingChanged = 'byImcrement';
28663
- if (!(whatToDo !== 'increaseQunatity')) {
28664
- _context3.next = 20;
28665
- break;
28666
- }
28667
- if (!((currentQuantity - deltaQuantity) % product.increments === 0 && from != 'onAdd')) {
28668
- _context3.next = 19;
28669
- break;
28670
- }
28671
- if (!(product.minQuantity === undefined || product.minQuantity <= currentQuantity - deltaQuantity || currentQuantity - deltaQuantity === 0)) {
28672
- _context3.next = 19;
28673
- break;
28674
- }
28675
- whatToDo = 'decreaseQunatity';
28676
- return _context3.abrupt("break", 22);
28677
- case 19:
28678
- if ((currentQuantity + deltaQuantity) % product.increments === 0 && from != 'onDelete') {
28679
- whatToDo = 'increaseQunatity';
28680
- }
28681
- case 20:
28682
- _context3.next = 11;
28683
- break;
28684
- case 22:
28685
- if (!(whatToDo !== undefined)) {
28686
- _context3.next = 36;
28687
- break;
28688
- }
28689
- case 23:
28690
- if (!(deltaQuantity !== 0)) {
28691
- _context3.next = 36;
28692
- break;
28693
- }
28694
- article = articles[product.curTargetArticles[0]]; //attention!! If an article has a quantity bigger than 1 this wont work!
28695
- if (!(whatToDo === 'increaseQunatity')) {
28696
- _context3.next = 30;
28697
- break;
28698
- }
28699
- _context3.next = 28;
28700
- return setHandlerInstance.addPlannerElement(set, article.articleCodex, {
28701
- variantValues: article.VariantValues
28702
- }, 'initializingProduct');
28703
- case 28:
28704
- _context3.next = 33;
28705
- break;
28706
- case 30:
28707
- _context3.next = 32;
28708
- return setHandlerInstance.deleteElementFromSet(set, article, false, undefined, true);
28709
- case 32:
28710
- product.curTargetArticles.splice(0, 1);
28711
- case 33:
28712
- deltaQuantity--;
28713
- _context3.next = 23;
28714
- break;
28715
- case 36:
28716
- _context3.next = 3;
28717
- break;
28718
- case 38:
28719
- return _context3.abrupt("return", somethingChanged);
28720
- case 39:
28721
- case "end":
28722
- return _context3.stop();
28723
- }
28724
- }, _callee3, this);
28725
- }));
28726
- function checkQuantitySteps(_x6, _x7, _x8) {
28727
- return _checkQuantitySteps.apply(this, arguments);
28728
- }
28729
- return checkQuantitySteps;
28730
- }()
28731
- /**
28732
- * this functions controlls if the list of configItems is available or not
28733
- * @param configItems
28734
- * @param variantsInfo
28735
- * @param articles
28736
- * @param targetArticles
28737
- * @returns
28738
- */
28739
- }, {
28740
- key: "checkProductInStock",
28741
- value: function checkProductInStock(configItems, variantsInfo, articles, targetArticles) {
28742
- var productsKey = articles[targetArticles[0]].catalogCodex + '_' + articles[targetArticles[0]].articleCodex;
28743
- var products = this.singleProductsGrouped[productsKey];
28744
- var indexesToDelete = [];
28745
- for (var i = 0; i < variantsInfo.length; i++) {
28746
- var variantInStock = false;
28747
- var variantInfo = variantsInfo[i];
28748
- for (var key in products) {
28749
- //***GUF***DEBUG HERE
28750
- var productVariantValues = products[key].variantValues;
28751
- var notFound = false;
28752
- var _loop3 = function _loop3() {
28753
- var variant = variantInfo.variants[j];
28754
- if (!productVariantValues.find(function (item) {
28755
- return variant.OPT === item.OPT && variant.OPV === item.OPV;
28756
- })) {
28757
- //only notFound set to true when the opt in general does exist in the productVariants only the value of it is different
28758
- if (productVariantValues.find(function (item) {
28759
- return variant.OPT === item.OPT;
28760
- })) {
28761
- notFound = true;
28762
- return 1; // break
28763
- }
28764
- }
28765
- };
28766
- for (var j = 0; j < variantInfo.variants.length; j++) {
28767
- if (_loop3()) break;
28768
- }
28769
- if (!notFound) {
28770
- variantInStock = true;
28771
- break;
28772
- }
28773
- }
28774
- if (!variantInStock) {
28775
- if (configItems[i]) {
28776
- indexesToDelete.push(i);
28777
- }
28778
- }
28779
- }
28780
- for (var _i4 = indexesToDelete.length - 1; _i4 >= 0; _i4--) {
28781
- configItems.splice(indexesToDelete[_i4], 1);
28782
- }
28783
- return configItems;
28784
- }
28785
- }, {
28786
- key: "getPrice",
28787
- value: function getPrice() {
28788
- var price = 0;
28789
- for (var key in this.currentSingleProducts) {
28790
- price += this.singleProducts[key].price * this.currentSingleProducts[key];
28791
- }
28792
- for (var _key2 in this.currentFamilies) {
28793
- price += this.singleProducts[_key2].price * this.currentFamilies[_key2];
28794
- }
28795
- return price;
28796
- }
28797
- }, {
28798
- key: "getCurrentProducts",
28799
- value: function getCurrentProducts() {
28800
- var products = this.currentSingleProducts;
28801
- for (var key in this.currentFamilies) {
28802
- products[key] = this.currentFamilies[key];
28803
- }
28804
- return products;
28805
- }
28806
- }, {
28807
- key: "getProductById",
28808
- value: function getProductById(productId) {
28809
- var product;
28810
- product = this.singleProducts[productId];
28811
- if (!product) this.familyProducts[productId];
28812
- return product;
28813
- }
28814
- }, {
28815
- key: "getBestMatch",
28816
- value: function getBestMatch(articles) {
28817
- var OPTION_CODEX = 'KOPFTEIL';
28818
- if (!articles) return;
28819
- for (var key in articles) {
28820
- var _article$VariantValue;
28821
- var article = articles[key];
28822
- var opv = (_article$VariantValue = article.VariantValues['OPT' + OPTION_CODEX]) === null || _article$VariantValue === void 0 ? void 0 : _article$VariantValue.replace('OPV', '');
28823
- var products = this.singleProductsGrouped[article.catalogCodex + '_' + article.articleCodex];
28824
- if (!products || !opv) continue;
28825
- for (var pId in products) {
28826
- var _products$pId$affilia;
28827
- if ((_products$pId$affilia = products[pId].affiliate) !== null && _products$pId$affilia !== void 0 && _products$pId$affilia.length) if (products[pId].findOPVCodexInVariantValues(OPTION_CODEX, opv)) {
28828
- return products[pId];
28829
- }
28830
- }
28831
- }
28832
- return undefined;
28833
- }
28834
- }]);
28835
- }();
28836
- var productHandlerInstance = new DivaProductHandler();
28837
-
28838
28280
  var SummaryHandler = /*#__PURE__*/function () {
28839
28281
  function SummaryHandler() {
28840
28282
  _classCallCheck__default["default"](this, SummaryHandler);
@@ -29172,30 +28614,16 @@ var SummaryHandler = /*#__PURE__*/function () {
29172
28614
  }, {
29173
28615
  key: "getSummaryItems",
29174
28616
  value: function () {
29175
- var _getSummaryItems = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(sets, doConfigure, doAllowSetPlanner) {
28617
+ var _getSummaryItems = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(sets, doConfigure) {
29176
28618
  var ret, _key5, set, items, type;
29177
28619
  return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
29178
28620
  while (1) switch (_context.prev = _context.next) {
29179
28621
  case 0:
29180
28622
  ret = [];
29181
- if (!doAllowSetPlanner) {
29182
- _context.next = 5;
29183
- break;
29184
- }
29185
- ret = [{
29186
- items: this.getArticlesForSummary(sets),
29187
- type: 'SUMMARY_ARTICLES',
29188
- name: 'ARTICLELIST',
29189
- price: setHandlerInstance.getTotalPrice(sets),
29190
- quantity: 1
29191
- }];
29192
- _context.next = 29;
29193
- break;
29194
- case 5:
29195
28623
  _context.t0 = _regeneratorRuntime__default["default"].keys(sets);
29196
- case 6:
28624
+ case 2:
29197
28625
  if ((_context.t1 = _context.t0()).done) {
29198
- _context.next = 29;
28626
+ _context.next = 25;
29199
28627
  break;
29200
28628
  }
29201
28629
  _key5 = _context.t1.value;
@@ -29203,9 +28631,9 @@ var SummaryHandler = /*#__PURE__*/function () {
29203
28631
  items = void 0;
29204
28632
  type = this.getSummaryType(set);
29205
28633
  _context.t2 = type;
29206
- _context.next = _context.t2 === 'SUMMARY_PARTLIST' ? 14 : _context.t2 === 'SUMMARY_OPTIONTREE' ? 17 : _context.t2 === 'VARIANTS' ? 19 : _context.t2 === 'PARTLIST_AND_SPECIALOPTIONS' ? 25 : 27;
28634
+ _context.next = _context.t2 === 'SUMMARY_PARTLIST' ? 10 : _context.t2 === 'SUMMARY_OPTIONTREE' ? 13 : _context.t2 === 'VARIANTS' ? 15 : _context.t2 === 'PARTLIST_AND_SPECIALOPTIONS' ? 21 : 23;
29207
28635
  break;
29208
- case 14:
28636
+ case 10:
29209
28637
  items = this.buildSummaryItemsOfPartlist(set);
29210
28638
  ret.push({
29211
28639
  items: items,
@@ -29214,33 +28642,33 @@ var SummaryHandler = /*#__PURE__*/function () {
29214
28642
  price: set.getSetPrice(),
29215
28643
  quantity: 1
29216
28644
  });
29217
- return _context.abrupt("break", 27);
29218
- case 17:
28645
+ return _context.abrupt("break", 23);
28646
+ case 13:
29219
28647
  ret = ret.concat(this.getOptionTreeSummary(set));
29220
- return _context.abrupt("break", 27);
29221
- case 19:
28648
+ return _context.abrupt("break", 23);
28649
+ case 15:
29222
28650
  _context.t3 = ret;
29223
- _context.next = 22;
28651
+ _context.next = 18;
29224
28652
  return this.getVariantsSummary(doConfigure, set);
29225
- case 22:
28653
+ case 18:
29226
28654
  _context.t4 = _context.sent;
29227
28655
  _context.t3.push.call(_context.t3, _context.t4);
29228
- return _context.abrupt("break", 27);
29229
- case 25:
28656
+ return _context.abrupt("break", 23);
28657
+ case 21:
29230
28658
  ret.push(this.buildSummaryItemsOfPartlistWithSpecialOptions(set));
29231
- return _context.abrupt("break", 27);
29232
- case 27:
29233
- _context.next = 6;
28659
+ return _context.abrupt("break", 23);
28660
+ case 23:
28661
+ _context.next = 2;
29234
28662
  break;
29235
- case 29:
28663
+ case 25:
29236
28664
  return _context.abrupt("return", ret);
29237
- case 30:
28665
+ case 26:
29238
28666
  case "end":
29239
28667
  return _context.stop();
29240
28668
  }
29241
28669
  }, _callee, this);
29242
28670
  }));
29243
- function getSummaryItems(_x, _x2, _x3) {
28671
+ function getSummaryItems(_x, _x2) {
29244
28672
  return _getSummaryItems.apply(this, arguments);
29245
28673
  }
29246
28674
  return getSummaryItems;
@@ -29344,69 +28772,15 @@ var SummaryHandler = /*#__PURE__*/function () {
29344
28772
  }
29345
28773
  return ret;
29346
28774
  }
29347
- }, {
29348
- key: "getArticlesForSummary",
29349
- value: function getArticlesForSummary(sets) {
29350
- var ret = {};
29351
- for (var setId in sets) {
29352
- var set = sets[setId];
29353
- var articles = set.getDivaArticles();
29354
- for (var basketId in articles) {
29355
- var article = articles[basketId];
29356
- if (!article.curProduct) {
29357
- var _key9 = article.catalogCodex + '_' + article.articleCodex + '_' + article.articleVariantDesc();
29358
- if (ret[_key9]) {
29359
- var _ret$_key9$targetArti;
29360
- ret[_key9].quantity = ret[_key9].quantity + article.quantity;
29361
- ret[_key9].targetBasketIds.push(article.basketId);
29362
- (_ret$_key9$targetArti = ret[_key9].targetArticlePosNrs) === null || _ret$_key9$targetArti === void 0 || _ret$_key9$targetArti.push(article.posNr);
29363
- } else {
29364
- ret[_key9] = {
29365
- setId: setId,
29366
- title: article.name,
29367
- title_locales: article.name_locales,
29368
- description: article.actSizeText,
29369
- isDefined: true,
29370
- price: article.price,
29371
- quantity: article.quantity,
29372
- codex: article.articleCodex,
29373
- targetBasketIds: [article.basketId],
29374
- posNr: Object.keys(ret).length,
29375
- image: article.imageUrl,
29376
- targetArticlePosNrs: [article.posNr]
29377
- };
29378
- }
29379
- }
29380
- }
29381
- }
29382
- var curProducts = productHandlerInstance.getCurrentProducts();
29383
- for (var _key10 in curProducts) {
29384
- var product = productHandlerInstance.getProductById(_key10);
29385
- ret[_key10] = {
29386
- setId: 'PRODUCTS',
29387
- title: product.shortDescription,
29388
- description: '',
29389
- isDefined: true,
29390
- price: product.price,
29391
- quantity: curProducts[_key10],
29392
- codex: product.productId,
29393
- targetBasketIds: [],
29394
- posNr: Object.keys(ret).length,
29395
- image: product.image,
29396
- targetArticlePosNrs: []
29397
- };
29398
- }
29399
- return ret;
29400
- }
29401
28775
  }, {
29402
28776
  key: "getSummaryItemsOfAllSets",
29403
28777
  value: function getSummaryItemsOfAllSets(sets, set) {
29404
28778
  var summaryItemsOfAllSets = {};
29405
- for (var _key11 in sets) {
29406
- var _set = sets[_key11];
28779
+ for (var _key9 in sets) {
28780
+ var _set = sets[_key9];
29407
28781
  var articlePosNrs = this.getArticlesPosNr(_set.getDivaArticles(true));
29408
28782
  var summaryItems = this.buildSummaryItems(articlePosNrs, _set);
29409
- summaryItemsOfAllSets[_key11] = {
28783
+ summaryItemsOfAllSets[_key9] = {
29410
28784
  setName: _set.CatalogData.catalogName,
29411
28785
  setPrice: _set.getSetPrice(),
29412
28786
  summaryItems: summaryItems
@@ -29420,10 +28794,10 @@ var SummaryHandler = /*#__PURE__*/function () {
29420
28794
  var groupedArticles = setHandlerInstance.getDockedGroupedArticles(set);
29421
28795
  var retGroups = {};
29422
28796
  var articlesCodexesOnIndex = {};
29423
- for (var _key12 in groupedArticles) {
29424
- var basketId = groupedArticles[_key12][Object.keys(groupedArticles[_key12])[0]].basketId;
28797
+ for (var _key10 in groupedArticles) {
28798
+ var basketId = groupedArticles[_key10][Object.keys(groupedArticles[_key10])[0]].basketId;
29425
28799
  retGroups[basketId] = {
29426
- articles: groupedArticles[_key12],
28800
+ articles: groupedArticles[_key10],
29427
28801
  quantity: 1
29428
28802
  };
29429
28803
  }
@@ -29438,12 +28812,12 @@ var SummaryHandler = /*#__PURE__*/function () {
29438
28812
  articlesCodexesOnIndex[articleCodex].push(i);
29439
28813
  }
29440
28814
  }
29441
- for (var _key13 in articlesCodexesOnIndex) {
29442
- if (articlesCodexesOnIndex[_key13].length > 1) {
28815
+ for (var _key11 in articlesCodexesOnIndex) {
28816
+ if (articlesCodexesOnIndex[_key11].length > 1) {
29443
28817
  //group the single groups by the aricleCodex
29444
28818
  var articles = [];
29445
- for (var _i4 = 0; _i4 < articlesCodexesOnIndex[_key13].length; _i4++) {
29446
- var _group = groupedArticles[articlesCodexesOnIndex[_key13][_i4]];
28819
+ for (var _i4 = 0; _i4 < articlesCodexesOnIndex[_key11].length; _i4++) {
28820
+ var _group = groupedArticles[articlesCodexesOnIndex[_key11][_i4]];
29447
28821
  articles.push({
29448
28822
  article: _group[Object.keys(_group)[0]]
29449
28823
  });
@@ -29499,12 +28873,12 @@ var SummaryHandler = /*#__PURE__*/function () {
29499
28873
  }
29500
28874
 
29501
28875
  //old logic TODO: Delete in 2024
29502
- if (Object.keys(tabGroups).length === 0) for (var _key14 in article.articleOptionStates) {
29503
- var _ops = article.articleOptionStates[_key14];
28876
+ if (Object.keys(tabGroups).length === 0) for (var _key12 in article.articleOptionStates) {
28877
+ var _ops = article.articleOptionStates[_key12];
29504
28878
  if (!_ops.isInvisible && (_ops.selectionmode != 0 || (_ops.visibleCount > 1 || _ops.isFreeText) && article.set.api.showSelectionModeZero()) && _ops.isDoShow && _ops.valCodex != 'OPVNR') {
29505
28879
  var tabGroup = _ops.option.addOptionToTabgroupInPartlistSummary;
29506
28880
  if (tabGroup) tabGroups.push({
29507
- optionCodex: _key14,
28881
+ optionCodex: _key12,
29508
28882
  tabGroup: tabGroup
29509
28883
  });
29510
28884
  }
@@ -29539,8 +28913,8 @@ var SummaryHandler = /*#__PURE__*/function () {
29539
28913
  }
29540
28914
 
29541
28915
  //old logic TODO: Delete in 2024
29542
- for (var _key15 in article.articleOptionStates) {
29543
- var _optionState = article.articleOptionStates[_key15];
28916
+ for (var _key13 in article.articleOptionStates) {
28917
+ var _optionState = article.articleOptionStates[_key13];
29544
28918
  if (_optionState.option.addOptionToTabgroupInPartlistSummary == tabGroup && !_optionState.isInvisible && _optionState.isDoShow && _optionState.visibleCount > 0 && _optionState.valCodex != 'OPVNR') {
29545
28919
  opss.push(_optionState);
29546
28920
  }
@@ -29704,7 +29078,7 @@ var SummaryHandler = /*#__PURE__*/function () {
29704
29078
  }
29705
29079
  }, _callee3);
29706
29080
  }));
29707
- function getVariantsSummary(_x4, _x5) {
29081
+ function getVariantsSummary(_x3, _x4) {
29708
29082
  return _getVariantsSummary.apply(this, arguments);
29709
29083
  }
29710
29084
  return getVariantsSummary;
@@ -29732,8 +29106,8 @@ var SummaryHandler = /*#__PURE__*/function () {
29732
29106
  key: "getArticlesPrice",
29733
29107
  value: function getArticlesPrice(articles) {
29734
29108
  var price = 0;
29735
- for (var _key16 in articles) {
29736
- price = price + articles[_key16].price * articles[_key16].quantity;
29109
+ for (var _key14 in articles) {
29110
+ price = price + articles[_key14].price * articles[_key14].quantity;
29737
29111
  }
29738
29112
  return price;
29739
29113
  }
@@ -29753,10 +29127,11 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29753
29127
  return _createClass__default["default"](DivaFavoritesHandler, [{
29754
29128
  key: "initSet",
29755
29129
  value: function initSet(set, orderSet) {
29756
- var _orderSet$ConfigVaria;
29130
+ var _orderSet$TinyVariant;
29757
29131
  set.favorites = orderSet !== null && orderSet !== void 0 && orderSet.Favorites ? orderSet.Favorites : new basketModel.Favorites();
29758
- if ((_orderSet$ConfigVaria = orderSet.ConfigVariants) !== null && _orderSet$ConfigVaria !== void 0 && _orderSet$ConfigVaria.length) {
29759
- set.oldConfigVariants = _toConsumableArray__default["default"](orderSet.ConfigVariants);
29132
+ if ((_orderSet$TinyVariant = orderSet.TinyVariantConfiguration) !== null && _orderSet$TinyVariant !== void 0 && _orderSet$TinyVariant.length) {
29133
+ var _orderSet$TinyVariant2;
29134
+ set.oldConfigVariants = _toConsumableArray__default["default"]((_orderSet$TinyVariant2 = orderSet.TinyVariantConfiguration) !== null && _orderSet$TinyVariant2 !== void 0 ? _orderSet$TinyVariant2 : []);
29760
29135
  }
29761
29136
  set.disabledVariants = [];
29762
29137
  }
@@ -29976,8 +29351,9 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29976
29351
  if (!((_set$oldConfigVariant = set.oldConfigVariants) !== null && _set$oldConfigVariant !== void 0 && _set$oldConfigVariant.length)) return 0;
29977
29352
  var highestId = 0;
29978
29353
  for (var i = 0; i < set.oldConfigVariants.length; i++) {
29979
- if (highestId < set.oldConfigVariants[i].VariantID) {
29980
- highestId = set.oldConfigVariants[i].VariantID;
29354
+ var variant = set.oldConfigVariants[i];
29355
+ if (variant.VariantID && highestId < variant.VariantID) {
29356
+ highestId = variant.VariantID;
29981
29357
  }
29982
29358
  }
29983
29359
  return highestId + 1;
@@ -29990,15 +29366,17 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29990
29366
  for (var i = 0; i < set.oldConfigVariants.length; i++) {
29991
29367
  var oldConfigVariant = set.oldConfigVariants[i];
29992
29368
  var tryNext = false;
29993
- for (var basketId in variant.targetArticles) {
29369
+ var _loop2 = function _loop2(basketId) {
29994
29370
  var articleNew = variant.targetArticles[basketId];
29995
- var articleOld = oldConfigVariant.SetVariantData[basketId];
29371
+ var articleOld = oldConfigVariant.OrderSets[0].OrderLines.find(function (ol) {
29372
+ return ol.BasketID == basketId;
29373
+ });
29996
29374
  if (!articleOld) {
29997
29375
  tryNext = true;
29998
- continue;
29376
+ return 1; // continue
29999
29377
  }
30000
- var _loop2 = function _loop2(opt) {
30001
- var option = articleOld.VariantValues.find(function (v) {
29378
+ var _loop3 = function _loop3(opt) {
29379
+ var option = articleOld.VariantBasketDatas.find(function (v) {
30002
29380
  return 'OPT' + v.OPT == opt;
30003
29381
  });
30004
29382
  if (!option) {
@@ -30012,9 +29390,12 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
30012
29390
  },
30013
29391
  _ret;
30014
29392
  for (var opt in articleNew) {
30015
- _ret = _loop2(opt);
29393
+ _ret = _loop3(opt);
30016
29394
  if (_ret === 0) continue;
30017
29395
  }
29396
+ };
29397
+ for (var basketId in variant.targetArticles) {
29398
+ if (_loop2(basketId)) continue;
30018
29399
  }
30019
29400
  if (tryNext) continue;
30020
29401
  return oldConfigVariant.VariantID;
@@ -30059,7 +29440,7 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
30059
29440
  var optionValue = set.CatalogData.getOptionValue(opvs[i]);
30060
29441
  var optionValueName = optionValue === null || optionValue === void 0 ? void 0 : optionValue.name;
30061
29442
  var optionValueImage = optionValue === null || optionValue === void 0 ? void 0 : optionValue.image;
30062
- favorit = new basketModel.Favorit(opt, opvs[i], targetArticles, optionName, optionValueName, optionValueImage);
29443
+ favorit = new basketModel.Favorite(opt, opvs[i], targetArticles, optionName, optionValueName, optionValueImage);
30063
29444
  this.setFavorites(set, opt, opvs[i], favorit, remove);
30064
29445
  }
30065
29446
  set.disabledVariants = [];
@@ -30455,14 +29836,28 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
30455
29836
  var optionsMatching = {};
30456
29837
  for (var basketId in variant.targetArticles) {
30457
29838
  var articleVariantValues = variant.targetArticles[basketId];
29839
+ var _loop4 = function _loop4(opt) {
29840
+ var _articleWithOption$Va;
29841
+ if (optionsMatching[opt]) return 0; // continue
29842
+ var articleWithOption = oldConfig.OrderSets[0].OrderLines.find(function (ol) {
29843
+ return ol.VariantBasketDatas.find(function (v) {
29844
+ return 'OPT' + v.OPT === opt;
29845
+ });
29846
+ });
29847
+ if ('OPV' + (articleWithOption === null || articleWithOption === void 0 || (_articleWithOption$Va = articleWithOption.VariantBasketDatas.find(function (v) {
29848
+ return 'OPT' + v.OPT === opt;
29849
+ })) === null || _articleWithOption$Va === void 0 ? void 0 : _articleWithOption$Va.OPV) == articleVariantValues[opt]) {
29850
+ optionsMatching[opt] = true;
29851
+ } else {
29852
+ tryNext = true;
29853
+ return 1; // break
29854
+ }
29855
+ },
29856
+ _ret2;
30458
29857
  for (var opt in articleVariantValues) {
30459
- if (optionsMatching[opt]) continue;
30460
- if (oldConfig.Variant[opt] == articleVariantValues[opt]) {
30461
- optionsMatching[opt] = true;
30462
- } else {
30463
- tryNext = true;
30464
- break;
30465
- }
29858
+ _ret2 = _loop4(opt);
29859
+ if (_ret2 === 0) continue;
29860
+ if (_ret2 === 1) break;
30466
29861
  }
30467
29862
  if (tryNext) break;
30468
29863
  }
@@ -31294,6 +30689,53 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
31294
30689
  }();
31295
30690
  var configTreeHandler = new DivaConfigTreeHandler();
31296
30691
 
30692
+ //Diese Klasse verwaltet Productlogiken
30693
+ var DivaProductHandler = /*#__PURE__*/function () {
30694
+ function DivaProductHandler() {
30695
+ _classCallCheck__default["default"](this, DivaProductHandler);
30696
+ }
30697
+ return _createClass__default["default"](DivaProductHandler, [{
30698
+ key: "getPrice",
30699
+ value: function getPrice() {
30700
+ var price = 0;
30701
+ return price;
30702
+ }
30703
+ }, {
30704
+ key: "updateProducts",
30705
+ value: function () {
30706
+ var _updateProducts = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(sets, api, from) {
30707
+ return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
30708
+ while (1) switch (_context.prev = _context.next) {
30709
+ case 0:
30710
+ ({
30711
+ catalogs: sets.map(function (set) {
30712
+ return {
30713
+ articles: Object.values(set.getDivaArticles()).map(function (article) {
30714
+ return {
30715
+ codex: article.articleCodex,
30716
+ hash: article.articleProductHash
30717
+ };
30718
+ }),
30719
+ catalogGuid: set.CatalogData.catalogGuid
30720
+ };
30721
+ })
30722
+ });
30723
+ return _context.abrupt("return");
30724
+ case 2:
30725
+ case "end":
30726
+ return _context.stop();
30727
+ }
30728
+ }, _callee);
30729
+ }));
30730
+ function updateProducts(_x, _x2, _x3) {
30731
+ return _updateProducts.apply(this, arguments);
30732
+ }
30733
+ return updateProducts;
30734
+ }()
30735
+ }]);
30736
+ }();
30737
+ var productHandlerInstance = new DivaProductHandler();
30738
+
31297
30739
  function ownKeys$8(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; }
31298
30740
  function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31299
30741
  var LOG$8 = DivaUtils__default["default"].initLog('Planner', 'DIVA-SET-HANDLER');
@@ -31342,11 +30784,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
31342
30784
  _context.next = 12;
31343
30785
  return set.plannerHandler.initSet(set, catalogData, undefined);
31344
30786
  case 12:
31345
- _context.next = 14;
31346
- return productHandlerInstance.updateProducts(set, 'onAdd');
31347
- case 14:
31348
30787
  return _context.abrupt("return", set);
31349
- case 15:
30788
+ case 13:
31350
30789
  case "end":
31351
30790
  return _context.stop();
31352
30791
  }
@@ -31403,7 +30842,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
31403
30842
  PosNr: orderline.PosNr,
31404
30843
  VariantValues: variantValues,
31405
30844
  VariantItemData: orderline.VariantBasketDatas,
31406
- ShelfPlanData: orderline.ShelfPlandata,
30845
+ ShelfPlandata: orderline.ShelfPlandata,
31407
30846
  elementId: (_orderline$ElementID = orderline.ElementID) !== null && _orderline$ElementID !== void 0 ? _orderline$ElementID : elements === null || elements === void 0 || (_elements$find = elements.find(function (element) {
31408
30847
  return element.basketID == orderline.BasketID;
31409
30848
  })) === null || _elements$find === void 0 ? void 0 : _elements$find.elementID
@@ -32130,19 +31569,12 @@ var DivaSetHandler = /*#__PURE__*/function () {
32130
31569
  _context13.next = 16;
32131
31570
  return articleHandlerInstance.toDoAfterArticleLoaded(newArticle, defaultHeaderValues, {}, from, undefined, ignorePlanner);
32132
31571
  case 16:
32133
- if (!(from === 'initializing')) {
32134
- _context13.next = 19;
32135
- break;
32136
- }
32137
- _context13.next = 19;
32138
- return productHandlerInstance.updateProducts(set, 'onAdd');
32139
- case 19:
32140
31572
  LOG$8.successTransaction('ON_PLAN_ARTICLE', {
32141
31573
  art: articleCodex,
32142
31574
  artName: newArticle.name
32143
31575
  });
32144
31576
  return _context13.abrupt("return", newArticle);
32145
- case 21:
31577
+ case 18:
32146
31578
  case "end":
32147
31579
  return _context13.stop();
32148
31580
  }
@@ -32275,7 +31707,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32275
31707
  key: "deleteElementFromSet",
32276
31708
  value: function () {
32277
31709
  var _deleteElementFromSet = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee14(set, article, autoCorrectAVL_AVR, deletionType, dontReload) {
32278
- var _deletedArticle$doorP, _set$CatalogData, _deletedArticle$curPr;
31710
+ var _deletedArticle$doorP, _set$CatalogData;
32279
31711
  var setId, deletedArticle, articles, key, newSelectedElement, oldTransform, result, _set$getArticleByBask3, elementDeleted;
32280
31712
  return _regeneratorRuntime__default["default"].wrap(function _callee14$(_context16) {
32281
31713
  while (1) switch (_context16.prev = _context16.next) {
@@ -32335,20 +31767,13 @@ var DivaSetHandler = /*#__PURE__*/function () {
32335
31767
  _context16.next = 27;
32336
31768
  return this.updateArticlesOptionStatesOfActSet(set, {}, []);
32337
31769
  case 27:
32338
- if (dontReload) {
32339
- _context16.next = 30;
32340
- break;
32341
- }
32342
- _context16.next = 30;
32343
- return productHandlerInstance.updateProducts(set, 'onDelete', deletedArticle === null || deletedArticle === void 0 || (_deletedArticle$curPr = deletedArticle.curProduct) === null || _deletedArticle$curPr === void 0 ? void 0 : _deletedArticle$curPr.productId);
32344
- case 30:
32345
31770
  return _context16.abrupt("return", {
32346
31771
  success: elementDeleted,
32347
31772
  selectElementId: newSelectedElement,
32348
31773
  setId: setId,
32349
31774
  oldTransform: oldTransform
32350
31775
  });
32351
- case 31:
31776
+ case 28:
32352
31777
  case "end":
32353
31778
  return _context16.stop();
32354
31779
  }
@@ -33130,8 +32555,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
33130
32555
  key: "variantsEvaluator",
33131
32556
  value: (function () {
33132
32557
  var _variantsEvaluator = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee23(set, configItems, configStepKey, paletteType) {
33133
- var _set$WebConfig, _set$ViewConfig, _configItems$;
33134
- var opt, checkForProductsInStock, calcVariantsForPricePreview, previewType, _set$CatalogData$show, targetArticles, startTime, variants, endTime;
32558
+ var _set$ViewConfig, _configItems$;
32559
+ var opt, calcVariantsForPricePreview, previewType, _set$CatalogData$show, targetArticles, startTime, variants, endTime;
33135
32560
  return _regeneratorRuntime__default["default"].wrap(function _callee23$(_context25) {
33136
32561
  while (1) switch (_context25.prev = _context25.next) {
33137
32562
  case 0:
@@ -33142,7 +32567,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
33142
32567
  }
33143
32568
  return _context25.abrupt("return", configItems);
33144
32569
  case 3:
33145
- checkForProductsInStock = ((_set$WebConfig = set.WebConfig) === null || _set$WebConfig === void 0 ? void 0 : _set$WebConfig.checkForProductsInStock) && !(opt !== null && opt !== void 0 && opt.isDescribingState);
33146
32570
  calcVariantsForPricePreview = false;
33147
32571
  previewType = (_set$ViewConfig = set.ViewConfig) === null || _set$ViewConfig === void 0 ? void 0 : _set$ViewConfig.pricePreview;
33148
32572
  if (previewType) {
@@ -33152,27 +32576,24 @@ var DivaSetHandler = /*#__PURE__*/function () {
33152
32576
  if (paletteType == 'GAL' && ((_configItems$ = configItems[0]) === null || _configItems$ === void 0 ? void 0 : _configItems$.groupName) === undefined || paletteType == 'TEXTBOX' || paletteType == 'NUMBERBOX' || paletteType == 'RANGE') {
33153
32577
  calcVariantsForPricePreview = false;
33154
32578
  }
33155
- if (!(checkForProductsInStock || calcVariantsForPricePreview)) {
33156
- _context25.next = 19;
32579
+ if (!calcVariantsForPricePreview) {
32580
+ _context25.next = 17;
33157
32581
  break;
33158
32582
  }
33159
32583
  targetArticles = set.configTree.getTargetArticles(configStepKey);
33160
32584
  startTime = new Date();
33161
- _context25.next = 14;
32585
+ _context25.next = 13;
33162
32586
  return this.calcVariants(set, configItems, targetArticles);
33163
- case 14:
32587
+ case 13:
33164
32588
  variants = _context25.sent;
33165
32589
  endTime = new Date();
33166
32590
  if (endTime.getTime() - startTime.getTime() > 1000) set.dontCalcPricePreviewDueToPerformanceIssues = true;
33167
32591
  if (previewType) {
33168
32592
  this.calcPricePreview(set, configItems, variants);
33169
32593
  }
33170
- if (checkForProductsInStock) {
33171
- configItems = productHandlerInstance.checkProductInStock(configItems, variants, set.getDivaArticles(), targetArticles);
33172
- }
33173
- case 19:
32594
+ case 17:
33174
32595
  return _context25.abrupt("return", configItems);
33175
- case 20:
32596
+ case 18:
33176
32597
  case "end":
33177
32598
  return _context25.stop();
33178
32599
  }
@@ -33346,29 +32767,22 @@ var DivaSetHandler = /*#__PURE__*/function () {
33346
32767
  _context27.next = 19;
33347
32768
  return this.updateEdoArticles(set, retValues.newEDOExtraArticles);
33348
32769
  case 19:
33349
- if (!(from == 'FromViewClick')) {
33350
- _context27.next = 22;
33351
- break;
33352
- }
33353
- _context27.next = 22;
33354
- return productHandlerInstance.updateProducts(set, 'onConfig');
33355
- case 22:
33356
32770
  if (set.CatalogData.hasAlternateRenderings) set.CatalogData.updateAlternativeRenderings(set.getDivaArticles());
33357
32771
 
33358
32772
  //Update Planner - check if planner data changed
33359
32773
  if (!(!ignorePlanner && from != 'calcVariant')) {
33360
- _context27.next = 51;
32774
+ _context27.next = 48;
33361
32775
  break;
33362
32776
  }
33363
32777
  targetElementIds = this.getElementIdsOfArticles(set, targetArticlesWithNewValues);
33364
- _context27.next = 27;
32778
+ _context27.next = 24;
33365
32779
  return set.plannerHandler.updatePlanner(set.getSetId(), myValues, targetElementIds);
33366
- case 27:
32780
+ case 24:
33367
32781
  resultPlannerUpdate = _context27.sent;
33368
32782
  i = 0;
33369
- case 29:
32783
+ case 26:
33370
32784
  if (!(i < resultPlannerUpdate.elemIdsToDelete.length)) {
33371
- _context27.next = 38;
32785
+ _context27.next = 35;
33372
32786
  break;
33373
32787
  }
33374
32788
  articleToDel = set.getArticleByElementId(resultPlannerUpdate.elemIdsToDelete[i]);
@@ -33376,43 +32790,43 @@ var DivaSetHandler = /*#__PURE__*/function () {
33376
32790
  if (index > -1) {
33377
32791
  targetArticlesWithNewValues.splice(index, 1);
33378
32792
  }
33379
- _context27.next = 35;
32793
+ _context27.next = 32;
33380
32794
  return this.deleteElementFromSetByElemId(set, resultPlannerUpdate.elemIdsToDelete[i], false, resultPlannerUpdate.deletionType);
33381
- case 35:
32795
+ case 32:
33382
32796
  i++;
33383
- _context27.next = 29;
32797
+ _context27.next = 26;
33384
32798
  break;
33385
- case 38:
32799
+ case 35:
33386
32800
  if (!(resultPlannerUpdate.elementIdToCopy && resultPlannerUpdate.elementIdToCopy.length > 0)) {
33387
- _context27.next = 51;
32801
+ _context27.next = 48;
33388
32802
  break;
33389
32803
  }
33390
32804
  //Todo copy these elements
33391
32805
  articleCopyRelation = new Map();
33392
32806
  i = 0;
33393
- case 41:
32807
+ case 38:
33394
32808
  if (!(i < resultPlannerUpdate.elementIdToCopy.length)) {
33395
- _context27.next = 49;
32809
+ _context27.next = 46;
33396
32810
  break;
33397
32811
  }
33398
- _context27.next = 44;
32812
+ _context27.next = 41;
33399
32813
  return this.copyArticleByElementId(set, resultPlannerUpdate.elementIdToCopy[i], resultPlannerUpdate.ignoreOptionsToCopy);
33400
- case 44:
32814
+ case 41:
33401
32815
  newArticle = _context27.sent;
33402
32816
  articleCopyRelation.set(resultPlannerUpdate.elementIdToCopy[i], newArticle.basketId);
33403
- case 46:
32817
+ case 43:
33404
32818
  i++;
33405
- _context27.next = 41;
32819
+ _context27.next = 38;
33406
32820
  break;
33407
- case 49:
33408
- _context27.next = 51;
32821
+ case 46:
32822
+ _context27.next = 48;
33409
32823
  return set.plannerHandler.copyPlannerElements(set.getSetId(), articleCopyRelation, {
33410
32824
  dpType: resultPlannerUpdate.copyDPType ? resultPlannerUpdate.copyDPType : 'NO',
33411
32825
  copyType: resultPlannerUpdate.copyType,
33412
32826
  changedOPT: resultPlannerUpdate.changedOPT,
33413
32827
  targetElements: resultPlannerUpdate.targetElements
33414
32828
  });
33415
- case 51:
32829
+ case 48:
33416
32830
  this.updatePosNrOfAccessoiresOfTargetArticles(set, targetArticlesWithNewValues);
33417
32831
  if (from == 'FromViewClick' && (_Object$keys = Object.keys(myValues)) !== null && _Object$keys !== void 0 && _Object$keys.length) {
33418
32832
  this.confirmOptionsInMetric(set, [Object.keys(myValues)[0]], 'onSelectConfig');
@@ -33422,7 +32836,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33422
32836
  elementIdsToUpdateSelection: (_resultPlannerUpdate = resultPlannerUpdate) === null || _resultPlannerUpdate === void 0 ? void 0 : _resultPlannerUpdate.elementIdsToUpdateSelection,
33423
32837
  setId: set.getSetId()
33424
32838
  });
33425
- case 54:
32839
+ case 51:
33426
32840
  case "end":
33427
32841
  return _context27.stop();
33428
32842
  }
@@ -33568,7 +32982,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33568
32982
  articleHandlerInstance.defineAllOptionsOfArticles(articles);
33569
32983
  } else if (key === set.getSetId()) {
33570
32984
  for (var _key in basketIdsOnOptions) {
33571
- articlesAndOptions[_key] = {
32985
+ if (articles[_key]) articlesAndOptions[_key] = {
33572
32986
  article: articles[_key],
33573
32987
  options: basketIdsOnOptions[_key]
33574
32988
  };
@@ -33719,7 +33133,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33719
33133
  value: function getTotalPrice(sets) {
33720
33134
  var _this$actSet;
33721
33135
  var price = 0;
33722
- if ((_this$actSet = this.actSet(sets)) !== null && _this$actSet !== void 0 && (_this$actSet = _this$actSet.WebConfig) !== null && _this$actSet !== void 0 && _this$actSet.checkForProductsInStock) {
33136
+ if ((_this$actSet = this.actSet(sets)) !== null && _this$actSet !== void 0 && (_this$actSet = _this$actSet.WebConfig) !== null && _this$actSet !== void 0 && _this$actSet.checkForProductsPrice && productHandlerInstance.getPrice()) {
33723
33137
  return productHandlerInstance.getPrice();
33724
33138
  }
33725
33139
  for (var key in sets) {
@@ -33733,7 +33147,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33733
33147
  var _this$actSet2;
33734
33148
  var price = 0;
33735
33149
  var bruttoActive = false;
33736
- if ((_this$actSet2 = this.actSet(sets)) !== null && _this$actSet2 !== void 0 && (_this$actSet2 = _this$actSet2.WebConfig) !== null && _this$actSet2 !== void 0 && _this$actSet2.checkForProductsInStock) {
33150
+ if ((_this$actSet2 = this.actSet(sets)) !== null && _this$actSet2 !== void 0 && (_this$actSet2 = _this$actSet2.WebConfig) !== null && _this$actSet2 !== void 0 && _this$actSet2.checkForProductsPrice && productHandlerInstance.getPrice()) {
33737
33151
  return productHandlerInstance.getPrice();
33738
33152
  }
33739
33153
  for (var key in sets) {
@@ -33760,7 +33174,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33760
33174
  key: "fillOrderLinesAndOrderSets",
33761
33175
  value: function () {
33762
33176
  var _fillOrderLinesAndOrderSets = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee28(sets, divaBasketHandler, repairOnly, setPlanner, returnTo) {
33763
- var _set$WebConfig2;
33177
+ var _set$WebConfig;
33764
33178
  var orderSets, basketData, set, setPosNr, price, key, _set$basketConfigVari, _OrderLinesOfActSet$, _set, catalogData, articles, orderLineInitInfos, newOrderSet, OrderLinesOfActSet, ret, _key2, i, _basketData$OrderSets, _basketData$SetPlanne, oderSetsIsInActPlanning, setId, j;
33765
33179
  return _regeneratorRuntime__default["default"].wrap(function _callee28$(_context30) {
33766
33180
  while (1) switch (_context30.prev = _context30.next) {
@@ -33770,7 +33184,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33770
33184
  set = this.actSet(sets); //ACHTUNG: Wenn man das nicht zuerst löscht, gibt es beim wiederholten basket Speichern doppelte Einträge
33771
33185
  basketData.setSAPOrderLines([]);
33772
33186
  setPosNr = 0;
33773
- if (set !== null && set !== void 0 && (_set$WebConfig2 = set.WebConfig) !== null && _set$WebConfig2 !== void 0 && _set$WebConfig2.checkForProductsPrice) {
33187
+ if (set !== null && set !== void 0 && (_set$WebConfig = set.WebConfig) !== null && _set$WebConfig !== void 0 && _set$WebConfig.checkForProductsPrice) {
33774
33188
  price = set.priceForActHash();
33775
33189
  if (!price) {
33776
33190
  basketData.OrigProductId = undefined;
@@ -33807,7 +33221,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33807
33221
  if (newOrderSet.SetImage == '' && (_OrderLinesOfActSet$ = OrderLinesOfActSet[0]) !== null && _OrderLinesOfActSet$ !== void 0 && _OrderLinesOfActSet$.Image && _set.PlannerMode == 'No') {
33808
33222
  newOrderSet.SetImage = OrderLinesOfActSet[0].Image.replace('_low', '');
33809
33223
  }
33810
- ret = divaBasketHandler.divaWWSHandler.getWWSData(basketData, _set, newOrderSet, OrderLinesOfActSet, productHandlerInstance.getCurrentProducts());
33224
+ ret = divaBasketHandler.divaWWSHandler.getWWSData(basketData, _set, newOrderSet, OrderLinesOfActSet);
33811
33225
  for (_key2 in ret) {
33812
33226
  if (_key2 == 'orderlines') {
33813
33227
  OrderLinesOfActSet = ret[_key2];
@@ -33911,8 +33325,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
33911
33325
  });
33912
33326
  if (origOrderSet) {
33913
33327
  origOrderSet.CatalogName = actOrderSet.CatalogName;
33328
+ origOrderSet.AccountName = actOrderSet.AccountName;
33329
+ origOrderSet.AccountLogo = actOrderSet.AccountLogo;
33914
33330
  origOrderSet.CatalogOfflineVersion = actOrderSet.CatalogOfflineVersion;
33915
33331
  origOrderSet.CatalogGUID = actOrderSet.CatalogGUID;
33332
+ origOrderSet.CollectionGUID = actOrderSet.CollectionGUID;
33916
33333
  origOrderSet.OrderLines = actOrderSet.OrderLines;
33917
33334
  origOrderSet.OrderSetDesc = actOrderSet.OrderSetDesc;
33918
33335
  origOrderSet.OrigZKATNr = actOrderSet.OrigZKATNr;
@@ -33925,11 +33342,14 @@ var DivaSetHandler = /*#__PURE__*/function () {
33925
33342
  origOrderSet.BBox = actOrderSet.BBox;
33926
33343
  origOrderSet.VariantDescription = actOrderSet.VariantDescription;
33927
33344
  if (actOrderSet.ConfigVariants && origOrderSet.ConfigVariants) origOrderSet.ConfigVariants = actOrderSet.ConfigVariants.map(function (variant, index) {
33345
+ var _origOrderSet$ConfigV;
33346
+ var configVariant = (_origOrderSet$ConfigV = origOrderSet.ConfigVariants) === null || _origOrderSet$ConfigV === void 0 ? void 0 : _origOrderSet$ConfigV[index];
33347
+ if (!configVariant) return variant;
33928
33348
  return _objectSpread$8(_objectSpread$8({}, variant), {}, {
33929
- SetImage: origOrderSet.ConfigVariants[index].SetImage,
33930
- HQRenderScript: origOrderSet.ConfigVariants[index].HQRenderScript,
33931
- Set2DImage: origOrderSet.ConfigVariants[index].Set2DImage,
33932
- Diva3DProject: origOrderSet.ConfigVariants[index].Diva3DProject
33349
+ SetImage: configVariant.SetImage,
33350
+ HQRenderScript: configVariant.HQRenderScript,
33351
+ Set2DImage: configVariant.Set2DImage,
33352
+ Diva3DProject: configVariant.Diva3DProject
33933
33353
  });
33934
33354
  });
33935
33355
  }
@@ -33938,7 +33358,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
33938
33358
  _loop7();
33939
33359
  }
33940
33360
  }
33941
-
33942
33361
  /**************************SpeicherRoutinen*************************************/
33943
33362
  }, {
33944
33363
  key: "isNoArticleToSave",
@@ -34022,7 +33441,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
34022
33441
  CatalogOfflineFilesLastUpdate: catalogData.offlineFilesLastUpdate,
34023
33442
  Description: catalogData.description,
34024
33443
  GroupType: GroupType,
34025
- MainPosNr: posNr,
34026
33444
  OfflineData: catalogData.offlineData,
34027
33445
  SetArticleNr: set.SetArticleNr ? set.SetArticleNr : catalogData.retailArticleNr,
34028
33446
  SetArticleNrPrefix: set.SetArticleNrPrefix,
@@ -34271,31 +33689,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
34271
33689
  Info: ((_set$api$getI18n$t = (_set$api$getI18n = set.api.getI18n()) === null || _set$api$getI18n === void 0 || (_set$api$getI18n$t2 = _set$api$getI18n.t) === null || _set$api$getI18n$t2 === void 0 ? void 0 : _set$api$getI18n$t2.call(_set$api$getI18n, 'utils.width_first_letter', 'B')) !== null && _set$api$getI18n$t !== void 0 ? _set$api$getI18n$t : 'B') + ': ' + dim.X + ' cm x ' + ((_set$api$getI18n$t3 = (_set$api$getI18n2 = set.api.getI18n()) === null || _set$api$getI18n2 === void 0 || (_set$api$getI18n2$t = _set$api$getI18n2.t) === null || _set$api$getI18n2$t === void 0 ? void 0 : _set$api$getI18n2$t.call(_set$api$getI18n2, 'utils.depth_first_letter', 'T')) !== null && _set$api$getI18n$t3 !== void 0 ? _set$api$getI18n$t3 : 'T') + ': ' + dim.Y + ' cm' + (dim.Z ? ' x ' + ((_set$api$getI18n$t4 = (_set$api$getI18n3 = set.api.getI18n()) === null || _set$api$getI18n3 === void 0 || (_set$api$getI18n3$t = _set$api$getI18n3.t) === null || _set$api$getI18n3$t === void 0 ? void 0 : _set$api$getI18n3$t.call(_set$api$getI18n3, 'utils.height_first_letter', 'H')) !== null && _set$api$getI18n$t4 !== void 0 ? _set$api$getI18n$t4 : 'H') + ': ' + dim.X + ' cm' : '')
34272
33690
  });
34273
33691
  }
34274
- }, {
34275
- key: "loadProductsOfSets",
34276
- value: function () {
34277
- var _loadProductsOfSets = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(orderSets, involvedSetIds) {
34278
- return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context36) {
34279
- while (1) switch (_context36.prev = _context36.next) {
34280
- case 0:
34281
- _context36.next = 2;
34282
- return productHandlerInstance.loadProductsOfSets(orderSets, involvedSetIds);
34283
- case 2:
34284
- case "end":
34285
- return _context36.stop();
34286
- }
34287
- }, _callee34);
34288
- }));
34289
- function loadProductsOfSets(_x113, _x114) {
34290
- return _loadProductsOfSets.apply(this, arguments);
34291
- }
34292
- return loadProductsOfSets;
34293
- }()
34294
- }, {
34295
- key: "addProducts",
34296
- value: function addProducts(variants, families) {
34297
- productHandlerInstance.addProducts(variants, families);
34298
- }
34299
33692
  }, {
34300
33693
  key: "getAllProducts",
34301
33694
  value: function getAllProducts(sets) {
@@ -34323,28 +33716,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
34323
33716
  }, {
34324
33717
  key: "addOrderSetArticlesToExistingSet",
34325
33718
  value: function () {
34326
- var _addOrderSetArticlesToExistingSet = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee35(set, orderSet, lastSetToInitialize) {
34327
- return _regeneratorRuntime__default["default"].wrap(function _callee35$(_context37) {
34328
- while (1) switch (_context37.prev = _context37.next) {
33719
+ var _addOrderSetArticlesToExistingSet = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(set, orderSet, lastSetToInitialize) {
33720
+ return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context36) {
33721
+ while (1) switch (_context36.prev = _context36.next) {
34329
33722
  case 0:
34330
33723
  //TODO: GLOBAL STUFF
34331
33724
  //this.updateActSet(set);
34332
33725
  orderSet.changeBasketIds();
34333
- _context37.next = 3;
33726
+ _context36.next = 3;
34334
33727
  return this.initOrderLineArticles(set, orderSet);
34335
33728
  case 3:
34336
- _context37.next = 5;
33729
+ _context36.next = 5;
34337
33730
  return set.plannerHandler.extendSet(set, orderSet.SetPlanData, lastSetToInitialize);
34338
33731
  case 5:
34339
- _context37.next = 7;
34340
- return productHandlerInstance.updateProducts(set, 'onAdd');
34341
- case 7:
34342
33732
  case "end":
34343
- return _context37.stop();
33733
+ return _context36.stop();
34344
33734
  }
34345
- }, _callee35, this);
33735
+ }, _callee34, this);
34346
33736
  }));
34347
- function addOrderSetArticlesToExistingSet(_x115, _x116, _x117) {
33737
+ function addOrderSetArticlesToExistingSet(_x113, _x114, _x115) {
34348
33738
  return _addOrderSetArticlesToExistingSet.apply(this, arguments);
34349
33739
  }
34350
33740
  return addOrderSetArticlesToExistingSet;
@@ -34669,21 +34059,29 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34669
34059
  }, {
34670
34060
  key: "initProductId",
34671
34061
  value: function () {
34672
- var _initProductId = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(api, productId, keepOldDivaNr) {
34062
+ var _initProductId = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(api, productId) {
34063
+ var result;
34673
34064
  return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
34674
34065
  while (1) switch (_context2.prev = _context2.next) {
34675
34066
  case 0:
34676
34067
  _context2.next = 2;
34677
- return this.loadProduct(api, productId, keepOldDivaNr);
34068
+ return this.getProduct(api, productId);
34678
34069
  case 2:
34070
+ result = _context2.sent;
34071
+ this.assignNewDivaNr = true;
34072
+ _context2.next = 6;
34073
+ return this.initBasket(api, result.divaNr, {
34074
+ basket: result.configuration
34075
+ }, false);
34076
+ case 6:
34679
34077
  return _context2.abrupt("return", _context2.sent);
34680
- case 3:
34078
+ case 7:
34681
34079
  case "end":
34682
34080
  return _context2.stop();
34683
34081
  }
34684
34082
  }, _callee2, this);
34685
34083
  }));
34686
- function initProductId(_x2, _x3, _x4) {
34084
+ function initProductId(_x2, _x3) {
34687
34085
  return _initProductId.apply(this, arguments);
34688
34086
  }
34689
34087
  return initProductId;
@@ -34729,7 +34127,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34729
34127
  }
34730
34128
  }, _callee3, this);
34731
34129
  }));
34732
- function tryInitFirstCatalog(_x5) {
34130
+ function tryInitFirstCatalog(_x4) {
34733
34131
  return _tryInitFirstCatalog.apply(this, arguments);
34734
34132
  }
34735
34133
  return tryInitFirstCatalog;
@@ -34764,7 +34162,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34764
34162
  }
34765
34163
  }, _callee4, this);
34766
34164
  }));
34767
- function createNewDivaNr(_x6) {
34165
+ function createNewDivaNr(_x5) {
34768
34166
  return _createNewDivaNr.apply(this, arguments);
34769
34167
  }
34770
34168
  return createNewDivaNr;
@@ -34794,7 +34192,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34794
34192
  } else {
34795
34193
  this.origConfiguration.originDivaNr = divaNr;
34796
34194
  }
34797
- if (this.plannerConfig.returnTo != 'REPAIR_BASKET' && basket.StatusKey == 'BASE_CONFIGURATION') {
34195
+ if (this.plannerConfig.returnTo != 'REPAIR_BASKET' && (basket.StatusKey == 'BASE_CONFIGURATION' || keepOldDivaNr === false)) {
34798
34196
  this.assignNewDivaNr = true;
34799
34197
  basket.CustomerJourneyId = DivaUtils.nanoid();
34800
34198
  basket.StatusKey = 'USER_CONFIGURATION';
@@ -34812,7 +34210,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34812
34210
  basket.OrderSets[i].SetID = newSetId;
34813
34211
  }
34814
34212
  }
34815
- if (!(this.assignNewDivaNr && !keepOldDivaNr)) {
34213
+ if (!this.assignNewDivaNr) {
34816
34214
  _context5.next = 29;
34817
34215
  break;
34818
34216
  }
@@ -34892,7 +34290,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34892
34290
  }
34893
34291
  }, _callee5, this);
34894
34292
  }));
34895
- function initBasket(_x7, _x8, _x9, _x10, _x11) {
34293
+ function initBasket(_x6, _x7, _x8, _x9, _x10) {
34896
34294
  return _initBasket.apply(this, arguments);
34897
34295
  }
34898
34296
  return initBasket;
@@ -34971,7 +34369,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34971
34369
  }
34972
34370
  }, _callee6, this);
34973
34371
  }));
34974
- function loadBasketByCatalogCodex(_x12) {
34372
+ function loadBasketByCatalogCodex(_x11) {
34975
34373
  return _loadBasketByCatalogCodex.apply(this, arguments);
34976
34374
  }
34977
34375
  return loadBasketByCatalogCodex;
@@ -34979,7 +34377,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34979
34377
  }, {
34980
34378
  key: "loadBasketByDivaNr",
34981
34379
  value: function () {
34982
- var _loadBasketByDivaNr = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee7(api, divaNr, keepOldDivaNr, origProductId) {
34380
+ var _loadBasketByDivaNr = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee7(api, divaNr) {
34983
34381
  var variantData;
34984
34382
  return _regeneratorRuntime__default["default"].wrap(function _callee7$(_context7) {
34985
34383
  while (1) switch (_context7.prev = _context7.next) {
@@ -34990,7 +34388,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34990
34388
  case 3:
34991
34389
  variantData = _context7.sent;
34992
34390
  _context7.next = 6;
34993
- return this.initBasket(api, divaNr, variantData, keepOldDivaNr, origProductId);
34391
+ return this.initBasket(api, divaNr, variantData);
34994
34392
  case 6:
34995
34393
  return _context7.abrupt("return", _context7.sent);
34996
34394
  case 9:
@@ -35009,7 +34407,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35009
34407
  }
35010
34408
  }, _callee7, this, [[0, 9]]);
35011
34409
  }));
35012
- function loadBasketByDivaNr(_x13, _x14, _x15, _x16) {
34410
+ function loadBasketByDivaNr(_x12, _x13) {
35013
34411
  return _loadBasketByDivaNr.apply(this, arguments);
35014
34412
  }
35015
34413
  return loadBasketByDivaNr;
@@ -35061,73 +34459,25 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35061
34459
  }
35062
34460
  }, _callee8, this, [[0, 12]]);
35063
34461
  }));
35064
- function loadBasketByCustomProductId(_x17, _x18, _x19, _x20) {
34462
+ function loadBasketByCustomProductId(_x14, _x15, _x16, _x17) {
35065
34463
  return _loadBasketByCustomProductId.apply(this, arguments);
35066
34464
  }
35067
34465
  return loadBasketByCustomProductId;
35068
34466
  }()
35069
34467
  }, {
35070
- key: "loadProduct",
34468
+ key: "getProduct",
35071
34469
  value: function () {
35072
- var _loadProduct = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee9(api, productId, keepOldDivaNr) {
35073
- var result, divaNr, id, successfully;
34470
+ var _getProduct = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee9(api, productId) {
34471
+ var result;
35074
34472
  return _regeneratorRuntime__default["default"].wrap(function _callee9$(_context9) {
35075
34473
  while (1) switch (_context9.prev = _context9.next) {
35076
34474
  case 0:
35077
34475
  _context9.next = 2;
35078
- return this.getProduct(api, productId);
35079
- case 2:
35080
- result = _context9.sent;
35081
- if (!(result === false)) {
35082
- _context9.next = 5;
35083
- break;
35084
- }
35085
- return _context9.abrupt("return", false);
35086
- case 5:
35087
- divaNr = result.divaNr;
35088
- if (result.originDivaNr) {
35089
- divaNr = result.originDivaNr;
35090
- } else if (result.variantId !== undefined) {
35091
- id = result.variantId;
35092
- divaNr = result.divaNr + '_' + id.toString().padStart(4, '0');
35093
- }
35094
- _context9.next = 9;
35095
- return this.loadBasketByDivaNr(api, divaNr, keepOldDivaNr, productId);
35096
- case 9:
35097
- successfully = _context9.sent;
35098
- result.type = 'ProductId';
35099
- if (!successfully) {
35100
- _context9.next = 15;
35101
- break;
35102
- }
35103
- return _context9.abrupt("return", result);
35104
- case 15:
35105
- return _context9.abrupt("return", false);
35106
- case 16:
35107
- case "end":
35108
- return _context9.stop();
35109
- }
35110
- }, _callee9, this);
35111
- }));
35112
- function loadProduct(_x21, _x22, _x23) {
35113
- return _loadProduct.apply(this, arguments);
35114
- }
35115
- return loadProduct;
35116
- }()
35117
- }, {
35118
- key: "getProduct",
35119
- value: function () {
35120
- var _getProduct = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10(api, productId) {
35121
- var result;
35122
- return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
35123
- while (1) switch (_context10.prev = _context10.next) {
35124
- case 0:
35125
- _context10.next = 2;
35126
34476
  return api.getDataCache(api.getProductUrl(productId), undefined, undefined, 'catalog');
35127
34477
  case 2:
35128
- result = _context10.sent;
34478
+ result = _context9.sent;
35129
34479
  if (!(result.Error || !result)) {
35130
- _context10.next = 6;
34480
+ _context9.next = 6;
35131
34481
  break;
35132
34482
  }
35133
34483
  LOG$7.error(new DivaUtils.DivaError('ProductId konnte in der Datenbank nicht gefunden werden', {
@@ -35136,16 +34486,16 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35136
34486
  productId: productId
35137
34487
  }
35138
34488
  }));
35139
- return _context10.abrupt("return", false);
34489
+ return _context9.abrupt("return", false);
35140
34490
  case 6:
35141
- return _context10.abrupt("return", result[0]);
34491
+ return _context9.abrupt("return", result[0]);
35142
34492
  case 7:
35143
34493
  case "end":
35144
- return _context10.stop();
34494
+ return _context9.stop();
35145
34495
  }
35146
- }, _callee10);
34496
+ }, _callee9);
35147
34497
  }));
35148
- function getProduct(_x24, _x25) {
34498
+ function getProduct(_x18, _x19) {
35149
34499
  return _getProduct.apply(this, arguments);
35150
34500
  }
35151
34501
  return getProduct;
@@ -35153,15 +34503,14 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35153
34503
  }, {
35154
34504
  key: "createNewBasket",
35155
34505
  value: function () {
35156
- var _createNewBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee11(api, initObject, divaNr, lang) {
34506
+ var _createNewBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10(api, initObject, divaNr, lang) {
35157
34507
  var setId, orderSet, basketInitObejct, basket;
35158
- return _regeneratorRuntime__default["default"].wrap(function _callee11$(_context11) {
35159
- while (1) switch (_context11.prev = _context11.next) {
34508
+ return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
34509
+ while (1) switch (_context10.prev = _context10.next) {
35160
34510
  case 0:
35161
34511
  setId = 'PLANNING_' + Math.random().toString(36).substring(6);
35162
34512
  orderSet = new basketModel.OrderSetData({
35163
34513
  SetID: setId,
35164
- MainPosNr: 1,
35165
34514
  AccountSessionGUID: initObject.accountSessionGuid,
35166
34515
  CatalogCodex: initObject.catalogCodex,
35167
34516
  CatalogGUID: initObject.catalogGuid,
@@ -35169,10 +34518,10 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35169
34518
  Favorites: new basketModel.Favorites()
35170
34519
  });
35171
34520
  if (!(initObject.accountGuid && !orderSet.AccountSessionGUID)) {
35172
- _context11.next = 5;
34521
+ _context10.next = 5;
35173
34522
  break;
35174
34523
  }
35175
- _context11.next = 5;
34524
+ _context10.next = 5;
35176
34525
  return api.setAccountSessionGuid({
35177
34526
  os: orderSet,
35178
34527
  accountGuid: initObject.accountGuid,
@@ -35190,14 +34539,14 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35190
34539
  CustomerJourneyId: DivaUtils.nanoid()
35191
34540
  };
35192
34541
  basket = new basketModel.BasketData(basketInitObejct);
35193
- return _context11.abrupt("return", basket);
34542
+ return _context10.abrupt("return", basket);
35194
34543
  case 8:
35195
34544
  case "end":
35196
- return _context11.stop();
34545
+ return _context10.stop();
35197
34546
  }
35198
- }, _callee11);
34547
+ }, _callee10);
35199
34548
  }));
35200
- function createNewBasket(_x26, _x27, _x28, _x29) {
34549
+ function createNewBasket(_x20, _x21, _x22, _x23) {
35201
34550
  return _createNewBasket.apply(this, arguments);
35202
34551
  }
35203
34552
  return createNewBasket;
@@ -35216,11 +34565,11 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35216
34565
  }, {
35217
34566
  key: "saveToBasket",
35218
34567
  value: function () {
35219
- var _saveToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee12(api, actBasket, returnTo) {
34568
+ var _saveToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee11(api, actBasket, returnTo) {
35220
34569
  var _this$plannerConfig$c4, _this$_basketHandler, _api$getJwt;
35221
34570
  var response;
35222
- return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context12) {
35223
- while (1) switch (_context12.prev = _context12.next) {
34571
+ return _regeneratorRuntime__default["default"].wrap(function _callee11$(_context11) {
34572
+ while (1) switch (_context11.prev = _context11.next) {
35224
34573
  case 0:
35225
34574
  LOG$7.startTransaction({
35226
34575
  event: 'SaveBasketOnAPI',
@@ -35232,12 +34581,12 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35232
34581
  actBasket.ReportConfigIdentifier = api.getReportConfigIdentifier();
35233
34582
  actBasket.PrintOptions = api.getPrintOptions(this.reportConfig);
35234
34583
  actBasket.ClientLanguage = api.getLanguage();
35235
- _context12.next = 8;
34584
+ _context11.next = 8;
35236
34585
  return DivaUtils__default["default"].updateBasketOrgInfo(actBasket, this.plannerConfig.currentOrganization, this.plannerConfig.currentUser, this.plannerConfig.settings.keepSalesPersonDataInBasket);
35237
34586
  case 8:
35238
34587
  actBasket.UserLanguage = api.getLanguage();
35239
34588
  actBasket.PrintRetailLogo = (_this$plannerConfig$c4 = this.plannerConfig.currentOrganization) === null || _this$plannerConfig$c4 === void 0 ? void 0 : _this$plannerConfig$c4.logoUrl;
35240
- _context12.next = 12;
34589
+ _context11.next = 12;
35241
34590
  return (_this$_basketHandler = this._basketHandler) === null || _this$_basketHandler === void 0 ? void 0 : _this$_basketHandler.saveBasket({
35242
34591
  jwt: (_api$getJwt = api.getJwt()) !== null && _api$getJwt !== void 0 ? _api$getJwt : undefined,
35243
34592
  basket: actBasket,
@@ -35246,30 +34595,30 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35246
34595
  apiKey: api.getApiKey()
35247
34596
  });
35248
34597
  case 12:
35249
- response = _context12.sent;
34598
+ response = _context11.sent;
35250
34599
  if (!(response != 'ERROR_NO_BASKET_SAVED')) {
35251
- _context12.next = 17;
34600
+ _context11.next = 17;
35252
34601
  break;
35253
34602
  }
35254
34603
  this.baskets[this.actDivaNr] = new basketModel.BasketData(response);
35255
- _context12.next = 19;
34604
+ _context11.next = 19;
35256
34605
  break;
35257
34606
  case 17:
35258
34607
  if (!(response === 'ERROR_NO_BASKET_SAVED' || response === 'ERROR_BASKET_AFTER_SAVE')) {
35259
- _context12.next = 19;
34608
+ _context11.next = 19;
35260
34609
  break;
35261
34610
  }
35262
- return _context12.abrupt("return", response);
34611
+ return _context11.abrupt("return", response);
35263
34612
  case 19:
35264
34613
  LOG$7.successTransaction('saveBasketOnAPI');
35265
- return _context12.abrupt("return", response === null || response === void 0 ? void 0 : response._id);
34614
+ return _context11.abrupt("return", response === null || response === void 0 ? void 0 : response._id);
35266
34615
  case 21:
35267
34616
  case "end":
35268
- return _context12.stop();
34617
+ return _context11.stop();
35269
34618
  }
35270
- }, _callee12, this);
34619
+ }, _callee11, this);
35271
34620
  }));
35272
- function saveToBasket(_x30, _x31, _x32) {
34621
+ function saveToBasket(_x24, _x25, _x26) {
35273
34622
  return _saveToBasket.apply(this, arguments);
35274
34623
  }
35275
34624
  return saveToBasket;
@@ -35382,61 +34731,53 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35382
34731
  }, {
35383
34732
  key: "initWWSClient",
35384
34733
  value: function () {
35385
- var _initWWSClient = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee13(wwsClient) {
35386
- var _yield$import, PfisterWWSHandler, _yield$import2, LiviqueWWSHandler, _yield$import3, SeriousWWSHandler, _yield$import4, ProductWWSHandler, _yield$import5, StandardWWSHandler;
35387
- return _regeneratorRuntime__default["default"].wrap(function _callee13$(_context13) {
35388
- while (1) switch (_context13.prev = _context13.next) {
34734
+ var _initWWSClient = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee12(wwsClient) {
34735
+ var _yield$import, PfisterWWSHandler, _yield$import2, LiviqueWWSHandler, _yield$import3, SeriousWWSHandler, _yield$import4, StandardWWSHandler;
34736
+ return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context12) {
34737
+ while (1) switch (_context12.prev = _context12.next) {
35389
34738
  case 0:
35390
- _context13.t0 = wwsClient;
35391
- _context13.next = _context13.t0 === 'Pfister' ? 3 : _context13.t0 === 'Livique' ? 9 : _context13.t0 === 'Serious' ? 15 : _context13.t0 === 'Product' ? 21 : 27;
34739
+ _context12.t0 = wwsClient;
34740
+ _context12.next = _context12.t0 === 'Pfister' ? 3 : _context12.t0 === 'Livique' ? 9 : _context12.t0 === 'Serious' ? 15 : 21;
35392
34741
  break;
35393
34742
  case 3:
35394
- _context13.next = 5;
35395
- return Promise.resolve().then(function () { return require('./PfisterWWSHandler-c542faae.js'); });
34743
+ _context12.next = 5;
34744
+ return Promise.resolve().then(function () { return require('./PfisterWWSHandler-57aec18d.js'); });
35396
34745
  case 5:
35397
- _yield$import = _context13.sent;
34746
+ _yield$import = _context12.sent;
35398
34747
  PfisterWWSHandler = _yield$import["default"];
35399
34748
  this._divaWWSHandler = new PfisterWWSHandler();
35400
- return _context13.abrupt("break", 33);
34749
+ return _context12.abrupt("break", 27);
35401
34750
  case 9:
35402
- _context13.next = 11;
35403
- return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-84f677cc.js'); });
34751
+ _context12.next = 11;
34752
+ return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-086d6c7f.js'); });
35404
34753
  case 11:
35405
- _yield$import2 = _context13.sent;
34754
+ _yield$import2 = _context12.sent;
35406
34755
  LiviqueWWSHandler = _yield$import2["default"];
35407
34756
  this._divaWWSHandler = new LiviqueWWSHandler();
35408
- return _context13.abrupt("break", 33);
34757
+ return _context12.abrupt("break", 27);
35409
34758
  case 15:
35410
- _context13.next = 17;
35411
- return Promise.resolve().then(function () { return require('./SeriousBasketHandler-cf892a55.js'); });
34759
+ _context12.next = 17;
34760
+ return Promise.resolve().then(function () { return require('./SeriousBasketHandler-f799c493.js'); });
35412
34761
  case 17:
35413
- _yield$import3 = _context13.sent;
34762
+ _yield$import3 = _context12.sent;
35414
34763
  SeriousWWSHandler = _yield$import3["default"];
35415
34764
  this._divaWWSHandler = new SeriousWWSHandler();
35416
- return _context13.abrupt("break", 33);
34765
+ return _context12.abrupt("break", 27);
35417
34766
  case 21:
35418
- _context13.next = 23;
35419
- return Promise.resolve().then(function () { return require('./ProductBasketHandler-8cfcadcd.js'); });
34767
+ _context12.next = 23;
34768
+ return Promise.resolve().then(function () { return require('./StandardWWSHandler-d4a1c639.js'); });
35420
34769
  case 23:
35421
- _yield$import4 = _context13.sent;
35422
- ProductWWSHandler = _yield$import4["default"];
35423
- this._divaWWSHandler = new ProductWWSHandler();
35424
- return _context13.abrupt("break", 33);
35425
- case 27:
35426
- _context13.next = 29;
35427
- return Promise.resolve().then(function () { return require('./StandardWWSHandler-c4d2c718.js'); });
35428
- case 29:
35429
- _yield$import5 = _context13.sent;
35430
- StandardWWSHandler = _yield$import5["default"];
34770
+ _yield$import4 = _context12.sent;
34771
+ StandardWWSHandler = _yield$import4["default"];
35431
34772
  this._divaWWSHandler = new StandardWWSHandler();
35432
- return _context13.abrupt("break", 33);
35433
- case 33:
34773
+ return _context12.abrupt("break", 27);
34774
+ case 27:
35434
34775
  case "end":
35435
- return _context13.stop();
34776
+ return _context12.stop();
35436
34777
  }
35437
- }, _callee13, this);
34778
+ }, _callee12, this);
35438
34779
  }));
35439
- function initWWSClient(_x33) {
34780
+ function initWWSClient(_x27) {
35440
34781
  return _initWWSClient.apply(this, arguments);
35441
34782
  }
35442
34783
  return initWWSClient;
@@ -36039,7 +35380,7 @@ var Rendering = /*#__PURE__*/function () {
36039
35380
  this.creationTime = new Date();
36040
35381
  this.layerMaskThreeTexture = undefined;
36041
35382
  this.hasStaticBackground = hasStaticBG;
36042
- this.mediaServiceSaveMode = mediaServiceSaveMode;
35383
+ this.mediaServiceSaveMode = mediaServiceSaveMode !== null && mediaServiceSaveMode !== void 0 ? mediaServiceSaveMode : 'STREAM';
36043
35384
  this.urlToSavedRendering = '';
36044
35385
  this.catalogData = {
36045
35386
  catalogCodex: '',
@@ -36084,12 +35425,12 @@ var Rendering = /*#__PURE__*/function () {
36084
35425
  }, {
36085
35426
  key: "getHasStaticBackground",
36086
35427
  value: function getHasStaticBackground() {
36087
- return this.hasStaticBackground;
35428
+ return !!this.hasStaticBackground;
36088
35429
  }
36089
35430
  }, {
36090
35431
  key: "getIsFullscreenRendering",
36091
35432
  value: function getIsFullscreenRendering() {
36092
- return this.isFullscreenRendering;
35433
+ return !!this.isFullscreenRendering;
36093
35434
  }
36094
35435
  }, {
36095
35436
  key: "setIsFullscreenRendering",
@@ -36099,12 +35440,13 @@ var Rendering = /*#__PURE__*/function () {
36099
35440
  }, {
36100
35441
  key: "getHasDimensionLines",
36101
35442
  value: function getHasDimensionLines() {
36102
- return this.hasDimensionLines;
35443
+ return !!this.hasDimensionLines;
36103
35444
  }
36104
35445
  }, {
36105
35446
  key: "getPlannerMeasureDigits",
36106
35447
  value: function getPlannerMeasureDigits() {
36107
- return this.plannerMeasureDigits;
35448
+ var _this$plannerMeasureD;
35449
+ return (_this$plannerMeasureD = this.plannerMeasureDigits) !== null && _this$plannerMeasureD !== void 0 ? _this$plannerMeasureD : 0;
36108
35450
  }
36109
35451
  }, {
36110
35452
  key: "getIsAlternateRendering",
@@ -36355,7 +35697,7 @@ var Rendering = /*#__PURE__*/function () {
36355
35697
  }, {
36356
35698
  key: "HasLayerMask",
36357
35699
  get: function get() {
36358
- return this.hasLayerMask;
35700
+ return !!this.hasLayerMask;
36359
35701
  },
36360
35702
  set: function set(hasLayerMask) {
36361
35703
  this.hasLayerMask = hasLayerMask;
@@ -36363,17 +35705,19 @@ var Rendering = /*#__PURE__*/function () {
36363
35705
  }, {
36364
35706
  key: "RenderWidth",
36365
35707
  get: function get() {
36366
- return this.renderWidth;
35708
+ var _this$renderWidth;
35709
+ return (_this$renderWidth = this.renderWidth) !== null && _this$renderWidth !== void 0 ? _this$renderWidth : 0;
36367
35710
  }
36368
35711
  }, {
36369
35712
  key: "RenderHeight",
36370
35713
  get: function get() {
36371
- return this.renderHeight;
35714
+ var _this$renderHeight;
35715
+ return (_this$renderHeight = this.renderHeight) !== null && _this$renderHeight !== void 0 ? _this$renderHeight : 0;
36372
35716
  }
36373
35717
  }, {
36374
35718
  key: "getHasLayerMask",
36375
35719
  value: function getHasLayerMask() {
36376
- return this.hasLayerMask;
35720
+ return !!this.hasLayerMask;
36377
35721
  }
36378
35722
  }, {
36379
35723
  key: "getLayerMaskForSrc",
@@ -36809,7 +36153,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36809
36153
  while (1) switch (_context3.prev = _context3.next) {
36810
36154
  case 0:
36811
36155
  _context3.next = 2;
36812
- return Promise.resolve().then(function () { return require('./Host3DSignalR-f9b0c4f0.js'); });
36156
+ return Promise.resolve().then(function () { return require('./Host3DSignalR-bb33f234.js'); });
36813
36157
  case 2:
36814
36158
  _yield$import = _context3.sent;
36815
36159
  Host3DSignalR = _yield$import["default"];
@@ -38361,7 +37705,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38361
37705
  break;
38362
37706
  case 8:
38363
37707
  _context4.next = 10;
38364
- return Promise.resolve().then(function () { return require('./DivaStandardPlanner-4f6be897.js'); });
37708
+ return Promise.resolve().then(function () { return require('./DivaStandardPlanner-15808d2b.js'); });
38365
37709
  case 10:
38366
37710
  _yield$import = _context4.sent;
38367
37711
  DivaStandardPlanner = _yield$import["default"];
@@ -38372,7 +37716,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38372
37716
  return _context4.abrupt("break", 21);
38373
37717
  case 15:
38374
37718
  _context4.next = 17;
38375
- return Promise.resolve().then(function () { return require('./DivaBoxPlanner-13d3daa2.js'); });
37719
+ return Promise.resolve().then(function () { return require('./DivaBoxPlanner-6fa732f4.js'); });
38376
37720
  case 17:
38377
37721
  _yield$import2 = _context4.sent;
38378
37722
  DivaBoxPlanner = _yield$import2["default"];
@@ -39518,7 +38862,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39518
38862
  //Do also pass the correct price format
39519
38863
  (_this$actions = _this.actions) === null || _this$actions === void 0 || (_this$actions$toggleL = _this$actions.toggleLoading) === null || _this$actions$toggleL === void 0 || _this$actions$toggleL.call(_this$actions, 'SUMMARY');
39520
38864
  _context2.next = 6;
39521
- return summaryHandlerInstance.getSummaryItems(_this.sets, _this.doConfigure.bind(_this), _this.doAllowSetPlanner());
38865
+ return summaryHandlerInstance.getSummaryItems(_this.sets, _this.doConfigure.bind(_this));
39522
38866
  case 6:
39523
38867
  summaryItems = _context2.sent;
39524
38868
  (_this$updateSummaryIt = _this.updateSummaryItems) === null || _this$updateSummaryIt === void 0 || _this$updateSummaryIt.call(_this, summaryItems, setPriceFormat, summaryHandlerInstance.getSummaryStepWarning(_this.actSet(), summaryItems));
@@ -39603,11 +38947,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39603
38947
  _this.updateViewButtonsDependigOnConfigStructure();
39604
38948
  baseArticle = setHandlerInstance.getBaseParentArticleOfAccessoire(set, newArticle.basketId);
39605
38949
  if (!dontUpdateView) (_this$updateElementSe = _this.updateElementSelectionPlanner) === null || _this$updateElementSe === void 0 || _this$updateElementSe.call(_this, [baseArticle.setId], [baseArticle.elementId], true);
39606
- _context3.next = 29;
38950
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAdd');
38951
+ _context3.next = 30;
39607
38952
  return _this.checkVariantData();
39608
- case 29:
39609
- return _context3.abrupt("return", 'ElementAdded');
39610
38953
  case 30:
38954
+ return _context3.abrupt("return", 'ElementAdded');
38955
+ case 31:
39611
38956
  case "end":
39612
38957
  return _context3.stop();
39613
38958
  }
@@ -39687,8 +39032,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39687
39032
  (_this$updateViewPlann3 = _this.updateViewPlannerElements) === null || _this$updateViewPlann3 === void 0 || _this$updateViewPlann3.call(_this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
39688
39033
  _this.updatePlannerView('ADD_ACC_ON_SHELF_PLANNER');
39689
39034
  }
39035
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onShelfAdd');
39036
+ _this.checkVariantData();
39690
39037
  return _context5.abrupt("return", retVal);
39691
- case 8:
39038
+ case 10:
39692
39039
  case "end":
39693
39040
  return _context5.stop();
39694
39041
  }
@@ -39732,7 +39079,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39732
39079
  _this.updateViewButtonsDependigOnConfigStructure();
39733
39080
  (_this$updateViewPlann5 = _this.updateViewPlannerElements) === null || _this$updateViewPlann5 === void 0 || _this$updateViewPlann5.call(_this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
39734
39081
  _this.updatePlannerView('DELETE_ACC_ON_SHELF_PLANNER');
39735
- case 9:
39082
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onShelfDelete');
39083
+ _this.checkVariantData();
39084
+ case 11:
39736
39085
  case "end":
39737
39086
  return _context6.stop();
39738
39087
  }
@@ -39790,22 +39139,24 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39790
39139
  _defineProperty__default["default"](this, "updateAccessoireQuantity", /*#__PURE__*/function () {
39791
39140
  var _ref8 = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee8(accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle) {
39792
39141
  var _this$actions11, _this$actions11$toggl, _this$actions12, _this$actions12$toggl;
39793
- var ret;
39142
+ var set, ret;
39794
39143
  return _regeneratorRuntime__default["default"].wrap(function _callee8$(_context8) {
39795
39144
  while (1) switch (_context8.prev = _context8.next) {
39796
39145
  case 0:
39146
+ set = _this.actSet();
39797
39147
  (_this$actions11 = _this.actions) === null || _this$actions11 === void 0 || (_this$actions11$toggl = _this$actions11.toggleLoading) === null || _this$actions11$toggl === void 0 || _this$actions11$toggl.call(_this$actions11, 'LoadingArticles_' + accessoireItem.articleCodex, false, true);
39798
- _context8.next = 3;
39799
- return setHandlerInstance.updateAccessoireQuantity(_this.actSet(), accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle);
39800
- case 3:
39148
+ _context8.next = 4;
39149
+ return setHandlerInstance.updateAccessoireQuantity(set, accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle);
39150
+ case 4:
39801
39151
  ret = _context8.sent;
39802
39152
  (_this$actions12 = _this.actions) === null || _this$actions12 === void 0 || (_this$actions12$toggl = _this$actions12.toggleLoading) === null || _this$actions12$toggl === void 0 || _this$actions12$toggl.call(_this$actions12, 'LoadingArticles_' + accessoireItem.articleCodex, false, false);
39803
39153
  if (ret.somethingChanged) _this.updateConfigStructure();
39804
39154
  _this.updatePlannerView('UPDATE_ACC_QUANTITY');
39805
39155
  _this.updatePriceInView();
39806
39156
  _this.updateViewButtonsDependigOnConfigStructure();
39157
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAccessoireUpdate');
39807
39158
  _this.checkVariantData();
39808
- case 10:
39159
+ case 12:
39809
39160
  case "end":
39810
39161
  return _context8.stop();
39811
39162
  }
@@ -39833,9 +39184,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39833
39184
  _this.updatePriceInView();
39834
39185
  _this.updateViewButtonsDependigOnConfigStructure();
39835
39186
  }
39187
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAccessoireDelete');
39836
39188
  _this.checkVariantData();
39837
39189
  return _context9.abrupt("return", wasDeleted);
39838
- case 7:
39190
+ case 8:
39839
39191
  case "end":
39840
39192
  return _context9.stop();
39841
39193
  }
@@ -39917,9 +39269,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39917
39269
  returnValues = _context11.sent;
39918
39270
  (_this$actions14 = _this.actions) === null || _this$actions14 === void 0 || (_this$actions14$toggl = _this$actions14.toggleLoading) === null || _this$actions14$toggl === void 0 || _this$actions14$toggl.call(_this$actions14, 'doConfigure', false, false);
39919
39271
  structure = setHandlerInstance.loadConfigStructureOfActSet(set, _this.getCurPlannerType());
39272
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onConfig');
39920
39273
  _this.checkVariantData();
39921
39274
  if (dontUpdatePlannerView) {
39922
- _context11.next = 18;
39275
+ _context11.next = 19;
39923
39276
  break;
39924
39277
  }
39925
39278
  _this.updateConfiguratorStructure(structure);
@@ -39933,16 +39286,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39933
39286
  _this.updateViewButtonsDependigOnConfigStructure();
39934
39287
  _this.updatePlannerView('DO_CONFIGURE', myValues);
39935
39288
  _this.updateWebConfiguratorTitle();
39936
- _context11.next = 18;
39289
+ _context11.next = 19;
39937
39290
  return _this.getFreePlacesOnGrids(undefined, 'doConfigure');
39938
- case 18:
39291
+ case 19:
39939
39292
  if (dontCallEvents) {
39940
- _context11.next = 21;
39293
+ _context11.next = 22;
39941
39294
  break;
39942
39295
  }
39943
- _context11.next = 21;
39296
+ _context11.next = 22;
39944
39297
  return _this.fillBaksetforOnWebPlanerConfigChange(myValues);
39945
- case 21:
39298
+ case 22:
39946
39299
  case "end":
39947
39300
  return _context11.stop();
39948
39301
  }
@@ -40068,11 +39421,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40068
39421
  case 12:
40069
39422
  loadSuccessful = _context13.sent;
40070
39423
  if (!loadSuccessful) {
40071
- _context13.next = 55;
39424
+ _context13.next = 58;
40072
39425
  break;
40073
39426
  }
40074
39427
  if (!(typeof loadSuccessful != 'boolean')) {
40075
- _context13.next = 23;
39428
+ _context13.next = 25;
40076
39429
  break;
40077
39430
  }
40078
39431
  if (!(loadSuccessful.type == 'ProductList')) {
@@ -40089,53 +39442,49 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40089
39442
  (_this$actions15 = this.actions) === null || _this$actions15 === void 0 || (_this$actions15$toggl = _this$actions15.toggleLoading) === null || _this$actions15$toggl === void 0 || _this$actions15$toggl.call(_this$actions15, 'Planner_Loading', false, false);
40090
39443
  return _context13.abrupt("return", true);
40091
39444
  case 23:
40092
- //TODO: get prices of matching product with more than one element
40093
-
40094
- //else if (DivaApiHandler.doCheckForProductsPrice()) {
40095
- // await DivaSetHandler.loadProductsOfSets(
40096
- // this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr),
40097
- // this.divaBasketHandler.actBasket.SetPlannerInfos?.InvolvedSetIds,
40098
- // );
40099
- //}
40100
-
39445
+ _context13.next = 26;
39446
+ break;
39447
+ case 25:
39448
+ if (this.api.doCheckForProductsPrice()) ;
39449
+ case 26:
40101
39450
  this.divaNr = this.divaBasketHandler.actDivaNr;
40102
39451
  initSetState = this.getInitStateForSet();
40103
39452
  this.plannerHandler.initPlanner(initSetState, this.getPlannerHandlerFunctions());
40104
- _context13.next = 28;
39453
+ _context13.next = 31;
40105
39454
  return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
40106
- case 28:
39455
+ case 31:
40107
39456
  set = this.actSet();
40108
39457
  if (!((_initSetState$api$web = initSetState.api.webConfig) !== null && _initSetState$api$web !== void 0 && _initSetState$api$web.checkForProductsPrice)) {
40109
- _context13.next = 40;
39458
+ _context13.next = 43;
40110
39459
  break;
40111
39460
  }
40112
39461
  if (!(typeof loadSuccessful != 'boolean' && loadSuccessful.type == 'ProductId')) {
40113
- _context13.next = 35;
39462
+ _context13.next = 38;
40114
39463
  break;
40115
39464
  }
40116
39465
  products = loadSuccessful;
40117
39466
  set === null || set === void 0 || set.remindPriceForHash(products);
40118
- _context13.next = 40;
39467
+ _context13.next = 43;
40119
39468
  break;
40120
- case 35:
39469
+ case 38:
40121
39470
  if (!this.divaBasketHandler.actBasket.OrigProductId) {
40122
- _context13.next = 40;
39471
+ _context13.next = 43;
40123
39472
  break;
40124
39473
  }
40125
- _context13.next = 38;
39474
+ _context13.next = 41;
40126
39475
  return this.divaBasketHandler.getProduct(this.api, this.divaBasketHandler.actBasket.OrigProductId);
40127
- case 38:
39476
+ case 41:
40128
39477
  result = _context13.sent;
40129
39478
  if (result) {
40130
39479
  set === null || set === void 0 || set.remindPriceForHash(result);
40131
39480
  }
40132
- case 40:
40133
- _context13.next = 42;
39481
+ case 43:
39482
+ _context13.next = 45;
40134
39483
  return viewReadyPromise;
40135
- case 42:
40136
- _context13.next = 44;
39484
+ case 45:
39485
+ _context13.next = 47;
40137
39486
  return this.initView();
40138
- case 44:
39487
+ case 47:
40139
39488
  (_this$actions16 = this.actions) === null || _this$actions16 === void 0 || _this$actions16.onEvent({
40140
39489
  type: 'onConfiguratorReady'
40141
39490
  });
@@ -40159,11 +39508,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40159
39508
  divaNr: basket.DivaNr,
40160
39509
  documentVersion: basket.DocumentVersion.toString()
40161
39510
  });
40162
- _context13.next = 52;
39511
+ _context13.next = 55;
40163
39512
  return this.fillBaksetforOnWebPlanerConfigChange(undefined, true);
40164
- case 52:
40165
- return _context13.abrupt("return", true);
40166
39513
  case 55:
39514
+ return _context13.abrupt("return", true);
39515
+ case 58:
40167
39516
  this.onInitializationError();
40168
39517
  //fehler beim laden vom basket..
40169
39518
  LOG$1.errorTransaction('LOADING_BASKET', 'BASKET_0002', 'Fehler beim Laden des Baskets', {
@@ -40181,7 +39530,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40181
39530
  plannerMode: this.getCurImageMode(),*/
40182
39531
  });
40183
39532
  return _context13.abrupt("return", false);
40184
- case 58:
39533
+ case 61:
40185
39534
  case "end":
40186
39535
  return _context13.stop();
40187
39536
  }
@@ -40343,7 +39692,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40343
39692
  break;
40344
39693
  }
40345
39694
  (_this$initConfigurato = this.initConfiguratorStructure) === null || _this$initConfigurato === void 0 || _this$initConfigurato.call(this, setHandlerInstance.loadConfigStructureForOnlyProductsList());
40346
- _context15.next = 17;
39695
+ _context15.next = 18;
40347
39696
  break;
40348
39697
  case 7:
40349
39698
  _context15.next = 9;
@@ -40358,11 +39707,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40358
39707
  (_this$updateViewPlann9 = this.updateViewPlannerElements) === null || _this$updateViewPlann9 === void 0 || _this$updateViewPlann9.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set), set.getSetId(), set.firstElementId);
40359
39708
  this.updatePlannerView('INIT_VIEW');
40360
39709
  this.onBasketInitialized();
39710
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onInit');
40361
39711
  this.checkVariantData();
40362
- case 17:
40363
- _context15.next = 19;
39712
+ case 18:
39713
+ _context15.next = 20;
40364
39714
  return this.runInitMode(plannerMode);
40365
- case 19:
39715
+ case 20:
40366
39716
  case "end":
40367
39717
  return _context15.stop();
40368
39718
  }
@@ -40461,31 +39811,32 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40461
39811
  i = 0;
40462
39812
  case 8:
40463
39813
  if (!(i < orderSets.length)) {
40464
- _context17.next = 23;
39814
+ _context17.next = 24;
40465
39815
  break;
40466
39816
  }
40467
39817
  orderset = orderSets[i];
40468
39818
  lastSetToInitialize = setHandlerInstance.getOrderSetShouldInitPlanner(orderSets, i);
40469
39819
  loadedSet = setHandlerInstance.findLoadedSet(this.sets, orderset.CatalogCodex, orderset.AccountGUID);
40470
39820
  if (!loadedSet) {
40471
- _context17.next = 17;
39821
+ _context17.next = 18;
40472
39822
  break;
40473
39823
  }
40474
39824
  _context17.next = 15;
40475
39825
  return setHandlerInstance.addOrderSetArticlesToExistingSet(loadedSet, orderset, lastSetToInitialize);
40476
39826
  case 15:
40477
- _context17.next = 19;
39827
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onAdd');
39828
+ _context17.next = 20;
40478
39829
  break;
40479
- case 17:
40480
- _context17.next = 19;
39830
+ case 18:
39831
+ _context17.next = 20;
40481
39832
  return setHandlerInstance.initSet(orderset, this.getInitStateForSet(), lastSetToInitialize);
40482
- case 19:
40483
- this.cleanUpEmptySets(true);
40484
39833
  case 20:
39834
+ this.cleanUpEmptySets(true);
39835
+ case 21:
40485
39836
  i++;
40486
39837
  _context17.next = 8;
40487
39838
  break;
40488
- case 23:
39839
+ case 24:
40489
39840
  this.divaBasketHandler.actBasket.OrderSets = [];
40490
39841
  this.updatePriceInView();
40491
39842
  this.updateWebConfiguratorTitle();
@@ -40493,7 +39844,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40493
39844
  (_this$updateViewPlann10 = this.updateViewPlannerElements) === null || _this$updateViewPlann10 === void 0 || _this$updateViewPlann10.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
40494
39845
  articlesKeys = Object.keys(this.actSet().getDivaArticles());
40495
39846
  this.loadPaletteInfos(undefined, [articlesKeys[0]], articlesKeys);
40496
- case 30:
39847
+ case 31:
40497
39848
  case "end":
40498
39849
  return _context17.stop();
40499
39850
  }
@@ -40504,37 +39855,6 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40504
39855
  }
40505
39856
  return addSetToActPlanningByDivaNr;
40506
39857
  }()
40507
- }, {
40508
- key: "initProductId",
40509
- value: function () {
40510
- var _initProductId = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee18(productId) {
40511
- var loadSuccessful;
40512
- return _regeneratorRuntime__default["default"].wrap(function _callee18$(_context18) {
40513
- while (1) switch (_context18.prev = _context18.next) {
40514
- case 0:
40515
- _context18.next = 2;
40516
- return this.divaBasketHandler.initProductId(this.api, productId, true);
40517
- case 2:
40518
- loadSuccessful = _context18.sent;
40519
- if (!(typeof loadSuccessful != 'boolean')) {
40520
- _context18.next = 6;
40521
- break;
40522
- }
40523
- setHandlerInstance.addProducts([loadSuccessful], []);
40524
- return _context18.abrupt("return", loadSuccessful.divaNr);
40525
- case 6:
40526
- return _context18.abrupt("return", false);
40527
- case 7:
40528
- case "end":
40529
- return _context18.stop();
40530
- }
40531
- }, _callee18, this);
40532
- }));
40533
- function initProductId(_x49) {
40534
- return _initProductId.apply(this, arguments);
40535
- }
40536
- return initProductId;
40537
- }()
40538
39858
  }, {
40539
39859
  key: "cleanUpEmptySets",
40540
39860
  value: function cleanUpEmptySets(ignoreActSet) {
@@ -40563,28 +39883,28 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40563
39883
  }, {
40564
39884
  key: "setActSetCurConfigStepKey",
40565
39885
  value: function () {
40566
- var _setActSetCurConfigStepKey = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee19(curConfigStepKey) {
39886
+ var _setActSetCurConfigStepKey = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee18(curConfigStepKey) {
40567
39887
  var set;
40568
- return _regeneratorRuntime__default["default"].wrap(function _callee19$(_context19) {
40569
- while (1) switch (_context19.prev = _context19.next) {
39888
+ return _regeneratorRuntime__default["default"].wrap(function _callee18$(_context18) {
39889
+ while (1) switch (_context18.prev = _context18.next) {
40570
39890
  case 0:
40571
39891
  set = this.actSet();
40572
39892
  if (set) {
40573
- _context19.next = 3;
39893
+ _context18.next = 3;
40574
39894
  break;
40575
39895
  }
40576
- return _context19.abrupt("return");
39896
+ return _context18.abrupt("return");
40577
39897
  case 3:
40578
39898
  set.ActConfigStepKey = curConfigStepKey;
40579
- _context19.next = 6;
39899
+ _context18.next = 6;
40580
39900
  return setHandlerInstance.updateNavigation(set);
40581
39901
  case 6:
40582
39902
  case "end":
40583
- return _context19.stop();
39903
+ return _context18.stop();
40584
39904
  }
40585
- }, _callee19, this);
39905
+ }, _callee18, this);
40586
39906
  }));
40587
- function setActSetCurConfigStepKey(_x50) {
39907
+ function setActSetCurConfigStepKey(_x49) {
40588
39908
  return _setActSetCurConfigStepKey.apply(this, arguments);
40589
39909
  }
40590
39910
  return setActSetCurConfigStepKey;
@@ -40723,17 +40043,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40723
40043
  }, {
40724
40044
  key: "deletePlannerElement",
40725
40045
  value: function () {
40726
- var _deletePlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee20(setId, elementId, denyElementSelectionClear) {
40046
+ var _deletePlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee19(setId, elementId, denyElementSelectionClear) {
40727
40047
  var _this$updateViewPlann11;
40728
40048
  var set, result, _this$updateElementSe5, _this$updateElementSe6;
40729
- return _regeneratorRuntime__default["default"].wrap(function _callee20$(_context20) {
40730
- while (1) switch (_context20.prev = _context20.next) {
40049
+ return _regeneratorRuntime__default["default"].wrap(function _callee19$(_context19) {
40050
+ while (1) switch (_context19.prev = _context19.next) {
40731
40051
  case 0:
40732
40052
  set = this.sets[setId];
40733
- _context20.next = 3;
40053
+ _context19.next = 3;
40734
40054
  return setHandlerInstance.deleteElementFromSetByElemId(set, elementId, true);
40735
40055
  case 3:
40736
- result = _context20.sent;
40056
+ result = _context19.sent;
40737
40057
  this.updateConfigStructure();
40738
40058
  (_this$updateViewPlann11 = this.updateViewPlannerElements) === null || _this$updateViewPlann11 === void 0 || _this$updateViewPlann11.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
40739
40059
  this.updatePlannerView('DELETE_PLANNER_ELEMENT');
@@ -40743,16 +40063,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40743
40063
  if (result.selectElementId) (_this$updateElementSe5 = this.updateElementSelectionPlanner) === null || _this$updateElementSe5 === void 0 || _this$updateElementSe5.call(this, [result.setId], [result.selectElementId], true);else (_this$updateElementSe6 = this.updateElementSelectionPlanner) === null || _this$updateElementSe6 === void 0 || _this$updateElementSe6.call(this, [], [], true);
40744
40064
  }
40745
40065
  this.updatePriceInView();
40066
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onDelete');
40746
40067
  this.checkVariantData();
40747
- _context20.next = 14;
40068
+ _context19.next = 15;
40748
40069
  return this.getFreePlacesOnGrids(undefined, 'deleteElement');
40749
- case 14:
40070
+ case 15:
40750
40071
  case "end":
40751
- return _context20.stop();
40072
+ return _context19.stop();
40752
40073
  }
40753
- }, _callee20, this);
40074
+ }, _callee19, this);
40754
40075
  }));
40755
- function deletePlannerElement(_x51, _x52, _x53) {
40076
+ function deletePlannerElement(_x50, _x51, _x52) {
40756
40077
  return _deletePlannerElement.apply(this, arguments);
40757
40078
  }
40758
40079
  return deletePlannerElement;
@@ -40766,17 +40087,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40766
40087
  }, {
40767
40088
  key: "copyPlannerElement",
40768
40089
  value: (function () {
40769
- var _copyPlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee21(setId, elementId, curConfigKey, copyInfo) {
40090
+ var _copyPlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee20(setId, elementId, curConfigKey, copyInfo) {
40770
40091
  var _this$updateViewPlann12;
40771
40092
  var set, newSelectedArticle, newConfigStepKey, _this$updateElementSe7, baseArticle;
40772
- return _regeneratorRuntime__default["default"].wrap(function _callee21$(_context21) {
40773
- while (1) switch (_context21.prev = _context21.next) {
40093
+ return _regeneratorRuntime__default["default"].wrap(function _callee20$(_context20) {
40094
+ while (1) switch (_context20.prev = _context20.next) {
40774
40095
  case 0:
40775
40096
  set = this.sets[setId];
40776
- _context21.next = 3;
40097
+ _context20.next = 3;
40777
40098
  return setHandlerInstance.copyPlannerElement(set, elementId, copyInfo);
40778
40099
  case 3:
40779
- newSelectedArticle = _context21.sent;
40100
+ newSelectedArticle = _context20.sent;
40780
40101
  this.updateConfigStructure();
40781
40102
  (_this$updateViewPlann12 = this.updateViewPlannerElements) === null || _this$updateViewPlann12 === void 0 || _this$updateViewPlann12.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
40782
40103
  this.updatePlannerView('COPY_PLANNER_ELEMENT');
@@ -40789,17 +40110,18 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40789
40110
  baseArticle = setHandlerInstance.getBaseParentArticleOfAccessoire(set, newSelectedArticle.basketId);
40790
40111
  (_this$updateElementSe7 = this.updateElementSelectionPlanner) === null || _this$updateElementSe7 === void 0 || _this$updateElementSe7.call(this, [baseArticle.setId], [baseArticle.elementId], true);
40791
40112
  }
40792
- _context21.next = 13;
40113
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onCopy');
40114
+ _context20.next = 14;
40793
40115
  return this.checkVariantData();
40794
- case 13:
40795
- return _context21.abrupt("return", newConfigStepKey);
40796
40116
  case 14:
40117
+ return _context20.abrupt("return", newConfigStepKey);
40118
+ case 15:
40797
40119
  case "end":
40798
- return _context21.stop();
40120
+ return _context20.stop();
40799
40121
  }
40800
- }, _callee21, this);
40122
+ }, _callee20, this);
40801
40123
  }));
40802
- function copyPlannerElement(_x54, _x55, _x56, _x57) {
40124
+ function copyPlannerElement(_x53, _x54, _x55, _x56) {
40803
40125
  return _copyPlannerElement.apply(this, arguments);
40804
40126
  }
40805
40127
  return copyPlannerElement;
@@ -40828,33 +40150,33 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40828
40150
  }, {
40829
40151
  key: "getFreePlacesOnGrids",
40830
40152
  value: function () {
40831
- var _getFreePlacesOnGrids = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee22(gridGroup, from) {
40153
+ var _getFreePlacesOnGrids = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee21(gridGroup, from) {
40832
40154
  var _this$updateFreePlace;
40833
40155
  var set, freeShelfGrids, plannedShelfGrids;
40834
- return _regeneratorRuntime__default["default"].wrap(function _callee22$(_context22) {
40835
- while (1) switch (_context22.prev = _context22.next) {
40156
+ return _regeneratorRuntime__default["default"].wrap(function _callee21$(_context21) {
40157
+ while (1) switch (_context21.prev = _context21.next) {
40836
40158
  case 0:
40837
40159
  set = this.actSet();
40838
40160
  if (set) {
40839
- _context22.next = 3;
40161
+ _context21.next = 3;
40840
40162
  break;
40841
40163
  }
40842
40164
  throw new Error('getFreePlacesOnGrids: act set is not defined!');
40843
40165
  case 3:
40844
40166
  if (!gridGroup) {
40845
- _context22.next = 9;
40167
+ _context21.next = 9;
40846
40168
  break;
40847
40169
  }
40848
- _context22.next = 6;
40170
+ _context21.next = 6;
40849
40171
  return setHandlerInstance.getFreeShelfGrids(set, gridGroup);
40850
40172
  case 6:
40851
- _context22.t0 = _context22.sent;
40852
- _context22.next = 10;
40173
+ _context21.t0 = _context21.sent;
40174
+ _context21.next = 10;
40853
40175
  break;
40854
40176
  case 9:
40855
- _context22.t0 = undefined;
40177
+ _context21.t0 = undefined;
40856
40178
  case 10:
40857
- freeShelfGrids = _context22.t0;
40179
+ freeShelfGrids = _context21.t0;
40858
40180
  plannedShelfGrids = setHandlerInstance.getPlannedShelfGrids(set);
40859
40181
  LOG$1.debug('TOULA', 'freeShelfGrids', freeShelfGrids, 'plannedShelfGrids', plannedShelfGrids);
40860
40182
  LOG$1.debug('update free from: ' + from, 'freeShelfGrids', freeShelfGrids, 'plannedShelfGrids', plannedShelfGrids);
@@ -40862,17 +40184,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40862
40184
  freeShelfGrids: freeShelfGrids,
40863
40185
  plannedShelfGrids: plannedShelfGrids
40864
40186
  });
40865
- return _context22.abrupt("return", {
40187
+ return _context21.abrupt("return", {
40866
40188
  freeShelfGrids: freeShelfGrids,
40867
40189
  plannedShelfGrids: plannedShelfGrids
40868
40190
  });
40869
40191
  case 16:
40870
40192
  case "end":
40871
- return _context22.stop();
40193
+ return _context21.stop();
40872
40194
  }
40873
- }, _callee22, this);
40195
+ }, _callee21, this);
40874
40196
  }));
40875
- function getFreePlacesOnGrids(_x58, _x59) {
40197
+ function getFreePlacesOnGrids(_x57, _x58) {
40876
40198
  return _getFreePlacesOnGrids.apply(this, arguments);
40877
40199
  }
40878
40200
  return getFreePlacesOnGrids;
@@ -40889,36 +40211,36 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40889
40211
  }, {
40890
40212
  key: "moveShelfItemToGrid",
40891
40213
  value: function () {
40892
- var _moveShelfItemToGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee23(accessoireBasketId, parentBasketId, gridName, cellIndex) {
40214
+ var _moveShelfItemToGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee22(accessoireBasketId, parentBasketId, gridName, cellIndex) {
40893
40215
  var set, newGridId;
40894
- return _regeneratorRuntime__default["default"].wrap(function _callee23$(_context23) {
40895
- while (1) switch (_context23.prev = _context23.next) {
40216
+ return _regeneratorRuntime__default["default"].wrap(function _callee22$(_context22) {
40217
+ while (1) switch (_context22.prev = _context22.next) {
40896
40218
  case 0:
40897
40219
  set = this.actSet();
40898
40220
  if (set) {
40899
- _context23.next = 3;
40221
+ _context22.next = 3;
40900
40222
  break;
40901
40223
  }
40902
- return _context23.abrupt("return");
40224
+ return _context22.abrupt("return");
40903
40225
  case 3:
40904
- _context23.next = 5;
40226
+ _context22.next = 5;
40905
40227
  return setHandlerInstance.moveShelfItemToGrid(set, accessoireBasketId, parentBasketId, gridName, cellIndex);
40906
40228
  case 5:
40907
- newGridId = _context23.sent;
40229
+ newGridId = _context22.sent;
40908
40230
  this.updatePlannerView('MOVE_SHELF_ITEM');
40909
40231
  if (!newGridId) {
40910
- _context23.next = 10;
40232
+ _context22.next = 10;
40911
40233
  break;
40912
40234
  }
40913
- _context23.next = 10;
40235
+ _context22.next = 10;
40914
40236
  return this.getFreePlacesOnGrids(newGridId, 'move shelf');
40915
40237
  case 10:
40916
40238
  case "end":
40917
- return _context23.stop();
40239
+ return _context22.stop();
40918
40240
  }
40919
- }, _callee23, this);
40241
+ }, _callee22, this);
40920
40242
  }));
40921
- function moveShelfItemToGrid(_x60, _x61, _x62, _x63) {
40243
+ function moveShelfItemToGrid(_x59, _x60, _x61, _x62) {
40922
40244
  return _moveShelfItemToGrid.apply(this, arguments);
40923
40245
  }
40924
40246
  return moveShelfItemToGrid;
@@ -40926,27 +40248,27 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40926
40248
  }, {
40927
40249
  key: "resetArticle",
40928
40250
  value: function () {
40929
- var _resetArticle = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee24(basketId) {
40251
+ var _resetArticle = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee23(basketId) {
40930
40252
  var set;
40931
- return _regeneratorRuntime__default["default"].wrap(function _callee24$(_context24) {
40932
- while (1) switch (_context24.prev = _context24.next) {
40253
+ return _regeneratorRuntime__default["default"].wrap(function _callee23$(_context23) {
40254
+ while (1) switch (_context23.prev = _context23.next) {
40933
40255
  case 0:
40934
40256
  set = this.actSet();
40935
40257
  if (set) {
40936
- _context24.next = 3;
40258
+ _context23.next = 3;
40937
40259
  break;
40938
40260
  }
40939
- return _context24.abrupt("return");
40261
+ return _context23.abrupt("return");
40940
40262
  case 3:
40941
- _context24.next = 5;
40263
+ _context23.next = 5;
40942
40264
  return setHandlerInstance.resetArticle(set, basketId);
40943
40265
  case 5:
40944
40266
  case "end":
40945
- return _context24.stop();
40267
+ return _context23.stop();
40946
40268
  }
40947
- }, _callee24, this);
40269
+ }, _callee23, this);
40948
40270
  }));
40949
- function resetArticle(_x64) {
40271
+ function resetArticle(_x63) {
40950
40272
  return _resetArticle.apply(this, arguments);
40951
40273
  }
40952
40274
  return resetArticle;
@@ -40954,27 +40276,27 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40954
40276
  }, {
40955
40277
  key: "checkVariantData",
40956
40278
  value: function () {
40957
- var _checkVariantData = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee25() {
40279
+ var _checkVariantData = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee24() {
40958
40280
  var somethingChanged;
40959
- return _regeneratorRuntime__default["default"].wrap(function _callee25$(_context25) {
40960
- while (1) switch (_context25.prev = _context25.next) {
40281
+ return _regeneratorRuntime__default["default"].wrap(function _callee24$(_context24) {
40282
+ while (1) switch (_context24.prev = _context24.next) {
40961
40283
  case 0:
40962
40284
  if (!this.api.getDoCheckVariantData()) {
40963
- _context25.next = 5;
40285
+ _context24.next = 5;
40964
40286
  break;
40965
40287
  }
40966
- _context25.next = 3;
40288
+ _context24.next = 3;
40967
40289
  return setHandlerInstance.checkVariantData(this.actSet());
40968
40290
  case 3:
40969
- somethingChanged = _context25.sent;
40291
+ somethingChanged = _context24.sent;
40970
40292
  if (somethingChanged) {
40971
40293
  this.updatePriceInView();
40972
40294
  }
40973
40295
  case 5:
40974
40296
  case "end":
40975
- return _context25.stop();
40297
+ return _context24.stop();
40976
40298
  }
40977
- }, _callee25, this);
40299
+ }, _callee24, this);
40978
40300
  }));
40979
40301
  function checkVariantData() {
40980
40302
  return _checkVariantData.apply(this, arguments);
@@ -41070,7 +40392,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41070
40392
  }, {
41071
40393
  key: "saveToBasketWrapper",
41072
40394
  value: function () {
41073
- var _saveToBasketWrapper = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee26(event, repairOnly, force) {
40395
+ var _saveToBasketWrapper = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee25(event, repairOnly, force) {
41074
40396
  var _this$actions25,
41075
40397
  _this$actions25$toggl,
41076
40398
  _this$actions26,
@@ -41078,48 +40400,46 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41078
40400
  _this2 = this,
41079
40401
  _this$actions30,
41080
40402
  _this$i18n14;
41081
- var returnTo, finalEvent, _this$api$getBarrierC, _this$openLeafeltBarr, product, _result, result, _this$actions27, _this$i18n8, _this$i18n9, _this$actions28, _this$i18n10, _this$i18n11, _this$actions29, _this$i18n12, _this$i18n13, _this$updatePlannerMs2, _this$actions31, _this$i18n15;
41082
- return _regeneratorRuntime__default["default"].wrap(function _callee26$(_context26) {
41083
- while (1) switch (_context26.prev = _context26.next) {
40403
+ var returnTo, finalEvent, _this$api$getBarrierC, _this$openLeafeltBarr, product, result, _this$actions27, _this$i18n8, _this$i18n9, _this$actions28, _this$i18n10, _this$i18n11, _this$actions29, _this$i18n12, _this$i18n13, _this$updatePlannerMs2, _this$actions31, _this$i18n15;
40404
+ return _regeneratorRuntime__default["default"].wrap(function _callee25$(_context25) {
40405
+ while (1) switch (_context25.prev = _context25.next) {
41084
40406
  case 0:
41085
40407
  returnTo = this.getReturnTo(event);
41086
40408
  finalEvent = event;
41087
40409
  if (!(returnTo == 'OPEN_LEAFLET_BARRIER')) {
41088
- _context26.next = 16;
40410
+ _context25.next = 14;
41089
40411
  break;
41090
40412
  }
41091
40413
  product = undefined;
41092
40414
  if (!((_this$api$getBarrierC = this.api.getBarrierConfig()) !== null && _this$api$getBarrierC !== void 0 && _this$api$getBarrierC.affiliate)) {
41093
- _context26.next = 10;
40415
+ _context25.next = 8;
41094
40416
  break;
41095
40417
  }
41096
- _context26.next = 7;
40418
+ _context25.next = 7;
41097
40419
  return this.api.getDataCache(this.api.getCatalogProductUrl(this.actSet().getCatalogCodex()), undefined, undefined, 'catalog');
41098
40420
  case 7:
41099
- _result = _context26.sent;
41100
- productHandlerInstance.addProducts(_result, []);
41101
- product = productHandlerInstance.getBestMatch(this.getDivaArticles());
41102
- case 10:
41103
- _context26.next = 12;
40421
+ _context25.sent;
40422
+ case 8:
40423
+ _context25.next = 10;
41104
40424
  return (_this$openLeafeltBarr = this.openLeafeltBarrier) === null || _this$openLeafeltBarr === void 0 ? void 0 : _this$openLeafeltBarr.call(this, this.divaBasketHandler, this.api.getBarrierConfig(), product);
41105
- case 12:
41106
- finalEvent = _context26.sent;
40425
+ case 10:
40426
+ finalEvent = _context25.sent;
41107
40427
  if (finalEvent) {
41108
- _context26.next = 15;
40428
+ _context25.next = 13;
41109
40429
  break;
41110
40430
  }
41111
- return _context26.abrupt("return", 'canceled');
41112
- case 15:
40431
+ return _context25.abrupt("return", 'canceled');
40432
+ case 13:
41113
40433
  returnTo = finalEvent == 'onAddToBasket' ? 'OPEN_PDF' : returnTo;
41114
- case 16:
40434
+ case 14:
41115
40435
  (_this$actions25 = this.actions) === null || _this$actions25 === void 0 || (_this$actions25$toggl = _this$actions25.toggleLoading) === null || _this$actions25$toggl === void 0 || _this$actions25$toggl.call(_this$actions25, 'Planner_Saving', false, true);
41116
- _context26.next = 19;
40436
+ _context25.next = 17;
41117
40437
  return this.saveToBasket(finalEvent, repairOnly, force);
41118
- case 19:
41119
- result = _context26.sent;
40438
+ case 17:
40439
+ result = _context25.sent;
41120
40440
  (_this$actions26 = this.actions) === null || _this$actions26 === void 0 || (_this$actions26$toggl = _this$actions26.toggleLoading) === null || _this$actions26$toggl === void 0 || _this$actions26$toggl.call(_this$actions26, 'Planner_Saving', false, false);
41121
40441
  if (!(result === 'canceled')) {
41122
- _context26.next = 25;
40442
+ _context25.next = 23;
41123
40443
  break;
41124
40444
  }
41125
40445
  LOG$1.error(new DivaUtils.DivaError('failed to save Basket'));
@@ -41127,12 +40447,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41127
40447
  text: ((_this$i18n8 = this.i18n()) === null || _this$i18n8 === void 0 ? void 0 : _this$i18n8.t('modal.general_error')) + ' --- ' + DivaUtils__default["default"].formatDate(new Date(), true, undefined, true) + ' --- ' + DivaUtils__default["default"].getCurrentTraceId() ? ((_this$i18n9 = this.i18n()) === null || _this$i18n9 === void 0 ? void 0 : _this$i18n9.t('modal.errorcode')) + ': ' + DivaUtils__default["default"].getCurrentTraceId() : '',
41128
40448
  accept: true
41129
40449
  });
41130
- return _context26.abrupt("return", result);
41131
- case 25:
41132
- _context26.t0 = returnTo;
41133
- _context26.next = _context26.t0 === 'OPEN_PDF' ? 28 : _context26.t0 === 'SAVE_BASKET_WITH_MODAL' ? 30 : 31;
40450
+ return _context25.abrupt("return", result);
40451
+ case 23:
40452
+ _context25.t0 = returnTo;
40453
+ _context25.next = _context25.t0 === 'OPEN_PDF' ? 26 : _context25.t0 === 'SAVE_BASKET_WITH_MODAL' ? 28 : 29;
41134
40454
  break;
41135
- case 28:
40455
+ case 26:
41136
40456
  if (!this.getBasket().PDFDocumentURL) {
41137
40457
  LOG$1.error(new DivaUtils.DivaError('PDF url is missing in basket', {
41138
40458
  code: 'WC_0010'
@@ -41150,22 +40470,22 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41150
40470
  }
41151
40471
  });
41152
40472
  }
41153
- return _context26.abrupt("break", 31);
41154
- case 30:
40473
+ return _context25.abrupt("break", 29);
40474
+ case 28:
41155
40475
  (_this$actions30 = this.actions) === null || _this$actions30 === void 0 || _this$actions30.openModal({
41156
40476
  text: (_this$i18n14 = this.i18n()) === null || _this$i18n14 === void 0 ? void 0 : _this$i18n14.t('modal.planning_saved'),
41157
40477
  accept: true
41158
40478
  });
41159
- case 31:
40479
+ case 29:
41160
40480
  if (!(result == 'noArticleToSave')) {
41161
- _context26.next = 34;
40481
+ _context25.next = 32;
41162
40482
  break;
41163
40483
  }
41164
40484
  (_this$updatePlannerMs2 = this.updatePlannerMsgContainer) === null || _this$updatePlannerMs2 === void 0 || _this$updatePlannerMs2.call(this, 'NOTHING_TO_SAVE', true, 'INFO', 'NOTHING_TO_SAVE', true);
41165
- return _context26.abrupt("return", 'canceled');
41166
- case 34:
40485
+ return _context25.abrupt("return", 'canceled');
40486
+ case 32:
41167
40487
  if (!(result == 'payloadToBig')) {
41168
- _context26.next = 37;
40488
+ _context25.next = 35;
41169
40489
  break;
41170
40490
  }
41171
40491
  (_this$actions31 = this.actions) === null || _this$actions31 === void 0 || _this$actions31.openModal({
@@ -41173,16 +40493,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41173
40493
  text: (_this$i18n15 = this.i18n()) === null || _this$i18n15 === void 0 ? void 0 : _this$i18n15.t('configurator.PAYLOAD_TO_BIG'),
41174
40494
  title: 'modals.error_saving'
41175
40495
  });
41176
- return _context26.abrupt("return", 'canceled');
41177
- case 37:
41178
- return _context26.abrupt("return", result);
41179
- case 38:
40496
+ return _context25.abrupt("return", 'canceled');
40497
+ case 35:
40498
+ return _context25.abrupt("return", result);
40499
+ case 36:
41180
40500
  case "end":
41181
- return _context26.stop();
40501
+ return _context25.stop();
41182
40502
  }
41183
- }, _callee26, this);
40503
+ }, _callee25, this);
41184
40504
  }));
41185
- function saveToBasketWrapper(_x65, _x66, _x67) {
40505
+ function saveToBasketWrapper(_x64, _x65, _x66) {
41186
40506
  return _saveToBasketWrapper.apply(this, arguments);
41187
40507
  }
41188
40508
  return saveToBasketWrapper;
@@ -41190,51 +40510,36 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41190
40510
  }, {
41191
40511
  key: "saveToBasket",
41192
40512
  value: function () {
41193
- var _saveToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee27(event, repairOnly, force) {
41194
- var _returnTo, _event, _event2, _event3, _returnTo2, _returnTo3, _this$actions32, _this$actions33;
41195
- var set, actBasket, returnTo, oldReturnTo, count, basketData, bytes, result, newDivaNr, _result2, _event4, product;
41196
- return _regeneratorRuntime__default["default"].wrap(function _callee27$(_context27) {
41197
- while (1) switch (_context27.prev = _context27.next) {
40513
+ var _saveToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee26(event, repairOnly, force) {
40514
+ var _returnTo, _event, _event2, _event3, _returnTo2, _returnTo3, _this$actions32, _this$actions33, _this$actions34;
40515
+ var set, actBasket, returnTo, oldReturnTo, result, newDivaNr, _result2, _event4, product;
40516
+ return _regeneratorRuntime__default["default"].wrap(function _callee26$(_context26) {
40517
+ while (1) switch (_context26.prev = _context26.next) {
41198
40518
  case 0:
41199
40519
  set = this.actSet();
41200
40520
  if (!(setHandlerInstance.isNoArticleToSave(this.sets) && !force)) {
41201
- _context27.next = 3;
40521
+ _context26.next = 3;
41202
40522
  break;
41203
40523
  }
41204
- return _context27.abrupt("return", 'noArticleToSave');
40524
+ return _context26.abrupt("return", 'noArticleToSave');
41205
40525
  case 3:
41206
40526
  actBasket = this.divaBasketHandler.actBasket;
41207
40527
  returnTo = this.getReturnTo(event);
41208
40528
  if (!((_returnTo = returnTo) !== null && _returnTo !== void 0 && _returnTo.startsWith('FAVORITS') && favoritesHandlerInstance.FavoritesDefined(set))) {
41209
- _context27.next = 22;
40529
+ _context26.next = 13;
41210
40530
  break;
41211
40531
  }
41212
40532
  oldReturnTo = returnTo;
41213
40533
  this.ReturnTo = returnTo.replace('FAVORITS_', '');
41214
- _context27.next = 10;
41215
- return this.getValidVariantsLength();
41216
- case 10:
41217
- count = _context27.sent;
41218
- _context27.next = 13;
41219
- return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !!repairOnly, this.doAllowSetPlanner(), this.ReturnTo);
41220
- case 13:
41221
- basketData = _context27.sent;
41222
- bytes = new TextEncoder().encode(JSON.stringify(basketData.getAsJson())).length;
41223
- if (!(bytes * count > 15000000)) {
41224
- _context27.next = 17;
41225
- break;
41226
- }
41227
- return _context27.abrupt("return", 'payloadToBig');
41228
- case 17:
41229
- _context27.next = 19;
40534
+ _context26.next = 10;
41230
40535
  return this.handleFavorites('SAVE');
41231
- case 19:
41232
- result = _context27.sent;
40536
+ case 10:
40537
+ result = _context26.sent;
41233
40538
  if (result === 'canceled') {
41234
40539
  this.ReturnTo = oldReturnTo;
41235
40540
  }
41236
- return _context27.abrupt("return", result);
41237
- case 22:
40541
+ return _context26.abrupt("return", result);
40542
+ case 13:
41238
40543
  LOG$1.startTransaction({
41239
40544
  event: (_event = event) !== null && _event !== void 0 ? _event : 'onAddToBasket',
41240
40545
  message: 'Perform case: ' + ((_event2 = event) !== null && _event2 !== void 0 ? _event2 : 'onAddToBasket'),
@@ -41249,13 +40554,13 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41249
40554
  warningTime: 2000,
41250
40555
  errorTime: 4000
41251
40556
  });
41252
- _context27.t0 = this.divaBasketHandler;
41253
- _context27.t1 = this.divaBasketHandler.actDivaNr;
41254
- _context27.next = 27;
40557
+ _context26.t0 = this.divaBasketHandler;
40558
+ _context26.t1 = this.divaBasketHandler.actDivaNr;
40559
+ _context26.next = 18;
41255
40560
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !!repairOnly, this.doAllowSetPlanner(), this.ReturnTo);
41256
- case 27:
41257
- _context27.t2 = _context27.sent;
41258
- _context27.t0.setBasketData.call(_context27.t0, _context27.t1, _context27.t2);
40561
+ case 18:
40562
+ _context26.t2 = _context26.sent;
40563
+ _context26.t0.setBasketData.call(_context26.t0, _context26.t1, _context26.t2);
41259
40564
  if ((_returnTo2 = returnTo) !== null && _returnTo2 !== void 0 && _returnTo2.endsWith('OPEN_SELLER_BASKET')) {
41260
40565
  this.ReturnTo = 'OPEN_SELLER_BASKET';
41261
40566
  returnTo = this.ReturnTo;
@@ -41271,27 +40576,27 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41271
40576
  actBasket.Updated = Date.now();
41272
40577
  LOG$1.successTransaction('FILL_BASKET');
41273
40578
  if (!returnTo) {
41274
- _context27.next = 63;
40579
+ _context26.next = 55;
41275
40580
  break;
41276
40581
  }
41277
- _context27.t3 = returnTo;
41278
- _context27.next = _context27.t3 === 'OPEN_SELLER_PRODUCTCREATOR' ? 39 : _context27.t3 === 'OPEN_SELLER_BASKET' ? 41 : _context27.t3 === 'OPEN_PDF' ? 43 : _context27.t3 === 'SAVE_BASKET_WITH_MODAL' ? 43 : _context27.t3 === 'SAVE_BASKET' ? 43 : _context27.t3 === 'SAVE_BASKET_SYNC' ? 43 : _context27.t3 === 'OPEN_LEAFLET_BARRIER' ? 43 : 63;
40582
+ _context26.t3 = returnTo;
40583
+ _context26.next = _context26.t3 === 'OPEN_SELLER_PRODUCTCREATOR' ? 30 : _context26.t3 === 'OPEN_SELLER_BASKET' ? 33 : _context26.t3 === 'OPEN_PDF' ? 35 : _context26.t3 === 'SAVE_BASKET_WITH_MODAL' ? 35 : _context26.t3 === 'SAVE_BASKET' ? 35 : _context26.t3 === 'SAVE_BASKET_SYNC' ? 35 : _context26.t3 === 'OPEN_LEAFLET_BARRIER' ? 35 : 55;
41279
40584
  break;
41280
- case 39:
41281
- (_this$actions32 = this.actions) === null || _this$actions32 === void 0 || _this$actions32.openComponent({
40585
+ case 30:
40586
+ (_this$actions32 = this.actions) === null || _this$actions32 === void 0 || _this$actions32.toggleLoading('buildScene', false, false);
40587
+ (_this$actions33 = this.actions) === null || _this$actions33 === void 0 || _this$actions33.openComponent({
41282
40588
  type: 'SELLER',
41283
40589
  parameters: {
41284
40590
  module: 'PCreator',
41285
40591
  divaNr: actBasket.DivaNr
41286
40592
  },
41287
40593
  internal: {
41288
- basketData: actBasket,
41289
- edited: true
40594
+ basketData: actBasket
41290
40595
  }
41291
40596
  });
41292
- return _context27.abrupt("break", 63);
41293
- case 41:
41294
- (_this$actions33 = this.actions) === null || _this$actions33 === void 0 || _this$actions33.openComponent({
40597
+ return _context26.abrupt("break", 55);
40598
+ case 33:
40599
+ (_this$actions34 = this.actions) === null || _this$actions34 === void 0 || _this$actions34.openComponent({
41295
40600
  type: 'SELLER',
41296
40601
  parameters: {
41297
40602
  module: 'Basket',
@@ -41301,37 +40606,37 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41301
40606
  basketData: actBasket
41302
40607
  }
41303
40608
  });
41304
- return _context27.abrupt("break", 63);
41305
- case 43:
40609
+ return _context26.abrupt("break", 55);
40610
+ case 35:
41306
40611
  if (!(event == 'onSaveProduct')) {
41307
- _context27.next = 53;
40612
+ _context26.next = 45;
41308
40613
  break;
41309
40614
  }
41310
40615
  //copy basket, so we only save a copy as baseconfiguration and can continue working with the original basket
41311
40616
  actBasket = new basketModel.BasketData(JSON.parse(JSON.stringify(actBasket)));
41312
- _context27.next = 47;
40617
+ _context26.next = 39;
41313
40618
  return DivaUtils__default["default"].updateBasketOrgInfo(actBasket, this.plannerConfig.currentOrganization, this.plannerConfig.currentUser);
41314
- case 47:
41315
- _context27.next = 49;
40619
+ case 39:
40620
+ _context26.next = 41;
41316
40621
  return this.api.getDataWithoutCache(this.api.getUniqueNewDivaNr(), undefined, 'basket');
41317
- case 49:
41318
- newDivaNr = _context27.sent;
40622
+ case 41:
40623
+ newDivaNr = _context26.sent;
41319
40624
  actBasket.convertToBaseConfiguration(newDivaNr.divaNr);
41320
- _context27.next = 62;
40625
+ _context26.next = 54;
41321
40626
  break;
41322
- case 53:
40627
+ case 45:
41323
40628
  if (this.divaBasketHandler.basketWasSavedWithCurrentDocVersion) {
41324
40629
  this.divaBasketHandler.basketWasSavedWithCurrentDocVersion = undefined;
41325
40630
  actBasket.setDocumentVersion(actBasket.getDocumentVersion() + 1);
41326
40631
  }
41327
40632
  this.divaBasketHandler.basketWasSavedWithCurrentDocVersion = true;
41328
40633
  actBasket.setDivaNr(this.divaBasketHandler.actDivaNr.split('-').length > 2 ? this.divaBasketHandler.actDivaNr.split('-')[0] + '-' + this.divaBasketHandler.actDivaNr.split('-')[1] : this.divaBasketHandler.actDivaNr);
41329
- _context27.next = 58;
40634
+ _context26.next = 50;
41330
40635
  return this.divaBasketHandler.saveToBasket(this.api, actBasket, returnTo);
41331
- case 58:
41332
- _result2 = _context27.sent;
40636
+ case 50:
40637
+ _result2 = _context26.sent;
41333
40638
  if (!(_result2 === 'ERROR_NO_BASKET_SAVED' || _result2 === 'ERROR_BASKET_AFTER_SAVE')) {
41334
- _context27.next = 62;
40639
+ _context26.next = 54;
41335
40640
  break;
41336
40641
  }
41337
40642
  LOG$1.errorTransaction((_event4 = event) !== null && _event4 !== void 0 ? _event4 : 'onAddToBasket', 'WC_0019', 'Error saving basket', {
@@ -41340,23 +40645,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41340
40645
  status: this.getBasketData().Status,
41341
40646
  bv: set.getSetPrice() / 1000
41342
40647
  });
41343
- return _context27.abrupt("return", 'canceled');
41344
- case 62:
41345
- return _context27.abrupt("break", 63);
41346
- case 63:
40648
+ return _context26.abrupt("return", 'canceled');
40649
+ case 54:
40650
+ return _context26.abrupt("break", 55);
40651
+ case 55:
41347
40652
  if (returnTo == 'DONT_SAVE_BASKET') event = 'dontSaveBasket';
41348
- _context27.next = 66;
40653
+ _context26.next = 58;
41349
40654
  return this.addToBasket(actBasket, event);
41350
- case 66:
41351
- product = _context27.sent;
41352
- return _context27.abrupt("return", product !== null && product !== void 0 ? product : 'saved');
41353
- case 68:
40655
+ case 58:
40656
+ product = _context26.sent;
40657
+ return _context26.abrupt("return", product !== null && product !== void 0 ? product : 'saved');
40658
+ case 60:
41354
40659
  case "end":
41355
- return _context27.stop();
40660
+ return _context26.stop();
41356
40661
  }
41357
- }, _callee27, this);
40662
+ }, _callee26, this);
41358
40663
  }));
41359
- function saveToBasket(_x68, _x69, _x70) {
40664
+ function saveToBasket(_x67, _x68, _x69) {
41360
40665
  return _saveToBasket.apply(this, arguments);
41361
40666
  }
41362
40667
  return saveToBasket;
@@ -41581,23 +40886,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41581
40886
  }, {
41582
40887
  key: "getBasketDataWithEkText",
41583
40888
  value: function () {
41584
- var _getBasketDataWithEkText = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee28() {
41585
- return _regeneratorRuntime__default["default"].wrap(function _callee28$(_context28) {
41586
- while (1) switch (_context28.prev = _context28.next) {
40889
+ var _getBasketDataWithEkText = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee27() {
40890
+ return _regeneratorRuntime__default["default"].wrap(function _callee27$(_context27) {
40891
+ while (1) switch (_context27.prev = _context27.next) {
41587
40892
  case 0:
41588
- _context28.t0 = this.divaBasketHandler;
41589
- _context28.t1 = this.divaBasketHandler.actDivaNr;
41590
- _context28.next = 4;
40893
+ _context27.t0 = this.divaBasketHandler;
40894
+ _context27.t1 = this.divaBasketHandler.actDivaNr;
40895
+ _context27.next = 4;
41591
40896
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, true, this.doAllowSetPlanner(), this.ReturnTo);
41592
40897
  case 4:
41593
- _context28.t2 = _context28.sent;
41594
- _context28.t0.setBasketData.call(_context28.t0, _context28.t1, _context28.t2);
41595
- return _context28.abrupt("return", this.divaBasketHandler.actBasket);
40898
+ _context27.t2 = _context27.sent;
40899
+ _context27.t0.setBasketData.call(_context27.t0, _context27.t1, _context27.t2);
40900
+ return _context27.abrupt("return", this.divaBasketHandler.actBasket);
41596
40901
  case 7:
41597
40902
  case "end":
41598
- return _context28.stop();
40903
+ return _context27.stop();
41599
40904
  }
41600
- }, _callee28, this);
40905
+ }, _callee27, this);
41601
40906
  }));
41602
40907
  function getBasketDataWithEkText() {
41603
40908
  return _getBasketDataWithEkText.apply(this, arguments);
@@ -41623,17 +40928,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41623
40928
  }, {
41624
40929
  key: "addToBasket",
41625
40930
  value: function () {
41626
- var _addToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee29(actBasket) {
41627
- var _this$actions34,
41628
- _this$actions35,
40931
+ var _addToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee28(actBasket) {
40932
+ var _this$actions35,
41629
40933
  _this$actions36,
41630
40934
  _this$actions37,
41631
40935
  _this$actions38,
40936
+ _this$actions39,
41632
40937
  _this$divaBasketHandl3,
41633
40938
  _this3 = this,
41634
- _this$actions39,
41635
40939
  _this$actions40,
41636
- _this$actions41;
40940
+ _this$actions41,
40941
+ _this$actions42;
41637
40942
  var event,
41638
40943
  addToBasketLog,
41639
40944
  emailConfig,
@@ -41642,50 +40947,50 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41642
40947
  to,
41643
40948
  variants,
41644
40949
  products,
41645
- _args29 = arguments;
41646
- return _regeneratorRuntime__default["default"].wrap(function _callee29$(_context29) {
41647
- while (1) switch (_context29.prev = _context29.next) {
40950
+ _args28 = arguments;
40951
+ return _regeneratorRuntime__default["default"].wrap(function _callee28$(_context28) {
40952
+ while (1) switch (_context28.prev = _context28.next) {
41648
40953
  case 0:
41649
- event = _args29.length > 1 && _args29[1] !== undefined ? _args29[1] : 'onAddToBasket';
40954
+ event = _args28.length > 1 && _args28[1] !== undefined ? _args28[1] : 'onAddToBasket';
41650
40955
  addToBasketLog = true;
41651
- _context29.t0 = event;
41652
- _context29.next = _context29.t0 === 'onWebPlanerPrint' ? 5 : _context29.t0 === 'onWebPlanerSave' ? 8 : _context29.t0 === 'onWebPlanerShare' ? 11 : _context29.t0 === 'onRequestConsulation' ? 14 : _context29.t0 === 'onSave' ? 17 : _context29.t0 === 'onSendEmail' ? 20 : _context29.t0 === 'onSaveProduct' ? 25 : _context29.t0 === 'dontSaveBasket' ? 33 : _context29.t0 === 'onAddToBasket' ? 35 : 35;
40956
+ _context28.t0 = event;
40957
+ _context28.next = _context28.t0 === 'onWebPlanerPrint' ? 5 : _context28.t0 === 'onWebPlanerSave' ? 8 : _context28.t0 === 'onWebPlanerShare' ? 11 : _context28.t0 === 'onRequestConsulation' ? 14 : _context28.t0 === 'onSave' ? 17 : _context28.t0 === 'onSendEmail' ? 20 : _context28.t0 === 'onSaveProduct' ? 25 : _context28.t0 === 'dontSaveBasket' ? 33 : _context28.t0 === 'onAddToBasket' ? 35 : 35;
41653
40958
  break;
41654
40959
  case 5:
41655
40960
  this.handleSuccessTransaction('onPrintBasket', actBasket);
41656
- (_this$actions34 = this.actions) === null || _this$actions34 === void 0 || _this$actions34.onEvent({
40961
+ (_this$actions35 = this.actions) === null || _this$actions35 === void 0 || _this$actions35.onEvent({
41657
40962
  type: 'onWebPlanerPrint',
41658
40963
  data: actBasket.getAsJson()
41659
40964
  });
41660
- return _context29.abrupt("break", 38);
40965
+ return _context28.abrupt("break", 38);
41661
40966
  case 8:
41662
40967
  this.handleSuccessTransaction('onSaveBasket', actBasket);
41663
- (_this$actions35 = this.actions) === null || _this$actions35 === void 0 || _this$actions35.onEvent({
40968
+ (_this$actions36 = this.actions) === null || _this$actions36 === void 0 || _this$actions36.onEvent({
41664
40969
  type: 'onWebPlanerSave',
41665
40970
  data: actBasket.getAsJson()
41666
40971
  });
41667
- return _context29.abrupt("break", 38);
40972
+ return _context28.abrupt("break", 38);
41668
40973
  case 11:
41669
40974
  this.handleSuccessTransaction('onShareBasket', actBasket);
41670
- (_this$actions36 = this.actions) === null || _this$actions36 === void 0 || _this$actions36.onEvent({
40975
+ (_this$actions37 = this.actions) === null || _this$actions37 === void 0 || _this$actions37.onEvent({
41671
40976
  type: 'onWebPlanerShare',
41672
40977
  data: actBasket.getAsJson()
41673
40978
  });
41674
- return _context29.abrupt("break", 38);
40979
+ return _context28.abrupt("break", 38);
41675
40980
  case 14:
41676
40981
  this.handleSuccessTransaction('onRequestConsulation', actBasket);
41677
- (_this$actions37 = this.actions) === null || _this$actions37 === void 0 || _this$actions37.onEvent({
40982
+ (_this$actions38 = this.actions) === null || _this$actions38 === void 0 || _this$actions38.onEvent({
41678
40983
  type: 'onRequestConsulation',
41679
40984
  data: actBasket.getAsJson()
41680
40985
  });
41681
- return _context29.abrupt("break", 38);
40986
+ return _context28.abrupt("break", 38);
41682
40987
  case 17:
41683
40988
  this.handleSuccessTransaction('onSave', actBasket);
41684
- (_this$actions38 = this.actions) === null || _this$actions38 === void 0 || _this$actions38.onEvent({
40989
+ (_this$actions39 = this.actions) === null || _this$actions39 === void 0 || _this$actions39.onEvent({
41685
40990
  type: 'onSave',
41686
40991
  data: actBasket.getAsJson()
41687
40992
  });
41688
- return _context29.abrupt("break", 38);
40993
+ return _context28.abrupt("break", 38);
41689
40994
  case 20:
41690
40995
  emailConfig = (_this$divaBasketHandl3 = this.divaBasketHandler.emailConfig) !== null && _this$divaBasketHandl3 !== void 0 ? _this$divaBasketHandl3 : this.getEmailConfig(); //reset the emailConfig
41691
40996
  this.divaBasketHandler.emailConfig = undefined;
@@ -41717,46 +41022,46 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41717
41022
  });
41718
41023
  this.handleSuccessTransaction('onSendEmail', actBasket);
41719
41024
  }
41720
- (_this$actions39 = this.actions) === null || _this$actions39 === void 0 || _this$actions39.onEvent({
41025
+ (_this$actions40 = this.actions) === null || _this$actions40 === void 0 || _this$actions40.onEvent({
41721
41026
  type: 'onAddToBasket',
41722
41027
  data: actBasket.getAsJson()
41723
41028
  });
41724
- return _context29.abrupt("break", 38);
41029
+ return _context28.abrupt("break", 38);
41725
41030
  case 25:
41726
41031
  this.actSet().CatalogData;
41727
- _context29.next = 28;
41032
+ _context28.next = 28;
41728
41033
  return this.api.saveAsProduct(this.sets, actBasket);
41729
41034
  case 28:
41730
- products = _context29.sent;
41035
+ products = _context28.sent;
41731
41036
  this.handleSuccessTransaction('onSaveProduct', actBasket);
41732
- (_this$actions40 = this.actions) === null || _this$actions40 === void 0 || _this$actions40.onEvent({
41037
+ (_this$actions41 = this.actions) === null || _this$actions41 === void 0 || _this$actions41.onEvent({
41733
41038
  type: 'onAddToBasket',
41734
41039
  data: actBasket.getAsJson()
41735
41040
  });
41736
41041
  if (!products) {
41737
- _context29.next = 33;
41042
+ _context28.next = 33;
41738
41043
  break;
41739
41044
  }
41740
- return _context29.abrupt("return", products[0]);
41045
+ return _context28.abrupt("return", products[0]);
41741
41046
  case 33:
41742
41047
  this.handleSuccessTransaction('onAddToBasketCallback', actBasket);
41743
41048
  addToBasketLog = false;
41744
41049
  case 35:
41745
41050
  if (addToBasketLog) this.handleSuccessTransaction('onAddToBasket', actBasket);
41746
- (_this$actions41 = this.actions) === null || _this$actions41 === void 0 || _this$actions41.onEvent({
41051
+ (_this$actions42 = this.actions) === null || _this$actions42 === void 0 || _this$actions42.onEvent({
41747
41052
  type: 'onAddToBasket',
41748
41053
  data: actBasket.getAsJson()
41749
41054
  });
41750
- return _context29.abrupt("break", 38);
41055
+ return _context28.abrupt("break", 38);
41751
41056
  case 38:
41752
- return _context29.abrupt("return");
41057
+ return _context28.abrupt("return");
41753
41058
  case 39:
41754
41059
  case "end":
41755
- return _context29.stop();
41060
+ return _context28.stop();
41756
41061
  }
41757
- }, _callee29, this);
41062
+ }, _callee28, this);
41758
41063
  }));
41759
- function addToBasket(_x71) {
41064
+ function addToBasket(_x70) {
41760
41065
  return _addToBasket.apply(this, arguments);
41761
41066
  }
41762
41067
  return addToBasket;
@@ -41775,8 +41080,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41775
41080
  }, {
41776
41081
  key: "openPDFpostAsEvent",
41777
41082
  value: function openPDFpostAsEvent(mongoDBId) {
41778
- var _this$actions42, _this$actions43, _this$actions44;
41779
- (_this$actions42 = this.actions) === null || _this$actions42 === void 0 || _this$actions42.updateBreadcrumbs({
41083
+ var _this$actions43, _this$actions44, _this$actions45;
41084
+ (_this$actions43 = this.actions) === null || _this$actions43 === void 0 || _this$actions43.updateBreadcrumbs({
41780
41085
  type: 'update',
41781
41086
  param: {
41782
41087
  groupId: 'SHOWROOM',
@@ -41790,7 +41095,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41790
41095
  }
41791
41096
  }
41792
41097
  });
41793
- (_this$actions43 = this.actions) === null || _this$actions43 === void 0 || _this$actions43.updateBreadcrumbs({
41098
+ (_this$actions44 = this.actions) === null || _this$actions44 === void 0 || _this$actions44.updateBreadcrumbs({
41794
41099
  type: 'update',
41795
41100
  param: {
41796
41101
  groupId: 'SHOWROOM',
@@ -41804,7 +41109,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41804
41109
  }
41805
41110
  }
41806
41111
  });
41807
- (_this$actions44 = this.actions) === null || _this$actions44 === void 0 || _this$actions44.openComponent({
41112
+ (_this$actions45 = this.actions) === null || _this$actions45 === void 0 || _this$actions45.openComponent({
41808
41113
  type: 'REPORT',
41809
41114
  parameters: {
41810
41115
  id: mongoDBId
@@ -42024,22 +41329,22 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42024
41329
  }, {
42025
41330
  key: "subscribeToWebPlannerEvents",
42026
41331
  value: function subscribeToWebPlannerEvents() {
42027
- var _this$actions45;
42028
- (_this$actions45 = this.actions) === null || _this$actions45 === void 0 || _this$actions45.subscribeEvents(this.addToBasketEventFunction);
41332
+ var _this$actions46;
41333
+ (_this$actions46 = this.actions) === null || _this$actions46 === void 0 || _this$actions46.subscribeEvents(this.addToBasketEventFunction);
42029
41334
  }
42030
41335
  }, {
42031
41336
  key: "unsubscribeFromWebPlannerEvents",
42032
41337
  value: function unsubscribeFromWebPlannerEvents() {
42033
- var _this$actions46;
42034
- (_this$actions46 = this.actions) === null || _this$actions46 === void 0 || _this$actions46.unSubscribeEvents(this.addToBasketEventFunction);
41338
+ var _this$actions47;
41339
+ (_this$actions47 = this.actions) === null || _this$actions47 === void 0 || _this$actions47.unSubscribeEvents(this.addToBasketEventFunction);
42035
41340
  }
42036
41341
  }, {
42037
41342
  key: "initApiForLogicOnly",
42038
41343
  value: //just for testing purposes
42039
41344
  function () {
42040
- var _initApiForLogicOnly = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee30(organization, lang, getSessionGuid, handler, applicationEnvironment, apiKey, jwt) {
42041
- return _regeneratorRuntime__default["default"].wrap(function _callee30$(_context30) {
42042
- while (1) switch (_context30.prev = _context30.next) {
41345
+ var _initApiForLogicOnly = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee29(organization, lang, getSessionGuid, handler, applicationEnvironment, apiKey, jwt) {
41346
+ return _regeneratorRuntime__default["default"].wrap(function _callee29$(_context29) {
41347
+ while (1) switch (_context29.prev = _context29.next) {
42043
41348
  case 0:
42044
41349
  //empty services
42045
41350
  this.api = new DivaApiHandler(_objectSpread$5(_objectSpread$5({}, this.plannerConfig), {}, {
@@ -42052,17 +41357,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42052
41357
  jwt: jwt,
42053
41358
  apiKey: apiKey
42054
41359
  }), handler);
42055
- _context30.next = 3;
41360
+ _context29.next = 3;
42056
41361
  return this.divaBasketHandler.initWWSClient(this.api.getWWSClient());
42057
41362
  case 3:
42058
41363
  this.plannerHandler = new DivaPlannerHandler(true);
42059
41364
  case 4:
42060
41365
  case "end":
42061
- return _context30.stop();
41366
+ return _context29.stop();
42062
41367
  }
42063
- }, _callee30, this);
41368
+ }, _callee29, this);
42064
41369
  }));
42065
- function initApiForLogicOnly(_x72, _x73, _x74, _x75, _x76, _x77, _x78) {
41370
+ function initApiForLogicOnly(_x71, _x72, _x73, _x74, _x75, _x76, _x77) {
42066
41371
  return _initApiForLogicOnly.apply(this, arguments);
42067
41372
  }
42068
41373
  return initApiForLogicOnly;
@@ -42075,16 +41380,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42075
41380
  }, {
42076
41381
  key: "loadBasket",
42077
41382
  value: function () {
42078
- var _loadBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee31() {
42079
- return _regeneratorRuntime__default["default"].wrap(function _callee31$(_context31) {
42080
- while (1) switch (_context31.prev = _context31.next) {
41383
+ var _loadBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee30() {
41384
+ return _regeneratorRuntime__default["default"].wrap(function _callee30$(_context30) {
41385
+ while (1) switch (_context30.prev = _context30.next) {
42081
41386
  case 0:
42082
- return _context31.abrupt("return", this.divaBasketHandler.initializeBasket(this.api));
41387
+ return _context30.abrupt("return", this.divaBasketHandler.initializeBasket(this.api));
42083
41388
  case 1:
42084
41389
  case "end":
42085
- return _context31.stop();
41390
+ return _context30.stop();
42086
41391
  }
42087
- }, _callee31, this);
41392
+ }, _callee30, this);
42088
41393
  }));
42089
41394
  function loadBasket() {
42090
41395
  return _loadBasket.apply(this, arguments);
@@ -42099,31 +41404,31 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42099
41404
  }, {
42100
41405
  key: "initBasket",
42101
41406
  value: function () {
42102
- var _initBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee32(init3D, ignoreFavorites) {
41407
+ var _initBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee31(init3D, ignoreFavorites) {
42103
41408
  var _initSetState$api$web2;
42104
41409
  var initSetState, sets, result, _sets$, set, basket;
42105
- return _regeneratorRuntime__default["default"].wrap(function _callee32$(_context32) {
42106
- while (1) switch (_context32.prev = _context32.next) {
41410
+ return _regeneratorRuntime__default["default"].wrap(function _callee31$(_context31) {
41411
+ while (1) switch (_context31.prev = _context31.next) {
42107
41412
  case 0:
42108
41413
  this.divaNr = this.divaBasketHandler.actDivaNr;
42109
41414
  initSetState = this.getInitStateForSet(!init3D);
42110
41415
  this.plannerHandler.initPlanner(initSetState, this.getPlannerHandlerFunctions());
42111
- _context32.next = 5;
41416
+ _context31.next = 5;
42112
41417
  return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
42113
41418
  case 5:
42114
- sets = _context32.sent;
41419
+ sets = _context31.sent;
42115
41420
  if (!((_initSetState$api$web2 = initSetState.api.webConfig) !== null && _initSetState$api$web2 !== void 0 && _initSetState$api$web2.checkForProductsPrice)) {
42116
- _context32.next = 12;
41421
+ _context31.next = 12;
42117
41422
  break;
42118
41423
  }
42119
41424
  if (!this.divaBasketHandler.actBasket.OrigProductId) {
42120
- _context32.next = 12;
41425
+ _context31.next = 12;
42121
41426
  break;
42122
41427
  }
42123
- _context32.next = 10;
41428
+ _context31.next = 10;
42124
41429
  return this.divaBasketHandler.getProduct(this.api, this.divaBasketHandler.actBasket.OrigProductId);
42125
41430
  case 10:
42126
- result = _context32.sent;
41431
+ result = _context31.sent;
42127
41432
  if (result) {
42128
41433
  (_sets$ = sets[0]) === null || _sets$ === void 0 || _sets$.remindPriceForHash(result);
42129
41434
  }
@@ -42132,24 +41437,24 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42132
41437
  set = this.actSet();
42133
41438
  setHandlerInstance.loadConfigStructureOfActSet(set, this.getCurPlannerType());
42134
41439
  if (!(favoritesHandlerInstance.FavoritesDefined(set) && !ignoreFavorites)) {
42135
- _context32.next = 17;
41440
+ _context31.next = 17;
42136
41441
  break;
42137
41442
  }
42138
- _context32.next = 17;
41443
+ _context31.next = 17;
42139
41444
  return this.handleFavorites(init3D ? 'CALC' : 'REPAIR');
42140
41445
  case 17:
42141
- _context32.next = 19;
41446
+ _context31.next = 19;
42142
41447
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !init3D, this.doAllowSetPlanner(), this.ReturnTo);
42143
41448
  case 19:
42144
- basket = _context32.sent;
42145
- return _context32.abrupt("return", basket);
41449
+ basket = _context31.sent;
41450
+ return _context31.abrupt("return", basket);
42146
41451
  case 21:
42147
41452
  case "end":
42148
- return _context32.stop();
41453
+ return _context31.stop();
42149
41454
  }
42150
- }, _callee32, this);
41455
+ }, _callee31, this);
42151
41456
  }));
42152
- function initBasket(_x79, _x80) {
41457
+ function initBasket(_x78, _x79) {
42153
41458
  return _initBasket.apply(this, arguments);
42154
41459
  }
42155
41460
  return initBasket;
@@ -42163,21 +41468,21 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42163
41468
  }, {
42164
41469
  key: "getValidVariantsLength",
42165
41470
  value: function () {
42166
- var _getValidVariantsLength = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee33() {
41471
+ var _getValidVariantsLength = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee32() {
42167
41472
  var set;
42168
- return _regeneratorRuntime__default["default"].wrap(function _callee33$(_context33) {
42169
- while (1) switch (_context33.prev = _context33.next) {
41473
+ return _regeneratorRuntime__default["default"].wrap(function _callee32$(_context32) {
41474
+ while (1) switch (_context32.prev = _context32.next) {
42170
41475
  case 0:
42171
41476
  set = this.actSet();
42172
- _context33.next = 3;
41477
+ _context32.next = 3;
42173
41478
  return favoritesHandlerInstance.getValidVariants(set, true);
42174
41479
  case 3:
42175
- return _context33.abrupt("return", _context33.sent.length);
41480
+ return _context32.abrupt("return", _context32.sent.length);
42176
41481
  case 4:
42177
41482
  case "end":
42178
- return _context33.stop();
41483
+ return _context32.stop();
42179
41484
  }
42180
- }, _callee33, this);
41485
+ }, _callee32, this);
42181
41486
  }));
42182
41487
  function getValidVariantsLength() {
42183
41488
  return _getValidVariantsLength.apply(this, arguments);
@@ -42187,46 +41492,46 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42187
41492
  }, {
42188
41493
  key: "handleFavorites",
42189
41494
  value: function () {
42190
- var _handleFavorites = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(mode) {
41495
+ var _handleFavorites = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee33(mode) {
42191
41496
  var _this4 = this;
42192
41497
  var set, i;
42193
- return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context34) {
42194
- while (1) switch (_context34.prev = _context34.next) {
41498
+ return _regeneratorRuntime__default["default"].wrap(function _callee33$(_context33) {
41499
+ while (1) switch (_context33.prev = _context33.next) {
42195
41500
  case 0:
42196
41501
  set = this.actSet();
42197
41502
  i = 0;
42198
41503
  case 2:
42199
41504
  if (!favoritesHandlerInstance.IsCalcForSummary) {
42200
- _context34.next = 11;
41505
+ _context33.next = 11;
42201
41506
  break;
42202
41507
  }
42203
- _context34.next = 5;
41508
+ _context33.next = 5;
42204
41509
  return DivaUtils__default["default"].Sleep(200);
42205
41510
  case 5:
42206
41511
  i++;
42207
41512
  if (!(i > 1000)) {
42208
- _context34.next = 9;
41513
+ _context33.next = 9;
42209
41514
  break;
42210
41515
  }
42211
41516
  LOG$1.error(new DivaUtils.DivaError('error on generating Variants of Summary'));
42212
- return _context34.abrupt("break", 11);
41517
+ return _context33.abrupt("break", 11);
42213
41518
  case 9:
42214
- _context34.next = 2;
41519
+ _context33.next = 2;
42215
41520
  break;
42216
41521
  case 11:
42217
- _context34.next = 13;
41522
+ _context33.next = 13;
42218
41523
  return favoritesHandlerInstance.handleFavorites(set, mode, this.divaBasketHandler.actBasket, this.saveToBasketWrapper.bind(this), this.doConfigure.bind(this), function () {
42219
41524
  return _this4.update2DGrid(set);
42220
41525
  }, this.actions);
42221
41526
  case 13:
42222
- return _context34.abrupt("return", _context34.sent);
41527
+ return _context33.abrupt("return", _context33.sent);
42223
41528
  case 14:
42224
41529
  case "end":
42225
- return _context34.stop();
41530
+ return _context33.stop();
42226
41531
  }
42227
- }, _callee34, this);
41532
+ }, _callee33, this);
42228
41533
  }));
42229
- function handleFavorites(_x81) {
41534
+ function handleFavorites(_x80) {
42230
41535
  return _handleFavorites.apply(this, arguments);
42231
41536
  }
42232
41537
  return handleFavorites;
@@ -42239,48 +41544,48 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42239
41544
  }, {
42240
41545
  key: "initSapOrderLinesFromBasket",
42241
41546
  value: function () {
42242
- var _initSapOrderLinesFromBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee35(divaNr, init3D, onlyLoadOldBakset) {
41547
+ var _initSapOrderLinesFromBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(divaNr, init3D, onlyLoadOldBakset) {
42243
41548
  var result, oldBasket, basket;
42244
- return _regeneratorRuntime__default["default"].wrap(function _callee35$(_context35) {
42245
- while (1) switch (_context35.prev = _context35.next) {
41549
+ return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context34) {
41550
+ while (1) switch (_context34.prev = _context34.next) {
42246
41551
  case 0:
42247
41552
  if (divaNr) this.divaBasketHandler.updateDivaNrInBasket(divaNr);
42248
- _context35.next = 3;
41553
+ _context34.next = 3;
42249
41554
  return this.loadBasket();
42250
41555
  case 3:
42251
- result = _context35.sent;
41556
+ result = _context34.sent;
42252
41557
  if (!onlyLoadOldBakset) {
42253
- _context35.next = 6;
41558
+ _context34.next = 6;
42254
41559
  break;
42255
41560
  }
42256
- return _context35.abrupt("return", {
41561
+ return _context34.abrupt("return", {
42257
41562
  oldBasket: new basketModel.BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket))),
42258
41563
  cache: {}
42259
41564
  });
42260
41565
  case 6:
42261
41566
  if (!(result === false)) {
42262
- _context35.next = 8;
41567
+ _context34.next = 8;
42263
41568
  break;
42264
41569
  }
42265
41570
  throw new Error('Could not load basket! ' + divaNr);
42266
41571
  case 8:
42267
41572
  oldBasket = new basketModel.BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket)));
42268
- _context35.next = 11;
41573
+ _context34.next = 11;
42269
41574
  return this.initBasket(init3D);
42270
41575
  case 11:
42271
- basket = _context35.sent;
42272
- return _context35.abrupt("return", {
41576
+ basket = _context34.sent;
41577
+ return _context34.abrupt("return", {
42273
41578
  basket: basket,
42274
41579
  oldBasket: oldBasket,
42275
41580
  cache: this.api.getJsonDataCache()
42276
41581
  });
42277
41582
  case 13:
42278
41583
  case "end":
42279
- return _context35.stop();
41584
+ return _context34.stop();
42280
41585
  }
42281
- }, _callee35, this);
41586
+ }, _callee34, this);
42282
41587
  }));
42283
- function initSapOrderLinesFromBasket(_x82, _x83, _x84) {
41588
+ function initSapOrderLinesFromBasket(_x81, _x82, _x83) {
42284
41589
  return _initSapOrderLinesFromBasket.apply(this, arguments);
42285
41590
  }
42286
41591
  return initSapOrderLinesFromBasket;
@@ -42305,6 +41610,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42305
41610
  }
42306
41611
  return undefined;
42307
41612
  }
41613
+ }, {
41614
+ key: "setsAsArray",
41615
+ get: function get() {
41616
+ return Object.values(this.sets);
41617
+ }
42308
41618
 
42309
41619
  /**
42310
41620
  * This function returns the planner mode.
@@ -60238,7 +59548,7 @@ var ProductHandler = /*#__PURE__*/function () {
60238
59548
  }, {
60239
59549
  key: "isSameProduct",
60240
59550
  value: function isSameProduct(product, setHash, diva3dProject, orderLines, varinatData, catalogCodex) {
60241
- var _product$articles;
59551
+ var _product$articles, _product$configuratio, _product$configuratio2;
60242
59552
  //For new products we store the setHash and hqRenderScript in order to determine if the product changed.
60243
59553
  if (product.uniqueHash !== undefined) {
60244
59554
  return product.uniqueHash === 'v1' + setHash + DivaUtils.md5(diva3dProject);
@@ -60249,22 +59559,22 @@ var ProductHandler = /*#__PURE__*/function () {
60249
59559
  return false;
60250
59560
  }
60251
59561
  //For older products without setHash we use the old comparison logic
59562
+ var orderlines = (_product$configuratio = (_product$configuratio2 = product.configuration) === null || _product$configuratio2 === void 0 || (_product$configuratio2 = _product$configuratio2.OrderSets) === null || _product$configuratio2 === void 0 ? void 0 : _product$configuratio2[0].OrderLines) !== null && _product$configuratio !== void 0 ? _product$configuratio : [];
60252
59563
  var _loop = function _loop() {
60253
- var _article$variantValue;
60254
- var article = product.articles[i];
59564
+ var article = orderlines[i];
60255
59565
  var orderLine = orderLines.find(function (ol) {
60256
- return ol.ArticleCodex == article.articleCodex && catalogCodex == article.catalogCodex;
59566
+ return ol.ArticleCodex == article.ArticleCodex && catalogCodex == article.CatalogCodex;
60257
59567
  });
60258
- if (!orderLine || ((_article$variantValue = article.variantValues) === null || _article$variantValue === void 0 ? void 0 : _article$variantValue.length) != (varinatData === null || varinatData === void 0 ? void 0 : varinatData.length)) {
59568
+ if (!orderLine) {
60259
59569
  return {
60260
59570
  v: false
60261
59571
  };
60262
59572
  }
60263
59573
  var _loop2 = function _loop2() {
60264
- var varinatValue = article.variantValues[j];
60265
- if (!(varinatData !== null && varinatData !== void 0 && varinatData.find(function (vb) {
59574
+ var varinatValue = article.VariantBasketDatas[j];
59575
+ if (!varinatData.find(function (vb) {
60266
59576
  return vb.OPT == varinatValue['OPT'] && vb.OPV == varinatValue['OPV'];
60267
- }))) {
59577
+ })) {
60268
59578
  return {
60269
59579
  v: {
60270
59580
  v: false
@@ -60273,14 +59583,14 @@ var ProductHandler = /*#__PURE__*/function () {
60273
59583
  }
60274
59584
  },
60275
59585
  _ret2;
60276
- for (var j = 0; j < (((_article$variantValue2 = article.variantValues) === null || _article$variantValue2 === void 0 ? void 0 : _article$variantValue2.length) || 0); j++) {
60277
- var _article$variantValue2;
59586
+ for (var j = 0; j < (((_article$VariantBaske = article.VariantBasketDatas) === null || _article$VariantBaske === void 0 ? void 0 : _article$VariantBaske.length) || 0); j++) {
59587
+ var _article$VariantBaske;
60278
59588
  _ret2 = _loop2();
60279
59589
  if (_ret2) return _ret2.v;
60280
59590
  }
60281
59591
  },
60282
59592
  _ret;
60283
- for (var i = 0; i < product.articles.length; i++) {
59593
+ for (var i = 0; i < orderlines.length; i++) {
60284
59594
  _ret = _loop();
60285
59595
  if (_ret) return _ret.v;
60286
59596
  }
@@ -60820,7 +60130,6 @@ exports.DockingPoint = DockingPoint;
60820
60130
  exports.Grid = Grid;
60821
60131
  exports.HQRenderScript = HQRenderScript;
60822
60132
  exports.OptionCatalogData = OptionCatalogData;
60823
- exports.Product = Product;
60824
60133
  exports.Rendering = Rendering;
60825
60134
  exports.Vector2 = Vector2;
60826
60135
  exports.Vector3 = Vector3;
@@ -60829,6 +60138,5 @@ exports.articleHandlerInstance = articleHandlerInstance;
60829
60138
  exports.creatRenderOrders = creatRenderOrders;
60830
60139
  exports.getOrigProductId = getOrigProductId;
60831
60140
  exports.loadAndRepairBasket = loadAndRepairBasket;
60832
- exports.productHandlerInstance = productHandlerInstance;
60833
60141
  exports.setHandlerInstance = setHandlerInstance;
60834
60142
  exports.summaryHandlerInstance = summaryHandlerInstance;