+
    ¾¾jq  ã                   ó¢   € R t ^ RIt^ RIHt ^ RIHtHt ^ RIHt ^ RI	H
t
Ht ^ RIHt ^RIHt ]P                   ! R4      t ! R	 R
]4      tR
.tR# )z(DURATION property type from :rfc:`5545`.N©Ú	timedelta)ÚAnyÚClassVar)ÚSelf)ÚInvalidCalendarÚJCalParsingError)Ú
Parameters)ÚTimeBasezG([-+]?)P(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?\Zc                   óî   a € ] tR t^t o RtRtRV 3R lR lltR t]R 4       t	]
V 3R lR	 l4       t]V 3R
 lR l4       t^ RIHt V 3R lR lt]V 3R lR l4       t]V 3R lR l4       tV 3R ltRtV tR# )Ú	vDurationaë  Duration

Value Name:
    DURATION

Purpose:
    This value type is used to identify properties that contain
    a duration of time.

Format Definition:
    This value type is defined by the following notation:

    .. code-block:: text

        dur-value  = (["+"] / "-") "P" (dur-date / dur-time / dur-week)

        dur-date   = dur-day [dur-time]
        dur-time   = "T" (dur-hour / dur-minute / dur-second)
        dur-week   = 1*DIGIT "W"
        dur-hour   = 1*DIGIT "H" [dur-minute]
        dur-minute = 1*DIGIT "M" [dur-second]
        dur-second = 1*DIGIT "S"
        dur-day    = 1*DIGIT "D"

Description:
    If the property permits, multiple "duration" values are
    specified by a COMMA-separated list of values.  The format is
    based on the [ISO.8601.2004] complete representation basic format
    with designators for the duration of time.  The format can
    represent nominal durations (weeks and days) and accurate
    durations (hours, minutes, and seconds).  Note that unlike
    [ISO.8601.2004], this value type doesn't support the "Y" and "M"
    designators to specify durations in terms of years and months.
    The duration of a week or a day depends on its position in the
    calendar.  In the case of discontinuities in the time scale, such
    as the change from standard time to daylight time and back, the
    computation of the exact duration requires the subtraction or
    addition of the change of duration of the discontinuity.  Leap
    seconds MUST NOT be considered when computing an exact duration.
    When computing an exact duration, the greatest order time
    components MUST be added first, that is, the number of days MUST
    be added first, followed by the number of hours, number of
    minutes, and number of seconds.

Example:
    A duration of 15 days, 5 hours, and 20 seconds would be:

    .. code-block:: ics

        P15DT5H0M20S

    A duration of 7 weeks would be:

    .. code-block:: ics

        P7W

    .. code-block:: pycon

        >>> from icalendar.prop import vDuration
        >>> duration = vDuration.from_ical('P15DT5H0M20S')
        >>> duration
        datetime.timedelta(days=15, seconds=18020)
        >>> duration = vDuration.from_ical('P7W')
        >>> duration
        datetime.timedelta(days=49)
ÚDURATIONNc                ó^   <€ V ^8„  d   QhRS[ S[S[3,          R,          RS[S[,          RR/# )é   ÚparamsNÚtdÚreturn)ÚdictÚstrr   r   )ÚformatÚ__classdict__s   "€ÚY/home/ralf/ical-fahrzeuge/venv/lib/python3.14/site-packages/icalendar/prop/dt/duration.pyÚ__annotate__ÚvDuration.__annotate__Z   s6   ø€ ÷ )ñ )Ù.2±3¹°8­n¸tÕ.Cð)Ù™c•/ð)à	ñ)ó    c               óÊ   € \        V\        4      '       d   \        P                  V4      p\        V\        4      '       g   \        R 4      hWn        \        V4      V n        R# )z"Value MUST be a timedelta instanceN)	Ú
isinstancer   r   Ú	from_icalr   Ú	TypeErrorr   r	   r   )Úselfr   r   s   ""&r   Ú__init__ÚvDuration.__init__Z   sK   € ô �bœ#×ÒÜ×$Ñ$ RÓ(ˆBÜ˜"œi×(Ò(ÜÐ@ÓAÐAØŒÜ  Ó(ˆŽr   c                ó,  € R pV P                   pVP                  ^ 8  d   RpV) pR pVP                  '       dŒ   RpVP                  R,          pVP                  R,          ^<,          pVP                  ^<,          pV'       d   W4 R2,          pV'       g   V'       d   V'       d   W5 R2,          pV'       d   W6 R2,          pVP                  ^ 8X  dI   V'       dA   \        V4      P	                  R4      R,           \        V4      P	                  R4      ,           # \        V4      P	                  R4      R,           \        \        VP                  4      4      P	                  R4      ,           R	,           \        V4      P	                  R4      ,           # )
Ú Ú-ÚTi  ÚHÚMÚSzutf-8ó   Pó   D)r   ÚdaysÚsecondsr   ÚencodeÚabs)r   Úsignr   ÚtimepartÚhoursÚminutesr,   s   &      r   Úto_icalÚvDuration.to_icald   s<  € ØˆØ�W‰WˆØ�7‰7�QŒ;ØˆDØ�ˆBØˆØ�:�:ˆ:ØˆHØ—J‘J $Õ&ˆEØ—j‘j 4Õ'¨2Õ-ˆGØ—j‘j 2•oˆGßØ˜g Q˜KÕ'�ßŸ5§WØ˜i q˜MÕ)�ßØ˜i q˜MÕ)�Ø�7‰7�aŒ<ŸHÜ�t“9×#Ñ# GÓ,¨tÕ3´c¸(³m×6JÑ6JÈ7Ó6SÕSÐSä�‹I×Ñ˜WÓ%Øõä”#�b—g‘g“,Ó×&Ñ& wÓ/õ0ð õô �(‹m×"Ñ" 7Ó+õ	,ð	
r   c           
     ó¼  € \         P                  V 4      pV'       g   \        R V  24      hVP                  4       w  r#rErg \	        \        T;'       g    ^ 4      \        T;'       g    ^ 4      \        T;'       g    ^ 4      \        T;'       g    ^ 4      \        T;'       g    ^ 4      R7      pTR8X  d   T) pT#   \         d   p	\        RT  24      T	hRp	?	ii ; i)zInvalid iCalendar duration: )Úweeksr+   r1   r2   r,   z Impractical iCalendar duration: Nr$   )ÚDURATION_REGEXÚmatchr   Úgroupsr   ÚintÚOverflowError)
Úicalr8   r/   r6   r+   r1   r2   r,   ÚvalueÚes
   &         r   r   ÚvDuration.from_ical€   sÎ   € ä×$Ñ$ TÓ*ˆßÜ!Ð$@ÀÀÐ"GÓHÐHà5:·\±\³^Ñ2ˆ�T 'ð	TÜÜ˜%Ÿ*˜* 1“oÜ˜Ÿ˜ “^Ü˜%Ÿ*˜* 1“oÜ˜GŸL˜L qÓ)Ü˜GŸL˜L qÓ)ôˆEð �3Œ;Ø�FˆEàˆøô ô 	Tô "Ð$DÀTÀFÐ"KÓLÐRSÐSûð		Tús0   Á&B< Á(B< Á<B< ÂB< Â$B< Â<CÃCÃCc                ó    <€ V ^8„  d   QhRS[ /# ©r   r   r   )r   r   s   "€r   r   r   ›   s   ø€ ÷ ñ ‘Iñ r   c                ó   € V P                   # )z!The time delta for compatibility.)r   )r   s   &r   ÚdtÚvDuration.dtš   s   € ð �w‰wˆr   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# rA   ©Úlistr   )r   r   s   "€r   r   r       s   ø€ ÷ 'ñ '™™d�ñ 'r   c                ó(   € V ! \        ^^c4      4      .# )zExamples of vDuration.r   )Úclss   &r   ÚexamplesÚvDuration.examplesŸ   s   € ñ ”I˜a Ó$Ó%Ð&Ð&r   )ÚVALUEc                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   Únamer   )r   rG   )r   r   s   "€r   r   r   ¦   s   ø€ ÷ 
ñ 
™Cð 
¡Dñ 
r   c                ó¦   € VV P                   P                  4       V P                  P                  4       V P	                  4       P                  4       .# )zBThe jCal representation of this property according to :rfc:`7265`.)r   Úto_jcalrL   Úlowerr3   Údecode)r   rN   s   &&r   rP   ÚvDuration.to_jcal¦   sC   € ð Ø�K‰K×ÑÓ!Ø�J‰J×ÑÓØ�L‰L‹N×!Ñ!Ó#ð	
ð 	
r   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   Újcalr   )r   r   )r   r   s   "€r   r   r   °   s   ø€ ÷ 	Uñ 	U¡Cð 	U©Iñ 	Ur   c                ó¬   € \         P                  ! V\        V 4        V P                  V4      #   \        \
        3 d   p\        RYR7      ThRp?ii ; i)zyParse a jCal string to a :class:`datetime.timedelta`.

Raises:
    ~error.JCalParsingError: If it can't parse a duration.zCannot parse duration.)r=   N)r   Úvalidate_value_typer   r   Ú
ValueErrorr   )rI   rU   r>   s   && r   Úparse_jcal_valueÚvDuration.parse_jcal_value¯   sS   € ô 	×,Ò,¨T´3¸Ô<ð	UØ—=‘= Ó&Ð&øÜœOÐ,ô 	UÜ"Ð#;¸SÔMÐSTÐTûð	Uús   ž/ ¯AÁ AÁAc                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   Újcal_propertyr   rF   )r   r   s   "€r   r   r   ¼   s   ø€ ÷ 
ñ 
¡dð 
©tñ 
r   c                ó  € \         P                  ! W4       \         P                  ! ^4      ;_uu_ 4        V P                  V^,          4      pRRR4       V ! X\        P
                  ! V4      4      #   + '       g   i     L-; i)z Parse jCal from :rfc:`7265`.

Parameters:
    jcal_property: The jCal property to parse.

Raises:
    ~error.JCalParsingError: If the provided jCal is invalid.
N)r   Úvalidate_propertyÚreraise_with_path_addedrY   r	   Úfrom_jcal_property)rI   r\   Údurations   && r   Ú	from_jcalÚvDuration.from_jcal»   sd   € ô 	×*Ò*¨=Ô>Ü×5Ò5°a×8Õ8Ø×+Ñ+¨M¸!Õ,<Ó=ˆH÷ 9áØÜ×)Ò)¨-Ó8ó
ð 	
÷ 9×8ús   µA3Á3B	c                óB   <€ V ^8„  d   Qh/ S[ S[,          ;R&   S[;R&   # )r   Údefault_valuer   )r   r   r	   )r   r   s   "€r   r   r      s'   ø‡ ‚ ñJ ™C•=Ñ-ñK ñL ÑòM r   )r   r   )N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__re   r    r3   Ústaticmethodr   ÚpropertyrC   ÚclassmethodrJ   Úicalendar.paramrL   rP   rY   rb   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      sŸ   ø‡ € ñBðH $.€M÷)ò )ò
ð8 ñó ðð2 ÷ó ðð ÷'ó ð'õ &÷
ð 
ð ÷	Uó ð	Uð ÷
ó ð
÷U ƒ r   r   )rj   ÚreÚdatetimer   Útypingr   r   Úicalendar.compatibilityr   Úicalendar.errorr   r   Úicalendar.parserr	   Úbaser
   Úcompiler7   r   Ú__all__© r   r   Ú<module>r|      sF   ðÙ .ã 	Ý ß  å (ß =Ý 'å à—’ØNó€ô
y
�ô y
ðx ˆ-‚r   