
    $)fb#                        d dl mZ d dl mZ d dl mZ er9d dl mZ d dl mZ ed   Z G d ded	
      Z G d ded	
      Z G d ded	
      Z	nd dl m
Z
 d dl mZ eZeee
f   xZxZZ	 G d d      Z G d d      Z G d d      Z G d d      Z G d d      Z G d de      Z G d de      Z G d d e      Z G d! d"      Zy#)$    )TYPE_CHECKING)List)Optional)Literal)	TypedDict)portrait	landscapec                   6    e Zd ZU eed<   eed<   eed<   eed<   y)_MarginOptsleftrighttopbottomN__name__
__module____qualname__float__annotations__     i/var/www/html/flask-app/venv/lib/python3.12/site-packages/selenium/webdriver/common/print_page_options.pyr   r      s    
r   r   F)totalc                   "    e Zd ZU eed<   eed<   y)	_PageOptswidthheightNr   r   r   r   r   r   #   s    r   r   c                   Z    e Zd ZU eed<   eed<   eed<   eed<   eed<   eed<   e	e
   ed<   y)	
_PrintOptsmarginpage
backgroundorientationscaleshrinkToFit
pageRangesN)r   r   r   r   r   r   boolOrientationr   r   strr   r   r   r   r   '   s.      Ir   r   )Any)Dictc                   0    e Zd ZdZd Zdee   fdZddZy)_PageSettingsDescriptorz8Descriptor which validates `height` and 'width' of page.c                     || _         y Nnameselfr1   s     r   __init__z _PageSettingsDescriptor.__init__;   	    	r   returnc                 N    |j                   j                  | j                  d       S r/   )_pagegetr1   r3   objclss      r   __get__z_PageSettingsDescriptor.__get__>   s    yy}}TYY--r   Nc                      t        |d      | j                  |       ||j                  | j                  <   |j                  |j                  d<   y )N_validate_num_propertyr!   )getattrr1   r8   _print_optionsr3   r;   values      r   __set__z_PageSettingsDescriptor.__set__A   s@    .-.tyy%@$		$))%(YY6"r   r6   N	r   r   r   __doc__r4   r   r   r=   rD   r   r   r   r-   r-   8   s    B.8E? ./r   r-   c                   0    e Zd ZdZd Zdee   fdZddZy)_MarginSettingsDescriptorz`Descriptor which validates below attributes.

    - top
    - bottom
    - left
    - right
    c                     || _         y r/   r0   r2   s     r   r4   z"_MarginSettingsDescriptor.__init__P   r5   r   r6   c                 N    |j                   j                  | j                  d       S r/   )_marginr9   r1   r:   s      r   r=   z!_MarginSettingsDescriptor.__get__S   s    {{tyy$//r   Nc                      t        |d      d| j                   |       ||j                  | j                  <   |j                  |j                  d<   y )Nr?   zMargin r    )r@   r1   rL   rA   rB   s      r   rD   z!_MarginSettingsDescriptor.__set__V   sG    .-./DeL!&DII'*{{8$r   rE   rF   r   r   r   rI   rI   G   s!    08E? 03r   rI   c                   0    e Zd ZdZd Zdee   fdZddZy)_ScaleDescriptorz'Scale descriptor which validates scale.c                     || _         y r/   r0   r2   s     r   r4   z_ScaleDescriptor.__init___   r5   r   r6   c                 L    |j                   j                  | j                        S r/   rA   r9   r1   r:   s      r   r=   z_ScaleDescriptor.__get__b   s    !!%%dii00r   Nc                      t        |d      | j                  |       |dk  s|dkD  rt        d      ||j                  | j                  <   y )Nr?   g?   z*Value of scale should be between 0.1 and 2)r@   r1   
ValueErrorrA   rB   s      r   rD   z_ScaleDescriptor.__set__e   sG    .-.tyy%@3;%!)IJJ(-499%r   rE   rF   r   r   r   rO   rO   \   s    118E? 1.r   rO   c                   8    e Zd ZdZddgZd Zdee   fdZd	dZ	y)
_PageOrientationDescriptorz?PageOrientation descriptor which validates orientation of page.r   r	   c                     || _         y r/   r0   r2   s     r   r4   z#_PageOrientationDescriptor.__init__q   r5   r   r6   c                 N    |j                   j                  | j                  d       S r/   rR   r:   s      r   r=   z"_PageOrientationDescriptor.__get__t       !!%%dii66r   Nc                     || j                   vrt        d| j                          ||j                  | j                  <   y )Nz!Orientation value must be one of )ORIENTATION_VALUESrU   rA   r1   rB   s      r   rD   z"_PageOrientationDescriptor.__set__w   s>    ///@AXAX@YZ[[(-499%r   rE   )
r   r   r   rG   r\   r4   r   r(   r=   rD   r   r   r   rW   rW   l   s+    I$k278K#8 7.r   rW   c                   (    e Zd ZdZdZd Zd ZddZy)_ValidateTypeDescriptorzEBase Class Descriptor which validates type of any subclass attribute.Nc                     || _         y r/   r0   )r3   r1   expected_types      r   r4   z _ValidateTypeDescriptor.__init__   r5   r   c                 N    |j                   j                  | j                  d       S r/   rR   r:   s      r   r=   z_ValidateTypeDescriptor.__get__   rZ   r   c                     t        || j                        s.t        | j                   d| j                  j                         ||j
                  | j                  <   y )Nz should be of type )
isinstancer`   rU   r1   r   rA   rB   s      r   rD   z_ValidateTypeDescriptor.__set__   sN    %!3!34		{*=d>P>P>Y>Y=Z[\\(-499%r   rE   )r   r   r   rG   r`   r4   r=   rD   r   r   r   r^   r^   }   s    OM7.r   r^   c                       e Zd ZdZeZy)_ValidateBackGroundz&Expected type of background attribute.Nr   r   r   rG   r'   r`   r   r   r   re   re      s
    0Mr   re   c                       e Zd ZdZeZy)_ValidateShrinkToFitz)Expected type of shirnk to fit attribute.Nrf   r   r   r   rh   rh      s
    3Mr   rh   c                       e Zd ZdZeZy)_ValidatePageRangesz'Excepted type of page ranges attribute.N)r   r   r   rG   listr`   r   r   r   rj   rj      s
    1Mr   rj   c                       e Zd Z ed      Z	  ed      Z	  ed      Z	  ed      Z	  ed      Z		  ed      Z
	  ed      Z	  ed      Z	  ed	e      Z	  ed
e      Z	  ede      Z	 ddZdefdZdededdfdZy)PrintOptionsr   r   r   r   r   r   r$   r#   r"   r%   r&   r6   Nc                 .    i | _         i | _        i | _        y r/   )rA   r8   rL   r3   s    r   r4   zPrintOptions.__init__  s    *, "
$&r   c                     | j                   S )z-:Returns: A hash of print options configured.)rA   ro   s    r   to_dictzPrintOptions.to_dict  s    """r   property_namerC   c                 r    t        |t        t        f      st        | d      |dk  rt        | d      y)z3Helper function to validate some of the properties.z  should be an integer or a floatr   z cannot be less then 0N)rc   intr   rU   )r3   rr   rC   s      r   r?   z#PrintOptions._validate_num_property  sB    %#u..NOPP19.DEFF r   rE   )r   r   r   r-   page_height
page_widthrI   
margin_topmargin_bottommargin_leftmargin_rightrO   r$   rW   r#   re   r'   r"   rh   shrink_to_fitrj   rk   page_rangesr4   r   rq   r)   r   r?   r   r   r   rm   rm      s    )(3K* )1J* +51J* .h7M* ,F3K* -W5L* W%E* -];K* %\48J* )=M* &lD9K*'
# #GC G G$ Gr   rm   N)typingr   r   r   r   r   r(   r   r   r   r*   r+   r)   r-   rI   rO   rW   r^   re   rh   rj   rm   r   r   r   <module>r~      s   & !   12Kiu IU Ye  K+/S>9K9)j/ /3 3*. . . .". ."1 2 1 BG BGr   