File: //lib/python3/dist-packages/sphinx/directives/__pycache__/patches.cpython-310.pyc
o
�$�aH# � @ s d Z ddlZddlZddlmZ ddlmZmZmZmZm Z m
Z
ddlmZ ddl
mZmZmZ ddlmZ ddlmZmZ dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZ ddl m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z' ddl(m)Z)m*Z*m+Z+ ddl,m-Z- zddl
m.Z/ ddl0m1Z2 W n e3y� ddl4m1Z2 ddl4m5Z5 e5j.Z/Y nw er�ddl6m7Z7 e#�8e9�Z:G dd� dej;�Z;G dd� de2e%�Z1G dd� dej<�Z<G dd� dej=�Z=G d d!� d!ej>�Z>G d"d#� d#e%�Z?G d$d%� d%e%�Z@d&d'd(eeAef fd)d*�ZBdS )+z�
sphinx.directives.patches
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
� N)�path)�
TYPE_CHECKING�Any�Dict�List�Tuple�cast)�nodes)�Node�make_id�system_message)�
directives)�images�tables)�set_classes)�addnodes)�RemovedInSphinx60Warning)�optional_int)�
MathDomain)�__)�logging)�SphinxDirective)�set_source_info)�SEP�os_path�relpath)�
OptionSpec)�meta)�Meta)�MetaBody)�Sphinxc �* e Zd ZdZdee f� fdd�Z� ZS )�FigureziThe figure directive which applies `:name:` option to the figure node
instead of the image node.
�returnc s� | j �dd �}t� �� }t|�dkst|d tj�r|S t|�dks$J �ttj |d �}|r8|| j d<