
    g                         d dl mZ ddlmZmZ d dlmZ d dlZd dlZ G d dej                        Z
	 	 	 	 ddZ	 d	 	 	 	 	 	 	 dd	Z	 	 	 	 	 	 	 	 dd
Z	 	 	 	 	 	 ddZ	 	 	 	 	 	 	 	 ddZy)    )annotations   )event_classT_JSON_DICT)	dataclassNc                  6    e Zd ZdZdZdZdZdZd Ze	d        Z
y)	StorageAreaz
    Storage areas.
    sessionlocalsyncmanagedc                    | j                   S N)value)selfs    e/var/www/html/venv/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v129/extensions.pyto_jsonzStorageArea.to_json   s    zz    c                     | |      S r    )clsjsons     r   	from_jsonzStorageArea.from_json   s    4yr   N)__name__
__module____qualname____doc__SESSIONLOCALSYNCMANAGEDr   classmethodr   r   r   r   r	   r	      s6     GEDG  r   r	   c              #  V   K   t               }| |d<   d|d}|}t        |d         S w)av  
    Installs an unpacked extension from the filesystem similar to
    --load-extension CLI flags. Returns extension ID once the extension
    has been installed. Available if the client is connected using the
    --remote-debugging-pipe flag and the --enable-unsafe-extension-debugging
    flag is set.

    :param path: Absolute file path.
    :returns: Extension id.
    pathzExtensions.loadUnpackedmethodparamsid)dictstr)r$   r'   cmd_dictr   s       r   load_unpackedr,      s<      &FF6N+H >DtDz?s   ')c              #     K   t               }| |d<   |j                         |d<   ||D cg c]  }| c}|d<   d|d}|}t        |d         S c c}w w)a(  
    Gets data from extension storage in the given ``storageArea``. If ``keys`` is
    specified, these are used to filter the result.

    :param id_: ID of extension.
    :param storage_area: StorageArea to retrieve data from.
    :param keys: *(Optional)* Keys to retrieve.
    :returns: 
    r(   storageAreakeyszExtensions.getStorageItemsr%   datar)   r   id_storage_arear/   r'   ir+   r   s          r   get_storage_itemsr6   5   so      &FF4L(002F=%)*!*v.H >DV +s   )A	A"Ac              #     K   t               }| |d<   |j                         |d<   |D cg c]  }| c}|d<   d|d}|}yc c}w w)z
    Removes ``keys`` from extension storage in the given ``storageArea``.

    :param id_: ID of extension.
    :param storage_area: StorageArea to remove data from.
    :param keys: Keys to remove.
    r(   r.   r/   zExtensions.removeStorageItemsr%   Nr1   r2   s          r   remove_storage_itemsr8   P   sZ      &FF4L(002F=!%&Aa&F6N1H >D 's   'A	AAc              #  b   K   t               }| |d<   |j                         |d<   d|d}|}yw)z
    Clears extension storage in the given ``storageArea``.

    :param id_: ID of extension.
    :param storage_area: StorageArea to remove data from.
    r(   r.   zExtensions.clearStorageItemsr%   Nr1   )r3   r4   r'   r+   r   s        r   clear_storage_itemsr:   g   sA      &FF4L(002F=0H >Ds   -/c              #  l   K   t               }| |d<   |j                         |d<   ||d<   d|d}|}yw)a  
    Sets ``values`` in extension storage in the given ``storageArea``. The provided ``values``
    will be merged with existing values in the storage area.

    :param id_: ID of extension.
    :param storage_area: StorageArea to set data in.
    :param values: Values to set.
    r(   r.   valueszExtensions.setStorageItemsr%   Nr1   )r3   r4   r<   r'   r+   r   s         r   set_storage_itemsr=   {   sK      &FF4L(002F=F8.H >Ds   24)r$   r*   returnz/typing.Generator[T_JSON_DICT, T_JSON_DICT, str]r   )r3   r*   r4   r	   r/   z!typing.Optional[typing.List[str]]r>   z0typing.Generator[T_JSON_DICT, T_JSON_DICT, dict])r3   r*   r4   r	   r/   ztyping.List[str]r>   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])r3   r*   r4   r	   r>   r?   )r3   r*   r4   r	   r<   r)   r>   r?   )
__future__r   utilr   r   dataclassesr   enumtypingEnumr	   r,   r6   r8   r:   r=   r   r   r   <module>rF      s    # * !  $)) "	64 37! 0 
8	6!  
8	.! 
8(!  
8	r   