
     fѩ                       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ddl	m
Z
  G d de          Z G d	 d
e          Ze G d d                      Ze G d d                      Ze G d d                      Ze G d d                      Ze G d d                      Ze G d d                      Z G d dej                  Ze G d d                      Z	 ddd Zdd!Z	 ddd%Z	 	 	 	 	 	 	 ddd3Z	 ddd5Z	 	 ddd;Zdd?ZddAZddEZddFZ ddHZ!ddJZ"ddLZ#	 dddNZ$	 	 dddSZ%ddVZ&ddYZ'dd\Z(	 ddd_Z)ddbZ*	 	 	 	 	 dddjZ+	 dddmZ,ddpZ-ddrZ.dduZ/	 dddyZ0dd{Z1dd~Z2	 dddZ3ddZ4ddZ5 ed          e G d d                                  Z6 ed          e G d d                                  Z7 ed          e G d d                                  Z8 ed          e G d d                                  Z9 ed          e G d d                                  Z:dS )    )annotations   )event_classT_JSON_DICT)	dataclassN)runtimec                  B     e Zd ZdZddZed	d            Z fdZ xZS )
BreakpointIdz 
    Breakpoint identifier.
    returnstrc                    | S N selfs    r/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/selenium/webdriver/common/devtools/v85/debugger.pyto_jsonzBreakpointId.to_json           jsonc                     | |          S r   r   clsr   s     r   	from_jsonzBreakpointId.from_json       s4yyr   c                j    d                     t                                                                S )NzBreakpointId({})formatsuper__repr__r   	__class__s    r   r    zBreakpointId.__repr__   s'    !(()9)9););<<<r   r   r   )r   r   r   r
   	__name__
__module____qualname____doc__r   classmethodr   r    __classcell__r"   s   @r   r
   r
      sv                [= = = = = = = = =r   r
   c                  B     e Zd ZdZddZed	d            Z fdZ xZS )
CallFrameIdz 
    Call frame identifier.
    r   r   c                    | S r   r   r   s    r   r   zCallFrameId.to_json"   r   r   r   c                     | |          S r   r   r   s     r   r   zCallFrameId.from_json%   r   r   c                j    d                     t                                                                S )NzCallFrameId({})r   r!   s    r   r    zCallFrameId.__repr__)   s'     ''(8(8(:(:;;;r   r#   )r   r   r   r-   r$   r+   s   @r   r-   r-      sv                [< < < < < < < < <r   r-   c                  R    e Zd ZU dZded<   ded<   dZded<   d	 Zed
             ZdS )Location&
    Location in the source code.
    runtime.ScriptId	script_idintline_numberNtyping.Optional[int]column_numberc                    t                      }| j                                        |d<   | j        |d<   | j        
| j        |d<   |S )NscriptId
lineNumbercolumnNumber)dictr5   r   r7   r9   r   r   s     r   r   zLocation.to_json;   sK    vv>1133Z!-\)#'#5D r   c                     | t           j                            |d                   t          |d                   d|v rt          |d                   nd           S )Nr;   r<   r=   )r5   r7   r9   )r   ScriptIdr   r6   r   s     r   r   zLocation.from_jsonC   sd    s&00j1ABBD.//7E7M7M#d>2333SW
 
 
 	
r   )	r%   r&   r'   r(   __annotations__r9   r   r)   r   r   r   r   r2   r2   -   sy              +/M....   
 
 [
 
 
r   r2   c                  D    e Zd ZU dZded<   ded<   d Zed             ZdS )ScriptPositionr3   r6   r7   r9   c                J    t                      }| j        |d<   | j        |d<   |S )Nr<   r=   )r>   r7   r9   r?   s     r   r   zScriptPosition.to_jsonU   s*    vv!-\#1^r   c                h     | t          |d                   t          |d                             S )Nr<   r=   )r7   r9   )r6   r   s     r   r   zScriptPosition.from_json[   s;    sD.//d>233
 
 
 	
r   Nr%   r&   r'   r(   rB   r   r)   r   r   r   r   rD   rD   L   sd              
 
 [
 
 
r   rD   c                      e Zd ZU dZded<   ded<   ded<   ded<   d	ed
<   ded<   dZded<   dZded<   d Zed             Z	dS )	CallFramezJ
    JavaScript call frame. Array of call frames form the call stack.
    r-   call_frame_idr   function_namer2   locationurlztyping.List[Scope]scope_chainruntime.RemoteObjectthisNtyping.Optional[Location]function_locationz%typing.Optional[runtime.RemoteObject]return_valuec                   t                      }| j                                        |d<   | j        |d<   | j                                        |d<   | j        |d<   d | j        D             |d<   | j                                        |d<   | j        | j                                        |d<   | j	        | j	                                        |d	<   |S )
NcallFrameIdfunctionNamerL   rM   c                6    g | ]}|                                 S r   r   .0is     r   
<listcomp>z%CallFrame.to_json.<locals>.<listcomp>   s     DDDaaiikkDDDr   
scopeChainrP   functionLocationreturnValue)
r>   rJ   r   rK   rL   rM   rN   rP   rR   rS   r?   s     r   r   zCallFrame.to_json   s    vv"088::]#1^=0022ZhUDD43CDDD\y((**V!-'+'='E'E'G'GD#$("&"3";";"="=Dr   c                    | t                               |d                   t          |d                   t                              |d                   t          |d                   d |d         D             t          j                            |d                   d|v r t                              |d                   nd d	|v r%t          j                            |d	                   nd 
          S )NrU   rV   rL   rM   c                B    g | ]}t                               |          S r   )Scoper   rY   s     r   r\   z'CallFrame.from_json.<locals>.<listcomp>   s$    HHH++HHHr   r]   rP   r^   r_   )rJ   rK   rL   rM   rN   rP   rR   rS   )r-   r   r   r2   r   RemoteObjectr   s     r   r   zCallFrame.from_json   s    s%//]0CDDd>233''Z(899DK  HHT,5GHHH%//V==N`dhNhNhh006H1IJJJnrP]aePePe-77]8KLLLko	
 	
 	
 		
r   )
r%   r&   r'   r(   rB   rR   rS   r   r)   r   r   r   r   rI   rI   c   s              HHH $###  487777 ;?L>>>>   

 

 [

 

 

r   rI   c                  n    e Zd ZU dZded<   ded<   dZded<   dZd	ed
<   dZd	ed<   d Ze	d             Z
dS )rb   z
    Scope description.
    r   type_rO   object_Ntyping.Optional[str]namerQ   start_locationend_locationc                   t                      }| j        |d<   | j                                        |d<   | j        
| j        |d<   | j        | j                                        |d<   | j        | j                                        |d<   |S )Ntypeobjectrh   startLocationendLocation)r>   re   rf   r   rh   ri   rj   r?   s     r   r   zScope.to_json   s    vvzV--//X9 9DL*$($7$?$?$A$AD!("&"3";";"="=Dr   c           
     P    | t          |d                   t          j                            |d                   d|v rt          |d                   nd d|v r t                              |d                   nd d|v r t                              |d                   nd           S )Nrl   rm   rh   rn   ro   )re   rf   rh   ri   rj   )r   r   rc   r   r2   r   s     r   r   zScope.from_json   s    sd6l##(224>BB&,nnT&\"""$HW[_H_H_8--d?.CDDDeiDQUYDYDY++D,?@@@_c
 
 
 	
r   )r%   r&   r'   r(   rB   rh   ri   rj   r   r)   r   r   r   r   rb   rb      s           JJJ
 "!!!!%D%%%% 15N4444 /3L2222
 
 
 
 
 [
 
 
r   rb   c                  D    e Zd ZU dZded<   ded<   d Zed             ZdS )	SearchMatchz$
    Search match for resource.
    floatr7   r   line_contentc                J    t                      }| j        |d<   | j        |d<   |S )Nr<   lineContent)r>   r7   rt   r?   s     r   r   zSearchMatch.to_json   s*    vv!-\"/]r   c                h     | t          |d                   t          |d                             S )Nr<   rv   )r7   rt   )rs   r   r   s     r   r   zSearchMatch.from_json   s;    sd<011T-011
 
 
 	
r   NrG   r   r   r   rr   rr      sf               
 
 [
 
 
r   rr   c                  \    e Zd ZU ded<   ded<   dZded<   dZded	<   d
 Zed             ZdS )BreakLocationr4   r5   r6   r7   Nr8   r9   rg   re   c                    t                      }| j                                        |d<   | j        |d<   | j        
| j        |d<   | j        
| j        |d<   |S )Nr;   r<   r=   rl   )r>   r5   r   r7   r9   re   r?   s     r   r   zBreakLocation.to_json   s^    vv>1133Z!-\)#'#5D :!:DLr   c           	          | t           j                            |d                   t          |d                   d|v rt          |d                   nd d|v rt	          |d                   nd           S )Nr;   r<   r=   rl   )r5   r7   r9   re   )r   rA   r   r6   r   r   s     r   r   zBreakLocation.from_json   s    s&00j1ABBD.//7E7M7M#d>2333SW'-~~#d6l###4	
 
 
 	
r   )	r%   r&   r'   rB   r9   re   r   r)   r   r   r   r   ry   ry      s             +/M...."&E&&&&   
 
 [
 
 
r   ry   c                  6    e Zd ZdZdZdZd Zed             ZdS )ScriptLanguagez,
    Enum of possible script languages.
    
JavaScriptWebAssemblyc                    | j         S r   )valuer   s    r   r   zScriptLanguage.to_json	  s
    zr   c                     | |          S r   r   r   s     r   r   zScriptLanguage.from_json  r   r   N)	r%   r&   r'   r(   JAVA_SCRIPTWEB_ASSEMBLYr   r)   r   r   r   r   r}   r}     sT          K L     [  r   r}   c                  H    e Zd ZU dZded<   dZded<   d Zed             ZdS )	DebugSymbolsz4
    Debug symbols available for a wasm script.
    r   re   Nrg   external_urlc                X    t                      }| j        |d<   | j        
| j        |d<   |S )Nrl   externalURL)r>   re   r   r?   s     r   r   zDebugSymbols.to_json  s1    vvzV("&"3Dr   c                t     | t          |d                   d|v rt          |d                   nd           S )Nrl   r   )re   r   r   r   s     r   r   zDebugSymbols.from_json#  sJ    sd6l##5Bd5J5JT-0111PT
 
 
 	
r   )	r%   r&   r'   r(   rB   r   r   r)   r   r   r   r   r   r     sh           JJJ *.L----   
 
 [
 
 
r   r   rL   target_call_framesrg   r   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]c              #  t   K   t                      }|                                 |d<   |||d<   d|d}|V }dS )z
    Continues execution until specific location is reached.

    :param location: Location to continue to.
    :param target_call_frames: *(Optional)*
    rL   NtargetCallFrameszDebugger.continueToLocationmethodparamsr>   r   )rL   r   r   cmd_dictr   s        r   continue_to_locationr   +  sY       &&F!))++F:%%7!"/ H >>DDDr   c               #     K   ddi} | V }dS )z+
    Disables debugger for given page.
    r   zDebugger.disableNr   r   r   s     r   disabler   @  $      
 	$H >>DDDr   max_scripts_cache_sizetyping.Optional[float]Dtyping.Generator[T_JSON_DICT, T_JSON_DICT, runtime.UniqueDebuggerId]c              #     K   t                      }| | |d<   d|d}|V }t          j                            |d                   S )a  
    Enables debugger for the given page. Clients should not assume that the debugging has been
    enabled until the result for this command is received.

    :param max_scripts_cache_size: **(EXPERIMENTAL)** *(Optional)* The maximum size in bytes of collected scripts (not referenced by other heap objects) the debugger can hold. Puts no limit if paramter is omitted.
    :returns: Unique identifier of the debugger.
    NmaxScriptsCacheSizezDebugger.enabler   
debuggerId)r>   r   UniqueDebuggerIdr   )r   r   r   r   s       r   enabler   J  s[       &&F)(>$%# H >>D#--d<.@AAAr   rJ   
expressionr   object_groupinclude_command_line_apityping.Optional[bool]silentreturn_by_valuegenerate_previewthrow_on_side_effecttimeout"typing.Optional[runtime.TimeDelta]ytyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[runtime.RemoteObject, typing.Optional[runtime.ExceptionDetails]]]c	              #    K   t                      }	|                                 |	d<   ||	d<   |||	d<   |||	d<   |||	d<   |||	d<   |||	d<   |||	d	<   ||                                |	d
<   d|	d}
|
V }t          j                            |d                   d|v r%t          j                            |d                   ndfS )a$  
    Evaluates expression on a given call frame.

    :param call_frame_id: Call frame identifier to evaluate on.
    :param expression: Expression to evaluate.
    :param object_group: *(Optional)* String object group name to put result into (allows rapid releasing resulting object handles using ```releaseObjectGroup````).
    :param include_command_line_api: *(Optional)* Specifies whether command line API should be available to the evaluated expression, defaults to false.
    :param silent: *(Optional)* In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ````setPauseOnException``` state.
    :param return_by_value: *(Optional)* Whether the result is expected to be a JSON object that should be sent by value.
    :param generate_preview: **(EXPERIMENTAL)** *(Optional)* Whether preview should be generated for the result.
    :param throw_on_side_effect: *(Optional)* Whether to throw an exception if side effect cannot be ruled out during evaluation.
    :param timeout: **(EXPERIMENTAL)** *(Optional)* Terminate execution after timing out (number of milliseconds).
    :returns: A tuple with the following items:

        0. **result** - Object wrapper for the evaluation result.
        1. **exceptionDetails** - *(Optional)* Exception details.
    rU   r   NobjectGroupincludeCommandLineAPIr   returnByValuegeneratePreviewthrowOnSideEffectr   zDebugger.evaluateOnCallFramer   resultexceptionDetailsr>   r   r   rc   r   ExceptionDetails)rJ   r   r   r   r   r   r   r   r   r   r   r   s               r   evaluate_on_call_framer   _  s     8 &&F)1133F=%F< ,}+*B&'!x""1#$4 !'&:"##OO--y0 H >>D&&tH~66HZ^bHbHb **40B+CDDDhl r   	evaluatorc              #  >  K   t                      }|                                 |d<   ||d<   ||                                |d<   d|d}|V }t          j                            |d                   d|v r%t          j                            |d                   ndfS )	a  
    Execute a Wasm Evaluator module on a given call frame.

    **EXPERIMENTAL**

    :param call_frame_id: WebAssembly call frame identifier to evaluate on.
    :param evaluator: Code of the evaluator module.
    :param timeout: **(EXPERIMENTAL)** *(Optional)* Terminate execution after timing out (number of milliseconds).
    :returns: A tuple with the following items:

        0. **result** - Object wrapper for the evaluation result.
        1. **exceptionDetails** - *(Optional)* Exception details.
    rU   r   Nr   zDebugger.executeWasmEvaluatorr   r   r   r   )rJ   r   r   r   r   r   s         r   execute_wasm_evaluatorr     s      $ &&F)1133F=#F;#OO--y1 H >>D&&tH~66HZ^bHbHb **40B+CDDDhl r   startendrQ   restrict_to_functionFtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[BreakLocation]]c              #     K   t                      }|                                 |d<   ||                                |d<   |||d<   d|d}|V }d |d         D             S )	a  
    Returns possible locations for breakpoint. scriptId in start and end range locations should be
    the same.

    :param start: Start of range to search possible breakpoint locations in.
    :param end: *(Optional)* End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range.
    :param restrict_to_function: *(Optional)* Only consider locations which are in the same (non-nested) function as start.
    :returns: List of the possible breakpoint locations.
    r   Nr   restrictToFunctionzDebugger.getPossibleBreakpointsr   c                B    g | ]}t                               |          S r   )ry   r   rY   s     r   r\   z,get_possible_breakpoints.<locals>.<listcomp>  s&    BBB1M##A&&BBBr   	locationsr   )r   r   r   r   r   r   s         r   get_possible_breakpointsr     s       &&FmmooF7O
u'';#$3 H >>DBB[0ABBBBr   r5   r4   Styping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[str, typing.Optional[str]]]c              #     K   t                      }|                                 |d<   d|d}|V }t          |d                   d|v rt          |d                   ndfS )a&  
    Returns source for the script with given id.

    :param script_id: Id of the script to get source for.
    :returns: A tuple with the following items:

        0. **scriptSource** - Script source (empty in case of Wasm bytecode).
        1. **bytecode** - *(Optional)* Wasm bytecode.
    r;   zDebugger.getScriptSourcer   scriptSourcebytecodeNr>   r   r   r5   r   r   r   s       r   get_script_sourcer     s}       &&F"**,,F:, H >>DD !!!+t!3!3D r   /typing.Generator[T_JSON_DICT, T_JSON_DICT, str]c              #     K   t                      }|                                 |d<   d|d}|V }t          |d                   S )z
    This command is deprecated. Use getScriptSource instead.

    :param script_id: Id of the Wasm script to get source for.
    :returns: Script source.
    r;   zDebugger.getWasmBytecoder   r   r   r   s       r   get_wasm_bytecoder     sW       &&F"**,,F:, H >>DtJ   r   stack_trace_idruntime.StackTraceId>typing.Generator[T_JSON_DICT, T_JSON_DICT, runtime.StackTrace]c              #     K   t                      }|                                 |d<   d|d}|V }t          j                            |d                   S )z{
    Returns stack trace with given ``stackTraceId``.

    **EXPERIMENTAL**

    :param stack_trace_id:
    :returns: 
    stackTraceIdzDebugger.getStackTracer   
stackTrace)r>   r   r   
StackTracer   )r   r   r   r   s       r   get_stack_tracer     s`       &&F+3355F>* H >>D''\(:;;;r   c               #     K   ddi} | V }dS )z1
    Stops on the next JavaScript statement.
    r   zDebugger.pauseNr   r   s     r   pauser     s$      
 	"H >>DDDr   parent_stack_trace_idc              #  f   K   t                      }|                                 |d<   d|d}|V }dS )z


    **EXPERIMENTAL**

    :param parent_stack_trace_id: Debugger will pause when async call with given stack trace is started.
    parentStackTraceIdzDebugger.pauseOnAsyncCallr   Nr   )r   r   r   r   s       r   pause_on_async_callr      sI       &&F#8#@#@#B#BF - H >>DDDr   breakpoint_idc              #  f   K   t                      }|                                 |d<   d|d}|V }dS )zC
    Removes JavaScript breakpoint.

    :param breakpoint_id:
    breakpointIdzDebugger.removeBreakpointr   Nr   )r   r   r   r   s       r   remove_breakpointr   3  sH       &&F*2244F>- H >>DDDr   typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.List[CallFrame], typing.Optional[runtime.StackTrace], typing.Optional[runtime.StackTraceId]]]c              #  0  K   t                      }|                                 |d<   d|d}|V }d |d         D             d|v r%t          j                            |d                   ndd|v r%t          j                            |d                   ndfS )	ao  
    Restarts particular call frame from the beginning.

    :param call_frame_id: Call frame identifier to evaluate on.
    :returns: A tuple with the following items:

        0. **callFrames** - New stack trace.
        1. **asyncStackTrace** - *(Optional)* Async stack trace, if any.
        2. **asyncStackTraceId** - *(Optional)* Async stack trace, if any.
    rU   zDebugger.restartFramer   c                B    g | ]}t                               |          S r   rI   r   rY   s     r   r\   z!restart_frame.<locals>.<listcomp>Y  &    <<<A		Q		<<<r   
callFramesasyncStackTraceNasyncStackTraceId)r>   r   r   r   r   StackTraceId)rJ   r   r   r   s       r   restart_framer   D  s       &&F)1133F=) H >>D<<l);<<<ARVZAZAZ$$T*;%<===`dEX\`E`E`&&t,?'@AAAfj r   terminate_on_resumec              #  F   K   t                      }| | |d<   d|d}|V }dS )a  
    Resumes JavaScript execution.

    :param terminate_on_resume: *(Optional)* Set to true to terminate execution upon resuming execution. In contrast to Runtime.terminateExecution, this will allows to execute further JavaScript (i.e. via evaluation) until execution of the paused code is actually resumed, at which point termination is triggered. If execution is currently not paused, this parameter has no effect.
    NterminateOnResumezDebugger.resumer   r>   )r   r   r   r   s       r   resumer   _  sC       &&F&&9"## H >>DDDr   querycase_sensitiveis_regexDtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[SearchMatch]]c              #     K   t                      }|                                 |d<   ||d<   |||d<   |||d<   d|d}|V }d |d	         D             S )
aR  
    Searches for given string in script content.

    :param script_id: Id of the script to search in.
    :param query: String to search for.
    :param case_sensitive: *(Optional)* If true, search is case sensitive.
    :param is_regex: *(Optional)* If true, treats string parameter as regex.
    :returns: List of search matches.
    r;   r   NcaseSensitiveisRegexzDebugger.searchInContentr   c                B    g | ]}t                               |          S r   )rr   r   rY   s     r   r\   z%search_in_content.<locals>.<listcomp>  s&    ===K!!!$$===r   r   r   )r5   r   r   r   r   r   r   s          r   search_in_contentr   q  s       &&F"**,,F:F7O!"0$y, H >>D==d8n====r   	max_depthr6   c              #  B   K   t                      }| |d<   d|d}|V }dS )z
    Enables or disables async call stacks tracking.

    :param max_depth: Maximum depth of async call stacks. Setting to ```0``` will effectively disable collecting async call stacks (default).
    maxDepthzDebugger.setAsyncCallStackDepthr   Nr   )r   r   r   r   s       r   set_async_call_stack_depthr     s<       &&F"F:3 H >>DDDr   patternstyping.List[str]c              #  V   K   t                      }d | D             |d<   d|d}|V }dS )a  
    Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in
    scripts with url matching one of the patterns. VM will try to leave blackboxed script by
    performing 'step in' several times, finally resorting to 'step out' if unsuccessful.

    **EXPERIMENTAL**

    :param patterns: Array of regexps that will be used to check script url for blackbox state.
    c                    g | ]}|S r   r   rY   s     r   r\   z)set_blackbox_patterns.<locals>.<listcomp>  s    ...!...r   r   zDebugger.setBlackboxPatternsr   Nr   )r   r   r   r   s       r   set_blackbox_patternsr     sJ       &&F..X...F:0 H >>DDDr   	positionstyping.List[ScriptPosition]c              #     K   t                      }|                                 |d<   d |D             |d<   d|d}|V }dS )a  
    Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted
    scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
    Positions array contains positions where blackbox state is changed. First interval isn't
    blackboxed. Array should be sorted.

    **EXPERIMENTAL**

    :param script_id: Id of the script.
    :param positions:
    r;   c                6    g | ]}|                                 S r   rX   rY   s     r   r\   z)set_blackboxed_ranges.<locals>.<listcomp>  s     :::1199;;:::r   r  zDebugger.setBlackboxedRangesr   Nr   )r5   r  r   r   r   s        r   set_blackboxed_rangesr    s`       &&F"**,,F:::	:::F;0 H >>DDDr   	conditionPtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[BreakpointId, Location]]c              #     K   t                      }|                                 |d<   |||d<   d|d}|V }t                              |d                   t                              |d                   fS )a  
    Sets JavaScript breakpoint at a given location.

    :param location: Location to set breakpoint in.
    :param condition: *(Optional)* Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
    :returns: A tuple with the following items:

        0. **breakpointId** - Id of the created breakpoint for further reference.
        1. **actualLocation** - Location this breakpoint resolved into.
    rL   Nr  zDebugger.setBreakpointr   r   actualLocation)r>   r   r
   r   r2   )rL   r  r   r   r   s        r   set_breakpointr
    s       &&F!))++F:'{* H >>DtN3444 0122 r   instrumentation8typing.Generator[T_JSON_DICT, T_JSON_DICT, BreakpointId]c              #  ~   K   t                      }| |d<   d|d}|V }t                              |d                   S )z
    Sets instrumentation breakpoint.

    :param instrumentation: Instrumentation name.
    :returns: Id of the created breakpoint for further reference.
    r  z%Debugger.setInstrumentationBreakpointr   r   r>   r
   r   )r  r   r   r   s       r   set_instrumentation_breakpointr    sR       &&F /F9 H >>D!!$~"6777r   r7   rM   	url_regexscript_hashr9   r8   ]typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[BreakpointId, typing.List[Location]]]c              #     K   t                      }| |d<   |||d<   |||d<   |||d<   |||d<   |||d<   d|d	}|V }t                              |d
                   d |d         D             fS )a  
    Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this
    command is issued, all existing parsed scripts will have breakpoints resolved and returned in
    ``locations`` property. Further matching script parsing will result in subsequent
    ``breakpointResolved`` events issued. This logical breakpoint will survive page reloads.

    :param line_number: Line number to set breakpoint at.
    :param url: *(Optional)* URL of the resources to set breakpoint on.
    :param url_regex: *(Optional)* Regex pattern for the URLs of the resources to set breakpoints on. Either ```url```` or ````urlRegex``` must be specified.
    :param script_hash: *(Optional)* Script hash of the resources to set breakpoint on.
    :param column_number: *(Optional)* Offset in the line to set breakpoint at.
    :param condition: *(Optional)* Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
    :returns: A tuple with the following items:

        0. **breakpointId** - Id of the created breakpoint for further reference.
        1. **locations** - List of the locations this breakpoint resolved into upon addition.
    r<   NrM   urlRegex
scriptHashr=   r  zDebugger.setBreakpointByUrlr   r   c                B    g | ]}t                               |          S r   )r2   r   rY   s     r   r\   z)set_breakpoint_by_url.<locals>.<listcomp>*  s&    :::1		A		:::r   r   r  )	r7   rM   r  r  r9   r  r   r   r   s	            r   set_breakpoint_by_urlr    s      2 &&F&F<
u&z*| !.~'{/ H >>DtN344::[(9::: r   	object_idruntime.RemoteObjectIdc              #     K   t                      }|                                 |d<   |||d<   d|d}|V }t                              |d                   S )a  
    Sets JavaScript breakpoint before each call to the given function.
    If another function was created from the same source as a given one,
    calling it will also trigger the breakpoint.

    **EXPERIMENTAL**

    :param object_id: Function object id.
    :param condition: *(Optional)* Expression to use as a breakpoint condition. When specified, debugger will stop on the breakpoint if this expression evaluates to true.
    :returns: Id of the created breakpoint for further reference.
    objectIdNr  z$Debugger.setBreakpointOnFunctionCallr   r   )r>   r   r
   r   )r  r  r   r   r   s        r   set_breakpoint_on_function_callr  .  sm       &&F"**,,F:'{8 H >>D!!$~"6777r   activeboolc              #  B   K   t                      }| |d<   d|d}|V }dS )zz
    Activates / deactivates all breakpoints on the page.

    :param active: New value for breakpoints active state.
    r  zDebugger.setBreakpointsActiver   Nr   )r  r   r   r   s       r   set_breakpoints_activer   I  s<       &&FF81 H >>DDDr   statec              #  B   K   t                      }| |d<   d|d}|V }dS )z
    Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or
    no exceptions. Initial pause on exceptions state is ``none``.

    :param state: Pause on exceptions mode.
    r!  zDebugger.setPauseOnExceptionsr   Nr   )r!  r   r   r   s       r   set_pause_on_exceptionsr#  Z  s;       &&FF7O1 H >>DDDr   	new_valueruntime.CallArgumentc              #  f   K   t                      }|                                 |d<   d|d}|V }dS )z
    Changes return value in top frame. Available only at return break position.

    **EXPERIMENTAL**

    :param new_value: New return value.
    newValuezDebugger.setReturnValuer   Nr   )r$  r   r   r   s       r   set_return_valuer(  l  sH       &&F"**,,F:+ H >>DDDr   script_sourcedry_runtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.Optional[typing.List[CallFrame]], typing.Optional[bool], typing.Optional[runtime.StackTrace], typing.Optional[runtime.StackTraceId], typing.Optional[runtime.ExceptionDetails]]]c              #    K   t                      }|                                 |d<   ||d<   |||d<   d|d}|V }d|v rd |d         D             ndd	|v rt          |d	                   ndd
|v r%t          j                            |d
                   ndd|v r%t          j                            |d                   ndd|v r%t          j                            |d                   ndfS )a  
    Edits JavaScript source live.

    :param script_id: Id of the script to edit.
    :param script_source: New content of the script.
    :param dry_run: *(Optional)* If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code.
    :returns: A tuple with the following items:

        0. **callFrames** - *(Optional)* New stack trace in case editing has happened while VM was stopped.
        1. **stackChanged** - *(Optional)* Whether current call stack  was modified after applying the changes.
        2. **asyncStackTrace** - *(Optional)* Async stack trace, if any.
        3. **asyncStackTraceId** - *(Optional)* Async stack trace, if any.
        4. **exceptionDetails** - *(Optional)* Exception details if any.
    r;   r   NdryRunzDebugger.setScriptSourcer   r   c                B    g | ]}t                               |          S r   r   rY   s     r   r\   z%set_script_source.<locals>.<listcomp>  r   r   stackChangedr   r   r   )r>   r   r  r   r   r   r   r   )r5   r)  r*  r   r   r   s         r   set_script_sourcer0    s0     & &&F"**,,F:*F>"x, H >>D@LPT@T@T<<l);<<<<Z^&4&<&<T.!"""$ARVZAZAZ$$T*;%<===`dEX\`E`E`&&t,?'@AAAfjHZ^bHbHb **40B+CDDDhl r   skipc              #  B   K   t                      }| |d<   d|d}|V }dS )z
    Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).

    :param skip: New value for skip pauses state.
    r1  zDebugger.setSkipAllPausesr   Nr   )r1  r   r   r   s       r   set_skip_all_pausesr3    s;       &&FF6N- H >>DDDr   scope_numbervariable_namec              #     K   t                      }| |d<   ||d<   |                                |d<   |                                |d<   d|d}|V }dS )a  
    Changes value of variable in a callframe. Object-based scopes are not supported and must be
    mutated manually.

    :param scope_number: 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.
    :param variable_name: Variable name.
    :param new_value: New variable value.
    :param call_frame_id: Id of callframe that holds variable.
    scopeNumbervariableNamer'  rU   zDebugger.setVariableValuer   Nr   )r4  r5  r$  rJ   r   r   r   s          r   set_variable_valuer9    sr       &&F(F=*F>"**,,F:)1133F=- H >>DDDr   break_on_async_callc              #  F   K   t                      }| | |d<   d|d}|V }dS )z
    Steps into the function call.

    :param break_on_async_call: **(EXPERIMENTAL)** *(Optional)* Debugger will pause on the execution of the first async task which was scheduled before next pause.
    NbreakOnAsyncCallzDebugger.stepIntor   r   )r:  r   r   r   s       r   	step_intor=    sC       &&F&%8!"% H >>DDDr   c               #     K   ddi} | V }dS )z)
    Steps out of the function call.
    r   zDebugger.stepOutNr   r   s     r   step_outr?    r   r   c               #     K   ddi} | V }dS )z#
    Steps over the statement.
    r   zDebugger.stepOverNr   r   s     r   	step_overrA    s$      
 	%H >>DDDr   zDebugger.breakpointResolvedc                  @    e Zd ZU dZded<   ded<   edd	            Zd
S )BreakpointResolvedzM
    Fired when breakpoint is resolved to an actual script and location.
    r
   r   r2   rL   r   r   r   c                     | t                               |d                   t                              |d                             S )Nr   rL   )r   rL   )r
   r   r2   r   s     r   r   zBreakpointResolved.from_json  sG    s&00n1EFF''Z(899
 
 
 	
r   N)r   r   r   rC  r%   r&   r'   r(   rB   r)   r   r   r   r   rC  rC    sX            
 
 
 [
 
 
r   rC  zDebugger.pausedc                  r    e Zd ZU dZded<   ded<   ded<   ded	<   d
ed<   ded<   ded<   edd            ZdS )Pausedzg
    Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
    ztyping.List[CallFrame]call_framesr   reasontyping.Optional[dict]dataz!typing.Optional[typing.List[str]]hit_breakpoints#typing.Optional[runtime.StackTrace]async_stack_tracez%typing.Optional[runtime.StackTraceId]async_stack_trace_idasync_call_stack_trace_idr   r   r   c                    | d |d         D             t          |d                   d|v rt          |d                   nd d|v rd |d         D             nd d|v r%t          j                            |d                   nd d|v r%t          j                            |d                   nd d	|v r%t          j                            |d	                   nd 
          S )Nc                B    g | ]}t                               |          S r   r   rY   s     r   r\   z$Paused.from_json.<locals>.<listcomp>"  s&    LLLA,,Q//LLLr   r   rI  rK  hitBreakpointsc                ,    g | ]}t          |          S r   r   rY   s     r   r\   z$Paused.from_json.<locals>.<listcomp>%  s    DDDSVVDDDr   r   r   asyncCallStackTraceId)rH  rI  rK  rL  rN  rO  rP  )r   r>   r   r   r   r   r   s     r   r   zPaused.from_json  s   sLLl9KLLLtH~&&'-~~d6l###4HX\`H`H`DDT2B-CDDDDfjWhlpWpWpg0::4@Q;RSSSvz^quy^y^y!5!?!?EX@Y!Z!Z!Z  @Dg~  CG  hG  hGg&:&D&DTJaEb&c&c&c  MQ
 
 
 	
r   N)r   r   r   rG  rE  r   r   r   rG  rG  
  s           ('''KKK6666::::????DDDD	
 	
 	
 [	
 	
 	
r   rG  zDebugger.resumedc                  *    e Zd ZdZedd            ZdS )Resumedz;
    Fired when the virtual machine resumed execution.
    r   r   r   c                     |             S r   r   r   s     r   r   zResumed.from_json4  s    s 
 
 	
r   N)r   r   r   rW  )r%   r&   r'   r(   r)   r   r   r   r   rW  rW  ,  s>         
 
 
 
 [
 
 
r   rW  zDebugger.scriptFailedToParsec                      e Zd ZU dZded<   ded<   ded<   ded<   ded	<   ded
<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ed!d            Zd S )"ScriptFailedToParsez?
    Fired when virtual machine fails to parse the script.
    r4   r5   r   rM   r6   
start_linestart_columnend_line
end_columnruntime.ExecutionContextIdexecution_context_idhash_rJ  execution_context_aux_datarg   source_map_urlr   has_source_url	is_moduler8   lengthrM  stack_tracecode_offset(typing.Optional[debugger.ScriptLanguage]script_languager   r   r   c           	         | di dt           j                            |d                   dt          |d                   dt	          |d                   dt	          |d                   dt	          |d	                   d
t	          |d                   dt           j                            |d                   dt          |d                   dd|v rt          |d                   nd dd|v rt          |d                   nd dd|v rt          |d                   nd dd|v rt          |d                   nd dd|v rt	          |d                   nd dd|v r%t           j                            |d                   nd dd|v rt	          |d                   nd dd|v r%t          j
                            |d                   nd S ) Nr5   r;   rM   r[  	startLiner\  startColumnr]  endLiner^  	endColumnr`  executionContextIdra  hashrb  executionContextAuxDatarc  sourceMapURLrd  hasSourceURLre  isModulerf  rg  r   rh  
codeOffsetrj  scriptLanguager   )r   rA   r   r   r6   ExecutionContextIdr>   r  r   debuggerr}   r   s     r   r   zScriptFailedToParse.from_jsonb  sS   s 
 
 
&00j1ABBB
DK   
 4,---
 T-0111	

 i)))
 4,---
 ")!;!E!EdK_F`!a!a!a
 d6l###
 QjmqPqPqtD1J,K'L'L'Lw{
 9G$8N8N3tN3444TX
 :H49O9O4^ 4555UY
 1;d0B0Bd4
+,,,
 +3d*:*:3tH~&&&
 MY\`L`L`*44T,5GHHHfj
 4@43G3GD.///T
  ZjmqYqYqH3==dCS>TUUUw{!
 	
r   N)r   r   r   rZ  rE  r   r   r   rZ  rZ  ;  s            HHHOOOMMMOOO4444JJJ5555(((())))$$$$    4444%%%%====
 
 
 [
 
 
r   rZ  zDebugger.scriptParsedc                      e Zd ZU dZded<   ded<   ded<   ded<   ded	<   ded
<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ed$d"            Zd#S )%ScriptParsedz
    Fired when virtual machine parses script. This event is also fired for all known and uncollected
    scripts upon enabling debugger.
    r4   r5   r   rM   r6   r[  r\  r]  r^  r_  r`  ra  rJ  rb  r   is_live_editrg   rc  rd  re  r8   rf  rM  rg  rh  ri  rj  z&typing.Optional[debugger.DebugSymbols]debug_symbolsr   r   r   c           	     >    | d#i dt           j                            |d                   dt          |d                   dt	          |d                   dt	          |d                   dt	          |d	                   d
t	          |d                   dt           j                            |d                   dt          |d                   dd|v rt          |d                   nd dd|v rt          |d                   nd dd|v rt          |d                   nd dd|v rt          |d                   nd dd|v rt          |d                   nd dd|v rt	          |d                   nd dd|v r%t           j                            |d                   nd dd|v rt	          |d                   nd dd |v r%t          j
                            |d                    nd d!d"|v r%t          j                            |d"                   nd S )$Nr5   r;   rM   r[  rl  r\  rm  r]  rn  r^  ro  r`  rp  ra  rq  rb  rr  r|  
isLiveEditrc  rs  rd  rt  re  ru  rf  rg  r   rh  rv  rj  rw  r}  debugSymbolsr   )r   rA   r   r   r6   rx  r>   r  r   ry  r}   r   r   s     r   r   zScriptParsed.from_json  s   s 
 
 
&00j1ABBB
DK   
 4,---
 T-0111	

 i)))
 4,---
 ")!;!E!EdK_F`!a!a!a
 d6l###
 QjmqPqPqtD1J,K'L'L'Lw{
 6BT5I5Id<0111t
 9G$8N8N3tN3444TX
 :H49O9O4^ 4555UY
 1;d0B0Bd4
+,,,
 +3d*:*:3tH~&&&
 MY\`L`L`*44T,5GHHHfj
  4@43G3GD.///T!
" ZjmqYqYqH3==dCS>TUUUw{#
$ TbeiSiSi(/99$~:NOOOos%
 	
r   N)r   r   r   r{  rE  r   r   r   r{  r{  x  s	         
  HHHOOOMMMOOO4444JJJ5555''''(((())))$$$$    4444%%%%====9999
 
 
 [
 
 
r   r{  r   )rL   r2   r   rg   r   r   )r   r   )r   r   r   r   )NNNNNNN)rJ   r-   r   r   r   rg   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )rJ   r-   r   r   r   r   r   r   )NN)r   r2   r   rQ   r   r   r   r   )r5   r4   r   r   )r5   r4   r   r   )r   r   r   r   )r   r   r   r   )r   r
   r   r   )rJ   r-   r   r   )r   r   r   r   )
r5   r4   r   r   r   r   r   r   r   r   )r   r6   r   r   )r   r   r   r   )r5   r4   r  r  r   r   )rL   r2   r  rg   r   r  )r  r   r   r  )NNNNN)r7   r6   rM   rg   r  rg   r  rg   r9   r8   r  rg   r   r  )r  r  r  rg   r   r  )r  r  r   r   )r!  r   r   r   )r$  r%  r   r   )r5   r4   r)  r   r*  r   r   r+  )r1  r  r   r   )
r4  r6   r5  r   r$  r%  rJ   r-   r   r   )r:  r   r   r   );
__future__r   utilr   r   dataclassesr   enumtyping r   r   r
   r-   r2   rD   rI   rb   rr   ry   Enumr}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r
  r  r  r  r   r#  r(  r0  r3  r9  r=  r?  rA  rC  rG  rW  rZ  r{  r   r   r   <module>r     s   # " " " " " * * * * * * * * ! ! ! ! ! !        = = = = =3 = = =< < < < <# < < < 
 
 
 
 
 
 
 
< 
 
 
 
 
 
 
 
, 5
 5
 5
 5
 5
 5
 5
 5
p (
 (
 (
 (
 (
 (
 (
 (
V 
 
 
 
 
 
 
 
0 
 
 
 
 
 
 
 
@    TY    
 
 
 
 
 
 
 
6 48    *    :>B B B B B0 .2:>(,15266:6:5 5 5 5 5v 7;    H *.6:C C C C C8   2! ! ! !&< < < <*      &   "   8 6:    * 15*.	> > > > ><   "   *   6 +/    :8 8 8 8* %)*.,0.2*.- - - - -d +/8 8 8 8 86   "   $   , *.# # # # #L   "   8 6:    $       *++

 
 
 
 
 
 
  ,+
" 

 
 
 
 
 
 
   
@   


 

 

 

 

 

 

  ! 

 +,,
8
 8
 8
 8
 8
 8
 8
  -,8
v $%%
?
 ?
 ?
 ?
 ?
 ?
 ?
  &%?
 ?
 ?
r   