
    \h9G                     D   S SK Jr  S SKJr  S SKJr  S SKJrJrJ	r	J
r
JrJrJrJrJrJrJrJrJrJrJrJr  S SKJrJrJrJrJr  S SKJrJrJ r   S SK!J"r"J#r#J$r$J%r%J&r&  \#" \S\S	\S	\S\S	\S	\S
05      r' " S S\"\\\ 5      r( " S S\(5      r) " S S\(5      r* " S S5      r+g)    )date)gettext)Optional)JANFEBMARAPRMAYJUNSEPOCTDECMONTUEWEDTHUFRISATSUN)
GOVERNMENTOPTIONALPUBLICSCHOOLWORKDAY)ChineseCalendarHolidaysInternationalHolidaysStaticHolidays)ObservedHolidayBaseObservedRuleSAT_TO_PREV_WORKDAYSUN_TO_NEXT_WORKDAYSAT_SUN_TO_NEXT_WORKDAY   c            	          ^  \ rS rSrSrSr\" S5      rSr\	\
\\\4rSrSrU 4S jr SS
\\   S\\   S\SS	4S jjrS rS rS rS rS rSrU =r$ )Taiwan0   u4
  Taiwan holidays.

References:
    * <https://zh.wikipedia.org/wiki/中華民國節日與歲時列表>
    * <https://en.wikipedia.org/wiki/Public_holidays_in_Taiwan>

Commemorative Day and Day Implementation Method Amendments:
    * [Ministry of Interior (87) Order No. 8706459](https://web.archive.org/web/20250501035936/https://zh.wikisource.org/wiki/紀念日及節日實施辦法_(民國87年))
    * [Ministry of Interior (88) Order No. 8897074](https://web.archive.org/web/20250429134107/https://zh.wikisource.org/wiki/紀念日及節日實施辦法_(民國88年))
    * [Ministry of Interior (89) Order No. 8972185](https://web.archive.org/web/20250429134119/https://zh.wikisource.org/wiki/紀念日及節日實施辦法_(民國89年2月))
    * [Ministry of Interior (89) Order No. 8962562](https://web.archive.org/web/20250429134023/https://zh.wikisource.org/wiki/紀念日及節日實施辦法_(民國89年12月))
    * [Ministry of Interior Order No. 0950045320](https://web.archive.org/web/20240916001724/https://law.moj.gov.tw/LawClass/LawOldVer.aspx?pcode=D0020033&lnndate=20060309&lser=001)
    * [Ministry of Interior Order No. 0960110433](https://web.archive.org/web/20240915222212/https://law.moj.gov.tw/LawClass/LawOldVer.aspx?pcode=D0020033&lnndate=20070711&lser=001)
    * [Ministry of Interior Order No. 0960131407](https://web.archive.org/web/20240915222212/https://law.moj.gov.tw/LawClass/LawOldVer.aspx?pcode=D0020033&lnndate=20070711&lser=001)
    * [Ministry of Interior Order No. 0960155673](https://web.archive.org/web/20240916000901/https://law.moj.gov.tw/LawClass/LawOldVer.aspx?pcode=D0020033&lnndate=20071003&lser=001)
    * [Ministry of Interior Order No. 0990212117](https://web.archive.org/web/20240916004712/https://law.moj.gov.tw/LawClass/LawOldVer.aspx?pcode=D0020033&lnndate=20101102&lser=001)
    * [Ministry of Interior Order No. 1010307327 and 1030128812](https://web.archive.org/web/20240919205138/https://law.moj.gov.tw/LawClass/LawOldVer.aspx?pcode=D0020033&lnndate=20120925&lser=001)
    * [Ministry of Interior Order No. 1030182404](https://web.archive.org/web/20250227171607/https://law.moj.gov.tw/LawClass/LawAll.aspx?pcode=D0020033)
    * [Decree No. 11400053171](https://web.archive.org/web/20250602210918/https://law.moj.gov.tw/News/newsdetail.aspx?msgid=191745)

Checked With:
    * [DGPA Work Calendar (1998-2025; Chinese)](https://web.archive.org/web/20250307201828/https://www.dgpa.gov.tw/informationlist?uid=30)
    * [DGPA Work Calendar (2001-2025; English)](https://web.archive.org/web/20240606012108/http://www.dgpa.gov.tw/en/informationlist?uid=353)
TWu   %s（慶祝）zh_TW)en_USthzh_CNr*     c                    > [         R                  " U 5        [        R                  " U 5        [        R                  " U [        5        UR                  S[        [        -   5        [        TU ]  " U0 UD6  g )Nobserved_rule)	r   __init__r   r   TaiwanStaticHolidays
setdefaultr    r!   super)selfargskwargs	__class__s      lC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\holidays/countries/taiwan.pyr1   Taiwan.__init__S   sY    ((.&&t,&:;/+>AT+TU$)&)    Ndtsrulesincereturnc           	          U R                   U:  a  gU R                  S5      n[        U5       HJ  nU R                  U5      nU H0  nU R	                  UUXt:X  a  [        U5      S:  a  [        OU5        M2     ML     g)u2  
Taiwan's General Observance Rule first started in 2015 as per
decreed in 內政部台內民字第1030182404號令.

Children's Day Special Observance Rule first started in 2012 as per
decreed in 內政部台內民字第1010307327號令 - as this doesn't affect 2011 ones,
as such the logic is simplified.
N	   兒童節r#   )_yeartrsortedget_list_add_observedlenCHILDRENS_DAY_RULE)r5   r<   r=   r>   childrens_daydtnamesnames           r9   _populate_observedTaiwan._populate_observedZ   st     :: ,+BMM"%E""*.*?CJQRN&X\	  r;   c                    [        5       n[        5       n[        S5      nUR                  U R                  U5      5        U R                  S:  a  U R                  U R                  US9  [        S5      nU R                  S:  a   UR                  U R                  U5      5        UR                  U R                  U5      5        [        S5      nUR                  U R                  U5      5        UR                  U R                  U5      5        UR                  U R                  U5      5        UR                  U R                  [        S5      5      5        U R                  S:  a)  UR                  U R                  [        S	5      5      5        UR                  U R                  [        S
5      5      5        U R                  S:  a  U R                  [        S5      5        UR                  U R!                  [        S5      5      5        UR                  U R#                  [        S5      5      5        U R                  S:  a  U R%                  [        S5      5        UR                  U R'                  [        S5      5      5        U R                  S:  a4  U R)                  [        S5      5        U R+                  [        S5      5        U R,                  (       a'  U R/                  U5        U R/                  U[0        SS9  g g )N   中華民國開國紀念日  )rL   u   農曆除夕i     春節u   和平紀念日i  rA      民族掃墓節	   勞動節	   端午節u	   中秋節     孔子誕辰紀念日u	   國慶日u-   臺灣光復暨金門古寧頭大捷紀念日   行憲紀念日i  )r=   r>   )setrC   add_add_new_years_dayrB   rF   _next_year_new_years_day%_add_chinese_day_before_new_years_eve_add_chinese_new_years_eve_add_chinese_new_years_day_add_chinese_new_years_day_two _add_chinese_new_years_day_three_add_holiday_feb_28_add_holiday_apr_4_add_qingming_festival_add_labor_day_add_dragon_boat_festival_add_mid_autumn_festival_add_holiday_sep_28_add_holiday_oct_10_add_holiday_oct_25_add_holiday_dec_25observedrM   r"   )r5   dts_observeddts_observed_forwardrL   s       r9   _populate_public_holidays Taiwan._populate_public_holidayst   sm   u"u /00067::t<<4H .!:: $$T%O%OPT%UV  !@!@!FG (|  !@!@!FG  !D!DT!JK  !F!Ft!LM 	11"5F2GHI::T44R_EF 	44R8I5JKL::;0 	77;HI 	66r+GH::$$R(?%@A 	11"[/BC::$$R(W%XY $$R(9%:;==##L1 ##$8?V^b#c	 r;   c                 ^   U R                   S::  a  U R                  [        S5      5        U R                  [        S5      5        U R	                  [        S5      5        U R                  [        S5      5        U R                  [        S5      5        U R                  [        S5      5        g g )N  rP   rW      臺灣光復節!   先總統　蔣公誕辰紀念日   國父誕辰紀念日rX   )rB   _add_new_years_day_tworC   rh   rj   _add_holiday_oct_31_add_holiday_nov_12rk   r5   s    r9   _populate_school_holidays Taiwan._populate_school_holidays   s    ::''+H(IJ $$R(?%@A $$R(9%:; $$R(K%LM $$R(?%@A $$R(9%:;# r;   c                 z    U R                  5         U R                  S::  a  U R                  [        S5      5        g g )Nrr      革命先烈紀念日)rz   rB   _add_holiday_mar_29rC   ry   s    r9   _populate_government_holidays$Taiwan._populate_government_holidays   s3    &&(::$$R(?%@A r;   c                     U R                   S::  a  U R                  [        S5      5        U R                  [        S5      5        g )NrV   rT   	   軍人節)rB   re   rC   _add_holiday_sep_3ry   s    r9   _populate_optional_holidays"Taiwan._populate_optional_holidays   s4    ::;0 	;0r;   c                    U R                  [        S5      5        U R                  [        S5      5        U R                  [        S5      5        U R                  [        S5      5        U R	                  [        S5      5        U R                  [        S5      5        U R                  S::  a  U R                  [        S5      5        U R                  S	::  a  U R                  [        S
5      5        U R                  S:  a  U R                  [        S5      5        U R                  S:  a  U R                  [        S5      5        U R                  [        S5      5        U R                  S::  a4  U R                  [        S5      5        U R                  [        S5      5        U R	                  [        S5      5        U R                  S::  a  U R                  [        S5      5        U R                  S::  a  U R                  [        S5      5        U R                  S:  a  U R                  [        S5      5        U R                  S:  a5  U R                  [        S5      5        U R!                  [        S5      5        g g )Nu   國父逝世紀念日u	   植樹節u	   青年節u	   教師節u   中華文化復興節	   婦女節  u   先總統蔣公逝世紀念日  rA   rr      佛陀誕辰紀念日  u	   道教節r}     rW   rs   ru   rX     rt   u   反侵略日i  u   解嚴紀念日u   臺灣聯合國日)_add_holiday_mar_12rC   r~   rh   rx   _add_womens_dayrB   rd   rc   _add_chinese_birthday_of_buddhar_   rj   rk   rw   _add_holiday_mar_14_add_holiday_jul_15_add_united_nations_dayry   s    r9   _populate_workday_holidays!Taiwan._populate_workday_holidays   s     $;!<= 	  K1 	  K1 	  K1 	  $;!<= 	R_-::''+K(LM::##B{O4::004K1LM::++B{O< $$R(?%@AzzT!((,C)DE ((,=)>? $$R(?%@AzzT!((,=)>?zzT!((,O)PQ::$$R%78::$$R(9%:; ((,@)AB r;    )NrQ   )__name__
__module____qualname____firstlineno____doc__countryrC   observed_labeldefault_languager   r   r   r   r   supported_categoriessupported_languages
start_yearr1   rY   r   r   r   intrM   ro   rz   r   r   r   __static_attributes____classcell__)r8   s   @r9   r'   r'   0   s    2 G()N&&&'J;J* QUt9$,\$:JM	4<d|<(B1AC ACr;   r'   c                       \ rS rSrSrg)r)   i  r   Nr   r   r   r   r   r   r;   r9   r)   r)         r;   r)   c                       \ rS rSrSrg)TWNi  r   Nr   r   r;   r9   r   r     r   r;   r   c            
       2   \ rS rSrSr\" S5      r\" S5      r\" S5      r\" S5      r	0 S\
S\
S	4_S
\S\S4_S\S\S4_S\S\S4_S\S\S4\
S\
S4\S\S4\S\S44_S\S\S4\S\S4\S\S44_S\S\S4_S \S!\S"4\S!\S4\S#\S44_S$\S%\S4\S\S44_S&\S\S!S'4_S(\S)\S4\S\S"4\S*\S44_S+\S!\S4\S\S4\S\S44_S,\
S\S#4\S#\S44_S-\S	\S4\S.\S4\S/\S44_S0\S\S%4\S1\S4\S\S144_S2\S\S4\S\S/44_S3\S"\S4_\S\S4\S!\S"4\S!\S4\
S\S44\S\S4\S\S44\S	\S4\S!\S	4S5.Er\
S"\	4\
S"\44\
S"\	4\
S"\44\
S\	4\
S\4\S"\" S65      44S7.r\S#\" S85      4\
S\" S95      44\S\" S:5      4\S\" S;5      44\S\" S<5      4\
S\	4S=.rS>rg?)@r2   i!  a  Taiwan special holidays.

DGPA, Executive Yuan Work Calendars:
    * [1998](https://web.archive.org/web/20240119034602/https://www.dgpa.gov.tw/information?pid=4979&uid=30)
    * [1999](https://web.archive.org/web/20240119034606/https://www.dgpa.gov.tw/information?pid=4978&uid=30)
    * [2000](https://web.archive.org/web/20231230164623/https://www.dgpa.gov.tw/information?uid=30&pid=4977)
    * [2001](https://web.archive.org/web/20220809165413/https://www.dgpa.gov.tw/en/information?uid=353&pid=6199)
    * [2002](https://web.archive.org/web/20220809163821/https://www.dgpa.gov.tw/en/information?uid=353&pid=6198)
    * [2003](https://web.archive.org/web/20220809161706/https://www.dgpa.gov.tw/en/information?uid=353&pid=6197)
    * [2004](https://web.archive.org/web/20220809175339/https://www.dgpa.gov.tw/en/information?uid=353&pid=6196)
    * [2005](https://web.archive.org/web/20220809173619/https://www.dgpa.gov.tw/en/information?uid=353&pid=6195)
    * [2006](https://web.archive.org/web/20250427175035/https://www.dgpa.gov.tw/en/information?uid=353&pid=6192)
    * [2007](https://web.archive.org/web/20250427175157/https://www.dgpa.gov.tw/en/information?uid=353&pid=6194)
    * [2008](https://web.archive.org/web/20250427175031/https://www.dgpa.gov.tw/en/information?uid=353&pid=6191)
    * [2009](https://web.archive.org/web/20250427175008/https://www.dgpa.gov.tw/en/information?uid=353&pid=6190)
    * [2010](https://web.archive.org/web/20240913193941/https://www.dgpa.gov.tw/en/information?pid=6189&uid=353)
    * [2011](https://web.archive.org/web/20250427175006/https://www.dgpa.gov.tw/en/information?uid=353&pid=6188)
    * [2012](https://web.archive.org/web/20250427175006/https://www.dgpa.gov.tw/en/information?uid=353&pid=6187)
    * [2013](https://web.archive.org/web/20250427174956/https://www.dgpa.gov.tw/en/information?uid=353&pid=6186)
    * [2014](https://web.archive.org/web/20220809133242/https://www.dgpa.gov.tw/en/information?uid=353&pid=6183)
    * [2015](https://web.archive.org/web/20220809133240/https://www.dgpa.gov.tw/en/information?uid=353&pid=6182)
    * [2016](https://web.archive.org/web/20220809133238/https://www.dgpa.gov.tw/en/information?uid=353&pid=6180)
    * [2017](https://web.archive.org/web/20220809133236/https://www.dgpa.gov.tw/en/information?uid=353&pid=6178)
    * [2018](https://web.archive.org/web/20240518122217/https://www.dgpa.gov.tw/en/information?uid=353&pid=7730)
    * [2019](https://web.archive.org/web/20240422121421/http://www.dgpa.gov.tw/en/information?uid=353&pid=8178)
    * [2020](https://web.archive.org/web/20240914094053/https://www.dgpa.gov.tw/en/information?pid=9724&uid=353)
    * [2021](https://web.archive.org/web/20240615041915/https://www.dgpa.gov.tw/en/information?uid=353&pid=10181)
    * [2022](https://web.archive.org/web/20220809133226/https://www.dgpa.gov.tw/en/information?uid=353&pid=10659)
    * [2023](https://web.archive.org/web/20220809133225/https://www.dgpa.gov.tw/en/information?uid=353&pid=11016)
    * [2024](https://web.archive.org/web/20250414165829/https://www.dgpa.gov.tw/en/information?uid=353&pid=11402)
    * [2025](https://web.archive.org/web/20250121091032/https://www.dgpa.gov.tw/en/information?uid=353&pid=11979)
z%Y-%m-%du   休息日（%s日起取代）r   rA   rr         r         i        r   	      r                  i     
         r      i                rQ   i  i        i  i  i  r#      i     i  i     )i  r   rV   r   )r.     rr   rR   rS   rP   rU   r   )r.   r   rr   r   r   N)r   r   r   r   r   rC   substituted_date_formatsubstituted_label
womens_dayrI   r	   r   r   r   r   r   r   r
   r   special_public_holidays"special_optional_holidays_observed special_public_holidays_observedr   r   r;   r9   r2   r2   !  s   D !n :; KJ {OMBsAsABsBR B 	sAsAB 	sAsB	B
 	"c1!S""c2"c2	
B 	!S""c2"c1
B  	sBQ!B" 	"c1"c1"c2
#B, 	"c2"c2
-B4 	sAsB%5B6 	"c2"c1"c2
7B@ 	"c2"c1!S"
ABJ 	!S""c2
KBR 	!S"!S""c1
SB\ 	"c2"c2!S"
]Bf 	"c2"c2
gBn 	sAsBoBr "c1"c1"c2!S""c2!S"
 AsBBQCBN !]#!Z 

 !]#!Z 

 !]#!Z !R_%	
*&( "bl#!R)*+	
 !R567"bo&	
 B234A}%($r;   r2   N),datetimer   r   rC   typingr   holidays.calendars.gregorianr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   holidays.constantsr   r   r   r   r   holidays.groupsr   r   r   holidays.observed_holiday_baser   r   r    r!   r"   rH   r'   r)   r   r2   r   r;   r9   <module>r      s     !     $ M L Z Z  "3CS"c2sBPSUWY\^`"ab fC "9;PR` fCR	 		& 	T Tr;   