+
    PV-jÀ  ã                   ó  a € R  t0 t ^ RIHtHt ^ RIHt ^ RIHtHtH	t	H
t
 ^ RIHt RRRRRR	/R
RR	/RRR	/RRRR^ ///t] ^ k  ! R R]4      tR R ltR R ltR R lt ! R R]4      tRRR
RRRRRRR/R R lltRtRt] ^k R# )!é    )Ú	AnnotatedÚAny)ÚDoc)ÚAfterValidatorÚ	BaseModelÚFieldÚmodel_validator)ÚStreamingResponseÚtypeÚobjectÚ
propertiesÚdataÚstringÚeventÚidÚretryÚintegerÚminimumc                   ó   € ] tR t^tRtRtRtR# )ÚEventSourceResponseaÊ  Streaming response with `text/event-stream` media type.

Use as `response_class=EventSourceResponse` on a *path operation* that uses `yield`
to enable Server Sent Events (SSE) responses.

Works with **any HTTP method** (`GET`, `POST`, etc.), which makes it compatible
with protocols like MCP that stream SSE over `POST`.

The actual encoding logic lives in the FastAPI routing layer. This class
serves mainly as a marker and sets the correct `Content-Type`.
ztext/event-stream© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú
media_typeÚ__static_attributes__r   ó    Ú\/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/fastapi/sse.pyr   r      s   † ñ
ð %„Jr   r   c                óX   € V ^8„  d   QhR\         R,          R\         R\         R,          /# )é   ÚvNÚ
field_nameÚreturn©Ústr)Úformats   "r    Ú__annotate__r)   $   s)   € ÷ ñ œ# �*ð ´#ð ¼#À½*ñ r   c                 óH   € V e   RV 9   g   RV 9   d   \        RV R24      hV # )NÚÚ
zSSE 'z' must be a single line)Ú
ValueError)r#   r$   s   &&r    Ú_check_single_liner.   $   s-   € Ø‚}˜$ !œ) t¨q¤yÜ˜5  Ð,CÐDÓEÐEØ€Hr   c                óL   € V ^8„  d   QhR\         R,          R\         R,          /# ©r"   r#   Nr%   r&   )r(   s   "r    r)   r)   *   s"   € ÷ *ñ *¤ d¥
ð *¬s°T­zñ *r   c                 ó   € \        V R 4      # )r   )r.   ©r#   s   &r    Ú_check_event_single_liner3   *   s   € Ü˜a Ó)Ð)r   c                óL   € V ^8„  d   QhR\         R,          R\         R,          /# r0   r&   )r(   s   "r    r)   r)   .   s"   € ÷ 'ñ '”s˜T•zð '¤c¨D¥jñ 'r   c                 óF   € V e   RV 9   d   \        R4      h\        V R4      # )NÚ z)SSE 'id' must not contain null charactersr   )r-   r.   r2   s   &r    Ú_check_id_validr7   .   s&   € Ø‚}˜ œÜÐDÓEÐEÜ˜a Ó&Ð&r   c                   ór   a € ] tR t^4t o RtRtRtRtRtRt	Rt
]! RR7      V 3R lR l4       tV 3R ltRtV tR# )	ÚServerSentEventaL  Represents a single Server-Sent Event.

When `yield`ed from a *path operation function* that uses
`response_class=EventSourceResponse`, each `ServerSentEvent` is encoded
into the [SSE wire format](https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream)
(`text/event-stream`).

If you yield a plain object (dict, Pydantic model, etc.) instead, it is
automatically JSON-encoded and sent as the `data:` field.

All `data` values **including plain strings** are JSON-serialized.

For example, `data="hello"` produces `data: "hello"` on the wire (with
quotes).
NÚafter)Úmodec                ó   <€ V ^8„  d   QhRR/# )r"   r%   r9   r   )r(   Ú__classdict__s   "€r    r)   ÚServerSentEvent.__annotate__•   s   ø€ ÷ ñ Ð'8ñ r   c                óT   € V P                   e   V P                  e   \        R4      hV # )Nz“Cannot set both 'data' and 'raw_data' on the same ServerSentEvent. Use 'data' for JSON-serialized payloads or 'raw_data' for pre-formatted strings.)r   Úraw_datar-   )Úselfs   &r    Ú_check_data_exclusiveÚ%ServerSentEvent._check_data_exclusive”   s.   € à�9‰9Ò  T§]¡]Ò%>Üð;óð ð
 ˆr   c                óª  <€ V ^8„  d   Qh/ S[ S[S[! R4      3,          ;R&   S[ S[R,          S[! R4      3,          ;R&   S[ S[R,          S[! S[4      S[! R4      3,          ;R&   S[ S[R,          S[! S[4      S[! R4      3,          ;R	&   S[ S[R,          S[! ^ R
7      S[! R4      3,          ;R&   S[ S[R,          S[! R4      3,          ;R&   # )r"   aB  
            The event payload.

            Can be any JSON-serializable value: a Pydantic model, dict, list,
            string, number, etc. It is **always** serialized to JSON: strings
            are quoted (`"hello"` becomes `data: "hello"` on the wire).

            Mutually exclusive with `raw_data`.
            r   NaQ  
            Raw string to send as the `data:` field **without** JSON encoding.

            Use this when you need to send pre-formatted text, HTML fragments,
            CSV lines, or any non-JSON payload. The string is placed directly
            into the `data:` field as-is.

            Mutually exclusive with `data`.
            r@   zë
            Optional event type name.

            Maps to `addEventListener(event, ...)` on the browser. When omitted,
            the browser dispatches on the generic `message` event. Must be a
            single line.
            r   zó
            Optional event ID.

            The browser sends this value back as the `Last-Event-ID` header on
            automatic reconnection. **Must be a single line** and must not contain
            null (`\0`) characters.
            r   )Úgez×
            Optional reconnection time in **milliseconds**.

            Tells the browser how long to wait before reconnecting after the
            connection is lost. Must be a non-negative integer.
            r   zû
            Optional comment line(s).

            Comment lines start with `:` in the SSE wire format and are ignored by
            `EventSource` clients. Useful for keep-alive pings to prevent
            proxy/load-balancer timeouts.
            Úcomment)	r   r   r   r'   r   r3   r7   Úintr   )r(   r=   s   "€r    r)   r>   4   s/  ø‡ ‚ ñ" ÙÚðó
	
ð	õñ ñ# ñ> Ùˆd�
Úðó
	
ð	õñ ñ? ñZ Ùˆd�
ÚÑ/Ó0Úðó	
ð
	õñ ñ[ ñt 	Ùˆd�
Ú‘Ó'Úðó	
ð
	õ	ñ ñu ñN Ùˆd�
Ú�ŒÚðó	
ð		õñ ñO ñf Ùˆd�
Úðó	
ð		õñ òg r   r   )r   r   r   r   r   r   r@   r   r   r   rF   r	   rB   Ú__annotate_func__r   Ú__classdictcell__)r=   s   @r    r9   r9   4   sg   ø‡ € ñð: 	ð 	ð6 	ð ð4 	ð 
ð2 	ð ð0 	ð 
ð. 	ð ñ ˜'Ô"÷ó #ð÷C ƒ r   r9   Údata_strNrF   c                ó‚  € V ^8„  d   QhR\         \        R,          \        R4      3,          R\         \        R,          \        R4      3,          R\         \        R,          \        R4      3,          R\         \        R,          \        R	4      3,          R
\         \        R,          \        R4      3,          R\        /# )r"   rJ   NzQ
            Pre-serialized data string to use as the `data:` field.
            r   zD
            Optional event type name (`event:` field).
            r   z:
            Optional event ID (`id:` field).
            r   zV
            Optional reconnection time in milliseconds (`retry:` field).
            rF   z@
            Optional comment line(s) (`:` prefix).
            r%   )r   r'   r   rG   Úbytes)r(   s   "r    r)   r)   Ÿ   sè   € ÷ D,ñ D,äÜˆd�
Üðó	
ð	õðD,ô Üˆd�
Üðó	
ð	õðD,ô$ 	Üˆd�
Üðó	
ð	õ	ð%D,ô4 Üˆd�
Üðó	
ð	õð5D,ôD Üˆd�
Üðó	
ð	õðED,ôT ñUD,r   c                óÖ  € . pVe,   VP                  4        F  pVP                  RV 24       K  	  Ve   VP                  RV 24       V e,   V P                  4        F  pVP                  RV 24       K  	  Ve   VP                  RV 24       Ve   VP                  RV 24       VP                  R4       VP                  R4       RP                  V4      P                  R4      # )	z|Build SSE wire-format bytes from **pre-serialized** data.

    The result always ends with `

` (the event terminator).
    z: zevent: zdata: zid: zretry: Ú r,   zutf-8)Ú
splitlinesÚappendÚjoinÚencode)rJ   r   r   r   rF   ÚlinesÚlines   $$$$$  r    Úformat_sse_eventrU   Ÿ   sß   € ð^ €EàÒØ×&Ñ&Ö(ˆDØ�L‰L˜2˜d˜V˜Ö%ñ )ð ÒØ�‰�w˜u˜gÐ&Ô'àÒØ×'Ñ'Ö)ˆDØ�L‰L˜6 $ ˜Ö)ñ *ð 
‚~Ø�‰�t˜B˜4�[Ô!àÒØ�‰�w˜u˜gÐ&Ô'à	‡L�L�ÔØ	‡L�L�ÔØ�9‰9�UÓ×"Ñ" 7Ó+Ð+r   s   : ping

g      .@c                óŠ   € V ^8„  d   Qh/ ^ \         9   d   \        \        \        3,          ;R&   ^\         9   d
   \        ;R&   # )r"   Ú_SSE_EVENT_SCHEMAÚ_PING_INTERVAL)Ú__conditional_annotations__Údictr'   r   Úfloat)r(   s   "r    r)   r)      s:   € × !Ñ !÷ò ”4œœS˜•>ñ ñ "÷T Ò ”Ñ òU "r   )rY   Útypingr   r   Úannotated_docr   Úpydanticr   r   r   r	   Ústarlette.responsesr
   rW   r   r.   r3   r7   r9   rU   ÚKEEPALIVE_COMMENTrX   r)   )rY   s   @r    Ú<module>ra      sß   øðß !Ô !å ß FÓ FÝ 1ð
 ˆHØØ�˜Ð"Ø�&˜(Ð#Øˆv�xÐ Ø�&˜) Y°Ð2ð	ð%Ð ó ô%Ð+ô %õ õ*õ'ôh�iô hðVD,ð 	ðD,ð" 	ð#D,ð2 	ð3D,ðB 	ðCD,ðR 	÷SD,ðP "Ð ð €Õ r   