
    MfO                     2    d dl mZmZ  G d de          ZdS )    )	Component_explicitize_argsc                        e Zd ZdZg ZdgZdZd Zee	j
        e	j
        e	j
        e	j
        e	j
        e	j
        e	j
        f fd	            Z xZS )LogoutButtona  A LogoutButton component.
    Logout button to submit a form post request to the `logout_url` prop.
    Usage is intended for dash-deployment-server authentication.

    DDS usage:

    `dcc.LogoutButton(logout_url=os.getenv('DASH_LOGOUT_URL'))`

    Custom usage:

    - Implement a login mechanism.
    - Create a flask route with a post method handler.
    `@app.server.route('/logout', methods=['POST'])`
      - The logout route should perform what's necessary for the user to logout.
      - If you store the session in a cookie, clear the cookie:
      `rep = flask.Response(); rep.set_cookie('session', '', expires=0)`

    - Create a logout button component and assign it the logout_url
    `dcc.LogoutButton(logout_url='/logout')`

    See https://dash.plotly.com/dash-core-components/logout_button
    for more documentation and examples.

    Keyword arguments:

    - id (string; optional):
        Id of the button.

    - className (string; optional):
        CSS class for the button.

    - label (string; default 'Logout'):
        Text of the button.

    - loading_state (dict; optional):
        Object that holds the loading state object coming from
        dash-renderer.

        `loading_state` is a dict with keys:

        - component_name (string; optional):
            Holds the name of the component that is loading.

        - is_loading (boolean; optional):
            Determines if the component is loading or not.

        - prop_name (string; optional):
            Holds which property is loading.

    - logout_url (string; optional):
        Url to submit a post logout request.

    - method (string; default 'post'):
        Http method to submit the logout form.

    - style (dict; optional):
        Style of the button.childrendash_core_componentsc                    g d| _         g | _        g d| _        g | _        |                    d          }	t                                          |           fd|	D             }
 t          t          |           j	        di |
 d S )N)id	classNamelabelloading_state
logout_urlmethodstyle_explicit_argsc                 "    i | ]}||         S  r   ).0k_localss     T/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/dash/dcc/LogoutButton.py
<dictcomp>z)LogoutButton.__init__.<locals>.<dictcomp>i   s    666!71:666    r   )
_prop_names_valid_wildcard_attributesavailable_propertiesavailable_wildcard_propertiespoplocalsupdatesuperr   __init__)selfr
   r   r   r   r   r   r   kwargsr   argsr   	__class__s              @r   r"   zLogoutButton.__init__F   s    
 
 
 +-'%
 %
 %
! .0*$455((v6666~666*lD!!*22T22222r   )__name__
__module____qualname____doc___children_props_base_nodes
_namespace_typer   r   	UNDEFINEDr"   __classcell__)r&   s   @r   r   r      s        8  8 t O,K'JE !&!"%)$3 $3 $3 $3 $3 $3 $3 $3 $3 $3r   r   N)dash.development.base_componentr   r   r   r   r   r   <module>r2      s^    I H H H H H H He3 e3 e3 e3 e39 e3 e3 e3 e3 e3r   