@heycater/qualification-funnel 1.19.10 → 1.19.12

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
@@ -4273,11 +4273,7 @@ const useIsGb = () => {
4273
4273
  };
4274
4274
  const getIsGb = (query) => {
4275
4275
  if (typeof window !== "undefined") {
4276
- const pathname = window.location.pathname.toLowerCase();
4277
- if (pathname.includes("london")) {
4278
- return true;
4279
- }
4280
- if (pathname.includes("en-uk")) {
4276
+ if (window.location.pathname.toLowerCase().includes("london")) {
4281
4277
  return true;
4282
4278
  }
4283
4279
  }
@@ -9265,8 +9261,6 @@ function getPillValue({
9265
9261
  answers.price_per_person,
9266
9262
  answers.min_order_number
9267
9263
  ];
9268
- const isGb = getIsGb();
9269
- const currency = getCurrencySymbol(isGb);
9270
9264
  return [
9271
9265
  {
9272
9266
  stepId,
@@ -9278,8 +9272,7 @@ function getPillValue({
9278
9272
  questionId: "price_per_person",
9279
9273
  text: t2("qualification:selection.budget", {
9280
9274
  perPerson: pricePerPerson,
9281
- total: total2,
9282
- currency
9275
+ total: total2
9283
9276
  })
9284
9277
  }
9285
9278
  ];
@@ -9889,14 +9882,9 @@ const localeConfig = {
9889
9882
  };
9890
9883
  const algoliaAttributeNameForLocale = (locale2) => (name) => {
9891
9884
  const toLocalizedAlgoliaKey = (name2) => {
9892
- let parsedLocale;
9893
- if (typeof locale2 === "string" && locale2.startsWith("en")) {
9894
- parsedLocale = "en";
9895
- } else if (localeConfig.locales.includes(locale2)) {
9896
- parsedLocale = locale2;
9897
- } else {
9898
- parsedLocale = localeConfig.defaultLocale;
9899
- }
9885
+ const parsedLocale = localeConfig.locales.includes(
9886
+ locale2
9887
+ ) ? locale2 : localeConfig.defaultLocale;
9900
9888
  return `${name2}_${parsedLocale}`;
9901
9889
  };
9902
9890
  if (name.includes(".")) {
@@ -9906,9 +9894,6 @@ const algoliaAttributeNameForLocale = (locale2) => (name) => {
9906
9894
  return toLocalizedAlgoliaKey(name);
9907
9895
  };
9908
9896
  const attributeNameForLocale = (locale2) => (name) => {
9909
- if (locale2 == null ? void 0 : locale2.startsWith("en")) {
9910
- return `${name}En`;
9911
- }
9912
9897
  if (!localeConfig.locales.includes(locale2))
9913
9898
  return `${name}${capitalize$3(localeConfig.defaultLocale)}`;
9914
9899
  return `${name}${capitalize$3(locale2)}`;
@@ -10229,6 +10214,20 @@ function trackStarted(context, initialStepId) {
10229
10214
  initial_step: initialStepId
10230
10215
  };
10231
10216
  captureEvent("qf_v14_started", properties);
10217
+ trackOptimeleonConversion("funnel_started");
10218
+ }
10219
+ function trackOptimeleonConversion(eventName, serviceType) {
10220
+ if (typeof window === "undefined") return;
10221
+ if (window.optimeleon) {
10222
+ try {
10223
+ window.optimeleon("track", eventName);
10224
+ if (serviceType) {
10225
+ window.optimeleon("track", `${eventName}_${serviceType}`);
10226
+ }
10227
+ } catch (error) {
10228
+ console.error("[Optimeleon] Failed to track conversion:", error);
10229
+ }
10230
+ }
10232
10231
  }
10233
10232
  function serializeAnswerValue(value) {
10234
10233
  if (value === void 0) return null;
@@ -10860,7 +10859,7 @@ const SwitchesWrapper = styled.div`
10860
10859
  `;
10861
10860
  const defaultLeadTimeInDays = DEFAULT_LEAD_DAYS;
10862
10861
  function DatePickerEmbedded() {
10863
- var _a2, _b, _c;
10862
+ var _a2, _b;
10864
10863
  const router = useRouter();
10865
10864
  const { answerOf, actions, state } = useQualification();
10866
10865
  const { trackAnswer } = useTracking();
@@ -10874,7 +10873,7 @@ function DatePickerEmbedded() {
10874
10873
  answers: state.qualification.answers,
10875
10874
  selectedCaterer: state.qualification.selectedCaterer
10876
10875
  }) : null;
10877
- 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;
10876
+ 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;
10878
10877
  const [isRecurringNeedSelected] = useState(
10879
10878
  !!answerOf(isRecurringQuestion.id)
10880
10879
  );
@@ -11880,7 +11879,7 @@ const EmbeddedQuestion = ({
11880
11879
  content: /* @__PURE__ */ jsx(Container, { size: MAX_WIDTH_OF_WHITE_WRAPPER, children: /* @__PURE__ */ jsx(WhiteWrapper, { children: /* @__PURE__ */ jsx(Box, { py: 4, children: /* @__PURE__ */ jsx(
11881
11880
  TeamSizeInput,
11882
11881
  {
11883
- label: t2("qualification:embeddedFunnel.teamSize.label", (_e = teamSizeQuestion.content) == null ? void 0 : _e.titleEn),
11882
+ label: t2("qualification:embeddedFunnel.teamSize.label", (_e = teamSizeQuestion.content) == null ? void 0 : _e.titleDe),
11884
11883
  questionId: teamSizeQuestion.id,
11885
11884
  value: answerOf("team_size"),
11886
11885
  onChange: (value) => actions.answerQuestion("team_size", value),
@@ -12473,7 +12472,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
12473
12472
  var ys = arrObjKeys(obj, inspect2);
12474
12473
  var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
12475
12474
  var protoTag = obj instanceof Object ? "" : "null prototype";
12476
- var stringTag2 = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
12475
+ var stringTag2 = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
12477
12476
  var constructorTag = isPlainObject2 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
12478
12477
  var tag = constructorTag + (stringTag2 || protoTag ? "[" + $join.call($concat$1.call([], stringTag2 || [], protoTag || []), ": ") + "] " : "");
12479
12478
  if (ys.length === 0) {
@@ -12498,25 +12497,25 @@ function canTrustToString(obj) {
12498
12497
  return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
12499
12498
  }
12500
12499
  function isArray$3(obj) {
12501
- return toStr(obj) === "[object Array]" && canTrustToString(obj);
12500
+ return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
12502
12501
  }
12503
12502
  function isDate(obj) {
12504
- return toStr(obj) === "[object Date]" && canTrustToString(obj);
12503
+ return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
12505
12504
  }
12506
12505
  function isRegExp$1(obj) {
12507
- return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
12506
+ return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
12508
12507
  }
12509
12508
  function isError(obj) {
12510
- return toStr(obj) === "[object Error]" && canTrustToString(obj);
12509
+ return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
12511
12510
  }
12512
12511
  function isString(obj) {
12513
- return toStr(obj) === "[object String]" && canTrustToString(obj);
12512
+ return toStr$1(obj) === "[object String]" && canTrustToString(obj);
12514
12513
  }
12515
12514
  function isNumber(obj) {
12516
- return toStr(obj) === "[object Number]" && canTrustToString(obj);
12515
+ return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
12517
12516
  }
12518
12517
  function isBoolean(obj) {
12519
- return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
12518
+ return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
12520
12519
  }
12521
12520
  function isSymbol(obj) {
12522
12521
  if (hasShammedSymbols) {
@@ -12552,7 +12551,7 @@ var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
12552
12551
  function has$4(obj, key) {
12553
12552
  return hasOwn$1.call(obj, key);
12554
12553
  }
12555
- function toStr(obj) {
12554
+ function toStr$1(obj) {
12556
12555
  return objectToString.call(obj);
12557
12556
  }
12558
12557
  function nameOf(f) {
@@ -12861,7 +12860,7 @@ var syntax = SyntaxError;
12861
12860
  var uri = URIError;
12862
12861
  var abs$1 = Math.abs;
12863
12862
  var floor$1 = Math.floor;
12864
- var max$1 = Math.max;
12863
+ var max$2 = Math.max;
12865
12864
  var min$1 = Math.min;
12866
12865
  var pow$1 = Math.pow;
12867
12866
  var round$2 = Math.round;
@@ -12990,99 +12989,78 @@ function requireObject_getPrototypeOf() {
12990
12989
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
12991
12990
  return Object_getPrototypeOf;
12992
12991
  }
12993
- var implementation;
12994
- var hasRequiredImplementation;
12995
- function requireImplementation() {
12996
- if (hasRequiredImplementation) return implementation;
12997
- hasRequiredImplementation = 1;
12998
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
12999
- var toStr2 = Object.prototype.toString;
13000
- var max2 = Math.max;
13001
- var funcType = "[object Function]";
13002
- var concatty = function concatty2(a3, b2) {
13003
- var arr = [];
13004
- for (var i2 = 0; i2 < a3.length; i2 += 1) {
13005
- arr[i2] = a3[i2];
13006
- }
13007
- for (var j = 0; j < b2.length; j += 1) {
13008
- arr[j + a3.length] = b2[j];
13009
- }
13010
- return arr;
13011
- };
13012
- var slicy = function slicy2(arrLike, offset2) {
13013
- var arr = [];
13014
- for (var i2 = offset2, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
13015
- arr[j] = arrLike[i2];
12992
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
12993
+ var toStr = Object.prototype.toString;
12994
+ var max$1 = Math.max;
12995
+ var funcType = "[object Function]";
12996
+ var concatty = function concatty2(a3, b2) {
12997
+ var arr = [];
12998
+ for (var i2 = 0; i2 < a3.length; i2 += 1) {
12999
+ arr[i2] = a3[i2];
13000
+ }
13001
+ for (var j = 0; j < b2.length; j += 1) {
13002
+ arr[j + a3.length] = b2[j];
13003
+ }
13004
+ return arr;
13005
+ };
13006
+ var slicy = function slicy2(arrLike, offset2) {
13007
+ var arr = [];
13008
+ for (var i2 = offset2, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
13009
+ arr[j] = arrLike[i2];
13010
+ }
13011
+ return arr;
13012
+ };
13013
+ var joiny = function(arr, joiner) {
13014
+ var str = "";
13015
+ for (var i2 = 0; i2 < arr.length; i2 += 1) {
13016
+ str += arr[i2];
13017
+ if (i2 + 1 < arr.length) {
13018
+ str += joiner;
13016
13019
  }
13017
- return arr;
13018
- };
13019
- var joiny = function(arr, joiner) {
13020
- var str = "";
13021
- for (var i2 = 0; i2 < arr.length; i2 += 1) {
13022
- str += arr[i2];
13023
- if (i2 + 1 < arr.length) {
13024
- str += joiner;
13020
+ }
13021
+ return str;
13022
+ };
13023
+ var implementation$1 = function bind(that) {
13024
+ var target = this;
13025
+ if (typeof target !== "function" || toStr.apply(target) !== funcType) {
13026
+ throw new TypeError(ERROR_MESSAGE + target);
13027
+ }
13028
+ var args = slicy(arguments, 1);
13029
+ var bound;
13030
+ var binder = function() {
13031
+ if (this instanceof bound) {
13032
+ var result = target.apply(
13033
+ this,
13034
+ concatty(args, arguments)
13035
+ );
13036
+ if (Object(result) === result) {
13037
+ return result;
13025
13038
  }
13039
+ return this;
13026
13040
  }
13027
- return str;
13041
+ return target.apply(
13042
+ that,
13043
+ concatty(args, arguments)
13044
+ );
13028
13045
  };
13029
- implementation = function bind2(that) {
13030
- var target = this;
13031
- if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
13032
- throw new TypeError(ERROR_MESSAGE + target);
13033
- }
13034
- var args = slicy(arguments, 1);
13035
- var bound;
13036
- var binder = function() {
13037
- if (this instanceof bound) {
13038
- var result = target.apply(
13039
- this,
13040
- concatty(args, arguments)
13041
- );
13042
- if (Object(result) === result) {
13043
- return result;
13044
- }
13045
- return this;
13046
- }
13047
- return target.apply(
13048
- that,
13049
- concatty(args, arguments)
13050
- );
13046
+ var boundLength = max$1(0, target.length - args.length);
13047
+ var boundArgs = [];
13048
+ for (var i2 = 0; i2 < boundLength; i2++) {
13049
+ boundArgs[i2] = "$" + i2;
13050
+ }
13051
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
13052
+ if (target.prototype) {
13053
+ var Empty = function Empty2() {
13051
13054
  };
13052
- var boundLength = max2(0, target.length - args.length);
13053
- var boundArgs = [];
13054
- for (var i2 = 0; i2 < boundLength; i2++) {
13055
- boundArgs[i2] = "$" + i2;
13056
- }
13057
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
13058
- if (target.prototype) {
13059
- var Empty = function Empty2() {
13060
- };
13061
- Empty.prototype = target.prototype;
13062
- bound.prototype = new Empty();
13063
- Empty.prototype = null;
13064
- }
13065
- return bound;
13066
- };
13067
- return implementation;
13068
- }
13069
- var functionBind;
13070
- var hasRequiredFunctionBind;
13071
- function requireFunctionBind() {
13072
- if (hasRequiredFunctionBind) return functionBind;
13073
- hasRequiredFunctionBind = 1;
13074
- var implementation2 = requireImplementation();
13075
- functionBind = Function.prototype.bind || implementation2;
13076
- return functionBind;
13077
- }
13078
- var functionCall;
13079
- var hasRequiredFunctionCall;
13080
- function requireFunctionCall() {
13081
- if (hasRequiredFunctionCall) return functionCall;
13082
- hasRequiredFunctionCall = 1;
13083
- functionCall = Function.prototype.call;
13084
- return functionCall;
13085
- }
13055
+ Empty.prototype = target.prototype;
13056
+ bound.prototype = new Empty();
13057
+ Empty.prototype = null;
13058
+ }
13059
+ return bound;
13060
+ };
13061
+ var implementation = implementation$1;
13062
+ var functionBind = Function.prototype.bind || implementation;
13063
+ var functionCall = Function.prototype.call;
13086
13064
  var functionApply;
13087
13065
  var hasRequiredFunctionApply;
13088
13066
  function requireFunctionApply() {
@@ -13092,14 +13070,14 @@ function requireFunctionApply() {
13092
13070
  return functionApply;
13093
13071
  }
13094
13072
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
13095
- var bind$2 = requireFunctionBind();
13073
+ var bind$2 = functionBind;
13096
13074
  var $apply$1 = requireFunctionApply();
13097
- var $call$2 = requireFunctionCall();
13075
+ var $call$2 = functionCall;
13098
13076
  var $reflectApply = reflectApply;
13099
13077
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
13100
- var bind$1 = requireFunctionBind();
13078
+ var bind$1 = functionBind;
13101
13079
  var $TypeError$4 = type;
13102
- var $call$1 = requireFunctionCall();
13080
+ var $call$1 = functionCall;
13103
13081
  var $actualApply = actualApply;
13104
13082
  var callBindApplyHelpers = function callBindBasic(args) {
13105
13083
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -13165,8 +13143,8 @@ function requireHasown() {
13165
13143
  hasRequiredHasown = 1;
13166
13144
  var call = Function.prototype.call;
13167
13145
  var $hasOwn = Object.prototype.hasOwnProperty;
13168
- var bind2 = requireFunctionBind();
13169
- hasown = bind2.call(call, $hasOwn);
13146
+ var bind3 = functionBind;
13147
+ hasown = bind3.call(call, $hasOwn);
13170
13148
  return hasown;
13171
13149
  }
13172
13150
  var undefined$1;
@@ -13180,7 +13158,7 @@ var $TypeError$3 = type;
13180
13158
  var $URIError = uri;
13181
13159
  var abs = abs$1;
13182
13160
  var floor = floor$1;
13183
- var max = max$1;
13161
+ var max = max$2;
13184
13162
  var min = min$1;
13185
13163
  var pow = pow$1;
13186
13164
  var round$1 = round$2;
@@ -13214,7 +13192,7 @@ var getProto = requireGetProto();
13214
13192
  var $ObjectGPO = requireObject_getPrototypeOf();
13215
13193
  var $ReflectGPO = requireReflect_getPrototypeOf();
13216
13194
  var $apply = requireFunctionApply();
13217
- var $call = requireFunctionCall();
13195
+ var $call = functionCall;
13218
13196
  var needsEval = {};
13219
13197
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
13220
13198
  var INTRINSICS = {
@@ -13385,13 +13363,13 @@ var LEGACY_ALIASES = {
13385
13363
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
13386
13364
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
13387
13365
  };
13388
- var bind = requireFunctionBind();
13366
+ var bind2 = functionBind;
13389
13367
  var hasOwn = requireHasown();
13390
- var $concat = bind.call($call, Array.prototype.concat);
13391
- var $spliceApply = bind.call($apply, Array.prototype.splice);
13392
- var $replace = bind.call($call, String.prototype.replace);
13393
- var $strSlice = bind.call($call, String.prototype.slice);
13394
- var $exec = bind.call($call, RegExp.prototype.exec);
13368
+ var $concat = bind2.call($call, Array.prototype.concat);
13369
+ var $spliceApply = bind2.call($apply, Array.prototype.splice);
13370
+ var $replace = bind2.call($call, String.prototype.replace);
13371
+ var $strSlice = bind2.call($call, String.prototype.slice);
13372
+ var $exec = bind2.call($call, RegExp.prototype.exec);
13395
13373
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
13396
13374
  var reEscapeChar = /\\(\\)?/g;
13397
13375
  var stringToPath = function stringToPath2(string2) {
@@ -26880,6 +26858,7 @@ function RequestForm({ header = null }) {
26880
26858
  var _a3;
26881
26859
  handleDisableCTA(true);
26882
26860
  const serviceType = (_a3 = qualification == null ? void 0 : qualification.answers) == null ? void 0 : _a3.service_type;
26861
+ trackOptimeleonConversion("funnel_form_submitted", serviceType);
26883
26862
  const isLeadOnlyFunnel = serviceType === "regular_employee_catering" || serviceType === "full_service_event";
26884
26863
  const { deliveryAddressCountry: deliveryAddressCountry2 } = values2;
26885
26864
  const isUkLead = ["United Kingdom", "Great Britain", "UK"].includes(
@@ -26893,6 +26872,7 @@ function RequestForm({ header = null }) {
26893
26872
  setShowLeadSuccess(true);
26894
26873
  trackFormSubmitted(funnelContextRef.current, { is_uk_lead: isUkLead });
26895
26874
  trackCompleted(funnelContextRef.current);
26875
+ trackOptimeleonConversion("funnel_completed", serviceType);
26896
26876
  return;
26897
26877
  } else {
26898
26878
  console.error("[HeyCater Funnel] Lead submission failed. Result:", response);
@@ -26935,6 +26915,7 @@ function RequestForm({ header = null }) {
26935
26915
  is_logged_in: !!currentUserAccount
26936
26916
  });
26937
26917
  trackCompleted(funnelContextRef.current);
26918
+ trackOptimeleonConversion("funnel_completed", serviceType);
26938
26919
  actions.setRequest(values2);
26939
26920
  redirectToCustomerAccountRequest(redirectRoute);
26940
26921
  };
@@ -28432,7 +28413,7 @@ const selection$1 = {
28432
28413
  vegan: "{{ amount }} Veganer",
28433
28414
  vegetarian: "{{ amount }} Vegetarier",
28434
28415
  carnivore: "{{ amount }} Fleischesser",
28435
- budget: "{{ perPerson }}{{currency}} p.P. / {{ total }}{{currency}} Gesamtbudget"
28416
+ budget: "{{ perPerson }} p.P. / {{ total }} Gesamtbudget"
28436
28417
  };
28437
28418
  const diet$1 = {
28438
28419
  pax: "Personenzahl:"
@@ -28895,7 +28876,7 @@ const questions = {
28895
28876
  lead_type: "request type",
28896
28877
  min_order_number: "Number of people",
28897
28878
  budget: "budget",
28898
- budgetProPerson: "Budget per person",
28879
+ budgetProPerson: "Budget pro Person",
28899
28880
  totalBudget: "Total Budget",
28900
28881
  services: "services"
28901
28882
  };
@@ -29624,7 +29605,7 @@ const selection = {
29624
29605
  vegan: "{{ amount }} Vegans",
29625
29606
  vegetarian: "{{ amount }} Vegetarians",
29626
29607
  carnivore: "{{ amount }} Carnivores",
29627
- budget: "{{currency}}{{ perPerson }} pp / {{currency}}{{ total }} Total Budget"
29608
+ budget: "{{ perPerson }} p.P. / {{ total }} Total Budget"
29628
29609
  };
29629
29610
  const diet = {
29630
29611
  pax: "Number of people:"
@@ -30723,6 +30704,7 @@ function QualificationFunnel({
30723
30704
  }) {
30724
30705
  const [ratings, setRatings] = useState(null);
30725
30706
  const [initialized, setInitialized] = useState(false);
30707
+ const [isGb, setIsGb] = useState(() => getIsGb());
30726
30708
  useEffect(() => {
30727
30709
  setAssetsBaseUrl(assetBaseUrl);
30728
30710
  initConfig({
@@ -30732,6 +30714,27 @@ function QualificationFunnel({
30732
30714
  });
30733
30715
  setInitialized(true);
30734
30716
  }, [apiEndpoint, googleMapsApiKey, locale2, assetBaseUrl]);
30717
+ useEffect(() => {
30718
+ const handleUrlChange = () => {
30719
+ setIsGb(getIsGb());
30720
+ };
30721
+ window.addEventListener("popstate", handleUrlChange);
30722
+ const originalPushState = history.pushState.bind(history);
30723
+ const originalReplaceState = history.replaceState.bind(history);
30724
+ history.pushState = (...args) => {
30725
+ originalPushState(...args);
30726
+ handleUrlChange();
30727
+ };
30728
+ history.replaceState = (...args) => {
30729
+ originalReplaceState(...args);
30730
+ handleUrlChange();
30731
+ };
30732
+ return () => {
30733
+ window.removeEventListener("popstate", handleUrlChange);
30734
+ history.pushState = originalPushState;
30735
+ history.replaceState = originalReplaceState;
30736
+ };
30737
+ }, []);
30735
30738
  useEffect(() => {
30736
30739
  if (initialized) {
30737
30740
  fetchRatings().then(setRatings).catch(console.error);
@@ -30749,7 +30752,7 @@ function QualificationFunnel({
30749
30752
  QualificationProvider,
30750
30753
  {
30751
30754
  initialized: true,
30752
- storageKey,
30755
+ storageKey: isGb ? `${storageKey}-gb` : storageKey,
30753
30756
  storage: "sessionStorage",
30754
30757
  children: /* @__PURE__ */ jsx(
30755
30758
  EmbeddedFunnel,
@@ -30761,7 +30764,8 @@ function QualificationFunnel({
30761
30764
  onCancel
30762
30765
  }
30763
30766
  )
30764
- }
30767
+ },
30768
+ isGb ? "gb" : "de"
30765
30769
  )
30766
30770
  ] }) }) }) }) }) });
30767
30771
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycater/qualification-funnel",
3
- "version": "1.19.10",
3
+ "version": "1.19.12",
4
4
  "type": "module",
5
5
  "description": "Heycater embedded qualification funnel widget",
6
6
  "main": "dist/index.cjs.js",