@orchestrator-ui/orchestrator-ui-components 2.7.1 → 2.8.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
@@ -26792,7 +26792,7 @@ var PolicyResource = /* @__PURE__ */ ((PolicyResource2) => {
26792
26792
  })(PolicyResource || {});
26793
26793
 
26794
26794
  // src/configuration/version.ts
26795
- var ORCHESTRATOR_UI_LIBRARY_VERSION = "2.7.1";
26795
+ var ORCHESTRATOR_UI_LIBRARY_VERSION = "2.8.0";
26796
26796
 
26797
26797
  // src/types/types.ts
26798
26798
  var EngineStatus = /* @__PURE__ */ ((EngineStatus3) => {
@@ -28494,24 +28494,9 @@ var thunk = createThunkMiddleware();
28494
28494
  var withExtraArgument = createThunkMiddleware;
28495
28495
 
28496
28496
  // ../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.mjs
28497
- var createDraftSafeSelectorCreator = (...args) => {
28498
- const createSelector2 = createSelectorCreator(...args);
28499
- const createDraftSafeSelector2 = Object.assign((...args2) => {
28500
- const selector = createSelector2(...args2);
28501
- const wrappedSelector = (value, ...rest) => selector(isDraft(value) ? current(value) : value, ...rest);
28502
- Object.assign(wrappedSelector, selector);
28503
- return wrappedSelector;
28504
- }, {
28505
- withTypes: () => createDraftSafeSelector2
28506
- });
28507
- return createDraftSafeSelector2;
28508
- };
28509
- var createDraftSafeSelector = createDraftSafeSelectorCreator(weakMapMemoize);
28510
28497
  var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
28511
- if (arguments.length === 0)
28512
- return void 0;
28513
- if (typeof arguments[0] === "object")
28514
- return compose;
28498
+ if (arguments.length === 0) return void 0;
28499
+ if (typeof arguments[0] === "object") return compose;
28515
28500
  return compose.apply(null, arguments);
28516
28501
  };
28517
28502
  var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() {
@@ -28626,8 +28611,7 @@ function emplace(map, key, handler) {
28626
28611
  }
28627
28612
  return value;
28628
28613
  }
28629
- if (!handler.insert)
28630
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(10) : "No insert provided for key not already in map");
28614
+ if (!handler.insert) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(10) : "No insert provided for key not already in map");
28631
28615
  const inserted = handler.insert(key, map);
28632
28616
  map.set(key, inserted);
28633
28617
  return inserted;
@@ -28712,21 +28696,17 @@ function createImmutableStateInvariantMiddleware(options = {}) {
28712
28696
  return JSON.stringify(obj, getSerialize2(serializer, decycler), indent);
28713
28697
  }, getSerialize2 = function(serializer, decycler) {
28714
28698
  let stack = [], keys = [];
28715
- if (!decycler)
28716
- decycler = function(_2, value) {
28717
- if (stack[0] === value)
28718
- return "[Circular ~]";
28719
- return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
28720
- };
28699
+ if (!decycler) decycler = function(_2, value) {
28700
+ if (stack[0] === value) return "[Circular ~]";
28701
+ return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
28702
+ };
28721
28703
  return function(key, value) {
28722
28704
  if (stack.length > 0) {
28723
28705
  var thisPos = stack.indexOf(this);
28724
28706
  ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
28725
28707
  ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
28726
- if (~stack.indexOf(value))
28727
- value = decycler.call(this, key, value);
28728
- } else
28729
- stack.push(value);
28708
+ if (~stack.indexOf(value)) value = decycler.call(this, key, value);
28709
+ } else stack.push(value);
28730
28710
  return serializer == null ? value : serializer.call(this, key, value);
28731
28711
  };
28732
28712
  };
@@ -28783,8 +28763,7 @@ function findNonSerializableValue(value, path = "", isSerializable = isPlain, ge
28783
28763
  if (typeof value !== "object" || value === null) {
28784
28764
  return false;
28785
28765
  }
28786
- if (cache3?.has(value))
28787
- return false;
28766
+ if (cache3?.has(value)) return false;
28788
28767
  const entries = getEntries != null ? getEntries(value) : Object.entries(value);
28789
28768
  const hasIgnoredPaths = ignoredPaths.length > 0;
28790
28769
  for (const [key, nestedValue] of entries) {
@@ -28813,18 +28792,14 @@ function findNonSerializableValue(value, path = "", isSerializable = isPlain, ge
28813
28792
  }
28814
28793
  }
28815
28794
  }
28816
- if (cache3 && isNestedFrozen(value))
28817
- cache3.add(value);
28795
+ if (cache3 && isNestedFrozen(value)) cache3.add(value);
28818
28796
  return false;
28819
28797
  }
28820
28798
  function isNestedFrozen(value) {
28821
- if (!Object.isFrozen(value))
28822
- return false;
28799
+ if (!Object.isFrozen(value)) return false;
28823
28800
  for (const nestedValue of Object.values(value)) {
28824
- if (typeof nestedValue !== "object" || nestedValue === null)
28825
- continue;
28826
- if (!isNestedFrozen(nestedValue))
28827
- return false;
28801
+ if (typeof nestedValue !== "object" || nestedValue === null) continue;
28802
+ if (!isNestedFrozen(nestedValue)) return false;
28828
28803
  }
28829
28804
  return true;
28830
28805
  }
@@ -28995,7 +28970,6 @@ var buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhanc
28995
28970
  }
28996
28971
  return enhancerArray;
28997
28972
  };
28998
- var IS_PRODUCTION = process.env.NODE_ENV === "production";
28999
28973
  function configureStore(options) {
29000
28974
  const getDefaultMiddleware = buildGetDefaultMiddleware();
29001
28975
  const {
@@ -29013,42 +28987,42 @@ function configureStore(options) {
29013
28987
  } else {
29014
28988
  throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(1) : "`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");
29015
28989
  }
29016
- if (!IS_PRODUCTION && middleware && typeof middleware !== "function") {
28990
+ if (process.env.NODE_ENV !== "production" && middleware && typeof middleware !== "function") {
29017
28991
  throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(2) : "`middleware` field must be a callback");
29018
28992
  }
29019
28993
  let finalMiddleware;
29020
28994
  if (typeof middleware === "function") {
29021
28995
  finalMiddleware = middleware(getDefaultMiddleware);
29022
- if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {
28996
+ if (process.env.NODE_ENV !== "production" && !Array.isArray(finalMiddleware)) {
29023
28997
  throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(3) : "when using a middleware builder function, an array of middleware must be returned");
29024
28998
  }
29025
28999
  } else {
29026
29000
  finalMiddleware = getDefaultMiddleware();
29027
29001
  }
29028
- if (!IS_PRODUCTION && finalMiddleware.some((item) => typeof item !== "function")) {
29002
+ if (process.env.NODE_ENV !== "production" && finalMiddleware.some((item) => typeof item !== "function")) {
29029
29003
  throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(4) : "each middleware provided to configureStore must be a function");
29030
29004
  }
29031
29005
  let finalCompose = compose;
29032
29006
  if (devTools) {
29033
29007
  finalCompose = composeWithDevTools({
29034
29008
  // Enable capture of stack traces for dispatched Redux actions
29035
- trace: !IS_PRODUCTION,
29009
+ trace: process.env.NODE_ENV !== "production",
29036
29010
  ...typeof devTools === "object" && devTools
29037
29011
  });
29038
29012
  }
29039
29013
  const middlewareEnhancer = applyMiddleware(...finalMiddleware);
29040
29014
  const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer);
29041
- if (!IS_PRODUCTION && enhancers && typeof enhancers !== "function") {
29015
+ if (process.env.NODE_ENV !== "production" && enhancers && typeof enhancers !== "function") {
29042
29016
  throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(5) : "`enhancers` field must be a callback");
29043
29017
  }
29044
29018
  let storeEnhancers = typeof enhancers === "function" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers();
29045
- if (!IS_PRODUCTION && !Array.isArray(storeEnhancers)) {
29019
+ if (process.env.NODE_ENV !== "production" && !Array.isArray(storeEnhancers)) {
29046
29020
  throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(6) : "`enhancers` callback must return an array");
29047
29021
  }
29048
- if (!IS_PRODUCTION && storeEnhancers.some((item) => typeof item !== "function")) {
29022
+ if (process.env.NODE_ENV !== "production" && storeEnhancers.some((item) => typeof item !== "function")) {
29049
29023
  throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(7) : "each enhancer provided to configureStore must be a function");
29050
29024
  }
29051
- if (!IS_PRODUCTION && finalMiddleware.length && !storeEnhancers.includes(middlewareEnhancer)) {
29025
+ if (process.env.NODE_ENV !== "production" && finalMiddleware.length && !storeEnhancers.includes(middlewareEnhancer)) {
29052
29026
  console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");
29053
29027
  }
29054
29028
  const composedEnhancer = finalCompose(...storeEnhancers);
@@ -29144,7 +29118,7 @@ function createReducer(initialState3, mapOrBuilderCallback) {
29144
29118
  if (previousState === null) {
29145
29119
  return previousState;
29146
29120
  }
29147
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(9) : "A case reducer on a non-draftable value must not return undefined");
29121
+ throw Error("A case reducer on a non-draftable value must not return undefined");
29148
29122
  }
29149
29123
  return result;
29150
29124
  } else {
@@ -29159,15 +29133,6 @@ function createReducer(initialState3, mapOrBuilderCallback) {
29159
29133
  reducer.getInitialState = getInitialState;
29160
29134
  return reducer;
29161
29135
  }
29162
- var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
29163
- var nanoid = (size = 21) => {
29164
- let id = "";
29165
- let i = size;
29166
- while (i--) {
29167
- id += urlAlphabet[Math.random() * 64 | 0];
29168
- }
29169
- return id;
29170
- };
29171
29136
  var matches = (matcher, action) => {
29172
29137
  if (hasMatchFunction(matcher)) {
29173
29138
  return matcher.match(action);
@@ -29186,8 +29151,7 @@ function isAllOf(...matchers) {
29186
29151
  };
29187
29152
  }
29188
29153
  function hasExpectedRequestMetadata(action, validStatus) {
29189
- if (!action || !action.meta)
29190
- return false;
29154
+ if (!action || !action.meta) return false;
29191
29155
  const hasValidRequestId = typeof action.meta.requestId === "string";
29192
29156
  const hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;
29193
29157
  return hasValidRequestId && hasValidRequestStatus;
@@ -29243,6 +29207,15 @@ function isAsyncThunkAction(...asyncThunks) {
29243
29207
  }
29244
29208
  return isAnyOf(...asyncThunks.flatMap((asyncThunk) => [asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled]));
29245
29209
  }
29210
+ var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
29211
+ var nanoid = (size = 21) => {
29212
+ let id = "";
29213
+ let i = size;
29214
+ while (i--) {
29215
+ id += urlAlphabet[Math.random() * 64 | 0];
29216
+ }
29217
+ return id;
29218
+ };
29246
29219
  var commonProperties = ["name", "message", "stack", "code"];
29247
29220
  var RejectWithValue = class {
29248
29221
  constructor(payload, meta) {
@@ -29526,13 +29499,11 @@ function buildCreateSlice({
29526
29499
  const injectedSelectorCache = /* @__PURE__ */ new Map();
29527
29500
  let _reducer;
29528
29501
  function reducer(state, action) {
29529
- if (!_reducer)
29530
- _reducer = buildReducer();
29502
+ if (!_reducer) _reducer = buildReducer();
29531
29503
  return _reducer(state, action);
29532
29504
  }
29533
29505
  function getInitialState() {
29534
- if (!_reducer)
29535
- _reducer = buildReducer();
29506
+ if (!_reducer) _reducer = buildReducer();
29536
29507
  return _reducer.getInitialState();
29537
29508
  }
29538
29509
  function makeSelectorProps(reducerPath2, injected = false) {
@@ -29712,67 +29683,15 @@ var taskCancelled = `task-${cancelled}`;
29712
29683
  var taskCompleted = `task-${completed}`;
29713
29684
  var listenerCancelled = `${listener}-${cancelled}`;
29714
29685
  var listenerCompleted = `${listener}-${completed}`;
29715
- var assertFunction = (func, expected) => {
29716
- if (typeof func !== "function") {
29717
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(32) : `${expected} is not a function`);
29718
- }
29719
- };
29720
29686
  var {
29721
29687
  assign
29722
29688
  } = Object;
29723
29689
  var alm = "listenerMiddleware";
29724
- var getListenerEntryPropsFrom = (options) => {
29725
- let {
29726
- type,
29727
- actionCreator,
29728
- matcher,
29729
- predicate,
29730
- effect
29731
- } = options;
29732
- if (type) {
29733
- predicate = createAction(type).match;
29734
- } else if (actionCreator) {
29735
- type = actionCreator.type;
29736
- predicate = actionCreator.match;
29737
- } else if (matcher) {
29738
- predicate = matcher;
29739
- } else if (predicate) {
29740
- } else {
29741
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(21) : "Creating or removing a listener requires one of the known fields for matching an action");
29742
- }
29743
- assertFunction(effect, "options.listener");
29744
- return {
29745
- predicate,
29746
- type,
29747
- effect
29748
- };
29749
- };
29750
- var createListenerEntry = Object.assign((options) => {
29751
- const {
29752
- type,
29753
- predicate,
29754
- effect
29755
- } = getListenerEntryPropsFrom(options);
29756
- const id = nanoid();
29757
- const entry = {
29758
- id,
29759
- effect,
29760
- type,
29761
- predicate,
29762
- pending: /* @__PURE__ */ new Set(),
29763
- unsubscribe: () => {
29764
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(22) : "Unsubscribe not initialized");
29765
- }
29766
- };
29767
- return entry;
29768
- }, {
29769
- withTypes: () => createListenerEntry
29770
- });
29771
- var addListener = Object.assign(createAction(`${alm}/add`), {
29690
+ var addListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/add`), {
29772
29691
  withTypes: () => addListener
29773
29692
  });
29774
- var clearAllListeners = createAction(`${alm}/removeAll`);
29775
- var removeListener = Object.assign(createAction(`${alm}/remove`), {
29693
+ var clearAllListeners = /* @__PURE__ */ createAction(`${alm}/removeAll`);
29694
+ var removeListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/remove`), {
29776
29695
  withTypes: () => removeListener
29777
29696
  });
29778
29697
  var ORIGINAL_STATE = Symbol.for("rtk-state-proxy-original");
@@ -29798,9 +29717,44 @@ function getRequestStatusFlags(status) {
29798
29717
  /* rejected */
29799
29718
  };
29800
29719
  }
29720
+ var isPlainObject22 = isPlainObject;
29721
+ function copyWithStructuralSharing(oldObj, newObj) {
29722
+ if (oldObj === newObj || !(isPlainObject22(oldObj) && isPlainObject22(newObj) || Array.isArray(oldObj) && Array.isArray(newObj))) {
29723
+ return newObj;
29724
+ }
29725
+ const newKeys = Object.keys(newObj);
29726
+ const oldKeys = Object.keys(oldObj);
29727
+ let isSameObject = newKeys.length === oldKeys.length;
29728
+ const mergeObj = Array.isArray(newObj) ? [] : {};
29729
+ for (const key of newKeys) {
29730
+ mergeObj[key] = copyWithStructuralSharing(oldObj[key], newObj[key]);
29731
+ if (isSameObject) isSameObject = oldObj[key] === mergeObj[key];
29732
+ }
29733
+ return isSameObject ? oldObj : mergeObj;
29734
+ }
29735
+ function countObjectKeys(obj) {
29736
+ let count = 0;
29737
+ for (const _key in obj) {
29738
+ count++;
29739
+ }
29740
+ return count;
29741
+ }
29742
+ var flatten = (arr) => [].concat(...arr);
29801
29743
  function isAbsoluteUrl(url) {
29802
29744
  return new RegExp(`(^|:)//`).test(url);
29803
29745
  }
29746
+ function isDocumentVisible() {
29747
+ if (typeof document === "undefined") {
29748
+ return true;
29749
+ }
29750
+ return document.visibilityState !== "hidden";
29751
+ }
29752
+ function isNotNullish(v) {
29753
+ return v != null;
29754
+ }
29755
+ function isOnline() {
29756
+ return typeof navigator === "undefined" ? true : navigator.onLine === void 0 ? true : navigator.onLine;
29757
+ }
29804
29758
  var withoutTrailingSlash = (url) => url.replace(/\/$/, "");
29805
29759
  var withoutLeadingSlash = (url) => url.replace(/^\//, "");
29806
29760
  function joinUrls(base, url) {
@@ -29818,32 +29772,6 @@ function joinUrls(base, url) {
29818
29772
  url = withoutLeadingSlash(url);
29819
29773
  return `${base}${delimiter}${url}`;
29820
29774
  }
29821
- var flatten = (arr) => [].concat(...arr);
29822
- function isOnline() {
29823
- return typeof navigator === "undefined" ? true : navigator.onLine === void 0 ? true : navigator.onLine;
29824
- }
29825
- function isDocumentVisible() {
29826
- if (typeof document === "undefined") {
29827
- return true;
29828
- }
29829
- return document.visibilityState !== "hidden";
29830
- }
29831
- var isPlainObject22 = isPlainObject;
29832
- function copyWithStructuralSharing(oldObj, newObj) {
29833
- if (oldObj === newObj || !(isPlainObject22(oldObj) && isPlainObject22(newObj) || Array.isArray(oldObj) && Array.isArray(newObj))) {
29834
- return newObj;
29835
- }
29836
- const newKeys = Object.keys(newObj);
29837
- const oldKeys = Object.keys(oldObj);
29838
- let isSameObject = newKeys.length === oldKeys.length;
29839
- const mergeObj = Array.isArray(newObj) ? [] : {};
29840
- for (const key of newKeys) {
29841
- mergeObj[key] = copyWithStructuralSharing(oldObj[key], newObj[key]);
29842
- if (isSameObject)
29843
- isSameObject = oldObj[key] === mergeObj[key];
29844
- }
29845
- return isSameObject ? oldObj : mergeObj;
29846
- }
29847
29775
  var defaultFetchFn = (...args) => fetch(...args);
29848
29776
  var defaultValidateStatus = (response) => response.status >= 200 && response.status <= 299;
29849
29777
  var defaultIsJsonContentType = (headers) => (
@@ -29858,8 +29786,7 @@ function stripUndefined(obj) {
29858
29786
  ...obj
29859
29787
  };
29860
29788
  for (const [k, v] of Object.entries(copy)) {
29861
- if (v === void 0)
29862
- delete copy[k];
29789
+ if (v === void 0) delete copy[k];
29863
29790
  }
29864
29791
  return copy;
29865
29792
  }
@@ -29879,9 +29806,8 @@ function fetchBaseQuery({
29879
29806
  if (typeof fetch === "undefined" && fetchFn === defaultFetchFn) {
29880
29807
  console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments.");
29881
29808
  }
29882
- return async (arg, api) => {
29809
+ return async (arg, api, extraOptions) => {
29883
29810
  const {
29884
- signal,
29885
29811
  getState,
29886
29812
  extra,
29887
29813
  endpoint,
@@ -29900,6 +29826,12 @@ function fetchBaseQuery({
29900
29826
  } = typeof arg == "string" ? {
29901
29827
  url: arg
29902
29828
  } : arg;
29829
+ let abortController, signal = api.signal;
29830
+ if (timeout) {
29831
+ abortController = new AbortController();
29832
+ api.signal.addEventListener("abort", abortController.abort);
29833
+ signal = abortController.signal;
29834
+ }
29903
29835
  let config = {
29904
29836
  ...baseFetchOptions,
29905
29837
  signal,
@@ -29908,10 +29840,12 @@ function fetchBaseQuery({
29908
29840
  headers = new Headers(stripUndefined(headers));
29909
29841
  config.headers = await prepareHeaders2(headers, {
29910
29842
  getState,
29843
+ arg,
29911
29844
  extra,
29912
29845
  endpoint,
29913
29846
  forced,
29914
- type
29847
+ type,
29848
+ extraOptions
29915
29849
  }) || headers;
29916
29850
  const isJsonifiable = (body) => typeof body === "object" && (isPlainObject(body) || Array.isArray(body) || typeof body.toJSON === "function");
29917
29851
  if (!config.headers.has("content-type") && isJsonifiable(config.body)) {
@@ -29931,9 +29865,9 @@ function fetchBaseQuery({
29931
29865
  meta = {
29932
29866
  request: requestClone
29933
29867
  };
29934
- let response, timedOut = false, timeoutId = timeout && setTimeout(() => {
29868
+ let response, timedOut = false, timeoutId = abortController && setTimeout(() => {
29935
29869
  timedOut = true;
29936
- api.abort();
29870
+ abortController.abort();
29937
29871
  }, timeout);
29938
29872
  try {
29939
29873
  response = await fetchFn(request);
@@ -29946,8 +29880,8 @@ function fetchBaseQuery({
29946
29880
  meta
29947
29881
  };
29948
29882
  } finally {
29949
- if (timeoutId)
29950
- clearTimeout(timeoutId);
29883
+ if (timeoutId) clearTimeout(timeoutId);
29884
+ abortController?.signal.removeEventListener("abort", abortController.abort);
29951
29885
  }
29952
29886
  const responseClone = response.clone();
29953
29887
  meta.response = responseClone;
@@ -29962,8 +29896,7 @@ function fetchBaseQuery({
29962
29896
  responseClone.text().then((r) => responseText = r, () => {
29963
29897
  })
29964
29898
  ]);
29965
- if (handleResponseError)
29966
- throw handleResponseError;
29899
+ if (handleResponseError) throw handleResponseError;
29967
29900
  } catch (e) {
29968
29901
  return {
29969
29902
  error: {
@@ -30033,16 +29966,6 @@ function expandTagDescription(description) {
30033
29966
  type: description
30034
29967
  } : description;
30035
29968
  }
30036
- function isNotNullish(v) {
30037
- return v != null;
30038
- }
30039
- function countObjectKeys(obj) {
30040
- let count = 0;
30041
- for (const _key in obj) {
30042
- count++;
30043
- }
30044
- return count;
30045
- }
30046
29969
  function asSafePromise(promise, fallback) {
30047
29970
  return promise.catch(fallback);
30048
29971
  }
@@ -30094,8 +30017,7 @@ function buildInitiate({
30094
30017
  }
30095
30018
  function middlewareWarning(dispatch) {
30096
30019
  if (process.env.NODE_ENV !== "production") {
30097
- if (middlewareWarning.triggered)
30098
- return;
30020
+ if (middlewareWarning.triggered) return;
30099
30021
  const returnedValue = dispatch(api.internalActions.internal_getRTKQSubscriptions());
30100
30022
  middlewareWarning.triggered = true;
30101
30023
  if (typeof returnedValue !== "object" || typeof returnedValue?.type === "string") {
@@ -30169,11 +30091,10 @@ You must add the middleware for RTK-Query to function correctly!`);
30169
30091
  forceRefetch: true
30170
30092
  })),
30171
30093
  unsubscribe() {
30172
- if (subscribe)
30173
- dispatch(unsubscribeQueryResult({
30174
- queryCacheKey,
30175
- requestId
30176
- }));
30094
+ if (subscribe) dispatch(unsubscribeQueryResult({
30095
+ queryCacheKey,
30096
+ requestId
30097
+ }));
30177
30098
  },
30178
30099
  updateSubscriptionOptions(options) {
30179
30100
  statePromise.subscriptionOptions = options;
@@ -30274,10 +30195,10 @@ function buildThunks({
30274
30195
  api,
30275
30196
  assertTagType
30276
30197
  }) {
30277
- const patchQueryData = (endpointName, args, patches, updateProvided) => (dispatch, getState) => {
30198
+ const patchQueryData = (endpointName, arg, patches, updateProvided) => (dispatch, getState) => {
30278
30199
  const endpointDefinition = endpointDefinitions[endpointName];
30279
30200
  const queryCacheKey = serializeQueryArgs({
30280
- queryArgs: args,
30201
+ queryArgs: arg,
30281
30202
  endpointDefinition,
30282
30203
  endpointName
30283
30204
  });
@@ -30288,26 +30209,26 @@ function buildThunks({
30288
30209
  if (!updateProvided) {
30289
30210
  return;
30290
30211
  }
30291
- const newValue = api.endpoints[endpointName].select(args)(
30212
+ const newValue = api.endpoints[endpointName].select(arg)(
30292
30213
  // Work around TS 4.1 mismatch
30293
30214
  getState()
30294
30215
  );
30295
- const providedTags = calculateProvidedBy(endpointDefinition.providesTags, newValue.data, void 0, args, {}, assertTagType);
30216
+ const providedTags = calculateProvidedBy(endpointDefinition.providesTags, newValue.data, void 0, arg, {}, assertTagType);
30296
30217
  dispatch(api.internalActions.updateProvidedBy({
30297
30218
  queryCacheKey,
30298
30219
  providedTags
30299
30220
  }));
30300
30221
  };
30301
- const updateQueryData = (endpointName, args, updateRecipe, updateProvided = true) => (dispatch, getState) => {
30222
+ const updateQueryData = (endpointName, arg, updateRecipe, updateProvided = true) => (dispatch, getState) => {
30302
30223
  const endpointDefinition = api.endpoints[endpointName];
30303
- const currentState = endpointDefinition.select(args)(
30224
+ const currentState = endpointDefinition.select(arg)(
30304
30225
  // Work around TS 4.1 mismatch
30305
30226
  getState()
30306
30227
  );
30307
- let ret = {
30228
+ const ret = {
30308
30229
  patches: [],
30309
30230
  inversePatches: [],
30310
- undo: () => dispatch(api.util.patchQueryData(endpointName, args, ret.inversePatches, updateProvided))
30231
+ undo: () => dispatch(api.util.patchQueryData(endpointName, arg, ret.inversePatches, updateProvided))
30311
30232
  };
30312
30233
  if (currentState.status === "uninitialized") {
30313
30234
  return ret;
@@ -30336,11 +30257,11 @@ function buildThunks({
30336
30257
  if (ret.patches.length === 0) {
30337
30258
  return ret;
30338
30259
  }
30339
- dispatch(api.util.patchQueryData(endpointName, args, ret.patches, updateProvided));
30260
+ dispatch(api.util.patchQueryData(endpointName, arg, ret.patches, updateProvided));
30340
30261
  return ret;
30341
30262
  };
30342
- const upsertQueryData = (endpointName, args, value) => (dispatch) => {
30343
- return dispatch(api.endpoints[endpointName].initiate(args, {
30263
+ const upsertQueryData = (endpointName, arg, value) => (dispatch) => {
30264
+ return dispatch(api.endpoints[endpointName].initiate(arg, {
30344
30265
  subscribe: false,
30345
30266
  forceRefetch: true,
30346
30267
  [forceQueryFnSymbol]: () => ({
@@ -30369,7 +30290,8 @@ function buildThunks({
30369
30290
  extra,
30370
30291
  endpoint: arg.endpointName,
30371
30292
  type: arg.type,
30372
- forced: arg.type === "query" ? isForcedQuery(arg, getState()) : void 0
30293
+ forced: arg.type === "query" ? isForcedQuery(arg, getState()) : void 0,
30294
+ queryCacheKey: arg.type === "query" ? arg.queryCacheKey : void 0
30373
30295
  };
30374
30296
  const forceQueryFn = arg.type === "query" ? arg[forceQueryFnSymbol] : void 0;
30375
30297
  if (forceQueryFn) {
@@ -30408,8 +30330,7 @@ function buildThunks({
30408
30330
  Object returned was:`, result);
30409
30331
  }
30410
30332
  }
30411
- if (result.error)
30412
- throw new HandledError(result.error, result.meta);
30333
+ if (result.error) throw new HandledError(result.error, result.meta);
30413
30334
  return fulfillWithValue(await transformResponse(result.data, result.meta, arg.originalArgs), {
30414
30335
  fulfilledTimeStamp: Date.now(),
30415
30336
  baseQueryMeta: result.meta,
@@ -30570,6 +30491,7 @@ function buildSlice({
30570
30491
  reducerPath,
30571
30492
  queryThunk,
30572
30493
  mutationThunk,
30494
+ serializeQueryArgs,
30573
30495
  context: {
30574
30496
  endpointDefinitions: definitions,
30575
30497
  apiUid,
@@ -30580,6 +30502,61 @@ function buildSlice({
30580
30502
  config
30581
30503
  }) {
30582
30504
  const resetApiState = createAction(`${reducerPath}/resetApiState`);
30505
+ function writePendingCacheEntry(draft, arg, upserting, meta) {
30506
+ var _a;
30507
+ draft[_a = arg.queryCacheKey] ?? (draft[_a] = {
30508
+ status: "uninitialized",
30509
+ endpointName: arg.endpointName
30510
+ });
30511
+ updateQuerySubstateIfExists(draft, arg.queryCacheKey, (substate) => {
30512
+ substate.status = "pending";
30513
+ substate.requestId = upserting && substate.requestId ? (
30514
+ // for `upsertQuery` **updates**, keep the current `requestId`
30515
+ substate.requestId
30516
+ ) : (
30517
+ // for normal queries or `upsertQuery` **inserts** always update the `requestId`
30518
+ meta.requestId
30519
+ );
30520
+ if (arg.originalArgs !== void 0) {
30521
+ substate.originalArgs = arg.originalArgs;
30522
+ }
30523
+ substate.startedTimeStamp = meta.startedTimeStamp;
30524
+ });
30525
+ }
30526
+ function writeFulfilledCacheEntry(draft, meta, payload) {
30527
+ updateQuerySubstateIfExists(draft, meta.arg.queryCacheKey, (substate) => {
30528
+ if (substate.requestId !== meta.requestId && !isUpsertQuery(meta.arg)) return;
30529
+ const {
30530
+ merge
30531
+ } = definitions[meta.arg.endpointName];
30532
+ substate.status = "fulfilled";
30533
+ if (merge) {
30534
+ if (substate.data !== void 0) {
30535
+ const {
30536
+ fulfilledTimeStamp,
30537
+ arg,
30538
+ baseQueryMeta,
30539
+ requestId
30540
+ } = meta;
30541
+ let newData = produce(substate.data, (draftSubstateData) => {
30542
+ return merge(draftSubstateData, payload, {
30543
+ arg: arg.originalArgs,
30544
+ baseQueryMeta,
30545
+ fulfilledTimeStamp,
30546
+ requestId
30547
+ });
30548
+ });
30549
+ substate.data = newData;
30550
+ } else {
30551
+ substate.data = payload;
30552
+ }
30553
+ } else {
30554
+ substate.data = definitions[meta.arg.endpointName].structuralSharing ?? true ? copyWithStructuralSharing(isDraft(substate.data) ? original(substate.data) : substate.data, payload) : payload;
30555
+ }
30556
+ delete substate.error;
30557
+ substate.fulfilledTimeStamp = meta.fulfilledTimeStamp;
30558
+ });
30559
+ }
30583
30560
  const querySlice = createSlice({
30584
30561
  name: `${reducerPath}/queries`,
30585
30562
  initialState,
@@ -30594,6 +30571,60 @@ function buildSlice({
30594
30571
  },
30595
30572
  prepare: prepareAutoBatched()
30596
30573
  },
30574
+ cacheEntriesUpserted: {
30575
+ reducer(draft, action) {
30576
+ for (const entry of action.payload) {
30577
+ const {
30578
+ queryDescription: arg,
30579
+ value
30580
+ } = entry;
30581
+ writePendingCacheEntry(draft, arg, true, {
30582
+ arg,
30583
+ requestId: action.meta.requestId,
30584
+ startedTimeStamp: action.meta.timestamp
30585
+ });
30586
+ writeFulfilledCacheEntry(draft, {
30587
+ arg,
30588
+ requestId: action.meta.requestId,
30589
+ fulfilledTimeStamp: action.meta.timestamp,
30590
+ baseQueryMeta: {}
30591
+ }, value);
30592
+ }
30593
+ },
30594
+ prepare: (payload) => {
30595
+ const queryDescriptions = payload.map((entry) => {
30596
+ const {
30597
+ endpointName,
30598
+ arg,
30599
+ value
30600
+ } = entry;
30601
+ const endpointDefinition = definitions[endpointName];
30602
+ const queryDescription = {
30603
+ type: "query",
30604
+ endpointName,
30605
+ originalArgs: entry.arg,
30606
+ queryCacheKey: serializeQueryArgs({
30607
+ queryArgs: arg,
30608
+ endpointDefinition,
30609
+ endpointName
30610
+ })
30611
+ };
30612
+ return {
30613
+ queryDescription,
30614
+ value
30615
+ };
30616
+ });
30617
+ const result = {
30618
+ payload: queryDescriptions,
30619
+ meta: {
30620
+ [SHOULD_AUTOBATCH]: true,
30621
+ requestId: nanoid(),
30622
+ timestamp: Date.now()
30623
+ }
30624
+ };
30625
+ return result;
30626
+ }
30627
+ },
30597
30628
  queryResultPatched: {
30598
30629
  reducer(draft, {
30599
30630
  payload: {
@@ -30615,63 +30646,13 @@ function buildSlice({
30615
30646
  arg
30616
30647
  }
30617
30648
  }) => {
30618
- var _a;
30619
30649
  const upserting = isUpsertQuery(arg);
30620
- draft[_a = arg.queryCacheKey] ?? (draft[_a] = {
30621
- status: "uninitialized",
30622
- endpointName: arg.endpointName
30623
- });
30624
- updateQuerySubstateIfExists(draft, arg.queryCacheKey, (substate) => {
30625
- substate.status = "pending";
30626
- substate.requestId = upserting && substate.requestId ? (
30627
- // for `upsertQuery` **updates**, keep the current `requestId`
30628
- substate.requestId
30629
- ) : (
30630
- // for normal queries or `upsertQuery` **inserts** always update the `requestId`
30631
- meta.requestId
30632
- );
30633
- if (arg.originalArgs !== void 0) {
30634
- substate.originalArgs = arg.originalArgs;
30635
- }
30636
- substate.startedTimeStamp = meta.startedTimeStamp;
30637
- });
30650
+ writePendingCacheEntry(draft, arg, upserting, meta);
30638
30651
  }).addCase(queryThunk.fulfilled, (draft, {
30639
30652
  meta,
30640
30653
  payload
30641
30654
  }) => {
30642
- updateQuerySubstateIfExists(draft, meta.arg.queryCacheKey, (substate) => {
30643
- if (substate.requestId !== meta.requestId && !isUpsertQuery(meta.arg))
30644
- return;
30645
- const {
30646
- merge
30647
- } = definitions[meta.arg.endpointName];
30648
- substate.status = "fulfilled";
30649
- if (merge) {
30650
- if (substate.data !== void 0) {
30651
- const {
30652
- fulfilledTimeStamp,
30653
- arg,
30654
- baseQueryMeta,
30655
- requestId
30656
- } = meta;
30657
- let newData = produce(substate.data, (draftSubstateData) => {
30658
- return merge(draftSubstateData, payload, {
30659
- arg: arg.originalArgs,
30660
- baseQueryMeta,
30661
- fulfilledTimeStamp,
30662
- requestId
30663
- });
30664
- });
30665
- substate.data = newData;
30666
- } else {
30667
- substate.data = payload;
30668
- }
30669
- } else {
30670
- substate.data = definitions[meta.arg.endpointName].structuralSharing ?? true ? copyWithStructuralSharing(isDraft(substate.data) ? original(substate.data) : substate.data, payload) : payload;
30671
- }
30672
- delete substate.error;
30673
- substate.fulfilledTimeStamp = meta.fulfilledTimeStamp;
30674
- });
30655
+ writeFulfilledCacheEntry(draft, meta, payload);
30675
30656
  }).addCase(queryThunk.rejected, (draft, {
30676
30657
  meta: {
30677
30658
  condition,
@@ -30684,8 +30665,7 @@ function buildSlice({
30684
30665
  updateQuerySubstateIfExists(draft, arg.queryCacheKey, (substate) => {
30685
30666
  if (condition) {
30686
30667
  } else {
30687
- if (substate.requestId !== requestId)
30688
- return;
30668
+ if (substate.requestId !== requestId) return;
30689
30669
  substate.status = "rejected";
30690
30670
  substate.error = payload ?? error;
30691
30671
  }
@@ -30730,8 +30710,7 @@ function buildSlice({
30730
30710
  startedTimeStamp
30731
30711
  }
30732
30712
  }) => {
30733
- if (!arg.track)
30734
- return;
30713
+ if (!arg.track) return;
30735
30714
  draft[getMutationCacheKey(meta)] = {
30736
30715
  requestId,
30737
30716
  status: "pending",
@@ -30742,11 +30721,9 @@ function buildSlice({
30742
30721
  payload,
30743
30722
  meta
30744
30723
  }) => {
30745
- if (!meta.arg.track)
30746
- return;
30724
+ if (!meta.arg.track) return;
30747
30725
  updateMutationSubstateIfExists(draft, meta, (substate) => {
30748
- if (substate.requestId !== meta.requestId)
30749
- return;
30726
+ if (substate.requestId !== meta.requestId) return;
30750
30727
  substate.status = "fulfilled";
30751
30728
  substate.data = payload;
30752
30729
  substate.fulfilledTimeStamp = meta.fulfilledTimeStamp;
@@ -30756,11 +30733,9 @@ function buildSlice({
30756
30733
  error,
30757
30734
  meta
30758
30735
  }) => {
30759
- if (!meta.arg.track)
30760
- return;
30736
+ if (!meta.arg.track) return;
30761
30737
  updateMutationSubstateIfExists(draft, meta, (substate) => {
30762
- if (substate.requestId !== meta.requestId)
30763
- return;
30738
+ if (substate.requestId !== meta.requestId) return;
30764
30739
  substate.status = "rejected";
30765
30740
  substate.error = payload ?? error;
30766
30741
  });
@@ -30962,8 +30937,7 @@ function buildSelectors({
30962
30937
  const state = rootState[reducerPath];
30963
30938
  if (process.env.NODE_ENV !== "production") {
30964
30939
  if (!state) {
30965
- if (selectInternalState.triggered)
30966
- return state;
30940
+ if (selectInternalState.triggered) return state;
30967
30941
  selectInternalState.triggered = true;
30968
30942
  console.error(`Error: No data found at \`state.${reducerPath}\`. Did you forget to add the reducer to the store?`);
30969
30943
  }
@@ -31163,8 +31137,135 @@ function buildCreateApi(...modules) {
31163
31137
  });
31164
31138
  };
31165
31139
  }
31140
+ function assertCast(v) {
31141
+ }
31142
+ function safeAssign(target, ...args) {
31143
+ return Object.assign(target, ...args);
31144
+ }
31145
+ var buildBatchedActionsHandler = ({
31146
+ api,
31147
+ queryThunk,
31148
+ internalState
31149
+ }) => {
31150
+ const subscriptionsPrefix = `${api.reducerPath}/subscriptions`;
31151
+ let previousSubscriptions = null;
31152
+ let updateSyncTimer = null;
31153
+ const {
31154
+ updateSubscriptionOptions,
31155
+ unsubscribeQueryResult
31156
+ } = api.internalActions;
31157
+ const actuallyMutateSubscriptions = (mutableState, action) => {
31158
+ var _a, _b;
31159
+ if (updateSubscriptionOptions.match(action)) {
31160
+ const {
31161
+ queryCacheKey,
31162
+ requestId,
31163
+ options
31164
+ } = action.payload;
31165
+ if (mutableState?.[queryCacheKey]?.[requestId]) {
31166
+ mutableState[queryCacheKey][requestId] = options;
31167
+ }
31168
+ return true;
31169
+ }
31170
+ if (unsubscribeQueryResult.match(action)) {
31171
+ const {
31172
+ queryCacheKey,
31173
+ requestId
31174
+ } = action.payload;
31175
+ if (mutableState[queryCacheKey]) {
31176
+ delete mutableState[queryCacheKey][requestId];
31177
+ }
31178
+ return true;
31179
+ }
31180
+ if (api.internalActions.removeQueryResult.match(action)) {
31181
+ delete mutableState[action.payload.queryCacheKey];
31182
+ return true;
31183
+ }
31184
+ if (queryThunk.pending.match(action)) {
31185
+ const {
31186
+ meta: {
31187
+ arg,
31188
+ requestId
31189
+ }
31190
+ } = action;
31191
+ const substate = mutableState[_a = arg.queryCacheKey] ?? (mutableState[_a] = {});
31192
+ substate[`${requestId}_running`] = {};
31193
+ if (arg.subscribe) {
31194
+ substate[requestId] = arg.subscriptionOptions ?? substate[requestId] ?? {};
31195
+ }
31196
+ return true;
31197
+ }
31198
+ let mutated = false;
31199
+ if (queryThunk.fulfilled.match(action) || queryThunk.rejected.match(action)) {
31200
+ const state = mutableState[action.meta.arg.queryCacheKey] || {};
31201
+ const key = `${action.meta.requestId}_running`;
31202
+ mutated || (mutated = !!state[key]);
31203
+ delete state[key];
31204
+ }
31205
+ if (queryThunk.rejected.match(action)) {
31206
+ const {
31207
+ meta: {
31208
+ condition,
31209
+ arg,
31210
+ requestId
31211
+ }
31212
+ } = action;
31213
+ if (condition && arg.subscribe) {
31214
+ const substate = mutableState[_b = arg.queryCacheKey] ?? (mutableState[_b] = {});
31215
+ substate[requestId] = arg.subscriptionOptions ?? substate[requestId] ?? {};
31216
+ mutated = true;
31217
+ }
31218
+ }
31219
+ return mutated;
31220
+ };
31221
+ const getSubscriptions = () => internalState.currentSubscriptions;
31222
+ const getSubscriptionCount = (queryCacheKey) => {
31223
+ const subscriptions = getSubscriptions();
31224
+ const subscriptionsForQueryArg = subscriptions[queryCacheKey] ?? {};
31225
+ return countObjectKeys(subscriptionsForQueryArg);
31226
+ };
31227
+ const isRequestSubscribed = (queryCacheKey, requestId) => {
31228
+ const subscriptions = getSubscriptions();
31229
+ return !!subscriptions?.[queryCacheKey]?.[requestId];
31230
+ };
31231
+ const subscriptionSelectors = {
31232
+ getSubscriptions,
31233
+ getSubscriptionCount,
31234
+ isRequestSubscribed
31235
+ };
31236
+ return (action, mwApi) => {
31237
+ if (!previousSubscriptions) {
31238
+ previousSubscriptions = JSON.parse(JSON.stringify(internalState.currentSubscriptions));
31239
+ }
31240
+ if (api.util.resetApiState.match(action)) {
31241
+ previousSubscriptions = internalState.currentSubscriptions = {};
31242
+ updateSyncTimer = null;
31243
+ return [true, false];
31244
+ }
31245
+ if (api.internalActions.internal_getRTKQSubscriptions.match(action)) {
31246
+ return [false, subscriptionSelectors];
31247
+ }
31248
+ const didMutate = actuallyMutateSubscriptions(internalState.currentSubscriptions, action);
31249
+ let actionShouldContinue = true;
31250
+ if (didMutate) {
31251
+ if (!updateSyncTimer) {
31252
+ updateSyncTimer = setTimeout(() => {
31253
+ const newSubscriptions = JSON.parse(JSON.stringify(internalState.currentSubscriptions));
31254
+ const [, patches] = produceWithPatches(previousSubscriptions, () => newSubscriptions);
31255
+ mwApi.next(api.internalActions.subscriptionsUpdated(patches));
31256
+ previousSubscriptions = newSubscriptions;
31257
+ updateSyncTimer = null;
31258
+ }, 500);
31259
+ }
31260
+ const isSubscriptionSliceAction = typeof action.type == "string" && !!action.type.startsWith(subscriptionsPrefix);
31261
+ const isAdditionalSubscriptionAction = queryThunk.rejected.match(action) && action.meta.condition && !!action.meta.arg.subscribe;
31262
+ actionShouldContinue = !isSubscriptionSliceAction && !isAdditionalSubscriptionAction;
31263
+ }
31264
+ return [actionShouldContinue, false];
31265
+ };
31266
+ };
31166
31267
  function isObjectEmpty(obj) {
31167
- for (let k in obj) {
31268
+ for (const k in obj) {
31168
31269
  return false;
31169
31270
  }
31170
31271
  return true;
@@ -31179,9 +31280,10 @@ var buildCacheCollectionHandler = ({
31179
31280
  }) => {
31180
31281
  const {
31181
31282
  removeQueryResult,
31182
- unsubscribeQueryResult
31283
+ unsubscribeQueryResult,
31284
+ cacheEntriesUpserted
31183
31285
  } = api.internalActions;
31184
- const canTriggerUnsubscribe = isAnyOf(unsubscribeQueryResult.match, queryThunk.fulfilled, queryThunk.rejected);
31286
+ const canTriggerUnsubscribe = isAnyOf(unsubscribeQueryResult.match, queryThunk.fulfilled, queryThunk.rejected, cacheEntriesUpserted.match);
31185
31287
  function anySubscriptionsRemainingForKey(queryCacheKey) {
31186
31288
  const subscriptions = internalState.currentSubscriptions[queryCacheKey];
31187
31289
  return !!subscriptions && !isObjectEmpty(subscriptions);
@@ -31190,15 +31292,22 @@ var buildCacheCollectionHandler = ({
31190
31292
  const handler = (action, mwApi, internalState2) => {
31191
31293
  if (canTriggerUnsubscribe(action)) {
31192
31294
  const state = mwApi.getState()[reducerPath];
31193
- const {
31194
- queryCacheKey
31195
- } = unsubscribeQueryResult.match(action) ? action.payload : action.meta.arg;
31196
- handleUnsubscribe(queryCacheKey, state.queries[queryCacheKey]?.endpointName, mwApi, state.config);
31295
+ let queryCacheKeys;
31296
+ if (cacheEntriesUpserted.match(action)) {
31297
+ queryCacheKeys = action.payload.map((entry) => entry.queryDescription.queryCacheKey);
31298
+ } else {
31299
+ const {
31300
+ queryCacheKey
31301
+ } = unsubscribeQueryResult.match(action) ? action.payload : action.meta.arg;
31302
+ queryCacheKeys = [queryCacheKey];
31303
+ }
31304
+ for (const queryCacheKey of queryCacheKeys) {
31305
+ handleUnsubscribe(queryCacheKey, state.queries[queryCacheKey]?.endpointName, mwApi, state.config);
31306
+ }
31197
31307
  }
31198
31308
  if (api.util.resetApiState.match(action)) {
31199
31309
  for (const [key, timeout] of Object.entries(currentRemovalTimeouts)) {
31200
- if (timeout)
31201
- clearTimeout(timeout);
31310
+ if (timeout) clearTimeout(timeout);
31202
31311
  delete currentRemovalTimeouts[key];
31203
31312
  }
31204
31313
  }
@@ -31236,6 +31345,139 @@ var buildCacheCollectionHandler = ({
31236
31345
  }
31237
31346
  return handler;
31238
31347
  };
31348
+ var neverResolvedError = new Error("Promise never resolved before cacheEntryRemoved.");
31349
+ var buildCacheLifecycleHandler = ({
31350
+ api,
31351
+ reducerPath,
31352
+ context,
31353
+ queryThunk,
31354
+ mutationThunk,
31355
+ internalState
31356
+ }) => {
31357
+ const isQueryThunk = isAsyncThunkAction(queryThunk);
31358
+ const isMutationThunk = isAsyncThunkAction(mutationThunk);
31359
+ const isFulfilledThunk = isFulfilled(queryThunk, mutationThunk);
31360
+ const lifecycleMap = {};
31361
+ function resolveLifecycleEntry(cacheKey, data, meta) {
31362
+ const lifecycle = lifecycleMap[cacheKey];
31363
+ if (lifecycle?.valueResolved) {
31364
+ lifecycle.valueResolved({
31365
+ data,
31366
+ meta
31367
+ });
31368
+ delete lifecycle.valueResolved;
31369
+ }
31370
+ }
31371
+ function removeLifecycleEntry(cacheKey) {
31372
+ const lifecycle = lifecycleMap[cacheKey];
31373
+ if (lifecycle) {
31374
+ delete lifecycleMap[cacheKey];
31375
+ lifecycle.cacheEntryRemoved();
31376
+ }
31377
+ }
31378
+ const handler = (action, mwApi, stateBefore) => {
31379
+ const cacheKey = getCacheKey(action);
31380
+ function checkForNewCacheKey(endpointName, cacheKey2, requestId, originalArgs) {
31381
+ const oldState = stateBefore[reducerPath].queries[cacheKey2];
31382
+ const state = mwApi.getState()[reducerPath].queries[cacheKey2];
31383
+ if (!oldState && state) {
31384
+ handleNewKey(endpointName, originalArgs, cacheKey2, mwApi, requestId);
31385
+ }
31386
+ }
31387
+ if (queryThunk.pending.match(action)) {
31388
+ checkForNewCacheKey(action.meta.arg.endpointName, cacheKey, action.meta.requestId, action.meta.arg.originalArgs);
31389
+ } else if (api.internalActions.cacheEntriesUpserted.match(action)) {
31390
+ for (const {
31391
+ queryDescription,
31392
+ value
31393
+ } of action.payload) {
31394
+ const {
31395
+ endpointName,
31396
+ originalArgs,
31397
+ queryCacheKey
31398
+ } = queryDescription;
31399
+ checkForNewCacheKey(endpointName, queryCacheKey, action.meta.requestId, originalArgs);
31400
+ resolveLifecycleEntry(queryCacheKey, value, {});
31401
+ }
31402
+ } else if (mutationThunk.pending.match(action)) {
31403
+ const state = mwApi.getState()[reducerPath].mutations[cacheKey];
31404
+ if (state) {
31405
+ handleNewKey(action.meta.arg.endpointName, action.meta.arg.originalArgs, cacheKey, mwApi, action.meta.requestId);
31406
+ }
31407
+ } else if (isFulfilledThunk(action)) {
31408
+ resolveLifecycleEntry(cacheKey, action.payload, action.meta.baseQueryMeta);
31409
+ } else if (api.internalActions.removeQueryResult.match(action) || api.internalActions.removeMutationResult.match(action)) {
31410
+ removeLifecycleEntry(cacheKey);
31411
+ } else if (api.util.resetApiState.match(action)) {
31412
+ for (const cacheKey2 of Object.keys(lifecycleMap)) {
31413
+ removeLifecycleEntry(cacheKey2);
31414
+ }
31415
+ }
31416
+ };
31417
+ function getCacheKey(action) {
31418
+ if (isQueryThunk(action)) return action.meta.arg.queryCacheKey;
31419
+ if (isMutationThunk(action)) {
31420
+ return action.meta.arg.fixedCacheKey ?? action.meta.requestId;
31421
+ }
31422
+ if (api.internalActions.removeQueryResult.match(action)) return action.payload.queryCacheKey;
31423
+ if (api.internalActions.removeMutationResult.match(action)) return getMutationCacheKey(action.payload);
31424
+ return "";
31425
+ }
31426
+ function handleNewKey(endpointName, originalArgs, queryCacheKey, mwApi, requestId) {
31427
+ const endpointDefinition = context.endpointDefinitions[endpointName];
31428
+ const onCacheEntryAdded = endpointDefinition?.onCacheEntryAdded;
31429
+ if (!onCacheEntryAdded) return;
31430
+ const lifecycle = {};
31431
+ const cacheEntryRemoved = new Promise((resolve) => {
31432
+ lifecycle.cacheEntryRemoved = resolve;
31433
+ });
31434
+ const cacheDataLoaded = Promise.race([new Promise((resolve) => {
31435
+ lifecycle.valueResolved = resolve;
31436
+ }), cacheEntryRemoved.then(() => {
31437
+ throw neverResolvedError;
31438
+ })]);
31439
+ cacheDataLoaded.catch(() => {
31440
+ });
31441
+ lifecycleMap[queryCacheKey] = lifecycle;
31442
+ const selector = api.endpoints[endpointName].select(endpointDefinition.type === "query" ? originalArgs : queryCacheKey);
31443
+ const extra = mwApi.dispatch((_2, __, extra2) => extra2);
31444
+ const lifecycleApi = {
31445
+ ...mwApi,
31446
+ getCacheEntry: () => selector(mwApi.getState()),
31447
+ requestId,
31448
+ extra,
31449
+ updateCachedData: endpointDefinition.type === "query" ? (updateRecipe) => mwApi.dispatch(api.util.updateQueryData(endpointName, originalArgs, updateRecipe)) : void 0,
31450
+ cacheDataLoaded,
31451
+ cacheEntryRemoved
31452
+ };
31453
+ const runningHandler = onCacheEntryAdded(originalArgs, lifecycleApi);
31454
+ Promise.resolve(runningHandler).catch((e) => {
31455
+ if (e === neverResolvedError) return;
31456
+ throw e;
31457
+ });
31458
+ }
31459
+ return handler;
31460
+ };
31461
+ var buildDevCheckHandler = ({
31462
+ api,
31463
+ context: {
31464
+ apiUid
31465
+ },
31466
+ reducerPath
31467
+ }) => {
31468
+ return (action, mwApi) => {
31469
+ if (api.util.resetApiState.match(action)) {
31470
+ mwApi.dispatch(api.internalActions.middlewareRegistered(apiUid));
31471
+ }
31472
+ if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
31473
+ if (api.internalActions.middlewareRegistered.match(action) && action.payload === apiUid && mwApi.getState()[reducerPath]?.config?.middlewareRegistered === "conflict") {
31474
+ console.warn(`There is a mismatch between slice and middleware for the reducerPath "${reducerPath}".
31475
+ You can only have one api per reducer path, this will lead to crashes in various situations!${reducerPath === "api" ? `
31476
+ If you have multiple apis, you *have* to specify the reducerPath option when using createApi!` : ""}`);
31477
+ }
31478
+ }
31479
+ };
31480
+ };
31239
31481
  var buildInvalidationByTagsHandler = ({
31240
31482
  reducerPath,
31241
31483
  context,
@@ -31266,12 +31508,10 @@ var buildInvalidationByTagsHandler = ({
31266
31508
  };
31267
31509
  function hasPendingRequests(state) {
31268
31510
  for (const key in state.queries) {
31269
- if (state.queries[key]?.status === "pending")
31270
- return true;
31511
+ if (state.queries[key]?.status === "pending") return true;
31271
31512
  }
31272
31513
  for (const key in state.mutations) {
31273
- if (state.mutations[key]?.status === "pending")
31274
- return true;
31514
+ if (state.mutations[key]?.status === "pending") return true;
31275
31515
  }
31276
31516
  return false;
31277
31517
  }
@@ -31284,8 +31524,7 @@ var buildInvalidationByTagsHandler = ({
31284
31524
  }
31285
31525
  const tags = pendingTagInvalidations;
31286
31526
  pendingTagInvalidations = [];
31287
- if (tags.length === 0)
31288
- return;
31527
+ if (tags.length === 0) return;
31289
31528
  const toInvalidate = api.util.selectInvalidatedBy(rootState, tags);
31290
31529
  context.batch(() => {
31291
31530
  const valuesArray = Array.from(toInvalidate.values());
@@ -31300,7 +31539,7 @@ var buildInvalidationByTagsHandler = ({
31300
31539
  queryCacheKey
31301
31540
  }));
31302
31541
  } else if (querySubState.status !== "uninitialized") {
31303
- mwApi.dispatch(refetchQuery(querySubState, queryCacheKey));
31542
+ mwApi.dispatch(refetchQuery(querySubState));
31304
31543
  }
31305
31544
  }
31306
31545
  }
@@ -31336,14 +31575,12 @@ var buildPollingHandler = ({
31336
31575
  const state = api2.getState()[reducerPath];
31337
31576
  const querySubState = state.queries[queryCacheKey];
31338
31577
  const subscriptions = internalState.currentSubscriptions[queryCacheKey];
31339
- if (!querySubState || querySubState.status === "uninitialized")
31340
- return;
31578
+ if (!querySubState || querySubState.status === "uninitialized") return;
31341
31579
  const {
31342
31580
  lowestPollingInterval,
31343
31581
  skipPollingIfUnfocused
31344
31582
  } = findLowestPollingInterval(subscriptions);
31345
- if (!Number.isFinite(lowestPollingInterval))
31346
- return;
31583
+ if (!Number.isFinite(lowestPollingInterval)) return;
31347
31584
  const currentPoll = currentPolls[queryCacheKey];
31348
31585
  if (currentPoll?.timeout) {
31349
31586
  clearTimeout(currentPoll.timeout);
@@ -31355,7 +31592,7 @@ var buildPollingHandler = ({
31355
31592
  pollingInterval: lowestPollingInterval,
31356
31593
  timeout: setTimeout(() => {
31357
31594
  if (state.config.focused || !skipPollingIfUnfocused) {
31358
- api2.dispatch(refetchQuery(querySubState, queryCacheKey));
31595
+ api2.dispatch(refetchQuery(querySubState));
31359
31596
  }
31360
31597
  startNextPoll({
31361
31598
  queryCacheKey
@@ -31405,153 +31642,13 @@ var buildPollingHandler = ({
31405
31642
  for (let key in subscribers) {
31406
31643
  if (!!subscribers[key].pollingInterval) {
31407
31644
  lowestPollingInterval = Math.min(subscribers[key].pollingInterval, lowestPollingInterval);
31408
- skipPollingIfUnfocused = subscribers[key].skipPollingIfUnfocused || skipPollingIfUnfocused;
31409
- }
31410
- }
31411
- return {
31412
- lowestPollingInterval,
31413
- skipPollingIfUnfocused
31414
- };
31415
- }
31416
- return handler;
31417
- };
31418
- var buildWindowEventHandler = ({
31419
- reducerPath,
31420
- context,
31421
- api,
31422
- refetchQuery,
31423
- internalState
31424
- }) => {
31425
- const {
31426
- removeQueryResult
31427
- } = api.internalActions;
31428
- const handler = (action, mwApi) => {
31429
- if (onFocus.match(action)) {
31430
- refetchValidQueries(mwApi, "refetchOnFocus");
31431
- }
31432
- if (onOnline.match(action)) {
31433
- refetchValidQueries(mwApi, "refetchOnReconnect");
31434
- }
31435
- };
31436
- function refetchValidQueries(api2, type) {
31437
- const state = api2.getState()[reducerPath];
31438
- const queries = state.queries;
31439
- const subscriptions = internalState.currentSubscriptions;
31440
- context.batch(() => {
31441
- for (const queryCacheKey of Object.keys(subscriptions)) {
31442
- const querySubState = queries[queryCacheKey];
31443
- const subscriptionSubState = subscriptions[queryCacheKey];
31444
- if (!subscriptionSubState || !querySubState)
31445
- continue;
31446
- const shouldRefetch = Object.values(subscriptionSubState).some((sub) => sub[type] === true) || Object.values(subscriptionSubState).every((sub) => sub[type] === void 0) && state.config[type];
31447
- if (shouldRefetch) {
31448
- if (countObjectKeys(subscriptionSubState) === 0) {
31449
- api2.dispatch(removeQueryResult({
31450
- queryCacheKey
31451
- }));
31452
- } else if (querySubState.status !== "uninitialized") {
31453
- api2.dispatch(refetchQuery(querySubState, queryCacheKey));
31454
- }
31455
- }
31456
- }
31457
- });
31458
- }
31459
- return handler;
31460
- };
31461
- var neverResolvedError = new Error("Promise never resolved before cacheEntryRemoved.");
31462
- var buildCacheLifecycleHandler = ({
31463
- api,
31464
- reducerPath,
31465
- context,
31466
- queryThunk,
31467
- mutationThunk,
31468
- internalState
31469
- }) => {
31470
- const isQueryThunk = isAsyncThunkAction(queryThunk);
31471
- const isMutationThunk = isAsyncThunkAction(mutationThunk);
31472
- const isFulfilledThunk = isFulfilled(queryThunk, mutationThunk);
31473
- const lifecycleMap = {};
31474
- const handler = (action, mwApi, stateBefore) => {
31475
- const cacheKey = getCacheKey(action);
31476
- if (queryThunk.pending.match(action)) {
31477
- const oldState = stateBefore[reducerPath].queries[cacheKey];
31478
- const state = mwApi.getState()[reducerPath].queries[cacheKey];
31479
- if (!oldState && state) {
31480
- handleNewKey(action.meta.arg.endpointName, action.meta.arg.originalArgs, cacheKey, mwApi, action.meta.requestId);
31481
- }
31482
- } else if (mutationThunk.pending.match(action)) {
31483
- const state = mwApi.getState()[reducerPath].mutations[cacheKey];
31484
- if (state) {
31485
- handleNewKey(action.meta.arg.endpointName, action.meta.arg.originalArgs, cacheKey, mwApi, action.meta.requestId);
31486
- }
31487
- } else if (isFulfilledThunk(action)) {
31488
- const lifecycle = lifecycleMap[cacheKey];
31489
- if (lifecycle?.valueResolved) {
31490
- lifecycle.valueResolved({
31491
- data: action.payload,
31492
- meta: action.meta.baseQueryMeta
31493
- });
31494
- delete lifecycle.valueResolved;
31495
- }
31496
- } else if (api.internalActions.removeQueryResult.match(action) || api.internalActions.removeMutationResult.match(action)) {
31497
- const lifecycle = lifecycleMap[cacheKey];
31498
- if (lifecycle) {
31499
- delete lifecycleMap[cacheKey];
31500
- lifecycle.cacheEntryRemoved();
31501
- }
31502
- } else if (api.util.resetApiState.match(action)) {
31503
- for (const [cacheKey2, lifecycle] of Object.entries(lifecycleMap)) {
31504
- delete lifecycleMap[cacheKey2];
31505
- lifecycle.cacheEntryRemoved();
31645
+ skipPollingIfUnfocused = subscribers[key].skipPollingIfUnfocused || skipPollingIfUnfocused;
31506
31646
  }
31507
31647
  }
31508
- };
31509
- function getCacheKey(action) {
31510
- if (isQueryThunk(action))
31511
- return action.meta.arg.queryCacheKey;
31512
- if (isMutationThunk(action)) {
31513
- return action.meta.arg.fixedCacheKey ?? action.meta.requestId;
31514
- }
31515
- if (api.internalActions.removeQueryResult.match(action))
31516
- return action.payload.queryCacheKey;
31517
- if (api.internalActions.removeMutationResult.match(action))
31518
- return getMutationCacheKey(action.payload);
31519
- return "";
31520
- }
31521
- function handleNewKey(endpointName, originalArgs, queryCacheKey, mwApi, requestId) {
31522
- const endpointDefinition = context.endpointDefinitions[endpointName];
31523
- const onCacheEntryAdded = endpointDefinition?.onCacheEntryAdded;
31524
- if (!onCacheEntryAdded)
31525
- return;
31526
- let lifecycle = {};
31527
- const cacheEntryRemoved = new Promise((resolve) => {
31528
- lifecycle.cacheEntryRemoved = resolve;
31529
- });
31530
- const cacheDataLoaded = Promise.race([new Promise((resolve) => {
31531
- lifecycle.valueResolved = resolve;
31532
- }), cacheEntryRemoved.then(() => {
31533
- throw neverResolvedError;
31534
- })]);
31535
- cacheDataLoaded.catch(() => {
31536
- });
31537
- lifecycleMap[queryCacheKey] = lifecycle;
31538
- const selector = api.endpoints[endpointName].select(endpointDefinition.type === "query" ? originalArgs : queryCacheKey);
31539
- const extra = mwApi.dispatch((_2, __, extra2) => extra2);
31540
- const lifecycleApi = {
31541
- ...mwApi,
31542
- getCacheEntry: () => selector(mwApi.getState()),
31543
- requestId,
31544
- extra,
31545
- updateCachedData: endpointDefinition.type === "query" ? (updateRecipe) => mwApi.dispatch(api.util.updateQueryData(endpointName, originalArgs, updateRecipe)) : void 0,
31546
- cacheDataLoaded,
31547
- cacheEntryRemoved
31648
+ return {
31649
+ lowestPollingInterval,
31650
+ skipPollingIfUnfocused
31548
31651
  };
31549
- const runningHandler = onCacheEntryAdded(originalArgs, lifecycleApi);
31550
- Promise.resolve(runningHandler).catch((e) => {
31551
- if (e === neverResolvedError)
31552
- return;
31553
- throw e;
31554
- });
31555
31652
  }
31556
31653
  return handler;
31557
31654
  };
@@ -31623,147 +31720,47 @@ var buildQueryLifecycleHandler = ({
31623
31720
  };
31624
31721
  return handler;
31625
31722
  };
31626
- var buildDevCheckHandler = ({
31627
- api,
31628
- context: {
31629
- apiUid
31630
- },
31631
- reducerPath
31632
- }) => {
31633
- return (action, mwApi) => {
31634
- if (api.util.resetApiState.match(action)) {
31635
- mwApi.dispatch(api.internalActions.middlewareRegistered(apiUid));
31636
- }
31637
- if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
31638
- if (api.internalActions.middlewareRegistered.match(action) && action.payload === apiUid && mwApi.getState()[reducerPath]?.config?.middlewareRegistered === "conflict") {
31639
- console.warn(`There is a mismatch between slice and middleware for the reducerPath "${reducerPath}".
31640
- You can only have one api per reducer path, this will lead to crashes in various situations!${reducerPath === "api" ? `
31641
- If you have multiple apis, you *have* to specify the reducerPath option when using createApi!` : ""}`);
31642
- }
31643
- }
31644
- };
31645
- };
31646
- var buildBatchedActionsHandler = ({
31723
+ var buildWindowEventHandler = ({
31724
+ reducerPath,
31725
+ context,
31647
31726
  api,
31648
- queryThunk,
31727
+ refetchQuery,
31649
31728
  internalState
31650
31729
  }) => {
31651
- const subscriptionsPrefix = `${api.reducerPath}/subscriptions`;
31652
- let previousSubscriptions = null;
31653
- let updateSyncTimer = null;
31654
31730
  const {
31655
- updateSubscriptionOptions,
31656
- unsubscribeQueryResult
31731
+ removeQueryResult
31657
31732
  } = api.internalActions;
31658
- const actuallyMutateSubscriptions = (mutableState, action) => {
31659
- var _a, _b;
31660
- if (updateSubscriptionOptions.match(action)) {
31661
- const {
31662
- queryCacheKey,
31663
- requestId,
31664
- options
31665
- } = action.payload;
31666
- if (mutableState?.[queryCacheKey]?.[requestId]) {
31667
- mutableState[queryCacheKey][requestId] = options;
31668
- }
31669
- return true;
31670
- }
31671
- if (unsubscribeQueryResult.match(action)) {
31672
- const {
31673
- queryCacheKey,
31674
- requestId
31675
- } = action.payload;
31676
- if (mutableState[queryCacheKey]) {
31677
- delete mutableState[queryCacheKey][requestId];
31678
- }
31679
- return true;
31680
- }
31681
- if (api.internalActions.removeQueryResult.match(action)) {
31682
- delete mutableState[action.payload.queryCacheKey];
31683
- return true;
31684
- }
31685
- if (queryThunk.pending.match(action)) {
31686
- const {
31687
- meta: {
31688
- arg,
31689
- requestId
31690
- }
31691
- } = action;
31692
- const substate = mutableState[_a = arg.queryCacheKey] ?? (mutableState[_a] = {});
31693
- substate[`${requestId}_running`] = {};
31694
- if (arg.subscribe) {
31695
- substate[requestId] = arg.subscriptionOptions ?? substate[requestId] ?? {};
31696
- }
31697
- return true;
31698
- }
31699
- let mutated = false;
31700
- if (queryThunk.fulfilled.match(action) || queryThunk.rejected.match(action)) {
31701
- const state = mutableState[action.meta.arg.queryCacheKey] || {};
31702
- const key = `${action.meta.requestId}_running`;
31703
- mutated || (mutated = !!state[key]);
31704
- delete state[key];
31733
+ const handler = (action, mwApi) => {
31734
+ if (onFocus.match(action)) {
31735
+ refetchValidQueries(mwApi, "refetchOnFocus");
31705
31736
  }
31706
- if (queryThunk.rejected.match(action)) {
31707
- const {
31708
- meta: {
31709
- condition,
31710
- arg,
31711
- requestId
31712
- }
31713
- } = action;
31714
- if (condition && arg.subscribe) {
31715
- const substate = mutableState[_b = arg.queryCacheKey] ?? (mutableState[_b] = {});
31716
- substate[requestId] = arg.subscriptionOptions ?? substate[requestId] ?? {};
31717
- mutated = true;
31718
- }
31737
+ if (onOnline.match(action)) {
31738
+ refetchValidQueries(mwApi, "refetchOnReconnect");
31719
31739
  }
31720
- return mutated;
31721
- };
31722
- const getSubscriptions = () => internalState.currentSubscriptions;
31723
- const getSubscriptionCount = (queryCacheKey) => {
31724
- const subscriptions = getSubscriptions();
31725
- const subscriptionsForQueryArg = subscriptions[queryCacheKey] ?? {};
31726
- return countObjectKeys(subscriptionsForQueryArg);
31727
- };
31728
- const isRequestSubscribed = (queryCacheKey, requestId) => {
31729
- const subscriptions = getSubscriptions();
31730
- return !!subscriptions?.[queryCacheKey]?.[requestId];
31731
- };
31732
- const subscriptionSelectors = {
31733
- getSubscriptions,
31734
- getSubscriptionCount,
31735
- isRequestSubscribed
31736
31740
  };
31737
- return (action, mwApi) => {
31738
- if (!previousSubscriptions) {
31739
- previousSubscriptions = JSON.parse(JSON.stringify(internalState.currentSubscriptions));
31740
- }
31741
- if (api.util.resetApiState.match(action)) {
31742
- previousSubscriptions = internalState.currentSubscriptions = {};
31743
- updateSyncTimer = null;
31744
- return [true, false];
31745
- }
31746
- if (api.internalActions.internal_getRTKQSubscriptions.match(action)) {
31747
- return [false, subscriptionSelectors];
31748
- }
31749
- const didMutate = actuallyMutateSubscriptions(internalState.currentSubscriptions, action);
31750
- let actionShouldContinue = true;
31751
- if (didMutate) {
31752
- if (!updateSyncTimer) {
31753
- updateSyncTimer = setTimeout(() => {
31754
- const newSubscriptions = JSON.parse(JSON.stringify(internalState.currentSubscriptions));
31755
- const [, patches] = produceWithPatches(previousSubscriptions, () => newSubscriptions);
31756
- mwApi.next(api.internalActions.subscriptionsUpdated(patches));
31757
- previousSubscriptions = newSubscriptions;
31758
- updateSyncTimer = null;
31759
- }, 500);
31741
+ function refetchValidQueries(api2, type) {
31742
+ const state = api2.getState()[reducerPath];
31743
+ const queries = state.queries;
31744
+ const subscriptions = internalState.currentSubscriptions;
31745
+ context.batch(() => {
31746
+ for (const queryCacheKey of Object.keys(subscriptions)) {
31747
+ const querySubState = queries[queryCacheKey];
31748
+ const subscriptionSubState = subscriptions[queryCacheKey];
31749
+ if (!subscriptionSubState || !querySubState) continue;
31750
+ const shouldRefetch = Object.values(subscriptionSubState).some((sub) => sub[type] === true) || Object.values(subscriptionSubState).every((sub) => sub[type] === void 0) && state.config[type];
31751
+ if (shouldRefetch) {
31752
+ if (countObjectKeys(subscriptionSubState) === 0) {
31753
+ api2.dispatch(removeQueryResult({
31754
+ queryCacheKey
31755
+ }));
31756
+ } else if (querySubState.status !== "uninitialized") {
31757
+ api2.dispatch(refetchQuery(querySubState));
31758
+ }
31759
+ }
31760
31760
  }
31761
- const isSubscriptionSliceAction = typeof action.type == "string" && !!action.type.startsWith(subscriptionsPrefix);
31762
- const isAdditionalSubscriptionAction = queryThunk.rejected.match(action) && action.meta.condition && !!action.meta.arg.subscribe;
31763
- actionShouldContinue = !isSubscriptionSliceAction && !isAdditionalSubscriptionAction;
31764
- }
31765
- return [actionShouldContinue, false];
31766
- };
31761
+ });
31762
+ }
31763
+ return handler;
31767
31764
  };
31768
31765
  function buildMiddleware(input) {
31769
31766
  const {
@@ -31782,7 +31779,7 @@ function buildMiddleware(input) {
31782
31779
  const handlerBuilders = [buildDevCheckHandler, buildCacheCollectionHandler, buildInvalidationByTagsHandler, buildPollingHandler, buildCacheLifecycleHandler, buildQueryLifecycleHandler];
31783
31780
  const middleware = (mwApi) => {
31784
31781
  let initialized2 = false;
31785
- let internalState = {
31782
+ const internalState = {
31786
31783
  currentSubscriptions: {}
31787
31784
  };
31788
31785
  const builderArgs = {
@@ -31818,7 +31815,7 @@ function buildMiddleware(input) {
31818
31815
  if (!!mwApi.getState()[reducerPath]) {
31819
31816
  windowEventsHandler(action, mwApiWithNext, stateBefore);
31820
31817
  if (isThisApiSliceAction(action) || context.hasRehydrationInfo(action)) {
31821
- for (let handler of handlers) {
31818
+ for (const handler of handlers) {
31822
31819
  handler(action, mwApiWithNext, stateBefore);
31823
31820
  }
31824
31821
  }
@@ -31831,23 +31828,13 @@ function buildMiddleware(input) {
31831
31828
  middleware,
31832
31829
  actions
31833
31830
  };
31834
- function refetchQuery(querySubState, queryCacheKey, override = {}) {
31835
- return queryThunk({
31836
- type: "query",
31837
- endpointName: querySubState.endpointName,
31838
- originalArgs: querySubState.originalArgs,
31831
+ function refetchQuery(querySubState) {
31832
+ return input.api.endpoints[querySubState.endpointName].initiate(querySubState.originalArgs, {
31839
31833
  subscribe: false,
31840
- forceRefetch: true,
31841
- queryCacheKey,
31842
- ...override
31834
+ forceRefetch: true
31843
31835
  });
31844
31836
  }
31845
31837
  }
31846
- function assertCast(v) {
31847
- }
31848
- function safeAssign(target, ...args) {
31849
- return Object.assign(target, ...args);
31850
- }
31851
31838
  var coreModuleName = /* @__PURE__ */ Symbol();
31852
31839
  var coreModule = ({
31853
31840
  createSelector: createSelector2 = createSelector
@@ -31908,6 +31895,7 @@ var coreModule = ({
31908
31895
  context,
31909
31896
  queryThunk,
31910
31897
  mutationThunk,
31898
+ serializeQueryArgs,
31911
31899
  reducerPath,
31912
31900
  assertTagType,
31913
31901
  config: {
@@ -31924,7 +31912,8 @@ var coreModule = ({
31924
31912
  updateQueryData,
31925
31913
  upsertQueryData,
31926
31914
  prefetch,
31927
- resetApiState: sliceActions.resetApiState
31915
+ resetApiState: sliceActions.resetApiState,
31916
+ upsertQueryEntries: sliceActions.cacheEntriesUpserted
31928
31917
  });
31929
31918
  safeAssign(api.internalActions, sliceActions);
31930
31919
  const {
@@ -32003,15 +31992,15 @@ var coreModule = ({
32003
31992
  var createApi = /* @__PURE__ */ buildCreateApi(coreModule());
32004
31993
 
32005
31994
  // ../../node_modules/@reduxjs/toolkit/dist/query/react/rtk-query-react.modern.mjs
31995
+ import { batch as rrBatch, useDispatch as rrUseDispatch, useSelector as rrUseSelector, useStore as rrUseStore } from "react-redux";
32006
31996
  import { useCallback, useDebugValue, useEffect as useEffect3, useLayoutEffect, useMemo as useMemo2, useRef as useRef3, useState } from "react";
32007
31997
  import { shallowEqual as shallowEqual2 } from "react-redux";
32008
31998
  import { useEffect, useRef, useMemo } from "react";
32009
31999
  import { useEffect as useEffect2, useRef as useRef2 } from "react";
32010
32000
  import { shallowEqual } from "react-redux";
32011
- import { batch as rrBatch, useDispatch as rrUseDispatch, useSelector as rrUseSelector, useStore as rrUseStore } from "react-redux";
32012
32001
  import { useContext } from "react";
32013
32002
  import { useEffect as useEffect4 } from "react";
32014
- import React from "react";
32003
+ import * as React from "react";
32015
32004
  import { Provider, ReactReduxContext } from "react-redux";
32016
32005
  function isQueryDefinition2(e) {
32017
32006
  return e.type === "query";
@@ -32025,6 +32014,13 @@ function safeAssign2(target, ...args) {
32025
32014
  function capitalize(str) {
32026
32015
  return str.replace(str[0], str[0].toUpperCase());
32027
32016
  }
32017
+ function countObjectKeys2(obj) {
32018
+ let count = 0;
32019
+ for (const _key in obj) {
32020
+ count++;
32021
+ }
32022
+ return count;
32023
+ }
32028
32024
  var cache2 = WeakMap ? /* @__PURE__ */ new WeakMap() : void 0;
32029
32025
  var defaultSerializeQueryArgs2 = ({
32030
32026
  endpointName,
@@ -32079,7 +32075,12 @@ function useShallowStableValue(value) {
32079
32075
  }, [value]);
32080
32076
  return shallowEqual(cache22.current, value) ? cache22.current : value;
32081
32077
  }
32082
- var useIsomorphicLayoutEffect = typeof window !== "undefined" && !!window.document && !!window.document.createElement ? useLayoutEffect : useEffect3;
32078
+ var canUseDOM = () => !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
32079
+ var isDOM = /* @__PURE__ */ canUseDOM();
32080
+ var isRunningInReactNative = () => typeof navigator !== "undefined" && navigator.product === "ReactNative";
32081
+ var isReactNative = /* @__PURE__ */ isRunningInReactNative();
32082
+ var getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? useLayoutEffect : useEffect3;
32083
+ var useIsomorphicLayoutEffect = /* @__PURE__ */ getUseIsomorphicLayoutEffect();
32083
32084
  var noPendingQueryStateSelector = (selected) => {
32084
32085
  if (selected.isUninitialized) {
32085
32086
  return {
@@ -32127,12 +32128,10 @@ function buildHooks({
32127
32128
  queryArgs,
32128
32129
  endpointDefinition,
32129
32130
  endpointName
32130
- }))
32131
- lastResult = void 0;
32131
+ })) lastResult = void 0;
32132
32132
  }
32133
32133
  let data = currentState.isSuccess ? currentState.data : lastResult?.data;
32134
- if (data === void 0)
32135
- data = currentState.data;
32134
+ if (data === void 0) data = currentState.data;
32136
32135
  const hasData = data !== void 0;
32137
32136
  const isFetching = currentState.isLoading;
32138
32137
  const isLoading = (!lastResult || lastResult.isLoading || lastResult.isUninitialized) && !hasData && isFetching;
@@ -32247,8 +32246,7 @@ function buildHooks({
32247
32246
  * A method to manually refetch data for the query
32248
32247
  */
32249
32248
  refetch: () => {
32250
- if (!promiseRef.current)
32251
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(38) : "Cannot refetch a query that has not been started yet.");
32249
+ if (!promiseRef.current) throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage2(38) : "Cannot refetch a query that has not been started yet.");
32252
32250
  return promiseRef.current?.refetch();
32253
32251
  }
32254
32252
  }), []);
@@ -32449,13 +32447,6 @@ function buildHooks({
32449
32447
  };
32450
32448
  }
32451
32449
  }
32452
- function countObjectKeys2(obj) {
32453
- let count = 0;
32454
- for (const _key in obj) {
32455
- count++;
32456
- }
32457
- return count;
32458
- }
32459
32450
  var reactHooksModuleName = /* @__PURE__ */ Symbol();
32460
32451
  var reactHooksModule = ({
32461
32452
  batch = rrBatch,
@@ -32916,11 +32907,11 @@ var getOrchestratorStore = ({
32916
32907
  };
32917
32908
 
32918
32909
  // src/rtk/storeProvider.tsx
32919
- import { useState as useState5 } from "react";
32910
+ import { useState as useState6 } from "react";
32920
32911
  import { Provider as Provider2 } from "react-redux";
32921
32912
 
32922
32913
  // src/contexts/ConfirmationDialogProvider.tsx
32923
- import { createContext, useState as useState2 } from "react";
32914
+ import { createContext, useState as useState3 } from "react";
32924
32915
 
32925
32916
  // src/components/confirmationDialog/WfoConfirmationDialog.tsx
32926
32917
  import { useTranslations } from "next-intl";
@@ -33016,7 +33007,7 @@ var ConfirmationDialogProvider = ConfirmationDialogContext.Provider;
33016
33007
  function ConfirmationDialogContextWrapper({
33017
33008
  children
33018
33009
  }) {
33019
- const [confirmationDialogOpen, setConfirmationDialogOpen] = useState2(false);
33010
+ const [confirmationDialogOpen, setConfirmationDialogOpen] = useState3(false);
33020
33011
  const [
33021
33012
  {
33022
33013
  onConfirm,
@@ -33027,7 +33018,7 @@ function ConfirmationDialogContextWrapper({
33027
33018
  confirmButtonText
33028
33019
  },
33029
33020
  setState
33030
- ] = useState2({
33021
+ ] = useState3({
33031
33022
  onConfirm: () => {
33032
33023
  },
33033
33024
  question: ""
@@ -33082,9 +33073,9 @@ function ConfirmationDialogContextWrapper({
33082
33073
  import { createContext as createContext2 } from "react";
33083
33074
 
33084
33075
  // src/hooks/useOrchestratorConfig.ts
33085
- import { useState as useState3 } from "react";
33076
+ import { useState as useState4 } from "react";
33086
33077
  var useOrchestratorConfig = (initialOrchestratorConfig) => {
33087
- const [orchestratorConfig] = useState3(initialOrchestratorConfig);
33078
+ const [orchestratorConfig] = useState4(initialOrchestratorConfig);
33088
33079
  return {
33089
33080
  orchestratorConfig
33090
33081
  };
@@ -33213,7 +33204,7 @@ var StoreProvider = ({
33213
33204
  orchestratorComponentOverride,
33214
33205
  customApis
33215
33206
  });
33216
- const [orchestratorStore] = useState5(store);
33207
+ const [orchestratorStore] = useState6(store);
33217
33208
  return /* @__PURE__ */ jsx7(Provider2, { store: orchestratorStore, children });
33218
33209
  };
33219
33210
 
@@ -37334,7 +37325,9 @@ var getWfoPageHeaderStyles = ({ theme }) => {
37334
37325
  const getHeaderStyle = (navigationHeight) => {
37335
37326
  return css5({
37336
37327
  backgroundColor: theme.colors.header,
37337
- height: navigationHeight
37328
+ height: navigationHeight,
37329
+ borderBottom: theme.colors.header
37330
+ // Overrides EuiHeader default border bottom
37338
37331
  });
37339
37332
  };
37340
37333
  return {
@@ -37344,7 +37337,7 @@ var getWfoPageHeaderStyles = ({ theme }) => {
37344
37337
  };
37345
37338
 
37346
37339
  // src/components/WfoPageTemplate/WfoPageHeader/WfoHamburgerMenu.tsx
37347
- import { useState as useState6 } from "react";
37340
+ import { useState as useState7 } from "react";
37348
37341
  import { signOut as signOut3 } from "next-auth/react";
37349
37342
  import { useTranslations as useTranslations9 } from "next-intl";
37350
37343
  import { EuiButtonIcon as EuiButtonIcon3, EuiContextMenu, EuiPopover } from "@elastic/eui";
@@ -37391,7 +37384,7 @@ var WfoQuestionCircle = ({
37391
37384
  import { jsx as jsx68 } from "@emotion/react/jsx-runtime";
37392
37385
  var WfoHamburgerMenu = ({}) => {
37393
37386
  const t = useTranslations9("main");
37394
- const [isPopoverOpen, setPopoverIsOpen] = useState6(false);
37387
+ const [isPopoverOpen, setPopoverIsOpen] = useState7(false);
37395
37388
  const { theme, isDarkThemeActive } = useOrchestratorTheme();
37396
37389
  const { enableSupportMenuItem, supportMenuItemUrl } = useGetOrchestratorConfig();
37397
37390
  const closePopover = () => {
@@ -37512,11 +37505,11 @@ var WfoPageHeader = ({
37512
37505
  };
37513
37506
 
37514
37507
  // src/components/WfoPageTemplate/WfoPageTemplate/WfoPageTemplate.tsx
37515
- import { useState as useState9 } from "react";
37508
+ import { useState as useState10 } from "react";
37516
37509
  import { EuiPageTemplate } from "@elastic/eui";
37517
37510
 
37518
37511
  // src/components/WfoPageTemplate/WfoSidebar/WfoSidebar.tsx
37519
- import { useState as useState8 } from "react";
37512
+ import { useState as useState9 } from "react";
37520
37513
  import { useTranslations as useTranslations13 } from "next-intl";
37521
37514
  import { useRouter as useRouter4 } from "next/router";
37522
37515
  import { EuiSideNav, EuiSpacer as EuiSpacer4 } from "@elastic/eui";
@@ -37628,7 +37621,7 @@ import { useTranslations as useTranslations11 } from "next-intl";
37628
37621
  import { useRouter as useRouter3 } from "next/router";
37629
37622
 
37630
37623
  // src/components/WfoStartButton/WfoStartButtonComboBox.tsx
37631
- import { useState as useState7 } from "react";
37624
+ import { useState as useState8 } from "react";
37632
37625
  import { EuiButton as EuiButton2, EuiPopover as EuiPopover2, EuiSelectable, EuiSpacer as EuiSpacer3 } from "@elastic/eui";
37633
37626
 
37634
37627
  // src/components/WfoStartButton/styles.ts
@@ -37660,7 +37653,7 @@ var WfoStartButtonComboBox = ({
37660
37653
  isProcess,
37661
37654
  className
37662
37655
  }) => {
37663
- const [isPopoverOpen, setPopoverOpen] = useState7(false);
37656
+ const [isPopoverOpen, setPopoverOpen] = useState8(false);
37664
37657
  const { theme, isDarkThemeActive } = useOrchestratorTheme();
37665
37658
  const { selectableStyle } = useWithOrchestratorTheme(getStyles4);
37666
37659
  const Button = /* @__PURE__ */ jsx70(
@@ -37811,7 +37804,7 @@ var WfoSidebar = ({ overrideMenuItems }) => {
37811
37804
  const { menuStyle } = useWithOrchestratorTheme(getMenuStyles);
37812
37805
  const t = useTranslations13("main");
37813
37806
  const router = useRouter4();
37814
- const [isSideNavOpenOnMobile, setIsSideNavOpenOnMobile] = useState8(false);
37807
+ const [isSideNavOpenOnMobile, setIsSideNavOpenOnMobile] = useState9(false);
37815
37808
  const { isAllowed } = usePolicy();
37816
37809
  const toggleMobile = () => {
37817
37810
  setIsSideNavOpenOnMobile((openState) => !openState);
@@ -38030,7 +38023,7 @@ var WfoPageTemplate = ({
38030
38023
  onThemeSwitch
38031
38024
  }) => {
38032
38025
  const { theme, multiplyByBaseUnit } = useOrchestratorTheme();
38033
- const [isSideMenuVisible, setIsSideMenuVisible] = useState9(true);
38026
+ const [isSideMenuVisible, setIsSideMenuVisible] = useState10(true);
38034
38027
  const navigationHeight = multiplyByBaseUnit(3);
38035
38028
  return /* @__PURE__ */ jsxs48(Fragment8, { children: [
38036
38029
  /* @__PURE__ */ jsx75(
@@ -38083,7 +38076,7 @@ var WfoPageTemplate = ({
38083
38076
  };
38084
38077
 
38085
38078
  // src/components/WfoSearchBar/WfoSearchField.tsx
38086
- import { useEffect as useEffect6, useRef as useRef4, useState as useState10 } from "react";
38079
+ import { useEffect as useEffect6, useRef as useRef4, useState as useState11 } from "react";
38087
38080
  import { useTranslations as useTranslations14 } from "next-intl";
38088
38081
  import { EuiFieldSearch, EuiFormRow } from "@elastic/eui";
38089
38082
 
@@ -38212,7 +38205,7 @@ var WfoSearchField = ({
38212
38205
  const handleSearch = useRef4(
38213
38206
  (queryText) => onUpdateQueryString?.(queryText)
38214
38207
  );
38215
- const [currentQuery, setCurrentQuery] = useState10(queryString ?? "");
38208
+ const [currentQuery, setCurrentQuery] = useState11(queryString ?? "");
38216
38209
  useEffect6(() => {
38217
38210
  setCurrentQuery(queryString ?? "");
38218
38211
  }, [queryString]);
@@ -39025,7 +39018,7 @@ var WfoProcessesTimeline = ({
39025
39018
  };
39026
39019
 
39027
39020
  // src/components/WfoSubscription/WfoRelatedSubscriptions.tsx
39028
- import { useState as useState13 } from "react";
39021
+ import { useState as useState14 } from "react";
39029
39022
  import { useTranslations as useTranslations26 } from "next-intl";
39030
39023
  import Link3 from "next/link";
39031
39024
  import { EuiFlexGroup as EuiFlexGroup8, EuiFlexItem as EuiFlexItem5, EuiSpacer as EuiSpacer12, EuiSwitch } from "@elastic/eui";
@@ -39494,7 +39487,7 @@ var WfoSortDirectionIcon = ({
39494
39487
  };
39495
39488
 
39496
39489
  // src/components/WfoTable/WfoTable/WfoTableHeaderCell/WfoTableHeaderCell.tsx
39497
- import { useState as useState11 } from "react";
39490
+ import { useState as useState12 } from "react";
39498
39491
  import { useTranslations as useTranslations22 } from "next-intl";
39499
39492
  import {
39500
39493
  EuiFieldSearch as EuiFieldSearch2,
@@ -39526,7 +39519,7 @@ var WfoTableHeaderCell = ({
39526
39519
  const smallContextMenuPopoverId = useGeneratedHtmlId({
39527
39520
  prefix: "smallContextMenuPopover"
39528
39521
  });
39529
- const [isPopoverOpen, setPopover] = useState11(false);
39522
+ const [isPopoverOpen, setPopover] = useState12(false);
39530
39523
  const handleButtonClick = () => setPopover(!isPopoverOpen);
39531
39524
  const closePopover = () => setPopover(false);
39532
39525
  const handleSearch = (searchText) => {
@@ -39746,7 +39739,7 @@ import { useTranslations as useTranslations25 } from "next-intl";
39746
39739
  import { EuiButtonEmpty as EuiButtonEmpty3, EuiFlexGroup as EuiFlexGroup7, EuiSpacer as EuiSpacer11 } from "@elastic/eui";
39747
39740
 
39748
39741
  // src/components/WfoTable/WfoTable/WfoGroupedTable/useGroupedTableConfig.tsx
39749
- import { useEffect as useEffect7, useRef as useRef5, useState as useState12 } from "react";
39742
+ import { useEffect as useEffect7, useRef as useRef5, useState as useState13 } from "react";
39750
39743
 
39751
39744
  // src/components/WfoTable/WfoTable/WfoGroupedTable/WfoExpandableRow.tsx
39752
39745
  import { useTranslations as useTranslations24 } from "next-intl";
@@ -39962,10 +39955,10 @@ var useGroupedTableConfig = ({
39962
39955
  notifyParent
39963
39956
  }) => {
39964
39957
  const groupReferences = useRef5(/* @__PURE__ */ new Map());
39965
- const [expandedRowIds, setExpandedRowIds] = useState12([]);
39966
- const [isAllGroupsExpanded, setIsAllGroupsExpanded] = useState12(false);
39967
- const [isAllSubgroupsExpanded, setIsAllSubgroupsExpanded] = useState12([]);
39968
- const [isExpanding, setIsExpanding] = useState12(false);
39958
+ const [expandedRowIds, setExpandedRowIds] = useState13([]);
39959
+ const [isAllGroupsExpanded, setIsAllGroupsExpanded] = useState13(false);
39960
+ const [isAllSubgroupsExpanded, setIsAllSubgroupsExpanded] = useState13([]);
39961
+ const [isExpanding, setIsExpanding] = useState13(false);
39969
39962
  const groups = getObjectKeys(data).map((key) => ({
39970
39963
  groupName: key.toString()
39971
39964
  }));
@@ -40210,7 +40203,7 @@ import { Fragment as Fragment20, jsx as jsx103, jsxs as jsxs61 } from "@emotion/
40210
40203
  var WfoRelatedSubscriptions = ({
40211
40204
  subscriptionId
40212
40205
  }) => {
40213
- const [hideTerminatedSubscriptions, setHideTerminatedSubscriptions] = useState13(true);
40206
+ const [hideTerminatedSubscriptions, setHideTerminatedSubscriptions] = useState14(true);
40214
40207
  const t = useTranslations26("subscriptions.detail");
40215
40208
  const { theme } = useOrchestratorTheme();
40216
40209
  const terminatedSubscriptionsFilter = {
@@ -40495,7 +40488,7 @@ var WfoSubscription = ({ subscriptionId }) => {
40495
40488
  };
40496
40489
 
40497
40490
  // src/components/WfoSubscription/WfoSubscriptionActions.tsx
40498
- import { useState as useState14 } from "react";
40491
+ import { useState as useState15 } from "react";
40499
40492
  import { useTranslations as useTranslations28 } from "next-intl";
40500
40493
  import Link4 from "next/link";
40501
40494
  import { useRouter as useRouter5 } from "next/router";
@@ -40541,7 +40534,7 @@ var WfoSubscriptionActions = ({
40541
40534
  const { theme } = useOrchestratorTheme();
40542
40535
  const router = useRouter5();
40543
40536
  const t = useTranslations28("subscriptions.detail.actions");
40544
- const [isPopoverOpen, setPopover] = useState14(false);
40537
+ const [isPopoverOpen, setPopover] = useState15(false);
40545
40538
  const { data: subscriptionActions } = useGetSubscriptionActionsQuery(
40546
40539
  {
40547
40540
  subscriptionId
@@ -40679,7 +40672,7 @@ var WfoSubscriptionActions = ({
40679
40672
  };
40680
40673
 
40681
40674
  // src/components/WfoSubscription/WfoSubscriptionProductBlock/WfoSubscriptionProductBlock.tsx
40682
- import { useState as useState15 } from "react";
40675
+ import { useState as useState16 } from "react";
40683
40676
  import { useTranslations as useTranslations30 } from "next-intl";
40684
40677
  import {
40685
40678
  EuiBadge as EuiBadge2,
@@ -40827,7 +40820,7 @@ var WfoSubscriptionProductBlock = ({
40827
40820
  outsideSubscriptionIdTextStyle,
40828
40821
  rowStyle
40829
40822
  } = useWithOrchestratorTheme(getStyles5);
40830
- const [showDetails, setShowDetails] = useState15(false);
40823
+ const [showDetails, setShowDetails] = useState16(false);
40831
40824
  const ownerSubscriptionId = productBlock.subscription.subscriptionId;
40832
40825
  const isOutsideCurrentSubscription = ownerSubscriptionId !== subscriptionId;
40833
40826
  const inUseByRelations = productBlock.inUseByRelations.filter(
@@ -40983,7 +40976,7 @@ var WfoProductBlockKeyValueRow = ({ fieldValue }) => {
40983
40976
  };
40984
40977
 
40985
40978
  // src/components/WfoSubscription/WfoSubscriptionDetailTree.tsx
40986
- import React28, { useState as useState16 } from "react";
40979
+ import React28, { useState as useState17 } from "react";
40987
40980
  import { useTranslations as useTranslations32 } from "next-intl";
40988
40981
  import { EuiCallOut, EuiFlexGroup as EuiFlexGroup14, EuiFlexItem as EuiFlexItem10, EuiText as EuiText10 } from "@elastic/eui";
40989
40982
 
@@ -41274,7 +41267,7 @@ var WfoSubscriptionDetailTree = ({
41274
41267
  }) => {
41275
41268
  const t = useTranslations32("subscriptions.detail");
41276
41269
  const { theme } = useOrchestratorTheme();
41277
- const [, setSelectedTreeNode] = useState16(-1);
41270
+ const [, setSelectedTreeNode] = useState17(-1);
41278
41271
  const { productBlockTreeWidth } = useWithOrchestratorTheme(
41279
41272
  getSubscriptionDetailStyles
41280
41273
  );
@@ -41530,7 +41523,7 @@ var WfoCustomerDescriptionsField = ({ customerDescriptions }) => {
41530
41523
  };
41531
41524
 
41532
41525
  // src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.tsx
41533
- import { useState as useState17 } from "react";
41526
+ import { useState as useState18 } from "react";
41534
41527
  import { useTranslations as useTranslations33 } from "next-intl";
41535
41528
  import {
41536
41529
  EuiForm,
@@ -41571,8 +41564,8 @@ var TableSettingsModal = ({
41571
41564
  const { formRowStyle, selectFieldStyle } = useWithOrchestratorTheme(
41572
41565
  getWfoTableSettingsModalStyles
41573
41566
  );
41574
- const [columns, setColumns] = useState17(tableConfig.columns);
41575
- const [selectedPageSize, setSelectedPageSize] = useState17(
41567
+ const [columns, setColumns] = useState18(tableConfig.columns);
41568
+ const [selectedPageSize, setSelectedPageSize] = useState18(
41576
41569
  tableConfig.selectedPageSize
41577
41570
  );
41578
41571
  const options = pageSizeOptions.map((pageSizeOption) => ({
@@ -41931,7 +41924,7 @@ var toSortedTableColumnConfig = (columnConfig, columnKeys) => columnKeys.reduce(
41931
41924
  }, {});
41932
41925
 
41933
41926
  // src/components/WfoTable/WfoAdvancedTable/WfoAdvancedTable.tsx
41934
- import { useEffect as useEffect9, useState as useState18 } from "react";
41927
+ import { useEffect as useEffect9, useState as useState19 } from "react";
41935
41928
  import { useTranslations as useTranslations34 } from "next-intl";
41936
41929
  import {
41937
41930
  EuiButton as EuiButton8,
@@ -41956,10 +41949,10 @@ var WfoAdvancedTable = ({
41956
41949
  ...tableProps
41957
41950
  }) => {
41958
41951
  const { theme } = useOrchestratorTheme();
41959
- const [hiddenColumns, setHiddenColumns] = useState18(defaultHiddenColumns);
41960
- const [showSettingsModal, setShowSettingsModal] = useState18(false);
41961
- const [selectedDataForDetailModal, setSelectedDataForDetailModal] = useState18(void 0);
41962
- const [showSearchModal, setShowSearchModal] = useState18(false);
41952
+ const [hiddenColumns, setHiddenColumns] = useState19(defaultHiddenColumns);
41953
+ const [showSettingsModal, setShowSettingsModal] = useState19(false);
41954
+ const [selectedDataForDetailModal, setSelectedDataForDetailModal] = useState19(void 0);
41955
+ const [showSearchModal, setShowSearchModal] = useState19(false);
41963
41956
  const t = useTranslations34("common");
41964
41957
  useEffect9(() => {
41965
41958
  if (defaultHiddenColumns) {
@@ -42352,7 +42345,7 @@ var WfoToastsList = () => {
42352
42345
  };
42353
42346
 
42354
42347
  // src/components/WfoForms/AutoFields.tsx
42355
- import { createElement } from "react";
42348
+ import { createElement as createElement2 } from "react";
42356
42349
  import { useForm } from "uniforms";
42357
42350
  import { AutoField } from "uniforms-unstyled";
42358
42351
  function AutoFields({
@@ -42363,11 +42356,11 @@ function AutoFields({
42363
42356
  ...props
42364
42357
  }) {
42365
42358
  const { schema } = useForm();
42366
- return createElement(
42359
+ return createElement2(
42367
42360
  element,
42368
42361
  { ...props },
42369
42362
  (fields ?? schema.getSubfields()).filter((field) => !omitFields.includes(field)).map(
42370
- (field) => createElement(autoField, {
42363
+ (field) => createElement2(autoField, {
42371
42364
  key: field,
42372
42365
  name: field,
42373
42366
  className: "form-input"
@@ -42377,7 +42370,7 @@ function AutoFields({
42377
42370
  }
42378
42371
 
42379
42372
  // src/components/WfoForms/UserInputForm.tsx
42380
- import { useContext as useContext6, useState as useState27 } from "react";
42373
+ import { useContext as useContext6, useState as useState28 } from "react";
42381
42374
  import invariant from "invariant";
42382
42375
  import cloneDeep2 from "lodash/cloneDeep";
42383
42376
  import get8 from "lodash/get";
@@ -43620,7 +43613,7 @@ function Date2({
43620
43613
  var DateField = connectField15(Date2, { kind: "leaf" });
43621
43614
 
43622
43615
  // src/components/WfoForms/formFields/LocationCodeField.tsx
43623
- import { useEffect as useEffect11, useState as useState19 } from "react";
43616
+ import { useEffect as useEffect11, useState as useState20 } from "react";
43624
43617
  import { useTranslations as useTranslations39 } from "next-intl";
43625
43618
  import { connectField as connectField16, filterDOMProps as filterDOMProps16 } from "uniforms";
43626
43619
 
@@ -43731,7 +43724,7 @@ import { jsx as jsx150 } from "@emotion/react/jsx-runtime";
43731
43724
  filterDOMProps16.register("locationCodes");
43732
43725
  function LocationCode({ locationCodes, ...props }) {
43733
43726
  const t = useTranslations39("pydanticForms");
43734
- const [codes, setCodes] = useState19(locationCodes ?? []);
43727
+ const [codes, setCodes] = useState20(locationCodes ?? []);
43735
43728
  const { data, error } = useLocationCodesQuery();
43736
43729
  useEffect11(() => {
43737
43730
  if (data) {
@@ -43910,7 +43903,7 @@ var ContactPersonAutocomplete = ({
43910
43903
  };
43911
43904
 
43912
43905
  // src/components/WfoForms/formFields/deprecated/ContactPersonNameField.tsx
43913
- import React36, { useEffect as useEffect13, useState as useState20 } from "react";
43906
+ import React36, { useEffect as useEffect13, useState as useState21 } from "react";
43914
43907
  import { isFunction as isFunction2 } from "lodash";
43915
43908
  import get4 from "lodash/get";
43916
43909
  import { useTranslations as useTranslations40 } from "next-intl";
@@ -43975,9 +43968,9 @@ function ContactPersonName({
43975
43968
  customerInitialValue = "";
43976
43969
  }
43977
43970
  const customerIdValue = customerId || contactsField.field.customerId || get4(model, customerIdFieldName, customerInitialValue);
43978
- const [displayAutocomplete, setDisplayAutocomplete] = useState20(false);
43979
- const [contactPersons, setContactPersons] = useState20([]);
43980
- const [selectedIndex, setSelectedIndex] = useState20(-1);
43971
+ const [displayAutocomplete, setDisplayAutocomplete] = useState21(false);
43972
+ const [contactPersons, setContactPersons] = useState21([]);
43973
+ const [selectedIndex, setSelectedIndex] = useState21(-1);
43981
43974
  const { data, error: fetchError } = useContactPersonsQuery(
43982
43975
  { customerIdValue },
43983
43976
  { skip: !customerIdValue }
@@ -44094,7 +44087,7 @@ var ContactPersonNameField = connectField17(ContactPersonName, {
44094
44087
  });
44095
44088
 
44096
44089
  // src/components/WfoForms/formFields/deprecated/ImsNodeIdField.tsx
44097
- import { useEffect as useEffect14, useState as useState21 } from "react";
44090
+ import { useEffect as useEffect14, useState as useState22 } from "react";
44098
44091
  import { get as get5 } from "lodash";
44099
44092
  import { useTranslations as useTranslations41 } from "next-intl";
44100
44093
  import { connectField as connectField18, filterDOMProps as filterDOMProps18 } from "uniforms";
@@ -44109,7 +44102,7 @@ function ImsNodeId({
44109
44102
  ...props
44110
44103
  }) {
44111
44104
  const t = useTranslations41("pydanticForms");
44112
- const [nodes, setNodes] = useState21([]);
44105
+ const [nodes, setNodes] = useState22([]);
44113
44106
  const { data, isLoading, error } = useImsNodesQuery(
44114
44107
  {
44115
44108
  locationCode,
@@ -44147,7 +44140,7 @@ function ImsNodeId({
44147
44140
  var ImsNodeIdField = connectField18(ImsNodeId, { kind: "leaf" });
44148
44141
 
44149
44142
  // src/components/WfoForms/formFields/deprecated/ImsPortIdField.tsx
44150
- import { useCallback as useCallback4, useEffect as useEffect15, useState as useState22 } from "react";
44143
+ import { useCallback as useCallback4, useEffect as useEffect15, useState as useState23 } from "react";
44151
44144
  import ReactSelect2 from "react-select";
44152
44145
  import { useTranslations as useTranslations42 } from "next-intl";
44153
44146
  import { connectField as connectField19, filterDOMProps as filterDOMProps19 } from "uniforms";
@@ -44203,10 +44196,10 @@ function ImsPortId({
44203
44196
  nodeStatuses,
44204
44197
  ...props
44205
44198
  }) {
44206
- const [nodeId, setNodeId] = useState22(
44199
+ const [nodeId, setNodeId] = useState23(
44207
44200
  nodeSubscriptionId
44208
44201
  );
44209
- const [ports, setPorts] = useState22([]);
44202
+ const [ports, setPorts] = useState23([]);
44210
44203
  const t = useTranslations42("pydanticForms");
44211
44204
  const { reactSelectInnerComponentStyles } = useWithOrchestratorTheme(getSelectFieldStyles);
44212
44205
  const {
@@ -44315,13 +44308,13 @@ function ImsPortId({
44315
44308
  var ImsPortIdField = connectField19(ImsPortId, { kind: "leaf" });
44316
44309
 
44317
44310
  // src/components/WfoForms/formFields/deprecated/IpNetworkField.tsx
44318
- import { useState as useState25 } from "react";
44311
+ import { useState as useState26 } from "react";
44319
44312
  import { useTranslations as useTranslations43 } from "next-intl";
44320
44313
  import { connectField as connectField20, filterDOMProps as filterDOMProps20 } from "uniforms";
44321
44314
  import { EuiCallOut as EuiCallOut2, EuiFormRow as EuiFormRow14, EuiText as EuiText26 } from "@elastic/eui";
44322
44315
 
44323
44316
  // src/components/WfoForms/formFields/deprecated/SplitPrefix.tsx
44324
- import { useEffect as useEffect16, useState as useState23 } from "react";
44317
+ import { useEffect as useEffect16, useState as useState24 } from "react";
44325
44318
  import ReactSelect3 from "react-select";
44326
44319
  import { range as range2 } from "lodash";
44327
44320
  import { EuiFlexItem as EuiFlexItem18 } from "@elastic/eui";
@@ -44380,8 +44373,8 @@ var SplitPrefix = ({
44380
44373
  onChange,
44381
44374
  selectedSubnet
44382
44375
  }) => {
44383
- const [subnets, setSubnets] = useState23([]);
44384
- const [desiredPrefixlen, setDesiredPrefixlen] = useState23(prefixMin);
44376
+ const [subnets, setSubnets] = useState24([]);
44377
+ const [desiredPrefixlen, setDesiredPrefixlen] = useState24(prefixMin);
44385
44378
  const { data, isFetching } = useFreeSubnetsQuery({
44386
44379
  subnet,
44387
44380
  netmask: prefixlen,
@@ -44467,7 +44460,7 @@ var SplitPrefix = ({
44467
44460
  var SplitPrefix_default = SplitPrefix;
44468
44461
 
44469
44462
  // src/components/WfoForms/formFields/deprecated/IpPrefixTableField.tsx
44470
- import { useCallback as useCallback5, useEffect as useEffect17, useState as useState24 } from "react";
44463
+ import { useCallback as useCallback5, useEffect as useEffect17, useState as useState25 } from "react";
44471
44464
  import ReactSelect4 from "react-select";
44472
44465
  import {
44473
44466
  EuiBadge as EuiBadge4,
@@ -44500,9 +44493,9 @@ var IpPrefixTableField = ({
44500
44493
  onManualOverride,
44501
44494
  selected_prefix_id
44502
44495
  }) => {
44503
- const [ipBlocks, setIpBlocks] = useState24([]);
44504
- const [filteredPrefixes, setFilteredPrefixes] = useState24([]);
44505
- const [filter, setFilter] = useState24({
44496
+ const [ipBlocks, setIpBlocks] = useState25([]);
44497
+ const [filteredPrefixes, setFilteredPrefixes] = useState25([]);
44498
+ const [filter, setFilter] = useState25({
44506
44499
  state: [
44507
44500
  ipamStates.indexOf("Free"),
44508
44501
  ipamStates.indexOf("Allocated"),
@@ -44511,14 +44504,14 @@ var IpPrefixTableField = ({
44511
44504
  ],
44512
44505
  prefix: void 0
44513
44506
  });
44514
- const [sorted] = useState24({
44507
+ const [sorted] = useState25({
44515
44508
  name: "prefix",
44516
44509
  descending: false
44517
44510
  });
44518
- const [manualOverrideVisible, setManualOverrideVisible] = useState24(false);
44519
- const [manualOverrideValue, setManualOverrideValue] = useState24("");
44520
- const [selectionDone, setSelectionDone] = useState24(false);
44521
- const [parentPrefix, setParentPrefix] = useState24(1);
44511
+ const [manualOverrideVisible, setManualOverrideVisible] = useState25(false);
44512
+ const [manualOverrideValue, setManualOverrideValue] = useState25("");
44513
+ const [selectionDone, setSelectionDone] = useState25(false);
44514
+ const [parentPrefix, setParentPrefix] = useState25(1);
44522
44515
  const { data: prefixFiltersData } = usePrefixFiltersQuery();
44523
44516
  const { data: ipBlocksData, isFetching } = useIpBlocksQuery({
44524
44517
  parentPrefix
@@ -44814,10 +44807,10 @@ function IpNetwork({
44814
44807
  }) {
44815
44808
  const { formRowStyle } = useWithOrchestratorTheme(getCommonFormFieldStyles);
44816
44809
  const t = useTranslations43("pydanticForms");
44817
- const [selectedPrefix, setSelectedPrefix] = useState25(
44810
+ const [selectedPrefix, setSelectedPrefix] = useState26(
44818
44811
  void 0
44819
44812
  );
44820
- const [manualOverride, setManualOverride] = useState25(false);
44813
+ const [manualOverride, setManualOverride] = useState26(false);
44821
44814
  const usePrefix = selectedPrefix?.prefix ?? value;
44822
44815
  const [subnet, netmask] = usePrefix?.split("/") ?? ["", ""];
44823
44816
  const usedPrefixMin = prefixMin ?? parseInt(netmask, 10) + (selectedPrefix?.state === 0 ? 0 : 1);
@@ -45074,7 +45067,7 @@ function Timestamp({
45074
45067
  var TimestampField = connectField21(Timestamp, { kind: "leaf" });
45075
45068
 
45076
45069
  // src/components/WfoForms/formFields/deprecated/VlanField.tsx
45077
- import { useEffect as useEffect18, useState as useState26 } from "react";
45070
+ import { useEffect as useEffect18, useState as useState27 } from "react";
45078
45071
  import get6 from "lodash/get";
45079
45072
  import { useTranslations as useTranslations44 } from "next-intl";
45080
45073
  import { connectField as connectField22, filterDOMProps as filterDOMProps22, joinName as joinName7, useForm as useForm7 } from "uniforms";
@@ -45185,8 +45178,8 @@ function Vlan({
45185
45178
  onChange("");
45186
45179
  }
45187
45180
  }, [onChange, subscriptionId, isFetched, portIsTagged]);
45188
- const [usedVlansInIms, setUsedVlansInIms] = useState26([]);
45189
- const [missingInIms, setMissingInIms] = useState26(false);
45181
+ const [usedVlansInIms, setUsedVlansInIms] = useState27([]);
45182
+ const [missingInIms, setMissingInIms] = useState27(false);
45190
45183
  const {
45191
45184
  data,
45192
45185
  isFetching: isLoading,
@@ -46215,9 +46208,9 @@ function WfoUserInputForm({
46215
46208
  const tDialog = useTranslations48("confirmationDialog");
46216
46209
  const { theme } = useOrchestratorTheme();
46217
46210
  const { showConfirmDialog } = useContext6(ConfirmationDialogContext);
46218
- const [processing, setProcessing] = useState27(false);
46219
- const [nrOfValidationErrors, setNrOfValidationErrors] = useState27(0);
46220
- const [rootErrors, setRootErrors] = useState27([]);
46211
+ const [processing, setProcessing] = useState28(false);
46212
+ const [nrOfValidationErrors, setNrOfValidationErrors] = useState28(0);
46213
+ const [rootErrors, setRootErrors] = useState28([]);
46221
46214
  const openLeavePageDialog = (leaveAction, leaveQuestion) => {
46222
46215
  const question = leaveQuestion || tDialog("leavePage");
46223
46216
  const subQuestion = leaveQuestion ? tDialog("leavePageSub") : "";
@@ -46399,7 +46392,7 @@ function WfoUserInputForm({
46399
46392
  }
46400
46393
 
46401
46394
  // src/components/WfoForms/UserInputFormWizard.tsx
46402
- import { useEffect as useEffect19, useState as useState28 } from "react";
46395
+ import { useEffect as useEffect19, useState as useState29 } from "react";
46403
46396
  import { useRouter as useRouter6 } from "next/router";
46404
46397
  import hash from "object-hash";
46405
46398
  import { jsx as jsx167 } from "@emotion/react/jsx-runtime";
@@ -46418,10 +46411,10 @@ var UserInputFormWizard = ({
46418
46411
  isResuming = false
46419
46412
  }) => {
46420
46413
  const router = useRouter6();
46421
- const [forms, setForms] = useState28([
46414
+ const [forms, setForms] = useState29([
46422
46415
  { form: stepUserInput, hasNext }
46423
46416
  ]);
46424
- const [userInputs, setUserInputs] = useState28([]);
46417
+ const [userInputs, setUserInputs] = useState29([]);
46425
46418
  useEffect19(() => {
46426
46419
  setForms([{ form: stepUserInput, hasNext }]);
46427
46420
  }, [hasNext, stepUserInput]);
@@ -46475,11 +46468,11 @@ var UserInputFormWizard = ({
46475
46468
  };
46476
46469
 
46477
46470
  // src/components/WfoForms/CreateForm.tsx
46478
- import { useCallback as useCallback6, useEffect as useEffect20, useState as useState29 } from "react";
46471
+ import { useCallback as useCallback6, useEffect as useEffect20, useState as useState30 } from "react";
46479
46472
  import { jsx as jsx168 } from "@emotion/react/jsx-runtime";
46480
46473
  function CreateForm(props) {
46481
46474
  const { preselectedInput, formKey, handleSubmit, handleCancel } = props;
46482
- const [form, setForm] = useState29({});
46475
+ const [form, setForm] = useState30({});
46483
46476
  const { stepUserInput, hasNext } = form;
46484
46477
  const [startForm] = useStartFormMutation();
46485
46478
  const submit = useCallback6(
@@ -46559,7 +46552,7 @@ var WfoAuth = ({
46559
46552
  };
46560
46553
 
46561
46554
  // src/components/WfoDropdownButton/WfoDropdownButton.tsx
46562
- import { useState as useState30 } from "react";
46555
+ import { useState as useState31 } from "react";
46563
46556
  import { EuiButtonGroup, EuiPopover as EuiPopover5 } from "@elastic/eui";
46564
46557
  import { jsx as jsx173 } from "@emotion/react/jsx-runtime";
46565
46558
  var WfoDropdownButton = ({
@@ -46567,8 +46560,8 @@ var WfoDropdownButton = ({
46567
46560
  isDisabled = false,
46568
46561
  children
46569
46562
  }) => {
46570
- const [isHovered, setIsHovered] = useState30(false);
46571
- const [isPopoverOpen, setPopoverOpen] = useState30(false);
46563
+ const [isHovered, setIsHovered] = useState31(false);
46564
+ const [isPopoverOpen, setPopoverOpen] = useState31(false);
46572
46565
  const buttonOptions = [
46573
46566
  {
46574
46567
  id: "id_1",
@@ -46625,7 +46618,7 @@ import { useTranslations as useTranslations69 } from "next-intl";
46625
46618
  import Link8 from "next/link";
46626
46619
 
46627
46620
  // src/pages/metadata/WfoProductBlocksPage.tsx
46628
- import { useEffect as useEffect21, useState as useState31 } from "react";
46621
+ import { useEffect as useEffect21, useState as useState32 } from "react";
46629
46622
  import { useTranslations as useTranslations51 } from "next-intl";
46630
46623
  import { EuiBadgeGroup as EuiBadgeGroup2 } from "@elastic/eui";
46631
46624
 
@@ -46691,7 +46684,7 @@ var WfoProductBlocksPage = () => {
46691
46684
  const t = useTranslations51("metadata.productBlocks");
46692
46685
  const tError = useTranslations51("errors");
46693
46686
  const { showToastMessage } = useShowToastMessage();
46694
- const [tableDefaults, setTableDefaults] = useState31();
46687
+ const [tableDefaults, setTableDefaults] = useState32();
46695
46688
  const getStoredTableConfig = useStoredTableConfig(
46696
46689
  METADATA_PRODUCT_BLOCKS_TABLE_LOCAL_STORAGE_KEY
46697
46690
  );
@@ -46875,7 +46868,7 @@ var WfoProductBlocksPage = () => {
46875
46868
  };
46876
46869
 
46877
46870
  // src/pages/metadata/WfoResourceTypesPage.tsx
46878
- import { useEffect as useEffect22, useState as useState32 } from "react";
46871
+ import { useEffect as useEffect22, useState as useState33 } from "react";
46879
46872
  import { useTranslations as useTranslations52 } from "next-intl";
46880
46873
  import { EuiBadgeGroup as EuiBadgeGroup3 } from "@elastic/eui";
46881
46874
  import { Fragment as Fragment40, jsx as jsx176, jsxs as jsxs96 } from "@emotion/react/jsx-runtime";
@@ -46884,7 +46877,7 @@ var WfoResourceTypesPage = () => {
46884
46877
  const t = useTranslations52("metadata.resourceTypes");
46885
46878
  const tError = useTranslations52("errors");
46886
46879
  const { showToastMessage } = useShowToastMessage();
46887
- const [tableDefaults, setTableDefaults] = useState32();
46880
+ const [tableDefaults, setTableDefaults] = useState33();
46888
46881
  const getStoredTableConfig = useStoredTableConfig(
46889
46882
  METADATA_RESOURCE_TYPES_TABLE_LOCAL_STORAGE_KEY
46890
46883
  );
@@ -47025,7 +47018,7 @@ var WfoResourceTypesPage = () => {
47025
47018
  };
47026
47019
 
47027
47020
  // src/pages/metadata/WfoProductsPage.tsx
47028
- import { useEffect as useEffect23, useState as useState33 } from "react";
47021
+ import { useEffect as useEffect23, useState as useState34 } from "react";
47029
47022
  import { useTranslations as useTranslations53 } from "next-intl";
47030
47023
  import { Fragment as Fragment41, jsx as jsx177, jsxs as jsxs97 } from "@emotion/react/jsx-runtime";
47031
47024
  var PRODUCT_FIELD_NAME = "name";
@@ -47033,7 +47026,7 @@ var WfoProductsPage = () => {
47033
47026
  const t = useTranslations53("metadata.products");
47034
47027
  const tError = useTranslations53("errors");
47035
47028
  const { showToastMessage } = useShowToastMessage();
47036
- const [tableDefaults, setTableDefaults] = useState33();
47029
+ const [tableDefaults, setTableDefaults] = useState34();
47037
47030
  const getStoredTableConfig = useStoredTableConfig(
47038
47031
  METADATA_PRODUCT_TABLE_LOCAL_STORAGE_KEY
47039
47032
  );
@@ -47228,7 +47221,7 @@ var WfoProductsPage = () => {
47228
47221
  };
47229
47222
 
47230
47223
  // src/pages/metadata/WfoWorkflowsPage.tsx
47231
- import { useEffect as useEffect24, useState as useState34 } from "react";
47224
+ import { useEffect as useEffect24, useState as useState35 } from "react";
47232
47225
  import { useTranslations as useTranslations54 } from "next-intl";
47233
47226
  import { EuiBadgeGroup as EuiBadgeGroup4 } from "@elastic/eui";
47234
47227
 
@@ -47266,7 +47259,7 @@ var WfoWorkflowsPage = () => {
47266
47259
  const t = useTranslations54("metadata.workflows");
47267
47260
  const tError = useTranslations54("errors");
47268
47261
  const { showToastMessage } = useShowToastMessage();
47269
- const [tableDefaults, setTableDefaults] = useState34();
47262
+ const [tableDefaults, setTableDefaults] = useState35();
47270
47263
  const getStoredTableConfig = useStoredTableConfig(
47271
47264
  METADATA_WORKFLOWS_TABLE_LOCAL_STORAGE_KEY
47272
47265
  );
@@ -47418,7 +47411,7 @@ var WfoWorkflowsPage = () => {
47418
47411
  };
47419
47412
 
47420
47413
  // src/pages/metadata/WfoTasksPage.tsx
47421
- import { useEffect as useEffect25, useState as useState35 } from "react";
47414
+ import { useEffect as useEffect25, useState as useState36 } from "react";
47422
47415
  import { useTranslations as useTranslations55 } from "next-intl";
47423
47416
  import { EuiBadgeGroup as EuiBadgeGroup5 } from "@elastic/eui";
47424
47417
 
@@ -47456,7 +47449,7 @@ var WfoTasksPage = () => {
47456
47449
  const t = useTranslations55("metadata.tasks");
47457
47450
  const tError = useTranslations55("errors");
47458
47451
  const { showToastMessage } = useShowToastMessage();
47459
- const [tableDefaults, setTableDefaults] = useState35();
47452
+ const [tableDefaults, setTableDefaults] = useState36();
47460
47453
  const getStoredTableConfig = useStoredTableConfig(
47461
47454
  METADATA_TASKS_TABLE_LOCAL_STORAGE_KEY
47462
47455
  );
@@ -48198,7 +48191,7 @@ var WfoProcessDetailPage = ({
48198
48191
  };
48199
48192
 
48200
48193
  // src/pages/processes/WfoStartProcessPage.tsx
48201
- import { useCallback as useCallback8, useEffect as useEffect28, useMemo as useMemo5, useState as useState40 } from "react";
48194
+ import { useCallback as useCallback8, useEffect as useEffect28, useMemo as useMemo5, useState as useState41 } from "react";
48202
48195
  import { useTranslations as useTranslations62 } from "next-intl";
48203
48196
  import { useRouter as useRouter9 } from "next/router";
48204
48197
  import {
@@ -48441,7 +48434,7 @@ var getStepContent = (stepDelta, showHiddenKeys) => {
48441
48434
  };
48442
48435
 
48443
48436
  // src/components/WfoWorkflowSteps/WfoStep/WfoStepForm.tsx
48444
- import { useState as useState36 } from "react";
48437
+ import { useState as useState37 } from "react";
48445
48438
  import { EuiFlexItem as EuiFlexItem25 } from "@elastic/eui";
48446
48439
  import { jsx as jsx184 } from "@emotion/react/jsx-runtime";
48447
48440
  var WfoStepForm = ({
@@ -48449,8 +48442,8 @@ var WfoStepForm = ({
48449
48442
  isTask,
48450
48443
  processId
48451
48444
  }) => {
48452
- const [isProcessing, setIsProcessing] = useState36(false);
48453
- const [hasError, setHasError] = useState36(false);
48445
+ const [isProcessing, setIsProcessing] = useState37(false);
48446
+ const [hasError, setHasError] = useState37(false);
48454
48447
  const { theme } = useOrchestratorTheme();
48455
48448
  const [resumeProcess] = useResumeProcessMutation();
48456
48449
  const submitForm = (processInput) => {
@@ -48700,12 +48693,12 @@ var WfoStepList = React57.forwardRef(
48700
48693
  WfoStepList.displayName = "WfoStepList";
48701
48694
 
48702
48695
  // src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoWorkflowStepList.tsx
48703
- import React59, { useEffect as useEffect27, useState as useState38 } from "react";
48696
+ import React59, { useEffect as useEffect27, useState as useState39 } from "react";
48704
48697
  import { useTranslations as useTranslations60 } from "next-intl";
48705
48698
 
48706
48699
  // src/components/WfoDiff/WfoDiff.tsx
48707
48700
  var refractor = __toESM(require_refractor(), 1);
48708
- import { useCallback as useCallback7, useEffect as useEffect26, useMemo as useMemo4, useState as useState37 } from "react";
48701
+ import { useCallback as useCallback7, useEffect as useEffect26, useMemo as useMemo4, useState as useState38 } from "react";
48709
48702
  import { Diff, Hunk, parseDiff, tokenize } from "react-diff-view";
48710
48703
  import "react-diff-view/style/index.css";
48711
48704
  import { useTranslations as useTranslations58 } from "next-intl";
@@ -48762,10 +48755,10 @@ var SMALL_CONTEXT = 3;
48762
48755
  var FULL_CONTEXT = 1e6;
48763
48756
  var WfoDiff = ({ oldText, newText, syntax }) => {
48764
48757
  const t = useTranslations58("processes.delta");
48765
- const [showSplit, setShowSplit] = useState37(true);
48766
- const [showFull, setShowFull] = useState37(false);
48758
+ const [showSplit, setShowSplit] = useState38(true);
48759
+ const [showFull, setShowFull] = useState38(false);
48767
48760
  const { diffStyle } = useWithOrchestratorTheme(getWfoDiffStyles);
48768
- const [{ type, hunks }, setDiff] = useState37({
48761
+ const [{ type, hunks }, setDiff] = useState38({
48769
48762
  type: "modify",
48770
48763
  hunks: []
48771
48764
  });
@@ -48895,16 +48888,16 @@ var WfoWorkflowStepList = React59.forwardRef(
48895
48888
  isTask,
48896
48889
  userInputForm
48897
48890
  }, reference) => {
48898
- const [showHiddenKeys, setShowHiddenKeys] = useState38(false);
48899
- const [showRaw, setShowRaw] = useState38(false);
48900
- const [showDelta, setShowDelta] = useState38(false);
48901
- const [showTraceback, setShowTraceback] = useState38(false);
48891
+ const [showHiddenKeys, setShowHiddenKeys] = useState39(false);
48892
+ const [showRaw, setShowRaw] = useState39(false);
48893
+ const [showDelta, setShowDelta] = useState39(false);
48894
+ const [showTraceback, setShowTraceback] = useState39(false);
48902
48895
  const t = useTranslations60("processes.steps");
48903
48896
  const initialStepListItems = steps.map((step) => ({
48904
48897
  step,
48905
48898
  isExpanded: false
48906
48899
  }));
48907
- const [stepListItems, setStepListItems] = useState38(initialStepListItems);
48900
+ const [stepListItems, setStepListItems] = useState39(initialStepListItems);
48908
48901
  const persistStepListItemState = (previousStepListItems, updatedSteps, userInputForm2) => {
48909
48902
  const reversedSteps = [...updatedSteps].reverse();
48910
48903
  const lastStepWithSuspendStatusStepId = reversedSteps.find(
@@ -48994,7 +48987,7 @@ var WfoWorkflowStepList = React59.forwardRef(
48994
48987
  WfoWorkflowStepList.displayName = "WfoWorkflowStepList";
48995
48988
 
48996
48989
  // src/components/WfoWorkflowSteps/WfoWorkflowStepList/WfoStepListHeader.tsx
48997
- import { useState as useState39 } from "react";
48990
+ import { useState as useState40 } from "react";
48998
48991
  import { useTranslations as useTranslations61 } from "next-intl";
48999
48992
  import {
49000
48993
  EuiButton as EuiButton12,
@@ -49056,7 +49049,7 @@ var WfoStepListHeader = ({
49056
49049
  stepListContentBoldTextStyle,
49057
49050
  stepListOptionsContainerStyle
49058
49051
  } = useWithOrchestratorTheme(getStyles13);
49059
- const [isViewOptionOpen, setIsViewOptionOpen] = useState39(false);
49052
+ const [isViewOptionOpen, setIsViewOptionOpen] = useState40(false);
49060
49053
  const onViewOptionClick = () => setIsViewOptionOpen((isViewOptionOpen2) => !isViewOptionOpen2);
49061
49054
  const closeViewOption = () => setIsViewOptionOpen(false);
49062
49055
  const viewOptionButton = /* @__PURE__ */ jsx191(
@@ -49171,9 +49164,9 @@ var WfoStartProcessPage = ({
49171
49164
  }) => {
49172
49165
  const t = useTranslations62("processes.steps");
49173
49166
  const router = useRouter9();
49174
- const [hasError, setHasError] = useState40(false);
49167
+ const [hasError, setHasError] = useState41(false);
49175
49168
  const { theme } = useOrchestratorTheme();
49176
- const [form, setForm] = useState40({});
49169
+ const [form, setForm] = useState41({});
49177
49170
  const { productId, subscriptionId } = router.query;
49178
49171
  const {
49179
49172
  data: subscriptionDetail,
@@ -49435,14 +49428,14 @@ var WfoSubscriptionDetailPage = () => {
49435
49428
  };
49436
49429
 
49437
49430
  // src/pages/subscriptions/WfoSubscriptionsListPage.tsx
49438
- import { useEffect as useEffect29, useState as useState41 } from "react";
49431
+ import { useEffect as useEffect29, useState as useState42 } from "react";
49439
49432
  import { useTranslations as useTranslations66 } from "next-intl";
49440
49433
  import { StringParam as StringParam3, useQueryParam as useQueryParam2, withDefault as withDefault3 } from "use-query-params";
49441
49434
  import { EuiSpacer as EuiSpacer20 } from "@elastic/eui";
49442
49435
  import { Fragment as Fragment53, jsx as jsx197, jsxs as jsxs113 } from "@emotion/react/jsx-runtime";
49443
49436
  var WfoSubscriptionsListPage = () => {
49444
49437
  const t = useTranslations66("subscriptions.detail");
49445
- const [tableDefaults, setTableDefaults] = useState41();
49438
+ const [tableDefaults, setTableDefaults] = useState42();
49446
49439
  const getStoredTableConfig = useStoredTableConfig(
49447
49440
  SUBSCRIPTIONS_TABLE_LOCAL_STORAGE_KEY
49448
49441
  );
@@ -49507,7 +49500,7 @@ var WfoSubscriptionsListPage = () => {
49507
49500
  };
49508
49501
 
49509
49502
  // src/pages/tasks/WfoTasksListPage.tsx
49510
- import { useContext as useContext9, useEffect as useEffect30, useState as useState42 } from "react";
49503
+ import { useContext as useContext9, useEffect as useEffect30, useState as useState43 } from "react";
49511
49504
  import { useTranslations as useTranslations67 } from "next-intl";
49512
49505
  import Link7 from "next/link";
49513
49506
  import { useRouter as useRouter11 } from "next/router";
@@ -49585,7 +49578,7 @@ var WfoTasksListPage = () => {
49585
49578
  "activeTab",
49586
49579
  withDefault4(StringParam4, "ACTIVE" /* ACTIVE */)
49587
49580
  );
49588
- const [tableDefaults, setTableDefaults] = useState42();
49581
+ const [tableDefaults, setTableDefaults] = useState43();
49589
49582
  const selectedTasksListTab = getTasksListTabTypeFromString(activeTab);
49590
49583
  const localStorageKey = selectedTasksListTab === "ACTIVE" /* ACTIVE */ ? ACTIVE_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY : COMPLETED_TASKS_LIST_TABLE_LOCAL_STORAGE_KEY;
49591
49584
  const getStoredTableConfig = useStoredTableConfig(localStorageKey);
@@ -49694,7 +49687,7 @@ var WfoTasksListPage = () => {
49694
49687
  };
49695
49688
 
49696
49689
  // src/pages/workflows/WfoWorkflowsListPage.tsx
49697
- import { useEffect as useEffect31, useState as useState43 } from "react";
49690
+ import { useEffect as useEffect31, useState as useState44 } from "react";
49698
49691
  import { useTranslations as useTranslations68 } from "next-intl";
49699
49692
  import { useRouter as useRouter12 } from "next/router";
49700
49693
  import { StringParam as StringParam5, useQueryParam as useQueryParam4, withDefault as withDefault5 } from "use-query-params";
@@ -49771,7 +49764,7 @@ var WfoWorkflowsListPage = () => {
49771
49764
  "activeTab",
49772
49765
  withDefault5(StringParam5, "ACTIVE" /* ACTIVE */)
49773
49766
  );
49774
- const [tableDefaults, setTableDefaults] = useState43();
49767
+ const [tableDefaults, setTableDefaults] = useState44();
49775
49768
  const selectedWorkflowsListTab = getWorkflowsListTabTypeFromString(activeTab);
49776
49769
  const localStorageKey = selectedWorkflowsListTab === "ACTIVE" /* ACTIVE */ ? ACTIVE_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY : COMPLETED_PROCESSES_LIST_TABLE_LOCAL_STORAGE_KEY;
49777
49770
  const getStoredTableConfig = useStoredTableConfig(localStorageKey);
@@ -50155,7 +50148,7 @@ var WfoJsonCodeBlock = ({
50155
50148
  };
50156
50149
 
50157
50150
  // src/components/WfoSettings/WfoFlushSettings.tsx
50158
- import { useState as useState44 } from "react";
50151
+ import { useState as useState45 } from "react";
50159
50152
  import { useTranslations as useTranslations70 } from "next-intl";
50160
50153
  import {
50161
50154
  EuiButton as EuiButton14,
@@ -50197,7 +50190,7 @@ var WfoFlushSettings = () => {
50197
50190
  );
50198
50191
  const [clearCache] = useClearCacheMutation();
50199
50192
  const t = useTranslations70("settings.page");
50200
- const [selectedOptions, setSelected] = useState44(
50193
+ const [selectedOptions, setSelected] = useState45(
50201
50194
  []
50202
50195
  );
50203
50196
  const { showToastMessage } = useShowToastMessage();
@@ -51349,23 +51342,25 @@ var WfoProductsSummaryCard = () => {
51349
51342
  };
51350
51343
 
51351
51344
  // src/components/WfoTitleWithWebsocketBadge/WfoTitleWithWebsocketBadge.tsx
51352
- import { EuiFlexGroup as EuiFlexGroup32, EuiFlexItem as EuiFlexItem36, EuiPageHeader as EuiPageHeader3 } from "@elastic/eui";
51353
- import { jsx as jsx224, jsxs as jsxs128 } from "@emotion/react/jsx-runtime";
51345
+ import { EuiPageHeader as EuiPageHeader3 } from "@elastic/eui";
51346
+ import { Fragment as Fragment57, jsx as jsx224, jsxs as jsxs128 } from "@emotion/react/jsx-runtime";
51354
51347
  var WfoTitleWithWebsocketBadge = ({
51355
51348
  title
51356
51349
  }) => {
51357
51350
  const { useWebSockets } = useGetOrchestratorConfig();
51358
- return /* @__PURE__ */ jsxs128(EuiFlexGroup32, { gutterSize: "s", alignItems: "baseline", children: [
51359
- /* @__PURE__ */ jsx224(EuiFlexItem36, { grow: 0, children: /* @__PURE__ */ jsx224(EuiPageHeader3, { pageTitle: title }) }),
51360
- /* @__PURE__ */ jsx224(EuiFlexItem36, { grow: 0, children: useWebSockets && /* @__PURE__ */ jsx224(WfoWebsocketStatusBadge, {}) })
51361
- ] });
51351
+ const pageTitle = useWebSockets ? /* @__PURE__ */ jsxs128(Fragment57, { children: [
51352
+ title,
51353
+ " ",
51354
+ /* @__PURE__ */ jsx224(WfoWebsocketStatusBadge, {})
51355
+ ] }) : title;
51356
+ return /* @__PURE__ */ jsx224(EuiPageHeader3, { pageTitle });
51362
51357
  };
51363
51358
 
51364
51359
  // src/components/WfoRadioDropdown/WfoRadioDropdown.tsx
51365
- import { useState as useState45 } from "react";
51360
+ import { useState as useState46 } from "react";
51366
51361
  import {
51367
51362
  EuiButtonEmpty as EuiButtonEmpty5,
51368
- EuiFlexGroup as EuiFlexGroup33,
51363
+ EuiFlexGroup as EuiFlexGroup32,
51369
51364
  EuiPopover as EuiPopover7,
51370
51365
  EuiRadioGroup
51371
51366
  } from "@elastic/eui";
@@ -51375,7 +51370,7 @@ var WfoRadioDropdown = ({
51375
51370
  onUpdateOption,
51376
51371
  selectedOption
51377
51372
  }) => {
51378
- const [isOpen, setIsOpen] = useState45(false);
51373
+ const [isOpen, setIsOpen] = useState46(false);
51379
51374
  const handleClose = () => {
51380
51375
  if (isOpen) {
51381
51376
  setIsOpen(false);
@@ -51396,7 +51391,7 @@ var WfoRadioDropdown = ({
51396
51391
  label: option.label
51397
51392
  }));
51398
51393
  return /* @__PURE__ */ jsx225(
51399
- EuiFlexGroup33,
51394
+ EuiFlexGroup32,
51400
51395
  {
51401
51396
  gutterSize: "s",
51402
51397
  alignItems: "center",
@@ -51440,7 +51435,7 @@ var WfoRadioDropdown = ({
51440
51435
  };
51441
51436
 
51442
51437
  // src/components/WfoInlineNoteEdit/WfoInlineNoteEdit.tsx
51443
- import { useEffect as useEffect32, useMemo as useMemo6, useState as useState46 } from "react";
51438
+ import { useEffect as useEffect32, useMemo as useMemo6, useState as useState47 } from "react";
51444
51439
  import { EuiInlineEditText } from "@elastic/eui";
51445
51440
  import { jsx as jsx226 } from "@emotion/react/jsx-runtime";
51446
51441
  var WfoInlineNoteEdit = ({
@@ -51449,7 +51444,7 @@ var WfoInlineNoteEdit = ({
51449
51444
  onlyShowOnHover = false
51450
51445
  }) => {
51451
51446
  const initialNote = useMemo6(() => value || "", [value]);
51452
- const [note, setNote] = useState46(initialNote);
51447
+ const [note, setNote] = useState47(initialNote);
51453
51448
  const [startProcess] = useStartProcessMutation();
51454
51449
  const triggerNoteModifyWorkflow = () => {
51455
51450
  const noteModifyPayload = [