Ë
    ‚+h  ã                   ó<   — d dl mZ d dlmZ d dlmZ  G d„ d«      Zy)é    )Úi18n)ÚWebobInputWrapper)Ú	clean_keyc                   óT   — e Zd ZdZd„ Zd„ Zd„ ZdZdZdZ	dZ
dZd„ ZdZd	Zi Zd
„ Zd„ Zy)ÚDefaultMetaz‹
    This is the default Meta class which defines all the default values and
    therefore also the 'API' of the class Meta interface.
    c                 ó*   —  |j                   dd|i|¤ŽS )aŽ  
        bind_field allows potential customization of how fields are bound.

        The default implementation simply passes the options to
        :meth:`UnboundField.bind`.

        :param form: The form.
        :param unbound_field: The unbound field.
        :param options:
            A dictionary of options which are typically passed to the field.

        :return: A bound field
        Úform© )Úbind)Úselfr	   Úunbound_fieldÚoptionss       ú?/var/www/html/venv/lib/python3.12/site-packages/wtforms/meta.pyÚ
bind_fieldzDefaultMeta.bind_field   s   € ð "ˆ}×!Ñ!Ñ7 tÐ7¨wÑ7Ð7ó    c                 óf   — |.t        |d«      s"t        |d«      rt        |«      S t        d«      ‚|S )aZ  
        wrap_formdata allows doing custom wrappers of WTForms formdata.

        The default implementation detects webob-style multidicts and wraps
        them, otherwise passes formdata back un-changed.

        :param form: The form.
        :param formdata: Form data.
        :return: A form-input wrapper compatible with WTForms.
        ÚgetlistÚgetallzNformdata should be a multidict-type wrapper that supports the 'getlist' method)Úhasattrr   Ú	TypeError)r   r	   Úformdatas      r   Úwrap_formdatazDefaultMeta.wrap_formdata   sA   € ð Ð¬°¸)Ô(DÜx Ô*Ü(¨Ó2Ð2äð5óð ð ˆr   c                 ó&  — |j                  «       D ci c]  \  }}t        |«      |“Œ }}}t        |dd«      }|8|j                  «       D ci c]  \  }}t        |«      |“Œ }}}t        |fi |¤Ž} |j                  |fi |¤ŽS c c}}w c c}}w )z£
        render_field allows customization of how widget rendering is done.

        The default implementation calls ``field.widget(field, **render_kw)``
        Ú	render_kwN)Úitemsr   ÚgetattrÚdictÚwidget)r   Úfieldr   ÚkÚvÚother_kws         r   Úrender_fieldzDefaultMeta.render_field3   s•   € ð 2;·±Ó1B×C©¨¨A”Y˜q“\ 1‘_ÐCˆ	ÑCä˜5 +¨tÓ4ˆØÐØ4<·N±NÓ4D×E©D¨A¨qœ	 !› a™ÐEˆHÑEÜ˜XÑ3¨Ñ3ˆIØˆu|‰|˜EÑ/ YÑ/Ð/ùó Dùó Fs   ”BÁBFÚ
csrf_tokenNc                 óT   — | j                   | j                  «       S ddlm}  |«       S )a—  
        Build a CSRF implementation. This is called once per form instance.

        The default implementation builds the class referenced to by
        :attr:`csrf_class` with zero arguments. If `csrf_class` is ``None``,
        will instead use the default implementation
        :class:`wtforms.csrf.session.SessionCSRF`.

        :param form: The form.
        :return: A CSRF implementation.
        r   )ÚSessionCSRF)Ú
csrf_classÚwtforms.csrf.sessionr&   )r   r	   r&   s      r   Ú
build_csrfzDefaultMeta.build_csrfJ   s&   € ð ?‰?Ð&Ø—?‘?Ó$Ð$å4á‹}Ðr   Tc                 ó
  — | j                   }|du ry| j                  rR|rt        |«      nd}| j                  j	                  |«      }|€$t        j                  |«      x}| j                  |<   |S t        j                  |«      S )zë
        Override in subclasses to provide alternate translations factory.
        See the i18n documentation for more.

        :param form: The form.
        :return: An object that provides gettext() and ngettext() methods.
        FN)ÚlocalesÚcache_translationsÚtupleÚtranslations_cacheÚgetr   Úget_translations)r   r	   r+   Útranslationss       r   r0   zDefaultMeta.get_translationsc   s‰   € ð —,‘,ˆØeÑØà×"Ò"á(/”e˜G”n°TˆGà×2Ñ2×6Ñ6°wÓ?ˆLØÐ#ÜBF×BWÑBWØóCð ˜t×6Ñ6°wÑ?ð  Ðä×$Ñ$ WÓ-Ð-r   c                 óN   — |j                  «       D ]  \  }}t        | ||«       Œ y)zV
        Given a dictionary of values, update values on this `Meta` instance.
        N)r   Úsetattr)r   ÚvaluesÚkeyÚvalues       r   Úupdate_valueszDefaultMeta.update_values   s)   € ð !Ÿ,™,›.ò 	&‰JˆCÜD˜#˜uÕ%ñ	&r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r#   ÚcsrfÚcsrf_field_nameÚcsrf_secretÚcsrf_contextr'   r)   r+   r,   r.   r0   r7   r
   r   r   r   r      sS   „ ñò8ò ò*0ð" €DØ"€OØ€KØ€LØ€Jòð* €GØÐØÐò.ó8&r   r   N)Úwtformsr   Úwtforms.utilsr   Úwtforms.widgets.corer   r   r
   r   r   ú<module>rC      s   ðÝ Ý +Ý *÷~&ò ~&r   