§
    Å‡tj
  ã                   ó„   — d Z ddlZddlZddlmZ ddlmZ ddl	m
Z
  ej        d¦  «        Z G d„ dej        ¦  «        ZdS ))ÚPdfUnspHandleré    N)ÚPdfiumErrorÚ	pypdfium2c                   óF   — e Zd ZdZdZd„ Zd„ Zed„ ¦   «         Zd„ Z	d	d„Z
dS )
r   am  
    Unsupported feature handler helper class.
    
    Attributes:
        raw (UNSUPPORT_INFO):
           The underlying pdfium ``UNSUPPORT_INFO`` struct.
        handlers (dict[str, typing.Callable]):
            A dictionary of named handler functions to be called with an unsupported code (:attr:`FPDF_UNSP_*`) when PDFium detects an unsupported feature.
    Nc                 óH   — i | _         t          j        d¬¦  «        | _        d S )Né   )Úversion)ÚhandlersÚpdfium_cÚUNSUPPORT_INFOÚraw©Úselfs    ú\/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/pypdfium2/_helpers/unsupported.pyÚ__init__zPdfUnspHandler.__init__   s"   € ØˆŒÝÔ*°1Ð5Ñ5Ô5ˆŒˆˆó    c                 óT   — | j                              ¦   «         D ]} ||¦  «         Œd S ©N)r
   Úvalues)r   Ú_ÚtypeÚhandlers       r   Ú__call__zPdfUnspHandler.__call__    s8   € Ø”}×+Ò+Ñ-Ô-ð 	ð 	ˆGØˆG�D‰MŒMˆMˆMð	ð 	r   c                 óz   — t                                dt          j                             | ¦  «        › �¦  «         d S )NzUnsupported PDF feature: )Ú
lib_loggerÚwarningÚpdfium_iÚUnsupportedInfoToStrÚget)r   s    r   Ú_defaultzPdfUnspHandler._default$   s7   € å×ÒÐ`µxÔ7T×7XÒ7XÐY]Ñ7^Ô7^Ð`Ð`ÑaÔaÐaÐaÐar   c                 óV   — t          | j        ¦  «         t          | j        ¦  «         d S r   )Úidr
   r   r   s    r   Ú_keepzPdfUnspHandler._keep(   s#   € Ý
ˆ4Œ=ÑÔÐÝ
ˆ4Œ8‰Œˆˆˆr   Tc                 ó@  — t           j        rt          d¦  «        ‚t          j        | j        d| ¦  «         t          j        | j        ¦  «        }|st          d¦  «        ‚| t           _        t          j
        | j        ¦  «         |rt           j        | j        d<   dS dS )aŠ  
        Register the handler with PDFium, and install an exit function that will keep the object alive until the end of session.
        
        Once set up, a :class:`.PdfUnspHandler` cannot be removed. It stands and falls with the library.
        Thus, this function can only be called once in a session.
        However, you may change the wrapped :attr:`.handlers` callbacks.
        Call ``.handlers.clear()`` to remove all handlers, thereby effectively disabling the instance.
        
        Parameters:
            add_default (bool):
                If True, add a default callback that will log unsupported features as warning.
        zAOnly one PdfUnspHandler instance can be registered for a session.ÚFSDK_UnSupport_Handlerz)Failed to register PdfUnspHandler object.ÚdefaultN)r   Ú	SINGLETONÚRuntimeErrorr   Úset_callbackr   r   ÚFSDK_SetUnSpObjProcessHandlerr   ÚatexitÚregisterr#   r    r
   )r   Úadd_defaultÚoks      r   ÚsetupzPdfUnspHandler.setup,   s¤   € õ Ô#ð 	dÝÐbÑcÔcÐcåÔ˜dœhÐ(@À$ÑGÔGÐGÝÔ3°D´HÑ=Ô=ˆØð 	KÝÐIÑJÔJÐJØ#'�Ô õ 	Œ˜œ
Ñ#Ô#Ð#Øð 	?Ý'5Ô'>ˆDŒM˜)Ñ$Ð$Ð$ð	?ð 	?r   )T)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r'   r   r   Ústaticmethodr    r#   r/   © r   r   r   r      s„   € € € € € ðð ð €Ið6ð 6ð 6ðð ð ð ðbð bñ „\ðbðð ð ð?ð ?ð ?ð ?ð ?ð ?r   r   )Ú__all__r+   ÚloggingÚpypdfium2.rawr   r   Úpypdfium2.internalÚinternalr   Úpypdfium2._helpers.miscr   Ú	getLoggerr   ÚAutoCastabler   r5   r   r   ú<module>r>      s�   ðð €à €€€Ø €€€Ø  Ð  Ð  Ð  Ð  Ð  Ø %Ð %Ð %Ð %Ð %Ð %Ø /Ð /Ð /Ð /Ð /Ð /àˆWÔ˜{Ñ+Ô+€
ð6?ð 6?ð 6?ð 6?ð 6?�hÔ+ñ 6?ô 6?ð 6?ð 6?ð 6?r   