diff --git a/car_inventory/__pycache__/settings.cpython-311.pyc b/car_inventory/__pycache__/settings.cpython-311.pyc index f64d2f3b..cae37f99 100644 Binary files a/car_inventory/__pycache__/settings.cpython-311.pyc and b/car_inventory/__pycache__/settings.cpython-311.pyc differ diff --git a/inventory/__pycache__/admin.cpython-311.pyc b/inventory/__pycache__/admin.cpython-311.pyc index d8302526..32b4af46 100644 Binary files a/inventory/__pycache__/admin.cpython-311.pyc and b/inventory/__pycache__/admin.cpython-311.pyc differ diff --git a/inventory/__pycache__/forms.cpython-311.pyc b/inventory/__pycache__/forms.cpython-311.pyc index 81ac0473..f041ae18 100644 Binary files a/inventory/__pycache__/forms.cpython-311.pyc and b/inventory/__pycache__/forms.cpython-311.pyc differ diff --git a/inventory/__pycache__/models.cpython-311.pyc b/inventory/__pycache__/models.cpython-311.pyc index bf3d139d..6de49907 100644 Binary files a/inventory/__pycache__/models.cpython-311.pyc and b/inventory/__pycache__/models.cpython-311.pyc differ diff --git a/inventory/__pycache__/services.cpython-311.pyc b/inventory/__pycache__/services.cpython-311.pyc index 6a8886ee..cf243eff 100644 Binary files a/inventory/__pycache__/services.cpython-311.pyc and b/inventory/__pycache__/services.cpython-311.pyc differ diff --git a/inventory/__pycache__/urls.cpython-311.pyc b/inventory/__pycache__/urls.cpython-311.pyc index 122bab45..e51a455c 100644 Binary files a/inventory/__pycache__/urls.cpython-311.pyc and b/inventory/__pycache__/urls.cpython-311.pyc differ diff --git a/inventory/__pycache__/utils.cpython-311.pyc b/inventory/__pycache__/utils.cpython-311.pyc index a847d46e..876655e8 100644 Binary files a/inventory/__pycache__/utils.cpython-311.pyc and b/inventory/__pycache__/utils.cpython-311.pyc differ diff --git a/inventory/__pycache__/views.cpython-311.pyc b/inventory/__pycache__/views.cpython-311.pyc index 54ada8d3..689ba4fb 100644 Binary files a/inventory/__pycache__/views.cpython-311.pyc and b/inventory/__pycache__/views.cpython-311.pyc differ diff --git a/inventory/forms.py b/inventory/forms.py index 6e75333a..befa4506 100644 --- a/inventory/forms.py +++ b/inventory/forms.py @@ -25,6 +25,7 @@ from django_ledger.forms.bill import BillModelCreateForm as BillModelCreateFormB from .models import ( Dealer, + DealersMake, # Branch, Vendor, Schedule, @@ -187,6 +188,7 @@ class CarForm( "vendor", ] widgets = { + "id_car_make": forms.Select(attrs={"class": "form-select form-select-sm"}), "receiving_date": forms.DateTimeInput(attrs={"type": "datetime-local"}), "remarks": forms.Textarea(attrs={"rows": 2}), } @@ -930,4 +932,24 @@ class DealerSettingsForm(forms.ModelForm): fields = "__all__" class LeadTransferForm(forms.Form): - transfer_to = forms.ModelChoiceField(label="to",queryset=Staff.objects.all()) \ No newline at end of file + transfer_to = forms.ModelChoiceField(label="to",queryset=Staff.objects.all()) + + +class DealersMakeForm(forms.Form): + car_makes = forms.ModelMultipleChoiceField( + queryset=CarMake.objects.filter(is_sa_import=True), + widget=forms.CheckboxSelectMultiple(attrs={"class": "car-makes-grid"}), + required=True, + label=_("Select Car Makes") + ) + + def __init__(self, *args, **kwargs): + self.dealer = kwargs.pop("dealer", None) # Pass dealer instance + super().__init__(*args, **kwargs) + + def save(self): + if self.dealer: + DealersMake.objects.filter(dealer=self.dealer).delete() + + for car_make in self.cleaned_data["car_makes"]: + DealersMake.objects.create(dealer=self.dealer, car_make=car_make) diff --git a/inventory/migrations/0054_dealersmake.py b/inventory/migrations/0054_dealersmake.py new file mode 100644 index 00000000..669ed228 --- /dev/null +++ b/inventory/migrations/0054_dealersmake.py @@ -0,0 +1,26 @@ +# Generated by Django 5.1.6 on 2025-03-03 16:59 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('inventory', '0053_lead_crn_lead_vrn'), + ] + + operations = [ + migrations.CreateModel( + name='DealersMake', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('added_at', models.DateTimeField(auto_now_add=True)), + ('car_make', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='car_dealers', to='inventory.carmake')), + ('dealer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dealer_makes', to='inventory.dealer')), + ], + options={ + 'unique_together': {('dealer', 'car_make')}, + }, + ), + ] diff --git a/inventory/models.py b/inventory/models.py index 4736bae7..ae8b9f7e 100644 --- a/inventory/models.py +++ b/inventory/models.py @@ -53,7 +53,8 @@ class DealerUserManager(UserManager): return user - +# class DealerMakes(models.Model): +# car_make = models.ManyToManyField(CarMake, verbose_name=_("Car Make"), related_name="dealers") class StaffUserManager(UserManager): @@ -924,6 +925,18 @@ class Dealer(models.Model, LocalizedNameMixin): # return self.parent_dealer if self.parent_dealer else self +class DealersMake(models.Model): + dealer = models.ForeignKey(Dealer, on_delete=models.CASCADE, related_name="dealer_makes") + car_make = models.ForeignKey(CarMake, on_delete=models.CASCADE, related_name="car_dealers") + added_at = models.DateTimeField(auto_now_add=True) + + class Meta: + unique_together = ("dealer", "car_make") # Prevents duplicate entries + + def __str__(self): + return f"{self.dealer.name} - {self.car_make.name}" + + ############################## # Additional staff types for later diff --git a/inventory/services.py b/inventory/services.py index cc782106..2a97bec8 100644 --- a/inventory/services.py +++ b/inventory/services.py @@ -7,7 +7,7 @@ import json from django_ledger.models import EntityModel -from inventory.utils import get_jwt_token +from inventory.utils import get_jwt_token, get_user_type from pyvin import VIN from django.conf import settings from openai import OpenAI @@ -80,12 +80,3 @@ def elm(vin): } print(data) return data if all([x for x in data.values()]) else None - - -def get_ledger_data(request): - data = {} - entity = EntityModel.objects.filter(name=request.user.dealer.name).first() - data['bills'] = entity.get_bills() - data['invoices'] = entity.get_invoices() - data['income'] = entity.get_income_statement() - return data \ No newline at end of file diff --git a/inventory/templatetags/__pycache__/custom_filters.cpython-311.pyc b/inventory/templatetags/__pycache__/custom_filters.cpython-311.pyc index 9c078ef4..5eefe0ce 100644 Binary files a/inventory/templatetags/__pycache__/custom_filters.cpython-311.pyc and b/inventory/templatetags/__pycache__/custom_filters.cpython-311.pyc differ diff --git a/inventory/templatetags/custom_filters.py b/inventory/templatetags/custom_filters.py index 69570a5c..bcd02dac 100644 --- a/inventory/templatetags/custom_filters.py +++ b/inventory/templatetags/custom_filters.py @@ -184,7 +184,7 @@ def income_statement_table(context, io_model, from_date=None, to_date=None): 'tx_digest': io_digest.get_io_data() } -@register.inclusion_tag('django_ledger/financial_statements/tags/cash_flow_statement.html', takes_context=True) +@register.inclusion_tag('ledger/reports/tags/cash_flow_statement.html', takes_context=True) def cash_flow_statement(context, io_model): user_model = context['user'] entity_slug = context['view'].kwargs.get('entity_slug') diff --git a/inventory/urls.py b/inventory/urls.py index 6c6a3dad..83e9fbfa 100644 --- a/inventory/urls.py +++ b/inventory/urls.py @@ -45,6 +45,7 @@ urlpatterns = [ # Dashboards # path("user//settings/", views.UserSettingsView.as_view(), name="user_settings"), path("dealer//settings/", views.DealerSettingsView, name="dealer_settings"), + path("dealer/assign-car-makes/", views.assign_car_makes, name="assign_car_makes"), path("dashboards/manager/", views.ManagerDashboard.as_view(), name="manager_dashboard"), path("dashboards/sales/", views.SalesDashboard.as_view(), name="sales_dashboard"), path("test/", views.TestView.as_view(), name="test"), diff --git a/inventory/utils.py b/inventory/utils.py index da094f10..8d6bfe38 100644 --- a/inventory/utils.py +++ b/inventory/utils.py @@ -846,4 +846,5 @@ def get_local_name(self): """ if get_language() == 'ar': return getattr(self, 'arabic_name', None) - return getattr(self, 'name', None) \ No newline at end of file + return getattr(self, 'name', None) + diff --git a/inventory/views.py b/inventory/views.py index 709b934b..d30cc64b 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -259,57 +259,57 @@ class HomeView(TemplateView): return redirect("welcome") return super().dispatch(request, *args, **kwargs) - def get_context_data(self, **kwargs): - context = super().get_context_data(**kwargs) - dealer = get_user_type(self.request) - - try: - # Fetch car-related statistics - total_cars = models.Car.objects.filter(dealer=dealer).count() - total_reservations = models.CarReservation.objects.filter( - reserved_until__gte=timezone.now() - ).count() - cars_in_house = models.CarLocation.objects.filter( - owner=dealer, - ).count() - cars_outside = total_cars - cars_in_house - - # Fetch financial statistics - stats = models.CarFinance.objects.aggregate( - total_cost_price=Sum("cost_price"), - total_selling_price=Sum("selling_price"), - ) - total_cost_price = stats.get("total_cost_price", 0) or 0 - total_selling_price = stats.get("total_selling_price", 0) or 0 - total_profit = total_selling_price - total_cost_price - - # Prepare context data - context.update({ - "dealer": dealer, - "total_cars": total_cars, - "cars_in_house": cars_in_house, - "cars_outside": cars_outside, - "total_reservations": total_reservations, - "total_cost_price": total_cost_price, - "total_selling_price": total_selling_price, - "total_profit": total_profit, - }) - - except Exception as e: - # Log the error (you can use Django's logging framework) - print(f"Error fetching data: {e}") - # Provide default values in case of an error - context.update({ - "dealer": dealer, - "total_cars": 0, - "cars_in_house": 0, - "cars_outside": 0, - "total_reservations": 0, - "total_cost_price": 0, - "total_selling_price": 0, - "total_profit": 0, - }) - return context + # def get_context_data(self, **kwargs): + # context = super().get_context_data(**kwargs) + # dealer = get_user_type(self.request) + # + # try: + # # Fetch car-related statistics + # total_cars = models.Car.objects.filter(dealer=dealer).count() + # total_reservations = models.CarReservation.objects.filter( + # reserved_until__gte=timezone.now() + # ).count() + # cars_in_house = models.CarLocation.objects.filter( + # owner=dealer, + # ).count() + # cars_outside = total_cars - cars_in_house + # + # # Fetch financial statistics + # stats = models.CarFinance.objects.aggregate( + # total_cost_price=Sum("cost_price"), + # total_selling_price=Sum("selling_price"), + # ) + # total_cost_price = stats.get("total_cost_price", 0) or 0 + # total_selling_price = stats.get("total_selling_price", 0) or 0 + # total_profit = total_selling_price - total_cost_price + # + # # Prepare context data + # context.update({ + # "dealer": dealer, + # "total_cars": total_cars, + # "cars_in_house": cars_in_house, + # "cars_outside": cars_outside, + # "total_reservations": total_reservations, + # "total_cost_price": total_cost_price, + # "total_selling_price": total_selling_price, + # "total_profit": total_profit, + # }) + # + # except Exception as e: + # # Log the error (you can use Django's logging framework) + # print(f"Error fetching data: {e}") + # # Provide default values in case of an error + # context.update({ + # "dealer": dealer, + # "total_cars": 0, + # "cars_in_house": 0, + # "cars_outside": 0, + # "total_reservations": 0, + # "total_cost_price": 0, + # "total_selling_price": 0, + # "total_profit": 0, + # }) + # return context class TestView(TemplateView): template_name = "inventory/cars_list_api.html" @@ -318,9 +318,7 @@ class ManagerDashboard(LoginRequiredMixin, TemplateView): template_name = "dashboards/manager.html" def dispatch(self, request, *args, **kwargs): - if ( - not request.user.is_authenticated - ): + if not request.user.is_authenticated: return redirect("welcome") return super().dispatch(request, *args, **kwargs) @@ -358,6 +356,8 @@ class ManagerDashboard(LoginRequiredMixin, TemplateView): total_leads = models.Lead.objects.filter(dealer=dealer).count() invoices = entity.get_invoices().count() customers = entity.get_customers().count() + purchase_orders = entity.get_purchase_orders().count() + estimates = entity.get_estimates().count() context["dealer"] = dealer context["total_cars"] = total_cars @@ -377,6 +377,13 @@ class ManagerDashboard(LoginRequiredMixin, TemplateView): context['damaged_cars'] = damaged_cars context['transfer_cars'] = transfer_cars context['car'] = json.dumps(car_by_make) + context['customers'] = customers + context['staff'] = staff + context['total_leads'] = total_leads + context['invoices'] = invoices + context['estimates'] = estimates + context['purchase_orders'] = purchase_orders + return context @@ -428,10 +435,10 @@ class SalesDashboard(LoginRequiredMixin, TemplateView): context['damaged_cars'] = damaged_cars context['transfer_cars'] = transfer_cars context['car'] = json.dumps(car_by_make) - context['customers'] = customers - context['staff'] = staff - context['total_leads'] = total_leads - context['invoices'] = invoices + # context['customers'] = customers + # context['staff'] = staff + # context['total_leads'] = total_leads + # context['invoices'] = invoices return context @@ -1206,13 +1213,20 @@ class DealerDetailView(LoginRequiredMixin, DetailView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) dealer = self.object + car_makes = models.CarMake.objects.filter(car_dealers__dealer=dealer) # Fetch current staff count from the annotated queryset staff_count = dealer.staff_count + cars_count = models.Car.objects.filter(dealer=dealer).count() # Get the quota value dynamically quota_dict = get_user_quota(dealer.user) - allowed_users = quota_dict.get("Users", None) # Fetch quota or default to None + + allowed_users = quota_dict.get("Users", None) + allowed_cars = quota_dict.get("Cars", None) + context["car_makes"] = car_makes context["staff_count"] = staff_count + context["cars_count"] = cars_count context["allowed_users"] = allowed_users + context["allowed_cars"] = allowed_cars context["quota_display"] = f"{staff_count}/{allowed_users}" if allowed_users is not None else "N/A" return context @@ -2296,6 +2310,7 @@ class EstimatePreviewView(DetailView): template_name = "sales/estimates/estimate_preview.html" def get_context_data(self, **kwargs): + dealer = get_user_type(self.request) estimate = kwargs.get("object") if estimate.get_itemtxs_data(): data = get_financial_values(estimate) @@ -2305,6 +2320,7 @@ class EstimatePreviewView(DetailView): kwargs["discount_amount"] = data["discount_amount"] kwargs["vat"] = data["vat"] kwargs["additional_services"] = data["additional_services"] + kwargs["dealer"] = dealer return super().get_context_data(**kwargs) @@ -2342,6 +2358,7 @@ def estimate_mark_as(request, pk): messages.error(request, _("Estimate is not ready for cancelation")) return redirect("estimate_detail", pk=estimate.pk) estimate.mark_as_canceled() + messages.success(request, _("Estimate canceled successfully.")) estimate.save() messages.success(request, "Estimate marked as " + mark.upper()) @@ -3478,53 +3495,50 @@ class OrderListView(ListView): # email @login_required def send_email_view(request, pk): + dealer = get_user_type(request) estimate = get_object_or_404(EstimateModel, pk=pk) - if request.method == "POST": - if not estimate.get_itemtxs_data()[0]: - messages.error(request, _("Estimate has no items")) - return redirect("estimate_detail", pk=estimate.pk) - send_email( - "manager@tenhal.com", - request.POST.get("to"), - request.POST.get("subject"), - request.POST.get("message"), - ) - estimate.mark_as_review() - messages.success(request, _("Email sent successfully!")) + if not estimate.get_itemtxs_data()[0]: + messages.error(request, _("Quotation has no items")) return redirect("estimate_detail", pk=estimate.pk) - link = reverse_lazy("estimate_preview", kwargs={"pk": estimate.pk}) + + link = request.build_absolute_uri(reverse_lazy("estimate_preview", kwargs={"pk": estimate.pk})) + msg = f""" السلام عليكم Dear {estimate.customer.customer_name}, - أود أن أشارككم تقدير المشروع الذي ناقشناه. يرجى العثور على الوثيقة التفصيلية للمقترح المرفقة. + أود أن أشارككم عرض السعر. - I hope this email finds you well. I wanted to share with you the estimate for the project we discussed. Please find the detailed estimate document attached. + I wanted to share with you the quotation. - يرجى مراجعة المقترح وإعلامي إذا كانت لديك أي أسئلة أو مخاوف. إذا كانت كل شيء يبدو جيدًا، يمكننا المضي قدمًا في المشروع. + يرجى مراجعة عرض السعر وإعلامي إذا كانت لديك أي استفسارات أو ملاحظات. إذا كان كل شيء على ما يرام، يمكننا المتابعة في الإجراءات. - Please review the estimate and let me know if you have any questions or concerns. If everything looks good, we can proceed with the project. + Please review the quotation and let me know if you have any questions or concerns. If everything looks good, we can proceed with the process. - Estimate Link: + رابط عرض السعر: {link} - شكراً لاهتمامكم بهذا الأمر. - Thank you for your attention to this matter. تحياتي, Best regards, - [Your Name] - [Your Position] - [Your Company] - [Your Contact Information] + {dealer.get_local_name} + {dealer.phone_number} + هيكل | Haikal """ - return render( - request, - "sales/estimates/estimate_send.html", - {"estimate": estimate, "message": msg}, + + send_email( + settings.DEFAULT_FROM_EMAIL, + estimate.customer.email, + _("Quotation"), + msg, ) + estimate.mark_as_review() + messages.success(request, _("Email sent successfully!")) + + return redirect("estimate_detail", pk=estimate.pk) + # errors def custom_page_not_found_view(request, exception): @@ -3896,4 +3910,20 @@ def schedule_cancel(request,pk): schedule.save() response = HttpResponse() response.status_code = 200 - return response \ No newline at end of file + return response + + +@login_required +def assign_car_makes(request): + dealer = get_user_type(request) + if request.method == "POST": + form = forms.DealersMakeForm(request.POST, dealer=dealer) + if form.is_valid(): + form.save() + return redirect("dealer_detail", pk=dealer.pk) + else: + # Pre-fill the form with existing selections + existing_car_makes = models.DealersMake.objects.filter(dealer=dealer).values_list("car_make", flat=True) + form = forms.DealersMakeForm(initial={"car_makes": existing_car_makes}, dealer=dealer) + + return render(request, "dealers/assign_car_makes.html", {"form": form}) \ No newline at end of file diff --git a/locale/ar/LC_MESSAGES/django.mo b/locale/ar/LC_MESSAGES/django.mo index 559450ab..37660f33 100644 Binary files a/locale/ar/LC_MESSAGES/django.mo and b/locale/ar/LC_MESSAGES/django.mo differ diff --git a/locale/ar/LC_MESSAGES/django.po b/locale/ar/LC_MESSAGES/django.po index d39ebe55..d532beb2 100644 --- a/locale/ar/LC_MESSAGES/django.po +++ b/locale/ar/LC_MESSAGES/django.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#: inventory/models.py:1808 +#: inventory/models.py:1825 #: templates/ledger/reports/tags/balance_sheet_statement.html:20 #: templates/ledger/reports/tags/income_statement.html:15 #, fuzzy @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-27 15:22+0300\n" +"POT-Creation-Date: 2025-03-03 10:03+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,7 +23,7 @@ msgstr "" "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" #: api/models.py:6 inventory/models.py:344 inventory/tables.py:12 -#: templates/inventory/car_detail.html:60 templates/inventory/car_form.html:33 +#: templates/inventory/car_detail.html:60 templates/inventory/car_form.html:31 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:31 #: templates/inventory/car_inventory.html:53 #: templates/inventory/car_list.html:67 templates/inventory/car_list.html:69 @@ -37,18 +37,6 @@ msgstr "" msgid "VIN" msgstr "رقم الهيكل" -#: car_inventory/settings.py:162 car_inventory/settings.py:326 -#: templates/crm/opportunities/opportunity_detail.html:42 -#: templates/index.html:100 templates/index.html:104 -#: templates/ledger/coa_accounts/account_detail.html:101 -#: templates/ledger/coa_accounts/account_detail.html:102 -#: templates/sales/invoices/invoice_detail.html:107 -#: templates/sales/invoices/invoice_detail.html:159 -#: templates/sales/invoices/invoice_detail.html:161 -#: templates/subscriptions/subscription_plan.html:41 -msgid "SAR" -msgstr "ريال" - #: car_inventory/settings.py:259 #: venv/lib/python3.11/site-packages/appointments/settings.py:136 msgid "English" @@ -63,80 +51,80 @@ msgstr "العربية" msgid "Haikal" msgstr "هيكل" -#: inventory/forms.py:311 inventory/models.py:692 +#: inventory/forms.py:306 inventory/models.py:692 #: templates/inventory/car_detail.html:123 msgid "Custom Date" msgstr "تاريخ البطاقة الجمركية" -#: inventory/forms.py:381 +#: inventory/forms.py:376 msgid "Both exterior and interior colors must be selected." msgstr "يجب اختيار اللونين الخارجي والداخلي." -#: inventory/forms.py:459 inventory/models.py:1147 inventory/models.py:1481 +#: inventory/forms.py:454 inventory/models.py:1150 inventory/models.py:1498 #: templates/account/email_change.html:5 templates/account/email_change.html:9 msgid "Email Address" msgstr "عنوان البريد الإلكتروني" -#: inventory/forms.py:463 +#: inventory/forms.py:458 #: venv/lib/python3.11/site-packages/appointment/views.py:424 #: venv/lib/python3.11/site-packages/django/db/models/fields/__init__.py:1915 msgid "Email address" msgstr "عنوان البريد الإلكتروني" -#: inventory/forms.py:464 templates/crm/leads/lead_list.html:39 -#: templates/customers/customer_list.html:35 +#: inventory/forms.py:459 templates/crm/leads/lead_list.html:39 +#: templates/customers/customer_list.html:34 #: templates/vendors/vendors_list.html:49 msgid "email" msgstr "البريد الإلكتروني" -#: inventory/forms.py:470 +#: inventory/forms.py:465 msgid "You must add an email." msgstr "يجب إضافة بريد إلكتروني." -#: inventory/forms.py:475 inventory/forms.py:479 +#: inventory/forms.py:470 inventory/forms.py:474 #: templates/account/login.html:35 templates/account/login.html:37 #: venv/lib/python3.11/site-packages/django_ledger/forms/auth.py:15 msgid "Password" msgstr "كلمة المرور" -#: inventory/forms.py:486 inventory/forms.py:503 inventory/forms.py:578 -#: inventory/forms.py:599 inventory/forms.py:617 inventory/forms.py:632 +#: inventory/forms.py:481 inventory/forms.py:498 inventory/forms.py:573 +#: inventory/forms.py:594 inventory/forms.py:612 inventory/forms.py:627 #: venv/lib/python3.11/site-packages/django/forms/fields.py:95 msgid "This field is required." msgstr "هذا الحقل مطلوب." -#: inventory/forms.py:492 inventory/forms.py:496 +#: inventory/forms.py:487 inventory/forms.py:491 msgid "Confirm Password" msgstr "تأكيد كلمة المرور" -#: inventory/forms.py:509 +#: inventory/forms.py:504 msgid "I accept the Terms and Privacy Policy" msgstr "أوافق على الشروط وسياسة الخصوصية" -#: inventory/forms.py:518 +#: inventory/forms.py:513 msgid "You must accept the terms and privacy policy." msgstr "يجب أن تقبل الشروط وسياسة الخصوصية." -#: inventory/forms.py:528 +#: inventory/forms.py:523 msgid "An account with this email already exists." msgstr "يوجد بالفعل حساب بهذا البريد الإلكتروني." -#: inventory/forms.py:536 +#: inventory/forms.py:531 msgid "Passwords do not match." msgstr "كلمات المرور غير متطابقة." -#: inventory/forms.py:542 inventory/models.py:299 inventory/models.py:641 -#: inventory/models.py:654 inventory/models.py:951 inventory/models.py:1113 -#: inventory/models.py:1141 templates/administration/manage_service.html:22 +#: inventory/forms.py:537 inventory/models.py:299 inventory/models.py:641 +#: inventory/models.py:654 inventory/models.py:951 inventory/models.py:1116 +#: inventory/models.py:1144 templates/administration/manage_service.html:22 #: templates/administration/service_list.html:23 #: templates/administration/staff_list.html:34 #: templates/administration/user_profile.html:226 -#: templates/customers/customer_list.html:32 +#: templates/customers/customer_list.html:31 #: templates/groups/group_detail.html:47 templates/groups/group_detail.html:60 #: templates/items/expenses/expenses_list.html:20 #: templates/items/service/service_list.html:20 #: templates/ledger/bank_accounts/bank_account_list.html:18 -#: templates/organizations/organization_list.html:46 +#: templates/organizations/organization_list.html:43 #: templates/plans/order_detail_table.html:8 templates/plans/order_list.html:21 #: templates/representatives/representative_list.html:17 #: templates/users/user_detail.html:47 templates/vendors/vendors_list.html:46 @@ -149,32 +137,32 @@ msgstr "كلمات المرور غير متطابقة." msgid "Name" msgstr "الاسم" -#: inventory/forms.py:546 inventory/models.py:868 inventory/models.py:1478 +#: inventory/forms.py:541 inventory/models.py:868 inventory/models.py:1495 msgid "English Name" msgstr "الاسم بالإنجليزية" -#: inventory/forms.py:551 +#: inventory/forms.py:546 msgid "Please enter an English Name." msgstr "يرجى إدخال اسم باللغة الإنجليزية." -#: inventory/forms.py:556 inventory/forms.py:560 inventory/models.py:300 +#: inventory/forms.py:551 inventory/forms.py:555 inventory/models.py:300 #: inventory/models.py:642 inventory/models.py:655 inventory/models.py:867 -#: inventory/models.py:952 inventory/models.py:1114 inventory/models.py:1142 -#: inventory/models.py:1477 templates/users/user_detail.html:48 +#: inventory/models.py:952 inventory/models.py:1117 inventory/models.py:1145 +#: inventory/models.py:1494 templates/users/user_detail.html:48 msgid "Arabic Name" msgstr "الاسم بالعربية" -#: inventory/forms.py:565 +#: inventory/forms.py:560 msgid "Please enter an Arabic name." msgstr "يرجى إدخال اسم باللغة العربية." -#: inventory/forms.py:570 inventory/models.py:869 inventory/models.py:953 -#: inventory/models.py:1088 inventory/models.py:1119 inventory/models.py:1146 -#: inventory/models.py:1166 inventory/models.py:1480 +#: inventory/forms.py:565 inventory/models.py:869 inventory/models.py:953 +#: inventory/models.py:1091 inventory/models.py:1122 inventory/models.py:1149 +#: inventory/models.py:1169 inventory/models.py:1497 #: templates/administration/staff_index.html:123 #: templates/crm/leads/lead_list.html:45 #: templates/crm/opportunities/opportunity_detail.html:193 -#: templates/customers/customer_list.html:40 +#: templates/customers/customer_list.html:39 #: templates/customers/view_customer.html:73 #: templates/users/user_detail.html:51 templates/vendors/view_vendor.html:52 #: venv/lib/python3.11/site-packages/appointment/templates/administration/staff_index.html:369 @@ -182,12 +170,12 @@ msgstr "يرجى إدخال اسم باللغة العربية." msgid "Phone Number" msgstr "رقم الهاتف" -#: inventory/forms.py:573 templates/administration/display_appointment.html:55 +#: inventory/forms.py:568 templates/administration/display_appointment.html:55 #: templates/appointment/appointment_client_information.html:57 #: templates/crm/leads/lead_detail.html:88 #: templates/dealers/dealer_detail.html:80 #: templates/organizations/organization_detail.html:10 -#: templates/organizations/organization_list.html:59 +#: templates/organizations/organization_list.html:62 #: templates/representatives/representative_detail.html:9 #: templates/representatives/representative_list.html:19 #: templates/vendors/vendors_list.html:54 @@ -196,42 +184,42 @@ msgstr "رقم الهاتف" msgid "Phone" msgstr "الهاتف" -#: inventory/forms.py:579 +#: inventory/forms.py:574 msgid "Phone number must be in the format 05xxxxxxxx" msgstr "يجب أن يكون رقم الهاتف بالصيغة 05xxxxxxxx" -#: inventory/forms.py:588 templates/organizations/organization_detail.html:8 -#: templates/organizations/organization_list.html:49 +#: inventory/forms.py:583 templates/organizations/organization_detail.html:8 +#: templates/organizations/organization_list.html:48 msgid "CRN" msgstr "رقم السجل التجاري" -#: inventory/forms.py:592 inventory/models.py:860 inventory/models.py:1116 -#: inventory/models.py:1472 +#: inventory/forms.py:587 inventory/models.py:860 inventory/models.py:1119 +#: inventory/models.py:1204 inventory/models.py:1489 msgid "Commercial Registration Number" msgstr "رقم السجل التجاري" -#: inventory/forms.py:606 templates/organizations/organization_detail.html:9 -#: templates/organizations/organization_list.html:54 +#: inventory/forms.py:601 templates/organizations/organization_detail.html:9 +#: templates/organizations/organization_list.html:55 msgid "VRN" msgstr "الرقم الضريبي" -#: inventory/forms.py:610 inventory/models.py:865 inventory/models.py:1118 -#: inventory/models.py:1475 +#: inventory/forms.py:605 inventory/models.py:865 inventory/models.py:1121 +#: inventory/models.py:1207 inventory/models.py:1492 msgid "VAT Registration Number" msgstr "رقم التسجيل في ضريبة القيمة المضافة" -#: inventory/forms.py:618 +#: inventory/forms.py:613 msgid "VAT Registration Number must be 15 characters." msgstr "يجب أن يكون رقم التسجيل الضريبي مكونًا من 15 حرفًا." -#: inventory/forms.py:623 inventory/models.py:871 inventory/models.py:1091 -#: inventory/models.py:1121 inventory/models.py:1149 inventory/models.py:1483 +#: inventory/forms.py:618 inventory/models.py:871 inventory/models.py:1094 +#: inventory/models.py:1124 inventory/models.py:1152 inventory/models.py:1500 #: templates/crm/leads/lead_detail.html:118 -#: templates/customers/customer_list.html:50 +#: templates/customers/customer_list.html:49 #: templates/customers/view_customer.html:68 #: templates/dealers/dealer_detail.html:64 #: templates/organizations/organization_detail.html:11 -#: templates/organizations/organization_list.html:64 +#: templates/organizations/organization_list.html:69 #: templates/representatives/representative_detail.html:10 #: templates/vendors/vendors_list.html:64 templates/vendors/view_vendor.html:58 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/customer/tags/customer_table.html:10 @@ -239,33 +227,34 @@ msgstr "يجب أن يكون رقم التسجيل الضريبي مكونًا msgid "Address" msgstr "العنوان" -#: inventory/forms.py:672 inventory/models.py:1681 +#: inventory/forms.py:667 inventory/models.py:1698 msgid "cash" msgstr "نقداً" -#: inventory/forms.py:673 inventory/models.py:1682 +#: inventory/forms.py:668 inventory/models.py:1699 msgid "credit" msgstr "دائن" -#: inventory/forms.py:674 inventory/models.py:1683 +#: inventory/forms.py:669 inventory/models.py:1700 #: templates/inventory/car_detail.html:165 #: templates/inventory/transfer_car.html:23 msgid "transfer" msgstr "نقل" -#: inventory/forms.py:675 inventory/models.py:1684 +#: inventory/forms.py:670 inventory/models.py:1701 msgid "debit" msgstr "مدين" -#: inventory/forms.py:676 inventory/models.py:1685 +#: inventory/forms.py:671 inventory/models.py:1702 msgid "SADAD" msgstr "سداد" -#: inventory/forms.py:835 inventory/forms.py:852 inventory/models.py:1097 +#: inventory/forms.py:833 inventory/forms.py:850 inventory/models.py:1100 +#: inventory/models.py:1171 #: templates/crm/opportunities/opportunity_form.html:22 #: templates/sales/estimates/estimate_detail.html:133 #: templates/sales/estimates/estimate_list.html:15 -#: templates/sales/estimates/estimate_preview.html:265 +#: templates/sales/estimates/estimate_preview.html:146 #: templates/sales/estimates/sale_order_preview.html:227 #: templates/sales/invoices/invoice_list.html:16 #: templates/sales/journals/journal_list.html:16 @@ -278,25 +267,26 @@ msgstr "سداد" msgid "Customer" msgstr "العميل" -#: inventory/forms.py:841 inventory/forms.py:851 +#: inventory/forms.py:839 inventory/forms.py:849 #: templates/ledger/bills/bill_detail.html:104 -#: templates/sales/estimates/estimate_preview.html:267 +#: templates/sales/estimates/estimate_preview.html:148 #: templates/sales/estimates/sale_order_preview.html:229 #: templates/sales/invoices/invoice_detail.html:123 #: venv/lib/python3.11/site-packages/django_ledger/models/mixins.py:974 msgid "Terms" msgstr "الشروط" -#: inventory/forms.py:846 inventory/forms.py:850 inventory/models.py:1070 +#: inventory/forms.py:844 inventory/forms.py:848 inventory/models.py:1073 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/estimate/includes/estimate_table.html:11 msgid "Title" msgstr "العنوان" #: inventory/models.py:118 inventory/models.py:413 inventory/models.py:491 #: inventory/models.py:536 inventory/models.py:689 inventory/models.py:704 -#: inventory/models.py:748 inventory/models.py:1355 +#: inventory/models.py:748 inventory/models.py:1372 #: templates/crm/leads/lead_list.html:33 #: templates/crm/opportunities/opportunity_form.html:35 +#: templates/dashboards/manager.html:53 #: templates/inventory/transfer_details.html:70 msgid "Car" msgstr "سيارة" @@ -382,7 +372,7 @@ msgstr "مسودة" msgid "Approved" msgstr "تمت الموافقة" -#: inventory/models.py:278 inventory/models.py:1010 +#: inventory/models.py:278 inventory/models.py:1013 #: templates/crm/leads/lead_detail.html:55 #: templates/crm/leads/lead_list.html:121 test.txt:46 msgid "Pending" @@ -397,7 +387,7 @@ msgstr "تم القبول" msgid "Success" msgstr "ناجحة" -#: inventory/models.py:281 templates/sales/estimates/estimate_preview.html:245 +#: inventory/models.py:281 msgid "Reject" msgstr "رفض" @@ -405,8 +395,8 @@ msgstr "رفض" msgid "Cancelled" msgstr "ملغى" -#: inventory/models.py:286 templates/dashboards/manager.html:21 -#: templates/dashboards/manager.html:333 templates/dashboards/sales.html:21 +#: inventory/models.py:286 templates/dashboards/manager.html:104 +#: templates/dashboards/manager.html:236 templates/dashboards/sales.html:21 #: templates/dashboards/sales.html:333 #: templates/inventory/car_inventory.html:99 #: templates/inventory/car_list_view.html:86 @@ -415,8 +405,8 @@ msgstr "ملغى" msgid "Available" msgstr "متاح" -#: inventory/models.py:287 templates/dashboards/manager.html:27 -#: templates/dashboards/manager.html:334 templates/dashboards/sales.html:27 +#: inventory/models.py:287 templates/dashboards/manager.html:110 +#: templates/dashboards/manager.html:237 templates/dashboards/sales.html:27 #: templates/dashboards/sales.html:334 #: templates/inventory/car_inventory.html:101 #: templates/inventory/car_list_view.html:88 @@ -424,32 +414,32 @@ msgstr "متاح" msgid "Sold" msgstr "تم البيع" -#: inventory/models.py:288 templates/dashboards/manager.html:45 -#: templates/dashboards/manager.html:337 templates/dashboards/sales.html:45 +#: inventory/models.py:288 templates/dashboards/manager.html:128 +#: templates/dashboards/manager.html:240 templates/dashboards/sales.html:45 #: templates/dashboards/sales.html:337 #: templates/inventory/car_inventory.html:103 msgid "Hold" msgstr "في الانتظار" -#: inventory/models.py:289 templates/dashboards/manager.html:51 -#: templates/dashboards/manager.html:338 templates/dashboards/sales.html:51 +#: inventory/models.py:289 templates/dashboards/manager.html:134 +#: templates/dashboards/manager.html:241 templates/dashboards/sales.html:51 #: templates/dashboards/sales.html:338 #: templates/inventory/car_inventory.html:107 #: templates/inventory/cars_list_api.html:23 msgid "Damaged" msgstr "تالف" -#: inventory/models.py:290 templates/dashboards/manager.html:33 -#: templates/dashboards/manager.html:335 templates/dashboards/sales.html:33 -#: templates/dashboards/sales.html:335 templates/index.html:24 +#: inventory/models.py:290 templates/dashboards/manager.html:116 +#: templates/dashboards/manager.html:238 templates/dashboards/sales.html:33 +#: templates/dashboards/sales.html:335 #: templates/inventory/car_inventory.html:105 #: templates/inventory/car_list_view.html:87 #: templates/inventory/cars_list_api.html:20 msgid "Reserved" msgstr "محجوزة" -#: inventory/models.py:291 templates/dashboards/manager.html:39 -#: templates/dashboards/manager.html:336 templates/dashboards/sales.html:39 +#: inventory/models.py:291 templates/dashboards/manager.html:122 +#: templates/dashboards/manager.html:239 templates/dashboards/sales.html:39 #: templates/dashboards/sales.html:336 #: templates/inventory/car_list_view.html:89 #: templates/inventory/car_location_form.html:8 @@ -458,7 +448,7 @@ msgstr "محجوزة" msgid "Transfer" msgstr "نقل" -#: inventory/models.py:294 inventory/models.py:1009 +#: inventory/models.py:294 inventory/models.py:1012 #: templates/crm/leads/lead_detail.html:53 #: templates/crm/leads/lead_list.html:119 #: templates/inventory/car_inventory.html:68 test.txt:33 @@ -520,7 +510,7 @@ msgstr "المعرض" #: inventory/models.py:317 templates/inventory/transfer_preview.html:229 #: templates/ledger/bills/bill_detail.html:213 -#: templates/sales/estimates/estimate_preview.html:275 +#: templates/sales/estimates/estimate_preview.html:156 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/bill_detail.html:94 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/tags/bill_item_formset.html:18 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/estimate/includes/estimate_item_table.html:8 @@ -539,15 +529,15 @@ msgstr "العنصر" #: inventory/models.py:336 inventory/models.py:337 #: templates/sales/estimates/estimate_detail.html:206 -#: templates/sales/estimates/estimate_preview.html:297 +#: templates/sales/estimates/estimate_preview.html:178 #: templates/sales/estimates/sale_order_preview.html:266 #: templates/sales/invoices/invoice_detail.html:271 msgid "Additional Services" msgstr "الخدمات الإضافية" -#: inventory/models.py:355 inventory/models.py:1491 +#: inventory/models.py:355 inventory/models.py:1508 #: templates/inventory/car_detail.html:101 -#: templates/inventory/car_form.html:135 +#: templates/inventory/car_form.html:133 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:166 #: templates/ledger/bills/bill_list.html:46 #: venv/lib/python3.11/site-packages/django_ledger/models/bill.py:364 @@ -557,7 +547,7 @@ msgstr "الخدمات الإضافية" msgid "Vendor" msgstr "المورد" -#: inventory/models.py:363 inventory/models.py:1179 inventory/tables.py:13 +#: inventory/models.py:363 inventory/models.py:1185 inventory/tables.py:13 #: templates/inventory/car_list_view.html:64 #: templates/inventory/car_list_view.html:109 #: templates/inventory/cars_list_api.html:32 @@ -568,7 +558,7 @@ msgstr "المورد" msgid "Make" msgstr "الصانع" -#: inventory/models.py:371 inventory/models.py:1186 inventory/tables.py:14 +#: inventory/models.py:371 inventory/models.py:1192 inventory/tables.py:14 #: templates/inventory/car_list_view.html:73 #: templates/inventory/car_list_view.html:110 #: templates/inventory/cars_list_api.html:33 @@ -579,8 +569,8 @@ msgstr "الصانع" msgid "Model" msgstr "الموديل" -#: inventory/models.py:373 inventory/models.py:1189 inventory/tables.py:15 -#: templates/inventory/car_form.html:56 +#: inventory/models.py:373 inventory/models.py:1195 inventory/tables.py:15 +#: templates/inventory/car_form.html:54 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:61 #: templates/inventory/car_inventory.html:54 #: templates/inventory/car_list_view.html:79 @@ -593,7 +583,7 @@ msgid "Year" msgstr "السنة" #: inventory/models.py:380 inventory/tables.py:16 -#: templates/inventory/car_form.html:66 +#: templates/inventory/car_form.html:64 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:121 msgid "Series" msgstr "السلسلة" @@ -604,8 +594,8 @@ msgstr "السلسلة" msgid "Trim" msgstr "الفئة" -#: inventory/models.py:394 inventory/models.py:1215 inventory/models.py:1363 -#: inventory/models.py:1414 inventory/tables.py:23 +#: inventory/models.py:394 inventory/models.py:1227 inventory/models.py:1380 +#: inventory/models.py:1431 inventory/tables.py:23 #: templates/crm/leads/lead_detail.html:51 #: templates/crm/opportunities/opportunity_detail.html:91 #: templates/inventory/car_detail.html:84 @@ -628,7 +618,7 @@ msgid "Status" msgstr "الحالة" #: inventory/models.py:400 inventory/tables.py:11 -#: templates/inventory/car_detail.html:88 templates/inventory/car_form.html:148 +#: templates/inventory/car_detail.html:88 templates/inventory/car_form.html:146 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:183 #: templates/inventory/car_list.html:177 msgid "Stock Type" @@ -636,21 +626,21 @@ msgstr "نوع المخزون" #: inventory/models.py:402 inventory/models.py:509 #: templates/inventory/car_detail.html:106 -#: templates/inventory/car_form.html:186 +#: templates/inventory/car_form.html:184 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:232 #: templates/inventory/car_list.html:200 msgid "Remarks" msgstr "ملاحظات" #: inventory/models.py:403 inventory/tables.py:18 -#: templates/inventory/car_detail.html:92 templates/inventory/car_form.html:160 +#: templates/inventory/car_detail.html:92 templates/inventory/car_form.html:158 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:198 #: templates/inventory/car_list.html:191 templates/inventory/car_list.html:192 msgid "Mileage" msgstr "عدد الكيلومترات" #: inventory/models.py:404 templates/inventory/car_detail.html:96 -#: templates/inventory/car_form.html:173 +#: templates/inventory/car_form.html:171 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:215 msgid "Receiving Date" msgstr "تاريخ الاستلام" @@ -660,7 +650,7 @@ msgid "Hash" msgstr "رمز" #: inventory/models.py:414 templates/header.html:85 -#: templates/sales/estimates/estimate_form.html:16 +#: templates/sales/estimates/estimate_form.html:38 msgid "Cars" msgstr "السيارات" @@ -679,7 +669,7 @@ msgstr "تاريخ النقل" #: inventory/models.py:508 templates/inventory/transfer_preview.html:230 #: templates/ledger/bills/bill_detail.html:214 #: templates/sales/estimates/estimate_detail.html:174 -#: templates/sales/estimates/estimate_preview.html:276 +#: templates/sales/estimates/estimate_preview.html:157 #: templates/sales/estimates/sale_order_preview.html:242 #: templates/sales/invoices/invoice_detail.html:240 #: venv/lib/python3.11/site-packages/django_ledger/models/items.py:1068 @@ -694,7 +684,7 @@ msgstr "تاريخ النقل" msgid "Quantity" msgstr "الكمية" -#: inventory/models.py:517 inventory/models.py:726 inventory/models.py:1488 +#: inventory/models.py:517 inventory/models.py:726 inventory/models.py:1505 msgid "Created At" msgstr "تاريخ الإنشاء" @@ -783,7 +773,7 @@ msgstr "البطاقة الجمركية" msgid "Custom Cards" msgstr "البطاقات الجمركية" -#: inventory/models.py:710 inventory/models.py:1371 +#: inventory/models.py:710 inventory/models.py:1388 msgid "Owner" msgstr "المالك" @@ -791,7 +781,7 @@ msgstr "المالك" msgid "Dealer who owns the car." msgstr "التاجر الذي يمتلك السيارة." -#: inventory/models.py:717 inventory/models.py:989 +#: inventory/models.py:717 inventory/models.py:992 msgid "Showroom" msgstr "صالة العرض" @@ -845,10 +835,10 @@ msgstr "التسجيل" msgid "Registrations" msgstr "تسجيل السيارات" -#: inventory/models.py:766 inventory/models.py:955 inventory/models.py:1093 -#: inventory/models.py:1126 inventory/models.py:1220 inventory/models.py:1376 -#: inventory/models.py:1396 inventory/models.py:1418 inventory/models.py:1441 -#: inventory/models.py:1458 templates/crm/leads/lead_detail.html:100 +#: inventory/models.py:766 inventory/models.py:955 inventory/models.py:1096 +#: inventory/models.py:1129 inventory/models.py:1232 inventory/models.py:1393 +#: inventory/models.py:1413 inventory/models.py:1435 inventory/models.py:1458 +#: inventory/models.py:1475 templates/crm/leads/lead_detail.html:100 #: templates/sales/estimates/estimate_list.html:18 #: templates/sales/invoices/invoice_list.html:19 #: templates/sales/journals/journal_list.html:19 @@ -858,14 +848,14 @@ msgstr "تسجيل السيارات" msgid "Created" msgstr "تاريخ الإنشاء" -#: inventory/models.py:767 inventory/models.py:956 inventory/models.py:1094 -#: inventory/models.py:1127 inventory/models.py:1222 inventory/models.py:1377 -#: inventory/models.py:1397 inventory/models.py:1419 inventory/models.py:1442 +#: inventory/models.py:767 inventory/models.py:956 inventory/models.py:1097 +#: inventory/models.py:1130 inventory/models.py:1234 inventory/models.py:1394 +#: inventory/models.py:1414 inventory/models.py:1436 inventory/models.py:1459 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/chart_of_accounts/includes/coa_card.html:41 msgid "Updated" msgstr "تم التحديث" -#: inventory/models.py:874 inventory/models.py:1124 inventory/models.py:1486 +#: inventory/models.py:874 inventory/models.py:1127 inventory/models.py:1503 msgid "Logo" msgstr "الشعار" @@ -915,68 +905,69 @@ msgstr "عميل" msgid "Staff Type" msgstr "نوع الموظف" -#: inventory/models.py:978 inventory/models.py:979 +#: inventory/models.py:981 inventory/models.py:982 #: templates/crm/opportunities/opportunity_detail.html:234 #: templates/crm/opportunities/opportunity_form.html:70 -#: templates/users/user_form.html:4 templates/users/user_list.html:5 +#: templates/dashboards/manager.html:17 templates/users/user_form.html:4 +#: templates/users/user_list.html:5 msgid "Staff" msgstr "الموظفون" -#: inventory/models.py:987 +#: inventory/models.py:990 msgid "Referrals" msgstr "إحالات" -#: inventory/models.py:988 inventory/models.py:1035 +#: inventory/models.py:991 inventory/models.py:1038 msgid "WhatsApp" msgstr "واتساب" -#: inventory/models.py:990 +#: inventory/models.py:993 msgid "TikTok" msgstr "تيك توك" -#: inventory/models.py:991 +#: inventory/models.py:994 msgid "Instagram" msgstr "إنستغرام" -#: inventory/models.py:992 +#: inventory/models.py:995 msgid "X" msgstr "إكس" -#: inventory/models.py:993 +#: inventory/models.py:996 msgid "Facebook" msgstr "فيسبوك" -#: inventory/models.py:994 +#: inventory/models.py:997 msgid "Motory" msgstr "موتري" -#: inventory/models.py:995 +#: inventory/models.py:998 msgid "Influencers" msgstr "المؤثرون" -#: inventory/models.py:996 +#: inventory/models.py:999 msgid "Youtube" msgstr "يوتيوب" -#: inventory/models.py:997 +#: inventory/models.py:1000 msgid "Campaign" msgstr "حملة" -#: inventory/models.py:1001 +#: inventory/models.py:1004 msgid "Walk In" msgstr "زيارة مباشرة" -#: inventory/models.py:1002 +#: inventory/models.py:1005 msgid "Toll Free" msgstr "رقم مجاني" -#: inventory/models.py:1003 +#: inventory/models.py:1006 #: venv/lib/python3.11/site-packages/django_ledger/models/mixins.py:112 msgid "Website" msgstr "الموقع الإلكتروني" -#: inventory/models.py:1004 inventory/models.py:1034 inventory/models.py:1083 -#: inventory/models.py:1165 inventory/models.py:1422 +#: inventory/models.py:1007 inventory/models.py:1037 inventory/models.py:1086 +#: inventory/models.py:1168 inventory/models.py:1439 #: templates/account/login.html:28 templates/account/login.html:30 #: templates/administration/display_appointment.html:49 #: templates/administration/manage_staff_personal_info.html:29 @@ -989,7 +980,7 @@ msgstr "الموقع الإلكتروني" #: templates/dealers/dealer_detail.html:74 #: templates/groups/group_detail.html:61 #: templates/sales/estimates/estimate_detail.html:137 -#: templates/sales/estimates/estimate_preview.html:266 +#: templates/sales/estimates/estimate_preview.html:147 #: templates/sales/estimates/sale_order_preview.html:228 #: templates/vendors/view_vendor.html:55 #: venv/lib/python3.11/site-packages/appointment/templates/administration/display_appointment.html:45 @@ -1000,29 +991,29 @@ msgstr "الموقع الإلكتروني" msgid "Email" msgstr "البريد الإلكتروني" -#: inventory/models.py:1005 +#: inventory/models.py:1008 msgid "Form" msgstr "نموذج" -#: inventory/models.py:1011 templates/crm/leads/lead_detail.html:57 +#: inventory/models.py:1014 templates/crm/leads/lead_detail.html:57 #: templates/crm/leads/lead_list.html:123 msgid "In Progress" msgstr "قيد التنفيذ" -#: inventory/models.py:1012 templates/crm/leads/lead_detail.html:59 +#: inventory/models.py:1015 templates/crm/leads/lead_detail.html:59 #: templates/crm/leads/lead_list.html:125 msgid "Qualified" msgstr "مؤهل" -#: inventory/models.py:1013 templates/crm/leads/lead_list.html:127 +#: inventory/models.py:1016 templates/crm/leads/lead_list.html:127 msgid "Contacted" msgstr "تم الاتصال" -#: inventory/models.py:1014 +#: inventory/models.py:1017 msgid "Converted" msgstr "تم التحويل" -#: inventory/models.py:1015 templates/crm/leads/lead_detail.html:61 +#: inventory/models.py:1018 templates/crm/leads/lead_detail.html:61 #: templates/crm/leads/lead_list.html:129 #: templates/sales/estimates/estimate_detail.html:73 #: templates/sales/estimates/estimate_detail.html:156 @@ -1036,269 +1027,274 @@ msgstr "تم التحويل" msgid "Canceled" msgstr "ملغى" -#: inventory/models.py:1019 +#: inventory/models.py:1022 msgid "Mr" msgstr "السيد" -#: inventory/models.py:1020 +#: inventory/models.py:1023 msgid "Mrs" msgstr "السيدة" -#: inventory/models.py:1021 +#: inventory/models.py:1024 msgid "Ms" msgstr "الآنسة" -#: inventory/models.py:1022 +#: inventory/models.py:1025 msgid "Miss" msgstr "الآنسة" -#: inventory/models.py:1023 +#: inventory/models.py:1026 msgid "Dr" msgstr "الدكتور" -#: inventory/models.py:1024 +#: inventory/models.py:1027 msgid "Prof" msgstr "الأستاذ" -#: inventory/models.py:1025 +#: inventory/models.py:1028 msgid "Prince" msgstr "الأمير" -#: inventory/models.py:1026 +#: inventory/models.py:1029 msgid "Princess" msgstr "الأميرة" -#: inventory/models.py:1027 +#: inventory/models.py:1030 msgid "Company" msgstr "الشركة" -#: inventory/models.py:1028 +#: inventory/models.py:1031 msgid "N/A" msgstr "غير متوفر" -#: inventory/models.py:1032 +#: inventory/models.py:1035 msgid "Call" msgstr "مكالمة" -#: inventory/models.py:1033 +#: inventory/models.py:1036 msgid "SMS" msgstr "رسالة نصية" -#: inventory/models.py:1036 +#: inventory/models.py:1039 msgid "Visit" msgstr "زيارة" -#: inventory/models.py:1037 templates/inventory/car_form.html:23 +#: inventory/models.py:1040 templates/inventory/car_form.html:22 msgid "Add Car" msgstr "إضافة سيارة" -#: inventory/models.py:1038 +#: inventory/models.py:1041 msgid "Sale Car" msgstr "بيع سيارة" -#: inventory/models.py:1039 templates/inventory/reserve_car.html:6 +#: inventory/models.py:1042 templates/inventory/reserve_car.html:6 #: templates/inventory/reserve_car.html:9 msgid "Reserve Car" msgstr "حجز السيارة" -#: inventory/models.py:1040 templates/inventory/transfer_car.html:4 +#: inventory/models.py:1043 templates/inventory/transfer_car.html:4 msgid "Transfer Car" msgstr "نقل السيارة" -#: inventory/models.py:1041 +#: inventory/models.py:1044 msgid "Remove Car" msgstr "إزالة السيارة" -#: inventory/models.py:1042 +#: inventory/models.py:1045 #: templates/crm/opportunities/opportunity_detail.html:19 #: templates/sales/estimates/estimate_form.html:5 -#: templates/sales/estimates/estimate_form.html:9 +#: templates/sales/estimates/estimate_form.html:32 msgid "Create Quotation" msgstr "إنشاء عرض" -#: inventory/models.py:1043 +#: inventory/models.py:1046 msgid "Cancel Quotation" msgstr "إلغاء العرض" -#: inventory/models.py:1044 +#: inventory/models.py:1047 msgid "Create Order" msgstr "إنشاء طلب" -#: inventory/models.py:1045 +#: inventory/models.py:1048 msgid "Cancel Order" msgstr "إلغاء الطلب" -#: inventory/models.py:1046 templates/sales/estimates/estimate_detail.html:89 +#: inventory/models.py:1049 templates/sales/estimates/estimate_detail.html:89 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/invoice/invoice_create.html:24 #: venv/lib/python3.11/site-packages/django_ledger/views/invoice.py:68 msgid "Create Invoice" msgstr "إنشاء فاتورة" -#: inventory/models.py:1047 +#: inventory/models.py:1050 msgid "Cancel Invoice" msgstr "إلغاء الفاتورة" -#: inventory/models.py:1051 +#: inventory/models.py:1054 msgid "Prospect" msgstr "العميل المحتمل" -#: inventory/models.py:1052 +#: inventory/models.py:1055 msgid "Proposal" msgstr "عرض" -#: inventory/models.py:1053 +#: inventory/models.py:1056 msgid "Negotiation" msgstr "مفاوضات" -#: inventory/models.py:1054 +#: inventory/models.py:1057 msgid "Closed Won" msgstr "مغلقة - ناجحة" -#: inventory/models.py:1055 +#: inventory/models.py:1058 msgid "Closed Lost" msgstr "مغلقة - خسارة" -#: inventory/models.py:1059 +#: inventory/models.py:1062 msgid "Low" msgstr "منخفض" -#: inventory/models.py:1060 +#: inventory/models.py:1063 msgid "Medium" msgstr "متوسط" -#: inventory/models.py:1061 +#: inventory/models.py:1064 msgid "High" msgstr "مرتفع" -#: inventory/models.py:1072 inventory/models.py:1163 +#: inventory/models.py:1075 inventory/models.py:1166 #: templates/administration/manage_staff_personal_info.html:18 msgid "First Name" msgstr "الاسم الأول" -#: inventory/models.py:1074 +#: inventory/models.py:1077 msgid "Middle Name" msgstr "اسم الأب" -#: inventory/models.py:1076 inventory/models.py:1164 +#: inventory/models.py:1079 inventory/models.py:1167 #: templates/administration/manage_staff_personal_info.html:24 msgid "Last Name" msgstr "اسم العائلة" -#: inventory/models.py:1078 +#: inventory/models.py:1081 msgid "Male" msgstr "ذكر" -#: inventory/models.py:1078 +#: inventory/models.py:1081 msgid "Female" msgstr "أنثى" -#: inventory/models.py:1080 +#: inventory/models.py:1083 msgid "Gender" msgstr "الجنس" -#: inventory/models.py:1082 +#: inventory/models.py:1085 msgid "Date of Birth" msgstr "تاريخ الميلاد" -#: inventory/models.py:1085 templates/customers/customer_list.html:45 +#: inventory/models.py:1088 templates/customers/customer_list.html:44 msgid "National ID" msgstr "رقم الهوية الوطنية" -#: inventory/models.py:1098 templates/customers/customer_form.html:4 +#: inventory/models.py:1101 templates/customers/customer_form.html:4 #: templates/customers/customer_list.html:4 #: templates/customers/customer_list.html:5 #: templates/customers/customer_list.html:9 +#: templates/dashboards/manager.html:27 msgid "Customers" msgstr "العملاء" -#: inventory/models.py:1130 +#: inventory/models.py:1133 inventory/models.py:1171 msgid "Organization" msgstr "شركة" -#: inventory/models.py:1131 templates/header.html:188 -#: templates/organizations/organization_list.html:4 +#: inventory/models.py:1134 templates/header.html:188 #: templates/organizations/organization_list.html:5 -#: templates/organizations/organization_list.html:12 +#: templates/organizations/organization_list.html:8 +#: templates/organizations/organization_list.html:14 msgid "Organizations" msgstr "الشركات" -#: inventory/models.py:1144 +#: inventory/models.py:1147 #: templates/representatives/representative_detail.html:8 #: templates/representatives/representative_list.html:18 msgid "ID Number" msgstr "رقم الهوية" -#: inventory/models.py:1154 +#: inventory/models.py:1157 msgid "Representative" msgstr "ممثل شركة" -#: inventory/models.py:1155 templates/header.html:196 +#: inventory/models.py:1158 templates/header.html:196 #: templates/representatives/representative_list.html:3 #: templates/representatives/representative_list.html:6 msgid "Representatives" msgstr "ممثلي الشركات" -#: inventory/models.py:1192 templates/crm/leads/lead_list.html:63 +#: inventory/models.py:1171 +msgid "Lead Type" +msgstr "نوع العميل المتوقع" + +#: inventory/models.py:1198 templates/crm/leads/lead_list.html:63 msgid "Source" msgstr "المصدر" -#: inventory/models.py:1195 templates/crm/leads/lead_list.html:69 +#: inventory/models.py:1201 templates/crm/leads/lead_list.html:69 msgid "Channel" msgstr "القناة" -#: inventory/models.py:1197 +#: inventory/models.py:1209 msgid "address" msgstr "العنوان" -#: inventory/models.py:1204 +#: inventory/models.py:1216 msgid "Assigned" msgstr "مُعين" -#: inventory/models.py:1210 +#: inventory/models.py:1222 msgid "Priority" msgstr "الأولوية" -#: inventory/models.py:1225 +#: inventory/models.py:1237 msgid "Lead" msgstr "فرصة" -#: inventory/models.py:1226 templates/crm/leads/lead_list.html:3 +#: inventory/models.py:1238 templates/crm/leads/lead_list.html:3 #: templates/crm/leads/lead_list.html:7 templates/crm/leads/lead_send.html:5 -#: test.txt:21 +#: templates/dashboards/manager.html:22 test.txt:21 msgid "Leads" msgstr "الفرص" -#: inventory/models.py:1324 +#: inventory/models.py:1341 msgid "Old Status" msgstr "الحالة القديمة" -#: inventory/models.py:1327 +#: inventory/models.py:1344 msgid "New Status" msgstr "الحالة الجديدة" -#: inventory/models.py:1332 +#: inventory/models.py:1349 msgid "Changed At" msgstr "تم التغيير في" -#: inventory/models.py:1335 +#: inventory/models.py:1352 msgid "Lead Status History" msgstr "تاريخ حالة العميل المحتمل" -#: inventory/models.py:1336 +#: inventory/models.py:1353 msgid "Lead Status Histories" msgstr "تواريخ حالات العملاء المحتملين" -#: inventory/models.py:1344 +#: inventory/models.py:1361 msgid "Probability must be between 0 and 100." msgstr "يجب أن تكون الاحتمالية بين 0 و 100." -#: inventory/models.py:1358 templates/crm/leads/lead_list.html:75 +#: inventory/models.py:1375 templates/crm/leads/lead_list.html:75 #: templates/crm/opportunities/opportunity_detail.html:98 #: templates/crm/opportunities/opportunity_form.html:48 msgid "Stage" msgstr "المرحلة" -#: inventory/models.py:1375 +#: inventory/models.py:1392 #: templates/crm/opportunities/opportunity_detail.html:267 #: templates/crm/opportunities/opportunity_form.html:79 #: ⁨templates/crm/opportunities/opportunity_list copy.html⁩:100 @@ -1307,27 +1303,27 @@ msgstr "المرحلة" msgid "Closing Date" msgstr "تاريخ الإغلاق" -#: inventory/models.py:1378 +#: inventory/models.py:1395 msgid "Closed" msgstr "مغلقة" -#: inventory/models.py:1381 +#: inventory/models.py:1398 msgid "Opportunity" msgstr "فرصة" -#: inventory/models.py:1382 +#: inventory/models.py:1399 #: ⁨templates/crm/opportunities/opportunity_list copy.html⁩:8 #: templates/crm/opportunities/opportunity_list.html:8 msgid "Opportunities" msgstr "الفرص" -#: inventory/models.py:1392 inventory/models.py:1400 +#: inventory/models.py:1409 inventory/models.py:1417 #: templates/account/snippets/already_logged_in.html:8 #: templates/crm/leads/lead_detail.html:226 msgid "Note" msgstr "ملاحظة" -#: inventory/models.py:1401 inventory/models.py:1437 +#: inventory/models.py:1418 inventory/models.py:1454 #: templates/crm/leads/lead_detail.html:137 #: templates/crm/leads/lead_detail.html:213 #: templates/crm/leads/lead_detail.html:388 @@ -1338,32 +1334,32 @@ msgstr "ملاحظة" msgid "Notes" msgstr "ملاحظات" -#: inventory/models.py:1410 +#: inventory/models.py:1427 msgid "From Email" msgstr "من البريد الإلكتروني" -#: inventory/models.py:1411 +#: inventory/models.py:1428 msgid "To Email" msgstr "إلى البريد الإلكتروني" -#: inventory/models.py:1412 +#: inventory/models.py:1429 msgid "Subject" msgstr "الموضوع" -#: inventory/models.py:1413 inventory/models.py:1456 +#: inventory/models.py:1430 inventory/models.py:1473 msgid "Message" msgstr "رسالة" -#: inventory/models.py:1423 templates/crm/leads/lead_detail.html:138 +#: inventory/models.py:1440 templates/crm/leads/lead_detail.html:138 #: templates/crm/leads/lead_detail.html:266 msgid "Emails" msgstr "رسائل البريد الإلكتروني" -#: inventory/models.py:1435 +#: inventory/models.py:1452 msgid "Activity Type" msgstr "نوع النشاط" -#: inventory/models.py:1445 templates/crm/leads/lead_detail.html:136 +#: inventory/models.py:1462 templates/crm/leads/lead_detail.html:136 #: templates/dealers/activity_log.html:11 #: venv/lib/python3.11/site-packages/django_ledger/models/closing_entry.py:384 #: venv/lib/python3.11/site-packages/django_ledger/models/journal_entry.py:388 @@ -1373,82 +1369,82 @@ msgstr "نوع النشاط" msgid "Activity" msgstr "النشاط" -#: inventory/models.py:1446 templates/crm/leads/lead_detail.html:166 +#: inventory/models.py:1463 templates/crm/leads/lead_detail.html:166 #: templates/header.html:458 msgid "Activities" msgstr "الأنشطة" -#: inventory/models.py:1457 +#: inventory/models.py:1474 msgid "Is Read" msgstr "تمت قراءته" -#: inventory/models.py:1461 +#: inventory/models.py:1478 msgid "Notification" msgstr "إشعار" -#: inventory/models.py:1462 templates/crm/notifications_history.html:6 +#: inventory/models.py:1479 templates/crm/notifications_history.html:6 #: templates/notifications.html:13 msgid "Notifications" msgstr "الإشعارات" -#: inventory/models.py:1479 templates/vendors/view_vendor.html:49 +#: inventory/models.py:1496 templates/vendors/view_vendor.html:49 msgid "Contact Person" msgstr "الشخص المسؤول" -#: inventory/models.py:1492 templates/vendors/vendor_form.html:4 +#: inventory/models.py:1509 templates/vendors/vendor_form.html:4 #: templates/vendors/vendors_list.html:4 templates/vendors/vendors_list.html:5 #: templates/vendors/vendors_list.html:12 msgid "Vendors" msgstr "الموردين" -#: inventory/models.py:1691 inventory/models.py:1721 +#: inventory/models.py:1708 inventory/models.py:1738 msgid "amount" msgstr "المبلغ" -#: inventory/models.py:1694 +#: inventory/models.py:1711 msgid "method" msgstr "طريقة" -#: inventory/models.py:1697 +#: inventory/models.py:1714 msgid "reference number" msgstr "رقم المرجع" -#: inventory/models.py:1699 +#: inventory/models.py:1716 msgid "date" msgstr "التاريخ" -#: inventory/models.py:1709 +#: inventory/models.py:1726 msgid "payment" msgstr "الدفعة" -#: inventory/models.py:1710 templates/header.html:145 +#: inventory/models.py:1727 templates/header.html:145 msgid "payments" msgstr "المدفوعات" -#: inventory/models.py:1723 +#: inventory/models.py:1740 msgid "reason" msgstr "السبب" -#: inventory/models.py:1724 +#: inventory/models.py:1741 msgid "refund date" msgstr "تاريخ الاسترداد" -#: inventory/models.py:1727 +#: inventory/models.py:1744 msgid "refund" msgstr "استرداد" -#: inventory/models.py:1728 +#: inventory/models.py:1745 msgid "refunds" msgstr "استردادات" -#: inventory/models.py:1752 templates/sales/estimates/estimate_preview.html:257 +#: inventory/models.py:1769 #: venv/lib/python3.11/site-packages/django_ledger/models/entity.py:3145 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/estimate/includes/card_estimate.html:9 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/estimate/includes/estimate_table.html:9 msgid "Estimate" msgstr "تقدير" -#: inventory/models.py:1758 templates/customers/view_customer.html:148 +#: inventory/models.py:1775 templates/customers/view_customer.html:148 #: templates/plans/create_order.html:29 #: templates/sales/invoices/invoice_create.html:5 #: templates/sales/invoices/invoice_detail.html:68 @@ -1723,7 +1719,7 @@ msgstr "العمر" msgid "success" msgstr "ناجحة" -#: inventory/utils.py:53 templates/inventory/car_form.html:374 +#: inventory/utils.py:53 templates/inventory/car_form.html:372 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:427 msgid "error" msgstr "خطأ" @@ -1737,255 +1733,267 @@ msgstr "نسيت كلمة المرور؟" msgid "Car reserved successfully." msgstr "تم حجز السيارة بنجاح." -#: inventory/views.py:496 +#: inventory/views.py:513 msgid "VIN number exists" msgstr "رقم الهيكل موجود مسبقاً" -#: inventory/views.py:689 templates/dashboards/manager.html:113 +#: inventory/views.py:706 templates/dashboards/manager.html:49 #: templates/dashboards/sales.html:113 templates/inventory/car_inventory.html:5 #: templates/inventory/inventory_stats.html:5 msgid "inventory" msgstr "المخزون" -#: inventory/views.py:903 +#: inventory/views.py:920 msgid "Car finance details saved successfully." msgstr "تم حفظ تفاصيل المالية للسيارة بنجاح." -#: inventory/views.py:927 +#: inventory/views.py:944 msgid "Car finance details updated successfully." msgstr "تم تحديث تفاصيل المالية للسيارة بنجاح." -#: inventory/views.py:956 +#: inventory/views.py:973 msgid "Car updated successfully." msgstr "تم تحديث السيارة بنجاح" -#: inventory/views.py:968 +#: inventory/views.py:985 msgid "Car deleted successfully." msgstr "تم حذف السيارة بنجاح." -#: inventory/views.py:1044 +#: inventory/views.py:1061 msgid "Car transfer canceled successfully." msgstr "تم إلغاء نقل السيارة بنجاح." -#: inventory/views.py:1061 +#: inventory/views.py:1078 msgid "Car transfer approved successfully." msgstr "تمت الموافقة على نقل السيارة بنجاح." -#: inventory/views.py:1072 +#: inventory/views.py:1089 msgid "Car transfer rejected successfully." msgstr "تم رفض نقل السيارة بنجاح." -#: inventory/views.py:1084 +#: inventory/views.py:1101 msgid "Car Transfer Completed successfully." msgstr "تم إكمال نقل السيارة بنجاح." -#: inventory/views.py:1116 +#: inventory/views.py:1133 msgid "Custom Card added successfully." msgstr "تم إضافة البطاقة الجمركية بنجاح." -#: inventory/views.py:1136 +#: inventory/views.py:1153 msgid "Registration added successfully." msgstr "تم إلغاء الحجز بنجاح." -#: inventory/views.py:1145 +#: inventory/views.py:1162 msgid "This car is already reserved." msgstr "هذه السيارة محجوزة بالفعل." -#: inventory/views.py:1165 +#: inventory/views.py:1182 msgid "Reservation renewed successfully." msgstr "تم تجديد الحجز بنجاح" -#: inventory/views.py:1173 +#: inventory/views.py:1190 msgid "Reservation canceled successfully." msgstr "تم إلغاء الحجز بنجاح." -#: inventory/views.py:1178 +#: inventory/views.py:1195 msgid "Invalid action." msgstr "إجراء غير صالح." -#: inventory/views.py:1182 +#: inventory/views.py:1199 msgid "Invalid request method." msgstr "طريقة الطلب غير صالحة" -#: inventory/views.py:1216 +#: inventory/views.py:1233 msgid "Dealer updated successfully." msgstr "تم تحديث المعرض بنجاح." -#: inventory/views.py:1223 templates/header.html:181 +#: inventory/views.py:1240 templates/header.html:181 msgid "customers" msgstr "العملاء" -#: inventory/views.py:1302 +#: inventory/views.py:1318 msgid "Customer with this email already exists." msgstr "عميل بهذا البريد الإلكتروني موجود بالفعل." -#: inventory/views.py:1327 +#: inventory/views.py:1342 msgid "Customer created successfully." msgstr "تم إنشاء العميل بنجاح." -#: inventory/views.py:1334 +#: inventory/views.py:1349 msgid "Please correct the errors below." msgstr "يرجى تصحيح الأخطاء أدناه." -#: inventory/views.py:1373 +#: inventory/views.py:1386 msgid "Customer updated successfully." msgstr "تم تحديث العميل بنجاح." -#: inventory/views.py:1390 +#: inventory/views.py:1407 msgid "Customer deleted successfully." msgstr "تم حذف العميل بنجاح." -#: inventory/views.py:1421 +#: inventory/views.py:1438 msgid "Vendor created successfully." msgstr "تم إنشاء المورد بنجاح." -#: inventory/views.py:1439 +#: inventory/views.py:1456 msgid "Vendor updated successfully." msgstr "تم تحديث المورد بنجاح" -#: inventory/views.py:1447 +#: inventory/views.py:1464 msgid "Vendor deleted successfully." msgstr "تم حذف المورد بنجاح." -#: inventory/views.py:1476 +#: inventory/views.py:1493 msgid "Group created successfully." msgstr "تم إنشاء المجموعة بنجاح." -#: inventory/views.py:1497 +#: inventory/views.py:1514 msgid "Group updated successfully." msgstr "تم تحديث المجموعة بنجاح." -#: inventory/views.py:1509 +#: inventory/views.py:1526 msgid "Group deleted successfully." msgstr "تم حذف المجموعة بنجاح." -#: inventory/views.py:1520 +#: inventory/views.py:1537 msgid "Permission added successfully." msgstr "تمت إضافة الإذن بنجاح." -#: inventory/views.py:1538 +#: inventory/views.py:1555 msgid "Group added successfully." msgstr "تمت إضافة المجموعة بنجاح." -#: inventory/views.py:1573 +#: inventory/views.py:1590 msgid "User created successfully." msgstr "تم إنشاء المستخدم بنجاح." -#: inventory/views.py:1581 +#: inventory/views.py:1598 msgid "" "The user quota for staff members is not defined. Please contact support." msgstr "لم يتم تحديد الحصة المخصصة لأعضاء الفريق. يرجى الاتصال بالدعم." -#: inventory/views.py:1586 +#: inventory/views.py:1603 msgid "" "You have reached the maximum number of staff users allowed for your plan." msgstr "لقد وصلت إلى الحد الأقصى لعدد أعضاء الفريق المسموح به في خطتك." -#: inventory/views.py:1616 +#: inventory/views.py:1634 msgid "User updated successfully." msgstr "تم تحديث المستخدم بنجاح" -#: inventory/views.py:1652 +#: inventory/views.py:1670 msgid "User deleted successfully." msgstr "تم حذف المستخدم بنجاح." -#: inventory/views.py:1697 +#: inventory/views.py:1715 msgid "An organization with this email already exists." msgstr "توجد بالفعل منظمة بهذا البريد الإلكتروني." -#: inventory/views.py:1723 inventory/views.py:1760 +#: inventory/views.py:1742 inventory/views.py:1780 msgid "Organization created successfully." msgstr "تم إنشاء المنظمة بنجاح." -#: inventory/views.py:1778 +#: inventory/views.py:1800 msgid "Organization deleted successfully." msgstr "تم حذف المنظمة بنجاح." -#: inventory/views.py:2301 +#: inventory/views.py:1803 +msgid "Unable to delete organization" +msgstr "غير قادر على حذف المنظمة" + +#: inventory/views.py:2327 msgid "Estimate is not ready for review" msgstr "العرض غير جاهز للمراجعة." -#: inventory/views.py:2307 +#: inventory/views.py:2333 msgid "Estimate is not ready for approval" msgstr "العرض غير جاهز للموافقة." -#: inventory/views.py:2310 +#: inventory/views.py:2336 msgid "Estimate approved successfully." msgstr "تمت الموافقة على العرض بنجاح." -#: inventory/views.py:2313 +#: inventory/views.py:2339 msgid "Estimate is not ready for rejection" msgstr "العرض غير جاهز للرفض." -#: inventory/views.py:2316 inventory/views.py:2326 +#: inventory/views.py:2342 inventory/views.py:2353 msgid "Estimate canceled successfully." msgstr "تم إلغاء العرض بنجاح." -#: inventory/views.py:2319 +#: inventory/views.py:2345 msgid "Estimate is not ready for completion" msgstr "العرض غير جاهز للإكمال." -#: inventory/views.py:2323 +#: inventory/views.py:2349 msgid "Estimate is not ready for cancelation" msgstr "العرض غير جاهز للإلغاء." -#: inventory/views.py:2801 +#: inventory/views.py:2847 msgid "Note deleted successfully." msgstr "تم حذف الملاحظة بنجاح." -#: inventory/views.py:2892 +#: inventory/views.py:2937 msgid "Email Draft successfully!" msgstr "تم حفظ مسودة البريد الإلكتروني بنجاح!" -#: inventory/views.py:2917 inventory/views.py:3453 +#: inventory/views.py:2962 inventory/views.py:3529 msgid "Email sent successfully!" msgstr "تم إرسال البريد الإلكتروني بنجاح!" -#: inventory/views.py:3043 +#: inventory/views.py:3088 msgid "Opportunity deleted successfully." msgstr "تم حذف الفرصة بنجاح." -#: inventory/views.py:3077 +#: inventory/views.py:3122 msgid "Notification marked as read." msgstr "تم تمييز الإشعار كمقروء." -#: inventory/views.py:3095 +#: inventory/views.py:3140 msgid "Service created successfully." msgstr "تم إنشاء الخدمة بنجاح." -#: inventory/views.py:3112 +#: inventory/views.py:3157 msgid "Service updated successfully." msgstr "تم تحديث الخدمة بنجاح." -#: inventory/views.py:3228 inventory/views.py:3253 +#: inventory/views.py:3273 inventory/views.py:3298 msgid "Bill updated successfully." msgstr "تم تحديث الفاتورة بنجاح." -#: inventory/views.py:3280 +#: inventory/views.py:3325 msgid "Bill is already approved." msgstr "تمت الموافقة على الفاتورة مسبقًا." -#: inventory/views.py:3284 +#: inventory/views.py:3329 msgid "Bill marked as approved successfully." msgstr "تم تحديد الفاتورة كموافقة بنجاح." -#: inventory/views.py:3294 +#: inventory/views.py:3339 msgid "Bill is already paid." msgstr "تم دفع الفاتورة مسبقًا." -#: inventory/views.py:3303 +#: inventory/views.py:3348 msgid "Bill marked as paid successfully." msgstr "تم تحديد الفاتورة كمدفوعة بنجاح." -#: inventory/views.py:3305 +#: inventory/views.py:3350 msgid "Amount paid is not equal to amount due." msgstr "المبلغ المدفوع لا يساوي المبلغ المستحق." -#: inventory/views.py:3443 -msgid "Estimate has no items" -msgstr "التقدير لا يحتوي على أي عناصر." +#: inventory/views.py:3493 +msgid "Quotation has no items" +msgstr "عرض السعر لا يحتوي على أي عناصر" -#: inventory/views.py:3644 templates/header.html:286 +#: inventory/views.py:3524 templates/customers/view_customer.html:126 +#: templates/sales/estimates/estimate_detail.html:62 +#: templates/sales/estimates/estimate_preview.html:138 +#: templates/sales/estimates/estimate_send.html:5 +#: templates/sales/sales_list.html:117 +msgid "Quotation" +msgstr "عرض سعر" + +#: inventory/views.py:3690 templates/header.html:286 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/unit/unit_detail.html:23 #: venv/lib/python3.11/site-packages/django_ledger/views/entity.py:210 msgid "Dashboard" @@ -2061,12 +2069,11 @@ msgstr "تأكيد" #: templates/organizations/organization_form.html:14 #: templates/representatives/representative_form.html:12 #: templates/sales/estimates/estimate_detail.html:99 -#: templates/sales/estimates/estimate_form.html:44 -#: templates/sales/estimates/estimate_preview.html:225 -#: templates/sales/estimates/estimate_preview.html:244 +#: templates/sales/estimates/estimate_form.html:66 +#: templates/sales/estimates/estimate_send.html:26 #: templates/sales/journals/journal_form.html:19 #: templates/two_factor/_wizard_actions.html:5 -#: templates/users/user_form.html:36 templates/users/user_group_form.html:28 +#: templates/users/user_form.html:41 templates/users/user_group_form.html:28 #: templates/vendors/vendor_form.html:38 #: venv/lib/python3.11/site-packages/appointment/templates/modal/event_details_modal.html:22 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/bills/bill_create.html:37 @@ -2150,8 +2157,8 @@ msgid "Re-send Verification" msgstr "إعادة إرسال التحقق" #: templates/account/email.html:51 templates/administration/staff_list.html:48 -#: templates/sales/estimates/estimate_form.html:31 -#: templates/sales/estimates/estimate_form.html:81 +#: templates/sales/estimates/estimate_form.html:53 +#: templates/sales/estimates/estimate_form.html:103 #: templates/sales/sales_list.html:206 #: venv/lib/python3.11/site-packages/appointment/templates/administration/staff_list.html:52 msgid "Remove" @@ -2689,13 +2696,13 @@ msgid "Password does not match" msgstr "كلمة المرور غير متطابقة" #: templates/account/signup-wizard.html:246 -#: templates/inventory/car_form.html:605 +#: templates/inventory/car_form.html:603 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:654 msgid "Please Wait" msgstr "الرجاء الإنتظار" #: templates/account/signup-wizard.html:247 -#: templates/inventory/car_form.html:606 +#: templates/inventory/car_form.html:604 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:655 msgid "Loading" msgstr "تحميل" @@ -2793,7 +2800,7 @@ msgstr "" #: templates/inventory/transfer_details.html:59 #: templates/inventory/transfer_preview.html:219 #: templates/ledger/coa_accounts/account_detail.html:64 -#: templates/sales/estimates/estimate_preview.html:264 +#: templates/sales/estimates/estimate_preview.html:145 #: templates/sales/estimates/sale_order_preview.html:226 #: venv/lib/python3.11/site-packages/appointment/templates/administration/display_appointment.html:25 #: venv/lib/python3.11/site-packages/appointment/templates/email_sender/reminder_email.html:134 @@ -2959,7 +2966,7 @@ msgstr "تأكيد الحذف" #: templates/modal/delete_modal.html:12 templates/modal/delete_modal.html:26 #: templates/modal/event_details_modal.html:33 #: templates/organizations/organization_detail.html:19 -#: templates/organizations/organization_list.html:131 +#: templates/organizations/organization_list.html:122 #: templates/plans/billing_info_create_or_update.html:14 #: templates/representatives/representative_detail.html:16 #: templates/sales/estimates/estimate_detail.html:12 @@ -3020,10 +3027,6 @@ msgstr "دفعة مقدمة" msgid "Image" msgstr "الصورة" -#: templates/administration/manage_service.html:90 -msgid "Currency" -msgstr "العملة" - #: templates/administration/manage_service.html:101 msgid "Background Color" msgstr "لون الخلفية" @@ -3081,7 +3084,7 @@ msgstr "" #: templates/organizations/organization_form.html:17 #: templates/plans/billing_info_create_or_update.html:17 #: templates/representatives/representative_form.html:11 -#: templates/sales/estimates/estimate_form.html:43 +#: templates/sales/estimates/estimate_form.html:65 #: templates/sales/estimates/sale_order_form.html:31 #: templates/sales/invoices/approved_invoice_update.html:16 #: templates/sales/invoices/draft_invoice_update.html:16 @@ -3090,7 +3093,7 @@ msgstr "" #: templates/sales/journals/journal_form.html:18 #: templates/sales/payments/payment_create.html:16 #: templates/sales/payments/payment_form.html:30 -#: templates/users/user_form.html:39 templates/users/user_group_form.html:31 +#: templates/users/user_form.html:44 templates/users/user_group_form.html:31 #: templates/vendors/vendor_form.html:41 #: venv/lib/python3.11/site-packages/appointment/templates/administration/manage_staff_member.html:70 #: venv/lib/python3.11/site-packages/appointment/views_admin.py:464 @@ -3263,7 +3266,7 @@ msgstr "إضافة" #: templates/administration/staff_list.html:36 #: ⁨templates/crm/opportunities/opportunity_list copy.html⁩:71 #: templates/crm/opportunities/opportunity_list.html:65 -#: templates/inventory/car_form.html:219 +#: templates/inventory/car_form.html:217 #: templates/inventory/inventory_stats.html:63 #: venv/lib/python3.11/site-packages/appointment/templates/administration/staff_list.html:40 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/closing_entry/tags/closing_entry_table.html:43 @@ -3494,9 +3497,10 @@ msgstr "تفاصيل الدفع" #: templates/ledger/bills/bill_detail.html:216 #: templates/ledger/coa_accounts/account_detail.html:100 #: templates/ledger/reports/tags/balance_sheet_statement.html:55 +#: templates/ledger/reports/tags/cash_flow_statement.html:11 #: templates/plans/order_detail_table.html:12 #: templates/sales/estimates/estimate_detail.html:176 -#: templates/sales/estimates/estimate_preview.html:278 +#: templates/sales/estimates/estimate_preview.html:159 #: templates/sales/estimates/sale_order_preview.html:244 #: templates/sales/invoices/invoice_detail.html:242 #: venv/lib/python3.11/site-packages/appointment/templates/appointment/appointment_client_information.html:103 @@ -3794,8 +3798,8 @@ msgid "Is Opportunity" msgstr "هل هي فرصة" #: templates/crm/leads/lead_list.html:85 -#: templates/customers/customer_list.html:54 -#: templates/organizations/organization_list.html:68 +#: templates/customers/customer_list.html:58 +#: templates/organizations/organization_list.html:72 #: templates/vendors/vendors_list.html:68 msgid "Create date" msgstr "تاريخ الإنشاء" @@ -3816,7 +3820,7 @@ msgstr "هل أنت متأكد أنك تريد حذف هذا العميل الم #: templates/ledger/bills/bill_list.html:69 #: templates/ledger/coa_accounts/account_detail.html:22 #: templates/ledger/coa_accounts/account_list.html:78 -#: templates/organizations/organization_list.html:100 +#: templates/organizations/organization_list.html:94 #: templates/sales/estimates/estimate_detail.html:20 #: templates/sales/estimates/estimate_detail.html:47 #: templates/sales/invoices/invoice_detail.html:30 @@ -3842,7 +3846,7 @@ msgstr "نعم" #: templates/ledger/bills/bill_list.html:68 #: templates/ledger/coa_accounts/account_detail.html:18 #: templates/ledger/coa_accounts/account_list.html:75 -#: templates/organizations/organization_list.html:97 +#: templates/organizations/organization_list.html:93 #: templates/sales/estimates/estimate_detail.html:46 #: templates/sales/invoices/invoice_detail.html:26 #: templates/sales/invoices/invoice_detail.html:51 @@ -3866,7 +3870,7 @@ msgstr "لا" #: templates/ledger/coa_accounts/account_detail.html:114 #: templates/modal/event_details_modal.html:27 #: templates/organizations/organization_detail.html:14 -#: templates/organizations/organization_list.html:129 +#: templates/organizations/organization_list.html:121 #: templates/representatives/representative_detail.html:13 #: templates/users/user_detail.html:84 templates/vendors/vendors_list.html:134 #: templates/vendors/view_vendor.html:64 @@ -4019,6 +4023,19 @@ msgstr "تحديث العميل" msgid "Add Customer" msgstr "إضافة عميل" +#: templates/customers/customer_list.html:54 +#: templates/dealers/dealer_detail.html:100 +#: templates/ledger/coa_accounts/account_detail.html:55 +#: templates/ledger/coa_accounts/account_list.html:46 +#: templates/plans/current.html:21 +#: venv/lib/python3.11/site-packages/django_ledger/models/accounts.py:433 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/account/tags/accounts_table.html:27 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/customer/tags/customer_table.html:11 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/uom/tags/uom_table.html:10 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/vendor/tags/vendor_table.html:12 +msgid "Active" +msgstr "نشط" + #: templates/customers/view_customer.html:4 templates/users/user_detail.html:5 msgid "View Customer" msgstr "عرض العميل" @@ -4028,6 +4045,7 @@ msgid "Customer details" msgstr "تفاصيل العميل" #: templates/customers/view_customer.html:50 +#: templates/dashboards/manager.html:32 #: templates/sales/invoices/invoice_list.html:4 #: templates/sales/invoices/invoice_list.html:9 #: templates/sales/journals/journal_list.html:4 @@ -4039,6 +4057,7 @@ msgid "Invoices" msgstr "الفواتير" #: templates/customers/view_customer.html:54 +#: templates/dashboards/manager.html:37 #: templates/sales/estimates/estimate_list.html:4 #: templates/sales/estimates/estimate_list.html:8 msgid "Quotations" @@ -4064,13 +4083,6 @@ msgstr "النوع" msgid "Payment Status" msgstr "حالة الدفع" -#: templates/customers/view_customer.html:126 -#: templates/sales/estimates/estimate_detail.html:62 -#: templates/sales/estimates/estimate_send.html:5 -#: templates/sales/sales_list.html:117 -msgid "Quotation" -msgstr "عرض سعر" - #: templates/customers/view_customer.html:154 #: templates/ledger/bills/bill_detail.html:199 #: templates/sales/invoices/invoice_detail.html:79 @@ -4081,49 +4093,52 @@ msgstr "عرض سعر" msgid "Paid" msgstr "مدفوع" -#: templates/dashboards/manager.html:17 templates/dashboards/sales.html:17 -msgid "Inventory by Status" -msgstr "المخزون حسب الحالة" - -#: templates/dashboards/manager.html:72 templates/dashboards/sales.html:72 -msgid "New Leads and Customers" -msgstr "العملاء والفرص الجديدة." - -#: templates/dashboards/manager.html:73 templates/dashboards/sales.html:73 -msgid "Payment received across all channels" -msgstr "تم استلام الدفع عبر جميع القنوات." - -#: templates/dashboards/manager.html:78 templates/dashboards/sales.html:78 -msgid "New Customers" -msgstr "عملاء جدد." - -#: templates/dashboards/manager.html:92 templates/dashboards/sales.html:92 -msgid "New Leads" -msgstr "فرص جديدة." - -#: templates/dashboards/manager.html:120 templates/dashboards/sales.html:120 +#: templates/dashboards/manager.html:10 templates/dashboards/sales.html:120 msgid "As of" msgstr "حتى" -#: templates/dashboards/manager.html:125 templates/dashboards/sales.html:125 -#: templates/index.html:94 +#: templates/dashboards/manager.html:42 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/estimate/estimate_detail.html:69 +msgid "Purchase Orders" +msgstr "أوامر الشراء" + +#: templates/dashboards/manager.html:58 templates/dashboards/sales.html:125 msgid "inventory value" msgstr "قيمة المخزون" -#: templates/dashboards/manager.html:140 templates/dashboards/sales.html:140 -#: templates/index.html:99 +#: templates/dashboards/manager.html:73 templates/dashboards/sales.html:140 msgid "Profits" msgstr "الأرباح" -#: templates/dashboards/manager.html:155 templates/dashboards/sales.html:155 +#: templates/dashboards/manager.html:100 templates/dashboards/sales.html:17 +msgid "Inventory by Status" +msgstr "المخزون حسب الحالة" + +#: templates/dashboards/sales.html:72 +msgid "New Leads and Customers" +msgstr "العملاء والفرص الجديدة." + +#: templates/dashboards/sales.html:73 +msgid "Payment received across all channels" +msgstr "تم استلام الدفع عبر جميع القنوات." + +#: templates/dashboards/sales.html:78 +msgid "New Customers" +msgstr "عملاء جدد." + +#: templates/dashboards/sales.html:92 +msgid "New Leads" +msgstr "فرص جديدة." + +#: templates/dashboards/sales.html:155 msgid "Canceled Invoices" msgstr "الفواتير الملغاة." -#: templates/dashboards/manager.html:161 templates/dashboards/sales.html:161 +#: templates/dashboards/sales.html:161 msgid "From last month" msgstr "من الشهر الماضي." -#: templates/dashboards/manager.html:172 templates/dashboards/sales.html:172 +#: templates/dashboards/sales.html:172 #: templates/ledger/reports/tags/income_statement.html:114 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/income_statement.html:148 msgid "Gross Profit" @@ -4150,18 +4165,6 @@ msgstr "آخر تسجيل دخول" msgid "Total users" msgstr "إجمالي المستخدمين" -#: templates/dealers/dealer_detail.html:100 -#: templates/ledger/coa_accounts/account_detail.html:55 -#: templates/ledger/coa_accounts/account_list.html:46 -#: templates/plans/current.html:21 -#: venv/lib/python3.11/site-packages/django_ledger/models/accounts.py:433 -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/account/tags/accounts_table.html:27 -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/customer/tags/customer_table.html:11 -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/uom/tags/uom_table.html:10 -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/vendor/tags/vendor_table.html:12 -msgid "Active" -msgstr "نشط" - #: templates/dealers/dealer_detail.html:102 #: templates/inventory/car_detail.html:326 templates/plans/current.html:23 msgid "Expired" @@ -4550,9 +4553,9 @@ msgstr "العودة" msgid "All right reserved" msgstr "جميع الحقوق محفوظة" -#: templates/footer.html:5 -msgid "tenhal" -msgstr "تنحل" +#: templates/footer.html:10 +msgid "Powered by" +msgstr "مدعوم من" #: templates/groups/group_detail.html:5 msgid "View Group" @@ -4648,6 +4651,7 @@ msgid "Type your message here..." msgstr "اكتب رسالتك هنا..." #: templates/haikalbot/chatbot.html:33 +#: templates/sales/estimates/estimate_send.html:27 msgid "Send" msgstr "إرسال" @@ -4784,18 +4788,6 @@ msgstr "الموظفون والمجموعات" msgid "Settings" msgstr "الإعدادات" -#: templates/index.html:19 -msgid "Total Cars in Inventory" -msgstr "إجمالي السيارات في المخزون" - -#: templates/index.html:29 -msgid "In Our Showroom" -msgstr "في صالة العرض الخاصة بنا" - -#: templates/index.html:34 -msgid "Outside Showroom" -msgstr "خارج صالة العرض" - #: templates/inventory/add_colors.html:5 msgid "Add Colors" msgstr "إضافة لون" @@ -4835,13 +4827,13 @@ msgstr "هذه السيارة محجوزة حتى " msgid "year" msgstr "السنة" -#: templates/inventory/car_detail.html:68 templates/inventory/car_form.html:75 +#: templates/inventory/car_detail.html:68 templates/inventory/car_form.html:73 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:82 #: templates/inventory/car_list.html:79 msgid "make" msgstr "الصانع" -#: templates/inventory/car_detail.html:72 templates/inventory/car_form.html:98 +#: templates/inventory/car_detail.html:72 templates/inventory/car_form.html:96 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:99 #: templates/inventory/car_list.html:97 msgid "model" @@ -4851,7 +4843,7 @@ msgstr "الموديل" msgid "series" msgstr "السلسلة" -#: templates/inventory/car_detail.html:80 templates/inventory/car_form.html:85 +#: templates/inventory/car_detail.html:80 templates/inventory/car_form.html:83 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:143 #: templates/inventory/car_list.html:141 msgid "trim" @@ -4859,7 +4851,7 @@ msgstr "الفئة" #: templates/inventory/car_detail.html:110 #: templates/inventory/car_detail.html:474 -#: templates/inventory/car_form.html:109 templates/inventory/car_form.html:219 +#: templates/inventory/car_form.html:107 templates/inventory/car_form.html:217 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:252 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:279 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:299 @@ -5009,11 +5001,11 @@ msgstr "التفاصيل المالية السيارة" msgid "Finance Details for" msgstr "التفاصيل المالية لـ" -#: templates/inventory/car_form.html:64 templates/inventory/car_form.html:83 -#: templates/inventory/car_form.html:96 templates/inventory/car_form.html:260 -#: templates/inventory/car_form.html:445 templates/inventory/car_form.html:462 -#: templates/inventory/car_form.html:463 templates/inventory/car_form.html:485 -#: templates/inventory/car_form.html:504 +#: templates/inventory/car_form.html:62 templates/inventory/car_form.html:81 +#: templates/inventory/car_form.html:94 templates/inventory/car_form.html:258 +#: templates/inventory/car_form.html:443 templates/inventory/car_form.html:460 +#: templates/inventory/car_form.html:461 templates/inventory/car_form.html:483 +#: templates/inventory/car_form.html:502 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:105 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:126 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:148 @@ -5027,24 +5019,24 @@ msgstr "التفاصيل المالية لـ" msgid "Select" msgstr "اختيار" -#: templates/inventory/car_form.html:116 +#: templates/inventory/car_form.html:114 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:259 #: templates/inventory/car_list.html:27 templates/inventory/car_list.html:214 msgid "options" msgstr "الخيارات" -#: templates/inventory/car_form.html:196 +#: templates/inventory/car_form.html:194 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:262 msgid "Save and Add Another" msgstr "حفظ وإضافة آخر" -#: templates/inventory/car_form.html:199 +#: templates/inventory/car_form.html:197 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:265 msgid "Save and Go to Inventory" msgstr "حفظ والانتقال إلى المخزون" -#: templates/inventory/car_form.html:229 templates/inventory/car_form.html:248 -#: templates/inventory/car_form.html:268 templates/inventory/car_form.html:280 +#: templates/inventory/car_form.html:227 templates/inventory/car_form.html:246 +#: templates/inventory/car_form.html:266 templates/inventory/car_form.html:278 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:281 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:287 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:301 @@ -5061,41 +5053,41 @@ msgstr "حفظ والانتقال إلى المخزون" msgid "Close" msgstr "إغلاق" -#: templates/inventory/car_form.html:246 +#: templates/inventory/car_form.html:244 #: venv/lib/python3.11/site-packages/click/core.py:1396 msgid "Options" msgstr "الخيارات" -#: templates/inventory/car_form.html:255 +#: templates/inventory/car_form.html:253 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:308 #: templates/inventory/car_list.html:152 msgid "equipment" msgstr "التجهيزات" -#: templates/inventory/car_form.html:279 +#: templates/inventory/car_form.html:277 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:332 msgid "scanner" msgstr "الماسح الضوئي" -#: templates/inventory/car_form.html:284 +#: templates/inventory/car_form.html:282 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:337 #: templates/partials/scanner_modal.html:10 msgid "VIN will appear here." msgstr "رقم الهيكل سيظهر هنا." -#: templates/inventory/car_form.html:285 +#: templates/inventory/car_form.html:283 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:338 #: templates/partials/scanner_modal.html:11 msgid "Use OCR Fallback" msgstr "التعرف الآلي على الحروف" -#: templates/inventory/car_form.html:356 templates/inventory/car_form.html:357 +#: templates/inventory/car_form.html:354 templates/inventory/car_form.html:355 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:409 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:410 msgid "Please enter a valid VIN." msgstr "الرجاء إدخال رقم هيكل صالح مكون من 17 حرفًا." -#: templates/inventory/car_form.html:379 +#: templates/inventory/car_form.html:377 #: ⁨templates/inventory/car_form_qabl alfalsafa.html⁩:432 msgid "An error occurred while decoding the VIN." msgstr "حدث خطأ أثناء فك تشفير الهيكل" @@ -5219,15 +5211,14 @@ msgid "Manage Car Location" msgstr "إدارة موقع السيارة" #: templates/inventory/car_transfer_form.html:4 -#, fuzzy -#| msgid "Car Transfer Log" msgid "Car Transfer" -msgstr "سجل نقل السيارة" +msgstr "نقل السيارة" #: templates/inventory/car_transfer_form.html:8 msgid "Sell car to another dealer" msgstr "بيع السيارة لتاجر آخر" +#: templates/inventory/car_transfer_form.html:13 msgid "Sell" msgstr "بيع" @@ -5311,7 +5302,7 @@ msgstr "إلى" #: templates/inventory/transfer_details.html:73 #: templates/plans/order_detail_table.html:10 -#: templates/sales/estimates/estimate_preview.html:296 +#: templates/sales/estimates/estimate_preview.html:177 #: templates/sales/estimates/sale_order_preview.html:265 #: templates/sales/invoices/invoice_detail.html:265 msgid "VAT" @@ -5319,7 +5310,7 @@ msgstr "ضريبة القيمة المضافة" #: templates/inventory/transfer_details.html:92 #: templates/inventory/transfer_preview.html:249 -#: templates/sales/estimates/estimate_preview.html:307 +#: templates/sales/estimates/estimate_preview.html:188 #: templates/sales/estimates/sale_order_preview.html:276 msgid "Total Amount" msgstr "المبلغ الإجمالي" @@ -5361,7 +5352,7 @@ msgid "Are you sure you want to reject this transfer?" msgstr "هل أنت متأكد أنك تريد رفض هذا النقل؟" #: templates/inventory/transfer_preview.html:214 -#: templates/sales/estimates/estimate_preview.html:258 +#: templates/sales/estimates/estimate_preview.html:139 #: templates/sales/estimates/sale_order_preview.html:219 msgid "Thank you for choosing us. We appreciate your business" msgstr "شكرًا لاختيارك لنا. نحن نقدر عملك معنا." @@ -5369,20 +5360,18 @@ msgstr "شكرًا لاختيارك لنا. نحن نقدر عملك معنا." #: templates/inventory/transfer_preview.html:231 #: templates/ledger/bills/bill_detail.html:215 #: templates/sales/estimates/estimate_detail.html:175 -#: templates/sales/estimates/estimate_preview.html:277 +#: templates/sales/estimates/estimate_preview.html:158 #: templates/sales/estimates/sale_order_preview.html:243 #: templates/sales/invoices/invoice_detail.html:241 msgid "Unit Price" msgstr "سعر الوحدة" #: templates/inventory/transfer_preview.html:254 -#: templates/sales/estimates/estimate_preview.html:312 #: templates/sales/estimates/sale_order_preview.html:281 msgid "If you have any questions, feel free to contact us at" msgstr "إذا كان لديك أي أسئلة، يرجى التواصل معنا على" #: templates/inventory/transfer_preview.html:255 -#: templates/sales/estimates/estimate_preview.html:313 #: templates/sales/estimates/sale_order_preview.html:282 msgid "Thank you for your business" msgstr "شكراً لتعاملك معنا" @@ -5953,6 +5942,55 @@ msgstr "إجمالي حقوق الملكية" msgid "Total Equity + Liabilities" msgstr "إجمالي حقوق الملكية + الالتزامات" +#: templates/ledger/reports/tags/cash_flow_statement.html:10 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:10 +msgid "Cash from Operating Activities" +msgstr "النقد من الأنشطة التشغيلية" + +#: templates/ledger/reports/tags/cash_flow_statement.html:27 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:27 +msgid "Noncash Charges to Non-current Accounts" +msgstr "تكاليف غير نقدية لحسابات غير جارية" + +#: templates/ledger/reports/tags/cash_flow_statement.html:48 +msgid "Non cash Charges to Current Accounts" +msgstr "تكاليف غير نقدية لحسابات جارية" + +#: templates/ledger/reports/tags/cash_flow_statement.html:91 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:91 +msgid "Net Cash Provided by Operating Activities" +msgstr "صافي النقد المقدم من الأنشطة التشغيلية" + +#: templates/ledger/reports/tags/cash_flow_statement.html:102 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:102 +msgid "Cash from Financing Activities" +msgstr "النقد من الأنشطة التمويلية" + +#: templates/ledger/reports/tags/cash_flow_statement.html:141 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:141 +msgid "Net Cash Provided by Financing Activities" +msgstr "صافي النقد المقدم من الأنشطة التمويلية" + +#: templates/ledger/reports/tags/cash_flow_statement.html:152 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:152 +msgid "Cash from Investing Activities" +msgstr "النقد من الأنشطة الاستثمارية" + +#: templates/ledger/reports/tags/cash_flow_statement.html:178 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:178 +msgid "Net Cash Provided by Investing Activities" +msgstr "صافي النقد المقدم من الأنشطة الاستثمارية" + +#: templates/ledger/reports/tags/cash_flow_statement.html:191 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:191 +msgid "Net Cashflow" +msgstr "صافي التدفق النقدي" + +#: templates/ledger/reports/tags/cash_flow_statement.html:199 +#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:199 +msgid "Net Cash From" +msgstr "صافي النقد من" + #: templates/ledger/reports/tags/income_statement.html:14 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/closing_entry/tags/closing_entry_txs_table.html:12 #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/income_statement.html:14 @@ -6159,20 +6197,20 @@ msgstr "تفاصيل الشركة" msgid "Add Organization" msgstr "إضافة شركة" -#: templates/organizations/organization_list.html:18 +#: templates/organizations/organization_list.html:20 msgid "add organization" msgstr "إضافة شركة" -#: templates/organizations/organization_list.html:27 +#: templates/organizations/organization_list.html:28 msgid "Enter Organization name" msgstr "أدخل اسم الشركة" -#: templates/organizations/organization_list.html:87 +#: templates/organizations/organization_list.html:84 #: templates/vendors/vendors_list.html:87 templates/vendors/view_vendor.html:18 msgid "Delete Vendor" msgstr "حذف مورد" -#: templates/organizations/organization_list.html:94 +#: templates/organizations/organization_list.html:91 msgid "Are you sure you want to delete this Organization?" msgstr "هل أنت متأكد أنك تريد حذف هذه الشركة؟" @@ -6623,6 +6661,7 @@ msgstr "عرض" #: templates/sales/estimates/estimate_detail.html:111 #: templates/sales/estimates/estimate_list.html:14 +#: templates/sales/estimates/estimate_preview.html:144 msgid "Quotation Number" msgstr "رقم عرض السعر" @@ -6638,11 +6677,18 @@ msgstr "حالة عرض السعر" msgid "Vat" msgstr "الضريبة" -#: templates/sales/estimates/estimate_form.html:23 +#: templates/sales/estimates/estimate_form.html:20 +msgid "Please add at least one car before creating a quotation." +msgstr "يرجى إضافة سيارة واحدة على الأقل قبل إنشاء عرض السعر." + +msgid "Please add at least one customer before creating a quotation." +msgstr "يرجى إضافة عميل واحد على الأقل قبل إنشاء عرض السعر." + +#: templates/sales/estimates/estimate_form.html:45 msgid "No Cars Found" msgstr "لم يتم العثور على سيارات" -#: templates/sales/estimates/estimate_form.html:36 +#: templates/sales/estimates/estimate_form.html:58 msgid "Add More" msgstr "إضافة المزيد" @@ -6668,42 +6714,10 @@ msgstr "باطل" #: templates/sales/estimates/estimate_list.html:56 #: templates/sales/journals/journal_list.html:40 -#: templates/sales/orders/order_list.html:40 +#: templates/sales/orders/order_list.html:41 msgid "No Quotations Found" msgstr "لم يتم العثور على عروض" -#: templates/sales/estimates/estimate_preview.html:203 -msgid "Download Estimate" -msgstr "تحميل العرض" - -#: templates/sales/estimates/estimate_preview.html:206 -#: templates/sales/estimates/estimate_preview.html:218 -msgid "Accept Estimate" -msgstr "قبول العرض" - -#: templates/sales/estimates/estimate_preview.html:209 -#: templates/sales/estimates/estimate_preview.html:237 -msgid "Reject Estimate" -msgstr "رفض العرض" - -#: templates/sales/estimates/estimate_preview.html:222 -msgid "Are you sure you want to accept this estimate?" -msgstr "هل أنت متأكد أنك تريد قبول هذا العرض؟" - -#: templates/sales/estimates/estimate_preview.html:226 -#: templates/sales/invoices/invoice_detail.html:85 -msgid "Accept" -msgstr "قبول" - -#: templates/sales/estimates/estimate_preview.html:241 -msgid "Are you sure you want to reject this estimate?" -msgstr "هل أنت متأكد أنك تريد رفض هذا العرض؟" - -#: templates/sales/estimates/estimate_preview.html:263 -#: venv/lib/python3.11/site-packages/django_ledger/models/estimate.py:247 -msgid "Estimate Number" -msgstr "رقم التقدير" - #: templates/sales/estimates/sale_order_form.html:5 #: templates/sales/estimates/sale_order_preview.html:218 msgid "Sale Order" @@ -6731,6 +6745,10 @@ msgstr "إضافة فاتورة" msgid "View Estimate" msgstr "عرض التقدير" +#: templates/sales/invoices/invoice_detail.html:85 +msgid "Accept" +msgstr "قبول" + #: templates/sales/invoices/invoice_detail.html:107 msgid "Owned" msgstr "مملوك" @@ -6824,11 +6842,11 @@ msgstr "المدفوعات" msgid "Payment Number" msgstr "رقم عملية الدفع" -#: templates/sales/payments/payment_list.html:42 +#: templates/sales/payments/payment_list.html:46 msgid "View Tranactions" msgstr "عرض المعالملات" -#: templates/sales/payments/payment_list.html:47 +#: templates/sales/payments/payment_list.html:51 msgid "No Payments Found" msgstr "لم يتم العثور على عملية دفع" @@ -10631,6 +10649,10 @@ msgstr "الوقت والمواد" msgid "Other" msgstr "أخرى" +#: venv/lib/python3.11/site-packages/django_ledger/models/estimate.py:247 +msgid "Estimate Number" +msgstr "رقم التقدير" + #: venv/lib/python3.11/site-packages/django_ledger/models/estimate.py:253 msgid "Contract Terms" msgstr "شروط العقد" @@ -11915,10 +11937,6 @@ msgstr "تقدير الهامش الإجمالي" msgid "Estimate Items" msgstr "عناصر التقدير" -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/estimate/estimate_detail.html:69 -msgid "Purchase Orders" -msgstr "أوامر الشراء" - #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/estimate/estimate_detail.html:75 msgid "Initiate PO" msgstr "بدء أمر الشراء" @@ -12035,46 +12053,10 @@ msgstr "وحدة القياس" msgid "By Unit" msgstr "حسب الوحدة" -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:10 -msgid "Cash from Operating Activities" -msgstr "النقد من الأنشطة التشغيلية" - -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:27 -msgid "Noncash Charges to Non-current Accounts" -msgstr "تكاليف غير نقدية لحسابات غير جارية" - #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:48 msgid "Noncash Charges to Current Accounts" msgstr "تكاليف غير نقدية لحسابات جارية" -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:91 -msgid "Net Cash Provided by Operating Activities" -msgstr "صافي النقد المقدم من الأنشطة التشغيلية" - -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:102 -msgid "Cash from Financing Activities" -msgstr "النقد من الأنشطة التمويلية" - -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:141 -msgid "Net Cash Provided by Financing Activities" -msgstr "صافي النقد المقدم من الأنشطة التمويلية" - -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:152 -msgid "Cash from Investing Activities" -msgstr "النقد من الأنشطة الاستثمارية" - -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:178 -msgid "Net Cash Provided by Investing Activities" -msgstr "صافي النقد المقدم من الأنشطة الاستثمارية" - -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:191 -msgid "Net Cashflow" -msgstr "صافي التدفق النقدي" - -#: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/financial_statements/tags/cash_flow_statement.html:199 -msgid "Net Cash From" -msgstr "صافي النقد من" - #: venv/lib/python3.11/site-packages/django_ledger/templates/django_ledger/includes/card_markdown.html:20 msgid "No available notes to display..." msgstr "لا توجد ملاحظات متاحة للعرض..." diff --git a/static/.DS_Store b/static/.DS_Store index f186b837..1b44444a 100644 Binary files a/static/.DS_Store and b/static/.DS_Store differ diff --git a/static/assets/fonts/SaudiRiyalFont.ttf b/static/assets/fonts/SaudiRiyalFont.ttf new file mode 100644 index 00000000..684c7098 Binary files /dev/null and b/static/assets/fonts/SaudiRiyalFont.ttf differ diff --git a/static/css/custom.css b/static/css/custom.css index 1111ec26..665b5a9d 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,13 @@ +@font-face { + font-family: 'SaudiRiyalFont'; + src: url('/static/assets/fonts/SaudiRiyalFont.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +.currency { + font-family: 'SaudiRiyalFont', sans-serif; +} .color-div { width: 64px; diff --git a/static/css/theme.css b/static/css/theme.css index 17825266..6a3da3e8 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -1259,6 +1259,7 @@ progress { font-weight: 600; } + .display-1 { font-size: calc(1.6018371582rem + 4.2220458984vw); font-weight: 400; diff --git a/static/images/car_make/Dongfeng.png b/static/images/car_make/Dongfeng.png new file mode 100644 index 00000000..fa272b7b Binary files /dev/null and b/static/images/car_make/Dongfeng.png differ diff --git a/static/images/car_make/EXEED.png b/static/images/car_make/EXEED.png new file mode 100644 index 00000000..c6c40273 Binary files /dev/null and b/static/images/car_make/EXEED.png differ diff --git a/static/images/car_make/Forthing.png b/static/images/car_make/Forthing.png new file mode 100644 index 00000000..474a02a3 Binary files /dev/null and b/static/images/car_make/Forthing.png differ diff --git a/static/images/car_make/GAC.png b/static/images/car_make/GAC.png new file mode 100644 index 00000000..c7d6b629 Binary files /dev/null and b/static/images/car_make/GAC.png differ diff --git a/static/images/car_make/GMC.png b/static/images/car_make/GMC.png new file mode 100644 index 00000000..d63c070b Binary files /dev/null and b/static/images/car_make/GMC.png differ diff --git a/static/images/car_make/GWM.png b/static/images/car_make/GWM.png new file mode 100644 index 00000000..df788792 Binary files /dev/null and b/static/images/car_make/GWM.png differ diff --git a/static/images/car_make/Geely.png b/static/images/car_make/Geely.png new file mode 100644 index 00000000..c45f76f0 Binary files /dev/null and b/static/images/car_make/Geely.png differ diff --git a/static/images/car_make/Genesis.png b/static/images/car_make/Genesis.png new file mode 100644 index 00000000..4c82d0f6 Binary files /dev/null and b/static/images/car_make/Genesis.png differ diff --git a/static/images/car_make/Hongqi.png b/static/images/car_make/Hongqi.png new file mode 100644 index 00000000..a713cdae Binary files /dev/null and b/static/images/car_make/Hongqi.png differ diff --git a/static/images/car_make/Jetour.png b/static/images/car_make/Jetour.png new file mode 100644 index 00000000..d2daa42d Binary files /dev/null and b/static/images/car_make/Jetour.png differ diff --git a/static/images/car_make/Lucid.png b/static/images/car_make/Lucid.png new file mode 100644 index 00000000..85887ca4 Binary files /dev/null and b/static/images/car_make/Lucid.png differ diff --git a/static/images/car_make/LynkCo.png b/static/images/car_make/LynkCo.png new file mode 100644 index 00000000..2e90a6e2 Binary files /dev/null and b/static/images/car_make/LynkCo.png differ diff --git a/static/images/car_make/MG.png b/static/images/car_make/MG.png new file mode 100644 index 00000000..d4021e0d Binary files /dev/null and b/static/images/car_make/MG.png differ diff --git a/static/images/car_make/Maxus.png b/static/images/car_make/Maxus.png new file mode 100644 index 00000000..f925e05a Binary files /dev/null and b/static/images/car_make/Maxus.png differ diff --git a/static/images/car_make/Mercedes-Benz.png b/static/images/car_make/Mercedes-Benz.png new file mode 100644 index 00000000..14c56556 Binary files /dev/null and b/static/images/car_make/Mercedes-Benz.png differ diff --git a/static/images/car_make/Porsche.png b/static/images/car_make/Porsche.png new file mode 100644 index 00000000..42d090bf Binary files /dev/null and b/static/images/car_make/Porsche.png differ diff --git a/static/images/car_make/Rayton-Fissore.png b/static/images/car_make/Rayton-Fissore.png new file mode 100644 index 00000000..ea6449bc Binary files /dev/null and b/static/images/car_make/Rayton-Fissore.png differ diff --git a/static/images/car_make/Renault.png b/static/images/car_make/Renault.png new file mode 100644 index 00000000..b130c600 Binary files /dev/null and b/static/images/car_make/Renault.png differ diff --git a/static/images/car_make/Rolls-Royce.png b/static/images/car_make/Rolls-Royce.png new file mode 100644 index 00000000..fa993053 Binary files /dev/null and b/static/images/car_make/Rolls-Royce.png differ diff --git a/static/images/car_make/Rover.png b/static/images/car_make/Rover.png new file mode 100644 index 00000000..7bb26736 Binary files /dev/null and b/static/images/car_make/Rover.png differ diff --git a/static/images/car_make/Saab.png b/static/images/car_make/Saab.png new file mode 100644 index 00000000..e7576c56 Binary files /dev/null and b/static/images/car_make/Saab.png differ diff --git a/static/images/car_make/Seres.png b/static/images/car_make/Seres.png new file mode 100644 index 00000000..f7c394fa Binary files /dev/null and b/static/images/car_make/Seres.png differ diff --git a/static/images/car_make/Smart.png b/static/images/car_make/Smart.png new file mode 100644 index 00000000..bb91aae5 Binary files /dev/null and b/static/images/car_make/Smart.png differ diff --git a/static/images/car_make/Ssangyong.png b/static/images/car_make/Ssangyong.png new file mode 100644 index 00000000..8b8d2bef Binary files /dev/null and b/static/images/car_make/Ssangyong.png differ diff --git a/static/images/car_make/Stelato.png b/static/images/car_make/Stelato.png new file mode 100644 index 00000000..398919c2 Binary files /dev/null and b/static/images/car_make/Stelato.png differ diff --git a/static/images/car_make/Subaru.png b/static/images/car_make/Subaru.png new file mode 100644 index 00000000..0979df2f Binary files /dev/null and b/static/images/car_make/Subaru.png differ diff --git a/static/images/car_make/Suzuki.png b/static/images/car_make/Suzuki.png new file mode 100644 index 00000000..3736bee5 Binary files /dev/null and b/static/images/car_make/Suzuki.png differ diff --git a/static/images/car_make/TATA.png b/static/images/car_make/TATA.png new file mode 100644 index 00000000..830a1d7c Binary files /dev/null and b/static/images/car_make/TATA.png differ diff --git a/static/images/car_make/Tank.png b/static/images/car_make/Tank.png new file mode 100644 index 00000000..44d8ef4e Binary files /dev/null and b/static/images/car_make/Tank.png differ diff --git a/static/images/car_make/Tesla.png b/static/images/car_make/Tesla.png new file mode 100644 index 00000000..b4245e81 Binary files /dev/null and b/static/images/car_make/Tesla.png differ diff --git a/static/images/car_make/Volkswagen.png b/static/images/car_make/Volkswagen.png new file mode 100644 index 00000000..dac34b45 Binary files /dev/null and b/static/images/car_make/Volkswagen.png differ diff --git a/static/images/car_make/Volvo.png b/static/images/car_make/Volvo.png new file mode 100644 index 00000000..30b6cc9c Binary files /dev/null and b/static/images/car_make/Volvo.png differ diff --git a/static/images/car_make/Voyah.png b/static/images/car_make/Voyah.png new file mode 100644 index 00000000..b8e0d3b1 Binary files /dev/null and b/static/images/car_make/Voyah.png differ diff --git a/static/images/car_make/Zotye.png b/static/images/car_make/Zotye.png new file mode 100644 index 00000000..c86d94e0 Binary files /dev/null and b/static/images/car_make/Zotye.png differ diff --git a/static/images/car_make/haval.png b/static/images/car_make/haval.png new file mode 100644 index 00000000..c1131c1d Binary files /dev/null and b/static/images/car_make/haval.png differ diff --git a/static/images/car_make/zx.png b/static/images/car_make/zx.png new file mode 100644 index 00000000..7b125b12 Binary files /dev/null and b/static/images/car_make/zx.png differ diff --git a/static/vendors/tesseract/tesseract.min.js b/static/vendors/tesseract/tesseract.min.js new file mode 100644 index 00000000..428fdae0 --- /dev/null +++ b/static/vendors/tesseract/tesseract.min.js @@ -0,0 +1,3 @@ +/*! For license information please see tesseract.min.js.LICENSE.txt */ +!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.Tesseract=r():t.Tesseract=r()}(self,(()=>(()=>{var t={670:t=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}t.exports=function(){return"undefined"!=typeof window&&"object"===r(window.process)&&"renderer"===window.process.type||!("undefined"==typeof process||"object"!==r(process.versions)||!process.versions.electron)||"object"===("undefined"==typeof navigator?"undefined":r(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}},760:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=function(t){"use strict";var r,e=Object.prototype,o=e.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function s(t,r,e,n){var o=r&&r.prototype instanceof m?r:m,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:P(t,e,c)}),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var p="suspendedStart",y="suspendedYield",v="executing",d="completed",g={};function m(){}function b(){}function w(){}var x={};l(x,c,(function(){return this}));var L=Object.getPrototypeOf,O=L&&L(L(A([])));O&&O!==e&&o.call(O,c)&&(x=O);var E=w.prototype=m.prototype=Object.create(x);function S(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function j(t,r){function e(i,a,c,u){var f=h(t[i],t,a);if("throw"!==f.type){var l=f.arg,s=l.value;return s&&"object"===n(s)&&o.call(s,"__await")?r.resolve(s.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(s).then((function(t){l.value=t,c(l)}),(function(t){return e("throw",t,c,u)}))}u(f.arg)}var a;i(this,"_invoke",{value:function(t,n){function o(){return new r((function(r,o){e(t,n,r,o)}))}return a=a?a.then(o,o):o()}})}function P(t,r,e){var n=p;return function(o,i){if(n===v)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return G()}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var c=k(a,e);if(c){if(c===g)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(n===p)throw n=d,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n=v;var u=h(t,r,e);if("normal"===u.type){if(n=e.done?d:y,u.arg===g)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n=d,e.method="throw",e.arg=u.arg)}}}function k(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,k(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function _(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function T(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function A(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(u&&f){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;T(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:A(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},t}("object"===n(t=e.nmd(t))?t.exports:{});try{regeneratorRuntime=o}catch(t){"object"===("undefined"==typeof globalThis?"undefined":n(globalThis))?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},793:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){"use strict";o=function(){return t};var t={},r=Object.prototype,e=r.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function s(t,r,e,n){var o=r&&r.prototype instanceof y?r:y,a=Object.create(o.prototype),c=new P(n||[]);return i(a,"_invoke",{value:O(t,e,c)}),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var p={};function y(){}function v(){}function d(){}var g={};l(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(k([])));b&&b!==r&&e.call(b,c)&&(g=b);var w=d.prototype=y.prototype=Object.create(g);function x(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function L(t,r){function o(i,a,c,u){var f=h(t[i],t,a);if("throw"!==f.type){var l=f.arg,s=l.value;return s&&"object"==n(s)&&e.call(s,"__await")?r.resolve(s.__await).then((function(t){o("next",t,c,u)}),(function(t){o("throw",t,c,u)})):r.resolve(s).then((function(t){l.value=t,c(l)}),(function(t){return o("throw",t,c,u)}))}u(f.arg)}var a;i(this,"_invoke",{value:function(t,e){function n(){return new r((function(r,n){o(t,e,r,n)}))}return a=a?a.then(n,n):n()}})}function O(t,r,e){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var c=E(a,e);if(c){if(c===p)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var u=h(t,r,e);if("normal"===u.type){if(n=e.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n="completed",e.method="throw",e.arg=u.arg)}}}function E(t,r){var e=r.method,n=t.iterator[e];if(void 0===n)return r.delegate=null,"throw"===e&&t.iterator.return&&(r.method="return",r.arg=void 0,E(t,r),"throw"===r.method)||"return"!==e&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+e+"' method")),p;var o=h(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function S(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function j(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function r(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=e.call(i,"catchLoc"),u=e.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),j(e),p}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;j(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:k(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),p}},t}function i(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}function a(t){return function(){var r=this,e=arguments;return new Promise((function(n,o){var a=t.apply(r,e);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))}}var c=e(311),u=function(){var t=a(o().mark((function t(r,e,n){var i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c(e,1,n);case 2:return i=t.sent,t.abrupt("return",i.recognize(r).finally(a(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.terminate();case 2:case"end":return t.stop()}}),t)})))));case 4:case"end":return t.stop()}}),t)})));return function(r,e,n){return t.apply(this,arguments)}}(),f=function(){var t=a(o().mark((function t(r,e){var n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c("osd",0,e);case 2:return n=t.sent,t.abrupt("return",n.detect(r).finally(a(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.terminate();case 2:case"end":return t.stop()}}),t)})))));case 4:case"end":return t.stop()}}),t)})));return function(r,e){return t.apply(this,arguments)}}();t.exports={recognize:u,detect:f}},847:t=>{t.exports={TESSERACT_ONLY:0,LSTM_ONLY:1,TESSERACT_LSTM_COMBINED:2,DEFAULT:3}},711:t=>{t.exports={OSD_ONLY:"0",AUTO_OSD:"1",AUTO_ONLY:"2",AUTO:"3",SINGLE_COLUMN:"4",SINGLE_BLOCK_VERT_TEXT:"5",SINGLE_BLOCK:"6",SINGLE_LINE:"7",SINGLE_WORD:"8",CIRCLE_WORD:"9",SINGLE_CHAR:"10",SPARSE_TEXT:"11",SPARSE_TEXT_OSD:"12",RAW_LINE:"13"}},341:t=>{t.exports={workerBlobURL:!0,logger:function(){}}},5:t=>{t.exports={AFR:"afr",AMH:"amh",ARA:"ara",ASM:"asm",AZE:"aze",AZE_CYRL:"aze_cyrl",BEL:"bel",BEN:"ben",BOD:"bod",BOS:"bos",BUL:"bul",CAT:"cat",CEB:"ceb",CES:"ces",CHI_SIM:"chi_sim",CHI_TRA:"chi_tra",CHR:"chr",CYM:"cym",DAN:"dan",DEU:"deu",DZO:"dzo",ELL:"ell",ENG:"eng",ENM:"enm",EPO:"epo",EST:"est",EUS:"eus",FAS:"fas",FIN:"fin",FRA:"fra",FRK:"frk",FRM:"frm",GLE:"gle",GLG:"glg",GRC:"grc",GUJ:"guj",HAT:"hat",HEB:"heb",HIN:"hin",HRV:"hrv",HUN:"hun",IKU:"iku",IND:"ind",ISL:"isl",ITA:"ita",ITA_OLD:"ita_old",JAV:"jav",JPN:"jpn",KAN:"kan",KAT:"kat",KAT_OLD:"kat_old",KAZ:"kaz",KHM:"khm",KIR:"kir",KOR:"kor",KUR:"kur",LAO:"lao",LAT:"lat",LAV:"lav",LIT:"lit",MAL:"mal",MAR:"mar",MKD:"mkd",MLT:"mlt",MSA:"msa",MYA:"mya",NEP:"nep",NLD:"nld",NOR:"nor",ORI:"ori",PAN:"pan",POL:"pol",POR:"por",PUS:"pus",RON:"ron",RUS:"rus",SAN:"san",SIN:"sin",SLK:"slk",SLV:"slv",SPA:"spa",SPA_OLD:"spa_old",SQI:"sqi",SRP:"srp",SRP_LATN:"srp_latn",SWA:"swa",SWE:"swe",SYR:"syr",TAM:"tam",TEL:"tel",TGK:"tgk",TGL:"tgl",THA:"tha",TIR:"tir",TUR:"tur",UIG:"uig",UKR:"ukr",URD:"urd",UZB:"uzb",UZB_CYRL:"uzb_cyrl",VIE:"vie",YID:"yid"}},106:(t,r,e)=>{var n=e(313),o=0;t.exports=function(t){var r=t.id,e=t.action,i=t.payload,a=void 0===i?{}:i,c=r;return void 0===c&&(c=n("Job",o),o+=1),{id:c,action:e,payload:a}}},936:function(t,r,e){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=this;function i(){"use strict";i=function(){return t};var t={},r=Object.prototype,e=r.hasOwnProperty,o=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function s(t,r,e,n){var i=r&&r.prototype instanceof y?r:y,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,e,c)}),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var p={};function y(){}function v(){}function d(){}var g={};l(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(k([])));b&&b!==r&&e.call(b,c)&&(g=b);var w=d.prototype=y.prototype=Object.create(g);function x(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function L(t,r){function i(o,a,c,u){var f=h(t[o],t,a);if("throw"!==f.type){var l=f.arg,s=l.value;return s&&"object"==n(s)&&e.call(s,"__await")?r.resolve(s.__await).then((function(t){i("next",t,c,u)}),(function(t){i("throw",t,c,u)})):r.resolve(s).then((function(t){l.value=t,c(l)}),(function(t){return i("throw",t,c,u)}))}u(f.arg)}var a;o(this,"_invoke",{value:function(t,e){function n(){return new r((function(r,n){i(t,e,r,n)}))}return a=a?a.then(n,n):n()}})}function O(t,r,e){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var c=E(a,e);if(c){if(c===p)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var u=h(t,r,e);if("normal"===u.type){if(n=e.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n="completed",e.method="throw",e.arg=u.arg)}}}function E(t,r){var e=r.method,n=t.iterator[e];if(void 0===n)return r.delegate=null,"throw"===e&&t.iterator.return&&(r.method="return",r.arg=void 0,E(t,r),"throw"===r.method)||"return"!==e&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+e+"' method")),p;var o=h(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function S(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function j(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function r(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=e.call(i,"catchLoc"),u=e.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),j(e),p}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;j(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:k(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),p}},t}function a(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e1?n-1:0),a=1;a=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=e.call(i,"catchLoc"),u=e.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),j(e),p}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;j(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:k(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),p}},t}function a(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e=0||(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function s(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}function h(t){return function(){var r=this,e=arguments;return new Promise((function(n,o){var i=t.apply(r,e);function a(t){s(i,n,o,a,c,"next",t)}function c(t){s(i,n,o,a,c,"throw",t)}a(void 0)}))}}var p=e(187),y=e(549),v=e(106),d=e(185).log,g=e(313),m=e(847),b=e(581),w=b.defaultOptions,x=b.spawnWorker,L=b.terminateWorker,O=b.onMessage,E=b.loadImage,S=b.send,j=0;t.exports=h(i().mark((function t(){var r,e,n,c,f,s,b,P,k,_,T,N,A,G,I,F,R,D,M,C,U,Y,B,z,H,K,W,J,V,Z,Q,q,X,$,tt,rt,et,nt,ot,it,at=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=at.length>0&&void 0!==at[0]?at[0]:"eng",e=at.length>1&&void 0!==at[1]?at[1]:m.LSTM_ONLY,n=at.length>2&&void 0!==at[2]?at[2]:{},c=at.length>3&&void 0!==at[3]?at[3]:{},f=g("Worker",j),s=p(u(u({},w),n)),b=s.logger,P=s.errorHandler,k=l(s,o),_={},T={},N="string"==typeof r?r.split("+"):r,A=e,G=c,I=[m.DEFAULT,m.LSTM_ONLY].includes(e)&&!k.legacyCore,D=new Promise((function(t,r){R=t,F=r})),M=function(t){F(t.message)},(C=x(k)).onerror=M,j+=1,U=function(t,r){_[t]=r},Y=function(t,r){T[t]=r},B=function(t){var r=t.id,e=t.action,n=t.payload;return new Promise((function(t,o){d("[".concat(f,"]: Start ").concat(r,", action=").concat(e));var i="".concat(e,"-").concat(r);U(i,t),Y(i,o),S(C,{workerId:f,jobId:r,action:e,payload:n})}))},z=function(){return console.warn("`load` is depreciated and should be removed from code (workers now come pre-loaded)")},H=function(t){return B(v({id:t,action:"load",payload:{options:{lstmOnly:I,corePath:k.corePath,logging:k.logging}}}))},K=function(t,r,e){return B(v({id:e,action:"FS",payload:{method:"writeFile",args:[t,r]}}))},W=function(t,r){return B(v({id:r,action:"FS",payload:{method:"readFile",args:[t,{encoding:"utf8"}]}}))},J=function(t,r){return B(v({id:r,action:"FS",payload:{method:"unlink",args:[t]}}))},V=function(t,r,e){return B(v({id:e,action:"FS",payload:{method:t,args:r}}))},Z=function(){return console.warn("`loadLanguage` is depreciated and should be removed from code (workers now come with language pre-loaded)")},Q=function(t,r){return B(v({id:r,action:"loadLanguage",payload:{langs:t,options:{langPath:k.langPath,dataPath:k.dataPath,cachePath:k.cachePath,cacheMethod:k.cacheMethod,gzip:k.gzip,lstmOnly:[m.DEFAULT,m.LSTM_ONLY].includes(A)&&!k.legacyLang}}}))},q=function(){return console.warn("`initialize` is depreciated and should be removed from code (workers now come pre-initialized)")},X=function(t,r,e,n){return B(v({id:n,action:"initialize",payload:{langs:t,oem:r,config:e}}))},$=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"eng",r=arguments.length>1?arguments[1]:void 0,e=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(I&&[m.TESSERACT_ONLY,m.TESSERACT_LSTM_COMBINED].includes(r))throw Error("Legacy model requested but code missing.");var o=r||A;A=o;var i=e||G;G=i;var c,u=("string"==typeof t?t.split("+"):t).filter((function(t){return!N.includes(t)}));return N.push.apply(N,function(t){if(Array.isArray(t))return a(t)}(c=u)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(c)||function(t,r){if(t){if("string"==typeof t)return a(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?a(t,r):void 0}}(c)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u.length>0?Q(u,n).then((function(){return X(t,o,i,n)})):X(t,o,i,n)},tt=function(){return B(v({id:arguments.length>1?arguments[1]:void 0,action:"setParameters",payload:{params:arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}}))},rt=function(){var t=h(i().mark((function t(r){var e,n,o,a=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=a.length>1&&void 0!==a[1]?a[1]:{},n=a.length>2&&void 0!==a[2]?a[2]:{blocks:!0,text:!0,hocr:!0,tsv:!0},o=a.length>3?a[3]:void 0,t.t0=B,t.t1=v,t.t2=o,t.next=8,E(r);case 8:return t.t3=t.sent,t.t4=e,t.t5=n,t.t6={image:t.t3,options:t.t4,output:t.t5},t.t7={id:t.t2,action:"recognize",payload:t.t6},t.t8=(0,t.t1)(t.t7),t.abrupt("return",(0,t.t0)(t.t8));case 15:case"end":return t.stop()}}),t)})));return function(r){return t.apply(this,arguments)}}(),et=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Tesseract OCR Result",r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=arguments.length>2?arguments[2]:void 0;return console.log("`getPDF` function is depreciated. `recognize` option `savePDF` should be used instead."),B(v({id:e,action:"getPDF",payload:{title:t,textonly:r}}))},nt=function(){var t=h(i().mark((function t(r,e){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!I){t.next=2;break}throw Error("`worker.detect` requires Legacy model, which was not loaded.");case 2:return t.t0=B,t.t1=v,t.t2=e,t.next=7,E(r);case 7:return t.t3=t.sent,t.t4={image:t.t3},t.t5={id:t.t2,action:"detect",payload:t.t4},t.t6=(0,t.t1)(t.t5),t.abrupt("return",(0,t.t0)(t.t6));case 12:case"end":return t.stop()}}),t)})));return function(r,e){return t.apply(this,arguments)}}(),ot=function(){var t=h(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return null!==C&&(L(C),C=null),t.abrupt("return",Promise.resolve());case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),O(C,(function(t){var r=t.workerId,e=t.jobId,n=t.status,o=t.action,i=t.data,a="".concat(o,"-").concat(e);if("resolve"===n){d("[".concat(r,"]: Complete ").concat(e));var c=i;"recognize"===o?c=y(i):"getPDF"===o&&(c=Array.from(u(u({},i),{},{length:Object.keys(i).length}))),_[a]({jobId:e,data:c})}else if("reject"===n){if(T[a](i),"load"===o&&F(i),!P)throw Error(i);P(i)}else"progress"===n&&b(u(u({},i),{},{userJobId:e}))})),it={id:f,worker:C,setResolve:U,setReject:Y,load:z,writeText:K,readText:W,removeFile:J,FS:V,loadLanguage:Z,initialize:q,reinitialize:$,setParameters:tt,recognize:rt,getPDF:et,detect:nt,terminate:ot},H().then((function(){return Q(r)})).then((function(){return X(r,e,c)})).then((function(){return R(it)})).catch((function(){})),t.abrupt("return",D);case 40:case"end":return t.stop()}}),t)})))},352:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function i(t,r,e){return(r=function(t){var r=function(t,r){if("object"!==n(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===n(r)?r:String(r)}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}e(760);var a=e(936),c=e(311),u=e(793),f=e(5),l=e(847),s=e(711),h=e(185).setLogging;t.exports=function(t){for(var r=1;r{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function e(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function n(t){for(var r=1;r{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var o=e(670);t.exports=function(t){var r={};return"undefined"!=typeof WorkerGlobalScope?r.type="webworker":o()?r.type="electron":"object"===("undefined"==typeof document?"undefined":n(document))?r.type="browser":"object"===("undefined"==typeof process?"undefined":n(process))&&(r.type="node"),void 0===t?r:r[t]}},313:t=>{t.exports=function(t,r){return"".concat(t,"-").concat(r,"-").concat(Math.random().toString(16).slice(3,8))}},185:function(t,r){var e=this,n=!1;r.logging=n,r.setLogging=function(t){n=t},r.log=function(){for(var t=arguments.length,r=new Array(t),o=0;o{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function i(t,r,e){return(r=function(t){var r=function(t,r){if("object"!==n(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===n(r)?r:String(r)}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var a="browser"===e(129)("type")?function(t){return new URL(t,window.location.href).href}:function(t){return t};t.exports=function(t){var r=function(t){for(var r=1;r{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function i(t){for(var r=1;r{var n=e(854),o=e(676),i=e(100),a=e(202),c=e(772),u=e(931);t.exports={defaultOptions:n,spawnWorker:o,terminateWorker:i,onMessage:a,send:c,loadImage:u}},931:t=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function e(){"use strict";e=function(){return t};var t={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function s(t,r,e,n){var o=r&&r.prototype instanceof y?r:y,a=Object.create(o.prototype),c=new P(n||[]);return i(a,"_invoke",{value:O(t,e,c)}),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var p={};function y(){}function v(){}function d(){}var g={};l(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(k([])));b&&b!==n&&o.call(b,c)&&(g=b);var w=d.prototype=y.prototype=Object.create(g);function x(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function L(t,e){function n(i,a,c,u){var f=h(t[i],t,a);if("throw"!==f.type){var l=f.arg,s=l.value;return s&&"object"==r(s)&&o.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):e.resolve(s).then((function(t){l.value=t,c(l)}),(function(t){return n("throw",t,c,u)}))}u(f.arg)}var a;i(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return a=a?a.then(o,o):o()}})}function O(t,r,e){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var c=E(a,e);if(c){if(c===p)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var u=h(t,r,e);if("normal"===u.type){if(n=e.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n="completed",e.method="throw",e.arg=u.arg)}}}function E(t,r){var e=r.method,n=t.iterator[e];if(void 0===n)return r.delegate=null,"throw"===e&&t.iterator.return&&(r.method="return",r.arg=void 0,E(t,r),"throw"===r.method)||"return"!==e&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+e+"' method")),p;var o=h(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function S(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function j(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,n=function r(){for(;++e=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),j(e),p}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;j(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:k(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),p}},t}function n(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}function o(t){return function(){var r=this,e=arguments;return new Promise((function(o,i){var a=t.apply(r,e);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))}}var i=function(t){return new Promise((function(r,e){var n=new FileReader;n.onload=function(){r(n.result)},n.onerror=function(t){var r=t.target.error.code;e(Error("File could not be read! Code=".concat(r)))},n.readAsArrayBuffer(t)}))},a=function(){var t=o(e().mark((function t(r){var n,c,u;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r,void 0!==r){t.next=3;break}return t.abrupt("return","undefined");case 3:if("string"!=typeof r){t.next=16;break}if(!/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(r)){t.next=8;break}n=atob(r.split(",")[1]).split("").map((function(t){return t.charCodeAt(0)})),t.next=14;break;case 8:return t.next=10,fetch(r);case 10:return c=t.sent,t.next=13,c.arrayBuffer();case 13:n=t.sent;case 14:t.next=43;break;case 16:if(!("undefined"!=typeof HTMLElement&&r instanceof HTMLElement)){t.next=30;break}if("IMG"!==r.tagName){t.next=21;break}return t.next=20,a(r.src);case 20:n=t.sent;case 21:if("VIDEO"!==r.tagName){t.next=25;break}return t.next=24,a(r.poster);case 24:n=t.sent;case 25:if("CANVAS"!==r.tagName){t.next=28;break}return t.next=28,new Promise((function(t){r.toBlob(function(){var r=o(e().mark((function r(o){return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,i(o);case 2:n=r.sent,t();case 4:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}())}));case 28:t.next=43;break;case 30:if(!("undefined"!=typeof OffscreenCanvas&&r instanceof OffscreenCanvas)){t.next=39;break}return t.next=33,r.convertToBlob();case 33:return u=t.sent,t.next=36,i(u);case 36:n=t.sent,t.next=43;break;case 39:if(!(r instanceof File||r instanceof Blob)){t.next=43;break}return t.next=42,i(r);case 42:n=t.sent;case 43:return t.abrupt("return",new Uint8Array(n));case 44:case"end":return t.stop()}}),t)})));return function(r){return t.apply(this,arguments)}}();t.exports=a},202:t=>{t.exports=function(t,r){t.onmessage=function(t){var e=t.data;r(e)}}},772:t=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function e(){"use strict";e=function(){return t};var t={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function s(t,r,e,n){var o=r&&r.prototype instanceof y?r:y,a=Object.create(o.prototype),c=new P(n||[]);return i(a,"_invoke",{value:O(t,e,c)}),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var p={};function y(){}function v(){}function d(){}var g={};l(g,c,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(k([])));b&&b!==n&&o.call(b,c)&&(g=b);var w=d.prototype=y.prototype=Object.create(g);function x(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function L(t,e){function n(i,a,c,u){var f=h(t[i],t,a);if("throw"!==f.type){var l=f.arg,s=l.value;return s&&"object"==r(s)&&o.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):e.resolve(s).then((function(t){l.value=t,c(l)}),(function(t){return n("throw",t,c,u)}))}u(f.arg)}var a;i(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return a=a?a.then(o,o):o()}})}function O(t,r,e){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var c=E(a,e);if(c){if(c===p)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var u=h(t,r,e);if("normal"===u.type){if(n=e.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n="completed",e.method="throw",e.arg=u.arg)}}}function E(t,r){var e=r.method,n=t.iterator[e];if(void 0===n)return r.delegate=null,"throw"===e&&t.iterator.return&&(r.method="return",r.arg=void 0,E(t,r),"throw"===r.method)||"return"!==e&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+e+"' method")),p;var o=h(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function S(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function j(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,n=function r(){for(;++e=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),j(e),p}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;j(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:k(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),p}},t}function n(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}t.exports=function(){var t,r=(t=e().mark((function t(r,n){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.postMessage(n);case 1:case"end":return t.stop()}}),t)})),function(){var r=this,e=arguments;return new Promise((function(o,i){var a=t.apply(r,e);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))});return function(t,e){return r.apply(this,arguments)}}()},676:t=>{t.exports=function(t){var r,e=t.workerPath,n=t.workerBlobURL;if(Blob&&URL&&n){var o=new Blob(['importScripts("'.concat(e,'");')],{type:"application/javascript"});r=new Worker(URL.createObjectURL(o))}else r=new Worker(e);return r}},100:t=>{t.exports=function(t){t.terminate()}},147:t=>{"use strict";t.exports={i8:"5.1.1"}}},r={};function e(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={id:n,loaded:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}return e.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),e(352)})())); +//# sourceMappingURL=tesseract.min.js.map \ No newline at end of file diff --git a/static/vendors/zxing/index.min.js b/static/vendors/zxing/index.min.js new file mode 100644 index 00000000..f85dd180 --- /dev/null +++ b/static/vendors/zxing/index.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ZXing={})}(this,(function(t){"use strict";var e,r,n=(e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},e(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}),i=function(t){function e(e,r){var n,i,s,o=this.constructor,a=t.call(this,e,r)||this;return Object.defineProperty(a,"name",{value:o.name,enumerable:!1,configurable:!0}),n=a,i=o.prototype,(s=Object.setPrototypeOf)?s(n,i):n.__proto__=i,function(t,e){void 0===e&&(e=t.constructor);var r=Error.captureStackTrace;r&&r(t,e)}(a),a}return n(e,t),e}(Error);class s extends i{constructor(t=void 0){super(t),this.message=t}getKind(){return this.constructor.kind}}s.kind="Exception";class o extends s{}o.kind="ArgumentException";class a extends s{}a.kind="IllegalArgumentException";class h{constructor(t){if(this.binarizer=t,null===t)throw new a("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(t,e){return this.binarizer.getBlackRow(t,e)}getBlackMatrix(){return null!==this.matrix&&void 0!==this.matrix||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(t,e,r,n){const i=this.binarizer.getLuminanceSource().crop(t,e,r,n);return new h(this.binarizer.createBinarizer(i))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new h(this.binarizer.createBinarizer(t))}rotateCounterClockwise45(){const t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new h(this.binarizer.createBinarizer(t))}toString(){try{return this.getBlackMatrix().toString()}catch(t){return""}}}class l extends s{static getChecksumInstance(){return new l}}l.kind="ChecksumException";class c{constructor(t){this.source=t}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class d{static arraycopy(t,e,r,n,i){for(;i--;)r[n++]=t[e++]}static currentTimeMillis(){return Date.now()}}class u extends s{}u.kind="IndexOutOfBoundsException";class g extends u{constructor(t=void 0,e=void 0){super(e),this.index=t,this.message=e}}g.kind="ArrayIndexOutOfBoundsException";class f{static fill(t,e){for(let r=0,n=t.length;rr)throw new a("fromIndex("+e+") > toIndex("+r+")");if(e<0)throw new g(e);if(r>t)throw new g(r)}static asList(...t){return t}static create(t,e,r){return Array.from({length:t}).map((t=>Array.from({length:e}).fill(r)))}static createInt32Array(t,e,r){return Array.from({length:t}).map((t=>Int32Array.from({length:e}).fill(r)))}static equals(t,e){if(!t)return!1;if(!e)return!1;if(!t.length)return!1;if(!e.length)return!1;if(t.length!==e.length)return!1;for(let r=0,n=t.length;r>1,o=r(e,t[s]);if(o>0)n=s+1;else{if(!(o<0))return s;i=s-1}}return-n-1}static numberComparator(t,e){return t-e}}class w{static numberOfTrailingZeros(t){let e;if(0===t)return 32;let r=31;return e=t<<16,0!==e&&(r-=16,t=e),e=t<<8,0!==e&&(r-=8,t=e),e=t<<4,0!==e&&(r-=4,t=e),e=t<<2,0!==e&&(r-=2,t=e),r-(t<<1>>>31)}static numberOfLeadingZeros(t){if(0===t)return 32;let e=1;return t>>>16==0&&(e+=16,t<<=16),t>>>24==0&&(e+=8,t<<=8),t>>>28==0&&(e+=4,t<<=4),t>>>30==0&&(e+=2,t<<=2),e-=t>>>31,e}static toHexString(t){return t.toString(16)}static toBinaryString(t){return String(parseInt(String(t),2))}static bitCount(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,t+=t>>>8,63&(t+=t>>>16)}static truncDivision(t,e){return Math.trunc(t/e)}static parseInt(t,e=void 0){return parseInt(t,e)}}w.MIN_VALUE_32_BITS=-2147483648,w.MAX_VALUE=Number.MAX_SAFE_INTEGER;class C{constructor(t,e){void 0===t?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=null==e?C.makeArray(t):e)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(t){if(t>32*this.bits.length){const e=C.makeArray(t);d.arraycopy(this.bits,0,e,0,this.bits.length),this.bits=e}}get(t){return!!(this.bits[Math.floor(t/32)]&1<<(31&t))}set(t){this.bits[Math.floor(t/32)]|=1<<(31&t)}flip(t){this.bits[Math.floor(t/32)]^=1<<(31&t)}getNextSet(t){const e=this.size;if(t>=e)return e;const r=this.bits;let n=Math.floor(t/32),i=r[n];i&=~((1<<(31&t))-1);const s=r.length;for(;0===i;){if(++n===s)return e;i=r[n]}const o=32*n+w.numberOfTrailingZeros(i);return o>e?e:o}getNextUnset(t){const e=this.size;if(t>=e)return e;const r=this.bits;let n=Math.floor(t/32),i=~r[n];i&=~((1<<(31&t))-1);const s=r.length;for(;0===i;){if(++n===s)return e;i=~r[n]}const o=32*n+w.numberOfTrailingZeros(i);return o>e?e:o}setBulk(t,e){this.bits[Math.floor(t/32)]=e}setRange(t,e){if(ethis.size)throw new a;if(e===t)return;e--;const r=Math.floor(t/32),n=Math.floor(e/32),i=this.bits;for(let s=r;s<=n;s++){const o=(2<<(sr?0:31&t));i[s]|=o}}clear(){const t=this.bits.length,e=this.bits;for(let r=0;rthis.size)throw new a;if(e===t)return!0;e--;const n=Math.floor(t/32),i=Math.floor(e/32),s=this.bits;for(let o=n;o<=i;o++){const a=(2<<(on?0:31&t))&4294967295;if((s[o]&a)!==(r?a:0))return!1}return!0}appendBit(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++}appendBits(t,e){if(e<0||e>32)throw new a("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(let r=e;r>0;r--)this.appendBit(1==(t>>r-1&1))}appendBitArray(t){const e=t.size;this.ensureCapacity(this.size+e);for(let r=0;r>1&1431655765|(1431655765&r)<<1,r=r>>2&858993459|(858993459&r)<<2,r=r>>4&252645135|(252645135&r)<<4,r=r>>8&16711935|(16711935&r)<<8,r=r>>16&65535|(65535&r)<<16,t[e-i]=r}if(this.size!==32*r){const e=32*r-this.size;let n=t[0]>>>e;for(let i=1;i>>e}t[r-1]=n}this.bits=t}static makeArray(t){return new Int32Array(Math.floor((t+31)/32))}equals(t){if(!(t instanceof C))return!1;const e=t;return this.size===e.size&&f.equals(this.bits,e.bits)}hashCode(){return 31*this.size+f.hashCode(this.bits)}toString(){let t="";for(let e=0,r=this.size;e=900)throw new m("incorect value");const e=I.VALUES_TO_ECI.get(t);if(void 0===e)throw new m("incorect value");return e}static getCharacterSetECIByName(t){const e=I.NAME_TO_ECI.get(t);if(void 0===e)throw new m("incorect value");return e}equals(t){if(!(t instanceof I))return!1;const e=t;return this.getName()===e.getName()}}I.VALUE_IDENTIFIER_TO_ECI=new Map,I.VALUES_TO_ECI=new Map,I.NAME_TO_ECI=new Map,I.Cp437=new I(A.Cp437,Int32Array.from([0,2]),"Cp437"),I.ISO8859_1=new I(A.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),I.ISO8859_2=new I(A.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),I.ISO8859_3=new I(A.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),I.ISO8859_4=new I(A.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),I.ISO8859_5=new I(A.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),I.ISO8859_6=new I(A.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),I.ISO8859_7=new I(A.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),I.ISO8859_8=new I(A.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),I.ISO8859_9=new I(A.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),I.ISO8859_10=new I(A.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),I.ISO8859_11=new I(A.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),I.ISO8859_13=new I(A.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),I.ISO8859_14=new I(A.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),I.ISO8859_15=new I(A.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),I.ISO8859_16=new I(A.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),I.SJIS=new I(A.SJIS,20,"SJIS","Shift_JIS"),I.Cp1250=new I(A.Cp1250,21,"Cp1250","windows-1250"),I.Cp1251=new I(A.Cp1251,22,"Cp1251","windows-1251"),I.Cp1252=new I(A.Cp1252,23,"Cp1252","windows-1252"),I.Cp1256=new I(A.Cp1256,24,"Cp1256","windows-1256"),I.UnicodeBigUnmarked=new I(A.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),I.UTF8=new I(A.UTF8,26,"UTF8","UTF-8"),I.ASCII=new I(A.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),I.Big5=new I(A.Big5,28,"Big5"),I.GB18030=new I(A.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),I.EUC_KR=new I(A.EUC_KR,30,"EUC_KR","EUC-KR");class _ extends s{}_.kind="UnsupportedOperationException";class S{static decode(t,e){const r=this.encodingName(e);return this.customDecoder?this.customDecoder(t,r):"undefined"==typeof TextDecoder||this.shouldDecodeOnFallback(r)?this.decodeFallback(t,r):new TextDecoder(r).decode(t)}static shouldDecodeOnFallback(t){return!S.isBrowser()&&"ISO-8859-1"===t}static encode(t,e){const r=this.encodingName(e);return this.customEncoder?this.customEncoder(t,r):"undefined"==typeof TextEncoder?this.encodeFallback(t):(new TextEncoder).encode(t)}static isBrowser(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)}static encodingName(t){return"string"==typeof t?t:t.getName()}static encodingCharacterSet(t){return t instanceof I?t:I.getCharacterSetECIByName(t)}static decodeFallback(t,e){const r=this.encodingCharacterSet(e);if(S.isDecodeFallbackSupported(r)){let e="";for(let r=0,n=t.length;r3&&239===t[0]&&187===t[1]&&191===t[2];for(let e=0;e0?128&r?o--:s=!1:128&r&&(64&r?(o++,32&r?(o++,16&r?(o++,8&r?s=!1:l++):h++):a++):s=!1)),n&&(r>127&&r<160?n=!1:r>159&&(r<192||215===r||247===r)&&C++),i&&(c>0?r<64||127===r||r>252?i=!1:c--:128===r||160===r||r>239?i=!1:r>160&&r<224?(d++,g=0,u++,u>f&&(f=u)):r>127?(c++,u=0,g++,g>w&&(w=g)):(u=0,g=0))}return s&&o>0&&(s=!1),i&&c>0&&(i=!1),s&&(A||a+h+l>0)?p.UTF8:i&&(p.ASSUME_SHIFT_JIS||f>=3||w>=3)?p.SHIFT_JIS:n&&i?2===f&&2===d||10*C>=r?p.SHIFT_JIS:p.ISO88591:n?p.ISO88591:i?p.SHIFT_JIS:s?p.UTF8:p.PLATFORM_DEFAULT_ENCODING}static format(t,...e){let r=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,(function(t,n,i,s,o,a){if("%%"===t)return"%";if(void 0===e[++r])return;t=s?parseInt(s.substr(1)):void 0;let h,l=o?parseInt(o.substr(1)):void 0;switch(a){case"s":h=e[r];break;case"c":h=e[r][0];break;case"f":h=parseFloat(e[r]).toFixed(t);break;case"p":h=parseFloat(e[r]).toPrecision(t);break;case"e":h=parseFloat(e[r]).toExponential(t);break;case"x":h=parseInt(e[r]).toString(l||16);break;case"d":h=parseFloat(parseInt(e[r],l||10).toPrecision(t)).toFixed(0)}h="object"==typeof h?JSON.stringify(h):(+h).toString(l);let c=parseInt(i),d=i&&i[0]+""=="0"?"0":" ";for(;h.lengths){if(-1===o)o=i-s;else if(i-s!==o)throw new a("row lengths do not match");s=i,h++}l++}else if(t.substring(l,l+e.length)===e)l+=e.length,n[i]=!0,i++;else{if(t.substring(l,l+r.length)!==r)throw new a("illegal character encountered: "+t.substring(l));l+=r.length,n[i]=!1,i++}if(i>s){if(-1===o)o=i-s;else if(i-s!==o)throw new a("row lengths do not match");h++}const c=new R(o,h);for(let t=0;t>>(31&t)&1)}set(t,e){const r=e*this.rowSize+Math.floor(t/32);this.bits[r]|=1<<(31&t)&4294967295}unset(t,e){const r=e*this.rowSize+Math.floor(t/32);this.bits[r]&=~(1<<(31&t)&4294967295)}flip(t,e){const r=e*this.rowSize+Math.floor(t/32);this.bits[r]^=1<<(31&t)&4294967295}xor(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new a("input matrix dimensions do not match");const e=new C(Math.floor(this.width/32)+1),r=this.rowSize,n=this.bits;for(let i=0,s=this.height;ithis.height||i>this.width)throw new a("The region must fit inside the matrix");const o=this.rowSize,h=this.bits;for(let r=e;ra&&(a=t),32*eo){let t=31;for(;h>>>t==0;)t--;32*e+t>o&&(o=32*e+t)}}}return o=0&&0===e[r];)r--;if(r<0)return null;const n=Math.floor(r/t);let i=32*Math.floor(r%t);const s=e[r];let o=31;for(;s>>>o==0;)o--;return i+=o,Int32Array.from([i,n])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(t){if(!(t instanceof R))return!1;const e=t;return this.width===e.width&&this.height===e.height&&this.rowSize===e.rowSize&&f.equals(this.bits,e.bits)}hashCode(){let t=this.width;return t=31*t+this.width,t=31*t+this.height,t=31*t+this.rowSize,t=31*t+f.hashCode(this.bits),t}toString(t="X ",e=" ",r="\n"){return this.buildToString(t,e,r)}buildToString(t,e,r){let n=new T;for(let i=0,s=this.height;i>y.LUMINANCE_SHIFT]++;const o=y.estimateBlackPoint(s);if(n<3)for(let t=0;t>y.LUMINANCE_SHIFT]++}}const s=y.estimateBlackPoint(i),o=t.getMatrix();for(let t=0;ti&&(n=s,i=t[s]),t[s]>r&&(r=t[s]);let s=0,o=0;for(let r=0;ro&&(s=r,o=i)}if(n>s){const t=n;n=s,s=t}if(s-n<=e/16)throw new N;let a=s-1,h=-1;for(let e=s-1;e>n;e--){const i=e-n,o=i*i*(s-e)*(r-t[e]);o>h&&(a=e,h=o)}return a<=D.MINIMUM_DIMENSION&&r>=D.MINIMUM_DIMENSION){const n=t.getMatrix();let i=e>>D.BLOCK_SIZE_POWER;e&D.BLOCK_SIZE_MASK&&i++;let s=r>>D.BLOCK_SIZE_POWER;r&D.BLOCK_SIZE_MASK&&s++;const o=D.calculateBlackPoints(n,i,s,e,r),a=new R(e,r);D.calculateThresholdForBlock(n,i,s,e,r,o,a),this.matrix=a}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(t){return new D(t)}static calculateThresholdForBlock(t,e,r,n,i,s,o){const a=i-D.BLOCK_SIZE,h=n-D.BLOCK_SIZE;for(let i=0;ia&&(l=a);const c=D.cap(i,2,r-3);for(let r=0;rh&&(i=h);const a=D.cap(r,2,e-3);let d=0;for(let t=-2;t<=2;t++){const e=s[c+t];d+=e[a-2]+e[a-1]+e[a]+e[a+1]+e[a+2]}const u=d/25;D.thresholdBlock(t,i,l,u,n,o)}}}static cap(t,e,r){return tr?r:t}static thresholdBlock(t,e,r,n,i,s){for(let o=0,a=r*i+e;os&&(r=s);for(let s=0;so&&(e=o);let h=0,l=255,c=0;for(let i=0,s=r*n+e;ic&&(c=r)}if(c-l>D.MIN_DYNAMIC_RANGE)for(i++,s+=n;i>2*D.BLOCK_SIZE_POWER;if(c-l<=D.MIN_DYNAMIC_RANGE&&(d=l/2,i>0&&s>0)){const t=(a[i-1][s]+2*a[i][s-1]+a[i-1][s-1])/4;l>10}i[r]=n}else for(let e=0,r=0,n=t.length;e>10}i[r]=255-n}return i}getRow(t,e){if(t<0||t>=this.getHeight())throw new a("Requested row is outside the image: "+t);const r=this.getWidth(),n=t*r;return null===e?e=this.buffer.slice(n,n+r):(e.lengthnew B(t.deviceId,t.label)))}))}findDeviceById(t){return L(this,void 0,void 0,(function*(){const e=yield this.listVideoInputDevices();return e?e.find((e=>e.deviceId===t)):null}))}decodeFromInputVideoDevice(t,e){return L(this,void 0,void 0,(function*(){return yield this.decodeOnceFromVideoDevice(t,e)}))}decodeOnceFromVideoDevice(t,e){return L(this,void 0,void 0,(function*(){let r;this.reset(),r=t?{deviceId:{exact:t}}:{facingMode:"environment"};const n={video:r};return yield this.decodeOnceFromConstraints(n,e)}))}decodeOnceFromConstraints(t,e){return L(this,void 0,void 0,(function*(){const r=yield navigator.mediaDevices.getUserMedia(t);return yield this.decodeOnceFromStream(r,e)}))}decodeOnceFromStream(t,e){return L(this,void 0,void 0,(function*(){this.reset();const r=yield this.attachStreamToVideo(t,e);return yield this.decodeOnce(r)}))}decodeFromInputVideoDeviceContinuously(t,e,r){return L(this,void 0,void 0,(function*(){return yield this.decodeFromVideoDevice(t,e,r)}))}decodeFromVideoDevice(t,e,r){return L(this,void 0,void 0,(function*(){let n;n=t?{deviceId:{exact:t}}:{facingMode:"environment"};const i={video:n};return yield this.decodeFromConstraints(i,e,r)}))}decodeFromConstraints(t,e,r){return L(this,void 0,void 0,(function*(){const n=yield navigator.mediaDevices.getUserMedia(t);return yield this.decodeFromStream(n,e,r)}))}decodeFromStream(t,e,r){return L(this,void 0,void 0,(function*(){this.reset();const n=yield this.attachStreamToVideo(t,e);return yield this.decodeContinuously(n,r)}))}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(t,e){return L(this,void 0,void 0,(function*(){const r=this.prepareVideoElement(e);return this.addVideoSource(r,t),this.videoElement=r,this.stream=t,yield this.playVideoOnLoadAsync(r),r}))}playVideoOnLoadAsync(t){return new Promise(((e,r)=>this.playVideoOnLoad(t,(()=>e()))))}playVideoOnLoad(t,e){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(t),t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)}isVideoPlaying(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2}tryPlayVideo(t){return L(this,void 0,void 0,(function*(){if(this.isVideoPlaying(t))console.warn("Trying to play video that is already playing.");else try{yield t.play()}catch(t){console.warn("It was not possible to play the video.")}}))}getMediaElement(t,e){const r=document.getElementById(t);if(!r)throw new o(`element with id '${t}' not found`);if(r.nodeName.toLowerCase()!==e.toLowerCase())throw new o(`element with id '${t}' must be an ${e} element`);return r}decodeFromImage(t,e){if(!t&&!e)throw new o("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)}decodeFromVideo(t,e){if(!t&&!e)throw new o("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)}decodeFromVideoContinuously(t,e,r){if(void 0===t&&void 0===e)throw new o("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,r):this.decodeFromVideoElementContinuously(t,r)}decodeFromImageElement(t){if(!t)throw new o("An image element must be provided.");this.reset();const e=this.prepareImageElement(t);let r;return this.imageElement=e,r=this.isImageLoaded(e)?this.decodeOnce(e,!1,!0):this._decodeOnLoadImage(e),r}decodeFromVideoElement(t){const e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)}decodeFromVideoElementContinuously(t,e){const r=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(r,e)}_decodeFromVideoElementSetup(t){if(!t)throw new o("A video element must be provided.");this.reset();const e=this.prepareVideoElement(t);return this.videoElement=e,e}decodeFromImageUrl(t){if(!t)throw new o("An URL must be provided.");this.reset();const e=this.prepareImageElement();this.imageElement=e;const r=this._decodeOnLoadImage(e);return e.src=t,r}decodeFromVideoUrl(t){if(!t)throw new o("An URL must be provided.");this.reset();const e=this.prepareVideoElement(),r=this.decodeFromVideoElement(e);return e.src=t,r}decodeFromVideoUrlContinuously(t,e){if(!t)throw new o("An URL must be provided.");this.reset();const r=this.prepareVideoElement(),n=this.decodeFromVideoElementContinuously(r,e);return r.src=t,n}_decodeOnLoadImage(t){return new Promise(((e,r)=>{this.imageLoadedListener=()=>this.decodeOnce(t,!1,!0).then(e,r),t.addEventListener("load",this.imageLoadedListener)}))}_decodeOnLoadVideo(t){return L(this,void 0,void 0,(function*(){return yield this.playVideoOnLoadAsync(t),yield this.decodeOnce(t)}))}_decodeOnLoadVideoContinuously(t,e){return L(this,void 0,void 0,(function*(){yield this.playVideoOnLoadAsync(t),this.decodeContinuously(t,e)}))}isImageLoaded(t){return!!t.complete&&0!==t.naturalWidth}prepareImageElement(t){let e;return void 0===t&&(e=document.createElement("img"),e.width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e}prepareVideoElement(t){let e;return t||"undefined"==typeof document||(e=document.createElement("video"),e.width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e}decodeOnce(t,e=!0,r=!0){this._stopAsyncDecode=!1;const n=(i,s)=>{if(this._stopAsyncDecode)return s(new N("Video stream has ended before any code could be detected.")),void(this._stopAsyncDecode=void 0);try{i(this.decode(t))}catch(t){if(e&&t instanceof N||(t instanceof l||t instanceof m)&&r)return setTimeout(n,this._timeBetweenDecodingAttempts,i,s);s(t)}};return new Promise(((t,e)=>n(t,e)))}decodeContinuously(t,e){this._stopContinuousDecode=!1;const r=()=>{if(this._stopContinuousDecode)this._stopContinuousDecode=void 0;else try{const n=this.decode(t);e(n,null),setTimeout(r,this.timeBetweenScansMillis)}catch(t){e(null,t);(t instanceof l||t instanceof m||t instanceof N)&&setTimeout(r,this._timeBetweenDecodingAttempts)}};r()}decode(t){const e=this.createBinaryBitmap(t);return this.decodeBitmap(e)}createBinaryBitmap(t){this.getCaptureCanvasContext(t);let e=!1;t instanceof HTMLVideoElement?(this.drawFrameOnCanvas(t),e=!0):this.drawImageOnCanvas(t);const r=this.getCaptureCanvas(t),n=new b(r,e),i=new D(n);return new h(i)}getCaptureCanvasContext(t){if(!this.captureCanvasContext){const e=this.getCaptureCanvas(t);let r;try{r=e.getContext("2d",{willReadFrequently:!0})}catch(t){r=e.getContext("2d")}this.captureCanvasContext=r}return this.captureCanvasContext}getCaptureCanvas(t){if(!this.captureCanvas){const e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas}drawFrameOnCanvas(t,e={sx:0,sy:0,sWidth:t.videoWidth,sHeight:t.videoHeight,dx:0,dy:0,dWidth:t.videoWidth,dHeight:t.videoHeight},r=this.captureCanvasContext){r.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)}drawImageOnCanvas(t,e={sx:0,sy:0,sWidth:t.naturalWidth,sHeight:t.naturalHeight,dx:0,dy:0,dWidth:t.naturalWidth,dHeight:t.naturalHeight},r=this.captureCanvasContext){r.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)}decodeBitmap(t){return this.reader.decode(t,this._hints)}createCaptureCanvas(t){if("undefined"==typeof document)return this._destroyCaptureCanvas(),null;const e=document.createElement("canvas");let r,n;return void 0!==t&&(t instanceof HTMLVideoElement?(r=t.videoWidth,n=t.videoHeight):t instanceof HTMLImageElement&&(r=t.naturalWidth||t.width,n=t.naturalHeight||t.height)),e.style.width=r+"px",e.style.height=n+"px",e.width=r,e.height=n,e}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach((t=>t.stop())),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){this.videoElement&&(void 0!==this.videoEndedListener&&this.videoElement.removeEventListener("ended",this.videoEndedListener),void 0!==this.videoPlayingEventListener&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),void 0!==this.videoCanPlayListener&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)}_destroyImageElement(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(t,e){try{t.srcObject=e}catch(r){t.src=URL.createObjectURL(e)}}cleanVideoSource(t){try{t.srcObject=null}catch(e){t.src=""}this.videoElement.removeAttribute("src")}}class v{constructor(t,e,r=(null==e?0:8*e.length),n,i,s=d.currentTimeMillis()){this.text=t,this.rawBytes=e,this.numBits=r,this.resultPoints=n,this.format=i,this.timestamp=s,this.text=t,this.rawBytes=e,this.numBits=null==r?null==e?0:8*e.length:r,this.resultPoints=n,this.format=i,this.resultMetadata=null,this.timestamp=null==s?d.currentTimeMillis():s}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(t,e){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)}putAllMetadata(t){null!==t&&(null===this.resultMetadata?this.resultMetadata=t:this.resultMetadata=new Map(t))}addResultPoints(t){const e=this.resultPoints;if(null===e)this.resultPoints=t;else if(null!==t&&t.length>0){const r=new Array(e.length+t.length);d.arraycopy(e,0,r,0,e.length),d.arraycopy(t,0,r,e.length,t.length),this.resultPoints=r}}getTimestamp(){return this.timestamp}toString(){return this.text}}!function(t){t[t.AZTEC=0]="AZTEC",t[t.CODABAR=1]="CODABAR",t[t.CODE_39=2]="CODE_39",t[t.CODE_93=3]="CODE_93",t[t.CODE_128=4]="CODE_128",t[t.DATA_MATRIX=5]="DATA_MATRIX",t[t.EAN_8=6]="EAN_8",t[t.EAN_13=7]="EAN_13",t[t.ITF=8]="ITF",t[t.MAXICODE=9]="MAXICODE",t[t.PDF_417=10]="PDF_417",t[t.QR_CODE=11]="QR_CODE",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(P||(P={}));var k,x=P;!function(t){t[t.OTHER=0]="OTHER",t[t.ORIENTATION=1]="ORIENTATION",t[t.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",t[t.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",t[t.ISSUE_NUMBER=4]="ISSUE_NUMBER",t[t.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",t[t.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",t[t.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",t[t.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",t[t.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",t[t.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"}(k||(k={}));var V,H,U,X,G,W,z=k;class Y{constructor(t,e,r,n,i=-1,s=-1){this.rawBytes=t,this.text=e,this.byteSegments=r,this.ecLevel=n,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=s,this.numBits=null==t?0:8*t.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(t){this.numBits=t}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(t){this.errorsCorrected=t}getErasures(){return this.erasures}setErasures(t){this.erasures=t}getOther(){return this.other}setOther(t){this.other=t}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class Z{exp(t){return this.expTable[t]}log(t){if(0===t)throw new a;return this.logTable[t]}static addOrSubtract(t,e){return t^e}}class K{constructor(t,e){if(0===e.length)throw new a;this.field=t;const r=e.length;if(r>1&&0===e[0]){let t=1;for(;tr.length){const t=e;e=r,r=t}let n=new Int32Array(r.length);const i=r.length-e.length;d.arraycopy(r,0,n,0,i);for(let t=i;t=t.getDegree()&&!n.isZero();){const i=n.getDegree()-t.getDegree(),o=e.multiply(n.getCoefficient(n.getDegree()),s),a=t.multiplyByMonomial(i,o),h=e.buildMonomial(i,o);r=r.addOrSubtract(h),n=n.addOrSubtract(a)}return[r,n]}toString(){let t="";for(let e=this.getDegree();e>=0;e--){let r=this.getCoefficient(e);if(0!==r){if(r<0?(t+=" - ",r=-r):t.length>0&&(t+=" + "),0===e||1!==r){const e=this.field.log(r);0===e?t+="1":1===e?t+="a":(t+="a^",t+=e)}0!==e&&(1===e?t+="x":(t+="x^",t+=e))}}return t}}class q extends s{}q.kind="ArithmeticException";class Q extends Z{constructor(t,e,r){super(),this.primitive=t,this.size=e,this.generatorBase=r;const n=new Int32Array(e);let i=1;for(let r=0;r=e&&(i^=t,i&=e-1);this.expTable=n;const s=new Int32Array(e);for(let t=0;t=(r/2|0);){let t=i,e=o;if(i=s,o=a,i.isZero())throw new j("r_{i-1} was zero");s=t;let r=n.getZero();const h=i.getCoefficient(i.getDegree()),l=n.inverse(h);for(;s.getDegree()>=i.getDegree()&&!s.isZero();){const t=s.getDegree()-i.getDegree(),e=n.multiply(s.getCoefficient(s.getDegree()),l);r=r.addOrSubtract(n.buildMonomial(t,e)),s=s.addOrSubtract(i.multiplyByMonomial(t,e))}if(a=r.multiply(o).addOrSubtract(e),s.getDegree()>=i.getDegree())throw new J("Division algorithm failed to reduce polynomial?")}const h=a.getCoefficient(0);if(0===h)throw new j("sigmaTilde(0) was zero");const l=n.inverse(h);return[a.multiplyScalar(l),s.multiplyScalar(l)]}findErrorLocations(t){const e=t.getDegree();if(1===e)return Int32Array.from([t.getCoefficient(1)]);const r=new Int32Array(e);let n=0;const i=this.field;for(let s=1;s1,c,c+r-1),c+=r-1;else for(let t=r-1;t>=0;--t)l[c++]=!!(e&1<=8?tt.readCode(t,e,8):tt.readCode(t,e,r)<<8-r}static convertBoolArrayToByteArray(t){let e=new Uint8Array((t.length+7)/8);for(let r=0;r","?","[","]","{","}","CTRL_UL"],tt.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class et{constructor(){}static round(t){return isNaN(t)?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0}static distance(t,e,r,n){const i=t-r,s=e-n;return Math.sqrt(i*i+s*s)}static sum(t){let e=0;for(let r=0,n=t.length;r!==n;r++){e+=t[r]}return e}}class rt{static floatToIntBits(t){return t}}rt.MAX_VALUE=Number.MAX_SAFE_INTEGER;class nt{constructor(t,e){this.x=t,this.y=e}getX(){return this.x}getY(){return this.y}equals(t){if(t instanceof nt){const e=t;return this.x===e.x&&this.y===e.y}return!1}hashCode(){return 31*rt.floatToIntBits(this.x)+rt.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(t){const e=this.distance(t[0],t[1]),r=this.distance(t[1],t[2]),n=this.distance(t[0],t[2]);let i,s,o;if(r>=e&&r>=n?(s=t[0],i=t[1],o=t[2]):n>=r&&n>=e?(s=t[1],i=t[0],o=t[2]):(s=t[2],i=t[0],o=t[1]),this.crossProductZ(i,s,o)<0){const t=i;i=o,o=t}t[0]=i,t[1]=s,t[2]=o}static distance(t,e){return et.distance(t.x,t.y,e.x,e.y)}static crossProductZ(t,e,r){const n=e.x,i=e.y;return(r.x-n)*(t.y-i)-(r.y-i)*(t.x-n)}}class it{constructor(t,e){this.bits=t,this.points=e}getBits(){return this.bits}getPoints(){return this.points}}class st extends it{constructor(t,e,r,n,i){super(t,e),this.compact=r,this.nbDatablocks=n,this.nbLayers=i}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class ot{constructor(t,e,r,n){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),null==e&&(e=ot.INIT_SIZE),null==r&&(r=t.getWidth()/2|0),null==n&&(n=t.getHeight()/2|0);const i=e/2|0;if(this.leftInit=r-i,this.rightInit=r+i,this.upInit=n-i,this.downInit=n+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new N}detect(){let t=this.leftInit,e=this.rightInit,r=this.upInit,n=this.downInit,i=!1,s=!0,o=!1,a=!1,h=!1,l=!1,c=!1;const d=this.width,u=this.height;for(;s;){s=!1;let g=!0;for(;(g||!a)&&e=d){i=!0;break}let f=!0;for(;(f||!h)&&n=u){i=!0;break}let w=!0;for(;(w||!l)&&t>=0;)w=this.containsBlackPoint(r,n,t,!1),w?(t--,s=!0,l=!0):l||t--;if(t<0){i=!0;break}let C=!0;for(;(C||!c)&&r>=0;)C=this.containsBlackPoint(t,e,r,!0),C?(r--,s=!0,c=!0):c||r--;if(r<0){i=!0;break}s&&(o=!0)}if(!i&&o){const i=e-t;let s=null;for(let e=1;null===s&&er||o<-1||o>n)throw new N;i=!1,-1===s?(e[t]=0,i=!0):s===r&&(e[t]=r-1,i=!0),-1===o?(e[t+1]=0,i=!0):o===n&&(e[t+1]=n-1,i=!0)}i=!0;for(let t=e.length-2;t>=0&&i;t-=2){const s=Math.floor(e[t]),o=Math.floor(e[t+1]);if(s<-1||s>r||o<-1||o>n)throw new N;i=!1,-1===s?(e[t]=0,i=!0):s===r&&(e[t]=r-1,i=!0),-1===o?(e[t+1]=0,i=!0):o===n&&(e[t+1]=n-1,i=!0)}}}class ht{constructor(t,e,r,n,i,s,o,a,h){this.a11=t,this.a21=e,this.a31=r,this.a12=n,this.a22=i,this.a32=s,this.a13=o,this.a23=a,this.a33=h}static quadrilateralToQuadrilateral(t,e,r,n,i,s,o,a,h,l,c,d,u,g,f,w){const C=ht.quadrilateralToSquare(t,e,r,n,i,s,o,a);return ht.squareToQuadrilateral(h,l,c,d,u,g,f,w).times(C)}transformPoints(t){const e=t.length,r=this.a11,n=this.a12,i=this.a13,s=this.a21,o=this.a22,a=this.a23,h=this.a31,l=this.a32,c=this.a33;for(let d=0;d>1&127):(n<<=10,n+=(e>>2&992)+(e>>1&31))}let i=this.getCorrectedParameterData(n,this.compact);this.compact?(this.nbLayers=1+(i>>6),this.nbDataBlocks=1+(63&i)):(this.nbLayers=1+(i>>11),this.nbDataBlocks=1+(2047&i))}getRotation(t,e){let r=0;t.forEach(((t,n,i)=>{r=(r<<3)+((t>>e-2<<1)+(1&t))})),r=((1&r)<<11)+(r>>1);for(let t=0;t<4;t++)if(w.bitCount(r^this.EXPECTED_CORNER_BITS[t])<=2)return t;throw new N}getCorrectedParameterData(t,e){let r,n;e?(r=7,n=2):(r=10,n=4);let i=r-n,s=new Int32Array(r);for(let e=r-1;e>=0;--e)s[e]=15&t,t>>=4;try{new $(Q.AZTEC_PARAM).decode(s,i)}catch(t){throw new N}let o=0;for(let t=0;t2){let r=this.distancePoint(h,t)*this.nbCenterLayers/(this.distancePoint(i,e)*(this.nbCenterLayers+2));if(r<.75||r>1.25||!this.isWhiteOrBlackRectangle(t,o,a,h))break}e=t,r=o,n=a,i=h,s=!s}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new N;this.compact=5===this.nbCenterLayers;let o=new nt(e.getX()+.5,e.getY()-.5),a=new nt(r.getX()+.5,r.getY()+.5),h=new nt(n.getX()-.5,n.getY()+.5),l=new nt(i.getX()-.5,i.getY()-.5);return this.expandSquare([o,a,h,l],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let t,e,r,n;try{let i=new ot(this.image).detect();t=i[0],e=i[1],r=i[2],n=i[3]}catch(i){let s=this.image.getWidth()/2,o=this.image.getHeight()/2;t=this.getFirstDifferent(new dt(s+7,o-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new dt(s+7,o+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new dt(s-7,o+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new dt(s-7,o-7),!1,-1,-1).toResultPoint()}let i=et.round((t.getX()+n.getX()+e.getX()+r.getX())/4),s=et.round((t.getY()+n.getY()+e.getY()+r.getY())/4);try{let o=new ot(this.image,15,i,s).detect();t=o[0],e=o[1],r=o[2],n=o[3]}catch(o){t=this.getFirstDifferent(new dt(i+7,s-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new dt(i+7,s+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new dt(i-7,s+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new dt(i-7,s-7),!1,-1,-1).toResultPoint()}return i=et.round((t.getX()+n.getX()+e.getX()+r.getX())/4),s=et.round((t.getY()+n.getY()+e.getY()+r.getY())/4),new dt(i,s)}getMatrixCornerPoints(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())}sampleGrid(t,e,r,n,i){let s=ct.getInstance(),o=this.getDimension(),a=o/2-this.nbCenterLayers,h=o/2+this.nbCenterLayers;return s.sampleGrid(t,o,o,a,a,h,a,h,h,a,h,e.getX(),e.getY(),r.getX(),r.getY(),n.getX(),n.getY(),i.getX(),i.getY())}sampleLine(t,e,r){let n=0,i=this.distanceResultPoint(t,e),s=i/r,o=t.getX(),a=t.getY(),h=s*(e.getX()-t.getX())/i,l=s*(e.getY()-t.getY())/i;for(let t=0;t.1&&c<.9?0:c<=.1===h?1:-1}getFirstDifferent(t,e,r,n){let i=t.getX()+r,s=t.getY()+n;for(;this.isValid(i,s)&&this.image.get(i,s)===e;)i+=r,s+=n;for(i-=r,s-=n;this.isValid(i,s)&&this.image.get(i,s)===e;)i+=r;for(i-=r;this.isValid(i,s)&&this.image.get(i,s)===e;)s+=n;return s-=n,new dt(i,s)}expandSquare(t,e,r){let n=r/(2*e),i=t[0].getX()-t[2].getX(),s=t[0].getY()-t[2].getY(),o=(t[0].getX()+t[2].getX())/2,a=(t[0].getY()+t[2].getY())/2,h=new nt(o+n*i,a+n*s),l=new nt(o-n*i,a-n*s);return i=t[1].getX()-t[3].getX(),s=t[1].getY()-t[3].getY(),o=(t[1].getX()+t[3].getX())/2,a=(t[1].getY()+t[3].getY())/2,[h,new nt(o+n*i,a+n*s),l,new nt(o-n*i,a-n*s)]}isValid(t,e){return t>=0&&t0&&e{r.foundPossibleResultPoint(t)}))}}reset(){}}class ft{decode(t,e){try{return this.doDecode(t,e)}catch(r){if(e&&!0===e.get(E.TRY_HARDER)&&t.isRotateSupported()){const r=t.rotateCounterClockwise(),n=this.doDecode(r,e),i=n.getResultMetadata();let s=270;null!==i&&!0===i.get(z.ORIENTATION)&&(s+=i.get(z.ORIENTATION)%360),n.putMetadata(z.ORIENTATION,s);const o=n.getResultPoints();if(null!==o){const t=r.getHeight();for(let e=0;e>(s?8:5));let a;a=s?n:15;const h=Math.trunc(n/2);for(let s=0;s=n)break;try{i=t.getBlackRow(l,i)}catch(t){continue}for(let t=0;t<2;t++){if(1===t&&(i.reverse(),e&&!0===e.get(E.NEED_RESULT_POINT_CALLBACK))){const t=new Map;e.forEach(((e,r)=>t.set(r,e))),t.delete(E.NEED_RESULT_POINT_CALLBACK),e=t}try{const n=this.decodeRow(l,i,e);if(1===t){n.putMetadata(z.ORIENTATION,180);const t=n.getResultPoints();null!==t&&(t[0]=new nt(r-t[0].getX()-1,t[0].getY()),t[1]=new nt(r-t[1].getX()-1,t[1].getY()))}return n}catch(t){}}}throw new N}static recordPattern(t,e,r){const n=r.length;for(let t=0;t=i)throw new N;let s=!t.get(e),o=0,a=e;for(;a0&&n>=0;)t.get(--e)!==i&&(n--,i=!i);if(n>=0)throw new N;ft.recordPattern(t,e+1,r)}static patternMatchVariance(t,e,r){const n=t.length;let i=0,s=0;for(let r=0;rs?n-s:s-n;if(h>r)return Number.POSITIVE_INFINITY;a+=h}return a/i}}class wt extends ft{static findStartPattern(t){const e=t.getSize(),r=t.getNextSet(0);let n=0,i=Int32Array.from([0,0,0,0,0,0]),s=r,o=!1;for(let a=r;a=0&&t.isRange(Math.max(0,s-(a-s)/2),s,!1))return Int32Array.from([s,a,r]);s+=i[0]+i[1],i=i.slice(2,i.length),i[n-1]=0,i[n]=0,n--}else n++;i[n]=1,o=!o}throw new N}static decodeCode(t,e,r){ft.recordPattern(t,r,e);let n=wt.MAX_AVG_VARIANCE,i=-1;for(let t=0;t=0)return i;throw new N}decodeRow(t,e,r){const n=r&&!0===r.get(E.ASSUME_GS1),i=wt.findStartPattern(e),s=i[2];let o=0;const a=new Uint8Array(20);let h;switch(a[o++]=s,s){case wt.CODE_START_A:h=wt.CODE_CODE_A;break;case wt.CODE_START_B:h=wt.CODE_CODE_B;break;case wt.CODE_START_C:h=wt.CODE_CODE_C;break;default:throw new m}let c=!1,d=!1,u="",g=i[0],f=i[1];const w=Int32Array.from([0,0,0,0,0,0]);let C=0,A=0,I=s,_=0,S=!0,p=!1,T=!1;for(;!c;){const t=d;switch(d=!1,C=A,A=wt.decodeCode(e,w,f),a[o++]=A,A!==wt.CODE_STOP&&(S=!0),A!==wt.CODE_STOP&&(_++,I+=_*A),g=f,f+=w.reduce(((t,e)=>t+e),0),A){case wt.CODE_START_A:case wt.CODE_START_B:case wt.CODE_START_C:throw new m}switch(h){case wt.CODE_CODE_A:if(A<64)u+=T===p?String.fromCharCode(" ".charCodeAt(0)+A):String.fromCharCode(" ".charCodeAt(0)+A+128),T=!1;else if(A<96)u+=T===p?String.fromCharCode(A-64):String.fromCharCode(A+64),T=!1;else switch(A!==wt.CODE_STOP&&(S=!1),A){case wt.CODE_FNC_1:n&&(0===u.length?u+="]C1":u+=String.fromCharCode(29));break;case wt.CODE_FNC_2:case wt.CODE_FNC_3:break;case wt.CODE_FNC_4_A:!p&&T?(p=!0,T=!1):p&&T?(p=!1,T=!1):T=!0;break;case wt.CODE_SHIFT:d=!0,h=wt.CODE_CODE_B;break;case wt.CODE_CODE_B:h=wt.CODE_CODE_B;break;case wt.CODE_CODE_C:h=wt.CODE_CODE_C;break;case wt.CODE_STOP:c=!0}break;case wt.CODE_CODE_B:if(A<96)u+=T===p?String.fromCharCode(" ".charCodeAt(0)+A):String.fromCharCode(" ".charCodeAt(0)+A+128),T=!1;else switch(A!==wt.CODE_STOP&&(S=!1),A){case wt.CODE_FNC_1:n&&(0===u.length?u+="]C1":u+=String.fromCharCode(29));break;case wt.CODE_FNC_2:case wt.CODE_FNC_3:break;case wt.CODE_FNC_4_B:!p&&T?(p=!0,T=!1):p&&T?(p=!1,T=!1):T=!0;break;case wt.CODE_SHIFT:d=!0,h=wt.CODE_CODE_A;break;case wt.CODE_CODE_A:h=wt.CODE_CODE_A;break;case wt.CODE_CODE_C:h=wt.CODE_CODE_C;break;case wt.CODE_STOP:c=!0}break;case wt.CODE_CODE_C:if(A<100)A<10&&(u+="0"),u+=A;else switch(A!==wt.CODE_STOP&&(S=!1),A){case wt.CODE_FNC_1:n&&(0===u.length?u+="]C1":u+=String.fromCharCode(29));break;case wt.CODE_CODE_A:h=wt.CODE_CODE_A;break;case wt.CODE_CODE_B:h=wt.CODE_CODE_B;break;case wt.CODE_STOP:c=!0}}t&&(h=h===wt.CODE_CODE_A?wt.CODE_CODE_B:wt.CODE_CODE_A)}const R=f-g;if(f=e.getNextUnset(f),!e.isRange(f,Math.min(e.getSize(),f+(f-g)/2),!1))throw new N;if(I-=_*C,I%103!==C)throw new l;const y=u.length;if(0===y)throw new N;y>0&&S&&(u=h===wt.CODE_CODE_C?u.substring(0,y-2):u.substring(0,y-1));const D=(i[1]+i[0])/2,O=g+R/2,M=a.length,b=new Uint8Array(M);for(let t=0;tn&&(i=e);n=i,e=0;let s=0,o=0;for(let i=0;in&&(o|=1<0;i++){let r=t[i];if(r>n&&(e--,2*r>=s))return-1}return o}}while(e>3);return-1}static patternToChar(t){for(let e=0;e="A"&&i<="Z"))throw new m;s=String.fromCharCode(i.charCodeAt(0)+32);break;case"$":if(!(i>="A"&&i<="Z"))throw new m;s=String.fromCharCode(i.charCodeAt(0)-64);break;case"%":if(i>="A"&&i<="E")s=String.fromCharCode(i.charCodeAt(0)-38);else if(i>="F"&&i<="J")s=String.fromCharCode(i.charCodeAt(0)-11);else if(i>="K"&&i<="O")s=String.fromCharCode(i.charCodeAt(0)+16);else if(i>="P"&&i<="T")s=String.fromCharCode(i.charCodeAt(0)+43);else if("U"===i)s="\0";else if("V"===i)s="@";else if("W"===i)s="`";else{if("X"!==i&&"Y"!==i&&"Z"!==i)throw new m;s=""}break;case"/":if(i>="A"&&i<="O")s=String.fromCharCode(i.charCodeAt(0)-32);else{if("Z"!==i)throw new m;s=":"}}r+=s,n++}else r+=e}return r}}Ct.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",Ct.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],Ct.ASTERISK_ENCODING=148;class At extends ft{constructor(){super(),this.decodeRowResult="",this.counters=new Int32Array(6)}decodeRow(t,e,r){let n,i,s=this.findAsteriskPattern(e),o=e.getNextSet(s[1]),a=e.getSize(),h=this.counters;h.fill(0),this.decodeRowResult="";do{At.recordPattern(e,o,h);let t=this.toPattern(h);if(t<0)throw new N;n=this.patternToChar(t),this.decodeRowResult+=n,i=o;for(let t of h)o+=t;o=e.getNextSet(o)}while("*"!==n);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let l=0;for(let t of h)l+=t;if(o===a||!e.get(o))throw new N;if(this.decodeRowResult.length<2)throw new N;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);let c=this.decodeExtended(this.decodeRowResult),d=(s[1]+s[0])/2,u=i+l/2;return new v(c,null,0,[new nt(d,t),new nt(u,t)],x.CODE_93,(new Date).getTime())}findAsteriskPattern(t){let e=t.getSize(),r=t.getNextSet(0);this.counters.fill(0);let n=this.counters,i=r,s=!1,o=n.length,a=0;for(let h=r;h4)return-1;if(1&i)r<<=n;else for(let t=0;t="a"&&i<="d"){if(n>=e-1)throw new m;let s=t.charAt(n+1),o="\0";switch(i){case"d":if(!(s>="A"&&s<="Z"))throw new m;o=String.fromCharCode(s.charCodeAt(0)+32);break;case"a":if(!(s>="A"&&s<="Z"))throw new m;o=String.fromCharCode(s.charCodeAt(0)-64);break;case"b":if(s>="A"&&s<="E")o=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")o=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")o=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")o=String.fromCharCode(s.charCodeAt(0)+43);else if("U"===s)o="\0";else if("V"===s)o="@";else if("W"===s)o="`";else{if(!(s>="X"&&s<="Z"))throw new m;o=String.fromCharCode(127)}break;case"c":if(s>="A"&&s<="O")o=String.fromCharCode(s.charCodeAt(0)-32);else{if("Z"!==s)throw new m;o=":"}}r+=o,n++}else r+=i}return r}checkChecksums(t){let e=t.length;this.checkOneChecksum(t,e-2,20),this.checkOneChecksum(t,e-1,15)}checkOneChecksum(t,e,r){let n=1,i=0;for(let s=e-1;s>=0;s--)i+=n*At.ALPHABET_STRING.indexOf(t.charAt(s)),++n>r&&(n=1);if(t.charAt(e)!==At.ALPHABET_STRING[i%47])throw new l}}At.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",At.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],At.ASTERISK_ENCODING=At.CHARACTER_ENCODINGS[47];class Et extends ft{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(t,e,r){let n=this.decodeStart(e),i=this.decodeEnd(e),s=new T;Et.decodeMiddle(e,n[1],i[0],s);let o=s.toString(),a=null;null!=r&&(a=r.get(E.ALLOWED_LENGTHS)),null==a&&(a=Et.DEFAULT_ALLOWED_LENGTHS);let h=o.length,l=!1,c=0;for(let t of a){if(h===t){l=!0;break}t>c&&(c=t)}if(!l&&h>c&&(l=!0),!l)throw new m;const d=[new nt(n[1],t),new nt(i[0],t)];return new v(o,null,0,d,x.ITF,(new Date).getTime())}static decodeMiddle(t,e,r,n){let i=new Int32Array(10),s=new Int32Array(5),o=new Int32Array(5);for(i.fill(0),s.fill(0),o.fill(0);e0&&n>=0&&!t.get(n);n--)r--;if(0!==r)throw new N}static skipWhiteSpace(t){const e=t.getSize(),r=t.getNextSet(0);if(r===e)throw new N;return r}decodeEnd(t){t.reverse();try{let e,r=Et.skipWhiteSpace(t);try{e=Et.findGuardPattern(t,r,Et.END_PATTERN_REVERSED[0])}catch(n){n instanceof N&&(e=Et.findGuardPattern(t,r,Et.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,e[0]);let n=e[0];return e[0]=t.getSize()-e[1],e[1]=t.getSize()-n,e}finally{t.reverse()}}static findGuardPattern(t,e,r){let n=r.length,i=new Int32Array(n),s=t.getSize(),o=!1,a=0,h=e;i.fill(0);for(let l=e;l=0)return r%10;throw new N}}Et.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],Et.MAX_AVG_VARIANCE=.38,Et.MAX_INDIVIDUAL_VARIANCE=.5,Et.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],Et.START_PATTERN=Int32Array.from([1,1,1,1]),Et.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class mt extends ft{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(t){let e,r=!1,n=0,i=Int32Array.from([0,0,0]);for(;!r;){i=Int32Array.from([0,0,0]),e=mt.findGuardPattern(t,n,!1,this.START_END_PATTERN,i);let s=e[0];n=e[1];let o=s-(n-s);o>=0&&(r=t.isRange(o,s,!1))}return e}static checkChecksum(t){return mt.checkStandardUPCEANChecksum(t)}static checkStandardUPCEANChecksum(t){let e=t.length;if(0===e)return!1;let r=parseInt(t.charAt(e-1),10);return mt.getStandardUPCEANChecksum(t.substring(0,e-1))===r}static getStandardUPCEANChecksum(t){let e=t.length,r=0;for(let n=e-1;n>=0;n-=2){let e=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);if(e<0||e>9)throw new m;r+=e}r*=3;for(let n=e-2;n>=0;n-=2){let e=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);if(e<0||e>9)throw new m;r+=e}return(1e3-r)%10}static decodeEnd(t,e){return mt.findGuardPattern(t,e,!1,mt.START_END_PATTERN,new Int32Array(mt.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(t,e,r,n){return this.findGuardPattern(t,e,r,n,new Int32Array(n.length))}static findGuardPattern(t,e,r,n,i){let s=t.getSize(),o=0,a=e=r?t.getNextUnset(e):t.getNextSet(e),h=n.length,l=r;for(let r=e;r=0)return s;throw new N}}mt.MAX_AVG_VARIANCE=.48,mt.MAX_INDIVIDUAL_VARIANCE=.7,mt.START_END_PATTERN=Int32Array.from([1,1,1]),mt.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),mt.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),mt.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])];class It{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(t,e,r){let n=this.decodeRowStringBuffer,i=this.decodeMiddle(e,r,n),s=n.toString(),o=It.parseExtensionString(s),a=[new nt((r[0]+r[1])/2,t),new nt(i,t)],h=new v(s,null,0,a,x.UPC_EAN_EXTENSION,(new Date).getTime());return null!=o&&h.putAllMetadata(o),h}decodeMiddle(t,e,r){let n=this.decodeMiddleCounters;n[0]=0,n[1]=0,n[2]=0,n[3]=0;let i=t.getSize(),s=e[1],o=0;for(let e=0;e<5&&s=10&&(o|=1<<4-e),4!==e&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(5!==r.length)throw new N;let a=this.determineCheckDigit(o);if(It.extensionChecksum(r.toString())!==a)throw new N;return s}static extensionChecksum(t){let e=t.length,r=0;for(let n=e-2;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);r*=3;for(let n=e-1;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);return r*=3,r%10}determineCheckDigit(t){for(let e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new N}static parseExtensionString(t){if(5!==t.length)return null;let e=It.parseExtension5String(t);return null==e?null:new Map([[z.SUGGESTED_PRICE,e]])}static parseExtension5String(t){let e;switch(t.charAt(0)){case"0":e="£";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e=""}let r=parseInt(t.substring(1)),n=r%100;return e+(r/100).toString()+"."+(n<10?"0"+n:n.toString())}}class _t{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(t,e,r){let n=this.decodeRowStringBuffer,i=this.decodeMiddle(e,r,n),s=n.toString(),o=_t.parseExtensionString(s),a=[new nt((r[0]+r[1])/2,t),new nt(i,t)],h=new v(s,null,0,a,x.UPC_EAN_EXTENSION,(new Date).getTime());return null!=o&&h.putAllMetadata(o),h}decodeMiddle(t,e,r){let n=this.decodeMiddleCounters;n[0]=0,n[1]=0,n[2]=0,n[3]=0;let i=t.getSize(),s=e[1],o=0;for(let e=0;e<2&&s=10&&(o|=1<<1-e),1!==e&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(2!==r.length)throw new N;if(parseInt(r.toString())%4!==o)throw new N;return s}static parseExtensionString(t){return 2!==t.length?null:new Map([[z.ISSUE_NUMBER,parseInt(t)]])}}class St{static decodeRow(t,e,r){let n=mt.findGuardPattern(e,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new It).decodeRow(t,e,n)}catch(r){return(new _t).decodeRow(t,e,n)}}}St.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class pt extends mt{constructor(){super(),this.decodeRowStringBuffer="",pt.L_AND_G_PATTERNS=pt.L_PATTERNS.map((t=>Int32Array.from(t)));for(let t=10;t<20;t++){let e=pt.L_PATTERNS[t-10],r=new Int32Array(e.length);for(let t=0;t=e.getSize()||!e.isRange(c,d,!1))throw new N;let u=a.toString();if(u.length<8)throw new m;if(!pt.checkChecksum(u))throw new l;let g=(n[1]+n[0])/2,f=(h[1]+h[0])/2,w=this.getBarcodeFormat(),C=[new nt(g,t),new nt(f,t)],A=new v(u,null,0,C,w,(new Date).getTime()),I=0;try{let r=St.decodeRow(t,e,h[1]);A.putMetadata(z.UPC_EAN_EXTENSION,r.getText()),A.putAllMetadata(r.getResultMetadata()),A.addResultPoints(r.getResultPoints()),I=r.getText().length}catch(t){}let _=null==r?null:r.get(E.ALLOWED_EAN_EXTENSIONS);if(null!=_){let t=!1;for(let e in _)if(I.toString()===e){t=!0;break}if(!t)throw new N}return w===x.EAN_13||x.UPC_A,A}static checkChecksum(t){return pt.checkStandardUPCEANChecksum(t)}static checkStandardUPCEANChecksum(t){let e=t.length;if(0===e)return!1;let r=parseInt(t.charAt(e-1),10);return pt.getStandardUPCEANChecksum(t.substring(0,e-1))===r}static getStandardUPCEANChecksum(t){let e=t.length,r=0;for(let n=e-1;n>=0;n-=2){let e=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);if(e<0||e>9)throw new m;r+=e}r*=3;for(let n=e-2;n>=0;n-=2){let e=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);if(e<0||e>9)throw new m;r+=e}return(1e3-r)%10}static decodeEnd(t,e){return pt.findGuardPattern(t,e,!1,pt.START_END_PATTERN,new Int32Array(pt.START_END_PATTERN.length).fill(0))}}class Tt extends pt{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(t,e,r){let n=this.decodeMiddleCounters;n[0]=0,n[1]=0,n[2]=0,n[3]=0;let i=t.getSize(),s=e[1],o=0;for(let e=0;e<6&&s=10&&(o|=1<<5-e)}r=Tt.determineFirstDigit(r,o),s=pt.findGuardPattern(t,s,!0,pt.MIDDLE_PATTERN,new Int32Array(pt.MIDDLE_PATTERN.length).fill(0))[1];for(let e=0;e<6&&st));n[0]=0,n[1]=0,n[2]=0,n[3]=0;const i=t.getSize();let s=e[1],o=0;for(let e=0;e<6&&s=10&&(o|=1<<5-e)}return yt.determineNumSysAndCheckDigit(new T(r),o),s}decodeEnd(t,e){return yt.findGuardPatternWithoutCounters(t,e,!0,yt.MIDDLE_END_PATTERN)}checkChecksum(t){return pt.checkChecksum(yt.convertUPCEtoUPCA(t))}static determineNumSysAndCheckDigit(t,e){for(let r=0;r<=1;r++)for(let n=0;n<10;n++)if(e===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[r][n])return t.insert(0,"0"+r),void t.append("0"+n);throw N.getNotFoundInstance()}getBarcodeFormat(){return x.UPC_E}static convertUPCEtoUPCA(t){const e=t.slice(1,7).split("").map((t=>t.charCodeAt(0))),r=new T;r.append(t.charAt(0));let n=e[5];switch(n){case 0:case 1:case 2:r.appendChars(e,0,2),r.append(n),r.append("0000"),r.appendChars(e,2,3);break;case 3:r.appendChars(e,0,3),r.append("00000"),r.appendChars(e,3,2);break;case 4:r.appendChars(e,0,4),r.append("00000"),r.append(e[4]);break;default:r.appendChars(e,0,5),r.append("0000"),r.append(n)}return t.length>=8&&r.append(t.charAt(7)),r.toString()}}yt.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),yt.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])];class Dt extends ft{constructor(t){super();let e=null==t?null:t.get(E.POSSIBLE_FORMATS),r=[];null!=e&&(e.indexOf(x.EAN_13)>-1&&r.push(new Tt),e.indexOf(x.UPC_A)>-1&&r.push(new Nt),e.indexOf(x.EAN_8)>-1&&r.push(new Rt),e.indexOf(x.UPC_E)>-1&&r.push(new yt)),0===r.length&&(r.push(new Tt),r.push(new Nt),r.push(new Rt),r.push(new yt)),this.readers=r}decodeRow(t,e,r){for(let n of this.readers)try{const i=n.decodeRow(t,e,r),s=i.getBarcodeFormat()===x.EAN_13&&"0"===i.getText().charAt(0),o=null==r?null:r.get(E.POSSIBLE_FORMATS),a=null==o||o.includes(x.UPC_A);if(s&&a){const t=i.getRawBytes(),e=new v(i.getText().substring(1),t,t?t.length:null,i.getResultPoints(),x.UPC_A);return e.putAllMetadata(i.getResultMetadata()),e}return i}catch(t){}throw new N}reset(){for(let t of this.readers)t.reset()}}class Ot extends ft{constructor(){super(...arguments),this.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"}}decodeRow(t,e,r){let n=this.getValidRowData(e);if(!n)throw new N;let i=this.codaBarDecodeRow(n.row);if(!i)throw new N;return new v(i,null,0,[new nt(n.left,t),new nt(n.right,t)],x.CODABAR,(new Date).getTime())}getValidRowData(t){let e=t.toArray(),r=e.indexOf(!0);if(-1===r)return null;let n=e.lastIndexOf(!0);if(n<=r)return null;e=e.slice(r,n+1);let i=[],s=e[0],o=1;for(let t=1;t(t+e)/2),0));for(;t.length>0;){const n=t.splice(0,8).splice(0,7).map((t=>tn&&(n=e[i],r=i);t[r]++}static decrement(t,e){let r=0,n=e[0];for(let i=1;i=Mt.MIN_FINDER_PATTERN_RATIO&&r<=Mt.MAX_FINDER_PATTERN_RATIO){let e=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;for(let n of t)n>r&&(r=n),n=o-a-1&&(t-=Pt.combins(n-h-(o-a),o-a-2)),o-a-1>1){let r=0;for(let t=n-h-(o-a-2);t>e;t--)r+=Pt.combins(n-h-t-1,o-a-3);t-=r*(o-1-a)}else n-h>e&&t--;i+=t}n-=h}return i}static combins(t,e){let r,n;t-e>e?(n=e,r=t-e):(n=t-e,r=e);let i=1,s=1;for(let e=t;e>r;e--)i*=e,s<=n&&(i/=s,s++);for(;s<=n;)i/=s,s++;return i}}class Lt{static buildBitArray(t){let e=2*t.length-1;null==t[t.length-1].getRightChar()&&(e-=1);let r=new C(12*e),n=0,i=t[0].getRightChar().getValue();for(let t=11;t>=0;--t)i&1<=0;--t)s&1<=0;--e)t&1<10||r<0||r>10)throw new m;this.firstDigit=e,this.secondDigit=r}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return 10*this.firstDigit+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===Vt.FNC1}isSecondDigitFNC1(){return this.secondDigit===Vt.FNC1}isAnyFNC1(){return this.firstDigit===Vt.FNC1||this.secondDigit===Vt.FNC1}}Vt.FNC1=10;class Ht{constructor(){}static parseFieldsInGeneralPurpose(t){if(!t)return null;if(t.length<2)throw new N;let e=t.substring(0,2);for(let r of Ht.TWO_DIGIT_DATA_LENGTH)if(r[0]===e)return r[1]===Ht.VARIABLE_LENGTH?Ht.processVariableAI(2,r[2],t):Ht.processFixedAI(2,r[1],t);if(t.length<3)throw new N;let r=t.substring(0,3);for(let e of Ht.THREE_DIGIT_DATA_LENGTH)if(e[0]===r)return e[1]===Ht.VARIABLE_LENGTH?Ht.processVariableAI(3,e[2],t):Ht.processFixedAI(3,e[1],t);for(let e of Ht.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(e[0]===r)return e[1]===Ht.VARIABLE_LENGTH?Ht.processVariableAI(4,e[2],t):Ht.processFixedAI(4,e[1],t);if(t.length<4)throw new N;let n=t.substring(0,4);for(let e of Ht.FOUR_DIGIT_DATA_LENGTH)if(e[0]===n)return e[1]===Ht.VARIABLE_LENGTH?Ht.processVariableAI(4,e[2],t):Ht.processFixedAI(4,e[1],t);throw new N}static processFixedAI(t,e,r){if(r.lengththis.information.getSize())return t+4<=this.information.getSize();for(let e=t;ethis.information.getSize()){let e=this.extractNumericValueFromBitArray(t,4);return new Vt(this.information.getSize(),0===e?Vt.FNC1:e-1,Vt.FNC1)}let e=this.extractNumericValueFromBitArray(t,7);return new Vt(t+7,(e-8)/11,(e-8)%11)}extractNumericValueFromBitArray(t,e){return Ut.extractNumericValueFromBitArray(this.information,t,e)}static extractNumericValueFromBitArray(t,e,r){let n=0;for(let i=0;ithis.information.getSize())return!1;let e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+7>this.information.getSize())return!1;let r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<116)return!0;if(t+8>this.information.getSize())return!1;let n=this.extractNumericValueFromBitArray(t,8);return n>=232&&n<253}decodeIsoIec646(t){let e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new kt(t+5,kt.FNC1);if(e>=5&&e<15)return new kt(t+5,"0"+(e-5));let r,n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<90)return new kt(t+7,""+(n+1));if(n>=90&&n<116)return new kt(t+7,""+(n+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new m}return new kt(t+8,r)}isStillAlpha(t){if(t+5>this.information.getSize())return!1;let e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;let r=this.extractNumericValueFromBitArray(t,6);return r>=16&&r<63}decodeAlphanumeric(t){let e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new kt(t+5,kt.FNC1);if(e>=5&&e<15)return new kt(t+5,"0"+(e-5));let r,n=this.extractNumericValueFromBitArray(t,6);if(n>=32&&n<58)return new kt(t+6,""+(n+33));switch(n){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new J("Decoding invalid alphanumeric value: "+n)}return new kt(t+6,r)}isAlphaTo646ToAlphaLatch(t){if(t+1>this.information.getSize())return!1;for(let e=0;e<5&&e+tthis.information.getSize())return!1;for(let e=t;ethis.information.getSize())return!1;for(let e=0;e<4&&e+t{e.forEach((e=>{t.getLeftChar().getValue()===e.getLeftChar().getValue()&&t.getRightChar().getValue()===e.getRightChar().getValue()&&t.getFinderPatter().getValue()===e.getFinderPatter().getValue()&&(r=!0)}))})),r}}class re extends Mt{constructor(){super(...arguments),this.pairs=new Array(re.MAX_PAIRS),this.rows=new Array,this.startEnd=[2]}decodeRow(t,e,r){this.pairs.length=0,this.startFromEven=!1;try{return re.constructResult(this.decodeRow2pairs(t,e))}catch(t){}return this.pairs.length=0,this.startFromEven=!0,re.constructResult(this.decodeRow2pairs(t,e))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(t,e){let r,n=!1;for(;!n;)try{this.pairs.push(this.retrieveNextPair(e,this.pairs,t))}catch(t){if(t instanceof N){if(!this.pairs.length)throw new N;n=!0}}if(this.checkChecksum())return this.pairs;if(r=!!this.rows.length,this.storeRow(t,!1),r){let t=this.checkRowsBoolean(!1);if(null!=t)return t;if(t=this.checkRowsBoolean(!0),null!=t)return t}throw new N}checkRowsBoolean(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());let e=null;try{e=this.checkRows(new Array,0)}catch(t){console.log(t)}return t&&(this.rows=this.rows.reverse()),e}checkRows(t,e){for(let r=e;re.length)continue;let r=!0;for(let n=0;nt){i=e.isEquivalent(this.pairs);break}n=e.isEquivalent(this.pairs),r++}i||n||re.isPartialRow(this.pairs,this.rows)||(this.rows.push(r,new ee(this.pairs,t,e)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(t,e){for(let r of e)if(r.getPairs().length!==t.length)for(let e of r.getPairs())for(let r of t)if(te.equals(e,r))break}static isPartialRow(t,e){for(let r of e){let e=!0;for(let n of t){let t=!1;for(let e of r.getPairs())if(n.equals(e)){t=!0;break}if(!t){e=!1;break}}if(e)return!0}return!1}getRows(){return this.rows}static constructResult(t){let e=$t(Lt.buildBitArray(t)).parseInformation(),r=t[0].getFinderPattern().getResultPoints(),n=t[t.length-1].getFinderPattern().getResultPoints(),i=[r[0],r[1],n[0],n[1]];return new v(e,null,null,i,x.RSS_EXPANDED,null)}checkChecksum(){let t=this.pairs.get(0),e=t.getLeftChar(),r=t.getRightChar();if(null===r)return!1;let n=r.getChecksumPortion(),i=2;for(let t=1;t=0)i=r;else if(this.isEmptyPair(e))i=0;else{i=e[e.length-1].getFinderPattern().getStartEnd()[1]}let o=e.length%2!=0;this.startFromEven&&(o=!o);let a=!1;for(;i=0&&!t.get(e);)e--;e++,n=this.startEnd[0]-e,i=e,s=this.startEnd[1]}else i=this.startEnd[0],s=t.getNextUnset(this.startEnd[1]+1),n=s-this.startEnd[1];let o,a=this.getDecodeFinderCounters();d.arraycopy(a,0,a,1,a.length-1),a[0]=n;try{o=this.parseFinderValue(a,re.FINDER_PATTERNS)}catch(t){return null}return new Bt(o,[i,s],i,s,e)}decodeDataCharacter(t,e,r,n){let i=this.getDataCharacterCounters();for(let t=0;t.3)throw new N;let a=this.getOddCounts(),h=this.getEvenCounts(),l=this.getOddRoundingErrors(),c=this.getEvenRoundingErrors();for(let t=0;t8){if(e>8.7)throw new N;r=8}let n=t/2;1&t?(h[n]=r,c[n]=e-r):(a[n]=r,l[n]=e-r)}this.adjustOddEvenCounts(17);let d=4*e.getValue()+(r?0:2)+(n?0:1)-1,u=0,g=0;for(let t=a.length-1;t>=0;t--){if(re.isNotA1left(e,r,n)){let e=re.WEIGHTS[d][2*t];g+=a[t]*e}u+=a[t]}let f=0;for(let t=h.length-1;t>=0;t--)if(re.isNotA1left(e,r,n)){let e=re.WEIGHTS[d][2*t+1];f+=h[t]*e}let w=g+f;if(1&u||u>13||u<4)throw new N;let C=(13-u)/2,A=re.SYMBOL_WIDEST[C],E=9-A,m=Pt.getRSSvalue(a,A,!0),I=Pt.getRSSvalue(h,E,!1),_=re.EVEN_TOTAL_SUBSET[C],S=re.GSUM[C];return new bt(m*_+I+S,w)}static isNotA1left(t,e,r){return!(0===t.getValue()&&e&&r)}adjustOddEvenCounts(t){let e=et.sum(new Int32Array(this.getOddCounts())),r=et.sum(new Int32Array(this.getEvenCounts())),n=!1,i=!1;e>13?i=!0:e<4&&(n=!0);let s=!1,o=!1;r>13?o=!0:r<4&&(s=!0);let a=e+r-t,h=!(1&~e),l=!(1&r);if(1===a)if(h){if(l)throw new N;i=!0}else{if(!l)throw new N;o=!0}else if(-1===a)if(h){if(l)throw new N;n=!0}else{if(!l)throw new N;s=!0}else{if(0!==a)throw new N;if(h){if(!l)throw new N;e1)for(let e of this.possibleRightPairs)if(e.getCount()>1&&ie.checkChecksum(t,e))return ie.constructResult(t,e);throw new N}static addOrTally(t,e){if(null==e)return;let r=!1;for(let n of t)if(n.getValue()===e.getValue()){n.incrementCount(),r=!0;break}r||t.push(e)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(t,e){let r=4537077*t.getValue()+e.getValue(),n=new String(r).toString(),i=new T;for(let t=13-n.length;t>0;t--)i.append("0");i.append(n);let s=0;for(let t=0;t<13;t++){let e=i.charAt(t).charCodeAt(0)-"0".charCodeAt(0);s+=1&t?e:3*e}s=10-s%10,10===s&&(s=0),i.append(s.toString());let o=t.getFinderPattern().getResultPoints(),a=e.getFinderPattern().getResultPoints();return new v(i.toString(),null,0,[o[0],o[1],a[0],a[1]],x.RSS_14,(new Date).getTime())}static checkChecksum(t,e){let r=(t.getChecksumPortion()+16*e.getChecksumPortion())%79,n=9*t.getFinderPattern().getValue()+e.getFinderPattern().getValue();return n>72&&n--,n>8&&n--,r===n}decodePair(t,e,r,n){try{let i=this.findFinderPattern(t,e),s=this.parseFoundFinderPattern(t,r,e,i),o=null==n?null:n.get(E.NEED_RESULT_POINT_CALLBACK);if(null!=o){let n=(i[0]+i[1])/2;e&&(n=t.getSize()-1-n),o.foundPossibleResultPoint(new nt(n,r))}let a=this.decodeDataCharacter(t,s,!0),h=this.decodeDataCharacter(t,s,!1);return new ne(1597*a.getValue()+h.getValue(),a.getChecksumPortion()+4*h.getChecksumPortion(),s)}catch(t){return null}}decodeDataCharacter(t,e,r){let n=this.getDataCharacterCounters();for(let t=0;t8&&(r=8);let i=Math.floor(t/2);1&t?(a[i]=r,l[i]=e-r):(o[i]=r,h[i]=e-r)}this.adjustOddEvenCounts(r,i);let c=0,d=0;for(let t=o.length-1;t>=0;t--)d*=9,d+=o[t],c+=o[t];let u=0,g=0;for(let t=a.length-1;t>=0;t--)u*=9,u+=a[t],g+=a[t];let f=d+3*u;if(r){if(1&c||c>12||c<4)throw new N;let t=(12-c)/2,e=ie.OUTSIDE_ODD_WIDEST[t],r=9-e,n=Pt.getRSSvalue(o,e,!1),i=Pt.getRSSvalue(a,r,!0),s=ie.OUTSIDE_EVEN_TOTAL_SUBSET[t],h=ie.OUTSIDE_GSUM[t];return new bt(n*s+i+h,f)}{if(1&g||g>10||g<4)throw new N;let t=(10-g)/2,e=ie.INSIDE_ODD_WIDEST[t],r=9-e,n=Pt.getRSSvalue(o,e,!0),i=Pt.getRSSvalue(a,r,!1),s=ie.INSIDE_ODD_TOTAL_SUBSET[t],h=ie.INSIDE_GSUM[t];return new bt(i*s+n+h,f)}}findFinderPattern(t,e){let r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;let n=t.getSize(),i=!1,s=0;for(;s=0&&i!==t.get(s);)s--;s++;const o=n[0]-s,a=this.getDecodeFinderCounters(),h=new Int32Array(a.length);d.arraycopy(a,0,h,1,a.length-1),h[0]=o;const l=this.parseFinderValue(h,ie.FINDER_PATTERNS);let c=s,u=n[1];return r&&(c=t.getSize()-1-c,u=t.getSize()-1-u),new Bt(l,[s,n[1]],c,u,e)}adjustOddEvenCounts(t,e){let r=et.sum(new Int32Array(this.getOddCounts())),n=et.sum(new Int32Array(this.getEvenCounts())),i=!1,s=!1,o=!1,a=!1;t?(r>12?s=!0:r<4&&(i=!0),n>12?a=!0:n<4&&(o=!0)):(r>11?s=!0:r<5&&(i=!0),n>10?a=!0:n<4&&(o=!0));let h=r+n-e,l=(1&r)==(t?1:0),c=!(1&~n);if(1===h)if(l){if(c)throw new N;s=!0}else{if(!c)throw new N;a=!0}else if(-1===h)if(l){if(c)throw new N;i=!0}else{if(!c)throw new N;o=!0}else{if(0!==h)throw new N;if(l){if(!c)throw new N;rt.reset()))}}class oe{constructor(t,e,r){this.ecCodewords=t,this.ecBlocks=[e],r&&this.ecBlocks.push(r)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class ae{constructor(t,e){this.count=t,this.dataCodewords=e}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class he{constructor(t,e,r,n,i,s){this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=r,this.dataRegionSizeRows=n,this.dataRegionSizeColumns=i,this.ecBlocks=s;let o=0;const a=s.getECCodewords(),h=s.getECBlocks();for(let t of h)o+=t.getCount()*(t.getDataCodewords()+a);this.totalCodewords=o}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(t,e){if(1&t||1&e)throw new m;for(let r of he.VERSIONS)if(r.symbolSizeRows===t&&r.symbolSizeColumns===e)return r;throw new m}toString(){return""+this.versionNumber}static buildVersions(){return[new he(1,10,10,8,8,new oe(5,new ae(1,3))),new he(2,12,12,10,10,new oe(7,new ae(1,5))),new he(3,14,14,12,12,new oe(10,new ae(1,8))),new he(4,16,16,14,14,new oe(12,new ae(1,12))),new he(5,18,18,16,16,new oe(14,new ae(1,18))),new he(6,20,20,18,18,new oe(18,new ae(1,22))),new he(7,22,22,20,20,new oe(20,new ae(1,30))),new he(8,24,24,22,22,new oe(24,new ae(1,36))),new he(9,26,26,24,24,new oe(28,new ae(1,44))),new he(10,32,32,14,14,new oe(36,new ae(1,62))),new he(11,36,36,16,16,new oe(42,new ae(1,86))),new he(12,40,40,18,18,new oe(48,new ae(1,114))),new he(13,44,44,20,20,new oe(56,new ae(1,144))),new he(14,48,48,22,22,new oe(68,new ae(1,174))),new he(15,52,52,24,24,new oe(42,new ae(2,102))),new he(16,64,64,14,14,new oe(56,new ae(2,140))),new he(17,72,72,16,16,new oe(36,new ae(4,92))),new he(18,80,80,18,18,new oe(48,new ae(4,114))),new he(19,88,88,20,20,new oe(56,new ae(4,144))),new he(20,96,96,22,22,new oe(68,new ae(4,174))),new he(21,104,104,24,24,new oe(56,new ae(6,136))),new he(22,120,120,18,18,new oe(68,new ae(6,175))),new he(23,132,132,20,20,new oe(62,new ae(8,163))),new he(24,144,144,22,22,new oe(62,new ae(8,156),new ae(2,155))),new he(25,8,18,6,16,new oe(7,new ae(1,5))),new he(26,8,32,6,14,new oe(11,new ae(1,10))),new he(27,12,26,10,24,new oe(14,new ae(1,16))),new he(28,12,36,10,16,new oe(18,new ae(1,22))),new he(29,16,36,14,16,new oe(24,new ae(1,32))),new he(30,16,48,14,22,new oe(28,new ae(1,49)))]}}he.VERSIONS=he.buildVersions();class le{constructor(t){const e=t.getHeight();if(e<8||e>144||1&e)throw new m;this.version=le.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new R(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(t){const e=t.getHeight(),r=t.getWidth();return he.getVersionForDimensions(e,r)}readCodewords(){const t=new Int8Array(this.version.getTotalCodewords());let e=0,r=4,n=0;const i=this.mappingBitMatrix.getHeight(),s=this.mappingBitMatrix.getWidth();let o=!1,a=!1,h=!1,l=!1;do{if(r!==i||0!==n||o)if(r===i-2&&0===n&&3&s&&!a)t[e++]=255&this.readCorner2(i,s),r-=2,n+=2,a=!0;else if(r!==i+4||2!==n||7&s||h)if(r!==i-2||0!==n||4!=(7&s)||l){do{r=0&&!this.readMappingMatrix.get(n,r)&&(t[e++]=255&this.readUtah(r,n,i,s)),r-=2,n+=2}while(r>=0&&n=0&&n=0);r+=3,n+=1}else t[e++]=255&this.readCorner4(i,s),r-=2,n+=2,l=!0;else t[e++]=255&this.readCorner3(i,s),r-=2,n+=2,h=!0;else t[e++]=255&this.readCorner1(i,s),r-=2,n+=2,o=!0}while(r7?e-1:e;s[n].codewords[i]=t[c++]}if(c!==t.length)throw new a;return s}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class de{constructor(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(t){if(t<1||t>32||t>this.available())throw new a(""+t);let e=0,r=this.bitOffset,n=this.byteOffset;const i=this.bytes;if(r>0){const s=8-r,o=t>8-o<>a,t-=o,r+=o,8===r&&(r=0,n++)}if(t>0){for(;t>=8;)e=e<<8|255&i[n],n++,t-=8;if(t>0){const s=8-t,o=255>>s<>s,r+=t}}return this.bitOffset=r,this.byteOffset=n,e}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}!function(t){t[t.PAD_ENCODE=0]="PAD_ENCODE",t[t.ASCII_ENCODE=1]="ASCII_ENCODE",t[t.C40_ENCODE=2]="C40_ENCODE",t[t.TEXT_ENCODE=3]="TEXT_ENCODE",t[t.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",t[t.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",t[t.BASE256_ENCODE=6]="BASE256_ENCODE"}(H||(H={}));class ue{static decode(t){const e=new de(t),r=new T,n=new T,i=new Array;let s=H.ASCII_ENCODE;do{if(s===H.ASCII_ENCODE)s=this.decodeAsciiSegment(e,r,n);else{switch(s){case H.C40_ENCODE:this.decodeC40Segment(e,r);break;case H.TEXT_ENCODE:this.decodeTextSegment(e,r);break;case H.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,r);break;case H.EDIFACT_ENCODE:this.decodeEdifactSegment(e,r);break;case H.BASE256_ENCODE:this.decodeBase256Segment(e,r,i);break;default:throw new m}s=H.ASCII_ENCODE}}while(s!==H.PAD_ENCODE&&e.available()>0);return n.length()>0&&r.append(n.toString()),new Y(t,r.toString(),0===i.length?null:i,null)}static decodeAsciiSegment(t,e,r){let n=!1;do{let i=t.readBits(8);if(0===i)throw new m;if(i<=128)return n&&(i+=128),e.append(String.fromCharCode(i-1)),H.ASCII_ENCODE;if(129===i)return H.PAD_ENCODE;if(i<=229){const t=i-130;t<10&&e.append("0"),e.append(""+t)}else switch(i){case 230:return H.C40_ENCODE;case 231:return H.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:n=!0;break;case 236:e.append("[)>05"),r.insert(0,"");break;case 237:e.append("[)>06"),r.insert(0,"");break;case 238:return H.ANSIX12_ENCODE;case 239:return H.TEXT_ENCODE;case 240:return H.EDIFACT_ENCODE;default:if(254!==i||0!==t.available())throw new m}}while(t.available()>0);return H.ASCII_ENCODE}static decodeC40Segment(t,e){let r=!1;const n=[];let i=0;do{if(8===t.available())return;const s=t.readBits(8);if(254===s)return;this.parseTwoBytes(s,t.readBits(8),n);for(let t=0;t<3;t++){const s=n[t];switch(i){case 0:if(s<3)i=s+1;else{if(!(s0)}static decodeTextSegment(t,e){let r=!1,n=[],i=0;do{if(8===t.available())return;const s=t.readBits(8);if(254===s)return;this.parseTwoBytes(s,t.readBits(8),n);for(let t=0;t<3;t++){const s=n[t];switch(i){case 0:if(s<3)i=s+1;else{if(!(s0)}static decodeAnsiX12Segment(t,e){const r=[];do{if(8===t.available())return;const n=t.readBits(8);if(254===n)return;this.parseTwoBytes(n,t.readBits(8),r);for(let t=0;t<3;t++){const n=r[t];switch(n){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(n<14)e.append(String.fromCharCode(n+44));else{if(!(n<40))throw new m;e.append(String.fromCharCode(n+51))}}}}while(t.available()>0)}static parseTwoBytes(t,e,r){let n=(t<<8)+e-1,i=Math.floor(n/1600);r[0]=i,n-=1600*i,i=Math.floor(n/40),r[1]=i,r[2]=n-40*i}static decodeEdifactSegment(t,e){do{if(t.available()<=16)return;for(let r=0;r<4;r++){let r=t.readBits(6);if(31===r){const e=8-t.getBitOffset();return void(8!==e&&t.readBits(e))}32&r||(r|=64),e.append(String.fromCharCode(r))}}while(t.available()>0)}static decodeBase256Segment(t,e,r){let n=1+t.getByteOffset();const i=this.unrandomize255State(t.readBits(8),n++);let s;if(s=0===i?t.available()/8|0:i<250?i:250*(i-249)+this.unrandomize255State(t.readBits(8),n++),s<0)throw new m;const o=new Uint8Array(s);for(let e=0;e=0?r:r+256}}ue.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ue.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],ue.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],ue.TEXT_SHIFT2_SET_CHARS=ue.C40_SHIFT2_SET_CHARS,ue.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)];class ge{constructor(){this.rsDecoder=new $(Q.DATA_MATRIX_FIELD_256)}decode(t){const e=new le(t),r=e.getVersion(),n=e.readCodewords(),i=ce.getDataBlocks(n,r);let s=0;for(let t of i)s+=t.getNumDataCodewords();const o=new Uint8Array(s),a=i.length;for(let t=0;to&&(l=o,c[0]=e,c[1]=r,c[2]=n,c[3]=i),l>a&&(l=a,c[0]=r,c[1]=n,c[2]=i,c[3]=e),l>h&&(c[0]=n,c[1]=i,c[2]=e,c[3]=r),c}detectSolid2(t){let e=t[0],r=t[1],n=t[2],i=t[3],s=this.transitionsBetween(e,i),o=fe.shiftPoint(r,n,4*(s+1)),a=fe.shiftPoint(n,r,4*(s+1));return this.transitionsBetween(o,e)this.transitionsBetween(a,c)+this.transitionsBetween(h,c)?l:c:l:this.isValid(c)?c:null}shiftToModuleCenter(t){let e=t[0],r=t[1],n=t[2],i=t[3],s=this.transitionsBetween(e,i)+1,o=this.transitionsBetween(n,i)+1,a=fe.shiftPoint(e,r,4*o),h=fe.shiftPoint(n,r,4*s);s=this.transitionsBetween(a,i)+1,o=this.transitionsBetween(h,i)+1,1&~s||(s+=1),1&~o||(o+=1);let l,c,d=(e.getX()+r.getX()+n.getX()+i.getX())/4,u=(e.getY()+r.getY()+n.getY()+i.getY())/4;return e=fe.moveAway(e,d,u),r=fe.moveAway(r,d,u),n=fe.moveAway(n,d,u),i=fe.moveAway(i,d,u),a=fe.shiftPoint(e,r,4*o),a=fe.shiftPoint(a,i,4*s),l=fe.shiftPoint(r,e,4*o),l=fe.shiftPoint(l,n,4*s),h=fe.shiftPoint(n,i,4*o),h=fe.shiftPoint(h,r,4*s),c=fe.shiftPoint(i,n,4*o),c=fe.shiftPoint(c,e,4*s),[a,l,h,c]}isValid(t){return t.getX()>=0&&t.getX()0&&t.getY()Math.abs(i-r);if(o){let t=r;r=n,n=t,t=i,i=s,s=t}let a=Math.abs(i-r),h=Math.abs(s-n),l=-a/2,c=n0){if(e===s)break;e+=c,l-=a}}return u}}class we{constructor(){this.decoder=new ge}decode(t,e=null){let r,n;if(null!=e&&e.has(E.PURE_BARCODE)){const e=we.extractPureBits(t.getBlackMatrix());r=this.decoder.decode(e),n=we.NO_POINTS}else{const e=new fe(t.getBlackMatrix()).detect();r=this.decoder.decode(e.getBits()),n=e.getPoints()}const i=r.getRawBytes(),s=new v(r.getText(),i,8*i.length,n,x.DATA_MATRIX,d.currentTimeMillis()),o=r.getByteSegments();null!=o&&s.putMetadata(z.BYTE_SEGMENTS,o);const a=r.getECLevel();return null!=a&&s.putMetadata(z.ERROR_CORRECTION_LEVEL,a),s}reset(){}static extractPureBits(t){const e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null==e||null==r)throw new N;const n=this.moduleSize(e,t);let i=e[1];const s=r[1];let o=e[0];const a=(r[0]-o+1)/n,h=(s-i+1)/n;if(a<=0||h<=0)throw new N;const l=n/2;i+=l,o+=l;const c=new R(a,h);for(let e=0;e=Ce.FOR_BITS.size)throw new a;return Ce.FOR_BITS.get(t)}}Ce.FOR_BITS=new Map,Ce.FOR_VALUE=new Map,Ce.L=new Ce(U.L,"L",1),Ce.M=new Ce(U.M,"M",0),Ce.Q=new Ce(U.Q,"Q",3),Ce.H=new Ce(U.H,"H",2);class Ae{constructor(t){this.errorCorrectionLevel=Ce.forBits(t>>3&3),this.dataMask=7&t}static numBitsDiffering(t,e){return w.bitCount(t^e)}static decodeFormatInformation(t,e){const r=Ae.doDecodeFormatInformation(t,e);return null!==r?r:Ae.doDecodeFormatInformation(t^Ae.FORMAT_INFO_MASK_QR,e^Ae.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(t,e){let r=Number.MAX_SAFE_INTEGER,n=0;for(const i of Ae.FORMAT_INFO_DECODE_LOOKUP){const s=i[0];if(s===t||s===e)return new Ae(i[1]);let o=Ae.numBitsDiffering(t,s);o40)throw new a;return Ie.VERSIONS[t-1]}static decodeVersionInformation(t){let e=Number.MAX_SAFE_INTEGER,r=0;for(let n=0;n6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e}toString(){return""+this.versionNumber}}Ie.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),Ie.VERSIONS=[new Ie(1,new Int32Array(0),new Ee(7,new me(1,19)),new Ee(10,new me(1,16)),new Ee(13,new me(1,13)),new Ee(17,new me(1,9))),new Ie(2,Int32Array.from([6,18]),new Ee(10,new me(1,34)),new Ee(16,new me(1,28)),new Ee(22,new me(1,22)),new Ee(28,new me(1,16))),new Ie(3,Int32Array.from([6,22]),new Ee(15,new me(1,55)),new Ee(26,new me(1,44)),new Ee(18,new me(2,17)),new Ee(22,new me(2,13))),new Ie(4,Int32Array.from([6,26]),new Ee(20,new me(1,80)),new Ee(18,new me(2,32)),new Ee(26,new me(2,24)),new Ee(16,new me(4,9))),new Ie(5,Int32Array.from([6,30]),new Ee(26,new me(1,108)),new Ee(24,new me(2,43)),new Ee(18,new me(2,15),new me(2,16)),new Ee(22,new me(2,11),new me(2,12))),new Ie(6,Int32Array.from([6,34]),new Ee(18,new me(2,68)),new Ee(16,new me(4,27)),new Ee(24,new me(4,19)),new Ee(28,new me(4,15))),new Ie(7,Int32Array.from([6,22,38]),new Ee(20,new me(2,78)),new Ee(18,new me(4,31)),new Ee(18,new me(2,14),new me(4,15)),new Ee(26,new me(4,13),new me(1,14))),new Ie(8,Int32Array.from([6,24,42]),new Ee(24,new me(2,97)),new Ee(22,new me(2,38),new me(2,39)),new Ee(22,new me(4,18),new me(2,19)),new Ee(26,new me(4,14),new me(2,15))),new Ie(9,Int32Array.from([6,26,46]),new Ee(30,new me(2,116)),new Ee(22,new me(3,36),new me(2,37)),new Ee(20,new me(4,16),new me(4,17)),new Ee(24,new me(4,12),new me(4,13))),new Ie(10,Int32Array.from([6,28,50]),new Ee(18,new me(2,68),new me(2,69)),new Ee(26,new me(4,43),new me(1,44)),new Ee(24,new me(6,19),new me(2,20)),new Ee(28,new me(6,15),new me(2,16))),new Ie(11,Int32Array.from([6,30,54]),new Ee(20,new me(4,81)),new Ee(30,new me(1,50),new me(4,51)),new Ee(28,new me(4,22),new me(4,23)),new Ee(24,new me(3,12),new me(8,13))),new Ie(12,Int32Array.from([6,32,58]),new Ee(24,new me(2,92),new me(2,93)),new Ee(22,new me(6,36),new me(2,37)),new Ee(26,new me(4,20),new me(6,21)),new Ee(28,new me(7,14),new me(4,15))),new Ie(13,Int32Array.from([6,34,62]),new Ee(26,new me(4,107)),new Ee(22,new me(8,37),new me(1,38)),new Ee(24,new me(8,20),new me(4,21)),new Ee(22,new me(12,11),new me(4,12))),new Ie(14,Int32Array.from([6,26,46,66]),new Ee(30,new me(3,115),new me(1,116)),new Ee(24,new me(4,40),new me(5,41)),new Ee(20,new me(11,16),new me(5,17)),new Ee(24,new me(11,12),new me(5,13))),new Ie(15,Int32Array.from([6,26,48,70]),new Ee(22,new me(5,87),new me(1,88)),new Ee(24,new me(5,41),new me(5,42)),new Ee(30,new me(5,24),new me(7,25)),new Ee(24,new me(11,12),new me(7,13))),new Ie(16,Int32Array.from([6,26,50,74]),new Ee(24,new me(5,98),new me(1,99)),new Ee(28,new me(7,45),new me(3,46)),new Ee(24,new me(15,19),new me(2,20)),new Ee(30,new me(3,15),new me(13,16))),new Ie(17,Int32Array.from([6,30,54,78]),new Ee(28,new me(1,107),new me(5,108)),new Ee(28,new me(10,46),new me(1,47)),new Ee(28,new me(1,22),new me(15,23)),new Ee(28,new me(2,14),new me(17,15))),new Ie(18,Int32Array.from([6,30,56,82]),new Ee(30,new me(5,120),new me(1,121)),new Ee(26,new me(9,43),new me(4,44)),new Ee(28,new me(17,22),new me(1,23)),new Ee(28,new me(2,14),new me(19,15))),new Ie(19,Int32Array.from([6,30,58,86]),new Ee(28,new me(3,113),new me(4,114)),new Ee(26,new me(3,44),new me(11,45)),new Ee(26,new me(17,21),new me(4,22)),new Ee(26,new me(9,13),new me(16,14))),new Ie(20,Int32Array.from([6,34,62,90]),new Ee(28,new me(3,107),new me(5,108)),new Ee(26,new me(3,41),new me(13,42)),new Ee(30,new me(15,24),new me(5,25)),new Ee(28,new me(15,15),new me(10,16))),new Ie(21,Int32Array.from([6,28,50,72,94]),new Ee(28,new me(4,116),new me(4,117)),new Ee(26,new me(17,42)),new Ee(28,new me(17,22),new me(6,23)),new Ee(30,new me(19,16),new me(6,17))),new Ie(22,Int32Array.from([6,26,50,74,98]),new Ee(28,new me(2,111),new me(7,112)),new Ee(28,new me(17,46)),new Ee(30,new me(7,24),new me(16,25)),new Ee(24,new me(34,13))),new Ie(23,Int32Array.from([6,30,54,78,102]),new Ee(30,new me(4,121),new me(5,122)),new Ee(28,new me(4,47),new me(14,48)),new Ee(30,new me(11,24),new me(14,25)),new Ee(30,new me(16,15),new me(14,16))),new Ie(24,Int32Array.from([6,28,54,80,106]),new Ee(30,new me(6,117),new me(4,118)),new Ee(28,new me(6,45),new me(14,46)),new Ee(30,new me(11,24),new me(16,25)),new Ee(30,new me(30,16),new me(2,17))),new Ie(25,Int32Array.from([6,32,58,84,110]),new Ee(26,new me(8,106),new me(4,107)),new Ee(28,new me(8,47),new me(13,48)),new Ee(30,new me(7,24),new me(22,25)),new Ee(30,new me(22,15),new me(13,16))),new Ie(26,Int32Array.from([6,30,58,86,114]),new Ee(28,new me(10,114),new me(2,115)),new Ee(28,new me(19,46),new me(4,47)),new Ee(28,new me(28,22),new me(6,23)),new Ee(30,new me(33,16),new me(4,17))),new Ie(27,Int32Array.from([6,34,62,90,118]),new Ee(30,new me(8,122),new me(4,123)),new Ee(28,new me(22,45),new me(3,46)),new Ee(30,new me(8,23),new me(26,24)),new Ee(30,new me(12,15),new me(28,16))),new Ie(28,Int32Array.from([6,26,50,74,98,122]),new Ee(30,new me(3,117),new me(10,118)),new Ee(28,new me(3,45),new me(23,46)),new Ee(30,new me(4,24),new me(31,25)),new Ee(30,new me(11,15),new me(31,16))),new Ie(29,Int32Array.from([6,30,54,78,102,126]),new Ee(30,new me(7,116),new me(7,117)),new Ee(28,new me(21,45),new me(7,46)),new Ee(30,new me(1,23),new me(37,24)),new Ee(30,new me(19,15),new me(26,16))),new Ie(30,Int32Array.from([6,26,52,78,104,130]),new Ee(30,new me(5,115),new me(10,116)),new Ee(28,new me(19,47),new me(10,48)),new Ee(30,new me(15,24),new me(25,25)),new Ee(30,new me(23,15),new me(25,16))),new Ie(31,Int32Array.from([6,30,56,82,108,134]),new Ee(30,new me(13,115),new me(3,116)),new Ee(28,new me(2,46),new me(29,47)),new Ee(30,new me(42,24),new me(1,25)),new Ee(30,new me(23,15),new me(28,16))),new Ie(32,Int32Array.from([6,34,60,86,112,138]),new Ee(30,new me(17,115)),new Ee(28,new me(10,46),new me(23,47)),new Ee(30,new me(10,24),new me(35,25)),new Ee(30,new me(19,15),new me(35,16))),new Ie(33,Int32Array.from([6,30,58,86,114,142]),new Ee(30,new me(17,115),new me(1,116)),new Ee(28,new me(14,46),new me(21,47)),new Ee(30,new me(29,24),new me(19,25)),new Ee(30,new me(11,15),new me(46,16))),new Ie(34,Int32Array.from([6,34,62,90,118,146]),new Ee(30,new me(13,115),new me(6,116)),new Ee(28,new me(14,46),new me(23,47)),new Ee(30,new me(44,24),new me(7,25)),new Ee(30,new me(59,16),new me(1,17))),new Ie(35,Int32Array.from([6,30,54,78,102,126,150]),new Ee(30,new me(12,121),new me(7,122)),new Ee(28,new me(12,47),new me(26,48)),new Ee(30,new me(39,24),new me(14,25)),new Ee(30,new me(22,15),new me(41,16))),new Ie(36,Int32Array.from([6,24,50,76,102,128,154]),new Ee(30,new me(6,121),new me(14,122)),new Ee(28,new me(6,47),new me(34,48)),new Ee(30,new me(46,24),new me(10,25)),new Ee(30,new me(2,15),new me(64,16))),new Ie(37,Int32Array.from([6,28,54,80,106,132,158]),new Ee(30,new me(17,122),new me(4,123)),new Ee(28,new me(29,46),new me(14,47)),new Ee(30,new me(49,24),new me(10,25)),new Ee(30,new me(24,15),new me(46,16))),new Ie(38,Int32Array.from([6,32,58,84,110,136,162]),new Ee(30,new me(4,122),new me(18,123)),new Ee(28,new me(13,46),new me(32,47)),new Ee(30,new me(48,24),new me(14,25)),new Ee(30,new me(42,15),new me(32,16))),new Ie(39,Int32Array.from([6,26,54,82,110,138,166]),new Ee(30,new me(20,117),new me(4,118)),new Ee(28,new me(40,47),new me(7,48)),new Ee(30,new me(43,24),new me(22,25)),new Ee(30,new me(10,15),new me(67,16))),new Ie(40,Int32Array.from([6,30,58,86,114,142,170]),new Ee(30,new me(19,118),new me(6,119)),new Ee(28,new me(18,47),new me(31,48)),new Ee(30,new me(34,24),new me(34,25)),new Ee(30,new me(20,15),new me(61,16)))],function(t){t[t.DATA_MASK_000=0]="DATA_MASK_000",t[t.DATA_MASK_001=1]="DATA_MASK_001",t[t.DATA_MASK_010=2]="DATA_MASK_010",t[t.DATA_MASK_011=3]="DATA_MASK_011",t[t.DATA_MASK_100=4]="DATA_MASK_100",t[t.DATA_MASK_101=5]="DATA_MASK_101",t[t.DATA_MASK_110=6]="DATA_MASK_110",t[t.DATA_MASK_111=7]="DATA_MASK_111"}(X||(X={}));class _e{constructor(t,e){this.value=t,this.isMasked=e}unmaskBitMatrix(t,e){for(let r=0;r!(t+e&1)))],[X.DATA_MASK_001,new _e(X.DATA_MASK_001,((t,e)=>!(1&t)))],[X.DATA_MASK_010,new _e(X.DATA_MASK_010,((t,e)=>e%3==0))],[X.DATA_MASK_011,new _e(X.DATA_MASK_011,((t,e)=>(t+e)%3==0))],[X.DATA_MASK_100,new _e(X.DATA_MASK_100,((t,e)=>!(Math.floor(t/2)+Math.floor(e/3)&1)))],[X.DATA_MASK_101,new _e(X.DATA_MASK_101,((t,e)=>t*e%6==0))],[X.DATA_MASK_110,new _e(X.DATA_MASK_110,((t,e)=>t*e%6<3))],[X.DATA_MASK_111,new _e(X.DATA_MASK_111,((t,e)=>!(t+e+t*e%3&1)))]]);class Se{constructor(t){const e=t.getHeight();if(e<21||1!=(3&e))throw new m;this.bitMatrix=t}readFormatInformation(){if(null!==this.parsedFormatInfo&&void 0!==this.parsedFormatInfo)return this.parsedFormatInfo;let t=0;for(let e=0;e<6;e++)t=this.copyBit(e,8,t);t=this.copyBit(7,8,t),t=this.copyBit(8,8,t),t=this.copyBit(8,7,t);for(let e=5;e>=0;e--)t=this.copyBit(8,e,t);const e=this.bitMatrix.getHeight();let r=0;const n=e-7;for(let t=e-1;t>=n;t--)r=this.copyBit(8,t,r);for(let t=e-8;t=0;e--)for(let i=t-9;i>=n;i--)r=this.copyBit(i,e,r);let i=Ie.decodeVersionInformation(r);if(null!==i&&i.getDimensionForVersion()===t)return this.parsedVersion=i,i;r=0;for(let e=5;e>=0;e--)for(let i=t-9;i>=n;i--)r=this.copyBit(e,i,r);if(i=Ie.decodeVersionInformation(r),null!==i&&i.getDimensionForVersion()===t)return this.parsedVersion=i,i;throw new m}copyBit(t,e,r){return(this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e))?r<<1|1:r<<1}readCodewords(){const t=this.readFormatInformation(),e=this.readVersion(),r=_e.values.get(t.getDataMask()),n=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,n);const i=e.buildFunctionPattern();let s=!0;const o=new Uint8Array(e.getTotalCodewords());let a=0,h=0,l=0;for(let t=n-1;t>0;t-=2){6===t&&t--;for(let e=0;e=0;){if(o[c].codewords.length===l)break;c--}c++;const d=l-n.getECCodewordsPerBlock();let u=0;for(let e=0;et.available())throw new m;const n=new Uint8Array(2*r);let i=0;for(;r>0;){const e=t.readBits(13);let s=e/96<<8&4294967295|e%96;s+=s<959?41377:42657,n[i]=s>>8&255,n[i+1]=255&s,i+=2,r--}try{e.append(S.decode(n,p.GB2312))}catch(t){throw new m(t)}}static decodeKanjiSegment(t,e,r){if(13*r>t.available())throw new m;const n=new Uint8Array(2*r);let i=0;for(;r>0;){const e=t.readBits(13);let s=e/192<<8&4294967295|e%192;s+=s<7936?33088:49472,n[i]=s>>8,n[i+1]=s,i+=2,r--}try{e.append(S.decode(n,p.SHIFT_JIS))}catch(t){throw new m(t)}}static decodeByteSegment(t,e,r,n,i,s){if(8*r>t.available())throw new m;const o=new Uint8Array(r);for(let e=0;e=Re.ALPHANUMERIC_CHARS.length)throw new m;return Re.ALPHANUMERIC_CHARS[t]}static decodeAlphanumericSegment(t,e,r,n){const i=e.length();for(;r>1;){if(t.available()<11)throw new m;const n=t.readBits(11);e.append(Re.toAlphaNumericChar(Math.floor(n/45))),e.append(Re.toAlphaNumericChar(n%45)),r-=2}if(1===r){if(t.available()<6)throw new m;e.append(Re.toAlphaNumericChar(t.readBits(6)))}if(n)for(let t=i;t=3;){if(t.available()<10)throw new m;const n=t.readBits(10);if(n>=1e3)throw new m;e.append(Re.toAlphaNumericChar(Math.floor(n/100))),e.append(Re.toAlphaNumericChar(Math.floor(n/10)%10)),e.append(Re.toAlphaNumericChar(n%10)),r-=3}if(2===r){if(t.available()<7)throw new m;const r=t.readBits(7);if(r>=100)throw new m;e.append(Re.toAlphaNumericChar(Math.floor(r/10))),e.append(Re.toAlphaNumericChar(r%10))}else if(1===r){if(t.available()<4)throw new m;const r=t.readBits(4);if(r>=10)throw new m;e.append(Re.toAlphaNumericChar(r))}}static parseECIValue(t){const e=t.readBits(8);if(!(128&e))return 127&e;if(128==(192&e)){return(63&e)<<8&4294967295|t.readBits(8)}if(192==(224&e)){return(31&e)<<16&4294967295|t.readBits(16)}throw new m}}Re.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",Re.GB2312_SUBSET=1;class Ne{constructor(t){this.mirrored=t}isMirrored(){return this.mirrored}applyMirroredCorrection(t){if(!this.mirrored||null===t||t.length<3)return;const e=t[0];t[0]=t[2],t[2]=e}}class ye{constructor(){this.rsDecoder=new $(Q.QR_CODE_FIELD_256)}decodeBooleanArray(t,e){return this.decodeBitMatrix(R.parseFromBooleanArray(t),e)}decodeBitMatrix(t,e){const r=new Se(t);let n=null;try{return this.decodeBitMatrixParser(r,e)}catch(t){n=t}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();const t=this.decodeBitMatrixParser(r,e);return t.setOther(new Ne(!0)),t}catch(t){if(null!==n)throw n;throw t}}decodeBitMatrixParser(t,e){const r=t.readVersion(),n=t.readFormatInformation().getErrorCorrectionLevel(),i=t.readCodewords(),s=pe.getDataBlocks(i,r,n);let o=0;for(const t of s)o+=t.getNumDataCodewords();const a=new Uint8Array(o);let h=0;for(const t of s){const e=t.getCodewords(),r=t.getNumDataCodewords();this.correctErrors(e,r);for(let t=0;t=r)return!1;return!0}crossCheckVertical(t,e,r,n){const i=this.image,s=i.getHeight(),o=this.crossCheckStateCount;o[0]=0,o[1]=0,o[2]=0;let a=t;for(;a>=0&&i.get(e,a)&&o[1]<=r;)o[1]++,a--;if(a<0||o[1]>r)return NaN;for(;a>=0&&!i.get(e,a)&&o[0]<=r;)o[0]++,a--;if(o[0]>r)return NaN;for(a=t+1;ar)return NaN;for(;ar)return NaN;const h=o[0]+o[1]+o[2];return 5*Math.abs(h-n)>=2*n?NaN:this.foundPatternCross(o)?Oe.centerFromEnd(o,a):NaN}handlePossibleCenter(t,e,r){const n=t[0]+t[1]+t[2],i=Oe.centerFromEnd(t,r),s=this.crossCheckVertical(e,i,2*t[1],n);if(!isNaN(s)){const e=(t[0]+t[1]+t[2])/3;for(const t of this.possibleCenters)if(t.aboutEquals(e,s,i))return t.combineEstimate(s,i,e);const r=new De(i,s,e);this.possibleCenters.push(r),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(r)}return null}}class Me extends nt{constructor(t,e,r,n){super(t,e),this.estimatedModuleSize=r,this.count=n,void 0===n&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(t,e,r){if(Math.abs(e-this.getY())<=t&&Math.abs(r-this.getX())<=t){const e=Math.abs(t-this.estimatedModuleSize);return e<=1||e<=this.estimatedModuleSize}return!1}combineEstimate(t,e,r){const n=this.count+1,i=(this.count*this.getX()+e)/n,s=(this.count*this.getY()+t)/n,o=(this.count*this.estimatedModuleSize+r)/n;return new Me(i,s,o,n)}}class be{constructor(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class Be{constructor(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(t){const e=null!=t&&void 0!==t.get(E.TRY_HARDER),r=null!=t&&void 0!==t.get(E.PURE_BARCODE),n=this.image,i=n.getHeight(),s=n.getWidth();let o=Math.floor(3*i/(4*Be.MAX_MODULES));(oh[2]&&(t+=e-h[2]-o,i=s-1)}e=0,h[0]=0,h[1]=0,h[2]=0,h[3]=0,h[4]=0}else h[0]=h[2],h[1]=h[3],h[2]=h[4],h[3]=1,h[4]=0,e=3;else h[++e]++;if(Be.foundPatternCross(h)){!0===this.handlePossibleCenter(h,t,s,r)&&(o=h[0],this.hasSkipped&&(a=this.haveMultiplyConfirmedCenters()))}}const l=this.selectBestPatterns();return nt.orderBestPatterns(l),new be(l)}static centerFromEnd(t,e){return e-t[4]-t[3]-t[2]/2}static foundPatternCross(t){let e=0;for(let r=0;r<5;r++){const n=t[r];if(0===n)return!1;e+=n}if(e<7)return!1;const r=e/7,n=r/2;return Math.abs(r-t[0])=s&&e>=s&&o.get(e-s,t-s);)i[2]++,s++;if(t=s&&e>=s&&!o.get(e-s,t-s)&&i[1]<=r;)i[1]++,s++;if(tr)return!1;for(;t>=s&&e>=s&&o.get(e-s,t-s)&&i[0]<=r;)i[0]++,s++;if(i[0]>r)return!1;const a=o.getHeight(),h=o.getWidth();for(s=1;t+s=a||e+s>=h)return!1;for(;t+s=a||e+s>=h||i[3]>=r)return!1;for(;t+s=r)return!1;const l=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(l-n)<2*n&&Be.foundPatternCross(i)}crossCheckVertical(t,e,r,n){const i=this.image,s=i.getHeight(),o=this.getCrossCheckStateCount();let a=t;for(;a>=0&&i.get(e,a);)o[2]++,a--;if(a<0)return NaN;for(;a>=0&&!i.get(e,a)&&o[1]<=r;)o[1]++,a--;if(a<0||o[1]>r)return NaN;for(;a>=0&&i.get(e,a)&&o[0]<=r;)o[0]++,a--;if(o[0]>r)return NaN;for(a=t+1;a=r)return NaN;for(;a=r)return NaN;const h=o[0]+o[1]+o[2]+o[3]+o[4];return 5*Math.abs(h-n)>=2*n?NaN:Be.foundPatternCross(o)?Be.centerFromEnd(o,a):NaN}crossCheckHorizontal(t,e,r,n){const i=this.image,s=i.getWidth(),o=this.getCrossCheckStateCount();let a=t;for(;a>=0&&i.get(a,e);)o[2]++,a--;if(a<0)return NaN;for(;a>=0&&!i.get(a,e)&&o[1]<=r;)o[1]++,a--;if(a<0||o[1]>r)return NaN;for(;a>=0&&i.get(a,e)&&o[0]<=r;)o[0]++,a--;if(o[0]>r)return NaN;for(a=t+1;a=r)return NaN;for(;a=r)return NaN;const h=o[0]+o[1]+o[2]+o[3]+o[4];return 5*Math.abs(h-n)>=n?NaN:Be.foundPatternCross(o)?Be.centerFromEnd(o,a):NaN}handlePossibleCenter(t,e,r,n){const i=t[0]+t[1]+t[2]+t[3]+t[4];let s=Be.centerFromEnd(t,r),o=this.crossCheckVertical(e,Math.floor(s),t[2],i);if(!isNaN(o)&&(s=this.crossCheckHorizontal(Math.floor(s),Math.floor(o),t[2],i),!isNaN(s)&&(!n||this.crossCheckDiagonal(Math.floor(o),Math.floor(s),t[2],i)))){const t=i/7;let e=!1;const r=this.possibleCenters;for(let n=0,i=r.length;n=Be.CENTER_QUORUM){if(null!=t)return this.hasSkipped=!0,Math.floor((Math.abs(t.getX()-e.getX())-Math.abs(t.getY()-e.getY()))/2);t=e}return 0}haveMultiplyConfirmedCenters(){let t=0,e=0;const r=this.possibleCenters.length;for(const r of this.possibleCenters)r.getCount()>=Be.CENTER_QUORUM&&(t++,e+=r.getEstimatedModuleSize());if(t<3)return!1;const n=e/r;let i=0;for(const t of this.possibleCenters)i+=Math.abs(t.getEstimatedModuleSize()-n);return i<=.05*e}selectBestPatterns(){const t=this.possibleCenters.length;if(t<3)throw new N;const e=this.possibleCenters;let r;if(t>3){let n=0,i=0;for(const t of this.possibleCenters){const e=t.getEstimatedModuleSize();n+=e,i+=e*e}r=n/t;let s=Math.sqrt(i/t-r*r);e.sort(((t,e)=>{const n=Math.abs(e.getEstimatedModuleSize()-r),i=Math.abs(t.getEstimatedModuleSize()-r);return ni?1:0}));const o=Math.max(.2*r,s);for(let t=0;t3;t++){const n=e[t];Math.abs(n.getEstimatedModuleSize()-r)>o&&(e.splice(t,1),t--)}}if(e.length>3){let t=0;for(const r of e)t+=r.getEstimatedModuleSize();r=t/e.length,e.sort(((t,e)=>{if(e.getCount()===t.getCount()){const n=Math.abs(e.getEstimatedModuleSize()-r),i=Math.abs(t.getEstimatedModuleSize()-r);return ni?-1:0}return e.getCount()-t.getCount()})),e.splice(3)}return[e[0],e[1],e[2]]}}Be.CENTER_QUORUM=2,Be.MIN_SKIP=3,Be.MAX_MODULES=57;class Pe{constructor(t){this.image=t}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(t){this.resultPointCallback=null==t?null:t.get(E.NEED_RESULT_POINT_CALLBACK);const e=new Be(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(e)}processFinderPatternInfo(t){const e=t.getTopLeft(),r=t.getTopRight(),n=t.getBottomLeft(),i=this.calculateModuleSize(e,r,n);if(i<1)throw new N("No pattern found in proccess finder.");const s=Pe.computeDimension(e,r,n,i),o=Ie.getProvisionalVersionForDimension(s),a=o.getDimensionForVersion()-7;let h=null;if(o.getAlignmentPatternCenters().length>0){const t=r.getX()-e.getX()+n.getX(),s=r.getY()-e.getY()+n.getY(),o=1-3/a,l=Math.floor(e.getX()+o*(t-e.getX())),c=Math.floor(e.getY()+o*(s-e.getY()));for(let t=4;t<=16;t<<=1)try{h=this.findAlignmentInRegion(i,l,c,t);break}catch(t){if(!(t instanceof N))throw t}}const l=Pe.createTransform(e,r,n,h,s),c=Pe.sampleGrid(this.image,l,s);let d;return d=null===h?[n,e,r]:[n,e,r,h],new it(c,d)}static createTransform(t,e,r,n,i){const s=i-3.5;let o,a,h,l;return null!==n?(o=n.getX(),a=n.getY(),h=s-3,l=h):(o=e.getX()-t.getX()+r.getX(),a=e.getY()-t.getY()+r.getY(),h=s,l=s),ht.quadrilateralToQuadrilateral(3.5,3.5,s,3.5,h,l,3.5,s,t.getX(),t.getY(),e.getX(),e.getY(),o,a,r.getX(),r.getY())}static sampleGrid(t,e,r){return ct.getInstance().sampleGridWithTransform(t,r,r,e)}static computeDimension(t,e,r,n){const i=et.round(nt.distance(t,e)/n),s=et.round(nt.distance(t,r)/n);let o=Math.floor((i+s)/2)+7;switch(3&o){case 0:o++;break;case 2:o--;break;case 3:throw new N("Dimensions could be not found.")}return o}calculateModuleSize(t,e,r){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,r))/2}calculateModuleSizeOneWay(t,e){const r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(r)?n/7:isNaN(n)?r/7:(r+n)/14}sizeOfBlackWhiteBlackRunBothWays(t,e,r,n){let i=this.sizeOfBlackWhiteBlackRun(t,e,r,n),s=1,o=t-(r-t);o<0?(s=t/(t-o),o=0):o>=this.image.getWidth()&&(s=(this.image.getWidth()-1-t)/(o-t),o=this.image.getWidth()-1);let a=Math.floor(e-(n-e)*s);return s=1,a<0?(s=e/(e-a),a=0):a>=this.image.getHeight()&&(s=(this.image.getHeight()-1-e)/(a-e),a=this.image.getHeight()-1),o=Math.floor(t+(o-t)*s),i+=this.sizeOfBlackWhiteBlackRun(t,e,o,a),i-1}sizeOfBlackWhiteBlackRun(t,e,r,n){const i=Math.abs(n-e)>Math.abs(r-t);if(i){let i=t;t=e,e=i,i=r,r=n,n=i}const s=Math.abs(r-t),o=Math.abs(n-e);let a=-s/2;const h=t0){if(u===n)break;u+=l,a-=s}}return 2===c?et.distance(r+h,n,t,e):NaN}findAlignmentInRegion(t,e,r,n){const i=Math.floor(n*t),s=Math.max(0,e-i),o=Math.min(this.image.getWidth()-1,e+i);if(o-s<3*t)throw new N("Alignment top exceeds estimated module size.");const a=Math.max(0,r-i),h=Math.min(this.image.getHeight()-1,r+i);if(h-a<3*t)throw new N("Alignment bottom exceeds estimated module size.");return new Oe(this.image,s,a,o-s,h-a,t,this.resultPointCallback).find()}}class Le{constructor(){this.decoder=new ye}getDecoder(){return this.decoder}decode(t,e){let r,n;if(null!=e&&void 0!==e.get(E.PURE_BARCODE)){const i=Le.extractPureBits(t.getBlackMatrix());r=this.decoder.decodeBitMatrix(i,e),n=Le.NO_POINTS}else{const i=new Pe(t.getBlackMatrix()).detect(e);r=this.decoder.decodeBitMatrix(i.getBits(),e),n=i.getPoints()}r.getOther()instanceof Ne&&r.getOther().applyMirroredCorrection(n);const i=new v(r.getText(),r.getRawBytes(),void 0,n,x.QR_CODE,void 0),s=r.getByteSegments();null!==s&&i.putMetadata(z.BYTE_SEGMENTS,s);const o=r.getECLevel();return null!==o&&i.putMetadata(z.ERROR_CORRECTION_LEVEL,o),r.hasStructuredAppend()&&(i.putMetadata(z.STRUCTURED_APPEND_SEQUENCE,r.getStructuredAppendSequenceNumber()),i.putMetadata(z.STRUCTURED_APPEND_PARITY,r.getStructuredAppendParity())),i}reset(){}static extractPureBits(t){const e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null===e||null===r)throw new N;const n=this.moduleSize(e,t);let i=e[1],s=r[1],o=e[0],a=r[0];if(o>=a||i>=s)throw new N;if(s-i!=a-o&&(a=o+(s-i),a>=t.getWidth()))throw new N;const h=Math.round((a-o+1)/n),l=Math.round((s-i+1)/n);if(h<=0||l<=0)throw new N;if(l!==h)throw new N;const c=Math.floor(n/2);i+=c,o+=c;const d=o+Math.floor((h-1)*n)-a;if(d>0){if(d>c)throw new N;o-=d}const u=i+Math.floor((l-1)*n)-s;if(u>0){if(u>c)throw new N;i-=u}const g=new R(h,l);for(let e=0;e0;){const o=ke.findGuardPattern(t,i,--n,r,!1,s,h);if(null==o){n++;break}e=o}o[0]=new nt(e[0],n),o[1]=new nt(e[1],n),a=!0;break}}let l=n+1;if(a){let n=0,i=Int32Array.from([Math.trunc(o[0].getX()),Math.trunc(o[1].getX())]);for(;lke.SKIPPED_ROW_COUNT_MAX)break;n++}}l-=n+1,o[2]=new nt(i[0],l),o[3]=new nt(i[1],l)}return l-n0&&h++s?n-s:s-n;if(h>r)return 1/0;a+=h}return a/i}}ke.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),ke.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),ke.MAX_AVG_VARIANCE=.42,ke.MAX_INDIVIDUAL_VARIANCE=.8,ke.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),ke.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),ke.MAX_PIXEL_DRIFT=3,ke.MAX_PATTERN_DRIFT=5,ke.SKIPPED_ROW_COUNT_MAX=25,ke.ROW_STEP=5,ke.BARCODE_MIN_HEIGHT=10;class xe{constructor(t,e){if(0===e.length)throw new a;this.field=t;let r=e.length;if(r>1&&0===e[0]){let t=1;for(;tr.length){let t=e;e=r,r=t}let n=new Int32Array(r.length),i=r.length-e.length;d.arraycopy(r,0,n,0,i);for(let t=i;t=0;e--){let r=this.getCoefficient(e);0!==r&&(r<0?(t.append(" - "),r=-r):t.length()>0&&t.append(" + "),0!==e&&1===r||t.append(r),0!==e&&(1===e?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()}}class Ve{add(t,e){return(t+e)%this.modulus}subtract(t,e){return(this.modulus+t-e)%this.modulus}exp(t){return this.expTable[t]}log(t){if(0===t)throw new a;return this.logTable[t]}inverse(t){if(0===t)throw new q;return this.expTable[this.modulus-this.logTable[t]-1]}multiply(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]}getSize(){return this.modulus}equals(t){return t===this}}class He extends Ve{constructor(t,e){super(),this.modulus=t,this.expTable=new Int32Array(t),this.logTable=new Int32Array(t);let r=1;for(let n=0;n0;t--){let r=n.evaluateAt(this.field.exp(t));i[e-t]=r,0!==r&&(s=!0)}if(!s)return 0;let o=this.field.getOne();if(null!=r)for(const e of r){let r=this.field.exp(t.length-1-e),n=new xe(this.field,new Int32Array([this.field.subtract(0,r),1]));o=o.multiply(n)}let a=new xe(this.field,i),h=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),a,e),c=h[0],d=h[1],u=this.findErrorLocations(c),g=this.findErrorMagnitudes(d,c,u);for(let e=0;e=Math.round(r/2);){let t=n,e=s;if(n=i,s=o,n.isZero())throw l.getChecksumInstance();i=t;let r=this.field.getZero(),a=n.getCoefficient(n.getDegree()),h=this.field.inverse(a);for(;i.getDegree()>=n.getDegree()&&!i.isZero();){let t=i.getDegree()-n.getDegree(),e=this.field.multiply(i.getCoefficient(i.getDegree()),h);r=r.add(this.field.buildMonomial(t,e)),i=i.subtract(n.multiplyByMonomial(t,e))}o=r.multiply(s).subtract(e).negative()}let a=o.getCoefficient(0);if(0===a)throw l.getChecksumInstance();let h=this.field.inverse(a);return[o.multiply(h),i.multiply(h)]}findErrorLocations(t){let e=t.getDegree(),r=new Int32Array(e),n=0;for(let i=1;i0){let e=r?this.topLeft:this.topRight,i=Math.trunc(e.getY()-t);i<0&&(i=0);let o=new nt(e.getX(),i);r?n=o:s=o}if(e>0){let t=r?this.bottomLeft:this.bottomRight,n=Math.trunc(t.getY()+e);n>=this.image.getHeight()&&(n=this.image.getHeight()-1);let s=new nt(t.getX(),n);r?i=s:o=s}return new Xe(this.image,n,i,s,o)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class Ge{constructor(t,e,r,n){this.columnCount=t,this.errorCorrectionLevel=n,this.rowCountUpperPart=e,this.rowCountLowerPart=r,this.rowCount=e+r}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class We{constructor(){this.buffer=""}static form(t,e){let r=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,(function(t,n,i,s,o,a){if("%%"===t)return"%";if(void 0===e[++r])return;t=s?parseInt(s.substr(1)):void 0;let h,l=o?parseInt(o.substr(1)):void 0;switch(a){case"s":h=e[r];break;case"c":h=e[r][0];break;case"f":h=parseFloat(e[r]).toFixed(t);break;case"p":h=parseFloat(e[r]).toPrecision(t);break;case"e":h=parseFloat(e[r]).toExponential(t);break;case"x":h=parseInt(e[r]).toString(l||16);break;case"d":h=parseFloat(parseInt(e[r],l||10).toPrecision(t)).toFixed(0)}h="object"==typeof h?JSON.stringify(h):(+h).toString(l);let c=parseInt(i),d=i&&i[0]+""=="0"?"0":" ";for(;h.length=0&&(e=this.codewords[n],null!=e))return e;if(n=this.imageRowToCodewordIndex(t)+r,nr,getValue:()=>n};i.getValue()>t?(t=i.getValue(),e=[],e.push(i.getKey())):i.getValue()===t&&e.push(i.getKey())}return Fe.toIntArray(e)}getConfidence(t){return this.values.get(t)}}class Ze extends ze{constructor(t,e){super(t),this._isLeft=e}setRowNumbers(){for(let t of this.getCodewords())null!=t&&t.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(t){let e=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(e,t);let r=this.getBoundingBox(),n=this._isLeft?r.getTopLeft():r.getTopRight(),i=this._isLeft?r.getBottomLeft():r.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(n.getY())),o=this.imageRowToCodewordIndex(Math.trunc(i.getY())),a=-1,h=1,l=0;for(let r=s;r=t.getRowCount()||i>r)e[r]=null;else{let t;t=h>2?(h-2)*i:i;let s=t>=r;for(let n=1;n<=t&&!s;n++)s=null!=e[r-n];s?e[r]=null:(a=n.getRowNumber(),l=1)}}}getRowHeights(){let t=this.getBarcodeMetadata();if(null==t)return null;this.adjustIncompleteIndicatorColumnRowNumbers(t);let e=new Int32Array(t.getRowCount());for(let t of this.getCodewords())if(null!=t){let r=t.getRowNumber();if(r>=e.length)continue;e[r]++}return e}adjustIncompleteIndicatorColumnRowNumbers(t){let e=this.getBoundingBox(),r=this._isLeft?e.getTopLeft():e.getTopRight(),n=this._isLeft?e.getBottomLeft():e.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(r.getY())),s=this.imageRowToCodewordIndex(Math.trunc(n.getY())),o=this.getCodewords(),a=-1;for(let e=i;e=t.getRowCount()?o[e]=null:a=r.getRowNumber())}}getBarcodeMetadata(){let t=this.getCodewords(),e=new Ye,r=new Ye,n=new Ye,i=new Ye;for(let s of t){if(null==s)continue;s.setRowNumberAsRowIndicatorColumn();let t=s.getValue()%30,o=s.getRowNumber();switch(this._isLeft||(o+=2),o%3){case 0:r.setValue(3*t+1);break;case 1:i.setValue(t/3),n.setValue(t%3);break;case 2:e.setValue(t+1)}}if(0===e.getValue().length||0===r.getValue().length||0===n.getValue().length||0===i.getValue().length||e.getValue()[0]<1||r.getValue()[0]+n.getValue()[0]Fe.MAX_ROWS_IN_BARCODE)return null;let s=new Ge(e.getValue()[0],r.getValue()[0],n.getValue()[0],i.getValue()[0]);return this.removeIncorrectCodewords(t,s),s}removeIncorrectCodewords(t,e){for(let r=0;re.getRowCount())t[r]=null;else switch(this._isLeft||(s+=2),s%3){case 0:3*i+1!==e.getRowCountUpperPart()&&(t[r]=null);break;case 1:Math.trunc(i/3)===e.getErrorCorrectionLevel()&&i%3===e.getRowCountLowerPart()||(t[r]=null);break;case 2:i+1!==e.getColumnCount()&&(t[r]=null)}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+"\n"+super.toString()}}class Ke{constructor(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let t,e=Fe.MAX_CODEWORDS_IN_BARCODE;do{t=e,e=this.adjustRowNumbersAndGetCount()}while(e>0&&e0&&i0&&(o[0]=r[e-1],o[4]=i[e-1],o[5]=s[e-1]),e>1&&(o[8]=r[e-2],o[10]=i[e-2],o[11]=s[e-2]),e>=1;r=1&e,Qe.RATIOS_TABLE[t]||(Qe.RATIOS_TABLE[t]=new Array(Fe.BARS_IN_MODULE)),Qe.RATIOS_TABLE[t][Fe.BARS_IN_MODULE-n-1]=Math.fround(i/Fe.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(t){let e=Qe.getDecodedCodewordValue(Qe.sampleBitCounts(t));return-1!==e?e:Qe.getClosestDecodedValue(t)}static sampleBitCounts(t){let e=et.sum(t),r=new Int32Array(Fe.BARS_IN_MODULE),n=0,i=0;for(let s=0;s1)for(let n=0;n=n)break}enew Array(Fe.BARS_IN_MODULE)));class je{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(t){this.segmentIndex=t}getFileId(){return this.fileId}setFileId(t){this.fileId=t}getOptionalData(){return this.optionalData}setOptionalData(t){this.optionalData=t}isLastSegment(){return this.lastSegment}setLastSegment(t){this.lastSegment=t}getSegmentCount(){return this.segmentCount}setSegmentCount(t){this.segmentCount=t}getSender(){return this.sender||null}setSender(t){this.sender=t}getAddressee(){return this.addressee||null}setAddressee(t){this.addressee=t}getFileName(){return this.fileName}setFileName(t){this.fileName=t}getFileSize(){return this.fileSize}setFileSize(t){this.fileSize=t}getChecksum(){return this.checksum}setChecksum(t){this.checksum=t}getTimestamp(){return this.timestamp}setTimestamp(t){this.timestamp=t}}class Je{static parseLong(t,e=void 0){return parseInt(t,e)}}class $e extends s{}$e.kind="NullPointerException";class tr{writeBytes(t){this.writeBytesOffset(t,0,t.length)}writeBytesOffset(t,e,r){if(null==t)throw new $e;if(e<0||e>t.length||r<0||e+r>t.length||e+r<0)throw new u;if(0!==r)for(let n=0;n0&&this.grow(t)}grow(t){let e=this.buf.length<<1;if(e-t<0&&(e=t),e<0){if(t<0)throw new er;e=w.MAX_VALUE}this.buf=f.copyOfUint8Array(this.buf,e)}write(t){this.ensureCapacity(this.count+1),this.buf[this.count]=t,this.count+=1}writeBytesOffset(t,e,r){if(e<0||e>t.length||r<0||e+r-t.length>0)throw new u;this.ensureCapacity(this.count+r),d.arraycopy(t,e,this.buf,this.count,r),this.count+=r}writeTo(t){t.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return f.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(t){return t?"string"==typeof t?this.toString_string(t):this.toString_number(t):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(t){return new String(this.buf).toString()}toString_number(t){return new String(this.buf).toString()}close(){}}function nr(){if("undefined"!=typeof window)return window.BigInt||null;if("undefined"!=typeof global)return global.BigInt||null;if("undefined"!=typeof self)return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let ir;function sr(t){if(void 0===ir&&(ir=nr()),null===ir)throw new Error("BigInt is not supported!");return ir(t)}!function(t){t[t.ALPHA=0]="ALPHA",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.PUNCT=3]="PUNCT",t[t.ALPHA_SHIFT=4]="ALPHA_SHIFT",t[t.PUNCT_SHIFT=5]="PUNCT_SHIFT"}(W||(W={}));class or{static decode(t,e){let r=new T(""),n=I.ISO8859_1;r.enableDecoding(n);let i=1,s=t[i++],o=new je;for(;it[0])throw m.getFormatInstance();let n=new Int32Array(or.NUMBER_OF_SEQUENCE_CODEWORDS);for(let r=0;r0){for(let t=0;t<6;++t)s.write(Number(sr(a)>>sr(8*(5-t))));a=0,o=0}}n===e[0]&&r0){for(let t=0;t<6;++t)s.write(Number(sr(a)>>sr(8*(5-t))));a=0,o=0}}}return i.append(S.decode(s.toByteArray(),r)),n}static numericCompaction(t,e,r){let n=0,i=!1,s=new Int32Array(or.MAX_NUMERIC_CODEWORDS);for(;e0&&(r.append(or.decodeBase900toBase10(s,n)),n=0)}return e}static decodeBase900toBase10(t,e){let r=sr(0);for(let n=0;n@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",or.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",or.EXP900=nr()?function(){let t=[];t[0]=sr(1);let e=sr(900);t[1]=e;for(let r=2;r<16;r++)t[r]=t[r-1]*e;return t}():[],or.NUMBER_OF_SEQUENCE_CODEWORDS=2;class ar{constructor(){}static decode(t,e,r,n,i,s,o){let a,h=new Xe(t,e,r,n,i),l=null,c=null;for(let r=!0;;r=!1){if(null!=e&&(l=ar.getRowIndicatorColumn(t,h,e,!0,s,o)),null!=n&&(c=ar.getRowIndicatorColumn(t,h,n,!1,s,o)),a=ar.merge(l,c),null==a)throw N.getNotFoundInstance();let i=a.getBoundingBox();if(!r||null==i||!(i.getMinY()h.getMaxY()))break;h=i}a.setBoundingBox(h);let d=a.getBarcodeColumnCount()+1;a.setDetectionResultColumn(0,l),a.setDetectionResultColumn(d,c);let u=null!=l;for(let e=1;e<=d;e++){let r,n=u?e:d-e;if(void 0!==a.getDetectionResultColumn(n))continue;r=0===n||n===d?new Ze(h,0===n):new ze(h),a.setDetectionResultColumn(n,r);let i=-1,l=i;for(let e=h.getMinY();e<=h.getMaxY();e++){if(i=ar.getStartColumn(a,n,e,u),i<0||i>h.getMaxX()){if(-1===l)continue;i=l}let c=ar.detectCodeword(t,h.getMinX(),h.getMaxX(),u,i,e,s,o);null!=c&&(r.setCodeword(e,c),l=i,s=Math.min(s,c.getWidth()),o=Math.max(o,c.getWidth()))}}return ar.createDecoderResult(a)}static merge(t,e){if(null==t&&null==e)return null;let r=ar.getBarcodeMetadata(t,e);if(null==r)return null;let n=Xe.merge(ar.adjustBoundingBox(t),ar.adjustBoundingBox(e));return new Ke(r,n)}static adjustBoundingBox(t){if(null==t)return null;let e=t.getRowHeights();if(null==e)return null;let r=ar.getMax(e),n=0;for(let t of e)if(n+=r-t,t>0)break;let i=t.getCodewords();for(let t=0;n>0&&null==i[t];t++)n--;let s=0;for(let t=e.length-1;t>=0&&(s+=r-e[t],!(e[t]>0));t--);for(let t=i.length-1;s>0&&null==i[t];t--)s--;return t.getBoundingBox().addMissingRows(n,s,t.isLeft())}static getMax(t){let e=-1;for(let r of t)e=Math.max(e,r);return e}static getBarcodeMetadata(t,e){let r,n;return null==t||null==(r=t.getBarcodeMetadata())?null==e?null:e.getBarcodeMetadata():null==e||null==(n=e.getBarcodeMetadata())?r:r.getColumnCount()!==n.getColumnCount()&&r.getErrorCorrectionLevel()!==n.getErrorCorrectionLevel()&&r.getRowCount()!==n.getRowCount()?null:r}static getRowIndicatorColumn(t,e,r,n,i,s){let o=new Ze(e,n);for(let a=0;a<2;a++){let h=0===a?1:-1,l=Math.trunc(Math.trunc(r.getX()));for(let a=Math.trunc(Math.trunc(r.getY()));a<=e.getMaxY()&&a>=e.getMinY();a+=h){let e=ar.detectCodeword(t,0,t.getWidth(),n,l,a,i,s);null!=e&&(o.setCodeword(a,e),l=n?e.getStartX():e.getEndX())}}return o}static adjustCodewordCount(t,e){let r=e[0][1],n=r.getValue(),i=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-ar.getNumberOfECCodeWords(t.getBarcodeECLevel());if(0===n.length){if(i<1||i>Fe.MAX_CODEWORDS_IN_BARCODE)throw N.getNotFoundInstance();r.setValue(i)}else n[0]!==i&&r.setValue(i)}static createDecoderResult(t){let e=ar.createBarcodeMatrix(t);ar.adjustCodewordCount(t,e);let r=new Array,n=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),i=[],s=new Array;for(let o=0;o0;){for(let t=0;tnew Array(t.getBarcodeColumnCount()+2)));for(let t=0;t=0){if(n>=e.length)continue;e[n][r].setValue(t.getValue())}}r++}return e}static isValidBarcodeColumn(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1}static getStartColumn(t,e,r,n){let i=n?1:-1,s=null;if(ar.isValidBarcodeColumn(t,e-i)&&(s=t.getDetectionResultColumn(e-i).getCodeword(r)),null!=s)return n?s.getEndX():s.getStartX();if(s=t.getDetectionResultColumn(e).getCodewordNearby(r),null!=s)return n?s.getStartX():s.getEndX();if(ar.isValidBarcodeColumn(t,e-i)&&(s=t.getDetectionResultColumn(e-i).getCodewordNearby(r)),null!=s)return n?s.getEndX():s.getStartX();let o=0;for(;ar.isValidBarcodeColumn(t,e-i);){e-=i;for(let r of t.getDetectionResultColumn(e).getCodewords())if(null!=r)return(n?r.getEndX():r.getStartX())+i*o*(r.getEndX()-r.getStartX());o++}return n?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()}static detectCodeword(t,e,r,n,i,s,o,a){i=ar.adjustCodewordStartColumn(t,e,r,n,i,s);let h,l=ar.getModuleBitCount(t,e,r,n,i,s);if(null==l)return null;let c=et.sum(l);if(n)h=i+c;else{for(let t=0;t=e)&&h=e:oar.CODEWORD_SKEW_SIZE)return i;o+=a}a=-a,n=!n}return o}static checkCodewordSkew(t,e,r){return e-ar.CODEWORD_SKEW_SIZE<=t&&t<=r+ar.CODEWORD_SKEW_SIZE}static decodeCodewords(t,e,r){if(0===t.length)throw m.getFormatInstance();let n=1<r/2+ar.MAX_ERRORS||r<0||r>ar.MAX_EC_CODEWORDS)throw l.getChecksumInstance();return ar.errorCorrection.decode(t,r,e)}static verifyCodewordCount(t,e){if(t.length<4)throw m.getFormatInstance();let r=t[0];if(r>t.length)throw m.getFormatInstance();if(0===r){if(!(e>=1;return e}static getCodewordBucketNumber(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)}static getCodewordBucketNumber_number(t){return ar.getCodewordBucketNumber(ar.getBitCountForCodeword(t))}static getCodewordBucketNumber_Int32Array(t){return(t[0]-t[2]+t[4]-t[6]+9)%9}static toString(t){let e=new We;for(let r=0;rt))}static getMaxWidth(t,e){return null==t||null==e?0:Math.trunc(Math.abs(t.getX()-e.getX()))}static getMinWidth(t,e){return null==t||null==e?w.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))}static getMaxCodewordWidth(t){return Math.floor(Math.max(Math.max(hr.getMaxWidth(t[0],t[4]),hr.getMaxWidth(t[6],t[2])*Fe.MODULES_IN_CODEWORD/Fe.MODULES_IN_STOP_PATTERN),Math.max(hr.getMaxWidth(t[1],t[5]),hr.getMaxWidth(t[7],t[3])*Fe.MODULES_IN_CODEWORD/Fe.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(t){return Math.floor(Math.min(Math.min(hr.getMinWidth(t[0],t[4]),hr.getMinWidth(t[6],t[2])*Fe.MODULES_IN_CODEWORD/Fe.MODULES_IN_STOP_PATTERN),Math.min(hr.getMinWidth(t[1],t[5]),hr.getMinWidth(t[7],t[3])*Fe.MODULES_IN_CODEWORD/Fe.MODULES_IN_STOP_PATTERN)))}reset(){}}class lr extends s{}lr.kind="ReaderException";class cr{decode(t,e){return this.setHints(e),this.decodeInternal(t)}decodeWithState(t){return null!==this.readers&&void 0!==this.readers||this.setHints(null),this.decodeInternal(t)}setHints(t){this.hints=t;const e=null!=t&&void 0!==t.get(E.TRY_HARDER),r=null==t?null:t.get(E.POSSIBLE_FORMATS),n=new Array;if(null!=r){const i=r.some((t=>t===x.UPC_A||t===x.UPC_E||t===x.EAN_13||t===x.EAN_8||t===x.CODABAR||t===x.CODE_39||t===x.CODE_93||t===x.CODE_128||t===x.ITF||t===x.RSS_14||t===x.RSS_EXPANDED));i&&!e&&n.push(new se(t)),r.includes(x.QR_CODE)&&n.push(new Le),r.includes(x.DATA_MATRIX)&&n.push(new we),r.includes(x.AZTEC)&&n.push(new gt),r.includes(x.PDF_417)&&n.push(new hr),i&&e&&n.push(new se(t))}0===n.length&&(e||n.push(new se(t)),n.push(new Le),n.push(new we),n.push(new gt),n.push(new hr),e&&n.push(new se(t))),this.readers=n}reset(){if(null!==this.readers)for(const t of this.readers)t.reset()}decodeInternal(t){if(null===this.readers)throw new lr("No readers where selected, nothing can be read.");for(const e of this.readers)try{return e.decode(t,this.hints)}catch(t){if(t instanceof lr)continue}throw new N("No MultiFormat Readers were able to detect the code.")}}var dr;!function(t){t[t.ERROR_CORRECTION=0]="ERROR_CORRECTION",t[t.CHARACTER_SET=1]="CHARACTER_SET",t[t.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",t[t.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",t[t.MIN_SIZE=4]="MIN_SIZE",t[t.MAX_SIZE=5]="MAX_SIZE",t[t.MARGIN=6]="MARGIN",t[t.PDF417_COMPACT=7]="PDF417_COMPACT",t[t.PDF417_COMPACTION=8]="PDF417_COMPACTION",t[t.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",t[t.AZTEC_LAYERS=10]="AZTEC_LAYERS",t[t.QR_VERSION=11]="QR_VERSION",t[t.GS1_FORMAT=12]="GS1_FORMAT",t[t.FORCE_C40=13]="FORCE_C40"}(dr||(dr={}));var ur=dr;class gr{constructor(t){this.field=t,this.cachedGenerators=[],this.cachedGenerators.push(new K(t,Int32Array.from([1])))}buildGenerator(t){const e=this.cachedGenerators;if(t>=e.length){let r=e[e.length-1];const n=this.field;for(let i=e.length;i<=t;i++){const t=r.multiply(new K(n,Int32Array.from([1,n.exp(i-1+n.getGeneratorBase())])));e.push(t),r=t}}return e[t]}encode(t,e){if(0===e)throw new a("No error correction bytes");const r=t.length-e;if(r<=0)throw new a("No data bytes provided");const n=this.buildGenerator(e),i=new Int32Array(r);d.arraycopy(t,0,i,0,r);let s=new K(this.field,i);s=s.multiplyByMonomial(e,1);const o=s.divide(n)[1].getCoefficients(),h=e-o.length;for(let e=0;e=5&&(r+=fr.N1+(n-5)),n=1,o=i)}n>=5&&(r+=fr.N1+(n-5))}return r}}fr.N1=3,fr.N2=3,fr.N3=40,fr.N4=10;class wr{constructor(t,e){this.width=t,this.height=e;const r=new Array(e);for(let n=0;n!==e;n++)r[n]=new Uint8Array(t);this.bytes=r}getHeight(){return this.height}getWidth(){return this.width}get(t,e){return this.bytes[e][t]}getArray(){return this.bytes}setNumber(t,e,r){this.bytes[e][t]=r}setBoolean(t,e,r){this.bytes[e][t]=r?1:0}clear(t){for(const e of this.bytes)f.fill(e,t)}equals(t){if(!(t instanceof wr))return!1;const e=t;if(this.width!==e.width)return!1;if(this.height!==e.height)return!1;for(let t=0,r=this.height;t>\n"),t.toString()}setMode(t){this.mode=t}setECLevel(t){this.ecLevel=t}setVersion(t){this.version=t}setMaskPattern(t){this.maskPattern=t}setMatrix(t){this.matrix=t}static isValidMaskPattern(t){return t>=0&&t0;){for(6===s&&(s-=1);o>=0&&o=r;)t^=e<=0)for(let t=0;t!==r;t++){const r=n[t];r>=0&&Er.isEmpty(e.get(r,i))&&Er.embedPositionAdjustmentPattern(r-2,i-2,e)}}}}Er.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),Er.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),Er.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),Er.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),Er.VERSION_INFO_POLY=7973,Er.TYPE_INFO_POLY=1335,Er.TYPE_INFO_MASK_PATTERN=21522;class mr{constructor(t,e){this.dataBytes=t,this.errorCorrectionBytes=e}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class Ir{constructor(){}static calculateMaskPenalty(t){return fr.applyMaskPenaltyRule1(t)+fr.applyMaskPenaltyRule2(t)+fr.applyMaskPenaltyRule3(t)+fr.applyMaskPenaltyRule4(t)}static encode(t,e,r=null){let n=Ir.DEFAULT_BYTE_MODE_ENCODING;const i=null!==r&&void 0!==r.get(ur.CHARACTER_SET);i&&(n=r.get(ur.CHARACTER_SET).toString());const s=this.chooseMode(t,n),o=new C;if(s===Te.BYTE&&(i||Ir.DEFAULT_BYTE_MODE_ENCODING!==n)){const t=I.getCharacterSetECIByName(n);void 0!==t&&this.appendECI(t,o)}this.appendModeInfo(s,o);const a=new C;let h;if(this.appendBytes(t,s,a,n),null!==r&&void 0!==r.get(ur.QR_VERSION)){const t=Number.parseInt(r.get(ur.QR_VERSION).toString(),10);h=Ie.getVersionForNumber(t);const n=this.calculateBitsNeeded(s,o,a,h);if(!this.willFit(n,h,e))throw new Ar("Data too big for requested version")}else h=this.recommendVersion(e,s,o,a);const l=new C;l.appendBitArray(o);const c=s===Te.BYTE?a.getSizeInBytes():t.length;this.appendLengthInfo(c,h,s,l),l.appendBitArray(a);const d=h.getECBlocksForLevel(e),u=h.getTotalCodewords()-d.getTotalECCodewords();this.terminateBits(u,l);const g=this.interleaveWithECBytes(l,h.getTotalCodewords(),u,d.getNumBlocks()),f=new Cr;f.setECLevel(e),f.setMode(s),f.setVersion(h);const w=h.getDimensionForVersion(),A=new wr(w,w),E=this.chooseMaskPattern(g,e,h,A);return f.setMaskPattern(E),Er.buildMatrix(g,e,h,E,A),f.setMatrix(A),f}static recommendVersion(t,e,r,n){const i=this.calculateBitsNeeded(e,r,n,Ie.getVersionForNumber(1)),s=this.chooseVersion(i,t),o=this.calculateBitsNeeded(e,r,n,s);return this.chooseVersion(o,t)}static calculateBitsNeeded(t,e,r,n){return e.getSize()+t.getCharacterCountBits(n)+r.getSize()}static getAlphanumericCode(t){return t159)&&(r<224||r>235))return!1}return!0}static chooseMaskPattern(t,e,r,n){let i=Number.MAX_SAFE_INTEGER,s=-1;for(let o=0;o=(t+7)/8}static terminateBits(t,e){const r=8*t;if(e.getSize()>r)throw new Ar("data bits cannot fit in the QR Code"+e.getSize()+" > "+r);for(let t=0;t<4&&e.getSize()0)for(let t=n;t<8;t++)e.appendBit(!1);const i=t-e.getSizeInBytes();for(let t=0;t=r)throw new Ar("Block ID too large");const o=t%r,a=r-o,h=Math.floor(t/r),l=h+1,c=Math.floor(e/r),d=c+1,u=h-c,g=l-d;if(u!==g)throw new Ar("EC bytes mismatch");if(r!==a+o)throw new Ar("RS blocks mismatch");if(t!==(c+u)*a+(d+g)*o)throw new Ar("Total bytes mismatch");n=1<=0&&e<=9}static appendNumericBytes(t,e){const r=t.length;let n=0;for(;n=33088&&n<=40956?i=n-33088:n>=57408&&n<=60351&&(i=n-49472),-1===i)throw new Ar("Invalid byte sequence");const s=192*(i>>8)+(255&i);e.appendBits(s,13)}}static appendECI(t,e){e.appendBits(Te.ECI.getBits(),4),e.appendBits(t.getValue(),8)}}Ir.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Ir.DEFAULT_BYTE_MODE_ENCODING=I.UTF8.getName();class _r{write(t,e,r,n=null){if(0===t.length)throw new a("Found empty contents");if(e<0||r<0)throw new a("Requested dimensions are too small: "+e+"x"+r);let i=Ce.L,s=_r.QUIET_ZONE_SIZE;null!==n&&(void 0!==n.get(ur.ERROR_CORRECTION)&&(i=Ce.fromString(n.get(ur.ERROR_CORRECTION).toString())),void 0!==n.get(ur.MARGIN)&&(s=Number.parseInt(n.get(ur.MARGIN).toString(),10)));const o=Ir.encode(t,i,n);return this.renderResult(o,e,r,s)}writeToDom(t,e,r,n,i=null){"string"==typeof t&&(t=document.querySelector(t));const s=this.write(e,r,n,i);t&&t.appendChild(s)}renderResult(t,e,r,n){const i=t.getMatrix();if(null===i)throw new J;const s=i.getWidth(),o=i.getHeight(),a=s+2*n,h=o+2*n,l=Math.max(e,a),c=Math.max(r,h),d=Math.min(Math.floor(l/a),Math.floor(c/h)),u=Math.floor((l-s*d)/2),g=Math.floor((c-o*d)/2),f=this.createSVGElement(l,c);for(let t=0,e=g;te||i+o>r)throw new a("Crop rectangle does not fit within image data.");h&&this.reverseHorizontal(s,o)}getRow(t,e){if(t<0||t>=this.getHeight())throw new a("Requested row is outside the image: "+t);const r=this.getWidth();(null==e||e.length>16&255,s=r>>7&510,o=255&r;i[e]=(n+s+o)/4&255}this.luminances=i}else this.luminances=t;if(void 0===n&&(this.dataWidth=e),void 0===i&&(this.dataHeight=r),void 0===s&&(this.left=0),void 0===o&&(this.top=0),this.left+e>this.dataWidth||this.top+r>this.dataHeight)throw new a("Crop rectangle does not fit within image data.")}getRow(t,e){if(t<0||t>=this.getHeight())throw new a("Requested row is outside the image: "+t);const r=this.getWidth();(null==e||e.length=0&&this.noBit(r,e)&&this.utah(e,r,t++),e-=2,r+=2}while(e>=0&&r=0&&r=0);e+=3,r++}while(e{let r=1;for(let n=0;n<255;n++)e[n]=r,t[r]=n,r*=2,r>=256&&(r^=301);return{LOG:t,ALOG:e}})([],[]);var Br;t.DataMatrixSymbolShapeHint=void 0,(Br=t.DataMatrixSymbolShapeHint||(t.DataMatrixSymbolShapeHint={}))[Br.FORCE_NONE=0]="FORCE_NONE",Br[Br.FORCE_SQUARE=1]="FORCE_SQUARE",Br[Br.FORCE_RECTANGLE=2]="FORCE_RECTANGLE";const Pr="[)>05",Lr="[)>06",Fr="";class vr{static encodeECC200(t,e){if(t.length!==e.getDataCapacity())throw new Error("The number of codewords does not match the selected symbol");const r=new T;r.append(t);const n=e.getInterleavedBlockCount();if(1===n){const n=this.createECCBlock(t,e.getErrorCodewords());r.append(n)}else{const i=[];for(let t=0;t0;t--)0!==s&&0!==n[t]?i[t]=i[t-1]^br[(Mr[s]+Mr[n[t]])%255]:i[t]=i[t-1];0!==s&&0!==n[0]?i[0]=br[(Mr[s]+Mr[n[0]])%255]:i[0]=0}const s=[];for(let t=0;tString.fromCharCode(t))).join("")}}class kr{getEncodingMode(){return 0}encode(t){if(Yr.determineConsecutiveDigitCount(t.getMessage(),t.pos)>=2)t.writeCodeword(this.encodeASCIIDigits(t.getMessage().charCodeAt(t.pos),t.getMessage().charCodeAt(t.pos+1))),t.pos+=2;else{const e=t.getCurrentChar(),r=Yr.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(r!==this.getEncodingMode())switch(r){case 5:return t.writeCodeword(231),void t.signalEncoderChange(5);case 1:return t.writeCodeword(230),void t.signalEncoderChange(1);case 3:t.writeCodeword(238),t.signalEncoderChange(3);break;case 2:t.writeCodeword(239),t.signalEncoderChange(2);break;case 4:t.writeCodeword(240),t.signalEncoderChange(4);break;default:throw new Error("Illegal mode: "+r)}else Yr.isExtendedASCII(e)?(t.writeCodeword(235),t.writeCodeword(e-128+1),t.pos++):(t.writeCodeword(e+1),t.pos++)}}encodeASCIIDigits(t,e){if(Yr.isDigit(t)&&Yr.isDigit(e)){return 10*(t-48)+(e-48)+130}throw new Error("not digits: "+t+e)}}class xr{getEncodingMode(){return 5}encode(t){const e=new T;for(e.append(0);t.hasMoreCharacters();){const r=t.getCurrentChar();e.append(r),t.pos++;if(Yr.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}const r=e.length()-1,n=t.getCodewordCount()+r+1;t.updateSymbolInfo(n);const i=t.getSymbolInfo().getDataCapacity()-n>0;if(t.hasMoreCharacters()||i)if(r<=249)e.setCharAt(0,p.getCharAt(r));else{if(!(r<=1555))throw new Error("Message length not in valid ranges: "+r);e.setCharAt(0,p.getCharAt(Math.floor(r/250)+249)),e.insert(1,p.getCharAt(r%250))}for(let r=0,n=e.length();r3||1!==o))&&(t.pos=n)}e.length()>0&&t.writeCodeword(230),this.handleEOD(t,e)}encode(t){const e=new T;for(;t.hasMoreCharacters();){const r=t.getCurrentChar();t.pos++;let n=this.encodeChar(r,e);const i=2*Math.floor(e.length()/3),s=t.getCodewordCount()+i;t.updateSymbolInfo(s);const o=t.getSymbolInfo().getDataCapacity()-s;if(!t.hasMoreCharacters()){const r=new T;for(e.length()%3==2&&2!==o&&(n=this.backtrackOneCharacter(t,e,r,n));e.length()%3==1&&(n>3||1!==o);)n=this.backtrackOneCharacter(t,e,r,n);break}if(e.length()%3==0){if(Yr.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}}this.handleEOD(t,e)}backtrackOneCharacter(t,e,r,n){const i=e.length(),s=e.toString().substring(0,i-n);e.setLengthToZero(),e.append(s),t.pos--;const o=t.getCurrentChar();return n=this.encodeChar(o,r),t.resetSymbolInfo(),n}writeNextTriplet(t,e){t.writeCodewords(this.encodeToCodewords(e.toString()));const r=e.toString().substring(3);e.setLengthToZero(),e.append(r)}handleEOD(t,e){const r=Math.floor(e.length()/3*2),n=e.length()%3,i=t.getCodewordCount()+r;t.updateSymbolInfo(i);const s=t.getSymbolInfo().getDataCapacity()-i;if(2===n){for(e.append("\0");e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(254)}else if(1===s&&1===n){for(;e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(254),t.pos--}else{if(0!==n)throw new Error("Unexpected case. Please report!");for(;e.length()>=3;)this.writeNextTriplet(t,e);(s>0||t.hasMoreCharacters())&&t.writeCodeword(254)}t.signalEncoderChange(0)}encodeChar(t,e){if(t===" ".charCodeAt(0))return e.append(3),1;if(t>="0".charCodeAt(0)&&t<="9".charCodeAt(0))return e.append(t-48+4),1;if(t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0))return e.append(t-65+14),1;if(t<" ".charCodeAt(0))return e.append(0),e.append(t),2;if(t<="/".charCodeAt(0))return e.append(1),e.append(t-33),2;if(t<="@".charCodeAt(0))return e.append(1),e.append(t-58+15),2;if(t<="_".charCodeAt(0))return e.append(1),e.append(t-91+22),2;if(t<=127)return e.append(2),e.append(t-96),2;e.append("1");let r=2;return r+=this.encodeChar(t-128,e),r}encodeToCodewords(t){const e=1600*t.charCodeAt(0)+40*t.charCodeAt(1)+t.charCodeAt(2)+1,r=e/256,n=e%256,i=new T;return i.append(r),i.append(n),i.toString()}}class Hr{getEncodingMode(){return 4}encode(t){const e=new T;for(;t.hasMoreCharacters();){const r=t.getCurrentChar();this.encodeChar(r,e),t.pos++;if(e.length()>=4){t.writeCodewords(this.encodeToCodewords(e.toString()));const r=e.toString().substring(4);e.setLengthToZero(),e.append(r);if(Yr.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}}e.append(p.getCharAt(31)),this.handleEOD(t,e)}handleEOD(t,e){try{const r=e.length();if(0===r)return;if(1===r){t.updateSymbolInfo();let e=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount();const r=t.getRemainingCharacters();if(r>e&&(t.updateSymbolInfo(t.getCodewordCount()+1),e=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount()),r<=e&&e<=2)return}if(r>4)throw new Error("Count must not exceed 4");const n=r-1,i=this.encodeToCodewords(e.toString());let s=!t.hasMoreCharacters()&&n<=2;if(n<=2){t.updateSymbolInfo(t.getCodewordCount()+n);t.getSymbolInfo().getDataCapacity()-t.getCodewordCount()>=3&&(s=!1,t.updateSymbolInfo(t.getCodewordCount()+i.length))}s?(t.resetSymbolInfo(),t.pos-=n):t.writeCodewords(i)}finally{t.signalEncoderChange(0)}}encodeChar(t,e){t>=" ".charCodeAt(0)&&t<="?".charCodeAt(0)?e.append(t):t>="@".charCodeAt(0)&&t<="^".charCodeAt(0)?e.append(p.getCharAt(t-64)):Yr.illegalCharacter(p.getCharAt(t))}encodeToCodewords(t){const e=t.length;if(0===e)throw new Error("StringBuilder must not be empty");const r=(t.charAt(0).charCodeAt(0)<<18)+((e>=2?t.charAt(1).charCodeAt(0):0)<<12)+((e>=3?t.charAt(2).charCodeAt(0):0)<<6)+(e>=4?t.charAt(3).charCodeAt(0):0),n=r>>16&255,i=r>>8&255,s=255&r,o=new T;return o.append(n),e>=2&&o.append(i),e>=3&&o.append(s),o.toString()}}class Ur{constructor(t,e,r,n,i,s,o=0,a=0){this.rectangular=t,this.dataCapacity=e,this.errorCodewords=r,this.matrixWidth=n,this.matrixHeight=i,this.dataRegions=s,this.rsBlockData=o,this.rsBlockError=a}static lookup(t,e=0,r=null,n=null,i=!0){for(const i of Xr)if((1!==e||!i.rectangular)&&(2!==e||i.rectangular)&&(null==r||!(i.getSymbolWidth()n.getWidth()||i.getSymbolHeight()>n.getHeight()))&&t<=i.dataCapacity)return i;if(i)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+t);return null}getHorizontalDataRegions(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}}getVerticalDataRegions(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}}getSymbolDataWidth(){return this.getHorizontalDataRegions()*this.matrixWidth}getSymbolDataHeight(){return this.getVerticalDataRegions()*this.matrixHeight}getSymbolWidth(){return this.getSymbolDataWidth()+2*this.getHorizontalDataRegions()}getSymbolHeight(){return this.getSymbolDataHeight()+2*this.getVerticalDataRegions()}getCodewordCount(){return this.dataCapacity+this.errorCodewords}getInterleavedBlockCount(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1}getDataCapacity(){return this.dataCapacity}getErrorCodewords(){return this.errorCodewords}getDataLengthForInterleavedBlock(t){return this.rsBlockData}getErrorLengthForInterleavedBlock(t){return this.rsBlockError}}const Xr=[new Ur(!1,3,5,8,8,1),new Ur(!1,5,7,10,10,1),new Ur(!0,5,7,16,6,1),new Ur(!1,8,10,12,12,1),new Ur(!0,10,11,14,6,2),new Ur(!1,12,12,14,14,1),new Ur(!0,16,14,24,10,1),new Ur(!1,18,14,16,16,1),new Ur(!1,22,18,18,18,1),new Ur(!0,22,18,16,10,2),new Ur(!1,30,20,20,20,1),new Ur(!0,32,24,16,14,2),new Ur(!1,36,24,22,22,1),new Ur(!1,44,28,24,24,1),new Ur(!0,49,28,22,14,2),new Ur(!1,62,36,14,14,4),new Ur(!1,86,42,16,16,4),new Ur(!1,114,48,18,18,4),new Ur(!1,144,56,20,20,4),new Ur(!1,174,68,22,22,4),new Ur(!1,204,84,24,24,4,102,42),new Ur(!1,280,112,14,14,16,140,56),new Ur(!1,368,144,16,16,16,92,36),new Ur(!1,456,192,18,18,16,114,48),new Ur(!1,576,224,20,20,16,144,56),new Ur(!1,696,272,22,22,16,174,68),new Ur(!1,816,336,24,24,16,136,56),new Ur(!1,1050,408,18,18,36,175,68),new Ur(!1,1304,496,20,20,36,163,62),new class extends Ur{constructor(){super(!1,1558,620,22,22,36,-1,62)}getInterleavedBlockCount(){return 10}getDataLengthForInterleavedBlock(t){return t<=8?156:155}}];class Gr{constructor(t){this.msg=t,this.pos=0,this.skipAtEnd=0;const e=t.split("").map((t=>t.charCodeAt(0))),r=new T;for(let n=0,i=e.length;nthis.symbolInfo.getDataCapacity())&&(this.symbolInfo=Ur.lookup(t,this.shape,this.minSize,this.maxSize,!0))}resetSymbolInfo(){this.symbolInfo=null}}class Wr extends Vr{getEncodingMode(){return 3}encode(t){const e=new T;for(;t.hasMoreCharacters();){const r=t.getCurrentChar();t.pos++,this.encodeChar(r,e);if(e.length()%3==0){this.writeNextTriplet(t,e);if(Yr.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}}this.handleEOD(t,e)}encodeChar(t,e){switch(t){case 13:e.append(0);break;case"*".charCodeAt(0):e.append(1);break;case">".charCodeAt(0):e.append(2);break;case" ".charCodeAt(0):e.append(3);break;default:t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)?e.append(t-48+4):t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)?e.append(t-65+14):Yr.illegalCharacter(p.getCharAt(t))}return 1}handleEOD(t,e){t.updateSymbolInfo();const r=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount(),n=e.length();t.pos-=n,(t.getRemainingCharacters()>1||r>1||t.getRemainingCharacters()!==r)&&t.writeCodeword(254),t.getNewEncoding()<0&&t.signalEncoderChange(0)}}class zr extends Vr{getEncodingMode(){return 2}encodeChar(t,e){if(t===" ".charCodeAt(0))return e.append(3),1;if(t>="0".charCodeAt(0)&&t<="9".charCodeAt(0))return e.append(t-48+4),1;if(t>="a".charCodeAt(0)&&t<="z".charCodeAt(0))return e.append(t-97+14),1;if(t<" ".charCodeAt(0))return e.append(0),e.append(t),2;if(t<="/".charCodeAt(0))return e.append(1),e.append(t-33),2;if(t<="@".charCodeAt(0))return e.append(1),e.append(t-58+15),2;if(t>="[".charCodeAt(0)&&t<="_".charCodeAt(0))return e.append(1),e.append(t-91+22),2;if(t==="`".charCodeAt(0))return e.append(2),e.append(0),2;if(t<="Z".charCodeAt(0))return e.append(2),e.append(t-65+1),2;if(t<=127)return e.append(2),e.append(t-123+27),2;e.append("1");let r=2;return r+=this.encodeChar(t-128,e),r}}class Yr{static randomize253State(t){const e=129+(149*t%253+1);return e<=254?e:e-254}static encodeHighLevel(t,e=0,r=null,n=null,i=!1){const s=new Vr,o=[new kr,s,new zr,new Wr,new Hr,new xr],a=new Gr(t);a.setSymbolShape(e),a.setSizeConstraints(r,n),t.startsWith(Pr)&&t.endsWith(Fr)?(a.writeCodeword(236),a.setSkipAtEnd(2),a.pos+=7):t.startsWith(Lr)&&t.endsWith(Fr)&&(a.writeCodeword(237),a.setSkipAtEnd(2),a.pos+=7);let h=0;for(i&&(s.encodeMaximal(a),h=a.getNewEncoding(),a.resetEncoderSignal());a.hasMoreCharacters();)o[h].encode(a),a.getNewEncoding()>=0&&(h=a.getNewEncoding(),a.resetEncoderSignal());const l=a.getCodewordCount();a.updateSymbolInfo();const c=a.getSymbolInfo().getDataCapacity();l=t.length)return r;let n;0===r?n=[0,1,1,1,1,1.25]:(n=[1,2,2,2,2,2.25],n[r]=0);let i=0;const s=new Uint8Array(6),o=[];for(;;){if(e+i===t.length){f.fill(s,0),f.fill(o,0);const t=this.findMinimums(n,o,w.MAX_VALUE,s),e=this.getMinimumCount(s);if(o[0]===t)return 0;if(1===e){if(s[5]>0)return 5;if(s[4]>0)return 4;if(s[2]>0)return 2;if(s[3]>0)return 3}return 1}const r=t.charCodeAt(e+i);if(i++,this.isDigit(r)?n[0]+=.5:this.isExtendedASCII(r)?(n[0]=Math.ceil(n[0]),n[0]+=2):(n[0]=Math.ceil(n[0]),n[0]++),this.isNativeC40(r)?n[1]+=2/3:this.isExtendedASCII(r)?n[1]+=8/3:n[1]+=4/3,this.isNativeText(r)?n[2]+=2/3:this.isExtendedASCII(r)?n[2]+=8/3:n[2]+=4/3,this.isNativeX12(r)?n[3]+=2/3:this.isExtendedASCII(r)?n[3]+=13/3:n[3]+=10/3,this.isNativeEDIFACT(r)?n[4]+=3/4:this.isExtendedASCII(r)?n[4]+=4.25:n[4]+=3.25,this.isSpecialB256(r)?n[5]+=4:n[5]++,i>=4){if(f.fill(s,0),f.fill(o,0),this.findMinimums(n,o,w.MAX_VALUE,s),o[0]s&&(r=s,f.fill(n,0)),r===s&&(n[i]=n[i]+1)}return r}static getMinimumCount(t){let e=0;for(let r=0;r<6;r++)e+=t[r];return e||0}static isDigit(t){return t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)}static isExtendedASCII(t){return t>=128&&t<=255}static isNativeC40(t){return t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)}static isNativeText(t){return t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="a".charCodeAt(0)&&t<="z".charCodeAt(0)}static isNativeX12(t){return this.isX12TermSep(t)||t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)}static isX12TermSep(t){return 13===t||t==="*".charCodeAt(0)||t===">".charCodeAt(0)}static isNativeEDIFACT(t){return t>=" ".charCodeAt(0)&&t<="^".charCodeAt(0)}static isSpecialB256(t){return!1}static determineConsecutiveDigitCount(t,e=0){const r=t.length;let n=e;for(;nnew Zr(Rr.forName(t)))),this.encoders=[];const n=[];n.push(new Zr(Nr.ISO_8859_1));let i=null!=e&&e.name.startsWith("UTF");for(let e=0;e=this.bytes.length)return!1;for(let r=0;r=this.length())throw new Error(""+t);if(this.isECI(t))throw new Error("value at "+t+" is not a character but an ECI");return this.isFNC1(t)?this.fnc1:this.bytes[t]}subSequence(t,e){if(t<0||t>e||e>this.length())throw new Error(""+t);const r=new T;for(let n=t;n=this.length())throw new Error(""+t);return this.bytes[t]>255&&this.bytes[t]<=999}isFNC1(t){if(t<0||t>=this.length())throw new Error(""+t);return 1e3===this.bytes[t]}getECIValue(t){if(t<0||t>=this.length())throw new Error(""+t);if(!this.isECI(t))throw new Error("value at "+t+" is not an ECI but a character");return this.bytes[t]-256}addEdge(t,e,r){(null==t[e][r.encoderIndex]||t[e][r.encoderIndex].cachedTotalSize>r.cachedTotalSize)&&(t[e][r.encoderIndex]=r)}addEdges(t,e,r,n,i,s){const o=t.charAt(n).charCodeAt(0);let a=0,h=e.length();e.getPriorityEncoderIndex()>=0&&(o===s||e.canEncode(o,e.getPriorityEncoderIndex()))&&(a=e.getPriorityEncoderIndex(),h=a+1);for(let t=a;t=0;e--)a.unshift(255&t[e])}(null===h.previous?0:h.previous.encoderIndex)!==h.encoderIndex&&a.unshift(256+e.getECIValue(h.encoderIndex)),h=h.previous}const l=[];for(let t=0;t","?","@","[","\\","]","^","_"];class $r{static isExtendedASCII(t,e){return t!==e&&t>=128&&t<=255}static isInC40Shift1Set(t){return t<=31}static isInC40Shift2Set(t,e){for(const e of Jr)if(e.charCodeAt(0)===t)return!0;return t===e}static isInTextShift1Set(t){return this.isInC40Shift1Set(t)}static isInTextShift2Set(t,e){return this.isInC40Shift2Set(t,e)}static encodeHighLevel(t,e=null,r=-1,n=0){let i=0;return t.startsWith(Pr)&&t.endsWith(Fr)?(i=5,t=t.substring(7,t.length-2)):t.startsWith(Lr)&&t.endsWith(Fr)&&(i=6,t=t.substring(7,t.length-2)),decodeURIComponent(escape(String.fromCharCode(...this.encode(t,e,r,n,i))))}static encode(t,e,r,n,i){return this.encodeMinimally(new rn(t,e,r,n,i)).getBytes()}static addEdge(t,e){const r=e.fromPosition+e.characterLength;(null===t[r][e.getEndMode()]||t[r][e.getEndMode()].cachedTotalSize>e.cachedTotalSize)&&(t[r][e.getEndMode()]=e)}static getNumberOfC40Words(t,e,r,n){let i=0;for(let s=e;s=128&&(r&&Yr.isNativeC40(t-128)||!r&&Yr.isNativeText(t-128))?i+=3:i+=4}else i+=2;if(i%3==0||(i-2)%3==0&&s+1===t.length())return n[0]=s-e+1,Math.ceil(i/3)}return n[0]=0,0}static addEdges(t,e,r,n){if(t.isECI(r))return void this.addEdge(e,new en(t,jr.ASCII,r,1,n));const i=t.charAt(r);if(null===n||n.getEndMode()!==jr.EDF){Yr.isDigit(i)&&t.haveNCharacters(r,2)&&Yr.isDigit(t.charAt(r+1))?this.addEdge(e,new en(t,jr.ASCII,r,2,n)):this.addEdge(e,new en(t,jr.ASCII,r,1,n));const s=[jr.C40,jr.TEXT];for(const i of s){const s=[];$r.getNumberOfC40Words(t,r,i===jr.C40,s)>0&&this.addEdge(e,new en(t,i,r,s[0],n))}t.haveNCharacters(r,3)&&Yr.isNativeX12(t.charAt(r))&&Yr.isNativeX12(t.charAt(r+1))&&Yr.isNativeX12(t.charAt(r+2))&&this.addEdge(e,new en(t,jr.X12,r,3,n)),this.addEdge(e,new en(t,jr.B256,r,1,n))}let s;for(s=0;s<3;s++){const i=r+s;if(!t.haveNCharacters(i,1)||!Yr.isNativeEDIFACT(t.charAt(i)))break;this.addEdge(e,new en(t,jr.EDF,r,s+1,n))}3===s&&t.haveNCharacters(r,4)&&Yr.isNativeEDIFACT(t.charAt(r+3))&&this.addEdge(e,new en(t,jr.EDF,r,4,n))}static encodeMinimally(t){const e=t.length(),r=Array(e+1).fill(null).map((()=>Array(6).fill(0)));this.addEdges(t,r,0,null);for(let n=1;n<=e;n++){for(let i=0;i<6;i++)null!==r[n][i]&&n=1&&t<=3?s.cachedTotalSize+1:s.cachedTotalSize;o0&&(r+=this.prepend(en.getBytes(232),n));for(let t=0;t=0;r--)e.unshift(t[r]);return t.length}randomize253State(t){const e=129+(149*t%253+1);return e<=254?e:e-254}applyRandomPattern(t,e,r){for(let n=0;n0&&this.getCodewordsRemaining(this.cachedTotalSize+t)<=2-t)return jr.ASCII}if(this.mode===jr.C40||this.mode===jr.TEXT||this.mode===jr.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&0===this.getCodewordsRemaining(this.cachedTotalSize))return jr.ASCII;if(1===this.getLastASCII()&&0===this.getCodewordsRemaining(this.cachedTotalSize+1))return jr.ASCII}return this.mode}getMode(){return this.mode}getLastASCII(){const t=this.input.length(),e=this.fromPosition+this.characterLength;return t-e>4||e>=t?0:t-e==1?$r.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?0:1:t-e==2?$r.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())||$r.isExtendedASCII(this.input.charAt(e+1),this.input.getFNC1Character())?0:Yr.isDigit(this.input.charAt(e))&&Yr.isDigit(this.input.charAt(e+1))?1:2:t-e==3?Yr.isDigit(this.input.charAt(e))&&Yr.isDigit(this.input.charAt(e+1))&&!$r.isExtendedASCII(this.input.charAt(e+2),this.input.getFNC1Character())||Yr.isDigit(this.input.charAt(e+1))&&Yr.isDigit(this.input.charAt(e+2))&&!$r.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?2:0:Yr.isDigit(this.input.charAt(e))&&Yr.isDigit(this.input.charAt(e+1))&&Yr.isDigit(this.input.charAt(e+2))&&Yr.isDigit(this.input.charAt(e+3))?2:0}getMinSymbolSize(t){switch(this.input.getShapeHint()){case 1:for(const e of this.squareCodewordCapacities)if(e>=t)return e;break;case 2:for(const e of this.rectangularCodewordCapacities)if(e>=t)return e}for(const e of this.allCodewordCapacities)if(e>=t)return e;return this.allCodewordCapacities[this.allCodewordCapacities.length-1]}getCodewordsRemaining(t){return this.getMinSymbolSize(t)-t}static getBytes(t,e){const r=new Uint8Array(e?2:1);return r[0]=t,e&&(r[1]=e),r}setC40Word(t,e,r,n,i){const s=1600*(255&r)+40*(255&n)+(255&i)+1;t[e]=s/256,t[e+1]=s%256}getX12Value(t){return 13===t?0:42===t?1:62===t?2:32===t?3:t>=48&&t<=57?t-44:t>=65&&t<=90?t-51:t}getX12Words(){if(this.characterLength%3!=0)throw new Error("X12 words must be a multiple of 3");const t=new Uint8Array(this.characterLength/3*2);for(let e=0;e=33&&r<=47?r-33:r>=48&&r<=57?r-44:r>=58&&r<=64?r-43:r>=65&&r<=90?r-64:r>=91&&r<=95?r-69:96===r?0:r>=97&&r<=122?r-83:r>=123&&r<=127?r-96:r}getC40Words(t,e){const r=[];for(let n=0;n>16&255,e[i+1]=s>>8&255,e[i+2]=255&s}return e}getLatchBytes(){switch(this.getPreviousMode()){case jr.ASCII:case jr.B256:switch(this.mode){case jr.B256:return en.getBytes(231);case jr.C40:return en.getBytes(230);case jr.TEXT:return en.getBytes(239);case jr.X12:return en.getBytes(238);case jr.EDF:return en.getBytes(240)}break;case jr.C40:case jr.TEXT:case jr.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case jr.ASCII:return en.getBytes(254);case jr.B256:return en.getBytes(254,231);case jr.C40:return en.getBytes(254,230);case jr.TEXT:return en.getBytes(254,239);case jr.X12:return en.getBytes(254,238);case jr.EDF:return en.getBytes(254,240)}break;case jr.EDF:if(this.mode!==jr.EDF)throw new Error("Cannot switch from EDF to "+this.mode)}return new Uint8Array(0)}getDataBytes(){switch(this.mode){case jr.ASCII:return this.input.isECI(this.fromPosition)?en.getBytes(241,this.input.getECIValue(this.fromPosition)+1):$r.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?en.getBytes(235,this.input.charAt(this.fromPosition)-127):2===this.characterLength?en.getBytes(10*this.input.charAt(this.fromPosition)+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?en.getBytes(232):en.getBytes(this.input.charAt(this.fromPosition)+1);case jr.B256:return en.getBytes(this.input.charAt(this.fromPosition));case jr.C40:return this.getC40Words(!0,this.input.getFNC1Character());case jr.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case jr.X12:return this.getX12Words();case jr.EDF:return this.getEDFBytes()}}}class rn extends qr{constructor(t,e,r,n,i){super(t,e,r),this.shape=n,this.macroId=i}getMacroId(){return this.macroId}getShapeHint(){return this.shape}}class nn{isCompact(){return this.compact}setCompact(t){this.compact=t}getSize(){return this.size}setSize(t){this.size=t}getLayers(){return this.layers}setLayers(t){this.layers=t}getCodeWords(){return this.codeWords}setCodeWords(t){this.codeWords=t}getMatrix(){return this.matrix}setMatrix(t){this.matrix=t}}class sn{static singletonList(t){return[t]}static min(t,e){return t.sort(e)[0]}}class on{constructor(t){this.previous=t}getPrevious(){return this.previous}}class an extends on{constructor(t,e,r){super(t),this.value=e,this.bitCount=r}appendTo(t,e){t.appendBits(this.value,this.bitCount)}add(t,e){return new an(this,t,e)}addBinaryShift(t,e){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new an(this,t,e)}toString(){let t=this.value&(1<"}}class hn extends an{constructor(t,e,r){super(t,0,0),this.binaryShiftStart=e,this.binaryShiftByteCount=r}appendTo(t,e){for(let r=0;r62?t.appendBits(this.binaryShiftByteCount-31,16):0===r?t.appendBits(Math.min(this.binaryShiftByteCount,31),5):t.appendBits(this.binaryShiftByteCount-31,5)),t.appendBits(e[this.binaryShiftStart+r],8)}addBinaryShift(t,e){return new hn(this,t,e)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function ln(t,e,r){return new an(t,e,r)}const cn=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],dn=new an(null,0,0),un=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])];const gn=function(t){for(let e of t)f.fill(e,-1);return t[0][4]=0,t[1][4]=0,t[1][0]=28,t[3][4]=0,t[2][4]=0,t[2][0]=15,t}(f.createInt32Array(6,6));class fn{constructor(t,e,r,n){this.token=t,this.mode=e,this.binaryShiftByteCount=r,this.bitCount=n}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(t,e){let r=this.bitCount,n=this.token;if(t!==this.mode){let e=un[this.mode][t];n=ln(n,65535&e,e>>16),r+=e>>16}let i=2===t?4:5;return n=ln(n,e,i),new fn(n,t,0,r+i)}shiftAndAppend(t,e){let r=this.token,n=2===this.mode?4:5;return r=ln(r,gn[this.mode][t],n),r=ln(r,e,5),new fn(r,this.mode,0,this.bitCount+n+5)}addBinaryShiftChar(t){let e=this.token,r=this.mode,n=this.bitCount;if(4===this.mode||2===this.mode){let t=un[r][0];e=ln(e,65535&t,t>>16),n+=t>>16,r=0}let i=0===this.binaryShiftByteCount||31===this.binaryShiftByteCount?18:62===this.binaryShiftByteCount?9:8,s=new fn(e,r,this.binaryShiftByteCount+1,n+i);return 2078===s.binaryShiftByteCount&&(s=s.endBinaryShift(t+1)),s}endBinaryShift(t){if(0===this.binaryShiftByteCount)return this;let e=this.token;return e=function(t,e,r){return new hn(t,e,r)}(e,t-this.binaryShiftByteCount,this.binaryShiftByteCount),new fn(e,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(t){let e=this.bitCount+(un[this.mode][t.mode]>>16);return this.binaryShiftByteCountt.binaryShiftByteCount&&t.binaryShiftByteCount>0&&(e+=10),e<=t.bitCount}toBitArray(t){let e=[];for(let r=this.endBinaryShift(t.length).token;null!==r;r=r.getPrevious())e.unshift(r);let r=new C;for(const n of e)n.appendTo(r,t);return r}toString(){return p.format("%s bits=%d bytes=%d",cn[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(t){return t.binaryShiftByteCount>62?21:t.binaryShiftByteCount>31?20:t.binaryShiftByteCount>0?10:0}}fn.INITIAL_STATE=new fn(dn,0,0,0);const wn=function(t){const e=p.getCharCode(" "),r=p.getCharCode("."),n=p.getCharCode(",");t[0][e]=1;const i=p.getCharCode("Z"),s=p.getCharCode("A");for(let e=s;e<=i;e++)t[0][e]=e-s+2;t[1][e]=1;const o=p.getCharCode("z"),a=p.getCharCode("a");for(let e=a;e<=o;e++)t[1][e]=e-a+2;t[2][e]=1;const h=p.getCharCode("9"),l=p.getCharCode("0");for(let e=l;e<=h;e++)t[2][e]=e-l+2;t[2][n]=12,t[2][r]=13;const c=["\0"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~",""];for(let e=0;e","?","[","]","{","}"];for(let e=0;e0&&(t[4][p.getCharCode(d[e])]=e);return t}(f.createInt32Array(5,256));class Cn{constructor(t){this.text=t}encode(){const t=p.getCharCode(" "),e=p.getCharCode("\n");let r=sn.singletonList(fn.INITIAL_STATE);for(let n=0;n0?(r=Cn.updateStateListForPair(r,n,i),n++):r=this.updateStateListForChar(r,n)}return sn.min(r,((t,e)=>t.getBitCount()-e.getBitCount())).toBitArray(this.text)}updateStateListForChar(t,e){const r=[];for(let n of t)this.updateStateForChar(n,e,r);return Cn.simplifyStates(r)}updateStateForChar(t,e,r){let n=255&this.text[e],i=wn[t.getMode()][n]>0,s=null;for(let o=0;o<=4;o++){let a=wn[o][n];if(a>0){if(null==s&&(s=t.endBinaryShift(e)),!i||o===t.getMode()||2===o){const t=s.latchAndAppend(o,a);r.push(t)}if(!i&&gn[t.getMode()][o]>=0){const t=s.shiftAndAppend(o,a);r.push(t)}}}if(t.getBinaryShiftByteCount()>0||0===wn[t.getMode()][n]){let n=t.addBinaryShiftChar(e);r.push(n)}}static updateStateListForPair(t,e,r){const n=[];for(let i of t)this.updateStateForPair(i,e,r,n);return this.simplifyStates(n)}static updateStateForPair(t,e,r,n){let i=t.endBinaryShift(e);if(n.push(i.latchAndAppend(4,r)),4!==t.getMode()&&n.push(i.shiftAndAppend(4,r)),3===r||4===r){let t=i.latchAndAppend(2,16-r).latchAndAppend(2,1);n.push(t)}if(t.getBinaryShiftByteCount()>0){let r=t.addBinaryShiftChar(e).addBinaryShiftChar(e+1);n.push(r)}}static simplifyStates(t){let e=[];for(const r of t){let t=!0;for(const n of e){if(n.isBetterThanOrEqualTo(r)){t=!1;break}r.isBetterThanOrEqualTo(n)&&(e=e.filter((t=>t!==n)))}t&&e.push(r)}return e}}class An{constructor(){}static encodeBytes(t){return An.encode(t,An.DEFAULT_EC_PERCENT,An.DEFAULT_AZTEC_LAYERS)}static encode(t,e,r){let n,i,s,o,h,l=new Cn(t).encode(),c=w.truncDivision(l.getSize()*e,100)+11,d=l.getSize()+c;if(r!==An.DEFAULT_AZTEC_LAYERS){if(n=r<0,i=Math.abs(r),i>(n?An.MAX_NB_BITS_COMPACT:An.MAX_NB_BITS))throw new a(p.format("Illegal value %s for layers",r));s=An.totalBitsInLayer(i,n),o=An.WORD_SIZE[i];let t=s-s%o;if(h=An.stuffBits(l,o),h.getSize()+c>t)throw new a("Data to large for user specified layer");if(n&&h.getSize()>64*o)throw new a("Data to large for user specified layer")}else{o=0,h=null;for(let t=0;;t++){if(t>An.MAX_NB_BITS)throw new a("Data too large for an Aztec code");if(n=t<=3,i=n?t+1:t,s=An.totalBitsInLayer(i,n),d>s)continue;null!=h&&o===An.WORD_SIZE[i]||(o=An.WORD_SIZE[i],h=An.stuffBits(l,o));let e=s-s%o;if(!(n&&h.getSize()>64*o)&&h.getSize()+c<=e)break}}let u,g=An.generateCheckWords(h,s,o),f=h.getSize()/o,C=An.generateModeMessage(n,i,f),A=(n?11:14)+4*i,E=new Int32Array(A);if(n){u=A;for(let t=0;t=n||t.get(s+r))&&(o|=1<
- + {% if form.currency.errors %}
{{ form.currency.errors }} diff --git a/templates/crm/opportunities/opportunity_detail.html b/templates/crm/opportunities/opportunity_detail.html index df86c495..36aa4634 100644 --- a/templates/crm/opportunities/opportunity_detail.html +++ b/templates/crm/opportunities/opportunity_detail.html @@ -39,7 +39,7 @@

{{ opportunity.customer.customer_name }}

{% if opportunity.car.finances %} -
{{ opportunity.car.finances.total }} {{ _("SAR") }}
+
{{ opportunity.car.finances.total }} {{ CURRENCY }}
{% endif %}
diff --git a/templates/customers/view_customer.html b/templates/customers/view_customer.html index f6b8d5c8..d0efc710 100644 --- a/templates/customers/view_customer.html +++ b/templates/customers/view_customer.html @@ -125,7 +125,7 @@

{{ _("Quotation") }}-{{ estimate.estimate_number }}

- {{ estimate.revenue_estimate|currency_format }} + {{ estimate.revenue_estimate|currency_format }} {{ CURRENCY }} @@ -147,7 +147,7 @@

{{ _("Invoice") }}-{{ invoice.invoice_number }}

- {{ invoice.amount_paid|currency_format }} + {{ invoice.amount_paid|currency_format }} {{ CURRENCY }} {% if invoice.is_paid %} diff --git a/templates/dashboards/manager.html b/templates/dashboards/manager.html index eef22582..c0982251 100644 --- a/templates/dashboards/manager.html +++ b/templates/dashboards/manager.html @@ -2,14 +2,15 @@ {% load i18n static custom_filters django_ledger%} {% block content %} - -
-
-
+

- {{ dealer.get_local_name }} -

-
+ {{ dealer.get_local_name }} + +

+ {{ _("As of")}}{% now "SHORT_DATETIME_FORMAT" %} +

+
+

{{ staff }}

@@ -17,7 +18,7 @@
-

{{ total_leads }}

+

{{ total_leads }}

{{ _("Leads")}}

@@ -30,7 +31,67 @@

{{ invoices }}

{{ _("Invoices")}}

+
+ +

{{ estimates }}

+

{{ _("Quotations")}}

+
+
+ +

{{ purchase_orders }}

+

{{ _("Purchase Orders")}}

+
+
+
+
+
+

{% trans 'inventory'|upper %}

+
+
+
+

{{ total_cars }} {{ _("Car") }}

+
+
+
+
+

{% trans 'inventory value'|upper %}

+
+
+ +
+

+

+
+
+
+

{{ total_selling_price|currency_format }} {{ CURRENCY }}

+
+
+
+
+

{% trans "Profits"|upper %}

+
+
+ +
+

+

+
+
+
+

{{ total_profit|currency_format }} {{ CURRENCY }}

+
+
+
+ +
+
+ +
+
+
+
@@ -78,194 +139,18 @@
-
-
-

-
+
+
-
-
-
-

{{ _("New Leads and Customers")}}

-

{{ _("Payment received across all channels")}}

-
-
-
-
-

{{ _("New Customers")}} : - 42 -

- - +24.5% - - -
-
-
-
-
-
-
-

{{ _("New Leads")}} : 45

- - +30.5% - - -
-
-
-
-
-
-
- -
-
-
- -
-
-
-
-

{% trans 'inventory'|upper %}

-
-
-
-

{{ total_cars }}

- {{ _("As of")}}{% now "SHORT_DATETIME_FORMAT" %} -
-
-
-
-

{% trans 'inventory value'|upper %}

-
-
- -
-

-

-
-
-
-

{{ total_selling_price|currency_format }} {{ CURRENCY }}

-
-
-
-
-

{% trans "Profits"|upper %}

-
-
- -
-

-

-
-
-
-

{{ total_profit|currency_format }} {{ CURRENCY }}

-
-
-
-
-
{{ _("Canceled Invoices")}}
-
-
-
-

120.00

- 5.76% - {{ _("From last month")}} -
-
-
-
-
-
-
-
-
-
-

{{ _("Gross Profit")}}

-

Annual income according to the board

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Flight
-
$162,791,400
-
-
-
- -

15.50%

-
-
-
-
-
-
-
-
Flight (Package)
-
$135,659,500
-
-
-
- -

11.09%

-
-
-
-
-
-
-
-
Hotel
-
$271,319,000
-
-
-
- -

29.98%

-
-
-
-
-
-
-
-
Hotel (Package)
-
$162,791,400
-
-
-
- -

03.90%

-
-
-
-
-
-
-
-
-
-
+ +
@@ -274,9 +159,7 @@ document.addEventListener("DOMContentLoaded", function () { /* Car Chart By Make */ - const getColor = (name, dom = document.documentElement) => { - return getComputedStyle(dom).getPropertyValue(`--phoenix-${name}`).trim(); - }; + const { getColor, rgbaColor } = window.phoenix.utils; const handleTooltipPosition = ([pos, , dom, , size]) => { // only for mobile device if (window.innerWidth <= 540) { @@ -348,9 +231,7 @@ document.addEventListener("DOMContentLoaded", function () { car_chart.setOption(option); /* Car Status Chart */ - const chartElContainer = document.querySelector('.echart-cars-by-status-container'); const car_status = echarts.init(document.getElementById('echart-cars-by-status')); - const chartLabel = chartElContainer.querySelector('[data-label]'); const data = [ {value: {{available_cars}}, name: '{{ _("Available") }}'}, {value: {{sold_cars}}, name: '{{ _("Sold")}}'}, @@ -359,24 +240,21 @@ document.addEventListener("DOMContentLoaded", function () { {value: {{hold_cars}}, name: '{{ _("Hold") }}'}, {value: {{damaged_cars}}, name: '{{ _("Damaged") }}'} ]; - const totalCars = data.reduce((acc, val) => val.value + acc, 0); - if (chartLabel) { - chartLabel.innerHTML = totalCars; - } + option = { color: [ - getColor('success'), - getColor('warning'), - getColor('danger'), - getColor('primary'), - getColor('warning-lighter'), - getColor('secondary-dark') + rgbaColor(getColor('success'),0.7), + rgbaColor(getColor('warning'),0.7), + rgbaColor(getColor('danger'),0.7), + rgbaColor(getColor('primary'),0.7), + rgbaColor(getColor('warning-light'),0.7), + rgbaColor(getColor('secondary-light'),0.7), ], tooltip: { trigger: 'item', padding: [7, 10], backgroundColor: getColor('body-highlight-bg'), - borderColor: getColor('border-color'), + borderColor: getColor('body-bg'), textStyle: {color: getColor('light-text-emphasis')}, borderWidth: 1, transitionDuration: 0, diff --git a/templates/dashboards/sales.html b/templates/dashboards/sales.html index ffddf5b9..e0c26d51 100644 --- a/templates/dashboards/sales.html +++ b/templates/dashboards/sales.html @@ -132,7 +132,7 @@
-

{{ total_selling_price|currency_format }} {{ CURRENCY }}

+

{{ total_selling_price|currency_format }} {{ CURRENCY }}

@@ -147,7 +147,7 @@
-

{{ total_profit|currency_format }} {{ CURRENCY }}

+

{{ total_profit|currency_format }} {{ CURRENCY }}

diff --git a/templates/dealers/assign_car_makes.html b/templates/dealers/assign_car_makes.html new file mode 100644 index 00000000..6810bcc5 --- /dev/null +++ b/templates/dealers/assign_car_makes.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} +{% load crispy_forms_filters %} + +{% block content %} + +

{{ _("Select Car Makes You Sell")}}

+ +
+ {% csrf_token %} +
+ {{ form.car_makes }} +
+ +
+{% endblock %} \ No newline at end of file diff --git a/templates/dealers/dealer_detail.html b/templates/dealers/dealer_detail.html index 2463d725..8dc930b0 100644 --- a/templates/dealers/dealer_detail.html +++ b/templates/dealers/dealer_detail.html @@ -44,10 +44,7 @@
{% trans 'last login'|capfirst %}

{{ dealer.user.last_login|date:"D M d, Y H:i" }}

-
-
{% trans 'Total users'|capfirst %}
-

{{ dealer.staff_count }} / {{ allowed_users }}

-
+ @@ -104,7 +101,7 @@

{% trans 'Active until' %}: {{ dealer.user.userplan.expire}}

-

{{ dealer.user.userplan.plan.planpricing_set.first.price }} {{ CURRENCY }}

+

{{ dealer.user.userplan.plan.planpricing_set.first.price }} {{ CURRENCY }}

{{ _("Per month")}}
@@ -131,12 +128,42 @@
-
+
-
-
-
+
+
+
+ +
{% trans 'Total users'|capfirst %}
+

{{ dealer.staff_count }} / {{ allowed_users }}

+
+ +
{% trans 'Total cars'|capfirst %}
+

{{ cars_count }} / {{ allowed_cars }}

+
+
+
+
+
+
+
+
+
+
+
+
+ {% for make in car_makes %} +
+ {% if make.logo %} + {{ make.get_local_name }} +{% endif %} +

{{ make.get_local_name }}

+
+ {% endfor %} +
+
+
diff --git a/templates/footer.html b/templates/footer.html index 45e4417a..13328aa5 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -1,11 +1,17 @@ -{% load i18n %} -