
    ci$                       d dl mZ d dlZd dlZd dlmZ d dlmZ 	 d dlZn# e	$ r d dl
ZY nw xY wddgZ ej        dd                    e          z            Z ej        d	          Z ej        d
          Z ej        d          Z ej        d          Z ej        d          Z ej        d          Z ej        d          ZdZ	 	 	 	 d,d-dZdddd deddddddfd.d+ZdS )/    )annotationsN)Iterable)name2codepointslugifysmart_truncatez&(%s);|z&#(\d+);z&#x([\da-fA-F]+);z[\']+z[^-a-zA-Z0-9]+z[\W_]+z-{2,}z(?<=\d),(?=\d)-F stringstr
max_lengthintword_boundarybool	separator
save_orderreturnc                   |                      |          } |s| S t          |           |k     r| S |s| d|                              |          S || vr
| d|         S d}|                     |          D ]g}|rct          |          t          |          z   }||k     r|d                    ||          z  }C||k    r|d                    |          z  } n|r nh|s
| d|         }|                     |          S )a=  
    Truncate a string.
    :param string (str): string for modification
    :param max_length (int): output string length
    :param word_boundary (bool):
    :param save_order (bool): if True then word order of output string is like input string
    :param separator (str): separator between words
    :return:
    N z{}{}z{})striplensplitformat)r   r   r   r   r   	truncatedwordnext_lens           _/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/slugify/slugify.pyr   r      s6   " \\)$$F 
6{{Z 4kzk"((333kzk""IY'' 
 
 		9~~D		1H*$$V]]4;;;		Z''T[[...	 E (;J;'	??9%%%    T textentitiesdecimalhexadecimal	stopwordsIterable[str]regex_patternre.Pattern[str] | str | None	lowercasereplacementsIterable[Iterable[str]]allow_unicodec                   |r|D ]\  }}|                      ||          } t          | t                    st          | dd          } t                              t
          |           } |rt          j        d|           } n)t          j        d|           } t          j        |           } t          | t                    st          | dd          } |rt                              d |           } |r.	 t                              d |           } n# t          $ r Y nw xY w|r.	 t                              d |           } n# t          $ r Y nw xY w|rt          j        d|           } nt          j        d|           } |
r|                                 } t                              d|           } t                              d|           } |r
|	pt          }n	|	pt           }t#          j        |t
          |           } t$                              t
          |                               t
                    } ru|
r3d	 D             fd
|                     t
                    D             }n&fd|                     t
                    D             }t
                              |          } |r|D ]\  }}|                      ||          } |dk    rt-          | ||t
          |          } |t
          k    r|                      t
          |          } | S )a  
    Make a slug from the given text.
    :param text (str): initial text
    :param entities (bool): converts html entities to unicode
    :param decimal (bool): converts html decimal to unicode
    :param hexadecimal (bool): converts html hexadecimal to unicode
    :param max_length (int): output string length
    :param word_boundary (bool): truncates to complete word even if length ends up shorter than max_length
    :param save_order (bool): if parameter is True and max_length > 0 return whole words in the initial order
    :param separator (str): separator between words
    :param stopwords (iterable): words to discount
    :param regex_pattern (str): regex pattern for disallowed characters
    :param lowercase (bool): activate case sensitivity by setting it to False
    :param replacements (iterable): list of replacement rules e.g. [['|', 'or'], ['%', 'percent']]
    :param allow_unicode (bool): allow unicode characters
    :return (str):
    zutf-8ignoreNFKCNFKDc                \    t          t          |                     d                             S N   )chrr   groupms    r   <lambda>zslugify.<locals>.<lambda>   s    ^AGGAJJ5O1P1P r   c                `    t          t          |                     d                              S r1   r3   r   r4   r5   s    r   r7   zslugify.<locals>.<lambda>   s    S__1E1E r   c                b    t          t          |                     d          d                    S )Nr2      r9   r5   s    r   r7   zslugify.<locals>.<lambda>   s"    SQWWQZZ1D1D-E-E r   r   c                6    g | ]}|                                 S r   )lower).0ss     r   
<listcomp>zslugify.<locals>.<listcomp>   s     <<<Qqwwyy<<<r   c                    g | ]}|v|	S r   r   )r>   wstopwords_lowers     r   r@   zslugify.<locals>.<listcomp>   s#    ZZZ1/AYAYQAYAYAYr   c                    g | ]}|v|	S r   r   )r>   rB   r$   s     r   r@   zslugify.<locals>.<listcomp>   s#    TTT1)ASASQASASASr   r   )replace
isinstancer   QUOTE_PATTERNsubDEFAULT_SEPARATORunicodedata	normalize	unidecodeCHAR_ENTITY_PATTERNDECIMAL_PATTERN	ExceptionHEX_PATTERNr=   NUMBERS_PATTERN DISALLOWED_UNICODE_CHARS_PATTERNDISALLOWED_CHARS_PATTERNreDUPLICATE_DASH_PATTERNr   r   joinr   )r    r!   r"   r#   r   r   r   r   r$   r&   r(   r)   r+   oldnewpatternwordsrC   s           `        @r   r   r   K   sb   D  *$ 	* 	*HC<<S))DD dC   ,4(++ .55D  )$VT22$VT22"4(( dC   ,4(++  X"&&'P'PRVWW  	"&&'E'EtLLDD 	 	 	D	  	??#E#EtLLDD 	 	 	D	  3$VT22$VT22  zz|| R&&D r4((D  <C#C;#;6',d33D "%%&7>>DDEVWWD  - 	U<<)<<<OZZZZ

+< = =ZZZEETTTT

+< = =TTTE %%e,,  *$ 	* 	*HC<<S))DD A~~dJ?PR\]]%%%||-y99Ks$   1D 
DD!D> >
E
E)r   Fr
   F)r   r   r   r   r   r   r   r   r   r   r   r   )r    r   r!   r   r"   r   r#   r   r   r   r   r   r   r   r   r   r$   r%   r&   r'   r(   r   r)   r*   r+   r   r   r   )
__future__r   rT   rJ   collections.abcr   html.entitiesr   rL   ImportErrortext_unidecode__all__compilerV   rM   rN   rP   rG   rS   rR   rU   rQ   rI   r   r   r   r   r   <module>rb      s   " " " " " " 				     $ $ $ $ $ $ ( ( ( ( ( (' ' ' '&&&&&&' &
' !bjSXXn-E-E!EFF "*[))bj-..
8$$%2:&788 #-2:i#8#8  #H-- "*.// 
 -& -& -& -& -&d &!26,.z z z z z z zs   ! 	--