
    0?hwL                         S SK r S SKrS SKrS SKrSSKJr  \R                  S    S:  a  \\4r	\rO\4r	\
r   SS jr   SS jrS rS r     SS	 jr    SS
 jrS rS rS rS rS rS rS rSqS rS rg)    N   )Parser   c	                 >    U R                  5       n	[        XX#XEUUUS9	$ )a  Deserialize ``fp`` (a ``.read()``-supporting file-like object
containing a JSON document) to a Python object.

Supports almost the same arguments as ``json.load()`` except that:
    - the `cls` keyword is ignored.
    - an extra `allow_duplicate_keys` parameter supports checking for
      duplicate keys in a object; by default, this is True for
      compatibility with ``json.load()``, but if set to False and
      the object contains duplicate keys, a ValueError will be raised.
)encodingclsobject_hookparse_float	parse_intparse_constantobject_pairs_hookallow_duplicate_keys)readloads)
fpr   r   r	   r
   r   r   r   r   ss
             Q/var/www/ev-aguas/ev-aguas-proceso/venv/lib/python3.13/site-packages/json5/lib.pyloadr      s,     		A3( .#4&:	< <    c	                   ^^ Ub   S5       e[         R                  S   S:  a  [        S5      n	O[        S5      n	[        X	5      (       a  U=(       d    SnU R	                  U5      n U (       d  [        S5      e[        U S5      n
U
R                  5       u  pnU(       a  [        U5      eS	 nU(       a  UnOT(       a  U4S
 jnOS nU(       d  UmU4S jnU=(       d    [        nU=(       d    [        nU=(       d    Un[        XXEU5      $ )a  Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a
JSON5 document) to a Python object.

Supports the same arguments as ``json.load()`` except that:
    - the `cls` keyword is ignored.
    - an extra `allow_duplicate_keys` parameter supports checking for
      duplicate keys in a object; by default, this is True for
      compatibility with ``json.load()``, but if set to False and
      the object contains duplicate keys, a ValueError will be raised.
z!Custom decoders are not supportedr   r    r   zutf-8z!Empty strings are not legal JSON5z<string>c                 X    [        U R                  SS5      R                  SS5      5      $ )NInfinityinfNaNnan)floatreplace)r   s    r   _fp_constant_parser"loads.<locals>._fp_constant_parserS   s%    QYYz5199%GHHr   c                 &   > T" [        U 5      5      $ Ndict)pairsr	   s    r   <lambda>loads.<locals>.<lambda>Y   s    DK 8r   c                     [        U 5      $ r"   r#   )r%   s    r   r&   r'   [   s    Ur   c                    > [        U T5      $ r"   )_reject_duplicate_keys)r%   _orig_dictifys    r   r&   r'   _   s     6um Lr   )sysversion_infotype
isinstancedecode
ValueErrorr   parser   int	_walk_ast)r   r   r   r	   r
   r   r   r   r   decodable_typeparserasterr_r   dictifyr+   s      `            @r   r   r   4   s     ;;;;;
Qbc!$$&wHHX<==Az"F,,.KCa
oI #	8+L&K SI#:':NS;>JJr   c                     [        5       nU  H'  u  p4X2;   a  [        SU5      eUR                  U5        M)     U" U 5      $ )Nz"Duplicate key "%s" found in object)setr1   add)r%   r:   keyskeyr9   s        r   r*   r*   h   s?    5D;A3GG  5>r   c           
         U S:X  a  g U S:X  a  gU S:X  a  gU u  pVUS:X  ai  UR                  S5      (       d  UR                  S5      (       a  U" US	S
9$ SU;   d  SU;   d  SU;   a  U" U5      $ SU;   d  SU;   a  U" U5      $ U" U5      $ US:X  a  U$ US:X  a4  / nU H$  u  p[        XX#U5      n
UR                  X45        M&     U" U5      $ US:X  a  U V s/ sH  n [        XX#U5      PM     sn $ [        SU -   5      es  sn f )NNoneTrueTFalseFnumber0x0X   )base.eEr   r   stringobjectarrayzunknown el: )
startswithr4   append	Exception)elr:   r
   r   r   tyvr%   r?   val_exprvals              r   r4   r4   p   s+   	V|	V|	W}EB	X~<<d!3!3QR((AXSAXq>!1_
!!$$Q<	X~	X~MCH{*,CLL#$  u~	W}B "{~N 	
NR'
((s   C<c                 T    UR                  [        [        XUXEXgUXXUS95      5        g)a  Serialize ``obj`` to a JSON5-formatted stream to ``fp`` (a ``.write()``-
supporting file-like object).

Supports the same arguments as ``json.dump()``, except that:

- The ``cls`` keyword is not supported.
- The ``encoding`` keyword is ignored; Unicode strings are always written.
- By default, object keys that are legal identifiers are not quoted;
  if you pass ``quote_keys=True``, they will be.
- By default, if lists and objects span multiple lines of output (i.e.,
  when ``indent`` >=0), the last item will have a trailing comma
  after it. If you pass ``trailing_commas=False``, it will not.
- If you use a number, a boolean, or ``None`` as a key value in a dict,
  it will be converted to the corresponding JSON string value, e.g.
  "1", "true", or "null". By default, ``dump()`` will match the `json`
  modules behavior and produce malformed JSON if you mix keys of
  different types that have the same converted value; e.g.,
  ``{1: "foo", "1": "bar"}`` produces '{"1": "foo", "1": "bar"}', an
  object with duplicated keys. If you pass ``allow_duplicate_keys=False``,
  an exception will be raised instead.
- If `quote_keys` is true, then keys of objects will be enclosed in quotes,
  as in regular JSON. Otheriwse, keys will not be enclosed in quotes unless
  they contain whitespace.
- If `trailing_commas` is false, then commas will not be inserted after
  the final elements of objects and arrays, as in regular JSON. Otherwise,
  such commas will be inserted.
- If `allow_duplicate_keys` is false, then only the last entry with a given
  key will be written. Otherwise, all entries with the same key will be
  written.

Calling ``dump(obj, fp, quote_keys=True, trailing_commas=False,                    allow_duplicate_keys=True)``
should produce exactly the same output as ``json.dump(obj, fp).``
)objskipkeysensure_asciicheck_circular	allow_nanr   indent
separatorsdefault	sort_keys
quote_keystrailing_commasr   N)writestrdumps)rX   r   rY   rZ   r[   r\   r   r]   r^   r_   r`   ra   rb   r   kwargss                  r   dumprg      s7    R HHS3&4*&",,@B C Dr   c                     UR                  SS5      b   S5       eUc  Uc  SnOSnU=(       d    [        nU(       a  [        5       nOSnSnSn[        XX#XFXxU	XUXU5      u  nnU$ )a  Serialize ``obj`` to a JSON5-formatted ``str``.

Supports the same arguments as ``json.dumps()``, except that:

- The ``cls`` keyword is not supported.
- The ``encoding`` keyword is ignored; Unicode strings are always written.
- By default, object keys that are legal identifiers are not quoted;
  if you pass ``quote_keys=True``, they will be.
- By default, if lists and objects span multiple lines of output (i.e.,
  when ``indent`` >=0), the last item will have a trailing comma
  after it. If you pass ``trailing_commas=False``, it will not.
- If you use a number, a boolean, or ``None`` as a key value in a dict,
  it will be converted to the corresponding JSON string value, e.g.
  "1", "true", or "null". By default, ``dump()`` will match the `json`
  modules behavior and produce malformed JSON if you mix keys of
  different types that have the same converted value; e.g.,
  ``{1: "foo", "1": "bar"}`` produces '{"1": "foo", "1": "bar"}', an
  object with duplicated keys. If you pass ``allow_duplicate_keys=False``,
  an exception will be raised instead.
- If `quote_keys` is true, then keys of objects will be enclosed in quotes,
  as in regular JSON. Otheriwse, keys will not be enclosed in quotes unless
  they contain whitespace.
- If `trailing_commas` is false, then commas will not be inserted after
  the final elements of objects and arrays, as in regular JSON. Otherwise,
  such commas will be inserted.
- If `allow_duplicate_keys` is false, then only the last entry with a given
  key will be written. Otherwise, all entries with the same key will be
  written.

Calling ``dumps(obj, quote_keys=True, trailing_commas=False,                     allow_duplicate_keys=True)``
should produce exactly the same output as ``json.dumps(obj).``
r   Nz!Custom encoders are not supported)z, : ),ri   r   F)get_raise_type_errorr<   _dumps)rX   rY   rZ   r[   r\   r   r]   r^   r_   r`   ra   rb   r   rf   seenlevelis_keyr9   rT   s                      r   re   re      s    N ::eT"*O,OO*>'J&J**GuEF#Z)/Cv'DAq Hr   c                    U SL a  SnGOGU SL a  SnGO>U c  SnGO7U [        S5      :X  a  U(       a  SnGO[        5       eU [        S5      :X  a  U(       a  S	nO[        5       e[        U [         5      (       a/  [        R                  " U 5      (       a  U(       a  S
nO[        5       e[        U [
        5      (       a?  U(       a+  [        U 5      (       a  U	(       d  [        U 5      (       d  SU 4$ S[        X5      4$ [        U [        5      (       a  [        R                  U 5      nO-[        U [         5      (       a  [         R                  U 5      nOS nU(       a)  Ub  SSU-  4$ U(       a  g[        S[        U 5      -  5      eUb  SU4$ Ub^  SnU
(       a  Sn[        U5      [        :X  a+  US:  a  SSU-  U-  -   nUSSU-  US-
  -  -   -  nO!SnUS-  nOSX]-  -   nUSX]S-
  -  -   -  nOSnSnUu  nnUU-  nUb-  [        U 5      nUU;   a  [        S5      eUR                  U5        [!        U S5      (       a,  [!        U S5      (       a  [#        XUX4UXgUXXUS-   UUUU5      nOY[!        U S5      (       a+  [!        U S5      (       a  [%        XUX4UXgUXXUS-   UUU5      nO['        U" U 5      XX4UXgUXXUU5      S   nUb  UR)                  W5        SU4$ )NTtrueFfalsenullr   r   z-infz	-Infinityr   z"%s")FNinvalid key %sr   rj   r   
 r   zCircular reference detected.r>   __getitem____iter__)r   r1   r/   mathisnan	str_types	_is_ident_is_reserved_word	_dump_strr3   __repr__	TypeErrorreprr.   idr=   hasattr
_dump_dict_dump_arrayrm   remove)rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   r   rn   ro   rp   r   end_str
indent_stritem_sepkv_sepis                        r   rm   rm     s    d{			e	A,	f	A,	C		DJJsOOA,	C	#	#y~~j%c**9Ys111	C		 LL	C		NN3=!##(49455}QwG<3z!C&L5$88
4#,%!)"<<<!
4.Jtf	222G
!Hf
HsG9;<<HHQK sF] ; ;sl%&!I!+519W> 
m	$	$j)A)A|&6"Y",EAI *g7 73<!f	'u
  A!8Or   c                    U (       d  gU(       a  [        U R                  5       5      nOU R                  5       nSU-   nSn[        5       nU H  n[        UXUXEXgUXUXSS9u  nnU(       ai  U(       d.  UU;   a  [	        S[        U5      -  5      eUR                  U5        U(       a  UU-  nUUU-   [        U U   XX4UXgUXUXSS9S   -   -  nUS-  nM  U(       a  M  [        S	[        U5      -  5      e   UUS
-   -  nU$ )Nz{}{r   T)rp   zduplicate key %sFr   ru   })sortedr>   r<   rm   r1   r   r=   r   )rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   r   rn   ro   r   r   r   r   r>   r   num_items_addednew_keysr?   	valid_keykey_strs                            r   r   r   o  s2    chhj!xxzzAOuH#C$-z$-$.$8$(>	7 'h&$%7$s)%CDDLL)X6!F3s8X+9f+5	+5+?+/u%F
 GH%I I IA q O,tCy899/ 2 4AHr   c                     U (       d  gSU-   UR                  U  Vs/ sH  n[        UXUXEXgXU
UXS5      S   PM     sn5      -   U-   S-   $ s  snf )Nz[][Fr   ])joinrm   )rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   r   rn   ro   r   r   r   rR   s                     r   r   r     s     :MM DG	H DGR	 ""hn"+Z"+"6"&u	6 78	9 DG	H II   Hs    A
c                    S/nU  GH  nUS:X  a  UR                  S5        M  US:X  a  UR                  S5        M6  US:X  a  UR                  S5        MO  US:X  a  UR                  S5        Mh  US	:X  a  UR                  S
5        M  US:X  a  UR                  S5        M  US:X  a  UR                  S5        M  US:X  a  UR                  S5        M  US:X  a  UR                  S5        M  US:X  a  UR                  S5        M  US:X  a  UR                  S5        GM  U(       d  UR                  U5        GM3  [        U5      nUS:  a  US:  a  UR                  U5        GM^  US:  a  UR                  SSU-  -   5        GM~  US-
  nSUS-	  -   nSUS-  -   nUR                  S Xg4-  5        GM     S!R                  U5      S-   $ )"N"\z\\z\"u    z\u2028u    z\u2029rv   z\nz\rz\bz\f	z\tz\v z\0       i   z\uz%04xi   
   i   i  z\u%04x\u%04xr   )rP   ordr   )rX   rZ   retchorV   highlows           r   r   r     s   %C:JJv3YJJu9_JJy!9_JJy!4ZJJu4ZJJu4ZJJu4ZJJu4ZJJu4ZJJu4ZJJuJJrNBABw1s7

2U

56A:-.'k+e,

+tk9:G H 88C=3r   c                     [        U 5      n U (       a  [        U S   5      (       d
  U S   S;  a  gU SS   H  n[        U5      (       a  M  US;  d  M    g   g)Nr   )$r9   Fr   T)rd   _is_id_start_is_id_continue)kr   s     r   r}   r}     sT    AAL1&&1Q4|+Cer""r'=  r   c                 4    [         R                  " U 5      S;   $ )N)LuLlLiLtLmLoNlunicodedatacategoryr   s    r   r   r     s    # (2 2 2r   c                 4    [         R                  " U 5      S;   $ )N)r   r   r   r   r   r   r   NdMnMcPcr   r   s    r   r   r     s"    # (J J Jr   c                     [         c-  [        R                  " SSR                  / SQ5      -   S-   5      q [         R	                  U 5      S L$ )N(|)$breakcasecatchclassconstcontinuedebuggerr_   deletedoelseenumexportextendsrs   finallyforfunctionifimportin
instanceofnewrt   returnsuperswitchthisthrowrr   trytypeofvarvoidwhilewithz)$)_reserved_word_rerecompiler   match)r   s    r   r~   r~     sU      JJsSXX %7
 %. %(J K%( %L ""1%T11r   c                 0    [        S[        U 5      -  5      e)Nz%s is not JSON5 serializable)r   r   )rX   s    r   rl   rl     s    
2T#Y>
??r   )NNNNNNNT)FTTTNNNNFFTT)rz   r   r,   r   r6   r   r-   rd   unicoder|   r3   longr   r   r*   r4   rg   re   rm   r   r   r   r}   r   r   r   r~   rl    r   r   <module>r      s     	 
  AgI
CID EI@D"<, EIAE#1Kh)@ EI;?!&+/"	.Db BF<@"'GK=@k\*Z&R2
J
  +2\@r   