@kontur.candy/generator 5.53.0 → 5.54.0

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 (2) hide show
  1. package/dist/index.js +644 -211
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -48658,6 +48658,7 @@ __webpack_require__.r(__webpack_exports__);
48658
48658
  /* harmony export */ getDaysInMonthKCLangFunction: () => (/* binding */ getDaysInMonthKCLangFunction),
48659
48659
  /* harmony export */ getMonthKCLangFunction: () => (/* binding */ getMonthKCLangFunction),
48660
48660
  /* harmony export */ getPicklistValuesKCLangFunction: () => (/* binding */ getPicklistValuesKCLangFunction),
48661
+ /* harmony export */ getSumByKeysKCLangFunction: () => (/* binding */ getSumByKeysKCLangFunction),
48661
48662
  /* harmony export */ getYearKCLangFunction: () => (/* binding */ getYearKCLangFunction),
48662
48663
  /* harmony export */ groupCountKCLangFunction: () => (/* binding */ groupCountKCLangFunction),
48663
48664
  /* harmony export */ groupSumKCLangFunction: () => (/* binding */ groupSumKCLangFunction),
@@ -48670,6 +48671,7 @@ __webpack_require__.r(__webpack_exports__);
48670
48671
  /* harmony export */ isValidAccountNumberKCLangFunction: () => (/* binding */ isValidAccountNumberKCLangFunction),
48671
48672
  /* harmony export */ isValidMirCardNumberKCLangFunction: () => (/* binding */ isValidMirCardNumberKCLangFunction),
48672
48673
  /* harmony export */ lengthKCLangFunction: () => (/* binding */ lengthKCLangFunction),
48674
+ /* harmony export */ makeDictKCLangFunction: () => (/* binding */ makeDictKCLangFunction),
48673
48675
  /* harmony export */ newlineKCLangFunction: () => (/* binding */ newlineKCLangFunction),
48674
48676
  /* harmony export */ noDepsKCLangFunction: () => (/* binding */ noDepsKCLangFunction),
48675
48677
  /* harmony export */ regexMatchKCLangFunction: () => (/* binding */ regexMatchKCLangFunction),
@@ -49357,6 +49359,46 @@ const hasAutoFlagKCLangFunction = params => {
49357
49359
  expression: param
49358
49360
  };
49359
49361
  };
49362
+ const makeDictKCLangFunction = params => {
49363
+ var _params$48, _params$49;
49364
+ const errors = Array.from(validateParams(params, 2));
49365
+ if (errors.length > 0) {
49366
+ return new FunctionValidationErrorCollection(errors);
49367
+ }
49368
+ const sourceKeyPathParam = (_params$48 = params[0]) === null || _params$48 === void 0 ? void 0 : _params$48.value;
49369
+ const sourceValuePathParam = (_params$49 = params[1]) === null || _params$49 === void 0 ? void 0 : _params$49.value;
49370
+ if ((sourceKeyPathParam === null || sourceKeyPathParam === void 0 ? void 0 : sourceKeyPathParam.type) !== "argument" || sourceValuePathParam == undefined) {
49371
+ const argumentsValidationError = new ArgumentValidationError("Invalid argument sourceKeyPath");
49372
+ return new FunctionValidationErrorCollection([argumentsValidationError]);
49373
+ }
49374
+ return {
49375
+ type: "makeDict",
49376
+ sourceKeyPath: sourceKeyPathParam.select,
49377
+ sourceValueExpression: sourceValuePathParam
49378
+ };
49379
+ };
49380
+ const getSumByKeysKCLangFunction = params => {
49381
+ var _params$50, _params$51;
49382
+ const errors = Array.from(validateParams(params, 2));
49383
+ if (errors.length > 0) {
49384
+ return new FunctionValidationErrorCollection(errors);
49385
+ }
49386
+ const dictPathParam = (_params$50 = params[0]) === null || _params$50 === void 0 ? void 0 : _params$50.value;
49387
+ const targetKeysParam = (_params$51 = params[1]) === null || _params$51 === void 0 ? void 0 : _params$51.value;
49388
+ if (targetKeysParam == undefined || (dictPathParam === null || dictPathParam === void 0 ? void 0 : dictPathParam.type) !== "argument") {
49389
+ const argumentsValidationError = new ArgumentValidationError("Invalid arguments dictPathParam, targetKeysParam");
49390
+ return new FunctionValidationErrorCollection([argumentsValidationError]);
49391
+ }
49392
+ const targetKeys = targetKeysParam.type === "array" ? targetKeysParam : {
49393
+ type: "array",
49394
+ items: [targetKeysParam]
49395
+ };
49396
+ return {
49397
+ type: "getSumByKeys",
49398
+ dictPath: dictPathParam.select,
49399
+ targetKeys: targetKeys
49400
+ };
49401
+ };
49360
49402
 
49361
49403
  /***/ }),
49362
49404
 
@@ -49421,7 +49463,9 @@ const getKCLangGlobalFunctionBuilders = () => ({
49421
49463
  addYears: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.addYearsKCLangFunction],
49422
49464
  dateToString: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.dateToStringKCLangFunction],
49423
49465
  dateTime: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.dateTimeKCLangFunction],
49424
- hasAutoFlag: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.hasAutoFlagKCLangFunction]
49466
+ hasAutoFlag: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.hasAutoFlagKCLangFunction],
49467
+ makeDict: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.makeDictKCLangFunction],
49468
+ getSumByKeys: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.getSumByKeysKCLangFunction]
49425
49469
  });
49426
49470
  class ErrorListener {
49427
49471
  constructor() {
@@ -49772,6 +49816,12 @@ class KCLangAntlrVisitor {
49772
49816
  case "string":
49773
49817
  dataType = "string";
49774
49818
  break;
49819
+ case "dict":
49820
+ dataType = "dict";
49821
+ break;
49822
+ case "array":
49823
+ dataType = "array";
49824
+ break;
49775
49825
  default:
49776
49826
  throw Error("visitType syntax incorrect");
49777
49827
  }
@@ -56973,6 +57023,12 @@ function traverseKCLangExpression(node, visitor) {
56973
57023
  case "hasAutoFlag":
56974
57024
  visitor.visitHasAutoFlagKCLangNode(node);
56975
57025
  break;
57026
+ case "makeDict":
57027
+ visitor.visitMakeDictKCLangNode(node);
57028
+ break;
57029
+ case "getSumByKeys":
57030
+ visitor.visitGetSumByKeysKCLangNode(node);
57031
+ break;
56976
57032
  default:
56977
57033
  (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.ensureNever)(node);
56978
57034
  break;
@@ -57129,6 +57185,12 @@ class DefaultKCLangExpressionVisitor {
57129
57185
  visitHasAutoFlagKCLangNode(node) {
57130
57186
  // default empty implementation
57131
57187
  }
57188
+ visitGetSumByKeysKCLangNode(node) {
57189
+ // default empty implementation
57190
+ }
57191
+ visitMakeDictKCLangNode(node) {
57192
+ // default empty implementation
57193
+ }
57132
57194
  }
57133
57195
 
57134
57196
  /***/ }),
@@ -57490,6 +57552,12 @@ const getGenerateJsExpressionFunc = options => {
57490
57552
  case "hasAutoFlag":
57491
57553
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
57492
57554
  break;
57555
+ case "makeDict":
57556
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
57557
+ break;
57558
+ case "getSumByKeys":
57559
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
57560
+ break;
57493
57561
  default:
57494
57562
  (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.ensureNever)(expression);
57495
57563
  }
@@ -57567,6 +57635,10 @@ function generateKCXmlExpression(expression) {
57567
57635
  return `<m:${expression.type} select="${expression.select}" />`;
57568
57636
  case "isValidAccountNumber":
57569
57637
  return `<m:${expression.type} bik="${expression.bik}" account="${expression.account}" />`;
57638
+ case "makeDict":
57639
+ return [`<m:${expression.type} sourceKeyPath="${expression.sourceKeyPath}">`, (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(expression.sourceValueExpression), 1), `</m:${expression.type}>`].join("\n");
57640
+ case "getSumByKeys":
57641
+ return [`<m:${expression.type} dictPath="${expression.dictPath}">`, (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(expression.targetKeys), 1), `</m:${expression.type}>`].join("\n");
57570
57642
  case "groupSum":
57571
57643
  return [`<m:${expression.type} sourceKeyPath="${expression.sourceKeyPath}" sourceValuePath="${expression.sourceValuePath}" >`, (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(expression.targetKeys), 1), `</m:${expression.type}>`].join("\n");
57572
57644
  case "groupCount":
@@ -63678,6 +63750,7 @@ __webpack_require__.r(__webpack_exports__);
63678
63750
  /* harmony export */ FormulaGetDaysInMonthExpression: () => (/* binding */ FormulaGetDaysInMonthExpression),
63679
63751
  /* harmony export */ FormulaGetMonthExpression: () => (/* binding */ FormulaGetMonthExpression),
63680
63752
  /* harmony export */ FormulaGetPicklistValuesExpression: () => (/* binding */ FormulaGetPicklistValuesExpression),
63753
+ /* harmony export */ FormulaGetSumByKeysExpression: () => (/* binding */ FormulaGetSumByKeysExpression),
63681
63754
  /* harmony export */ FormulaGetYearExpression: () => (/* binding */ FormulaGetYearExpression),
63682
63755
  /* harmony export */ FormulaGroupCountExpression: () => (/* binding */ FormulaGroupCountExpression),
63683
63756
  /* harmony export */ FormulaGroupSumExpression: () => (/* binding */ FormulaGroupSumExpression),
@@ -63693,6 +63766,7 @@ __webpack_require__.r(__webpack_exports__);
63693
63766
  /* harmony export */ FormulaLeExpression: () => (/* binding */ FormulaLeExpression),
63694
63767
  /* harmony export */ FormulaLengthExpression: () => (/* binding */ FormulaLengthExpression),
63695
63768
  /* harmony export */ FormulaLtExpression: () => (/* binding */ FormulaLtExpression),
63769
+ /* harmony export */ FormulaMakeDictExpression: () => (/* binding */ FormulaMakeDictExpression),
63696
63770
  /* harmony export */ FormulaMinusExpression: () => (/* binding */ FormulaMinusExpression),
63697
63771
  /* harmony export */ FormulaMultiplyExpression: () => (/* binding */ FormulaMultiplyExpression),
63698
63772
  /* harmony export */ FormulaMultySumExpression: () => (/* binding */ FormulaMultySumExpression),
@@ -63724,7 +63798,7 @@ __webpack_require__.r(__webpack_exports__);
63724
63798
 
63725
63799
 
63726
63800
 
63727
- var _dec, _dec2, _class, _class2, _descriptor, _dec3, _class3, _dec4, _dec5, _class4, _class5, _descriptor2, _dec6, _dec7, _class6, _class7, _descriptor3, _dec8, _dec9, _class8, _class9, _descriptor4, _dec10, _dec11, _class10, _class11, _descriptor5, _dec12, _dec13, _class12, _class13, _descriptor6, _dec14, _dec15, _dec16, _class14, _class15, _descriptor7, _descriptor8, _dec17, _dec18, _dec19, _class16, _class17, _descriptor9, _descriptor10, _dec20, _dec21, _class18, _class19, _descriptor11, _dec22, _dec23, _class20, _class21, _descriptor12, _dec24, _dec25, _class22, _class23, _descriptor13, _dec26, _dec27, _class24, _class25, _descriptor14, _dec28, _dec29, _class26, _class27, _descriptor15, _dec30, _dec31, _class28, _class29, _descriptor16, _dec32, _dec33, _class30, _class31, _descriptor17, _dec34, _dec35, _class32, _class33, _descriptor18, _dec36, _dec37, _class34, _class35, _descriptor19, _dec38, _dec39, _dec40, _dec41, _class36, _class37, _descriptor20, _descriptor21, _descriptor22, _dec42, _dec43, _class38, _class39, _descriptor23, _dec44, _dec45, _class40, _class41, _descriptor24, _dec46, _dec47, _dec48, _class42, _class43, _descriptor25, _descriptor26, _dec49, _dec50, _class44, _class45, _descriptor27, _dec51, _dec52, _class46, _class47, _descriptor28, _dec53, _dec54, _class48, _class49, _descriptor29, _dec55, _dec56, _class50, _class51, _descriptor30, _dec57, _dec58, _dec59, _class52, _class53, _descriptor31, _descriptor32, _dec60, _dec61, _dec62, _dec63, _class54, _class55, _descriptor33, _descriptor34, _descriptor35, _dec64, _dec65, _dec66, _class56, _class57, _descriptor36, _descriptor37, _dec67, _class58, _dec68, _dec69, _class59, _class60, _descriptor38, _dec70, _dec71, _class61, _class62, _descriptor39, _dec72, _dec73, _class63, _class64, _descriptor40, _dec74, _dec75, _class65, _class66, _descriptor41, _dec76, _dec77, _class67, _class68, _descriptor42, _dec78, _dec79, _class69, _class70, _descriptor43, _dec80, _dec81, _class71, _class72, _descriptor44, _dec82, _dec83, _class73, _class74, _descriptor45, _dec84, _dec85, _dec86, _class75, _class76, _descriptor46, _descriptor47, _dec87, _dec88, _dec89, _class77, _class78, _descriptor48, _descriptor49, _dec90, _dec91, _dec92, _class79, _class80, _descriptor50, _descriptor51, _dec93, _dec94, _dec95, _class81, _class82, _descriptor52, _descriptor53, _dec96, _dec97, _class83, _class84, _descriptor54, _dec98, _dec99, _class85, _class86, _descriptor55, _dec100, _dec101, _class87, _class88, _descriptor56, _dec102, _dec103, _class89, _class90, _descriptor57, _dec104, _dec105, _class91, _class92, _descriptor58, _dec106, _dec107, _dec108, _class93, _class94, _descriptor59, _descriptor60, _dec109, _dec110, _dec111, _class95, _class96, _descriptor61, _descriptor62, _dec112, _dec113, _class97, _class98, _descriptor63, _dec114, _dec115, _class99, _class100, _descriptor64, _dec116, _dec117, _class101, _class102, _descriptor65, _dec118, _dec119, _dec120, _dec121, _dec122, _class103, _class104, _descriptor66, _descriptor67, _descriptor68, _descriptor69, _dec123, _dec124, _class105, _class106, _descriptor70, _dec125, _dec126, _class107, _class108, _descriptor71, _dec127, _dec128, _class109, _class110, _descriptor72, _dec129, _dec130, _class111, _class112, _descriptor73, _dec131, _dec132, _dec133, _class113, _class114, _descriptor74, _descriptor75, _dec134, _dec135, _class115, _class116, _descriptor76, _dec136, _class117, _dec137, _dec138, _dec139, _dec140, _class118, _class119, _descriptor77, _descriptor78, _descriptor79, _dec141, _dec142, _class120, _class121, _descriptor80, _dec143, _dec144, _class122, _class123, _descriptor81, _dec145, _dec146, _dec147, _dec148, _dec149, _dec150, _class124, _class125, _descriptor82, _descriptor83, _descriptor84, _descriptor85, _descriptor86, _dec151, _dec152, _class126, _class127, _descriptor87, _dec153, _dec154, _dec155, _class128, _class129, _descriptor88, _descriptor89, _dec156, _dec157, _dec158, _dec159, _class130, _class131, _descriptor90, _descriptor91, _descriptor92, _dec160, _dec161, _dec162, _class132, _class133, _descriptor93, _descriptor94;
63801
+ var _dec, _dec2, _class, _class2, _descriptor, _dec3, _class3, _dec4, _dec5, _class4, _class5, _descriptor2, _dec6, _dec7, _class6, _class7, _descriptor3, _dec8, _dec9, _class8, _class9, _descriptor4, _dec10, _dec11, _class10, _class11, _descriptor5, _dec12, _dec13, _class12, _class13, _descriptor6, _dec14, _dec15, _dec16, _class14, _class15, _descriptor7, _descriptor8, _dec17, _dec18, _dec19, _class16, _class17, _descriptor9, _descriptor10, _dec20, _dec21, _class18, _class19, _descriptor11, _dec22, _dec23, _class20, _class21, _descriptor12, _dec24, _dec25, _class22, _class23, _descriptor13, _dec26, _dec27, _class24, _class25, _descriptor14, _dec28, _dec29, _class26, _class27, _descriptor15, _dec30, _dec31, _class28, _class29, _descriptor16, _dec32, _dec33, _class30, _class31, _descriptor17, _dec34, _dec35, _class32, _class33, _descriptor18, _dec36, _dec37, _class34, _class35, _descriptor19, _dec38, _dec39, _dec40, _dec41, _class36, _class37, _descriptor20, _descriptor21, _descriptor22, _dec42, _dec43, _class38, _class39, _descriptor23, _dec44, _dec45, _class40, _class41, _descriptor24, _dec46, _dec47, _dec48, _class42, _class43, _descriptor25, _descriptor26, _dec49, _dec50, _class44, _class45, _descriptor27, _dec51, _dec52, _class46, _class47, _descriptor28, _dec53, _dec54, _class48, _class49, _descriptor29, _dec55, _dec56, _class50, _class51, _descriptor30, _dec57, _dec58, _dec59, _class52, _class53, _descriptor31, _descriptor32, _dec60, _dec61, _dec62, _dec63, _class54, _class55, _descriptor33, _descriptor34, _descriptor35, _dec64, _dec65, _dec66, _class56, _class57, _descriptor36, _descriptor37, _dec67, _class58, _dec68, _dec69, _class59, _class60, _descriptor38, _dec70, _dec71, _class61, _class62, _descriptor39, _dec72, _dec73, _class63, _class64, _descriptor40, _dec74, _dec75, _class65, _class66, _descriptor41, _dec76, _dec77, _class67, _class68, _descriptor42, _dec78, _dec79, _class69, _class70, _descriptor43, _dec80, _dec81, _class71, _class72, _descriptor44, _dec82, _dec83, _class73, _class74, _descriptor45, _dec84, _dec85, _dec86, _class75, _class76, _descriptor46, _descriptor47, _dec87, _dec88, _dec89, _class77, _class78, _descriptor48, _descriptor49, _dec90, _dec91, _dec92, _class79, _class80, _descriptor50, _descriptor51, _dec93, _dec94, _dec95, _class81, _class82, _descriptor52, _descriptor53, _dec96, _dec97, _class83, _class84, _descriptor54, _dec98, _dec99, _class85, _class86, _descriptor55, _dec100, _dec101, _class87, _class88, _descriptor56, _dec102, _dec103, _class89, _class90, _descriptor57, _dec104, _dec105, _class91, _class92, _descriptor58, _dec106, _dec107, _dec108, _class93, _class94, _descriptor59, _descriptor60, _dec109, _dec110, _dec111, _class95, _class96, _descriptor61, _descriptor62, _dec112, _dec113, _class97, _class98, _descriptor63, _dec114, _dec115, _class99, _class100, _descriptor64, _dec116, _dec117, _class101, _class102, _descriptor65, _dec118, _dec119, _dec120, _dec121, _dec122, _class103, _class104, _descriptor66, _descriptor67, _descriptor68, _descriptor69, _dec123, _dec124, _class105, _class106, _descriptor70, _dec125, _dec126, _class107, _class108, _descriptor71, _dec127, _dec128, _class109, _class110, _descriptor72, _dec129, _dec130, _class111, _class112, _descriptor73, _dec131, _dec132, _dec133, _class113, _class114, _descriptor74, _descriptor75, _dec134, _dec135, _class115, _class116, _descriptor76, _dec136, _class117, _dec137, _dec138, _dec139, _dec140, _class118, _class119, _descriptor77, _descriptor78, _descriptor79, _dec141, _dec142, _class120, _class121, _descriptor80, _dec143, _dec144, _class122, _class123, _descriptor81, _dec145, _dec146, _dec147, _dec148, _dec149, _dec150, _class124, _class125, _descriptor82, _descriptor83, _descriptor84, _descriptor85, _descriptor86, _dec151, _dec152, _class126, _class127, _descriptor87, _dec153, _dec154, _dec155, _class128, _class129, _descriptor88, _descriptor89, _dec156, _dec157, _dec158, _class130, _class131, _descriptor90, _descriptor91, _dec159, _dec160, _dec161, _class132, _class133, _descriptor92, _descriptor93, _dec162, _dec163, _dec164, _dec165, _class134, _class135, _descriptor94, _descriptor95, _descriptor96, _dec166, _dec167, _dec168, _class136, _class137, _descriptor97, _descriptor98;
63728
63802
 
63729
63803
 
63730
63804
 
@@ -63740,7 +63814,7 @@ class FormulaExpression extends _markupGenerator_Serializer_SugarSerializer__WEB
63740
63814
  throw new Error(`${this.constructor} does not decorated with sugarNode() properly`);
63741
63815
  }
63742
63816
  }
63743
- const typeArgumentValueParser = _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.enum("decimal", "string");
63817
+ const typeArgumentValueParser = _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.enum("decimal", "string", "dict", "array");
63744
63818
  let FormulaWhenExpression = (_dec = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("when", `TODO`), _dec2 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec(_class = (_class2 = class FormulaWhenExpression extends FormulaExpression {
63745
63819
  constructor(...args) {
63746
63820
  super(...args);
@@ -64677,47 +64751,81 @@ let MathContainer = (_dec153 = (0,_markupGenerator_Serializer_SugarSerializer__W
64677
64751
  writable: true,
64678
64752
  initializer: null
64679
64753
  })), _class129)) || _class128);
64680
- let FormulaGroupSumExpression = (_dec156 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("groupsum", `Вычисление суммы с группировкой в разных множественностях`), _dec157 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("array", [FormulaArrayExpression]), _dec158 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ группы в суммируемой множественности`), _dec159 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceValuePath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь в суммируемой множественности откуда берем значение для свёртки`), _dec156(_class130 = (_class131 = class FormulaGroupSumExpression extends FormulaExpression {
64754
+ let FormulaMakeDictExpression = (_dec156 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("makedict", `Получение словаря по ключу-значению из иннера`), _dec157 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ`), _dec158 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)(undefined, [FormulaArgumentExpression, FormulaConstExpression, FormulaCastExpression], `Путь откуда брать значение или константа`), _dec156(_class130 = (_class131 = class FormulaMakeDictExpression extends FormulaExpression {
64681
64755
  constructor(...args) {
64682
64756
  super(...args);
64683
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor90, this);
64684
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor91, this);
64685
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceValuePath", _descriptor92, this);
64757
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor90, this);
64758
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceValueExpression", _descriptor91, this);
64686
64759
  }
64687
- }, (_descriptor90 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "targetKeys", [_dec157], {
64760
+ }, (_descriptor90 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "sourceKeyPath", [_dec157], {
64688
64761
  configurable: true,
64689
64762
  enumerable: true,
64690
64763
  writable: true,
64691
64764
  initializer: null
64692
- }), _descriptor91 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "sourceKeyPath", [_dec158], {
64765
+ }), _descriptor91 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "sourceValueExpression", [_dec158], {
64693
64766
  configurable: true,
64694
64767
  enumerable: true,
64695
64768
  writable: true,
64696
64769
  initializer: null
64697
- }), _descriptor92 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "sourceValuePath", [_dec159], {
64770
+ })), _class131)) || _class130);
64771
+ let FormulaGetSumByKeysExpression = (_dec159 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("getsumbykeys", `Вычисление суммы с группировкой в разных множественностях`), _dec160 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("dictPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь к словарю`), _dec161 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("array", [FormulaArrayExpression]), _dec159(_class132 = (_class133 = class FormulaGetSumByKeysExpression extends FormulaExpression {
64772
+ constructor(...args) {
64773
+ super(...args);
64774
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "dictPath", _descriptor92, this);
64775
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor93, this);
64776
+ }
64777
+ }, (_descriptor92 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class133.prototype, "dictPath", [_dec160], {
64698
64778
  configurable: true,
64699
64779
  enumerable: true,
64700
64780
  writable: true,
64701
64781
  initializer: null
64702
- })), _class131)) || _class130);
64703
- let FormulaGroupCountExpression = (_dec160 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("groupcount", `Вычисление количества элементов по группам в разных множественностях`), _dec161 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("array", [FormulaArrayExpression]), _dec162 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ группы в суммируемой множественности`), _dec160(_class132 = (_class133 = class FormulaGroupCountExpression extends FormulaExpression {
64782
+ }), _descriptor93 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class133.prototype, "targetKeys", [_dec161], {
64783
+ configurable: true,
64784
+ enumerable: true,
64785
+ writable: true,
64786
+ initializer: null
64787
+ })), _class133)) || _class132);
64788
+ let FormulaGroupSumExpression = (_dec162 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("groupsum", `Вычисление суммы с группировкой в разных множественностях`), _dec163 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("array", [FormulaArrayExpression]), _dec164 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ группы в суммируемой множественности`), _dec165 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceValuePath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь в суммируемой множественности откуда берем значение для свёртки`), _dec162(_class134 = (_class135 = class FormulaGroupSumExpression extends FormulaExpression {
64704
64789
  constructor(...args) {
64705
64790
  super(...args);
64706
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor93, this);
64707
- _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor94, this);
64791
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor94, this);
64792
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor95, this);
64793
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceValuePath", _descriptor96, this);
64708
64794
  }
64709
- }, (_descriptor93 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class133.prototype, "targetKeys", [_dec161], {
64795
+ }, (_descriptor94 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class135.prototype, "targetKeys", [_dec163], {
64710
64796
  configurable: true,
64711
64797
  enumerable: true,
64712
64798
  writable: true,
64713
64799
  initializer: null
64714
- }), _descriptor94 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class133.prototype, "sourceKeyPath", [_dec162], {
64800
+ }), _descriptor95 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class135.prototype, "sourceKeyPath", [_dec164], {
64715
64801
  configurable: true,
64716
64802
  enumerable: true,
64717
64803
  writable: true,
64718
64804
  initializer: null
64719
- })), _class133)) || _class132);
64720
- const formulaExpressions = [FormulaSumExpression, FormulaArgumentExpression, FormulaConstExpression, FormulaMultySumExpression, FormulaRoundExpression, FormulaFloorExpression, FormulaAbsExpression, FormulaDivisionExpression, FormulaMinusExpression, FormulaMultiplyExpression, FormulaChooseExpression, FormulaEqExpression, FormulaGtExpression, FormulaLtExpression, FormulaGeExpression, FormulaLeExpression, FormulaAndExpression, FormulaOrExpression, FormulaNotExpression, FormulaRegexMatchExpression, FormulaSubstringExpression, FormulaXAbsExpression, FormulaExistsExpression, FormulaLengthExpression, FormulaWhenExpression, FormulaCountExpression, FormulaDateNowExpression, FormulaGetDaysInMonthExpression, FormulaGetDayExpression, FormulaGetMonthExpression, FormulaGetYearExpression, FormulaIsDateExpression, FormulaDifferenceInMonthsExpression, FormulaDifferenceInDaysExpression, FormulaAddDaysExpression, FormulaAddMonthsExpression, FormulaAddYearsExpression, FormulaDateToStringExpression, FormulaDateTimeExpression, FormulaIsSnilsExpression, FormulaIsRegNumSfrExpression, FormulaIsInnExpression, FormulaIsValidAccountNumberExpression, FormulaIsValidMirCardNumberExpression, FormulaCastExpression, FormulaConcatExpression, FormulaGroupSumExpression, FormulaGroupCountExpression, FormulaNewLineExpression, FormulaOneOfExpression, FormulaGetPicklistValuesExpression, FormulaArrayExpression, FormulaFirstOrDefaultExpression, FormulaHashSetExpression, FormulaFilterColumnExpression, FormulaFilterKeyExpression, FormulaNoDepsNode, FormulaHasAutoFlagExpression];
64805
+ }), _descriptor96 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class135.prototype, "sourceValuePath", [_dec165], {
64806
+ configurable: true,
64807
+ enumerable: true,
64808
+ writable: true,
64809
+ initializer: null
64810
+ })), _class135)) || _class134);
64811
+ let FormulaGroupCountExpression = (_dec166 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("groupcount", `Вычисление количества элементов по группам в разных множественностях`), _dec167 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.singleChild)("array", [FormulaArrayExpression]), _dec168 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("sourceKeyPath", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, `Путь откуда брать ключ группы в суммируемой множественности`), _dec166(_class136 = (_class137 = class FormulaGroupCountExpression extends FormulaExpression {
64812
+ constructor(...args) {
64813
+ super(...args);
64814
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor97, this);
64815
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor98, this);
64816
+ }
64817
+ }, (_descriptor97 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class137.prototype, "targetKeys", [_dec167], {
64818
+ configurable: true,
64819
+ enumerable: true,
64820
+ writable: true,
64821
+ initializer: null
64822
+ }), _descriptor98 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class137.prototype, "sourceKeyPath", [_dec168], {
64823
+ configurable: true,
64824
+ enumerable: true,
64825
+ writable: true,
64826
+ initializer: null
64827
+ })), _class137)) || _class136);
64828
+ const formulaExpressions = [FormulaSumExpression, FormulaArgumentExpression, FormulaConstExpression, FormulaMultySumExpression, FormulaRoundExpression, FormulaFloorExpression, FormulaAbsExpression, FormulaDivisionExpression, FormulaMinusExpression, FormulaMultiplyExpression, FormulaChooseExpression, FormulaEqExpression, FormulaGtExpression, FormulaLtExpression, FormulaGeExpression, FormulaLeExpression, FormulaAndExpression, FormulaOrExpression, FormulaNotExpression, FormulaRegexMatchExpression, FormulaSubstringExpression, FormulaXAbsExpression, FormulaExistsExpression, FormulaLengthExpression, FormulaWhenExpression, FormulaCountExpression, FormulaDateNowExpression, FormulaGetDaysInMonthExpression, FormulaGetDayExpression, FormulaGetMonthExpression, FormulaGetYearExpression, FormulaIsDateExpression, FormulaDifferenceInMonthsExpression, FormulaDifferenceInDaysExpression, FormulaAddDaysExpression, FormulaAddMonthsExpression, FormulaAddYearsExpression, FormulaDateToStringExpression, FormulaDateTimeExpression, FormulaIsSnilsExpression, FormulaIsRegNumSfrExpression, FormulaIsInnExpression, FormulaIsValidAccountNumberExpression, FormulaIsValidMirCardNumberExpression, FormulaCastExpression, FormulaConcatExpression, FormulaGroupSumExpression, FormulaGroupCountExpression, FormulaNewLineExpression, FormulaOneOfExpression, FormulaGetPicklistValuesExpression, FormulaArrayExpression, FormulaFirstOrDefaultExpression, FormulaHashSetExpression, FormulaFilterColumnExpression, FormulaFilterKeyExpression, FormulaNoDepsNode, FormulaHasAutoFlagExpression, FormulaMakeDictExpression, FormulaGetSumByKeysExpression];
64721
64829
 
64722
64830
  /***/ }),
64723
64831
 
@@ -67177,7 +67285,7 @@ class LazyLoadDeclarationGenerator {
67177
67285
  thresholdValue: lazyLoadingNodeDeclaration.thresholdValue
67178
67286
  };
67179
67287
  }
67180
- const result = this.replaceHolder(`
67288
+ const result = LazyLoadDeclarationGenerator.replaceHolder(`
67181
67289
  export default function lazyLoadDeclaration() {
67182
67290
  return ${serialize_javascript__WEBPACK_IMPORTED_MODULE_0___default()(declaration, {
67183
67291
  space: " "
@@ -67189,6 +67297,16 @@ class LazyLoadDeclarationGenerator {
67189
67297
  declaration: declaration
67190
67298
  };
67191
67299
  }
67300
+ static convertDeclarationToContent(declaration) {
67301
+ const result = LazyLoadDeclarationGenerator.replaceHolder(`
67302
+ export default function lazyLoadDeclaration() {
67303
+ return ${serialize_javascript__WEBPACK_IMPORTED_MODULE_0___default()(declaration, {
67304
+ space: " "
67305
+ })};
67306
+ };`);
67307
+ const content = unescape(result.replace(/(\\)(u[\dA-Fa-f]{4})/g, "%$2"));
67308
+ return content;
67309
+ }
67192
67310
  *extractLazyLoadingDeclarationFromSugar(sugarRoot) {
67193
67311
  const controlConverterClass = (0,_markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_5__.getConverterByNodeClass)((0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.getNodeClass)(sugarRoot));
67194
67312
  if (controlConverterClass != undefined) {
@@ -67267,7 +67385,7 @@ class LazyLoadDeclarationGenerator {
67267
67385
  yield* this.processElement(nextPath, child);
67268
67386
  }
67269
67387
  }
67270
- replaceHolder(decl) {
67388
+ static replaceHolder(decl) {
67271
67389
  let replacedDecl = decl;
67272
67390
  for (const [placeholderName, placeHoldersFunction] of (0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.iterateEntries)(_DataDeclarationGenerator_placeholders__WEBPACK_IMPORTED_MODULE_2__.placeHolders)) {
67273
67391
  const checkName = `"#(${placeholderName})(\\('[\\w]*'\\))?#"`;
@@ -67390,7 +67508,7 @@ __webpack_require__.r(__webpack_exports__);
67390
67508
 
67391
67509
  function processSugar(formSugarContent, additionalContent, generationOptions) {
67392
67510
  try {
67393
- var _kxXmlMathContainer$f, _kxXmlMathContainer$f2, _kcLangMathContainer$, _kcLangMathContainer$2, _additionalContent$fo, _additionalContent$fo2, _additionalContent$fo3, _additionalContent$fo4, _sugarRoot$schemaVali, _Iterator$from$map$fl, _generationOptions$in, _generationOptions$in2, _generationOptions$re, _additionalContent$fo5, _additionalContent$fo6;
67511
+ var _kxXmlMathContainer$f, _kxXmlMathContainer$f2, _kcLangMathContainer$, _kcLangMathContainer$2, _additionalContent$fo, _additionalContent$fo2, _additionalContent$fo3, _additionalContent$fo4, _sugarRoot$schemaVali, _Iterator$from$map$fl, _generationOptions$in, _generationOptions$in2, _generationOptions$re, _additionalContent$fo5, _additionalContent$fo6, _additionalContent$fo7, _additionalContent$fo8, _additionalContent$fo9, _additionalContent$fo10, _additionalContent$fo11, _additionalContent$fo12;
67394
67512
  const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
67395
67513
  const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_13__.createDefaultSugarSerializer)();
67396
67514
  const sugarRoot = (0,_markupGenerator_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_14__.strictCastNode)(serializer.deserializeFromSugarXmlNode(sugarAst), _markupGenerator_ElementProcessors_FormParts_Form_FormNode__WEBPACK_IMPORTED_MODULE_11__.FormNode);
@@ -67427,15 +67545,21 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
67427
67545
  const lazyLoadGenerator = new _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_29__.LazyLoadDeclarationGenerator(sugarRoot, formSchemaRng);
67428
67546
  const lazyLoadGeneratorResult = lazyLoadGenerator.generate();
67429
67547
  const resourcesHash = (_generationOptions$re = generationOptions === null || generationOptions === void 0 ? void 0 : generationOptions.resourcesHash) !== null && _generationOptions$re !== void 0 ? _generationOptions$re : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.reject)("Current generator version requires resources hash");
67430
- const formulaExprConverter = new _ServerSideFLangNormalization_FormulaExpressionToFlangExpressionConverter__WEBPACK_IMPORTED_MODULE_34__.FormulaExpressionToFlangExpressionConverter(path => (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_35__.adjustPathMultiplicityComplex)(path, formSchemaRng, dataDeclarationHelper));
67431
- const formulaRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_FormulaRulesBuilder__WEBPACK_IMPORTED_MODULE_36__.FormulaRulesBuilder(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter);
67548
+ const formulaExprConverter = new _ServerSideFLangNormalization_FormulaExpressionToFlangExpressionConverter__WEBPACK_IMPORTED_MODULE_34__.FormulaExpressionToFlangExpressionConverter(path => (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_35__.adjustPathMultiplicityComplex)(path, formSchemaRng, dataDeclarationHelper), {
67549
+ enableGroupSumAutoConversion: (_additionalContent$fo5 = (_additionalContent$fo6 = additionalContent.formJsonSettings) === null || _additionalContent$fo6 === void 0 ? void 0 : _additionalContent$fo6.enableTypedFlang) !== null && _additionalContent$fo5 !== void 0 ? _additionalContent$fo5 : false
67550
+ });
67551
+ const formulaRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_FormulaRulesBuilder__WEBPACK_IMPORTED_MODULE_36__.FormulaRulesBuilder(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter, {
67552
+ enableTypedFlang: (_additionalContent$fo7 = (_additionalContent$fo8 = additionalContent.formJsonSettings) === null || _additionalContent$fo8 === void 0 ? void 0 : _additionalContent$fo8.enableTypedFlang) !== null && _additionalContent$fo7 !== void 0 ? _additionalContent$fo7 : false
67553
+ });
67432
67554
  const initializationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_InitializationRulesBuilder__WEBPACK_IMPORTED_MODULE_37__.InitializationRulesBuilder(sugarRoot, resourcesHash);
67433
67555
  const lazyLoadingRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_LazyLoadingRulesBuilder__WEBPACK_IMPORTED_MODULE_38__.LazyLoadingRulesBuilder(sugarRoot, lazyLoadGeneratorResult.declaration);
67434
67556
  const sugarRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_SugarRulesBuilder__WEBPACK_IMPORTED_MODULE_39__.SugarRulesBuilder(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, dataDeclarationHelper, typeRegistry, useSchemaValidations);
67435
67557
  const validationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_ValidationRulesBuilder__WEBPACK_IMPORTED_MODULE_40__.ValidationRulesBuilder(sugarRoot, dataDeclarationHelper, formSchemaRng, formulaExprConverter, kcXmlConditions, typeRegistry, useSchemaValidations);
67436
67558
  const optionalSectionRuleBuilder = new _ServerSideFLangNormalization_RuleBuilders_OptionalSectionRulesBuilder__WEBPACK_IMPORTED_MODULE_33__.OptionalSectionRulesBuilder(sugarRoot, dataDeclarationHelper);
67437
67559
  const normalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_NormalizationRulesGenerator__WEBPACK_IMPORTED_MODULE_25__.NormalizationRulesGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng);
67438
- const formulaOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_30__.FormulaOnlyNormalizationRuleGenerator(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder);
67560
+ const formulaOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_30__.FormulaOnlyNormalizationRuleGenerator(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder, {
67561
+ enableTypedFlang: (_additionalContent$fo9 = (_additionalContent$fo10 = additionalContent.formJsonSettings) === null || _additionalContent$fo10 === void 0 ? void 0 : _additionalContent$fo10.enableTypedFlang) !== null && _additionalContent$fo9 !== void 0 ? _additionalContent$fo9 : false
67562
+ });
67439
67563
  const formulaAndInitOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaAndInitOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_41__.FormulaAndInitOnlyNormalizationRuleGenerator(sugarRulesBuilder, formulaRulesBuilder, optionalSectionRuleBuilder, formSchemaRng);
67440
67564
  const autoValueForValueByDefaultNormalizationRuleGenerator = new _ServerSideFLangNormalization_Normalizers_AutoValueForValueByDefaultNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_45__.AutoValueForValueByDefaultNormalizationRuleGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng, dataDeclarationHelper);
67441
67565
  const builder = new _FormSourcesBuilder_FormSourcesBuilder__WEBPACK_IMPORTED_MODULE_21__.FormSourcesBuilder(additionalContent.formSourcesPath);
@@ -67443,23 +67567,24 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
67443
67567
  markupGenerator.generate(sugarRoot, builder);
67444
67568
  builder.addResource("settings.js", (0,_markupGenerator_getSettings__WEBPACK_IMPORTED_MODULE_9__.getSettings)(sugarRoot, additionalContent.gfv, additionalSettings, additionalContent.formJsonSettings));
67445
67569
  builder.addResource("requisiteList.js", (0,_RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_24__.getRequisiteList)(sugarRoot, fetchFunctions));
67446
- builder.addResource("lazyLoadDeclaration.js", lazyLoadGeneratorResult.content);
67447
67570
  const autocalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsGenerator__WEBPACK_IMPORTED_MODULE_18__.AutoCalculationsGenerator(dataDeclarationHelper, schemaRng);
67448
67571
  const formulasForCalculator = useOldCalculator ? formulas : [];
67449
67572
  builder.addResource("calculationFunctions.js", autocalcGenerator.generate(sugarRoot, additionalContent.autocalcsContent, formulasForCalculator));
67450
67573
  builder.addResource("dataDeclaration.js", dataDeclarationContent);
67451
- if ((_additionalContent$fo5 = (_additionalContent$fo6 = additionalContent.formJsonSettings) === null || _additionalContent$fo6 === void 0 ? void 0 : _additionalContent$fo6.useServerSideFLangNormalization) !== null && _additionalContent$fo5 !== void 0 ? _additionalContent$fo5 : false) {
67452
- var _additionalContent$fo7, _additionalContent$fo8, _additionalContent$fo9;
67574
+ let finalLazyLoadDeclaration = lazyLoadGeneratorResult.declaration;
67575
+ if ((_additionalContent$fo11 = (_additionalContent$fo12 = additionalContent.formJsonSettings) === null || _additionalContent$fo12 === void 0 ? void 0 : _additionalContent$fo12.useServerSideFLangNormalization) !== null && _additionalContent$fo11 !== void 0 ? _additionalContent$fo11 : false) {
67576
+ var _additionalContent$fo13, _additionalContent$fo14, _additionalContent$fo15;
67453
67577
  const defaultNormalizationRules = normalizationRulesGenerator.generateRules();
67578
+ finalLazyLoadDeclaration = mixLazyLoadingDeclarationWithServerOnlyPaths(lazyLoadGeneratorResult.declaration, defaultNormalizationRules.serverOnlyPaths);
67454
67579
  const customNormalizers = [{
67455
67580
  normalizerId: "formulas",
67456
- content: (_additionalContent$fo7 = additionalContent.formJsonSettings) !== null && _additionalContent$fo7 !== void 0 && _additionalContent$fo7.disableFlangRulesForEnableAutoFieldFeature ? "" : formulaOnlyNormalizationRulesGenerator.generateRules()
67581
+ content: (_additionalContent$fo13 = additionalContent.formJsonSettings) !== null && _additionalContent$fo13 !== void 0 && _additionalContent$fo13.disableFlangRulesForEnableAutoFieldFeature ? "" : formulaOnlyNormalizationRulesGenerator.generateRules()
67457
67582
  }, {
67458
67583
  normalizerId: "formulasWithInitializers",
67459
- content: (_additionalContent$fo8 = additionalContent.formJsonSettings) !== null && _additionalContent$fo8 !== void 0 && _additionalContent$fo8.disableFlangRulesForFormulaAndInitNormalizer ? "" : formulaAndInitOnlyNormalizationRulesGenerator.generateRules()
67584
+ content: (_additionalContent$fo14 = additionalContent.formJsonSettings) !== null && _additionalContent$fo14 !== void 0 && _additionalContent$fo14.disableFlangRulesForFormulaAndInitNormalizer ? "" : formulaAndInitOnlyNormalizationRulesGenerator.generateRules()
67460
67585
  }, {
67461
67586
  normalizerId: "autoValueForValueByDefault",
67462
- content: (_additionalContent$fo9 = additionalContent.formJsonSettings) !== null && _additionalContent$fo9 !== void 0 && _additionalContent$fo9.enableFlangRulesForAutoValueForValueByDefaultNormalizer ? autoValueForValueByDefaultNormalizationRuleGenerator.generateRules() : ""
67587
+ content: (_additionalContent$fo15 = additionalContent.formJsonSettings) !== null && _additionalContent$fo15 !== void 0 && _additionalContent$fo15.enableFlangRulesForAutoValueForValueByDefaultNormalizer ? autoValueForValueByDefaultNormalizationRuleGenerator.generateRules() : ""
67463
67588
  }].filter(x => (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.isNotNullOrEmpty)(x.content));
67464
67589
  const additionalNormalizationRules = additionalContent.additionalNormalizers ? additionalContent.additionalNormalizers.map(additionalNormalizer => {
67465
67590
  switch (additionalNormalizer.extension) {
@@ -67483,9 +67608,10 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
67483
67608
  throw new Error(`Cannot transform normalization file with ${additionalNormalizer.extension} extension`);
67484
67609
  }
67485
67610
  }) : [];
67486
- const resultRules = combineFlangRules(defaultNormalizationRules, ...additionalNormalizationRules, ...customNormalizers);
67611
+ const resultRules = combineFlangRules(defaultNormalizationRules.content, ...additionalNormalizationRules, ...customNormalizers);
67487
67612
  builder.addServerSideResource("ServerSide.normalize", resultRules);
67488
67613
  }
67614
+ builder.addResource("lazyLoadDeclaration.js", _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_29__.LazyLoadDeclarationGenerator.convertDeclarationToContent(finalLazyLoadDeclaration));
67489
67615
  const attachmentPathsGenerator = new _AttachmentPaths_AttachmentPathsGenerator__WEBPACK_IMPORTED_MODULE_27__.AttachmentPathsGenerator();
67490
67616
  const attachmentPaths = attachmentPathsGenerator.generate(sugarRoot);
67491
67617
  builder.addServerSideResource(`AttachmentPaths.json`, JSON.stringify(attachmentPaths));
@@ -67526,6 +67652,17 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
67526
67652
  return (0,_common_Errors_ProcessSugarErrors__WEBPACK_IMPORTED_MODULE_1__.processSugarErrors)(e, additionalContent.gfv);
67527
67653
  }
67528
67654
  }
67655
+ function mixLazyLoadingDeclarationWithServerOnlyPaths(declaration, paths) {
67656
+ const updateDeclaration = {
67657
+ ...declaration
67658
+ };
67659
+ for (const path of paths) {
67660
+ updateDeclaration[path.toString()] = {
67661
+ lazyLoadMode: "serverOnly"
67662
+ };
67663
+ }
67664
+ return updateDeclaration;
67665
+ }
67529
67666
  function combineFlangRules(baseRules, ...rules) {
67530
67667
  const customNormalizeRules = rules.filter(r => r.normalizerId).map(x => `--${x.normalizerId}--\n${x.content}`);
67531
67668
  const additionalBaseRules = rules.filter(r => !r.normalizerId).map(r => r.content);
@@ -68014,7 +68151,7 @@ class CustomKCLangToFlangRuleGenerator {
68014
68151
  const result = [];
68015
68152
  const getFormulaExpression = field => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.wrapWithArgumentsCondition)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.castOperandToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__.AbsoluteModelFieldPath(fullTarget, field), x => precalculationRules.push(x)), "G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(defaultValue));
68016
68153
  if (isTargetAutoField) {
68017
- result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "autoValue"), getFormulaExpression("autoValue")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue")), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.string)));
68154
+ result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "autoValue"), getFormulaExpression("autoValue")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.makeStringValueReference)(fullTarget.toCurrentIteration(), "value"), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoValue")), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.string)));
68018
68155
  } else {
68019
68156
  result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
68020
68157
  }
@@ -68104,8 +68241,8 @@ class FLangValidationBuildContext {
68104
68241
  buildBasicValidations(targetPath, typeNode, schemaTypeNode, optional, highOrderDescription, nodeGId) {
68105
68242
  var _typeNode$base, _typeNode$description;
68106
68243
  const validations = [];
68107
- const valueReference = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(targetPath.toCurrentIteration(), "value");
68108
- const autoValueReference = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(targetPath.toCurrentIteration(), "autoValue");
68244
+ const valueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(targetPath.toCurrentIteration(), "value");
68245
+ const autoValueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(targetPath.toCurrentIteration(), "autoValue");
68109
68246
  const baseName = (_typeNode$base = typeNode === null || typeNode === void 0 ? void 0 : typeNode.base) !== null && _typeNode$base !== void 0 ? _typeNode$base : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.baseType;
68110
68247
  const baseDescription = (_typeNode$description = typeNode === null || typeNode === void 0 ? void 0 : typeNode.description) !== null && _typeNode$description !== void 0 ? _typeNode$description : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description;
68111
68248
  if (baseName != undefined) {
@@ -68128,7 +68265,7 @@ class FLangValidationBuildContext {
68128
68265
  const schemaNode = this.schemaRng.getElementByPath(targetPath);
68129
68266
  const parentNode = schemaNode != undefined ? this.getFirstAcceptedParent(schemaNode) : undefined;
68130
68267
  const allChildrenPaths = parentNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_2__.FormSchemaRngElement ? this.schemaRng.getAllChildValueNodes(parentNode).map(x => this.schemaRng.getPath(x, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each)).filter(x => !(0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_4__.getMatchedAndDifferentModelPaths)(targetPath, x).differentPath.isContainIteration()) : undefined;
68131
- const restChecks = allChildrenPaths === null || allChildrenPaths === void 0 ? void 0 : allChildrenPaths.map(childPath => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(childPath.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(""))).reduce(_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.combineByAndFlangExpr, undefined);
68268
+ const restChecks = allChildrenPaths === null || allChildrenPaths === void 0 ? void 0 : allChildrenPaths.map(childPath => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(childPath.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(""))).reduce(_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.combineByAndFlangExpr, undefined);
68132
68269
  const errorValidations = validations.filter(x => !x.checkType || x.checkType === "error");
68133
68270
  const errorExpression = this.createFlangExpression((0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_5__.reverseArray)(errorValidations), targetPath, valueReference, "error", highOrderDescription !== null && highOrderDescription !== void 0 ? highOrderDescription : typeNode === null || typeNode === void 0 ? void 0 : typeNode.requiredDescription, optional, parentNode, restChecks);
68134
68271
  const result = [];
@@ -68223,7 +68360,7 @@ class FLangValidationBuildContext {
68223
68360
  const value = match === null || match === void 0 || (_match$3 = match[0]) === null || _match$3 === void 0 ? void 0 : _match$3[3];
68224
68361
  if (path != undefined && sign != undefined && value != undefined) {
68225
68362
  const fullPath = this.schemaRng.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(path, false)).normalize()).trimLastStarIfLastToken().toCurrentIteration();
68226
- const valueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(fullPath, "children");
68363
+ const valueRef = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(fullPath, "children");
68227
68364
  const len = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.LenExpression(valueRef);
68228
68365
  const argument = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(value);
68229
68366
  const getOperation = () => {
@@ -68507,6 +68644,7 @@ __webpack_require__.r(__webpack_exports__);
68507
68644
  /* harmony export */ ArgumentDeclarationExpression: () => (/* binding */ ArgumentDeclarationExpression),
68508
68645
  /* harmony export */ ArgumentReferenceExpression: () => (/* binding */ ArgumentReferenceExpression),
68509
68646
  /* harmony export */ ArrayExpression: () => (/* binding */ ArrayExpression),
68647
+ /* harmony export */ ArrayLengthExpression: () => (/* binding */ ArrayLengthExpression),
68510
68648
  /* harmony export */ BinaryBooleanExpression: () => (/* binding */ BinaryBooleanExpression),
68511
68649
  /* harmony export */ BinaryExpression: () => (/* binding */ BinaryExpression),
68512
68650
  /* harmony export */ BoolLiteralExpression: () => (/* binding */ BoolLiteralExpression),
@@ -68526,6 +68664,7 @@ __webpack_require__.r(__webpack_exports__);
68526
68664
  /* harmony export */ DifferenceInMonthsExpression: () => (/* binding */ DifferenceInMonthsExpression),
68527
68665
  /* harmony export */ DivisionBinaryExpression: () => (/* binding */ DivisionBinaryExpression),
68528
68666
  /* harmony export */ EqExpression: () => (/* binding */ EqExpression),
68667
+ /* harmony export */ ExistsExpression: () => (/* binding */ ExistsExpression),
68529
68668
  /* harmony export */ FLangBoolExpression: () => (/* binding */ FLangBoolExpression),
68530
68669
  /* harmony export */ FLangDecimalExpression: () => (/* binding */ FLangDecimalExpression),
68531
68670
  /* harmony export */ FLangDictExpression: () => (/* binding */ FLangDictExpression),
@@ -68677,7 +68816,7 @@ class ValueReferenceExpression extends FLangExpression {
68677
68816
  return [];
68678
68817
  }
68679
68818
  getType() {
68680
- return BuildInTypeExpression.string;
68819
+ return BuildInTypeExpression.object;
68681
68820
  }
68682
68821
  convertToString() {
68683
68822
  return `${toFLangString(this.modePath)}.${this.valueName}`;
@@ -68875,6 +69014,7 @@ class BuildInTypeExpression extends TypeReferenceExpression {
68875
69014
  }
68876
69015
  }
68877
69016
  _BuildInTypeExpression = BuildInTypeExpression;
69017
+ BuildInTypeExpression.object = new _BuildInTypeExpression("object");
68878
69018
  BuildInTypeExpression.decimal = new _BuildInTypeExpression("decimal");
68879
69019
  BuildInTypeExpression.string = new _BuildInTypeExpression("string");
68880
69020
  BuildInTypeExpression.dict = new _BuildInTypeExpression("dict");
@@ -69131,7 +69271,7 @@ class StringLiteralExpression extends ConstExpression {
69131
69271
  return JSON.stringify(this.stringValue);
69132
69272
  }
69133
69273
  }
69134
- class DecimalLiteralExpression extends FLangDecimalExpression {
69274
+ class DecimalLiteralExpression extends ConstExpression {
69135
69275
  constructor(value) {
69136
69276
  super();
69137
69277
  this.value = void 0;
@@ -69148,6 +69288,11 @@ class DecimalLiteralExpression extends FLangDecimalExpression {
69148
69288
  }
69149
69289
  }
69150
69290
  class DictLiteralExpression extends FLangExpression {
69291
+ constructor(value) {
69292
+ super();
69293
+ this.value = void 0;
69294
+ this.value = value;
69295
+ }
69151
69296
  getChildNodes() {
69152
69297
  return [];
69153
69298
  }
@@ -69155,7 +69300,9 @@ class DictLiteralExpression extends FLangExpression {
69155
69300
  return BuildInTypeExpression.dict;
69156
69301
  }
69157
69302
  convertToString() {
69158
- return `dict()`;
69303
+ var _this$value;
69304
+ const argument = this.value != undefined ? (_this$value = this.value) === null || _this$value === void 0 ? void 0 : _this$value.convertToString() : "";
69305
+ return `dict(${argument})`;
69159
69306
  }
69160
69307
  }
69161
69308
  class BoolLiteralExpression extends ConstExpression {
@@ -69701,7 +69848,39 @@ class ArrayExpression extends FLangExpression {
69701
69848
  }
69702
69849
  convertToString() {
69703
69850
  const items = this.items.map(x => x.convertToString()).join(", ");
69704
- return `array(${items})`;
69851
+ return `makeArray(${items})`;
69852
+ }
69853
+ }
69854
+ class ArrayLengthExpression extends FLangExpression {
69855
+ constructor(expression) {
69856
+ super();
69857
+ this.expression = void 0;
69858
+ this.expression = expression;
69859
+ }
69860
+ getType() {
69861
+ return BuildInTypeExpression.decimal;
69862
+ }
69863
+ *getChildNodes() {
69864
+ yield this.expression;
69865
+ }
69866
+ convertToString() {
69867
+ return `arrayLength(${this.expression.convertToString()})`;
69868
+ }
69869
+ }
69870
+ class ExistsExpression extends FLangExpression {
69871
+ constructor(source) {
69872
+ super();
69873
+ this.source = void 0;
69874
+ this.source = source;
69875
+ }
69876
+ getType() {
69877
+ return BuildInTypeExpression.bool;
69878
+ }
69879
+ *getChildNodes() {
69880
+ yield this.source;
69881
+ }
69882
+ convertToString() {
69883
+ return `exists(${this.source.convertToString()})`;
69705
69884
  }
69706
69885
  }
69707
69886
  class NullCoalesceExpression extends FLangExpression {
@@ -69837,7 +70016,7 @@ class GetOldExpression extends FLangExpression {
69837
70016
  return [];
69838
70017
  }
69839
70018
  getType() {
69840
- return BuildInTypeExpression.bool;
70019
+ return this.expression.getType();
69841
70020
  }
69842
70021
  convertToString() {
69843
70022
  return `old(${this.expression.convertToString()})`;
@@ -69872,6 +70051,9 @@ class SetStatement extends FLangStatement {
69872
70051
  "use strict";
69873
70052
  __webpack_require__.r(__webpack_exports__);
69874
70053
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
70054
+ /* harmony export */ arrayFieldNameSuffix: () => (/* binding */ arrayFieldNameSuffix),
70055
+ /* harmony export */ castFinalExpressionToStringIfNeed: () => (/* binding */ castFinalExpressionToStringIfNeed),
70056
+ /* harmony export */ castOperandIfNeed: () => (/* binding */ castOperandIfNeed),
69875
70057
  /* harmony export */ castOperandToBoolIfNeed: () => (/* binding */ castOperandToBoolIfNeed),
69876
70058
  /* harmony export */ castOperandToDateTimeIfNeed: () => (/* binding */ castOperandToDateTimeIfNeed),
69877
70059
  /* harmony export */ castOperandToDecimalIfNeed: () => (/* binding */ castOperandToDecimalIfNeed),
@@ -69880,19 +70062,34 @@ __webpack_require__.r(__webpack_exports__);
69880
70062
  /* harmony export */ combineByOrFlangExpr: () => (/* binding */ combineByOrFlangExpr),
69881
70063
  /* harmony export */ combineRulesWithOptionalSectionChecking: () => (/* binding */ combineRulesWithOptionalSectionChecking),
69882
70064
  /* harmony export */ decimalWrapper: () => (/* binding */ decimalWrapper),
70065
+ /* harmony export */ dictFieldNameSuffix: () => (/* binding */ dictFieldNameSuffix),
70066
+ /* harmony export */ ensureCorrectFieldNameByExpressionType: () => (/* binding */ ensureCorrectFieldNameByExpressionType),
69883
70067
  /* harmony export */ ensureOperandsOfTypeOrNull: () => (/* binding */ ensureOperandsOfTypeOrNull),
70068
+ /* harmony export */ extractValueReferenceFromCast: () => (/* binding */ extractValueReferenceFromCast),
69884
70069
  /* harmony export */ getAllExpressionChildren: () => (/* binding */ getAllExpressionChildren),
70070
+ /* harmony export */ hashSetFieldNameSuffix: () => (/* binding */ hashSetFieldNameSuffix),
70071
+ /* harmony export */ makeGetOld: () => (/* binding */ makeGetOld),
70072
+ /* harmony export */ makeNoDeps: () => (/* binding */ makeNoDeps),
70073
+ /* harmony export */ makeStringValueReference: () => (/* binding */ makeStringValueReference),
69885
70074
  /* harmony export */ nullCoalesceWithTypeCheck: () => (/* binding */ nullCoalesceWithTypeCheck),
69886
70075
  /* harmony export */ tryExtractValueReferenceAsStringFromDecimal: () => (/* binding */ tryExtractValueReferenceAsStringFromDecimal),
69887
70076
  /* harmony export */ wrapWithArgumentsCondition: () => (/* binding */ wrapWithArgumentsCondition),
69888
70077
  /* harmony export */ wrapWithDisableValueAutoInitFlagCheckIfRequired: () => (/* binding */ wrapWithDisableValueAutoInitFlagCheckIfRequired)
69889
70078
  /* harmony export */ });
69890
- /* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
69891
- /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
69892
- /* harmony import */ var _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
70079
+ /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! util */ "util");
70080
+ /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_0__);
70081
+ /* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
70082
+ /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
70083
+ /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
70084
+ /* harmony import */ var _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
69893
70085
 
69894
70086
 
69895
70087
 
70088
+
70089
+
70090
+ const dictFieldNameSuffix = "_dict";
70091
+ const arrayFieldNameSuffix = "_array";
70092
+ const hashSetFieldNameSuffix = "_hashSet";
69896
70093
  function* getAllExpressionChildren(node, descendantsFilter) {
69897
70094
  const children = node.getChildNodes();
69898
70095
  for (const child of children) {
@@ -69903,75 +70100,138 @@ function* getAllExpressionChildren(node, descendantsFilter) {
69903
70100
  }
69904
70101
  }
69905
70102
  function createValueRuleWithDisableValueAutoInitCheck(path, originalExpression) {
69906
- return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(path, "value"), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ConditionalExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.EqExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(path.toCurrentIteration(), "disableValueAutoInit"), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression("true")), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NoDepsExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(path.toCurrentIteration(), "value")), originalExpression));
70103
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(path, "value"), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ConditionalExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.EqExpression(makeStringValueReference(path.toCurrentIteration(), "disableValueAutoInit"), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression("true")), makeNoDeps(castOperandIfNeed(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(path.toCurrentIteration(), "value"), originalExpression.getType())), originalExpression));
69907
70104
  }
69908
70105
  function wrapWithDisableValueAutoInitFlagCheckIfRequired(formSchemaRng, x) {
69909
70106
  var _formSchemaRng$getEle;
69910
- return x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement && x.left.valueName === "value" && (_formSchemaRng$getEle = formSchemaRng.getElementByPath(x.left.modePath)) !== null && _formSchemaRng$getEle !== void 0 && _formSchemaRng$getEle.isIgnoreForcedValueSet() ? [createValueRuleWithDisableValueAutoInitCheck(x.left.modePath, x.right)] : [x];
70107
+ return x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement && x.left.valueName === "value" && (_formSchemaRng$getEle = formSchemaRng.getElementByPath(x.left.modePath)) !== null && _formSchemaRng$getEle !== void 0 && _formSchemaRng$getEle.isIgnoreForcedValueSet() ? [createValueRuleWithDisableValueAutoInitCheck(x.left.modePath, x.right)] : [x];
69911
70108
  }
69912
70109
  function wrapWithArgumentsCondition(expression) {
69913
- const childFilter = node => !(node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ReduceCallExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.GetSumByKeysExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NoDepsExpression);
69914
- const allValueRefNodes = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat([expression], getAllExpressionChildren(expression, childFilter)).map(x => x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression ? x : undefined).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__.isNotNullOrUndefined);
69915
- const uniquePaths = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.distinctBy(allValueRefNodes, x => x.convertToString());
69916
- const conditionExpression = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.reduce(uniquePaths, (acc, curr) => {
69917
- const currExpr = new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.AndBinaryExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NotEqExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(curr.modePath, curr.valueName), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression()), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NotEqExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(curr.modePath, curr.valueName), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression("")));
69918
- return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.OrBinaryExpression(acc, currExpr) : currExpr;
70110
+ const childFilter = node => !(node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ReduceCallExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.GetSumByKeysExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression);
70111
+ const allValueRefNodes = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.concat([expression], getAllExpressionChildren(expression, childFilter)).map(x => x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression ? x : undefined).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrUndefined);
70112
+ const uniquePaths = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.distinctBy(allValueRefNodes, x => x.convertToString());
70113
+ const conditionExpression = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.reduce(uniquePaths, (acc, curr) => {
70114
+ const currExpr = new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ExistsExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(curr.modePath, curr.valueName));
70115
+ return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.OrBinaryExpression(acc, currExpr) : currExpr;
69919
70116
  }, undefined);
69920
70117
  if (conditionExpression == undefined) {
69921
70118
  return expression;
69922
70119
  }
69923
- return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ConditionalExpression(conditionExpression, expression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression());
70120
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ConditionalExpression(conditionExpression, expression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullLiteralExpression());
69924
70121
  }
69925
70122
  function combineRulesWithOptionalSectionChecking(allRules, optionalSectionRulesBuilder) {
69926
- const allUniqueRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.distinctBy(allRules, x => x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement ? x.left.convertToString() : x.convertToString());
70123
+ const allUniqueRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.distinctBy(allRules, x => x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement ? x.left.convertToString() : x.convertToString());
69927
70124
  const allUniqueRulesWithOptionalChecks = Iterator.from(optionalSectionRulesBuilder.wrapRulesWithOptionalPageCheck(allUniqueRules)).map(x => x.convertToString()).reduce((x, y) => x + (x ? "\n" : "") + y, "");
69928
70125
  return allUniqueRulesWithOptionalChecks;
69929
70126
  }
69930
70127
  function tryExtractValueReferenceAsStringFromDecimal(expression) {
69931
- if (expression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal && expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression) {
70128
+ if (expression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.decimal && expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
69932
70129
  return expression.targetExpression;
69933
70130
  }
69934
70131
  return expression;
69935
70132
  }
70133
+ function castFinalExpressionToStringIfNeed(operandExpression, enableTypedExpression, decimalFormat = "G29") {
70134
+ if (enableTypedExpression && (operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.dict || operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.array || operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.hashSet)) {
70135
+ return operandExpression;
70136
+ }
70137
+ return castOperandToStringIfNeed(operandExpression, decimalFormat);
70138
+ }
69936
70139
  function castOperandToStringIfNeed(operandExpression, decimalFormat = "G29") {
69937
- if (operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.DateTimeExpression || operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.DateNowExpression) {
69938
- return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.DateToStringExpression(operandExpression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression("dd.MM.yyyy"));
70140
+ if (operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DateTimeExpression || operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DateNowExpression) {
70141
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DateToStringExpression(operandExpression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression("dd.MM.yyyy"));
70142
+ }
70143
+ if (operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.array || operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.hashSet) {
70144
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SerializeEnumerationExpression(operandExpression);
69939
70145
  }
69940
- if (operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.HashSetExpression) {
69941
- return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SerializeEnumerationExpression(operandExpression);
70146
+ return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string, decimalFormat != undefined && operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.decimal ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression(decimalFormat) : undefined) : operandExpression;
70147
+ }
70148
+ function castOperandIfNeed(operandExpression, type) {
70149
+ if (type instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression) {
70150
+ return operandExpression.getType() != type ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(operandExpression, type) : operandExpression;
69942
70151
  }
69943
- return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.string ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.string, decimalFormat != undefined && operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression(decimalFormat) : undefined) : operandExpression;
70152
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid type for cast: ${type}`);
69944
70153
  }
69945
70154
  function castOperandToBoolIfNeed(operandExpression) {
69946
- return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.bool ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.bool) : operandExpression;
70155
+ return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.bool ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.bool) : operandExpression;
69947
70156
  }
69948
70157
  function castOperandToDecimalIfNeed(operandExpression, defaultValue) {
69949
- return operandExpression.getType() !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal, defaultValue != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.DecimalLiteralExpression(defaultValue) : undefined) : operandExpression;
70158
+ return operandExpression.getType() !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.decimal ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.decimal, defaultValue != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DecimalLiteralExpression(defaultValue) : undefined) : operandExpression;
69950
70159
  }
69951
- const decimalWrapper = (ex, needWrapped) => needWrapped ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(ex, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal) : ex;
70160
+ const decimalWrapper = (ex, needWrapped) => needWrapped ? castOperandToDecimalIfNeed(ex) : ex;
69952
70161
  function castOperandToDateTimeIfNeed(operandExpression) {
69953
- return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dateTime ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dateTime) : operandExpression;
70162
+ return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.dateTime ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.dateTime) : operandExpression;
69954
70163
  }
69955
70164
  function nullCoalesceWithTypeCheck(argument, replacement) {
69956
- const isValid = argument.getType() === replacement.getType() || argument.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.null || replacement.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.null;
70165
+ const isValid = argument.getType() === replacement.getType() || argument.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.null || replacement.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.null;
69957
70166
  if (!isValid) {
69958
70167
  throw new Error("Couldn't build null coalesce expression: types not match");
69959
70168
  }
69960
- return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullCoalesceExpression(argument, replacement);
70169
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullCoalesceExpression(argument, replacement);
69961
70170
  }
69962
70171
  function ensureOperandsOfTypeOrNull(type, ...operands) {
69963
70172
  for (const operand of operands) {
69964
70173
  const operandType = operand.getType();
69965
- if (operandType !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.null && operandType !== type) {
70174
+ if (operandType !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.null && operandType !== type) {
69966
70175
  throw new Error(`Invalid operand type: required [${type}] but got ${operandType}`);
69967
70176
  }
69968
70177
  }
69969
70178
  }
69970
70179
  function combineByOrFlangExpr(acc, current) {
69971
- return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.OrBinaryExpression(acc, current) : current;
70180
+ return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.OrBinaryExpression(acc, current) : current;
69972
70181
  }
69973
70182
  function combineByAndFlangExpr(acc, current) {
69974
- return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.AndBinaryExpression(acc, current) : current;
70183
+ return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.AndBinaryExpression(acc, current) : current;
70184
+ }
70185
+ function makeNoDeps(expression) {
70186
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
70187
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression(expression);
70188
+ }
70189
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
70190
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression(expression.targetExpression), expression.targetType, expression.defaultValue);
70191
+ }
70192
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid NoDeps usage: argument must be native ValueReferenceExpression or wrapped to CastExpression!`);
70193
+ }
70194
+ function makeGetOld(expression) {
70195
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
70196
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.GetOldExpression(expression);
70197
+ }
70198
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
70199
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.GetOldExpression(expression.targetExpression), expression.targetType, expression.defaultValue);
70200
+ }
70201
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid GetOld usage: argument must be native ValueReferenceExpression or wrapped to CastExpression!`);
70202
+ }
70203
+ function makeStringValueReference(modePath, valueName) {
70204
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(modePath, valueName), _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string);
70205
+ }
70206
+ function extractValueReferenceFromCast(expression) {
70207
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
70208
+ return expression;
70209
+ }
70210
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
70211
+ return expression.targetExpression;
70212
+ }
70213
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression) {
70214
+ return expression.targetExpression;
70215
+ }
70216
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Cannot extract ValueReferenceExpression! ${(0,util__WEBPACK_IMPORTED_MODULE_0__.inspect)(expression)}`);
70217
+ }
70218
+ function ensureCorrectFieldNameByExpressionType(statement) {
70219
+ if (statement instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement) {
70220
+ const lastPart = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.last(statement.left.modePath.getPathParts());
70221
+ const lastStringPart = _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__.PathTokens.isSimpleToken(lastPart) ? lastPart : "";
70222
+ if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.dict && !lastStringPart.endsWith(dictFieldNameSuffix)) {
70223
+ throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${dictFieldNameSuffix}"`);
70224
+ }
70225
+ if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.hashSet && !lastStringPart.endsWith(hashSetFieldNameSuffix)) {
70226
+ throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${hashSetFieldNameSuffix}"`);
70227
+ }
70228
+ if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.array && !lastStringPart.endsWith(arrayFieldNameSuffix)) {
70229
+ throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${arrayFieldNameSuffix}"`);
70230
+ }
70231
+ if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string && (lastStringPart.endsWith(arrayFieldNameSuffix) || lastStringPart.endsWith(hashSetFieldNameSuffix) || lastStringPart.endsWith(dictFieldNameSuffix))) {
70232
+ throw new Error(`Suffix of path ${statement.left.modePath.toString()} must NOT be "${arrayFieldNameSuffix}", "${hashSetFieldNameSuffix}" or "${dictFieldNameSuffix}"`);
70233
+ }
70234
+ }
69975
70235
  }
69976
70236
 
69977
70237
  /***/ }),
@@ -70147,8 +70407,10 @@ __webpack_require__.r(__webpack_exports__);
70147
70407
  /* harmony import */ var _Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../Common/ModelPath/BuildIterationSequence */ "./Common/ModelPath/BuildIterationSequence.ts");
70148
70408
  /* harmony import */ var _Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../Common/ModelPath/PathSplitHelper */ "./Common/ModelPath/PathSplitHelper.ts");
70149
70409
  /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
70150
- /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
70151
- /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
70410
+ /* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
70411
+ /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
70412
+ /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
70413
+
70152
70414
 
70153
70415
 
70154
70416
 
@@ -70159,14 +70421,16 @@ __webpack_require__.r(__webpack_exports__);
70159
70421
 
70160
70422
 
70161
70423
  class FormulaExpressionToFlangExpressionConverter {
70162
- constructor(adjustPathMultiplicityFunc) {
70424
+ constructor(adjustPathMultiplicityFunc, options) {
70163
70425
  this.adjustPathMultiplicity = void 0;
70426
+ this.options = void 0;
70427
+ this.options = options;
70164
70428
  this.adjustPathMultiplicity = adjustPathMultiplicityFunc;
70165
70429
  }
70166
70430
  compileExpressionToFlangExpression(expression, prefix, target, addPrecalculationRule) {
70167
70431
  const resultExpr = this.compileExpressionToFlangExpressionInternal(expression, prefix, target, addPrecalculationRule);
70168
70432
  // Если формула это только прямое обращение к значене, то трактовать его как строку
70169
- if (resultExpr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression && resultExpr.targetType === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal && resultExpr.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression) {
70433
+ if (resultExpr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && resultExpr.targetType === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal && resultExpr.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70170
70434
  return resultExpr.targetExpression;
70171
70435
  }
70172
70436
  return resultExpr;
@@ -70183,24 +70447,24 @@ class FormulaExpressionToFlangExpressionConverter {
70183
70447
  return this.compiledArgumentExpression(prefix, target, expression.select, "decimal", addPrecalculationRule);
70184
70448
  }
70185
70449
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAbsExpression) {
70186
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AbsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70450
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AbsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70187
70451
  }
70188
70452
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaXAbsExpression) {
70189
- const expr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
70190
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.LtExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(expr), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AbsExpression(expr));
70453
+ const expr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
70454
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LtExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(expr), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AbsExpression(expr));
70191
70455
  }
70192
70456
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaRoundExpression) {
70193
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.RoundExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IntegerLiteralExpression(expression.fractionalDigits));
70457
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.RoundExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IntegerLiteralExpression(expression.fractionalDigits));
70194
70458
  }
70195
70459
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaFloorExpression) {
70196
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.FloorExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70460
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.FloorExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70197
70461
  }
70198
70462
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaChooseExpression) {
70199
70463
  const condExpr = this.compileExpressionToFlangExpressionInternal(expression.ifNode.condition, prefix, target, addPrecalculationRule);
70200
70464
  const thenExpr = this.compileExpressionToFlangExpressionInternal(expression.thenNode.expression, prefix, target, addPrecalculationRule);
70201
70465
  const elseExpr = this.compileExpressionToFlangExpressionInternal(expression.elseNode.expression, prefix, target, addPrecalculationRule);
70202
- const castToStringRequired = thenExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.string || elseExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.string;
70203
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(condExpr, castToStringRequired ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(thenExpr) : thenExpr, castToStringRequired ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(elseExpr) : elseExpr);
70466
+ const castToStringRequired = thenExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string || elseExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string;
70467
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(condExpr, castToStringRequired ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(thenExpr) : thenExpr, castToStringRequired ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(elseExpr) : elseExpr);
70204
70468
  }
70205
70469
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMultiplyExpression) {
70206
70470
  return this.compileMultiplyExpression(expression, prefix, target, addPrecalculationRule);
@@ -70212,14 +70476,14 @@ class FormulaExpressionToFlangExpressionConverter {
70212
70476
  return this.compileAndExpression(expression, prefix, target, addPrecalculationRule);
70213
70477
  }
70214
70478
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNotExpression) {
70215
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NegateUnaryExpression(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
70479
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NegateUnaryExpression(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
70216
70480
  }
70217
70481
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaConstExpression) {
70218
70482
  switch (expression.type) {
70219
70483
  case "string":
70220
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression(expression.value);
70484
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.value);
70221
70485
  case "decimal":
70222
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(expression.value);
70486
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.value);
70223
70487
  default:
70224
70488
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.NotSupportedError("Unknown constant type!");
70225
70489
  }
@@ -70228,35 +70492,35 @@ class FormulaExpressionToFlangExpressionConverter {
70228
70492
  return this.compileDivisionExpression(expression, prefix, target, addPrecalculationRule);
70229
70493
  }
70230
70494
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMinusExpression) {
70231
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.MinusUnaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70495
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MinusUnaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70232
70496
  }
70233
70497
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGtExpression) {
70234
70498
  const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
70235
70499
  const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
70236
70500
  const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
70237
70501
  const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
70238
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GtExpression(left, right);
70502
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GtExpression(left, right);
70239
70503
  }
70240
70504
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLtExpression) {
70241
70505
  const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
70242
70506
  const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
70243
70507
  const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
70244
70508
  const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
70245
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.LtExpression(left, right);
70509
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LtExpression(left, right);
70246
70510
  }
70247
70511
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGeExpression) {
70248
70512
  const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
70249
70513
  const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
70250
70514
  const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
70251
70515
  const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
70252
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GeExpression(left, right);
70516
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GeExpression(left, right);
70253
70517
  }
70254
70518
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLeExpression) {
70255
70519
  const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
70256
70520
  const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
70257
70521
  const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
70258
70522
  const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
70259
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.LeExpression(left, right);
70523
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LeExpression(left, right);
70260
70524
  }
70261
70525
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaEqExpression) {
70262
70526
  return this.compileEqExpression(prefix, target, expression, addPrecalculationRule);
@@ -70266,105 +70530,105 @@ class FormulaExpressionToFlangExpressionConverter {
70266
70530
  // TODO: тут необходимо учесть, что exists может смотреть на множественность
70267
70531
  // TODO: реализовать в рамках задачи https://yt.skbkontur.ru/issue/FS-7385
70268
70532
  /* eslint-enable no-warning-comments */
70269
- const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
70270
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.EqExpression(arg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.EqExpression(arg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression())));
70533
+ const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.extractValueReferenceFromCast)(this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule));
70534
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ExistsExpression(arg);
70271
70535
  }
70272
70536
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaWhenExpression) {
70273
70537
  const condition = this.compileExpressionToFlangExpressionInternal(expression.expressions[0], prefix, target, addPrecalculationRule);
70274
70538
  const thenExpression = this.compileExpressionToFlangExpressionInternal(expression.expressions[1], prefix, target, addPrecalculationRule);
70275
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(condition, thenExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IntegerLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IntegerLiteralExpression(1)));
70539
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(condition, thenExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IntegerLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IntegerLiteralExpression(1)));
70276
70540
  }
70277
70541
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaRegexMatchExpression) {
70278
70542
  const arg = this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule);
70279
- const correctedArg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.tryExtractValueReferenceAsStringFromDecimal)(arg);
70280
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.RegexMatchExpression(correctedArg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression(expression.pattern));
70543
+ const correctedArg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.tryExtractValueReferenceAsStringFromDecimal)(arg);
70544
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.RegexMatchExpression(correctedArg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.pattern));
70281
70545
  }
70282
70546
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaCountExpression) {
70283
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule, "Count"), 0);
70547
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule, "Count"), 0);
70284
70548
  }
70285
70549
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLengthExpression) {
70286
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.LenExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule)));
70550
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LenExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule)));
70287
70551
  }
70288
70552
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaConcatExpression) {
70289
70553
  return this.compileConcatExpression(expression, prefix, target, addPrecalculationRule);
70290
70554
  }
70291
70555
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaSubstringExpression) {
70292
70556
  const arg = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
70293
- const argAsString = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(arg, arg.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal ? "G29" : undefined);
70294
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.SubstringExpression(argAsString, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(expression.start), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(expression.length));
70557
+ const argAsString = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg, arg.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal ? "G29" : undefined);
70558
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SubstringExpression(argAsString, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.start), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.length));
70295
70559
  }
70296
70560
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNewLineExpression) {
70297
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression("\r\n");
70561
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("\r\n");
70298
70562
  }
70299
70563
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNoDepsNode) {
70300
70564
  const noDepsExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
70301
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NoDepsExpression(noDepsExpression);
70565
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)(noDepsExpression);
70302
70566
  }
70303
70567
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateNowExpression) {
70304
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DateNowExpression();
70568
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DateNowExpression();
70305
70569
  }
70306
70570
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetDaysInMonthExpression) {
70307
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetDaysInMonthExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70571
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetDaysInMonthExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70308
70572
  }
70309
70573
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetDayExpression) {
70310
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetDayExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70574
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetDayExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70311
70575
  }
70312
70576
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetMonthExpression) {
70313
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetMonthExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70577
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetMonthExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70314
70578
  }
70315
70579
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetYearExpression) {
70316
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetYearExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70580
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetYearExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70317
70581
  }
70318
70582
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsDateExpression) {
70319
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IsDateExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70583
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsDateExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70320
70584
  }
70321
70585
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDifferenceInMonthsExpression) {
70322
- const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
70323
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DifferenceInMonthsExpression(expressions);
70586
+ const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
70587
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DifferenceInMonthsExpression(expressions);
70324
70588
  }
70325
70589
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDifferenceInDaysExpression) {
70326
- const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
70327
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DifferenceInDaysExpression(expressions);
70590
+ const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
70591
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DifferenceInDaysExpression(expressions);
70328
70592
  }
70329
70593
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAddDaysExpression) {
70330
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AddDaysExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(expression.amount));
70594
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddDaysExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.amount));
70331
70595
  }
70332
70596
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAddMonthsExpression) {
70333
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AddMonthsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(expression.amount));
70597
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddMonthsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.amount));
70334
70598
  }
70335
70599
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAddYearsExpression) {
70336
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AddYearsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(expression.amount));
70600
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddYearsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.amount));
70337
70601
  }
70338
70602
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateToStringExpression) {
70339
70603
  var _expression$format;
70340
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DateToStringExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression((_expression$format = expression.format) !== null && _expression$format !== void 0 ? _expression$format : "dd.MM.yyyy"));
70604
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DateToStringExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression((_expression$format = expression.format) !== null && _expression$format !== void 0 ? _expression$format : "dd.MM.yyyy"));
70341
70605
  }
70342
70606
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateTimeExpression) {
70343
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.dateTime);
70607
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dateTime);
70344
70608
  }
70345
70609
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsSnilsExpression) {
70346
70610
  const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
70347
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IsSnilsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(arg));
70611
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsSnilsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
70348
70612
  }
70349
70613
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsRegNumSfrExpression) {
70350
70614
  const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
70351
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IsRegNumSfrExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(arg));
70615
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsRegNumSfrExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
70352
70616
  }
70353
70617
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsInnExpression) {
70354
70618
  const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
70355
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IsInnExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(arg));
70619
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsInnExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
70356
70620
  }
70357
70621
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsValidMirCardNumberExpression) {
70358
70622
  const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
70359
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IsValidMirCardNumberExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(arg));
70623
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsValidMirCardNumberExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
70360
70624
  }
70361
70625
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaArrayExpression) {
70362
70626
  const items = expression.items.map(arg => this.compileEnumerationItem(arg, prefix, target, addPrecalculationRule));
70363
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArrayExpression(items);
70627
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArrayExpression(items);
70364
70628
  }
70365
70629
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaFirstOrDefaultExpression) {
70366
70630
  const firstOrDefaultExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
70367
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.FirstOrDefaultExpression(firstOrDefaultExpression);
70631
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.FirstOrDefaultExpression(firstOrDefaultExpression);
70368
70632
  }
70369
70633
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaHashSetExpression) {
70370
70634
  if (expression.expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaArgumentExpression) {
@@ -70380,21 +70644,21 @@ class FormulaExpressionToFlangExpressionConverter {
70380
70644
  const lastStarIndexSecondPart = secondPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
70381
70645
  const secondPartFinalParts = secondPartParts.slice(0, lastStarIndexSecondPart);
70382
70646
  const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)([...firstPart.getPathParts(), ...secondPartFinalParts]).trimLastStarIfLastToken();
70383
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.hashSet, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.hashSet)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AddArrayExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.HashSetExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration(), "value")))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.HashSetExpression());
70647
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.hashSet, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.hashSet)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddArrayExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration(), "value")))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression());
70384
70648
  }
70385
70649
  }
70386
70650
  const hashSetExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
70387
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.HashSetExpression(hashSetExpression);
70651
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression(hashSetExpression);
70388
70652
  }
70389
70653
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression) {
70390
70654
  const filterColumn = this.compileExpressionToFlangExpressionInternal(expression.filterColumn.filterColumn, prefix, target, addPrecalculationRule);
70391
70655
  const filterKey = this.compileExpressionToFlangExpressionInternal(expression.filterKey.filterKey, prefix, target, addPrecalculationRule);
70392
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetPicklistValuesExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression(expression.gId), filterColumn, filterKey, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression(expression.resultColumn));
70656
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetPicklistValuesExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.gId), filterColumn, filterKey, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.resultColumn));
70393
70657
  }
70394
70658
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsValidAccountNumberExpression) {
70395
70659
  const bik = this.compiledArgumentExpression(prefix, target, expression.bik, "string", addPrecalculationRule);
70396
70660
  const account = this.compiledArgumentExpression(prefix, target, expression.account, "string", addPrecalculationRule);
70397
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IsValidAccountNumberExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(bik), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(account));
70661
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsValidAccountNumberExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(bik), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(account));
70398
70662
  }
70399
70663
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGroupSumExpression) {
70400
70664
  return this.compileGroupSumExpression(prefix, target, expression, addPrecalculationRule);
@@ -70402,18 +70666,30 @@ class FormulaExpressionToFlangExpressionConverter {
70402
70666
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGroupCountExpression) {
70403
70667
  return this.compileGroupCountExpression(prefix, target, expression, addPrecalculationRule);
70404
70668
  }
70669
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMakeDictExpression) {
70670
+ return this.compileMakeDictExpression(prefix, target, expression, addPrecalculationRule);
70671
+ }
70672
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetSumByKeysExpression) {
70673
+ return this.compileGetSumByKeysExpression(prefix, target, expression, addPrecalculationRule);
70674
+ }
70405
70675
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaOneOfExpression) {
70406
- const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
70407
- const items = expression.items.expressions.map(item => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(item, prefix, target, addPrecalculationRule)));
70408
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.OneOfExpression(arg, items);
70676
+ const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
70677
+ const items = expression.items.expressions.map(item => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(item, prefix, target, addPrecalculationRule)));
70678
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OneOfExpression(arg, items);
70409
70679
  }
70410
70680
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaHasAutoFlagExpression) {
70411
- const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
70412
- const valueRefExpression = arg instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression ? arg : undefined;
70413
- if (valueRefExpression == undefined) {
70414
- throw new Error("hasAutoFlag supports only Argument expression (ValueReferenceExpression) as parameter.");
70415
- }
70416
- const expr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(valueRefExpression.modePath, "value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(valueRefExpression.modePath, "autoFlag")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression("true")));
70681
+ const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
70682
+ const getValueReferenceExpression = () => {
70683
+ if (arg instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70684
+ return arg;
70685
+ }
70686
+ if (arg instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && arg.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70687
+ return arg.targetExpression;
70688
+ }
70689
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)("hasAutoFlag supports only Argument expression (ValueReferenceExpression) as parameter.");
70690
+ };
70691
+ const valueRefExpression = getValueReferenceExpression();
70692
+ const expr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(valueRefExpression.modePath, "value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(valueRefExpression.modePath, "autoFlag")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("true")));
70417
70693
  return expr;
70418
70694
  }
70419
70695
  throw new Error(`Unsupported type of node: ${expression.constructor.name}, ${expression.sourceXmlNode.name}`);
@@ -70422,7 +70698,7 @@ class FormulaExpressionToFlangExpressionConverter {
70422
70698
  if (formulaExpression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateTimeExpression || formulaExpression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateNowExpression) {
70423
70699
  return flangExpression;
70424
70700
  }
70425
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(flangExpression);
70701
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(flangExpression);
70426
70702
  }
70427
70703
  compileEqExpression(prefix, target, expression, addPrecalculationRule) {
70428
70704
  const left = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
@@ -70430,12 +70706,109 @@ class FormulaExpressionToFlangExpressionConverter {
70430
70706
 
70431
70707
  // Сейчас в АР иногда проверку на decimal значение делаем через [Значение != "Какая-то строка"]
70432
70708
  // Поэтому при такой проверке вычитываем поле "Значение" как строку
70433
- if (left.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal && right.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.string && left instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression && left.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression) {
70434
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.EqExpression(left.targetExpression, right);
70709
+ if (left.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal && right.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string && left instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && left.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70710
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(left.targetExpression), right);
70435
70711
  }
70436
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(left), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(right));
70712
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(left), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(right));
70437
70713
  }
70438
- compileGroupSumExpressionWithCustomValueExpression(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
70714
+ compileMakeDictExpressionImpl(prefix, target, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
70715
+ const getOldSourceValueExpression = () => {
70716
+ if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70717
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(sourceValueExpression);
70718
+ }
70719
+ if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && sourceValueExpression.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70720
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(sourceValueExpression.targetExpression), sourceValueExpression.targetType, sourceValueExpression.defaultValue);
70721
+ }
70722
+ if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConstExpression) {
70723
+ return sourceValueExpression;
70724
+ }
70725
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)(`SourceValueExpression for makeDict must be reference to value or constant.
70726
+ Converted Object: ${JSON.stringify(sourceValueExpression)}`);
70727
+ };
70728
+ const oldSourceValueExpression = getOldSourceValueExpression();
70729
+ const matchedPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
70730
+ const firstPart = matchedPaths.matchedPath.toCurrentIteration();
70731
+ const secondPart = matchedPaths.differentPath;
70732
+ const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(firstPart.joinWith(secondPart).getLastListPath());
70733
+ const keys = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression([new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value")], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
70734
+ const oldKeys = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression([(0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value"))], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
70735
+ const reduceExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), keys, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(sourceValueExpression)), oldKeys, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MinusUnaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(oldSourceValueExpression))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), keys, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(sourceValueExpression)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(target.path.toCurrentIteration(), "value"))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression()));
70736
+ return reduceExpression;
70737
+ }
70738
+ compileMakeDictExpression(prefix, target, expression, addPrecalculationRule) {
70739
+ const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
70740
+ const sourceValueExpression = this.compileExpressionToFlangExpressionInternal(expression.sourceValueExpression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__.AbsoluteModelFieldPath(sourceKeyPath, "value"), addPrecalculationRule);
70741
+ const reduceExpression = this.compileMakeDictExpressionImpl(prefix, target, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70742
+ return reduceExpression;
70743
+ }
70744
+ compileArrayOfTargetKeys(prefix, target, targetKeys, addPrecalculationRule) {
70745
+ const deserializedKeys = targetKeys.items[0] instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression ? this.compileExpressionToFlangExpressionInternal(targetKeys.items[0], prefix, target, addPrecalculationRule) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression(targetKeys.items.map(i => {
70746
+ const item = this.compileEnumerationItem(i, prefix, target, addPrecalculationRule);
70747
+ if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConstExpression) {
70748
+ return item;
70749
+ }
70750
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.extractValueReferenceFromCast)(item);
70751
+ }), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
70752
+ return deserializedKeys;
70753
+ }
70754
+ compileGetSumByKeysExpressionImpl(prefix, target, dictPath, targetKeys, addPrecalculationRule) {
70755
+ const finalValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(dictPath, "value")), targetKeys);
70756
+ return finalValueExpression;
70757
+ }
70758
+ compileGetSumByKeysExpression(prefix, target, expression, addPrecalculationRule) {
70759
+ const dictPath = this.preparePathAndAdjustMultiplicity(prefix, expression.dictPath);
70760
+ const targetKeys = expression.targetKeys;
70761
+ const deserializedKeys = this.compileArrayOfTargetKeys(prefix, target, targetKeys, addPrecalculationRule);
70762
+ return this.compileGetSumByKeysExpressionImpl(prefix, target, dictPath, deserializedKeys, addPrecalculationRule);
70763
+ }
70764
+ compileGroupSumExpressionWithPersistentDictionary(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
70765
+ const matchPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
70766
+ const sourceKeyParts = sourceKeyPath.getPathPartsAsArray();
70767
+ const firstPart = matchPaths.matchedPath;
70768
+ const firstPartLength = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.count(firstPart.getPathParts());
70769
+ const secondParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength));
70770
+ const getIterationPathWithNestedMultiplicity = () => firstPart;
70771
+ const getIterationPathWithoutNestedMultiplicity = () => {
70772
+ const firstPartParts = matchPaths.matchedPath.getPathPartsAsArray();
70773
+ const lastStarIndexSecondPart = firstPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
70774
+ return (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(sourceKeyParts.slice(0, lastStarIndexSecondPart)).getParentPath();
70775
+ };
70776
+ const finalIterPath = secondParts.isContainCurrentOrEachIteration() ? getIterationPathWithNestedMultiplicity() : getIterationPathWithoutNestedMultiplicity();
70777
+ if (finalIterPath.isEmpty()) {
70778
+ throw new Error("Error occurred while trying parse path for reduce: " + firstPart.toLegacyPath());
70779
+ }
70780
+ const extractNameFromPath = path => Iterator.from(path.getPathParts()).filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken).toArray().join("_");
70781
+ const extractNameFromExpression = (basePathForDict, expr) => {
70782
+ const exprAsValueRef = expr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression ? expr : expr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && expr.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression ? expr.targetExpression : undefined;
70783
+ if (exprAsValueRef != undefined) {
70784
+ return extractNameFromPath((0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(basePathForDict, exprAsValueRef.modePath).differentPath);
70785
+ }
70786
+ const exprAsConst = expr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConstExpression ? expr : expr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && expr.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConstExpression ? expr.targetExpression : undefined;
70787
+ if (exprAsConst != undefined) {
70788
+ if (exprAsConst instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression) {
70789
+ return `constant_${exprAsConst.value}`;
70790
+ }
70791
+ if (exprAsConst instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression) {
70792
+ return `constant_${exprAsConst.stringValue}`;
70793
+ }
70794
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)("Can't convert sourceValueExpression for generated dictionary name: unsupported type of constant!");
70795
+ }
70796
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)("Can't convert sourceValueExpression for generated dictionary name!");
70797
+ };
70798
+ const basePathForDict = finalIterPath;
70799
+ const keyDiffPathText = extractNameFromPath((0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(basePathForDict, sourceKeyPath).differentPath);
70800
+ const valueDiffPathText = extractNameFromExpression(basePathForDict, sourceValueExpression);
70801
+ const dictPath = basePathForDict.joinWith(`${keyDiffPathText}_${valueDiffPathText}_generated${_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.dictFieldNameSuffix}`);
70802
+ const dictPathWithField = new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__.AbsoluteModelFieldPath(dictPath, "value");
70803
+ const basePathForDictPrefix = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(Iterator.from(basePathForDict.getPathParts()).filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken).toArray());
70804
+ const dictExpression = this.compileMakeDictExpressionImpl(basePathForDictPrefix, dictPathWithField, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70805
+ const dictStatement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(dictPathWithField.path, "value"), dictExpression);
70806
+ addPrecalculationRule(dictStatement);
70807
+ const deserializedKeys = this.compileArrayOfTargetKeys(prefix, target, targetKeys, addPrecalculationRule);
70808
+ const finalValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(dictStatement.left.modePath.toCurrentIteration(), dictStatement.left.valueName)), deserializedKeys);
70809
+ return finalValueExpression;
70810
+ }
70811
+ compileGroupSumExpressionWithoutPersistentDictionaries(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
70439
70812
  const matchPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
70440
70813
  const sourceKeyParts = sourceKeyPath.getPathPartsAsArray();
70441
70814
  const firstPart = matchPaths.matchedPath.toCurrentIteration();
@@ -70456,10 +70829,10 @@ class FormulaExpressionToFlangExpressionConverter {
70456
70829
  if (finalIterPath.isEmpty()) {
70457
70830
  throw new Error("Error occurred while trying parse path for reduce: " + firstPart.toLegacyPath());
70458
70831
  }
70459
- const keys = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DeserializeEnumerationExpression([new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value")], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BoolLiteralExpression(true));
70460
- const reduceExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.dict)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentReferenceExpression("result"), keys, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(sourceValueExpression))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DictLiteralExpression());
70461
- const deserializedKeys = targetKeys.items[0] instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression ? this.compileExpressionToFlangExpressionInternal(targetKeys.items[0], prefix, target, addPrecalculationRule) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DeserializeEnumerationExpression(targetKeys.items.map(i => this.compileEnumerationItem(i, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BoolLiteralExpression(true));
70462
- const finalValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetSumByKeysExpression(reduceExpression, deserializedKeys !== null && deserializedKeys !== void 0 ? deserializedKeys : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)());
70832
+ const keys = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression([new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value")], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
70833
+ const reduceExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), keys, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(sourceValueExpression))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression());
70834
+ const deserializedKeys = targetKeys.items[0] instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression ? this.compileExpressionToFlangExpressionInternal(targetKeys.items[0], prefix, target, addPrecalculationRule) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression(targetKeys.items.map(i => this.compileEnumerationItem(i, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
70835
+ const finalValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetSumByKeysExpression(reduceExpression, deserializedKeys !== null && deserializedKeys !== void 0 ? deserializedKeys : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)());
70463
70836
  return finalValueExpression;
70464
70837
  }
70465
70838
  compileEnumerationItem(expression, prefix, target, addPrecalculationRule) {
@@ -70468,62 +70841,80 @@ class FormulaExpressionToFlangExpressionConverter {
70468
70841
  }
70469
70842
  return this.compileExpressionToFlangExpressionInternal(expression, prefix, target, addPrecalculationRule);
70470
70843
  }
70844
+ compileGroupSumExpressionWithCustomValueExpression(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
70845
+ return this.options.enableGroupSumAutoConversion ? this.compileGroupSumExpressionWithPersistentDictionary(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) : this.compileGroupSumExpressionWithoutPersistentDictionaries(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70846
+ }
70471
70847
  compileGroupSumExpression(prefix, target, expression, addPrecalculationRule) {
70472
70848
  const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
70473
70849
  const sourceValuePath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceValuePath);
70474
- const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(sourceValuePath.toCurrentIteration(), "value");
70850
+ const sourceValueExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(sourceValuePath.toCurrentIteration(), "value");
70475
70851
  return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, expression.targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70476
70852
  }
70477
70853
  compileGroupCountExpression(prefix, target, expression, addPrecalculationRule) {
70478
70854
  const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
70479
- const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(1);
70855
+ const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(1);
70480
70856
  return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, expression.targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70481
70857
  }
70858
+ convertExpressionTypePropertyToFLangType(type) {
70859
+ switch (type) {
70860
+ case "string":
70861
+ return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string;
70862
+ case "array":
70863
+ return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.array;
70864
+ case "decimal":
70865
+ return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal;
70866
+ case "dict":
70867
+ return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict;
70868
+ default:
70869
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)(`Unknown ExpressionTypeProperty [${type}]`);
70870
+ }
70871
+ }
70482
70872
  compiledArgumentExpression(prefix, target, selectPath, selectType, addPrecalculationRule, aggregationFunction = "Sum") {
70873
+ const builtInType = this.convertExpressionTypePropertyToFLangType(selectType !== null && selectType !== void 0 ? selectType : "string");
70483
70874
  const adjustedSelectPath = this.preparePathAndAdjustMultiplicity(prefix, selectPath);
70484
70875
  const splitInfo = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, adjustedSelectPath);
70485
70876
  const baseSelectPath = splitInfo.matchedPath;
70486
70877
  if (!splitInfo.differentPath.isContainIteration()) {
70487
- const valueRefExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
70488
- const finalValue = splitInfo.differentPath.isEmpty() && target.field === "value" ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NoDepsExpression(valueRefExpression) : valueRefExpression;
70489
- return selectType === "decimal" ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(finalValue) : finalValue;
70878
+ const valueRefExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
70879
+ const finalValue = splitInfo.differentPath.isEmpty() && target.field === "value" ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)(valueRefExpression) : valueRefExpression;
70880
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandIfNeed)(finalValue, builtInType);
70490
70881
  } else {
70491
70882
  var _countValueExpression;
70492
- let resultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
70883
+ let resultValueExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(adjustedSelectPath.toCurrentIteration().normalize(), "value");
70493
70884
  let countValueExpression = undefined;
70494
70885
  const iterationEntries = [...(0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.reverseArray)((0,_Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_4__.buildIterationSequence)(splitInfo.differentPath))];
70495
70886
  for (const iterationEntry of iterationEntries) {
70496
70887
  const iterablePath = baseSelectPath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(iterationEntry.iterable.getPathPartsAsArray()));
70497
70888
  const suffixWithoutMultiple = iterationEntry.suffix.getPathPartsAsArray().filter(x => _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken(x));
70498
- const nextResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").normalize(), "value");
70499
- const currentSumExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").toCurrentIteration().normalize(), "value");
70500
- const countResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").normalize(), "value");
70501
- const currenCountExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").toCurrentIteration().normalize(), "value");
70502
- const sumReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetOldExpression(resultValueExpression), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(nextResultValueExpression.modePath.toCurrentIteration(), nextResultValueExpression.valueName))), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression())));
70503
- addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.SetStatement(nextResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(sumReduceExpr, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression("G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression(""))));
70504
- const countReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(countValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IncrementalFlagExpression(), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetOldExpression(resultValueExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetOldExpression(resultValueExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GetOldExpression(countValueExpression), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(countResultValueExpression.modePath.toCurrentIteration(), countResultValueExpression.valueName))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)));
70505
- addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.SetStatement(countResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.CastExpression(countReduceExpr, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression("G29"))));
70889
+ const nextResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").normalize(), "value");
70890
+ const currentSumExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").toCurrentIteration().normalize(), "value");
70891
+ const countResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").normalize(), "value");
70892
+ const currenCountExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").toCurrentIteration().normalize(), "value");
70893
+ const sumReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(resultValueExpression), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(nextResultValueExpression.modePath.toCurrentIteration(), nextResultValueExpression.valueName))), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())));
70894
+ addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SetStatement(nextResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(sumReduceExpr, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(""))));
70895
+ const countReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(countValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(resultValueExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(resultValueExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(countValueExpression), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(countResultValueExpression.modePath.toCurrentIteration(), countResultValueExpression.valueName))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)));
70896
+ addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SetStatement(countResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(countReduceExpr, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("G29"))));
70506
70897
  resultValueExpression = currentSumExpression;
70507
70898
  countValueExpression = currenCountExpression;
70508
70899
  }
70509
70900
  const finalValue = aggregationFunction === "Sum" ? resultValueExpression : (_countValueExpression = countValueExpression) !== null && _countValueExpression !== void 0 ? _countValueExpression : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)();
70510
- return selectType === "decimal" ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(finalValue) : finalValue;
70901
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandIfNeed)(finalValue, builtInType);
70511
70902
  }
70512
70903
  }
70513
70904
  compileSumExpression(expression, prefix, target, addPrecalculationRule) {
70514
70905
  const result = expression.arguments.reduce((acc, curr) => {
70515
- const currExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0));
70516
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.SumBinaryExpression(acc, currExpr) : currExpr;
70906
+ const currExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0));
70907
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SumBinaryExpression(acc, currExpr) : currExpr;
70517
70908
  }, undefined);
70518
70909
  if (result == undefined) {
70519
70910
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
70520
70911
  }
70521
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.wrapWithArgumentsCondition)(result);
70912
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
70522
70913
  }
70523
70914
  compileConcatExpression(expression, prefix, target, addPrecalculationRule) {
70524
70915
  const result = expression.arguments.reduce((acc, curr) => {
70525
- const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule));
70526
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConcatStringsExpression(acc, currExpr) : currExpr;
70916
+ const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule));
70917
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConcatStringsExpression(acc, currExpr) : currExpr;
70527
70918
  }, undefined);
70528
70919
  if (result == undefined) {
70529
70920
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
@@ -70533,7 +70924,7 @@ class FormulaExpressionToFlangExpressionConverter {
70533
70924
  compileOrExpression(expression, prefix, target, addPrecalculationRule) {
70534
70925
  const result = expression.arguments.reduce((acc, curr) => {
70535
70926
  const currExpr = this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule);
70536
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.OrBinaryExpression(acc, currExpr) : currExpr;
70927
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OrBinaryExpression(acc, currExpr) : currExpr;
70537
70928
  }, undefined);
70538
70929
  if (result == undefined) {
70539
70930
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
@@ -70543,7 +70934,7 @@ class FormulaExpressionToFlangExpressionConverter {
70543
70934
  compileAndExpression(expression, prefix, target, addPrecalculationRule) {
70544
70935
  const result = expression.arguments.reduce((acc, curr) => {
70545
70936
  const currExpr = this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule);
70546
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AndBinaryExpression(acc, currExpr) : currExpr;
70937
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AndBinaryExpression(acc, currExpr) : currExpr;
70547
70938
  }, undefined);
70548
70939
  if (result == undefined) {
70549
70940
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
@@ -70552,24 +70943,24 @@ class FormulaExpressionToFlangExpressionConverter {
70552
70943
  }
70553
70944
  compileMultiplyExpression(expression, prefix, target, addPrecalculationRule) {
70554
70945
  const result = expression.arguments.reduce((acc, curr) => {
70555
- const expr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0));
70556
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.MultiplyBinaryExpression(acc, expr) : expr;
70946
+ const expr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0));
70947
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MultiplyBinaryExpression(acc, expr) : expr;
70557
70948
  }, undefined);
70558
70949
  if (result == undefined) {
70559
70950
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
70560
70951
  }
70561
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.wrapWithArgumentsCondition)(result);
70952
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
70562
70953
  }
70563
70954
  compileDivisionExpression(expression, prefix, target, addPrecalculationRule) {
70564
- const makeDivision = (numerator, denominator) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NotEqExpression(denominator, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DivisionBinaryExpression(numerator, denominator), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NullLiteralExpression());
70955
+ const makeDivision = (numerator, denominator) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(denominator, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DivisionBinaryExpression(numerator, denominator), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression());
70565
70956
  const result = expression.arguments.reduce((acc, curr) => {
70566
- const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule), 0);
70957
+ const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule), 0);
70567
70958
  return acc != undefined ? makeDivision(acc, currExpr) : currExpr;
70568
70959
  }, undefined);
70569
70960
  if (result == undefined) {
70570
70961
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
70571
70962
  }
70572
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.wrapWithArgumentsCondition)(result);
70963
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
70573
70964
  }
70574
70965
  preparePathAndAdjustMultiplicity(prefix, path) {
70575
70966
  const resultPath = this.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(path.replace(/\@/g, ""), "auto")).normalize());
@@ -70679,9 +71070,10 @@ class AutoValueForValueByDefaultNormalizationRuleGenerator {
70679
71070
  const createValueRuleFromAutoValueRule = autoValueRule => {
70680
71071
  var _formulaRulesMap$get$, _formulaRulesMap$get;
70681
71072
  const valueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath, "value");
71073
+ const autoValueExpressionType = autoValueRule.right.getType();
70682
71074
  const valueRefCurrentIteration = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value");
70683
71075
  const autoFlagRefCurrentIteration = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "autoFlag");
70684
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement(valueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NoDepsExpression(valueRefCurrentIteration), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NoDepsExpression(autoFlagRefCurrentIteration), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression())), autoValueRule.right, formulaRulesMap.has(valueRef) ? (_formulaRulesMap$get$ = (_formulaRulesMap$get = formulaRulesMap.get(valueRef)) === null || _formulaRulesMap$get === void 0 ? void 0 : _formulaRulesMap$get.right) !== null && _formulaRulesMap$get$ !== void 0 ? _formulaRulesMap$get$ : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.reject)("Unexpected error") : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression(this.dataDeclarationHelper.getDefaultValue(autoValueRule.left.modePath)))));
71076
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement(valueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.makeNoDeps)(valueRefCurrentIteration), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.makeNoDeps)(autoFlagRefCurrentIteration), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression())), autoValueRule.right, formulaRulesMap.has(valueRef) ? (_formulaRulesMap$get$ = (_formulaRulesMap$get = formulaRulesMap.get(valueRef)) === null || _formulaRulesMap$get === void 0 ? void 0 : _formulaRulesMap$get.right) !== null && _formulaRulesMap$get$ !== void 0 ? _formulaRulesMap$get$ : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.reject)("Unexpected error") : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value"), autoValueExpressionType === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.string ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression(this.dataDeclarationHelper.getDefaultValue(autoValueRule.left.modePath)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression())));
70685
71077
  };
70686
71078
  const updatedFormulaRules = Iterator.from(formulaFLangRules).flatMap(x => x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement && x.left.valueName === "autoValue" ? [x, createValueRuleFromAutoValueRule(x)] : [x]);
70687
71079
 
@@ -70728,8 +71120,8 @@ class FormulaAndInitOnlyNormalizationRuleGenerator {
70728
71120
  this.optionalSectionRuleBuilder = optionalSectionRuleBuilder;
70729
71121
  }
70730
71122
  generateRules() {
70731
- const createValueRuleFromAutoValueRule = autoValueRule => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value")), autoValueRule.right));
70732
- const createValueRuleEmptyRule = path => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path.toCurrentIteration(), "value")));
71123
+ const createValueRuleFromAutoValueRule = autoValueRule => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NotEqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_2__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression()), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_2__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value")), autoValueRule.right));
71124
+ const createValueRuleEmptyRule = path => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, "value"), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_2__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path.toCurrentIteration(), "value")));
70733
71125
  const createDisableValueAutoInitRule = path => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, "disableValueAutoInit"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("true"));
70734
71126
  const ignoredValueSetRuleMapper = x => {
70735
71127
  var _this$formSchemaRng$g;
@@ -70776,13 +71168,15 @@ __webpack_require__.r(__webpack_exports__);
70776
71168
  * 2) переводит autoFlag в true
70777
71169
  */
70778
71170
  class FormulaOnlyNormalizationRuleGenerator {
70779
- constructor(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder) {
71171
+ constructor(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder, options) {
70780
71172
  this.dataDeclarationHelper = void 0;
70781
71173
  this.formSchemaRng = void 0;
70782
71174
  this.formulas = void 0;
71175
+ this.options = void 0;
70783
71176
  this.formulaExprConverter = void 0;
70784
71177
  this.optionalSectionRuleBuilder = void 0;
70785
71178
  this.validationRulesBuilder = void 0;
71179
+ this.options = options;
70786
71180
  this.optionalSectionRuleBuilder = optionalSectionRuleBuilder;
70787
71181
  this.dataDeclarationHelper = dataDeclarationHelper;
70788
71182
  this.formSchemaRng = formSchemaRng;
@@ -70809,10 +71203,14 @@ class FormulaOnlyNormalizationRuleGenerator {
70809
71203
  const precalculationRules = [];
70810
71204
  const defaultValue = this.dataDeclarationHelper.getDefaultValue(fullTarget.toLegacyPath());
70811
71205
  const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
71206
+ const getFormulaExpression = field => {
71207
+ const result = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.castFinalExpressionToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__.AbsoluteModelFieldPath(fullTarget, field), x => precalculationRules.push(x)), this.options.enableTypedFlang, "G29");
71208
+ const resultType = result.getType();
71209
+ return resultType === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.wrapWithArgumentsCondition)(result), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression(defaultValue)) : result;
71210
+ };
70812
71211
  const result = [];
70813
- const getFormulaExpression = field => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.wrapWithArgumentsCondition)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.castOperandToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__.AbsoluteModelFieldPath(fullTarget, field), x => precalculationRules.push(x)), "G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression(defaultValue));
70814
71212
  if (isTargetAutoField) {
70815
- result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "autoValue"), getFormulaExpression("autoValue")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue")), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string)));
71213
+ result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "autoValue"), getFormulaExpression("autoValue")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value")), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue"))), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string)));
70816
71214
  } else {
70817
71215
  result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
70818
71216
  }
@@ -70839,6 +71237,12 @@ __webpack_require__.r(__webpack_exports__);
70839
71237
  /* harmony export */ });
70840
71238
  /* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
70841
71239
  /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
71240
+ /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
71241
+ /* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
71242
+ /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
71243
+
71244
+
71245
+
70842
71246
 
70843
71247
 
70844
71248
 
@@ -70871,8 +71275,16 @@ class NormalizationRulesGenerator {
70871
71275
  const dataDeclarationRules = this.sugarRulesBuilder.buildRules();
70872
71276
 
70873
71277
  // Порядок важен, т.к. потом делаем distinctBy.
70874
- const allRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(initializeRules, lazyLoadingRules, formulaFLangRules, optionalSectionRules, dataDeclarationRules, sugarValidationRules).flatMap(rule => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.wrapWithDisableValueAutoInitFlagCheckIfRequired)(this.formSchemaRng, rule));
70875
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.combineRulesWithOptionalSectionChecking)(allRules, this.optionalSectionRulesBuilder);
71278
+ const allRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(initializeRules, lazyLoadingRules, formulaFLangRules, optionalSectionRules, dataDeclarationRules, sugarValidationRules).flatMap(rule => {
71279
+ (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.ensureCorrectFieldNameByExpressionType)(rule);
71280
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.wrapWithDisableValueAutoInitFlagCheckIfRequired)(this.formSchemaRng, rule);
71281
+ }).toArray();
71282
+ const dictionaryRules = Iterator.from(allRules).filter(rule => rule instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement && (rule.right.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dict || rule.right instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression && rule.right.targetExpression.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dict || rule.right instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullCoalesceExpression && rule.right.expression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression && rule.right.expression.targetExpression.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dict)).map(x => x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement ? new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__.AbsoluteModelFieldPath(x.left.modePath, x.left.valueName) : undefined).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.isNotNullOrUndefined).toArray();
71283
+ const content = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.combineRulesWithOptionalSectionChecking)(allRules, this.optionalSectionRulesBuilder);
71284
+ return {
71285
+ content: content,
71286
+ serverOnlyPaths: dictionaryRules
71287
+ };
70876
71288
  }
70877
71289
  }
70878
71290
 
@@ -70926,12 +71338,14 @@ __webpack_require__.r(__webpack_exports__);
70926
71338
 
70927
71339
 
70928
71340
  class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.BaseRuleBuilder {
70929
- constructor(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter) {
71341
+ constructor(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter, options) {
70930
71342
  super();
70931
71343
  this.formSchemaRng = void 0;
70932
71344
  this.formulas = void 0;
71345
+ this.options = void 0;
70933
71346
  this.formulaExprConverter = void 0;
70934
71347
  this.dataDeclarationHelper = void 0;
71348
+ this.options = options;
70935
71349
  this.formulaExprConverter = formulaExprConverter;
70936
71350
  this.dataDeclarationHelper = dataDeclarationHelper;
70937
71351
  this.formulas = formulas;
@@ -70953,7 +71367,11 @@ class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.
70953
71367
  const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
70954
71368
  const isDisabled = this.dataDeclarationHelper.isNodeHasDisabledEntry(fullTarget.toAbsolute());
70955
71369
  const isDecimal = ((_this$formSchemaRng$g = this.formSchemaRng.getTypeNodeByPath(fullTarget.toAbsolute())) === null || _this$formSchemaRng$g === void 0 ? void 0 : _this$formSchemaRng$g.baseType) === "decimal";
70956
- const getFormulaExpression = targetField => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.wrapWithArgumentsCondition)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castOperandToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__.AbsoluteModelFieldPath(fullTarget, targetField), x => precalculationRules.push(x)), "G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue));
71370
+ const getFormulaExpression = targetField => {
71371
+ const result = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castFinalExpressionToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__.AbsoluteModelFieldPath(fullTarget, targetField), x => precalculationRules.push(x)), this.options.enableTypedFlang, "G29");
71372
+ const resultType = result.getType();
71373
+ return resultType === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.string ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.wrapWithArgumentsCondition)(result), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue)) : result;
71374
+ };
70957
71375
  const valueRule = isTargetAutoField ? isDisabled ? this.createValueRuleForDisabledAutoField(fullTarget, getFormulaExpression) : this.createValueRuleForAutoField(fullTarget, defaultValue, getFormulaExpression) : this.createRegularValueRule(fullTarget, getFormulaExpression);
70958
71376
  const autoValueRule = isTargetAutoField ? this.createAutoValueRule(fullTarget, getFormulaExpression) : undefined;
70959
71377
  const autoFlagRule = isTargetAutoField ? this.createAutoFlagRule(fullTarget, isDecimal) : undefined;
@@ -70967,13 +71385,13 @@ class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.
70967
71385
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value"));
70968
71386
  }
70969
71387
  createAutoFlagRule(fullTarget, isDecimal) {
70970
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false"))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.decimalWrapper)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), isDecimal), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.decimalWrapper)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue"), isDecimal)), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.string), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"))));
71388
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false"))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.decimalWrapper)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "value"), isDecimal), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.decimalWrapper)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoValue"), isDecimal)), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.string), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"))));
70971
71389
  }
70972
71390
  createValueRuleForDisabledAutoField(fullTarget, getFormulaExpression) {
70973
71391
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value"));
70974
71392
  }
70975
71393
  createValueRuleForAutoField(fullTarget, defaultValue, getFormulaExpression) {
70976
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), getFormulaExpression("value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue))));
71394
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoFlag")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), getFormulaExpression("value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue))));
70977
71395
  }
70978
71396
  adjustPathMultiplicity(path) {
70979
71397
  return (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_2__.adjustPathMultiplicityComplex)(path, this.formSchemaRng, this.dataDeclarationHelper);
@@ -71032,12 +71450,14 @@ __webpack_require__.r(__webpack_exports__);
71032
71450
  /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
71033
71451
  /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
71034
71452
  /* harmony import */ var _markupGenerator_getRootPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../markupGenerator/getRootPath */ "./Generator/src/generators/markupGenerator/getRootPath.ts");
71035
- /* harmony import */ var _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./BaseRuleBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/BaseRuleBuilder.ts");
71453
+ /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
71454
+ /* harmony import */ var _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./BaseRuleBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/BaseRuleBuilder.ts");
71036
71455
 
71037
71456
 
71038
71457
 
71039
71458
 
71040
- class LazyLoadingRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_3__.BaseRuleBuilder {
71459
+
71460
+ class LazyLoadingRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_4__.BaseRuleBuilder {
71041
71461
  constructor(sugarRoot, lazyLoadingDeclaration) {
71042
71462
  super();
71043
71463
  this.sugarRoot = void 0;
@@ -71053,11 +71473,22 @@ class LazyLoadingRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_
71053
71473
  const thresholdEntry = Object.entries(this.lazyLoadingDeclaration).find(x => x[1].thresholdValue != undefined);
71054
71474
  if (thresholdEntry != undefined) {
71055
71475
  var _thresholdEntry$1$thr, _thresholdEntry$;
71056
- const thresholdEntryPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(`/${thresholdEntry[0]}`, true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
71476
+ const thresholdEntryPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(`/${thresholdEntry[0]}`, true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).trimLastStarIfLastToken();
71057
71477
  const thresholdValue = (_thresholdEntry$1$thr = (_thresholdEntry$ = thresholdEntry[1]) === null || _thresholdEntry$ === void 0 ? void 0 : _thresholdEntry$.thresholdValue) !== null && _thresholdEntry$1$thr !== void 0 ? _thresholdEntry$1$thr : 0;
71058
71478
  const lazyLoadingEnabledRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot).joinWith("LazyLoadingEnabled"), "value");
71059
- const statement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(lazyLoadingEnabledRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.GeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ReduceCallExpression(thresholdEntryPath.trimLastStarIfLastToken(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(1))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(thresholdValue)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false")));
71060
- yield statement;
71479
+ const childrenPathReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(thresholdEntryPath.toCurrentIteration(), "children");
71480
+ const getLengthExpression = (useOldValue = false) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ArrayLengthExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DeserializeEnumerationExpression([useOldValue ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeGetOld)(childrenPathReference) : childrenPathReference], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BoolLiteralExpression(true))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(0));
71481
+ if (thresholdEntryPath.isContainIteration()) {
71482
+ const lazyLoadingCounterRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot).joinWith("LazyLoadingCounter"), "value");
71483
+ const iterationPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(thresholdEntryPath.getLastListPath());
71484
+ const counterStatement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(lazyLoadingCounterRef, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ReduceCallExpression(iterationPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ArgumentReferenceExpression("result"), getLengthExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IncrementalFlagExpression(), getLengthExpression(true), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castOperandToDecimalIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)(lazyLoadingCounterRef)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(0)))));
71485
+ yield counterStatement;
71486
+ const lazyFlagStatement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(lazyLoadingEnabledRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.GeExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castOperandToDecimalIfNeed)(counterStatement.left), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(thresholdValue)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false")));
71487
+ yield lazyFlagStatement;
71488
+ } else {
71489
+ const statement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(lazyLoadingEnabledRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.GeExpression(getLengthExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.DecimalLiteralExpression(thresholdValue)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false")));
71490
+ yield statement;
71491
+ }
71061
71492
  }
71062
71493
  }
71063
71494
  }
@@ -71084,7 +71515,8 @@ __webpack_require__.r(__webpack_exports__);
71084
71515
  /* harmony import */ var _Engine_src_Engine_Core_PathUtils_PathUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../../Engine/src/Engine/Core/PathUtils/PathUtils */ "./Engine/src/Engine/Core/PathUtils/PathUtils.ts");
71085
71516
  /* harmony import */ var _Common_ModelPath_ModelPathHelper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPathHelper */ "./Common/ModelPath/ModelPathHelper.ts");
71086
71517
  /* harmony import */ var _Common_PathConstants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../../Common/PathConstants */ "./Common/PathConstants.ts");
71087
- /* harmony import */ var _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./BaseRuleBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/BaseRuleBuilder.ts");
71518
+ /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
71519
+ /* harmony import */ var _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./BaseRuleBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/BaseRuleBuilder.ts");
71088
71520
 
71089
71521
 
71090
71522
 
@@ -71095,7 +71527,8 @@ __webpack_require__.r(__webpack_exports__);
71095
71527
 
71096
71528
 
71097
71529
 
71098
- class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_9__.BaseRuleBuilder {
71530
+
71531
+ class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_10__.BaseRuleBuilder {
71099
71532
  constructor(sugarRoot, dataDeclarationHelper) {
71100
71533
  super();
71101
71534
  this.sugarRoot = void 0;
@@ -71181,7 +71614,7 @@ class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MOD
71181
71614
  const targetIsFilledPath = targetOptionalSection.path.joinWith(_Common_PathConstants__WEBPACK_IMPORTED_MODULE_8__.OptionalSectionFilledFieldName);
71182
71615
  if (!targetIsFilledPath.isEquals(targetPath)) {
71183
71616
  const targetIsFilledValueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(targetIsFilledPath.toCurrentIteration(), "value");
71184
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(rule.left, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.EqExpression(targetIsFilledValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("1")), rule.right, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression()));
71617
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(rule.left, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(targetIsFilledValueRef), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("1")), rule.right, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression()));
71185
71618
  }
71186
71619
  }
71187
71620
  return rule;
@@ -71203,7 +71636,7 @@ class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MOD
71203
71636
  var _pathGroup$, _pathGroup$map$reduce;
71204
71637
  const iterationEntry = (_pathGroup$ = pathGroup[0]) === null || _pathGroup$ === void 0 ? void 0 : _pathGroup$.lastIterationEntry;
71205
71638
  const pathCheckExpr = (_pathGroup$map$reduce = pathGroup.map(pathInfo => {
71206
- const pathValueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(pathInfo.path.toCurrentIteration(), "value"));
71639
+ const pathValueRef = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(pathInfo.path.toCurrentIteration(), "value"));
71207
71640
  const checkExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NotEqExpression(pathValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression());
71208
71641
  return checkExpression;
71209
71642
  }).reduce((acc, current) => acc == undefined ? current : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.OrBinaryExpression(acc, current), undefined)) !== null && _pathGroup$map$reduce !== void 0 ? _pathGroup$map$reduce : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.reject)();
@@ -71357,11 +71790,9 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
71357
71790
  const validationText = next.message.reduce((acc, item) => {
71358
71791
  if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression) {
71359
71792
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(item));
71360
- } else if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression) {
71361
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.JoinExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DeserializeEnumerationExpression([item], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BoolLiteralExpression(true)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(", ")));
71362
- } else {
71363
- throw new Error(`Invalid WithDescription ${item.toString()}`);
71364
71793
  }
71794
+ const valueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.extractValueReferenceFromCast)(item);
71795
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.JoinExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DeserializeEnumerationExpression([valueReference], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BoolLiteralExpression(true)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(", ")));
71365
71796
  }, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(""));
71366
71797
  const condition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NegateUnaryExpression(next.checkExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(`["`), validationText), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(`"]`)), current);
71367
71798
  return condition;
@@ -71415,7 +71846,7 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
71415
71846
  }
71416
71847
  buildErrorWarningCountReduceRule(iterable, countFieldName, getAllItemsSumExpression) {
71417
71848
  const nextErrorCountTarget = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable, countFieldName);
71418
- const aggregationReduce = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ReduceCallExpression(iterable.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.MinusBinaryExpression(getAllItemsSumExpression(false), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IncrementalFlagExpression(), getAllItemsSumExpression(true), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0))))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.GetOldExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable.toCurrentIteration(), countFieldName))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0)));
71849
+ const aggregationReduce = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ReduceCallExpression(iterable.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.MinusBinaryExpression(getAllItemsSumExpression(false), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IncrementalFlagExpression(), getAllItemsSumExpression(true), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0))))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(iterable.toCurrentIteration(), countFieldName))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0)));
71419
71850
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(nextErrorCountTarget, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(aggregationReduce, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("G29")));
71420
71851
  }
71421
71852
  buildErrorWarningCountSimpleSumRule(iterable, countFieldName, getAllItemsSumExpression) {
@@ -71423,11 +71854,11 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
71423
71854
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(nextErrorCountTarget, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(getAllItemsSumExpression(false), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("G29")));
71424
71855
  }
71425
71856
  getErrorWarningCountExpression(path, fieldName, readOldValues) {
71426
- const valueGetExpression = readOldValues ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.GetOldExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, fieldName)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, fieldName);
71857
+ const valueGetExpression = readOldValues ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(path, fieldName)) : (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(path, fieldName);
71427
71858
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IsEqualsBinaryExpression(valueGetExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(`[]`)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IsEqualsBinaryExpression(valueGetExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(1));
71428
71859
  }
71429
71860
  getReadErrorCountValueExpression(path, countFieldName, readOldValues) {
71430
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(readOldValues ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.GetOldExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path.toCurrentIteration(), countFieldName)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path.toCurrentIteration(), countFieldName), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0));
71861
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(readOldValues ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(path.toCurrentIteration(), countFieldName)) : (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(path.toCurrentIteration(), countFieldName), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0));
71431
71862
  }
71432
71863
  buildChainOfErrorCountRules(path, countFieldName, fieldName) {
71433
71864
  const reduceResult = Iterator.from((0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__.reverseArray)([...this.splitModelPathIfErrorCountRequired(path)])).flatMap(iterationPath => this.dataDeclarationHelper.isNodeHasChildrenEntry(iterationPath) ? [iterationPath.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each), iterationPath] : [iterationPath]).reduce((result, iterationPath) => {
@@ -95892,8 +96323,10 @@ __webpack_require__.r(__webpack_exports__);
95892
96323
  /* harmony import */ var _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ServerSideFLangNormalization/FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
95893
96324
  /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
95894
96325
  /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
95895
- /* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
95896
- /* harmony import */ var _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ElementProcessors/CommonNodeProperties/ValidationInfoNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/CommonNodeProperties/ValidationInfoNode.ts");
96326
+ /* harmony import */ var _ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ServerSideFLangNormalization/FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
96327
+ /* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
96328
+ /* harmony import */ var _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ElementProcessors/CommonNodeProperties/ValidationInfoNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/CommonNodeProperties/ValidationInfoNode.ts");
96329
+
95897
96330
 
95898
96331
 
95899
96332
 
@@ -95915,17 +96348,17 @@ class FLangNormalizationRulesBuilder {
95915
96348
  this.controlCustomizationContext = controlCustomizationContext;
95916
96349
  }
95917
96350
  *childrenInitializer(node, optional, defaultChildren) {
95918
- const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_3__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
95919
- yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "children"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "children")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(JSON.stringify(defaultChildren !== null && defaultChildren !== void 0 ? defaultChildren : optional ? [] : ["0"])), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "children"))));
96351
+ const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_4__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
96352
+ yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "children"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(JSON.stringify(defaultChildren !== null && defaultChildren !== void 0 ? defaultChildren : optional ? [] : ["0"])), (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children"))));
95920
96353
  }
95921
96354
  *childrenInitializerForPicklist(node, optional, defaultChildren) {
95922
96355
  const targetPathReference = node.getFullPath().toEachIteration().trimLastStarIfLastToken();
95923
- yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "children"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "children")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(JSON.stringify(defaultChildren !== null && defaultChildren !== void 0 ? defaultChildren : optional ? [] : ["0"])), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "children"))));
96356
+ yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "children"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(JSON.stringify(defaultChildren !== null && defaultChildren !== void 0 ? defaultChildren : optional ? [] : ["0"])), (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children"))));
95924
96357
  }
95925
96358
  valueInitializer(node, dataBinding, disabled, pathSuffix, fetchFunctionSuffix) {
95926
96359
  var _dataBinding$defaultV;
95927
- const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_3__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).joinWith((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(pathSuffix) ? (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(pathSuffix, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each) : (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.emptyModelPath)());
95928
- const originalValueReference = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "value"));
96360
+ const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_4__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).joinWith((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(pathSuffix) ? (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(pathSuffix, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each) : (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.emptyModelPath)());
96361
+ const originalValueReference = (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "value"));
95929
96362
  const sourceValueReference = this.getSourceValueReferenceWithCorrection(node, targetPathReference);
95930
96363
  const defaultValue = (_dataBinding$defaultV = dataBinding.defaultValue) !== null && _dataBinding$defaultV !== void 0 ? _dataBinding$defaultV : "";
95931
96364
  if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(dataBinding.fetchfn)) {
@@ -95949,11 +96382,11 @@ class FLangNormalizationRulesBuilder {
95949
96382
  if (!disabled && !dataBinding.settings) {
95950
96383
  valueExpression = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(originalValueReference, new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), valueExpression, sourceValueReference);
95951
96384
  }
95952
- const finalExpression = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(targetPathReference) ? new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "autoFlag")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "autoValue")), valueExpression) : valueExpression;
96385
+ const finalExpression = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(targetPathReference) ? new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "autoFlag")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "autoValue")), valueExpression) : valueExpression;
95953
96386
  return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), finalExpression);
95954
96387
  }
95955
96388
  *specialFieldsInitializer(node, options) {
95956
- const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_3__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).joinWith((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(options.pathSuffix) ? (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(options.pathSuffix, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each) : (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.emptyModelPath)());
96389
+ const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_4__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).joinWith((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(options.pathSuffix) ? (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(options.pathSuffix, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each) : (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.emptyModelPath)());
95957
96390
  if (options.disabled) {
95958
96391
  yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "disabled"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true"));
95959
96392
  }
@@ -95971,9 +96404,9 @@ class FLangNormalizationRulesBuilder {
95971
96404
  var _typeNode$base, _this$schemaRng$getTy;
95972
96405
  // eslint-disable-next-line
95973
96406
  const validationInfoSource = node === null || node === void 0 ? void 0 : node.validationInfo;
95974
- const typeNode = validationInfoSource instanceof _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_4__.ValidationInfoNode ? this.nodeTypeInfoHelper.getTypeNode(validationInfoSource) : undefined;
96407
+ const typeNode = validationInfoSource instanceof _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_5__.ValidationInfoNode ? this.nodeTypeInfoHelper.getTypeNode(validationInfoSource) : undefined;
95975
96408
  const baseType = (_typeNode$base = typeNode === null || typeNode === void 0 ? void 0 : typeNode.base) !== null && _typeNode$base !== void 0 ? _typeNode$base : (_this$schemaRng$getTy = this.schemaRng.getTypeNodeByPath(targetPathReference)) === null || _this$schemaRng$getTy === void 0 ? void 0 : _this$schemaRng$getTy.baseType;
95976
- const sourceValueReference = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "value"));
96409
+ const sourceValueReference = (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "value"));
95977
96410
  return baseType != undefined ? this.wrapExpressionWithCorrectionExpression(baseType, sourceValueReference) : sourceValueReference;
95978
96411
  }
95979
96412
  }
@@ -97438,9 +97871,9 @@ function children(onlyTagName, nodeClasses = [], skipNodeNames = []) {
97438
97871
  (0,_ClassMetadataAccess__WEBPACK_IMPORTED_MODULE_4__.setPropertyDeserializer)(targetClass, propName, new _Properties_SinglePropertyDeserializer__WEBPACK_IMPORTED_MODULE_7__.SinglePropertyDeserializer(propName.toString(), new _Properties_ValuesSources_ChildrenNodesValueSource__WEBPACK_IMPORTED_MODULE_19__.ChildrenNodesValueSource(onlyTagNames != undefined ? node => onlyTagNames.includes(node.name) && !skipNodeNames.includes(node.name) : node => !skipNodeNames.includes(node.name), nodeClasses)));
97439
97872
  };
97440
97873
  }
97441
- function singleChild(tagName, nodeClasses = []) {
97874
+ function singleChild(tagName, nodeClasses = [], dec) {
97442
97875
  return (targetClass, propName) => {
97443
- (0,_ClassMetadataAccess__WEBPACK_IMPORTED_MODULE_4__.setPropertyDeserializer)(targetClass, propName, new _Properties_SinglePropertyDeserializer__WEBPACK_IMPORTED_MODULE_7__.SinglePropertyDeserializer(propName.toString(), new _Properties_ValuesSources_SingleChildValueSource__WEBPACK_IMPORTED_MODULE_20__.SingleChildValueSource(tagName, nodeClasses)));
97876
+ (0,_ClassMetadataAccess__WEBPACK_IMPORTED_MODULE_4__.setPropertyDeserializer)(targetClass, propName, new _Properties_SinglePropertyDeserializer__WEBPACK_IMPORTED_MODULE_7__.SinglePropertyDeserializer(propName.toString(), new _Properties_ValuesSources_SingleChildValueSource__WEBPACK_IMPORTED_MODULE_20__.SingleChildValueSource(tagName, nodeClasses), dec));
97444
97877
  };
97445
97878
  }
97446
97879
  function attr(attrName, valueParser, dec) {