o
    ™�jÍ  ã                   @   s   d e dB de fdd„ZdS )Ú
ip_addressNÚreturnc                 C   sØ   | sdS |   ¡ }|dv rdS | d¡sh| d¡sh| d¡sh| d¡sh| d¡sh| d	¡sh| d
¡sh| d¡sh| d¡sh| d¡sh| d¡sh| d¡sh| d¡sh| d¡sh| d¡sh| d¡sh| d¡sh| d¡rjdS dS )a  
    Resolves client IP address to a country name.
    For local/demo testing, identifies private/localhost IPs cleanly.
    Returns 'Unknown' if IP is missing or unresolvable.
    
    This function is isolated so it can later be replaced with a GeoIP provider.
    ÚUnknown)z	127.0.0.1z::1Ú	localhostÚ
testclientzLocal / Demoz10.z192.168.z172.16.z172.17.z172.18.z172.19.z172.20.z172.21.z172.22.z172.23.z172.24.z172.25.z172.26.z172.27.z172.28.z172.29.z172.30.z172.31.)ÚstripÚ
startswith)r   Ú
cleaned_ip© r	   ú;/web/html/dev/chatbot/backend/app/utils/country_resolver.pyÚresolve_country   sV   ÿþýüûúùø	÷
öõôóòñðïîr   )Ústrr   r	   r	   r	   r
   Ú<module>   s    