@heycater/qualification-funnel 1.19.13 → 1.19.15

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.esm.js CHANGED
@@ -9878,14 +9878,18 @@ const IconButtonLeft$1 = styled(StepperIconButton$1)`
9878
9878
  margin-right: ${(props) => props.theme.spacing(2)}px;
9879
9879
  `;
9880
9880
  const localeConfig = {
9881
- locales: ["en", "de"],
9882
9881
  defaultLocale: "de"
9883
9882
  };
9883
+ const normalizeLocale = (locale2) => {
9884
+ if (typeof locale2 === "string") {
9885
+ if (locale2.startsWith("en")) return "en";
9886
+ if (locale2.startsWith("de")) return "de";
9887
+ }
9888
+ return localeConfig.defaultLocale;
9889
+ };
9884
9890
  const algoliaAttributeNameForLocale = (locale2) => (name) => {
9885
9891
  const toLocalizedAlgoliaKey = (name2) => {
9886
- const parsedLocale = localeConfig.locales.includes(
9887
- locale2
9888
- ) ? locale2 : localeConfig.defaultLocale;
9892
+ const parsedLocale = normalizeLocale(locale2);
9889
9893
  return `${name2}_${parsedLocale}`;
9890
9894
  };
9891
9895
  if (name.includes(".")) {
@@ -9895,9 +9899,8 @@ const algoliaAttributeNameForLocale = (locale2) => (name) => {
9895
9899
  return toLocalizedAlgoliaKey(name);
9896
9900
  };
9897
9901
  const attributeNameForLocale = (locale2) => (name) => {
9898
- if (!localeConfig.locales.includes(locale2))
9899
- return `${name}${capitalize$3(localeConfig.defaultLocale)}`;
9900
- return `${name}${capitalize$3(locale2)}`;
9902
+ const normalizedLocale = normalizeLocale(locale2);
9903
+ return `${name}${capitalize$3(normalizedLocale)}`;
9901
9904
  };
9902
9905
  function useLocalizedFieldName() {
9903
9906
  const router = useRouter();
@@ -10860,7 +10863,7 @@ const SwitchesWrapper = styled.div`
10860
10863
  `;
10861
10864
  const defaultLeadTimeInDays = DEFAULT_LEAD_DAYS;
10862
10865
  function DatePickerEmbedded() {
10863
- var _a2, _b;
10866
+ var _a2, _b, _c;
10864
10867
  const router = useRouter();
10865
10868
  const { answerOf, actions, state } = useQualification();
10866
10869
  const { trackAnswer } = useTracking();
@@ -10874,7 +10877,7 @@ function DatePickerEmbedded() {
10874
10877
  answers: state.qualification.answers,
10875
10878
  selectedCaterer: state.qualification.selectedCaterer
10876
10879
  }) : null;
10877
- const minDateMessage = router.locale === "en" ? (_a2 = attributes == null ? void 0 : attributes.minDate) == null ? void 0 : _a2.messageEn : (_b = attributes == null ? void 0 : attributes.minDate) == null ? void 0 : _b.messageDe;
10880
+ const minDateMessage = ((_a2 = router.locale) == null ? void 0 : _a2.startsWith("en")) ? (_b = attributes == null ? void 0 : attributes.minDate) == null ? void 0 : _b.messageEn : (_c = attributes == null ? void 0 : attributes.minDate) == null ? void 0 : _c.messageDe;
10878
10881
  const [isRecurringNeedSelected] = useState(
10879
10882
  !!answerOf(isRecurringQuestion.id)
10880
10883
  );
@@ -12473,7 +12476,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
12473
12476
  var ys = arrObjKeys(obj, inspect2);
12474
12477
  var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
12475
12478
  var protoTag = obj instanceof Object ? "" : "null prototype";
12476
- var stringTag2 = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
12479
+ var stringTag2 = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
12477
12480
  var constructorTag = isPlainObject2 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
12478
12481
  var tag = constructorTag + (stringTag2 || protoTag ? "[" + $join.call($concat$1.call([], stringTag2 || [], protoTag || []), ": ") + "] " : "");
12479
12482
  if (ys.length === 0) {
@@ -12498,25 +12501,25 @@ function canTrustToString(obj) {
12498
12501
  return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
12499
12502
  }
12500
12503
  function isArray$3(obj) {
12501
- return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
12504
+ return toStr(obj) === "[object Array]" && canTrustToString(obj);
12502
12505
  }
12503
12506
  function isDate(obj) {
12504
- return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
12507
+ return toStr(obj) === "[object Date]" && canTrustToString(obj);
12505
12508
  }
12506
12509
  function isRegExp$1(obj) {
12507
- return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
12510
+ return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
12508
12511
  }
12509
12512
  function isError(obj) {
12510
- return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
12513
+ return toStr(obj) === "[object Error]" && canTrustToString(obj);
12511
12514
  }
12512
12515
  function isString(obj) {
12513
- return toStr$1(obj) === "[object String]" && canTrustToString(obj);
12516
+ return toStr(obj) === "[object String]" && canTrustToString(obj);
12514
12517
  }
12515
12518
  function isNumber(obj) {
12516
- return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
12519
+ return toStr(obj) === "[object Number]" && canTrustToString(obj);
12517
12520
  }
12518
12521
  function isBoolean(obj) {
12519
- return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
12522
+ return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
12520
12523
  }
12521
12524
  function isSymbol(obj) {
12522
12525
  if (hasShammedSymbols) {
@@ -12552,7 +12555,7 @@ var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
12552
12555
  function has$4(obj, key) {
12553
12556
  return hasOwn$1.call(obj, key);
12554
12557
  }
12555
- function toStr$1(obj) {
12558
+ function toStr(obj) {
12556
12559
  return objectToString.call(obj);
12557
12560
  }
12558
12561
  function nameOf(f) {
@@ -12861,7 +12864,7 @@ var syntax = SyntaxError;
12861
12864
  var uri = URIError;
12862
12865
  var abs$1 = Math.abs;
12863
12866
  var floor$1 = Math.floor;
12864
- var max$2 = Math.max;
12867
+ var max$1 = Math.max;
12865
12868
  var min$1 = Math.min;
12866
12869
  var pow$1 = Math.pow;
12867
12870
  var round$2 = Math.round;
@@ -12990,77 +12993,91 @@ function requireObject_getPrototypeOf() {
12990
12993
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
12991
12994
  return Object_getPrototypeOf;
12992
12995
  }
12993
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
12994
- var toStr = Object.prototype.toString;
12995
- var max$1 = Math.max;
12996
- var funcType = "[object Function]";
12997
- var concatty = function concatty2(a3, b2) {
12998
- var arr = [];
12999
- for (var i2 = 0; i2 < a3.length; i2 += 1) {
13000
- arr[i2] = a3[i2];
13001
- }
13002
- for (var j = 0; j < b2.length; j += 1) {
13003
- arr[j + a3.length] = b2[j];
13004
- }
13005
- return arr;
13006
- };
13007
- var slicy = function slicy2(arrLike, offset2) {
13008
- var arr = [];
13009
- for (var i2 = offset2, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
13010
- arr[j] = arrLike[i2];
13011
- }
13012
- return arr;
13013
- };
13014
- var joiny = function(arr, joiner) {
13015
- var str = "";
13016
- for (var i2 = 0; i2 < arr.length; i2 += 1) {
13017
- str += arr[i2];
13018
- if (i2 + 1 < arr.length) {
13019
- str += joiner;
12996
+ var implementation;
12997
+ var hasRequiredImplementation;
12998
+ function requireImplementation() {
12999
+ if (hasRequiredImplementation) return implementation;
13000
+ hasRequiredImplementation = 1;
13001
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
13002
+ var toStr2 = Object.prototype.toString;
13003
+ var max2 = Math.max;
13004
+ var funcType = "[object Function]";
13005
+ var concatty = function concatty2(a3, b2) {
13006
+ var arr = [];
13007
+ for (var i2 = 0; i2 < a3.length; i2 += 1) {
13008
+ arr[i2] = a3[i2];
13020
13009
  }
13021
- }
13022
- return str;
13023
- };
13024
- var implementation$1 = function bind(that) {
13025
- var target = this;
13026
- if (typeof target !== "function" || toStr.apply(target) !== funcType) {
13027
- throw new TypeError(ERROR_MESSAGE + target);
13028
- }
13029
- var args = slicy(arguments, 1);
13030
- var bound;
13031
- var binder = function() {
13032
- if (this instanceof bound) {
13033
- var result = target.apply(
13034
- this,
13035
- concatty(args, arguments)
13036
- );
13037
- if (Object(result) === result) {
13038
- return result;
13010
+ for (var j = 0; j < b2.length; j += 1) {
13011
+ arr[j + a3.length] = b2[j];
13012
+ }
13013
+ return arr;
13014
+ };
13015
+ var slicy = function slicy2(arrLike, offset2) {
13016
+ var arr = [];
13017
+ for (var i2 = offset2, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
13018
+ arr[j] = arrLike[i2];
13019
+ }
13020
+ return arr;
13021
+ };
13022
+ var joiny = function(arr, joiner) {
13023
+ var str = "";
13024
+ for (var i2 = 0; i2 < arr.length; i2 += 1) {
13025
+ str += arr[i2];
13026
+ if (i2 + 1 < arr.length) {
13027
+ str += joiner;
13039
13028
  }
13040
- return this;
13041
13029
  }
13042
- return target.apply(
13043
- that,
13044
- concatty(args, arguments)
13045
- );
13030
+ return str;
13046
13031
  };
13047
- var boundLength = max$1(0, target.length - args.length);
13048
- var boundArgs = [];
13049
- for (var i2 = 0; i2 < boundLength; i2++) {
13050
- boundArgs[i2] = "$" + i2;
13051
- }
13052
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
13053
- if (target.prototype) {
13054
- var Empty = function Empty2() {
13032
+ implementation = function bind2(that) {
13033
+ var target = this;
13034
+ if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
13035
+ throw new TypeError(ERROR_MESSAGE + target);
13036
+ }
13037
+ var args = slicy(arguments, 1);
13038
+ var bound;
13039
+ var binder = function() {
13040
+ if (this instanceof bound) {
13041
+ var result = target.apply(
13042
+ this,
13043
+ concatty(args, arguments)
13044
+ );
13045
+ if (Object(result) === result) {
13046
+ return result;
13047
+ }
13048
+ return this;
13049
+ }
13050
+ return target.apply(
13051
+ that,
13052
+ concatty(args, arguments)
13053
+ );
13055
13054
  };
13056
- Empty.prototype = target.prototype;
13057
- bound.prototype = new Empty();
13058
- Empty.prototype = null;
13059
- }
13060
- return bound;
13061
- };
13062
- var implementation = implementation$1;
13063
- var functionBind = Function.prototype.bind || implementation;
13055
+ var boundLength = max2(0, target.length - args.length);
13056
+ var boundArgs = [];
13057
+ for (var i2 = 0; i2 < boundLength; i2++) {
13058
+ boundArgs[i2] = "$" + i2;
13059
+ }
13060
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
13061
+ if (target.prototype) {
13062
+ var Empty = function Empty2() {
13063
+ };
13064
+ Empty.prototype = target.prototype;
13065
+ bound.prototype = new Empty();
13066
+ Empty.prototype = null;
13067
+ }
13068
+ return bound;
13069
+ };
13070
+ return implementation;
13071
+ }
13072
+ var functionBind;
13073
+ var hasRequiredFunctionBind;
13074
+ function requireFunctionBind() {
13075
+ if (hasRequiredFunctionBind) return functionBind;
13076
+ hasRequiredFunctionBind = 1;
13077
+ var implementation2 = requireImplementation();
13078
+ functionBind = Function.prototype.bind || implementation2;
13079
+ return functionBind;
13080
+ }
13064
13081
  var functionCall = Function.prototype.call;
13065
13082
  var functionApply;
13066
13083
  var hasRequiredFunctionApply;
@@ -13071,12 +13088,12 @@ function requireFunctionApply() {
13071
13088
  return functionApply;
13072
13089
  }
13073
13090
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
13074
- var bind$2 = functionBind;
13091
+ var bind$2 = requireFunctionBind();
13075
13092
  var $apply$1 = requireFunctionApply();
13076
13093
  var $call$2 = functionCall;
13077
13094
  var $reflectApply = reflectApply;
13078
13095
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
13079
- var bind$1 = functionBind;
13096
+ var bind$1 = requireFunctionBind();
13080
13097
  var $TypeError$4 = type;
13081
13098
  var $call$1 = functionCall;
13082
13099
  var $actualApply = actualApply;
@@ -13144,8 +13161,8 @@ function requireHasown() {
13144
13161
  hasRequiredHasown = 1;
13145
13162
  var call = Function.prototype.call;
13146
13163
  var $hasOwn = Object.prototype.hasOwnProperty;
13147
- var bind3 = functionBind;
13148
- hasown = bind3.call(call, $hasOwn);
13164
+ var bind2 = requireFunctionBind();
13165
+ hasown = bind2.call(call, $hasOwn);
13149
13166
  return hasown;
13150
13167
  }
13151
13168
  var undefined$1;
@@ -13159,7 +13176,7 @@ var $TypeError$3 = type;
13159
13176
  var $URIError = uri;
13160
13177
  var abs = abs$1;
13161
13178
  var floor = floor$1;
13162
- var max = max$2;
13179
+ var max = max$1;
13163
13180
  var min = min$1;
13164
13181
  var pow = pow$1;
13165
13182
  var round$1 = round$2;
@@ -13364,13 +13381,13 @@ var LEGACY_ALIASES = {
13364
13381
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
13365
13382
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
13366
13383
  };
13367
- var bind2 = functionBind;
13384
+ var bind = requireFunctionBind();
13368
13385
  var hasOwn = requireHasown();
13369
- var $concat = bind2.call($call, Array.prototype.concat);
13370
- var $spliceApply = bind2.call($apply, Array.prototype.splice);
13371
- var $replace = bind2.call($call, String.prototype.replace);
13372
- var $strSlice = bind2.call($call, String.prototype.slice);
13373
- var $exec = bind2.call($call, RegExp.prototype.exec);
13386
+ var $concat = bind.call($call, Array.prototype.concat);
13387
+ var $spliceApply = bind.call($apply, Array.prototype.splice);
13388
+ var $replace = bind.call($call, String.prototype.replace);
13389
+ var $strSlice = bind.call($call, String.prototype.slice);
13390
+ var $exec = bind.call($call, RegExp.prototype.exec);
13374
13391
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
13375
13392
  var reEscapeChar = /\\(\\)?/g;
13376
13393
  var stringToPath = function stringToPath2(string2) {
@@ -28877,7 +28894,7 @@ const questions = {
28877
28894
  lead_type: "request type",
28878
28895
  min_order_number: "Number of people",
28879
28896
  budget: "budget",
28880
- budgetProPerson: "Budget pro Person",
28897
+ budgetProPerson: "Budget per Person",
28881
28898
  totalBudget: "Total Budget",
28882
28899
  services: "services"
28883
28900
  };
@@ -29770,7 +29787,8 @@ const getFallbackForLocale = (locale2) => {
29770
29787
  return locale2;
29771
29788
  };
29772
29789
  const i18nextInit = (config2 = {}) => {
29773
- const locale2 = config2.locale || "de";
29790
+ const rawLocale = config2.locale || "de";
29791
+ const locale2 = getFallbackForLocale(rawLocale);
29774
29792
  const locales = config2.locales || LOCALES;
29775
29793
  if (!i18next.isInitialized) {
29776
29794
  i18next.use(initReactI18next).init({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycater/qualification-funnel",
3
- "version": "1.19.13",
3
+ "version": "1.19.15",
4
4
  "type": "module",
5
5
  "description": "Heycater embedded qualification funnel widget",
6
6
  "main": "dist/index.cjs.js",