@heycater/qualification-funnel 1.19.11 → 1.19.13

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,7 +4273,8 @@ const useIsGb = () => {
4273
4273
  };
4274
4274
  const getIsGb = (query) => {
4275
4275
  if (typeof window !== "undefined") {
4276
- if (window.location.pathname.toLowerCase().includes("london")) {
4276
+ const pathname = window.location.pathname.toLowerCase();
4277
+ if (pathname.includes("en-uk") || pathname.includes("london")) {
4277
4278
  return true;
4278
4279
  }
4279
4280
  }
@@ -10214,6 +10215,20 @@ function trackStarted(context, initialStepId) {
10214
10215
  initial_step: initialStepId
10215
10216
  };
10216
10217
  captureEvent("qf_v14_started", properties);
10218
+ trackOptimeleonConversion("funnel_started");
10219
+ }
10220
+ function trackOptimeleonConversion(eventName, serviceType) {
10221
+ if (typeof window === "undefined") return;
10222
+ if (window.optimeleon) {
10223
+ try {
10224
+ window.optimeleon("track", eventName);
10225
+ if (serviceType) {
10226
+ window.optimeleon("track", `${eventName}_${serviceType}`);
10227
+ }
10228
+ } catch (error) {
10229
+ console.error("[Optimeleon] Failed to track conversion:", error);
10230
+ }
10231
+ }
10217
10232
  }
10218
10233
  function serializeAnswerValue(value) {
10219
10234
  if (value === void 0) return null;
@@ -12458,7 +12473,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
12458
12473
  var ys = arrObjKeys(obj, inspect2);
12459
12474
  var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
12460
12475
  var protoTag = obj instanceof Object ? "" : "null prototype";
12461
- var stringTag2 = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
12476
+ var stringTag2 = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
12462
12477
  var constructorTag = isPlainObject2 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
12463
12478
  var tag = constructorTag + (stringTag2 || protoTag ? "[" + $join.call($concat$1.call([], stringTag2 || [], protoTag || []), ": ") + "] " : "");
12464
12479
  if (ys.length === 0) {
@@ -12483,25 +12498,25 @@ function canTrustToString(obj) {
12483
12498
  return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
12484
12499
  }
12485
12500
  function isArray$3(obj) {
12486
- return toStr(obj) === "[object Array]" && canTrustToString(obj);
12501
+ return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
12487
12502
  }
12488
12503
  function isDate(obj) {
12489
- return toStr(obj) === "[object Date]" && canTrustToString(obj);
12504
+ return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
12490
12505
  }
12491
12506
  function isRegExp$1(obj) {
12492
- return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
12507
+ return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
12493
12508
  }
12494
12509
  function isError(obj) {
12495
- return toStr(obj) === "[object Error]" && canTrustToString(obj);
12510
+ return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
12496
12511
  }
12497
12512
  function isString(obj) {
12498
- return toStr(obj) === "[object String]" && canTrustToString(obj);
12513
+ return toStr$1(obj) === "[object String]" && canTrustToString(obj);
12499
12514
  }
12500
12515
  function isNumber(obj) {
12501
- return toStr(obj) === "[object Number]" && canTrustToString(obj);
12516
+ return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
12502
12517
  }
12503
12518
  function isBoolean(obj) {
12504
- return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
12519
+ return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
12505
12520
  }
12506
12521
  function isSymbol(obj) {
12507
12522
  if (hasShammedSymbols) {
@@ -12537,7 +12552,7 @@ var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
12537
12552
  function has$4(obj, key) {
12538
12553
  return hasOwn$1.call(obj, key);
12539
12554
  }
12540
- function toStr(obj) {
12555
+ function toStr$1(obj) {
12541
12556
  return objectToString.call(obj);
12542
12557
  }
12543
12558
  function nameOf(f) {
@@ -12846,7 +12861,7 @@ var syntax = SyntaxError;
12846
12861
  var uri = URIError;
12847
12862
  var abs$1 = Math.abs;
12848
12863
  var floor$1 = Math.floor;
12849
- var max$1 = Math.max;
12864
+ var max$2 = Math.max;
12850
12865
  var min$1 = Math.min;
12851
12866
  var pow$1 = Math.pow;
12852
12867
  var round$2 = Math.round;
@@ -12975,99 +12990,78 @@ function requireObject_getPrototypeOf() {
12975
12990
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
12976
12991
  return Object_getPrototypeOf;
12977
12992
  }
12978
- var implementation;
12979
- var hasRequiredImplementation;
12980
- function requireImplementation() {
12981
- if (hasRequiredImplementation) return implementation;
12982
- hasRequiredImplementation = 1;
12983
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
12984
- var toStr2 = Object.prototype.toString;
12985
- var max2 = Math.max;
12986
- var funcType = "[object Function]";
12987
- var concatty = function concatty2(a3, b2) {
12988
- var arr = [];
12989
- for (var i2 = 0; i2 < a3.length; i2 += 1) {
12990
- arr[i2] = a3[i2];
12991
- }
12992
- for (var j = 0; j < b2.length; j += 1) {
12993
- arr[j + a3.length] = b2[j];
12994
- }
12995
- return arr;
12996
- };
12997
- var slicy = function slicy2(arrLike, offset2) {
12998
- var arr = [];
12999
- for (var i2 = offset2, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
13000
- arr[j] = arrLike[i2];
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;
13001
13020
  }
13002
- return arr;
13003
- };
13004
- var joiny = function(arr, joiner) {
13005
- var str = "";
13006
- for (var i2 = 0; i2 < arr.length; i2 += 1) {
13007
- str += arr[i2];
13008
- if (i2 + 1 < arr.length) {
13009
- str += joiner;
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
13039
  }
13040
+ return this;
13011
13041
  }
13012
- return str;
13042
+ return target.apply(
13043
+ that,
13044
+ concatty(args, arguments)
13045
+ );
13013
13046
  };
13014
- implementation = function bind2(that) {
13015
- var target = this;
13016
- if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
13017
- throw new TypeError(ERROR_MESSAGE + target);
13018
- }
13019
- var args = slicy(arguments, 1);
13020
- var bound;
13021
- var binder = function() {
13022
- if (this instanceof bound) {
13023
- var result = target.apply(
13024
- this,
13025
- concatty(args, arguments)
13026
- );
13027
- if (Object(result) === result) {
13028
- return result;
13029
- }
13030
- return this;
13031
- }
13032
- return target.apply(
13033
- that,
13034
- concatty(args, arguments)
13035
- );
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() {
13036
13055
  };
13037
- var boundLength = max2(0, target.length - args.length);
13038
- var boundArgs = [];
13039
- for (var i2 = 0; i2 < boundLength; i2++) {
13040
- boundArgs[i2] = "$" + i2;
13041
- }
13042
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
13043
- if (target.prototype) {
13044
- var Empty = function Empty2() {
13045
- };
13046
- Empty.prototype = target.prototype;
13047
- bound.prototype = new Empty();
13048
- Empty.prototype = null;
13049
- }
13050
- return bound;
13051
- };
13052
- return implementation;
13053
- }
13054
- var functionBind;
13055
- var hasRequiredFunctionBind;
13056
- function requireFunctionBind() {
13057
- if (hasRequiredFunctionBind) return functionBind;
13058
- hasRequiredFunctionBind = 1;
13059
- var implementation2 = requireImplementation();
13060
- functionBind = Function.prototype.bind || implementation2;
13061
- return functionBind;
13062
- }
13063
- var functionCall;
13064
- var hasRequiredFunctionCall;
13065
- function requireFunctionCall() {
13066
- if (hasRequiredFunctionCall) return functionCall;
13067
- hasRequiredFunctionCall = 1;
13068
- functionCall = Function.prototype.call;
13069
- return functionCall;
13070
- }
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;
13064
+ var functionCall = Function.prototype.call;
13071
13065
  var functionApply;
13072
13066
  var hasRequiredFunctionApply;
13073
13067
  function requireFunctionApply() {
@@ -13077,14 +13071,14 @@ function requireFunctionApply() {
13077
13071
  return functionApply;
13078
13072
  }
13079
13073
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
13080
- var bind$2 = requireFunctionBind();
13074
+ var bind$2 = functionBind;
13081
13075
  var $apply$1 = requireFunctionApply();
13082
- var $call$2 = requireFunctionCall();
13076
+ var $call$2 = functionCall;
13083
13077
  var $reflectApply = reflectApply;
13084
13078
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
13085
- var bind$1 = requireFunctionBind();
13079
+ var bind$1 = functionBind;
13086
13080
  var $TypeError$4 = type;
13087
- var $call$1 = requireFunctionCall();
13081
+ var $call$1 = functionCall;
13088
13082
  var $actualApply = actualApply;
13089
13083
  var callBindApplyHelpers = function callBindBasic(args) {
13090
13084
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -13150,8 +13144,8 @@ function requireHasown() {
13150
13144
  hasRequiredHasown = 1;
13151
13145
  var call = Function.prototype.call;
13152
13146
  var $hasOwn = Object.prototype.hasOwnProperty;
13153
- var bind2 = requireFunctionBind();
13154
- hasown = bind2.call(call, $hasOwn);
13147
+ var bind3 = functionBind;
13148
+ hasown = bind3.call(call, $hasOwn);
13155
13149
  return hasown;
13156
13150
  }
13157
13151
  var undefined$1;
@@ -13165,7 +13159,7 @@ var $TypeError$3 = type;
13165
13159
  var $URIError = uri;
13166
13160
  var abs = abs$1;
13167
13161
  var floor = floor$1;
13168
- var max = max$1;
13162
+ var max = max$2;
13169
13163
  var min = min$1;
13170
13164
  var pow = pow$1;
13171
13165
  var round$1 = round$2;
@@ -13199,7 +13193,7 @@ var getProto = requireGetProto();
13199
13193
  var $ObjectGPO = requireObject_getPrototypeOf();
13200
13194
  var $ReflectGPO = requireReflect_getPrototypeOf();
13201
13195
  var $apply = requireFunctionApply();
13202
- var $call = requireFunctionCall();
13196
+ var $call = functionCall;
13203
13197
  var needsEval = {};
13204
13198
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
13205
13199
  var INTRINSICS = {
@@ -13370,13 +13364,13 @@ var LEGACY_ALIASES = {
13370
13364
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
13371
13365
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
13372
13366
  };
13373
- var bind = requireFunctionBind();
13367
+ var bind2 = functionBind;
13374
13368
  var hasOwn = requireHasown();
13375
- var $concat = bind.call($call, Array.prototype.concat);
13376
- var $spliceApply = bind.call($apply, Array.prototype.splice);
13377
- var $replace = bind.call($call, String.prototype.replace);
13378
- var $strSlice = bind.call($call, String.prototype.slice);
13379
- var $exec = bind.call($call, RegExp.prototype.exec);
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);
13380
13374
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
13381
13375
  var reEscapeChar = /\\(\\)?/g;
13382
13376
  var stringToPath = function stringToPath2(string2) {
@@ -26865,6 +26859,7 @@ function RequestForm({ header = null }) {
26865
26859
  var _a3;
26866
26860
  handleDisableCTA(true);
26867
26861
  const serviceType = (_a3 = qualification == null ? void 0 : qualification.answers) == null ? void 0 : _a3.service_type;
26862
+ trackOptimeleonConversion("funnel_form_submitted", serviceType);
26868
26863
  const isLeadOnlyFunnel = serviceType === "regular_employee_catering" || serviceType === "full_service_event";
26869
26864
  const { deliveryAddressCountry: deliveryAddressCountry2 } = values2;
26870
26865
  const isUkLead = ["United Kingdom", "Great Britain", "UK"].includes(
@@ -26878,6 +26873,7 @@ function RequestForm({ header = null }) {
26878
26873
  setShowLeadSuccess(true);
26879
26874
  trackFormSubmitted(funnelContextRef.current, { is_uk_lead: isUkLead });
26880
26875
  trackCompleted(funnelContextRef.current);
26876
+ trackOptimeleonConversion("funnel_completed", serviceType);
26881
26877
  return;
26882
26878
  } else {
26883
26879
  console.error("[HeyCater Funnel] Lead submission failed. Result:", response);
@@ -26920,6 +26916,7 @@ function RequestForm({ header = null }) {
26920
26916
  is_logged_in: !!currentUserAccount
26921
26917
  });
26922
26918
  trackCompleted(funnelContextRef.current);
26919
+ trackOptimeleonConversion("funnel_completed", serviceType);
26923
26920
  actions.setRequest(values2);
26924
26921
  redirectToCustomerAccountRequest(redirectRoute);
26925
26922
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycater/qualification-funnel",
3
- "version": "1.19.11",
3
+ "version": "1.19.13",
4
4
  "type": "module",
5
5
  "description": "Heycater embedded qualification funnel widget",
6
6
  "main": "dist/index.cjs.js",