codeforlife 2.8.3 → 2.9.0
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/dist/Countdown-DFI1RljW.js +28 -0
- package/dist/Countdown-DFI1RljW.js.map +1 -0
- package/dist/Countdown-zY3nMzmi.cjs +2 -0
- package/dist/Countdown-zY3nMzmi.cjs.map +1 -0
- package/dist/Image-D5jC9UoX.js +21 -0
- package/dist/Image-D5jC9UoX.js.map +1 -0
- package/dist/Image-mgT45r_B.cjs +2 -0
- package/dist/Image-mgT45r_B.cjs.map +1 -0
- package/dist/LinkButton-BYFkvL_O.cjs +2 -0
- package/dist/LinkButton-BYFkvL_O.cjs.map +1 -0
- package/dist/LinkButton-oK0RThqn.js +12 -0
- package/dist/LinkButton-oK0RThqn.js.map +1 -0
- package/dist/Navigate-Dq47aqC8.js +25 -0
- package/dist/Navigate-Dq47aqC8.js.map +1 -0
- package/dist/Navigate-dQocLhzN.cjs +2 -0
- package/dist/Navigate-dQocLhzN.cjs.map +1 -0
- package/dist/api/endpoints/index.cjs.js +2 -0
- package/dist/api/endpoints/index.cjs.js.map +1 -0
- package/dist/api/endpoints/index.d.ts +81 -0
- package/dist/api/endpoints/index.es.js +78 -0
- package/dist/api/endpoints/index.es.js.map +1 -0
- package/dist/api/index.cjs.js +4 -0
- package/dist/api/index.cjs.js.map +1 -0
- package/dist/api/index.d.ts +77 -0
- package/dist/api/index.es.js +541 -0
- package/dist/api/index.es.js.map +1 -0
- package/dist/api-Cbyt3rw0.js +92 -0
- package/dist/api-Cbyt3rw0.js.map +1 -0
- package/dist/api-CnMfjRk3.cjs +2 -0
- package/dist/api-CnMfjRk3.cjs.map +1 -0
- package/dist/api-Cs4Y-WeI.js +20 -0
- package/dist/api-Cs4Y-WeI.js.map +1 -0
- package/dist/api-DIgp_6Vr.cjs +2 -0
- package/dist/api-DIgp_6Vr.cjs.map +1 -0
- package/dist/api.d.ts +123 -0
- package/dist/auth-BPfUPjmM.js +237 -0
- package/dist/auth-BPfUPjmM.js.map +1 -0
- package/dist/auth-Vf1MgMci.cjs +2 -0
- package/dist/auth-Vf1MgMci.cjs.map +1 -0
- package/dist/auth.d.ts +40 -0
- package/dist/components/form/index.cjs.js +2 -0
- package/dist/components/form/index.cjs.js.map +1 -0
- package/dist/components/form/index.d.ts +86 -0
- package/dist/components/form/index.es.js +18 -0
- package/dist/components/form/index.es.js.map +1 -0
- package/dist/components/index.cjs.js +11 -0
- package/dist/components/index.cjs.js.map +1 -0
- package/dist/components/index.d.ts +90 -0
- package/dist/components/index.es.js +383 -0
- package/dist/components/index.es.js.map +1 -0
- package/dist/components/page/index.cjs.js +2 -0
- package/dist/components/page/index.cjs.js.map +1 -0
- package/dist/components/page/index.d.ts +77 -0
- package/dist/components/page/index.es.js +9 -0
- package/dist/components/page/index.es.js.map +1 -0
- package/dist/components/router/index.cjs.js +2 -0
- package/dist/components/router/index.cjs.js.map +1 -0
- package/dist/components/router/index.d.ts +78 -0
- package/dist/components/router/index.es.js +11 -0
- package/dist/components/router/index.es.js.map +1 -0
- package/dist/components/table/index.cjs.js +2 -0
- package/dist/components/table/index.cjs.js.map +1 -0
- package/dist/components/table/index.d.ts +75 -0
- package/dist/components/table/index.es.js +9 -0
- package/dist/components/table/index.es.js.map +1 -0
- package/dist/en-gb-B_rK7Jx1.js +20 -0
- package/dist/en-gb-B_rK7Jx1.js.map +1 -0
- package/dist/en-gb-CpyEkKq3.cjs +2 -0
- package/dist/en-gb-CpyEkKq3.cjs.map +1 -0
- package/dist/features/index.cjs.js +2 -0
- package/dist/features/index.cjs.js.map +1 -0
- package/dist/features/index.d.ts +76 -0
- package/dist/features/index.es.js +47 -0
- package/dist/features/index.es.js.map +1 -0
- package/dist/form.d.ts +40 -0
- package/dist/general-BPbbmkeX.cjs +2 -0
- package/dist/general-BPbbmkeX.cjs.map +1 -0
- package/dist/general-CtTJPCJn.js +58 -0
- package/dist/general-CtTJPCJn.js.map +1 -0
- package/dist/general.d.ts +53 -0
- package/dist/hooks/index.cjs.js +2 -0
- package/dist/hooks/index.cjs.js.map +1 -0
- package/dist/hooks/index.d.ts +77 -0
- package/dist/hooks/index.es.js +25 -0
- package/dist/hooks/index.es.js.map +1 -0
- package/dist/index-2W--_sNE.js +30 -0
- package/dist/index-2W--_sNE.js.map +1 -0
- package/dist/index-BUMdUVBH.cjs +5 -0
- package/dist/index-BUMdUVBH.cjs.map +1 -0
- package/dist/index-B_Zy_zwA.cjs +2 -0
- package/dist/index-B_Zy_zwA.cjs.map +1 -0
- package/dist/index-BgsynEGX.cjs +2 -0
- package/dist/index-BgsynEGX.cjs.map +1 -0
- package/dist/index-CA-ugBSa.cjs +2 -0
- package/dist/index-CA-ugBSa.cjs.map +1 -0
- package/dist/index-CNtOlJ49.js +572 -0
- package/dist/index-CNtOlJ49.js.map +1 -0
- package/dist/index-DkM_cG3a.js +237 -0
- package/dist/index-DkM_cG3a.js.map +1 -0
- package/dist/index-Dqp7dpn3.js +1111 -0
- package/dist/index-Dqp7dpn3.js.map +1 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.es.js +7 -0
- package/dist/index.es.js.map +1 -0
- package/dist/jsx-runtime-CeSfJrVB.cjs +31 -0
- package/dist/jsx-runtime-CeSfJrVB.cjs.map +1 -0
- package/dist/jsx-runtime-Dpn_P65e.js +634 -0
- package/dist/jsx-runtime-Dpn_P65e.js.map +1 -0
- package/dist/middlewares/index.cjs.js +2 -0
- package/dist/middlewares/index.cjs.js.map +1 -0
- package/dist/middlewares/index.d.ts +73 -0
- package/dist/middlewares/index.es.js +10 -0
- package/dist/middlewares/index.es.js.map +1 -0
- package/dist/palette-CE2mKYse.cjs +2 -0
- package/dist/palette-CE2mKYse.cjs.map +1 -0
- package/dist/palette-C_L0akN_.js +43 -0
- package/dist/palette-C_L0akN_.js.map +1 -0
- package/dist/router.d.ts +48 -0
- package/dist/rtk-query.modern-CjetfYPg.js +3038 -0
- package/dist/rtk-query.modern-CjetfYPg.js.map +1 -0
- package/dist/rtk-query.modern-PBCErCqb.cjs +15 -0
- package/dist/rtk-query.modern-PBCErCqb.cjs.map +1 -0
- package/dist/schema.d.ts +89 -0
- package/dist/schemas-BZbJpkD5.cjs +2 -0
- package/dist/schemas-BZbJpkD5.cjs.map +1 -0
- package/dist/schemas-DlOtf2vf.js +162 -0
- package/dist/schemas-DlOtf2vf.js.map +1 -0
- package/dist/server.cjs.js +6 -0
- package/dist/server.cjs.js.map +1 -0
- package/dist/server.d.ts +129 -0
- package/dist/server.es.js +127 -0
- package/dist/server.es.js.map +1 -0
- package/dist/session-CE2U7oL1.cjs +2 -0
- package/dist/session-CE2U7oL1.cjs.map +1 -0
- package/dist/session-CacrgFSv.cjs +2 -0
- package/dist/session-CacrgFSv.cjs.map +1 -0
- package/dist/session-D312kYKk.js +32 -0
- package/dist/session-D312kYKk.js.map +1 -0
- package/dist/session-oI-Ht2C8.js +30 -0
- package/dist/session-oI-Ht2C8.js.map +1 -0
- package/dist/settings/index.cjs.js +2 -0
- package/dist/settings/index.cjs.js.map +1 -0
- package/dist/settings/index.d.ts +76 -0
- package/dist/settings/index.es.js +17 -0
- package/dist/settings/index.es.js.map +1 -0
- package/dist/slices/index.cjs.js +2 -0
- package/dist/slices/index.cjs.js.map +1 -0
- package/dist/slices/index.d.ts +74 -0
- package/dist/slices/index.es.js +6 -0
- package/dist/slices/index.es.js.map +1 -0
- package/dist/store.d.ts +17 -0
- package/dist/style.css +1 -0
- package/dist/test.d.ts +75 -0
- package/dist/theme/components/index.cjs.js +2 -0
- package/dist/theme/components/index.cjs.js.map +1 -0
- package/dist/theme/components/index.d.ts +75 -0
- package/dist/theme/components/index.es.js +6 -0
- package/dist/theme/components/index.es.js.map +1 -0
- package/dist/theme/index.cjs.js +2 -0
- package/dist/theme/index.cjs.js.map +1 -0
- package/dist/theme/index.d.ts +79 -0
- package/dist/theme/index.es.js +222 -0
- package/dist/theme/index.es.js.map +1 -0
- package/dist/theme.d.ts +19 -0
- package/dist/urls-DtHr1d3H.js +14 -0
- package/dist/urls-DtHr1d3H.js.map +1 -0
- package/dist/urls-MaVXL_C2.cjs +2 -0
- package/dist/urls-MaVXL_C2.cjs.map +1 -0
- package/dist/utils/api.cjs.js +2 -0
- package/dist/utils/api.cjs.js.map +1 -0
- package/dist/utils/api.d.ts +144 -0
- package/dist/utils/api.es.js +16 -0
- package/dist/utils/api.es.js.map +1 -0
- package/dist/utils/auth.cjs.js +2 -0
- package/dist/utils/auth.cjs.js.map +1 -0
- package/dist/utils/auth.d.ts +100 -0
- package/dist/utils/auth.es.js +117 -0
- package/dist/utils/auth.es.js.map +1 -0
- package/dist/utils/form.cjs.js +2 -0
- package/dist/utils/form.cjs.js.map +1 -0
- package/dist/utils/form.d.ts +97 -0
- package/dist/utils/form.es.js +76 -0
- package/dist/utils/form.es.js.map +1 -0
- package/dist/utils/general.cjs.js +2 -0
- package/dist/utils/general.cjs.js.map +1 -0
- package/dist/utils/general.d.ts +102 -0
- package/{src/utils/general.ts → dist/utils/general.es.js} +87 -165
- package/dist/utils/general.es.js.map +1 -0
- package/dist/utils/router.cjs.js +2 -0
- package/dist/utils/router.cjs.js.map +1 -0
- package/dist/utils/router.d.ts +91 -0
- package/dist/utils/router.es.js +33 -0
- package/dist/utils/router.es.js.map +1 -0
- package/dist/utils/schema.cjs.js +2 -0
- package/dist/utils/schema.cjs.js.map +1 -0
- package/dist/utils/schema.d.ts +115 -0
- package/dist/utils/schema.es.js +123 -0
- package/dist/utils/schema.es.js.map +1 -0
- package/dist/utils/store.cjs.js +2 -0
- package/dist/utils/store.cjs.js.map +1 -0
- package/dist/utils/store.d.ts +82 -0
- package/dist/utils/store.es.js +20 -0
- package/dist/utils/store.es.js.map +1 -0
- package/dist/utils/test.cjs.js +2 -0
- package/dist/utils/test.cjs.js.map +1 -0
- package/dist/utils/test.d.ts +125 -0
- package/dist/utils/test.es.js +60 -0
- package/dist/utils/test.es.js.map +1 -0
- package/dist/utils/theme.cjs.js +2 -0
- package/dist/utils/theme.cjs.js.map +1 -0
- package/dist/utils/theme.d.ts +83 -0
- package/dist/utils/theme.es.js +12 -0
- package/dist/utils/theme.es.js.map +1 -0
- package/dist/utils/window.cjs.js +2 -0
- package/dist/utils/window.cjs.js.map +1 -0
- package/dist/utils/window.d.ts +74 -0
- package/dist/utils/window.es.js +11 -0
- package/dist/utils/window.es.js.map +1 -0
- package/dist/window.d.ts +5 -0
- package/package.json +142 -37
- package/.github/workflows/main.yml +0 -55
- package/.prettierignore +0 -1
- package/CHANGELOG.md +0 -2027
- package/CONTRIBUTING.md +0 -3
- package/eslint.config.js +0 -17
- package/src/api/createApi.ts +0 -91
- package/src/api/endpoints/authFactor.ts +0 -31
- package/src/api/endpoints/index.ts +0 -9
- package/src/api/endpoints/klass.ts +0 -87
- package/src/api/endpoints/school.ts +0 -34
- package/src/api/endpoints/session.ts +0 -47
- package/src/api/endpoints/user.ts +0 -70
- package/src/api/index.ts +0 -5
- package/src/api/models.ts +0 -145
- package/src/api/schemas.ts +0 -243
- package/src/api/tagTypes.ts +0 -12
- package/src/api/urls.ts +0 -13
- package/src/components/App.css +0 -38
- package/src/components/App.tsx +0 -152
- package/src/components/ClickableTooltip.tsx +0 -43
- package/src/components/CopyIconButton.test.tsx +0 -16
- package/src/components/CopyIconButton.tsx +0 -27
- package/src/components/Countdown.tsx +0 -42
- package/src/components/DownloadFileButton.tsx +0 -55
- package/src/components/ElevatedAppBar.tsx +0 -41
- package/src/components/Image.tsx +0 -41
- package/src/components/InputFileButton.tsx +0 -27
- package/src/components/ItemizedList.tsx +0 -63
- package/src/components/OrderedGrid.tsx +0 -92
- package/src/components/ScrollIntoViewLink.tsx +0 -22
- package/src/components/SyncError.tsx +0 -14
- package/src/components/TablePagination.tsx +0 -142
- package/src/components/YouTubeVideo.tsx +0 -26
- package/src/components/form/ApiAutocompleteField.tsx +0 -187
- package/src/components/form/AutocompleteField.tsx +0 -135
- package/src/components/form/CheckboxField.tsx +0 -86
- package/src/components/form/CountryField.tsx +0 -75
- package/src/components/form/DatePickerField.tsx +0 -126
- package/src/components/form/EmailField.tsx +0 -38
- package/src/components/form/FirstNameField.tsx +0 -40
- package/src/components/form/Form.tsx +0 -165
- package/src/components/form/OtpField.tsx +0 -28
- package/src/components/form/PasswordField.tsx +0 -71
- package/src/components/form/RepeatField.tsx +0 -123
- package/src/components/form/SubmitButton.tsx +0 -57
- package/src/components/form/TextField.tsx +0 -150
- package/src/components/form/UkCountyField.tsx +0 -68
- package/src/components/form/index.tsx +0 -35
- package/src/components/index.ts +0 -28
- package/src/components/page/Banner.tsx +0 -95
- package/src/components/page/Notification.tsx +0 -71
- package/src/components/page/Page.tsx +0 -73
- package/src/components/page/Section.tsx +0 -21
- package/src/components/page/TabBar.tsx +0 -131
- package/src/components/page/index.ts +0 -10
- package/src/components/router/Link.tsx +0 -23
- package/src/components/router/LinkButton.tsx +0 -22
- package/src/components/router/LinkIconButton.tsx +0 -22
- package/src/components/router/LinkListItem.tsx +0 -22
- package/src/components/router/LinkTab.tsx +0 -22
- package/src/components/router/Navigate.tsx +0 -33
- package/src/components/router/index.tsx +0 -9
- package/src/components/table/CellStack.tsx +0 -19
- package/src/components/table/Table.tsx +0 -55
- package/src/components/table/index.tsx +0 -8
- package/src/features/InactiveDialog.tsx +0 -40
- package/src/features/ScreenTimeDialog.tsx +0 -30
- package/src/features/index.ts +0 -4
- package/src/fonts/ttf/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/src/fonts/ttf/SpaceGrotesk-VariableFont_wght.ttf +0 -0
- package/src/hooks/api.tsx +0 -39
- package/src/hooks/auth.tsx +0 -397
- package/src/hooks/form.tsx +0 -11
- package/src/hooks/general.tsx +0 -110
- package/src/hooks/index.ts +0 -5
- package/src/hooks/router.tsx +0 -168
- package/src/images/svg/brain.svg +0 -1
- package/src/index.ts +0 -2
- package/src/middlewares/index.ts +0 -1
- package/src/middlewares/session.ts +0 -21
- package/src/scripts/freshDesk.js +0 -473
- package/src/scripts/index.ts +0 -1
- package/src/server.js +0 -187
- package/src/settings/custom.ts +0 -22
- package/src/settings/index.ts +0 -7
- package/src/settings/vite.ts +0 -26
- package/src/setupTests.ts +0 -2
- package/src/slices/createSlice.ts +0 -8
- package/src/slices/index.ts +0 -2
- package/src/slices/session.ts +0 -32
- package/src/theme/ThemedBox.tsx +0 -265
- package/src/theme/colors.ts +0 -57
- package/src/theme/components/MuiAccordion.tsx +0 -13
- package/src/theme/components/MuiAutocomplete.tsx +0 -11
- package/src/theme/components/MuiButton.ts +0 -70
- package/src/theme/components/MuiCardActions.tsx +0 -12
- package/src/theme/components/MuiCheckbox.ts +0 -12
- package/src/theme/components/MuiContainer.ts +0 -19
- package/src/theme/components/MuiDialog.tsx +0 -16
- package/src/theme/components/MuiFormControlLabel.ts +0 -18
- package/src/theme/components/MuiFormHelperText.ts +0 -12
- package/src/theme/components/MuiGrid2.ts +0 -16
- package/src/theme/components/MuiInputBase.ts +0 -14
- package/src/theme/components/MuiLink.ts +0 -41
- package/src/theme/components/MuiList.ts +0 -12
- package/src/theme/components/MuiListItemText.ts +0 -18
- package/src/theme/components/MuiMenu.ts +0 -14
- package/src/theme/components/MuiMenuItem.ts +0 -15
- package/src/theme/components/MuiSelect.ts +0 -16
- package/src/theme/components/MuiTab.ts +0 -29
- package/src/theme/components/MuiTable.ts +0 -29
- package/src/theme/components/MuiTableBody.ts +0 -15
- package/src/theme/components/MuiTableHead.ts +0 -26
- package/src/theme/components/MuiTabs.ts +0 -26
- package/src/theme/components/MuiTextField.ts +0 -86
- package/src/theme/components/MuiToolbar.ts +0 -11
- package/src/theme/components/MuiTypography.ts +0 -12
- package/src/theme/components/_components.ts +0 -95
- package/src/theme/components/index.ts +0 -57
- package/src/theme/index.ts +0 -25
- package/src/theme/palette.ts +0 -98
- package/src/theme/spacing.ts +0 -8
- package/src/theme/typography.ts +0 -101
- package/src/utils/api.test.ts +0 -19
- package/src/utils/api.tsx +0 -339
- package/src/utils/auth.ts +0 -78
- package/src/utils/form.test.ts +0 -50
- package/src/utils/form.ts +0 -193
- package/src/utils/general.test.ts +0 -55
- package/src/utils/router.test.ts +0 -156
- package/src/utils/router.ts +0 -67
- package/src/utils/schema.ts +0 -290
- package/src/utils/store.ts +0 -31
- package/src/utils/test.tsx +0 -82
- package/src/utils/theme.tsx +0 -83
- package/src/utils/window.ts +0 -11
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.app.json +0 -4
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -4
- package/types/fixes.d.ts +0 -18
- package/vite.config.ts +0 -23
|
@@ -0,0 +1,1111 @@
|
|
|
1
|
+
import { j as l } from "./jsx-runtime-Dpn_P65e.js";
|
|
2
|
+
import { CircularProgress as zt, Button as Dt, Autocomplete as At, TextField as ft, FormControl as Et, FormControlLabel as Bt, Checkbox as _t, FormHelperText as wt, InputAdornment as mt, IconButton as $t } from "@mui/material";
|
|
3
|
+
import { useState as U, useEffect as I, forwardRef as Ut, Children as It, useRef as Vt } from "react";
|
|
4
|
+
import { S as Ht } from "./api-Cbyt3rw0.js";
|
|
5
|
+
import { u as Nt } from "./api-Cs4Y-WeI.js";
|
|
6
|
+
import { Field as $, Formik as Wt, Form as qt } from "formik";
|
|
7
|
+
import { string as V, number as Rt, bool as Gt, date as Zt, array as Xt } from "yup";
|
|
8
|
+
import { schemaToFieldValidator as H, submitForm as Qt } from "./utils/form.es.js";
|
|
9
|
+
import { getNestedProperty as D, COUNTRY_ISO_CODE_MAPPING as Kt, COUNTRY_ISO_CODES as Jt, getKeyPaths as te, UK_COUNTIES as ee } from "./utils/general.es.js";
|
|
10
|
+
import "./en-gb-B_rK7Jx1.js";
|
|
11
|
+
import { LocalizationProvider as re, DatePicker as se } from "@mui/x-date-pickers";
|
|
12
|
+
import j from "dayjs";
|
|
13
|
+
import { EmailOutlined as ne, PersonOutlined as ie, Visibility as oe, VisibilityOff as ae } from "@mui/icons-material";
|
|
14
|
+
import "./settings/index.es.js";
|
|
15
|
+
import "./session-oI-Ht2C8.js";
|
|
16
|
+
import "js-cookie";
|
|
17
|
+
import { u as ue } from "./schemas-DlOtf2vf.js";
|
|
18
|
+
import "./urls-DtHr1d3H.js";
|
|
19
|
+
function N(n) {
|
|
20
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
21
|
+
}
|
|
22
|
+
function dt() {
|
|
23
|
+
return dt = Object.assign ? Object.assign.bind() : function(n) {
|
|
24
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
25
|
+
var i = arguments[o];
|
|
26
|
+
for (var t in i) ({}).hasOwnProperty.call(i, t) && (n[t] = i[t]);
|
|
27
|
+
}
|
|
28
|
+
return n;
|
|
29
|
+
}, dt.apply(null, arguments);
|
|
30
|
+
}
|
|
31
|
+
const ce = ({
|
|
32
|
+
useLazyListQuery: n,
|
|
33
|
+
filterOptions: o,
|
|
34
|
+
getOptionLabel: i,
|
|
35
|
+
getOptionKey: t = (a) => a.id,
|
|
36
|
+
searchKey: e,
|
|
37
|
+
...r
|
|
38
|
+
}) => {
|
|
39
|
+
const [a, u] = U(""), [s, { isLoading: d, isError: c }] = n(), [{ limit: g, offset: y }, M] = Nt(), [{ options: Y, hasMore: T }, f] = U({ options: {}, hasMore: !0 });
|
|
40
|
+
I(
|
|
41
|
+
() => {
|
|
42
|
+
const x = { limit: g, offset: y, ...o };
|
|
43
|
+
a && (x[e] = a), s(x, !0).unwrap().then(({ data: O, offset: C, limit: b, count: w }) => {
|
|
44
|
+
f(({ options: k }) => {
|
|
45
|
+
const P = { ...k };
|
|
46
|
+
return O.forEach((F) => {
|
|
47
|
+
P[t(F)] = F;
|
|
48
|
+
}), { options: P, hasMore: C + b < w };
|
|
49
|
+
});
|
|
50
|
+
}).catch((O) => {
|
|
51
|
+
O && console.error(O);
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
|
+
[
|
|
56
|
+
s,
|
|
57
|
+
g,
|
|
58
|
+
y,
|
|
59
|
+
e,
|
|
60
|
+
a,
|
|
61
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
|
+
...Object.values(o || {})
|
|
63
|
+
]
|
|
64
|
+
);
|
|
65
|
+
let h = Object.keys(Y);
|
|
66
|
+
if (!h.length) return /* @__PURE__ */ l.jsx(l.Fragment, {});
|
|
67
|
+
typeof t(Object.values(Y)[0]) == "number" && (h = h.map(Number));
|
|
68
|
+
function m() {
|
|
69
|
+
M(({ page: x, limit: O }) => ({ page: x + 1, limit: O }));
|
|
70
|
+
}
|
|
71
|
+
const p = ({ children: x, ...O }, C) => {
|
|
72
|
+
const b = It.toArray(x);
|
|
73
|
+
return d ? b.push(/* @__PURE__ */ l.jsx(zt, {}, "is-loading")) : (c && b.push(/* @__PURE__ */ l.jsx(Ht, {}, "is-error")), T && b.push(
|
|
74
|
+
/* @__PURE__ */ l.jsx(Dt, { onClick: m, children: "Load more" }, "load-more")
|
|
75
|
+
)), /* @__PURE__ */ l.jsx(
|
|
76
|
+
"ul",
|
|
77
|
+
{
|
|
78
|
+
...O,
|
|
79
|
+
ref: C,
|
|
80
|
+
onScroll: (w) => {
|
|
81
|
+
!d && w.currentTarget.clientHeight + w.currentTarget.scrollTop >= w.currentTarget.scrollHeight && m();
|
|
82
|
+
},
|
|
83
|
+
children: b
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
return /* @__PURE__ */ l.jsx(
|
|
88
|
+
rt,
|
|
89
|
+
{
|
|
90
|
+
options: h,
|
|
91
|
+
getOptionLabel: (x) => i(Y[x]),
|
|
92
|
+
onInputChange: (x, O, C) => {
|
|
93
|
+
u(C === "input" ? O : "");
|
|
94
|
+
},
|
|
95
|
+
ListboxComponent: Ut(p),
|
|
96
|
+
...r
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}, rt = ({
|
|
100
|
+
textFieldProps: n,
|
|
101
|
+
options: o,
|
|
102
|
+
validateOptions: i,
|
|
103
|
+
...t
|
|
104
|
+
}) => {
|
|
105
|
+
const { id: e, name: r, required: a, ...u } = n, s = r.split("."), d = "not a valid option";
|
|
106
|
+
let c = typeof o[0] == "string" ? V().oneOf(o, d) : Rt().oneOf(o, d);
|
|
107
|
+
a && (c = c.required());
|
|
108
|
+
const g = {
|
|
109
|
+
name: r,
|
|
110
|
+
type: typeof o[0] == "string" ? "text" : "number",
|
|
111
|
+
validate: H(c, i)
|
|
112
|
+
};
|
|
113
|
+
return /* @__PURE__ */ l.jsx($, { ...g, children: ({ form: y, meta: M }) => {
|
|
114
|
+
const Y = D(
|
|
115
|
+
y.values,
|
|
116
|
+
s
|
|
117
|
+
), T = D(y.touched, s), f = D(y.errors, s);
|
|
118
|
+
return /* @__PURE__ */ l.jsx(
|
|
119
|
+
At,
|
|
120
|
+
{
|
|
121
|
+
options: o,
|
|
122
|
+
defaultValue: M.initialValue === "" ? void 0 : M.initialValue,
|
|
123
|
+
renderInput: ({
|
|
124
|
+
id: h,
|
|
125
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
126
|
+
...m
|
|
127
|
+
}) => /* @__PURE__ */ l.jsx(
|
|
128
|
+
ft,
|
|
129
|
+
{
|
|
130
|
+
id: e ?? r,
|
|
131
|
+
name: r,
|
|
132
|
+
required: a,
|
|
133
|
+
type: "text",
|
|
134
|
+
value: Y,
|
|
135
|
+
error: T && !!f,
|
|
136
|
+
helperText: T && f,
|
|
137
|
+
...u,
|
|
138
|
+
...m
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
onChange: (h, m) => {
|
|
142
|
+
y.setFieldValue(r, m ?? void 0, !0);
|
|
143
|
+
},
|
|
144
|
+
onBlur: y.handleBlur,
|
|
145
|
+
...t
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
} });
|
|
149
|
+
}, he = ({
|
|
150
|
+
id: n,
|
|
151
|
+
name: o,
|
|
152
|
+
formControlLabelProps: i,
|
|
153
|
+
required: t = !1,
|
|
154
|
+
errorMessage: e = "this is a required field",
|
|
155
|
+
validateOptions: r,
|
|
156
|
+
...a
|
|
157
|
+
}) => {
|
|
158
|
+
const u = o.split(".");
|
|
159
|
+
let s = Gt();
|
|
160
|
+
t && (s = s.oneOf([!0], e));
|
|
161
|
+
const d = {
|
|
162
|
+
name: o,
|
|
163
|
+
type: "checkbox",
|
|
164
|
+
validate: H(s, r)
|
|
165
|
+
};
|
|
166
|
+
return /* @__PURE__ */ l.jsx($, { ...d, children: ({ form: c, meta: g }) => {
|
|
167
|
+
const y = D(c.touched, u), M = D(c.errors, u), Y = D(
|
|
168
|
+
c.values,
|
|
169
|
+
u
|
|
170
|
+
), T = y && !!M;
|
|
171
|
+
return /* @__PURE__ */ l.jsxs(Et, { error: T, required: t, children: [
|
|
172
|
+
/* @__PURE__ */ l.jsx(
|
|
173
|
+
Bt,
|
|
174
|
+
{
|
|
175
|
+
control: /* @__PURE__ */ l.jsx(
|
|
176
|
+
_t,
|
|
177
|
+
{
|
|
178
|
+
defaultChecked: g.initialValue,
|
|
179
|
+
id: n ?? o,
|
|
180
|
+
name: o,
|
|
181
|
+
value: Y,
|
|
182
|
+
onChange: c.handleChange,
|
|
183
|
+
onBlur: c.handleBlur,
|
|
184
|
+
...a
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
...i
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
T && /* @__PURE__ */ l.jsx(wt, { children: M })
|
|
191
|
+
] });
|
|
192
|
+
} });
|
|
193
|
+
}, le = ({
|
|
194
|
+
textFieldProps: n,
|
|
195
|
+
...o
|
|
196
|
+
}) => {
|
|
197
|
+
const {
|
|
198
|
+
name: i = "country",
|
|
199
|
+
label: t = "Country",
|
|
200
|
+
placeholder: e = "Select your country",
|
|
201
|
+
...r
|
|
202
|
+
} = n || {};
|
|
203
|
+
return /* @__PURE__ */ l.jsx(
|
|
204
|
+
rt,
|
|
205
|
+
{
|
|
206
|
+
options: Jt,
|
|
207
|
+
getOptionLabel: (a) => Kt[a],
|
|
208
|
+
textFieldProps: { name: i, label: t, placeholder: e, ...r },
|
|
209
|
+
...o
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
};
|
|
213
|
+
var Q = { exports: {} }, de = Q.exports, yt;
|
|
214
|
+
function fe() {
|
|
215
|
+
return yt || (yt = 1, (function(n, o) {
|
|
216
|
+
(function(i, t) {
|
|
217
|
+
n.exports = t();
|
|
218
|
+
})(de, (function() {
|
|
219
|
+
var i = "week", t = "year";
|
|
220
|
+
return function(e, r, a) {
|
|
221
|
+
var u = r.prototype;
|
|
222
|
+
u.week = function(s) {
|
|
223
|
+
if (s === void 0 && (s = null), s !== null) return this.add(7 * (s - this.week()), "day");
|
|
224
|
+
var d = this.$locale().yearStart || 1;
|
|
225
|
+
if (this.month() === 11 && this.date() > 25) {
|
|
226
|
+
var c = a(this).startOf(t).add(1, t).date(d), g = a(this).endOf(i);
|
|
227
|
+
if (c.isBefore(g)) return 1;
|
|
228
|
+
}
|
|
229
|
+
var y = a(this).startOf(t).date(d).startOf(i).subtract(1, "millisecond"), M = this.diff(y, i, !0);
|
|
230
|
+
return M < 0 ? a(this).startOf("week").week() : Math.ceil(M);
|
|
231
|
+
}, u.weeks = function(s) {
|
|
232
|
+
return s === void 0 && (s = null), this.week(s);
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
}));
|
|
236
|
+
})(Q)), Q.exports;
|
|
237
|
+
}
|
|
238
|
+
var me = fe();
|
|
239
|
+
const pe = /* @__PURE__ */ N(me);
|
|
240
|
+
var K = { exports: {} }, ge = K.exports, Mt;
|
|
241
|
+
function ye() {
|
|
242
|
+
return Mt || (Mt = 1, (function(n, o) {
|
|
243
|
+
(function(i, t) {
|
|
244
|
+
n.exports = t();
|
|
245
|
+
})(ge, (function() {
|
|
246
|
+
var i = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, e = /\d/, r = /\d\d/, a = /\d\d?/, u = /\d*[^-_:/,()\s\d]+/, s = {}, d = function(f) {
|
|
247
|
+
return (f = +f) + (f > 68 ? 1900 : 2e3);
|
|
248
|
+
}, c = function(f) {
|
|
249
|
+
return function(h) {
|
|
250
|
+
this[f] = +h;
|
|
251
|
+
};
|
|
252
|
+
}, g = [/[+-]\d\d:?(\d\d)?|Z/, function(f) {
|
|
253
|
+
(this.zone || (this.zone = {})).offset = (function(h) {
|
|
254
|
+
if (!h || h === "Z") return 0;
|
|
255
|
+
var m = h.match(/([+-]|\d\d)/g), p = 60 * m[1] + (+m[2] || 0);
|
|
256
|
+
return p === 0 ? 0 : m[0] === "+" ? -p : p;
|
|
257
|
+
})(f);
|
|
258
|
+
}], y = function(f) {
|
|
259
|
+
var h = s[f];
|
|
260
|
+
return h && (h.indexOf ? h : h.s.concat(h.f));
|
|
261
|
+
}, M = function(f, h) {
|
|
262
|
+
var m, p = s.meridiem;
|
|
263
|
+
if (p) {
|
|
264
|
+
for (var x = 1; x <= 24; x += 1) if (f.indexOf(p(x, 0, h)) > -1) {
|
|
265
|
+
m = x > 12;
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
} else m = f === (h ? "pm" : "PM");
|
|
269
|
+
return m;
|
|
270
|
+
}, Y = { A: [u, function(f) {
|
|
271
|
+
this.afternoon = M(f, !1);
|
|
272
|
+
}], a: [u, function(f) {
|
|
273
|
+
this.afternoon = M(f, !0);
|
|
274
|
+
}], Q: [e, function(f) {
|
|
275
|
+
this.month = 3 * (f - 1) + 1;
|
|
276
|
+
}], S: [e, function(f) {
|
|
277
|
+
this.milliseconds = 100 * +f;
|
|
278
|
+
}], SS: [r, function(f) {
|
|
279
|
+
this.milliseconds = 10 * +f;
|
|
280
|
+
}], SSS: [/\d{3}/, function(f) {
|
|
281
|
+
this.milliseconds = +f;
|
|
282
|
+
}], s: [a, c("seconds")], ss: [a, c("seconds")], m: [a, c("minutes")], mm: [a, c("minutes")], H: [a, c("hours")], h: [a, c("hours")], HH: [a, c("hours")], hh: [a, c("hours")], D: [a, c("day")], DD: [r, c("day")], Do: [u, function(f) {
|
|
283
|
+
var h = s.ordinal, m = f.match(/\d+/);
|
|
284
|
+
if (this.day = m[0], h) for (var p = 1; p <= 31; p += 1) h(p).replace(/\[|\]/g, "") === f && (this.day = p);
|
|
285
|
+
}], w: [a, c("week")], ww: [r, c("week")], M: [a, c("month")], MM: [r, c("month")], MMM: [u, function(f) {
|
|
286
|
+
var h = y("months"), m = (y("monthsShort") || h.map((function(p) {
|
|
287
|
+
return p.slice(0, 3);
|
|
288
|
+
}))).indexOf(f) + 1;
|
|
289
|
+
if (m < 1) throw new Error();
|
|
290
|
+
this.month = m % 12 || m;
|
|
291
|
+
}], MMMM: [u, function(f) {
|
|
292
|
+
var h = y("months").indexOf(f) + 1;
|
|
293
|
+
if (h < 1) throw new Error();
|
|
294
|
+
this.month = h % 12 || h;
|
|
295
|
+
}], Y: [/[+-]?\d+/, c("year")], YY: [r, function(f) {
|
|
296
|
+
this.year = d(f);
|
|
297
|
+
}], YYYY: [/\d{4}/, c("year")], Z: g, ZZ: g };
|
|
298
|
+
function T(f) {
|
|
299
|
+
var h, m;
|
|
300
|
+
h = f, m = s && s.formats;
|
|
301
|
+
for (var p = (f = h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(P, F, v) {
|
|
302
|
+
var S = v && v.toUpperCase();
|
|
303
|
+
return F || m[v] || i[v] || m[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(z, A, E) {
|
|
304
|
+
return A || E.slice(1);
|
|
305
|
+
}));
|
|
306
|
+
}))).match(t), x = p.length, O = 0; O < x; O += 1) {
|
|
307
|
+
var C = p[O], b = Y[C], w = b && b[0], k = b && b[1];
|
|
308
|
+
p[O] = k ? { regex: w, parser: k } : C.replace(/^\[|\]$/g, "");
|
|
309
|
+
}
|
|
310
|
+
return function(P) {
|
|
311
|
+
for (var F = {}, v = 0, S = 0; v < x; v += 1) {
|
|
312
|
+
var z = p[v];
|
|
313
|
+
if (typeof z == "string") S += z.length;
|
|
314
|
+
else {
|
|
315
|
+
var A = z.regex, E = z.parser, q = P.slice(S), _ = A.exec(q)[0];
|
|
316
|
+
E.call(F, _), P = P.replace(_, "");
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return (function(B) {
|
|
320
|
+
var R = B.afternoon;
|
|
321
|
+
if (R !== void 0) {
|
|
322
|
+
var L = B.hours;
|
|
323
|
+
R ? L < 12 && (B.hours += 12) : L === 12 && (B.hours = 0), delete B.afternoon;
|
|
324
|
+
}
|
|
325
|
+
})(F), F;
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
return function(f, h, m) {
|
|
329
|
+
m.p.customParseFormat = !0, f && f.parseTwoDigitYear && (d = f.parseTwoDigitYear);
|
|
330
|
+
var p = h.prototype, x = p.parse;
|
|
331
|
+
p.parse = function(O) {
|
|
332
|
+
var C = O.date, b = O.utc, w = O.args;
|
|
333
|
+
this.$u = b;
|
|
334
|
+
var k = w[1];
|
|
335
|
+
if (typeof k == "string") {
|
|
336
|
+
var P = w[2] === !0, F = w[3] === !0, v = P || F, S = w[2];
|
|
337
|
+
F && (S = w[2]), s = this.$locale(), !P && S && (s = m.Ls[S]), this.$d = (function(q, _, B, R) {
|
|
338
|
+
try {
|
|
339
|
+
if (["x", "X"].indexOf(_) > -1) return new Date((_ === "X" ? 1e3 : 1) * q);
|
|
340
|
+
var L = T(_)(q), st = L.year, G = L.month, kt = L.day, Ft = L.hours, St = L.minutes, Pt = L.seconds, vt = L.milliseconds, pt = L.zone, gt = L.week, nt = /* @__PURE__ */ new Date(), it = kt || (st || G ? 1 : nt.getDate()), ot = st || nt.getFullYear(), Z = 0;
|
|
341
|
+
st && !G || (Z = G > 0 ? G - 1 : nt.getMonth());
|
|
342
|
+
var X, at = Ft || 0, ut = St || 0, ct = Pt || 0, ht = vt || 0;
|
|
343
|
+
return pt ? new Date(Date.UTC(ot, Z, it, at, ut, ct, ht + 60 * pt.offset * 1e3)) : B ? new Date(Date.UTC(ot, Z, it, at, ut, ct, ht)) : (X = new Date(ot, Z, it, at, ut, ct, ht), gt && (X = R(X).week(gt).toDate()), X);
|
|
344
|
+
} catch {
|
|
345
|
+
return /* @__PURE__ */ new Date("");
|
|
346
|
+
}
|
|
347
|
+
})(C, k, b, m), this.init(), S && S !== !0 && (this.$L = this.locale(S).$L), v && C != this.format(k) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
|
|
348
|
+
} else if (k instanceof Array) for (var z = k.length, A = 1; A <= z; A += 1) {
|
|
349
|
+
w[1] = k[A - 1];
|
|
350
|
+
var E = m.apply(this, w);
|
|
351
|
+
if (E.isValid()) {
|
|
352
|
+
this.$d = E.$d, this.$L = E.$L, this.init();
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
A === z && (this.$d = /* @__PURE__ */ new Date(""));
|
|
356
|
+
}
|
|
357
|
+
else x.call(this, O);
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
}));
|
|
361
|
+
})(K)), K.exports;
|
|
362
|
+
}
|
|
363
|
+
var Me = ye();
|
|
364
|
+
const xe = /* @__PURE__ */ N(Me);
|
|
365
|
+
var J = { exports: {} }, Te = J.exports, xt;
|
|
366
|
+
function Oe() {
|
|
367
|
+
return xt || (xt = 1, (function(n, o) {
|
|
368
|
+
(function(i, t) {
|
|
369
|
+
n.exports = t();
|
|
370
|
+
})(Te, (function() {
|
|
371
|
+
var i = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" };
|
|
372
|
+
return function(t, e, r) {
|
|
373
|
+
var a = e.prototype, u = a.format;
|
|
374
|
+
r.en.formats = i, a.format = function(s) {
|
|
375
|
+
s === void 0 && (s = "YYYY-MM-DDTHH:mm:ssZ");
|
|
376
|
+
var d = this.$locale().formats, c = (function(g, y) {
|
|
377
|
+
return g.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(M, Y, T) {
|
|
378
|
+
var f = T && T.toUpperCase();
|
|
379
|
+
return Y || y[T] || i[T] || y[f].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(h, m, p) {
|
|
380
|
+
return m || p.slice(1);
|
|
381
|
+
}));
|
|
382
|
+
}));
|
|
383
|
+
})(s, d === void 0 ? {} : d);
|
|
384
|
+
return u.call(this, c);
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
}));
|
|
388
|
+
})(J)), J.exports;
|
|
389
|
+
}
|
|
390
|
+
var Ye = Oe();
|
|
391
|
+
const je = /* @__PURE__ */ N(Ye);
|
|
392
|
+
var tt = { exports: {} }, De = tt.exports, Tt;
|
|
393
|
+
function we() {
|
|
394
|
+
return Tt || (Tt = 1, (function(n, o) {
|
|
395
|
+
(function(i, t) {
|
|
396
|
+
n.exports = t();
|
|
397
|
+
})(De, (function() {
|
|
398
|
+
return function(i, t, e) {
|
|
399
|
+
t.prototype.isBetween = function(r, a, u, s) {
|
|
400
|
+
var d = e(r), c = e(a), g = (s = s || "()")[0] === "(", y = s[1] === ")";
|
|
401
|
+
return (g ? this.isAfter(d, u) : !this.isBefore(d, u)) && (y ? this.isBefore(c, u) : !this.isAfter(c, u)) || (g ? this.isBefore(d, u) : !this.isAfter(d, u)) && (y ? this.isAfter(c, u) : !this.isBefore(c, u));
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
}));
|
|
405
|
+
})(tt)), tt.exports;
|
|
406
|
+
}
|
|
407
|
+
var be = we();
|
|
408
|
+
const Le = /* @__PURE__ */ N(be);
|
|
409
|
+
var et = { exports: {} }, Ce = et.exports, Ot;
|
|
410
|
+
function ke() {
|
|
411
|
+
return Ot || (Ot = 1, (function(n, o) {
|
|
412
|
+
(function(i, t) {
|
|
413
|
+
n.exports = t();
|
|
414
|
+
})(Ce, (function() {
|
|
415
|
+
return function(i, t) {
|
|
416
|
+
var e = t.prototype, r = e.format;
|
|
417
|
+
e.format = function(a) {
|
|
418
|
+
var u = this, s = this.$locale();
|
|
419
|
+
if (!this.isValid()) return r.bind(this)(a);
|
|
420
|
+
var d = this.$utils(), c = (a || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, (function(g) {
|
|
421
|
+
switch (g) {
|
|
422
|
+
case "Q":
|
|
423
|
+
return Math.ceil((u.$M + 1) / 3);
|
|
424
|
+
case "Do":
|
|
425
|
+
return s.ordinal(u.$D);
|
|
426
|
+
case "gggg":
|
|
427
|
+
return u.weekYear();
|
|
428
|
+
case "GGGG":
|
|
429
|
+
return u.isoWeekYear();
|
|
430
|
+
case "wo":
|
|
431
|
+
return s.ordinal(u.week(), "W");
|
|
432
|
+
case "w":
|
|
433
|
+
case "ww":
|
|
434
|
+
return d.s(u.week(), g === "w" ? 1 : 2, "0");
|
|
435
|
+
case "W":
|
|
436
|
+
case "WW":
|
|
437
|
+
return d.s(u.isoWeek(), g === "W" ? 1 : 2, "0");
|
|
438
|
+
case "k":
|
|
439
|
+
case "kk":
|
|
440
|
+
return d.s(String(u.$H === 0 ? 24 : u.$H), g === "k" ? 1 : 2, "0");
|
|
441
|
+
case "X":
|
|
442
|
+
return Math.floor(u.$d.getTime() / 1e3);
|
|
443
|
+
case "x":
|
|
444
|
+
return u.$d.getTime();
|
|
445
|
+
case "z":
|
|
446
|
+
return "[" + u.offsetName() + "]";
|
|
447
|
+
case "zzz":
|
|
448
|
+
return "[" + u.offsetName("long") + "]";
|
|
449
|
+
default:
|
|
450
|
+
return g;
|
|
451
|
+
}
|
|
452
|
+
}));
|
|
453
|
+
return r.bind(this)(c);
|
|
454
|
+
};
|
|
455
|
+
};
|
|
456
|
+
}));
|
|
457
|
+
})(et)), et.exports;
|
|
458
|
+
}
|
|
459
|
+
var Fe = ke();
|
|
460
|
+
const Se = /* @__PURE__ */ N(Fe), Yt = /* @__PURE__ */ new Set();
|
|
461
|
+
function Pe(n, o = "warning") {
|
|
462
|
+
if (process.env.NODE_ENV === "production")
|
|
463
|
+
return;
|
|
464
|
+
const i = Array.isArray(n) ? n.join(`
|
|
465
|
+
`) : n;
|
|
466
|
+
Yt.has(i) || (Yt.add(i), o === "error" ? console.error(i) : console.warn(i));
|
|
467
|
+
}
|
|
468
|
+
j.extend(je);
|
|
469
|
+
j.extend(pe);
|
|
470
|
+
j.extend(Le);
|
|
471
|
+
j.extend(Se);
|
|
472
|
+
const ve = {
|
|
473
|
+
// Year
|
|
474
|
+
YY: "year",
|
|
475
|
+
YYYY: {
|
|
476
|
+
sectionType: "year",
|
|
477
|
+
contentType: "digit",
|
|
478
|
+
maxLength: 4
|
|
479
|
+
},
|
|
480
|
+
// Month
|
|
481
|
+
M: {
|
|
482
|
+
sectionType: "month",
|
|
483
|
+
contentType: "digit",
|
|
484
|
+
maxLength: 2
|
|
485
|
+
},
|
|
486
|
+
MM: "month",
|
|
487
|
+
MMM: {
|
|
488
|
+
sectionType: "month",
|
|
489
|
+
contentType: "letter"
|
|
490
|
+
},
|
|
491
|
+
MMMM: {
|
|
492
|
+
sectionType: "month",
|
|
493
|
+
contentType: "letter"
|
|
494
|
+
},
|
|
495
|
+
// Day of the month
|
|
496
|
+
D: {
|
|
497
|
+
sectionType: "day",
|
|
498
|
+
contentType: "digit",
|
|
499
|
+
maxLength: 2
|
|
500
|
+
},
|
|
501
|
+
DD: "day",
|
|
502
|
+
Do: {
|
|
503
|
+
sectionType: "day",
|
|
504
|
+
contentType: "digit-with-letter"
|
|
505
|
+
},
|
|
506
|
+
// Day of the week
|
|
507
|
+
d: {
|
|
508
|
+
sectionType: "weekDay",
|
|
509
|
+
contentType: "digit",
|
|
510
|
+
maxLength: 2
|
|
511
|
+
},
|
|
512
|
+
dd: {
|
|
513
|
+
sectionType: "weekDay",
|
|
514
|
+
contentType: "letter"
|
|
515
|
+
},
|
|
516
|
+
ddd: {
|
|
517
|
+
sectionType: "weekDay",
|
|
518
|
+
contentType: "letter"
|
|
519
|
+
},
|
|
520
|
+
dddd: {
|
|
521
|
+
sectionType: "weekDay",
|
|
522
|
+
contentType: "letter"
|
|
523
|
+
},
|
|
524
|
+
// Meridiem
|
|
525
|
+
A: "meridiem",
|
|
526
|
+
a: "meridiem",
|
|
527
|
+
// Hours
|
|
528
|
+
H: {
|
|
529
|
+
sectionType: "hours",
|
|
530
|
+
contentType: "digit",
|
|
531
|
+
maxLength: 2
|
|
532
|
+
},
|
|
533
|
+
HH: "hours",
|
|
534
|
+
h: {
|
|
535
|
+
sectionType: "hours",
|
|
536
|
+
contentType: "digit",
|
|
537
|
+
maxLength: 2
|
|
538
|
+
},
|
|
539
|
+
hh: "hours",
|
|
540
|
+
// Minutes
|
|
541
|
+
m: {
|
|
542
|
+
sectionType: "minutes",
|
|
543
|
+
contentType: "digit",
|
|
544
|
+
maxLength: 2
|
|
545
|
+
},
|
|
546
|
+
mm: "minutes",
|
|
547
|
+
// Seconds
|
|
548
|
+
s: {
|
|
549
|
+
sectionType: "seconds",
|
|
550
|
+
contentType: "digit",
|
|
551
|
+
maxLength: 2
|
|
552
|
+
},
|
|
553
|
+
ss: "seconds"
|
|
554
|
+
}, ze = {
|
|
555
|
+
year: "YYYY",
|
|
556
|
+
month: "MMMM",
|
|
557
|
+
monthShort: "MMM",
|
|
558
|
+
dayOfMonth: "D",
|
|
559
|
+
dayOfMonthFull: "Do",
|
|
560
|
+
weekday: "dddd",
|
|
561
|
+
weekdayShort: "dd",
|
|
562
|
+
hours24h: "HH",
|
|
563
|
+
hours12h: "hh",
|
|
564
|
+
meridiem: "A",
|
|
565
|
+
minutes: "mm",
|
|
566
|
+
seconds: "ss",
|
|
567
|
+
fullDate: "ll",
|
|
568
|
+
keyboardDate: "L",
|
|
569
|
+
shortDate: "MMM D",
|
|
570
|
+
normalDate: "D MMMM",
|
|
571
|
+
normalDateWithWeekday: "ddd, MMM D",
|
|
572
|
+
fullTime: "LT",
|
|
573
|
+
fullTime12h: "hh:mm A",
|
|
574
|
+
fullTime24h: "HH:mm",
|
|
575
|
+
keyboardDateTime: "L LT",
|
|
576
|
+
keyboardDateTime12h: "L hh:mm A",
|
|
577
|
+
keyboardDateTime24h: "L HH:mm"
|
|
578
|
+
}, lt = ["Missing UTC plugin", "To be able to use UTC or timezones, you have to enable the `utc` plugin", "Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
|
|
579
|
+
`), jt = ["Missing timezone plugin", "To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin", "Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(`
|
|
580
|
+
`), Ae = (n, o) => o ? (...i) => n(...i).locale(o) : n;
|
|
581
|
+
class Ee {
|
|
582
|
+
constructor({
|
|
583
|
+
locale: o,
|
|
584
|
+
formats: i
|
|
585
|
+
} = {}) {
|
|
586
|
+
this.isMUIAdapter = !0, this.isTimezoneCompatible = !0, this.lib = "dayjs", this.dayjs = void 0, this.locale = void 0, this.formats = void 0, this.escapedCharacters = {
|
|
587
|
+
start: "[",
|
|
588
|
+
end: "]"
|
|
589
|
+
}, this.formatTokenMap = ve, this.setLocaleToValue = (t) => {
|
|
590
|
+
const e = this.getCurrentLocaleCode();
|
|
591
|
+
return e === t.locale() ? t : t.locale(e);
|
|
592
|
+
}, this.hasUTCPlugin = () => typeof j.utc < "u", this.hasTimezonePlugin = () => typeof j.tz < "u", this.isSame = (t, e, r) => {
|
|
593
|
+
const a = this.setTimezone(e, this.getTimezone(t));
|
|
594
|
+
return t.format(r) === a.format(r);
|
|
595
|
+
}, this.cleanTimezone = (t) => {
|
|
596
|
+
switch (t) {
|
|
597
|
+
case "default":
|
|
598
|
+
return;
|
|
599
|
+
case "system":
|
|
600
|
+
return j.tz.guess();
|
|
601
|
+
default:
|
|
602
|
+
return t;
|
|
603
|
+
}
|
|
604
|
+
}, this.createSystemDate = (t) => {
|
|
605
|
+
if (this.hasUTCPlugin() && this.hasTimezonePlugin()) {
|
|
606
|
+
const e = j.tz.guess();
|
|
607
|
+
return e !== "UTC" ? j.tz(t, e) : j(t);
|
|
608
|
+
}
|
|
609
|
+
return j(t);
|
|
610
|
+
}, this.createUTCDate = (t) => {
|
|
611
|
+
if (!this.hasUTCPlugin())
|
|
612
|
+
throw new Error(lt);
|
|
613
|
+
return j.utc(t);
|
|
614
|
+
}, this.createTZDate = (t, e) => {
|
|
615
|
+
if (!this.hasUTCPlugin())
|
|
616
|
+
throw new Error(lt);
|
|
617
|
+
if (!this.hasTimezonePlugin())
|
|
618
|
+
throw new Error(jt);
|
|
619
|
+
const r = t !== void 0 && !t.endsWith("Z");
|
|
620
|
+
return j(t).tz(this.cleanTimezone(e), r);
|
|
621
|
+
}, this.getLocaleFormats = () => {
|
|
622
|
+
const t = j.Ls, e = this.locale || "en";
|
|
623
|
+
let r = t[e];
|
|
624
|
+
return r === void 0 && (process.env.NODE_ENV !== "production" && Pe(["MUI X: Your locale has not been found.", "Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale.", "Or you forget to import the locale from 'dayjs/locale/{localeUsed}'", "fallback on English locale."]), r = t.en), r.formats;
|
|
625
|
+
}, this.adjustOffset = (t) => {
|
|
626
|
+
if (!this.hasTimezonePlugin())
|
|
627
|
+
return t;
|
|
628
|
+
const e = this.getTimezone(t);
|
|
629
|
+
if (e !== "UTC") {
|
|
630
|
+
const r = t.tz(this.cleanTimezone(e), !0);
|
|
631
|
+
if (r.$offset === (t.$offset ?? 0))
|
|
632
|
+
return t;
|
|
633
|
+
t.$offset = r.$offset;
|
|
634
|
+
}
|
|
635
|
+
return t;
|
|
636
|
+
}, this.date = (t, e = "default") => {
|
|
637
|
+
if (t === null)
|
|
638
|
+
return null;
|
|
639
|
+
let r;
|
|
640
|
+
return e === "UTC" ? r = this.createUTCDate(t) : e === "system" || e === "default" && !this.hasTimezonePlugin() ? r = this.createSystemDate(t) : r = this.createTZDate(t, e), this.locale === void 0 ? r : r.locale(this.locale);
|
|
641
|
+
}, this.getInvalidDate = () => j(/* @__PURE__ */ new Date("Invalid date")), this.getTimezone = (t) => {
|
|
642
|
+
if (this.hasTimezonePlugin()) {
|
|
643
|
+
const e = t.$x?.$timezone;
|
|
644
|
+
if (e)
|
|
645
|
+
return e;
|
|
646
|
+
}
|
|
647
|
+
return this.hasUTCPlugin() && t.isUTC() ? "UTC" : "system";
|
|
648
|
+
}, this.setTimezone = (t, e) => {
|
|
649
|
+
if (this.getTimezone(t) === e)
|
|
650
|
+
return t;
|
|
651
|
+
if (e === "UTC") {
|
|
652
|
+
if (!this.hasUTCPlugin())
|
|
653
|
+
throw new Error(lt);
|
|
654
|
+
return t.utc();
|
|
655
|
+
}
|
|
656
|
+
if (e === "system")
|
|
657
|
+
return t.local();
|
|
658
|
+
if (!this.hasTimezonePlugin()) {
|
|
659
|
+
if (e === "default")
|
|
660
|
+
return t;
|
|
661
|
+
throw new Error(jt);
|
|
662
|
+
}
|
|
663
|
+
return j.tz(t, this.cleanTimezone(e));
|
|
664
|
+
}, this.toJsDate = (t) => t.toDate(), this.parse = (t, e) => t === "" ? null : this.dayjs(t, e, this.locale, !0), this.getCurrentLocaleCode = () => this.locale || "en", this.is12HourCycleInCurrentLocale = () => /A|a/.test(this.getLocaleFormats().LT || ""), this.expandFormat = (t) => {
|
|
665
|
+
const e = this.getLocaleFormats(), r = (a) => a.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (u, s, d) => s || d.slice(1));
|
|
666
|
+
return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (a, u, s) => {
|
|
667
|
+
const d = s && s.toUpperCase();
|
|
668
|
+
return u || e[s] || r(e[d]);
|
|
669
|
+
});
|
|
670
|
+
}, this.isValid = (t) => t == null ? !1 : t.isValid(), this.format = (t, e) => this.formatByString(t, this.formats[e]), this.formatByString = (t, e) => this.dayjs(t).format(e), this.formatNumber = (t) => t, this.isEqual = (t, e) => t === null && e === null ? !0 : t === null || e === null ? !1 : t.toDate().getTime() === e.toDate().getTime(), this.isSameYear = (t, e) => this.isSame(t, e, "YYYY"), this.isSameMonth = (t, e) => this.isSame(t, e, "YYYY-MM"), this.isSameDay = (t, e) => this.isSame(t, e, "YYYY-MM-DD"), this.isSameHour = (t, e) => t.isSame(e, "hour"), this.isAfter = (t, e) => t > e, this.isAfterYear = (t, e) => this.hasUTCPlugin() ? !this.isSameYear(t, e) && t.utc() > e.utc() : t.isAfter(e, "year"), this.isAfterDay = (t, e) => this.hasUTCPlugin() ? !this.isSameDay(t, e) && t.utc() > e.utc() : t.isAfter(e, "day"), this.isBefore = (t, e) => t < e, this.isBeforeYear = (t, e) => this.hasUTCPlugin() ? !this.isSameYear(t, e) && t.utc() < e.utc() : t.isBefore(e, "year"), this.isBeforeDay = (t, e) => this.hasUTCPlugin() ? !this.isSameDay(t, e) && t.utc() < e.utc() : t.isBefore(e, "day"), this.isWithinRange = (t, [e, r]) => t >= e && t <= r, this.startOfYear = (t) => this.adjustOffset(t.startOf("year")), this.startOfMonth = (t) => this.adjustOffset(t.startOf("month")), this.startOfWeek = (t) => this.adjustOffset(this.setLocaleToValue(t).startOf("week")), this.startOfDay = (t) => this.adjustOffset(t.startOf("day")), this.endOfYear = (t) => this.adjustOffset(t.endOf("year")), this.endOfMonth = (t) => this.adjustOffset(t.endOf("month")), this.endOfWeek = (t) => this.adjustOffset(this.setLocaleToValue(t).endOf("week")), this.endOfDay = (t) => this.adjustOffset(t.endOf("day")), this.addYears = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "year") : t.add(e, "year")), this.addMonths = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "month") : t.add(e, "month")), this.addWeeks = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "week") : t.add(e, "week")), this.addDays = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "day") : t.add(e, "day")), this.addHours = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "hour") : t.add(e, "hour")), this.addMinutes = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "minute") : t.add(e, "minute")), this.addSeconds = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "second") : t.add(e, "second")), this.getYear = (t) => t.year(), this.getMonth = (t) => t.month(), this.getDate = (t) => t.date(), this.getHours = (t) => t.hour(), this.getMinutes = (t) => t.minute(), this.getSeconds = (t) => t.second(), this.getMilliseconds = (t) => t.millisecond(), this.setYear = (t, e) => this.adjustOffset(t.set("year", e)), this.setMonth = (t, e) => this.adjustOffset(t.set("month", e)), this.setDate = (t, e) => this.adjustOffset(t.set("date", e)), this.setHours = (t, e) => this.adjustOffset(t.set("hour", e)), this.setMinutes = (t, e) => this.adjustOffset(t.set("minute", e)), this.setSeconds = (t, e) => this.adjustOffset(t.set("second", e)), this.setMilliseconds = (t, e) => this.adjustOffset(t.set("millisecond", e)), this.getDaysInMonth = (t) => t.daysInMonth(), this.getWeekArray = (t) => {
|
|
671
|
+
const e = this.startOfWeek(this.startOfMonth(t)), r = this.endOfWeek(this.endOfMonth(t));
|
|
672
|
+
let a = 0, u = e;
|
|
673
|
+
const s = [];
|
|
674
|
+
for (; u < r; ) {
|
|
675
|
+
const d = Math.floor(a / 7);
|
|
676
|
+
s[d] = s[d] || [], s[d].push(u), u = this.addDays(u, 1), a += 1;
|
|
677
|
+
}
|
|
678
|
+
return s;
|
|
679
|
+
}, this.getWeekNumber = (t) => t.week(), this.getYearRange = ([t, e]) => {
|
|
680
|
+
const r = this.startOfYear(t), a = this.endOfYear(e), u = [];
|
|
681
|
+
let s = r;
|
|
682
|
+
for (; this.isBefore(s, a); )
|
|
683
|
+
u.push(s), s = this.addYears(s, 1);
|
|
684
|
+
return u;
|
|
685
|
+
}, this.dayjs = Ae(j, o), this.locale = o, this.formats = dt({}, ze, i), j.extend(xe);
|
|
686
|
+
}
|
|
687
|
+
getDayOfWeek(o) {
|
|
688
|
+
return o.day() + 1;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
const Be = ({
|
|
692
|
+
name: n,
|
|
693
|
+
required: o,
|
|
694
|
+
minDate: i,
|
|
695
|
+
maxDate: t,
|
|
696
|
+
validateOptions: e,
|
|
697
|
+
...r
|
|
698
|
+
}) => {
|
|
699
|
+
const a = n.split(".");
|
|
700
|
+
function u(c) {
|
|
701
|
+
return c.locale("en-gb").format("L");
|
|
702
|
+
}
|
|
703
|
+
let s = Zt();
|
|
704
|
+
o && (s = s.required()), i && (s = s.min(
|
|
705
|
+
i,
|
|
706
|
+
`this field must be after or equal to ${u(i)}`
|
|
707
|
+
)), t && (s = s.max(
|
|
708
|
+
t,
|
|
709
|
+
`this field must be before or equal to ${u(t)}`
|
|
710
|
+
));
|
|
711
|
+
const d = {
|
|
712
|
+
name: n,
|
|
713
|
+
type: "date",
|
|
714
|
+
validate: H(s, e)
|
|
715
|
+
};
|
|
716
|
+
return /* @__PURE__ */ l.jsx($, { ...d, children: ({ form: c }) => {
|
|
717
|
+
const g = D(c.errors, a), y = D(c.touched, a);
|
|
718
|
+
let M = D(
|
|
719
|
+
c.values,
|
|
720
|
+
a
|
|
721
|
+
);
|
|
722
|
+
M = M ? j(M) : null;
|
|
723
|
+
function Y(T) {
|
|
724
|
+
c.setFieldValue(
|
|
725
|
+
n,
|
|
726
|
+
T && T.isValid() ? T.format("YYYY-MM-DD") : null,
|
|
727
|
+
!0
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
return /* @__PURE__ */ l.jsx(
|
|
731
|
+
re,
|
|
732
|
+
{
|
|
733
|
+
dateAdapter: Ee,
|
|
734
|
+
adapterLocale: "en-gb",
|
|
735
|
+
children: /* @__PURE__ */ l.jsx(
|
|
736
|
+
se,
|
|
737
|
+
{
|
|
738
|
+
name: n,
|
|
739
|
+
value: M,
|
|
740
|
+
minDate: i,
|
|
741
|
+
maxDate: t,
|
|
742
|
+
onChange: Y,
|
|
743
|
+
slotProps: {
|
|
744
|
+
textField: {
|
|
745
|
+
id: n,
|
|
746
|
+
onChange: (T) => {
|
|
747
|
+
Y(T);
|
|
748
|
+
},
|
|
749
|
+
onBlur: c.handleBlur,
|
|
750
|
+
required: o,
|
|
751
|
+
error: y && !!g,
|
|
752
|
+
helperText: y && g
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
...r
|
|
756
|
+
}
|
|
757
|
+
)
|
|
758
|
+
}
|
|
759
|
+
);
|
|
760
|
+
} });
|
|
761
|
+
}, W = ({
|
|
762
|
+
id: n,
|
|
763
|
+
name: o,
|
|
764
|
+
schema: i,
|
|
765
|
+
type: t = "text",
|
|
766
|
+
required: e = !1,
|
|
767
|
+
dirty: r = !1,
|
|
768
|
+
unique: a = !1,
|
|
769
|
+
uniqueCaseInsensitive: u = !1,
|
|
770
|
+
split: s,
|
|
771
|
+
validateOptions: d,
|
|
772
|
+
...c
|
|
773
|
+
}) => {
|
|
774
|
+
const [g, y] = U(""), M = o.split(".");
|
|
775
|
+
function Y() {
|
|
776
|
+
let h = i;
|
|
777
|
+
if (h = e ? h.required() : h.optional(), r && !s && (h = h.notOneOf(
|
|
778
|
+
[g],
|
|
779
|
+
"cannot be initial value"
|
|
780
|
+
)), !s) return h;
|
|
781
|
+
let m = Xt().of(h);
|
|
782
|
+
return m = e ? m.required().min(1) : m.optional(), (a || u) && (m = m.test({
|
|
783
|
+
message: "cannot have duplicates",
|
|
784
|
+
test: (p) => Array.isArray(p) && p.length >= 2 && p.every((x) => typeof x == "string") ? new Set(
|
|
785
|
+
u ? p.map((x) => x.toLowerCase()) : p
|
|
786
|
+
).size === p.length : !0
|
|
787
|
+
})), r && (m = m.notOneOf(
|
|
788
|
+
[g],
|
|
789
|
+
"cannot be initial value"
|
|
790
|
+
)), m;
|
|
791
|
+
}
|
|
792
|
+
const T = {
|
|
793
|
+
name: o,
|
|
794
|
+
type: t,
|
|
795
|
+
validate: H(Y(), d)
|
|
796
|
+
}, f = ({ form: h }) => {
|
|
797
|
+
const m = D(
|
|
798
|
+
h.initialValues,
|
|
799
|
+
M
|
|
800
|
+
), p = D(
|
|
801
|
+
h.values,
|
|
802
|
+
M
|
|
803
|
+
), x = D(h.errors, M), O = D(h.touched, M);
|
|
804
|
+
return I(() => {
|
|
805
|
+
y(m);
|
|
806
|
+
}, [m]), I(() => {
|
|
807
|
+
h.setFieldValue(
|
|
808
|
+
o,
|
|
809
|
+
s && typeof p == "string" ? p.split(s) : p,
|
|
810
|
+
!0
|
|
811
|
+
);
|
|
812
|
+
}, [p]), /* @__PURE__ */ l.jsx(
|
|
813
|
+
ft,
|
|
814
|
+
{
|
|
815
|
+
id: n ?? o,
|
|
816
|
+
name: o,
|
|
817
|
+
type: t,
|
|
818
|
+
required: e,
|
|
819
|
+
value: p,
|
|
820
|
+
onChange: h.handleChange,
|
|
821
|
+
onBlur: h.handleBlur,
|
|
822
|
+
error: O && !!x,
|
|
823
|
+
helperText: O && x,
|
|
824
|
+
...c
|
|
825
|
+
}
|
|
826
|
+
);
|
|
827
|
+
};
|
|
828
|
+
return /* @__PURE__ */ l.jsx($, { ...T, children: f });
|
|
829
|
+
}, _e = ({
|
|
830
|
+
name: n = "email",
|
|
831
|
+
label: o = "Email address",
|
|
832
|
+
placeholder: i = "Enter your email address",
|
|
833
|
+
InputProps: t = {},
|
|
834
|
+
...e
|
|
835
|
+
}) => /* @__PURE__ */ l.jsx(
|
|
836
|
+
W,
|
|
837
|
+
{
|
|
838
|
+
type: "email",
|
|
839
|
+
schema: V().email(),
|
|
840
|
+
name: n,
|
|
841
|
+
label: o,
|
|
842
|
+
placeholder: i,
|
|
843
|
+
InputProps: {
|
|
844
|
+
endAdornment: /* @__PURE__ */ l.jsx(mt, { position: "end", children: /* @__PURE__ */ l.jsx(ne, {}) }),
|
|
845
|
+
...t
|
|
846
|
+
},
|
|
847
|
+
...e
|
|
848
|
+
}
|
|
849
|
+
), $e = ({
|
|
850
|
+
name: n = "first_name",
|
|
851
|
+
label: o = "First name",
|
|
852
|
+
placeholder: i = "Enter your first name",
|
|
853
|
+
InputProps: t = {},
|
|
854
|
+
...e
|
|
855
|
+
}) => /* @__PURE__ */ l.jsx(
|
|
856
|
+
W,
|
|
857
|
+
{
|
|
858
|
+
schema: ue.first_name,
|
|
859
|
+
name: n,
|
|
860
|
+
label: o,
|
|
861
|
+
placeholder: i,
|
|
862
|
+
InputProps: {
|
|
863
|
+
endAdornment: /* @__PURE__ */ l.jsx(mt, { position: "end", children: /* @__PURE__ */ l.jsx(ie, {}) }),
|
|
864
|
+
...t
|
|
865
|
+
},
|
|
866
|
+
...e
|
|
867
|
+
}
|
|
868
|
+
), bt = {
|
|
869
|
+
behavior: "smooth",
|
|
870
|
+
block: "start"
|
|
871
|
+
}, Ue = ({
|
|
872
|
+
scrollIntoViewOptions: n = bt,
|
|
873
|
+
...o
|
|
874
|
+
}) => {
|
|
875
|
+
const i = Vt(null);
|
|
876
|
+
return I(() => {
|
|
877
|
+
i.current && i.current.scrollIntoView(n);
|
|
878
|
+
}, [n]), /* @__PURE__ */ l.jsx(wt, { ref: i, error: !0, ...o });
|
|
879
|
+
}, Lt = ({
|
|
880
|
+
children: n,
|
|
881
|
+
scrollIntoViewOptions: o = bt,
|
|
882
|
+
nonFieldErrorsProps: i,
|
|
883
|
+
fieldRefs: t = [],
|
|
884
|
+
...e
|
|
885
|
+
}) => /* @__PURE__ */ l.jsx(Wt, { ...e, children: (r) => {
|
|
886
|
+
const a = !!Object.keys(r.errors).length, u = a && typeof r.errors.__all__ == "string";
|
|
887
|
+
if (a && !u && r.isSubmitting && t.length) {
|
|
888
|
+
const s = te(r.errors), d = t.find(({ name: c }) => s.includes(c))?.inputRef.current;
|
|
889
|
+
d && d.scrollIntoView(o);
|
|
890
|
+
}
|
|
891
|
+
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
892
|
+
u && /* @__PURE__ */ l.jsx(Ue, { ...i, children: r.errors.__all__ }),
|
|
893
|
+
/* @__PURE__ */ l.jsx(qt, { children: typeof n == "function" ? n(r) : n })
|
|
894
|
+
] });
|
|
895
|
+
} }), Ie = ({
|
|
896
|
+
useMutation: n,
|
|
897
|
+
submitOptions: o,
|
|
898
|
+
...i
|
|
899
|
+
}) => {
|
|
900
|
+
const [t] = n();
|
|
901
|
+
return /* @__PURE__ */ l.jsx(
|
|
902
|
+
Lt,
|
|
903
|
+
{
|
|
904
|
+
...i,
|
|
905
|
+
onSubmit: Qt(
|
|
906
|
+
t,
|
|
907
|
+
i.initialValues,
|
|
908
|
+
o
|
|
909
|
+
)
|
|
910
|
+
}
|
|
911
|
+
);
|
|
912
|
+
}, Ve = (n) => "onSubmit" in n ? /* @__PURE__ */ l.jsx(Lt, { ...n }) : Ie(n), He = ({
|
|
913
|
+
name: n = "otp",
|
|
914
|
+
label: o = "OTP",
|
|
915
|
+
placeholder: i = "Enter your OTP",
|
|
916
|
+
...t
|
|
917
|
+
}) => /* @__PURE__ */ l.jsx(
|
|
918
|
+
W,
|
|
919
|
+
{
|
|
920
|
+
name: n,
|
|
921
|
+
label: o,
|
|
922
|
+
schema: V().matches(/^[0-9]{6}$/, "Must be exactly 6 digits."),
|
|
923
|
+
placeholder: i,
|
|
924
|
+
required: !0,
|
|
925
|
+
...t
|
|
926
|
+
}
|
|
927
|
+
), Ne = ({
|
|
928
|
+
id: n,
|
|
929
|
+
repeatName: o,
|
|
930
|
+
setValue: i,
|
|
931
|
+
fieldProps: t,
|
|
932
|
+
name: e,
|
|
933
|
+
label: r,
|
|
934
|
+
placeholder: a,
|
|
935
|
+
type: u,
|
|
936
|
+
...s
|
|
937
|
+
}) => {
|
|
938
|
+
const { form: d } = t, c = e.split("."), g = D(d.values, c), y = o.split("."), M = D(
|
|
939
|
+
d.values,
|
|
940
|
+
y
|
|
941
|
+
), Y = D(
|
|
942
|
+
d.touched,
|
|
943
|
+
y
|
|
944
|
+
), T = D(d.errors, y);
|
|
945
|
+
return I(() => {
|
|
946
|
+
i(g);
|
|
947
|
+
}, [i, g]), /* @__PURE__ */ l.jsx(
|
|
948
|
+
ft,
|
|
949
|
+
{
|
|
950
|
+
required: !0,
|
|
951
|
+
type: u,
|
|
952
|
+
label: r ?? `Repeat ${e.replace("_", " ")}`,
|
|
953
|
+
placeholder: a ?? `Enter your ${e.replace("_", " ")} again`,
|
|
954
|
+
id: n ?? o,
|
|
955
|
+
name: o,
|
|
956
|
+
value: M,
|
|
957
|
+
onChange: d.handleChange,
|
|
958
|
+
onBlur: d.handleBlur,
|
|
959
|
+
error: Y && !!T,
|
|
960
|
+
helperText: Y && T,
|
|
961
|
+
...s
|
|
962
|
+
}
|
|
963
|
+
);
|
|
964
|
+
}, Ct = ({
|
|
965
|
+
name: n,
|
|
966
|
+
type: o = "text",
|
|
967
|
+
validateOptions: i,
|
|
968
|
+
...t
|
|
969
|
+
}) => {
|
|
970
|
+
const [e, r] = U(""), a = `${n}_repeat`, u = {
|
|
971
|
+
name: a,
|
|
972
|
+
type: o,
|
|
973
|
+
validate: H(
|
|
974
|
+
V().required().equals([e], "does not match"),
|
|
975
|
+
i
|
|
976
|
+
)
|
|
977
|
+
};
|
|
978
|
+
return /* @__PURE__ */ l.jsx($, { ...u, children: (s) => /* @__PURE__ */ l.jsx(
|
|
979
|
+
Ne,
|
|
980
|
+
{
|
|
981
|
+
name: n,
|
|
982
|
+
type: o,
|
|
983
|
+
repeatName: a,
|
|
984
|
+
setValue: r,
|
|
985
|
+
fieldProps: s,
|
|
986
|
+
...t
|
|
987
|
+
}
|
|
988
|
+
) });
|
|
989
|
+
}, We = ({
|
|
990
|
+
name: n = "password",
|
|
991
|
+
label: o = "Password",
|
|
992
|
+
placeholder: i = "Enter your password",
|
|
993
|
+
schema: t = V(),
|
|
994
|
+
InputProps: e = {},
|
|
995
|
+
withRepeatField: r = !1,
|
|
996
|
+
repeatFieldProps: a = {},
|
|
997
|
+
...u
|
|
998
|
+
}) => {
|
|
999
|
+
const [s, d] = U(!1), c = s ? "text" : "password", g = /* @__PURE__ */ l.jsx(mt, { position: "end", children: /* @__PURE__ */ l.jsx(
|
|
1000
|
+
$t,
|
|
1001
|
+
{
|
|
1002
|
+
onClick: () => {
|
|
1003
|
+
d((y) => !y);
|
|
1004
|
+
},
|
|
1005
|
+
edge: "end",
|
|
1006
|
+
children: s ? /* @__PURE__ */ l.jsx(oe, {}) : /* @__PURE__ */ l.jsx(ae, {})
|
|
1007
|
+
}
|
|
1008
|
+
) });
|
|
1009
|
+
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
1010
|
+
/* @__PURE__ */ l.jsx(
|
|
1011
|
+
W,
|
|
1012
|
+
{
|
|
1013
|
+
autoComplete: "off",
|
|
1014
|
+
type: c,
|
|
1015
|
+
name: n,
|
|
1016
|
+
label: o,
|
|
1017
|
+
schema: t,
|
|
1018
|
+
placeholder: i,
|
|
1019
|
+
InputProps: { endAdornment: g, ...e },
|
|
1020
|
+
...u
|
|
1021
|
+
}
|
|
1022
|
+
),
|
|
1023
|
+
r && /* @__PURE__ */ l.jsx(
|
|
1024
|
+
Ct,
|
|
1025
|
+
{
|
|
1026
|
+
name: n,
|
|
1027
|
+
type: c,
|
|
1028
|
+
...a,
|
|
1029
|
+
InputProps: { endAdornment: g, ...a.InputProps }
|
|
1030
|
+
}
|
|
1031
|
+
)
|
|
1032
|
+
] });
|
|
1033
|
+
}, qe = ({
|
|
1034
|
+
children: n = "Submit",
|
|
1035
|
+
...o
|
|
1036
|
+
}) => {
|
|
1037
|
+
function i(t, e) {
|
|
1038
|
+
e = e || {};
|
|
1039
|
+
for (const r in t) {
|
|
1040
|
+
const a = t[r];
|
|
1041
|
+
e[r] = a instanceof Object && a.constructor === Object ? i(a, e) : !0;
|
|
1042
|
+
}
|
|
1043
|
+
return e;
|
|
1044
|
+
}
|
|
1045
|
+
return /* @__PURE__ */ l.jsx($, { name: "submit", type: "submit", children: ({ form: t }) => /* @__PURE__ */ l.jsx(
|
|
1046
|
+
Dt,
|
|
1047
|
+
{
|
|
1048
|
+
type: "button",
|
|
1049
|
+
onClick: () => {
|
|
1050
|
+
t.setTouched(i(t.values), !0).then((e) => {
|
|
1051
|
+
const r = !!(e && Object.keys(e).length);
|
|
1052
|
+
t.setSubmitting(r), r || t.submitForm();
|
|
1053
|
+
});
|
|
1054
|
+
},
|
|
1055
|
+
...o,
|
|
1056
|
+
children: n
|
|
1057
|
+
}
|
|
1058
|
+
) });
|
|
1059
|
+
}, Re = ({
|
|
1060
|
+
textFieldProps: n,
|
|
1061
|
+
...o
|
|
1062
|
+
}) => {
|
|
1063
|
+
const {
|
|
1064
|
+
name: i = "uk_county",
|
|
1065
|
+
label: t = "UK county",
|
|
1066
|
+
placeholder: e = "Select your UK county",
|
|
1067
|
+
...r
|
|
1068
|
+
} = n || {};
|
|
1069
|
+
return /* @__PURE__ */ l.jsx(
|
|
1070
|
+
rt,
|
|
1071
|
+
{
|
|
1072
|
+
options: ee,
|
|
1073
|
+
textFieldProps: { name: i, label: t, placeholder: e, ...r },
|
|
1074
|
+
...o
|
|
1075
|
+
}
|
|
1076
|
+
);
|
|
1077
|
+
}, fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1078
|
+
__proto__: null,
|
|
1079
|
+
ApiAutocompleteField: ce,
|
|
1080
|
+
AutocompleteField: rt,
|
|
1081
|
+
CheckboxField: he,
|
|
1082
|
+
CountryField: le,
|
|
1083
|
+
DatePickerField: Be,
|
|
1084
|
+
EmailField: _e,
|
|
1085
|
+
FirstNameField: $e,
|
|
1086
|
+
Form: Ve,
|
|
1087
|
+
OtpField: He,
|
|
1088
|
+
PasswordField: We,
|
|
1089
|
+
RepeatField: Ct,
|
|
1090
|
+
SubmitButton: qe,
|
|
1091
|
+
TextField: W,
|
|
1092
|
+
UkCountyField: Re
|
|
1093
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1094
|
+
export {
|
|
1095
|
+
ce as A,
|
|
1096
|
+
he as C,
|
|
1097
|
+
Be as D,
|
|
1098
|
+
_e as E,
|
|
1099
|
+
$e as F,
|
|
1100
|
+
He as O,
|
|
1101
|
+
We as P,
|
|
1102
|
+
Ct as R,
|
|
1103
|
+
qe as S,
|
|
1104
|
+
W as T,
|
|
1105
|
+
Re as U,
|
|
1106
|
+
rt as a,
|
|
1107
|
+
le as b,
|
|
1108
|
+
Ve as c,
|
|
1109
|
+
fr as i
|
|
1110
|
+
};
|
|
1111
|
+
//# sourceMappingURL=index-Dqp7dpn3.js.map
|