@crystaldesign/web-planner-logic 26.12.0-beta.37 → 26.12.0-beta.39

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 (46) hide show
  1. package/build/cjs/{DivaBoxPlanner-ed84f911.js → DivaBoxPlanner-eb204f64.js} +2 -2
  2. package/build/cjs/{DivaStandardPlanner-2f156ac4.js → DivaStandardPlanner-024a707c.js} +2 -2
  3. package/build/cjs/{DoorPlanner-1f12ae12.js → DoorPlanner-5fb30a3b.js} +1 -1
  4. package/build/cjs/{Host3DSignalR-7631b06e.js → Host3DSignalR-053d1f70.js} +1 -1
  5. package/build/cjs/{LiviqueWWSHandler-b25309a0.js → LiviqueWWSHandler-010c4674.js} +1 -1
  6. package/build/cjs/{PfisterWWSHandler-3f044082.js → PfisterWWSHandler-028180d3.js} +1 -1
  7. package/build/cjs/{PlannerHandler2D-790dc424.js → PlannerHandler2D-3641e717.js} +1 -1
  8. package/build/cjs/{SeriousBasketHandler-e81c3ce0.js → SeriousBasketHandler-ce8059dd.js} +1 -1
  9. package/build/cjs/{ShelfPlanner-9deb02f0.js → ShelfPlanner-61795dcc.js} +1 -1
  10. package/build/cjs/{StandardWWSHandler-35a5cd86.js → StandardWWSHandler-45060aea.js} +1 -1
  11. package/build/cjs/{index-617f37df.js → index-92b3f811.js} +177 -83
  12. package/build/cjs/index.js +1 -1
  13. package/build/esm/{DivaBoxPlanner-497f920b.js → DivaBoxPlanner-e87a4462.js} +2 -2
  14. package/build/esm/{DivaStandardPlanner-02829820.js → DivaStandardPlanner-d24209f4.js} +2 -2
  15. package/build/esm/{DoorPlanner-bcee08d0.js → DoorPlanner-1664243f.js} +1 -1
  16. package/build/esm/{Host3DSignalR-a1aae6ae.js → Host3DSignalR-746d0063.js} +1 -1
  17. package/build/esm/{LiviqueWWSHandler-1fffea90.js → LiviqueWWSHandler-7326190a.js} +1 -1
  18. package/build/esm/{PfisterWWSHandler-44c23ccb.js → PfisterWWSHandler-9219a61d.js} +1 -1
  19. package/build/esm/{PlannerHandler2D-d38ac865.js → PlannerHandler2D-3367fa6b.js} +1 -1
  20. package/build/esm/{SeriousBasketHandler-a7290ac4.js → SeriousBasketHandler-da02a5b3.js} +1 -1
  21. package/build/esm/{ShelfPlanner-f9466ab6.js → ShelfPlanner-f35a2bb8.js} +1 -1
  22. package/build/esm/{StandardWWSHandler-a90fe0e2.js → StandardWWSHandler-b166bb90.js} +1 -1
  23. package/build/esm/{index-dc4616aa.js → index-90706aea.js} +177 -83
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts +1 -0
  26. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/logic/Article/ArticleOptionState.d.ts +1 -0
  28. package/build/types/web-planner-logic/src/logic/Article/ArticleOptionState.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts.map +1 -1
  30. package/build/types/web-planner-logic/src/logic/Article/DivaArticleHandler.d.ts +8 -3
  31. package/build/types/web-planner-logic/src/logic/Article/DivaArticleHandler.d.ts.map +1 -1
  32. package/build/types/web-planner-logic/src/logic/Article/Engine/IDMArticleEngine.d.ts +5 -8
  33. package/build/types/web-planner-logic/src/logic/Article/Engine/IDMArticleEngine.d.ts.map +1 -1
  34. package/build/types/web-planner-logic/src/logic/Article/measureUnit.d.ts +5 -0
  35. package/build/types/web-planner-logic/src/logic/Article/measureUnit.d.ts.map +1 -0
  36. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts +1 -0
  38. package/build/types/web-planner-logic/src/model/Catalog/CatalogData.d.ts.map +1 -1
  39. package/build/types/web-planner-logic/src/model/Catalog/IDMCatalogData.d.ts.map +1 -1
  40. package/build/types/web-planner-logic/src/model/Options/ArticleOptionValueData.d.ts +1 -0
  41. package/build/types/web-planner-logic/src/model/Options/ArticleOptionValueData.d.ts.map +1 -1
  42. package/build/types/web-planner-logic/src/model/Options/CatalogOptionValueData.d.ts +3 -0
  43. package/build/types/web-planner-logic/src/model/Options/CatalogOptionValueData.d.ts.map +1 -1
  44. package/build/types/web-planner-logic/src/test/idmMeasureUnit.test.d.ts +2 -0
  45. package/build/types/web-planner-logic/src/test/idmMeasureUnit.test.d.ts.map +1 -0
  46. package/package.json +3 -3
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-617f37df.js');
5
+ var index = require('./index-92b3f811.js');
6
6
  var planner2dCore = require('@crystaldesign/planner-2d-core');
7
7
  require('@babel/runtime/helpers/slicedToArray');
8
8
  require('@babel/runtime/helpers/asyncToGenerator');
@@ -3,11 +3,11 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
3
3
  import _createClass from '@babel/runtime/helpers/createClass';
4
4
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
5
5
  import _regeneratorRuntime from '@babel/runtime/regenerator';
6
- import { c as Vector2, V as Vector3, P as PlannerElementData, B as BoundingBox } from './index-dc4616aa.js';
6
+ import { c as Vector2, V as Vector3, P as PlannerElementData, B as BoundingBox } from './index-90706aea.js';
7
7
  import DivaUtils, { DivaError, md5 } from '@crystaldesign/diva-utils';
8
8
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
9
9
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
10
- import { d as dockingPointHandlerInst, h as handler2D } from './PlannerHandler2D-d38ac865.js';
10
+ import { d as dockingPointHandlerInst, h as handler2D } from './PlannerHandler2D-3367fa6b.js';
11
11
  import '@babel/runtime/helpers/objectWithoutProperties';
12
12
  import 'axios';
13
13
  import '@crystaldesign/planner-2d-core';
@@ -4,10 +4,10 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
4
4
  import _createClass from '@babel/runtime/helpers/createClass';
5
5
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
6
6
  import _regeneratorRuntime from '@babel/runtime/regenerator';
7
- import { V as Vector3, P as PlannerElementData, B as BoundingBox } from './index-dc4616aa.js';
7
+ import { V as Vector3, P as PlannerElementData, B as BoundingBox } from './index-90706aea.js';
8
8
  import DivaUtils, { DivaError, md5 } from '@crystaldesign/diva-utils';
9
9
  import { computeDockedTransform } from '@crystaldesign/planner-2d-core';
10
- import { d as dockingPointHandlerInst, h as handler2D } from './PlannerHandler2D-d38ac865.js';
10
+ import { d as dockingPointHandlerInst, h as handler2D } from './PlannerHandler2D-3367fa6b.js';
11
11
  import '@babel/runtime/helpers/slicedToArray';
12
12
  import '@babel/runtime/helpers/objectWithoutProperties';
13
13
  import 'axios';
@@ -1,7 +1,7 @@
1
1
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
2
2
  import _createClass from '@babel/runtime/helpers/createClass';
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
- import './index-dc4616aa.js';
4
+ import './index-90706aea.js';
5
5
  import DivaUtils from '@crystaldesign/diva-utils';
6
6
  import '@babel/runtime/helpers/slicedToArray';
7
7
  import '@babel/runtime/helpers/asyncToGenerator';
@@ -3,7 +3,7 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
3
3
  import _createClass from '@babel/runtime/helpers/createClass';
4
4
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
5
5
  import _regeneratorRuntime from '@babel/runtime/regenerator';
6
- import { d as bootMark, R as Rendering, H as HQRenderScript } from './index-dc4616aa.js';
6
+ import { d as bootMark, R as Rendering, H as HQRenderScript } from './index-90706aea.js';
7
7
  import DivaUtils, { DivaError } from '@crystaldesign/diva-utils';
8
8
  import { HubConnectionBuilder, LogLevel } from '@microsoft/signalr';
9
9
  import io from 'socket.io-client';
@@ -1,6 +1,6 @@
1
1
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
2
2
  import _createClass from '@babel/runtime/helpers/createClass';
3
- import './index-dc4616aa.js';
3
+ import './index-90706aea.js';
4
4
  import '@babel/runtime/helpers/slicedToArray';
5
5
  import '@babel/runtime/helpers/asyncToGenerator';
6
6
  import '@babel/runtime/helpers/defineProperty';
@@ -1,6 +1,6 @@
1
1
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
2
2
  import _createClass from '@babel/runtime/helpers/createClass';
3
- import { a as articleHandlerInstance } from './index-dc4616aa.js';
3
+ import { a as articleHandlerInstance } from './index-90706aea.js';
4
4
  import { SAPOrderLineData } from '@crystaldesign/basket-model';
5
5
  import DivaUtils, { DivaError } from '@crystaldesign/diva-utils';
6
6
  import '@babel/runtime/helpers/slicedToArray';
@@ -3,7 +3,7 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
3
3
  import _createClass from '@babel/runtime/helpers/createClass';
4
4
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
5
5
  import _regeneratorRuntime from '@babel/runtime/regenerator';
6
- import { c as Vector2, S as SVGUtils } from './index-dc4616aa.js';
6
+ import { c as Vector2, S as SVGUtils } from './index-90706aea.js';
7
7
  import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn';
8
8
  import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
9
9
  import _get from '@babel/runtime/helpers/get';
@@ -1,7 +1,7 @@
1
1
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
2
2
  import _createClass from '@babel/runtime/helpers/createClass';
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
- import { s as summaryHandlerInstance } from './index-dc4616aa.js';
4
+ import { s as summaryHandlerInstance } from './index-90706aea.js';
5
5
  import DivaUtils from '@crystaldesign/diva-utils';
6
6
  import '@babel/runtime/helpers/slicedToArray';
7
7
  import '@babel/runtime/helpers/asyncToGenerator';
@@ -4,7 +4,7 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
4
4
  import _createClass from '@babel/runtime/helpers/createClass';
5
5
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
6
6
  import _regeneratorRuntime from '@babel/runtime/regenerator';
7
- import { G as Grid, a as articleHandlerInstance, b as setHandlerInstance } from './index-dc4616aa.js';
7
+ import { G as Grid, a as articleHandlerInstance, b as setHandlerInstance } from './index-90706aea.js';
8
8
  import DivaUtils, { DivaError } from '@crystaldesign/diva-utils';
9
9
  import '@babel/runtime/helpers/slicedToArray';
10
10
  import '@babel/runtime/helpers/objectWithoutProperties';
@@ -1,6 +1,6 @@
1
1
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
2
2
  import _createClass from '@babel/runtime/helpers/createClass';
3
- import './index-dc4616aa.js';
3
+ import './index-90706aea.js';
4
4
  import '@babel/runtime/helpers/slicedToArray';
5
5
  import '@babel/runtime/helpers/asyncToGenerator';
6
6
  import '@babel/runtime/helpers/defineProperty';
@@ -16922,6 +16922,51 @@ var ralClassics = [{
16922
16922
  rgb: '#7E8182'
16923
16923
  }];
16924
16924
 
16925
+ /** IDM length units (UN/ECE rec. 20) to centimetres; 'MT' is the engine's old alias. */
16926
+ var TO_CENTIMETERS = {
16927
+ MMT: function MMT(value) {
16928
+ return value / 10;
16929
+ },
16930
+ CMT: function CMT(value) {
16931
+ return value;
16932
+ },
16933
+ DMT: function DMT(value) {
16934
+ return value * 10;
16935
+ },
16936
+ MTR: function MTR(value) {
16937
+ return value * 100;
16938
+ },
16939
+ INH: function INH(value) {
16940
+ return value * 2.54;
16941
+ },
16942
+ MT: function MT(value) {
16943
+ return value * 10;
16944
+ }
16945
+ };
16946
+
16947
+ /** The IDM code for a unit written the SI way (mm, cm, dm, m, in; any case), or the unit as given. */
16948
+ var IDM_CODE_OF_SI_UNIT = {
16949
+ MM: 'MMT',
16950
+ CM: 'CMT',
16951
+ DM: 'DMT',
16952
+ M: 'MTR',
16953
+ IN: 'INH'
16954
+ };
16955
+
16956
+ /** An IDM option unit as its UN/ECE code: 'mm' and 'mmt' become 'MMT'; anything else is returned unchanged. */
16957
+ function idmMeasureUnit(unit) {
16958
+ if (typeof unit !== 'string') return unit;
16959
+ var upper = unit.trim().toUpperCase();
16960
+ if (Object.prototype.hasOwnProperty.call(TO_CENTIMETERS, upper)) return upper;
16961
+ return Object.prototype.hasOwnProperty.call(IDM_CODE_OF_SI_UNIT, upper) ? IDM_CODE_OF_SI_UNIT[upper] : unit;
16962
+ }
16963
+
16964
+ /** An option's measure in centimetres; a missing or unknown unit counts as centimetres. */
16965
+ function measureInCentimeters(value, unit) {
16966
+ if (!unit || !Object.prototype.hasOwnProperty.call(TO_CENTIMETERS, unit)) return value;
16967
+ return TO_CENTIMETERS[unit](value);
16968
+ }
16969
+
16925
16970
  var LOG$p = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
16926
16971
  var OptionValueCatalogData = /*#__PURE__*/function () {
16927
16972
  function OptionValueCatalogData(opv, catalogData) {
@@ -16929,6 +16974,7 @@ var OptionValueCatalogData = /*#__PURE__*/function () {
16929
16974
  _this$opv$property;
16930
16975
  _classCallCheck(this, OptionValueCatalogData);
16931
16976
  _defineProperty(this, "opv", void 0);
16977
+ _defineProperty(this, "isIDMFormat", void 0);
16932
16978
  /**
16933
16979
  * this function mapps the ral colors to color groups for the color filtering
16934
16980
  * @returns
@@ -16982,6 +17028,7 @@ var OptionValueCatalogData = /*#__PURE__*/function () {
16982
17028
  return undefined;
16983
17029
  });
16984
17030
  this.opv = opv;
17031
+ this.isIDMFormat = !!catalogData.isIDMFormat;
16985
17032
  if (opv.imagePaletteColor) {
16986
17033
  this.opv.colorGroups = [opv.imagePaletteColor];
16987
17034
  } else {
@@ -17101,6 +17148,12 @@ var OptionValueCatalogData = /*#__PURE__*/function () {
17101
17148
  var _this$opv$propertyObj2;
17102
17149
  return (_this$opv$propertyObj2 = this.opv.propertyObj.measureUnit) !== null && _this$opv$propertyObj2 !== void 0 ? _this$opv$propertyObj2 : this.opv.measureUnit;
17103
17150
  }
17151
+ /** The unit to convert by: an IDM unit as its UN/ECE code ('mm' is MMT); `measureUnit` stays as written for labels and export. */
17152
+ }, {
17153
+ key: "measureUnitCode",
17154
+ get: function get() {
17155
+ return this.isIDMFormat ? idmMeasureUnit(this.measureUnit) : this.measureUnit;
17156
+ }
17104
17157
  }, {
17105
17158
  key: "measureMinimum",
17106
17159
  get: function get() {
@@ -19060,6 +19113,11 @@ var ArticleOptionValueData = /*#__PURE__*/function () {
19060
19113
  get: function get() {
19061
19114
  return this.opv.catalogOPV.measureUnit;
19062
19115
  }
19116
+ }, {
19117
+ key: "measureUnitCode",
19118
+ get: function get() {
19119
+ return this.opv.catalogOPV.measureUnitCode;
19120
+ }
19063
19121
  }, {
19064
19122
  key: "measureMinimum",
19065
19123
  get: function get() {
@@ -21989,6 +22047,7 @@ function initIDMCatalogData(serie, orderSet, api) {
21989
22047
  //digits: json.Digits,
21990
22048
  supplierILN: catalog.glnNo,
21991
22049
  // SupplierILN des Herstellers des Katalogs
22050
+ supplierName: catalog.manufacturerName1,
21992
22051
  rounding: catalog.roundingType,
21993
22052
  optionGroups: catalog.optionGroups,
21994
22053
  formulas: catalog.formulas,
@@ -22834,6 +22893,11 @@ var DivaCatalogData = /*#__PURE__*/function () {
22834
22893
  get: function get() {
22835
22894
  return this.catalogData.supplierILN;
22836
22895
  }
22896
+ }, {
22897
+ key: "supplierName",
22898
+ get: function get() {
22899
+ return this.catalogData.supplierName;
22900
+ }
22837
22901
  }, {
22838
22902
  key: "retailArticleNr",
22839
22903
  get: function get() {
@@ -25001,12 +25065,9 @@ var ArticleOptionStateData = /*#__PURE__*/function () {
25001
25065
  }, {
25002
25066
  key: "value",
25003
25067
  get: function get() {
25004
- var _this$val11, _this$val12;
25068
+ var _this$val11;
25005
25069
  if (!((_this$val11 = this.val) !== null && _this$val11 !== void 0 && _this$val11.value)) return undefined;
25006
- if (this.val.measureUnit == 'MMT') return this.val.value / 10;
25007
- if (this.val.measureUnit == 'CMT') return this.val.value;
25008
- if (this.val.measureUnit == 'MT') return this.val.value * 10;
25009
- return (_this$val12 = this.val) === null || _this$val12 === void 0 ? void 0 : _this$val12.value;
25070
+ return measureInCentimeters(this.val.value, this.val.measureUnitCode);
25010
25071
  }
25011
25072
  }, {
25012
25073
  key: "vCodex",
@@ -25034,8 +25095,8 @@ var ArticleOptionStateData = /*#__PURE__*/function () {
25034
25095
  get: function get() {
25035
25096
  if (this.articleOptionState.retailArticleNr) return this.articleOptionState.retailArticleNr;
25036
25097
  if (this.articleOptionState.option.articlePlaceholder) {
25037
- var _this$val13;
25038
- return (_this$val13 = this.val) === null || _this$val13 === void 0 ? void 0 : _this$val13.subRetailArticleNr;
25098
+ var _this$val12;
25099
+ return (_this$val12 = this.val) === null || _this$val12 === void 0 ? void 0 : _this$val12.subRetailArticleNr;
25039
25100
  }
25040
25101
  return undefined;
25041
25102
  },
@@ -25058,8 +25119,8 @@ var ArticleOptionStateData = /*#__PURE__*/function () {
25058
25119
  }, {
25059
25120
  key: "visibleInSummary",
25060
25121
  value: function visibleInSummary(aritcle, summaryForBasket) {
25061
- var _this$val14, _this$val15;
25062
- return (!this.isInvisible || summaryForBasket && !this.invisibleWithoutMaskeInfluence) && (this.selectionmode != 0 || (this.visibleCount > 1 || this.isFreeText) && aritcle.set.api.showSelectionModeZero()) && this.isDoShow && !((_this$val14 = this.val) !== null && _this$val14 !== void 0 && _this$val14.isNotRelevant) && !this.isHiddenByDefaultValueForOptions(aritcle, summaryForBasket) && !((_this$val15 = this.val) !== null && _this$val15 !== void 0 && _this$val15.hideInSummary);
25122
+ var _this$val13, _this$val14;
25123
+ return (!this.isInvisible || summaryForBasket && !this.invisibleWithoutMaskeInfluence) && (this.selectionmode != 0 || (this.visibleCount > 1 || this.isFreeText) && aritcle.set.api.showSelectionModeZero()) && this.isDoShow && !((_this$val13 = this.val) !== null && _this$val13 !== void 0 && _this$val13.isNotRelevant) && !this.isHiddenByDefaultValueForOptions(aritcle, summaryForBasket) && !((_this$val14 = this.val) !== null && _this$val14 !== void 0 && _this$val14.hideInSummary);
25063
25124
  }
25064
25125
  }, {
25065
25126
  key: "isHiddenByDefaultValueForOptions",
@@ -25081,20 +25142,26 @@ var ArticleOptionStateData = /*#__PURE__*/function () {
25081
25142
  }, {
25082
25143
  key: "subArticleCodex",
25083
25144
  get: function get() {
25084
- var _this$val16;
25085
- return (_this$val16 = this.val) === null || _this$val16 === void 0 ? void 0 : _this$val16.subArticleCodex;
25145
+ var _this$val15;
25146
+ return (_this$val15 = this.val) === null || _this$val15 === void 0 ? void 0 : _this$val15.subArticleCodex;
25086
25147
  }
25087
25148
  }, {
25088
25149
  key: "subArticleName",
25089
25150
  get: function get() {
25090
- var _this$val17;
25091
- return (_this$val17 = this.val) === null || _this$val17 === void 0 ? void 0 : _this$val17.subArticleName;
25151
+ var _this$val16;
25152
+ return (_this$val16 = this.val) === null || _this$val16 === void 0 ? void 0 : _this$val16.subArticleName;
25092
25153
  }
25093
25154
  }, {
25094
25155
  key: "measureUnit",
25156
+ get: function get() {
25157
+ var _this$val17;
25158
+ return (_this$val17 = this.val) === null || _this$val17 === void 0 ? void 0 : _this$val17.measureUnit;
25159
+ }
25160
+ }, {
25161
+ key: "measureUnitCode",
25095
25162
  get: function get() {
25096
25163
  var _this$val18;
25097
- return (_this$val18 = this.val) === null || _this$val18 === void 0 ? void 0 : _this$val18.measureUnit;
25164
+ return (_this$val18 = this.val) === null || _this$val18 === void 0 ? void 0 : _this$val18.measureUnitCode;
25098
25165
  }
25099
25166
  }, {
25100
25167
  key: "priceUnit",
@@ -28326,11 +28393,11 @@ var IDMEngine = /*#__PURE__*/function () {
28326
28393
  if (!formula) throw new Error('formula ' + action.formulaRef.formulaKey + ' not found in catalog but used in decision: ' + decision.decisionNo);
28327
28394
  var freeText = this.evalMeasureFormula(formula);
28328
28395
  if (option) {
28329
- this.updateArtOPV(option, action.featureNo.toString(), _ops2, freeText, true);
28396
+ this.updateArtOPV(option, action.featureNo.toString(), _ops2, freeText, freeText ? Number(freeText) : undefined);
28330
28397
  }
28331
28398
  } else if (action.featureRef) {
28332
28399
  var _ops3 = this.article.getArticleOptionState(action.featureRef.featureNo);
28333
- if (_ops3 !== null && _ops3 !== void 0 && _ops3.valCodex) this.assignOptionValue(action.featureNo.toString(), _ops3.valCodex, 'default');
28400
+ if (_ops3 !== null && _ops3 !== void 0 && _ops3.valCodex) this.assignOptionValue(action.featureNo.toString(), _ops3.valCodex, 'default', _ops3);
28334
28401
  } else if (action.optionRef) {
28335
28402
  this.assignOptionValue(action.featureNo.toString(), action.optionRef.optionKey, 'default');
28336
28403
  } else {
@@ -28367,7 +28434,7 @@ var IDMEngine = /*#__PURE__*/function () {
28367
28434
  if (!formula) throw new Error('formula ' + action.formulaRef.formulaKey + ' not found in catalog but used in decision: ' + decision.decisionNo);
28368
28435
  var freeText = this.evalMeasureFormula(formula);
28369
28436
  if (option) {
28370
- this.updateArtOPV(option, action.featureNo.toString(), ops, freeText, true);
28437
+ this.updateArtOPV(option, action.featureNo.toString(), ops, freeText, freeText ? Number(freeText) : undefined);
28371
28438
  }
28372
28439
  } else if (action.featureRef) {
28373
28440
  var _ops4 = this.article.getArticleOptionState(action.featureRef.featureNo);
@@ -28390,7 +28457,8 @@ var IDMEngine = /*#__PURE__*/function () {
28390
28457
  } else if (!targetHasSourceValue) {
28391
28458
  LOG$g.warn('evalSetFeature(featureRef) decision ' + decision.decisionNo + ': target feature ' + action.featureNo + ' does not have source feature ' + action.featureRef.featureNo + "'s value '" + _ops4.valCodex + "' among its visible option values - assignOptionValue will be a no-op (price relevant). Target visible values: " + (targetOps ? Array.from(targetOps.visibleOptionValues.keys()).join(', ') : '<no target>'));
28392
28459
  }
28393
- if (_ops4 !== null && _ops4 !== void 0 && _ops4.valCodex) this.assignOptionValue(action.featureNo.toString(), _ops4.valCodex, isFixed ? 'fix' : 'set');
28460
+ // The typed number travels with the option key, or the target shows the option without the user's entry.
28461
+ if (_ops4 !== null && _ops4 !== void 0 && _ops4.valCodex) this.assignOptionValue(action.featureNo.toString(), _ops4.valCodex, isFixed ? 'fix' : 'set', _ops4);
28394
28462
  } else if (action.optionRef) {
28395
28463
  this.assignOptionValue(action.featureNo.toString(), action.optionRef.optionKey, isFixed ? 'fix' : 'set');
28396
28464
  } else {
@@ -28403,25 +28471,30 @@ var IDMEngine = /*#__PURE__*/function () {
28403
28471
  _iterator19.f();
28404
28472
  }
28405
28473
  }
28474
+
28475
+ /** Selects an option on a feature; a FEATURE_REF passes its `source`, whose typed text and formula measure (cm) come along. */
28406
28476
  }, {
28407
28477
  key: "assignOptionValue",
28408
- value: function assignOptionValue(featureNo, optionNo, setBy, freeText) {
28478
+ value: function assignOptionValue(featureNo, optionNo, setBy, source) {
28409
28479
  var ops = this.article.getArticleOptionState(featureNo);
28410
28480
  if (!ops) throw new Error('myOptionState ' + featureNo + ' is undefined');
28411
28481
  var option = ops.visibleOptionValues.get(optionNo);
28412
28482
  if (option) {
28483
+ var _source$freeText;
28413
28484
  if (setBy == 'fix') ops.definedBySetFeatureFixed = true;
28414
28485
  ops.valueWasSet = true;
28415
- this.updateArtOPV(option, featureNo, ops, freeText);
28486
+ if (source) ops.measureValue = undefined;
28487
+ var freeText = source !== null && source !== void 0 && source.isFreeText ? (_source$freeText = source.freeText) !== null && _source$freeText !== void 0 ? _source$freeText : null : undefined;
28488
+ this.updateArtOPV(option, featureNo, ops, freeText, source === null || source === void 0 ? void 0 : source.measureValue);
28416
28489
  }
28417
28490
  }
28418
28491
  }, {
28419
28492
  key: "updateArtOPV",
28420
- value: function updateArtOPV(myItem, featureNo, ops, freeText, byFormula) {
28493
+ value: function updateArtOPV(myItem, featureNo, ops, freeText, measureValue) {
28421
28494
  // myItem - OPV Objekt und speichert es bei Option
28422
28495
 
28423
28496
  if (myItem) {
28424
- ops = this.setOP(featureNo, myItem, freeText, false, byFormula);
28497
+ ops = this.setOP(featureNo, myItem, freeText, false, measureValue);
28425
28498
  //wenn manuell gesetzte Option auf eine Regel basiert, isInherited auch bei abhängige Optionen setzten
28426
28499
  } else {
28427
28500
  this.clearOP(featureNo);
@@ -28658,7 +28731,7 @@ var IDMEngine = /*#__PURE__*/function () {
28658
28731
  }
28659
28732
  }, {
28660
28733
  key: "setOP",
28661
- value: function setOP(featureNo, option, freeText, doDefine, byFormula) {
28734
+ value: function setOP(featureNo, option, freeText, doDefine, measureValue) {
28662
28735
  var myArtOPS = this.article.getArticleOptionState(featureNo);
28663
28736
  if (!myArtOPS) {
28664
28737
  LOG$g.error(new DivaError('FeautureNo: ' + featureNo + ' in articleCodex: ' + this.article.articleCodex + ' not found!'));
@@ -28687,6 +28760,9 @@ var IDMEngine = /*#__PURE__*/function () {
28687
28760
  }
28688
28761
  myArtOPS.isVisibleFreeText = true;
28689
28762
  } else {
28763
+ // IDM values without OPTION_FREE_TEXT carry isFreeText undefined, which the option state's own reset (== false) misses
28764
+ myArtOPS.freeText = undefined;
28765
+ myArtOPS.freeTextLang = undefined;
28690
28766
  myArtOPS.isVisibleFreeText = false;
28691
28767
  }
28692
28768
  var _this$optionStateText = this.optionStateText(option, myArtOPS.freeText),
@@ -28694,8 +28770,8 @@ var IDMEngine = /*#__PURE__*/function () {
28694
28770
  origName = _this$optionStateText.origName;
28695
28771
  myArtOPS.name = name;
28696
28772
  myArtOPS.origName = origName;
28697
- if (byFormula && freeText) {
28698
- myArtOPS.measureValue = isNaN(Number(freeText)) ? undefined : Number(freeText);
28773
+ if (measureValue !== undefined) {
28774
+ myArtOPS.measureValue = isNaN(measureValue) ? undefined : measureValue;
28699
28775
  }
28700
28776
  return myArtOPS;
28701
28777
  }
@@ -29370,20 +29446,14 @@ var IDMEngine = /*#__PURE__*/function () {
29370
29446
  return null;
29371
29447
  }
29372
29448
 
29373
- /**
29374
- * FreeText holds the raw typed/slider string with NO unit conversion (unlike the `value` getter,
29375
- * which converts per `measureUnit`), so a Planungsbreite freetext of "25600" MMT must become
29376
- * 2560 cm here — mirrors the `value` getter's conversion table.
29377
- */
29449
+ /** The typed freetext is not unit-converted like `value`: "25600" MMT must become 2560 cm here. */
29378
29450
  }, {
29379
29451
  key: "freeTextMeasureCm",
29380
29452
  value: function freeTextMeasureCm(ops) {
29381
29453
  if (ops.freeText == null || ops.freeText === '') return undefined;
29382
29454
  var n = Number(ops.freeText);
29383
29455
  if (!Number.isFinite(n)) return undefined;
29384
- if (ops.measureUnit == 'MMT') return n / 10;
29385
- if (ops.measureUnit == 'MT') return n * 10;
29386
- return n;
29456
+ return measureInCentimeters(n, ops.measureUnitCode);
29387
29457
  }
29388
29458
  }, {
29389
29459
  key: "evalMeasureFormula",
@@ -30760,9 +30830,14 @@ var DivaArticle = /*#__PURE__*/function () {
30760
30830
  _step6;
30761
30831
  try {
30762
30832
  for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
30763
- var _ops$value;
30833
+ var _ops$freeText, _ops$value;
30764
30834
  var ops = _step6.value;
30765
- if (ops.option.measureKey == measureKey) return (_ops$value = ops.value) !== null && _ops$value !== void 0 ? _ops$value : ops.valueFromName;
30835
+ if (ops.option.measureKey != measureKey) continue;
30836
+ // a formula result is already cm; a typed number is in the option's unit and outranks the option's default measure
30837
+ if (ops.measureValue !== undefined) return ops.measureValue;
30838
+ var typed = ops.isFreeText && String((_ops$freeText = ops.freeText) !== null && _ops$freeText !== void 0 ? _ops$freeText : '').trim() ? Number(ops.freeText) : NaN;
30839
+ if (Number.isFinite(typed)) return measureInCentimeters(typed, ops.measureUnitCode);
30840
+ return (_ops$value = ops.value) !== null && _ops$value !== void 0 ? _ops$value : ops.valueFromName;
30766
30841
  }
30767
30842
  } catch (err) {
30768
30843
  _iterator6.e(err);
@@ -32587,7 +32662,7 @@ var DivaArticle = /*#__PURE__*/function () {
32587
32662
  break;
32588
32663
  }
32589
32664
  _context.next = 4;
32590
- return import('./ShelfPlanner-f9466ab6.js');
32665
+ return import('./ShelfPlanner-f35a2bb8.js');
32591
32666
  case 4:
32592
32667
  _yield$import = _context.sent;
32593
32668
  ShelfPlanner = _yield$import["default"];
@@ -34385,7 +34460,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
34385
34460
  return _regeneratorRuntime.wrap(function _callee15$(_context16) {
34386
34461
  while (1) switch (_context16.prev = _context16.next) {
34387
34462
  case 0:
34388
- if (this.checkPartlistDepth(article, doLoadItem)) {
34463
+ if (this.checkPartlistCycle(article, doLoadItem)) {
34389
34464
  _context16.next = 2;
34390
34465
  break;
34391
34466
  }
@@ -34440,48 +34515,57 @@ var DivaArticleHandler = /*#__PURE__*/function () {
34440
34515
  return loadPartlistArticle;
34441
34516
  }()
34442
34517
  /**
34443
- * Whether the child may still be loaded. FALSE means the nesting limit is reached — the caller must stop, because
34444
- * a cyclic partlist re-enters `loadPartlistArticle` and this is the only thing that ends the recursion.
34518
+ * Whether the child may be loaded without closing a loop. FALSE means the child is the article itself or one of its
34519
+ * ancestors (same catalog): a partlist component carries the partlist it is a position of, so loading it would load
34520
+ * that partlist again and again. The load stops at the first repetition and names the article that closes the loop.
34521
+ * Every endless partlist chain repeats an (article, catalog) pair among its ancestors, so this check is also what
34522
+ * ends the recursion.
34445
34523
  */
34446
34524
  }, {
34447
- key: "checkPartlistDepth",
34448
- value: function checkPartlistDepth(article, doLoadItem) {
34449
- var PARTLIST_MAX_DEPTH = 10;
34450
- var depth = 0;
34451
- var current = article.partListParentArticle;
34452
- while (current) {
34453
- depth++;
34454
- current = current.partListParentArticle;
34455
- }
34456
- if (depth >= PARTLIST_MAX_DEPTH) {
34457
- var _article$set$actions;
34458
- var ancestorChain = this.collectAncestorChain(article).map(function (a) {
34459
- return a.articleCodex;
34460
- });
34461
- LOG$e.error(new DivaError('Partlist nesting exceeded the maximum allowed depth – aborting load', {
34462
- custom: {
34463
- maxDepth: PARTLIST_MAX_DEPTH,
34464
- currentDepth: depth,
34465
- articleCodexToLoad: doLoadItem.ArticleCodex,
34466
- parentBasketId: article.basketId,
34467
- parentArticleCodex: article.articleCodex,
34468
- ancestorChain: ancestorChain
34469
- }
34470
- }));
34471
- if ((_article$set$actions = article.set.actions) !== null && _article$set$actions !== void 0 && _article$set$actions.userHasPermission('advancedconfigurator')) {
34472
- var _article$set$actions2, _article$set$actions3;
34473
- (_article$set$actions2 = article.set.actions) === null || _article$set$actions2 === void 0 || (_article$set$actions3 = _article$set$actions2.openModal) === null || _article$set$actions3 === void 0 || _article$set$actions3.call(_article$set$actions2, {
34474
- title: 'Partlist nesting too deep',
34475
- text: "Aborted loading partlist article \"".concat(doLoadItem.ArticleCodex, "\" because the partlist nesting exceeded the maximum allowed depth of ").concat(PARTLIST_MAX_DEPTH, ". ") + "This usually means an article references itself or an ancestor as a partlist child. " + "Parent article: ".concat(article.articleCodex, ". Ancestor chain: ").concat(ancestorChain.join(' -> '), "."),
34476
- accept: true
34477
- });
34478
- return false;
34479
- } else {
34480
- article.set.getSetState.errorHandler(new DivaError('Partlist nesting exceeded the maximum allowed depth – aborting load'));
34481
- return false;
34525
+ key: "checkPartlistCycle",
34526
+ value: function checkPartlistCycle(article, doLoadItem) {
34527
+ var ancestorChain = this.collectAncestorChain(article);
34528
+ var closesLoop = ancestorChain.some(function (ancestor) {
34529
+ return ancestor.articleCodex === doLoadItem.ArticleCodex && String(ancestor.catalogCodex) === String(doLoadItem.CatalogCodex);
34530
+ });
34531
+ if (!closesLoop) return true;
34532
+ var chain = [].concat(_toConsumableArray(ancestorChain.reverse().map(function (ancestor) {
34533
+ return ancestor.articleCodex;
34534
+ })), [doLoadItem.ArticleCodex]).join(' → ');
34535
+ LOG$e.error(new DivaError('Partlist contains itself – aborting load', {
34536
+ custom: {
34537
+ articleCodexToLoad: doLoadItem.ArticleCodex,
34538
+ catalogCodex: doLoadItem.CatalogCodex,
34539
+ parentBasketId: article.basketId,
34540
+ chain: chain
34482
34541
  }
34542
+ }));
34543
+ if (this.showsPartlistHint(article)) {
34544
+ var _article$set$actions, _article$set$actions$, _i18n$t, _i18n$t2;
34545
+ var i18n = article.set.api.getI18n();
34546
+ (_article$set$actions = article.set.actions) === null || _article$set$actions === void 0 || (_article$set$actions$ = _article$set$actions.openModal) === null || _article$set$actions$ === void 0 || _article$set$actions$.call(_article$set$actions, {
34547
+ title: (_i18n$t = i18n === null || i18n === void 0 ? void 0 : i18n.t('configurator.partlist_cycle_title', {
34548
+ defaultValue: 'Partlist contains itself'
34549
+ })) !== null && _i18n$t !== void 0 ? _i18n$t : 'Partlist contains itself',
34550
+ text: (_i18n$t2 = i18n === null || i18n === void 0 ? void 0 : i18n.t('configurator.partlist_cycle_text', {
34551
+ defaultValue: 'The partlist article {{article}} references a partlist that contains itself or one of its parent articles as a position. Remove the partlist from this article. Chain: {{chain}}',
34552
+ article: doLoadItem.ArticleCodex,
34553
+ chain: chain
34554
+ })) !== null && _i18n$t2 !== void 0 ? _i18n$t2 : "Partlist contains itself: ".concat(chain),
34555
+ accept: true
34556
+ });
34557
+ } else {
34558
+ article.set.getSetState.errorHandler(new DivaError('Partlist contains itself – aborting load'));
34483
34559
  }
34484
- return true;
34560
+ return false;
34561
+ }
34562
+
34563
+ /** Partlist data hints are meant for the data maintainer: always in the backoffice preview, live only with the advanced permission. */
34564
+ }, {
34565
+ key: "showsPartlistHint",
34566
+ value: function showsPartlistHint(article) {
34567
+ var _article$set$actions2;
34568
+ return !article.set.api.isSeller || !!((_article$set$actions2 = article.set.actions) !== null && _article$set$actions2 !== void 0 && _article$set$actions2.userHasPermission('advancedconfigurator'));
34485
34569
  }
34486
34570
  }, {
34487
34571
  key: "collectAncestorChain",
@@ -41224,7 +41308,7 @@ var DivaSet = /*#__PURE__*/function () {
41224
41308
  break;
41225
41309
  }
41226
41310
  _context5.next = 3;
41227
- return import('./DoorPlanner-bcee08d0.js');
41311
+ return import('./DoorPlanner-1664243f.js');
41228
41312
  case 3:
41229
41313
  _yield$import = _context5.sent;
41230
41314
  DoorPlanner = _yield$import["default"];
@@ -47169,6 +47253,12 @@ var DivaSetHandler = /*#__PURE__*/function () {
47169
47253
  origOrderSet.OfflineData = actOrderSet.OfflineData;
47170
47254
  origOrderSet.CatalogName = actOrderSet.CatalogName;
47171
47255
  origOrderSet.CatalogName_locales = actOrderSet.CatalogName_locales;
47256
+ // other catalogs keep the supplier infos the basket service decrypted from their OfflineData
47257
+ if (actOrderSet.IsIDMFormat) {
47258
+ origOrderSet.SupplierILN = actOrderSet.SupplierILN;
47259
+ origOrderSet.SupplierName = actOrderSet.SupplierName;
47260
+ origOrderSet.SupplierCatalogName = actOrderSet.SupplierCatalogName;
47261
+ }
47172
47262
  if (actOrderSet.ConfigVariants && origOrderSet.ConfigVariants) origOrderSet.ConfigVariants = actOrderSet.ConfigVariants.map(function (variant, index) {
47173
47263
  var _origOrderSet$ConfigV;
47174
47264
  var configVariant = (_origOrderSet$ConfigV = origOrderSet.ConfigVariants) === null || _origOrderSet$ConfigV === void 0 ? void 0 : _origOrderSet$ConfigV[index];
@@ -47553,6 +47643,10 @@ var DivaSetHandler = /*#__PURE__*/function () {
47553
47643
  SetName_locales: set.setName_locales,
47554
47644
  ProductSetName: set.ProductSetName,
47555
47645
  SupplierGUID: catalogData.supplierGuid,
47646
+ // IDM catalogs carry no OfflineData the basket service could decrypt the supplier infos from
47647
+ SupplierILN: catalogData.supplierILN,
47648
+ SupplierName: catalogData.supplierName,
47649
+ SupplierCatalogName: catalogData.origCatalogName,
47556
47650
  SetPrice: set.getSetPrice(),
47557
47651
  BruttoSetPrice: bruttoPrice,
47558
47652
  SetQuantity: 1,
@@ -49168,7 +49262,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
49168
49262
  break;
49169
49263
  case 3:
49170
49264
  _context12.next = 5;
49171
- return import('./PfisterWWSHandler-44c23ccb.js');
49265
+ return import('./PfisterWWSHandler-9219a61d.js');
49172
49266
  case 5:
49173
49267
  _yield$import = _context12.sent;
49174
49268
  PfisterWWSHandler = _yield$import["default"];
@@ -49176,7 +49270,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
49176
49270
  return _context12.abrupt("break", 27);
49177
49271
  case 9:
49178
49272
  _context12.next = 11;
49179
- return import('./LiviqueWWSHandler-1fffea90.js');
49273
+ return import('./LiviqueWWSHandler-7326190a.js');
49180
49274
  case 11:
49181
49275
  _yield$import2 = _context12.sent;
49182
49276
  LiviqueWWSHandler = _yield$import2["default"];
@@ -49184,7 +49278,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
49184
49278
  return _context12.abrupt("break", 27);
49185
49279
  case 15:
49186
49280
  _context12.next = 17;
49187
- return import('./SeriousBasketHandler-a7290ac4.js');
49281
+ return import('./SeriousBasketHandler-da02a5b3.js');
49188
49282
  case 17:
49189
49283
  _yield$import3 = _context12.sent;
49190
49284
  SeriousWWSHandler = _yield$import3["default"];
@@ -49192,7 +49286,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
49192
49286
  return _context12.abrupt("break", 27);
49193
49287
  case 21:
49194
49288
  _context12.next = 23;
49195
- return import('./StandardWWSHandler-a90fe0e2.js');
49289
+ return import('./StandardWWSHandler-b166bb90.js');
49196
49290
  case 23:
49197
49291
  _yield$import4 = _context12.sent;
49198
49292
  StandardWWSHandler = _yield$import4["default"];
@@ -50579,7 +50673,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
50579
50673
  //If we need real time rendering initialize the SignalR and 3D host connection Handler
50580
50674
  bootMark('signalr: chunk import start');
50581
50675
  _context3.next = 3;
50582
- return import('./Host3DSignalR-a1aae6ae.js');
50676
+ return import('./Host3DSignalR-746d0063.js');
50583
50677
  case 3:
50584
50678
  _yield$import = _context3.sent;
50585
50679
  Host3DSignalR = _yield$import["default"];
@@ -52311,7 +52405,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
52311
52405
  break;
52312
52406
  case 8:
52313
52407
  _context5.next = 10;
52314
- return import('./DivaStandardPlanner-02829820.js');
52408
+ return import('./DivaStandardPlanner-d24209f4.js');
52315
52409
  case 10:
52316
52410
  _yield$import = _context5.sent;
52317
52411
  DivaStandardPlanner = _yield$import["default"];
@@ -52322,7 +52416,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
52322
52416
  return _context5.abrupt("break", 21);
52323
52417
  case 15:
52324
52418
  _context5.next = 17;
52325
- return import('./DivaBoxPlanner-497f920b.js');
52419
+ return import('./DivaBoxPlanner-e87a4462.js');
52326
52420
  case 17:
52327
52421
  _yield$import2 = _context5.sent;
52328
52422
  DivaBoxPlanner = _yield$import2["default"];