
    +g2                       S SK Jr  SSKJrJr  S SKJr  S SKrS SKrSSK	J
r
  SSK	Jr  \ " S S	5      5       r\ " S
 S5      5       r\ " S S5      5       r\ " S S5      5       r\ " S S5      5       r\ " S S5      5       rS&S jrS&S jrS'S jr    S(S jrS&S jr   S)       S*S jjrS+S jrS&S jrS,S jr\" S5      \ " S S5      5       5       r\" S 5      \ " S! S"5      5       5       r\" S#5      \ " S$ S%5      5       5       rg)-    )annotations   )event_classT_JSON_DICT)	dataclassN)debugger)runtimec                  |    \ rS rSr% SrS\S'   S\S'   SrS\S	'   SrS
\S'   SrS\S'   Sr	S\S'   S r
\S 5       rSrg)ProfileNode   zQ
Profile node. Holds callsite information, execution statistics and child nodes.
intid_zruntime.CallFrame
call_frameNztyping.Optional[int]	hit_count!typing.Optional[typing.List[int]]childrentyping.Optional[str]deopt_reasonz.typing.Optional[typing.List[PositionTickInfo]]position_ticksc                   [        5       nU R                  US'   U R                  R                  5       US'   U R                  b  U R                  US'   U R
                  b  U R
                   Vs/ s H  o"PM     snUS'   U R                  b  U R                  US'   U R                  b-  U R                   Vs/ s H  o"R                  5       PM     snUS'   U$ s  snf s  snf )Nid	callFramehitCountr   deoptReasonpositionTicks)dictr   r   to_jsonr   r   r   r   selfjsonis      x/Users/Alptekin/Desktop/izin_takip/venv/lib/python3.13/site-packages/selenium/webdriver/common/devtools/v131/profiler.pyr   ProfileNode.to_json(   s    vXXT
 OO335[>>%#~~D==$+/==9=a=9D("&"3"3D*:>:M:M$N:MQYY[:M$ND!  : %Os   .C6Cc                   U " [        US   5      [        R                  R                  US   5      SU;   a  [        US   5      OS SU;   a  US    Vs/ s H  n[        U5      PM     snOS SU;   a  [	        US   5      OS SU;   a+  US    Vs/ s H  n[
        R                  U5      PM     snS9$ S S9$ s  snf s  snf )Nr   r   r   r   r   r   )r   r   r   r   r   r   )r   r	   	CallFrame	from_jsonstrPositionTickInfoclsr    r!   s      r"   r&   ProfileNode.from_json6   s    DJ((2243DE/9T/Ac$z*+t;E;Md:&67&6c!f&67SW5Bd5JT-01PT]lpt]t4CXYCXa,66q9CXY
 	
 {
 	
 8Ys   B6B; )__name__
__module____qualname____firstlineno____doc____annotations__r   r   r   r   r   classmethodr&   __static_attributes__r,       r"   r   r      se     
H "! '+I#* 37H/6 *.L&- FJNBI 
 
r5   r   c                  j    \ rS rSr% SrS\S'   S\S'   S\S'   SrS	\S
'   SrS	\S'   S r\	S 5       r
Srg)ProfileB   z

Profile.
ztyping.List[ProfileNode]nodesfloat
start_timeend_timeNr   samplestime_deltasc                ~   [        5       nU R                   Vs/ s H  o"R                  5       PM     snUS'   U R                  US'   U R                  US'   U R
                  b  U R
                   Vs/ s H  o"PM     snUS'   U R                  b  U R                   Vs/ s H  o"PM     snUS'   U$ s  snf s  snf s  snf )Nr9   	startTimeendTimer=   
timeDeltas)r   r9   r   r;   r<   r=   r>   r   s      r"   r   Profile.to_jsonW   s    v.2jj9jj9W OO[--Y<<#*.,,7,Qq,7DO'-1-=-=!>-=!-=!>D : 8!>s   B01B5B:c                J   U " US    Vs/ s H  n[         R                  U5      PM     sn[        US   5      [        US   5      SU;   a  US    Vs/ s H  n[        U5      PM     snOS SU;   a!  US    Vs/ s H  n[        U5      PM     snS9$ S S9$ s  snf s  snf s  snf )Nr9   r@   rA   r=   rB   )r9   r;   r<   r=   r>   )r   r&   r:   r   r)   s      r"   r&   Profile.from_jsonb   s    59']C];((+]CT+./4	?+9Bd9JT)_5_SV_5PT@LPT@Tl);<);AQ);<
 	

 [_
 	
C 6<s   BB8B r,   )r-   r.   r/   r0   r1   r2   r=   r>   r   r3   r&   r4   r,   r5   r"   r7   r7   B   sQ     $#  O 26G.5 6:K29	 
 
r5   r7   c                  D    \ rS rSr% SrS\S'   S\S'   S r\S 5       rSr	g	)
r(   m   zH
Specifies a number of samples attributed to a certain source position.
r   lineticksc                V    [        5       nU R                  US'   U R                  US'   U$ )NrH   rI   )r   rH   rI   r   r    s     r"   r   PositionTickInfo.to_jsonx   s(    vyyV

Wr5   c                @    U " [        US   5      [        US   5      S9$ )NrH   rI   )rH   rI   r   r*   r    s     r"   r&   PositionTickInfo.from_json~   s'    T&\"d7m$
 	
r5   r,   N
r-   r.   r/   r0   r1   r2   r   r3   r&   r4   r,   r5   r"   r(   r(   m   s.     I J 
 
r5   r(   c                  N    \ rS rSr% SrS\S'   S\S'   S\S'   S r\S 5       rS	r	g
)CoverageRange   z#
Coverage data for a source range.
r   start_offset
end_offsetcountc                t    [        5       nU R                  US'   U R                  US'   U R                  US'   U$ )NstartOffset	endOffsetrW   )r   rU   rV   rW   rK   s     r"   r   CoverageRange.to_json   s9    v"//] OO[

Wr5   c                Z    U " [        US   5      [        US   5      [        US   5      S9$ )NrY   rZ   rW   )rU   rV   rW   rN   rO   s     r"   r&   CoverageRange.from_json   s5    T-014,-d7m$
 	
r5   r,   NrQ   r,   r5   r"   rS   rS      s6      O J 
 
r5   rS   c                  N    \ rS rSr% SrS\S'   S\S'   S\S'   S	 r\S
 5       rSr	g)FunctionCoverage   z*
Coverage data for a JavaScript function.
r'   function_nameztyping.List[CoverageRange]rangesboolis_block_coveragec                    [        5       nU R                  US'   U R                   Vs/ s H  o"R                  5       PM     snUS'   U R                  US'   U$ s  snf )NfunctionNamerb   isBlockCoverage)r   ra   rb   r   rd   r   s      r"   r   FunctionCoverage.to_json   sT    v#11^/3{{;{!))+{;X"&"8"8 <s   Ac           	         U " [        US   5      US    Vs/ s H  n[        R                  U5      PM     sn[        US   5      S9$ s  snf )Nrf   rb   rg   )ra   rb   rd   )r'   rS   r&   rc   r)   s      r"   r&   FunctionCoverage.from_json   sN    d>238<XG1M++A.G"4(9#:;
 	
Gs   A
r,   NrQ   r,   r5   r"   r_   r_      s8      '&  
 
r5   r_   c                  N    \ rS rSr% SrS\S'   S\S'   S\S'   S	 r\S
 5       rSr	g)ScriptCoverage   z(
Coverage data for a JavaScript script.
zruntime.ScriptId	script_idr'   urlztyping.List[FunctionCoverage]	functionsc                    [        5       nU R                  R                  5       US'   U R                  US'   U R                   Vs/ s H  o"R                  5       PM     snUS'   U$ s  snf )NscriptIdro   rp   )r   rn   r   ro   rp   r   s      r"   r   ScriptCoverage.to_json   sY    v>>113ZhhU26..A.QYY[.A[ Bs   A&c           
         U " [         R                  R                  US   5      [        US   5      US    Vs/ s H  n[        R                  U5      PM     snS9$ s  snf )Nrr   ro   rp   )rn   ro   rp   )r	   ScriptIdr&   r'   r_   r)   s      r"   r&   ScriptCoverage.from_json   s_    &&00j1ABDK >B;>OP>O'11!4>OP
 	
 Qs   Ar,   NrQ   r,   r5   r"   rl   rl      s7       
H -, 
 
r5   rl   c               #     #    SS0n U v ng 7f)NmethodzProfiler.disabler,   cmd_dictr    s     r"   disabler{      s      	$H >D   
c               #     #    SS0n U v ng 7f)Nrx   zProfiler.enabler,   ry   s     r"   enabler~      s      	#H >Dr|   c               #  v   #    SS0n U v nUS    Vs/ s H  n[         R                  U5      PM     sn$ s  snf 7f)z
Collect coverage data for the current isolate. The coverage data may be incomplete due to
garbage collection.

:returns: Coverage data for the current isolate.
rx   zProfiler.getBestEffortCoverageresult)rl   r&   rz   r    r!   s      r"   get_best_effort_coverager      sD      	2H >D15h@AN$$Q'@@@s   949c              #  :   #    [        5       nXS'   SUS.nUv ng7f)z
Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.

:param interval: New sampling interval in microseconds.
intervalzProfiler.setSamplingIntervalrx   paramsN)r   )r   r   rz   r    s       r"   set_sampling_intervalr      s,      &F!:0H >Ds   c               #     #    SS0n U v ng 7f)Nrx   zProfiler.startr,   ry   s     r"   startr     s      	"H >Dr|   c              #  v   #    [        5       nU b  XS'   Ub  XS'   Ub  X#S'   SUS.nUv n[        US   5      $ 7f)a7  
Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code
coverage may be incomplete. Enabling prevents running optimized code and resets execution
counters.

:param call_count: *(Optional)* Collect accurate call counts beyond simple 'covered' or 'not covered'.
:param detailed: *(Optional)* Collect block-based coverage.
:param allow_triggered_updates: *(Optional)* Allow the backend to send updates on its own initiative
:returns: Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
	callCountdetailedallowTriggeredUpdateszProfiler.startPreciseCoverager   	timestamp)r   r:   )
call_countr   allow_triggered_updatesr   rz   r    s         r"   start_precise_coverager     s_      &F({%z**A&'1H >Dk"##s   79c               #  J   #    SS0n U v n[         R                  US   5      $ 7f)z


:returns: Recorded profile.
rx   zProfiler.stopprofile)r7   r&   ry   s     r"   stopr   5  s1      	/H >DT)_--s   !#c               #     #    SS0n U v ng7f)z|
Disable precise code coverage. Disabling releases unnecessary execution count records and allows
executing optimized code.
rx   zProfiler.stopPreciseCoverageNr,   ry   s     r"   stop_precise_coverager   B  s      	0H >Dr|   c               #     #    SS0n U v nUS    Vs/ s H  n[         R                  U5      PM     sn[        US   5      4$ s  snf 7f)aZ  
Collect coverage data for the current isolate, and resets execution counters. Precise code
coverage needs to have started.

:returns: A tuple with the following items:

    0. **result** - Coverage data for the current isolate.
    1. **timestamp** - Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
rx   zProfiler.takePreciseCoverager   r   )rl   r&   r:   r   s      r"   take_precise_coverager   M  sX      	0H >D.28n=n	!	!!	$n=d;  =s   AAAzProfiler.consoleProfileFinishedc                  R    \ rS rSr% S\S'   S\S'   S\S'   S\S	'   \SS
 j5       rSrg)ConsoleProfileFinishedia  r'   r   debugger.Locationlocationr7   r   r   titlec           	         U " [        US   5      [        R                  R                  US   5      [        R                  US   5      SU;   a  [        US   5      S9$ S S9$ )Nr   r   r   r   )r   r   r   r   )r'   r   Locationr&   r7   rO   s     r"   r&    ConsoleProfileFinished.from_jsonk  sg    DJ&&00j1AB%%d9o6(/4#d7m$	
 	
 >B	
 	
r5   r,   N)r    r   returnr   )r-   r.   r/   r0   r2   r3   r&   r4   r,   r5   r"   r   r   a  s-     
H
 
r5   r   zProfiler.consoleProfileStartedc                  L    \ rS rSr% SrS\S'   S\S'   S\S'   \SS	 j5       rS
rg)ConsoleProfileStartediu  zJ
Sent when new profile recording is started using console.profile() call.
r'   r   r   r   r   r   c                    U " [        US   5      [        R                  R                  US   5      SU;   a  [        US   5      S9$ S S9$ )Nr   r   r   )r   r   r   )r'   r   r   r&   rO   s     r"   r&   ConsoleProfileStarted.from_json  sU    DJ&&00j1AB(/4#d7m$
 	
 >B
 	
r5   r,   N)r    r   r   r   	r-   r.   r/   r0   r1   r2   r3   r&   r4   r,   r5   r"   r   r   u  s,     
H
 
r5   r   z#Profiler.preciseCoverageDeltaUpdatec                  L    \ rS rSr% SrS\S'   S\S'   S\S'   \SS	 j5       rS
rg)PreciseCoverageDeltaUpdatei  a[  
**EXPERIMENTAL**

Reports coverage delta since the last poll (either from an event like this, or from
``takePreciseCoverage`` for the current isolate. May only be sent if precise code
coverage has been started. This event can be trigged by the embedder to, for example,
trigger collection of coverage data immediately at a certain point in time.
r:   r   r'   occasionztyping.List[ScriptCoverage]r   c           
         U " [        US   5      [        US   5      US    Vs/ s H  n[        R                  U5      PM     snS9$ s  snf )Nr   r   r   )r   r   r   )r:   r'   rl   r&   r)   s      r"   r&   $PreciseCoverageDeltaUpdate.from_json  sP    D-.j)*9=hHAN,,Q/H
 	
 Is   Ar,   N)r    r   r   r   r   r,   r5   r"   r   r     s,     M''
 
r5   r   )r   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])r   zGtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[ScriptCoverage]])r   r   r   r   )NNN)r   typing.Optional[bool]r   r   r   r   r   z1typing.Generator[T_JSON_DICT, T_JSON_DICT, float])r   z3typing.Generator[T_JSON_DICT, T_JSON_DICT, Profile])r   z\typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.List[ScriptCoverage], float]])
__future__r   utilr   r   dataclassesr   enumtyping r   r	   r   r7   r(   rS   r_   rl   r{   r~   r   r   r   r   r   r   r   r   r   r   r,   r5   r"   <module>r      s   # * !     .
 .
 .
b '
 '
 '
T 
 
 
0 
 
 
: 
 
 
: 
 
 
:A	7" -1*.9=$)$'$ "7$ 
9	$<
.( ./

 
  0
$ -.

 
  /
& 23

 
  4
r5   