"use strict";const r=require("react"),u=require("./SSRProvider-DZRLwxPS.cjs.js"),b=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),s=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function i(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),l=typeof t.getTextInfo=="function"?t.getTextInfo():t.textInfo;if(l)return l.direction==="rtl";if(t.script)return b.has(t.script)}let a=e.split("-")[0];return s.has(a)}const v=Symbol.for("react-aria.i18n.locale");function d(){let e=typeof window<"u"&&window[v]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:i(e)?"rtl":"ltr"}}let f=d(),n=new Set;function o(){f=d();for(let e of n)e(f)}function $(){let e=u.$b5e257d569688ac6$export$535bd6ca7f90a273(),[a,t]=r.useState(f);return r.useEffect(()=>(n.size===0&&window.addEventListener("languagechange",o),n.add(t),()=>{n.delete(t),n.size===0&&window.removeEventListener("languagechange",o)}),[]),e?{locale:"en-US",direction:"ltr"}:a}const c=r.createContext(null);function p(e){let{locale:a,children:t}=e,l=r.useMemo(()=>({locale:a,direction:i(a)?"rtl":"ltr"}),[a]);return r.createElement(c.Provider,{value:l},t)}function g(e){let{children:a}=e,t=$();return r.createElement(c.Provider,{value:t},a)}function h(e){let{locale:a,children:t}=e;return a?r.createElement(p,{locale:a,children:t}):r.createElement(g,{children:t})}function x(){let e=$();return r.useContext(c)||e}exports.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7=x;exports.$18f2051aff69b9bf$export$a54013f0d02a8f82=h;
//# sourceMappingURL=context-CyT9C4U4.cjs.js.map
