Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- Dockerfile +16 -0
- README.md +12 -5
- __init__.py +0 -0
- __pycache__/__init__.cpython-311.pyc +0 -0
- __pycache__/app.cpython-311.pyc +0 -0
- app.py +20 -0
- requirements.txt +1 -0
- src/.gitignore +9 -0
- src/README.md +10 -0
- src/backend/gradio_highlightedtextbox/__init__.py +4 -0
- src/backend/gradio_highlightedtextbox/highlightedtextbox.py +180 -0
- src/backend/gradio_highlightedtextbox/highlightedtextbox.pyi +429 -0
- src/backend/gradio_highlightedtextbox/templates/component/index.js +3172 -0
- src/backend/gradio_highlightedtextbox/templates/component/style.css +1 -0
- src/backend/gradio_highlightedtextbox/templates/example/index.js +112 -0
- src/backend/gradio_highlightedtextbox/templates/example/style.css +1 -0
- src/demo/__init__.py +0 -0
- src/demo/app.py +20 -0
- src/frontend/Example.svelte +46 -0
- src/frontend/HighlightedTextbox.svelte +296 -0
- src/frontend/Index.svelte +88 -0
- src/frontend/package-lock.json +934 -0
- src/frontend/package.json +21 -0
- src/frontend/utils.ts +74 -0
- src/pyproject.toml +42 -0
Dockerfile
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
FROM python:3.9
|
3 |
+
|
4 |
+
WORKDIR /code
|
5 |
+
|
6 |
+
COPY --link --chown=1000 . .
|
7 |
+
|
8 |
+
RUN mkdir -p /tmp/cache/
|
9 |
+
RUN chmod a+rwx -R /tmp/cache/
|
10 |
+
ENV TRANSFORMERS_CACHE=/tmp/cache/
|
11 |
+
|
12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
13 |
+
|
14 |
+
ENV PYTHONUNBUFFERED=1 GRADIO_ALLOW_FLAGGING=never GRADIO_NUM_PORTS=1 GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860 SYSTEM=spaces
|
15 |
+
|
16 |
+
CMD ["python", "app.py"]
|
README.md
CHANGED
@@ -1,10 +1,17 @@
|
|
|
|
1 |
---
|
2 |
-
|
3 |
-
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: docker
|
7 |
pinned: false
|
|
|
8 |
---
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
---
|
3 |
+
tags: [gradio-custom-component,gradio-template-SimpleTextbox,highlight,textbox,editing,color]
|
4 |
+
title: gradio_highlightedtextbox V0.0.1
|
5 |
+
colorFrom: indigo
|
6 |
+
colorTo: green
|
7 |
sdk: docker
|
8 |
pinned: false
|
9 |
+
license: apache-2.0
|
10 |
---
|
11 |
|
12 |
+
|
13 |
+
# Name: gradio_highlightedtextbox
|
14 |
+
|
15 |
+
Description: Editable Gradio textarea supporting highlighting
|
16 |
+
|
17 |
+
Install with: pip install gradio_highlightedtextbox
|
__init__.py
ADDED
File without changes
|
__pycache__/__init__.cpython-311.pyc
ADDED
Binary file (177 Bytes). View file
|
|
__pycache__/app.cpython-311.pyc
ADDED
Binary file (745 Bytes). View file
|
|
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from gradio_highlightedtextbox import HighlightedTextbox
|
3 |
+
|
4 |
+
def set_highlighted():
|
5 |
+
return HighlightedTextbox(
|
6 |
+
value=[("Non è qualcosa di cui vergognarsi: non è diverso dalle paure e", None), ("odie", "Potential issue"), ("personali", None), ("di altre cose", "Potential issue"), ("che", None), ("molta gente ha", "Potential issue"), (".", None)],
|
7 |
+
interactive=True, label="Output", show_legend=True, show_label=False, legend_label="Test:", show_legend_label=True
|
8 |
+
)
|
9 |
+
|
10 |
+
with gr.Blocks() as demo:
|
11 |
+
with gr.Row():
|
12 |
+
gr.Textbox(" It is not something to be ashamed of: it is no different from the personal fears and dislikes of other things that very many people have.", interactive=False)
|
13 |
+
high = HighlightedTextbox(
|
14 |
+
interactive=True, label="Input", show_legend=True, show_label=False, legend_label="Legend:", show_legend_label=True
|
15 |
+
)
|
16 |
+
button = gr.Button("Submit")
|
17 |
+
button.click(fn=set_highlighted, inputs=[], outputs=high)
|
18 |
+
|
19 |
+
|
20 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
gradio_highlightedtextbox-0.0.1-py3-none-any.whl
|
src/.gitignore
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.eggs/
|
2 |
+
dist/
|
3 |
+
*.pyc
|
4 |
+
__pycache__/
|
5 |
+
*.py[cod]
|
6 |
+
*$py.class
|
7 |
+
__tmp/*
|
8 |
+
*.pyi
|
9 |
+
node_modules
|
src/README.md
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# gradio_highlightedtextbox
|
3 |
+
A Custom Gradio component.
|
4 |
+
|
5 |
+
## Example usage
|
6 |
+
|
7 |
+
```python
|
8 |
+
import gradio as gr
|
9 |
+
from gradio_highlightedtextbox import HighlightedTextbox
|
10 |
+
```
|
src/backend/gradio_highlightedtextbox/__init__.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
from .highlightedtextbox import HighlightedTextbox
|
3 |
+
|
4 |
+
__all__ = ['HighlightedTextbox']
|
src/backend/gradio_highlightedtextbox/highlightedtextbox.py
ADDED
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import annotations
|
2 |
+
|
3 |
+
from typing import Any, Callable, List, Tuple
|
4 |
+
|
5 |
+
from gradio.data_classes import GradioRootModel
|
6 |
+
from gradio.components.base import FormComponent
|
7 |
+
from gradio.events import Events
|
8 |
+
|
9 |
+
|
10 |
+
class HighlightedTextData(GradioRootModel):
|
11 |
+
root: List[Tuple[str, str | None]]
|
12 |
+
|
13 |
+
|
14 |
+
class HighlightedTextbox(FormComponent):
|
15 |
+
"""
|
16 |
+
Creates a textarea for user to enter string input or display string output where some
|
17 |
+
elements are highlighted.
|
18 |
+
Preprocessing: passes a list of tuples as a {List[Tuple[str, float | str | None]]]} into the function. If no labels are provided, the text will be displayed as a single span.
|
19 |
+
Postprocessing: expects a {List[Tuple[str, float | str]]]} consisting of spans of text and their associated labels, or a {Dict} with two keys:
|
20 |
+
(1) "text" whose value is the complete text, and
|
21 |
+
(2) "highlights", which is a list of dictionaries, each of which have the keys:
|
22 |
+
"highlight_type" (consisting of the highlight label),
|
23 |
+
"start" (the character index where the label starts), and
|
24 |
+
"end" (the character index where the label ends).
|
25 |
+
Highlights should not overlap.
|
26 |
+
"""
|
27 |
+
|
28 |
+
EVENTS = [
|
29 |
+
Events.change,
|
30 |
+
Events.input,
|
31 |
+
Events.select,
|
32 |
+
Events.submit,
|
33 |
+
Events.focus,
|
34 |
+
Events.blur,
|
35 |
+
]
|
36 |
+
data_model = HighlightedTextData
|
37 |
+
|
38 |
+
def __init__(
|
39 |
+
self,
|
40 |
+
value: str | Callable | None = "",
|
41 |
+
*,
|
42 |
+
color_map: dict[str, str] | None = None,
|
43 |
+
show_legend: bool = False,
|
44 |
+
show_legend_label: bool = False,
|
45 |
+
legend_label: str = "",
|
46 |
+
combine_adjacent: bool = False,
|
47 |
+
adjacent_separator: str = "",
|
48 |
+
label: str | None = None,
|
49 |
+
info: str | None = None,
|
50 |
+
every: float | None = None,
|
51 |
+
show_label: bool | None = None,
|
52 |
+
container: bool = True,
|
53 |
+
scale: int | None = None,
|
54 |
+
min_width: int = 160,
|
55 |
+
visible: bool = True,
|
56 |
+
elem_id: str | None = None,
|
57 |
+
autofocus: bool = False,
|
58 |
+
autoscroll: bool = True,
|
59 |
+
interactive: bool = True,
|
60 |
+
elem_classes: list[str] | str | None = None,
|
61 |
+
render: bool = True,
|
62 |
+
show_copy_button: bool = False,
|
63 |
+
):
|
64 |
+
"""
|
65 |
+
Parameters:
|
66 |
+
value: default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.
|
67 |
+
lines: number of lines to display in textbox.
|
68 |
+
max_lines: maximum number of lines to display in textbox.
|
69 |
+
color_map: dictionary mapping labels to colors.
|
70 |
+
show_legend: if True, will display legend.
|
71 |
+
show_legend_label: if True, will display legend label.
|
72 |
+
legend_label: label to display above legend.
|
73 |
+
combine_adjacent: if True, will combine adjacent spans with the same label.
|
74 |
+
adjacent_separator: separator to use when combining adjacent spans.
|
75 |
+
placeholder: placeholder hint to provide behind textbox.
|
76 |
+
label: component name in interface.
|
77 |
+
every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.
|
78 |
+
show_label: if True, will display label.
|
79 |
+
container: If True, will place the component in a container - providing some extra padding around the border.
|
80 |
+
scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer.
|
81 |
+
min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
|
82 |
+
interactive: if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.
|
83 |
+
visible: If False, component will be hidden.
|
84 |
+
rtl: If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.
|
85 |
+
elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
|
86 |
+
elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
|
87 |
+
render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
|
88 |
+
rtl: If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.
|
89 |
+
show_copy_button: If True, includes a copy button to copy the text in the textbox. Only applies if show_label is True.
|
90 |
+
autoscroll: If True, will automatically scroll to the bottom of the textbox when the value changes, unless the user scrolls up. If False, will not scroll to the bottom of the textbox when the value changes.
|
91 |
+
"""
|
92 |
+
self.color_map = color_map
|
93 |
+
self.show_legend = show_legend
|
94 |
+
self.show_legend_label = show_legend_label
|
95 |
+
self.legend_label = legend_label
|
96 |
+
self.combine_adjacent = combine_adjacent
|
97 |
+
self.adjacent_separator = adjacent_separator
|
98 |
+
self.show_copy_button = show_copy_button
|
99 |
+
self.autofocus = autofocus
|
100 |
+
self.autoscroll = autoscroll
|
101 |
+
super().__init__(
|
102 |
+
label=label,
|
103 |
+
info=info,
|
104 |
+
show_label=show_label,
|
105 |
+
container=container,
|
106 |
+
scale=scale,
|
107 |
+
min_width=min_width,
|
108 |
+
interactive=interactive,
|
109 |
+
visible=visible,
|
110 |
+
elem_id=elem_id,
|
111 |
+
elem_classes=elem_classes,
|
112 |
+
value=value,
|
113 |
+
render=render,
|
114 |
+
every=every,
|
115 |
+
)
|
116 |
+
|
117 |
+
def preprocess(self, payload: str | None) -> str | None:
|
118 |
+
return None if payload is None else str(payload)
|
119 |
+
|
120 |
+
def postprocess(
|
121 |
+
self, y: HighlightedTextData | dict | None
|
122 |
+
) -> HighlightedTextData | None:
|
123 |
+
"""
|
124 |
+
Parameters:
|
125 |
+
y: List of (word, category) tuples, or a dictionary of two keys: "text", and "highlights", which itself is
|
126 |
+
a list of dictionaries, each of which have the keys: "highlight_type", "start", and "end"
|
127 |
+
Returns:
|
128 |
+
List of (word, category) tuples
|
129 |
+
"""
|
130 |
+
if y is None:
|
131 |
+
return None
|
132 |
+
if isinstance(y, dict):
|
133 |
+
try:
|
134 |
+
text = y["text"]
|
135 |
+
highlights = y["highlights"]
|
136 |
+
except KeyError as ke:
|
137 |
+
raise ValueError(
|
138 |
+
"Expected a dictionary with keys 'text' and 'highlights' "
|
139 |
+
"for the value of the HighlightedText component."
|
140 |
+
) from ke
|
141 |
+
if len(highlights) == 0:
|
142 |
+
y = [(text, None)]
|
143 |
+
else:
|
144 |
+
list_format = []
|
145 |
+
index = 0
|
146 |
+
entities = sorted(highlights, key=lambda x: x["start"])
|
147 |
+
for entity in entities:
|
148 |
+
list_format.append((text[index : entity["start"]], None))
|
149 |
+
highlight_type = entity.get("highlight_type")
|
150 |
+
list_format.append(
|
151 |
+
(text[entity["start"] : entity["end"]], highlight_type)
|
152 |
+
)
|
153 |
+
index = entity["end"]
|
154 |
+
list_format.append((text[index:], None))
|
155 |
+
y = list_format
|
156 |
+
if self.combine_adjacent:
|
157 |
+
output = []
|
158 |
+
running_text, running_category = None, None
|
159 |
+
for text, category in y:
|
160 |
+
if running_text is None:
|
161 |
+
running_text = text
|
162 |
+
running_category = category
|
163 |
+
elif category == running_category:
|
164 |
+
running_text += self.adjacent_separator + text
|
165 |
+
elif not text:
|
166 |
+
# Skip fully empty item, these get added in processing
|
167 |
+
# of dictionaries.
|
168 |
+
pass
|
169 |
+
else:
|
170 |
+
output.append((running_text, running_category))
|
171 |
+
running_text = text
|
172 |
+
running_category = category
|
173 |
+
if running_text is not None:
|
174 |
+
output.append((running_text, running_category))
|
175 |
+
return output
|
176 |
+
else:
|
177 |
+
return y
|
178 |
+
|
179 |
+
def example_inputs(self) -> Any:
|
180 |
+
return [("Hello", None), ("world", "highlight")]
|
src/backend/gradio_highlightedtextbox/highlightedtextbox.pyi
ADDED
@@ -0,0 +1,429 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import annotations
|
2 |
+
|
3 |
+
from typing import Any, Callable
|
4 |
+
|
5 |
+
from gradio.components.base import FormComponent
|
6 |
+
from gradio.events import Events
|
7 |
+
|
8 |
+
from gradio.events import Dependency
|
9 |
+
|
10 |
+
class HighlightedTextbox(FormComponent):
|
11 |
+
"""
|
12 |
+
Creates a textarea for user to enter string input or display string output where some
|
13 |
+
elements are highlighted.
|
14 |
+
Preprocessing: passes a list of tuples as a {List[Tuple[str, float | str | None]]]} into the function. If no labels are provided, the text will be displayed as a single span.
|
15 |
+
Postprocessing: expects a {List[Tuple[str, float | str]]]} consisting of spans of text and their associated labels, or a {Dict} with two keys:
|
16 |
+
(1) "text" whose value is the complete text, and
|
17 |
+
(2) "highlights", which is a list of dictionaries, each of which have the keys:
|
18 |
+
"highlight_type" (consisting of the highlight label),
|
19 |
+
"start" (the character index where the label starts), and
|
20 |
+
"end" (the character index where the label ends).
|
21 |
+
Highlights should not overlap.
|
22 |
+
"""
|
23 |
+
|
24 |
+
EVENTS = [
|
25 |
+
Events.change,
|
26 |
+
Events.input,
|
27 |
+
Events.select,
|
28 |
+
Events.submit,
|
29 |
+
Events.focus,
|
30 |
+
Events.blur,
|
31 |
+
]
|
32 |
+
data_model = HighlightedTextData
|
33 |
+
|
34 |
+
def __init__(
|
35 |
+
self,
|
36 |
+
value: str | Callable | None = "",
|
37 |
+
*,
|
38 |
+
color_map: dict[str, str] | None = None,
|
39 |
+
show_legend: bool = False,
|
40 |
+
show_legend_label: bool = False,
|
41 |
+
legend_label: str = "",
|
42 |
+
combine_adjacent: bool = False,
|
43 |
+
adjacent_separator: str = "",
|
44 |
+
label: str | None = None,
|
45 |
+
info: str | None = None,
|
46 |
+
every: float | None = None,
|
47 |
+
show_label: bool | None = None,
|
48 |
+
container: bool = True,
|
49 |
+
scale: int | None = None,
|
50 |
+
min_width: int = 160,
|
51 |
+
visible: bool = True,
|
52 |
+
elem_id: str | None = None,
|
53 |
+
autofocus: bool = False,
|
54 |
+
autoscroll: bool = True,
|
55 |
+
interactive: bool = True,
|
56 |
+
elem_classes: list[str] | str | None = None,
|
57 |
+
render: bool = True,
|
58 |
+
show_copy_button: bool = False,
|
59 |
+
):
|
60 |
+
"""
|
61 |
+
Parameters:
|
62 |
+
value: default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.
|
63 |
+
lines: number of lines to display in textbox.
|
64 |
+
max_lines: maximum number of lines to display in textbox.
|
65 |
+
color_map: dictionary mapping labels to colors.
|
66 |
+
show_legend: if True, will display legend.
|
67 |
+
show_legend_label: if True, will display legend label.
|
68 |
+
legend_label: label to display above legend.
|
69 |
+
combine_adjacent: if True, will combine adjacent spans with the same label.
|
70 |
+
adjacent_separator: separator to use when combining adjacent spans.
|
71 |
+
placeholder: placeholder hint to provide behind textbox.
|
72 |
+
label: component name in interface.
|
73 |
+
every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.
|
74 |
+
show_label: if True, will display label.
|
75 |
+
container: If True, will place the component in a container - providing some extra padding around the border.
|
76 |
+
scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer.
|
77 |
+
min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
|
78 |
+
interactive: if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.
|
79 |
+
visible: If False, component will be hidden.
|
80 |
+
rtl: If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.
|
81 |
+
elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
|
82 |
+
elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
|
83 |
+
render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
|
84 |
+
rtl: If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.
|
85 |
+
show_copy_button: If True, includes a copy button to copy the text in the textbox. Only applies if show_label is True.
|
86 |
+
autoscroll: If True, will automatically scroll to the bottom of the textbox when the value changes, unless the user scrolls up. If False, will not scroll to the bottom of the textbox when the value changes.
|
87 |
+
"""
|
88 |
+
self.color_map = color_map
|
89 |
+
self.show_legend = show_legend
|
90 |
+
self.show_legend_label = show_legend_label
|
91 |
+
self.legend_label = legend_label
|
92 |
+
self.combine_adjacent = combine_adjacent
|
93 |
+
self.adjacent_separator = adjacent_separator
|
94 |
+
self.show_copy_button = show_copy_button
|
95 |
+
self.autofocus = autofocus
|
96 |
+
self.autoscroll = autoscroll
|
97 |
+
super().__init__(
|
98 |
+
label=label,
|
99 |
+
info=info,
|
100 |
+
show_label=show_label,
|
101 |
+
container=container,
|
102 |
+
scale=scale,
|
103 |
+
min_width=min_width,
|
104 |
+
interactive=interactive,
|
105 |
+
visible=visible,
|
106 |
+
elem_id=elem_id,
|
107 |
+
elem_classes=elem_classes,
|
108 |
+
value=value,
|
109 |
+
render=render,
|
110 |
+
every=every,
|
111 |
+
)
|
112 |
+
|
113 |
+
def preprocess(self, payload: str | None) -> str | None:
|
114 |
+
return None if payload is None else str(payload)
|
115 |
+
|
116 |
+
def postprocess(
|
117 |
+
self, y: HighlightedTextData | dict | None
|
118 |
+
) -> HighlightedTextData | None:
|
119 |
+
"""
|
120 |
+
Parameters:
|
121 |
+
y: List of (word, category) tuples, or a dictionary of two keys: "text", and "highlights", which itself is
|
122 |
+
a list of dictionaries, each of which have the keys: "highlight_type", "start", and "end"
|
123 |
+
Returns:
|
124 |
+
List of (word, category) tuples
|
125 |
+
"""
|
126 |
+
if y is None:
|
127 |
+
return None
|
128 |
+
if isinstance(y, dict):
|
129 |
+
try:
|
130 |
+
text = y["text"]
|
131 |
+
highlights = y["highlights"]
|
132 |
+
except KeyError as ke:
|
133 |
+
raise ValueError(
|
134 |
+
"Expected a dictionary with keys 'text' and 'highlights' "
|
135 |
+
"for the value of the HighlightedText component."
|
136 |
+
) from ke
|
137 |
+
if len(highlights) == 0:
|
138 |
+
y = [(text, None)]
|
139 |
+
else:
|
140 |
+
list_format = []
|
141 |
+
index = 0
|
142 |
+
entities = sorted(highlights, key=lambda x: x["start"])
|
143 |
+
for entity in entities:
|
144 |
+
list_format.append((text[index : entity["start"]], None))
|
145 |
+
highlight_type = entity.get("highlight_type")
|
146 |
+
list_format.append(
|
147 |
+
(text[entity["start"] : entity["end"]], highlight_type)
|
148 |
+
)
|
149 |
+
index = entity["end"]
|
150 |
+
list_format.append((text[index:], None))
|
151 |
+
y = list_format
|
152 |
+
if self.combine_adjacent:
|
153 |
+
output = []
|
154 |
+
running_text, running_category = None, None
|
155 |
+
for text, category in y:
|
156 |
+
if running_text is None:
|
157 |
+
running_text = text
|
158 |
+
running_category = category
|
159 |
+
elif category == running_category:
|
160 |
+
running_text += self.adjacent_separator + text
|
161 |
+
elif not text:
|
162 |
+
# Skip fully empty item, these get added in processing
|
163 |
+
# of dictionaries.
|
164 |
+
pass
|
165 |
+
else:
|
166 |
+
output.append((running_text, running_category))
|
167 |
+
running_text = text
|
168 |
+
running_category = category
|
169 |
+
if running_text is not None:
|
170 |
+
output.append((running_text, running_category))
|
171 |
+
return output
|
172 |
+
else:
|
173 |
+
return y
|
174 |
+
|
175 |
+
def example_inputs(self) -> Any:
|
176 |
+
return [("Hello", None), ("world", "highlight")]
|
177 |
+
|
178 |
+
|
179 |
+
def change(self,
|
180 |
+
fn: Callable | None,
|
181 |
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
182 |
+
outputs: Component | Sequence[Component] | None = None,
|
183 |
+
api_name: str | None | Literal[False] = None,
|
184 |
+
scroll_to_output: bool = False,
|
185 |
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
186 |
+
queue: bool | None = None,
|
187 |
+
batch: bool = False,
|
188 |
+
max_batch_size: int = 4,
|
189 |
+
preprocess: bool = True,
|
190 |
+
postprocess: bool = True,
|
191 |
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
192 |
+
every: float | None = None,
|
193 |
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
194 |
+
js: str | None = None,
|
195 |
+
concurrency_limit: int | None | Literal["default"] = "default",
|
196 |
+
concurrency_id: str | None = None,
|
197 |
+
show_api: bool = True) -> Dependency:
|
198 |
+
"""
|
199 |
+
Parameters:
|
200 |
+
fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
|
201 |
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
202 |
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
203 |
+
api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
|
204 |
+
scroll_to_output: If True, will scroll to output component on completion
|
205 |
+
show_progress: If True, will show progress animation while pending
|
206 |
+
queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
|
207 |
+
batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
|
208 |
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
209 |
+
preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
|
210 |
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
211 |
+
cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
|
212 |
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.
|
213 |
+
trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` event) would allow a second submission after the pending event is complete.
|
214 |
+
js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
|
215 |
+
concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
|
216 |
+
concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
|
217 |
+
show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
|
218 |
+
"""
|
219 |
+
...
|
220 |
+
|
221 |
+
def input(self,
|
222 |
+
fn: Callable | None,
|
223 |
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
224 |
+
outputs: Component | Sequence[Component] | None = None,
|
225 |
+
api_name: str | None | Literal[False] = None,
|
226 |
+
scroll_to_output: bool = False,
|
227 |
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
228 |
+
queue: bool | None = None,
|
229 |
+
batch: bool = False,
|
230 |
+
max_batch_size: int = 4,
|
231 |
+
preprocess: bool = True,
|
232 |
+
postprocess: bool = True,
|
233 |
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
234 |
+
every: float | None = None,
|
235 |
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
236 |
+
js: str | None = None,
|
237 |
+
concurrency_limit: int | None | Literal["default"] = "default",
|
238 |
+
concurrency_id: str | None = None,
|
239 |
+
show_api: bool = True) -> Dependency:
|
240 |
+
"""
|
241 |
+
Parameters:
|
242 |
+
fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
|
243 |
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
244 |
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
245 |
+
api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
|
246 |
+
scroll_to_output: If True, will scroll to output component on completion
|
247 |
+
show_progress: If True, will show progress animation while pending
|
248 |
+
queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
|
249 |
+
batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
|
250 |
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
251 |
+
preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
|
252 |
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
253 |
+
cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
|
254 |
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.
|
255 |
+
trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` event) would allow a second submission after the pending event is complete.
|
256 |
+
js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
|
257 |
+
concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
|
258 |
+
concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
|
259 |
+
show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
|
260 |
+
"""
|
261 |
+
...
|
262 |
+
|
263 |
+
def select(self,
|
264 |
+
fn: Callable | None,
|
265 |
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
266 |
+
outputs: Component | Sequence[Component] | None = None,
|
267 |
+
api_name: str | None | Literal[False] = None,
|
268 |
+
scroll_to_output: bool = False,
|
269 |
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
270 |
+
queue: bool | None = None,
|
271 |
+
batch: bool = False,
|
272 |
+
max_batch_size: int = 4,
|
273 |
+
preprocess: bool = True,
|
274 |
+
postprocess: bool = True,
|
275 |
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
276 |
+
every: float | None = None,
|
277 |
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
278 |
+
js: str | None = None,
|
279 |
+
concurrency_limit: int | None | Literal["default"] = "default",
|
280 |
+
concurrency_id: str | None = None,
|
281 |
+
show_api: bool = True) -> Dependency:
|
282 |
+
"""
|
283 |
+
Parameters:
|
284 |
+
fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
|
285 |
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
286 |
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
287 |
+
api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
|
288 |
+
scroll_to_output: If True, will scroll to output component on completion
|
289 |
+
show_progress: If True, will show progress animation while pending
|
290 |
+
queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
|
291 |
+
batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
|
292 |
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
293 |
+
preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
|
294 |
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
295 |
+
cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
|
296 |
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.
|
297 |
+
trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` event) would allow a second submission after the pending event is complete.
|
298 |
+
js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
|
299 |
+
concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
|
300 |
+
concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
|
301 |
+
show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
|
302 |
+
"""
|
303 |
+
...
|
304 |
+
|
305 |
+
def submit(self,
|
306 |
+
fn: Callable | None,
|
307 |
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
308 |
+
outputs: Component | Sequence[Component] | None = None,
|
309 |
+
api_name: str | None | Literal[False] = None,
|
310 |
+
scroll_to_output: bool = False,
|
311 |
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
312 |
+
queue: bool | None = None,
|
313 |
+
batch: bool = False,
|
314 |
+
max_batch_size: int = 4,
|
315 |
+
preprocess: bool = True,
|
316 |
+
postprocess: bool = True,
|
317 |
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
318 |
+
every: float | None = None,
|
319 |
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
320 |
+
js: str | None = None,
|
321 |
+
concurrency_limit: int | None | Literal["default"] = "default",
|
322 |
+
concurrency_id: str | None = None,
|
323 |
+
show_api: bool = True) -> Dependency:
|
324 |
+
"""
|
325 |
+
Parameters:
|
326 |
+
fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
|
327 |
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
328 |
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
329 |
+
api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
|
330 |
+
scroll_to_output: If True, will scroll to output component on completion
|
331 |
+
show_progress: If True, will show progress animation while pending
|
332 |
+
queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
|
333 |
+
batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
|
334 |
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
335 |
+
preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
|
336 |
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
337 |
+
cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
|
338 |
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.
|
339 |
+
trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` event) would allow a second submission after the pending event is complete.
|
340 |
+
js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
|
341 |
+
concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
|
342 |
+
concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
|
343 |
+
show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
|
344 |
+
"""
|
345 |
+
...
|
346 |
+
|
347 |
+
def focus(self,
|
348 |
+
fn: Callable | None,
|
349 |
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
350 |
+
outputs: Component | Sequence[Component] | None = None,
|
351 |
+
api_name: str | None | Literal[False] = None,
|
352 |
+
scroll_to_output: bool = False,
|
353 |
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
354 |
+
queue: bool | None = None,
|
355 |
+
batch: bool = False,
|
356 |
+
max_batch_size: int = 4,
|
357 |
+
preprocess: bool = True,
|
358 |
+
postprocess: bool = True,
|
359 |
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
360 |
+
every: float | None = None,
|
361 |
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
362 |
+
js: str | None = None,
|
363 |
+
concurrency_limit: int | None | Literal["default"] = "default",
|
364 |
+
concurrency_id: str | None = None,
|
365 |
+
show_api: bool = True) -> Dependency:
|
366 |
+
"""
|
367 |
+
Parameters:
|
368 |
+
fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
|
369 |
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
370 |
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
371 |
+
api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
|
372 |
+
scroll_to_output: If True, will scroll to output component on completion
|
373 |
+
show_progress: If True, will show progress animation while pending
|
374 |
+
queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
|
375 |
+
batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
|
376 |
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
377 |
+
preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
|
378 |
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
379 |
+
cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
|
380 |
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.
|
381 |
+
trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` event) would allow a second submission after the pending event is complete.
|
382 |
+
js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
|
383 |
+
concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
|
384 |
+
concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
|
385 |
+
show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
|
386 |
+
"""
|
387 |
+
...
|
388 |
+
|
389 |
+
def blur(self,
|
390 |
+
fn: Callable | None,
|
391 |
+
inputs: Component | Sequence[Component] | set[Component] | None = None,
|
392 |
+
outputs: Component | Sequence[Component] | None = None,
|
393 |
+
api_name: str | None | Literal[False] = None,
|
394 |
+
scroll_to_output: bool = False,
|
395 |
+
show_progress: Literal["full", "minimal", "hidden"] = "full",
|
396 |
+
queue: bool | None = None,
|
397 |
+
batch: bool = False,
|
398 |
+
max_batch_size: int = 4,
|
399 |
+
preprocess: bool = True,
|
400 |
+
postprocess: bool = True,
|
401 |
+
cancels: dict[str, Any] | list[dict[str, Any]] | None = None,
|
402 |
+
every: float | None = None,
|
403 |
+
trigger_mode: Literal["once", "multiple", "always_last"] | None = None,
|
404 |
+
js: str | None = None,
|
405 |
+
concurrency_limit: int | None | Literal["default"] = "default",
|
406 |
+
concurrency_id: str | None = None,
|
407 |
+
show_api: bool = True) -> Dependency:
|
408 |
+
"""
|
409 |
+
Parameters:
|
410 |
+
fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.
|
411 |
+
inputs: List of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.
|
412 |
+
outputs: List of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.
|
413 |
+
api_name: Defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.
|
414 |
+
scroll_to_output: If True, will scroll to output component on completion
|
415 |
+
show_progress: If True, will show progress animation while pending
|
416 |
+
queue: If True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.
|
417 |
+
batch: If True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.
|
418 |
+
max_batch_size: Maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)
|
419 |
+
preprocess: If False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).
|
420 |
+
postprocess: If False, will not run postprocessing of component data before returning 'fn' output to the browser.
|
421 |
+
cancels: A list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.
|
422 |
+
every: Run this event 'every' number of seconds while the client connection is open. Interpreted in seconds. Queue must be enabled.
|
423 |
+
trigger_mode: If "once" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to "multiple", unlimited submissions are allowed while pending, and "always_last" (default for `.change()` event) would allow a second submission after the pending event is complete.
|
424 |
+
js: Optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.
|
425 |
+
concurrency_limit: If set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to "default" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).
|
426 |
+
concurrency_id: If set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.
|
427 |
+
show_api: whether to show this event in the "view API" page of the Gradio app, or in the ".view_api()" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps to use this event. If fn is None, show_api will automatically be set to False.
|
428 |
+
"""
|
429 |
+
...
|
src/backend/gradio_highlightedtextbox/templates/component/index.js
ADDED
@@ -0,0 +1,3172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const {
|
2 |
+
SvelteComponent: el,
|
3 |
+
assign: tl,
|
4 |
+
create_slot: ll,
|
5 |
+
detach: nl,
|
6 |
+
element: il,
|
7 |
+
get_all_dirty_from_scope: sl,
|
8 |
+
get_slot_changes: ol,
|
9 |
+
get_spread_update: fl,
|
10 |
+
init: _l,
|
11 |
+
insert: al,
|
12 |
+
safe_not_equal: rl,
|
13 |
+
set_dynamic_element_data: et,
|
14 |
+
set_style: N,
|
15 |
+
toggle_class: x,
|
16 |
+
transition_in: Ot,
|
17 |
+
transition_out: Rt,
|
18 |
+
update_slot_base: ul
|
19 |
+
} = window.__gradio__svelte__internal;
|
20 |
+
function cl(n) {
|
21 |
+
let e, t, l;
|
22 |
+
const i = (
|
23 |
+
/*#slots*/
|
24 |
+
n[18].default
|
25 |
+
), s = ll(
|
26 |
+
i,
|
27 |
+
n,
|
28 |
+
/*$$scope*/
|
29 |
+
n[17],
|
30 |
+
null
|
31 |
+
);
|
32 |
+
let o = [
|
33 |
+
{ "data-testid": (
|
34 |
+
/*test_id*/
|
35 |
+
n[7]
|
36 |
+
) },
|
37 |
+
{ id: (
|
38 |
+
/*elem_id*/
|
39 |
+
n[2]
|
40 |
+
) },
|
41 |
+
{
|
42 |
+
class: t = "block " + /*elem_classes*/
|
43 |
+
n[3].join(" ") + " svelte-1t38q2d"
|
44 |
+
}
|
45 |
+
], _ = {};
|
46 |
+
for (let f = 0; f < o.length; f += 1)
|
47 |
+
_ = tl(_, o[f]);
|
48 |
+
return {
|
49 |
+
c() {
|
50 |
+
e = il(
|
51 |
+
/*tag*/
|
52 |
+
n[14]
|
53 |
+
), s && s.c(), et(
|
54 |
+
/*tag*/
|
55 |
+
n[14]
|
56 |
+
)(e, _), x(
|
57 |
+
e,
|
58 |
+
"hidden",
|
59 |
+
/*visible*/
|
60 |
+
n[10] === !1
|
61 |
+
), x(
|
62 |
+
e,
|
63 |
+
"padded",
|
64 |
+
/*padding*/
|
65 |
+
n[6]
|
66 |
+
), x(
|
67 |
+
e,
|
68 |
+
"border_focus",
|
69 |
+
/*border_mode*/
|
70 |
+
n[5] === "focus"
|
71 |
+
), x(e, "hide-container", !/*explicit_call*/
|
72 |
+
n[8] && !/*container*/
|
73 |
+
n[9]), N(
|
74 |
+
e,
|
75 |
+
"height",
|
76 |
+
/*get_dimension*/
|
77 |
+
n[15](
|
78 |
+
/*height*/
|
79 |
+
n[0]
|
80 |
+
)
|
81 |
+
), N(e, "width", typeof /*width*/
|
82 |
+
n[1] == "number" ? `calc(min(${/*width*/
|
83 |
+
n[1]}px, 100%))` : (
|
84 |
+
/*get_dimension*/
|
85 |
+
n[15](
|
86 |
+
/*width*/
|
87 |
+
n[1]
|
88 |
+
)
|
89 |
+
)), N(
|
90 |
+
e,
|
91 |
+
"border-style",
|
92 |
+
/*variant*/
|
93 |
+
n[4]
|
94 |
+
), N(
|
95 |
+
e,
|
96 |
+
"overflow",
|
97 |
+
/*allow_overflow*/
|
98 |
+
n[11] ? "visible" : "hidden"
|
99 |
+
), N(
|
100 |
+
e,
|
101 |
+
"flex-grow",
|
102 |
+
/*scale*/
|
103 |
+
n[12]
|
104 |
+
), N(e, "min-width", `calc(min(${/*min_width*/
|
105 |
+
n[13]}px, 100%))`), N(e, "border-width", "var(--block-border-width)");
|
106 |
+
},
|
107 |
+
m(f, a) {
|
108 |
+
al(f, e, a), s && s.m(e, null), l = !0;
|
109 |
+
},
|
110 |
+
p(f, a) {
|
111 |
+
s && s.p && (!l || a & /*$$scope*/
|
112 |
+
131072) && ul(
|
113 |
+
s,
|
114 |
+
i,
|
115 |
+
f,
|
116 |
+
/*$$scope*/
|
117 |
+
f[17],
|
118 |
+
l ? ol(
|
119 |
+
i,
|
120 |
+
/*$$scope*/
|
121 |
+
f[17],
|
122 |
+
a,
|
123 |
+
null
|
124 |
+
) : sl(
|
125 |
+
/*$$scope*/
|
126 |
+
f[17]
|
127 |
+
),
|
128 |
+
null
|
129 |
+
), et(
|
130 |
+
/*tag*/
|
131 |
+
f[14]
|
132 |
+
)(e, _ = fl(o, [
|
133 |
+
(!l || a & /*test_id*/
|
134 |
+
128) && { "data-testid": (
|
135 |
+
/*test_id*/
|
136 |
+
f[7]
|
137 |
+
) },
|
138 |
+
(!l || a & /*elem_id*/
|
139 |
+
4) && { id: (
|
140 |
+
/*elem_id*/
|
141 |
+
f[2]
|
142 |
+
) },
|
143 |
+
(!l || a & /*elem_classes*/
|
144 |
+
8 && t !== (t = "block " + /*elem_classes*/
|
145 |
+
f[3].join(" ") + " svelte-1t38q2d")) && { class: t }
|
146 |
+
])), x(
|
147 |
+
e,
|
148 |
+
"hidden",
|
149 |
+
/*visible*/
|
150 |
+
f[10] === !1
|
151 |
+
), x(
|
152 |
+
e,
|
153 |
+
"padded",
|
154 |
+
/*padding*/
|
155 |
+
f[6]
|
156 |
+
), x(
|
157 |
+
e,
|
158 |
+
"border_focus",
|
159 |
+
/*border_mode*/
|
160 |
+
f[5] === "focus"
|
161 |
+
), x(e, "hide-container", !/*explicit_call*/
|
162 |
+
f[8] && !/*container*/
|
163 |
+
f[9]), a & /*height*/
|
164 |
+
1 && N(
|
165 |
+
e,
|
166 |
+
"height",
|
167 |
+
/*get_dimension*/
|
168 |
+
f[15](
|
169 |
+
/*height*/
|
170 |
+
f[0]
|
171 |
+
)
|
172 |
+
), a & /*width*/
|
173 |
+
2 && N(e, "width", typeof /*width*/
|
174 |
+
f[1] == "number" ? `calc(min(${/*width*/
|
175 |
+
f[1]}px, 100%))` : (
|
176 |
+
/*get_dimension*/
|
177 |
+
f[15](
|
178 |
+
/*width*/
|
179 |
+
f[1]
|
180 |
+
)
|
181 |
+
)), a & /*variant*/
|
182 |
+
16 && N(
|
183 |
+
e,
|
184 |
+
"border-style",
|
185 |
+
/*variant*/
|
186 |
+
f[4]
|
187 |
+
), a & /*allow_overflow*/
|
188 |
+
2048 && N(
|
189 |
+
e,
|
190 |
+
"overflow",
|
191 |
+
/*allow_overflow*/
|
192 |
+
f[11] ? "visible" : "hidden"
|
193 |
+
), a & /*scale*/
|
194 |
+
4096 && N(
|
195 |
+
e,
|
196 |
+
"flex-grow",
|
197 |
+
/*scale*/
|
198 |
+
f[12]
|
199 |
+
), a & /*min_width*/
|
200 |
+
8192 && N(e, "min-width", `calc(min(${/*min_width*/
|
201 |
+
f[13]}px, 100%))`);
|
202 |
+
},
|
203 |
+
i(f) {
|
204 |
+
l || (Ot(s, f), l = !0);
|
205 |
+
},
|
206 |
+
o(f) {
|
207 |
+
Rt(s, f), l = !1;
|
208 |
+
},
|
209 |
+
d(f) {
|
210 |
+
f && nl(e), s && s.d(f);
|
211 |
+
}
|
212 |
+
};
|
213 |
+
}
|
214 |
+
function dl(n) {
|
215 |
+
let e, t = (
|
216 |
+
/*tag*/
|
217 |
+
n[14] && cl(n)
|
218 |
+
);
|
219 |
+
return {
|
220 |
+
c() {
|
221 |
+
t && t.c();
|
222 |
+
},
|
223 |
+
m(l, i) {
|
224 |
+
t && t.m(l, i), e = !0;
|
225 |
+
},
|
226 |
+
p(l, [i]) {
|
227 |
+
/*tag*/
|
228 |
+
l[14] && t.p(l, i);
|
229 |
+
},
|
230 |
+
i(l) {
|
231 |
+
e || (Ot(t, l), e = !0);
|
232 |
+
},
|
233 |
+
o(l) {
|
234 |
+
Rt(t, l), e = !1;
|
235 |
+
},
|
236 |
+
d(l) {
|
237 |
+
t && t.d(l);
|
238 |
+
}
|
239 |
+
};
|
240 |
+
}
|
241 |
+
function ml(n, e, t) {
|
242 |
+
let { $$slots: l = {}, $$scope: i } = e, { height: s = void 0 } = e, { width: o = void 0 } = e, { elem_id: _ = "" } = e, { elem_classes: f = [] } = e, { variant: a = "solid" } = e, { border_mode: r = "base" } = e, { padding: u = !0 } = e, { type: c = "normal" } = e, { test_id: m = void 0 } = e, { explicit_call: p = !1 } = e, { container: T = !0 } = e, { visible: L = !0 } = e, { allow_overflow: S = !0 } = e, { scale: C = null } = e, { min_width: d = 0 } = e, y = c === "fieldset" ? "fieldset" : "div";
|
243 |
+
const M = (h) => {
|
244 |
+
if (h !== void 0) {
|
245 |
+
if (typeof h == "number")
|
246 |
+
return h + "px";
|
247 |
+
if (typeof h == "string")
|
248 |
+
return h;
|
249 |
+
}
|
250 |
+
};
|
251 |
+
return n.$$set = (h) => {
|
252 |
+
"height" in h && t(0, s = h.height), "width" in h && t(1, o = h.width), "elem_id" in h && t(2, _ = h.elem_id), "elem_classes" in h && t(3, f = h.elem_classes), "variant" in h && t(4, a = h.variant), "border_mode" in h && t(5, r = h.border_mode), "padding" in h && t(6, u = h.padding), "type" in h && t(16, c = h.type), "test_id" in h && t(7, m = h.test_id), "explicit_call" in h && t(8, p = h.explicit_call), "container" in h && t(9, T = h.container), "visible" in h && t(10, L = h.visible), "allow_overflow" in h && t(11, S = h.allow_overflow), "scale" in h && t(12, C = h.scale), "min_width" in h && t(13, d = h.min_width), "$$scope" in h && t(17, i = h.$$scope);
|
253 |
+
}, [
|
254 |
+
s,
|
255 |
+
o,
|
256 |
+
_,
|
257 |
+
f,
|
258 |
+
a,
|
259 |
+
r,
|
260 |
+
u,
|
261 |
+
m,
|
262 |
+
p,
|
263 |
+
T,
|
264 |
+
L,
|
265 |
+
S,
|
266 |
+
C,
|
267 |
+
d,
|
268 |
+
y,
|
269 |
+
M,
|
270 |
+
c,
|
271 |
+
i,
|
272 |
+
l
|
273 |
+
];
|
274 |
+
}
|
275 |
+
class bl extends el {
|
276 |
+
constructor(e) {
|
277 |
+
super(), _l(this, e, ml, dl, rl, {
|
278 |
+
height: 0,
|
279 |
+
width: 1,
|
280 |
+
elem_id: 2,
|
281 |
+
elem_classes: 3,
|
282 |
+
variant: 4,
|
283 |
+
border_mode: 5,
|
284 |
+
padding: 6,
|
285 |
+
type: 16,
|
286 |
+
test_id: 7,
|
287 |
+
explicit_call: 8,
|
288 |
+
container: 9,
|
289 |
+
visible: 10,
|
290 |
+
allow_overflow: 11,
|
291 |
+
scale: 12,
|
292 |
+
min_width: 13
|
293 |
+
});
|
294 |
+
}
|
295 |
+
}
|
296 |
+
const {
|
297 |
+
SvelteComponent: hl,
|
298 |
+
attr: gl,
|
299 |
+
create_slot: wl,
|
300 |
+
detach: pl,
|
301 |
+
element: kl,
|
302 |
+
get_all_dirty_from_scope: vl,
|
303 |
+
get_slot_changes: yl,
|
304 |
+
init: Cl,
|
305 |
+
insert: ql,
|
306 |
+
safe_not_equal: Ll,
|
307 |
+
transition_in: Sl,
|
308 |
+
transition_out: Tl,
|
309 |
+
update_slot_base: Fl
|
310 |
+
} = window.__gradio__svelte__internal;
|
311 |
+
function Ml(n) {
|
312 |
+
let e, t;
|
313 |
+
const l = (
|
314 |
+
/*#slots*/
|
315 |
+
n[1].default
|
316 |
+
), i = wl(
|
317 |
+
l,
|
318 |
+
n,
|
319 |
+
/*$$scope*/
|
320 |
+
n[0],
|
321 |
+
null
|
322 |
+
);
|
323 |
+
return {
|
324 |
+
c() {
|
325 |
+
e = kl("div"), i && i.c(), gl(e, "class", "svelte-1hnfib2");
|
326 |
+
},
|
327 |
+
m(s, o) {
|
328 |
+
ql(s, e, o), i && i.m(e, null), t = !0;
|
329 |
+
},
|
330 |
+
p(s, [o]) {
|
331 |
+
i && i.p && (!t || o & /*$$scope*/
|
332 |
+
1) && Fl(
|
333 |
+
i,
|
334 |
+
l,
|
335 |
+
s,
|
336 |
+
/*$$scope*/
|
337 |
+
s[0],
|
338 |
+
t ? yl(
|
339 |
+
l,
|
340 |
+
/*$$scope*/
|
341 |
+
s[0],
|
342 |
+
o,
|
343 |
+
null
|
344 |
+
) : vl(
|
345 |
+
/*$$scope*/
|
346 |
+
s[0]
|
347 |
+
),
|
348 |
+
null
|
349 |
+
);
|
350 |
+
},
|
351 |
+
i(s) {
|
352 |
+
t || (Sl(i, s), t = !0);
|
353 |
+
},
|
354 |
+
o(s) {
|
355 |
+
Tl(i, s), t = !1;
|
356 |
+
},
|
357 |
+
d(s) {
|
358 |
+
s && pl(e), i && i.d(s);
|
359 |
+
}
|
360 |
+
};
|
361 |
+
}
|
362 |
+
function jl(n, e, t) {
|
363 |
+
let { $$slots: l = {}, $$scope: i } = e;
|
364 |
+
return n.$$set = (s) => {
|
365 |
+
"$$scope" in s && t(0, i = s.$$scope);
|
366 |
+
}, [i, l];
|
367 |
+
}
|
368 |
+
class Vl extends hl {
|
369 |
+
constructor(e) {
|
370 |
+
super(), Cl(this, e, jl, Ml, Ll, {});
|
371 |
+
}
|
372 |
+
}
|
373 |
+
const {
|
374 |
+
SvelteComponent: Hl,
|
375 |
+
attr: tt,
|
376 |
+
check_outros: Nl,
|
377 |
+
create_component: zl,
|
378 |
+
create_slot: Zl,
|
379 |
+
destroy_component: Al,
|
380 |
+
detach: je,
|
381 |
+
element: Bl,
|
382 |
+
empty: Pl,
|
383 |
+
get_all_dirty_from_scope: Dl,
|
384 |
+
get_slot_changes: El,
|
385 |
+
group_outros: Il,
|
386 |
+
init: Ol,
|
387 |
+
insert: Ve,
|
388 |
+
mount_component: Rl,
|
389 |
+
safe_not_equal: Ul,
|
390 |
+
set_data: Xl,
|
391 |
+
space: Yl,
|
392 |
+
text: Gl,
|
393 |
+
toggle_class: ue,
|
394 |
+
transition_in: ve,
|
395 |
+
transition_out: He,
|
396 |
+
update_slot_base: Wl
|
397 |
+
} = window.__gradio__svelte__internal;
|
398 |
+
function lt(n) {
|
399 |
+
let e, t;
|
400 |
+
return e = new Vl({
|
401 |
+
props: {
|
402 |
+
$$slots: { default: [Jl] },
|
403 |
+
$$scope: { ctx: n }
|
404 |
+
}
|
405 |
+
}), {
|
406 |
+
c() {
|
407 |
+
zl(e.$$.fragment);
|
408 |
+
},
|
409 |
+
m(l, i) {
|
410 |
+
Rl(e, l, i), t = !0;
|
411 |
+
},
|
412 |
+
p(l, i) {
|
413 |
+
const s = {};
|
414 |
+
i & /*$$scope, info*/
|
415 |
+
10 && (s.$$scope = { dirty: i, ctx: l }), e.$set(s);
|
416 |
+
},
|
417 |
+
i(l) {
|
418 |
+
t || (ve(e.$$.fragment, l), t = !0);
|
419 |
+
},
|
420 |
+
o(l) {
|
421 |
+
He(e.$$.fragment, l), t = !1;
|
422 |
+
},
|
423 |
+
d(l) {
|
424 |
+
Al(e, l);
|
425 |
+
}
|
426 |
+
};
|
427 |
+
}
|
428 |
+
function Jl(n) {
|
429 |
+
let e;
|
430 |
+
return {
|
431 |
+
c() {
|
432 |
+
e = Gl(
|
433 |
+
/*info*/
|
434 |
+
n[1]
|
435 |
+
);
|
436 |
+
},
|
437 |
+
m(t, l) {
|
438 |
+
Ve(t, e, l);
|
439 |
+
},
|
440 |
+
p(t, l) {
|
441 |
+
l & /*info*/
|
442 |
+
2 && Xl(
|
443 |
+
e,
|
444 |
+
/*info*/
|
445 |
+
t[1]
|
446 |
+
);
|
447 |
+
},
|
448 |
+
d(t) {
|
449 |
+
t && je(e);
|
450 |
+
}
|
451 |
+
};
|
452 |
+
}
|
453 |
+
function Kl(n) {
|
454 |
+
let e, t, l, i;
|
455 |
+
const s = (
|
456 |
+
/*#slots*/
|
457 |
+
n[2].default
|
458 |
+
), o = Zl(
|
459 |
+
s,
|
460 |
+
n,
|
461 |
+
/*$$scope*/
|
462 |
+
n[3],
|
463 |
+
null
|
464 |
+
);
|
465 |
+
let _ = (
|
466 |
+
/*info*/
|
467 |
+
n[1] && lt(n)
|
468 |
+
);
|
469 |
+
return {
|
470 |
+
c() {
|
471 |
+
e = Bl("span"), o && o.c(), t = Yl(), _ && _.c(), l = Pl(), tt(e, "data-testid", "block-info"), tt(e, "class", "svelte-22c38v"), ue(e, "sr-only", !/*show_label*/
|
472 |
+
n[0]), ue(e, "hide", !/*show_label*/
|
473 |
+
n[0]), ue(
|
474 |
+
e,
|
475 |
+
"has-info",
|
476 |
+
/*info*/
|
477 |
+
n[1] != null
|
478 |
+
);
|
479 |
+
},
|
480 |
+
m(f, a) {
|
481 |
+
Ve(f, e, a), o && o.m(e, null), Ve(f, t, a), _ && _.m(f, a), Ve(f, l, a), i = !0;
|
482 |
+
},
|
483 |
+
p(f, [a]) {
|
484 |
+
o && o.p && (!i || a & /*$$scope*/
|
485 |
+
8) && Wl(
|
486 |
+
o,
|
487 |
+
s,
|
488 |
+
f,
|
489 |
+
/*$$scope*/
|
490 |
+
f[3],
|
491 |
+
i ? El(
|
492 |
+
s,
|
493 |
+
/*$$scope*/
|
494 |
+
f[3],
|
495 |
+
a,
|
496 |
+
null
|
497 |
+
) : Dl(
|
498 |
+
/*$$scope*/
|
499 |
+
f[3]
|
500 |
+
),
|
501 |
+
null
|
502 |
+
), (!i || a & /*show_label*/
|
503 |
+
1) && ue(e, "sr-only", !/*show_label*/
|
504 |
+
f[0]), (!i || a & /*show_label*/
|
505 |
+
1) && ue(e, "hide", !/*show_label*/
|
506 |
+
f[0]), (!i || a & /*info*/
|
507 |
+
2) && ue(
|
508 |
+
e,
|
509 |
+
"has-info",
|
510 |
+
/*info*/
|
511 |
+
f[1] != null
|
512 |
+
), /*info*/
|
513 |
+
f[1] ? _ ? (_.p(f, a), a & /*info*/
|
514 |
+
2 && ve(_, 1)) : (_ = lt(f), _.c(), ve(_, 1), _.m(l.parentNode, l)) : _ && (Il(), He(_, 1, 1, () => {
|
515 |
+
_ = null;
|
516 |
+
}), Nl());
|
517 |
+
},
|
518 |
+
i(f) {
|
519 |
+
i || (ve(o, f), ve(_), i = !0);
|
520 |
+
},
|
521 |
+
o(f) {
|
522 |
+
He(o, f), He(_), i = !1;
|
523 |
+
},
|
524 |
+
d(f) {
|
525 |
+
f && (je(e), je(t), je(l)), o && o.d(f), _ && _.d(f);
|
526 |
+
}
|
527 |
+
};
|
528 |
+
}
|
529 |
+
function Ql(n, e, t) {
|
530 |
+
let { $$slots: l = {}, $$scope: i } = e, { show_label: s = !0 } = e, { info: o = void 0 } = e;
|
531 |
+
return n.$$set = (_) => {
|
532 |
+
"show_label" in _ && t(0, s = _.show_label), "info" in _ && t(1, o = _.info), "$$scope" in _ && t(3, i = _.$$scope);
|
533 |
+
}, [s, o, l, i];
|
534 |
+
}
|
535 |
+
class xl extends Hl {
|
536 |
+
constructor(e) {
|
537 |
+
super(), Ol(this, e, Ql, Kl, Ul, { show_label: 0, info: 1 });
|
538 |
+
}
|
539 |
+
}
|
540 |
+
const {
|
541 |
+
SvelteComponent: $l,
|
542 |
+
append: en,
|
543 |
+
attr: $,
|
544 |
+
detach: tn,
|
545 |
+
init: ln,
|
546 |
+
insert: nn,
|
547 |
+
noop: De,
|
548 |
+
safe_not_equal: sn,
|
549 |
+
svg_element: nt
|
550 |
+
} = window.__gradio__svelte__internal;
|
551 |
+
function on(n) {
|
552 |
+
let e, t;
|
553 |
+
return {
|
554 |
+
c() {
|
555 |
+
e = nt("svg"), t = nt("polyline"), $(t, "points", "20 6 9 17 4 12"), $(e, "xmlns", "http://www.w3.org/2000/svg"), $(e, "viewBox", "2 0 20 20"), $(e, "fill", "none"), $(e, "stroke", "currentColor"), $(e, "stroke-width", "3"), $(e, "stroke-linecap", "round"), $(e, "stroke-linejoin", "round");
|
556 |
+
},
|
557 |
+
m(l, i) {
|
558 |
+
nn(l, e, i), en(e, t);
|
559 |
+
},
|
560 |
+
p: De,
|
561 |
+
i: De,
|
562 |
+
o: De,
|
563 |
+
d(l) {
|
564 |
+
l && tn(e);
|
565 |
+
}
|
566 |
+
};
|
567 |
+
}
|
568 |
+
class fn extends $l {
|
569 |
+
constructor(e) {
|
570 |
+
super(), ln(this, e, null, on, sn, {});
|
571 |
+
}
|
572 |
+
}
|
573 |
+
const {
|
574 |
+
SvelteComponent: _n,
|
575 |
+
append: it,
|
576 |
+
attr: ne,
|
577 |
+
detach: an,
|
578 |
+
init: rn,
|
579 |
+
insert: un,
|
580 |
+
noop: Ee,
|
581 |
+
safe_not_equal: cn,
|
582 |
+
svg_element: Ie
|
583 |
+
} = window.__gradio__svelte__internal;
|
584 |
+
function dn(n) {
|
585 |
+
let e, t, l;
|
586 |
+
return {
|
587 |
+
c() {
|
588 |
+
e = Ie("svg"), t = Ie("path"), l = Ie("path"), ne(t, "fill", "currentColor"), ne(t, "d", "M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z"), ne(l, "fill", "currentColor"), ne(l, "d", "M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z"), ne(e, "xmlns", "http://www.w3.org/2000/svg"), ne(e, "viewBox", "0 0 33 33"), ne(e, "color", "currentColor");
|
589 |
+
},
|
590 |
+
m(i, s) {
|
591 |
+
un(i, e, s), it(e, t), it(e, l);
|
592 |
+
},
|
593 |
+
p: Ee,
|
594 |
+
i: Ee,
|
595 |
+
o: Ee,
|
596 |
+
d(i) {
|
597 |
+
i && an(e);
|
598 |
+
}
|
599 |
+
};
|
600 |
+
}
|
601 |
+
class mn extends _n {
|
602 |
+
constructor(e) {
|
603 |
+
super(), rn(this, e, null, dn, cn, {});
|
604 |
+
}
|
605 |
+
}
|
606 |
+
const st = [
|
607 |
+
"red",
|
608 |
+
"green",
|
609 |
+
"blue",
|
610 |
+
"yellow",
|
611 |
+
"purple",
|
612 |
+
"teal",
|
613 |
+
"orange",
|
614 |
+
"cyan",
|
615 |
+
"lime",
|
616 |
+
"pink"
|
617 |
+
], bn = [
|
618 |
+
{ color: "red", primary: 600, secondary: 100 },
|
619 |
+
{ color: "green", primary: 600, secondary: 100 },
|
620 |
+
{ color: "blue", primary: 600, secondary: 100 },
|
621 |
+
{ color: "yellow", primary: 500, secondary: 100 },
|
622 |
+
{ color: "purple", primary: 600, secondary: 100 },
|
623 |
+
{ color: "teal", primary: 600, secondary: 100 },
|
624 |
+
{ color: "orange", primary: 600, secondary: 100 },
|
625 |
+
{ color: "cyan", primary: 600, secondary: 100 },
|
626 |
+
{ color: "lime", primary: 500, secondary: 100 },
|
627 |
+
{ color: "pink", primary: 600, secondary: 100 }
|
628 |
+
], ot = {
|
629 |
+
inherit: "inherit",
|
630 |
+
current: "currentColor",
|
631 |
+
transparent: "transparent",
|
632 |
+
black: "#000",
|
633 |
+
white: "#fff",
|
634 |
+
slate: {
|
635 |
+
50: "#f8fafc",
|
636 |
+
100: "#f1f5f9",
|
637 |
+
200: "#e2e8f0",
|
638 |
+
300: "#cbd5e1",
|
639 |
+
400: "#94a3b8",
|
640 |
+
500: "#64748b",
|
641 |
+
600: "#475569",
|
642 |
+
700: "#334155",
|
643 |
+
800: "#1e293b",
|
644 |
+
900: "#0f172a",
|
645 |
+
950: "#020617"
|
646 |
+
},
|
647 |
+
gray: {
|
648 |
+
50: "#f9fafb",
|
649 |
+
100: "#f3f4f6",
|
650 |
+
200: "#e5e7eb",
|
651 |
+
300: "#d1d5db",
|
652 |
+
400: "#9ca3af",
|
653 |
+
500: "#6b7280",
|
654 |
+
600: "#4b5563",
|
655 |
+
700: "#374151",
|
656 |
+
800: "#1f2937",
|
657 |
+
900: "#111827",
|
658 |
+
950: "#030712"
|
659 |
+
},
|
660 |
+
zinc: {
|
661 |
+
50: "#fafafa",
|
662 |
+
100: "#f4f4f5",
|
663 |
+
200: "#e4e4e7",
|
664 |
+
300: "#d4d4d8",
|
665 |
+
400: "#a1a1aa",
|
666 |
+
500: "#71717a",
|
667 |
+
600: "#52525b",
|
668 |
+
700: "#3f3f46",
|
669 |
+
800: "#27272a",
|
670 |
+
900: "#18181b",
|
671 |
+
950: "#09090b"
|
672 |
+
},
|
673 |
+
neutral: {
|
674 |
+
50: "#fafafa",
|
675 |
+
100: "#f5f5f5",
|
676 |
+
200: "#e5e5e5",
|
677 |
+
300: "#d4d4d4",
|
678 |
+
400: "#a3a3a3",
|
679 |
+
500: "#737373",
|
680 |
+
600: "#525252",
|
681 |
+
700: "#404040",
|
682 |
+
800: "#262626",
|
683 |
+
900: "#171717",
|
684 |
+
950: "#0a0a0a"
|
685 |
+
},
|
686 |
+
stone: {
|
687 |
+
50: "#fafaf9",
|
688 |
+
100: "#f5f5f4",
|
689 |
+
200: "#e7e5e4",
|
690 |
+
300: "#d6d3d1",
|
691 |
+
400: "#a8a29e",
|
692 |
+
500: "#78716c",
|
693 |
+
600: "#57534e",
|
694 |
+
700: "#44403c",
|
695 |
+
800: "#292524",
|
696 |
+
900: "#1c1917",
|
697 |
+
950: "#0c0a09"
|
698 |
+
},
|
699 |
+
red: {
|
700 |
+
50: "#fef2f2",
|
701 |
+
100: "#fee2e2",
|
702 |
+
200: "#fecaca",
|
703 |
+
300: "#fca5a5",
|
704 |
+
400: "#f87171",
|
705 |
+
500: "#ef4444",
|
706 |
+
600: "#dc2626",
|
707 |
+
700: "#b91c1c",
|
708 |
+
800: "#991b1b",
|
709 |
+
900: "#7f1d1d",
|
710 |
+
950: "#450a0a"
|
711 |
+
},
|
712 |
+
orange: {
|
713 |
+
50: "#fff7ed",
|
714 |
+
100: "#ffedd5",
|
715 |
+
200: "#fed7aa",
|
716 |
+
300: "#fdba74",
|
717 |
+
400: "#fb923c",
|
718 |
+
500: "#f97316",
|
719 |
+
600: "#ea580c",
|
720 |
+
700: "#c2410c",
|
721 |
+
800: "#9a3412",
|
722 |
+
900: "#7c2d12",
|
723 |
+
950: "#431407"
|
724 |
+
},
|
725 |
+
amber: {
|
726 |
+
50: "#fffbeb",
|
727 |
+
100: "#fef3c7",
|
728 |
+
200: "#fde68a",
|
729 |
+
300: "#fcd34d",
|
730 |
+
400: "#fbbf24",
|
731 |
+
500: "#f59e0b",
|
732 |
+
600: "#d97706",
|
733 |
+
700: "#b45309",
|
734 |
+
800: "#92400e",
|
735 |
+
900: "#78350f",
|
736 |
+
950: "#451a03"
|
737 |
+
},
|
738 |
+
yellow: {
|
739 |
+
50: "#fefce8",
|
740 |
+
100: "#fef9c3",
|
741 |
+
200: "#fef08a",
|
742 |
+
300: "#fde047",
|
743 |
+
400: "#facc15",
|
744 |
+
500: "#eab308",
|
745 |
+
600: "#ca8a04",
|
746 |
+
700: "#a16207",
|
747 |
+
800: "#854d0e",
|
748 |
+
900: "#713f12",
|
749 |
+
950: "#422006"
|
750 |
+
},
|
751 |
+
lime: {
|
752 |
+
50: "#f7fee7",
|
753 |
+
100: "#ecfccb",
|
754 |
+
200: "#d9f99d",
|
755 |
+
300: "#bef264",
|
756 |
+
400: "#a3e635",
|
757 |
+
500: "#84cc16",
|
758 |
+
600: "#65a30d",
|
759 |
+
700: "#4d7c0f",
|
760 |
+
800: "#3f6212",
|
761 |
+
900: "#365314",
|
762 |
+
950: "#1a2e05"
|
763 |
+
},
|
764 |
+
green: {
|
765 |
+
50: "#f0fdf4",
|
766 |
+
100: "#dcfce7",
|
767 |
+
200: "#bbf7d0",
|
768 |
+
300: "#86efac",
|
769 |
+
400: "#4ade80",
|
770 |
+
500: "#22c55e",
|
771 |
+
600: "#16a34a",
|
772 |
+
700: "#15803d",
|
773 |
+
800: "#166534",
|
774 |
+
900: "#14532d",
|
775 |
+
950: "#052e16"
|
776 |
+
},
|
777 |
+
emerald: {
|
778 |
+
50: "#ecfdf5",
|
779 |
+
100: "#d1fae5",
|
780 |
+
200: "#a7f3d0",
|
781 |
+
300: "#6ee7b7",
|
782 |
+
400: "#34d399",
|
783 |
+
500: "#10b981",
|
784 |
+
600: "#059669",
|
785 |
+
700: "#047857",
|
786 |
+
800: "#065f46",
|
787 |
+
900: "#064e3b",
|
788 |
+
950: "#022c22"
|
789 |
+
},
|
790 |
+
teal: {
|
791 |
+
50: "#f0fdfa",
|
792 |
+
100: "#ccfbf1",
|
793 |
+
200: "#99f6e4",
|
794 |
+
300: "#5eead4",
|
795 |
+
400: "#2dd4bf",
|
796 |
+
500: "#14b8a6",
|
797 |
+
600: "#0d9488",
|
798 |
+
700: "#0f766e",
|
799 |
+
800: "#115e59",
|
800 |
+
900: "#134e4a",
|
801 |
+
950: "#042f2e"
|
802 |
+
},
|
803 |
+
cyan: {
|
804 |
+
50: "#ecfeff",
|
805 |
+
100: "#cffafe",
|
806 |
+
200: "#a5f3fc",
|
807 |
+
300: "#67e8f9",
|
808 |
+
400: "#22d3ee",
|
809 |
+
500: "#06b6d4",
|
810 |
+
600: "#0891b2",
|
811 |
+
700: "#0e7490",
|
812 |
+
800: "#155e75",
|
813 |
+
900: "#164e63",
|
814 |
+
950: "#083344"
|
815 |
+
},
|
816 |
+
sky: {
|
817 |
+
50: "#f0f9ff",
|
818 |
+
100: "#e0f2fe",
|
819 |
+
200: "#bae6fd",
|
820 |
+
300: "#7dd3fc",
|
821 |
+
400: "#38bdf8",
|
822 |
+
500: "#0ea5e9",
|
823 |
+
600: "#0284c7",
|
824 |
+
700: "#0369a1",
|
825 |
+
800: "#075985",
|
826 |
+
900: "#0c4a6e",
|
827 |
+
950: "#082f49"
|
828 |
+
},
|
829 |
+
blue: {
|
830 |
+
50: "#eff6ff",
|
831 |
+
100: "#dbeafe",
|
832 |
+
200: "#bfdbfe",
|
833 |
+
300: "#93c5fd",
|
834 |
+
400: "#60a5fa",
|
835 |
+
500: "#3b82f6",
|
836 |
+
600: "#2563eb",
|
837 |
+
700: "#1d4ed8",
|
838 |
+
800: "#1e40af",
|
839 |
+
900: "#1e3a8a",
|
840 |
+
950: "#172554"
|
841 |
+
},
|
842 |
+
indigo: {
|
843 |
+
50: "#eef2ff",
|
844 |
+
100: "#e0e7ff",
|
845 |
+
200: "#c7d2fe",
|
846 |
+
300: "#a5b4fc",
|
847 |
+
400: "#818cf8",
|
848 |
+
500: "#6366f1",
|
849 |
+
600: "#4f46e5",
|
850 |
+
700: "#4338ca",
|
851 |
+
800: "#3730a3",
|
852 |
+
900: "#312e81",
|
853 |
+
950: "#1e1b4b"
|
854 |
+
},
|
855 |
+
violet: {
|
856 |
+
50: "#f5f3ff",
|
857 |
+
100: "#ede9fe",
|
858 |
+
200: "#ddd6fe",
|
859 |
+
300: "#c4b5fd",
|
860 |
+
400: "#a78bfa",
|
861 |
+
500: "#8b5cf6",
|
862 |
+
600: "#7c3aed",
|
863 |
+
700: "#6d28d9",
|
864 |
+
800: "#5b21b6",
|
865 |
+
900: "#4c1d95",
|
866 |
+
950: "#2e1065"
|
867 |
+
},
|
868 |
+
purple: {
|
869 |
+
50: "#faf5ff",
|
870 |
+
100: "#f3e8ff",
|
871 |
+
200: "#e9d5ff",
|
872 |
+
300: "#d8b4fe",
|
873 |
+
400: "#c084fc",
|
874 |
+
500: "#a855f7",
|
875 |
+
600: "#9333ea",
|
876 |
+
700: "#7e22ce",
|
877 |
+
800: "#6b21a8",
|
878 |
+
900: "#581c87",
|
879 |
+
950: "#3b0764"
|
880 |
+
},
|
881 |
+
fuchsia: {
|
882 |
+
50: "#fdf4ff",
|
883 |
+
100: "#fae8ff",
|
884 |
+
200: "#f5d0fe",
|
885 |
+
300: "#f0abfc",
|
886 |
+
400: "#e879f9",
|
887 |
+
500: "#d946ef",
|
888 |
+
600: "#c026d3",
|
889 |
+
700: "#a21caf",
|
890 |
+
800: "#86198f",
|
891 |
+
900: "#701a75",
|
892 |
+
950: "#4a044e"
|
893 |
+
},
|
894 |
+
pink: {
|
895 |
+
50: "#fdf2f8",
|
896 |
+
100: "#fce7f3",
|
897 |
+
200: "#fbcfe8",
|
898 |
+
300: "#f9a8d4",
|
899 |
+
400: "#f472b6",
|
900 |
+
500: "#ec4899",
|
901 |
+
600: "#db2777",
|
902 |
+
700: "#be185d",
|
903 |
+
800: "#9d174d",
|
904 |
+
900: "#831843",
|
905 |
+
950: "#500724"
|
906 |
+
},
|
907 |
+
rose: {
|
908 |
+
50: "#fff1f2",
|
909 |
+
100: "#ffe4e6",
|
910 |
+
200: "#fecdd3",
|
911 |
+
300: "#fda4af",
|
912 |
+
400: "#fb7185",
|
913 |
+
500: "#f43f5e",
|
914 |
+
600: "#e11d48",
|
915 |
+
700: "#be123c",
|
916 |
+
800: "#9f1239",
|
917 |
+
900: "#881337",
|
918 |
+
950: "#4c0519"
|
919 |
+
}
|
920 |
+
}, ft = bn.reduce(
|
921 |
+
(n, { color: e, primary: t, secondary: l }) => ({
|
922 |
+
...n,
|
923 |
+
[e]: {
|
924 |
+
primary: ot[e][t],
|
925 |
+
secondary: ot[e][l]
|
926 |
+
}
|
927 |
+
}),
|
928 |
+
{}
|
929 |
+
), hn = (n) => st[n % st.length];
|
930 |
+
function Ne() {
|
931 |
+
}
|
932 |
+
const gn = (n) => n;
|
933 |
+
function wn(n, e) {
|
934 |
+
return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function";
|
935 |
+
}
|
936 |
+
const Ut = typeof window < "u";
|
937 |
+
let _t = Ut ? () => window.performance.now() : () => Date.now(), Xt = Ut ? (n) => requestAnimationFrame(n) : Ne;
|
938 |
+
const he = /* @__PURE__ */ new Set();
|
939 |
+
function Yt(n) {
|
940 |
+
he.forEach((e) => {
|
941 |
+
e.c(n) || (he.delete(e), e.f());
|
942 |
+
}), he.size !== 0 && Xt(Yt);
|
943 |
+
}
|
944 |
+
function pn(n) {
|
945 |
+
let e;
|
946 |
+
return he.size === 0 && Xt(Yt), {
|
947 |
+
promise: new Promise((t) => {
|
948 |
+
he.add(e = { c: n, f: t });
|
949 |
+
}),
|
950 |
+
abort() {
|
951 |
+
he.delete(e);
|
952 |
+
}
|
953 |
+
};
|
954 |
+
}
|
955 |
+
function kn(n, { delay: e = 0, duration: t = 400, easing: l = gn } = {}) {
|
956 |
+
const i = +getComputedStyle(n).opacity;
|
957 |
+
return {
|
958 |
+
delay: e,
|
959 |
+
duration: t,
|
960 |
+
easing: l,
|
961 |
+
css: (s) => `opacity: ${s * i}`
|
962 |
+
};
|
963 |
+
}
|
964 |
+
const ce = [];
|
965 |
+
function vn(n, e = Ne) {
|
966 |
+
let t;
|
967 |
+
const l = /* @__PURE__ */ new Set();
|
968 |
+
function i(_) {
|
969 |
+
if (wn(n, _) && (n = _, t)) {
|
970 |
+
const f = !ce.length;
|
971 |
+
for (const a of l)
|
972 |
+
a[1](), ce.push(a, n);
|
973 |
+
if (f) {
|
974 |
+
for (let a = 0; a < ce.length; a += 2)
|
975 |
+
ce[a][0](ce[a + 1]);
|
976 |
+
ce.length = 0;
|
977 |
+
}
|
978 |
+
}
|
979 |
+
}
|
980 |
+
function s(_) {
|
981 |
+
i(_(n));
|
982 |
+
}
|
983 |
+
function o(_, f = Ne) {
|
984 |
+
const a = [_, f];
|
985 |
+
return l.add(a), l.size === 1 && (t = e(i, s) || Ne), _(n), () => {
|
986 |
+
l.delete(a), l.size === 0 && t && (t(), t = null);
|
987 |
+
};
|
988 |
+
}
|
989 |
+
return { set: i, update: s, subscribe: o };
|
990 |
+
}
|
991 |
+
function at(n) {
|
992 |
+
return Object.prototype.toString.call(n) === "[object Date]";
|
993 |
+
}
|
994 |
+
function Re(n, e, t, l) {
|
995 |
+
if (typeof t == "number" || at(t)) {
|
996 |
+
const i = l - t, s = (t - e) / (n.dt || 1 / 60), o = n.opts.stiffness * i, _ = n.opts.damping * s, f = (o - _) * n.inv_mass, a = (s + f) * n.dt;
|
997 |
+
return Math.abs(a) < n.opts.precision && Math.abs(i) < n.opts.precision ? l : (n.settled = !1, at(t) ? new Date(t.getTime() + a) : t + a);
|
998 |
+
} else {
|
999 |
+
if (Array.isArray(t))
|
1000 |
+
return t.map(
|
1001 |
+
(i, s) => Re(n, e[s], t[s], l[s])
|
1002 |
+
);
|
1003 |
+
if (typeof t == "object") {
|
1004 |
+
const i = {};
|
1005 |
+
for (const s in t)
|
1006 |
+
i[s] = Re(n, e[s], t[s], l[s]);
|
1007 |
+
return i;
|
1008 |
+
} else
|
1009 |
+
throw new Error(`Cannot spring ${typeof t} values`);
|
1010 |
+
}
|
1011 |
+
}
|
1012 |
+
function rt(n, e = {}) {
|
1013 |
+
const t = vn(n), { stiffness: l = 0.15, damping: i = 0.8, precision: s = 0.01 } = e;
|
1014 |
+
let o, _, f, a = n, r = n, u = 1, c = 0, m = !1;
|
1015 |
+
function p(L, S = {}) {
|
1016 |
+
r = L;
|
1017 |
+
const C = f = {};
|
1018 |
+
return n == null || S.hard || T.stiffness >= 1 && T.damping >= 1 ? (m = !0, o = _t(), a = L, t.set(n = r), Promise.resolve()) : (S.soft && (c = 1 / ((S.soft === !0 ? 0.5 : +S.soft) * 60), u = 0), _ || (o = _t(), m = !1, _ = pn((d) => {
|
1019 |
+
if (m)
|
1020 |
+
return m = !1, _ = null, !1;
|
1021 |
+
u = Math.min(u + c, 1);
|
1022 |
+
const y = {
|
1023 |
+
inv_mass: u,
|
1024 |
+
opts: T,
|
1025 |
+
settled: !0,
|
1026 |
+
dt: (d - o) * 60 / 1e3
|
1027 |
+
}, M = Re(y, a, n, r);
|
1028 |
+
return o = d, a = n, t.set(n = M), y.settled && (_ = null), !y.settled;
|
1029 |
+
})), new Promise((d) => {
|
1030 |
+
_.promise.then(() => {
|
1031 |
+
C === f && d();
|
1032 |
+
});
|
1033 |
+
}));
|
1034 |
+
}
|
1035 |
+
const T = {
|
1036 |
+
set: p,
|
1037 |
+
update: (L, S) => p(L(r, n), S),
|
1038 |
+
subscribe: t.subscribe,
|
1039 |
+
stiffness: l,
|
1040 |
+
damping: i,
|
1041 |
+
precision: s
|
1042 |
+
};
|
1043 |
+
return T;
|
1044 |
+
}
|
1045 |
+
function ut(n, e, t) {
|
1046 |
+
if (!t) {
|
1047 |
+
var l = document.createElement("canvas");
|
1048 |
+
t = l.getContext("2d");
|
1049 |
+
}
|
1050 |
+
t.fillStyle = n, t.fillRect(0, 0, 1, 1);
|
1051 |
+
const [i, s, o] = t.getImageData(0, 0, 1, 1).data;
|
1052 |
+
return t.clearRect(0, 0, 1, 1), `rgba(${i}, ${s}, ${o}, ${255 / e})`;
|
1053 |
+
}
|
1054 |
+
function yn(n, e, t) {
|
1055 |
+
var l = {};
|
1056 |
+
for (const i in n) {
|
1057 |
+
const s = n[i].trim();
|
1058 |
+
s in ft ? l[i] = ft[s] : l[i] = {
|
1059 |
+
primary: e ? ut(n[i], 1, t) : n[i],
|
1060 |
+
secondary: e ? ut(n[i], 0.5, t) : n[i]
|
1061 |
+
};
|
1062 |
+
}
|
1063 |
+
return l;
|
1064 |
+
}
|
1065 |
+
function Cn(n, e) {
|
1066 |
+
let t = [], l = null, i = null;
|
1067 |
+
for (const [s, o] of n)
|
1068 |
+
e === "empty" && o === null || e === "equal" && i === o ? l = l ? l + s : s : (l !== null && t.push([l, i]), l = s, i = o);
|
1069 |
+
return l !== null && t.push([l, i]), t;
|
1070 |
+
}
|
1071 |
+
const {
|
1072 |
+
SvelteComponent: qn,
|
1073 |
+
add_render_callback: Xe,
|
1074 |
+
append: se,
|
1075 |
+
attr: V,
|
1076 |
+
binding_callbacks: ct,
|
1077 |
+
bubble: de,
|
1078 |
+
check_outros: Gt,
|
1079 |
+
create_component: Ye,
|
1080 |
+
create_in_transition: Ln,
|
1081 |
+
destroy_component: Ge,
|
1082 |
+
destroy_each: Sn,
|
1083 |
+
detach: G,
|
1084 |
+
element: le,
|
1085 |
+
empty: Tn,
|
1086 |
+
ensure_array_like: dt,
|
1087 |
+
group_outros: Wt,
|
1088 |
+
init: Fn,
|
1089 |
+
insert: W,
|
1090 |
+
listen: U,
|
1091 |
+
mount_component: We,
|
1092 |
+
noop: Jt,
|
1093 |
+
run_all: Mn,
|
1094 |
+
safe_not_equal: jn,
|
1095 |
+
set_data: Je,
|
1096 |
+
space: ye,
|
1097 |
+
text: Ke,
|
1098 |
+
toggle_class: mt,
|
1099 |
+
transition_in: ee,
|
1100 |
+
transition_out: oe
|
1101 |
+
} = window.__gradio__svelte__internal, { beforeUpdate: Vn, afterUpdate: Hn, createEventDispatcher: Nn, tick: Ei } = window.__gradio__svelte__internal;
|
1102 |
+
function bt(n, e, t) {
|
1103 |
+
const l = n.slice();
|
1104 |
+
return l[39] = e[t][0], l[40] = e[t][1], l[42] = t, l;
|
1105 |
+
}
|
1106 |
+
function ht(n) {
|
1107 |
+
let e, t, l = (
|
1108 |
+
/*show_legend_label*/
|
1109 |
+
n[5] && gt(n)
|
1110 |
+
), i = dt(Object.entries(
|
1111 |
+
/*_color_map*/
|
1112 |
+
n[12]
|
1113 |
+
)), s = [];
|
1114 |
+
for (let o = 0; o < i.length; o += 1)
|
1115 |
+
s[o] = wt(bt(n, i, o));
|
1116 |
+
return {
|
1117 |
+
c() {
|
1118 |
+
e = le("div"), l && l.c(), t = ye();
|
1119 |
+
for (let o = 0; o < s.length; o += 1)
|
1120 |
+
s[o].c();
|
1121 |
+
V(e, "class", "category-legend svelte-1t4levu"), V(e, "data-testid", "highlighted-text:category-legend");
|
1122 |
+
},
|
1123 |
+
m(o, _) {
|
1124 |
+
W(o, e, _), l && l.m(e, null), se(e, t);
|
1125 |
+
for (let f = 0; f < s.length; f += 1)
|
1126 |
+
s[f] && s[f].m(e, null);
|
1127 |
+
},
|
1128 |
+
p(o, _) {
|
1129 |
+
if (/*show_legend_label*/
|
1130 |
+
o[5] ? l ? l.p(o, _) : (l = gt(o), l.c(), l.m(e, t)) : l && (l.d(1), l = null), _[0] & /*_color_map*/
|
1131 |
+
4096) {
|
1132 |
+
i = dt(Object.entries(
|
1133 |
+
/*_color_map*/
|
1134 |
+
o[12]
|
1135 |
+
));
|
1136 |
+
let f;
|
1137 |
+
for (f = 0; f < i.length; f += 1) {
|
1138 |
+
const a = bt(o, i, f);
|
1139 |
+
s[f] ? s[f].p(a, _) : (s[f] = wt(a), s[f].c(), s[f].m(e, null));
|
1140 |
+
}
|
1141 |
+
for (; f < s.length; f += 1)
|
1142 |
+
s[f].d(1);
|
1143 |
+
s.length = i.length;
|
1144 |
+
}
|
1145 |
+
},
|
1146 |
+
d(o) {
|
1147 |
+
o && G(e), l && l.d(), Sn(s, o);
|
1148 |
+
}
|
1149 |
+
};
|
1150 |
+
}
|
1151 |
+
function gt(n) {
|
1152 |
+
let e, t;
|
1153 |
+
return {
|
1154 |
+
c() {
|
1155 |
+
e = le("div"), t = Ke(
|
1156 |
+
/*legend_label*/
|
1157 |
+
n[1]
|
1158 |
+
), V(e, "class", "legend-description svelte-1t4levu");
|
1159 |
+
},
|
1160 |
+
m(l, i) {
|
1161 |
+
W(l, e, i), se(e, t);
|
1162 |
+
},
|
1163 |
+
p(l, i) {
|
1164 |
+
i[0] & /*legend_label*/
|
1165 |
+
2 && Je(
|
1166 |
+
t,
|
1167 |
+
/*legend_label*/
|
1168 |
+
l[1]
|
1169 |
+
);
|
1170 |
+
},
|
1171 |
+
d(l) {
|
1172 |
+
l && G(e);
|
1173 |
+
}
|
1174 |
+
};
|
1175 |
+
}
|
1176 |
+
function wt(n) {
|
1177 |
+
let e, t = (
|
1178 |
+
/*category*/
|
1179 |
+
n[39] + ""
|
1180 |
+
), l, i, s;
|
1181 |
+
return {
|
1182 |
+
c() {
|
1183 |
+
e = le("div"), l = Ke(t), i = ye(), V(e, "class", "category-label svelte-1t4levu"), V(e, "style", s = "background-color:" + /*color*/
|
1184 |
+
n[40].secondary);
|
1185 |
+
},
|
1186 |
+
m(o, _) {
|
1187 |
+
W(o, e, _), se(e, l), se(e, i);
|
1188 |
+
},
|
1189 |
+
p(o, _) {
|
1190 |
+
_[0] & /*_color_map*/
|
1191 |
+
4096 && t !== (t = /*category*/
|
1192 |
+
o[39] + "") && Je(l, t), _[0] & /*_color_map*/
|
1193 |
+
4096 && s !== (s = "background-color:" + /*color*/
|
1194 |
+
o[40].secondary) && V(e, "style", s);
|
1195 |
+
},
|
1196 |
+
d(o) {
|
1197 |
+
o && G(e);
|
1198 |
+
}
|
1199 |
+
};
|
1200 |
+
}
|
1201 |
+
function zn(n) {
|
1202 |
+
let e;
|
1203 |
+
return {
|
1204 |
+
c() {
|
1205 |
+
e = Ke(
|
1206 |
+
/*label*/
|
1207 |
+
n[0]
|
1208 |
+
);
|
1209 |
+
},
|
1210 |
+
m(t, l) {
|
1211 |
+
W(t, e, l);
|
1212 |
+
},
|
1213 |
+
p(t, l) {
|
1214 |
+
l[0] & /*label*/
|
1215 |
+
1 && Je(
|
1216 |
+
e,
|
1217 |
+
/*label*/
|
1218 |
+
t[0]
|
1219 |
+
);
|
1220 |
+
},
|
1221 |
+
d(t) {
|
1222 |
+
t && G(e);
|
1223 |
+
}
|
1224 |
+
};
|
1225 |
+
}
|
1226 |
+
function pt(n) {
|
1227 |
+
let e, t, l, i;
|
1228 |
+
const s = [An, Zn], o = [];
|
1229 |
+
function _(f, a) {
|
1230 |
+
return (
|
1231 |
+
/*copied*/
|
1232 |
+
f[13] ? 0 : 1
|
1233 |
+
);
|
1234 |
+
}
|
1235 |
+
return e = _(n), t = o[e] = s[e](n), {
|
1236 |
+
c() {
|
1237 |
+
t.c(), l = Tn();
|
1238 |
+
},
|
1239 |
+
m(f, a) {
|
1240 |
+
o[e].m(f, a), W(f, l, a), i = !0;
|
1241 |
+
},
|
1242 |
+
p(f, a) {
|
1243 |
+
let r = e;
|
1244 |
+
e = _(f), e === r ? o[e].p(f, a) : (Wt(), oe(o[r], 1, 1, () => {
|
1245 |
+
o[r] = null;
|
1246 |
+
}), Gt(), t = o[e], t ? t.p(f, a) : (t = o[e] = s[e](f), t.c()), ee(t, 1), t.m(l.parentNode, l));
|
1247 |
+
},
|
1248 |
+
i(f) {
|
1249 |
+
i || (ee(t), i = !0);
|
1250 |
+
},
|
1251 |
+
o(f) {
|
1252 |
+
oe(t), i = !1;
|
1253 |
+
},
|
1254 |
+
d(f) {
|
1255 |
+
f && G(l), o[e].d(f);
|
1256 |
+
}
|
1257 |
+
};
|
1258 |
+
}
|
1259 |
+
function Zn(n) {
|
1260 |
+
let e, t, l, i, s;
|
1261 |
+
return t = new mn({}), {
|
1262 |
+
c() {
|
1263 |
+
e = le("button"), Ye(t.$$.fragment), V(e, "aria-label", "Copy"), V(e, "aria-roledescription", "Copy text"), V(e, "class", "svelte-1t4levu");
|
1264 |
+
},
|
1265 |
+
m(o, _) {
|
1266 |
+
W(o, e, _), We(t, e, null), l = !0, i || (s = U(
|
1267 |
+
e,
|
1268 |
+
"click",
|
1269 |
+
/*handle_copy*/
|
1270 |
+
n[15]
|
1271 |
+
), i = !0);
|
1272 |
+
},
|
1273 |
+
p: Jt,
|
1274 |
+
i(o) {
|
1275 |
+
l || (ee(t.$$.fragment, o), l = !0);
|
1276 |
+
},
|
1277 |
+
o(o) {
|
1278 |
+
oe(t.$$.fragment, o), l = !1;
|
1279 |
+
},
|
1280 |
+
d(o) {
|
1281 |
+
o && G(e), Ge(t), i = !1, s();
|
1282 |
+
}
|
1283 |
+
};
|
1284 |
+
}
|
1285 |
+
function An(n) {
|
1286 |
+
let e, t, l, i;
|
1287 |
+
return t = new fn({}), {
|
1288 |
+
c() {
|
1289 |
+
e = le("button"), Ye(t.$$.fragment), V(e, "aria-label", "Copied"), V(e, "aria-roledescription", "Text copied"), V(e, "class", "svelte-1t4levu");
|
1290 |
+
},
|
1291 |
+
m(s, o) {
|
1292 |
+
W(s, e, o), We(t, e, null), i = !0;
|
1293 |
+
},
|
1294 |
+
p: Jt,
|
1295 |
+
i(s) {
|
1296 |
+
i || (ee(t.$$.fragment, s), s && (l || Xe(() => {
|
1297 |
+
l = Ln(e, kn, { duration: 300 }), l.start();
|
1298 |
+
})), i = !0);
|
1299 |
+
},
|
1300 |
+
o(s) {
|
1301 |
+
oe(t.$$.fragment, s), i = !1;
|
1302 |
+
},
|
1303 |
+
d(s) {
|
1304 |
+
s && G(e), Ge(t);
|
1305 |
+
}
|
1306 |
+
};
|
1307 |
+
}
|
1308 |
+
function Bn(n) {
|
1309 |
+
let e, t, l;
|
1310 |
+
return {
|
1311 |
+
c() {
|
1312 |
+
e = le("div"), V(e, "class", "textfield svelte-1t4levu"), V(e, "data-testid", "highlighted-textbox"), V(e, "contenteditable", "true"), /*el_text*/
|
1313 |
+
(n[11] === void 0 || /*marked_el_text*/
|
1314 |
+
n[9] === void 0) && Xe(() => (
|
1315 |
+
/*div_input_handler_1*/
|
1316 |
+
n[28].call(e)
|
1317 |
+
));
|
1318 |
+
},
|
1319 |
+
m(i, s) {
|
1320 |
+
W(i, e, s), n[27](e), /*el_text*/
|
1321 |
+
n[11] !== void 0 && (e.textContent = /*el_text*/
|
1322 |
+
n[11]), /*marked_el_text*/
|
1323 |
+
n[9] !== void 0 && (e.innerHTML = /*marked_el_text*/
|
1324 |
+
n[9]), t || (l = [
|
1325 |
+
U(
|
1326 |
+
e,
|
1327 |
+
"input",
|
1328 |
+
/*div_input_handler_1*/
|
1329 |
+
n[28]
|
1330 |
+
),
|
1331 |
+
U(
|
1332 |
+
e,
|
1333 |
+
"blur",
|
1334 |
+
/*handle_blur*/
|
1335 |
+
n[14]
|
1336 |
+
),
|
1337 |
+
U(
|
1338 |
+
e,
|
1339 |
+
"keypress",
|
1340 |
+
/*keypress_handler*/
|
1341 |
+
n[19]
|
1342 |
+
),
|
1343 |
+
U(
|
1344 |
+
e,
|
1345 |
+
"select",
|
1346 |
+
/*select_handler*/
|
1347 |
+
n[20]
|
1348 |
+
),
|
1349 |
+
U(
|
1350 |
+
e,
|
1351 |
+
"scroll",
|
1352 |
+
/*scroll_handler*/
|
1353 |
+
n[21]
|
1354 |
+
),
|
1355 |
+
U(
|
1356 |
+
e,
|
1357 |
+
"input",
|
1358 |
+
/*input_handler*/
|
1359 |
+
n[22]
|
1360 |
+
),
|
1361 |
+
U(
|
1362 |
+
e,
|
1363 |
+
"focus",
|
1364 |
+
/*focus_handler*/
|
1365 |
+
n[23]
|
1366 |
+
),
|
1367 |
+
U(
|
1368 |
+
e,
|
1369 |
+
"change",
|
1370 |
+
/*change_handler*/
|
1371 |
+
n[24]
|
1372 |
+
)
|
1373 |
+
], t = !0);
|
1374 |
+
},
|
1375 |
+
p(i, s) {
|
1376 |
+
s[0] & /*el_text*/
|
1377 |
+
2048 && /*el_text*/
|
1378 |
+
i[11] !== e.textContent && (e.textContent = /*el_text*/
|
1379 |
+
i[11]), s[0] & /*marked_el_text*/
|
1380 |
+
512 && /*marked_el_text*/
|
1381 |
+
i[9] !== e.innerHTML && (e.innerHTML = /*marked_el_text*/
|
1382 |
+
i[9]);
|
1383 |
+
},
|
1384 |
+
d(i) {
|
1385 |
+
i && G(e), n[27](null), t = !1, Mn(l);
|
1386 |
+
}
|
1387 |
+
};
|
1388 |
+
}
|
1389 |
+
function Pn(n) {
|
1390 |
+
let e, t, l;
|
1391 |
+
return {
|
1392 |
+
c() {
|
1393 |
+
e = le("div"), V(e, "class", "textfield svelte-1t4levu"), V(e, "data-testid", "highlighted-textbox"), V(e, "contenteditable", "false"), /*el_text*/
|
1394 |
+
(n[11] === void 0 || /*marked_el_text*/
|
1395 |
+
n[9] === void 0) && Xe(() => (
|
1396 |
+
/*div_input_handler*/
|
1397 |
+
n[26].call(e)
|
1398 |
+
));
|
1399 |
+
},
|
1400 |
+
m(i, s) {
|
1401 |
+
W(i, e, s), n[25](e), /*el_text*/
|
1402 |
+
n[11] !== void 0 && (e.textContent = /*el_text*/
|
1403 |
+
n[11]), /*marked_el_text*/
|
1404 |
+
n[9] !== void 0 && (e.innerHTML = /*marked_el_text*/
|
1405 |
+
n[9]), t || (l = U(
|
1406 |
+
e,
|
1407 |
+
"input",
|
1408 |
+
/*div_input_handler*/
|
1409 |
+
n[26]
|
1410 |
+
), t = !0);
|
1411 |
+
},
|
1412 |
+
p(i, s) {
|
1413 |
+
s[0] & /*el_text*/
|
1414 |
+
2048 && /*el_text*/
|
1415 |
+
i[11] !== e.textContent && (e.textContent = /*el_text*/
|
1416 |
+
i[11]), s[0] & /*marked_el_text*/
|
1417 |
+
512 && /*marked_el_text*/
|
1418 |
+
i[9] !== e.innerHTML && (e.innerHTML = /*marked_el_text*/
|
1419 |
+
i[9]);
|
1420 |
+
},
|
1421 |
+
d(i) {
|
1422 |
+
i && G(e), n[25](null), t = !1, l();
|
1423 |
+
}
|
1424 |
+
};
|
1425 |
+
}
|
1426 |
+
function Dn(n) {
|
1427 |
+
let e, t, l, i, s, o, _ = (
|
1428 |
+
/*show_legend*/
|
1429 |
+
n[4] && ht(n)
|
1430 |
+
);
|
1431 |
+
l = new xl({
|
1432 |
+
props: {
|
1433 |
+
show_label: (
|
1434 |
+
/*show_label*/
|
1435 |
+
n[3]
|
1436 |
+
),
|
1437 |
+
info: (
|
1438 |
+
/*info*/
|
1439 |
+
n[2]
|
1440 |
+
),
|
1441 |
+
$$slots: { default: [zn] },
|
1442 |
+
$$scope: { ctx: n }
|
1443 |
+
}
|
1444 |
+
});
|
1445 |
+
let f = (
|
1446 |
+
/*show_copy_button*/
|
1447 |
+
n[7] && pt(n)
|
1448 |
+
);
|
1449 |
+
function a(c, m) {
|
1450 |
+
return (
|
1451 |
+
/*disabled*/
|
1452 |
+
c[8] ? Pn : Bn
|
1453 |
+
);
|
1454 |
+
}
|
1455 |
+
let r = a(n), u = r(n);
|
1456 |
+
return {
|
1457 |
+
c() {
|
1458 |
+
e = le("label"), _ && _.c(), t = ye(), Ye(l.$$.fragment), i = ye(), f && f.c(), s = ye(), u.c(), V(e, "class", "svelte-1t4levu"), mt(
|
1459 |
+
e,
|
1460 |
+
"container",
|
1461 |
+
/*container*/
|
1462 |
+
n[6]
|
1463 |
+
);
|
1464 |
+
},
|
1465 |
+
m(c, m) {
|
1466 |
+
W(c, e, m), _ && _.m(e, null), se(e, t), We(l, e, null), se(e, i), f && f.m(e, null), se(e, s), u.m(e, null), o = !0;
|
1467 |
+
},
|
1468 |
+
p(c, m) {
|
1469 |
+
/*show_legend*/
|
1470 |
+
c[4] ? _ ? _.p(c, m) : (_ = ht(c), _.c(), _.m(e, t)) : _ && (_.d(1), _ = null);
|
1471 |
+
const p = {};
|
1472 |
+
m[0] & /*show_label*/
|
1473 |
+
8 && (p.show_label = /*show_label*/
|
1474 |
+
c[3]), m[0] & /*info*/
|
1475 |
+
4 && (p.info = /*info*/
|
1476 |
+
c[2]), m[0] & /*label*/
|
1477 |
+
1 | m[1] & /*$$scope*/
|
1478 |
+
4096 && (p.$$scope = { dirty: m, ctx: c }), l.$set(p), /*show_copy_button*/
|
1479 |
+
c[7] ? f ? (f.p(c, m), m[0] & /*show_copy_button*/
|
1480 |
+
128 && ee(f, 1)) : (f = pt(c), f.c(), ee(f, 1), f.m(e, s)) : f && (Wt(), oe(f, 1, 1, () => {
|
1481 |
+
f = null;
|
1482 |
+
}), Gt()), r === (r = a(c)) && u ? u.p(c, m) : (u.d(1), u = r(c), u && (u.c(), u.m(e, null))), (!o || m[0] & /*container*/
|
1483 |
+
64) && mt(
|
1484 |
+
e,
|
1485 |
+
"container",
|
1486 |
+
/*container*/
|
1487 |
+
c[6]
|
1488 |
+
);
|
1489 |
+
},
|
1490 |
+
i(c) {
|
1491 |
+
o || (ee(l.$$.fragment, c), ee(f), o = !0);
|
1492 |
+
},
|
1493 |
+
o(c) {
|
1494 |
+
oe(l.$$.fragment, c), oe(f), o = !1;
|
1495 |
+
},
|
1496 |
+
d(c) {
|
1497 |
+
c && G(e), _ && _.d(), Ge(l), f && f.d(), u.d();
|
1498 |
+
}
|
1499 |
+
};
|
1500 |
+
}
|
1501 |
+
function En(n) {
|
1502 |
+
let e, t = n[0], l = 1;
|
1503 |
+
for (; l < n.length; ) {
|
1504 |
+
const i = n[l], s = n[l + 1];
|
1505 |
+
if (l += 2, (i === "optionalAccess" || i === "optionalCall") && t == null)
|
1506 |
+
return;
|
1507 |
+
i === "access" || i === "optionalAccess" ? (e = t, t = s(t)) : (i === "call" || i === "optionalCall") && (t = s((...o) => t.call(e, ...o)), e = void 0);
|
1508 |
+
}
|
1509 |
+
return t;
|
1510 |
+
}
|
1511 |
+
function In(n, e, t) {
|
1512 |
+
const l = typeof document < "u";
|
1513 |
+
let { value: i = [] } = e, { value_is_output: s = !1 } = e, { label: o } = e, { legend_label: _ } = e, { info: f = void 0 } = e, { show_label: a = !0 } = e, { show_legend: r = !1 } = e, { show_legend_label: u = !1 } = e, { container: c = !0 } = e, { color_map: m = {} } = e, { show_copy_button: p = !1 } = e, { disabled: T } = e, L, S = "", C = "", d, y = {}, M = {}, h = !1, P;
|
1514 |
+
function J() {
|
1515 |
+
if (!m || Object.keys(m).length === 0 ? y = {} : y = m, i.length > 0) {
|
1516 |
+
for (let [b, H] of i)
|
1517 |
+
if (H !== null && !(H in y)) {
|
1518 |
+
let re = hn(Object.keys(y).length);
|
1519 |
+
y[H] = re;
|
1520 |
+
}
|
1521 |
+
}
|
1522 |
+
t(12, M = yn(y, l, d));
|
1523 |
+
}
|
1524 |
+
function z() {
|
1525 |
+
i.length > 0 && s && (t(11, S = i.map(([b, H]) => b).join(" ")), t(9, C = i.map(([b, H]) => H !== null ? `<mark class="hl ${H}" style="background-color:${M[H].secondary}">${b}</mark>` : b).join(" ") + " "));
|
1526 |
+
}
|
1527 |
+
const D = Nn();
|
1528 |
+
Vn(() => {
|
1529 |
+
L && L.offsetHeight + L.scrollTop > L.scrollHeight - 100;
|
1530 |
+
});
|
1531 |
+
function R() {
|
1532 |
+
D("change", C), s || D("input");
|
1533 |
+
}
|
1534 |
+
Hn(() => {
|
1535 |
+
J(), z(), t(17, s = !1);
|
1536 |
+
});
|
1537 |
+
function fe() {
|
1538 |
+
let b = [], H = "", re = null, Be = !1, Se = "";
|
1539 |
+
for (let Pe = 0; Pe < C.length; Pe++) {
|
1540 |
+
let Te = C[Pe];
|
1541 |
+
Te === "<" ? (Be = !0, H && b.push([H, re]), H = "", re = null) : Te === ">" ? (Be = !1, Se.startsWith("mark") && (re = En([
|
1542 |
+
Se,
|
1543 |
+
"access",
|
1544 |
+
(ke) => ke.match,
|
1545 |
+
"call",
|
1546 |
+
(ke) => ke(/class="hl ([^"]+)"/),
|
1547 |
+
"optionalAccess",
|
1548 |
+
(ke) => ke[1]
|
1549 |
+
]) || null), Se = "") : Be ? Se += Te : H += Te;
|
1550 |
+
}
|
1551 |
+
H && b.push([H, re]), t(16, i = b);
|
1552 |
+
}
|
1553 |
+
async function E() {
|
1554 |
+
"clipboard" in navigator && (await navigator.clipboard.writeText(S), K());
|
1555 |
+
}
|
1556 |
+
function K() {
|
1557 |
+
t(13, h = !0), P && clearTimeout(P), P = setTimeout(
|
1558 |
+
() => {
|
1559 |
+
t(13, h = !1);
|
1560 |
+
},
|
1561 |
+
1e3
|
1562 |
+
);
|
1563 |
+
}
|
1564 |
+
function Z(b) {
|
1565 |
+
de.call(this, n, b);
|
1566 |
+
}
|
1567 |
+
function _e(b) {
|
1568 |
+
de.call(this, n, b);
|
1569 |
+
}
|
1570 |
+
function g(b) {
|
1571 |
+
de.call(this, n, b);
|
1572 |
+
}
|
1573 |
+
function qe(b) {
|
1574 |
+
de.call(this, n, b);
|
1575 |
+
}
|
1576 |
+
function Le(b) {
|
1577 |
+
de.call(this, n, b);
|
1578 |
+
}
|
1579 |
+
function ae(b) {
|
1580 |
+
de.call(this, n, b);
|
1581 |
+
}
|
1582 |
+
function Ze(b) {
|
1583 |
+
ct[b ? "unshift" : "push"](() => {
|
1584 |
+
L = b, t(10, L);
|
1585 |
+
});
|
1586 |
+
}
|
1587 |
+
function Ae() {
|
1588 |
+
S = this.textContent, C = this.innerHTML, t(11, S), t(9, C);
|
1589 |
+
}
|
1590 |
+
function w(b) {
|
1591 |
+
ct[b ? "unshift" : "push"](() => {
|
1592 |
+
L = b, t(10, L);
|
1593 |
+
});
|
1594 |
+
}
|
1595 |
+
function $t() {
|
1596 |
+
S = this.textContent, C = this.innerHTML, t(11, S), t(9, C);
|
1597 |
+
}
|
1598 |
+
return n.$$set = (b) => {
|
1599 |
+
"value" in b && t(16, i = b.value), "value_is_output" in b && t(17, s = b.value_is_output), "label" in b && t(0, o = b.label), "legend_label" in b && t(1, _ = b.legend_label), "info" in b && t(2, f = b.info), "show_label" in b && t(3, a = b.show_label), "show_legend" in b && t(4, r = b.show_legend), "show_legend_label" in b && t(5, u = b.show_legend_label), "container" in b && t(6, c = b.container), "color_map" in b && t(18, m = b.color_map), "show_copy_button" in b && t(7, p = b.show_copy_button), "disabled" in b && t(8, T = b.disabled);
|
1600 |
+
}, n.$$.update = () => {
|
1601 |
+
n.$$.dirty[0] & /*marked_el_text*/
|
1602 |
+
512 && R();
|
1603 |
+
}, z(), J(), [
|
1604 |
+
o,
|
1605 |
+
_,
|
1606 |
+
f,
|
1607 |
+
a,
|
1608 |
+
r,
|
1609 |
+
u,
|
1610 |
+
c,
|
1611 |
+
p,
|
1612 |
+
T,
|
1613 |
+
C,
|
1614 |
+
L,
|
1615 |
+
S,
|
1616 |
+
M,
|
1617 |
+
h,
|
1618 |
+
fe,
|
1619 |
+
E,
|
1620 |
+
i,
|
1621 |
+
s,
|
1622 |
+
m,
|
1623 |
+
Z,
|
1624 |
+
_e,
|
1625 |
+
g,
|
1626 |
+
qe,
|
1627 |
+
Le,
|
1628 |
+
ae,
|
1629 |
+
Ze,
|
1630 |
+
Ae,
|
1631 |
+
w,
|
1632 |
+
$t
|
1633 |
+
];
|
1634 |
+
}
|
1635 |
+
class On extends qn {
|
1636 |
+
constructor(e) {
|
1637 |
+
super(), Fn(
|
1638 |
+
this,
|
1639 |
+
e,
|
1640 |
+
In,
|
1641 |
+
Dn,
|
1642 |
+
jn,
|
1643 |
+
{
|
1644 |
+
value: 16,
|
1645 |
+
value_is_output: 17,
|
1646 |
+
label: 0,
|
1647 |
+
legend_label: 1,
|
1648 |
+
info: 2,
|
1649 |
+
show_label: 3,
|
1650 |
+
show_legend: 4,
|
1651 |
+
show_legend_label: 5,
|
1652 |
+
container: 6,
|
1653 |
+
color_map: 18,
|
1654 |
+
show_copy_button: 7,
|
1655 |
+
disabled: 8
|
1656 |
+
},
|
1657 |
+
null,
|
1658 |
+
[-1, -1]
|
1659 |
+
);
|
1660 |
+
}
|
1661 |
+
}
|
1662 |
+
function me(n) {
|
1663 |
+
let e = ["", "k", "M", "G", "T", "P", "E", "Z"], t = 0;
|
1664 |
+
for (; n > 1e3 && t < e.length - 1; )
|
1665 |
+
n /= 1e3, t++;
|
1666 |
+
let l = e[t];
|
1667 |
+
return (Number.isInteger(n) ? n : n.toFixed(1)) + l;
|
1668 |
+
}
|
1669 |
+
const {
|
1670 |
+
SvelteComponent: Rn,
|
1671 |
+
append: I,
|
1672 |
+
attr: q,
|
1673 |
+
component_subscribe: kt,
|
1674 |
+
detach: Un,
|
1675 |
+
element: Xn,
|
1676 |
+
init: Yn,
|
1677 |
+
insert: Gn,
|
1678 |
+
noop: vt,
|
1679 |
+
safe_not_equal: Wn,
|
1680 |
+
set_style: Fe,
|
1681 |
+
svg_element: O,
|
1682 |
+
toggle_class: yt
|
1683 |
+
} = window.__gradio__svelte__internal, { onMount: Jn } = window.__gradio__svelte__internal;
|
1684 |
+
function Kn(n) {
|
1685 |
+
let e, t, l, i, s, o, _, f, a, r, u, c;
|
1686 |
+
return {
|
1687 |
+
c() {
|
1688 |
+
e = Xn("div"), t = O("svg"), l = O("g"), i = O("path"), s = O("path"), o = O("path"), _ = O("path"), f = O("g"), a = O("path"), r = O("path"), u = O("path"), c = O("path"), q(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), q(i, "fill", "#FF7C00"), q(i, "fill-opacity", "0.4"), q(i, "class", "svelte-43sxxs"), q(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), q(s, "fill", "#FF7C00"), q(s, "class", "svelte-43sxxs"), q(o, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), q(o, "fill", "#FF7C00"), q(o, "fill-opacity", "0.4"), q(o, "class", "svelte-43sxxs"), q(_, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), q(_, "fill", "#FF7C00"), q(_, "class", "svelte-43sxxs"), Fe(l, "transform", "translate(" + /*$top*/
|
1689 |
+
n[1][0] + "px, " + /*$top*/
|
1690 |
+
n[1][1] + "px)"), q(a, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), q(a, "fill", "#FF7C00"), q(a, "fill-opacity", "0.4"), q(a, "class", "svelte-43sxxs"), q(r, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), q(r, "fill", "#FF7C00"), q(r, "class", "svelte-43sxxs"), q(u, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), q(u, "fill", "#FF7C00"), q(u, "fill-opacity", "0.4"), q(u, "class", "svelte-43sxxs"), q(c, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), q(c, "fill", "#FF7C00"), q(c, "class", "svelte-43sxxs"), Fe(f, "transform", "translate(" + /*$bottom*/
|
1691 |
+
n[2][0] + "px, " + /*$bottom*/
|
1692 |
+
n[2][1] + "px)"), q(t, "viewBox", "-1200 -1200 3000 3000"), q(t, "fill", "none"), q(t, "xmlns", "http://www.w3.org/2000/svg"), q(t, "class", "svelte-43sxxs"), q(e, "class", "svelte-43sxxs"), yt(
|
1693 |
+
e,
|
1694 |
+
"margin",
|
1695 |
+
/*margin*/
|
1696 |
+
n[0]
|
1697 |
+
);
|
1698 |
+
},
|
1699 |
+
m(m, p) {
|
1700 |
+
Gn(m, e, p), I(e, t), I(t, l), I(l, i), I(l, s), I(l, o), I(l, _), I(t, f), I(f, a), I(f, r), I(f, u), I(f, c);
|
1701 |
+
},
|
1702 |
+
p(m, [p]) {
|
1703 |
+
p & /*$top*/
|
1704 |
+
2 && Fe(l, "transform", "translate(" + /*$top*/
|
1705 |
+
m[1][0] + "px, " + /*$top*/
|
1706 |
+
m[1][1] + "px)"), p & /*$bottom*/
|
1707 |
+
4 && Fe(f, "transform", "translate(" + /*$bottom*/
|
1708 |
+
m[2][0] + "px, " + /*$bottom*/
|
1709 |
+
m[2][1] + "px)"), p & /*margin*/
|
1710 |
+
1 && yt(
|
1711 |
+
e,
|
1712 |
+
"margin",
|
1713 |
+
/*margin*/
|
1714 |
+
m[0]
|
1715 |
+
);
|
1716 |
+
},
|
1717 |
+
i: vt,
|
1718 |
+
o: vt,
|
1719 |
+
d(m) {
|
1720 |
+
m && Un(e);
|
1721 |
+
}
|
1722 |
+
};
|
1723 |
+
}
|
1724 |
+
function Qn(n, e, t) {
|
1725 |
+
let l, i, { margin: s = !0 } = e;
|
1726 |
+
const o = rt([0, 0]);
|
1727 |
+
kt(n, o, (c) => t(1, l = c));
|
1728 |
+
const _ = rt([0, 0]);
|
1729 |
+
kt(n, _, (c) => t(2, i = c));
|
1730 |
+
let f;
|
1731 |
+
async function a() {
|
1732 |
+
await Promise.all([o.set([125, 140]), _.set([-125, -140])]), await Promise.all([o.set([-125, 140]), _.set([125, -140])]), await Promise.all([o.set([-125, 0]), _.set([125, -0])]), await Promise.all([o.set([125, 0]), _.set([-125, 0])]);
|
1733 |
+
}
|
1734 |
+
async function r() {
|
1735 |
+
await a(), f || r();
|
1736 |
+
}
|
1737 |
+
async function u() {
|
1738 |
+
await Promise.all([o.set([125, 0]), _.set([-125, 0])]), r();
|
1739 |
+
}
|
1740 |
+
return Jn(() => (u(), () => f = !0)), n.$$set = (c) => {
|
1741 |
+
"margin" in c && t(0, s = c.margin);
|
1742 |
+
}, [s, l, i, o, _];
|
1743 |
+
}
|
1744 |
+
class xn extends Rn {
|
1745 |
+
constructor(e) {
|
1746 |
+
super(), Yn(this, e, Qn, Kn, Wn, { margin: 0 });
|
1747 |
+
}
|
1748 |
+
}
|
1749 |
+
const {
|
1750 |
+
SvelteComponent: $n,
|
1751 |
+
append: ie,
|
1752 |
+
attr: X,
|
1753 |
+
binding_callbacks: Ct,
|
1754 |
+
check_outros: Kt,
|
1755 |
+
create_component: ei,
|
1756 |
+
create_slot: ti,
|
1757 |
+
destroy_component: li,
|
1758 |
+
destroy_each: Qt,
|
1759 |
+
detach: k,
|
1760 |
+
element: Q,
|
1761 |
+
empty: pe,
|
1762 |
+
ensure_array_like: ze,
|
1763 |
+
get_all_dirty_from_scope: ni,
|
1764 |
+
get_slot_changes: ii,
|
1765 |
+
group_outros: xt,
|
1766 |
+
init: si,
|
1767 |
+
insert: v,
|
1768 |
+
mount_component: oi,
|
1769 |
+
noop: Ue,
|
1770 |
+
safe_not_equal: fi,
|
1771 |
+
set_data: B,
|
1772 |
+
set_style: te,
|
1773 |
+
space: Y,
|
1774 |
+
text: F,
|
1775 |
+
toggle_class: A,
|
1776 |
+
transition_in: ge,
|
1777 |
+
transition_out: we,
|
1778 |
+
update_slot_base: _i
|
1779 |
+
} = window.__gradio__svelte__internal, { tick: ai } = window.__gradio__svelte__internal, { onDestroy: ri } = window.__gradio__svelte__internal, ui = (n) => ({}), qt = (n) => ({});
|
1780 |
+
function Lt(n, e, t) {
|
1781 |
+
const l = n.slice();
|
1782 |
+
return l[38] = e[t], l[40] = t, l;
|
1783 |
+
}
|
1784 |
+
function St(n, e, t) {
|
1785 |
+
const l = n.slice();
|
1786 |
+
return l[38] = e[t], l;
|
1787 |
+
}
|
1788 |
+
function ci(n) {
|
1789 |
+
let e, t = (
|
1790 |
+
/*i18n*/
|
1791 |
+
n[1]("common.error") + ""
|
1792 |
+
), l, i, s;
|
1793 |
+
const o = (
|
1794 |
+
/*#slots*/
|
1795 |
+
n[29].error
|
1796 |
+
), _ = ti(
|
1797 |
+
o,
|
1798 |
+
n,
|
1799 |
+
/*$$scope*/
|
1800 |
+
n[28],
|
1801 |
+
qt
|
1802 |
+
);
|
1803 |
+
return {
|
1804 |
+
c() {
|
1805 |
+
e = Q("span"), l = F(t), i = Y(), _ && _.c(), X(e, "class", "error svelte-1txqlrd");
|
1806 |
+
},
|
1807 |
+
m(f, a) {
|
1808 |
+
v(f, e, a), ie(e, l), v(f, i, a), _ && _.m(f, a), s = !0;
|
1809 |
+
},
|
1810 |
+
p(f, a) {
|
1811 |
+
(!s || a[0] & /*i18n*/
|
1812 |
+
2) && t !== (t = /*i18n*/
|
1813 |
+
f[1]("common.error") + "") && B(l, t), _ && _.p && (!s || a[0] & /*$$scope*/
|
1814 |
+
268435456) && _i(
|
1815 |
+
_,
|
1816 |
+
o,
|
1817 |
+
f,
|
1818 |
+
/*$$scope*/
|
1819 |
+
f[28],
|
1820 |
+
s ? ii(
|
1821 |
+
o,
|
1822 |
+
/*$$scope*/
|
1823 |
+
f[28],
|
1824 |
+
a,
|
1825 |
+
ui
|
1826 |
+
) : ni(
|
1827 |
+
/*$$scope*/
|
1828 |
+
f[28]
|
1829 |
+
),
|
1830 |
+
qt
|
1831 |
+
);
|
1832 |
+
},
|
1833 |
+
i(f) {
|
1834 |
+
s || (ge(_, f), s = !0);
|
1835 |
+
},
|
1836 |
+
o(f) {
|
1837 |
+
we(_, f), s = !1;
|
1838 |
+
},
|
1839 |
+
d(f) {
|
1840 |
+
f && (k(e), k(i)), _ && _.d(f);
|
1841 |
+
}
|
1842 |
+
};
|
1843 |
+
}
|
1844 |
+
function di(n) {
|
1845 |
+
let e, t, l, i, s, o, _, f, a, r = (
|
1846 |
+
/*variant*/
|
1847 |
+
n[8] === "default" && /*show_eta_bar*/
|
1848 |
+
n[18] && /*show_progress*/
|
1849 |
+
n[6] === "full" && Tt(n)
|
1850 |
+
);
|
1851 |
+
function u(d, y) {
|
1852 |
+
if (
|
1853 |
+
/*progress*/
|
1854 |
+
d[7]
|
1855 |
+
)
|
1856 |
+
return hi;
|
1857 |
+
if (
|
1858 |
+
/*queue_position*/
|
1859 |
+
d[2] !== null && /*queue_size*/
|
1860 |
+
d[3] !== void 0 && /*queue_position*/
|
1861 |
+
d[2] >= 0
|
1862 |
+
)
|
1863 |
+
return bi;
|
1864 |
+
if (
|
1865 |
+
/*queue_position*/
|
1866 |
+
d[2] === 0
|
1867 |
+
)
|
1868 |
+
return mi;
|
1869 |
+
}
|
1870 |
+
let c = u(n), m = c && c(n), p = (
|
1871 |
+
/*timer*/
|
1872 |
+
n[5] && jt(n)
|
1873 |
+
);
|
1874 |
+
const T = [ki, pi], L = [];
|
1875 |
+
function S(d, y) {
|
1876 |
+
return (
|
1877 |
+
/*last_progress_level*/
|
1878 |
+
d[15] != null ? 0 : (
|
1879 |
+
/*show_progress*/
|
1880 |
+
d[6] === "full" ? 1 : -1
|
1881 |
+
)
|
1882 |
+
);
|
1883 |
+
}
|
1884 |
+
~(s = S(n)) && (o = L[s] = T[s](n));
|
1885 |
+
let C = !/*timer*/
|
1886 |
+
n[5] && Bt(n);
|
1887 |
+
return {
|
1888 |
+
c() {
|
1889 |
+
r && r.c(), e = Y(), t = Q("div"), m && m.c(), l = Y(), p && p.c(), i = Y(), o && o.c(), _ = Y(), C && C.c(), f = pe(), X(t, "class", "progress-text svelte-1txqlrd"), A(
|
1890 |
+
t,
|
1891 |
+
"meta-text-center",
|
1892 |
+
/*variant*/
|
1893 |
+
n[8] === "center"
|
1894 |
+
), A(
|
1895 |
+
t,
|
1896 |
+
"meta-text",
|
1897 |
+
/*variant*/
|
1898 |
+
n[8] === "default"
|
1899 |
+
);
|
1900 |
+
},
|
1901 |
+
m(d, y) {
|
1902 |
+
r && r.m(d, y), v(d, e, y), v(d, t, y), m && m.m(t, null), ie(t, l), p && p.m(t, null), v(d, i, y), ~s && L[s].m(d, y), v(d, _, y), C && C.m(d, y), v(d, f, y), a = !0;
|
1903 |
+
},
|
1904 |
+
p(d, y) {
|
1905 |
+
/*variant*/
|
1906 |
+
d[8] === "default" && /*show_eta_bar*/
|
1907 |
+
d[18] && /*show_progress*/
|
1908 |
+
d[6] === "full" ? r ? r.p(d, y) : (r = Tt(d), r.c(), r.m(e.parentNode, e)) : r && (r.d(1), r = null), c === (c = u(d)) && m ? m.p(d, y) : (m && m.d(1), m = c && c(d), m && (m.c(), m.m(t, l))), /*timer*/
|
1909 |
+
d[5] ? p ? p.p(d, y) : (p = jt(d), p.c(), p.m(t, null)) : p && (p.d(1), p = null), (!a || y[0] & /*variant*/
|
1910 |
+
256) && A(
|
1911 |
+
t,
|
1912 |
+
"meta-text-center",
|
1913 |
+
/*variant*/
|
1914 |
+
d[8] === "center"
|
1915 |
+
), (!a || y[0] & /*variant*/
|
1916 |
+
256) && A(
|
1917 |
+
t,
|
1918 |
+
"meta-text",
|
1919 |
+
/*variant*/
|
1920 |
+
d[8] === "default"
|
1921 |
+
);
|
1922 |
+
let M = s;
|
1923 |
+
s = S(d), s === M ? ~s && L[s].p(d, y) : (o && (xt(), we(L[M], 1, 1, () => {
|
1924 |
+
L[M] = null;
|
1925 |
+
}), Kt()), ~s ? (o = L[s], o ? o.p(d, y) : (o = L[s] = T[s](d), o.c()), ge(o, 1), o.m(_.parentNode, _)) : o = null), /*timer*/
|
1926 |
+
d[5] ? C && (C.d(1), C = null) : C ? C.p(d, y) : (C = Bt(d), C.c(), C.m(f.parentNode, f));
|
1927 |
+
},
|
1928 |
+
i(d) {
|
1929 |
+
a || (ge(o), a = !0);
|
1930 |
+
},
|
1931 |
+
o(d) {
|
1932 |
+
we(o), a = !1;
|
1933 |
+
},
|
1934 |
+
d(d) {
|
1935 |
+
d && (k(e), k(t), k(i), k(_), k(f)), r && r.d(d), m && m.d(), p && p.d(), ~s && L[s].d(d), C && C.d(d);
|
1936 |
+
}
|
1937 |
+
};
|
1938 |
+
}
|
1939 |
+
function Tt(n) {
|
1940 |
+
let e, t = `translateX(${/*eta_level*/
|
1941 |
+
(n[17] || 0) * 100 - 100}%)`;
|
1942 |
+
return {
|
1943 |
+
c() {
|
1944 |
+
e = Q("div"), X(e, "class", "eta-bar svelte-1txqlrd"), te(e, "transform", t);
|
1945 |
+
},
|
1946 |
+
m(l, i) {
|
1947 |
+
v(l, e, i);
|
1948 |
+
},
|
1949 |
+
p(l, i) {
|
1950 |
+
i[0] & /*eta_level*/
|
1951 |
+
131072 && t !== (t = `translateX(${/*eta_level*/
|
1952 |
+
(l[17] || 0) * 100 - 100}%)`) && te(e, "transform", t);
|
1953 |
+
},
|
1954 |
+
d(l) {
|
1955 |
+
l && k(e);
|
1956 |
+
}
|
1957 |
+
};
|
1958 |
+
}
|
1959 |
+
function mi(n) {
|
1960 |
+
let e;
|
1961 |
+
return {
|
1962 |
+
c() {
|
1963 |
+
e = F("processing |");
|
1964 |
+
},
|
1965 |
+
m(t, l) {
|
1966 |
+
v(t, e, l);
|
1967 |
+
},
|
1968 |
+
p: Ue,
|
1969 |
+
d(t) {
|
1970 |
+
t && k(e);
|
1971 |
+
}
|
1972 |
+
};
|
1973 |
+
}
|
1974 |
+
function bi(n) {
|
1975 |
+
let e, t = (
|
1976 |
+
/*queue_position*/
|
1977 |
+
n[2] + 1 + ""
|
1978 |
+
), l, i, s, o;
|
1979 |
+
return {
|
1980 |
+
c() {
|
1981 |
+
e = F("queue: "), l = F(t), i = F("/"), s = F(
|
1982 |
+
/*queue_size*/
|
1983 |
+
n[3]
|
1984 |
+
), o = F(" |");
|
1985 |
+
},
|
1986 |
+
m(_, f) {
|
1987 |
+
v(_, e, f), v(_, l, f), v(_, i, f), v(_, s, f), v(_, o, f);
|
1988 |
+
},
|
1989 |
+
p(_, f) {
|
1990 |
+
f[0] & /*queue_position*/
|
1991 |
+
4 && t !== (t = /*queue_position*/
|
1992 |
+
_[2] + 1 + "") && B(l, t), f[0] & /*queue_size*/
|
1993 |
+
8 && B(
|
1994 |
+
s,
|
1995 |
+
/*queue_size*/
|
1996 |
+
_[3]
|
1997 |
+
);
|
1998 |
+
},
|
1999 |
+
d(_) {
|
2000 |
+
_ && (k(e), k(l), k(i), k(s), k(o));
|
2001 |
+
}
|
2002 |
+
};
|
2003 |
+
}
|
2004 |
+
function hi(n) {
|
2005 |
+
let e, t = ze(
|
2006 |
+
/*progress*/
|
2007 |
+
n[7]
|
2008 |
+
), l = [];
|
2009 |
+
for (let i = 0; i < t.length; i += 1)
|
2010 |
+
l[i] = Mt(St(n, t, i));
|
2011 |
+
return {
|
2012 |
+
c() {
|
2013 |
+
for (let i = 0; i < l.length; i += 1)
|
2014 |
+
l[i].c();
|
2015 |
+
e = pe();
|
2016 |
+
},
|
2017 |
+
m(i, s) {
|
2018 |
+
for (let o = 0; o < l.length; o += 1)
|
2019 |
+
l[o] && l[o].m(i, s);
|
2020 |
+
v(i, e, s);
|
2021 |
+
},
|
2022 |
+
p(i, s) {
|
2023 |
+
if (s[0] & /*progress*/
|
2024 |
+
128) {
|
2025 |
+
t = ze(
|
2026 |
+
/*progress*/
|
2027 |
+
i[7]
|
2028 |
+
);
|
2029 |
+
let o;
|
2030 |
+
for (o = 0; o < t.length; o += 1) {
|
2031 |
+
const _ = St(i, t, o);
|
2032 |
+
l[o] ? l[o].p(_, s) : (l[o] = Mt(_), l[o].c(), l[o].m(e.parentNode, e));
|
2033 |
+
}
|
2034 |
+
for (; o < l.length; o += 1)
|
2035 |
+
l[o].d(1);
|
2036 |
+
l.length = t.length;
|
2037 |
+
}
|
2038 |
+
},
|
2039 |
+
d(i) {
|
2040 |
+
i && k(e), Qt(l, i);
|
2041 |
+
}
|
2042 |
+
};
|
2043 |
+
}
|
2044 |
+
function Ft(n) {
|
2045 |
+
let e, t = (
|
2046 |
+
/*p*/
|
2047 |
+
n[38].unit + ""
|
2048 |
+
), l, i, s = " ", o;
|
2049 |
+
function _(r, u) {
|
2050 |
+
return (
|
2051 |
+
/*p*/
|
2052 |
+
r[38].length != null ? wi : gi
|
2053 |
+
);
|
2054 |
+
}
|
2055 |
+
let f = _(n), a = f(n);
|
2056 |
+
return {
|
2057 |
+
c() {
|
2058 |
+
a.c(), e = Y(), l = F(t), i = F(" | "), o = F(s);
|
2059 |
+
},
|
2060 |
+
m(r, u) {
|
2061 |
+
a.m(r, u), v(r, e, u), v(r, l, u), v(r, i, u), v(r, o, u);
|
2062 |
+
},
|
2063 |
+
p(r, u) {
|
2064 |
+
f === (f = _(r)) && a ? a.p(r, u) : (a.d(1), a = f(r), a && (a.c(), a.m(e.parentNode, e))), u[0] & /*progress*/
|
2065 |
+
128 && t !== (t = /*p*/
|
2066 |
+
r[38].unit + "") && B(l, t);
|
2067 |
+
},
|
2068 |
+
d(r) {
|
2069 |
+
r && (k(e), k(l), k(i), k(o)), a.d(r);
|
2070 |
+
}
|
2071 |
+
};
|
2072 |
+
}
|
2073 |
+
function gi(n) {
|
2074 |
+
let e = me(
|
2075 |
+
/*p*/
|
2076 |
+
n[38].index || 0
|
2077 |
+
) + "", t;
|
2078 |
+
return {
|
2079 |
+
c() {
|
2080 |
+
t = F(e);
|
2081 |
+
},
|
2082 |
+
m(l, i) {
|
2083 |
+
v(l, t, i);
|
2084 |
+
},
|
2085 |
+
p(l, i) {
|
2086 |
+
i[0] & /*progress*/
|
2087 |
+
128 && e !== (e = me(
|
2088 |
+
/*p*/
|
2089 |
+
l[38].index || 0
|
2090 |
+
) + "") && B(t, e);
|
2091 |
+
},
|
2092 |
+
d(l) {
|
2093 |
+
l && k(t);
|
2094 |
+
}
|
2095 |
+
};
|
2096 |
+
}
|
2097 |
+
function wi(n) {
|
2098 |
+
let e = me(
|
2099 |
+
/*p*/
|
2100 |
+
n[38].index || 0
|
2101 |
+
) + "", t, l, i = me(
|
2102 |
+
/*p*/
|
2103 |
+
n[38].length
|
2104 |
+
) + "", s;
|
2105 |
+
return {
|
2106 |
+
c() {
|
2107 |
+
t = F(e), l = F("/"), s = F(i);
|
2108 |
+
},
|
2109 |
+
m(o, _) {
|
2110 |
+
v(o, t, _), v(o, l, _), v(o, s, _);
|
2111 |
+
},
|
2112 |
+
p(o, _) {
|
2113 |
+
_[0] & /*progress*/
|
2114 |
+
128 && e !== (e = me(
|
2115 |
+
/*p*/
|
2116 |
+
o[38].index || 0
|
2117 |
+
) + "") && B(t, e), _[0] & /*progress*/
|
2118 |
+
128 && i !== (i = me(
|
2119 |
+
/*p*/
|
2120 |
+
o[38].length
|
2121 |
+
) + "") && B(s, i);
|
2122 |
+
},
|
2123 |
+
d(o) {
|
2124 |
+
o && (k(t), k(l), k(s));
|
2125 |
+
}
|
2126 |
+
};
|
2127 |
+
}
|
2128 |
+
function Mt(n) {
|
2129 |
+
let e, t = (
|
2130 |
+
/*p*/
|
2131 |
+
n[38].index != null && Ft(n)
|
2132 |
+
);
|
2133 |
+
return {
|
2134 |
+
c() {
|
2135 |
+
t && t.c(), e = pe();
|
2136 |
+
},
|
2137 |
+
m(l, i) {
|
2138 |
+
t && t.m(l, i), v(l, e, i);
|
2139 |
+
},
|
2140 |
+
p(l, i) {
|
2141 |
+
/*p*/
|
2142 |
+
l[38].index != null ? t ? t.p(l, i) : (t = Ft(l), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
|
2143 |
+
},
|
2144 |
+
d(l) {
|
2145 |
+
l && k(e), t && t.d(l);
|
2146 |
+
}
|
2147 |
+
};
|
2148 |
+
}
|
2149 |
+
function jt(n) {
|
2150 |
+
let e, t = (
|
2151 |
+
/*eta*/
|
2152 |
+
n[0] ? `/${/*formatted_eta*/
|
2153 |
+
n[19]}` : ""
|
2154 |
+
), l, i;
|
2155 |
+
return {
|
2156 |
+
c() {
|
2157 |
+
e = F(
|
2158 |
+
/*formatted_timer*/
|
2159 |
+
n[20]
|
2160 |
+
), l = F(t), i = F("s");
|
2161 |
+
},
|
2162 |
+
m(s, o) {
|
2163 |
+
v(s, e, o), v(s, l, o), v(s, i, o);
|
2164 |
+
},
|
2165 |
+
p(s, o) {
|
2166 |
+
o[0] & /*formatted_timer*/
|
2167 |
+
1048576 && B(
|
2168 |
+
e,
|
2169 |
+
/*formatted_timer*/
|
2170 |
+
s[20]
|
2171 |
+
), o[0] & /*eta, formatted_eta*/
|
2172 |
+
524289 && t !== (t = /*eta*/
|
2173 |
+
s[0] ? `/${/*formatted_eta*/
|
2174 |
+
s[19]}` : "") && B(l, t);
|
2175 |
+
},
|
2176 |
+
d(s) {
|
2177 |
+
s && (k(e), k(l), k(i));
|
2178 |
+
}
|
2179 |
+
};
|
2180 |
+
}
|
2181 |
+
function pi(n) {
|
2182 |
+
let e, t;
|
2183 |
+
return e = new xn({
|
2184 |
+
props: { margin: (
|
2185 |
+
/*variant*/
|
2186 |
+
n[8] === "default"
|
2187 |
+
) }
|
2188 |
+
}), {
|
2189 |
+
c() {
|
2190 |
+
ei(e.$$.fragment);
|
2191 |
+
},
|
2192 |
+
m(l, i) {
|
2193 |
+
oi(e, l, i), t = !0;
|
2194 |
+
},
|
2195 |
+
p(l, i) {
|
2196 |
+
const s = {};
|
2197 |
+
i[0] & /*variant*/
|
2198 |
+
256 && (s.margin = /*variant*/
|
2199 |
+
l[8] === "default"), e.$set(s);
|
2200 |
+
},
|
2201 |
+
i(l) {
|
2202 |
+
t || (ge(e.$$.fragment, l), t = !0);
|
2203 |
+
},
|
2204 |
+
o(l) {
|
2205 |
+
we(e.$$.fragment, l), t = !1;
|
2206 |
+
},
|
2207 |
+
d(l) {
|
2208 |
+
li(e, l);
|
2209 |
+
}
|
2210 |
+
};
|
2211 |
+
}
|
2212 |
+
function ki(n) {
|
2213 |
+
let e, t, l, i, s, o = `${/*last_progress_level*/
|
2214 |
+
n[15] * 100}%`, _ = (
|
2215 |
+
/*progress*/
|
2216 |
+
n[7] != null && Vt(n)
|
2217 |
+
);
|
2218 |
+
return {
|
2219 |
+
c() {
|
2220 |
+
e = Q("div"), t = Q("div"), _ && _.c(), l = Y(), i = Q("div"), s = Q("div"), X(t, "class", "progress-level-inner svelte-1txqlrd"), X(s, "class", "progress-bar svelte-1txqlrd"), te(s, "width", o), X(i, "class", "progress-bar-wrap svelte-1txqlrd"), X(e, "class", "progress-level svelte-1txqlrd");
|
2221 |
+
},
|
2222 |
+
m(f, a) {
|
2223 |
+
v(f, e, a), ie(e, t), _ && _.m(t, null), ie(e, l), ie(e, i), ie(i, s), n[30](s);
|
2224 |
+
},
|
2225 |
+
p(f, a) {
|
2226 |
+
/*progress*/
|
2227 |
+
f[7] != null ? _ ? _.p(f, a) : (_ = Vt(f), _.c(), _.m(t, null)) : _ && (_.d(1), _ = null), a[0] & /*last_progress_level*/
|
2228 |
+
32768 && o !== (o = `${/*last_progress_level*/
|
2229 |
+
f[15] * 100}%`) && te(s, "width", o);
|
2230 |
+
},
|
2231 |
+
i: Ue,
|
2232 |
+
o: Ue,
|
2233 |
+
d(f) {
|
2234 |
+
f && k(e), _ && _.d(), n[30](null);
|
2235 |
+
}
|
2236 |
+
};
|
2237 |
+
}
|
2238 |
+
function Vt(n) {
|
2239 |
+
let e, t = ze(
|
2240 |
+
/*progress*/
|
2241 |
+
n[7]
|
2242 |
+
), l = [];
|
2243 |
+
for (let i = 0; i < t.length; i += 1)
|
2244 |
+
l[i] = At(Lt(n, t, i));
|
2245 |
+
return {
|
2246 |
+
c() {
|
2247 |
+
for (let i = 0; i < l.length; i += 1)
|
2248 |
+
l[i].c();
|
2249 |
+
e = pe();
|
2250 |
+
},
|
2251 |
+
m(i, s) {
|
2252 |
+
for (let o = 0; o < l.length; o += 1)
|
2253 |
+
l[o] && l[o].m(i, s);
|
2254 |
+
v(i, e, s);
|
2255 |
+
},
|
2256 |
+
p(i, s) {
|
2257 |
+
if (s[0] & /*progress_level, progress*/
|
2258 |
+
16512) {
|
2259 |
+
t = ze(
|
2260 |
+
/*progress*/
|
2261 |
+
i[7]
|
2262 |
+
);
|
2263 |
+
let o;
|
2264 |
+
for (o = 0; o < t.length; o += 1) {
|
2265 |
+
const _ = Lt(i, t, o);
|
2266 |
+
l[o] ? l[o].p(_, s) : (l[o] = At(_), l[o].c(), l[o].m(e.parentNode, e));
|
2267 |
+
}
|
2268 |
+
for (; o < l.length; o += 1)
|
2269 |
+
l[o].d(1);
|
2270 |
+
l.length = t.length;
|
2271 |
+
}
|
2272 |
+
},
|
2273 |
+
d(i) {
|
2274 |
+
i && k(e), Qt(l, i);
|
2275 |
+
}
|
2276 |
+
};
|
2277 |
+
}
|
2278 |
+
function Ht(n) {
|
2279 |
+
let e, t, l, i, s = (
|
2280 |
+
/*i*/
|
2281 |
+
n[40] !== 0 && vi()
|
2282 |
+
), o = (
|
2283 |
+
/*p*/
|
2284 |
+
n[38].desc != null && Nt(n)
|
2285 |
+
), _ = (
|
2286 |
+
/*p*/
|
2287 |
+
n[38].desc != null && /*progress_level*/
|
2288 |
+
n[14] && /*progress_level*/
|
2289 |
+
n[14][
|
2290 |
+
/*i*/
|
2291 |
+
n[40]
|
2292 |
+
] != null && zt()
|
2293 |
+
), f = (
|
2294 |
+
/*progress_level*/
|
2295 |
+
n[14] != null && Zt(n)
|
2296 |
+
);
|
2297 |
+
return {
|
2298 |
+
c() {
|
2299 |
+
s && s.c(), e = Y(), o && o.c(), t = Y(), _ && _.c(), l = Y(), f && f.c(), i = pe();
|
2300 |
+
},
|
2301 |
+
m(a, r) {
|
2302 |
+
s && s.m(a, r), v(a, e, r), o && o.m(a, r), v(a, t, r), _ && _.m(a, r), v(a, l, r), f && f.m(a, r), v(a, i, r);
|
2303 |
+
},
|
2304 |
+
p(a, r) {
|
2305 |
+
/*p*/
|
2306 |
+
a[38].desc != null ? o ? o.p(a, r) : (o = Nt(a), o.c(), o.m(t.parentNode, t)) : o && (o.d(1), o = null), /*p*/
|
2307 |
+
a[38].desc != null && /*progress_level*/
|
2308 |
+
a[14] && /*progress_level*/
|
2309 |
+
a[14][
|
2310 |
+
/*i*/
|
2311 |
+
a[40]
|
2312 |
+
] != null ? _ || (_ = zt(), _.c(), _.m(l.parentNode, l)) : _ && (_.d(1), _ = null), /*progress_level*/
|
2313 |
+
a[14] != null ? f ? f.p(a, r) : (f = Zt(a), f.c(), f.m(i.parentNode, i)) : f && (f.d(1), f = null);
|
2314 |
+
},
|
2315 |
+
d(a) {
|
2316 |
+
a && (k(e), k(t), k(l), k(i)), s && s.d(a), o && o.d(a), _ && _.d(a), f && f.d(a);
|
2317 |
+
}
|
2318 |
+
};
|
2319 |
+
}
|
2320 |
+
function vi(n) {
|
2321 |
+
let e;
|
2322 |
+
return {
|
2323 |
+
c() {
|
2324 |
+
e = F(" /");
|
2325 |
+
},
|
2326 |
+
m(t, l) {
|
2327 |
+
v(t, e, l);
|
2328 |
+
},
|
2329 |
+
d(t) {
|
2330 |
+
t && k(e);
|
2331 |
+
}
|
2332 |
+
};
|
2333 |
+
}
|
2334 |
+
function Nt(n) {
|
2335 |
+
let e = (
|
2336 |
+
/*p*/
|
2337 |
+
n[38].desc + ""
|
2338 |
+
), t;
|
2339 |
+
return {
|
2340 |
+
c() {
|
2341 |
+
t = F(e);
|
2342 |
+
},
|
2343 |
+
m(l, i) {
|
2344 |
+
v(l, t, i);
|
2345 |
+
},
|
2346 |
+
p(l, i) {
|
2347 |
+
i[0] & /*progress*/
|
2348 |
+
128 && e !== (e = /*p*/
|
2349 |
+
l[38].desc + "") && B(t, e);
|
2350 |
+
},
|
2351 |
+
d(l) {
|
2352 |
+
l && k(t);
|
2353 |
+
}
|
2354 |
+
};
|
2355 |
+
}
|
2356 |
+
function zt(n) {
|
2357 |
+
let e;
|
2358 |
+
return {
|
2359 |
+
c() {
|
2360 |
+
e = F("-");
|
2361 |
+
},
|
2362 |
+
m(t, l) {
|
2363 |
+
v(t, e, l);
|
2364 |
+
},
|
2365 |
+
d(t) {
|
2366 |
+
t && k(e);
|
2367 |
+
}
|
2368 |
+
};
|
2369 |
+
}
|
2370 |
+
function Zt(n) {
|
2371 |
+
let e = (100 * /*progress_level*/
|
2372 |
+
(n[14][
|
2373 |
+
/*i*/
|
2374 |
+
n[40]
|
2375 |
+
] || 0)).toFixed(1) + "", t, l;
|
2376 |
+
return {
|
2377 |
+
c() {
|
2378 |
+
t = F(e), l = F("%");
|
2379 |
+
},
|
2380 |
+
m(i, s) {
|
2381 |
+
v(i, t, s), v(i, l, s);
|
2382 |
+
},
|
2383 |
+
p(i, s) {
|
2384 |
+
s[0] & /*progress_level*/
|
2385 |
+
16384 && e !== (e = (100 * /*progress_level*/
|
2386 |
+
(i[14][
|
2387 |
+
/*i*/
|
2388 |
+
i[40]
|
2389 |
+
] || 0)).toFixed(1) + "") && B(t, e);
|
2390 |
+
},
|
2391 |
+
d(i) {
|
2392 |
+
i && (k(t), k(l));
|
2393 |
+
}
|
2394 |
+
};
|
2395 |
+
}
|
2396 |
+
function At(n) {
|
2397 |
+
let e, t = (
|
2398 |
+
/*p*/
|
2399 |
+
(n[38].desc != null || /*progress_level*/
|
2400 |
+
n[14] && /*progress_level*/
|
2401 |
+
n[14][
|
2402 |
+
/*i*/
|
2403 |
+
n[40]
|
2404 |
+
] != null) && Ht(n)
|
2405 |
+
);
|
2406 |
+
return {
|
2407 |
+
c() {
|
2408 |
+
t && t.c(), e = pe();
|
2409 |
+
},
|
2410 |
+
m(l, i) {
|
2411 |
+
t && t.m(l, i), v(l, e, i);
|
2412 |
+
},
|
2413 |
+
p(l, i) {
|
2414 |
+
/*p*/
|
2415 |
+
l[38].desc != null || /*progress_level*/
|
2416 |
+
l[14] && /*progress_level*/
|
2417 |
+
l[14][
|
2418 |
+
/*i*/
|
2419 |
+
l[40]
|
2420 |
+
] != null ? t ? t.p(l, i) : (t = Ht(l), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
|
2421 |
+
},
|
2422 |
+
d(l) {
|
2423 |
+
l && k(e), t && t.d(l);
|
2424 |
+
}
|
2425 |
+
};
|
2426 |
+
}
|
2427 |
+
function Bt(n) {
|
2428 |
+
let e, t;
|
2429 |
+
return {
|
2430 |
+
c() {
|
2431 |
+
e = Q("p"), t = F(
|
2432 |
+
/*loading_text*/
|
2433 |
+
n[9]
|
2434 |
+
), X(e, "class", "loading svelte-1txqlrd");
|
2435 |
+
},
|
2436 |
+
m(l, i) {
|
2437 |
+
v(l, e, i), ie(e, t);
|
2438 |
+
},
|
2439 |
+
p(l, i) {
|
2440 |
+
i[0] & /*loading_text*/
|
2441 |
+
512 && B(
|
2442 |
+
t,
|
2443 |
+
/*loading_text*/
|
2444 |
+
l[9]
|
2445 |
+
);
|
2446 |
+
},
|
2447 |
+
d(l) {
|
2448 |
+
l && k(e);
|
2449 |
+
}
|
2450 |
+
};
|
2451 |
+
}
|
2452 |
+
function yi(n) {
|
2453 |
+
let e, t, l, i, s;
|
2454 |
+
const o = [di, ci], _ = [];
|
2455 |
+
function f(a, r) {
|
2456 |
+
return (
|
2457 |
+
/*status*/
|
2458 |
+
a[4] === "pending" ? 0 : (
|
2459 |
+
/*status*/
|
2460 |
+
a[4] === "error" ? 1 : -1
|
2461 |
+
)
|
2462 |
+
);
|
2463 |
+
}
|
2464 |
+
return ~(t = f(n)) && (l = _[t] = o[t](n)), {
|
2465 |
+
c() {
|
2466 |
+
e = Q("div"), l && l.c(), X(e, "class", i = "wrap " + /*variant*/
|
2467 |
+
n[8] + " " + /*show_progress*/
|
2468 |
+
n[6] + " svelte-1txqlrd"), A(e, "hide", !/*status*/
|
2469 |
+
n[4] || /*status*/
|
2470 |
+
n[4] === "complete" || /*show_progress*/
|
2471 |
+
n[6] === "hidden"), A(
|
2472 |
+
e,
|
2473 |
+
"translucent",
|
2474 |
+
/*variant*/
|
2475 |
+
n[8] === "center" && /*status*/
|
2476 |
+
(n[4] === "pending" || /*status*/
|
2477 |
+
n[4] === "error") || /*translucent*/
|
2478 |
+
n[11] || /*show_progress*/
|
2479 |
+
n[6] === "minimal"
|
2480 |
+
), A(
|
2481 |
+
e,
|
2482 |
+
"generating",
|
2483 |
+
/*status*/
|
2484 |
+
n[4] === "generating"
|
2485 |
+
), A(
|
2486 |
+
e,
|
2487 |
+
"border",
|
2488 |
+
/*border*/
|
2489 |
+
n[12]
|
2490 |
+
), te(
|
2491 |
+
e,
|
2492 |
+
"position",
|
2493 |
+
/*absolute*/
|
2494 |
+
n[10] ? "absolute" : "static"
|
2495 |
+
), te(
|
2496 |
+
e,
|
2497 |
+
"padding",
|
2498 |
+
/*absolute*/
|
2499 |
+
n[10] ? "0" : "var(--size-8) 0"
|
2500 |
+
);
|
2501 |
+
},
|
2502 |
+
m(a, r) {
|
2503 |
+
v(a, e, r), ~t && _[t].m(e, null), n[31](e), s = !0;
|
2504 |
+
},
|
2505 |
+
p(a, r) {
|
2506 |
+
let u = t;
|
2507 |
+
t = f(a), t === u ? ~t && _[t].p(a, r) : (l && (xt(), we(_[u], 1, 1, () => {
|
2508 |
+
_[u] = null;
|
2509 |
+
}), Kt()), ~t ? (l = _[t], l ? l.p(a, r) : (l = _[t] = o[t](a), l.c()), ge(l, 1), l.m(e, null)) : l = null), (!s || r[0] & /*variant, show_progress*/
|
2510 |
+
320 && i !== (i = "wrap " + /*variant*/
|
2511 |
+
a[8] + " " + /*show_progress*/
|
2512 |
+
a[6] + " svelte-1txqlrd")) && X(e, "class", i), (!s || r[0] & /*variant, show_progress, status, show_progress*/
|
2513 |
+
336) && A(e, "hide", !/*status*/
|
2514 |
+
a[4] || /*status*/
|
2515 |
+
a[4] === "complete" || /*show_progress*/
|
2516 |
+
a[6] === "hidden"), (!s || r[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
|
2517 |
+
2384) && A(
|
2518 |
+
e,
|
2519 |
+
"translucent",
|
2520 |
+
/*variant*/
|
2521 |
+
a[8] === "center" && /*status*/
|
2522 |
+
(a[4] === "pending" || /*status*/
|
2523 |
+
a[4] === "error") || /*translucent*/
|
2524 |
+
a[11] || /*show_progress*/
|
2525 |
+
a[6] === "minimal"
|
2526 |
+
), (!s || r[0] & /*variant, show_progress, status*/
|
2527 |
+
336) && A(
|
2528 |
+
e,
|
2529 |
+
"generating",
|
2530 |
+
/*status*/
|
2531 |
+
a[4] === "generating"
|
2532 |
+
), (!s || r[0] & /*variant, show_progress, border*/
|
2533 |
+
4416) && A(
|
2534 |
+
e,
|
2535 |
+
"border",
|
2536 |
+
/*border*/
|
2537 |
+
a[12]
|
2538 |
+
), r[0] & /*absolute*/
|
2539 |
+
1024 && te(
|
2540 |
+
e,
|
2541 |
+
"position",
|
2542 |
+
/*absolute*/
|
2543 |
+
a[10] ? "absolute" : "static"
|
2544 |
+
), r[0] & /*absolute*/
|
2545 |
+
1024 && te(
|
2546 |
+
e,
|
2547 |
+
"padding",
|
2548 |
+
/*absolute*/
|
2549 |
+
a[10] ? "0" : "var(--size-8) 0"
|
2550 |
+
);
|
2551 |
+
},
|
2552 |
+
i(a) {
|
2553 |
+
s || (ge(l), s = !0);
|
2554 |
+
},
|
2555 |
+
o(a) {
|
2556 |
+
we(l), s = !1;
|
2557 |
+
},
|
2558 |
+
d(a) {
|
2559 |
+
a && k(e), ~t && _[t].d(), n[31](null);
|
2560 |
+
}
|
2561 |
+
};
|
2562 |
+
}
|
2563 |
+
let Me = [], Oe = !1;
|
2564 |
+
async function Ci(n, e = !0) {
|
2565 |
+
if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && e !== !0)) {
|
2566 |
+
if (Me.push(n), !Oe)
|
2567 |
+
Oe = !0;
|
2568 |
+
else
|
2569 |
+
return;
|
2570 |
+
await ai(), requestAnimationFrame(() => {
|
2571 |
+
let t = [0, 0];
|
2572 |
+
for (let l = 0; l < Me.length; l++) {
|
2573 |
+
const s = Me[l].getBoundingClientRect();
|
2574 |
+
(l === 0 || s.top + window.scrollY <= t[0]) && (t[0] = s.top + window.scrollY, t[1] = l);
|
2575 |
+
}
|
2576 |
+
window.scrollTo({ top: t[0] - 20, behavior: "smooth" }), Oe = !1, Me = [];
|
2577 |
+
});
|
2578 |
+
}
|
2579 |
+
}
|
2580 |
+
function qi(n, e, t) {
|
2581 |
+
let l, { $$slots: i = {}, $$scope: s } = e, { i18n: o } = e, { eta: _ = null } = e, { queue_position: f } = e, { queue_size: a } = e, { status: r } = e, { scroll_to_output: u = !1 } = e, { timer: c = !0 } = e, { show_progress: m = "full" } = e, { message: p = null } = e, { progress: T = null } = e, { variant: L = "default" } = e, { loading_text: S = "Loading..." } = e, { absolute: C = !0 } = e, { translucent: d = !1 } = e, { border: y = !1 } = e, { autoscroll: M } = e, h, P = !1, J = 0, z = 0, D = null, R = null, fe = 0, E = null, K, Z = null, _e = !0;
|
2582 |
+
const g = () => {
|
2583 |
+
t(0, _ = t(26, D = t(19, ae = null))), t(24, J = performance.now()), t(25, z = 0), P = !0, qe();
|
2584 |
+
};
|
2585 |
+
function qe() {
|
2586 |
+
requestAnimationFrame(() => {
|
2587 |
+
t(25, z = (performance.now() - J) / 1e3), P && qe();
|
2588 |
+
});
|
2589 |
+
}
|
2590 |
+
function Le() {
|
2591 |
+
t(25, z = 0), t(0, _ = t(26, D = t(19, ae = null))), P && (P = !1);
|
2592 |
+
}
|
2593 |
+
ri(() => {
|
2594 |
+
P && Le();
|
2595 |
+
});
|
2596 |
+
let ae = null;
|
2597 |
+
function Ze(w) {
|
2598 |
+
Ct[w ? "unshift" : "push"](() => {
|
2599 |
+
Z = w, t(16, Z), t(7, T), t(14, E), t(15, K);
|
2600 |
+
});
|
2601 |
+
}
|
2602 |
+
function Ae(w) {
|
2603 |
+
Ct[w ? "unshift" : "push"](() => {
|
2604 |
+
h = w, t(13, h);
|
2605 |
+
});
|
2606 |
+
}
|
2607 |
+
return n.$$set = (w) => {
|
2608 |
+
"i18n" in w && t(1, o = w.i18n), "eta" in w && t(0, _ = w.eta), "queue_position" in w && t(2, f = w.queue_position), "queue_size" in w && t(3, a = w.queue_size), "status" in w && t(4, r = w.status), "scroll_to_output" in w && t(21, u = w.scroll_to_output), "timer" in w && t(5, c = w.timer), "show_progress" in w && t(6, m = w.show_progress), "message" in w && t(22, p = w.message), "progress" in w && t(7, T = w.progress), "variant" in w && t(8, L = w.variant), "loading_text" in w && t(9, S = w.loading_text), "absolute" in w && t(10, C = w.absolute), "translucent" in w && t(11, d = w.translucent), "border" in w && t(12, y = w.border), "autoscroll" in w && t(23, M = w.autoscroll), "$$scope" in w && t(28, s = w.$$scope);
|
2609 |
+
}, n.$$.update = () => {
|
2610 |
+
n.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
|
2611 |
+
218103809 && (_ === null && t(0, _ = D), _ != null && D !== _ && (t(27, R = (performance.now() - J) / 1e3 + _), t(19, ae = R.toFixed(1)), t(26, D = _))), n.$$.dirty[0] & /*eta_from_start, timer_diff*/
|
2612 |
+
167772160 && t(17, fe = R === null || R <= 0 || !z ? null : Math.min(z / R, 1)), n.$$.dirty[0] & /*progress*/
|
2613 |
+
128 && T != null && t(18, _e = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
|
2614 |
+
114816 && (T != null ? t(14, E = T.map((w) => {
|
2615 |
+
if (w.index != null && w.length != null)
|
2616 |
+
return w.index / w.length;
|
2617 |
+
if (w.progress != null)
|
2618 |
+
return w.progress;
|
2619 |
+
})) : t(14, E = null), E ? (t(15, K = E[E.length - 1]), Z && (K === 0 ? t(16, Z.style.transition = "0", Z) : t(16, Z.style.transition = "150ms", Z))) : t(15, K = void 0)), n.$$.dirty[0] & /*status*/
|
2620 |
+
16 && (r === "pending" ? g() : Le()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
|
2621 |
+
10493968 && h && u && (r === "pending" || r === "complete") && Ci(h, M), n.$$.dirty[0] & /*status, message*/
|
2622 |
+
4194320, n.$$.dirty[0] & /*timer_diff*/
|
2623 |
+
33554432 && t(20, l = z.toFixed(1));
|
2624 |
+
}, [
|
2625 |
+
_,
|
2626 |
+
o,
|
2627 |
+
f,
|
2628 |
+
a,
|
2629 |
+
r,
|
2630 |
+
c,
|
2631 |
+
m,
|
2632 |
+
T,
|
2633 |
+
L,
|
2634 |
+
S,
|
2635 |
+
C,
|
2636 |
+
d,
|
2637 |
+
y,
|
2638 |
+
h,
|
2639 |
+
E,
|
2640 |
+
K,
|
2641 |
+
Z,
|
2642 |
+
fe,
|
2643 |
+
_e,
|
2644 |
+
ae,
|
2645 |
+
l,
|
2646 |
+
u,
|
2647 |
+
p,
|
2648 |
+
M,
|
2649 |
+
J,
|
2650 |
+
z,
|
2651 |
+
D,
|
2652 |
+
R,
|
2653 |
+
s,
|
2654 |
+
i,
|
2655 |
+
Ze,
|
2656 |
+
Ae
|
2657 |
+
];
|
2658 |
+
}
|
2659 |
+
class Li extends $n {
|
2660 |
+
constructor(e) {
|
2661 |
+
super(), si(
|
2662 |
+
this,
|
2663 |
+
e,
|
2664 |
+
qi,
|
2665 |
+
yi,
|
2666 |
+
fi,
|
2667 |
+
{
|
2668 |
+
i18n: 1,
|
2669 |
+
eta: 0,
|
2670 |
+
queue_position: 2,
|
2671 |
+
queue_size: 3,
|
2672 |
+
status: 4,
|
2673 |
+
scroll_to_output: 21,
|
2674 |
+
timer: 5,
|
2675 |
+
show_progress: 6,
|
2676 |
+
message: 22,
|
2677 |
+
progress: 7,
|
2678 |
+
variant: 8,
|
2679 |
+
loading_text: 9,
|
2680 |
+
absolute: 10,
|
2681 |
+
translucent: 11,
|
2682 |
+
border: 12,
|
2683 |
+
autoscroll: 23
|
2684 |
+
},
|
2685 |
+
null,
|
2686 |
+
[-1, -1]
|
2687 |
+
);
|
2688 |
+
}
|
2689 |
+
}
|
2690 |
+
const {
|
2691 |
+
SvelteComponent: Si,
|
2692 |
+
add_flush_callback: Pt,
|
2693 |
+
assign: Ti,
|
2694 |
+
bind: Dt,
|
2695 |
+
binding_callbacks: Et,
|
2696 |
+
check_outros: Fi,
|
2697 |
+
create_component: Qe,
|
2698 |
+
destroy_component: xe,
|
2699 |
+
detach: Mi,
|
2700 |
+
flush: j,
|
2701 |
+
get_spread_object: ji,
|
2702 |
+
get_spread_update: Vi,
|
2703 |
+
group_outros: Hi,
|
2704 |
+
init: Ni,
|
2705 |
+
insert: zi,
|
2706 |
+
mount_component: $e,
|
2707 |
+
safe_not_equal: Zi,
|
2708 |
+
space: Ai,
|
2709 |
+
transition_in: be,
|
2710 |
+
transition_out: Ce
|
2711 |
+
} = window.__gradio__svelte__internal;
|
2712 |
+
function It(n) {
|
2713 |
+
let e, t;
|
2714 |
+
const l = [
|
2715 |
+
{ autoscroll: (
|
2716 |
+
/*gradio*/
|
2717 |
+
n[3].autoscroll
|
2718 |
+
) },
|
2719 |
+
{ i18n: (
|
2720 |
+
/*gradio*/
|
2721 |
+
n[3].i18n
|
2722 |
+
) },
|
2723 |
+
/*loading_status*/
|
2724 |
+
n[17]
|
2725 |
+
];
|
2726 |
+
let i = {};
|
2727 |
+
for (let s = 0; s < l.length; s += 1)
|
2728 |
+
i = Ti(i, l[s]);
|
2729 |
+
return e = new Li({ props: i }), {
|
2730 |
+
c() {
|
2731 |
+
Qe(e.$$.fragment);
|
2732 |
+
},
|
2733 |
+
m(s, o) {
|
2734 |
+
$e(e, s, o), t = !0;
|
2735 |
+
},
|
2736 |
+
p(s, o) {
|
2737 |
+
const _ = o & /*gradio, loading_status*/
|
2738 |
+
131080 ? Vi(l, [
|
2739 |
+
o & /*gradio*/
|
2740 |
+
8 && { autoscroll: (
|
2741 |
+
/*gradio*/
|
2742 |
+
s[3].autoscroll
|
2743 |
+
) },
|
2744 |
+
o & /*gradio*/
|
2745 |
+
8 && { i18n: (
|
2746 |
+
/*gradio*/
|
2747 |
+
s[3].i18n
|
2748 |
+
) },
|
2749 |
+
o & /*loading_status*/
|
2750 |
+
131072 && ji(
|
2751 |
+
/*loading_status*/
|
2752 |
+
s[17]
|
2753 |
+
)
|
2754 |
+
]) : {};
|
2755 |
+
e.$set(_);
|
2756 |
+
},
|
2757 |
+
i(s) {
|
2758 |
+
t || (be(e.$$.fragment, s), t = !0);
|
2759 |
+
},
|
2760 |
+
o(s) {
|
2761 |
+
Ce(e.$$.fragment, s), t = !1;
|
2762 |
+
},
|
2763 |
+
d(s) {
|
2764 |
+
xe(e, s);
|
2765 |
+
}
|
2766 |
+
};
|
2767 |
+
}
|
2768 |
+
function Bi(n) {
|
2769 |
+
let e, t, l, i, s, o = (
|
2770 |
+
/*loading_status*/
|
2771 |
+
n[17] && It(n)
|
2772 |
+
);
|
2773 |
+
function _(r) {
|
2774 |
+
n[22](r);
|
2775 |
+
}
|
2776 |
+
function f(r) {
|
2777 |
+
n[23](r);
|
2778 |
+
}
|
2779 |
+
let a = {
|
2780 |
+
label: (
|
2781 |
+
/*label*/
|
2782 |
+
n[4]
|
2783 |
+
),
|
2784 |
+
info: (
|
2785 |
+
/*info*/
|
2786 |
+
n[6]
|
2787 |
+
),
|
2788 |
+
show_label: (
|
2789 |
+
/*show_label*/
|
2790 |
+
n[10]
|
2791 |
+
),
|
2792 |
+
show_legend: (
|
2793 |
+
/*show_legend*/
|
2794 |
+
n[11]
|
2795 |
+
),
|
2796 |
+
show_legend_label: (
|
2797 |
+
/*show_legend_label*/
|
2798 |
+
n[12]
|
2799 |
+
),
|
2800 |
+
legend_label: (
|
2801 |
+
/*legend_label*/
|
2802 |
+
n[5]
|
2803 |
+
),
|
2804 |
+
color_map: (
|
2805 |
+
/*color_map*/
|
2806 |
+
n[1]
|
2807 |
+
),
|
2808 |
+
show_copy_button: (
|
2809 |
+
/*show_copy_button*/
|
2810 |
+
n[16]
|
2811 |
+
),
|
2812 |
+
container: (
|
2813 |
+
/*container*/
|
2814 |
+
n[13]
|
2815 |
+
),
|
2816 |
+
disabled: !/*interactive*/
|
2817 |
+
n[18]
|
2818 |
+
};
|
2819 |
+
return (
|
2820 |
+
/*value*/
|
2821 |
+
n[0] !== void 0 && (a.value = /*value*/
|
2822 |
+
n[0]), /*value_is_output*/
|
2823 |
+
n[2] !== void 0 && (a.value_is_output = /*value_is_output*/
|
2824 |
+
n[2]), t = new On({ props: a }), Et.push(() => Dt(t, "value", _)), Et.push(() => Dt(t, "value_is_output", f)), t.$on(
|
2825 |
+
"change",
|
2826 |
+
/*change_handler*/
|
2827 |
+
n[24]
|
2828 |
+
), t.$on(
|
2829 |
+
"input",
|
2830 |
+
/*input_handler*/
|
2831 |
+
n[25]
|
2832 |
+
), t.$on(
|
2833 |
+
"submit",
|
2834 |
+
/*submit_handler*/
|
2835 |
+
n[26]
|
2836 |
+
), t.$on(
|
2837 |
+
"blur",
|
2838 |
+
/*blur_handler*/
|
2839 |
+
n[27]
|
2840 |
+
), t.$on(
|
2841 |
+
"select",
|
2842 |
+
/*select_handler*/
|
2843 |
+
n[28]
|
2844 |
+
), t.$on(
|
2845 |
+
"focus",
|
2846 |
+
/*focus_handler*/
|
2847 |
+
n[29]
|
2848 |
+
), {
|
2849 |
+
c() {
|
2850 |
+
o && o.c(), e = Ai(), Qe(t.$$.fragment);
|
2851 |
+
},
|
2852 |
+
m(r, u) {
|
2853 |
+
o && o.m(r, u), zi(r, e, u), $e(t, r, u), s = !0;
|
2854 |
+
},
|
2855 |
+
p(r, u) {
|
2856 |
+
/*loading_status*/
|
2857 |
+
r[17] ? o ? (o.p(r, u), u & /*loading_status*/
|
2858 |
+
131072 && be(o, 1)) : (o = It(r), o.c(), be(o, 1), o.m(e.parentNode, e)) : o && (Hi(), Ce(o, 1, 1, () => {
|
2859 |
+
o = null;
|
2860 |
+
}), Fi());
|
2861 |
+
const c = {};
|
2862 |
+
u & /*label*/
|
2863 |
+
16 && (c.label = /*label*/
|
2864 |
+
r[4]), u & /*info*/
|
2865 |
+
64 && (c.info = /*info*/
|
2866 |
+
r[6]), u & /*show_label*/
|
2867 |
+
1024 && (c.show_label = /*show_label*/
|
2868 |
+
r[10]), u & /*show_legend*/
|
2869 |
+
2048 && (c.show_legend = /*show_legend*/
|
2870 |
+
r[11]), u & /*show_legend_label*/
|
2871 |
+
4096 && (c.show_legend_label = /*show_legend_label*/
|
2872 |
+
r[12]), u & /*legend_label*/
|
2873 |
+
32 && (c.legend_label = /*legend_label*/
|
2874 |
+
r[5]), u & /*color_map*/
|
2875 |
+
2 && (c.color_map = /*color_map*/
|
2876 |
+
r[1]), u & /*show_copy_button*/
|
2877 |
+
65536 && (c.show_copy_button = /*show_copy_button*/
|
2878 |
+
r[16]), u & /*container*/
|
2879 |
+
8192 && (c.container = /*container*/
|
2880 |
+
r[13]), u & /*interactive*/
|
2881 |
+
262144 && (c.disabled = !/*interactive*/
|
2882 |
+
r[18]), !l && u & /*value*/
|
2883 |
+
1 && (l = !0, c.value = /*value*/
|
2884 |
+
r[0], Pt(() => l = !1)), !i && u & /*value_is_output*/
|
2885 |
+
4 && (i = !0, c.value_is_output = /*value_is_output*/
|
2886 |
+
r[2], Pt(() => i = !1)), t.$set(c);
|
2887 |
+
},
|
2888 |
+
i(r) {
|
2889 |
+
s || (be(o), be(t.$$.fragment, r), s = !0);
|
2890 |
+
},
|
2891 |
+
o(r) {
|
2892 |
+
Ce(o), Ce(t.$$.fragment, r), s = !1;
|
2893 |
+
},
|
2894 |
+
d(r) {
|
2895 |
+
r && Mi(e), o && o.d(r), xe(t, r);
|
2896 |
+
}
|
2897 |
+
}
|
2898 |
+
);
|
2899 |
+
}
|
2900 |
+
function Pi(n) {
|
2901 |
+
let e, t;
|
2902 |
+
return e = new bl({
|
2903 |
+
props: {
|
2904 |
+
visible: (
|
2905 |
+
/*visible*/
|
2906 |
+
n[9]
|
2907 |
+
),
|
2908 |
+
elem_id: (
|
2909 |
+
/*elem_id*/
|
2910 |
+
n[7]
|
2911 |
+
),
|
2912 |
+
elem_classes: (
|
2913 |
+
/*elem_classes*/
|
2914 |
+
n[8]
|
2915 |
+
),
|
2916 |
+
scale: (
|
2917 |
+
/*scale*/
|
2918 |
+
n[14]
|
2919 |
+
),
|
2920 |
+
min_width: (
|
2921 |
+
/*min_width*/
|
2922 |
+
n[15]
|
2923 |
+
),
|
2924 |
+
allow_overflow: !1,
|
2925 |
+
padding: (
|
2926 |
+
/*container*/
|
2927 |
+
n[13]
|
2928 |
+
),
|
2929 |
+
$$slots: { default: [Bi] },
|
2930 |
+
$$scope: { ctx: n }
|
2931 |
+
}
|
2932 |
+
}), {
|
2933 |
+
c() {
|
2934 |
+
Qe(e.$$.fragment);
|
2935 |
+
},
|
2936 |
+
m(l, i) {
|
2937 |
+
$e(e, l, i), t = !0;
|
2938 |
+
},
|
2939 |
+
p(l, [i]) {
|
2940 |
+
const s = {};
|
2941 |
+
i & /*visible*/
|
2942 |
+
512 && (s.visible = /*visible*/
|
2943 |
+
l[9]), i & /*elem_id*/
|
2944 |
+
128 && (s.elem_id = /*elem_id*/
|
2945 |
+
l[7]), i & /*elem_classes*/
|
2946 |
+
256 && (s.elem_classes = /*elem_classes*/
|
2947 |
+
l[8]), i & /*scale*/
|
2948 |
+
16384 && (s.scale = /*scale*/
|
2949 |
+
l[14]), i & /*min_width*/
|
2950 |
+
32768 && (s.min_width = /*min_width*/
|
2951 |
+
l[15]), i & /*container*/
|
2952 |
+
8192 && (s.padding = /*container*/
|
2953 |
+
l[13]), i & /*$$scope, label, info, show_label, show_legend, show_legend_label, legend_label, color_map, show_copy_button, container, interactive, value, value_is_output, gradio, loading_status*/
|
2954 |
+
1074216063 && (s.$$scope = { dirty: i, ctx: l }), e.$set(s);
|
2955 |
+
},
|
2956 |
+
i(l) {
|
2957 |
+
t || (be(e.$$.fragment, l), t = !0);
|
2958 |
+
},
|
2959 |
+
o(l) {
|
2960 |
+
Ce(e.$$.fragment, l), t = !1;
|
2961 |
+
},
|
2962 |
+
d(l) {
|
2963 |
+
xe(e, l);
|
2964 |
+
}
|
2965 |
+
};
|
2966 |
+
}
|
2967 |
+
function Di(n, e, t) {
|
2968 |
+
let { gradio: l } = e, { label: i = "Highlighted Textbox" } = e, { legend_label: s = "Highlights:" } = e, { info: o = void 0 } = e, { elem_id: _ = "" } = e, { elem_classes: f = [] } = e, { visible: a = !0 } = e, { value: r } = e, { show_label: u } = e, { show_legend: c } = e, { show_legend_label: m } = e, { color_map: p = {} } = e, { container: T = !0 } = e, { scale: L = null } = e, { min_width: S = void 0 } = e, { show_copy_button: C = !1 } = e, { loading_status: d = void 0 } = e, { value_is_output: y = !1 } = e, { combine_adjacent: M = !1 } = e, { interactive: h = !0 } = e;
|
2969 |
+
const P = !1, J = !0;
|
2970 |
+
function z(g) {
|
2971 |
+
r = g, t(0, r), t(19, M);
|
2972 |
+
}
|
2973 |
+
function D(g) {
|
2974 |
+
y = g, t(2, y);
|
2975 |
+
}
|
2976 |
+
const R = () => l.dispatch("change"), fe = () => l.dispatch("input"), E = () => l.dispatch("submit"), K = () => l.dispatch("blur"), Z = (g) => l.dispatch("select", g.detail), _e = () => l.dispatch("focus");
|
2977 |
+
return n.$$set = (g) => {
|
2978 |
+
"gradio" in g && t(3, l = g.gradio), "label" in g && t(4, i = g.label), "legend_label" in g && t(5, s = g.legend_label), "info" in g && t(6, o = g.info), "elem_id" in g && t(7, _ = g.elem_id), "elem_classes" in g && t(8, f = g.elem_classes), "visible" in g && t(9, a = g.visible), "value" in g && t(0, r = g.value), "show_label" in g && t(10, u = g.show_label), "show_legend" in g && t(11, c = g.show_legend), "show_legend_label" in g && t(12, m = g.show_legend_label), "color_map" in g && t(1, p = g.color_map), "container" in g && t(13, T = g.container), "scale" in g && t(14, L = g.scale), "min_width" in g && t(15, S = g.min_width), "show_copy_button" in g && t(16, C = g.show_copy_button), "loading_status" in g && t(17, d = g.loading_status), "value_is_output" in g && t(2, y = g.value_is_output), "combine_adjacent" in g && t(19, M = g.combine_adjacent), "interactive" in g && t(18, h = g.interactive);
|
2979 |
+
}, n.$$.update = () => {
|
2980 |
+
n.$$.dirty & /*color_map*/
|
2981 |
+
2 && !p && Object.keys(p).length && t(1, p), n.$$.dirty & /*value, combine_adjacent*/
|
2982 |
+
524289 && r && M && t(0, r = Cn(r, "equal"));
|
2983 |
+
}, [
|
2984 |
+
r,
|
2985 |
+
p,
|
2986 |
+
y,
|
2987 |
+
l,
|
2988 |
+
i,
|
2989 |
+
s,
|
2990 |
+
o,
|
2991 |
+
_,
|
2992 |
+
f,
|
2993 |
+
a,
|
2994 |
+
u,
|
2995 |
+
c,
|
2996 |
+
m,
|
2997 |
+
T,
|
2998 |
+
L,
|
2999 |
+
S,
|
3000 |
+
C,
|
3001 |
+
d,
|
3002 |
+
h,
|
3003 |
+
M,
|
3004 |
+
P,
|
3005 |
+
J,
|
3006 |
+
z,
|
3007 |
+
D,
|
3008 |
+
R,
|
3009 |
+
fe,
|
3010 |
+
E,
|
3011 |
+
K,
|
3012 |
+
Z,
|
3013 |
+
_e
|
3014 |
+
];
|
3015 |
+
}
|
3016 |
+
class Ii extends Si {
|
3017 |
+
constructor(e) {
|
3018 |
+
super(), Ni(this, e, Di, Pi, Zi, {
|
3019 |
+
gradio: 3,
|
3020 |
+
label: 4,
|
3021 |
+
legend_label: 5,
|
3022 |
+
info: 6,
|
3023 |
+
elem_id: 7,
|
3024 |
+
elem_classes: 8,
|
3025 |
+
visible: 9,
|
3026 |
+
value: 0,
|
3027 |
+
show_label: 10,
|
3028 |
+
show_legend: 11,
|
3029 |
+
show_legend_label: 12,
|
3030 |
+
color_map: 1,
|
3031 |
+
container: 13,
|
3032 |
+
scale: 14,
|
3033 |
+
min_width: 15,
|
3034 |
+
show_copy_button: 16,
|
3035 |
+
loading_status: 17,
|
3036 |
+
value_is_output: 2,
|
3037 |
+
combine_adjacent: 19,
|
3038 |
+
interactive: 18,
|
3039 |
+
autofocus: 20,
|
3040 |
+
autoscroll: 21
|
3041 |
+
});
|
3042 |
+
}
|
3043 |
+
get gradio() {
|
3044 |
+
return this.$$.ctx[3];
|
3045 |
+
}
|
3046 |
+
set gradio(e) {
|
3047 |
+
this.$$set({ gradio: e }), j();
|
3048 |
+
}
|
3049 |
+
get label() {
|
3050 |
+
return this.$$.ctx[4];
|
3051 |
+
}
|
3052 |
+
set label(e) {
|
3053 |
+
this.$$set({ label: e }), j();
|
3054 |
+
}
|
3055 |
+
get legend_label() {
|
3056 |
+
return this.$$.ctx[5];
|
3057 |
+
}
|
3058 |
+
set legend_label(e) {
|
3059 |
+
this.$$set({ legend_label: e }), j();
|
3060 |
+
}
|
3061 |
+
get info() {
|
3062 |
+
return this.$$.ctx[6];
|
3063 |
+
}
|
3064 |
+
set info(e) {
|
3065 |
+
this.$$set({ info: e }), j();
|
3066 |
+
}
|
3067 |
+
get elem_id() {
|
3068 |
+
return this.$$.ctx[7];
|
3069 |
+
}
|
3070 |
+
set elem_id(e) {
|
3071 |
+
this.$$set({ elem_id: e }), j();
|
3072 |
+
}
|
3073 |
+
get elem_classes() {
|
3074 |
+
return this.$$.ctx[8];
|
3075 |
+
}
|
3076 |
+
set elem_classes(e) {
|
3077 |
+
this.$$set({ elem_classes: e }), j();
|
3078 |
+
}
|
3079 |
+
get visible() {
|
3080 |
+
return this.$$.ctx[9];
|
3081 |
+
}
|
3082 |
+
set visible(e) {
|
3083 |
+
this.$$set({ visible: e }), j();
|
3084 |
+
}
|
3085 |
+
get value() {
|
3086 |
+
return this.$$.ctx[0];
|
3087 |
+
}
|
3088 |
+
set value(e) {
|
3089 |
+
this.$$set({ value: e }), j();
|
3090 |
+
}
|
3091 |
+
get show_label() {
|
3092 |
+
return this.$$.ctx[10];
|
3093 |
+
}
|
3094 |
+
set show_label(e) {
|
3095 |
+
this.$$set({ show_label: e }), j();
|
3096 |
+
}
|
3097 |
+
get show_legend() {
|
3098 |
+
return this.$$.ctx[11];
|
3099 |
+
}
|
3100 |
+
set show_legend(e) {
|
3101 |
+
this.$$set({ show_legend: e }), j();
|
3102 |
+
}
|
3103 |
+
get show_legend_label() {
|
3104 |
+
return this.$$.ctx[12];
|
3105 |
+
}
|
3106 |
+
set show_legend_label(e) {
|
3107 |
+
this.$$set({ show_legend_label: e }), j();
|
3108 |
+
}
|
3109 |
+
get color_map() {
|
3110 |
+
return this.$$.ctx[1];
|
3111 |
+
}
|
3112 |
+
set color_map(e) {
|
3113 |
+
this.$$set({ color_map: e }), j();
|
3114 |
+
}
|
3115 |
+
get container() {
|
3116 |
+
return this.$$.ctx[13];
|
3117 |
+
}
|
3118 |
+
set container(e) {
|
3119 |
+
this.$$set({ container: e }), j();
|
3120 |
+
}
|
3121 |
+
get scale() {
|
3122 |
+
return this.$$.ctx[14];
|
3123 |
+
}
|
3124 |
+
set scale(e) {
|
3125 |
+
this.$$set({ scale: e }), j();
|
3126 |
+
}
|
3127 |
+
get min_width() {
|
3128 |
+
return this.$$.ctx[15];
|
3129 |
+
}
|
3130 |
+
set min_width(e) {
|
3131 |
+
this.$$set({ min_width: e }), j();
|
3132 |
+
}
|
3133 |
+
get show_copy_button() {
|
3134 |
+
return this.$$.ctx[16];
|
3135 |
+
}
|
3136 |
+
set show_copy_button(e) {
|
3137 |
+
this.$$set({ show_copy_button: e }), j();
|
3138 |
+
}
|
3139 |
+
get loading_status() {
|
3140 |
+
return this.$$.ctx[17];
|
3141 |
+
}
|
3142 |
+
set loading_status(e) {
|
3143 |
+
this.$$set({ loading_status: e }), j();
|
3144 |
+
}
|
3145 |
+
get value_is_output() {
|
3146 |
+
return this.$$.ctx[2];
|
3147 |
+
}
|
3148 |
+
set value_is_output(e) {
|
3149 |
+
this.$$set({ value_is_output: e }), j();
|
3150 |
+
}
|
3151 |
+
get combine_adjacent() {
|
3152 |
+
return this.$$.ctx[19];
|
3153 |
+
}
|
3154 |
+
set combine_adjacent(e) {
|
3155 |
+
this.$$set({ combine_adjacent: e }), j();
|
3156 |
+
}
|
3157 |
+
get interactive() {
|
3158 |
+
return this.$$.ctx[18];
|
3159 |
+
}
|
3160 |
+
set interactive(e) {
|
3161 |
+
this.$$set({ interactive: e }), j();
|
3162 |
+
}
|
3163 |
+
get autofocus() {
|
3164 |
+
return this.$$.ctx[20];
|
3165 |
+
}
|
3166 |
+
get autoscroll() {
|
3167 |
+
return this.$$.ctx[21];
|
3168 |
+
}
|
3169 |
+
}
|
3170 |
+
export {
|
3171 |
+
Ii as default
|
3172 |
+
};
|
src/backend/gradio_highlightedtextbox/templates/component/style.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.block.svelte-1t38q2d{position:relative;margin:0;box-shadow:var(--block-shadow);border-width:var(--block-border-width);border-color:var(--block-border-color);border-radius:var(--block-radius);background:var(--block-background-fill);width:100%;line-height:var(--line-sm)}.block.border_focus.svelte-1t38q2d{border-color:var(--color-accent)}.padded.svelte-1t38q2d{padding:var(--block-padding)}.hidden.svelte-1t38q2d{display:none}.hide-container.svelte-1t38q2d{margin:0;box-shadow:none;--block-border-width:0;background:transparent;padding:0;overflow:visible}div.svelte-1hnfib2{margin-bottom:var(--spacing-lg);color:var(--block-info-text-color);font-weight:var(--block-info-text-weight);font-size:var(--block-info-text-size);line-height:var(--line-sm)}span.has-info.svelte-22c38v{margin-bottom:var(--spacing-xs)}span.svelte-22c38v:not(.has-info){margin-bottom:var(--spacing-lg)}span.svelte-22c38v{display:inline-block;position:relative;z-index:var(--layer-4);border:solid var(--block-title-border-width) var(--block-title-border-color);border-radius:var(--block-title-radius);background:var(--block-title-background-fill);padding:var(--block-title-padding);color:var(--block-title-text-color);font-weight:var(--block-title-text-weight);font-size:var(--block-title-text-size);line-height:var(--line-sm)}.hide.svelte-22c38v{margin:0;height:0}label.svelte-9gxdi0{display:inline-flex;align-items:center;z-index:var(--layer-2);box-shadow:var(--block-label-shadow);border:var(--block-label-border-width) solid var(--border-color-primary);border-top:none;border-left:none;border-radius:var(--block-label-radius);background:var(--block-label-background-fill);padding:var(--block-label-padding);pointer-events:none;color:var(--block-label-text-color);font-weight:var(--block-label-text-weight);font-size:var(--block-label-text-size);line-height:var(--line-sm)}.gr-group label.svelte-9gxdi0{border-top-left-radius:0}label.float.svelte-9gxdi0{position:absolute;top:var(--block-label-margin);left:var(--block-label-margin)}label.svelte-9gxdi0:not(.float){position:static;margin-top:var(--block-label-margin);margin-left:var(--block-label-margin)}.hide.svelte-9gxdi0{height:0}span.svelte-9gxdi0{opacity:.8;margin-right:var(--size-2);width:calc(var(--block-label-text-size) - 1px);height:calc(var(--block-label-text-size) - 1px)}.hide-label.svelte-9gxdi0{box-shadow:none;border-width:0;background:transparent;overflow:visible}button.svelte-lpi64a{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-2);border-radius:var(--radius-sm);color:var(--block-label-text-color);border:1px solid transparent}button[disabled].svelte-lpi64a{opacity:.5;box-shadow:none}button[disabled].svelte-lpi64a:hover{cursor:not-allowed}.padded.svelte-lpi64a{padding:2px;background:var(--bg-color);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color)}button.svelte-lpi64a:hover,button.highlight.svelte-lpi64a{cursor:pointer;color:var(--color-accent)}.padded.svelte-lpi64a:hover{border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-lpi64a{padding:0 1px;font-size:10px}div.svelte-lpi64a{padding:2px;display:flex;align-items:flex-end}.small.svelte-lpi64a{width:14px;height:14px}.large.svelte-lpi64a{width:22px;height:22px}.pending.svelte-lpi64a{animation:svelte-lpi64a-flash .5s infinite}@keyframes svelte-lpi64a-flash{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.transparent.svelte-lpi64a{background:transparent;border:none;box-shadow:none}.empty.svelte-3w3rth{display:flex;justify-content:center;align-items:center;margin-top:calc(0px - var(--size-6));height:var(--size-full)}.icon.svelte-3w3rth{opacity:.5;height:var(--size-5);color:var(--body-text-color)}.small.svelte-3w3rth{min-height:calc(var(--size-32) - 20px)}.large.svelte-3w3rth{min-height:calc(var(--size-64) - 20px)}.unpadded_box.svelte-3w3rth{margin-top:0}.small_parent.svelte-3w3rth{min-height:100%!important}.dropdown-arrow.svelte-145leq6{fill:currentColor}.wrap.svelte-kzcjhc{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md);height:100%;padding-top:var(--size-3)}.or.svelte-kzcjhc{color:var(--body-text-color-subdued);display:flex}.icon-wrap.svelte-kzcjhc{width:30px;margin-bottom:var(--spacing-lg)}@media (--screen-md){.wrap.svelte-kzcjhc{font-size:var(--text-lg)}}.hovered.svelte-kzcjhc{color:var(--color-accent)}div.svelte-ipfyu7{border-top:1px solid transparent;display:flex;max-height:100%;justify-content:center;gap:var(--spacing-sm);height:auto;align-items:flex-end;padding-bottom:var(--spacing-xl);color:var(--block-label-text-color);flex-shrink:0;width:95%}.show_border.svelte-ipfyu7{border-top:1px solid var(--block-border-color);margin-top:var(--spacing-xxl);box-shadow:var(--shadow-drop)}.source-selection.svelte-1jp3vgd{display:flex;align-items:center;justify-content:center;border-top:1px solid var(--border-color-primary);width:95%;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto}.icon.svelte-1jp3vgd{width:22px;height:22px;margin:var(--spacing-lg) var(--spacing-xs);padding:var(--spacing-xs);color:var(--neutral-400);border-radius:var(--radius-md)}.selected.svelte-1jp3vgd{color:var(--color-accent)}.icon.svelte-1jp3vgd:hover,.icon.svelte-1jp3vgd:focus{color:var(--color-accent)}label.svelte-1t4levu{display:block;width:100%}button.svelte-1t4levu{display:flex;position:absolute;top:var(--block-label-margin);right:var(--block-label-margin);align-items:center;box-shadow:var(--shadow-drop);border:1px solid var(--color-border-primary);border-top:none;border-right:none;border-radius:var(--block-label-right-radius);background:var(--block-label-background-fill);padding:5px;width:22px;height:22px;overflow:hidden;color:var(--block-label-color);font:var(--font-sans);font-size:var(--button-small-text-size)}.container.svelte-1t4levu{display:flex;flex-direction:column;gap:var(--spacing-sm);padding:var(--block-padding)}.category-legend.svelte-1t4levu{display:flex;flex-wrap:wrap;gap:var(--spacing-sm);color:#000;margin-bottom:var(--spacing-sm)}.category-label.svelte-1t4levu{border-radius:var(--radius-xs);padding-right:var(--size-2);padding-left:var(--size-2);font-weight:var(--weight-semibold)}.legend-description.svelte-1t4levu{background-color:transparent;color:var(--block-title-text-color);padding-left:0;border-radius:var(--radius-xs);font-weight:var(--input-text-weight)}.textfield.svelte-1t4levu{box-sizing:border-box;outline:none!important;box-shadow:var(--input-shadow);padding:var(--input-padding);border-radius:var(--radius-md);background:var(--input-background-fill);background-color:transparent;font-weight:var(--input-text-weight);font-size:var(--input-text-size);width:100%;line-height:var(--line-sm);word-break:break-all;border:var(--input-border-width) solid var(--input-border-color);cursor:text}.textfield.svelte-1t4levu:focus{box-shadow:var(--input-shadow-focus);border-color:var(--input-border-color-focus)}mark{border-radius:3px}svg.svelte-43sxxs.svelte-43sxxs{width:var(--size-20);height:var(--size-20)}svg.svelte-43sxxs path.svelte-43sxxs{fill:var(--loader-color)}div.svelte-43sxxs.svelte-43sxxs{z-index:var(--layer-2)}.margin.svelte-43sxxs.svelte-43sxxs{margin:var(--size-4)}.wrap.svelte-1txqlrd.svelte-1txqlrd{display:flex;flex-direction:column;justify-content:center;align-items:center;z-index:var(--layer-top);transition:opacity .1s ease-in-out;border-radius:var(--block-radius);background:var(--block-background-fill);padding:0 var(--size-6);max-height:var(--size-screen-h);overflow:hidden;pointer-events:none}.wrap.center.svelte-1txqlrd.svelte-1txqlrd{top:0;right:0;left:0}.wrap.default.svelte-1txqlrd.svelte-1txqlrd{top:0;right:0;bottom:0;left:0}.hide.svelte-1txqlrd.svelte-1txqlrd{opacity:0;pointer-events:none}.generating.svelte-1txqlrd.svelte-1txqlrd{animation:svelte-1txqlrd-pulse 2s cubic-bezier(.4,0,.6,1) infinite;border:2px solid var(--color-accent);background:transparent}.translucent.svelte-1txqlrd.svelte-1txqlrd{background:none}@keyframes svelte-1txqlrd-pulse{0%,to{opacity:1}50%{opacity:.5}}.loading.svelte-1txqlrd.svelte-1txqlrd{z-index:var(--layer-2);color:var(--body-text-color)}.eta-bar.svelte-1txqlrd.svelte-1txqlrd{position:absolute;top:0;right:0;bottom:0;left:0;transform-origin:left;opacity:.8;z-index:var(--layer-1);transition:10ms;background:var(--background-fill-secondary)}.progress-bar-wrap.svelte-1txqlrd.svelte-1txqlrd{border:1px solid var(--border-color-primary);background:var(--background-fill-primary);width:55.5%;height:var(--size-4)}.progress-bar.svelte-1txqlrd.svelte-1txqlrd{transform-origin:left;background-color:var(--loader-color);width:var(--size-full);height:var(--size-full)}.progress-level.svelte-1txqlrd.svelte-1txqlrd{display:flex;flex-direction:column;align-items:center;gap:1;z-index:var(--layer-2);width:var(--size-full)}.progress-level-inner.svelte-1txqlrd.svelte-1txqlrd{margin:var(--size-2) auto;color:var(--body-text-color);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text.svelte-1txqlrd.svelte-1txqlrd{position:absolute;top:0;right:0;z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text-center.svelte-1txqlrd.svelte-1txqlrd{display:flex;position:absolute;top:0;right:0;justify-content:center;align-items:center;transform:translateY(var(--size-6));z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono);text-align:center}.error.svelte-1txqlrd.svelte-1txqlrd{box-shadow:var(--shadow-drop);border:solid 1px var(--error-border-color);border-radius:var(--radius-full);background:var(--error-background-fill);padding-right:var(--size-4);padding-left:var(--size-4);color:var(--error-text-color);font-weight:var(--weight-semibold);font-size:var(--text-lg);line-height:var(--line-lg);font-family:var(--font)}.minimal.svelte-1txqlrd .progress-text.svelte-1txqlrd{background:var(--block-background-fill)}.border.svelte-1txqlrd.svelte-1txqlrd{border:1px solid var(--border-color-primary)}.toast-body.svelte-solcu7{display:flex;position:relative;right:0;left:0;align-items:center;margin:var(--size-6) var(--size-4);margin:auto;border-radius:var(--container-radius);overflow:hidden;pointer-events:auto}.toast-body.error.svelte-solcu7{border:1px solid var(--color-red-700);background:var(--color-red-50)}.dark .toast-body.error.svelte-solcu7{border:1px solid var(--color-red-500);background-color:var(--color-grey-950)}.toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-700);background:var(--color-yellow-50)}.dark .toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-500);background-color:var(--color-grey-950)}.toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-700);background:var(--color-grey-50)}.dark .toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-500);background-color:var(--color-grey-950)}.toast-title.svelte-solcu7{display:flex;align-items:center;font-weight:var(--weight-bold);font-size:var(--text-lg);line-height:var(--line-sm);text-transform:capitalize}.toast-title.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-title.error.svelte-solcu7{color:var(--color-red-50)}.toast-title.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-title.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-title.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-title.info.svelte-solcu7{color:var(--color-grey-50)}.toast-close.svelte-solcu7{margin:0 var(--size-3);border-radius:var(--size-3);padding:0px var(--size-1-5);font-size:var(--size-5);line-height:var(--size-5)}.toast-close.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-close.error.svelte-solcu7{color:var(--color-red-500)}.toast-close.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-close.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-close.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-close.info.svelte-solcu7{color:var(--color-grey-500)}.toast-text.svelte-solcu7{font-size:var(--text-lg)}.toast-text.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-text.error.svelte-solcu7{color:var(--color-red-50)}.toast-text.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-text.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-text.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-text.info.svelte-solcu7{color:var(--color-grey-50)}.toast-details.svelte-solcu7{margin:var(--size-3) var(--size-3) var(--size-3) 0;width:100%}.toast-icon.svelte-solcu7{display:flex;position:absolute;position:relative;flex-shrink:0;justify-content:center;align-items:center;margin:var(--size-2);border-radius:var(--radius-full);padding:var(--size-1);padding-left:calc(var(--size-1) - 1px);width:35px;height:35px}.toast-icon.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-icon.error.svelte-solcu7{color:var(--color-red-500)}.toast-icon.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-icon.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-icon.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-icon.info.svelte-solcu7{color:var(--color-grey-500)}@keyframes svelte-solcu7-countdown{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.timer.svelte-solcu7{position:absolute;bottom:0;left:0;transform-origin:0 0;animation:svelte-solcu7-countdown 10s linear forwards;width:100%;height:var(--size-1)}.timer.error.svelte-solcu7{background:var(--color-red-700)}.dark .timer.error.svelte-solcu7{background:var(--color-red-500)}.timer.warning.svelte-solcu7{background:var(--color-yellow-700)}.dark .timer.warning.svelte-solcu7{background:var(--color-yellow-500)}.timer.info.svelte-solcu7{background:var(--color-grey-700)}.dark .timer.info.svelte-solcu7{background:var(--color-grey-500)}.toast-wrap.svelte-gatr8h{display:flex;position:fixed;top:var(--size-4);right:var(--size-4);flex-direction:column;align-items:end;gap:var(--size-2);z-index:var(--layer-top);width:calc(100% - var(--size-8))}@media (--screen-sm){.toast-wrap.svelte-gatr8h{width:calc(var(--size-96) + var(--size-10))}}
|
src/backend/gradio_highlightedtextbox/templates/example/index.js
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const {
|
2 |
+
SvelteComponent: y,
|
3 |
+
add_iframe_resize_listener: b,
|
4 |
+
add_render_callback: v,
|
5 |
+
append: m,
|
6 |
+
attr: h,
|
7 |
+
binding_callbacks: p,
|
8 |
+
detach: w,
|
9 |
+
element: z,
|
10 |
+
init: k,
|
11 |
+
insert: E,
|
12 |
+
noop: f,
|
13 |
+
safe_not_equal: S,
|
14 |
+
set_data: q,
|
15 |
+
text: C,
|
16 |
+
toggle_class: _
|
17 |
+
} = window.__gradio__svelte__internal, { onMount: M } = window.__gradio__svelte__internal;
|
18 |
+
function P(t) {
|
19 |
+
let e, s, r;
|
20 |
+
return {
|
21 |
+
c() {
|
22 |
+
e = z("div"), s = C(
|
23 |
+
/*value*/
|
24 |
+
t[0]
|
25 |
+
), h(e, "class", "svelte-84cxb8"), v(() => (
|
26 |
+
/*div_elementresize_handler*/
|
27 |
+
t[5].call(e)
|
28 |
+
)), _(
|
29 |
+
e,
|
30 |
+
"table",
|
31 |
+
/*type*/
|
32 |
+
t[1] === "table"
|
33 |
+
), _(
|
34 |
+
e,
|
35 |
+
"gallery",
|
36 |
+
/*type*/
|
37 |
+
t[1] === "gallery"
|
38 |
+
), _(
|
39 |
+
e,
|
40 |
+
"selected",
|
41 |
+
/*selected*/
|
42 |
+
t[2]
|
43 |
+
);
|
44 |
+
},
|
45 |
+
m(l, i) {
|
46 |
+
E(l, e, i), m(e, s), r = b(
|
47 |
+
e,
|
48 |
+
/*div_elementresize_handler*/
|
49 |
+
t[5].bind(e)
|
50 |
+
), t[6](e);
|
51 |
+
},
|
52 |
+
p(l, [i]) {
|
53 |
+
i & /*value*/
|
54 |
+
1 && q(
|
55 |
+
s,
|
56 |
+
/*value*/
|
57 |
+
l[0]
|
58 |
+
), i & /*type*/
|
59 |
+
2 && _(
|
60 |
+
e,
|
61 |
+
"table",
|
62 |
+
/*type*/
|
63 |
+
l[1] === "table"
|
64 |
+
), i & /*type*/
|
65 |
+
2 && _(
|
66 |
+
e,
|
67 |
+
"gallery",
|
68 |
+
/*type*/
|
69 |
+
l[1] === "gallery"
|
70 |
+
), i & /*selected*/
|
71 |
+
4 && _(
|
72 |
+
e,
|
73 |
+
"selected",
|
74 |
+
/*selected*/
|
75 |
+
l[2]
|
76 |
+
);
|
77 |
+
},
|
78 |
+
i: f,
|
79 |
+
o: f,
|
80 |
+
d(l) {
|
81 |
+
l && w(e), r(), t[6](null);
|
82 |
+
}
|
83 |
+
};
|
84 |
+
}
|
85 |
+
function W(t, e, s) {
|
86 |
+
let { value: r } = e, { type: l } = e, { selected: i = !1 } = e, c, a;
|
87 |
+
function u(n, d) {
|
88 |
+
!n || !d || (a.style.setProperty("--local-text-width", `${d < 150 ? d : 200}px`), s(4, a.style.whiteSpace = "unset", a));
|
89 |
+
}
|
90 |
+
M(() => {
|
91 |
+
u(a, c);
|
92 |
+
});
|
93 |
+
function o() {
|
94 |
+
c = this.clientWidth, s(3, c);
|
95 |
+
}
|
96 |
+
function g(n) {
|
97 |
+
p[n ? "unshift" : "push"](() => {
|
98 |
+
a = n, s(4, a);
|
99 |
+
});
|
100 |
+
}
|
101 |
+
return t.$$set = (n) => {
|
102 |
+
"value" in n && s(0, r = n.value), "type" in n && s(1, l = n.type), "selected" in n && s(2, i = n.selected);
|
103 |
+
}, [r, l, i, c, a, o, g];
|
104 |
+
}
|
105 |
+
class j extends y {
|
106 |
+
constructor(e) {
|
107 |
+
super(), k(this, e, W, P, S, { value: 0, type: 1, selected: 2 });
|
108 |
+
}
|
109 |
+
}
|
110 |
+
export {
|
111 |
+
j as default
|
112 |
+
};
|
src/backend/gradio_highlightedtextbox/templates/example/style.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.gallery.svelte-84cxb8{padding:var(--size-1) var(--size-2)}div.svelte-84cxb8{overflow:hidden;min-width:var(--local-text-width);white-space:nowrap}
|
src/demo/__init__.py
ADDED
File without changes
|
src/demo/app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from gradio_highlightedtextbox import HighlightedTextbox
|
3 |
+
|
4 |
+
def set_highlighted():
|
5 |
+
return HighlightedTextbox(
|
6 |
+
value=[("Non è qualcosa di cui vergognarsi: non è diverso dalle paure e", None), ("odie", "Potential issue"), ("personali", None), ("di altre cose", "Potential issue"), ("che", None), ("molta gente ha", "Potential issue"), (".", None)],
|
7 |
+
interactive=True, label="Output", show_legend=True, show_label=False, legend_label="Test:", show_legend_label=True
|
8 |
+
)
|
9 |
+
|
10 |
+
with gr.Blocks() as demo:
|
11 |
+
with gr.Row():
|
12 |
+
gr.Textbox(" It is not something to be ashamed of: it is no different from the personal fears and dislikes of other things that very many people have.", interactive=False)
|
13 |
+
high = HighlightedTextbox(
|
14 |
+
interactive=True, label="Input", show_legend=True, show_label=False, legend_label="Legend:", show_legend_label=True
|
15 |
+
)
|
16 |
+
button = gr.Button("Submit")
|
17 |
+
button.click(fn=set_highlighted, inputs=[], outputs=high)
|
18 |
+
|
19 |
+
|
20 |
+
demo.launch()
|
src/frontend/Example.svelte
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
import { onMount } from "svelte";
|
3 |
+
|
4 |
+
export let value: string;
|
5 |
+
export let type: "gallery" | "table";
|
6 |
+
export let selected = false;
|
7 |
+
|
8 |
+
let size: number;
|
9 |
+
let el: HTMLDivElement;
|
10 |
+
|
11 |
+
function set_styles(element: HTMLElement, el_width: number): void {
|
12 |
+
if (!element || !el_width) return;
|
13 |
+
el.style.setProperty(
|
14 |
+
"--local-text-width",
|
15 |
+
`${el_width < 150 ? el_width : 200}px`
|
16 |
+
);
|
17 |
+
el.style.whiteSpace = "unset";
|
18 |
+
}
|
19 |
+
|
20 |
+
onMount(() => {
|
21 |
+
set_styles(el, size);
|
22 |
+
});
|
23 |
+
</script>
|
24 |
+
|
25 |
+
<div
|
26 |
+
bind:clientWidth={size}
|
27 |
+
bind:this={el}
|
28 |
+
class:table={type === "table"}
|
29 |
+
class:gallery={type === "gallery"}
|
30 |
+
class:selected
|
31 |
+
>
|
32 |
+
{value}
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<style>
|
36 |
+
.gallery {
|
37 |
+
padding: var(--size-1) var(--size-2);
|
38 |
+
}
|
39 |
+
|
40 |
+
div {
|
41 |
+
overflow: hidden;
|
42 |
+
min-width: var(--local-text-width);
|
43 |
+
|
44 |
+
white-space: nowrap;
|
45 |
+
}
|
46 |
+
</style>
|
src/frontend/HighlightedTextbox.svelte
ADDED
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
import {
|
3 |
+
beforeUpdate,
|
4 |
+
afterUpdate,
|
5 |
+
createEventDispatcher,
|
6 |
+
tick,
|
7 |
+
} from "svelte";
|
8 |
+
import { BlockTitle } from "@gradio/atoms";
|
9 |
+
import { Copy, Check } from "@gradio/icons";
|
10 |
+
import { fade } from "svelte/transition";
|
11 |
+
import type { SelectData } from "@gradio/utils";
|
12 |
+
import { get_next_color } from "@gradio/utils";
|
13 |
+
import { correct_color_map } from "./utils";
|
14 |
+
|
15 |
+
const browser = typeof document !== "undefined";
|
16 |
+
export let value: [string, string | null][] = [];
|
17 |
+
export let value_is_output: boolean = false;
|
18 |
+
export let label: string;
|
19 |
+
export let legend_label: string;
|
20 |
+
export let info: string | undefined = undefined;
|
21 |
+
export let show_label = true;
|
22 |
+
export let show_legend = false;
|
23 |
+
export let show_legend_label = false;
|
24 |
+
export let container = true;
|
25 |
+
export let color_map: Record<string, string> = {};
|
26 |
+
export let show_copy_button = false;
|
27 |
+
export let disabled: boolean;
|
28 |
+
|
29 |
+
let el: HTMLDivElement;
|
30 |
+
let el_text: string = "";
|
31 |
+
let marked_el_text: string = "";
|
32 |
+
let ctx: CanvasRenderingContext2D;
|
33 |
+
let current_color_map: Record<string, string> = {};
|
34 |
+
let _color_map: Record<string, { primary: string; secondary: string }> = {};
|
35 |
+
let copied = false;
|
36 |
+
let timer: ReturnType<typeof setTimeout>;
|
37 |
+
let can_scroll: boolean;
|
38 |
+
|
39 |
+
function set_color_map(): void {
|
40 |
+
if (!color_map || Object.keys(color_map).length === 0) {
|
41 |
+
current_color_map = {};
|
42 |
+
}
|
43 |
+
else {
|
44 |
+
current_color_map = color_map;
|
45 |
+
}
|
46 |
+
if (value.length > 0) {
|
47 |
+
for (let [_, label] of value) {
|
48 |
+
if (label !== null && !(label in current_color_map)) {
|
49 |
+
let color = get_next_color(Object.keys(current_color_map).length);
|
50 |
+
current_color_map[label] = color;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
54 |
+
_color_map = correct_color_map(current_color_map, browser, ctx);
|
55 |
+
}
|
56 |
+
|
57 |
+
function set_text_from_value(): void {
|
58 |
+
if (value.length > 0 && value_is_output) {
|
59 |
+
el_text = value.map(([text, _]) => text).join(" ");
|
60 |
+
marked_el_text = value.map(([text, category]) => {
|
61 |
+
if (category !== null) {
|
62 |
+
return `<mark class="hl ${category}" style="background-color:${_color_map[category].secondary}">${text}</mark>`;
|
63 |
+
} else {
|
64 |
+
return text;
|
65 |
+
}
|
66 |
+
}).join(" ") + " ";
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
$: set_text_from_value();
|
71 |
+
$: set_color_map();
|
72 |
+
|
73 |
+
const dispatch = createEventDispatcher<{
|
74 |
+
change: string;
|
75 |
+
submit: undefined;
|
76 |
+
blur: undefined;
|
77 |
+
select: SelectData;
|
78 |
+
input: undefined;
|
79 |
+
focus: undefined;
|
80 |
+
}>();
|
81 |
+
|
82 |
+
beforeUpdate(() => {
|
83 |
+
can_scroll = el && el.offsetHeight + el.scrollTop > el.scrollHeight - 100;
|
84 |
+
});
|
85 |
+
|
86 |
+
function handle_change(): void {
|
87 |
+
dispatch("change", marked_el_text);
|
88 |
+
if (!value_is_output) {
|
89 |
+
dispatch("input");
|
90 |
+
}
|
91 |
+
}
|
92 |
+
afterUpdate(() => {
|
93 |
+
set_color_map();
|
94 |
+
set_text_from_value();
|
95 |
+
value_is_output = false;
|
96 |
+
});
|
97 |
+
$: marked_el_text, handle_change();
|
98 |
+
|
99 |
+
// Given a string like Hello <mark class="hl red" style="background-color:#fee2e2">world!</mark> This is cool.
|
100 |
+
// for marked_el_text and its previous parsed version (value) like [["Hello ", null], ["world!", "red"], [" This is ", null], ["nice", "blue"]],
|
101 |
+
// update value such that it matches marked_el_text (i.e. [["Hello ", null], ["world!", "red"], [" This is cool.", null]])
|
102 |
+
function handle_blur(): void {
|
103 |
+
let new_value: [string, string | null][] = [];
|
104 |
+
let text = "";
|
105 |
+
let category = null;
|
106 |
+
let in_tag = false;
|
107 |
+
let tag = "";
|
108 |
+
for (let i = 0; i < marked_el_text.length; i++) {
|
109 |
+
let char = marked_el_text[i];
|
110 |
+
if (char === "<") {
|
111 |
+
in_tag = true;
|
112 |
+
if (text) {
|
113 |
+
new_value.push([text, category]);
|
114 |
+
}
|
115 |
+
text = "";
|
116 |
+
category = null;
|
117 |
+
} else if (char === ">") {
|
118 |
+
in_tag = false;
|
119 |
+
if (tag.startsWith("mark")) {
|
120 |
+
category = tag.match(/class="hl ([^"]+)"/)?.[1] || null;
|
121 |
+
}
|
122 |
+
tag = "";
|
123 |
+
} else if (in_tag) {
|
124 |
+
tag += char;
|
125 |
+
} else {
|
126 |
+
text += char;
|
127 |
+
}
|
128 |
+
}
|
129 |
+
if (text) {
|
130 |
+
new_value.push([text, category]);
|
131 |
+
}
|
132 |
+
value = new_value;
|
133 |
+
}
|
134 |
+
|
135 |
+
async function handle_copy(): Promise<void> {
|
136 |
+
if ("clipboard" in navigator) {
|
137 |
+
await navigator.clipboard.writeText(el_text);
|
138 |
+
copy_feedback();
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
function copy_feedback(): void {
|
143 |
+
copied = true;
|
144 |
+
if (timer) clearTimeout(timer);
|
145 |
+
timer = setTimeout(() => {
|
146 |
+
copied = false;
|
147 |
+
}, 1000);
|
148 |
+
}
|
149 |
+
</script>
|
150 |
+
|
151 |
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
152 |
+
<!-- svelte-ignore a11y-click-events-have-key-events-->
|
153 |
+
<label class:container>
|
154 |
+
{#if show_legend}
|
155 |
+
<div
|
156 |
+
class="category-legend"
|
157 |
+
data-testid="highlighted-text:category-legend"
|
158 |
+
>
|
159 |
+
{#if show_legend_label}
|
160 |
+
<div class="legend-description">{legend_label}</div>
|
161 |
+
{/if}
|
162 |
+
{#each Object.entries(_color_map) as [category, color], i}
|
163 |
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
164 |
+
<div class="category-label" style={"background-color:" + color.secondary}>
|
165 |
+
{category}
|
166 |
+
</div>
|
167 |
+
{/each}
|
168 |
+
</div>
|
169 |
+
{/if}
|
170 |
+
<BlockTitle {show_label} {info}>{label}</BlockTitle>
|
171 |
+
{#if show_copy_button}
|
172 |
+
{#if copied}
|
173 |
+
<button
|
174 |
+
in:fade={{ duration: 300 }}
|
175 |
+
aria-label="Copied"
|
176 |
+
aria-roledescription="Text copied"><Check /></button
|
177 |
+
>
|
178 |
+
{:else}
|
179 |
+
<button
|
180 |
+
on:click={handle_copy}
|
181 |
+
aria-label="Copy"
|
182 |
+
aria-roledescription="Copy text"><Copy /></button
|
183 |
+
>
|
184 |
+
{/if}
|
185 |
+
{/if}
|
186 |
+
|
187 |
+
{#if disabled}
|
188 |
+
<div
|
189 |
+
class="textfield"
|
190 |
+
data-testid="highlighted-textbox"
|
191 |
+
contenteditable="false"
|
192 |
+
bind:this={el}
|
193 |
+
bind:textContent={el_text}
|
194 |
+
bind:innerHTML={marked_el_text}
|
195 |
+
/>
|
196 |
+
{:else}
|
197 |
+
<div
|
198 |
+
class="textfield"
|
199 |
+
data-testid="highlighted-textbox"
|
200 |
+
contenteditable="true"
|
201 |
+
bind:this={el}
|
202 |
+
bind:textContent={el_text}
|
203 |
+
bind:innerHTML={marked_el_text}
|
204 |
+
on:blur={handle_blur}
|
205 |
+
on:keypress
|
206 |
+
on:select
|
207 |
+
on:scroll
|
208 |
+
on:input
|
209 |
+
on:focus
|
210 |
+
on:change
|
211 |
+
/>
|
212 |
+
{/if}
|
213 |
+
</label>
|
214 |
+
|
215 |
+
<style>
|
216 |
+
label {
|
217 |
+
display: block;
|
218 |
+
width: 100%;
|
219 |
+
}
|
220 |
+
|
221 |
+
button {
|
222 |
+
display: flex;
|
223 |
+
position: absolute;
|
224 |
+
top: var(--block-label-margin);
|
225 |
+
right: var(--block-label-margin);
|
226 |
+
align-items: center;
|
227 |
+
box-shadow: var(--shadow-drop);
|
228 |
+
border: 1px solid var(--color-border-primary);
|
229 |
+
border-top: none;
|
230 |
+
border-right: none;
|
231 |
+
border-radius: var(--block-label-right-radius);
|
232 |
+
background: var(--block-label-background-fill);
|
233 |
+
padding: 5px;
|
234 |
+
width: 22px;
|
235 |
+
height: 22px;
|
236 |
+
overflow: hidden;
|
237 |
+
color: var(--block-label-color);
|
238 |
+
font: var(--font-sans);
|
239 |
+
font-size: var(--button-small-text-size);
|
240 |
+
}
|
241 |
+
.container {
|
242 |
+
display: flex;
|
243 |
+
flex-direction: column;
|
244 |
+
gap: var(--spacing-sm);
|
245 |
+
padding: var(--block-padding);
|
246 |
+
}
|
247 |
+
|
248 |
+
.category-legend {
|
249 |
+
display: flex;
|
250 |
+
flex-wrap: wrap;
|
251 |
+
gap: var(--spacing-sm);
|
252 |
+
color: black;
|
253 |
+
margin-bottom: var(--spacing-sm)
|
254 |
+
}
|
255 |
+
|
256 |
+
.category-label {
|
257 |
+
border-radius: var(--radius-xs);
|
258 |
+
padding-right: var(--size-2);
|
259 |
+
padding-left: var(--size-2);
|
260 |
+
font-weight: var(--weight-semibold);
|
261 |
+
}
|
262 |
+
|
263 |
+
.legend-description {
|
264 |
+
background-color: transparent;
|
265 |
+
color: var(--block-title-text-color);
|
266 |
+
padding-left: 0px;
|
267 |
+
border-radius: var(--radius-xs);
|
268 |
+
font-weight: var(--input-text-weight);
|
269 |
+
}
|
270 |
+
|
271 |
+
.textfield {
|
272 |
+
box-sizing: border-box;
|
273 |
+
outline: none !important;
|
274 |
+
box-shadow: var(--input-shadow);
|
275 |
+
padding: var(--input-padding);
|
276 |
+
border-radius: var(--radius-md);
|
277 |
+
background: var(--input-background-fill);
|
278 |
+
background-color: transparent;
|
279 |
+
font-weight: var(--input-text-weight);
|
280 |
+
font-size: var(--input-text-size);
|
281 |
+
width: 100%;
|
282 |
+
line-height: var(--line-sm);
|
283 |
+
word-break: break-all;
|
284 |
+
border: var(--input-border-width) solid var(--input-border-color);
|
285 |
+
cursor: text;
|
286 |
+
}
|
287 |
+
|
288 |
+
.textfield:focus {
|
289 |
+
box-shadow: var(--input-shadow-focus);
|
290 |
+
border-color: var(--input-border-color-focus);
|
291 |
+
}
|
292 |
+
|
293 |
+
:global(mark) {
|
294 |
+
border-radius: 3px;
|
295 |
+
}
|
296 |
+
</style>
|
src/frontend/Index.svelte
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<svelte:options accessors={true} />
|
2 |
+
|
3 |
+
<script lang="ts">
|
4 |
+
import type { Gradio, SelectData } from "@gradio/utils";
|
5 |
+
import HighlightedTextbox from "./HighlightedTextbox.svelte";
|
6 |
+
import { Block } from "@gradio/atoms";
|
7 |
+
import { StatusTracker } from "@gradio/statustracker";
|
8 |
+
import type { LoadingStatus } from "@gradio/statustracker";
|
9 |
+
import { merge_elements } from "./utils";
|
10 |
+
|
11 |
+
export let gradio: Gradio<{
|
12 |
+
change: never;
|
13 |
+
input: never;
|
14 |
+
submit: never;
|
15 |
+
select: SelectData;
|
16 |
+
focus: never;
|
17 |
+
blur: never;
|
18 |
+
}>;
|
19 |
+
|
20 |
+
export let label = "Highlighted Textbox";
|
21 |
+
export let legend_label: string | undefined = "Highlights:";
|
22 |
+
export let info: string | undefined = undefined;
|
23 |
+
export let elem_id = "";
|
24 |
+
export let elem_classes: string[] = [];
|
25 |
+
export let visible = true;
|
26 |
+
export let value: [string, string | null][];
|
27 |
+
export let show_label: boolean;
|
28 |
+
export let show_legend: boolean;
|
29 |
+
export let show_legend_label: boolean;
|
30 |
+
export let color_map: Record<string, string> = {};
|
31 |
+
export let container: boolean = true;
|
32 |
+
export let scale: number | null = null;
|
33 |
+
export let min_width: number | undefined = undefined;
|
34 |
+
export let show_copy_button: boolean = false;
|
35 |
+
export let loading_status: LoadingStatus | undefined = undefined;
|
36 |
+
export let value_is_output: boolean = false;
|
37 |
+
export let combine_adjacent: boolean = false;
|
38 |
+
export let interactive: boolean = true;
|
39 |
+
export const autofocus: boolean = false;
|
40 |
+
export const autoscroll: boolean = true;
|
41 |
+
|
42 |
+
$: if (!color_map && Object.keys(color_map).length) {
|
43 |
+
color_map = color_map;
|
44 |
+
}
|
45 |
+
|
46 |
+
$: if (value && combine_adjacent) {
|
47 |
+
value = merge_elements(value, "equal");
|
48 |
+
}
|
49 |
+
</script>
|
50 |
+
|
51 |
+
<Block
|
52 |
+
{visible}
|
53 |
+
{elem_id}
|
54 |
+
{elem_classes}
|
55 |
+
{scale}
|
56 |
+
{min_width}
|
57 |
+
allow_overflow={false}
|
58 |
+
padding={container}
|
59 |
+
>
|
60 |
+
{#if loading_status}
|
61 |
+
<StatusTracker
|
62 |
+
autoscroll={gradio.autoscroll}
|
63 |
+
i18n={gradio.i18n}
|
64 |
+
{...loading_status}
|
65 |
+
/>
|
66 |
+
{/if}
|
67 |
+
|
68 |
+
<HighlightedTextbox
|
69 |
+
bind:value
|
70 |
+
bind:value_is_output
|
71 |
+
{label}
|
72 |
+
{info}
|
73 |
+
{show_label}
|
74 |
+
{show_legend}
|
75 |
+
{show_legend_label}
|
76 |
+
{legend_label}
|
77 |
+
{color_map}
|
78 |
+
{show_copy_button}
|
79 |
+
{container}
|
80 |
+
disabled={!interactive}
|
81 |
+
on:change={() => gradio.dispatch("change")}
|
82 |
+
on:input={() => gradio.dispatch("input")}
|
83 |
+
on:submit={() => gradio.dispatch("submit")}
|
84 |
+
on:blur={() => gradio.dispatch("blur")}
|
85 |
+
on:select={(e) => gradio.dispatch("select", e.detail)}
|
86 |
+
on:focus={() => gradio.dispatch("focus")}
|
87 |
+
/>
|
88 |
+
</Block>
|
src/frontend/package-lock.json
ADDED
@@ -0,0 +1,934 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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"version": "0.1.6",
|
10 |
+
"license": "ISC",
|
11 |
+
"dependencies": {
|
12 |
+
"@gradio/atoms": "0.4.1",
|
13 |
+
"@gradio/icons": "0.3.2",
|
14 |
+
"@gradio/statustracker": "0.4.3",
|
15 |
+
"@gradio/utils": "0.2.0"
|
16 |
+
}
|
17 |
+
},
|
18 |
+
"node_modules/@ampproject/remapping": {
|
19 |
+
"version": "2.2.1",
|
20 |
+
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
|
21 |
+
"integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==",
|
22 |
+
"peer": true,
|
23 |
+
"dependencies": {
|
24 |
+
"@jridgewell/gen-mapping": "^0.3.0",
|
25 |
+
"@jridgewell/trace-mapping": "^0.3.9"
|
26 |
+
},
|
27 |
+
"engines": {
|
28 |
+
"node": ">=6.0.0"
|
29 |
+
}
|
30 |
+
},
|
31 |
+
"node_modules/@esbuild/aix-ppc64": {
|
32 |
+
"version": "0.19.11",
|
33 |
+
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz",
|
34 |
+
"integrity": "sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g==",
|
35 |
+
"cpu": [
|
36 |
+
"ppc64"
|
37 |
+
],
|
38 |
+
"optional": true,
|
39 |
+
"os": [
|
40 |
+
"aix"
|
41 |
+
],
|
42 |
+
"engines": {
|
43 |
+
"node": ">=12"
|
44 |
+
}
|
45 |
+
},
|
46 |
+
"node_modules/@esbuild/android-arm": {
|
47 |
+
"version": "0.19.11",
|
48 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.11.tgz",
|
49 |
+
"integrity": "sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw==",
|
50 |
+
"cpu": [
|
51 |
+
"arm"
|
52 |
+
],
|
53 |
+
"optional": true,
|
54 |
+
"os": [
|
55 |
+
"android"
|
56 |
+
],
|
57 |
+
"engines": {
|
58 |
+
"node": ">=12"
|
59 |
+
}
|
60 |
+
},
|
61 |
+
"node_modules/@esbuild/android-arm64": {
|
62 |
+
"version": "0.19.11",
|
63 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.11.tgz",
|
64 |
+
"integrity": "sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q==",
|
65 |
+
"cpu": [
|
66 |
+
"arm64"
|
67 |
+
],
|
68 |
+
"optional": true,
|
69 |
+
"os": [
|
70 |
+
"android"
|
71 |
+
],
|
72 |
+
"engines": {
|
73 |
+
"node": ">=12"
|
74 |
+
}
|
75 |
+
},
|
76 |
+
"node_modules/@esbuild/android-x64": {
|
77 |
+
"version": "0.19.11",
|
78 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.11.tgz",
|
79 |
+
"integrity": "sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg==",
|
80 |
+
"cpu": [
|
81 |
+
"x64"
|
82 |
+
],
|
83 |
+
"optional": true,
|
84 |
+
"os": [
|
85 |
+
"android"
|
86 |
+
],
|
87 |
+
"engines": {
|
88 |
+
"node": ">=12"
|
89 |
+
}
|
90 |
+
},
|
91 |
+
"node_modules/@esbuild/darwin-arm64": {
|
92 |
+
"version": "0.19.11",
|
93 |
+
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.11.tgz",
|
94 |
+
"integrity": "sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ==",
|
95 |
+
"cpu": [
|
96 |
+
"arm64"
|
97 |
+
],
|
98 |
+
"optional": true,
|
99 |
+
"os": [
|
100 |
+
"darwin"
|
101 |
+
],
|
102 |
+
"engines": {
|
103 |
+
"node": ">=12"
|
104 |
+
}
|
105 |
+
},
|
106 |
+
"node_modules/@esbuild/darwin-x64": {
|
107 |
+
"version": "0.19.11",
|
108 |
+
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.11.tgz",
|
109 |
+
"integrity": "sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g==",
|
110 |
+
"cpu": [
|
111 |
+
"x64"
|
112 |
+
],
|
113 |
+
"optional": true,
|
114 |
+
"os": [
|
115 |
+
"darwin"
|
116 |
+
],
|
117 |
+
"engines": {
|
118 |
+
"node": ">=12"
|
119 |
+
}
|
120 |
+
},
|
121 |
+
"node_modules/@esbuild/freebsd-arm64": {
|
122 |
+
"version": "0.19.11",
|
123 |
+
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.11.tgz",
|
124 |
+
"integrity": "sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA==",
|
125 |
+
"cpu": [
|
126 |
+
"arm64"
|
127 |
+
],
|
128 |
+
"optional": true,
|
129 |
+
"os": [
|
130 |
+
"freebsd"
|
131 |
+
],
|
132 |
+
"engines": {
|
133 |
+
"node": ">=12"
|
134 |
+
}
|
135 |
+
},
|
136 |
+
"node_modules/@esbuild/freebsd-x64": {
|
137 |
+
"version": "0.19.11",
|
138 |
+
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.11.tgz",
|
139 |
+
"integrity": "sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw==",
|
140 |
+
"cpu": [
|
141 |
+
"x64"
|
142 |
+
],
|
143 |
+
"optional": true,
|
144 |
+
"os": [
|
145 |
+
"freebsd"
|
146 |
+
],
|
147 |
+
"engines": {
|
148 |
+
"node": ">=12"
|
149 |
+
}
|
150 |
+
},
|
151 |
+
"node_modules/@esbuild/linux-arm": {
|
152 |
+
"version": "0.19.11",
|
153 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.11.tgz",
|
154 |
+
"integrity": "sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q==",
|
155 |
+
"cpu": [
|
156 |
+
"arm"
|
157 |
+
],
|
158 |
+
"optional": true,
|
159 |
+
"os": [
|
160 |
+
"linux"
|
161 |
+
],
|
162 |
+
"engines": {
|
163 |
+
"node": ">=12"
|
164 |
+
}
|
165 |
+
},
|
166 |
+
"node_modules/@esbuild/linux-arm64": {
|
167 |
+
"version": "0.19.11",
|
168 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.11.tgz",
|
169 |
+
"integrity": "sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg==",
|
170 |
+
"cpu": [
|
171 |
+
"arm64"
|
172 |
+
],
|
173 |
+
"optional": true,
|
174 |
+
"os": [
|
175 |
+
"linux"
|
176 |
+
],
|
177 |
+
"engines": {
|
178 |
+
"node": ">=12"
|
179 |
+
}
|
180 |
+
},
|
181 |
+
"node_modules/@esbuild/linux-ia32": {
|
182 |
+
"version": "0.19.11",
|
183 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.11.tgz",
|
184 |
+
"integrity": "sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA==",
|
185 |
+
"cpu": [
|
186 |
+
"ia32"
|
187 |
+
],
|
188 |
+
"optional": true,
|
189 |
+
"os": [
|
190 |
+
"linux"
|
191 |
+
],
|
192 |
+
"engines": {
|
193 |
+
"node": ">=12"
|
194 |
+
}
|
195 |
+
},
|
196 |
+
"node_modules/@esbuild/linux-loong64": {
|
197 |
+
"version": "0.19.11",
|
198 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.11.tgz",
|
199 |
+
"integrity": "sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg==",
|
200 |
+
"cpu": [
|
201 |
+
"loong64"
|
202 |
+
],
|
203 |
+
"optional": true,
|
204 |
+
"os": [
|
205 |
+
"linux"
|
206 |
+
],
|
207 |
+
"engines": {
|
208 |
+
"node": ">=12"
|
209 |
+
}
|
210 |
+
},
|
211 |
+
"node_modules/@esbuild/linux-mips64el": {
|
212 |
+
"version": "0.19.11",
|
213 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.11.tgz",
|
214 |
+
"integrity": "sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg==",
|
215 |
+
"cpu": [
|
216 |
+
"mips64el"
|
217 |
+
],
|
218 |
+
"optional": true,
|
219 |
+
"os": [
|
220 |
+
"linux"
|
221 |
+
],
|
222 |
+
"engines": {
|
223 |
+
"node": ">=12"
|
224 |
+
}
|
225 |
+
},
|
226 |
+
"node_modules/@esbuild/linux-ppc64": {
|
227 |
+
"version": "0.19.11",
|
228 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.11.tgz",
|
229 |
+
"integrity": "sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA==",
|
230 |
+
"cpu": [
|
231 |
+
"ppc64"
|
232 |
+
],
|
233 |
+
"optional": true,
|
234 |
+
"os": [
|
235 |
+
"linux"
|
236 |
+
],
|
237 |
+
"engines": {
|
238 |
+
"node": ">=12"
|
239 |
+
}
|
240 |
+
},
|
241 |
+
"node_modules/@esbuild/linux-riscv64": {
|
242 |
+
"version": "0.19.11",
|
243 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.11.tgz",
|
244 |
+
"integrity": "sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ==",
|
245 |
+
"cpu": [
|
246 |
+
"riscv64"
|
247 |
+
],
|
248 |
+
"optional": true,
|
249 |
+
"os": [
|
250 |
+
"linux"
|
251 |
+
],
|
252 |
+
"engines": {
|
253 |
+
"node": ">=12"
|
254 |
+
}
|
255 |
+
},
|
256 |
+
"node_modules/@esbuild/linux-s390x": {
|
257 |
+
"version": "0.19.11",
|
258 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.11.tgz",
|
259 |
+
"integrity": "sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q==",
|
260 |
+
"cpu": [
|
261 |
+
"s390x"
|
262 |
+
],
|
263 |
+
"optional": true,
|
264 |
+
"os": [
|
265 |
+
"linux"
|
266 |
+
],
|
267 |
+
"engines": {
|
268 |
+
"node": ">=12"
|
269 |
+
}
|
270 |
+
},
|
271 |
+
"node_modules/@esbuild/linux-x64": {
|
272 |
+
"version": "0.19.11",
|
273 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.11.tgz",
|
274 |
+
"integrity": "sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA==",
|
275 |
+
"cpu": [
|
276 |
+
"x64"
|
277 |
+
],
|
278 |
+
"optional": true,
|
279 |
+
"os": [
|
280 |
+
"linux"
|
281 |
+
],
|
282 |
+
"engines": {
|
283 |
+
"node": ">=12"
|
284 |
+
}
|
285 |
+
},
|
286 |
+
"node_modules/@esbuild/netbsd-x64": {
|
287 |
+
"version": "0.19.11",
|
288 |
+
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.11.tgz",
|
289 |
+
"integrity": "sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ==",
|
290 |
+
"cpu": [
|
291 |
+
"x64"
|
292 |
+
],
|
293 |
+
"optional": true,
|
294 |
+
"os": [
|
295 |
+
"netbsd"
|
296 |
+
],
|
297 |
+
"engines": {
|
298 |
+
"node": ">=12"
|
299 |
+
}
|
300 |
+
},
|
301 |
+
"node_modules/@esbuild/openbsd-x64": {
|
302 |
+
"version": "0.19.11",
|
303 |
+
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.11.tgz",
|
304 |
+
"integrity": "sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw==",
|
305 |
+
"cpu": [
|
306 |
+
"x64"
|
307 |
+
],
|
308 |
+
"optional": true,
|
309 |
+
"os": [
|
310 |
+
"openbsd"
|
311 |
+
],
|
312 |
+
"engines": {
|
313 |
+
"node": ">=12"
|
314 |
+
}
|
315 |
+
},
|
316 |
+
"node_modules/@esbuild/sunos-x64": {
|
317 |
+
"version": "0.19.11",
|
318 |
+
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.11.tgz",
|
319 |
+
"integrity": "sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ==",
|
320 |
+
"cpu": [
|
321 |
+
"x64"
|
322 |
+
],
|
323 |
+
"optional": true,
|
324 |
+
"os": [
|
325 |
+
"sunos"
|
326 |
+
],
|
327 |
+
"engines": {
|
328 |
+
"node": ">=12"
|
329 |
+
}
|
330 |
+
},
|
331 |
+
"node_modules/@esbuild/win32-arm64": {
|
332 |
+
"version": "0.19.11",
|
333 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.11.tgz",
|
334 |
+
"integrity": "sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ==",
|
335 |
+
"cpu": [
|
336 |
+
"arm64"
|
337 |
+
],
|
338 |
+
"optional": true,
|
339 |
+
"os": [
|
340 |
+
"win32"
|
341 |
+
],
|
342 |
+
"engines": {
|
343 |
+
"node": ">=12"
|
344 |
+
}
|
345 |
+
},
|
346 |
+
"node_modules/@esbuild/win32-ia32": {
|
347 |
+
"version": "0.19.11",
|
348 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.11.tgz",
|
349 |
+
"integrity": "sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg==",
|
350 |
+
"cpu": [
|
351 |
+
"ia32"
|
352 |
+
],
|
353 |
+
"optional": true,
|
354 |
+
"os": [
|
355 |
+
"win32"
|
356 |
+
],
|
357 |
+
"engines": {
|
358 |
+
"node": ">=12"
|
359 |
+
}
|
360 |
+
},
|
361 |
+
"node_modules/@esbuild/win32-x64": {
|
362 |
+
"version": "0.19.11",
|
363 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.11.tgz",
|
364 |
+
"integrity": "sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw==",
|
365 |
+
"cpu": [
|
366 |
+
"x64"
|
367 |
+
],
|
368 |
+
"optional": true,
|
369 |
+
"os": [
|
370 |
+
"win32"
|
371 |
+
],
|
372 |
+
"engines": {
|
373 |
+
"node": ">=12"
|
374 |
+
}
|
375 |
+
},
|
376 |
+
"node_modules/@formatjs/ecma402-abstract": {
|
377 |
+
"version": "1.11.4",
|
378 |
+
"resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.4.tgz",
|
379 |
+
"integrity": "sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw==",
|
380 |
+
"dependencies": {
|
381 |
+
"@formatjs/intl-localematcher": "0.2.25",
|
382 |
+
"tslib": "^2.1.0"
|
383 |
+
}
|
384 |
+
},
|
385 |
+
"node_modules/@formatjs/fast-memoize": {
|
386 |
+
"version": "1.2.1",
|
387 |
+
"resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-1.2.1.tgz",
|
388 |
+
"integrity": "sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==",
|
389 |
+
"dependencies": {
|
390 |
+
"tslib": "^2.1.0"
|
391 |
+
}
|
392 |
+
},
|
393 |
+
"node_modules/@formatjs/icu-messageformat-parser": {
|
394 |
+
"version": "2.1.0",
|
395 |
+
"resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.0.tgz",
|
396 |
+
"integrity": "sha512-Qxv/lmCN6hKpBSss2uQ8IROVnta2r9jd3ymUEIjm2UyIkUCHVcbUVRGL/KS/wv7876edvsPe+hjHVJ4z8YuVaw==",
|
397 |
+
"dependencies": {
|
398 |
+
"@formatjs/ecma402-abstract": "1.11.4",
|
399 |
+
"@formatjs/icu-skeleton-parser": "1.3.6",
|
400 |
+
"tslib": "^2.1.0"
|
401 |
+
}
|
402 |
+
},
|
403 |
+
"node_modules/@formatjs/icu-skeleton-parser": {
|
404 |
+
"version": "1.3.6",
|
405 |
+
"resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.6.tgz",
|
406 |
+
"integrity": "sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg==",
|
407 |
+
"dependencies": {
|
408 |
+
"@formatjs/ecma402-abstract": "1.11.4",
|
409 |
+
"tslib": "^2.1.0"
|
410 |
+
}
|
411 |
+
},
|
412 |
+
"node_modules/@formatjs/intl-localematcher": {
|
413 |
+
"version": "0.2.25",
|
414 |
+
"resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.25.tgz",
|
415 |
+
"integrity": "sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA==",
|
416 |
+
"dependencies": {
|
417 |
+
"tslib": "^2.1.0"
|
418 |
+
}
|
419 |
+
},
|
420 |
+
"node_modules/@gradio/atoms": {
|
421 |
+
"version": "0.4.1",
|
422 |
+
"resolved": "https://registry.npmjs.org/@gradio/atoms/-/atoms-0.4.1.tgz",
|
423 |
+
"integrity": "sha512-NkA5JBwglft0HpE/kfq2KA8f/2LvMcQ9yMBgAZD4wbp7O3i3HJ2+Gw4umKvUGNt53berq8Q+qT2qnFxc3qAGUQ==",
|
424 |
+
"dependencies": {
|
425 |
+
"@gradio/icons": "^0.3.2",
|
426 |
+
"@gradio/utils": "^0.2.0"
|
427 |
+
}
|
428 |
+
},
|
429 |
+
"node_modules/@gradio/column": {
|
430 |
+
"version": "0.1.0",
|
431 |
+
"resolved": "https://registry.npmjs.org/@gradio/column/-/column-0.1.0.tgz",
|
432 |
+
"integrity": "sha512-P24nqqVnMXBaDA1f/zSN5HZRho4PxP8Dq+7VltPHlmxIEiZYik2AJ4J0LeuIha34FDO0guu/16evdrpvGIUAfw=="
|
433 |
+
},
|
434 |
+
"node_modules/@gradio/icons": {
|
435 |
+
"version": "0.3.2",
|
436 |
+
"resolved": "https://registry.npmjs.org/@gradio/icons/-/icons-0.3.2.tgz",
|
437 |
+
"integrity": "sha512-l0jGfSRFiZ/doAXz6L+JEp6MN/a1BTZm88kqVoSnYrKSytP6bnBLRWeF4UvOi2T2fbVrNKenAEt/lwxJE5vK4w=="
|
438 |
+
},
|
439 |
+
"node_modules/@gradio/statustracker": {
|
440 |
+
"version": "0.4.3",
|
441 |
+
"resolved": "https://registry.npmjs.org/@gradio/statustracker/-/statustracker-0.4.3.tgz",
|
442 |
+
"integrity": "sha512-q1B4+I/O9eKoCIWW42xK/yxBGRRQZFfV2dVWxBcEmlX6A0r5FfkFHvs569lfVxdKrJDNlmtI55Idm97meYPaeg==",
|
443 |
+
"dependencies": {
|
444 |
+
"@gradio/atoms": "^0.4.1",
|
445 |
+
"@gradio/column": "^0.1.0",
|
446 |
+
"@gradio/icons": "^0.3.2",
|
447 |
+
"@gradio/utils": "^0.2.0"
|
448 |
+
}
|
449 |
+
},
|
450 |
+
"node_modules/@gradio/theme": {
|
451 |
+
"version": "0.2.0",
|
452 |
+
"resolved": "https://registry.npmjs.org/@gradio/theme/-/theme-0.2.0.tgz",
|
453 |
+
"integrity": "sha512-33c68Nk7oRXLn08OxPfjcPm7S4tXGOUV1I1bVgzdM2YV5o1QBOS1GEnXPZPu/CEYPePLMB6bsDwffrLEyLGWVQ=="
|
454 |
+
},
|
455 |
+
"node_modules/@gradio/utils": {
|
456 |
+
"version": "0.2.0",
|
457 |
+
"resolved": "https://registry.npmjs.org/@gradio/utils/-/utils-0.2.0.tgz",
|
458 |
+
"integrity": "sha512-YkwzXufi6IxQrlMW+1sFo8Yn6F9NLL69ZoBsbo7QEhms0v5L7pmOTw+dfd7M3dwbRP2lgjrb52i1kAIN3n6aqQ==",
|
459 |
+
"dependencies": {
|
460 |
+
"@gradio/theme": "^0.2.0",
|
461 |
+
"svelte-i18n": "^3.6.0"
|
462 |
+
}
|
463 |
+
},
|
464 |
+
"node_modules/@jridgewell/gen-mapping": {
|
465 |
+
"version": "0.3.3",
|
466 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz",
|
467 |
+
"integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==",
|
468 |
+
"peer": true,
|
469 |
+
"dependencies": {
|
470 |
+
"@jridgewell/set-array": "^1.0.1",
|
471 |
+
"@jridgewell/sourcemap-codec": "^1.4.10",
|
472 |
+
"@jridgewell/trace-mapping": "^0.3.9"
|
473 |
+
},
|
474 |
+
"engines": {
|
475 |
+
"node": ">=6.0.0"
|
476 |
+
}
|
477 |
+
},
|
478 |
+
"node_modules/@jridgewell/resolve-uri": {
|
479 |
+
"version": "3.1.1",
|
480 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
|
481 |
+
"integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
|
482 |
+
"peer": true,
|
483 |
+
"engines": {
|
484 |
+
"node": ">=6.0.0"
|
485 |
+
}
|
486 |
+
},
|
487 |
+
"node_modules/@jridgewell/set-array": {
|
488 |
+
"version": "1.1.2",
|
489 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
|
490 |
+
"integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
|
491 |
+
"peer": true,
|
492 |
+
"engines": {
|
493 |
+
"node": ">=6.0.0"
|
494 |
+
}
|
495 |
+
},
|
496 |
+
"node_modules/@jridgewell/sourcemap-codec": {
|
497 |
+
"version": "1.4.15",
|
498 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
|
499 |
+
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
|
500 |
+
"peer": true
|
501 |
+
},
|
502 |
+
"node_modules/@jridgewell/trace-mapping": {
|
503 |
+
"version": "0.3.20",
|
504 |
+
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz",
|
505 |
+
"integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==",
|
506 |
+
"peer": true,
|
507 |
+
"dependencies": {
|
508 |
+
"@jridgewell/resolve-uri": "^3.1.0",
|
509 |
+
"@jridgewell/sourcemap-codec": "^1.4.14"
|
510 |
+
}
|
511 |
+
},
|
512 |
+
"node_modules/@types/estree": {
|
513 |
+
"version": "1.0.5",
|
514 |
+
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
|
515 |
+
"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
|
516 |
+
"peer": true
|
517 |
+
},
|
518 |
+
"node_modules/acorn": {
|
519 |
+
"version": "8.11.3",
|
520 |
+
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
|
521 |
+
"integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
|
522 |
+
"peer": true,
|
523 |
+
"bin": {
|
524 |
+
"acorn": "bin/acorn"
|
525 |
+
},
|
526 |
+
"engines": {
|
527 |
+
"node": ">=0.4.0"
|
528 |
+
}
|
529 |
+
},
|
530 |
+
"node_modules/aria-query": {
|
531 |
+
"version": "5.3.0",
|
532 |
+
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
|
533 |
+
"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
|
534 |
+
"peer": true,
|
535 |
+
"dependencies": {
|
536 |
+
"dequal": "^2.0.3"
|
537 |
+
}
|
538 |
+
},
|
539 |
+
"node_modules/axobject-query": {
|
540 |
+
"version": "3.2.1",
|
541 |
+
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz",
|
542 |
+
"integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==",
|
543 |
+
"peer": true,
|
544 |
+
"dependencies": {
|
545 |
+
"dequal": "^2.0.3"
|
546 |
+
}
|
547 |
+
},
|
548 |
+
"node_modules/cli-color": {
|
549 |
+
"version": "2.0.3",
|
550 |
+
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.3.tgz",
|
551 |
+
"integrity": "sha512-OkoZnxyC4ERN3zLzZaY9Emb7f/MhBOIpePv0Ycok0fJYT+Ouo00UBEIwsVsr0yoow++n5YWlSUgST9GKhNHiRQ==",
|
552 |
+
"dependencies": {
|
553 |
+
"d": "^1.0.1",
|
554 |
+
"es5-ext": "^0.10.61",
|
555 |
+
"es6-iterator": "^2.0.3",
|
556 |
+
"memoizee": "^0.4.15",
|
557 |
+
"timers-ext": "^0.1.7"
|
558 |
+
},
|
559 |
+
"engines": {
|
560 |
+
"node": ">=0.10"
|
561 |
+
}
|
562 |
+
},
|
563 |
+
"node_modules/code-red": {
|
564 |
+
"version": "1.0.4",
|
565 |
+
"resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz",
|
566 |
+
"integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==",
|
567 |
+
"peer": true,
|
568 |
+
"dependencies": {
|
569 |
+
"@jridgewell/sourcemap-codec": "^1.4.15",
|
570 |
+
"@types/estree": "^1.0.1",
|
571 |
+
"acorn": "^8.10.0",
|
572 |
+
"estree-walker": "^3.0.3",
|
573 |
+
"periscopic": "^3.1.0"
|
574 |
+
}
|
575 |
+
},
|
576 |
+
"node_modules/css-tree": {
|
577 |
+
"version": "2.3.1",
|
578 |
+
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz",
|
579 |
+
"integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",
|
580 |
+
"peer": true,
|
581 |
+
"dependencies": {
|
582 |
+
"mdn-data": "2.0.30",
|
583 |
+
"source-map-js": "^1.0.1"
|
584 |
+
},
|
585 |
+
"engines": {
|
586 |
+
"node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
|
587 |
+
}
|
588 |
+
},
|
589 |
+
"node_modules/d": {
|
590 |
+
"version": "1.0.1",
|
591 |
+
"resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
|
592 |
+
"integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
|
593 |
+
"dependencies": {
|
594 |
+
"es5-ext": "^0.10.50",
|
595 |
+
"type": "^1.0.1"
|
596 |
+
}
|
597 |
+
},
|
598 |
+
"node_modules/deepmerge": {
|
599 |
+
"version": "4.3.1",
|
600 |
+
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
601 |
+
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
|
602 |
+
"engines": {
|
603 |
+
"node": ">=0.10.0"
|
604 |
+
}
|
605 |
+
},
|
606 |
+
"node_modules/dequal": {
|
607 |
+
"version": "2.0.3",
|
608 |
+
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
|
609 |
+
"integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
|
610 |
+
"peer": true,
|
611 |
+
"engines": {
|
612 |
+
"node": ">=6"
|
613 |
+
}
|
614 |
+
},
|
615 |
+
"node_modules/es5-ext": {
|
616 |
+
"version": "0.10.62",
|
617 |
+
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz",
|
618 |
+
"integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==",
|
619 |
+
"hasInstallScript": true,
|
620 |
+
"dependencies": {
|
621 |
+
"es6-iterator": "^2.0.3",
|
622 |
+
"es6-symbol": "^3.1.3",
|
623 |
+
"next-tick": "^1.1.0"
|
624 |
+
},
|
625 |
+
"engines": {
|
626 |
+
"node": ">=0.10"
|
627 |
+
}
|
628 |
+
},
|
629 |
+
"node_modules/es6-iterator": {
|
630 |
+
"version": "2.0.3",
|
631 |
+
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
|
632 |
+
"integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
|
633 |
+
"dependencies": {
|
634 |
+
"d": "1",
|
635 |
+
"es5-ext": "^0.10.35",
|
636 |
+
"es6-symbol": "^3.1.1"
|
637 |
+
}
|
638 |
+
},
|
639 |
+
"node_modules/es6-symbol": {
|
640 |
+
"version": "3.1.3",
|
641 |
+
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
|
642 |
+
"integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
|
643 |
+
"dependencies": {
|
644 |
+
"d": "^1.0.1",
|
645 |
+
"ext": "^1.1.2"
|
646 |
+
}
|
647 |
+
},
|
648 |
+
"node_modules/es6-weak-map": {
|
649 |
+
"version": "2.0.3",
|
650 |
+
"resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz",
|
651 |
+
"integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==",
|
652 |
+
"dependencies": {
|
653 |
+
"d": "1",
|
654 |
+
"es5-ext": "^0.10.46",
|
655 |
+
"es6-iterator": "^2.0.3",
|
656 |
+
"es6-symbol": "^3.1.1"
|
657 |
+
}
|
658 |
+
},
|
659 |
+
"node_modules/esbuild": {
|
660 |
+
"version": "0.19.11",
|
661 |
+
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.11.tgz",
|
662 |
+
"integrity": "sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA==",
|
663 |
+
"hasInstallScript": true,
|
664 |
+
"bin": {
|
665 |
+
"esbuild": "bin/esbuild"
|
666 |
+
},
|
667 |
+
"engines": {
|
668 |
+
"node": ">=12"
|
669 |
+
},
|
670 |
+
"optionalDependencies": {
|
671 |
+
"@esbuild/aix-ppc64": "0.19.11",
|
672 |
+
"@esbuild/android-arm": "0.19.11",
|
673 |
+
"@esbuild/android-arm64": "0.19.11",
|
674 |
+
"@esbuild/android-x64": "0.19.11",
|
675 |
+
"@esbuild/darwin-arm64": "0.19.11",
|
676 |
+
"@esbuild/darwin-x64": "0.19.11",
|
677 |
+
"@esbuild/freebsd-arm64": "0.19.11",
|
678 |
+
"@esbuild/freebsd-x64": "0.19.11",
|
679 |
+
"@esbuild/linux-arm": "0.19.11",
|
680 |
+
"@esbuild/linux-arm64": "0.19.11",
|
681 |
+
"@esbuild/linux-ia32": "0.19.11",
|
682 |
+
"@esbuild/linux-loong64": "0.19.11",
|
683 |
+
"@esbuild/linux-mips64el": "0.19.11",
|
684 |
+
"@esbuild/linux-ppc64": "0.19.11",
|
685 |
+
"@esbuild/linux-riscv64": "0.19.11",
|
686 |
+
"@esbuild/linux-s390x": "0.19.11",
|
687 |
+
"@esbuild/linux-x64": "0.19.11",
|
688 |
+
"@esbuild/netbsd-x64": "0.19.11",
|
689 |
+
"@esbuild/openbsd-x64": "0.19.11",
|
690 |
+
"@esbuild/sunos-x64": "0.19.11",
|
691 |
+
"@esbuild/win32-arm64": "0.19.11",
|
692 |
+
"@esbuild/win32-ia32": "0.19.11",
|
693 |
+
"@esbuild/win32-x64": "0.19.11"
|
694 |
+
}
|
695 |
+
},
|
696 |
+
"node_modules/estree-walker": {
|
697 |
+
"version": "3.0.3",
|
698 |
+
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
|
699 |
+
"integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
|
700 |
+
"peer": true,
|
701 |
+
"dependencies": {
|
702 |
+
"@types/estree": "^1.0.0"
|
703 |
+
}
|
704 |
+
},
|
705 |
+
"node_modules/event-emitter": {
|
706 |
+
"version": "0.3.5",
|
707 |
+
"resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
|
708 |
+
"integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==",
|
709 |
+
"dependencies": {
|
710 |
+
"d": "1",
|
711 |
+
"es5-ext": "~0.10.14"
|
712 |
+
}
|
713 |
+
},
|
714 |
+
"node_modules/ext": {
|
715 |
+
"version": "1.7.0",
|
716 |
+
"resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz",
|
717 |
+
"integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==",
|
718 |
+
"dependencies": {
|
719 |
+
"type": "^2.7.2"
|
720 |
+
}
|
721 |
+
},
|
722 |
+
"node_modules/ext/node_modules/type": {
|
723 |
+
"version": "2.7.2",
|
724 |
+
"resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz",
|
725 |
+
"integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw=="
|
726 |
+
},
|
727 |
+
"node_modules/globalyzer": {
|
728 |
+
"version": "0.1.0",
|
729 |
+
"resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
|
730 |
+
"integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q=="
|
731 |
+
},
|
732 |
+
"node_modules/globrex": {
|
733 |
+
"version": "0.1.2",
|
734 |
+
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
|
735 |
+
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg=="
|
736 |
+
},
|
737 |
+
"node_modules/intl-messageformat": {
|
738 |
+
"version": "9.13.0",
|
739 |
+
"resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-9.13.0.tgz",
|
740 |
+
"integrity": "sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==",
|
741 |
+
"dependencies": {
|
742 |
+
"@formatjs/ecma402-abstract": "1.11.4",
|
743 |
+
"@formatjs/fast-memoize": "1.2.1",
|
744 |
+
"@formatjs/icu-messageformat-parser": "2.1.0",
|
745 |
+
"tslib": "^2.1.0"
|
746 |
+
}
|
747 |
+
},
|
748 |
+
"node_modules/is-promise": {
|
749 |
+
"version": "2.2.2",
|
750 |
+
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
|
751 |
+
"integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
|
752 |
+
},
|
753 |
+
"node_modules/is-reference": {
|
754 |
+
"version": "3.0.2",
|
755 |
+
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.2.tgz",
|
756 |
+
"integrity": "sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==",
|
757 |
+
"peer": true,
|
758 |
+
"dependencies": {
|
759 |
+
"@types/estree": "*"
|
760 |
+
}
|
761 |
+
},
|
762 |
+
"node_modules/locate-character": {
|
763 |
+
"version": "3.0.0",
|
764 |
+
"resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",
|
765 |
+
"integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==",
|
766 |
+
"peer": true
|
767 |
+
},
|
768 |
+
"node_modules/lru-queue": {
|
769 |
+
"version": "0.1.0",
|
770 |
+
"resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz",
|
771 |
+
"integrity": "sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==",
|
772 |
+
"dependencies": {
|
773 |
+
"es5-ext": "~0.10.2"
|
774 |
+
}
|
775 |
+
},
|
776 |
+
"node_modules/magic-string": {
|
777 |
+
"version": "0.30.5",
|
778 |
+
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz",
|
779 |
+
"integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==",
|
780 |
+
"peer": true,
|
781 |
+
"dependencies": {
|
782 |
+
"@jridgewell/sourcemap-codec": "^1.4.15"
|
783 |
+
},
|
784 |
+
"engines": {
|
785 |
+
"node": ">=12"
|
786 |
+
}
|
787 |
+
},
|
788 |
+
"node_modules/mdn-data": {
|
789 |
+
"version": "2.0.30",
|
790 |
+
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",
|
791 |
+
"integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==",
|
792 |
+
"peer": true
|
793 |
+
},
|
794 |
+
"node_modules/memoizee": {
|
795 |
+
"version": "0.4.15",
|
796 |
+
"resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz",
|
797 |
+
"integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==",
|
798 |
+
"dependencies": {
|
799 |
+
"d": "^1.0.1",
|
800 |
+
"es5-ext": "^0.10.53",
|
801 |
+
"es6-weak-map": "^2.0.3",
|
802 |
+
"event-emitter": "^0.3.5",
|
803 |
+
"is-promise": "^2.2.2",
|
804 |
+
"lru-queue": "^0.1.0",
|
805 |
+
"next-tick": "^1.1.0",
|
806 |
+
"timers-ext": "^0.1.7"
|
807 |
+
}
|
808 |
+
},
|
809 |
+
"node_modules/mri": {
|
810 |
+
"version": "1.2.0",
|
811 |
+
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
|
812 |
+
"integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
|
813 |
+
"engines": {
|
814 |
+
"node": ">=4"
|
815 |
+
}
|
816 |
+
},
|
817 |
+
"node_modules/next-tick": {
|
818 |
+
"version": "1.1.0",
|
819 |
+
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
|
820 |
+
"integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ=="
|
821 |
+
},
|
822 |
+
"node_modules/periscopic": {
|
823 |
+
"version": "3.1.0",
|
824 |
+
"resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz",
|
825 |
+
"integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==",
|
826 |
+
"peer": true,
|
827 |
+
"dependencies": {
|
828 |
+
"@types/estree": "^1.0.0",
|
829 |
+
"estree-walker": "^3.0.0",
|
830 |
+
"is-reference": "^3.0.0"
|
831 |
+
}
|
832 |
+
},
|
833 |
+
"node_modules/sade": {
|
834 |
+
"version": "1.8.1",
|
835 |
+
"resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",
|
836 |
+
"integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==",
|
837 |
+
"dependencies": {
|
838 |
+
"mri": "^1.1.0"
|
839 |
+
},
|
840 |
+
"engines": {
|
841 |
+
"node": ">=6"
|
842 |
+
}
|
843 |
+
},
|
844 |
+
"node_modules/source-map-js": {
|
845 |
+
"version": "1.0.2",
|
846 |
+
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
|
847 |
+
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
848 |
+
"peer": true,
|
849 |
+
"engines": {
|
850 |
+
"node": ">=0.10.0"
|
851 |
+
}
|
852 |
+
},
|
853 |
+
"node_modules/svelte": {
|
854 |
+
"version": "4.2.8",
|
855 |
+
"resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.8.tgz",
|
856 |
+
"integrity": "sha512-hU6dh1MPl8gh6klQZwK/n73GiAHiR95IkFsesLPbMeEZi36ydaXL/ZAb4g9sayT0MXzpxyZjR28yderJHxcmYA==",
|
857 |
+
"peer": true,
|
858 |
+
"dependencies": {
|
859 |
+
"@ampproject/remapping": "^2.2.1",
|
860 |
+
"@jridgewell/sourcemap-codec": "^1.4.15",
|
861 |
+
"@jridgewell/trace-mapping": "^0.3.18",
|
862 |
+
"acorn": "^8.9.0",
|
863 |
+
"aria-query": "^5.3.0",
|
864 |
+
"axobject-query": "^3.2.1",
|
865 |
+
"code-red": "^1.0.3",
|
866 |
+
"css-tree": "^2.3.1",
|
867 |
+
"estree-walker": "^3.0.3",
|
868 |
+
"is-reference": "^3.0.1",
|
869 |
+
"locate-character": "^3.0.0",
|
870 |
+
"magic-string": "^0.30.4",
|
871 |
+
"periscopic": "^3.1.0"
|
872 |
+
},
|
873 |
+
"engines": {
|
874 |
+
"node": ">=16"
|
875 |
+
}
|
876 |
+
},
|
877 |
+
"node_modules/svelte-i18n": {
|
878 |
+
"version": "3.7.4",
|
879 |
+
"resolved": "https://registry.npmjs.org/svelte-i18n/-/svelte-i18n-3.7.4.tgz",
|
880 |
+
"integrity": "sha512-yGRCNo+eBT4cPuU7IVsYTYjxB7I2V8qgUZPlHnNctJj5IgbJgV78flsRzpjZ/8iUYZrS49oCt7uxlU3AZv/N5Q==",
|
881 |
+
"dependencies": {
|
882 |
+
"cli-color": "^2.0.3",
|
883 |
+
"deepmerge": "^4.2.2",
|
884 |
+
"esbuild": "^0.19.2",
|
885 |
+
"estree-walker": "^2",
|
886 |
+
"intl-messageformat": "^9.13.0",
|
887 |
+
"sade": "^1.8.1",
|
888 |
+
"tiny-glob": "^0.2.9"
|
889 |
+
},
|
890 |
+
"bin": {
|
891 |
+
"svelte-i18n": "dist/cli.js"
|
892 |
+
},
|
893 |
+
"engines": {
|
894 |
+
"node": ">= 16"
|
895 |
+
},
|
896 |
+
"peerDependencies": {
|
897 |
+
"svelte": "^3 || ^4"
|
898 |
+
}
|
899 |
+
},
|
900 |
+
"node_modules/svelte-i18n/node_modules/estree-walker": {
|
901 |
+
"version": "2.0.2",
|
902 |
+
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
903 |
+
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
904 |
+
},
|
905 |
+
"node_modules/timers-ext": {
|
906 |
+
"version": "0.1.7",
|
907 |
+
"resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz",
|
908 |
+
"integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==",
|
909 |
+
"dependencies": {
|
910 |
+
"es5-ext": "~0.10.46",
|
911 |
+
"next-tick": "1"
|
912 |
+
}
|
913 |
+
},
|
914 |
+
"node_modules/tiny-glob": {
|
915 |
+
"version": "0.2.9",
|
916 |
+
"resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
|
917 |
+
"integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
|
918 |
+
"dependencies": {
|
919 |
+
"globalyzer": "0.1.0",
|
920 |
+
"globrex": "^0.1.2"
|
921 |
+
}
|
922 |
+
},
|
923 |
+
"node_modules/tslib": {
|
924 |
+
"version": "2.6.2",
|
925 |
+
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
|
926 |
+
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
|
927 |
+
},
|
928 |
+
"node_modules/type": {
|
929 |
+
"version": "1.2.0",
|
930 |
+
"resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
|
931 |
+
"integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg=="
|
932 |
+
}
|
933 |
+
}
|
934 |
+
}
|
src/frontend/package.json
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "gradio_highlightedtextbox",
|
3 |
+
"version": "0.1.6",
|
4 |
+
"description": "Gradio UI packages",
|
5 |
+
"type": "module",
|
6 |
+
"author": "",
|
7 |
+
"license": "ISC",
|
8 |
+
"private": false,
|
9 |
+
"main_changeset": true,
|
10 |
+
"exports": {
|
11 |
+
".": "./Index.svelte",
|
12 |
+
"./example": "./Example.svelte",
|
13 |
+
"./package.json": "./package.json"
|
14 |
+
},
|
15 |
+
"dependencies": {
|
16 |
+
"@gradio/atoms": "0.4.1",
|
17 |
+
"@gradio/icons": "0.3.2",
|
18 |
+
"@gradio/statustracker": "0.4.3",
|
19 |
+
"@gradio/utils": "0.2.0"
|
20 |
+
}
|
21 |
+
}
|
src/frontend/utils.ts
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { colors } from "@gradio/theme";
|
2 |
+
|
3 |
+
type HighlightValueType = [string, string | null];
|
4 |
+
|
5 |
+
export function name_to_rgba(
|
6 |
+
name: string,
|
7 |
+
a: number,
|
8 |
+
ctx: CanvasRenderingContext2D | null
|
9 |
+
): string {
|
10 |
+
if (!ctx) {
|
11 |
+
var canvas = document.createElement("canvas");
|
12 |
+
ctx = canvas.getContext("2d")!;
|
13 |
+
}
|
14 |
+
ctx.fillStyle = name;
|
15 |
+
ctx.fillRect(0, 0, 1, 1);
|
16 |
+
const [r, g, b] = ctx.getImageData(0, 0, 1, 1).data;
|
17 |
+
ctx.clearRect(0, 0, 1, 1);
|
18 |
+
return `rgba(${r}, ${g}, ${b}, ${255 / a})`;
|
19 |
+
}
|
20 |
+
|
21 |
+
export function correct_color_map(
|
22 |
+
color_map: Record<string, string>,
|
23 |
+
browser: any,
|
24 |
+
ctx: CanvasRenderingContext2D | null
|
25 |
+
): Record<string, { primary: string; secondary: string }> {
|
26 |
+
var _color_map: Record<string, { primary: string; secondary: string }> = {};
|
27 |
+
for (const col in color_map) {
|
28 |
+
const _c = color_map[col].trim();
|
29 |
+
|
30 |
+
if (_c in colors) {
|
31 |
+
_color_map[col] = colors[_c as keyof typeof colors];
|
32 |
+
} else {
|
33 |
+
_color_map[col] = {
|
34 |
+
primary: browser
|
35 |
+
? name_to_rgba(color_map[col], 1, ctx)
|
36 |
+
: color_map[col],
|
37 |
+
secondary: browser
|
38 |
+
? name_to_rgba(color_map[col], 0.5, ctx)
|
39 |
+
: color_map[col]
|
40 |
+
};
|
41 |
+
}
|
42 |
+
}
|
43 |
+
return _color_map;
|
44 |
+
}
|
45 |
+
|
46 |
+
export function merge_elements(
|
47 |
+
value: HighlightValueType[],
|
48 |
+
mergeMode: "empty" | "equal"
|
49 |
+
): HighlightValueType[] {
|
50 |
+
let result: HighlightValueType[] = [];
|
51 |
+
let tempStr: string | null = null;
|
52 |
+
let tempVal: string | null = null;
|
53 |
+
|
54 |
+
for (const [str, val] of value) {
|
55 |
+
if (
|
56 |
+
(mergeMode === "empty" && val === null) ||
|
57 |
+
(mergeMode === "equal" && tempVal === val)
|
58 |
+
) {
|
59 |
+
tempStr = tempStr ? tempStr + str : str;
|
60 |
+
} else {
|
61 |
+
if (tempStr !== null) {
|
62 |
+
result.push([tempStr, tempVal as string]);
|
63 |
+
}
|
64 |
+
tempStr = str;
|
65 |
+
tempVal = val;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
if (tempStr !== null) {
|
70 |
+
result.push([tempStr, tempVal as string]);
|
71 |
+
}
|
72 |
+
|
73 |
+
return result;
|
74 |
+
}
|
src/pyproject.toml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[build-system]
|
2 |
+
requires = [
|
3 |
+
"hatchling",
|
4 |
+
"hatch-requirements-txt",
|
5 |
+
"hatch-fancy-pypi-readme>=22.5.0",
|
6 |
+
]
|
7 |
+
build-backend = "hatchling.build"
|
8 |
+
|
9 |
+
[project]
|
10 |
+
name = "gradio_highlightedtextbox"
|
11 |
+
version = "0.0.1"
|
12 |
+
description = "Editable Gradio textarea supporting highlighting"
|
13 |
+
readme = "README.md"
|
14 |
+
license = "mit"
|
15 |
+
requires-python = ">=3.8"
|
16 |
+
authors = [{ name = "Gabriele Sarti", email = "gabriele.sarti996@gmail.com" }]
|
17 |
+
keywords = ["gradio-custom-component", "gradio-template-SimpleTextbox", "highlight", "textbox", "editing", "color"]
|
18 |
+
# Add dependencies here
|
19 |
+
dependencies = ["gradio>=4.0,<5.0"]
|
20 |
+
classifiers = [
|
21 |
+
'Development Status :: 3 - Alpha',
|
22 |
+
'License :: OSI Approved :: Apache Software License',
|
23 |
+
'Operating System :: OS Independent',
|
24 |
+
'Programming Language :: Python :: 3',
|
25 |
+
'Programming Language :: Python :: 3 :: Only',
|
26 |
+
'Programming Language :: Python :: 3.8',
|
27 |
+
'Programming Language :: Python :: 3.9',
|
28 |
+
'Programming Language :: Python :: 3.10',
|
29 |
+
'Programming Language :: Python :: 3.11',
|
30 |
+
'Topic :: Scientific/Engineering',
|
31 |
+
'Topic :: Scientific/Engineering :: Artificial Intelligence',
|
32 |
+
'Topic :: Scientific/Engineering :: Visualization',
|
33 |
+
]
|
34 |
+
|
35 |
+
[project.optional-dependencies]
|
36 |
+
dev = ["build", "twine"]
|
37 |
+
|
38 |
+
[tool.hatch.build]
|
39 |
+
artifacts = ["/backend/gradio_highlightedtextbox/templates", "*.pyi", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates"]
|
40 |
+
|
41 |
+
[tool.hatch.build.targets.wheel]
|
42 |
+
packages = ["/backend/gradio_highlightedtextbox"]
|