+
    û¦Ög	  ã                  ó|  € ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
 ]
'       d   ^ RIHt ^ RIHtHt  ^ RIHt Rt]P&                  ! ]4      t ! R
 R4      t ! R R4      t];QJ d    . R ]! ^^4       4       F  NK  	  5M! R ]! ^^4       4       4      t ! R R]4      tR#   ] d    R	t Lti ; i)é    )ÚannotationsN)Ú
HTMLParser)ÚTYPE_CHECKING)ÚPage)Ú
AnchorLinkÚTableOfContents)ÚlunrTFc                  ób   € ] tR t^tRtR R ltR R ltR R ltR R	 ltR
 R lt	R R lt
RtR# )ÚSearchIndexzm
Search index is a collection of pages and sections (heading
tags and their following content are sections).
c               ó   € V ^8„  d   QhRR/# ©é   ÚreturnÚNone© )Úformats   "ÚD/usr/lib/python3/dist-packages/mkdocs/contrib/search/search_index.pyÚ__annotate__ÚSearchIndex.__annotate__   s   € ÷ ñ  Dñ ó    c                	ó    € . V n         Wn        R # ©N©Ú_entriesÚconfig)Úselfr   s   &,r   Ú__init__ÚSearchIndex.__init__   s   € Ø$&ˆŒØŽr   c               ó    € V ^8„  d   QhRRRR/# )r   Úid_ú
str | Noner   zAnchorLink | Noner   )r   s   "r   r   r   #   s   € ÷ ñ ¨
ð Ð7Hñ r   c                óŠ   € V F<  pVP                   V8X  d   Vu # V P                  VP                  V4      pVf   K:  Vu # 	  R# )z`
Given a table of contents and HTML ID, iterate through
and return the matched item in the TOC.
N)ÚidÚ_find_toc_by_idÚchildren)r   Útocr    Útoc_itemÚ
toc_item_rs   &&&  r   r$   ÚSearchIndex._find_toc_by_id#   sH   € ó
 ˆHØ�{‰{˜cÔ!Ø’Ø×-Ñ-¨h×.?Ñ.?ÀÓEˆJØÔ%Ø!Ò!ñ ñ r   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   Útitler!   ÚtextÚstrÚlocr   r   r   )r   s   "r   r   r   0   s.   € ÷ Nñ N 
ð N°#ð N¸Cð NÀDñ Nr   c                ó¸   € VP                  RR4      p\        P                  ! RRVP                  4       4      pV P                  P                  RVRVRV/4       R# )z:A simple wrapper to add an entry, dropping bad characters.ô   Â Ú z[ \t\n\r\f\v]+r+   r,   ÚlocationN)ÚreplaceÚreÚsubÚstripr   Úappend)r   r+   r,   r.   s   &&&&r   Ú
_add_entryÚSearchIndex._add_entry0   sJ   € à�|‰|˜H cÓ*ˆÜ�vŠvÐ'¨¨d¯j©j«lÓ;ˆà�‰×Ñ˜g u¨f°d¸JÈÐLÖMr   c               ó    € V ^8„  d   QhRRRR/# )r   Úpager   r   r   r   )r   s   "r   r   r   7   s   € ÷ Fñ F¨4ð F°Dñ Fr   c                óÞ  € \        4       pVP                  f   Q hVP                  VP                  4       VP                  4        VP                  pV P
                  R,          R8X  d   VP                  P                  R4      MRpV P                  VP                  WCR7       V P
                  R,          R9   d2   VP                   F  pV P                  WQP                  V4       K!  	  R# R# )zv
Create a set of entries in the index for a page. One for
the page itself and then one for each of its' heading
tags.
NÚindexingÚfullÚ
Ú ©r+   r,   r.   )r>   Úsections)ÚContentParserÚcontentÚfeedÚcloseÚurlr   Ústripped_htmlÚrstripr8   r+   ÚdataÚcreate_entry_for_sectionr&   )r   r;   ÚparserrG   r,   Úsections   &&    r   Úadd_entry_from_contextÚ"SearchIndex.add_entry_from_context7   s·   € ô “ˆØ�|‰|Ò'Ð'Ð'Ø�‰�D—L‘LÔ!Ø�‰Œð �h‰hˆð 59·K±KÀ
Õ4KÈvÔ4Uˆv×#Ñ#×*Ñ*¨4Ô0Ð[]ˆØ�‰˜dŸj™j¨tˆÔ=à�;‰;�zÕ"Ð&:Ô:Ø!Ÿ;œ;�Ø×-Ñ-¨g·x±xÀÖEó 'ñ ;r   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   rM   ÚContentSectionr&   r   Úabs_urlr-   r   r   r   )r   s   "r   r   r   Q   s2   € ÷ Yñ YØ%ðYØ,;ðYØFIðYà	ñYr   c                ó  € V P                  W!P                  4      pV P                  R,          R8X  d   RP                  VP                  4      MRpVe1   V P                  VP                  WSVP                  ,           R7       R# R# )zt
Given a section on the page, the table of contents and
the absolute url for the page create an entry in the
index.
r=   r>   r1   r@   NrA   )r$   r#   r   Újoinr,   r8   r+   rG   )r   rM   r&   rR   r'   r,   s   &&&&  r   rK   Ú$SearchIndex.create_entry_for_sectionQ   se   € ð ×'Ñ'¨¯Z©ZÓ8ˆà)-¯©°ZÕ)@ÀFÔ)Jˆs�x‰x˜Ÿ™Ô%ÐPRˆØÒØ�O‰O (§.¡.°tÈ8Ï<É<ÕAWˆOÖXñ  r   c               ó   € V ^8„  d   QhRR/# ©r   r   r-   r   )r   s   "r   r   r   _   s   € ÷ ,ñ , sñ ,r   c                ó‚  € RV P                   RV P                  /p\        P                  ! VRR\        R7      pV P                  R,          R9   Ed&    \
        P                  P                  \
        P                  P                  \
        P                  P                  \        4      4      R4      p\        P                  ! RV.\        P                  \        P                  \        P                  RR	7      pVP                  V4      w  rVV'       gJ   \        P                  ! V4      VR
&   \        P                  ! VRRR7      p\         P#                  R4       V# \         P%                  RV 24        V# V P                  R,          R8X  dz   \*        '       dY   \-        RRV P                   V P                  R,          R7      pVP/                  4       VR
&   \        P                  ! VRRR7      pV# \         P%                  R4       V#   \&        \(        3 d$   p\         P%                  RT 24        Rp?T# Rp?ii ; i)zPython to json conversion.Údocsr   T)Ú	sort_keysÚ
separatorsÚdefaultÚprebuild_indexÚnodezprebuild-index.jszutf-8)ÚstdinÚstdoutÚstderrÚencodingÚindex)rZ   r[   z,Pre-built search index created successfully.z)Failed to pre-build search index. Error: NÚpythonr2   Úlang)ÚrefÚfieldsÚ	documentsÚ	languagesa  Failed to pre-build search index. The 'python' method was specified; however, the 'lunr.py' library does not appear to be installed. Try installing it with 'pip install lunr'. If you are using any language other than English you will also need to install 'lunr[languages]'.)Ú,Ú:)Tr^   )r+   r,   )r   r   ÚjsonÚdumpsr-   ÚosÚpathrT   ÚdirnameÚabspathÚ__file__Ú
subprocessÚPopenÚPIPEÚcommunicateÚloadsÚlogÚdebugÚwarningÚOSErrorÚ
ValueErrorÚ	haslunrpyr	   Ú	serialize)	r   Ú
page_dictsrJ   Úscript_pathÚpÚidxÚerrÚeÚlunr_idxs	   &        r   Úgenerate_search_indexÚ!SearchIndex.generate_search_index_   sÏ  € à˜dŸm™m¨X°t·{±{ÐCˆ
Ü�zŠz˜*°ÀÔUXÔYˆà�;‰;Ð'Õ(¨NÕ:ðMÜ Ÿg™gŸl™lÜ—G‘G—O‘O¤B§G¡G§O¡O´HÓ$=Ó>Ð@Só�ô ×$Ò$Ø˜[Ð)Ü$Ÿ/™/Ü%Ÿ?™?Ü%Ÿ?™?Ø$ô�ð Ÿ=™=¨Ó.‘�ßÜ*.¯*ª*°S«/�J˜wÑ'ÜŸ:š: j¸DÈZÔX�DÜ—I‘IÐLÔMð. ˆô+ —K‘KÐ"KÈCÈ5Ð QÕRð* ˆð% �[‰[Ð)Õ*¨hÔ6ß‹yÜØ"Ø,Ø"Ÿm™mØ"Ÿk™k¨&Õ1ô	�ð '/×&8Ñ&8Ó&:�
˜7Ñ#Ü—z’z *¸ÈÔT�ð ˆô —‘ðZôð ˆøô) œZÐ(ô MÜ—‘ÐGÈÀsÐK×LÐLð& ˆûð)Mús   ÁDH
 ÅH
 È
H>ÈH9È9H>r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r$   r8   rN   rK   r†   Ú__static_attributes__r   r   r   r   r      s-   † ñõ
õõNõFõ4Y÷,ñ ,r   r   c                  ó0   € ] tR t^ŽtRtRR R lltR tRtR# )rQ   za
Used by the ContentParser class to capture the information we
need when it is parsing the HTML.
Nc               ó(   € V ^8„  d   QhRRRRRRRR/# )r   r,   zlist[str] | Noner    r!   r+   r   r   r   )r   s   "r   r   ÚContentSection.__annotate__”   s2   € ÷ ñ àðð ðð ð	ð
 
ñr   c                	ó@   € T;'       g    . V n         W n        W0n        R # r   ©r,   r#   r+   )r   r,   r    r+   s   &&&&r   r   ÚContentSection.__init__”   s   € ð —J�J˜BˆŒ	ØŒØŽ
r   c                	ó¸   € V P                   VP                   8H  ;'       d;    V P                  VP                  8H  ;'       d    V P                  VP                  8H  # r   r’   )r   Úothers   &&r   Ú__eq__ÚContentSection.__eq__ž   sB   € Ø�y‰y˜EŸJ™JÑ&×\Ð\¨4¯7©7°e·h±hÑ+>×\Ð\À4Ç:Á:ÐQV×Q\ÑQ\ÑC\Ð\r   )r#   r,   r+   )NNN)rˆ   r‰   rŠ   r‹   rŒ   r   r–   r�   r   r   r   rQ   rQ   Ž   s   † ñ÷
ö]r   rQ   c              #  ó,   "  € T F
  pR V 2x € K  	  R# 5i)ÚhNr   )Ú.0Úxs   & r   Ú	<genexpr>rœ   ¢   s   é € Ð2¡k �q˜˜•W£kùs   ‚c                  ól   a € ] tR t^¥tRtR V 3R lltR R ltR R ltR R	 lt]	R
 R l4       t
RtV ;t# )rC   zŠ
Given a block of HTML, group the content under the preceding
heading tags which can then be used for creating an index
for that section.
c               ó   € V ^8„  d   QhRR/# r   r   )r   s   "r   r   ÚContentParser.__annotate__¬   s   € ÷ ,ñ ,¨4ñ ,r   c                	ó`   <€ \         SV `  ! V/ VB  . V n        R V n        RV n        . V n        R # )NF)Úsuperr   rJ   rM   Úis_header_tagÚ_stripped_html)r   ÚargsÚkwargsÚ	__class__s   &*,€r   r   ÚContentParser.__init__¬   s3   ø€ Ü‰Ò˜$Ð) &Ò)à*,ˆŒ	Ø.2ˆŒØ"ˆÔØ)+ˆÖr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   Útagr-   Úattrszlist[tuple[str, str | None]]r   r   r   )r   s   "r   r   rŸ   ´   s#   € ÷ *ñ * 3ð *Ð/Kð *ÐPTñ *r   c                óø   € V\         9  d   R# RV n        \        4       V n        V P                  P                  V P                  4       V F+  pV^ ,          R8X  g   K  V^,          V P                  n        K-  	  R# )z&Called at the start of every HTML tag.NTr#   )Ú_HEADER_TAGSr¢   rQ   rM   rJ   r7   r#   )r   r©   rª   Úattrs   &&& r   Úhandle_starttagÚContentParser.handle_starttag´   s]   € ð ”lÔ"Ùð "ˆÔÜ%Ó'ˆŒØ�	‰	×Ñ˜Ÿ™Ô&ãˆDØ�A�w˜$ŽØ"& q¥'�—‘–ó r   c               ó    € V ^8„  d   QhRRRR/# )r   r©   r-   r   r   r   )r   s   "r   r   rŸ   Ä   s   € ÷ #ñ # ð #¨ñ #r   c                ó.   € V\         9  d   R# RV n        R# )z$Called at the end of every HTML tag.NF)r¬   r¢   )r   r©   s   &&r   Úhandle_endtagÚContentParser.handle_endtagÄ   s   € ð ”lÔ"Ùà"ˆÖr   c               ó    € V ^8„  d   QhRRRR/# )r   rJ   r-   r   r   r   )r   s   "r   r   rŸ   Ì   s   € ÷ 8ñ 8 ð 8¨ñ 8r   c                ó  € V P                   P                  V4       V P                  f   R# V P                  '       d   WP                  n        R# V P                  P
                  P                  VP                  R4      4       R# )z)Called for the text contents of each tag.Nr?   )r£   r7   rM   r¢   r+   r,   rI   )r   rJ   s   &&r   Úhandle_dataÚContentParser.handle_dataÌ   s^   € à×Ñ×"Ñ" 4Ô(à�<‰<Òñ
 ð
 ××ÐØ!%�L‰LÖà�L‰L×Ñ×$Ñ$ T§[¡[°Ó%6Ö7r   c               ó   € V ^8„  d   QhRR/# rW   r   )r   s   "r   r   rŸ   à   s   € ÷ .ñ .˜sñ .r   c                	ó8   € R P                  V P                  4      # )r?   )rT   r£   )r   s   &r   rH   ÚContentParser.stripped_htmlß   s   € à�y‰y˜×,Ñ,Ó-Ð-r   )r£   rJ   r¢   rM   )rˆ   r‰   rŠ   r‹   rŒ   r   r®   r²   r¶   ÚpropertyrH   r�   Ú__classcell__)r¦   s   @r   rC   rC   ¥   s5   ø† ñ÷,ð ,õ*õ #õ8ð& ô.ó ö.r   rC   )Ú
__future__r   rl   Úloggingrn   r4   rs   Úhtml.parserr   Útypingr   Úmkdocs.structure.pagesr   Úmkdocs.structure.tocr   r   r	   r}   ÚImportErrorÚ	getLoggerrˆ   rx   r   rQ   ÚtupleÚranger¬   rC   r   r   r   Ú<module>rÇ      s­   ðÝ "ã Û Û 	Û 	Û Ý "Ý  çÝ+ß@ðÝà€Ið ×Ò˜Ó!€÷rñ r÷j]ñ ]÷( ˆuÑ2¡e¨A¨q¤kÓ2�u‰uÑ2¡e¨A¨q¤kÓ2Ó2€ô<.�Jö <.øðe ô Ø‚Iðús   ¾B/ Â/	B;Â:B;