@kontur.candy/generator 5.52.0 → 5.54.0-model-read-in-sn-fetchfn.1

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 +750 -245
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -47196,9 +47196,13 @@ function isMatchAbbreviation(abbreviation, value) {
47196
47196
  "use strict";
47197
47197
  __webpack_require__.r(__webpack_exports__);
47198
47198
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
47199
+ /* harmony export */ ensureIsKnownViewModelFieldName: () => (/* binding */ ensureIsKnownViewModelFieldName),
47199
47200
  /* harmony export */ getKnownViewModelFieldNames: () => (/* binding */ getKnownViewModelFieldNames),
47200
47201
  /* harmony export */ nonRegularFieldName: () => (/* binding */ nonRegularFieldName)
47201
47202
  /* harmony export */ });
47203
+ /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
47204
+
47205
+
47202
47206
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
47203
47207
 
47204
47208
  // Эту модель, которая лежит в redux-состоянии в поле viewModel, каждый узел кроме . является ViewModel
@@ -47207,6 +47211,9 @@ function nonRegularFieldName(fieldName) {
47207
47211
  // @ts-ignore
47208
47212
  return fieldName;
47209
47213
  }
47214
+ function ensureIsKnownViewModelFieldName(fieldName) {
47215
+ return getKnownViewModelFieldNames().includes(fieldName) ? fieldName : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.reject)(`[${fieldName}] is not known ViewModelFieldName`);
47216
+ }
47210
47217
  function getKnownViewModelFieldNames() {
47211
47218
  const names = ["children", "error", "warning", "description", "id", "disabled", "visible", "disabledSending", "value", "autoValue", "autoFlag", "resourcesHash", "errorsCount", "warningsCount", "code", "picklist", "normalized", "emptyUnitsVisible", "pencilOpened", "ignoreAutoFlag", "disableValueAutoInit", "index", "regionCode", "district", "city", "settlement", "street", "house", "building", "room", "bossValue", "agentValue", "senderInn", "nameorg", "sum", "count", "normalizationSource", "referencedId"];
47212
47219
  return names;
@@ -48658,6 +48665,7 @@ __webpack_require__.r(__webpack_exports__);
48658
48665
  /* harmony export */ getDaysInMonthKCLangFunction: () => (/* binding */ getDaysInMonthKCLangFunction),
48659
48666
  /* harmony export */ getMonthKCLangFunction: () => (/* binding */ getMonthKCLangFunction),
48660
48667
  /* harmony export */ getPicklistValuesKCLangFunction: () => (/* binding */ getPicklistValuesKCLangFunction),
48668
+ /* harmony export */ getSumByKeysKCLangFunction: () => (/* binding */ getSumByKeysKCLangFunction),
48661
48669
  /* harmony export */ getYearKCLangFunction: () => (/* binding */ getYearKCLangFunction),
48662
48670
  /* harmony export */ groupCountKCLangFunction: () => (/* binding */ groupCountKCLangFunction),
48663
48671
  /* harmony export */ groupSumKCLangFunction: () => (/* binding */ groupSumKCLangFunction),
@@ -48670,6 +48678,7 @@ __webpack_require__.r(__webpack_exports__);
48670
48678
  /* harmony export */ isValidAccountNumberKCLangFunction: () => (/* binding */ isValidAccountNumberKCLangFunction),
48671
48679
  /* harmony export */ isValidMirCardNumberKCLangFunction: () => (/* binding */ isValidMirCardNumberKCLangFunction),
48672
48680
  /* harmony export */ lengthKCLangFunction: () => (/* binding */ lengthKCLangFunction),
48681
+ /* harmony export */ makeDictKCLangFunction: () => (/* binding */ makeDictKCLangFunction),
48673
48682
  /* harmony export */ newlineKCLangFunction: () => (/* binding */ newlineKCLangFunction),
48674
48683
  /* harmony export */ noDepsKCLangFunction: () => (/* binding */ noDepsKCLangFunction),
48675
48684
  /* harmony export */ regexMatchKCLangFunction: () => (/* binding */ regexMatchKCLangFunction),
@@ -49357,6 +49366,46 @@ const hasAutoFlagKCLangFunction = params => {
49357
49366
  expression: param
49358
49367
  };
49359
49368
  };
49369
+ const makeDictKCLangFunction = params => {
49370
+ var _params$48, _params$49;
49371
+ const errors = Array.from(validateParams(params, 2));
49372
+ if (errors.length > 0) {
49373
+ return new FunctionValidationErrorCollection(errors);
49374
+ }
49375
+ const sourceKeyPathParam = (_params$48 = params[0]) === null || _params$48 === void 0 ? void 0 : _params$48.value;
49376
+ const sourceValuePathParam = (_params$49 = params[1]) === null || _params$49 === void 0 ? void 0 : _params$49.value;
49377
+ if ((sourceKeyPathParam === null || sourceKeyPathParam === void 0 ? void 0 : sourceKeyPathParam.type) !== "argument" || sourceValuePathParam == undefined) {
49378
+ const argumentsValidationError = new ArgumentValidationError("Invalid argument sourceKeyPath");
49379
+ return new FunctionValidationErrorCollection([argumentsValidationError]);
49380
+ }
49381
+ return {
49382
+ type: "makeDict",
49383
+ sourceKeyPath: sourceKeyPathParam.select,
49384
+ sourceValueExpression: sourceValuePathParam
49385
+ };
49386
+ };
49387
+ const getSumByKeysKCLangFunction = params => {
49388
+ var _params$50, _params$51;
49389
+ const errors = Array.from(validateParams(params, 2));
49390
+ if (errors.length > 0) {
49391
+ return new FunctionValidationErrorCollection(errors);
49392
+ }
49393
+ const dictPathParam = (_params$50 = params[0]) === null || _params$50 === void 0 ? void 0 : _params$50.value;
49394
+ const targetKeysParam = (_params$51 = params[1]) === null || _params$51 === void 0 ? void 0 : _params$51.value;
49395
+ if (targetKeysParam == undefined || (dictPathParam === null || dictPathParam === void 0 ? void 0 : dictPathParam.type) !== "argument") {
49396
+ const argumentsValidationError = new ArgumentValidationError("Invalid arguments dictPathParam, targetKeysParam");
49397
+ return new FunctionValidationErrorCollection([argumentsValidationError]);
49398
+ }
49399
+ const targetKeys = targetKeysParam.type === "array" ? targetKeysParam : {
49400
+ type: "array",
49401
+ items: [targetKeysParam]
49402
+ };
49403
+ return {
49404
+ type: "getSumByKeys",
49405
+ dictPath: dictPathParam.select,
49406
+ targetKeys: targetKeys
49407
+ };
49408
+ };
49360
49409
 
49361
49410
  /***/ }),
49362
49411
 
@@ -49421,7 +49470,9 @@ const getKCLangGlobalFunctionBuilders = () => ({
49421
49470
  addYears: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.addYearsKCLangFunction],
49422
49471
  dateToString: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.dateToStringKCLangFunction],
49423
49472
  dateTime: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.dateTimeKCLangFunction],
49424
- hasAutoFlag: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.hasAutoFlagKCLangFunction]
49473
+ hasAutoFlag: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.hasAutoFlagKCLangFunction],
49474
+ makeDict: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.makeDictKCLangFunction],
49475
+ getSumByKeys: [_KCLangAntlrFunctions__WEBPACK_IMPORTED_MODULE_2__.getSumByKeysKCLangFunction]
49425
49476
  });
49426
49477
  class ErrorListener {
49427
49478
  constructor() {
@@ -49772,6 +49823,12 @@ class KCLangAntlrVisitor {
49772
49823
  case "string":
49773
49824
  dataType = "string";
49774
49825
  break;
49826
+ case "dict":
49827
+ dataType = "dict";
49828
+ break;
49829
+ case "array":
49830
+ dataType = "array";
49831
+ break;
49775
49832
  default:
49776
49833
  throw Error("visitType syntax incorrect");
49777
49834
  }
@@ -56973,6 +57030,12 @@ function traverseKCLangExpression(node, visitor) {
56973
57030
  case "hasAutoFlag":
56974
57031
  visitor.visitHasAutoFlagKCLangNode(node);
56975
57032
  break;
57033
+ case "makeDict":
57034
+ visitor.visitMakeDictKCLangNode(node);
57035
+ break;
57036
+ case "getSumByKeys":
57037
+ visitor.visitGetSumByKeysKCLangNode(node);
57038
+ break;
56976
57039
  default:
56977
57040
  (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.ensureNever)(node);
56978
57041
  break;
@@ -57129,6 +57192,12 @@ class DefaultKCLangExpressionVisitor {
57129
57192
  visitHasAutoFlagKCLangNode(node) {
57130
57193
  // default empty implementation
57131
57194
  }
57195
+ visitGetSumByKeysKCLangNode(node) {
57196
+ // default empty implementation
57197
+ }
57198
+ visitMakeDictKCLangNode(node) {
57199
+ // default empty implementation
57200
+ }
57132
57201
  }
57133
57202
 
57134
57203
  /***/ }),
@@ -57490,6 +57559,12 @@ const getGenerateJsExpressionFunc = options => {
57490
57559
  case "hasAutoFlag":
57491
57560
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
57492
57561
  break;
57562
+ case "makeDict":
57563
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
57564
+ break;
57565
+ case "getSumByKeys":
57566
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_1__.NotImplementedError();
57567
+ break;
57493
57568
  default:
57494
57569
  (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.ensureNever)(expression);
57495
57570
  }
@@ -57567,6 +57642,10 @@ function generateKCXmlExpression(expression) {
57567
57642
  return `<m:${expression.type} select="${expression.select}" />`;
57568
57643
  case "isValidAccountNumber":
57569
57644
  return `<m:${expression.type} bik="${expression.bik}" account="${expression.account}" />`;
57645
+ case "makeDict":
57646
+ return [`<m:${expression.type} sourceKeyPath="${expression.sourceKeyPath}">`, (0,_Common_IndentString__WEBPACK_IMPORTED_MODULE_2__.indent)(generateKCXmlExpression(expression.sourceValueExpression), 1), `</m:${expression.type}>`].join("\n");
57647
+ case "getSumByKeys":
57648
+ 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
57649
  case "groupSum":
57571
57650
  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
57651
  case "groupCount":
@@ -63678,6 +63757,7 @@ __webpack_require__.r(__webpack_exports__);
63678
63757
  /* harmony export */ FormulaGetDaysInMonthExpression: () => (/* binding */ FormulaGetDaysInMonthExpression),
63679
63758
  /* harmony export */ FormulaGetMonthExpression: () => (/* binding */ FormulaGetMonthExpression),
63680
63759
  /* harmony export */ FormulaGetPicklistValuesExpression: () => (/* binding */ FormulaGetPicklistValuesExpression),
63760
+ /* harmony export */ FormulaGetSumByKeysExpression: () => (/* binding */ FormulaGetSumByKeysExpression),
63681
63761
  /* harmony export */ FormulaGetYearExpression: () => (/* binding */ FormulaGetYearExpression),
63682
63762
  /* harmony export */ FormulaGroupCountExpression: () => (/* binding */ FormulaGroupCountExpression),
63683
63763
  /* harmony export */ FormulaGroupSumExpression: () => (/* binding */ FormulaGroupSumExpression),
@@ -63693,6 +63773,7 @@ __webpack_require__.r(__webpack_exports__);
63693
63773
  /* harmony export */ FormulaLeExpression: () => (/* binding */ FormulaLeExpression),
63694
63774
  /* harmony export */ FormulaLengthExpression: () => (/* binding */ FormulaLengthExpression),
63695
63775
  /* harmony export */ FormulaLtExpression: () => (/* binding */ FormulaLtExpression),
63776
+ /* harmony export */ FormulaMakeDictExpression: () => (/* binding */ FormulaMakeDictExpression),
63696
63777
  /* harmony export */ FormulaMinusExpression: () => (/* binding */ FormulaMinusExpression),
63697
63778
  /* harmony export */ FormulaMultiplyExpression: () => (/* binding */ FormulaMultiplyExpression),
63698
63779
  /* harmony export */ FormulaMultySumExpression: () => (/* binding */ FormulaMultySumExpression),
@@ -63724,7 +63805,7 @@ __webpack_require__.r(__webpack_exports__);
63724
63805
 
63725
63806
 
63726
63807
 
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;
63808
+ 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
63809
 
63729
63810
 
63730
63811
 
@@ -63740,7 +63821,7 @@ class FormulaExpression extends _markupGenerator_Serializer_SugarSerializer__WEB
63740
63821
  throw new Error(`${this.constructor} does not decorated with sugarNode() properly`);
63741
63822
  }
63742
63823
  }
63743
- const typeArgumentValueParser = _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.enum("decimal", "string");
63824
+ const typeArgumentValueParser = _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.enum("decimal", "string", "dict", "array");
63744
63825
  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
63826
  constructor(...args) {
63746
63827
  super(...args);
@@ -64677,47 +64758,81 @@ let MathContainer = (_dec153 = (0,_markupGenerator_Serializer_SugarSerializer__W
64677
64758
  writable: true,
64678
64759
  initializer: null
64679
64760
  })), _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 {
64761
+ 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
64762
  constructor(...args) {
64682
64763
  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);
64764
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor90, this);
64765
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceValueExpression", _descriptor91, this);
64686
64766
  }
64687
- }, (_descriptor90 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "targetKeys", [_dec157], {
64767
+ }, (_descriptor90 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "sourceKeyPath", [_dec157], {
64688
64768
  configurable: true,
64689
64769
  enumerable: true,
64690
64770
  writable: true,
64691
64771
  initializer: null
64692
- }), _descriptor91 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "sourceKeyPath", [_dec158], {
64772
+ }), _descriptor91 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "sourceValueExpression", [_dec158], {
64693
64773
  configurable: true,
64694
64774
  enumerable: true,
64695
64775
  writable: true,
64696
64776
  initializer: null
64697
- }), _descriptor92 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class131.prototype, "sourceValuePath", [_dec159], {
64777
+ })), _class131)) || _class130);
64778
+ 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 {
64779
+ constructor(...args) {
64780
+ super(...args);
64781
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "dictPath", _descriptor92, this);
64782
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor93, this);
64783
+ }
64784
+ }, (_descriptor92 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class133.prototype, "dictPath", [_dec160], {
64698
64785
  configurable: true,
64699
64786
  enumerable: true,
64700
64787
  writable: true,
64701
64788
  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 {
64789
+ }), _descriptor93 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class133.prototype, "targetKeys", [_dec161], {
64790
+ configurable: true,
64791
+ enumerable: true,
64792
+ writable: true,
64793
+ initializer: null
64794
+ })), _class133)) || _class132);
64795
+ 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
64796
  constructor(...args) {
64705
64797
  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);
64798
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor94, this);
64799
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor95, this);
64800
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceValuePath", _descriptor96, this);
64708
64801
  }
64709
- }, (_descriptor93 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class133.prototype, "targetKeys", [_dec161], {
64802
+ }, (_descriptor94 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class135.prototype, "targetKeys", [_dec163], {
64710
64803
  configurable: true,
64711
64804
  enumerable: true,
64712
64805
  writable: true,
64713
64806
  initializer: null
64714
- }), _descriptor94 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class133.prototype, "sourceKeyPath", [_dec162], {
64807
+ }), _descriptor95 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class135.prototype, "sourceKeyPath", [_dec164], {
64715
64808
  configurable: true,
64716
64809
  enumerable: true,
64717
64810
  writable: true,
64718
64811
  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];
64812
+ }), _descriptor96 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class135.prototype, "sourceValuePath", [_dec165], {
64813
+ configurable: true,
64814
+ enumerable: true,
64815
+ writable: true,
64816
+ initializer: null
64817
+ })), _class135)) || _class134);
64818
+ 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 {
64819
+ constructor(...args) {
64820
+ super(...args);
64821
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "targetKeys", _descriptor97, this);
64822
+ _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "sourceKeyPath", _descriptor98, this);
64823
+ }
64824
+ }, (_descriptor97 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class137.prototype, "targetKeys", [_dec167], {
64825
+ configurable: true,
64826
+ enumerable: true,
64827
+ writable: true,
64828
+ initializer: null
64829
+ }), _descriptor98 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_1___default()(_class137.prototype, "sourceKeyPath", [_dec168], {
64830
+ configurable: true,
64831
+ enumerable: true,
64832
+ writable: true,
64833
+ initializer: null
64834
+ })), _class137)) || _class136);
64835
+ 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
64836
 
64722
64837
  /***/ }),
64723
64838
 
@@ -67177,7 +67292,7 @@ class LazyLoadDeclarationGenerator {
67177
67292
  thresholdValue: lazyLoadingNodeDeclaration.thresholdValue
67178
67293
  };
67179
67294
  }
67180
- const result = this.replaceHolder(`
67295
+ const result = LazyLoadDeclarationGenerator.replaceHolder(`
67181
67296
  export default function lazyLoadDeclaration() {
67182
67297
  return ${serialize_javascript__WEBPACK_IMPORTED_MODULE_0___default()(declaration, {
67183
67298
  space: " "
@@ -67189,6 +67304,16 @@ class LazyLoadDeclarationGenerator {
67189
67304
  declaration: declaration
67190
67305
  };
67191
67306
  }
67307
+ static convertDeclarationToContent(declaration) {
67308
+ const result = LazyLoadDeclarationGenerator.replaceHolder(`
67309
+ export default function lazyLoadDeclaration() {
67310
+ return ${serialize_javascript__WEBPACK_IMPORTED_MODULE_0___default()(declaration, {
67311
+ space: " "
67312
+ })};
67313
+ };`);
67314
+ const content = unescape(result.replace(/(\\)(u[\dA-Fa-f]{4})/g, "%$2"));
67315
+ return content;
67316
+ }
67192
67317
  *extractLazyLoadingDeclarationFromSugar(sugarRoot) {
67193
67318
  const controlConverterClass = (0,_markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_5__.getConverterByNodeClass)((0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.getNodeClass)(sugarRoot));
67194
67319
  if (controlConverterClass != undefined) {
@@ -67267,7 +67392,7 @@ class LazyLoadDeclarationGenerator {
67267
67392
  yield* this.processElement(nextPath, child);
67268
67393
  }
67269
67394
  }
67270
- replaceHolder(decl) {
67395
+ static replaceHolder(decl) {
67271
67396
  let replacedDecl = decl;
67272
67397
  for (const [placeholderName, placeHoldersFunction] of (0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.iterateEntries)(_DataDeclarationGenerator_placeholders__WEBPACK_IMPORTED_MODULE_2__.placeHolders)) {
67273
67398
  const checkName = `"#(${placeholderName})(\\('[\\w]*'\\))?#"`;
@@ -67390,7 +67515,7 @@ __webpack_require__.r(__webpack_exports__);
67390
67515
 
67391
67516
  function processSugar(formSugarContent, additionalContent, generationOptions) {
67392
67517
  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;
67518
+ 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
67519
  const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
67395
67520
  const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_13__.createDefaultSugarSerializer)();
67396
67521
  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 +67552,21 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
67427
67552
  const lazyLoadGenerator = new _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_29__.LazyLoadDeclarationGenerator(sugarRoot, formSchemaRng);
67428
67553
  const lazyLoadGeneratorResult = lazyLoadGenerator.generate();
67429
67554
  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);
67555
+ const formulaExprConverter = new _ServerSideFLangNormalization_FormulaExpressionToFlangExpressionConverter__WEBPACK_IMPORTED_MODULE_34__.FormulaExpressionToFlangExpressionConverter(path => (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_35__.adjustPathMultiplicityComplex)(path, formSchemaRng, dataDeclarationHelper), {
67556
+ 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
67557
+ });
67558
+ const formulaRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_FormulaRulesBuilder__WEBPACK_IMPORTED_MODULE_36__.FormulaRulesBuilder(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter, {
67559
+ 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
67560
+ });
67432
67561
  const initializationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_InitializationRulesBuilder__WEBPACK_IMPORTED_MODULE_37__.InitializationRulesBuilder(sugarRoot, resourcesHash);
67433
67562
  const lazyLoadingRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_LazyLoadingRulesBuilder__WEBPACK_IMPORTED_MODULE_38__.LazyLoadingRulesBuilder(sugarRoot, lazyLoadGeneratorResult.declaration);
67434
67563
  const sugarRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_SugarRulesBuilder__WEBPACK_IMPORTED_MODULE_39__.SugarRulesBuilder(sugarRoot, formSchemaRng, controlCustomizationContext, fetchFunctions, dataDeclarationHelper, typeRegistry, useSchemaValidations);
67435
67564
  const validationRulesBuilder = new _ServerSideFLangNormalization_RuleBuilders_ValidationRulesBuilder__WEBPACK_IMPORTED_MODULE_40__.ValidationRulesBuilder(sugarRoot, dataDeclarationHelper, formSchemaRng, formulaExprConverter, kcXmlConditions, typeRegistry, useSchemaValidations);
67436
67565
  const optionalSectionRuleBuilder = new _ServerSideFLangNormalization_RuleBuilders_OptionalSectionRulesBuilder__WEBPACK_IMPORTED_MODULE_33__.OptionalSectionRulesBuilder(sugarRoot, dataDeclarationHelper);
67437
67566
  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);
67567
+ const formulaOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_30__.FormulaOnlyNormalizationRuleGenerator(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder, {
67568
+ 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
67569
+ });
67439
67570
  const formulaAndInitOnlyNormalizationRulesGenerator = new _ServerSideFLangNormalization_Normalizers_FormulaAndInitOnlyNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_41__.FormulaAndInitOnlyNormalizationRuleGenerator(sugarRulesBuilder, formulaRulesBuilder, optionalSectionRuleBuilder, formSchemaRng);
67440
67571
  const autoValueForValueByDefaultNormalizationRuleGenerator = new _ServerSideFLangNormalization_Normalizers_AutoValueForValueByDefaultNormalizationRuleGenerator__WEBPACK_IMPORTED_MODULE_45__.AutoValueForValueByDefaultNormalizationRuleGenerator(optionalSectionRuleBuilder, validationRulesBuilder, lazyLoadingRulesBuilder, sugarRulesBuilder, initializationRulesBuilder, formulaRulesBuilder, formSchemaRng, dataDeclarationHelper);
67441
67572
  const builder = new _FormSourcesBuilder_FormSourcesBuilder__WEBPACK_IMPORTED_MODULE_21__.FormSourcesBuilder(additionalContent.formSourcesPath);
@@ -67443,23 +67574,24 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
67443
67574
  markupGenerator.generate(sugarRoot, builder);
67444
67575
  builder.addResource("settings.js", (0,_markupGenerator_getSettings__WEBPACK_IMPORTED_MODULE_9__.getSettings)(sugarRoot, additionalContent.gfv, additionalSettings, additionalContent.formJsonSettings));
67445
67576
  builder.addResource("requisiteList.js", (0,_RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_24__.getRequisiteList)(sugarRoot, fetchFunctions));
67446
- builder.addResource("lazyLoadDeclaration.js", lazyLoadGeneratorResult.content);
67447
67577
  const autocalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsGenerator__WEBPACK_IMPORTED_MODULE_18__.AutoCalculationsGenerator(dataDeclarationHelper, schemaRng);
67448
67578
  const formulasForCalculator = useOldCalculator ? formulas : [];
67449
67579
  builder.addResource("calculationFunctions.js", autocalcGenerator.generate(sugarRoot, additionalContent.autocalcsContent, formulasForCalculator));
67450
67580
  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;
67581
+ let finalLazyLoadDeclaration = lazyLoadGeneratorResult.declaration;
67582
+ 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) {
67583
+ var _additionalContent$fo13, _additionalContent$fo14, _additionalContent$fo15;
67453
67584
  const defaultNormalizationRules = normalizationRulesGenerator.generateRules();
67585
+ finalLazyLoadDeclaration = mixLazyLoadingDeclarationWithServerOnlyPaths(lazyLoadGeneratorResult.declaration, defaultNormalizationRules.serverOnlyPaths);
67454
67586
  const customNormalizers = [{
67455
67587
  normalizerId: "formulas",
67456
- content: (_additionalContent$fo7 = additionalContent.formJsonSettings) !== null && _additionalContent$fo7 !== void 0 && _additionalContent$fo7.disableFlangRulesForEnableAutoFieldFeature ? "" : formulaOnlyNormalizationRulesGenerator.generateRules()
67588
+ content: (_additionalContent$fo13 = additionalContent.formJsonSettings) !== null && _additionalContent$fo13 !== void 0 && _additionalContent$fo13.disableFlangRulesForEnableAutoFieldFeature ? "" : formulaOnlyNormalizationRulesGenerator.generateRules()
67457
67589
  }, {
67458
67590
  normalizerId: "formulasWithInitializers",
67459
- content: (_additionalContent$fo8 = additionalContent.formJsonSettings) !== null && _additionalContent$fo8 !== void 0 && _additionalContent$fo8.disableFlangRulesForFormulaAndInitNormalizer ? "" : formulaAndInitOnlyNormalizationRulesGenerator.generateRules()
67591
+ content: (_additionalContent$fo14 = additionalContent.formJsonSettings) !== null && _additionalContent$fo14 !== void 0 && _additionalContent$fo14.disableFlangRulesForFormulaAndInitNormalizer ? "" : formulaAndInitOnlyNormalizationRulesGenerator.generateRules()
67460
67592
  }, {
67461
67593
  normalizerId: "autoValueForValueByDefault",
67462
- content: (_additionalContent$fo9 = additionalContent.formJsonSettings) !== null && _additionalContent$fo9 !== void 0 && _additionalContent$fo9.enableFlangRulesForAutoValueForValueByDefaultNormalizer ? autoValueForValueByDefaultNormalizationRuleGenerator.generateRules() : ""
67594
+ content: (_additionalContent$fo15 = additionalContent.formJsonSettings) !== null && _additionalContent$fo15 !== void 0 && _additionalContent$fo15.enableFlangRulesForAutoValueForValueByDefaultNormalizer ? autoValueForValueByDefaultNormalizationRuleGenerator.generateRules() : ""
67463
67595
  }].filter(x => (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.isNotNullOrEmpty)(x.content));
67464
67596
  const additionalNormalizationRules = additionalContent.additionalNormalizers ? additionalContent.additionalNormalizers.map(additionalNormalizer => {
67465
67597
  switch (additionalNormalizer.extension) {
@@ -67483,9 +67615,10 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
67483
67615
  throw new Error(`Cannot transform normalization file with ${additionalNormalizer.extension} extension`);
67484
67616
  }
67485
67617
  }) : [];
67486
- const resultRules = combineFlangRules(defaultNormalizationRules, ...additionalNormalizationRules, ...customNormalizers);
67618
+ const resultRules = combineFlangRules(defaultNormalizationRules.content, ...additionalNormalizationRules, ...customNormalizers);
67487
67619
  builder.addServerSideResource("ServerSide.normalize", resultRules);
67488
67620
  }
67621
+ builder.addResource("lazyLoadDeclaration.js", _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_29__.LazyLoadDeclarationGenerator.convertDeclarationToContent(finalLazyLoadDeclaration));
67489
67622
  const attachmentPathsGenerator = new _AttachmentPaths_AttachmentPathsGenerator__WEBPACK_IMPORTED_MODULE_27__.AttachmentPathsGenerator();
67490
67623
  const attachmentPaths = attachmentPathsGenerator.generate(sugarRoot);
67491
67624
  builder.addServerSideResource(`AttachmentPaths.json`, JSON.stringify(attachmentPaths));
@@ -67526,6 +67659,17 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
67526
67659
  return (0,_common_Errors_ProcessSugarErrors__WEBPACK_IMPORTED_MODULE_1__.processSugarErrors)(e, additionalContent.gfv);
67527
67660
  }
67528
67661
  }
67662
+ function mixLazyLoadingDeclarationWithServerOnlyPaths(declaration, paths) {
67663
+ const updateDeclaration = {
67664
+ ...declaration
67665
+ };
67666
+ for (const path of paths) {
67667
+ updateDeclaration[path.toString()] = {
67668
+ lazyLoadMode: "serverOnly"
67669
+ };
67670
+ }
67671
+ return updateDeclaration;
67672
+ }
67529
67673
  function combineFlangRules(baseRules, ...rules) {
67530
67674
  const customNormalizeRules = rules.filter(r => r.normalizerId).map(x => `--${x.normalizerId}--\n${x.content}`);
67531
67675
  const additionalBaseRules = rules.filter(r => !r.normalizerId).map(r => r.content);
@@ -68014,7 +68158,7 @@ class CustomKCLangToFlangRuleGenerator {
68014
68158
  const result = [];
68015
68159
  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
68160
  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)));
68161
+ 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
68162
  } else {
68019
68163
  result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
68020
68164
  }
@@ -68104,8 +68248,8 @@ class FLangValidationBuildContext {
68104
68248
  buildBasicValidations(targetPath, typeNode, schemaTypeNode, optional, highOrderDescription, nodeGId) {
68105
68249
  var _typeNode$base, _typeNode$description;
68106
68250
  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");
68251
+ const valueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(targetPath.toCurrentIteration(), "value");
68252
+ const autoValueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(targetPath.toCurrentIteration(), "autoValue");
68109
68253
  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
68254
  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
68255
  if (baseName != undefined) {
@@ -68128,7 +68272,7 @@ class FLangValidationBuildContext {
68128
68272
  const schemaNode = this.schemaRng.getElementByPath(targetPath);
68129
68273
  const parentNode = schemaNode != undefined ? this.getFirstAcceptedParent(schemaNode) : undefined;
68130
68274
  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);
68275
+ 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
68276
  const errorValidations = validations.filter(x => !x.checkType || x.checkType === "error");
68133
68277
  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
68278
  const result = [];
@@ -68223,7 +68367,7 @@ class FLangValidationBuildContext {
68223
68367
  const value = match === null || match === void 0 || (_match$3 = match[0]) === null || _match$3 === void 0 ? void 0 : _match$3[3];
68224
68368
  if (path != undefined && sign != undefined && value != undefined) {
68225
68369
  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");
68370
+ const valueRef = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(fullPath, "children");
68227
68371
  const len = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.LenExpression(valueRef);
68228
68372
  const argument = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(value);
68229
68373
  const getOperation = () => {
@@ -68507,6 +68651,7 @@ __webpack_require__.r(__webpack_exports__);
68507
68651
  /* harmony export */ ArgumentDeclarationExpression: () => (/* binding */ ArgumentDeclarationExpression),
68508
68652
  /* harmony export */ ArgumentReferenceExpression: () => (/* binding */ ArgumentReferenceExpression),
68509
68653
  /* harmony export */ ArrayExpression: () => (/* binding */ ArrayExpression),
68654
+ /* harmony export */ ArrayLengthExpression: () => (/* binding */ ArrayLengthExpression),
68510
68655
  /* harmony export */ BinaryBooleanExpression: () => (/* binding */ BinaryBooleanExpression),
68511
68656
  /* harmony export */ BinaryExpression: () => (/* binding */ BinaryExpression),
68512
68657
  /* harmony export */ BoolLiteralExpression: () => (/* binding */ BoolLiteralExpression),
@@ -68526,6 +68671,7 @@ __webpack_require__.r(__webpack_exports__);
68526
68671
  /* harmony export */ DifferenceInMonthsExpression: () => (/* binding */ DifferenceInMonthsExpression),
68527
68672
  /* harmony export */ DivisionBinaryExpression: () => (/* binding */ DivisionBinaryExpression),
68528
68673
  /* harmony export */ EqExpression: () => (/* binding */ EqExpression),
68674
+ /* harmony export */ ExistsExpression: () => (/* binding */ ExistsExpression),
68529
68675
  /* harmony export */ FLangBoolExpression: () => (/* binding */ FLangBoolExpression),
68530
68676
  /* harmony export */ FLangDecimalExpression: () => (/* binding */ FLangDecimalExpression),
68531
68677
  /* harmony export */ FLangDictExpression: () => (/* binding */ FLangDictExpression),
@@ -68564,6 +68710,7 @@ __webpack_require__.r(__webpack_exports__);
68564
68710
  /* harmony export */ LenExpression: () => (/* binding */ LenExpression),
68565
68711
  /* harmony export */ LogicalExpression: () => (/* binding */ LogicalExpression),
68566
68712
  /* harmony export */ LtExpression: () => (/* binding */ LtExpression),
68713
+ /* harmony export */ MakeHashSetFromDictExpression: () => (/* binding */ MakeHashSetFromDictExpression),
68567
68714
  /* harmony export */ MinusBinaryExpression: () => (/* binding */ MinusBinaryExpression),
68568
68715
  /* harmony export */ MinusUnaryExpression: () => (/* binding */ MinusUnaryExpression),
68569
68716
  /* harmony export */ MultiplicativeBinaryExpression: () => (/* binding */ MultiplicativeBinaryExpression),
@@ -68677,7 +68824,7 @@ class ValueReferenceExpression extends FLangExpression {
68677
68824
  return [];
68678
68825
  }
68679
68826
  getType() {
68680
- return BuildInTypeExpression.string;
68827
+ return BuildInTypeExpression.object;
68681
68828
  }
68682
68829
  convertToString() {
68683
68830
  return `${toFLangString(this.modePath)}.${this.valueName}`;
@@ -68875,6 +69022,7 @@ class BuildInTypeExpression extends TypeReferenceExpression {
68875
69022
  }
68876
69023
  }
68877
69024
  _BuildInTypeExpression = BuildInTypeExpression;
69025
+ BuildInTypeExpression.object = new _BuildInTypeExpression("object");
68878
69026
  BuildInTypeExpression.decimal = new _BuildInTypeExpression("decimal");
68879
69027
  BuildInTypeExpression.string = new _BuildInTypeExpression("string");
68880
69028
  BuildInTypeExpression.dict = new _BuildInTypeExpression("dict");
@@ -69131,7 +69279,7 @@ class StringLiteralExpression extends ConstExpression {
69131
69279
  return JSON.stringify(this.stringValue);
69132
69280
  }
69133
69281
  }
69134
- class DecimalLiteralExpression extends FLangDecimalExpression {
69282
+ class DecimalLiteralExpression extends ConstExpression {
69135
69283
  constructor(value) {
69136
69284
  super();
69137
69285
  this.value = void 0;
@@ -69148,6 +69296,11 @@ class DecimalLiteralExpression extends FLangDecimalExpression {
69148
69296
  }
69149
69297
  }
69150
69298
  class DictLiteralExpression extends FLangExpression {
69299
+ constructor(value) {
69300
+ super();
69301
+ this.value = void 0;
69302
+ this.value = value;
69303
+ }
69151
69304
  getChildNodes() {
69152
69305
  return [];
69153
69306
  }
@@ -69155,7 +69308,9 @@ class DictLiteralExpression extends FLangExpression {
69155
69308
  return BuildInTypeExpression.dict;
69156
69309
  }
69157
69310
  convertToString() {
69158
- return `dict()`;
69311
+ var _this$value;
69312
+ const argument = this.value != undefined ? (_this$value = this.value) === null || _this$value === void 0 ? void 0 : _this$value.convertToString() : "";
69313
+ return `dict(${argument})`;
69159
69314
  }
69160
69315
  }
69161
69316
  class BoolLiteralExpression extends ConstExpression {
@@ -69629,6 +69784,26 @@ class HashSetExpression extends FLangExpression {
69629
69784
  return `hashSet(${(_this$expression$conv = (_this$expression = this.expression) === null || _this$expression === void 0 ? void 0 : _this$expression.convertToString()) !== null && _this$expression$conv !== void 0 ? _this$expression$conv : ""})`;
69630
69785
  }
69631
69786
  }
69787
+ class MakeHashSetFromDictExpression extends FLangExpression {
69788
+ constructor(expression) {
69789
+ super();
69790
+ this.expression = void 0;
69791
+ this.expression = expression;
69792
+ }
69793
+ getType() {
69794
+ return BuildInTypeExpression.hashSet;
69795
+ }
69796
+ *getChildNodes() {
69797
+ if (this.expression != undefined) {
69798
+ yield this.expression;
69799
+ }
69800
+ return [];
69801
+ }
69802
+ convertToString() {
69803
+ var _this$expression$conv2, _this$expression2;
69804
+ return `makeHashSetFromDict(${(_this$expression$conv2 = (_this$expression2 = this.expression) === null || _this$expression2 === void 0 ? void 0 : _this$expression2.convertToString()) !== null && _this$expression$conv2 !== void 0 ? _this$expression$conv2 : ""})`;
69805
+ }
69806
+ }
69632
69807
  class AddArrayExpression extends FLangExpression {
69633
69808
  constructor(argumentReference, expression) {
69634
69809
  super();
@@ -69701,7 +69876,39 @@ class ArrayExpression extends FLangExpression {
69701
69876
  }
69702
69877
  convertToString() {
69703
69878
  const items = this.items.map(x => x.convertToString()).join(", ");
69704
- return `array(${items})`;
69879
+ return `makeArray(${items})`;
69880
+ }
69881
+ }
69882
+ class ArrayLengthExpression extends FLangExpression {
69883
+ constructor(expression) {
69884
+ super();
69885
+ this.expression = void 0;
69886
+ this.expression = expression;
69887
+ }
69888
+ getType() {
69889
+ return BuildInTypeExpression.decimal;
69890
+ }
69891
+ *getChildNodes() {
69892
+ yield this.expression;
69893
+ }
69894
+ convertToString() {
69895
+ return `arrayLength(${this.expression.convertToString()})`;
69896
+ }
69897
+ }
69898
+ class ExistsExpression extends FLangExpression {
69899
+ constructor(source) {
69900
+ super();
69901
+ this.source = void 0;
69902
+ this.source = source;
69903
+ }
69904
+ getType() {
69905
+ return BuildInTypeExpression.bool;
69906
+ }
69907
+ *getChildNodes() {
69908
+ yield this.source;
69909
+ }
69910
+ convertToString() {
69911
+ return `exists(${this.source.convertToString()})`;
69705
69912
  }
69706
69913
  }
69707
69914
  class NullCoalesceExpression extends FLangExpression {
@@ -69837,7 +70044,7 @@ class GetOldExpression extends FLangExpression {
69837
70044
  return [];
69838
70045
  }
69839
70046
  getType() {
69840
- return BuildInTypeExpression.bool;
70047
+ return this.expression.getType();
69841
70048
  }
69842
70049
  convertToString() {
69843
70050
  return `old(${this.expression.convertToString()})`;
@@ -69872,6 +70079,9 @@ class SetStatement extends FLangStatement {
69872
70079
  "use strict";
69873
70080
  __webpack_require__.r(__webpack_exports__);
69874
70081
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
70082
+ /* harmony export */ arrayFieldNameSuffix: () => (/* binding */ arrayFieldNameSuffix),
70083
+ /* harmony export */ castFinalExpressionToStringIfNeed: () => (/* binding */ castFinalExpressionToStringIfNeed),
70084
+ /* harmony export */ castOperandIfNeed: () => (/* binding */ castOperandIfNeed),
69875
70085
  /* harmony export */ castOperandToBoolIfNeed: () => (/* binding */ castOperandToBoolIfNeed),
69876
70086
  /* harmony export */ castOperandToDateTimeIfNeed: () => (/* binding */ castOperandToDateTimeIfNeed),
69877
70087
  /* harmony export */ castOperandToDecimalIfNeed: () => (/* binding */ castOperandToDecimalIfNeed),
@@ -69880,19 +70090,34 @@ __webpack_require__.r(__webpack_exports__);
69880
70090
  /* harmony export */ combineByOrFlangExpr: () => (/* binding */ combineByOrFlangExpr),
69881
70091
  /* harmony export */ combineRulesWithOptionalSectionChecking: () => (/* binding */ combineRulesWithOptionalSectionChecking),
69882
70092
  /* harmony export */ decimalWrapper: () => (/* binding */ decimalWrapper),
70093
+ /* harmony export */ dictFieldNameSuffix: () => (/* binding */ dictFieldNameSuffix),
70094
+ /* harmony export */ ensureCorrectFieldNameByExpressionType: () => (/* binding */ ensureCorrectFieldNameByExpressionType),
69883
70095
  /* harmony export */ ensureOperandsOfTypeOrNull: () => (/* binding */ ensureOperandsOfTypeOrNull),
70096
+ /* harmony export */ extractValueReferenceFromCast: () => (/* binding */ extractValueReferenceFromCast),
69884
70097
  /* harmony export */ getAllExpressionChildren: () => (/* binding */ getAllExpressionChildren),
70098
+ /* harmony export */ hashSetFieldNameSuffix: () => (/* binding */ hashSetFieldNameSuffix),
70099
+ /* harmony export */ makeGetOld: () => (/* binding */ makeGetOld),
70100
+ /* harmony export */ makeNoDeps: () => (/* binding */ makeNoDeps),
70101
+ /* harmony export */ makeStringValueReference: () => (/* binding */ makeStringValueReference),
69885
70102
  /* harmony export */ nullCoalesceWithTypeCheck: () => (/* binding */ nullCoalesceWithTypeCheck),
69886
70103
  /* harmony export */ tryExtractValueReferenceAsStringFromDecimal: () => (/* binding */ tryExtractValueReferenceAsStringFromDecimal),
69887
70104
  /* harmony export */ wrapWithArgumentsCondition: () => (/* binding */ wrapWithArgumentsCondition),
69888
70105
  /* harmony export */ wrapWithDisableValueAutoInitFlagCheckIfRequired: () => (/* binding */ wrapWithDisableValueAutoInitFlagCheckIfRequired)
69889
70106
  /* 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");
70107
+ /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! util */ "util");
70108
+ /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_0__);
70109
+ /* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
70110
+ /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
70111
+ /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
70112
+ /* harmony import */ var _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
70113
+
69893
70114
 
69894
70115
 
69895
70116
 
70117
+
70118
+ const dictFieldNameSuffix = "_dict";
70119
+ const arrayFieldNameSuffix = "_array";
70120
+ const hashSetFieldNameSuffix = "_hashSet";
69896
70121
  function* getAllExpressionChildren(node, descendantsFilter) {
69897
70122
  const children = node.getChildNodes();
69898
70123
  for (const child of children) {
@@ -69903,75 +70128,138 @@ function* getAllExpressionChildren(node, descendantsFilter) {
69903
70128
  }
69904
70129
  }
69905
70130
  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));
70131
+ 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
70132
  }
69908
70133
  function wrapWithDisableValueAutoInitFlagCheckIfRequired(formSchemaRng, x) {
69909
70134
  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];
70135
+ 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
70136
  }
69912
70137
  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;
70138
+ 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);
70139
+ 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);
70140
+ const uniquePaths = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.distinctBy(allValueRefNodes, x => x.convertToString());
70141
+ const conditionExpression = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.reduce(uniquePaths, (acc, curr) => {
70142
+ const currExpr = new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ExistsExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(curr.modePath, curr.valueName));
70143
+ return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.OrBinaryExpression(acc, currExpr) : currExpr;
69919
70144
  }, undefined);
69920
70145
  if (conditionExpression == undefined) {
69921
70146
  return expression;
69922
70147
  }
69923
- return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ConditionalExpression(conditionExpression, expression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression());
70148
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ConditionalExpression(conditionExpression, expression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullLiteralExpression());
69924
70149
  }
69925
70150
  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());
70151
+ 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
70152
  const allUniqueRulesWithOptionalChecks = Iterator.from(optionalSectionRulesBuilder.wrapRulesWithOptionalPageCheck(allUniqueRules)).map(x => x.convertToString()).reduce((x, y) => x + (x ? "\n" : "") + y, "");
69928
70153
  return allUniqueRulesWithOptionalChecks;
69929
70154
  }
69930
70155
  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) {
70156
+ 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
70157
  return expression.targetExpression;
69933
70158
  }
69934
70159
  return expression;
69935
70160
  }
70161
+ function castFinalExpressionToStringIfNeed(operandExpression, enableTypedExpression, decimalFormat = "G29") {
70162
+ 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)) {
70163
+ return operandExpression;
70164
+ }
70165
+ return castOperandToStringIfNeed(operandExpression, decimalFormat);
70166
+ }
69936
70167
  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"));
70168
+ if (operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DateTimeExpression || operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DateNowExpression) {
70169
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DateToStringExpression(operandExpression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression("dd.MM.yyyy"));
70170
+ }
70171
+ if (operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.array || operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.hashSet) {
70172
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SerializeEnumerationExpression(operandExpression);
69939
70173
  }
69940
- if (operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.HashSetExpression) {
69941
- return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SerializeEnumerationExpression(operandExpression);
70174
+ 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;
70175
+ }
70176
+ function castOperandIfNeed(operandExpression, type) {
70177
+ if (type instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression) {
70178
+ return operandExpression.getType() != type ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(operandExpression, type) : operandExpression;
69942
70179
  }
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;
70180
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid type for cast: ${type}`);
69944
70181
  }
69945
70182
  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;
70183
+ 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
70184
  }
69948
70185
  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;
70186
+ 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
70187
  }
69951
- const decimalWrapper = (ex, needWrapped) => needWrapped ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(ex, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal) : ex;
70188
+ const decimalWrapper = (ex, needWrapped) => needWrapped ? castOperandToDecimalIfNeed(ex) : ex;
69952
70189
  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;
70190
+ 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
70191
  }
69955
70192
  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;
70193
+ 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
70194
  if (!isValid) {
69958
70195
  throw new Error("Couldn't build null coalesce expression: types not match");
69959
70196
  }
69960
- return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullCoalesceExpression(argument, replacement);
70197
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullCoalesceExpression(argument, replacement);
69961
70198
  }
69962
70199
  function ensureOperandsOfTypeOrNull(type, ...operands) {
69963
70200
  for (const operand of operands) {
69964
70201
  const operandType = operand.getType();
69965
- if (operandType !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.null && operandType !== type) {
70202
+ if (operandType !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.null && operandType !== type) {
69966
70203
  throw new Error(`Invalid operand type: required [${type}] but got ${operandType}`);
69967
70204
  }
69968
70205
  }
69969
70206
  }
69970
70207
  function combineByOrFlangExpr(acc, current) {
69971
- return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.OrBinaryExpression(acc, current) : current;
70208
+ return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.OrBinaryExpression(acc, current) : current;
69972
70209
  }
69973
70210
  function combineByAndFlangExpr(acc, current) {
69974
- return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.AndBinaryExpression(acc, current) : current;
70211
+ return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.AndBinaryExpression(acc, current) : current;
70212
+ }
70213
+ function makeNoDeps(expression) {
70214
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
70215
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression(expression);
70216
+ }
70217
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
70218
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression(expression.targetExpression), expression.targetType, expression.defaultValue);
70219
+ }
70220
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid NoDeps usage: argument must be native ValueReferenceExpression or wrapped to CastExpression!`);
70221
+ }
70222
+ function makeGetOld(expression) {
70223
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
70224
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.GetOldExpression(expression);
70225
+ }
70226
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
70227
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.GetOldExpression(expression.targetExpression), expression.targetType, expression.defaultValue);
70228
+ }
70229
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid GetOld usage: argument must be native ValueReferenceExpression or wrapped to CastExpression!`);
70230
+ }
70231
+ function makeStringValueReference(modePath, valueName) {
70232
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(modePath, valueName), _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string);
70233
+ }
70234
+ function extractValueReferenceFromCast(expression) {
70235
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
70236
+ return expression;
70237
+ }
70238
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression) {
70239
+ return expression.targetExpression;
70240
+ }
70241
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression) {
70242
+ return expression.targetExpression;
70243
+ }
70244
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Cannot extract ValueReferenceExpression! ${(0,util__WEBPACK_IMPORTED_MODULE_0__.inspect)(expression)}`);
70245
+ }
70246
+ function ensureCorrectFieldNameByExpressionType(statement) {
70247
+ if (statement instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement) {
70248
+ const lastPart = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.last(statement.left.modePath.getPathParts());
70249
+ const lastStringPart = _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_3__.PathTokens.isSimpleToken(lastPart) ? lastPart : "";
70250
+ if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.dict && !lastStringPart.endsWith(dictFieldNameSuffix)) {
70251
+ throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${dictFieldNameSuffix}"`);
70252
+ }
70253
+ if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.hashSet && !lastStringPart.endsWith(hashSetFieldNameSuffix)) {
70254
+ throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${hashSetFieldNameSuffix}"`);
70255
+ }
70256
+ if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.array && !lastStringPart.endsWith(arrayFieldNameSuffix)) {
70257
+ throw new Error(`Suffix of path ${statement.left.modePath.toString()} must be "${arrayFieldNameSuffix}"`);
70258
+ }
70259
+ if (statement.right.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string && (lastStringPart.endsWith(arrayFieldNameSuffix) || lastStringPart.endsWith(hashSetFieldNameSuffix) || lastStringPart.endsWith(dictFieldNameSuffix))) {
70260
+ throw new Error(`Suffix of path ${statement.left.modePath.toString()} must NOT be "${arrayFieldNameSuffix}", "${hashSetFieldNameSuffix}" or "${dictFieldNameSuffix}"`);
70261
+ }
70262
+ }
69975
70263
  }
69976
70264
 
69977
70265
  /***/ }),
@@ -69994,7 +70282,13 @@ __webpack_require__.r(__webpack_exports__);
69994
70282
  /* harmony import */ var _babel_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_types__WEBPACK_IMPORTED_MODULE_1__);
69995
70283
  /* harmony import */ var _Common_Errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/Errors */ "./Common/Errors.ts");
69996
70284
  /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
69997
- /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
70285
+ /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
70286
+ /* harmony import */ var _Engine_src_Engine_Core_CoreTypes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../Engine/src/Engine/Core/CoreTypes */ "./Engine/src/Engine/Core/CoreTypes.ts");
70287
+ /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
70288
+ /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
70289
+
70290
+
70291
+
69998
70292
 
69999
70293
 
70000
70294
 
@@ -70061,8 +70355,8 @@ class FetchFunctionToFlangConverter {
70061
70355
  const innerCondition = this.traverse(node.test);
70062
70356
  const then = this.traverse(node.consequent);
70063
70357
  const elseThen = this.traverse(node.alternate);
70064
- const condition = innerCondition instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.LogicalExpression ? innerCondition : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NotEqExpression(innerCondition, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullLiteralExpression());
70065
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ConditionalExpression(condition, then, elseThen);
70358
+ const condition = innerCondition instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.LogicalExpression ? innerCondition : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NotEqExpression(innerCondition, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NullLiteralExpression());
70359
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ConditionalExpression(condition, then, elseThen);
70066
70360
  }
70067
70361
  if (_babel_types__WEBPACK_IMPORTED_MODULE_1__.isBinaryExpression(node)) {
70068
70362
  const left = this.traverse(node.left);
@@ -70070,12 +70364,12 @@ class FetchFunctionToFlangConverter {
70070
70364
  switch (node.operator) {
70071
70365
  case "==":
70072
70366
  case "===":
70073
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.EqExpression(left, right);
70367
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.EqExpression(left, right);
70074
70368
  case "!=":
70075
70369
  case "!==":
70076
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NotEqExpression(left, right);
70370
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NotEqExpression(left, right);
70077
70371
  case "+":
70078
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SumBinaryExpression(left, right);
70372
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SumBinaryExpression(left, right);
70079
70373
  default:
70080
70374
  throw new JsToFlangConvertError("Not supported!");
70081
70375
  }
@@ -70085,38 +70379,57 @@ class FetchFunctionToFlangConverter {
70085
70379
  const right = this.traverse(node.right);
70086
70380
  switch (node.operator) {
70087
70381
  case "||":
70088
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.OrBinaryExpression(left, right);
70382
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.OrBinaryExpression(left, right);
70089
70383
  case "&&":
70090
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.AndBinaryExpression(left, right);
70384
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.AndBinaryExpression(left, right);
70091
70385
  case "??":
70092
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullCoalesceExpression(left, right);
70386
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NullCoalesceExpression(left, right);
70093
70387
  default:
70094
70388
  throw new JsToFlangConvertError("Not supported!");
70095
70389
  }
70096
70390
  }
70097
70391
  if (_babel_types__WEBPACK_IMPORTED_MODULE_1__.isStringLiteral(node)) {
70098
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression(node.value);
70392
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(node.value);
70099
70393
  }
70100
70394
  if (_babel_types__WEBPACK_IMPORTED_MODULE_1__.isNumericLiteral(node)) {
70101
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.DecimalLiteralExpression(node.value);
70395
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.DecimalLiteralExpression(node.value);
70102
70396
  }
70103
70397
  if (_babel_types__WEBPACK_IMPORTED_MODULE_1__.isNullLiteral(node)) {
70104
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullLiteralExpression();
70398
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NullLiteralExpression();
70105
70399
  }
70106
70400
  if (_babel_types__WEBPACK_IMPORTED_MODULE_1__.isIdentifier(node) && node.name === "undefined") {
70107
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullLiteralExpression();
70401
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NullLiteralExpression();
70108
70402
  }
70109
70403
  if (_babel_types__WEBPACK_IMPORTED_MODULE_1__.isMemberExpression(node)) {
70110
70404
  return this.convertMemberExpression(node);
70111
70405
  }
70406
+ if (_babel_types__WEBPACK_IMPORTED_MODULE_1__.isCallExpression(node)) {
70407
+ return this.convertCallExpression(node);
70408
+ }
70112
70409
  throw new JsToFlangConvertError("Unknown code node.\n" + JSON.stringify(node, null, 4));
70113
70410
  }
70411
+ convertCallExpression(node) {
70412
+ const obj = node.callee;
70413
+ const args = node.arguments;
70414
+ const isModelCall = _babel_types__WEBPACK_IMPORTED_MODULE_1__.isMemberExpression(obj) && _babel_types__WEBPACK_IMPORTED_MODULE_1__.isMemberExpression(obj.object) && _babel_types__WEBPACK_IMPORTED_MODULE_1__.isThisExpression(obj.object.object) && _babel_types__WEBPACK_IMPORTED_MODULE_1__.isIdentifier(obj.object.property) && obj.object.property.name === "model" && _babel_types__WEBPACK_IMPORTED_MODULE_1__.isIdentifier(obj.property) && obj.property.name === "getCached";
70415
+ if (isModelCall) {
70416
+ var _extractedArgs$, _extractedArgs$2;
70417
+ const extractedArgs = args.map(x => _babel_types__WEBPACK_IMPORTED_MODULE_1__.isStringLiteral(x) ? x.value : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.reject)("Arguments of [getCached] MUST be strings"));
70418
+ if (extractedArgs.length != 2) {
70419
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.reject)("[getCached] MUST have 2 arguments!");
70420
+ }
70421
+ const path = (_extractedArgs$ = extractedArgs[0]) !== null && _extractedArgs$ !== void 0 ? _extractedArgs$ : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.reject)();
70422
+ const fieldName = (_extractedArgs$2 = extractedArgs[1]) !== null && _extractedArgs$2 !== void 0 ? _extractedArgs$2 : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_3__.reject)();
70423
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.makeStringValueReference)((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_4__.createAbsolute)(path), (0,_Engine_src_Engine_Core_CoreTypes__WEBPACK_IMPORTED_MODULE_5__.ensureIsKnownViewModelFieldName)(fieldName));
70424
+ }
70425
+ throw new JsToFlangConvertError("Unknown call to model!");
70426
+ }
70114
70427
  convertMemberExpression(node) {
70115
70428
  const obj = node.object;
70116
- const check = _babel_types__WEBPACK_IMPORTED_MODULE_1__.isMemberExpression(obj) && _babel_types__WEBPACK_IMPORTED_MODULE_1__.isThisExpression(obj.object) && _babel_types__WEBPACK_IMPORTED_MODULE_1__.isIdentifier(obj.property) && obj.property.name === "requisites";
70117
- if (check) {
70429
+ const isRequisitesCall = _babel_types__WEBPACK_IMPORTED_MODULE_1__.isMemberExpression(obj) && _babel_types__WEBPACK_IMPORTED_MODULE_1__.isThisExpression(obj.object) && _babel_types__WEBPACK_IMPORTED_MODULE_1__.isIdentifier(obj.property) && obj.property.name === "requisites";
70430
+ if (isRequisitesCall) {
70118
70431
  if (_babel_types__WEBPACK_IMPORTED_MODULE_1__.isStringLiteral(node.property)) {
70119
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.GetExternalInfoExpression(node.property.value.endsWith(".value") ? node.property.value : `${node.property.value}.value`);
70432
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.GetExternalInfoExpression(node.property.value.endsWith(".value") ? node.property.value : `${node.property.value}.value`);
70120
70433
  }
70121
70434
  throw new JsToFlangConvertError("Unsuported call to requisites!");
70122
70435
  }
@@ -70147,8 +70460,10 @@ __webpack_require__.r(__webpack_exports__);
70147
70460
  /* harmony import */ var _Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../Common/ModelPath/BuildIterationSequence */ "./Common/ModelPath/BuildIterationSequence.ts");
70148
70461
  /* harmony import */ var _Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../Common/ModelPath/PathSplitHelper */ "./Common/ModelPath/PathSplitHelper.ts");
70149
70462
  /* 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");
70463
+ /* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
70464
+ /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
70465
+ /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
70466
+
70152
70467
 
70153
70468
 
70154
70469
 
@@ -70159,14 +70474,16 @@ __webpack_require__.r(__webpack_exports__);
70159
70474
 
70160
70475
 
70161
70476
  class FormulaExpressionToFlangExpressionConverter {
70162
- constructor(adjustPathMultiplicityFunc) {
70477
+ constructor(adjustPathMultiplicityFunc, options) {
70163
70478
  this.adjustPathMultiplicity = void 0;
70479
+ this.options = void 0;
70480
+ this.options = options;
70164
70481
  this.adjustPathMultiplicity = adjustPathMultiplicityFunc;
70165
70482
  }
70166
70483
  compileExpressionToFlangExpression(expression, prefix, target, addPrecalculationRule) {
70167
70484
  const resultExpr = this.compileExpressionToFlangExpressionInternal(expression, prefix, target, addPrecalculationRule);
70168
70485
  // Если формула это только прямое обращение к значене, то трактовать его как строку
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) {
70486
+ 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
70487
  return resultExpr.targetExpression;
70171
70488
  }
70172
70489
  return resultExpr;
@@ -70183,24 +70500,24 @@ class FormulaExpressionToFlangExpressionConverter {
70183
70500
  return this.compiledArgumentExpression(prefix, target, expression.select, "decimal", addPrecalculationRule);
70184
70501
  }
70185
70502
  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)));
70503
+ 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
70504
  }
70188
70505
  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));
70506
+ const expr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
70507
+ 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
70508
  }
70192
70509
  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));
70510
+ 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
70511
  }
70195
70512
  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)));
70513
+ 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
70514
  }
70198
70515
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaChooseExpression) {
70199
70516
  const condExpr = this.compileExpressionToFlangExpressionInternal(expression.ifNode.condition, prefix, target, addPrecalculationRule);
70200
70517
  const thenExpr = this.compileExpressionToFlangExpressionInternal(expression.thenNode.expression, prefix, target, addPrecalculationRule);
70201
70518
  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);
70519
+ const castToStringRequired = thenExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string || elseExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string;
70520
+ 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
70521
  }
70205
70522
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMultiplyExpression) {
70206
70523
  return this.compileMultiplyExpression(expression, prefix, target, addPrecalculationRule);
@@ -70212,14 +70529,14 @@ class FormulaExpressionToFlangExpressionConverter {
70212
70529
  return this.compileAndExpression(expression, prefix, target, addPrecalculationRule);
70213
70530
  }
70214
70531
  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));
70532
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NegateUnaryExpression(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
70216
70533
  }
70217
70534
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaConstExpression) {
70218
70535
  switch (expression.type) {
70219
70536
  case "string":
70220
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression(expression.value);
70537
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.value);
70221
70538
  case "decimal":
70222
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(expression.value);
70539
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.value);
70223
70540
  default:
70224
70541
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.NotSupportedError("Unknown constant type!");
70225
70542
  }
@@ -70228,35 +70545,35 @@ class FormulaExpressionToFlangExpressionConverter {
70228
70545
  return this.compileDivisionExpression(expression, prefix, target, addPrecalculationRule);
70229
70546
  }
70230
70547
  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)));
70548
+ 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
70549
  }
70233
70550
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGtExpression) {
70234
70551
  const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
70235
70552
  const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
70236
70553
  const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
70237
70554
  const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
70238
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GtExpression(left, right);
70555
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GtExpression(left, right);
70239
70556
  }
70240
70557
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLtExpression) {
70241
70558
  const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
70242
70559
  const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
70243
70560
  const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
70244
70561
  const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
70245
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.LtExpression(left, right);
70562
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LtExpression(left, right);
70246
70563
  }
70247
70564
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGeExpression) {
70248
70565
  const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
70249
70566
  const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
70250
70567
  const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
70251
70568
  const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
70252
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.GeExpression(left, right);
70569
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GeExpression(left, right);
70253
70570
  }
70254
70571
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLeExpression) {
70255
70572
  const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
70256
70573
  const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
70257
70574
  const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
70258
70575
  const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
70259
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.LeExpression(left, right);
70576
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LeExpression(left, right);
70260
70577
  }
70261
70578
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaEqExpression) {
70262
70579
  return this.compileEqExpression(prefix, target, expression, addPrecalculationRule);
@@ -70266,135 +70583,118 @@ class FormulaExpressionToFlangExpressionConverter {
70266
70583
  // TODO: тут необходимо учесть, что exists может смотреть на множественность
70267
70584
  // TODO: реализовать в рамках задачи https://yt.skbkontur.ru/issue/FS-7385
70268
70585
  /* 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())));
70586
+ const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.extractValueReferenceFromCast)(this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule));
70587
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ExistsExpression(arg);
70271
70588
  }
70272
70589
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaWhenExpression) {
70273
70590
  const condition = this.compileExpressionToFlangExpressionInternal(expression.expressions[0], prefix, target, addPrecalculationRule);
70274
70591
  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)));
70592
+ 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
70593
  }
70277
70594
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaRegexMatchExpression) {
70278
70595
  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));
70596
+ const correctedArg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.tryExtractValueReferenceAsStringFromDecimal)(arg);
70597
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.RegexMatchExpression(correctedArg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.pattern));
70281
70598
  }
70282
70599
  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);
70600
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule, "Count"), 0);
70284
70601
  }
70285
70602
  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)));
70603
+ 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
70604
  }
70288
70605
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaConcatExpression) {
70289
70606
  return this.compileConcatExpression(expression, prefix, target, addPrecalculationRule);
70290
70607
  }
70291
70608
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaSubstringExpression) {
70292
70609
  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));
70610
+ const argAsString = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg, arg.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal ? "G29" : undefined);
70611
+ 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
70612
  }
70296
70613
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNewLineExpression) {
70297
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.StringLiteralExpression("\r\n");
70614
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("\r\n");
70298
70615
  }
70299
70616
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNoDepsNode) {
70300
70617
  const noDepsExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
70301
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.NoDepsExpression(noDepsExpression);
70618
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)(noDepsExpression);
70302
70619
  }
70303
70620
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateNowExpression) {
70304
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DateNowExpression();
70621
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DateNowExpression();
70305
70622
  }
70306
70623
  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)));
70624
+ 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
70625
  }
70309
70626
  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)));
70627
+ 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
70628
  }
70312
70629
  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)));
70630
+ 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
70631
  }
70315
70632
  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)));
70633
+ 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
70634
  }
70318
70635
  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)));
70636
+ 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
70637
  }
70321
70638
  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);
70639
+ const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
70640
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DifferenceInMonthsExpression(expressions);
70324
70641
  }
70325
70642
  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);
70643
+ const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
70644
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DifferenceInDaysExpression(expressions);
70328
70645
  }
70329
70646
  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));
70647
+ 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
70648
  }
70332
70649
  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));
70650
+ 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
70651
  }
70335
70652
  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));
70653
+ 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
70654
  }
70338
70655
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateToStringExpression) {
70339
70656
  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"));
70657
+ 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
70658
  }
70342
70659
  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);
70660
+ 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
70661
  }
70345
70662
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsSnilsExpression) {
70346
70663
  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));
70664
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsSnilsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
70348
70665
  }
70349
70666
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsRegNumSfrExpression) {
70350
70667
  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));
70668
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsRegNumSfrExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
70352
70669
  }
70353
70670
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsInnExpression) {
70354
70671
  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));
70672
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsInnExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
70356
70673
  }
70357
70674
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsValidMirCardNumberExpression) {
70358
70675
  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));
70676
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsValidMirCardNumberExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
70360
70677
  }
70361
70678
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaArrayExpression) {
70362
70679
  const items = expression.items.map(arg => this.compileEnumerationItem(arg, prefix, target, addPrecalculationRule));
70363
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ArrayExpression(items);
70680
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArrayExpression(items);
70364
70681
  }
70365
70682
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaFirstOrDefaultExpression) {
70366
70683
  const firstOrDefaultExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
70367
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.FirstOrDefaultExpression(firstOrDefaultExpression);
70684
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.FirstOrDefaultExpression(firstOrDefaultExpression);
70368
70685
  }
70369
70686
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaHashSetExpression) {
70370
- if (expression.expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaArgumentExpression) {
70371
- const adjustedSelectPath = this.preparePathAndAdjustMultiplicity(prefix, expression.expression.select);
70372
- const splitInfo = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, adjustedSelectPath);
70373
- const diffSelectPath = splitInfo.differentPath;
70374
- const hasMultiplicity = diffSelectPath.getIterationRank() > 0;
70375
- if (hasMultiplicity) {
70376
- const sourceKeyParts = adjustedSelectPath.getPathPartsAsArray();
70377
- const firstPart = splitInfo.matchedPath.toCurrentIteration();
70378
- const firstPartLength = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.count(firstPart.getPathParts());
70379
- const secondPartParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength)).getPathPartsAsArray();
70380
- const lastStarIndexSecondPart = secondPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
70381
- const secondPartFinalParts = secondPartParts.slice(0, lastStarIndexSecondPart);
70382
- 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());
70384
- }
70385
- }
70386
- const hashSetExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
70387
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.HashSetExpression(hashSetExpression);
70687
+ return this.compileHashSetExpression(prefix, target, expression, addPrecalculationRule);
70388
70688
  }
70389
70689
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression) {
70390
70690
  const filterColumn = this.compileExpressionToFlangExpressionInternal(expression.filterColumn.filterColumn, prefix, target, addPrecalculationRule);
70391
70691
  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));
70692
+ 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
70693
  }
70394
70694
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsValidAccountNumberExpression) {
70395
70695
  const bik = this.compiledArgumentExpression(prefix, target, expression.bik, "string", addPrecalculationRule);
70396
70696
  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));
70697
+ 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
70698
  }
70399
70699
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGroupSumExpression) {
70400
70700
  return this.compileGroupSumExpression(prefix, target, expression, addPrecalculationRule);
@@ -70402,18 +70702,30 @@ class FormulaExpressionToFlangExpressionConverter {
70402
70702
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGroupCountExpression) {
70403
70703
  return this.compileGroupCountExpression(prefix, target, expression, addPrecalculationRule);
70404
70704
  }
70705
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMakeDictExpression) {
70706
+ return this.compileMakeDictExpression(prefix, target, expression, addPrecalculationRule);
70707
+ }
70708
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetSumByKeysExpression) {
70709
+ return this.compileGetSumByKeysExpression(prefix, target, expression, addPrecalculationRule);
70710
+ }
70405
70711
  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);
70712
+ const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
70713
+ const items = expression.items.expressions.map(item => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(item, prefix, target, addPrecalculationRule)));
70714
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OneOfExpression(arg, items);
70409
70715
  }
70410
70716
  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")));
70717
+ const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
70718
+ const getValueReferenceExpression = () => {
70719
+ if (arg instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70720
+ return arg;
70721
+ }
70722
+ if (arg instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && arg.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70723
+ return arg.targetExpression;
70724
+ }
70725
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)("hasAutoFlag supports only Argument expression (ValueReferenceExpression) as parameter.");
70726
+ };
70727
+ const valueRefExpression = getValueReferenceExpression();
70728
+ 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
70729
  return expr;
70418
70730
  }
70419
70731
  throw new Error(`Unsupported type of node: ${expression.constructor.name}, ${expression.sourceXmlNode.name}`);
@@ -70422,7 +70734,7 @@ class FormulaExpressionToFlangExpressionConverter {
70422
70734
  if (formulaExpression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateTimeExpression || formulaExpression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateNowExpression) {
70423
70735
  return flangExpression;
70424
70736
  }
70425
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.castOperandToDecimalIfNeed)(flangExpression);
70737
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(flangExpression);
70426
70738
  }
70427
70739
  compileEqExpression(prefix, target, expression, addPrecalculationRule) {
70428
70740
  const left = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
@@ -70430,12 +70742,145 @@ class FormulaExpressionToFlangExpressionConverter {
70430
70742
 
70431
70743
  // Сейчас в АР иногда проверку на decimal значение делаем через [Значение != "Какая-то строка"]
70432
70744
  // Поэтому при такой проверке вычитываем поле "Значение" как строку
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);
70745
+ 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) {
70746
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(left.targetExpression), right);
70747
+ }
70748
+ 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));
70749
+ }
70750
+ compileHashSetExpression(prefix, target, expression, addPrecalculationRule) {
70751
+ if (expression.expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaArgumentExpression) {
70752
+ const adjustedSelectPath = this.preparePathAndAdjustMultiplicity(prefix, expression.expression.select);
70753
+ const splitInfo = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, adjustedSelectPath);
70754
+ const diffSelectPath = splitInfo.differentPath;
70755
+ const hasMultiplicity = diffSelectPath.getIterationRank() > 0;
70756
+ if (hasMultiplicity) {
70757
+ if (this.options.enableGroupSumAutoConversion) {
70758
+ const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.expression.select);
70759
+ const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(1);
70760
+ const dictPathWithField = this.makeDictNameFromKeyAndValue(splitInfo.matchedPath, sourceKeyPath, sourceValueExpression);
70761
+ const dictExpression = this.compileMakeDictExpressionImpl(prefix, dictPathWithField, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70762
+ const dictStatement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(dictPathWithField.path, "value"), dictExpression);
70763
+ addPrecalculationRule(dictStatement);
70764
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MakeHashSetFromDictExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(dictPathWithField.path.toCurrentIteration(), "value")));
70765
+ } else {
70766
+ const sourceKeyParts = adjustedSelectPath.getPathPartsAsArray();
70767
+ const firstPart = splitInfo.matchedPath.toCurrentIteration();
70768
+ const firstPartLength = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.count(firstPart.getPathParts());
70769
+ const secondPartParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength)).getPathPartsAsArray();
70770
+ const lastStarIndexSecondPart = secondPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
70771
+ const secondPartFinalParts = secondPartParts.slice(0, lastStarIndexSecondPart);
70772
+ const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)([...firstPart.getPathParts(), ...secondPartFinalParts]).trimLastStarIfLastToken();
70773
+ 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());
70774
+ }
70775
+ }
70435
70776
  }
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));
70777
+ const hashSetExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
70778
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression(hashSetExpression);
70437
70779
  }
70438
- compileGroupSumExpressionWithCustomValueExpression(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
70780
+ compileMakeDictExpressionImpl(prefix, target, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
70781
+ const getOldSourceValueExpression = () => {
70782
+ if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70783
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(sourceValueExpression);
70784
+ }
70785
+ if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && sourceValueExpression.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70786
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)(sourceValueExpression.targetExpression), sourceValueExpression.targetType, sourceValueExpression.defaultValue);
70787
+ }
70788
+ if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConstExpression) {
70789
+ return sourceValueExpression;
70790
+ }
70791
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)(`SourceValueExpression for makeDict must be reference to value or constant.
70792
+ Converted Object: ${JSON.stringify(sourceValueExpression)}`);
70793
+ };
70794
+ const oldSourceValueExpression = getOldSourceValueExpression();
70795
+ const matchedPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
70796
+ const firstPart = matchedPaths.matchedPath.toCurrentIteration();
70797
+ const secondPart = matchedPaths.differentPath;
70798
+ const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(firstPart.joinWith(secondPart).getLastListPath());
70799
+ 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));
70800
+ 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));
70801
+ 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()));
70802
+ return reduceExpression;
70803
+ }
70804
+ compileMakeDictExpression(prefix, target, expression, addPrecalculationRule) {
70805
+ const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
70806
+ const sourceValueExpression = this.compileExpressionToFlangExpressionInternal(expression.sourceValueExpression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__.AbsoluteModelFieldPath(sourceKeyPath, "value"), addPrecalculationRule);
70807
+ const reduceExpression = this.compileMakeDictExpressionImpl(prefix, target, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70808
+ return reduceExpression;
70809
+ }
70810
+ compileArrayOfTargetKeys(prefix, target, targetKeys, addPrecalculationRule) {
70811
+ const deserializedKeys = targetKeys[0] instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression ? this.compileExpressionToFlangExpressionInternal(targetKeys[0], prefix, target, addPrecalculationRule) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression(targetKeys.map(i => {
70812
+ const item = this.compileEnumerationItem(i, prefix, target, addPrecalculationRule);
70813
+ if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConstExpression) {
70814
+ return item;
70815
+ }
70816
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.extractValueReferenceFromCast)(item);
70817
+ }), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
70818
+ return deserializedKeys;
70819
+ }
70820
+ compileGetSumByKeysExpressionImpl(prefix, target, dictPath, targetKeys, addPrecalculationRule) {
70821
+ 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);
70822
+ return finalValueExpression;
70823
+ }
70824
+ compileGetSumByKeysExpression(prefix, target, expression, addPrecalculationRule) {
70825
+ const dictPath = this.preparePathAndAdjustMultiplicity(prefix, expression.dictPath);
70826
+ const targetKeys = expression.targetKeys;
70827
+ const deserializedKeys = this.compileArrayOfTargetKeys(prefix, target, targetKeys.items, addPrecalculationRule);
70828
+ return this.compileGetSumByKeysExpressionImpl(prefix, target, dictPath, deserializedKeys, addPrecalculationRule);
70829
+ }
70830
+ compileGroupSumExpressionWithPersistentDictionary(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
70831
+ const matchPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
70832
+ const sourceKeyParts = sourceKeyPath.getPathPartsAsArray();
70833
+ const firstPart = matchPaths.matchedPath;
70834
+ const firstPartLength = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.count(firstPart.getPathParts());
70835
+ const secondParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength));
70836
+ const getIterationPathWithNestedMultiplicity = () => firstPart;
70837
+ const getIterationPathWithoutNestedMultiplicity = () => {
70838
+ const firstPartParts = matchPaths.matchedPath.getPathPartsAsArray();
70839
+ const lastStarIndexSecondPart = firstPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
70840
+ return (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(sourceKeyParts.slice(0, lastStarIndexSecondPart)).getParentPath();
70841
+ };
70842
+ const finalIterPath = secondParts.isContainCurrentOrEachIteration() ? getIterationPathWithNestedMultiplicity() : getIterationPathWithoutNestedMultiplicity();
70843
+ if (finalIterPath.isEmpty()) {
70844
+ throw new Error("Error occurred while trying parse path for reduce: " + firstPart.toLegacyPath());
70845
+ }
70846
+ const basePathForDict = finalIterPath;
70847
+ const dictPathWithField = this.makeDictNameFromKeyAndValue(finalIterPath, sourceKeyPath, sourceValueExpression);
70848
+ 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());
70849
+ const dictExpression = this.compileMakeDictExpressionImpl(basePathForDictPrefix, dictPathWithField, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70850
+ const dictStatement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(dictPathWithField.path, "value"), dictExpression);
70851
+ addPrecalculationRule(dictStatement);
70852
+ const deserializedKeys = this.compileArrayOfTargetKeys(prefix, target, targetKeys, addPrecalculationRule);
70853
+ 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);
70854
+ return finalValueExpression;
70855
+ }
70856
+ extractNameFromPath(path) {
70857
+ return Iterator.from(path.getPathParts()).filter(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken).toArray().join("_");
70858
+ }
70859
+ extractNameFromExpression(basePath, expr) {
70860
+ 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;
70861
+ if (exprAsValueRef != undefined) {
70862
+ return this.extractNameFromPath((0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(basePath, exprAsValueRef.modePath).differentPath);
70863
+ }
70864
+ 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;
70865
+ if (exprAsConst != undefined) {
70866
+ if (exprAsConst instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression) {
70867
+ return `constant_${exprAsConst.value}`;
70868
+ }
70869
+ if (exprAsConst instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression) {
70870
+ return `constant_${exprAsConst.stringValue}`;
70871
+ }
70872
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)("Can't convert sourceValueExpression for generated dictionary name: unsupported type of constant!");
70873
+ }
70874
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)("Can't convert sourceValueExpression for generated dictionary name!");
70875
+ }
70876
+ makeDictNameFromKeyAndValue(basePathForDict, sourceKeyPath, sourceValueExpression) {
70877
+ const keyDiffPathText = this.extractNameFromPath((0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(basePathForDict, sourceKeyPath).differentPath);
70878
+ const valueDiffPathText = this.extractNameFromExpression(basePathForDict, sourceValueExpression);
70879
+ const dictPath = basePathForDict.joinWith(`${keyDiffPathText}_${valueDiffPathText}_generated${_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.dictFieldNameSuffix}`);
70880
+ const dictPathWithField = new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__.AbsoluteModelFieldPath(dictPath, "value");
70881
+ return dictPathWithField;
70882
+ }
70883
+ compileGroupSumExpressionWithoutPersistentDictionaries(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
70439
70884
  const matchPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
70440
70885
  const sourceKeyParts = sourceKeyPath.getPathPartsAsArray();
70441
70886
  const firstPart = matchPaths.matchedPath.toCurrentIteration();
@@ -70456,10 +70901,10 @@ class FormulaExpressionToFlangExpressionConverter {
70456
70901
  if (finalIterPath.isEmpty()) {
70457
70902
  throw new Error("Error occurred while trying parse path for reduce: " + firstPart.toLegacyPath());
70458
70903
  }
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)());
70904
+ 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));
70905
+ 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());
70906
+ const deserializedKeys = targetKeys[0] instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression ? this.compileExpressionToFlangExpressionInternal(targetKeys[0], prefix, target, addPrecalculationRule) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression(targetKeys.map(i => this.compileEnumerationItem(i, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
70907
+ 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
70908
  return finalValueExpression;
70464
70909
  }
70465
70910
  compileEnumerationItem(expression, prefix, target, addPrecalculationRule) {
@@ -70468,62 +70913,80 @@ class FormulaExpressionToFlangExpressionConverter {
70468
70913
  }
70469
70914
  return this.compileExpressionToFlangExpressionInternal(expression, prefix, target, addPrecalculationRule);
70470
70915
  }
70916
+ compileGroupSumExpressionWithCustomValueExpression(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
70917
+ return this.options.enableGroupSumAutoConversion ? this.compileGroupSumExpressionWithPersistentDictionary(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) : this.compileGroupSumExpressionWithoutPersistentDictionaries(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70918
+ }
70471
70919
  compileGroupSumExpression(prefix, target, expression, addPrecalculationRule) {
70472
70920
  const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
70473
70921
  const sourceValuePath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceValuePath);
70474
- const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(sourceValuePath.toCurrentIteration(), "value");
70475
- return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, expression.targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70922
+ const sourceValueExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(sourceValuePath.toCurrentIteration(), "value");
70923
+ return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, expression.targetKeys.items, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70476
70924
  }
70477
70925
  compileGroupCountExpression(prefix, target, expression, addPrecalculationRule) {
70478
70926
  const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
70479
- const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.DecimalLiteralExpression(1);
70480
- return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, expression.targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70927
+ const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(1);
70928
+ return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, expression.targetKeys.items, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70929
+ }
70930
+ convertExpressionTypePropertyToFLangType(type) {
70931
+ switch (type) {
70932
+ case "string":
70933
+ return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string;
70934
+ case "array":
70935
+ return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.array;
70936
+ case "decimal":
70937
+ return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal;
70938
+ case "dict":
70939
+ return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict;
70940
+ default:
70941
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)(`Unknown ExpressionTypeProperty [${type}]`);
70942
+ }
70481
70943
  }
70482
70944
  compiledArgumentExpression(prefix, target, selectPath, selectType, addPrecalculationRule, aggregationFunction = "Sum") {
70945
+ const builtInType = this.convertExpressionTypePropertyToFLangType(selectType !== null && selectType !== void 0 ? selectType : "string");
70483
70946
  const adjustedSelectPath = this.preparePathAndAdjustMultiplicity(prefix, selectPath);
70484
70947
  const splitInfo = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, adjustedSelectPath);
70485
70948
  const baseSelectPath = splitInfo.matchedPath;
70486
70949
  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;
70950
+ const valueRefExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
70951
+ const finalValue = splitInfo.differentPath.isEmpty() && target.field === "value" ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeNoDeps)(valueRefExpression) : valueRefExpression;
70952
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandIfNeed)(finalValue, builtInType);
70490
70953
  } else {
70491
70954
  var _countValueExpression;
70492
- let resultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
70955
+ let resultValueExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(adjustedSelectPath.toCurrentIteration().normalize(), "value");
70493
70956
  let countValueExpression = undefined;
70494
70957
  const iterationEntries = [...(0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.reverseArray)((0,_Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_4__.buildIterationSequence)(splitInfo.differentPath))];
70495
70958
  for (const iterationEntry of iterationEntries) {
70496
70959
  const iterablePath = baseSelectPath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(iterationEntry.iterable.getPathPartsAsArray()));
70497
70960
  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"))));
70961
+ 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");
70962
+ 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");
70963
+ 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");
70964
+ 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");
70965
+ 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())));
70966
+ 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(""))));
70967
+ 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)));
70968
+ 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
70969
  resultValueExpression = currentSumExpression;
70507
70970
  countValueExpression = currenCountExpression;
70508
70971
  }
70509
70972
  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;
70973
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandIfNeed)(finalValue, builtInType);
70511
70974
  }
70512
70975
  }
70513
70976
  compileSumExpression(expression, prefix, target, addPrecalculationRule) {
70514
70977
  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;
70978
+ 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));
70979
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SumBinaryExpression(acc, currExpr) : currExpr;
70517
70980
  }, undefined);
70518
70981
  if (result == undefined) {
70519
70982
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
70520
70983
  }
70521
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.wrapWithArgumentsCondition)(result);
70984
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
70522
70985
  }
70523
70986
  compileConcatExpression(expression, prefix, target, addPrecalculationRule) {
70524
70987
  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;
70988
+ const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule));
70989
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConcatStringsExpression(acc, currExpr) : currExpr;
70527
70990
  }, undefined);
70528
70991
  if (result == undefined) {
70529
70992
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
@@ -70533,7 +70996,7 @@ class FormulaExpressionToFlangExpressionConverter {
70533
70996
  compileOrExpression(expression, prefix, target, addPrecalculationRule) {
70534
70997
  const result = expression.arguments.reduce((acc, curr) => {
70535
70998
  const currExpr = this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule);
70536
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.OrBinaryExpression(acc, currExpr) : currExpr;
70999
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OrBinaryExpression(acc, currExpr) : currExpr;
70537
71000
  }, undefined);
70538
71001
  if (result == undefined) {
70539
71002
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
@@ -70543,7 +71006,7 @@ class FormulaExpressionToFlangExpressionConverter {
70543
71006
  compileAndExpression(expression, prefix, target, addPrecalculationRule) {
70544
71007
  const result = expression.arguments.reduce((acc, curr) => {
70545
71008
  const currExpr = this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule);
70546
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_8__.AndBinaryExpression(acc, currExpr) : currExpr;
71009
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AndBinaryExpression(acc, currExpr) : currExpr;
70547
71010
  }, undefined);
70548
71011
  if (result == undefined) {
70549
71012
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
@@ -70552,24 +71015,24 @@ class FormulaExpressionToFlangExpressionConverter {
70552
71015
  }
70553
71016
  compileMultiplyExpression(expression, prefix, target, addPrecalculationRule) {
70554
71017
  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;
71018
+ 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));
71019
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MultiplyBinaryExpression(acc, expr) : expr;
70557
71020
  }, undefined);
70558
71021
  if (result == undefined) {
70559
71022
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
70560
71023
  }
70561
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.wrapWithArgumentsCondition)(result);
71024
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
70562
71025
  }
70563
71026
  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());
71027
+ 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
71028
  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);
71029
+ const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule), 0);
70567
71030
  return acc != undefined ? makeDivision(acc, currExpr) : currExpr;
70568
71031
  }, undefined);
70569
71032
  if (result == undefined) {
70570
71033
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
70571
71034
  }
70572
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_7__.wrapWithArgumentsCondition)(result);
71035
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
70573
71036
  }
70574
71037
  preparePathAndAdjustMultiplicity(prefix, path) {
70575
71038
  const resultPath = this.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(path.replace(/\@/g, ""), "auto")).normalize());
@@ -70679,9 +71142,10 @@ class AutoValueForValueByDefaultNormalizationRuleGenerator {
70679
71142
  const createValueRuleFromAutoValueRule = autoValueRule => {
70680
71143
  var _formulaRulesMap$get$, _formulaRulesMap$get;
70681
71144
  const valueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath, "value");
71145
+ const autoValueExpressionType = autoValueRule.right.getType();
70682
71146
  const valueRefCurrentIteration = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value");
70683
71147
  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)))));
71148
+ 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
71149
  };
70686
71150
  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
71151
 
@@ -70728,8 +71192,8 @@ class FormulaAndInitOnlyNormalizationRuleGenerator {
70728
71192
  this.optionalSectionRuleBuilder = optionalSectionRuleBuilder;
70729
71193
  }
70730
71194
  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")));
71195
+ 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));
71196
+ 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
71197
  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
71198
  const ignoredValueSetRuleMapper = x => {
70735
71199
  var _this$formSchemaRng$g;
@@ -70776,13 +71240,15 @@ __webpack_require__.r(__webpack_exports__);
70776
71240
  * 2) переводит autoFlag в true
70777
71241
  */
70778
71242
  class FormulaOnlyNormalizationRuleGenerator {
70779
- constructor(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder) {
71243
+ constructor(dataDeclarationHelper, formSchemaRng, formulas, optionalSectionRuleBuilder, formulaExprConverter, validationRulesBuilder, options) {
70780
71244
  this.dataDeclarationHelper = void 0;
70781
71245
  this.formSchemaRng = void 0;
70782
71246
  this.formulas = void 0;
71247
+ this.options = void 0;
70783
71248
  this.formulaExprConverter = void 0;
70784
71249
  this.optionalSectionRuleBuilder = void 0;
70785
71250
  this.validationRulesBuilder = void 0;
71251
+ this.options = options;
70786
71252
  this.optionalSectionRuleBuilder = optionalSectionRuleBuilder;
70787
71253
  this.dataDeclarationHelper = dataDeclarationHelper;
70788
71254
  this.formSchemaRng = formSchemaRng;
@@ -70809,10 +71275,14 @@ class FormulaOnlyNormalizationRuleGenerator {
70809
71275
  const precalculationRules = [];
70810
71276
  const defaultValue = this.dataDeclarationHelper.getDefaultValue(fullTarget.toLegacyPath());
70811
71277
  const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
71278
+ const getFormulaExpression = field => {
71279
+ 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");
71280
+ const resultType = result.getType();
71281
+ 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;
71282
+ };
70812
71283
  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
71284
  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)));
71285
+ 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
71286
  } else {
70817
71287
  result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
70818
71288
  }
@@ -70839,6 +71309,12 @@ __webpack_require__.r(__webpack_exports__);
70839
71309
  /* harmony export */ });
70840
71310
  /* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
70841
71311
  /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
71312
+ /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
71313
+ /* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
71314
+ /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
71315
+
71316
+
71317
+
70842
71318
 
70843
71319
 
70844
71320
 
@@ -70871,8 +71347,16 @@ class NormalizationRulesGenerator {
70871
71347
  const dataDeclarationRules = this.sugarRulesBuilder.buildRules();
70872
71348
 
70873
71349
  // Порядок важен, т.к. потом делаем 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);
71350
+ const allRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(initializeRules, lazyLoadingRules, formulaFLangRules, optionalSectionRules, dataDeclarationRules, sugarValidationRules).flatMap(rule => {
71351
+ (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.ensureCorrectFieldNameByExpressionType)(rule);
71352
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.wrapWithDisableValueAutoInitFlagCheckIfRequired)(this.formSchemaRng, rule);
71353
+ }).toArray();
71354
+ 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();
71355
+ const content = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.combineRulesWithOptionalSectionChecking)(allRules, this.optionalSectionRulesBuilder);
71356
+ return {
71357
+ content: content,
71358
+ serverOnlyPaths: dictionaryRules
71359
+ };
70876
71360
  }
70877
71361
  }
70878
71362
 
@@ -70926,12 +71410,14 @@ __webpack_require__.r(__webpack_exports__);
70926
71410
 
70927
71411
 
70928
71412
  class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.BaseRuleBuilder {
70929
- constructor(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter) {
71413
+ constructor(formSchemaRng, formulas, dataDeclarationHelper, formulaExprConverter, options) {
70930
71414
  super();
70931
71415
  this.formSchemaRng = void 0;
70932
71416
  this.formulas = void 0;
71417
+ this.options = void 0;
70933
71418
  this.formulaExprConverter = void 0;
70934
71419
  this.dataDeclarationHelper = void 0;
71420
+ this.options = options;
70935
71421
  this.formulaExprConverter = formulaExprConverter;
70936
71422
  this.dataDeclarationHelper = dataDeclarationHelper;
70937
71423
  this.formulas = formulas;
@@ -70953,7 +71439,11 @@ class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.
70953
71439
  const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
70954
71440
  const isDisabled = this.dataDeclarationHelper.isNodeHasDisabledEntry(fullTarget.toAbsolute());
70955
71441
  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));
71442
+ const getFormulaExpression = targetField => {
71443
+ 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");
71444
+ const resultType = result.getType();
71445
+ 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;
71446
+ };
70957
71447
  const valueRule = isTargetAutoField ? isDisabled ? this.createValueRuleForDisabledAutoField(fullTarget, getFormulaExpression) : this.createValueRuleForAutoField(fullTarget, defaultValue, getFormulaExpression) : this.createRegularValueRule(fullTarget, getFormulaExpression);
70958
71448
  const autoValueRule = isTargetAutoField ? this.createAutoValueRule(fullTarget, getFormulaExpression) : undefined;
70959
71449
  const autoFlagRule = isTargetAutoField ? this.createAutoFlagRule(fullTarget, isDecimal) : undefined;
@@ -70967,13 +71457,13 @@ class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.
70967
71457
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value"));
70968
71458
  }
70969
71459
  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"))));
71460
+ 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
71461
  }
70972
71462
  createValueRuleForDisabledAutoField(fullTarget, getFormulaExpression) {
70973
71463
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value"));
70974
71464
  }
70975
71465
  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))));
71466
+ 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
71467
  }
70978
71468
  adjustPathMultiplicity(path) {
70979
71469
  return (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_2__.adjustPathMultiplicityComplex)(path, this.formSchemaRng, this.dataDeclarationHelper);
@@ -71032,12 +71522,14 @@ __webpack_require__.r(__webpack_exports__);
71032
71522
  /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
71033
71523
  /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
71034
71524
  /* 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");
71525
+ /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
71526
+ /* harmony import */ var _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./BaseRuleBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/BaseRuleBuilder.ts");
71036
71527
 
71037
71528
 
71038
71529
 
71039
71530
 
71040
- class LazyLoadingRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_3__.BaseRuleBuilder {
71531
+
71532
+ class LazyLoadingRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_4__.BaseRuleBuilder {
71041
71533
  constructor(sugarRoot, lazyLoadingDeclaration) {
71042
71534
  super();
71043
71535
  this.sugarRoot = void 0;
@@ -71053,11 +71545,22 @@ class LazyLoadingRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_
71053
71545
  const thresholdEntry = Object.entries(this.lazyLoadingDeclaration).find(x => x[1].thresholdValue != undefined);
71054
71546
  if (thresholdEntry != undefined) {
71055
71547
  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);
71548
+ 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
71549
  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
71550
  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;
71551
+ const childrenPathReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(thresholdEntryPath.toCurrentIteration(), "children");
71552
+ 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));
71553
+ if (thresholdEntryPath.isContainIteration()) {
71554
+ const lazyLoadingCounterRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot).joinWith("LazyLoadingCounter"), "value");
71555
+ const iterationPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(thresholdEntryPath.getLastListPath());
71556
+ 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)))));
71557
+ yield counterStatement;
71558
+ 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")));
71559
+ yield lazyFlagStatement;
71560
+ } else {
71561
+ 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")));
71562
+ yield statement;
71563
+ }
71061
71564
  }
71062
71565
  }
71063
71566
  }
@@ -71084,7 +71587,9 @@ __webpack_require__.r(__webpack_exports__);
71084
71587
  /* 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
71588
  /* harmony import */ var _Common_ModelPath_ModelPathHelper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPathHelper */ "./Common/ModelPath/ModelPathHelper.ts");
71086
71589
  /* 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");
71590
+ /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
71591
+ /* harmony import */ var _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./BaseRuleBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/BaseRuleBuilder.ts");
71592
+
71088
71593
 
71089
71594
 
71090
71595
 
@@ -71095,7 +71600,7 @@ __webpack_require__.r(__webpack_exports__);
71095
71600
 
71096
71601
 
71097
71602
 
71098
- class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_9__.BaseRuleBuilder {
71603
+ class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_10__.BaseRuleBuilder {
71099
71604
  constructor(sugarRoot, dataDeclarationHelper) {
71100
71605
  super();
71101
71606
  this.sugarRoot = void 0;
@@ -71181,7 +71686,7 @@ class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MOD
71181
71686
  const targetIsFilledPath = targetOptionalSection.path.joinWith(_Common_PathConstants__WEBPACK_IMPORTED_MODULE_8__.OptionalSectionFilledFieldName);
71182
71687
  if (!targetIsFilledPath.isEquals(targetPath)) {
71183
71688
  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()));
71689
+ 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
71690
  }
71186
71691
  }
71187
71692
  return rule;
@@ -71203,7 +71708,7 @@ class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MOD
71203
71708
  var _pathGroup$, _pathGroup$map$reduce;
71204
71709
  const iterationEntry = (_pathGroup$ = pathGroup[0]) === null || _pathGroup$ === void 0 ? void 0 : _pathGroup$.lastIterationEntry;
71205
71710
  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"));
71711
+ const pathValueRef = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(pathInfo.path.toCurrentIteration(), "value"));
71207
71712
  const checkExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NotEqExpression(pathValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression());
71208
71713
  return checkExpression;
71209
71714
  }).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 +71862,9 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
71357
71862
  const validationText = next.message.reduce((acc, item) => {
71358
71863
  if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression) {
71359
71864
  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
71865
  }
71866
+ const valueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.extractValueReferenceFromCast)(item);
71867
+ 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
71868
  }, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(""));
71366
71869
  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
71870
  return condition;
@@ -71415,7 +71918,7 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
71415
71918
  }
71416
71919
  buildErrorWarningCountReduceRule(iterable, countFieldName, getAllItemsSumExpression) {
71417
71920
  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)));
71921
+ 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
71922
  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
71923
  }
71421
71924
  buildErrorWarningCountSimpleSumRule(iterable, countFieldName, getAllItemsSumExpression) {
@@ -71423,11 +71926,11 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
71423
71926
  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
71927
  }
71425
71928
  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);
71929
+ 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
71930
  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
71931
  }
71429
71932
  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));
71933
+ 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
71934
  }
71432
71935
  buildChainOfErrorCountRules(path, countFieldName, fieldName) {
71433
71936
  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 +96395,10 @@ __webpack_require__.r(__webpack_exports__);
95892
96395
  /* harmony import */ var _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ServerSideFLangNormalization/FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
95893
96396
  /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
95894
96397
  /* 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");
96398
+ /* harmony import */ var _ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ServerSideFLangNormalization/FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
96399
+ /* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
96400
+ /* harmony import */ var _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ElementProcessors/CommonNodeProperties/ValidationInfoNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/CommonNodeProperties/ValidationInfoNode.ts");
96401
+
95897
96402
 
95898
96403
 
95899
96404
 
@@ -95915,17 +96420,17 @@ class FLangNormalizationRulesBuilder {
95915
96420
  this.controlCustomizationContext = controlCustomizationContext;
95916
96421
  }
95917
96422
  *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"))));
96423
+ 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);
96424
+ 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
96425
  }
95921
96426
  *childrenInitializerForPicklist(node, optional, defaultChildren) {
95922
96427
  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"))));
96428
+ 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
96429
  }
95925
96430
  valueInitializer(node, dataBinding, disabled, pathSuffix, fetchFunctionSuffix) {
95926
96431
  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"));
96432
+ 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)());
96433
+ const originalValueReference = (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "value"));
95929
96434
  const sourceValueReference = this.getSourceValueReferenceWithCorrection(node, targetPathReference);
95930
96435
  const defaultValue = (_dataBinding$defaultV = dataBinding.defaultValue) !== null && _dataBinding$defaultV !== void 0 ? _dataBinding$defaultV : "";
95931
96436
  if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(dataBinding.fetchfn)) {
@@ -95949,11 +96454,11 @@ class FLangNormalizationRulesBuilder {
95949
96454
  if (!disabled && !dataBinding.settings) {
95950
96455
  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
96456
  }
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;
96457
+ 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
96458
  return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), finalExpression);
95954
96459
  }
95955
96460
  *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)());
96461
+ 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
96462
  if (options.disabled) {
95958
96463
  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
96464
  }
@@ -95971,9 +96476,9 @@ class FLangNormalizationRulesBuilder {
95971
96476
  var _typeNode$base, _this$schemaRng$getTy;
95972
96477
  // eslint-disable-next-line
95973
96478
  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;
96479
+ const typeNode = validationInfoSource instanceof _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_5__.ValidationInfoNode ? this.nodeTypeInfoHelper.getTypeNode(validationInfoSource) : undefined;
95975
96480
  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"));
96481
+ const sourceValueReference = (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "value"));
95977
96482
  return baseType != undefined ? this.wrapExpressionWithCorrectionExpression(baseType, sourceValueReference) : sourceValueReference;
95978
96483
  }
95979
96484
  }
@@ -97438,9 +97943,9 @@ function children(onlyTagName, nodeClasses = [], skipNodeNames = []) {
97438
97943
  (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
97944
  };
97440
97945
  }
97441
- function singleChild(tagName, nodeClasses = []) {
97946
+ function singleChild(tagName, nodeClasses = [], dec) {
97442
97947
  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)));
97948
+ (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
97949
  };
97445
97950
  }
97446
97951
  function attr(attrName, valueParser, dec) {