@orchestrator-ui/orchestrator-ui-components 5.8.0 → 5.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -241,7 +241,7 @@ var require_xlink = __commonJS({
241
241
  xLinkType: null
242
242
  }
243
243
  });
244
- function xlinkTransform(_2, prop2) {
244
+ function xlinkTransform(_5, prop2) {
245
245
  return "xlink:" + prop2.slice(5).toLowerCase();
246
246
  }
247
247
  }
@@ -261,7 +261,7 @@ var require_xml = __commonJS({
261
261
  xmlSpace: null
262
262
  }
263
263
  });
264
- function xmlTransform(_2, prop2) {
264
+ function xmlTransform(_5, prop2) {
265
265
  return "xml:" + prop2.slice(3).toLowerCase();
266
266
  }
267
267
  }
@@ -373,7 +373,7 @@ var require_aria = __commonJS({
373
373
  role: null
374
374
  }
375
375
  });
376
- function ariaTransform(_2, prop2) {
376
+ function ariaTransform(_5, prop2) {
377
377
  return prop2 === "role" ? prop2 : "aria-" + prop2.slice(4).toLowerCase();
378
378
  }
379
379
  }
@@ -3835,7 +3835,7 @@ var require_prism_core = __commonJS({
3835
3835
  var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
3836
3836
  var uniqueId = 0;
3837
3837
  var plainTextGrammar = {};
3838
- var _2 = {
3838
+ var _5 = {
3839
3839
  /**
3840
3840
  * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
3841
3841
  * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
@@ -3944,9 +3944,9 @@ var require_prism_core = __commonJS({
3944
3944
  visited = visited || {};
3945
3945
  var clone;
3946
3946
  var id;
3947
- switch (_2.util.type(o)) {
3947
+ switch (_5.util.type(o)) {
3948
3948
  case "Object":
3949
- id = _2.util.objId(o);
3949
+ id = _5.util.objId(o);
3950
3950
  if (visited[id]) {
3951
3951
  return visited[id];
3952
3952
  }
@@ -3963,7 +3963,7 @@ var require_prism_core = __commonJS({
3963
3963
  clone
3964
3964
  );
3965
3965
  case "Array":
3966
- id = _2.util.objId(o);
3966
+ id = _5.util.objId(o);
3967
3967
  if (visited[id]) {
3968
3968
  return visited[id];
3969
3969
  }
@@ -4121,7 +4121,7 @@ var require_prism_core = __commonJS({
4121
4121
  * });
4122
4122
  */
4123
4123
  extend: function(id, redef) {
4124
- var lang2 = _2.util.clone(_2.languages[id]);
4124
+ var lang2 = _5.util.clone(_5.languages[id]);
4125
4125
  for (var key in redef) {
4126
4126
  lang2[key] = redef[key];
4127
4127
  }
@@ -4204,7 +4204,7 @@ var require_prism_core = __commonJS({
4204
4204
  */
4205
4205
  insertBefore: function(inside, before, insert2, root) {
4206
4206
  root = root || /** @type {any} */
4207
- _2.languages;
4207
+ _5.languages;
4208
4208
  var grammar = root[inside];
4209
4209
  var ret = {};
4210
4210
  for (var token in grammar) {
@@ -4223,7 +4223,7 @@ var require_prism_core = __commonJS({
4223
4223
  }
4224
4224
  var old = root[inside];
4225
4225
  root[inside] = ret;
4226
- _2.languages.DFS(_2.languages, function(key, value) {
4226
+ _5.languages.DFS(_5.languages, function(key, value) {
4227
4227
  if (value === old && key != inside) {
4228
4228
  this[key] = ret;
4229
4229
  }
@@ -4233,12 +4233,12 @@ var require_prism_core = __commonJS({
4233
4233
  // Traverse a language definition with Depth First Search
4234
4234
  DFS: function DFS(o, callback, type, visited) {
4235
4235
  visited = visited || {};
4236
- var objId = _2.util.objId;
4236
+ var objId = _5.util.objId;
4237
4237
  for (var i in o) {
4238
4238
  if (o.hasOwnProperty(i)) {
4239
4239
  callback.call(o, i, o[i], type || i);
4240
4240
  var property = o[i];
4241
- var propertyType = _2.util.type(property);
4241
+ var propertyType = _5.util.type(property);
4242
4242
  if (propertyType === "Object" && !visited[objId(property)]) {
4243
4243
  visited[objId(property)] = true;
4244
4244
  DFS(property, callback, null, visited);
@@ -4264,7 +4264,7 @@ var require_prism_core = __commonJS({
4264
4264
  * @public
4265
4265
  */
4266
4266
  highlightAll: function(async, callback) {
4267
- _2.highlightAllUnder(document, async, callback);
4267
+ _5.highlightAllUnder(document, async, callback);
4268
4268
  },
4269
4269
  /**
4270
4270
  * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
@@ -4287,11 +4287,11 @@ var require_prism_core = __commonJS({
4287
4287
  container,
4288
4288
  selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
4289
4289
  };
4290
- _2.hooks.run("before-highlightall", env);
4290
+ _5.hooks.run("before-highlightall", env);
4291
4291
  env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
4292
- _2.hooks.run("before-all-elements-highlight", env);
4292
+ _5.hooks.run("before-all-elements-highlight", env);
4293
4293
  for (var i = 0, element; element = env.elements[i++]; ) {
4294
- _2.highlightElement(element, async === true, env.callback);
4294
+ _5.highlightElement(element, async === true, env.callback);
4295
4295
  }
4296
4296
  },
4297
4297
  /**
@@ -4323,12 +4323,12 @@ var require_prism_core = __commonJS({
4323
4323
  * @public
4324
4324
  */
4325
4325
  highlightElement: function(element, async, callback) {
4326
- var language = _2.util.getLanguage(element);
4327
- var grammar = _2.languages[language];
4328
- _2.util.setLanguage(element, language);
4326
+ var language = _5.util.getLanguage(element);
4327
+ var grammar = _5.languages[language];
4328
+ _5.util.setLanguage(element, language);
4329
4329
  var parent = element.parentElement;
4330
4330
  if (parent && parent.nodeName.toLowerCase() === "pre") {
4331
- _2.util.setLanguage(parent, language);
4331
+ _5.util.setLanguage(parent, language);
4332
4332
  }
4333
4333
  var code = element.textContent;
4334
4334
  var env = {
@@ -4339,29 +4339,29 @@ var require_prism_core = __commonJS({
4339
4339
  };
4340
4340
  function insertHighlightedCode(highlightedCode) {
4341
4341
  env.highlightedCode = highlightedCode;
4342
- _2.hooks.run("before-insert", env);
4342
+ _5.hooks.run("before-insert", env);
4343
4343
  env.element.innerHTML = env.highlightedCode;
4344
- _2.hooks.run("after-highlight", env);
4345
- _2.hooks.run("complete", env);
4344
+ _5.hooks.run("after-highlight", env);
4345
+ _5.hooks.run("complete", env);
4346
4346
  callback && callback.call(env.element);
4347
4347
  }
4348
- _2.hooks.run("before-sanity-check", env);
4348
+ _5.hooks.run("before-sanity-check", env);
4349
4349
  parent = env.element.parentElement;
4350
4350
  if (parent && parent.nodeName.toLowerCase() === "pre" && !parent.hasAttribute("tabindex")) {
4351
4351
  parent.setAttribute("tabindex", "0");
4352
4352
  }
4353
4353
  if (!env.code) {
4354
- _2.hooks.run("complete", env);
4354
+ _5.hooks.run("complete", env);
4355
4355
  callback && callback.call(env.element);
4356
4356
  return;
4357
4357
  }
4358
- _2.hooks.run("before-highlight", env);
4358
+ _5.hooks.run("before-highlight", env);
4359
4359
  if (!env.grammar) {
4360
- insertHighlightedCode(_2.util.encode(env.code));
4360
+ insertHighlightedCode(_5.util.encode(env.code));
4361
4361
  return;
4362
4362
  }
4363
4363
  if (async && _self2.Worker) {
4364
- var worker = new Worker(_2.filename);
4364
+ var worker = new Worker(_5.filename);
4365
4365
  worker.onmessage = function(evt) {
4366
4366
  insertHighlightedCode(evt.data);
4367
4367
  };
@@ -4371,7 +4371,7 @@ var require_prism_core = __commonJS({
4371
4371
  immediateClose: true
4372
4372
  }));
4373
4373
  } else {
4374
- insertHighlightedCode(_2.highlight(env.code, env.grammar, env.language));
4374
+ insertHighlightedCode(_5.highlight(env.code, env.grammar, env.language));
4375
4375
  }
4376
4376
  },
4377
4377
  /**
@@ -4400,13 +4400,13 @@ var require_prism_core = __commonJS({
4400
4400
  grammar,
4401
4401
  language
4402
4402
  };
4403
- _2.hooks.run("before-tokenize", env);
4403
+ _5.hooks.run("before-tokenize", env);
4404
4404
  if (!env.grammar) {
4405
4405
  throw new Error('The language "' + env.language + '" has no grammar.');
4406
4406
  }
4407
- env.tokens = _2.tokenize(env.code, env.grammar);
4408
- _2.hooks.run("after-tokenize", env);
4409
- return Token.stringify(_2.util.encode(env.tokens), env.language);
4407
+ env.tokens = _5.tokenize(env.code, env.grammar);
4408
+ _5.hooks.run("after-tokenize", env);
4409
+ return Token.stringify(_5.util.encode(env.tokens), env.language);
4410
4410
  },
4411
4411
  /**
4412
4412
  * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
@@ -4465,7 +4465,7 @@ var require_prism_core = __commonJS({
4465
4465
  * @public
4466
4466
  */
4467
4467
  add: function(name, callback) {
4468
- var hooks = _2.hooks.all;
4468
+ var hooks = _5.hooks.all;
4469
4469
  hooks[name] = hooks[name] || [];
4470
4470
  hooks[name].push(callback);
4471
4471
  },
@@ -4479,7 +4479,7 @@ var require_prism_core = __commonJS({
4479
4479
  * @public
4480
4480
  */
4481
4481
  run: function(name, env) {
4482
- var callbacks = _2.hooks.all[name];
4482
+ var callbacks = _5.hooks.all[name];
4483
4483
  if (!callbacks || !callbacks.length) {
4484
4484
  return;
4485
4485
  }
@@ -4490,7 +4490,7 @@ var require_prism_core = __commonJS({
4490
4490
  },
4491
4491
  Token
4492
4492
  };
4493
- _self2.Prism = _2;
4493
+ _self2.Prism = _5;
4494
4494
  function Token(type, content, alias, matchedStr) {
4495
4495
  this.type = type;
4496
4496
  this.content = content;
@@ -4524,7 +4524,7 @@ var require_prism_core = __commonJS({
4524
4524
  env.classes.push(aliases);
4525
4525
  }
4526
4526
  }
4527
- _2.hooks.run("wrap", env);
4527
+ _5.hooks.run("wrap", env);
4528
4528
  var attributes = "";
4529
4529
  for (var name in env.attributes) {
4530
4530
  attributes += " " + name + '="' + (env.attributes[name] || "").replace(/"/g, """) + '"';
@@ -4620,7 +4620,7 @@ var require_prism_core = __commonJS({
4620
4620
  pos += before.length;
4621
4621
  }
4622
4622
  removeRange(tokenList, removeFrom, removeCount);
4623
- var wrapped = new Token(token, inside ? _2.tokenize(matchStr, inside) : matchStr, alias, matchStr);
4623
+ var wrapped = new Token(token, inside ? _5.tokenize(matchStr, inside) : matchStr, alias, matchStr);
4624
4624
  currentNode = addAfter(tokenList, removeFrom, wrapped);
4625
4625
  if (after) {
4626
4626
  addAfter(tokenList, currentNode, after);
@@ -4675,35 +4675,35 @@ var require_prism_core = __commonJS({
4675
4675
  }
4676
4676
  if (!_self2.document) {
4677
4677
  if (!_self2.addEventListener) {
4678
- return _2;
4678
+ return _5;
4679
4679
  }
4680
- if (!_2.disableWorkerMessageHandler) {
4680
+ if (!_5.disableWorkerMessageHandler) {
4681
4681
  _self2.addEventListener("message", function(evt) {
4682
4682
  var message = JSON.parse(evt.data);
4683
4683
  var lang2 = message.language;
4684
4684
  var code = message.code;
4685
4685
  var immediateClose = message.immediateClose;
4686
- _self2.postMessage(_2.highlight(code, _2.languages[lang2], lang2));
4686
+ _self2.postMessage(_5.highlight(code, _5.languages[lang2], lang2));
4687
4687
  if (immediateClose) {
4688
4688
  _self2.close();
4689
4689
  }
4690
4690
  }, false);
4691
4691
  }
4692
- return _2;
4692
+ return _5;
4693
4693
  }
4694
- var script = _2.util.currentScript();
4694
+ var script = _5.util.currentScript();
4695
4695
  if (script) {
4696
- _2.filename = script.src;
4696
+ _5.filename = script.src;
4697
4697
  if (script.hasAttribute("data-manual")) {
4698
- _2.manual = true;
4698
+ _5.manual = true;
4699
4699
  }
4700
4700
  }
4701
4701
  function highlightAutomaticallyCallback() {
4702
- if (!_2.manual) {
4703
- _2.highlightAll();
4702
+ if (!_5.manual) {
4703
+ _5.highlightAll();
4704
4704
  }
4705
4705
  }
4706
- if (!_2.manual) {
4706
+ if (!_5.manual) {
4707
4707
  var readyState = document.readyState;
4708
4708
  if (readyState === "loading" || readyState === "interactive" && script && script.defer) {
4709
4709
  document.addEventListener("DOMContentLoaded", highlightAutomaticallyCallback);
@@ -4715,7 +4715,7 @@ var require_prism_core = __commonJS({
4715
4715
  }
4716
4716
  }
4717
4717
  }
4718
- return _2;
4718
+ return _5;
4719
4719
  }(_self);
4720
4720
  if (typeof module !== "undefined" && module.exports) {
4721
4721
  module.exports = Prism;
@@ -26801,7 +26801,7 @@ var PolicyResource = /* @__PURE__ */ ((PolicyResource2) => {
26801
26801
  })(PolicyResource || {});
26802
26802
 
26803
26803
  // src/configuration/version.ts
26804
- var ORCHESTRATOR_UI_LIBRARY_VERSION = "5.8.0";
26804
+ var ORCHESTRATOR_UI_LIBRARY_VERSION = "5.9.0";
26805
26805
 
26806
26806
  // src/types/types.ts
26807
26807
  var EngineStatus = /* @__PURE__ */ ((EngineStatus3) => {
@@ -28698,7 +28698,7 @@ function createImmutableStateInvariantMiddleware(options = {}) {
28698
28698
  return JSON.stringify(obj, getSerialize2(serializer, decycler), indent);
28699
28699
  }, getSerialize2 = function(serializer, decycler) {
28700
28700
  let stack = [], keys = [];
28701
- if (!decycler) decycler = function(_2, value) {
28701
+ if (!decycler) decycler = function(_5, value) {
28702
28702
  if (stack[0] === value) return "[Circular ~]";
28703
28703
  return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
28704
28704
  };
@@ -29066,6 +29066,21 @@ function executeReducerBuilderCallback(builderCallback) {
29066
29066
  actionsMap[type] = reducer;
29067
29067
  return builder;
29068
29068
  },
29069
+ addAsyncThunk(asyncThunk, reducers) {
29070
+ if (process.env.NODE_ENV !== "production") {
29071
+ if (defaultCaseReducer) {
29072
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(43) : "`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");
29073
+ }
29074
+ }
29075
+ if (reducers.pending) actionsMap[asyncThunk.pending.type] = reducers.pending;
29076
+ if (reducers.rejected) actionsMap[asyncThunk.rejected.type] = reducers.rejected;
29077
+ if (reducers.fulfilled) actionsMap[asyncThunk.fulfilled.type] = reducers.fulfilled;
29078
+ if (reducers.settled) actionMatchers.push({
29079
+ matcher: asyncThunk.settled,
29080
+ reducer: reducers.settled
29081
+ });
29082
+ return builder;
29083
+ },
29069
29084
  addMatcher(matcher, reducer) {
29070
29085
  if (process.env.NODE_ENV !== "production") {
29071
29086
  if (defaultCaseReducer) {
@@ -29338,7 +29353,7 @@ var createAsyncThunk = /* @__PURE__ */ (() => {
29338
29353
  message: "Aborted due to condition callback returning false."
29339
29354
  };
29340
29355
  }
29341
- const abortedPromise = new Promise((_2, reject) => {
29356
+ const abortedPromise = new Promise((_5, reject) => {
29342
29357
  abortHandler = () => {
29343
29358
  reject({
29344
29359
  name: "AbortError",
@@ -29817,6 +29832,11 @@ function getOrInsert(map, key, value) {
29817
29832
  if (map.has(key)) return map.get(key);
29818
29833
  return map.set(key, value).get(key);
29819
29834
  }
29835
+ function getOrInsertComputed2(map, key, compute) {
29836
+ if (map.has(key)) return map.get(key);
29837
+ return map.set(key, compute(key)).get(key);
29838
+ }
29839
+ var createNewMap = () => /* @__PURE__ */ new Map();
29820
29840
  var defaultFetchFn = (...args) => fetch(...args);
29821
29841
  var defaultValidateStatus = (response) => response.status >= 200 && response.status <= 299;
29822
29842
  var defaultIsJsonContentType = (headers) => (
@@ -30028,10 +30048,13 @@ function buildInitiate({
30028
30048
  infiniteQueryThunk,
30029
30049
  mutationThunk,
30030
30050
  api,
30031
- context
30051
+ context,
30052
+ internalState
30032
30053
  }) {
30033
- const runningQueries = /* @__PURE__ */ new Map();
30034
- const runningMutations = /* @__PURE__ */ new Map();
30054
+ const {
30055
+ runningQueries,
30056
+ runningMutations
30057
+ } = internalState;
30035
30058
  const {
30036
30059
  unsubscribeQueryResult,
30037
30060
  removeMutationResult,
@@ -30266,6 +30289,7 @@ var NamedSchemaError = class extends SchemaError {
30266
30289
  this._bqMeta = _bqMeta;
30267
30290
  }
30268
30291
  };
30292
+ var shouldSkip = (skipSchemaValidation, schemaName) => Array.isArray(skipSchemaValidation) ? skipSchemaValidation.includes(schemaName) : !!skipSchemaValidation;
30269
30293
  async function parseWithSchema(schema, data, schemaName, bqMeta) {
30270
30294
  const result = await schema["~standard"].validate(data);
30271
30295
  if (result.issues) {
@@ -30397,7 +30421,7 @@ function buildThunks({
30397
30421
  skipSchemaValidation = globalSkipSchemaValidation
30398
30422
  } = endpointDefinition;
30399
30423
  try {
30400
- let transformResponse = getTransformCallbackForEndpoint(endpointDefinition, "transformResponse");
30424
+ let transformResponse = defaultTransformResponse;
30401
30425
  const baseQueryApi = {
30402
30426
  signal,
30403
30427
  abort,
@@ -30439,7 +30463,7 @@ function buildThunks({
30439
30463
  rawResponseSchema,
30440
30464
  responseSchema
30441
30465
  } = endpointDefinition;
30442
- if (argSchema && !skipSchemaValidation) {
30466
+ if (argSchema && !shouldSkip(skipSchemaValidation, "arg")) {
30443
30467
  finalQueryArg = await parseWithSchema(
30444
30468
  argSchema,
30445
30469
  finalQueryArg,
@@ -30451,6 +30475,7 @@ function buildThunks({
30451
30475
  if (forceQueryFn) {
30452
30476
  result = forceQueryFn();
30453
30477
  } else if (endpointDefinition.query) {
30478
+ transformResponse = getTransformCallbackForEndpoint(endpointDefinition, "transformResponse");
30454
30479
  result = await baseQuery(endpointDefinition.query(finalQueryArg), baseQueryApi, extraOptions);
30455
30480
  } else {
30456
30481
  result = await endpointDefinition.queryFn(finalQueryArg, baseQueryApi, extraOptions, (arg2) => baseQuery(arg2, baseQueryApi, extraOptions));
@@ -30485,11 +30510,11 @@ function buildThunks({
30485
30510
  let {
30486
30511
  data
30487
30512
  } = result;
30488
- if (rawResponseSchema && !skipSchemaValidation) {
30513
+ if (rawResponseSchema && !shouldSkip(skipSchemaValidation, "rawResponse")) {
30489
30514
  data = await parseWithSchema(rawResponseSchema, result.data, "rawResponseSchema", result.meta);
30490
30515
  }
30491
30516
  let transformedResponse = await transformResponse(data, result.meta, finalQueryArg);
30492
- if (responseSchema && !skipSchemaValidation) {
30517
+ if (responseSchema && !shouldSkip(skipSchemaValidation, "response")) {
30493
30518
  transformedResponse = await parseWithSchema(responseSchema, transformedResponse, "responseSchema", result.meta);
30494
30519
  }
30495
30520
  return {
@@ -30518,7 +30543,7 @@ function buildThunks({
30518
30543
  if ("direction" in arg && arg.direction && existingData.pages.length) {
30519
30544
  const previous = arg.direction === "backward";
30520
30545
  const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;
30521
- const param = pageParamFn(infiniteQueryOptions, existingData);
30546
+ const param = pageParamFn(infiniteQueryOptions, existingData, arg.originalArgs);
30522
30547
  result = await fetchPage(existingData, param, maxPages, previous);
30523
30548
  } else {
30524
30549
  const {
@@ -30534,7 +30559,7 @@ function buildThunks({
30534
30559
  };
30535
30560
  }
30536
30561
  for (let i = 1; i < totalPages; i++) {
30537
- const param = getNextPageParam(infiniteQueryOptions, result.data);
30562
+ const param = getNextPageParam(infiniteQueryOptions, result.data, arg.originalArgs);
30538
30563
  result = await fetchPage(result.data, param, maxPages);
30539
30564
  }
30540
30565
  }
@@ -30542,7 +30567,7 @@ function buildThunks({
30542
30567
  } else {
30543
30568
  finalQueryReturnValue = await executeRequest(arg.originalArgs);
30544
30569
  }
30545
- if (metaSchema && !skipSchemaValidation && finalQueryReturnValue.meta) {
30570
+ if (metaSchema && !shouldSkip(skipSchemaValidation, "meta") && finalQueryReturnValue.meta) {
30546
30571
  finalQueryReturnValue.meta = await parseWithSchema(metaSchema, finalQueryReturnValue.meta, "metaSchema", finalQueryReturnValue.meta);
30547
30572
  }
30548
30573
  return fulfillWithValue(finalQueryReturnValue.data, addShouldAutoBatch({
@@ -30562,14 +30587,14 @@ function buildThunks({
30562
30587
  meta
30563
30588
  } = caughtError;
30564
30589
  try {
30565
- if (rawErrorResponseSchema && !skipSchemaValidation) {
30590
+ if (rawErrorResponseSchema && !shouldSkip(skipSchemaValidation, "rawErrorResponse")) {
30566
30591
  value = await parseWithSchema(rawErrorResponseSchema, value, "rawErrorResponseSchema", meta);
30567
30592
  }
30568
- if (metaSchema && !skipSchemaValidation) {
30593
+ if (metaSchema && !shouldSkip(skipSchemaValidation, "meta")) {
30569
30594
  meta = await parseWithSchema(metaSchema, meta, "metaSchema", meta);
30570
30595
  }
30571
30596
  let transformedErrorResponse = await transformErrorResponse(value, meta, arg.originalArgs);
30572
- if (errorResponseSchema && !skipSchemaValidation) {
30597
+ if (errorResponseSchema && !shouldSkip(skipSchemaValidation, "errorResponse")) {
30573
30598
  transformedErrorResponse = await parseWithSchema(errorResponseSchema, transformedErrorResponse, "errorResponseSchema", meta);
30574
30599
  }
30575
30600
  return rejectWithValue(transformedErrorResponse, addShouldAutoBatch({
@@ -30731,15 +30756,15 @@ In the case of an unhandled error, no tags will be "provided" or "invalidated".`
30731
30756
  function getNextPageParam(options, {
30732
30757
  pages,
30733
30758
  pageParams
30734
- }) {
30759
+ }, queryArg) {
30735
30760
  const lastIndex = pages.length - 1;
30736
- return options.getNextPageParam(pages[lastIndex], pages, pageParams[lastIndex], pageParams);
30761
+ return options.getNextPageParam(pages[lastIndex], pages, pageParams[lastIndex], pageParams, queryArg);
30737
30762
  }
30738
30763
  function getPreviousPageParam(options, {
30739
30764
  pages,
30740
30765
  pageParams
30741
- }) {
30742
- return options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams);
30766
+ }, queryArg) {
30767
+ return options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams, queryArg);
30743
30768
  }
30744
30769
  function calculateProvidedByThunk(action, type, endpointDefinitions, assertTagType) {
30745
30770
  return calculateProvidedBy(endpointDefinitions[action.meta.arg.endpointName][type], isFulfilled(action) ? action.payload : void 0, isRejectedWithValue(action) ? action.payload : void 0, action.meta.arg.originalArgs, "baseQueryMeta" in action.meta ? action.meta.baseQueryMeta : void 0, assertTagType);
@@ -31084,7 +31109,7 @@ function buildSlice({
31084
31109
  const {
31085
31110
  provided
31086
31111
  } = extractRehydrationInfo(action);
31087
- for (const [type, incomingTags] of Object.entries(provided)) {
31112
+ for (const [type, incomingTags] of Object.entries(provided.tags ?? {})) {
31088
31113
  for (const [id, cacheKeys] of Object.entries(incomingTags)) {
31089
31114
  const subscribedQueries = (_b = (_a = draft.tags)[type] ?? (_a[type] = {}))[_c = id || "__internal_without_id"] ?? (_b[_c] = []);
31090
31115
  for (const queryCacheKey of cacheKeys) {
@@ -31092,6 +31117,7 @@ function buildSlice({
31092
31117
  if (!alreadySubscribed) {
31093
31118
  subscribedQueries.push(queryCacheKey);
31094
31119
  }
31120
+ draft.keys[queryCacheKey] = provided.keys[queryCacheKey];
31095
31121
  }
31096
31122
  }
31097
31123
  }
@@ -31308,8 +31334,8 @@ function buildSelectors({
31308
31334
  const isBackward = direction === "backward";
31309
31335
  return {
31310
31336
  ...stateWithRequestFlags,
31311
- hasNextPage: getHasNextPage(infiniteQueryOptions, stateWithRequestFlags.data),
31312
- hasPreviousPage: getHasPreviousPage(infiniteQueryOptions, stateWithRequestFlags.data),
31337
+ hasNextPage: getHasNextPage(infiniteQueryOptions, stateWithRequestFlags.data, stateWithRequestFlags.originalArgs),
31338
+ hasPreviousPage: getHasPreviousPage(infiniteQueryOptions, stateWithRequestFlags.data, stateWithRequestFlags.originalArgs),
31313
31339
  isFetchingNextPage: isLoading && isForward,
31314
31340
  isFetchingPreviousPage: isLoading && isBackward,
31315
31341
  isFetchNextPageError: isError2 && isForward,
@@ -31365,13 +31391,13 @@ function buildSelectors({
31365
31391
  /* uninitialized */
31366
31392
  ).map((entry) => entry.originalArgs);
31367
31393
  }
31368
- function getHasNextPage(options, data) {
31394
+ function getHasNextPage(options, data, queryArg) {
31369
31395
  if (!data) return false;
31370
- return getNextPageParam(options, data) != null;
31396
+ return getNextPageParam(options, data, queryArg) != null;
31371
31397
  }
31372
- function getHasPreviousPage(options, data) {
31398
+ function getHasPreviousPage(options, data, queryArg) {
31373
31399
  if (!data || !options.getPreviousPageParam) return false;
31374
- return getPreviousPageParam(options, data) != null;
31400
+ return getPreviousPageParam(options, data, queryArg) != null;
31375
31401
  }
31376
31402
  }
31377
31403
  var cache = WeakMap ? /* @__PURE__ */ new WeakMap() : void 0;
@@ -31539,7 +31565,8 @@ function safeAssign(target, ...args) {
31539
31565
  var buildBatchedActionsHandler = ({
31540
31566
  api,
31541
31567
  queryThunk,
31542
- internalState
31568
+ internalState,
31569
+ mwApi
31543
31570
  }) => {
31544
31571
  const subscriptionsPrefix = `${api.reducerPath}/subscriptions`;
31545
31572
  let previousSubscriptions = null;
@@ -31548,16 +31575,16 @@ var buildBatchedActionsHandler = ({
31548
31575
  updateSubscriptionOptions,
31549
31576
  unsubscribeQueryResult
31550
31577
  } = api.internalActions;
31551
- const actuallyMutateSubscriptions = (mutableState, action) => {
31552
- var _a, _b;
31578
+ const actuallyMutateSubscriptions = (currentSubscriptions, action) => {
31553
31579
  if (updateSubscriptionOptions.match(action)) {
31554
31580
  const {
31555
31581
  queryCacheKey,
31556
31582
  requestId,
31557
31583
  options
31558
31584
  } = action.payload;
31559
- if (mutableState?.[queryCacheKey]?.[requestId]) {
31560
- mutableState[queryCacheKey][requestId] = options;
31585
+ const sub = currentSubscriptions.get(queryCacheKey);
31586
+ if (sub?.has(requestId)) {
31587
+ sub.set(requestId, options);
31561
31588
  }
31562
31589
  return true;
31563
31590
  }
@@ -31566,13 +31593,14 @@ var buildBatchedActionsHandler = ({
31566
31593
  queryCacheKey,
31567
31594
  requestId
31568
31595
  } = action.payload;
31569
- if (mutableState[queryCacheKey]) {
31570
- delete mutableState[queryCacheKey][requestId];
31596
+ const sub = currentSubscriptions.get(queryCacheKey);
31597
+ if (sub) {
31598
+ sub.delete(requestId);
31571
31599
  }
31572
31600
  return true;
31573
31601
  }
31574
31602
  if (api.internalActions.removeQueryResult.match(action)) {
31575
- delete mutableState[action.payload.queryCacheKey];
31603
+ currentSubscriptions.delete(action.payload.queryCacheKey);
31576
31604
  return true;
31577
31605
  }
31578
31606
  if (queryThunk.pending.match(action)) {
@@ -31582,20 +31610,13 @@ var buildBatchedActionsHandler = ({
31582
31610
  requestId
31583
31611
  }
31584
31612
  } = action;
31585
- const substate = mutableState[_a = arg.queryCacheKey] ?? (mutableState[_a] = {});
31586
- substate[`${requestId}_running`] = {};
31613
+ const substate = getOrInsertComputed2(currentSubscriptions, arg.queryCacheKey, createNewMap);
31587
31614
  if (arg.subscribe) {
31588
- substate[requestId] = arg.subscriptionOptions ?? substate[requestId] ?? {};
31615
+ substate.set(requestId, arg.subscriptionOptions ?? substate.get(requestId) ?? {});
31589
31616
  }
31590
31617
  return true;
31591
31618
  }
31592
31619
  let mutated = false;
31593
- if (queryThunk.fulfilled.match(action) || queryThunk.rejected.match(action)) {
31594
- const state = mutableState[action.meta.arg.queryCacheKey] || {};
31595
- const key = `${action.meta.requestId}_running`;
31596
- mutated || (mutated = !!state[key]);
31597
- delete state[key];
31598
- }
31599
31620
  if (queryThunk.rejected.match(action)) {
31600
31621
  const {
31601
31622
  meta: {
@@ -31605,8 +31626,8 @@ var buildBatchedActionsHandler = ({
31605
31626
  }
31606
31627
  } = action;
31607
31628
  if (condition && arg.subscribe) {
31608
- const substate = mutableState[_b = arg.queryCacheKey] ?? (mutableState[_b] = {});
31609
- substate[requestId] = arg.subscriptionOptions ?? substate[requestId] ?? {};
31629
+ const substate = getOrInsertComputed2(currentSubscriptions, arg.queryCacheKey, createNewMap);
31630
+ substate.set(requestId, arg.subscriptionOptions ?? substate.get(requestId) ?? {});
31610
31631
  mutated = true;
31611
31632
  }
31612
31633
  }
@@ -31615,24 +31636,28 @@ var buildBatchedActionsHandler = ({
31615
31636
  const getSubscriptions = () => internalState.currentSubscriptions;
31616
31637
  const getSubscriptionCount = (queryCacheKey) => {
31617
31638
  const subscriptions = getSubscriptions();
31618
- const subscriptionsForQueryArg = subscriptions[queryCacheKey] ?? {};
31619
- return countObjectKeys(subscriptionsForQueryArg);
31639
+ const subscriptionsForQueryArg = subscriptions.get(queryCacheKey);
31640
+ return subscriptionsForQueryArg?.size ?? 0;
31620
31641
  };
31621
31642
  const isRequestSubscribed = (queryCacheKey, requestId) => {
31622
31643
  const subscriptions = getSubscriptions();
31623
- return !!subscriptions?.[queryCacheKey]?.[requestId];
31644
+ return !!subscriptions?.get(queryCacheKey)?.get(requestId);
31624
31645
  };
31625
31646
  const subscriptionSelectors = {
31626
31647
  getSubscriptions,
31627
31648
  getSubscriptionCount,
31628
31649
  isRequestSubscribed
31629
31650
  };
31630
- return (action, mwApi) => {
31651
+ function serializeSubscriptions(currentSubscriptions) {
31652
+ return JSON.parse(JSON.stringify(Object.fromEntries([...currentSubscriptions].map(([k, v]) => [k, Object.fromEntries(v)]))));
31653
+ }
31654
+ return (action, mwApi2) => {
31631
31655
  if (!previousSubscriptions) {
31632
- previousSubscriptions = JSON.parse(JSON.stringify(internalState.currentSubscriptions));
31656
+ previousSubscriptions = serializeSubscriptions(internalState.currentSubscriptions);
31633
31657
  }
31634
31658
  if (api.util.resetApiState.match(action)) {
31635
- previousSubscriptions = internalState.currentSubscriptions = {};
31659
+ previousSubscriptions = {};
31660
+ internalState.currentSubscriptions.clear();
31636
31661
  updateSyncTimer = null;
31637
31662
  return [true, false];
31638
31663
  }
@@ -31641,12 +31666,15 @@ var buildBatchedActionsHandler = ({
31641
31666
  }
31642
31667
  const didMutate = actuallyMutateSubscriptions(internalState.currentSubscriptions, action);
31643
31668
  let actionShouldContinue = true;
31669
+ if (process.env.NODE_ENV === "test" && typeof action.type === "string" && action.type === `${api.reducerPath}/getPolling`) {
31670
+ return [false, internalState.currentPolls];
31671
+ }
31644
31672
  if (didMutate) {
31645
31673
  if (!updateSyncTimer) {
31646
31674
  updateSyncTimer = setTimeout(() => {
31647
- const newSubscriptions = JSON.parse(JSON.stringify(internalState.currentSubscriptions));
31675
+ const newSubscriptions = serializeSubscriptions(internalState.currentSubscriptions);
31648
31676
  const [, patches] = produceWithPatches(previousSubscriptions, () => newSubscriptions);
31649
- mwApi.next(api.internalActions.subscriptionsUpdated(patches));
31677
+ mwApi2.next(api.internalActions.subscriptionsUpdated(patches));
31650
31678
  previousSubscriptions = newSubscriptions;
31651
31679
  updateSyncTimer = null;
31652
31680
  }, 500);
@@ -31658,12 +31686,6 @@ var buildBatchedActionsHandler = ({
31658
31686
  return [actionShouldContinue, false];
31659
31687
  };
31660
31688
  };
31661
- function isObjectEmpty(obj) {
31662
- for (const k in obj) {
31663
- return false;
31664
- }
31665
- return true;
31666
- }
31667
31689
  var THIRTY_TWO_BIT_MAX_TIMER_SECONDS = 2147483647 / 1e3 - 1;
31668
31690
  var buildCacheCollectionHandler = ({
31669
31691
  reducerPath,
@@ -31674,21 +31696,29 @@ var buildCacheCollectionHandler = ({
31674
31696
  selectors: {
31675
31697
  selectQueryEntry,
31676
31698
  selectConfig
31677
- }
31699
+ },
31700
+ getRunningQueryThunk,
31701
+ mwApi
31678
31702
  }) => {
31679
31703
  const {
31680
31704
  removeQueryResult,
31681
31705
  unsubscribeQueryResult,
31682
31706
  cacheEntriesUpserted
31683
31707
  } = api.internalActions;
31708
+ const runningQueries = internalState.runningQueries.get(mwApi.dispatch);
31684
31709
  const canTriggerUnsubscribe = isAnyOf(unsubscribeQueryResult.match, queryThunk.fulfilled, queryThunk.rejected, cacheEntriesUpserted.match);
31685
31710
  function anySubscriptionsRemainingForKey(queryCacheKey) {
31686
- const subscriptions = internalState.currentSubscriptions[queryCacheKey];
31687
- return !!subscriptions && !isObjectEmpty(subscriptions);
31711
+ const subscriptions = internalState.currentSubscriptions.get(queryCacheKey);
31712
+ if (!subscriptions) {
31713
+ return false;
31714
+ }
31715
+ const hasSubscriptions = subscriptions.size > 0;
31716
+ const isRunning = runningQueries?.[queryCacheKey] !== void 0;
31717
+ return hasSubscriptions || isRunning;
31688
31718
  }
31689
31719
  const currentRemovalTimeouts = {};
31690
- const handler = (action, mwApi, internalState2) => {
31691
- const state = mwApi.getState();
31720
+ const handler = (action, mwApi2, internalState2) => {
31721
+ const state = mwApi2.getState();
31692
31722
  const config = selectConfig(state);
31693
31723
  if (canTriggerUnsubscribe(action)) {
31694
31724
  let queryCacheKeys;
@@ -31700,7 +31730,7 @@ var buildCacheCollectionHandler = ({
31700
31730
  } = unsubscribeQueryResult.match(action) ? action.payload : action.meta.arg;
31701
31731
  queryCacheKeys = [queryCacheKey];
31702
31732
  }
31703
- handleUnsubscribeMany(queryCacheKeys, mwApi, config);
31733
+ handleUnsubscribeMany(queryCacheKeys, mwApi2, config);
31704
31734
  }
31705
31735
  if (api.util.resetApiState.match(action)) {
31706
31736
  for (const [key, timeout] of Object.entries(currentRemovalTimeouts)) {
@@ -31712,14 +31742,16 @@ var buildCacheCollectionHandler = ({
31712
31742
  const {
31713
31743
  queries
31714
31744
  } = context.extractRehydrationInfo(action);
31715
- handleUnsubscribeMany(Object.keys(queries), mwApi, config);
31745
+ handleUnsubscribeMany(Object.keys(queries), mwApi2, config);
31716
31746
  }
31717
31747
  };
31718
31748
  function handleUnsubscribeMany(cacheKeys, api2, config) {
31719
31749
  const state = api2.getState();
31720
31750
  for (const queryCacheKey of cacheKeys) {
31721
31751
  const entry = selectQueryEntry(state, queryCacheKey);
31722
- handleUnsubscribe(queryCacheKey, entry?.endpointName, api2, config);
31752
+ if (entry?.endpointName) {
31753
+ handleUnsubscribe(queryCacheKey, entry.endpointName, api2, config);
31754
+ }
31723
31755
  }
31724
31756
  }
31725
31757
  function handleUnsubscribe(queryCacheKey, endpointName, api2, config) {
@@ -31736,6 +31768,11 @@ var buildCacheCollectionHandler = ({
31736
31768
  }
31737
31769
  currentRemovalTimeouts[queryCacheKey] = setTimeout(() => {
31738
31770
  if (!anySubscriptionsRemainingForKey(queryCacheKey)) {
31771
+ const entry = selectQueryEntry(api2.getState(), queryCacheKey);
31772
+ if (entry?.endpointName) {
31773
+ const runningQuery = api2.dispatch(getRunningQueryThunk(entry.endpointName, entry.originalArgs));
31774
+ runningQuery?.abort();
31775
+ }
31739
31776
  api2.dispatch(removeQueryResult({
31740
31777
  queryCacheKey
31741
31778
  }));
@@ -31845,7 +31882,7 @@ var buildCacheLifecycleHandler = ({
31845
31882
  });
31846
31883
  lifecycleMap[queryCacheKey] = lifecycle;
31847
31884
  const selector = api.endpoints[endpointName].select(isAnyQueryDefinition(endpointDefinition) ? originalArgs : queryCacheKey);
31848
- const extra = mwApi.dispatch((_2, __, extra2) => extra2);
31885
+ const extra = mwApi.dispatch((_5, __, extra2) => extra2);
31849
31886
  const lifecycleApi = {
31850
31887
  ...mwApi,
31851
31888
  getCacheEntry: () => selector(mwApi.getState()),
@@ -31940,9 +31977,9 @@ var buildInvalidationByTagsHandler = ({
31940
31977
  queryCacheKey
31941
31978
  } of valuesArray) {
31942
31979
  const querySubState = state.queries[queryCacheKey];
31943
- const subscriptionSubState = internalState.currentSubscriptions[queryCacheKey] ?? {};
31980
+ const subscriptionSubState = getOrInsertComputed2(internalState.currentSubscriptions, queryCacheKey, createNewMap);
31944
31981
  if (querySubState) {
31945
- if (countObjectKeys(subscriptionSubState) === 0) {
31982
+ if (subscriptionSubState.size === 0) {
31946
31983
  mwApi.dispatch(removeQueryResult({
31947
31984
  queryCacheKey
31948
31985
  }));
@@ -31962,25 +31999,49 @@ var buildPollingHandler = ({
31962
31999
  refetchQuery,
31963
32000
  internalState
31964
32001
  }) => {
31965
- const currentPolls = {};
32002
+ const {
32003
+ currentPolls,
32004
+ currentSubscriptions
32005
+ } = internalState;
32006
+ const pendingPollingUpdates = /* @__PURE__ */ new Set();
32007
+ let pollingUpdateTimer = null;
31966
32008
  const handler = (action, mwApi) => {
31967
32009
  if (api.internalActions.updateSubscriptionOptions.match(action) || api.internalActions.unsubscribeQueryResult.match(action)) {
31968
- updatePollingInterval(action.payload, mwApi);
32010
+ schedulePollingUpdate(action.payload.queryCacheKey, mwApi);
31969
32011
  }
31970
32012
  if (queryThunk.pending.match(action) || queryThunk.rejected.match(action) && action.meta.condition) {
31971
- updatePollingInterval(action.meta.arg, mwApi);
32013
+ schedulePollingUpdate(action.meta.arg.queryCacheKey, mwApi);
31972
32014
  }
31973
32015
  if (queryThunk.fulfilled.match(action) || queryThunk.rejected.match(action) && !action.meta.condition) {
31974
32016
  startNextPoll(action.meta.arg, mwApi);
31975
32017
  }
31976
32018
  if (api.util.resetApiState.match(action)) {
31977
32019
  clearPolls();
32020
+ if (pollingUpdateTimer) {
32021
+ clearTimeout(pollingUpdateTimer);
32022
+ pollingUpdateTimer = null;
32023
+ }
32024
+ pendingPollingUpdates.clear();
31978
32025
  }
31979
32026
  };
32027
+ function schedulePollingUpdate(queryCacheKey, api2) {
32028
+ pendingPollingUpdates.add(queryCacheKey);
32029
+ if (!pollingUpdateTimer) {
32030
+ pollingUpdateTimer = setTimeout(() => {
32031
+ for (const key of pendingPollingUpdates) {
32032
+ updatePollingInterval({
32033
+ queryCacheKey: key
32034
+ }, api2);
32035
+ }
32036
+ pendingPollingUpdates.clear();
32037
+ pollingUpdateTimer = null;
32038
+ }, 0);
32039
+ }
32040
+ }
31980
32041
  function getCacheEntrySubscriptions(queryCacheKey, api2) {
31981
32042
  const state = api2.getState()[reducerPath];
31982
32043
  const querySubState = state.queries[queryCacheKey];
31983
- const subscriptions = internalState.currentSubscriptions[queryCacheKey];
32044
+ const subscriptions = currentSubscriptions.get(queryCacheKey);
31984
32045
  if (!querySubState || querySubState.status === "uninitialized") return;
31985
32046
  return subscriptions;
31986
32047
  }
@@ -31989,20 +32050,20 @@ var buildPollingHandler = ({
31989
32050
  }, api2) {
31990
32051
  const state = api2.getState()[reducerPath];
31991
32052
  const querySubState = state.queries[queryCacheKey];
31992
- const subscriptions = internalState.currentSubscriptions[queryCacheKey];
32053
+ const subscriptions = currentSubscriptions.get(queryCacheKey);
31993
32054
  if (!querySubState || querySubState.status === "uninitialized") return;
31994
32055
  const {
31995
32056
  lowestPollingInterval,
31996
32057
  skipPollingIfUnfocused
31997
32058
  } = findLowestPollingInterval(subscriptions);
31998
32059
  if (!Number.isFinite(lowestPollingInterval)) return;
31999
- const currentPoll = currentPolls[queryCacheKey];
32060
+ const currentPoll = currentPolls.get(queryCacheKey);
32000
32061
  if (currentPoll?.timeout) {
32001
32062
  clearTimeout(currentPoll.timeout);
32002
32063
  currentPoll.timeout = void 0;
32003
32064
  }
32004
32065
  const nextPollTimestamp = Date.now() + lowestPollingInterval;
32005
- currentPolls[queryCacheKey] = {
32066
+ currentPolls.set(queryCacheKey, {
32006
32067
  nextPollTimestamp,
32007
32068
  pollingInterval: lowestPollingInterval,
32008
32069
  timeout: setTimeout(() => {
@@ -32013,25 +32074,30 @@ var buildPollingHandler = ({
32013
32074
  queryCacheKey
32014
32075
  }, api2);
32015
32076
  }, lowestPollingInterval)
32016
- };
32077
+ });
32017
32078
  }
32018
32079
  function updatePollingInterval({
32019
32080
  queryCacheKey
32020
32081
  }, api2) {
32021
32082
  const state = api2.getState()[reducerPath];
32022
32083
  const querySubState = state.queries[queryCacheKey];
32023
- const subscriptions = internalState.currentSubscriptions[queryCacheKey];
32084
+ const subscriptions = currentSubscriptions.get(queryCacheKey);
32024
32085
  if (!querySubState || querySubState.status === "uninitialized") {
32025
32086
  return;
32026
32087
  }
32027
32088
  const {
32028
32089
  lowestPollingInterval
32029
32090
  } = findLowestPollingInterval(subscriptions);
32091
+ if (process.env.NODE_ENV === "test") {
32092
+ const updateCounters = currentPolls.pollUpdateCounters ?? (currentPolls.pollUpdateCounters = {});
32093
+ updateCounters[queryCacheKey] ?? (updateCounters[queryCacheKey] = 0);
32094
+ updateCounters[queryCacheKey]++;
32095
+ }
32030
32096
  if (!Number.isFinite(lowestPollingInterval)) {
32031
32097
  cleanupPollForKey(queryCacheKey);
32032
32098
  return;
32033
32099
  }
32034
- const currentPoll = currentPolls[queryCacheKey];
32100
+ const currentPoll = currentPolls.get(queryCacheKey);
32035
32101
  const nextPollTimestamp = Date.now() + lowestPollingInterval;
32036
32102
  if (!currentPoll || nextPollTimestamp < currentPoll.nextPollTimestamp) {
32037
32103
  startNextPoll({
@@ -32040,24 +32106,24 @@ var buildPollingHandler = ({
32040
32106
  }
32041
32107
  }
32042
32108
  function cleanupPollForKey(key) {
32043
- const existingPoll = currentPolls[key];
32109
+ const existingPoll = currentPolls.get(key);
32044
32110
  if (existingPoll?.timeout) {
32045
32111
  clearTimeout(existingPoll.timeout);
32046
32112
  }
32047
- delete currentPolls[key];
32113
+ currentPolls.delete(key);
32048
32114
  }
32049
32115
  function clearPolls() {
32050
- for (const key of Object.keys(currentPolls)) {
32116
+ for (const key of currentPolls.keys()) {
32051
32117
  cleanupPollForKey(key);
32052
32118
  }
32053
32119
  }
32054
- function findLowestPollingInterval(subscribers = {}) {
32120
+ function findLowestPollingInterval(subscribers = /* @__PURE__ */ new Map()) {
32055
32121
  let skipPollingIfUnfocused = false;
32056
32122
  let lowestPollingInterval = Number.POSITIVE_INFINITY;
32057
- for (let key in subscribers) {
32058
- if (!!subscribers[key].pollingInterval) {
32059
- lowestPollingInterval = Math.min(subscribers[key].pollingInterval, lowestPollingInterval);
32060
- skipPollingIfUnfocused = subscribers[key].skipPollingIfUnfocused || skipPollingIfUnfocused;
32123
+ for (const entry of subscribers.values()) {
32124
+ if (!!entry.pollingInterval) {
32125
+ lowestPollingInterval = Math.min(entry.pollingInterval, lowestPollingInterval);
32126
+ skipPollingIfUnfocused = entry.skipPollingIfUnfocused || skipPollingIfUnfocused;
32061
32127
  }
32062
32128
  }
32063
32129
  return {
@@ -32098,7 +32164,7 @@ var buildQueryLifecycleHandler = ({
32098
32164
  });
32099
32165
  lifecycleMap[requestId] = lifecycle;
32100
32166
  const selector = api.endpoints[endpointName].select(isAnyQueryDefinition(endpointDefinition) ? originalArgs : requestId);
32101
- const extra = mwApi.dispatch((_2, __, extra2) => extra2);
32167
+ const extra = mwApi.dispatch((_5, __, extra2) => extra2);
32102
32168
  const lifecycleApi = {
32103
32169
  ...mwApi,
32104
32170
  getCacheEntry: () => selector(mwApi.getState()),
@@ -32158,13 +32224,14 @@ var buildWindowEventHandler = ({
32158
32224
  const queries = state.queries;
32159
32225
  const subscriptions = internalState.currentSubscriptions;
32160
32226
  context.batch(() => {
32161
- for (const queryCacheKey of Object.keys(subscriptions)) {
32227
+ for (const queryCacheKey of subscriptions.keys()) {
32162
32228
  const querySubState = queries[queryCacheKey];
32163
- const subscriptionSubState = subscriptions[queryCacheKey];
32229
+ const subscriptionSubState = subscriptions.get(queryCacheKey);
32164
32230
  if (!subscriptionSubState || !querySubState) continue;
32165
- const shouldRefetch = Object.values(subscriptionSubState).some((sub) => sub[type] === true) || Object.values(subscriptionSubState).every((sub) => sub[type] === void 0) && state.config[type];
32231
+ const values = [...subscriptionSubState.values()];
32232
+ const shouldRefetch = values.some((sub) => sub[type] === true) || values.every((sub) => sub[type] === void 0) && state.config[type];
32166
32233
  if (shouldRefetch) {
32167
- if (countObjectKeys(subscriptionSubState) === 0) {
32234
+ if (subscriptionSubState.size === 0) {
32168
32235
  api2.dispatch(removeQueryResult({
32169
32236
  queryCacheKey
32170
32237
  }));
@@ -32182,7 +32249,8 @@ function buildMiddleware(input) {
32182
32249
  reducerPath,
32183
32250
  queryThunk,
32184
32251
  api,
32185
- context
32252
+ context,
32253
+ internalState
32186
32254
  } = input;
32187
32255
  const {
32188
32256
  apiUid
@@ -32194,14 +32262,12 @@ function buildMiddleware(input) {
32194
32262
  const handlerBuilders = [buildDevCheckHandler, buildCacheCollectionHandler, buildInvalidationByTagsHandler, buildPollingHandler, buildCacheLifecycleHandler, buildQueryLifecycleHandler];
32195
32263
  const middleware = (mwApi) => {
32196
32264
  let initialized2 = false;
32197
- const internalState = {
32198
- currentSubscriptions: {}
32199
- };
32200
32265
  const builderArgs = {
32201
32266
  ...input,
32202
32267
  internalState,
32203
32268
  refetchQuery,
32204
- isThisApiSliceAction
32269
+ isThisApiSliceAction,
32270
+ mwApi
32205
32271
  };
32206
32272
  const handlers = handlerBuilders.map((build) => build(builderArgs));
32207
32273
  const batchedActionsHandler = buildBatchedActionsHandler(builderArgs);
@@ -32356,24 +32422,12 @@ var coreModule = ({
32356
32422
  upsertQueryEntries: sliceActions.cacheEntriesUpserted
32357
32423
  });
32358
32424
  safeAssign(api.internalActions, sliceActions);
32359
- const {
32360
- middleware,
32361
- actions: middlewareActions
32362
- } = buildMiddleware({
32363
- reducerPath,
32364
- context,
32365
- queryThunk,
32366
- mutationThunk,
32367
- infiniteQueryThunk,
32368
- api,
32369
- assertTagType,
32370
- selectors
32371
- });
32372
- safeAssign(api.util, middlewareActions);
32373
- safeAssign(api, {
32374
- reducer,
32375
- middleware
32376
- });
32425
+ const internalState = {
32426
+ currentSubscriptions: /* @__PURE__ */ new Map(),
32427
+ currentPolls: /* @__PURE__ */ new Map(),
32428
+ runningQueries: /* @__PURE__ */ new Map(),
32429
+ runningMutations: /* @__PURE__ */ new Map()
32430
+ };
32377
32431
  const {
32378
32432
  buildInitiateQuery,
32379
32433
  buildInitiateInfiniteQuery,
@@ -32388,7 +32442,8 @@ var coreModule = ({
32388
32442
  infiniteQueryThunk,
32389
32443
  api,
32390
32444
  serializeQueryArgs,
32391
- context
32445
+ context,
32446
+ internalState
32392
32447
  });
32393
32448
  safeAssign(api.util, {
32394
32449
  getRunningMutationThunk,
@@ -32396,6 +32451,26 @@ var coreModule = ({
32396
32451
  getRunningQueryThunk,
32397
32452
  getRunningQueriesThunk
32398
32453
  });
32454
+ const {
32455
+ middleware,
32456
+ actions: middlewareActions
32457
+ } = buildMiddleware({
32458
+ reducerPath,
32459
+ context,
32460
+ queryThunk,
32461
+ mutationThunk,
32462
+ infiniteQueryThunk,
32463
+ api,
32464
+ assertTagType,
32465
+ selectors,
32466
+ getRunningQueryThunk,
32467
+ internalState
32468
+ });
32469
+ safeAssign(api.util, middlewareActions);
32470
+ safeAssign(api, {
32471
+ reducer,
32472
+ middleware
32473
+ });
32399
32474
  return {
32400
32475
  name: coreModuleName,
32401
32476
  injectEndpoint(endpointName, definition) {
@@ -32463,22 +32538,15 @@ function safeAssign2(target, ...args) {
32463
32538
  return Object.assign(target, ...args);
32464
32539
  }
32465
32540
  var UNINITIALIZED_VALUE = Symbol();
32466
- function useStableQueryArgs(queryArgs, serialize, endpointDefinition, endpointName) {
32467
- const incoming = useMemo(() => ({
32468
- queryArgs,
32469
- serialized: typeof queryArgs == "object" ? serialize({
32470
- queryArgs,
32471
- endpointDefinition,
32472
- endpointName
32473
- }) : queryArgs
32474
- }), [queryArgs, serialize, endpointDefinition, endpointName]);
32475
- const cache2 = useRef(incoming);
32541
+ function useStableQueryArgs(queryArgs) {
32542
+ const cache2 = useRef(queryArgs);
32543
+ const copy = useMemo(() => copyWithStructuralSharing(cache2.current, queryArgs), [queryArgs]);
32476
32544
  useEffect(() => {
32477
- if (cache2.current.serialized !== incoming.serialized) {
32478
- cache2.current = incoming;
32545
+ if (cache2.current !== copy) {
32546
+ cache2.current = copy;
32479
32547
  }
32480
- }, [incoming]);
32481
- return cache2.current.serialized === incoming.serialized ? cache2.current.queryArgs : queryArgs;
32548
+ }, [copy]);
32549
+ return copy;
32482
32550
  }
32483
32551
  function useShallowStableValue(value) {
32484
32552
  const cache2 = useRef2(value);
@@ -32631,17 +32699,7 @@ function buildHooks({
32631
32699
  }
32632
32700
  subscriptionSelectorsRef.current = returnedValue;
32633
32701
  }
32634
- const stableArg = useStableQueryArgs(
32635
- skip ? skipToken : arg,
32636
- // Even if the user provided a per-endpoint `serializeQueryArgs` with
32637
- // a consistent return value, _here_ we want to use the default behavior
32638
- // so we can tell if _anything_ actually changed. Otherwise, we can end up
32639
- // with a case where the query args did change but the serialization doesn't,
32640
- // and then we never try to initiate a refetch.
32641
- defaultSerializeQueryArgs,
32642
- context.endpointDefinitions[endpointName],
32643
- endpointName
32644
- );
32702
+ const stableArg = useStableQueryArgs(skip ? skipToken : arg);
32645
32703
  const stableSubscriptionOptions = useShallowStableValue({
32646
32704
  refetchOnReconnect,
32647
32705
  refetchOnFocus,
@@ -32700,7 +32758,7 @@ function buildHooks({
32700
32758
  const {
32701
32759
  select
32702
32760
  } = api.endpoints[endpointName];
32703
- const stableArg = useStableQueryArgs(skip ? skipToken : arg, serializeQueryArgs, context.endpointDefinitions[endpointName], endpointName);
32761
+ const stableArg = useStableQueryArgs(skip ? skipToken : arg);
32704
32762
  const lastValue = useRef3(void 0);
32705
32763
  const selectDefaultResult = useMemo2(() => (
32706
32764
  // Normally ts-ignores are bad and should be avoided, but we're
@@ -32710,8 +32768,8 @@ function buildHooks({
32710
32768
  createSelector2([
32711
32769
  // @ts-ignore
32712
32770
  select(stableArg),
32713
- (_2, lastResult) => lastResult,
32714
- (_2) => stableArg
32771
+ (_5, lastResult) => lastResult,
32772
+ (_5) => stableArg
32715
32773
  ], preSelector, {
32716
32774
  memoizeOptions: {
32717
32775
  resultEqualityCheck: shallowEqual2
@@ -32872,17 +32930,7 @@ function buildHooks({
32872
32930
  return promise;
32873
32931
  }, [promiseRef, dispatch, initiate]);
32874
32932
  usePromiseRefUnsubscribeOnUnmount(promiseRef);
32875
- const stableArg = useStableQueryArgs(
32876
- options.skip ? skipToken : arg,
32877
- // Even if the user provided a per-endpoint `serializeQueryArgs` with
32878
- // a consistent return value, _here_ we want to use the default behavior
32879
- // so we can tell if _anything_ actually changed. Otherwise, we can end up
32880
- // with a case where the query args did change but the serialization doesn't,
32881
- // and then we never try to initiate a refetch.
32882
- defaultSerializeQueryArgs,
32883
- context.endpointDefinitions[endpointName],
32884
- endpointName
32885
- );
32933
+ const stableArg = useStableQueryArgs(options.skip ? skipToken : arg);
32886
32934
  const refetch = useCallback(() => refetchOrErrorIfUnmounted(promiseRef), [promiseRef]);
32887
32935
  return useMemo2(() => {
32888
32936
  const fetchNextPage = () => {
@@ -34082,7 +34130,7 @@ var workflowsApi = orchestratorApi.injectEndpoints({
34082
34130
  document: workflowsDescription,
34083
34131
  variables
34084
34132
  }),
34085
- transformResponse: (response, _2, variables) => {
34133
+ transformResponse: (response, _5, variables) => {
34086
34134
  const workflows = response.workflows.page || [];
34087
34135
  const workflow = workflows.find(
34088
34136
  ({ name: name2 }) => name2 === variables.workflowName
@@ -34866,7 +34914,7 @@ var streamMessagesApi = orchestratorApi.injectEndpoints({
34866
34914
  queryFn: () => {
34867
34915
  return { data: true };
34868
34916
  },
34869
- async onCacheEntryAdded(_2, {
34917
+ async onCacheEntryAdded(_5, {
34870
34918
  cacheDataLoaded,
34871
34919
  cacheEntryRemoved,
34872
34920
  dispatch,
@@ -38239,7 +38287,7 @@ var WfoStartButtonComboBox = ({
38239
38287
  css: selectableStyle,
38240
38288
  searchable: true,
38241
38289
  options,
38242
- onChange: (_2, __, changedOption) => onOptionChange(changedOption),
38290
+ onChange: (_5, __, changedOption) => onOptionChange(changedOption),
38243
38291
  height: 200,
38244
38292
  children: (list, search) => /* @__PURE__ */ jsxs41(Fragment3, { children: [
38245
38293
  search,
@@ -41228,11 +41276,11 @@ var WfoDragHandler = ({
41228
41276
  const onStart = () => {
41229
41277
  setIsDragging(false);
41230
41278
  };
41231
- const onDrag = (_2, data) => {
41279
+ const onDrag = (_5, data) => {
41232
41280
  setIsDragging(true);
41233
41281
  setPosition({ x: data.x, y: data.y });
41234
41282
  };
41235
- const onStop = (_2, data) => {
41283
+ const onStop = (_5, data) => {
41236
41284
  if (headerRowRef.current && isDragging) {
41237
41285
  const newWidth = startWidth + data.x;
41238
41286
  onUpdateColumWidth(
@@ -43136,7 +43184,7 @@ var WfoButtonComboBox = ({
43136
43184
  css: selectableStyle,
43137
43185
  options: optionsState,
43138
43186
  searchable: true,
43139
- onChange: (options2, _2, changedOption) => {
43187
+ onChange: (options2, _5, changedOption) => {
43140
43188
  onOptionChange(changedOption);
43141
43189
  setOptionsState(options2);
43142
43190
  },
@@ -47794,7 +47842,7 @@ function Summary({
47794
47842
  return null;
47795
47843
  }
47796
47844
  const { headers, labels, columns } = data;
47797
- const extraColumnsData = columns.filter((_2, index) => index !== 0);
47845
+ const extraColumnsData = columns.filter((_5, index) => index !== 0);
47798
47846
  const rows = columns[0].map((row, index) => /* @__PURE__ */ jsxs98("tr", { children: [
47799
47847
  labels && /* @__PURE__ */ jsx181("td", { className: `label`, children: labels[index] }),
47800
47848
  /* @__PURE__ */ jsx181("td", { className: `value`, children: typeof row === "string" && row.includes("<!doctype html>") ? /* @__PURE__ */ jsx181(
@@ -47804,7 +47852,7 @@ function Summary({
47804
47852
  dangerouslySetInnerHTML: { __html: row }
47805
47853
  }
47806
47854
  ) : row }),
47807
- extraColumnsData && extraColumnsData.map((_2, idx) => /* @__PURE__ */ jsx181("td", { className: `value`, children: extraColumnsData[idx][index] }, idx))
47855
+ extraColumnsData && extraColumnsData.map((_5, idx) => /* @__PURE__ */ jsx181("td", { className: `value`, children: extraColumnsData[idx][index] }, idx))
47808
47856
  ] }, index));
47809
47857
  const tableHeader = !headers || headers.length === 0 ? null : /* @__PURE__ */ jsxs98("tr", { children: [
47810
47858
  labels && /* @__PURE__ */ jsx181("th", {}),
@@ -50358,7 +50406,7 @@ var WfoProcessDetailPage = ({
50358
50406
  };
50359
50407
 
50360
50408
  // src/pages/processes/WfoStartProcessPage.tsx
50361
- import { useCallback as useCallback9, useEffect as useEffect34, useMemo as useMemo7, useState as useState50 } from "react";
50409
+ import { useCallback as useCallback9, useEffect as useEffect34, useMemo as useMemo7, useState as useState51 } from "react";
50362
50410
  import { useTranslations as useTranslations69 } from "next-intl";
50363
50411
  import { useRouter as useRouter10 } from "next/router";
50364
50412
  import {
@@ -50371,6 +50419,7 @@ import {
50371
50419
 
50372
50420
  // src/components/WfoPydanticForm/WfoPydanticForm.tsx
50373
50421
  import { useCallback as useCallback6, useMemo as useMemo4 } from "react";
50422
+ import _4 from "lodash";
50374
50423
  import { useMessages, useTranslations as useTranslations62 } from "next-intl";
50375
50424
  import { useRouter as useRouter9 } from "next/router";
50376
50425
  import {
@@ -50556,6 +50605,8 @@ var WfoTextArea = ({
50556
50605
  };
50557
50606
 
50558
50607
  // src/components/WfoPydanticForm/fields/WfoText.tsx
50608
+ import _2 from "lodash";
50609
+ import { getFormFieldIdWithPath } from "pydantic-forms";
50559
50610
  import { EuiFieldText as EuiFieldText4 } from "@elastic/eui";
50560
50611
  import { jsx as jsx208 } from "@emotion/react/jsx-runtime";
50561
50612
  var WfoText = ({
@@ -50567,6 +50618,8 @@ var WfoText = ({
50567
50618
  const { formFieldBaseStyle } = useWithOrchestratorTheme(
50568
50619
  getFormFieldsBaseStyle
50569
50620
  );
50621
+ const fieldName = getFormFieldIdWithPath(pydanticFormField.id);
50622
+ const fieldValue = _2.isObject(value) && _2.has(value, fieldName) ? _2.get(value, fieldName) : value;
50570
50623
  return /* @__PURE__ */ jsx208(
50571
50624
  EuiFieldText4,
50572
50625
  {
@@ -50574,7 +50627,7 @@ var WfoText = ({
50574
50627
  css: formFieldBaseStyle,
50575
50628
  disabled,
50576
50629
  onChange: (event) => onChange(event.target.value),
50577
- value: value ?? "",
50630
+ value: fieldValue,
50578
50631
  fullWidth: true
50579
50632
  }
50580
50633
  );
@@ -50647,7 +50700,7 @@ var WfoSummary = ({ pydanticFormField }) => {
50647
50700
  const headers = summaryData?.headers;
50648
50701
  const labels = summaryData?.labels;
50649
50702
  const columns = summaryData?.columns || [];
50650
- const extraColumnsData = columns.filter((_2, index) => index !== 0);
50703
+ const extraColumnsData = columns.filter((_5, index) => index !== 0);
50651
50704
  const rows = columns[0].map((row, index) => /* @__PURE__ */ jsxs111("tr", { children: [
50652
50705
  labels && /* @__PURE__ */ jsx212("td", { className: `label`, children: getNestedSummaryLabel(labels, index) }),
50653
50706
  /* @__PURE__ */ jsx212("td", { className: `value`, children: typeof row === "string" && row.includes("<!doctype html>") ? /* @__PURE__ */ jsx212(
@@ -50657,7 +50710,7 @@ var WfoSummary = ({ pydanticFormField }) => {
50657
50710
  dangerouslySetInnerHTML: { __html: row }
50658
50711
  }
50659
50712
  ) : row }),
50660
- extraColumnsData && extraColumnsData.map((_2, idx) => /* @__PURE__ */ jsx212("td", { className: `value`, children: extraColumnsData[idx][index].toString() }, idx))
50713
+ extraColumnsData && extraColumnsData.map((_5, idx) => /* @__PURE__ */ jsx212("td", { className: `value`, children: extraColumnsData[idx][index].toString() }, idx))
50661
50714
  ] }, index));
50662
50715
  const tableHeader = !headers || headers.length === 0 ? null : /* @__PURE__ */ jsxs111("tr", { children: [
50663
50716
  labels && /* @__PURE__ */ jsx212("th", {}),
@@ -51492,7 +51545,7 @@ var WfoRadio = ({
51492
51545
  value,
51493
51546
  disabled
51494
51547
  }) => {
51495
- const radioOptions = pydanticFormField.options.map((option) => ({
51548
+ const radioOptions = pydanticFormField.options?.map((option) => ({
51496
51549
  id: option.value,
51497
51550
  label: option.label
51498
51551
  }));
@@ -51500,7 +51553,7 @@ var WfoRadio = ({
51500
51553
  EuiRadioGroup,
51501
51554
  {
51502
51555
  "data-testid": pydanticFormField.id,
51503
- options: radioOptions,
51556
+ options: radioOptions || [],
51504
51557
  idSelected: value,
51505
51558
  onChange: (id) => onChange(id),
51506
51559
  name: pydanticFormField.id,
@@ -51510,6 +51563,8 @@ var WfoRadio = ({
51510
51563
  };
51511
51564
 
51512
51565
  // src/components/WfoPydanticForm/fields/WfoInteger.tsx
51566
+ import _3 from "lodash";
51567
+ import { getFormFieldIdWithPath as getFormFieldIdWithPath2 } from "pydantic-forms";
51513
51568
  import { EuiFieldNumber as EuiFieldNumber2 } from "@elastic/eui";
51514
51569
  import { css as css38 } from "@emotion/react";
51515
51570
  import { jsx as jsx216 } from "@emotion/react/jsx-runtime";
@@ -51534,6 +51589,8 @@ var WfoInteger = ({
51534
51589
  const { formFieldBaseStyle } = useWithOrchestratorTheme(
51535
51590
  getFormFieldsBaseStyle2
51536
51591
  );
51592
+ const fieldName = getFormFieldIdWithPath2(pydanticFormField.id);
51593
+ const fieldValue = _3.isObject(value) && _3.has(value, fieldName) ? _3.get(value, fieldName) : value;
51537
51594
  return /* @__PURE__ */ jsx216(
51538
51595
  EuiFieldNumber2,
51539
51596
  {
@@ -51541,14 +51598,14 @@ var WfoInteger = ({
51541
51598
  css: formFieldBaseStyle,
51542
51599
  name: pydanticFormField.id,
51543
51600
  onChange: (event) => onChange(parseInt(event.target.value)),
51544
- value,
51601
+ value: fieldValue,
51545
51602
  disabled
51546
51603
  }
51547
51604
  );
51548
51605
  };
51549
51606
 
51550
51607
  // src/components/WfoPydanticForm/fields/WfoReactSelect/WfoReactSelect.tsx
51551
- import React67, { useEffect as useEffect30 } from "react";
51608
+ import { useEffect as useEffect30, useState as useState44 } from "react";
51552
51609
  import ReactSelect5, { components } from "react-select";
51553
51610
  import { EuiButtonIcon as EuiButtonIcon12 } from "@elastic/eui";
51554
51611
 
@@ -51624,16 +51681,18 @@ var WfoReactSelect = ({
51624
51681
  hasError = false,
51625
51682
  refetch
51626
51683
  }) => {
51627
- useEffect30(() => {
51628
- const selectedValue2 = options.find(
51629
- (option) => option.value === value
51630
- );
51631
- setSelectedValue(selectedValue2 || null);
51632
- }, [options, value]);
51633
51684
  const initialValue = options.find(
51634
51685
  (option) => option.value === value
51635
51686
  );
51636
- const [selectedValue, setSelectedValue] = React67.useState(initialValue || null);
51687
+ const [selectedValue, setSelectedValue] = useState44(initialValue || null);
51688
+ useEffect30(() => {
51689
+ const preSelectedValue = options.find(
51690
+ (option) => option.value === value
51691
+ );
51692
+ if (preSelectedValue !== selectedValue) {
51693
+ setSelectedValue(preSelectedValue || null);
51694
+ }
51695
+ }, [options, selectedValue, value]);
51637
51696
  const {
51638
51697
  reactSelectInnerComponentStyles,
51639
51698
  containerStyle,
@@ -51673,7 +51732,7 @@ var WfoReactSelect = ({
51673
51732
  onChange: (option) => {
51674
51733
  if (option === null) {
51675
51734
  setSelectedValue(null);
51676
- onChange(void 0);
51735
+ onChange(null);
51677
51736
  } else {
51678
51737
  const selectedValue2 = option?.value;
51679
51738
  setSelectedValue(option);
@@ -51704,14 +51763,14 @@ var WfoDropdown = ({
51704
51763
  pydanticFormField,
51705
51764
  value
51706
51765
  }) => {
51707
- const dropDownOptions = pydanticFormField.options.map((option) => ({
51766
+ const dropDownOptions = pydanticFormField.options?.map((option) => ({
51708
51767
  value: option.value,
51709
51768
  label: option.label
51710
51769
  }));
51711
51770
  return /* @__PURE__ */ jsx218(
51712
51771
  WfoReactSelect,
51713
51772
  {
51714
- options: dropDownOptions,
51773
+ options: dropDownOptions || [],
51715
51774
  onChange,
51716
51775
  id: pydanticFormField.id,
51717
51776
  value
@@ -51720,7 +51779,7 @@ var WfoDropdown = ({
51720
51779
  };
51721
51780
 
51722
51781
  // src/components/WfoPydanticForm/fields/WfoMultiCheckboxField.tsx
51723
- import { useEffect as useEffect31, useState as useState44 } from "react";
51782
+ import { useEffect as useEffect31, useState as useState45 } from "react";
51724
51783
  import { EuiCheckboxGroup } from "@elastic/eui";
51725
51784
  import { jsx as jsx219 } from "@emotion/react/jsx-runtime";
51726
51785
  var WfoMultiCheckboxField = ({
@@ -51741,9 +51800,9 @@ var WfoMultiCheckboxField = ({
51741
51800
  };
51742
51801
  setCheckboxIdToSelectedMap(getInitialMap());
51743
51802
  }, [value]);
51744
- const [checkboxIdToSelectedMap, setCheckboxIdToSelectedMap] = useState44({});
51803
+ const [checkboxIdToSelectedMap, setCheckboxIdToSelectedMap] = useState45({});
51745
51804
  const { options, id } = pydanticFormField;
51746
- const checkboxes = options.map((option, index) => ({
51805
+ const checkboxes = options?.map((option, index) => ({
51747
51806
  label: option.label,
51748
51807
  id: option.value,
51749
51808
  "data-test-id": `${id}-${index}`
@@ -51764,7 +51823,7 @@ var WfoMultiCheckboxField = ({
51764
51823
  return /* @__PURE__ */ jsx219(
51765
51824
  EuiCheckboxGroup,
51766
51825
  {
51767
- options: checkboxes,
51826
+ options: checkboxes || [],
51768
51827
  idToSelectedMap: checkboxIdToSelectedMap,
51769
51828
  onChange: (id2) => handleCheckboxChange(id2),
51770
51829
  "data-testid": id
@@ -51877,7 +51936,7 @@ var useWfoPydanticFormConfig = () => {
51877
51936
  isControlledElement: true
51878
51937
  },
51879
51938
  matcher(field) {
51880
- return field.type === PydanticFormFieldType.STRING && Array.isArray(field.options) && field.options.length > 0;
51939
+ return field.type === PydanticFormFieldType.STRING && _4.isArray(field.options) && field.options.length > 0;
51881
51940
  }
51882
51941
  },
51883
51942
  {
@@ -51898,7 +51957,7 @@ var useWfoPydanticFormConfig = () => {
51898
51957
  isControlledElement: true
51899
51958
  },
51900
51959
  matcher(field) {
51901
- return field.type === PydanticFormFieldType.ARRAY && field.options?.length > 0 && field.options?.length <= 5;
51960
+ return field.type === PydanticFormFieldType.ARRAY && _4.isArray(field.options) && field.options?.length > 0 && field.options?.length <= 5;
51902
51961
  },
51903
51962
  validator: zodValidationPresets.multiSelect
51904
51963
  },
@@ -52046,7 +52105,7 @@ var WfoPydanticForm = ({
52046
52105
  };
52047
52106
 
52048
52107
  // src/components/WfoWorkflowSteps/WfoStep/WfoStep.tsx
52049
- import React72, { useState as useState46 } from "react";
52108
+ import React72, { useState as useState47 } from "react";
52050
52109
  import { useTranslations as useTranslations64 } from "next-intl";
52051
52110
  import {
52052
52111
  EuiButton as EuiButton13,
@@ -52057,7 +52116,7 @@ import {
52057
52116
  } from "@elastic/eui";
52058
52117
 
52059
52118
  // src/components/WfoWorkflowSteps/WfoStep/WfoStepFormOld.tsx
52060
- import { useState as useState45 } from "react";
52119
+ import { useState as useState46 } from "react";
52061
52120
  import { EuiFlexItem as EuiFlexItem25 } from "@elastic/eui";
52062
52121
  import { jsx as jsx221 } from "@emotion/react/jsx-runtime";
52063
52122
  var WfoStepFormOld = ({
@@ -52066,8 +52125,8 @@ var WfoStepFormOld = ({
52066
52125
  processId,
52067
52126
  userPermissions
52068
52127
  }) => {
52069
- const [isProcessing, setIsProcessing] = useState45(false);
52070
- const [hasError, setHasError] = useState45(false);
52128
+ const [isProcessing, setIsProcessing] = useState46(false);
52129
+ const [hasError, setHasError] = useState46(false);
52071
52130
  const { theme } = useOrchestratorTheme();
52072
52131
  const [resumeProcess] = useResumeProcessMutation();
52073
52132
  const submitForm = (processInput) => {
@@ -52457,7 +52516,7 @@ var WfoStep = React72.forwardRef(
52457
52516
  userPermissions
52458
52517
  }, ref) => {
52459
52518
  const { isExpanded, step, userInputForm } = stepListItem;
52460
- const [tableView, setTableView] = useState46(false);
52519
+ const [tableView, setTableView] = useState47(false);
52461
52520
  const { theme } = useOrchestratorTheme();
52462
52521
  const {
52463
52522
  stepEmailContainerStyle,
@@ -52697,12 +52756,12 @@ var WfoStepList = React73.forwardRef(
52697
52756
  WfoStepList.displayName = "WfoStepList";
52698
52757
 
52699
52758
  // src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.tsx
52700
- import React75, { useEffect as useEffect33, useState as useState48 } from "react";
52759
+ import React75, { useEffect as useEffect33, useState as useState49 } from "react";
52701
52760
  import { useTranslations as useTranslations67 } from "next-intl";
52702
52761
 
52703
52762
  // src/components/WfoDiff/WfoDiff.tsx
52704
52763
  var refractor = __toESM(require_refractor(), 1);
52705
- import { useCallback as useCallback8, useEffect as useEffect32, useMemo as useMemo6, useState as useState47 } from "react";
52764
+ import { useCallback as useCallback8, useEffect as useEffect32, useMemo as useMemo6, useState as useState48 } from "react";
52706
52765
  import { Diff, Hunk, parseDiff, tokenize } from "react-diff-view";
52707
52766
  import "react-diff-view/style/index.css";
52708
52767
  import { useTranslations as useTranslations65 } from "next-intl";
@@ -52759,10 +52818,10 @@ var SMALL_CONTEXT = 3;
52759
52818
  var FULL_CONTEXT = 1e6;
52760
52819
  var WfoDiff = ({ oldText, newText, syntax }) => {
52761
52820
  const t = useTranslations65("processes.delta");
52762
- const [showSplit, setShowSplit] = useState47(true);
52763
- const [showFull, setShowFull] = useState47(false);
52821
+ const [showSplit, setShowSplit] = useState48(true);
52822
+ const [showFull, setShowFull] = useState48(false);
52764
52823
  const { diffStyle } = useWithOrchestratorTheme(getWfoDiffStyles);
52765
- const [{ type, hunks }, setDiff] = useState47({
52824
+ const [{ type, hunks }, setDiff] = useState48({
52766
52825
  type: "modify",
52767
52826
  hunks: []
52768
52827
  });
@@ -52895,16 +52954,16 @@ var WfoWorkflowStepList = React75.forwardRef(
52895
52954
  userInputForm,
52896
52955
  userPermissions
52897
52956
  }, reference) => {
52898
- const [showHiddenKeys, setShowHiddenKeys] = useState48(false);
52899
- const [showRaw, setShowRaw] = useState48(false);
52900
- const [showDelta, setShowDelta] = useState48(false);
52901
- const [showTraceback, setShowTraceback] = useState48(false);
52957
+ const [showHiddenKeys, setShowHiddenKeys] = useState49(false);
52958
+ const [showRaw, setShowRaw] = useState49(false);
52959
+ const [showDelta, setShowDelta] = useState49(false);
52960
+ const [showTraceback, setShowTraceback] = useState49(false);
52902
52961
  const t = useTranslations67("processes.steps");
52903
52962
  const initialStepListItems = steps.map((step) => ({
52904
52963
  step,
52905
52964
  isExpanded: false
52906
52965
  }));
52907
- const [stepListItems, setStepListItems] = useState48(initialStepListItems);
52966
+ const [stepListItems, setStepListItems] = useState49(initialStepListItems);
52908
52967
  const persistStepListItemState = (previousStepListItems, updatedSteps, userInputForm2) => {
52909
52968
  const reversedSteps = [...updatedSteps].reverse();
52910
52969
  const lastStepWithSuspendStatusStepId = reversedSteps.find(
@@ -53000,7 +53059,7 @@ var WfoWorkflowStepList = React75.forwardRef(
53000
53059
  WfoWorkflowStepList.displayName = "WfoWorkflowStepList";
53001
53060
 
53002
53061
  // src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoStepListHeader.tsx
53003
- import { useState as useState49 } from "react";
53062
+ import { useState as useState50 } from "react";
53004
53063
  import { useTranslations as useTranslations68 } from "next-intl";
53005
53064
  import {
53006
53065
  EuiButton as EuiButton14,
@@ -53063,7 +53122,7 @@ var WfoStepListHeader = ({
53063
53122
  stepListContentBoldTextStyle,
53064
53123
  stepListOptionsContainerStyle
53065
53124
  } = useWithOrchestratorTheme(getWorkflowStepsStyles);
53066
- const [isViewOptionOpen, setIsViewOptionOpen] = useState49(false);
53125
+ const [isViewOptionOpen, setIsViewOptionOpen] = useState50(false);
53067
53126
  const onViewOptionClick = () => setIsViewOptionOpen((isViewOptionOpen2) => !isViewOptionOpen2);
53068
53127
  const closeViewOption = () => setIsViewOptionOpen(false);
53069
53128
  const viewOptionButton = /* @__PURE__ */ jsx231(
@@ -53183,9 +53242,9 @@ var WfoStartProcessPage = ({
53183
53242
  }) => {
53184
53243
  const t = useTranslations69("processes.steps");
53185
53244
  const router = useRouter10();
53186
- const [hasError, setHasError] = useState50(false);
53245
+ const [hasError, setHasError] = useState51(false);
53187
53246
  const { theme } = useOrchestratorTheme();
53188
- const [form, setForm] = useState50({});
53247
+ const [form, setForm] = useState51({});
53189
53248
  const { productId, subscriptionId } = router.query;
53190
53249
  const {
53191
53250
  data: subscriptionDetail,
@@ -53603,14 +53662,14 @@ var WfoSubscriptionDetailPage = () => {
53603
53662
  };
53604
53663
 
53605
53664
  // src/pages/subscriptions/WfoSubscriptionsListPage.tsx
53606
- import { useEffect as useEffect35, useState as useState51 } from "react";
53665
+ import { useEffect as useEffect35, useState as useState52 } from "react";
53607
53666
  import { useTranslations as useTranslations74 } from "next-intl";
53608
53667
  import { StringParam as StringParam4, useQueryParam as useQueryParam3, withDefault as withDefault4 } from "use-query-params";
53609
53668
  import { EuiSpacer as EuiSpacer23 } from "@elastic/eui";
53610
53669
  import { Fragment as Fragment58, jsx as jsx238, jsxs as jsxs127 } from "@emotion/react/jsx-runtime";
53611
53670
  var WfoSubscriptionsListPage = () => {
53612
53671
  const t = useTranslations74("subscriptions.detail");
53613
- const [tableDefaults, setTableDefaults] = useState51();
53672
+ const [tableDefaults, setTableDefaults] = useState52();
53614
53673
  const getStoredTableConfig = useStoredTableConfig(
53615
53674
  SUBSCRIPTIONS_TABLE_LOCAL_STORAGE_KEY
53616
53675
  );
@@ -53675,7 +53734,7 @@ var WfoSubscriptionsListPage = () => {
53675
53734
  };
53676
53735
 
53677
53736
  // src/pages/tasks/WfoTasksListPage.tsx
53678
- import { useContext as useContext11, useEffect as useEffect36, useState as useState52 } from "react";
53737
+ import { useContext as useContext11, useEffect as useEffect36, useState as useState53 } from "react";
53679
53738
  import { useTranslations as useTranslations75 } from "next-intl";
53680
53739
  import Link11 from "next/link";
53681
53740
  import { useRouter as useRouter12 } from "next/router";
@@ -53753,7 +53812,7 @@ var WfoTasksListPage = () => {
53753
53812
  "activeTab",
53754
53813
  withDefault5(StringParam5, "ACTIVE" /* ACTIVE */)
53755
53814
  );
53756
- const [tableDefaults, setTableDefaults] = useState52();
53815
+ const [tableDefaults, setTableDefaults] = useState53();
53757
53816
  const selectedTasksListTab = getTasksListTabTypeFromString(activeTab);
53758
53817
  const localStorageKey = selectedTasksListTab === "ACTIVE" /* ACTIVE */ ? ACTIVE_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY : COMPLETED_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY;
53759
53818
  const getStoredTableConfig = useStoredTableConfig(localStorageKey);
@@ -53862,7 +53921,7 @@ var WfoTasksListPage = () => {
53862
53921
  };
53863
53922
 
53864
53923
  // src/pages/workflows/WfoWorkflowsListPage.tsx
53865
- import { useEffect as useEffect37, useState as useState53 } from "react";
53924
+ import { useEffect as useEffect37, useState as useState54 } from "react";
53866
53925
  import { useTranslations as useTranslations76 } from "next-intl";
53867
53926
  import { useRouter as useRouter13 } from "next/router";
53868
53927
  import { StringParam as StringParam6, useQueryParam as useQueryParam5, withDefault as withDefault6 } from "use-query-params";
@@ -53939,7 +53998,7 @@ var WfoWorkflowsListPage = () => {
53939
53998
  "activeTab",
53940
53999
  withDefault6(StringParam6, "ACTIVE" /* ACTIVE */)
53941
54000
  );
53942
- const [tableDefaults, setTableDefaults] = useState53();
54001
+ const [tableDefaults, setTableDefaults] = useState54();
53943
54002
  const selectedWorkflowsListTab = getWorkflowsListTabTypeFromString(activeTab);
53944
54003
  const localStorageKey = selectedWorkflowsListTab === "ACTIVE" /* ACTIVE */ ? ACTIVE_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY : COMPLETED_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY;
53945
54004
  const getStoredTableConfig = useStoredTableConfig(localStorageKey);
@@ -54325,7 +54384,7 @@ var WfoJsonCodeBlock = ({
54325
54384
  };
54326
54385
 
54327
54386
  // src/components/WfoSettings/WfoFlushSettings.tsx
54328
- import { useState as useState54 } from "react";
54387
+ import { useState as useState55 } from "react";
54329
54388
  import { useTranslations as useTranslations78 } from "next-intl";
54330
54389
  import {
54331
54390
  EuiButton as EuiButton17,
@@ -54367,7 +54426,7 @@ var WfoFlushSettings = () => {
54367
54426
  );
54368
54427
  const [clearCache] = useClearCacheMutation();
54369
54428
  const t = useTranslations78("settings.page");
54370
- const [selectedOptions, setSelected] = useState54(
54429
+ const [selectedOptions, setSelected] = useState55(
54371
54430
  []
54372
54431
  );
54373
54432
  const { showToastMessage } = useShowToastMessage();
@@ -55653,7 +55712,7 @@ var WfoTitleWithWebsocketBadge = ({
55653
55712
  };
55654
55713
 
55655
55714
  // src/components/WfoRadioDropdown/WfoRadioDropdown.tsx
55656
- import { useState as useState55 } from "react";
55715
+ import { useState as useState56 } from "react";
55657
55716
  import {
55658
55717
  EuiButtonEmpty as EuiButtonEmpty5,
55659
55718
  EuiFlexGroup as EuiFlexGroup32,
@@ -55666,7 +55725,7 @@ var WfoRadioDropdown = ({
55666
55725
  onUpdateOption,
55667
55726
  selectedOption
55668
55727
  }) => {
55669
- const [isOpen, setIsOpen] = useState55(false);
55728
+ const [isOpen, setIsOpen] = useState56(false);
55670
55729
  const handleClose = () => {
55671
55730
  if (isOpen) {
55672
55731
  setIsOpen(false);