@srimandir/kundli-generator 5.9.0 → 5.10.0

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.
@@ -1,4 +1,4 @@
1
- import Ge, { useContext as We, createContext as cr, useState as W, useRef as K, useEffect as H, useMemo as Ue, useCallback as Te } from "react";
1
+ import Ge, { useContext as We, createContext as cr, useState as W, useRef as H, useEffect as Y, useMemo as Ue, useCallback as Te } from "react";
2
2
  import { FormSectionHeader as Dr, FooterCTAButton as Fr, FooterShell as Or, CircularMarquee as Mr, footerShellStyles as ke, PageHeader as $r } from "@srimandir/astrology-common";
3
3
  var Le = { exports: {} }, Ie = {};
4
4
  var ar;
@@ -44,10 +44,10 @@ function Gr() {
44
44
  R.unshift("Warning: " + i), Function.prototype.apply.call(console[e], console, R);
45
45
  }
46
46
  }
47
- var w = !1, D = !1, Y = !1, J = !1, re = !1, q;
47
+ var w = !1, D = !1, K = !1, J = !1, re = !1, q;
48
48
  q = /* @__PURE__ */ Symbol.for("react.module.reference");
49
49
  function M(e) {
50
- return !!(typeof e == "string" || typeof e == "function" || e === m || e === S || re || e === k || e === E || e === c || J || e === I || w || D || Y || typeof e == "object" && e !== null && (e.$$typeof === p || e.$$typeof === N || e.$$typeof === x || e.$$typeof === j || e.$$typeof === A || // This needs to include all possible module reference object
50
+ return !!(typeof e == "string" || typeof e == "function" || e === m || e === S || re || e === k || e === E || e === c || J || e === I || w || D || K || typeof e == "object" && e !== null && (e.$$typeof === p || e.$$typeof === N || e.$$typeof === x || e.$$typeof === j || e.$$typeof === A || // This needs to include all possible module reference object
51
51
  // types supported by any Flight configuration anywhere since
52
52
  // we don't know which Flight build this will end up being used
53
53
  // with.
@@ -1154,20 +1154,20 @@ const Ke = cr(null), ot = {
1154
1154
  proceedHref: U,
1155
1155
  originalPriceLabel: w,
1156
1156
  discountedPriceLabel: D,
1157
- discountPillLabel: Y,
1157
+ discountPillLabel: K,
1158
1158
  analytics: J,
1159
1159
  onProceedGuidance: re,
1160
1160
  onLocaleChange: q,
1161
1161
  imageComponent: M = De,
1162
1162
  children: se
1163
1163
  }) => {
1164
- const [Q, G] = W("landing"), [T, F] = W(t ?? "en"), [X, te] = W(ot), ge = K(!0);
1165
- H(() => {
1164
+ const [Q, G] = W("landing"), [T, F] = W(t ?? "en"), [X, te] = W(ot), ge = H(!0);
1165
+ Y(() => {
1166
1166
  const ie = at();
1167
1167
  ie && F(ie);
1168
- }, []), H(() => {
1168
+ }, []), Y(() => {
1169
1169
  nt(T);
1170
- }, [T]), H(() => {
1170
+ }, [T]), Y(() => {
1171
1171
  if (ge.current) {
1172
1172
  ge.current = !1;
1173
1173
  return;
@@ -1198,7 +1198,7 @@ const Ke = cr(null), ot = {
1198
1198
  proceedHref: U,
1199
1199
  originalPriceLabel: w,
1200
1200
  discountedPriceLabel: D,
1201
- discountPillLabel: Y,
1201
+ discountPillLabel: K,
1202
1202
  analytics: J,
1203
1203
  onProceedGuidance: re,
1204
1204
  onLocaleChange: q,
@@ -1227,7 +1227,7 @@ const Ke = cr(null), ot = {
1227
1227
  U,
1228
1228
  w,
1229
1229
  D,
1230
- Y,
1230
+ K,
1231
1231
  J,
1232
1232
  re,
1233
1233
  q,
@@ -1342,8 +1342,8 @@ const it = "_header_19172_1", lt = "_centered_19172_8", lr = {
1342
1342
  restrictCountry: t?.restrictCountry
1343
1343
  };
1344
1344
  }, ca = (t) => {
1345
- const { searchLocalities: o, restrictCountry: d } = t, [m, k] = W([]), [S, x] = W(!1), [j, A] = W(null), E = K(0);
1346
- H(() => {
1345
+ const { searchLocalities: o, restrictCountry: d } = t, [m, k] = W([]), [S, x] = W(!1), [j, A] = W(null), E = H(0);
1346
+ Y(() => {
1347
1347
  A(null);
1348
1348
  }, [o]);
1349
1349
  const c = Te(
@@ -1471,7 +1471,7 @@ const da = ({
1471
1471
  atlasSearchLocalities: j,
1472
1472
  className: A = ""
1473
1473
  }) => {
1474
- const E = Re(), c = E?.config?.analytics ?? x, N = E?.config.isGlobal ?? !0, p = E?.config?.atlasSearchLocalities, [I, h] = W(!1), [B, C] = W(""), b = K(null), g = K(null), U = K({}), w = (n) => d({ ...o, ...n }), D = (n, s) => {
1474
+ const E = Re(), c = E?.config?.analytics ?? x, N = E?.config.isGlobal ?? !0, p = E?.config?.atlasSearchLocalities, [I, h] = W(!1), [B, C] = W(""), b = H(null), g = H(null), U = H({}), w = (n) => d({ ...o, ...n }), D = (n, s) => {
1475
1475
  s.trim() && !U.current[n] && (U.current[n] = !0, {
1476
1476
  fullName: () => c?.trackNameSectionFilled?.(),
1477
1477
  phone: () => c?.trackPhoneSectionFilled?.(),
@@ -1480,9 +1480,9 @@ const da = ({
1480
1480
  birthTime: () => c?.trackTimeFilled?.(),
1481
1481
  birthPlace: () => c?.trackPlaceOfBirthChosen?.()
1482
1482
  }[n]?.());
1483
- }, Y = (n) => n.replace(/\D/g, "").slice(0, 10), J = B.trim().toLowerCase(), re = pr.filter((n) => J ? n.country.toLowerCase().includes(J) || n.code.includes(J) : !0), q = K(null);
1484
- K(null);
1485
- const M = K(null), se = K(0), Q = K(null), [G, T] = W(!1), [F, X] = W({ hour12: 12, minute: "00", meridiem: "AM" }), te = (n) => String(n).padStart(2, "0"), ge = (n) => {
1483
+ }, K = (n) => n.replace(/\D/g, "").slice(0, 10), J = B.trim().toLowerCase(), re = pr.filter((n) => J ? n.country.toLowerCase().includes(J) || n.code.includes(J) : !0), q = H(null);
1484
+ H(null);
1485
+ const M = H(null), se = H(0), Q = H(null), [G, T] = W(!1), [F, X] = W({ hour12: 12, minute: "00", meridiem: "AM" }), te = (n) => String(n).padStart(2, "0"), ge = (n) => {
1486
1486
  const s = /^([01]\d|2[0-3]):([0-5]\d)$/.exec(n);
1487
1487
  if (!s) return n;
1488
1488
  const L = Number(s[1]), me = s[2], Se = L >= 12 ? "PM" : "AM";
@@ -1496,7 +1496,7 @@ const da = ({
1496
1496
  const s = Math.min(12, Math.max(1, n.hour12)), L = /^([0-5]\d)$/.test(n.minute) ? n.minute : "00";
1497
1497
  let me = s % 12;
1498
1498
  return n.meridiem === "PM" && (me += 12), `${te(me)}:${L}`;
1499
- }, ce = K(null), [ae, ie] = W(!1), [fe, ne] = W(
1499
+ }, ce = H(null), [ae, ie] = W(!1), [fe, ne] = W(
1500
1500
  null
1501
1501
  ), de = (o.birthPlace ?? "").trim(), _e = N ? void 0 : "in", z = j ?? p, ye = Number.isFinite(o.birthPlaceLat) && Number.isFinite(o.birthPlaceLng), ue = de.length > 0 && !ye && !ae, {
1502
1502
  predictions: we,
@@ -1508,23 +1508,23 @@ const da = ({
1508
1508
  searchLocalities: z,
1509
1509
  restrictCountry: _e
1510
1510
  });
1511
- H(() => {
1511
+ Y(() => {
1512
1512
  const n = (s) => {
1513
1513
  ce.current && (ce.current.contains(s.target) || ie(!1));
1514
1514
  };
1515
1515
  return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
1516
- }, []), H(() => {
1516
+ }, []), Y(() => {
1517
1517
  const n = (s) => {
1518
1518
  b.current && (b.current.contains(s.target) || (h(!1), C("")));
1519
1519
  };
1520
1520
  return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
1521
- }, []), H(() => {
1521
+ }, []), Y(() => {
1522
1522
  if (!I) return;
1523
1523
  const n = window.setTimeout(() => {
1524
1524
  g.current?.focus();
1525
1525
  }, 0);
1526
1526
  return () => window.clearTimeout(n);
1527
- }, [I]), H(() => {
1527
+ }, [I]), Y(() => {
1528
1528
  if (!ae) return;
1529
1529
  if (de.length < 2) {
1530
1530
  y();
@@ -1549,12 +1549,12 @@ const da = ({
1549
1549
  s.focus(), M.current = s, se.current = Date.now();
1550
1550
  }
1551
1551
  };
1552
- return H(() => {
1552
+ return Y(() => {
1553
1553
  const n = (s) => {
1554
1554
  Q.current && (Q.current.contains(s.target) || T(!1));
1555
1555
  };
1556
1556
  return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
1557
- }, []), H(() => {
1557
+ }, []), Y(() => {
1558
1558
  const n = (L) => {
1559
1559
  L.target?.closest?.("[data-info-tooltip]") == null && ne(null);
1560
1560
  }, s = (L) => {
@@ -1621,7 +1621,7 @@ const da = ({
1621
1621
  onFocus: () => c?.trackPhoneSectionClicked?.(),
1622
1622
  onChange: (n) => {
1623
1623
  const s = n.target.value;
1624
- w({ phone: Y(s) }), D("phone", Y(s));
1624
+ w({ phone: K(s) }), D("phone", K(s));
1625
1625
  },
1626
1626
  placeholder: t("formPhonePlaceholder"),
1627
1627
  autoComplete: "tel",
@@ -2343,8 +2343,8 @@ const da = ({
2343
2343
  const C = Re(), b = C?.config.isGlobal ?? !0, g = C?.config?.variant, [U, w] = W(!1), D = Ue(
2344
2344
  () => wa(o, b, k),
2345
2345
  [o, b, k]
2346
- ), Y = D === null, J = g === "v1" && C?.config?.showSheet;
2347
- H(() => {
2346
+ ), K = D === null, J = g === "v1" && C?.config?.showSheet;
2347
+ Y(() => {
2348
2348
  if (!U) return;
2349
2349
  const Q = window.setTimeout(() => {
2350
2350
  w(!1);
@@ -2352,7 +2352,7 @@ const da = ({
2352
2352
  return () => window.clearTimeout(Q);
2353
2353
  }, [U]);
2354
2354
  const re = b ? N ?? t("formDiscountedPrice") : J ? "" : "₹499", q = C?.config.imageComponent ?? De, M = (Q) => {
2355
- if (Q.preventDefault(), g === "v1" && !Y && E?.trackKundliDetailedClicked?.(), !Y) {
2355
+ if (Q.preventDefault(), console.log("Proceed clicked - validating form", K, g), K || E?.trackKundliDetailedClicked?.(), !K) {
2356
2356
  D && (S?.(
2357
2357
  D === "birthPlaceCoordinates" ? "birthPlace" : D
2358
2358
  ), D === "birthPlaceCoordinates" && w(!0));
@@ -2371,11 +2371,11 @@ const da = ({
2371
2371
  Fr,
2372
2372
  {
2373
2373
  href: A,
2374
- disabled: g === "v1" ? !1 : !Y,
2374
+ disabled: g === "v1" ? !1 : !K,
2375
2375
  onClick: M,
2376
2376
  "aria-label": t("formPriceAria"),
2377
- className: g === "v1" && Y ? Ne.ctaFilled : g === "v1" ? Ne.ctaButton : void 0,
2378
- children: g === "v1" ? Y ? /* @__PURE__ */ r.jsxs("span", { className: Ne.ctaFilledContent, children: [
2377
+ className: g === "v1" && K ? Ne.ctaFilled : g === "v1" ? Ne.ctaButton : void 0,
2378
+ children: g === "v1" ? K ? /* @__PURE__ */ r.jsxs("span", { className: Ne.ctaFilledContent, children: [
2379
2379
  J ? t("selectPackage") : h && B ? `${t("proceedWithPlan")}${B.price}` : `${t("formProceed")} ${re}`,
2380
2380
  /* @__PURE__ */ r.jsx(
2381
2381
  q,
@@ -2639,8 +2639,8 @@ const da = ({
2639
2639
  t: x,
2640
2640
  analytics: j
2641
2641
  }) => {
2642
- const E = Re()?.config.isGlobal ?? !0, c = k ?? Pn(E), N = d?.id || c.find((C) => C.badge)?.id || c[0]?.id || "", p = K(null), I = K(null), h = K(!1);
2643
- H(() => {
2642
+ const E = Re()?.config.isGlobal ?? !0, c = k ?? Pn(E), N = d?.id || c.find((C) => C.badge)?.id || c[0]?.id || "", p = H(null), I = H(null), h = H(!1);
2643
+ Y(() => {
2644
2644
  if (t) {
2645
2645
  if (!d) {
2646
2646
  const C = c.find((b) => b.badge) ?? c[0];
@@ -2653,7 +2653,7 @@ const da = ({
2653
2653
  const B = () => {
2654
2654
  j?.trackPlanPageClosed?.(), o();
2655
2655
  };
2656
- return H(() => {
2656
+ return Y(() => {
2657
2657
  if (!t) return;
2658
2658
  const C = document.body.style.overflow;
2659
2659
  return document.body.style.overflow = "hidden", () => {
@@ -2749,16 +2749,16 @@ const da = ({
2749
2749
  atlasSearchLocalities: c,
2750
2750
  analytics: N
2751
2751
  }) => {
2752
- const p = Re(), I = Kr(), h = p !== null, B = h ? p.locale : o, C = B ?? I?.locale ?? "en", [b, g] = W(C), U = h ? p.locale : b, w = h ? p.setLocale : g, [D, Y] = W(!1), J = K(null), re = K(B), q = K(
2752
+ const p = Re(), I = Kr(), h = p !== null, B = h ? p.locale : o, C = B ?? I?.locale ?? "en", [b, g] = W(C), U = h ? p.locale : b, w = h ? p.setLocale : g, [D, K] = W(!1), J = H(null), re = H(B), q = H(
2753
2753
  I?.locale
2754
2754
  );
2755
- H(() => {
2755
+ Y(() => {
2756
2756
  window.scrollTo({ top: 0, left: 0, behavior: "auto" });
2757
2757
  }, []);
2758
2758
  const M = (y) => jn(U, y);
2759
- H(() => {
2759
+ Y(() => {
2760
2760
  B && re.current !== B && w(B), re.current = B;
2761
- }, [B, w]), H(() => {
2761
+ }, [B, w]), Y(() => {
2762
2762
  if (B) return;
2763
2763
  const y = I?.locale;
2764
2764
  y && q.current !== y && w(y), q.current = y;
@@ -2770,18 +2770,18 @@ const da = ({
2770
2770
  }), G = h ? p?.config.isGlobal ?? !0 : !0, [T, F] = W(
2771
2771
  G ? "+1" : "+91"
2772
2772
  );
2773
- H(() => {
2773
+ Y(() => {
2774
2774
  F(G ? "+1" : "+91");
2775
2775
  }, [G]);
2776
2776
  const X = h ? p.formValues : se, te = h ? p.setFormValues : Q, ge = h ? p.goToPage : m, V = h ? p.onProceed : S, oe = h ? p.onProceedGuidance : x, ce = h ? p.config.proceedHref : j, ae = h ? p.config.originalPriceLabel : A, ie = h ? p.config.discountedPriceLabel : E, fe = h ? p.config.showLanguageSelector ?? !0 : d, ne = (h ? p?.config?.analytics : N) ?? N;
2777
- H(() => {
2777
+ Y(() => {
2778
2778
  if (!D) return;
2779
2779
  const y = (pe) => {
2780
- J.current && !J.current.contains(pe.target) && Y(!1);
2780
+ J.current && !J.current.contains(pe.target) && K(!1);
2781
2781
  };
2782
2782
  return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
2783
2783
  }, [D]);
2784
- const [de, _e] = W(!1), [z, ye] = W(null), ue = K(null), we = Te((y) => {
2784
+ const [de, _e] = W(!1), [z, ye] = W(null), ue = H(null), we = Te((y) => {
2785
2785
  ue.current = y, _e(!0);
2786
2786
  }, []), be = Te(() => {
2787
2787
  if (ne?.trackPlanProceedClicked?.({
@@ -2797,7 +2797,7 @@ const da = ({
2797
2797
  type: "button",
2798
2798
  className: he.langTrigger,
2799
2799
  onClick: () => {
2800
- ne?.trackLanguageClickedFe?.({ language: U }), Y((y) => !y);
2800
+ ne?.trackLanguageClickedFe?.({ language: U }), K((y) => !y);
2801
2801
  },
2802
2802
  "aria-expanded": D,
2803
2803
  "aria-haspopup": "listbox",
@@ -2834,7 +2834,7 @@ const da = ({
2834
2834
  "aria-selected": y === U,
2835
2835
  className: he.langOption,
2836
2836
  onClick: () => {
2837
- ne?.trackLanguageChangedFe?.({ newLanguage: y }), w(y), Y(!1);
2837
+ ne?.trackLanguageChangedFe?.({ newLanguage: y }), w(y), K(!1);
2838
2838
  },
2839
2839
  children: ir[y]
2840
2840
  },
@@ -2968,4 +2968,4 @@ export {
2968
2968
  ur as t,
2969
2969
  Kr as u
2970
2970
  };
2971
- //# sourceMappingURL=analytics-CSkzpTAZ.js.map
2971
+ //# sourceMappingURL=analytics-BxTHGN8F.js.map