Compare commits
No commits in common. "main" and "master" have entirely different histories.
BIN
Dokumentacja Konserwacyjna.pdf
Normal file
BIN
Dokumentacja Konserwacyjna.pdf
Normal file
Binary file not shown.
BIN
Dokumentacja Użytkowa.pdf
Normal file
BIN
Dokumentacja Użytkowa.pdf
Normal file
Binary file not shown.
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 s452649
|
||||
Copyright (c) 2024 Alicja Laskowska, Vladyslav Serhiienko
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
129
README.md
129
README.md
@ -1,3 +1,130 @@
|
||||
# PhishGuardian
|
||||
|
||||
PhishGuardian - Keep you e-mails safe!
|
||||
PhishGuardian is a browser extension designed to detect and manage phishing emails. It uses machine learning to identify potential phishing emails and provides options to mark them as safe or move them to the trash. The extension is built using Flask for the backend and JavaScript for the frontend.
|
||||
|
||||
## Features
|
||||
|
||||
- Detects phishing emails using machine learning
|
||||
- Allows users to mark emails as safe
|
||||
- Allows users to move phishing emails to the trash
|
||||
- Provides notifications for detected phishing emails
|
||||
|
||||
## Installation
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Python 3.6+
|
||||
- Flask
|
||||
- scikit-learn
|
||||
- Chrome browser
|
||||
|
||||
### Backend Setup
|
||||
|
||||
1. Clone the repository:
|
||||
|
||||
```sh
|
||||
git clone https://git.wmi.amu.edu.pl/s452649/PhishGuardian.git
|
||||
cd PhishGuardian/backend
|
||||
```
|
||||
|
||||
2. Install the required Python packages:
|
||||
|
||||
```sh
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
3. Run the Flask backend:
|
||||
```sh
|
||||
python backend.py
|
||||
```
|
||||
|
||||
### Setting up Gmail API
|
||||
|
||||
### To integrate the Gmail API, follow these steps:
|
||||
|
||||
1. Visit the Google Cloud Console at https://console.cloud.google.com/apis/credentials.
|
||||
2. Click on "Create Project" and fill in the required fields.
|
||||
3. Navigate to the Library, find the Gmail API, and enable it.
|
||||
4. Go to the OAuth consent screen and select the "External" option in the User Type field and click "Create". Enter the application name and your email address. Skip the "App logo" and "App domain" fields. Also, skip all the following windows until the last step "Summary", where click "Back to dashboard". Then, in the "Publishing status" field, click "Publish app".
|
||||
5. Go to the Credentials tab and click on "Create Credentials". Then, select "OAuth client ID", choose "Web application", and fill in the following fields:
|
||||
|
||||
- javascript_origins: ["http://localhost:5000"]
|
||||
- redirect_uris: ["http://localhost:5000/oauth2callback"]
|
||||
|
||||
6. A popup window will appear where you can obtain the "Client_id" which must be noted in 'manifest.json'. There will also be a button to download a JSON file. Place this file in the backend folder for convenience, name the file "client_secret.json", or you can rename it in backend.py as needed.
|
||||
7. These setup instructions will assist you in integrating and using the Gmail API effectively in your project.
|
||||
|
||||
### Extension Setup
|
||||
|
||||
1. Open Chrome and go to `chrome://extensions/`
|
||||
2. Enable "Developer mode" by toggling the switch in the top right corner.
|
||||
3. Click on "Load unpacked" and select the `PhishGuardian` directory.
|
||||
|
||||
## Usage
|
||||
|
||||
1. Click on the PhishGuardian extension icon in the Chrome toolbar.
|
||||
2. Select the email system from the list - either Gmail or Outlook.
|
||||
3. Login with your email credentials.
|
||||
4. Use the "Check Mail" button to scan for phishing emails.
|
||||
5. If a phishing email is detected, a popup window will appear with list of mails with options to mark the email as "Safe" or "Move" it to the trash.
|
||||
6. After use, you can close the additional popup window, and you will see the changes made in your email service.
|
||||
7. To use it again, follow steps 4-6 of this list.
|
||||
|
||||
## Code Overview
|
||||
|
||||
### Backend Architecture Description
|
||||
|
||||
#### Flask Application:
|
||||
|
||||
- Flask is used as the main web framework.
|
||||
|
||||
#### CORS:
|
||||
|
||||
- Enabled using Flask-CORS to handle cross-origin requests.
|
||||
|
||||
#### Configuration and Environment:
|
||||
|
||||
- Secret Key: Defined for managing sessions.
|
||||
|
||||
- Environment Variable: OAUTHLIB_INSECURE_TRANSPORT is set to '1' to allow insecure HTTP connections during development. This can be removed once a certificate is obtained from Google.
|
||||
|
||||
#### OAuth 2.0:
|
||||
|
||||
- Client Secrets: Loaded from the client_secret.json file.
|
||||
|
||||
- Scopes: Defined for permissions to read and modify Gmail data.
|
||||
|
||||
- Routes: /authorize to initiate the OAuth process and /oauth2callback to handle the OAuth callback.
|
||||
|
||||
#### Session Management:
|
||||
|
||||
- Saving and Loading Credentials: Functions for storing and loading OAuth credentials in the session.
|
||||
|
||||
#### Email Handling:
|
||||
|
||||
- Safe Emails: Stored in a JSON file safe_emails.json.
|
||||
|
||||
#### Data Collection for Custom Training Model:
|
||||
|
||||
- All emails that the user marks to be moved to the trash are recorded in a separate CSV file - safe_trash.csv, which is used as a database in the future for training the model to better recognize phishing.
|
||||
|
||||
### Frontend
|
||||
|
||||
- `popup.html`: The main interface of the extension.
|
||||
- `popup.js`: Handles interactions in the popup, such as login, checking mail, and handling responses.
|
||||
- `background.js`: Listens for messages from the popup and handles notifications.
|
||||
- `notification.html` & `notification.js`: The interface and logic for the notification popup.
|
||||
|
||||
### Routes:
|
||||
|
||||
- /validate-outlook-login: For validating Outlook credentials.
|
||||
- /fetch-emails: To fetch and classify emails from Outlook.
|
||||
- /check_mail: To check emails from Gmail.
|
||||
- /mark_safe/<email_id>: To mark emails as safe.
|
||||
- /move_trash/<email_id>: To move emails to the trash in Gmail.
|
||||
- /delete-email: To delete an email from Outlook.
|
||||
- /logout: To clear the session.
|
||||
|
||||
### Backend Checks
|
||||
|
||||
The backend performs checks on the email content itself to detect any presence of links, buttons (for confirmation or verification purposes). The model has been trained on a dataset containing a high volume of invalid emails, which includes additions of HTML, incorrect and suspicious text. Emails that are too short will also be considered suspicious.
|
||||
|
8
backend/.idea/.gitignore
vendored
Normal file
8
backend/.idea/.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
1
backend/.idea/.name
Normal file
1
backend/.idea/.name
Normal file
@ -0,0 +1 @@
|
||||
app.py
|
8
backend/.idea/PhishGuardian.iml
Normal file
8
backend/.idea/PhishGuardian.iml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
8
backend/.idea/backend.iml
Normal file
8
backend/.idea/backend.iml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
6
backend/.idea/inspectionProfiles/profiles_settings.xml
Normal file
6
backend/.idea/inspectionProfiles/profiles_settings.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
7
backend/.idea/misc.xml
Normal file
7
backend/.idea/misc.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.12" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12" project-jdk-type="Python SDK" />
|
||||
</project>
|
8
backend/.idea/modules.xml
Normal file
8
backend/.idea/modules.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/PhishGuardian.iml" filepath="$PROJECT_DIR$/.idea/PhishGuardian.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
6
backend/.idea/vcs.xml
Normal file
6
backend/.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
755
backend/.ipynb_checkpoints/ML-checkpoint.ipynb
Normal file
755
backend/.ipynb_checkpoints/ML-checkpoint.ipynb
Normal file
@ -0,0 +1,755 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"is_executing": true
|
||||
},
|
||||
"ExecuteTime": {
|
||||
"start_time": "2024-06-05T20:03:23.481431Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"%pip install pandas\n",
|
||||
"%pip install matplotlib\n",
|
||||
"%pip install nltk\n",
|
||||
"%pip install wordcloud\n",
|
||||
"%pip install scikit-learn==1.3.2\n",
|
||||
"%pip install scikit-fuzzy==0.4.2\n",
|
||||
"# Import pakietów\n",
|
||||
"import nltk\n",
|
||||
"nltk.download('punkt')\n",
|
||||
"nltk.download('stopwords')\n",
|
||||
"import pandas as pd\n",
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
"import re\n",
|
||||
"import string\n",
|
||||
"from wordcloud import WordCloud\n",
|
||||
"from sklearn.feature_extraction.text import CountVectorizer\n",
|
||||
"from sklearn.model_selection import train_test_split\n",
|
||||
"from sklearn.naive_bayes import MultinomialNB\n",
|
||||
"from sklearn.ensemble import RandomForestClassifier\n",
|
||||
"from sklearn.tree import DecisionTreeClassifier\n",
|
||||
"from sklearn.metrics import accuracy_score, classification_report, confusion_matrix\n",
|
||||
"from nltk.corpus import stopwords\n",
|
||||
"from nltk.stem import PorterStemmer\n",
|
||||
"from nltk.tokenize import word_tokenize\n",
|
||||
"import joblib\n",
|
||||
"import pickle"
|
||||
],
|
||||
"id": "b313cab7d5cc49c0",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Requirement already satisfied: pandas in c:\\users\\alicj\\appdata\\local\\programs\\python\\python312\\lib\\site-packages (2.2.2)\n",
|
||||
"Requirement already satisfied: numpy>=1.26.0 in c:\\users\\alicj\\appdata\\local\\programs\\python\\python312\\lib\\site-packages (from pandas) (1.26.4)\n",
|
||||
"Requirement already satisfied: python-dateutil>=2.8.2 in c:\\users\\alicj\\appdata\\roaming\\python\\python312\\site-packages (from pandas) (2.9.0.post0)\n",
|
||||
"Requirement already satisfied: pytz>=2020.1 in c:\\users\\alicj\\appdata\\local\\programs\\python\\python312\\lib\\site-packages (from pandas) (2024.1)\n",
|
||||
"Requirement already satisfied: tzdata>=2022.7 in c:\\users\\alicj\\appdata\\local\\programs\\python\\python312\\lib\\site-packages (from pandas) (2024.1)\n",
|
||||
"Requirement already satisfied: six>=1.5 in c:\\users\\alicj\\appdata\\roaming\\python\\python312\\site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)\n",
|
||||
"Note: you may need to restart the kernel to use updated packages.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Załaduj dane\n",
|
||||
"data_path = \"joined_data.csv\"\n",
|
||||
"data = pd.read_csv(data_path)"
|
||||
],
|
||||
"id": "768266dbb79c5e9d"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "print(data.head())",
|
||||
"id": "ee08266d5c30627b"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "print(data.info())",
|
||||
"id": "1798f605e33fe5e5"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "data",
|
||||
"id": "b4f43d913b92485b"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "# Usuwamy NaN",
|
||||
"id": "e3bf0f04a2be4e1a"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "data.dropna(inplace=True)",
|
||||
"id": "71a6bbebdb0dccd4"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "# Usuwamy puste wiadomości i wiadomości zawierające jedynie \"\\n\"",
|
||||
"id": "b7fca25d67381cdd"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "data = data[data['Body'] != '\\n']",
|
||||
"id": "72d84bf6c1e7023a"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "data = data[data['Body'] != 'empty']",
|
||||
"id": "7c94c4dca6c4cdae"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "data.reset_index(drop=True, inplace=True)",
|
||||
"id": "7e6fd3f8014498f3"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "data",
|
||||
"id": "a0c33f82a936c59"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Sprawdźmy rozkład targetów\n",
|
||||
"print(data['Label'].value_counts())"
|
||||
],
|
||||
"id": "19af5936d0cfeba2"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "# Analiza długości wiadomości",
|
||||
"id": "96c861e2655312cb"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"def get_len(row):\n",
|
||||
" try:\n",
|
||||
" return len(row)\n",
|
||||
" except:\n",
|
||||
" return row"
|
||||
],
|
||||
"id": "e1ec1ed8aa7c856d"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "data['message_length'] = data['Body'].apply(get_len)",
|
||||
"id": "63c023f34d234f3e"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "data.sort_values(by='message_length')",
|
||||
"id": "d4fd0e2dcc2bfee9"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "# Jedna wiadomość jest bardzo długa 17085626",
|
||||
"id": "e62112260ebc17f0"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "data['message_length'].value_counts()",
|
||||
"id": "7c369131e3c91ce3"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Histogram długości wiadomości dla każdej kategorii - ograniczamy do 200.000 znaków celem wyświetlenia histogramów\n",
|
||||
"hist_data = data[data['message_length'] < 200000]\n",
|
||||
"plt.figure(figsize=(10, 6))\n",
|
||||
"hist_data[hist_data['Label'] == 0]['message_length'].hist(bins=100, alpha=0.6, label='Not Spam')\n",
|
||||
"hist_data[hist_data['Label'] == 1]['message_length'].hist(bins=100, alpha=0.6, label='Spam')\n",
|
||||
"plt.legend()\n",
|
||||
"plt.xlabel('Długość wiadomości')\n",
|
||||
"plt.ylabel('Liczba wiadomości')\n",
|
||||
"plt.title('Rozkład długości wiadomości')\n",
|
||||
"plt.show()"
|
||||
],
|
||||
"id": "b6b509692fd7c541"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "# Ograniczamy jeszcze bardziej ",
|
||||
"id": "7182d6a1d6600c2"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Histogram długości wiadomości dla każdej kategorii - ograniczamy do 10000 znaków celem wyświetlenia histogramów\n",
|
||||
"hist_data = data[data['message_length'] < 10000]\n",
|
||||
"plt.figure(figsize=(10, 6))\n",
|
||||
"hist_data[hist_data['Label'] == 0]['message_length'].hist(bins=100, alpha=0.6, label='Not Spam')\n",
|
||||
"hist_data[hist_data['Label'] == 1]['message_length'].hist(bins=100, alpha=0.6, label='Spam')\n",
|
||||
"plt.legend()\n",
|
||||
"plt.xlabel('Długość wiadomości')\n",
|
||||
"plt.ylabel('Liczba wiadomości')\n",
|
||||
"plt.title('Rozkład długości wiadomości')\n",
|
||||
"plt.show()"
|
||||
],
|
||||
"id": "962efe0bd652ecdb"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "# Można zauważyć, że trudno odróżnić widomości po samej długości. W tym celu należy skorzystać z bardziej zaawansowanych metod.",
|
||||
"id": "eaa483deb9c81942"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "# Przetwarzanie tekstu",
|
||||
"id": "6e0ee5fccf308cd1"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "data",
|
||||
"id": "50c0131db25859cb"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"stop_words = set(stopwords.words('english'))\n",
|
||||
"ps = PorterStemmer()\n",
|
||||
"\n",
|
||||
"def preprocess_text(text):\n",
|
||||
" # Usuwanie znaków specjalnych i tokenizacja\n",
|
||||
" text = re.sub(r'\\d+', '', text)\n",
|
||||
" text = text.translate(str.maketrans('', '', string.punctuation))\n",
|
||||
" words = word_tokenize(text)\n",
|
||||
" # Usuwanie stopwords i stemming\n",
|
||||
" words = [ps.stem(word) for word in words if word.lower() not in stop_words]\n",
|
||||
" return \" \".join(words)"
|
||||
],
|
||||
"id": "c32c52a7b2575a3b"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "# Ten proces jest czasochłonny",
|
||||
"id": "5953cb974349cb33"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "data['processed_message'] = data['Body'].apply(preprocess_text)",
|
||||
"id": "89b8cdeaa9da5c2d"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "data.head()",
|
||||
"id": "ccce395ac94c39a1"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "data['processed_message']",
|
||||
"id": "7ce382be7bcdff2c"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Analiza słów za pomocą WordCloud\n",
|
||||
"spam_words = ' '.join(list(data[data['Label'] == 1]['processed_message']))\n",
|
||||
"not_spam_words = ' '.join(list(data[data['Label'] == 0]['processed_message']))"
|
||||
],
|
||||
"id": "dc456d793b576f7"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"plt.figure(figsize=(10, 6))\n",
|
||||
"wordcloud_spam = WordCloud(width=800, height=400).generate(spam_words)\n",
|
||||
"plt.imshow(wordcloud_spam, interpolation='bilinear')\n",
|
||||
"plt.axis('off')\n",
|
||||
"plt.title('Word Cloud dla Spam')\n",
|
||||
"plt.show()"
|
||||
],
|
||||
"id": "c9d7d9c9f4ae91ed"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"plt.figure(figsize=(10, 6))\n",
|
||||
"wordcloud_not_spam = WordCloud(width=800, height=400).generate(not_spam_words)\n",
|
||||
"plt.imshow(wordcloud_not_spam, interpolation='bilinear')\n",
|
||||
"plt.axis('off')\n",
|
||||
"plt.title('Word Cloud dla Not Spam')\n",
|
||||
"plt.show()"
|
||||
],
|
||||
"id": "d954e01a1d0b3a97"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "# Budowa modelu klasyfikacyjnego",
|
||||
"id": "743000c7d99b8a85"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Zamiana tekstu na wektory\n",
|
||||
"vectorizer = CountVectorizer()\n",
|
||||
"X = vectorizer.fit_transform(data['processed_message'])\n",
|
||||
"y = data['Label']"
|
||||
],
|
||||
"id": "7b3ba8e5b035cdc0"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Podział na zbiór treningowy i testowy\n",
|
||||
"X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)"
|
||||
],
|
||||
"id": "5d66dcf506f4f399"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Trenowanie modelu Naiwnego Bayesa\n",
|
||||
"model_NB = MultinomialNB()\n",
|
||||
"model_NB.fit(X_train, y_train)"
|
||||
],
|
||||
"id": "b3c2a6673c718301"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Predykcja i ocena Naiwny Bayes\n",
|
||||
"y_pred_NB = model_NB.predict(X_test)\n",
|
||||
"accuracy_NB = accuracy_score(y_test, y_pred_NB)\n",
|
||||
"classification_rep_NB = classification_report(y_test, y_pred_NB)\n",
|
||||
"confusion_matrix_NB = confusion_matrix(y_test, y_pred_NB)"
|
||||
],
|
||||
"id": "82f18edc9161422a"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "accuracy_NB",
|
||||
"id": "a629b6b89d5cdf34"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "print(classification_rep_NB)",
|
||||
"id": "53c0cf3dc8aa02bc"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "print(confusion_matrix_NB)",
|
||||
"id": "9b915d02828de60"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "# Trening Drzewa Decyzyjnego (DT)",
|
||||
"id": "160da18f95c142a0"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Parametry domyślne\n",
|
||||
"model_DT = DecisionTreeClassifier(criterion= 'gini',\n",
|
||||
" max_depth= None,\n",
|
||||
" min_samples_leaf= 1,\n",
|
||||
" min_samples_split= 2,\n",
|
||||
" splitter= 'best')\n",
|
||||
"model_DT.fit(X_train, y_train)"
|
||||
],
|
||||
"id": "8720ed4fd0ed5c72"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Predykcja i ocena DT\n",
|
||||
"y_pred_DT = model_DT.predict(X_test)\n",
|
||||
"accuracy_DT = accuracy_score(y_test, y_pred_DT)\n",
|
||||
"classification_rep_DT = classification_report(y_test, y_pred_DT)\n",
|
||||
"confusion_matrix_DT = confusion_matrix(y_test, y_pred_DT)"
|
||||
],
|
||||
"id": "7aee079d59bdd4eb"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "accuracy_DT",
|
||||
"id": "57ac5a3ffe724fd5"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "print(classification_rep_DT)",
|
||||
"id": "ed8955dc5d5cdeaf"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "print(confusion_matrix_DT)",
|
||||
"id": "3ebfee20eb06e8cc"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "# Las losowy",
|
||||
"id": "85d3dc4e44a2a4b3"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"model_RF = RandomForestClassifier(n_estimators= 100,\n",
|
||||
" bootstrap= True,\n",
|
||||
" ccp_alpha= 0.0,\n",
|
||||
" criterion= 'gini',\n",
|
||||
" max_depth= None,\n",
|
||||
" min_samples_leaf= 1,\n",
|
||||
" min_samples_split= 2,\n",
|
||||
" random_state=123)\n",
|
||||
"model_RF.fit(X_train, y_train)"
|
||||
],
|
||||
"id": "6f454235f54aa9cc"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Predykcja i ocena RF\n",
|
||||
"y_pred_RF = model_RF.predict(X_test)\n",
|
||||
"accuracy_RF = accuracy_score(y_test, y_pred_RF)\n",
|
||||
"classification_rep_RF = classification_report(y_test, y_pred_RF)\n",
|
||||
"confusion_matrix_RF = confusion_matrix(y_test, y_pred_RF)"
|
||||
],
|
||||
"id": "23d68d066dc47f9"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "accuracy_RF",
|
||||
"id": "55789560bb43f9b8"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "print(classification_rep_RF)",
|
||||
"id": "d15d57c467b94bad"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "print(confusion_matrix_RF)",
|
||||
"id": "477ea9a19dbe7389"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Najlepszym modelem okazał się Las losowy - lepiej sklasyfikować spam jako wiadomość nie będącą spamem niż odwrotnie. \n",
|
||||
"# Dlatego wybieramy RF, a nie NB."
|
||||
],
|
||||
"id": "9c3308c811b9d014"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Teraz dokonamy treningu na pełnych danych i zapiszemy model celem wykorzystania na danych rzeczywistych w późniejszej \n",
|
||||
"# aplikacji."
|
||||
],
|
||||
"id": "81f08fa14ba4daf5"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"model_RF_full = RandomForestClassifier(n_estimators= 100,\n",
|
||||
" bootstrap= True,\n",
|
||||
" ccp_alpha= 0.0,\n",
|
||||
" criterion= 'gini',\n",
|
||||
" max_depth= None,\n",
|
||||
" min_samples_leaf= 1,\n",
|
||||
" min_samples_split= 2,\n",
|
||||
" random_state=123)"
|
||||
],
|
||||
"id": "7f580653f470d7af"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "model_RF_full.fit(X, y)",
|
||||
"id": "f75fc9a4d4746e5a"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Predykcja i ocena RF\n",
|
||||
"y_pred_RF_full = model_RF_full.predict(X)\n",
|
||||
"accuracy_RF_full = accuracy_score(y, y_pred_RF_full)\n",
|
||||
"classification_rep_RF_full = classification_report(y, y_pred_RF_full)\n",
|
||||
"confusion_matrix_RF_full = confusion_matrix(y, y_pred_RF_full)"
|
||||
],
|
||||
"id": "3d77bed327ac2fa1"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "accuracy_RF_full",
|
||||
"id": "a76a53da77128562"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "print(classification_rep_RF_full)",
|
||||
"id": "9a66104fd13572f8"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "print(confusion_matrix_RF_full)",
|
||||
"id": "823635f2315ecf05"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "model_RF_full",
|
||||
"id": "d0136f7b9f6344c4"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": [
|
||||
"# Zapisz model i vectorizer\n",
|
||||
"joblib.dump(model_RF_full, 'spam_classifier_model.pkl')\n",
|
||||
"joblib.dump(vectorizer, 'vectorizer.pkl')"
|
||||
],
|
||||
"id": "e02e9031d10617f6"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "# Uwaga, ważna jest zgodność wersji scikita i joblib tutaj i w środowisku aplikacji",
|
||||
"id": "2ac5943e18571301"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "pip freeze | findstr scikit",
|
||||
"id": "a238743e07978f4"
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"outputs": [],
|
||||
"execution_count": null,
|
||||
"source": "# Jak instalować?",
|
||||
"id": "a64099b8c61a884"
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 140,
|
||||
"id": "d99c1dbe",
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2024-06-05T16:57:22.800834Z",
|
||||
"start_time": "2024-06-05T16:57:22.798725Z"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Np. tak\n",
|
||||
"# pip install scikit-learn==1.3.2"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.12.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
1886
backend/ML.ipynb
Normal file
1886
backend/ML.ipynb
Normal file
File diff suppressed because one or more lines are too long
450
backend/backend.py
Normal file
450
backend/backend.py
Normal file
@ -0,0 +1,450 @@
|
||||
from flask import Flask, request, jsonify, session, redirect, url_for
|
||||
from flask_cors import CORS
|
||||
import google.oauth2.credentials
|
||||
import google_auth_oauthlib.flow
|
||||
import googleapiclient.discovery
|
||||
import os
|
||||
import json
|
||||
import traceback
|
||||
from sklearn.feature_extraction.text import TfidfVectorizer
|
||||
from sklearn.naive_bayes import MultinomialNB
|
||||
import pandas as pd
|
||||
import re
|
||||
import joblib
|
||||
import imaplib
|
||||
import email
|
||||
from email.header import decode_header
|
||||
import base64
|
||||
import csv
|
||||
from datetime import datetime, timedelta
|
||||
from googleapiclient.discovery import build
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
CORS(app)
|
||||
app.secret_key = 'your_secret_key'
|
||||
|
||||
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'
|
||||
|
||||
CLIENT_SECRETS_FILE = "client_secret.json"
|
||||
SCOPES = ['https://www.googleapis.com/auth/gmail.readonly','https://www.googleapis.com/auth/gmail.modify',"https://www.googleapis.com/auth/userinfo.email",'https://www.googleapis.com/auth/userinfo.profile',
|
||||
'openid']
|
||||
API_SERVICE_NAME = 'gmail'
|
||||
API_VERSION = 'v1'
|
||||
SAFE_EMAILS_FILE = 'safe_emails.json'
|
||||
SAFE_TRASH_FILE = 'safe_trash.csv'
|
||||
|
||||
def load_safe_emails():
|
||||
if os.path.exists(SAFE_EMAILS_FILE):
|
||||
if os.path.getsize(SAFE_EMAILS_FILE) > 0:
|
||||
with open(SAFE_EMAILS_FILE, 'r') as file:
|
||||
try:
|
||||
return json.load(file)
|
||||
except json.JSONDecodeError:
|
||||
return []
|
||||
return []
|
||||
|
||||
def save_safe_emails(safe_emails):
|
||||
with open(SAFE_EMAILS_FILE, 'w') as file:
|
||||
json.dump(safe_emails, file)
|
||||
def save_safe_trash(safe_trash):
|
||||
file_exists = os.path.isfile(SAFE_TRASH_FILE)
|
||||
|
||||
with open(SAFE_TRASH_FILE, 'a', newline='', encoding='utf-8') as file:
|
||||
fieldnames = ['from', 'subject', 'body', 'date',"username"]
|
||||
writer = csv.DictWriter(file, fieldnames=fieldnames)
|
||||
|
||||
if not file_exists:
|
||||
writer.writeheader()
|
||||
|
||||
if 'date' not in safe_trash:
|
||||
safe_trash['date'] = datetime.now().isoformat()
|
||||
writer.writerow(safe_trash)
|
||||
|
||||
safe_emails = load_safe_emails()
|
||||
|
||||
model = joblib.load('spam_classifier_model.pkl')
|
||||
vectorizer = joblib.load('vectorizer.pkl')
|
||||
|
||||
def load_client_secrets():
|
||||
with open(CLIENT_SECRETS_FILE) as f:
|
||||
return json.load(f)
|
||||
|
||||
def save_credentials(credentials):
|
||||
session['credentials'] = credentials_to_dict(credentials)
|
||||
app.logger.info("Credentials saved in session.")
|
||||
|
||||
def load_credentials():
|
||||
if 'credentials' in session:
|
||||
return google.oauth2.credentials.Credentials(
|
||||
**session['credentials'])
|
||||
return None
|
||||
|
||||
@app.route('/authorize')
|
||||
def authorize():
|
||||
client_secrets = load_client_secrets()
|
||||
flow = google_auth_oauthlib.flow.Flow.from_client_secrets_file(
|
||||
CLIENT_SECRETS_FILE, scopes=SCOPES)
|
||||
flow.redirect_uri = url_for('oauth2callback', _external=True)
|
||||
authorization_url, state = flow.authorization_url(
|
||||
access_type='offline',
|
||||
include_granted_scopes='true')
|
||||
session['state'] = state
|
||||
app.logger.info(f"Authorization URL: {authorization_url}, State: {state}")
|
||||
return jsonify({'url': authorization_url, 'state': state})
|
||||
|
||||
@app.route('/oauth2callback')
|
||||
def oauth2callback():
|
||||
state = session.pop('state', None)
|
||||
if not state:
|
||||
app.logger.error('CSRF Warning: State mismatch')
|
||||
return jsonify({'error': 'CSRF Warning: State mismatch'}), 400
|
||||
|
||||
client_secrets = load_client_secrets()
|
||||
flow = google_auth_oauthlib.flow.Flow.from_client_secrets_file(
|
||||
CLIENT_SECRETS_FILE, scopes=SCOPES, state=state)
|
||||
flow.redirect_uri = url_for('oauth2callback', _external=True)
|
||||
|
||||
authorization_response = request.url
|
||||
app.logger.info(f"Authorization response: {authorization_response}")
|
||||
|
||||
try:
|
||||
flow.fetch_token(authorization_response=authorization_response)
|
||||
credentials = flow.credentials
|
||||
save_credentials(credentials)
|
||||
app.logger.info(f"Token received and saved: {credentials.token}")
|
||||
return """
|
||||
<script>
|
||||
window.opener.postMessage('auth_complete', 'http://localhost:5000');
|
||||
window.close();
|
||||
</script>
|
||||
"""
|
||||
except KeyError as e:
|
||||
app.logger.error(f"KeyError: {str(e)}")
|
||||
app.logger.error("Client secrets: " + json.dumps(client_secrets, indent=2))
|
||||
app.logger.error("Authorization response: " + authorization_response)
|
||||
return jsonify({'error': 'KeyError', 'message': str(e)}), 500
|
||||
except Exception as e:
|
||||
app.logger.error(f"Exception: {str(e)}")
|
||||
app.logger.error("Traceback: " + traceback.format_exc())
|
||||
return jsonify({'error': 'Exception', 'message': str(e)}), 500
|
||||
|
||||
@app.route('/validate-outlook-login', methods=['POST'])
|
||||
def validate_outlook_login():
|
||||
data = request.json
|
||||
username = data['email']
|
||||
password = data['password']
|
||||
|
||||
try:
|
||||
mail = imaplib.IMAP4_SSL("outlook.office365.com")
|
||||
mail.login(username, password)
|
||||
mail.logout()
|
||||
return jsonify({"success": True}), 200
|
||||
except imaplib.IMAP4.error:
|
||||
return jsonify({"success": False, "error": "Invalid credentials"}), 401
|
||||
except UnicodeEncodeError:
|
||||
return jsonify({"success": False, "error": "Encoding error"}), 400
|
||||
|
||||
@app.route('/fetch-emails', methods=['POST'])
|
||||
def fetch_emails():
|
||||
data = request.json
|
||||
username = data['username']
|
||||
password = data['password']
|
||||
|
||||
try:
|
||||
mail = imaplib.IMAP4_SSL("outlook.office365.com")
|
||||
mail.login(username, password)
|
||||
mail.select("inbox")
|
||||
except imaplib.IMAP4.error:
|
||||
return jsonify({"error": "Login failed. Check your email and password."}), 401
|
||||
except UnicodeEncodeError:
|
||||
return jsonify({"error": "Encoding error. Ensure your email and password contain only valid characters."}), 400
|
||||
|
||||
status, messages = mail.search(None, "ALL")
|
||||
if status != "OK":
|
||||
return jsonify({"error": "Failed to retrieve emails."}), 500
|
||||
|
||||
status, messages = mail.search(None, "ALL")
|
||||
email_ids = messages[0].split()
|
||||
|
||||
emails = []
|
||||
|
||||
for email_id in email_ids:
|
||||
res, msg = mail.fetch(email_id, "(RFC822)")
|
||||
for response_part in msg:
|
||||
if isinstance(response_part, tuple):
|
||||
msg = email.message_from_bytes(response_part[1])
|
||||
subject, encoding = decode_header(msg["Subject"])[0]
|
||||
if isinstance(subject, bytes):
|
||||
subject = subject.decode(encoding if encoding else "utf-8")
|
||||
from_ = msg.get("From")
|
||||
name, email_address = email.utils.parseaddr(from_)
|
||||
body = ""
|
||||
result = False
|
||||
if msg.is_multipart():
|
||||
for part in msg.walk():
|
||||
if part.get_content_type() == "text/plain" and part.get("Content-Disposition") is None:
|
||||
body += part.get_payload(decode=True).decode(part.get_content_charset() or "utf-8")
|
||||
else:
|
||||
body = msg.get_payload(decode=True).decode(msg.get_content_charset() or "utf-8")
|
||||
email_vectorized = vectorizer.transform([body])
|
||||
prediction = model.predict(email_vectorized)
|
||||
if not any(email['id'] == email_id.decode() for email in safe_emails):
|
||||
result = True if prediction == 1 or contains_suspicious_links(body) or contains_phishing_indicators(subject, email_address,body) else False
|
||||
|
||||
emails.append({"id": email_id.decode(),
|
||||
"from": email_address,
|
||||
"subject": subject,
|
||||
"snippet": body,
|
||||
"suspicious": result})
|
||||
|
||||
|
||||
return jsonify(emails)
|
||||
|
||||
@app.route('/check_auth_status', methods=['GET'])
|
||||
def check_auth_status():
|
||||
if 'credentials' in session:
|
||||
credentials = google.oauth2.credentials.Credentials(**session['credentials'])
|
||||
if credentials and credentials.valid:
|
||||
return jsonify({'logged_in': True})
|
||||
return jsonify({'logged_in': False})
|
||||
|
||||
@app.route('/check_mail')
|
||||
def check_mail():
|
||||
if 'credentials' not in session:
|
||||
return redirect('authorize')
|
||||
|
||||
credentials = google.oauth2.credentials.Credentials(
|
||||
**session['credentials'])
|
||||
|
||||
gmail = googleapiclient.discovery.build(
|
||||
'gmail', 'v1', credentials=credentials)
|
||||
|
||||
results = gmail.users().messages().list(userId='me', labelIds=['INBOX']).execute()
|
||||
messages = results.get('messages', [])
|
||||
|
||||
emails = []
|
||||
for message in messages:
|
||||
msg = gmail.users().messages().get(userId='me', id=message['id']).execute()
|
||||
snippet = msg.get('snippet', '')
|
||||
payload = msg.get('payload', {})
|
||||
headers = payload.get('headers', [])
|
||||
subject = ''
|
||||
sender = ''
|
||||
result = False
|
||||
for header in headers:
|
||||
if header['name'] == 'Subject':
|
||||
subject = header['value']
|
||||
if header['name'] == 'From':
|
||||
sender = header['value']
|
||||
email_vectorized = vectorizer.transform([snippet])
|
||||
prediction = model.predict(email_vectorized)
|
||||
if not any(email['id'] == message['id'] for email in safe_emails):
|
||||
result = True if prediction == 1 or contains_suspicious_links(snippet) or contains_phishing_indicators(subject, sender, snippet) else False
|
||||
|
||||
emails.append({
|
||||
'subject': subject,
|
||||
'from': sender,
|
||||
'snippet': snippet,
|
||||
'id': message['id'],
|
||||
'suspicious': result
|
||||
})
|
||||
return jsonify(emails)
|
||||
|
||||
@app.route('/logout', methods=['POST'])
|
||||
def logout():
|
||||
session.clear()
|
||||
app.logger.info("Session cleared. User logged out.")
|
||||
return jsonify({'message': 'Logged out'}), 200
|
||||
|
||||
@app.route('/mark_safe/<email_id>', methods=['POST'])
|
||||
def mark_safe(email_id):
|
||||
data = request.json
|
||||
email = data['email']
|
||||
username = data['username']
|
||||
if email == "gmail":
|
||||
credentials = google.oauth2.credentials.Credentials(
|
||||
**session['credentials'])
|
||||
service = build('people', 'v1', credentials=credentials)
|
||||
profile = service.people().get(resourceName='people/me', personFields='emailAddresses').execute()
|
||||
username = profile.get('emailAddresses', [])[0].get('value')
|
||||
global safe_emails
|
||||
email_data = {'id': email_id, 'date': datetime.now().isoformat(),"username":username}
|
||||
safe_emails.append(email_data)
|
||||
save_safe_emails(safe_emails)
|
||||
return jsonify({'status': 'success'})
|
||||
|
||||
@app.route('/move_trash/<email_id>', methods=['POST'])
|
||||
def move_trash(email_id):
|
||||
if 'credentials' not in session:
|
||||
return jsonify({'message': 'Not logged in'}), 401
|
||||
credentials = google.oauth2.credentials.Credentials(
|
||||
**session['credentials'])
|
||||
gmail = googleapiclient.discovery.build(
|
||||
'gmail', 'v1', credentials=credentials)
|
||||
|
||||
service = build('people', 'v1', credentials=credentials)
|
||||
profile = service.people().get(resourceName='people/me', personFields='emailAddresses').execute()
|
||||
username = profile.get('emailAddresses', [])[0].get('value')
|
||||
|
||||
try:
|
||||
message = gmail.users().messages().get(userId='me', id=email_id).execute()
|
||||
payload = message.get('payload', {})
|
||||
headers = payload.get('headers', [])
|
||||
subject = ''
|
||||
sender = ''
|
||||
body = ''
|
||||
|
||||
for header in headers:
|
||||
if header['name'] == 'Subject':
|
||||
subject = header['value']
|
||||
if header['name'] == 'From':
|
||||
sender = header['value']
|
||||
|
||||
if 'parts' in payload:
|
||||
for part in payload['parts']:
|
||||
if part['mimeType'] == 'text/plain':
|
||||
body = part['body']['data']
|
||||
body = base64.urlsafe_b64decode(body).decode('utf-8')
|
||||
|
||||
safe_trash = {
|
||||
"from": sender,
|
||||
"subject": subject,
|
||||
"body": body,
|
||||
"username": username
|
||||
}
|
||||
save_safe_trash(safe_trash)
|
||||
|
||||
gmail.users().messages().modify(
|
||||
userId='me',
|
||||
id=email_id,
|
||||
body={'removeLabelIds': ['INBOX'], 'addLabelIds': ['TRASH']}
|
||||
).execute()
|
||||
app.logger.info(f'Email {email_id} moved to trash')
|
||||
return jsonify({"message": f"Email {email_id} moved to trash"}), 200
|
||||
except Exception as e:
|
||||
app.logger.error(f"Exception moving email to trash: {str(e)}")
|
||||
return jsonify({"error": str(e)}), 500
|
||||
|
||||
@app.route('/delete-email', methods=['POST'])
|
||||
def delete_email():
|
||||
data = request.json
|
||||
email_id = data['email_id']
|
||||
username = data['username']
|
||||
password = data['password']
|
||||
|
||||
try:
|
||||
mail = imaplib.IMAP4_SSL("outlook.office365.com")
|
||||
mail.login(username, password)
|
||||
mail.select("inbox")
|
||||
status, message_data = mail.fetch(email_id, "(RFC822)")
|
||||
|
||||
if status != "OK":
|
||||
return jsonify({"error": "Failed to fetch email"}), 500
|
||||
|
||||
msg = email.message_from_bytes(message_data[0][1])
|
||||
subject, encoding = decode_header(msg["Subject"])[0]
|
||||
if isinstance(subject, bytes):
|
||||
subject = subject.decode(encoding if encoding else "utf-8")
|
||||
from_ = msg.get("From")
|
||||
body = ""
|
||||
if msg.is_multipart():
|
||||
for part in msg.walk():
|
||||
if part.get_content_type() == "text/plain" and part.get("Content-Disposition") is None:
|
||||
body += part.get_payload(decode=True).decode(part.get_content_charset() or "utf-8")
|
||||
else:
|
||||
body = msg.get_payload(decode=True).decode(msg.get_content_charset() or "utf-8")
|
||||
|
||||
safe_trash = {
|
||||
"from": from_,
|
||||
"subject": subject,
|
||||
"body": body,
|
||||
"username": username
|
||||
}
|
||||
save_safe_trash(safe_trash)
|
||||
|
||||
mail.store(email_id, '+FLAGS', '\\Deleted')
|
||||
mail.expunge()
|
||||
return jsonify({"message": f"Email {email_id} deleted"})
|
||||
except imaplib.IMAP4.error:
|
||||
return jsonify({"error": "Failed to delete email"}), 500
|
||||
|
||||
@app.route('/get_email_stats', methods=['POST'])
|
||||
def get_email_stats():
|
||||
data = request.json
|
||||
email = data['emailService']
|
||||
username = data['username']
|
||||
if email == "gmail":
|
||||
credentials = google.oauth2.credentials.Credentials(
|
||||
**session['credentials'])
|
||||
service = build('people', 'v1', credentials=credentials)
|
||||
profile = service.people().get(resourceName='people/me', personFields='emailAddresses').execute()
|
||||
username = profile.get('emailAddresses', [])[0].get('value')
|
||||
start_date = datetime.fromisoformat(data['start_date'])
|
||||
end_date = datetime.fromisoformat(data['end_date']) + timedelta(days=1)
|
||||
|
||||
safe_emails_count = 0
|
||||
trashed_emails_count = 0
|
||||
|
||||
safe_emails = load_safe_emails()
|
||||
for email in safe_emails:
|
||||
if email['username'] == username and 'date' in email:
|
||||
email_date = datetime.fromisoformat(email['date'])
|
||||
if start_date <= email_date < end_date:
|
||||
safe_emails_count += 1
|
||||
|
||||
if os.path.exists(SAFE_TRASH_FILE):
|
||||
with open(SAFE_TRASH_FILE, 'r', encoding='utf-8') as file:
|
||||
reader = csv.DictReader(file)
|
||||
for row in reader:
|
||||
if row['username'] == username:
|
||||
email_date = datetime.fromisoformat(row['date'])
|
||||
if start_date <= email_date < end_date:
|
||||
trashed_emails_count += 1
|
||||
return jsonify({
|
||||
'safe_emails_count': safe_emails_count,
|
||||
'trashed_emails_count': trashed_emails_count
|
||||
})
|
||||
|
||||
|
||||
def contains_suspicious_links(snippet):
|
||||
url_pattern = re.compile(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+')
|
||||
urls = url_pattern.findall(snippet)
|
||||
suspicious_domains = ['phishingsite.com', 'malicious.com']
|
||||
for url in urls:
|
||||
for domain in suspicious_domains:
|
||||
if domain in url:
|
||||
return True
|
||||
return False
|
||||
|
||||
def contains_phishing_indicators(subject, sender, body):
|
||||
phishing_subject_keywords = ['urgent', 'important', 'update', 'verification', 'account', 'password', 'verify']
|
||||
phishing_senders = ['no-reply@phishingsite.com', 'support@malicious.com']
|
||||
phishing_body_keywords = ['click', 'verify', 'confirm']
|
||||
|
||||
for keyword in phishing_subject_keywords:
|
||||
if keyword in subject.lower():
|
||||
return True
|
||||
|
||||
for phishing_sender in phishing_senders:
|
||||
if phishing_sender in sender.lower():
|
||||
return True
|
||||
|
||||
for keyword in phishing_body_keywords:
|
||||
if keyword in body.lower():
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def credentials_to_dict(credentials):
|
||||
return {
|
||||
'token': credentials.token,
|
||||
'refresh_token': credentials.refresh_token,
|
||||
'token_uri': credentials.token_uri,
|
||||
'client_id': credentials.client_id,
|
||||
'client_secret': credentials.client_secret,
|
||||
'scopes': credentials.scopes
|
||||
}
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(port=5000, debug=True)
|
183469
backend/completeSpamAssassin.csv
Normal file
183469
backend/completeSpamAssassin.csv
Normal file
File diff suppressed because one or more lines are too long
20
backend/data_join.py
Normal file
20
backend/data_join.py
Normal file
@ -0,0 +1,20 @@
|
||||
import pandas as pd
|
||||
|
||||
df_1 = pd.read_csv("completeSpamAssassin.csv")
|
||||
df_2 = pd.read_csv("enronSpamSubset.csv")
|
||||
df_3 = pd.read_csv("lingSpam.csv")
|
||||
|
||||
df = pd.concat([df_1, df_2, df_3])
|
||||
df = df[['Body', 'Label']]
|
||||
|
||||
df = df.sample(len(df))
|
||||
|
||||
df.reset_index(drop=True, inplace=True)
|
||||
|
||||
df.to_csv('joined_data.csv')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
252259
backend/enronSpamSubset.csv
Normal file
252259
backend/enronSpamSubset.csv
Normal file
File diff suppressed because one or more lines are too long
467279
backend/joined_data.csv
Normal file
467279
backend/joined_data.csv
Normal file
File diff suppressed because one or more lines are too long
31553
backend/lingSpam.csv
Normal file
31553
backend/lingSpam.csv
Normal file
File diff suppressed because one or more lines are too long
10
backend/requirements.txt
Normal file
10
backend/requirements.txt
Normal file
@ -0,0 +1,10 @@
|
||||
Flask==3.0.3
|
||||
Flask-Cors==4.0.1
|
||||
scikit-learn==1.3.2
|
||||
joblib==1.4.2
|
||||
pandas==2.2.2
|
||||
google-api-core==2.19.0
|
||||
google-api-python-client ==2.132.0
|
||||
google-auth==2.30.0
|
||||
google-auth-httplib2==0.2.0
|
||||
google-auth-oauthlib==1.2.0
|
BIN
backend/spam_classifier_model.pkl
Normal file
BIN
backend/spam_classifier_model.pkl
Normal file
Binary file not shown.
BIN
backend/vectorizer.pkl
Normal file
BIN
backend/vectorizer.pkl
Normal file
Binary file not shown.
100
extension/background.js
Normal file
100
extension/background.js
Normal file
@ -0,0 +1,100 @@
|
||||
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||
if (message.type === "phishing-detected") {
|
||||
const emails = message.emails;
|
||||
let notificationTitle = "You are safe!";
|
||||
let notificationMessage = "No phishing emails detected.";
|
||||
const phishingEmails = emails.filter((email) => email.suspicious);
|
||||
|
||||
if (phishingEmails.length > 0) {
|
||||
notificationTitle = "You are in danger!";
|
||||
notificationMessage = `Detected ${phishingEmails.length} suspicious emails.`;
|
||||
|
||||
chrome.windows.create(
|
||||
{
|
||||
url: "notification.html",
|
||||
type: "popup",
|
||||
width: 400,
|
||||
height: 400,
|
||||
},
|
||||
function (window) {
|
||||
chrome.storage.local.set({
|
||||
notificationTitle: notificationTitle,
|
||||
notificationMessage: notificationMessage,
|
||||
phishingEmails: phishingEmails,
|
||||
});
|
||||
}
|
||||
);
|
||||
} else {
|
||||
chrome.windows.create(
|
||||
{
|
||||
url: "notification.html",
|
||||
type: "popup",
|
||||
width: 300,
|
||||
height: 200,
|
||||
},
|
||||
function (window) {
|
||||
chrome.storage.local.set({
|
||||
notificationTitle: notificationTitle,
|
||||
notificationMessage: notificationMessage,
|
||||
phishingEmails: [],
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
} else if (message.type === "mark-safe") {
|
||||
chrome.storage.local.get(
|
||||
["email", "password", "emailService"],
|
||||
function (result) {
|
||||
const emailService = result.emailService;
|
||||
const emailId = message.emailId;
|
||||
fetch(`http://localhost:5000/mark_safe/${emailId}`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
username: result.email,
|
||||
email: emailService,
|
||||
}),
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => console.log(data))
|
||||
.catch((error) => console.error("Error:", error));
|
||||
}
|
||||
);
|
||||
} else if (message.type === "move-trash") {
|
||||
chrome.storage.local.get(
|
||||
["email", "password", "emailService"],
|
||||
function (result) {
|
||||
const emailService = result.emailService;
|
||||
const emailId = message.emailId;
|
||||
if (emailService === "outlook") {
|
||||
fetch(`http://localhost:5000/delete-email`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
email_id: emailId,
|
||||
username: result.email,
|
||||
password: result.password,
|
||||
}),
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => console.log(data))
|
||||
.catch((error) => console.error("Error:", error));
|
||||
} else {
|
||||
fetch(`http://localhost:5000/move_trash/${emailId}`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => console.log(data))
|
||||
.catch((error) => console.error("Error:", error));
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
4085
extension/css/bootstrap-grid.css
vendored
Normal file
4085
extension/css/bootstrap-grid.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
extension/css/bootstrap-grid.css.map
Normal file
1
extension/css/bootstrap-grid.css.map
Normal file
File diff suppressed because one or more lines are too long
6
extension/css/bootstrap-grid.min.css
vendored
Normal file
6
extension/css/bootstrap-grid.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
extension/css/bootstrap-grid.min.css.map
Normal file
1
extension/css/bootstrap-grid.min.css.map
Normal file
File diff suppressed because one or more lines are too long
4084
extension/css/bootstrap-grid.rtl.css
vendored
Normal file
4084
extension/css/bootstrap-grid.rtl.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
extension/css/bootstrap-grid.rtl.css.map
Normal file
1
extension/css/bootstrap-grid.rtl.css.map
Normal file
File diff suppressed because one or more lines are too long
6
extension/css/bootstrap-grid.rtl.min.css
vendored
Normal file
6
extension/css/bootstrap-grid.rtl.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
extension/css/bootstrap-grid.rtl.min.css.map
Normal file
1
extension/css/bootstrap-grid.rtl.min.css.map
Normal file
File diff suppressed because one or more lines are too long
597
extension/css/bootstrap-reboot.css
vendored
Normal file
597
extension/css/bootstrap-reboot.css
vendored
Normal file
@ -0,0 +1,597 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v5.3.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2024 The Bootstrap Authors
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
:root,
|
||||
[data-bs-theme=light] {
|
||||
--bs-blue: #0d6efd;
|
||||
--bs-indigo: #6610f2;
|
||||
--bs-purple: #6f42c1;
|
||||
--bs-pink: #d63384;
|
||||
--bs-red: #dc3545;
|
||||
--bs-orange: #fd7e14;
|
||||
--bs-yellow: #ffc107;
|
||||
--bs-green: #198754;
|
||||
--bs-teal: #20c997;
|
||||
--bs-cyan: #0dcaf0;
|
||||
--bs-black: #000;
|
||||
--bs-white: #fff;
|
||||
--bs-gray: #6c757d;
|
||||
--bs-gray-dark: #343a40;
|
||||
--bs-gray-100: #f8f9fa;
|
||||
--bs-gray-200: #e9ecef;
|
||||
--bs-gray-300: #dee2e6;
|
||||
--bs-gray-400: #ced4da;
|
||||
--bs-gray-500: #adb5bd;
|
||||
--bs-gray-600: #6c757d;
|
||||
--bs-gray-700: #495057;
|
||||
--bs-gray-800: #343a40;
|
||||
--bs-gray-900: #212529;
|
||||
--bs-primary: #0d6efd;
|
||||
--bs-secondary: #6c757d;
|
||||
--bs-success: #198754;
|
||||
--bs-info: #0dcaf0;
|
||||
--bs-warning: #ffc107;
|
||||
--bs-danger: #dc3545;
|
||||
--bs-light: #f8f9fa;
|
||||
--bs-dark: #212529;
|
||||
--bs-primary-rgb: 13, 110, 253;
|
||||
--bs-secondary-rgb: 108, 117, 125;
|
||||
--bs-success-rgb: 25, 135, 84;
|
||||
--bs-info-rgb: 13, 202, 240;
|
||||
--bs-warning-rgb: 255, 193, 7;
|
||||
--bs-danger-rgb: 220, 53, 69;
|
||||
--bs-light-rgb: 248, 249, 250;
|
||||
--bs-dark-rgb: 33, 37, 41;
|
||||
--bs-primary-text-emphasis: #052c65;
|
||||
--bs-secondary-text-emphasis: #2b2f32;
|
||||
--bs-success-text-emphasis: #0a3622;
|
||||
--bs-info-text-emphasis: #055160;
|
||||
--bs-warning-text-emphasis: #664d03;
|
||||
--bs-danger-text-emphasis: #58151c;
|
||||
--bs-light-text-emphasis: #495057;
|
||||
--bs-dark-text-emphasis: #495057;
|
||||
--bs-primary-bg-subtle: #cfe2ff;
|
||||
--bs-secondary-bg-subtle: #e2e3e5;
|
||||
--bs-success-bg-subtle: #d1e7dd;
|
||||
--bs-info-bg-subtle: #cff4fc;
|
||||
--bs-warning-bg-subtle: #fff3cd;
|
||||
--bs-danger-bg-subtle: #f8d7da;
|
||||
--bs-light-bg-subtle: #fcfcfd;
|
||||
--bs-dark-bg-subtle: #ced4da;
|
||||
--bs-primary-border-subtle: #9ec5fe;
|
||||
--bs-secondary-border-subtle: #c4c8cb;
|
||||
--bs-success-border-subtle: #a3cfbb;
|
||||
--bs-info-border-subtle: #9eeaf9;
|
||||
--bs-warning-border-subtle: #ffe69c;
|
||||
--bs-danger-border-subtle: #f1aeb5;
|
||||
--bs-light-border-subtle: #e9ecef;
|
||||
--bs-dark-border-subtle: #adb5bd;
|
||||
--bs-white-rgb: 255, 255, 255;
|
||||
--bs-black-rgb: 0, 0, 0;
|
||||
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
|
||||
--bs-body-font-family: var(--bs-font-sans-serif);
|
||||
--bs-body-font-size: 1rem;
|
||||
--bs-body-font-weight: 400;
|
||||
--bs-body-line-height: 1.5;
|
||||
--bs-body-color: #212529;
|
||||
--bs-body-color-rgb: 33, 37, 41;
|
||||
--bs-body-bg: #fff;
|
||||
--bs-body-bg-rgb: 255, 255, 255;
|
||||
--bs-emphasis-color: #000;
|
||||
--bs-emphasis-color-rgb: 0, 0, 0;
|
||||
--bs-secondary-color: rgba(33, 37, 41, 0.75);
|
||||
--bs-secondary-color-rgb: 33, 37, 41;
|
||||
--bs-secondary-bg: #e9ecef;
|
||||
--bs-secondary-bg-rgb: 233, 236, 239;
|
||||
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
|
||||
--bs-tertiary-color-rgb: 33, 37, 41;
|
||||
--bs-tertiary-bg: #f8f9fa;
|
||||
--bs-tertiary-bg-rgb: 248, 249, 250;
|
||||
--bs-heading-color: inherit;
|
||||
--bs-link-color: #0d6efd;
|
||||
--bs-link-color-rgb: 13, 110, 253;
|
||||
--bs-link-decoration: underline;
|
||||
--bs-link-hover-color: #0a58ca;
|
||||
--bs-link-hover-color-rgb: 10, 88, 202;
|
||||
--bs-code-color: #d63384;
|
||||
--bs-highlight-color: #212529;
|
||||
--bs-highlight-bg: #fff3cd;
|
||||
--bs-border-width: 1px;
|
||||
--bs-border-style: solid;
|
||||
--bs-border-color: #dee2e6;
|
||||
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
|
||||
--bs-border-radius: 0.375rem;
|
||||
--bs-border-radius-sm: 0.25rem;
|
||||
--bs-border-radius-lg: 0.5rem;
|
||||
--bs-border-radius-xl: 1rem;
|
||||
--bs-border-radius-xxl: 2rem;
|
||||
--bs-border-radius-2xl: var(--bs-border-radius-xxl);
|
||||
--bs-border-radius-pill: 50rem;
|
||||
--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
||||
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
|
||||
--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);
|
||||
--bs-focus-ring-width: 0.25rem;
|
||||
--bs-focus-ring-opacity: 0.25;
|
||||
--bs-focus-ring-color: rgba(13, 110, 253, 0.25);
|
||||
--bs-form-valid-color: #198754;
|
||||
--bs-form-valid-border-color: #198754;
|
||||
--bs-form-invalid-color: #dc3545;
|
||||
--bs-form-invalid-border-color: #dc3545;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] {
|
||||
color-scheme: dark;
|
||||
--bs-body-color: #dee2e6;
|
||||
--bs-body-color-rgb: 222, 226, 230;
|
||||
--bs-body-bg: #212529;
|
||||
--bs-body-bg-rgb: 33, 37, 41;
|
||||
--bs-emphasis-color: #fff;
|
||||
--bs-emphasis-color-rgb: 255, 255, 255;
|
||||
--bs-secondary-color: rgba(222, 226, 230, 0.75);
|
||||
--bs-secondary-color-rgb: 222, 226, 230;
|
||||
--bs-secondary-bg: #343a40;
|
||||
--bs-secondary-bg-rgb: 52, 58, 64;
|
||||
--bs-tertiary-color: rgba(222, 226, 230, 0.5);
|
||||
--bs-tertiary-color-rgb: 222, 226, 230;
|
||||
--bs-tertiary-bg: #2b3035;
|
||||
--bs-tertiary-bg-rgb: 43, 48, 53;
|
||||
--bs-primary-text-emphasis: #6ea8fe;
|
||||
--bs-secondary-text-emphasis: #a7acb1;
|
||||
--bs-success-text-emphasis: #75b798;
|
||||
--bs-info-text-emphasis: #6edff6;
|
||||
--bs-warning-text-emphasis: #ffda6a;
|
||||
--bs-danger-text-emphasis: #ea868f;
|
||||
--bs-light-text-emphasis: #f8f9fa;
|
||||
--bs-dark-text-emphasis: #dee2e6;
|
||||
--bs-primary-bg-subtle: #031633;
|
||||
--bs-secondary-bg-subtle: #161719;
|
||||
--bs-success-bg-subtle: #051b11;
|
||||
--bs-info-bg-subtle: #032830;
|
||||
--bs-warning-bg-subtle: #332701;
|
||||
--bs-danger-bg-subtle: #2c0b0e;
|
||||
--bs-light-bg-subtle: #343a40;
|
||||
--bs-dark-bg-subtle: #1a1d20;
|
||||
--bs-primary-border-subtle: #084298;
|
||||
--bs-secondary-border-subtle: #41464b;
|
||||
--bs-success-border-subtle: #0f5132;
|
||||
--bs-info-border-subtle: #087990;
|
||||
--bs-warning-border-subtle: #997404;
|
||||
--bs-danger-border-subtle: #842029;
|
||||
--bs-light-border-subtle: #495057;
|
||||
--bs-dark-border-subtle: #343a40;
|
||||
--bs-heading-color: inherit;
|
||||
--bs-link-color: #6ea8fe;
|
||||
--bs-link-hover-color: #8bb9fe;
|
||||
--bs-link-color-rgb: 110, 168, 254;
|
||||
--bs-link-hover-color-rgb: 139, 185, 254;
|
||||
--bs-code-color: #e685b5;
|
||||
--bs-highlight-color: #dee2e6;
|
||||
--bs-highlight-bg: #664d03;
|
||||
--bs-border-color: #495057;
|
||||
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
|
||||
--bs-form-valid-color: #75b798;
|
||||
--bs-form-valid-border-color: #75b798;
|
||||
--bs-form-invalid-color: #ea868f;
|
||||
--bs-form-invalid-border-color: #ea868f;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
:root {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: var(--bs-body-font-family);
|
||||
font-size: var(--bs-body-font-size);
|
||||
font-weight: var(--bs-body-font-weight);
|
||||
line-height: var(--bs-body-line-height);
|
||||
color: var(--bs-body-color);
|
||||
text-align: var(--bs-body-text-align);
|
||||
background-color: var(--bs-body-bg);
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 1rem 0;
|
||||
color: inherit;
|
||||
border: 0;
|
||||
border-top: var(--bs-border-width) solid;
|
||||
opacity: 0.25;
|
||||
}
|
||||
|
||||
h6, h5, h4, h3, h2, h1 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
color: var(--bs-heading-color);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: calc(1.375rem + 1.5vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h1 {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: calc(1.325rem + 0.9vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h2 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: calc(1.3rem + 0.6vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h3 {
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: calc(1.275rem + 0.3vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h4 {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
abbr[title] {
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted;
|
||||
cursor: help;
|
||||
-webkit-text-decoration-skip-ink: none;
|
||||
text-decoration-skip-ink: none;
|
||||
}
|
||||
|
||||
address {
|
||||
margin-bottom: 1rem;
|
||||
font-style: normal;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul {
|
||||
padding-left: 2rem;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul,
|
||||
dl {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
ol ol,
|
||||
ul ul,
|
||||
ol ul,
|
||||
ul ol {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-bottom: 0.5rem;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
mark {
|
||||
padding: 0.1875em;
|
||||
color: var(--bs-highlight-color);
|
||||
background-color: var(--bs-highlight-bg);
|
||||
}
|
||||
|
||||
sub,
|
||||
sup {
|
||||
position: relative;
|
||||
font-size: 0.75em;
|
||||
line-height: 0;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
a {
|
||||
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:hover {
|
||||
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
|
||||
}
|
||||
|
||||
a:not([href]):not([class]), a:not([href]):not([class]):hover {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
pre,
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: var(--bs-font-monospace);
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
display: block;
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
overflow: auto;
|
||||
font-size: 0.875em;
|
||||
}
|
||||
pre code {
|
||||
font-size: inherit;
|
||||
color: inherit;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 0.875em;
|
||||
color: var(--bs-code-color);
|
||||
word-wrap: break-word;
|
||||
}
|
||||
a > code {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
kbd {
|
||||
padding: 0.1875rem 0.375rem;
|
||||
font-size: 0.875em;
|
||||
color: var(--bs-body-bg);
|
||||
background-color: var(--bs-body-color);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
kbd kbd {
|
||||
padding: 0;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
img,
|
||||
svg {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
table {
|
||||
caption-side: bottom;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
caption {
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
color: var(--bs-secondary-color);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: inherit;
|
||||
text-align: -webkit-match-parent;
|
||||
}
|
||||
|
||||
thead,
|
||||
tbody,
|
||||
tfoot,
|
||||
tr,
|
||||
td,
|
||||
th {
|
||||
border-color: inherit;
|
||||
border-style: solid;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
button {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
button:focus:not(:focus-visible) {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
input,
|
||||
button,
|
||||
select,
|
||||
optgroup,
|
||||
textarea {
|
||||
margin: 0;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
[role=button] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
select {
|
||||
word-wrap: normal;
|
||||
}
|
||||
select:disabled {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
button,
|
||||
[type=button],
|
||||
[type=reset],
|
||||
[type=submit] {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
button:not(:disabled),
|
||||
[type=button]:not(:disabled),
|
||||
[type=reset]:not(:disabled),
|
||||
[type=submit]:not(:disabled) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
legend {
|
||||
float: left;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: calc(1.275rem + 0.3vw);
|
||||
line-height: inherit;
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
legend {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
legend + * {
|
||||
clear: left;
|
||||
}
|
||||
|
||||
::-webkit-datetime-edit-fields-wrapper,
|
||||
::-webkit-datetime-edit-text,
|
||||
::-webkit-datetime-edit-minute,
|
||||
::-webkit-datetime-edit-hour-field,
|
||||
::-webkit-datetime-edit-day-field,
|
||||
::-webkit-datetime-edit-month-field,
|
||||
::-webkit-datetime-edit-year-field {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
::-webkit-inner-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
[type=search] {
|
||||
-webkit-appearance: textfield;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
/* rtl:raw:
|
||||
[type="tel"],
|
||||
[type="url"],
|
||||
[type="email"],
|
||||
[type="number"] {
|
||||
direction: ltr;
|
||||
}
|
||||
*/
|
||||
::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
::-webkit-color-swatch-wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
::file-selector-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
output {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
iframe {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=bootstrap-reboot.css.map */
|
1
extension/css/bootstrap-reboot.css.map
Normal file
1
extension/css/bootstrap-reboot.css.map
Normal file
File diff suppressed because one or more lines are too long
6
extension/css/bootstrap-reboot.min.css
vendored
Normal file
6
extension/css/bootstrap-reboot.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
extension/css/bootstrap-reboot.min.css.map
Normal file
1
extension/css/bootstrap-reboot.min.css.map
Normal file
File diff suppressed because one or more lines are too long
594
extension/css/bootstrap-reboot.rtl.css
vendored
Normal file
594
extension/css/bootstrap-reboot.rtl.css
vendored
Normal file
@ -0,0 +1,594 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v5.3.3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2024 The Bootstrap Authors
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
:root,
|
||||
[data-bs-theme=light] {
|
||||
--bs-blue: #0d6efd;
|
||||
--bs-indigo: #6610f2;
|
||||
--bs-purple: #6f42c1;
|
||||
--bs-pink: #d63384;
|
||||
--bs-red: #dc3545;
|
||||
--bs-orange: #fd7e14;
|
||||
--bs-yellow: #ffc107;
|
||||
--bs-green: #198754;
|
||||
--bs-teal: #20c997;
|
||||
--bs-cyan: #0dcaf0;
|
||||
--bs-black: #000;
|
||||
--bs-white: #fff;
|
||||
--bs-gray: #6c757d;
|
||||
--bs-gray-dark: #343a40;
|
||||
--bs-gray-100: #f8f9fa;
|
||||
--bs-gray-200: #e9ecef;
|
||||
--bs-gray-300: #dee2e6;
|
||||
--bs-gray-400: #ced4da;
|
||||
--bs-gray-500: #adb5bd;
|
||||
--bs-gray-600: #6c757d;
|
||||
--bs-gray-700: #495057;
|
||||
--bs-gray-800: #343a40;
|
||||
--bs-gray-900: #212529;
|
||||
--bs-primary: #0d6efd;
|
||||
--bs-secondary: #6c757d;
|
||||
--bs-success: #198754;
|
||||
--bs-info: #0dcaf0;
|
||||
--bs-warning: #ffc107;
|
||||
--bs-danger: #dc3545;
|
||||
--bs-light: #f8f9fa;
|
||||
--bs-dark: #212529;
|
||||
--bs-primary-rgb: 13, 110, 253;
|
||||
--bs-secondary-rgb: 108, 117, 125;
|
||||
--bs-success-rgb: 25, 135, 84;
|
||||
--bs-info-rgb: 13, 202, 240;
|
||||
--bs-warning-rgb: 255, 193, 7;
|
||||
--bs-danger-rgb: 220, 53, 69;
|
||||
--bs-light-rgb: 248, 249, 250;
|
||||
--bs-dark-rgb: 33, 37, 41;
|
||||
--bs-primary-text-emphasis: #052c65;
|
||||
--bs-secondary-text-emphasis: #2b2f32;
|
||||
--bs-success-text-emphasis: #0a3622;
|
||||
--bs-info-text-emphasis: #055160;
|
||||
--bs-warning-text-emphasis: #664d03;
|
||||
--bs-danger-text-emphasis: #58151c;
|
||||
--bs-light-text-emphasis: #495057;
|
||||
--bs-dark-text-emphasis: #495057;
|
||||
--bs-primary-bg-subtle: #cfe2ff;
|
||||
--bs-secondary-bg-subtle: #e2e3e5;
|
||||
--bs-success-bg-subtle: #d1e7dd;
|
||||
--bs-info-bg-subtle: #cff4fc;
|
||||
--bs-warning-bg-subtle: #fff3cd;
|
||||
--bs-danger-bg-subtle: #f8d7da;
|
||||
--bs-light-bg-subtle: #fcfcfd;
|
||||
--bs-dark-bg-subtle: #ced4da;
|
||||
--bs-primary-border-subtle: #9ec5fe;
|
||||
--bs-secondary-border-subtle: #c4c8cb;
|
||||
--bs-success-border-subtle: #a3cfbb;
|
||||
--bs-info-border-subtle: #9eeaf9;
|
||||
--bs-warning-border-subtle: #ffe69c;
|
||||
--bs-danger-border-subtle: #f1aeb5;
|
||||
--bs-light-border-subtle: #e9ecef;
|
||||
--bs-dark-border-subtle: #adb5bd;
|
||||
--bs-white-rgb: 255, 255, 255;
|
||||
--bs-black-rgb: 0, 0, 0;
|
||||
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
|
||||
--bs-body-font-family: var(--bs-font-sans-serif);
|
||||
--bs-body-font-size: 1rem;
|
||||
--bs-body-font-weight: 400;
|
||||
--bs-body-line-height: 1.5;
|
||||
--bs-body-color: #212529;
|
||||
--bs-body-color-rgb: 33, 37, 41;
|
||||
--bs-body-bg: #fff;
|
||||
--bs-body-bg-rgb: 255, 255, 255;
|
||||
--bs-emphasis-color: #000;
|
||||
--bs-emphasis-color-rgb: 0, 0, 0;
|
||||
--bs-secondary-color: rgba(33, 37, 41, 0.75);
|
||||
--bs-secondary-color-rgb: 33, 37, 41;
|
||||
--bs-secondary-bg: #e9ecef;
|
||||
--bs-secondary-bg-rgb: 233, 236, 239;
|
||||
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
|
||||
--bs-tertiary-color-rgb: 33, 37, 41;
|
||||
--bs-tertiary-bg: #f8f9fa;
|
||||
--bs-tertiary-bg-rgb: 248, 249, 250;
|
||||
--bs-heading-color: inherit;
|
||||
--bs-link-color: #0d6efd;
|
||||
--bs-link-color-rgb: 13, 110, 253;
|
||||
--bs-link-decoration: underline;
|
||||
--bs-link-hover-color: #0a58ca;
|
||||
--bs-link-hover-color-rgb: 10, 88, 202;
|
||||
--bs-code-color: #d63384;
|
||||
--bs-highlight-color: #212529;
|
||||
--bs-highlight-bg: #fff3cd;
|
||||
--bs-border-width: 1px;
|
||||
--bs-border-style: solid;
|
||||
--bs-border-color: #dee2e6;
|
||||
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
|
||||
--bs-border-radius: 0.375rem;
|
||||
--bs-border-radius-sm: 0.25rem;
|
||||
--bs-border-radius-lg: 0.5rem;
|
||||
--bs-border-radius-xl: 1rem;
|
||||
--bs-border-radius-xxl: 2rem;
|
||||
--bs-border-radius-2xl: var(--bs-border-radius-xxl);
|
||||
--bs-border-radius-pill: 50rem;
|
||||
--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
||||
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
|
||||
--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
|
||||
--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);
|
||||
--bs-focus-ring-width: 0.25rem;
|
||||
--bs-focus-ring-opacity: 0.25;
|
||||
--bs-focus-ring-color: rgba(13, 110, 253, 0.25);
|
||||
--bs-form-valid-color: #198754;
|
||||
--bs-form-valid-border-color: #198754;
|
||||
--bs-form-invalid-color: #dc3545;
|
||||
--bs-form-invalid-border-color: #dc3545;
|
||||
}
|
||||
|
||||
[data-bs-theme=dark] {
|
||||
color-scheme: dark;
|
||||
--bs-body-color: #dee2e6;
|
||||
--bs-body-color-rgb: 222, 226, 230;
|
||||
--bs-body-bg: #212529;
|
||||
--bs-body-bg-rgb: 33, 37, 41;
|
||||
--bs-emphasis-color: #fff;
|
||||
--bs-emphasis-color-rgb: 255, 255, 255;
|
||||
--bs-secondary-color: rgba(222, 226, 230, 0.75);
|
||||
--bs-secondary-color-rgb: 222, 226, 230;
|
||||
--bs-secondary-bg: #343a40;
|
||||
--bs-secondary-bg-rgb: 52, 58, 64;
|
||||
--bs-tertiary-color: rgba(222, 226, 230, 0.5);
|
||||
--bs-tertiary-color-rgb: 222, 226, 230;
|
||||
--bs-tertiary-bg: #2b3035;
|
||||
--bs-tertiary-bg-rgb: 43, 48, 53;
|
||||
--bs-primary-text-emphasis: #6ea8fe;
|
||||
--bs-secondary-text-emphasis: #a7acb1;
|
||||
--bs-success-text-emphasis: #75b798;
|
||||
--bs-info-text-emphasis: #6edff6;
|
||||
--bs-warning-text-emphasis: #ffda6a;
|
||||
--bs-danger-text-emphasis: #ea868f;
|
||||
--bs-light-text-emphasis: #f8f9fa;
|
||||
--bs-dark-text-emphasis: #dee2e6;
|
||||
--bs-primary-bg-subtle: #031633;
|
||||
--bs-secondary-bg-subtle: #161719;
|
||||
--bs-success-bg-subtle: #051b11;
|
||||
--bs-info-bg-subtle: #032830;
|
||||
--bs-warning-bg-subtle: #332701;
|
||||
--bs-danger-bg-subtle: #2c0b0e;
|
||||
--bs-light-bg-subtle: #343a40;
|
||||
--bs-dark-bg-subtle: #1a1d20;
|
||||
--bs-primary-border-subtle: #084298;
|
||||
--bs-secondary-border-subtle: #41464b;
|
||||
--bs-success-border-subtle: #0f5132;
|
||||
--bs-info-border-subtle: #087990;
|
||||
--bs-warning-border-subtle: #997404;
|
||||
--bs-danger-border-subtle: #842029;
|
||||
--bs-light-border-subtle: #495057;
|
||||
--bs-dark-border-subtle: #343a40;
|
||||
--bs-heading-color: inherit;
|
||||
--bs-link-color: #6ea8fe;
|
||||
--bs-link-hover-color: #8bb9fe;
|
||||
--bs-link-color-rgb: 110, 168, 254;
|
||||
--bs-link-hover-color-rgb: 139, 185, 254;
|
||||
--bs-code-color: #e685b5;
|
||||
--bs-highlight-color: #dee2e6;
|
||||
--bs-highlight-bg: #664d03;
|
||||
--bs-border-color: #495057;
|
||||
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
|
||||
--bs-form-valid-color: #75b798;
|
||||
--bs-form-valid-border-color: #75b798;
|
||||
--bs-form-invalid-color: #ea868f;
|
||||
--bs-form-invalid-border-color: #ea868f;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
:root {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: var(--bs-body-font-family);
|
||||
font-size: var(--bs-body-font-size);
|
||||
font-weight: var(--bs-body-font-weight);
|
||||
line-height: var(--bs-body-line-height);
|
||||
color: var(--bs-body-color);
|
||||
text-align: var(--bs-body-text-align);
|
||||
background-color: var(--bs-body-bg);
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 1rem 0;
|
||||
color: inherit;
|
||||
border: 0;
|
||||
border-top: var(--bs-border-width) solid;
|
||||
opacity: 0.25;
|
||||
}
|
||||
|
||||
h6, h5, h4, h3, h2, h1 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
color: var(--bs-heading-color);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: calc(1.375rem + 1.5vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h1 {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: calc(1.325rem + 0.9vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h2 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: calc(1.3rem + 0.6vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h3 {
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: calc(1.275rem + 0.3vw);
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
h4 {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
abbr[title] {
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted;
|
||||
cursor: help;
|
||||
-webkit-text-decoration-skip-ink: none;
|
||||
text-decoration-skip-ink: none;
|
||||
}
|
||||
|
||||
address {
|
||||
margin-bottom: 1rem;
|
||||
font-style: normal;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul {
|
||||
padding-right: 2rem;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul,
|
||||
dl {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
ol ol,
|
||||
ul ul,
|
||||
ol ul,
|
||||
ul ol {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-bottom: 0.5rem;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
mark {
|
||||
padding: 0.1875em;
|
||||
color: var(--bs-highlight-color);
|
||||
background-color: var(--bs-highlight-bg);
|
||||
}
|
||||
|
||||
sub,
|
||||
sup {
|
||||
position: relative;
|
||||
font-size: 0.75em;
|
||||
line-height: 0;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
a {
|
||||
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:hover {
|
||||
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
|
||||
}
|
||||
|
||||
a:not([href]):not([class]), a:not([href]):not([class]):hover {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
pre,
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: var(--bs-font-monospace);
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
display: block;
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
overflow: auto;
|
||||
font-size: 0.875em;
|
||||
}
|
||||
pre code {
|
||||
font-size: inherit;
|
||||
color: inherit;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 0.875em;
|
||||
color: var(--bs-code-color);
|
||||
word-wrap: break-word;
|
||||
}
|
||||
a > code {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
kbd {
|
||||
padding: 0.1875rem 0.375rem;
|
||||
font-size: 0.875em;
|
||||
color: var(--bs-body-bg);
|
||||
background-color: var(--bs-body-color);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
kbd kbd {
|
||||
padding: 0;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
img,
|
||||
svg {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
table {
|
||||
caption-side: bottom;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
caption {
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
color: var(--bs-secondary-color);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: inherit;
|
||||
text-align: -webkit-match-parent;
|
||||
}
|
||||
|
||||
thead,
|
||||
tbody,
|
||||
tfoot,
|
||||
tr,
|
||||
td,
|
||||
th {
|
||||
border-color: inherit;
|
||||
border-style: solid;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
button {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
button:focus:not(:focus-visible) {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
input,
|
||||
button,
|
||||
select,
|
||||
optgroup,
|
||||
textarea {
|
||||
margin: 0;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
[role=button] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
select {
|
||||
word-wrap: normal;
|
||||
}
|
||||
select:disabled {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
button,
|
||||
[type=button],
|
||||
[type=reset],
|
||||
[type=submit] {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
button:not(:disabled),
|
||||
[type=button]:not(:disabled),
|
||||
[type=reset]:not(:disabled),
|
||||
[type=submit]:not(:disabled) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
legend {
|
||||
float: right;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: calc(1.275rem + 0.3vw);
|
||||
line-height: inherit;
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
legend {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
}
|
||||
legend + * {
|
||||
clear: right;
|
||||
}
|
||||
|
||||
::-webkit-datetime-edit-fields-wrapper,
|
||||
::-webkit-datetime-edit-text,
|
||||
::-webkit-datetime-edit-minute,
|
||||
::-webkit-datetime-edit-hour-field,
|
||||
::-webkit-datetime-edit-day-field,
|
||||
::-webkit-datetime-edit-month-field,
|
||||
::-webkit-datetime-edit-year-field {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
::-webkit-inner-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
[type=search] {
|
||||
-webkit-appearance: textfield;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
[type="tel"],
|
||||
[type="url"],
|
||||
[type="email"],
|
||||
[type="number"] {
|
||||
direction: ltr;
|
||||
}
|
||||
::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
::-webkit-color-swatch-wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
::file-selector-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
output {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
iframe {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
/*# sourceMappingURL=bootstrap-reboot.rtl.css.map */
|
1
extension/css/bootstrap-reboot.rtl.css.map
Normal file
1
extension/css/bootstrap-reboot.rtl.css.map
Normal file
File diff suppressed because one or more lines are too long
6
extension/css/bootstrap-reboot.rtl.min.css
vendored
Normal file
6
extension/css/bootstrap-reboot.rtl.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
extension/css/bootstrap-reboot.rtl.min.css.map
Normal file
1
extension/css/bootstrap-reboot.rtl.min.css.map
Normal file
File diff suppressed because one or more lines are too long
5402
extension/css/bootstrap-utilities.css
vendored
Normal file
5402
extension/css/bootstrap-utilities.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
extension/css/bootstrap-utilities.css.map
Normal file
1
extension/css/bootstrap-utilities.css.map
Normal file
File diff suppressed because one or more lines are too long
6
extension/css/bootstrap-utilities.min.css
vendored
Normal file
6
extension/css/bootstrap-utilities.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
extension/css/bootstrap-utilities.min.css.map
Normal file
1
extension/css/bootstrap-utilities.min.css.map
Normal file
File diff suppressed because one or more lines are too long
5393
extension/css/bootstrap-utilities.rtl.css
vendored
Normal file
5393
extension/css/bootstrap-utilities.rtl.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
extension/css/bootstrap-utilities.rtl.css.map
Normal file
1
extension/css/bootstrap-utilities.rtl.css.map
Normal file
File diff suppressed because one or more lines are too long
6
extension/css/bootstrap-utilities.rtl.min.css
vendored
Normal file
6
extension/css/bootstrap-utilities.rtl.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
extension/css/bootstrap-utilities.rtl.min.css.map
Normal file
1
extension/css/bootstrap-utilities.rtl.min.css.map
Normal file
File diff suppressed because one or more lines are too long
12057
extension/css/bootstrap.css
vendored
Normal file
12057
extension/css/bootstrap.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
extension/css/bootstrap.css.map
Normal file
1
extension/css/bootstrap.css.map
Normal file
File diff suppressed because one or more lines are too long
6
extension/css/bootstrap.min.css
vendored
Normal file
6
extension/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
extension/css/bootstrap.min.css.map
Normal file
1
extension/css/bootstrap.min.css.map
Normal file
File diff suppressed because one or more lines are too long
12030
extension/css/bootstrap.rtl.css
vendored
Normal file
12030
extension/css/bootstrap.rtl.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
extension/css/bootstrap.rtl.css.map
Normal file
1
extension/css/bootstrap.rtl.css.map
Normal file
File diff suppressed because one or more lines are too long
6
extension/css/bootstrap.rtl.min.css
vendored
Normal file
6
extension/css/bootstrap.rtl.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
extension/css/bootstrap.rtl.min.css.map
Normal file
1
extension/css/bootstrap.rtl.min.css.map
Normal file
File diff suppressed because one or more lines are too long
BIN
extension/images/icon128.png
Normal file
BIN
extension/images/icon128.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
extension/images/icon16.png
Normal file
BIN
extension/images/icon16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 537 B |
BIN
extension/images/icon48.png
Normal file
BIN
extension/images/icon48.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
6314
extension/js/bootstrap.bundle.js
vendored
Normal file
6314
extension/js/bootstrap.bundle.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
extension/js/bootstrap.bundle.js.map
Normal file
1
extension/js/bootstrap.bundle.js.map
Normal file
File diff suppressed because one or more lines are too long
7
extension/js/bootstrap.bundle.min.js
vendored
Normal file
7
extension/js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
extension/js/bootstrap.bundle.min.js.map
Normal file
1
extension/js/bootstrap.bundle.min.js.map
Normal file
File diff suppressed because one or more lines are too long
4447
extension/js/bootstrap.esm.js
vendored
Normal file
4447
extension/js/bootstrap.esm.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
extension/js/bootstrap.esm.js.map
Normal file
1
extension/js/bootstrap.esm.js.map
Normal file
File diff suppressed because one or more lines are too long
7
extension/js/bootstrap.esm.min.js
vendored
Normal file
7
extension/js/bootstrap.esm.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
extension/js/bootstrap.esm.min.js.map
Normal file
1
extension/js/bootstrap.esm.min.js.map
Normal file
File diff suppressed because one or more lines are too long
4494
extension/js/bootstrap.js
vendored
Normal file
4494
extension/js/bootstrap.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
extension/js/bootstrap.js.map
Normal file
1
extension/js/bootstrap.js.map
Normal file
File diff suppressed because one or more lines are too long
7
extension/js/bootstrap.min.js
vendored
Normal file
7
extension/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
extension/js/bootstrap.min.js.map
Normal file
1
extension/js/bootstrap.min.js.map
Normal file
File diff suppressed because one or more lines are too long
2
extension/js/jquery-3.7.1.min.js
vendored
Normal file
2
extension/js/jquery-3.7.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
16
extension/js/node_modules/.package-lock.json
generated
vendored
Normal file
16
extension/js/node_modules/.package-lock.json
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "js",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/@popperjs/core": {
|
||||
"version": "2.11.8",
|
||||
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
|
||||
"integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/popperjs"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
20
extension/js/node_modules/@popperjs/core/LICENSE.md
generated
vendored
Normal file
20
extension/js/node_modules/@popperjs/core/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 Federico Zivolo
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
376
extension/js/node_modules/@popperjs/core/README.md
generated
vendored
Normal file
376
extension/js/node_modules/@popperjs/core/README.md
generated
vendored
Normal file
@ -0,0 +1,376 @@
|
||||
<!-- <HEADER> // IGNORE IT -->
|
||||
<p align="center">
|
||||
<img src="https://rawcdn.githack.com/popperjs/popper-core/8805a5d7599e14619c9e7ac19a3713285d8e5d7f/docs/src/images/popper-logo-outlined.svg" alt="Popper" height="300px"/>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
<h1>Tooltip & Popover Positioning Engine</h1>
|
||||
</div>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/@popperjs/core">
|
||||
<img src="https://img.shields.io/npm/v/@popperjs/core?style=for-the-badge" alt="npm version" />
|
||||
</a>
|
||||
<a href="https://www.npmjs.com/package/@popperjs/core">
|
||||
<img src="https://img.shields.io/endpoint?style=for-the-badge&url=https://runkit.io/fezvrasta/combined-npm-downloads/1.0.0?packages=popper.js,@popperjs/core" alt="npm downloads per month (popper.js + @popperjs/core)" />
|
||||
</a>
|
||||
<a href="https://rollingversions.com/popperjs/popper-core">
|
||||
<img src="https://img.shields.io/badge/Rolling%20Versions-Enabled-brightgreen?style=for-the-badge" alt="Rolling Versions" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<br />
|
||||
<!-- </HEADER> // NOW BEGINS THE README -->
|
||||
|
||||
**Positioning tooltips and popovers is difficult. Popper is here to help!**
|
||||
|
||||
Given an element, such as a button, and a tooltip element describing it, Popper
|
||||
will automatically put the tooltip in the right place near the button.
|
||||
|
||||
It will position _any_ UI element that "pops out" from the flow of your document
|
||||
and floats near a target element. The most common example is a tooltip, but it
|
||||
also includes popovers, drop-downs, and more. All of these can be generically
|
||||
described as a "popper" element.
|
||||
|
||||
## Demo
|
||||
|
||||
[![Popper visualized](https://i.imgur.com/F7qWsmV.jpg)](https://popper.js.org)
|
||||
|
||||
## Docs
|
||||
|
||||
- [v2.x (latest)](https://popper.js.org/docs/v2/)
|
||||
- [v1.x](https://popper.js.org/docs/v1/)
|
||||
|
||||
We've created a
|
||||
[Migration Guide](https://popper.js.org/docs/v2/migration-guide/) to help you
|
||||
migrate from Popper 1 to Popper 2.
|
||||
|
||||
To contribute to the Popper website and documentation, please visit the
|
||||
[dedicated repository](https://github.com/popperjs/website).
|
||||
|
||||
## Why not use pure CSS?
|
||||
|
||||
- **Clipping and overflow issues**: Pure CSS poppers will not be prevented from
|
||||
overflowing clipping boundaries, such as the viewport. It will get partially
|
||||
cut off or overflows if it's near the edge since there is no dynamic
|
||||
positioning logic. When using Popper, your popper will always be positioned in
|
||||
the right place without needing manual adjustments.
|
||||
- **No flipping**: CSS poppers will not flip to a different placement to fit
|
||||
better in view if necessary. While you can manually adjust for the main axis
|
||||
overflow, this feature cannot be achieved via CSS alone. Popper automatically
|
||||
flips the tooltip to make it fit in view as best as possible for the user.
|
||||
- **No virtual positioning**: CSS poppers cannot follow the mouse cursor or be
|
||||
used as a context menu. Popper allows you to position your tooltip relative to
|
||||
any coordinates you desire.
|
||||
- **Slower development cycle**: When pure CSS is used to position popper
|
||||
elements, the lack of dynamic positioning means they must be carefully placed
|
||||
to consider overflow on all screen sizes. In reusable component libraries,
|
||||
this means a developer can't just add the component anywhere on the page,
|
||||
because these issues need to be considered and adjusted for every time. With
|
||||
Popper, you can place your elements anywhere and they will be positioned
|
||||
correctly, without needing to consider different screen sizes, layouts, etc.
|
||||
This massively speeds up development time because this work is automatically
|
||||
offloaded to Popper.
|
||||
- **Lack of extensibility**: CSS poppers cannot be easily extended to fit any
|
||||
arbitrary use case you may need to adjust for. Popper is built with
|
||||
extensibility in mind.
|
||||
|
||||
## Why Popper?
|
||||
|
||||
With the CSS drawbacks out of the way, we now move on to Popper in the
|
||||
JavaScript space itself.
|
||||
|
||||
Naive JavaScript tooltip implementations usually have the following problems:
|
||||
|
||||
- **Scrolling containers**: They don't ensure the tooltip stays with the
|
||||
reference element while scrolling when inside any number of scrolling
|
||||
containers.
|
||||
- **DOM context**: They often require the tooltip move outside of its original
|
||||
DOM context because they don't handle `offsetParent` contexts.
|
||||
- **Compatibility**: Popper handles an incredible number of edge cases regarding
|
||||
different browsers and environments (mobile viewports, RTL, scrollbars enabled
|
||||
or disabled, etc.). Popper is a popular and well-maintained library, so you
|
||||
can be confident positioning will work for your users on any device.
|
||||
- **Configurability**: They often lack advanced configurability to suit any
|
||||
possible use case.
|
||||
- **Size**: They are usually relatively large in size, or require an ancient
|
||||
jQuery dependency.
|
||||
- **Performance**: They often have runtime performance issues and update the
|
||||
tooltip position too slowly.
|
||||
|
||||
**Popper solves all of these key problems in an elegant, performant manner.** It
|
||||
is a lightweight ~3 kB library that aims to provide a reliable and extensible
|
||||
positioning engine you can use to ensure all your popper elements are positioned
|
||||
in the right place.
|
||||
|
||||
When you start writing your own popper implementation, you'll quickly run into
|
||||
all of the problems mentioned above. These widgets are incredibly common in our
|
||||
UIs; we've done the hard work figuring this out so you don't need to spend hours
|
||||
fixing and handling numerous edge cases that we already ran into while building
|
||||
the library!
|
||||
|
||||
Popper is used in popular libraries like Bootstrap, Foundation, Material UI, and
|
||||
more. It's likely you've already used popper elements on the web positioned by
|
||||
Popper at some point in the past few years.
|
||||
|
||||
Since we write UIs using powerful abstraction libraries such as React or Angular
|
||||
nowadays, you'll also be glad to know Popper can fully integrate with them and
|
||||
be a good citizen together with your other components. Check out `react-popper`
|
||||
for the official Popper wrapper for React.
|
||||
|
||||
## Installation
|
||||
|
||||
### 1. Package Manager
|
||||
|
||||
```bash
|
||||
# With npm
|
||||
npm i @popperjs/core
|
||||
|
||||
# With Yarn
|
||||
yarn add @popperjs/core
|
||||
```
|
||||
|
||||
### 2. CDN
|
||||
|
||||
```html
|
||||
<!-- Development version -->
|
||||
<script src="https://unpkg.com/@popperjs/core@2/dist/umd/popper.js"></script>
|
||||
|
||||
<!-- Production version -->
|
||||
<script src="https://unpkg.com/@popperjs/core@2"></script>
|
||||
```
|
||||
|
||||
### 3. Direct Download?
|
||||
|
||||
Managing dependencies by "directly downloading" them and placing them into your
|
||||
source code is not recommended for a variety of reasons, including missing out
|
||||
on feat/fix updates easily. Please use a versioning management system like a CDN
|
||||
or npm/Yarn.
|
||||
|
||||
## Usage
|
||||
|
||||
The most straightforward way to get started is to import Popper from the `unpkg`
|
||||
CDN, which includes all of its features. You can call the `Popper.createPopper`
|
||||
constructor to create new popper instances.
|
||||
|
||||
Here is a complete example:
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<title>Popper example</title>
|
||||
|
||||
<style>
|
||||
#tooltip {
|
||||
background-color: #333;
|
||||
color: white;
|
||||
padding: 5px 10px;
|
||||
border-radius: 4px;
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<button id="button" aria-describedby="tooltip">I'm a button</button>
|
||||
<div id="tooltip" role="tooltip">I'm a tooltip</div>
|
||||
|
||||
<script src="https://unpkg.com/@popperjs/core@^2.0.0"></script>
|
||||
<script>
|
||||
const button = document.querySelector('#button');
|
||||
const tooltip = document.querySelector('#tooltip');
|
||||
|
||||
// Pass the button, the tooltip, and some options, and Popper will do the
|
||||
// magic positioning for you:
|
||||
Popper.createPopper(button, tooltip, {
|
||||
placement: 'right',
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
Visit the [tutorial](https://popper.js.org/docs/v2/tutorial/) for an example of
|
||||
how to build your own tooltip from scratch using Popper.
|
||||
|
||||
### Module bundlers
|
||||
|
||||
You can import the `createPopper` constructor from the fully-featured file:
|
||||
|
||||
```js
|
||||
import { createPopper } from '@popperjs/core';
|
||||
|
||||
const button = document.querySelector('#button');
|
||||
const tooltip = document.querySelector('#tooltip');
|
||||
|
||||
// Pass the button, the tooltip, and some options, and Popper will do the
|
||||
// magic positioning for you:
|
||||
createPopper(button, tooltip, {
|
||||
placement: 'right',
|
||||
});
|
||||
```
|
||||
|
||||
All the modifiers listed in the docs menu will be enabled and "just work", so
|
||||
you don't need to think about setting Popper up. The size of Popper including
|
||||
all of its features is about 5 kB minzipped, but it may grow a bit in the
|
||||
future.
|
||||
|
||||
#### Popper Lite (tree-shaking)
|
||||
|
||||
If bundle size is important, you'll want to take advantage of tree-shaking. The
|
||||
library is built in a modular way to allow to import only the parts you really
|
||||
need.
|
||||
|
||||
```js
|
||||
import { createPopperLite as createPopper } from '@popperjs/core';
|
||||
```
|
||||
|
||||
The Lite version includes the most necessary modifiers that will compute the
|
||||
offsets of the popper, compute and add the positioning styles, and add event
|
||||
listeners. This is close in bundle size to pure CSS tooltip libraries, and
|
||||
behaves somewhat similarly.
|
||||
|
||||
However, this does not include the features that makes Popper truly useful.
|
||||
|
||||
The two most useful modifiers not included in Lite are `preventOverflow` and
|
||||
`flip`:
|
||||
|
||||
```js
|
||||
import {
|
||||
createPopperLite as createPopper,
|
||||
preventOverflow,
|
||||
flip,
|
||||
} from '@popperjs/core';
|
||||
|
||||
const button = document.querySelector('#button');
|
||||
const tooltip = document.querySelector('#tooltip');
|
||||
|
||||
createPopper(button, tooltip, {
|
||||
modifiers: [preventOverflow, flip],
|
||||
});
|
||||
```
|
||||
|
||||
As you make more poppers, you may be finding yourself needing other modifiers
|
||||
provided by the library.
|
||||
|
||||
See [tree-shaking](https://popper.js.org/docs/v2/performance/#tree-shaking) for more
|
||||
information.
|
||||
|
||||
## Distribution targets
|
||||
|
||||
Popper is distributed in 3 different versions, in 3 different file formats.
|
||||
|
||||
The 3 file formats are:
|
||||
|
||||
- `esm` (works with `import` syntax — **recommended**)
|
||||
- `umd` (works with `<script>` tags or RequireJS)
|
||||
- `cjs` (works with `require()` syntax)
|
||||
|
||||
There are two different `esm` builds, one for bundler consumers (e.g. webpack,
|
||||
Rollup, etc..), which is located under `/lib`, and one for browsers with native
|
||||
support for ES Modules, under `/dist/esm`. The only difference within the two,
|
||||
is that the browser-compatible version doesn't make use of
|
||||
`process.env.NODE_ENV` to run development checks.
|
||||
|
||||
The 3 versions are:
|
||||
|
||||
- `popper`: includes all the modifiers (features) in one file (**default**);
|
||||
- `popper-lite`: includes only the minimum amount of modifiers to provide the
|
||||
basic functionality;
|
||||
- `popper-base`: doesn't include any modifier, you must import them separately;
|
||||
|
||||
Below you can find the size of each version, minified and compressed with the
|
||||
[Brotli compression algorithm](https://medium.com/groww-engineering/enable-brotli-compression-in-webpack-with-fallback-to-gzip-397a57cf9fc6):
|
||||
|
||||
<!-- Don't change the labels to use hyphens, it breaks, even when encoded -->
|
||||
|
||||
![](https://badge-size.now.sh/https://unpkg.com/@popperjs/core/dist/umd/popper.min.js?compression=brotli&label=popper)
|
||||
![](https://badge-size.now.sh/https://unpkg.com/@popperjs/core/dist/umd/popper-lite.min.js?compression=brotli&label=popper%20lite)
|
||||
![](https://badge-size.now.sh/https://unpkg.com/@popperjs/core/dist/umd/popper-base.min.js?compression=brotli&label=popper%20base)
|
||||
|
||||
## Hacking the library
|
||||
|
||||
If you want to play with the library, implement new features, fix a bug you
|
||||
found, or simply experiment with it, this section is for you!
|
||||
|
||||
First of all, make sure to have
|
||||
[Yarn installed](https://yarnpkg.com/lang/en/docs/install).
|
||||
|
||||
Install the development dependencies:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
And run the development environment:
|
||||
|
||||
```bash
|
||||
yarn dev
|
||||
```
|
||||
|
||||
Then, simply open one the development server web page:
|
||||
|
||||
```bash
|
||||
# macOS and Linux
|
||||
open localhost:5000
|
||||
|
||||
# Windows
|
||||
start localhost:5000
|
||||
```
|
||||
|
||||
From there, you can open any of the examples (`.html` files) to fiddle with
|
||||
them.
|
||||
|
||||
Now any change you will made to the source code, will be automatically compiled,
|
||||
you just need to refresh the page.
|
||||
|
||||
If the page is not working properly, try to go in _"Developer Tools >
|
||||
Application > Clear storage"_ and click on "_Clear site data_".
|
||||
To run the examples you need a browser with
|
||||
[JavaScript modules via script tag support](https://caniuse.com/#feat=es6-module).
|
||||
|
||||
## Test Suite
|
||||
|
||||
Popper is currently tested with unit tests, and functional tests. Both of them
|
||||
are run by Jest.
|
||||
|
||||
### Unit Tests
|
||||
|
||||
The unit tests use JSDOM to provide a primitive document object API, they are
|
||||
used to ensure the utility functions behave as expected in isolation.
|
||||
|
||||
### Functional Tests
|
||||
|
||||
The functional tests run with Puppeteer, to take advantage of a complete browser
|
||||
environment. They are currently running on Chromium, and Firefox.
|
||||
|
||||
You can run them with `yarn test:functional`. Set the `PUPPETEER_BROWSER`
|
||||
environment variable to `firefox` to run them on the Mozilla browser.
|
||||
|
||||
The assertions are written in form of image snapshots, so that it's easy to
|
||||
assert for the correct Popper behavior without having to write a lot of offsets
|
||||
comparisons manually.
|
||||
|
||||
You can mark a `*.test.js` file to run in the Puppeteer environment by
|
||||
prepending a `@jest-environment puppeteer` JSDoc comment to the interested file.
|
||||
|
||||
Here's an example of a basic functional test:
|
||||
|
||||
```js
|
||||
/**
|
||||
* @jest-environment puppeteer
|
||||
* @flow
|
||||
*/
|
||||
import { screenshot } from '../utils/puppeteer.js';
|
||||
|
||||
it('should position the popper on the right', async () => {
|
||||
const page = await browser.newPage();
|
||||
await page.goto(`${TEST_URL}/basic.html`);
|
||||
|
||||
expect(await screenshot(page)).toMatchImageSnapshot();
|
||||
});
|
||||
```
|
||||
|
||||
You can find the complete
|
||||
[`jest-puppeteer` documentation here](https://github.com/smooth-code/jest-puppeteer#api),
|
||||
and the
|
||||
[`jest-image-snapshot` documentation here](https://github.com/americanexpress/jest-image-snapshot#%EF%B8%8F-api).
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
65
extension/js/node_modules/@popperjs/core/dist/cjs/enums.js
generated
vendored
Normal file
65
extension/js/node_modules/@popperjs/core/dist/cjs/enums.js
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
/**
|
||||
* @popperjs/core v2.11.8 - MIT License
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var top = 'top';
|
||||
var bottom = 'bottom';
|
||||
var right = 'right';
|
||||
var left = 'left';
|
||||
var auto = 'auto';
|
||||
var basePlacements = [top, bottom, right, left];
|
||||
var start = 'start';
|
||||
var end = 'end';
|
||||
var clippingParents = 'clippingParents';
|
||||
var viewport = 'viewport';
|
||||
var popper = 'popper';
|
||||
var reference = 'reference';
|
||||
var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
|
||||
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
||||
}, []);
|
||||
var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
|
||||
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
||||
}, []); // modifiers that need to read the DOM
|
||||
|
||||
var beforeRead = 'beforeRead';
|
||||
var read = 'read';
|
||||
var afterRead = 'afterRead'; // pure-logic modifiers
|
||||
|
||||
var beforeMain = 'beforeMain';
|
||||
var main = 'main';
|
||||
var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
|
||||
|
||||
var beforeWrite = 'beforeWrite';
|
||||
var write = 'write';
|
||||
var afterWrite = 'afterWrite';
|
||||
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
||||
|
||||
exports.afterMain = afterMain;
|
||||
exports.afterRead = afterRead;
|
||||
exports.afterWrite = afterWrite;
|
||||
exports.auto = auto;
|
||||
exports.basePlacements = basePlacements;
|
||||
exports.beforeMain = beforeMain;
|
||||
exports.beforeRead = beforeRead;
|
||||
exports.beforeWrite = beforeWrite;
|
||||
exports.bottom = bottom;
|
||||
exports.clippingParents = clippingParents;
|
||||
exports.end = end;
|
||||
exports.left = left;
|
||||
exports.main = main;
|
||||
exports.modifierPhases = modifierPhases;
|
||||
exports.placements = placements;
|
||||
exports.popper = popper;
|
||||
exports.read = read;
|
||||
exports.reference = reference;
|
||||
exports.right = right;
|
||||
exports.start = start;
|
||||
exports.top = top;
|
||||
exports.variationPlacements = variationPlacements;
|
||||
exports.viewport = viewport;
|
||||
exports.write = write;
|
||||
//# sourceMappingURL=enums.js.map
|
3
extension/js/node_modules/@popperjs/core/dist/cjs/enums.js.flow
generated
vendored
Normal file
3
extension/js/node_modules/@popperjs/core/dist/cjs/enums.js.flow
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// @flow
|
||||
|
||||
export * from '../../lib/enums.js'
|
1
extension/js/node_modules/@popperjs/core/dist/cjs/enums.js.map
generated
vendored
Normal file
1
extension/js/node_modules/@popperjs/core/dist/cjs/enums.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"enums.js","sources":["../../src/enums.js"],"sourcesContent":["// @flow\nexport const top: 'top' = 'top';\nexport const bottom: 'bottom' = 'bottom';\nexport const right: 'right' = 'right';\nexport const left: 'left' = 'left';\nexport const auto: 'auto' = 'auto';\nexport type BasePlacement =\n | typeof top\n | typeof bottom\n | typeof right\n | typeof left;\nexport const basePlacements: Array<BasePlacement> = [top, bottom, right, left];\n\nexport const start: 'start' = 'start';\nexport const end: 'end' = 'end';\nexport type Variation = typeof start | typeof end;\n\nexport const clippingParents: 'clippingParents' = 'clippingParents';\nexport const viewport: 'viewport' = 'viewport';\nexport type Boundary = Element | Array<Element> | typeof clippingParents;\nexport type RootBoundary = typeof viewport | 'document';\n\nexport const popper: 'popper' = 'popper';\nexport const reference: 'reference' = 'reference';\nexport type Context = typeof popper | typeof reference;\n\nexport type VariationPlacement =\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end';\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\nexport type ComputedPlacement = VariationPlacement | BasePlacement;\nexport type Placement = AutoPlacement | BasePlacement | VariationPlacement;\n\nexport const variationPlacements: Array<VariationPlacement> = basePlacements.reduce(\n (acc: Array<VariationPlacement>, placement: BasePlacement) =>\n acc.concat([(`${placement}-${start}`: any), (`${placement}-${end}`: any)]),\n []\n);\nexport const placements: Array<Placement> = [...basePlacements, auto].reduce(\n (\n acc: Array<Placement>,\n placement: BasePlacement | typeof auto\n ): Array<Placement> =>\n acc.concat([\n placement,\n (`${placement}-${start}`: any),\n (`${placement}-${end}`: any),\n ]),\n []\n);\n\n// modifiers that need to read the DOM\nexport const beforeRead: 'beforeRead' = 'beforeRead';\nexport const read: 'read' = 'read';\nexport const afterRead: 'afterRead' = 'afterRead';\n// pure-logic modifiers\nexport const beforeMain: 'beforeMain' = 'beforeMain';\nexport const main: 'main' = 'main';\nexport const afterMain: 'afterMain' = 'afterMain';\n// modifier with the purpose to write to the DOM (or write into a framework state)\nexport const beforeWrite: 'beforeWrite' = 'beforeWrite';\nexport const write: 'write' = 'write';\nexport const afterWrite: 'afterWrite' = 'afterWrite';\nexport const modifierPhases: Array<ModifierPhases> = [\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite,\n];\n\nexport type ModifierPhases =\n | typeof beforeRead\n | typeof read\n | typeof afterRead\n | typeof beforeMain\n | typeof main\n | typeof afterMain\n | typeof beforeWrite\n | typeof write\n | typeof afterWrite;\n"],"names":["top","bottom","right","left","auto","basePlacements","start","end","clippingParents","viewport","popper","reference","variationPlacements","reduce","acc","placement","concat","placements","beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite","modifierPhases"],"mappings":";;;;;;;;IACaA,GAAU,GAAG;IACbC,MAAgB,GAAG;IACnBC,KAAc,GAAG;IACjBC,IAAY,GAAG;IACfC,IAAY,GAAG;IAMfC,cAAoC,GAAG,CAACL,GAAD,EAAMC,MAAN,EAAcC,KAAd,EAAqBC,IAArB;IAEvCG,KAAc,GAAG;IACjBC,GAAU,GAAG;IAGbC,eAAkC,GAAG;IACrCC,QAAoB,GAAG;IAIvBC,MAAgB,GAAG;IACnBC,SAAsB,GAAG;IAgBzBC,mBAA8C,gBAAGP,cAAc,CAACQ,MAAf,CAC5D,UAACC,GAAD,EAAiCC,SAAjC;AAAA,SACED,GAAG,CAACE,MAAJ,CAAW,CAAKD,SAAL,SAAkBT,KAAlB,EAAqCS,SAArC,SAAkDR,GAAlD,CAAX,CADF;AAAA,CAD4D,EAG5D,EAH4D;IAKjDU,UAA4B,gBAAG,UAAIZ,cAAJ,GAAoBD,IAApB,GAA0BS,MAA1B,CAC1C,UACEC,GADF,EAEEC,SAFF;AAAA,SAIED,GAAG,CAACE,MAAJ,CAAW,CACTD,SADS,EAELA,SAFK,SAEQT,KAFR,EAGLS,SAHK,SAGQR,GAHR,CAAX,CAJF;AAAA,CAD0C,EAU1C,EAV0C;;IAc/BW,UAAwB,GAAG;IAC3BC,IAAY,GAAG;IACfC,SAAsB,GAAG;;IAEzBC,UAAwB,GAAG;IAC3BC,IAAY,GAAG;IACfC,SAAsB,GAAG;;IAEzBC,WAA0B,GAAG;IAC7BC,KAAc,GAAG;IACjBC,UAAwB,GAAG;IAC3BC,cAAqC,GAAG,CACnDT,UADmD,EAEnDC,IAFmD,EAGnDC,SAHmD,EAInDC,UAJmD,EAKnDC,IALmD,EAMnDC,SANmD,EAOnDC,WAPmD,EAQnDC,KARmD,EASnDC,UATmD;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
939
extension/js/node_modules/@popperjs/core/dist/cjs/popper-base.js
generated
vendored
Normal file
939
extension/js/node_modules/@popperjs/core/dist/cjs/popper-base.js
generated
vendored
Normal file
@ -0,0 +1,939 @@
|
||||
/**
|
||||
* @popperjs/core v2.11.8 - MIT License
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function getWindow(node) {
|
||||
if (node == null) {
|
||||
return window;
|
||||
}
|
||||
|
||||
if (node.toString() !== '[object Window]') {
|
||||
var ownerDocument = node.ownerDocument;
|
||||
return ownerDocument ? ownerDocument.defaultView || window : window;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
function isElement(node) {
|
||||
var OwnElement = getWindow(node).Element;
|
||||
return node instanceof OwnElement || node instanceof Element;
|
||||
}
|
||||
|
||||
function isHTMLElement(node) {
|
||||
var OwnElement = getWindow(node).HTMLElement;
|
||||
return node instanceof OwnElement || node instanceof HTMLElement;
|
||||
}
|
||||
|
||||
function isShadowRoot(node) {
|
||||
// IE 11 has no ShadowRoot
|
||||
if (typeof ShadowRoot === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
var OwnElement = getWindow(node).ShadowRoot;
|
||||
return node instanceof OwnElement || node instanceof ShadowRoot;
|
||||
}
|
||||
|
||||
var max = Math.max;
|
||||
var min = Math.min;
|
||||
var round = Math.round;
|
||||
|
||||
function getUAString() {
|
||||
var uaData = navigator.userAgentData;
|
||||
|
||||
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
|
||||
return uaData.brands.map(function (item) {
|
||||
return item.brand + "/" + item.version;
|
||||
}).join(' ');
|
||||
}
|
||||
|
||||
return navigator.userAgent;
|
||||
}
|
||||
|
||||
function isLayoutViewport() {
|
||||
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
||||
}
|
||||
|
||||
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
||||
if (includeScale === void 0) {
|
||||
includeScale = false;
|
||||
}
|
||||
|
||||
if (isFixedStrategy === void 0) {
|
||||
isFixedStrategy = false;
|
||||
}
|
||||
|
||||
var clientRect = element.getBoundingClientRect();
|
||||
var scaleX = 1;
|
||||
var scaleY = 1;
|
||||
|
||||
if (includeScale && isHTMLElement(element)) {
|
||||
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
||||
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
||||
}
|
||||
|
||||
var _ref = isElement(element) ? getWindow(element) : window,
|
||||
visualViewport = _ref.visualViewport;
|
||||
|
||||
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
||||
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
||||
var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
||||
var width = clientRect.width / scaleX;
|
||||
var height = clientRect.height / scaleY;
|
||||
return {
|
||||
width: width,
|
||||
height: height,
|
||||
top: y,
|
||||
right: x + width,
|
||||
bottom: y + height,
|
||||
left: x,
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
}
|
||||
|
||||
function getWindowScroll(node) {
|
||||
var win = getWindow(node);
|
||||
var scrollLeft = win.pageXOffset;
|
||||
var scrollTop = win.pageYOffset;
|
||||
return {
|
||||
scrollLeft: scrollLeft,
|
||||
scrollTop: scrollTop
|
||||
};
|
||||
}
|
||||
|
||||
function getHTMLElementScroll(element) {
|
||||
return {
|
||||
scrollLeft: element.scrollLeft,
|
||||
scrollTop: element.scrollTop
|
||||
};
|
||||
}
|
||||
|
||||
function getNodeScroll(node) {
|
||||
if (node === getWindow(node) || !isHTMLElement(node)) {
|
||||
return getWindowScroll(node);
|
||||
} else {
|
||||
return getHTMLElementScroll(node);
|
||||
}
|
||||
}
|
||||
|
||||
function getNodeName(element) {
|
||||
return element ? (element.nodeName || '').toLowerCase() : null;
|
||||
}
|
||||
|
||||
function getDocumentElement(element) {
|
||||
// $FlowFixMe[incompatible-return]: assume body is always available
|
||||
return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
||||
element.document) || window.document).documentElement;
|
||||
}
|
||||
|
||||
function getWindowScrollBarX(element) {
|
||||
// If <html> has a CSS width greater than the viewport, then this will be
|
||||
// incorrect for RTL.
|
||||
// Popper 1 is broken in this case and never had a bug report so let's assume
|
||||
// it's not an issue. I don't think anyone ever specifies width on <html>
|
||||
// anyway.
|
||||
// Browsers where the left scrollbar doesn't cause an issue report `0` for
|
||||
// this (e.g. Edge 2019, IE11, Safari)
|
||||
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
||||
}
|
||||
|
||||
function getComputedStyle(element) {
|
||||
return getWindow(element).getComputedStyle(element);
|
||||
}
|
||||
|
||||
function isScrollParent(element) {
|
||||
// Firefox wants us to check `-x` and `-y` variations as well
|
||||
var _getComputedStyle = getComputedStyle(element),
|
||||
overflow = _getComputedStyle.overflow,
|
||||
overflowX = _getComputedStyle.overflowX,
|
||||
overflowY = _getComputedStyle.overflowY;
|
||||
|
||||
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
||||
}
|
||||
|
||||
function isElementScaled(element) {
|
||||
var rect = element.getBoundingClientRect();
|
||||
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
||||
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
||||
return scaleX !== 1 || scaleY !== 1;
|
||||
} // Returns the composite rect of an element relative to its offsetParent.
|
||||
// Composite means it takes into account transforms as well as layout.
|
||||
|
||||
|
||||
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
||||
if (isFixed === void 0) {
|
||||
isFixed = false;
|
||||
}
|
||||
|
||||
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
||||
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
||||
var documentElement = getDocumentElement(offsetParent);
|
||||
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
||||
var scroll = {
|
||||
scrollLeft: 0,
|
||||
scrollTop: 0
|
||||
};
|
||||
var offsets = {
|
||||
x: 0,
|
||||
y: 0
|
||||
};
|
||||
|
||||
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
||||
if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
|
||||
isScrollParent(documentElement)) {
|
||||
scroll = getNodeScroll(offsetParent);
|
||||
}
|
||||
|
||||
if (isHTMLElement(offsetParent)) {
|
||||
offsets = getBoundingClientRect(offsetParent, true);
|
||||
offsets.x += offsetParent.clientLeft;
|
||||
offsets.y += offsetParent.clientTop;
|
||||
} else if (documentElement) {
|
||||
offsets.x = getWindowScrollBarX(documentElement);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
x: rect.left + scroll.scrollLeft - offsets.x,
|
||||
y: rect.top + scroll.scrollTop - offsets.y,
|
||||
width: rect.width,
|
||||
height: rect.height
|
||||
};
|
||||
}
|
||||
|
||||
// means it doesn't take into account transforms.
|
||||
|
||||
function getLayoutRect(element) {
|
||||
var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
|
||||
// Fixes https://github.com/popperjs/popper-core/issues/1223
|
||||
|
||||
var width = element.offsetWidth;
|
||||
var height = element.offsetHeight;
|
||||
|
||||
if (Math.abs(clientRect.width - width) <= 1) {
|
||||
width = clientRect.width;
|
||||
}
|
||||
|
||||
if (Math.abs(clientRect.height - height) <= 1) {
|
||||
height = clientRect.height;
|
||||
}
|
||||
|
||||
return {
|
||||
x: element.offsetLeft,
|
||||
y: element.offsetTop,
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
}
|
||||
|
||||
function getParentNode(element) {
|
||||
if (getNodeName(element) === 'html') {
|
||||
return element;
|
||||
}
|
||||
|
||||
return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
||||
// $FlowFixMe[incompatible-return]
|
||||
// $FlowFixMe[prop-missing]
|
||||
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
||||
element.parentNode || ( // DOM Element detected
|
||||
isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
||||
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
||||
getDocumentElement(element) // fallback
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
function getScrollParent(node) {
|
||||
if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
|
||||
// $FlowFixMe[incompatible-return]: assume body is always available
|
||||
return node.ownerDocument.body;
|
||||
}
|
||||
|
||||
if (isHTMLElement(node) && isScrollParent(node)) {
|
||||
return node;
|
||||
}
|
||||
|
||||
return getScrollParent(getParentNode(node));
|
||||
}
|
||||
|
||||
/*
|
||||
given a DOM element, return the list of all scroll parents, up the list of ancesors
|
||||
until we get to the top window object. This list is what we attach scroll listeners
|
||||
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
||||
reference element's position.
|
||||
*/
|
||||
|
||||
function listScrollParents(element, list) {
|
||||
var _element$ownerDocumen;
|
||||
|
||||
if (list === void 0) {
|
||||
list = [];
|
||||
}
|
||||
|
||||
var scrollParent = getScrollParent(element);
|
||||
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
||||
var win = getWindow(scrollParent);
|
||||
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
||||
var updatedList = list.concat(target);
|
||||
return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
||||
updatedList.concat(listScrollParents(getParentNode(target)));
|
||||
}
|
||||
|
||||
function isTableElement(element) {
|
||||
return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
|
||||
}
|
||||
|
||||
function getTrueOffsetParent(element) {
|
||||
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
||||
getComputedStyle(element).position === 'fixed') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return element.offsetParent;
|
||||
} // `.offsetParent` reports `null` for fixed elements, while absolute elements
|
||||
// return the containing block
|
||||
|
||||
|
||||
function getContainingBlock(element) {
|
||||
var isFirefox = /firefox/i.test(getUAString());
|
||||
var isIE = /Trident/i.test(getUAString());
|
||||
|
||||
if (isIE && isHTMLElement(element)) {
|
||||
// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
|
||||
var elementCss = getComputedStyle(element);
|
||||
|
||||
if (elementCss.position === 'fixed') {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
var currentNode = getParentNode(element);
|
||||
|
||||
if (isShadowRoot(currentNode)) {
|
||||
currentNode = currentNode.host;
|
||||
}
|
||||
|
||||
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
||||
var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
||||
// create a containing block.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
||||
|
||||
if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
|
||||
return currentNode;
|
||||
} else {
|
||||
currentNode = currentNode.parentNode;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
} // Gets the closest ancestor positioned element. Handles some edge cases,
|
||||
// such as table ancestors and cross browser bugs.
|
||||
|
||||
|
||||
function getOffsetParent(element) {
|
||||
var window = getWindow(element);
|
||||
var offsetParent = getTrueOffsetParent(element);
|
||||
|
||||
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
||||
offsetParent = getTrueOffsetParent(offsetParent);
|
||||
}
|
||||
|
||||
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
|
||||
return window;
|
||||
}
|
||||
|
||||
return offsetParent || getContainingBlock(element) || window;
|
||||
}
|
||||
|
||||
var top = 'top';
|
||||
var bottom = 'bottom';
|
||||
var right = 'right';
|
||||
var left = 'left';
|
||||
var basePlacements = [top, bottom, right, left];
|
||||
var start = 'start';
|
||||
var end = 'end';
|
||||
var clippingParents = 'clippingParents';
|
||||
var viewport = 'viewport';
|
||||
var popper = 'popper';
|
||||
var reference = 'reference';
|
||||
|
||||
var beforeRead = 'beforeRead';
|
||||
var read = 'read';
|
||||
var afterRead = 'afterRead'; // pure-logic modifiers
|
||||
|
||||
var beforeMain = 'beforeMain';
|
||||
var main = 'main';
|
||||
var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
|
||||
|
||||
var beforeWrite = 'beforeWrite';
|
||||
var write = 'write';
|
||||
var afterWrite = 'afterWrite';
|
||||
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
||||
|
||||
function order(modifiers) {
|
||||
var map = new Map();
|
||||
var visited = new Set();
|
||||
var result = [];
|
||||
modifiers.forEach(function (modifier) {
|
||||
map.set(modifier.name, modifier);
|
||||
}); // On visiting object, check for its dependencies and visit them recursively
|
||||
|
||||
function sort(modifier) {
|
||||
visited.add(modifier.name);
|
||||
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
||||
requires.forEach(function (dep) {
|
||||
if (!visited.has(dep)) {
|
||||
var depModifier = map.get(dep);
|
||||
|
||||
if (depModifier) {
|
||||
sort(depModifier);
|
||||
}
|
||||
}
|
||||
});
|
||||
result.push(modifier);
|
||||
}
|
||||
|
||||
modifiers.forEach(function (modifier) {
|
||||
if (!visited.has(modifier.name)) {
|
||||
// check for visited object
|
||||
sort(modifier);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function orderModifiers(modifiers) {
|
||||
// order based on dependencies
|
||||
var orderedModifiers = order(modifiers); // order based on phase
|
||||
|
||||
return modifierPhases.reduce(function (acc, phase) {
|
||||
return acc.concat(orderedModifiers.filter(function (modifier) {
|
||||
return modifier.phase === phase;
|
||||
}));
|
||||
}, []);
|
||||
}
|
||||
|
||||
function debounce(fn) {
|
||||
var pending;
|
||||
return function () {
|
||||
if (!pending) {
|
||||
pending = new Promise(function (resolve) {
|
||||
Promise.resolve().then(function () {
|
||||
pending = undefined;
|
||||
resolve(fn());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return pending;
|
||||
};
|
||||
}
|
||||
|
||||
function mergeByName(modifiers) {
|
||||
var merged = modifiers.reduce(function (merged, current) {
|
||||
var existing = merged[current.name];
|
||||
merged[current.name] = existing ? Object.assign({}, existing, current, {
|
||||
options: Object.assign({}, existing.options, current.options),
|
||||
data: Object.assign({}, existing.data, current.data)
|
||||
}) : current;
|
||||
return merged;
|
||||
}, {}); // IE11 does not support Object.values
|
||||
|
||||
return Object.keys(merged).map(function (key) {
|
||||
return merged[key];
|
||||
});
|
||||
}
|
||||
|
||||
function getViewportRect(element, strategy) {
|
||||
var win = getWindow(element);
|
||||
var html = getDocumentElement(element);
|
||||
var visualViewport = win.visualViewport;
|
||||
var width = html.clientWidth;
|
||||
var height = html.clientHeight;
|
||||
var x = 0;
|
||||
var y = 0;
|
||||
|
||||
if (visualViewport) {
|
||||
width = visualViewport.width;
|
||||
height = visualViewport.height;
|
||||
var layoutViewport = isLayoutViewport();
|
||||
|
||||
if (layoutViewport || !layoutViewport && strategy === 'fixed') {
|
||||
x = visualViewport.offsetLeft;
|
||||
y = visualViewport.offsetTop;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
width: width,
|
||||
height: height,
|
||||
x: x + getWindowScrollBarX(element),
|
||||
y: y
|
||||
};
|
||||
}
|
||||
|
||||
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
||||
|
||||
function getDocumentRect(element) {
|
||||
var _element$ownerDocumen;
|
||||
|
||||
var html = getDocumentElement(element);
|
||||
var winScroll = getWindowScroll(element);
|
||||
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
||||
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
||||
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
||||
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
||||
var y = -winScroll.scrollTop;
|
||||
|
||||
if (getComputedStyle(body || html).direction === 'rtl') {
|
||||
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
||||
}
|
||||
|
||||
return {
|
||||
width: width,
|
||||
height: height,
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
}
|
||||
|
||||
function contains(parent, child) {
|
||||
var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
|
||||
|
||||
if (parent.contains(child)) {
|
||||
return true;
|
||||
} // then fallback to custom implementation with Shadow DOM support
|
||||
else if (rootNode && isShadowRoot(rootNode)) {
|
||||
var next = child;
|
||||
|
||||
do {
|
||||
if (next && parent.isSameNode(next)) {
|
||||
return true;
|
||||
} // $FlowFixMe[prop-missing]: need a better way to handle this...
|
||||
|
||||
|
||||
next = next.parentNode || next.host;
|
||||
} while (next);
|
||||
} // Give up, the result is false
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function rectToClientRect(rect) {
|
||||
return Object.assign({}, rect, {
|
||||
left: rect.x,
|
||||
top: rect.y,
|
||||
right: rect.x + rect.width,
|
||||
bottom: rect.y + rect.height
|
||||
});
|
||||
}
|
||||
|
||||
function getInnerBoundingClientRect(element, strategy) {
|
||||
var rect = getBoundingClientRect(element, false, strategy === 'fixed');
|
||||
rect.top = rect.top + element.clientTop;
|
||||
rect.left = rect.left + element.clientLeft;
|
||||
rect.bottom = rect.top + element.clientHeight;
|
||||
rect.right = rect.left + element.clientWidth;
|
||||
rect.width = element.clientWidth;
|
||||
rect.height = element.clientHeight;
|
||||
rect.x = rect.left;
|
||||
rect.y = rect.top;
|
||||
return rect;
|
||||
}
|
||||
|
||||
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
||||
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
||||
} // A "clipping parent" is an overflowable container with the characteristic of
|
||||
// clipping (or hiding) overflowing elements with a position different from
|
||||
// `initial`
|
||||
|
||||
|
||||
function getClippingParents(element) {
|
||||
var clippingParents = listScrollParents(getParentNode(element));
|
||||
var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
|
||||
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
||||
|
||||
if (!isElement(clipperElement)) {
|
||||
return [];
|
||||
} // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
|
||||
|
||||
|
||||
return clippingParents.filter(function (clippingParent) {
|
||||
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
||||
});
|
||||
} // Gets the maximum area that the element is visible in due to any number of
|
||||
// clipping parents
|
||||
|
||||
|
||||
function getClippingRect(element, boundary, rootBoundary, strategy) {
|
||||
var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
|
||||
var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
|
||||
var firstClippingParent = clippingParents[0];
|
||||
var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
|
||||
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
||||
accRect.top = max(rect.top, accRect.top);
|
||||
accRect.right = min(rect.right, accRect.right);
|
||||
accRect.bottom = min(rect.bottom, accRect.bottom);
|
||||
accRect.left = max(rect.left, accRect.left);
|
||||
return accRect;
|
||||
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
||||
clippingRect.width = clippingRect.right - clippingRect.left;
|
||||
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
||||
clippingRect.x = clippingRect.left;
|
||||
clippingRect.y = clippingRect.top;
|
||||
return clippingRect;
|
||||
}
|
||||
|
||||
function getBasePlacement(placement) {
|
||||
return placement.split('-')[0];
|
||||
}
|
||||
|
||||
function getVariation(placement) {
|
||||
return placement.split('-')[1];
|
||||
}
|
||||
|
||||
function getMainAxisFromPlacement(placement) {
|
||||
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
||||
}
|
||||
|
||||
function computeOffsets(_ref) {
|
||||
var reference = _ref.reference,
|
||||
element = _ref.element,
|
||||
placement = _ref.placement;
|
||||
var basePlacement = placement ? getBasePlacement(placement) : null;
|
||||
var variation = placement ? getVariation(placement) : null;
|
||||
var commonX = reference.x + reference.width / 2 - element.width / 2;
|
||||
var commonY = reference.y + reference.height / 2 - element.height / 2;
|
||||
var offsets;
|
||||
|
||||
switch (basePlacement) {
|
||||
case top:
|
||||
offsets = {
|
||||
x: commonX,
|
||||
y: reference.y - element.height
|
||||
};
|
||||
break;
|
||||
|
||||
case bottom:
|
||||
offsets = {
|
||||
x: commonX,
|
||||
y: reference.y + reference.height
|
||||
};
|
||||
break;
|
||||
|
||||
case right:
|
||||
offsets = {
|
||||
x: reference.x + reference.width,
|
||||
y: commonY
|
||||
};
|
||||
break;
|
||||
|
||||
case left:
|
||||
offsets = {
|
||||
x: reference.x - element.width,
|
||||
y: commonY
|
||||
};
|
||||
break;
|
||||
|
||||
default:
|
||||
offsets = {
|
||||
x: reference.x,
|
||||
y: reference.y
|
||||
};
|
||||
}
|
||||
|
||||
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
||||
|
||||
if (mainAxis != null) {
|
||||
var len = mainAxis === 'y' ? 'height' : 'width';
|
||||
|
||||
switch (variation) {
|
||||
case start:
|
||||
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
||||
break;
|
||||
|
||||
case end:
|
||||
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return offsets;
|
||||
}
|
||||
|
||||
function getFreshSideObject() {
|
||||
return {
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
left: 0
|
||||
};
|
||||
}
|
||||
|
||||
function mergePaddingObject(paddingObject) {
|
||||
return Object.assign({}, getFreshSideObject(), paddingObject);
|
||||
}
|
||||
|
||||
function expandToHashMap(value, keys) {
|
||||
return keys.reduce(function (hashMap, key) {
|
||||
hashMap[key] = value;
|
||||
return hashMap;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function detectOverflow(state, options) {
|
||||
if (options === void 0) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
var _options = options,
|
||||
_options$placement = _options.placement,
|
||||
placement = _options$placement === void 0 ? state.placement : _options$placement,
|
||||
_options$strategy = _options.strategy,
|
||||
strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,
|
||||
_options$boundary = _options.boundary,
|
||||
boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
|
||||
_options$rootBoundary = _options.rootBoundary,
|
||||
rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
|
||||
_options$elementConte = _options.elementContext,
|
||||
elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
|
||||
_options$altBoundary = _options.altBoundary,
|
||||
altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
|
||||
_options$padding = _options.padding,
|
||||
padding = _options$padding === void 0 ? 0 : _options$padding;
|
||||
var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
||||
var altContext = elementContext === popper ? reference : popper;
|
||||
var popperRect = state.rects.popper;
|
||||
var element = state.elements[altBoundary ? altContext : elementContext];
|
||||
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
|
||||
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
||||
var popperOffsets = computeOffsets({
|
||||
reference: referenceClientRect,
|
||||
element: popperRect,
|
||||
strategy: 'absolute',
|
||||
placement: placement
|
||||
});
|
||||
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
|
||||
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
|
||||
// 0 or negative = within the clipping rect
|
||||
|
||||
var overflowOffsets = {
|
||||
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
||||
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
||||
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
||||
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
||||
};
|
||||
var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
|
||||
|
||||
if (elementContext === popper && offsetData) {
|
||||
var offset = offsetData[placement];
|
||||
Object.keys(overflowOffsets).forEach(function (key) {
|
||||
var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
|
||||
var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
|
||||
overflowOffsets[key] += offset[axis] * multiply;
|
||||
});
|
||||
}
|
||||
|
||||
return overflowOffsets;
|
||||
}
|
||||
|
||||
var DEFAULT_OPTIONS = {
|
||||
placement: 'bottom',
|
||||
modifiers: [],
|
||||
strategy: 'absolute'
|
||||
};
|
||||
|
||||
function areValidElements() {
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return !args.some(function (element) {
|
||||
return !(element && typeof element.getBoundingClientRect === 'function');
|
||||
});
|
||||
}
|
||||
|
||||
function popperGenerator(generatorOptions) {
|
||||
if (generatorOptions === void 0) {
|
||||
generatorOptions = {};
|
||||
}
|
||||
|
||||
var _generatorOptions = generatorOptions,
|
||||
_generatorOptions$def = _generatorOptions.defaultModifiers,
|
||||
defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
|
||||
_generatorOptions$def2 = _generatorOptions.defaultOptions,
|
||||
defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
||||
return function createPopper(reference, popper, options) {
|
||||
if (options === void 0) {
|
||||
options = defaultOptions;
|
||||
}
|
||||
|
||||
var state = {
|
||||
placement: 'bottom',
|
||||
orderedModifiers: [],
|
||||
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
||||
modifiersData: {},
|
||||
elements: {
|
||||
reference: reference,
|
||||
popper: popper
|
||||
},
|
||||
attributes: {},
|
||||
styles: {}
|
||||
};
|
||||
var effectCleanupFns = [];
|
||||
var isDestroyed = false;
|
||||
var instance = {
|
||||
state: state,
|
||||
setOptions: function setOptions(setOptionsAction) {
|
||||
var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
|
||||
cleanupModifierEffects();
|
||||
state.options = Object.assign({}, defaultOptions, state.options, options);
|
||||
state.scrollParents = {
|
||||
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
||||
popper: listScrollParents(popper)
|
||||
}; // Orders the modifiers based on their dependencies and `phase`
|
||||
// properties
|
||||
|
||||
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
|
||||
|
||||
state.orderedModifiers = orderedModifiers.filter(function (m) {
|
||||
return m.enabled;
|
||||
});
|
||||
runModifierEffects();
|
||||
return instance.update();
|
||||
},
|
||||
// Sync update – it will always be executed, even if not necessary. This
|
||||
// is useful for low frequency updates where sync behavior simplifies the
|
||||
// logic.
|
||||
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
||||
// prefer the async Popper#update method
|
||||
forceUpdate: function forceUpdate() {
|
||||
if (isDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
var _state$elements = state.elements,
|
||||
reference = _state$elements.reference,
|
||||
popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
|
||||
// anymore
|
||||
|
||||
if (!areValidElements(reference, popper)) {
|
||||
return;
|
||||
} // Store the reference and popper rects to be read by modifiers
|
||||
|
||||
|
||||
state.rects = {
|
||||
reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
|
||||
popper: getLayoutRect(popper)
|
||||
}; // Modifiers have the ability to reset the current update cycle. The
|
||||
// most common use case for this is the `flip` modifier changing the
|
||||
// placement, which then needs to re-run all the modifiers, because the
|
||||
// logic was previously ran for the previous placement and is therefore
|
||||
// stale/incorrect
|
||||
|
||||
state.reset = false;
|
||||
state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
|
||||
// is filled with the initial data specified by the modifier. This means
|
||||
// it doesn't persist and is fresh on each update.
|
||||
// To ensure persistent data, use `${name}#persistent`
|
||||
|
||||
state.orderedModifiers.forEach(function (modifier) {
|
||||
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
||||
});
|
||||
|
||||
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
||||
if (state.reset === true) {
|
||||
state.reset = false;
|
||||
index = -1;
|
||||
continue;
|
||||
}
|
||||
|
||||
var _state$orderedModifie = state.orderedModifiers[index],
|
||||
fn = _state$orderedModifie.fn,
|
||||
_state$orderedModifie2 = _state$orderedModifie.options,
|
||||
_options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
|
||||
name = _state$orderedModifie.name;
|
||||
|
||||
if (typeof fn === 'function') {
|
||||
state = fn({
|
||||
state: state,
|
||||
options: _options,
|
||||
name: name,
|
||||
instance: instance
|
||||
}) || state;
|
||||
}
|
||||
}
|
||||
},
|
||||
// Async and optimistically optimized update – it will not be executed if
|
||||
// not necessary (debounced to run at most once-per-tick)
|
||||
update: debounce(function () {
|
||||
return new Promise(function (resolve) {
|
||||
instance.forceUpdate();
|
||||
resolve(state);
|
||||
});
|
||||
}),
|
||||
destroy: function destroy() {
|
||||
cleanupModifierEffects();
|
||||
isDestroyed = true;
|
||||
}
|
||||
};
|
||||
|
||||
if (!areValidElements(reference, popper)) {
|
||||
return instance;
|
||||
}
|
||||
|
||||
instance.setOptions(options).then(function (state) {
|
||||
if (!isDestroyed && options.onFirstUpdate) {
|
||||
options.onFirstUpdate(state);
|
||||
}
|
||||
}); // Modifiers have the ability to execute arbitrary code before the first
|
||||
// update cycle runs. They will be executed in the same order as the update
|
||||
// cycle. This is useful when a modifier adds some persistent data that
|
||||
// other modifiers need to use, but the modifier is run after the dependent
|
||||
// one.
|
||||
|
||||
function runModifierEffects() {
|
||||
state.orderedModifiers.forEach(function (_ref) {
|
||||
var name = _ref.name,
|
||||
_ref$options = _ref.options,
|
||||
options = _ref$options === void 0 ? {} : _ref$options,
|
||||
effect = _ref.effect;
|
||||
|
||||
if (typeof effect === 'function') {
|
||||
var cleanupFn = effect({
|
||||
state: state,
|
||||
name: name,
|
||||
instance: instance,
|
||||
options: options
|
||||
});
|
||||
|
||||
var noopFn = function noopFn() {};
|
||||
|
||||
effectCleanupFns.push(cleanupFn || noopFn);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function cleanupModifierEffects() {
|
||||
effectCleanupFns.forEach(function (fn) {
|
||||
return fn();
|
||||
});
|
||||
effectCleanupFns = [];
|
||||
}
|
||||
|
||||
return instance;
|
||||
};
|
||||
}
|
||||
var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
exports.createPopper = createPopper;
|
||||
exports.detectOverflow = detectOverflow;
|
||||
exports.popperGenerator = popperGenerator;
|
||||
//# sourceMappingURL=popper-base.js.map
|
3
extension/js/node_modules/@popperjs/core/dist/cjs/popper-base.js.flow
generated
vendored
Normal file
3
extension/js/node_modules/@popperjs/core/dist/cjs/popper-base.js.flow
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// @flow
|
||||
|
||||
export * from '../../lib/popper-base.js'
|
1
extension/js/node_modules/@popperjs/core/dist/cjs/popper-base.js.map
generated
vendored
Normal file
1
extension/js/node_modules/@popperjs/core/dist/cjs/popper-base.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1260
extension/js/node_modules/@popperjs/core/dist/cjs/popper-lite.js
generated
vendored
Normal file
1260
extension/js/node_modules/@popperjs/core/dist/cjs/popper-lite.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3
extension/js/node_modules/@popperjs/core/dist/cjs/popper-lite.js.flow
generated
vendored
Normal file
3
extension/js/node_modules/@popperjs/core/dist/cjs/popper-lite.js.flow
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// @flow
|
||||
|
||||
export * from '../../lib/popper-lite.js'
|
1
extension/js/node_modules/@popperjs/core/dist/cjs/popper-lite.js.map
generated
vendored
Normal file
1
extension/js/node_modules/@popperjs/core/dist/cjs/popper-lite.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1819
extension/js/node_modules/@popperjs/core/dist/cjs/popper.js
generated
vendored
Normal file
1819
extension/js/node_modules/@popperjs/core/dist/cjs/popper.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3
extension/js/node_modules/@popperjs/core/dist/cjs/popper.js.flow
generated
vendored
Normal file
3
extension/js/node_modules/@popperjs/core/dist/cjs/popper.js.flow
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// @flow
|
||||
|
||||
export * from '../../lib/popper.js'
|
1
extension/js/node_modules/@popperjs/core/dist/cjs/popper.js.map
generated
vendored
Normal file
1
extension/js/node_modules/@popperjs/core/dist/cjs/popper.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
199
extension/js/node_modules/@popperjs/core/dist/esm/createPopper.js
generated
vendored
Normal file
199
extension/js/node_modules/@popperjs/core/dist/esm/createPopper.js
generated
vendored
Normal file
@ -0,0 +1,199 @@
|
||||
import getCompositeRect from "./dom-utils/getCompositeRect.js";
|
||||
import getLayoutRect from "./dom-utils/getLayoutRect.js";
|
||||
import listScrollParents from "./dom-utils/listScrollParents.js";
|
||||
import getOffsetParent from "./dom-utils/getOffsetParent.js";
|
||||
import orderModifiers from "./utils/orderModifiers.js";
|
||||
import debounce from "./utils/debounce.js";
|
||||
import mergeByName from "./utils/mergeByName.js";
|
||||
import detectOverflow from "./utils/detectOverflow.js";
|
||||
import { isElement } from "./dom-utils/instanceOf.js";
|
||||
var DEFAULT_OPTIONS = {
|
||||
placement: 'bottom',
|
||||
modifiers: [],
|
||||
strategy: 'absolute'
|
||||
};
|
||||
|
||||
function areValidElements() {
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return !args.some(function (element) {
|
||||
return !(element && typeof element.getBoundingClientRect === 'function');
|
||||
});
|
||||
}
|
||||
|
||||
export function popperGenerator(generatorOptions) {
|
||||
if (generatorOptions === void 0) {
|
||||
generatorOptions = {};
|
||||
}
|
||||
|
||||
var _generatorOptions = generatorOptions,
|
||||
_generatorOptions$def = _generatorOptions.defaultModifiers,
|
||||
defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
|
||||
_generatorOptions$def2 = _generatorOptions.defaultOptions,
|
||||
defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
||||
return function createPopper(reference, popper, options) {
|
||||
if (options === void 0) {
|
||||
options = defaultOptions;
|
||||
}
|
||||
|
||||
var state = {
|
||||
placement: 'bottom',
|
||||
orderedModifiers: [],
|
||||
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
||||
modifiersData: {},
|
||||
elements: {
|
||||
reference: reference,
|
||||
popper: popper
|
||||
},
|
||||
attributes: {},
|
||||
styles: {}
|
||||
};
|
||||
var effectCleanupFns = [];
|
||||
var isDestroyed = false;
|
||||
var instance = {
|
||||
state: state,
|
||||
setOptions: function setOptions(setOptionsAction) {
|
||||
var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
|
||||
cleanupModifierEffects();
|
||||
state.options = Object.assign({}, defaultOptions, state.options, options);
|
||||
state.scrollParents = {
|
||||
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
||||
popper: listScrollParents(popper)
|
||||
}; // Orders the modifiers based on their dependencies and `phase`
|
||||
// properties
|
||||
|
||||
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
|
||||
|
||||
state.orderedModifiers = orderedModifiers.filter(function (m) {
|
||||
return m.enabled;
|
||||
});
|
||||
runModifierEffects();
|
||||
return instance.update();
|
||||
},
|
||||
// Sync update – it will always be executed, even if not necessary. This
|
||||
// is useful for low frequency updates where sync behavior simplifies the
|
||||
// logic.
|
||||
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
||||
// prefer the async Popper#update method
|
||||
forceUpdate: function forceUpdate() {
|
||||
if (isDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
var _state$elements = state.elements,
|
||||
reference = _state$elements.reference,
|
||||
popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
|
||||
// anymore
|
||||
|
||||
if (!areValidElements(reference, popper)) {
|
||||
return;
|
||||
} // Store the reference and popper rects to be read by modifiers
|
||||
|
||||
|
||||
state.rects = {
|
||||
reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
|
||||
popper: getLayoutRect(popper)
|
||||
}; // Modifiers have the ability to reset the current update cycle. The
|
||||
// most common use case for this is the `flip` modifier changing the
|
||||
// placement, which then needs to re-run all the modifiers, because the
|
||||
// logic was previously ran for the previous placement and is therefore
|
||||
// stale/incorrect
|
||||
|
||||
state.reset = false;
|
||||
state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
|
||||
// is filled with the initial data specified by the modifier. This means
|
||||
// it doesn't persist and is fresh on each update.
|
||||
// To ensure persistent data, use `${name}#persistent`
|
||||
|
||||
state.orderedModifiers.forEach(function (modifier) {
|
||||
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
||||
});
|
||||
|
||||
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
||||
if (state.reset === true) {
|
||||
state.reset = false;
|
||||
index = -1;
|
||||
continue;
|
||||
}
|
||||
|
||||
var _state$orderedModifie = state.orderedModifiers[index],
|
||||
fn = _state$orderedModifie.fn,
|
||||
_state$orderedModifie2 = _state$orderedModifie.options,
|
||||
_options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
|
||||
name = _state$orderedModifie.name;
|
||||
|
||||
if (typeof fn === 'function') {
|
||||
state = fn({
|
||||
state: state,
|
||||
options: _options,
|
||||
name: name,
|
||||
instance: instance
|
||||
}) || state;
|
||||
}
|
||||
}
|
||||
},
|
||||
// Async and optimistically optimized update – it will not be executed if
|
||||
// not necessary (debounced to run at most once-per-tick)
|
||||
update: debounce(function () {
|
||||
return new Promise(function (resolve) {
|
||||
instance.forceUpdate();
|
||||
resolve(state);
|
||||
});
|
||||
}),
|
||||
destroy: function destroy() {
|
||||
cleanupModifierEffects();
|
||||
isDestroyed = true;
|
||||
}
|
||||
};
|
||||
|
||||
if (!areValidElements(reference, popper)) {
|
||||
return instance;
|
||||
}
|
||||
|
||||
instance.setOptions(options).then(function (state) {
|
||||
if (!isDestroyed && options.onFirstUpdate) {
|
||||
options.onFirstUpdate(state);
|
||||
}
|
||||
}); // Modifiers have the ability to execute arbitrary code before the first
|
||||
// update cycle runs. They will be executed in the same order as the update
|
||||
// cycle. This is useful when a modifier adds some persistent data that
|
||||
// other modifiers need to use, but the modifier is run after the dependent
|
||||
// one.
|
||||
|
||||
function runModifierEffects() {
|
||||
state.orderedModifiers.forEach(function (_ref) {
|
||||
var name = _ref.name,
|
||||
_ref$options = _ref.options,
|
||||
options = _ref$options === void 0 ? {} : _ref$options,
|
||||
effect = _ref.effect;
|
||||
|
||||
if (typeof effect === 'function') {
|
||||
var cleanupFn = effect({
|
||||
state: state,
|
||||
name: name,
|
||||
instance: instance,
|
||||
options: options
|
||||
});
|
||||
|
||||
var noopFn = function noopFn() {};
|
||||
|
||||
effectCleanupFns.push(cleanupFn || noopFn);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function cleanupModifierEffects() {
|
||||
effectCleanupFns.forEach(function (fn) {
|
||||
return fn();
|
||||
});
|
||||
effectCleanupFns = [];
|
||||
}
|
||||
|
||||
return instance;
|
||||
};
|
||||
}
|
||||
export var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules
|
||||
|
||||
export { detectOverflow };
|
23
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/contains.js
generated
vendored
Normal file
23
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/contains.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
import { isShadowRoot } from "./instanceOf.js";
|
||||
export default function contains(parent, child) {
|
||||
var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
|
||||
|
||||
if (parent.contains(child)) {
|
||||
return true;
|
||||
} // then fallback to custom implementation with Shadow DOM support
|
||||
else if (rootNode && isShadowRoot(rootNode)) {
|
||||
var next = child;
|
||||
|
||||
do {
|
||||
if (next && parent.isSameNode(next)) {
|
||||
return true;
|
||||
} // $FlowFixMe[prop-missing]: need a better way to handle this...
|
||||
|
||||
|
||||
next = next.parentNode || next.host;
|
||||
} while (next);
|
||||
} // Give up, the result is false
|
||||
|
||||
|
||||
return false;
|
||||
}
|
41
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getBoundingClientRect.js
generated
vendored
Normal file
41
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getBoundingClientRect.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
import { isElement, isHTMLElement } from "./instanceOf.js";
|
||||
import { round } from "../utils/math.js";
|
||||
import getWindow from "./getWindow.js";
|
||||
import isLayoutViewport from "./isLayoutViewport.js";
|
||||
export default function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
||||
if (includeScale === void 0) {
|
||||
includeScale = false;
|
||||
}
|
||||
|
||||
if (isFixedStrategy === void 0) {
|
||||
isFixedStrategy = false;
|
||||
}
|
||||
|
||||
var clientRect = element.getBoundingClientRect();
|
||||
var scaleX = 1;
|
||||
var scaleY = 1;
|
||||
|
||||
if (includeScale && isHTMLElement(element)) {
|
||||
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
||||
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
||||
}
|
||||
|
||||
var _ref = isElement(element) ? getWindow(element) : window,
|
||||
visualViewport = _ref.visualViewport;
|
||||
|
||||
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
||||
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
||||
var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
||||
var width = clientRect.width / scaleX;
|
||||
var height = clientRect.height / scaleY;
|
||||
return {
|
||||
width: width,
|
||||
height: height,
|
||||
top: y,
|
||||
right: x + width,
|
||||
bottom: y + height,
|
||||
left: x,
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
}
|
70
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getClippingRect.js
generated
vendored
Normal file
70
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getClippingRect.js
generated
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
import { viewport } from "../enums.js";
|
||||
import getViewportRect from "./getViewportRect.js";
|
||||
import getDocumentRect from "./getDocumentRect.js";
|
||||
import listScrollParents from "./listScrollParents.js";
|
||||
import getOffsetParent from "./getOffsetParent.js";
|
||||
import getDocumentElement from "./getDocumentElement.js";
|
||||
import getComputedStyle from "./getComputedStyle.js";
|
||||
import { isElement, isHTMLElement } from "./instanceOf.js";
|
||||
import getBoundingClientRect from "./getBoundingClientRect.js";
|
||||
import getParentNode from "./getParentNode.js";
|
||||
import contains from "./contains.js";
|
||||
import getNodeName from "./getNodeName.js";
|
||||
import rectToClientRect from "../utils/rectToClientRect.js";
|
||||
import { max, min } from "../utils/math.js";
|
||||
|
||||
function getInnerBoundingClientRect(element, strategy) {
|
||||
var rect = getBoundingClientRect(element, false, strategy === 'fixed');
|
||||
rect.top = rect.top + element.clientTop;
|
||||
rect.left = rect.left + element.clientLeft;
|
||||
rect.bottom = rect.top + element.clientHeight;
|
||||
rect.right = rect.left + element.clientWidth;
|
||||
rect.width = element.clientWidth;
|
||||
rect.height = element.clientHeight;
|
||||
rect.x = rect.left;
|
||||
rect.y = rect.top;
|
||||
return rect;
|
||||
}
|
||||
|
||||
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
||||
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
||||
} // A "clipping parent" is an overflowable container with the characteristic of
|
||||
// clipping (or hiding) overflowing elements with a position different from
|
||||
// `initial`
|
||||
|
||||
|
||||
function getClippingParents(element) {
|
||||
var clippingParents = listScrollParents(getParentNode(element));
|
||||
var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
|
||||
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
||||
|
||||
if (!isElement(clipperElement)) {
|
||||
return [];
|
||||
} // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
|
||||
|
||||
|
||||
return clippingParents.filter(function (clippingParent) {
|
||||
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
||||
});
|
||||
} // Gets the maximum area that the element is visible in due to any number of
|
||||
// clipping parents
|
||||
|
||||
|
||||
export default function getClippingRect(element, boundary, rootBoundary, strategy) {
|
||||
var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
|
||||
var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
|
||||
var firstClippingParent = clippingParents[0];
|
||||
var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
|
||||
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
||||
accRect.top = max(rect.top, accRect.top);
|
||||
accRect.right = min(rect.right, accRect.right);
|
||||
accRect.bottom = min(rect.bottom, accRect.bottom);
|
||||
accRect.left = max(rect.left, accRect.left);
|
||||
return accRect;
|
||||
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
||||
clippingRect.width = clippingRect.right - clippingRect.left;
|
||||
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
||||
clippingRect.x = clippingRect.left;
|
||||
clippingRect.y = clippingRect.top;
|
||||
return clippingRect;
|
||||
}
|
58
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getCompositeRect.js
generated
vendored
Normal file
58
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getCompositeRect.js
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
import getBoundingClientRect from "./getBoundingClientRect.js";
|
||||
import getNodeScroll from "./getNodeScroll.js";
|
||||
import getNodeName from "./getNodeName.js";
|
||||
import { isHTMLElement } from "./instanceOf.js";
|
||||
import getWindowScrollBarX from "./getWindowScrollBarX.js";
|
||||
import getDocumentElement from "./getDocumentElement.js";
|
||||
import isScrollParent from "./isScrollParent.js";
|
||||
import { round } from "../utils/math.js";
|
||||
|
||||
function isElementScaled(element) {
|
||||
var rect = element.getBoundingClientRect();
|
||||
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
||||
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
||||
return scaleX !== 1 || scaleY !== 1;
|
||||
} // Returns the composite rect of an element relative to its offsetParent.
|
||||
// Composite means it takes into account transforms as well as layout.
|
||||
|
||||
|
||||
export default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
||||
if (isFixed === void 0) {
|
||||
isFixed = false;
|
||||
}
|
||||
|
||||
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
||||
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
||||
var documentElement = getDocumentElement(offsetParent);
|
||||
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
||||
var scroll = {
|
||||
scrollLeft: 0,
|
||||
scrollTop: 0
|
||||
};
|
||||
var offsets = {
|
||||
x: 0,
|
||||
y: 0
|
||||
};
|
||||
|
||||
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
||||
if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
|
||||
isScrollParent(documentElement)) {
|
||||
scroll = getNodeScroll(offsetParent);
|
||||
}
|
||||
|
||||
if (isHTMLElement(offsetParent)) {
|
||||
offsets = getBoundingClientRect(offsetParent, true);
|
||||
offsets.x += offsetParent.clientLeft;
|
||||
offsets.y += offsetParent.clientTop;
|
||||
} else if (documentElement) {
|
||||
offsets.x = getWindowScrollBarX(documentElement);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
x: rect.left + scroll.scrollLeft - offsets.x,
|
||||
y: rect.top + scroll.scrollTop - offsets.y,
|
||||
width: rect.width,
|
||||
height: rect.height
|
||||
};
|
||||
}
|
4
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getComputedStyle.js
generated
vendored
Normal file
4
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getComputedStyle.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import getWindow from "./getWindow.js";
|
||||
export default function getComputedStyle(element) {
|
||||
return getWindow(element).getComputedStyle(element);
|
||||
}
|
6
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getDocumentElement.js
generated
vendored
Normal file
6
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getDocumentElement.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
import { isElement } from "./instanceOf.js";
|
||||
export default function getDocumentElement(element) {
|
||||
// $FlowFixMe[incompatible-return]: assume body is always available
|
||||
return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
||||
element.document) || window.document).documentElement;
|
||||
}
|
29
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getDocumentRect.js
generated
vendored
Normal file
29
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getDocumentRect.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
import getDocumentElement from "./getDocumentElement.js";
|
||||
import getComputedStyle from "./getComputedStyle.js";
|
||||
import getWindowScrollBarX from "./getWindowScrollBarX.js";
|
||||
import getWindowScroll from "./getWindowScroll.js";
|
||||
import { max } from "../utils/math.js"; // Gets the entire size of the scrollable document area, even extending outside
|
||||
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
||||
|
||||
export default function getDocumentRect(element) {
|
||||
var _element$ownerDocumen;
|
||||
|
||||
var html = getDocumentElement(element);
|
||||
var winScroll = getWindowScroll(element);
|
||||
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
||||
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
||||
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
||||
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
||||
var y = -winScroll.scrollTop;
|
||||
|
||||
if (getComputedStyle(body || html).direction === 'rtl') {
|
||||
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
||||
}
|
||||
|
||||
return {
|
||||
width: width,
|
||||
height: height,
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
}
|
6
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getHTMLElementScroll.js
generated
vendored
Normal file
6
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getHTMLElementScroll.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
export default function getHTMLElementScroll(element) {
|
||||
return {
|
||||
scrollLeft: element.scrollLeft,
|
||||
scrollTop: element.scrollTop
|
||||
};
|
||||
}
|
25
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getLayoutRect.js
generated
vendored
Normal file
25
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getLayoutRect.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
import getBoundingClientRect from "./getBoundingClientRect.js"; // Returns the layout rect of an element relative to its offsetParent. Layout
|
||||
// means it doesn't take into account transforms.
|
||||
|
||||
export default function getLayoutRect(element) {
|
||||
var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
|
||||
// Fixes https://github.com/popperjs/popper-core/issues/1223
|
||||
|
||||
var width = element.offsetWidth;
|
||||
var height = element.offsetHeight;
|
||||
|
||||
if (Math.abs(clientRect.width - width) <= 1) {
|
||||
width = clientRect.width;
|
||||
}
|
||||
|
||||
if (Math.abs(clientRect.height - height) <= 1) {
|
||||
height = clientRect.height;
|
||||
}
|
||||
|
||||
return {
|
||||
x: element.offsetLeft,
|
||||
y: element.offsetTop,
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
}
|
3
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getNodeName.js
generated
vendored
Normal file
3
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getNodeName.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
export default function getNodeName(element) {
|
||||
return element ? (element.nodeName || '').toLowerCase() : null;
|
||||
}
|
11
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getNodeScroll.js
generated
vendored
Normal file
11
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getNodeScroll.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import getWindowScroll from "./getWindowScroll.js";
|
||||
import getWindow from "./getWindow.js";
|
||||
import { isHTMLElement } from "./instanceOf.js";
|
||||
import getHTMLElementScroll from "./getHTMLElementScroll.js";
|
||||
export default function getNodeScroll(node) {
|
||||
if (node === getWindow(node) || !isHTMLElement(node)) {
|
||||
return getWindowScroll(node);
|
||||
} else {
|
||||
return getHTMLElementScroll(node);
|
||||
}
|
||||
}
|
69
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getOffsetParent.js
generated
vendored
Normal file
69
extension/js/node_modules/@popperjs/core/dist/esm/dom-utils/getOffsetParent.js
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
import getWindow from "./getWindow.js";
|
||||
import getNodeName from "./getNodeName.js";
|
||||
import getComputedStyle from "./getComputedStyle.js";
|
||||
import { isHTMLElement, isShadowRoot } from "./instanceOf.js";
|
||||
import isTableElement from "./isTableElement.js";
|
||||
import getParentNode from "./getParentNode.js";
|
||||
import getUAString from "../utils/userAgent.js";
|
||||
|
||||
function getTrueOffsetParent(element) {
|
||||
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
||||
getComputedStyle(element).position === 'fixed') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return element.offsetParent;
|
||||
} // `.offsetParent` reports `null` for fixed elements, while absolute elements
|
||||
// return the containing block
|
||||
|
||||
|
||||
function getContainingBlock(element) {
|
||||
var isFirefox = /firefox/i.test(getUAString());
|
||||
var isIE = /Trident/i.test(getUAString());
|
||||
|
||||
if (isIE && isHTMLElement(element)) {
|
||||
// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
|
||||
var elementCss = getComputedStyle(element);
|
||||
|
||||
if (elementCss.position === 'fixed') {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
var currentNode = getParentNode(element);
|
||||
|
||||
if (isShadowRoot(currentNode)) {
|
||||
currentNode = currentNode.host;
|
||||
}
|
||||
|
||||
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
||||
var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
||||
// create a containing block.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
||||
|
||||
if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
|
||||
return currentNode;
|
||||
} else {
|
||||
currentNode = currentNode.parentNode;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
} // Gets the closest ancestor positioned element. Handles some edge cases,
|
||||
// such as table ancestors and cross browser bugs.
|
||||
|
||||
|
||||
export default function getOffsetParent(element) {
|
||||
var window = getWindow(element);
|
||||
var offsetParent = getTrueOffsetParent(element);
|
||||
|
||||
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
||||
offsetParent = getTrueOffsetParent(offsetParent);
|
||||
}
|
||||
|
||||
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
|
||||
return window;
|
||||
}
|
||||
|
||||
return offsetParent || getContainingBlock(element) || window;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user