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tD,OAAMmD,EAAO,KAHN,CAIrC,GAAC,CAAAhC,IAAA,cAAAC,MAED,SAAYyB,EAAaI,EAAWC,GAClC,OAAIL,GAAe,KACTI,EAAYJ,EAAe,IAC1BA,EAAc,KAAOA,EAAc,MAExCK,GAC2BL,EAAc,KAAO,KAA/CI,EAAYC,IACbL,EACF,IAGMK,EAAWL,EAAe,GAEtC,GAAC,CAAA1B,IAAA,eAAAC,MAED,WACE5B,KAAKyC,iBACP,M,6EAAC,CA/IS,E","sources":["webpack://@hero-digital/zoom/./src/components/foundation/LottieAnimation/LottieAnimation.js"],"sourcesContent":["import lottie from 'lottie-web'\r\n\r\nclass Lottie {\r\n constructor(el) {\r\n this.el = el\r\n\r\n this.domMap = {\r\n $allLottieJsonElements: this.el.querySelectorAll('.lottie-animation-json, .lottie-animation-image'),\r\n $lottieAnimationElements: this.el.querySelectorAll('.lottie-animation')\r\n }\r\n\r\n this.domMap.$allLottieJsonElements.forEach((jsonElement) => {\r\n if (!jsonElement.id) {\r\n jsonElement.id = `lottie-${Math.random().toString(36).substr(2, 9)}`\r\n }\r\n })\r\n\r\n this.domMap.$allLottieJsonElements.forEach((jsonElement) => {\r\n const config = {\r\n jsonLink: jsonElement.getAttribute('data-json-link'),\r\n animationDuration:\r\n parseFloat(jsonElement.getAttribute('data-animation-duration')) || 0,\r\n containerClass: jsonElement.getAttribute('data-container-class') || '',\r\n animationSpeed:\r\n parseFloat(jsonElement.getAttribute('data-animation-speed')) || 1,\r\n animationDelay:\r\n parseFloat(jsonElement.getAttribute('data-animation-delay')) || 0\r\n }\r\n\r\n if (!config.jsonLink) {\r\n return\r\n }\r\n\r\n if (!jsonElement.LottieInstance) {\r\n this.loadLottieAnimation(jsonElement, config)\r\n }\r\n })\r\n\r\n // Attach resize event listener\r\n window.addEventListener('resize', this.handleResize.bind(this))\r\n }\r\n\r\n loadLottieAnimation(jsonElement, config) {\r\n if (!jsonElement) return\r\n\r\n if (jsonElement.classList.contains('lottie-animation-json')) {\r\n const animation = lottie.loadAnimation({\r\n container: jsonElement, // Use the specific lottie-animation-json element as the container\r\n path: config.jsonLink,\r\n renderer: 'svg',\r\n loop: false,\r\n autoplay: false\r\n })\r\n\r\n jsonElement.LottieInstance = animation\r\n\r\n animation.setSpeed(config.animationSpeed)\r\n animation.addEventListener('complete', () =>\r\n this.onAnimationComplete(jsonElement)\r\n )\r\n animation.addEventListener('DOMLoaded', () =>\r\n this.updateDynamicVW(jsonElement)\r\n )\r\n\r\n animation.play()\r\n } else if (jsonElement.classList.contains('lottie-animation-image')) {\r\n this.updateDynamicVW(jsonElement) // Directly apply width updates for images\r\n }\r\n }\r\n\r\n onAnimationComplete(jsonElement) {\r\n const wrapper = this.el.querySelector('.lottie-animation-two-wrapper')\r\n\r\n if (wrapper && !wrapper.dataset.lottieInitialized) {\r\n this.initSecondLottie(wrapper) // Initialize Lottie immediately\r\n wrapper.dataset.lottieInitialized = true // Mark as initialized\r\n\r\n // Add slide-in class after Lottie initialization\r\n wrapper.classList.add('slide-in')\r\n } else if (wrapper && !wrapper.dataset.lottieInitialized) {\r\n // If already initialized, skip reinitialization\r\n this.initSecondLottie(wrapper)\r\n wrapper.dataset.lottieInitialized = true\r\n }\r\n }\r\n\r\n // Method to initialize the second Lottie animation\r\n initSecondLottie(wrapper) {\r\n const lottieJson = wrapper.querySelector('.lottie-animation-json')\r\n\r\n if (lottieJson) {\r\n if (lottieJson.LottieInstance) {\r\n // Reset existing Lottie instance before re-initializing\r\n lottieJson.LottieInstance.destroy()\r\n lottieJson.innerHTML = '' // Clear previous content\r\n }\r\n\r\n this.loadLottieAnimation(lottieJson, {\r\n jsonLink: lottieJson.getAttribute('data-json-link'),\r\n animationDuration:\r\n parseFloat(lottieJson.getAttribute('data-animation-duration')) || 0,\r\n containerClass: lottieJson.getAttribute('data-container-class') || '',\r\n animationSpeed:\r\n parseFloat(lottieJson.getAttribute('data-animation-speed')) || 1,\r\n animationDelay:\r\n parseFloat(lottieJson.getAttribute('data-animation-delay')) || 0\r\n })\r\n }\r\n }\r\n\r\n updateDynamicVW(jsonElement) {\r\n const screenWidth = window.innerWidth\r\n this.domMap.$lottieAnimationElements.forEach((animationElement) => {\r\n this.updateElementWidth(animationElement, screenWidth)\r\n })\r\n }\r\n\r\n updateElementWidth(animationElement, screenWidth) {\r\n const highWidth =\r\n parseFloat(animationElement.getAttribute('data-width-high')) || 0\r\n const lowWidth = parseFloat(animationElement.getAttribute('data-width-low')) || 0\r\n\r\n if (!highWidth && !lowWidth) return\r\n\r\n const vwValue = this.calculateVW(screenWidth, highWidth, lowWidth)\r\n animationElement.style.width = `${vwValue}vw`\r\n }\r\n\r\n calculateVW(screenWidth, highWidth, lowWidth) {\r\n if (screenWidth >= 1440) {\r\n return (highWidth / screenWidth) * 100\r\n } else if (screenWidth > 768 && screenWidth < 1440) {\r\n return (\r\n ((lowWidth +\r\n (highWidth - lowWidth) * ((screenWidth - 768) / (1440 - 768))) /\r\n screenWidth) *\r\n 100\r\n )\r\n } else {\r\n return (lowWidth / screenWidth) * 100\r\n }\r\n }\r\n\r\n handleResize() {\r\n this.updateDynamicVW()\r\n }\r\n}\r\n\r\nexport default Lottie\r\n"],"names":["Lottie","el","_this","_classCallCheck","this","domMap","$allLottieJsonElements","querySelectorAll","$lottieAnimationElements","forEach","jsonElement","id","concat","Math","random","toString","substr","config","jsonLink","getAttribute","animationDuration","parseFloat","containerClass","animationSpeed","animationDelay","LottieInstance","loadLottieAnimation","window","addEventListener","handleResize","bind","key","value","_this2","classList","contains","animation","lottie","container","path","renderer","loop","autoplay","setSpeed","onAnimationComplete","updateDynamicVW","play","wrapper","querySelector","dataset","lottieInitialized","initSecondLottie","add","lottieJson","destroy","innerHTML","_this3","screenWidth","innerWidth","animationElement","updateElementWidth","highWidth","lowWidth","vwValue","calculateVW","style","width"],"sourceRoot":""}