import{u as l,a as i}from"./hooks-1.0.63-CWs3kTdT.js";import{l as a,aX as c,S as n,aY as u,aZ as p,a_ as r,a$ as f,b0 as m,C as S}from"./lib-1.0.63-DJZPtMem.js";import{r as g}from"./redux-1.0.63-Df-eBzJn.js";import{R as q}from"./RestApi-1.0.63-BUfzocgq.js";import{e as d}from"./notistack-1.0.63-B49ULGrj.js";const C=()=>{const e=l(o=>o.locales.translations);return a.debug("translations",e),e},k=()=>{const e=i();g.useEffect(()=>{c.getSelectors().selectTranslations(n.getState().locales)===void 0&&(u.getSelectors().selectRequests(n.getState().ui).includes("translations")||(e(p({request:"translations"})),a.debug("loading custom translations"),q(S.appUrlLocalizationGet,{},s=>{if(a.debug(s),(s==null?void 0:s.code)==="ok"&&(s==null?void 0:s.data)!==void 0&&s.data!==!1)try{const t=JSON.parse(s.data);e(f({translations:t})),e(m({savedTranslations:t}))}catch{d("Invalid response",{variant:"error"})}finally{e(r({request:"translations"}))}},s=>{console.error(s),e(r({request:"translations"}))})))},[])};export{C as a,k as u};
