
    i                         d Z ddlZddlmZ ej
                  rddlmZ ddlm	Z	 dddddd	Z
d
ZddgZdeddfdZdddefdZy)zBrowse one of the largest collections of copyleft icons
that can be used for own projects (e.g. apps, websites).

.. _Website: https://lucide.dev

    N)EngineResults)SXNG_Response)OnlineParamszhttps://lucide.dev/TJSON)websitewikidata_idofficial_api_documentationuse_official_apiresultsz*https://cdn.jsdelivr.net/npm/lucide-staticimagesiconsqueryparamsr   c                 (    t          d|d<   | |d<   |S )Nz
/tags.jsonurlr   )cdn_base_url)r   r   s     %/root/searxng/searx/engines/lucide.pyrequestr      s     #nJ/F5MF7OM    respr   returnc                    t               }| j                  d   j                         j                  d      dt        t
        t        t
           f   dt        ffd}t        || j                         j                               }|D ]Q  \  }}t         d| d}|j                  |j                  j                  d||d	j                  |      |d
d             S |S )Nr    resultr   c                 F    | \  }}D ]  }||v r y|D ]	  }||v s  y  y)NTF )r   	icon_nametagsparttagquery_partss        r   is_result_matchz!response.<locals>.is_result_match(   sD     	4 	 Dy   3; 		  r   z/icons/z.svgzimages.htmlz, SVG)templater   titlecontentimg_src
img_format)r   search_paramslowersplittuplestrlistboolfilterjsonitemsr   addtypesLegacyResultjoin)r   resr"   filtered_resultsr   r   r'   r!   s          @r   responser9   $   s    
/C$$W-335;;C@Kc49n 5 $  otyy{/@/@/BC+ 
	4!N')D9II"" -"&#yy&"'		

 Jr   )__doc__typingtsearx.result_typesr   TYPE_CHECKINGextended_typesr   search.processors.onliner   aboutr   
categoriesr-   r   r9   r   r   r   <module>rC      sn     ,??,5 %"&	 < 
3  !? !} !r   