from django import template
from django.template.base import FilterExpression
from django.template.defaultfilters import stringfilter
from wagtail import hooks as hooks
from wagtail.admin.admin_url_finder import AdminURLFinder as AdminURLFinder
from wagtail.admin.icons import get_icon_sprite_url as get_icon_sprite_url
from wagtail.admin.localization import get_js_translation_strings as get_js_translation_strings
from wagtail.admin.menu import admin_menu as admin_menu
from wagtail.admin.search import admin_search_areas as admin_search_areas
from wagtail.admin.ui import sidebar as sidebar
from wagtail.admin.ui.menus import MenuItem as MenuItem
from wagtail.admin.utils import (
    get_admin_base_url as get_admin_base_url,
)
from wagtail.admin.utils import (
    get_keyboard_key_labels_from_request as get_keyboard_key_labels_from_request,
)
from wagtail.admin.utils import (
    get_latest_str as get_latest_str,
)
from wagtail.admin.utils import (
    get_user_display_name as get_user_display_name,
)
from wagtail.admin.views.bulk_action.registry import bulk_action_registry as bulk_action_registry
from wagtail.admin.views.pages.utils import get_breadcrumbs_items_for_page as get_breadcrumbs_items_for_page
from wagtail.admin.widgets import Button as Button
from wagtail.admin.widgets import ButtonWithDropdown as ButtonWithDropdown
from wagtail.admin.widgets.button import ListingButton as ListingButton
from wagtail.coreutils import (
    camelcase_to_underscore as camelcase_to_underscore,
)
from wagtail.coreutils import (
    get_content_type_label as get_content_type_label,
)
from wagtail.coreutils import (
    get_locales_display_names as get_locales_display_names,
)
from wagtail.models import Locale as Locale
from wagtail.models import Page as Page
from wagtail.models import PageViewRestriction as PageViewRestriction
from wagtail.telepath import JSContext as JSContext
from wagtail.users.utils import get_gravatar_url as get_gravatar_url

register: template.Library

def breadcrumbs(items, is_expanded: bool = False, classname=None, icon_name=None): ...
def page_breadcrumbs(
    context,
    page,
    url_name,
    url_root_name=None,
    include_self: bool = True,
    is_expanded: bool = False,
    querystring_value: str = "",
    trailing_breadcrumb_title=None,
    classname=None,
    icon_name=None,
): ...
def search_other(context, current=None): ...
def ellipsistrim(value, max_length): ...
@register.filter
def fieldtype(bound_field): ...
@register.filter
def widgettype(bound_field): ...
def page_permissions(context, page): ...
@register.simple_tag
def is_page(obj): ...
def admin_edit_url(context, obj, user=None): ...
@register.simple_tag
def admin_url_name(obj, action): ...
def build_absolute_url(context, url): ...
@register.simple_tag
def latest_str(obj): ...
@register.simple_tag
def classnames(*classes): ...
def test_collection_is_public(collection): ...
def test_page_is_public(context, page): ...
@register.simple_tag
def hook_output(hook_name): ...
@register.simple_tag
def base_url_setting(default=None): ...
@register.simple_tag
def allow_unicode_slugs(): ...
@register.filter
def render_with_errors(bound_field): ...
@register.filter
def has_unrendered_errors(bound_field): ...
@stringfilter
def cautious_slugify(value): ...
def querystring(context, **kwargs): ...
def pagination_querystring(context, page_number, page_key: str = "p"): ...
def paginate(context, page, base_url: str = "", page_key: str = "p", classname: str = ""): ...
def page_listing_buttons(context, page, user, next_url=None): ...
def page_header_buttons(context, page, user, view_name): ...
def bulk_action_choices(context, app_label, model_name): ...
def avatar(user=None, classname=None, size=None, tooltip=None, tooltip_html=None, edit_link: bool = False): ...
@register.simple_tag
def message_level_tag(message): ...
@register.simple_tag
def message_tags(message): ...
@register.filter
def admin_urlquote(value): ...
@register.simple_tag
def avatar_url(user, size: int = 50, gravatar_only: bool = False): ...
def admin_theme_classname(context): ...
def admin_theme_color_scheme(context): ...
@register.simple_tag
def absolute_static(path): ...
@register.simple_tag
def versioned_static(path): ...
def icon(name=None, classname=None, title=None, wrapped: bool = False): ...
def status(label=None, classname=None, url=None, title=None, hidden_label=None, attrs=None): ...
def timesince_simple(d): ...
@register.simple_tag
def timesince_last_update(
    last_update, show_time_prefix: bool = False, user_display_name: str = "", use_shorthand: bool = True
): ...
@register.filter
def user_display_name(user): ...
@register.filter
def format_content_type(content_type): ...
@register.simple_tag
def i18n_enabled(): ...
@register.simple_tag
def locale_label_from_id(locale_id): ...
def sidebar_collapsed(context): ...
def sidebar_props(context): ...
@register.simple_tag
def get_comments_enabled(): ...
def wagtail_config(context): ...
@register.simple_tag
def resolve_url(url): ...

class FragmentNode(template.Node):
    nodelist: template.NodeList
    target_var: str
    stripped: bool
    def __init__(self, nodelist, target_var, stripped: bool = False) -> None: ...
    def render(self, context): ...

def fragment(parser, token): ...

class BlockInclusionNode(template.Node):
    content_var: str
    nodelist: template.NodeList
    template: str
    extra_context: dict[str, FilterExpression]
    target_var: str | None
    def __init__(self, nodelist, template, extra_context, target_var=None) -> None: ...
    def get_context_data(self, parent_context): ...
    def render(self, context): ...
    @classmethod
    def handle(cls, parser, token): ...

class DialogNode(BlockInclusionNode):
    template: str
    def get_context_data(self, parent_context): ...

class HelpBlockNode(BlockInclusionNode):
    template: str

class DropdownNode(BlockInclusionNode):
    template: str

class DropdownButtonNode(BlockInclusionNode):
    template: str

class PanelNode(BlockInclusionNode):
    template: str

class RawFormattedFieldNode(BlockInclusionNode):
    content_var: str
    template: str

def formattedfield(
    field=None,
    rendered_field=None,
    classname: str = "",
    show_label: bool = True,
    id_for_label=None,
    sr_only_label: bool = False,
    icon=None,
    help_text=None,
    help_text_id=None,
    show_add_comment_button: bool = False,
    label_text=None,
    error_message_id=None,
    wrapper_id=None,
    attrs=None,
): ...
def formattedfieldfromcontext(context): ...

class FieldRowNode(BlockInclusionNode):
    template: str

def dialog_toggle(dialog_id, classname: str = "", text=None): ...
def workflow_status_with_date(workflow_state): ...
def keyboard_shortcuts_dialog(context): ...
def human_readable_date(date, description=None, placement: str = "top"): ...
