diff --git a/common/admin.py b/common/admin.py index 360ba05..8db7c8a 100644 --- a/common/admin.py +++ b/common/admin.py @@ -15,7 +15,7 @@ class ItemDataButtonsInline(admin.TabularInline): class ItemDataAdmin(admin.ModelAdmin): list_display = ('title', "author", 'status', 'created_at', 'updated_at', 'get_link') - search_fields = ('title', 'author') + search_fields = ('title', 'author__username') list_filter = ('collection', 'status') ordering = ('-created_at', '-updated_at', 'id') diff --git a/common/migrations/0009_alter_itemdata_description_and_more.py b/common/migrations/0009_alter_itemdata_description_and_more.py new file mode 100644 index 0000000..07e8b97 --- /dev/null +++ b/common/migrations/0009_alter_itemdata_description_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.16 on 2024-11-25 15:22 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0008_contextbuttontype_host_regex'), + ] + + operations = [ + migrations.AlterField( + model_name='itemdata', + name='description', + field=models.TextField(blank=True, default='', verbose_name='Описание'), + ), + migrations.AlterField( + model_name='itemdata', + name='short_description', + field=models.TextField(default='', max_length=256, verbose_name='Краткое описание'), + ), + ] diff --git a/common/models.py b/common/models.py index b4e2ae0..9bcf091 100644 --- a/common/models.py +++ b/common/models.py @@ -22,6 +22,13 @@ class ItemDataStatus(models.Model): name = models.CharField(max_length=20, primary_key=True) verbose = models.CharField(max_length=20) + @property + def select_data_dict(self) -> typing.Dict[str, str]: + return { + "verbose": self.verbose, + "name": self.name + } + def __str__(self): return self.verbose @@ -34,8 +41,8 @@ class ItemDataStatus(models.Model): class ItemData(models.Model): title = models.CharField(max_length=100, 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='Краткое описание') + description = models.TextField(verbose_name='Описание', blank=True, default="") + short_description = models.TextField(max_length=256, verbose_name='Краткое описание', default="") preview = models.ImageField(upload_to='images/previews/', verbose_name='Превью', null=True, blank=True) collection = models.ForeignKey( @@ -69,13 +76,16 @@ class ItemData(models.Model): @property def dict(self) -> typing.Dict[str, typing.Union[str, int, float, None]]: + preview = self.preview or self.image + if preview: + preview = preview.url return { "id": self.id, "title": self.title, "image": None if not self.image else self.image.url, "description": self.description, "shortDescription": self.short_description, - "preview": None if not self.preview else self.preview.url, + "preview": preview, "createdAt": self.created_at.timestamp(), "updatedAt": self.updated_at.timestamp(), } @@ -96,22 +106,26 @@ class ItemData(models.Model): "shortDescription": self.short_description, "description": self.description, "author": author, - "contextButtons": context_buttons + "contextButtons": context_buttons, + "status": self.status.select_data_dict } @property def card_dict(self) -> typing.Dict[str, typing.Union[str, int, float, None]]: + preview = self.preview or self.image or None + if preview: + preview = preview.url return { "id": self.id, "title": self.title, - "preview": None if not self.preview else self.preview.url + "preview": preview } @property def mini_card_dict(self) -> typing.Dict[str, typing.Union[str, int, float, None]]: card = self.card_dict card.update({ - "status": self.status.verbose, + "status": self.status.select_data_dict, "updatedAt": self.updated_at.timestamp(), "shortDescription": self.short_description }) diff --git a/common/urls.py b/common/urls.py index dde7489..5acbe5a 100644 --- a/common/urls.py +++ b/common/urls.py @@ -7,4 +7,5 @@ urlpatterns = [ 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'), + path('get/available-item-statuses/', views.item_statuses_list, name='available-item-statuses'), ] diff --git a/common/views.py b/common/views.py index 69e2981..a67bf76 100644 --- a/common/views.py +++ b/common/views.py @@ -5,7 +5,7 @@ from django.db.models import QuerySet from django.http import HttpResponse, HttpRequest, JsonResponse from common.exceptions import NovelPlusHttpExceptionResponse -from common.models import ItemData, ContextButtonType +from common.models import ItemData, ContextButtonType, ItemDataCollection, ItemDataStatus from users.models import User from utils import get_request_data, update_context_buttons @@ -50,14 +50,36 @@ def get_item(request: HttpRequest, collection: str, item_id: int) -> HttpRespons def update_item(request): data = get_request_data(request) user: User = request.user - item: ItemData = ItemData.objects.filter( - id=data['id'][0] - ).first() + item: ItemData + + if not user.is_authenticated: + return NovelPlusHttpExceptionResponse(request, "Вы не имеете право на эту операцию", status=401) + + if not data.get("createdData"): + item = ItemData.objects.filter( + id=data['id'][0] + ).first() + else: + created_data: dict = json.loads(data.get("createdData")[0]) + + try: + collection = ItemDataCollection.objects.get(name=created_data["collection"]) + except ItemDataCollection.DoesNotExist: + return NovelPlusHttpExceptionResponse(request, "У вас нет права создавать новую коллекцию", status=403) + + item = ItemData.objects.create( + title=created_data.get("title", "Unnamed"), + author=user, + collection=collection, + status=ItemDataStatus.objects.first(), + is_passed_moderation=True #TODO автомодерация на первых этапах + ) + if item is None: return NovelPlusHttpExceptionResponse(request, "Такого объекта не существует", status=403) try: - if not (user.id == int(data['author'][0]) == item.author.id): + if not (user.id == int(data['author'][0]) == item.author.id or user.is_staff): return NovelPlusHttpExceptionResponse(request, "Вы не имеете право на эту операцию", status=403) except KeyError: return NovelPlusHttpExceptionResponse(request, "Вы не имеете право на эту операцию", status=403) @@ -72,12 +94,17 @@ def update_item(request): return NovelPlusHttpExceptionResponse(request, "Произошла ошибка", 500, repr(e)) elif change == "contextButtons": update_context_buttons(data.get(change)[0], item) + elif change == "status": + try: + item.status = ItemDataStatus.objects.get(name=data.get(change)[0]) + except ItemDataStatus.DoesNotExist: + return NovelPlusHttpExceptionResponse(request, "Такого статуса не существует", status=404) else: setattr(item, change, data.get(change)[0]) item.save() - return JsonResponse({"success": True}) + return JsonResponse({"success": True, "id": item.id}) def context_buttons_list(request): @@ -87,3 +114,14 @@ def context_buttons_list(request): "context_buttons": [cb.verbose for cb in ContextButtonType.objects.all()] } ) + + +def item_statuses_list(request): + return JsonResponse( + { + "success": True, + "item_status": [ + status.select_data_dict for status in ItemDataStatus.objects.all() + ] + } + ) diff --git a/frontend/NovelPlus-frontend b/frontend/NovelPlus-frontend index 4bb343a..7b12f19 160000 --- a/frontend/NovelPlus-frontend +++ b/frontend/NovelPlus-frontend @@ -1 +1 @@ -Subproject commit 4bb343af06b90bf1cefd721246afed702d59d860 +Subproject commit 7b12f197d98d1c549a7c8f180c54987a07fe7ed0 diff --git a/frontend/static/frontend/css/main.908d9b15.css b/frontend/static/frontend/css/main.908d9b15.css new file mode 100644 index 0000000..f071acd --- /dev/null +++ b/frontend/static/frontend/css/main.908d9b15.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}label{font-weight:700}.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 .short_description{width:100%}.section.item textarea.short_description{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}.editable-choice{gap:7px}.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}}.section.store{gap:20px}.section.store .items{display:flex;flex-direction:column;gap:10px}@media (min-width:640px){.section.store .items{grid-gap:39px;display:grid;gap:39px;grid-template-columns:min-content min-content;width:min-content}}@media (min-width:1600px){.section.store .items{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}}.section.vacancy{gap:20px}.section.vacancy .items{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.908d9b15.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 deleted file mode 100644 index e30ce34..0000000 --- a/frontend/static/frontend/css/main.c8e987ad.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:#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.55f5b4b9.js b/frontend/static/frontend/js/main.11488baa.js similarity index 58% rename from frontend/static/frontend/js/main.55f5b4b9.js rename to frontend/static/frontend/js/main.11488baa.js index ee1d24b..7625ef5 100644 --- a/frontend/static/frontend/js/main.55f5b4b9.js +++ b/frontend/static/frontend/js/main.11488baa.js @@ -1,3 +1,3 @@ -/*! For license information please see main.55f5b4b9.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(m){}var o=function(){if(r){if("function"===typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(m){}if("function"===typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(m){}}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,m=u[p-2],v=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[p]=g+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),A=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+A|0,a=i,i=o,o=r,r=A+(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 g(e),b(),t}}function g(e){this.start=e,this.end={line:d,column:f},this.source=s.source}g.prototype.content=e;var m=[];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;m.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 A(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 k(){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(A(t);e=k();)!1!==e&&(t.push(e),A(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