@orderingstack/front-components-product-configurator 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/components/Counter/Counter.d.ts +0 -1
  2. package/dist/components/Counter/Counter.d.ts.map +1 -1
  3. package/dist/components/DisplayState/DisplayState.d.ts +0 -1
  4. package/dist/components/DisplayState/DisplayState.d.ts.map +1 -1
  5. package/dist/components/GroupStateInfo/GroupStateInfo.d.ts +0 -1
  6. package/dist/components/GroupStateInfo/GroupStateInfo.d.ts.map +1 -1
  7. package/dist/components/InfoLine/InfoLine.d.ts +0 -1
  8. package/dist/components/InfoLine/InfoLine.d.ts.map +1 -1
  9. package/dist/components/MenuItemsDispatcher/MenuItemsDispatcher.d.ts +0 -1
  10. package/dist/components/MenuItemsDispatcher/MenuItemsDispatcher.d.ts.map +1 -1
  11. package/dist/components/MenuOptions/MenuOptions.d.ts +0 -1
  12. package/dist/components/MenuOptions/MenuOptions.d.ts.map +1 -1
  13. package/dist/components/MenuOptions/MenuOptionsDefaultUI.d.ts +0 -1
  14. package/dist/components/MenuOptions/MenuOptionsDefaultUI.d.ts.map +1 -1
  15. package/dist/components/MenuProduct/MenuProduct.d.ts +0 -1
  16. package/dist/components/MenuProduct/MenuProduct.d.ts.map +1 -1
  17. package/dist/components/MenuProductRoot/MenuProductRoot.d.ts +0 -1
  18. package/dist/components/MenuProductRoot/MenuProductRoot.d.ts.map +1 -1
  19. package/dist/components/MenuProductRoot/MenuProductRootDefaultUI.d.ts +0 -1
  20. package/dist/components/MenuProductRoot/MenuProductRootDefaultUI.d.ts.map +1 -1
  21. package/dist/components/MenuProductRoot/MenuProductRootDefaultUIModal.d.ts +0 -1
  22. package/dist/components/MenuProductRoot/MenuProductRootDefaultUIModal.d.ts.map +1 -1
  23. package/dist/components/Price/Price.d.ts +0 -1
  24. package/dist/components/Price/Price.d.ts.map +1 -1
  25. package/dist/components/ProductConfigurator/ProductConfigurator.d.ts +0 -1
  26. package/dist/components/ProductConfigurator/ProductConfigurator.d.ts.map +1 -1
  27. package/dist/components/ProductConfigurator/useProductConfigurator.d.ts.map +1 -1
  28. package/dist/components/SimpleCheckbox/SimpleCheckbox.d.ts +0 -1
  29. package/dist/components/SimpleCheckbox/SimpleCheckbox.d.ts.map +1 -1
  30. package/dist/components/SimpleRadio/SimpleRadio.d.ts +0 -1
  31. package/dist/components/SimpleRadio/SimpleRadio.d.ts.map +1 -1
  32. package/dist/components/SubmitRow/SubmitRow.d.ts +0 -1
  33. package/dist/components/SubmitRow/SubmitRow.d.ts.map +1 -1
  34. package/dist/index.cjs.js +9 -6
  35. package/dist/index.cjs.js.map +1 -1
  36. package/dist/index.es.js +366 -276
  37. package/dist/index.es.js.map +1 -1
  38. package/dist/types/index.d.ts +0 -1
  39. package/dist/types/index.d.ts.map +1 -1
  40. package/dist/utils/formatValues.d.ts +3 -1
  41. package/dist/utils/formatValues.d.ts.map +1 -1
  42. package/dist/utils/validate.d.ts.map +1 -1
  43. package/package.json +89 -88
package/dist/index.es.js CHANGED
@@ -4903,225 +4903,6 @@ const countComplexProductPrice = (product) => {
4903
4903
  }
4904
4904
  return price;
4905
4905
  };
4906
- const properyToEncode = ["id", "selCtx", "fltCtx"];
4907
- const CHAR_TO_REPLACE = ".";
4908
- const REPLACEMENT_CHAR = "#dot";
4909
- const replaceIn = (value) => {
4910
- return value.replaceAll(CHAR_TO_REPLACE, REPLACEMENT_CHAR);
4911
- };
4912
- const replaceOut = (value) => {
4913
- return value.replaceAll(REPLACEMENT_CHAR, CHAR_TO_REPLACE);
4914
- };
4915
- const encodeValue = (key, value) => {
4916
- return codeValue(key, value, replaceIn);
4917
- };
4918
- const decodeValue = (key, value) => {
4919
- return codeValue(key, value, replaceOut);
4920
- };
4921
- const codeValue = (key, value, replaceCb) => {
4922
- let resValue = value;
4923
- if (properyToEncode.includes(key) && (typeof value === "string" || value instanceof String)) {
4924
- resValue = replaceCb(value);
4925
- }
4926
- if (key === "selected" || key === "filter") {
4927
- const stringified = JSON.stringify(value);
4928
- const stringifiedReplaced = replaceCb(stringified);
4929
- resValue = JSON.parse(stringifiedReplaced);
4930
- }
4931
- return resValue;
4932
- };
4933
- const iterateOverObject = (obj, cb) => {
4934
- Object.keys(obj).forEach((key) => {
4935
- const value = obj[key];
4936
- obj[key] = cb(key, value);
4937
- if (typeof value === "object" && value !== null) {
4938
- iterateOverObject(value, cb);
4939
- }
4940
- });
4941
- return obj;
4942
- };
4943
- const cleanSelected = (selected) => {
4944
- const selectedCopy = JSON.parse(JSON.stringify(selected));
4945
- for (const [contextName, value] of Object.entries(selectedCopy)) {
4946
- if (value && !Array.isArray(value)) {
4947
- const nestedObj = selectedCopy[contextName];
4948
- for (const [nestedKey, nestedValue] of Object.entries(nestedObj)) {
4949
- if (nestedValue === false) {
4950
- delete nestedObj[nestedKey];
4951
- }
4952
- }
4953
- if (Object.keys(nestedObj).length === 0) {
4954
- delete selectedCopy[contextName];
4955
- }
4956
- } else {
4957
- delete selectedCopy[contextName];
4958
- }
4959
- }
4960
- return selectedCopy;
4961
- };
4962
- const decodeSelected = (selected) => {
4963
- return decodeValue("selected", selected);
4964
- };
4965
- const isApiBooleanTrue = (value) => {
4966
- if (value === "true" || value === true) {
4967
- return true;
4968
- }
4969
- return false;
4970
- };
4971
- const scrollToId = (id) => {
4972
- const element = document.getElementById(id);
4973
- if (element) {
4974
- element.scrollIntoView({ behavior: "smooth" });
4975
- } else {
4976
- console.warn(`Error: scrollToId: id: ${id} not found in html structure`);
4977
- }
4978
- };
4979
- const getOptionsKindId = (contextName) => {
4980
- return `options--${contextName}`;
4981
- };
4982
- const getItemImage = (item) => {
4983
- const { details: { media = [] } = {} } = item;
4984
- const mainMedia = media.find((el) => el.name === "MAIN_IMG") || media[0] || {};
4985
- return (mainMedia == null ? void 0 : mainMedia.url) || "";
4986
- };
4987
- const isVisible = (item) => {
4988
- var _a, _b;
4989
- const isHidden = ((_a = item == null ? void 0 : item.attrs) == null ? void 0 : _a.hidden) === true || ((_b = item == null ? void 0 : item["_"]) == null ? void 0 : _b.hidden) === "true";
4990
- return !isHidden;
4991
- };
4992
- function createStore(createState) {
4993
- let state;
4994
- const listeners = /* @__PURE__ */ new Set();
4995
- const setState = (partial, replace) => {
4996
- const nextState = typeof partial === "function" ? partial(state) : partial;
4997
- if (nextState !== state) {
4998
- const previousState = state;
4999
- state = replace ? nextState : Object.assign({}, state, nextState);
5000
- listeners.forEach((listener) => listener(state, previousState));
5001
- }
5002
- };
5003
- const getState = () => state;
5004
- const subscribeWithSelector = (listener, selector = getState, equalityFn = Object.is) => {
5005
- console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");
5006
- let currentSlice = selector(state);
5007
- function listenerToAdd() {
5008
- const nextSlice = selector(state);
5009
- if (!equalityFn(currentSlice, nextSlice)) {
5010
- const previousSlice = currentSlice;
5011
- listener(currentSlice = nextSlice, previousSlice);
5012
- }
5013
- }
5014
- listeners.add(listenerToAdd);
5015
- return () => listeners.delete(listenerToAdd);
5016
- };
5017
- const subscribe = (listener, selector, equalityFn) => {
5018
- if (selector || equalityFn) {
5019
- return subscribeWithSelector(listener, selector, equalityFn);
5020
- }
5021
- listeners.add(listener);
5022
- return () => listeners.delete(listener);
5023
- };
5024
- const destroy = () => listeners.clear();
5025
- const api = { setState, getState, subscribe, destroy };
5026
- state = createState(setState, getState, api);
5027
- return api;
5028
- }
5029
- const isSSR = typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
5030
- const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect;
5031
- function create(createState) {
5032
- const api = typeof createState === "function" ? createStore(createState) : createState;
5033
- const useStore2 = (selector = api.getState, equalityFn = Object.is) => {
5034
- const [, forceUpdate] = useReducer((c) => c + 1, 0);
5035
- const state = api.getState();
5036
- const stateRef = useRef(state);
5037
- const selectorRef = useRef(selector);
5038
- const equalityFnRef = useRef(equalityFn);
5039
- const erroredRef = useRef(false);
5040
- const currentSliceRef = useRef();
5041
- if (currentSliceRef.current === void 0) {
5042
- currentSliceRef.current = selector(state);
5043
- }
5044
- let newStateSlice;
5045
- let hasNewStateSlice = false;
5046
- if (stateRef.current !== state || selectorRef.current !== selector || equalityFnRef.current !== equalityFn || erroredRef.current) {
5047
- newStateSlice = selector(state);
5048
- hasNewStateSlice = !equalityFn(currentSliceRef.current, newStateSlice);
5049
- }
5050
- useIsomorphicLayoutEffect(() => {
5051
- if (hasNewStateSlice) {
5052
- currentSliceRef.current = newStateSlice;
5053
- }
5054
- stateRef.current = state;
5055
- selectorRef.current = selector;
5056
- equalityFnRef.current = equalityFn;
5057
- erroredRef.current = false;
5058
- });
5059
- const stateBeforeSubscriptionRef = useRef(state);
5060
- useIsomorphicLayoutEffect(() => {
5061
- const listener = () => {
5062
- try {
5063
- const nextState = api.getState();
5064
- const nextStateSlice = selectorRef.current(nextState);
5065
- if (!equalityFnRef.current(currentSliceRef.current, nextStateSlice)) {
5066
- stateRef.current = nextState;
5067
- currentSliceRef.current = nextStateSlice;
5068
- forceUpdate();
5069
- }
5070
- } catch (error2) {
5071
- erroredRef.current = true;
5072
- forceUpdate();
5073
- }
5074
- };
5075
- const unsubscribe = api.subscribe(listener);
5076
- if (api.getState() !== stateBeforeSubscriptionRef.current) {
5077
- listener();
5078
- }
5079
- return unsubscribe;
5080
- }, []);
5081
- const sliceToReturn = hasNewStateSlice ? newStateSlice : currentSliceRef.current;
5082
- useDebugValue(sliceToReturn);
5083
- return sliceToReturn;
5084
- };
5085
- Object.assign(useStore2, api);
5086
- useStore2[Symbol.iterator] = function() {
5087
- console.warn("[useStore, api] = create() is deprecated and will be removed in v4");
5088
- const items = [useStore2, api];
5089
- return {
5090
- next() {
5091
- const done = items.length <= 0;
5092
- return { value: items.shift(), done };
5093
- }
5094
- };
5095
- };
5096
- return useStore2;
5097
- }
5098
- const createFilterSlice = (set2) => ({
5099
- filter: {},
5100
- initialSelected: {},
5101
- setInitialFilter: (productFilter) => {
5102
- set2(() => ({
5103
- filter: {
5104
- ...productFilter
5105
- }
5106
- }));
5107
- },
5108
- setInitialSelected: (selected) => {
5109
- set2(() => ({
5110
- initialSelected: selected
5111
- }));
5112
- },
5113
- setFilter: (fltCtx, emit) => {
5114
- set2(({ filter }) => ({
5115
- filter: {
5116
- ...filter,
5117
- [fltCtx]: {
5118
- ...filter[fltCtx],
5119
- ...emit
5120
- }
5121
- }
5122
- }));
5123
- }
5124
- });
5125
4906
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
5126
4907
  var freeGlobal$1 = freeGlobal;
5127
4908
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
@@ -5130,11 +4911,11 @@ var root$1 = root;
5130
4911
  var Symbol$1 = root$1.Symbol;
5131
4912
  var Symbol$2 = Symbol$1;
5132
4913
  var objectProto$f = Object.prototype;
5133
- var hasOwnProperty$c = objectProto$f.hasOwnProperty;
4914
+ var hasOwnProperty$d = objectProto$f.hasOwnProperty;
5134
4915
  var nativeObjectToString$1 = objectProto$f.toString;
5135
4916
  var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
5136
4917
  function getRawTag(value) {
5137
- var isOwn = hasOwnProperty$c.call(value, symToStringTag$1), tag = value[symToStringTag$1];
4918
+ var isOwn = hasOwnProperty$d.call(value, symToStringTag$1), tag = value[symToStringTag$1];
5138
4919
  try {
5139
4920
  value[symToStringTag$1] = void 0;
5140
4921
  var unmasked = true;
@@ -5258,9 +5039,9 @@ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
5258
5039
  var reIsHostCtor = /^\[object .+?Constructor\]$/;
5259
5040
  var funcProto = Function.prototype, objectProto$d = Object.prototype;
5260
5041
  var funcToString = funcProto.toString;
5261
- var hasOwnProperty$b = objectProto$d.hasOwnProperty;
5042
+ var hasOwnProperty$c = objectProto$d.hasOwnProperty;
5262
5043
  var reIsNative = RegExp(
5263
- "^" + funcToString.call(hasOwnProperty$b).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
5044
+ "^" + funcToString.call(hasOwnProperty$c).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
5264
5045
  );
5265
5046
  function baseIsNative(value) {
5266
5047
  if (!isObject(value) || isMasked(value)) {
@@ -5345,10 +5126,10 @@ function eq(value, other) {
5345
5126
  return value === other || value !== value && other !== other;
5346
5127
  }
5347
5128
  var objectProto$c = Object.prototype;
5348
- var hasOwnProperty$a = objectProto$c.hasOwnProperty;
5129
+ var hasOwnProperty$b = objectProto$c.hasOwnProperty;
5349
5130
  function assignValue(object, key, value) {
5350
5131
  var objValue = object[key];
5351
- if (!(hasOwnProperty$a.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
5132
+ if (!(hasOwnProperty$b.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
5352
5133
  baseAssignValue(object, key, value);
5353
5134
  }
5354
5135
  }
@@ -5394,12 +5175,12 @@ function baseIsArguments(value) {
5394
5175
  return isObjectLike(value) && baseGetTag(value) == argsTag$3;
5395
5176
  }
5396
5177
  var objectProto$a = Object.prototype;
5397
- var hasOwnProperty$9 = objectProto$a.hasOwnProperty;
5178
+ var hasOwnProperty$a = objectProto$a.hasOwnProperty;
5398
5179
  var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
5399
5180
  var isArguments = baseIsArguments(function() {
5400
5181
  return arguments;
5401
5182
  }()) ? baseIsArguments : function(value) {
5402
- return isObjectLike(value) && hasOwnProperty$9.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
5183
+ return isObjectLike(value) && hasOwnProperty$a.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
5403
5184
  };
5404
5185
  var isArguments$1 = isArguments;
5405
5186
  function stubFalse() {
@@ -5444,11 +5225,11 @@ var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
5444
5225
  var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
5445
5226
  var isTypedArray$1 = isTypedArray;
5446
5227
  var objectProto$9 = Object.prototype;
5447
- var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
5228
+ var hasOwnProperty$9 = objectProto$9.hasOwnProperty;
5448
5229
  function arrayLikeKeys(value, inherited) {
5449
5230
  var isArr = isArray$1(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
5450
5231
  for (var key in value) {
5451
- if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
5232
+ if ((inherited || hasOwnProperty$9.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
5452
5233
  result.push(key);
5453
5234
  }
5454
5235
  }
@@ -5462,14 +5243,14 @@ function overArg(func, transform) {
5462
5243
  var nativeKeys = overArg(Object.keys, Object);
5463
5244
  var nativeKeys$1 = nativeKeys;
5464
5245
  var objectProto$8 = Object.prototype;
5465
- var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
5246
+ var hasOwnProperty$8 = objectProto$8.hasOwnProperty;
5466
5247
  function baseKeys(object) {
5467
5248
  if (!isPrototype(object)) {
5468
5249
  return nativeKeys$1(object);
5469
5250
  }
5470
5251
  var result = [];
5471
5252
  for (var key in Object(object)) {
5472
- if (hasOwnProperty$7.call(object, key) && key != "constructor") {
5253
+ if (hasOwnProperty$8.call(object, key) && key != "constructor") {
5473
5254
  result.push(key);
5474
5255
  }
5475
5256
  }
@@ -5488,14 +5269,14 @@ function nativeKeysIn(object) {
5488
5269
  return result;
5489
5270
  }
5490
5271
  var objectProto$7 = Object.prototype;
5491
- var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
5272
+ var hasOwnProperty$7 = objectProto$7.hasOwnProperty;
5492
5273
  function baseKeysIn(object) {
5493
5274
  if (!isObject(object)) {
5494
5275
  return nativeKeysIn(object);
5495
5276
  }
5496
5277
  var isProto = isPrototype(object), result = [];
5497
5278
  for (var key in object) {
5498
- if (!(key == "constructor" && (isProto || !hasOwnProperty$6.call(object, key)))) {
5279
+ if (!(key == "constructor" && (isProto || !hasOwnProperty$7.call(object, key)))) {
5499
5280
  result.push(key);
5500
5281
  }
5501
5282
  }
@@ -5517,20 +5298,20 @@ function hashDelete(key) {
5517
5298
  }
5518
5299
  var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
5519
5300
  var objectProto$6 = Object.prototype;
5520
- var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
5301
+ var hasOwnProperty$6 = objectProto$6.hasOwnProperty;
5521
5302
  function hashGet(key) {
5522
5303
  var data = this.__data__;
5523
5304
  if (nativeCreate$1) {
5524
5305
  var result = data[key];
5525
5306
  return result === HASH_UNDEFINED$2 ? void 0 : result;
5526
5307
  }
5527
- return hasOwnProperty$5.call(data, key) ? data[key] : void 0;
5308
+ return hasOwnProperty$6.call(data, key) ? data[key] : void 0;
5528
5309
  }
5529
5310
  var objectProto$5 = Object.prototype;
5530
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
5311
+ var hasOwnProperty$5 = objectProto$5.hasOwnProperty;
5531
5312
  function hashHas(key) {
5532
5313
  var data = this.__data__;
5533
- return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$4.call(data, key);
5314
+ return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$5.call(data, key);
5534
5315
  }
5535
5316
  var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
5536
5317
  function hashSet(key, value) {
@@ -5810,10 +5591,10 @@ if (DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$3 ||
5810
5591
  }
5811
5592
  var getTag$1 = getTag;
5812
5593
  var objectProto$3 = Object.prototype;
5813
- var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
5594
+ var hasOwnProperty$4 = objectProto$3.hasOwnProperty;
5814
5595
  function initCloneArray(array) {
5815
5596
  var length = array.length, result = new array.constructor(length);
5816
- if (length && typeof array[0] == "string" && hasOwnProperty$3.call(array, "index")) {
5597
+ if (length && typeof array[0] == "string" && hasOwnProperty$4.call(array, "index")) {
5817
5598
  result.index = array.index;
5818
5599
  result.input = array.input;
5819
5600
  }
@@ -6105,7 +5886,7 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
6105
5886
  }
6106
5887
  var COMPARE_PARTIAL_FLAG$1 = 1;
6107
5888
  var objectProto$2 = Object.prototype;
6108
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
5889
+ var hasOwnProperty$3 = objectProto$2.hasOwnProperty;
6109
5890
  function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
6110
5891
  var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
6111
5892
  if (objLength != othLength && !isPartial) {
@@ -6114,7 +5895,7 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
6114
5895
  var index = objLength;
6115
5896
  while (index--) {
6116
5897
  var key = objProps[index];
6117
- if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) {
5898
+ if (!(isPartial ? key in other : hasOwnProperty$3.call(other, key))) {
6118
5899
  return false;
6119
5900
  }
6120
5901
  }
@@ -6152,7 +5933,7 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
6152
5933
  var COMPARE_PARTIAL_FLAG = 1;
6153
5934
  var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
6154
5935
  var objectProto$1 = Object.prototype;
6155
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
5936
+ var hasOwnProperty$2 = objectProto$1.hasOwnProperty;
6156
5937
  function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
6157
5938
  var objIsArr = isArray$1(object), othIsArr = isArray$1(other), objTag = objIsArr ? arrayTag : getTag$1(object), othTag = othIsArr ? arrayTag : getTag$1(other);
6158
5939
  objTag = objTag == argsTag ? objectTag : objTag;
@@ -6170,7 +5951,7 @@ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
6170
5951
  return objIsArr || isTypedArray$1(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
6171
5952
  }
6172
5953
  if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
6173
- var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$1.call(other, "__wrapped__");
5954
+ var objIsWrapped = objIsObj && hasOwnProperty$2.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$2.call(other, "__wrapped__");
6174
5955
  if (objIsWrapped || othIsWrapped) {
6175
5956
  var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
6176
5957
  stack || (stack = new Stack());
@@ -6209,7 +5990,7 @@ function inRange(number, start, end) {
6209
5990
  }
6210
5991
  var mapTag = "[object Map]", setTag = "[object Set]";
6211
5992
  var objectProto = Object.prototype;
6212
- var hasOwnProperty = objectProto.hasOwnProperty;
5993
+ var hasOwnProperty$1 = objectProto.hasOwnProperty;
6213
5994
  function isEmpty(value) {
6214
5995
  if (value == null) {
6215
5996
  return true;
@@ -6225,7 +6006,7 @@ function isEmpty(value) {
6225
6006
  return !baseKeys(value).length;
6226
6007
  }
6227
6008
  for (var key in value) {
6228
- if (hasOwnProperty.call(value, key)) {
6009
+ if (hasOwnProperty$1.call(value, key)) {
6229
6010
  return false;
6230
6011
  }
6231
6012
  }
@@ -6234,15 +6015,248 @@ function isEmpty(value) {
6234
6015
  function isEqual(value, other) {
6235
6016
  return baseIsEqual(value, other);
6236
6017
  }
6237
- const isInputEnabled = (item, validationMap) => {
6238
- var _a;
6239
- const { selCtx } = item;
6240
- const isParentProductKind = ((_a = validationMap == null ? void 0 : validationMap[selCtx]) == null ? void 0 : _a.parentKind) === ProductKinds.PRODUCT;
6241
- if (isParentProductKind) {
6242
- return checkSelCtxParam(item, validationMap, "isSelCntAllowedToIncrement");
6018
+ const propertyToEncode = ["id", "selCtx", "fltCtx"];
6019
+ const CHAR_TO_REPLACE = ".";
6020
+ const REPLACEMENT_CHAR = "#dot";
6021
+ const FIX_NUMBER_PREFIX = "#FIX_NUMBER";
6022
+ const encodeProduct = (product) => {
6023
+ return iterateOverObject(cloneDeep(product), encodeValue);
6024
+ };
6025
+ const replaceIn = (value) => {
6026
+ const replaced = value.replaceAll(CHAR_TO_REPLACE, REPLACEMENT_CHAR);
6027
+ if (/^\d+$/.test(replaced)) {
6028
+ return `${FIX_NUMBER_PREFIX}${replaced}`;
6029
+ } else {
6030
+ return replaced;
6031
+ }
6032
+ };
6033
+ const replaceOut = (value) => {
6034
+ return value.replaceAll(REPLACEMENT_CHAR, CHAR_TO_REPLACE).replaceAll(FIX_NUMBER_PREFIX, "");
6035
+ };
6036
+ const encodeValue = (key, value) => {
6037
+ return codeValue(key, value, replaceIn);
6038
+ };
6039
+ const decodeValue = (key, value) => {
6040
+ return codeValue(key, value, replaceOut);
6041
+ };
6042
+ const codeValue = (key, value, replaceCb) => {
6043
+ let resValue = value;
6044
+ function handleState(obj) {
6045
+ const processedObj = {};
6046
+ for (const key2 in obj) {
6047
+ if (obj.hasOwnProperty(key2)) {
6048
+ const processedKey = replaceCb(key2);
6049
+ let processedValue = obj[key2];
6050
+ if (typeof obj[key2] === "object" && obj[key2] !== null) {
6051
+ processedValue = handleState(obj[key2]);
6052
+ }
6053
+ processedObj[processedKey] = processedValue;
6054
+ }
6055
+ }
6056
+ return processedObj;
6057
+ }
6058
+ if (propertyToEncode.includes(key) && (typeof value === "string" || value instanceof String)) {
6059
+ resValue = replaceCb(value);
6060
+ }
6061
+ if (key === "selected" || key === "filter") {
6062
+ resValue = handleState(value);
6063
+ }
6064
+ return resValue;
6065
+ };
6066
+ const iterateOverObject = (obj, cb) => {
6067
+ Object.keys(obj).forEach((key) => {
6068
+ const value = obj[key];
6069
+ obj[key] = cb(key, value);
6070
+ if (typeof value === "object" && value !== null) {
6071
+ iterateOverObject(value, cb);
6072
+ }
6073
+ });
6074
+ return obj;
6075
+ };
6076
+ const cleanSelected = (selected) => {
6077
+ const selectedCopy = JSON.parse(JSON.stringify(selected));
6078
+ for (const [contextName, value] of Object.entries(selectedCopy)) {
6079
+ if (value && !Array.isArray(value)) {
6080
+ const nestedObj = selectedCopy[contextName];
6081
+ for (const [nestedKey, nestedValue] of Object.entries(nestedObj)) {
6082
+ if (nestedValue === false) {
6083
+ delete nestedObj[nestedKey];
6084
+ }
6085
+ }
6086
+ if (Object.keys(nestedObj).length === 0) {
6087
+ delete selectedCopy[contextName];
6088
+ }
6089
+ } else {
6090
+ delete selectedCopy[contextName];
6091
+ }
6092
+ }
6093
+ return selectedCopy;
6094
+ };
6095
+ const decodeSelected = (selected) => {
6096
+ return decodeValue("selected", selected);
6097
+ };
6098
+ const isApiBooleanTrue = (value) => {
6099
+ if (value === "true" || value === true) {
6100
+ return true;
6101
+ }
6102
+ return false;
6103
+ };
6104
+ const scrollToId = (id) => {
6105
+ const element = document.getElementById(id);
6106
+ if (element) {
6107
+ element.scrollIntoView({ behavior: "smooth" });
6243
6108
  } else {
6244
- return checkSelCtxParam(item, validationMap, "isSelCntAllowedToIncrement") && checkParentSelCtxParam(item, validationMap, "isSelCntAllowedToIncrement");
6109
+ console.warn(`Error: scrollToId: id: ${id} not found in html structure`);
6110
+ }
6111
+ };
6112
+ const getOptionsKindId = (contextName) => {
6113
+ return `options--${contextName}`;
6114
+ };
6115
+ const getItemImage = (item) => {
6116
+ const { details: { media = [] } = {} } = item;
6117
+ const mainMedia = media.find((el) => el.name === "MAIN_IMG") || media[0] || {};
6118
+ return (mainMedia == null ? void 0 : mainMedia.url) || "";
6119
+ };
6120
+ const isVisible = (item) => {
6121
+ var _a, _b;
6122
+ const isHidden = ((_a = item == null ? void 0 : item.attrs) == null ? void 0 : _a.hidden) === true || ((_b = item == null ? void 0 : item["_"]) == null ? void 0 : _b.hidden) === "true";
6123
+ return !isHidden;
6124
+ };
6125
+ function createStore(createState) {
6126
+ let state;
6127
+ const listeners = /* @__PURE__ */ new Set();
6128
+ const setState = (partial, replace) => {
6129
+ const nextState = typeof partial === "function" ? partial(state) : partial;
6130
+ if (nextState !== state) {
6131
+ const previousState = state;
6132
+ state = replace ? nextState : Object.assign({}, state, nextState);
6133
+ listeners.forEach((listener) => listener(state, previousState));
6134
+ }
6135
+ };
6136
+ const getState = () => state;
6137
+ const subscribeWithSelector = (listener, selector = getState, equalityFn = Object.is) => {
6138
+ console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");
6139
+ let currentSlice = selector(state);
6140
+ function listenerToAdd() {
6141
+ const nextSlice = selector(state);
6142
+ if (!equalityFn(currentSlice, nextSlice)) {
6143
+ const previousSlice = currentSlice;
6144
+ listener(currentSlice = nextSlice, previousSlice);
6145
+ }
6146
+ }
6147
+ listeners.add(listenerToAdd);
6148
+ return () => listeners.delete(listenerToAdd);
6149
+ };
6150
+ const subscribe = (listener, selector, equalityFn) => {
6151
+ if (selector || equalityFn) {
6152
+ return subscribeWithSelector(listener, selector, equalityFn);
6153
+ }
6154
+ listeners.add(listener);
6155
+ return () => listeners.delete(listener);
6156
+ };
6157
+ const destroy = () => listeners.clear();
6158
+ const api = { setState, getState, subscribe, destroy };
6159
+ state = createState(setState, getState, api);
6160
+ return api;
6161
+ }
6162
+ const isSSR = typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
6163
+ const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect;
6164
+ function create(createState) {
6165
+ const api = typeof createState === "function" ? createStore(createState) : createState;
6166
+ const useStore2 = (selector = api.getState, equalityFn = Object.is) => {
6167
+ const [, forceUpdate] = useReducer((c) => c + 1, 0);
6168
+ const state = api.getState();
6169
+ const stateRef = useRef(state);
6170
+ const selectorRef = useRef(selector);
6171
+ const equalityFnRef = useRef(equalityFn);
6172
+ const erroredRef = useRef(false);
6173
+ const currentSliceRef = useRef();
6174
+ if (currentSliceRef.current === void 0) {
6175
+ currentSliceRef.current = selector(state);
6176
+ }
6177
+ let newStateSlice;
6178
+ let hasNewStateSlice = false;
6179
+ if (stateRef.current !== state || selectorRef.current !== selector || equalityFnRef.current !== equalityFn || erroredRef.current) {
6180
+ newStateSlice = selector(state);
6181
+ hasNewStateSlice = !equalityFn(currentSliceRef.current, newStateSlice);
6182
+ }
6183
+ useIsomorphicLayoutEffect(() => {
6184
+ if (hasNewStateSlice) {
6185
+ currentSliceRef.current = newStateSlice;
6186
+ }
6187
+ stateRef.current = state;
6188
+ selectorRef.current = selector;
6189
+ equalityFnRef.current = equalityFn;
6190
+ erroredRef.current = false;
6191
+ });
6192
+ const stateBeforeSubscriptionRef = useRef(state);
6193
+ useIsomorphicLayoutEffect(() => {
6194
+ const listener = () => {
6195
+ try {
6196
+ const nextState = api.getState();
6197
+ const nextStateSlice = selectorRef.current(nextState);
6198
+ if (!equalityFnRef.current(currentSliceRef.current, nextStateSlice)) {
6199
+ stateRef.current = nextState;
6200
+ currentSliceRef.current = nextStateSlice;
6201
+ forceUpdate();
6202
+ }
6203
+ } catch (error2) {
6204
+ erroredRef.current = true;
6205
+ forceUpdate();
6206
+ }
6207
+ };
6208
+ const unsubscribe = api.subscribe(listener);
6209
+ if (api.getState() !== stateBeforeSubscriptionRef.current) {
6210
+ listener();
6211
+ }
6212
+ return unsubscribe;
6213
+ }, []);
6214
+ const sliceToReturn = hasNewStateSlice ? newStateSlice : currentSliceRef.current;
6215
+ useDebugValue(sliceToReturn);
6216
+ return sliceToReturn;
6217
+ };
6218
+ Object.assign(useStore2, api);
6219
+ useStore2[Symbol.iterator] = function() {
6220
+ console.warn("[useStore, api] = create() is deprecated and will be removed in v4");
6221
+ const items = [useStore2, api];
6222
+ return {
6223
+ next() {
6224
+ const done = items.length <= 0;
6225
+ return { value: items.shift(), done };
6226
+ }
6227
+ };
6228
+ };
6229
+ return useStore2;
6230
+ }
6231
+ const createFilterSlice = (set2) => ({
6232
+ filter: {},
6233
+ initialSelected: {},
6234
+ setInitialFilter: (productFilter) => {
6235
+ set2(() => ({
6236
+ filter: {
6237
+ ...productFilter
6238
+ }
6239
+ }));
6240
+ },
6241
+ setInitialSelected: (selected) => {
6242
+ set2(() => ({
6243
+ initialSelected: selected
6244
+ }));
6245
+ },
6246
+ setFilter: (fltCtx, emit) => {
6247
+ set2(({ filter }) => ({
6248
+ filter: {
6249
+ ...filter,
6250
+ [fltCtx]: {
6251
+ ...filter[fltCtx],
6252
+ ...emit
6253
+ }
6254
+ }
6255
+ }));
6245
6256
  }
6257
+ });
6258
+ const isInputEnabled = (item, validationMap) => {
6259
+ return checkSelCtxParam(item, validationMap, "isSelCntAllowedToIncrement") && checkSelCtxParam(item, validationMap, "isQtyCntAllowedToIncrement") && checkParentSelCtxParam(item, validationMap, "isQtyCntAllowedToIncrement") && checkParentSelCtxParam(item, validationMap, "isQtyCntAllowedToIncrement");
6246
6260
  };
6247
6261
  const isInputCounterIncrementEnabled = (item, itemActualQty, validationMap) => {
6248
6262
  var _a;
@@ -6457,9 +6471,12 @@ function getValidSelectedState(product, selected) {
6457
6471
  function useProductConfigurator(product) {
6458
6472
  var _a;
6459
6473
  const [productQuantity, setProductQuantity] = useState(1);
6460
- const encodedProduct = iterateOverObject(product, encodeValue);
6474
+ const encodedProduct = encodeProduct(product);
6461
6475
  const { state: { filter: initFilter = {} } = {} } = encodedProduct;
6462
- const initSelected = getValidSelectedState(product, (_a = product.state) == null ? void 0 : _a.selected);
6476
+ const initSelected = getValidSelectedState(
6477
+ encodedProduct,
6478
+ (_a = encodedProduct.state) == null ? void 0 : _a.selected
6479
+ );
6463
6480
  const setInitialFilter = useStore((state) => state.setInitialFilter);
6464
6481
  const setInitialSelected = useStore((state) => state.setInitialSelected);
6465
6482
  const setInitialValidate = useStore((state) => state.setInitialValidate);
@@ -6716,8 +6733,75 @@ function useMenuOptions(product, nestedLvl, parentKind, parentSelCtx) {
6716
6733
  }
6717
6734
  var jsxRuntime = { exports: {} };
6718
6735
  var reactJsxRuntime_production_min = {};
6719
- /**
6720
- * @license React
6736
+ /*
6737
+ object-assign
6738
+ (c) Sindre Sorhus
6739
+ @license MIT
6740
+ */
6741
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
6742
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
6743
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
6744
+ function toObject(val) {
6745
+ if (val === null || val === void 0) {
6746
+ throw new TypeError("Object.assign cannot be called with null or undefined");
6747
+ }
6748
+ return Object(val);
6749
+ }
6750
+ function shouldUseNative() {
6751
+ try {
6752
+ if (!Object.assign) {
6753
+ return false;
6754
+ }
6755
+ var test1 = new String("abc");
6756
+ test1[5] = "de";
6757
+ if (Object.getOwnPropertyNames(test1)[0] === "5") {
6758
+ return false;
6759
+ }
6760
+ var test2 = {};
6761
+ for (var i2 = 0; i2 < 10; i2++) {
6762
+ test2["_" + String.fromCharCode(i2)] = i2;
6763
+ }
6764
+ var order2 = Object.getOwnPropertyNames(test2).map(function(n2) {
6765
+ return test2[n2];
6766
+ });
6767
+ if (order2.join("") !== "0123456789") {
6768
+ return false;
6769
+ }
6770
+ var test3 = {};
6771
+ "abcdefghijklmnopqrst".split("").forEach(function(letter) {
6772
+ test3[letter] = letter;
6773
+ });
6774
+ if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
6775
+ return false;
6776
+ }
6777
+ return true;
6778
+ } catch (err) {
6779
+ return false;
6780
+ }
6781
+ }
6782
+ shouldUseNative() ? Object.assign : function(target, source) {
6783
+ var from;
6784
+ var to = toObject(target);
6785
+ var symbols;
6786
+ for (var s2 = 1; s2 < arguments.length; s2++) {
6787
+ from = Object(arguments[s2]);
6788
+ for (var key in from) {
6789
+ if (hasOwnProperty.call(from, key)) {
6790
+ to[key] = from[key];
6791
+ }
6792
+ }
6793
+ if (getOwnPropertySymbols) {
6794
+ symbols = getOwnPropertySymbols(from);
6795
+ for (var i2 = 0; i2 < symbols.length; i2++) {
6796
+ if (propIsEnumerable.call(from, symbols[i2])) {
6797
+ to[symbols[i2]] = from[symbols[i2]];
6798
+ }
6799
+ }
6800
+ }
6801
+ }
6802
+ return to;
6803
+ };
6804
+ /** @license React v17.0.2
6721
6805
  * react-jsx-runtime.production.min.js
6722
6806
  *
6723
6807
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -6725,20 +6809,26 @@ var reactJsxRuntime_production_min = {};
6725
6809
  * This source code is licensed under the MIT license found in the
6726
6810
  * LICENSE file in the root directory of this source tree.
6727
6811
  */
6728
- var f$3 = React, k$2 = Symbol.for("react.element"), l$4 = Symbol.for("react.fragment"), m$3 = Object.prototype.hasOwnProperty, n$2 = f$3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p$3 = { key: true, ref: true, __self: true, __source: true };
6729
- function q(c, a2, g) {
6730
- var b, d2 = {}, e2 = null, h2 = null;
6731
- void 0 !== g && (e2 = "" + g);
6812
+ var f$3 = React, g = 60103;
6813
+ reactJsxRuntime_production_min.Fragment = 60107;
6814
+ if ("function" === typeof Symbol && Symbol.for) {
6815
+ var h$3 = Symbol.for;
6816
+ g = h$3("react.element");
6817
+ reactJsxRuntime_production_min.Fragment = h$3("react.fragment");
6818
+ }
6819
+ var m$3 = f$3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, n$2 = Object.prototype.hasOwnProperty, p$3 = { key: true, ref: true, __self: true, __source: true };
6820
+ function q(c, a2, k2) {
6821
+ var b, d2 = {}, e2 = null, l2 = null;
6822
+ void 0 !== k2 && (e2 = "" + k2);
6732
6823
  void 0 !== a2.key && (e2 = "" + a2.key);
6733
- void 0 !== a2.ref && (h2 = a2.ref);
6824
+ void 0 !== a2.ref && (l2 = a2.ref);
6734
6825
  for (b in a2)
6735
- m$3.call(a2, b) && !p$3.hasOwnProperty(b) && (d2[b] = a2[b]);
6826
+ n$2.call(a2, b) && !p$3.hasOwnProperty(b) && (d2[b] = a2[b]);
6736
6827
  if (c && c.defaultProps)
6737
6828
  for (b in a2 = c.defaultProps, a2)
6738
6829
  void 0 === d2[b] && (d2[b] = a2[b]);
6739
- return { $$typeof: k$2, type: c, key: e2, ref: h2, props: d2, _owner: n$2.current };
6830
+ return { $$typeof: g, type: c, key: e2, ref: l2, props: d2, _owner: m$3.current };
6740
6831
  }
6741
- reactJsxRuntime_production_min.Fragment = l$4;
6742
6832
  reactJsxRuntime_production_min.jsx = q;
6743
6833
  reactJsxRuntime_production_min.jsxs = q;
6744
6834
  {
@@ -7288,7 +7378,7 @@ var Dinero = function Dinero2(options) {
7288
7378
  var factor = Math.pow(10, digits);
7289
7379
  return calculator$1.divide(calculator$1.round(calculator$1.multiply(this.toUnit(), factor), roundingMode), factor);
7290
7380
  },
7291
- toObject: function toObject() {
7381
+ toObject: function toObject2() {
7292
7382
  return {
7293
7383
  amount,
7294
7384
  currency,
@@ -9332,8 +9422,8 @@ function p$1(r2, t2 = {}, e2, a2) {
9332
9422
  let d2 = {};
9333
9423
  if (t2) {
9334
9424
  let f2 = false, y2 = [];
9335
- for (let [h2, g] of Object.entries(t2))
9336
- typeof g == "boolean" && (f2 = true), g === true && y2.push(h2);
9425
+ for (let [h2, g2] of Object.entries(t2))
9426
+ typeof g2 == "boolean" && (f2 = true), g2 === true && y2.push(h2);
9337
9427
  f2 && (d2["data-headlessui-state"] = y2.join(" "));
9338
9428
  }
9339
9429
  if (o2 === Fragment$1 && Object.keys(F$3(s2)).length > 0) {
@@ -9757,31 +9847,31 @@ let Se$1 = "div", Le = S$1.RenderStrategy | S$1.Static, Me = C$1(function(e2, r2
9757
9847
  throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${a2}`);
9758
9848
  if (typeof o2 != "function")
9759
9849
  throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o2}`);
9760
- let g = a2 ? 0 : 1, [h2, Q2] = useReducer(Ce$1, { titleId: null, descriptionId: null, panelRef: createRef() }), R = o$3(() => o2(false)), j2 = o$3((T2) => Q2({ type: 0, id: T2 })), x2 = a$2() ? f2 ? false : g === 0 : false, w2 = n$12 > 1, X2 = useContext(H) !== null, Z = w2 ? "parent" : "leaf";
9850
+ let g2 = a2 ? 0 : 1, [h2, Q2] = useReducer(Ce$1, { titleId: null, descriptionId: null, panelRef: createRef() }), R = o$3(() => o2(false)), j2 = o$3((T2) => Q2({ type: 0, id: T2 })), x2 = a$2() ? f2 ? false : g2 === 0 : false, w2 = n$12 > 1, X2 = useContext(H) !== null, Z = w2 ? "parent" : "leaf";
9761
9851
  M$3(u2, w2 ? x2 : false);
9762
9852
  let N2 = o$3(() => {
9763
9853
  var b, D2;
9764
9854
  return [...Array.from((b = y$1 == null ? void 0 : y$1.querySelectorAll("body > *, [data-headlessui-portal]")) != null ? b : []).filter((E2) => !(!(E2 instanceof HTMLElement) || E2.contains(U2.current) || h2.panelRef.current && E2.contains(h2.panelRef.current))), (D2 = h2.panelRef.current) != null ? D2 : u2.current];
9765
9855
  });
9766
9856
  L(() => N2(), R, x2 && !w2), E(y$1 == null ? void 0 : y$1.defaultView, "keydown", (T2) => {
9767
- T2.defaultPrevented || T2.key === o$1.Escape && g === 0 && (w2 || (T2.preventDefault(), T2.stopPropagation(), R()));
9768
- }), Oe(y$1, g === 0 && !X2, N2), useEffect(() => {
9769
- if (g !== 0 || !u2.current)
9857
+ T2.defaultPrevented || T2.key === o$1.Escape && g2 === 0 && (w2 || (T2.preventDefault(), T2.stopPropagation(), R()));
9858
+ }), Oe(y$1, g2 === 0 && !X2, N2), useEffect(() => {
9859
+ if (g2 !== 0 || !u2.current)
9770
9860
  return;
9771
9861
  let T2 = new IntersectionObserver((b) => {
9772
9862
  for (let D2 of b)
9773
9863
  D2.boundingClientRect.x === 0 && D2.boundingClientRect.y === 0 && D2.boundingClientRect.width === 0 && D2.boundingClientRect.height === 0 && R();
9774
9864
  });
9775
9865
  return T2.observe(u2.current), () => T2.disconnect();
9776
- }, [g, u2, R]);
9777
- let [ee, te] = k$1(), oe2 = useMemo(() => [{ dialogState: g, close: R, setTitleId: j2 }, h2], [g, h2, R, j2]), V = useMemo(() => ({ open: g === 0 }), [g]), re2 = { ref: _24, id: d2, role: "dialog", "aria-modal": g === 0 ? true : void 0, "aria-labelledby": h2.titleId, "aria-describedby": ee };
9778
- return React.createElement(M$2, { type: "Dialog", enabled: g === 0, element: u2, onUpdate: o$3((T2, b, D2) => {
9866
+ }, [g2, u2, R]);
9867
+ let [ee, te] = k$1(), oe2 = useMemo(() => [{ dialogState: g2, close: R, setTitleId: j2 }, h2], [g2, h2, R, j2]), V = useMemo(() => ({ open: g2 === 0 }), [g2]), re2 = { ref: _24, id: d2, role: "dialog", "aria-modal": g2 === 0 ? true : void 0, "aria-labelledby": h2.titleId, "aria-describedby": ee };
9868
+ return React.createElement(M$2, { type: "Dialog", enabled: g2 === 0, element: u2, onUpdate: o$3((T2, b, D2) => {
9779
9869
  b === "Dialog" && u$3(T2, { [s.Add]() {
9780
9870
  P2.current.add(D2), i2((E2) => E2 + 1);
9781
9871
  }, [s.Remove]() {
9782
9872
  P2.current.add(D2), i2((E2) => E2 - 1);
9783
9873
  } });
9784
- }) }, React.createElement(P$1, { force: true }, React.createElement($, null, React.createElement(H.Provider, { value: oe2 }, React.createElement($.Group, { target: u2 }, React.createElement(P$1, { force: false }, React.createElement(te, { slot: V, name: "Dialog.Description" }, React.createElement(de, { initialFocus: p$12, containers: P2, features: x2 ? u$3(Z, { parent: de.features.RestoreFocus, leaf: de.features.All & ~de.features.FocusLock }) : de.features.None }, $$1({ ourProps: re2, theirProps: c, slot: V, defaultTag: Se$1, features: Le, visible: g === 0, name: "Dialog" })))))))), React.createElement(h$1, { features: s$4.Hidden, ref: U2 }));
9874
+ }) }, React.createElement(P$1, { force: true }, React.createElement($, null, React.createElement(H.Provider, { value: oe2 }, React.createElement($.Group, { target: u2 }, React.createElement(P$1, { force: false }, React.createElement(te, { slot: V, name: "Dialog.Description" }, React.createElement(de, { initialFocus: p$12, containers: P2, features: x2 ? u$3(Z, { parent: de.features.RestoreFocus, leaf: de.features.All & ~de.features.FocusLock }) : de.features.None }, $$1({ ourProps: re2, theirProps: c, slot: V, defaultTag: Se$1, features: Le, visible: g2 === 0, name: "Dialog" })))))))), React.createElement(h$1, { features: s$4.Hidden, ref: U2 }));
9785
9875
  }), ke = "div", we = C$1(function(e2, r2) {
9786
9876
  let s2 = I$2(), { id: d2 = `headlessui-dialog-overlay-${s2}`, ...a2 } = e2, [{ dialogState: o2, close: p2 }] = k("Dialog.Overlay"), f2 = y(r2), c = o$3((l2) => {
9787
9877
  if (l2.target === l2.currentTarget) {
@@ -9828,7 +9918,7 @@ function F(t2, e2) {
9828
9918
  if (!t2)
9829
9919
  return n2.dispose;
9830
9920
  let { transitionDuration: a2, transitionDelay: i2 } = getComputedStyle(t2), [m2, d2] = [a2, i2].map((o2) => {
9831
- let [r2 = 0] = o2.split(",").filter(Boolean).map((l2) => l2.includes("ms") ? parseFloat(l2) : parseFloat(l2) * 1e3).sort((l2, g) => g - l2);
9921
+ let [r2 = 0] = o2.split(",").filter(Boolean).map((l2) => l2.includes("ms") ? parseFloat(l2) : parseFloat(l2) * 1e3).sort((l2, g2) => g2 - l2);
9832
9922
  return r2;
9833
9923
  });
9834
9924
  if (m2 + d2 !== 0) {