{"version":3,"file":"WithTracking.D8wFSOY2.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/ajhJGoPGyD8dweWAEeS3/jkQNuxPDWUHTvxNTOeWk/WithTracking.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({background:\"#0099FF\"});export function withRotate(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,animate:{rotate:90},transition:{duration:2}});};}export function withHover(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,whileHover:{scale:1.05}});};}export function withRandomColor(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});};}// Tracking utility function\nconst track=eventName=>{if(typeof window!==\"undefined\"&&window.gtag){window.gtag(\"event\",eventName);console.log(\"Triggered\",eventName);}};export function withTrackMainBannerSales(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,onClick:e=>{// Send event to Google Analytics\n    track(\"main_banner_sales\");// Call original onClick if it exists\n    props.onClick?.(e);}});}export function withTrackMenuProductSales(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,onClick:e=>{// Send event to Google Analytics\n    track(\"menu_product_sales\");// Call original onClick if it exists\n    props.onClick?.(e);}});}export function withTrackClickTopContact(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,onClick:e=>{// Send event to Google Analytics\n    track(\"click_top_contact\");// Call original onClick if it exists\n    props.onClick?.(e);}});}export function withTrackClickTopComingSoon(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,onClick:e=>{// Send event to Google Analytics\n    track(\"click_top_comingsoon\");// Call original onClick if it exists\n    props.onClick?.(e);}});}export function withTrackClickBottomContact(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,onClick:e=>{// Send event to Google Analytics\n    track(\"click_bottom_contact\");// Call original onClick if it exists\n    props.onClick?.(e);}});}export function withTrackClickBottomComingSoon(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,onClick:e=>{// Send event to Google Analytics\n    track(\"click_bottom_contact\");// Call original onClick if it exists\n    props.onClick?.(e);}});}export function addGnbClass(Component){return props=>{// Clone the props to avoid modifying the original\nconst newProps={...props};// Add the gnb-container class to the navigation container\n// This uses className which all React components have\nnewProps.className=(newProps.className||\"\")+\" gnb-container\";// Add data-gnb attribute\nnewProps[\"data-gnb\"]=\"true\";return /*#__PURE__*/_jsx(Component,{...newProps});};}export function addCTAClass(Component){return props=>{// Clone the props to avoid modifying the original\nconst newProps={...props};// Add the cta-link  class to the navigation container\n// This uses className which all React components have\nnewProps.className=(newProps.className||\"\")+\" cta-link\";// Add data-cta attribute\nnewProps[\"data-cta\"]=\"true\";return /*#__PURE__*/_jsx(Component,{...newProps});};}export function addSwitcherClass(Component){return props=>{const elementRef=useRef(null);// Clone the props to avoid modifying the original\nconst newProps={...props};// Add the lang-switcher class to the navigation container\nnewProps.className=(newProps.className||\"\")+\" lang-switcher\";// Function to show/hide elements based on Korean status\nconst toggleKoreanVisibility=shouldShow=>{if(elementRef.current){let containerParent=null;const immediateParent=elementRef.current.parentElement;// Check if immediate parent has \"ssr\" class\nif(immediateParent&&immediateParent.classList.contains(\"ssr\")){containerParent=immediateParent;}else{// Check first and second parent for *-container class\nlet currentParent=immediateParent;// Check first parent\nif(currentParent){const classList=Array.from(currentParent.classList);const hasContainerClass=classList.some(className=>className.endsWith(\"-container\"));if(hasContainerClass){containerParent=currentParent;}else{// Check second parent\nconst secondParent=currentParent.parentElement;if(secondParent){const secondClassList=Array.from(secondParent.classList);const hasSecondContainerClass=secondClassList.some(className=>className.endsWith(\"-container\"));if(hasSecondContainerClass){containerParent=secondParent;}}}}}// Show/hide elements based on shouldShow parameter\nconst displayValue=shouldShow?\"flex\":\"none\";elementRef.current.style.display=displayValue;if(containerParent){containerParent.style.display=displayValue;}}};// Function to check IP-based location\nconst checkKoreanIP=async()=>{try{console.log(\"Fetching user's IP address for Korean check\");// Fetch user's IP address\nconst ipResponse=await fetch(\"https://api.iplocation.net/?cmd=get-ip\");const ipData=await ipResponse.json();if(ipData.response_code===200){const ip=ipData.ip;console.log(`User's IP address: ${ip}`);// Fetch user's country based on IP address\nconsole.log(\"Fetching user's country based on IP address\");const countryResponse=await fetch(`https://api.iplocation.net/?cmd=ip-country&ip=${ip}`);const countryData=await countryResponse.json();if(countryData.response_code===\"200\"){const country=countryData.country_name;console.log(`User's country: ${country}`);// Check if user is from South Korea\nconst isKoreanIP=country.includes(\"Korea\");return isKoreanIP;}}return false;}catch(error){console.log(\"Error fetching IP location:\",error);return false;}};useEffect(()=>{const initializeVisibility=async()=>{if(!elementRef.current)return;// Check if user's browser language is Korean\nconst userLanguage=navigator.language||navigator.languages[0];const isKoreanLanguage=userLanguage.startsWith(\"ko\")// 'ko', 'ko-KR', etc.\n;// Check if user's IP is from Korea\nconst isKoreanIP=await checkKoreanIP();// Show banner if either language is Korean OR IP is from Korea\nconst shouldShowKorean=isKoreanLanguage||isKoreanIP;console.log(`Korean language detected: ${isKoreanLanguage}`);console.log(`Korean IP detected: ${isKoreanIP}`);console.log(`Should show Korean banner: ${shouldShowKorean}`);toggleKoreanVisibility(shouldShowKorean);};initializeVisibility();},[]);return /*#__PURE__*/_jsx(Component,{...newProps,ref:elementRef});};}\nexport const __FramerMetadata__ = {\"exports\":{\"addSwitcherClass\":{\"type\":\"reactHoc\",\"name\":\"addSwitcherClass\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackClickBottomContact\":{\"type\":\"reactHoc\",\"name\":\"withTrackClickBottomContact\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackMenuProductSales\":{\"type\":\"reactHoc\",\"name\":\"withTrackMenuProductSales\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"addCTAClass\":{\"type\":\"reactHoc\",\"name\":\"addCTAClass\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackClickTopContact\":{\"type\":\"reactHoc\",\"name\":\"withTrackClickTopContact\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackClickBottomComingSoon\":{\"type\":\"reactHoc\",\"name\":\"withTrackClickBottomComingSoon\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackMainBannerSales\":{\"type\":\"reactHoc\",\"name\":\"withTrackMainBannerSales\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"addGnbClass\":{\"type\":\"reactHoc\",\"name\":\"addGnbClass\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackClickTopComingSoon\":{\"type\":\"reactHoc\",\"name\":\"withTrackClickTopComingSoon\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithTracking.map"],"mappings":"sMAc4B,SAAgB,EAAY,EAAU,CAAC,MAAO,IAAO,CACjF,IAAM,EAAS,CAAC,GAAG,EAAM,CAGG,MAD5B,GAAS,WAAW,EAAS,WAAW,IAAI,iBAC5C,EAAS,YAAY,OAA2B,EAAK,EAAU,CAAC,GAAG,EAAS,CAAC,EAAI,SAAgB,EAAY,EAAU,CAAC,MAAO,IAAO,CACtI,IAAM,EAAS,CAAC,GAAG,EAAM,CAGG,MAD5B,GAAS,WAAW,EAAS,WAAW,IAAI,YAC5C,EAAS,YAAY,OAA2B,EAAK,EAAU,CAAC,GAAG,EAAS,CAAC,EAAI,SAAgB,EAAiB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAWA,EAAO,K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