+
    *:g#                      a  0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHtHtHt ^ RIHt ^ RIHt ^ RIHt / tR]R	&   ]P.                  ! 4       t]P2                  P5                  ]P2                  P7                  ]4      R
4      t]P<                  ! R]P>                  4      t R R lt!R R lt"R R lt#]! RR7      R R l4       t$R R lt%RR R llt&R R lt' ! R R4      t( ! R R]
P                  4      t)R# ) a+  
babel.localedata
~~~~~~~~~~~~~~~~

Low-level locale data access.

:note: The `Locale` class, which uses this module under the hood, provides a
       more convenient interface for accessing the locale data.

:copyright: (c) 2013-2025 by the Babel Team.
:license: BSD, see LICENSE for more details.
)annotationsN)abc)IteratorMappingMutableMapping)	lru_cache)chain)Anydict[str, Any]_cachezlocale-dataz%^(con|prn|aux|nul|com[0-9]|lpt[0-9])$c                    V ^8  d   QhRRRR/# )   namestrreturnz
str | None )formats   "2/usr/lib/python3/dist-packages/babel/localedata.py__annotate__r   !   s      3 :     c                   V '       d   \        V \        4      '       g   R# V P                  4       P                  4       p \        P
                  ! \        \        4       .4       F  pWP                  4       8X  g   K  Vu # 	  R# )zNormalize a locale ID by stripping spaces and apply proper casing.

Returns the normalized locale ID string or `None` if the ID is not
recognized.
N)
isinstancer   striplowerr   from_iterabler   locale_identifiers)r   	locale_ids   & r   normalize_localer   !   s\     z$,,::<D((&2D2F)GH	??$$ Ir   c                    V ^8  d   QhRRRR/# )r   r   os.PathLike[str] | strr   r   r   )r   s   "r   r   r   /   s     1 1"8 1S 1r   c                T   \         P                  P                  V 4      p \        P                  R8X  dO   \
        P                  \         P                  P                  V 4      ^ ,          4      '       d   \        RV  R24      h\         P                  P                  \        V  R24      # )z7
Resolve a locale identifier to a `.dat` path on disk.
win32zName z is invalid on Windows.dat)ospathbasenamesysplatform_windows_reserved_name_rematchsplitext
ValueErrorjoin_dirname)r   s   &r   resolve_locale_filenamer.   /   s     77D!D ||w#<#B#B277CSCSTXCYZ[C\#]#]5&<=>> 77<<TF$-00r   c                    V ^8  d   QhRRRR/# r   r   r   r   boolr   )r   s   "r   r   r   ?   s     @ @ @ @r   c                    V '       d   \        V \        4      '       g   R# V \        9   d   R# \        P                  P                  \        V 4      4      pV'       d   R# \        \        V 4      4      # )zCheck whether locale data is available for the given locale.

Returns `True` if it exists, `False` otherwise.

:param name: the locale identifier string
FT)	r   r   r   r#   r$   existsr.   r1   r   )r   
file_founds   & r   r3   r3   ?   sP     z$,,v~ 7 =>J4?4(8(>#??r   )maxsizec                   V ^8  d   QhRR/# )r   r   z	list[str]r   )r   s   "r   r   r   O   s      I r   c                     R \         P                  ! \        4       4        U Uu. uF  w  rVR8X  g   K  V R8w  g   K  V NK  	  upp # u upp i )a  Return a list of all locale identifiers for which locale data is
available.

This data is cached after the first invocation.
You can clear the cache by calling `locale_identifiers.cache_clear()`.

.. versionadded:: 0.8.1

:return: a list of locale identifiers (strings)
c              3  `   "   T F$  p\         P                  P                  V4      x  K&  	  R # 5iN)r#   r$   r*   ).0filenames   & r   	<genexpr>%locale_identifiers.<locals>.<genexpr>]   s$     I4H		(	#	#4Hs   ,.r"   root)r#   listdirr-   )stem	extensions     r   r   r   N   sX     	JBJJx4HI 	J D 	 $(6> 	I  s   AAAc                    V ^8  d   QhRRRR/# r0   r   )r   s   "r   r   r   b   s        r   c                    ^ RI HpHp  V! V 4      vr4rVpT'       dG   T'       d?   T'       g7   T'       g/   T'       g'   T! R4      P	                  T4      pT! T4      v rp	YZ8g  # R#   \         d     R# i ; i)zReturn whether the locale is of the form ``lang_Script``,
and the script is not the likely script for the language.

This implements the behavior of the ``nonlikelyScript`` value of the
``localRules`` attribute for parent locales added in CLDR 45.
)
get_globalparse_localeFlikely_subtags)
babel.corerD   rE   r+   get)r   rD   rE   lang	territoryscriptvariantrestlikely_subtag_likely_scripts   &          r   _is_non_likely_scriptrQ   b   sq     42>t2D/4 y"#3488>".}"=1a&&  s   A% %A43A4c               $    V ^8  d   QhRRRRRR/# )r   r   r   merge_inheritedr1   r   r
   r   )r   s   "r   r   r   w   s"     4 4% 4 4 4r   c                N   \         P                  P                  V 4      p \        P	                  4         \
        P                  V 4      pV'       Eg   V R8X  g	   V'       g   / pM^ RIHp V! R4      P                  V 4      pV'       gL   \        V 4      '       d   RpM7V P                  R4      p\        V4      ^8X  d   RMRP                  VRR 4      p\        V4      P                  4       p\        V 4      p\!        VR4      ;_uu_ 4       pV R8w  d*   V'       d"   \#        V\$        P                  ! V4      4       M\$        P                  ! V4      pRRR4       V\
        V &   V\        P'                  4        #   + '       g   i     L/; i  \        P'                  4        i ; i)a  Load the locale data for the given locale.

The locale data is a dictionary that contains much of the data defined by
the Common Locale Data Repository (CLDR). This data is stored as a
collection of pickle files inside the ``babel`` package.

>>> d = load('en_US')
>>> d['languages']['sv']
u'Swedish'

Note that the results are cached, and subsequent requests for the same
locale return the same dictionary:

>>> d1 = load('en_US')
>>> d2 = load('en_US')
>>> d1 is d2
True

:param name: the locale identifier string (or "root")
:param merge_inherited: whether the inherited data should be merged into
                        the data of the requested locale
:raise `IOError`: if no locale data file is found for the given locale
                  identifier, or one of the locales it inherits from
r>   )rD   parent_exceptionsrO   Nrb)r#   r$   r%   _cache_lockacquirer   rH   rG   rD   rQ   splitlenr,   loadcopyr.   openmergepicklerelease)r   rS   datarD   parentpartsr;   fileobjs   &&      r   r\   r\   w   s0   2 77D!Dzz$tv~_1#$78<<TB,T22!' $

3+.u:?sPR@TF|((*.t4Hh%%6>o$G 45!;;w/D	 &
  F4L &% 	s<   F F "'F 
BF E;7E;F ;F	F F$c               $    V ^8  d   QhRRRRRR/# )r   dict1zMutableMapping[Any, Any]dict2zMapping[Any, Any]r   Noner   )r   s   "r   r   r      s#      ) 2C  r   c                   VP                  4        F  w  r#Vf   K  V P                  V4      p\        V\        4      '       dv   Vf   / p\        V\        4      '       d   WC3pMW\        V\
        4      '       d$   Vw  rVVP                  4       p\        Wc4       WV3pMVP                  4       p\        WC4       MTpW@V&   K  	  R# )aN  Merge the data from `dict2` into the `dict1` dictionary, making copies
of nested dictionaries.

>>> d = {1: 'foo', 3: 'baz'}
>>> merge(d, {1: 'Foo', 2: 'Bar'})
>>> sorted(d.items())
[(1, 'Foo'), (2, 'Bar'), (3, 'baz')]

:param dict1: the dictionary to merge into
:param dict2: the dictionary containing the data that should be merged
N)itemsrH   r   dictAliastupler]   r_   )rg   rh   keyval2val1aliasotherss   &&     r   r_   r_      s     [[]	99S>D$%%<DdE** <De,,$(ME#[[]F&'!?D99;D$%#J% #r   c                  >    ] tR t^tRtR R ltR R ltR R ltRtR	# )
rm   zRepresentation of an alias in the locale data.

An alias is a value that refers to some other part of the locale data,
as specified by the `keys`.
c                    V ^8  d   QhRRRR/# )r   keysztuple[str, ...]r   ri   r   )r   s   "r   r   Alias.__annotate__   s        _    r   c                	&    \        V4      V n        R # r9   )rn   rv   )selfrv   s   &&r   __init__Alias.__init__   s    $K	r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   rw      s     8 8# 8r   c                	P    R \        V 4      P                   RV P                  : R2# )< >)type__name__rv   ry   s   &r   __repr__Alias.__repr__   s&    4:&&'qQ77r   c                    V ^8  d   QhRRRR/# )r   rb   zMapping[str | int | None, Any]r   r   )r   s   "r   r   rw      s      : ?] r   c                    TpV P                    F  pW,          pK  	  \        V\        4      '       d   VP                  V4      pV# \        V\        4      '       d   Vw  rEVP                  V4      pV# )zResolve the alias based on the given data.

This is done recursively, so if one alias resolves to a second alias,
that second alias will also be resolved.

:param data: the locale data
:type data: `dict`
)rv   r   rm   resolvern   )ry   rb   basero   rr   rs   s   &&    r   r   Alias.resolve   si     99C9D dE""<<%D  e$$ ME==&Dr   )rv   N)	r   
__module____qualname____firstlineno____doc__rz   r   r   __static_attributes__r   r   r   rm   rm      s     8 r   rm   c                  r    ] tR t^tRtRR R lltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltRtR# )LocaleDataDictzMDictionary wrapper that automatically resolves aliases to the actual
values.
Nc                    V ^8  d   QhRRRR/# )r   rb   z%MutableMapping[str | int | None, Any]r   z%Mapping[str | int | None, Any] | Noner   )r   s   "r   r   LocaleDataDict.__annotate__   s      B Jo r   c                	*    Wn         Vf   TpW n        R # r9   _datar   )ry   rb   r   s   &&&r   rz   LocaleDataDict.__init__   s    
<D	r   c                   V ^8  d   QhRR/# )r   r   intr   )r   s   "r   r   r      s       r   c                	,    \        V P                  4      # r9   )r[   r   r   s   &r   __len__LocaleDataDict.__len__   s    4::r   c                   V ^8  d   QhRR/# )r   r   zIterator[str | int | None]r   )r   s   "r   r   r      s        4  r   c                	,    \        V P                  4      # r9   )iterr   r   s   &r   __iter__LocaleDataDict.__iter__   s    DJJr   c                    V ^8  d   QhRRRR/# )r   ro   str | int | Noner   r	   r   )r   s   "r   r   r     s      / C r   c                	   V P                   V,          ;r#\        V\        4      '       d   VP                  V P                  4      p\        V\
        4      '       d9   Vw  rEVP                  V P                  4      P                  4       p\        W54       \        V\        4      '       d   \        W0P                  R 7      pW2Jd   W0P                   V&   V# )r   )
r   r   rm   r   r   rn   r]   r_   rl   r   )ry   ro   origvalrr   rs   s   &&    r   __getitem__LocaleDataDict.__getitem__  s    ZZ_$c5!!++dii(Cc5!!ME--		*//1C#c4   995C?!JJsO
r   c               $    V ^8  d   QhRRRRRR/# )r   ro   r   valuer	   r   ri   r   )r   s   "r   r   r     s"        /      r   c                	"    W P                   V&   R # r9   r   )ry   ro   r   s   &&&r   __setitem__LocaleDataDict.__setitem__  s    

3r   c                    V ^8  d   QhRRRR/# )r   ro   r   r   ri   r   )r   s   "r   r   r     s      / D r   c                	     V P                   V R # r9   r   )ry   ro   s   &&r   __delitem__LocaleDataDict.__delitem__  s    JJsOr   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r     s     A An Ar   c                	`    \        V P                  P                  4       V P                  R 7      # r   )r   r   r]   r   r   s   &r   r]   LocaleDataDict.copy  s    djjoo/dii@@r   r   r9   )r   r   r   r   r   rz   r   r   r   r   r   r]   r   r   r   r   r   r      s1      A Ar   r   )T)*__conditional_annotations__r   
__future__r   r#   r`   rer&   	threadingcollectionsr   collections.abcr   r   r   	functoolsr   	itertoolsr   typingr	   r   __annotations__RLockrX   r$   r,   dirname__file__r-   compileIr(   r   r.   r3   r   rQ   r\   r_   rm   r   )r   s   @r   <module>r      s    # 	  	 
   = =    oo77<<1=AJJ'NPRPTPTU 1 @ 4 &*4nB B&AS'' &Ar   