@heycater/qualification-funnel 1.4.12 → 1.4.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
@@ -11142,6 +11142,7 @@ function TrackingProvider({
11142
11142
  const serviceType = value;
11143
11143
  if (serviceType) {
11144
11144
  const stepOrder = getStepOrderForServiceType(serviceType);
11145
+ delete funnelContextRef.current.city;
11145
11146
  updateContext({
11146
11147
  service_type: serviceType,
11147
11148
  total_steps: stepOrder.length
@@ -12270,7 +12271,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
12270
12271
  var ys = arrObjKeys(obj, inspect2);
12271
12272
  var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
12272
12273
  var protoTag = obj instanceof Object ? "" : "null prototype";
12273
- var stringTag2 = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
12274
+ var stringTag2 = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
12274
12275
  var constructorTag = isPlainObject2 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
12275
12276
  var tag = constructorTag + (stringTag2 || protoTag ? "[" + $join.call($concat$1.call([], stringTag2 || [], protoTag || []), ": ") + "] " : "");
12276
12277
  if (ys.length === 0) {
@@ -12295,25 +12296,25 @@ function canTrustToString(obj) {
12295
12296
  return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
12296
12297
  }
12297
12298
  function isArray$3(obj) {
12298
- return toStr(obj) === "[object Array]" && canTrustToString(obj);
12299
+ return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
12299
12300
  }
12300
12301
  function isDate(obj) {
12301
- return toStr(obj) === "[object Date]" && canTrustToString(obj);
12302
+ return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
12302
12303
  }
12303
12304
  function isRegExp$1(obj) {
12304
- return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
12305
+ return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
12305
12306
  }
12306
12307
  function isError(obj) {
12307
- return toStr(obj) === "[object Error]" && canTrustToString(obj);
12308
+ return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
12308
12309
  }
12309
12310
  function isString(obj) {
12310
- return toStr(obj) === "[object String]" && canTrustToString(obj);
12311
+ return toStr$1(obj) === "[object String]" && canTrustToString(obj);
12311
12312
  }
12312
12313
  function isNumber(obj) {
12313
- return toStr(obj) === "[object Number]" && canTrustToString(obj);
12314
+ return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
12314
12315
  }
12315
12316
  function isBoolean(obj) {
12316
- return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
12317
+ return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
12317
12318
  }
12318
12319
  function isSymbol(obj) {
12319
12320
  if (hasShammedSymbols) {
@@ -12349,7 +12350,7 @@ var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
12349
12350
  function has$4(obj, key) {
12350
12351
  return hasOwn$1.call(obj, key);
12351
12352
  }
12352
- function toStr(obj) {
12353
+ function toStr$1(obj) {
12353
12354
  return objectToString.call(obj);
12354
12355
  }
12355
12356
  function nameOf(f) {
@@ -12658,7 +12659,7 @@ var syntax = SyntaxError;
12658
12659
  var uri = URIError;
12659
12660
  var abs$1 = Math.abs;
12660
12661
  var floor$1 = Math.floor;
12661
- var max$1 = Math.max;
12662
+ var max$2 = Math.max;
12662
12663
  var min$1 = Math.min;
12663
12664
  var pow$1 = Math.pow;
12664
12665
  var round$2 = Math.round;
@@ -12787,99 +12788,78 @@ function requireObject_getPrototypeOf() {
12787
12788
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
12788
12789
  return Object_getPrototypeOf;
12789
12790
  }
12790
- var implementation;
12791
- var hasRequiredImplementation;
12792
- function requireImplementation() {
12793
- if (hasRequiredImplementation) return implementation;
12794
- hasRequiredImplementation = 1;
12795
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
12796
- var toStr2 = Object.prototype.toString;
12797
- var max2 = Math.max;
12798
- var funcType = "[object Function]";
12799
- var concatty = function concatty2(a3, b2) {
12800
- var arr = [];
12801
- for (var i2 = 0; i2 < a3.length; i2 += 1) {
12802
- arr[i2] = a3[i2];
12803
- }
12804
- for (var j = 0; j < b2.length; j += 1) {
12805
- arr[j + a3.length] = b2[j];
12806
- }
12807
- return arr;
12808
- };
12809
- var slicy = function slicy2(arrLike, offset2) {
12810
- var arr = [];
12811
- for (var i2 = offset2, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
12812
- arr[j] = arrLike[i2];
12791
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
12792
+ var toStr = Object.prototype.toString;
12793
+ var max$1 = Math.max;
12794
+ var funcType = "[object Function]";
12795
+ var concatty = function concatty2(a3, b2) {
12796
+ var arr = [];
12797
+ for (var i2 = 0; i2 < a3.length; i2 += 1) {
12798
+ arr[i2] = a3[i2];
12799
+ }
12800
+ for (var j = 0; j < b2.length; j += 1) {
12801
+ arr[j + a3.length] = b2[j];
12802
+ }
12803
+ return arr;
12804
+ };
12805
+ var slicy = function slicy2(arrLike, offset2) {
12806
+ var arr = [];
12807
+ for (var i2 = offset2, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
12808
+ arr[j] = arrLike[i2];
12809
+ }
12810
+ return arr;
12811
+ };
12812
+ var joiny = function(arr, joiner) {
12813
+ var str = "";
12814
+ for (var i2 = 0; i2 < arr.length; i2 += 1) {
12815
+ str += arr[i2];
12816
+ if (i2 + 1 < arr.length) {
12817
+ str += joiner;
12813
12818
  }
12814
- return arr;
12815
- };
12816
- var joiny = function(arr, joiner) {
12817
- var str = "";
12818
- for (var i2 = 0; i2 < arr.length; i2 += 1) {
12819
- str += arr[i2];
12820
- if (i2 + 1 < arr.length) {
12821
- str += joiner;
12819
+ }
12820
+ return str;
12821
+ };
12822
+ var implementation$1 = function bind(that) {
12823
+ var target = this;
12824
+ if (typeof target !== "function" || toStr.apply(target) !== funcType) {
12825
+ throw new TypeError(ERROR_MESSAGE + target);
12826
+ }
12827
+ var args = slicy(arguments, 1);
12828
+ var bound;
12829
+ var binder = function() {
12830
+ if (this instanceof bound) {
12831
+ var result = target.apply(
12832
+ this,
12833
+ concatty(args, arguments)
12834
+ );
12835
+ if (Object(result) === result) {
12836
+ return result;
12822
12837
  }
12838
+ return this;
12823
12839
  }
12824
- return str;
12840
+ return target.apply(
12841
+ that,
12842
+ concatty(args, arguments)
12843
+ );
12825
12844
  };
12826
- implementation = function bind2(that) {
12827
- var target = this;
12828
- if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
12829
- throw new TypeError(ERROR_MESSAGE + target);
12830
- }
12831
- var args = slicy(arguments, 1);
12832
- var bound;
12833
- var binder = function() {
12834
- if (this instanceof bound) {
12835
- var result = target.apply(
12836
- this,
12837
- concatty(args, arguments)
12838
- );
12839
- if (Object(result) === result) {
12840
- return result;
12841
- }
12842
- return this;
12843
- }
12844
- return target.apply(
12845
- that,
12846
- concatty(args, arguments)
12847
- );
12845
+ var boundLength = max$1(0, target.length - args.length);
12846
+ var boundArgs = [];
12847
+ for (var i2 = 0; i2 < boundLength; i2++) {
12848
+ boundArgs[i2] = "$" + i2;
12849
+ }
12850
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
12851
+ if (target.prototype) {
12852
+ var Empty = function Empty2() {
12848
12853
  };
12849
- var boundLength = max2(0, target.length - args.length);
12850
- var boundArgs = [];
12851
- for (var i2 = 0; i2 < boundLength; i2++) {
12852
- boundArgs[i2] = "$" + i2;
12853
- }
12854
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
12855
- if (target.prototype) {
12856
- var Empty = function Empty2() {
12857
- };
12858
- Empty.prototype = target.prototype;
12859
- bound.prototype = new Empty();
12860
- Empty.prototype = null;
12861
- }
12862
- return bound;
12863
- };
12864
- return implementation;
12865
- }
12866
- var functionBind;
12867
- var hasRequiredFunctionBind;
12868
- function requireFunctionBind() {
12869
- if (hasRequiredFunctionBind) return functionBind;
12870
- hasRequiredFunctionBind = 1;
12871
- var implementation2 = requireImplementation();
12872
- functionBind = Function.prototype.bind || implementation2;
12873
- return functionBind;
12874
- }
12875
- var functionCall;
12876
- var hasRequiredFunctionCall;
12877
- function requireFunctionCall() {
12878
- if (hasRequiredFunctionCall) return functionCall;
12879
- hasRequiredFunctionCall = 1;
12880
- functionCall = Function.prototype.call;
12881
- return functionCall;
12882
- }
12854
+ Empty.prototype = target.prototype;
12855
+ bound.prototype = new Empty();
12856
+ Empty.prototype = null;
12857
+ }
12858
+ return bound;
12859
+ };
12860
+ var implementation = implementation$1;
12861
+ var functionBind = Function.prototype.bind || implementation;
12862
+ var functionCall = Function.prototype.call;
12883
12863
  var functionApply;
12884
12864
  var hasRequiredFunctionApply;
12885
12865
  function requireFunctionApply() {
@@ -12889,14 +12869,14 @@ function requireFunctionApply() {
12889
12869
  return functionApply;
12890
12870
  }
12891
12871
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
12892
- var bind$2 = requireFunctionBind();
12872
+ var bind$2 = functionBind;
12893
12873
  var $apply$1 = requireFunctionApply();
12894
- var $call$2 = requireFunctionCall();
12874
+ var $call$2 = functionCall;
12895
12875
  var $reflectApply = reflectApply;
12896
12876
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
12897
- var bind$1 = requireFunctionBind();
12877
+ var bind$1 = functionBind;
12898
12878
  var $TypeError$4 = type;
12899
- var $call$1 = requireFunctionCall();
12879
+ var $call$1 = functionCall;
12900
12880
  var $actualApply = actualApply;
12901
12881
  var callBindApplyHelpers = function callBindBasic(args) {
12902
12882
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -12962,8 +12942,8 @@ function requireHasown() {
12962
12942
  hasRequiredHasown = 1;
12963
12943
  var call = Function.prototype.call;
12964
12944
  var $hasOwn = Object.prototype.hasOwnProperty;
12965
- var bind2 = requireFunctionBind();
12966
- hasown = bind2.call(call, $hasOwn);
12945
+ var bind3 = functionBind;
12946
+ hasown = bind3.call(call, $hasOwn);
12967
12947
  return hasown;
12968
12948
  }
12969
12949
  var undefined$1;
@@ -12977,7 +12957,7 @@ var $TypeError$3 = type;
12977
12957
  var $URIError = uri;
12978
12958
  var abs = abs$1;
12979
12959
  var floor = floor$1;
12980
- var max = max$1;
12960
+ var max = max$2;
12981
12961
  var min = min$1;
12982
12962
  var pow = pow$1;
12983
12963
  var round$1 = round$2;
@@ -13011,7 +12991,7 @@ var getProto = requireGetProto();
13011
12991
  var $ObjectGPO = requireObject_getPrototypeOf();
13012
12992
  var $ReflectGPO = requireReflect_getPrototypeOf();
13013
12993
  var $apply = requireFunctionApply();
13014
- var $call = requireFunctionCall();
12994
+ var $call = functionCall;
13015
12995
  var needsEval = {};
13016
12996
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
13017
12997
  var INTRINSICS = {
@@ -13182,13 +13162,13 @@ var LEGACY_ALIASES = {
13182
13162
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
13183
13163
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
13184
13164
  };
13185
- var bind = requireFunctionBind();
13165
+ var bind2 = functionBind;
13186
13166
  var hasOwn = requireHasown();
13187
- var $concat = bind.call($call, Array.prototype.concat);
13188
- var $spliceApply = bind.call($apply, Array.prototype.splice);
13189
- var $replace = bind.call($call, String.prototype.replace);
13190
- var $strSlice = bind.call($call, String.prototype.slice);
13191
- var $exec = bind.call($call, RegExp.prototype.exec);
13167
+ var $concat = bind2.call($call, Array.prototype.concat);
13168
+ var $spliceApply = bind2.call($apply, Array.prototype.splice);
13169
+ var $replace = bind2.call($call, String.prototype.replace);
13170
+ var $strSlice = bind2.call($call, String.prototype.slice);
13171
+ var $exec = bind2.call($call, RegExp.prototype.exec);
13192
13172
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
13193
13173
  var reEscapeChar = /\\(\\)?/g;
13194
13174
  var stringToPath = function stringToPath2(string2) {
@@ -29900,11 +29880,13 @@ const EmbeddedFunnel = React__default.forwardRef(
29900
29880
  } catch (e2) {
29901
29881
  }
29902
29882
  }
29883
+ const shouldRestoreCity = (restoredContext == null ? void 0 : restoredContext.service_type) === serviceType;
29884
+ const cityToUse = city || (shouldRestoreCity ? restoredContext == null ? void 0 : restoredContext.city : void 0);
29903
29885
  updateContext({
29904
29886
  session_id: sessionId,
29905
29887
  total_steps: totalSteps,
29906
29888
  service_type: (restoredContext == null ? void 0 : restoredContext.service_type) || serviceType,
29907
- ...(restoredContext == null ? void 0 : restoredContext.city) || city ? { city: (restoredContext == null ? void 0 : restoredContext.city) || city } : {}
29889
+ ...cityToUse ? { city: cityToUse } : {}
29908
29890
  });
29909
29891
  }, [
29910
29892
  "qualification" in state ? (_a2 = state.qualification.sessionInfo) == null ? void 0 : _a2.sessionId : null,
@@ -29947,7 +29929,15 @@ const EmbeddedFunnel = React__default.forwardRef(
29947
29929
  }
29948
29930
  };
29949
29931
  if (state.status === QUALIFICATION_STATUS.qualifiedForRequest) {
29950
- return /* @__PURE__ */ jsx(EmbeddedRequestPage, { ratings });
29932
+ return /* @__PURE__ */ jsx(
29933
+ TrackingProvider,
29934
+ {
29935
+ funnelContextRef: funnelContext,
29936
+ updateContext,
29937
+ currentStepId: stepId,
29938
+ children: /* @__PURE__ */ jsx(EmbeddedRequestPage, { ratings })
29939
+ }
29940
+ );
29951
29941
  }
29952
29942
  let textColor = onBackground === "light" ? "dark" : "light";
29953
29943
  if (stepId.includes("customer-") && ((_e = slides == null ? void 0 : slides.customerTier) == null ? void 0 : _e.whiteWrapper)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycater/qualification-funnel",
3
- "version": "1.4.12",
3
+ "version": "1.4.13",
4
4
  "type": "module",
5
5
  "description": "Heycater embedded qualification funnel widget",
6
6
  "main": "dist/index.cjs.js",