
    6Dhw                     j    S SK Jr  S SKrS SKJr  S SKJr  S rS r	S\
S\\
   4S jr\" 5       4S	 jrg)
    )ListN)get_plotlyjs_versionc                 |   SSK Jn  [        X5      (       a  U R                  5       nU$ [        U [        5      (       a;  U(       a/  [
        R                  R                  U 5      R                  5       nU$ U n U$ [        U S5      (       a  U R                  5       nU$ [        SR                  [        U 5      U S95      e)Nr   )
BaseFigureto_plotly_jsonzR
The fig parameter must be a dict or Figure.
    Received value of type {typ}: {v})typv)plotly.basedatatypesr   
isinstanceto_dictdictplotly
graph_objsFigurer   hasattr
ValueErrorformattype)figvalidater   fig_dicts       B/var/www/html/env/lib/python3.13/site-packages/plotly/io/_utils.pyvalidate_coerce_fig_to_dictr      s    /#"";;=" O! 
C		((//4CCEH O H O 
&	'	'%%' O ))/I *0 *
 	
    c                     U S:X  d  U [         R                  :X  a  [         R                  nU$ U S:X  d)  [        [         S5      (       a&  U [         R                  :X  a  [         R                  nU$ [	        S5      e)Nr   FigureWidgetzP
Invalid output type: {output_type}
    Must be one of: 'Figure', 'FigureWidget')gor   r   r   r   )output_typeclss     r   validate_coerce_output_typer        sk    h+":ii J 
	&N##r(Foo J 0
 	
r   kwargsreturnc                  @   [        U R                  5       5       Vs/ s H%  n[        U[        5      (       d  M  [	        U5      PM'     nnU(       a#  [	        [        U5      5      S:  a  [        S5      eU(       a  US   OSnU R                  5        VVs0 s H#  u  pAU[        U[        5      (       d  U/U-  OU_M%     nnn[        U5       VVVs/ s H*  oeR                  5        VVs0 s H
  u  pAXAU   _M     snnPM,     nnnnU$ s  snf s  snnf s  snnf s  snnnf )a  
Given one or more keyword arguments which may be either a single value or a list of values,
return a list of keyword dictionaries by broadcasting the single valuesacross all the dicts.
If more than one item in the input is a list, all lists must be the same length.

Parameters
----------
**kwargs: dict
    The keyword arguments

Returns
-------
list of dicts
    A list of dictionaries

Raises
------
ValueError
    If any of the input lists are not the same length
   z-All list arguments must have the same length.r   )	tuplevaluesr   listlensetr   itemsrange)r!   r	   list_lengthslist_lengthkexpanded_kwargsilist_of_kwargss           r   broadcast_args_to_dictsr2   0   s   0 %*&--/$:R$:qjD>QFCF$:LRC-.2HII%1,q/qK
 LLN"DA 	
Jq$$7$7A3Q>"   @E[?Q?Q!22454TQaD45?Q   ! S 	6s(   DD*DD)D:DDc                      SR                  U S9$ )zReturn a valid plotly CDN url.z+https://cdn.plot.ly/plotly-{cdn_ver}.min.jscdn_ver)r   r4   s    r   plotly_cdn_urlr6   [   s    8?? @  r   )typingr   r   plotly.graph_objsr   r   plotly.offliner   r   r    r   r2   r6    r   r   <module>r;      s@       /0 (d (tDz (V 01 r   