@fynd-design-engineering/fynd-one-v2 3.3.44 → 3.3.46
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/filters/konnect.ts"],
|
|
4
|
-
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// ---- global helpers ----\nfunction getQueryParam(name: string): string | null {\n const val = new URLSearchParams(window.location.search).get(name);\n return val ? val.trim() : null;\n}\n\nfunction getTagEqualFromURL(): string | null {\n return getQueryParam(\"tag_equal\");\n}\n\n// expose globally if you want to inspect it in the console\n// @ts-ignore\n(window as any).getTagEqualFromURL = getTagEqualFromURL;\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n console.log(\"%csrc/filters/konnect.ts:2 working\", \"color: #007acc;\");\n const elements = document.querySelectorAll<HTMLElement>(\n \"[konnect-filter-element]\"\n );\n if (elements.length === 0) return;\n setTimeout(updateMobileSelectOnLoad, 200);\n\n // watch tag_equal every 100 ms\n let lastTagEqual = getTagEqualFromURL();\n setInterval(() => {\n const current = getTagEqualFromURL();\n if (current !== lastTagEqual) {\n console.log(\"tag_equal changed:\", current);\n lastTagEqual = current;\n updateMobileSelect(); // re-sync the select whenever the URL changes\n }\n }, 100);\n\n // log the URL param whenever user changes select\n const select = document.getElementById(\n \"konnect-filter\"\n ) as HTMLSelectElement | null;\n if (select) {\n select.addEventListener(\"change\", () => {\n console.log(\"Select changed \u2192 URL tag_equal is:\", getTagEqualFromURL());\n });\n }\n\n elements.forEach((el) => {\n el.addEventListener(\"click\", () => {\n console.log(\"konnect-filter-element clicked:\", el);\n const type = el.getAttribute(\"konnect-filter-element\");\n if (type === \"primary\") {\n setTimeout(updateMobileSelect, 100);\n const items = document.querySelectorAll<HTMLElement>(\n '[konnect-filter-element=\"secondary\"]'\n );\n items.forEach((el, index) => {\n if (index == 0) {\n el.click();\n el.setAttribute(\"konnect-filter-active\", \"true\");\n } else {\n el.setAttribute(\"konnect-filter-active\", \"false\");\n }\n });\n } else {\n setTimeout(updateSecondaryFilterTabs, 100);\n }\n });\n });\n});\n\nfunction updateSecondaryFilterTabs(): void {\n const raw = new URLSearchParams(window.location.search).get(\"nest-tag_equal\");\n const items = document.querySelectorAll<HTMLElement>(\n '[konnect-filter-element=\"secondary\"]'\n );\n if (!raw) {\n items.forEach((el, index) => {\n el.setAttribute(\"konnect-filter-active\", index == 0 ? \"true\" : \"false\");\n });\n return;\n }\n const target = raw.trim().toLowerCase();\n if (items.length === 0) return;\n\n items.forEach((el) => {\n const input = el.querySelector<HTMLInputElement>(\"[fs-list-value]\");\n if (!input) return;\n const valFromAttr = input\n .getAttribute(\"fs-list-value\")\n ?.trim()\n .toLowerCase();\n if (valFromAttr === target) {\n el.setAttribute(\"konnect-filter-active\", \"true\");\n items[0].setAttribute(\"konnect-filter-active\", \"false\");\n } else {\n el.setAttribute(\"konnect-filter-active\", \"false\");\n }\n });\n}\n\nfunction updateMobileSelect(): void {\n const raw = getTagEqualFromURL();\n const select = document.getElementById(\n \"konnect-filter\"\n ) as HTMLSelectElement | null;\n if (!select) {\n console.warn(\"Select element with id 'konnect-filter' not found.\");\n return;\n }\n\n if (raw) {\n const matchedOption = Array.from(select.options).find(\n (option) => option.value === raw\n );\n if (matchedOption) {\n select.value = raw;\n console.log(`Selected option: ${raw}`);\n toggleSecondaryFilter(raw);\n } else {\n console.warn(`No matching option found for value: ${raw}`);\n }\n } else {\n console.log(\"No 'tag_equal' parameter in URL.\");\n }\n}\n\nfunction updateMobileSelectOnLoad(): void {\n const raw = getTagEqualFromURL();\n const select = document.getElementById(\n \"konnect-filter\"\n ) as HTMLSelectElement | null;\n if (!select) {\n console.warn(\"Select element with id 'konnect-filter' not found.\");\n return;\n }\n\n if (raw) {\n const matchedOption = Array.from(select.options).find(\n (option) => option.value === raw\n );\n if (matchedOption) {\n select.value = raw;\n console.log(`Selected from URL param: ${raw}`);\n } else {\n console.warn(\n `No matching option found for value: ${raw}. Defaulting to Marketplaces.`\n );\n select.value = \"Marketplaces\";\n }\n } else {\n select.value = \"Marketplaces\";\n console.log(\"No tag_equal param found. Defaulted to Marketplaces.\");\n }\n}\nfunction toggleSecondaryFilter(raw: string | null): void {\n const
|
|
5
|
-
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACTA,WAAS,cAAc,MAA6B;AAClD,UAAM,MAAM,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAI,IAAI;AAChE,WAAO,MAAM,IAAI,KAAK,IAAI;AAAA,EAC5B;AAEA,WAAS,qBAAoC;AAC3C,WAAO,cAAc,WAAW;AAAA,EAClC;AAIA,EAAC,OAAe,qBAAqB;AAErC,WAAS,iBAAiB,oBAAoB,MAAM;AAClD,YAAQ,IAAI,sCAAsC,iBAAiB;AACnE,UAAM,WAAW,SAAS;AAAA,MACxB;AAAA,IACF;AACA,QAAI,SAAS,WAAW,EAAG;AAC3B,eAAW,0BAA0B,GAAG;AAGxC,QAAI,eAAe,mBAAmB;AACtC,gBAAY,MAAM;AAChB,YAAM,UAAU,mBAAmB;AACnC,UAAI,YAAY,cAAc;AAC5B,gBAAQ,IAAI,sBAAsB,OAAO;AACzC,uBAAe;AACf,2BAAmB;AAAA,MACrB;AAAA,IACF,GAAG,GAAG;AAGN,UAAM,SAAS,SAAS;AAAA,MACtB;AAAA,IACF;AACA,Q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enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// ---- global helpers ----\nfunction getQueryParam(name: string): string | null {\n const val = new URLSearchParams(window.location.search).get(name);\n return val ? val.trim() : null;\n}\n\nfunction getTagEqualFromURL(): string | null {\n return getQueryParam(\"tag_equal\");\n}\n\n// expose globally if you want to inspect it in the console\n// @ts-ignore\n(window as any).getTagEqualFromURL = getTagEqualFromURL;\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n console.log(\"%csrc/filters/konnect.ts:2 working\", \"color: #007acc;\");\n const elements = document.querySelectorAll<HTMLElement>(\n \"[konnect-filter-element]\"\n );\n if (elements.length === 0) return;\n setTimeout(updateMobileSelectOnLoad, 200);\n\n // watch tag_equal every 100 ms\n let lastTagEqual = getTagEqualFromURL();\n setInterval(() => {\n const current = getTagEqualFromURL();\n if (current !== lastTagEqual) {\n console.log(\"tag_equal changed:\", current);\n lastTagEqual = current;\n updateMobileSelect(); // re-sync the select whenever the URL changes\n }\n }, 100);\n\n // log the URL param whenever user changes select\n const select = document.getElementById(\n \"konnect-filter\"\n ) as HTMLSelectElement | null;\n if (select) {\n select.addEventListener(\"change\", () => {\n console.log(\"Select changed \u2192 URL tag_equal is:\", getTagEqualFromURL());\n });\n }\n\n elements.forEach((el) => {\n el.addEventListener(\"click\", () => {\n console.log(\"konnect-filter-element clicked:\", el);\n const type = el.getAttribute(\"konnect-filter-element\");\n if (type === \"primary\") {\n setTimeout(updateMobileSelect, 100);\n const items = document.querySelectorAll<HTMLElement>(\n '[konnect-filter-element=\"secondary\"]'\n );\n items.forEach((el, index) => {\n if (index == 0) {\n el.click();\n el.setAttribute(\"konnect-filter-active\", \"true\");\n } else {\n el.setAttribute(\"konnect-filter-active\", \"false\");\n }\n });\n } else {\n setTimeout(updateSecondaryFilterTabs, 100);\n }\n });\n });\n});\n\nfunction updateSecondaryFilterTabs(): void {\n const raw = new URLSearchParams(window.location.search).get(\"nest-tag_equal\");\n const items = document.querySelectorAll<HTMLElement>(\n '[konnect-filter-element=\"secondary\"]'\n );\n if (!raw) {\n items.forEach((el, index) => {\n el.setAttribute(\"konnect-filter-active\", index == 0 ? \"true\" : \"false\");\n });\n return;\n }\n const target = raw.trim().toLowerCase();\n if (items.length === 0) return;\n\n items.forEach((el) => {\n const input = el.querySelector<HTMLInputElement>(\"[fs-list-value]\");\n if (!input) return;\n const valFromAttr = input\n .getAttribute(\"fs-list-value\")\n ?.trim()\n .toLowerCase();\n if (valFromAttr === target) {\n el.setAttribute(\"konnect-filter-active\", \"true\");\n items[0].setAttribute(\"konnect-filter-active\", \"false\");\n } else {\n el.setAttribute(\"konnect-filter-active\", \"false\");\n }\n });\n}\n\nfunction updateMobileSelect(): void {\n const raw = getTagEqualFromURL();\n const select = document.getElementById(\n \"konnect-filter\"\n ) as HTMLSelectElement | null;\n if (!select) {\n console.warn(\"Select element with id 'konnect-filter' not found.\");\n return;\n }\n\n if (raw) {\n const matchedOption = Array.from(select.options).find(\n (option) => option.value === raw\n );\n if (matchedOption) {\n select.value = raw;\n console.log(`Selected option: ${raw}`);\n toggleSecondaryFilter(raw);\n } else {\n console.warn(`No matching option found for value: ${raw}`);\n }\n } else {\n console.log(\"No 'tag_equal' parameter in URL.\");\n }\n}\n\nfunction updateMobileSelectOnLoad(): void {\n const raw = getTagEqualFromURL();\n const select = document.getElementById(\n \"konnect-filter\"\n ) as HTMLSelectElement | null;\n if (!select) {\n console.warn(\"Select element with id 'konnect-filter' not found.\");\n return;\n }\n\n if (raw) {\n const matchedOption = Array.from(select.options).find(\n (option) => option.value === raw\n );\n if (matchedOption) {\n select.value = raw;\n console.log(`Selected from URL param: ${raw}`);\n } else {\n console.warn(\n `No matching option found for value: ${raw}. Defaulting to Marketplaces.`\n );\n select.value = \"Marketplaces\";\n }\n } else {\n select.value = \"Marketplaces\";\n console.log(\"No tag_equal param found. Defaulted to Marketplaces.\");\n }\n}\n\nconst RULES = [\n { primary: \"Marketplaces\", show: [\"*\"] },\n { primary: \"Storefront\", show: [\"*\"] },\n { primary: \"OMS/WMS\", show: [\"All\"] },\n { primary: \"ERP/POS\", show: [\"All\"] },\n];\n\nfunction toggleSecondaryFilter(raw: string | null): void {\n const primary = (raw ?? \"\").trim().toLowerCase();\n\n const rule = RULES.find((r) => r.primary.toLowerCase() === primary);\n const allowed = rule ? rule.show : [];\n const showAll = allowed.includes(\"*\");\n const allowSet = new Set(allowed.map((v) => v.toLowerCase()));\n\n const hiddenFilters =\n document.querySelectorAll<HTMLElement>(\"[hidden-filter]\");\n if (!hiddenFilters) return;\n\n hiddenFilters.forEach((el) => {\n const tag = (el.getAttribute(\"hidden-filter\") ?? \"\").trim().toLowerCase();\n const visible = showAll || allowSet.has(tag);\n el.style.display = visible ? \"flex\" : \"none\";\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACTA,WAAS,cAAc,MAA6B;AAClD,UAAM,MAAM,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAI,IAAI;AAChE,WAAO,MAAM,IAAI,KAAK,IAAI;AAAA,EAC5B;AAEA,WAAS,qBAAoC;AAC3C,WAAO,cAAc,WAAW;AAAA,EAClC;AAIA,EAAC,OAAe,qBAAqB;AAErC,WAAS,iBAAiB,oBAAoB,MAAM;AAClD,YAAQ,IAAI,sCAAsC,iBAAiB;AACnE,UAAM,WAAW,SAAS;AAAA,MACxB;AAAA,IACF;AACA,QAAI,SAAS,WAAW,EAAG;AAC3B,eAAW,0BAA0B,GAAG;AAGxC,Q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live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "interface Solution {\n name: string;\n slug: string;\n id: string;\n}\
|
|
5
|
-
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;
|
|
4
|
+
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "interface Solution {\n name: string;\n slug: string;\n id: string;\n}\n\nconst solutions: Solution[] = [\n {\n name: \"Fynd PIM\",\n slug: \"/solutions/ai-pim\",\n id: \"bc50976c-a18e-467f-8e74-8bc7e6a1f247\",\n },\n {\n name: \"Catalog Cloud\",\n slug: \"/solutions/catalog-cloud\",\n id: \"bc051955-3ec9-4164-9a2f-097fa2d92279\",\n },\n {\n name: \"Fynd Platform\",\n slug: \"/solutions/storefront\",\n id: \"999c6e3a-5baa-4b1c-85b8-e57e67464069\",\n },\n {\n name: \"Fynd Engage\",\n slug: \"/solutions/engage\",\n id: \"c14d07f5-138a-4d9d-95d2-426dc0564f68\",\n },\n {\n name: \"Boltic\",\n slug: \"/solutions/workflow-automation\",\n id: \"40ec7873-ce38-4f0a-923b-1ebe96887d78\",\n },\n {\n name: \"TMS\",\n slug: \"/solutions/transport-management-system\",\n id: \"6fb171d2-612e-4919-b85b-187077171d35\",\n },\n {\n name: \"Copilot\",\n slug: \"/solutions/ai-agent-builder\",\n id: \"5f1dbe12-4a95-4d18-88f6-120ccead764d\",\n },\n];\n\nconst currentPath = window.location.pathname;\nconst currentSolution = solutions.find((sol) => sol.slug === currentPath);\n\nif (currentSolution) {\n const updateUrl = (href: string): string => {\n try {\n const url = new URL(href, window.location.origin);\n if (url.hostname.includes(\"console.fynd.com\")) {\n url.searchParams.set(\"client_id\", currentSolution.id);\n return url.toString();\n }\n } catch {\n // skip invalid URLs\n }\n return href;\n };\n\n // Update <a> tags\n const links = document.querySelectorAll<HTMLAnchorElement>(\n 'a[href*=\"console.fynd.com\"], a[href^=\"https://console.fynd.com/\"], a[href=\"https://console.fynd.com\"]'\n );\n\n links.forEach((link) => {\n if (link.getAttribute(\"update-console\") === \"false\") return;\n link.href = updateUrl(link.href);\n });\n\n // Update <button> elements\n const buttons = document.querySelectorAll<HTMLButtonElement>(\"button\");\n buttons.forEach((button) => {\n if (button.getAttribute(\"update-console\") === \"false\") return;\n\n const dataHref = button.getAttribute(\"data-href\");\n const onClick = button.getAttribute(\"onclick\");\n\n if (dataHref && dataHref.includes(\"console.fynd.com\")) {\n button.setAttribute(\"data-href\", updateUrl(dataHref));\n }\n\n if (onClick && onClick.includes(\"console.fynd.com\")) {\n const match = onClick.match(/https:\\/\\/console\\.fynd\\.com[^\\s'\"]*/);\n if (match) {\n const newOnClick = onClick.replace(match[0], updateUrl(match[0]));\n button.setAttribute(\"onclick\", newOnClick);\n }\n }\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACJA,MAAM,YAAwB;AAAA,IAC5B;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,IAAI;AAAA,IACN;AAAA,IACA;AA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AG;AACrD,eAAO,aAAa,aAAa,UAAU,QAAQ,CAAC;AAAA,MACtD;AAEA,UAAI,WAAW,QAAQ,SAAS,kBAAkB,GAAG;AACnD,cAAM,QAAQ,QAAQ,MAAM,sCAAsC;AAClE,YAAI,OAAO;AACT,gBAAM,aAAa,QAAQ,QAAQ,MAAM,CAAC,GAAG,UAAU,MAAM,CAAC,CAAC,CAAC;AAChE,iBAAO,aAAa,WAAW,UAAU;AAAA,QAC3C;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{let n=document.querySelector('[data-popup-contact="wrapper"]'),e=document.querySelector('[data-popup-contact="content"]'),o=document.querySelector('[data-popup-contact="overlay"]'),p=document.querySelectorAll('[data-popup-contact-trigger="open"]'),i=document.querySelectorAll('[data-popup-contact-trigger="close"]');n.style.display="none",o.style.opacity="0",e.style.opacity="0",e.style.transform="scale(0.95)";let c=document.createElement("style");c.id="contact-popup-style",c.textContent=`
|
|
2
|
+
.iti.iti--container {
|
|
3
|
+
z-index: 100000000000 !important;
|
|
4
|
+
}
|
|
5
|
+
@media (max-width: 768px) {
|
|
6
|
+
.iti.iti--container {
|
|
7
|
+
width: 320px !important;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
`;function s(){document.body.style.overflow="hidden"}function r(){document.body.style.overflow=""}function d(){document.getElementById("contact-popup-style")||document.head.appendChild(c)}function y(){let t=document.getElementById("contact-popup-style");t&&t.remove()}function l(){n.style.display="flex",s(),d(),requestAnimationFrame(()=>{o.style.transition="opacity 0.25s ease",e.style.transition="opacity 0.25s ease, transform 0.25s ease",o.style.opacity="1",e.style.opacity="1",e.style.transform="scale(1)"})}function a(){o.style.opacity="0",e.style.opacity="0",e.style.transform="scale(0.95)",setTimeout(()=>{n.style.display="none",r(),y()},250)}p.forEach(t=>t.addEventListener("click",l)),i.forEach(t=>t.addEventListener("click",a)),o.addEventListener("click",t=>{t.target===o&&a()}),window.openContactPopup=l,window.closeContactPopup=a});})();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../bin/live-reload.js", "../../src/global/contact-popup.ts"],
|
|
4
|
+
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "document.addEventListener(\"DOMContentLoaded\", () => {\n const wrapper = document.querySelector<HTMLElement>(\n '[data-popup-contact=\"wrapper\"]'\n )!;\n const content = document.querySelector<HTMLElement>(\n '[data-popup-contact=\"content\"]'\n )!;\n const overlay = document.querySelector<HTMLElement>(\n '[data-popup-contact=\"overlay\"]'\n )!;\n const openTriggers = document.querySelectorAll<HTMLElement>(\n '[data-popup-contact-trigger=\"open\"]'\n );\n const closeTriggers = document.querySelectorAll<HTMLElement>(\n '[data-popup-contact-trigger=\"close\"]'\n );\n\n // initial\n wrapper.style.display = \"none\";\n overlay.style.opacity = \"0\";\n content.style.opacity = \"0\";\n content.style.transform = \"scale(0.95)\";\n\n // add a dynamic style tag for .iti.iti--container when popup is open\n const popupStyle = document.createElement(\"style\");\n popupStyle.id = \"contact-popup-style\";\n popupStyle.textContent = `\n .iti.iti--container {\n z-index: 100000000000 !important;\n }\n @media (max-width: 768px) {\n .iti.iti--container {\n width: 320px !important;\n }\n }\n `;\n\n function lockScroll() {\n document.body.style.overflow = \"hidden\";\n }\n\n function unlockScroll() {\n document.body.style.overflow = \"\";\n }\n\n function addPopupStyle() {\n if (!document.getElementById(\"contact-popup-style\")) {\n document.head.appendChild(popupStyle);\n }\n }\n\n function removePopupStyle() {\n const existing = document.getElementById(\"contact-popup-style\");\n if (existing) existing.remove();\n }\n\n function openPopup() {\n wrapper.style.display = \"flex\";\n lockScroll();\n addPopupStyle();\n\n requestAnimationFrame(() => {\n overlay.style.transition = \"opacity 0.25s ease\";\n content.style.transition = \"opacity 0.25s ease, transform 0.25s ease\";\n overlay.style.opacity = \"1\";\n content.style.opacity = \"1\";\n content.style.transform = \"scale(1)\";\n });\n }\n\n function closePopup() {\n overlay.style.opacity = \"0\";\n content.style.opacity = \"0\";\n content.style.transform = \"scale(0.95)\";\n setTimeout(() => {\n wrapper.style.display = \"none\";\n unlockScroll();\n removePopupStyle();\n }, 250);\n }\n\n openTriggers.forEach((el) => el.addEventListener(\"click\", openPopup));\n closeTriggers.forEach((el) => el.addEventListener(\"click\", closePopup));\n overlay.addEventListener(\"click\", (e) => {\n if (e.target === overlay) closePopup();\n });\n\n (window as any).openContactPopup = openPopup;\n (window as any).closeContactPopup = closePopup;\n});\n"],
|
|
5
|
+
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACVA,WAAS,iBAAiB,oBAAoB,MAAM;AAClD,UAAM,UAAU,SAAS;AAAA,MACvB;AAAA,IACF;AACA,UAAM,UAAU,SAAS;AAAA,MACvB;AAAA,IACF;AACA,UAAM,UAAU,SAAS;AAAA,MACvB;AAAA,IACF;AACA,UAAM,eAAe,SAAS;AAAA,MAC5B;AAAA,IACF;AACA,UAAM,gBAAgB,SAAS;AAAA,MAC7B;AAAA,IACF;AAGA,YAAQ,MAAM,UAAU;AACxB,YAAQ,MAAM,UAAU;AACxB,YAAQ,MAAM,UAAU;AACxB,YAAQ,MAAM,YAAY;AAG1B,UAAM,aAAa,SAAS,cAAc,OAAO;AACjD,eAAW,KAAK;AAChB,eAAW,cAAc;AAAA;AAAA;AAAA;A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3
|
"sources": ["../../bin/live-reload.js", "../../src/global/geolocation/main.ts", "../../src/global/geolocation/geolocation-cached.ts", "../../src/global/animation/toggle-banner.ts", "../../src/utils/cookies.ts", "../../src/global/screen-type.ts", "../../src/navigation/country-detection/main.ts", "../../src/navigation/initialization.ts"],
|
|
4
|
-
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// Define the type for returned geolocation data\n// Remider for adding Fallback: ipinfo.io (HTTPS, requires token)\nexport type GeoData = {\n ip: string;\n country: string;\n region: string;\n city: string;\n latitude: number;\n longitude: number;\n isp: string;\n timezone: string;\n };\n \n // Exported function that can be reused anywhere\n export async function getGeolocation(): Promise<GeoData | null> {\n try {\n const response = await fetch(\"https://ipwho.is/\");\n if (!response.ok) {\n throw new Error(\"Failed to fetch geolocation\");\n }\n \n const data = await response.json();\n \n if (data.success === false) {\n console.error(\"Geolocation lookup failed:\", data.message);\n return null;\n }\n \n return {\n ip: data.ip,\n country: data.country,\n region: data.region,\n city: data.city,\n latitude: data.latitude,\n longitude: data.longitude,\n isp: data.connection?.isp || \"\",\n timezone: data.timezone?.id || \"\"\n };\n } catch (error) {\n console.error(\"Error fetching geolocation:\", error);\n return null;\n }\n }\n\n //used in /src/navigation/initialization.ts for displaying ip banner", "import { GeoData, getGeolocation } from \"./main\";\n\nconst GEO_CACHE_KEY = \"geo:data:v1\";\nconst GEO_COOKIE_KEY = \"geo_country\";\nconst GEO_TTL_MS = 7 * 24 * 60 * 60 * 1000; // 7 days\n\ntype Cached<T> = { data: T; expiresAt: number };\n\n// --- Cookie helpers ---\nfunction setCookie(name: string, value: string, maxAgeSec: number) {\n document.cookie = `${encodeURIComponent(name)}=${encodeURIComponent(\n value\n )}; Max-Age=${maxAgeSec}; Path=/; SameSite=Lax; Secure`;\n}\n\nfunction getCookie(name: string): string | null {\n const key = `${encodeURIComponent(name)}=`;\n const parts = document.cookie.split(\"; \");\n for (const p of parts) {\n if (p.startsWith(key)) return decodeURIComponent(p.slice(key.length));\n }\n return null;\n}\n\nfunction clearCookie(name: string) {\n document.cookie = `${encodeURIComponent(\n name\n )}=; Max-Age=0; Path=/; SameSite=Lax; Secure`;\n}\n\n// --- LocalStorage helpers ---\nfunction readCache<T>(key: string): T | null {\n try {\n const raw = localStorage.getItem(key);\n if (!raw) return null;\n const parsed = JSON.parse(raw) as Cached<T>;\n if (!parsed?.expiresAt || Date.now() > parsed.expiresAt) {\n localStorage.removeItem(key);\n return null;\n }\n return parsed.data;\n } catch {\n localStorage.removeItem(key);\n return null;\n }\n}\n\nfunction writeCache<T>(key: string, data: T, ttlMs: number) {\n const payload: Cached<T> = { data, expiresAt: Date.now() + ttlMs };\n try {\n localStorage.setItem(key, JSON.stringify(payload));\n } catch {\n // ignore quota errors\n }\n}\n\n// --- Public API ---\nexport async function getGeolocationCached(options?: {\n forceRefresh?: boolean;\n}): Promise<GeoData | null> {\n if (typeof window === \"undefined\") return null;\n\n const forceRefresh = options?.forceRefresh ?? false;\n\n if (!forceRefresh) {\n const cached = readCache<GeoData>(GEO_CACHE_KEY);\n if (cached) {\n (window as any).__GEO = cached;\n if (!getCookie(GEO_COOKIE_KEY)) {\n setCookie(\n GEO_COOKIE_KEY,\n cached.country ?? \"\",\n Math.floor(GEO_TTL_MS / 1000)\n );\n }\n return cached;\n }\n }\n\n // \u2B07\uFE0F changed block starts here\n let geo: GeoData | null = null;\n try {\n geo = await getGeolocation();\n } catch (e) {\n console.warn(\"getGeolocation() failed; defaulting to India:\", e);\n }\n\n if (!geo) {\n // Fallback to India if the fetch failed or returned invalid data\n geo = { country: \"India\" } as GeoData;\n }\n\n writeCache(GEO_CACHE_KEY, geo, GEO_TTL_MS);\n setCookie(GEO_COOKIE_KEY, geo.country ?? \"\", Math.floor(GEO_TTL_MS / 1000));\n (window as any).__GEO = geo;\n return geo;\n // \u2B06\uFE0F changed block ends here\n}\n\nexport function getGeoCountryFromCookie(): string | null {\n return getCookie(GEO_COOKIE_KEY);\n}\n\nexport function clearGeolocationCache() {\n try {\n localStorage.removeItem(GEO_CACHE_KEY);\n } catch {}\n clearCookie(GEO_COOKIE_KEY);\n if (typeof window !== \"undefined\") {\n (window as any).__GEO = undefined;\n }\n}\n", "// toggleBanner.ts\n// Utility functions to open/close a banner using GSAP with optional target height.\n\nexport function openBanner(\n mainSelector: string,\n innerSelector: string,\n targetHeight: string | number = \"auto\" // default stays \"auto\"\n) {\n const w = (window as any) || {};\n const gsap = w.gsap as any;\n if (!gsap) {\n console.warn(\"GSAP not found on window. Did you include it globally?\");\n return;\n }\n\n const mainEl = document.querySelector<HTMLElement>(mainSelector);\n const innerEl = document.querySelector<HTMLElement>(innerSelector);\n\n if (!mainEl || !innerEl) {\n console.warn(\"openBanner: Element(s) not found for selectors:\", {\n mainSelector,\n innerSelector,\n });\n return;\n }\n\n // Ensure clean start\n gsap.set(mainEl, { height: 0, overflow: \"hidden\" });\n gsap.set(innerEl, { opacity: 0 });\n\n const tl = gsap.timeline();\n\n // Animate main from height: 0 -> targetHeight\n tl.to(mainEl, {\n height: targetHeight,\n duration: 0.5,\n ease: \"power2.out\",\n });\n\n // After 0.2s, fade inner to 1\n tl.to(\n innerEl,\n {\n opacity: 1,\n duration: 0.3,\n ease: \"power1.out\",\n },\n 0.2\n );\n\n return tl;\n}\n\nexport function closeBanner(\n mainSelector: string,\n innerSelector: string,\n targetHeight: string | number = 0 // default collapse fully\n) {\n const w = (window as any) || {};\n const gsap = w.gsap as any;\n if (!gsap) {\n console.warn(\"GSAP not found on window. Did you include it globally?\");\n return;\n }\n\n const mainEl = document.querySelector<HTMLElement>(mainSelector);\n const innerEl = document.querySelector<HTMLElement>(innerSelector);\n\n if (!mainEl || !innerEl) {\n console.warn(\"closeBanner: Element(s) not found for selectors:\", {\n mainSelector,\n innerSelector,\n });\n return;\n }\n\n gsap.set(mainEl, { overflow: \"hidden\" });\n\n const tl = gsap.timeline();\n\n // Fade inner out\n tl.to(innerEl, {\n opacity: 0,\n duration: 0.25,\n ease: \"power1.out\",\n });\n\n // Collapse height to targetHeight (default 0)\n tl.to(\n mainEl,\n {\n height: targetHeight,\n duration: 0.45,\n ease: \"power2.inOut\",\n },\n 0.2\n );\n\n return tl;\n}", "export function setCookie(name: string, value: string, hours: number) {\n const date = new Date();\n date.setTime(date.getTime() + hours * 60 * 60 * 1000);\n document.cookie = `${name}=${value}; expires=${date.toUTCString()}; path=/`;\n }\n \n export function getCookie(name: string): string | null {\n const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));\n return match ? match[2] : null;\n }", "// screen-type.ts\n// Utility to get the current screen type\n// Breakpoints:\n// - Desktop: 992px+\n// - Tablet: 768px\u2013991px\n// - Mobile Landscape: 480px\u2013767px\n// - Mobile Portrait: under 480px\n\nexport type ScreenType = \"desktop\" | \"tablet\" | \"mobileLandscape\" | \"mobilePortrait\";\n\nexport function getScreenType(): ScreenType {\n const width = window.innerWidth;\n\n if (width >= 992) {\n return \"desktop\";\n } else if (width >= 768) {\n return \"tablet\";\n } else if (width >= 480) {\n return \"mobileLandscape\";\n } else {\n return \"mobilePortrait\";\n }\n}", "// geo.ts\nimport { getGeoCountryFromCookie, getGeolocationCached } from \"src/global/geolocation/geolocation-cached\";\nimport { GeoData } from \"src/global/geolocation/main\";\n\n/** Your banner config */\ntype CountryConfig = {\n country: string; // canonical lowercase name\n countryCode: string; // ISO-2 lowercase code (e.g., \"in\")\n url: string; // leading-slash path (e.g., \"/in\")\n tagline: string; // banner text/html\n aliases?: string[]; // optional extra names to match against\n};\n\nexport const COUNTRY_CONFIG: CountryConfig[] = [\n {\n country: \"united arab emirates\",\n aliases: [\"uae\", \"u.a.e\", \"united arab emirates\"],\n countryCode: \"ae\",\n url: \"/ae\",\n tagline: \"You're in the UAE. Welcome!\"\n },\n {\n country: \"saudi arabia\",\n aliases: [\"saudi\", \"ksa\", \"kingdom of saudi arabia\"],\n countryCode: \"sa\",\n url: \"/sa\",\n tagline: \"Hello Saudi Arabia!\"\n },\n {\n country: \"south africa\",\n aliases: [\"rsa\"],\n countryCode: \"za\",\n url: \"/za\",\n tagline: \"Hi South Africa!\"\n },\n {\n country: \"malaysia\",\n countryCode: \"my\",\n url: \"/my\",\n tagline: \"Selamat datang, Malaysia!\"\n },\n {\n country: \"indonesia\",\n aliases: [\"idn\"],\n countryCode: \"id\",\n url: \"/id\",\n tagline: \"Halo Indonesia!\"\n },\n {\n country: \"philippines\",\n aliases: [\"phl\", \"the philippines\"],\n countryCode: \"ph\",\n url: \"/ph\",\n tagline: \"Kumusta, Philippines!\"\n },\n {\n country: \"india\",\n aliases: [\"bharat\"],\n countryCode: \"in\",\n url: \"/in\",\n tagline: \"This country is India. Hi some text\"\n },\n // \uD83D\uDC47 fallback\n {\n country: \"global\",\n aliases: [\"global\", \"rest of world\", \"others\"],\n countryCode: \"global\", // keep lowercase for consistency\n url: \"/global\",\n tagline: \"This is rest of world. Hi some text\"\n }\n];\n\n/** Utility: normalize strings for comparisons */\nfunction norm(s: string | null | undefined): string {\n return (s ?? \"\").trim().toLowerCase();\n}\n\n/** Utility: ensure URL starts with a single leading slash */\nfunction toPath(path: string): string {\n const p = path.trim();\n if (!p) return \"/\";\n return p.startsWith(\"/\") ? p : `/${p}`;\n}\n\n/** Determine user's country as a *string* (might be name or code depending on your geo source) */\nexport async function getUserCountry(): Promise<string | null> {\n if (typeof window === \"undefined\") return null;\n\n // 1) Cookie fast-path\n const cookieCountry = getGeoCountryFromCookie();\n if (cookieCountry) return norm(cookieCountry);\n\n // 2) Cached or network\n const geo: GeoData | null = await getGeolocationCached();\n return norm((geo as any)?.country);\n}\n\n/** Find matching config by country *name* or *ISO-2 code* with aliases */\nfunction findCountryConfig(input: string | null): CountryConfig | null {\n const v = norm(input);\n if (!v) return null;\n\n const byCode = COUNTRY_CONFIG.find(c => norm(c.countryCode) === v);\n if (byCode) return byCode;\n\n const byName = COUNTRY_CONFIG.find(c => norm(c.country) === v);\n if (byName) return byName;\n\n const byAlias = COUNTRY_CONFIG.find(c => (c.aliases ?? []).some(a => norm(a) === v));\n if (byAlias) return byAlias;\n\n return null;\n}\n\n/** Helper to fetch the global config */\nfunction getGlobalConfig(): CountryConfig {\n const g = COUNTRY_CONFIG.find(c => c.country === \"global\");\n if (!g) throw new Error(\"[geo-banner] Global config not found in COUNTRY_CONFIG\");\n return g;\n}\n\nfunction updateBannerLink(countryCode?: string | null): void {\n if (typeof window === \"undefined\") return;\n\n const code = norm(countryCode);\n const conf =\n COUNTRY_CONFIG.find(c => norm(c.countryCode) === code) ||\n getGlobalConfig();\n\n const linkEl = document.querySelector<HTMLAnchorElement>('[fynd-banner-field=\"link\"]');\n if (linkEl) {\n const base = window.location.origin;\n linkEl.href = `${base}${toPath(conf.url)}`;\n }\n}\n\nexport function setSelectValueSafely(selectEl: HTMLSelectElement, desired: string) {\n // 1) resolve config\n const conf =\n findCountryConfig(desired) ??\n COUNTRY_CONFIG.find(c => c.country === \"global\");\n if (!conf) {\n console.warn(\"[geo-banner] No matching config for\", desired);\n return false;\n }\n const desiredCode = conf.countryCode; // assume already normalized/lowercase\n\n // 2) find matching option (normalize both sides)\n const opts = Array.from(selectEl.options);\n const opt = opts.find(o => norm(o.value) === norm(desiredCode));\n if (!opt) {\n console.warn(\"[geo-banner] No matching <option> for\", desiredCode, \"on\", selectEl);\n return false;\n }\n\n // 3) update the <select> itself (more reliable than toggling option.selected)\n const prev = selectEl.value;\n selectEl.value = opt.value;\n\n // if some browsers/frameworks didn\u2019t adopt .value, force selectedIndex too\n if (selectEl.value !== opt.value) {\n selectEl.selectedIndex = opts.indexOf(opt);\n }\n\n // 4) (optional) keep options\u2019 selected flags in sync\n opts.forEach(o => (o.selected = o === opt));\n\n // 5) fire events frameworks listen to\n if (prev !== selectEl.value) {\n selectEl.dispatchEvent(new Event(\"input\", { bubbles: true }));\n selectEl.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n\n console.log(\"[geo-banner] Select updated \u2192\", conf.country, \"(\", conf.countryCode, \")\");\n return true;\n}\n\n/** Update the banner content for a given countryCode (lowercase ISO-2) with global fallback */\nexport function updateBannerContent(countryCode?: string | null): void {\n if (typeof window === \"undefined\") return;\n\n const code = norm(countryCode);\n const conf =\n COUNTRY_CONFIG.find(c => norm(c.countryCode) === code) ||\n getGlobalConfig();\n // 1) Set <select fynd-banner-field=\"geoswitch\"> value (robustly)\n const selectEl =\n document.querySelector<HTMLSelectElement>('#geoswitch-select') ||\n document.querySelector<HTMLSelectElement>('[fynd-banner-field=\"geoswitch\"]');\n\n if (selectEl) {\n console.log(`country code is ${conf.countryCode}`)\n setSelectValueSafely(selectEl, conf.countryCode);\n selectEl.value = conf.countryCode; // or \"global\", etc.\n\n selectEl.dispatchEvent(new Event(\"change\", { bubbles: true }));\n } else {\n console.warn('[geo-banner] Select not found: #geoswitch-select / [fynd-banner-field=\"geoswitch\"]');\n }\n\n // // 2) Update banner text (unchanged)\n // const textEl = document.querySelector<HTMLElement>('[fynd-banner-field=\"banner-text\"]');\n // if (textEl) textEl.innerHTML = conf.tagline;\n\n // 3) Update link href (unchanged)\n const linkEl = document.querySelector<HTMLAnchorElement>('[fynd-banner-field=\"link\"]');\n if (linkEl) {\n const base = window.location.origin;\n linkEl.href = `${base}${toPath(conf.url)}`;\n }\n}\n\n/**\n * Main entry: detect country and update banner if it matches one of the configured countries.\n * Always falls back to global if no match is found.\n */\nexport async function initCountryDetection(): Promise<CountryConfig> {\n if (typeof window === \"undefined\") return getGlobalConfig();\n\n if (document.readyState === \"loading\") {\n await new Promise<void>(resolve => {\n document.addEventListener(\"DOMContentLoaded\", () => resolve(), { once: true });\n });\n }\n\n const rawCountry = await getUserCountry();\n const match = findCountryConfig(rawCountry);\n const resolved = match ?? getGlobalConfig();\n\n // Debug visibility\n console.log(\"[geo-banner] rawCountry:\", rawCountry, \"\u2192 resolved:\", resolved.countryCode);\n\n // \u2705 Always update from the resolved config (guarantees global fallback)\n updateBannerContent(resolved.countryCode);\n\n // (If you also attached the select change listener, keep that here)\n const selectEl = document.querySelector<HTMLSelectElement>('[fynd-banner-field=\"geoswitch\"]');\n if (selectEl && !(selectEl as any).__geoHandlerAttached) {\n selectEl.addEventListener(\"change\", (e) => {\n const value = (e.target as HTMLSelectElement).value;\n updateBannerLink(value); // only updates href on change\n });\n (selectEl as any).__geoHandlerAttached = true;\n }\n\n return resolved;\n}", "import { getGeolocationCached } from \"src/global/geolocation/geolocation-cached\";\nimport { closeBanner, openBanner } from \"src/global/animation/toggle-banner\";\nimport { getCookie, setCookie } from \"$utils/cookies\";\nimport { getScreenType } from \"src/global/screen-type\";\nimport { initCountryDetection } from \"./country-detection/main\";\n\n/**\n * Banner rules by route (normalized, no trailing slash).\n * Modes:\n * - { mode: \"always\" }\n * - { mode: \"country\", countries: [...] } \u2192 open if geo.country matches (case-insensitive)\n * - { mode: \"notCountry\", countries: [...] } \u2192 open if geo.country does NOT match\n * - { mode: \"predicate\", test: (geo) => boolean }\n */\nconst bannerRouteRules: Record<\n string,\n | { mode: \"always\" }\n | { mode: \"country\"; countries: string[] }\n | { mode: \"notCountry\"; countries: string[] }\n | { mode: \"predicate\"; test: (geo?: any) => boolean }\n> = {\n \"/global\": { mode: \"country\", countries: [\"India\"] },\n \"/\": { mode: \"notCountry\", countries: [\"India\"] },\n};\n\n// Elements\nconst ipBannerMain = '[fynd-navigation=\"ip-banner\"]';\nconst ipBannerInner = '[fynd-navigation=\"ip-banner-inner\"]';\nconst closeIpBanner = '[fynd-navigation=\"ip-banner-close\"]';\n\nconst announcementBar = document.querySelector(\n '[fynd-navigation=\"announcement-bar\"]'\n);\nconst announcementList = document.querySelector(\n '[fynd-navigation=\"announcement-list\"]'\n);\n\n// Global navigation state\nconst navigationData = {\n ipbanner: {\n visibility: false,\n height: {\n desktop: \"56px\",\n tablet: \"60px\",\n mobileLandscape: \"120px\",\n mobilePortrait: \"120px\",\n },\n },\n announcementbar: {\n visibility: true,\n height: {\n desktop: \"40px\",\n tablet: \"40px\",\n mobileLandscape: \"40px\",\n mobilePortrait: \"46px\",\n },\n },\n default: {\n visibility: true,\n height: {\n desktop: \"70px\",\n tablet: \"64px\",\n mobileLandscape: \"40px\",\n mobilePortrait: \"64px\",\n },\n },\n};\n(window as any).navigationData = navigationData;\n\n// --- Utils -------------------------------------------------------------------\n\nfunction addPx(a: string | number, b: string | number): string {\n const toNumber = (val: string | number): number => {\n if (typeof val === \"number\") return val;\n const num = parseInt(val, 10);\n return isNaN(num) ? 0 : num;\n };\n return `${toNumber(a) + toNumber(b)}px`;\n}\n\nfunction subtractPx(a: string | number, b: string | number): string {\n const toNumber = (val: string | number): number => {\n if (typeof val === \"number\") return val;\n const num = parseInt(val, 10);\n return isNaN(num) ? 0 : num;\n };\n return `${toNumber(a) - toNumber(b)}px`;\n}\n\nconst normalizePath = (p: string) => {\n try {\n const urlPath = p.split(\"?\")[0].split(\"#\")[0];\n if (urlPath === \"/\") return \"/\";\n return urlPath.replace(/\\/+$/, \"\") || \"/\";\n } catch {\n return \"/\";\n }\n};\n\n// Longest-prefix match, so \"/india/offers\" matches \"/india\"\nfunction getMatchingRule(pathname: string) {\n const path = normalizePath(pathname);\n let bestKey = \"\";\n for (const key of Object.keys(bannerRouteRules)) {\n const normKey = normalizePath(key);\n if (path === normKey || path.startsWith(normKey + \"/\")) {\n if (normKey.length > bestKey.length) bestKey = normKey;\n }\n }\n return bestKey ? { key: bestKey, rule: bannerRouteRules[bestKey] } : null;\n}\n\nfunction shouldOpenBannerForPage(pathname: string, geo?: { country?: string }) {\n const match = getMatchingRule(pathname);\n if (!match) return false;\n\n const { rule } = match;\n const visitorCountry = (geo?.country || \"\").toLowerCase();\n\n switch (rule.mode) {\n case \"always\":\n return true;\n case \"country\":\n return rule.countries.some((c) => c.toLowerCase() === visitorCountry);\n case \"notCountry\":\n return !rule.countries.some((c) => c.toLowerCase() === visitorCountry);\n case \"predicate\":\n return !!rule.test?.(geo);\n default:\n return false;\n }\n}\n\n// --- Announcement Bar --------------------------------------------------------\n\nfunction initAnnouncementBar() {\n const swiperEl = document.querySelector<HTMLElement>(\n '[fynd-navigation=\"announcement-swiper\"]'\n );\n\n // Initialize swiper if present\n if (swiperEl && !(swiperEl as any).__swiperInstance) {\n try {\n const Swiper = (window as any).Swiper;\n const swiper = new Swiper(swiperEl, {\n slidesPerView: 1,\n spaceBetween: 0,\n effect: \"fade\",\n fadeEffect: { crossFade: true },\n autoplay: { delay: 3000, disableOnInteraction: false },\n loop: true,\n speed: 1000,\n allowTouchMove: false,\n on: {\n init: function (this: any): void {\n if (\n this.slides.length <= 1 &&\n this.autoplay &&\n typeof this.autoplay.stop === \"function\"\n ) {\n this.autoplay.stop();\n }\n },\n },\n });\n (swiperEl as any).__swiperInstance = swiper;\n } catch (err) {\n console.warn(\"Announcement Swiper init failed:\", err);\n }\n }\n\n // // Visibility & cleanup\n // if (announcementBar && announcementList && announcementList.children.length > 0) {\n // navigationData.announcementbar.visibility = true;\n // } else {\n // navigationData.announcementbar.visibility = false;\n // if (announcementBar && announcementBar.parentNode) {\n // if (swiperEl && (swiperEl as any).__swiperInstance) {\n // (swiperEl as any).__swiperInstance.destroy(true, true);\n // (swiperEl as any).__swiperInstance = undefined;\n // }\n // announcementBar.parentNode.removeChild(announcementBar);\n // }\n // }\n}\n\n// --- Desktop Dropdown Positioning -------------------------------------------\n\nfunction initDesktopDropdownMenu() {\n const selector = '[fynd-navigation=\"dropdown-container\"]';\n const el = document.querySelector<HTMLElement>(selector);\n if (!el) {\n console.warn(`initDesktopDropdownMenu: element not found: ${selector}`);\n return;\n }\n\n const screenType = getScreenType?.() ?? \"unknown\";\n\n // Not desktop \u2192 reset transform\n if (screenType !== \"desktop\") {\n el.style.transition = el.style.transition || \"transform 0.3s ease\";\n el.style.transform = \"translateY(0px)\";\n return;\n }\n\n // Compute total stacked height\n let total = navigationData.default.height?.[screenType];\n let subtractFlag = false;\n\n if (navigationData.announcementbar?.visibility) {\n const h = navigationData.announcementbar.height?.[screenType];\n total = addPx(total, h);\n total = subtractPx(total, \"46px\");\n subtractFlag = true;\n }\n\n if (navigationData.ipbanner?.visibility) {\n // Currently not offsetting desktop for IP banner\n const h = \"0px\";\n total = addPx(total, h);\n if (!subtractFlag) {\n total = subtractPx(total, \"46px\");\n }\n }\n\n // Offset dropdown under nav (minus header overlap 46px)\n el.style.transform = `translateY(${total})`;\n}\n\n// --- Dynamic Spacer ----------------------------------------------------------\n\nfunction initNavigationSpacer() {\n const spacer = document.querySelector<HTMLElement>(\n '[fynd-navigation=\"spacer\"][data-wf--navigation-spacer--variant=\"dynamic\"]'\n );\n\n if (!spacer) {\n console.warn(\"initNavigationSpacer: spacer element not found\");\n return;\n }\n\n const toPx = (v?: string | number): number => {\n if (typeof v === \"number\") return v;\n if (typeof v === \"string\") {\n const n = parseFloat(v);\n return Number.isFinite(n) ? n : 0;\n }\n return 0;\n };\n\n const screenType = getScreenType?.() ?? \"desktop\";\n let total = navigationData.default.height?.[screenType];\n\n if (navigationData.announcementbar?.visibility) {\n const h = navigationData.announcementbar.height?.[screenType];\n total = addPx(total, h);\n }\n\n if (navigationData.ipbanner?.visibility) {\n const h = toPx(navigationData.ipbanner.height?.[screenType]);\n total = addPx(total, h);\n }\n\n spacer.style.height = `${total}`;\n}\n\n// --- IP Banner ---------------------------------------------------------------\n\nasync function initIpBanner() {\n const ipClosed = getCookie(\"ipBannerClosed\") === \"true\";\n if (ipClosed) {\n navigationData.ipbanner.visibility = false;\n return;\n }\n\n const geo = await getGeolocationCached();\n const path = window.location.pathname || \"/\";\n const allowByRoute = shouldOpenBannerForPage(path, geo ?? undefined);\n\n const countryReady = await initCountryDetection();\n\n if (allowByRoute && countryReady) {\n openBanner(\n ipBannerMain,\n ipBannerInner,\n navigationData.ipbanner.height.desktop\n );\n navigationData.ipbanner.visibility = true;\n\n const closeBtn = document.querySelector<HTMLElement>(closeIpBanner);\n if (closeBtn) {\n closeBtn.addEventListener(\"click\", () => {\n closeBanner(ipBannerMain, ipBannerInner);\n setCookie(\"ipBannerClosed\", \"true\", 24);\n navigationData.ipbanner.visibility = false;\n initDesktopDropdownMenu();\n initNavigationSpacer();\n });\n }\n } else {\n navigationData.ipbanner.visibility = false;\n }\n}\n\n// --- Init --------------------------------------------------------------------\n\ndocument.addEventListener(\"DOMContentLoaded\", async () => {\n await initIpBanner();\n initAnnouncementBar();\n initDesktopDropdownMenu();\n initNavigationSpacer();\n});\n"],
|
|
4
|
+
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// Define the type for returned geolocation data\n// Remider for adding Fallback: ipinfo.io (HTTPS, requires token)\nexport type GeoData = {\n ip: string;\n country: string;\n region: string;\n city: string;\n latitude: number;\n longitude: number;\n isp: string;\n timezone: string;\n };\n \n // Exported function that can be reused anywhere\n export async function getGeolocation(): Promise<GeoData | null> {\n try {\n const response = await fetch(\"https://ipwho.is/\");\n if (!response.ok) {\n throw new Error(\"Failed to fetch geolocation\");\n }\n \n const data = await response.json();\n \n if (data.success === false) {\n console.error(\"Geolocation lookup failed:\", data.message);\n return null;\n }\n \n return {\n ip: data.ip,\n country: data.country,\n region: data.region,\n city: data.city,\n latitude: data.latitude,\n longitude: data.longitude,\n isp: data.connection?.isp || \"\",\n timezone: data.timezone?.id || \"\"\n };\n } catch (error) {\n console.error(\"Error fetching geolocation:\", error);\n return null;\n }\n }\n\n //used in /src/navigation/initialization.ts for displaying ip banner", "import { GeoData, getGeolocation } from \"./main\";\n\nconst GEO_CACHE_KEY = \"geo:data:v1\";\nconst GEO_COOKIE_KEY = \"geo_country\";\nconst GEO_TTL_MS = 7 * 24 * 60 * 60 * 1000; // 7 days\n\ntype Cached<T> = { data: T; expiresAt: number };\n\n// --- Cookie helpers ---\nfunction setCookie(name: string, value: string, maxAgeSec: number) {\n document.cookie = `${encodeURIComponent(name)}=${encodeURIComponent(\n value\n )}; Max-Age=${maxAgeSec}; Path=/; SameSite=Lax; Secure`;\n}\n\nfunction getCookie(name: string): string | null {\n const key = `${encodeURIComponent(name)}=`;\n const parts = document.cookie.split(\"; \");\n for (const p of parts) {\n if (p.startsWith(key)) return decodeURIComponent(p.slice(key.length));\n }\n return null;\n}\n\nfunction clearCookie(name: string) {\n document.cookie = `${encodeURIComponent(\n name\n )}=; Max-Age=0; Path=/; SameSite=Lax; Secure`;\n}\n\n// --- LocalStorage helpers ---\nfunction readCache<T>(key: string): T | null {\n try {\n const raw = localStorage.getItem(key);\n if (!raw) return null;\n const parsed = JSON.parse(raw) as Cached<T>;\n if (!parsed?.expiresAt || Date.now() > parsed.expiresAt) {\n localStorage.removeItem(key);\n return null;\n }\n return parsed.data;\n } catch {\n localStorage.removeItem(key);\n return null;\n }\n}\n\nfunction writeCache<T>(key: string, data: T, ttlMs: number) {\n const payload: Cached<T> = { data, expiresAt: Date.now() + ttlMs };\n try {\n localStorage.setItem(key, JSON.stringify(payload));\n } catch {\n // ignore quota errors\n }\n}\n\n// --- Public API ---\nexport async function getGeolocationCached(options?: {\n forceRefresh?: boolean;\n}): Promise<GeoData | null> {\n if (typeof window === \"undefined\") return null;\n\n const forceRefresh = options?.forceRefresh ?? false;\n\n if (!forceRefresh) {\n const cached = readCache<GeoData>(GEO_CACHE_KEY);\n if (cached) {\n (window as any).__GEO = cached;\n if (!getCookie(GEO_COOKIE_KEY)) {\n setCookie(\n GEO_COOKIE_KEY,\n cached.country ?? \"\",\n Math.floor(GEO_TTL_MS / 1000)\n );\n }\n return cached;\n }\n }\n\n // \u2B07\uFE0F changed block starts here\n let geo: GeoData | null = null;\n try {\n geo = await getGeolocation();\n } catch (e) {\n console.warn(\"getGeolocation() failed; defaulting to India:\", e);\n }\n\n if (!geo) {\n // Fallback to India if the fetch failed or returned invalid data\n geo = { country: \"India\" } as GeoData;\n }\n\n writeCache(GEO_CACHE_KEY, geo, GEO_TTL_MS);\n setCookie(GEO_COOKIE_KEY, geo.country ?? \"\", Math.floor(GEO_TTL_MS / 1000));\n (window as any).__GEO = geo;\n return geo;\n // \u2B06\uFE0F changed block ends here\n}\n\nexport function getGeoCountryFromCookie(): string | null {\n return getCookie(GEO_COOKIE_KEY);\n}\n\nexport function clearGeolocationCache() {\n try {\n localStorage.removeItem(GEO_CACHE_KEY);\n } catch {}\n clearCookie(GEO_COOKIE_KEY);\n if (typeof window !== \"undefined\") {\n (window as any).__GEO = undefined;\n }\n}\n", "// toggleBanner.ts\n// Utility functions to open/close a banner using GSAP with optional target height.\n\nexport function openBanner(\n mainSelector: string,\n innerSelector: string,\n targetHeight: string | number = \"auto\" // default stays \"auto\"\n) {\n const w = (window as any) || {};\n const gsap = w.gsap as any;\n if (!gsap) {\n console.warn(\"GSAP not found on window. Did you include it globally?\");\n return;\n }\n\n const mainEl = document.querySelector<HTMLElement>(mainSelector);\n const innerEl = document.querySelector<HTMLElement>(innerSelector);\n\n if (!mainEl || !innerEl) {\n console.warn(\"openBanner: Element(s) not found for selectors:\", {\n mainSelector,\n innerSelector,\n });\n return;\n }\n\n // Ensure clean start\n gsap.set(mainEl, { height: 0, overflow: \"hidden\" });\n gsap.set(innerEl, { opacity: 0 });\n\n const tl = gsap.timeline();\n\n // Animate main from height: 0 -> targetHeight\n tl.to(mainEl, {\n height: targetHeight,\n duration: 0.5,\n ease: \"power2.out\",\n });\n\n // After 0.2s, fade inner to 1\n tl.to(\n innerEl,\n {\n opacity: 1,\n duration: 0.3,\n ease: \"power1.out\",\n },\n 0.2\n );\n\n return tl;\n}\n\nexport function closeBanner(\n mainSelector: string,\n innerSelector: string,\n targetHeight: string | number = 0 // default collapse fully\n) {\n const w = (window as any) || {};\n const gsap = w.gsap as any;\n if (!gsap) {\n console.warn(\"GSAP not found on window. Did you include it globally?\");\n return;\n }\n\n const mainEl = document.querySelector<HTMLElement>(mainSelector);\n const innerEl = document.querySelector<HTMLElement>(innerSelector);\n\n if (!mainEl || !innerEl) {\n console.warn(\"closeBanner: Element(s) not found for selectors:\", {\n mainSelector,\n innerSelector,\n });\n return;\n }\n\n gsap.set(mainEl, { overflow: \"hidden\" });\n\n const tl = gsap.timeline();\n\n // Fade inner out\n tl.to(innerEl, {\n opacity: 0,\n duration: 0.25,\n ease: \"power1.out\",\n });\n\n // Collapse height to targetHeight (default 0)\n tl.to(\n mainEl,\n {\n height: targetHeight,\n duration: 0.45,\n ease: \"power2.inOut\",\n },\n 0.2\n );\n\n return tl;\n}", "export function setCookie(name: string, value: string, hours: number) {\n const date = new Date();\n date.setTime(date.getTime() + hours * 60 * 60 * 1000);\n document.cookie = `${name}=${value}; expires=${date.toUTCString()}; path=/`;\n }\n \n export function getCookie(name: string): string | null {\n const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));\n return match ? match[2] : null;\n }", "// screen-type.ts\n// Utility to get the current screen type\n// Breakpoints:\n// - Desktop: 992px+\n// - Tablet: 768px\u2013991px\n// - Mobile Landscape: 480px\u2013767px\n// - Mobile Portrait: under 480px\n\nexport type ScreenType = \"desktop\" | \"tablet\" | \"mobileLandscape\" | \"mobilePortrait\";\n\nexport function getScreenType(): ScreenType {\n const width = window.innerWidth;\n\n if (width >= 992) {\n return \"desktop\";\n } else if (width >= 768) {\n return \"tablet\";\n } else if (width >= 480) {\n return \"mobileLandscape\";\n } else {\n return \"mobilePortrait\";\n }\n}", "// geo.ts\nimport { getGeoCountryFromCookie, getGeolocationCached } from \"src/global/geolocation/geolocation-cached\";\nimport { GeoData } from \"src/global/geolocation/main\";\n\n/** Your banner config */\ntype CountryConfig = {\n country: string; // canonical lowercase name\n countryCode: string; // ISO-2 lowercase code (e.g., \"in\")\n url: string; // leading-slash path (e.g., \"/in\")\n tagline: string; // banner text/html\n aliases?: string[]; // optional extra names to match against\n};\n\nexport const COUNTRY_CONFIG: CountryConfig[] = [\n {\n country: \"united arab emirates\",\n aliases: [\"uae\", \"u.a.e\", \"united arab emirates\"],\n countryCode: \"ae\",\n url: \"/ae\",\n tagline: \"You're in the UAE. Welcome!\"\n },\n {\n country: \"saudi arabia\",\n aliases: [\"saudi\", \"ksa\", \"kingdom of saudi arabia\"],\n countryCode: \"sa\",\n url: \"/sa\",\n tagline: \"Hello Saudi Arabia!\"\n },\n {\n country: \"south africa\",\n aliases: [\"rsa\"],\n countryCode: \"za\",\n url: \"/za\",\n tagline: \"Hi South Africa!\"\n },\n {\n country: \"malaysia\",\n countryCode: \"my\",\n url: \"/my\",\n tagline: \"Selamat datang, Malaysia!\"\n },\n {\n country: \"indonesia\",\n aliases: [\"idn\"],\n countryCode: \"id\",\n url: \"/id\",\n tagline: \"Halo Indonesia!\"\n },\n {\n country: \"philippines\",\n aliases: [\"phl\", \"the philippines\"],\n countryCode: \"ph\",\n url: \"/ph\",\n tagline: \"Kumusta, Philippines!\"\n },\n {\n country: \"india\",\n aliases: [\"bharat\"],\n countryCode: \"in\",\n url: \"/in\",\n tagline: \"This country is India. Hi some text\"\n },\n // \uD83D\uDC47 fallback\n {\n country: \"global\",\n aliases: [\"global\", \"rest of world\", \"others\"],\n countryCode: \"global\", // keep lowercase for consistency\n url: \"/global\",\n tagline: \"This is rest of world. Hi some text\"\n }\n];\n\n/** Utility: normalize strings for comparisons */\nfunction norm(s: string | null | undefined): string {\n return (s ?? \"\").trim().toLowerCase();\n}\n\n/** Utility: ensure URL starts with a single leading slash */\nfunction toPath(path: string): string {\n const p = path.trim();\n if (!p) return \"/\";\n return p.startsWith(\"/\") ? p : `/${p}`;\n}\n\n/** Determine user's country as a *string* (might be name or code depending on your geo source) */\nexport async function getUserCountry(): Promise<string | null> {\n if (typeof window === \"undefined\") return null;\n\n // 1) Cookie fast-path\n const cookieCountry = getGeoCountryFromCookie();\n if (cookieCountry) return norm(cookieCountry);\n\n // 2) Cached or network\n const geo: GeoData | null = await getGeolocationCached();\n return norm((geo as any)?.country);\n}\n\n/** Find matching config by country *name* or *ISO-2 code* with aliases */\nfunction findCountryConfig(input: string | null): CountryConfig | null {\n const v = norm(input);\n if (!v) return null;\n\n const byCode = COUNTRY_CONFIG.find(c => norm(c.countryCode) === v);\n if (byCode) return byCode;\n\n const byName = COUNTRY_CONFIG.find(c => norm(c.country) === v);\n if (byName) return byName;\n\n const byAlias = COUNTRY_CONFIG.find(c => (c.aliases ?? []).some(a => norm(a) === v));\n if (byAlias) return byAlias;\n\n return null;\n}\n\n/** Helper to fetch the global config */\nfunction getGlobalConfig(): CountryConfig {\n const g = COUNTRY_CONFIG.find(c => c.country === \"global\");\n if (!g) throw new Error(\"[geo-banner] Global config not found in COUNTRY_CONFIG\");\n return g;\n}\n\nfunction updateBannerLink(countryCode?: string | null): void {\n if (typeof window === \"undefined\") return;\n\n const code = norm(countryCode);\n const conf =\n COUNTRY_CONFIG.find(c => norm(c.countryCode) === code) ||\n getGlobalConfig();\n\n const linkEl = document.querySelector<HTMLAnchorElement>('[fynd-banner-field=\"link\"]');\n if (linkEl) {\n const base = window.location.origin;\n linkEl.href = `${base}${toPath(conf.url)}`;\n }\n}\n\nexport function setSelectValueSafely(selectEl: HTMLSelectElement, desired: string) {\n // 1) resolve config\n const conf =\n findCountryConfig(desired) ??\n COUNTRY_CONFIG.find(c => c.country === \"global\");\n if (!conf) {\n console.warn(\"[geo-banner] No matching config for\", desired);\n return false;\n }\n const desiredCode = conf.countryCode; // assume already normalized/lowercase\n\n // 2) find matching option (normalize both sides)\n const opts = Array.from(selectEl.options);\n const opt = opts.find(o => norm(o.value) === norm(desiredCode));\n if (!opt) {\n console.warn(\"[geo-banner] No matching <option> for\", desiredCode, \"on\", selectEl);\n return false;\n }\n\n // 3) update the <select> itself (more reliable than toggling option.selected)\n const prev = selectEl.value;\n selectEl.value = opt.value;\n\n // if some browsers/frameworks didn\u2019t adopt .value, force selectedIndex too\n if (selectEl.value !== opt.value) {\n selectEl.selectedIndex = opts.indexOf(opt);\n }\n\n // 4) (optional) keep options\u2019 selected flags in sync\n opts.forEach(o => (o.selected = o === opt));\n\n // 5) fire events frameworks listen to\n if (prev !== selectEl.value) {\n selectEl.dispatchEvent(new Event(\"input\", { bubbles: true }));\n selectEl.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n\n console.log(\"[geo-banner] Select updated \u2192\", conf.country, \"(\", conf.countryCode, \")\");\n return true;\n}\n\n/** Update the banner content for a given countryCode (lowercase ISO-2) with global fallback */\nexport function updateBannerContent(countryCode?: string | null): void {\n if (typeof window === \"undefined\") return;\n\n const code = norm(countryCode);\n const conf =\n COUNTRY_CONFIG.find(c => norm(c.countryCode) === code) ||\n getGlobalConfig();\n // 1) Set <select fynd-banner-field=\"geoswitch\"> value (robustly)\n const selectEl =\n document.querySelector<HTMLSelectElement>('#geoswitch-select') ||\n document.querySelector<HTMLSelectElement>('[fynd-banner-field=\"geoswitch\"]');\n\n if (selectEl) {\n console.log(`country code is ${conf.countryCode}`)\n setSelectValueSafely(selectEl, conf.countryCode);\n selectEl.value = conf.countryCode; // or \"global\", etc.\n\n selectEl.dispatchEvent(new Event(\"change\", { bubbles: true }));\n } else {\n console.warn('[geo-banner] Select not found: #geoswitch-select / [fynd-banner-field=\"geoswitch\"]');\n }\n\n // // 2) Update banner text (unchanged)\n // const textEl = document.querySelector<HTMLElement>('[fynd-banner-field=\"banner-text\"]');\n // if (textEl) textEl.innerHTML = conf.tagline;\n\n // 3) Update link href (unchanged)\n const linkEl = document.querySelector<HTMLAnchorElement>('[fynd-banner-field=\"link\"]');\n if (linkEl) {\n const base = window.location.origin;\n linkEl.href = `${base}${toPath(conf.url)}`;\n }\n}\n\n/**\n * Main entry: detect country and update banner if it matches one of the configured countries.\n * Always falls back to global if no match is found.\n */\nexport async function initCountryDetection(): Promise<CountryConfig> {\n if (typeof window === \"undefined\") return getGlobalConfig();\n\n if (document.readyState === \"loading\") {\n await new Promise<void>(resolve => {\n document.addEventListener(\"DOMContentLoaded\", () => resolve(), { once: true });\n });\n }\n\n const rawCountry = await getUserCountry();\n const match = findCountryConfig(rawCountry);\n const resolved = match ?? getGlobalConfig();\n\n // Debug visibility\n console.log(\"[geo-banner] rawCountry:\", rawCountry, \"\u2192 resolved:\", resolved.countryCode);\n\n // \u2705 Always update from the resolved config (guarantees global fallback)\n updateBannerContent(resolved.countryCode);\n\n // (If you also attached the select change listener, keep that here)\n const selectEl = document.querySelector<HTMLSelectElement>('[fynd-banner-field=\"geoswitch\"]');\n if (selectEl && !(selectEl as any).__geoHandlerAttached) {\n selectEl.addEventListener(\"change\", (e) => {\n const value = (e.target as HTMLSelectElement).value;\n updateBannerLink(value); // only updates href on change\n });\n (selectEl as any).__geoHandlerAttached = true;\n }\n\n return resolved;\n}", "import { getGeolocationCached } from \"src/global/geolocation/geolocation-cached\";\nimport { closeBanner, openBanner } from \"src/global/animation/toggle-banner\";\nimport { getCookie, setCookie } from \"$utils/cookies\";\nimport { getScreenType } from \"src/global/screen-type\";\nimport { initCountryDetection } from \"./country-detection/main\";\n\n/**\n * Banner rules by route (normalized, no trailing slash).\n * Modes:\n * - { mode: \"always\" }\n * - { mode: \"country\", countries: [...] } \u2192 open if geo.country matches (case-insensitive)\n * - { mode: \"notCountry\", countries: [...] } \u2192 open if geo.country does NOT match\n * - { mode: \"predicate\", test: (geo) => boolean }\n */\nconst bannerRouteRules: Record<\n string,\n | { mode: \"always\" }\n | { mode: \"country\"; countries: string[] }\n | { mode: \"notCountry\"; countries: string[] }\n | { mode: \"predicate\"; test: (geo?: any) => boolean }\n> = {\n \"/global\": { mode: \"country\", countries: [\"India\"] },\n \"/\": { mode: \"notCountry\", countries: [\"India\"] },\n};\n\n// Elements\nconst ipBannerMain = '[fynd-navigation=\"ip-banner\"]';\nconst ipBannerInner = '[fynd-navigation=\"ip-banner-inner\"]';\nconst closeIpBanner = '[fynd-navigation=\"ip-banner-close\"]';\n\nconst announcementBar = document.querySelector(\n '[fynd-navigation=\"announcement-bar\"]'\n);\nconst announcementList = document.querySelector(\n '[fynd-navigation=\"announcement-list\"]'\n);\n\n// Global navigation state\nconst navigationData = {\n ipbanner: {\n visibility: false,\n height: {\n desktop: \"56px\",\n tablet: \"60px\",\n mobileLandscape: \"120px\",\n mobilePortrait: \"120px\",\n },\n },\n announcementbar: {\n visibility: false,\n height: {\n desktop: \"40px\",\n tablet: \"40px\",\n mobileLandscape: \"40px\",\n mobilePortrait: \"46px\",\n },\n },\n default: {\n visibility: true,\n height: {\n desktop: \"70px\",\n tablet: \"64px\",\n mobileLandscape: \"40px\",\n mobilePortrait: \"64px\",\n },\n },\n};\n(window as any).navigationData = navigationData;\n\n// --- Utils -------------------------------------------------------------------\n\nfunction addPx(a: string | number, b: string | number): string {\n const toNumber = (val: string | number): number => {\n if (typeof val === \"number\") return val;\n const num = parseInt(val, 10);\n return isNaN(num) ? 0 : num;\n };\n return `${toNumber(a) + toNumber(b)}px`;\n}\n\nfunction subtractPx(a: string | number, b: string | number): string {\n const toNumber = (val: string | number): number => {\n if (typeof val === \"number\") return val;\n const num = parseInt(val, 10);\n return isNaN(num) ? 0 : num;\n };\n return `${toNumber(a) - toNumber(b)}px`;\n}\n\nconst normalizePath = (p: string) => {\n try {\n const urlPath = p.split(\"?\")[0].split(\"#\")[0];\n if (urlPath === \"/\") return \"/\";\n return urlPath.replace(/\\/+$/, \"\") || \"/\";\n } catch {\n return \"/\";\n }\n};\n\n// Longest-prefix match, so \"/india/offers\" matches \"/india\"\nfunction getMatchingRule(pathname: string) {\n const path = normalizePath(pathname);\n let bestKey = \"\";\n for (const key of Object.keys(bannerRouteRules)) {\n const normKey = normalizePath(key);\n if (path === normKey || path.startsWith(normKey + \"/\")) {\n if (normKey.length > bestKey.length) bestKey = normKey;\n }\n }\n return bestKey ? { key: bestKey, rule: bannerRouteRules[bestKey] } : null;\n}\n\nfunction shouldOpenBannerForPage(pathname: string, geo?: { country?: string }) {\n const match = getMatchingRule(pathname);\n if (!match) return false;\n\n const { rule } = match;\n const visitorCountry = (geo?.country || \"\").toLowerCase();\n\n switch (rule.mode) {\n case \"always\":\n return true;\n case \"country\":\n return rule.countries.some((c) => c.toLowerCase() === visitorCountry);\n case \"notCountry\":\n return !rule.countries.some((c) => c.toLowerCase() === visitorCountry);\n case \"predicate\":\n return !!rule.test?.(geo);\n default:\n return false;\n }\n}\n\n// --- Announcement Bar --------------------------------------------------------\n\nfunction initAnnouncementBar() {\n const swiperEl = document.querySelector<HTMLElement>(\n '[fynd-navigation=\"announcement-swiper\"]'\n );\n\n // Initialize swiper if present\n if (swiperEl && !(swiperEl as any).__swiperInstance) {\n try {\n const Swiper = (window as any).Swiper;\n const swiper = new Swiper(swiperEl, {\n slidesPerView: 1,\n spaceBetween: 0,\n effect: \"fade\",\n fadeEffect: { crossFade: true },\n autoplay: { delay: 3000, disableOnInteraction: false },\n loop: true,\n speed: 1000,\n allowTouchMove: false,\n on: {\n init: function (this: any): void {\n if (\n this.slides.length <= 1 &&\n this.autoplay &&\n typeof this.autoplay.stop === \"function\"\n ) {\n this.autoplay.stop();\n }\n },\n },\n });\n (swiperEl as any).__swiperInstance = swiper;\n } catch (err) {\n console.warn(\"Announcement Swiper init failed:\", err);\n }\n }\n\n // // Visibility & cleanup\n // if (announcementBar && announcementList && announcementList.children.length > 0) {\n // navigationData.announcementbar.visibility = true;\n // } else {\n // navigationData.announcementbar.visibility = false;\n // if (announcementBar && announcementBar.parentNode) {\n // if (swiperEl && (swiperEl as any).__swiperInstance) {\n // (swiperEl as any).__swiperInstance.destroy(true, true);\n // (swiperEl as any).__swiperInstance = undefined;\n // }\n // announcementBar.parentNode.removeChild(announcementBar);\n // }\n // }\n}\n\n// --- Desktop Dropdown Positioning -------------------------------------------\n\nfunction initDesktopDropdownMenu() {\n const selector = '[fynd-navigation=\"dropdown-container\"]';\n const el = document.querySelector<HTMLElement>(selector);\n if (!el) {\n console.warn(`initDesktopDropdownMenu: element not found: ${selector}`);\n return;\n }\n\n const screenType = getScreenType?.() ?? \"unknown\";\n\n // Not desktop \u2192 reset transform\n if (screenType !== \"desktop\") {\n el.style.transition = el.style.transition || \"transform 0.3s ease\";\n el.style.transform = \"translateY(0px)\";\n return;\n }\n\n // Compute total stacked height\n let total = navigationData.default.height?.[screenType];\n let subtractFlag = false;\n\n if (navigationData.announcementbar?.visibility) {\n const h = navigationData.announcementbar.height?.[screenType];\n total = addPx(total, h);\n total = subtractPx(total, \"46px\");\n subtractFlag = true;\n }\n\n if (navigationData.ipbanner?.visibility) {\n // Currently not offsetting desktop for IP banner\n const h = \"0px\";\n total = addPx(total, h);\n if (!subtractFlag) {\n total = subtractPx(total, \"46px\");\n }\n }\n\n // Offset dropdown under nav (minus header overlap 46px)\n el.style.transform = `translateY(${total})`;\n}\n\n// --- Dynamic Spacer ----------------------------------------------------------\n\nfunction initNavigationSpacer() {\n const spacer = document.querySelector<HTMLElement>(\n '[fynd-navigation=\"spacer\"][data-wf--navigation-spacer--variant=\"dynamic\"]'\n );\n\n if (!spacer) {\n console.warn(\"initNavigationSpacer: spacer element not found\");\n return;\n }\n\n const toPx = (v?: string | number): number => {\n if (typeof v === \"number\") return v;\n if (typeof v === \"string\") {\n const n = parseFloat(v);\n return Number.isFinite(n) ? n : 0;\n }\n return 0;\n };\n\n const screenType = getScreenType?.() ?? \"desktop\";\n let total = navigationData.default.height?.[screenType];\n\n if (navigationData.announcementbar?.visibility) {\n const h = navigationData.announcementbar.height?.[screenType];\n total = addPx(total, h);\n }\n\n if (navigationData.ipbanner?.visibility) {\n const h = toPx(navigationData.ipbanner.height?.[screenType]);\n total = addPx(total, h);\n }\n\n spacer.style.height = `${total}`;\n}\n\n// --- IP Banner ---------------------------------------------------------------\n\nasync function initIpBanner() {\n const ipClosed = getCookie(\"ipBannerClosed\") === \"true\";\n if (ipClosed) {\n navigationData.ipbanner.visibility = false;\n return;\n }\n\n const geo = await getGeolocationCached();\n const path = window.location.pathname || \"/\";\n const allowByRoute = shouldOpenBannerForPage(path, geo ?? undefined);\n\n const countryReady = await initCountryDetection();\n\n if (allowByRoute && countryReady) {\n openBanner(\n ipBannerMain,\n ipBannerInner,\n navigationData.ipbanner.height.desktop\n );\n navigationData.ipbanner.visibility = true;\n\n const closeBtn = document.querySelector<HTMLElement>(closeIpBanner);\n if (closeBtn) {\n closeBtn.addEventListener(\"click\", () => {\n closeBanner(ipBannerMain, ipBannerInner);\n setCookie(\"ipBannerClosed\", \"true\", 24);\n navigationData.ipbanner.visibility = false;\n initDesktopDropdownMenu();\n initNavigationSpacer();\n });\n }\n } else {\n navigationData.ipbanner.visibility = false;\n }\n}\n\n// --- Init --------------------------------------------------------------------\n\ndocument.addEventListener(\"DOMContentLoaded\", async () => {\n await initIpBanner();\n initAnnouncementBar();\n initDesktopDropdownMenu();\n initNavigationSpacer();\n});\n"],
|
|
5
5
|
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACIE,iBAAsB,iBAA0C;AAC9D,QAAI;AACF,YAAM,WAAW,MAAM,MAAM,mBAAmB;AAChD,UAAI,CAAC,SAAS,IAAI;AAChB,cAAM,IAAI,MAAM,6BAA6B;AAAA,MAC/C;AAEA,YAAM,OAAO,MAAM,SAAS,KAAK;AAEjC,UAAI,KAAK,YAAY,OAAO;AAC1B,gBAAQ,MAAM,8BAA8B,KAAK,OAAO;AACxD,eAAO;AAAA,MACT;AAEA,aAAO;AAAA,QACL,IAAI,KAAK;AAAA,QACT,SAAS,KAAK;AAAA,QACd,QAAQ,KAAK;AAAA,QACb,MAAM,KAAK;AAAA,QACX,UAAU,KAAK;AAAA,QACf,WAAW,KAAK;AAAA,QAChB,KAAK,KAAK,YAAY,OAAO;AAAA,QAC7B,UAAU,KAAK,UAAU,MAAM;AAAA,MACjC;AAA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