diff --git a/common/admin.py b/common/admin.py index 453c072..360ba05 100644 --- a/common/admin.py +++ b/common/admin.py @@ -1,4 +1,6 @@ from django.contrib import admin +from django.urls import reverse +from django.utils.html import format_html from common.models import ItemData, ContextButtonType, ItemDataContextButton from common.signals import add_signals @@ -12,19 +14,30 @@ class ItemDataButtonsInline(admin.TabularInline): class ItemDataAdmin(admin.ModelAdmin): - list_display = ('title', "author", 'status', 'created_at', 'updated_at') + list_display = ('title', "author", 'status', 'created_at', 'updated_at', 'get_link') search_fields = ('title', 'author') list_filter = ('collection', 'status') ordering = ('-created_at', '-updated_at', 'id') + readonly_fields = ('get_link',) + inlines = [ItemDataButtonsInline] + def get_link(self, obj: ItemData): + if obj.collection: # Проверяем, есть ли коллекция + url = reverse('item-view', args=(obj.collection.name, obj.id,)) + return format_html(f'Открыть') + else: + return "-" + + get_link.short_description = "Ссылка на сайте" + admin.site.register(ItemData, ItemDataAdmin) class ContextButtonTypeAdmin(admin.ModelAdmin): - list_display = ('verbose', 'name') + list_display = ('verbose', 'name', 'host_regex') search_fields = ('verbose', 'name') ordering = ('verbose',) diff --git a/common/migrations/0007_alter_itemdata_image_alter_itemdata_preview.py b/common/migrations/0007_alter_itemdata_image_alter_itemdata_preview.py new file mode 100644 index 0000000..7e04cd5 --- /dev/null +++ b/common/migrations/0007_alter_itemdata_image_alter_itemdata_preview.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.16 on 2024-11-18 19:22 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0006_itemdatacontextbutton'), + ] + + operations = [ + migrations.AlterField( + model_name='itemdata', + name='image', + field=models.ImageField(blank=True, null=True, upload_to='images/', verbose_name='Главное изображение'), + ), + migrations.AlterField( + model_name='itemdata', + name='preview', + field=models.ImageField(blank=True, null=True, upload_to='images/previews/', verbose_name='Превью'), + ), + ] diff --git a/common/migrations/0008_contextbuttontype_host_regex.py b/common/migrations/0008_contextbuttontype_host_regex.py new file mode 100644 index 0000000..b7b73c1 --- /dev/null +++ b/common/migrations/0008_contextbuttontype_host_regex.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.16 on 2024-11-22 21:12 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0007_alter_itemdata_image_alter_itemdata_preview'), + ] + + operations = [ + migrations.AddField( + model_name='contextbuttontype', + name='host_regex', + field=models.CharField(blank=True, default='', max_length=20), + ), + ] diff --git a/common/models.py b/common/models.py index 31f5911..b4e2ae0 100644 --- a/common/models.py +++ b/common/models.py @@ -33,10 +33,10 @@ class ItemDataStatus(models.Model): class ItemData(models.Model): title = models.CharField(max_length=100, verbose_name='Название') - image = models.ImageField(upload_to='images/', verbose_name='Главное изображение') + image = models.ImageField(upload_to='images/', verbose_name='Главное изображение', null=True, blank=True) description = models.TextField(verbose_name='Описание') short_description = models.TextField(max_length=256, verbose_name='Краткое описание') - preview = models.ImageField(upload_to='images/previews/', verbose_name='Превью') + preview = models.ImageField(upload_to='images/previews/', verbose_name='Превью', null=True, blank=True) collection = models.ForeignKey( ItemDataCollection, @@ -72,10 +72,10 @@ class ItemData(models.Model): return { "id": self.id, "title": self.title, - "image": self.image.url, + "image": None if not self.image else self.image.url, "description": self.description, "shortDescription": self.short_description, - "preview": self.preview.url, + "preview": None if not self.preview else self.preview.url, "createdAt": self.created_at.timestamp(), "updatedAt": self.updated_at.timestamp(), } @@ -90,7 +90,8 @@ class ItemData(models.Model): author = self.author.id return { - "image": self.image.url, + "id": self.id, + "image": None if not self.image else self.image.url, "title": self.title, "shortDescription": self.short_description, "description": self.description, @@ -103,7 +104,7 @@ class ItemData(models.Model): return { "id": self.id, "title": self.title, - "preview": self.preview.url + "preview": None if not self.preview else self.preview.url } @property @@ -111,7 +112,7 @@ class ItemData(models.Model): card = self.card_dict card.update({ "status": self.status.verbose, - "updatedAt": self.updated_at.timestamp() // .001, + "updatedAt": self.updated_at.timestamp(), "shortDescription": self.short_description }) @@ -122,6 +123,8 @@ class ContextButtonType(models.Model): name = models.CharField(max_length=20, primary_key=True) verbose = models.CharField(max_length=20) + host_regex = models.CharField(max_length=20, default="", blank=True) + def __str__(self): return self.verbose diff --git a/common/signals.py b/common/signals.py index 27ccc08..e03b52d 100644 --- a/common/signals.py +++ b/common/signals.py @@ -42,16 +42,16 @@ def create_status_types(sender, **kwargs): @receiver(post_migrate) def create_context_button_types(sender, **kwargs): default_context_button_types = ( - ("telegram", "Телеграм"), - ("vk", "Вконтакте"), - ("email", "E-MAIL"), - ("steam", "Страница в стиме"), - ("itchio", "Страница в itch.io"), + ("telegram", "Телеграм", r"https://t\.me/"), + ("vk", "Вконтакте", "https://vk.com/"), + ("email", "E-MAIL", "mailto://"), + ("steam", "Страница в стиме", r"https://(?store\.steampowered|steamcommunity)\.com/"), + ("itchio", "Страница в itch.io", r"https://\w+\.itch\.io/"), ) - for name, verbose in default_context_button_types: + for name, verbose, host_regex in default_context_button_types: try: - ContextButtonType.objects.get_or_create(name=name, verbose=verbose) + ContextButtonType.objects.get_or_create(name=name, verbose=verbose, host_regex=host_regex) except Exception as e: print(f"[-] {repr(e)} - {name} {verbose}") diff --git a/common/urls.py b/common/urls.py index 5ac3c2d..dde7489 100644 --- a/common/urls.py +++ b/common/urls.py @@ -5,4 +5,6 @@ from . import views urlpatterns = [ path('get-collection//', views.get_cards, name='get-collection'), path('get-item//', views.get_item, name='get-collection'), + path('update/item/', views.update_item, name='update-item'), + path('get/available-context-buttons/', views.context_buttons_list, name='available-context-buttons'), ] diff --git a/common/views.py b/common/views.py index 687f505..69e2981 100644 --- a/common/views.py +++ b/common/views.py @@ -1,8 +1,13 @@ +import json +import re + from django.db.models import QuerySet from django.http import HttpResponse, HttpRequest, JsonResponse from common.exceptions import NovelPlusHttpExceptionResponse -from common.models import ItemData +from common.models import ItemData, ContextButtonType +from users.models import User +from utils import get_request_data, update_context_buttons def get_cards(request: HttpRequest, variant: str, collection: str) -> HttpResponse: @@ -40,3 +45,45 @@ def get_item(request: HttpRequest, collection: str, item_id: int) -> HttpRespons 500, {"message": repr(e)} ) + + +def update_item(request): + data = get_request_data(request) + user: User = request.user + item: ItemData = ItemData.objects.filter( + id=data['id'][0] + ).first() + if item is None: + return NovelPlusHttpExceptionResponse(request, "Такого объекта не существует", status=403) + + try: + if not (user.id == int(data['author'][0]) == item.author.id): + return NovelPlusHttpExceptionResponse(request, "Вы не имеете право на эту операцию", status=403) + except KeyError: + return NovelPlusHttpExceptionResponse(request, "Вы не имеете право на эту операцию", status=403) + except ValueError: + return NovelPlusHttpExceptionResponse(request, "Вы не имеете право на эту операцию", status=403) + + for change in data['changes']: + if change == "image": + try: + item.image.save(user.username + str(item.id) + ".jpg", request.FILES['image'], save=False) + except Exception as e: + return NovelPlusHttpExceptionResponse(request, "Произошла ошибка", 500, repr(e)) + elif change == "contextButtons": + update_context_buttons(data.get(change)[0], item) + else: + setattr(item, change, data.get(change)[0]) + + item.save() + + return JsonResponse({"success": True}) + + +def context_buttons_list(request): + return JsonResponse( + { + "success": True, + "context_buttons": [cb.verbose for cb in ContextButtonType.objects.all()] + } + ) diff --git a/frontend/NovelPlus-frontend b/frontend/NovelPlus-frontend index 4c467f2..4bb343a 160000 --- a/frontend/NovelPlus-frontend +++ b/frontend/NovelPlus-frontend @@ -1 +1 @@ -Subproject commit 4c467f23253058307be6973fd863afd5ee19847a +Subproject commit 4bb343af06b90bf1cefd721246afed702d59d860 diff --git a/frontend/react-to-django/template.html b/frontend/react-to-django/template.html index 6731d8c..b04ac6b 100644 --- a/frontend/react-to-django/template.html +++ b/frontend/react-to-django/template.html @@ -10,7 +10,8 @@ {%% csrf_token %%} - + + diff --git a/frontend/static/frontend/css/main.3c1cb610.css b/frontend/static/frontend/css/main.3c1cb610.css deleted file mode 100644 index 790d2f2..0000000 --- a/frontend/static/frontend/css/main.3c1cb610.css +++ /dev/null @@ -1,2 +0,0 @@ -@import url(https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;800&display=swap);:root{--color-header-background:#feb198;--color-base-background:#ffe0ce;--color-base-primary:#000;--color-base-secondary:#edc881;--color-base-tertiary:#7d5555;--color-footer-primary:#fff;--color-error-text:red}.error{color:red;color:var(--color-error-text)}body{background-color:var(--color-base-background);margin:0;padding:0}h1,h2{margin:0;text-transform:uppercase}h1{font-size:30px}h2{font-size:20px}#root,.App,.page,body,html{height:100%}.page{display:table}@media (min-width:1200px){h1{font-size:80px}h2{font-size:40px}}.body-text{font-size:16px}@media (min-width:1200px){.body-text{font-size:26px}}.primary{background:var(--color-base-secondary);border:1px solid var(--color-base-tertiary);border-radius:40px;box-sizing:border-box;color:var(--color-base-tertiary);cursor:pointer;font-family:Montserrat,sans-serif;text-align:center;text-decoration:none;text-transform:uppercase;width:fit-content}.primary:hover{color:var(--color-base-primary)}.primary.selected,.primary:hover{border-color:var(--color-base-primary)}.primary.selected{background:var(--color-base-tertiary);color:var(--color-base-secondary)}.primary.large{font-size:40px;font-weight:600;padding:6px 35px}.primary.medium{font-size:20px;font-weight:500;padding:10px 40px}.primary.small{font-size:12px;font-weight:500;padding:7px 20px}@media (min-width:1200px){.primary.large{font-size:80px;font-weight:600;padding:6px 54px}.primary.medium{font-size:40px;font-weight:500;padding:14px 54px}.primary.small{font-size:26px;font-weight:500;padding:10px 29px}}.content-box{margin-left:auto;margin-right:auto;width:300px}.fill-width{width:100%}.align-center,.align-end,.align-start,.horizontal-box,.stretched-box,.vertical-box{display:flex}.stretched-box{flex-direction:row;justify-content:space-between}.vertical-box{flex-direction:column}.horizontal-box{flex-direction:row}.align-end{align-items:flex-end}.align-center{align-items:center}.align-start{align-items:flex-start}.align-left{margin-right:auto}@media (min-width:640px){.content-box{margin-left:auto;margin-right:auto;width:620px}}@media (min-width:1200px){.content-box{margin-left:auto;margin-right:auto;width:1100px}}@media (min-width:1600px){.content-box{margin-left:auto;margin-right:auto;width:1550px}}@media (min-width:1900px){.content-box{margin-left:auto;margin-right:auto;width:1880px}}.header .icon{width:80%}.header .avatar{border-radius:60px;height:60px;width:60px}.header .navigation .primary.small{width:100%}.header .phone-menu{display:table}.header .phone-menu>div{display:table-cell;padding:3px;width:50%}.header{background-color:var(--color-header-background);padding-top:40px}.header,.header .bottom-menu,.header .upper-menu{padding-bottom:20px}.header .upper-menu{gap:60px;padding-top:20px}.header .bottom-menu{border-top:1px solid var(--color-base-primary);padding-top:40px}.header .navigation{gap:20px}.header .menu-button>.avatar{align-items:center;background-color:#fcfcfa}.header .dropdown-menu{position:relative}.header .menu-button{background:none;border:none;cursor:pointer}.header .menu-content{background-color:#333;border:1px solid #fcfcfa;border-radius:5px;display:flex;flex-direction:column;padding:10px;width:max-content}.header .menu-content a,.header .menu-content button{background:none;border:2px outset buttonborder;border-image:none;border-image:initial;color:#fcfcfa;padding:10px 20px;text-decoration:none}.header .menu-content a:hover,.header .menu-content button:hover{background-color:#444}.header .menu-click-area{position:absolute;right:0;top:0}.header .menu-click-area>div{gap:10px}.header .vk-login{padding-top:20px}@media (min-width:1200px){.header .icon,.header .navigation .primary.small{width:auto}.header .avatar{border-radius:100px;height:100px;width:100px}}.login-from-menu{color:#fff}.footer{background-color:var(--color-base-tertiary);padding:30px 20px}.footer,.footer a{color:var(--color-footer-primary)}.footer a{font-family:Montserrat,sans-serif;font-size:20px;font-weight:500}.footer a:hover{color:var(--color-base-secondary)}@media (min-width:1200px){.footer{padding:130px 150px}.footer a{font-size:40px}}section{display:table-row;height:100%;margin:30px 0}.section{margin:0 auto;padding:30px 0}.about .button-list{gap:20px}.about .button-list a.primary.medium{width:100%}@media (min-width:640px){.about .button-list a.primary.medium{width:fit-content}}.card{background-size:cover;color:#fff;display:flex;margin-left:auto;margin-right:auto;text-decoration:none}.card,.card>div{height:175px;width:250px}.card>div{background:linear-gradient(180deg,#2d0c0c00 68.5%,#2d0c0c)}.card>div:hover{background:linear-gradient(180deg,#2d0c0c00 30.5%,#2d0c0c)}.card>div>div{color:var(--color-base-secondary);height:33px;margin-left:auto;margin-right:auto;text-align:center;width:225px}@media (min-width:640px){.card{margin-left:0;margin-right:0}}@media (min-width:1200px){.card{height:350px;width:500px}.card>div>div{height:66px;width:450px;width:500px}.card>div{background:linear-gradient(180deg,#2d0c0c00 68.5%,#2d0c0c);height:350px;width:500px}}.store{display:flex;flex-direction:column;gap:10px}@media (min-width:640px){.store{grid-gap:39px;display:grid;gap:39px;grid-template-columns:min-content min-content;width:min-content}}@media (min-width:1600px){.store{grid-template-columns:min-content min-content min-content}}.loading-page>img{width:100%}@media (min-width:640px){.loading-page>img{width:300px}}.vacancy{gap:56px}.mini-card{color:#000;gap:12px;text-decoration:none}.mini-card:hover{background-color:var(--color-header-background)}.mini-card .preview{height:100px;object-fit:cover;width:175px}@media (min-width:1200px){.mini-card .preview{height:200px;object-fit:cover;width:350px}}.section.item .preview{gap:39px}.section.item .preview>img{max-height:350px;object-fit:cover;width:100%}@media (min-width:1200px){.section.item .preview>img{max-height:400px;width:500px}}.user-profile>div{gap:25px}.user-profile .avatar{background-color:var(--color-base-tertiary);height:300px;width:300px}.user-profile .username{color:var(--color-base-tertiary)} -/*# sourceMappingURL=main.3c1cb610.css.map*/ \ No newline at end of file diff --git a/frontend/static/frontend/css/main.c8e987ad.css b/frontend/static/frontend/css/main.c8e987ad.css new file mode 100644 index 0000000..e30ce34 --- /dev/null +++ b/frontend/static/frontend/css/main.c8e987ad.css @@ -0,0 +1,2 @@ +@import url(https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;800&display=swap);:root{--color-header-background:#feb198;--color-base-background:#fff5f5;--color-base-primary:#000;--color-base-secondary:#edc881;--color-base-tertiary:#7d5555;--color-footer-primary:#fff;--color-error-text:red}.error{color:red;color:var(--color-error-text)}body{background-color:var(--color-base-background);margin:0;padding:0}h1,h2{margin:0;text-transform:uppercase}h1{font-size:30px}h2{font-size:20px}#root,.App,.page,body,html{height:100%}.page{display:table}@media (min-width:1200px){h1{font-size:80px}h2{font-size:40px}}a,body,button,h1,h2,h3,h4,h5,input,textarea{font-family:Montserrat,sans-serif}.body-text{font-size:16px}@media (min-width:1200px){.body-text{font-size:26px}}.primary{background:var(--color-base-secondary);border:1px solid var(--color-base-tertiary);border-radius:40px;box-sizing:border-box;color:var(--color-base-tertiary);cursor:pointer;font-family:Montserrat,sans-serif;text-align:center;text-decoration:none;text-transform:uppercase;width:fit-content}.primary:hover{color:var(--color-base-primary)}.primary.selected,.primary:hover{border-color:var(--color-base-primary)}.primary.selected{background:var(--color-base-tertiary);color:var(--color-base-secondary)}.primary.large{font-size:40px;font-weight:600;padding:6px 35px}.primary.medium{font-size:20px;font-weight:500;padding:10px 40px}.primary.small{font-size:12px;font-weight:500;padding:7px 20px}@media (min-width:1200px){.primary.large{font-size:80px;font-weight:600;padding:6px 54px}.primary.medium{font-size:40px;font-weight:500;padding:14px 54px}.primary.small{font-size:26px;font-weight:500;padding:10px 29px}}.content-box{margin-left:auto;margin-right:auto;width:300px}.fill-width{width:100%}.align-center,.align-end,.align-start,.horizontal-box,.stretched-box,.vertical-box{display:flex}.stretched-box{flex-direction:row;justify-content:space-between}.vertical-box{flex-direction:column}.horizontal-box{flex-direction:row}.align-end{align-items:flex-end}.align-center{align-items:center}.align-start{align-items:flex-start}.align-left{margin-right:auto}@media (min-width:640px){.content-box{margin-left:auto;margin-right:auto;width:620px}}@media (min-width:1200px){.content-box{margin-left:auto;margin-right:auto;width:1100px}}@media (min-width:1600px){.content-box{margin-left:auto;margin-right:auto;width:1550px}}@media (min-width:1900px){.content-box{margin-left:auto;margin-right:auto;width:1880px}}.header .icon{width:80%}.header .avatar{border-radius:60px;height:60px;width:60px}.header .navigation .primary.small{width:100%}.header .phone-menu{display:table}.header .phone-menu>div{display:table-cell;padding:3px;width:50%}.header{background-color:var(--color-header-background);padding-top:40px}.header,.header .bottom-menu,.header .upper-menu{padding-bottom:20px}.header .upper-menu{gap:60px;padding-top:20px}.header .bottom-menu{border-top:1px solid var(--color-base-primary);padding-top:40px}.header .navigation{gap:20px}.header .menu-button>.avatar{align-items:center;background-color:#fcfcfa}.header .dropdown-menu{position:relative}.header .menu-button{background:none;border:none;cursor:pointer}.header .menu-content{background-color:#333;border:1px solid #fcfcfa;border-radius:5px;display:flex;flex-direction:column;padding:10px;width:max-content}.header .menu-content a,.header .menu-content button{background:none;border:2px outset buttonborder;border-image:none;border-image:initial;color:#fcfcfa;padding:10px 20px;text-decoration:none}.header .menu-content a:hover,.header .menu-content button:hover{background-color:#444}.header .menu-click-area{position:absolute;right:0;top:0}.header .menu-click-area>div{gap:10px}.header .vk-login{padding-top:20px}@media (min-width:1200px){.header .icon,.header .navigation .primary.small{width:auto}.header .avatar{border-radius:100px;height:100px;width:100px}}.login-from-menu{color:#fff}.footer{background-color:var(--color-base-tertiary);padding:30px 20px}.footer,.footer a{color:var(--color-footer-primary)}.footer a{font-family:Montserrat,sans-serif;font-size:20px;font-weight:500}.footer a:hover{color:var(--color-base-secondary)}@media (min-width:1200px){.footer{padding:30px 150px}.footer a{font-size:40px}}section{display:table-row;height:100%;margin:30px 0}.section{margin:0 auto;padding:30px 0}.section.item .preview{gap:39px}.section.item .preview .main-image{max-height:350px;object-fit:cover;width:100%}.section.item .shortDescription{width:100%}.section.item textarea.shortDescription{height:200px}.section.item .action-box,.section.item .information{gap:5px}.section.item .description img{margin-left:5%;margin-right:5%;width:90%}@media (min-width:1200px){.section.item .preview .main-image{max-height:400px;width:500px}}.loading-page>img{width:100%}@media (min-width:640px){.loading-page>img{width:300px}}.editable-image{gap:10px}.editable-label.editable-size-1 *{font-size:30px}.editable-label.editable-size-2 *{font-size:20px}@media (min-width:1200px){.editable-label.editable-size-1 *{font-size:40px}.editable-label.editable-size-2 *{font-size:20px}}.context-buttons-list{gap:5px}.context-button{width:100%}@media (min-width:640px){.context-buttons-list{gap:10px;width:fit-content}}.editable-markdown>textarea{height:200px}.about .button-list{gap:20px}.about .button-list a.primary.medium{width:100%}@media (min-width:640px){.about .button-list a.primary.medium{width:fit-content}}.store{display:flex;flex-direction:column;gap:10px}@media (min-width:640px){.store{grid-gap:39px;display:grid;gap:39px;grid-template-columns:min-content min-content;width:min-content}}@media (min-width:1600px){.store{grid-template-columns:min-content min-content min-content}}.card{background-size:cover;color:#fff;display:flex;margin-left:auto;margin-right:auto;text-decoration:none}.card,.card>div{height:175px;width:250px}.card>div{background:linear-gradient(180deg,#2d0c0c00 68.5%,#2d0c0c)}.card>div:hover{background:linear-gradient(180deg,#2d0c0c00 30.5%,#2d0c0c)}.card>div>div{color:var(--color-base-secondary);height:33px;margin-left:auto;margin-right:auto;text-align:center;width:225px}@media (min-width:640px){.card{margin-left:0;margin-right:0}}@media (min-width:1200px){.card{height:350px;width:500px}.card>div>div{height:66px;width:450px;width:500px}.card>div{background:linear-gradient(180deg,#2d0c0c00 68.5%,#2d0c0c);height:350px;width:500px}}.vacancy{gap:56px}.mini-card{color:#000;gap:12px;text-decoration:none}.mini-card:hover{background-color:var(--color-header-background)}.mini-card .preview{object-fit:cover;width:175px}@media (min-width:1200px){.mini-card .preview{object-fit:cover;width:350px}}.section.user-profile .preview{gap:39px}.section.user-profile .information{gap:5px}.user-profile .avatar{background-color:var(--color-base-tertiary);height:300px;width:300px}.user-profile .username{color:var(--color-base-tertiary)} +/*# sourceMappingURL=main.c8e987ad.css.map*/ \ No newline at end of file diff --git a/frontend/static/frontend/js/main.4a9be667.js b/frontend/static/frontend/js/main.4a9be667.js deleted file mode 100644 index 7e7c21a..0000000 --- a/frontend/static/frontend/js/main.4a9be667.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see main.4a9be667.js.LICENSE.txt */ -(()=>{var e={488:function(e,t,n){e.exports=function(){var e=e||function(e,t){var r;if("undefined"!==typeof window&&window.crypto&&(r=window.crypto),"undefined"!==typeof self&&self.crypto&&(r=self.crypto),"undefined"!==typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!==typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!==typeof n.g&&n.g.crypto&&(r=n.g.crypto),!r)try{r=n(477)}catch(g){}var o=function(){if(r){if("function"===typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(g){}if("function"===typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(g){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},l=a.lib={},s=l.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=l.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var l=0;l>>2]=n[l>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},f=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},p=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},h=l.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,a=this.blockSize,l=i/(4*a),s=(l=t?e.ceil(l):e.max((0|l)-this._minBufferSize,0))*a,c=e.min(4*s,i);if(s){for(var d=0;d>>6-a%4*2;o[i>>>2]|=l<<24-i%4*8,i++}return n.create(o,i)}e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var o=[],i=0;i>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,l=0;l<4&&i+.75*l>>6*(3-l)&63));var s=r.charAt(64);if(s)for(;o.length%4;)o.push(s);return o.join("")},parse:function(e){var t=e.length,n=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i>>7)^(h<<14|h>>>18)^h>>>3,g=u[p-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[p]=m+u[p-7]+v+u[p-16]}var y=r&o^r&i^o&i,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),k=f+((l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25))+(l&c^~l&d)+s[p]+u[p];f=d,d=c,c=l,l=a+k|0,a=i,i=o,o=r,r=k+(b+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+l|0,n[5]=n[5]+c|0,n[6]=n[6]+d|0,n[7]=n[7]+f|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=i._createHelper(c),n.HmacSHA256=i._createHmacHelper(c)}(Math),t.SHA256)}()},240:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=function(e){return"function"===typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,o=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!i)return!1;for(r in e);return"undefined"===typeof r||t.call(e,r)},l=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(o)return o(e,n).value}return e[n]};e.exports=function e(){var t,n,r,o,u,c,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"===typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!==typeof d&&"function"!==typeof d)&&(d={});f{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,u="";function c(e){return e?e.replace(s,u):u}e.exports=function(e,s){if("string"!==typeof e)throw new TypeError("First argument must be a string");if(!e)return[];s=s||{};var d=1,f=1;function p(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function h(){var e={line:d,column:f};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:d,column:f},this.source=s.source}m.prototype.content=e;var g=[];function v(t){var n=new Error(s.source+":"+d+":"+f+": "+t);if(n.reason=t,n.filename=s.source,n.line=d,n.column=f,n.source=e,!s.silent)throw n;g.push(n)}function y(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function b(){y(r)}function k(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;u!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,u===e.charAt(n-1))return v("End of comment missing");var r=e.slice(2,n-2);return f+=2,p(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function x(){var e=h(),n=y(o);if(n){if(w(),!y(i))return v("property missing ':'");var r=y(a),s=e({type:"declaration",property:c(n[0].replace(t,u)),value:r?c(r[0].replace(t,u)):u});return y(l),s}}return b(),function(){var e,t=[];for(k(t);e=x();)!1!==e&&(t.push(e),k(t));return t}()}},730:(e,t,n)=>{"use strict";var r=n(43),o=n(853);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n