@ashtuka/react-lib 1.0.40 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -2
- package/dist/chunks/LoadAbleImg-jaQDlIaY.mjs +75 -0
- package/dist/chunks/Service-uGKXRZVE.mjs +47 -0
- package/dist/chunks/breakpoints-BOwHOeQN.mjs +8 -0
- package/dist/chunks/file-C_N83pgK.mjs +5 -0
- package/dist/chunks/index-BDjvzGbZ.mjs +44 -0
- package/dist/chunks/spinner-By2573Fq.mjs +10 -0
- package/dist/components/LoadAbleImg/LoadAbleImg.d.ts +1 -1
- package/dist/constants/breakpoints.d.ts +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.es.js +7 -3
- package/dist/hooks/useBreakPoint-C-91njOc.mjs +13 -0
- package/dist/hooks/useBreakPoint.d.ts +24 -0
- package/dist/hooks/useOutsideClick-DPN2gHf5.mjs +15 -0
- package/dist/hooks/useOutsideClick.d.ts +22 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.es.js +18 -4
- package/dist/modules/AuthModule/AuthModule-wq1Xt6Op.mjs +1001 -0
- package/dist/modules/AuthModule/AuthModule.css +1 -0
- package/dist/modules/AuthModule/AuthModule.d.ts +3 -0
- package/dist/modules/AuthModule/AuthModule.types.d.ts +82 -0
- package/dist/modules/AuthModule/ButtonSpinner/ButtonSpinner.d.ts +2 -0
- package/dist/modules/AuthModule/EmailSent/EmailSent.d.ts +9 -0
- package/dist/modules/AuthModule/ErrorMessage/ErrorMessage.d.ts +11 -0
- package/dist/modules/AuthModule/InputItem/InputItem.d.ts +16 -0
- package/dist/modules/AuthModule/InputItem/PhoneInput.d.ts +13 -0
- package/dist/modules/AuthModule/LoginForm/LoginForm.d.ts +12 -0
- package/dist/modules/AuthModule/OtpInputItem/OtpInputItem.d.ts +17 -0
- package/dist/modules/AuthModule/PasswordRestoreForm/PasswordRestoreForm.d.ts +12 -0
- package/dist/modules/AuthModule/PrivacyPolicy/PrivacyPolicy.d.ts +6 -0
- package/dist/modules/AuthModule/RegistrationForm/RegistrationForm.d.ts +7 -0
- package/dist/modules/AuthModule/SocialBlock/SocialBlock.d.ts +10 -0
- package/dist/modules/AuthModule/Tabs/Tabs.d.ts +10 -0
- package/dist/modules/AuthModule/index.d.ts +2 -0
- package/dist/modules/AuthModule/index.es.js +4 -0
- package/dist/modules/AuthModule/localization.d.ts +96 -0
- package/dist/modules/AuthModule/translation.d.ts +98 -0
- package/dist/modules/AuthModule/utils/formValueCheck.d.ts +3 -0
- package/dist/modules/AuthModule/utils/getErrorDescriptionKey.d.ts +3 -0
- package/dist/modules/AuthModule/utils/getFormData.d.ts +4 -0
- package/dist/modules/AuthModule/utils/getProductDataExtraVarValue.d.ts +3 -0
- package/dist/modules/AuthModule/utils/getRegexPattern.d.ts +3 -0
- package/dist/modules/AuthModule/utils/handleKeyDown.d.ts +3 -0
- package/dist/modules/AuthModule/utils/inputClearError.d.ts +4 -0
- package/dist/modules/AuthModule/utils/inputValueCheck.d.ts +4 -0
- package/dist/modules/AuthModule/utils/isAppleDevice.d.ts +2 -0
- package/dist/modules/AuthModule/utils/isFormHasError.d.ts +3 -0
- package/dist/modules/AuthModule/utils/parseRequestError.d.ts +7 -0
- package/dist/modules/AuthModule/utils/phoneMaskHandler.d.ts +2 -0
- package/dist/modules/CrumbsModule/Crumb/Crumb.d.ts +8 -0
- package/dist/modules/CrumbsModule/Crumb/index.d.ts +1 -0
- package/dist/modules/CrumbsModule/CrumbsModule-BQIxJcqN.mjs +79 -0
- package/dist/modules/CrumbsModule/CrumbsModule.css +1 -0
- package/dist/modules/CrumbsModule/CrumbsModule.d.ts +2 -0
- package/dist/modules/CrumbsModule/CrumbsModule.types.d.ts +8 -0
- package/dist/modules/CrumbsModule/HiddenCrumbs/HiddenCrumbs.d.ts +6 -0
- package/dist/modules/CrumbsModule/HiddenCrumbs/index.d.ts +1 -0
- package/dist/modules/CrumbsModule/index.d.ts +2 -0
- package/dist/modules/CrumbsModule/index.es.js +4 -0
- package/dist/modules/DiyaModule/DesktopContent.d.ts +6 -0
- package/dist/modules/DiyaModule/DesktopTitle.d.ts +6 -0
- package/dist/modules/DiyaModule/DiyaLink.d.ts +7 -0
- package/dist/modules/DiyaModule/DiyaModule-CR7O-AA3.mjs +2159 -0
- package/dist/modules/DiyaModule/DiyaModule.css +1 -0
- package/dist/modules/DiyaModule/DiyaModule.d.ts +3 -0
- package/dist/modules/DiyaModule/DiyaModule.types.d.ts +16 -0
- package/dist/modules/DiyaModule/DownloadDiya.d.ts +6 -0
- package/dist/modules/DiyaModule/Loader.d.ts +6 -0
- package/dist/modules/DiyaModule/Qr.d.ts +8 -0
- package/dist/modules/DiyaModule/TimeOver.d.ts +6 -0
- package/dist/modules/DiyaModule/Timer.d.ts +8 -0
- package/dist/modules/DiyaModule/UpdateBtn.d.ts +7 -0
- package/dist/modules/DiyaModule/index.d.ts +2 -0
- package/dist/modules/DiyaModule/index.es.js +4 -0
- package/dist/modules/DiyaModule/utils/isMobDevice.d.ts +1 -0
- package/dist/modules/ErrorPaymentModule/ErrorPaymentModule-CyboRcvA.mjs +58 -0
- package/dist/modules/ErrorPaymentModule/ErrorPaymentModule.css +1 -0
- package/dist/modules/ErrorPaymentModule/ErrorPaymentModule.d.ts +3 -0
- package/dist/modules/ErrorPaymentModule/ErrorPaymentModule.types.d.ts +26 -0
- package/dist/modules/ErrorPaymentModule/Header/Header.d.ts +6 -0
- package/dist/modules/ErrorPaymentModule/Header/index.d.ts +2 -0
- package/dist/modules/ErrorPaymentModule/Nav/Nav.d.ts +6 -0
- package/dist/modules/ErrorPaymentModule/Nav/index.d.ts +2 -0
- package/dist/modules/ErrorPaymentModule/Picture/Picture.d.ts +5 -0
- package/dist/modules/ErrorPaymentModule/Picture/index.d.ts +2 -0
- package/dist/modules/ErrorPaymentModule/index.d.ts +2 -0
- package/dist/modules/ErrorPaymentModule/index.es.js +4 -0
- package/dist/modules/FooterV2Module/FooterV2Module-Bk6XRHqm.mjs +279 -0
- package/dist/modules/FooterV2Module/FooterV2Module.css +1 -1
- package/dist/modules/FooterV2Module/index.es.js +1 -1
- package/dist/modules/FooterV2Module/utils/index.d.ts +0 -1
- package/dist/modules/HeaderV5Module/Auth/Auth.d.ts +19 -0
- package/dist/modules/HeaderV5Module/Banner/Banner.d.ts +8 -0
- package/dist/modules/HeaderV5Module/HeaderV5Module-B9tK4bOZ.mjs +576 -0
- package/dist/modules/HeaderV5Module/HeaderV5Module.css +1 -0
- package/dist/modules/HeaderV5Module/HeaderV5Module.d.ts +2 -0
- package/dist/modules/HeaderV5Module/HeaderV5Module.types.d.ts +74 -0
- package/dist/modules/HeaderV5Module/Lang/Lang.d.ts +7 -0
- package/dist/modules/HeaderV5Module/Logo/Logo.d.ts +7 -0
- package/dist/modules/HeaderV5Module/Menu/Menu.d.ts +13 -0
- package/dist/modules/HeaderV5Module/Menu/MenuItemList/MenuItemList.d.ts +7 -0
- package/dist/modules/HeaderV5Module/Menu/MenuItemList/index.d.ts +2 -0
- package/dist/modules/HeaderV5Module/Menu/Tabs/Tabs.d.ts +20 -0
- package/dist/modules/HeaderV5Module/MenuBtn/MenuBtn.d.ts +10 -0
- package/dist/modules/HeaderV5Module/Phone/Phone.d.ts +1 -0
- package/dist/modules/HeaderV5Module/index.d.ts +2 -0
- package/dist/modules/HeaderV5Module/index.es.js +4 -0
- package/dist/modules/HeaderV5Module/useHeader.d.ts +10 -0
- package/dist/modules/HeaderV5Module/utils/bodyScrollHandler.d.ts +2 -0
- package/dist/modules/HeaderV5Module/utils/getParamFromCookie.d.ts +2 -0
- package/dist/modules/HeaderV5Module/utils/setCookieLocale.d.ts +3 -0
- package/dist/modules/HeaderV5Module/utils/setCookieParam.d.ts +2 -0
- package/dist/modules/LoadAbleImg/LoadAbleImg.css +1 -0
- package/dist/modules/OtpModule/ConditionsBlock/ConditionsBlock.d.ts +11 -0
- package/dist/modules/OtpModule/ConditionsBlock/index.d.ts +1 -0
- package/dist/modules/OtpModule/Item/Item.d.ts +11 -0
- package/dist/modules/OtpModule/Item/index.d.ts +1 -0
- package/dist/modules/OtpModule/Navigation/Navigation.d.ts +9 -0
- package/dist/modules/OtpModule/Navigation/index.d.ts +1 -0
- package/dist/modules/OtpModule/NotConfirmPopup/NotConfirmPopup.d.ts +9 -0
- package/dist/modules/OtpModule/NotConfirmPopup/index.d.ts +1 -0
- package/dist/modules/OtpModule/OtpModule-C_J1fNer.mjs +394 -0
- package/dist/modules/OtpModule/OtpModule.css +1 -0
- package/dist/modules/OtpModule/OtpModule.d.ts +2 -0
- package/dist/modules/OtpModule/OtpModule.types.d.ts +56 -0
- package/dist/modules/OtpModule/OtpPopup/OtpPopup.d.ts +9 -0
- package/dist/modules/OtpModule/OtpPopup/index.d.ts +1 -0
- package/dist/modules/OtpModule/index.d.ts +2 -0
- package/dist/modules/OtpModule/index.es.js +4 -0
- package/dist/modules/OtpModule/localization.d.ts +33 -0
- package/dist/modules/OtpModule/utils/setOtpStyleConfig.d.ts +3 -0
- package/dist/modules/PageLoaderModule/PageLoaderModule-qw6Twqhc.mjs +61 -0
- package/dist/modules/PageLoaderModule/index.es.js +1 -1
- package/dist/modules/SuccessPaymentModule/Header/Header.d.ts +6 -0
- package/dist/modules/SuccessPaymentModule/Header/index.d.ts +2 -0
- package/dist/modules/SuccessPaymentModule/InfoList/InfoList.d.ts +8 -0
- package/dist/modules/SuccessPaymentModule/InfoList/index.d.ts +2 -0
- package/dist/modules/SuccessPaymentModule/Nav/Nav.d.ts +6 -0
- package/dist/modules/SuccessPaymentModule/Nav/index.d.ts +2 -0
- package/dist/modules/SuccessPaymentModule/Picture/Picture.d.ts +5 -0
- package/dist/modules/SuccessPaymentModule/Picture/index.d.ts +2 -0
- package/dist/modules/SuccessPaymentModule/Referral/Referral.d.ts +6 -0
- package/dist/modules/SuccessPaymentModule/Referral/index.d.ts +2 -0
- package/dist/modules/SuccessPaymentModule/Referral/localization.d.ts +7 -0
- package/dist/modules/SuccessPaymentModule/SuccessPaymentModule-BizFQek6.mjs +126 -0
- package/dist/modules/SuccessPaymentModule/SuccessPaymentModule.css +1 -0
- package/dist/modules/SuccessPaymentModule/SuccessPaymentModule.d.ts +2 -0
- package/dist/modules/SuccessPaymentModule/SuccessPaymentModule.types.d.ts +36 -0
- package/dist/modules/SuccessPaymentModule/index.d.ts +2 -0
- package/dist/modules/SuccessPaymentModule/index.es.js +4 -0
- package/dist/services/AuthService.d.ts +16 -0
- package/dist/services/DesignerService.d.ts +7 -0
- package/dist/services/LayoutService.d.ts +1 -1
- package/dist/services/StrapiService.d.ts +7 -0
- package/dist/services/utils/getStrapiHost.d.ts +2 -0
- package/dist/types/Designer.d.ts +28 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/utils/getAbsUrl-C3tTvhge.mjs +9 -0
- package/dist/utils/getAbsUrl.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.es.js +4 -2
- package/package.json +14 -2
- package/dist/modules/FooterV2Module/FooterV2Module-Cd4z2v8y.mjs +0 -387
- package/dist/modules/FooterV2Module/utils/getAbsUrl.d.ts +0 -3
- package/dist/modules/PageLoaderModule/PageLoaderModule-D6yGXr6Z.mjs +0 -100
- package/dist/types/Header.d.ts +0 -34
|
@@ -0,0 +1,2159 @@
|
|
|
1
|
+
import { jsxs as z, jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import * as oe from "react";
|
|
3
|
+
import j, { cloneElement as Ve, Component as qe, createElement as De, useState as pe, useEffect as ge } from "react";
|
|
4
|
+
import { c as We } from "../../chunks/index-BDjvzGbZ.mjs";
|
|
5
|
+
import { L as X } from "../../types/Locale-D0KYJGGt.mjs";
|
|
6
|
+
import ee from "react-localization";
|
|
7
|
+
import { S as vt } from "../../chunks/spinner-By2573Fq.mjs";
|
|
8
|
+
const K = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), yt = "_diya_5iyk8_1", gt = "_logo_5iyk8_21", Et = "_titleBlock_5iyk8_32", Tt = "_loaderBlock_5iyk8_49", Ct = "_loaderTitle_5iyk8_58", wt = "_loaderSpinner_5iyk8_72", bt = "_spinner_5iyk8_77", St = "_content_5iyk8_86", _t = "_column_5iyk8_97", Pt = "_columnMob_5iyk8_106", Mt = "_qrBlock_5iyk8_110", Rt = "_qr_5iyk8_110", Ot = "_qrTitle_5iyk8_128", At = "_btn_5iyk8_136", kt = "_mob_5iyk8_151", It = "_timerBlock_5iyk8_168", Dt = "_timer_5iyk8_168", Lt = "_timerTitle_5iyk8_196", xt = "_textBlock_5iyk8_209", Nt = "_list_5iyk8_216", Bt = "_phone_5iyk8_228", $t = "_linkBlock_5iyk8_234", Ut = "_linkText_5iyk8_243", Ft = "_timeOverBlock_5iyk8_249", jt = "_downloadBlock_5iyk8_277", zt = "_storeBlock_5iyk8_294", Ht = "_linkLogo_5iyk8_300", N = {
|
|
9
|
+
diya: yt,
|
|
10
|
+
logo: gt,
|
|
11
|
+
titleBlock: Et,
|
|
12
|
+
loaderBlock: Tt,
|
|
13
|
+
loaderTitle: Ct,
|
|
14
|
+
loaderSpinner: wt,
|
|
15
|
+
spinner: bt,
|
|
16
|
+
content: St,
|
|
17
|
+
column: _t,
|
|
18
|
+
columnMob: Pt,
|
|
19
|
+
qrBlock: Mt,
|
|
20
|
+
qr: Rt,
|
|
21
|
+
qrTitle: Ot,
|
|
22
|
+
btn: At,
|
|
23
|
+
mob: kt,
|
|
24
|
+
timerBlock: It,
|
|
25
|
+
timer: Dt,
|
|
26
|
+
timerTitle: Lt,
|
|
27
|
+
textBlock: xt,
|
|
28
|
+
list: Nt,
|
|
29
|
+
phone: Bt,
|
|
30
|
+
linkBlock: $t,
|
|
31
|
+
linkText: Ut,
|
|
32
|
+
timeOverBlock: Ft,
|
|
33
|
+
downloadBlock: jt,
|
|
34
|
+
storeBlock: zt,
|
|
35
|
+
linkLogo: Ht
|
|
36
|
+
}, Yt = ({ locale: t = X.UK }) => {
|
|
37
|
+
const i = new ee({
|
|
38
|
+
uk: {
|
|
39
|
+
noDiya: "Немає застосунку Дія?",
|
|
40
|
+
download: "Завантажити Дія можна тут"
|
|
41
|
+
},
|
|
42
|
+
ru: {
|
|
43
|
+
noDiya: "Нет приложение Дія?",
|
|
44
|
+
download: "Скачать Дія можно здесь"
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return i.setLanguage(t), /* @__PURE__ */ z("div", { className: N.downloadBlock, children: [
|
|
48
|
+
/* @__PURE__ */ b("p", { children: i.noDiya }),
|
|
49
|
+
/* @__PURE__ */ z("p", { children: [
|
|
50
|
+
i.download,
|
|
51
|
+
/* @__PURE__ */ b("span", { children: "↴" })
|
|
52
|
+
] }),
|
|
53
|
+
/* @__PURE__ */ z("div", { className: N.storeBlock, children: [
|
|
54
|
+
/* @__PURE__ */ b("a", { className: N.linkLogo, href: "https://apps.apple.com/us/app/%D0%B4%D1%96%D1%8F/id1489717872", children: /* @__PURE__ */ b(
|
|
55
|
+
"img",
|
|
56
|
+
{
|
|
57
|
+
src: "https://polis.ua/static/img/react-modules/appsBannerModule/v2/appleSvg.svg",
|
|
58
|
+
alt: "Apple"
|
|
59
|
+
}
|
|
60
|
+
) }),
|
|
61
|
+
/* @__PURE__ */ b(
|
|
62
|
+
"a",
|
|
63
|
+
{
|
|
64
|
+
className: N.linkLogo,
|
|
65
|
+
href: "https://play.google.com/store/apps/details?id=ua.gov.diia.app&hl=ru&gl=US",
|
|
66
|
+
children: /* @__PURE__ */ b(
|
|
67
|
+
"img",
|
|
68
|
+
{
|
|
69
|
+
src: "https://polis.ua/static/img/react-modules/appsBannerModule/v2/googleSvg.svg",
|
|
70
|
+
alt: "Google"
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
] })
|
|
76
|
+
] });
|
|
77
|
+
}, Qt = (t) => /* @__PURE__ */ oe.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ oe.createElement("path", { d: "M12 24C5.28 24 3.47151 23.6606 1.90545 22.0945C0.339394 20.5285 0 18.72 0 12C0 5.28 0.339394 3.48121 1.90545 1.90545C3.47151 0.329697 5.28 0 12 0C18.72 0 20.5285 0.339394 22.0945 1.90545C23.6606 3.47151 24 5.28 24 12C24 18.72 23.6703 20.5188 22.0945 22.0945C20.5188 23.6703 18.72 24 12 24Z", fill: "black" }), /* @__PURE__ */ oe.createElement("path", { d: "M16.7066 11.9902C16.5092 11.9902 16.3199 11.9118 16.1803 11.7723C16.0408 11.6327 15.9624 11.4434 15.9624 11.246C15.9624 11.0486 16.0408 10.8593 16.1803 10.7197C16.3199 10.5802 16.5092 10.5018 16.7066 10.5018H17.9042V11.9902H16.7066ZM18.9102 9.6363H16.5902C15.6084 9.6363 14.9369 10.2787 14.9369 11.2024C14.9239 11.5347 15.0236 11.8617 15.2199 12.1301C15.4162 12.3986 15.6975 12.5928 16.0181 12.6812L14.7527 14.606H15.8727L17.0096 12.8484H17.9042V14.5987H18.9102V9.6363ZM6.37933 10.9405V9.45449H8.31873V13.6921H5.88479C6.14661 13.2339 6.37933 12.1745 6.37933 10.9405ZM9.3563 8.48479H5.38782V10.9793C5.38782 12.2521 5.16479 13.2436 4.86418 13.6921H4.37933V15.9587H5.36115V14.6157H9.08479V15.9587H10.0666V13.6921H9.3563V8.48479ZM12.3502 13.7599L12.263 13.7018L13.4218 9.6363H11.0775L10.8351 10.5405H12.1951L11.3102 13.6436C11.2697 13.7729 11.2611 13.9101 11.2851 14.0434C11.3092 14.1768 11.3652 14.3023 11.4484 14.4093C11.5315 14.5163 11.6393 14.6015 11.7626 14.6577C11.8859 14.7139 12.021 14.7394 12.1563 14.7321C12.3682 14.729 12.5747 14.6641 12.7502 14.5454L14.3454 13.4666L13.8605 12.7393L12.3502 13.7599ZM13.0315 8.70297C13.5163 8.70297 13.7321 8.51873 13.7321 8.07994C13.7321 7.64115 13.5187 7.43994 13.0315 7.43994C12.5442 7.43994 12.3309 7.62418 12.3309 8.07994C12.3309 8.5357 12.5369 8.70297 13.0315 8.70297Z", fill: "white" })), Vt = (t) => /* @__PURE__ */ oe.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...t }, /* @__PURE__ */ oe.createElement("path", { d: "M4 13L16.17 13L10.58 18.59L12 20L20 12L12 4L10.59 5.41L16.17 11L4 11L4 13Z", fill: "#2D2B2B" })), qt = () => {
|
|
78
|
+
const t = navigator.userAgent || navigator.vendor;
|
|
79
|
+
return /android/i.test(t) ? "android" : /iPad|iPhone|iPod/.test(t) ? "ios" : "desktop";
|
|
80
|
+
}, Wt = (t) => {
|
|
81
|
+
const i = qt();
|
|
82
|
+
let a = "";
|
|
83
|
+
const s = t == null ? void 0 : t.slice(6);
|
|
84
|
+
switch (i) {
|
|
85
|
+
case "android":
|
|
86
|
+
a = `intent:${s}#Intent;scheme=https;package=ua.gov.diia.app;action=android.intent.action.VIEW;S.browser_fallback_url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dua.gov.diia.app%26launch%3Dtrue%0A;end;`;
|
|
87
|
+
break;
|
|
88
|
+
case "ios":
|
|
89
|
+
a = t;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
return a;
|
|
93
|
+
}, Zt = ({ locale: t = X.UK, deeplink: i }) => {
|
|
94
|
+
const a = new ee({
|
|
95
|
+
uk: {
|
|
96
|
+
linkText: "За цим посиланням Ви потрапите до застосунку Дія. Після виконання інструкцій застосунку Дія повертайтесь до нас, Ваші дані буде внесено до анкети.",
|
|
97
|
+
linkBtnText: "Перейти в Дія"
|
|
98
|
+
},
|
|
99
|
+
ru: {
|
|
100
|
+
linkText: "По этой ссылке Вы попадете в приложение Дія. После выполнения инструкций приложения Дія возвращайтесь к нам, Ваши данные будут внесены в анкету.",
|
|
101
|
+
linkBtnText: "Перейти в Дія"
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return a.setLanguage(t), /* @__PURE__ */ z("div", { className: N.linkBlock, children: [
|
|
105
|
+
/* @__PURE__ */ b("p", { className: N.linkText, children: a.linkText }),
|
|
106
|
+
/* @__PURE__ */ z(
|
|
107
|
+
"a",
|
|
108
|
+
{
|
|
109
|
+
className: We(N.btn, { [N.mob]: K }),
|
|
110
|
+
href: Wt(i || ""),
|
|
111
|
+
children: [
|
|
112
|
+
K && /* @__PURE__ */ b(Qt, {}),
|
|
113
|
+
a.linkBtnText,
|
|
114
|
+
/* @__PURE__ */ b(Vt, {})
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] });
|
|
119
|
+
}, Gt = ({ locale: t = X.UK }) => {
|
|
120
|
+
const i = new ee({
|
|
121
|
+
uk: {
|
|
122
|
+
text1: "Вам потрібно:",
|
|
123
|
+
text2: "Відкрийте застосунок Дія на Вашому смартфоні",
|
|
124
|
+
text3: "Переконайтесь що у Вас активовано Дія.Підпис",
|
|
125
|
+
text4: "На екрані натисніть кнопку сканування QR-коду (як на фото нижче)",
|
|
126
|
+
text5: "Відскануйте QR-код на цьому екрані."
|
|
127
|
+
},
|
|
128
|
+
ru: {
|
|
129
|
+
text1: "Вам нужно:",
|
|
130
|
+
text2: "Откройте приложение Дія на Вашем смартфоне",
|
|
131
|
+
text3: "Убедитесь, что у Вас активировано Дія.Підпис",
|
|
132
|
+
text4: "На экране нажмите кнопку сканирования QR-кода (как на фото ниже)",
|
|
133
|
+
text5: "Отсканируйте QR-код на этом экране."
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
return i.setLanguage(t), /* @__PURE__ */ z("div", { className: N.textBlock, children: [
|
|
137
|
+
/* @__PURE__ */ b("p", { children: i.text1 }),
|
|
138
|
+
/* @__PURE__ */ z("ul", { className: N.list, children: [
|
|
139
|
+
/* @__PURE__ */ b("li", { children: i.text2 }),
|
|
140
|
+
/* @__PURE__ */ b("li", { children: i.text3 }),
|
|
141
|
+
/* @__PURE__ */ b("li", { children: i.text4 }),
|
|
142
|
+
/* @__PURE__ */ b("img", { className: N.phone, src: "https://polis.ua/static/img/react-modules/diya/diya.png", alt: "Phone" }),
|
|
143
|
+
/* @__PURE__ */ b("li", { children: i.text5 })
|
|
144
|
+
] })
|
|
145
|
+
] });
|
|
146
|
+
}, Kt = (t) => /* @__PURE__ */ oe.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 25, height: 24, viewBox: "0 0 25 24", fill: "none", ...t }, /* @__PURE__ */ oe.createElement("path", { d: "M17.6876 18.5356C18.0886 18.1558 18.1058 17.5229 17.7261 17.1219C17.3463 16.7209 16.7134 16.7037 16.3124 17.0834L17.6876 18.5356ZM19.5 15L18.7929 15.7071C19.1834 16.0976 19.8166 16.0976 20.2071 15.7071L19.5 15ZM17.2071 11.2929C16.8166 10.9024 16.1834 10.9024 15.7929 11.2929C15.4024 11.6834 15.4024 12.3166 15.7929 12.7071L17.2071 11.2929ZM23.2071 12.7071C23.5976 12.3166 23.5976 11.6834 23.2071 11.2929C22.8166 10.9024 22.1834 10.9024 21.7929 11.2929L23.2071 12.7071ZM11.5 19C7.63401 19 4.5 15.866 4.5 12H2.5C2.5 16.9706 6.52944 21 11.5 21V19ZM4.5 12C4.5 8.13401 7.63401 5 11.5 5V3C6.52944 3 2.5 7.02944 2.5 12H4.5ZM11.5 5C15.366 5 18.5 8.13401 18.5 12H20.5C20.5 7.02944 16.4706 3 11.5 3V5ZM16.3124 17.0834C15.057 18.2723 13.3646 19 11.5 19V21C13.8963 21 16.0756 20.0622 17.6876 18.5356L16.3124 17.0834ZM18.5 12V15H20.5V12H18.5ZM20.2071 14.2929L17.2071 11.2929L15.7929 12.7071L18.7929 15.7071L20.2071 14.2929ZM20.2071 15.7071L23.2071 12.7071L21.7929 11.2929L18.7929 14.2929L20.2071 15.7071Z", fill: "#2D2B2B" })), Ze = ({ locale: t = X.UK, updateHandler: i }) => {
|
|
147
|
+
const a = new ee({
|
|
148
|
+
uk: {
|
|
149
|
+
updateBtn: "ОНОВИТИ Qr-код",
|
|
150
|
+
updateLink: "ОНОВИТИ посилання"
|
|
151
|
+
},
|
|
152
|
+
ru: {
|
|
153
|
+
updateBtn: "ОБНОВИТЬ Qr-код",
|
|
154
|
+
updateLink: "ОБНОВИТЬ ссылку"
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
return a.setLanguage(t), /* @__PURE__ */ z(
|
|
158
|
+
"button",
|
|
159
|
+
{
|
|
160
|
+
className: N.btn,
|
|
161
|
+
type: "button",
|
|
162
|
+
onClick: i,
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ b(Kt, {}),
|
|
165
|
+
K ? a.updateLink : a.updateBtn
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
};
|
|
170
|
+
var _e = { exports: {} }, he = { exports: {} }, L = {};
|
|
171
|
+
/** @license React v16.13.1
|
|
172
|
+
* react-is.production.min.js
|
|
173
|
+
*
|
|
174
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the MIT license found in the
|
|
177
|
+
* LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/
|
|
179
|
+
var Le;
|
|
180
|
+
function Xt() {
|
|
181
|
+
if (Le) return L;
|
|
182
|
+
Le = 1;
|
|
183
|
+
var t = typeof Symbol == "function" && Symbol.for, i = t ? Symbol.for("react.element") : 60103, a = t ? Symbol.for("react.portal") : 60106, s = t ? Symbol.for("react.fragment") : 60107, o = t ? Symbol.for("react.strict_mode") : 60108, u = t ? Symbol.for("react.profiler") : 60114, m = t ? Symbol.for("react.provider") : 60109, h = t ? Symbol.for("react.context") : 60110, e = t ? Symbol.for("react.async_mode") : 60111, n = t ? Symbol.for("react.concurrent_mode") : 60111, r = t ? Symbol.for("react.forward_ref") : 60112, c = t ? Symbol.for("react.suspense") : 60113, l = t ? Symbol.for("react.suspense_list") : 60120, f = t ? Symbol.for("react.memo") : 60115, d = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, E = t ? Symbol.for("react.fundamental") : 60117, D = t ? Symbol.for("react.responder") : 60118, $ = t ? Symbol.for("react.scope") : 60119;
|
|
184
|
+
function C(v) {
|
|
185
|
+
if (typeof v == "object" && v !== null) {
|
|
186
|
+
var Z = v.$$typeof;
|
|
187
|
+
switch (Z) {
|
|
188
|
+
case i:
|
|
189
|
+
switch (v = v.type, v) {
|
|
190
|
+
case e:
|
|
191
|
+
case n:
|
|
192
|
+
case s:
|
|
193
|
+
case u:
|
|
194
|
+
case o:
|
|
195
|
+
case c:
|
|
196
|
+
return v;
|
|
197
|
+
default:
|
|
198
|
+
switch (v = v && v.$$typeof, v) {
|
|
199
|
+
case h:
|
|
200
|
+
case r:
|
|
201
|
+
case d:
|
|
202
|
+
case f:
|
|
203
|
+
case m:
|
|
204
|
+
return v;
|
|
205
|
+
default:
|
|
206
|
+
return Z;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
case a:
|
|
210
|
+
return Z;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
function S(v) {
|
|
215
|
+
return C(v) === n;
|
|
216
|
+
}
|
|
217
|
+
return L.AsyncMode = e, L.ConcurrentMode = n, L.ContextConsumer = h, L.ContextProvider = m, L.Element = i, L.ForwardRef = r, L.Fragment = s, L.Lazy = d, L.Memo = f, L.Portal = a, L.Profiler = u, L.StrictMode = o, L.Suspense = c, L.isAsyncMode = function(v) {
|
|
218
|
+
return S(v) || C(v) === e;
|
|
219
|
+
}, L.isConcurrentMode = S, L.isContextConsumer = function(v) {
|
|
220
|
+
return C(v) === h;
|
|
221
|
+
}, L.isContextProvider = function(v) {
|
|
222
|
+
return C(v) === m;
|
|
223
|
+
}, L.isElement = function(v) {
|
|
224
|
+
return typeof v == "object" && v !== null && v.$$typeof === i;
|
|
225
|
+
}, L.isForwardRef = function(v) {
|
|
226
|
+
return C(v) === r;
|
|
227
|
+
}, L.isFragment = function(v) {
|
|
228
|
+
return C(v) === s;
|
|
229
|
+
}, L.isLazy = function(v) {
|
|
230
|
+
return C(v) === d;
|
|
231
|
+
}, L.isMemo = function(v) {
|
|
232
|
+
return C(v) === f;
|
|
233
|
+
}, L.isPortal = function(v) {
|
|
234
|
+
return C(v) === a;
|
|
235
|
+
}, L.isProfiler = function(v) {
|
|
236
|
+
return C(v) === u;
|
|
237
|
+
}, L.isStrictMode = function(v) {
|
|
238
|
+
return C(v) === o;
|
|
239
|
+
}, L.isSuspense = function(v) {
|
|
240
|
+
return C(v) === c;
|
|
241
|
+
}, L.isValidElementType = function(v) {
|
|
242
|
+
return typeof v == "string" || typeof v == "function" || v === s || v === n || v === u || v === o || v === c || v === l || typeof v == "object" && v !== null && (v.$$typeof === d || v.$$typeof === f || v.$$typeof === m || v.$$typeof === h || v.$$typeof === r || v.$$typeof === E || v.$$typeof === D || v.$$typeof === $ || v.$$typeof === g);
|
|
243
|
+
}, L.typeOf = C, L;
|
|
244
|
+
}
|
|
245
|
+
var x = {};
|
|
246
|
+
/** @license React v16.13.1
|
|
247
|
+
* react-is.development.js
|
|
248
|
+
*
|
|
249
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the MIT license found in the
|
|
252
|
+
* LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/
|
|
254
|
+
var xe;
|
|
255
|
+
function Jt() {
|
|
256
|
+
return xe || (xe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
257
|
+
var t = typeof Symbol == "function" && Symbol.for, i = t ? Symbol.for("react.element") : 60103, a = t ? Symbol.for("react.portal") : 60106, s = t ? Symbol.for("react.fragment") : 60107, o = t ? Symbol.for("react.strict_mode") : 60108, u = t ? Symbol.for("react.profiler") : 60114, m = t ? Symbol.for("react.provider") : 60109, h = t ? Symbol.for("react.context") : 60110, e = t ? Symbol.for("react.async_mode") : 60111, n = t ? Symbol.for("react.concurrent_mode") : 60111, r = t ? Symbol.for("react.forward_ref") : 60112, c = t ? Symbol.for("react.suspense") : 60113, l = t ? Symbol.for("react.suspense_list") : 60120, f = t ? Symbol.for("react.memo") : 60115, d = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, E = t ? Symbol.for("react.fundamental") : 60117, D = t ? Symbol.for("react.responder") : 60118, $ = t ? Symbol.for("react.scope") : 60119;
|
|
258
|
+
function C(y) {
|
|
259
|
+
return typeof y == "string" || typeof y == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
260
|
+
y === s || y === n || y === u || y === o || y === c || y === l || typeof y == "object" && y !== null && (y.$$typeof === d || y.$$typeof === f || y.$$typeof === m || y.$$typeof === h || y.$$typeof === r || y.$$typeof === E || y.$$typeof === D || y.$$typeof === $ || y.$$typeof === g);
|
|
261
|
+
}
|
|
262
|
+
function S(y) {
|
|
263
|
+
if (typeof y == "object" && y !== null) {
|
|
264
|
+
var G = y.$$typeof;
|
|
265
|
+
switch (G) {
|
|
266
|
+
case i:
|
|
267
|
+
var de = y.type;
|
|
268
|
+
switch (de) {
|
|
269
|
+
case e:
|
|
270
|
+
case n:
|
|
271
|
+
case s:
|
|
272
|
+
case u:
|
|
273
|
+
case o:
|
|
274
|
+
case c:
|
|
275
|
+
return de;
|
|
276
|
+
default:
|
|
277
|
+
var Ie = de && de.$$typeof;
|
|
278
|
+
switch (Ie) {
|
|
279
|
+
case h:
|
|
280
|
+
case r:
|
|
281
|
+
case d:
|
|
282
|
+
case f:
|
|
283
|
+
case m:
|
|
284
|
+
return Ie;
|
|
285
|
+
default:
|
|
286
|
+
return G;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
case a:
|
|
290
|
+
return G;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
var v = e, Z = n, ae = h, J = m, te = i, re = r, H = s, ue = d, se = f, Y = a, V = u, q = o, W = c, ne = !1;
|
|
295
|
+
function ce(y) {
|
|
296
|
+
return ne || (ne = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), p(y) || S(y) === e;
|
|
297
|
+
}
|
|
298
|
+
function p(y) {
|
|
299
|
+
return S(y) === n;
|
|
300
|
+
}
|
|
301
|
+
function T(y) {
|
|
302
|
+
return S(y) === h;
|
|
303
|
+
}
|
|
304
|
+
function P(y) {
|
|
305
|
+
return S(y) === m;
|
|
306
|
+
}
|
|
307
|
+
function _(y) {
|
|
308
|
+
return typeof y == "object" && y !== null && y.$$typeof === i;
|
|
309
|
+
}
|
|
310
|
+
function w(y) {
|
|
311
|
+
return S(y) === r;
|
|
312
|
+
}
|
|
313
|
+
function A(y) {
|
|
314
|
+
return S(y) === s;
|
|
315
|
+
}
|
|
316
|
+
function M(y) {
|
|
317
|
+
return S(y) === d;
|
|
318
|
+
}
|
|
319
|
+
function O(y) {
|
|
320
|
+
return S(y) === f;
|
|
321
|
+
}
|
|
322
|
+
function k(y) {
|
|
323
|
+
return S(y) === a;
|
|
324
|
+
}
|
|
325
|
+
function B(y) {
|
|
326
|
+
return S(y) === u;
|
|
327
|
+
}
|
|
328
|
+
function I(y) {
|
|
329
|
+
return S(y) === o;
|
|
330
|
+
}
|
|
331
|
+
function Q(y) {
|
|
332
|
+
return S(y) === c;
|
|
333
|
+
}
|
|
334
|
+
x.AsyncMode = v, x.ConcurrentMode = Z, x.ContextConsumer = ae, x.ContextProvider = J, x.Element = te, x.ForwardRef = re, x.Fragment = H, x.Lazy = ue, x.Memo = se, x.Portal = Y, x.Profiler = V, x.StrictMode = q, x.Suspense = W, x.isAsyncMode = ce, x.isConcurrentMode = p, x.isContextConsumer = T, x.isContextProvider = P, x.isElement = _, x.isForwardRef = w, x.isFragment = A, x.isLazy = M, x.isMemo = O, x.isPortal = k, x.isProfiler = B, x.isStrictMode = I, x.isSuspense = Q, x.isValidElementType = C, x.typeOf = S;
|
|
335
|
+
}()), x;
|
|
336
|
+
}
|
|
337
|
+
var Ne;
|
|
338
|
+
function Ge() {
|
|
339
|
+
return Ne || (Ne = 1, process.env.NODE_ENV === "production" ? he.exports = Xt() : he.exports = Jt()), he.exports;
|
|
340
|
+
}
|
|
341
|
+
/*
|
|
342
|
+
object-assign
|
|
343
|
+
(c) Sindre Sorhus
|
|
344
|
+
@license MIT
|
|
345
|
+
*/
|
|
346
|
+
var Ee, Be;
|
|
347
|
+
function er() {
|
|
348
|
+
if (Be) return Ee;
|
|
349
|
+
Be = 1;
|
|
350
|
+
var t = Object.getOwnPropertySymbols, i = Object.prototype.hasOwnProperty, a = Object.prototype.propertyIsEnumerable;
|
|
351
|
+
function s(u) {
|
|
352
|
+
if (u == null)
|
|
353
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
354
|
+
return Object(u);
|
|
355
|
+
}
|
|
356
|
+
function o() {
|
|
357
|
+
try {
|
|
358
|
+
if (!Object.assign)
|
|
359
|
+
return !1;
|
|
360
|
+
var u = new String("abc");
|
|
361
|
+
if (u[5] = "de", Object.getOwnPropertyNames(u)[0] === "5")
|
|
362
|
+
return !1;
|
|
363
|
+
for (var m = {}, h = 0; h < 10; h++)
|
|
364
|
+
m["_" + String.fromCharCode(h)] = h;
|
|
365
|
+
var e = Object.getOwnPropertyNames(m).map(function(r) {
|
|
366
|
+
return m[r];
|
|
367
|
+
});
|
|
368
|
+
if (e.join("") !== "0123456789")
|
|
369
|
+
return !1;
|
|
370
|
+
var n = {};
|
|
371
|
+
return "abcdefghijklmnopqrst".split("").forEach(function(r) {
|
|
372
|
+
n[r] = r;
|
|
373
|
+
}), Object.keys(Object.assign({}, n)).join("") === "abcdefghijklmnopqrst";
|
|
374
|
+
} catch {
|
|
375
|
+
return !1;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
return Ee = o() ? Object.assign : function(u, m) {
|
|
379
|
+
for (var h, e = s(u), n, r = 1; r < arguments.length; r++) {
|
|
380
|
+
h = Object(arguments[r]);
|
|
381
|
+
for (var c in h)
|
|
382
|
+
i.call(h, c) && (e[c] = h[c]);
|
|
383
|
+
if (t) {
|
|
384
|
+
n = t(h);
|
|
385
|
+
for (var l = 0; l < n.length; l++)
|
|
386
|
+
a.call(h, n[l]) && (e[n[l]] = h[n[l]]);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return e;
|
|
390
|
+
}, Ee;
|
|
391
|
+
}
|
|
392
|
+
var Te, $e;
|
|
393
|
+
function Ae() {
|
|
394
|
+
if ($e) return Te;
|
|
395
|
+
$e = 1;
|
|
396
|
+
var t = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
397
|
+
return Te = t, Te;
|
|
398
|
+
}
|
|
399
|
+
var Ce, Ue;
|
|
400
|
+
function Ke() {
|
|
401
|
+
return Ue || (Ue = 1, Ce = Function.call.bind(Object.prototype.hasOwnProperty)), Ce;
|
|
402
|
+
}
|
|
403
|
+
var we, Fe;
|
|
404
|
+
function tr() {
|
|
405
|
+
if (Fe) return we;
|
|
406
|
+
Fe = 1;
|
|
407
|
+
var t = function() {
|
|
408
|
+
};
|
|
409
|
+
if (process.env.NODE_ENV !== "production") {
|
|
410
|
+
var i = Ae(), a = {}, s = Ke();
|
|
411
|
+
t = function(u) {
|
|
412
|
+
var m = "Warning: " + u;
|
|
413
|
+
typeof console < "u" && console.error(m);
|
|
414
|
+
try {
|
|
415
|
+
throw new Error(m);
|
|
416
|
+
} catch {
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
function o(u, m, h, e, n) {
|
|
421
|
+
if (process.env.NODE_ENV !== "production") {
|
|
422
|
+
for (var r in u)
|
|
423
|
+
if (s(u, r)) {
|
|
424
|
+
var c;
|
|
425
|
+
try {
|
|
426
|
+
if (typeof u[r] != "function") {
|
|
427
|
+
var l = Error(
|
|
428
|
+
(e || "React class") + ": " + h + " type `" + r + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof u[r] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
429
|
+
);
|
|
430
|
+
throw l.name = "Invariant Violation", l;
|
|
431
|
+
}
|
|
432
|
+
c = u[r](m, r, e, h, null, i);
|
|
433
|
+
} catch (d) {
|
|
434
|
+
c = d;
|
|
435
|
+
}
|
|
436
|
+
if (c && !(c instanceof Error) && t(
|
|
437
|
+
(e || "React class") + ": type specification of " + h + " `" + r + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof c + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
438
|
+
), c instanceof Error && !(c.message in a)) {
|
|
439
|
+
a[c.message] = !0;
|
|
440
|
+
var f = n ? n() : "";
|
|
441
|
+
t(
|
|
442
|
+
"Failed " + h + " type: " + c.message + (f ?? "")
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
return o.resetWarningCache = function() {
|
|
449
|
+
process.env.NODE_ENV !== "production" && (a = {});
|
|
450
|
+
}, we = o, we;
|
|
451
|
+
}
|
|
452
|
+
var be, je;
|
|
453
|
+
function rr() {
|
|
454
|
+
if (je) return be;
|
|
455
|
+
je = 1;
|
|
456
|
+
var t = Ge(), i = er(), a = Ae(), s = Ke(), o = tr(), u = function() {
|
|
457
|
+
};
|
|
458
|
+
process.env.NODE_ENV !== "production" && (u = function(h) {
|
|
459
|
+
var e = "Warning: " + h;
|
|
460
|
+
typeof console < "u" && console.error(e);
|
|
461
|
+
try {
|
|
462
|
+
throw new Error(e);
|
|
463
|
+
} catch {
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
function m() {
|
|
467
|
+
return null;
|
|
468
|
+
}
|
|
469
|
+
return be = function(h, e) {
|
|
470
|
+
var n = typeof Symbol == "function" && Symbol.iterator, r = "@@iterator";
|
|
471
|
+
function c(p) {
|
|
472
|
+
var T = p && (n && p[n] || p[r]);
|
|
473
|
+
if (typeof T == "function")
|
|
474
|
+
return T;
|
|
475
|
+
}
|
|
476
|
+
var l = "<<anonymous>>", f = {
|
|
477
|
+
array: D("array"),
|
|
478
|
+
bigint: D("bigint"),
|
|
479
|
+
bool: D("boolean"),
|
|
480
|
+
func: D("function"),
|
|
481
|
+
number: D("number"),
|
|
482
|
+
object: D("object"),
|
|
483
|
+
string: D("string"),
|
|
484
|
+
symbol: D("symbol"),
|
|
485
|
+
any: $(),
|
|
486
|
+
arrayOf: C,
|
|
487
|
+
element: S(),
|
|
488
|
+
elementType: v(),
|
|
489
|
+
instanceOf: Z,
|
|
490
|
+
node: re(),
|
|
491
|
+
objectOf: J,
|
|
492
|
+
oneOf: ae,
|
|
493
|
+
oneOfType: te,
|
|
494
|
+
shape: ue,
|
|
495
|
+
exact: se
|
|
496
|
+
};
|
|
497
|
+
function d(p, T) {
|
|
498
|
+
return p === T ? p !== 0 || 1 / p === 1 / T : p !== p && T !== T;
|
|
499
|
+
}
|
|
500
|
+
function g(p, T) {
|
|
501
|
+
this.message = p, this.data = T && typeof T == "object" ? T : {}, this.stack = "";
|
|
502
|
+
}
|
|
503
|
+
g.prototype = Error.prototype;
|
|
504
|
+
function E(p) {
|
|
505
|
+
if (process.env.NODE_ENV !== "production")
|
|
506
|
+
var T = {}, P = 0;
|
|
507
|
+
function _(A, M, O, k, B, I, Q) {
|
|
508
|
+
if (k = k || l, I = I || O, Q !== a) {
|
|
509
|
+
if (e) {
|
|
510
|
+
var y = new Error(
|
|
511
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
512
|
+
);
|
|
513
|
+
throw y.name = "Invariant Violation", y;
|
|
514
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
515
|
+
var G = k + ":" + O;
|
|
516
|
+
!T[G] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
517
|
+
P < 3 && (u(
|
|
518
|
+
"You are manually calling a React.PropTypes validation function for the `" + I + "` prop on `" + k + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
519
|
+
), T[G] = !0, P++);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
return M[O] == null ? A ? M[O] === null ? new g("The " + B + " `" + I + "` is marked as required " + ("in `" + k + "`, but its value is `null`.")) : new g("The " + B + " `" + I + "` is marked as required in " + ("`" + k + "`, but its value is `undefined`.")) : null : p(M, O, k, B, I);
|
|
523
|
+
}
|
|
524
|
+
var w = _.bind(null, !1);
|
|
525
|
+
return w.isRequired = _.bind(null, !0), w;
|
|
526
|
+
}
|
|
527
|
+
function D(p) {
|
|
528
|
+
function T(P, _, w, A, M, O) {
|
|
529
|
+
var k = P[_], B = q(k);
|
|
530
|
+
if (B !== p) {
|
|
531
|
+
var I = W(k);
|
|
532
|
+
return new g(
|
|
533
|
+
"Invalid " + A + " `" + M + "` of type " + ("`" + I + "` supplied to `" + w + "`, expected ") + ("`" + p + "`."),
|
|
534
|
+
{ expectedType: p }
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
return null;
|
|
538
|
+
}
|
|
539
|
+
return E(T);
|
|
540
|
+
}
|
|
541
|
+
function $() {
|
|
542
|
+
return E(m);
|
|
543
|
+
}
|
|
544
|
+
function C(p) {
|
|
545
|
+
function T(P, _, w, A, M) {
|
|
546
|
+
if (typeof p != "function")
|
|
547
|
+
return new g("Property `" + M + "` of component `" + w + "` has invalid PropType notation inside arrayOf.");
|
|
548
|
+
var O = P[_];
|
|
549
|
+
if (!Array.isArray(O)) {
|
|
550
|
+
var k = q(O);
|
|
551
|
+
return new g("Invalid " + A + " `" + M + "` of type " + ("`" + k + "` supplied to `" + w + "`, expected an array."));
|
|
552
|
+
}
|
|
553
|
+
for (var B = 0; B < O.length; B++) {
|
|
554
|
+
var I = p(O, B, w, A, M + "[" + B + "]", a);
|
|
555
|
+
if (I instanceof Error)
|
|
556
|
+
return I;
|
|
557
|
+
}
|
|
558
|
+
return null;
|
|
559
|
+
}
|
|
560
|
+
return E(T);
|
|
561
|
+
}
|
|
562
|
+
function S() {
|
|
563
|
+
function p(T, P, _, w, A) {
|
|
564
|
+
var M = T[P];
|
|
565
|
+
if (!h(M)) {
|
|
566
|
+
var O = q(M);
|
|
567
|
+
return new g("Invalid " + w + " `" + A + "` of type " + ("`" + O + "` supplied to `" + _ + "`, expected a single ReactElement."));
|
|
568
|
+
}
|
|
569
|
+
return null;
|
|
570
|
+
}
|
|
571
|
+
return E(p);
|
|
572
|
+
}
|
|
573
|
+
function v() {
|
|
574
|
+
function p(T, P, _, w, A) {
|
|
575
|
+
var M = T[P];
|
|
576
|
+
if (!t.isValidElementType(M)) {
|
|
577
|
+
var O = q(M);
|
|
578
|
+
return new g("Invalid " + w + " `" + A + "` of type " + ("`" + O + "` supplied to `" + _ + "`, expected a single ReactElement type."));
|
|
579
|
+
}
|
|
580
|
+
return null;
|
|
581
|
+
}
|
|
582
|
+
return E(p);
|
|
583
|
+
}
|
|
584
|
+
function Z(p) {
|
|
585
|
+
function T(P, _, w, A, M) {
|
|
586
|
+
if (!(P[_] instanceof p)) {
|
|
587
|
+
var O = p.name || l, k = ce(P[_]);
|
|
588
|
+
return new g("Invalid " + A + " `" + M + "` of type " + ("`" + k + "` supplied to `" + w + "`, expected ") + ("instance of `" + O + "`."));
|
|
589
|
+
}
|
|
590
|
+
return null;
|
|
591
|
+
}
|
|
592
|
+
return E(T);
|
|
593
|
+
}
|
|
594
|
+
function ae(p) {
|
|
595
|
+
if (!Array.isArray(p))
|
|
596
|
+
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? u(
|
|
597
|
+
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
598
|
+
) : u("Invalid argument supplied to oneOf, expected an array.")), m;
|
|
599
|
+
function T(P, _, w, A, M) {
|
|
600
|
+
for (var O = P[_], k = 0; k < p.length; k++)
|
|
601
|
+
if (d(O, p[k]))
|
|
602
|
+
return null;
|
|
603
|
+
var B = JSON.stringify(p, function(Q, y) {
|
|
604
|
+
var G = W(y);
|
|
605
|
+
return G === "symbol" ? String(y) : y;
|
|
606
|
+
});
|
|
607
|
+
return new g("Invalid " + A + " `" + M + "` of value `" + String(O) + "` " + ("supplied to `" + w + "`, expected one of " + B + "."));
|
|
608
|
+
}
|
|
609
|
+
return E(T);
|
|
610
|
+
}
|
|
611
|
+
function J(p) {
|
|
612
|
+
function T(P, _, w, A, M) {
|
|
613
|
+
if (typeof p != "function")
|
|
614
|
+
return new g("Property `" + M + "` of component `" + w + "` has invalid PropType notation inside objectOf.");
|
|
615
|
+
var O = P[_], k = q(O);
|
|
616
|
+
if (k !== "object")
|
|
617
|
+
return new g("Invalid " + A + " `" + M + "` of type " + ("`" + k + "` supplied to `" + w + "`, expected an object."));
|
|
618
|
+
for (var B in O)
|
|
619
|
+
if (s(O, B)) {
|
|
620
|
+
var I = p(O, B, w, A, M + "." + B, a);
|
|
621
|
+
if (I instanceof Error)
|
|
622
|
+
return I;
|
|
623
|
+
}
|
|
624
|
+
return null;
|
|
625
|
+
}
|
|
626
|
+
return E(T);
|
|
627
|
+
}
|
|
628
|
+
function te(p) {
|
|
629
|
+
if (!Array.isArray(p))
|
|
630
|
+
return process.env.NODE_ENV !== "production" && u("Invalid argument supplied to oneOfType, expected an instance of array."), m;
|
|
631
|
+
for (var T = 0; T < p.length; T++) {
|
|
632
|
+
var P = p[T];
|
|
633
|
+
if (typeof P != "function")
|
|
634
|
+
return u(
|
|
635
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ne(P) + " at index " + T + "."
|
|
636
|
+
), m;
|
|
637
|
+
}
|
|
638
|
+
function _(w, A, M, O, k) {
|
|
639
|
+
for (var B = [], I = 0; I < p.length; I++) {
|
|
640
|
+
var Q = p[I], y = Q(w, A, M, O, k, a);
|
|
641
|
+
if (y == null)
|
|
642
|
+
return null;
|
|
643
|
+
y.data && s(y.data, "expectedType") && B.push(y.data.expectedType);
|
|
644
|
+
}
|
|
645
|
+
var G = B.length > 0 ? ", expected one of type [" + B.join(", ") + "]" : "";
|
|
646
|
+
return new g("Invalid " + O + " `" + k + "` supplied to " + ("`" + M + "`" + G + "."));
|
|
647
|
+
}
|
|
648
|
+
return E(_);
|
|
649
|
+
}
|
|
650
|
+
function re() {
|
|
651
|
+
function p(T, P, _, w, A) {
|
|
652
|
+
return Y(T[P]) ? null : new g("Invalid " + w + " `" + A + "` supplied to " + ("`" + _ + "`, expected a ReactNode."));
|
|
653
|
+
}
|
|
654
|
+
return E(p);
|
|
655
|
+
}
|
|
656
|
+
function H(p, T, P, _, w) {
|
|
657
|
+
return new g(
|
|
658
|
+
(p || "React class") + ": " + T + " type `" + P + "." + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + w + "`."
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
function ue(p) {
|
|
662
|
+
function T(P, _, w, A, M) {
|
|
663
|
+
var O = P[_], k = q(O);
|
|
664
|
+
if (k !== "object")
|
|
665
|
+
return new g("Invalid " + A + " `" + M + "` of type `" + k + "` " + ("supplied to `" + w + "`, expected `object`."));
|
|
666
|
+
for (var B in p) {
|
|
667
|
+
var I = p[B];
|
|
668
|
+
if (typeof I != "function")
|
|
669
|
+
return H(w, A, M, B, W(I));
|
|
670
|
+
var Q = I(O, B, w, A, M + "." + B, a);
|
|
671
|
+
if (Q)
|
|
672
|
+
return Q;
|
|
673
|
+
}
|
|
674
|
+
return null;
|
|
675
|
+
}
|
|
676
|
+
return E(T);
|
|
677
|
+
}
|
|
678
|
+
function se(p) {
|
|
679
|
+
function T(P, _, w, A, M) {
|
|
680
|
+
var O = P[_], k = q(O);
|
|
681
|
+
if (k !== "object")
|
|
682
|
+
return new g("Invalid " + A + " `" + M + "` of type `" + k + "` " + ("supplied to `" + w + "`, expected `object`."));
|
|
683
|
+
var B = i({}, P[_], p);
|
|
684
|
+
for (var I in B) {
|
|
685
|
+
var Q = p[I];
|
|
686
|
+
if (s(p, I) && typeof Q != "function")
|
|
687
|
+
return H(w, A, M, I, W(Q));
|
|
688
|
+
if (!Q)
|
|
689
|
+
return new g(
|
|
690
|
+
"Invalid " + A + " `" + M + "` key `" + I + "` supplied to `" + w + "`.\nBad object: " + JSON.stringify(P[_], null, " ") + `
|
|
691
|
+
Valid keys: ` + JSON.stringify(Object.keys(p), null, " ")
|
|
692
|
+
);
|
|
693
|
+
var y = Q(O, I, w, A, M + "." + I, a);
|
|
694
|
+
if (y)
|
|
695
|
+
return y;
|
|
696
|
+
}
|
|
697
|
+
return null;
|
|
698
|
+
}
|
|
699
|
+
return E(T);
|
|
700
|
+
}
|
|
701
|
+
function Y(p) {
|
|
702
|
+
switch (typeof p) {
|
|
703
|
+
case "number":
|
|
704
|
+
case "string":
|
|
705
|
+
case "undefined":
|
|
706
|
+
return !0;
|
|
707
|
+
case "boolean":
|
|
708
|
+
return !p;
|
|
709
|
+
case "object":
|
|
710
|
+
if (Array.isArray(p))
|
|
711
|
+
return p.every(Y);
|
|
712
|
+
if (p === null || h(p))
|
|
713
|
+
return !0;
|
|
714
|
+
var T = c(p);
|
|
715
|
+
if (T) {
|
|
716
|
+
var P = T.call(p), _;
|
|
717
|
+
if (T !== p.entries) {
|
|
718
|
+
for (; !(_ = P.next()).done; )
|
|
719
|
+
if (!Y(_.value))
|
|
720
|
+
return !1;
|
|
721
|
+
} else
|
|
722
|
+
for (; !(_ = P.next()).done; ) {
|
|
723
|
+
var w = _.value;
|
|
724
|
+
if (w && !Y(w[1]))
|
|
725
|
+
return !1;
|
|
726
|
+
}
|
|
727
|
+
} else
|
|
728
|
+
return !1;
|
|
729
|
+
return !0;
|
|
730
|
+
default:
|
|
731
|
+
return !1;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
function V(p, T) {
|
|
735
|
+
return p === "symbol" ? !0 : T ? T["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && T instanceof Symbol : !1;
|
|
736
|
+
}
|
|
737
|
+
function q(p) {
|
|
738
|
+
var T = typeof p;
|
|
739
|
+
return Array.isArray(p) ? "array" : p instanceof RegExp ? "object" : V(T, p) ? "symbol" : T;
|
|
740
|
+
}
|
|
741
|
+
function W(p) {
|
|
742
|
+
if (typeof p > "u" || p === null)
|
|
743
|
+
return "" + p;
|
|
744
|
+
var T = q(p);
|
|
745
|
+
if (T === "object") {
|
|
746
|
+
if (p instanceof Date)
|
|
747
|
+
return "date";
|
|
748
|
+
if (p instanceof RegExp)
|
|
749
|
+
return "regexp";
|
|
750
|
+
}
|
|
751
|
+
return T;
|
|
752
|
+
}
|
|
753
|
+
function ne(p) {
|
|
754
|
+
var T = W(p);
|
|
755
|
+
switch (T) {
|
|
756
|
+
case "array":
|
|
757
|
+
case "object":
|
|
758
|
+
return "an " + T;
|
|
759
|
+
case "boolean":
|
|
760
|
+
case "date":
|
|
761
|
+
case "regexp":
|
|
762
|
+
return "a " + T;
|
|
763
|
+
default:
|
|
764
|
+
return T;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
function ce(p) {
|
|
768
|
+
return !p.constructor || !p.constructor.name ? l : p.constructor.name;
|
|
769
|
+
}
|
|
770
|
+
return f.checkPropTypes = o, f.resetWarningCache = o.resetWarningCache, f.PropTypes = f, f;
|
|
771
|
+
}, be;
|
|
772
|
+
}
|
|
773
|
+
var Se, ze;
|
|
774
|
+
function nr() {
|
|
775
|
+
if (ze) return Se;
|
|
776
|
+
ze = 1;
|
|
777
|
+
var t = Ae();
|
|
778
|
+
function i() {
|
|
779
|
+
}
|
|
780
|
+
function a() {
|
|
781
|
+
}
|
|
782
|
+
return a.resetWarningCache = i, Se = function() {
|
|
783
|
+
function s(m, h, e, n, r, c) {
|
|
784
|
+
if (c !== t) {
|
|
785
|
+
var l = new Error(
|
|
786
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
787
|
+
);
|
|
788
|
+
throw l.name = "Invariant Violation", l;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
s.isRequired = s;
|
|
792
|
+
function o() {
|
|
793
|
+
return s;
|
|
794
|
+
}
|
|
795
|
+
var u = {
|
|
796
|
+
array: s,
|
|
797
|
+
bigint: s,
|
|
798
|
+
bool: s,
|
|
799
|
+
func: s,
|
|
800
|
+
number: s,
|
|
801
|
+
object: s,
|
|
802
|
+
string: s,
|
|
803
|
+
symbol: s,
|
|
804
|
+
any: s,
|
|
805
|
+
arrayOf: o,
|
|
806
|
+
element: s,
|
|
807
|
+
elementType: s,
|
|
808
|
+
instanceOf: o,
|
|
809
|
+
node: s,
|
|
810
|
+
objectOf: o,
|
|
811
|
+
oneOf: o,
|
|
812
|
+
oneOfType: o,
|
|
813
|
+
shape: o,
|
|
814
|
+
exact: o,
|
|
815
|
+
checkPropTypes: a,
|
|
816
|
+
resetWarningCache: i
|
|
817
|
+
};
|
|
818
|
+
return u.PropTypes = u, u;
|
|
819
|
+
}, Se;
|
|
820
|
+
}
|
|
821
|
+
if (process.env.NODE_ENV !== "production") {
|
|
822
|
+
var or = Ge(), ir = !0;
|
|
823
|
+
_e.exports = rr()(or.isElement, ir);
|
|
824
|
+
} else
|
|
825
|
+
_e.exports = nr()();
|
|
826
|
+
var U = _e.exports;
|
|
827
|
+
function Xe(t, i) {
|
|
828
|
+
if (!(t instanceof i))
|
|
829
|
+
throw new TypeError("Cannot call a class as a function");
|
|
830
|
+
}
|
|
831
|
+
function ar(t, i) {
|
|
832
|
+
for (var a = 0; a < i.length; a++) {
|
|
833
|
+
var s = i[a];
|
|
834
|
+
s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(t, s.key, s);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
function Je(t, i, a) {
|
|
838
|
+
return i && ar(t.prototype, i), t;
|
|
839
|
+
}
|
|
840
|
+
function et(t, i) {
|
|
841
|
+
if (typeof i != "function" && i !== null)
|
|
842
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
843
|
+
t.prototype = Object.create(i && i.prototype, {
|
|
844
|
+
constructor: {
|
|
845
|
+
value: t,
|
|
846
|
+
writable: !0,
|
|
847
|
+
configurable: !0
|
|
848
|
+
}
|
|
849
|
+
}), i && Pe(t, i);
|
|
850
|
+
}
|
|
851
|
+
function ve(t) {
|
|
852
|
+
return ve = Object.setPrototypeOf ? Object.getPrototypeOf : function(a) {
|
|
853
|
+
return a.__proto__ || Object.getPrototypeOf(a);
|
|
854
|
+
}, ve(t);
|
|
855
|
+
}
|
|
856
|
+
function Pe(t, i) {
|
|
857
|
+
return Pe = Object.setPrototypeOf || function(s, o) {
|
|
858
|
+
return s.__proto__ = o, s;
|
|
859
|
+
}, Pe(t, i);
|
|
860
|
+
}
|
|
861
|
+
function sr() {
|
|
862
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
863
|
+
if (typeof Proxy == "function") return !0;
|
|
864
|
+
try {
|
|
865
|
+
return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
|
|
866
|
+
})), !0;
|
|
867
|
+
} catch {
|
|
868
|
+
return !1;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
function cr(t) {
|
|
872
|
+
if (t === void 0)
|
|
873
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
874
|
+
return t;
|
|
875
|
+
}
|
|
876
|
+
function lr(t, i) {
|
|
877
|
+
return i && (typeof i == "object" || typeof i == "function") ? i : cr(t);
|
|
878
|
+
}
|
|
879
|
+
function tt(t) {
|
|
880
|
+
var i = sr();
|
|
881
|
+
return function() {
|
|
882
|
+
var s = ve(t), o;
|
|
883
|
+
if (i) {
|
|
884
|
+
var u = ve(this).constructor;
|
|
885
|
+
o = Reflect.construct(s, arguments, u);
|
|
886
|
+
} else
|
|
887
|
+
o = s.apply(this, arguments);
|
|
888
|
+
return lr(this, o);
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
function ur(t) {
|
|
892
|
+
return fr(t) || dr(t) || pr(t) || hr();
|
|
893
|
+
}
|
|
894
|
+
function fr(t) {
|
|
895
|
+
if (Array.isArray(t)) return Me(t);
|
|
896
|
+
}
|
|
897
|
+
function dr(t) {
|
|
898
|
+
if (typeof Symbol < "u" && Symbol.iterator in Object(t)) return Array.from(t);
|
|
899
|
+
}
|
|
900
|
+
function pr(t, i) {
|
|
901
|
+
if (t) {
|
|
902
|
+
if (typeof t == "string") return Me(t, i);
|
|
903
|
+
var a = Object.prototype.toString.call(t).slice(8, -1);
|
|
904
|
+
if (a === "Object" && t.constructor && (a = t.constructor.name), a === "Map" || a === "Set") return Array.from(t);
|
|
905
|
+
if (a === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)) return Me(t, i);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
function Me(t, i) {
|
|
909
|
+
(i == null || i > t.length) && (i = t.length);
|
|
910
|
+
for (var a = 0, s = new Array(i); a < i; a++) s[a] = t[a];
|
|
911
|
+
return s;
|
|
912
|
+
}
|
|
913
|
+
function hr() {
|
|
914
|
+
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
915
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
916
|
+
}
|
|
917
|
+
function fe(t) {
|
|
918
|
+
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 2, a = String(t);
|
|
919
|
+
if (i === 0) return a;
|
|
920
|
+
var s = a.match(/(.*?)([0-9]+)(.*)/), o = s ? s[1] : "", u = s ? s[3] : "", m = s ? s[2] : a, h = m.length >= i ? m : (ur(Array(i)).map(function() {
|
|
921
|
+
return "0";
|
|
922
|
+
}).join("") + m).slice(i * -1);
|
|
923
|
+
return "".concat(o).concat(h).concat(u);
|
|
924
|
+
}
|
|
925
|
+
var rt = {
|
|
926
|
+
daysInHours: !1,
|
|
927
|
+
zeroPadTime: 2
|
|
928
|
+
};
|
|
929
|
+
function mr(t) {
|
|
930
|
+
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = i.now, s = a === void 0 ? Date.now : a, o = i.precision, u = o === void 0 ? 0 : o, m = i.controlled, h = i.offsetTime, e = h === void 0 ? 0 : h, n = i.overtime, r;
|
|
931
|
+
typeof t == "string" ? r = new Date(t).getTime() : t instanceof Date ? r = t.getTime() : r = t, m || (r += e);
|
|
932
|
+
var c = m ? r : r - s(), l = Math.min(20, Math.max(0, u)), f = Math.round(parseFloat(((n ? c : Math.max(0, c)) / 1e3).toFixed(l)) * 1e3), d = Math.abs(f) / 1e3;
|
|
933
|
+
return {
|
|
934
|
+
total: f,
|
|
935
|
+
days: Math.floor(d / (3600 * 24)),
|
|
936
|
+
hours: Math.floor(d / 3600 % 24),
|
|
937
|
+
minutes: Math.floor(d / 60 % 60),
|
|
938
|
+
seconds: Math.floor(d % 60),
|
|
939
|
+
milliseconds: Number((d % 1 * 1e3).toFixed()),
|
|
940
|
+
completed: f <= 0
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
function vr(t, i) {
|
|
944
|
+
var a = t.days, s = t.hours, o = t.minutes, u = t.seconds, m = Object.assign(Object.assign({}, rt), i), h = m.daysInHours, e = m.zeroPadTime, n = m.zeroPadDays, r = n === void 0 ? e : n, c = Math.min(2, e), l = h ? fe(s + a * 24, e) : fe(s, c);
|
|
945
|
+
return {
|
|
946
|
+
days: h ? "" : fe(a, r),
|
|
947
|
+
hours: l,
|
|
948
|
+
minutes: fe(o, c),
|
|
949
|
+
seconds: fe(u, c)
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
var nt = function(t) {
|
|
953
|
+
et(a, t);
|
|
954
|
+
var i = tt(a);
|
|
955
|
+
function a() {
|
|
956
|
+
var s;
|
|
957
|
+
return Xe(this, a), s = i.apply(this, arguments), s.state = {
|
|
958
|
+
count: s.props.count || 3
|
|
959
|
+
}, s.startCountdown = function() {
|
|
960
|
+
s.interval = window.setInterval(function() {
|
|
961
|
+
var o = s.state.count - 1;
|
|
962
|
+
o === 0 ? (s.stopCountdown(), s.props.onComplete && s.props.onComplete()) : s.setState(function(u) {
|
|
963
|
+
return {
|
|
964
|
+
count: u.count - 1
|
|
965
|
+
};
|
|
966
|
+
});
|
|
967
|
+
}, 1e3);
|
|
968
|
+
}, s.stopCountdown = function() {
|
|
969
|
+
clearInterval(s.interval);
|
|
970
|
+
}, s.addTime = function(o) {
|
|
971
|
+
s.stopCountdown(), s.setState(function(u) {
|
|
972
|
+
return {
|
|
973
|
+
count: u.count + o
|
|
974
|
+
};
|
|
975
|
+
}, s.startCountdown);
|
|
976
|
+
}, s;
|
|
977
|
+
}
|
|
978
|
+
return Je(a, [{
|
|
979
|
+
key: "componentDidMount",
|
|
980
|
+
value: function() {
|
|
981
|
+
this.startCountdown();
|
|
982
|
+
}
|
|
983
|
+
}, {
|
|
984
|
+
key: "componentWillUnmount",
|
|
985
|
+
value: function() {
|
|
986
|
+
clearInterval(this.interval);
|
|
987
|
+
}
|
|
988
|
+
}, {
|
|
989
|
+
key: "render",
|
|
990
|
+
value: function() {
|
|
991
|
+
return this.props.children ? Ve(this.props.children, {
|
|
992
|
+
count: this.state.count
|
|
993
|
+
}) : null;
|
|
994
|
+
}
|
|
995
|
+
}]), a;
|
|
996
|
+
}(qe);
|
|
997
|
+
nt.propTypes = {
|
|
998
|
+
count: U.number,
|
|
999
|
+
children: U.element,
|
|
1000
|
+
onComplete: U.func
|
|
1001
|
+
};
|
|
1002
|
+
var ke = function(t) {
|
|
1003
|
+
et(a, t);
|
|
1004
|
+
var i = tt(a);
|
|
1005
|
+
function a(s) {
|
|
1006
|
+
var o;
|
|
1007
|
+
if (Xe(this, a), o = i.call(this, s), o.mounted = !1, o.initialTimestamp = o.calcOffsetStartTimestamp(), o.offsetStartTimestamp = o.props.autoStart ? 0 : o.initialTimestamp, o.offsetTime = 0, o.legacyMode = !1, o.legacyCountdownRef = null, o.tick = function() {
|
|
1008
|
+
var m = o.calcTimeDelta(), h = m.completed && !o.props.overtime ? void 0 : o.props.onTick;
|
|
1009
|
+
o.setTimeDeltaState(m, void 0, h);
|
|
1010
|
+
}, o.setLegacyCountdownRef = function(m) {
|
|
1011
|
+
o.legacyCountdownRef = m;
|
|
1012
|
+
}, o.start = function() {
|
|
1013
|
+
if (!o.isStarted()) {
|
|
1014
|
+
var m = o.offsetStartTimestamp;
|
|
1015
|
+
o.offsetStartTimestamp = 0, o.offsetTime += m ? o.calcOffsetStartTimestamp() - m : 0;
|
|
1016
|
+
var h = o.calcTimeDelta();
|
|
1017
|
+
o.setTimeDeltaState(h, "STARTED", o.props.onStart), !o.props.controlled && (!h.completed || o.props.overtime) && (o.clearTimer(), o.interval = window.setInterval(o.tick, o.props.intervalDelay));
|
|
1018
|
+
}
|
|
1019
|
+
}, o.pause = function() {
|
|
1020
|
+
o.isPaused() || (o.clearTimer(), o.offsetStartTimestamp = o.calcOffsetStartTimestamp(), o.setTimeDeltaState(o.state.timeDelta, "PAUSED", o.props.onPause));
|
|
1021
|
+
}, o.stop = function() {
|
|
1022
|
+
o.isStopped() || (o.clearTimer(), o.offsetStartTimestamp = o.calcOffsetStartTimestamp(), o.offsetTime = o.offsetStartTimestamp - o.initialTimestamp, o.setTimeDeltaState(o.calcTimeDelta(), "STOPPED", o.props.onStop));
|
|
1023
|
+
}, o.isStarted = function() {
|
|
1024
|
+
return o.isStatus("STARTED");
|
|
1025
|
+
}, o.isPaused = function() {
|
|
1026
|
+
return o.isStatus("PAUSED");
|
|
1027
|
+
}, o.isStopped = function() {
|
|
1028
|
+
return o.isStatus("STOPPED");
|
|
1029
|
+
}, o.isCompleted = function() {
|
|
1030
|
+
return o.isStatus("COMPLETED");
|
|
1031
|
+
}, s.date) {
|
|
1032
|
+
var u = o.calcTimeDelta();
|
|
1033
|
+
o.state = {
|
|
1034
|
+
timeDelta: u,
|
|
1035
|
+
status: u.completed ? "COMPLETED" : "STOPPED"
|
|
1036
|
+
};
|
|
1037
|
+
} else
|
|
1038
|
+
o.legacyMode = !0;
|
|
1039
|
+
return o;
|
|
1040
|
+
}
|
|
1041
|
+
return Je(a, [{
|
|
1042
|
+
key: "componentDidMount",
|
|
1043
|
+
value: function() {
|
|
1044
|
+
this.legacyMode || (this.mounted = !0, this.props.onMount && this.props.onMount(this.calcTimeDelta()), this.props.autoStart && this.start());
|
|
1045
|
+
}
|
|
1046
|
+
}, {
|
|
1047
|
+
key: "componentDidUpdate",
|
|
1048
|
+
value: function(o) {
|
|
1049
|
+
this.legacyMode || this.props.date !== o.date && (this.initialTimestamp = this.calcOffsetStartTimestamp(), this.offsetStartTimestamp = this.initialTimestamp, this.offsetTime = 0, this.setTimeDeltaState(this.calcTimeDelta()));
|
|
1050
|
+
}
|
|
1051
|
+
}, {
|
|
1052
|
+
key: "componentWillUnmount",
|
|
1053
|
+
value: function() {
|
|
1054
|
+
this.legacyMode || (this.mounted = !1, this.clearTimer());
|
|
1055
|
+
}
|
|
1056
|
+
}, {
|
|
1057
|
+
key: "calcTimeDelta",
|
|
1058
|
+
value: function() {
|
|
1059
|
+
var o = this.props, u = o.date, m = o.now, h = o.precision, e = o.controlled, n = o.overtime;
|
|
1060
|
+
return mr(u, {
|
|
1061
|
+
now: m,
|
|
1062
|
+
precision: h,
|
|
1063
|
+
controlled: e,
|
|
1064
|
+
offsetTime: this.offsetTime,
|
|
1065
|
+
overtime: n
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
}, {
|
|
1069
|
+
key: "calcOffsetStartTimestamp",
|
|
1070
|
+
value: function() {
|
|
1071
|
+
return Date.now();
|
|
1072
|
+
}
|
|
1073
|
+
}, {
|
|
1074
|
+
key: "addTime",
|
|
1075
|
+
value: function(o) {
|
|
1076
|
+
this.legacyCountdownRef.addTime(o);
|
|
1077
|
+
}
|
|
1078
|
+
}, {
|
|
1079
|
+
key: "clearTimer",
|
|
1080
|
+
value: function() {
|
|
1081
|
+
window.clearInterval(this.interval);
|
|
1082
|
+
}
|
|
1083
|
+
}, {
|
|
1084
|
+
key: "isStatus",
|
|
1085
|
+
value: function(o) {
|
|
1086
|
+
return this.state.status === o;
|
|
1087
|
+
}
|
|
1088
|
+
}, {
|
|
1089
|
+
key: "setTimeDeltaState",
|
|
1090
|
+
value: function(o, u, m) {
|
|
1091
|
+
var h = this;
|
|
1092
|
+
if (this.mounted) {
|
|
1093
|
+
var e = o.completed && !this.state.timeDelta.completed, n = o.completed && u === "STARTED";
|
|
1094
|
+
e && !this.props.overtime && this.clearTimer();
|
|
1095
|
+
var r = function() {
|
|
1096
|
+
m && m(h.state.timeDelta), h.props.onComplete && (e || n) && h.props.onComplete(o, n);
|
|
1097
|
+
};
|
|
1098
|
+
return this.setState(function(c) {
|
|
1099
|
+
var l = u || c.status;
|
|
1100
|
+
return o.completed && !h.props.overtime ? l = "COMPLETED" : !u && l === "COMPLETED" && (l = "STOPPED"), {
|
|
1101
|
+
timeDelta: o,
|
|
1102
|
+
status: l
|
|
1103
|
+
};
|
|
1104
|
+
}, r);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
}, {
|
|
1108
|
+
key: "getApi",
|
|
1109
|
+
value: function() {
|
|
1110
|
+
return this.api = this.api || {
|
|
1111
|
+
start: this.start,
|
|
1112
|
+
pause: this.pause,
|
|
1113
|
+
stop: this.stop,
|
|
1114
|
+
isStarted: this.isStarted,
|
|
1115
|
+
isPaused: this.isPaused,
|
|
1116
|
+
isStopped: this.isStopped,
|
|
1117
|
+
isCompleted: this.isCompleted
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
}, {
|
|
1121
|
+
key: "getRenderProps",
|
|
1122
|
+
value: function() {
|
|
1123
|
+
var o = this.props, u = o.daysInHours, m = o.zeroPadTime, h = o.zeroPadDays, e = this.state.timeDelta;
|
|
1124
|
+
return Object.assign(Object.assign({}, e), {
|
|
1125
|
+
api: this.getApi(),
|
|
1126
|
+
props: this.props,
|
|
1127
|
+
formatted: vr(e, {
|
|
1128
|
+
daysInHours: u,
|
|
1129
|
+
zeroPadTime: m,
|
|
1130
|
+
zeroPadDays: h
|
|
1131
|
+
})
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
}, {
|
|
1135
|
+
key: "render",
|
|
1136
|
+
value: function() {
|
|
1137
|
+
if (this.legacyMode) {
|
|
1138
|
+
var o = this.props, u = o.count, m = o.children, h = o.onComplete;
|
|
1139
|
+
return De(nt, {
|
|
1140
|
+
ref: this.setLegacyCountdownRef,
|
|
1141
|
+
count: u,
|
|
1142
|
+
onComplete: h
|
|
1143
|
+
}, m);
|
|
1144
|
+
}
|
|
1145
|
+
var e = this.props, n = e.className, r = e.overtime, c = e.children, l = e.renderer, f = this.getRenderProps();
|
|
1146
|
+
if (l)
|
|
1147
|
+
return l(f);
|
|
1148
|
+
if (c && this.state.timeDelta.completed && !r)
|
|
1149
|
+
return Ve(c, {
|
|
1150
|
+
countdown: f
|
|
1151
|
+
});
|
|
1152
|
+
var d = f.formatted, g = d.days, E = d.hours, D = d.minutes, $ = d.seconds;
|
|
1153
|
+
return De("span", {
|
|
1154
|
+
className: n
|
|
1155
|
+
}, f.total < 0 ? "-" : "", g, g ? ":" : "", E, ":", D, ":", $);
|
|
1156
|
+
}
|
|
1157
|
+
}]), a;
|
|
1158
|
+
}(qe);
|
|
1159
|
+
ke.defaultProps = Object.assign(Object.assign({}, rt), {
|
|
1160
|
+
controlled: !1,
|
|
1161
|
+
intervalDelay: 1e3,
|
|
1162
|
+
precision: 0,
|
|
1163
|
+
autoStart: !0
|
|
1164
|
+
});
|
|
1165
|
+
ke.propTypes = {
|
|
1166
|
+
date: U.oneOfType([U.instanceOf(Date), U.string, U.number]),
|
|
1167
|
+
daysInHours: U.bool,
|
|
1168
|
+
zeroPadTime: U.number,
|
|
1169
|
+
zeroPadDays: U.number,
|
|
1170
|
+
controlled: U.bool,
|
|
1171
|
+
intervalDelay: U.number,
|
|
1172
|
+
precision: U.number,
|
|
1173
|
+
autoStart: U.bool,
|
|
1174
|
+
overtime: U.bool,
|
|
1175
|
+
className: U.string,
|
|
1176
|
+
children: U.element,
|
|
1177
|
+
renderer: U.func,
|
|
1178
|
+
now: U.func,
|
|
1179
|
+
onMount: U.func,
|
|
1180
|
+
onStart: U.func,
|
|
1181
|
+
onPause: U.func,
|
|
1182
|
+
onStop: U.func,
|
|
1183
|
+
onTick: U.func,
|
|
1184
|
+
onComplete: U.func
|
|
1185
|
+
};
|
|
1186
|
+
const yr = ({ locale: t = X.UK, start: i, setIsTimeOver: a }) => {
|
|
1187
|
+
const s = new ee({
|
|
1188
|
+
uk: {
|
|
1189
|
+
timerTitle: "Ви маєте обмежений час для переходу в застосунок Дія"
|
|
1190
|
+
},
|
|
1191
|
+
ru: {
|
|
1192
|
+
timerTitle: "У вас есть ограниченное время для перехода в приложение Дія"
|
|
1193
|
+
}
|
|
1194
|
+
});
|
|
1195
|
+
s.setLanguage(t);
|
|
1196
|
+
const o = (u) => {
|
|
1197
|
+
const { seconds: m, completed: h, minutes: e } = u;
|
|
1198
|
+
return h ? (a(!0), null) : /* @__PURE__ */ b("div", { children: `${e}:${m > 9 ? m : `0${m}`}` });
|
|
1199
|
+
};
|
|
1200
|
+
return /* @__PURE__ */ z("div", { className: N.timerBlock, children: [
|
|
1201
|
+
/* @__PURE__ */ b("div", { className: N.timer, children: /* @__PURE__ */ b(
|
|
1202
|
+
ke,
|
|
1203
|
+
{
|
|
1204
|
+
date: i,
|
|
1205
|
+
renderer: o
|
|
1206
|
+
}
|
|
1207
|
+
) }),
|
|
1208
|
+
/* @__PURE__ */ b("div", { className: N.timerTitle, children: s.timerTitle })
|
|
1209
|
+
] });
|
|
1210
|
+
}, gr = ({ locale: t = X.UK }) => {
|
|
1211
|
+
const i = new ee({
|
|
1212
|
+
uk: {
|
|
1213
|
+
timeOver: "Упс, ваш час минув",
|
|
1214
|
+
tryAgain: "Спробуйте ще раз або скористайтеся іншим способом ідентифікації."
|
|
1215
|
+
},
|
|
1216
|
+
ru: {
|
|
1217
|
+
timeOver: "Упс, ваше время прошло",
|
|
1218
|
+
tryAgain: "Попробуйте снова или воспользуйтесь другим способом идентификации."
|
|
1219
|
+
}
|
|
1220
|
+
});
|
|
1221
|
+
return i.setLanguage(t), /* @__PURE__ */ z("div", { className: N.timeOverBlock, children: [
|
|
1222
|
+
/* @__PURE__ */ b("p", { children: i.timeOver }),
|
|
1223
|
+
/* @__PURE__ */ b("p", { children: i.tryAgain })
|
|
1224
|
+
] });
|
|
1225
|
+
}, Er = ({ locale: t = X.UK }) => {
|
|
1226
|
+
const i = new ee({
|
|
1227
|
+
uk: {
|
|
1228
|
+
title: "Переконайтесь, що завантажена остання версія застосунку Дія"
|
|
1229
|
+
},
|
|
1230
|
+
ru: {
|
|
1231
|
+
title: "Убедитесь, что загружена последняя версия приложения Дія"
|
|
1232
|
+
}
|
|
1233
|
+
});
|
|
1234
|
+
return i.setLanguage(t), /* @__PURE__ */ z("div", { className: N.titleBlock, children: [
|
|
1235
|
+
/* @__PURE__ */ z("svg", { xmlns: "http://www.w3.org/2000/svg", width: "25", height: "24", viewBox: "0 0 25 24", fill: "none", children: [
|
|
1236
|
+
/* @__PURE__ */ b("circle", { cx: "12.5", cy: "12", r: "12", fill: "#FFD63B" }),
|
|
1237
|
+
/* @__PURE__ */ b(
|
|
1238
|
+
"path",
|
|
1239
|
+
{
|
|
1240
|
+
d: "M13.8189 5.21875V10.4936C13.8189 11.0592 13.7863 11.6217 13.7211 12.1812C13.6559 12.7345 13.5699 13.3001 13.4632 13.878H11.5956C11.4889 13.3001 11.4029 12.7345 11.3377 12.1812C11.2725 11.6217 11.2399 11.0592 11.2399 10.4936V5.21875H13.8189ZM10.9375 17.207C10.9375 16.9857 10.976 16.7798 11.0531 16.5892C11.1361 16.3986 11.2458 16.2326 11.3822 16.0912C11.5245 15.9498 11.6905 15.8391 11.8802 15.7592C12.0699 15.6732 12.2774 15.6301 12.5027 15.6301C12.7221 15.6301 12.9266 15.6732 13.1164 15.7592C13.3061 15.8391 13.4721 15.9498 13.6144 16.0912C13.7567 16.2326 13.8664 16.3986 13.9434 16.5892C14.0264 16.7798 14.0679 16.9857 14.0679 17.207C14.0679 17.4284 14.0264 17.6374 13.9434 17.8341C13.8664 18.0247 13.7567 18.1907 13.6144 18.3321C13.4721 18.4735 13.3061 18.5842 13.1164 18.6641C12.9266 18.744 12.7221 18.784 12.5027 18.784C12.2774 18.784 12.0699 18.744 11.8802 18.6641C11.6905 18.5842 11.5245 18.4735 11.3822 18.3321C11.2458 18.1907 11.1361 18.0247 11.0531 17.8341C10.976 17.6374 10.9375 17.4284 10.9375 17.207Z",
|
|
1241
|
+
fill: "#2D2B2B"
|
|
1242
|
+
}
|
|
1243
|
+
)
|
|
1244
|
+
] }),
|
|
1245
|
+
/* @__PURE__ */ b("p", { children: i.title })
|
|
1246
|
+
] });
|
|
1247
|
+
}, Tr = ({ locale: t = X.UK }) => {
|
|
1248
|
+
const i = new ee({
|
|
1249
|
+
uk: {
|
|
1250
|
+
loaderTitleDesk: "Очікуйте завантаження QR-коду",
|
|
1251
|
+
loaderTitleMob: "Очікуйте переходу до застосунку Дія"
|
|
1252
|
+
},
|
|
1253
|
+
ru: {
|
|
1254
|
+
loaderTitleDesk: "Ожидайте загрузку QR-кода",
|
|
1255
|
+
loaderTitleMob: "Ожидайте перехода в приложение Дія"
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
return i.setLanguage(t), /* @__PURE__ */ z("div", { className: N.loaderBlock, children: [
|
|
1259
|
+
/* @__PURE__ */ b("p", { className: N.loaderTitle, children: K ? i.loaderTitleMob : i.loaderTitleDesk }),
|
|
1260
|
+
/* @__PURE__ */ b("div", { className: N.loaderSpinner, children: /* @__PURE__ */ b(vt, { className: N.spinner }) })
|
|
1261
|
+
] });
|
|
1262
|
+
};
|
|
1263
|
+
var Cr = Object.defineProperty, ye = Object.getOwnPropertySymbols, ot = Object.prototype.hasOwnProperty, it = Object.prototype.propertyIsEnumerable, He = (t, i, a) => i in t ? Cr(t, i, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[i] = a, Re = (t, i) => {
|
|
1264
|
+
for (var a in i || (i = {}))
|
|
1265
|
+
ot.call(i, a) && He(t, a, i[a]);
|
|
1266
|
+
if (ye)
|
|
1267
|
+
for (var a of ye(i))
|
|
1268
|
+
it.call(i, a) && He(t, a, i[a]);
|
|
1269
|
+
return t;
|
|
1270
|
+
}, Oe = (t, i) => {
|
|
1271
|
+
var a = {};
|
|
1272
|
+
for (var s in t)
|
|
1273
|
+
ot.call(t, s) && i.indexOf(s) < 0 && (a[s] = t[s]);
|
|
1274
|
+
if (t != null && ye)
|
|
1275
|
+
for (var s of ye(t))
|
|
1276
|
+
i.indexOf(s) < 0 && it.call(t, s) && (a[s] = t[s]);
|
|
1277
|
+
return a;
|
|
1278
|
+
};
|
|
1279
|
+
/**
|
|
1280
|
+
* @license QR Code generator library (TypeScript)
|
|
1281
|
+
* Copyright (c) Project Nayuki.
|
|
1282
|
+
* SPDX-License-Identifier: MIT
|
|
1283
|
+
*/
|
|
1284
|
+
var ie;
|
|
1285
|
+
((t) => {
|
|
1286
|
+
const i = class R {
|
|
1287
|
+
/*-- Constructor (low level) and fields --*/
|
|
1288
|
+
// Creates a new QR Code with the given version number,
|
|
1289
|
+
// error correction level, data codeword bytes, and mask number.
|
|
1290
|
+
// This is a low-level API that most users should not use directly.
|
|
1291
|
+
// A mid-level API is the encodeSegments() function.
|
|
1292
|
+
constructor(e, n, r, c) {
|
|
1293
|
+
if (this.version = e, this.errorCorrectionLevel = n, this.modules = [], this.isFunction = [], e < R.MIN_VERSION || e > R.MAX_VERSION)
|
|
1294
|
+
throw new RangeError("Version value out of range");
|
|
1295
|
+
if (c < -1 || c > 7)
|
|
1296
|
+
throw new RangeError("Mask value out of range");
|
|
1297
|
+
this.size = e * 4 + 17;
|
|
1298
|
+
let l = [];
|
|
1299
|
+
for (let d = 0; d < this.size; d++)
|
|
1300
|
+
l.push(!1);
|
|
1301
|
+
for (let d = 0; d < this.size; d++)
|
|
1302
|
+
this.modules.push(l.slice()), this.isFunction.push(l.slice());
|
|
1303
|
+
this.drawFunctionPatterns();
|
|
1304
|
+
const f = this.addEccAndInterleave(r);
|
|
1305
|
+
if (this.drawCodewords(f), c == -1) {
|
|
1306
|
+
let d = 1e9;
|
|
1307
|
+
for (let g = 0; g < 8; g++) {
|
|
1308
|
+
this.applyMask(g), this.drawFormatBits(g);
|
|
1309
|
+
const E = this.getPenaltyScore();
|
|
1310
|
+
E < d && (c = g, d = E), this.applyMask(g);
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
o(0 <= c && c <= 7), this.mask = c, this.applyMask(c), this.drawFormatBits(c), this.isFunction = [];
|
|
1314
|
+
}
|
|
1315
|
+
/*-- Static factory functions (high level) --*/
|
|
1316
|
+
// Returns a QR Code representing the given Unicode text string at the given error correction level.
|
|
1317
|
+
// As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer
|
|
1318
|
+
// Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
|
|
1319
|
+
// QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
|
|
1320
|
+
// ecl argument if it can be done without increasing the version.
|
|
1321
|
+
static encodeText(e, n) {
|
|
1322
|
+
const r = t.QrSegment.makeSegments(e);
|
|
1323
|
+
return R.encodeSegments(r, n);
|
|
1324
|
+
}
|
|
1325
|
+
// Returns a QR Code representing the given binary data at the given error correction level.
|
|
1326
|
+
// This function always encodes using the binary segment mode, not any text mode. The maximum number of
|
|
1327
|
+
// bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
|
|
1328
|
+
// The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
|
|
1329
|
+
static encodeBinary(e, n) {
|
|
1330
|
+
const r = t.QrSegment.makeBytes(e);
|
|
1331
|
+
return R.encodeSegments([r], n);
|
|
1332
|
+
}
|
|
1333
|
+
/*-- Static factory functions (mid level) --*/
|
|
1334
|
+
// Returns a QR Code representing the given segments with the given encoding parameters.
|
|
1335
|
+
// The smallest possible QR Code version within the given range is automatically
|
|
1336
|
+
// chosen for the output. Iff boostEcl is true, then the ECC level of the result
|
|
1337
|
+
// may be higher than the ecl argument if it can be done without increasing the
|
|
1338
|
+
// version. The mask number is either between 0 to 7 (inclusive) to force that
|
|
1339
|
+
// mask, or -1 to automatically choose an appropriate mask (which may be slow).
|
|
1340
|
+
// This function allows the user to create a custom sequence of segments that switches
|
|
1341
|
+
// between modes (such as alphanumeric and byte) to encode text in less space.
|
|
1342
|
+
// This is a mid-level API; the high-level API is encodeText() and encodeBinary().
|
|
1343
|
+
static encodeSegments(e, n, r = 1, c = 40, l = -1, f = !0) {
|
|
1344
|
+
if (!(R.MIN_VERSION <= r && r <= c && c <= R.MAX_VERSION) || l < -1 || l > 7)
|
|
1345
|
+
throw new RangeError("Invalid value");
|
|
1346
|
+
let d, g;
|
|
1347
|
+
for (d = r; ; d++) {
|
|
1348
|
+
const C = R.getNumDataCodewords(d, n) * 8, S = m.getTotalBits(e, d);
|
|
1349
|
+
if (S <= C) {
|
|
1350
|
+
g = S;
|
|
1351
|
+
break;
|
|
1352
|
+
}
|
|
1353
|
+
if (d >= c)
|
|
1354
|
+
throw new RangeError("Data too long");
|
|
1355
|
+
}
|
|
1356
|
+
for (const C of [R.Ecc.MEDIUM, R.Ecc.QUARTILE, R.Ecc.HIGH])
|
|
1357
|
+
f && g <= R.getNumDataCodewords(d, C) * 8 && (n = C);
|
|
1358
|
+
let E = [];
|
|
1359
|
+
for (const C of e) {
|
|
1360
|
+
a(C.mode.modeBits, 4, E), a(C.numChars, C.mode.numCharCountBits(d), E);
|
|
1361
|
+
for (const S of C.getData())
|
|
1362
|
+
E.push(S);
|
|
1363
|
+
}
|
|
1364
|
+
o(E.length == g);
|
|
1365
|
+
const D = R.getNumDataCodewords(d, n) * 8;
|
|
1366
|
+
o(E.length <= D), a(0, Math.min(4, D - E.length), E), a(0, (8 - E.length % 8) % 8, E), o(E.length % 8 == 0);
|
|
1367
|
+
for (let C = 236; E.length < D; C ^= 253)
|
|
1368
|
+
a(C, 8, E);
|
|
1369
|
+
let $ = [];
|
|
1370
|
+
for (; $.length * 8 < E.length; )
|
|
1371
|
+
$.push(0);
|
|
1372
|
+
return E.forEach((C, S) => $[S >>> 3] |= C << 7 - (S & 7)), new R(d, n, $, l);
|
|
1373
|
+
}
|
|
1374
|
+
/*-- Accessor methods --*/
|
|
1375
|
+
// Returns the color of the module (pixel) at the given coordinates, which is false
|
|
1376
|
+
// for light or true for dark. The top left corner has the coordinates (x=0, y=0).
|
|
1377
|
+
// If the given coordinates are out of bounds, then false (light) is returned.
|
|
1378
|
+
getModule(e, n) {
|
|
1379
|
+
return 0 <= e && e < this.size && 0 <= n && n < this.size && this.modules[n][e];
|
|
1380
|
+
}
|
|
1381
|
+
// Modified to expose modules for easy access
|
|
1382
|
+
getModules() {
|
|
1383
|
+
return this.modules;
|
|
1384
|
+
}
|
|
1385
|
+
/*-- Private helper methods for constructor: Drawing function modules --*/
|
|
1386
|
+
// Reads this object's version field, and draws and marks all function modules.
|
|
1387
|
+
drawFunctionPatterns() {
|
|
1388
|
+
for (let r = 0; r < this.size; r++)
|
|
1389
|
+
this.setFunctionModule(6, r, r % 2 == 0), this.setFunctionModule(r, 6, r % 2 == 0);
|
|
1390
|
+
this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
|
|
1391
|
+
const e = this.getAlignmentPatternPositions(), n = e.length;
|
|
1392
|
+
for (let r = 0; r < n; r++)
|
|
1393
|
+
for (let c = 0; c < n; c++)
|
|
1394
|
+
r == 0 && c == 0 || r == 0 && c == n - 1 || r == n - 1 && c == 0 || this.drawAlignmentPattern(e[r], e[c]);
|
|
1395
|
+
this.drawFormatBits(0), this.drawVersion();
|
|
1396
|
+
}
|
|
1397
|
+
// Draws two copies of the format bits (with its own error correction code)
|
|
1398
|
+
// based on the given mask and this object's error correction level field.
|
|
1399
|
+
drawFormatBits(e) {
|
|
1400
|
+
const n = this.errorCorrectionLevel.formatBits << 3 | e;
|
|
1401
|
+
let r = n;
|
|
1402
|
+
for (let l = 0; l < 10; l++)
|
|
1403
|
+
r = r << 1 ^ (r >>> 9) * 1335;
|
|
1404
|
+
const c = (n << 10 | r) ^ 21522;
|
|
1405
|
+
o(c >>> 15 == 0);
|
|
1406
|
+
for (let l = 0; l <= 5; l++)
|
|
1407
|
+
this.setFunctionModule(8, l, s(c, l));
|
|
1408
|
+
this.setFunctionModule(8, 7, s(c, 6)), this.setFunctionModule(8, 8, s(c, 7)), this.setFunctionModule(7, 8, s(c, 8));
|
|
1409
|
+
for (let l = 9; l < 15; l++)
|
|
1410
|
+
this.setFunctionModule(14 - l, 8, s(c, l));
|
|
1411
|
+
for (let l = 0; l < 8; l++)
|
|
1412
|
+
this.setFunctionModule(this.size - 1 - l, 8, s(c, l));
|
|
1413
|
+
for (let l = 8; l < 15; l++)
|
|
1414
|
+
this.setFunctionModule(8, this.size - 15 + l, s(c, l));
|
|
1415
|
+
this.setFunctionModule(8, this.size - 8, !0);
|
|
1416
|
+
}
|
|
1417
|
+
// Draws two copies of the version bits (with its own error correction code),
|
|
1418
|
+
// based on this object's version field, iff 7 <= version <= 40.
|
|
1419
|
+
drawVersion() {
|
|
1420
|
+
if (this.version < 7)
|
|
1421
|
+
return;
|
|
1422
|
+
let e = this.version;
|
|
1423
|
+
for (let r = 0; r < 12; r++)
|
|
1424
|
+
e = e << 1 ^ (e >>> 11) * 7973;
|
|
1425
|
+
const n = this.version << 12 | e;
|
|
1426
|
+
o(n >>> 18 == 0);
|
|
1427
|
+
for (let r = 0; r < 18; r++) {
|
|
1428
|
+
const c = s(n, r), l = this.size - 11 + r % 3, f = Math.floor(r / 3);
|
|
1429
|
+
this.setFunctionModule(l, f, c), this.setFunctionModule(f, l, c);
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
// Draws a 9*9 finder pattern including the border separator,
|
|
1433
|
+
// with the center module at (x, y). Modules can be out of bounds.
|
|
1434
|
+
drawFinderPattern(e, n) {
|
|
1435
|
+
for (let r = -4; r <= 4; r++)
|
|
1436
|
+
for (let c = -4; c <= 4; c++) {
|
|
1437
|
+
const l = Math.max(Math.abs(c), Math.abs(r)), f = e + c, d = n + r;
|
|
1438
|
+
0 <= f && f < this.size && 0 <= d && d < this.size && this.setFunctionModule(f, d, l != 2 && l != 4);
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
// Draws a 5*5 alignment pattern, with the center module
|
|
1442
|
+
// at (x, y). All modules must be in bounds.
|
|
1443
|
+
drawAlignmentPattern(e, n) {
|
|
1444
|
+
for (let r = -2; r <= 2; r++)
|
|
1445
|
+
for (let c = -2; c <= 2; c++)
|
|
1446
|
+
this.setFunctionModule(e + c, n + r, Math.max(Math.abs(c), Math.abs(r)) != 1);
|
|
1447
|
+
}
|
|
1448
|
+
// Sets the color of a module and marks it as a function module.
|
|
1449
|
+
// Only used by the constructor. Coordinates must be in bounds.
|
|
1450
|
+
setFunctionModule(e, n, r) {
|
|
1451
|
+
this.modules[n][e] = r, this.isFunction[n][e] = !0;
|
|
1452
|
+
}
|
|
1453
|
+
/*-- Private helper methods for constructor: Codewords and masking --*/
|
|
1454
|
+
// Returns a new byte string representing the given data with the appropriate error correction
|
|
1455
|
+
// codewords appended to it, based on this object's version and error correction level.
|
|
1456
|
+
addEccAndInterleave(e) {
|
|
1457
|
+
const n = this.version, r = this.errorCorrectionLevel;
|
|
1458
|
+
if (e.length != R.getNumDataCodewords(n, r))
|
|
1459
|
+
throw new RangeError("Invalid argument");
|
|
1460
|
+
const c = R.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n], l = R.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n], f = Math.floor(R.getNumRawDataModules(n) / 8), d = c - f % c, g = Math.floor(f / c);
|
|
1461
|
+
let E = [];
|
|
1462
|
+
const D = R.reedSolomonComputeDivisor(l);
|
|
1463
|
+
for (let C = 0, S = 0; C < c; C++) {
|
|
1464
|
+
let v = e.slice(S, S + g - l + (C < d ? 0 : 1));
|
|
1465
|
+
S += v.length;
|
|
1466
|
+
const Z = R.reedSolomonComputeRemainder(v, D);
|
|
1467
|
+
C < d && v.push(0), E.push(v.concat(Z));
|
|
1468
|
+
}
|
|
1469
|
+
let $ = [];
|
|
1470
|
+
for (let C = 0; C < E[0].length; C++)
|
|
1471
|
+
E.forEach((S, v) => {
|
|
1472
|
+
(C != g - l || v >= d) && $.push(S[C]);
|
|
1473
|
+
});
|
|
1474
|
+
return o($.length == f), $;
|
|
1475
|
+
}
|
|
1476
|
+
// Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
|
|
1477
|
+
// data area of this QR Code. Function modules need to be marked off before this is called.
|
|
1478
|
+
drawCodewords(e) {
|
|
1479
|
+
if (e.length != Math.floor(R.getNumRawDataModules(this.version) / 8))
|
|
1480
|
+
throw new RangeError("Invalid argument");
|
|
1481
|
+
let n = 0;
|
|
1482
|
+
for (let r = this.size - 1; r >= 1; r -= 2) {
|
|
1483
|
+
r == 6 && (r = 5);
|
|
1484
|
+
for (let c = 0; c < this.size; c++)
|
|
1485
|
+
for (let l = 0; l < 2; l++) {
|
|
1486
|
+
const f = r - l, g = (r + 1 & 2) == 0 ? this.size - 1 - c : c;
|
|
1487
|
+
!this.isFunction[g][f] && n < e.length * 8 && (this.modules[g][f] = s(e[n >>> 3], 7 - (n & 7)), n++);
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
o(n == e.length * 8);
|
|
1491
|
+
}
|
|
1492
|
+
// XORs the codeword modules in this QR Code with the given mask pattern.
|
|
1493
|
+
// The function modules must be marked and the codeword bits must be drawn
|
|
1494
|
+
// before masking. Due to the arithmetic of XOR, calling applyMask() with
|
|
1495
|
+
// the same mask value a second time will undo the mask. A final well-formed
|
|
1496
|
+
// QR Code needs exactly one (not zero, two, etc.) mask applied.
|
|
1497
|
+
applyMask(e) {
|
|
1498
|
+
if (e < 0 || e > 7)
|
|
1499
|
+
throw new RangeError("Mask value out of range");
|
|
1500
|
+
for (let n = 0; n < this.size; n++)
|
|
1501
|
+
for (let r = 0; r < this.size; r++) {
|
|
1502
|
+
let c;
|
|
1503
|
+
switch (e) {
|
|
1504
|
+
case 0:
|
|
1505
|
+
c = (r + n) % 2 == 0;
|
|
1506
|
+
break;
|
|
1507
|
+
case 1:
|
|
1508
|
+
c = n % 2 == 0;
|
|
1509
|
+
break;
|
|
1510
|
+
case 2:
|
|
1511
|
+
c = r % 3 == 0;
|
|
1512
|
+
break;
|
|
1513
|
+
case 3:
|
|
1514
|
+
c = (r + n) % 3 == 0;
|
|
1515
|
+
break;
|
|
1516
|
+
case 4:
|
|
1517
|
+
c = (Math.floor(r / 3) + Math.floor(n / 2)) % 2 == 0;
|
|
1518
|
+
break;
|
|
1519
|
+
case 5:
|
|
1520
|
+
c = r * n % 2 + r * n % 3 == 0;
|
|
1521
|
+
break;
|
|
1522
|
+
case 6:
|
|
1523
|
+
c = (r * n % 2 + r * n % 3) % 2 == 0;
|
|
1524
|
+
break;
|
|
1525
|
+
case 7:
|
|
1526
|
+
c = ((r + n) % 2 + r * n % 3) % 2 == 0;
|
|
1527
|
+
break;
|
|
1528
|
+
default:
|
|
1529
|
+
throw new Error("Unreachable");
|
|
1530
|
+
}
|
|
1531
|
+
!this.isFunction[n][r] && c && (this.modules[n][r] = !this.modules[n][r]);
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
// Calculates and returns the penalty score based on state of this QR Code's current modules.
|
|
1535
|
+
// This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.
|
|
1536
|
+
getPenaltyScore() {
|
|
1537
|
+
let e = 0;
|
|
1538
|
+
for (let l = 0; l < this.size; l++) {
|
|
1539
|
+
let f = !1, d = 0, g = [0, 0, 0, 0, 0, 0, 0];
|
|
1540
|
+
for (let E = 0; E < this.size; E++)
|
|
1541
|
+
this.modules[l][E] == f ? (d++, d == 5 ? e += R.PENALTY_N1 : d > 5 && e++) : (this.finderPenaltyAddHistory(d, g), f || (e += this.finderPenaltyCountPatterns(g) * R.PENALTY_N3), f = this.modules[l][E], d = 1);
|
|
1542
|
+
e += this.finderPenaltyTerminateAndCount(f, d, g) * R.PENALTY_N3;
|
|
1543
|
+
}
|
|
1544
|
+
for (let l = 0; l < this.size; l++) {
|
|
1545
|
+
let f = !1, d = 0, g = [0, 0, 0, 0, 0, 0, 0];
|
|
1546
|
+
for (let E = 0; E < this.size; E++)
|
|
1547
|
+
this.modules[E][l] == f ? (d++, d == 5 ? e += R.PENALTY_N1 : d > 5 && e++) : (this.finderPenaltyAddHistory(d, g), f || (e += this.finderPenaltyCountPatterns(g) * R.PENALTY_N3), f = this.modules[E][l], d = 1);
|
|
1548
|
+
e += this.finderPenaltyTerminateAndCount(f, d, g) * R.PENALTY_N3;
|
|
1549
|
+
}
|
|
1550
|
+
for (let l = 0; l < this.size - 1; l++)
|
|
1551
|
+
for (let f = 0; f < this.size - 1; f++) {
|
|
1552
|
+
const d = this.modules[l][f];
|
|
1553
|
+
d == this.modules[l][f + 1] && d == this.modules[l + 1][f] && d == this.modules[l + 1][f + 1] && (e += R.PENALTY_N2);
|
|
1554
|
+
}
|
|
1555
|
+
let n = 0;
|
|
1556
|
+
for (const l of this.modules)
|
|
1557
|
+
n = l.reduce((f, d) => f + (d ? 1 : 0), n);
|
|
1558
|
+
const r = this.size * this.size, c = Math.ceil(Math.abs(n * 20 - r * 10) / r) - 1;
|
|
1559
|
+
return o(0 <= c && c <= 9), e += c * R.PENALTY_N4, o(0 <= e && e <= 2568888), e;
|
|
1560
|
+
}
|
|
1561
|
+
/*-- Private helper functions --*/
|
|
1562
|
+
// Returns an ascending list of positions of alignment patterns for this version number.
|
|
1563
|
+
// Each position is in the range [0,177), and are used on both the x and y axes.
|
|
1564
|
+
// This could be implemented as lookup table of 40 variable-length lists of integers.
|
|
1565
|
+
getAlignmentPatternPositions() {
|
|
1566
|
+
if (this.version == 1)
|
|
1567
|
+
return [];
|
|
1568
|
+
{
|
|
1569
|
+
const e = Math.floor(this.version / 7) + 2, n = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (e * 2 - 2)) * 2;
|
|
1570
|
+
let r = [6];
|
|
1571
|
+
for (let c = this.size - 7; r.length < e; c -= n)
|
|
1572
|
+
r.splice(1, 0, c);
|
|
1573
|
+
return r;
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
// Returns the number of data bits that can be stored in a QR Code of the given version number, after
|
|
1577
|
+
// all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.
|
|
1578
|
+
// The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.
|
|
1579
|
+
static getNumRawDataModules(e) {
|
|
1580
|
+
if (e < R.MIN_VERSION || e > R.MAX_VERSION)
|
|
1581
|
+
throw new RangeError("Version number out of range");
|
|
1582
|
+
let n = (16 * e + 128) * e + 64;
|
|
1583
|
+
if (e >= 2) {
|
|
1584
|
+
const r = Math.floor(e / 7) + 2;
|
|
1585
|
+
n -= (25 * r - 10) * r - 55, e >= 7 && (n -= 36);
|
|
1586
|
+
}
|
|
1587
|
+
return o(208 <= n && n <= 29648), n;
|
|
1588
|
+
}
|
|
1589
|
+
// Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
|
|
1590
|
+
// QR Code of the given version number and error correction level, with remainder bits discarded.
|
|
1591
|
+
// This stateless pure function could be implemented as a (40*4)-cell lookup table.
|
|
1592
|
+
static getNumDataCodewords(e, n) {
|
|
1593
|
+
return Math.floor(R.getNumRawDataModules(e) / 8) - R.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e] * R.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e];
|
|
1594
|
+
}
|
|
1595
|
+
// Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be
|
|
1596
|
+
// implemented as a lookup table over all possible parameter values, instead of as an algorithm.
|
|
1597
|
+
static reedSolomonComputeDivisor(e) {
|
|
1598
|
+
if (e < 1 || e > 255)
|
|
1599
|
+
throw new RangeError("Degree out of range");
|
|
1600
|
+
let n = [];
|
|
1601
|
+
for (let c = 0; c < e - 1; c++)
|
|
1602
|
+
n.push(0);
|
|
1603
|
+
n.push(1);
|
|
1604
|
+
let r = 1;
|
|
1605
|
+
for (let c = 0; c < e; c++) {
|
|
1606
|
+
for (let l = 0; l < n.length; l++)
|
|
1607
|
+
n[l] = R.reedSolomonMultiply(n[l], r), l + 1 < n.length && (n[l] ^= n[l + 1]);
|
|
1608
|
+
r = R.reedSolomonMultiply(r, 2);
|
|
1609
|
+
}
|
|
1610
|
+
return n;
|
|
1611
|
+
}
|
|
1612
|
+
// Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.
|
|
1613
|
+
static reedSolomonComputeRemainder(e, n) {
|
|
1614
|
+
let r = n.map((c) => 0);
|
|
1615
|
+
for (const c of e) {
|
|
1616
|
+
const l = c ^ r.shift();
|
|
1617
|
+
r.push(0), n.forEach((f, d) => r[d] ^= R.reedSolomonMultiply(f, l));
|
|
1618
|
+
}
|
|
1619
|
+
return r;
|
|
1620
|
+
}
|
|
1621
|
+
// Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result
|
|
1622
|
+
// are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.
|
|
1623
|
+
static reedSolomonMultiply(e, n) {
|
|
1624
|
+
if (e >>> 8 || n >>> 8)
|
|
1625
|
+
throw new RangeError("Byte out of range");
|
|
1626
|
+
let r = 0;
|
|
1627
|
+
for (let c = 7; c >= 0; c--)
|
|
1628
|
+
r = r << 1 ^ (r >>> 7) * 285, r ^= (n >>> c & 1) * e;
|
|
1629
|
+
return o(r >>> 8 == 0), r;
|
|
1630
|
+
}
|
|
1631
|
+
// Can only be called immediately after a light run is added, and
|
|
1632
|
+
// returns either 0, 1, or 2. A helper function for getPenaltyScore().
|
|
1633
|
+
finderPenaltyCountPatterns(e) {
|
|
1634
|
+
const n = e[1];
|
|
1635
|
+
o(n <= this.size * 3);
|
|
1636
|
+
const r = n > 0 && e[2] == n && e[3] == n * 3 && e[4] == n && e[5] == n;
|
|
1637
|
+
return (r && e[0] >= n * 4 && e[6] >= n ? 1 : 0) + (r && e[6] >= n * 4 && e[0] >= n ? 1 : 0);
|
|
1638
|
+
}
|
|
1639
|
+
// Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().
|
|
1640
|
+
finderPenaltyTerminateAndCount(e, n, r) {
|
|
1641
|
+
return e && (this.finderPenaltyAddHistory(n, r), n = 0), n += this.size, this.finderPenaltyAddHistory(n, r), this.finderPenaltyCountPatterns(r);
|
|
1642
|
+
}
|
|
1643
|
+
// Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().
|
|
1644
|
+
finderPenaltyAddHistory(e, n) {
|
|
1645
|
+
n[0] == 0 && (e += this.size), n.pop(), n.unshift(e);
|
|
1646
|
+
}
|
|
1647
|
+
};
|
|
1648
|
+
i.MIN_VERSION = 1, i.MAX_VERSION = 40, i.PENALTY_N1 = 3, i.PENALTY_N2 = 3, i.PENALTY_N3 = 40, i.PENALTY_N4 = 10, i.ECC_CODEWORDS_PER_BLOCK = [
|
|
1649
|
+
// Version: (note that index 0 is for padding, and is set to an illegal value)
|
|
1650
|
+
//0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 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, 36, 37, 38, 39, 40 Error correction level
|
|
1651
|
+
[-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
|
|
1652
|
+
// Low
|
|
1653
|
+
[-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],
|
|
1654
|
+
// Medium
|
|
1655
|
+
[-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
|
|
1656
|
+
// Quartile
|
|
1657
|
+
[-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]
|
|
1658
|
+
// High
|
|
1659
|
+
], i.NUM_ERROR_CORRECTION_BLOCKS = [
|
|
1660
|
+
// Version: (note that index 0 is for padding, and is set to an illegal value)
|
|
1661
|
+
//0, 1, 2, 3, 4, 5, 6, 7, 8, 9,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, 36, 37, 38, 39, 40 Error correction level
|
|
1662
|
+
[-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],
|
|
1663
|
+
// Low
|
|
1664
|
+
[-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],
|
|
1665
|
+
// Medium
|
|
1666
|
+
[-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],
|
|
1667
|
+
// Quartile
|
|
1668
|
+
[-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
|
|
1669
|
+
// High
|
|
1670
|
+
], t.QrCode = i;
|
|
1671
|
+
function a(h, e, n) {
|
|
1672
|
+
if (e < 0 || e > 31 || h >>> e)
|
|
1673
|
+
throw new RangeError("Value out of range");
|
|
1674
|
+
for (let r = e - 1; r >= 0; r--)
|
|
1675
|
+
n.push(h >>> r & 1);
|
|
1676
|
+
}
|
|
1677
|
+
function s(h, e) {
|
|
1678
|
+
return (h >>> e & 1) != 0;
|
|
1679
|
+
}
|
|
1680
|
+
function o(h) {
|
|
1681
|
+
if (!h)
|
|
1682
|
+
throw new Error("Assertion error");
|
|
1683
|
+
}
|
|
1684
|
+
const u = class F {
|
|
1685
|
+
/*-- Constructor (low level) and fields --*/
|
|
1686
|
+
// Creates a new QR Code segment with the given attributes and data.
|
|
1687
|
+
// The character count (numChars) must agree with the mode and the bit buffer length,
|
|
1688
|
+
// but the constraint isn't checked. The given bit buffer is cloned and stored.
|
|
1689
|
+
constructor(e, n, r) {
|
|
1690
|
+
if (this.mode = e, this.numChars = n, this.bitData = r, n < 0)
|
|
1691
|
+
throw new RangeError("Invalid argument");
|
|
1692
|
+
this.bitData = r.slice();
|
|
1693
|
+
}
|
|
1694
|
+
/*-- Static factory functions (mid level) --*/
|
|
1695
|
+
// Returns a segment representing the given binary data encoded in
|
|
1696
|
+
// byte mode. All input byte arrays are acceptable. Any text string
|
|
1697
|
+
// can be converted to UTF-8 bytes and encoded as a byte mode segment.
|
|
1698
|
+
static makeBytes(e) {
|
|
1699
|
+
let n = [];
|
|
1700
|
+
for (const r of e)
|
|
1701
|
+
a(r, 8, n);
|
|
1702
|
+
return new F(F.Mode.BYTE, e.length, n);
|
|
1703
|
+
}
|
|
1704
|
+
// Returns a segment representing the given string of decimal digits encoded in numeric mode.
|
|
1705
|
+
static makeNumeric(e) {
|
|
1706
|
+
if (!F.isNumeric(e))
|
|
1707
|
+
throw new RangeError("String contains non-numeric characters");
|
|
1708
|
+
let n = [];
|
|
1709
|
+
for (let r = 0; r < e.length; ) {
|
|
1710
|
+
const c = Math.min(e.length - r, 3);
|
|
1711
|
+
a(parseInt(e.substring(r, r + c), 10), c * 3 + 1, n), r += c;
|
|
1712
|
+
}
|
|
1713
|
+
return new F(F.Mode.NUMERIC, e.length, n);
|
|
1714
|
+
}
|
|
1715
|
+
// Returns a segment representing the given text string encoded in alphanumeric mode.
|
|
1716
|
+
// The characters allowed are: 0 to 9, A to Z (uppercase only), space,
|
|
1717
|
+
// dollar, percent, asterisk, plus, hyphen, period, slash, colon.
|
|
1718
|
+
static makeAlphanumeric(e) {
|
|
1719
|
+
if (!F.isAlphanumeric(e))
|
|
1720
|
+
throw new RangeError("String contains unencodable characters in alphanumeric mode");
|
|
1721
|
+
let n = [], r;
|
|
1722
|
+
for (r = 0; r + 2 <= e.length; r += 2) {
|
|
1723
|
+
let c = F.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r)) * 45;
|
|
1724
|
+
c += F.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r + 1)), a(c, 11, n);
|
|
1725
|
+
}
|
|
1726
|
+
return r < e.length && a(F.ALPHANUMERIC_CHARSET.indexOf(e.charAt(r)), 6, n), new F(F.Mode.ALPHANUMERIC, e.length, n);
|
|
1727
|
+
}
|
|
1728
|
+
// Returns a new mutable list of zero or more segments to represent the given Unicode text string.
|
|
1729
|
+
// The result may use various segment modes and switch modes to optimize the length of the bit stream.
|
|
1730
|
+
static makeSegments(e) {
|
|
1731
|
+
return e == "" ? [] : F.isNumeric(e) ? [F.makeNumeric(e)] : F.isAlphanumeric(e) ? [F.makeAlphanumeric(e)] : [F.makeBytes(F.toUtf8ByteArray(e))];
|
|
1732
|
+
}
|
|
1733
|
+
// Returns a segment representing an Extended Channel Interpretation
|
|
1734
|
+
// (ECI) designator with the given assignment value.
|
|
1735
|
+
static makeEci(e) {
|
|
1736
|
+
let n = [];
|
|
1737
|
+
if (e < 0)
|
|
1738
|
+
throw new RangeError("ECI assignment value out of range");
|
|
1739
|
+
if (e < 128)
|
|
1740
|
+
a(e, 8, n);
|
|
1741
|
+
else if (e < 16384)
|
|
1742
|
+
a(2, 2, n), a(e, 14, n);
|
|
1743
|
+
else if (e < 1e6)
|
|
1744
|
+
a(6, 3, n), a(e, 21, n);
|
|
1745
|
+
else
|
|
1746
|
+
throw new RangeError("ECI assignment value out of range");
|
|
1747
|
+
return new F(F.Mode.ECI, 0, n);
|
|
1748
|
+
}
|
|
1749
|
+
// Tests whether the given string can be encoded as a segment in numeric mode.
|
|
1750
|
+
// A string is encodable iff each character is in the range 0 to 9.
|
|
1751
|
+
static isNumeric(e) {
|
|
1752
|
+
return F.NUMERIC_REGEX.test(e);
|
|
1753
|
+
}
|
|
1754
|
+
// Tests whether the given string can be encoded as a segment in alphanumeric mode.
|
|
1755
|
+
// A string is encodable iff each character is in the following set: 0 to 9, A to Z
|
|
1756
|
+
// (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.
|
|
1757
|
+
static isAlphanumeric(e) {
|
|
1758
|
+
return F.ALPHANUMERIC_REGEX.test(e);
|
|
1759
|
+
}
|
|
1760
|
+
/*-- Methods --*/
|
|
1761
|
+
// Returns a new copy of the data bits of this segment.
|
|
1762
|
+
getData() {
|
|
1763
|
+
return this.bitData.slice();
|
|
1764
|
+
}
|
|
1765
|
+
// (Package-private) Calculates and returns the number of bits needed to encode the given segments at
|
|
1766
|
+
// the given version. The result is infinity if a segment has too many characters to fit its length field.
|
|
1767
|
+
static getTotalBits(e, n) {
|
|
1768
|
+
let r = 0;
|
|
1769
|
+
for (const c of e) {
|
|
1770
|
+
const l = c.mode.numCharCountBits(n);
|
|
1771
|
+
if (c.numChars >= 1 << l)
|
|
1772
|
+
return 1 / 0;
|
|
1773
|
+
r += 4 + l + c.bitData.length;
|
|
1774
|
+
}
|
|
1775
|
+
return r;
|
|
1776
|
+
}
|
|
1777
|
+
// Returns a new array of bytes representing the given string encoded in UTF-8.
|
|
1778
|
+
static toUtf8ByteArray(e) {
|
|
1779
|
+
e = encodeURI(e);
|
|
1780
|
+
let n = [];
|
|
1781
|
+
for (let r = 0; r < e.length; r++)
|
|
1782
|
+
e.charAt(r) != "%" ? n.push(e.charCodeAt(r)) : (n.push(parseInt(e.substring(r + 1, r + 3), 16)), r += 2);
|
|
1783
|
+
return n;
|
|
1784
|
+
}
|
|
1785
|
+
};
|
|
1786
|
+
u.NUMERIC_REGEX = /^[0-9]*$/, u.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, u.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
|
|
1787
|
+
let m = u;
|
|
1788
|
+
t.QrSegment = u;
|
|
1789
|
+
})(ie || (ie = {}));
|
|
1790
|
+
((t) => {
|
|
1791
|
+
((i) => {
|
|
1792
|
+
const a = class {
|
|
1793
|
+
// The QR Code can tolerate about 30% erroneous codewords
|
|
1794
|
+
/*-- Constructor and fields --*/
|
|
1795
|
+
constructor(o, u) {
|
|
1796
|
+
this.ordinal = o, this.formatBits = u;
|
|
1797
|
+
}
|
|
1798
|
+
};
|
|
1799
|
+
a.LOW = new a(0, 1), a.MEDIUM = new a(1, 0), a.QUARTILE = new a(2, 3), a.HIGH = new a(3, 2), i.Ecc = a;
|
|
1800
|
+
})(t.QrCode || (t.QrCode = {}));
|
|
1801
|
+
})(ie || (ie = {}));
|
|
1802
|
+
((t) => {
|
|
1803
|
+
((i) => {
|
|
1804
|
+
const a = class {
|
|
1805
|
+
/*-- Constructor and fields --*/
|
|
1806
|
+
constructor(o, u) {
|
|
1807
|
+
this.modeBits = o, this.numBitsCharCount = u;
|
|
1808
|
+
}
|
|
1809
|
+
/*-- Method --*/
|
|
1810
|
+
// (Package-private) Returns the bit width of the character count field for a segment in
|
|
1811
|
+
// this mode in a QR Code at the given version number. The result is in the range [0, 16].
|
|
1812
|
+
numCharCountBits(o) {
|
|
1813
|
+
return this.numBitsCharCount[Math.floor((o + 7) / 17)];
|
|
1814
|
+
}
|
|
1815
|
+
};
|
|
1816
|
+
a.NUMERIC = new a(1, [10, 12, 14]), a.ALPHANUMERIC = new a(2, [9, 11, 13]), a.BYTE = new a(4, [8, 16, 16]), a.KANJI = new a(8, [8, 10, 12]), a.ECI = new a(7, [0, 0, 0]), i.Mode = a;
|
|
1817
|
+
})(t.QrSegment || (t.QrSegment = {}));
|
|
1818
|
+
})(ie || (ie = {}));
|
|
1819
|
+
var le = ie;
|
|
1820
|
+
/**
|
|
1821
|
+
* @license qrcode.react
|
|
1822
|
+
* Copyright (c) Paul O'Shannessy
|
|
1823
|
+
* SPDX-License-Identifier: ISC
|
|
1824
|
+
*/
|
|
1825
|
+
var wr = {
|
|
1826
|
+
L: le.QrCode.Ecc.LOW,
|
|
1827
|
+
M: le.QrCode.Ecc.MEDIUM,
|
|
1828
|
+
Q: le.QrCode.Ecc.QUARTILE,
|
|
1829
|
+
H: le.QrCode.Ecc.HIGH
|
|
1830
|
+
}, at = 128, st = "L", ct = "#FFFFFF", lt = "#000000", ut = !1, ft = 1, br = 4, Sr = 0, _r = 0.1;
|
|
1831
|
+
function dt(t, i = 0) {
|
|
1832
|
+
const a = [];
|
|
1833
|
+
return t.forEach(function(s, o) {
|
|
1834
|
+
let u = null;
|
|
1835
|
+
s.forEach(function(m, h) {
|
|
1836
|
+
if (!m && u !== null) {
|
|
1837
|
+
a.push(
|
|
1838
|
+
`M${u + i} ${o + i}h${h - u}v1H${u + i}z`
|
|
1839
|
+
), u = null;
|
|
1840
|
+
return;
|
|
1841
|
+
}
|
|
1842
|
+
if (h === s.length - 1) {
|
|
1843
|
+
if (!m)
|
|
1844
|
+
return;
|
|
1845
|
+
u === null ? a.push(`M${h + i},${o + i} h1v1H${h + i}z`) : a.push(
|
|
1846
|
+
`M${u + i},${o + i} h${h + 1 - u}v1H${u + i}z`
|
|
1847
|
+
);
|
|
1848
|
+
return;
|
|
1849
|
+
}
|
|
1850
|
+
m && u === null && (u = h);
|
|
1851
|
+
});
|
|
1852
|
+
}), a.join("");
|
|
1853
|
+
}
|
|
1854
|
+
function pt(t, i) {
|
|
1855
|
+
return t.slice().map((a, s) => s < i.y || s >= i.y + i.h ? a : a.map((o, u) => u < i.x || u >= i.x + i.w ? o : !1));
|
|
1856
|
+
}
|
|
1857
|
+
function Pr(t, i, a, s) {
|
|
1858
|
+
if (s == null)
|
|
1859
|
+
return null;
|
|
1860
|
+
const o = t.length + a * 2, u = Math.floor(i * _r), m = o / i, h = (s.width || u) * m, e = (s.height || u) * m, n = s.x == null ? t.length / 2 - h / 2 : s.x * m, r = s.y == null ? t.length / 2 - e / 2 : s.y * m, c = s.opacity == null ? 1 : s.opacity;
|
|
1861
|
+
let l = null;
|
|
1862
|
+
if (s.excavate) {
|
|
1863
|
+
let d = Math.floor(n), g = Math.floor(r), E = Math.ceil(h + n - d), D = Math.ceil(e + r - g);
|
|
1864
|
+
l = { x: d, y: g, w: E, h: D };
|
|
1865
|
+
}
|
|
1866
|
+
const f = s.crossOrigin;
|
|
1867
|
+
return { x: n, y: r, h: e, w: h, excavation: l, opacity: c, crossOrigin: f };
|
|
1868
|
+
}
|
|
1869
|
+
function Mr(t, i) {
|
|
1870
|
+
return i != null ? Math.max(Math.floor(i), 0) : t ? br : Sr;
|
|
1871
|
+
}
|
|
1872
|
+
function ht({
|
|
1873
|
+
value: t,
|
|
1874
|
+
level: i,
|
|
1875
|
+
minVersion: a,
|
|
1876
|
+
includeMargin: s,
|
|
1877
|
+
marginSize: o,
|
|
1878
|
+
imageSettings: u,
|
|
1879
|
+
size: m,
|
|
1880
|
+
boostLevel: h
|
|
1881
|
+
}) {
|
|
1882
|
+
let e = j.useMemo(() => {
|
|
1883
|
+
const d = (Array.isArray(t) ? t : [t]).reduce((g, E) => (g.push(...le.QrSegment.makeSegments(E)), g), []);
|
|
1884
|
+
return le.QrCode.encodeSegments(
|
|
1885
|
+
d,
|
|
1886
|
+
wr[i],
|
|
1887
|
+
a,
|
|
1888
|
+
void 0,
|
|
1889
|
+
void 0,
|
|
1890
|
+
h
|
|
1891
|
+
);
|
|
1892
|
+
}, [t, i, a, h]);
|
|
1893
|
+
const { cells: n, margin: r, numCells: c, calculatedImageSettings: l } = j.useMemo(() => {
|
|
1894
|
+
let f = e.getModules();
|
|
1895
|
+
const d = Mr(s, o), g = f.length + d * 2, E = Pr(
|
|
1896
|
+
f,
|
|
1897
|
+
m,
|
|
1898
|
+
d,
|
|
1899
|
+
u
|
|
1900
|
+
);
|
|
1901
|
+
return {
|
|
1902
|
+
cells: f,
|
|
1903
|
+
margin: d,
|
|
1904
|
+
numCells: g,
|
|
1905
|
+
calculatedImageSettings: E
|
|
1906
|
+
};
|
|
1907
|
+
}, [e, m, u, s, o]);
|
|
1908
|
+
return {
|
|
1909
|
+
qrcode: e,
|
|
1910
|
+
margin: r,
|
|
1911
|
+
cells: n,
|
|
1912
|
+
numCells: c,
|
|
1913
|
+
calculatedImageSettings: l
|
|
1914
|
+
};
|
|
1915
|
+
}
|
|
1916
|
+
var Rr = function() {
|
|
1917
|
+
try {
|
|
1918
|
+
new Path2D().addPath(new Path2D());
|
|
1919
|
+
} catch {
|
|
1920
|
+
return !1;
|
|
1921
|
+
}
|
|
1922
|
+
return !0;
|
|
1923
|
+
}(), mt = j.forwardRef(
|
|
1924
|
+
function(i, a) {
|
|
1925
|
+
const s = i, {
|
|
1926
|
+
value: o,
|
|
1927
|
+
size: u = at,
|
|
1928
|
+
level: m = st,
|
|
1929
|
+
bgColor: h = ct,
|
|
1930
|
+
fgColor: e = lt,
|
|
1931
|
+
includeMargin: n = ut,
|
|
1932
|
+
minVersion: r = ft,
|
|
1933
|
+
boostLevel: c,
|
|
1934
|
+
marginSize: l,
|
|
1935
|
+
imageSettings: f
|
|
1936
|
+
} = s, g = Oe(s, [
|
|
1937
|
+
"value",
|
|
1938
|
+
"size",
|
|
1939
|
+
"level",
|
|
1940
|
+
"bgColor",
|
|
1941
|
+
"fgColor",
|
|
1942
|
+
"includeMargin",
|
|
1943
|
+
"minVersion",
|
|
1944
|
+
"boostLevel",
|
|
1945
|
+
"marginSize",
|
|
1946
|
+
"imageSettings"
|
|
1947
|
+
]), { style: E } = g, D = Oe(g, ["style"]), $ = f == null ? void 0 : f.src, C = j.useRef(null), S = j.useRef(null), v = j.useCallback(
|
|
1948
|
+
(Y) => {
|
|
1949
|
+
C.current = Y, typeof a == "function" ? a(Y) : a && (a.current = Y);
|
|
1950
|
+
},
|
|
1951
|
+
[a]
|
|
1952
|
+
), [Z, ae] = j.useState(!1), { margin: J, cells: te, numCells: re, calculatedImageSettings: H } = ht({
|
|
1953
|
+
value: o,
|
|
1954
|
+
level: m,
|
|
1955
|
+
minVersion: r,
|
|
1956
|
+
boostLevel: c,
|
|
1957
|
+
includeMargin: n,
|
|
1958
|
+
marginSize: l,
|
|
1959
|
+
imageSettings: f,
|
|
1960
|
+
size: u
|
|
1961
|
+
});
|
|
1962
|
+
j.useEffect(() => {
|
|
1963
|
+
if (C.current != null) {
|
|
1964
|
+
const Y = C.current, V = Y.getContext("2d");
|
|
1965
|
+
if (!V)
|
|
1966
|
+
return;
|
|
1967
|
+
let q = te;
|
|
1968
|
+
const W = S.current, ne = H != null && W !== null && W.complete && W.naturalHeight !== 0 && W.naturalWidth !== 0;
|
|
1969
|
+
ne && H.excavation != null && (q = pt(
|
|
1970
|
+
te,
|
|
1971
|
+
H.excavation
|
|
1972
|
+
));
|
|
1973
|
+
const ce = window.devicePixelRatio || 1;
|
|
1974
|
+
Y.height = Y.width = u * ce;
|
|
1975
|
+
const p = u / re * ce;
|
|
1976
|
+
V.scale(p, p), V.fillStyle = h, V.fillRect(0, 0, re, re), V.fillStyle = e, Rr ? V.fill(new Path2D(dt(q, J))) : te.forEach(function(T, P) {
|
|
1977
|
+
T.forEach(function(_, w) {
|
|
1978
|
+
_ && V.fillRect(w + J, P + J, 1, 1);
|
|
1979
|
+
});
|
|
1980
|
+
}), H && (V.globalAlpha = H.opacity), ne && V.drawImage(
|
|
1981
|
+
W,
|
|
1982
|
+
H.x + J,
|
|
1983
|
+
H.y + J,
|
|
1984
|
+
H.w,
|
|
1985
|
+
H.h
|
|
1986
|
+
);
|
|
1987
|
+
}
|
|
1988
|
+
}), j.useEffect(() => {
|
|
1989
|
+
ae(!1);
|
|
1990
|
+
}, [$]);
|
|
1991
|
+
const ue = Re({ height: u, width: u }, E);
|
|
1992
|
+
let se = null;
|
|
1993
|
+
return $ != null && (se = /* @__PURE__ */ j.createElement(
|
|
1994
|
+
"img",
|
|
1995
|
+
{
|
|
1996
|
+
src: $,
|
|
1997
|
+
key: $,
|
|
1998
|
+
style: { display: "none" },
|
|
1999
|
+
onLoad: () => {
|
|
2000
|
+
ae(!0);
|
|
2001
|
+
},
|
|
2002
|
+
ref: S,
|
|
2003
|
+
crossOrigin: H == null ? void 0 : H.crossOrigin
|
|
2004
|
+
}
|
|
2005
|
+
)), /* @__PURE__ */ j.createElement(j.Fragment, null, /* @__PURE__ */ j.createElement(
|
|
2006
|
+
"canvas",
|
|
2007
|
+
Re({
|
|
2008
|
+
style: ue,
|
|
2009
|
+
height: u,
|
|
2010
|
+
width: u,
|
|
2011
|
+
ref: v,
|
|
2012
|
+
role: "img"
|
|
2013
|
+
}, D)
|
|
2014
|
+
), se);
|
|
2015
|
+
}
|
|
2016
|
+
);
|
|
2017
|
+
mt.displayName = "QRCodeCanvas";
|
|
2018
|
+
var Or = j.forwardRef(
|
|
2019
|
+
function(i, a) {
|
|
2020
|
+
const s = i, {
|
|
2021
|
+
value: o,
|
|
2022
|
+
size: u = at,
|
|
2023
|
+
level: m = st,
|
|
2024
|
+
bgColor: h = ct,
|
|
2025
|
+
fgColor: e = lt,
|
|
2026
|
+
includeMargin: n = ut,
|
|
2027
|
+
minVersion: r = ft,
|
|
2028
|
+
boostLevel: c,
|
|
2029
|
+
title: l,
|
|
2030
|
+
marginSize: f,
|
|
2031
|
+
imageSettings: d
|
|
2032
|
+
} = s, g = Oe(s, [
|
|
2033
|
+
"value",
|
|
2034
|
+
"size",
|
|
2035
|
+
"level",
|
|
2036
|
+
"bgColor",
|
|
2037
|
+
"fgColor",
|
|
2038
|
+
"includeMargin",
|
|
2039
|
+
"minVersion",
|
|
2040
|
+
"boostLevel",
|
|
2041
|
+
"title",
|
|
2042
|
+
"marginSize",
|
|
2043
|
+
"imageSettings"
|
|
2044
|
+
]), { margin: E, cells: D, numCells: $, calculatedImageSettings: C } = ht({
|
|
2045
|
+
value: o,
|
|
2046
|
+
level: m,
|
|
2047
|
+
minVersion: r,
|
|
2048
|
+
boostLevel: c,
|
|
2049
|
+
includeMargin: n,
|
|
2050
|
+
marginSize: f,
|
|
2051
|
+
imageSettings: d,
|
|
2052
|
+
size: u
|
|
2053
|
+
});
|
|
2054
|
+
let S = D, v = null;
|
|
2055
|
+
d != null && C != null && (C.excavation != null && (S = pt(
|
|
2056
|
+
D,
|
|
2057
|
+
C.excavation
|
|
2058
|
+
)), v = /* @__PURE__ */ j.createElement(
|
|
2059
|
+
"image",
|
|
2060
|
+
{
|
|
2061
|
+
href: d.src,
|
|
2062
|
+
height: C.h,
|
|
2063
|
+
width: C.w,
|
|
2064
|
+
x: C.x + E,
|
|
2065
|
+
y: C.y + E,
|
|
2066
|
+
preserveAspectRatio: "none",
|
|
2067
|
+
opacity: C.opacity,
|
|
2068
|
+
crossOrigin: C.crossOrigin
|
|
2069
|
+
}
|
|
2070
|
+
));
|
|
2071
|
+
const Z = dt(S, E);
|
|
2072
|
+
return /* @__PURE__ */ j.createElement(
|
|
2073
|
+
"svg",
|
|
2074
|
+
Re({
|
|
2075
|
+
height: u,
|
|
2076
|
+
width: u,
|
|
2077
|
+
viewBox: `0 0 ${$} ${$}`,
|
|
2078
|
+
ref: a,
|
|
2079
|
+
role: "img"
|
|
2080
|
+
}, g),
|
|
2081
|
+
!!l && /* @__PURE__ */ j.createElement("title", null, l),
|
|
2082
|
+
/* @__PURE__ */ j.createElement(
|
|
2083
|
+
"path",
|
|
2084
|
+
{
|
|
2085
|
+
fill: h,
|
|
2086
|
+
d: `M0,0 h${$}v${$}H0z`,
|
|
2087
|
+
shapeRendering: "crispEdges"
|
|
2088
|
+
}
|
|
2089
|
+
),
|
|
2090
|
+
/* @__PURE__ */ j.createElement("path", { fill: e, d: Z, shapeRendering: "crispEdges" }),
|
|
2091
|
+
v
|
|
2092
|
+
);
|
|
2093
|
+
}
|
|
2094
|
+
);
|
|
2095
|
+
Or.displayName = "QRCodeSVG";
|
|
2096
|
+
const Ar = ({ locale: t = X.UK, deeplink: i = "", updateHandler: a }) => {
|
|
2097
|
+
const s = new ee({
|
|
2098
|
+
uk: {
|
|
2099
|
+
qrTitle: "Відскануйте QR-код"
|
|
2100
|
+
},
|
|
2101
|
+
ru: {
|
|
2102
|
+
qrTitle: "Отсканируйте QR-код"
|
|
2103
|
+
}
|
|
2104
|
+
});
|
|
2105
|
+
return s.setLanguage(t), /* @__PURE__ */ z("div", { className: N.column, children: [
|
|
2106
|
+
/* @__PURE__ */ z("div", { className: N.qrBlock, children: [
|
|
2107
|
+
/* @__PURE__ */ b("p", { className: N.qrTitle, children: s.qrTitle }),
|
|
2108
|
+
/* @__PURE__ */ b("div", { className: N.qr, children: /* @__PURE__ */ b(mt, { value: i, size: 206 }) })
|
|
2109
|
+
] }),
|
|
2110
|
+
/* @__PURE__ */ b(Ze, { locale: t, updateHandler: a })
|
|
2111
|
+
] });
|
|
2112
|
+
};
|
|
2113
|
+
var me = /* @__PURE__ */ ((t) => (t.INITIAL = "initial", t.LOADING = "loading", t.SUCCESS = "success", t.ERROR = "error", t))(me || {});
|
|
2114
|
+
const Ye = 6e4, Qe = 1e3, Ur = ({
|
|
2115
|
+
locale: t = X.UK,
|
|
2116
|
+
deeplinkStatus: i,
|
|
2117
|
+
deeplink: a,
|
|
2118
|
+
getDeeplinkCallback: s,
|
|
2119
|
+
updateDeeplinkCallback: o,
|
|
2120
|
+
getUserDataCallback: u,
|
|
2121
|
+
setTimerIdCallback: m
|
|
2122
|
+
}) => {
|
|
2123
|
+
const [h, e] = pe(Date.now() + 3 * Ye), [n, r] = pe(!1), [c, l] = pe(!1), [f, d] = pe(null), g = () => {
|
|
2124
|
+
o(), e(Date.now() + 3 * Ye), r(!1), f && clearInterval(f), l(!1), s();
|
|
2125
|
+
}, E = () => {
|
|
2126
|
+
f && clearInterval(f);
|
|
2127
|
+
};
|
|
2128
|
+
return ge(() => {
|
|
2129
|
+
s();
|
|
2130
|
+
}, []), ge(() => (f && window.addEventListener("popstate", E), () => {
|
|
2131
|
+
E(), window.removeEventListener("popstate", E);
|
|
2132
|
+
}), [f]), ge(() => (f && clearInterval(f), a && !c && (l(!0), setTimeout(() => {
|
|
2133
|
+
const D = setInterval(
|
|
2134
|
+
() => u(),
|
|
2135
|
+
2.5 * Qe
|
|
2136
|
+
);
|
|
2137
|
+
d(D), m(D);
|
|
2138
|
+
}, 20 * Qe)), () => {
|
|
2139
|
+
f && clearInterval(f);
|
|
2140
|
+
}), [a]), /* @__PURE__ */ z("div", { className: N.diya, children: [
|
|
2141
|
+
/* @__PURE__ */ b("img", { className: N.logo, src: "https://polis.ua/static/img/react-modules/diya/diyaLogo.png", alt: "Diya logo" }),
|
|
2142
|
+
!K && /* @__PURE__ */ b(Er, { locale: t }),
|
|
2143
|
+
(i === me.INITIAL || i === me.LOADING) && /* @__PURE__ */ b(Tr, { locale: t }),
|
|
2144
|
+
i === me.SUCCESS && a && /* @__PURE__ */ z("div", { className: N.content, children: [
|
|
2145
|
+
!K && !n && /* @__PURE__ */ b(Ar, { locale: t, deeplink: a, updateHandler: g }),
|
|
2146
|
+
/* @__PURE__ */ z("div", { className: We(N.column, { [N.columnMob]: K || n }), children: [
|
|
2147
|
+
!n && /* @__PURE__ */ b(yr, { locale: t, start: h, setIsTimeOver: r }),
|
|
2148
|
+
!K && !n && /* @__PURE__ */ b(Gt, { locale: t }),
|
|
2149
|
+
K && !n && /* @__PURE__ */ b(Zt, { locale: t, deeplink: a }),
|
|
2150
|
+
K && !n && /* @__PURE__ */ b(Yt, { locale: t }),
|
|
2151
|
+
n && /* @__PURE__ */ b(gr, { locale: t }),
|
|
2152
|
+
n && /* @__PURE__ */ b(Ze, { locale: t, updateHandler: g })
|
|
2153
|
+
] })
|
|
2154
|
+
] })
|
|
2155
|
+
] });
|
|
2156
|
+
};
|
|
2157
|
+
export {
|
|
2158
|
+
Ur as D
|
|
2159
|
+
};
|