@crystaldesign/diva-backoffice 26.12.0-beta.23 → 26.12.0-beta.24

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.
@@ -51353,7 +51353,7 @@ var NAVIGATION_TOOL_DEFS = [{
51353
51353
  argAliases: GRID_ARG_ALIASES
51354
51354
  }, {
51355
51355
  name: 'locateRow',
51356
- description: "Locate a row in an on-screen table: already-loaded rows are scrolled to and flashed directly (no filter); rows not loaded yet are found via a server-side column filter (filterApplied:true in the result — the filter narrows the visible table, clearGridFilter restores it). EXACT ALWAYS WINS: an equals match is tried first (numbers and text alike); only when NONE exists does it fall back to a loose contains/prefix candidate — the result then carries `exact:false` and the `note` says so explicitly, it is never disguised as a genuine hit (a contains-match on a KEY column can otherwise stand in for a value that was never actually there, e.g. serieNo '9' resolving to '99'). Pass `exact:true` to reject a loose candidate outright (matchedRows:0) instead of returning it. Optionally selects the match (main-table selection reveals the subtable). ALSO THE CHEAPEST RECORD READ: the returned `firstRow` carries the record fields including ones that are not grid columns at all (featureRefs, catalogId, the raw localized JSON of a name column) — useful fields first, and on very wide records `firstRowOmittedFields` names what did not fit — plus toolbarTools and gridsOnScreen in the same answer. For \"what does this record actually contain\" it beats readGridRows on completeness AND tokens; reach for readGridRows when you want MANY rows, for locateRow when you want ONE row whole. BULK READ: pass 'values' (an array) to fetch SEVERAL records by the same column in ONE call — one trimmed row per value, misses and values that hit no UNIQUE exact row listed separately, no selection; use it whenever you would otherwise chain locateRow calls (collecting reference ids, pre-write checks).",
51356
+ description: "Locate a row in an on-screen table: already-loaded rows are scrolled to and flashed directly (no filter); rows not loaded yet are found via a server-side column filter (filterApplied:true in the result — the filter narrows the visible table, clearGridFilter restores it). EXACT ALWAYS WINS: an equals match is tried first (numbers and text alike); only when NONE exists does it fall back to a loose contains/prefix candidate — the result then carries `exact:false` and the `note` says so explicitly, it is never disguised as a genuine hit (a contains-match on a KEY column can otherwise stand in for a value that was never actually there, e.g. serieNo '9' resolving to '99'). Pass `exact:true` to reject a loose candidate outright (matchedRows:0) instead of returning it. Optionally selects the match (main-table selection reveals the subtable). ALSO THE CHEAPEST RECORD READ: the returned `firstRow` carries the record fields including ones that are not grid columns at all (featureRefs, catalogId, the raw localized JSON of a name column) — useful fields first, and on very wide records `firstRowOmittedFields` names what did not fit — plus toolbarTools and gridsOnScreen in the same answer. For \"what does this record actually contain\" it beats readGridRows on completeness AND tokens; reach for readGridRows when you want MANY rows, for locateRow when you want ONE row whole. BULK READ: pass 'values' (an array) to fetch SEVERAL records by the same column in ONE call — on a fully loaded table the rows are read directly, otherwise they go to the server as ONE combined equals filter per 50 values (not one lookup per value, so 100 values cost two server round trips): one trimmed row per value, misses and values that hit no UNIQUE exact row listed separately, no selection, no loose matching. Use it whenever you would otherwise chain locateRow calls (collecting reference ids, pre-write checks), and hand over the WHOLE list — splitting it into batches of a handful only multiplies the calls.",
51357
51357
  input_schema: {
51358
51358
  type: 'object',
51359
51359
  properties: {
@@ -51374,7 +51374,7 @@ var NAVIGATION_TOOL_DEFS = [{
51374
51374
  items: {
51375
51375
  type: 'string'
51376
51376
  },
51377
- description: 'BULK READ: several values to locate in ONE call — returns one row per value plus the misses; no selection'
51377
+ description: 'BULK READ: several values (a whole list, hundreds are fine) to locate in ONE call — one combined server filter per 50 values; returns one row per value plus the misses; no selection'
51378
51378
  },
51379
51379
  select: {
51380
51380
  type: 'boolean',
@@ -52151,6 +52151,60 @@ function countExactRows(api, column, value) {
52151
52151
  return count;
52152
52152
  }
52153
52153
 
52154
+ /** The first `limit` DISPLAYED real rows whose cell is EXACTLY the value — enough to tell none / one / several apart without a full count. */
52155
+ function exactRowsOf(api, column, value, isNumber) {
52156
+ var limit = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 2;
52157
+ var nodes = [];
52158
+ var displayed = api.getDisplayedRowCount();
52159
+ for (var i = 0; i < Math.min(displayed, 500) && nodes.length < limit; i++) {
52160
+ var node = api.getDisplayedRowAtIndex(i);
52161
+ if (isRealRow(node) && cellMatchesExact(cellValueOf(api, node, column), value, isNumber)) nodes.push(node);
52162
+ }
52163
+ return nodes;
52164
+ }
52165
+
52166
+ /**
52167
+ * Whether the DISPLAYED set reaches past what is loaded: a row without data is a block the server has not delivered
52168
+ * yet. A creating table's trailing creator row is such a stub too while it sits past the loaded block, so one stub
52169
+ * there is not a data block. Past 500 displayed rows the rest is not scanned and counts as unloaded.
52170
+ */
52171
+ function hasUnloadedDisplayedRows(api) {
52172
+ var _api$getGridOption;
52173
+ var displayed = api.getDisplayedRowCount();
52174
+ if (displayed > 500) return true;
52175
+ var stubs = 0;
52176
+ var creatorLoaded = false;
52177
+ for (var i = 0; i < displayed; i++) {
52178
+ var _node$data$__diva_con2;
52179
+ var node = api.getDisplayedRowAtIndex(i);
52180
+ if (!(node !== null && node !== void 0 && node.data)) stubs += 1;else if ((_node$data$__diva_con2 = node.data.__diva_context) !== null && _node$data$__diva_con2 !== void 0 && _node$data$__diva_con2.isEmpty) creatorLoaded = true;
52181
+ }
52182
+ var canCreate = !!((_api$getGridOption = api.getGridOption('context')) !== null && _api$getGridOption !== void 0 && _api$getGridOption.canCreate);
52183
+ return stubs > (canCreate && !creatorLoaded ? 1 : 0);
52184
+ }
52185
+
52186
+ /** Resolves a column id case-insensitively to the grid's own field id and def; throws the teaching error when there is none. */
52187
+ function resolveFilterColumn(api, column) {
52188
+ var _api$getColumns;
52189
+ var direct = api.getColumnDef(column);
52190
+ if (direct) return {
52191
+ column: column,
52192
+ colDef: direct
52193
+ };
52194
+ var fields = ((_api$getColumns = api.getColumns()) !== null && _api$getColumns !== void 0 ? _api$getColumns : []).map(function (c) {
52195
+ return c.getColId();
52196
+ });
52197
+ var matched = fields.find(function (f) {
52198
+ return f.toLowerCase() === column.toLowerCase();
52199
+ });
52200
+ var colDef = matched ? api.getColumnDef(matched) : undefined;
52201
+ if (!matched || !colDef) throw new Error("Column '".concat(column, "' not found. Fields of this table: ").concat(fields.slice(0, 40).join(', ')).concat(fields.length > 40 ? ', …' : '', "."));
52202
+ return {
52203
+ column: matched,
52204
+ colDef: colDef
52205
+ };
52206
+ }
52207
+
52154
52208
  /**
52155
52209
  * Scan the ALREADY-LOADED rows for matches (unloaded server-side blocks are skipped, never fetched).
52156
52210
  * An EXACT hit (case-sensitive text equality / numeric equality) always wins over a merely LOOSE one
@@ -52200,16 +52254,18 @@ function locateRowCore(_x3, _x4, _x5) {
52200
52254
  return _locateRowCore.apply(this, arguments);
52201
52255
  }
52202
52256
 
52203
- /** Audit stamps come LAST so they never crowd payload fields out of the row preview. */
52257
+ /**
52258
+ * Server round trips of a bulk locate go in chunks of this many values, ONE combined equals-OR filter per chunk (the
52259
+ * grid's condition cap, the spreadsheet's FILTER_MAX_CONDITIONS, sits well above it). Half a server-side block of 100
52260
+ * rows: the loaded-row scan sees only the first block, so a key that recurs twice still lands inside it.
52261
+ */
52204
52262
  function _locateRowCore() {
52205
52263
  _locateRowCore = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(api, column, value) {
52206
52264
  var _rowIndex;
52207
52265
  var select,
52208
52266
  deadline,
52267
+ resolved,
52209
52268
  colDef,
52210
- _api$getColumns,
52211
- fields,
52212
- matched,
52213
52269
  isNumber,
52214
52270
  budget,
52215
52271
  loaded,
@@ -52235,31 +52291,13 @@ function _locateRowCore() {
52235
52291
  select = _args21.length > 3 && _args21[3] !== undefined ? _args21[3] : true;
52236
52292
  /** Epoch ms after which no further wait is started — a bulk caller's budget, honoured INSIDE the lookup. */
52237
52293
  deadline = _args21.length > 4 ? _args21[4] : undefined;
52238
- colDef = api.getColumnDef(column);
52239
- if (colDef) {
52240
- _context21.next = 9;
52241
- break;
52242
- }
52243
- fields = ((_api$getColumns = api.getColumns()) !== null && _api$getColumns !== void 0 ? _api$getColumns : []).map(function (c) {
52244
- return c.getColId();
52245
- });
52246
- matched = fields.find(function (f) {
52247
- return f.toLowerCase() === column.toLowerCase();
52248
- });
52249
- if (matched) {
52250
- column = matched;
52251
- colDef = api.getColumnDef(matched);
52252
- }
52253
- if (colDef) {
52254
- _context21.next = 9;
52255
- break;
52256
- }
52257
- throw new Error("Column '".concat(column, "' not found. Fields of this table: ").concat(fields.slice(0, 40).join(', ')).concat(fields.length > 40 ? ', …' : '', "."));
52258
- case 9:
52294
+ resolved = resolveFilterColumn(api, column);
52295
+ column = resolved.column;
52296
+ colDef = resolved.colDef;
52259
52297
  isNumber = matchesNumerically(colDef, String(value)); // A non-numeric value can never match a number column — bail out before the server-side
52260
52298
  // filter would send NaN (the grid API 500s on it and the table is left in an error state).
52261
52299
  if (!(colDef.cellDataType === 'number' && Number.isNaN(Number(value)))) {
52262
- _context21.next = 12;
52300
+ _context21.next = 8;
52263
52301
  break;
52264
52302
  }
52265
52303
  return _context21.abrupt("return", {
@@ -52269,26 +52307,26 @@ function _locateRowCore() {
52269
52307
  exact: false,
52270
52308
  column: column
52271
52309
  });
52272
- case 12:
52310
+ case 8:
52273
52311
  // Every wait is capped by the caller's deadline: a bulk read that checked its budget only between lookups let one
52274
52312
  // lookup spend three full waits on its own.
52275
52313
  budget = function budget(ms) {
52276
52314
  return deadline === undefined ? ms : Math.max(0, Math.min(ms, deadline - Date.now()));
52277
52315
  }; // Right after a navigation the first server-side block may still be loading — without waiting, the scan misses.
52278
52316
  if (isRealRow(api.getDisplayedRowAtIndex(0))) {
52279
- _context21.next = 16;
52317
+ _context21.next = 12;
52280
52318
  break;
52281
52319
  }
52282
- _context21.next = 16;
52320
+ _context21.next = 12;
52283
52321
  return waitForRows(api, budget(8000));
52284
- case 16:
52322
+ case 12:
52285
52323
  loaded = scanLoadedRows(api, column, String(value), isNumber);
52286
52324
  firstNode = loaded.first;
52287
52325
  filterApplied = false;
52288
52326
  exact = loaded.exact;
52289
52327
  loadedMatches = loaded.count;
52290
52328
  if (firstNode) {
52291
- _context21.next = 52;
52329
+ _context21.next = 48;
52292
52330
  break;
52293
52331
  }
52294
52332
  outOfBudget = {
@@ -52300,11 +52338,11 @@ function _locateRowCore() {
52300
52338
  budgetExhausted: true
52301
52339
  }; // No budget left for an answer: do not even send the filter.
52302
52340
  if (!(budget(LOOKUP_WAIT_MS) <= 0)) {
52303
- _context21.next = 25;
52341
+ _context21.next = 21;
52304
52342
  break;
52305
52343
  }
52306
52344
  return _context21.abrupt("return", outOfBudget);
52307
- case 25:
52345
+ case 21:
52308
52346
  previousFilter = api.getFilterModel(); // EXACT first, ALWAYS — including for TEXT columns (previously 'contains' only there). A plain
52309
52347
  // substring/prefix filter let a value that was never actually present stand in silently for one
52310
52348
  // that only LOOKS similar (serieNo '9' ~ '99', partlistKey 'PL_JULIA' ~ 'PL_JULIAN').
@@ -52333,11 +52371,11 @@ function _locateRowCore() {
52333
52371
  // pass is NOT tried after it: a second wait would run the bulk callers past their budget, and a loose hit cannot
52334
52372
  // stand in for an exact query the server never answered.
52335
52373
  exactWait = budget(LOOKUP_WAIT_MS);
52336
- _context21.next = 33;
52374
+ _context21.next = 29;
52337
52375
  return lookupUnanswered(api, exactWait);
52338
- case 33:
52376
+ case 29:
52339
52377
  if (!_context21.sent) {
52340
- _context21.next = 36;
52378
+ _context21.next = 32;
52341
52379
  break;
52342
52380
  }
52343
52381
  restoreFilter();
@@ -52345,14 +52383,14 @@ function _locateRowCore() {
52345
52383
  return _context21.abrupt("return", exactWait < LOOKUP_WAIT_MS ? _objectSpread$X(_objectSpread$X({}, outOfBudget), {}, {
52346
52384
  filterApplied: filterApplied
52347
52385
  }) : unanswered);
52348
- case 36:
52386
+ case 32:
52349
52387
  candidate = (_api$getDisplayedRowA3 = api.getDisplayedRowAtIndex(0)) !== null && _api$getDisplayedRowA3 !== void 0 ? _api$getDisplayedRowA3 : undefined;
52350
52388
  exact = isRealRow(candidate);
52351
52389
  // The loose pass is diagnostic only (the closest candidate for a typo'd key) — an exact miss the server DID answer
52352
52390
  // stands as the verdict when the budget cannot carry a second wait.
52353
52391
  looseWait = budget(LOOKUP_WAIT_MS);
52354
52392
  if (!(!exact && !isNumber && looseWait > 0)) {
52355
- _context21.next = 47;
52393
+ _context21.next = 43;
52356
52394
  break;
52357
52395
  }
52358
52396
  // No exact server-side hit — fall back to the ORIGINAL loose (contains) search so a partial/typo'd
@@ -52363,11 +52401,11 @@ function _locateRowCore() {
52363
52401
  type: 'contains',
52364
52402
  filter: String(value)
52365
52403
  }));
52366
- _context21.next = 43;
52404
+ _context21.next = 39;
52367
52405
  return lookupUnanswered(api, looseWait);
52368
- case 43:
52406
+ case 39:
52369
52407
  if (!_context21.sent) {
52370
- _context21.next = 46;
52408
+ _context21.next = 42;
52371
52409
  break;
52372
52410
  }
52373
52411
  restoreFilter();
@@ -52380,11 +52418,11 @@ function _locateRowCore() {
52380
52418
  } : _objectSpread$X(_objectSpread$X({}, unanswered), {}, {
52381
52419
  exactAnswered: true
52382
52420
  }));
52383
- case 46:
52421
+ case 42:
52384
52422
  candidate = (_api$getDisplayedRowA4 = api.getDisplayedRowAtIndex(0)) !== null && _api$getDisplayedRowA4 !== void 0 ? _api$getDisplayedRowA4 : undefined;
52385
- case 47:
52423
+ case 43:
52386
52424
  if (isRealRow(candidate)) {
52387
- _context21.next = 50;
52425
+ _context21.next = 46;
52388
52426
  break;
52389
52427
  }
52390
52428
  restoreFilter();
@@ -52395,15 +52433,15 @@ function _locateRowCore() {
52395
52433
  exact: false,
52396
52434
  column: column
52397
52435
  });
52398
- case 50:
52436
+ case 46:
52399
52437
  firstNode = candidate;
52400
52438
  loadedMatches = 0; // recomputed by callers from the now-filtered DISPLAYED set (countExactRows or an equivalent scan).
52401
- case 52:
52439
+ case 48:
52402
52440
  api.ensureIndexVisible((_rowIndex = firstNode.rowIndex) !== null && _rowIndex !== void 0 ? _rowIndex : 0, 'middle');
52403
52441
  // Let the scrolled-to row render before highlighting.
52404
- _context21.next = 55;
52442
+ _context21.next = 51;
52405
52443
  return sleep(budget(150));
52406
- case 55:
52444
+ case 51:
52407
52445
  api.flashCells({
52408
52446
  rowNodes: [firstNode]
52409
52447
  });
@@ -52422,7 +52460,7 @@ function _locateRowCore() {
52422
52460
  exact: exact,
52423
52461
  column: column
52424
52462
  });
52425
- case 58:
52463
+ case 54:
52426
52464
  case "end":
52427
52465
  return _context21.stop();
52428
52466
  }
@@ -52430,6 +52468,213 @@ function _locateRowCore() {
52430
52468
  }));
52431
52469
  return _locateRowCore.apply(this, arguments);
52432
52470
  }
52471
+ var BULK_LOOKUP_CHUNK = 50;
52472
+ /** How many conditions the grid KEPT of a column filter model — it drops what exceeds filterParams.maxNumConditions silently. */
52473
+ function conditionCountOf(model) {
52474
+ if (!model || _typeof(model) !== 'object') return 0;
52475
+ var conditions = model.conditions;
52476
+ return Array.isArray(conditions) ? conditions.length : 1;
52477
+ }
52478
+
52479
+ /**
52480
+ * Locates MANY values of one column: loaded rows are scanned first, every value still open then goes to the server in
52481
+ * chunks, each chunk ONE combined equals-OR filter. Previously one filter and one wait went out PER VALUE — twenty
52482
+ * values were twenty refilters of a lazy table, and the call budget cut the tail off. The last lookup filter is left in
52483
+ * place; the caller restores the model it captured before.
52484
+ */
52485
+ function bulkLocateRows(_x6, _x7, _x8, _x9) {
52486
+ return _bulkLocateRows.apply(this, arguments);
52487
+ }
52488
+
52489
+ /** Audit stamps come LAST so they never crowd payload fields out of the row preview. */
52490
+ function _bulkLocateRows() {
52491
+ _bulkLocateRows = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(api, column, values, deadline) {
52492
+ var resolved, colDef, budget, result, numeric, judge, partlyLoaded, pending, _i16, _arr4, value, loaded, groups, chunkSize, _iterator27, _step27, _loop10;
52493
+ return _regeneratorRuntime.wrap(function _callee15$(_context23) {
52494
+ while (1) switch (_context23.prev = _context23.next) {
52495
+ case 0:
52496
+ resolved = resolveFilterColumn(api, column);
52497
+ column = resolved.column;
52498
+ colDef = resolved.colDef;
52499
+ budget = function budget(ms) {
52500
+ return Math.max(0, Math.min(ms, deadline - Date.now()));
52501
+ };
52502
+ result = {
52503
+ hits: [],
52504
+ missing: [],
52505
+ unverified: [],
52506
+ notUnique: [],
52507
+ notReached: [],
52508
+ serverLookups: 0,
52509
+ filterApplied: false
52510
+ }; // Right after a navigation the first server-side block may still be loading — without waiting, the scan misses.
52511
+ if (isRealRow(api.getDisplayedRowAtIndex(0))) {
52512
+ _context23.next = 8;
52513
+ break;
52514
+ }
52515
+ _context23.next = 8;
52516
+ return waitForRows(api, budget(8000));
52517
+ case 8:
52518
+ numeric = function numeric(value) {
52519
+ return matchesNumerically(colDef, value);
52520
+ }; // `unproven`: rows on screen are still unloaded, so one loaded hit does not prove uniqueness and none does not prove
52521
+ // absence — only a visible duplicate is a verdict either way.
52522
+ judge = function judge(value, rows, unproven) {
52523
+ if (rows.length > 1) result.notUnique.push({
52524
+ value: value,
52525
+ matches: countExactRows(api, column, value)
52526
+ });else if (unproven) result.unverified.push(value);else if (rows.length === 1) result.hits.push({
52527
+ value: value,
52528
+ node: rows[0]
52529
+ });else result.missing.push(value);
52530
+ }; // On a lazy table the whole row count is on screen but only the first block is loaded: a loaded hit there says
52531
+ // nothing about a second row further down, so such values go to the server like the unloaded ones.
52532
+ partlyLoaded = hasUnloadedDisplayedRows(api);
52533
+ pending = [];
52534
+ _i16 = 0, _arr4 = _toConsumableArray(new Set(values));
52535
+ case 13:
52536
+ if (!(_i16 < _arr4.length)) {
52537
+ _context23.next = 23;
52538
+ break;
52539
+ }
52540
+ value = _arr4[_i16];
52541
+ if (!(colDef.cellDataType === 'number' && Number.isNaN(Number(value)))) {
52542
+ _context23.next = 18;
52543
+ break;
52544
+ }
52545
+ result.missing.push(value);
52546
+ return _context23.abrupt("continue", 20);
52547
+ case 18:
52548
+ loaded = exactRowsOf(api, column, value, numeric(value));
52549
+ if (loaded.length > 1 || loaded.length === 1 && !partlyLoaded) judge(value, loaded, partlyLoaded);else pending.push(value);
52550
+ case 20:
52551
+ _i16++;
52552
+ _context23.next = 13;
52553
+ break;
52554
+ case 23:
52555
+ // A number and a text condition cannot share one column filter — numeric-looking values go in chunks of their own.
52556
+ groups = [pending.filter(numeric), pending.filter(function (value) {
52557
+ return !numeric(value);
52558
+ })].filter(function (group) {
52559
+ return group.length;
52560
+ });
52561
+ chunkSize = BULK_LOOKUP_CHUNK;
52562
+ _iterator27 = _createForOfIteratorHelper$r(groups);
52563
+ _context23.prev = 26;
52564
+ _loop10 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop10() {
52565
+ var queue, isNumber, _api$getFilterModel3, _result$notReached, chunk, conditions, kept, wait, _ref49, overflow, _iterator28, _step28, _value;
52566
+ return _regeneratorRuntime.wrap(function _loop10$(_context22) {
52567
+ while (1) switch (_context22.prev = _context22.next) {
52568
+ case 0:
52569
+ queue = _step27.value;
52570
+ isNumber = numeric(queue[0]);
52571
+ case 2:
52572
+ if (!queue.length) {
52573
+ _context22.next = 26;
52574
+ break;
52575
+ }
52576
+ if (!(budget(LOOKUP_WAIT_MS) <= 0)) {
52577
+ _context22.next = 6;
52578
+ break;
52579
+ }
52580
+ (_result$notReached = result.notReached).push.apply(_result$notReached, _toConsumableArray(queue.splice(0)));
52581
+ return _context22.abrupt("break", 26);
52582
+ case 6:
52583
+ chunk = queue.splice(0, chunkSize);
52584
+ conditions = chunk.map(function (value) {
52585
+ return isNumber ? {
52586
+ filterType: 'number',
52587
+ type: 'equals',
52588
+ filter: Number(value)
52589
+ } : {
52590
+ filterType: 'text',
52591
+ type: 'equals',
52592
+ filter: value
52593
+ };
52594
+ });
52595
+ api.setFilterModel(_defineProperty({}, column, conditions.length === 1 ? conditions[0] : {
52596
+ filterType: conditions[0].filterType,
52597
+ operator: 'OR',
52598
+ conditions: conditions
52599
+ }));
52600
+ result.filterApplied = true;
52601
+ result.serverLookups += 1;
52602
+ // The grid caps a column's conditions (filterParams.maxNumConditions) and drops the rest without a word: what it
52603
+ // dropped goes back on the queue, and the chunks shrink to what it keeps.
52604
+ kept = conditionCountOf((_api$getFilterModel3 = api.getFilterModel()) === null || _api$getFilterModel3 === void 0 ? void 0 : _api$getFilterModel3[column]);
52605
+ if (!(kept === 0)) {
52606
+ _context22.next = 14;
52607
+ break;
52608
+ }
52609
+ throw new Error("The table did not accept an equals filter on '".concat(column, "' \u2014 locate these values one by one (locateRow with value)."));
52610
+ case 14:
52611
+ if (kept < chunk.length) {
52612
+ queue.unshift.apply(queue, _toConsumableArray(chunk.splice(kept)));
52613
+ chunkSize = kept;
52614
+ }
52615
+ wait = budget(LOOKUP_WAIT_MS);
52616
+ _context22.next = 18;
52617
+ return lookupUnanswered(api, wait);
52618
+ case 18:
52619
+ if (!_context22.sent) {
52620
+ _context22.next = 21;
52621
+ break;
52622
+ }
52623
+ // A wait the deadline cut short says nothing about the server — only the full wait does.
52624
+ (_ref49 = wait < LOOKUP_WAIT_MS ? result.notReached : result.unverified).push.apply(_ref49, _toConsumableArray(chunk));
52625
+ return _context22.abrupt("continue", 2);
52626
+ case 21:
52627
+ overflow = hasUnloadedDisplayedRows(api);
52628
+ _iterator28 = _createForOfIteratorHelper$r(chunk);
52629
+ try {
52630
+ for (_iterator28.s(); !(_step28 = _iterator28.n()).done;) {
52631
+ _value = _step28.value;
52632
+ judge(_value, exactRowsOf(api, column, _value, isNumber), overflow);
52633
+ }
52634
+ } catch (err) {
52635
+ _iterator28.e(err);
52636
+ } finally {
52637
+ _iterator28.f();
52638
+ }
52639
+ _context22.next = 2;
52640
+ break;
52641
+ case 26:
52642
+ case "end":
52643
+ return _context22.stop();
52644
+ }
52645
+ }, _loop10);
52646
+ });
52647
+ _iterator27.s();
52648
+ case 29:
52649
+ if ((_step27 = _iterator27.n()).done) {
52650
+ _context23.next = 33;
52651
+ break;
52652
+ }
52653
+ return _context23.delegateYield(_loop10(), "t0", 31);
52654
+ case 31:
52655
+ _context23.next = 29;
52656
+ break;
52657
+ case 33:
52658
+ _context23.next = 38;
52659
+ break;
52660
+ case 35:
52661
+ _context23.prev = 35;
52662
+ _context23.t1 = _context23["catch"](26);
52663
+ _iterator27.e(_context23.t1);
52664
+ case 38:
52665
+ _context23.prev = 38;
52666
+ _iterator27.f();
52667
+ return _context23.finish(38);
52668
+ case 41:
52669
+ return _context23.abrupt("return", result);
52670
+ case 42:
52671
+ case "end":
52672
+ return _context23.stop();
52673
+ }
52674
+ }, _callee15, null, [[26, 35, 38, 41]]);
52675
+ }));
52676
+ return _bulkLocateRows.apply(this, arguments);
52677
+ }
52433
52678
  var AUDIT_FIELD = /^(created|lastUpdated)/;
52434
52679
 
52435
52680
  /** Row preview for the model: internal fields dropped, audit stamps last, at most 25 columns, nested objects shortened; names what was cut. */
@@ -52800,7 +53045,7 @@ function createNavigationToolset(ctx) {
52800
53045
  }
52801
53046
  }, _callee, null, [[8, 14]]);
52802
53047
  }));
52803
- return function applyParentRowPrelude(_x6, _x7) {
53048
+ return function applyParentRowPrelude(_x10, _x11) {
52804
53049
  return _ref13.apply(this, arguments);
52805
53050
  };
52806
53051
  }();
@@ -52891,7 +53136,7 @@ function createNavigationToolset(ctx) {
52891
53136
  },
52892
53137
  dispatch: function () {
52893
53138
  var _dispatch = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(name, input, signal, onProgress) {
52894
- var awaitingApproval, args, _i2, _Object$entries, _Object$entries$_i, alias, canonical, from, _allViews2, views, editorSubviews, _args$path, _root$navigationState2, _allViews3, _views, _editorSubviews, requested, dynamic, known, catalogIdIn, fromCatalog, toCatalog, only, entries, compactWanted, fullWanted, _args$value, _resolveGrid, entry, api, error, multiValues, filterBeforeBulk, rows, missing, unverified, notUnique, deadline, notReached, anyLookupFilter, _iterator5, _step5, _trimmed$row, value, hit, _cellValueOf2, matches, trimmed, filterBeforeLocate, located, _args$value2, matchedRows, _cellValueOf3, matchedValue, gridsOnScreen, subtableHint, trimmedFirstRow, revealNote, revealed, _args$id, openError, _entry$getHandle$getD, _entry$getHandle2, _lastNode$data, _entry$getHandle$hasP, _entry$getHandle3, _api$getFilterModel, prelude, _resolveGrid2, _entry, _api, _error, waitedForRowsMs, previewCell, divaDefs, leafFields, _requested, columns, unknownColumns, limit, _rows, displayed, unsavedRowCount, i, _api$getDisplayedRowA, context, _i3, node, values, truncatedColumns, _iterator6, _step6, column, raw, columnMeta, lastNode, gridContext, hasCreatorRow, creatorRowLoaded, totalRowCount, dirty, filterModel, filteredBy, _ref25, _ref26, _staged$0$rowId, _staged$, _addedRows$, _outcome$committed, _root$navigationState3, _outcome$failed, _outcome$skipped, KNOWN_KEYS, ALIASES, unknownKeys, hints, edits, EDIT_KEYS, EDIT_ALIASES, editFaults, addRows, addRowsTsv, lines, header, duplicate, faults, removeRowIds, removeRows, editedRows, removedRows, intendedRowCount, _prelude, _resolveGrid3, _entry2, _api2, _error2, handle, explicitParentRow, mountedAfterFirst, isSubtable, parentBinding, boundParentRow, parentBindingNote, idColumnPresent, isUnloadedRecordId, reroutedRecordIds, _iterator7, _step7, _edit2, _i4, _arr2, rowId, serieScope, fmt, _divaDefs, checkCellInput, parserRefusal, parseRefusalOf, newRowEditability, newRowEditRefusal, typedValueOf, computedRefusalOf, writeCell, isLookupColumn, lookupWrite, staged, storedWrite, expectedValueOf, stagingNotes, failed, unchanged, removed, removedRecordIds, filterBeforeStaging, keyFilterApplied, restoreUserFilter, keyCache, resolveByKey, resolveTarget, applyEditToNode, columnDefFor, requiredFields, failures, editabilityUnverified, failedRows, problems, needsServerLookup, lookupKeyOf, lookupKeys, _iterator9, _step9, _edit3, _keyColumn2, _keyValue2, _iterator10, _step10, _removal, _keyColumn3, _keyValue3, _iterator11, _step11, edit, keyColumn, keyValue, _iterator12, _step12, removal, _keyColumn, _keyValue, mergedOutcome, mergeCommitOutcome, preApproved, intendedCount, _approved, _iterator13, _step13, _loop3, _ret3, filterWasChanged, _iterator15, _step15, _removal2, _target2, _target2$error, id, _iterator16, _step16, _edit4$column, _edit4, _column2, _target3, _target3$error, _node2, _rowId2, targets, _iterator17, _step17, _api2$getRowNode2, _rowId, addedRows, providedAddColumns, conditionedPosDefaults, lookupWriteCache, _loop4, _ret4, _i7, addSchemaHint, validationErrors, alreadySent, _iterator18, _step18, _api2$getRowNode12, _rowId3, rowErrors, focusNode, totalStaged, survivingOperations, approved, survived, survivedCount, trimEcho, finalOutcome, outcome, serverErrors, reported, isSessionRowId, sentValuesOf, lengthLimitNote, addError, _iterator19, _step19, failure, _iterator20, _step20, _rowId4, _iterator21, _step21, _api2$getRowNode13, _rowId5, _rowErrors, _i9, _addedRows, _api2$getRowNode5, a, outcomeIsEmpty, survivedAfterCommit, autoCommitted, autoCommittedOps, committedIds, failedIds, editTargets, addTargets, removalTargets, hasIdColumn, verifyDeadline, verifyDeadlineHit, filterBeforeVerify, verifyFilterApplied, probeServerRow, restoreVerifyFilter, verifiedChanges, verifiedAdds, verifiedRemovals, _iterator22, _step22, _loop5, _iterator23, _step23, target, probe, _iterator24, _step24, _target, _probe, appliedCount, livePath, editorPathFor, echoValues, withServerIds, addedRowsWithoutId, landedInSeries, foreignSeries, committedOps, confirmedCount, notCommittedRowIds, isEmptyCell, silentlyDropped, dirtyGrids, _root$navigationState4, _livePath$match, _livePath$match2, _ref43, _ref44, _livePath, packageBase, catalogBase, baseId, isPack, _root$webplannerInsta, destroyed, reloadTriggered, knownKeys, source, _action, _input, _entry3$getActions, _entry3$getActions2, _resolveGrid4, _entry3, _error3, _handle, actionName, actionInput, _addTargets, removeTargets, viewActions, available, approve, declined, autoNote, authorizedFetch, refreshAndSettle, unsettledNote, viewAction, mutating, cloneSettled, _catalogId, _handle$getApplicatio7, _handle$getApplicatio8, catalogId, importSettled, _handle$getApplicatio9, _handle$getApplicatio10, _params2$scope, _pricelistNode, app, serieNo, _params2, scope, key, parent, parentHandle, pricelistNode, patch, label, factors, pricelistRowId, factorOutcome, rejected, _handle$getApplicatio11, _handle$getApplicatio12, _app, pricesSettled, removeTargetIn, _target4, _header, live, saved, gone, attempt, rowsNote, _target5, keys, resolved, _iterator27, _step27, _loop8, _ret6, added, newColumns, _loop9, _i15, _resolved, decisionSubtableNote, partialNote, _column8, _search, _entry4$getActions, _entry4$getActions2, _enumDef$customParams, _data, _plainWords$sort$, _resolveGrid5, _entry4, _api3, _error4, _handle2, _column7, search, _limit, wantsExact, needle, equals, optionAction, _yield$optionAction$o, options, note, enumDef, enumData, _enumDef$customParams2, computedDef, savedRowsOnly, fields, _enumDef$cellDataType, firstRow, rowData, patternChars, plainWords, remoteSearch, matchLocally, fetchLimit, fetched, text, _options, fetchCapped, _defs$find$customPara, _defs$find, _handle2$getApplicati, _handle2$getApplicati2, defs, url, _rowFields, appScope, deps, hint, _resolveGrid6, _api4, _error5, _resolveGrid7, _entry5, _error6, _handle3, _label, _autoNote;
53139
+ var awaitingApproval, args, _i2, _Object$entries, _Object$entries$_i, alias, canonical, from, _allViews2, views, editorSubviews, _args$path, _root$navigationState2, _allViews3, _views, _editorSubviews, requested, dynamic, known, catalogIdIn, fromCatalog, toCatalog, only, entries, compactWanted, fullWanted, _args$value, _resolveGrid, entry, api, error, multiValues, filterBeforeBulk, deadline, bulk, _api$getFilterModel, rows, _bulk, missing, unverified, notUnique, notReached, filterBeforeLocate, located, _args$value2, matchedRows, _cellValueOf2, matchedValue, gridsOnScreen, subtableHint, trimmedFirstRow, revealNote, revealed, _args$id, openError, _entry$getHandle$getD, _entry$getHandle2, _lastNode$data, _entry$getHandle$hasP, _entry$getHandle3, _api$getFilterModel2, prelude, _resolveGrid2, _entry, _api, _error, waitedForRowsMs, previewCell, divaDefs, leafFields, _requested, columns, unknownColumns, limit, _rows, displayed, unsavedRowCount, i, _api$getDisplayedRowA, context, _i3, node, values, truncatedColumns, _iterator5, _step5, column, raw, columnMeta, lastNode, gridContext, hasCreatorRow, creatorRowLoaded, totalRowCount, dirty, filterModel, filteredBy, _ref26, _ref27, _staged$0$rowId, _staged$, _addedRows$, _outcome$committed, _root$navigationState3, _outcome$failed, _outcome$skipped, KNOWN_KEYS, ALIASES, unknownKeys, hints, edits, EDIT_KEYS, EDIT_ALIASES, editFaults, addRows, addRowsTsv, lines, header, duplicate, faults, removeRowIds, removeRows, editedRows, removedRows, intendedRowCount, _prelude, _resolveGrid3, _entry2, _api2, _error2, handle, explicitParentRow, mountedAfterFirst, isSubtable, parentBinding, boundParentRow, parentBindingNote, idColumnPresent, isUnloadedRecordId, reroutedRecordIds, _iterator6, _step6, _edit2, _i4, _arr2, rowId, serieScope, fmt, _divaDefs, checkCellInput, parserRefusal, parseRefusalOf, newRowEditability, newRowEditRefusal, typedValueOf, computedRefusalOf, writeCell, isLookupColumn, lookupWrite, staged, storedWrite, expectedValueOf, stagingNotes, failed, unchanged, removed, removedRecordIds, filterBeforeStaging, keyFilterApplied, restoreUserFilter, keyCache, resolveByKey, resolveTarget, applyEditToNode, columnDefFor, requiredFields, failures, editabilityUnverified, failedRows, problems, needsServerLookup, lookupKeyOf, lookupKeys, _iterator8, _step8, _edit3, _keyColumn2, _keyValue2, _iterator9, _step9, _removal, _keyColumn3, _keyValue3, _iterator10, _step10, edit, keyColumn, keyValue, _iterator11, _step11, removal, _keyColumn, _keyValue, mergedOutcome, mergeCommitOutcome, preApproved, intendedCount, _approved, _iterator12, _step12, _loop3, _ret3, filterWasChanged, _iterator14, _step14, _removal2, _target2, _target2$error, id, _iterator15, _step15, _edit4$column, _edit4, _column2, _target3, _target3$error, _node2, _rowId2, targets, _iterator16, _step16, _api2$getRowNode2, _rowId, addedRows, providedAddColumns, conditionedPosDefaults, lookupWriteCache, _loop4, _ret4, _i7, addSchemaHint, validationErrors, alreadySent, _iterator17, _step17, _api2$getRowNode12, _rowId3, rowErrors, focusNode, totalStaged, survivingOperations, approved, survived, survivedCount, trimEcho, finalOutcome, outcome, serverErrors, reported, isSessionRowId, sentValuesOf, lengthLimitNote, addError, _iterator18, _step18, failure, _iterator19, _step19, _rowId4, _iterator20, _step20, _api2$getRowNode13, _rowId5, _rowErrors, _i9, _addedRows, _api2$getRowNode5, a, outcomeIsEmpty, survivedAfterCommit, autoCommitted, autoCommittedOps, committedIds, failedIds, editTargets, addTargets, removalTargets, hasIdColumn, verifyDeadline, verifyDeadlineHit, filterBeforeVerify, verifyFilterApplied, probeServerRow, restoreVerifyFilter, verifiedChanges, verifiedAdds, verifiedRemovals, _iterator21, _step21, _loop5, _iterator22, _step22, target, probe, _iterator23, _step23, _target, _probe, appliedCount, livePath, editorPathFor, echoValues, withServerIds, addedRowsWithoutId, landedInSeries, foreignSeries, committedOps, confirmedCount, notCommittedRowIds, isEmptyCell, silentlyDropped, dirtyGrids, _root$navigationState4, _livePath$match, _livePath$match2, _ref44, _ref45, _livePath, packageBase, catalogBase, baseId, isPack, _root$webplannerInsta, destroyed, reloadTriggered, knownKeys, source, _action, _input, _entry3$getActions, _entry3$getActions2, _resolveGrid4, _entry3, _error3, _handle, actionName, actionInput, _addTargets, removeTargets, viewActions, available, approve, declined, autoNote, authorizedFetch, refreshAndSettle, unsettledNote, viewAction, mutating, cloneSettled, _catalogId, _handle$getApplicatio7, _handle$getApplicatio8, catalogId, importSettled, _handle$getApplicatio9, _handle$getApplicatio10, _params2$scope, _pricelistNode, app, serieNo, _params2, scope, key, parent, parentHandle, pricelistNode, patch, label, factors, pricelistRowId, factorOutcome, rejected, _handle$getApplicatio11, _handle$getApplicatio12, _app, pricesSettled, removeTargetIn, _target4, _header, live, saved, gone, attempt, rowsNote, _target5, keys, resolved, _iterator26, _step26, _loop8, _ret6, added, newColumns, _loop9, _i15, _resolved, decisionSubtableNote, partialNote, _column8, _search, _entry4$getActions, _entry4$getActions2, _enumDef$customParams, _data, _plainWords$sort$, _resolveGrid5, _entry4, _api3, _error4, _handle2, _column7, search, _limit, wantsExact, needle, equals, optionAction, _yield$optionAction$o, options, note, enumDef, enumData, _enumDef$customParams2, computedDef, savedRowsOnly, fields, _enumDef$cellDataType, firstRow, rowData, patternChars, plainWords, remoteSearch, matchLocally, fetchLimit, fetched, text, _options, fetchCapped, _defs$find$customPara, _defs$find, _handle2$getApplicati, _handle2$getApplicati2, defs, url, _rowFields, appScope, deps, hint, _resolveGrid6, _api4, _error5, _resolveGrid7, _entry5, _error6, _handle3, _label, _autoNote;
52895
53140
  return _regeneratorRuntime.wrap(function _callee11$(_context18) {
52896
53141
  while (1) switch (_context18.prev = _context18.next) {
52897
53142
  case 0:
@@ -52907,7 +53152,7 @@ function createNavigationToolset(ctx) {
52907
53152
  if (!args[canonical] && from) args[canonical] = from;
52908
53153
  }
52909
53154
  _context18.t0 = name;
52910
- _context18.next = _context18.t0 === 'listViews' ? 6 : _context18.t0 === 'navigateTo' ? 8 : _context18.t0 === 'listGrids' ? 24 : _context18.t0 === 'locateRow' ? 31 : _context18.t0 === 'openToolbarTool' ? 121 : _context18.t0 === 'readGridRows' ? 127 : _context18.t0 === 'stageTableEdits' ? 177 : _context18.t0 === 'reloadPage' ? 592 : _context18.t0 === 'reloadPlanner' ? 597 : _context18.t0 === 'runTableAction' ? 611 : _context18.t0 === 'readColumnOptions' ? 862 : _context18.t0 === 'clearGridFilter' ? 931 : _context18.t0 === 'discardStagedChanges' ? 936 : 957;
53155
+ _context18.next = _context18.t0 === 'listViews' ? 6 : _context18.t0 === 'navigateTo' ? 8 : _context18.t0 === 'listGrids' ? 24 : _context18.t0 === 'locateRow' ? 31 : _context18.t0 === 'openToolbarTool' ? 86 : _context18.t0 === 'readGridRows' ? 92 : _context18.t0 === 'stageTableEdits' ? 142 : _context18.t0 === 'reloadPage' ? 557 : _context18.t0 === 'reloadPlanner' ? 562 : _context18.t0 === 'runTableAction' ? 576 : _context18.t0 === 'readColumnOptions' ? 827 : _context18.t0 === 'clearGridFilter' ? 896 : _context18.t0 === 'discardStagedChanges' ? 901 : 922;
52911
53156
  break;
52912
53157
  case 6:
52913
53158
  _allViews2 = allViews(root, ctx), views = _allViews2.views, editorSubviews = _allViews2.editorSubviews;
@@ -53058,110 +53303,51 @@ function createNavigationToolset(ctx) {
53058
53303
  // BULK READ: one call instead of a locateRow chain. Read-only — the pre-bulk filter model is restored before returning.
53059
53304
  multiValues = Array.isArray(input === null || input === void 0 ? void 0 : input.values) ? input.values.map(String) : undefined;
53060
53305
  if (!(multiValues !== null && multiValues !== void 0 && multiValues.length)) {
53061
- _context18.next = 90;
53306
+ _context18.next = 55;
53062
53307
  break;
53063
53308
  }
53064
- filterBeforeBulk = api.getFilterModel();
53065
- rows = [];
53066
- missing = []; // A miss the server never answered is not a miss (measured: an existing row reported 'missing' on a lazy table).
53067
- unverified = []; // A contains-hit on a neighbour value, or several rows carrying the value, is NOT a usable reference row.
53068
- notUnique = []; // Time budget: running past the bridge's call timeout leaves this handler blocking the serialized call queue.
53309
+ filterBeforeBulk = api.getFilterModel(); // Time budget: running past the call timeout leaves this handler blocking the serialized call queue.
53069
53310
  deadline = Date.now() + 14000;
53070
- notReached = [];
53071
- anyLookupFilter = false;
53072
- _iterator5 = _createForOfIteratorHelper$r(multiValues);
53073
- _context18.prev = 45;
53074
- _iterator5.s();
53075
- case 47:
53076
- if ((_step5 = _iterator5.n()).done) {
53077
- _context18.next = 77;
53078
- break;
53079
- }
53080
- value = _step5.value;
53081
- if (!(Date.now() >= deadline)) {
53082
- _context18.next = 52;
53083
- break;
53084
- }
53085
- notReached.push(value);
53086
- return _context18.abrupt("continue", 75);
53087
- case 52:
53088
- hit = void 0;
53089
- _context18.prev = 53;
53090
- _context18.next = 56;
53091
- return locateRowCore(api, args.column, value, false, deadline);
53092
- case 56:
53093
- hit = _context18.sent;
53094
- _context18.next = 62;
53311
+ _context18.prev = 38;
53312
+ _context18.next = 41;
53313
+ return bulkLocateRows(api, args.column, multiValues, deadline);
53314
+ case 41:
53315
+ bulk = _context18.sent;
53316
+ _context18.next = 48;
53095
53317
  break;
53096
- case 59:
53097
- _context18.prev = 59;
53098
- _context18.t1 = _context18["catch"](53);
53318
+ case 44:
53319
+ _context18.prev = 44;
53320
+ _context18.t1 = _context18["catch"](38);
53321
+ // A lookup that failed AFTER its filter went out (a column that takes no equals filter) must not leave the
53322
+ // user's own filter wiped — setFilterModel replaces the whole model, not just this column's part.
53323
+ if (JSON.stringify((_api$getFilterModel = api.getFilterModel()) !== null && _api$getFilterModel !== void 0 ? _api$getFilterModel : {}) !== JSON.stringify(filterBeforeBulk !== null && filterBeforeBulk !== void 0 ? filterBeforeBulk : {})) api.setFilterModel(Object.keys(filterBeforeBulk !== null && filterBeforeBulk !== void 0 ? filterBeforeBulk : {}).length ? filterBeforeBulk : null);
53099
53324
  return _context18.abrupt("return", {
53100
53325
  error: _context18.t1 instanceof Error ? _context18.t1.message : String(_context18.t1)
53101
53326
  });
53102
- case 62:
53103
- anyLookupFilter = anyLookupFilter || hit.filterApplied;
53104
- if (hit.node) {
53105
- _context18.next = 66;
53106
- break;
53107
- }
53108
- // A lookup the deadline cut short got no verdict — it joins the values never started, not the unverified ones.
53109
- // An exact miss the server answered stays a miss, even when the loose pass after it timed out.
53110
- (hit.budgetExhausted ? notReached : hit.lookupTimedOut && !hit.exactAnswered ? unverified : missing).push(value);
53111
- return _context18.abrupt("continue", 75);
53112
- case 66:
53113
- if (hit.exact) {
53114
- _context18.next = 69;
53115
- break;
53116
- }
53117
- notUnique.push({
53118
- value: value,
53119
- matchedValue: String((_cellValueOf2 = cellValueOf(api, hit.node, hit.column)) !== null && _cellValueOf2 !== void 0 ? _cellValueOf2 : '')
53120
- });
53121
- return _context18.abrupt("continue", 75);
53122
- case 69:
53123
- matches = countExactRows(api, hit.column, value);
53124
- if (!(matches > 1)) {
53125
- _context18.next = 73;
53126
- break;
53127
- }
53128
- notUnique.push({
53129
- value: value,
53130
- matches: matches
53131
- });
53132
- return _context18.abrupt("continue", 75);
53133
- case 73:
53134
- trimmed = trimRowData(hit.node.data);
53135
- rows.push(_objectSpread$X({
53136
- value: value,
53137
- firstRow: (_trimmed$row = trimmed === null || trimmed === void 0 ? void 0 : trimmed.row) !== null && _trimmed$row !== void 0 ? _trimmed$row : {}
53138
- }, trimmed !== null && trimmed !== void 0 && trimmed.omitted.length ? {
53139
- fieldsOmitted: trimmed.omitted
53140
- } : {}));
53141
- case 75:
53142
- _context18.next = 47;
53143
- break;
53144
- case 77:
53145
- _context18.next = 82;
53146
- break;
53147
- case 79:
53148
- _context18.prev = 79;
53149
- _context18.t2 = _context18["catch"](45);
53150
- _iterator5.e(_context18.t2);
53151
- case 82:
53152
- _context18.prev = 82;
53153
- _iterator5.f();
53154
- return _context18.finish(82);
53155
- case 85:
53156
- if (!anyLookupFilter) {
53157
- _context18.next = 89;
53327
+ case 48:
53328
+ // Row previews BEFORE the filter goes back — the grid recycles its nodes on a refilter.
53329
+ rows = bulk.hits.map(function (_ref17) {
53330
+ var _trimmed$row;
53331
+ var value = _ref17.value,
53332
+ node = _ref17.node;
53333
+ var trimmed = trimRowData(node.data);
53334
+ return _objectSpread$X({
53335
+ value: value,
53336
+ firstRow: (_trimmed$row = trimmed === null || trimmed === void 0 ? void 0 : trimmed.row) !== null && _trimmed$row !== void 0 ? _trimmed$row : {}
53337
+ }, trimmed !== null && trimmed !== void 0 && trimmed.omitted.length ? {
53338
+ fieldsOmitted: trimmed.omitted
53339
+ } : {});
53340
+ }); // A pure read must not leave lookup filters behind — restore what was active before.
53341
+ if (!bulk.filterApplied) {
53342
+ _context18.next = 53;
53158
53343
  break;
53159
53344
  }
53160
53345
  api.setFilterModel(Object.keys(filterBeforeBulk !== null && filterBeforeBulk !== void 0 ? filterBeforeBulk : {}).length ? filterBeforeBulk : null);
53161
53346
  // The settle wait lives inside the budget too — the model is restored either way.
53162
- _context18.next = 89;
53347
+ _context18.next = 53;
53163
53348
  return waitForRows(api, Math.max(0, deadline - Date.now()));
53164
- case 89:
53349
+ case 53:
53350
+ _bulk = bulk, missing = _bulk.missing, unverified = _bulk.unverified, notUnique = _bulk.notUnique, notReached = _bulk.notReached;
53165
53351
  return _context18.abrupt("return", _objectSpread$X(_objectSpread$X(_objectSpread$X(_objectSpread$X(_objectSpread$X({
53166
53352
  rows: rows
53167
53353
  }, missing.length ? {
@@ -53173,35 +53359,35 @@ function createNavigationToolset(ctx) {
53173
53359
  } : {}), notReached.length ? {
53174
53360
  notReached: notReached
53175
53361
  } : {}), {}, {
53176
- note: "".concat(rows.length, "/").concat(multiValues.length, " located.") + (missing.length ? " Missing values did NOT match — check them for typos before concluding they don't exist." : '') + (unverified.length ? " UNVERIFIED values got NO answer from the server filter within ".concat(LOOKUP_WAIT_MS / 1000, " s \u2014 that is not a miss: look them up one by one (locateRow with value) once the tab is idle, never conclude they do not exist.") : '') + (notUnique.length ? ' notUnique values did NOT resolve to exactly ONE row carrying that exact value (matchedValue = what the contains-search hit instead, matches = how many rows carry it) — never use them as a reference id; locate them individually.' : '') + (notReached.length ? " TIME BUDGET HIT: ".concat(notReached.length, " value(s) were NOT looked up or their lookup was cut short (server-side filters are slow here) \u2014 call again with just those, in smaller batches.") : ' No filter was left behind.')
53362
+ note: "".concat(rows.length, "/").concat(multiValues.length, " located") + (bulk.serverLookups ? " in ".concat(bulk.serverLookups, " server lookup(s) of up to ").concat(BULK_LOOKUP_CHUNK, " values each.") : ' from the loaded rows, no server lookup needed.') + (missing.length ? " Missing values did NOT match — check them for typos before concluding they don't exist." : '') + (unverified.length ? " UNVERIFIED values have NO verdict \u2014 that is not a miss: their server lookup did not answer within ".concat(LOOKUP_WAIT_MS / 1000, " s, or the batch matched more rows than the table loads at once. Look them up again (smaller batches, once the tab is idle), never conclude they do not exist.") : '') + (notUnique.length ? ' notUnique values match SEVERAL rows (matches = how many carry the exact value) — never use them as a reference id; locateRow such a value on its own (its filter then shows every row carrying it) and readGridRows those rows.' : '') + (notReached.length ? " TIME BUDGET HIT: ".concat(notReached.length, " value(s) were NOT looked up \u2014 call again with just those.") : ' No filter was left behind.')
53177
53363
  }));
53178
- case 90:
53364
+ case 55:
53179
53365
  if (!(((_args$value = args.value) !== null && _args$value !== void 0 ? _args$value : '') === '')) {
53180
- _context18.next = 92;
53366
+ _context18.next = 57;
53181
53367
  break;
53182
53368
  }
53183
53369
  return _context18.abrupt("return", {
53184
53370
  error: "Provide 'value' (one row) or 'values' (bulk read)."
53185
53371
  });
53186
- case 92:
53372
+ case 57:
53187
53373
  // Captured before the lookup: a rejected loose hit must hand the user's OWN filter back, not an empty one.
53188
53374
  filterBeforeLocate = api.getFilterModel();
53189
- _context18.prev = 93;
53190
- _context18.next = 96;
53375
+ _context18.prev = 58;
53376
+ _context18.next = 61;
53191
53377
  return locateRowCore(api, args.column, String((_args$value2 = args.value) !== null && _args$value2 !== void 0 ? _args$value2 : ''), args.select !== false);
53192
- case 96:
53378
+ case 61:
53193
53379
  located = _context18.sent;
53194
- _context18.next = 102;
53380
+ _context18.next = 67;
53195
53381
  break;
53196
- case 99:
53197
- _context18.prev = 99;
53198
- _context18.t3 = _context18["catch"](93);
53382
+ case 64:
53383
+ _context18.prev = 64;
53384
+ _context18.t2 = _context18["catch"](58);
53199
53385
  return _context18.abrupt("return", {
53200
- error: _context18.t3 instanceof Error ? _context18.t3.message : String(_context18.t3)
53386
+ error: _context18.t2 instanceof Error ? _context18.t2.message : String(_context18.t2)
53201
53387
  });
53202
- case 102:
53388
+ case 67:
53203
53389
  if (located.node) {
53204
- _context18.next = 104;
53390
+ _context18.next = 69;
53205
53391
  break;
53206
53392
  }
53207
53393
  return _context18.abrupt("return", _objectSpread$X(_objectSpread$X({
@@ -53211,34 +53397,34 @@ function createNavigationToolset(ctx) {
53211
53397
  } : {}), {}, {
53212
53398
  note: located.lookupTimedOut ? "The server filter for ".concat(args.column, " = '").concat(args.value, "' did NOT answer within ").concat(LOOKUP_WAIT_MS / 1000, " s \u2014 this is NOT proof that the row is missing (a busy or stuck grid). Retry once the tab is idle; the lookup filter is already removed.") : "No row matched ".concat(args.column, " ~ '").concat(args.value, "'. The lookup filter is already removed \u2014 do NOT call clearGridFilter, it would drop a filter the user set.")
53213
53399
  }));
53214
- case 104:
53400
+ case 69:
53215
53401
  matchedRows = located.filterApplied ? countDisplayedRealRows(api) : located.loadedMatches; // `exact:true` requires a genuine hit — a loose (contains/prefix) one is reported as NOT FOUND rather
53216
53402
  // than handed back disguised as the requested value (serieNo '9' resolving to '99').
53217
53403
  if (!(args.exact && !located.exact)) {
53218
- _context18.next = 112;
53404
+ _context18.next = 77;
53219
53405
  break;
53220
53406
  }
53221
- matchedValue = String((_cellValueOf3 = cellValueOf(api, located.node, located.column)) !== null && _cellValueOf3 !== void 0 ? _cellValueOf3 : '');
53407
+ matchedValue = String((_cellValueOf2 = cellValueOf(api, located.node, located.column)) !== null && _cellValueOf2 !== void 0 ? _cellValueOf2 : '');
53222
53408
  if (!located.filterApplied) {
53223
- _context18.next = 111;
53409
+ _context18.next = 76;
53224
53410
  break;
53225
53411
  }
53226
53412
  api.setFilterModel(Object.keys(filterBeforeLocate !== null && filterBeforeLocate !== void 0 ? filterBeforeLocate : {}).length ? filterBeforeLocate : null);
53227
- _context18.next = 111;
53413
+ _context18.next = 76;
53228
53414
  return waitForRows(api);
53229
- case 111:
53415
+ case 76:
53230
53416
  return _context18.abrupt("return", {
53231
53417
  matchedRows: 0,
53232
53418
  note: "No EXACT match for ".concat(args.column, " = '").concat(args.value, "' \u2014 the closest candidate was '").concat(matchedValue, "' (").concat(matchedRows, " loose candidate(s) total, none exact). Nothing was selected.")
53233
53419
  });
53234
- case 112:
53420
+ case 77:
53235
53421
  if (!(args.select !== false)) {
53236
- _context18.next = 115;
53422
+ _context18.next = 80;
53237
53423
  break;
53238
53424
  }
53239
- _context18.next = 115;
53425
+ _context18.next = 80;
53240
53426
  return sleep(400);
53241
- case 115:
53427
+ case 80:
53242
53428
  // A subtable already on screen re-renders in place, so only openToolbarTool for one NOT yet listed.
53243
53429
  gridsOnScreen = root.gridRegistry.entries.map(function (e) {
53244
53430
  return e.label;
@@ -53269,57 +53455,57 @@ function createNavigationToolset(ctx) {
53269
53455
  gridsOnScreen: gridsOnScreen,
53270
53456
  note: (located.exact ? '' : "NOT AN EXACT MATCH: ".concat(args.column, " = '").concat(args.value, "' was requested but this row's value is different (see firstRow) \u2014 ") + "it only matched loosely. Do not treat this as proof that '".concat(args.value, "' exists; pass exact:true to require a genuine hit instead of the closest candidate. ")) + (located.filterApplied ? 'VERIFY via firstRow that this is really the requested entity. LEAVE the filter active — it is what shows the user the match; clearGridFilter only when the user is done with this row or before locating something else.' : 'The row was already loaded — scrolled to and highlighted WITHOUT filtering (matchedRows counts the loaded rows; more may exist server-side). No filter to clear.') + subtableHint + revealNote
53271
53457
  }));
53272
- case 121:
53458
+ case 86:
53273
53459
  openError = openToolbarToolById(String((_args$id = args.id) !== null && _args$id !== void 0 ? _args$id : ''));
53274
53460
  if (!openError) {
53275
- _context18.next = 124;
53461
+ _context18.next = 89;
53276
53462
  break;
53277
53463
  }
53278
53464
  throw new Error(openError);
53279
- case 124:
53280
- _context18.next = 126;
53465
+ case 89:
53466
+ _context18.next = 91;
53281
53467
  return sleep(400);
53282
- case 126:
53468
+ case 91:
53283
53469
  return _context18.abrupt("return", {
53284
53470
  ok: true,
53285
53471
  gridsNowOnScreen: root.gridRegistry.entries.map(function (entry) {
53286
53472
  return entry.label;
53287
53473
  })
53288
53474
  });
53289
- case 127:
53290
- _context18.next = 129;
53475
+ case 92:
53476
+ _context18.next = 94;
53291
53477
  return applyParentRowPrelude(input, args);
53292
- case 129:
53478
+ case 94:
53293
53479
  prelude = _context18.sent;
53294
53480
  if (!prelude) {
53295
- _context18.next = 132;
53481
+ _context18.next = 97;
53296
53482
  break;
53297
53483
  }
53298
53484
  return _context18.abrupt("return", prelude);
53299
- case 132:
53485
+ case 97:
53300
53486
  _resolveGrid2 = resolveGrid(args.grid), _entry = _resolveGrid2.entry, _api = _resolveGrid2.api, _error = _resolveGrid2.error;
53301
53487
  if (!(_error || !_api || !_entry)) {
53302
- _context18.next = 135;
53488
+ _context18.next = 100;
53303
53489
  break;
53304
53490
  }
53305
53491
  return _context18.abrupt("return", {
53306
53492
  error: _error
53307
53493
  });
53308
- case 135:
53494
+ case 100:
53309
53495
  if (!isRealRow(_api.getDisplayedRowAtIndex(0))) {
53310
- _context18.next = 139;
53496
+ _context18.next = 104;
53311
53497
  break;
53312
53498
  }
53313
- _context18.t4 = 0;
53314
- _context18.next = 142;
53499
+ _context18.t3 = 0;
53500
+ _context18.next = 107;
53315
53501
  break;
53316
- case 139:
53317
- _context18.next = 141;
53502
+ case 104:
53503
+ _context18.next = 106;
53318
53504
  return waitForRows(_api);
53319
- case 141:
53320
- _context18.t4 = _context18.sent;
53321
- case 142:
53322
- waitedForRowsMs = _context18.t4;
53505
+ case 106:
53506
+ _context18.t3 = _context18.sent;
53507
+ case 107:
53508
+ waitedForRowsMs = _context18.t3;
53323
53509
  previewCell = function previewCell(column, v, truncatedColumns) {
53324
53510
  if (v == null || _typeof(v) !== 'object') return v;
53325
53511
  // Scalar arrays are VALUES (decisionRefs, featureRefs) — a truncated list is unwritable, return them whole.
@@ -53358,31 +53544,31 @@ function createNavigationToolset(ctx) {
53358
53544
  if (context !== null && context !== void 0 && context.isNew && !context.isEmpty) unsavedRowCount += 1;
53359
53545
  }
53360
53546
  _i3 = 0;
53361
- case 155:
53547
+ case 120:
53362
53548
  if (!(_i3 < displayed && _rows.length < limit)) {
53363
- _context18.next = 167;
53549
+ _context18.next = 132;
53364
53550
  break;
53365
53551
  }
53366
53552
  node = _api.getDisplayedRowAtIndex(_i3);
53367
53553
  if (!(!isRealRow(node) || !node.id)) {
53368
- _context18.next = 159;
53554
+ _context18.next = 124;
53369
53555
  break;
53370
53556
  }
53371
- return _context18.abrupt("continue", 164);
53372
- case 159:
53557
+ return _context18.abrupt("continue", 129);
53558
+ case 124:
53373
53559
  values = {};
53374
53560
  truncatedColumns = [];
53375
- _iterator6 = _createForOfIteratorHelper$r(columns);
53561
+ _iterator5 = _createForOfIteratorHelper$r(columns);
53376
53562
  try {
53377
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
53378
- column = _step6.value;
53563
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
53564
+ column = _step5.value;
53379
53565
  raw = cellValueOf(_api, node, column); // The stored SET_POS_COUNT_VALUE:n form reads like a decision action; the number is what gets written back.
53380
53566
  values[column] = isPosCountActionsColumn(divaDefOf(divaDefs, column)) ? posCountOf$1(raw) : previewCell(column, raw, truncatedColumns);
53381
53567
  }
53382
53568
  } catch (err) {
53383
- _iterator6.e(err);
53569
+ _iterator5.e(err);
53384
53570
  } finally {
53385
- _iterator6.f();
53571
+ _iterator5.f();
53386
53572
  }
53387
53573
  _rows.push(_objectSpread$X({
53388
53574
  rowId: node.id,
@@ -53390,11 +53576,11 @@ function createNavigationToolset(ctx) {
53390
53576
  }, truncatedColumns.length ? {
53391
53577
  truncatedColumns: truncatedColumns
53392
53578
  } : {}));
53393
- case 164:
53579
+ case 129:
53394
53580
  _i3++;
53395
- _context18.next = 155;
53581
+ _context18.next = 120;
53396
53582
  break;
53397
- case 167:
53583
+ case 132:
53398
53584
  columnMeta = columns.map(function (field) {
53399
53585
  return _objectSpread$X({
53400
53586
  column: field
@@ -53410,7 +53596,7 @@ function createNavigationToolset(ctx) {
53410
53596
  creatorRowLoaded = !!(lastNode !== null && lastNode !== void 0 && (_lastNode$data = lastNode.data) !== null && _lastNode$data !== void 0 && (_lastNode$data = _lastNode$data.__diva_context) !== null && _lastNode$data !== void 0 && _lastNode$data.isEmpty);
53411
53597
  totalRowCount = displayed && (creatorRowLoaded || hasCreatorRow) ? displayed - 1 : displayed; // totalRowCount counts DISPLAYED rows, so an unreconciled optimistic row inflates it.
53412
53598
  dirty = (_entry$getHandle$hasP = (_entry$getHandle3 = _entry.getHandle()) === null || _entry$getHandle3 === void 0 ? void 0 : _entry$getHandle3.hasPendingChanges()) !== null && _entry$getHandle$hasP !== void 0 ? _entry$getHandle$hasP : false; // An active filter makes totalRowCount the FILTERED count — without naming it, the number reads as the table size.
53413
- filterModel = (_api$getFilterModel = _api.getFilterModel()) !== null && _api$getFilterModel !== void 0 ? _api$getFilterModel : {};
53599
+ filterModel = (_api$getFilterModel2 = _api.getFilterModel()) !== null && _api$getFilterModel2 !== void 0 ? _api$getFilterModel2 : {};
53414
53600
  filteredBy = Object.keys(filterModel);
53415
53601
  return _context18.abrupt("return", _objectSpread$X(_objectSpread$X(_objectSpread$X(_objectSpread$X(_objectSpread$X(_objectSpread$X(_objectSpread$X({
53416
53602
  grid: _entry.label,
@@ -53438,7 +53624,7 @@ function createNavigationToolset(ctx) {
53438
53624
  countNote: dirty ? 'This table has UNCOMMITTED staged rows, so totalRowCount is inflated by them — do not report it as the row count; enumerate, or reload the page first.' : undefined,
53439
53625
  note: _rows.length === 0 ? "The table has 0 loaded rows after polling ".concat(waitedForRowsMs, " ms for its first block \u2014 its prefilter (serie/catalog selection) yields no data here. This is not a loading race any more: treat it as empty; re-read only if you changed the selection/filter or navigated since.") : "Returned ".concat(_rows.length, " of ").concat(totalRowCount, " rows").concat(_rows.length < totalRowCount ? _rows.length === limit ? " \u2014 the `limit` (".concat(limit, ") cut the slice: re-call with a higher limit (max 500) for more. For COUNTS always report totalRowCount, never the returned slice") : ' — the rest is not loaded client-side (server-side lazy table; scrolling or a filter loads more). For COUNTS always report totalRowCount, never the returned slice' : '', ". For stageTableEdits you can address rows directly by keyColumn/keyValue (unique value) \u2014 rowId is the fallback for rows without a unique key.")
53440
53626
  }));
53441
- case 177:
53627
+ case 142:
53442
53628
  // A misspelled top-level key would be dropped in silence and `grid` would default to the wrong table.
53443
53629
  KNOWN_KEYS = ['grid', 'edits', 'addRows', 'removeRowIds', 'removeRows', 'parentRow', 'addRowsTsv', 'source', 'mapping', 'dryRun'];
53444
53630
  ALIASES = {
@@ -53449,18 +53635,18 @@ function createNavigationToolset(ctx) {
53449
53635
  }; // Over the MCP bridge a `source` and its `mapping` are replaced by the payload's rows before the call ever
53450
53636
  // reaches here. Arriving unexpanded means this is the in-app agent, which has no payload store of its own.
53451
53637
  if (!(input !== null && input !== void 0 && input.source || input !== null && input !== void 0 && input.mapping)) {
53452
- _context18.next = 181;
53638
+ _context18.next = 146;
53453
53639
  break;
53454
53640
  }
53455
53641
  return _context18.abrupt("return", {
53456
53642
  error: "A payload `source` (and its `mapping`) only works over the MCP bridge, where the service resolves it into rows. In this chat, pass the rows as addRows or addRowsTsv, with the table's own column ids. Nothing was staged."
53457
53643
  });
53458
- case 181:
53644
+ case 146:
53459
53645
  unknownKeys = Object.keys(input !== null && input !== void 0 ? input : {}).filter(function (key) {
53460
53646
  return !KNOWN_KEYS.includes(key);
53461
53647
  });
53462
53648
  if (!unknownKeys.length) {
53463
- _context18.next = 185;
53649
+ _context18.next = 150;
53464
53650
  break;
53465
53651
  }
53466
53652
  hints = unknownKeys.map(function (key) {
@@ -53469,7 +53655,7 @@ function createNavigationToolset(ctx) {
53469
53655
  return _context18.abrupt("return", {
53470
53656
  error: "Unknown parameter(s) ".concat(hints.join(', '), ". stageTableEdits takes: ").concat(KNOWN_KEYS.join(', '), ". Nothing was staged.")
53471
53657
  });
53472
- case 185:
53658
+ case 150:
53473
53659
  edits = Array.isArray(input === null || input === void 0 ? void 0 : input.edits) ? input.edits : []; // A missing `newValue` would coerce to '' — the documented "clear the cell" — and wipe the cell in silence.
53474
53660
  EDIT_KEYS = ['rowId', 'keyColumn', 'keyValue', 'column', 'newValue'];
53475
53661
  EDIT_ALIASES = {
@@ -53492,13 +53678,13 @@ function createNavigationToolset(ctx) {
53492
53678
  return ["edits[".concat(index, "] ").concat(faults.filter(Boolean).join(' and '))];
53493
53679
  });
53494
53680
  if (!editFaults.length) {
53495
- _context18.next = 191;
53681
+ _context18.next = 156;
53496
53682
  break;
53497
53683
  }
53498
53684
  return _context18.abrupt("return", {
53499
53685
  error: "".concat(editFaults.join('; '), ". Each edit takes: ").concat(EDIT_KEYS.join(', '), " \u2014 newValue is required (an empty string clears the cell). Nothing was staged.")
53500
53686
  });
53501
- case 191:
53687
+ case 156:
53502
53688
  // Entries without the `values` wrapper are unambiguous — treat the entry AS the values.
53503
53689
  addRows = (Array.isArray(input === null || input === void 0 ? void 0 : input.addRows) ? input.addRows : []).map(function (row) {
53504
53690
  return row && _typeof(row) === 'object' && !('values' in row) && Object.keys(row).length ? {
@@ -53510,7 +53696,7 @@ function createNavigationToolset(ctx) {
53510
53696
  // left out of that row, so its default (or 'required' complaint) behaves as if it had never been mentioned.
53511
53697
  addRowsTsv = typeof (input === null || input === void 0 ? void 0 : input.addRowsTsv) === 'string' ? input.addRowsTsv : undefined;
53512
53698
  if (!(addRowsTsv !== undefined)) {
53513
- _context18.next = 206;
53699
+ _context18.next = 171;
53514
53700
  break;
53515
53701
  }
53516
53702
  lines = addRowsTsv.split('\n').map(function (line) {
@@ -53521,13 +53707,13 @@ function createNavigationToolset(ctx) {
53521
53707
  // Exactly one empty tail is the final newline; a second one is a blank row the caller wrote and gets its fault.
53522
53708
  if (lines.length && lines[lines.length - 1] === '') lines.pop();
53523
53709
  if (!(lines.length < 2)) {
53524
- _context18.next = 198;
53710
+ _context18.next = 163;
53525
53711
  break;
53526
53712
  }
53527
53713
  return _context18.abrupt("return", {
53528
53714
  error: "addRowsTsv needs a HEADER line of column field ids and at least one row line, tab-separated (e.g. 'typeNo\\tsequenceNo' then 'ART_001\\t10'). Nothing was staged."
53529
53715
  });
53530
- case 198:
53716
+ case 163:
53531
53717
  header = lines[0].split('\t').map(function (cell) {
53532
53718
  return cell.trim();
53533
53719
  });
@@ -53535,13 +53721,13 @@ function createNavigationToolset(ctx) {
53535
53721
  return cell && header.indexOf(cell) !== index;
53536
53722
  });
53537
53723
  if (!(!header.every(Boolean) || duplicate)) {
53538
- _context18.next = 202;
53724
+ _context18.next = 167;
53539
53725
  break;
53540
53726
  }
53541
53727
  return _context18.abrupt("return", {
53542
53728
  error: duplicate ? "addRowsTsv names the column '".concat(duplicate, "' twice in its header line. Nothing was staged.") : 'addRowsTsv has an empty column name in its header line. Nothing was staged.'
53543
53729
  });
53544
- case 202:
53730
+ case 167:
53545
53731
  faults = [];
53546
53732
  lines.slice(1).forEach(function (line, index) {
53547
53733
  if (!line.trim()) {
@@ -53555,9 +53741,9 @@ function createNavigationToolset(ctx) {
53555
53741
  }
53556
53742
  var values = Object.fromEntries(header.map(function (column, position) {
53557
53743
  return [column, cells[position].trim()];
53558
- }).filter(function (_ref17) {
53559
- var _ref18 = _slicedToArray(_ref17, 2),
53560
- value = _ref18[1];
53744
+ }).filter(function (_ref18) {
53745
+ var _ref19 = _slicedToArray(_ref18, 2),
53746
+ value = _ref19[1];
53561
53747
  return value !== '';
53562
53748
  }));
53563
53749
  if (!Object.keys(values).length) {
@@ -53569,19 +53755,19 @@ function createNavigationToolset(ctx) {
53569
53755
  });
53570
53756
  });
53571
53757
  if (!faults.length) {
53572
- _context18.next = 206;
53758
+ _context18.next = 171;
53573
53759
  break;
53574
53760
  }
53575
53761
  return _context18.abrupt("return", {
53576
53762
  error: "addRowsTsv: ".concat(faults.slice(0, 5).join('; ')).concat(faults.length > 5 ? "; and ".concat(faults.length - 5, " more") : '', ". Every row line needs exactly one cell per header column (an empty cell leaves that column unset). Nothing was staged.")
53577
53763
  });
53578
- case 206:
53764
+ case 171:
53579
53765
  removeRowIds = _toConsumableArray(new Set((Array.isArray(input === null || input === void 0 ? void 0 : input.removeRowIds) ? input.removeRowIds : []).map(String)));
53580
53766
  removeRows = Array.isArray(input === null || input === void 0 ? void 0 : input.removeRows) ? input.removeRows : []; // A dry run must NEVER reach the staging path below. It only knows how to check NEW rows: entered on
53581
53767
  // `dryRun && addRows.length`, a dry run carrying only edits or removals used to fall through and was staged,
53582
53768
  // approved and committed for real. A mixed call would check the rows and write the rest — refused as well.
53583
53769
  if (!(input !== null && input !== void 0 && input.dryRun && (!addRows.length || edits.length || removeRowIds.length || removeRows.length))) {
53584
- _context18.next = 210;
53770
+ _context18.next = 175;
53585
53771
  break;
53586
53772
  }
53587
53773
  return _context18.abrupt("return", {
@@ -53589,7 +53775,7 @@ function createNavigationToolset(ctx) {
53589
53775
  dryRun: true,
53590
53776
  error: 'A dry run checks NEW rows only (addRows, addRowsTsv or a payload `source`)' + (addRows.length ? ', and this call also carries edits or removals, which it would not check. ' : ', and this call carries none. ') + 'Nothing was staged. Re-send without dryRun to apply edits or removals, or send only the rows to check.'
53591
53777
  });
53592
- case 210:
53778
+ case 175:
53593
53779
  // The cap counts ROWS on screen: two edits on one row are one live grid row, so each row counts once however
53594
53780
  // many of its cells change.
53595
53781
  editedRows = new Set(edits.map(function (edit) {
@@ -53603,7 +53789,7 @@ function createNavigationToolset(ctx) {
53603
53789
  intendedRowCount = editedRows.size + addRows.length + removeRowIds.length + removedRows.size; // A dry run stages nothing, so the browser limit does not apply to it — checking a big payload in one go is
53604
53790
  // exactly how an agent finds out it has to split, and what to fix before it does.
53605
53791
  if (!(intendedRowCount > WRITE_ROW_LIMIT && !(input !== null && input !== void 0 && input.dryRun))) {
53606
- _context18.next = 215;
53792
+ _context18.next = 180;
53607
53793
  break;
53608
53794
  }
53609
53795
  return _context18.abrupt("return", {
@@ -53611,47 +53797,47 @@ function createNavigationToolset(ctx) {
53611
53797
  intendedRowCount: intendedRowCount,
53612
53798
  limit: WRITE_ROW_LIMIT
53613
53799
  });
53614
- case 215:
53800
+ case 180:
53615
53801
  if (!(!edits.length && !addRows.length && !removeRowIds.length && !removeRows.length)) {
53616
- _context18.next = 217;
53802
+ _context18.next = 182;
53617
53803
  break;
53618
53804
  }
53619
53805
  throw new Error('Provide edits: [{rowId | keyColumn+keyValue, column, newValue}], addRows: [{values}], removeRowIds and/or removeRows: [{keyColumn, keyValue}] — key addressing locates the row for you (unique value of any column), rowIds come from readGridRows.');
53620
- case 217:
53621
- _context18.next = 219;
53806
+ case 182:
53807
+ _context18.next = 184;
53622
53808
  return applyParentRowPrelude(input, args);
53623
- case 219:
53809
+ case 184:
53624
53810
  _prelude = _context18.sent;
53625
53811
  if (!_prelude) {
53626
- _context18.next = 222;
53812
+ _context18.next = 187;
53627
53813
  break;
53628
53814
  }
53629
53815
  return _context18.abrupt("return", _prelude);
53630
- case 222:
53816
+ case 187:
53631
53817
  _resolveGrid3 = resolveGrid(args.grid), _entry2 = _resolveGrid3.entry, _api2 = _resolveGrid3.api, _error2 = _resolveGrid3.error;
53632
53818
  if (!(_error2 || !_api2 || !_entry2)) {
53633
- _context18.next = 225;
53819
+ _context18.next = 190;
53634
53820
  break;
53635
53821
  }
53636
53822
  return _context18.abrupt("return", {
53637
53823
  error: _error2
53638
53824
  });
53639
- case 225:
53825
+ case 190:
53640
53826
  handle = _entry2.getHandle();
53641
53827
  if (handle) {
53642
- _context18.next = 228;
53828
+ _context18.next = 193;
53643
53829
  break;
53644
53830
  }
53645
53831
  return _context18.abrupt("return", {
53646
53832
  error: "Table '".concat(_entry2.label, "' is not ready.")
53647
53833
  });
53648
- case 228:
53834
+ case 193:
53649
53835
  if (!handle.hasPendingChanges()) {
53650
- _context18.next = 230;
53836
+ _context18.next = 195;
53651
53837
  break;
53652
53838
  }
53653
53839
  throw new Error('This table already has uncommitted (staged) changes — wait for the pending decision or ask the user to save/discard their manual edits first.');
53654
- case 230:
53840
+ case 195:
53655
53841
  // Without parentRow the write lands under the parent the subtable is bound to — the one an earlier call left
53656
53842
  // selected. Only the subtable's own declaration names it; without one the write is refused, never guessed.
53657
53843
  explicitParentRow = !!(input !== null && input !== void 0 && input.parentRow); // Mount order is the fallback for a subtable whose module declares no parent (media refs, the assortment item
@@ -53662,13 +53848,13 @@ function createNavigationToolset(ctx) {
53662
53848
  isSubtable = explicitParentRow || !!_entry2.getBoundParent || mountedAfterFirst;
53663
53849
  parentBinding = explicitParentRow ? undefined : declaredParentBinding(_entry2);
53664
53850
  if (!(parentBinding !== null && parentBinding !== void 0 && parentBinding.refusal)) {
53665
- _context18.next = 236;
53851
+ _context18.next = 201;
53666
53852
  break;
53667
53853
  }
53668
53854
  return _context18.abrupt("return", {
53669
53855
  error: parentBinding.refusal
53670
53856
  });
53671
- case 236:
53857
+ case 201:
53672
53858
  boundParentRow = parentBinding === null || parentBinding === void 0 ? void 0 : parentBinding.parent;
53673
53859
  parentBindingNote = boundParentRow ? " SUBTABLE WRITE WITHOUT parentRow: bound to the parent row this subtable is showing \u2014 '".concat(boundParentRow.grid, "' ").concat(boundParentRow.column, " = '").concat(boundParentRow.value, "' (boundParentRow). Verify that is the intended parent; pass parentRow to bind explicitly.") : mountedAfterFirst && !explicitParentRow && !_entry2.getBoundParent ? ' SUBTABLE WRITE WITHOUT parentRow: this table declares no parent binding, so the parent row it landed under cannot be named here — verify it in the table before building on the write.' : ''; // A record _id offered as rowId — partlistpos hands the _id out AS the rowId, and locateRow.firstRow._id is the
53674
53860
  // same value — is a valid address once its node is loaded. When it is not (the subtable re-rendered, a filter
@@ -53679,10 +53865,10 @@ function createNavigationToolset(ctx) {
53679
53865
  return idColumnPresent && typeof rowId === 'string' && isRecordId(rowId) && !isRealRow(_api2.getRowNode(rowId));
53680
53866
  };
53681
53867
  reroutedRecordIds = 0;
53682
- _iterator7 = _createForOfIteratorHelper$r(edits);
53868
+ _iterator6 = _createForOfIteratorHelper$r(edits);
53683
53869
  try {
53684
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
53685
- _edit2 = _step7.value;
53870
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
53871
+ _edit2 = _step6.value;
53686
53872
  if ((_edit2 === null || _edit2 === void 0 ? void 0 : _edit2.rowId) != null && isUnloadedRecordId(String(_edit2.rowId))) {
53687
53873
  _edit2.keyColumn = '_id';
53688
53874
  _edit2.keyValue = String(_edit2.rowId);
@@ -53691,45 +53877,45 @@ function createNavigationToolset(ctx) {
53691
53877
  }
53692
53878
  }
53693
53879
  } catch (err) {
53694
- _iterator7.e(err);
53880
+ _iterator6.e(err);
53695
53881
  } finally {
53696
- _iterator7.f();
53882
+ _iterator6.f();
53697
53883
  }
53698
53884
  _i4 = 0, _arr2 = _toConsumableArray(removeRowIds);
53699
- case 244:
53885
+ case 209:
53700
53886
  if (!(_i4 < _arr2.length)) {
53701
- _context18.next = 254;
53887
+ _context18.next = 219;
53702
53888
  break;
53703
53889
  }
53704
53890
  rowId = _arr2[_i4];
53705
53891
  if (isUnloadedRecordId(rowId)) {
53706
- _context18.next = 248;
53892
+ _context18.next = 213;
53707
53893
  break;
53708
53894
  }
53709
- return _context18.abrupt("continue", 251);
53710
- case 248:
53895
+ return _context18.abrupt("continue", 216);
53896
+ case 213:
53711
53897
  removeRowIds.splice(removeRowIds.indexOf(rowId), 1);
53712
53898
  removeRows.push({
53713
53899
  keyColumn: '_id',
53714
53900
  keyValue: rowId
53715
53901
  });
53716
53902
  reroutedRecordIds += 1;
53717
- case 251:
53903
+ case 216:
53718
53904
  _i4++;
53719
- _context18.next = 244;
53905
+ _context18.next = 209;
53720
53906
  break;
53721
- case 254:
53907
+ case 219:
53722
53908
  // Hard stop for CREATES when the serie scope is unresolved — the row would be filed wherever the endpoint defaults to.
53723
53909
  serieScope = serieScopeOf(_entry2, handle);
53724
53910
  if (!(addRows.length && serieScope && !serieScope.serieId)) {
53725
- _context18.next = 257;
53911
+ _context18.next = 222;
53726
53912
  break;
53727
53913
  }
53728
53914
  return _context18.abrupt("return", {
53729
53915
  error: "'".concat(_entry2.label, "' belongs to ONE serie (its endpoint is /series/<id>/\u2026) and NO serie is selected, so a new row would be filed wherever the view defaults to \u2014 usually the FIRST serie (serie 0, the components serie). Nothing was staged."),
53730
53916
  fix: 'selectSerie(<serieNo>) first — listSeries shows the numbers and the current selection — then re-send this call unchanged.'
53731
53917
  });
53732
- case 257:
53918
+ case 222:
53733
53919
  fmt = function fmt(v) {
53734
53920
  return v == null ? undefined : _typeof(v) === 'object' ? JSON.stringify(v).slice(0, 80) : v;
53735
53921
  }; // The AG col def loses the DIVA custom props (editable/required/customParams) — check the DIVA def too.
@@ -53813,20 +53999,20 @@ function createNavigationToolset(ctx) {
53813
53999
  };
53814
54000
  var multi = !!(divaDef !== null && divaDef !== void 0 && (_divaDef$customParams7 = divaDef.customParams) !== null && _divaDef$customParams7 !== void 0 && _divaDef$customParams7.multiple);
53815
54001
  var resolve = function resolve(token) {
53816
- var _ref19, _enumData$find;
53817
- return (_ref19 = (_enumData$find = enumData.find(function (e) {
54002
+ var _ref20, _enumData$find;
54003
+ return (_ref20 = (_enumData$find = enumData.find(function (e) {
53818
54004
  return String(e === null || e === void 0 ? void 0 : e.value) === token;
53819
54005
  })) !== null && _enumData$find !== void 0 ? _enumData$find : enumData.find(function (e) {
53820
54006
  return String(e === null || e === void 0 ? void 0 : e.value).toLowerCase() === token.toLowerCase();
53821
- })) !== null && _ref19 !== void 0 ? _ref19 : enumData.find(function (e) {
54007
+ })) !== null && _ref20 !== void 0 ? _ref20 : enumData.find(function (e) {
53822
54008
  return String(e === null || e === void 0 ? void 0 : e.name).toLowerCase() === token.toLowerCase();
53823
54009
  });
53824
54010
  };
53825
54011
  var tokens = multi ? raw.split(/[,;]/).map(function (s) {
53826
54012
  return s.trim();
53827
54013
  }).filter(Boolean) : [raw.trim()];
53828
- var _matches = tokens.map(resolve);
53829
- if (!tokens.length || _matches.some(function (m) {
54014
+ var matches = tokens.map(resolve);
54015
+ if (!tokens.length || matches.some(function (m) {
53830
54016
  return !m;
53831
54017
  })) {
53832
54018
  var _enumData$;
@@ -53840,7 +54026,7 @@ function createNavigationToolset(ctx) {
53840
54026
  // The enum parser matches names and values exactly — hand it the canonical values the tokens resolved to.
53841
54027
  return {
53842
54028
  ok: true,
53843
- text: _matches.map(function (m) {
54029
+ text: matches.map(function (m) {
53844
54030
  return String(m.value);
53845
54031
  }).join(',')
53846
54032
  };
@@ -54049,7 +54235,7 @@ function createNavigationToolset(ctx) {
54049
54235
  };
54050
54236
  /** The table's own write path; a refusal comes back as the message the agent reports. */
54051
54237
  writeCell = /*#__PURE__*/function () {
54052
- var _ref20 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(rowId, column, text) {
54238
+ var _ref21 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(rowId, column, text) {
54053
54239
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
54054
54240
  while (1) switch (_context2.prev = _context2.next) {
54055
54241
  case 0:
@@ -54079,8 +54265,8 @@ function createNavigationToolset(ctx) {
54079
54265
  }
54080
54266
  }, _callee2, null, [[0, 7]]);
54081
54267
  }));
54082
- return function writeCell(_x12, _x13, _x14) {
54083
- return _ref20.apply(this, arguments);
54268
+ return function writeCell(_x16, _x17, _x18) {
54269
+ return _ref21.apply(this, arguments);
54084
54270
  };
54085
54271
  }();
54086
54272
  isLookupColumn = function isLookupColumn(column) {
@@ -54088,7 +54274,7 @@ function createNavigationToolset(ctx) {
54088
54274
  return ((_divaDefOf2 = divaDefOf(_divaDefs, column)) === null || _divaDefOf2 === void 0 ? void 0 : _divaDefOf2.cellDataType) === 'lookup';
54089
54275
  };
54090
54276
  lookupWrite = /*#__PURE__*/function () {
54091
- var _ref21 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(column, raw, rowData) {
54277
+ var _ref22 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(column, raw, rowData) {
54092
54278
  var _divaDefs$find2;
54093
54279
  var multiple, normalizedRaw, parsed, keys, _yield$handle$resolve, data, resolved, _missing, candidates, valueForLabel, corrected, _yield$handle$resolve2, separatorHint, candidateList, candidateHint;
54094
54280
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
@@ -54198,8 +54384,8 @@ function createNavigationToolset(ctx) {
54198
54384
  }
54199
54385
  }, _callee3, null, [[6, 35]]);
54200
54386
  }));
54201
- return function lookupWrite(_x15, _x16, _x17) {
54202
- return _ref21.apply(this, arguments);
54387
+ return function lookupWrite(_x19, _x20, _x21) {
54388
+ return _ref22.apply(this, arguments);
54203
54389
  };
54204
54390
  }();
54205
54391
  staged = [];
@@ -54225,7 +54411,7 @@ function createNavigationToolset(ctx) {
54225
54411
  }; // Key addressing: loose (contains) or multiple matches are rejected — edits must never hit the wrong row.
54226
54412
  keyCache = new Map();
54227
54413
  resolveByKey = /*#__PURE__*/function () {
54228
- var _ref22 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(keyColumn, keyValue) {
54414
+ var _ref23 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(keyColumn, keyValue) {
54229
54415
  var label, cacheKey, cached, located, matches, exact;
54230
54416
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
54231
54417
  while (1) switch (_context4.prev = _context4.next) {
@@ -54315,12 +54501,12 @@ function createNavigationToolset(ctx) {
54315
54501
  }
54316
54502
  }, _callee4, null, [[5, 11]]);
54317
54503
  }));
54318
- return function resolveByKey(_x18, _x19) {
54319
- return _ref22.apply(this, arguments);
54504
+ return function resolveByKey(_x22, _x23) {
54505
+ return _ref23.apply(this, arguments);
54320
54506
  };
54321
54507
  }();
54322
54508
  resolveTarget = /*#__PURE__*/function () {
54323
- var _ref23 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(address) {
54509
+ var _ref24 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(address) {
54324
54510
  var rowId, _node, keyColumn, keyValue;
54325
54511
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
54326
54512
  while (1) switch (_context5.prev = _context5.next) {
@@ -54372,13 +54558,13 @@ function createNavigationToolset(ctx) {
54372
54558
  }
54373
54559
  }, _callee5);
54374
54560
  }));
54375
- return function resolveTarget(_x20) {
54376
- return _ref23.apply(this, arguments);
54561
+ return function resolveTarget(_x24) {
54562
+ return _ref24.apply(this, arguments);
54377
54563
  };
54378
54564
  }();
54379
54565
  /** Apply one column edit to an already-resolved row — shared by the direct loop and the sequential lookup path below. */
54380
54566
  applyEditToNode = /*#__PURE__*/function () {
54381
- var _ref24 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(node, rowId, column, rawNewValue) {
54567
+ var _ref25 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(node, rowId, column, rawNewValue) {
54382
54568
  var _node$data2, _api2$getRowNode;
54383
54569
  var from, _node$data, _res$data$column, res, _ok, check, ok;
54384
54570
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
@@ -54477,8 +54663,8 @@ function createNavigationToolset(ctx) {
54477
54663
  }
54478
54664
  }, _callee6);
54479
54665
  }));
54480
- return function applyEditToNode(_x21, _x22, _x23, _x24) {
54481
- return _ref24.apply(this, arguments);
54666
+ return function applyEditToNode(_x25, _x26, _x27, _x28) {
54667
+ return _ref25.apply(this, arguments);
54482
54668
  };
54483
54669
  }(); // --- Multiple EXISTING rows addressed by keyColumn/keyValue, none of them already loaded on screen
54484
54670
  // (the prices grid, and generally any table bigger than its initial window): each such lookup goes
@@ -54507,7 +54693,7 @@ function createNavigationToolset(ctx) {
54507
54693
  // for rows that came from a payload: the agent never read them, so this is its only way to check them — and
54508
54694
  // the answer stays small, counts plus the failing rows, however many rows there are.
54509
54695
  if (!(input !== null && input !== void 0 && input.dryRun && addRows.length)) {
54510
- _context18.next = 294;
54696
+ _context18.next = 259;
54511
54697
  break;
54512
54698
  }
54513
54699
  requiredFields = _divaDefs.filter(function (definition) {
@@ -54544,17 +54730,17 @@ function createNavigationToolset(ctx) {
54544
54730
  return definition.field === column;
54545
54731
  })) === null || _divaDefs$find3 === void 0 ? void 0 : _divaDefs$find3.customParams) !== null && _customParams !== void 0 ? _customParams : {};
54546
54732
  if (_params.nameField) provided.add(_params.nameField);
54547
- var _iterator8 = _createForOfIteratorHelper$r((_params$additionalMap = _params.additionalMappings) !== null && _params$additionalMap !== void 0 ? _params$additionalMap : []),
54548
- _step8;
54733
+ var _iterator7 = _createForOfIteratorHelper$r((_params$additionalMap = _params.additionalMappings) !== null && _params$additionalMap !== void 0 ? _params$additionalMap : []),
54734
+ _step7;
54549
54735
  try {
54550
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
54551
- var mapping = _step8.value;
54736
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
54737
+ var mapping = _step7.value;
54552
54738
  if (mapping.targetField) provided.add(mapping.targetField);
54553
54739
  }
54554
54740
  } catch (err) {
54555
- _iterator8.e(err);
54741
+ _iterator7.e(err);
54556
54742
  } finally {
54557
- _iterator8.f();
54743
+ _iterator7.f();
54558
54744
  }
54559
54745
  return 0; // continue
54560
54746
  }
@@ -54648,7 +54834,7 @@ function createNavigationToolset(ctx) {
54648
54834
  return "'".concat(column, "'");
54649
54835
  }).join(', '), " (editabilityUnverified) \u2014 its rule needs grid context a dry run does not have, so the real call may still refuse it. ") : '. ') + "Row numbers count the addRows list (a payload's rows follow the rows listed in the call), then the addRowsTsv lines. " + 'Re-send without dryRun to stage and commit.' + (addRows.length > WRITE_ROW_LIMIT ? " NOTE: ".concat(addRows.length, " rows exceed the ").concat(WRITE_ROW_LIMIT, "-row limit of ONE write \u2014 split them across calls.") : '')
54650
54836
  }));
54651
- case 294:
54837
+ case 259:
54652
54838
  /** Mirrors locateRowCore's own loaded-rows check (read-only) — never mutates the filter itself. */
54653
54839
  needsServerLookup = function needsServerLookup(keyColumn, keyValue) {
54654
54840
  var colDef = columnDefFor(keyColumn);
@@ -54660,10 +54846,10 @@ function createNavigationToolset(ctx) {
54660
54846
  return "".concat(keyColumn, "\0").concat(keyValue);
54661
54847
  };
54662
54848
  lookupKeys = new Map();
54663
- _iterator9 = _createForOfIteratorHelper$r(edits);
54849
+ _iterator8 = _createForOfIteratorHelper$r(edits);
54664
54850
  try {
54665
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
54666
- _edit3 = _step9.value;
54851
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
54852
+ _edit3 = _step8.value;
54667
54853
  if ((_edit3 === null || _edit3 === void 0 ? void 0 : _edit3.rowId) == null && (_edit3 === null || _edit3 === void 0 ? void 0 : _edit3.keyColumn) != null && (_edit3 === null || _edit3 === void 0 ? void 0 : _edit3.keyValue) != null) {
54668
54854
  _keyColumn2 = String(_edit3.keyColumn);
54669
54855
  _keyValue2 = String(_edit3.keyValue);
@@ -54674,14 +54860,14 @@ function createNavigationToolset(ctx) {
54674
54860
  }
54675
54861
  }
54676
54862
  } catch (err) {
54677
- _iterator9.e(err);
54863
+ _iterator8.e(err);
54678
54864
  } finally {
54679
- _iterator9.f();
54865
+ _iterator8.f();
54680
54866
  }
54681
- _iterator10 = _createForOfIteratorHelper$r(removeRows);
54867
+ _iterator9 = _createForOfIteratorHelper$r(removeRows);
54682
54868
  try {
54683
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
54684
- _removal = _step10.value;
54869
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
54870
+ _removal = _step9.value;
54685
54871
  if ((_removal === null || _removal === void 0 ? void 0 : _removal.keyColumn) != null && (_removal === null || _removal === void 0 ? void 0 : _removal.keyValue) != null) {
54686
54872
  _keyColumn3 = String(_removal.keyColumn);
54687
54873
  _keyValue3 = String(_removal.keyValue);
@@ -54695,15 +54881,15 @@ function createNavigationToolset(ctx) {
54695
54881
  // rows that were loaded at that point. So once any key needs the server, every key-addressed row goes
54696
54882
  // through the per-row path: a row that is still loaded resolves there without touching the filter.
54697
54883
  } catch (err) {
54698
- _iterator10.e(err);
54884
+ _iterator9.e(err);
54699
54885
  } finally {
54700
- _iterator10.f();
54886
+ _iterator9.f();
54701
54887
  }
54702
54888
  if (lookupKeys.size > 0) {
54703
- _iterator11 = _createForOfIteratorHelper$r(edits);
54889
+ _iterator10 = _createForOfIteratorHelper$r(edits);
54704
54890
  try {
54705
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
54706
- edit = _step11.value;
54891
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
54892
+ edit = _step10.value;
54707
54893
  if ((edit === null || edit === void 0 ? void 0 : edit.rowId) == null && (edit === null || edit === void 0 ? void 0 : edit.keyColumn) != null && (edit === null || edit === void 0 ? void 0 : edit.keyValue) != null) {
54708
54894
  keyColumn = String(edit.keyColumn);
54709
54895
  keyValue = String(edit.keyValue);
@@ -54714,14 +54900,14 @@ function createNavigationToolset(ctx) {
54714
54900
  }
54715
54901
  }
54716
54902
  } catch (err) {
54717
- _iterator11.e(err);
54903
+ _iterator10.e(err);
54718
54904
  } finally {
54719
- _iterator11.f();
54905
+ _iterator10.f();
54720
54906
  }
54721
- _iterator12 = _createForOfIteratorHelper$r(removeRows);
54907
+ _iterator11 = _createForOfIteratorHelper$r(removeRows);
54722
54908
  try {
54723
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
54724
- removal = _step12.value;
54909
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
54910
+ removal = _step11.value;
54725
54911
  if ((removal === null || removal === void 0 ? void 0 : removal.keyColumn) != null && (removal === null || removal === void 0 ? void 0 : removal.keyValue) != null) {
54726
54912
  _keyColumn = String(removal.keyColumn);
54727
54913
  _keyValue = String(removal.keyValue);
@@ -54732,9 +54918,9 @@ function createNavigationToolset(ctx) {
54732
54918
  }
54733
54919
  }
54734
54920
  } catch (err) {
54735
- _iterator12.e(err);
54921
+ _iterator11.e(err);
54736
54922
  } finally {
54737
- _iterator12.f();
54923
+ _iterator11.f();
54738
54924
  }
54739
54925
  }
54740
54926
  mergedOutcome = {
@@ -54752,24 +54938,24 @@ function createNavigationToolset(ctx) {
54752
54938
  };
54753
54939
  preApproved = false;
54754
54940
  if (!(lookupKeys.size > 0)) {
54755
- _context18.next = 342;
54941
+ _context18.next = 307;
54756
54942
  break;
54757
54943
  }
54758
54944
  intendedCount = edits.length + addRows.length + removeRowIds.length + removeRows.length;
54759
54945
  if (!ctx.autoApprove) awaitingApproval();
54760
- _context18.t5 = ctx.autoApprove;
54761
- if (_context18.t5) {
54762
- _context18.next = 313;
54946
+ _context18.t4 = ctx.autoApprove;
54947
+ if (_context18.t4) {
54948
+ _context18.next = 278;
54763
54949
  break;
54764
54950
  }
54765
- _context18.next = 312;
54951
+ _context18.next = 277;
54766
54952
  return _entry2.requestAgentApproval(intendedCount, "".concat(intendedCount, " change(s) \u2014 ").concat(lookupKeys.size, " row(s) must be located first"), signal);
54767
- case 312:
54768
- _context18.t5 = _context18.sent;
54769
- case 313:
54770
- _approved = _context18.t5;
54953
+ case 277:
54954
+ _context18.t4 = _context18.sent;
54955
+ case 278:
54956
+ _approved = _context18.t4;
54771
54957
  if (_approved) {
54772
- _context18.next = 317;
54958
+ _context18.next = 282;
54773
54959
  break;
54774
54960
  }
54775
54961
  restoreUserFilter();
@@ -54778,16 +54964,16 @@ function createNavigationToolset(ctx) {
54778
54964
  stagedCount: 0,
54779
54965
  note: 'The user DECLINED the change — nothing was staged or saved. Do not retry; ask what to do instead.'
54780
54966
  });
54781
- case 317:
54967
+ case 282:
54782
54968
  preApproved = true;
54783
- _iterator13 = _createForOfIteratorHelper$r(lookupKeys.values());
54784
- _context18.prev = 319;
54969
+ _iterator12 = _createForOfIteratorHelper$r(lookupKeys.values());
54970
+ _context18.prev = 284;
54785
54971
  _loop3 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop3() {
54786
- var _step13$value, keyColumn, keyValue, target, _target$error, node, rowId, rowEdits, rowRemovals, _node$data3, _iterator14, _step14, _edit$column, _edit;
54972
+ var _step12$value, keyColumn, keyValue, target, _target$error, node, rowId, rowEdits, rowRemovals, _node$data3, _iterator13, _step13, _edit$column, _edit;
54787
54973
  return _regeneratorRuntime.wrap(function _loop3$(_context7) {
54788
54974
  while (1) switch (_context7.prev = _context7.next) {
54789
54975
  case 0:
54790
- _step13$value = _step13.value, keyColumn = _step13$value.keyColumn, keyValue = _step13$value.keyValue;
54976
+ _step12$value = _step12.value, keyColumn = _step12$value.keyColumn, keyValue = _step12$value.keyValue;
54791
54977
  _context7.next = 3;
54792
54978
  return resolveByKey(keyColumn, keyValue);
54793
54979
  case 3:
@@ -54837,15 +55023,15 @@ function createNavigationToolset(ctx) {
54837
55023
  _context7.next = 38;
54838
55024
  break;
54839
55025
  case 21:
54840
- _iterator14 = _createForOfIteratorHelper$r(rowEdits);
55026
+ _iterator13 = _createForOfIteratorHelper$r(rowEdits);
54841
55027
  _context7.prev = 22;
54842
- _iterator14.s();
55028
+ _iterator13.s();
54843
55029
  case 24:
54844
- if ((_step14 = _iterator14.n()).done) {
55030
+ if ((_step13 = _iterator13.n()).done) {
54845
55031
  _context7.next = 30;
54846
55032
  break;
54847
55033
  }
54848
- _edit = _step14.value;
55034
+ _edit = _step13.value;
54849
55035
  _context7.next = 28;
54850
55036
  return applyEditToNode(node, rowId, String((_edit$column = _edit === null || _edit === void 0 ? void 0 : _edit.column) !== null && _edit$column !== void 0 ? _edit$column : ''), _edit === null || _edit === void 0 ? void 0 : _edit.newValue);
54851
55037
  case 28:
@@ -54857,10 +55043,10 @@ function createNavigationToolset(ctx) {
54857
55043
  case 32:
54858
55044
  _context7.prev = 32;
54859
55045
  _context7.t0 = _context7["catch"](22);
54860
- _iterator14.e(_context7.t0);
55046
+ _iterator13.e(_context7.t0);
54861
55047
  case 35:
54862
55048
  _context7.prev = 35;
54863
- _iterator14.f();
55049
+ _iterator13.f();
54864
55050
  return _context7.finish(35);
54865
55051
  case 38:
54866
55052
  _context7.t1 = mergeCommitOutcome;
@@ -54875,117 +55061,117 @@ function createNavigationToolset(ctx) {
54875
55061
  }
54876
55062
  }, _loop3, null, [[22, 32, 35, 38]]);
54877
55063
  });
54878
- _iterator13.s();
54879
- case 322:
54880
- if ((_step13 = _iterator13.n()).done) {
54881
- _context18.next = 329;
55064
+ _iterator12.s();
55065
+ case 287:
55066
+ if ((_step12 = _iterator12.n()).done) {
55067
+ _context18.next = 294;
54882
55068
  break;
54883
55069
  }
54884
- return _context18.delegateYield(_loop3(), "t6", 324);
54885
- case 324:
54886
- _ret3 = _context18.t6;
55070
+ return _context18.delegateYield(_loop3(), "t5", 289);
55071
+ case 289:
55072
+ _ret3 = _context18.t5;
54887
55073
  if (!(_ret3 === 0)) {
54888
- _context18.next = 327;
55074
+ _context18.next = 292;
54889
55075
  break;
54890
55076
  }
54891
- return _context18.abrupt("continue", 327);
54892
- case 327:
54893
- _context18.next = 322;
55077
+ return _context18.abrupt("continue", 292);
55078
+ case 292:
55079
+ _context18.next = 287;
54894
55080
  break;
54895
- case 329:
54896
- _context18.next = 334;
55081
+ case 294:
55082
+ _context18.next = 299;
54897
55083
  break;
54898
- case 331:
54899
- _context18.prev = 331;
54900
- _context18.t7 = _context18["catch"](319);
54901
- _iterator13.e(_context18.t7);
54902
- case 334:
54903
- _context18.prev = 334;
54904
- _iterator13.f();
54905
- return _context18.finish(334);
54906
- case 337:
55084
+ case 296:
55085
+ _context18.prev = 296;
55086
+ _context18.t6 = _context18["catch"](284);
55087
+ _iterator12.e(_context18.t6);
55088
+ case 299:
55089
+ _context18.prev = 299;
55090
+ _iterator12.f();
55091
+ return _context18.finish(299);
55092
+ case 302:
54907
55093
  // Bring the loaded window back to what the caller had before more edits (possibly rowId-addressed,
54908
55094
  // always assumed already-loaded) rely on it — restoreUserFilter only mutates when a lookup above
54909
55095
  // actually changed something, and the grid needs a moment to settle after a filter change.
54910
55096
  filterWasChanged = keyFilterApplied;
54911
55097
  restoreUserFilter();
54912
55098
  if (!filterWasChanged) {
54913
- _context18.next = 342;
55099
+ _context18.next = 307;
54914
55100
  break;
54915
55101
  }
54916
- _context18.next = 342;
55102
+ _context18.next = 307;
54917
55103
  return waitForRows(_api2);
54918
- case 342:
55104
+ case 307:
54919
55105
  // Key-addressed removals resolve to rowIds before the edit loop (conflicts are checked against the final id list).
54920
55106
  // Rows already resolved+staged+committed by the sequential lookup pass above are skipped here.
54921
- _iterator15 = _createForOfIteratorHelper$r(removeRows);
54922
- _context18.prev = 343;
54923
- _iterator15.s();
54924
- case 345:
54925
- if ((_step15 = _iterator15.n()).done) {
54926
- _context18.next = 359;
55107
+ _iterator14 = _createForOfIteratorHelper$r(removeRows);
55108
+ _context18.prev = 308;
55109
+ _iterator14.s();
55110
+ case 310:
55111
+ if ((_step14 = _iterator14.n()).done) {
55112
+ _context18.next = 324;
54927
55113
  break;
54928
55114
  }
54929
- _removal2 = _step15.value;
55115
+ _removal2 = _step14.value;
54930
55116
  if (!((_removal2 === null || _removal2 === void 0 ? void 0 : _removal2.keyColumn) != null && (_removal2 === null || _removal2 === void 0 ? void 0 : _removal2.keyValue) != null && lookupKeys.has(lookupKeyOf(String(_removal2.keyColumn), String(_removal2.keyValue))))) {
54931
- _context18.next = 349;
55117
+ _context18.next = 314;
54932
55118
  break;
54933
55119
  }
54934
- return _context18.abrupt("continue", 357);
54935
- case 349:
54936
- _context18.next = 351;
55120
+ return _context18.abrupt("continue", 322);
55121
+ case 314:
55122
+ _context18.next = 316;
54937
55123
  return resolveTarget(_removal2);
54938
- case 351:
55124
+ case 316:
54939
55125
  _target2 = _context18.sent;
54940
55126
  if (!(_target2.error || !_target2.node)) {
54941
- _context18.next = 355;
55127
+ _context18.next = 320;
54942
55128
  break;
54943
55129
  }
54944
55130
  failed.push({
54945
55131
  rowId: _target2.label,
54946
55132
  error: (_target2$error = _target2.error) !== null && _target2$error !== void 0 ? _target2$error : 'Row not found.'
54947
55133
  });
54948
- return _context18.abrupt("continue", 357);
54949
- case 355:
55134
+ return _context18.abrupt("continue", 322);
55135
+ case 320:
54950
55136
  id = String(_target2.node.id);
54951
55137
  if (!removeRowIds.includes(id)) removeRowIds.push(id);
54952
- case 357:
54953
- _context18.next = 345;
55138
+ case 322:
55139
+ _context18.next = 310;
54954
55140
  break;
54955
- case 359:
54956
- _context18.next = 364;
55141
+ case 324:
55142
+ _context18.next = 329;
54957
55143
  break;
54958
- case 361:
54959
- _context18.prev = 361;
54960
- _context18.t8 = _context18["catch"](343);
54961
- _iterator15.e(_context18.t8);
54962
- case 364:
54963
- _context18.prev = 364;
54964
- _iterator15.f();
54965
- return _context18.finish(364);
54966
- case 367:
54967
- _iterator16 = _createForOfIteratorHelper$r(edits);
54968
- _context18.prev = 368;
54969
- _iterator16.s();
54970
- case 370:
54971
- if ((_step16 = _iterator16.n()).done) {
54972
- _context18.next = 390;
55144
+ case 326:
55145
+ _context18.prev = 326;
55146
+ _context18.t7 = _context18["catch"](308);
55147
+ _iterator14.e(_context18.t7);
55148
+ case 329:
55149
+ _context18.prev = 329;
55150
+ _iterator14.f();
55151
+ return _context18.finish(329);
55152
+ case 332:
55153
+ _iterator15 = _createForOfIteratorHelper$r(edits);
55154
+ _context18.prev = 333;
55155
+ _iterator15.s();
55156
+ case 335:
55157
+ if ((_step15 = _iterator15.n()).done) {
55158
+ _context18.next = 355;
54973
55159
  break;
54974
55160
  }
54975
- _edit4 = _step16.value;
55161
+ _edit4 = _step15.value;
54976
55162
  if (!((_edit4 === null || _edit4 === void 0 ? void 0 : _edit4.rowId) == null && (_edit4 === null || _edit4 === void 0 ? void 0 : _edit4.keyColumn) != null && (_edit4 === null || _edit4 === void 0 ? void 0 : _edit4.keyValue) != null && lookupKeys.has(lookupKeyOf(String(_edit4.keyColumn), String(_edit4.keyValue))))) {
54977
- _context18.next = 374;
55163
+ _context18.next = 339;
54978
55164
  break;
54979
55165
  }
54980
- return _context18.abrupt("continue", 388);
54981
- case 374:
55166
+ return _context18.abrupt("continue", 353);
55167
+ case 339:
54982
55168
  _column2 = String((_edit4$column = _edit4 === null || _edit4 === void 0 ? void 0 : _edit4.column) !== null && _edit4$column !== void 0 ? _edit4$column : '');
54983
- _context18.next = 377;
55169
+ _context18.next = 342;
54984
55170
  return resolveTarget(_edit4);
54985
- case 377:
55171
+ case 342:
54986
55172
  _target3 = _context18.sent;
54987
55173
  if (!(_target3.error || !_target3.node)) {
54988
- _context18.next = 381;
55174
+ _context18.next = 346;
54989
55175
  break;
54990
55176
  }
54991
55177
  failed.push({
@@ -54993,12 +55179,12 @@ function createNavigationToolset(ctx) {
54993
55179
  column: _column2,
54994
55180
  error: (_target3$error = _target3.error) !== null && _target3$error !== void 0 ? _target3$error : 'Row not found.'
54995
55181
  });
54996
- return _context18.abrupt("continue", 388);
54997
- case 381:
55182
+ return _context18.abrupt("continue", 353);
55183
+ case 346:
54998
55184
  _node2 = _target3.node;
54999
55185
  _rowId2 = String(_node2.id);
55000
55186
  if (!removeRowIds.includes(_rowId2)) {
55001
- _context18.next = 386;
55187
+ _context18.next = 351;
55002
55188
  break;
55003
55189
  }
55004
55190
  failed.push({
@@ -55006,25 +55192,25 @@ function createNavigationToolset(ctx) {
55006
55192
  column: _column2,
55007
55193
  error: 'This row is also being removed — edit OR remove a row, not both.'
55008
55194
  });
55009
- return _context18.abrupt("continue", 388);
55010
- case 386:
55011
- _context18.next = 388;
55195
+ return _context18.abrupt("continue", 353);
55196
+ case 351:
55197
+ _context18.next = 353;
55012
55198
  return applyEditToNode(_node2, _rowId2, _column2, _edit4 === null || _edit4 === void 0 ? void 0 : _edit4.newValue);
55013
- case 388:
55014
- _context18.next = 370;
55199
+ case 353:
55200
+ _context18.next = 335;
55015
55201
  break;
55016
- case 390:
55017
- _context18.next = 395;
55202
+ case 355:
55203
+ _context18.next = 360;
55018
55204
  break;
55019
- case 392:
55020
- _context18.prev = 392;
55021
- _context18.t9 = _context18["catch"](368);
55022
- _iterator16.e(_context18.t9);
55023
- case 395:
55024
- _context18.prev = 395;
55025
- _iterator16.f();
55026
- return _context18.finish(395);
55027
- case 398:
55205
+ case 357:
55206
+ _context18.prev = 357;
55207
+ _context18.t8 = _context18["catch"](333);
55208
+ _iterator15.e(_context18.t8);
55209
+ case 360:
55210
+ _context18.prev = 360;
55211
+ _iterator15.f();
55212
+ return _context18.finish(360);
55213
+ case 363:
55028
55214
  targets = removeRowIds.filter(function (rowId) {
55029
55215
  if (isRealRow(_api2.getRowNode(rowId))) return true;
55030
55216
  failed.push({
@@ -55033,26 +55219,26 @@ function createNavigationToolset(ctx) {
55033
55219
  });
55034
55220
  return false;
55035
55221
  });
55036
- _iterator17 = _createForOfIteratorHelper$r(targets);
55222
+ _iterator16 = _createForOfIteratorHelper$r(targets);
55037
55223
  try {
55038
- for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
55039
- _rowId = _step17.value;
55224
+ for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
55225
+ _rowId = _step16.value;
55040
55226
  removedRecordIds.set(_rowId, (_api2$getRowNode2 = _api2.getRowNode(_rowId)) === null || _api2$getRowNode2 === void 0 || (_api2$getRowNode2 = _api2$getRowNode2.data) === null || _api2$getRowNode2 === void 0 ? void 0 : _api2$getRowNode2._id);
55041
55227
  }
55042
55228
  } catch (err) {
55043
- _iterator17.e(err);
55229
+ _iterator16.e(err);
55044
55230
  } finally {
55045
- _iterator17.f();
55231
+ _iterator16.f();
55046
55232
  }
55047
55233
  if (!targets.length) {
55048
- _context18.next = 405;
55234
+ _context18.next = 370;
55049
55235
  break;
55050
55236
  }
55051
- _context18.next = 404;
55237
+ _context18.next = 369;
55052
55238
  return handle.stageRemoveRows(targets);
55053
- case 404:
55239
+ case 369:
55054
55240
  removed.push.apply(removed, _toConsumableArray(targets));
55055
- case 405:
55241
+ case 370:
55056
55242
  addedRows = [];
55057
55243
  /** Columns the AGENT provided per added row — lookup writes drag companion fields into `values`. */
55058
55244
  providedAddColumns = new Map();
@@ -55060,7 +55246,7 @@ function createNavigationToolset(ctx) {
55060
55246
  lookupWriteCache = new Map();
55061
55247
  _loop4 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop4() {
55062
55248
  var _addRows$_i7$values, _addRows$_i, _handle$getApplicatio5, _handle$getApplicatio6;
55063
- var rawValues, plainCols, lookupCols, bad, _i10, _Object$entries4, _Object$entries4$_i, _column3, rawValue, check, provided, _loop6, _i11, _lookupCols, hasField, requiredMissing, seed, newId, values, _i12, _plainCols, _plainCols$_i, _column4, text, ok, appData, rowFields, rowDepsOf, lookupColumns, _loop7, _ret5, _api2$getRowNode$data, _api2$getRowNode9, finished, _iterator26, _step26, _divaDefOf3, _step26$value, _column5, _text, isPosCountRow, _ok2, _api2$getRowNode$data2, _api2$getRowNode10, _finished, _i13, _arr3, _divaDefOf4, _column6, editableFn, locked;
55249
+ var rawValues, plainCols, lookupCols, bad, _i10, _Object$entries4, _Object$entries4$_i, _column3, rawValue, check, provided, _loop6, _i11, _lookupCols, hasField, requiredMissing, seed, newId, values, _i12, _plainCols, _plainCols$_i, _column4, text, ok, appData, rowFields, rowDepsOf, lookupColumns, _loop7, _ret5, _api2$getRowNode$data, _api2$getRowNode9, finished, _iterator25, _step25, _divaDefOf3, _step25$value, _column5, _text, isPosCountRow, _ok2, _api2$getRowNode$data2, _api2$getRowNode10, _finished, _i13, _arr3, _divaDefOf4, _column6, editableFn, locked;
55064
55250
  return _regeneratorRuntime.wrap(function _loop4$(_context12) {
55065
55251
  while (1) switch (_context12.prev = _context12.next) {
55066
55252
  case 0:
@@ -55124,14 +55310,14 @@ function createNavigationToolset(ctx) {
55124
55310
  case 24:
55125
55311
  // Fail fast with the COMPLETE list of missing required columns; defaulted ones are filled by the add itself.
55126
55312
  // A lookup also fills its companion fields (name field, mapped fields), so those count as provided.
55127
- provided = new Set(plainCols.map(function (_ref35) {
55128
- var _ref36 = _slicedToArray(_ref35, 1),
55129
- column = _ref36[0];
55313
+ provided = new Set(plainCols.map(function (_ref36) {
55314
+ var _ref37 = _slicedToArray(_ref36, 1),
55315
+ column = _ref37[0];
55130
55316
  return column;
55131
55317
  }));
55132
55318
  _loop6 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop6() {
55133
55319
  var _divaDefs$find$custom, _divaDefs$find4, _params$additionalMap2;
55134
- var _lookupCols$_i, column, params, _iterator25, _step25, mapping;
55320
+ var _lookupCols$_i, column, params, _iterator24, _step24, mapping;
55135
55321
  return _regeneratorRuntime.wrap(function _loop6$(_context10) {
55136
55322
  while (1) switch (_context10.prev = _context10.next) {
55137
55323
  case 0:
@@ -55141,16 +55327,16 @@ function createNavigationToolset(ctx) {
55141
55327
  return d.field === column;
55142
55328
  })) === null || _divaDefs$find4 === void 0 ? void 0 : _divaDefs$find4.customParams) !== null && _divaDefs$find$custom !== void 0 ? _divaDefs$find$custom : {};
55143
55329
  if (params.nameField) provided.add(params.nameField);
55144
- _iterator25 = _createForOfIteratorHelper$r((_params$additionalMap2 = params.additionalMappings) !== null && _params$additionalMap2 !== void 0 ? _params$additionalMap2 : []);
55330
+ _iterator24 = _createForOfIteratorHelper$r((_params$additionalMap2 = params.additionalMappings) !== null && _params$additionalMap2 !== void 0 ? _params$additionalMap2 : []);
55145
55331
  try {
55146
- for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {
55147
- mapping = _step25.value;
55332
+ for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
55333
+ mapping = _step24.value;
55148
55334
  if (mapping.targetField) provided.add(mapping.targetField);
55149
55335
  }
55150
55336
  } catch (err) {
55151
- _iterator25.e(err);
55337
+ _iterator24.e(err);
55152
55338
  } finally {
55153
- _iterator25.f();
55339
+ _iterator24.f();
55154
55340
  }
55155
55341
  case 6:
55156
55342
  case "end":
@@ -55263,21 +55449,21 @@ function createNavigationToolset(ctx) {
55263
55449
  return rowFields.has(p) && appData[p] === undefined;
55264
55450
  });
55265
55451
  }; // The loop below consumes `lookupCols`, and the finished row is judged on every column the call wrote.
55266
- lookupColumns = lookupCols.map(function (_ref37) {
55267
- var _ref38 = _slicedToArray(_ref37, 1),
55268
- column = _ref38[0];
55452
+ lookupColumns = lookupCols.map(function (_ref38) {
55453
+ var _ref39 = _slicedToArray(_ref38, 1),
55454
+ column = _ref39[0];
55269
55455
  return column;
55270
55456
  });
55271
55457
  _loop7 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop7() {
55272
55458
  var _api2$getRowNode$data3, _api2$getRowNode11, _lookupWriteCache$get;
55273
- var readyIdx, _lookupCols$splice$, column, rawValue, missingDeps, providers, lookupRowData, lookupCacheKey, res, write, _i14, _Object$entries5, _res$data, _Object$entries5$_i, key, _value2;
55459
+ var readyIdx, _lookupCols$splice$, column, rawValue, missingDeps, providers, lookupRowData, lookupCacheKey, res, write, _i14, _Object$entries5, _res$data, _Object$entries5$_i, key, value;
55274
55460
  return _regeneratorRuntime.wrap(function _loop7$(_context11) {
55275
55461
  while (1) switch (_context11.prev = _context11.next) {
55276
55462
  case 0:
55277
55463
  // Prefer a lookup whose row dependencies are already satisfied — its write may provide what the deferred one needs.
55278
- readyIdx = lookupCols.findIndex(function (_ref41) {
55279
- var _ref42 = _slicedToArray(_ref41, 1),
55280
- column = _ref42[0];
55464
+ readyIdx = lookupCols.findIndex(function (_ref42) {
55465
+ var _ref43 = _slicedToArray(_ref42, 1),
55466
+ column = _ref43[0];
55281
55467
  return rowDepsOf(column).every(function (dep) {
55282
55468
  return values[dep] !== undefined || rawValues[dep] !== undefined;
55283
55469
  });
@@ -55343,8 +55529,8 @@ function createNavigationToolset(ctx) {
55343
55529
  // On a NEW row an undefined write-shape entry means "leave empty" — skip it so it does not clobber a provided key.
55344
55530
  write = {};
55345
55531
  for (_i14 = 0, _Object$entries5 = Object.entries((_res$data = res.data) !== null && _res$data !== void 0 ? _res$data : {}); _i14 < _Object$entries5.length; _i14++) {
55346
- _Object$entries5$_i = _slicedToArray(_Object$entries5[_i14], 2), key = _Object$entries5$_i[0], _value2 = _Object$entries5$_i[1];
55347
- if (_value2 !== undefined) write[key] = _value2;
55532
+ _Object$entries5$_i = _slicedToArray(_Object$entries5[_i14], 2), key = _Object$entries5$_i[0], value = _Object$entries5$_i[1];
55533
+ if (value !== undefined) write[key] = value;
55348
55534
  }
55349
55535
  _context11.t1 = Object.keys(write).length;
55350
55536
  if (!_context11.t1) {
@@ -55401,15 +55587,15 @@ function createNavigationToolset(ctx) {
55401
55587
  finished = (_api2$getRowNode$data = (_api2$getRowNode9 = _api2.getRowNode(newId)) === null || _api2$getRowNode9 === void 0 ? void 0 : _api2$getRowNode9.data) !== null && _api2$getRowNode$data !== void 0 ? _api2$getRowNode$data : values; // A row-dependent PARSER needs the finished row just as much: the count column stores
55402
55588
  // SET_POS_COUNT_VALUE:n only once the row's decision is known, and that decision is a lookup written
55403
55589
  // after it. Writing the same text again now lets the column parse it into the shape it really has.
55404
- _iterator26 = _createForOfIteratorHelper$r(plainCols);
55590
+ _iterator25 = _createForOfIteratorHelper$r(plainCols);
55405
55591
  _context12.prev = 75;
55406
- _iterator26.s();
55592
+ _iterator25.s();
55407
55593
  case 77:
55408
- if ((_step26 = _iterator26.n()).done) {
55594
+ if ((_step25 = _iterator25.n()).done) {
55409
55595
  _context12.next = 92;
55410
55596
  break;
55411
55597
  }
55412
- _step26$value = _slicedToArray(_step26.value, 2), _column5 = _step26$value[0], _text = _step26$value[1];
55598
+ _step25$value = _slicedToArray(_step25.value, 2), _column5 = _step25$value[0], _text = _step25$value[1];
55413
55599
  isPosCountRow = (_divaDefOf3 = divaDefOf(_divaDefs, _column5)) === null || _divaDefOf3 === void 0 || (_divaDefOf3 = _divaDefOf3.customParams) === null || _divaDefOf3 === void 0 ? void 0 : _divaDefOf3.isPosCount;
55414
55600
  if (!(typeof isPosCountRow !== 'function' || !isPosCountRow(finished))) {
55415
55601
  _context12.next = 82;
@@ -55443,10 +55629,10 @@ function createNavigationToolset(ctx) {
55443
55629
  case 94:
55444
55630
  _context12.prev = 94;
55445
55631
  _context12.t2 = _context12["catch"](75);
55446
- _iterator26.e(_context12.t2);
55632
+ _iterator25.e(_context12.t2);
55447
55633
  case 97:
55448
55634
  _context12.prev = 97;
55449
- _iterator26.f();
55635
+ _iterator25.f();
55450
55636
  return _context12.finish(97);
55451
55637
  case 100:
55452
55638
  if (bad) {
@@ -55455,9 +55641,9 @@ function createNavigationToolset(ctx) {
55455
55641
  }
55456
55642
  _finished = (_api2$getRowNode$data2 = (_api2$getRowNode10 = _api2.getRowNode(newId)) === null || _api2$getRowNode10 === void 0 ? void 0 : _api2$getRowNode10.data) !== null && _api2$getRowNode$data2 !== void 0 ? _api2$getRowNode$data2 : values; // Lookup columns too: `lookupWrite` never evaluates the rule, so a lookup a creatable table locks on the
55457
55643
  // finished row (a parent key chosen by another column) would otherwise reach the server unchecked.
55458
- _i13 = 0, _arr3 = [].concat(_toConsumableArray(plainCols.map(function (_ref39) {
55459
- var _ref40 = _slicedToArray(_ref39, 1),
55460
- field = _ref40[0];
55644
+ _i13 = 0, _arr3 = [].concat(_toConsumableArray(plainCols.map(function (_ref40) {
55645
+ var _ref41 = _slicedToArray(_ref40, 1),
55646
+ field = _ref41[0];
55461
55647
  return field;
55462
55648
  })), _toConsumableArray(lookupColumns));
55463
55649
  case 103:
@@ -55520,24 +55706,24 @@ function createNavigationToolset(ctx) {
55520
55706
  }, _loop4, null, [[75, 94, 97, 100]]);
55521
55707
  });
55522
55708
  _i7 = 0;
55523
- case 411:
55709
+ case 376:
55524
55710
  if (!(_i7 < addRows.length)) {
55525
- _context18.next = 419;
55711
+ _context18.next = 384;
55526
55712
  break;
55527
55713
  }
55528
- return _context18.delegateYield(_loop4(), "t10", 413);
55529
- case 413:
55530
- _ret4 = _context18.t10;
55714
+ return _context18.delegateYield(_loop4(), "t9", 378);
55715
+ case 378:
55716
+ _ret4 = _context18.t9;
55531
55717
  if (!(_ret4 === 0)) {
55532
- _context18.next = 416;
55718
+ _context18.next = 381;
55533
55719
  break;
55534
55720
  }
55535
- return _context18.abrupt("continue", 416);
55536
- case 416:
55721
+ return _context18.abrupt("continue", 381);
55722
+ case 381:
55537
55723
  _i7++;
55538
- _context18.next = 411;
55724
+ _context18.next = 376;
55539
55725
  break;
55540
- case 419:
55726
+ case 384:
55541
55727
  // Any add failed → return the table's FULL add schema so the next attempt has everything.
55542
55728
  addSchemaHint = function addSchemaHint() {
55543
55729
  if (!addRows.length) return '';
@@ -55554,7 +55740,7 @@ function createNavigationToolset(ctx) {
55554
55740
  return " ADD SCHEMA of '".concat(_entry2.label, "' \u2014 required: ").concat(req.join(', ') || 'none').concat(defaulted.length ? "; defaulted (OMIT): ".concat(defaulted.join(', ')) : '', ". Enum/lookup columns take only their listed values (listGrids/readColumnOptions).");
55555
55741
  };
55556
55742
  if (!(!staged.length && !addedRows.length && !removed.length)) {
55557
- _context18.next = 423;
55743
+ _context18.next = 388;
55558
55744
  break;
55559
55745
  }
55560
55746
  restoreUserFilter();
@@ -55565,32 +55751,32 @@ function createNavigationToolset(ctx) {
55565
55751
  failed: failed.length ? summarizeFailures(failed) : undefined,
55566
55752
  note: unchanged.length ? 'NOTHING was staged: every proposed value equals the current cell value (the change may already have been applied earlier). Tell the user the data already matches — do NOT claim you changed anything.' : "Nothing could be staged \u2014 nothing to approve. Fix the failures (fresh readGridRows) and try again.".concat(failed.length ? addSchemaHint() : '')
55567
55753
  });
55568
- case 423:
55754
+ case 388:
55569
55755
  // The table would silently skip invalid staged rows on save — surface that as a failure instead of a fake success.
55570
55756
  validationErrors = []; // Rows the sequential lookup pass already sent carry the SERVER's verdict (a rejection leaves the same
55571
55757
  // error markers) — that is reported as a server error below, not as a validation failure of the rest.
55572
55758
  alreadySent = new Set([].concat(_toConsumableArray(mergedOutcome.committed), _toConsumableArray(mergedOutcome.failed.map(function (failure) {
55573
55759
  return failure.rowId;
55574
55760
  })), _toConsumableArray(mergedOutcome.skipped)));
55575
- _iterator18 = _createForOfIteratorHelper$r(new Set([].concat(_toConsumableArray(staged.map(function (s) {
55761
+ _iterator17 = _createForOfIteratorHelper$r(new Set([].concat(_toConsumableArray(staged.map(function (s) {
55576
55762
  return s.rowId;
55577
55763
  })), _toConsumableArray(addedRows.map(function (a) {
55578
55764
  return a.rowId;
55579
55765
  })))));
55580
- _context18.prev = 426;
55581
- _iterator18.s();
55582
- case 428:
55583
- if ((_step18 = _iterator18.n()).done) {
55584
- _context18.next = 436;
55766
+ _context18.prev = 391;
55767
+ _iterator17.s();
55768
+ case 393:
55769
+ if ((_step17 = _iterator17.n()).done) {
55770
+ _context18.next = 401;
55585
55771
  break;
55586
55772
  }
55587
- _rowId3 = _step18.value;
55773
+ _rowId3 = _step17.value;
55588
55774
  if (!alreadySent.has(_rowId3)) {
55589
- _context18.next = 432;
55775
+ _context18.next = 397;
55590
55776
  break;
55591
55777
  }
55592
- return _context18.abrupt("continue", 434);
55593
- case 432:
55778
+ return _context18.abrupt("continue", 399);
55779
+ case 397:
55594
55780
  rowErrors = (_api2$getRowNode12 = _api2.getRowNode(_rowId3)) === null || _api2$getRowNode12 === void 0 || (_api2$getRowNode12 = _api2$getRowNode12.data) === null || _api2$getRowNode12 === void 0 || (_api2$getRowNode12 = _api2$getRowNode12.__diva_context) === null || _api2$getRowNode12 === void 0 ? void 0 : _api2$getRowNode12.errors;
55595
55781
  if (Array.isArray(rowErrors) && rowErrors.length) {
55596
55782
  validationErrors.push({
@@ -55600,28 +55786,28 @@ function createNavigationToolset(ctx) {
55600
55786
  })
55601
55787
  });
55602
55788
  }
55603
- case 434:
55604
- _context18.next = 428;
55789
+ case 399:
55790
+ _context18.next = 393;
55605
55791
  break;
55606
- case 436:
55607
- _context18.next = 441;
55792
+ case 401:
55793
+ _context18.next = 406;
55608
55794
  break;
55609
- case 438:
55610
- _context18.prev = 438;
55611
- _context18.t11 = _context18["catch"](426);
55612
- _iterator18.e(_context18.t11);
55613
- case 441:
55614
- _context18.prev = 441;
55615
- _iterator18.f();
55616
- return _context18.finish(441);
55617
- case 444:
55795
+ case 403:
55796
+ _context18.prev = 403;
55797
+ _context18.t10 = _context18["catch"](391);
55798
+ _iterator17.e(_context18.t10);
55799
+ case 406:
55800
+ _context18.prev = 406;
55801
+ _iterator17.f();
55802
+ return _context18.finish(406);
55803
+ case 409:
55618
55804
  if (!validationErrors.length) {
55619
- _context18.next = 449;
55805
+ _context18.next = 414;
55620
55806
  break;
55621
55807
  }
55622
- _context18.next = 447;
55808
+ _context18.next = 412;
55623
55809
  return handle.rollback();
55624
- case 447:
55810
+ case 412:
55625
55811
  restoreUserFilter();
55626
55812
  // Rows resolved by the sequential lookup pass above commit individually, BEFORE this check runs —
55627
55813
  // a validation failure in the rest of the batch cannot roll those back, so "everything was reverted"
@@ -55636,9 +55822,9 @@ function createNavigationToolset(ctx) {
55636
55822
  failed: failed.length ? summarizeFailures(failed) : undefined,
55637
55823
  note: mergedOutcome.committed.length ? "".concat(mergedOutcome.committed.length, " row(s) addressed by keyColumn/keyValue were already COMMITTED individually before this validation failure (each such row is located, staged and saved on its own, to avoid losing it to a later filter change) \u2014 do NOT re-send those, see committedRowIds. The REST of the batch failed validation and was reverted: fix the listed problems and try ONE new stageTableEdits call for just those.").concat(addSchemaHint()) : "NOTHING was staged for approval: some rows fail the table's validation (everything was reverted). Fix the listed problems \u2014 e.g. fill the required columns \u2014 and try ONE new stageTableEdits call.".concat(addSchemaHint())
55638
55824
  }));
55639
- case 449:
55825
+ case 414:
55640
55826
  // Bring the first staged row into view; staged cells/rows are highlighted.
55641
- focusNode = _api2.getRowNode((_ref25 = (_ref26 = (_staged$0$rowId = (_staged$ = staged[0]) === null || _staged$ === void 0 ? void 0 : _staged$.rowId) !== null && _staged$0$rowId !== void 0 ? _staged$0$rowId : removed[0]) !== null && _ref26 !== void 0 ? _ref26 : (_addedRows$ = addedRows[0]) === null || _addedRows$ === void 0 ? void 0 : _addedRows$.rowId) !== null && _ref25 !== void 0 ? _ref25 : '');
55827
+ focusNode = _api2.getRowNode((_ref26 = (_ref27 = (_staged$0$rowId = (_staged$ = staged[0]) === null || _staged$ === void 0 ? void 0 : _staged$.rowId) !== null && _staged$0$rowId !== void 0 ? _staged$0$rowId : removed[0]) !== null && _ref27 !== void 0 ? _ref27 : (_addedRows$ = addedRows[0]) === null || _addedRows$ === void 0 ? void 0 : _addedRows$.rowId) !== null && _ref26 !== void 0 ? _ref26 : '');
55642
55828
  if ((focusNode === null || focusNode === void 0 ? void 0 : focusNode.rowIndex) != null) _api2.ensureIndexVisible(focusNode.rowIndex, 'middle');
55643
55829
  totalStaged = staged.length + addedRows.length + removed.length;
55644
55830
  /**
@@ -55666,29 +55852,29 @@ function createNavigationToolset(ctx) {
55666
55852
  }; // Block until the user decides on the approval bar (abort = discard) — unless auto-approve is on, or
55667
55853
  // the sequential lookup pass above already asked (and got) the one approval this whole call needs.
55668
55854
  if (!ctx.autoApprove && !preApproved) awaitingApproval();
55669
- _context18.t12 = ctx.autoApprove || preApproved;
55670
- if (_context18.t12) {
55671
- _context18.next = 459;
55855
+ _context18.t11 = ctx.autoApprove || preApproved;
55856
+ if (_context18.t11) {
55857
+ _context18.next = 424;
55672
55858
  break;
55673
55859
  }
55674
- _context18.next = 458;
55860
+ _context18.next = 423;
55675
55861
  return _entry2.requestAgentApproval(totalStaged, undefined, signal);
55676
- case 458:
55677
- _context18.t12 = _context18.sent;
55678
- case 459:
55679
- approved = _context18.t12;
55862
+ case 423:
55863
+ _context18.t11 = _context18.sent;
55864
+ case 424:
55865
+ approved = _context18.t11;
55680
55866
  if (approved) {
55681
- _context18.next = 469;
55867
+ _context18.next = 434;
55682
55868
  break;
55683
55869
  }
55684
- _context18.next = 463;
55870
+ _context18.next = 428;
55685
55871
  return handle.rollback();
55686
- case 463:
55872
+ case 428:
55687
55873
  survived = survivingOperations();
55688
55874
  survivedCount = survived.changes.length + survived.addedRowIds.length + survived.removedRowIds.length;
55689
55875
  restoreUserFilter();
55690
55876
  if (survivedCount) {
55691
- _context18.next = 468;
55877
+ _context18.next = 433;
55692
55878
  break;
55693
55879
  }
55694
55880
  return _context18.abrupt("return", {
@@ -55697,7 +55883,7 @@ function createNavigationToolset(ctx) {
55697
55883
  failed: failed.length ? summarizeFailures(failed) : undefined,
55698
55884
  note: 'The user DISCARDED the staged changes — nothing was saved. Do NOT re-stage the same values; ask what to adjust instead.'
55699
55885
  });
55700
- case 468:
55886
+ case 433:
55701
55887
  return _context18.abrupt("return", {
55702
55888
  applied: true,
55703
55889
  appliedCount: survivedCount,
@@ -55714,7 +55900,7 @@ function createNavigationToolset(ctx) {
55714
55900
  failed: failed.length ? summarizeFailures(failed) : undefined,
55715
55901
  note: 'The user DISCARDED the staged changes, but the table had ALREADY SAVED the listed operations before the decision arrived ' + '(it saves pending edits by itself when the user clicks outside the grid), so the rollback found nothing to revert. ' + 'Report EXACTLY these operations as live on the server and ask the user whether to undo them — do NOT re-send them, and do not claim the discard took effect.'
55716
55902
  });
55717
- case 469:
55903
+ case 434:
55718
55904
  // Trim the echoed row: drop `*DisplayTexts` mirrors, collapse localized objects to one language.
55719
55905
  trimEcho = function trimEcho(values) {
55720
55906
  var isLocalized = function isLocalized(v) {
@@ -55727,16 +55913,16 @@ function createNavigationToolset(ctx) {
55727
55913
  var _localized$DE;
55728
55914
  var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i8], 2),
55729
55915
  key = _Object$entries3$_i[0],
55730
- _value = _Object$entries3$_i[1];
55916
+ value = _Object$entries3$_i[1];
55731
55917
  if (/DisplayTexts?$/.test(key)) continue;
55732
- var localized = _value;
55733
- out[key] = isLocalized(_value) ? (_localized$DE = localized.DE) !== null && _localized$DE !== void 0 ? _localized$DE : Object.values(localized)[0] : _value;
55918
+ var localized = value;
55919
+ out[key] = isLocalized(value) ? (_localized$DE = localized.DE) !== null && _localized$DE !== void 0 ? _localized$DE : Object.values(localized)[0] : value;
55734
55920
  }
55735
55921
  return out;
55736
55922
  }; // The commit REPORTS what the server confirmed; grid state cannot (a vanished rejected row gets no marker).
55737
- _context18.next = 472;
55923
+ _context18.next = 437;
55738
55924
  return handle.commitStagedChanges();
55739
- case 472:
55925
+ case 437:
55740
55926
  finalOutcome = _context18.sent;
55741
55927
  // Rows resolved by the sequential lookup pass above were already committed individually — merge
55742
55928
  // their outcomes in. When that pass never ran (the common case), this is exactly `finalOutcome`.
@@ -55760,10 +55946,10 @@ function createNavigationToolset(ctx) {
55760
55946
  })), _toConsumableArray(addedRows.filter(function (a) {
55761
55947
  return a.rowId === rowId;
55762
55948
  }).flatMap(function (a) {
55763
- return Object.entries(a.values).map(function (_ref27) {
55764
- var _ref28 = _slicedToArray(_ref27, 2),
55765
- column = _ref28[0],
55766
- value = _ref28[1];
55949
+ return Object.entries(a.values).map(function (_ref28) {
55950
+ var _ref29 = _slicedToArray(_ref28, 2),
55951
+ column = _ref29[0],
55952
+ value = _ref29[1];
55767
55953
  return {
55768
55954
  column: column,
55769
55955
  length: String(value !== null && value !== void 0 ? value : '').length
@@ -55807,37 +55993,37 @@ function createNavigationToolset(ctx) {
55807
55993
  errors: [].concat(_toConsumableArray(said), _toConsumableArray(lengthNote ? [lengthNote] : []), _toConsumableArray(remedy ? [remedy] : []))
55808
55994
  });
55809
55995
  };
55810
- _iterator19 = _createForOfIteratorHelper$r((_outcome$failed = outcome === null || outcome === void 0 ? void 0 : outcome.failed) !== null && _outcome$failed !== void 0 ? _outcome$failed : []);
55996
+ _iterator18 = _createForOfIteratorHelper$r((_outcome$failed = outcome === null || outcome === void 0 ? void 0 : outcome.failed) !== null && _outcome$failed !== void 0 ? _outcome$failed : []);
55811
55997
  try {
55812
- for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
55813
- failure = _step19.value;
55998
+ for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
55999
+ failure = _step18.value;
55814
56000
  addError(failure.rowId, failure.errors);
55815
56001
  }
55816
56002
  } catch (err) {
55817
- _iterator19.e(err);
56003
+ _iterator18.e(err);
55818
56004
  } finally {
55819
- _iterator19.f();
56005
+ _iterator18.f();
55820
56006
  }
55821
- _iterator20 = _createForOfIteratorHelper$r((_outcome$skipped = outcome === null || outcome === void 0 ? void 0 : outcome.skipped) !== null && _outcome$skipped !== void 0 ? _outcome$skipped : []);
56007
+ _iterator19 = _createForOfIteratorHelper$r((_outcome$skipped = outcome === null || outcome === void 0 ? void 0 : outcome.skipped) !== null && _outcome$skipped !== void 0 ? _outcome$skipped : []);
55822
56008
  try {
55823
- for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
55824
- _rowId4 = _step20.value;
56009
+ for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
56010
+ _rowId4 = _step19.value;
55825
56011
  addError(_rowId4, ['Row was NOT sent to the server — the commit skipped it (its grid row was gone, or it still carried validation errors). ' + 'VERIFY BEFORE RE-SENDING: this message has been measured WRONG (the row WAS on the server) — locateRow the row by its key first; a blind re-send creates a silent duplicate. ' + 'Typical on rows created AFTER this view last loaded (the lazy grid evicts them): locateRow the row (loads and pins it), then re-send ONLY its cells as an own batch — one row per call.']);
55826
56012
  }
55827
56013
  // Secondary signal for rows the outcome did not mention: server-rejected rows stay pending with error markers.
55828
56014
  } catch (err) {
55829
- _iterator20.e(err);
56015
+ _iterator19.e(err);
55830
56016
  } finally {
55831
- _iterator20.f();
56017
+ _iterator19.f();
55832
56018
  }
55833
- _iterator21 = _createForOfIteratorHelper$r(new Set([].concat(_toConsumableArray(staged.map(function (s) {
56019
+ _iterator20 = _createForOfIteratorHelper$r(new Set([].concat(_toConsumableArray(staged.map(function (s) {
55834
56020
  return s.rowId;
55835
56021
  })), _toConsumableArray(addedRows.map(function (a) {
55836
56022
  return a.rowId;
55837
56023
  })), removed)));
55838
56024
  try {
55839
- for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {
55840
- _rowId5 = _step21.value;
56025
+ for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
56026
+ _rowId5 = _step20.value;
55841
56027
  _rowErrors = (_api2$getRowNode13 = _api2.getRowNode(_rowId5)) === null || _api2$getRowNode13 === void 0 || (_api2$getRowNode13 = _api2$getRowNode13.data) === null || _api2$getRowNode13 === void 0 || (_api2$getRowNode13 = _api2$getRowNode13.__diva_context) === null || _api2$getRowNode13 === void 0 ? void 0 : _api2$getRowNode13.errors;
55842
56028
  if (Array.isArray(_rowErrors) && _rowErrors.length) {
55843
56029
  addError(_rowId5, _rowErrors.map(function (e) {
@@ -55847,9 +56033,9 @@ function createNavigationToolset(ctx) {
55847
56033
  }
55848
56034
  // A committed row loses its isNew marker. NOT keyed on _id: bulk endpoints may not echo the record.
55849
56035
  } catch (err) {
55850
- _iterator21.e(err);
56036
+ _iterator20.e(err);
55851
56037
  } finally {
55852
- _iterator21.f();
56038
+ _iterator20.f();
55853
56039
  }
55854
56040
  for (_i9 = 0, _addedRows = addedRows; _i9 < _addedRows.length; _i9++) {
55855
56041
  a = _addedRows[_i9];
@@ -55863,12 +56049,12 @@ function createNavigationToolset(ctx) {
55863
56049
  survivedAfterCommit = outcomeIsEmpty ? survivingOperations() : undefined;
55864
56050
  autoCommitted = !!survivedAfterCommit && survivedAfterCommit.changes.length + survivedAfterCommit.addedRowIds.length + survivedAfterCommit.removedRowIds.length > 0;
55865
56051
  if (!(outcomeIsEmpty && !autoCommitted && !serverErrors.length)) {
55866
- _context18.next = 496;
56052
+ _context18.next = 461;
55867
56053
  break;
55868
56054
  }
55869
- _context18.next = 494;
56055
+ _context18.next = 459;
55870
56056
  return handle.rollback();
55871
- case 494:
56057
+ case 459:
55872
56058
  restoreUserFilter();
55873
56059
  return _context18.abrupt("return", {
55874
56060
  applied: false,
@@ -55876,13 +56062,13 @@ function createNavigationToolset(ctx) {
55876
56062
  failed: failed.length ? summarizeFailures(failed) : undefined,
55877
56063
  note: 'NOTHING was saved: the commit reported no row as saved or rejected, and the grid holds none of the staged values any more ' + '(the table dropped the pending edits before they were sent). Do NOT report this as done — re-read the rows (readGridRows) and stage the batch again.'
55878
56064
  });
55879
- case 496:
56065
+ case 461:
55880
56066
  autoCommittedOps = autoCommitted ? survivedAfterCommit : undefined;
55881
56067
  committedIds = new Set(autoCommittedOps ? [].concat(_toConsumableArray(autoCommittedOps.changes.map(function (change) {
55882
56068
  return change.rowId;
55883
56069
  })), _toConsumableArray(autoCommittedOps.addedRowIds), _toConsumableArray(autoCommittedOps.removedRowIds)) : (_outcome$committed = outcome === null || outcome === void 0 ? void 0 : outcome.committed) !== null && _outcome$committed !== void 0 ? _outcome$committed : []);
55884
56070
  if (!serverErrors.length) {
55885
- _context18.next = 578;
56071
+ _context18.next = 543;
55886
56072
  break;
55887
56073
  }
55888
56074
  failedIds = new Set(serverErrors.map(function (s) {
@@ -55915,9 +56101,9 @@ function createNavigationToolset(ctx) {
55915
56101
  _id: removedRecordIds.get(rowId)
55916
56102
  };
55917
56103
  }); // Clear the rejected leftovers (they would block the next staging).
55918
- _context18.next = 505;
56104
+ _context18.next = 470;
55919
56105
  return handle.rollback();
55920
- case 505:
56106
+ case 470:
55921
56107
  restoreUserFilter();
55922
56108
  // Partial failure: neither the commit report nor the rollback is reliable — read the server back per operation.
55923
56109
  hasIdColumn = !!_api2.getColumnDef('_id'); // A COUNT budget bounded nothing: one probe can spend three 8s row-waits, so 25 of them ran for ten
@@ -55931,7 +56117,7 @@ function createNavigationToolset(ctx) {
55931
56117
  filterBeforeVerify = _api2.getFilterModel();
55932
56118
  verifyFilterApplied = false;
55933
56119
  probeServerRow = /*#__PURE__*/function () {
55934
- var _ref29 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_id, onFound) {
56120
+ var _ref30 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_id, onFound) {
55935
56121
  var _id2, _located$node$data, located, exact;
55936
56122
  return _regeneratorRuntime.wrap(function _callee7$(_context8) {
55937
56123
  while (1) switch (_context8.prev = _context8.next) {
@@ -55992,8 +56178,8 @@ function createNavigationToolset(ctx) {
55992
56178
  }
55993
56179
  }, _callee7, null, [[5, 17]]);
55994
56180
  }));
55995
- return function probeServerRow(_x25, _x26) {
55996
- return _ref29.apply(this, arguments);
56181
+ return function probeServerRow(_x29, _x30) {
56182
+ return _ref30.apply(this, arguments);
55997
56183
  };
55998
56184
  }();
55999
56185
  restoreVerifyFilter = function restoreVerifyFilter() {
@@ -56004,16 +56190,16 @@ function createNavigationToolset(ctx) {
56004
56190
  verifiedChanges = [];
56005
56191
  verifiedAdds = [];
56006
56192
  verifiedRemovals = [];
56007
- _context18.prev = 516;
56008
- _iterator22 = _createForOfIteratorHelper$r(editTargets);
56009
- _context18.prev = 518;
56193
+ _context18.prev = 481;
56194
+ _iterator21 = _createForOfIteratorHelper$r(editTargets);
56195
+ _context18.prev = 483;
56010
56196
  _loop5 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop5() {
56011
56197
  var _expectedValueOf, _target$from;
56012
56198
  var target, probe, serverValue, serverState;
56013
56199
  return _regeneratorRuntime.wrap(function _loop5$(_context9) {
56014
56200
  while (1) switch (_context9.prev = _context9.next) {
56015
56201
  case 0:
56016
- target = _step22.value;
56202
+ target = _step21.value;
56017
56203
  _context9.next = 3;
56018
56204
  return probeServerRow(target._id, function (node) {
56019
56205
  return fmt(cellValueOf(_api2, node, target.column));
@@ -56050,48 +56236,48 @@ function createNavigationToolset(ctx) {
56050
56236
  }
56051
56237
  }, _loop5);
56052
56238
  });
56053
- _iterator22.s();
56054
- case 521:
56055
- if ((_step22 = _iterator22.n()).done) {
56056
- _context18.next = 527;
56239
+ _iterator21.s();
56240
+ case 486:
56241
+ if ((_step21 = _iterator21.n()).done) {
56242
+ _context18.next = 492;
56057
56243
  break;
56058
56244
  }
56059
- return _context18.delegateYield(_loop5(), "t13", 523);
56060
- case 523:
56061
- if (!_context18.t13) {
56062
- _context18.next = 525;
56245
+ return _context18.delegateYield(_loop5(), "t12", 488);
56246
+ case 488:
56247
+ if (!_context18.t12) {
56248
+ _context18.next = 490;
56063
56249
  break;
56064
56250
  }
56065
- return _context18.abrupt("continue", 525);
56066
- case 525:
56067
- _context18.next = 521;
56251
+ return _context18.abrupt("continue", 490);
56252
+ case 490:
56253
+ _context18.next = 486;
56068
56254
  break;
56069
- case 527:
56070
- _context18.next = 532;
56255
+ case 492:
56256
+ _context18.next = 497;
56071
56257
  break;
56072
- case 529:
56073
- _context18.prev = 529;
56074
- _context18.t14 = _context18["catch"](518);
56075
- _iterator22.e(_context18.t14);
56076
- case 532:
56077
- _context18.prev = 532;
56078
- _iterator22.f();
56079
- return _context18.finish(532);
56080
- case 535:
56081
- _iterator23 = _createForOfIteratorHelper$r(addTargets);
56082
- _context18.prev = 536;
56083
- _iterator23.s();
56084
- case 538:
56085
- if ((_step23 = _iterator23.n()).done) {
56086
- _context18.next = 546;
56258
+ case 494:
56259
+ _context18.prev = 494;
56260
+ _context18.t13 = _context18["catch"](483);
56261
+ _iterator21.e(_context18.t13);
56262
+ case 497:
56263
+ _context18.prev = 497;
56264
+ _iterator21.f();
56265
+ return _context18.finish(497);
56266
+ case 500:
56267
+ _iterator22 = _createForOfIteratorHelper$r(addTargets);
56268
+ _context18.prev = 501;
56269
+ _iterator22.s();
56270
+ case 503:
56271
+ if ((_step22 = _iterator22.n()).done) {
56272
+ _context18.next = 511;
56087
56273
  break;
56088
56274
  }
56089
- target = _step23.value;
56090
- _context18.next = 542;
56275
+ target = _step22.value;
56276
+ _context18.next = 507;
56091
56277
  return probeServerRow(target._id, function () {
56092
56278
  return true;
56093
56279
  });
56094
- case 542:
56280
+ case 507:
56095
56281
  probe = _context18.sent;
56096
56282
  verifiedAdds.push(_objectSpread$X(_objectSpread$X({
56097
56283
  rowId: target.rowId,
@@ -56101,60 +56287,60 @@ function createNavigationToolset(ctx) {
56101
56287
  } : {}), {}, {
56102
56288
  serverState: probe.state === 'found' ? 'applied' : probe.state === 'missing' ? 'reverted' : 'unknown'
56103
56289
  }));
56104
- case 544:
56105
- _context18.next = 538;
56290
+ case 509:
56291
+ _context18.next = 503;
56106
56292
  break;
56107
- case 546:
56108
- _context18.next = 551;
56293
+ case 511:
56294
+ _context18.next = 516;
56109
56295
  break;
56110
- case 548:
56111
- _context18.prev = 548;
56112
- _context18.t15 = _context18["catch"](536);
56113
- _iterator23.e(_context18.t15);
56114
- case 551:
56115
- _context18.prev = 551;
56116
- _iterator23.f();
56117
- return _context18.finish(551);
56118
- case 554:
56119
- _iterator24 = _createForOfIteratorHelper$r(removalTargets);
56120
- _context18.prev = 555;
56121
- _iterator24.s();
56122
- case 557:
56123
- if ((_step24 = _iterator24.n()).done) {
56124
- _context18.next = 565;
56296
+ case 513:
56297
+ _context18.prev = 513;
56298
+ _context18.t14 = _context18["catch"](501);
56299
+ _iterator22.e(_context18.t14);
56300
+ case 516:
56301
+ _context18.prev = 516;
56302
+ _iterator22.f();
56303
+ return _context18.finish(516);
56304
+ case 519:
56305
+ _iterator23 = _createForOfIteratorHelper$r(removalTargets);
56306
+ _context18.prev = 520;
56307
+ _iterator23.s();
56308
+ case 522:
56309
+ if ((_step23 = _iterator23.n()).done) {
56310
+ _context18.next = 530;
56125
56311
  break;
56126
56312
  }
56127
- _target = _step24.value;
56128
- _context18.next = 561;
56313
+ _target = _step23.value;
56314
+ _context18.next = 526;
56129
56315
  return probeServerRow(_target._id, function () {
56130
56316
  return true;
56131
56317
  });
56132
- case 561:
56318
+ case 526:
56133
56319
  _probe = _context18.sent;
56134
56320
  verifiedRemovals.push({
56135
56321
  rowId: _target.rowId,
56136
56322
  serverState: _probe.state === 'missing' ? 'applied' : _probe.state === 'found' ? 'reverted' : 'unknown'
56137
56323
  });
56138
- case 563:
56139
- _context18.next = 557;
56324
+ case 528:
56325
+ _context18.next = 522;
56140
56326
  break;
56141
- case 565:
56142
- _context18.next = 570;
56327
+ case 530:
56328
+ _context18.next = 535;
56143
56329
  break;
56144
- case 567:
56145
- _context18.prev = 567;
56146
- _context18.t16 = _context18["catch"](555);
56147
- _iterator24.e(_context18.t16);
56148
- case 570:
56149
- _context18.prev = 570;
56150
- _iterator24.f();
56151
- return _context18.finish(570);
56152
- case 573:
56153
- _context18.prev = 573;
56330
+ case 532:
56331
+ _context18.prev = 532;
56332
+ _context18.t15 = _context18["catch"](520);
56333
+ _iterator23.e(_context18.t15);
56334
+ case 535:
56335
+ _context18.prev = 535;
56336
+ _iterator23.f();
56337
+ return _context18.finish(535);
56338
+ case 538:
56339
+ _context18.prev = 538;
56154
56340
  // The table belongs to the user again before we answer, whatever the probes did.
56155
56341
  restoreVerifyFilter();
56156
- return _context18.finish(573);
56157
- case 576:
56342
+ return _context18.finish(538);
56343
+ case 541:
56158
56344
  appliedCount = [].concat(verifiedChanges, verifiedAdds, verifiedRemovals).filter(function (v) {
56159
56345
  return v.serverState === 'applied';
56160
56346
  }).length;
@@ -56179,7 +56365,7 @@ function createNavigationToolset(ctx) {
56179
56365
  failed: failed.length ? summarizeFailures(failed) : undefined,
56180
56366
  note: 'The SERVER REJECTED the listed rows. Every other operation was READ BACK from the server — its `serverState` is the truth: ' + 'applied = the effect IS on the server (do NOT re-send it), reverted = re-send it after fixing the rejection cause, ' + 'unknown = verify with readGridRows/locateRow before re-sending. Never re-send an applied or unknown operation blindly — that is how silent duplicates happen.' + (verifyDeadlineHit ? ' The read-back ran out of time, so some `unknown`s mean UNCHECKED rather than unanswered — check those yourself before deciding.' : '') + parentBindingNote
56181
56367
  }));
56182
- case 578:
56368
+ case 543:
56183
56369
  // Return the real _id so references are not built from grid rowIds; catalogs/packages list rows are new EDITORS.
56184
56370
  livePath = (_root$navigationState3 = root.navigationState.path) !== null && _root$navigationState3 !== void 0 ? _root$navigationState3 : '';
56185
56371
  editorPathFor = function editorPathFor(id) {
@@ -56246,23 +56432,23 @@ function createNavigationToolset(ctx) {
56246
56432
  column: s.column
56247
56433
  };
56248
56434
  })), _toConsumableArray(addedRows.flatMap(function (a) {
56249
- return Object.entries(a.values).filter(function (_ref30) {
56435
+ return Object.entries(a.values).filter(function (_ref31) {
56250
56436
  var _providedAddColumns$g, _providedAddColumns$g2;
56251
- var _ref31 = _slicedToArray(_ref30, 2),
56252
- column = _ref31[0],
56253
- value = _ref31[1];
56437
+ var _ref32 = _slicedToArray(_ref31, 2),
56438
+ column = _ref32[0],
56439
+ value = _ref32[1];
56254
56440
  return !isEmptyCell(value) && ((_providedAddColumns$g = (_providedAddColumns$g2 = providedAddColumns.get(a.rowId)) === null || _providedAddColumns$g2 === void 0 ? void 0 : _providedAddColumns$g2.has(column)) !== null && _providedAddColumns$g !== void 0 ? _providedAddColumns$g : true);
56255
- }).map(function (_ref32) {
56256
- var _ref33 = _slicedToArray(_ref32, 1),
56257
- column = _ref33[0];
56441
+ }).map(function (_ref33) {
56442
+ var _ref34 = _slicedToArray(_ref33, 1),
56443
+ column = _ref34[0];
56258
56444
  return {
56259
56445
  rowId: a.rowId,
56260
56446
  column: column
56261
56447
  };
56262
56448
  });
56263
- }))).filter(function (_ref34) {
56264
- var rowId = _ref34.rowId,
56265
- column = _ref34.column;
56449
+ }))).filter(function (_ref35) {
56450
+ var rowId = _ref35.rowId,
56451
+ column = _ref35.column;
56266
56452
  var node = _api2.getRowNode(rowId);
56267
56453
  return node ? isEmptyCell(cellValueOf(_api2, node, column)) : false;
56268
56454
  });
@@ -56304,7 +56490,7 @@ function createNavigationToolset(ctx) {
56304
56490
  // The serie by NUMBER AND NAME, not by 24-hex id — the thing to check is whether this is serie 0.
56305
56491
  serieScope && (addedRows.length || staged.length || removed.length) ? " SERIE-SCOPED TABLE: these rows belong to ".concat(serieLabelOf(serieScope), " \u2014 the serie the VIEW's selector held, which AUTO-SELECTS THE FIRST serie when nobody chose one").concat(addedRows.length ? ', so a new row can land in the components serie without anyone deciding that' : '', ". CONFIRM it is the serie you meant before continuing.").concat(foreignSeries.length ? " MISMATCH: the saved record(s) report serieId ".concat(foreignSeries.join(', '), ", which is NOT this view's scope \u2014 read the rows back before doing anything else.") : '') : '') + (removed.length ? ' REMOVALS: inbound references are NOT cleaned up. Deleting an entity leaves dead pointers in decisions (featureRefs + condition columns), price feature groups + their finishes conditions, option-group membership, partlistpos.itemRefTypeNo, items.featureClassRefNo and items.partListRef, plus formula keys inside action strings — measured on all of these. Two of them make the planner THROW on init (a missing feature class, a missing formula). Only option keys inside decision condition/action cells are cleaned, and a deleted PRICE FEATURE GROUP is the one clean case (its matrix column goes with it). So after any delete, read the referrers yourself; nothing warns you. ' + 'lintCatalog finds most of them AFTER a reloadPlanner — but NOT a dead items.featureClassRefNo, because that article throws during init and never enters the snapshot it lints. For that one check the EDITOR: on the items view, readGridRows({grid:"items", columns:["typeNo","featureClassRefNo"]}) and compare against readColumnOptions({grid:"items", column:"featureClassRefNo"}), which lists the classes that still exist. Same approach for partlistpos.itemRefTypeNo against the items list.' : '') + ' Loaded planner instances still hold PRE-change data — reloadPlanner before verifying these changes in the planner.' + (stagingNotes.length ? " HOUSE-STYLE NOTES: ".concat(stagingNotes.join(' ')) : '')
56306
56492
  }));
56307
- case 592:
56493
+ case 557:
56308
56494
  // Thrown (not returned) so the refusal does NOT end the turn — the model tells the user to decide on the staged edits first.
56309
56495
  dirtyGrids = root.gridRegistry.entries.filter(function (entry) {
56310
56496
  var _entry$getHandle4;
@@ -56313,11 +56499,11 @@ function createNavigationToolset(ctx) {
56313
56499
  return entry.label;
56314
56500
  });
56315
56501
  if (!dirtyGrids.length) {
56316
- _context18.next = 595;
56502
+ _context18.next = 560;
56317
56503
  break;
56318
56504
  }
56319
56505
  throw new Error("Page reload refused: table(s) ".concat(dirtyGrids.join(', '), " still carry staged, unapproved edits that a reload would silently drop. Ask the user to \xDCbernehmen or Verwerfen them first, then call reloadPage again."));
56320
- case 595:
56506
+ case 560:
56321
56507
  // Deferred so the tool result reaches the chat and the turn is persisted (the stored endedByTool record is what
56322
56508
  // triggers the automatic 'Continue.' after the reload) before the document unloads.
56323
56509
  setTimeout(function () {
@@ -56329,29 +56515,29 @@ function createNavigationToolset(ctx) {
56329
56515
  pageReload: true,
56330
56516
  note: "Full page reload triggered — this turn ends here. The chat reopens on this conversation and an automatic 'Continue.' follows once the view is ready (if the agent panel is not open after the reload, it fires when the user opens it). Every planner instance is rebuilt from a FRESH article payload, so decisionRefs and media changes are now in effect — verify with listDecisions / getMediaInfo, do not assume."
56331
56517
  });
56332
- case 597:
56518
+ case 562:
56333
56519
  _livePath = (_root$navigationState4 = root.navigationState.path) !== null && _root$navigationState4 !== void 0 ? _root$navigationState4 : '';
56334
56520
  packageBase = (_livePath$match = _livePath.match(/catalogs\/idmeditor\/packages\/([^/]+)/)) === null || _livePath$match === void 0 ? void 0 : _livePath$match[1];
56335
56521
  catalogBase = (_livePath$match2 = _livePath.match(/catalogs\/idmeditor\/catalogs\/([^/]+)/)) === null || _livePath$match2 === void 0 ? void 0 : _livePath$match2[1];
56336
- baseId = (_ref43 = (_ref44 = packageBase !== null && packageBase !== void 0 ? packageBase : catalogBase) !== null && _ref44 !== void 0 ? _ref44 : ctx.packageId) !== null && _ref43 !== void 0 ? _ref43 : ctx.catalogId;
56522
+ baseId = (_ref44 = (_ref45 = packageBase !== null && packageBase !== void 0 ? packageBase : catalogBase) !== null && _ref45 !== void 0 ? _ref45 : ctx.packageId) !== null && _ref44 !== void 0 ? _ref44 : ctx.catalogId;
56337
56523
  if (baseId) {
56338
- _context18.next = 603;
56524
+ _context18.next = 568;
56339
56525
  break;
56340
56526
  }
56341
56527
  return _context18.abrupt("return", {
56342
56528
  error: 'No catalog/package context — nothing to reload.'
56343
56529
  });
56344
- case 603:
56530
+ case 568:
56345
56531
  // Package views load the ENRICHER pack, catalog views the raw IDM catalog.
56346
56532
  isPack = baseId === packageBase || !packageBase && !catalogBase && baseId === ctx.packageId;
56347
56533
  _root$webplannerInsta = root.webplannerInstanceStore.invalidateByBase(baseId), destroyed = _root$webplannerInsta.destroyed, reloadTriggered = _root$webplannerInsta.reloadTriggered, knownKeys = _root$webplannerInsta.knownKeys;
56348
56534
  source = isPack ? "PACKAGE ".concat(baseId, " (enricher pack: pricelist factors and manual prices APPLY)") : "CATALOG ".concat(baseId, " (raw IDM catalog: enricher pricelists do NOT apply \u2014 to verify pack prices, navigateTo the package view first, then reloadPlanner there)"); // A base matching no instance key invalidates nothing — report that instead of claiming the discard happened.
56349
56535
  if (!(!destroyed && !reloadTriggered)) {
56350
- _context18.next = 610;
56536
+ _context18.next = 575;
56351
56537
  break;
56352
56538
  }
56353
56539
  if (knownKeys.length) {
56354
- _context18.next = 609;
56540
+ _context18.next = 574;
56355
56541
  break;
56356
56542
  }
56357
56543
  return _context18.abrupt("return", {
@@ -56361,7 +56547,7 @@ function createNavigationToolset(ctx) {
56361
56547
  environmentUnchanged: true,
56362
56548
  note: "NOTHING TO RELOAD \u2014 no planner instance is loaded for ".concat(baseId, ", so there was no stale snapshot to discard. The next planner use loads CURRENT data from ").concat(source, ".")
56363
56549
  });
56364
- case 609:
56550
+ case 574:
56365
56551
  return _context18.abrupt("return", {
56366
56552
  ok: false,
56367
56553
  destroyed: destroyed,
@@ -56370,32 +56556,32 @@ function createNavigationToolset(ctx) {
56370
56556
  knownKeys: knownKeys,
56371
56557
  error: "Nothing was invalidated: no loaded planner belongs to '".concat(baseId, "'. Loaded instance keys are [").concat(knownKeys.join(', '), "] ") + "(key = catalogId|serieNo|itemTypeNo|language). A key whose first segment is EMPTY or differs from '".concat(baseId, "' means the ") + "configurator was mounted without the catalog binding \u2014 reload the page to re-bind, then reloadPlanner again. Do NOT treat " + "planner reads as current until this succeeds."
56372
56558
  });
56373
- case 610:
56559
+ case 575:
56374
56560
  return _context18.abrupt("return", {
56375
56561
  ok: true,
56376
56562
  destroyed: destroyed,
56377
56563
  reloadTriggered: reloadTriggered,
56378
56564
  note: "Planner instances were discarded \u2014 the next planner use loads CURRENT data from ".concat(source) + (reloadTriggered ? ' (the open configurator reloads itself, and its stale instance is destroyed rather than re-adopted)' : '') + ". The turn ends here; an automatic 'Continue.' follows."
56379
56565
  });
56380
- case 611:
56566
+ case 576:
56381
56567
  _resolveGrid4 = resolveGrid(args.grid), _entry3 = _resolveGrid4.entry, _error3 = _resolveGrid4.error;
56382
56568
  if (!(_error3 || !_entry3)) {
56383
- _context18.next = 614;
56569
+ _context18.next = 579;
56384
56570
  break;
56385
56571
  }
56386
56572
  return _context18.abrupt("return", {
56387
56573
  error: _error3
56388
56574
  });
56389
- case 614:
56575
+ case 579:
56390
56576
  _handle = _entry3.getHandle();
56391
56577
  if (_handle) {
56392
- _context18.next = 617;
56578
+ _context18.next = 582;
56393
56579
  break;
56394
56580
  }
56395
56581
  return _context18.abrupt("return", {
56396
56582
  error: "Table '".concat(_entry3.label, "' is not ready.")
56397
56583
  });
56398
- case 617:
56584
+ case 582:
56399
56585
  actionName = String((_action = input === null || input === void 0 ? void 0 : input.action) !== null && _action !== void 0 ? _action : '');
56400
56586
  actionInput = String((_input = input === null || input === void 0 ? void 0 : input.input) !== null && _input !== void 0 ? _input : '').trim();
56401
56587
  _addTargets = _handle.getDivaColumnDefs().filter(isHeaderAddColumn);
@@ -56407,15 +56593,15 @@ function createNavigationToolset(ctx) {
56407
56593
  return action.name;
56408
56594
  })));
56409
56595
  if (available.includes(actionName)) {
56410
- _context18.next = 625;
56596
+ _context18.next = 590;
56411
56597
  break;
56412
56598
  }
56413
56599
  return _context18.abrupt("return", {
56414
56600
  error: "Action '".concat(actionName, "' is not available on '").concat(_entry3.label, "' \u2014 this table has: ").concat(available.join(', ') || 'no actions', " (listGrids shows each table's actions).")
56415
56601
  });
56416
- case 625:
56602
+ case 590:
56417
56603
  approve = /*#__PURE__*/function () {
56418
- var _ref45 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(label) {
56604
+ var _ref46 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(label) {
56419
56605
  return _regeneratorRuntime.wrap(function _callee8$(_context13) {
56420
56606
  while (1) switch (_context13.prev = _context13.next) {
56421
56607
  case 0:
@@ -56437,8 +56623,8 @@ function createNavigationToolset(ctx) {
56437
56623
  }
56438
56624
  }, _callee8);
56439
56625
  }));
56440
- return function approve(_x27) {
56441
- return _ref45.apply(this, arguments);
56626
+ return function approve(_x31) {
56627
+ return _ref46.apply(this, arguments);
56442
56628
  };
56443
56629
  }();
56444
56630
  declined = {
@@ -56447,7 +56633,7 @@ function createNavigationToolset(ctx) {
56447
56633
  }; // Same transparency rule as stageTableEdits: a silently executed action must be reported as such.
56448
56634
  autoNote = ctx.autoApprove ? ' AUTO-APPROVE is on — executed WITHOUT the approval bar; mention that ONCE per reply, not per call.' : '';
56449
56635
  authorizedFetch = /*#__PURE__*/function () {
56450
- var _ref46 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(url, method, body) {
56636
+ var _ref47 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(url, method, body) {
56451
56637
  var response, detail;
56452
56638
  return _regeneratorRuntime.wrap(function _callee9$(_context14) {
56453
56639
  while (1) switch (_context14.prev = _context14.next) {
@@ -56481,12 +56667,12 @@ function createNavigationToolset(ctx) {
56481
56667
  }
56482
56668
  }, _callee9);
56483
56669
  }));
56484
- return function authorizedFetch(_x28, _x29, _x30) {
56485
- return _ref46.apply(this, arguments);
56670
+ return function authorizedFetch(_x32, _x33, _x34) {
56671
+ return _ref47.apply(this, arguments);
56486
56672
  };
56487
56673
  }(); // The reload is asynchronous — purge, then wait bounded until rows are back.
56488
56674
  refreshAndSettle = /*#__PURE__*/function () {
56489
- var _ref47 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
56675
+ var _ref48 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
56490
56676
  var api, deadline;
56491
56677
  return _regeneratorRuntime.wrap(function _callee10$(_context15) {
56492
56678
  while (1) switch (_context15.prev = _context15.next) {
@@ -56513,7 +56699,7 @@ function createNavigationToolset(ctx) {
56513
56699
  }, _callee10);
56514
56700
  }));
56515
56701
  return function refreshAndSettle() {
56516
- return _ref47.apply(this, arguments);
56702
+ return _ref48.apply(this, arguments);
56517
56703
  };
56518
56704
  }();
56519
56705
  unsettledNote = ' WARNING: the table has NOT repopulated yet (server still recomputing) — before reading it, reopen the view: locateRow the parent row again, openToolbarTool the subtable.'; // Declared by the VIEW and executed by it — this toolset only carries the input and the approval.
@@ -56521,336 +56707,336 @@ function createNavigationToolset(ctx) {
56521
56707
  return action.name === actionName;
56522
56708
  });
56523
56709
  if (!viewAction) {
56524
- _context18.next = 653;
56710
+ _context18.next = 618;
56525
56711
  break;
56526
56712
  }
56527
56713
  mutating = viewAction.mutating !== false;
56528
- _context18.t17 = mutating;
56529
- if (!_context18.t17) {
56530
- _context18.next = 639;
56714
+ _context18.t16 = mutating;
56715
+ if (!_context18.t16) {
56716
+ _context18.next = 604;
56531
56717
  break;
56532
56718
  }
56533
- _context18.next = 638;
56719
+ _context18.next = 603;
56534
56720
  return approve("".concat(actionName, ": ").concat(actionInput || '(no input)'));
56535
- case 638:
56536
- _context18.t17 = !_context18.sent;
56537
- case 639:
56538
- if (!_context18.t17) {
56539
- _context18.next = 641;
56721
+ case 603:
56722
+ _context18.t16 = !_context18.sent;
56723
+ case 604:
56724
+ if (!_context18.t16) {
56725
+ _context18.next = 606;
56540
56726
  break;
56541
56727
  }
56542
56728
  return _context18.abrupt("return", declined);
56543
- case 641:
56544
- _context18.prev = 641;
56545
- _context18.t18 = "";
56546
- _context18.next = 645;
56729
+ case 606:
56730
+ _context18.prev = 606;
56731
+ _context18.t17 = "";
56732
+ _context18.next = 610;
56547
56733
  return viewAction.run(actionInput);
56548
- case 645:
56549
- _context18.t19 = _context18.sent;
56550
- _context18.t20 = _context18.t18.concat.call(_context18.t18, _context18.t19).concat(mutating ? autoNote : '');
56734
+ case 610:
56735
+ _context18.t18 = _context18.sent;
56736
+ _context18.t19 = _context18.t17.concat.call(_context18.t17, _context18.t18).concat(mutating ? autoNote : '');
56551
56737
  return _context18.abrupt("return", {
56552
56738
  applied: true,
56553
- note: _context18.t20
56739
+ note: _context18.t19
56554
56740
  });
56555
- case 650:
56556
- _context18.prev = 650;
56557
- _context18.t21 = _context18["catch"](641);
56741
+ case 615:
56742
+ _context18.prev = 615;
56743
+ _context18.t20 = _context18["catch"](606);
56558
56744
  return _context18.abrupt("return", {
56559
- error: _context18.t21 instanceof Error ? _context18.t21.message : String(_context18.t21)
56745
+ error: _context18.t20 instanceof Error ? _context18.t20.message : String(_context18.t20)
56560
56746
  });
56561
- case 653:
56747
+ case 618:
56562
56748
  if (!(actionName === 'cloneCatalog')) {
56563
- _context18.next = 672;
56749
+ _context18.next = 637;
56564
56750
  break;
56565
56751
  }
56566
56752
  if (isRecordId(actionInput)) {
56567
- _context18.next = 656;
56753
+ _context18.next = 621;
56568
56754
  break;
56569
56755
  }
56570
56756
  return _context18.abrupt("return", {
56571
56757
  error: "input must be the catalog's _id (24-hex) — read it from the _id column (readGridRows)."
56572
56758
  });
56573
- case 656:
56574
- _context18.next = 658;
56759
+ case 621:
56760
+ _context18.next = 623;
56575
56761
  return approve("cloneCatalog: ".concat(actionInput));
56576
- case 658:
56762
+ case 623:
56577
56763
  if (_context18.sent) {
56578
- _context18.next = 660;
56764
+ _context18.next = 625;
56579
56765
  break;
56580
56766
  }
56581
56767
  return _context18.abrupt("return", declined);
56582
- case 660:
56583
- _context18.prev = 660;
56584
- _context18.next = 663;
56768
+ case 625:
56769
+ _context18.prev = 625;
56770
+ _context18.next = 628;
56585
56771
  return authorizedFetch("".concat(root.configurationStore.apiConfig.idmService, "/catalogs/").concat(actionInput, "/clone"), 'POST', '{}');
56586
- case 663:
56587
- _context18.next = 668;
56772
+ case 628:
56773
+ _context18.next = 633;
56588
56774
  break;
56589
- case 665:
56590
- _context18.prev = 665;
56591
- _context18.t22 = _context18["catch"](660);
56775
+ case 630:
56776
+ _context18.prev = 630;
56777
+ _context18.t21 = _context18["catch"](625);
56592
56778
  return _context18.abrupt("return", {
56593
- error: _context18.t22 instanceof Error ? _context18.t22.message : String(_context18.t22)
56779
+ error: _context18.t21 instanceof Error ? _context18.t21.message : String(_context18.t21)
56594
56780
  });
56595
- case 668:
56596
- _context18.next = 670;
56781
+ case 633:
56782
+ _context18.next = 635;
56597
56783
  return refreshAndSettle();
56598
- case 670:
56784
+ case 635:
56599
56785
  cloneSettled = _context18.sent;
56600
56786
  return _context18.abrupt("return", {
56601
56787
  applied: true,
56602
56788
  note: "Catalog cloned server-side \u2014 the table refreshes; the copy appears as a new row (readGridRows to find it and REPORT its name + _id).".concat(autoNote).concat(cloneSettled ? '' : unsettledNote)
56603
56789
  });
56604
- case 672:
56790
+ case 637:
56605
56791
  if (!(actionName === 'importGlobalFeatures')) {
56606
- _context18.next = 692;
56792
+ _context18.next = 657;
56607
56793
  break;
56608
56794
  }
56609
56795
  catalogId = String((_catalogId = ((_handle$getApplicatio7 = (_handle$getApplicatio8 = _handle.getApplicationData) === null || _handle$getApplicatio8 === void 0 ? void 0 : _handle$getApplicatio8.call(_handle)) !== null && _handle$getApplicatio7 !== void 0 ? _handle$getApplicatio7 : {}).catalogId) !== null && _catalogId !== void 0 ? _catalogId : '');
56610
56796
  if (catalogId) {
56611
- _context18.next = 676;
56797
+ _context18.next = 641;
56612
56798
  break;
56613
56799
  }
56614
56800
  return _context18.abrupt("return", {
56615
56801
  error: 'No catalog context on this table.'
56616
56802
  });
56617
- case 676:
56618
- _context18.next = 678;
56803
+ case 641:
56804
+ _context18.next = 643;
56619
56805
  return approve('importGlobalFeatures');
56620
- case 678:
56806
+ case 643:
56621
56807
  if (_context18.sent) {
56622
- _context18.next = 680;
56808
+ _context18.next = 645;
56623
56809
  break;
56624
56810
  }
56625
56811
  return _context18.abrupt("return", declined);
56626
- case 680:
56627
- _context18.prev = 680;
56628
- _context18.next = 683;
56812
+ case 645:
56813
+ _context18.prev = 645;
56814
+ _context18.next = 648;
56629
56815
  return authorizedFetch("".concat(root.configurationStore.apiConfig.idmService, "/catalogs/").concat(catalogId, "/features/global"), 'POST');
56630
- case 683:
56631
- _context18.next = 688;
56816
+ case 648:
56817
+ _context18.next = 653;
56632
56818
  break;
56633
- case 685:
56634
- _context18.prev = 685;
56635
- _context18.t23 = _context18["catch"](680);
56819
+ case 650:
56820
+ _context18.prev = 650;
56821
+ _context18.t22 = _context18["catch"](645);
56636
56822
  return _context18.abrupt("return", {
56637
- error: _context18.t23 instanceof Error ? _context18.t23.message : String(_context18.t23)
56823
+ error: _context18.t22 instanceof Error ? _context18.t22.message : String(_context18.t22)
56638
56824
  });
56639
- case 688:
56640
- _context18.next = 690;
56825
+ case 653:
56826
+ _context18.next = 655;
56641
56827
  return refreshAndSettle();
56642
- case 690:
56828
+ case 655:
56643
56829
  importSettled = _context18.sent;
56644
56830
  return _context18.abrupt("return", {
56645
56831
  applied: true,
56646
56832
  note: "Global features imported \u2014 the table refreshes with the added feature rows.".concat(autoNote).concat(importSettled ? '' : unsettledNote)
56647
56833
  });
56648
- case 692:
56834
+ case 657:
56649
56835
  if (!(actionName === 'setPriceFactor' || actionName === 'setPriceFactorPriority')) {
56650
- _context18.next = 753;
56836
+ _context18.next = 718;
56651
56837
  break;
56652
56838
  }
56653
56839
  app = (_handle$getApplicatio9 = (_handle$getApplicatio10 = _handle.getApplicationData) === null || _handle$getApplicatio10 === void 0 ? void 0 : _handle$getApplicatio10.call(_handle)) !== null && _handle$getApplicatio9 !== void 0 ? _handle$getApplicatio9 : {};
56654
56840
  serieNo = Number(app.serieNo);
56655
- _context18.prev = 695;
56841
+ _context18.prev = 660;
56656
56842
  _params2 = JSON.parse(actionInput || '{}');
56657
- _context18.next = 702;
56843
+ _context18.next = 667;
56658
56844
  break;
56659
- case 699:
56660
- _context18.prev = 699;
56661
- _context18.t24 = _context18["catch"](695);
56845
+ case 664:
56846
+ _context18.prev = 664;
56847
+ _context18.t23 = _context18["catch"](660);
56662
56848
  return _context18.abrupt("return", {
56663
56849
  error: "input must be a JSON object — listGrids shows this action's exact shape."
56664
56850
  });
56665
- case 702:
56851
+ case 667:
56666
56852
  scope = String((_params2$scope = _params2.scope) !== null && _params2$scope !== void 0 ? _params2$scope : '');
56667
56853
  if (scope in PRICE_FACTOR_FIELDS) {
56668
- _context18.next = 705;
56854
+ _context18.next = 670;
56669
56855
  break;
56670
56856
  }
56671
56857
  return _context18.abrupt("return", {
56672
56858
  error: "scope must be one of: ".concat(Object.keys(PRICE_FACTOR_FIELDS).join(', '), ".")
56673
56859
  });
56674
- case 705:
56860
+ case 670:
56675
56861
  key = _params2.key === undefined ? undefined : String(_params2.key); // The factor maps live on the PRICELIST record — the write goes through the parent pricelists grid row.
56676
56862
  parent = resolveGrid('pricelists');
56677
56863
  if (!(parent.error || !parent.entry || !parent.api)) {
56678
- _context18.next = 709;
56864
+ _context18.next = 674;
56679
56865
  break;
56680
56866
  }
56681
56867
  return _context18.abrupt("return", {
56682
56868
  error: "The parent 'pricelists' table must be on screen for factor actions."
56683
56869
  });
56684
- case 709:
56870
+ case 674:
56685
56871
  parentHandle = parent.entry.getHandle();
56686
56872
  if (parentHandle) {
56687
- _context18.next = 712;
56873
+ _context18.next = 677;
56688
56874
  break;
56689
56875
  }
56690
56876
  return _context18.abrupt("return", {
56691
56877
  error: "Table 'pricelists' is not ready."
56692
56878
  });
56693
- case 712:
56879
+ case 677:
56694
56880
  parent.api.forEachNode(function (node) {
56695
56881
  var _node$data4;
56696
56882
  if (((_node$data4 = node.data) === null || _node$data4 === void 0 ? void 0 : _node$data4._id) === app.pricelistId) pricelistNode = node;
56697
56883
  });
56698
56884
  if ((_pricelistNode = pricelistNode) !== null && _pricelistNode !== void 0 && _pricelistNode.id) {
56699
- _context18.next = 715;
56885
+ _context18.next = 680;
56700
56886
  break;
56701
56887
  }
56702
56888
  return _context18.abrupt("return", {
56703
56889
  error: "Pricelist ".concat(app.pricelistId, " is not loaded in the 'pricelists' table.")
56704
56890
  });
56705
- case 715:
56706
- _context18.prev = 715;
56891
+ case 680:
56892
+ _context18.prev = 680;
56707
56893
  if (!(actionName === 'setPriceFactor')) {
56708
- _context18.next = 724;
56894
+ _context18.next = 689;
56709
56895
  break;
56710
56896
  }
56711
56897
  factors = _params2.factors;
56712
56898
  if (!(!Array.isArray(factors) || factors.some(function (f) {
56713
56899
  return typeof f !== 'number' || !Number.isFinite(f) || f <= 0;
56714
56900
  }))) {
56715
- _context18.next = 720;
56901
+ _context18.next = 685;
56716
56902
  break;
56717
56903
  }
56718
56904
  return _context18.abrupt("return", {
56719
56905
  error: 'factors must be an array of positive numbers (>1 = factor, <1 = discount fraction, e.g. 0.95 = 5% off); [] clears the entry.'
56720
56906
  });
56721
- case 720:
56907
+ case 685:
56722
56908
  patch = applyPriceFactor(pricelistNode.data, serieNo, scope, key, factors);
56723
56909
  label = "setPriceFactor ".concat(scope).concat(key ? " ".concat(key) : '', " \u2192 [").concat(factors.join('; '), "] (Serie ").concat(serieNo, ")");
56724
- _context18.next = 730;
56910
+ _context18.next = 695;
56725
56911
  break;
56726
- case 724:
56912
+ case 689:
56727
56913
  if (!(typeof _params2.priority !== 'boolean')) {
56728
- _context18.next = 726;
56914
+ _context18.next = 691;
56729
56915
  break;
56730
56916
  }
56731
56917
  return _context18.abrupt("return", {
56732
56918
  error: 'priority must be true or false.'
56733
56919
  });
56734
- case 726:
56920
+ case 691:
56735
56921
  if (key) {
56736
- _context18.next = 728;
56922
+ _context18.next = 693;
56737
56923
  break;
56738
56924
  }
56739
56925
  return _context18.abrupt("return", {
56740
56926
  error: 'key is required (the pfg id / price group).'
56741
56927
  });
56742
- case 728:
56928
+ case 693:
56743
56929
  patch = applyPriceFactorPriority(pricelistNode.data, serieNo, scope, key, _params2.priority);
56744
56930
  label = "setPriceFactorPriority ".concat(scope, " ").concat(key, " \u2192 ").concat(_params2.priority, " (Serie ").concat(serieNo, ")");
56745
- case 730:
56746
- _context18.next = 735;
56931
+ case 695:
56932
+ _context18.next = 700;
56747
56933
  break;
56748
- case 732:
56749
- _context18.prev = 732;
56750
- _context18.t25 = _context18["catch"](715);
56934
+ case 697:
56935
+ _context18.prev = 697;
56936
+ _context18.t24 = _context18["catch"](680);
56751
56937
  return _context18.abrupt("return", {
56752
- error: _context18.t25 instanceof Error ? _context18.t25.message : String(_context18.t25)
56938
+ error: _context18.t24 instanceof Error ? _context18.t24.message : String(_context18.t24)
56753
56939
  });
56754
- case 735:
56755
- _context18.next = 737;
56940
+ case 700:
56941
+ _context18.next = 702;
56756
56942
  return approve(label);
56757
- case 737:
56943
+ case 702:
56758
56944
  if (_context18.sent) {
56759
- _context18.next = 739;
56945
+ _context18.next = 704;
56760
56946
  break;
56761
56947
  }
56762
56948
  return _context18.abrupt("return", declined);
56763
- case 739:
56949
+ case 704:
56764
56950
  pricelistRowId = pricelistNode.id;
56765
- _context18.next = 742;
56951
+ _context18.next = 707;
56766
56952
  return parentHandle.setNodeDataValue(pricelistRowId, patch, {
56767
56953
  suppressAutoCommit: true
56768
56954
  });
56769
- case 742:
56955
+ case 707:
56770
56956
  if (_context18.sent) {
56771
- _context18.next = 744;
56957
+ _context18.next = 709;
56772
56958
  break;
56773
56959
  }
56774
56960
  return _context18.abrupt("return", {
56775
56961
  error: 'The pricelist row rejected the update.'
56776
56962
  });
56777
- case 744:
56778
- _context18.next = 746;
56963
+ case 709:
56964
+ _context18.next = 711;
56779
56965
  return parentHandle.commitStagedChanges();
56780
- case 746:
56966
+ case 711:
56781
56967
  factorOutcome = _context18.sent;
56782
56968
  rejected = factorOutcome === null || factorOutcome === void 0 ? void 0 : factorOutcome.failed.find(function (failure) {
56783
56969
  return failure.rowId === pricelistRowId;
56784
56970
  });
56785
56971
  if (!rejected) {
56786
- _context18.next = 750;
56972
+ _context18.next = 715;
56787
56973
  break;
56788
56974
  }
56789
56975
  return _context18.abrupt("return", {
56790
56976
  error: "The server rejected the factor update: ".concat(rejected.errors.join(' ') || 'no reason given', ". Nothing was changed.")
56791
56977
  });
56792
- case 750:
56978
+ case 715:
56793
56979
  if (!(factorOutcome && !factorOutcome.committed.includes(pricelistRowId))) {
56794
- _context18.next = 752;
56980
+ _context18.next = 717;
56795
56981
  break;
56796
56982
  }
56797
56983
  return _context18.abrupt("return", {
56798
56984
  error: 'The factor update was NOT saved — the commit did not confirm the pricelist row. Re-read the pricelist (readGridRows) before retrying.'
56799
56985
  });
56800
- case 752:
56986
+ case 717:
56801
56987
  return _context18.abrupt("return", {
56802
56988
  applied: true,
56803
56989
  note: "Saved on the pricelist record and confirmed by the server (same path as the factor modal) \u2014 the prices table reflects it immediately.".concat(autoNote)
56804
56990
  });
56805
- case 753:
56991
+ case 718:
56806
56992
  if (!(actionName === 'deleteAllManualPrices')) {
56807
- _context18.next = 771;
56993
+ _context18.next = 736;
56808
56994
  break;
56809
56995
  }
56810
56996
  _app = (_handle$getApplicatio11 = (_handle$getApplicatio12 = _handle.getApplicationData) === null || _handle$getApplicatio12 === void 0 ? void 0 : _handle$getApplicatio12.call(_handle)) !== null && _handle$getApplicatio11 !== void 0 ? _handle$getApplicatio11 : {};
56811
- _context18.next = 757;
56997
+ _context18.next = 722;
56812
56998
  return approve("deleteAllManualPrices (Pricelist ".concat(_app.pricelistId, ", Serie ").concat(_app.serieNo, ")"));
56813
- case 757:
56999
+ case 722:
56814
57000
  if (_context18.sent) {
56815
- _context18.next = 759;
57001
+ _context18.next = 724;
56816
57002
  break;
56817
57003
  }
56818
57004
  return _context18.abrupt("return", declined);
56819
- case 759:
56820
- _context18.prev = 759;
56821
- _context18.next = 762;
57005
+ case 724:
57006
+ _context18.prev = 724;
57007
+ _context18.next = 727;
56822
57008
  return authorizedFetch("".concat(root.configurationStore.apiConfig.enricherService, "/packages/").concat(_app.packageId, "/pricelists/").concat(_app.pricelistId, "/serie/").concat(_app.serieNo, "/prices/manual"), 'DELETE');
56823
- case 762:
56824
- _context18.next = 767;
57009
+ case 727:
57010
+ _context18.next = 732;
56825
57011
  break;
56826
- case 764:
56827
- _context18.prev = 764;
56828
- _context18.t26 = _context18["catch"](759);
57012
+ case 729:
57013
+ _context18.prev = 729;
57014
+ _context18.t25 = _context18["catch"](724);
56829
57015
  return _context18.abrupt("return", {
56830
- error: _context18.t26 instanceof Error ? _context18.t26.message : String(_context18.t26)
57016
+ error: _context18.t25 instanceof Error ? _context18.t25.message : String(_context18.t25)
56831
57017
  });
56832
- case 767:
56833
- _context18.next = 769;
57018
+ case 732:
57019
+ _context18.next = 734;
56834
57020
  return refreshAndSettle();
56835
- case 769:
57021
+ case 734:
56836
57022
  pricesSettled = _context18.sent;
56837
57023
  return _context18.abrupt("return", {
56838
57024
  applied: true,
56839
57025
  note: "All manual price overrides of this pricelist+serie were deleted (irreversible) \u2014 the table refreshed; origPrices and factors now determine every cell.".concat(autoNote).concat(pricesSettled ? '' : unsettledNote)
56840
57026
  });
56841
- case 771:
57027
+ case 736:
56842
57028
  if (!(actionName === 'removeColumn')) {
56843
- _context18.next = 810;
57029
+ _context18.next = 775;
56844
57030
  break;
56845
57031
  }
56846
57032
  if (actionInput) {
56847
- _context18.next = 774;
57033
+ _context18.next = 739;
56848
57034
  break;
56849
57035
  }
56850
57036
  return _context18.abrupt("return", {
56851
57037
  error: "Provide input: the column to remove — its field id ('optionsSetRefs.2305') or the bare key ('2305'); listGrids shows the columns."
56852
57038
  });
56853
- case 774:
57039
+ case 739:
56854
57040
  removeTargetIn = function removeTargetIn(defs) {
56855
57041
  return defs.find(function (def) {
56856
57042
  return def.field === actionInput || def.colId === actionInput || String(def.field).endsWith(".".concat(actionInput));
@@ -56858,7 +57044,7 @@ function createNavigationToolset(ctx) {
56858
57044
  };
56859
57045
  _target4 = removeTargetIn(removeTargets);
56860
57046
  if (_target4) {
56861
- _context18.next = 778;
57047
+ _context18.next = 743;
56862
57048
  break;
56863
57049
  }
56864
57050
  return _context18.abrupt("return", {
@@ -56866,75 +57052,75 @@ function createNavigationToolset(ctx) {
56866
57052
  return "'".concat(def.field, "'");
56867
57053
  }).join(', ') || 'none', ".")
56868
57054
  });
56869
- case 778:
57055
+ case 743:
56870
57056
  _header = typeof _target4.headerName === 'string' ? root.t(_target4.headerName) : String(_target4.field);
56871
- _context18.next = 781;
57057
+ _context18.next = 746;
56872
57058
  return approve("removeColumn: ".concat(_header));
56873
- case 781:
57059
+ case 746:
56874
57060
  if (_context18.sent) {
56875
- _context18.next = 783;
57061
+ _context18.next = 748;
56876
57062
  break;
56877
57063
  }
56878
57064
  return _context18.abrupt("return", declined);
56879
- case 783:
57065
+ case 748:
56880
57066
  // The defs are rebuilt on every render, each onRemove closing over the feature list of ITS render — the
56881
57067
  // pre-wait closure would drop a feature the user added while the bar was open. Re-resolve after the wait.
56882
57068
  live = removeTargetIn(_handle.getDivaColumnDefs().filter(isRemovableColumn));
56883
57069
  if (live) {
56884
- _context18.next = 786;
57070
+ _context18.next = 751;
56885
57071
  break;
56886
57072
  }
56887
57073
  return _context18.abrupt("return", {
56888
57074
  applied: false,
56889
57075
  note: "'".concat(_target4.field, "' left the table while the approval was pending \u2014 nothing was removed. listGrids shows the current columns.")
56890
57076
  });
56891
- case 786:
56892
- _context18.prev = 786;
56893
- _context18.next = 789;
57077
+ case 751:
57078
+ _context18.prev = 751;
57079
+ _context18.next = 754;
56894
57080
  return live.headerComponentParams.onRemove();
56895
- case 789:
57081
+ case 754:
56896
57082
  saved = _context18.sent;
56897
- _context18.next = 795;
57083
+ _context18.next = 760;
56898
57084
  break;
56899
- case 792:
56900
- _context18.prev = 792;
56901
- _context18.t27 = _context18["catch"](786);
57085
+ case 757:
57086
+ _context18.prev = 757;
57087
+ _context18.t26 = _context18["catch"](751);
56902
57088
  return _context18.abrupt("return", {
56903
- error: _context18.t27 instanceof Error ? _context18.t27.message : String(_context18.t27)
57089
+ error: _context18.t26 instanceof Error ? _context18.t26.message : String(_context18.t26)
56904
57090
  });
56905
- case 795:
57091
+ case 760:
56906
57092
  if (!(saved === false)) {
56907
- _context18.next = 797;
57093
+ _context18.next = 762;
56908
57094
  break;
56909
57095
  }
56910
57096
  return _context18.abrupt("return", {
56911
57097
  applied: false,
56912
57098
  note: "The parent row did not take the new feature list \u2014 '".concat(_target4.field, "' was NOT removed. locateRow the parent row again so the view reloads, then retry.")
56913
57099
  });
56914
- case 797:
57100
+ case 762:
56915
57101
  // Poll until the column left the view — the parent entity's write and the rebuild are asynchronous.
56916
57102
  gone = false;
56917
57103
  attempt = 0;
56918
- case 799:
57104
+ case 764:
56919
57105
  if (!(attempt < 20 && !gone)) {
56920
- _context18.next = 806;
57106
+ _context18.next = 771;
56921
57107
  break;
56922
57108
  }
56923
- _context18.next = 802;
57109
+ _context18.next = 767;
56924
57110
  return sleep(100);
56925
- case 802:
57111
+ case 767:
56926
57112
  gone = !_handle.getDivaColumnDefs().some(function (def) {
56927
57113
  return def.field === _target4.field;
56928
57114
  });
56929
- case 803:
57115
+ case 768:
56930
57116
  attempt++;
56931
- _context18.next = 799;
57117
+ _context18.next = 764;
56932
57118
  break;
56933
- case 806:
57119
+ case 771:
56934
57120
  // The view declares what becomes of the rows' cells of a removed feature column.
56935
57121
  rowsNote = _target4.headerComponentParams.removeKeepsCells ? ' The rows KEEP their cells for that feature (hidden now, still exported) — re-add the column to see or clear them.' : " The server also strips that feature's cells from every row of this table.";
56936
57122
  if (gone) {
56937
- _context18.next = 809;
57123
+ _context18.next = 774;
56938
57124
  break;
56939
57125
  }
56940
57126
  return _context18.abrupt("return", {
@@ -56946,7 +57132,7 @@ function createNavigationToolset(ctx) {
56946
57132
  viewNotRebuilt: true,
56947
57133
  note: "The parent row took the new feature list, but '".concat(_target4.field, "' is still in the view after the wait \u2014 the rebuild is pending. Re-read the columns (listGrids) before touching this table again; do NOT retry the removal.") + rowsNote + autoNote
56948
57134
  });
56949
- case 809:
57135
+ case 774:
56950
57136
  return _context18.abrupt("return", {
56951
57137
  applied: true,
56952
57138
  removed: {
@@ -56955,30 +57141,30 @@ function createNavigationToolset(ctx) {
56955
57141
  },
56956
57142
  note: 'Column removed.' + rowsNote + autoNote
56957
57143
  });
56958
- case 810:
57144
+ case 775:
56959
57145
  // addColumn: one approval, sequential adds — parallel adds race the view rebuild.
56960
57146
  _target5 = _addTargets[0];
56961
57147
  if (actionInput) {
56962
- _context18.next = 813;
57148
+ _context18.next = 778;
56963
57149
  break;
56964
57150
  }
56965
57151
  return _context18.abrupt("return", {
56966
57152
  error: "Provide input: the key(s) to add, comma-separated \u2014 readColumnOptions('".concat(_target5.field, "') lists the addable entries.")
56967
57153
  });
56968
- case 813:
57154
+ case 778:
56969
57155
  keys = actionInput.split(',').map(function (k) {
56970
57156
  return k.trim();
56971
57157
  }).filter(Boolean); // Resolve ALL keys BEFORE asking approval: the bar shows the real labels, invalid keys fail fast.
56972
57158
  resolved = [];
56973
- _context18.prev = 815;
56974
- _iterator27 = _createForOfIteratorHelper$r(keys);
56975
- _context18.prev = 817;
57159
+ _context18.prev = 780;
57160
+ _iterator26 = _createForOfIteratorHelper$r(keys);
57161
+ _context18.prev = 782;
56976
57162
  _loop8 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop8() {
56977
57163
  var key, options, option;
56978
57164
  return _regeneratorRuntime.wrap(function _loop8$(_context16) {
56979
57165
  while (1) switch (_context16.prev = _context16.next) {
56980
57166
  case 0:
56981
- key = _step27.value;
57167
+ key = _step26.value;
56982
57168
  _context16.next = 3;
56983
57169
  return _handle.fetchLookupOptions(_target5.field, [key], {}, 0, 50);
56984
57170
  case 3:
@@ -57006,58 +57192,58 @@ function createNavigationToolset(ctx) {
57006
57192
  }
57007
57193
  }, _loop8);
57008
57194
  });
57009
- _iterator27.s();
57010
- case 820:
57011
- if ((_step27 = _iterator27.n()).done) {
57012
- _context18.next = 827;
57195
+ _iterator26.s();
57196
+ case 785:
57197
+ if ((_step26 = _iterator26.n()).done) {
57198
+ _context18.next = 792;
57013
57199
  break;
57014
57200
  }
57015
- return _context18.delegateYield(_loop8(), "t28", 822);
57016
- case 822:
57017
- _ret6 = _context18.t28;
57201
+ return _context18.delegateYield(_loop8(), "t27", 787);
57202
+ case 787:
57203
+ _ret6 = _context18.t27;
57018
57204
  if (!_ret6) {
57019
- _context18.next = 825;
57205
+ _context18.next = 790;
57020
57206
  break;
57021
57207
  }
57022
57208
  return _context18.abrupt("return", _ret6.v);
57023
- case 825:
57024
- _context18.next = 820;
57209
+ case 790:
57210
+ _context18.next = 785;
57025
57211
  break;
57026
- case 827:
57027
- _context18.next = 832;
57212
+ case 792:
57213
+ _context18.next = 797;
57028
57214
  break;
57029
- case 829:
57030
- _context18.prev = 829;
57031
- _context18.t29 = _context18["catch"](817);
57032
- _iterator27.e(_context18.t29);
57033
- case 832:
57034
- _context18.prev = 832;
57035
- _iterator27.f();
57036
- return _context18.finish(832);
57037
- case 835:
57038
- _context18.next = 840;
57215
+ case 794:
57216
+ _context18.prev = 794;
57217
+ _context18.t28 = _context18["catch"](782);
57218
+ _iterator26.e(_context18.t28);
57219
+ case 797:
57220
+ _context18.prev = 797;
57221
+ _iterator26.f();
57222
+ return _context18.finish(797);
57223
+ case 800:
57224
+ _context18.next = 805;
57039
57225
  break;
57040
- case 837:
57041
- _context18.prev = 837;
57042
- _context18.t30 = _context18["catch"](815);
57226
+ case 802:
57227
+ _context18.prev = 802;
57228
+ _context18.t29 = _context18["catch"](780);
57043
57229
  return _context18.abrupt("return", {
57044
- error: _context18.t30 instanceof Error ? _context18.t30.message : String(_context18.t30)
57230
+ error: _context18.t29 instanceof Error ? _context18.t29.message : String(_context18.t29)
57045
57231
  });
57046
- case 840:
57047
- _context18.next = 842;
57232
+ case 805:
57233
+ _context18.next = 807;
57048
57234
  return approve("addColumn: ".concat(resolved.map(function (r) {
57049
57235
  return r.label;
57050
57236
  }).join(', ')));
57051
- case 842:
57237
+ case 807:
57052
57238
  if (_context18.sent) {
57053
- _context18.next = 844;
57239
+ _context18.next = 809;
57054
57240
  break;
57055
57241
  }
57056
57242
  return _context18.abrupt("return", declined);
57057
- case 844:
57243
+ case 809:
57058
57244
  added = [];
57059
57245
  newColumns = [];
57060
- _context18.prev = 846;
57246
+ _context18.prev = 811;
57061
57247
  _loop9 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop9() {
57062
57248
  var key, beforeFields, _attempt, newColumn;
57063
57249
  return _regeneratorRuntime.wrap(function _loop9$(_context17) {
@@ -57104,17 +57290,17 @@ function createNavigationToolset(ctx) {
57104
57290
  }, _loop9);
57105
57291
  });
57106
57292
  _i15 = 0, _resolved = resolved;
57107
- case 849:
57293
+ case 814:
57108
57294
  if (!(_i15 < _resolved.length)) {
57109
- _context18.next = 854;
57295
+ _context18.next = 819;
57110
57296
  break;
57111
57297
  }
57112
- return _context18.delegateYield(_loop9(), "t31", 851);
57113
- case 851:
57298
+ return _context18.delegateYield(_loop9(), "t30", 816);
57299
+ case 816:
57114
57300
  _i15++;
57115
- _context18.next = 849;
57301
+ _context18.next = 814;
57116
57302
  break;
57117
- case 854:
57303
+ case 819:
57118
57304
  // On a decision's option-combinations subtable the add also writes the decision's featureRefs.
57119
57305
  decisionSubtableNote = /optioncombination/i.test(_entry3.label) ? " NOTE: on a decision's option-combinations subtable this ALSO wrote the feature(s) into the decision's featureRefs — existing rows carry NO condition for it, which in a type-0/1 re-opens that feature entirely. Re-read the decision row; fill the rows or revert featureRefs if you only wanted to look." : '';
57120
57306
  partialNote = newColumns.length < resolved.length ? " ".concat(resolved.length - newColumns.length, " added column(s) did not surface a field id within the poll \u2014 listGrids shows the final columns.") : '';
@@ -57130,31 +57316,31 @@ function createNavigationToolset(ctx) {
57130
57316
  return "'".concat(c, "'");
57131
57317
  }).join(', '), ".") : 'Column(s) added — the table re-renders; listGrids shows the new columns and their field ids.') + partialNote + decisionSubtableNote + autoNote
57132
57318
  }));
57133
- case 859:
57134
- _context18.prev = 859;
57135
- _context18.t32 = _context18["catch"](846);
57319
+ case 824:
57320
+ _context18.prev = 824;
57321
+ _context18.t31 = _context18["catch"](811);
57136
57322
  return _context18.abrupt("return", {
57137
- error: "".concat(_context18.t32 instanceof Error ? _context18.t32.message : String(_context18.t32)).concat(newColumns.length ? " \u2014 ".concat(newColumns.length, " column(s) were already added before the failure: ").concat(newColumns.join(', ')) : '')
57323
+ error: "".concat(_context18.t31 instanceof Error ? _context18.t31.message : String(_context18.t31)).concat(newColumns.length ? " \u2014 ".concat(newColumns.length, " column(s) were already added before the failure: ").concat(newColumns.join(', ')) : '')
57138
57324
  });
57139
- case 862:
57325
+ case 827:
57140
57326
  _resolveGrid5 = resolveGrid(args.grid), _entry4 = _resolveGrid5.entry, _api3 = _resolveGrid5.api, _error4 = _resolveGrid5.error;
57141
57327
  if (!(_error4 || !_api3 || !_entry4)) {
57142
- _context18.next = 865;
57328
+ _context18.next = 830;
57143
57329
  break;
57144
57330
  }
57145
57331
  return _context18.abrupt("return", {
57146
57332
  error: _error4
57147
57333
  });
57148
- case 865:
57334
+ case 830:
57149
57335
  _handle2 = _entry4.getHandle();
57150
57336
  if (_handle2) {
57151
- _context18.next = 868;
57337
+ _context18.next = 833;
57152
57338
  break;
57153
57339
  }
57154
57340
  return _context18.abrupt("return", {
57155
57341
  error: "Table '".concat(_entry4.label, "' is not ready.")
57156
57342
  });
57157
- case 868:
57343
+ case 833:
57158
57344
  _column7 = String((_column8 = input === null || input === void 0 ? void 0 : input.column) !== null && _column8 !== void 0 ? _column8 : '');
57159
57345
  search = String((_search = input === null || input === void 0 ? void 0 : input.search) !== null && _search !== void 0 ? _search : '');
57160
57346
  _limit = Math.min(Number(input === null || input === void 0 ? void 0 : input.limit) > 0 ? Number(input.limit) : 50, 200); // `exact` is one contract for every source below: action values and enum values as well as lookups.
@@ -57169,11 +57355,11 @@ function createNavigationToolset(ctx) {
57169
57355
  return action.name === _column7;
57170
57356
  });
57171
57357
  if (!optionAction) {
57172
- _context18.next = 890;
57358
+ _context18.next = 855;
57173
57359
  break;
57174
57360
  }
57175
57361
  if (optionAction.options) {
57176
- _context18.next = 878;
57362
+ _context18.next = 843;
57177
57363
  break;
57178
57364
  }
57179
57365
  return _context18.abrupt("return", {
@@ -57182,11 +57368,11 @@ function createNavigationToolset(ctx) {
57182
57368
  hasMore: false,
57183
57369
  note: "'".concat(_column7, "' is a table ACTION with no value list \u2014 its input is described in listGrids: ").concat(optionAction.description)
57184
57370
  });
57185
- case 878:
57186
- _context18.prev = 878;
57187
- _context18.next = 881;
57371
+ case 843:
57372
+ _context18.prev = 843;
57373
+ _context18.next = 846;
57188
57374
  return optionAction.options(search, _limit);
57189
- case 881:
57375
+ case 846:
57190
57376
  _yield$optionAction$o = _context18.sent;
57191
57377
  options = _yield$optionAction$o.options;
57192
57378
  note = _yield$optionAction$o.note;
@@ -57199,20 +57385,20 @@ function createNavigationToolset(ctx) {
57199
57385
  } : {}), {}, {
57200
57386
  note: "Values for runTableAction('".concat(_column7, "', <input>) \u2014 pass the VALUE(s), not the label.").concat(note ? " ".concat(note) : '').concat(wantsExact ? ' exact:true — only options whose value or label equals the search.' : '')
57201
57387
  }));
57202
- case 887:
57203
- _context18.prev = 887;
57204
- _context18.t33 = _context18["catch"](878);
57388
+ case 852:
57389
+ _context18.prev = 852;
57390
+ _context18.t32 = _context18["catch"](843);
57205
57391
  return _context18.abrupt("return", {
57206
- error: _context18.t33 instanceof Error ? _context18.t33.message : String(_context18.t33)
57392
+ error: _context18.t32 instanceof Error ? _context18.t32.message : String(_context18.t32)
57207
57393
  });
57208
- case 890:
57394
+ case 855:
57209
57395
  // Enum columns are answered here too: 'which values does this column take' is ONE question.
57210
57396
  enumDef = _handle2.getDivaColumnDefs().find(function (d) {
57211
57397
  return d.field === _column7;
57212
57398
  });
57213
57399
  enumData = enumDef === null || enumDef === void 0 || (_enumDef$customParams = enumDef.customParams) === null || _enumDef$customParams === void 0 ? void 0 : _enumDef$customParams.enumData;
57214
57400
  if (!(Array.isArray(enumData) && enumData.length)) {
57215
- _context18.next = 894;
57401
+ _context18.next = 859;
57216
57402
  break;
57217
57403
  }
57218
57404
  return _context18.abrupt("return", _objectSpread$X(_objectSpread$X({
@@ -57232,14 +57418,14 @@ function createNavigationToolset(ctx) {
57232
57418
  } : {}), {}, {
57233
57419
  note: "Enum column \u2014 this is the COMPLETE allowed set (also in listGrids). Stage the VALUE, not the label".concat(enumDef !== null && enumDef !== void 0 && (_enumDef$customParams2 = enumDef.customParams) !== null && _enumDef$customParams2 !== void 0 && _enumDef$customParams2.multiple ? ', comma-separated for multiple' : '', ".").concat(wantsExact ? ' exact:true — only options whose value or label equals the search.' : '')
57234
57420
  }));
57235
- case 894:
57421
+ case 859:
57236
57422
  if (enumDef) {
57237
- _context18.next = 901;
57423
+ _context18.next = 866;
57238
57424
  break;
57239
57425
  }
57240
57426
  computedDef = divaDefOf(_handle2.getDivaColumnDefs(), _column7);
57241
57427
  if (!isComputedColumn(computedDef)) {
57242
- _context18.next = 899;
57428
+ _context18.next = 864;
57243
57429
  break;
57244
57430
  }
57245
57431
  // Same source as listGrids, so the two cannot disagree about whether a new row may carry this column.
@@ -57250,16 +57436,16 @@ function createNavigationToolset(ctx) {
57250
57436
  hasMore: false,
57251
57437
  note: savedRowsOnly ? "'".concat(_column7, "' is a computed matrix cell \u2014 it has no option list, and addRows cannot set it. Create the row, then set it with stageTableEdits 'edits'.") : "'".concat(_column7, "' is a computed matrix cell \u2014 it has no option list; stage its value directly with stageTableEdits.")
57252
57438
  });
57253
- case 899:
57439
+ case 864:
57254
57440
  fields = _handle2.getDivaColumnDefs().map(function (d) {
57255
57441
  return d.field;
57256
57442
  }).filter(Boolean);
57257
57443
  return _context18.abrupt("return", {
57258
57444
  error: "Column '".concat(_column7, "' not found. Fields of '").concat(_entry4.label, "': ").concat(fields.join(', '), ".")
57259
57445
  });
57260
- case 901:
57446
+ case 866:
57261
57447
  if (!(enumDef.cellDataType === 'asset')) {
57262
- _context18.next = 903;
57448
+ _context18.next = 868;
57263
57449
  break;
57264
57450
  }
57265
57451
  return _context18.abrupt("return", {
@@ -57268,9 +57454,9 @@ function createNavigationToolset(ctx) {
57268
57454
  hasMore: false,
57269
57455
  note: "'".concat(_column7, "' is an ASSET cell \u2014 no option list; write it via uploadAsset + setAssetCell.")
57270
57456
  });
57271
- case 903:
57457
+ case 868:
57272
57458
  if (!(enumDef.cellDataType !== 'lookup' && !isHeaderAddColumn(enumDef))) {
57273
- _context18.next = 905;
57459
+ _context18.next = 870;
57274
57460
  break;
57275
57461
  }
57276
57462
  return _context18.abrupt("return", {
@@ -57279,7 +57465,7 @@ function createNavigationToolset(ctx) {
57279
57465
  hasMore: false,
57280
57466
  note: "'".concat(_column7, "' is a free-form ").concat((_enumDef$cellDataType = enumDef.cellDataType) !== null && _enumDef$cellDataType !== void 0 ? _enumDef$cellDataType : 'text', " column \u2014 it has no option list; stage a ").concat(enumDef.cellDataType === 'number' ? 'number' : 'value', " directly with stageTableEdits.")
57281
57467
  });
57282
- case 905:
57468
+ case 870:
57283
57469
  // Row-dependent url/filter templates resolve against a loaded row.
57284
57470
  firstRow = _api3.getDisplayedRowAtIndex(0);
57285
57471
  rowData = isRealRow(firstRow) ? (_data = firstRow.data) !== null && _data !== void 0 ? _data : {} : {}; // The server's contains-filter reads the search as a pattern: a bracket or a pipe in it returns nothing at all
@@ -57292,10 +57478,10 @@ function createNavigationToolset(ctx) {
57292
57478
  })[0]) !== null && _plainWords$sort$ !== void 0 ? _plainWords$sort$ : '' : search;
57293
57479
  matchLocally = remoteSearch !== search || wantsExact; // The local match only sees ONE capped fetch — a plain word with more hits than that can still hide the value.
57294
57480
  fetchLimit = matchLocally ? Math.max(_limit, 200) : _limit;
57295
- _context18.prev = 912;
57296
- _context18.next = 915;
57481
+ _context18.prev = 877;
57482
+ _context18.next = 880;
57297
57483
  return _handle2.fetchLookupOptions(_column7, remoteSearch, rowData, 0, fetchLimit);
57298
- case 915:
57484
+ case 880:
57299
57485
  fetched = _context18.sent;
57300
57486
  text = function text(o) {
57301
57487
  var _o$label2;
@@ -57323,9 +57509,9 @@ function createNavigationToolset(ctx) {
57323
57509
  } : {}), {}, {
57324
57510
  note: (isHeaderAddColumn(enumDef) ? "These entries are ADDABLE via runTableAction 'addColumn' (each becomes a table column) — they are not cell values to stage." : 'Stage this column with the VALUE(s) — comma-separated when the column is multi-select (see columnMeta.multiSelect).') + (remoteSearch !== search ? " The search contains characters the server filter reads as a pattern \u2014 the server was asked for '".concat(remoteSearch, "' and the full text '").concat(search, "' was matched here.") : '') + (wantsExact ? ' exact:true — only options whose value or label equals the search.' : '') + (fetchCapped ? " The ".concat(wantsExact ? 'exact' : 'full-text', " check ran on the first ").concat(fetchLimit, " rows").concat(remoteSearch ? " matching '".concat(remoteSearch, "'") : '', " only \u2014 narrow the search if the value is not among them.") : '')
57325
57511
  }));
57326
- case 922:
57327
- _context18.prev = 922;
57328
- _context18.t34 = _context18["catch"](912);
57512
+ case 887:
57513
+ _context18.prev = 887;
57514
+ _context18.t33 = _context18["catch"](877);
57329
57515
  // On an empty table a row-dependent lookup request goes out broken — teach the recovery instead of the opaque error.
57330
57516
  defs = _handle2.getDivaColumnDefs();
57331
57517
  url = String((_defs$find$customPara = (_defs$find = defs.find(function (d) {
@@ -57343,96 +57529,96 @@ function createNavigationToolset(ctx) {
57343
57529
  });
57344
57530
  hint = deps.length ? " This lookup's option list depends on row value(s) ".concat(deps.join(', '), " \u2014 with no loaded row it cannot be listed here: stage the add directly with the depending column in the SAME row (lookups resolve row-aware there).") : '';
57345
57531
  return _context18.abrupt("return", {
57346
- error: (_context18.t34 instanceof Error ? _context18.t34.message : String(_context18.t34)) + hint
57532
+ error: (_context18.t33 instanceof Error ? _context18.t33.message : String(_context18.t33)) + hint
57347
57533
  });
57348
- case 931:
57534
+ case 896:
57349
57535
  _resolveGrid6 = resolveGrid(args.grid), _api4 = _resolveGrid6.api, _error5 = _resolveGrid6.error;
57350
57536
  if (!(_error5 || !_api4)) {
57351
- _context18.next = 934;
57537
+ _context18.next = 899;
57352
57538
  break;
57353
57539
  }
57354
57540
  return _context18.abrupt("return", {
57355
57541
  error: _error5
57356
57542
  });
57357
- case 934:
57543
+ case 899:
57358
57544
  _api4.setFilterModel(null);
57359
57545
  return _context18.abrupt("return", {
57360
57546
  ok: true
57361
57547
  });
57362
- case 936:
57548
+ case 901:
57363
57549
  _resolveGrid7 = resolveGrid(args.grid), _entry5 = _resolveGrid7.entry, _error6 = _resolveGrid7.error;
57364
57550
  if (!(_error6 || !_entry5)) {
57365
- _context18.next = 939;
57551
+ _context18.next = 904;
57366
57552
  break;
57367
57553
  }
57368
57554
  return _context18.abrupt("return", {
57369
57555
  error: _error6
57370
57556
  });
57371
- case 939:
57557
+ case 904:
57372
57558
  _handle3 = _entry5.getHandle();
57373
57559
  if (_handle3) {
57374
- _context18.next = 942;
57560
+ _context18.next = 907;
57375
57561
  break;
57376
57562
  }
57377
57563
  return _context18.abrupt("return", {
57378
57564
  error: "Table '".concat(_entry5.label, "' is not ready.")
57379
57565
  });
57380
- case 942:
57566
+ case 907:
57381
57567
  if (_handle3.hasPendingChanges()) {
57382
- _context18.next = 944;
57568
+ _context18.next = 909;
57383
57569
  break;
57384
57570
  }
57385
57571
  return _context18.abrupt("return", {
57386
57572
  discarded: false,
57387
57573
  note: "Nothing is staged on '".concat(_entry5.label, "' \u2014 no staging blocks writes to it.")
57388
57574
  });
57389
- case 944:
57575
+ case 909:
57390
57576
  if (ctx.autoApprove) {
57391
- _context18.next = 951;
57577
+ _context18.next = 916;
57392
57578
  break;
57393
57579
  }
57394
57580
  awaitingApproval();
57395
57581
  // The bar's own buttons read Apply/Discard — the label says what Apply does, or Discard reads as the action.
57396
57582
  _label = "discardStagedChanges: every staged change on '".concat(_entry5.label, "' is dropped, the table returns to its last committed state");
57397
- _context18.next = 949;
57583
+ _context18.next = 914;
57398
57584
  return _entry5.requestAgentApproval(1, _label, signal);
57399
- case 949:
57585
+ case 914:
57400
57586
  if (_context18.sent) {
57401
- _context18.next = 951;
57587
+ _context18.next = 916;
57402
57588
  break;
57403
57589
  }
57404
57590
  return _context18.abrupt("return", {
57405
57591
  discarded: false,
57406
57592
  note: 'The user KEPT the staged changes — nothing was discarded. Ask what to do with them instead.'
57407
57593
  });
57408
- case 951:
57594
+ case 916:
57409
57595
  if (_handle3.hasPendingChanges()) {
57410
- _context18.next = 953;
57596
+ _context18.next = 918;
57411
57597
  break;
57412
57598
  }
57413
57599
  return _context18.abrupt("return", {
57414
57600
  discarded: false,
57415
57601
  note: "The table SAVED the staged changes on '".concat(_entry5.label, "' before the decision arrived (it saves pending edits by itself when the user clicks outside the grid) \u2014 nothing was discarded, those changes are live on the server. Read the rows back (readGridRows) and ask the user whether to undo them.")
57416
57602
  });
57417
- case 953:
57418
- _context18.next = 955;
57603
+ case 918:
57604
+ _context18.next = 920;
57419
57605
  return _handle3.rollback();
57420
- case 955:
57606
+ case 920:
57421
57607
  // Same transparency rule as runTableAction: a discard executed without the bar must be reported as such.
57422
57608
  _autoNote = ctx.autoApprove ? ' AUTO-APPROVE is on — executed WITHOUT the approval bar, so the user could not keep their own pending edits; mention that ONCE per reply, not per call.' : '';
57423
57609
  return _context18.abrupt("return", {
57424
57610
  discarded: true,
57425
57611
  note: "The staged changes on '".concat(_entry5.label, "' were discarded \u2014 the table is back at its last committed state, nothing was sent to the server, and writes to it are possible again.").concat(_autoNote)
57426
57612
  });
57427
- case 957:
57613
+ case 922:
57428
57614
  throw new Error("Unknown navigation tool: ".concat(name));
57429
- case 958:
57615
+ case 923:
57430
57616
  case "end":
57431
57617
  return _context18.stop();
57432
57618
  }
57433
- }, _callee11, null, [[45, 79, 82, 85], [53, 59], [93, 99], [319, 331, 334, 337], [343, 361, 364, 367], [368, 392, 395, 398], [426, 438, 441, 444], [516,, 573, 576], [518, 529, 532, 535], [536, 548, 551, 554], [555, 567, 570, 573], [641, 650], [660, 665], [680, 685], [695, 699], [715, 732], [759, 764], [786, 792], [815, 837], [817, 829, 832, 835], [846, 859], [878, 887], [912, 922]]);
57619
+ }, _callee11, null, [[38, 44], [58, 64], [284, 296, 299, 302], [308, 326, 329, 332], [333, 357, 360, 363], [391, 403, 406, 409], [481,, 538, 541], [483, 494, 497, 500], [501, 513, 516, 519], [520, 532, 535, 538], [606, 615], [625, 630], [645, 650], [660, 664], [680, 697], [724, 729], [751, 757], [780, 802], [782, 794, 797, 800], [811, 824], [843, 852], [877, 887]]);
57434
57620
  }));
57435
- function dispatch(_x8, _x9, _x10, _x11) {
57621
+ function dispatch(_x12, _x13, _x14, _x15) {
57436
57622
  return _dispatch.apply(this, arguments);
57437
57623
  }
57438
57624
  return dispatch;
@@ -57454,7 +57640,7 @@ function findGridEntry(root, gridRef) {
57454
57640
  }
57455
57641
 
57456
57642
  /** Waits for a registered on-screen grid (by label, or the first one) to be mounted and ready. */
57457
- function waitForGrid(_x31, _x32, _x33) {
57643
+ function waitForGrid(_x35, _x36, _x37) {
57458
57644
  return _waitForGrid.apply(this, arguments);
57459
57645
  }
57460
57646
  /**
@@ -57464,41 +57650,41 @@ function waitForGrid(_x31, _x32, _x33) {
57464
57650
  * refusal on timeout; a grid without a declaration passes at once.
57465
57651
  */
57466
57652
  function _waitForGrid() {
57467
- _waitForGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(root, gridLabel, timeoutMs) {
57653
+ _waitForGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(root, gridLabel, timeoutMs) {
57468
57654
  var deadline, _entry$getHandle5, entry, api;
57469
- return _regeneratorRuntime.wrap(function _callee15$(_context22) {
57470
- while (1) switch (_context22.prev = _context22.next) {
57655
+ return _regeneratorRuntime.wrap(function _callee16$(_context24) {
57656
+ while (1) switch (_context24.prev = _context24.next) {
57471
57657
  case 0:
57472
57658
  deadline = Date.now() + timeoutMs;
57473
57659
  case 1:
57474
57660
  if (!(Date.now() < deadline)) {
57475
- _context22.next = 10;
57661
+ _context24.next = 10;
57476
57662
  break;
57477
57663
  }
57478
57664
  entry = gridLabel ? findGridEntry(root, gridLabel) : root.gridRegistry.entries[0];
57479
57665
  api = entry === null || entry === void 0 || (_entry$getHandle5 = entry.getHandle()) === null || _entry$getHandle5 === void 0 ? void 0 : _entry$getHandle5.getGridApi();
57480
57666
  if (!api) {
57481
- _context22.next = 6;
57667
+ _context24.next = 6;
57482
57668
  break;
57483
57669
  }
57484
- return _context22.abrupt("return", api);
57670
+ return _context24.abrupt("return", api);
57485
57671
  case 6:
57486
- _context22.next = 8;
57672
+ _context24.next = 8;
57487
57673
  return sleep(250);
57488
57674
  case 8:
57489
- _context22.next = 1;
57675
+ _context24.next = 1;
57490
57676
  break;
57491
57677
  case 10:
57492
- return _context22.abrupt("return", undefined);
57678
+ return _context24.abrupt("return", undefined);
57493
57679
  case 11:
57494
57680
  case "end":
57495
- return _context22.stop();
57681
+ return _context24.stop();
57496
57682
  }
57497
- }, _callee15);
57683
+ }, _callee16);
57498
57684
  }));
57499
57685
  return _waitForGrid.apply(this, arguments);
57500
57686
  }
57501
- function waitForDeclaredParent(_x34, _x35, _x36, _x37, _x38) {
57687
+ function waitForDeclaredParent(_x38, _x39, _x40, _x41, _x42) {
57502
57688
  return _waitForDeclaredParent.apply(this, arguments);
57503
57689
  }
57504
57690
  /**
@@ -57508,53 +57694,53 @@ function waitForDeclaredParent(_x34, _x35, _x36, _x37, _x38) {
57508
57694
  * is already on screen.
57509
57695
  */
57510
57696
  function _waitForDeclaredParent() {
57511
- _waitForDeclaredParent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(root, gridRef, parentApi, parentNode, timeoutMs) {
57512
- var deadline, label, mismatch, _entry$getBoundParent, entry, declared, _cellValueOf4, _declared$value, expected;
57513
- return _regeneratorRuntime.wrap(function _callee16$(_context23) {
57514
- while (1) switch (_context23.prev = _context23.next) {
57697
+ _waitForDeclaredParent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17(root, gridRef, parentApi, parentNode, timeoutMs) {
57698
+ var deadline, label, mismatch, _entry$getBoundParent, entry, declared, _cellValueOf3, _declared$value, expected;
57699
+ return _regeneratorRuntime.wrap(function _callee17$(_context25) {
57700
+ while (1) switch (_context25.prev = _context25.next) {
57515
57701
  case 0:
57516
57702
  deadline = Date.now() + timeoutMs;
57517
57703
  label = gridRef;
57518
57704
  mismatch = 'no bound parent row';
57519
57705
  case 3:
57520
57706
  if (!(Date.now() < deadline)) {
57521
- _context23.next = 18;
57707
+ _context25.next = 18;
57522
57708
  break;
57523
57709
  }
57524
57710
  entry = findGridEntry(root, gridRef);
57525
57711
  if (!(entry && !entry.getBoundParent)) {
57526
- _context23.next = 7;
57712
+ _context25.next = 7;
57527
57713
  break;
57528
57714
  }
57529
- return _context23.abrupt("return", undefined);
57715
+ return _context25.abrupt("return", undefined);
57530
57716
  case 7:
57531
57717
  declared = entry === null || entry === void 0 || (_entry$getBoundParent = entry.getBoundParent) === null || _entry$getBoundParent === void 0 ? void 0 : _entry$getBoundParent.call(entry);
57532
57718
  if (!(entry && declared)) {
57533
- _context23.next = 14;
57719
+ _context25.next = 14;
57534
57720
  break;
57535
57721
  }
57536
- expected = String((_cellValueOf4 = cellValueOf(parentApi, parentNode, declared.column)) !== null && _cellValueOf4 !== void 0 ? _cellValueOf4 : '');
57722
+ expected = String((_cellValueOf3 = cellValueOf(parentApi, parentNode, declared.column)) !== null && _cellValueOf3 !== void 0 ? _cellValueOf3 : '');
57537
57723
  if (!(expected && declared.value === expected)) {
57538
- _context23.next = 12;
57724
+ _context25.next = 12;
57539
57725
  break;
57540
57726
  }
57541
- return _context23.abrupt("return", undefined);
57727
+ return _context25.abrupt("return", undefined);
57542
57728
  case 12:
57543
57729
  label = entry.label;
57544
57730
  mismatch = "".concat(declared.column, " = '").concat((_declared$value = declared.value) !== null && _declared$value !== void 0 ? _declared$value : '', "', not the located row's '").concat(expected, "'");
57545
57731
  case 14:
57546
- _context23.next = 16;
57732
+ _context25.next = 16;
57547
57733
  return sleep(250);
57548
57734
  case 16:
57549
- _context23.next = 3;
57735
+ _context25.next = 3;
57550
57736
  break;
57551
57737
  case 18:
57552
- return _context23.abrupt("return", "parentRow: the '".concat(label, "' subtable still shows ").concat(mismatch, ", after waiting ").concat(timeoutMs, " ms \u2014 it did not switch to the selected parent in time. Nothing was read or staged."));
57738
+ return _context25.abrupt("return", "parentRow: the '".concat(label, "' subtable still shows ").concat(mismatch, ", after waiting ").concat(timeoutMs, " ms \u2014 it did not switch to the selected parent in time. Nothing was read or staged."));
57553
57739
  case 19:
57554
57740
  case "end":
57555
- return _context23.stop();
57741
+ return _context25.stop();
57556
57742
  }
57557
- }, _callee16);
57743
+ }, _callee17);
57558
57744
  }));
57559
57745
  return _waitForDeclaredParent.apply(this, arguments);
57560
57746
  }
@@ -57568,7 +57754,7 @@ function gridIdentity(entry) {
57568
57754
  * other helpers resolve FIRST — its gridId, or the label only when it has none. Returning the label would hand a
57569
57755
  * colliding name straight back to waitForGrid/resolveGrid, which then pick the parent grid of the same label.
57570
57756
  */
57571
- function waitForNewGrid(_x39, _x40, _x41) {
57757
+ function waitForNewGrid(_x43, _x44, _x45) {
57572
57758
  return _waitForNewGrid.apply(this, arguments);
57573
57759
  }
57574
57760
  /**
@@ -57576,50 +57762,50 @@ function waitForNewGrid(_x39, _x40, _x41) {
57576
57762
  * waits for the table, then locates + selects the row (subtable deep-links carry tool/subGrid/subColumn/subValue).
57577
57763
  */
57578
57764
  function _waitForNewGrid() {
57579
- _waitForNewGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17(root, before, timeoutMs) {
57765
+ _waitForNewGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18(root, before, timeoutMs) {
57580
57766
  var deadline, fresh;
57581
- return _regeneratorRuntime.wrap(function _callee17$(_context24) {
57582
- while (1) switch (_context24.prev = _context24.next) {
57767
+ return _regeneratorRuntime.wrap(function _callee18$(_context26) {
57768
+ while (1) switch (_context26.prev = _context26.next) {
57583
57769
  case 0:
57584
57770
  deadline = Date.now() + timeoutMs;
57585
57771
  case 1:
57586
57772
  if (!(Date.now() < deadline)) {
57587
- _context24.next = 9;
57773
+ _context26.next = 9;
57588
57774
  break;
57589
57775
  }
57590
57776
  fresh = root.gridRegistry.entries.find(function (entry) {
57591
57777
  return !before.has(gridIdentity(entry));
57592
57778
  });
57593
57779
  if (!fresh) {
57594
- _context24.next = 5;
57780
+ _context26.next = 5;
57595
57781
  break;
57596
57782
  }
57597
- return _context24.abrupt("return", gridIdentity(fresh));
57783
+ return _context26.abrupt("return", gridIdentity(fresh));
57598
57784
  case 5:
57599
- _context24.next = 7;
57785
+ _context26.next = 7;
57600
57786
  return sleep(250);
57601
57787
  case 7:
57602
- _context24.next = 1;
57788
+ _context26.next = 1;
57603
57789
  break;
57604
57790
  case 9:
57605
- return _context24.abrupt("return", undefined);
57791
+ return _context26.abrupt("return", undefined);
57606
57792
  case 10:
57607
57793
  case "end":
57608
- return _context24.stop();
57794
+ return _context26.stop();
57609
57795
  }
57610
- }, _callee17);
57796
+ }, _callee18);
57611
57797
  }));
57612
57798
  return _waitForNewGrid.apply(this, arguments);
57613
57799
  }
57614
- function showEntityFromLink(_x42, _x43) {
57800
+ function showEntityFromLink(_x46, _x47) {
57615
57801
  return _showEntityFromLink.apply(this, arguments);
57616
57802
  }
57617
57803
  function _showEntityFromLink() {
57618
- _showEntityFromLink = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18(root, href) {
57804
+ _showEntityFromLink = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19(root, href) {
57619
57805
  var _params$get, _params$get2, _params$get3, _params$get4, _params$get5, _params$get6, _params$get7, _params$get8;
57620
- var params, targetPath, grid, column, value, targetMissing, api, _yield$locateRowCore$, parentNode, toolId, toolDeadline, opened, _i16, _arr4, bar, tool, subGrid, subColumn, subValue, subApi;
57621
- return _regeneratorRuntime.wrap(function _callee18$(_context25) {
57622
- while (1) switch (_context25.prev = _context25.next) {
57806
+ var params, targetPath, grid, column, value, targetMissing, api, _yield$locateRowCore$, parentNode, toolId, toolDeadline, opened, _i17, _arr5, bar, tool, subGrid, subColumn, subValue, subApi;
57807
+ return _regeneratorRuntime.wrap(function _callee19$(_context27) {
57808
+ while (1) switch (_context27.prev = _context27.next) {
57623
57809
  case 0:
57624
57810
  params = new URL(href).searchParams;
57625
57811
  targetPath = ((_params$get = params.get('path')) !== null && _params$get !== void 0 ? _params$get : '').replace(/^\//, '');
@@ -57627,7 +57813,7 @@ function _showEntityFromLink() {
57627
57813
  column = (_params$get3 = params.get('column')) !== null && _params$get3 !== void 0 ? _params$get3 : '';
57628
57814
  value = (_params$get4 = params.get('value')) !== null && _params$get4 !== void 0 ? _params$get4 : ''; // Model-derived path — same whitelist as navigateTo.
57629
57815
  if (!(targetPath && !isKnownPath(root, targetPath))) {
57630
- _context25.next = 7;
57816
+ _context27.next = 7;
57631
57817
  break;
57632
57818
  }
57633
57819
  throw new Error("entity link targets unknown path '".concat(targetPath, "'"));
@@ -57637,16 +57823,16 @@ function _showEntityFromLink() {
57637
57823
  root.navigate('/' + targetPath);
57638
57824
  }
57639
57825
  if (!(!column || !value)) {
57640
- _context25.next = 10;
57826
+ _context27.next = 10;
57641
57827
  break;
57642
57828
  }
57643
- return _context25.abrupt("return");
57829
+ return _context27.abrupt("return");
57644
57830
  case 10:
57645
57831
  if (!(value === column)) {
57646
- _context25.next = 12;
57832
+ _context27.next = 12;
57647
57833
  break;
57648
57834
  }
57649
- return _context25.abrupt("return");
57835
+ return _context27.abrupt("return");
57650
57836
  case 12:
57651
57837
  // Locate failures past this point happen AFTER a successful navigation — mark them so the
57652
57838
  // caller can report "view opened, row not found" instead of a dead link.
@@ -57655,25 +57841,25 @@ function _showEntityFromLink() {
57655
57841
  entityLinkTargetMissing: true
57656
57842
  });
57657
57843
  };
57658
- _context25.next = 15;
57844
+ _context27.next = 15;
57659
57845
  return waitForGrid(root, grid, 10000);
57660
57846
  case 15:
57661
- api = _context25.sent;
57847
+ api = _context27.sent;
57662
57848
  if (api) {
57663
- _context25.next = 18;
57849
+ _context27.next = 18;
57664
57850
  break;
57665
57851
  }
57666
57852
  throw targetMissing("entity link: table '".concat(grid !== null && grid !== void 0 ? grid : '', "' not found on '").concat(targetPath, "'"));
57667
57853
  case 18:
57668
- _context25.next = 20;
57854
+ _context27.next = 20;
57669
57855
  return locateRowCore(api, column, value)["catch"](function (e) {
57670
57856
  throw targetMissing(e instanceof Error ? e.message : String(e));
57671
57857
  });
57672
57858
  case 20:
57673
- _yield$locateRowCore$ = _context25.sent;
57859
+ _yield$locateRowCore$ = _context27.sent;
57674
57860
  parentNode = _yield$locateRowCore$.node;
57675
57861
  if (parentNode) {
57676
- _context25.next = 24;
57862
+ _context27.next = 24;
57677
57863
  break;
57678
57864
  }
57679
57865
  throw targetMissing("entity link: no row with ".concat(column, "='").concat(value, "' in '").concat(grid !== null && grid !== void 0 ? grid : '', "'"));
@@ -57681,75 +57867,75 @@ function _showEntityFromLink() {
57681
57867
  // Subtable chain: the parent selection reveals a conditional toolbar tool — open it, then locate inside it.
57682
57868
  toolId = (_params$get5 = params.get('tool')) !== null && _params$get5 !== void 0 ? _params$get5 : params.get('subGrid');
57683
57869
  if (toolId) {
57684
- _context25.next = 27;
57870
+ _context27.next = 27;
57685
57871
  break;
57686
57872
  }
57687
- return _context25.abrupt("return");
57873
+ return _context27.abrupt("return");
57688
57874
  case 27:
57689
57875
  toolDeadline = Date.now() + 5000;
57690
57876
  opened = false;
57691
57877
  case 29:
57692
57878
  if (!(Date.now() < toolDeadline && !opened)) {
57693
- _context25.next = 47;
57879
+ _context27.next = 47;
57694
57880
  break;
57695
57881
  }
57696
- _i16 = 0, _arr4 = [root.contentStore.rightToolBar, root.contentStore.bottomToolBar];
57882
+ _i17 = 0, _arr5 = [root.contentStore.rightToolBar, root.contentStore.bottomToolBar];
57697
57883
  case 31:
57698
- if (!(_i16 < _arr4.length)) {
57699
- _context25.next = 42;
57884
+ if (!(_i17 < _arr5.length)) {
57885
+ _context27.next = 42;
57700
57886
  break;
57701
57887
  }
57702
- bar = _arr4[_i16];
57888
+ bar = _arr5[_i17];
57703
57889
  tool = bar.tools.find(function (candidate) {
57704
57890
  return candidate.id.toLowerCase() === toolId.toLowerCase();
57705
57891
  });
57706
57892
  if (!tool) {
57707
- _context25.next = 39;
57893
+ _context27.next = 39;
57708
57894
  break;
57709
57895
  }
57710
57896
  bar.selectTool(tool.id);
57711
57897
  bar.hidden = false;
57712
57898
  opened = true;
57713
- return _context25.abrupt("break", 42);
57899
+ return _context27.abrupt("break", 42);
57714
57900
  case 39:
57715
- _i16++;
57716
- _context25.next = 31;
57901
+ _i17++;
57902
+ _context27.next = 31;
57717
57903
  break;
57718
57904
  case 42:
57719
57905
  if (opened) {
57720
- _context25.next = 45;
57906
+ _context27.next = 45;
57721
57907
  break;
57722
57908
  }
57723
- _context25.next = 45;
57909
+ _context27.next = 45;
57724
57910
  return sleep(250);
57725
57911
  case 45:
57726
- _context25.next = 29;
57912
+ _context27.next = 29;
57727
57913
  break;
57728
57914
  case 47:
57729
57915
  subGrid = (_params$get6 = params.get('subGrid')) !== null && _params$get6 !== void 0 ? _params$get6 : undefined;
57730
57916
  subColumn = (_params$get7 = params.get('subColumn')) !== null && _params$get7 !== void 0 ? _params$get7 : '';
57731
57917
  subValue = (_params$get8 = params.get('subValue')) !== null && _params$get8 !== void 0 ? _params$get8 : '';
57732
57918
  if (!(!opened || !subColumn || !subValue)) {
57733
- _context25.next = 52;
57919
+ _context27.next = 52;
57734
57920
  break;
57735
57921
  }
57736
- return _context25.abrupt("return");
57922
+ return _context27.abrupt("return");
57737
57923
  case 52:
57738
- _context25.next = 54;
57924
+ _context27.next = 54;
57739
57925
  return waitForGrid(root, subGrid, 10000);
57740
57926
  case 54:
57741
- subApi = _context25.sent;
57927
+ subApi = _context27.sent;
57742
57928
  if (!subApi) {
57743
- _context25.next = 58;
57929
+ _context27.next = 58;
57744
57930
  break;
57745
57931
  }
57746
- _context25.next = 58;
57932
+ _context27.next = 58;
57747
57933
  return locateRowCore(subApi, subColumn, subValue);
57748
57934
  case 58:
57749
57935
  case "end":
57750
- return _context25.stop();
57936
+ return _context27.stop();
57751
57937
  }
57752
- }, _callee18);
57938
+ }, _callee19);
57753
57939
  }));
57754
57940
  return _showEntityFromLink.apply(this, arguments);
57755
57941
  }