{"version":3,"file":"LanguageSwitcherV3.BdlnCMze.mjs","names":["useMemo","useState"],"sources":["https:/framer.com/m/framer/icon-nullstate.js@0.7.0","https:/framerusercontent.com/modules/Ma20hU0GGRxLxZphbywl/OSpwWF91FHPVFyQJjMHt/utils.js","https:/framerusercontent.com/modules/ahAJXEjpyX1HA5rtz6TR/O87vbYPiYy8lqHrOFDgZ/LanguageSwitcherV3.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport * as React from \"react\";\nexport const containerStyles = {\n    width: \"100%\",\n    height: \"100%\",\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nconst nullIconStyle = {\n    minWidth: \"10px\",\n    minHeight: \"10px\",\n    maxWidth: \"20px\",\n    maxHeight: \"20px\",\n    width: \"60%\",\n    height: \"60%\"\n};\nconst emptyStateStyle = {\n    ...containerStyles,\n    borderRadius: 6,\n    background: \"rgba(149, 149, 149, 0.1)\",\n    border: \"1px dashed rgba(149, 149, 149, 0.15)\",\n    color: \"#a5a5a5\",\n    flexDirection: \"column\"\n};\nexport const NullState = /*#__PURE__*/ React.forwardRef((_, ref)=>{\n    return(/*#__PURE__*/ _jsx(\"div\", {\n        style: emptyStateStyle,\n        ref: ref\n    }));\n}) /*\n\n<svg\n                xmlns=\"http://www.w3.org/2000/svg\"\n                viewBox=\"0 0 30 30\"\n                style={nullIconStyle}\n            >\n                <path\n                    d=\"M 12.857 0 C 19.958 0 25.714 5.756 25.714 12.857 C 25.714 19.958 19.958 25.714 12.857 25.714 C 5.756 25.714 0 19.958 0 12.857 C 0 5.756 5.756 0 12.857 0 Z\"\n                    fill=\"#FFFFFF\"\n                ></path>\n                <path\n                    d=\"M 20.357 20.357 L 27.857 27.857\"\n                    fill=\"transparent\"\n                    strokeWidth=\"4.28\"\n                    stroke=\"#FFFFFF\"\n                    strokeLinecap=\"round\"\n                ></path>\n                <g transform=\"translate(9.643 6.429)\">\n                    <path\n                        d=\"M 3.214 12.857 L 3.214 12.857\"\n                        fill=\"transparent\"\n                        strokeWidth=\"3.75\"\n                        stroke=\"currentColor\"\n                        strokeLinecap=\"round\"\n                    ></path>\n                    <path\n                        d=\"M 0 3.214 C 0 1.004 1.843 0 3.214 0 C 4.586 0 6.429 0.603 6.429 3.214 C 6.429 5.826 3.214 5.913 3.214 7.232 C 3.214 8.552 3.214 8.571 3.214 8.571\"\n                        fill=\"transparent\"\n                        strokeWidth=\"3.22\"\n                        stroke=\"currentColor\"\n                        strokeLinecap=\"round\"\n                        strokeLinejoin=\"round\"\n                    ></path>\n                </g>\n            </svg>\n            */ ;\n\nexport const __FramerMetadata__ = {\"exports\":{\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"NullState\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./nullstate.map","import{useMemo}from\"react\";import{ControlType}from\"framer\";/*\n ** ICON UTILS\n ** Pull as much re-usable logic into here as possible\n ** This will make it easier to replace in all icon components\n */ export const containerStyles={width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\"};export const defaultEvents={onClick:{type:ControlType.EventHandler},onMouseDown:{type:ControlType.EventHandler},onMouseUp:{type:ControlType.EventHandler},onMouseEnter:{type:ControlType.EventHandler},onMouseLeave:{type:ControlType.EventHandler}};const findByArray=(arr,search)=>arr.find(a=>a.toLowerCase().includes(search));export function getIconSelection(iconKeys,selectByList,iconSearch=\"\",iconSelection,lowercaseIconKeyPairs){// gotta get the exact match first THEN find\n// have a set and try to access ?\nif(selectByList)return iconSelection;if(iconSearch==null||(iconSearch===null||iconSearch===void 0?void 0:iconSearch.length)===0)return null;const iconSearchTerm=iconSearch.toLowerCase().replace(/-|\\s/g,\"\");var _iconSearchTerm;// check for exact match, otherwise use .find\nconst searchResult=(_iconSearchTerm=lowercaseIconKeyPairs[iconSearchTerm])!==null&&_iconSearchTerm!==void 0?_iconSearchTerm:findByArray(iconKeys,iconSearchTerm);return searchResult;}export function useIconSelection(iconKeys,selectByList,iconSearch=\"\",iconSelection,lowercaseIconKeyPairs){// Clean search term\nconst iconSearchResult=useMemo(()=>{if(iconSearch==null||(iconSearch===null||iconSearch===void 0?void 0:iconSearch.length)===0)return null;const iconSearchTerm=iconSearch.toLowerCase().replace(/-|\\s/g,\"\");var _iconSearchTerm;// check for exact match, otherwise use .find\nconst searchResult=(_iconSearchTerm=lowercaseIconKeyPairs[iconSearchTerm])!==null&&_iconSearchTerm!==void 0?_iconSearchTerm:findByArray(iconKeys,iconSearchTerm);return searchResult;},[iconSelection,iconSearch]);const name=selectByList?iconSelection:iconSearchResult;return name;}\nexport const __FramerMetadata__ = {\"exports\":{\"getIconSelection\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useIconSelection\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultEvents\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./utils.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";export default function LanguageSwitcher({textColor=\"#19174F\",iconColor=\"#19174F\",bgColor=\"#EFEFF0\",hoverBgColor=\"#E0E0E1\",fontSize=\"16px\",fontFamilyEnglish=\"GE SS Two Light, sans-serif\",fontFamilyArabic=\"Figtree, sans-serif\",iconSize=\"24px\",iconScale=\"scale(.8)\",buttonPadding=\"5px 10px\",borderRadius=\"0px\"}){const[newUrl,setNewUrl]=useState(\"\");const[isArabic,setIsArabic]=useState(false);useEffect(()=>{const currentUrl=window.location.href;const url=new URL(currentUrl);const path=url.pathname;const host=`${url.protocol}//${url.host}`;if(path.startsWith(\"/ar\")){setNewUrl(host+path.replace(/^\\/ar/,\"\")+url.search);setIsArabic(true);}else{setNewUrl(host+\"/ar\"+path+url.search);setIsArabic(false);}},[]);const switchLanguage=()=>{window.location.href=newUrl;};return /*#__PURE__*/_jsxs(\"button\",{onClick:switchLanguage,style:{display:\"flex\",alignItems:\"center\",gap:\"4px\",padding:buttonPadding,fontSize:fontSize,fontWeight:\"regular\",borderRadius:borderRadius,backgroundColor:bgColor,color:textColor,border:\"solid 0px\",borderColor:\"#19174F\",cursor:\"pointer\",transition:\"background 0.3s ease\",fontFamily:isArabic?fontFamilyArabic:fontFamilyEnglish},onMouseOver:e=>e.currentTarget.style.backgroundColor=hoverBgColor,onMouseOut:e=>e.currentTarget.style.backgroundColor=bgColor,children:[isArabic?\"English\":\"العربية\",/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,transform:iconScale,xmlns:\"http://www.w3.org/2000/svg\",fillRule:\"evenodd\",clipRule:\"evenodd\",style:{marginLeft:\"4px\",fill:iconColor},children:/*#__PURE__*/_jsx(\"path\",{d:\"M12 0c6.623 0 12 5.377 12 12s-5.377 12-12 12-12-5.377-12-12 5.377-12 12-12m2.557 16h-5.115c.546 2.46 1.441 4.114 2.558 5.744 1.194-1.741 2.041-3.41 2.557-5.744m-7.157 0h-4.567c1.236 2.825 3.704 4.972 6.755 5.716-1.048-1.733-1.783-3.658-2.188-5.716m13.767 0h-4.567c-.391 1.988-1.095 3.887-2.175 5.694 3.012-.763 5.517-2.895 6.742-5.694m-14.005-6h-4.962c-.267 1.313-.267 2.685 0 4h4.915c-.119-1.329-.101-2.672.047-4m7.661 0h-5.647c-.165 1.326-.185 2.672-.053 4h5.753c.133-1.328.111-2.673-.053-4m6.977 0h-4.963c.148 1.328.166 2.671.048 4h4.915c.26-1.285.273-2.648 0-4m-12.156-7.729c-3.077.732-5.567 2.886-6.811 5.729h4.653c.435-2.042 1.178-3.985 2.158-5.729m2.355-.048c-1.089 1.77-1.91 3.453-2.463 5.777h4.927c-.534-2.246-1.337-3.948-2.464-5.777m2.368.069c1.013 1.812 1.733 3.76 2.146 5.708h4.654c-1.232-2.816-3.762-4.958-6.8-5.708\"})})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LanguageSwitcher\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LanguageSwitcherV3.map"],"mappings":"2UAEa,EAAkB,CAC3B,MAAO,OACP,OAAQ,OACR,QAAS,OACT,eAAgB,SAChB,WAAY,SACf,CASK,EAAkB,CACpB,GAAG,EACH,aAAc,EACd,WAAY,2BACZ,OAAQ,uCACR,MAAO,UACP,cAAe,SAClB,CACY,EAA0B,GAAkB,EAAG,IACnC,EAAK,MAAO,CAC7B,MAAO,EACF,MACR,MCzBub,SAAgB,EAAiB,EAAS,EAAa,EAAW,GAAG,EAAc,EAAsB,CAEriB,GAAG,EAAa,OAAO,EAAc,GAAG,GAAY,MAAO,GAAyD,SAAU,EAAE,OAAO,KAAK,IAAM,EAAe,EAAW,cAAc,QAAQ,QAAQ,IAAI,IAAI,EAClN,IAAM,GAAc,EAAgB,EAAsB,KAAkE,EAAY,EAAS,GAAgB,OAAO,CAAc,UAAgB,EAAiB,EAAS,EAAa,EAAW,GAAG,EAAc,EAAsB,CAC/R,IAAM,EAAiBA,MAAY,CAAC,GAAG,GAAY,MAAO,GAAyD,SAAU,EAAE,OAAO,KAAK,IAAM,EAAe,EAAW,cAAc,QAAQ,QAAQ,IAAI,IAAI,EACjN,IAAM,GAAc,EAAgB,EAAsB,KAAkE,EAAY,EAAS,GAAgB,OAAO,CAAc,EAAC,CAAC,EAAc,EAAW,EAAQ,EAAK,EAAa,EAAc,EAAiB,OAAO,CAAM,2BALjJ,EAAc,CAAC,QAAQ,CAAC,KAAK,EAAY,aAAa,CAAC,YAAY,CAAC,KAAK,EAAY,aAAa,CAAC,UAAU,CAAC,KAAK,EAAY,aAAa,CAAC,aAAa,CAAC,KAAK,EAAY,aAAa,CAAC,aAAa,CAAC,KA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