Ë
    R/j,  ã                  ó
  — U d Z ddlmZ ddlZddlZddlmZ  ej                  ej                  dd¬«      d   «      Z
e
j                   ej                  «       «       dd„Z e«        d	Zi Zd
ed<   dd„Zdd„Z G d„ d«      Zy)a�  Multicast DNS Service Discovery for Python, v0.14-wmcbrine
    )
Copyright 2003 Paul Scott-Murphy, 2014 William McBrine

This module provides a framework for the use of DNS Service Discovery
using IP multicast.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
é    )ÚannotationsN)ÚAnyú.é   )Úmaxsplitc                 óŽ   — t         j                  t        j                  k(  r$t         j	                  t        j
                  «       y y )N)ÚlogÚlevelÚloggingÚNOTSETÚsetLevelÚWARN© ó    úB/home/josh/.local/lib/python3.12/site-packages/zeroconf/_logger.pyÚset_logger_level_if_unsetr   "   s'   € Ü
‡y�y”G—N‘NÒ"Ü�‰”W—\‘\Õ"ð #r   i   údict[str, None]Ú
_seen_logsc                óx   — 	 | j                  t        t        | «      «      d«       y# t        t        f$ r Y yw xY w)u¥  Pop the oldest entry from ``seen``; return False if it raced.

    Individual dict ops (``pop`` with a default, ``next``) are atomic
    on the free-threaded build, but the compound ``iter`` â†’ ``next``
    used to pick the FIFO victim can raise ``RuntimeError`` if
    another thread mutates the dict between the two ops. The caller
    breaks its drain loop on False so concurrent mutation can't make
    it spin.
    NFT)ÚpopÚnextÚiterÚRuntimeErrorÚStopIteration)Úseens    r   Ú_evict_oldestr   .   s<   € ðØ�‰””d˜4“jÓ! 4Ô(ð øô œ-Ð(ò Ùðús   ‚$' §9¸9c                ó    — || v}t        | «      t        |z
  kD  r-t        | «      r"	 t        | «      t        |z
  kD  rt        | «      rŒ"|rd| |<   |S )aa  Record ``key`` in ``seen`` and return True if it was newly added.

    Bounds the dict so callers passing attacker-influenced keys (peer
    addresses, packet offsets) cannot grow it without bound. Evicts
    the oldest entries on overflow (dict preserves insertion order on
    Python 3.7+), so ``_MAX_SEEN_LOGS`` is a recency window.

    The dict is shared across all ``Zeroconf`` instances in the
    process; on the free-threaded build (3.14t) and under multi-
    instance sync use, callers can race the ``len < cap`` check and
    both insert, leaving the dict transiently above the cap. The
    drain loop runs on every call (steady-state-at-cap hits are a
    single ``len`` + compare past the membership check because the
    helper short-circuits) so a contention burst is corrected by the
    next caller regardless of whether it's a hit or a miss.
    N)ÚlenÚ_MAX_SEEN_LOGSr   )r   ÚkeyÚ	insertings      r   Ú
_mark_seenr"   ?   sV   € ð" ˜4�€Iô ˆd‹)”n yÑ0Ò
0´]À4Ô5HØô ˆd‹)”n yÑ0Ò
0´]À4Õ5HáØˆˆS‰	ØÐr   c                  óT   — e Zd Zedd„«       Zedd„«       Zedd„«       Zedd„«       Zy)	ÚQuietLoggerc                ó¾   — t        t        t        t        j                  «       d   «      «      }|rt
        j                  nt
        j                  } ||xs dgddiŽ y )Nr   úException occurredÚexc_infoT)r"   r   ÚstrÚsysr'   r	   ÚwarningÚdebug)ÚclsÚlogger_dataÚ
first_timeÚloggers       r   Úlog_exception_warningz!QuietLogger.log_exception_warning\   sE   € ä¤
¬C´·±³¸qÑ0AÓ,BÓCˆ
Ù *”—’´·	±	ˆÙ�Ò6Ð!5Ð 6ÐGÀ$ÓGr   c                ó”   — t        t        t        t        j                  «       d   «      «      }t        j                  |xs dgd|iŽ y )Nr   r&   r'   )r"   r   r(   r)   r'   r	   r+   )r,   r-   r.   s      r   Úlog_exception_debugzQuietLogger.log_exception_debugb   s8   € ä¤
¬C´·±³¸qÑ0AÓ,BÓCˆ
Ü�	‰	�KÒ9Ð$8Ð#9ÐPÀZÓPr   c                ót   — t        t        |d   «      rt        j                  nt        j                  } ||Ž  y )Nr   ©r"   r   r	   r*   r+   )r,   Úargsr/   s      r   Úlog_warning_oncezQuietLogger.log_warning_onceg   s%   € ä *¬:°t¸A±wÔ ?”—’ÄSÇYÁYˆÙ�Šr   c                óz   — t        t        |d   «      rt        j                  nt        j                  } ||d|iŽ y )Nr   r'   r4   )r,   Úexcr5   r/   s       r   Úlog_exception_oncezQuietLogger.log_exception_oncel   s+   € ä *¬:°t¸A±wÔ ?”—’ÄSÇYÁYˆÙ�Ð#˜sÓ#r   N)r-   r   ÚreturnÚNone)r5   r   r:   r;   )r8   Ú	Exceptionr5   r   r:   r;   )Ú__name__Ú
__module__Ú__qualname__Úclassmethodr0   r2   r6   r9   r   r   r   r$   r$   [   sT   „ ØòHó ðHð
 òQó ðQð òó ðð ò$ó ñ$r   r$   )r:   r;   )r   r   r:   Úbool)r   r   r    r(   r:   rA   )Ú__doc__Ú
__future__r   r   r)   Útypingr   Ú	getLoggerr=   Úsplitr	   Ú
addHandlerÚNullHandlerr   r   r   Ú__annotations__r   r"   r$   r   r   r   ú<module>rJ      s†   ðòõ. #ã Û 
Ý à€g×Ñ˜Ÿ™ s°Q˜Ó7¸Ñ:Ó;€Ø ‡�Ð"ˆw×"Ñ"Ó$Ô %ó#ñ
 Ô ð €Ø €
ˆOÓ  óó"÷8$ò $r   