Ë
    hKêjÃ(  ã                  ó4  — U d Z ddlmZ ddlZddlZddlZddlmZ ddlm	Z	 ddl
mZmZ ddlmZmZ dd	lmZ ej$                  d
k(  rdd„ZnddlmZ  G d„ de«      Z G d„ dee«      Z ej.                  dej0                  «      Zded<   dd„ZdZded<   dgZy)zmacOS.é    )ÚannotationsN)Úsuppress)ÚPath)ÚFinalÚNoReturné   )ÚXDGMixinÚ_expand_user)ÚPlatformDirsABCÚwin32c                 ó   — d} t        | «      ‚)Nzshould only be used on macOS)ÚRuntimeError)Úmsgs    úW/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/platformdirs/macos.pyÚgeteuidr      s   € Ø,ˆÜ˜3ÓÐó    )r   c                  ó>  ‡ — e Zd ZdZd"ˆ fd„Zed#d„«       Zd$d„Zd%d„Ze	d$d„«       Z
e	d%d„«       Ze	d$d„«       Ze	d%d	„«       Ze	d$d
„«       Ze	d%d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Ze	d$d„«       Z e	d$d„«       Z!e	d$d„«       Z"e	d%d„«       Z#e	d$d „«       Z$e	d$d!„«       Z%ˆ xZ&S )&Ú_MacOSDefaultsaˆ  Default platform directories for macOS without XDG environment variable overrides.

    Follows the guidance from `Apple's File System Programming Guide
    <https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html>`_.
    The XDG env var handling is in :class:`~platformdirs._xdg.XDGMixin`.

    c               ó   •— | j                   r¤t        t        «      x}t        |«      x}j                  v r|||j	                  |«      j
                  d   z  }t        t        «      5  t        ‰| �%  t        |«      |¬«       d d d «       | j                  |«      x}rd|› �}t        |«      ‚||k(  ry t        ‰| �%  ||¬«       y # 1 sw Y   ŒDxY w)Nr   ©Úprivatezsite cache directory )Úensure_existsr   Ú_SITE_CACHEÚparentsÚrelative_toÚpartsr   ÚFileExistsErrorÚsuperÚ_optionally_create_directoryÚstrÚ_shared_entry_problemÚPermissionError)	ÚselfÚpathr   ÚsharedÚtargetÚentryÚproblemr   Ú	__class__s	           €r   r   z+_MacOSDefaults._optionally_create_directory"   sÍ   ø€ Ø×Ò¬T´+Ó->Ð#> 6ÌdÐSWËjÐDXÀF×CaÑCaÑ"aà˜V×/Ñ/°Ó7×=Ñ=¸aÑ@Ñ@ˆEÜœ/Ó*ñ RÜ‘Ñ4´S¸³ZÈÐ4ÔQ÷Rà×4Ñ4°UÓ;Ð;ˆwÐ;Ø-¨g¨YÐ7�Ü% cÓ*Ð*Ø˜ŠØÜ‰Ñ,¨T¸7Ð,ÕC÷Rð Rús   Á&CÃCc                ó,  — | j                  «       }t        j                  |j                  «      r| › d�S t        j                  |j                  «      s| › d�S |j
                  dk7  r-|j
                  t        «       x}k7  r| › d|j
                  › d|› �S y )Nz is a symlinkz is not a directoryr   z is owned by uid z, not root or )ÚlstatÚstatÚS_ISLNKÚst_modeÚS_ISDIRÚst_uidr   )r$   ÚinfoÚeuids      r   r!   z$_MacOSDefaults._shared_entry_problem/   s…   € à�z‰z‹|ˆÜ�<‰<˜Ÿ™Ô%Ø�V˜=Ð)Ð)Ü�|‰|˜DŸL™LÔ)Ø�VÐ.Ð/Ð/Ø�;‰;˜!Ò §¡¼»	Ð0A°Ò BØ�VÐ,¨T¯[©[¨M¸ÈÀvÐNÐNØr   c                ó:   — | j                  t        d«      d¬«      S )Nz~/Library/Application SupportTr   ©Ú_append_app_name_and_versionr
   ©r#   s    r   Ú_base_user_app_support_dirz)_MacOSDefaults._base_user_app_support_dir:   s   € Ø×0Ñ0´Ð>]Ó1^ÐhlÐ0ÓmÐmr   c                óŒ   — t        «       x}r| j                  |› d�«      gng }|j                  | j                  d«      «       |S )Nz/sharez/Library/Application Support)Ú_homebrew_prefixÚ_join_app_name_and_versionÚappend©r#   ÚprefixÚ	path_lists      r   Ú_base_site_dirsz_MacOSDefaults._base_site_dirs=   sL   € ÜWgÓWiÐMiÈVÐMi�T×4Ñ4¸°x¸vÐ5FÓGÑHÐprˆ	Ø×Ñ˜×8Ñ8Ð9WÓXÔYØÐr   c                ó"   — | j                  «       S )zZData directory tied to the user, e.g. ``~/Library/Application Support/$appname/$version``.©r7   r6   s    r   Úuser_data_dirz_MacOSDefaults.user_data_dirB   ó   € ð ×.Ñ.Ó0Ð0r   c                ó"   — | j                  «       S ©N©r?   r6   s    r   Ú_site_data_dirsz_MacOSDefaults._site_data_dirsG   ó   € à×#Ñ#Ó%Ð%r   c                ó"   — | j                  «       S )z;Config directory tied to the user, same as `user_data_dir`.rA   r6   s    r   Úuser_config_dirz_MacOSDefaults.user_config_dirK   rC   r   c                ó"   — | j                  «       S rE   rF   r6   s    r   Ú_site_config_dirsz _MacOSDefaults._site_config_dirsP   rH   r   c                ó:   — | j                  t        d«      d¬«      S )zNCache directory tied to the user, e.g. ``~/Library/Caches/$appname/$version``.z~/Library/CachesTr   r4   r6   s    r   Úuser_cache_dirz_MacOSDefaults.user_cache_dirT   s!   € ð ×0Ñ0´Ð>PÓ1QÐ[_Ð0Ó`Ð`r   c                ó”   — t        «       x}r| j                  |› d�«      gng }|j                  | j                  t        «      «       |S )Nz
/var/cache)r9   r:   r;   r   r<   s      r   Ú_site_cache_dirsz_MacOSDefaults._site_cache_dirsY   sL   € ä[kÓ[mÐQmÐQWÐQm�T×4Ñ4¸°x¸zÐ5JÓKÑLÐtvˆ	Ø×Ñ˜×8Ñ8¼ÓEÔFØÐr   c                ó8   — | j                  | j                  «      S )aí  Cache directory shared by users, e.g. ``/Library/Caches/$appname/$version``. If we're using a Python binary managed by `Homebrew <https://brew.sh>`_, the directory will be under the Homebrew prefix, e.g. ``$homebrew_prefix/var/cache/$appname/$version``. If `multipath <platformdirs.api.PlatformDirsABC.multipath>` is enabled, and we're in Homebrew, the response is a multi-path string separated by ":", e.g. ``$homebrew_prefix/var/cache/$appname/$version:/Library/Caches/$appname/$version``.

        :raises PermissionError: under `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`, if
            ``/Library/Caches/$appname`` is a symlink, not a directory or owned by a user other than root and the
            current one.

        )Ú_select_site_dirsrP   r6   s    r   Úsite_cache_dirz_MacOSDefaults.site_cache_dir_   s   € ð ×%Ñ% d×&;Ñ&;Ó<Ð<r   c                ó"   — | j                  «       S )z�State directory tied to the user, same as `user_data_dir` without ``$XDG_DATA_HOME``, e.g. ``~/Library/Application Support/$appname/$version``.rA   r6   s    r   Úuser_state_dirz_MacOSDefaults.user_state_dirj   rC   r   c                óR   — | j                  «       d   }| j                  |d¬«       |S )z¢State directory shared by users, the first entry of `site_data_dir` without ``$XDG_DATA_DIRS``, ignoring `multipath <platformdirs.api.PlatformDirsABC.multipath>`.r   Fr   )r?   r   )r#   r$   s     r   Úsite_state_dirz_MacOSDefaults.site_state_diro   s/   € ð ×#Ñ#Ó% aÑ(ˆØ×)Ñ)¨$¸Ð)Ô>Øˆr   c                ó:   — | j                  t        d«      d¬«      S )zJLog directory tied to the user, e.g. ``~/Library/Logs/$appname/$version``.z~/Library/LogsTr   r4   r6   s    r   Úuser_log_dirz_MacOSDefaults.user_log_dirv   s!   € ð ×0Ñ0´Ð>NÓ1OÐY]Ð0Ó^Ð^r   c                ó(   — | j                  dd¬«      S )zHLog directory shared by users, e.g. ``/Library/Logs/$appname/$version``.z/Library/LogsFr   )r5   r6   s    r   Úsite_log_dirz_MacOSDefaults.site_log_dir{   s   € ð ×0Ñ0°È%Ð0ÓPÐPr   c                ó   — t        d«      S )z;Documents directory tied to the user, e.g. ``~/Documents``.z~/Documents©r
   r6   s    r   Úuser_documents_dirz!_MacOSDefaults.user_documents_dir€   ó   € ô ˜MÓ*Ð*r   c                ó   — t        d«      S )z;Downloads directory tied to the user, e.g. ``~/Downloads``.z~/Downloadsr]   r6   s    r   Úuser_downloads_dirz!_MacOSDefaults.user_downloads_dir…   r_   r   c                ó   — t        d«      S )z9Pictures directory tied to the user, e.g. ``~/Pictures``.z
~/Picturesr]   r6   s    r   Úuser_pictures_dirz _MacOSDefaults.user_pictures_dirŠ   ó   € ô ˜LÓ)Ð)r   c                ó   — t        d«      S )z5Videos directory tied to the user, e.g. ``~/Movies``.z~/Moviesr]   r6   s    r   Úuser_videos_dirz_MacOSDefaults.user_videos_dir�   ó   € ô ˜JÓ'Ð'r   c                ó   — t        d«      S )z3Music directory tied to the user, e.g. ``~/Music``.z~/Musicr]   r6   s    r   Úuser_music_dirz_MacOSDefaults.user_music_dir”   s   € ô ˜IÓ&Ð&r   c                ó   — t        d«      S )z7Desktop directory tied to the user, e.g. ``~/Desktop``.z	~/Desktopr]   r6   s    r   Úuser_desktop_dirz_MacOSDefaults.user_desktop_dir™   s   € ô ˜KÓ(Ð(r   c                ó   — t        d«      S )z9Projects directory tied to the user, e.g. ``~/Projects``.z
~/Projectsr]   r6   s    r   Úuser_projects_dirz _MacOSDefaults.user_projects_dirž   rd   r   c                ó   — t        d«      S )z;Public share directory tied to the user, e.g. ``~/Public``.z~/Publicr]   r6   s    r   Úuser_publicshare_dirz#_MacOSDefaults.user_publicshare_dir£   rg   r   c                ó   — t        d«      S )z;Templates directory tied to the user, e.g. ``~/Templates``.z~/Templatesr]   r6   s    r   Úuser_templates_dirz!_MacOSDefaults.user_templates_dir¨   r_   r   c                ó   — t        d«      S )z;Fonts directory tied to the user, e.g. ``~/Library/Fonts``.z~/Library/Fontsr]   r6   s    r   Úuser_fonts_dirz_MacOSDefaults.user_fonts_dir­   s   € ô Ð-Ó.Ð.r   c                ó:   — | j                  t        d«      d¬«      S )zNPreference directory tied to the user, e.g. ``~/Library/Preferences/AppName``.z~/Library/PreferencesTr   r4   r6   s    r   Úuser_preference_dirz"_MacOSDefaults.user_preference_dir²   s!   € ð ×0Ñ0´Ð>UÓ1VÐ`dÐ0ÓeÐer   c                ó   — t        d«      S )z6Bin directory tied to the user, e.g. ``~/.local/bin``.z~/.local/binr]   r6   s    r   Úuser_bin_dirz_MacOSDefaults.user_bin_dir·   s   € ô ˜NÓ+Ð+r   c                 ó   — y)z7Bin directory shared by users, e.g. ``/usr/local/bin``.z/usr/local/bin© r6   s    r   Úsite_bin_dirz_MacOSDefaults.site_bin_dir¼   s   € ð  r   c                ó   — t        d«      S )zAApplications directory tied to the user, e.g. ``~/Applications``.z~/Applicationsr]   r6   s    r   Úuser_applications_dirz$_MacOSDefaults.user_applications_dirÁ   s   € ô Ð,Ó-Ð-r   c                ó   — dgS )Nz/Applicationsry   r6   s    r   Ú_site_applications_dirsz&_MacOSDefaults._site_applications_dirsÆ   s   € àÐ Ð r   c                ó:   — | j                  t        d«      d¬«      S )z_Runtime directory tied to the user, e.g. ``~/Library/Caches/TemporaryItems/$appname/$version``.z~/Library/Caches/TemporaryItemsTr   r4   r6   s    r   Úuser_runtime_dirz_MacOSDefaults.user_runtime_dirÊ   s!   € ð ×0Ñ0´Ð>_Ó1`ÐjnÐ0ÓoÐor   c                ó   — | j                   S )z>Runtime directory shared by users, same as `user_runtime_dir`.)r€   r6   s    r   Úsite_runtime_dirz_MacOSDefaults.site_runtime_dirÏ   s   € ð ×$Ñ$Ð$r   )r$   r    r   ÚboolÚreturnÚNone)r$   r   r„   ú
str | None)r„   r    )r„   z	list[str])'Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ústaticmethodr!   r7   r?   ÚpropertyrB   rG   rJ   rL   rN   rP   rS   rU   rW   rY   r[   r^   ra   rc   rf   ri   rk   rm   ro   rq   rs   ru   rw   rz   r|   r~   r€   r‚   Ú__classcell__)r)   s   @r   r   r      sg  ø„ ñõDð òó ðónóð
 ò1ó ð1ð ò&ó ð&ð ò1ó ð1ð ò&ó ð&ð òaó ðað òó ðð
 ò=ó ð=ð ò1ó ð1ð òó ðð ò_ó ð_ð òQó ðQð ò+ó ð+ð ò+ó ð+ð ò*ó ð*ð ò(ó ð(ð ò'ó ð'ð ò)ó ð)ð ò*ó ð*ð ò(ó ð(ð ò+ó ð+ð ò/ó ð/ð òfó ðfð ò,ó ð,ð ò ó ð ð ò.ó ð.ð ò!ó ð!ð òpó ðpð ò%ó ô%r   r   c                  ó   — e Zd ZdZy)ÚMacOSaF  Platform directories for the macOS operating system.

    Follows the guidance from `Apple documentation
    <https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html>`_.
    Makes use of the `appname <platformdirs.api.PlatformDirsABC.appname>`, `version
    <platformdirs.api.PlatformDirsABC.version>`, `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`.

    XDG environment variables (e.g. ``$XDG_DATA_HOME``) are supported and take precedence over macOS defaults.

    N)r‡   rˆ   r‰   rŠ   ry   r   r   r�   r�   Õ   s   „ ò	r   r�   aû  
    (?P<prefix>.+)                          # $HOMEBREW_PREFIX, as printed by `brew --prefix`
    /(?:opt/python[^/]*                     # formula link: python, python3, python@3.13 or python-freethreading
       |Cellar/python[^/]*/[0-9._abrc]+)    # formula keg, named by version as sitecustomize matches it, e.g. 3.13.7_1
    /Frameworks/PythonT?\.framework         # framework build, PythonT for python-freethreading
    /Versions/[^/]+                         # interpreter version, such as 3.13
    r   Ú_HOMEBREW_PYTHONc                 óX   — t         j                  t        j                  «      x} r| d   S y )Nr=   )r�   Ú	fullmatchÚsysÚbase_prefix)Úmatchs    r   r9   r9   ñ   s)   € Ü ×*Ñ*¬3¯?©?Ó;Ð;€uÐ;Ø�X‰ÐØr   z/Library/Cachesr   )r„   r   )r„   r†   )rŠ   Ú
__future__r   Úrer,   r“   Ú
contextlibr   Úpathlibr   Útypingr   r   Ú_xdgr	   r
   Úapir   Úplatformr   Úosr   r�   ÚcompileÚVERBOSEr�   Ú__annotations__r9   r   Ú__all__ry   r   r   ú<module>r£      s›   ðÚ å "ã 	Û Û 
Ý Ý ß "ç (Ý  à‡<�<�7Òô õ
 ôy%�_ô y%ôx
ˆH�nô 
ð  %˜"Ÿ*™*ðð ‡J�Jó	Ð �%ó 	óð '€ˆUÓ &ð ð�r   