
    PTh                     d    d dl mZ ddlmZmZ dZdedee   dedefd	Z	de
fd
Z G d de      Zy)    )Optional   )FEATURES
conv_space))     @@r   nsr   )r   r   u   µsr   )r   r   msr   )      N@      ?s   valprecspacereturnc                    | dz  } t         D ]]  \  }}}}t        | |      }||k\  r| |z  } |t        | |      }n|dz  dk(  rd}n|dz  dz  dk(  rd}nd}dj                  ||||      c S  t        | d      } | d	z  }|d	k  rK| d	z  }|n
|dz  dk(  rd}|dk(  rd
j                  |dz  |      S dj                  |dz  t        |d            S dj                  |d	z  dz  |d	z  dz  | d	z  dz        S )Ng    eAr           r   g      $@r   r   z{:.{}f}{}{}r
   z{:.0f}:{:02.0f}z{:.0f}:{:04.1f}z{:.0f}:{:02.0f}:{:02.0f})SPECroundformat)	r   r   r   sizediv_nextscaledecrms	            ^/home/www/backend.miabetepe.com/venv/lib/python3.12/site-packages/about_time/human_duration.py__human_durationr      s=   3JC&* ;"hs#sO98OCc4 AVr\D#g^r!DD##AtUE::;  Q-Cc	A3w#IVr\D19$++AGQ77 ''Rq!==%,,QW]AGrM3QT9XZ?[[    c                 D     dt         t           f fd}t                |S )Nr   c                     t        | |      S N)r   )r   r   r   s     r   runzfn_human_duration.<locals>.run2   s    T511r   )r   intr   )r   r#   s   ` r   fn_human_durationr%   1   s$    2x} 2 uEJr   c                   L    e Zd Zd Zed        Zd
dee   defdZ	d Z
d Zd	 Zy)HumanDurationc                      |dk\  sJ || _         y )Nr   _value)selfvalues     r   __init__zHumanDuration.__init__:   s    {{r   c                     | j                   S r"   r)   r+   s    r   r,   zHumanDuration.value>   s    {{r   Nr   r   c                 V     t        t        j                        | j                  |      S )zReturn a beautiful representation of this duration.
        It dynamically calculates the best scale to use.

        Args:
            prec: an optional custom precision

        Returns:
            the human friendly representation.

        )r%   r   feature_spacer*   )r+   r   s     r   as_humanzHumanDuration.as_humanB   s#     9 !7!78dKKr   c                 "    | j                         S r"   )r2   r/   s    r   __str__zHumanDuration.__str__O   s    }}r   c                 :    dj                  | j                  |       S )Nz!HumanDuration{{ value={} }} -> {})r   r*   r/   s    r   __repr__zHumanDuration.__repr__R   s    299$++tLLr   c                 (    | j                         |k(  S r"   )r4   )r+   others     r   __eq__zHumanDuration.__eq__U   s    ||~&&r   r"   )__name__
__module____qualname__r-   propertyr,   r   r$   strr2   r4   r6   r9    r   r   r'   r'   9   sE      LXc] Lc LM'r   r'   N)typingr   featuresr   r   r   floatr$   r>   r   boolr%   objectr'   r?   r   r   <module>rE      sU     *\% \x} \S \S \DT 'F 'r   