@hortonstudio/main 1.9.24 → 1.9.25

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.
Files changed (89) hide show
  1. package/dist/assets/hs-animations-tvD4W7u0.js +3 -0
  2. package/dist/assets/hs-animations-tvD4W7u0.js.br +0 -0
  3. package/dist/assets/hs-animations-tvD4W7u0.js.gz +0 -0
  4. package/dist/assets/hs-animations-tvD4W7u0.js.map +1 -0
  5. package/dist/assets/hs-counter-DmspKHOV.js +2 -0
  6. package/dist/assets/hs-counter-DmspKHOV.js.br +0 -0
  7. package/dist/assets/hs-counter-DmspKHOV.js.gz +0 -0
  8. package/dist/assets/{hs-counter-Bfh7_P60.js.map → hs-counter-DmspKHOV.js.map} +1 -1
  9. package/dist/assets/hs-default-Dxg7WNGx.js +2 -0
  10. package/dist/assets/hs-default-Dxg7WNGx.js.br +0 -0
  11. package/dist/assets/hs-default-Dxg7WNGx.js.gz +0 -0
  12. package/dist/assets/hs-default-Dxg7WNGx.js.map +1 -0
  13. package/dist/assets/hs-marquee-Dwenaw7L.js +2 -0
  14. package/dist/assets/hs-marquee-Dwenaw7L.js.br +0 -0
  15. package/dist/assets/hs-marquee-Dwenaw7L.js.gz +0 -0
  16. package/dist/assets/{hs-marquee-CZ9pmCbT.js.map → hs-marquee-Dwenaw7L.js.map} +1 -1
  17. package/dist/assets/hs-normalize-iTnWVIjq.js +2 -0
  18. package/dist/assets/hs-normalize-iTnWVIjq.js.br +0 -0
  19. package/dist/assets/hs-normalize-iTnWVIjq.js.gz +0 -0
  20. package/dist/assets/{hs-normalize-CTwtG5-a.js.map → hs-normalize-iTnWVIjq.js.map} +1 -1
  21. package/dist/assets/hs-utils-CNwAFmmK.js +2 -0
  22. package/dist/assets/hs-utils-CNwAFmmK.js.br +0 -0
  23. package/dist/assets/hs-utils-CNwAFmmK.js.gz +0 -0
  24. package/dist/assets/hs-utils-CNwAFmmK.js.map +1 -0
  25. package/dist/main.js +2 -2
  26. package/dist/main.js.br +0 -0
  27. package/dist/main.js.gz +0 -0
  28. package/dist/main.js.map +1 -1
  29. package/package.json +2 -2
  30. package/dist/assets/hs-animations-BDMqlbof.js +0 -3
  31. package/dist/assets/hs-animations-BDMqlbof.js. +0 -3
  32. package/dist/assets/hs-animations-BDMqlbof.js.gz +0 -0
  33. package/dist/assets/hs-animations-BDMqlbof.js.map +0 -1
  34. package/dist/assets/hs-attributeSelector-6pGcDBo-.js +0 -2
  35. package/dist/assets/hs-attributeSelector-6pGcDBo-.js.map +0 -1
  36. package/dist/assets/hs-comparison-Ja8EiSGD.js +0 -2
  37. package/dist/assets/hs-comparison-Ja8EiSGD.js. +0 -2
  38. package/dist/assets/hs-comparison-Ja8EiSGD.js.gz +0 -0
  39. package/dist/assets/hs-comparison-Ja8EiSGD.js.map +0 -1
  40. package/dist/assets/hs-counter-Bfh7_P60.js +0 -2
  41. package/dist/assets/hs-counter-Bfh7_P60.js. +0 -2
  42. package/dist/assets/hs-counter-Bfh7_P60.js.gz +0 -0
  43. package/dist/assets/hs-cssVariables-BjuwJfDJ.js +0 -2
  44. package/dist/assets/hs-cssVariables-BjuwJfDJ.js.map +0 -1
  45. package/dist/assets/hs-default-CLmDRb9d.js +0 -2
  46. package/dist/assets/hs-default-CLmDRb9d.js. +0 -2
  47. package/dist/assets/hs-default-CLmDRb9d.js.gz +0 -0
  48. package/dist/assets/hs-default-CLmDRb9d.js.map +0 -1
  49. package/dist/assets/hs-form-COFGgawz.js +0 -2
  50. package/dist/assets/hs-form-COFGgawz.js. +0 -2
  51. package/dist/assets/hs-form-COFGgawz.js.gz +0 -0
  52. package/dist/assets/hs-form-COFGgawz.js.map +0 -1
  53. package/dist/assets/hs-marquee-CZ9pmCbT.js +0 -2
  54. package/dist/assets/hs-marquee-CZ9pmCbT.js. +0 -2
  55. package/dist/assets/hs-marquee-CZ9pmCbT.js.gz +0 -0
  56. package/dist/assets/hs-modalManager-H_YegPAO.js +0 -2
  57. package/dist/assets/hs-modalManager-H_YegPAO.js. +0 -2
  58. package/dist/assets/hs-modalManager-H_YegPAO.js.gz +0 -0
  59. package/dist/assets/hs-modalManager-H_YegPAO.js.map +0 -1
  60. package/dist/assets/hs-normalize-CTwtG5-a.js +0 -2
  61. package/dist/assets/hs-normalize-CTwtG5-a.js. +0 -2
  62. package/dist/assets/hs-normalize-CTwtG5-a.js.gz +0 -0
  63. package/dist/assets/hs-orchestrator-J8b7XRk1.js +0 -2
  64. package/dist/assets/hs-orchestrator-J8b7XRk1.js. +0 -2
  65. package/dist/assets/hs-orchestrator-J8b7XRk1.js.gz +0 -0
  66. package/dist/assets/hs-orchestrator-J8b7XRk1.js.map +0 -1
  67. package/dist/assets/hs-pagination-DcOxmDPJ.js +0 -2
  68. package/dist/assets/hs-pagination-DcOxmDPJ.js. +0 -2
  69. package/dist/assets/hs-pagination-DcOxmDPJ.js.gz +0 -0
  70. package/dist/assets/hs-pagination-DcOxmDPJ.js.map +0 -1
  71. package/dist/assets/hs-structure-DhNix64P.js +0 -3
  72. package/dist/assets/hs-structure-DhNix64P.js. +0 -3
  73. package/dist/assets/hs-structure-DhNix64P.js.gz +0 -0
  74. package/dist/assets/hs-structure-DhNix64P.js.map +0 -1
  75. package/dist/assets/hs-tabs-CaxqHoGW.js +0 -2
  76. package/dist/assets/hs-tabs-CaxqHoGW.js. +0 -2
  77. package/dist/assets/hs-tabs-CaxqHoGW.js.gz +0 -0
  78. package/dist/assets/hs-tabs-CaxqHoGW.js.map +0 -1
  79. package/dist/assets/hs-toc-fxIQS7tz.js +0 -2
  80. package/dist/assets/hs-toc-fxIQS7tz.js. +0 -2
  81. package/dist/assets/hs-toc-fxIQS7tz.js.gz +0 -0
  82. package/dist/assets/hs-toc-fxIQS7tz.js.map +0 -1
  83. package/dist/assets/hs-transition-CDNuGJNq.js +0 -2
  84. package/dist/assets/hs-transition-CDNuGJNq.js. +0 -2
  85. package/dist/assets/hs-transition-CDNuGJNq.js.gz +0 -0
  86. package/dist/assets/hs-transition-CDNuGJNq.js.map +0 -1
  87. package/dist/assets/hs-utils-CKm6QhLw.js +0 -2
  88. package/dist/assets/hs-utils-CKm6QhLw.js.map +0 -1
  89. package/dist/main.js. +0 -3
@@ -0,0 +1,2 @@
1
+ import{p as e,d as r,j as t,l as s,m as a,g as i,n,r as l}from"./hs-utils-CNwAFmmK.js";const o='[data-hs-marquee="wrapper"]',c="data-hs-marquee-direction",u="data-hs-marquee-duration",g="data-hs-marquee-scroll",d="data-hs-marquee-type",m=25,h=0;async function p(){if(e())return{result:"marquee skipped - prefers-reduced-motion enabled"};const p=r("marquee");if(!p)return{result:"marquee skipped - GSAP not loaded"};const{gsap:f,ScrollTrigger:q}=p;t("marquee",["ScrollTrigger"],"error"),q&&f.registerPlugin(q),s(),a();const k=Array.from(document.querySelectorAll(o)),A={timelines:[],scrollTriggers:[],tickers:[]};return k.forEach(e=>{const r=e.getAttribute(c),t=Array.from(e.children);if(0===t.length)return void console.warn("[marquee] No children found in marquee wrapper:",e);const s=e.getAttribute(u),a=s?parseFloat(s):m,o=e.getAttribute(g),p=o?parseFloat(o):h,q=e.getAttribute(d);s||e.setAttribute(u,String(m)),o||e.setAttribute(g,String(h)),e.classList.add(i.classes.gsap);const k=f.timeline({repeat:-1});if(t.forEach(e=>{"left"===r?k.to(e,{xPercent:-100,duration:a,ease:"none"},0):"right"===r&&(f.set(e,{xPercent:-100}),k.to(e,{xPercent:0,duration:a,ease:"none"},0))}),A.timelines.push(k),p>0){let e=1;const r=()=>{const r=l(),t=n();let s=1;if("reverse"===q)if(1===t)s=1+r*p;else if(-1===t){const e=r*p;s=e>.5?-e:1}else s=1;else{s=1+r*p}Math.abs(s-e)>.001&&(k.timeScale(s),e=s)};f.ticker.add(r),A.tickers.push({tickerFunc:r,gsap:f})}}),{result:`marquee initialized (${k.length} instances)`,destroy:()=>{A.timelines.forEach(e=>{e&&e.kill()}),A.scrollTriggers.forEach(e=>{e&&e.kill()}),A.tickers.forEach(({tickerFunc:e,gsap:r})=>{r.ticker.remove(e)}),k.forEach(e=>{e.classList.remove(i.classes.gsap)}),A.timelines.length=0,A.scrollTriggers.length=0,A.tickers.length=0}}}export{p as init};
2
+ //# sourceMappingURL=hs-marquee-Dwenaw7L.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hs-marquee-CZ9pmCbT.js","sources":["../../src/animations/functions/marquee.ts"],"sourcesContent":["/**\n * Marquee Module\n *\n * GSAP-powered infinite scrolling marquee with scroll-based interactions.\n * Works with normalize/dupe module for content duplication.\n *\n * Usage:\n * <div data-hs-marquee=\"wrapper\" data-hs-marquee-direction=\"left\">\n * <div data-hs-dupe=\"child\" data-hs-dupe-count=\"2\">\n * <!-- Content here -->\n * </div>\n * </div>\n *\n * Scroll Behavior:\n * - Default: Speeds up when scrolling (magnitude only)\n * - Type \"reverse\": Scroll down speeds up, scroll up reverses animation\n * - Smooth velocity interpolation for buttery transitions\n */\n\nimport {\n globalConfig,\n getGsap,\n prefersReducedMotion,\n warnMissingDependencies,\n initScrollVelocityTracking,\n initScrollTriggerRefresh,\n getScrollVelocity,\n getScrollDirection,\n type GsapTimeline,\n} from '@utils';\n\ninterface GsapInstance {\n timeline: (vars?: Record<string, unknown>) => GsapTimeline;\n set: (target: unknown, vars: Record<string, unknown>) => void;\n registerPlugin: (...plugins: unknown[]) => void;\n ticker: {\n add: (callback: () => void) => void;\n remove: (callback: () => void) => void;\n };\n}\n\n// Selectors and Attributes\nconst SELECTORS = {\n wrapper: '[data-hs-marquee=\"wrapper\"]',\n};\n\nconst ATTRIBUTES = {\n direction: 'data-hs-marquee-direction',\n duration: 'data-hs-marquee-duration',\n scroll: 'data-hs-marquee-scroll',\n type: 'data-hs-marquee-type',\n};\n\nconst DEFAULTS = {\n duration: 25,\n scrollMultiplier: 0,\n};\n\nexport async function init() {\n // Skip if user prefers reduced motion\n if (prefersReducedMotion()) {\n return { result: 'marquee skipped - prefers-reduced-motion enabled' };\n }\n\n const gsapLib = getGsap('marquee');\n if (!gsapLib) {\n return { result: 'marquee skipped - GSAP not loaded' };\n }\n\n const { gsap, ScrollTrigger } = gsapLib;\n\n // Warn about missing required dependencies (marquee needs ScrollTrigger for scroll effects)\n warnMissingDependencies('marquee', ['ScrollTrigger'], 'error');\n\n if (ScrollTrigger) {\n gsap.registerPlugin(ScrollTrigger);\n }\n\n // Initialize global scroll utilities (only run once)\n initScrollVelocityTracking();\n initScrollTriggerRefresh();\n\n const marquees = Array.from(document.querySelectorAll(SELECTORS.wrapper));\n const cleanup = {\n timelines: [] as GsapTimeline[],\n scrollTriggers: [] as any[],\n tickers: [] as Array<{ tickerFunc: () => void; gsap: GsapInstance }>,\n };\n\n marquees.forEach((marquee) => {\n const direction = marquee.getAttribute(ATTRIBUTES.direction);\n const children = Array.from(marquee.children);\n\n if (children.length === 0) {\n console.warn('[marquee] No children found in marquee wrapper:', marquee);\n return;\n }\n\n // Get duration - check attribute first, then use default\n const durationAttr = marquee.getAttribute(ATTRIBUTES.duration);\n const duration = durationAttr ? parseFloat(durationAttr) : DEFAULTS.duration;\n\n // Get scroll multiplier - check attribute first, then use default\n const scrollAttr = marquee.getAttribute(ATTRIBUTES.scroll);\n const scrollMultiplier = scrollAttr ? parseFloat(scrollAttr) : DEFAULTS.scrollMultiplier;\n\n // Get marquee type (reverse or default)\n const marqueeType = marquee.getAttribute(ATTRIBUTES.type);\n\n // Set attributes with defaults if not present (for visibility in DOM)\n if (!durationAttr) {\n marquee.setAttribute(ATTRIBUTES.duration, String(DEFAULTS.duration));\n }\n if (!scrollAttr) {\n marquee.setAttribute(ATTRIBUTES.scroll, String(DEFAULTS.scrollMultiplier));\n }\n\n // Add class to indicate GSAP is controlling animation\n marquee.classList.add(globalConfig.classes.gsap);\n\n // Create GSAP timeline\n const tl = gsap.timeline({ repeat: -1 });\n\n // Animate all children together at the same time\n children.forEach((child) => {\n if (direction === 'left') {\n // Left: 0% → -100%\n tl.to(\n child,\n {\n xPercent: -100,\n duration: duration,\n ease: 'none',\n },\n 0\n );\n } else if (direction === 'right') {\n // Right: -100% → 0%\n gsap.set(child, { xPercent: -100 }); // Start from -100%\n tl.to(\n child,\n {\n xPercent: 0,\n duration: duration,\n ease: 'none',\n },\n 0\n );\n }\n });\n\n cleanup.timelines.push(tl);\n\n // Add scroll-based speed boost if scroll multiplier is set\n if (scrollMultiplier > 0) {\n let lastTimeScale = 1;\n\n const tickerFunc = () => {\n // Get global scroll velocity and direction\n const scrollSpeed = getScrollVelocity();\n const scrollDir = getScrollDirection();\n let newTimeScale = 1;\n\n if (marqueeType === 'reverse') {\n // Reverse type: scroll down speeds up, scroll up reverses\n if (scrollDir === 1) {\n // Scrolling down: speed up in normal direction\n newTimeScale = 1 + scrollSpeed * scrollMultiplier;\n } else if (scrollDir === -1) {\n // Scrolling up: reverse the animation\n // Use absolute minimum to prevent getting stuck at 0\n const reverseScale = scrollSpeed * scrollMultiplier;\n newTimeScale = reverseScale > 0.5 ? -reverseScale : 1;\n } else {\n // Not scrolling: return to base speed\n newTimeScale = 1;\n }\n } else {\n // Default type: just speed up based on velocity (no direction)\n const speedBoost = scrollSpeed * scrollMultiplier;\n newTimeScale = 1 + speedBoost;\n }\n\n // Only update if changed (avoid unnecessary updates)\n if (Math.abs(newTimeScale - lastTimeScale) > 0.001) {\n tl.timeScale(newTimeScale);\n lastTimeScale = newTimeScale;\n }\n };\n\n // Add ticker function to GSAP's ticker\n gsap.ticker.add(tickerFunc);\n\n // Store ticker function and gsap reference for cleanup\n cleanup.tickers.push({ tickerFunc, gsap: gsap as GsapInstance });\n }\n });\n\n return {\n result: `marquee initialized (${marquees.length} instances)`,\n destroy: () => {\n // Kill all timelines\n cleanup.timelines.forEach((tl) => {\n if (tl) tl.kill();\n });\n\n // Kill all scroll triggers\n cleanup.scrollTriggers.forEach((st) => {\n if (st) (st as any).kill();\n });\n\n // Remove all ticker functions\n cleanup.tickers.forEach(({ tickerFunc, gsap: gsapInstance }) => {\n gsapInstance.ticker.remove(tickerFunc);\n });\n\n // Remove GSAP class from all marquees\n marquees.forEach((marquee) => {\n marquee.classList.remove(globalConfig.classes.gsap);\n });\n\n // Clear arrays\n cleanup.timelines.length = 0;\n cleanup.scrollTriggers.length = 0;\n cleanup.tickers.length = 0;\n },\n };\n}\n"],"names":["SELECTORS","ATTRIBUTES","DEFAULTS","async","init","prefersReducedMotion","result","gsapLib","getGsap","gsap","ScrollTrigger","warnMissingDependencies","registerPlugin","initScrollVelocityTracking","initScrollTriggerRefresh","marquees","Array","from","document","querySelectorAll","cleanup","timelines","scrollTriggers","tickers","forEach","marquee","direction","getAttribute","children","length","console","warn","durationAttr","duration","parseFloat","scrollAttr","scrollMultiplier","marqueeType","setAttribute","String","classList","add","globalConfig","classes","tl","timeline","repeat","child","to","xPercent","ease","set","push","lastTimeScale","tickerFunc","scrollSpeed","getScrollVelocity","scrollDir","getScrollDirection","newTimeScale","reverseScale","Math","abs","timeScale","ticker","destroy","kill","st","gsapInstance","remove"],"mappings":"0JA0CA,MAAMA,EACK,8BAGLC,EACO,4BADPA,EAEM,2BAFNA,EAGI,yBAHJA,EAIE,uBAGFC,EACM,GADNA,EAEc,EAGpBC,eAAsBC,IAEpB,GAAIC,IACF,MAAO,CAAEC,OAAQ,oDAGnB,MAAMC,EAAUC,EAAQ,WACxB,IAAKD,EACH,MAAO,CAAED,OAAQ,qCAGnB,MAAMG,KAAEA,EAAAC,cAAMA,GAAkBH,EAGhCI,EAAwB,UAAW,CAAC,iBAAkB,SAElDD,GACFD,EAAKG,eAAeF,GAItBG,IACAC,IAEA,MAAMC,EAAWC,MAAMC,KAAKC,SAASC,iBAAiBnB,IAChDoB,EAAU,CACdC,UAAW,GACXC,eAAgB,GAChBC,QAAS,IAgHX,OA7GAR,EAASS,QAASC,IAChB,MAAMC,EAAYD,EAAQE,aAAa1B,GACjC2B,EAAWZ,MAAMC,KAAKQ,EAAQG,UAEpC,GAAwB,IAApBA,EAASC,OAEX,YADAC,QAAQC,KAAK,kDAAmDN,GAKlE,MAAMO,EAAeP,EAAQE,aAAa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S2C,IAC1BA,KAAgBD,SAItB9C,EAAQG,QAAQC,QAAQ,EAAG8B,aAAY7C,KAAM2D,MAC3CA,EAAaJ,OAAOK,OAAOf,KAI7BvC,EAASS,QAASC,IAChBA,EAAQe,UAAU6B,OAAO3B,EAAaC,QAAQlC,QAIhDW,EAAQC,UAAUQ,OAAS,EAC3BT,EAAQE,eAAeO,OAAS,EAChCT,EAAQG,QAAQM,OAAS,GAG/B"}
1
+ {"version":3,"file":"hs-marquee-Dwenaw7L.js","sources":["../../src/animations/functions/marquee.ts"],"sourcesContent":["/**\n * Marquee Module\n *\n * GSAP-powered infinite scrolling marquee with scroll-based interactions.\n * Works with normalize/dupe module for content duplication.\n *\n * Usage:\n * <div data-hs-marquee=\"wrapper\" data-hs-marquee-direction=\"left\">\n * <div data-hs-dupe=\"child\" data-hs-dupe-count=\"2\">\n * <!-- Content here -->\n * </div>\n * </div>\n *\n * Scroll Behavior:\n * - Default: Speeds up when scrolling (magnitude only)\n * - Type \"reverse\": Scroll down speeds up, scroll up reverses animation\n * - Smooth velocity interpolation for buttery transitions\n */\n\nimport {\n globalConfig,\n getGsap,\n prefersReducedMotion,\n warnMissingDependencies,\n initScrollVelocityTracking,\n initScrollTriggerRefresh,\n getScrollVelocity,\n getScrollDirection,\n type GsapTimeline,\n} from '@utils';\n\ninterface GsapInstance {\n timeline: (vars?: Record<string, unknown>) => GsapTimeline;\n set: (target: unknown, vars: Record<string, unknown>) => void;\n registerPlugin: (...plugins: unknown[]) => void;\n ticker: {\n add: (callback: () => void) => void;\n remove: (callback: () => void) => void;\n };\n}\n\n// Selectors and Attributes\nconst SELECTORS = {\n wrapper: '[data-hs-marquee=\"wrapper\"]',\n};\n\nconst ATTRIBUTES = {\n direction: 'data-hs-marquee-direction',\n duration: 'data-hs-marquee-duration',\n scroll: 'data-hs-marquee-scroll',\n type: 'data-hs-marquee-type',\n};\n\nconst DEFAULTS = {\n duration: 25,\n scrollMultiplier: 0,\n};\n\nexport async function init() {\n // Skip if user prefers reduced motion\n if (prefersReducedMotion()) {\n return { result: 'marquee skipped - prefers-reduced-motion enabled' };\n }\n\n const gsapLib = getGsap('marquee');\n if (!gsapLib) {\n return { result: 'marquee skipped - GSAP not loaded' };\n }\n\n const { gsap, ScrollTrigger } = gsapLib;\n\n // Warn about missing required dependencies (marquee needs ScrollTrigger for scroll effects)\n warnMissingDependencies('marquee', ['ScrollTrigger'], 'error');\n\n if (ScrollTrigger) {\n gsap.registerPlugin(ScrollTrigger);\n }\n\n // Initialize global scroll utilities (only run once)\n initScrollVelocityTracking();\n initScrollTriggerRefresh();\n\n const marquees = Array.from(document.querySelectorAll(SELECTORS.wrapper));\n const cleanup = {\n timelines: [] as GsapTimeline[],\n scrollTriggers: [] as any[],\n tickers: [] as Array<{ tickerFunc: () => void; gsap: GsapInstance }>,\n };\n\n marquees.forEach((marquee) => {\n const direction = marquee.getAttribute(ATTRIBUTES.direction);\n const children = Array.from(marquee.children);\n\n if (children.length === 0) {\n console.warn('[marquee] No children found in marquee wrapper:', marquee);\n return;\n }\n\n // Get duration - check attribute first, then use default\n const durationAttr = marquee.getAttribute(ATTRIBUTES.duration);\n const duration = durationAttr ? parseFloat(durationAttr) : DEFAULTS.duration;\n\n // Get scroll multiplier - check attribute first, then use default\n const scrollAttr = marquee.getAttribute(ATTRIBUTES.scroll);\n const scrollMultiplier = scrollAttr ? parseFloat(scrollAttr) : DEFAULTS.scrollMultiplier;\n\n // Get marquee type (reverse or default)\n const marqueeType = marquee.getAttribute(ATTRIBUTES.type);\n\n // Set attributes with defaults if not present (for visibility in DOM)\n if (!durationAttr) {\n marquee.setAttribute(ATTRIBUTES.duration, String(DEFAULTS.duration));\n }\n if (!scrollAttr) {\n marquee.setAttribute(ATTRIBUTES.scroll, String(DEFAULTS.scrollMultiplier));\n }\n\n // Add class to indicate GSAP is controlling animation\n marquee.classList.add(globalConfig.classes.gsap);\n\n // Create GSAP timeline\n const tl = gsap.timeline({ repeat: -1 });\n\n // Animate all children together at the same time\n children.forEach((child) => {\n if (direction === 'left') {\n // Left: 0% → -100%\n tl.to(\n child,\n {\n xPercent: -100,\n duration: duration,\n ease: 'none',\n },\n 0\n );\n } else if (direction === 'right') {\n // Right: -100% → 0%\n gsap.set(child, { xPercent: -100 }); // Start from -100%\n tl.to(\n child,\n {\n xPercent: 0,\n duration: duration,\n ease: 'none',\n },\n 0\n );\n }\n });\n\n cleanup.timelines.push(tl);\n\n // Add scroll-based speed boost if scroll multiplier is set\n if (scrollMultiplier > 0) {\n let lastTimeScale = 1;\n\n const tickerFunc = () => {\n // Get global scroll velocity and direction\n const scrollSpeed = getScrollVelocity();\n const scrollDir = getScrollDirection();\n let newTimeScale = 1;\n\n if (marqueeType === 'reverse') {\n // Reverse type: scroll down speeds up, scroll up reverses\n if (scrollDir === 1) {\n // Scrolling down: speed up in normal direction\n newTimeScale = 1 + scrollSpeed * scrollMultiplier;\n } else if (scrollDir === -1) {\n // Scrolling up: reverse the animation\n // Use absolute minimum to prevent getting stuck at 0\n const reverseScale = scrollSpeed * scrollMultiplier;\n newTimeScale = reverseScale > 0.5 ? -reverseScale : 1;\n } else {\n // Not scrolling: return to base speed\n newTimeScale = 1;\n }\n } else {\n // Default type: just speed up based on velocity (no direction)\n const speedBoost = scrollSpeed * scrollMultiplier;\n newTimeScale = 1 + speedBoost;\n }\n\n // Only update if changed (avoid unnecessary updates)\n if (Math.abs(newTimeScale - lastTimeScale) > 0.001) {\n tl.timeScale(newTimeScale);\n lastTimeScale = newTimeScale;\n }\n };\n\n // Add ticker function to GSAP's ticker\n gsap.ticker.add(tickerFunc);\n\n // Store ticker function and gsap reference for cleanup\n cleanup.tickers.push({ tickerFunc, gsap: gsap as GsapInstance });\n }\n });\n\n return {\n result: `marquee initialized (${marquees.length} instances)`,\n destroy: () => {\n // Kill all timelines\n cleanup.timelines.forEach((tl) => {\n if (tl) tl.kill();\n });\n\n // Kill all scroll triggers\n cleanup.scrollTriggers.forEach((st) => {\n if (st) (st as any).kill();\n });\n\n // Remove all ticker functions\n cleanup.tickers.forEach(({ tickerFunc, gsap: gsapInstance }) => {\n gsapInstance.ticker.remove(tickerFunc);\n });\n\n // Remove GSAP class from all marquees\n marquees.forEach((marquee) => {\n marquee.classList.remove(globalConfig.classes.gsap);\n });\n\n // Clear arrays\n cleanup.timelines.length = 0;\n cleanup.scrollTriggers.length = 0;\n cleanup.tickers.length = 0;\n },\n };\n}\n"],"names":["SELECTORS","ATTRIBUTES","DEFAULTS","async","init","prefersReducedMotion","result","gsapLib","getGsap","gsap","ScrollTrigger","warnMissingDependencies","registerPlugin","initScrollVelocityTracking","initScrollTriggerRefresh","marquees","Array","from","document","querySelectorAll","cleanup","timelines","scrollTriggers","tickers","forEach","marquee","direction","getAttribute","children","length","console","warn","durationAttr","duration","parseFloat","scrollAttr","scrollMultiplier","marqueeType","setAttribute","String","classList","add","globalConfig","classes","tl","timeline","repeat","child","to","xPercent","ease","set","push","lastTimeScale","tickerFunc","scrollSpeed","getScrollVelocity","scrollDir","getScrollDirection","newTimeScale","reverseScale","Math","abs","timeScale","ticker","destroy","kill","st","gsapInstance","remove"],"mappings":"uFA0CA,MAAMA,EACK,8BAGLC,EACO,4BADPA,EAEM,2BAFNA,EAGI,yBAHJA,EAIE,uBAGFC,EACM,GADNA,EAEc,EAGpBC,eAAsBC,IAEpB,GAAIC,IACF,MAAO,CAAEC,OAAQ,oDAGnB,MAAMC,EAAUC,EAAQ,WACxB,IAAKD,EACH,MAAO,CAAED,OAAQ,qCAGnB,MAAMG,KAAEA,EAAAC,cAAMA,GAAkBH,EAGhCI,EAAwB,UAAW,CAAC,iBAAkB,SAElDD,GACFD,EAAKG,eAAeF,GAItBG,IACAC,IAEA,MAAMC,EAAWC,MAAMC,KAAKC,SAASC,iBAAiBnB,IAChDoB,EAAU,CACdC,UAAW,GACXC,eAAgB,GAChBC,QAAS,IAgHX,OA7GAR,EAASS,QAASC,IAChB,MAAMC,EAAYD,EAAQE,aAAa1B,GACjC2B,EAAWZ,MAAMC,K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OAAQ,wBAAwBS,EAASc,oBACzCoC,QAAS,KAEP7C,EAAQC,UAAUG,QAASoB,IACrBA,KAAOsB,SAIb9C,EAAQE,eAAeE,QAAS2C,IAC1BA,KAAgBD,SAItB9C,EAAQG,QAAQC,QAAQ,EAAG8B,aAAY7C,KAAM2D,MAC3CA,EAAaJ,OAAOK,OAAOf,KAI7BvC,EAASS,QAASC,IAChBA,EAAQe,UAAU6B,OAAO3B,EAAaC,QAAQlC,QAIhDW,EAAQC,UAAUQ,OAAS,EAC3BT,EAAQE,eAAeO,OAAS,EAChCT,EAAQG,QAAQM,OAAS,GAG/B"}
@@ -0,0 +1,2 @@
1
+ import{q as e,a as t,g as r,b as n,c as o}from"./hs-utils-CNwAFmmK.js";function s(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let n;for(;n=r.nextNode();)n.nodeValue?.trim()&&t.push(n);return t}function i(e){const t=[];return e.hasAttribute("href")&&t.push(e),t.push(...Array.from(e.querySelectorAll("[href]"))),t}function c(e){if(e.hasAttribute("src")){if(e.getAttribute("src"))return e}const t=e.querySelector("[src]");if(t){if(t.getAttribute("src"))return t}return null}function l(e,t,r){if(function(e,t){const r=t.attributes.properties.syncField;return null!==e.querySelector(`[${r}]`)}(t,r))return void function(e,t,r){const n=r.attributes.properties.syncField;e.querySelectorAll(`[${n}]`).forEach(e=>{const r=e.getAttribute(n),o=t.querySelector(`[${n}="${r}"]`);if(!o)return;const i=c(e),l=c(o);if(i&&l){const e=i.getAttribute("src");e&&l.setAttribute("src",e)}else if(e.hasAttribute("href")&&o.hasAttribute("href")){const t=e.getAttribute("href");t&&o.setAttribute("href",t)}else{const t=s(e),r=t.length>0?t[0].nodeValue:e.textContent.trim();if(r){const e=s(o);e.length>0?e[0].nodeValue=r:o.textContent=r}}})}(e,t,r);const n=s(e),o=n.length>0?n[0].nodeValue:"",l=i(e),a=l.length>0?l[0].getAttribute("href"):"";if(o){s(t).forEach(e=>{e.nodeValue=o})}if(a){i(t).forEach(e=>{e.setAttribute("href",a)})}}const a="hs-dupe-no-transition";let u=!1;async function d(t){!function(){if(u)return;const e=document.createElement("style");e.textContent=`\n .${a},\n .${a} * {\n transition: none !important;\n animation: none !important;\n }\n `,document.head.appendChild(e),u=!0}();const r={processedElements:[]};return e(t,"wrapper").forEach(e=>{const t=e.getAttribute("data-hs-dupe");if(!t||"child"!==t&&"self"!==t)return void console.warn('[dupe] Invalid mode. Use "child" or "self":',e);const n=e.getAttribute("data-hs-dupe-count");let o=n?parseInt(n,10):1;(isNaN(o)||o<1)&&(console.warn("[dupe] Invalid count, using default of 1:",e),o=1),o>20&&(console.warn(`[dupe] Count of ${o} exceeds maximum of 20. Capping at 20.`),o=20);const s={hidden:e.hasAttribute("data-hs-dupe-hidden"),noSelect:e.hasAttribute("data-hs-dupe-no-select")};"child"===t?function(e,t,r,n){const o=e.children[0];if(!o)return;const s=[];for(let i=0;i<t;i++){const t=o.cloneNode(!0);t.classList.add(a),p(t,r),e.appendChild(t),s.push(t),t.offsetHeight,requestAnimationFrame(()=>{t.classList.remove(a)})}n.processedElements.push({element:e,mode:"child",clones:s})}(e,o,s,r):"self"===t&&function(e,t,r,n){const o=e.parentNode;if(!o)return void console.warn("[dupe] Element has no parent, cannot duplicate self:",e);const s=[];let i=e;for(let c=0;c<t;c++){const t=e.cloneNode(!0);t.classList.add(a),t.removeAttribute("data-hs-dupe"),t.removeAttribute("data-hs-dupe-count"),t.removeAttribute("data-hs-dupe-hidden"),t.removeAttribute("data-hs-dupe-no-select"),p(t,r),i.nextSibling?o.insertBefore(t,i.nextSibling):o.appendChild(t),s.push(t),i=t,t.offsetHeight,requestAnimationFrame(()=>{t.classList.remove(a)})}n.processedElements.push({element:e,mode:"self",clones:s})}(e,o,s,r)}),{result:`dupe processed ${r.processedElements.length} elements`,destroy:()=>{r.processedElements.forEach(({clones:e})=>{e.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)})}),r.processedElements.length=0}}}function p(e,t){if(t.hidden&&e.setAttribute("aria-hidden","true"),t.noSelect){const t=e;t.style.userSelect="none",t.style.webkitUserSelect="none",t.style.msUserSelect="none"}}async function h(){const s={destroyFunctions:[]},i=o.normalize;try{const a=await async function(r){const n=e(r,"source"),o=new Map;n.forEach(e=>{const t=e.getAttribute(r.attributes.properties.syncId);t&&o.set(t,e)});const s=e(r,"target");let i=0,c=0;return s.forEach(n=>{const s=n.getAttribute(r.attributes.properties.syncId);if(!s||!o.has(s))return void c++;const a=o.get(s),u=t(r,"item",n);if(!u)return void console.warn(`[sync] Target list "${s}" missing item template`);const d="child"===u.getAttribute(r.attributes.properties.syncMode),p=t(r,"ignore",n),h=e(r,"item",a);if(0===h.length)return void console.warn(`[sync] Source list "${s}" has no items`);let f;if(d){const e=u.firstElementChild;if(!e)return void console.warn(`[sync] Target list "${s}" has sync-mode="child" but item wrapper has no children`);f=e.cloneNode(!0)}else f=u.cloneNode(!0),f.removeAttribute(r.attributes.elements.item.primary.split("=")[0]);let m=!1;if(p){let e=p.nextElementSibling;for(;e;){if(e===u){m=!0;break}e=e.nextElementSibling}}if(d){for(;u.firstChild;)u.removeChild(u.firstChild);h.forEach(e=>{const t=f.cloneNode(!0);l(e,t,r),u.appendChild(t)}),u.removeAttribute(r.attributes.elements.item.primary.split("=")[0])}else{Array.from(n.children).forEach(e=>{e!==p&&e.remove()});const e=Array.from(h).map(e=>{const t=f.cloneNode(!0);return l(e,t,r),t});p?m?e.forEach(e=>{n.appendChild(e)}):e.forEach(e=>{n.insertBefore(e,p)}):e.forEach(e=>{n.appendChild(e)})}i++}),{result:`sync initialized (${i} synced, ${c} skipped)`}}(i.sync);a&&"destroy"in a&&"function"==typeof a.destroy&&s.destroyFunctions.push(a.destroy);const u=await async function(){const t={processedWrappers:[]};return e(r.clickable,"wrapper").forEach(e=>{const r=e.querySelector(":scope > button"),n=e.querySelector(":scope > a");if(!r||!n)return;const o=n.getAttribute("href");let s,i;o&&""!==o&&"#"!==o?(s=n,i=r):(s=r,i=n);const c="button"===s.getAttribute("data-hs-clickable");c||s.setAttribute("data-hs-clickable","button"),i.remove(),t.processedWrappers.push({wrapper:e,keptElement:s,wasLink:s===n,addedAttribute:!c})}),{result:`clickable processed ${t.processedWrappers.length} wrappers`,destroy:()=>{t.processedWrappers.forEach(({keptElement:e,addedAttribute:t})=>{t&&e.removeAttribute("data-hs-clickable")}),t.processedWrappers.length=0}}}();u&&"destroy"in u&&"function"==typeof u.destroy&&s.destroyFunctions.push(u.destroy);const p=await d(i.dupe);p&&"destroy"in p&&"function"==typeof p.destroy&&s.destroyFunctions.push(p.destroy);const h=(c=o.structure?.["site-settings"],function(){const r=t(c,"wrapper");if(!r)return;const o=e(c,"list",r);if(0===o.length)return;const s={};if(o.forEach(e=>{const t=n(c,"setting");e.querySelectorAll(t).forEach(e=>{const t=e.cloneNode(!0),r=n(c,"hide");t.querySelectorAll(r).forEach(e=>{const t=c.attributes.elements.hide.primary.match(/data-site-settings-hide/)[0],r=e.getAttribute(t);r&&r.split(" ").filter(e=>e.trim()).some(t=>e.classList.contains(t))&&e.remove()});const o=c.attributes.elements.setting.primary.match(/data-site-settings/)[0],i=e.getAttribute(o),l=t.textContent.trim(),a=e.getAttribute("href");i&&(l||a)&&(s[i]={text:l||null,href:a||null})})}),0===Object.keys(s).length)return;const i=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,{acceptNode:e=>{const t=e.textContent;for(const r in s)if(t.includes(`{{${r}}}`))return NodeFilter.FILTER_ACCEPT;return NodeFilter.FILTER_SKIP}}),l=[];let a;for(;a=i.nextNode();)l.push(a);l.forEach(e=>{let t=e.textContent,r=!1;for(const n in s){const e=`{{${n}}}`;if(t.includes(e)){const o=s[n],i=o.text||o.href;i&&(t=t.replace(new RegExp(e,"g"),i),r=!0)}}r&&(e.textContent=t)}),document.querySelectorAll("a[href]").forEach(e=>{let t=e.getAttribute("href"),r=!1;for(const n in s){const e=`{{${n}}}`;if(t.includes(e)){const o=s[n];o.href?(t=o.href,r=!0):o.text&&(t=t.replace(new RegExp(e,"g"),o.text),r=!0)}}r&&e.setAttribute("href",t)})}(),{result:"site-settings initialized",destroy:()=>{}});h&&"destroy"in h&&"function"==typeof h.destroy&&s.destroyFunctions.push(h.destroy);const f=function(e){return function(){const t=(new Date).getFullYear().toString(),r=["January","February","March","April","May","June","July","August","September","October","November","December"][(new Date).getMonth()],n=e.attributes.placeholders.year,o=e.attributes.placeholders.month,s=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,{acceptNode:e=>e.textContent.includes(n)||e.textContent.includes(o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}),i=[];let c;for(;c=s.nextNode();)i.push(c);const l=new RegExp(n.replace(/[{}]/g,"\\$&"),"gi"),a=new RegExp(o.replace(/[{}]/g,"\\$&"),"gi");i.forEach(e=>{let n=e.textContent.replace(l,t);n=n.replace(a,r),n!==e.textContent&&(e.textContent=n)})}(),{result:"year-replacement initialized",destroy:()=>{}}}(o.structure?.["year-replacement"]);return f&&"destroy"in f&&"function"==typeof f.destroy&&s.destroyFunctions.push(f.destroy),{result:"normalize initialized",destroy:()=>{s.destroyFunctions.reverse().forEach(e=>{try{e()}catch(t){console.error("[normalize] Error during cleanup:",t)}}),s.destroyFunctions.length=0}}}catch(a){throw console.error("[normalize] Initialization failed:",a),s.destroyFunctions.reverse().forEach(e=>{try{e()}catch(t){console.error("[normalize] Error during error cleanup:",t)}}),a}var c}export{h as init};
2
+ //# sourceMappingURL=hs-normalize-iTnWVIjq.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hs-normalize-CTwtG5-a.js","sources":["../../src/modules/normalize/functions/sync.ts","../../src/modules/normalize/functions/dupe.ts","../../src/modules/normalize/normalize.ts","../../src/modules/normalize/functions/clickable.ts","../../src/modules/normalize/functions/site-settings.ts","../../src/modules/normalize/functions/year-replacement.ts"],"sourcesContent":["/**\n * List Sync\n *\n * Syncs collection list data to static lists by sync-id.\n *\n * Simple mode (text/href):\n * <div data-hs-sync=\"source\" data-hs-sync-id=\"services\">\n * <a data-hs-sync=\"item\" href=\"/service-1\">Service 1</a>\n * </div>\n * <div data-hs-sync=\"target\" data-hs-sync-id=\"services\">\n * <a data-hs-sync=\"item\" href=\"#\">Placeholder</a>\n * </div>\n *\n * Field-based mode (named fields):\n * <div data-hs-sync=\"source\" data-hs-sync-id=\"projects\">\n * <div data-hs-sync=\"item\">\n * <img data-hs-sync-field=\"before\" src=\"/before.jpg\">\n * <img data-hs-sync-field=\"after\" src=\"/after.jpg\">\n * </div>\n * </div>\n * <div data-hs-sync=\"target\" data-hs-sync-id=\"projects\">\n * <div data-hs-sync=\"item\">\n * <img data-hs-sync-field=\"before\" src=\"/placeholder.jpg\">\n * <img data-hs-sync-field=\"after\" src=\"/placeholder.jpg\">\n * </div>\n * </div>\n *\n * Child mode (wrapper templates):\n * <div data-hs-sync=\"target\" data-hs-sync-id=\"marquee\">\n * <div data-hs-sync=\"item\" data-hs-sync-mode=\"child\">\n * <div class=\"marquee_list\">\n * <img data-hs-sync-field=\"image\" src=\"/placeholder.jpg\">\n * </div>\n * </div>\n * </div>\n *\n * Supports data-hs-sync=\"ignore\" to preserve elements during sync.\n */\n\nimport { querySelectorAll, querySelector } from '@utils';\n\n/**\n * Get all text nodes within an element\n */\nfunction getTextNodes(element: Element): Text[] {\n const textNodes: Text[] = [];\n const walker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT, null);\n\n let node: Node | null;\n while ((node = walker.nextNode())) {\n // Skip empty/whitespace-only nodes\n if (node.nodeValue?.trim()) {\n textNodes.push(node as Text);\n }\n }\n\n return textNodes;\n}\n\n/**\n * Get all elements with href attribute (including the element itself)\n */\nfunction getHrefElements(element: Element): Element[] {\n const hrefs: Element[] = [];\n\n // Check if element itself has href\n if (element.hasAttribute('href')) {\n hrefs.push(element);\n }\n\n // Check descendants\n hrefs.push(...Array.from(element.querySelectorAll('[href]')));\n\n return hrefs;\n}\n\n/**\n * Check if item uses field-based syncing\n */\nfunction usesFieldBasedSync(\n item: Element,\n config: { attributes: { properties: { syncField: string } } }\n): boolean {\n const fieldAttr = config.attributes.properties.syncField;\n return item.querySelector(`[${fieldAttr}]`) !== null;\n}\n\n/**\n * Find element with src attribute (check element itself, then descendants)\n */\nfunction findElementWithSrc(element: Element): Element | null {\n // Check element itself\n if (element.hasAttribute('src')) {\n const src = element.getAttribute('src');\n if (src) return element;\n }\n\n // Check descendants\n const descendant = element.querySelector('[src]');\n if (descendant) {\n const src = descendant.getAttribute('src');\n if (src) return descendant;\n }\n\n return null;\n}\n\n/**\n * Sync data using field-based mapping\n * Maps fields by name between source and target\n */\nfunction syncFieldBasedData(\n sourceItem: Element,\n targetClone: Element,\n config: { attributes: { properties: { syncField: string } } }\n): void {\n const fieldAttr = config.attributes.properties.syncField;\n\n // Get all fields in source\n const sourceFields = sourceItem.querySelectorAll(`[${fieldAttr}]`);\n\n sourceFields.forEach((sourceField: Element) => {\n const fieldName = sourceField.getAttribute(fieldAttr);\n\n // Find matching field in target\n const targetField = targetClone.querySelector(`[${fieldAttr}=\"${fieldName}\"]`);\n if (!targetField) return;\n\n // Try to find elements with src (for images)\n const sourceImgElement = findElementWithSrc(sourceField);\n const targetImgElement = findElementWithSrc(targetField);\n\n if (sourceImgElement && targetImgElement) {\n // Sync src attribute\n const src = sourceImgElement.getAttribute('src');\n if (src) {\n targetImgElement.setAttribute('src', src);\n }\n }\n // Link elements: sync href\n else if (sourceField.hasAttribute('href') && targetField.hasAttribute('href')) {\n const href = sourceField.getAttribute('href');\n if (href) {\n targetField.setAttribute('href', href);\n }\n }\n // Text elements: sync text content\n else {\n const sourceTextNodes = getTextNodes(sourceField);\n const sourceText =\n sourceTextNodes.length > 0 ? sourceTextNodes[0].nodeValue : sourceField.textContent.trim();\n\n if (sourceText) {\n const targetTextNodes = getTextNodes(targetField);\n if (targetTextNodes.length > 0) {\n targetTextNodes[0].nodeValue = sourceText;\n } else {\n targetField.textContent = sourceText;\n }\n }\n }\n });\n}\n\n/**\n * Sync data from source item to target clone\n * Extracts text and href from source, applies to ALL matching elements in target\n */\nfunction syncItemData(\n sourceItem: Element,\n targetClone: Element,\n config: { attributes: { properties: { syncField: string } } }\n): void {\n // Check if using field-based syncing\n if (usesFieldBasedSync(targetClone, config)) {\n syncFieldBasedData(sourceItem, targetClone, config);\n return;\n }\n\n // Fallback to simple syncing (existing behavior)\n // Get text content from source (first non-empty text node)\n const sourceTextNodes = getTextNodes(sourceItem);\n const sourceText = sourceTextNodes.length > 0 ? sourceTextNodes[0].nodeValue : '';\n\n // Get href from source (first href element)\n const sourceHrefs = getHrefElements(sourceItem);\n const sourceHref = sourceHrefs.length > 0 ? sourceHrefs[0].getAttribute('href') : '';\n\n // Apply source text to ALL text nodes in target\n if (sourceText) {\n const targetTextNodes = getTextNodes(targetClone);\n targetTextNodes.forEach((node) => {\n node.nodeValue = sourceText;\n });\n }\n\n // Apply source href to ALL href elements in target\n if (sourceHref) {\n const targetHrefs = getHrefElements(targetClone);\n targetHrefs.forEach((el) => {\n el.setAttribute('href', sourceHref);\n });\n }\n}\n\ninterface SyncConfig {\n attributes: {\n elements: {\n item: { primary: string };\n };\n properties: {\n syncId: string;\n syncField: string;\n syncMode: string;\n };\n };\n}\n\nexport async function init(config: SyncConfig): Promise<{ result: string }> {\n // Find all source lists and build map by sync-id\n const sourceLists = querySelectorAll(config, 'source');\n const sourceMap = new Map<string, Element>();\n\n sourceLists.forEach((source) => {\n const syncId = source.getAttribute(config.attributes.properties.syncId);\n if (syncId) {\n sourceMap.set(syncId, source);\n }\n });\n\n // Find all target lists\n const targetLists = querySelectorAll(config, 'target');\n let syncedCount = 0;\n let skippedCount = 0;\n\n targetLists.forEach((target) => {\n const syncId = target.getAttribute(config.attributes.properties.syncId);\n\n // Skip if no sync-id or no matching source\n if (!syncId || !sourceMap.has(syncId)) {\n skippedCount++;\n return;\n }\n\n const source = sourceMap.get(syncId);\n\n // Find item template in target (element to clone)\n const targetTemplateWrapper = querySelector(config, 'item', target);\n if (!targetTemplateWrapper) {\n console.warn(`[sync] Target list \"${syncId}\" missing item template`);\n return;\n }\n\n // Check sync mode - determines which element to use as template\n const syncMode = targetTemplateWrapper.getAttribute(config.attributes.properties.syncMode);\n const isChildMode = syncMode === 'child';\n\n // Find ignore element in target (if exists)\n const ignoreElement = querySelector(config, 'ignore', target);\n\n // Find all source items\n const sourceItems = querySelectorAll(config, 'item', source);\n if (sourceItems.length === 0) {\n console.warn(`[sync] Source list \"${syncId}\" has no items`);\n return;\n }\n\n // Determine template based on mode\n let template: Element;\n if (isChildMode) {\n // Child mode: clone the wrapper, we'll replace its child content\n const firstChild = targetTemplateWrapper.firstElementChild;\n if (!firstChild) {\n console.warn(\n `[sync] Target list \"${syncId}\" has sync-mode=\"child\" but item wrapper has no children`\n );\n return;\n }\n // Clone the child element to use for syncing data\n template = firstChild.cloneNode(true) as Element;\n } else {\n // Default mode: clone the item element itself\n template = targetTemplateWrapper.cloneNode(true) as Element;\n template.removeAttribute(config.attributes.elements.item.primary.split('=')[0]);\n }\n\n // Determine insertion strategy if ignore exists\n let insertAfterIgnore = false;\n if (ignoreElement) {\n // Check if template wrapper comes after ignore element\n let currentElement = ignoreElement.nextElementSibling;\n while (currentElement) {\n if (currentElement === targetTemplateWrapper) {\n insertAfterIgnore = true;\n break;\n }\n currentElement = currentElement.nextElementSibling;\n }\n }\n\n if (isChildMode) {\n // CHILD MODE: Keep wrapper as single element, duplicate children inside it\n // Clear the wrapper's children\n while (targetTemplateWrapper.firstChild) {\n targetTemplateWrapper.removeChild(targetTemplateWrapper.firstChild);\n }\n\n // Create synced children and append to the wrapper\n sourceItems.forEach((sourceItem) => {\n const childClone = template.cloneNode(true) as Element;\n syncItemData(sourceItem, childClone, config);\n targetTemplateWrapper.appendChild(childClone);\n });\n\n // Remove data-hs-sync=\"item\" attribute from wrapper\n targetTemplateWrapper.removeAttribute(config.attributes.elements.item.primary.split('=')[0]);\n } else {\n // DEFAULT MODE: Duplicate the item element itself\n // Clear target list, but preserve ignore element\n const children = Array.from(target.children);\n children.forEach((child) => {\n if (child !== ignoreElement) {\n child.remove();\n }\n });\n\n // Create synced items\n const syncedItems = Array.from(sourceItems).map((sourceItem) => {\n const clone = template.cloneNode(true) as Element;\n syncItemData(sourceItem, clone, config);\n return clone;\n });\n\n // Insert synced items based on strategy\n if (ignoreElement) {\n if (insertAfterIgnore) {\n // Insert all items after ignore\n syncedItems.forEach((item) => {\n target.appendChild(item);\n });\n } else {\n // Insert all items before ignore\n syncedItems.forEach((item) => {\n target.insertBefore(item, ignoreElement);\n });\n }\n } else {\n // No ignore element, just append all\n syncedItems.forEach((item) => {\n target.appendChild(item);\n });\n }\n }\n\n syncedCount++;\n });\n\n return {\n result: `sync initialized (${syncedCount} synced, ${skippedCount} skipped)`,\n };\n}\n","/**\n * Element Duplication\n *\n * Duplicates elements for marquee effects and visual consistency.\n *\n * Child mode (duplicate children):\n * <div data-hs-dupe=\"child\" data-hs-dupe-count=\"2\">\n * <div class=\"marquee_item\">Content</div>\n * </div>\n *\n * Self mode (duplicate wrapper):\n * <div data-hs-dupe=\"self\" data-hs-dupe-count=\"3\">Content</div>\n *\n * Modifiers: data-hs-dupe-hidden (aria-hidden), data-hs-dupe-no-select (disable selection).\n */\nimport { querySelectorAll } from '@utils';\n\nconst MAX_DUPE_COUNT = 20;\nconst TRANSITION_CLASS = 'hs-dupe-no-transition';\n\n// Inject CSS once\nlet cssInjected = false;\nfunction injectCSS(): void {\n if (cssInjected) return;\n\n const style = document.createElement('style');\n style.textContent = `\n .${TRANSITION_CLASS},\n .${TRANSITION_CLASS} * {\n transition: none !important;\n animation: none !important;\n }\n `;\n document.head.appendChild(style);\n cssInjected = true;\n}\n\ninterface DupeConfig {\n attributes: {\n elements: {\n [key: string]: {\n primary: string;\n aliases?: string[];\n };\n };\n };\n}\n\ninterface CleanupRecord {\n element: Element;\n mode: string;\n clones: Element[];\n}\n\ninterface DupeOptions {\n hidden: boolean;\n noSelect: boolean;\n}\n\nexport async function init(config: DupeConfig): Promise<{ result: string; destroy: () => void }> {\n // Inject CSS on first init\n injectCSS();\n\n const cleanup: { processedElements: CleanupRecord[] } = {\n processedElements: [],\n };\n\n // Find all elements with dupe attribute\n const dupeElements = querySelectorAll(config, 'wrapper');\n\n dupeElements.forEach((element) => {\n // Get dupe mode (child or self)\n const mode = element.getAttribute('data-hs-dupe');\n if (!mode || (mode !== 'child' && mode !== 'self')) {\n console.warn('[dupe] Invalid mode. Use \"child\" or \"self\":', element);\n return;\n }\n\n // Get dupe count (default: 1)\n const countAttr = element.getAttribute('data-hs-dupe-count');\n let count = countAttr ? parseInt(countAttr, 10) : 1;\n\n // Validate and cap count\n if (isNaN(count) || count < 1) {\n console.warn('[dupe] Invalid count, using default of 1:', element);\n count = 1;\n }\n\n if (count > MAX_DUPE_COUNT) {\n console.warn(\n `[dupe] Count of ${count} exceeds maximum of ${MAX_DUPE_COUNT}. Capping at ${MAX_DUPE_COUNT}.`\n );\n count = MAX_DUPE_COUNT;\n }\n\n // Get modifier options\n const options = {\n hidden: element.hasAttribute('data-hs-dupe-hidden'),\n noSelect: element.hasAttribute('data-hs-dupe-no-select'),\n };\n\n // Execute duplication based on mode\n if (mode === 'child') {\n dupeChild(element, count, options, cleanup);\n } else if (mode === 'self') {\n dupeSelf(element, count, options, cleanup);\n }\n });\n\n return {\n result: `dupe processed ${cleanup.processedElements.length} elements`,\n destroy: () => {\n // Remove all cloned elements\n cleanup.processedElements.forEach(({ clones }) => {\n clones.forEach((clone) => {\n if (clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n });\n cleanup.processedElements.length = 0;\n },\n };\n}\n\nfunction dupeChild(\n element: Element,\n count: number,\n options: DupeOptions,\n cleanup: { processedElements: CleanupRecord[] }\n): void {\n // Get first direct child\n const firstChild = element.children[0];\n\n // Silently skip if no child exists (e.g., empty slot waiting for CMS content)\n if (!firstChild) {\n return;\n }\n\n const clones: Element[] = [];\n\n // Create clones and append as siblings\n for (let i = 0; i < count; i++) {\n const clone = firstChild.cloneNode(true) as Element;\n\n // Disable transitions during insertion\n clone.classList.add(TRANSITION_CLASS);\n\n // Apply modifiers to clone\n applyModifiers(clone, options);\n\n // Append to DOM\n element.appendChild(clone);\n clones.push(clone);\n\n // Force reflow\n (clone as HTMLElement).offsetHeight;\n\n // Re-enable transitions on next frame\n requestAnimationFrame(() => {\n clone.classList.remove(TRANSITION_CLASS);\n });\n }\n\n // Track for cleanup\n cleanup.processedElements.push({\n element,\n mode: 'child',\n clones,\n });\n}\n\nfunction dupeSelf(\n element: Element,\n count: number,\n options: DupeOptions,\n cleanup: { processedElements: CleanupRecord[] }\n): void {\n const parent = element.parentNode;\n\n if (!parent) {\n console.warn('[dupe] Element has no parent, cannot duplicate self:', element);\n return;\n }\n\n const clones: Element[] = [];\n\n // Create clones and insert as next siblings\n let referenceNode: Element | Node = element;\n for (let i = 0; i < count; i++) {\n const clone = element.cloneNode(true) as Element;\n\n // Disable transitions during insertion\n clone.classList.add(TRANSITION_CLASS);\n\n // Remove dupe attributes from clone\n clone.removeAttribute('data-hs-dupe');\n clone.removeAttribute('data-hs-dupe-count');\n clone.removeAttribute('data-hs-dupe-hidden');\n clone.removeAttribute('data-hs-dupe-no-select');\n\n // Apply modifiers to clone\n applyModifiers(clone, options);\n\n // Insert after reference node\n if (referenceNode.nextSibling) {\n parent.insertBefore(clone, referenceNode.nextSibling);\n } else {\n parent.appendChild(clone);\n }\n\n clones.push(clone);\n referenceNode = clone; // Next clone goes after this one\n\n // Force reflow\n (clone as HTMLElement).offsetHeight;\n\n // Re-enable transitions on next frame\n requestAnimationFrame(() => {\n clone.classList.remove(TRANSITION_CLASS);\n });\n }\n\n // Track for cleanup\n cleanup.processedElements.push({\n element,\n mode: 'self',\n clones,\n });\n}\n\nfunction applyModifiers(clone: Element, options: DupeOptions): void {\n // Add aria-hidden if requested\n if (options.hidden) {\n clone.setAttribute('aria-hidden', 'true');\n }\n\n // Add user-select: none if requested\n if (options.noSelect) {\n const htmlClone = clone as HTMLElement;\n htmlClone.style.userSelect = 'none';\n (htmlClone.style as unknown as { webkitUserSelect: string }).webkitUserSelect = 'none';\n (htmlClone.style as unknown as { msUserSelect: string }).msUserSelect = 'none';\n }\n}\n","/**\n * Normalize Orchestrator\n *\n * Sequential DOM normalization: Sync → Clickable → Dupe → Site Settings → Year Replacement.\n * Critical first phase that prepares DOM structure for all other modules.\n */\nimport config from '@config';\nimport { init as syncInit } from './functions/sync.ts';\nimport { init as clickableInit } from './functions/clickable.ts';\nimport { init as dupeInit } from './functions/dupe.ts';\nimport { init as siteSettingsInit } from './functions/site-settings.ts';\nimport { init as yearReplacementInit } from './functions/year-replacement.ts';\n\nconst CONFIG_ROOT = 'normalize';\n\nexport async function init(): Promise<{ result: string; destroy: () => void }> {\n const cleanup: { destroyFunctions: (() => void)[] } = { destroyFunctions: [] };\n const moduleConfig = config[CONFIG_ROOT];\n\n try {\n // Phase 1a: Sync (populates lists with collection data) - must complete first\n const syncResult = await syncInit(\n moduleConfig.sync as unknown as {\n attributes: {\n elements: { item: { primary: string } };\n properties: { syncId: string; syncField: string; syncMode: string };\n };\n }\n );\n if (syncResult && 'destroy' in syncResult && typeof syncResult.destroy === 'function') {\n cleanup.destroyFunctions.push(syncResult.destroy as () => void);\n }\n\n // Phase 1b: Clickable (normalizes button/link structure) - runs after sync creates content\n const clickableResult = await clickableInit();\n if (\n clickableResult &&\n 'destroy' in clickableResult &&\n typeof clickableResult.destroy === 'function'\n ) {\n cleanup.destroyFunctions.push(clickableResult.destroy as () => void);\n }\n\n // Phase 1c: Dupe (duplicates normalized elements)\n const dupeResult = await dupeInit(\n moduleConfig.dupe as unknown as {\n attributes: { elements: { [key: string]: { primary: string; aliases?: string[] } } };\n }\n );\n if (dupeResult && 'destroy' in dupeResult && typeof dupeResult.destroy === 'function') {\n cleanup.destroyFunctions.push(dupeResult.destroy as () => void);\n }\n\n // Phase 1d: Site Settings (applies global site configuration)\n const siteSettingsResult = siteSettingsInit(config.structure?.['site-settings']);\n if (\n siteSettingsResult &&\n 'destroy' in siteSettingsResult &&\n typeof siteSettingsResult.destroy === 'function'\n ) {\n cleanup.destroyFunctions.push(siteSettingsResult.destroy as () => void);\n }\n\n // Phase 1e: Year Replacement (replaces year tokens)\n const yearReplacementResult = yearReplacementInit(config.structure?.['year-replacement']);\n if (\n yearReplacementResult &&\n 'destroy' in yearReplacementResult &&\n typeof yearReplacementResult.destroy === 'function'\n ) {\n cleanup.destroyFunctions.push(yearReplacementResult.destroy as () => void);\n }\n\n return {\n result: 'normalize initialized',\n destroy: () => {\n // Call all destroy functions in reverse order\n cleanup.destroyFunctions.reverse().forEach((destroyFn) => {\n try {\n destroyFn();\n } catch (error) {\n console.error('[normalize] Error during cleanup:', error);\n }\n });\n cleanup.destroyFunctions.length = 0;\n },\n };\n } catch (error) {\n console.error('[normalize] Initialization failed:', error);\n // Cleanup any partial initialization\n cleanup.destroyFunctions.reverse().forEach((fn) => {\n try {\n fn();\n } catch (cleanupError) {\n console.error('[normalize] Error during error cleanup:', cleanupError);\n }\n });\n throw error;\n }\n}\n","/**\n * Clickable Normalization\n *\n * Normalizes clickable wrappers by keeping either button or link based on href validity.\n * Removes the unused element and ensures the kept element has data-hs-clickable=\"button\".\n *\n * Structure:\n * <div data-hs-clickable=\"wrapper\">\n * <button data-hs-clickable=\"button\">Click</button>\n * <a data-hs-clickable=\"button\" href=\"/page\">Click</a>\n * </div>\n *\n * Logic: Keep link if href is valid, otherwise keep button.\n */\nimport { globalConfig, querySelectorAll } from '@utils';\n\ninterface ProcessedWrapper {\n wrapper: Element;\n keptElement: Element;\n wasLink: boolean;\n addedAttribute: boolean;\n}\n\nexport async function init(): Promise<{ result: string; destroy: () => void }> {\n const cleanup: { processedWrappers: ProcessedWrapper[] } = {\n processedWrappers: [],\n };\n\n // Find all clickable wrappers using global clickable config\n const wrappers = querySelectorAll(\n globalConfig.clickable as {\n attributes: { elements: { [key: string]: { primary: string; aliases?: string[] } } };\n },\n 'wrapper'\n );\n\n wrappers.forEach((wrapper) => {\n // Find direct button and link children\n const button = wrapper.querySelector(':scope > button');\n const link = wrapper.querySelector(':scope > a');\n\n // Only process if both exist\n if (!button || !link) return;\n\n // Check if link has valid href\n const href = link.getAttribute('href');\n const hasValidHref = href && href !== '' && href !== '#';\n\n let keptElement: Element;\n let removedElement: Element;\n\n if (hasValidHref) {\n // Keep link, remove button\n keptElement = link;\n removedElement = button;\n } else {\n // Keep button, remove link\n keptElement = button;\n removedElement = link;\n }\n\n // Check if kept element already has data-hs-clickable=\"button\"\n const hadAttribute = keptElement.getAttribute('data-hs-clickable') === 'button';\n\n // Ensure kept element has data-hs-clickable=\"button\"\n if (!hadAttribute) {\n keptElement.setAttribute('data-hs-clickable', 'button');\n }\n\n // Remove the other element\n removedElement.remove();\n\n // Track for cleanup\n cleanup.processedWrappers.push({\n wrapper,\n keptElement,\n wasLink: keptElement === link,\n addedAttribute: !hadAttribute,\n });\n });\n\n return {\n result: `clickable processed ${cleanup.processedWrappers.length} wrappers`,\n destroy: () => {\n // On destroy, we can't restore deleted elements\n // Only remove the attribute if we added it\n cleanup.processedWrappers.forEach(({ keptElement, addedAttribute }) => {\n if (addedAttribute) {\n keptElement.removeAttribute('data-hs-clickable');\n }\n });\n cleanup.processedWrappers.length = 0;\n },\n };\n}\n","/**\n * Site Settings\n *\n * Collects dynamic values from designated elements and replaces {{placeholder}} text throughout the page.\n * Supports both text content and href attributes for proper link handling.\n *\n * Features:\n * - Collects settings from wrapper/list structure with text and href values\n * - Replaces {{name}} placeholders in text content and link hrefs\n * - Complete href replacement for links (prevents Webflow \"https://\" prefix issues)\n * - Conditional hide feature to exclude elements based on class names\n * - One-time replacement on page load (no ongoing observers)\n *\n * Structure:\n * <div data-site-settings-element=\"wrapper\">\n * <div data-site-settings-element=\"list\">\n * <a data-site-settings=\"email\" href=\"mailto:info@example.com\">info@example.com</a>\n * <a data-site-settings=\"phone\" href=\"tel:+15551234567\">(555) 123-4567</a>\n * </div>\n * </div>\n *\n * Usage:\n * Text: \"Contact us at {{email}}\" → \"Contact us at info@example.com\"\n * Link: <a href=\"{{email}}\">Email</a> → <a href=\"mailto:info@example.com\">Email</a>\n */\n\nimport { querySelector, querySelectorAll, getSelector } from '@utils';\n\nexport function init(config) {\n function setupSiteSettings() {\n const wrapper = querySelector(config, 'wrapper');\n\n if (!wrapper) {\n return;\n }\n\n // Find all lists inside the wrapper\n const lists = querySelectorAll(config, 'list', wrapper);\n\n if (lists.length === 0) {\n return;\n }\n\n // Collect all site settings data\n const siteSettings = {};\n\n lists.forEach((list) => {\n // Find all descendants with data-site-settings attribute\n const settingSelector = getSelector(config, 'setting');\n const settingElements = list.querySelectorAll(settingSelector);\n\n settingElements.forEach((element) => {\n // Clone the element to avoid modifying the original DOM\n const clonedElement = element.cloneNode(true) as Element;\n\n // Find and remove elements with data-site-settings-hide that match their classes\n const hideSelector = getSelector(config, 'hide');\n const hideElements = clonedElement.querySelectorAll(hideSelector);\n\n hideElements.forEach((hideElement) => {\n const hideAttr =\n config.attributes.elements.hide.primary.match(/data-site-settings-hide/)[0];\n const hideValue = hideElement.getAttribute(hideAttr);\n\n if (hideValue) {\n // Split by spaces to get all class names to check\n const classesToHide = hideValue.split(' ').filter((c) => c.trim());\n\n // Check if element has any of the classes\n const hasMatchingClass = classesToHide.some((className) =>\n hideElement.classList.contains(className)\n );\n\n // Remove element if it has a matching class\n if (hasMatchingClass) {\n hideElement.remove();\n }\n }\n });\n\n const settingAttr =\n config.attributes.elements.setting.primary.match(/data-site-settings/)[0];\n const settingName = element.getAttribute(settingAttr);\n const settingText = clonedElement.textContent.trim();\n const settingHref = element.getAttribute('href');\n\n // Store if name exists and either text or href exists\n if (settingName && (settingText || settingHref)) {\n siteSettings[settingName] = {\n text: settingText || null,\n href: settingHref || null,\n };\n }\n });\n });\n\n // If no site settings found, exit early\n if (Object.keys(siteSettings).length === 0) {\n return;\n }\n\n // Replace text content efficiently using TreeWalker\n const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, {\n acceptNode: (node) => {\n // Check if any site setting names exist in the text content\n const text = node.textContent;\n for (const name in siteSettings) {\n if (text.includes(`{{${name}}}`)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n }\n return NodeFilter.FILTER_SKIP;\n },\n });\n\n const textNodes = [];\n let node;\n while ((node = walker.nextNode())) {\n textNodes.push(node);\n }\n\n // Replace text in collected nodes\n textNodes.forEach((textNode) => {\n let newText = textNode.textContent;\n let hasChanges = false;\n\n for (const name in siteSettings) {\n const placeholder = `{{${name}}}`;\n if (newText.includes(placeholder)) {\n const setting = siteSettings[name];\n // Use text value if available, otherwise use href value, otherwise skip\n const replacementValue = setting.text || setting.href;\n if (replacementValue) {\n newText = newText.replace(new RegExp(placeholder, 'g'), replacementValue);\n hasChanges = true;\n }\n }\n }\n\n if (hasChanges) {\n textNode.textContent = newText;\n }\n });\n\n // Replace link hrefs\n const links = document.querySelectorAll('a[href]');\n links.forEach((link) => {\n let href = link.getAttribute('href');\n let hasChanges = false;\n\n for (const name in siteSettings) {\n const placeholder = `{{${name}}}`;\n if (href.includes(placeholder)) {\n const setting = siteSettings[name];\n\n // If setting has a dedicated href, completely replace the entire href\n // (prevents Webflow's default \"https://\" from breaking tel:, mailto:, etc.)\n if (setting.href) {\n href = setting.href;\n hasChanges = true;\n }\n // Otherwise, do normal placeholder replacement with text value\n else if (setting.text) {\n href = href.replace(new RegExp(placeholder, 'g'), setting.text);\n hasChanges = true;\n }\n }\n }\n\n if (hasChanges) {\n link.setAttribute('href', href);\n }\n });\n }\n\n setupSiteSettings();\n\n return {\n result: 'site-settings initialized',\n destroy: () => {\n // No cleanup needed - this module only modifies DOM during init\n },\n };\n}\n","/**\n * Year Replacement\n *\n * Automatically replaces {{year}} and {{month}} placeholders with current values.\n * Scans all text nodes on page load and performs one-time replacement.\n *\n * Features:\n * - Case-insensitive placeholder matching\n * - Uses TreeWalker for efficient text node scanning\n * - No ongoing observers (one-time replacement)\n * - Configurable placeholders via config.json\n *\n * Example:\n * \"Copyright {{year}}\" → \"Copyright 2024\"\n * \"{{month}} Newsletter\" → \"January Newsletter\"\n */\n\nexport function init(config) {\n function setupYearReplacement() {\n const currentYear = new Date().getFullYear().toString();\n const monthNames = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ];\n const currentMonth = monthNames[new Date().getMonth()];\n\n const yearPlaceholder = config.attributes.placeholders.year;\n const monthPlaceholder = config.attributes.placeholders.month;\n\n const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, {\n acceptNode: (node) => {\n return node.textContent.includes(yearPlaceholder) ||\n node.textContent.includes(monthPlaceholder)\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_SKIP;\n },\n });\n\n const textNodes = [];\n let node;\n while ((node = walker.nextNode())) {\n textNodes.push(node);\n }\n\n // Create regex patterns from config placeholders\n const yearRegex = new RegExp(yearPlaceholder.replace(/[{}]/g, '\\\\$&'), 'gi');\n const monthRegex = new RegExp(monthPlaceholder.replace(/[{}]/g, '\\\\$&'), 'gi');\n\n textNodes.forEach((textNode) => {\n let newText = textNode.textContent.replace(yearRegex, currentYear);\n newText = newText.replace(monthRegex, currentMonth);\n if (newText !== textNode.textContent) {\n textNode.textContent = newText;\n }\n });\n }\n\n setupYearReplacement();\n\n return {\n result: 'year-replacement initialized',\n destroy: () => {\n // No cleanup needed - this is a one-time text replacement\n },\n };\n}\n"],"names":["getTextNodes","element","textNodes","walker","document","createTreeWalker","NodeFilter","SHOW_TEXT","node","nextNode","nodeValue","trim","push","getHrefElements","hrefs","hasAttribute","Array","from","querySelectorAll","findElementWithSrc","getAttribute","descendant","querySelector","syncItemData","sourceItem","targetClone","config","item","fieldAttr","attributes","properties","syncField","usesFieldBasedSync","forEach","sourceField","fieldName","targetField","sourceImgElement","targetImgElement","src","setAttribute","href","sourceTextNodes","sourceText","length","textContent","targetTextNodes","syncFieldBasedData","sourceHrefs","sourceHref","el","TRANSITION_CLASS","cssInjected","async","init","style","createElement","head","appendChild","injectCSS","cleanup","processedElements","mode","console","warn","countAttr","count","parseInt","isNaN","options","hidden","noSelect","firstChild","children","clones","i","clone","cloneNode","classList","add","applyModifiers","offsetHeight","requestAnimationFrame","remove","dupeChild","parent","parentNode","referenceNode","removeAttribute","nextSibling","insertBefore","dupeSelf","result","destroy","removeChild","htmlClone","userSelect","webkitUserSelect","msUserSelect","destroyFunctions","moduleConfig","syncResult","sourceLists","sourceMap","Map","source","syncId","set","targetLists","syncedCount","skippedCount","target","has","get","targetTemplateWrapper","isChildMode","syncMode","ignoreElement","sourceItems","template","firstElementChild","elements","primary","split","insertAfterIgnore","currentElement","nextElementSibling","childClone","child","syncedItems","map","syncInit","sync","clickableResult","processedWrappers","globalConfig","clickable","wrapper","button","link","keptElement","removedElement","hadAttribute","wasLink","addedAttribute","clickableInit","dupeResult","dupeInit","dupe","siteSettingsResult","structure","lists","siteSettings","list","settingSelector","getSelector","clonedElement","hideSelector","hideElement","hideAttr","hide","match","hideValue","filter","c","some","className","contains","settingAttr","setting","settingName","settingText","settingHref","text","Object","keys","body","acceptNode","name","includes","FILTER_ACCEPT","FILTER_SKIP","textNode","newText","hasChanges","placeholder","replacementValue","replace","RegExp","setupSiteSettings","yearReplacementResult","currentYear","Date","getFullYear","toString","currentMonth","getMonth","yearPlaceholder","placeholders","year","monthPlaceholder","month","yearRegex","monthRegex","setupYearReplacement","yearReplacementInit","reverse","destroyFn","error","fn","cleanupError"],"mappings":"qLA4CA,SAASA,EAAaC,GACpB,MAAMC,EAAoB,GACpBC,EAASC,SAASC,iBAAiBJ,EAASK,WAAWC,UAAW,MAExE,IAAIC,EACJ,KAAQA,EAAOL,EAAOM,YAEhBD,EAAKE,WAAWC,QAClBT,EAAUU,KAAKJ,GAInB,OAAON,CACT,CAKA,SAASW,EAAgBZ,GACvB,MAAMa,EAAmB,GAUzB,OAPIb,EAAQc,aAAa,SACvBD,EAAMF,KAAKX,GAIba,EAAMF,QAAQI,MAAMC,K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pBP,EAAUU,KAAKJ,GAIjB,MAAMkM,EAAY,IAAId,OAAOS,EAAgBV,QAAQ,QAAS,QAAS,MACjEgB,EAAa,IAAIf,OAAOY,EAAiBb,QAAQ,QAAS,QAAS,MAEzEzL,EAAU+B,QAASqJ,IACjB,IAAIC,EAAUD,EAASzI,YAAY8I,QAAQe,EAAWX,GACtDR,EAAUA,EAAQI,QAAQgB,EAAYR,GAClCZ,IAAYD,EAASzI,cACvByI,EAASzI,YAAc0I,IAG7B,CAEAqB,GAEO,CACLhH,OAAQ,+BACRC,QAAS,OAIb,CHXkCgH,CAAoBnL,EAAO4H,YAAY,qBASrE,OAPEwC,GACA,YAAaA,GAC4B,mBAAlCA,EAAsBjG,SAE7BjC,EAAQuC,iBAAiBvF,KAAKkL,EAAsBjG,SAG/C,CACLD,OAAQ,wBACRC,QAAS,KAEPjC,EAAQuC,iBAAiB2G,UAAU7K,QAAS8K,IAC1C,IACEA,GACF,OAASC,GACPjJ,QAAQiJ,MAAM,oCAAqCA,EACrD,IAEFpJ,EAAQuC,iBAAiBvD,OAAS,GAGxC,OAASoK,GAUP,MATAjJ,QAAQiJ,MAAM,qCAAsCA,GAEpDpJ,EAAQuC,iBAAiB2G,UAAU7K,QAASgL,IAC1C,IACEA,GACF,OAASC,GACPnJ,QAAQiJ,MAAM,0CAA2CE,EAC3D,IAEIF,CACR,CEtEK,IAActL,CFuErB"}
1
+ {"version":3,"file":"hs-normalize-iTnWVIjq.js","sources":["../../src/modules/normalize/functions/sync.ts","../../src/modules/normalize/functions/dupe.ts","../../src/modules/normalize/normalize.ts","../../src/modules/normalize/functions/clickable.ts","../../src/modules/normalize/functions/site-settings.ts","../../src/modules/normalize/functions/year-replacement.ts"],"sourcesContent":["/**\n * List Sync\n *\n * Syncs collection list data to static lists by sync-id.\n *\n * Simple mode (text/href):\n * <div data-hs-sync=\"source\" data-hs-sync-id=\"services\">\n * <a data-hs-sync=\"item\" href=\"/service-1\">Service 1</a>\n * </div>\n * <div data-hs-sync=\"target\" data-hs-sync-id=\"services\">\n * <a data-hs-sync=\"item\" href=\"#\">Placeholder</a>\n * </div>\n *\n * Field-based mode (named fields):\n * <div data-hs-sync=\"source\" data-hs-sync-id=\"projects\">\n * <div data-hs-sync=\"item\">\n * <img data-hs-sync-field=\"before\" src=\"/before.jpg\">\n * <img data-hs-sync-field=\"after\" src=\"/after.jpg\">\n * </div>\n * </div>\n * <div data-hs-sync=\"target\" data-hs-sync-id=\"projects\">\n * <div data-hs-sync=\"item\">\n * <img data-hs-sync-field=\"before\" src=\"/placeholder.jpg\">\n * <img data-hs-sync-field=\"after\" src=\"/placeholder.jpg\">\n * </div>\n * </div>\n *\n * Child mode (wrapper templates):\n * <div data-hs-sync=\"target\" data-hs-sync-id=\"marquee\">\n * <div data-hs-sync=\"item\" data-hs-sync-mode=\"child\">\n * <div class=\"marquee_list\">\n * <img data-hs-sync-field=\"image\" src=\"/placeholder.jpg\">\n * </div>\n * </div>\n * </div>\n *\n * Supports data-hs-sync=\"ignore\" to preserve elements during sync.\n */\n\nimport { querySelectorAll, querySelector } from '@utils';\n\n/**\n * Get all text nodes within an element\n */\nfunction getTextNodes(element: Element): Text[] {\n const textNodes: Text[] = [];\n const walker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT, null);\n\n let node: Node | null;\n while ((node = walker.nextNode())) {\n // Skip empty/whitespace-only nodes\n if (node.nodeValue?.trim()) {\n textNodes.push(node as Text);\n }\n }\n\n return textNodes;\n}\n\n/**\n * Get all elements with href attribute (including the element itself)\n */\nfunction getHrefElements(element: Element): Element[] {\n const hrefs: Element[] = [];\n\n // Check if element itself has href\n if (element.hasAttribute('href')) {\n hrefs.push(element);\n }\n\n // Check descendants\n hrefs.push(...Array.from(element.querySelectorAll('[href]')));\n\n return hrefs;\n}\n\n/**\n * Check if item uses field-based syncing\n */\nfunction usesFieldBasedSync(\n item: Element,\n config: { attributes: { properties: { syncField: string } } }\n): boolean {\n const fieldAttr = config.attributes.properties.syncField;\n return item.querySelector(`[${fieldAttr}]`) !== null;\n}\n\n/**\n * Find element with src attribute (check element itself, then descendants)\n */\nfunction findElementWithSrc(element: Element): Element | null {\n // Check element itself\n if (element.hasAttribute('src')) {\n const src = element.getAttribute('src');\n if (src) return element;\n }\n\n // Check descendants\n const descendant = element.querySelector('[src]');\n if (descendant) {\n const src = descendant.getAttribute('src');\n if (src) return descendant;\n }\n\n return null;\n}\n\n/**\n * Sync data using field-based mapping\n * Maps fields by name between source and target\n */\nfunction syncFieldBasedData(\n sourceItem: Element,\n targetClone: Element,\n config: { attributes: { properties: { syncField: string } } }\n): void {\n const fieldAttr = config.attributes.properties.syncField;\n\n // Get all fields in source\n const sourceFields = sourceItem.querySelectorAll(`[${fieldAttr}]`);\n\n sourceFields.forEach((sourceField: Element) => {\n const fieldName = sourceField.getAttribute(fieldAttr);\n\n // Find matching field in target\n const targetField = targetClone.querySelector(`[${fieldAttr}=\"${fieldName}\"]`);\n if (!targetField) return;\n\n // Try to find elements with src (for images)\n const sourceImgElement = findElementWithSrc(sourceField);\n const targetImgElement = findElementWithSrc(targetField);\n\n if (sourceImgElement && targetImgElement) {\n // Sync src attribute\n const src = sourceImgElement.getAttribute('src');\n if (src) {\n targetImgElement.setAttribute('src', src);\n }\n }\n // Link elements: sync href\n else if (sourceField.hasAttribute('href') && targetField.hasAttribute('href')) {\n const href = sourceField.getAttribute('href');\n if (href) {\n targetField.setAttribute('href', href);\n }\n }\n // Text elements: sync text content\n else {\n const sourceTextNodes = getTextNodes(sourceField);\n const sourceText =\n sourceTextNodes.length > 0 ? sourceTextNodes[0].nodeValue : sourceField.textContent.trim();\n\n if (sourceText) {\n const targetTextNodes = getTextNodes(targetField);\n if (targetTextNodes.length > 0) {\n targetTextNodes[0].nodeValue = sourceText;\n } else {\n targetField.textContent = sourceText;\n }\n }\n }\n });\n}\n\n/**\n * Sync data from source item to target clone\n * Extracts text and href from source, applies to ALL matching elements in target\n */\nfunction syncItemData(\n sourceItem: Element,\n targetClone: Element,\n config: { attributes: { properties: { syncField: string } } }\n): void {\n // Check if using field-based syncing\n if (usesFieldBasedSync(targetClone, config)) {\n syncFieldBasedData(sourceItem, targetClone, config);\n return;\n }\n\n // Fallback to simple syncing (existing behavior)\n // Get text content from source (first non-empty text node)\n const sourceTextNodes = getTextNodes(sourceItem);\n const sourceText = sourceTextNodes.length > 0 ? sourceTextNodes[0].nodeValue : '';\n\n // Get href from source (first href element)\n const sourceHrefs = getHrefElements(sourceItem);\n const sourceHref = sourceHrefs.length > 0 ? sourceHrefs[0].getAttribute('href') : '';\n\n // Apply source text to ALL text nodes in target\n if (sourceText) {\n const targetTextNodes = getTextNodes(targetClone);\n targetTextNodes.forEach((node) => {\n node.nodeValue = sourceText;\n });\n }\n\n // Apply source href to ALL href elements in target\n if (sourceHref) {\n const targetHrefs = getHrefElements(targetClone);\n targetHrefs.forEach((el) => {\n el.setAttribute('href', sourceHref);\n });\n }\n}\n\ninterface SyncConfig {\n attributes: {\n elements: {\n item: { primary: string };\n };\n properties: {\n syncId: string;\n syncField: string;\n syncMode: string;\n };\n };\n}\n\nexport async function init(config: SyncConfig): Promise<{ result: string }> {\n // Find all source lists and build map by sync-id\n const sourceLists = querySelectorAll(config, 'source');\n const sourceMap = new Map<string, Element>();\n\n sourceLists.forEach((source) => {\n const syncId = source.getAttribute(config.attributes.properties.syncId);\n if (syncId) {\n sourceMap.set(syncId, source);\n }\n });\n\n // Find all target lists\n const targetLists = querySelectorAll(config, 'target');\n let syncedCount = 0;\n let skippedCount = 0;\n\n targetLists.forEach((target) => {\n const syncId = target.getAttribute(config.attributes.properties.syncId);\n\n // Skip if no sync-id or no matching source\n if (!syncId || !sourceMap.has(syncId)) {\n skippedCount++;\n return;\n }\n\n const source = sourceMap.get(syncId);\n\n // Find item template in target (element to clone)\n const targetTemplateWrapper = querySelector(config, 'item', target);\n if (!targetTemplateWrapper) {\n console.warn(`[sync] Target list \"${syncId}\" missing item template`);\n return;\n }\n\n // Check sync mode - determines which element to use as template\n const syncMode = targetTemplateWrapper.getAttribute(config.attributes.properties.syncMode);\n const isChildMode = syncMode === 'child';\n\n // Find ignore element in target (if exists)\n const ignoreElement = querySelector(config, 'ignore', target);\n\n // Find all source items\n const sourceItems = querySelectorAll(config, 'item', source);\n if (sourceItems.length === 0) {\n console.warn(`[sync] Source list \"${syncId}\" has no items`);\n return;\n }\n\n // Determine template based on mode\n let template: Element;\n if (isChildMode) {\n // Child mode: clone the wrapper, we'll replace its child content\n const firstChild = targetTemplateWrapper.firstElementChild;\n if (!firstChild) {\n console.warn(\n `[sync] Target list \"${syncId}\" has sync-mode=\"child\" but item wrapper has no children`\n );\n return;\n }\n // Clone the child element to use for syncing data\n template = firstChild.cloneNode(true) as Element;\n } else {\n // Default mode: clone the item element itself\n template = targetTemplateWrapper.cloneNode(true) as Element;\n template.removeAttribute(config.attributes.elements.item.primary.split('=')[0]);\n }\n\n // Determine insertion strategy if ignore exists\n let insertAfterIgnore = false;\n if (ignoreElement) {\n // Check if template wrapper comes after ignore element\n let currentElement = ignoreElement.nextElementSibling;\n while (currentElement) {\n if (currentElement === targetTemplateWrapper) {\n insertAfterIgnore = true;\n break;\n }\n currentElement = currentElement.nextElementSibling;\n }\n }\n\n if (isChildMode) {\n // CHILD MODE: Keep wrapper as single element, duplicate children inside it\n // Clear the wrapper's children\n while (targetTemplateWrapper.firstChild) {\n targetTemplateWrapper.removeChild(targetTemplateWrapper.firstChild);\n }\n\n // Create synced children and append to the wrapper\n sourceItems.forEach((sourceItem) => {\n const childClone = template.cloneNode(true) as Element;\n syncItemData(sourceItem, childClone, config);\n targetTemplateWrapper.appendChild(childClone);\n });\n\n // Remove data-hs-sync=\"item\" attribute from wrapper\n targetTemplateWrapper.removeAttribute(config.attributes.elements.item.primary.split('=')[0]);\n } else {\n // DEFAULT MODE: Duplicate the item element itself\n // Clear target list, but preserve ignore element\n const children = Array.from(target.children);\n children.forEach((child) => {\n if (child !== ignoreElement) {\n child.remove();\n }\n });\n\n // Create synced items\n const syncedItems = Array.from(sourceItems).map((sourceItem) => {\n const clone = template.cloneNode(true) as Element;\n syncItemData(sourceItem, clone, config);\n return clone;\n });\n\n // Insert synced items based on strategy\n if (ignoreElement) {\n if (insertAfterIgnore) {\n // Insert all items after ignore\n syncedItems.forEach((item) => {\n target.appendChild(item);\n });\n } else {\n // Insert all items before ignore\n syncedItems.forEach((item) => {\n target.insertBefore(item, ignoreElement);\n });\n }\n } else {\n // No ignore element, just append all\n syncedItems.forEach((item) => {\n target.appendChild(item);\n });\n }\n }\n\n syncedCount++;\n });\n\n return {\n result: `sync initialized (${syncedCount} synced, ${skippedCount} skipped)`,\n };\n}\n","/**\n * Element Duplication\n *\n * Duplicates elements for marquee effects and visual consistency.\n *\n * Child mode (duplicate children):\n * <div data-hs-dupe=\"child\" data-hs-dupe-count=\"2\">\n * <div class=\"marquee_item\">Content</div>\n * </div>\n *\n * Self mode (duplicate wrapper):\n * <div data-hs-dupe=\"self\" data-hs-dupe-count=\"3\">Content</div>\n *\n * Modifiers: data-hs-dupe-hidden (aria-hidden), data-hs-dupe-no-select (disable selection).\n */\nimport { querySelectorAll } from '@utils';\n\nconst MAX_DUPE_COUNT = 20;\nconst TRANSITION_CLASS = 'hs-dupe-no-transition';\n\n// Inject CSS once\nlet cssInjected = false;\nfunction injectCSS(): void {\n if (cssInjected) return;\n\n const style = document.createElement('style');\n style.textContent = `\n .${TRANSITION_CLASS},\n .${TRANSITION_CLASS} * {\n transition: none !important;\n animation: none !important;\n }\n `;\n document.head.appendChild(style);\n cssInjected = true;\n}\n\ninterface DupeConfig {\n attributes: {\n elements: {\n [key: string]: {\n primary: string;\n aliases?: string[];\n };\n };\n };\n}\n\ninterface CleanupRecord {\n element: Element;\n mode: string;\n clones: Element[];\n}\n\ninterface DupeOptions {\n hidden: boolean;\n noSelect: boolean;\n}\n\nexport async function init(config: DupeConfig): Promise<{ result: string; destroy: () => void }> {\n // Inject CSS on first init\n injectCSS();\n\n const cleanup: { processedElements: CleanupRecord[] } = {\n processedElements: [],\n };\n\n // Find all elements with dupe attribute\n const dupeElements = querySelectorAll(config, 'wrapper');\n\n dupeElements.forEach((element) => {\n // Get dupe mode (child or self)\n const mode = element.getAttribute('data-hs-dupe');\n if (!mode || (mode !== 'child' && mode !== 'self')) {\n console.warn('[dupe] Invalid mode. Use \"child\" or \"self\":', element);\n return;\n }\n\n // Get dupe count (default: 1)\n const countAttr = element.getAttribute('data-hs-dupe-count');\n let count = countAttr ? parseInt(countAttr, 10) : 1;\n\n // Validate and cap count\n if (isNaN(count) || count < 1) {\n console.warn('[dupe] Invalid count, using default of 1:', element);\n count = 1;\n }\n\n if (count > MAX_DUPE_COUNT) {\n console.warn(\n `[dupe] Count of ${count} exceeds maximum of ${MAX_DUPE_COUNT}. Capping at ${MAX_DUPE_COUNT}.`\n );\n count = MAX_DUPE_COUNT;\n }\n\n // Get modifier options\n const options = {\n hidden: element.hasAttribute('data-hs-dupe-hidden'),\n noSelect: element.hasAttribute('data-hs-dupe-no-select'),\n };\n\n // Execute duplication based on mode\n if (mode === 'child') {\n dupeChild(element, count, options, cleanup);\n } else if (mode === 'self') {\n dupeSelf(element, count, options, cleanup);\n }\n });\n\n return {\n result: `dupe processed ${cleanup.processedElements.length} elements`,\n destroy: () => {\n // Remove all cloned elements\n cleanup.processedElements.forEach(({ clones }) => {\n clones.forEach((clone) => {\n if (clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n });\n cleanup.processedElements.length = 0;\n },\n };\n}\n\nfunction dupeChild(\n element: Element,\n count: number,\n options: DupeOptions,\n cleanup: { processedElements: CleanupRecord[] }\n): void {\n // Get first direct child\n const firstChild = element.children[0];\n\n // Silently skip if no child exists (e.g., empty slot waiting for CMS content)\n if (!firstChild) {\n return;\n }\n\n const clones: Element[] = [];\n\n // Create clones and append as siblings\n for (let i = 0; i < count; i++) {\n const clone = firstChild.cloneNode(true) as Element;\n\n // Disable transitions during insertion\n clone.classList.add(TRANSITION_CLASS);\n\n // Apply modifiers to clone\n applyModifiers(clone, options);\n\n // Append to DOM\n element.appendChild(clone);\n clones.push(clone);\n\n // Force reflow\n (clone as HTMLElement).offsetHeight;\n\n // Re-enable transitions on next frame\n requestAnimationFrame(() => {\n clone.classList.remove(TRANSITION_CLASS);\n });\n }\n\n // Track for cleanup\n cleanup.processedElements.push({\n element,\n mode: 'child',\n clones,\n });\n}\n\nfunction dupeSelf(\n element: Element,\n count: number,\n options: DupeOptions,\n cleanup: { processedElements: CleanupRecord[] }\n): void {\n const parent = element.parentNode;\n\n if (!parent) {\n console.warn('[dupe] Element has no parent, cannot duplicate self:', element);\n return;\n }\n\n const clones: Element[] = [];\n\n // Create clones and insert as next siblings\n let referenceNode: Element | Node = element;\n for (let i = 0; i < count; i++) {\n const clone = element.cloneNode(true) as Element;\n\n // Disable transitions during insertion\n clone.classList.add(TRANSITION_CLASS);\n\n // Remove dupe attributes from clone\n clone.removeAttribute('data-hs-dupe');\n clone.removeAttribute('data-hs-dupe-count');\n clone.removeAttribute('data-hs-dupe-hidden');\n clone.removeAttribute('data-hs-dupe-no-select');\n\n // Apply modifiers to clone\n applyModifiers(clone, options);\n\n // Insert after reference node\n if (referenceNode.nextSibling) {\n parent.insertBefore(clone, referenceNode.nextSibling);\n } else {\n parent.appendChild(clone);\n }\n\n clones.push(clone);\n referenceNode = clone; // Next clone goes after this one\n\n // Force reflow\n (clone as HTMLElement).offsetHeight;\n\n // Re-enable transitions on next frame\n requestAnimationFrame(() => {\n clone.classList.remove(TRANSITION_CLASS);\n });\n }\n\n // Track for cleanup\n cleanup.processedElements.push({\n element,\n mode: 'self',\n clones,\n });\n}\n\nfunction applyModifiers(clone: Element, options: DupeOptions): void {\n // Add aria-hidden if requested\n if (options.hidden) {\n clone.setAttribute('aria-hidden', 'true');\n }\n\n // Add user-select: none if requested\n if (options.noSelect) {\n const htmlClone = clone as HTMLElement;\n htmlClone.style.userSelect = 'none';\n (htmlClone.style as unknown as { webkitUserSelect: string }).webkitUserSelect = 'none';\n (htmlClone.style as unknown as { msUserSelect: string }).msUserSelect = 'none';\n }\n}\n","/**\n * Normalize Orchestrator\n *\n * Sequential DOM normalization: Sync → Clickable → Dupe → Site Settings → Year Replacement.\n * Critical first phase that prepares DOM structure for all other modules.\n */\nimport config from '@config';\nimport { init as syncInit } from './functions/sync.ts';\nimport { init as clickableInit } from './functions/clickable.ts';\nimport { init as dupeInit } from './functions/dupe.ts';\nimport { init as siteSettingsInit } from './functions/site-settings.ts';\nimport { init as yearReplacementInit } from './functions/year-replacement.ts';\n\nconst CONFIG_ROOT = 'normalize';\n\nexport async function init(): Promise<{ result: string; destroy: () => void }> {\n const cleanup: { destroyFunctions: (() => void)[] } = { destroyFunctions: [] };\n const moduleConfig = config[CONFIG_ROOT];\n\n try {\n // Phase 1a: Sync (populates lists with collection data) - must complete first\n const syncResult = await syncInit(\n moduleConfig.sync as unknown as {\n attributes: {\n elements: { item: { primary: string } };\n properties: { syncId: string; syncField: string; syncMode: string };\n };\n }\n );\n if (syncResult && 'destroy' in syncResult && typeof syncResult.destroy === 'function') {\n cleanup.destroyFunctions.push(syncResult.destroy as () => void);\n }\n\n // Phase 1b: Clickable (normalizes button/link structure) - runs after sync creates content\n const clickableResult = await clickableInit();\n if (\n clickableResult &&\n 'destroy' in clickableResult &&\n typeof clickableResult.destroy === 'function'\n ) {\n cleanup.destroyFunctions.push(clickableResult.destroy as () => void);\n }\n\n // Phase 1c: Dupe (duplicates normalized elements)\n const dupeResult = await dupeInit(\n moduleConfig.dupe as unknown as {\n attributes: { elements: { [key: string]: { primary: string; aliases?: string[] } } };\n }\n );\n if (dupeResult && 'destroy' in dupeResult && typeof dupeResult.destroy === 'function') {\n cleanup.destroyFunctions.push(dupeResult.destroy as () => void);\n }\n\n // Phase 1d: Site Settings (applies global site configuration)\n const siteSettingsResult = siteSettingsInit(config.structure?.['site-settings']);\n if (\n siteSettingsResult &&\n 'destroy' in siteSettingsResult &&\n typeof siteSettingsResult.destroy === 'function'\n ) {\n cleanup.destroyFunctions.push(siteSettingsResult.destroy as () => void);\n }\n\n // Phase 1e: Year Replacement (replaces year tokens)\n const yearReplacementResult = yearReplacementInit(config.structure?.['year-replacement']);\n if (\n yearReplacementResult &&\n 'destroy' in yearReplacementResult &&\n typeof yearReplacementResult.destroy === 'function'\n ) {\n cleanup.destroyFunctions.push(yearReplacementResult.destroy as () => void);\n }\n\n return {\n result: 'normalize initialized',\n destroy: () => {\n // Call all destroy functions in reverse order\n cleanup.destroyFunctions.reverse().forEach((destroyFn) => {\n try {\n destroyFn();\n } catch (error) {\n console.error('[normalize] Error during cleanup:', error);\n }\n });\n cleanup.destroyFunctions.length = 0;\n },\n };\n } catch (error) {\n console.error('[normalize] Initialization failed:', error);\n // Cleanup any partial initialization\n cleanup.destroyFunctions.reverse().forEach((fn) => {\n try {\n fn();\n } catch (cleanupError) {\n console.error('[normalize] Error during error cleanup:', cleanupError);\n }\n });\n throw error;\n }\n}\n","/**\n * Clickable Normalization\n *\n * Normalizes clickable wrappers by keeping either button or link based on href validity.\n * Removes the unused element and ensures the kept element has data-hs-clickable=\"button\".\n *\n * Structure:\n * <div data-hs-clickable=\"wrapper\">\n * <button data-hs-clickable=\"button\">Click</button>\n * <a data-hs-clickable=\"button\" href=\"/page\">Click</a>\n * </div>\n *\n * Logic: Keep link if href is valid, otherwise keep button.\n */\nimport { globalConfig, querySelectorAll } from '@utils';\n\ninterface ProcessedWrapper {\n wrapper: Element;\n keptElement: Element;\n wasLink: boolean;\n addedAttribute: boolean;\n}\n\nexport async function init(): Promise<{ result: string; destroy: () => void }> {\n const cleanup: { processedWrappers: ProcessedWrapper[] } = {\n processedWrappers: [],\n };\n\n // Find all clickable wrappers using global clickable config\n const wrappers = querySelectorAll(\n globalConfig.clickable as {\n attributes: { elements: { [key: string]: { primary: string; aliases?: string[] } } };\n },\n 'wrapper'\n );\n\n wrappers.forEach((wrapper) => {\n // Find direct button and link children\n const button = wrapper.querySelector(':scope > button');\n const link = wrapper.querySelector(':scope > a');\n\n // Only process if both exist\n if (!button || !link) return;\n\n // Check if link has valid href\n const href = link.getAttribute('href');\n const hasValidHref = href && href !== '' && href !== '#';\n\n let keptElement: Element;\n let removedElement: Element;\n\n if (hasValidHref) {\n // Keep link, remove button\n keptElement = link;\n removedElement = button;\n } else {\n // Keep button, remove link\n keptElement = button;\n removedElement = link;\n }\n\n // Check if kept element already has data-hs-clickable=\"button\"\n const hadAttribute = keptElement.getAttribute('data-hs-clickable') === 'button';\n\n // Ensure kept element has data-hs-clickable=\"button\"\n if (!hadAttribute) {\n keptElement.setAttribute('data-hs-clickable', 'button');\n }\n\n // Remove the other element\n removedElement.remove();\n\n // Track for cleanup\n cleanup.processedWrappers.push({\n wrapper,\n keptElement,\n wasLink: keptElement === link,\n addedAttribute: !hadAttribute,\n });\n });\n\n return {\n result: `clickable processed ${cleanup.processedWrappers.length} wrappers`,\n destroy: () => {\n // On destroy, we can't restore deleted elements\n // Only remove the attribute if we added it\n cleanup.processedWrappers.forEach(({ keptElement, addedAttribute }) => {\n if (addedAttribute) {\n keptElement.removeAttribute('data-hs-clickable');\n }\n });\n cleanup.processedWrappers.length = 0;\n },\n };\n}\n","/**\n * Site Settings\n *\n * Collects dynamic values from designated elements and replaces {{placeholder}} text throughout the page.\n * Supports both text content and href attributes for proper link handling.\n *\n * Features:\n * - Collects settings from wrapper/list structure with text and href values\n * - Replaces {{name}} placeholders in text content and link hrefs\n * - Complete href replacement for links (prevents Webflow \"https://\" prefix issues)\n * - Conditional hide feature to exclude elements based on class names\n * - One-time replacement on page load (no ongoing observers)\n *\n * Structure:\n * <div data-site-settings-element=\"wrapper\">\n * <div data-site-settings-element=\"list\">\n * <a data-site-settings=\"email\" href=\"mailto:info@example.com\">info@example.com</a>\n * <a data-site-settings=\"phone\" href=\"tel:+15551234567\">(555) 123-4567</a>\n * </div>\n * </div>\n *\n * Usage:\n * Text: \"Contact us at {{email}}\" → \"Contact us at info@example.com\"\n * Link: <a href=\"{{email}}\">Email</a> → <a href=\"mailto:info@example.com\">Email</a>\n */\n\nimport { querySelector, querySelectorAll, getSelector } from '@utils';\n\nexport function init(config) {\n function setupSiteSettings() {\n const wrapper = querySelector(config, 'wrapper');\n\n if (!wrapper) {\n return;\n }\n\n // Find all lists inside the wrapper\n const lists = querySelectorAll(config, 'list', wrapper);\n\n if (lists.length === 0) {\n return;\n }\n\n // Collect all site settings data\n const siteSettings = {};\n\n lists.forEach((list) => {\n // Find all descendants with data-site-settings attribute\n const settingSelector = getSelector(config, 'setting');\n const settingElements = list.querySelectorAll(settingSelector);\n\n settingElements.forEach((element) => {\n // Clone the element to avoid modifying the original DOM\n const clonedElement = element.cloneNode(true) as Element;\n\n // Find and remove elements with data-site-settings-hide that match their classes\n const hideSelector = getSelector(config, 'hide');\n const hideElements = clonedElement.querySelectorAll(hideSelector);\n\n hideElements.forEach((hideElement) => {\n const hideAttr =\n config.attributes.elements.hide.primary.match(/data-site-settings-hide/)[0];\n const hideValue = hideElement.getAttribute(hideAttr);\n\n if (hideValue) {\n // Split by spaces to get all class names to check\n const classesToHide = hideValue.split(' ').filter((c) => c.trim());\n\n // Check if element has any of the classes\n const hasMatchingClass = classesToHide.some((className) =>\n hideElement.classList.contains(className)\n );\n\n // Remove element if it has a matching class\n if (hasMatchingClass) {\n hideElement.remove();\n }\n }\n });\n\n const settingAttr =\n config.attributes.elements.setting.primary.match(/data-site-settings/)[0];\n const settingName = element.getAttribute(settingAttr);\n const settingText = clonedElement.textContent.trim();\n const settingHref = element.getAttribute('href');\n\n // Store if name exists and either text or href exists\n if (settingName && (settingText || settingHref)) {\n siteSettings[settingName] = {\n text: settingText || null,\n href: settingHref || null,\n };\n }\n });\n });\n\n // If no site settings found, exit early\n if (Object.keys(siteSettings).length === 0) {\n return;\n }\n\n // Replace text content efficiently using TreeWalker\n const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, {\n acceptNode: (node) => {\n // Check if any site setting names exist in the text content\n const text = node.textContent;\n for (const name in siteSettings) {\n if (text.includes(`{{${name}}}`)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n }\n return NodeFilter.FILTER_SKIP;\n },\n });\n\n const textNodes = [];\n let node;\n while ((node = walker.nextNode())) {\n textNodes.push(node);\n }\n\n // Replace text in collected nodes\n textNodes.forEach((textNode) => {\n let newText = textNode.textContent;\n let hasChanges = false;\n\n for (const name in siteSettings) {\n const placeholder = `{{${name}}}`;\n if (newText.includes(placeholder)) {\n const setting = siteSettings[name];\n // Use text value if available, otherwise use href value, otherwise skip\n const replacementValue = setting.text || setting.href;\n if (replacementValue) {\n newText = newText.replace(new RegExp(placeholder, 'g'), replacementValue);\n hasChanges = true;\n }\n }\n }\n\n if (hasChanges) {\n textNode.textContent = newText;\n }\n });\n\n // Replace link hrefs\n const links = document.querySelectorAll('a[href]');\n links.forEach((link) => {\n let href = link.getAttribute('href');\n let hasChanges = false;\n\n for (const name in siteSettings) {\n const placeholder = `{{${name}}}`;\n if (href.includes(placeholder)) {\n const setting = siteSettings[name];\n\n // If setting has a dedicated href, completely replace the entire href\n // (prevents Webflow's default \"https://\" from breaking tel:, mailto:, etc.)\n if (setting.href) {\n href = setting.href;\n hasChanges = true;\n }\n // Otherwise, do normal placeholder replacement with text value\n else if (setting.text) {\n href = href.replace(new RegExp(placeholder, 'g'), setting.text);\n hasChanges = true;\n }\n }\n }\n\n if (hasChanges) {\n link.setAttribute('href', href);\n }\n });\n }\n\n setupSiteSettings();\n\n return {\n result: 'site-settings initialized',\n destroy: () => {\n // No cleanup needed - this module only modifies DOM during init\n },\n };\n}\n","/**\n * Year Replacement\n *\n * Automatically replaces {{year}} and {{month}} placeholders with current values.\n * Scans all text nodes on page load and performs one-time replacement.\n *\n * Features:\n * - Case-insensitive placeholder matching\n * - Uses TreeWalker for efficient text node scanning\n * - No ongoing observers (one-time replacement)\n * - Configurable placeholders via config.json\n *\n * Example:\n * \"Copyright {{year}}\" → \"Copyright 2024\"\n * \"{{month}} Newsletter\" → \"January Newsletter\"\n */\n\nexport function init(config) {\n function setupYearReplacement() {\n const currentYear = new Date().getFullYear().toString();\n const monthNames = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ];\n const currentMonth = monthNames[new Date().getMonth()];\n\n const yearPlaceholder = config.attributes.placeholders.year;\n const monthPlaceholder = config.attributes.placeholders.month;\n\n const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, {\n acceptNode: (node) => {\n return node.textContent.includes(yearPlaceholder) ||\n node.textContent.includes(monthPlaceholder)\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_SKIP;\n },\n });\n\n const textNodes = [];\n let node;\n while ((node = walker.nextNode())) {\n textNodes.push(node);\n }\n\n // Create regex patterns from config placeholders\n const yearRegex = new RegExp(yearPlaceholder.replace(/[{}]/g, '\\\\$&'), 'gi');\n const monthRegex = new RegExp(monthPlaceholder.replace(/[{}]/g, '\\\\$&'), 'gi');\n\n textNodes.forEach((textNode) => {\n let newText = textNode.textContent.replace(yearRegex, currentYear);\n newText = newText.replace(monthRegex, currentMonth);\n if (newText !== textNode.textContent) {\n textNode.textContent = newText;\n }\n });\n }\n\n setupYearReplacement();\n\n return {\n result: 'year-replacement initialized',\n destroy: () => {\n // No cleanup needed - this is a one-time text replacement\n },\n };\n}\n"],"names":["getTextNodes","element","textNodes","walker","document","createTreeWalker","NodeFilter","SHOW_TEXT","node","nextNode","nodeValue","trim","push","getHrefElements","hrefs","hasAttribute","Array","from","querySelectorAll","findElementWithSrc","getAttribute","descendant","querySelector","syncItemData","sourceItem","targetClone","config","item","fieldAttr","attributes","properties","syncField","usesFieldBasedSync","forEach","sourceField","fieldName","targetField","sourceImgElement","targetImgElement","src","setAttribute","href","sourceTextNodes","sourceText","length","textContent","targetTextNodes","syncFieldBasedData","sourceHrefs","sourceHref","el","TRANSITION_CLASS","cssInjected","async","init","style","createElement","head","appendChild","injectCSS","cleanup","processedElements","mode","console","warn","countAttr","count","parseInt","isNaN","options","hidden","noSelect","firstChild","children","clones","i","clone","cloneNode","classList","add","applyModifiers","offsetHeight","requestAnimationFrame","remove","dupeChild","parent","parentNode","referenceNode","removeAttribute","nextSibling","insertBefore","dupeSelf","result","destroy","removeChild","htmlClone","userSelect","webkitUserSelect","msUserSelect","destroyFunctions","moduleConfig","syncResult","sourceLists","sourceMap","Map","source","syncId","set","targetLists","syncedCount","skippedCount","target","has","get","targetTemplateWrapper","isChildMode","syncMode","ignoreElement","sourceItems","template","firstElementChild","elements","primary","split","insertAfterIgnore","currentElement","nextElementSibling","childClone","child","syncedItems","map","syncInit","sync","clickableResult","processedWrappers","globalConfig","clickable","wrapper","button","link","keptElement","removedElement","hadAttribute","wasLink","addedAttribute","clickableInit","dupeResult","dupeInit","dupe","siteSettingsResult","structure","lists","siteSettings","list","settingSelector","getSelector","clonedElement","hideSelector","hideElement","hideAttr","hide","match","hideValue","filter","c","some","className","contains","settingAttr","setting","settingName","settingText","settingHref","text","Object","keys","body","acceptNode","name","includes","FILTER_ACCEPT","FILTER_SKIP","textNode","newText","hasChanges","placeholder","replacementValue","replace","RegExp","setupSiteSettings","yearReplacementResult","currentYear","Date","getFullYear","toString","currentMonth","getMonth","yearPlaceholder","placeholders","year","monthPlaceholder","month","yearRegex","monthRegex","setupYearReplacement","yearReplacementInit","reverse","destroyFn","error","fn","cleanupError"],"mappings":"uEA4CA,SAASA,EAAaC,GACpB,MAAMC,EAAoB,GACpBC,EAASC,SAASC,iBAAiBJ,EAASK,WAAWC,UAAW,MAExE,IAAIC,EACJ,KAAQA,EAAOL,EAAOM,YAEhBD,EAAKE,WAAWC,QAClBT,EAAUU,KAAKJ,GAInB,OAAON,CACT,CAKA,SAASW,EAAgBZ,GACvB,MAAMa,EAAmB,GAUzB,OAPIb,EAAQc,aAAa,SACvBD,EAAMF,KAAKX,GAIba,EAAMF,QAAQI,MAAMC,KAAKhB,EAAQiB,iBAAiB,YAE3CJ,CACT,CAgBA,SAASK,EAAmBlB,GAE1B,GAAIA,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,QAAS,MACjEgB,EAAa,IAAIf,OAAOY,EAAiBb,QAAQ,QAAS,QAAS,MAEzEzL,EAAU+B,QAASqJ,IACjB,IAAIC,EAAUD,EAASzI,YAAY8I,QAAQe,EAAWX,GACtDR,EAAUA,EAAQI,QAAQgB,EAAYR,GAClCZ,IAAYD,EAASzI,cACvByI,EAASzI,YAAc0I,IAG7B,CAEAqB,GAEO,CACLhH,OAAQ,+BACRC,QAAS,OAIb,CHXkCgH,CAAoBnL,EAAO4H,YAAY,qBASrE,OAPEwC,GACA,YAAaA,GAC4B,mBAAlCA,EAAsBjG,SAE7BjC,EAAQuC,iBAAiBvF,KAAKkL,EAAsBjG,SAG/C,CACLD,OAAQ,wBACRC,QAAS,KAEPjC,EAAQuC,iBAAiB2G,UAAU7K,QAAS8K,IAC1C,IACEA,GACF,OAASC,GACPjJ,QAAQiJ,MAAM,oCAAqCA,EACrD,IAEFpJ,EAAQuC,iBAAiBvD,OAAS,GAGxC,OAASoK,GAUP,MATAjJ,QAAQiJ,MAAM,qCAAsCA,GAEpDpJ,EAAQuC,iBAAiB2G,UAAU7K,QAASgL,IAC1C,IACEA,GACF,OAASC,GACPnJ,QAAQiJ,MAAM,0CAA2CE,EAC3D,IAEIF,CACR,CEtEK,IAActL,CFuErB"}
@@ -0,0 +1,2 @@
1
+ const e={_global:{version:"2.0.0",apiName:"hsmain",attributes:{height:"data-hs-height",heightValue:"element",heightDuration:"data-hs-height-duration",heightEase:"data-hs-height-ease",moduleType:"data-hs-module-type",module:"data-hs-module"},classes:{modalOpen:"hs-modal-open",overflowHidden:"u-overflow-hidden",initialized:"hs-main",displayContents:"u-display-contents",active:"is-active",gsap:"hs-gsap"},cssVars:{prefix:"--_hs---",state:{name:"state",values:{active:"1",inactive:"0"}},clip:{name:"clip"},scrollOffset:{name:"scroll-offset"}},clickable:{module:"global-clickable",attributes:{elements:{wrapper:{primary:"data-hs-clickable='wrapper'",aliases:[]},button:{primary:"data-hs-clickable='button'",aliases:[]}}}}},normalize:{sync:{module:"sync",attributes:{elements:{source:{primary:"data-hs-sync='source'",aliases:[]},target:{primary:"data-hs-sync='target'",aliases:[]},item:{primary:"data-hs-sync='item'",aliases:[]},ignore:{primary:"data-hs-sync='ignore'",aliases:[]}},properties:{syncId:"data-hs-sync-id",syncField:"data-hs-sync-field",syncMode:"data-hs-sync-mode"}}},clickable:{module:"clickable",attributes:{elements:{wrapper:{primary:"data-hs-clickable='wrapper'",aliases:[]}}},normalize:{module:"normalize",attributes:{elements:{wrapper:{primary:"data-hs-clickable='wrapper'",aliases:[]},button:{primary:"data-hs-clickable='button'",aliases:[]}}}}},dupe:{module:"dupe",attributes:{elements:{wrapper:{primary:"data-hs-dupe",aliases:[]}},properties:{count:"data-hs-dupe-count",hidden:"data-hs-dupe-hidden",noSelect:"data-hs-dupe-no-select"}},modes:{child:"Duplicates the first direct child element",self:"Duplicates the element itself as a sibling"},modifiers:{hidden:"Adds aria-hidden='true' to clones for accessibility",noSelect:"Adds user-select: none to clones to prevent text selection"},limits:{maxCount:20}},"year-replacement":{module:"year-replacement",attributes:{placeholders:{year:"{{year}}",month:"{{month}}"}}},"site-settings":{module:"site-settings",attributes:{elements:{wrapper:{primary:"data-site-settings-element='wrapper'",aliases:[]},list:{primary:"data-site-settings-element='list'",aliases:[]},setting:{primary:"data-site-settings",aliases:[]},hide:{primary:"data-site-settings-hide",aliases:[]}}}}},default:{transition:{module:"transition",attributes:{elements:{wrapper:{primary:"data-hs-transition='wrapper'",aliases:["data-hs-transition='element'"]},exitTrigger:{primary:"data-hs-transition-exit-trigger",aliases:[]},enterTrigger:{primary:"data-hs-transition-enter-trigger",aliases:[]},trigger:{primary:"data-hs-transition-trigger",aliases:[]},namespace:{primary:"data-hs-transition-namespace",aliases:[]},exitTime:{primary:"data-hs-transition-exit-time",aliases:["data-hs-exit-time"]},firstDelay:{primary:"data-hs-transition-first-delay",aliases:["data-hs-delay"]}}}},"smooth-scroll":{module:"smooth-scroll",attributes:{elements:{"offset-proxy":{primary:"data-hs-scroll-offset='proxy'",aliases:[]}}}},accordion:{module:"accordion",attributes:{elements:{wrapper:{primary:"data-hs-accordion='wrapper'",aliases:[]},toggle:{primary:"data-hs-accordion='toggle'",aliases:[]},content:{primary:"data-hs-accordion='content'",aliases:[]},state:{primary:"data-hs-accordion-text='state'",aliases:[]}},properties:{default:"data-hs-accordion-default",open:"data-hs-accordion-open",closed:"data-hs-accordion-closed"}}},navbar:{module:"navbar",attributes:{elements:{wrapper:{primary:"data-hs-nav='wrapper'",aliases:[]},"skip-link":{primary:"data-hs-nav='skip-link'",aliases:[]}}},dropdown:{module:"dropdown",attributes:{elements:{wrapper:{primary:"data-hs-nav-dropdown='wrapper'",aliases:[]},list:{primary:"data-hs-nav-dropdown='list'",aliases:[]}},properties:{type:"data-hs-nav-dropdown-type"}},types:{hover:"Desktop behavior: hover + full keyboard navigation (ArrowDown/Up, Space, Enter, Escape)",click:"Mobile/accordion behavior: click only + simple keyboard (Space, Enter, Escape)"}},menu:{module:"menu",attributes:{elements:{wrapper:{primary:"data-hs-nav-menu='wrapper'",aliases:[]},button:{primary:"data-hs-nav-menu='button'",aliases:[]}}}},"arrow-navigation":{module:"arrow-navigation"}},toc:{module:"toc",attributes:{elements:{content:{primary:"data-hs-toc='content'",aliases:[]},list:{primary:"data-hs-toc='list'",aliases:[]}}},"progress-bar":{module:"progress-bar",attributes:{elements:{wrapper:{primary:"data-hs-toc-progress='wrapper'",aliases:[]},element:{primary:"data-hs-toc-progress='element'",aliases:[]}}}}},pagination:{module:"pagination",attributes:{elements:{wrapper:{primary:"data-hs-pagination='wrapper'",aliases:[]},list:{primary:"data-hs-pagination='list'",aliases:[]},controls:{primary:"data-hs-pagination='controls'",aliases:[]},previous:{primary:"data-hs-pagination='previous'",aliases:[]},next:{primary:"data-hs-pagination='next'",aliases:[]},counter:{primary:"data-hs-pagination='counter'",aliases:[]},dots:{primary:"data-hs-pagination='dots'",aliases:[]}},properties:{show:"data-hs-pagination-show",showMobile:"data-hs-pagination-show-mobile"}}},comparison:{module:"comparison",attributes:{elements:{wrapper:{primary:"data-hs-comparison='wrapper'",aliases:[]},"template-list":{primary:"data-hs-comparison-template='list'",aliases:[]},"template-item":{primary:"data-hs-comparison-template='item'",aliases:[]},"template-name":{primary:"data-hs-comparison-template='name'",aliases:[]},"template-description":{primary:"data-hs-comparison-template='description'",aliases:[]},"template-before-image":{primary:"data-hs-comparison-template='before-image'",aliases:[]},"template-after-image":{primary:"data-hs-comparison-template='after-image'",aliases:[]},name:{primary:"data-hs-comparison='name'",aliases:[]},description:{primary:"data-hs-comparison='description'",aliases:[]},"image-wrapper":{primary:"data-hs-comparison='image-wrapper'",aliases:[]},"before-image":{primary:"data-hs-comparison-image='before'",aliases:[]},"after-image":{primary:"data-hs-comparison-image='after'",aliases:[]},slider:{primary:"data-hs-comparison='slider'",aliases:[]},pagination:{primary:"data-hs-comparison='pagination'",aliases:[]}},properties:{modeType:"data-hs-comparison-mode",navType:"data-hs-comparison-nav"}}},tabs:{module:"tabs",attributes:{elements:{wrapper:{primary:"data-hs-tab='wrapper'",aliases:[]},links:{primary:"data-hs-tab='links'",aliases:[]},list:{primary:"data-hs-tab='list'",aliases:[]}},properties:{autoplay:"data-hs-tab-autoplay",duration:"data-hs-tab-duration",hover:"data-hs-tab-hover",animation:"data-hs-tab-animation",animationDuration:"data-hs-tab-animation-duration",controls:"data-hs-tab-controls"}},cssVars:{progress:"progress"}},form:{honeypot:{module:"honeypot",attributes:{elements:{"form-handler":{primary:"data-hs-form='form-handler'",aliases:[]}}}},range:{module:"range",attributes:{elements:{wrapper:{primary:"data-hs-form-range='wrapper'",aliases:[]},output:{primary:"data-hs-form-range='output'",aliases:[]}}},cssVars:{progress:"progress"}},test:{module:"form-test",attributes:{elements:{wrapper:{primary:"data-hs-form-test='wrapper'",aliases:[]},info:{primary:"data-hs-form-test='info'",aliases:[]}}}},select:{module:"select",attributes:{elements:{wrapper:{primary:"data-hs-form-select='wrapper'",aliases:[]},list:{primary:"data-hs-form-select='list'",aliases:[]},button:{primary:"data-hs-form-select='button'",aliases:[]}}},states:{module:"select-states",attributes:{elements:{states:{primary:"data-hs-form-select='states'",aliases:[]}}}},"custom-select":{module:"select-custom",attributes:{elements:{wrapper:{primary:"data-hs-form-select='wrapper'",aliases:[]},list:{primary:"data-hs-form-select='list'",aliases:[]},button:{primary:"data-hs-form-select='button'",aliases:[]}}}}}}},animations:{}};function a(e,a){const t=e.attributes?.elements?.[a];if(!t)return console.warn(`[attributeSelector] No config for element: ${a}`),"";return[`[${t.primary}]`,...(t.aliases||[]).map(e=>`[${e}]`)].join(", ")}function t(e,t,s=document){const r=a(e,t);return s.querySelectorAll(r)}function s(e,t,s=document){const r=a(e,t);return s.querySelector(r)}let r=!1,i=0,o=0,n=!1,l=!1;function c(){if(n||!m())return;const e=window.gsap;let a=window.scrollY,t=performance.now(),s=0,r=0;window.ScrollTrigger.create({onUpdate:()=>{const e=window.scrollY,r=performance.now(),i=e-a,n=r-t;i>0?o=1:i<0&&(o=-1),n>0&&(s=Math.abs(i)/n*1e3),a=e,t=r}}),e.ticker.add(()=>{r+=.08*(s-r),s*=.95,Math.abs(r)<.1&&(r=0),Math.abs(s)<.1&&(s=0),i=r}),n=!0}function d(){return i}function p(){return o}function m(){return void 0!==window.ScrollTrigger}function u(e,a=!0){return void 0===window.gsap?(a&&!r?(console.warn("[gsap] GSAP library not detected. Some animations will be skipped. Add GSAP to your project: https://greensock.com/docs/v3/Installation"),r=!0):e&&!r&&(console.warn(`[${e}] GSAP not available, module will use fallback behavior`),r=!0),null):{gsap:window.gsap,ScrollTrigger:window.ScrollTrigger,Draggable:window.Draggable}}function h(e,a,t="warn"){const s=[];if(a.forEach(e=>{"ScrollTrigger"!==e||m()?"Draggable"===e&&void 0===window.Draggable&&s.push("Draggable"):s.push("ScrollTrigger")}),0===s.length)return;const r=s.join(", "),i="error"===t?`[${e}] Missing required GSAP plugin(s): ${r}. Module will not work correctly. Add to your project: https://greensock.com/docs/v3/Installation`:`[${e}] Missing optional GSAP plugin(s): ${r}. Some features will be disabled. Add for full functionality: https://greensock.com/docs/v3/Installation`;"error"===t?console.error(i):console.warn(i)}function g(){if(l||!m())return;let e=null;document.addEventListener("load",a=>{a.target instanceof HTMLImageElement&&(null!==e&&clearTimeout(e),e=setTimeout(()=>{window.ScrollTrigger.refresh(),e=null},50))},!0),l=!0}function f(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}const y=new class{#e=new Map;async animate(a,t,s={}){const r=u("heightAnimator");if(!r)return;const{gsap:i}=r,o=e._global.attributes.height,n=e._global.attributes.heightValue,l=e._global.attributes.heightDuration,c=e._global.attributes.heightEase,d=a.hasAttribute?.(o)&&a.getAttribute(o)===n?a:a.querySelector?.(`[${o}="${n}"]`)||a,p=this.#e.get(d);p&&(p.kill(),this.#e.delete(d));let m=d.getAttribute(l),h=d.getAttribute(c);!m&&d.parentElement&&(m=d.parentElement.getAttribute(l)),!h&&d.parentElement&&(h=d.parentElement.getAttribute(c));let g=m?parseInt(m,10)/1e3:(s.duration||300)/1e3;f()&&(g=0);const y=h||s.ease||"power2.inOut",b=i.to(d,{height:t?"auto":0,duration:g,ease:y});this.#e.set(d,b);try{await b.then()}finally{this.#e.delete(d)}}setHeight(a,t){const s=u("heightAnimator");if(!s)return;const{gsap:r}=s,i=e._global.attributes.height,o=e._global.attributes.heightValue,n=a.hasAttribute?.(i)&&a.getAttribute(i)===o?a:a.querySelector?.(`[${i}="${o}"]`)||a;r.set(n,{height:t?"auto":0})}cancelAll(){this.#e.forEach(e=>e.kill()),this.#e.clear()}},b=y.animate.bind(y),w=y.setHeight.bind(y);let v=0;const k=[],A=[];let S=!0,E=null;function x(){if(!S)return null;if(E)return E;const e=window;return e.lenis&&"function"==typeof e.lenis.stop&&"function"==typeof e.lenis.start?(E=e.lenis,e.lenis):null}function M(){if(v++,1===v){const t=e._global.classes.modalOpen,s=e._global.classes.overflowHidden;document.body.classList.add(s,t);const r=x();if(r)try{r.stop()}catch(a){console.error("[modalManager] Error stopping Lenis:",a)}k.forEach(e=>{try{e()}catch(a){console.error("[modalManager] Error in open callback:",a)}})}}function T(){if(v--,0===v){const t=e._global.classes.modalOpen,s=e._global.classes.overflowHidden;document.body.classList.remove(s,t);const r=x();if(r)try{r.start()}catch(a){console.error("[modalManager] Error starting Lenis:",a)}A.forEach(e=>{try{e()}catch(a){console.error("[modalManager] Error in close callback:",a)}})}v<0&&(console.warn("[modalManager] Modal count went negative, resetting to 0"),v=0)}if("undefined"!=typeof window){const e=window;e.HS=e.HS||{},e.HS.modal={open:M,close:T,getCount:function(){return v},isOpen:function(){return v>0},onOpen:function(e){return"function"!=typeof e?(console.warn("[modalManager] onModalOpen requires a function"),()=>{}):(k.push(e),()=>{const a=k.indexOf(e);a>-1&&k.splice(a,1)})},onClose:function(e){return"function"!=typeof e?(console.warn("[modalManager] onModalClose requires a function"),()=>{}):(A.push(e),()=>{const a=A.indexOf(e);a>-1&&A.splice(a,1)})},setLenisEnabled:function(e){S=e,e||(E=null)}}}const $=e._global.cssVars,D={state:$.prefix+$.state.name,clip:$.prefix+$.clip?.name};function _(e){const a=new Map;return{scan:async function(){const t=[],s=e.filter(e=>{const s=document.querySelector(e.selector);return s&&a.has(e.name)?(t.push({name:e.name,status:"already-loaded"}),!1):s}).map(e=>e.import().then(a=>({module:e,moduleExports:a,success:!0})).catch(a=>({module:e,error:a,success:!1}))),r=await Promise.allSettled(s);for(const e of r)if("fulfilled"===e.status&&e.value.success){const{module:s,moduleExports:r}=e.value;try{const{init:e}=r,i=void 0!==s.config?await e(s.config):await e();a.set(s.name,i),t.push({name:s.name,status:"loaded"})}catch(n){const e=n instanceof Error?n.message:String(n);console.error(`[orchestrator] Failed to initialize ${s.name}:`,n),t.push({name:s.name,status:"failed",error:e})}}else if("fulfilled"!==e.status||e.value.success)"rejected"===e.status&&console.error("[orchestrator] Unexpected error:",e.reason);else{const a=e.value,{module:s,error:r}=a,i=r instanceof Error?r.message:String(r);console.error(`[orchestrator] Failed to load ${s.name}:`,r),t.push({name:s.name,status:"failed",error:i})}const i=t.filter(e=>"loaded"===e.status),o=t.filter(e=>"failed"===e.status);return{results:t,loaded:i,failed:o}},destroy:function(){a.forEach((e,a)=>{try{e?.destroy&&e.destroy()}catch(t){console.error(`[orchestrator] Error destroying ${a}:`,t)}}),a.clear()}}}function I(){return document.documentElement.getAttributeNames().some(e=>e.startsWith("data-wf-"))}async function O(e=3e3){return console.log("[Webflow] Waiting for IX3, timeout:",e,"ms"),new Promise(a=>{const t=Date.now(),s=()=>{const r=document.documentElement,i=r.classList.contains("w-mod-ix3"),o=r.hasAttribute("data-wf-ix-ready"),n=i||o,l=Date.now()-t;n?(console.log("[Webflow] IX3 detected after",l,"ms"),a(!0)):l>e?(console.warn(`[Webflow] IX3 timeout after ${l}ms - proceeding without IX3 coordination`),a(!1)):setTimeout(s,50)};s()})}const q=e._global;export{s as a,a as b,e as c,u as d,b as e,T as f,q as g,D as h,I as i,h as j,_ as k,c as l,g as m,p as n,M as o,f as p,t as q,d as r,w as s,O as w};
2
+ //# sourceMappingURL=hs-utils-CNwAFmmK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hs-utils-CNwAFmmK.js","sources":["../../src/config.ts","../../src/utils/attributeSelector.ts","../../src/utils/gsap.ts","../../src/utils/heightAnimator.ts","../../src/utils/modalManager.ts","../../src/utils/cssVariables.ts","../../src/utils/orchestrator.ts","../../src/utils/webflow.ts","../../src/utils.ts"],"sourcesContent":["/**\n * Master Configuration\n *\n * Single source of truth for all module configs with TypeScript type safety.\n * Provides autocomplete and type checking for all configuration access.\n */\nimport configData from './config.json';\n\n// TypeScript interfaces for autocomplete and type safety\n\nexport interface AttributeConfig {\n primary: string;\n aliases: string[];\n}\n\nexport interface ModuleConfig {\n module: string;\n description?: string;\n attributes?: {\n elements?: Record<string, AttributeConfig>;\n properties?: Record<string, string>;\n placeholders?: Record<string, string>;\n note?: string;\n };\n modes?: Record<string, string>;\n modifiers?: Record<string, string>;\n limits?: Record<string, number>;\n types?: Record<string, string>;\n defaults?: Record<string, string>;\n}\n\nexport interface GlobalConfig {\n version: string;\n apiName: string;\n attributes: {\n height: string;\n heightValue: string;\n heightDuration: string;\n heightEase: string;\n moduleType: string;\n module: string;\n };\n classes: {\n modalOpen: string;\n overflowHidden: string;\n initialized: string;\n displayContents: string;\n active: string;\n gsap: string;\n };\n cssVars: {\n prefix: string;\n state: {\n name: string;\n values: {\n active: string;\n inactive: string;\n };\n };\n clip: {\n name: string;\n };\n };\n clickable: ModuleConfig;\n}\n\nexport interface Config {\n _global: GlobalConfig;\n normalize?: {\n sync?: ModuleConfig;\n clickable?: ModuleConfig & {\n normalize?: ModuleConfig;\n };\n dupe?: ModuleConfig;\n 'year-replacement'?: ModuleConfig;\n 'site-settings'?: ModuleConfig;\n };\n default?: {\n transition?: ModuleConfig;\n 'smooth-scroll'?: ModuleConfig;\n accordion?: ModuleConfig;\n navbar?: ModuleConfig & {\n dropdown?: ModuleConfig;\n menu?: ModuleConfig;\n 'arrow-navigation'?: ModuleConfig;\n };\n toc?: ModuleConfig & {\n 'progress-bar'?: ModuleConfig;\n };\n pagination?: ModuleConfig;\n comparison?: ModuleConfig;\n tabs?: ModuleConfig & {\n cssVars?: {\n progress?: string;\n };\n };\n form?: {\n honeypot?: ModuleConfig;\n range?: ModuleConfig & {\n cssVars?: {\n progress?: string;\n };\n };\n test?: ModuleConfig;\n select?: ModuleConfig & {\n states?: ModuleConfig;\n 'custom-select'?: ModuleConfig;\n };\n };\n };\n animations?: {};\n [key: string]: unknown;\n}\n\n// Export typed config\nexport const config = configData as Config;\nexport default config;\n","/**\n * Attribute Selector Utility\n *\n * Builds CSS selectors from module config to support primary attributes + aliases.\n * Enables easy rebranding and backward compatibility.\n */\n\ninterface AttributeSelectorConfig {\n module?: string;\n attributes?: {\n elements?: {\n [key: string]: {\n primary: string;\n aliases?: string[];\n };\n };\n };\n}\n\n/**\n * Builds a CSS selector from config attribute patterns\n */\nexport function getSelector(config: AttributeSelectorConfig, elementKey: string): string {\n const element = config.attributes?.elements?.[elementKey];\n if (!element) {\n console.warn(`[attributeSelector] No config for element: ${elementKey}`);\n return '';\n }\n\n const selectors = [\n `[${element.primary}]`,\n ...(element.aliases || []).map((alias: string) => `[${alias}]`),\n ];\n\n return selectors.join(', ');\n}\n\n/**\n * Gets all matching elements for a given element type\n */\nexport function querySelectorAll(\n config: AttributeSelectorConfig,\n elementKey: string,\n root: Document | Element = document\n): NodeListOf<Element> {\n const selector = getSelector(config, elementKey);\n return root.querySelectorAll(selector);\n}\n\n/**\n * Gets first matching element for a given element type\n */\nexport function querySelector(\n config: AttributeSelectorConfig,\n elementKey: string,\n root: Document | Element = document\n): Element | null {\n const selector = getSelector(config, elementKey);\n return root.querySelector(selector);\n}\n\n/**\n * Logs deprecation warning if using non-primary attributes\n */\nexport function checkDeprecated(\n element: Element | null,\n config: AttributeSelectorConfig,\n elementKey: string\n): void {\n if (!element) return;\n\n const elementConfig = config.attributes.elements[elementKey];\n const elementAttrs = element.getAttributeNames();\n\n elementConfig.aliases?.forEach((alias: string) => {\n const attrName = alias.split('=')[0].replace(/[\\[\\]']/g, '');\n if (elementAttrs.includes(attrName)) {\n console.warn(\n `[${config.module}] Using deprecated attribute \"${alias}\". ` +\n `Please use \"${elementConfig.primary}\" instead. ` +\n `Support for deprecated attributes will be removed in v3.0.0`\n );\n }\n });\n}\n","/**\n * GSAP Handler\n *\n * Centralized GSAP detection, error handling, and utilities.\n * Provides type-safe access to GSAP, ScrollTrigger, and Draggable.\n *\n * Features:\n * - Global scroll velocity tracking\n * - ScrollTrigger refresh on image load\n * - Prefers-reduced-motion detection\n */\n\n// Type definitions for externally loaded GSAP\nexport interface GsapTween {\n kill: () => void;\n then: () => Promise<void>;\n}\n\nexport interface GsapTimeline {\n to: (target: unknown, vars: Record<string, unknown>, position?: number | string) => GsapTimeline;\n from: (\n target: unknown,\n vars: Record<string, unknown>,\n position?: number | string\n ) => GsapTimeline;\n set: (target: unknown, vars: Record<string, unknown>, position?: number | string) => GsapTimeline;\n call: (callback: () => void, params?: unknown[], position?: number | string) => GsapTimeline;\n play: () => GsapTimeline;\n pause: () => GsapTimeline;\n kill: () => void;\n timeScale: (value: number) => GsapTimeline;\n}\n\ninterface GsapPlugin {\n create: (config: unknown) => void;\n getAll: () => unknown[];\n refresh: () => void;\n}\n\ninterface GsapDraggable {\n create: (target: unknown, vars?: Record<string, unknown>) => unknown[];\n}\n\ninterface GsapInstance {\n to: (target: unknown, vars: Record<string, unknown>) => GsapTween;\n from: (target: unknown, vars: Record<string, unknown>) => GsapTween;\n set: (target: unknown, vars: Record<string, unknown>) => void;\n timeline: (vars?: Record<string, unknown>) => GsapTimeline;\n registerPlugin: (...plugins: unknown[]) => void;\n ticker: {\n add: (callback: () => void) => void;\n remove: (callback: () => void) => void;\n };\n}\n\n// Declare global types for GSAP (loaded externally)\ndeclare global {\n interface Window {\n gsap?: GsapInstance;\n ScrollTrigger?: GsapPlugin;\n Draggable?: GsapDraggable;\n }\n}\n\nlet hasWarned = false;\nlet globalScrollVelocity = 0;\nlet globalScrollDirection = 0; // 1 = down, -1 = up, 0 = not scrolling\nlet scrollVelocityInitialized = false;\nlet scrollTriggerRefreshInitialized = false;\n\n/**\n * Initialize global scroll velocity tracking\n */\nexport function initScrollVelocityTracking(): void {\n if (scrollVelocityInitialized || !hasScrollTrigger()) {\n return;\n }\n\n const gsap = window.gsap!;\n\n // Track scroll position and smooth velocity\n let lastScrollY = window.scrollY;\n let lastTime = performance.now();\n let targetVelocity = 0;\n let currentVelocity = 0;\n\n // Update target velocity and direction on scroll\n window.ScrollTrigger!.create({\n onUpdate: () => {\n const currentScrollY = window.scrollY;\n const currentTime = performance.now();\n const deltaY = currentScrollY - lastScrollY;\n const deltaTime = currentTime - lastTime;\n\n // Update scroll direction\n if (deltaY > 0) {\n globalScrollDirection = 1; // Scrolling down\n } else if (deltaY < 0) {\n globalScrollDirection = -1; // Scrolling up\n }\n\n // Calculate velocity in pixels per second (framerate-independent)\n // Avoid division by zero\n if (deltaTime > 0) {\n targetVelocity = (Math.abs(deltaY) / deltaTime) * 1000; // Convert to pixels/second\n }\n\n lastScrollY = currentScrollY;\n lastTime = currentTime;\n },\n });\n\n // Smoothly lerp current velocity to target velocity every frame\n gsap.ticker.add(() => {\n // Lerp factor: lower = smoother (0.08 for buttery smooth)\n const lerpFactor = 0.08;\n\n // Interpolate current velocity towards target\n currentVelocity += (targetVelocity - currentVelocity) * lerpFactor;\n\n // Decay target velocity (simulates friction) - slower decay for smoothness\n targetVelocity *= 0.95;\n\n // Snap to zero when very small\n if (Math.abs(currentVelocity) < 0.1) {\n currentVelocity = 0;\n }\n if (Math.abs(targetVelocity) < 0.1) {\n targetVelocity = 0;\n }\n\n // Update global velocity\n globalScrollVelocity = currentVelocity;\n });\n\n scrollVelocityInitialized = true;\n}\n\n/**\n * Get current scroll velocity\n * @returns Current scroll velocity (pixels per second)\n */\nexport function getScrollVelocity(): number {\n return globalScrollVelocity;\n}\n\n/**\n * Get current scroll direction\n * @returns 1 for down, -1 for up, 0 for not scrolling\n */\nexport function getScrollDirection(): number {\n return globalScrollDirection;\n}\n\n/**\n * Check if GSAP is available\n */\nexport function hasGsap(): boolean {\n return typeof window.gsap !== 'undefined';\n}\n\n/**\n * Check if ScrollTrigger is available\n */\nexport function hasScrollTrigger(): boolean {\n return typeof window.ScrollTrigger !== 'undefined';\n}\n\n/**\n * Check if Draggable is available\n */\nexport function hasDraggable(): boolean {\n return typeof window.Draggable !== 'undefined';\n}\n\n/**\n * Get GSAP instance with type safety\n */\nexport function getGsap(\n moduleName?: string,\n required: boolean = true\n): { gsap: GsapInstance; ScrollTrigger?: GsapPlugin; Draggable?: GsapDraggable } | null {\n if (!hasGsap()) {\n if (required && !hasWarned) {\n console.warn(\n '[gsap] GSAP library not detected. Some animations will be skipped. ' +\n 'Add GSAP to your project: https://greensock.com/docs/v3/Installation'\n );\n hasWarned = true;\n } else if (moduleName && !hasWarned) {\n console.warn(`[${moduleName}] GSAP not available, module will use fallback behavior`);\n hasWarned = true;\n }\n return null;\n }\n\n return {\n gsap: window.gsap!,\n ScrollTrigger: window.ScrollTrigger,\n Draggable: window.Draggable,\n };\n}\n\n/**\n * Warn about missing GSAP dependencies\n * Call this from modules to alert developers about missing plugins\n *\n * @param moduleName - Name of the module requiring the dependency\n * @param dependencies - Array of dependency names (e.g., ['ScrollTrigger', 'Draggable'])\n * @param severity - 'error' for required dependencies, 'warn' for optional\n *\n * @example\n * // Required dependency (module won't work without it)\n * warnMissingDependencies('marquee', ['ScrollTrigger'], 'error');\n *\n * @example\n * // Optional dependency (module has fallback)\n * warnMissingDependencies('counter', ['ScrollTrigger'], 'warn');\n */\nexport function warnMissingDependencies(\n moduleName: string,\n dependencies: Array<'ScrollTrigger' | 'Draggable'>,\n severity: 'error' | 'warn' = 'warn'\n): void {\n const missing: string[] = [];\n\n dependencies.forEach((dep) => {\n if (dep === 'ScrollTrigger' && !hasScrollTrigger()) {\n missing.push('ScrollTrigger');\n } else if (dep === 'Draggable' && !hasDraggable()) {\n missing.push('Draggable');\n }\n });\n\n if (missing.length === 0) return;\n\n const pluginList = missing.join(', ');\n const message =\n severity === 'error'\n ? `[${moduleName}] Missing required GSAP plugin(s): ${pluginList}. Module will not work correctly. Add to your project: https://greensock.com/docs/v3/Installation`\n : `[${moduleName}] Missing optional GSAP plugin(s): ${pluginList}. Some features will be disabled. Add for full functionality: https://greensock.com/docs/v3/Installation`;\n\n if (severity === 'error') {\n console.error(message);\n } else {\n console.warn(message);\n }\n}\n\n/**\n * Reset warning state (useful for testing)\n */\nexport function resetGsapWarning(): void {\n hasWarned = false;\n}\n\n/**\n * Initialize ScrollTrigger refresh on image load\n */\nexport function initScrollTriggerRefresh(): void {\n if (scrollTriggerRefreshInitialized || !hasScrollTrigger()) {\n return;\n }\n\n let refreshTimeout: ReturnType<typeof setTimeout> | null = null;\n const refreshDelay = 50; // Debounce delay in ms\n\n // Debounced refresh function\n const debouncedRefresh = () => {\n if (refreshTimeout !== null) {\n clearTimeout(refreshTimeout);\n }\n refreshTimeout = setTimeout(() => {\n window.ScrollTrigger!.refresh();\n refreshTimeout = null;\n }, refreshDelay);\n };\n\n // Listen for all image load events using event delegation\n document.addEventListener(\n 'load',\n (e) => {\n if (e.target instanceof HTMLImageElement) {\n debouncedRefresh();\n }\n },\n true\n ); // Use capture phase to catch all image loads\n\n scrollTriggerRefreshInitialized = true;\n}\n\n/**\n * Check if user prefers reduced motion\n * @returns true if user prefers reduced motion\n */\nexport function prefersReducedMotion(): boolean {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n","/**\n * Height Animator\n *\n * GSAP-based height animations with singleton pattern.\n * Supports customizable duration, easing, and respects prefers-reduced-motion.\n */\nimport config from '@config';\nimport { getGsap, prefersReducedMotion, type GsapTween } from './gsap.ts';\n\ninterface AnimateOptions {\n duration?: number;\n ease?: string;\n}\n\nclass HeightAnimator {\n #activeAnimations = new Map<HTMLElement, GsapTween>();\n\n /**\n * Animate element height to open or closed state\n */\n async animate(\n element: HTMLElement,\n isOpen: boolean,\n options: AnimateOptions = {}\n ): Promise<void> {\n const gsapLib = getGsap('heightAnimator');\n if (!gsapLib) return;\n\n const { gsap } = gsapLib;\n\n const heightAttr = config._global.attributes.height;\n const heightValue = config._global.attributes.heightValue;\n const durationAttr = config._global.attributes.heightDuration;\n const easeAttr = config._global.attributes.heightEase;\n\n // Check for custom height target element\n const heightTarget =\n element.hasAttribute?.(heightAttr) && element.getAttribute(heightAttr) === heightValue\n ? element\n : (element.querySelector?.(`[${heightAttr}=\"${heightValue}\"]`) as HTMLElement) || element;\n\n // Cancel existing animation on this element\n const existingAnim = this.#activeAnimations.get(heightTarget);\n if (existingAnim) {\n existingAnim.kill();\n this.#activeAnimations.delete(heightTarget);\n }\n\n // Get attributes - check both the target AND its parent wrapper\n let durationValue = heightTarget.getAttribute(durationAttr);\n let easeValue = heightTarget.getAttribute(easeAttr);\n\n // If not found on target, check parent wrapper\n if (!durationValue && heightTarget.parentElement) {\n durationValue = heightTarget.parentElement.getAttribute(durationAttr);\n }\n if (!easeValue && heightTarget.parentElement) {\n easeValue = heightTarget.parentElement.getAttribute(easeAttr);\n }\n\n // Fallback chain: attribute > options > default\n let duration = durationValue\n ? parseInt(durationValue, 10) / 1000\n : (options.duration || 300) / 1000;\n\n // Force instant updates if user prefers reduced motion\n if (prefersReducedMotion()) {\n duration = 0;\n }\n\n const ease = easeValue || options.ease || 'power2.inOut';\n\n // Create animation\n const animation = gsap.to(heightTarget, {\n height: isOpen ? 'auto' : 0,\n duration: duration,\n ease: ease,\n });\n\n // Track active animation\n this.#activeAnimations.set(heightTarget, animation);\n\n // Wait for animation to complete\n try {\n await animation.then();\n } finally {\n this.#activeAnimations.delete(heightTarget);\n }\n }\n\n /**\n * Set element height immediately without animation (for initial state)\n */\n setHeight(element: HTMLElement, isOpen: boolean): void {\n const gsapLib = getGsap('heightAnimator');\n if (!gsapLib) return;\n\n const { gsap } = gsapLib;\n\n const heightAttr = config._global.attributes.height;\n const heightValue = config._global.attributes.heightValue;\n\n // Check for custom height target element\n const heightTarget =\n element.hasAttribute?.(heightAttr) && element.getAttribute(heightAttr) === heightValue\n ? element\n : (element.querySelector?.(`[${heightAttr}=\"${heightValue}\"]`) as HTMLElement) || element;\n\n // Set immediately without animation\n gsap.set(heightTarget, {\n height: isOpen ? 'auto' : 0,\n });\n }\n\n /**\n * Cancel all active animations (for cleanup)\n */\n cancelAll(): void {\n this.#activeAnimations.forEach((anim) => anim.kill());\n this.#activeAnimations.clear();\n }\n}\n\n// Export singleton instance\nexport const heightAnimator = new HeightAnimator();\n\n// Export bound methods for convenience\nexport const animateHeight = heightAnimator.animate.bind(heightAnimator);\nexport const setHeight = heightAnimator.setHeight.bind(heightAnimator);\n","/**\n * Modal Manager\n *\n * Reference-counted modal state management with body class handling.\n * Automatically detects and handles Lenis smooth scroll (stop on open, start on close).\n * Supports extensible hooks for custom callbacks.\n *\n * Usage:\n * import { openModal, closeModal } from '@utils/modalManager';\n * openModal(); // Register modal as open, auto-stops Lenis if detected\n * closeModal(); // Register modal as closed, auto-starts Lenis if detected\n *\n * Lenis Integration:\n * - Auto-detects window.lenis and stops/starts automatically\n * - Works whether Lenis loads before or after this module\n * - Disable auto-handling: window.HS.modal.setLenisEnabled(false);\n * - Manual control still available: window.HS.modal.onOpen(() => customLogic());\n *\n * External API:\n * window.HS.modal.open();\n * window.HS.modal.close();\n * window.HS.modal.setLenisEnabled(false); // Disable auto Lenis handling\n * window.HS.modal.onOpen(() => customCallback()); // Additional callbacks\n */\nimport config from '@config';\n\ntype ModalCallback = () => void;\n\nlet activeModalCount = 0;\nconst openCallbacks: ModalCallback[] = [];\nconst closeCallbacks: ModalCallback[] = [];\n\n// Lenis integration settings\nlet lenisEnabled = true; // Auto-detect and handle Lenis by default\nlet lenisInstance: unknown = null; // Cache Lenis instance\n\n/**\n * Detect and get Lenis instance from window\n */\nfunction getLenis(): { stop: () => void; start: () => void } | null {\n if (!lenisEnabled) return null;\n\n // Check cached instance first\n if (lenisInstance) return lenisInstance as { stop: () => void; start: () => void };\n\n // Try to find Lenis on window\n const win = window as Window & { lenis?: { stop: () => void; start: () => void } };\n if (win.lenis && typeof win.lenis.stop === 'function' && typeof win.lenis.start === 'function') {\n lenisInstance = win.lenis;\n return win.lenis;\n }\n\n return null;\n}\n\n/**\n * Enable or disable automatic Lenis integration\n */\nexport function setLenisEnabled(enabled: boolean): void {\n lenisEnabled = enabled;\n if (!enabled) {\n lenisInstance = null; // Clear cache when disabled\n }\n}\n\n/**\n * Register a callback to run when first modal opens\n */\nexport function onModalOpen(callback: ModalCallback): () => void {\n if (typeof callback !== 'function') {\n console.warn('[modalManager] onModalOpen requires a function');\n return () => {};\n }\n\n openCallbacks.push(callback);\n\n // Return unregister function\n return () => {\n const index = openCallbacks.indexOf(callback);\n if (index > -1) openCallbacks.splice(index, 1);\n };\n}\n\n/**\n * Register a callback to run when last modal closes\n */\nexport function onModalClose(callback: ModalCallback): () => void {\n if (typeof callback !== 'function') {\n console.warn('[modalManager] onModalClose requires a function');\n return () => {};\n }\n\n closeCallbacks.push(callback);\n\n // Return unregister function\n return () => {\n const index = closeCallbacks.indexOf(callback);\n if (index > -1) closeCallbacks.splice(index, 1);\n };\n}\n\n/**\n * Register a modal as open\n */\nexport function openModal(): void {\n activeModalCount++;\n\n // Only apply effects when first modal opens\n if (activeModalCount === 1) {\n const modalOpenClass = config._global.classes.modalOpen;\n const overflowHiddenClass = config._global.classes.overflowHidden;\n\n document.body.classList.add(overflowHiddenClass, modalOpenClass);\n\n // Auto-stop Lenis if detected\n const lenis = getLenis();\n if (lenis) {\n try {\n lenis.stop();\n } catch (error) {\n console.error('[modalManager] Error stopping Lenis:', error);\n }\n }\n\n // Run all registered open callbacks\n openCallbacks.forEach((callback) => {\n try {\n callback();\n } catch (error) {\n console.error('[modalManager] Error in open callback:', error);\n }\n });\n }\n}\n\n/**\n * Register a modal as closed\n */\nexport function closeModal(): void {\n activeModalCount--;\n\n // Only remove effects when last modal closes\n if (activeModalCount === 0) {\n const modalOpenClass = config._global.classes.modalOpen;\n const overflowHiddenClass = config._global.classes.overflowHidden;\n\n document.body.classList.remove(overflowHiddenClass, modalOpenClass);\n\n // Auto-start Lenis if detected\n const lenis = getLenis();\n if (lenis) {\n try {\n lenis.start();\n } catch (error) {\n console.error('[modalManager] Error starting Lenis:', error);\n }\n }\n\n // Run all registered close callbacks\n closeCallbacks.forEach((callback) => {\n try {\n callback();\n } catch (error) {\n console.error('[modalManager] Error in close callback:', error);\n }\n });\n }\n\n // Safety: prevent negative count\n if (activeModalCount < 0) {\n console.warn('[modalManager] Modal count went negative, resetting to 0');\n activeModalCount = 0;\n }\n}\n\n/**\n * Get current modal count (for debugging)\n */\nexport function getActiveModalCount(): number {\n return activeModalCount;\n}\n\n/**\n * Check if any modals are currently open\n */\nexport function isModalOpen(): boolean {\n return activeModalCount > 0;\n}\n\n// Expose globally for external scripts\ninterface WindowWithHS extends Window {\n HS?: {\n modal?: {\n open: () => void;\n close: () => void;\n getCount: () => number;\n isOpen: () => boolean;\n onOpen: (callback: ModalCallback) => () => void;\n onClose: (callback: ModalCallback) => () => void;\n setLenisEnabled: (enabled: boolean) => void;\n };\n };\n}\n\nif (typeof window !== 'undefined') {\n const win = window as WindowWithHS;\n win.HS = win.HS || {};\n win.HS.modal = {\n open: openModal,\n close: closeModal,\n getCount: getActiveModalCount,\n isOpen: isModalOpen,\n onOpen: onModalOpen,\n onClose: onModalClose,\n setLenisEnabled: setLenisEnabled,\n };\n}\n","/**\n * CSS Variables\n *\n * Centralized CSS variable names built from global config.\n * Ensures consistency across all modules.\n *\n * Usage:\n * import cssVariables from '@utils/cssVariables';\n * const value = getComputedStyle(el).getPropertyValue(cssVariables.state);\n */\n\nimport config from '@config';\n\nconst globalCssVars = config._global.cssVars as {\n prefix: string;\n state: { name: string };\n clip?: { name: string };\n};\n\nconst cssVariables = {\n prefix: globalCssVars.prefix,\n state: globalCssVars.prefix + globalCssVars.state.name,\n clip: globalCssVars.prefix + (globalCssVars.clip?.name || 'clip'),\n};\n\nexport default cssVariables;\n","/**\n * Orchestrator Utility\n *\n * Generic orchestrator factory for registry-based module loading.\n * Provides consistent scanning, initialization, and cleanup across all orchestrators.\n *\n * Features:\n * - Registry-based module discovery\n * - Prevents duplicate initialization\n * - SPA-friendly rescan support\n * - Automatic cleanup on destroy\n * - Error handling per module\n *\n * Usage:\n * const REGISTRY = [\n * { name: 'counter', selector: '[data-hs-anim=\"counter\"]', import: () => import('./counter.ts') },\n * ];\n *\n * export async function init() {\n * const orchestrator = createOrchestrator(REGISTRY);\n * const results = await orchestrator.scan();\n *\n * return {\n * result: `initialized (${results.loaded.length} active)`,\n * rescan: orchestrator.scan,\n * destroy: orchestrator.destroy,\n * };\n * }\n */\n\nexport interface ModuleRegistryEntry<TConfig = unknown> {\n name: string;\n selector: string;\n import: () => Promise<{ init: (config?: TConfig) => Promise<ModuleInstance> | ModuleInstance }>;\n config?: TConfig;\n}\n\nexport interface ModuleInstance {\n result?: string;\n destroy?: () => void;\n rescan?: () => Promise<unknown>;\n}\n\nexport interface ScanResult {\n name: string;\n status: 'loaded' | 'failed' | 'already-loaded';\n error?: string;\n}\n\nexport interface OrchestratorReturn {\n scan: () => Promise<{ results: ScanResult[]; loaded: ScanResult[]; failed: ScanResult[] }>;\n destroy: () => void;\n}\n\n/**\n * Create an orchestrator for a module registry\n * @param registry - Array of module definitions with selectors and imports\n */\nexport function createOrchestrator(registry: ModuleRegistryEntry[]): OrchestratorReturn {\n const activeModules = new Map<string, ModuleInstance>();\n\n /**\n * Scan DOM and initialize modules that exist on the page\n */\n async function scan() {\n const results: ScanResult[] = [];\n\n // Step 1: Find which modules are on the page\n const modulesToLoad = registry.filter((module) => {\n const exists = document.querySelector(module.selector);\n if (exists && activeModules.has(module.name)) {\n results.push({ name: module.name, status: 'already-loaded' });\n return false; // Already loaded, skip\n }\n return exists;\n });\n\n // Step 2: Download all needed modules in parallel\n const importPromises = modulesToLoad.map((module) =>\n module\n .import()\n .then(\n (moduleExports) =>\n ({ module, moduleExports, success: true }) as {\n module: ModuleRegistryEntry;\n moduleExports: {\n init: (config?: unknown) => Promise<ModuleInstance> | ModuleInstance;\n };\n success: true;\n }\n )\n .catch(\n (error) =>\n ({ module, error, success: false }) as {\n module: ModuleRegistryEntry;\n error: unknown;\n success: false;\n }\n )\n );\n\n const importResults = await Promise.allSettled(importPromises);\n\n // Step 3: Initialize each successfully downloaded module\n for (const result of importResults) {\n if (result.status === 'fulfilled' && result.value.success) {\n // Success case: module downloaded successfully\n const { module, moduleExports } = result.value;\n try {\n const { init } = moduleExports;\n // Call init with config if provided, otherwise call with no args\n const instance = module.config !== undefined ? await init(module.config) : await init();\n activeModules.set(module.name, instance);\n results.push({ name: module.name, status: 'loaded' });\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n console.error(`[orchestrator] Failed to initialize ${module.name}:`, error);\n results.push({ name: module.name, status: 'failed', error: errorMessage });\n }\n } else if (result.status === 'fulfilled' && !result.value.success) {\n // Download failed (caught by import's .catch())\n const value = result.value as {\n module: ModuleRegistryEntry;\n error: unknown;\n success: false;\n };\n const { module, error } = value;\n const errorMessage = error instanceof Error ? error.message : String(error);\n console.error(`[orchestrator] Failed to load ${module.name}:`, error);\n results.push({ name: module.name, status: 'failed', error: errorMessage });\n } else if (result.status === 'rejected') {\n // Promise itself rejected (shouldn't happen with our catch handler)\n console.error(`[orchestrator] Unexpected error:`, result.reason);\n }\n }\n\n const loaded = results.filter((r) => r.status === 'loaded');\n const failed = results.filter((r) => r.status === 'failed');\n\n return { results, loaded, failed };\n }\n\n /**\n * Destroy all active modules and clear registry\n */\n function destroy() {\n activeModules.forEach((instance, name) => {\n try {\n if (instance?.destroy) {\n instance.destroy();\n }\n } catch (error) {\n console.error(`[orchestrator] Error destroying ${name}:`, error);\n }\n });\n activeModules.clear();\n }\n\n return {\n scan,\n destroy,\n };\n}\n","/**\n * Webflow Platform Utility\n *\n * Handles Webflow-specific initialization requirements including IX3 detection.\n * Auto-detects Webflow via data-wf-* attributes on <html> element.\n *\n * Features:\n * - Auto-detects Webflow platform\n * - Waits for IX3 initialization\n * - Manual override with data-hs-wf-off\n */\n\n/**\n * Detect if running on Webflow platform\n * Checks for any data-wf-* attribute on <html> element\n */\nexport function isWebflow(): boolean {\n const html = document.documentElement;\n const attributes = html.getAttributeNames();\n return attributes.some((attr) => attr.startsWith('data-wf-'));\n}\n\n/**\n * Wait for Webflow IX3 to be ready\n * Polls for multiple IX ready signals with timeout fallback\n * @param timeout - Maximum time to wait in milliseconds (default: 3000ms)\n * @returns Promise<boolean> - true if IX3 loaded, false if timeout\n */\nexport async function waitForIx3(timeout: number = 3000): Promise<boolean> {\n console.log('[Webflow] Waiting for IX3, timeout:', timeout, 'ms');\n return new Promise((resolve) => {\n const startTime = Date.now();\n\n const checkIx3 = () => {\n const html = document.documentElement;\n\n // Check all known IX ready signals (supports old and new Webflow versions)\n const hasLegacyIx3 = html.classList.contains('w-mod-ix3');\n const hasNewIxSignal = html.hasAttribute('data-wf-ix-ready');\n const hasAnyIxSignal = hasLegacyIx3 || hasNewIxSignal;\n\n const elapsed = Date.now() - startTime;\n\n if (hasAnyIxSignal) {\n console.log('[Webflow] IX3 detected after', elapsed, 'ms');\n resolve(true); // IX3 loaded successfully\n } else if (elapsed > timeout) {\n // Timeout reached - proceed without IX3\n console.warn(\n `[Webflow] IX3 timeout after ${elapsed}ms - proceeding without IX3 coordination`\n );\n resolve(false);\n } else {\n setTimeout(checkIx3, 50);\n }\n };\n checkIx3();\n });\n}\n\n/**\n * Check if Webflow waiting should be disabled via script attribute\n * Looks for data-hs-wf-off on module script tag\n */\nexport function shouldSkipWebflow(scripts: Element[]): boolean {\n return scripts.some((script) => script.hasAttribute('data-hs-wf-off'));\n}\n","/**\n * Utils Barrel Export\n *\n * Centralized export for all utility functions.\n * Enables cleaner imports across modules.\n */\n\n// Attribute selector utilities\nexport {\n getSelector,\n querySelectorAll,\n querySelector,\n checkDeprecated,\n} from './utils/attributeSelector.ts';\n\n// Height animation utilities\nexport { animateHeight, setHeight } from './utils/heightAnimator.ts';\n\n// Modal manager utilities\nexport {\n openModal,\n closeModal,\n onModalOpen,\n onModalClose,\n getActiveModalCount,\n isModalOpen,\n} from './utils/modalManager.ts';\n\n// Import config to extract globalConfig\nimport config from '@config';\n\n// Export globalConfig from master config\nexport const globalConfig = config._global;\n\n// CSS variables utility (default export becomes named export)\nexport { default as cssVariables } from './utils/cssVariables.ts';\n\n// GSAP utilities\nexport {\n getGsap,\n hasGsap,\n hasScrollTrigger,\n hasDraggable,\n resetGsapWarning,\n prefersReducedMotion,\n initScrollVelocityTracking,\n initScrollTriggerRefresh,\n getScrollVelocity,\n getScrollDirection,\n warnMissingDependencies,\n type GsapTimeline,\n type GsapTween,\n} from './utils/gsap.ts';\n\n// Orchestrator utility\nexport {\n createOrchestrator,\n type ModuleRegistryEntry,\n type ModuleInstance,\n type ScanResult,\n type OrchestratorReturn,\n} from './utils/orchestrator.ts';\n\n// Webflow platform utilities\nexport { isWebflow, waitForIx3, shouldSkipWebflow } from './utils/webflow.ts';\n\n// Config types\nexport { type ModuleConfig } from './config.ts';\n"],"names":["config","getSelector","elementKey","element","attributes","elements","console","warn","primary","aliases","map","alias","join","querySelectorAll","root","document","selector","querySelector","hasWarned","globalScrollVelocity","globalScrollDirection","scrollVelocityInitialized","scrollTriggerRefreshInitialized","initScrollVelocityTracking","hasScrollTrigger","gsap","window","lastScrollY","scrollY","lastTime","performance","now","targetVelocity","currentVelocity","ScrollTrigger","create","onUpdate","currentScrollY","currentTime","deltaY","deltaTime","Math","abs","ticker","add","getScrollVelocity","getScrollDirection","getGsap","moduleName","required","Draggable","warnMissingDependencies","dependencies","severity","missing","forEach","dep","push","length","pluginList","message","error","initScrollTriggerRefresh","refreshTimeout","addEventListener","e","target","HTMLImageElement","clearTimeout","setTimeout","refresh","prefersReducedMotion","matchMedia","matches","heightAnimator","activeAnimations","Map","animate","isOpen","options","gsapLib","heightAttr","_global","height","heightValue","durationAttr","heightDuration","easeAttr","heightEase","heightTarget","hasAttribute","getAttribute","existingAnim","this","get","kill","delete","durationValue","easeValue","parentElement","duration","parseInt","ease","animation","to","set","then","setHeight","cancelAll","anim","clear","animateHeight","bind","activeModalCount","openCallbacks","closeCallbacks","lenisEnabled","lenisInstance","getLenis","win","lenis","stop","start","openModal","modalOpenClass","classes","modalOpen","overflowHiddenClass","overflowHidden","body","classList","callback","closeModal","remove","HS","modal","open","close","getCount","onOpen","index","indexOf","splice","onClose","setLenisEnabled","enabled","globalCssVars","cssVars","cssVariables","state","prefix","name","clip","createOrchestrator","registry","activeModules","scan","async","results","importPromises","filter","module","exists","has","status","import","moduleExports","success","catch","importResults","Promise","allSettled","result","value","init","instance","errorMessage","Error","String","reason","loaded","r","failed","destroy","isWebflow","documentElement","getAttributeNames","some","attr","startsWith","waitForIx3","timeout","log","resolve","startTime","Date","checkIx3","html","hasLegacyIx3","contains","hasNewIxSignal","has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EAAEjB,QAEvC,MAAO,CAAEN,UAASsB,SAAQE,SAC5B,EAoBEC,QAfF,WACE5B,EAAcpG,QAAQ,CAACwH,EAAUxB,KAC/B,IACMwB,GAAUQ,SACZR,EAASQ,SAEb,OAAS1H,GACPvD,QAAQuD,MAAM,mCAAmC0F,KAAS1F,EAC5D,IAEF8F,EAAc7C,OAChB,EAMF,CClJO,SAAS0E,IAGd,OAFazK,SAAS0K,gBACEC,oBACNC,KAAMC,GAASA,EAAKC,WAAW,YACnD,CAQAhC,eAAsBiC,EAAWC,EAAkB,KAEjD,OADAzL,QAAQ0L,IAAI,sCAAuCD,EAAS,MACrD,IAAIrB,QAASuB,IAClB,MAAMC,EAAYC,KAAKpK,MAEjBqK,EAAW,KACf,MAAMC,EAAOtL,SAAS0K,gBAGhBa,EAAeD,EAAKnE,UAAUqE,SAAS,aACvCC,EAAiBH,EAAK3G,aAAa,oBACnC+G,EAAiBH,GAAgBE,EAEjCE,EAAUP,KAAKpK,MAAQmK,EAEzBO,GACFnM,QAAQ0L,IAAI,+BAAgCU,EAAS,MACrDT,GAAQ,IACCS,EAAUX,GAEnBzL,QAAQC,KACN,+BAA+BmM,6CAEjCT,GAAQ,IAER5H,WAAW+H,EAAU,KAGzBA,KAEJ,CC1BO,MAAMO,EAAe3M,EAAOkF"}
package/dist/main.js CHANGED
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hs-normalize-CTwtG5-a.js","assets/hs-attributeSelector-6pGcDBo-.js","assets/hs-modalManager-H_YegPAO.js","assets/hs-utils-CKm6QhLw.js","assets/hs-structure-DhNix64P.js","assets/hs-orchestrator-J8b7XRk1.js","assets/hs-default-CLmDRb9d.js","assets/hs-cssVariables-BjuwJfDJ.js","assets/hs-animations-BDMqlbof.js"])))=>i.map(i=>d[i]);
2
- const a={},e=function(e,t,s){let r=Promise.resolve();if(t&&t.length>0){let e=function(a){return Promise.all(a.map(a=>Promise.resolve(a).then(a=>({status:"fulfilled",value:a}),a=>({status:"rejected",reason:a}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),i=s?.nonce||s?.getAttribute("nonce");r=e(t.map(e=>{if((e=function(a){return"https://cdn.jsdelivr.net/npm/@hortonstudio/main@1.9.24/dist/"+a}(e))in a)return;a[e]=!0;const t=e.endsWith(".css"),s=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${s}`))return;const r=document.createElement("link");return r.rel=t?"stylesheet":"modulepreload",t||(r.as="script"),r.crossOrigin="",r.href=e,i&&r.setAttribute("nonce",i),document.head.appendChild(r),t?new Promise((a,t)=>{r.addEventListener("load",a),r.addEventListener("error",()=>t(new Error(`Unable to preload CSS for ${e}`)))}):void 0}))}function i(a){const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=a,window.dispatchEvent(e),!e.defaultPrevented)throw a}return r.then(a=>{for(const e of a||[])"rejected"===e.status&&i(e.reason);return e().catch(i)})},t={_global:{version:"2.0.0",apiName:"hsmain",attributes:{height:"data-hs-height",heightValue:"element",heightDuration:"data-hs-height-duration",heightEase:"data-hs-height-ease",moduleType:"data-hs-module-type",module:"data-hs-module"},classes:{modalOpen:"hs-modal-open",overflowHidden:"u-overflow-hidden",initialized:"hs-main",displayContents:"u-display-contents",active:"is-active",gsap:"hs-gsap"},cssVars:{prefix:"--_hs---",state:{name:"state",values:{active:"1",inactive:"0"}},clip:{name:"clip"},scrollOffset:{name:"scroll-offset"}},clickable:{module:"global-clickable",attributes:{elements:{wrapper:{primary:"data-hs-clickable='wrapper'",aliases:[]},button:{primary:"data-hs-clickable='button'",aliases:[]}}}}},normalize:{sync:{module:"sync",description:"Syncs collection list data to static lists with matching structure",attributes:{elements:{source:{primary:"data-hs-sync='source'",aliases:[]},target:{primary:"data-hs-sync='target'",aliases:[]},item:{primary:"data-hs-sync='item'",aliases:[]},ignore:{primary:"data-hs-sync='ignore'",aliases:[]}},properties:{syncId:"data-hs-sync-id",syncField:"data-hs-sync-field",syncMode:"data-hs-sync-mode"}}},clickable:{module:"clickable",attributes:{elements:{wrapper:{primary:"data-hs-clickable='wrapper'",aliases:[]}}},normalize:{module:"normalize",description:"Normalizes clickable wrappers by keeping either button or link based on href validity",attributes:{elements:{wrapper:{primary:"data-hs-clickable='wrapper'",aliases:[]},button:{primary:"data-hs-clickable='button'",aliases:[]}}}}},dupe:{module:"dupe",description:"Duplicates elements or their children based on specified modes",attributes:{elements:{wrapper:{primary:"data-hs-dupe",aliases:[]}},properties:{count:"data-hs-dupe-count",hidden:"data-hs-dupe-hidden",noSelect:"data-hs-dupe-no-select"}},modes:{child:"Duplicates the first direct child element",self:"Duplicates the element itself as a sibling"},modifiers:{hidden:"Adds aria-hidden='true' to clones for accessibility",noSelect:"Adds user-select: none to clones to prevent text selection"},limits:{maxCount:20}}},structure:{"year-replacement":{module:"year-replacement",attributes:{placeholders:{year:"{{year}}",month:"{{month}}"}}},toc:{module:"toc",description:"Table of contents with heading links and optional progress bar",attributes:{elements:{content:{primary:"data-hs-toc='content'",aliases:[]},list:{primary:"data-hs-toc='list'",aliases:[]}}},"progress-bar":{module:"progress-bar",attributes:{elements:{wrapper:{primary:"data-hs-toc-progress='wrapper'",aliases:[]},element:{primary:"data-hs-toc-progress='element'",aliases:[]}}}}},pagination:{module:"pagination",attributes:{elements:{wrapper:{primary:"data-hs-pagination='wrapper'",aliases:[]},list:{primary:"data-hs-pagination='list'",aliases:[]},controls:{primary:"data-hs-pagination='controls'",aliases:[]},previous:{primary:"data-hs-pagination='previous'",aliases:[]},next:{primary:"data-hs-pagination='next'",aliases:[]},counter:{primary:"data-hs-pagination='counter'",aliases:[]},dots:{primary:"data-hs-pagination='dots'",aliases:[]}},properties:{show:"data-hs-pagination-show",showMobile:"data-hs-pagination-show-mobile"}}},comparison:{module:"comparison",attributes:{elements:{wrapper:{primary:"data-hs-comparison='wrapper'",aliases:[]},"template-list":{primary:"data-hs-comparison-template='list'",aliases:[]},"template-item":{primary:"data-hs-comparison-template='item'",aliases:[]},"template-name":{primary:"data-hs-comparison-template='name'",aliases:[]},"template-description":{primary:"data-hs-comparison-template='description'",aliases:[]},"template-before-image":{primary:"data-hs-comparison-template='before-image'",aliases:[]},"template-after-image":{primary:"data-hs-comparison-template='after-image'",aliases:[]},name:{primary:"data-hs-comparison='name'",aliases:[]},description:{primary:"data-hs-comparison='description'",aliases:[]},"image-wrapper":{primary:"data-hs-comparison='image-wrapper'",aliases:[]},"before-image":{primary:"data-hs-comparison-image='before'",aliases:[]},"after-image":{primary:"data-hs-comparison-image='after'",aliases:[]},slider:{primary:"data-hs-comparison='slider'",aliases:[]},pagination:{primary:"data-hs-comparison='pagination'",aliases:[]}},properties:{modeType:"data-hs-comparison-mode",navType:"data-hs-comparison-nav"}}},tabs:{module:"tabs",description:"Accessible tab system with autoplay, animations, and keyboard navigation",attributes:{elements:{wrapper:{primary:"data-hs-tab='wrapper'",aliases:[]},links:{primary:"data-hs-tab='links'",aliases:[]},list:{primary:"data-hs-tab='list'",aliases:[]}},properties:{autoplay:"data-hs-tab-autoplay",duration:"data-hs-tab-duration",hover:"data-hs-tab-hover",animation:"data-hs-tab-animation",animationDuration:"data-hs-tab-animation-duration",controls:"data-hs-tab-controls"}},cssVars:{progress:"progress"}},"site-settings":{module:"site-settings",attributes:{elements:{wrapper:{primary:"data-site-settings-element='wrapper'",aliases:[]},list:{primary:"data-site-settings-element='list'",aliases:[]},setting:{primary:"data-site-settings",aliases:[]},hide:{primary:"data-site-settings-hide",aliases:[]}}}},form:{honeypot:{module:"honeypot",attributes:{elements:{"form-handler":{primary:"data-hs-form='form-handler'",aliases:[]}}}},range:{module:"range",attributes:{elements:{wrapper:{primary:"data-hs-form-range='wrapper'",aliases:[]},output:{primary:"data-hs-form-range='output'",aliases:[]}}},cssVars:{progress:"progress"}},test:{module:"form-test",attributes:{elements:{wrapper:{primary:"data-hs-form-test='wrapper'",aliases:[]},info:{primary:"data-hs-form-test='info'",aliases:[]}}}},select:{module:"select",attributes:{elements:{wrapper:{primary:"data-hs-form-select='wrapper'",aliases:[]},list:{primary:"data-hs-form-select='list'",aliases:[]},button:{primary:"data-hs-form-select='button'",aliases:[]}}},states:{module:"select-states",attributes:{elements:{states:{primary:"data-hs-form-select='states'",aliases:[]}}}},"custom-select":{module:"select-custom",attributes:{elements:{wrapper:{primary:"data-hs-form-select='wrapper'",aliases:[]},list:{primary:"data-hs-form-select='list'",aliases:[]},button:{primary:"data-hs-form-select='button'",aliases:[]}}}}}}},default:{"smooth-scroll":{module:"smooth-scroll",attributes:{elements:{"offset-proxy":{primary:"data-hs-scroll-offset='proxy'",aliases:[]}},note:"Auto-detects anchor links (a[href^='#']). Optional: Use data-hs-scroll-offset='proxy' on an element to set scroll offset based on its offsetTop"}},accordion:{module:"accordion",attributes:{elements:{wrapper:{primary:"data-hs-accordion='wrapper'",aliases:[]},toggle:{primary:"data-hs-accordion='toggle'",aliases:[]},content:{primary:"data-hs-accordion='content'",aliases:[]},state:{primary:"data-hs-accordion-text='state'",aliases:[]}},properties:{default:"data-hs-accordion-default",open:"data-hs-accordion-open",closed:"data-hs-accordion-closed"}}},navbar:{module:"navbar",description:"Main navigation orchestrator with modular functions",attributes:{elements:{wrapper:{primary:"data-hs-nav='wrapper'",aliases:[]},"skip-link":{primary:"data-hs-nav='skip-link'",aliases:[]}}},dropdown:{module:"dropdown",description:"Navigation dropdown with hover or click behavior",attributes:{elements:{wrapper:{primary:"data-hs-nav-dropdown='wrapper'",aliases:[]},list:{primary:"data-hs-nav-dropdown='list'",aliases:[]}},properties:{type:"data-hs-nav-dropdown-type"}},types:{hover:"Desktop behavior: hover + full keyboard navigation (ArrowDown/Up, Space, Enter, Escape)",click:"Mobile/accordion behavior: click only + simple keyboard (Space, Enter, Escape)"}},menu:{module:"menu",description:"Mobile menu button and modal behavior",attributes:{elements:{wrapper:{primary:"data-hs-nav-menu='wrapper'",aliases:[]},button:{primary:"data-hs-nav-menu='button'",aliases:[]}}}},"arrow-navigation":{module:"arrow-navigation",description:"Keyboard arrow navigation for desktop navbar and mobile menu"}}},animations:{transition:{module:"transition",attributes:{elements:{wrapper:{primary:"data-hs-transition='wrapper'",aliases:["data-hs-transition='element'"]},exitTrigger:{primary:"data-hs-transition-exit-trigger",aliases:[]},enterTrigger:{primary:"data-hs-transition-enter-trigger",aliases:[]},trigger:{primary:"data-hs-transition-trigger",aliases:[]},namespace:{primary:"data-hs-transition-namespace",aliases:[]},exitTime:{primary:"data-hs-transition-exit-time",aliases:["data-hs-exit-time"]},firstDelay:{primary:"data-hs-transition-first-delay",aliases:["data-hs-delay"]}}}}}},s=t._global.apiName;(async()=>{if(window[s]&&!Array.isArray(window[s])&&window[s].loaded)return;document.documentElement.classList.add(t._global.classes.initialized);const a=Array.isArray(window[s])?window[s]:[],r={normalize:()=>e(()=>import("./assets/hs-normalize-CTwtG5-a.js"),__vite__mapDeps([0,1,2,3])),structure:()=>e(()=>import("./assets/hs-structure-DhNix64P.js"),__vite__mapDeps([4,1,2,5])),default:()=>e(()=>import("./assets/hs-default-CLmDRb9d.js"),__vite__mapDeps([6,1,2,3,7])),animations:()=>e(()=>import("./assets/hs-animations-BDMqlbof.js"),__vite__mapDeps([8,2,5]))};let i=[...document.querySelectorAll(`script[type="module"][src="${import.meta.url}"]`)];0===i.length&&(i=[...document.querySelectorAll('script[type="module"][src*="@hortonstudio/main"]')].filter(a=>{const e=a.src,t=import.meta.url,s=e.match(/@hortonstudio\/main(@[\d.]+)?/)?.[0],r=t.match(/@hortonstudio\/main(@[\d.]+)?/)?.[0];return s&&r&&s.split("@")[0]===r.split("@")[0]}));const o={isSPA:i.some(a=>"true"===a.getAttribute("data-hs-spa"))},n={normalize:{modules:["normalize"],parallel:!1},structure:{modules:["structure"],parallel:!1},default:{modules:["default","animations"],parallel:!0}},l=async a=>{const e=window[s];if(e.process.has(a))return e.modules[a]?.loading;e.process.add(a);const t=e.modules[a]||{};let i;e.modules[a]=t,t.loading=new Promise((a,e)=>{t.resolve=a,t.reject=e});try{const{init:s}=await r[a](),o=await s()||{};i=o.destroy;const n=o.result;return t.destroy=()=>{i?.(),e.process.delete(a)},t.restart=()=>{t.destroy?.(),e.load(a)},t.resolve?.(n),delete t.resolve,delete t.reject,n}catch(o){throw i?.(),t.reject?.(o),e.process.delete(a),o}},d=async a=>{const e=n[a];if(e.parallel){const a=e.modules.map(a=>l(a));await Promise.allSettled(a)}else for(const t of e.modules)await l(t)},p=async()=>{await Promise.allSettled([r.normalize(),r.structure(),r.default(),r.animations()]),await d("normalize"),await d("structure"),await d("default"),(()=>{const a=new CustomEvent("hsmain:dom-ready");window.dispatchEvent(a)})()},m=[];window[s]={scripts:i,settings:o,modules:{},process:new Set,load:l,loaded:!1,push(...a){for(const[e,t]of a)"function"==typeof t?this.modules[e]?.loading?.then(t):this.load(e)},destroy(){for(const a in this.modules)this.modules[a]?.destroy?.()},async reinitialize(){this.loaded=!1,this.destroy(),this.modules={},this.process=new Set,await this.scanForEmbedModules(),await p(),this.loaded=!0},async scanForEmbedModules(){document.querySelectorAll(".w-embed").forEach(a=>{a.querySelectorAll("script[data-hs-module]").forEach(a=>{const e=a.getAttribute("data-hs-module-type"),t=a.getAttribute("data-hs-module");if(e&&t){const a=`data-hs-${e}-${t}`;r[a]&&this.load(a)}})})},afterReady(a){"function"==typeof a&&(this.loaded?a():m.push(a))},status(a){return a?{loaded:!!this.modules[a],loading:this.process.has(a)}:{loaded:Object.keys(this.modules),loading:[...this.process],phases:n}}};(async()=>{window[s].push(...a),await p(),window[s].loaded=!0,m.forEach(a=>{try{a()}catch{}}),m.length=0})().catch(()=>{})})();export{e as _,t as c};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hs-normalize-iTnWVIjq.js","assets/hs-utils-CNwAFmmK.js","assets/hs-default-Dxg7WNGx.js","assets/hs-animations-tvD4W7u0.js"])))=>i.map(i=>d[i]);
2
+ import{c as e}from"./assets/hs-utils-CNwAFmmK.js";const t={},s=function(e,s,o){let a=Promise.resolve();if(s&&s.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),r=o?.nonce||o?.getAttribute("nonce");a=e(s.map(e=>{if((e=function(e){return"https://cdn.jsdelivr.net/npm/@hortonstudio/main@1.9.25/dist/"+e}(e))in t)return;t[e]=!0;const s=e.endsWith(".css"),o=s?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${o}`))return;const a=document.createElement("link");return a.rel=s?"stylesheet":"modulepreload",s||(a.as="script"),a.crossOrigin="",a.href=e,r&&a.setAttribute("nonce",r),document.head.appendChild(a),s?new Promise((t,s)=>{a.addEventListener("load",t),a.addEventListener("error",()=>s(new Error(`Unable to preload CSS for ${e}`)))}):void 0}))}function r(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return a.then(t=>{for(const e of t||[])"rejected"===e.status&&r(e.reason);return e().catch(r)})},o=e._global.apiName;(async()=>{if(window[o]&&!Array.isArray(window[o])&&window[o].loaded)return;document.documentElement.classList.add(e._global.classes.initialized);const t=Array.isArray(window[o])?window[o]:[],a={normalize:()=>s(()=>import("./assets/hs-normalize-iTnWVIjq.js"),__vite__mapDeps([0,1])),default:()=>s(()=>import("./assets/hs-default-Dxg7WNGx.js"),__vite__mapDeps([2,1])),animations:()=>s(()=>import("./assets/hs-animations-tvD4W7u0.js"),__vite__mapDeps([3,1]))};let r=[...document.querySelectorAll(`script[type="module"][src="${import.meta.url}"]`)];0===r.length&&(r=[...document.querySelectorAll('script[type="module"][src*="@hortonstudio/main"]')].filter(e=>{const t=e.src,s=import.meta.url,o=t.match(/@hortonstudio\/main(@[\d.]+)?/)?.[0],a=s.match(/@hortonstudio\/main(@[\d.]+)?/)?.[0];return o&&a&&o.split("@")[0]===a.split("@")[0]}));const n={isSPA:r.some(e=>"true"===e.getAttribute("data-hs-spa"))},i={normalize:{modules:["normalize"],parallel:!1},default:{modules:["default","animations"],parallel:!0}},l=async e=>{const t=window[o];if(t.process.has(e))return t.modules[e]?.loading;t.process.add(e);const s=t.modules[e]||{};let r;t.modules[e]=s,s.loading=new Promise((e,t)=>{s.resolve=e,s.reject=t});try{const{init:o}=await a[e](),n=await o()||{};r=n.destroy;const i=n.result;return s.destroy=()=>{r?.(),t.process.delete(e)},s.restart=()=>{s.destroy?.(),t.load(e)},s.resolve?.(i),delete s.resolve,delete s.reject,i}catch(n){throw r?.(),s.reject?.(n),t.process.delete(e),n}},d=async e=>{const t=i[e];if(t.parallel){const e=t.modules.map(e=>l(e));await Promise.allSettled(e)}else for(const s of t.modules)await l(s)},c=async()=>{await Promise.allSettled([a.normalize(),a.default(),a.animations()]),await d("normalize"),await d("default"),(()=>{const e=new CustomEvent("hsmain:dom-ready");window.dispatchEvent(e)})()},u=[];window[o]={scripts:r,settings:n,modules:{},process:new Set,load:l,loaded:!1,push(...e){for(const[t,s]of e)"function"==typeof s?this.modules[t]?.loading?.then(s):this.load(t)},destroy(){for(const e in this.modules)this.modules[e]?.destroy?.()},async reinitialize(){this.loaded=!1,this.destroy(),this.modules={},this.process=new Set,await this.scanForEmbedModules(),await c(),this.loaded=!0},async scanForEmbedModules(){document.querySelectorAll(".w-embed").forEach(e=>{e.querySelectorAll("script[data-hs-module]").forEach(e=>{const t=e.getAttribute("data-hs-module-type"),s=e.getAttribute("data-hs-module");if(t&&s){const e=`data-hs-${t}-${s}`;a[e]&&this.load(e)}})})},afterReady(e){"function"==typeof e&&(this.loaded?e():u.push(e))},status(e){return e?{loaded:!!this.modules[e],loading:this.process.has(e)}:{loaded:Object.keys(this.modules),loading:[...this.process],phases:i}}};(async()=>{window[o].push(...t),await c(),window[o].loaded=!0,u.forEach(e=>{try{e()}catch{}}),u.length=0})().catch(()=>{})})();export{s as _};
3
3
  //# sourceMappingURL=main.js.map
Binary file
package/dist/main.js.gz CHANGED
Binary file