زIQddlmZddlZddlZddlmZddlmZdZej dZ ej d Z ej d ej ej zZd Zd Zd eeZeedZgdZdZdddeDzdzZdezdzZdezdzezdzZdZej dZej dezdzZej dezdzZej dezdzZej deddzdzZej dezd zZ d!ededed"Z!ej e!ej ej zZ"e#d#Z$e#d$Z%e$e%zd%hzZ&e&d&d'hzZ'e'd(hzxZ(Z)Gd)d*ej*d*d+ej+e,fd,ej+e,fd-ej+e,fd.ej+e-fd/ej+e,fd0ej+e,fd1ej+e,fgZ.ej/dGd7Z0ej/dHd9Z0dId;Z0dJd<Z1ej/dKd=Z2ej/dLd>Z2dMd?Z2dNdBZ3dOdDZ4dPdFZ5dS)Q) annotationsN)LocationParseError)to_str)httphttpsNz%[a-fA-F0-9]{2}z^(?:[a-zA-Z][a-zA-Z0-9+-]*:|/)zS^(?:([a-zA-Z][a-zA-Z0-9+.-]*):)?(?://([^\\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$z(?:[0-9]{1,3}\.){3}[0-9]{1,3}z[0-9A-Fa-f]{1,4}z(?:{hex}:{hex}|{ipv4}))hexipv4)r ls32) z(?:%(hex)s:){6}%(ls32)sz::(?:%(hex)s:){5}%(ls32)sz%(?:%(hex)s)?::(?:%(hex)s:){4}%(ls32)sz2(?:(?:%(hex)s:)?%(hex)s)?::(?:%(hex)s:){3}%(ls32)sz6(?:(?:%(hex)s:){0,2}%(hex)s)?::(?:%(hex)s:){2}%(ls32)sz/(?:(?:%(hex)s:){0,3}%(hex)s)?::%(hex)s:%(ls32)sz'(?:(?:%(hex)s:){0,4}%(hex)s)?::%(ls32)sz&(?:(?:%(hex)s:){0,5}%(hex)s)?::%(hex)sz(?:(?:%(hex)s:){0,6}%(hex)s)?::zCABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._\-~z(?:|c"g|] }|tz S)_subs).0xs /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/urllib3/util/url.py r4s===Aa%i===)z (?:%25|%)(?:[z]|%[a-fA-F0-9]{2})+z\[z)?\]z!(?:[^\[\]%:/?#]|%[a-fA-F0-9]{2})*z!^(/[^?#]*)(?:\?([^#]*))?(?:#.*)?$^$(z)\]$z^(z)(?::0*?(|0|[1-9][0-9]{0,4}))?$zBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-~z !$&'()*+,;=:@/?ceZdZdZ ddfd ZeddZeddZeddZeddZ eddZ ddZ xZ S)Urlz Data structure for representing an HTTP URL. Used as a return value for :func:`parse_url`. Both the scheme and host are normalized as they are both case-insensitive according to RFC 3986. Nscheme str | Noneauthhostport int | Nonepathqueryfragmentc |r|dsd|z}||}t||||||||S)Nr) startswithlowersuper__new__) clsr!r#r$r%r'r(r) __class__s rr.z Url.__new__ds`  ,, :D  \\^^FwwsFD$dE8TTTrreturnc|jS)z@For backwards-compatibility with urlparse. We're nice like that.)r$selfs rhostnamez Url.hostnamets yrstrc@|jpd}|j |d|jzz }|S)z)Absolute path including the query string.rNr)r'r()r4uris r request_urizUrl.request_uriys.i3 : ! 3# #C rc8|j}|j}|||S|d|S)z Authority component as defined in RFC 3986 3.2. This includes userinfo (auth), host and port. i.e. userinfo@host:port Nr)r#netloc)r4userinfor;s r authorityz Url.authoritys59 >X-M)))) )rcR|jdS|jr|jd|jS|jS)z Network location including host and port. If you need the equivalent of urllib.parse's ``netloc``, use the ``authority`` property instead. Nr)r$r%r3s rr;z Url.netlocs; 9 4 9 .i--$)-- -yrc|\}}}}}}}d}|||dzz }|||dzz }|||z }||dt|zz }|||z }||d|zz }||d|zz }|S)a2 Convert self into a url This function should more or less round-trip with :func:`.parse_url`. The returned url may not be exactly the same as the url inputted to :func:`.parse_url`, but it should be equivalent by the RFC (e.g., urls with a blank port will have : removed). Example: .. code-block:: python import urllib3 U = urllib3.util.parse_url("https://google.com/mail/") print(U.url) # "https://google.com/mail/" print( urllib3.util.Url("https", "username:password", "host.com", 80, "/path", "query", "fragment" ).url ) # "https://username:password@host.com:80/path?query#fragment" Nz://rrr#)r6) r4r!r#r$r%r'r(r)urls rrBzUrl.urls6;?7dD$x   6E> !C   4#: C   4KC   3T? "C   4KC   3; C   3> !C rc|jSN)rBr3s r__str__z Url.__str__s xr)NNNNNNN)r!r"r#r"r$r"r%r&r'r"r(r"r)r")r1r")r1r6) __name__ __module__ __qualname____doc__r.propertyr5r9r=r;rBrE __classcell__)r0s@rr r Ps" #UUUUUUU XX * * *X *   X ---X-^rr r!r#r$r%r'r(r) componentr6 allowed_charstyping.Container[str]r1cdSrDrrLrMs r_encode_invalid_charsrQ CrNonecdSrDrrPs rrQrQrRrr"c||St|}td|\}}|dd}||dk}t }t dt|D]}|||dz}t|}|r|dks|dkr| |vr||z }H| dt|d d d  z| S) zfPercent-encodes a URI component without reapplying onto an already percent-encoded component. NcP|dS)Nr)groupupper)matchs rz'_encode_invalid_chars..sekk!nn**,,rzutf-8 surrogatepass%rrr)r _PERCENT_REsubnencodecount bytearrayrangelenorddecodeextendr zfillrX) rLrMpercent_encodings uri_bytesis_percent_encodedencoded_componentibytebyte_ords rrQrQsT y!!I $/#3#3,,i$$ I   /::I*iood.C.CC!  1c)nn % % W WQU#t99  44<< sNNt{{}} ==  %    Xqrr):)A)A)C)C)I)I!)L)L)R)R)T)T!UVVVV  # # % %%rc|d}g}|D];}|dkr |dkr||%|r|<|dr |r|dr|dd|dr|dd|S)Nr.z..rr@)z/.z/..)splitappendpopr+insertendswithjoin)r'segmentsoutputsegments r_remove_path_dot_segmentsr{szz#H F   c>>  d?? MM' " " " "  JJLLL sVvay a }}]## b 88F  rcdSrDrr$r!s r_normalize_hostr~%CrcdSrDrr}s rr~r~*rrc|rB|tvr8t|}|rt|}|r|d\}}|||}|dr|dkr |dd}n |dd}t|t}|d| d|||dS| St|s@td d| dDdS|S) Nrz%25%.c,g|]}t|Sr) _idna_encode)rlabels rrz#_normalize_host..Fs PPPu|E22PPPrrqascii)_NORMALIZABLE_SCHEMES_IPV6_ADDRZ_RErY _ZONE_ID_REsearchspanr+rQ_UNRESERVED_CHARSr,_IPV4_RErrwrr)r$r!is_ipv6rYstartendzone_ids rr~r~/sU  * * *$**400G $**400 (!&AJE3"59oG))%00.W5E5E")!""+")!""+3G=NOOG"6E6l0022JJWJd344jJJJ::<<'^^D)) IIPP 3PPPQQ KrnamebytescZ|sq ddl}n#t$rtddwxYw ||ddS#|j$rtd|ddwxYw|dS)Nrz-Unable to parse URL without the 'idna' moduleT)strict std3_ruleszName 'z' is not a valid IDNA labelr)isasciiidna ImportErrorrr`r, IDNAError)rrs rrrLs <<>>   KKKK   $?    ;;tzz||DT;JJ J~   $::::   ::<<  w ' ''s6)A$$Btargetct|}|st|d|\}}t |t }|t |t }|d|zz }|S)zPercent-encodes a request target so that there are no invalid characters Pre-condition for this function is that 'target' must start with '/'. If that is the case then _TARGET_RE will always produce a match. z is not a valid request URINr) _TARGET_RErYrgroupsrQ _PATH_CHARS _QUERY_CHARS)rrYr'r(encoded_targets r_encode_targetr_s   V $ $E K F!I!I!IJJJ,,..KD%*4==N %e\::#+% rrBc |stS|}t|sd|z} t|\}}}}}|dup|tv}|r|}|rn|d\}} } |pd}t| \} } |r|rt|t}| dkrd} nd\}} } | .t| } d| cxkrdksnt|nd} t| |} |r&|r$t|}t|t }|r|rt|t"}|r|rt|t$}n)#t&t(f$r}t||d}~wwxYw|s ||d}nd}t||| | |||S) a Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is performed to parse incomplete urls. Fields not provided will be None. This parser is RFC 3986 and RFC 6874 compliant. The parser logic and helper functions are based heavily on work done in the ``rfc3986`` module. :param str url: URL to parse into a :class:`.Url` namedtuple. Partly backwards-compatible with :mod:`urllib.parse`. Example: .. code-block:: python import urllib3 print( urllib3.util.parse_url('http://google.com/mail/')) # Url(scheme='http', host='google.com', port=None, path='/mail/', ...) print( urllib3.util.parse_url('google.com:80')) # Url(scheme=None, host='google.com', port=80, path=None, ...) print( urllib3.util.parse_url('/foo?bar')) # Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...) z//Nrr@)NNNri)r!r#r$r%r'r(r))r _SCHEME_REr_URI_RErYrr,r rpartition _HOST_PORT_RErQ_USERINFO_CHARSintrr~r{rr_FRAGMENT_CHARS ValueErrorAttributeError)rB source_urlr!r=r'r(r) normalize_urir#_ host_portr$r%port_intes r parse_urlrqsd8 uu J   S ! !Sj$43:==3E3E3L3L3N3N0 4$Q&,,..>@@JD$ D  D,T?CCrzz/ D$  4yyH****U****(---+HtV,,  >E  HX H,XGGH  '444 ,,!34    4DDD        sE9F--G>GG)rLr6rMrNr1r6)rLrSrMrNr1rS)rLr"rMrNr1r")r'r6r1r6)r$rSr!r"r1rS)r$r6r!r"r1r6)r$r"r!r"r1r")rr6r1r)rr6r1r6)rBr6r1r )6 __future__rretyping exceptionsrutilrrcompiler^rUNICODEDOTALLr _IPV4_PAT_HEX_PATformat _LS32_PATr _variations_UNRESERVED_PATrw _IPV6_PAT _ZONE_ID_PAT_IPV6_ADDRZ_PAT _REG_NAME_PATrr_IPV6_REr_BRACELESS_IPV6_ADDRZ_REr_HOST_PORT_PATrsetr_SUB_DELIM_CHARSrrrr NamedTupleOptionalr6rr overloadrQr{r~rrrrrrrs?"""""" ++++++0bj+,, RZ9 : : "* J    -  $ + +y + I I ),, *Y CHH=====>> > D 03HH )#f,|;gE4 RZ< = = 2:cIo+ , , 2:cIo+ , ,C/1C788%2:cOAbD,A&AC&GHHbj|+g566 MM IIOO  >2: +ABB CH3}%%#&66#>c * !,u!44 BBBBBF vs+ , V_S) * V_S) * V_S) * V_S) * foc* + - .   BBBJ  !&!&!&!&H<:((((&$ffffffr