{"version":3,"file":"LocalizationEngine.CZ81O2Xz.mjs","names":[],"sources":["https:/framerusercontent.com/modules/kuS5b0i3hmWrggoUtgxm/61379NqNyI8NszQzgidg/LocalizationEngine.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{RenderTarget}from\"framer\";// --- CONFIGURATION ---\nconst THEME_MAIN=\"#65326F\";const STORAGE_KEY=\"preferred_language\";// --- Helper: Robust Color Opacity ---\nconst setOpacity=(color,alpha)=>{if(!color)return`rgba(101, 50, 111, ${alpha})`;if(color.startsWith(\"#\")){let hex=color.replace(\"#\",\"\");if(hex.length===3)hex=hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];const r=parseInt(hex.substring(0,2),16);const g=parseInt(hex.substring(2,4),16);const b=parseInt(hex.substring(4,6),16);return`rgba(${r}, ${g}, ${b}, ${alpha})`;}return color;};const ScrollbarStyles=`\n    ::-webkit-scrollbar { width: 6px; background: transparent; }\n    ::-webkit-scrollbar-track { background: transparent; }\n    ::-webkit-scrollbar-thumb {\n        background-color: ${setOpacity(THEME_MAIN,.4)};\n        border-radius: 10px;\n        border: 2px solid transparent;\n        background-clip: content-box;\n    }\n    ::-webkit-scrollbar-thumb:hover { background-color: ${THEME_MAIN}; }\n    * { scrollbar-width: thin; scrollbar-color: ${setOpacity(THEME_MAIN,.4)} transparent; }\n`;// --- Path Helpers ---\nconst isPathHebrew=path=>path===\"/he\"||path.startsWith(\"/he/\");const getHebrewPath=path=>isPathHebrew(path)?path:path===\"/\"?\"/he\":`/he${path}`;const getEnglishPath=path=>isPathHebrew(path)?path.replace(/^\\/he/,\"\")||\"/\":path;// ==========================================\n// 1. ENGLISH CONTROLLER (Apply to main template)\n// ==========================================\nexport function EnglishController(Component){return props=>{useEffect(()=>{if(typeof window===\"undefined\"||RenderTarget.current()===RenderTarget.canvas)return;const isFramerApp=window.location.pathname.startsWith(\"/s/app\");if(isFramerApp)return;// GLOBAL MEMORY CHECK: If they prefer Hebrew, redirect them immediately\nconst savedLang=localStorage.getItem(STORAGE_KEY);if(savedLang===\"he\"){const targetPath=getHebrewPath(window.location.pathname);window.location.replace(targetPath+window.location.search+window.location.hash);return;// Stop execution here\n}// Otherwise, set to English\nlocalStorage.setItem(STORAGE_KEY,\"en\");document.documentElement.lang=\"en\";document.documentElement.dir=\"ltr\";document.documentElement.style.scrollBehavior=\"smooth\";},[]);return /*#__PURE__*/_jsxs(\"div\",{style:{direction:\"ltr\",width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"style\",{children:ScrollbarStyles}),/*#__PURE__*/_jsx(Component,{...props})]});};}// ==========================================\n// 2. HEBREW CONTROLLER (Apply to Hebrew template)\n// ==========================================\nexport function HebrewController(Component){return props=>{useEffect(()=>{if(typeof window===\"undefined\"||RenderTarget.current()===RenderTarget.canvas)return;const isFramerApp=window.location.pathname.startsWith(\"/s/app\");if(isFramerApp)return;// GLOBAL MEMORY CHECK: If they prefer English, redirect them immediately\nconst savedLang=localStorage.getItem(STORAGE_KEY);if(savedLang===\"en\"){const targetPath=getEnglishPath(window.location.pathname);window.location.replace(targetPath+window.location.search+window.location.hash);return;// Stop execution here\n}// Otherwise, set to Hebrew\nlocalStorage.setItem(STORAGE_KEY,\"he\");document.documentElement.lang=\"he\";document.documentElement.dir=\"rtl\";document.documentElement.style.scrollBehavior=\"smooth\";// LINK INTERCEPTOR\nconst handleNuclearClick=e=>{const target=e.target;if(target.closest(\".lang-switcher\"))return;const link=target.closest(\"a\");if(!link)return;const url=new URL(link.href);if(url.host!==window.location.host)return;const linkPath=url.pathname;// If it's an internal link missing /he, catch it before Framer does!\nif(!isPathHebrew(linkPath)){e.preventDefault();e.stopPropagation();const targetPath=getHebrewPath(linkPath);const targetUrl=targetPath+url.search+url.hash;const currentPath=window.location.pathname;if(targetPath===currentPath){if(url.hash){window.history.pushState(null,\"\",targetUrl);const id=url.hash.replace(\"#\",\"\");const section=document.getElementById(id);if(section)section.scrollIntoView({behavior:\"smooth\"});}}else{window.location.assign(targetUrl);}}};window.addEventListener(\"click\",handleNuclearClick,true);return()=>window.removeEventListener(\"click\",handleNuclearClick,true);},[]);return /*#__PURE__*/_jsxs(\"div\",{style:{direction:\"rtl\",width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"style\",{children:ScrollbarStyles}),/*#__PURE__*/_jsx(Component,{...props})]});};}// ==========================================\n// 3. SWITCHERS\n// ==========================================\nexport function SwitchToHebrew(Component){return props=>{const combinedClass=`${props.className||\"\"} lang-switcher`.trim();return /*#__PURE__*/_jsx(Component,{...props,className:combinedClass,style:{...props.style,cursor:\"pointer\"},onClick:e=>{e.preventDefault();e.stopPropagation();// Force the preference change before redirecting\nlocalStorage.setItem(STORAGE_KEY,\"he\");if(window.location.pathname.startsWith(\"/s/app\")){window.location.reload();return;}const url=new URL(window.location.href);const targetPath=getHebrewPath(url.pathname);window.location.assign(targetPath+url.search+url.hash);}});};}export function SwitchToEnglish(Component){return props=>{const combinedClass=`${props.className||\"\"} lang-switcher`.trim();return /*#__PURE__*/_jsx(Component,{...props,className:combinedClass,style:{...props.style,cursor:\"pointer\"},onClick:e=>{e.preventDefault();e.stopPropagation();// Force the preference change before redirecting\nlocalStorage.setItem(STORAGE_KEY,\"en\");if(window.location.pathname.startsWith(\"/s/app\")){window.location.reload();return;}const url=new URL(window.location.href);const targetPath=getEnglishPath(url.pathname);window.location.assign(targetPath+url.search+url.hash);}});};}// ==========================================\n// 4. UTILITIES\n// ==========================================\nexport function FixMediaPlayerDirection(Component){return props=>/*#__PURE__*/_jsx(\"div\",{style:{direction:\"ltr\",width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsx(Component,{...props})});}\nexport const __FramerMetadata__ = {\"exports\":{\"SwitchToEnglish\":{\"type\":\"reactHoc\",\"name\":\"SwitchToEnglish\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"HebrewController\":{\"type\":\"reactHoc\",\"name\":\"HebrewController\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"FixMediaPlayerDirection\":{\"type\":\"reactHoc\",\"name\":\"FixMediaPlayerDirection\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"EnglishController\":{\"type\":\"reactHoc\",\"name\":\"EnglishController\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SwitchToHebrew\":{\"type\":\"reactHoc\",\"name\":\"SwitchToHebrew\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LocalizationEngine.map"],"mappings":"wLAiBA,SAAgB,EAAkB,EAAU,CAAC,MAAO,KAAQ,MAAc,CAAI,KAAO,IAAS,QAAa,EAAa,SAAS,GAAG,EAAa,SAAgC,GAAO,SAAS,SAAS,WAAW,SAAS,CAC5K,IAAlC,aAAa,QAAQ,EAAY,GAAgB,KAAK,CAAC,IAAM,EAAW,EAAc,EAAO,SAAS,SAAS,CAAC,EAAO,SAAS,QAAQ,EAAW,EAAO,SAAS,OAAO,EAAO,SAAS,KAAK,CAAC,OAEhN,aAAa,QAAQ,EAAY,KAAK,CAAC,SAAS,gBAAgB,KAAK,KAAK,SAAS,gBAAgB,IAAI,MAAM,SAAS,gBAAgB,MAAM,eAAe,WAAW,EAAE,CAAC,CAAqB,EAAM,MAAM,CAAC,MAAM,CAAC,UAAU,MAAM,MAAM,OAAO,OAAO,OAAO,CAAC,SAAS,CAAc,EAAK,QAAQ,CAAC,SAAS,EAAgB,CAAC,CAAc,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,CAAC,CAAC,CAAC,EAGxW,SAAgB,EAAiB,EAAU,CAAC,MAAO,KAAQ,MAAc,CAAqJ,GAA1I,IAAS,QAAa,EAAa,SAAS,GAAG,EAAa,QAAgC,EAAO,SAAS,SAAS,WAAW,SAAS,CAAgB,OAC3L,GAAlC,aAAa,QAAQ,EAAY,GAAgB,KAAK,CAAC,IAAM,EAAW,EAAe,EAAO,SAAS,SAAS,CAAC,EAAO,SAA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