mf6ddlmZddlZddlmZddlmZddlmZgdZ dZ ej d Z ej d Z ej d ejejzZd Zd ZdeeZeedZgdZdZdddeDzdzZdezdzZdezdzezdzZdZej dZej dezdzZej dezdzZej dezdzZ ej deddzdzZ!ej d ezd!zZ"d"ededed#Z#ej e#ejejzZ$e%d$Z&e%d%Z'e&e'zd&hzZ(e(d'd(hzZ)e)d)hzxZ*Z+Gd*d+ed+e Z,d,Z-d5d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4dS)6)absolute_importN) namedtuple)LocationParseError)sixschemeauthhostportpathqueryfragment)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)rls32) 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)?::zDABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._!\-~z(?:|c"g|] }|tz S)_subs.0xs G/opt/imunify360/venv/lib64/python3.11/site-packages/urllib3/util/url.py r6s<<<1QY<<<)z (?:%25|%)(?:[z]|%[a-fA-F0-9]{2})+z\[z)?\]z!(?:[^\[\]%:/?#]|%[a-fA-F0-9]{2})*z!^(/[^?#]*)(?:\?([^#]*))?(?:#.*)?$^$(z)\]$z^(z)(?::([0-9]{0,5}))?$zBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-~z !$&'()*+,;=:@/?ceZdZdZdZ d fd ZedZedZedZ edZ d Z 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. rNc |r|dsd|z}||}tt|||||||||S)Nr&) startswithlowersuperr)__new__) clsr r r r r rr __class__s rr.z Url.__new__[sm  ,, :D  \\^^FS#&& tT4   rc|jS)z@For backwards-compatibility with urlparse. We're nice like that.)r selfs rhostnamez Url.hostnamems yrc@|jpd}|j |d|jzz }|S)z)Absolute path including the query string.r&Nr')r r)r3uris r request_urizUrl.request_urirs.i3 : ! 3# #C rc@|jrd|j|jfzS|jS)z(Network location including host and portz%s:%d)r r r2s rnetlocz Url.netloc|s* 9 4di33 3yrc|\}}}}}}}d}|||dzz }|||dzz }|||z }||dt|zz }|||z }||d|zz }||d|zz }|S)a 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: :: >>> U = parse_url('http://google.com/mail/') >>> U.url 'http://google.com/mail/' >>> Url('http', 'username:password', 'host.com', 80, ... '/path', 'query', 'fragment').url 'http://username:password@host.com:80/path?query#fragment' Nz://r%r$r'#)str) r3r r r r r rrurls rr>zUrl.urls&;?7dD$x   6F? "C   4$; C   4KC   4#d))# #C   4KC   4%< C   4(? "C rc|jSN)r>r2s r__str__z Url.__str__s xr)NNNNNNN) __name__ __module__ __qualname____doc__ __slots__r.propertyr4r7r9r>rA __classcell__)r0s@rr)r)Rs I          $XXX %%X%Nrr)cd}d}|D]*}||}|dkr|||kr|}|}+||dkr|ddfS|d|||dzd|fS)a .. deprecated:: 1.25 Given a string and an iterable of delimiters, split on the first found delimiter. Return two split parts and the matched delimiter. If not found, then the first part is the full input string. Example:: >>> split_first('foo/bar?baz', '?/=') ('foo', 'bar?baz', '/') >>> split_first('foo/bar?baz', '123') ('foo/bar?baz', '', None) Scales linearly with number of delims. Not ideal for large number of delims. Nrr;)find)sdelimsmin_idx min_delimdidxs r split_firstrRs$GI ffQii 77  ?cGmmGI'A++"d{ XgX;'A+--() 33rutf-8c||Stj|}td|\}}|dd}||dk}t }tdt|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**,,rrS surrogatepass%rrJr)r ensure_text PERCENT_REsubnencodecount bytearrayrangelenorddecodeextendrzfillrW) component allowed_charsencodingpercent_encodings uri_bytesis_percent_encodedencoded_componentibytebyte_ords r_encode_invalid_charsrssV **I $.??,,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  # #H - --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_segmentsrszz#H F   c>>  __ MM' " " " "  JJLLL sVvay a }}]## b 88F  rc|rvt|tjrtj|}|tvr>t |}|rt|}|r| d\}}|||}| dr|dkr |dd}n |dd}dt|tz}|d| |z||dzS| St|sDtjdd|dDS|S)NrJz%25%.c,g|]}t|Sr) _idna_encode)rlabels rrz#_normalize_host..)s PPPu|E22PPPrru) isinstancer binary_type ensure_strNORMALIZABLE_SCHEMES IPV6_ADDRZ_RErX ZONE_ID_REsearchspanr+rsUNRESERVED_CHARSr,IPV4_REr{rv)r r is_ipv6rXstartendzone_ids r_normalize_hostrsr  dCO , , (>$''D ) ) )#))$//G "))$// (!&AJE3"59oG))%00.W5E5E")!""+")!""+!$9'CS$T$TTG<--//'9DJFF::<<']]4(( ~IIPP 3PPPQQ Krc|rtd|Dr ddl}n2#t$r%tjt ddYnwxYw ||ddS#|j$r(tjt d|zdYnwxYw|dS)Nc4g|]}t|dkS)r\)rers rrz _idna_encode../s"000aSVVc\000rrz-Unable to parse URL without the 'idna' moduleT)strict std3_rulesz#Name '%s' is not a valid IDNA labelascii) anyidna ImportErrorr raise_fromrr`r, IDNAError)namers rrr.s 00400011   KKKK    N"#RSS        ;;tzz||DT;JJ J~    N"#ID#PQQSW       ::<<  w ' ''s!",AA)A??/B10B1ct|\}}t|t}t|t }||d|zz }|S)zHPercent-encodes a request target so that there are no invalid charactersNr') TARGET_RErXgroupsrs PATH_CHARS QUERY_CHARS)targetr rs r_encode_targetr@sZ//&))0022KD% "4 4 4F !% 5 5E #+ Mrc |stS|}t|sd|z} t|\}}}}}|dup|tv}|r|}|rn|d\}} } |pd}t| \} } |r|rt|t}| dkrd} nd\}} } | -t| } d| cxkrdksnt|t| |} |r&|r$t|}t|t }|r|rt|t"}|r|rt|t$}n9#t&t(f$r%t+jt|dcYSwxYw|s ||d}nd}t/|t*jr t*jn t*jfd} 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 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:`urlparse`. Example:: >>> parse_url('http://google.com/mail/') Url(scheme='http', host='google.com', port=None, path='/mail/', ...) >>> parse_url('google.com:80') Url(scheme=None, host='google.com', port=80, path=None, ...) >>> parse_url('/foo?bar') Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...) z//Nr%r;)NNNric"||n |Sr@r)r ensure_funcs r ensure_typezparse_url..ensure_typesIqq;;q>>1rr)r) SCHEME_RErURI_RErXrr,r rpartition _HOST_PORT_RErsUSERINFO_CHARSintrrrrrFRAGMENT_CHARS ValueErrorAttributeErrorrrr text_typer]r)r> source_urlr authorityr rr normalize_urir _ host_portr r rrs @r parse_urlrJs, uu J   C Sj"D39<<3D3D3K3K3M3M0 4$P&,,..>@@JD$ C  C,T>BBrzz/ D$  t99D&&&&&&&&(---tV,,  ;T ;,T22D(z::D  >U >)%==E  GX G,X~FFH  'DDD~0<ps rget_hostrs' #A 8 vqz16 11r)rS)5 __future__rre collectionsr exceptionsrpackagesr url_attrsrcompiler^rUNICODEDOTALLrIPV4_PATHEX_PATformatLS32_PATr _variationsUNRESERVED_PATr{IPV6_PAT ZONE_ID_PATIPV6_ADDRZ_PAT REG_NAME_PATrrIPV6_RErBRACELESS_IPV6_ADDRZ_REr_HOST_PORT_PATrsetrSUB_DELIM_CHARSrrrrr)rRrsrrrrrrrrrrsX&&&&&& """"""++++++ K K K /RZ* + + BJ8 9 9  J    ,  # * *wX * F F** *Y 388<< <<<== = C.1FF !F*[87B3 BJ; < < "*S8^c) * * "*S8^c) * * 3/#566 $"*S>!B$+?%?#%EFF RZk)G3 4 4 LL HHNN  >2: +ABB 3H#m$$!O3se; sCj ( )SE11 nZZZZZ**UI & &ZZZz 4 4 4F....D<8((($^^^B22222r