import{o as e,r as t}from"./jsx-runtime-BbTa8W_M-1776590214964.js";import{o as n}from"./app-CXDQ5oEH-1776590214964.js";var r=e(t(),1);function i(){let{translations:e={},locale:t=`en`,isRtl:i=!1}=n().props;return(0,r.useEffect)(()=>{window.location.pathname.startsWith(`/cp`)?(document.documentElement.dir=`ltr`,document.documentElement.lang=`en`):(document.documentElement.dir=i?`rtl`:`ltr`,document.documentElement.lang=t)},[t,i]),{t:(t,n=null)=>{if(typeof window<`u`&&window.location.pathname.startsWith(`/cp`))return t;let r=e[t]===void 0?t:e[t];return n&&typeof n==`object`&&Object.keys(n).forEach(e=>{r=String(r).replace(`:${e}`,n[e])}),r},locale:t,isRtl:i}}export{i as t};