
    nj                     \    d dl Z d dlmZmZmZ d dlmZ d dlmZ erd dl	m
Z
  G d d      Zy)    N)TYPE_CHECKINGOptionalUnion)Artifact)Error)Pagec                       e Zd Zdddee   ddfdZdefdZdej                  fdZ
d	eeej                  f   ddfd
ZddZy)Videopager   artifactreturnNc                     |j                   | _         |j                  | _        || _        |j                  j                  | _        || _        y N)_loop_dispatcher_fiber_page_connection	is_remote
_is_remote	_artifact)selfr   r   s      K/home/ubuntu/.local/lib/python3.12/site-packages/playwright/_impl/_video.py__init__zVideo.__init__   s<    ZZ
!%!7!7
**44!    c                 "    d| j                    dS )Nz<Video page=>)r   r   s    r   __repr__zVideo.__repr__!   s    djj\++r   c                    K   | j                   rt        d      | j                  st        d      | j                  j                  S w)Nz[Path is not available when using browserType.connect(). Use save_as() to save a local copy.%Video recording has not been started.)r   r   r   absolute_pathr   s    r   pathz
Video.path$   sB     ??m  ~~?@@~~+++s   AAr"   c                   K   | j                   j                  j                  r!| j                   j                  st	        d      | j
                  st	        d      | j
                  j                  |       d {    y 7 w)Nz?Page is not yet closed. Close the page prior to calling save_asr    )r   r   _is_sync
_is_closedr   r   save_as)r   r"   s     r   r&   zVideo.save_as-   sb     ::!!**4::3H3HQ  ~~?@@nn$$T***s   A7B9A?:Bc                 n   K   | j                   r#| j                   j                          d {    y y 7 wr   )r   deleter   s    r   r(   zVideo.delete6   s+     >>..''))) )s   *535)r   N)__name__
__module____qualname__r   r   r   strr   pathlibPathr"   r   r&   r(    r   r   r
   r
      sc    "V "x/A "d ",# ,,GLL ,+%W\\(9": +t +*r   r
   )r-   typingr   r   r   playwright._impl._artifactr   playwright._impl._helperr   playwright._impl._pager   r
   r/   r   r   <module>r4      s&     1 1 / *+* *r   