vanna 0.1.1__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vanna/base/base.py +91 -27
- vanna/chromadb/chromadb_vector.py +22 -6
- vanna/{flask.py → flask/__init__.py} +59 -52
- vanna/flask/assets.py +36 -0
- vanna/openai/openai_chat.py +25 -19
- vanna/openai/openai_embeddings.py +0 -2
- vanna/remote.py +44 -70
- {vanna-0.1.1.dist-info → vanna-0.2.0.dist-info}/METADATA +2 -1
- {vanna-0.1.1.dist-info → vanna-0.2.0.dist-info}/RECORD +10 -9
- {vanna-0.1.1.dist-info → vanna-0.2.0.dist-info}/WHEEL +0 -0
vanna/base/base.py
CHANGED
|
@@ -72,6 +72,7 @@ class VannaBase(ABC):
|
|
|
72
72
|
def __init__(self, config=None):
|
|
73
73
|
self.config = config
|
|
74
74
|
self.run_sql_is_set = False
|
|
75
|
+
self.static_documentation = ""
|
|
75
76
|
|
|
76
77
|
def log(self, message: str):
|
|
77
78
|
print(message)
|
|
@@ -140,18 +141,35 @@ class VannaBase(ABC):
|
|
|
140
141
|
else:
|
|
141
142
|
return False
|
|
142
143
|
|
|
143
|
-
def generate_followup_questions(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
144
|
+
def generate_followup_questions(
|
|
145
|
+
self, question: str, sql: str, df: pd.DataFrame, **kwargs
|
|
146
|
+
) -> list:
|
|
147
|
+
"""
|
|
148
|
+
**Example:**
|
|
149
|
+
```python
|
|
150
|
+
vn.generate_followup_questions("What are the top 10 customers by sales?", df)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Generate a list of followup questions that you can ask Vanna.AI.
|
|
154
|
+
|
|
155
|
+
Args:
|
|
156
|
+
question (str): The question that was asked.
|
|
157
|
+
df (pd.DataFrame): The results of the SQL query.
|
|
158
|
+
|
|
159
|
+
Returns:
|
|
160
|
+
list: A list of followup questions that you can ask Vanna.AI.
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
message_log = [
|
|
164
|
+
self.system_message(
|
|
165
|
+
f"You are a helpful data assistant. The user asked the question: '{question}'\n\nThe SQL query for this question was: {sql}\n\nThe following is a pandas DataFrame with the results of the query: \n{df.to_markdown()}\n\n"
|
|
166
|
+
),
|
|
167
|
+
self.user_message(
|
|
168
|
+
"Generate a list of followup questions that the user might ask about this data. Respond with a list of questions, one per line. Do not answer with any explanations -- just the questions. Remember that there should be an unambiguous SQL query that can be generated from the question. Prefer questions that are answerable outside of the context of this conversation. Prefer questions that are slight modifications of the SQL query that was generated that allow digging deeper into the data. Each question will be turned into a button that the user can click to generate a new SQL query so don't use 'example' type questions. Each question must have a one-to-one correspondence with an instantiated SQL query."
|
|
169
|
+
),
|
|
170
|
+
]
|
|
171
|
+
|
|
172
|
+
llm_response = self.submit_prompt(message_log, **kwargs)
|
|
155
173
|
|
|
156
174
|
numbers_removed = re.sub(r"^\d+\.\s*", "", llm_response, flags=re.MULTILINE)
|
|
157
175
|
return numbers_removed.split("\n")
|
|
@@ -169,6 +187,36 @@ class VannaBase(ABC):
|
|
|
169
187
|
|
|
170
188
|
return [q["question"] for q in question_sql]
|
|
171
189
|
|
|
190
|
+
def generate_summary(self, question: str, df: pd.DataFrame, **kwargs) -> str:
|
|
191
|
+
"""
|
|
192
|
+
**Example:**
|
|
193
|
+
```python
|
|
194
|
+
vn.generate_summary("What are the top 10 customers by sales?", df)
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Generate a summary of the results of a SQL query.
|
|
198
|
+
|
|
199
|
+
Args:
|
|
200
|
+
question (str): The question that was asked.
|
|
201
|
+
df (pd.DataFrame): The results of the SQL query.
|
|
202
|
+
|
|
203
|
+
Returns:
|
|
204
|
+
str: The summary of the results of the SQL query.
|
|
205
|
+
"""
|
|
206
|
+
|
|
207
|
+
message_log = [
|
|
208
|
+
self.system_message(
|
|
209
|
+
f"You are a helpful data assistant. The user asked the question: '{question}'\n\nThe following is a pandas DataFrame with the results of the query: \n{df.to_markdown()}\n\n"
|
|
210
|
+
),
|
|
211
|
+
self.user_message(
|
|
212
|
+
"Briefly summarize the data based on the question that was asked. Do not respond with any additional explanation beyond the summary."
|
|
213
|
+
),
|
|
214
|
+
]
|
|
215
|
+
|
|
216
|
+
summary = self.submit_prompt(message_log, **kwargs)
|
|
217
|
+
|
|
218
|
+
return summary
|
|
219
|
+
|
|
172
220
|
# ----------------- Use Any Embeddings API ----------------- #
|
|
173
221
|
@abstractmethod
|
|
174
222
|
def generate_embedding(self, data: str, **kwargs) -> List[float]:
|
|
@@ -184,7 +232,7 @@ class VannaBase(ABC):
|
|
|
184
232
|
question (str): The question to get similar questions and their corresponding SQL statements for.
|
|
185
233
|
|
|
186
234
|
Returns:
|
|
187
|
-
list: A list of similar questions and their corresponding SQL statements.
|
|
235
|
+
list: A list of similar questions and their corresponding SQL statements.
|
|
188
236
|
"""
|
|
189
237
|
pass
|
|
190
238
|
|
|
@@ -224,7 +272,7 @@ class VannaBase(ABC):
|
|
|
224
272
|
sql (str): The SQL query to add.
|
|
225
273
|
|
|
226
274
|
Returns:
|
|
227
|
-
str: The ID of the training data that was added.
|
|
275
|
+
str: The ID of the training data that was added.
|
|
228
276
|
"""
|
|
229
277
|
pass
|
|
230
278
|
|
|
@@ -232,7 +280,7 @@ class VannaBase(ABC):
|
|
|
232
280
|
def add_ddl(self, ddl: str, **kwargs) -> str:
|
|
233
281
|
"""
|
|
234
282
|
This method is used to add a DDL statement to the training data.
|
|
235
|
-
|
|
283
|
+
|
|
236
284
|
Args:
|
|
237
285
|
ddl (str): The DDL statement to add.
|
|
238
286
|
|
|
@@ -265,7 +313,7 @@ class VannaBase(ABC):
|
|
|
265
313
|
This method is used to get all the training data from the retrieval layer.
|
|
266
314
|
|
|
267
315
|
Returns:
|
|
268
|
-
pd.DataFrame: The training data.
|
|
316
|
+
pd.DataFrame: The training data.
|
|
269
317
|
"""
|
|
270
318
|
pass
|
|
271
319
|
|
|
@@ -321,7 +369,10 @@ class VannaBase(ABC):
|
|
|
321
369
|
return initial_prompt
|
|
322
370
|
|
|
323
371
|
def add_documentation_to_prompt(
|
|
324
|
-
self,
|
|
372
|
+
self,
|
|
373
|
+
initial_prompt: str,
|
|
374
|
+
documentation_list: list[str],
|
|
375
|
+
max_tokens: int = 14000,
|
|
325
376
|
) -> str:
|
|
326
377
|
if len(documentation_list) > 0:
|
|
327
378
|
initial_prompt += f"\nYou may use the following documentation as a reference for what tables might be available. Use responses to past questions also to guide you:\n\n"
|
|
@@ -389,6 +440,9 @@ class VannaBase(ABC):
|
|
|
389
440
|
initial_prompt, ddl_list, max_tokens=14000
|
|
390
441
|
)
|
|
391
442
|
|
|
443
|
+
if self.static_documentation != "":
|
|
444
|
+
doc_list.append(self.static_documentation)
|
|
445
|
+
|
|
392
446
|
initial_prompt = self.add_documentation_to_prompt(
|
|
393
447
|
initial_prompt, doc_list, max_tokens=14000
|
|
394
448
|
)
|
|
@@ -599,6 +653,7 @@ class VannaBase(ABC):
|
|
|
599
653
|
|
|
600
654
|
return df
|
|
601
655
|
|
|
656
|
+
self.static_documentation = "This is a Snowflake database"
|
|
602
657
|
self.run_sql = run_sql_snowflake
|
|
603
658
|
self.run_sql_is_set = True
|
|
604
659
|
|
|
@@ -632,6 +687,7 @@ class VannaBase(ABC):
|
|
|
632
687
|
def run_sql_sqlite(sql: str):
|
|
633
688
|
return pd.read_sql_query(sql, conn)
|
|
634
689
|
|
|
690
|
+
self.static_documentation = "This is a SQLite database"
|
|
635
691
|
self.run_sql = run_sql_sqlite
|
|
636
692
|
self.run_sql_is_set = True
|
|
637
693
|
|
|
@@ -731,11 +787,12 @@ class VannaBase(ABC):
|
|
|
731
787
|
except psycopg2.Error as e:
|
|
732
788
|
conn.rollback()
|
|
733
789
|
raise ValidationError(e)
|
|
734
|
-
|
|
790
|
+
|
|
735
791
|
except Exception as e:
|
|
736
792
|
conn.rollback()
|
|
737
793
|
raise e
|
|
738
794
|
|
|
795
|
+
self.static_documentation = "This is a Postgres database"
|
|
739
796
|
self.run_sql_is_set = True
|
|
740
797
|
self.run_sql = run_sql_postgres
|
|
741
798
|
|
|
@@ -825,6 +882,7 @@ class VannaBase(ABC):
|
|
|
825
882
|
raise errors
|
|
826
883
|
return None
|
|
827
884
|
|
|
885
|
+
self.static_documentation = "This is a BigQuery database"
|
|
828
886
|
self.run_sql_is_set = True
|
|
829
887
|
self.run_sql = run_sql_bigquery
|
|
830
888
|
|
|
@@ -847,13 +905,13 @@ class VannaBase(ABC):
|
|
|
847
905
|
" run command: \npip install vanna[duckdb]"
|
|
848
906
|
)
|
|
849
907
|
# URL of the database to download
|
|
850
|
-
if url==":memory:" or url=="":
|
|
851
|
-
path=":memory:"
|
|
908
|
+
if url == ":memory:" or url == "":
|
|
909
|
+
path = ":memory:"
|
|
852
910
|
else:
|
|
853
911
|
# Path to save the downloaded database
|
|
854
912
|
print(os.path.exists(url))
|
|
855
913
|
if os.path.exists(url):
|
|
856
|
-
path=url
|
|
914
|
+
path = url
|
|
857
915
|
elif url.startswith("md") or url.startswith("motherduck"):
|
|
858
916
|
path = url
|
|
859
917
|
else:
|
|
@@ -873,6 +931,7 @@ class VannaBase(ABC):
|
|
|
873
931
|
def run_sql_duckdb(sql: str):
|
|
874
932
|
return conn.query(sql).to_df()
|
|
875
933
|
|
|
934
|
+
self.static_documentation = "This is a DuckDB database"
|
|
876
935
|
self.run_sql = run_sql_duckdb
|
|
877
936
|
self.run_sql_is_set = True
|
|
878
937
|
|
|
@@ -895,17 +954,20 @@ class VannaBase(ABC):
|
|
|
895
954
|
)
|
|
896
955
|
|
|
897
956
|
try:
|
|
898
|
-
from sqlalchemy.engine import URL
|
|
899
957
|
import sqlalchemy as sa
|
|
958
|
+
from sqlalchemy.engine import URL
|
|
900
959
|
except ImportError:
|
|
901
960
|
raise DependencyError(
|
|
902
961
|
"You need to install required dependencies to execute this method,"
|
|
903
962
|
" run command: pip install sqlalchemy"
|
|
904
963
|
)
|
|
905
964
|
|
|
906
|
-
connection_url = URL.create(
|
|
965
|
+
connection_url = URL.create(
|
|
966
|
+
"mssql+pyodbc", query={"odbc_connect": odbc_conn_str}
|
|
967
|
+
)
|
|
907
968
|
|
|
908
969
|
from sqlalchemy import create_engine
|
|
970
|
+
|
|
909
971
|
engine = create_engine(connection_url)
|
|
910
972
|
|
|
911
973
|
def run_sql_mssql(sql: str):
|
|
@@ -913,9 +975,10 @@ class VannaBase(ABC):
|
|
|
913
975
|
with engine.begin() as conn:
|
|
914
976
|
df = pd.read_sql_query(sa.text(sql), conn)
|
|
915
977
|
return df
|
|
916
|
-
|
|
978
|
+
|
|
917
979
|
raise Exception("Couldn't run sql")
|
|
918
980
|
|
|
981
|
+
self.static_documentation = "This is a Microsoft SQL Server database"
|
|
919
982
|
self.run_sql = run_sql_mssql
|
|
920
983
|
self.run_sql_is_set = True
|
|
921
984
|
|
|
@@ -943,7 +1006,7 @@ class VannaBase(ABC):
|
|
|
943
1006
|
question: Union[str, None] = None,
|
|
944
1007
|
print_results: bool = True,
|
|
945
1008
|
auto_train: bool = True,
|
|
946
|
-
visualize: bool = True,
|
|
1009
|
+
visualize: bool = True, # if False, will not generate plotly code
|
|
947
1010
|
) -> Union[
|
|
948
1011
|
Tuple[
|
|
949
1012
|
Union[str, None],
|
|
@@ -1024,7 +1087,9 @@ class VannaBase(ABC):
|
|
|
1024
1087
|
display = __import__(
|
|
1025
1088
|
"IPython.display", fromlist=["display"]
|
|
1026
1089
|
).display
|
|
1027
|
-
Image = __import__(
|
|
1090
|
+
Image = __import__(
|
|
1091
|
+
"IPython.display", fromlist=["Image"]
|
|
1092
|
+
).Image
|
|
1028
1093
|
img_bytes = fig.to_image(format="png", scale=2)
|
|
1029
1094
|
display(Image(img_bytes))
|
|
1030
1095
|
except Exception as e:
|
|
@@ -1377,4 +1442,3 @@ class VannaBase(ABC):
|
|
|
1377
1442
|
fig.update_layout(template="plotly_dark")
|
|
1378
1443
|
|
|
1379
1444
|
return fig
|
|
1380
|
-
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from typing import List
|
|
3
2
|
import uuid
|
|
4
|
-
from
|
|
3
|
+
from typing import List
|
|
5
4
|
|
|
6
5
|
import chromadb
|
|
7
6
|
import pandas as pd
|
|
@@ -20,13 +19,28 @@ class ChromaDB_VectorStore(VannaBase):
|
|
|
20
19
|
if config is not None:
|
|
21
20
|
path = config.get("path", ".")
|
|
22
21
|
self.embedding_function = config.get("embedding_function", default_ef)
|
|
22
|
+
curr_client = config.get("client", "persistent")
|
|
23
|
+
self.n_results = config.get("n_results", 10)
|
|
23
24
|
else:
|
|
24
25
|
path = "."
|
|
25
26
|
self.embedding_function = default_ef
|
|
27
|
+
curr_client = "persistent" # defaults to persistent storage
|
|
28
|
+
self.n_results = 10 # defaults to 10 documents
|
|
29
|
+
|
|
30
|
+
if curr_client == "persistent":
|
|
31
|
+
self.chroma_client = chromadb.PersistentClient(
|
|
32
|
+
path=path, settings=Settings(anonymized_telemetry=False)
|
|
33
|
+
)
|
|
34
|
+
elif curr_client == "in-memory":
|
|
35
|
+
self.chroma_client = chromadb.EphemeralClient(
|
|
36
|
+
settings=Settings(anonymized_telemetry=False)
|
|
37
|
+
)
|
|
38
|
+
elif isinstance(curr_client, chromadb.api.client.Client):
|
|
39
|
+
# allow providing client directly
|
|
40
|
+
self.chroma_client = curr_client
|
|
41
|
+
else:
|
|
42
|
+
raise ValueError(f"Unsupported client was set in config: {curr_client}")
|
|
26
43
|
|
|
27
|
-
self.chroma_client = chromadb.PersistentClient(
|
|
28
|
-
path=path, settings=Settings(anonymized_telemetry=False)
|
|
29
|
-
)
|
|
30
44
|
self.documentation_collection = self.chroma_client.get_or_create_collection(
|
|
31
45
|
name="documentation", embedding_function=self.embedding_function
|
|
32
46
|
)
|
|
@@ -196,7 +210,8 @@ class ChromaDB_VectorStore(VannaBase):
|
|
|
196
210
|
query_results (pd.DataFrame): The dataframe to use.
|
|
197
211
|
|
|
198
212
|
Returns:
|
|
199
|
-
List[str] or None: The extracted documents, or an empty list or
|
|
213
|
+
List[str] or None: The extracted documents, or an empty list or
|
|
214
|
+
single document if an error occurred.
|
|
200
215
|
"""
|
|
201
216
|
if query_results is None:
|
|
202
217
|
return []
|
|
@@ -216,6 +231,7 @@ class ChromaDB_VectorStore(VannaBase):
|
|
|
216
231
|
return ChromaDB_VectorStore._extract_documents(
|
|
217
232
|
self.sql_collection.query(
|
|
218
233
|
query_texts=[question],
|
|
234
|
+
n_results=self.n_results,
|
|
219
235
|
)
|
|
220
236
|
)
|
|
221
237
|
|
|
@@ -7,6 +7,8 @@ import flask
|
|
|
7
7
|
import requests
|
|
8
8
|
from flask import Flask, Response, jsonify, request
|
|
9
9
|
|
|
10
|
+
from .assets import css_content, html_content, js_content
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
class Cache(ABC):
|
|
12
14
|
@abstractmethod
|
|
@@ -92,10 +94,11 @@ class VannaFlaskApp:
|
|
|
92
94
|
|
|
93
95
|
return decorator
|
|
94
96
|
|
|
95
|
-
def __init__(self, vn, cache: Cache = MemoryCache()):
|
|
97
|
+
def __init__(self, vn, cache: Cache = MemoryCache(), allow_llm_to_see_data=False):
|
|
96
98
|
self.flask_app = Flask(__name__)
|
|
97
99
|
self.vn = vn
|
|
98
100
|
self.cache = cache
|
|
101
|
+
self.allow_llm_to_see_data = allow_llm_to_see_data
|
|
99
102
|
|
|
100
103
|
log = logging.getLogger("werkzeug")
|
|
101
104
|
log.setLevel(logging.ERROR)
|
|
@@ -296,23 +299,55 @@ class VannaFlaskApp:
|
|
|
296
299
|
return jsonify({"type": "error", "error": str(e)})
|
|
297
300
|
|
|
298
301
|
@self.flask_app.route("/api/v0/generate_followup_questions", methods=["GET"])
|
|
299
|
-
@self.requires_cache(["df", "question"])
|
|
300
|
-
def generate_followup_questions(id: str, df, question):
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
302
|
+
@self.requires_cache(["df", "question", "sql"])
|
|
303
|
+
def generate_followup_questions(id: str, df, question, sql):
|
|
304
|
+
if self.allow_llm_to_see_data:
|
|
305
|
+
followup_questions = vn.generate_followup_questions(
|
|
306
|
+
question=question, sql=sql, df=df
|
|
307
|
+
)
|
|
308
|
+
if followup_questions is not None and len(followup_questions) > 5:
|
|
309
|
+
followup_questions = followup_questions[:5]
|
|
305
310
|
|
|
306
|
-
|
|
311
|
+
cache.set(id=id, field="followup_questions", value=followup_questions)
|
|
307
312
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
313
|
+
return jsonify(
|
|
314
|
+
{
|
|
315
|
+
"type": "question_list",
|
|
316
|
+
"id": id,
|
|
317
|
+
"questions": followup_questions,
|
|
318
|
+
"header": "Here are some potential followup questions:",
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
else:
|
|
322
|
+
return jsonify(
|
|
323
|
+
{
|
|
324
|
+
"type": "question_list",
|
|
325
|
+
"id": id,
|
|
326
|
+
"questions": [],
|
|
327
|
+
"header": "Followup Questions can be enabled if you set allow_llm_to_see_data=True",
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
@self.flask_app.route("/api/v0/generate_summary", methods=["GET"])
|
|
332
|
+
@self.requires_cache(["df", "question"])
|
|
333
|
+
def generate_summary(id: str, df, question):
|
|
334
|
+
if self.allow_llm_to_see_data:
|
|
335
|
+
summary = vn.generate_summary(question=question, df=df)
|
|
336
|
+
return jsonify(
|
|
337
|
+
{
|
|
338
|
+
"type": "text",
|
|
339
|
+
"id": id,
|
|
340
|
+
"text": summary,
|
|
341
|
+
}
|
|
342
|
+
)
|
|
343
|
+
else:
|
|
344
|
+
return jsonify(
|
|
345
|
+
{
|
|
346
|
+
"type": "text",
|
|
347
|
+
"id": id,
|
|
348
|
+
"text": "Summarization can be enabled if you set allow_llm_to_see_data=True",
|
|
349
|
+
}
|
|
350
|
+
)
|
|
316
351
|
|
|
317
352
|
@self.flask_app.route("/api/v0/load_question", methods=["GET"])
|
|
318
353
|
@self.requires_cache(
|
|
@@ -352,25 +387,14 @@ class VannaFlaskApp:
|
|
|
352
387
|
|
|
353
388
|
@self.flask_app.route("/assets/<path:filename>")
|
|
354
389
|
def proxy_assets(filename):
|
|
355
|
-
|
|
356
|
-
|
|
390
|
+
if ".css" in filename:
|
|
391
|
+
return Response(css_content, mimetype="text/css")
|
|
357
392
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
"transfer-encoding",
|
|
364
|
-
"connection",
|
|
365
|
-
]
|
|
366
|
-
headers = [
|
|
367
|
-
(name, value)
|
|
368
|
-
for (name, value) in response.raw.headers.items()
|
|
369
|
-
if name.lower() not in excluded_headers
|
|
370
|
-
]
|
|
371
|
-
return Response(response.content, response.status_code, headers)
|
|
372
|
-
else:
|
|
373
|
-
return "Error fetching file from remote server", response.status_code
|
|
393
|
+
if ".js" in filename:
|
|
394
|
+
return Response(js_content, mimetype="text/javascript")
|
|
395
|
+
|
|
396
|
+
# Return 404
|
|
397
|
+
return "File not found", 404
|
|
374
398
|
|
|
375
399
|
# Proxy the /vanna.svg file to the remote server
|
|
376
400
|
@self.flask_app.route("/vanna.svg")
|
|
@@ -398,24 +422,7 @@ class VannaFlaskApp:
|
|
|
398
422
|
@self.flask_app.route("/", defaults={"path": ""})
|
|
399
423
|
@self.flask_app.route("/<path:path>")
|
|
400
424
|
def hello(path: str):
|
|
401
|
-
return
|
|
402
|
-
<!doctype html>
|
|
403
|
-
<html lang="en">
|
|
404
|
-
<head>
|
|
405
|
-
<meta charset="UTF-8" />
|
|
406
|
-
<link rel="icon" type="image/svg+xml" href="/vanna.svg" />
|
|
407
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
408
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@350&display=swap" rel="stylesheet">
|
|
409
|
-
<script src="https://cdn.plot.ly/plotly-latest.min.js" type="text/javascript"></script>
|
|
410
|
-
<title>Vanna.AI</title>
|
|
411
|
-
<script type="module" crossorigin src="/assets/index-d29524f4.js"></script>
|
|
412
|
-
<link rel="stylesheet" href="/assets/index-b1a5a2f1.css">
|
|
413
|
-
</head>
|
|
414
|
-
<body class="bg-white dark:bg-slate-900">
|
|
415
|
-
<div id="app"></div>
|
|
416
|
-
</body>
|
|
417
|
-
</html>
|
|
418
|
-
"""
|
|
425
|
+
return html_content
|
|
419
426
|
|
|
420
427
|
def run(self):
|
|
421
428
|
try:
|
vanna/flask/assets.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
html_content = """<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vanna.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@350&display=swap" rel="stylesheet">
|
|
8
|
+
<script src="https://cdn.plot.ly/plotly-latest.min.js" type="text/javascript"></script>
|
|
9
|
+
<title>Vanna.AI</title>
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-e3ab6312.js"></script>
|
|
11
|
+
<link rel="stylesheet" href="/assets/index-1a6ba9fe.css">
|
|
12
|
+
</head>
|
|
13
|
+
<body class="bg-white dark:bg-slate-900">
|
|
14
|
+
<div id="app"></div>
|
|
15
|
+
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
css_content = """.nav-title{font-family:Roboto Slab,serif}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-px{left:1px;right:1px}.bottom-0{bottom:0}.bottom-px{bottom:1px}.left-0{left:0}.top-0{top:0}.z-10{z-index:10}.z-50{z-index:50}.z-\[60\]{z-index:60}.-m-1{margin:-.25rem}.-m-1\.5{margin:-.375rem}.m-3{margin:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-3{margin-right:.75rem}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[2\.375rem\]{height:2.375rem}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.min-h-\[15rem\]{min-height:15rem}.min-h-\[calc\(100\%-3\.5rem\)\]{min-height:calc(100% - 3.5rem)}.w-0{width:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-8{width:2rem}.w-\[2\.375rem\]{width:2.375rem}.w-\[3\.25rem\]{width:3.25rem}.w-full{width:100%}.w-px{width:1px}.min-w-full{min-width:100%}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-\[85rem\]{max-width:85rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-auto{flex:1 1 auto}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.-space-y-px>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(-1px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(-1px * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-b-md{border-bottom-right-radius:.375rem;border-bottom-left-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-\[3px\]{border-width:3px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity))}.border-current{border-color:currentColor}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity))}.border-t-transparent{border-top-color:transparent}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-12{padding-bottom:3rem}.pl-7{padding-left:1.75rem}.pr-4{padding-right:1rem}.pr-9{padding-right:2.25rem}.text-left{text-align:left}.text-center{text-align:center}.text-start{text-align:start}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.tracking-wide{letter-spacing:.025em}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity))}.opacity-0{opacity:0}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-transparent{--tw-ring-color: transparent}.ring-offset-white{--tw-ring-offset-color: #fff}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.before\:inline-block:before{content:var(--tw-content);display:inline-block}.before\:h-6:before{content:var(--tw-content);height:1.5rem}.before\:w-6:before{content:var(--tw-content);width:1.5rem}.before\:translate-x-0:before{content:var(--tw-content);--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.before\:transform:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.before\:rounded-full:before{content:var(--tw-content);border-radius:9999px}.before\:bg-white:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.before\:shadow:before{content:var(--tw-content);--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.before\:ring-0:before{content:var(--tw-content);--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.before\:transition:before{content:var(--tw-content);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.before\:duration-200:before{content:var(--tw-content);transition-duration:.2s}.before\:ease-in-out:before{content:var(--tw-content);transition-timing-function:cubic-bezier(.4,0,.2,1)}.first\:mt-0:first-child{margin-top:0}.first\:rounded-t-lg:first-child{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.last\:rounded-b-lg:last-child{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.checked\:bg-blue-600:checked{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.checked\:bg-none:checked{background-image:none}.checked\:before\:translate-x-full:checked:before{content:var(--tw-content);--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.checked\:before\:bg-blue-200:checked:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity))}.hover\:border-green-500:hover{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity))}.hover\:border-red-500:hover{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}.hover\:bg-blue-50:hover{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity))}.hover\:bg-blue-500:hover{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\:bg-green-500:hover{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity))}.hover\:bg-red-500:hover{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.hover\:text-blue-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.hover\:text-gray-400:hover{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.focus\:z-10:focus{z-index:10}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.focus\:border-blue-600:focus{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity))}.focus\:ring-blue-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(37 99 235 / var(--tw-ring-opacity))}.focus\:ring-gray-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus\:ring-green-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(187 247 208 / var(--tw-ring-opacity))}.focus\:ring-red-200:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(254 202 202 / var(--tw-ring-opacity))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus\:ring-offset-white:focus{--tw-ring-offset-color: #fff}.open.hs-overlay-open\:mt-7{margin-top:1.75rem}.open.hs-overlay-open\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.open.hs-overlay-open\:opacity-100{opacity:1}.open.hs-overlay-open\:duration-500{transition-duration:.5s}.open .hs-overlay-open\:mt-7{margin-top:1.75rem}.open .hs-overlay-open\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.open .hs-overlay-open\:opacity-100{opacity:1}.open .hs-overlay-open\:duration-500{transition-duration:.5s}@media (prefers-color-scheme: dark){.dark\:divide-gray-700>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity))}.dark\:border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.dark\:border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.dark\:border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.dark\:bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.dark\:bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\:bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}.dark\:bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity))}.dark\:bg-opacity-80{--tw-bg-opacity: .8}.dark\:text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.dark\:text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.dark\:text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.dark\:text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.dark\:text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.dark\:text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.dark\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}.dark\:placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity))}.dark\:shadow-slate-700\/\[\.7\]{--tw-shadow-color: rgb(51 65 85 / .7);--tw-shadow: var(--tw-shadow-colored)}.dark\:before\:bg-gray-400:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.dark\:checked\:border-blue-500:checked{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.dark\:checked\:bg-blue-500:checked{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.dark\:checked\:bg-blue-600:checked{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.dark\:checked\:before\:bg-blue-200:checked:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity))}.dark\:hover\:border-blue-400:hover{--tw-border-opacity: 1;border-color:rgb(96 165 250 / var(--tw-border-opacity))}.dark\:hover\:bg-gray-900:hover{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.dark\:hover\:bg-slate-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}.dark\:hover\:text-blue-400:hover{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.dark\:hover\:text-slate-300:hover{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}.dark\:hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.dark\:focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity))}.dark\:focus\:ring-gray-700:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity))}.dark\:focus\:ring-offset-gray-800:focus{--tw-ring-offset-color: #1f2937}}@media (min-width: 640px){.sm\:mx-auto{margin-left:auto;margin-right:auto}.sm\:mb-3{margin-bottom:.75rem}.sm\:mt-10{margin-top:2.5rem}.sm\:w-full{width:100%}.sm\:max-w-lg{max-width:32rem}.sm\:gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.sm\:p-4{padding:1rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\:py-6{padding-top:1.5rem;padding-bottom:1.5rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}}@media (min-width: 768px){.md\:flex{display:flex}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:p-10{padding:2.5rem}.md\:p-5{padding:1.25rem}}@media (min-width: 1024px){.lg\:bottom-0{bottom:0}.lg\:right-auto{right:auto}.lg\:block{display:block}.lg\:hidden{display:none}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:py-14{padding-top:3.5rem;padding-bottom:3.5rem}.lg\:pl-64{padding-left:16rem}}
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
js_content = """var yr=Object.defineProperty;var br=(r,e,n)=>e in r?yr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n;var tn=(r,e,n)=>(br(r,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))t(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&t(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function t(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function se(){}function vr(r,e){for(const n in e)r[n]=e[n];return r}function rr(r){return r()}function xn(){return Object.create(null)}function ot(r){r.forEach(rr)}function pt(r){return typeof r=="function"}function xe(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}let Vt;function or(r,e){return r===e?!0:(Vt||(Vt=document.createElement("a")),Vt.href=e,r===Vt.href)}function _r(r){return Object.keys(r).length===0}function Gt(r,e,n,t){if(r){const o=ir(r,e,n,t);return r[0](o)}}function ir(r,e,n,t){return r[1]&&t?vr(n.ctx.slice(),r[1](t(e))):n.ctx}function Ut(r,e,n,t){if(r[2]&&t){const o=r[2](t(n));if(e.dirty===void 0)return o;if(typeof o=="object"){const i=[],s=Math.max(e.dirty.length,o.length);for(let l=0;l<s;l+=1)i[l]=e.dirty[l]|o[l];return i}return e.dirty|o}return e.dirty}function Zt(r,e,n,t,o,i){if(o){const s=ir(e,n,t,i);r.p(s,o)}}function Wt(r){if(r.ctx.length>32){const e=[],n=r.ctx.length/32;for(let t=0;t<n;t++)e[t]=-1;return e}return-1}function w(r,e){r.appendChild(e)}function U(r,e,n){r.insertBefore(e,n||null)}function G(r){r.parentNode&&r.parentNode.removeChild(r)}function Je(r,e){for(let n=0;n<r.length;n+=1)r[n]&&r[n].d(e)}function E(r){return document.createElement(r)}function Pt(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function we(r){return document.createTextNode(r)}function Z(){return we(" ")}function nt(){return we("")}function je(r,e,n,t){return r.addEventListener(e,n,t),()=>r.removeEventListener(e,n,t)}function v(r,e,n){n==null?r.removeAttribute(e):r.getAttribute(e)!==n&&r.setAttribute(e,n)}function wr(r){let e;return{p(...n){e=n,e.forEach(t=>r.push(t))},r(){e.forEach(n=>r.splice(r.indexOf(n),1))}}}function kr(r){return Array.from(r.childNodes)}function Ve(r,e){e=""+e,r.data!==e&&(r.data=e)}function bt(r,e){r.value=e??""}let Dt;function qt(r){Dt=r}function xr(){if(!Dt)throw new Error("Function called outside component initialization");return Dt}function sr(r){xr().$$.on_mount.push(r)}const St=[],At=[];let Ot=[];const sn=[],$r=Promise.resolve();let ln=!1;function Sr(){ln||(ln=!0,$r.then(lr))}function an(r){Ot.push(r)}function nn(r){sn.push(r)}const rn=new Set;let $t=0;function lr(){if($t!==0)return;const r=Dt;do{try{for(;$t<St.length;){const e=St[$t];$t++,qt(e),Or(e.$$)}}catch(e){throw St.length=0,$t=0,e}for(qt(null),St.length=0,$t=0;At.length;)At.pop()();for(let e=0;e<Ot.length;e+=1){const n=Ot[e];rn.has(n)||(rn.add(n),n())}Ot.length=0}while(St.length);for(;sn.length;)sn.pop()();ln=!1,rn.clear(),qt(r)}function Or(r){if(r.fragment!==null){r.update(),ot(r.before_update);const e=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,e),r.after_update.forEach(an)}}function Lr(r){const e=[],n=[];Ot.forEach(t=>r.indexOf(t)===-1?e.push(t):n.push(t)),n.forEach(t=>t()),Ot=e}const zt=new Set;let yt;function Ne(){yt={r:0,c:[],p:yt}}function Qe(){yt.r||ot(yt.c),yt=yt.p}function M(r,e){r&&r.i&&(zt.delete(r),r.i(e))}function I(r,e,n,t){if(r&&r.o){if(zt.has(r))return;zt.add(r),yt.c.push(()=>{zt.delete(r),t&&(n&&r.d(1),t())}),r.o(e)}else t&&t()}function _e(r){return(r==null?void 0:r.length)!==void 0?r:Array.from(r)}function on(r,e,n){const t=r.$$.props[e];t!==void 0&&(r.$$.bound[t]=n,n(r.$$.ctx[t]))}function J(r){r&&r.c()}function F(r,e,n){const{fragment:t,after_update:o}=r.$$;t&&t.m(e,n),an(()=>{const i=r.$$.on_mount.map(rr).filter(pt);r.$$.on_destroy?r.$$.on_destroy.push(...i):ot(i),r.$$.on_mount=[]}),o.forEach(an)}function Y(r,e){const n=r.$$;n.fragment!==null&&(Lr(n.after_update),ot(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Tr(r,e){r.$$.dirty[0]===-1&&(St.push(r),Sr(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<<e%31}function $e(r,e,n,t,o,i,s,l=[-1]){const c=Dt;qt(r);const a=r.$$={fragment:null,ctx:[],props:i,update:se,not_equal:o,bound:xn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:xn(),dirty:l,skip_bound:!1,root:e.target||c.$$.root};s&&s(a.root);let d=!1;if(a.ctx=n?n(r,e.props||{},(g,k,...x)=>{const D=x.length?x[0]:k;return a.ctx&&o(a.ctx[g],a.ctx[g]=D)&&(!a.skip_bound&&a.bound[g]&&a.bound[g](D),d&&Tr(r,g)),k}):[],a.update(),d=!0,ot(a.before_update),a.fragment=t?t(a.ctx):!1,e.target){if(e.hydrate){const g=kr(e.target);a.fragment&&a.fragment.l(g),g.forEach(G)}else a.fragment&&a.fragment.c();e.intro&&M(r.$$.fragment),F(r,e.target,e.anchor),lr()}qt(c)}class Se{constructor(){tn(this,"$$");tn(this,"$$set")}$destroy(){Y(this,1),this.$destroy=se}$on(e,n){if(!pt(n))return se;const t=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return t.push(n),()=>{const o=t.indexOf(n);o!==-1&&t.splice(o,1)}}$set(e){this.$$set&&!_r(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Er="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Er);function $n(r,e,n){const t=r.slice();return t[4]=e[n],t[6]=n,t}function Sn(r){let e;return{c(){e=E("span"),e.innerHTML="",v(e,"class","inline")},m(n,t){U(n,e,t)},d(n){n&&G(e)}}}function On(r){let e,n=r[4]+"",t,o,i,s,l=r[6]<r[0]&&Sn();return{c(){e=E("span"),t=we(n),i=Z(),l&&l.c(),s=nt(),v(e,"class",o=r[6]<r[0]?"inline":"hidden")},m(c,a){U(c,e,a),w(e,t),U(c,i,a),l&&l.m(c,a),U(c,s,a)},p(c,a){a&1&&o!==(o=c[6]<c[0]?"inline":"hidden")&&v(e,"class",o),c[6]<c[0]?l||(l=Sn(),l.c(),l.m(s.parentNode,s)):l&&(l.d(1),l=null)},d(c){c&&(G(e),G(i),G(s)),l&&l.d(c)}}}function Cr(r){let e,n=_e(r[1]),t=[];for(let o=0;o<n.length;o+=1)t[o]=On($n(r,n,o));return{c(){for(let o=0;o<t.length;o+=1)t[o].c();e=nt()},m(o,i){for(let s=0;s<t.length;s+=1)t[s]&&t[s].m(o,i);U(o,e,i)},p(o,[i]){if(i&3){n=_e(o[1]);let s;for(s=0;s<n.length;s+=1){const l=$n(o,n,s);t[s]?t[s].p(l,i):(t[s]=On(l),t[s].c(),t[s].m(e.parentNode,e))}for(;s<t.length;s+=1)t[s].d(1);t.length=n.length}},i:se,o:se,d(o){o&&G(e),Je(t,o)}}}function jr(r,e,n){let{text:t}=e,o=t.split(" "),i=0;return setInterval(()=>{i<o.length&&n(0,i++,i)},100),r.$$set=l=>{"text"in l&&n(2,t=l.text)},[i,o,t]}class Pr extends Se{constructor(e){super(),$e(this,e,jr,Cr,xe,{text:2})}}function Ln(r,e,n){const t=r.slice();return t[5]=e[n],t}function Tn(r){let e,n,t,o,i,s=r[5].question+"",l,c,a,d;function g(){return r[4](r[5])}return{c(){e=E("li"),n=E("button"),t=Pt("svg"),o=Pt("path"),i=Z(),l=we(s),c=Z(),v(o,"stroke-linecap","round"),v(o,"stroke-linejoin","round"),v(o,"d","M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"),v(t,"class","w-3.5 h-3.5"),v(t,"fill","none"),v(t,"stroke","currentColor"),v(t,"stroke-width","1.5"),v(t,"viewBox","0 0 24 24"),v(t,"xmlns","http://www.w3.org/2000/svg"),v(t,"aria-hidden","true"),v(n,"class","flex items-center text-left gap-x-3 py-2 px-3 text-sm text-slate-700 rounded-md hover:bg-gray-100 dark:hover:bg-gray-900 dark:text-slate-400 dark:hover:text-slate-300")},m(k,x){U(k,e,x),w(e,n),w(n,t),w(t,o),w(n,i),w(n,l),w(e,c),a||(d=je(n,"click",g),a=!0)},p(k,x){r=k,x&8&&s!==(s=r[5].question+"")&&Ve(l,s)},d(k){k&&G(e),a=!1,d()}}}function qr(r){let e,n,t,o,i,s,l,c,a,d,g,k,x,D,L,m,h=_e(r[3]),p=[];for(let _=0;_<h.length;_+=1)p[_]=Tn(Ln(r,h,_));return{c(){e=E("div"),n=E("nav"),t=E("div"),t.innerHTML='<img class="w-28 h-auto" src="https://img.vanna.ai/vanna-flask.svg" alt="Vanna Logo"/> <div class="lg:hidden"><button type="button" class="w-8 h-8 inline-flex justify-center items-center gap-2 rounded-md text-gray-700 align-middle focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-blue-600 transition-all dark:text-gray-400 dark:focus:ring-offset-gray-800" data-hs-overlay="#application-sidebar" aria-controls="application-sidebar" aria-label="Toggle navigation"><svg class="w-4 h-4" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"></path></svg> <span class="sr-only">Sidebar</span></button></div>',o=Z(),i=E("div"),s=E("ul"),l=E("li"),c=E("button"),c.innerHTML=`<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M4.26 10.147a60.436 60.436 0 00-.491 6.347A48.627 48.627 0 0112 20.904a48.627 48.627 0 018.232-4.41 60.46 60.46 0 00-.491-6.347m-15.482 0a50.57 50.57 0 00-2.658-.813A59.905 59.905 0 0112 3.493a59.902 59.902 0 0110.399 5.84c-.896.248-1.783.52-2.658.814m-15.482 0A50.697 50.697 0 0112 13.489a50.702 50.702 0 017.74-3.342M6.75 15a.75.75 0 100-1.5.75.75 0 000 1.5zm0 0v-3.675A55.378 55.378 0 0112 8.443m-7.007 11.55A5.981 5.981 0 006.75 15.75v-1.5"></path></svg>
|
|
24
|
+
Training Data`,a=Z(),d=E("li"),g=E("button"),g.innerHTML=`<svg class="w-3.5 h-3.5" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 2C8.47339 2 8.85714 2.38376 8.85714 2.85714V7.14286L13.1429 7.14286C13.6162 7.14286 14 7.52661 14 8C14 8.47339 13.6162 8.85714 13.1429 8.85714L8.85714 8.85715V13.1429C8.85714 13.6162 8.47339 14 8 14C7.52661 14 7.14286 13.6162 7.14286 13.1429V8.85715L2.85714 8.85715C2.38376 8.85715 2 8.4734 2 8.00001C2 7.52662 2.38376 7.14287 2.85714 7.14287L7.14286 7.14286V2.85714C7.14286 2.38376 7.52661 2 8 2Z" fill="currentColor"></path></svg>
|
|
25
|
+
New question`,k=Z();for(let _=0;_<p.length;_+=1)p[_].c();x=Z(),D=E("div"),D.innerHTML=`<div class="py-2.5 px-7"><p class="inline-flex items-center gap-x-2 text-xs text-green-600"><span class="block w-1.5 h-1.5 rounded-full bg-green-600"></span>
|
|
26
|
+
Connected</p></div> <div class="p-4 border-t border-gray-200 dark:border-gray-700"><a class="flex justify-between items-center gap-x-3 py-2 px-3 text-sm text-slate-700 rounded-md hover:bg-gray-100 dark:hover:bg-gray-900 dark:text-slate-400 dark:hover:text-slate-300" href="#replace">Sign out
|
|
27
|
+
<svg class="w-3.5 h-3.5" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M10 3.5a.5.5 0 0 0-.5-.5h-8a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 1 1 0v2A1.5 1.5 0 0 1 9.5 14h-8A1.5 1.5 0 0 1 0 12.5v-9A1.5 1.5 0 0 1 1.5 2h8A1.5 1.5 0 0 1 11 3.5v2a.5.5 0 0 1-1 0v-2z"></path><path fill-rule="evenodd" d="M4.146 8.354a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5H14.5a.5.5 0 0 1 0 1H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3z"></path></svg></a></div>`,v(t,"class","flex items-center justify-between py-4 pr-4 pl-7"),v(c,"class","flex items-center gap-x-3 py-2 px-3 text-sm text-slate-700 rounded-md hover:bg-gray-100 dark:hover:bg-gray-900 dark:text-slate-400 dark:hover:text-slate-300 border-t border-b border-gray-200 dark:border-gray-700 w-full"),v(g,"class","flex items-center gap-x-3 py-2 px-3 text-sm text-slate-700 rounded-md hover:bg-gray-100 dark:hover:bg-gray-900 dark:text-slate-400 dark:hover:text-slate-300"),v(s,"class","space-y-1.5 p-4"),v(i,"class","h-full"),v(D,"class","mt-auto"),v(n,"class","hs-accordion-group w-full h-full flex flex-col"),v(n,"data-hs-accordion-always-open",""),v(e,"id","application-sidebar"),v(e,"class","hs-overlay hs-overlay-open:translate-x-0 -translate-x-full transition-all duration-300 transform hidden fixed top-0 left-0 bottom-0 z-[60] w-64 bg-white border-r border-gray-200 overflow-y-auto scrollbar-y lg:block lg:translate-x-0 lg:right-auto lg:bottom-0 dark:scrollbar-y dark:bg-slate-900 dark:border-gray-700")},m(_,A){U(_,e,A),w(e,n),w(n,t),w(n,o),w(n,i),w(i,s),w(s,l),w(l,c),w(s,a),w(s,d),w(d,g),w(s,k);for(let P=0;P<p.length;P+=1)p[P]&&p[P].m(s,null);w(n,x),w(n,D),L||(m=[je(c,"click",function(){pt(r[0])&&r[0].apply(this,arguments)}),je(g,"click",function(){pt(r[1])&&r[1].apply(this,arguments)})],L=!0)},p(_,[A]){if(r=_,A&12){h=_e(r[3]);let P;for(P=0;P<h.length;P+=1){const T=Ln(r,h,P);p[P]?p[P].p(T,A):(p[P]=Tn(T),p[P].c(),p[P].m(s,null))}for(;P<p.length;P+=1)p[P].d(1);p.length=h.length}},i:se,o:se,d(_){_&&G(e),Je(p,_),L=!1,ot(m)}}}function Ar(r,e,n){let{getTrainingData:t}=e,{newQuestionPage:o}=e,{loadQuestionPage:i}=e,{questionHistory:s}=e;const l=c=>{i(c.id)};return r.$$set=c=>{"getTrainingData"in c&&n(0,t=c.getTrainingData),"newQuestionPage"in c&&n(1,o=c.newQuestionPage),"loadQuestionPage"in c&&n(2,i=c.loadQuestionPage),"questionHistory"in c&&n(3,s=c.questionHistory)},[t,o,i,s,l]}class Dr extends Se{constructor(e){super(),$e(this,e,Ar,qr,xe,{getTrainingData:0,newQuestionPage:1,loadQuestionPage:2,questionHistory:3})}}var Hr={exports:{}};/*! For license information please see preline.js.LICENSE.txt */(function(r,e){(function(n,t){r.exports=t()})(self,function(){return(()=>{var n={661:(s,l,c)=>{function a(L){return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},a(L)}function d(L,m){for(var h=0;h<m.length;h++){var p=m[h];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,p.key,p)}}function g(L,m){return g=Object.setPrototypeOf||function(h,p){return h.__proto__=p,h},g(L,m)}function k(L,m){if(m&&(a(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}(L)}function x(L){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},x(L)}var D=function(L){(function(T,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(u&&u.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),Object.defineProperty(T,"prototype",{writable:!1}),u&&g(T,u)})(P,L);var m,h,p,_,A=(p=P,_=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var T,u=x(p);if(_){var f=x(this).constructor;T=Reflect.construct(u,arguments,f)}else T=u.apply(this,arguments);return k(this,T)});function P(){return function(T,u){if(!(T instanceof u))throw new TypeError("Cannot call a class as a function")}(this,P),A.call(this,".hs-accordion")}return m=P,(h=[{key:"init",value:function(){var T=this;document.addEventListener("click",function(u){var f=u.target,O=f.closest(T.selector),C=f.closest(".hs-accordion-toggle"),S=f.closest(".hs-accordion-group");O&&S&&C&&(T._hideAll(O),T.show(O))})}},{key:"show",value:function(T){var u=this;if(T.classList.contains("active"))return this.hide(T);T.classList.add("active");var f=T.querySelector(".hs-accordion-content");f.style.display="block",f.style.height=0,setTimeout(function(){f.style.height="".concat(f.scrollHeight,"px")}),this.afterTransition(f,function(){T.classList.contains("active")&&(f.style.height="",u._fireEvent("open",T),u._dispatch("open.hs.accordion",T,T))})}},{key:"hide",value:function(T){var u=this,f=T.querySelector(".hs-accordion-content");f.style.height="".concat(f.scrollHeight,"px"),setTimeout(function(){f.style.height=0}),this.afterTransition(f,function(){T.classList.contains("active")||(f.style.display="",u._fireEvent("hide",T),u._dispatch("hide.hs.accordion",T,T))}),T.classList.remove("active")}},{key:"_hideAll",value:function(T){var u=this,f=T.closest(".hs-accordion-group");f.hasAttribute("data-hs-accordion-always-open")||f.querySelectorAll(this.selector).forEach(function(O){T!==O&&u.hide(O)})}}])&&d(m.prototype,h),Object.defineProperty(m,"prototype",{writable:!1}),P}(c(765).Z);window.HSAccordion=new D,document.addEventListener("load",window.HSAccordion.init())},795:(s,l,c)=>{function a(m){return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},a(m)}function d(m,h){(h==null||h>m.length)&&(h=m.length);for(var p=0,_=new Array(h);p<h;p++)_[p]=m[p];return _}function g(m,h){for(var p=0;p<h.length;p++){var _=h[p];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}function k(m,h){return k=Object.setPrototypeOf||function(p,_){return p.__proto__=_,p},k(m,h)}function x(m,h){if(h&&(a(h)==="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}(m)}function D(m){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(h){return h.__proto__||Object.getPrototypeOf(h)},D(m)}var L=function(m){(function(u,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(f&&f.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),f&&k(u,f)})(T,m);var h,p,_,A,P=(_=T,A=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var u,f=D(_);if(A){var O=D(this).constructor;u=Reflect.construct(f,arguments,O)}else u=f.apply(this,arguments);return x(this,u)});function T(){return function(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}(this,T),P.call(this,"[data-hs-collapse]")}return h=T,(p=[{key:"init",value:function(){var u=this;document.addEventListener("click",function(f){var O=f.target.closest(u.selector);if(O){var C=document.querySelectorAll(O.getAttribute("data-hs-collapse"));u.toggle(C)}})}},{key:"toggle",value:function(u){var f,O=this;u.length&&(f=u,function(C){if(Array.isArray(C))return d(C)}(f)||function(C){if(typeof Symbol<"u"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}(f)||function(C,S){if(C){if(typeof C=="string")return d(C,S);var j=Object.prototype.toString.call(C).slice(8,-1);return j==="Object"&&C.constructor&&(j=C.constructor.name),j==="Map"||j==="Set"?Array.from(C):j==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(j)?d(C,S):void 0}}(f)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
28
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()).forEach(function(C){C.classList.contains("hidden")?O.show(C):O.hide(C)})}},{key:"show",value:function(u){var f=this;u.classList.add("open"),u.classList.remove("hidden"),u.style.height=0,document.querySelectorAll(this.selector).forEach(function(O){u.closest(O.getAttribute("data-hs-collapse"))&&O.classList.add("open")}),u.style.height="".concat(u.scrollHeight,"px"),this.afterTransition(u,function(){u.classList.contains("open")&&(u.style.height="",f._fireEvent("open",u),f._dispatch("open.hs.collapse",u,u))})}},{key:"hide",value:function(u){var f=this;u.style.height="".concat(u.scrollHeight,"px"),setTimeout(function(){u.style.height=0}),u.classList.remove("open"),this.afterTransition(u,function(){u.classList.contains("open")||(u.classList.add("hidden"),u.style.height=null,f._fireEvent("hide",u),f._dispatch("hide.hs.collapse",u,u),u.querySelectorAll(".hs-mega-menu-content.block").forEach(function(O){O.classList.remove("block"),O.classList.add("hidden")}))}),document.querySelectorAll(this.selector).forEach(function(O){u.closest(O.getAttribute("data-hs-collapse"))&&O.classList.remove("open")})}}])&&g(h.prototype,p),Object.defineProperty(h,"prototype",{writable:!1}),T}(c(765).Z);window.HSCollapse=new L,document.addEventListener("load",window.HSCollapse.init())},682:(s,l,c)=>{var a=c(714),d=c(765);const g={historyIndex:-1,addHistory:function(A){this.historyIndex=A},existsInHistory:function(A){return A>this.historyIndex},clearHistory:function(){this.historyIndex=-1}};function k(A){return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},k(A)}function x(A){return function(P){if(Array.isArray(P))return D(P)}(A)||function(P){if(typeof Symbol<"u"&&P[Symbol.iterator]!=null||P["@@iterator"]!=null)return Array.from(P)}(A)||function(P,T){if(P){if(typeof P=="string")return D(P,T);var u=Object.prototype.toString.call(P).slice(8,-1);return u==="Object"&&P.constructor&&(u=P.constructor.name),u==="Map"||u==="Set"?Array.from(P):u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u)?D(P,T):void 0}}(A)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
29
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function D(A,P){(P==null||P>A.length)&&(P=A.length);for(var T=0,u=new Array(P);T<P;T++)u[T]=A[T];return u}function L(A,P){for(var T=0;T<P.length;T++){var u=P[T];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(A,u.key,u)}}function m(A,P){return m=Object.setPrototypeOf||function(T,u){return T.__proto__=u,T},m(A,P)}function h(A,P){if(P&&(k(P)==="object"||typeof P=="function"))return P;if(P!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}(A)}function p(A){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(P){return P.__proto__||Object.getPrototypeOf(P)},p(A)}var _=function(A){(function(S,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(j&&j.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),Object.defineProperty(S,"prototype",{writable:!1}),j&&m(S,j)})(C,A);var P,T,u,f,O=(u=C,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var S,j=p(u);if(f){var R=p(this).constructor;S=Reflect.construct(j,arguments,R)}else S=j.apply(this,arguments);return h(this,S)});function C(){var S;return function(j,R){if(!(j instanceof R))throw new TypeError("Cannot call a class as a function")}(this,C),(S=O.call(this,".hs-dropdown")).positions={top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-top":"right-start","right-bottom":"right-end",left:"left","left-top":"left-start","left-bottom":"left-end"},S.absoluteStrategyModifiers=function(j){return[{name:"applyStyles",fn:function(R){var q=(window.getComputedStyle(j).getPropertyValue("--strategy")||"absolute").replace(" ",""),B=(window.getComputedStyle(j).getPropertyValue("--adaptive")||"adaptive").replace(" ","");R.state.elements.popper.style.position=q,R.state.elements.popper.style.transform=B==="adaptive"?R.state.styles.popper.transform:null,R.state.elements.popper.style.top=null,R.state.elements.popper.style.bottom=null,R.state.elements.popper.style.left=null,R.state.elements.popper.style.right=null,R.state.elements.popper.style.margin=0}},{name:"computeStyles",options:{adaptive:!1}}]},S._history=g,S}return P=C,T=[{key:"init",value:function(){var S=this;document.addEventListener("click",function(j){var R=j.target,q=R.closest(S.selector),B=R.closest(".hs-dropdown-menu");if(q&&q.classList.contains("open")||S._closeOthers(q),B){var N=(window.getComputedStyle(q).getPropertyValue("--auto-close")||"").replace(" ","");if((N=="false"||N=="inside")&&!q.parentElement.closest(S.selector))return}q&&(q.classList.contains("open")?S.close(q):S.open(q))}),document.addEventListener("mousemove",function(j){var R=j.target,q=R.closest(S.selector);if(R.closest(".hs-dropdown-menu"),q){var B=(window.getComputedStyle(q).getPropertyValue("--trigger")||"click").replace(" ","");if(B!=="hover")return;q&&q.classList.contains("open")||S._closeOthers(q),B!=="hover"||q.classList.contains("open")||/iPad|iPhone|iPod/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)||S._hover(R)}}),document.addEventListener("keydown",this._keyboardSupport.bind(this)),window.addEventListener("resize",function(){document.querySelectorAll(".hs-dropdown.open").forEach(function(j){S.close(j,!0)})})}},{key:"_closeOthers",value:function(){var S=this,j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,R=document.querySelectorAll("".concat(this.selector,".open"));R.forEach(function(q){if(!j||j.closest(".hs-dropdown.open")!==q){var B=(window.getComputedStyle(q).getPropertyValue("--auto-close")||"").replace(" ","");B!="false"&&B!="outside"&&S.close(q)}})}},{key:"_hover",value:function(S){var j=this,R=S.closest(this.selector);this.open(R),document.addEventListener("mousemove",function q(B){B.target.closest(j.selector)&&B.target.closest(j.selector)!==R.parentElement.closest(j.selector)||(j.close(R),document.removeEventListener("mousemove",q,!0))},!0)}},{key:"close",value:function(S){var j=this,R=arguments.length>1&&arguments[1]!==void 0&&arguments[1],q=S.querySelector(".hs-dropdown-menu"),B=function(){S.classList.contains("open")||(q.classList.remove("block"),q.classList.add("hidden"),q.style.inset=null,q.style.position=null,S._popper&&S._popper.destroy())};R||this.afterTransition(S.querySelector("[data-hs-dropdown-transition]")||q,function(){B()}),q.style.margin=null,S.classList.remove("open"),R&&B(),this._fireEvent("close",S),this._dispatch("close.hs.dropdown",S,S);var N=q.querySelectorAll(".hs-dropdown.open");N.forEach(function(ie){j.close(ie,!0)})}},{key:"open",value:function(S){var j=S.querySelector(".hs-dropdown-menu"),R=(window.getComputedStyle(S).getPropertyValue("--placement")||"").replace(" ",""),q=(window.getComputedStyle(S).getPropertyValue("--strategy")||"fixed").replace(" ",""),B=((window.getComputedStyle(S).getPropertyValue("--adaptive")||"adaptive").replace(" ",""),parseInt((window.getComputedStyle(S).getPropertyValue("--offset")||"10").replace(" ","")));if(q!=="static"){S._popper&&S._popper.destroy();var N=(0,a.fi)(S,j,{placement:this.positions[R]||"bottom-start",strategy:q,modifiers:[].concat(x(q!=="fixed"?this.absoluteStrategyModifiers(S):[]),[{name:"offset",options:{offset:[0,B]}}])});S._popper=N}j.style.margin=null,j.classList.add("block"),j.classList.remove("hidden"),setTimeout(function(){S.classList.add("open")}),this._fireEvent("open",S),this._dispatch("open.hs.dropdown",S,S)}},{key:"_keyboardSupport",value:function(S){var j=document.querySelector(".hs-dropdown.open");if(j)return S.keyCode===27?(S.preventDefault(),this._esc(j)):S.keyCode===40?(S.preventDefault(),this._down(j)):S.keyCode===38?(S.preventDefault(),this._up(j)):S.keyCode===36?(S.preventDefault(),this._start(j)):S.keyCode===35?(S.preventDefault(),this._end(j)):void this._byChar(j,S.key)}},{key:"_esc",value:function(S){this.close(S)}},{key:"_up",value:function(S){var j=S.querySelector(".hs-dropdown-menu"),R=x(j.querySelectorAll("a")).reverse().filter(function(N){return!N.disabled}),q=j.querySelector("a:focus"),B=R.findIndex(function(N){return N===q});B+1<R.length&&B++,R[B].focus()}},{key:"_down",value:function(S){var j=S.querySelector(".hs-dropdown-menu"),R=x(j.querySelectorAll("a")).filter(function(N){return!N.disabled}),q=j.querySelector("a:focus"),B=R.findIndex(function(N){return N===q});B+1<R.length&&B++,R[B].focus()}},{key:"_start",value:function(S){var j=x(S.querySelector(".hs-dropdown-menu").querySelectorAll("a")).filter(function(R){return!R.disabled});j.length&&j[0].focus()}},{key:"_end",value:function(S){var j=x(S.querySelector(".hs-dropdown-menu").querySelectorAll("a")).reverse().filter(function(R){return!R.disabled});j.length&&j[0].focus()}},{key:"_byChar",value:function(S,j){var R=this,q=x(S.querySelector(".hs-dropdown-menu").querySelectorAll("a")),B=function(){return q.findIndex(function(ie,re){return ie.innerText.toLowerCase().charAt(0)===j.toLowerCase()&&R._history.existsInHistory(re)})},N=B();N===-1&&(this._history.clearHistory(),N=B()),N!==-1&&(q[N].focus(),this._history.addHistory(N))}},{key:"toggle",value:function(S){S.classList.contains("open")?this.close(S):this.open(S)}}],T&&L(P.prototype,T),Object.defineProperty(P,"prototype",{writable:!1}),C}(d.Z);window.HSDropdown=new _,document.addEventListener("load",window.HSDropdown.init())},284:(s,l,c)=>{function a(m){return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},a(m)}function d(m,h){(h==null||h>m.length)&&(h=m.length);for(var p=0,_=new Array(h);p<h;p++)_[p]=m[p];return _}function g(m,h){for(var p=0;p<h.length;p++){var _=h[p];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}function k(m,h){return k=Object.setPrototypeOf||function(p,_){return p.__proto__=_,p},k(m,h)}function x(m,h){if(h&&(a(h)==="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}(m)}function D(m){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(h){return h.__proto__||Object.getPrototypeOf(h)},D(m)}var L=function(m){(function(u,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(f&&f.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),f&&k(u,f)})(T,m);var h,p,_,A,P=(_=T,A=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var u,f=D(_);if(A){var O=D(this).constructor;u=Reflect.construct(f,arguments,O)}else u=f.apply(this,arguments);return x(this,u)});function T(){var u;return function(f,O){if(!(f instanceof O))throw new TypeError("Cannot call a class as a function")}(this,T),(u=P.call(this,"[data-hs-overlay]")).openNextOverlay=!1,u}return h=T,(p=[{key:"init",value:function(){var u=this;document.addEventListener("click",function(f){var O=f.target.closest(u.selector),C=f.target.closest("[data-hs-overlay-close]"),S=f.target.getAttribute("aria-overlay")==="true";return C?u.close(C.closest(".hs-overlay.open")):O?u.toggle(document.querySelector(O.getAttribute("data-hs-overlay"))):void(S&&u._onBackdropClick(f.target))}),document.addEventListener("keydown",function(f){if(f.keyCode===27){var O=document.querySelector(".hs-overlay.open");if(!O)return;setTimeout(function(){O.getAttribute("data-hs-overlay-keyboard")!=="false"&&u.close(O)})}})}},{key:"toggle",value:function(u){u&&(u.classList.contains("hidden")?this.open(u):this.close(u))}},{key:"open",value:function(u){var f=this;if(u){var O=document.querySelector(".hs-overlay.open"),C=this.getClassProperty(u,"--body-scroll","false")!=="true";if(O)return this.openNextOverlay=!0,this.close(O).then(function(){f.open(u),f.openNextOverlay=!1});C&&(document.body.style.overflow="hidden"),this._buildBackdrop(u),this._checkTimer(u),this._autoHide(u),u.classList.remove("hidden"),u.setAttribute("aria-overlay","true"),u.setAttribute("tabindex","-1"),setTimeout(function(){u.classList.contains("hidden")||(u.classList.add("open"),f._fireEvent("open",u),f._dispatch("open.hs.overlay",u,u),f._focusInput(u))},50)}}},{key:"close",value:function(u){var f=this;return new Promise(function(O){u&&(u.classList.remove("open"),u.removeAttribute("aria-overlay"),u.removeAttribute("tabindex","-1"),f.afterTransition(u,function(){u.classList.contains("open")||(u.classList.add("hidden"),f._destroyBackdrop(),f._fireEvent("close",u),f._dispatch("close.hs.overlay",u,u),document.body.style.overflow="",O(u))}))})}},{key:"_autoHide",value:function(u){var f=this,O=parseInt(this.getClassProperty(u,"--auto-hide","0"));O&&(u.autoHide=setTimeout(function(){f.close(u)},O))}},{key:"_checkTimer",value:function(u){u.autoHide&&(clearTimeout(u.autoHide),delete u.autoHide)}},{key:"_onBackdropClick",value:function(u){this.getClassProperty(u,"--overlay-backdrop","true")!=="static"&&this.close(u)}},{key:"_buildBackdrop",value:function(u){var f,O=this,C=u.getAttribute("data-hs-overlay-backdrop-container")||!1,S=document.createElement("div"),j="transition duration fixed inset-0 z-50 bg-gray-900 bg-opacity-50 dark:bg-opacity-80 hs-overlay-backdrop",R=function(N,ie){var re=typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(!re){if(Array.isArray(N)||(re=function(me,it){if(me){if(typeof me=="string")return d(me,it);var Ge=Object.prototype.toString.call(me).slice(8,-1);return Ge==="Object"&&me.constructor&&(Ge=me.constructor.name),Ge==="Map"||Ge==="Set"?Array.from(me):Ge==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ge)?d(me,it):void 0}}(N))||ie&&N&&typeof N.length=="number"){re&&(N=re);var Ye=0,Ae=function(){};return{s:Ae,n:function(){return Ye>=N.length?{done:!0}:{done:!1,value:N[Ye++]}},e:function(me){throw me},f:Ae}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
30
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var De,ze=!0,at=!1;return{s:function(){re=re.call(N)},n:function(){var me=re.next();return ze=me.done,me},e:function(me){at=!0,De=me},f:function(){try{ze||re.return==null||re.return()}finally{if(at)throw De}}}}(u.classList.values());try{for(R.s();!(f=R.n()).done;){var q=f.value;q.startsWith("hs-overlay-backdrop-open:")&&(j+=" ".concat(q))}}catch(N){R.e(N)}finally{R.f()}var B=this.getClassProperty(u,"--overlay-backdrop","true")!=="static";this.getClassProperty(u,"--overlay-backdrop","true")==="false"||(C&&((S=document.querySelector(C).cloneNode(!0)).classList.remove("hidden"),j=S.classList,S.classList=""),B&&S.addEventListener("click",function(){return O.close(u)},!0),S.setAttribute("data-hs-overlay-backdrop-template",""),document.body.appendChild(S),setTimeout(function(){S.classList=j}))}},{key:"_destroyBackdrop",value:function(){var u=document.querySelector("[data-hs-overlay-backdrop-template]");u&&(this.openNextOverlay&&(u.style.transitionDuration="".concat(1.8*parseFloat(window.getComputedStyle(u).transitionDuration.replace(/[^\d.-]/g,"")),"s")),u.classList.add("opacity-0"),this.afterTransition(u,function(){u.remove()}))}},{key:"_focusInput",value:function(u){var f=u.querySelector("[autofocus]");f&&f.focus()}}])&&g(h.prototype,p),Object.defineProperty(h,"prototype",{writable:!1}),T}(c(765).Z);window.HSOverlay=new L,document.addEventListener("load",window.HSOverlay.init())},181:(s,l,c)=>{function a(L){return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},a(L)}function d(L,m){for(var h=0;h<m.length;h++){var p=m[h];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,p.key,p)}}function g(L,m){return g=Object.setPrototypeOf||function(h,p){return h.__proto__=p,h},g(L,m)}function k(L,m){if(m&&(a(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}(L)}function x(L){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},x(L)}var D=function(L){(function(T,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(u&&u.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),Object.defineProperty(T,"prototype",{writable:!1}),u&&g(T,u)})(P,L);var m,h,p,_,A=(p=P,_=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var T,u=x(p);if(_){var f=x(this).constructor;T=Reflect.construct(u,arguments,f)}else T=u.apply(this,arguments);return k(this,T)});function P(){return function(T,u){if(!(T instanceof u))throw new TypeError("Cannot call a class as a function")}(this,P),A.call(this,"[data-hs-remove-element]")}return m=P,(h=[{key:"init",value:function(){var T=this;document.addEventListener("click",function(u){var f=u.target.closest(T.selector);if(f){var O=document.querySelector(f.getAttribute("data-hs-remove-element"));O&&(O.classList.add("hs-removing"),T.afterTransition(O,function(){O.remove()}))}})}}])&&d(m.prototype,h),Object.defineProperty(m,"prototype",{writable:!1}),P}(c(765).Z);window.HSRemoveElement=new D,document.addEventListener("load",window.HSRemoveElement.init())},778:(s,l,c)=>{function a(L){return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},a(L)}function d(L,m){for(var h=0;h<m.length;h++){var p=m[h];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(L,p.key,p)}}function g(L,m){return g=Object.setPrototypeOf||function(h,p){return h.__proto__=p,h},g(L,m)}function k(L,m){if(m&&(a(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}(L)}function x(L){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},x(L)}var D=function(L){(function(T,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(u&&u.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),Object.defineProperty(T,"prototype",{writable:!1}),u&&g(T,u)})(P,L);var m,h,p,_,A=(p=P,_=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var T,u=x(p);if(_){var f=x(this).constructor;T=Reflect.construct(u,arguments,f)}else T=u.apply(this,arguments);return k(this,T)});function P(){var T;return function(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}(this,P),(T=A.call(this,"[data-hs-scrollspy] ")).activeSection=null,T}return m=P,(h=[{key:"init",value:function(){var T=this;document.querySelectorAll(this.selector).forEach(function(u){var f=document.querySelector(u.getAttribute("data-hs-scrollspy")),O=u.querySelectorAll("[href]"),C=f.children,S=u.getAttribute("data-hs-scrollspy-scrollable-parent")?document.querySelector(u.getAttribute("data-hs-scrollspy-scrollable-parent")):document;Array.from(C).forEach(function(j){j.getAttribute("id")&&S.addEventListener("scroll",function(R){return T._update({$scrollspyEl:u,$scrollspyContentEl:f,links:O,$sectionEl:j,sections:C,ev:R})})}),O.forEach(function(j){j.addEventListener("click",function(R){R.preventDefault(),j.getAttribute("href")!=="javascript:;"&&T._scrollTo({$scrollspyEl:u,$scrollableEl:S,$link:j})})})})}},{key:"_update",value:function(T){var u=T.ev,f=T.$scrollspyEl,O=(T.sections,T.links),C=T.$sectionEl,S=parseInt(this.getClassProperty(f,"--scrollspy-offset","0")),j=this.getClassProperty(C,"--scrollspy-offset")||S,R=u.target===document?0:parseInt(u.target.getBoundingClientRect().top),q=parseInt(C.getBoundingClientRect().top)-j-R,B=C.offsetHeight;if(q<=0&&q+B>0){if(this.activeSection===C)return;O.forEach(function(Ye){Ye.classList.remove("active")});var N=f.querySelector('[href="#'.concat(C.getAttribute("id"),'"]'));if(N){N.classList.add("active");var ie=N.closest("[data-hs-scrollspy-group]");if(ie){var re=ie.querySelector("[href]");re&&re.classList.add("active")}}this.activeSection=C}}},{key:"_scrollTo",value:function(T){var u=T.$scrollspyEl,f=T.$scrollableEl,O=T.$link,C=document.querySelector(O.getAttribute("href")),S=parseInt(this.getClassProperty(u,"--scrollspy-offset","0")),j=this.getClassProperty(C,"--scrollspy-offset")||S,R=f===document?0:f.offsetTop,q=C.offsetTop-j-R,B=f===document?window:f;this._fireEvent("scroll",u),this._dispatch("scroll.hs.scrollspy",u,u),window.history.replaceState(null,null,O.getAttribute("href")),B.scrollTo({top:q,left:0,behavior:"smooth"})}}])&&d(m.prototype,h),Object.defineProperty(m,"prototype",{writable:!1}),P}(c(765).Z);window.HSScrollspy=new D,document.addEventListener("load",window.HSScrollspy.init())},51:(s,l,c)=>{function a(h){return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},a(h)}function d(h){return function(p){if(Array.isArray(p))return g(p)}(h)||function(p){if(typeof Symbol<"u"&&p[Symbol.iterator]!=null||p["@@iterator"]!=null)return Array.from(p)}(h)||function(p,_){if(p){if(typeof p=="string")return g(p,_);var A=Object.prototype.toString.call(p).slice(8,-1);return A==="Object"&&p.constructor&&(A=p.constructor.name),A==="Map"||A==="Set"?Array.from(p):A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?g(p,_):void 0}}(h)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
31
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function g(h,p){(p==null||p>h.length)&&(p=h.length);for(var _=0,A=new Array(p);_<p;_++)A[_]=h[_];return A}function k(h,p){for(var _=0;_<p.length;_++){var A=p[_];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function x(h,p){return x=Object.setPrototypeOf||function(_,A){return _.__proto__=A,_},x(h,p)}function D(h,p){if(p&&(a(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}(h)}function L(h){return L=Object.setPrototypeOf?Object.getPrototypeOf:function(p){return p.__proto__||Object.getPrototypeOf(p)},L(h)}var m=function(h){(function(f,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");f.prototype=Object.create(O&&O.prototype,{constructor:{value:f,writable:!0,configurable:!0}}),Object.defineProperty(f,"prototype",{writable:!1}),O&&x(f,O)})(u,h);var p,_,A,P,T=(A=u,P=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var f,O=L(A);if(P){var C=L(this).constructor;f=Reflect.construct(O,arguments,C)}else f=O.apply(this,arguments);return D(this,f)});function u(){return function(f,O){if(!(f instanceof O))throw new TypeError("Cannot call a class as a function")}(this,u),T.call(this,"[data-hs-tab]")}return p=u,(_=[{key:"init",value:function(){var f=this;document.addEventListener("keydown",this._keyboardSupport.bind(this)),document.addEventListener("click",function(O){var C=O.target.closest(f.selector);C&&f.open(C)}),document.querySelectorAll("[hs-data-tab-select]").forEach(function(O){var C=document.querySelector(O.getAttribute("hs-data-tab-select"));C&&C.addEventListener("change",function(S){var j=document.querySelector('[data-hs-tab="'.concat(S.target.value,'"]'));j&&f.open(j)})})}},{key:"open",value:function(f){var O=document.querySelector(f.getAttribute("data-hs-tab")),C=d(f.parentElement.children),S=d(O.parentElement.children),j=f.closest("[hs-data-tab-select]"),R=j?document.querySelector(j.getAttribute("data-hs-tab")):null;C.forEach(function(q){return q.classList.remove("active")}),S.forEach(function(q){return q.classList.add("hidden")}),f.classList.add("active"),O.classList.remove("hidden"),this._fireEvent("change",f),this._dispatch("change.hs.tab",f,f),R&&(R.value=f.getAttribute("data-hs-tab"))}},{key:"_keyboardSupport",value:function(f){var O=f.target.closest(this.selector);if(O){var C=O.closest('[role="tablist"]').getAttribute("data-hs-tabs-vertical")==="true";return(C?f.keyCode===38:f.keyCode===37)?(f.preventDefault(),this._left(O)):(C?f.keyCode===40:f.keyCode===39)?(f.preventDefault(),this._right(O)):f.keyCode===36?(f.preventDefault(),this._start(O)):f.keyCode===35?(f.preventDefault(),this._end(O)):void 0}}},{key:"_right",value:function(f){var O=f.closest('[role="tablist"]');if(O){var C=d(O.querySelectorAll(this.selector)).filter(function(R){return!R.disabled}),S=O.querySelector("button:focus"),j=C.findIndex(function(R){return R===S});j+1<C.length?j++:j=0,C[j].focus(),this.open(C[j])}}},{key:"_left",value:function(f){var O=f.closest('[role="tablist"]');if(O){var C=d(O.querySelectorAll(this.selector)).filter(function(R){return!R.disabled}).reverse(),S=O.querySelector("button:focus"),j=C.findIndex(function(R){return R===S});j+1<C.length?j++:j=0,C[j].focus(),this.open(C[j])}}},{key:"_start",value:function(f){var O=f.closest('[role="tablist"]');if(O){var C=d(O.querySelectorAll(this.selector)).filter(function(S){return!S.disabled});C.length&&(C[0].focus(),this.open(C[0]))}}},{key:"_end",value:function(f){var O=f.closest('[role="tablist"]');if(O){var C=d(O.querySelectorAll(this.selector)).reverse().filter(function(S){return!S.disabled});C.length&&(C[0].focus(),this.open(C[0]))}}}])&&k(p.prototype,_),Object.defineProperty(p,"prototype",{writable:!1}),u}(c(765).Z);window.HSTabs=new m,document.addEventListener("load",window.HSTabs.init())},185:(s,l,c)=>{var a=c(765),d=c(714);function g(h){return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},g(h)}function k(h,p){for(var _=0;_<p.length;_++){var A=p[_];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(h,A.key,A)}}function x(h,p){return x=Object.setPrototypeOf||function(_,A){return _.__proto__=A,_},x(h,p)}function D(h,p){if(p&&(g(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}(h)}function L(h){return L=Object.setPrototypeOf?Object.getPrototypeOf:function(p){return p.__proto__||Object.getPrototypeOf(p)},L(h)}var m=function(h){(function(f,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");f.prototype=Object.create(O&&O.prototype,{constructor:{value:f,writable:!0,configurable:!0}}),Object.defineProperty(f,"prototype",{writable:!1}),O&&x(f,O)})(u,h);var p,_,A,P,T=(A=u,P=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var f,O=L(A);if(P){var C=L(this).constructor;f=Reflect.construct(O,arguments,C)}else f=O.apply(this,arguments);return D(this,f)});function u(){return function(f,O){if(!(f instanceof O))throw new TypeError("Cannot call a class as a function")}(this,u),T.call(this,".hs-tooltip")}return p=u,(_=[{key:"init",value:function(){var f=this;document.addEventListener("click",function(O){var C=O.target.closest(f.selector);C&&f.getClassProperty(C,"--trigger")==="focus"&&f._focus(C),C&&f.getClassProperty(C,"--trigger")==="click"&&f._click(C)}),document.addEventListener("mousemove",function(O){var C=O.target.closest(f.selector);C&&f.getClassProperty(C,"--trigger")!=="focus"&&f.getClassProperty(C,"--trigger")!=="click"&&f._hover(C)})}},{key:"_hover",value:function(f){var O=this;if(!f.classList.contains("show")){var C=f.querySelector(".hs-tooltip-toggle"),S=f.querySelector(".hs-tooltip-content"),j=this.getClassProperty(f,"--placement");(0,d.fi)(C,S,{placement:j||"top",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]}),this.show(f),f.addEventListener("mouseleave",function R(q){q.relatedTarget.closest(O.selector)&&q.relatedTarget.closest(O.selector)==f||(O.hide(f),f.removeEventListener("mouseleave",R,!0))},!0)}}},{key:"_focus",value:function(f){var O=this,C=f.querySelector(".hs-tooltip-toggle"),S=f.querySelector(".hs-tooltip-content"),j=this.getClassProperty(f,"--placement"),R=this.getClassProperty(f,"--strategy");(0,d.fi)(C,S,{placement:j||"top",strategy:R||"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]}),this.show(f),f.addEventListener("blur",function q(){O.hide(f),f.removeEventListener("blur",q,!0)},!0)}},{key:"_click",value:function(f){var O=this;if(!f.classList.contains("show")){var C=f.querySelector(".hs-tooltip-toggle"),S=f.querySelector(".hs-tooltip-content"),j=this.getClassProperty(f,"--placement"),R=this.getClassProperty(f,"--strategy");(0,d.fi)(C,S,{placement:j||"top",strategy:R||"fixed",modifiers:[{name:"offset",options:{offset:[0,5]}}]}),this.show(f);var q=function B(N){setTimeout(function(){O.hide(f),f.removeEventListener("click",B,!0),f.removeEventListener("blur",B,!0)})};f.addEventListener("blur",q,!0),f.addEventListener("click",q,!0)}}},{key:"show",value:function(f){var O=this;f.querySelector(".hs-tooltip-content").classList.remove("hidden"),setTimeout(function(){f.classList.add("show"),O._fireEvent("show",f),O._dispatch("show.hs.tooltip",f,f)})}},{key:"hide",value:function(f){var O=f.querySelector(".hs-tooltip-content");f.classList.remove("show"),this._fireEvent("hide",f),this._dispatch("hide.hs.tooltip",f,f),this.afterTransition(O,function(){f.classList.contains("show")||O.classList.add("hidden")})}}])&&k(p.prototype,_),Object.defineProperty(p,"prototype",{writable:!1}),u}(a.Z);window.HSTooltip=new m,document.addEventListener("load",window.HSTooltip.init())},765:(s,l,c)=>{function a(g,k){for(var x=0;x<k.length;x++){var D=k[x];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(g,D.key,D)}}c.d(l,{Z:()=>d});var d=function(){function g(D,L){(function(m,h){if(!(m instanceof h))throw new TypeError("Cannot call a class as a function")})(this,g),this.$collection=[],this.selector=D,this.config=L,this.events={}}var k,x;return k=g,x=[{key:"_fireEvent",value:function(D){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.events.hasOwnProperty(D)&&this.events[D](L)}},{key:"_dispatch",value:function(D,L){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,h=new CustomEvent(D,{detail:{payload:m},bubbles:!0,cancelable:!0,composed:!1});L.dispatchEvent(h)}},{key:"on",value:function(D,L){this.events[D]=L}},{key:"afterTransition",value:function(D,L){window.getComputedStyle(D,null).getPropertyValue("transition")!=="all 0s ease 0s"?D.addEventListener("transitionend",function m(){L(),D.removeEventListener("transitionend",m,!0)},!0):L()}},{key:"getClassProperty",value:function(D,L){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",h=(window.getComputedStyle(D).getPropertyValue(L)||m).replace(" ","");return h}}],x&&a(k.prototype,x),Object.defineProperty(k,"prototype",{writable:!1}),g}()},714:(s,l,c)=>{function a(b){if(b==null)return window;if(b.toString()!=="[object Window]"){var y=b.ownerDocument;return y&&y.defaultView||window}return b}function d(b){return b instanceof a(b).Element||b instanceof Element}function g(b){return b instanceof a(b).HTMLElement||b instanceof HTMLElement}function k(b){return typeof ShadowRoot<"u"&&(b instanceof a(b).ShadowRoot||b instanceof ShadowRoot)}c.d(l,{fi:()=>gr});var x=Math.max,D=Math.min,L=Math.round;function m(b,y){y===void 0&&(y=!1);var $=b.getBoundingClientRect(),H=1,z=1;if(g(b)&&y){var Q=b.offsetHeight,V=b.offsetWidth;V>0&&(H=L($.width)/V||1),Q>0&&(z=L($.height)/Q||1)}return{width:$.width/H,height:$.height/z,top:$.top/z,right:$.right/H,bottom:$.bottom/z,left:$.left/H,x:$.left/H,y:$.top/z}}function h(b){var y=a(b);return{scrollLeft:y.pageXOffset,scrollTop:y.pageYOffset}}function p(b){return b?(b.nodeName||"").toLowerCase():null}function _(b){return((d(b)?b.ownerDocument:b.document)||window.document).documentElement}function A(b){return m(_(b)).left+h(b).scrollLeft}function P(b){return a(b).getComputedStyle(b)}function T(b){var y=P(b),$=y.overflow,H=y.overflowX,z=y.overflowY;return/auto|scroll|overlay|hidden/.test($+z+H)}function u(b,y,$){$===void 0&&($=!1);var H,z,Q=g(y),V=g(y)&&function(ee){var Ee=ee.getBoundingClientRect(),ae=L(Ee.width)/ee.offsetWidth||1,he=L(Ee.height)/ee.offsetHeight||1;return ae!==1||he!==1}(y),W=_(y),K=m(b,V),te={scrollLeft:0,scrollTop:0},ne={x:0,y:0};return(Q||!Q&&!$)&&((p(y)!=="body"||T(W))&&(te=(H=y)!==a(H)&&g(H)?{scrollLeft:(z=H).scrollLeft,scrollTop:z.scrollTop}:h(H)),g(y)?((ne=m(y,!0)).x+=y.clientLeft,ne.y+=y.clientTop):W&&(ne.x=A(W))),{x:K.left+te.scrollLeft-ne.x,y:K.top+te.scrollTop-ne.y,width:K.width,height:K.height}}function f(b){var y=m(b),$=b.offsetWidth,H=b.offsetHeight;return Math.abs(y.width-$)<=1&&($=y.width),Math.abs(y.height-H)<=1&&(H=y.height),{x:b.offsetLeft,y:b.offsetTop,width:$,height:H}}function O(b){return p(b)==="html"?b:b.assignedSlot||b.parentNode||(k(b)?b.host:null)||_(b)}function C(b){return["html","body","#document"].indexOf(p(b))>=0?b.ownerDocument.body:g(b)&&T(b)?b:C(O(b))}function S(b,y){var $;y===void 0&&(y=[]);var H=C(b),z=H===(($=b.ownerDocument)==null?void 0:$.body),Q=a(H),V=z?[Q].concat(Q.visualViewport||[],T(H)?H:[]):H,W=y.concat(V);return z?W:W.concat(S(O(V)))}function j(b){return["table","td","th"].indexOf(p(b))>=0}function R(b){return g(b)&&P(b).position!=="fixed"?b.offsetParent:null}function q(b){for(var y=a(b),$=R(b);$&&j($)&&P($).position==="static";)$=R($);return $&&(p($)==="html"||p($)==="body"&&P($).position==="static")?y:$||function(H){var z=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1;if(navigator.userAgent.indexOf("Trident")!==-1&&g(H)&&P(H).position==="fixed")return null;for(var Q=O(H);g(Q)&&["html","body"].indexOf(p(Q))<0;){var V=P(Q);if(V.transform!=="none"||V.perspective!=="none"||V.contain==="paint"||["transform","perspective"].indexOf(V.willChange)!==-1||z&&V.willChange==="filter"||z&&V.filter&&V.filter!=="none")return Q;Q=Q.parentNode}return null}(b)||y}var B="top",N="bottom",ie="right",re="left",Ye="auto",Ae=[B,N,ie,re],De="start",ze="end",at="viewport",me="popper",it=Ae.reduce(function(b,y){return b.concat([y+"-"+De,y+"-"+ze])},[]),Ge=[].concat(Ae,[Ye]).reduce(function(b,y){return b.concat([y,y+"-"+De,y+"-"+ze])},[]),ct=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Lt(b){var y=new Map,$=new Set,H=[];function z(Q){$.add(Q.name),[].concat(Q.requires||[],Q.requiresIfExists||[]).forEach(function(V){if(!$.has(V)){var W=y.get(V);W&&z(W)}}),H.push(Q)}return b.forEach(function(Q){y.set(Q.name,Q)}),b.forEach(function(Q){$.has(Q.name)||z(Q)}),H}var Tt={placement:"bottom",modifiers:[],strategy:"absolute"};function Te(){for(var b=arguments.length,y=new Array(b),$=0;$<b;$++)y[$]=arguments[$];return!y.some(function(H){return!(H&&typeof H.getBoundingClientRect=="function")})}function ut(b){b===void 0&&(b={});var y=b,$=y.defaultModifiers,H=$===void 0?[]:$,z=y.defaultOptions,Q=z===void 0?Tt:z;return function(V,W,K){K===void 0&&(K=Q);var te,ne,ee={placement:"bottom",orderedModifiers:[],options:Object.assign({},Tt,Q),modifiersData:{},elements:{reference:V,popper:W},attributes:{},styles:{}},Ee=[],ae=!1,he={state:ee,setOptions:function(le){var Ce=typeof le=="function"?le(ee.options):le;pe(),ee.options=Object.assign({},Q,ee.options,Ce),ee.scrollParents={reference:d(V)?S(V):V.contextElement?S(V.contextElement):[],popper:S(W)};var ve,fe,ye=function(ce){var ue=Lt(ce);return ct.reduce(function(de,ge){return de.concat(ue.filter(function(be){return be.phase===ge}))},[])}((ve=[].concat(H,ee.options.modifiers),fe=ve.reduce(function(ce,ue){var de=ce[ue.name];return ce[ue.name]=de?Object.assign({},de,ue,{options:Object.assign({},de.options,ue.options),data:Object.assign({},de.data,ue.data)}):ue,ce},{}),Object.keys(fe).map(function(ce){return fe[ce]})));return ee.orderedModifiers=ye.filter(function(ce){return ce.enabled}),ee.orderedModifiers.forEach(function(ce){var ue=ce.name,de=ce.options,ge=de===void 0?{}:de,be=ce.effect;if(typeof be=="function"){var Me=be({state:ee,name:ue,instance:he,options:ge});Ee.push(Me||function(){})}}),he.update()},forceUpdate:function(){if(!ae){var le=ee.elements,Ce=le.reference,ve=le.popper;if(Te(Ce,ve)){ee.rects={reference:u(Ce,q(ve),ee.options.strategy==="fixed"),popper:f(ve)},ee.reset=!1,ee.placement=ee.options.placement,ee.orderedModifiers.forEach(function(be){return ee.modifiersData[be.name]=Object.assign({},be.data)});for(var fe=0;fe<ee.orderedModifiers.length;fe++)if(ee.reset!==!0){var ye=ee.orderedModifiers[fe],ce=ye.fn,ue=ye.options,de=ue===void 0?{}:ue,ge=ye.name;typeof ce=="function"&&(ee=ce({state:ee,options:de,name:ge,instance:he})||ee)}else ee.reset=!1,fe=-1}}},update:(te=function(){return new Promise(function(le){he.forceUpdate(),le(ee)})},function(){return ne||(ne=new Promise(function(le){Promise.resolve().then(function(){ne=void 0,le(te())})})),ne}),destroy:function(){pe(),ae=!0}};if(!Te(V,W))return he;function pe(){Ee.forEach(function(le){return le()}),Ee=[]}return he.setOptions(K).then(function(le){!ae&&K.onFirstUpdate&&K.onFirstUpdate(le)}),he}}var Pe={passive:!0};function Be(b){return b.split("-")[0]}function Oe(b){return b.split("-")[1]}function Le(b){return["top","bottom"].indexOf(b)>=0?"x":"y"}function X(b){var y,$=b.reference,H=b.element,z=b.placement,Q=z?Be(z):null,V=z?Oe(z):null,W=$.x+$.width/2-H.width/2,K=$.y+$.height/2-H.height/2;switch(Q){case B:y={x:W,y:$.y-H.height};break;case N:y={x:W,y:$.y+$.height};break;case ie:y={x:$.x+$.width,y:K};break;case re:y={x:$.x-H.width,y:K};break;default:y={x:$.x,y:$.y}}var te=Q?Le(Q):null;if(te!=null){var ne=te==="y"?"height":"width";switch(V){case De:y[te]=y[te]-($[ne]/2-H[ne]/2);break;case ze:y[te]=y[te]+($[ne]/2-H[ne]/2)}}return y}var He={top:"auto",right:"auto",bottom:"auto",left:"auto"};function oe(b){var y,$=b.popper,H=b.popperRect,z=b.placement,Q=b.variation,V=b.offsets,W=b.position,K=b.gpuAcceleration,te=b.adaptive,ne=b.roundOffsets,ee=b.isFixed,Ee=V.x,ae=Ee===void 0?0:Ee,he=V.y,pe=he===void 0?0:he,le=typeof ne=="function"?ne({x:ae,y:pe}):{x:ae,y:pe};ae=le.x,pe=le.y;var Ce=V.hasOwnProperty("x"),ve=V.hasOwnProperty("y"),fe=re,ye=B,ce=window;if(te){var ue=q($),de="clientHeight",ge="clientWidth";ue===a($)&&P(ue=_($)).position!=="static"&&W==="absolute"&&(de="scrollHeight",ge="scrollWidth"),ue=ue,(z===B||(z===re||z===ie)&&Q===ze)&&(ye=N,pe-=(ee&&ce.visualViewport?ce.visualViewport.height:ue[de])-H.height,pe*=K?1:-1),z!==re&&(z!==B&&z!==N||Q!==ze)||(fe=ie,ae-=(ee&&ce.visualViewport?ce.visualViewport.width:ue[ge])-H.width,ae*=K?1:-1)}var be,Me=Object.assign({position:W},te&&He),Re=ne===!0?function(Ze){var Xe=Ze.x,st=Ze.y,We=window.devicePixelRatio||1;return{x:L(Xe*We)/We||0,y:L(st*We)/We||0}}({x:ae,y:pe}):{x:ae,y:pe};return ae=Re.x,pe=Re.y,K?Object.assign({},Me,((be={})[ye]=ve?"0":"",be[fe]=Ce?"0":"",be.transform=(ce.devicePixelRatio||1)<=1?"translate("+ae+"px, "+pe+"px)":"translate3d("+ae+"px, "+pe+"px, 0)",be)):Object.assign({},Me,((y={})[ye]=ve?pe+"px":"",y[fe]=Ce?ae+"px":"",y.transform="",y))}var gt={left:"right",right:"left",bottom:"top",top:"bottom"};function Rt(b){return b.replace(/left|right|bottom|top/g,function(y){return gt[y]})}var pr={start:"end",end:"start"};function cn(b){return b.replace(/start|end/g,function(y){return pr[y]})}function un(b,y){var $=y.getRootNode&&y.getRootNode();if(b.contains(y))return!0;if($&&k($)){var H=y;do{if(H&&b.isSameNode(H))return!0;H=H.parentNode||H.host}while(H)}return!1}function Ft(b){return Object.assign({},b,{left:b.x,top:b.y,right:b.x+b.width,bottom:b.y+b.height})}function fn(b,y){return y===at?Ft(function($){var H=a($),z=_($),Q=H.visualViewport,V=z.clientWidth,W=z.clientHeight,K=0,te=0;return Q&&(V=Q.width,W=Q.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(K=Q.offsetLeft,te=Q.offsetTop)),{width:V,height:W,x:K+A($),y:te}}(b)):d(y)?function($){var H=m($);return H.top=H.top+$.clientTop,H.left=H.left+$.clientLeft,H.bottom=H.top+$.clientHeight,H.right=H.left+$.clientWidth,H.width=$.clientWidth,H.height=$.clientHeight,H.x=H.left,H.y=H.top,H}(y):Ft(function($){var H,z=_($),Q=h($),V=(H=$.ownerDocument)==null?void 0:H.body,W=x(z.scrollWidth,z.clientWidth,V?V.scrollWidth:0,V?V.clientWidth:0),K=x(z.scrollHeight,z.clientHeight,V?V.scrollHeight:0,V?V.clientHeight:0),te=-Q.scrollLeft+A($),ne=-Q.scrollTop;return P(V||z).direction==="rtl"&&(te+=x(z.clientWidth,V?V.clientWidth:0)-W),{width:W,height:K,x:te,y:ne}}(_(b)))}function dn(b){return Object.assign({},{top:0,right:0,bottom:0,left:0},b)}function pn(b,y){return y.reduce(function($,H){return $[H]=b,$},{})}function Et(b,y){y===void 0&&(y={});var $=y,H=$.placement,z=H===void 0?b.placement:H,Q=$.boundary,V=Q===void 0?"clippingParents":Q,W=$.rootBoundary,K=W===void 0?at:W,te=$.elementContext,ne=te===void 0?me:te,ee=$.altBoundary,Ee=ee!==void 0&&ee,ae=$.padding,he=ae===void 0?0:ae,pe=dn(typeof he!="number"?he:pn(he,Ae)),le=ne===me?"reference":me,Ce=b.rects.popper,ve=b.elements[Ee?le:ne],fe=function(Re,Ze,Xe){var st=Ze==="clippingParents"?function(ke){var ft=S(O(ke)),Fe=["absolute","fixed"].indexOf(P(ke).position)>=0&&g(ke)?q(ke):ke;return d(Fe)?ft.filter(function(Ue){return d(Ue)&&un(Ue,Fe)&&p(Ue)!=="body"}):[]}(Re):[].concat(Ze),We=[].concat(st,[Xe]),Ie=We[0],qe=We.reduce(function(ke,ft){var Fe=fn(Re,ft);return ke.top=x(Fe.top,ke.top),ke.right=D(Fe.right,ke.right),ke.bottom=D(Fe.bottom,ke.bottom),ke.left=x(Fe.left,ke.left),ke},fn(Re,Ie));return qe.width=qe.right-qe.left,qe.height=qe.bottom-qe.top,qe.x=qe.left,qe.y=qe.top,qe}(d(ve)?ve:ve.contextElement||_(b.elements.popper),V,K),ye=m(b.elements.reference),ce=X({reference:ye,element:Ce,strategy:"absolute",placement:z}),ue=Ft(Object.assign({},Ce,ce)),de=ne===me?ue:ye,ge={top:fe.top-de.top+pe.top,bottom:de.bottom-fe.bottom+pe.bottom,left:fe.left-de.left+pe.left,right:de.right-fe.right+pe.right},be=b.modifiersData.offset;if(ne===me&&be){var Me=be[z];Object.keys(ge).forEach(function(Re){var Ze=[ie,N].indexOf(Re)>=0?1:-1,Xe=[B,N].indexOf(Re)>=0?"y":"x";ge[Re]+=Me[Xe]*Ze})}return ge}function Ct(b,y,$){return x(b,D(y,$))}function gn(b,y,$){return $===void 0&&($={x:0,y:0}),{top:b.top-y.height-$.y,right:b.right-y.width+$.x,bottom:b.bottom-y.height+$.y,left:b.left-y.width-$.x}}function hn(b){return[B,ie,N,re].some(function(y){return b[y]>=0})}var gr=ut({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(b){var y=b.state,$=b.instance,H=b.options,z=H.scroll,Q=z===void 0||z,V=H.resize,W=V===void 0||V,K=a(y.elements.popper),te=[].concat(y.scrollParents.reference,y.scrollParents.popper);return Q&&te.forEach(function(ne){ne.addEventListener("scroll",$.update,Pe)}),W&&K.addEventListener("resize",$.update,Pe),function(){Q&&te.forEach(function(ne){ne.removeEventListener("scroll",$.update,Pe)}),W&&K.removeEventListener("resize",$.update,Pe)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(b){var y=b.state,$=b.name;y.modifiersData[$]=X({reference:y.rects.reference,element:y.rects.popper,strategy:"absolute",placement:y.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(b){var y=b.state,$=b.options,H=$.gpuAcceleration,z=H===void 0||H,Q=$.adaptive,V=Q===void 0||Q,W=$.roundOffsets,K=W===void 0||W,te={placement:Be(y.placement),variation:Oe(y.placement),popper:y.elements.popper,popperRect:y.rects.popper,gpuAcceleration:z,isFixed:y.options.strategy==="fixed"};y.modifiersData.popperOffsets!=null&&(y.styles.popper=Object.assign({},y.styles.popper,oe(Object.assign({},te,{offsets:y.modifiersData.popperOffsets,position:y.options.strategy,adaptive:V,roundOffsets:K})))),y.modifiersData.arrow!=null&&(y.styles.arrow=Object.assign({},y.styles.arrow,oe(Object.assign({},te,{offsets:y.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:K})))),y.attributes.popper=Object.assign({},y.attributes.popper,{"data-popper-placement":y.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(b){var y=b.state;Object.keys(y.elements).forEach(function($){var H=y.styles[$]||{},z=y.attributes[$]||{},Q=y.elements[$];g(Q)&&p(Q)&&(Object.assign(Q.style,H),Object.keys(z).forEach(function(V){var W=z[V];W===!1?Q.removeAttribute(V):Q.setAttribute(V,W===!0?"":W)}))})},effect:function(b){var y=b.state,$={popper:{position:y.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(y.elements.popper.style,$.popper),y.styles=$,y.elements.arrow&&Object.assign(y.elements.arrow.style,$.arrow),function(){Object.keys(y.elements).forEach(function(H){var z=y.elements[H],Q=y.attributes[H]||{},V=Object.keys(y.styles.hasOwnProperty(H)?y.styles[H]:$[H]).reduce(function(W,K){return W[K]="",W},{});g(z)&&p(z)&&(Object.assign(z.style,V),Object.keys(Q).forEach(function(W){z.removeAttribute(W)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(b){var y=b.state,$=b.options,H=b.name,z=$.offset,Q=z===void 0?[0,0]:z,V=Ge.reduce(function(ne,ee){return ne[ee]=function(Ee,ae,he){var pe=Be(Ee),le=[re,B].indexOf(pe)>=0?-1:1,Ce=typeof he=="function"?he(Object.assign({},ae,{placement:Ee})):he,ve=Ce[0],fe=Ce[1];return ve=ve||0,fe=(fe||0)*le,[re,ie].indexOf(pe)>=0?{x:fe,y:ve}:{x:ve,y:fe}}(ee,y.rects,Q),ne},{}),W=V[y.placement],K=W.x,te=W.y;y.modifiersData.popperOffsets!=null&&(y.modifiersData.popperOffsets.x+=K,y.modifiersData.popperOffsets.y+=te),y.modifiersData[H]=V}},{name:"flip",enabled:!0,phase:"main",fn:function(b){var y=b.state,$=b.options,H=b.name;if(!y.modifiersData[H]._skip){for(var z=$.mainAxis,Q=z===void 0||z,V=$.altAxis,W=V===void 0||V,K=$.fallbackPlacements,te=$.padding,ne=$.boundary,ee=$.rootBoundary,Ee=$.altBoundary,ae=$.flipVariations,he=ae===void 0||ae,pe=$.allowedAutoPlacements,le=y.options.placement,Ce=Be(le),ve=K||(Ce!==le&&he?function(Ue){if(Be(Ue)===Ye)return[];var et=Rt(Ue);return[cn(Ue),et,cn(et)]}(le):[Rt(le)]),fe=[le].concat(ve).reduce(function(Ue,et){return Ue.concat(Be(et)===Ye?function(vt,dt){dt===void 0&&(dt={});var tt=dt,Bt=tt.placement,It=tt.boundary,_t=tt.rootBoundary,Yt=tt.padding,Jt=tt.flipVariations,wt=tt.allowedAutoPlacements,Kt=wt===void 0?Ge:wt,jt=Oe(Bt),Nt=jt?Jt?it:it.filter(function(rt){return Oe(rt)===jt}):Ae,kt=Nt.filter(function(rt){return Kt.indexOf(rt)>=0});kt.length===0&&(kt=Nt);var xt=kt.reduce(function(rt,ht){return rt[ht]=Et(vt,{placement:ht,boundary:It,rootBoundary:_t,padding:Yt})[Be(ht)],rt},{});return Object.keys(xt).sort(function(rt,ht){return xt[rt]-xt[ht]})}(y,{placement:et,boundary:ne,rootBoundary:ee,padding:te,flipVariations:he,allowedAutoPlacements:pe}):et)},[]),ye=y.rects.reference,ce=y.rects.popper,ue=new Map,de=!0,ge=fe[0],be=0;be<fe.length;be++){var Me=fe[be],Re=Be(Me),Ze=Oe(Me)===De,Xe=[B,N].indexOf(Re)>=0,st=Xe?"width":"height",We=Et(y,{placement:Me,boundary:ne,rootBoundary:ee,altBoundary:Ee,padding:te}),Ie=Xe?Ze?ie:re:Ze?N:B;ye[st]>ce[st]&&(Ie=Rt(Ie));var qe=Rt(Ie),ke=[];if(Q&&ke.push(We[Re]<=0),W&&ke.push(We[Ie]<=0,We[qe]<=0),ke.every(function(Ue){return Ue})){ge=Me,de=!1;break}ue.set(Me,ke)}if(de)for(var ft=function(Ue){var et=fe.find(function(vt){var dt=ue.get(vt);if(dt)return dt.slice(0,Ue).every(function(tt){return tt})});if(et)return ge=et,"break"},Fe=he?3:1;Fe>0&&ft(Fe)!=="break";Fe--);y.placement!==ge&&(y.modifiersData[H]._skip=!0,y.placement=ge,y.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(b){var y=b.state,$=b.options,H=b.name,z=$.mainAxis,Q=z===void 0||z,V=$.altAxis,W=V!==void 0&&V,K=$.boundary,te=$.rootBoundary,ne=$.altBoundary,ee=$.padding,Ee=$.tether,ae=Ee===void 0||Ee,he=$.tetherOffset,pe=he===void 0?0:he,le=Et(y,{boundary:K,rootBoundary:te,padding:ee,altBoundary:ne}),Ce=Be(y.placement),ve=Oe(y.placement),fe=!ve,ye=Le(Ce),ce=ye==="x"?"y":"x",ue=y.modifiersData.popperOffsets,de=y.rects.reference,ge=y.rects.popper,be=typeof pe=="function"?pe(Object.assign({},y.rects,{placement:y.placement})):pe,Me=typeof be=="number"?{mainAxis:be,altAxis:be}:Object.assign({mainAxis:0,altAxis:0},be),Re=y.modifiersData.offset?y.modifiersData.offset[y.placement]:null,Ze={x:0,y:0};if(ue){if(Q){var Xe,st=ye==="y"?B:re,We=ye==="y"?N:ie,Ie=ye==="y"?"height":"width",qe=ue[ye],ke=qe+le[st],ft=qe-le[We],Fe=ae?-ge[Ie]/2:0,Ue=ve===De?de[Ie]:ge[Ie],et=ve===De?-ge[Ie]:-de[Ie],vt=y.elements.arrow,dt=ae&&vt?f(vt):{width:0,height:0},tt=y.modifiersData["arrow#persistent"]?y.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Bt=tt[st],It=tt[We],_t=Ct(0,de[Ie],dt[Ie]),Yt=fe?de[Ie]/2-Fe-_t-Bt-Me.mainAxis:Ue-_t-Bt-Me.mainAxis,Jt=fe?-de[Ie]/2+Fe+_t+It+Me.mainAxis:et+_t+It+Me.mainAxis,wt=y.elements.arrow&&q(y.elements.arrow),Kt=wt?ye==="y"?wt.clientTop||0:wt.clientLeft||0:0,jt=(Xe=Re==null?void 0:Re[ye])!=null?Xe:0,Nt=qe+Jt-jt,kt=Ct(ae?D(ke,qe+Yt-jt-Kt):ke,qe,ae?x(ft,Nt):ft);ue[ye]=kt,Ze[ye]=kt-qe}if(W){var xt,rt=ye==="x"?B:re,ht=ye==="x"?N:ie,mt=ue[ce],Qt=ce==="y"?"height":"width",mn=mt+le[rt],yn=mt-le[ht],Xt=[B,re].indexOf(Ce)!==-1,bn=(xt=Re==null?void 0:Re[ce])!=null?xt:0,vn=Xt?mn:mt-de[Qt]-ge[Qt]-bn+Me.altAxis,_n=Xt?mt+de[Qt]+ge[Qt]-bn-Me.altAxis:yn,wn=ae&&Xt?function(hr,mr,en){var kn=Ct(hr,mr,en);return kn>en?en:kn}(vn,mt,_n):Ct(ae?vn:mn,mt,ae?_n:yn);ue[ce]=wn,Ze[ce]=wn-mt}y.modifiersData[H]=Ze}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(b){var y,$=b.state,H=b.name,z=b.options,Q=$.elements.arrow,V=$.modifiersData.popperOffsets,W=Be($.placement),K=Le(W),te=[re,ie].indexOf(W)>=0?"height":"width";if(Q&&V){var ne=function(ge,be){return dn(typeof(ge=typeof ge=="function"?ge(Object.assign({},be.rects,{placement:be.placement})):ge)!="number"?ge:pn(ge,Ae))}(z.padding,$),ee=f(Q),Ee=K==="y"?B:re,ae=K==="y"?N:ie,he=$.rects.reference[te]+$.rects.reference[K]-V[K]-$.rects.popper[te],pe=V[K]-$.rects.reference[K],le=q(Q),Ce=le?K==="y"?le.clientHeight||0:le.clientWidth||0:0,ve=he/2-pe/2,fe=ne[Ee],ye=Ce-ee[te]-ne[ae],ce=Ce/2-ee[te]/2+ve,ue=Ct(fe,ce,ye),de=K;$.modifiersData[H]=((y={})[de]=ue,y.centerOffset=ue-ce,y)}},effect:function(b){var y=b.state,$=b.options.element,H=$===void 0?"[data-popper-arrow]":$;H!=null&&(typeof H!="string"||(H=y.elements.popper.querySelector(H)))&&un(y.elements.popper,H)&&(y.elements.arrow=H)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(b){var y=b.state,$=b.name,H=y.rects.reference,z=y.rects.popper,Q=y.modifiersData.preventOverflow,V=Et(y,{elementContext:"reference"}),W=Et(y,{altBoundary:!0}),K=gn(V,H),te=gn(W,z,Q),ne=hn(K),ee=hn(te);y.modifiersData[$]={referenceClippingOffsets:K,popperEscapeOffsets:te,isReferenceHidden:ne,hasPopperEscaped:ee},y.attributes.popper=Object.assign({},y.attributes.popper,{"data-popper-reference-hidden":ne,"data-popper-escaped":ee})}}]})}},t={};function o(s){var l=t[s];if(l!==void 0)return l.exports;var c=t[s]={exports:{}};return n[s](c,c.exports,o),c.exports}o.d=(s,l)=>{for(var c in l)o.o(l,c)&&!o.o(s,c)&&Object.defineProperty(s,c,{enumerable:!0,get:l[c]})},o.o=(s,l)=>Object.prototype.hasOwnProperty.call(s,l),o.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var i={};return o.r(i),o(661),o(795),o(682),o(284),o(181),o(778),o(51),o(185),i})()})})(Hr);function Mr(r){let e;return{c(){e=E("div"),e.innerHTML='<h1 class="text-3xl font-bold text-gray-800 sm:text-4xl dark:text-white">Welcome to <span class="nav-title">Vanna.AI</span></h1> <p class="mt-3 text-gray-600 dark:text-gray-400">Your AI-powered copilot for SQL queries.</p>',v(e,"class","max-w-4xl px-4 sm:px-6 lg:px-8 mx-auto text-center")},m(n,t){U(n,e,t)},p:se,i:se,o:se,d(n){n&&G(e)}}}class Rr extends Se{constructor(e){super(),$e(this,e,null,Mr,xe,{})}}function Br(r){let e,n;const t=r[1].default,o=Gt(t,r,r[0],null);return{c(){e=E("p"),o&&o.c(),v(e,"class","text-gray-800 dark:text-gray-200")},m(i,s){U(i,e,s),o&&o.m(e,null),n=!0},p(i,[s]){o&&o.p&&(!n||s&1)&&Zt(o,t,i,i[0],n?Ut(t,i[0],s,null):Wt(i[0]),null)},i(i){n||(M(o,i),n=!0)},o(i){I(o,i),n=!1},d(i){i&&G(e),o&&o.d(i)}}}function Ir(r,e,n){let{$$slots:t={},$$scope:o}=e;return r.$$set=i=>{"$$scope"in i&&n(0,o=i.$$scope)},[o,t]}class lt extends Se{constructor(e){super(),$e(this,e,Ir,Br,xe,{})}}function Nr(r){let e;return{c(){e=we(r[0])},m(n,t){U(n,e,t)},p(n,t){t&1&&Ve(e,n[0])},d(n){n&&G(e)}}}function Qr(r){let e,n,t,o,i,s,l,c,a;l=new lt({props:{$$slots:{default:[Nr]},$$scope:{ctx:r}}});const d=r[1].default,g=Gt(d,r,r[2],null);return{c(){e=E("li"),n=E("div"),t=E("div"),o=E("span"),o.innerHTML='<span class="text-sm font-medium text-white leading-none">You</span>',i=Z(),s=E("div"),J(l.$$.fragment),c=Z(),g&&g.c(),v(o,"class","flex-shrink-0 inline-flex items-center justify-center h-[2.375rem] w-[2.375rem] rounded-full bg-gray-600"),v(s,"class","grow mt-2 space-y-3"),v(t,"class","max-w-2xl flex gap-x-2 sm:gap-x-4"),v(n,"class","max-w-4xl px-4 sm:px-6 lg:px-8 mx-auto"),v(e,"class","py-2 sm:py-4")},m(k,x){U(k,e,x),w(e,n),w(n,t),w(t,o),w(t,i),w(t,s),F(l,s,null),w(s,c),g&&g.m(s,null),a=!0},p(k,[x]){const D={};x&5&&(D.$$scope={dirty:x,ctx:k}),l.$set(D),g&&g.p&&(!a||x&4)&&Zt(g,d,k,k[2],a?Ut(d,k[2],x,null):Wt(k[2]),null)},i(k){a||(M(l.$$.fragment,k),M(g,k),a=!0)},o(k){I(l.$$.fragment,k),I(g,k),a=!1},d(k){k&&G(e),Y(l),g&&g.d(k)}}}function Vr(r,e,n){let{$$slots:t={},$$scope:o}=e,{message:i}=e;return r.$$set=s=>{"message"in s&&n(0,i=s.message),"$$scope"in s&&n(2,o=s.$$scope)},[i,t,o]}class Mt extends Se{constructor(e){super(),$e(this,e,Vr,Qr,xe,{message:0})}}function zr(r){let e,n,t,o,i,s,l,c,a,d,g;return{c(){e=E("div"),n=E("input"),t=Z(),o=E("div"),i=E("div"),s=E("div"),s.innerHTML="",l=Z(),c=E("div"),a=E("button"),a.innerHTML='<svg class="h-3.5 w-3.5" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M15.964.686a.5.5 0 0 0-.65-.65L.767 5.855H.766l-.452.18a.5.5 0 0 0-.082.887l.41.26.001.002 4.995 3.178 3.178 4.995.002.002.26.41a.5.5 0 0 0 .886-.083l6-15Zm-1.833 1.89L6.637 10.07l-.215-.338a.5.5 0 0 0-.154-.154l-.338-.215 7.494-7.494 1.178-.471-.47 1.178Z"></path></svg>',v(n,"type","text"),v(n,"class","p-4 pb-12 block w-full bg-gray-100 border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-slate-800 dark:border-gray-700 dark:text-gray-400"),v(n,"placeholder","Ask me a question about your data that I can turn into SQL."),v(s,"class","flex items-center"),v(a,"type","button"),v(a,"class","inline-flex flex-shrink-0 justify-center items-center h-8 w-8 rounded-md text-white bg-blue-600 hover:bg-blue-500 focus:z-10 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-all"),v(c,"class","flex items-center gap-x-1"),v(i,"class","flex justify-between items-center"),v(o,"class","absolute bottom-px inset-x-px p-2 rounded-b-md bg-gray-100 dark:bg-slate-800"),v(e,"class","relative")},m(k,x){U(k,e,x),w(e,n),bt(n,r[0]),w(e,t),w(e,o),w(o,i),w(i,s),w(i,l),w(i,c),w(c,a),d||(g=[je(n,"input",r[4]),je(n,"keydown",r[1]),je(a,"click",r[2])],d=!0)},p(k,[x]){x&1&&n.value!==k[0]&&bt(n,k[0])},i:se,o:se,d(k){k&&G(e),d=!1,ot(g)}}}function Gr(r,e,n){let{onSubmit:t}=e,o="";function i(c){c.key==="Enter"&&(t(o),c.preventDefault())}function s(){t(o)}function l(){o=this.value,n(0,o)}return r.$$set=c=>{"onSubmit"in c&&n(3,t=c.onSubmit)},[o,i,s,t,l]}class Ur extends Se{constructor(e){super(),$e(this,e,Gr,zr,xe,{onSubmit:3})}}function Zr(r){let e;return{c(){e=E("div"),e.innerHTML='<button type="button" class="p-2 inline-flex justify-center items-center gap-1.5 rounded-md border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-blue-600 transition-all text-xs dark:bg-slate-900 dark:hover:bg-slate-800 dark:border-gray-700 dark:text-gray-400 dark:hover:text-white dark:focus:ring-offset-gray-800" data-hs-overlay="#application-sidebar" aria-controls="application-sidebar" aria-label="Toggle navigation"><svg class="w-3.5 h-3.5" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"></path></svg> <span>Sidebar</span></button>',v(e,"class","lg:hidden flex justify-end mb-2 sm:mb-3")},m(n,t){U(n,e,t)},p:se,i:se,o:se,d(n){n&&G(e)}}}class Wr extends Se{constructor(e){super(),$e(this,e,null,Zr,xe,{})}}function Fr(r){let e,n,t,o;return{c(){e=E("button"),n=we(r[0]),v(e,"type","button"),v(e,"class","mb-2.5 mr-1.5 py-2 px-3 inline-flex justify-center items-center gap-x-2 rounded-md border border-blue-600 bg-white text-blue-600 align-middle hover:bg-blue-50 text-sm dark:bg-slate-900 dark:text-blue-500 dark:border-blue-500 dark:hover:text-blue-400 dark:hover:border-blue-400")},m(i,s){U(i,e,s),w(e,n),t||(o=je(e,"click",r[1]),t=!0)},p(i,[s]){s&1&&Ve(n,i[0])},i:se,o:se,d(i){i&&G(e),t=!1,o()}}}function Yr(r,e,n){let{message:t}=e,{onSubmit:o}=e;function i(){o(t)}return r.$$set=s=>{"message"in s&&n(0,t=s.message),"onSubmit"in s&&n(2,o=s.onSubmit)},[t,i,o]}class Ht extends Se{constructor(e){super(),$e(this,e,Yr,Fr,xe,{message:0,onSubmit:2})}}function Jr(r){let e,n,t,o,i,s;const l=r[1].default,c=Gt(l,r,r[0],null);return{c(){e=E("li"),n=E("img"),o=Z(),i=E("div"),c&&c.c(),or(n.src,t="/vanna.svg")||v(n,"src",t),v(n,"class","flex-shrink-0 w-[2.375rem] h-[2.375rem] "),v(n,"alt","agent logo"),v(i,"class","space-y-3 overflow-x-auto overflow-y-hidden"),v(e,"class","max-w-4xl py-2 px-4 sm:px-6 lg:px-8 mx-auto flex gap-x-2 sm:gap-x-4")},m(a,d){U(a,e,d),w(e,n),w(e,o),w(e,i),c&&c.m(i,null),s=!0},p(a,[d]){c&&c.p&&(!s||d&1)&&Zt(c,l,a,a[0],s?Ut(l,a[0],d,null):Wt(a[0]),null)},i(a){s||(M(c,a),s=!0)},o(a){I(c,a),s=!1},d(a){a&&G(e),c&&c.d(a)}}}function Kr(r,e,n){let{$$slots:t={},$$scope:o}=e;return r.$$set=i=>{"$$scope"in i&&n(0,o=i.$$scope)},[o,t]}class Ke extends Se{constructor(e){super(),$e(this,e,Kr,Jr,xe,{})}}function Xr(r){let e;return{c(){e=we("Thinking...")},m(n,t){U(n,e,t)},d(n){n&&G(e)}}}function eo(r){let e,n,t,o,i,s,l;return s=new lt({props:{$$slots:{default:[Xr]},$$scope:{ctx:r}}}),{c(){e=E("li"),n=E("img"),o=Z(),i=E("div"),J(s.$$.fragment),or(n.src,t="/vanna.svg")||v(n,"src",t),v(n,"class","flex-shrink-0 w-[2.375rem] h-[2.375rem] animate-bounce "),v(n,"alt","agent logo"),v(i,"class","space-y-3"),v(e,"class","max-w-4xl py-2 px-4 sm:px-6 lg:px-8 mx-auto flex gap-x-2 sm:gap-x-4")},m(c,a){U(c,e,a),w(e,n),w(e,o),w(e,i),F(s,i,null),l=!0},p(c,[a]){const d={};a&1&&(d.$$scope={dirty:a,ctx:c}),s.$set(d)},i(c){l||(M(s.$$.fragment,c),l=!0)},o(c){I(s.$$.fragment,c),l=!1},d(c){c&&G(e),Y(s)}}}class to extends Se{constructor(e){super(),$e(this,e,null,eo,xe,{})}}function no(r){let e,n,t,o,i,s,l,c,a,d,g;return{c(){e=E("ul"),n=E("li"),t=E("div"),o=E("span"),o.textContent="CSV",i=Z(),s=E("a"),l=Pt("svg"),c=Pt("path"),a=Pt("path"),d=we(`
|
|
32
|
+
Download`),v(o,"class","mr-3 flex-1 w-0 truncate"),v(c,"d","M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"),v(a,"d","M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"),v(l,"class","flex-shrink-0 w-3 h-3"),v(l,"width","16"),v(l,"height","16"),v(l,"viewBox","0 0 16 16"),v(l,"fill","currentColor"),v(s,"class","flex items-center gap-x-2 text-gray-500 hover:text-blue-500 whitespace-nowrap"),v(s,"href",g="/api/v0/download_csv?id="+r[0]),v(t,"class","w-full flex justify-between truncate"),v(n,"class","flex items-center gap-x-2 p-3 text-sm bg-white border text-gray-800 first:rounded-t-lg first:mt-0 last:rounded-b-lg dark:bg-slate-900 dark:border-gray-700 dark:text-gray-200"),v(e,"class","flex flex-col justify-end text-start -space-y-px")},m(k,x){U(k,e,x),w(e,n),w(n,t),w(t,o),w(t,i),w(t,s),w(s,l),w(l,c),w(l,a),w(s,d)},p(k,[x]){x&1&&g!==(g="/api/v0/download_csv?id="+k[0])&&v(s,"href",g)},i:se,o:se,d(k){k&&G(e)}}}function ro(r,e,n){let{id:t}=e;return r.$$set=o=>{"id"in o&&n(0,t=o.id)},[t]}class oo extends Se{constructor(e){super(),$e(this,e,ro,no,xe,{id:0})}}function En(r,e,n){const t=r.slice();return t[4]=e[n],t}function Cn(r,e,n){const t=r.slice();return t[7]=e[n],t}function jn(r,e,n){const t=r.slice();return t[7]=e[n],t}function Pn(r){let e,n,t,o;return{c(){e=E("th"),n=E("div"),t=E("span"),t.textContent=`${r[7]}`,o=Z(),v(t,"class","text-xs font-semibold uppercase tracking-wide text-gray-800 dark:text-gray-200"),v(n,"class","flex items-center gap-x-2"),v(e,"scope","col"),v(e,"class","px-6 py-3 text-left")},m(i,s){U(i,e,s),w(e,n),w(n,t),w(e,o)},p:se,d(i){i&&G(e)}}}function qn(r){let e,n,t;return{c(){e=E("td"),n=E("div"),t=E("span"),t.textContent=`${r[4][r[7]]}`,v(t,"class","text-gray-800 dark:text-gray-200"),v(n,"class","px-6 py-3"),v(e,"class","h-px w-px whitespace-nowrap")},m(o,i){U(o,e,i),w(e,n),w(n,t)},p:se,d(o){o&&G(e)}}}function An(r){let e,n,t=_e(r[2]),o=[];for(let i=0;i<t.length;i+=1)o[i]=qn(Cn(r,t,i));return{c(){e=E("tr");for(let i=0;i<o.length;i+=1)o[i].c();n=Z()},m(i,s){U(i,e,s);for(let l=0;l<o.length;l+=1)o[l]&&o[l].m(e,null);w(e,n)},p(i,s){if(s&6){t=_e(i[2]);let l;for(l=0;l<t.length;l+=1){const c=Cn(i,t,l);o[l]?o[l].p(c,s):(o[l]=qn(c),o[l].c(),o[l].m(e,n))}for(;l<o.length;l+=1)o[l].d(1);o.length=t.length}},d(i){i&&G(e),Je(o,i)}}}function io(r){let e,n,t,o,i,s,l,c,a,d,g,k=_e(r[2]),x=[];for(let m=0;m<k.length;m+=1)x[m]=Pn(jn(r,k,m));let D=_e(r[1]),L=[];for(let m=0;m<D.length;m+=1)L[m]=An(En(r,D,m));return d=new oo({props:{id:r[0]}}),{c(){e=E("div"),n=E("div"),t=E("div"),o=E("table"),i=E("thead"),s=E("tr");for(let m=0;m<x.length;m+=1)x[m].c();l=Z(),c=E("tbody");for(let m=0;m<L.length;m+=1)L[m].c();a=Z(),J(d.$$.fragment),v(i,"class","bg-gray-50 dark:bg-slate-800"),v(c,"class","divide-y divide-gray-200 dark:divide-gray-700"),v(o,"class","min-w-full divide-y divide-gray-200 dark:divide-gray-700"),v(t,"class","p-1.5 min-w-full inline-block align-middle"),v(n,"class","-m-1.5 overflow-x-auto"),v(e,"class","bg-white border border-gray-200 rounded-xl shadow-sm overflow-hidden dark:bg-slate-900 dark:border-gray-700")},m(m,h){U(m,e,h),w(e,n),w(n,t),w(t,o),w(o,i),w(i,s);for(let p=0;p<x.length;p+=1)x[p]&&x[p].m(s,null);w(o,l),w(o,c);for(let p=0;p<L.length;p+=1)L[p]&&L[p].m(c,null);U(m,a,h),F(d,m,h),g=!0},p(m,[h]){if(h&4){k=_e(m[2]);let _;for(_=0;_<k.length;_+=1){const A=jn(m,k,_);x[_]?x[_].p(A,h):(x[_]=Pn(A),x[_].c(),x[_].m(s,null))}for(;_<x.length;_+=1)x[_].d(1);x.length=k.length}if(h&6){D=_e(m[1]);let _;for(_=0;_<D.length;_+=1){const A=En(m,D,_);L[_]?L[_].p(A,h):(L[_]=An(A),L[_].c(),L[_].m(c,null))}for(;_<L.length;_+=1)L[_].d(1);L.length=D.length}const p={};h&1&&(p.id=m[0]),d.$set(p)},i(m){g||(M(d.$$.fragment,m),g=!0)},o(m){I(d.$$.fragment,m),g=!1},d(m){m&&(G(e),G(a)),Je(x,m),Je(L,m),Y(d,m)}}}function so(r,e,n){let{id:t}=e,{df:o}=e,i=JSON.parse(o),s=i.length>0?Object.keys(i[0]):[];return r.$$set=l=>{"id"in l&&n(0,t=l.id),"df"in l&&n(3,o=l.df)},[t,i,s,o]}class ar extends Se{constructor(e){super(),$e(this,e,so,io,xe,{id:0,df:3})}}function lo(r){let e;return{c(){e=E("div"),v(e,"id",r[0])},m(n,t){U(n,e,t)},p:se,i:se,o:se,d(n){n&&G(e)}}}function ao(r,e,n){let{fig:t}=e,o=JSON.parse(t),i=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);return sr(()=>{Plotly.newPlot(document.getElementById(i),o,{responsive:!0})}),r.$$set=s=>{"fig"in s&&n(1,t=s.fig)},[i,t]}class cr extends Se{constructor(e){super(),$e(this,e,ao,lo,xe,{fig:1})}}function co(r){let e,n,t,o;return{c(){e=E("button"),n=we(r[0]),v(e,"type","button"),v(e,"class","mb-2.5 mr-1.5 py-3 px-4 inline-flex justify-center items-center gap-2 rounded-md border-2 border-green-200 font-semibold text-green-500 hover:text-white hover:bg-green-500 hover:border-green-500 focus:outline-none focus:ring-2 focus:ring-green-200 focus:ring-offset-2 transition-all text-sm dark:focus:ring-offset-gray-800")},m(i,s){U(i,e,s),w(e,n),t||(o=je(e,"click",r[1]),t=!0)},p(i,[s]){s&1&&Ve(n,i[0])},i:se,o:se,d(i){i&&G(e),t=!1,o()}}}function uo(r,e,n){let{message:t}=e,{onSubmit:o}=e;function i(){o(t)}return r.$$set=s=>{"message"in s&&n(0,t=s.message),"onSubmit"in s&&n(2,o=s.onSubmit)},[t,i,o]}class ur extends Se{constructor(e){super(),$e(this,e,uo,co,xe,{message:0,onSubmit:2})}}function fo(r){let e,n,t,o,i,s,l,c,a;return{c(){e=E("div"),n=E("div"),t=E("div"),t.innerHTML='<svg class="h-4 w-4 text-yellow-400 mt-0.5" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"></path></svg>',o=Z(),i=E("div"),s=E("h3"),s.textContent="Error",l=Z(),c=E("div"),a=we(r[0]),v(t,"class","flex-shrink-0"),v(s,"class","text-sm text-yellow-800 font-semibold"),v(c,"class","mt-1 text-sm text-yellow-700"),v(i,"class","ml-4"),v(n,"class","flex"),v(e,"class","bg-yellow-50 border border-yellow-200 rounded-md p-4"),v(e,"role","alert")},m(d,g){U(d,e,g),w(e,n),w(n,t),w(n,o),w(n,i),w(i,s),w(i,l),w(i,c),w(c,a)},p(d,[g]){g&1&&Ve(a,d[0])},i:se,o:se,d(d){d&&G(e)}}}function po(r,e,n){let{message:t}=e;return r.$$set=o=>{"message"in o&&n(0,t=o.message)},[t]}let fr=class extends Se{constructor(e){super(),$e(this,e,po,fo,xe,{message:0})}};function go(r){let e,n;const t=r[1].default,o=Gt(t,r,r[0],null);return{c(){e=E("div"),o&&o.c(),v(e,"class","font-mono whitespace-pre-wrap")},m(i,s){U(i,e,s),o&&o.m(e,null),n=!0},p(i,[s]){o&&o.p&&(!n||s&1)&&Zt(o,t,i,i[0],n?Ut(t,i[0],s,null):Wt(i[0]),null)},i(i){n||(M(o,i),n=!0)},o(i){I(o,i),n=!1},d(i){i&&G(e),o&&o.d(i)}}}function ho(r,e,n){let{$$slots:t={},$$scope:o}=e;return r.$$set=i=>{"$$scope"in i&&n(0,o=i.$$scope)},[o,t]}class dr extends Se{constructor(e){super(),$e(this,e,ho,go,xe,{})}}function mo(r){let e,n,t,o,i,s;return t=new Ht({props:{message:"Train",onSubmit:r[3]}}),{c(){e=E("textarea"),n=Z(),J(t.$$.fragment),v(e,"rows","6"),v(e,"class","block p-2.5 w-full text-blue-600 hover:text-blue-500 dark:text-blue-500 dark:hover:text-blue-400 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500 font-mono"),v(e,"placeholder","SELECT col1, col2, col3 FROM ...")},m(l,c){U(l,e,c),bt(e,r[1]),U(l,n,c),F(t,l,c),o=!0,i||(s=je(e,"input",r[2]),i=!0)},p(l,[c]){c&2&&bt(e,l[1]);const a={};c&3&&(a.onSubmit=l[3]),t.$set(a)},i(l){o||(M(t.$$.fragment,l),o=!0)},o(l){I(t.$$.fragment,l),o=!1},d(l){l&&(G(e),G(n)),Y(t,l),i=!1,s()}}}function yo(r,e,n){let{onSubmit:t}=e,o;function i(){o=this.value,n(1,o)}const s=()=>t(o);return r.$$set=l=>{"onSubmit"in l&&n(0,t=l.onSubmit)},[t,o,i,s]}class bo extends Se{constructor(e){super(),$e(this,e,yo,mo,xe,{onSubmit:0})}}function Dn(r,e,n){const t=r.slice();return t[12]=e[n],t}function Hn(r,e,n){const t=r.slice();return t[15]=e[n],t}function Mn(r,e,n){const t=r.slice();return t[18]=e[n],t}function Rn(r,e,n){const t=r.slice();return t[18]=e[n],t}function Bn(r){let e,n;return e=new Ke({props:{$$slots:{default:[_o]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388618&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function In(r){let e,n;return e=new Ht({props:{message:r[18],onSubmit:r[3]}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&2&&(i.message=t[18]),o&8&&(i.onSubmit=t[3]),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function vo(r){let e=r[1].header+"",n,t,o,i,s=_e(r[1].questions),l=[];for(let a=0;a<s.length;a+=1)l[a]=In(Rn(r,s,a));const c=a=>I(l[a],1,1,()=>{l[a]=null});return{c(){n=we(e),t=Z();for(let a=0;a<l.length;a+=1)l[a].c();o=nt()},m(a,d){U(a,n,d),U(a,t,d);for(let g=0;g<l.length;g+=1)l[g]&&l[g].m(a,d);U(a,o,d),i=!0},p(a,d){if((!i||d&2)&&e!==(e=a[1].header+"")&&Ve(n,e),d&10){s=_e(a[1].questions);let g;for(g=0;g<s.length;g+=1){const k=Rn(a,s,g);l[g]?(l[g].p(k,d),M(l[g],1)):(l[g]=In(k),l[g].c(),M(l[g],1),l[g].m(o.parentNode,o))}for(Ne(),g=s.length;g<l.length;g+=1)c(g);Qe()}},i(a){if(!i){for(let d=0;d<s.length;d+=1)M(l[d]);i=!0}},o(a){l=l.filter(Boolean);for(let d=0;d<l.length;d+=1)I(l[d]);i=!1},d(a){a&&(G(n),G(t),G(o)),Je(l,a)}}}function _o(r){let e,n;return e=new lt({props:{$$slots:{default:[vo]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388618&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function wo(r){let e,n;return e=new Ke({props:{$$slots:{default:[Po]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388612&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function ko(r){let e,n;return e=new Ke({props:{$$slots:{default:[Ao]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388612&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function xo(r){let e,n;return e=new Mt({props:{message:"Put your SQL here",$$slots:{default:[Do]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388672&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function $o(r){let e,n,t,o,i,s,l,c;return e=new Mt({props:{message:r[15].question}}),t=new Ke({props:{$$slots:{default:[Ro]},$$scope:{ctx:r}}}),i=new Ke({props:{$$slots:{default:[Bo]},$$scope:{ctx:r}}}),l=new Ke({props:{$$slots:{default:[Io]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment),n=Z(),J(t.$$.fragment),o=Z(),J(i.$$.fragment),s=Z(),J(l.$$.fragment)},m(a,d){F(e,a,d),U(a,n,d),F(t,a,d),U(a,o,d),F(i,a,d),U(a,s,d),F(l,a,d),c=!0},p(a,d){const g={};d&4&&(g.message=a[15].question),e.$set(g);const k={};d&8388612&&(k.$$scope={dirty:d,ctx:a}),t.$set(k);const x={};d&8388612&&(x.$$scope={dirty:d,ctx:a}),i.$set(x);const D={};d&8388612&&(D.$$scope={dirty:d,ctx:a}),l.$set(D)},i(a){c||(M(e.$$.fragment,a),M(t.$$.fragment,a),M(i.$$.fragment,a),M(l.$$.fragment,a),c=!0)},o(a){I(e.$$.fragment,a),I(t.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),c=!1},d(a){a&&(G(n),G(o),G(s)),Y(e,a),Y(t,a),Y(i,a),Y(l,a)}}}function So(r){let e,n;return e=new Ke({props:{$$slots:{default:[No]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388612&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Oo(r){let e,n,t,o,i,s,l,c;e=new Ke({props:{$$slots:{default:[Qo]},$$scope:{ctx:r}}}),t=new Ke({props:{$$slots:{default:[zo]},$$scope:{ctx:r}}});const a=[Uo,Go],d=[];function g(k,x){return k[0]===!0?0:k[0]===!1?1:-1}return~(i=g(r))&&(s=d[i]=a[i](r)),{c(){J(e.$$.fragment),n=Z(),J(t.$$.fragment),o=Z(),s&&s.c(),l=nt()},m(k,x){F(e,k,x),U(k,n,x),F(t,k,x),U(k,o,x),~i&&d[i].m(k,x),U(k,l,x),c=!0},p(k,x){const D={};x&8388612&&(D.$$scope={dirty:x,ctx:k}),e.$set(D);const L={};x&8388609&&(L.$$scope={dirty:x,ctx:k}),t.$set(L);let m=i;i=g(k),i!==m&&(s&&(Ne(),I(d[m],1,1,()=>{d[m]=null}),Qe()),~i?(s=d[i],s||(s=d[i]=a[i](k),s.c()),M(s,1),s.m(l.parentNode,l)):s=null)},i(k){c||(M(e.$$.fragment,k),M(t.$$.fragment,k),M(s),c=!0)},o(k){I(e.$$.fragment,k),I(t.$$.fragment,k),I(s),c=!1},d(k){k&&(G(n),G(o),G(l)),Y(e,k),Y(t,k),~i&&d[i].d(k)}}}function Lo(r){let e,n;return e=new Ke({props:{$$slots:{default:[Zo]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388612&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function To(r){let e,n;return e=new Ke({props:{$$slots:{default:[Fo]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388620&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Eo(r){let e,n;return e=new Ke({props:{$$slots:{default:[Ko]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388612&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Co(r){let e,n;return e=new Mt({props:{message:r[15].question}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&4&&(i.message=t[15].question),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function jo(r){let e=JSON.stringify(r[15])+"",n;return{c(){n=we(e)},m(t,o){U(t,n,o)},p(t,o){o&4&&e!==(e=JSON.stringify(t[15])+"")&&Ve(n,e)},d(t){t&&G(n)}}}function Po(r){let e,n;return e=new lt({props:{$$slots:{default:[jo]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388612&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function qo(r){let e=r[15].text+"",n;return{c(){n=we(e)},m(t,o){U(t,n,o)},p(t,o){o&4&&e!==(e=t[15].text+"")&&Ve(n,e)},d(t){t&&G(n)}}}function Ao(r){let e,n;return e=new lt({props:{$$slots:{default:[qo]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388612&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Do(r){let e,n;return e=new bo({props:{onSubmit:r[6]}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&64&&(i.onSubmit=t[6]),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Ho(r){let e=r[15].sql+"",n;return{c(){n=we(e)},m(t,o){U(t,n,o)},p(t,o){o&4&&e!==(e=t[15].sql+"")&&Ve(n,e)},d(t){t&&G(n)}}}function Mo(r){let e,n;return e=new dr({props:{$$slots:{default:[Ho]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388612&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Ro(r){let e,n;return e=new lt({props:{$$slots:{default:[Mo]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388612&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Bo(r){let e,n;return e=new ar({props:{id:r[15].id,df:r[15].df}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&4&&(i.id=t[15].id),o&4&&(i.df=t[15].df),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Io(r){let e,n;return e=new cr({props:{fig:r[15].fig}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&4&&(i.fig=t[15].fig),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function No(r){let e,n;return e=new fr({props:{message:r[15].error}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&4&&(i.message=t[15].error),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Qo(r){let e,n;return e=new cr({props:{fig:r[15].fig}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&4&&(i.fig=t[15].fig),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Vo(r){let e;return{c(){e=we("Were the results correct?")},m(n,t){U(n,e,t)},d(n){n&&G(e)}}}function Nn(r){let e,n,t,o;return e=new Ht({props:{message:"Yes",onSubmit:r[9]}}),t=new Ht({props:{message:"No",onSubmit:r[10]}}),{c(){J(e.$$.fragment),n=Z(),J(t.$$.fragment)},m(i,s){F(e,i,s),U(i,n,s),F(t,i,s),o=!0},p(i,s){const l={};s&1&&(l.onSubmit=i[9]),e.$set(l);const c={};s&1&&(c.onSubmit=i[10]),t.$set(c)},i(i){o||(M(e.$$.fragment,i),M(t.$$.fragment,i),o=!0)},o(i){I(e.$$.fragment,i),I(t.$$.fragment,i),o=!1},d(i){i&&G(n),Y(e,i),Y(t,i)}}}function zo(r){let e,n,t,o;e=new lt({props:{$$slots:{default:[Vo]},$$scope:{ctx:r}}});let i=r[0]===null&&Nn(r);return{c(){J(e.$$.fragment),n=Z(),i&&i.c(),t=nt()},m(s,l){F(e,s,l),U(s,n,l),i&&i.m(s,l),U(s,t,l),o=!0},p(s,l){const c={};l&8388608&&(c.$$scope={dirty:l,ctx:s}),e.$set(c),s[0]===null?i?(i.p(s,l),l&1&&M(i,1)):(i=Nn(s),i.c(),M(i,1),i.m(t.parentNode,t)):i&&(Ne(),I(i,1,1,()=>{i=null}),Qe())},i(s){o||(M(e.$$.fragment,s),M(i),o=!0)},o(s){I(e.$$.fragment,s),I(i),o=!1},d(s){s&&(G(n),G(t)),Y(e,s),i&&i.d(s)}}}function Go(r){let e,n;return e=new Mt({props:{message:"No, the results were not correct."}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Uo(r){let e,n;return e=new Mt({props:{message:"Yes, the results were correct."}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Zo(r){let e,n;return e=new ar({props:{id:r[15].id,df:r[15].df}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&4&&(i.id=t[15].id),o&4&&(i.df=t[15].df),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Qn(r){let e,n;return e=new Ht({props:{message:r[18],onSubmit:r[3]}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&4&&(i.message=t[18]),o&8&&(i.onSubmit=t[3]),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Wo(r){let e=r[15].header+"",n,t,o,i,s=_e(r[15].questions),l=[];for(let a=0;a<s.length;a+=1)l[a]=Qn(Mn(r,s,a));const c=a=>I(l[a],1,1,()=>{l[a]=null});return{c(){n=we(e),t=Z();for(let a=0;a<l.length;a+=1)l[a].c();o=nt()},m(a,d){U(a,n,d),U(a,t,d);for(let g=0;g<l.length;g+=1)l[g]&&l[g].m(a,d);U(a,o,d),i=!0},p(a,d){if((!i||d&4)&&e!==(e=a[15].header+"")&&Ve(n,e),d&12){s=_e(a[15].questions);let g;for(g=0;g<s.length;g+=1){const k=Mn(a,s,g);l[g]?(l[g].p(k,d),M(l[g],1)):(l[g]=Qn(k),l[g].c(),M(l[g],1),l[g].m(o.parentNode,o))}for(Ne(),g=s.length;g<l.length;g+=1)c(g);Qe()}},i(a){if(!i){for(let d=0;d<s.length;d+=1)M(l[d]);i=!0}},o(a){l=l.filter(Boolean);for(let d=0;d<l.length;d+=1)I(l[d]);i=!1},d(a){a&&(G(n),G(t),G(o)),Je(l,a)}}}function Fo(r){let e,n;return e=new lt({props:{$$slots:{default:[Wo]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388620&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Yo(r){let e,n;return e=new Pr({props:{text:r[15].text}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&4&&(i.text=t[15].text),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Jo(r){let e,n;return e=new dr({props:{$$slots:{default:[Yo]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388612&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Ko(r){let e,n;return e=new lt({props:{$$slots:{default:[Jo]},$$scope:{ctx:r}}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8388612&&(i.$$scope={dirty:o,ctx:t}),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Vn(r){let e,n,t,o;const i=[Co,Eo,To,Lo,Oo,So,$o,xo,ko,wo],s=[];function l(c,a){return c[15].type==="user_question"?0:c[15].type==="sql"?1:c[15].type==="question_list"?2:c[15].type==="df"?3:c[15].type==="plotly_figure"?4:c[15].type==="error"?5:c[15].type==="question_cache"?6:c[15].type==="user_sql"?7:c[15].type==="text"?8:9}return e=l(r),n=s[e]=i[e](r),{c(){n.c(),t=nt()},m(c,a){s[e].m(c,a),U(c,t,a),o=!0},p(c,a){let d=e;e=l(c),e===d?s[e].p(c,a):(Ne(),I(s[d],1,1,()=>{s[d]=null}),Qe(),n=s[e],n?n.p(c,a):(n=s[e]=i[e](c),n.c()),M(n,1),n.m(t.parentNode,t))},i(c){o||(M(n),o=!0)},o(c){I(n),o=!1},d(c){c&&G(t),s[e].d(c)}}}function zn(r){let e,n;return e=new to({}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Xo(r){let e,n;return e=new Ur({props:{onSubmit:r[3]}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8&&(i.onSubmit=t[3]),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function ei(r){let e,n,t,o;e=new ur({props:{message:"New Question",onSubmit:r[5]}});let i=_e(r[2]),s=[];for(let c=0;c<i.length;c+=1)s[c]=Un(Dn(r,i,c));const l=c=>I(s[c],1,1,()=>{s[c]=null});return{c(){J(e.$$.fragment),n=Z();for(let c=0;c<s.length;c+=1)s[c].c();t=nt()},m(c,a){F(e,c,a),U(c,n,a);for(let d=0;d<s.length;d+=1)s[d]&&s[d].m(c,a);U(c,t,a),o=!0},p(c,a){const d={};if(a&32&&(d.onSubmit=c[5]),e.$set(d),a&20){i=_e(c[2]);let g;for(g=0;g<i.length;g+=1){const k=Dn(c,i,g);s[g]?(s[g].p(k,a),M(s[g],1)):(s[g]=Un(k),s[g].c(),M(s[g],1),s[g].m(t.parentNode,t))}for(Ne(),g=i.length;g<s.length;g+=1)l(g);Qe()}},i(c){if(!o){M(e.$$.fragment,c);for(let a=0;a<i.length;a+=1)M(s[a]);o=!0}},o(c){I(e.$$.fragment,c),s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)I(s[a]);o=!1},d(c){c&&(G(n),G(t)),Y(e,c),Je(s,c)}}}function Gn(r){let e,n;function t(){return r[11](r[12])}return e=new ur({props:{message:"Re-Run SQL",onSubmit:t}}),{c(){J(e.$$.fragment)},m(o,i){F(e,o,i),n=!0},p(o,i){r=o;const s={};i&20&&(s.onSubmit=t),e.$set(s)},i(o){n||(M(e.$$.fragment,o),n=!0)},o(o){I(e.$$.fragment,o),n=!1},d(o){Y(e,o)}}}function Un(r){let e,n,t=r[12].type==="question_cache"&&Gn(r);return{c(){t&&t.c(),e=nt()},m(o,i){t&&t.m(o,i),U(o,e,i),n=!0},p(o,i){o[12].type==="question_cache"?t?(t.p(o,i),i&4&&M(t,1)):(t=Gn(o),t.c(),M(t,1),t.m(e.parentNode,e)):t&&(Ne(),I(t,1,1,()=>{t=null}),Qe())},i(o){n||(M(t),n=!0)},o(o){I(t),n=!1},d(o){o&&G(e),t&&t.d(o)}}}function ti(r){let e,n,t,o,i,s,l,c,a,d,g,k,x,D;t=new Rr({});let L=r[1]&&r[1].type=="question_list"&&!r[7]&&Bn(r),m=_e(r[2]),h=[];for(let u=0;u<m.length;u+=1)h[u]=Vn(Hn(r,m,u));const p=u=>I(h[u],1,1,()=>{h[u]=null});let _=r[8]&&zn();d=new Wr({});const A=[ei,Xo],P=[];function T(u,f){return u[7]?0:1}return k=T(r),x=P[k]=A[k](r),{c(){e=E("div"),n=E("div"),J(t.$$.fragment),o=Z(),L&&L.c(),i=Z(),s=E("ul");for(let u=0;u<h.length;u+=1)h[u].c();l=Z(),_&&_.c(),c=Z(),a=E("footer"),J(d.$$.fragment),g=Z(),x.c(),v(s,"class","mt-16 space-y-5"),v(n,"class","py-10 lg:py-14"),v(a,"class","max-w-4xl mx-auto sticky bottom-0 z-10 p-3 sm:py-6"),v(e,"class","relative h-screen w-full lg:pl-64")},m(u,f){U(u,e,f),w(e,n),F(t,n,null),w(n,o),L&&L.m(n,null),w(n,i),w(n,s);for(let O=0;O<h.length;O+=1)h[O]&&h[O].m(s,null);w(s,l),_&&_.m(s,null),w(e,c),w(e,a),F(d,a,null),w(a,g),P[k].m(a,null),D=!0},p(u,[f]){if(u[1]&&u[1].type=="question_list"&&!u[7]?L?(L.p(u,f),f&130&&M(L,1)):(L=Bn(u),L.c(),M(L,1),L.m(n,i)):L&&(Ne(),I(L,1,1,()=>{L=null}),Qe()),f&77){m=_e(u[2]);let C;for(C=0;C<m.length;C+=1){const S=Hn(u,m,C);h[C]?(h[C].p(S,f),M(h[C],1)):(h[C]=Vn(S),h[C].c(),M(h[C],1),h[C].m(s,l))}for(Ne(),C=m.length;C<h.length;C+=1)p(C);Qe()}u[8]?_?f&256&&M(_,1):(_=zn(),_.c(),M(_,1),_.m(s,null)):_&&(Ne(),I(_,1,1,()=>{_=null}),Qe());let O=k;k=T(u),k===O?P[k].p(u,f):(Ne(),I(P[O],1,1,()=>{P[O]=null}),Qe(),x=P[k],x?x.p(u,f):(x=P[k]=A[k](u),x.c()),M(x,1),x.m(a,null))},i(u){if(!D){M(t.$$.fragment,u),M(L);for(let f=0;f<m.length;f+=1)M(h[f]);M(_),M(d.$$.fragment,u),M(x),D=!0}},o(u){I(t.$$.fragment,u),I(L),h=h.filter(Boolean);for(let f=0;f<h.length;f+=1)I(h[f]);I(_),I(d.$$.fragment,u),I(x),D=!1},d(u){u&&G(e),Y(t),L&&L.d(),Je(h,u),_&&_.d(),Y(d),P[k].d()}}}function ni(r,e,n){let{suggestedQuestions:t=null}=e,{messageLog:o}=e,{newQuestion:i}=e,{rerunSql:s}=e,{clearMessages:l}=e,{onUpdateSql:c}=e,{question_asked:a}=e,{marked_correct:d}=e,{thinking:g}=e;const k=()=>n(0,d=!0),x=()=>n(0,d=!1),D=L=>L.type==="question_cache"?s(L.id):void 0;return r.$$set=L=>{"suggestedQuestions"in L&&n(1,t=L.suggestedQuestions),"messageLog"in L&&n(2,o=L.messageLog),"newQuestion"in L&&n(3,i=L.newQuestion),"rerunSql"in L&&n(4,s=L.rerunSql),"clearMessages"in L&&n(5,l=L.clearMessages),"onUpdateSql"in L&&n(6,c=L.onUpdateSql),"question_asked"in L&&n(7,a=L.question_asked),"marked_correct"in L&&n(0,d=L.marked_correct),"thinking"in L&&n(8,g=L.thinking)},[d,t,o,i,s,l,c,a,g,k,x,D]}class ri extends Se{constructor(e){super(),$e(this,e,ni,ti,xe,{suggestedQuestions:1,messageLog:2,newQuestion:3,rerunSql:4,clearMessages:5,onUpdateSql:6,question_asked:7,marked_correct:0,thinking:8})}}function oi(r){let e,n,t,o,i,s,l,c,a,d,g,k,x,D,L,m,h,p,_;return{c(){e=E("div"),n=E("div"),t=E("div"),o=E("div"),i=E("h3"),i.textContent="Are you sure?",s=Z(),l=E("button"),l.innerHTML='<span class="sr-only">Close</span> <svg class="w-3.5 h-3.5" width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.258206 1.00652C0.351976 0.912791 0.479126 0.860131 0.611706 0.860131C0.744296 0.860131 0.871447 0.912791 0.965207 1.00652L3.61171 3.65302L6.25822 1.00652C6.30432 0.958771 6.35952 0.920671 6.42052 0.894471C6.48152 0.868271 6.54712 0.854471 6.61352 0.853901C6.67992 0.853321 6.74572 0.865971 6.80722 0.891111C6.86862 0.916251 6.92442 0.953381 6.97142 1.00032C7.01832 1.04727 7.05552 1.1031 7.08062 1.16454C7.10572 1.22599 7.11842 1.29183 7.11782 1.35822C7.11722 1.42461 7.10342 1.49022 7.07722 1.55122C7.05102 1.61222 7.01292 1.6674 6.96522 1.71352L4.31871 4.36002L6.96522 7.00648C7.05632 7.10078 7.10672 7.22708 7.10552 7.35818C7.10442 7.48928 7.05182 7.61468 6.95912 7.70738C6.86642 7.80018 6.74102 7.85268 6.60992 7.85388C6.47882 7.85498 6.35252 7.80458 6.25822 7.71348L3.61171 5.06702L0.965207 7.71348C0.870907 7.80458 0.744606 7.85498 0.613506 7.85388C0.482406 7.85268 0.357007 7.80018 0.264297 7.70738C0.171597 7.61468 0.119017 7.48928 0.117877 7.35818C0.116737 7.22708 0.167126 7.10078 0.258206 7.00648L2.90471 4.36002L0.258206 1.71352C0.164476 1.61976 0.111816 1.4926 0.111816 1.36002C0.111816 1.22744 0.164476 1.10028 0.258206 1.00652Z" fill="currentColor"></path></svg>',c=Z(),a=E("div"),d=E("p"),g=we(r[0]),k=Z(),x=E("div"),D=E("button"),D.textContent="Close",L=Z(),m=E("button"),h=we(r[1]),v(i,"class","font-bold text-gray-800 dark:text-white"),v(l,"type","button"),v(l,"class","hs-dropdown-toggle inline-flex flex-shrink-0 justify-center items-center h-8 w-8 rounded-md text-gray-500 hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 focus:ring-offset-white transition-all text-sm dark:focus:ring-gray-700 dark:focus:ring-offset-gray-800"),v(l,"data-hs-overlay","#hs-vertically-centered-modal"),v(o,"class","flex justify-between items-center py-3 px-4 border-b dark:border-gray-700"),v(d,"class","text-gray-800 dark:text-gray-400"),v(a,"class","p-4 overflow-y-auto"),v(D,"type","button"),v(D,"class","hs-dropdown-toggle py-3 px-4 inline-flex justify-center items-center gap-2 rounded-md border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-blue-600 transition-all text-sm dark:bg-slate-900 dark:hover:bg-slate-800 dark:border-gray-700 dark:text-gray-400 dark:hover:text-white dark:focus:ring-offset-gray-800"),v(D,"data-hs-overlay","#hs-vertically-centered-modal"),v(m,"class","py-3 px-4 inline-flex justify-center items-center gap-2 rounded-md border border-transparent font-semibold bg-blue-500 text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all text-sm dark:focus:ring-offset-gray-800"),v(x,"class","flex justify-end items-center gap-x-2 py-3 px-4 border-t dark:border-gray-700"),v(t,"class","flex flex-col bg-white border shadow-sm rounded-xl dark:bg-gray-800 dark:border-gray-700 dark:shadow-slate-700/[.7]"),v(n,"class","hs-overlay-open:mt-7 hs-overlay-open:opacity-100 hs-overlay-open:duration-500 mt-0 opacity-0 ease-out transition-all sm:max-w-lg sm:w-full m-3 sm:mx-auto min-h-[calc(100%-3.5rem)] flex items-center"),v(e,"class","hs-overlay open w-full h-full fixed top-0 left-0 z-[60] overflow-x-hidden overflow-y-auto")},m(A,P){U(A,e,P),w(e,n),w(n,t),w(t,o),w(o,i),w(o,s),w(o,l),w(t,c),w(t,a),w(a,d),w(d,g),w(t,k),w(t,x),w(x,D),w(x,L),w(x,m),w(m,h),p||(_=[je(l,"click",function(){pt(r[2])&&r[2].apply(this,arguments)}),je(D,"click",function(){pt(r[2])&&r[2].apply(this,arguments)}),je(m,"click",function(){pt(r[3])&&r[3].apply(this,arguments)})],p=!0)},p(A,[P]){r=A,P&1&&Ve(g,r[0]),P&2&&Ve(h,r[1])},i:se,o:se,d(A){A&&G(e),p=!1,ot(_)}}}function ii(r,e,n){let{message:t}=e,{buttonLabel:o}=e,{onClose:i}=e,{onConfirm:s}=e;return r.$$set=l=>{"message"in l&&n(0,t=l.message),"buttonLabel"in l&&n(1,o=l.buttonLabel),"onClose"in l&&n(2,i=l.onClose),"onConfirm"in l&&n(3,s=l.onConfirm)},[t,o,i,s]}class si extends Se{constructor(e){super(),$e(this,e,ii,oi,xe,{message:0,buttonLabel:1,onClose:2,onConfirm:3})}}function Zn(r,e,n){const t=r.slice();return t[10]=e[n].name,t[11]=e[n].description,t[12]=e[n].example,t}function Wn(r){let e,n,t,o,i,s,l,c,a,d,g,k;return d=wr(r[7][0]),{c(){e=E("div"),n=E("div"),t=E("input"),o=Z(),i=E("label"),s=E("span"),s.textContent=`${r[10]}`,l=Z(),c=E("span"),c.textContent=`${r[11]}`,a=Z(),v(t,"id","hs-radio-"+r[10]),t.__value=r[10],bt(t,t.__value),v(t,"name","hs-radio-with-description"),v(t,"type","radio"),v(t,"class","border-gray-200 rounded-full text-blue-600 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800"),v(t,"aria-describedby","hs-radio-delete-description"),v(n,"class","flex items-center h-5 mt-1"),v(s,"class","block text-sm font-semibold text-gray-800 dark:text-gray-300"),v(c,"id","hs-radio-ddl-description"),v(c,"class","block text-sm text-gray-600 dark:text-gray-500"),v(i,"for","hs-radio-"+r[10]),v(i,"class","ml-3"),v(e,"class","relative flex items-start"),d.p(t)},m(x,D){U(x,e,D),w(e,n),w(n,t),t.checked=t.__value===r[0],w(e,o),w(e,i),w(i,s),w(i,l),w(i,c),w(e,a),g||(k=je(t,"change",r[6]),g=!0)},p(x,D){D&1&&(t.checked=t.__value===x[0])},d(x){x&&G(e),d.r(),g=!1,k()}}}function li(r){let e,n,t,o,i,s,l,c,a,d,g,k,x,D,L,m,h,p,_,A,P,T,u,f,O,C=_e(r[3]),S=[];for(let j=0;j<C.length;j+=1)S[j]=Wn(Zn(r,C,j));return{c(){var j;e=E("div"),n=E("div"),t=E("div"),o=E("div"),i=E("h2"),i.textContent="Add Training Data",s=Z(),l=E("button"),l.innerHTML='<span class="sr-only">Close</span> <svg class="w-3.5 h-3.5" width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.258206 1.00652C0.351976 0.912791 0.479126 0.860131 0.611706 0.860131C0.744296 0.860131 0.871447 0.912791 0.965207 1.00652L3.61171 3.65302L6.25822 1.00652C6.30432 0.958771 6.35952 0.920671 6.42052 0.894471C6.48152 0.868271 6.54712 0.854471 6.61352 0.853901C6.67992 0.853321 6.74572 0.865971 6.80722 0.891111C6.86862 0.916251 6.92442 0.953381 6.97142 1.00032C7.01832 1.04727 7.05552 1.1031 7.08062 1.16454C7.10572 1.22599 7.11842 1.29183 7.11782 1.35822C7.11722 1.42461 7.10342 1.49022 7.07722 1.55122C7.05102 1.61222 7.01292 1.6674 6.96522 1.71352L4.31871 4.36002L6.96522 7.00648C7.05632 7.10078 7.10672 7.22708 7.10552 7.35818C7.10442 7.48928 7.05182 7.61468 6.95912 7.70738C6.86642 7.80018 6.74102 7.85268 6.60992 7.85388C6.47882 7.85498 6.35252 7.80458 6.25822 7.71348L3.61171 5.06702L0.965207 7.71348C0.870907 7.80458 0.744606 7.85498 0.613506 7.85388C0.482406 7.85268 0.357007 7.80018 0.264297 7.70738C0.171597 7.61468 0.119017 7.48928 0.117877 7.35818C0.116737 7.22708 0.167126 7.10078 0.258206 7.00648L2.90471 4.36002L0.258206 1.71352C0.164476 1.61976 0.111816 1.4926 0.111816 1.36002C0.111816 1.22744 0.164476 1.10028 0.258206 1.00652Z" fill="currentColor"></path></svg>',c=Z(),a=E("span"),a.textContent="Training Data Type",d=Z(),g=E("div");for(let R=0;R<S.length;R+=1)S[R].c();k=Z(),x=E("div"),D=E("label"),L=we("Your "),m=we(r[0]),h=Z(),p=E("div"),_=E("textarea"),P=Z(),T=E("div"),u=E("button"),u.textContent="Save",v(i,"class","text-xl text-gray-800 font-bold sm:text-3xl dark:text-white"),v(l,"type","button"),v(l,"class","hs-dropdown-toggle inline-flex flex-shrink-0 justify-center items-center h-8 w-8 rounded-md text-gray-500 hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 focus:ring-offset-white transition-all text-sm dark:focus:ring-gray-700 dark:focus:ring-offset-gray-800"),v(l,"data-hs-overlay","#hs-vertically-centered-modal"),v(o,"class","flex justify-between items-center py-3 px-4 border-b dark:border-gray-700 mb-2"),v(a,"class","block mb-2 text-sm font-medium dark:text-white"),v(g,"class","grid space-y-3 mb-1"),v(D,"for","hs-feedback-post-comment-textarea-1"),v(D,"class","block mt-2 mb-2 text-sm font-medium dark:text-white"),v(_,"id","hs-feedback-post-comment-textarea-1"),v(_,"name","hs-feedback-post-comment-textarea-1"),v(_,"rows","3"),v(_,"class","py-3 px-4 block w-full border border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 sm:p-4 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400"),v(_,"placeholder",A=((j=r[3].find(r[8]))==null?void 0:j.example)??"No example available"),v(p,"class","mt-1"),v(x,"class","mt-2 border-t dark:border-gray-700"),v(u,"class","py-3 px-4 inline-flex justify-center items-center gap-2 rounded-md border border-transparent font-semibold bg-blue-500 text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all dark:focus:ring-offset-gray-800"),v(T,"class","mt-6 grid"),v(t,"class","mt-5 p-4 relative z-10 bg-white border rounded-xl sm:mt-10 md:p-10 dark:bg-gray-800 dark:border-gray-700"),v(n,"class","mx-auto max-w-2xl"),v(e,"class","max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 mx-auto")},m(j,R){U(j,e,R),w(e,n),w(n,t),w(t,o),w(o,i),w(o,s),w(o,l),w(t,c),w(t,a),w(t,d),w(t,g);for(let q=0;q<S.length;q+=1)S[q]&&S[q].m(g,null);w(t,k),w(t,x),w(x,D),w(D,L),w(D,m),w(x,h),w(x,p),w(p,_),bt(_,r[2]),w(t,P),w(t,T),w(T,u),f||(O=[je(l,"click",function(){pt(r[1])&&r[1].apply(this,arguments)}),je(_,"input",r[9]),je(u,"click",r[4])],f=!0)},p(j,[R]){var q;if(r=j,R&9){C=_e(r[3]);let B;for(B=0;B<C.length;B+=1){const N=Zn(r,C,B);S[B]?S[B].p(N,R):(S[B]=Wn(N),S[B].c(),S[B].m(g,null))}for(;B<S.length;B+=1)S[B].d(1);S.length=C.length}R&1&&Ve(m,r[0]),R&1&&A!==(A=((q=r[3].find(r[8]))==null?void 0:q.example)??"No example available")&&v(_,"placeholder",A),R&4&&bt(_,r[2])},i:se,o:se,d(j){j&&G(e),Je(S,j),f=!1,ot(O)}}}function ai(r,e,n){let{onDismiss:t}=e,{onTrain:o}=e,{selectedTrainingDataType:i="SQL"}=e,s=[{name:"DDL",description:"These are the CREATE TABLE statements that define your database structure.",example:"CREATE TABLE table_name (column_1 datatype, column_2 datatype, column_3 datatype);"},{name:"Documentation",description:"This can be any text-based documentation. Keep the chunks small and focused on a single topic.",example:"Our definition of ABC is XYZ."},{name:"SQL",description:"This can be any SQL statement that works. The more the merrier.",example:"SELECT column_1, column_2 FROM table_name;"}],l="";const c=()=>{o(l,i.toLowerCase())},a=[[]];function d(){i=this.__value,n(0,i)}const g=x=>x.name===i;function k(){l=this.value,n(2,l)}return r.$$set=x=>{"onDismiss"in x&&n(1,t=x.onDismiss),"onTrain"in x&&n(5,o=x.onTrain),"selectedTrainingDataType"in x&&n(0,i=x.selectedTrainingDataType)},[i,t,l,s,c,o,d,a,g,k]}class ci extends Se{constructor(e){super(),$e(this,e,ai,li,xe,{onDismiss:1,onTrain:5,selectedTrainingDataType:0})}}function Fn(r,e,n){const t=r.slice();return t[21]=e[n],t}function Yn(r,e,n){const t=r.slice();return t[24]=e[n],t}function Jn(r,e,n){const t=r.slice();return t[24]=e[n],t}function Kn(r){let e,n;return e=new ci({props:{onDismiss:r[13],onTrain:r[0]}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&1&&(i.onTrain=t[0]),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function ui(r){let e;return{c(){e=we("Action")},m(n,t){U(n,e,t)},p:se,d(n){n&&G(e)}}}function fi(r){let e=r[24]+"",n;return{c(){n=we(e)},m(t,o){U(t,n,o)},p:se,d(t){t&&G(n)}}}function Xn(r){let e,n,t,o;function i(c,a){return c[24]!="id"?fi:ui}let l=i(r)(r);return{c(){e=E("th"),n=E("div"),t=E("span"),l.c(),o=Z(),v(t,"class","text-xs font-semibold uppercase tracking-wide text-gray-800 dark:text-gray-200"),v(n,"class","flex items-center gap-x-2"),v(e,"scope","col"),v(e,"class","px-6 py-3 text-left")},m(c,a){U(c,e,a),w(e,n),w(n,t),l.m(t,null),w(e,o)},p(c,a){l.p(c,a)},d(c){c&&G(e),l.d()}}}function di(r){let e,n,t;function o(){return r[18](r[21],r[24])}return{c(){e=E("button"),e.textContent="Delete",v(e,"type","button"),v(e,"class","py-2 px-3 inline-flex justify-center items-center gap-2 rounded-md border-2 border-red-200 font-semibold text-red-500 hover:text-white hover:bg-red-500 hover:border-red-500 focus:outline-none focus:ring-2 focus:ring-red-200 focus:ring-offset-2 transition-all text-sm dark:focus:ring-offset-gray-800")},m(i,s){U(i,e,s),n||(t=je(e,"click",o),n=!0)},p(i,s){r=i},d(i){i&&G(e),n=!1,t()}}}function pi(r){let e,n=r[21][r[24]]+"",t;return{c(){e=E("span"),t=we(n),v(e,"class","text-gray-800 dark:text-gray-200")},m(o,i){U(o,e,i),w(e,t)},p(o,i){i&16&&n!==(n=o[21][o[24]]+"")&&Ve(t,n)},d(o){o&&G(e)}}}function er(r){let e,n;function t(s,l){return s[24]!="id"?pi:di}let i=t(r)(r);return{c(){e=E("td"),n=E("div"),i.c(),v(n,"class","px-6 py-3"),v(e,"class","h-px w-px ")},m(s,l){U(s,e,l),w(e,n),i.m(n,null)},p(s,l){i.p(s,l)},d(s){s&&G(e),i.d()}}}function tr(r){let e,n,t=_e(r[8]),o=[];for(let i=0;i<t.length;i+=1)o[i]=er(Yn(r,t,i));return{c(){e=E("tr");for(let i=0;i<o.length;i+=1)o[i].c();n=Z()},m(i,s){U(i,e,s);for(let l=0;l<o.length;l+=1)o[l]&&o[l].m(e,null);w(e,n)},p(i,s){if(s&304){t=_e(i[8]);let l;for(l=0;l<t.length;l+=1){const c=Yn(i,t,l);o[l]?o[l].p(c,s):(o[l]=er(c),o[l].c(),o[l].m(e,n))}for(;l<o.length;l+=1)o[l].d(1);o.length=t.length}},d(i){i&&G(e),Je(o,i)}}}function nr(r){let e,n;return e=new si({props:{message:"Are you sure you want to delete this?",buttonLabel:"Delete",onClose:r[19],onConfirm:r[20]}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&32&&(i.onClose=t[19]),o&34&&(i.onConfirm=t[20]),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function gi(r){let e,n,t,o,i,s,l,c,a,d,g,k,x,D,L,m,h,p,_,A,P,T,u,f,O,C,S,j=r[2]+1+"",R,q,B=Math.min(r[3],r[7].length)+"",N,ie,re,Ye,Ae,De,ze,at,me,it,Ge,ct,Lt,Tt,Te=r[6]&&Kn(r),ut=_e(r[8]),Pe=[];for(let X=0;X<ut.length;X+=1)Pe[X]=Xn(Jn(r,ut,X));let Be=_e(r[4]),Oe=[];for(let X=0;X<Be.length;X+=1)Oe[X]=tr(Fn(r,Be,X));let Le=r[5]!=null&&nr(r);return{c(){Te&&Te.c(),e=Z(),n=E("div"),t=E("div"),o=E("div"),i=E("div"),s=E("div"),l=E("div"),c=E("div"),c.innerHTML='<h2 class="text-xl font-semibold text-gray-800 dark:text-gray-200">Training Data</h2> <p class="text-sm text-gray-600 dark:text-gray-400">Add or remove training data. Good training data is the key to accuracy.</p>',a=Z(),d=E("div"),g=E("div"),k=E("button"),k.textContent="View all",x=Z(),D=E("button"),D.innerHTML=`<svg class="w-3 h-3" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M2.63452 7.50001L13.6345 7.5M8.13452 13V2" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg>
|
|
33
|
+
Add training data`,L=Z(),m=E("table"),h=E("thead"),p=E("tr");for(let X=0;X<Pe.length;X+=1)Pe[X].c();_=Z(),A=E("tbody");for(let X=0;X<Oe.length;X+=1)Oe[X].c();P=Z(),T=E("div"),u=E("div"),f=E("p"),f.textContent="Showing:",O=Z(),C=E("div"),S=E("span"),R=we(j),q=we(" - "),N=we(B),ie=Z(),re=E("p"),re.textContent=`of ${r[7].length}`,Ye=Z(),Ae=E("div"),De=E("div"),ze=E("button"),ze.innerHTML=`<svg class="w-3 h-3" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"></path></svg>
|
|
34
|
+
Prev`,at=Z(),me=E("button"),me.innerHTML=`Next
|
|
35
|
+
<svg class="w-3 h-3" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"></path></svg>`,it=Z(),Le&&Le.c(),Ge=nt(),v(k,"class","py-2 px-3 inline-flex justify-center items-center gap-2 rounded-md border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-blue-600 transition-all text-sm dark:bg-slate-900 dark:hover:bg-slate-800 dark:border-gray-700 dark:text-gray-400 dark:hover:text-white dark:focus:ring-offset-gray-800"),v(D,"class","py-2 px-3 inline-flex justify-center items-center gap-2 rounded-md border border-transparent font-semibold bg-blue-500 text-white hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all text-sm dark:focus:ring-offset-gray-800"),v(g,"class","inline-flex gap-x-2"),v(l,"class","px-6 py-4 grid gap-3 md:flex md:justify-between md:items-center border-b border-gray-200 dark:border-gray-700"),v(h,"class","bg-gray-50 dark:bg-slate-800"),v(A,"class","divide-y divide-gray-200 dark:divide-gray-700"),v(m,"class","min-w-full divide-y divide-gray-200 dark:divide-gray-700"),v(f,"class","text-sm text-gray-600 dark:text-gray-400"),v(S,"class","py-2 px-3 pr-9 block w-full border-gray-200 rounded-md text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-slate-900 dark:border-gray-700 dark:text-gray-400"),v(C,"class","max-w-sm space-y-3"),v(re,"class","text-sm text-gray-600 dark:text-gray-400"),v(u,"class","inline-flex items-center gap-x-2"),v(ze,"type","button"),v(ze,"class","py-2 px-3 inline-flex justify-center items-center gap-2 rounded-md border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-blue-600 transition-all text-sm dark:bg-slate-900 dark:hover:bg-slate-800 dark:border-gray-700 dark:text-gray-400 dark:hover:text-white dark:focus:ring-offset-gray-800"),v(me,"type","button"),v(me,"class","py-2 px-3 inline-flex justify-center items-center gap-2 rounded-md border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-blue-600 transition-all text-sm dark:bg-slate-900 dark:hover:bg-slate-800 dark:border-gray-700 dark:text-gray-400 dark:hover:text-white dark:focus:ring-offset-gray-800"),v(De,"class","inline-flex gap-x-2"),v(T,"class","px-6 py-4 grid gap-3 md:flex md:justify-between md:items-center border-t border-gray-200 dark:border-gray-700"),v(s,"class","bg-white border border-gray-200 rounded-xl shadow-sm overflow-hidden dark:bg-slate-900 dark:border-gray-700"),v(i,"class","p-1.5 min-w-full inline-block align-middle"),v(o,"class","-m-1.5 overflow-x-auto"),v(t,"class","flex flex-col"),v(n,"class","max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 mx-auto")},m(X,He){Te&&Te.m(X,He),U(X,e,He),U(X,n,He),w(n,t),w(t,o),w(o,i),w(i,s),w(s,l),w(l,c),w(l,a),w(l,d),w(d,g),w(g,k),w(g,x),w(g,D),w(s,L),w(s,m),w(m,h),w(h,p);for(let oe=0;oe<Pe.length;oe+=1)Pe[oe]&&Pe[oe].m(p,null);w(m,_),w(m,A);for(let oe=0;oe<Oe.length;oe+=1)Oe[oe]&&Oe[oe].m(A,null);w(s,P),w(s,T),w(T,u),w(u,f),w(u,O),w(u,C),w(C,S),w(S,R),w(S,q),w(S,N),w(u,ie),w(u,re),w(T,Ye),w(T,Ae),w(Ae,De),w(De,ze),w(De,at),w(De,me),U(X,it,He),Le&&Le.m(X,He),U(X,Ge,He),ct=!0,Lt||(Tt=[je(k,"click",r[11]),je(D,"click",r[12]),je(ze,"click",r[9]),je(me,"click",r[10])],Lt=!0)},p(X,[He]){if(X[6]?Te?(Te.p(X,He),He&64&&M(Te,1)):(Te=Kn(X),Te.c(),M(Te,1),Te.m(e.parentNode,e)):Te&&(Ne(),I(Te,1,1,()=>{Te=null}),Qe()),He&256){ut=_e(X[8]);let oe;for(oe=0;oe<ut.length;oe+=1){const gt=Jn(X,ut,oe);Pe[oe]?Pe[oe].p(gt,He):(Pe[oe]=Xn(gt),Pe[oe].c(),Pe[oe].m(p,null))}for(;oe<Pe.length;oe+=1)Pe[oe].d(1);Pe.length=ut.length}if(He&304){Be=_e(X[4]);let oe;for(oe=0;oe<Be.length;oe+=1){const gt=Fn(X,Be,oe);Oe[oe]?Oe[oe].p(gt,He):(Oe[oe]=tr(gt),Oe[oe].c(),Oe[oe].m(A,null))}for(;oe<Oe.length;oe+=1)Oe[oe].d(1);Oe.length=Be.length}(!ct||He&4)&&j!==(j=X[2]+1+"")&&Ve(R,j),(!ct||He&8)&&B!==(B=Math.min(X[3],X[7].length)+"")&&Ve(N,B),X[5]!=null?Le?(Le.p(X,He),He&32&&M(Le,1)):(Le=nr(X),Le.c(),M(Le,1),Le.m(Ge.parentNode,Ge)):Le&&(Ne(),I(Le,1,1,()=>{Le=null}),Qe())},i(X){ct||(M(Te),M(Le),ct=!0)},o(X){I(Te),I(Le),ct=!1},d(X){X&&(G(e),G(n),G(it),G(Ge)),Te&&Te.d(X),Je(Pe,X),Je(Oe,X),Le&&Le.d(X),Lt=!1,ot(Tt)}}}function hi(r,e,n){let{df:t}=e,{onTrain:o}=e,{removeTrainingData:i}=e,s=JSON.parse(t),l=s.length>0?Object.keys(s[0]):[],c=10,a=1,d=Math.ceil(s.length/c),g=(a-1)*c,k=a*c,x=s.slice(g,k);const D=()=>{a>1&&n(16,a--,a)},L=()=>{a<d&&n(16,a++,a)},m=()=>{n(16,a=1),n(15,c=s.length)};let h=null,p=!1;const _=()=>{n(6,p=!0)},A=()=>{n(6,p=!1)},P=(f,O)=>{n(5,h=f[O])},T=()=>{n(5,h=null)},u=()=>{h&&i(h)};return r.$$set=f=>{"df"in f&&n(14,t=f.df),"onTrain"in f&&n(0,o=f.onTrain),"removeTrainingData"in f&&n(1,i=f.removeTrainingData)},r.$$.update=()=>{r.$$.dirty&98304&&n(2,g=(a-1)*c),r.$$.dirty&98304&&n(3,k=a*c),r.$$.dirty&12&&n(4,x=s.slice(g,k)),r.$$.dirty&32768&&n(17,d=Math.ceil(s.length/c)),r.$$.dirty&196608&&console.log(a,d)},[o,i,g,k,x,h,p,s,l,D,L,m,_,A,t,c,a,d,P,T,u]}class mi extends Se{constructor(e){super(),$e(this,e,hi,gi,xe,{df:14,onTrain:0,removeTrainingData:1})}}function yi(r){let e;return{c(){e=E("div"),e.innerHTML='<div class="flex flex-auto flex-col justify-center items-center p-4 md:p-5"><div class="flex justify-center"><div class="animate-spin inline-block w-6 h-6 border-[3px] border-current border-t-transparent text-blue-600 rounded-full" role="status" aria-label="loading"><span class="sr-only">Loading...</span></div></div></div>',v(e,"class","min-h-[15rem] flex flex-col bg-white border shadow-sm rounded-xl dark:bg-gray-800 dark:border-gray-700 dark:shadow-slate-700/[.7]")},m(n,t){U(n,e,t)},p:se,i:se,o:se,d(n){n&&G(e)}}}function bi(r){let e,n,t,o;const i=[_i,vi],s=[];function l(c,a){return c[0].type==="df"?0:c[0].type==="error"?1:-1}return~(e=l(r))&&(n=s[e]=i[e](r)),{c(){n&&n.c(),t=nt()},m(c,a){~e&&s[e].m(c,a),U(c,t,a),o=!0},p(c,a){let d=e;e=l(c),e===d?~e&&s[e].p(c,a):(n&&(Ne(),I(s[d],1,1,()=>{s[d]=null}),Qe()),~e?(n=s[e],n?n.p(c,a):(n=s[e]=i[e](c),n.c()),M(n,1),n.m(t.parentNode,t)):n=null)},i(c){o||(M(n),o=!0)},o(c){I(n),o=!1},d(c){c&&G(t),~e&&s[e].d(c)}}}function vi(r){let e,n;return e=new fr({props:{message:r[0].error}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&1&&(i.message=t[0].error),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function _i(r){let e,n;return e=new mi({props:{df:r[0].df,removeTrainingData:r[1],onTrain:r[2]}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&1&&(i.df=t[0].df),o&2&&(i.removeTrainingData=t[1]),o&4&&(i.onTrain=t[2]),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function wi(r){let e,n,t,o,i;const s=[bi,yi],l=[];function c(a,d){return a[0]!==null?0:1}return t=c(r),o=l[t]=s[t](r),{c(){e=E("div"),n=E("div"),o.c(),v(n,"class","py-10 lg:py-14"),v(e,"class","relative h-screen w-full lg:pl-64")},m(a,d){U(a,e,d),w(e,n),l[t].m(n,null),i=!0},p(a,[d]){let g=t;t=c(a),t===g?l[t].p(a,d):(Ne(),I(l[g],1,1,()=>{l[g]=null}),Qe(),o=l[t],o?o.p(a,d):(o=l[t]=s[t](a),o.c()),M(o,1),o.m(n,null))},i(a){i||(M(o),i=!0)},o(a){I(o),i=!1},d(a){a&&G(e),l[t].d()}}}function ki(r,e,n){let{trainingData:t}=e,{removeTrainingData:o}=e,{onTrain:i}=e;return r.$$set=s=>{"trainingData"in s&&n(0,t=s.trainingData),"removeTrainingData"in s&&n(1,o=s.removeTrainingData),"onTrain"in s&&n(2,i=s.onTrain)},[t,o,i]}class xi extends Se{constructor(e){super(),$e(this,e,ki,wi,xe,{trainingData:0,removeTrainingData:1,onTrain:2})}}function $i(r){let e,n;return e=new xi({props:{trainingData:r[3],removeTrainingData:r[14],onTrain:r[15]}}),{c(){J(e.$$.fragment)},m(t,o){F(e,t,o),n=!0},p(t,o){const i={};o&8&&(i.trainingData=t[3]),e.$set(i)},i(t){n||(M(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){Y(e,t)}}}function Si(r){let e,n,t,o,i;function s(d){r[17](d)}function l(d){r[18](d)}function c(d){r[19](d)}let a={suggestedQuestions:r[2],messageLog:r[1],newQuestion:r[9],rerunSql:r[10],clearMessages:r[8],onUpdateSql:r[16]};return r[4]!==void 0&&(a.question_asked=r[4]),r[5]!==void 0&&(a.thinking=r[5]),r[0]!==void 0&&(a.marked_correct=r[0]),e=new ri({props:a}),At.push(()=>on(e,"question_asked",s)),At.push(()=>on(e,"thinking",l)),At.push(()=>on(e,"marked_correct",c)),{c(){J(e.$$.fragment)},m(d,g){F(e,d,g),i=!0},p(d,g){const k={};g&4&&(k.suggestedQuestions=d[2]),g&2&&(k.messageLog=d[1]),!n&&g&16&&(n=!0,k.question_asked=d[4],nn(()=>n=!1)),!t&&g&32&&(t=!0,k.thinking=d[5],nn(()=>t=!1)),!o&&g&1&&(o=!0,k.marked_correct=d[0],nn(()=>o=!1)),e.$set(k)},i(d){i||(M(e.$$.fragment,d),i=!0)},o(d){I(e.$$.fragment,d),i=!1},d(d){Y(e,d)}}}function Oi(r){let e,n,t,o,i,s;n=new Dr({props:{getTrainingData:r[11],newQuestionPage:r[12],loadQuestionPage:r[13],questionHistory:r[7]}});const l=[Si,$i],c=[];function a(d,g){return d[6]==="chat"?0:d[6]==="training-data"?1:-1}return~(o=a(r))&&(i=c[o]=l[o](r)),{c(){e=E("main"),J(n.$$.fragment),t=Z(),i&&i.c()},m(d,g){U(d,e,g),F(n,e,null),w(e,t),~o&&c[o].m(e,null),s=!0},p(d,[g]){const k={};g&128&&(k.questionHistory=d[7]),n.$set(k);let x=o;o=a(d),o===x?~o&&c[o].p(d,g):(i&&(Ne(),I(c[x],1,1,()=>{c[x]=null}),Qe()),~o?(i=c[o],i?i.p(d,g):(i=c[o]=l[o](d),i.c()),M(i,1),i.m(e,null)):i=null)},i(d){s||(M(n.$$.fragment,d),M(i),s=!0)},o(d){I(n.$$.fragment,d),I(i),s=!1},d(d){d&&G(e),Y(n),~o&&c[o].d()}}}function Li(){setTimeout(()=>{window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},100)}function Ti(r,e,n){sr(async()=>{D(),new URL(window.location.href).hash.slice(1)==="training-data"?L():m()});let t=[],o=null,i=null,s=!1,l=!1,c=null,a,d=[];function g(){n(1,t=[]),n(4,s=!1),n(5,l=!1),n(0,c=null)}function k(q){g(),_({type:"user_question",question:q}),n(4,s=!0),f("generate_sql","GET",{question:q}).then(_).then(B=>{B.type==="sql"&&(window.location.hash=B.id,f("run_sql","GET",{id:B.id}).then(_).then(N=>{N.type==="df"&&f("generate_plotly_figure","GET",{id:N.id}).then(_).then(ie=>{ie.type==="plotly_figure"&&(n(7,d=[...d,{question:q,id:ie.id}]),f("generate_summary","GET",{id:ie.id}).then(_).then(re=>{re.type==="text"&&f("generate_followup_questions","GET",{id:re.id}).then(_)}))})}))})}function x(q){_({type:"user_question",question:"Re-run the SQL"}),f("run_sql","GET",{id:q}).then(_).then(B=>{B.type==="df"&&f("generate_plotly_figure","GET",{id:B.id}).then(_).then(N=>{N.type==="plotly_figure"&&f("generate_followup_questions","GET",{id:N.id}).then(_)})})}function D(){f("get_question_history","GET",[]).then(T)}function L(){window.location.hash="training-data",n(6,a="training-data"),f("get_training_data","GET",[]).then(A)}function m(){window.location.hash="",n(6,a="chat"),g(),o||f("generate_questions","GET",[]).then(P)}function h(q){window.location.hash=q,n(6,a="chat"),g(),n(4,s=!0),f("load_question","GET",{id:q}).then(_)}function p(q){n(3,i=null),f("remove_training_data","POST",{id:q}).then(B=>{f("get_training_data","GET",[]).then(A)})}function _(q){return n(1,t=[...t,q]),Li(),q}function A(q){return n(3,i=q),q}function P(q){return n(2,o=q),q}function T(q){return q.type==="question_history"&&n(7,d=q.questions),q}function u(q,B){n(3,i=null);let N={};N[B]=q,f("train","POST",N).then(A).then(ie=>{ie.type!=="error"&&f("get_training_data","GET",[]).then(A)})}async function f(q,B,N){try{n(5,l=!0);let ie="",re;if(B==="GET")ie=Object.entries(N).filter(([Ae,De])=>Ae!=="endpoint"&&Ae!=="addMessage").map(([Ae,De])=>`${encodeURIComponent(Ae)}=${encodeURIComponent(De)}`).join("&"),re=await fetch(`/api/v0/${q}?${ie}`);else{let Ae=JSON.stringify(N);re=await fetch(`/api/v0/${q}`,{method:"POST",headers:{"Content-Type":"application/json"},body:Ae})}if(!re.ok)throw new Error("The server returned an error. See the server logs for more details.");const Ye=await re.json();return n(5,l=!1),Ye}catch(ie){return n(5,l=!1),{type:"error",error:String(ie)}}}function O(){let q=t.find(B=>B.type==="user_question");if(q&&q.type==="user_question"){let B=t.find(N=>N.type==="sql");if(B&&B.type==="sql")return{question:q.question,sql:B.text}}return null}function C(q){let B=t.find(N=>N.type==="user_question");if(B&&B.type==="user_question"){let N={question:B.question,sql:q};f("train","POST",N),n(1,t=t.filter(ie=>ie.type!=="user_sql")),_({type:"sql",text:q,id:window.location.hash})}}function S(q){s=q,n(4,s)}function j(q){l=q,n(5,l)}function R(q){c=q,n(0,c)}return r.$$.update=()=>{if(r.$$.dirty&1)if(c===!0){let q=O();q&&f("train","POST",q)}else c===!1&&_({type:"user_sql"})},[c,t,o,i,s,l,a,d,g,k,x,L,m,h,p,u,C,S,j,R]}class Ei extends Se{constructor(e){super(),$e(this,e,Ti,Oi,xe,{})}}new Ei({target:document.getElementById("app")});
|
|
36
|
+
"""
|
vanna/openai/openai_chat.py
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
|
-
import re
|
|
3
|
-
from abc import abstractmethod
|
|
4
2
|
|
|
5
|
-
import pandas as pd
|
|
6
3
|
from openai import OpenAI
|
|
7
4
|
|
|
8
5
|
from ..base import VannaBase
|
|
@@ -20,6 +17,16 @@ class OpenAI_Chat(VannaBase):
|
|
|
20
17
|
self.client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
|
|
21
18
|
return
|
|
22
19
|
|
|
20
|
+
# default parameters - can be overrided using config
|
|
21
|
+
self.temperature = 0.7
|
|
22
|
+
self.max_tokens = 500
|
|
23
|
+
|
|
24
|
+
if "temperature" in config:
|
|
25
|
+
self.temperature = config["temperature"]
|
|
26
|
+
|
|
27
|
+
if "max_tokens" in config:
|
|
28
|
+
self.max_tokens = config["max_tokens"]
|
|
29
|
+
|
|
23
30
|
if "api_type" in config:
|
|
24
31
|
raise Exception(
|
|
25
32
|
"Passing api_type is now deprecated. Please pass an OpenAI client instead."
|
|
@@ -55,11 +62,10 @@ class OpenAI_Chat(VannaBase):
|
|
|
55
62
|
raise Exception("Prompt is empty")
|
|
56
63
|
|
|
57
64
|
# Count the number of tokens in the message log
|
|
65
|
+
# Use 4 as an approximation for the number of characters per token
|
|
58
66
|
num_tokens = 0
|
|
59
67
|
for message in prompt:
|
|
60
|
-
num_tokens += (
|
|
61
|
-
len(message["content"]) / 4
|
|
62
|
-
) # Use 4 as an approximation for the number of characters per token
|
|
68
|
+
num_tokens += len(message["content"]) / 4
|
|
63
69
|
|
|
64
70
|
if self.config is not None and "engine" in self.config:
|
|
65
71
|
print(
|
|
@@ -68,9 +74,9 @@ class OpenAI_Chat(VannaBase):
|
|
|
68
74
|
response = self.client.chat.completions.create(
|
|
69
75
|
engine=self.config["engine"],
|
|
70
76
|
messages=prompt,
|
|
71
|
-
max_tokens=
|
|
77
|
+
max_tokens=self.max_tokens,
|
|
72
78
|
stop=None,
|
|
73
|
-
temperature=
|
|
79
|
+
temperature=self.temperature,
|
|
74
80
|
)
|
|
75
81
|
elif self.config is not None and "model" in self.config:
|
|
76
82
|
print(
|
|
@@ -79,9 +85,9 @@ class OpenAI_Chat(VannaBase):
|
|
|
79
85
|
response = self.client.chat.completions.create(
|
|
80
86
|
model=self.config["model"],
|
|
81
87
|
messages=prompt,
|
|
82
|
-
max_tokens=
|
|
88
|
+
max_tokens=self.max_tokens,
|
|
83
89
|
stop=None,
|
|
84
|
-
temperature=
|
|
90
|
+
temperature=self.temperature,
|
|
85
91
|
)
|
|
86
92
|
else:
|
|
87
93
|
if num_tokens > 3500:
|
|
@@ -91,17 +97,17 @@ class OpenAI_Chat(VannaBase):
|
|
|
91
97
|
|
|
92
98
|
print(f"Using model {model} for {num_tokens} tokens (approx)")
|
|
93
99
|
response = self.client.chat.completions.create(
|
|
94
|
-
model=model,
|
|
100
|
+
model=model,
|
|
101
|
+
messages=prompt,
|
|
102
|
+
max_tokens=self.max_tokens,
|
|
103
|
+
stop=None,
|
|
104
|
+
temperature=self.temperature,
|
|
95
105
|
)
|
|
96
106
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
) in (
|
|
100
|
-
response.choices
|
|
101
|
-
): # Find the first response from the chatbot that has text in it (some responses may not have text)
|
|
107
|
+
# Find the first response from the chatbot that has text in it (some responses may not have text)
|
|
108
|
+
for choice in response.choices:
|
|
102
109
|
if "text" in choice:
|
|
103
110
|
return choice.text
|
|
104
111
|
|
|
105
|
-
return response
|
|
106
|
-
|
|
107
|
-
].message.content # If no response with text is found, return the first response's content (which may be empty)
|
|
112
|
+
# If no response with text is found, return the first response's content (which may be empty)
|
|
113
|
+
return response.choices[0].message.content
|
vanna/remote.py
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import dataclasses
|
|
2
2
|
import json
|
|
3
|
+
from io import StringIO
|
|
3
4
|
from typing import Callable, List, Tuple, Union
|
|
4
5
|
|
|
5
|
-
import requests
|
|
6
6
|
import pandas as pd
|
|
7
|
-
|
|
7
|
+
import requests
|
|
8
8
|
|
|
9
9
|
from .base import VannaBase
|
|
10
10
|
from .types import (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
11
|
+
AccuracyStats,
|
|
12
|
+
ApiKey,
|
|
13
|
+
DataFrameJSON,
|
|
14
|
+
DataResult,
|
|
15
|
+
Explanation,
|
|
16
|
+
FullQuestionDocument,
|
|
17
|
+
NewOrganization,
|
|
18
|
+
NewOrganizationMember,
|
|
19
|
+
Organization,
|
|
20
|
+
OrganizationList,
|
|
21
|
+
PlotlyResult,
|
|
22
|
+
Question,
|
|
23
|
+
QuestionCategory,
|
|
24
|
+
QuestionId,
|
|
25
|
+
QuestionList,
|
|
26
|
+
QuestionSQLPair,
|
|
27
|
+
QuestionStringList,
|
|
28
|
+
SQLAnswer,
|
|
29
|
+
Status,
|
|
30
|
+
StatusWithId,
|
|
31
|
+
StringData,
|
|
32
|
+
TrainingData,
|
|
33
|
+
UserEmail,
|
|
34
|
+
UserOTP,
|
|
35
|
+
Visibility,
|
|
36
36
|
)
|
|
37
37
|
|
|
38
38
|
|
|
@@ -94,13 +94,13 @@ class VannaDefault(VannaBase):
|
|
|
94
94
|
return dataclasses.asdict(obj)
|
|
95
95
|
|
|
96
96
|
def system_message(self, message: str) -> any:
|
|
97
|
-
|
|
97
|
+
return {"role": "system", "content": message}
|
|
98
98
|
|
|
99
99
|
def user_message(self, message: str) -> any:
|
|
100
|
-
|
|
100
|
+
return {"role": "user", "content": message}
|
|
101
101
|
|
|
102
102
|
def assistant_message(self, message: str) -> any:
|
|
103
|
-
|
|
103
|
+
return {"role": "assistant", "content": message}
|
|
104
104
|
|
|
105
105
|
def get_training_data(self, **kwargs) -> pd.DataFrame:
|
|
106
106
|
"""
|
|
@@ -396,9 +396,20 @@ class VannaDefault(VannaBase):
|
|
|
396
396
|
"""
|
|
397
397
|
|
|
398
398
|
def submit_prompt(self, prompt, **kwargs) -> str:
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
399
|
+
# JSON-ify the prompt
|
|
400
|
+
json_prompt = json.dumps(prompt)
|
|
401
|
+
|
|
402
|
+
params = [StringData(data=json_prompt)]
|
|
403
|
+
|
|
404
|
+
d = self._rpc_call(method="submit_prompt", params=params)
|
|
405
|
+
|
|
406
|
+
if "result" not in d:
|
|
407
|
+
return None
|
|
408
|
+
|
|
409
|
+
# Load the result into a dataclass
|
|
410
|
+
results = StringData(**d["result"])
|
|
411
|
+
|
|
412
|
+
return results.data
|
|
402
413
|
|
|
403
414
|
def get_similar_question_sql(self, question: str, **kwargs) -> list:
|
|
404
415
|
"""
|
|
@@ -442,40 +453,3 @@ class VannaDefault(VannaBase):
|
|
|
442
453
|
sql_answer = SQLAnswer(**d["result"])
|
|
443
454
|
|
|
444
455
|
return sql_answer.sql
|
|
445
|
-
|
|
446
|
-
def generate_followup_questions(self, question: str, df: pd.DataFrame, **kwargs) -> list[str]:
|
|
447
|
-
"""
|
|
448
|
-
**Example:**
|
|
449
|
-
```python
|
|
450
|
-
vn.generate_followup_questions(question="What is the average salary of employees?", df=df)
|
|
451
|
-
# ['What is the average salary of employees in the Sales department?', 'What is the average salary of employees in the Engineering department?', ...]
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
Generate follow-up questions using the Vanna.AI API.
|
|
455
|
-
|
|
456
|
-
Args:
|
|
457
|
-
question (str): The question to generate follow-up questions for.
|
|
458
|
-
df (pd.DataFrame): The DataFrame to generate follow-up questions for.
|
|
459
|
-
|
|
460
|
-
Returns:
|
|
461
|
-
List[str] or None: The follow-up questions, or None if an error occurred.
|
|
462
|
-
"""
|
|
463
|
-
params = [
|
|
464
|
-
DataResult(
|
|
465
|
-
question=question,
|
|
466
|
-
sql=None,
|
|
467
|
-
table_markdown="",
|
|
468
|
-
error=None,
|
|
469
|
-
correction_attempts=0,
|
|
470
|
-
)
|
|
471
|
-
]
|
|
472
|
-
|
|
473
|
-
d = self._rpc_call(method="generate_followup_questions", params=params)
|
|
474
|
-
|
|
475
|
-
if "result" not in d:
|
|
476
|
-
return None
|
|
477
|
-
|
|
478
|
-
# Load the result into a dataclass
|
|
479
|
-
question_string_list = QuestionStringList(**d["result"])
|
|
480
|
-
|
|
481
|
-
return question_string_list.questions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vanna
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Generate SQL queries from natural language
|
|
5
5
|
Author-email: Zain Hoda <zain@vanna.ai>
|
|
6
6
|
Requires-Python: >=3.9
|
|
@@ -23,6 +23,7 @@ Requires-Dist: snowflake-connector-python ; extra == "all"
|
|
|
23
23
|
Requires-Dist: duckdb ; extra == "all"
|
|
24
24
|
Requires-Dist: openai ; extra == "all"
|
|
25
25
|
Requires-Dist: mistralai ; extra == "all"
|
|
26
|
+
Requires-Dist: chromadb ; extra == "all"
|
|
26
27
|
Requires-Dist: google-cloud-bigquery ; extra == "bigquery"
|
|
27
28
|
Requires-Dist: chromadb ; extra == "chromadb"
|
|
28
29
|
Requires-Dist: duckdb ; extra == "duckdb"
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
vanna/__init__.py,sha256=4zz2kSkVZenjwJQg-ETWsIVYdz3gio275i9DMa_aHxM,9248
|
|
2
|
-
vanna/flask.py,sha256=f_6XhdS3m5zu1M6KI1hRMHvWndLogAGzePGwcO3GnEI,15096
|
|
3
2
|
vanna/local.py,sha256=U5s8ybCRQhBUizi8I69o3jqOpTeu_6KGYY6DMwZxjG4,313
|
|
4
|
-
vanna/remote.py,sha256=
|
|
3
|
+
vanna/remote.py,sha256=qqaTA4l-ikVH_1aQInae4DyTAfCCmFokQme6Jq_i1us,12803
|
|
5
4
|
vanna/utils.py,sha256=Q0H4eugPYg9SVpEoTWgvmuoJZZxOVRhNzrP97E5lyak,1472
|
|
6
5
|
vanna/ZhipuAI/ZhipuAI_Chat.py,sha256=hcx__0ZKHr5wtmIv0Ye2Xake8E-sOi5Qyc5nFIIdFvg,8957
|
|
7
6
|
vanna/ZhipuAI/ZhipuAI_embeddings.py,sha256=lUqzJg9fOx7rVFhjdkFjXcDeVGV4aAB5Ss0oERsa8pE,2849
|
|
8
7
|
vanna/ZhipuAI/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
8
|
vanna/base/__init__.py,sha256=Sl-HM1RRYzAZoSqmL1CZQmF3ZF-byYTCFQP3JZ2A5MU,28
|
|
10
|
-
vanna/base/base.py,sha256=
|
|
9
|
+
vanna/base/base.py,sha256=6tSgklJdaZwhK9vMhI7ZilZsB_bsngUWk7bW1vVSoOE,52175
|
|
11
10
|
vanna/chromadb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
vanna/chromadb/chromadb_vector.py,sha256=
|
|
11
|
+
vanna/chromadb/chromadb_vector.py,sha256=fa7uj_knzSfzsVLvpSunwwu1ZJNC3GbiNZ4Yy09v4l4,8372
|
|
13
12
|
vanna/exceptions/__init__.py,sha256=N76unE7sjbGGBz6LmCrPQAugFWr9cUFv8ErJxBrCTts,717
|
|
13
|
+
vanna/flask/__init__.py,sha256=i7eh55uB64Kio3nnrAK4eg45gAoY_b2uziLLlCmj1Dk,15186
|
|
14
|
+
vanna/flask/assets.py,sha256=1DcZNu3Uo93hz7M8ldEYKDeEslROIL3IK44sSS8PZgM,163301
|
|
14
15
|
vanna/marqo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
16
|
vanna/marqo/marqo.py,sha256=2OBuC5IZmGcFXN2Ah6GVPKHBYtkDXeSwhXsqUbxyU94,5285
|
|
16
17
|
vanna/mistral/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -18,11 +19,11 @@ vanna/mistral/mistral.py,sha256=6NarIVLfh9qxJIyUv_9pdRzbbMfC54gYsqg99Q-K7aA,1514
|
|
|
18
19
|
vanna/ollama/__init__.py,sha256=GW1ek7zw_fpL2yFNgrnN5RNjV2PdkK8CmTmcJF9YpDU,2464
|
|
19
20
|
vanna/ollama/ollama.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
21
|
vanna/openai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
|
-
vanna/openai/openai_chat.py,sha256=
|
|
22
|
-
vanna/openai/openai_embeddings.py,sha256=
|
|
22
|
+
vanna/openai/openai_chat.py,sha256=2A6YEibwnMgdc6r1mvInqi_32xDDkdGi-bx73UEUaJM,3846
|
|
23
|
+
vanna/openai/openai_embeddings.py,sha256=g4pNh9LVcYP9wOoO8ecaccDFWmCUYMInebfHucAa2Gc,1260
|
|
23
24
|
vanna/types/__init__.py,sha256=Qhn_YscKtJh7mFPCyCDLa2K8a4ORLMGVnPpTbv9uB2U,4957
|
|
24
25
|
vanna/vannadb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
26
|
vanna/vannadb/vannadb_vector.py,sha256=f4kddaJgTpZync7wnQi09QdODUuMtiHsK7WfKBUAmSo,5644
|
|
26
|
-
vanna-0.
|
|
27
|
-
vanna-0.
|
|
28
|
-
vanna-0.
|
|
27
|
+
vanna-0.2.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
28
|
+
vanna-0.2.0.dist-info/METADATA,sha256=UzXxOVxudUIRanqrhsqp_ssL-lpvLqulSrn_PMyjnSY,9741
|
|
29
|
+
vanna-0.2.0.dist-info/RECORD,,
|
|
File without changes
|