
    Mf}                         d dl Z d dlZd dlZd dlZd dlZd dlZd dlZddlmZ ddl	m
Z
 dZdZdZdZd	Zd
ZdZdZdZdZdZdZd Zd Zd Zd Zd Z	 	 d#dZd Zd Zd Zd Z d Z!d Z"d Z#d$dZ$d  Z%	 d%d!Z&d" Z'dS )&    N   )
r_keywords)reorder_propsa  #' @export
{funcname} <- function({default_argtext}{wildcards}) {{
    {wildcard_declaration}
    props <- list({default_paramtext}{wildcards})
    if (length(props) > 0) {{
        props <- props[!vapply(props, is.null, logical(1))]
    }}
    component <- list(
        props = props,
        type = '{name}',
        namespace = '{project_shortname}',
        propNames = c({prop_names}{wildcard_names}),
        package = '{package_name}'
        )

    structure(component, class = c('dash_component', 'list'))
}}
z?.{rpkgname}_js_metadata <- function() {{
deps_metadata <- list(a,  `{dep_name}` = structure(list(name = "{dep_name}",
version = "{project_ver}", src = list(href = NULL,
file = "deps"), meta = NULL,
script = {script_name},
stylesheet = {css_name}, head = NULL, attachment = NULL, package = "{rpkgname}",
all_files = FALSE{async_or_dynamic}), class = "html_dependency")a>  `{project_shortname}` = structure(list(name = "{project_shortname}",
version = "{project_ver}", src = list(href = NULL,
file = "deps"), meta = NULL,
script = {script_name},
stylesheet = {css_name}, head = NULL, attachment = NULL, package = "{rpkgname}",
all_files = FALSE{async_or_dynamic}), class = "html_dependency")z)
return(deps_metadata)
}
z% Auto-generated: do not edit by hand
\name{{{funcname}}}

\alias{{{funcname}}}

\title{{{name} component}}

\description{{
{description}
}}

\usage{{
{funcname}({default_argtext})
}}

\arguments{{
{item_text}
}}

\value{{{value_text}}}

a~  Package: {package_name}
Title: {package_title}
Version: {package_version}
Description: {package_description}
Depends: R (>= 3.0.2){package_depends}
Imports: {package_imports}
Suggests: {package_suggests}{package_rauthors}
License: {package_license}{package_copyright}
URL: {package_url}
BugReports: {package_issues}
Encoding: UTF-8
LazyData: true{vignette_builder}
KeepSource: true
a  # ignore JS config files/folders
node_modules/
coverage/
src/
lib/
.babelrc
.builderrc
.eslintrc
.npmignore
.editorconfig
.eslintignore
.prettierrc
.circleci
.github

# demo folder has special meaning in R
# this should hopefully make it still
# allow for the possibility to make R demos
demo/.*\.js
demo/.*\.html
demo/.*\.css

# ignore Python files/folders
setup.py
usage.py
setup.py
requirements.txt
MANIFEST.in
CHANGELOG.md
test/
# CRAN has weird LICENSE requirements
LICENSE.txt
^.*\.Rproj$
^\.Rproj\.user$
z% Auto-generated: do not edit by hand
\docType{{package}}
\name{{{package_name}-package}}
\alias{{{package_name}}}
\title{{{pkg_help_title}}}
\description{{
{pkg_help_description}
}}
\author{{
\strong{{Maintainer}}: {maintainer}
}}
a+  
dash_assert_valid_wildcards <- function (attrib = list("data", "aria"), ...)
{
    args <- list(...)
    validation_results <- lapply(names(args), function(x) {
        grepl(paste0("^(", paste0(attrib, collapse="|"), ")-[a-zA-Z0-9_-]+$"),
            x)
    })
    if (FALSE %in% validation_results) {
        stop(sprintf("The following props are not valid in this component: '%s'",
            paste(names(args)[grepl(FALSE, unlist(validation_results))],
                collapse = ", ")), call. = FALSE)
    }
    else {
        return(args)
    }
}
zQ
    wildcard_names = names(dash_assert_valid_wildcards(attrib = list({}), ...))
z9


\item{{...}}{{wildcards allowed have the form: `{}`}}
c                    t          |          }t          |          }t          |                                          }d}d}d}d}	d}
d}t	          d |D                       rAt          |          }d}t                              |                    dd                    }d}d	                    d |D                       }|d d          D ]y}|
                    d          s|d	k    r|                    |           3|t          v r=|                    |           t          j        d
                    ||                      z|
d	                    d |D                       z  }
|	d	                    d |D                       z  }	t                              t!          ||           | |
|||	||||
  
        S )Nprops c              3   @   K   | ]}|                     d           V  dS -*Nendswith.0keys     h/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/dash/development/_r_components_generation.py	<genexpr>z(generate_class_string.<locals>.<genexpr>   .      
3
3#3<<
3
3
3
3
3
3    , ...r   z, wildcard_names, c              3   P   K   | ]!}d |v|dv
d                     |          V  "dS )*)setProps'{}'Nformatr   ps     r   r   z(generate_class_string.<locals>.<genexpr>   sI        s!||@U@Ua@U@U@U@U r   r   zSWARNING: prop "{}" in component "{}" is an R keyword - REMOVED FROM THE R COMPONENTc              3   @   K   | ]}d                      |          V  dS z{}=NULLNr   r   s     r   r   z(generate_class_string.<locals>.<genexpr>   0       H H!1!1!!4!4 H H H H H Hr   c              3   v   K   | ]4}|d k    rd                     |          nd                     |          V  5dS )childrenz{0}={0}z{}=childrenNr   r   s     r   r   z(generate_class_string.<locals>.<genexpr>   s_       # #  !J	M4H4H4K4K# # # # # #r   )
funcnamenamedefault_argtext	wildcardswildcard_declarationdefault_paramtextproject_shortname
prop_nameswildcard_namespackage_name)snake_case_to_camel_caser   listkeysanyget_wildcards_rwildcard_templater   replacejoinr   remover   warningswarnr_component_stringformat_fn_name)r&   r   r+   prefixr.   	prop_keysr(   r)   r-   r*   r'   accepted_wildcardsr,   items                 r   generate_class_stringr@      s(   +,=>>L &&&EUZZ\\""IINO

3
3
3
3
333 ,,Y77	077&&tR00 
  
 ,   "+    J
 !!! 
 
== 		$*"4"4T""""ZT"""M6&t$$	   tyy H Hi H H HHHHO  # ## # #   
 $$--'1++%! %   r   c                    t           j                            dt          j                               t          j        |          }t          |dg           t          |dg           z   }|                     d          }t          |          }t                              |          }g }g }t          |          dk    rt          t          |                    D ]}	||	         }
|
d         }t          |
          }d|v r|                    d	          d         }nd
                    |          }d|v rd                    |          }d}nd                    |          }d}|t                               |||||||          gz  }d                    |          }nt          |          dk    rr|d         }	|	d         }t          |	          }d|v rd                    |          }d}nd                    |          }d}t$                              ||||||          }d                    ||t&          g          }|S )aC  Dynamically generate R function to supply JavaScript and CSS dependency
    information required by the dash package for R.

    Parameters
    ----------
    project_shortname = component library name, in snake case

    Returns
    -------
    function_string = complete R function code to provide component features
    r   _js_dist	_css_distversion)rpkgnamer   relative_package_pathdash_.{}cssr   NULL)dep_nameproject_verrE   r+   script_namecss_nameasync_or_dynamicz,
)r+   rM   rE   rN   rO   rP   r	   )syspathinsertosgetcwd	importlibimport_modulegetattrgetr/   frame_open_templater   lenrangeget_async_typesplitframe_element_templater6   frame_body_templateframe_close_template)pkg_datar+   modalldistrM   rE   function_frame_openfunction_framefunction_frame_bodydepcurr_deprpprP   rL   rO   rN   function_strings                    r   generate_js_metadatarl      sj    HOOAry{{###

!"3
4
4Cc:r**WS+r-J-JJG,,y))K'(9::H .44h4GGN 7||aW&& 	= 	=Cs|H23C-h77#~~99S>>!,;;'899||!==--$$mmC00!&--% +%&7 +%%5 .  
 
N #(**^"<"<;	=< 
W		aj)*)#..C<<}}S))H KK --,,KH188/##- 9 
 
 gg	13GH O r   c                 8   d}|                                  D ]}|dv r|| |         }t          |t                    s(d                    |                                          }n!t          |                                          }d                    ||          }|S )Nr	   )asyncdynamicr   z	, {} = {})r1   
isinstanceboolr   lowerstrupper)rh   rP   r   keyvals       r   r]   r]   V  s    xxzz ? ?&&&XFfd++ -v||~~66V**,,*11#v>>r   c                 >    | dk    r|S d                     | |          S )Nr	   z
\{}{{
{}}}r   )tagcodes     r   wrapry   e  s&    
byy  d+++r   c                    t          ||           dz   }d}d}d}d}	d}
t                                                    }t          d |D                       rt	          |          }	d}|dd         D ];}|                    d          s|t          v s|dk    r|                    |           <|d	                    d
 |D                       z  }|d                    fd|D                       z  }t          j
        dd|          }t          j
        dd|          }d|v r-|                    d          d                                         }|dk    r"||z  }|t                              |	          z  }t          j                            d|          }t#          |dd          5 }|                    t&                              | t)          j        |dd          ||
|                    dd                               ddd           n# 1 swxY w Y   |d|v r|                    d          }fd|D             pdgd         }d}|rd|                                v r|t1          dt1          |                    d          rdnd|d                             z  }t#          |d d          5 }|                    |dz              ddd           dS # 1 swxY w Y   dS dS dS dS dS )!a  Write R documentation file (.Rd) given component name and properties.

    Parameters
    ----------
    name = the name of the Dash component for which a help file is generated
    props = the properties of the component
    description = the component's description, inserted into help file header
    prefix = the DashR library prefix (optional, can be a blank string)
    rpkg_data = package metadata (optional)

    Returns
    -------
    writes an R help file to the man directory for the generated R package
    z.Rdr	   zQnamed list of JSON elements corresponding to React.js properties and their valuesc              3   @   K   | ]}|                     d           V  dS r   r   r   s     r   r   z"write_help_file.<locals>.<genexpr>  r   r   r   Nr   r   r   c              3   @   K   | ]}d                      |          V  dS r!   r   r   s     r   r   z"write_help_file.<locals>.<genexpr>  r"   r   z

c              3      K   | ]@}d                      |t          |         d                   |         d                   V  AdS )z\item{{{}}}{{{}{}}}typedescriptionN)r   print_r_type)r   r   r   s     r   r   z"write_help_file.<locals>.<genexpr>  sj          	%%|E!HV,--uQx/F	
 	
     r   z(?<!\\)%z\%z**Example Usage**r   manwutf-8encoding<   F)widthbreak_long_words
 )r%   r&   r'   	item_text
value_textr   
r_examplesc                 F    g | ]}|                     d           k    |S )r&   )rY   )r   er%   s     r   
<listcomp>z#write_help_file.<locals>.<listcomp>  s-    >>>AEE&MMX$=$=1$=$=$=r   rx   examplesdontrunza+)r;   r0   r1   r2   r3   r   r   r7   r6   resubr^   rstripwildcard_help_templater   rT   rR   openwritehelp_stringtextwrapfillr5   rY   ry   )r&   r   r   r<   	rpkg_data	file_namer(   r'   r   r>   r   r=   r?   	file_pathfexthe_exresultfar%   s    `                 @r   write_help_filer   k  s    fd++H5 IIOI eJUZZ\\""I

3
3
3
3
333 ,Y77	 !!! # #== 	#$*"4"4
8J8JT"""tyy H Hi H H HHHHO     	     I &e[99K{E955I k))!''(;<<Q?FFHHG9$+223EFFF	 UI..I	iw	/	/	/ 
1	! (#2! ! ! $%'//c::  	 		
 	
 	

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 !:!:]]<((>>>>b>>>H4&!L 	(f--d&**Y"7"7?YYRPP  F i888 (B$'''( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( !:!:	( 	(--s%   0AHH H K&&K*-K*c                    t          |          }t          | ||||           d}t          | |||          }t          ||           dz   }t          j                            d|          }	t          |	dd          5 }
|
                    |           |
                    |           d d d            n# 1 swxY w Y   t          d
                    |                     d S )	Nr   %# AUTO GENERATED FILE - DO NOT EDIT

.RRr   r   r   zGenerated {})r   r   r@   r;   rT   rR   r6   r   r   printr   )r&   r   r   r+   r<   r   import_stringclass_stringr   r   r   s              r   write_class_filer     s    &&&E D%fi@@@=M(u6GPPLvt,,t3IS),,I	iw	/	/	/ 1		               
.

	
*
*+++++s   =+B44B8;B8c                 ,   t          | |          }d}t          j                            d          st          j        d           t          j                            d|          }t          |dd          5 }|                    |           |r|                    t                     ddd           n# 1 swxY w Y   t          j                            d          rt          j
        d           t          j        d           t          j        |          D ]\  }}}	|	D ]}
t          j                            |
          d	         }|d
v r,t          j                            t          j                            dt          j                            ||                              }t          j                            |          st          j        |           t          j        t          j                            ||
          |           dS )zWrite an internal (not exported) R function to return all JS
    dependencies as required by dash.

    Parameters
    ----------
    project_shortname = hyphenated string, e.g. dash-html-components

    Returns
    -------
    )rb   r+   
internal.Rr   r   r   r   Nz	inst/depsr   )z.pyz.pycz.jsonz
inst/deps/)rl   rT   rR   existsmakedirsr6   r   r   wildcard_helpershutilrmtreewalksplitextrelpathcopy)rb   r+   has_wildcardsrk   r   r   r   rel_dirname_	filenamesfilename	extensiontarget_dirnames                r   write_js_metadatar     s'    +->  O I 7>># 
CS),,I	iw	/	/	/ %1	    	%GGO$$$% % % % % % % % % % % % % % % 
w~~k"" #k"""K%'W->%?%? M M!Q	! 	M 	MH((2215I444W\\ "'//+?P"Q"Q  N 7>>.11 ,N+++K[(;;^LLLL	MM Ms   92B77B;>B;c                    t          |          }d}	d}
|                     d          }||                    d          r*|                    d|                     dd                    }|                    d          r*|                    d|                     dd                    }|                    d          r)d                    |                    dd                    }	n,|                     dd          }|                     dd          }|                     d	d
          }|r@d|                    d                                          z   }t          j        dd|          }|r=|                    d                                          }t          j        dd|          }|r=|                    d                                          }t          j        dd|          }d| v r| d                             dd          }nd}t          dt          j	                   d| v r|                     dd          }nd}t          dt          j	                   |                     d          }|
                    d          d         }|
                    d          d         dd         }|
                    d          d         }|                    dd          d         }|                     d|                     d                    }d|vr/t          dt          j	                   t          j        d           |V|                    d          r*d                    |                    dd                    }
nd                     |||          }
t          j                            d!          s6t          j                            d"          s|                     d#d          }nM|                     d#d          d$z   }t          j                            d!          st          j        d"d!           d%}d}|
                    d          |
                    d          z   }t#          t$          |          }|r|D ]}|d&                    |          z  }t          j                            d'          r%d(}d)|vrd*|vr|d+z  }|                    d          }nd}t          j                            d,|d-z             }t+          | ||           t-          d.d/d01          5 }|                    |           |                    |           |                    |           ddd           n# 1 swxY w Y   t-          d2d/d01          5 }|                    t0                     ddd           n# 1 swxY w Y   t2                              |||||
|||||	|||3          } t-          d4d/d01          5 }!|!                    |            ddd           n# 1 swxY w Y   ||                    d          rt4                              ||                    d          |                    d          ||5          }"t-          |d6d01          5 }#|#                    |"           ddd           dS # 1 swxY w Y   dS dS dS )7zGenerate documents for R package creation.

    Parameters
    ----------
    pkg_data
    rpkg_data
    project_shortname
    export_string
    package_depends
    package_imports
    package_suggests
    has_wildcards

    Returns
    -------
    r	   r&   Npkg_help_titler   pkg_help_descriptionpkg_copyrightz
Copyright: {}rD   z0.0.1r   ,z
(,(?![ ]))bugsurlzGWarning: a URL for bug reports was not provided. Empty string inserted.)filehomepagez@Warning: a homepage URL was not provided. Empty string inserted.authorz <r   r   r      
maintainer<zError, aborting R package generation: R packages require a properly formatted author field or installation will fail. Please include an email address enclosed within < > brackets in package.json. pkg_authorsz
Authors@R: {}zD
Authors@R: person("{}", "{}", role = c("aut", "cre"), email = "{}")LICENSEzLICENSE.txtlicensez + file LICENSEr   z
import({})
	vignettesz
VignetteBuilder: knitrknitr	rmarkdownz, knitr, rmarkdownr   z-package.Rd	NAMESPACEzw+r   r   z.Rbuildignore)r.   package_titlepackage_descriptionpackage_versionpackage_rauthorspackage_dependspackage_importspackage_suggestspackage_licensepackage_copyrightpackage_urlpackage_issuesvignette_builderDESCRIPTION)r.   r   r   lib_namer   r   )r/   rY   r   striplstripr   r   r   rQ   stderrr^   rsplitexitrT   rR   isfilesymlinkfilterrq   r   r6   r   r   r   rbuild_ignore_stringdescription_templatepkghelp_stub)$rb   r   r+   export_stringr   r   r   r   r.   r   r   r   r   r   r   r   r   package_authorpackage_author_namepackage_author_emailpackage_author_fnpackage_author_lnr   r   r   packages_stringrpackage_listrpackager   pkghelp_stub_pathr   f2description_stringf3pkghelpf4s$                                       r   generate_rpkgr     s   < ,,=>>L||F##H==)** 	%MM (,,}b"A"A M ==/00 	"+--&]B(G(G# # ==)) 	 1 8 8or22! !
 !]B77&ll="==ll9g66O  G!6!6s!;!;!B!B!D!DD&oFF G)//44;;==&oFF I+11#66==??6-7GHH!&)--eR883	
 	
 	
 	
 Xll:r22N	
 	
 	
 	

 \\(++N(..t44Q7)//55a8"=+11#66q9+223::2>lHLL,B,BCCJ
.  E 	
 	
 	
 	
 	=='' 	077mR00     gmm!#46J    GNN9%% 1)F)F 1",,y"55",,y"558IIw~~i(( 	1J}i000=MO#))$///2G2G2M2MMM4//M A% 	A 	AH/66x@@@OO	w~~k"" 5***{BR/R/R 44/66t<<UL=,HII
 h 1=AAA	k4'	2	2	2 !a			   ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
 
otg	6	6	6 '"
%&&&' ' ' ' ' ' ' ' ' ' ' ' ' ' ' .44!#/')'')'+%) 5    
mTG	4	4	4 %
#$$$% % % % % % % % % % % % % % % ==/00 		"")))(}}-=>>%.]]3I%J%J!% *  G 'w??? "2!!!" " " " " " " " " " " " " " " " " " 		" 		"sI   /A U;;U?U?V??WWX%%X),X)[[[c                     |                      d          }|d         d                    d |dd          D                       z   S )Nr   r   r	   c              3   >   K   | ]}|                                 V  d S )N)
capitalize)r   r   s     r   r   z+snake_case_to_camel_case.<locals>.<genexpr>  s*      88Q!,,..888888r   r   )r^   r6   )
namestringss     r   r/   r/     sG    AQ4"''88!ABB%8888888r   c                     | r| t          |          z   S t          |d                                         |dd          z             S )Nr   r   )r/   rr   )r<   r&   s     r   r;   r;     sE     706666#DGMMOOd122h$>???r   c	           
          t          ||          }
d}|                                D ]%}t          d |d         D                       rd} n&t          ||| |
||||           d S )NFc              3   @   K   | ]}|                     d           V  dS r   r   r   s     r   r   z#generate_exports.<locals>.<genexpr>  s.      EEcs||D!!EEEEEEr   r   T)make_namespace_exportsvaluesr2   r   )r+   
componentsmetadatarb   r   r<   r   r   r   kwargsr   r   component_datas                r   generate_exportsr    s     +:v>>M M"//++  EE^G-DEEEEE 	 ME	 	 	 	 	 	r   c                    d}| D ]W}|                     d          s@t          |          t          vr*t          |          dvr|d                    |          z  }Xg }ddgfd| D             z   }g }t	          j        d          D ]?}|                     d	          r(||vr$|t          j                            d|          gz  }@|D ]t}t          |d
d          5 }|	                                }	t          j        dd|	t          j                  }	|	                    dd                              dd          }	t          j        dd|	          }	t          j        dd|	          }	t          |	          dz   }
t          |	          |
k     rNt          |	          }
t          j        dd|	          }	t          j        dd|	          }	t          |	          |
k     Nt          j        d|	          }|D ]/}|d         }|d         dk    r||vr|                    |           0	 d d d            n# 1 swxY w Y   v|d                    d |D                       z  }|S )Nr	   r   )r   r$   zexport({}{})
zutils.Rr   c                 <    g | ]}d                      |          S )z{}{}.Rr   )r   	componentr<   s     r   r   z*make_namespace_exports.<locals>.<listcomp>   s4     , , ,/8	**, , ,r   r   r   rr   r   z#.*$)flagsr   r   z'([^'\\]|\\'|\\[^'])*'z''z"([^"\\]|\\"|\\[^"])*"z""r   z\(([^()]|\(\))*\)z()z\{([^{}]|\{\})*\}rI   z6([^A-Za-z0-9._]|^)([A-Za-z0-9._]+)\s*(=|<-)\s*functionr   rH   c              3   @   K   | ]}d                      |          V  dS )z
export({})Nr   )r   functions     r   r   z)make_namespace_exports.<locals>.<genexpr>L  s0      TT|228<<TTTTTTr   )r   rs   r   r   rT   listdirrR   r6   r   readr   r   Mr5   r[   findallappend)r  r<   r   r  	rfilelistomitlistfnlistscriptrfiler  prev_lenmatchesmatchfns    `            r   r  r    s   M H H	""4((	HIj00I&>>>-44VYGGGM I<( , , , ,<F, , , H F*S// 5 5??4   	5V8%;%;"',,sF3344I !& !&%w///  	&6A vr1BD111A 		$$$,,T377A 0$::A0$::A
 1vvzHa&&8##q66F/q99F/q99 a&&8## jI G
 ! & &1Xa5C<<Bf$4$4MM"%%%	&9 	&  	&  	&  	&  	&  	&  	&  	&  	&  	&  	&  	&  	&  	&  	&D TYYTTVTTTTTTMs    EH44H8	;H8	c                 p      fd}t          d d d d d d d d	  fd
 fd fd fd||          S )z8Mapping from the PropTypes js type object to the R type.c            
         d                     d                    d  d         D                       d                     d                    d  d                                         D                                           S )Nz lists containing elements {}.
{}r   c              3   @   K   | ]}d                      |          V  dS )r   Nr   r   ts     r   r   z;get_r_prop_types.<locals>.shape_or_exact.<locals>.<genexpr>U  s.      EE1fmmA&&EEEEEEr   valuez+Those elements have the following types:
{}r   c           
   3   x   K   | ]5\  }}t          |||d          |                    dd          d          V  6dS )requiredr   r	   r   )	prop_nametype_objectr*  r   
indent_numN)create_prop_docstring_rrY   )r   r+  props      r   r   z;get_r_prop_types.<locals>.shape_or_exact.<locals>.<genexpr>W  sm       	 	 (	4 ,"+$(!%j!1$(HH]B$?$?#$  	 	 	 	 	 	r   )r   r6   itemsr,  s   r   shape_or_exactz(get_r_prop_types.<locals>.shape_or_exactS  s    299IIEEG0DEEEEE:AA		 	 	 ,7w+?+E+E+G+G	 	 	 	 	 
 
 	
r   c                      dS )Nzunnamed list r4  r   r   <lambda>z"get_r_prop_types.<locals>.<lambda>e  s    n r   c                      dS )Nlogicalr4  r4  r   r   r5  z"get_r_prop_types.<locals>.<lambda>f  s    Y r   c                      dS )Nnumericr4  r4  r   r   r5  z"get_r_prop_types.<locals>.<lambda>g  s    y r   c                      dS )N	characterr4  r4  r   r   r5  z"get_r_prop_types.<locals>.<lambda>h  s    { r   c                      dS )Nz
named listr4  r4  r   r   r5  z"get_r_prop_types.<locals>.<lambda>i  s    | r   c                      dS )Nz9logical | numeric | character | named list | unnamed listr4  r4  r   r   r5  z"get_r_prop_types.<locals>.<lambda>j  s    O r   c                      dS )Nzdash componentr4  r4  r   r   r5  z"get_r_prop_types.<locals>.<lambda>k  s    ( r   c                      dS )Nz8a list of or a singular dash component, string or numberr4  r4  r   r   r5  z"get_r_prop_types.<locals>.<lambda>l  s    O r   c                  t    d                     d                    d  d         D                                 S )Nza value equal to: {}r   c              3   f   K   | ],}d                      t          |d                             V  -dS )rI   r(  N)r   rs   r&  s     r   r   z5get_r_prop_types.<locals>.<lambda>.<locals>.<genexpr>o  s8      QQqdkk#aj//22QQQQQQr   r(  r   r6   r1  s   r   r5  z"get_r_prop_types.<locals>.<lambda>n  s;    +22IIQQK<PQQQQQ
 
 r   c                  t    d                     d                    d  d         D                                 S )NrI   z | c              3      K   | ]9}t          |          d k    d                    t          |                    V  :dS )r	   rI   N
get_r_typer   )r   subTypes     r   r   z5get_r_prop_types.<locals>.<lambda>.<locals>.<genexpr>s  sU        g&&",, Jw//00,,,, r   r(  rB  r1  s   r   r5  z"get_r_prop_types.<locals>.<lambda>r  sG    dkkJJ  *73    
 
 r   c                      dt           d                   dk    r(d                    t           d                             ndz   S )Nr0   r(  r	   z of {}srE  r1  s   r   r5  z"get_r_prop_types.<locals>.<lambda>z  sP     k'233r99   K,@!A!ABBB	 r   c                  T    d                     t           d                             S )Nz.list with named elements and values of type {}r(  )r   rF  r1  s   r   r5  z"get_r_prop_types.<locals>.<lambda>  s(    IPP{7+,,
 
 r   )arrayrq   numberstringobjectr2   elementnodeenumunionarrayOfobjectOfshapeexact)dict)r,  r2  s   ` r   get_r_prop_typesrW  P  s    
 
 
 
 
" $$  ""##OO((OO
 
 
 

 
 
 

 
 
 

 
 
 
 K& & & &r   Fc                     | d         }t          |           }d| v r| d         s|                     dd          dk    rdS ||v r ||                     }|S dS )aP  
    Convert JS types to R types for the component definition
    Parameters
    ----------
    type_object: dict
        react-docgen-generated prop type dictionary
    is_flow_type: bool
    indent_num: int
        Number of indents to use for the docstring for the prop
    Returns
    -------
    str
        Python type string
    r&   r1  computedr~   r	   r  )rW  rY   )r,  is_flow_typer-  js_type_namejs_to_r_types	prop_types         r   rF  rF    s|     v&L$===Mk!!
# 	"??62&&*44r}$$/M,/11	2r   c                 V    t          |                                           }|r|dz  }|S )Nz. )rF  r   )typedata
typestrings     r   r   r     s3    H%%0022J d
r   c                    t          |||dz             }d|z  }d|v rd                    || |||rdnd          S d	                    || |rd
                    |          nd|dk    rd                    |          nd|rdnd          S )aS  
    Create the Dash component prop docstring
    Parameters
    ----------
    prop_name: str
        Name of the Dash component prop
    type_object: dict
        react-docgen-generated prop type dictionary
    required: bool
        Component is required?
    description: str
        Dash component description
    indent_num: int
        Number of indents to use for the context block
        (creates 2 spaces for every indent)
    is_flow_type: bool
        Does the prop use Flow types? Otherwise, uses PropTypes
    Returns
    -------
    str
        Dash component prop docstring
    r   )r,  rZ  r-  z  r   z^{indent_spacing}- {name} ({is_required}): {description}. {name} has the following type: {type}r*  optional)indent_spacingr&   r~   r   is_requiredz;{indent_spacing}- {name} ({type}{is_required}){description}z{}; r	   z: {}rE  )r+  r,  r*  r   r-  rZ  r_type_namerc  s           r   r.  r.    s    2 lzTU~  K J&N{44:F- '*2BJJ
 5; 5 5		
 IOO%+6>V]];'''B3>"3D3DV]];///""*:JJ
 P   r   c                 ^    d}|d                     d | D                       z  }|dk    rd}|S )Nr	   r   c              3   j   K   | ].}|                     d           d                    |          V  /dS )r   r   N)r   r   r   s     r   r   z"get_wildcards_r.<locals>.<genexpr>  s?      SS!**TBRBRS6==++SSSSSSr   rK   )r6   )r=   r(   s     r   r3   r3     s@    ISSYSSSSSSIB	r   )NN)Fr   )F)(rT   rQ   r   rV   r   r   r8   _all_keywordsr   _py_components_generationr   r:   rZ   r_   r`   ra   r   r   r   r   r   r4   r   r@   rl   r]   ry   r   r   r   r   r/   r;   r  r  rW  rF  r   r.  r3   r4  r   r   <module>rj     s
   				 



       				  % % % % % % 4 4 4 4 4 4 , D D  
. " H&  = = =B[ [ [D
 
 
, , ,X( X( X(B , , , ,<3M 3M 3Mn{" {" {"B9 9 9@ @ @! ! !H< < <~: : :z   :   MR/ / / /d    r   