ó
    Uujð  ã                   óT   • S r SSKrSSKJs  Jr  SSKJrJ	r	J
r
  SSKJr  S rS rS rg)au  The reference list leads with the answer's own source.

The UI activates the first reference that carries a box, so the id order
handed to the grounding resolver decides the default highlight. A scalar
payload names the cell it was read from; that id must come first whether the
model cited it late or not at all. Payloads without a source keep the
model's citation order.
é    N)ÚProseÚScalarÚUnanswerable)Úcited_ids_source_firstc                  ó  • [        SSS9n / SQn[        X5      n/ SQo2U:H  oD(       GdX  [        R                  " SU4SX#45      S[        R
                  " 5       ;   d  [        R                  " [        5      (       a  [        R                  " [        5      OSS	[        R
                  " 5       ;   d  [        R                  " U 5      (       a  [        R                  " U 5      OS	S
[        R
                  " 5       ;   d  [        R                  " U5      (       a  [        R                  " U5      OS
[        R                  " U5      [        R                  " U5      S.-  nSSU0-  n[        [        R                  " U5      5      eS =n=pCg )Nú2.7út15-12-1©ÚvalueÚ	source_id)út15-line-12r	   út15-0-1)r	   r   r   ©ú==)z9%(py4)s
{%(py4)s = %(py0)s(%(py1)s, %(py2)s)
} == %(py7)sr   ÚpayloadÚcited)Úpy0Úpy1Úpy2Úpy4Úpy7zassert %(py9)sÚpy9©
r   r   Ú
@pytest_arÚ_call_reprcompareÚ@py_builtinsÚlocalsÚ_should_repr_global_nameÚ	_safereprÚAssertionErrorÚ_format_explanation)r   r   Ú@py_assert3Ú@py_assert6Ú@py_assert5Ú@py_format8Ú@py_format10s          Ú?/home/mande/repo/quber/tests/playground/test_reference_order.pyÚtest_source_cell_moves_to_frontr(      sÎ   € Ü˜5¨JÑ7€GÚ2€EÜ! 'Ó1Ð[Ò5[Ð[Ð5[Ñ[×[×[×[Ó[Ð1×[×[×[×[×[Õ[Ô!×[×[×[Ñ[Ô!×[×[×[×[×[Ö[ '×[×[×[Ñ[ '×[×[×[×[×[Ö[¨5×[×[×[Ñ[¨5×[×[Õ[Ð1×[×[Ó[Ð5[×[×[×[×[×[×[Ô[ó    c                  ó¤  • [        SSS9n S/n[        X5      nSS/o2U:H  oD(       Gd"  [        R                  " SU4SX#45      S[        R
                  " 5       ;   d  [        R                  " [        5      (       a  [        R                  " [        5      OSS[        R
                  " 5       ;   d  [        R                  " U 5      (       a  [        R                  " U 5      OS[        R                  " U5      [        R                  " U5      [        R                  " U5      S	.-  nS
SU0-  n[        [        R                  " U5      5      eS =n=n=pCg )Nr   r	   r
   r   r   )z9%(py5)s
{%(py5)s = %(py0)s(%(py1)s, %(py3)s)
} == %(py8)sr   r   )r   r   Úpy3Úpy5Úpy8zassert %(py10)sÚpy10r   )r   Ú@py_assert2Ú@py_assert4Ú@py_assert7r#   Ú@py_format9Ú@py_format11s          r'   Ú test_uncited_source_is_prependedr4      s¾   € Ü˜5¨JÑ7€GØ,9¨?ÐZÔ! 'Ó;ÐZÀ
ÈMÐ?ZÐZÐ?ZÑZ×Z×Z×ZÓZÐ;×Z×Z×Z×Z×ZÕZÔ!×Z×Z×ZÑZÔ!×Z×Z×Z×Z×ZÖZ '×Z×Z×ZÑZ '×Z×ZÕZ¨?×Z×ZÓZÐ;×Z×ZÓZÐ?Z×Z×Z×Z×Z×Z×ZÖZr)   c            
      ó\
  • SS/n Sn[        US9n[        X 5      nSS/oCU:H  oU(       GdŠ  [        R                  " SU4SX445      S[        R
                  " 5       ;   d  [        R                  " [        5      (       a  [        R                  " [        5      OSS[        R
                  " 5       ;   d  [        R                  " [         5      (       a  [        R                  " [         5      OS[        R                  " U5      [        R                  " U5      S	[        R
                  " 5       ;   d  [        R                  " U 5      (       a  [        R                  " U 5      OS	[        R                  " U5      [        R                  " U5      S
.-  nSSU0-  n[        [        R                  " U5      5      eS =n=n=n=pTSn[        US9n[        X 5      nSS/oCU:H  oU(       GdŠ  [        R                  " SU4SX445      S[        R
                  " 5       ;   d  [        R                  " [        5      (       a  [        R                  " [        5      OSS[        R
                  " 5       ;   d  [        R                  " [        5      (       a  [        R                  " [        5      OS[        R                  " U5      [        R                  " U5      S	[        R
                  " 5       ;   d  [        R                  " U 5      (       a  [        R                  " U 5      OS	[        R                  " U5      [        R                  " U5      S
.-  nSSU0-  n[        [        R                  " U5      5      eS =n=n=n=pTSn[        US9n[        X 5      nSS/oCU:H  oU(       GdŠ  [        R                  " SU4SX445      S[        R
                  " 5       ;   d  [        R                  " [        5      (       a  [        R                  " [        5      OSS[        R
                  " 5       ;   d  [        R                  " [        5      (       a  [        R                  " [        5      OS[        R                  " U5      [        R                  " U5      S	[        R
                  " 5       ;   d  [        R                  " U 5      (       a  [        R                  " U 5      OS	[        R                  " U5      [        R                  " U5      S
.-  nSSU0-  n[        [        R                  " U5      5      eS =n=n=n=pTg )NÚaÚbr   )r   r   )z^%(py8)s
{%(py8)s = %(py0)s(%(py5)s
{%(py5)s = %(py1)s(value=%(py3)s)
}, %(py6)s)
} == %(py11)sr   r   r   )r   r   r+   r,   Úpy6r-   Úpy11zassert %(py13)sÚpy13Úbecause)Útext)z]%(py8)s
{%(py8)s = %(py0)s(%(py5)s
{%(py5)s = %(py1)s(text=%(py3)s)
}, %(py6)s)
} == %(py11)sr   znot printed)Úreason)z_%(py8)s
{%(py8)s = %(py0)s(%(py5)s
{%(py5)s = %(py1)s(reason=%(py3)s)
}, %(py6)s)
} == %(py11)sr   )r   r   r   r   r   r   r   r   r    r!   r   r   )r   r/   r0   r1   Ú@py_assert10Ú@py_assert9Ú@py_format12Ú@py_format14s           r'   Ú0test_payloads_without_source_keep_citation_orderrB      s¿  € Ø�#ˆJ€EØ/4ÐK¤&¨uÑ"5ÐKÔ!Ð"5Ó=ÐKÀ#ÀsÀÐKÀÑK×K×K×KÓKÐ=×K×K×K×K×KÕKÔ!×K×K×KÑKÔ!×K×K×K×K×KÖK¤&×K×K×KÑK¤&×K×KÕK¨u×K×KÓKÐ"5×K×K×K×K×KÔK°u×K×K×KÑK°u×K×KÕKÐ=×K×KÓKÀ×K×K×K×K×K×K×KØ-6ÐM¤%¨YÑ"7ÐMÔ!Ð"7Ó?ÐMÀCÈÀ:ÐMÀ:ÑM×M×M×MÓMÐ?×M×M×M×M×MÕMÔ!×M×M×MÑMÔ!×M×M×M×M×MÖM¤%×M×M×MÑM¤%×M×MÕM¨Y×M×MÓMÐ"7×M×M×M×M×MÔM¸×M×M×MÑM¸×M×MÕMÐ?×M×MÓMÀ:×M×M×M×M×M×M×MØ6CÐZ¤,°mÑ"DÐZÔ!Ð"DÓLÐZÐQTÐVYÐPZÐZÐPZÑZ×Z×Z×ZÓZÐL×Z×Z×Z×Z×ZÕZÔ!×Z×Z×ZÑZÔ!×Z×Z×Z×Z×ZÖZ¤,×Z×Z×ZÑZ¤,×Z×ZÕZ°m×Z×ZÓZÐ"D×Z×Z×Z×Z×ZÔZÀe×Z×Z×ZÑZÀe×Z×ZÕZÐL×Z×ZÓZÐPZ×Z×Z×Z×Z×Z×Z×ZÐZr)   )Ú__doc__Úbuiltinsr   Ú_pytest.assertion.rewriteÚ	assertionÚrewriter   Úquber.playground.answers.shapesr   r   r   Úquber.playground.appr   r(   r4   rB   © r)   r'   Ú<module>rK      s,   ðñ÷ „ × GÑ GÝ 7ò\ò[ó
[r)   