react-marketing-tools 0.0.4 → 0.0.7

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.
@@ -697,7 +697,7 @@ const xe = (e, d = "") => {
697
697
  console.group(), console.info("BuildInGlobalEventActionList"), console.table(e), console.groupEnd();
698
698
  };
699
699
  let oe = {};
700
- const e_ = (e) => {
700
+ const o_ = (e) => {
701
701
  const {
702
702
  appName: d,
703
703
  appSessionCookieName: o,
@@ -737,14 +737,14 @@ const e_ = (e) => {
737
737
  (a) => a
738
738
  );
739
739
  return {
740
- CITY: o.city,
741
- COUNTRY: o.country,
742
- HOSTNAME: o.hostname,
743
- IP: o.ip,
744
- LOC: o.loc,
745
- POSTAL: o.postal,
746
- REGION: o.region,
747
- TIMEZONE: o.timezone
740
+ SERVER_CITY: o.city,
741
+ SERVER_COUNTRY: o.country,
742
+ SERVER_HOSTNAME: o.hostname,
743
+ SERVER_IP: o.ip,
744
+ SERVER_LOCATION: o.loc,
745
+ SERVER_POSTAL: o.postal,
746
+ SERVER_REGION: o.region,
747
+ SERVER_TIMEZONE: o.timezone
748
748
  };
749
749
  }
750
750
  }, ul = (e) => fetch(`https://ipinfo.io/110.174.218.10?token=${e}`).then(
@@ -47764,12 +47764,12 @@ const HG = async (e, d) => {
47764
47764
  HIT_TIMESTAMP: l.toISOString(),
47765
47765
  ...i || []
47766
47766
  };
47767
- return await WG(
47767
+ return await QG(
47768
47768
  g,
47769
47769
  e,
47770
47770
  d
47771
47771
  );
47772
- }, kG = (e) => new VG().parse(e), Cr = (e, d = "") => {
47772
+ }, kG = (e) => !!window.dataLayer.find((o) => o.event === e), KG = (e) => new VG().parse(e), Cr = (e, d = "") => {
47773
47773
  const { analyticsGlobalEventActionList: o } = oe;
47774
47774
  let l = "";
47775
47775
  xe(
@@ -47790,7 +47790,7 @@ const HG = async (e, d) => {
47790
47790
  "getEventSequence(), previousGlobalAppEvent is not in the analyticsGlobalEventActionList!"
47791
47791
  );
47792
47792
  return { currentSequence: a, previousSequence: l };
47793
- }, KG = (e, d) => Object.assign(e, d), WG = (e, d, o) => {
47793
+ }, WG = (e, d) => Object.assign(e, d), QG = (e, d, o) => {
47794
47794
  const { analyticsGlobalEventActionList: l, includeUserKeys: a } = oe;
47795
47795
  let i = {};
47796
47796
  const { currentSequence: g } = Cr(o);
@@ -47801,13 +47801,13 @@ const HG = async (e, d) => {
47801
47801
  [$.toUpperCase()]: A
47802
47802
  });
47803
47803
  });
47804
- return KG(e, i);
47804
+ return WG(e, i);
47805
47805
  }, io = (e) => {
47806
47806
  var l, a;
47807
47807
  const o = `; ${document.cookie}`.split(`; ${e}=`);
47808
47808
  if ((o == null ? void 0 : o.length) === 2)
47809
47809
  return (a = (l = o == null ? void 0 : o.pop()) == null ? void 0 : l.split(";")) == null ? void 0 : a.shift();
47810
- }, QG = async (e) => {
47810
+ }, ZG = async (e) => {
47811
47811
  var B, N;
47812
47812
  const { consoleLogData: d, data: o, eventName: l, globalAppEvent: a, userDetails: i } = e, { appSessionCookieName: g, TOKENS: m } = { ...oe };
47813
47813
  xe(
@@ -47836,23 +47836,23 @@ const HG = async (e, d) => {
47836
47836
  method: "POST",
47837
47837
  body: JSON.stringify(P)
47838
47838
  }
47839
- ), ZG({ googleDataPayload: P, ...d });
47840
- }, ZG = (e) => {
47839
+ ), YG({ googleDataPayload: P, ...d });
47840
+ }, YG = (e) => {
47841
47841
  const { googleDataPayload: d, showJourneyPropsPayload: o, showUserProps: l } = e;
47842
47842
  l && console.log(
47843
47843
  "googleDataPayload.user_properties",
47844
47844
  d.user_properties
47845
47845
  ), o && console.log("googleDataPayload.events", d.events);
47846
- }, YG = async (e) => {
47846
+ }, JG = async (e) => {
47847
47847
  var k, w, V, x;
47848
47848
  const {
47849
47849
  consoleLogData: d,
47850
47850
  data: o,
47851
47851
  eventName: l,
47852
47852
  globalAppEvent: a,
47853
- layerCheck: i,
47853
+ dataLayerCheck: i,
47854
47854
  userDetails: g
47855
- } = e, { appName: m, appSessionCookieName: $, withDeviceInfo: A } = oe, M = navigator.userAgent, P = A && kG(M), B = await Br(o, a), N = {
47855
+ } = e, { appName: m, appSessionCookieName: $, withDeviceInfo: A } = oe, M = navigator.userAgent, P = A && KG(M), B = await Br(o, a), N = {
47856
47856
  event: l,
47857
47857
  globalVars: {
47858
47858
  app: m,
@@ -47870,8 +47870,8 @@ const HG = async (e, d) => {
47870
47870
  ...B
47871
47871
  }
47872
47872
  };
47873
- JG({ dataLayerData: N, ...d }), i && defaultDataLayerEventCheck(l) || window.dataLayer.push(N);
47874
- }, JG = (e) => {
47873
+ zG({ dataLayerData: N, ...d }), i && kG(l) || window.dataLayer.push(N);
47874
+ }, zG = (e) => {
47875
47875
  const {
47876
47876
  dataLayerData: d,
47877
47877
  showGlobalVars: o,
@@ -47899,7 +47899,7 @@ const HG = async (e, d) => {
47899
47899
  o.eventName,
47900
47900
  "_"
47901
47901
  ).toUpperCase()}` : UG(o);
47902
- if (l === Se.DATALAYER_PUSH && await YG({
47902
+ if (l === Se.DATALAYER_PUSH && await JG({
47903
47903
  eventName: $,
47904
47904
  dataLayerCheck: i,
47905
47905
  globalAppEvent: o.globalAppEvent,
@@ -47913,7 +47913,7 @@ const HG = async (e, d) => {
47913
47913
  ge(ro(d, m)) && (A = await HG(
47914
47914
  ro(d, m),
47915
47915
  a
47916
- )), await QG({
47916
+ )), await ZG({
47917
47917
  data: d,
47918
47918
  eventName: $,
47919
47919
  userDetails: A,
@@ -47933,7 +47933,7 @@ var Nr = { exports: {} }, Be = {};
47933
47933
  * LICENSE file in the root directory of this source tree.
47934
47934
  */
47935
47935
  var Mr;
47936
- function zG() {
47936
+ function jG() {
47937
47937
  if (Mr)
47938
47938
  return Be;
47939
47939
  Mr = 1;
@@ -47961,7 +47961,7 @@ var Ce = {};
47961
47961
  * LICENSE file in the root directory of this source tree.
47962
47962
  */
47963
47963
  var Pr;
47964
- function jG() {
47964
+ function qG() {
47965
47965
  return Pr || (Pr = 1, process.env.NODE_ENV !== "production" && function() {
47966
47966
  var e = Tr, d = Symbol.for("react.element"), o = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), m = Symbol.for("react.context"), $ = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), M = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), B = Symbol.for("react.lazy"), N = Symbol.for("react.offscreen"), k = Symbol.iterator, w = "@@iterator";
47967
47967
  function V(r) {
@@ -48539,7 +48539,7 @@ Check the top-level render call using <` + s + ">.");
48539
48539
  }()), Ce;
48540
48540
  }
48541
48541
  (function(e) {
48542
- process.env.NODE_ENV === "production" ? e.exports = zG() : e.exports = jG();
48542
+ process.env.NODE_ENV === "production" ? e.exports = jG() : e.exports = qG();
48543
48543
  })(Nr);
48544
48544
  const vr = Nr.exports.jsx, Or = pr({}), yr = pr({}), Ir = Or.Provider;
48545
48545
  Ir.propTypes = {
@@ -48560,7 +48560,7 @@ wr.propTypes = {
48560
48560
  showMeBuildInEventActionPrefixList: j.exports.func,
48561
48561
  showMeBuildInGlobalEventActionList: j.exports.func
48562
48562
  };
48563
- const o_ = ({
48563
+ const r_ = ({
48564
48564
  children: e
48565
48565
  }) => {
48566
48566
  const d = fo(() => ({
@@ -48582,20 +48582,20 @@ const o_ = ({
48582
48582
  children: e
48583
48583
  })
48584
48584
  });
48585
- }, r_ = () => {
48585
+ }, l_ = () => {
48586
48586
  const e = Gr(Or);
48587
48587
  return xe(e, "useAppState must be used within the AppProvider"), e;
48588
- }, l_ = () => {
48588
+ }, d_ = () => {
48589
48589
  const e = Gr(yr);
48590
48590
  return xe(e, "useAppApi must be used within the AppProvider"), e;
48591
48591
  };
48592
48592
  export {
48593
48593
  yr as ContextApi,
48594
48594
  Or as ContextState,
48595
- o_ as ReactMarketingProvider,
48595
+ r_ as ReactMarketingProvider,
48596
48596
  Se as analyticsPlatform,
48597
- e_ as buildConfig,
48597
+ o_ as buildConfig,
48598
48598
  Ar as trackAnalyticsEvent,
48599
- l_ as useMarketingApi,
48600
- r_ as useMarketingState
48599
+ d_ as useMarketingApi,
48600
+ l_ as useMarketingState
48601
48601
  };