
    x7#h*&                     ^    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  G d de      Zy)	    )date)Optional)_ChineseLunisolarCHINESE_CALENDAR)APRDEC)EasternCalendarHolidaysc            
          e Zd ZdZddefddZed        Zed        Zed        Z	ed	        Z
ed
        Zed        Zed        Z	 d dedeee   ef   dedee   fdZdee   fdZdee   fdZdee   fdZdee   fdZdee   fdZdee   fdZdee   fdZdee   fdZdefdZdee   fdZdee   fdZdee   fdZ dee   fdZ!dee   fdZ"y)!ChineseCalendarHolidaysz.
    Chinese lunisolar calendar holidays.
    NFreturnc                 J    |r	 ||      nt        |      | _        || _        y )N)calendar)r   _chinese_calendar _chinese_calendar_show_estimated)selfclsshow_estimatedr   s       W/var/www/api/v1/venv_getwork_v1/lib/python3.12/site-packages/holidays/groups/chinese.py__init__z ChineseCalendarHolidays.__init__   s&    &)C"/@(/S 	 1?-    c                 R    | j                   j                  | j                        d   S )z/
        Return Chinese New Year date.
        r   )r   lunar_new_year_date_yearr   s    r   _chinese_new_yearz)ChineseCalendarHolidays._chinese_new_year    s$    
 %%99$**EaHHr   c                     d}| j                   dz  dk  s!| j                   dz  dk  r| j                   dk\  rd}t        | j                   t        |      S )zT
        Return Qingming Festival (15th day after the Spring Equinox) date.
                    i  )r   r   r   r   days     r   _qingming_festivalz*ChineseCalendarHolidays._qingming_festival'   sK    
 JJNQDJJNQ$64::;MCDJJS))r   c                 R    | j                   j                  | j                        d   S )zT
        Return Mid Autumn Festival (15th day of the 8th lunar month) date.
        r   )r   mid_autumn_dater   r   s    r   _mid_autumn_festivalz,ChineseCalendarHolidays._mid_autumn_festival1   s$    
 %%55djjA!DDr   c                 R    | j                   j                  | j                        d   S )zw
        Return Add Birthday of the Buddha by Chinese lunar calendar (8th day of the
        4th lunar month).
        r   )r   buddha_birthday_dater   r   s    r   _chinese_birthday_of_buddhaz3ChineseCalendarHolidays._chinese_birthday_of_buddha8   s$     %%::4::FqIIr   c                 R    | j                   j                  | j                        d   S )zP
        Return Dragon Boat Festival (5th day of 5th lunar month) date.
        r   )r   dragon_boat_dater   r   s    r   _dragon_boat_festivalz-ChineseCalendarHolidays._dragon_boat_festival@   s$    
 %%66tzzB1EEr   c                 R    | j                   j                  | j                        d   S )zQ
        Return Double Ninth Festival (9th day of 9th lunar month) date.
        r   )r   double_ninth_dater   r   s    r   _double_ninth_festivalz.ChineseCalendarHolidays._double_ninth_festivalG   s$    
 %%77

CAFFr   c                 J   | j                   dz  dk(  r| j                   dk\  sc| j                   dz  dk(  r| j                   dk\  sB| j                   dz  dk(  r| j                   dk\  s!| j                   dz  dk(  r| j                   d	k\  rd
}nd}t        | j                   t        |      S )z
        Return Dongzhi Festival (Chinese Winter Solstice) date.

        This approximation is reliable for 1952-2099 years.
        r   r   i  r   i  r    i
     i+        )r   r   r   r!   s     r   _dongzhi_festivalz)ChineseCalendarHolidays._dongzhi_festivalN   s     ZZ!^q TZZ4%7

Q!#

d(:

Q!#

d(:

Q!#

d(:CCDJJS))r   namedt_estimated
days_deltac                 >    | j                  ||| j                  |      S )z
        Add Chinese calendar holiday.

        Adds customizable estimation label to holiday name if holiday date
        is an estimation.
        )_add_eastern_calendar_holidayr   )r   r5   r6   r7   s       r   _add_chinese_calendar_holidayz5ChineseCalendarHolidays._add_chinese_calendar_holidaya   s&     11, E Ez
 	
r   c                 l    | j                  || j                  j                  | j                              S )at  
        Add Birthday of the Buddha by Chinese lunar calendar (8th day of the
        4th lunar month).

        Birthday of the Buddha is a Buddhist festival that is celebrated in
        most of East Asia and South Asia commemorating the birth of Gautama
        Buddha, who was the founder of Buddhism.
        https://en.wikipedia.org/wiki/Buddha%27s_Birthday
        )r:   r   r(   r   r   r5   s     r   _add_chinese_birthday_of_buddhaz7ChineseCalendarHolidays._add_chinese_birthday_of_buddhan   s1     11$((==djjI
 	
r   c                 p    | j                  || j                  j                  | j                        d      S )z
        Add Chinese New Year's Eve (last day of 12th lunar month).

        Chinese New Year's Eve is the day before the Chinese New Year.
        https://en.wikipedia.org/wiki/Chinese_New_Year%27s_Eve
        r7   r:   r   r   r   r<   s     r   _add_chinese_new_years_evez2ChineseCalendarHolidays._add_chinese_new_years_eve|   s9     11$((<<TZZHUW 2 
 	
r   c                 l    | j                  || j                  j                  | j                              S )a   
        Add Chinese New Year's Day (first day of the first lunar month).

        Chinese New Year is the festival that celebrates the beginning of
        a new year on the traditional lunisolar and solar Chinese calendar.
        https://en.wikipedia.org/wiki/Chinese_New_Year
        rA   r<   s     r   _add_chinese_new_years_dayz2ChineseCalendarHolidays._add_chinese_new_years_day   s1     11$((<<TZZH
 	
r   c                 p    | j                  || j                  j                  | j                        d      S )zi
        Add Chinese New Year's Day Two.

        https://en.wikipedia.org/wiki/Chinese_New_Year
        r   r@   rA   r<   s     r   _add_chinese_new_years_day_twoz6ChineseCalendarHolidays._add_chinese_new_years_day_two   9     11$((<<TZZHUW 2 
 	
r   c                 p    | j                  || j                  j                  | j                        d      S )zk
        Add Chinese New Year's Day Three.

        https://en.wikipedia.org/wiki/Chinese_New_Year
        r    r@   rA   r<   s     r    _add_chinese_new_years_day_threez8ChineseCalendarHolidays._add_chinese_new_years_day_three   rG   r   c                 p    | j                  || j                  j                  | j                        d      S )zj
        Add Chinese New Year's Day Four.

        https://en.wikipedia.org/wiki/Chinese_New_Year
        r1   r@   rA   r<   s     r   _add_chinese_new_years_day_fourz7ChineseCalendarHolidays._add_chinese_new_years_day_four   rG   r   c                 p    | j                  || j                  j                  | j                        d      S )zj
        Add Chinese New Year's Day Five.

        https://en.wikipedia.org/wiki/Chinese_New_Year
        r   r@   rA   r<   s     r   _add_chinese_new_years_day_fivez7ChineseCalendarHolidays._add_chinese_new_years_day_five   rG   r   c                 :    | j                  || j                        S )aH  
        Add Dongzhi Festival (Chinese Winter Solstice).

        The Dongzhi Festival or Winter Solstice Festival is a traditional
        Chinese festival celebrated during the Dongzhi solar term
        (winter solstice), which falls between December 21 and 23.
        https://en.wikipedia.org/wiki/Dongzhi_Festival
        )_add_holidayr4   r<   s     r   _add_dongzhi_festivalz-ChineseCalendarHolidays._add_dongzhi_festival   s       t'='=>>r   c                 :    | j                  || j                        S )a  
        Add Qingming Festival (15th day after the Spring Equinox).

        The Qingming festival or Ching Ming Festival, also known as
        Tomb-Sweeping Day in English, is a traditional Chinese festival.
        https://en.wikipedia.org/wiki/Qingming_Festival
        )rO   r#   r<   s     r   _add_qingming_festivalz.ChineseCalendarHolidays._add_qingming_festival   s       t'>'>??r   c                 l    | j                  || j                  j                  | j                              S )a  
        Add Double Ninth Festival (9th day of 9th lunar month).

        The Double Ninth Festival (Chongyang Festival in Mainland China
        and Taiwan or Chung Yeung Festival in Hong Kong and Macau).
        https://en.wikipedia.org/wiki/Double_Ninth_Festival
        )r:   r   r.   r   r<   s     r   _add_double_ninth_festivalz2ChineseCalendarHolidays._add_double_ninth_festival   s1     11$((::4::F
 	
r   c                 l    | j                  || j                  j                  | j                              S )a  
        Add Dragon Boat Festival (5th day of 5th lunar month).

        The Dragon Boat Festival is a traditional Chinese holiday which occurs
        on the fifth day of the fifth month of the Chinese calendar.
        https://en.wikipedia.org/wiki/Dragon_Boat_Festival
        )r:   r   r+   r   r<   s     r   _add_dragon_boat_festivalz1ChineseCalendarHolidays._add_dragon_boat_festival   s1     11$((99$**E
 	
r   c                 l    | j                  || j                  j                  | j                              S )u  
        Add Hùng Kings' Temple Festival (10th day of the 3rd lunar month).

        Vietnamese festival held annually from the 8th to the 11th day of the
        3rd lunar month in honour of the Hùng Kings.
        https://en.wikipedia.org/wiki/H%C3%B9ng_Kings%27_Festival
        )r:   r   hung_kings_dater   r<   s     r   _add_hung_kings_dayz+ChineseCalendarHolidays._add_hung_kings_day   1     11$((88D
 	
r   c                 l    | j                  || j                  j                  | j                              S )z
        Add Mid Autumn Festival (15th day of the 8th lunar month).

        The Mid-Autumn Festival, also known as the Moon Festival or
        Mooncake Festival.
        https://en.wikipedia.org/wiki/Mid-Autumn_Festival
        r:   r   r%   r   r<   s     r   _add_mid_autumn_festivalz0ChineseCalendarHolidays._add_mid_autumn_festival   rZ   r   c                 p    | j                  || j                  j                  | j                        d      S )z
        Add Mid Autumn Festival Day Two (16th day of the 8th lunar month).

        The Mid-Autumn Festival, also known as the Moon Festival or
        Mooncake Festival.
        https://en.wikipedia.org/wiki/Mid-Autumn_Festival
        r   r@   r\   r<   s     r    _add_mid_autumn_festival_day_twoz8ChineseCalendarHolidays._add_mid_autumn_festival_day_two   s9     11$((88DQS 2 
 	
r   )r   N)r   )#__name__
__module____qualname____doc__r   r   propertyr   r#   r&   r)   r,   r/   r4   strtupler   r   boolintr:   r=   rB   rD   rF   rI   rK   rM   rP   rR   rT   rV   rY   r]   r_    r   r   r   r      s     @P ? I I * * E E J J F F G G * *& WX

',Xd^T-A'B
PS
	$

x~ 
	
(4. 	


(4. 


htn 

 

x~ 

x~ 
	?Xd^ 	?@d @

(4. 



$ 



8D> 



 



 

r   r   N)datetimer   typingr   holidays.calendars.chineser   r   holidays.calendars.gregorianr   r   holidays.groups.easternr	   r   ri   r   r   <module>ro      s%      J 1 ;u
5 u
r   