
    ^f`                     v    d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddZdd	Zdd
Z eee          ZdS )zN
Provide urlresolver functions that return fully qualified URLs or view names
    )NoReverseMatch)reverse)lazy)api_settings)replace_query_paramNc                     || S t           j        g}|D ]+}|r'||j        v r|j        |         }t          | ||          } ,| S )z
    Given an incoming request, and an outgoing URL representation,
    append the value of any built-in query parameters.
    )r   URL_FORMAT_OVERRIDEGETr   )urlrequest	overridesparamvalues        H/var/www/html/env/lib/python3.11/site-packages/rest_framework/reverse.pypreserve_builtin_query_paramsr      se    
 
 	(I  9 9 	9ew{**K&E%c5%88CJ    c                     t          |dd          }|5	  |j        | ||||fi |}n2# t          $ r t          | ||||fi |}Y nw xY wt          | ||||fi |}t	          ||          S )z
    If versioning is being used then we pass any `reverse` calls through
    to the versioning scheme instance, so that the resulting URL
    can be modified if needed.
    versioning_schemeN)getattrr   r   _reverser   )viewnameargskwargsr   formatextraschemer   s           r   r   r       s     W1488F	M &.4&RRERRCC 	M 	M 	M 8T67FLLeLLCCC	M
 xvwHH%HH(g666s   ( AAc                 j    |	|pi }||d<   t          | f||d|}|r|                    |          S |S )z
    Same as `django.urls.reverse`, but optionally takes a request
    and returns a fully qualified URL, using the request to get the base URL.
    Nr   )r   r   )django_reversebuild_absolute_uri)r   r   r   r   r   r   r   s          r   r   r   4   sZ    
 2!x

EV
E
Eu
E
EC /))#...Jr   )N)NNNN)__doc__django.urlsr   r   r   django.utils.functionalr   rest_framework.settingsr   rest_framework.utils.urlsr   r   r   strreverse_lazy r   r   <module>r(      s     ' & & & & & 1 1 1 1 1 1 ( ( ( ( ( ( 0 0 0 0 0 0 9 9 9 9 9 9   (7 7 7 7(    tGS!!r   