
    !g                         d dl mZ d dlmZmZmZmZmZmZ d dl	m
Z
mZmZ d dlmZmZmZmZ  G d dee
ee      Z G d de      Z G d	 d
e      Z G d de      Z G d d      Zy)    )Union)APRMAYJUNJULSEPDEC)ChristianHolidaysInternationalHolidaysStaticHolidays)ObservedHolidayBaseMON_TO_NEXT_TUESAT_SUN_TO_NEXT_MONSAT_SUN_TO_NEXT_MON_TUEc                        e Zd ZU dZdZdZdZeed   ee	df   f   e
d<   dd	d
ddZdZdZ fdZddZ fdZd Zd Zd Zd Z xZS )UnitedKingdoma  
    References:
    - https://en.wikipedia.org/wiki/Public_holidays_in_the_United_Kingdom
    - https://archive.org/details/treatiseonbanki00walk/page/334/mode/2up
    - https://www.gov.uk/bank-holidays
    - https://www.timeanddate.com/holidays/uk/

    The Anniversary of the Battle of the Boyne bank holiday is proclaimed annually by the
    Secretary of State for Northern Ireland.

    In-Lieu observance was first provided in the Bank Holidays Extension Act 1875.
    GBz%s (observed))ENGNIRSCTWLS .subdivisionsr   r   r   r   )EnglandzNorthern IrelandScotlandWales)UKiP  c                     t        j                  |        t        j                  |        t        j                  | t               |j                  dt               |j                  dd       t        |   |i | y )Nobserved_ruleobserved_sinceiS  )r
   __init__r   r   UnitedKingdomStaticHolidays
setdefaultr   super)selfargskwargs	__class__s      ^/var/www/dash_apps/app1/venv/lib/python3.12/site-packages/holidays/countries/united_kingdom.pyr!   zUnitedKingdom.__init__9   sd    ""4(&&t,&AB/+>?*D1$)&)    c                 |   | j                  d       | j                  dk\  r3d}| j                  dv r| j                  |       n| j                  |       | j                  dk\  rZt        dft        dft        dfd}d	}| j                  |v r | j                  ||| j                            y | j                  |       y y )
NzGood Fridayi  zMay Day>               )      zSpring Bank Holiday)_add_good_friday_year_add_holiday_may_8_add_holiday_1st_mon_of_mayr   _add_holiday_add_holiday_last_mon_of_may)r%   namespring_bank_datess      r)   _populate_public_holidaysz'UnitedKingdom._populate_public_holidaysB   s    m, ::Dzz\)''-006 ::AhAhAh!
 )Dzz..!!$(9$**(EF11$7 r*   c                 6   | j                   dk7  r{| j                  dk\  r | j                  | j                  d             | j                  | j	                  d      t
               | j                  | j                  d      t
               t        | !          y )Nr   i  New Year's DayChristmas Dayrule
Boxing Day)	subdivr5   _add_observed_add_new_years_day_add_christmas_dayr   _add_christmas_day_twor$   _populate_subdiv_holidays)r%   r(   s    r)   rH   z'UnitedKingdom._populate_subdiv_holidays[   s    ;;%zzT!""4#:#:;K#LM ''8?V  
 ++L9@W   	)+r*   c                     | j                  d       | j                  dk  r| j                  d       | j                  dk\  r| j                  d       y y NEaster Monday  Whit Mondayr.   Late Summer Bank Holiday_add_easter_mondayr5   _add_whit_monday_add_holiday_last_mon_of_augr%   s    r)   $_populate_subdiv_eng_public_holidaysz2UnitedKingdom._populate_subdiv_eng_public_holidaysm   N    0 ::!!-0 ::--.HI r*   c                 F   | j                   dk\  r | j                  | j                  d             | j                  d       | j                   dk  r| j	                  d       | j                  | j                  d             | j                   dk\  r| j                  d       y y )	Nio  zSaint Patrick's DayrK   rL   rM   zBattle of the Boyner.   rN   )r5   rD   _add_holiday_mar_17rP   rQ   _add_holiday_jul_12rR   rS   s    r)   $_populate_subdiv_nir_public_holidaysz2UnitedKingdom._populate_subdiv_nir_public_holidaysy   s    ::t778MNO 	0 ::!!-0 	4334IJK ::--.HI r*   c                    | j                  d      }| j                  | j                  d      t        t        z          | j                  |       | j                  d       | j                  dk\  r | j                  | j                  d             | j                  | j                  d      | j                  dk\  rt        nt               | j                  dk\  r'| j                  | j                  d	      t               y y )
Nr>   zNew Year Holidayr@   zSummer Bank Holidayi  zSaint Andrew's Dayr?   i  rB   )rE   rD   _add_new_years_day_twor   r   _add_holiday_1st_mon_of_augr5   _add_holiday_nov_30rF   r   rG   )r%   jan_1s     r)   $_populate_subdiv_sct_public_holidaysz2UnitedKingdom._populate_subdiv_sct_public_holidays   s    ''(89 	''(:;(?: 	 	
 	5! 	(()>?::t778LMN 	##O4,0JJ$,>(DW 	 	

 ::++L9@W   r*   c                     | j                  d       | j                  dk  r| j                  d       | j                  dk\  r| j                  d       y y rJ   rO   rS   s    r)   $_populate_subdiv_wls_public_holidaysz2UnitedKingdom._populate_subdiv_wls_public_holidays   rU   r*   )returnN)__name__
__module____qualname____doc__countryobserved_labelr   r   tuplestr__annotations__subdivisions_aliases_deprecated_subdivisions
start_yearr!   r<   rH   rT   rY   r_   ra   __classcell__)r(   s   @r)   r   r      s     G$N7L%b	5c?23  !	  'J*82,$
JJ&<
Jr*   r   c                       e Zd Zy)r   Nrc   rd   re   r   r*   r)   r   r          r*   r   c                       e Zd Zy)r   Nrq   r   r*   r)   r   r      rr   r*   r   c                       e Zd Zy)GBRNrq   r   r*   r)   ru   ru      rr   r*   ru   c            
       \    e Zd Zeddfeddfeddfeddfedd	fed
dfeddfeddffeddfdZ	y)r"      zSilver Jubilee of Elizabeth II   zWedding of Charles and Diana   zMillennium Celebrations   zGolden Jubilee of Elizabeth IIz Wedding of William and Catherine   zDiamond Jubilee of Elizabeth IIz Platinum Jubilee of Elizabeth II   z#State Funeral of Queen Elizabeth II   zCoronation of Charles III)i  i  i  r1   i  r2   r3   i  N)
rc   rd   re   r   r   r	   r   r   r   special_public_holidaysr   r*   r)   r"   r"      st    A78B67B12A78B:;A89!78";<
 A23r*   r"   N)typingr   holidays.calendars.gregorianr   r   r   r   r   r	   holidays.groupsr
   r   r   holidays.observed_holiday_baser   r   r   r   r   r   r   ru   r"   r   r*   r)   <module>r      si     E E T T [J'):<QSa [J|	 		 		- 	 r*   