L imddlmZddlZddlZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZer dd lmZdd lmZdd Z d dd ZGd dZy)) annotationsN)Path) TYPE_CHECKING)config)CustomComponent) get_instance)get_script_run_ctx) FrameType)BaseComponentRegistryctj|}| td|j}|dk(rVtj|}t j j|}t j j|\}}|S)Nz)module is None. This should never happen.__main__) inspect getmodule RuntimeError__name__getfileospathbasenamesplitext) caller_framemodule module_name file_pathfilename_s p/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/components/v1/component_registry.py_get_module_namer!sx  | ,F ~FGG//K j OOL1 77##I.))(3 Q c|t|tr t|}tj}| t d|j }| t dt|}|d|}|stjdx}r|d|d}t||||}t} | #tjj||S)aCreate a custom component and register it if there is a ``ScriptRunContext``. The component is not registered when there is no ``ScriptRunContext``. This can happen when a ``CustomComponent`` is executed as standalone command (e.g. for testing). To use this function, import it from the ``streamlit.components.v1`` module. .. warning:: Using ``st.components.v1.declare_component`` directly (instead of importing its module) is deprecated and will be disallowed in a later version. Parameters ---------- name : str A short, descriptive name for the component, like "slider". path: str, Path, or None The path to serve the component's frontend files from. The path should be absolute. If ``path`` is ``None`` (default), Streamlit will serve the component from the location in ``url``. Either ``path`` or ``url`` must be specified. If both are specified, then ``url`` will take precedence. url: str or None The URL that the component is served from. If ``url`` is ``None`` (default), Streamlit will serve the component from the location in ``path``. Either ``path`` or ``url`` must be specified. If both are specified, then ``url`` will take precedence. Returns ------- CustomComponent A ``CustomComponent`` that can be called like a function. Calling the component will create a new instance of the component in the Streamlit app. z0current_frame is None. This should never happen.z/caller_frame is None. This should never happen..z!server.customComponentBaseUrlPath/)namerurlr) isinstancerstrr currentframerf_backrr get_optionrr rcomponent_registryregister_component) r#rr$ current_framerrcomponent_namecomponent_base_path componentctxs rdeclare_componentr15s\ JtT24y'.&:&:&rEsq#  D*VX,#P P P P Pr11r