@srimandir/kundli-matching-generator 11.6.0 → 11.6.2

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.
@@ -113,7 +113,12 @@ export interface KundliMatchingAnalytics {
113
113
  trackPrimaryCtaClickedL1?(params: {
114
114
  avenue?: string;
115
115
  }): void;
116
- trackPlanPageViewed?(): void;
116
+ trackPlanPageViewed?(params?: {
117
+ plans: Array<{
118
+ sku: string;
119
+ price: string;
120
+ }>;
121
+ }): void;
117
122
  trackPlanSelected?(params: {
118
123
  planId: string;
119
124
  planName: string;
@@ -1,4 +1,4 @@
1
- import { d as ge, j as e, L as se, S as ke, u as Ie, D as Te, B as ne, e as re, v as Ce, c as Pe, I as J, b as Se, f as X, t as Re } from "./image-vNHUAL7L.js";
1
+ import { d as ge, j as e, L as se, S as ke, u as Ie, D as Te, B as ne, e as re, v as Ce, c as Pe, I as J, b as Se, f as z, t as Re } from "./image-vNHUAL7L.js";
2
2
  import pe, { useState as P, useRef as w, useEffect as y, useMemo as Le, useCallback as ie } from "react";
3
3
  import { FaStar as be, FaCheck as Be, FaQuoteLeft as Ae, FaQuoteRight as Ee } from "react-icons/fa";
4
4
  import { FiChevronDown as $e } from "react-icons/fi";
@@ -171,17 +171,17 @@ const De = "_header_15wki_1", Me = "_brand_15wki_15", Ve = "_logo_15wki_21", Ge
171
171
  },
172
172
  `${d}-${c}`
173
173
  ) });
174
- }, gt = "_section_2axro_1", pt = "_title_2axro_10", bt = "_details_2axro_20", xt = "_spacer_2axro_36", ft = "_link_2axro_41", q = {
174
+ }, gt = "_section_2axro_1", pt = "_title_2axro_10", bt = "_details_2axro_20", xt = "_spacer_2axro_36", ft = "_link_2axro_41", U = {
175
175
  section: gt,
176
176
  title: pt,
177
177
  details: bt,
178
178
  spacer: xt,
179
179
  link: ft
180
- }, vt = "080-711-74417", yt = "https://wa.me/918071174417", de = "shubham.goyal@appsforbharat.com", jt = ({ t, className: s = "", analytics: r }) => /* @__PURE__ */ e.jsxs("section", { className: `${q.section} ${s}`, children: [
181
- /* @__PURE__ */ e.jsx("h2", { className: q.title, children: t("contactTitle") }),
182
- /* @__PURE__ */ e.jsxs("address", { className: q.details, children: [
180
+ }, vt = "080-711-74417", yt = "https://wa.me/918071174417", de = "shubham.goyal@appsforbharat.com", jt = ({ t, className: s = "", analytics: r }) => /* @__PURE__ */ e.jsxs("section", { className: `${U.section} ${s}`, children: [
181
+ /* @__PURE__ */ e.jsx("h2", { className: U.title, children: t("contactTitle") }),
182
+ /* @__PURE__ */ e.jsxs("address", { className: U.details, children: [
183
183
  /* @__PURE__ */ e.jsx("span", { children: t("contactBrand") }),
184
- /* @__PURE__ */ e.jsx("span", { className: q.spacer, "aria-hidden": "true" }),
184
+ /* @__PURE__ */ e.jsx("span", { className: U.spacer, "aria-hidden": "true" }),
185
185
  /* @__PURE__ */ e.jsxs("span", { children: [
186
186
  t("contactWhatsapp"),
187
187
  " ",
@@ -191,7 +191,7 @@ const De = "_header_15wki_1", Me = "_brand_15wki_15", Ve = "_logo_15wki_21", Ge
191
191
  href: yt,
192
192
  target: "_blank",
193
193
  rel: "noopener noreferrer",
194
- className: q.link,
194
+ className: U.link,
195
195
  onClick: () => r?.trackFunnelEvent?.("contact_click", { channel: "whatsapp" }),
196
196
  children: vt
197
197
  }
@@ -204,7 +204,7 @@ const De = "_header_15wki_1", Me = "_brand_15wki_15", Ve = "_logo_15wki_21", Ge
204
204
  "a",
205
205
  {
206
206
  href: `mailto:${de}`,
207
- className: q.link,
207
+ className: U.link,
208
208
  onClick: () => r?.trackFunnelEvent?.("contact_click", { channel: "email" }),
209
209
  children: de
210
210
  }
@@ -546,10 +546,10 @@ const xn = 6, fn = ({
546
546
  if (!t || !a || !o.current || !f) return;
547
547
  d(!0), _(null), o.current.innerHTML = "";
548
548
  const h = /* @__PURE__ */ new Set(), k = new IntersectionObserver(
549
- (I) => {
550
- I.forEach((T) => {
551
- const L = Number(T.target.dataset.page);
552
- !T.isIntersecting || h.has(L) || (h.add(L), i?.(L));
549
+ (T) => {
550
+ T.forEach((C) => {
551
+ const L = Number(C.target.dataset.page);
552
+ !C.isIntersecting || h.has(L) || (h.add(L), i?.(L));
553
553
  });
554
554
  },
555
555
  // "In view" = crosses the viewport's center line; a ratio threshold never trips for pages taller than the viewport.
@@ -558,17 +558,17 @@ const xn = 6, fn = ({
558
558
  return (async () => {
559
559
  try {
560
560
  bn(f);
561
- const T = await f.getDocument({ url: a }).promise, L = o.current;
561
+ const C = await f.getDocument({ url: a }).promise, L = o.current;
562
562
  if (!L) return;
563
563
  const S = L.clientWidth || 600, v = Math.min(S / 612, 2);
564
- for (let b = 1; b <= Math.min(T.numPages, xn); b++) {
565
- const R = await T.getPage(b), $ = R.getViewport({ scale: v }), B = document.createElement("canvas");
564
+ for (let b = 1; b <= Math.min(C.numPages, xn); b++) {
565
+ const R = await C.getPage(b), $ = R.getViewport({ scale: v }), B = document.createElement("canvas");
566
566
  B.height = $.height, B.width = $.width, B.style.display = "block", B.style.margin = "0 auto 1rem", B.style.maxWidth = "100%";
567
567
  const K = B.getContext("2d");
568
568
  K && await R.render({ canvasContext: K, viewport: $ }).promise, B.dataset.page = String(b), L.appendChild(B), k.observe(B);
569
569
  }
570
- } catch (I) {
571
- _(I instanceof Error ? I.message : "Failed to load PDF");
570
+ } catch (T) {
571
+ _(T instanceof Error ? T.message : "Failed to load PDF");
572
572
  } finally {
573
573
  d(!1);
574
574
  }
@@ -912,7 +912,7 @@ const Kn = ({
912
912
  rating: 5,
913
913
  review: t("testimonial8Review")
914
914
  }
915
- ], k = [...h, ...h, ...h], g = h.length, I = g, T = (v, b = !0) => {
915
+ ], k = [...h, ...h, ...h], g = h.length, T = g, C = (v, b = !0) => {
916
916
  if (!i.current) return;
917
917
  f.current = !0;
918
918
  const R = i.current, $ = R.children[0];
@@ -927,10 +927,10 @@ const Kn = ({
927
927
  };
928
928
  y(() => {
929
929
  const v = setTimeout(() => {
930
- c(I), T(I, !1);
930
+ c(T), C(T, !1);
931
931
  }, 50);
932
932
  return () => clearTimeout(v);
933
- }, [I]), y(() => () => {
933
+ }, [T]), y(() => () => {
934
934
  _.current && clearTimeout(_.current);
935
935
  }, []), y(() => {
936
936
  if (d) return;
@@ -940,15 +940,15 @@ const Kn = ({
940
940
  return () => clearInterval(v);
941
941
  }, [d]), y(() => {
942
942
  if (!i.current || o === 0) return;
943
- T(o, !0);
943
+ C(o, !0);
944
944
  const v = setTimeout(() => {
945
945
  if (i.current) {
946
946
  if (o >= g * 2) {
947
947
  const b = o - g;
948
- c(b), T(b, !1);
948
+ c(b), C(b, !1);
949
949
  } else if (o < g) {
950
950
  const b = o + g;
951
- c(b), T(b, !1);
951
+ c(b), C(b, !1);
952
952
  }
953
953
  }
954
954
  }, 700);
@@ -1403,14 +1403,14 @@ const Kn = ({
1403
1403
  };
1404
1404
  return y(() => {
1405
1405
  if (t && !r) {
1406
- const g = l.find((I) => I.badge) ?? l[0];
1406
+ const g = l.find((T) => T.badge) ?? l[0];
1407
1407
  g && a(g);
1408
1408
  }
1409
1409
  }, [t, l, r, a]), y(() => {
1410
1410
  if (!t) return;
1411
- const g = document.body.style.overflow, I = document.documentElement.style.overflow;
1411
+ const g = document.body.style.overflow, T = document.documentElement.style.overflow;
1412
1412
  return document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden", () => {
1413
- document.body.style.overflow = g, document.documentElement.style.overflow = I;
1413
+ document.body.style.overflow = g, document.documentElement.style.overflow = T;
1414
1414
  };
1415
1415
  }, [t]), t ? Oe(
1416
1416
  /* @__PURE__ */ e.jsx(
@@ -1434,9 +1434,9 @@ const Kn = ({
1434
1434
  plan: g,
1435
1435
  isSelected: g.id === _,
1436
1436
  t: d,
1437
- onSelect: (I) => {
1438
- const T = l.find((L) => L.id === I);
1439
- T && a(T, !0);
1437
+ onSelect: (T) => {
1438
+ const C = l.find((L) => L.id === T);
1439
+ C && a(C, !0);
1440
1440
  }
1441
1441
  },
1442
1442
  g.id
@@ -1518,12 +1518,14 @@ function Mi({ className: t, variant: s }) {
1518
1518
  () => Di(i.phoneCountryCode, a.isGlobal ?? !1)
1519
1519
  ), h = a.isGlobal ? f : "+91", k = w(
1520
1520
  !!(i.phoneCountryCode && J.includes(i.phoneCountryCode))
1521
- ), g = w(!1), I = ie((u) => {
1521
+ ), g = w(!1), T = ie((u) => {
1522
1522
  g.current = !0, p(u);
1523
- }, []), T = w(!1), L = w(null), S = (u) => Oi(r, u), v = (u) => {
1524
- const C = a.plans ?? fe(a.isGlobal ?? !1), F = l ?? C.find((U) => U.badge) ?? C[0];
1525
- a.analytics?.trackFunnelEvent?.("plan_view", {
1526
- default_selected_sku: F ? X(F.id) : "",
1523
+ }, []), C = w(!1), L = w(null), S = (u) => Oi(r, u), v = (u) => {
1524
+ const I = a.plans ?? fe(a.isGlobal ?? !1), F = l ?? I.find((q) => q.badge) ?? I[0];
1525
+ a.analytics?.trackPlanPageViewed?.({
1526
+ plans: I.map((q) => ({ sku: z(q.id), price: q.price }))
1527
+ }), a.analytics?.trackFunnelEvent?.("plan_view", {
1528
+ default_selected_sku: F ? z(F.id) : "",
1527
1529
  entry: u
1528
1530
  });
1529
1531
  }, b = ie((u) => {
@@ -1558,7 +1560,7 @@ function Mi({ className: t, variant: s }) {
1558
1560
  }, [i.phoneCountryCode]);
1559
1561
  const $ = w(!1);
1560
1562
  y(() => {
1561
- $.current || !a.autoOpenPlanSheet || ($.current = !0, d(!0), a.analytics?.trackPlanPageViewed?.(), v("deep_link"));
1563
+ $.current || !a.autoOpenPlanSheet || ($.current = !0, d(!0), v("deep_link"));
1562
1564
  }, [a.autoOpenPlanSheet, a.analytics]);
1563
1565
  const B = w(!1);
1564
1566
  y(() => {
@@ -1574,45 +1576,45 @@ function Mi({ className: t, variant: s }) {
1574
1576
  const [K, H] = P(!1), W = w(null), ve = (u) => {
1575
1577
  if (W.current === null) {
1576
1578
  W.current = Date.now();
1577
- const [C, F] = Object.entries(u)[0] ?? [], U = C === "boy" || C === "girl" ? C : "contact";
1578
- let z = C ?? "";
1579
- if (U !== "contact" && F && typeof F == "object") {
1580
- const Y = i[U], ae = F;
1581
- z = Object.keys(ae).find((Q) => Q !== "birthPlaceNeedsPick" && ae[Q] !== Y[Q]) ?? z;
1579
+ const [I, F] = Object.entries(u)[0] ?? [], q = I === "boy" || I === "girl" ? I : "contact";
1580
+ let Y = I ?? "";
1581
+ if (q !== "contact" && F && typeof F == "object") {
1582
+ const Q = i[q], ae = F;
1583
+ Y = Object.keys(ae).find((X) => X !== "birthPlaceNeedsPick" && ae[X] !== Q[X]) ?? Y;
1582
1584
  }
1583
1585
  a.analytics?.trackFunnelEvent?.("form_start", {
1584
- field_name: z.replace(/[A-Z]/g, (Y) => `_${Y.toLowerCase()}`),
1585
- partner: U
1586
+ field_name: Y.replace(/[A-Z]/g, (Q) => `_${Q.toLowerCase()}`),
1587
+ partner: q
1586
1588
  });
1587
1589
  }
1588
- o((C) => ({ ...C, ...u }));
1590
+ o((I) => ({ ...I, ...u }));
1589
1591
  }, ye = () => {
1590
1592
  a.analytics?.trackPrimaryCtaClickedL1?.({
1591
1593
  avenue: "kundli_matching_form"
1592
1594
  }), a.analytics?.trackFunnelEvent?.("form_submit_attempt"), a.analytics?.trackFunnelEvent?.("form_submit_success", {
1593
1595
  // 0 when nothing was typed (fully pre-filled form).
1594
1596
  seconds_since_form_start: W.current ? Math.round((Date.now() - W.current) / 1e3) : 0
1595
- }), T.current = !1, d(!0), a.analytics?.trackPlanPageViewed?.(), v("cta");
1596
- }, je = (u, C) => {
1597
- _(u), C && a.analytics?.trackFunnelEvent?.("plan_select", { sku: X(u.id) }), a.analytics?.trackPlanSelected?.({
1597
+ }), C.current = !1, d(!0), v("cta");
1598
+ }, je = (u, I) => {
1599
+ _(u), I && a.analytics?.trackFunnelEvent?.("plan_select", { sku: z(u.id) }), a.analytics?.trackPlanSelected?.({
1598
1600
  planId: u.id,
1599
1601
  planName: u.title
1600
1602
  });
1601
1603
  }, Ne = (u) => {
1602
- T.current = !0, a.analytics?.trackPlanProceedClicked?.({
1604
+ C.current = !0, a.analytics?.trackPlanProceedClicked?.({
1603
1605
  planId: u.id,
1604
1606
  planName: u.title
1605
1607
  });
1606
- const C = (i.phone ?? "").trim(), F = {
1608
+ const I = (i.phone ?? "").trim(), F = {
1607
1609
  ...i,
1608
- phone: C && `${h}-${C}`
1610
+ phone: I && `${h}-${I}`
1609
1611
  };
1610
1612
  if (a.onProceed)
1611
1613
  return a.onProceed(F, u);
1612
1614
  console.log("Proceeding to payment:", { formValues: F, plan: u });
1613
1615
  }, we = () => {
1614
- T.current || (a.analytics?.trackPlanPageClosed?.(), a.analytics?.trackFunnelEvent?.("plan_sheet_closed", {
1615
- selected_sku: l ? X(l.id) : ""
1616
+ C.current || (a.analytics?.trackPlanPageClosed?.(), a.analytics?.trackFunnelEvent?.("plan_sheet_closed", {
1617
+ selected_sku: l ? z(l.id) : ""
1616
1618
  })), d(!1);
1617
1619
  };
1618
1620
  return /* @__PURE__ */ e.jsxs("div", { className: `kundli-matching-page-root space-y-8 max-w-lg mx-auto pb-[160px] ${t}`, children: [
@@ -1642,7 +1644,7 @@ function Mi({ className: t, variant: s }) {
1642
1644
  isGlobal: a.isGlobal,
1643
1645
  analytics: a.analytics,
1644
1646
  phoneIsdCode: h,
1645
- onPhoneIsdCodeChange: I,
1647
+ onPhoneIsdCodeChange: T,
1646
1648
  showAllErrors: K
1647
1649
  }
1648
1650
  ) }) }),
@@ -1699,4 +1701,4 @@ export {
1699
1701
  oe as g,
1700
1702
  Yi as r
1701
1703
  };
1702
- //# sourceMappingURL=criticalCss-BrMuSMKP.js.map
1704
+ //# sourceMappingURL=criticalCss-BQNyvpkS.js.map