react-start-kit-shared 1.0.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/LICENSE +21 -0
- package/README.md +236 -0
- package/dist/chunks/Actions-2AYZB2tr.es.js +34 -0
- package/dist/chunks/Actions-2AYZB2tr.es.js.map +1 -0
- package/dist/chunks/Actions-CZS1OCgc.cjs.js +2 -0
- package/dist/chunks/Actions-CZS1OCgc.cjs.js.map +1 -0
- package/dist/chunks/DateRangePicker-BTWpQRRq.es.js +178 -0
- package/dist/chunks/DateRangePicker-BTWpQRRq.es.js.map +1 -0
- package/dist/chunks/DateRangePicker-D6Q3vFLO.cjs.js +2 -0
- package/dist/chunks/DateRangePicker-D6Q3vFLO.cjs.js.map +1 -0
- package/dist/chunks/Empty-BiJ2b9JP.cjs.js +2 -0
- package/dist/chunks/Empty-BiJ2b9JP.cjs.js.map +1 -0
- package/dist/chunks/Empty-CP4yXr6G.es.js +25 -0
- package/dist/chunks/Empty-CP4yXr6G.es.js.map +1 -0
- package/dist/chunks/ExportData-Cf-cs_pE.es.js +36 -0
- package/dist/chunks/ExportData-Cf-cs_pE.es.js.map +1 -0
- package/dist/chunks/ExportData-Yp3Tm5Lv.cjs.js +2 -0
- package/dist/chunks/ExportData-Yp3Tm5Lv.cjs.js.map +1 -0
- package/dist/chunks/Keyboard-CJVAJWdO.es.js +5 -0
- package/dist/chunks/Keyboard-CJVAJWdO.es.js.map +1 -0
- package/dist/chunks/Keyboard-kyPAAQWP.cjs.js +2 -0
- package/dist/chunks/Keyboard-kyPAAQWP.cjs.js.map +1 -0
- package/dist/chunks/Loader-B51uJ48y.cjs.js +2 -0
- package/dist/chunks/Loader-B51uJ48y.cjs.js.map +1 -0
- package/dist/chunks/Loader-JIMPYfiR.es.js +14 -0
- package/dist/chunks/Loader-JIMPYfiR.es.js.map +1 -0
- package/dist/chunks/MyInput-BbLCYCkb.es.js +280 -0
- package/dist/chunks/MyInput-BbLCYCkb.es.js.map +1 -0
- package/dist/chunks/MyInput-CIgmb5kZ.cjs.js +2 -0
- package/dist/chunks/MyInput-CIgmb5kZ.cjs.js.map +1 -0
- package/dist/chunks/MyPagination-DYYM6ks6.cjs.js +2 -0
- package/dist/chunks/MyPagination-DYYM6ks6.cjs.js.map +1 -0
- package/dist/chunks/MyPagination-Dtx70bK6.es.js +142 -0
- package/dist/chunks/MyPagination-Dtx70bK6.es.js.map +1 -0
- package/dist/chunks/MySelect-DWTZ-FuO.es.js +58 -0
- package/dist/chunks/MySelect-DWTZ-FuO.es.js.map +1 -0
- package/dist/chunks/MySelect-DoX-Qy5y.cjs.js +2 -0
- package/dist/chunks/MySelect-DoX-Qy5y.cjs.js.map +1 -0
- package/dist/chunks/PasswordConfirm-DGVigQbo.cjs.js +2 -0
- package/dist/chunks/PasswordConfirm-DGVigQbo.cjs.js.map +1 -0
- package/dist/chunks/PasswordConfirm-DYTMNa33.es.js +3270 -0
- package/dist/chunks/PasswordConfirm-DYTMNa33.es.js.map +1 -0
- package/dist/chunks/Search-BQKw3els.cjs.js +2 -0
- package/dist/chunks/Search-BQKw3els.cjs.js.map +1 -0
- package/dist/chunks/Search-DqbIV61m.es.js +147 -0
- package/dist/chunks/Search-DqbIV61m.es.js.map +1 -0
- package/dist/chunks/SortOrder-81BrXp3i.cjs.js +2 -0
- package/dist/chunks/SortOrder-81BrXp3i.cjs.js.map +1 -0
- package/dist/chunks/SortOrder-CwuehjY1.es.js +5 -0
- package/dist/chunks/SortOrder-CwuehjY1.es.js.map +1 -0
- package/dist/chunks/Spin-CCtUPIlI.cjs.js +2 -0
- package/dist/chunks/Spin-CCtUPIlI.cjs.js.map +1 -0
- package/dist/chunks/Spin-DSBxxpPG.es.js +37 -0
- package/dist/chunks/Spin-DSBxxpPG.es.js.map +1 -0
- package/dist/chunks/ThemeMode-BO6tit_Z.cjs.js +2 -0
- package/dist/chunks/ThemeMode-BO6tit_Z.cjs.js.map +1 -0
- package/dist/chunks/ThemeMode-CqURAYDL.es.js +5 -0
- package/dist/chunks/ThemeMode-CqURAYDL.es.js.map +1 -0
- package/dist/chunks/ThemeProviderContext-CDiIvEe7.es.js +10 -0
- package/dist/chunks/ThemeProviderContext-CDiIvEe7.es.js.map +1 -0
- package/dist/chunks/ThemeProviderContext-rq2okb30.cjs.js +2 -0
- package/dist/chunks/ThemeProviderContext-rq2okb30.cjs.js.map +1 -0
- package/dist/chunks/_commonjsHelpers-DKOUU3wS.cjs.js +2 -0
- package/dist/chunks/_commonjsHelpers-DKOUU3wS.cjs.js.map +1 -0
- package/dist/chunks/_commonjsHelpers-DaMA6jEr.es.js +9 -0
- package/dist/chunks/_commonjsHelpers-DaMA6jEr.es.js.map +1 -0
- package/dist/chunks/index-ClQFzqcq.cjs.js +2 -0
- package/dist/chunks/index-ClQFzqcq.cjs.js.map +1 -0
- package/dist/chunks/index-E1NtSoNr.es.js +10 -0
- package/dist/chunks/index-E1NtSoNr.es.js.map +1 -0
- package/dist/chunks/useColumnsStore-C5UCQBGh.es.js +181 -0
- package/dist/chunks/useColumnsStore-C5UCQBGh.es.js.map +1 -0
- package/dist/chunks/useColumnsStore-ChRhCpCd.cjs.js +2 -0
- package/dist/chunks/useColumnsStore-ChRhCpCd.cjs.js.map +1 -0
- package/dist/chunks/useFilter-D93ncAmn.cjs.js +2 -0
- package/dist/chunks/useFilter-D93ncAmn.cjs.js.map +1 -0
- package/dist/chunks/useFilter-DpCwY1KO.es.js +17 -0
- package/dist/chunks/useFilter-DpCwY1KO.es.js.map +1 -0
- package/dist/chunks/useSortable-B8xGLknV.cjs.js +2 -0
- package/dist/chunks/useSortable-B8xGLknV.cjs.js.map +1 -0
- package/dist/chunks/useSortable-DD1y7f_o.es.js +256 -0
- package/dist/chunks/useSortable-DD1y7f_o.es.js.map +1 -0
- package/dist/chunks/useTheme-hjEZ-FC3.cjs.js +2 -0
- package/dist/chunks/useTheme-hjEZ-FC3.cjs.js.map +1 -0
- package/dist/chunks/useTheme-iKF3BEvj.es.js +12 -0
- package/dist/chunks/useTheme-iKF3BEvj.es.js.map +1 -0
- package/dist/components/actions/index.cjs.js +2 -0
- package/dist/components/actions/index.cjs.js.map +1 -0
- package/dist/components/actions/index.es.js +5 -0
- package/dist/components/actions/index.es.js.map +1 -0
- package/dist/components/confirm/index.cjs.js +2 -0
- package/dist/components/confirm/index.cjs.js.map +1 -0
- package/dist/components/confirm/index.es.js +7 -0
- package/dist/components/confirm/index.es.js.map +1 -0
- package/dist/components/datatable/index.cjs.js +2 -0
- package/dist/components/datatable/index.cjs.js.map +1 -0
- package/dist/components/datatable/index.es.js +404 -0
- package/dist/components/datatable/index.es.js.map +1 -0
- package/dist/components/datepicker/index.cjs.js +2 -0
- package/dist/components/datepicker/index.cjs.js.map +1 -0
- package/dist/components/datepicker/index.es.js +5 -0
- package/dist/components/datepicker/index.es.js.map +1 -0
- package/dist/components/empty/index.cjs.js +2 -0
- package/dist/components/empty/index.cjs.js.map +1 -0
- package/dist/components/empty/index.es.js +5 -0
- package/dist/components/empty/index.es.js.map +1 -0
- package/dist/components/export/index.cjs.js +2 -0
- package/dist/components/export/index.cjs.js.map +1 -0
- package/dist/components/export/index.es.js +5 -0
- package/dist/components/export/index.es.js.map +1 -0
- package/dist/components/filters/index.cjs.js +2 -0
- package/dist/components/filters/index.cjs.js.map +1 -0
- package/dist/components/filters/index.es.js +48 -0
- package/dist/components/filters/index.es.js.map +1 -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.es.js +450 -0
- package/dist/components/form/index.es.js.map +1 -0
- package/dist/components/gallery/index.cjs.js +2 -0
- package/dist/components/gallery/index.cjs.js.map +1 -0
- package/dist/components/gallery/index.es.js +308 -0
- package/dist/components/gallery/index.es.js.map +1 -0
- package/dist/components/loader/index.cjs.js +2 -0
- package/dist/components/loader/index.cjs.js.map +1 -0
- package/dist/components/loader/index.es.js +7 -0
- package/dist/components/loader/index.es.js.map +1 -0
- package/dist/components/modal/index.cjs.js +2 -0
- package/dist/components/modal/index.cjs.js.map +1 -0
- package/dist/components/modal/index.es.js +46 -0
- package/dist/components/modal/index.es.js.map +1 -0
- package/dist/components/pagination/index.cjs.js +2 -0
- package/dist/components/pagination/index.cjs.js.map +1 -0
- package/dist/components/pagination/index.es.js +6 -0
- package/dist/components/pagination/index.es.js.map +1 -0
- package/dist/components/scroll/index.cjs.js +2 -0
- package/dist/components/scroll/index.cjs.js.map +1 -0
- package/dist/components/scroll/index.es.js +16 -0
- package/dist/components/scroll/index.es.js.map +1 -0
- package/dist/components/theme/index.cjs.js +2 -0
- package/dist/components/theme/index.cjs.js.map +1 -0
- package/dist/components/theme/index.es.js +26 -0
- package/dist/components/theme/index.es.js.map +1 -0
- package/dist/components/tooltip/index.cjs.js +2 -0
- package/dist/components/tooltip/index.cjs.js.map +1 -0
- package/dist/components/tooltip/index.es.js +18 -0
- package/dist/components/tooltip/index.es.js.map +1 -0
- package/dist/enums/index.cjs.js +2 -0
- package/dist/enums/index.cjs.js.map +1 -0
- package/dist/enums/index.es.js +9 -0
- package/dist/enums/index.es.js.map +1 -0
- package/dist/hooks/index.cjs.js +21 -0
- package/dist/hooks/index.cjs.js.map +1 -0
- package/dist/hooks/index.es.js +1015 -0
- package/dist/hooks/index.es.js.map +1 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.js +2 -0
- package/dist/index.es.js.map +1 -0
- package/dist/providers/index.cjs.js +2 -0
- package/dist/providers/index.cjs.js.map +1 -0
- package/dist/providers/index.es.js +32 -0
- package/dist/providers/index.es.js.map +1 -0
- package/dist/stores/index.cjs.js +2 -0
- package/dist/stores/index.cjs.js.map +1 -0
- package/dist/stores/index.es.js +21 -0
- package/dist/stores/index.es.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/types/App.d.ts +3 -0
- package/dist/types/App.d.ts.map +1 -0
- package/dist/types/components/actions/Actions.d.ts +32 -0
- package/dist/types/components/actions/Actions.d.ts.map +1 -0
- package/dist/types/components/actions/index.d.ts +2 -0
- package/dist/types/components/actions/index.d.ts.map +1 -0
- package/dist/types/components/confirm/Confirm.d.ts +27 -0
- package/dist/types/components/confirm/Confirm.d.ts.map +1 -0
- package/dist/types/components/confirm/PasswordConfirm.d.ts +22 -0
- package/dist/types/components/confirm/PasswordConfirm.d.ts.map +1 -0
- package/dist/types/components/confirm/index.d.ts +4 -0
- package/dist/types/components/confirm/index.d.ts.map +1 -0
- package/dist/types/components/datatable/DataTable.d.ts +196 -0
- package/dist/types/components/datatable/DataTable.d.ts.map +1 -0
- package/dist/types/components/datatable/MyTable.d.ts +56 -0
- package/dist/types/components/datatable/MyTable.d.ts.map +1 -0
- package/dist/types/components/datatable/index.d.ts +3 -0
- package/dist/types/components/datatable/index.d.ts.map +1 -0
- package/dist/types/components/datepicker/DateRangePicker.d.ts +50 -0
- package/dist/types/components/datepicker/DateRangePicker.d.ts.map +1 -0
- package/dist/types/components/datepicker/index.d.ts +2 -0
- package/dist/types/components/datepicker/index.d.ts.map +1 -0
- package/dist/types/components/empty/Empty.d.ts +19 -0
- package/dist/types/components/empty/Empty.d.ts.map +1 -0
- package/dist/types/components/empty/index.d.ts +2 -0
- package/dist/types/components/empty/index.d.ts.map +1 -0
- package/dist/types/components/export/ExportData.d.ts +52 -0
- package/dist/types/components/export/ExportData.d.ts.map +1 -0
- package/dist/types/components/export/index.d.ts +2 -0
- package/dist/types/components/export/index.d.ts.map +1 -0
- package/dist/types/components/filters/AppliedFilters.d.ts +24 -0
- package/dist/types/components/filters/AppliedFilters.d.ts.map +1 -0
- package/dist/types/components/filters/FilterWrapper.d.ts +58 -0
- package/dist/types/components/filters/FilterWrapper.d.ts.map +1 -0
- package/dist/types/components/filters/Search.d.ts +28 -0
- package/dist/types/components/filters/Search.d.ts.map +1 -0
- package/dist/types/components/filters/SearchWithCtrl.d.ts +25 -0
- package/dist/types/components/filters/SearchWithCtrl.d.ts.map +1 -0
- package/dist/types/components/filters/index.d.ts +4 -0
- package/dist/types/components/filters/index.d.ts.map +1 -0
- package/dist/types/components/form/MyCheckbox.d.ts +20 -0
- package/dist/types/components/form/MyCheckbox.d.ts.map +1 -0
- package/dist/types/components/form/MyDatePicker.d.ts +43 -0
- package/dist/types/components/form/MyDatePicker.d.ts.map +1 -0
- package/dist/types/components/form/MyDateRangePicker.d.ts +26 -0
- package/dist/types/components/form/MyDateRangePicker.d.ts.map +1 -0
- package/dist/types/components/form/MyHtmlEditor.d.ts +26 -0
- package/dist/types/components/form/MyHtmlEditor.d.ts.map +1 -0
- package/dist/types/components/form/MyInput.d.ts +24 -0
- package/dist/types/components/form/MyInput.d.ts.map +1 -0
- package/dist/types/components/form/MyMaskInput.d.ts +28 -0
- package/dist/types/components/form/MyMaskInput.d.ts.map +1 -0
- package/dist/types/components/form/MyRadio.d.ts +25 -0
- package/dist/types/components/form/MyRadio.d.ts.map +1 -0
- package/dist/types/components/form/MySelect.d.ts +29 -0
- package/dist/types/components/form/MySelect.d.ts.map +1 -0
- package/dist/types/components/form/MyShadcnSelect.d.ts +39 -0
- package/dist/types/components/form/MyShadcnSelect.d.ts.map +1 -0
- package/dist/types/components/form/MySwitch.d.ts +20 -0
- package/dist/types/components/form/MySwitch.d.ts.map +1 -0
- package/dist/types/components/form/MyTextarea.d.ts +24 -0
- package/dist/types/components/form/MyTextarea.d.ts.map +1 -0
- package/dist/types/components/form/MyTimePicker.d.ts +29 -0
- package/dist/types/components/form/MyTimePicker.d.ts.map +1 -0
- package/dist/types/components/form/index.d.ts +14 -0
- package/dist/types/components/form/index.d.ts.map +1 -0
- package/dist/types/components/gallery/MyGallery.d.ts +62 -0
- package/dist/types/components/gallery/MyGallery.d.ts.map +1 -0
- package/dist/types/components/gallery/index.d.ts +2 -0
- package/dist/types/components/gallery/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +15 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/loader/Loader.d.ts +10 -0
- package/dist/types/components/loader/Loader.d.ts.map +1 -0
- package/dist/types/components/loader/Spin.d.ts +14 -0
- package/dist/types/components/loader/Spin.d.ts.map +1 -0
- package/dist/types/components/loader/index.d.ts +4 -0
- package/dist/types/components/loader/index.d.ts.map +1 -0
- package/dist/types/components/modal/MyModal.d.ts +51 -0
- package/dist/types/components/modal/MyModal.d.ts.map +1 -0
- package/dist/types/components/modal/index.d.ts +2 -0
- package/dist/types/components/modal/index.d.ts.map +1 -0
- package/dist/types/components/pagination/MyLimitSelect.d.ts +27 -0
- package/dist/types/components/pagination/MyLimitSelect.d.ts.map +1 -0
- package/dist/types/components/pagination/MyPagination.d.ts +39 -0
- package/dist/types/components/pagination/MyPagination.d.ts.map +1 -0
- package/dist/types/components/pagination/index.d.ts +4 -0
- package/dist/types/components/pagination/index.d.ts.map +1 -0
- package/dist/types/components/scroll/ScrollArea.d.ts +10 -0
- package/dist/types/components/scroll/ScrollArea.d.ts.map +1 -0
- package/dist/types/components/scroll/index.d.ts +2 -0
- package/dist/types/components/scroll/index.d.ts.map +1 -0
- package/dist/types/components/theme/index.d.ts +2 -0
- package/dist/types/components/theme/index.d.ts.map +1 -0
- package/dist/types/components/theme/theme-toggle.d.ts +15 -0
- package/dist/types/components/theme/theme-toggle.d.ts.map +1 -0
- package/dist/types/components/tooltip/MyTooltip.d.ts +25 -0
- package/dist/types/components/tooltip/MyTooltip.d.ts.map +1 -0
- package/dist/types/components/tooltip/index.d.ts +3 -0
- package/dist/types/components/tooltip/index.d.ts.map +1 -0
- package/dist/types/contexts/ThemeProviderContext.d.ts +18 -0
- package/dist/types/contexts/ThemeProviderContext.d.ts.map +1 -0
- package/dist/types/contexts/index.d.ts +2 -0
- package/dist/types/contexts/index.d.ts.map +1 -0
- package/dist/types/enums/Keyboard.d.ts +8 -0
- package/dist/types/enums/Keyboard.d.ts.map +1 -0
- package/dist/types/enums/SortOrder.d.ts +10 -0
- package/dist/types/enums/SortOrder.d.ts.map +1 -0
- package/dist/types/enums/ThemeMode.d.ts +12 -0
- package/dist/types/enums/ThemeMode.d.ts.map +1 -0
- package/dist/types/enums/index.d.ts +4 -0
- package/dist/types/enums/index.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +9 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/useColumns.d.ts +31 -0
- package/dist/types/hooks/useColumns.d.ts.map +1 -0
- package/dist/types/hooks/useConfirm.d.ts +21 -0
- package/dist/types/hooks/useConfirm.d.ts.map +1 -0
- package/dist/types/hooks/useDataTable.d.ts +33 -0
- package/dist/types/hooks/useDataTable.d.ts.map +1 -0
- package/dist/types/hooks/useDocumentTitle.d.ts +9 -0
- package/dist/types/hooks/useDocumentTitle.d.ts.map +1 -0
- package/dist/types/hooks/useFilter.d.ts +29 -0
- package/dist/types/hooks/useFilter.d.ts.map +1 -0
- package/dist/types/hooks/useMediaQuerySizes.d.ts +22 -0
- package/dist/types/hooks/useMediaQuerySizes.d.ts.map +1 -0
- package/dist/types/hooks/useSortable.d.ts +29 -0
- package/dist/types/hooks/useSortable.d.ts.map +1 -0
- package/dist/types/hooks/useTheme.d.ts +14 -0
- package/dist/types/hooks/useTheme.d.ts.map +1 -0
- package/dist/types/index.cjs.js +2 -0
- package/dist/types/index.cjs.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.es.js +2 -0
- package/dist/types/index.es.js.map +1 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/main.d.ts.map +1 -0
- package/dist/types/providers/ThemeProvider.d.ts +24 -0
- package/dist/types/providers/ThemeProvider.d.ts.map +1 -0
- package/dist/types/providers/index.d.ts +2 -0
- package/dist/types/providers/index.d.ts.map +1 -0
- package/dist/types/schemas/createConfirmPasswordSchema.d.ts +20 -0
- package/dist/types/schemas/createConfirmPasswordSchema.d.ts.map +1 -0
- package/dist/types/schemas/index.d.ts +2 -0
- package/dist/types/schemas/index.d.ts.map +1 -0
- package/dist/types/stores/index.d.ts +3 -0
- package/dist/types/stores/index.d.ts.map +1 -0
- package/dist/types/stores/useColumnsStore.d.ts +26 -0
- package/dist/types/stores/useColumnsStore.d.ts.map +1 -0
- package/dist/types/stores/useDateRangeStore.d.ts +27 -0
- package/dist/types/stores/useDateRangeStore.d.ts.map +1 -0
- package/dist/types/stories/Actions.stories.d.ts +8 -0
- package/dist/types/stories/Actions.stories.d.ts.map +1 -0
- package/dist/types/stories/AppliedFilters.stories.d.ts +10 -0
- package/dist/types/stories/AppliedFilters.stories.d.ts.map +1 -0
- package/dist/types/stories/Confirm.stories.d.ts +8 -0
- package/dist/types/stories/Confirm.stories.d.ts.map +1 -0
- package/dist/types/stories/DataTable.stories.d.ts +19 -0
- package/dist/types/stories/DataTable.stories.d.ts.map +1 -0
- package/dist/types/stories/DateRangePicker.stories.d.ts +10 -0
- package/dist/types/stories/DateRangePicker.stories.d.ts.map +1 -0
- package/dist/types/stories/Empty.stories.d.ts +9 -0
- package/dist/types/stories/Empty.stories.d.ts.map +1 -0
- package/dist/types/stories/ExportData.stories.d.ts +9 -0
- package/dist/types/stories/ExportData.stories.d.ts.map +1 -0
- package/dist/types/stories/FilterWrapper.stories.d.ts +9 -0
- package/dist/types/stories/FilterWrapper.stories.d.ts.map +1 -0
- package/dist/types/stories/Loader.stories.d.ts +7 -0
- package/dist/types/stories/Loader.stories.d.ts.map +1 -0
- package/dist/types/stories/MyCheckbox.stories.d.ts +8 -0
- package/dist/types/stories/MyCheckbox.stories.d.ts.map +1 -0
- package/dist/types/stories/MyDatePicker.stories.d.ts +10 -0
- package/dist/types/stories/MyDatePicker.stories.d.ts.map +1 -0
- package/dist/types/stories/MyDateRangePicker.stories.d.ts +8 -0
- package/dist/types/stories/MyDateRangePicker.stories.d.ts.map +1 -0
- package/dist/types/stories/MyGallery.stories.d.ts +9 -0
- package/dist/types/stories/MyGallery.stories.d.ts.map +1 -0
- package/dist/types/stories/MyHtmlEditor.stories.d.ts +8 -0
- package/dist/types/stories/MyHtmlEditor.stories.d.ts.map +1 -0
- package/dist/types/stories/MyInput.stories.d.ts +10 -0
- package/dist/types/stories/MyInput.stories.d.ts.map +1 -0
- package/dist/types/stories/MyLimitSelect.stories.d.ts +9 -0
- package/dist/types/stories/MyLimitSelect.stories.d.ts.map +1 -0
- package/dist/types/stories/MyMaskInput.stories.d.ts +9 -0
- package/dist/types/stories/MyMaskInput.stories.d.ts.map +1 -0
- package/dist/types/stories/MyModal.stories.d.ts +10 -0
- package/dist/types/stories/MyModal.stories.d.ts.map +1 -0
- package/dist/types/stories/MyPagination.stories.d.ts +10 -0
- package/dist/types/stories/MyPagination.stories.d.ts.map +1 -0
- package/dist/types/stories/MyRadio.stories.d.ts +7 -0
- package/dist/types/stories/MyRadio.stories.d.ts.map +1 -0
- package/dist/types/stories/MySelect.stories.d.ts +10 -0
- package/dist/types/stories/MySelect.stories.d.ts.map +1 -0
- package/dist/types/stories/MyShadcnSelect.stories.d.ts +9 -0
- package/dist/types/stories/MyShadcnSelect.stories.d.ts.map +1 -0
- package/dist/types/stories/MySwitch.stories.d.ts +8 -0
- package/dist/types/stories/MySwitch.stories.d.ts.map +1 -0
- package/dist/types/stories/MyTable.stories.d.ts +19 -0
- package/dist/types/stories/MyTable.stories.d.ts.map +1 -0
- package/dist/types/stories/MyTextarea.stories.d.ts +9 -0
- package/dist/types/stories/MyTextarea.stories.d.ts.map +1 -0
- package/dist/types/stories/MyTimePicker.stories.d.ts +9 -0
- package/dist/types/stories/MyTimePicker.stories.d.ts.map +1 -0
- package/dist/types/stories/MyTooltip.stories.d.ts +10 -0
- package/dist/types/stories/MyTooltip.stories.d.ts.map +1 -0
- package/dist/types/stories/PasswordConfirm.stories.d.ts +8 -0
- package/dist/types/stories/PasswordConfirm.stories.d.ts.map +1 -0
- package/dist/types/stories/ScrollArea.stories.d.ts +8 -0
- package/dist/types/stories/ScrollArea.stories.d.ts.map +1 -0
- package/dist/types/stories/Search.stories.d.ts +8 -0
- package/dist/types/stories/Search.stories.d.ts.map +1 -0
- package/dist/types/stories/SearchWithCtrl.stories.d.ts +8 -0
- package/dist/types/stories/SearchWithCtrl.stories.d.ts.map +1 -0
- package/dist/types/stories/Spin.stories.d.ts +8 -0
- package/dist/types/stories/Spin.stories.d.ts.map +1 -0
- package/dist/types/stories/ThemeToggle.stories.d.ts +8 -0
- package/dist/types/stories/ThemeToggle.stories.d.ts.map +1 -0
- package/dist/types/types/column.type.d.ts +31 -0
- package/dist/types/types/column.type.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/translation-args.type.d.ts +17 -0
- package/dist/types/types/translation-args.type.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/utils.d.ts +8 -0
- package/dist/types/utils/utils.d.ts.map +1 -0
- package/dist/types/vite-env.d.ts +1 -0
- package/dist/utils/index.cjs.js +2 -0
- package/dist/utils/index.cjs.js.map +1 -0
- package/dist/utils/index.es.js +7 -0
- package/dist/utils/index.es.js.map +1 -0
- package/package.json +265 -0
|
@@ -0,0 +1,3270 @@
|
|
|
1
|
+
import I, { useState as Re, useRef as le, useEffect as Te, useSyncExternalStore as Ut, useLayoutEffect as pt, isValidElement as Ce, cloneElement as Fe, useMemo as Ft } from "react";
|
|
2
|
+
import { jsxs as F, jsx as M } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslation as gt } from "react-i18next";
|
|
4
|
+
import { AlertDialog as yt, AlertDialogTrigger as vt, AlertDialogContent as _t, AlertDialogHeader as bt, AlertDialogTitle as xt, AlertDialogDescription as Wt, AlertDialogFooter as kt, AlertDialogCancel as wt, AlertDialogAction as Tt } from "react-start-kit/alert-dialog";
|
|
5
|
+
import { get as je, set as Ie, appendErrors as Ct, useForm as qt } from "react-hook-form";
|
|
6
|
+
import { Form as Ht } from "react-start-kit/form";
|
|
7
|
+
import { M as Xt } from "./MyInput-BbLCYCkb.es.js";
|
|
8
|
+
function Et(t) {
|
|
9
|
+
var e, r, n = "";
|
|
10
|
+
if (typeof t == "string" || typeof t == "number") n += t;
|
|
11
|
+
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
12
|
+
var s = t.length;
|
|
13
|
+
for (e = 0; e < s; e++) t[e] && (r = Et(t[e])) && (n && (n += " "), n += r);
|
|
14
|
+
} else for (r in t) t[r] && (n && (n += " "), n += r);
|
|
15
|
+
return n;
|
|
16
|
+
}
|
|
17
|
+
function ee() {
|
|
18
|
+
for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = Et(t)) && (n && (n += " "), n += e);
|
|
19
|
+
return n;
|
|
20
|
+
}
|
|
21
|
+
var me = (t) => typeof t == "number" && !isNaN(t), te = (t) => typeof t == "string", W = (t) => typeof t == "function", Yt = (t) => te(t) || me(t), Ze = (t) => te(t) || W(t) ? t : null, Jt = (t, e) => t === !1 || me(t) && t > 0 ? t : e, $e = (t) => Ce(t) || te(t) || W(t) || me(t);
|
|
22
|
+
function Qt(t, e, r = 300) {
|
|
23
|
+
let { scrollHeight: n, style: s } = t;
|
|
24
|
+
requestAnimationFrame(() => {
|
|
25
|
+
s.minHeight = "initial", s.height = n + "px", s.transition = `all ${r}ms`, requestAnimationFrame(() => {
|
|
26
|
+
s.height = "0", s.padding = "0", s.margin = "0", setTimeout(e, r);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function Gt({ enter: t, exit: e, appendPosition: r = !1, collapse: n = !0, collapseDuration: s = 300 }) {
|
|
31
|
+
return function({ children: a, position: i, preventExitTransition: o, done: c, nodeRef: l, isIn: u, playToast: C }) {
|
|
32
|
+
let j = r ? `${t}--${i}` : t, Z = r ? `${e}--${i}` : e, P = le(0);
|
|
33
|
+
return pt(() => {
|
|
34
|
+
let N = l.current, E = j.split(" "), T = (p) => {
|
|
35
|
+
p.target === l.current && (C(), N.removeEventListener("animationend", T), N.removeEventListener("animationcancel", T), P.current === 0 && p.type !== "animationcancel" && N.classList.remove(...E));
|
|
36
|
+
};
|
|
37
|
+
N.classList.add(...E), N.addEventListener("animationend", T), N.addEventListener("animationcancel", T);
|
|
38
|
+
}, []), Te(() => {
|
|
39
|
+
let N = l.current, E = () => {
|
|
40
|
+
N.removeEventListener("animationend", E), n ? Qt(N, c, s) : c();
|
|
41
|
+
};
|
|
42
|
+
u || (o ? E() : (P.current = 1, N.className += ` ${Z}`, N.addEventListener("animationend", E)));
|
|
43
|
+
}, [u]), I.createElement(I.Fragment, null, a);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function Xe(t, e) {
|
|
47
|
+
return { content: At(t.content, t.props), containerId: t.props.containerId, id: t.props.toastId, theme: t.props.theme, type: t.props.type, data: t.props.data || {}, isLoading: t.props.isLoading, icon: t.props.icon, reason: t.removalReason, status: e };
|
|
48
|
+
}
|
|
49
|
+
function At(t, e, r = !1) {
|
|
50
|
+
return Ce(t) && !te(t.type) ? Fe(t, { closeToast: e.closeToast, toastProps: e, data: e.data, isPaused: r }) : W(t) ? t({ closeToast: e.closeToast, toastProps: e, data: e.data, isPaused: r }) : t;
|
|
51
|
+
}
|
|
52
|
+
function Kt({ closeToast: t, theme: e, ariaLabel: r = "close" }) {
|
|
53
|
+
return I.createElement("button", { className: `Toastify__close-button Toastify__close-button--${e}`, type: "button", onClick: (n) => {
|
|
54
|
+
n.stopPropagation(), t(!0);
|
|
55
|
+
}, "aria-label": r }, I.createElement("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, I.createElement("path", { fillRule: "evenodd", d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z" })));
|
|
56
|
+
}
|
|
57
|
+
function er({ delay: t, isRunning: e, closeToast: r, type: n = "default", hide: s, className: a, controlledProgress: i, progress: o, rtl: c, isIn: l, theme: u }) {
|
|
58
|
+
let C = s || i && o === 0, j = { animationDuration: `${t}ms`, animationPlayState: e ? "running" : "paused" };
|
|
59
|
+
i && (j.transform = `scaleX(${o})`);
|
|
60
|
+
let Z = ee("Toastify__progress-bar", i ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", `Toastify__progress-bar-theme--${u}`, `Toastify__progress-bar--${n}`, { "Toastify__progress-bar--rtl": c }), P = W(a) ? a({ rtl: c, type: n, defaultClassName: Z }) : ee(Z, a), N = { [i && o >= 1 ? "onTransitionEnd" : "onAnimationEnd"]: i && o < 1 ? null : () => {
|
|
61
|
+
l && r();
|
|
62
|
+
} };
|
|
63
|
+
return I.createElement("div", { className: "Toastify__progress-bar--wrp", "data-hidden": C }, I.createElement("div", { className: `Toastify__progress-bar--bg Toastify__progress-bar-theme--${u} Toastify__progress-bar--${n}` }), I.createElement("div", { role: "progressbar", "aria-hidden": C ? "true" : "false", "aria-label": "notification timer", className: P, style: j, ...N }));
|
|
64
|
+
}
|
|
65
|
+
var tr = 1, Ot = () => `${tr++}`;
|
|
66
|
+
function rr(t, e, r) {
|
|
67
|
+
let n = 1, s = 0, a = [], i = [], o = e, c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = (p) => (l.add(p), () => l.delete(p)), C = () => {
|
|
68
|
+
i = Array.from(c.values()), l.forEach((p) => p());
|
|
69
|
+
}, j = ({ containerId: p, toastId: g, updateId: b }) => {
|
|
70
|
+
let R = p ? p !== t : t !== 1, L = c.has(g) && b == null;
|
|
71
|
+
return R || L;
|
|
72
|
+
}, Z = (p, g) => {
|
|
73
|
+
c.forEach((b) => {
|
|
74
|
+
var R;
|
|
75
|
+
(g == null || g === b.props.toastId) && ((R = b.toggle) == null || R.call(b, p));
|
|
76
|
+
});
|
|
77
|
+
}, P = (p) => {
|
|
78
|
+
var g, b;
|
|
79
|
+
(b = (g = p.props) == null ? void 0 : g.onClose) == null || b.call(g, p.removalReason), p.isActive = !1;
|
|
80
|
+
}, N = (p) => {
|
|
81
|
+
if (p == null) c.forEach(P);
|
|
82
|
+
else {
|
|
83
|
+
let g = c.get(p);
|
|
84
|
+
g && P(g);
|
|
85
|
+
}
|
|
86
|
+
C();
|
|
87
|
+
}, E = () => {
|
|
88
|
+
s -= a.length, a = [];
|
|
89
|
+
}, T = (p) => {
|
|
90
|
+
var g, b;
|
|
91
|
+
let { toastId: R, updateId: L } = p.props, w = L == null;
|
|
92
|
+
p.staleId && c.delete(p.staleId), p.isActive = !0, c.set(R, p), C(), r(Xe(p, w ? "added" : "updated")), w && ((b = (g = p.props).onOpen) == null || b.call(g));
|
|
93
|
+
};
|
|
94
|
+
return { id: t, props: o, observe: u, toggle: Z, removeToast: N, toasts: c, clearQueue: E, buildToast: (p, g) => {
|
|
95
|
+
if (j(g)) return;
|
|
96
|
+
let { toastId: b, updateId: R, data: L, staleId: w, delay: O } = g, V = R == null;
|
|
97
|
+
V && s++;
|
|
98
|
+
let H = { ...o, style: o.toastStyle, key: n++, ...Object.fromEntries(Object.entries(g).filter(([K, ge]) => ge != null)), toastId: b, updateId: R, data: L, isIn: !1, className: Ze(g.className || o.toastClassName), progressClassName: Ze(g.progressClassName || o.progressClassName), autoClose: g.isLoading ? !1 : Jt(g.autoClose, o.autoClose), closeToast(K) {
|
|
99
|
+
c.get(b).removalReason = K, N(b);
|
|
100
|
+
}, deleteToast() {
|
|
101
|
+
let K = c.get(b);
|
|
102
|
+
if (K != null) {
|
|
103
|
+
if (r(Xe(K, "removed")), c.delete(b), s--, s < 0 && (s = 0), a.length > 0) {
|
|
104
|
+
T(a.shift());
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
C();
|
|
108
|
+
}
|
|
109
|
+
} };
|
|
110
|
+
H.closeButton = o.closeButton, g.closeButton === !1 || $e(g.closeButton) ? H.closeButton = g.closeButton : g.closeButton === !0 && (H.closeButton = $e(o.closeButton) ? o.closeButton : !0);
|
|
111
|
+
let U = { content: p, props: H, staleId: w };
|
|
112
|
+
o.limit && o.limit > 0 && s > o.limit && V ? a.push(U) : me(O) ? setTimeout(() => {
|
|
113
|
+
T(U);
|
|
114
|
+
}, O) : T(U);
|
|
115
|
+
}, setProps(p) {
|
|
116
|
+
o = p;
|
|
117
|
+
}, setToggle: (p, g) => {
|
|
118
|
+
let b = c.get(p);
|
|
119
|
+
b && (b.toggle = g);
|
|
120
|
+
}, isToastActive: (p) => {
|
|
121
|
+
var g;
|
|
122
|
+
return (g = c.get(p)) == null ? void 0 : g.isActive;
|
|
123
|
+
}, getSnapshot: () => i };
|
|
124
|
+
}
|
|
125
|
+
var $ = /* @__PURE__ */ new Map(), de = [], Pe = /* @__PURE__ */ new Set(), nr = (t) => Pe.forEach((e) => e(t)), Nt = () => $.size > 0;
|
|
126
|
+
function sr() {
|
|
127
|
+
de.forEach((t) => St(t.content, t.options)), de = [];
|
|
128
|
+
}
|
|
129
|
+
var ar = (t, { containerId: e }) => {
|
|
130
|
+
var r;
|
|
131
|
+
return (r = $.get(e || 1)) == null ? void 0 : r.toasts.get(t);
|
|
132
|
+
};
|
|
133
|
+
function It(t, e) {
|
|
134
|
+
var r;
|
|
135
|
+
if (e) return !!((r = $.get(e)) != null && r.isToastActive(t));
|
|
136
|
+
let n = !1;
|
|
137
|
+
return $.forEach((s) => {
|
|
138
|
+
s.isToastActive(t) && (n = !0);
|
|
139
|
+
}), n;
|
|
140
|
+
}
|
|
141
|
+
function ir(t) {
|
|
142
|
+
if (!Nt()) {
|
|
143
|
+
de = de.filter((e) => t != null && e.options.toastId !== t);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (t == null || Yt(t)) $.forEach((e) => {
|
|
147
|
+
e.removeToast(t);
|
|
148
|
+
});
|
|
149
|
+
else if (t && ("containerId" in t || "id" in t)) {
|
|
150
|
+
let e = $.get(t.containerId);
|
|
151
|
+
e ? e.removeToast(t.id) : $.forEach((r) => {
|
|
152
|
+
r.removeToast(t.id);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
var or = (t = {}) => {
|
|
157
|
+
$.forEach((e) => {
|
|
158
|
+
e.props.limit && (!t.containerId || e.id === t.containerId) && e.clearQueue();
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
function St(t, e) {
|
|
162
|
+
$e(t) && (Nt() || de.push({ content: t, options: e }), $.forEach((r) => {
|
|
163
|
+
r.buildToast(t, e);
|
|
164
|
+
}));
|
|
165
|
+
}
|
|
166
|
+
function cr(t) {
|
|
167
|
+
var e;
|
|
168
|
+
(e = $.get(t.containerId || 1)) == null || e.setToggle(t.id, t.fn);
|
|
169
|
+
}
|
|
170
|
+
function Rt(t, e) {
|
|
171
|
+
$.forEach((r) => {
|
|
172
|
+
(e == null || !(e != null && e.containerId) || (e == null ? void 0 : e.containerId) === r.id) && r.toggle(t, e == null ? void 0 : e.id);
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function lr(t) {
|
|
176
|
+
let e = t.containerId || 1;
|
|
177
|
+
return { subscribe(r) {
|
|
178
|
+
let n = rr(e, t, nr);
|
|
179
|
+
$.set(e, n);
|
|
180
|
+
let s = n.observe(r);
|
|
181
|
+
return sr(), () => {
|
|
182
|
+
s(), $.delete(e);
|
|
183
|
+
};
|
|
184
|
+
}, setProps(r) {
|
|
185
|
+
var n;
|
|
186
|
+
(n = $.get(e)) == null || n.setProps(r);
|
|
187
|
+
}, getSnapshot() {
|
|
188
|
+
var r;
|
|
189
|
+
return (r = $.get(e)) == null ? void 0 : r.getSnapshot();
|
|
190
|
+
} };
|
|
191
|
+
}
|
|
192
|
+
function dr(t) {
|
|
193
|
+
return Pe.add(t), () => {
|
|
194
|
+
Pe.delete(t);
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function ur(t) {
|
|
198
|
+
return t && (te(t.toastId) || me(t.toastId)) ? t.toastId : Ot();
|
|
199
|
+
}
|
|
200
|
+
function pe(t, e) {
|
|
201
|
+
return St(t, e), e.toastId;
|
|
202
|
+
}
|
|
203
|
+
function Ee(t, e) {
|
|
204
|
+
return { ...e, type: e && e.type || t, toastId: ur(e) };
|
|
205
|
+
}
|
|
206
|
+
function Ae(t) {
|
|
207
|
+
return (e, r) => pe(e, Ee(t, r));
|
|
208
|
+
}
|
|
209
|
+
function A(t, e) {
|
|
210
|
+
return pe(t, Ee("default", e));
|
|
211
|
+
}
|
|
212
|
+
A.loading = (t, e) => pe(t, Ee("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...e }));
|
|
213
|
+
function fr(t, { pending: e, error: r, success: n }, s) {
|
|
214
|
+
let a;
|
|
215
|
+
e && (a = te(e) ? A.loading(e, s) : A.loading(e.render, { ...s, ...e }));
|
|
216
|
+
let i = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, o = (l, u, C) => {
|
|
217
|
+
if (u == null) {
|
|
218
|
+
A.dismiss(a);
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
let j = { type: l, ...i, ...s, data: C }, Z = te(u) ? { render: u } : u;
|
|
222
|
+
return a ? A.update(a, { ...j, ...Z }) : A(Z.render, { ...j, ...Z }), C;
|
|
223
|
+
}, c = W(t) ? t() : t;
|
|
224
|
+
return c.then((l) => o("success", n, l)).catch((l) => o("error", r, l)), c;
|
|
225
|
+
}
|
|
226
|
+
A.promise = fr;
|
|
227
|
+
A.success = Ae("success");
|
|
228
|
+
A.info = Ae("info");
|
|
229
|
+
A.error = Ae("error");
|
|
230
|
+
A.warning = Ae("warning");
|
|
231
|
+
A.warn = A.warning;
|
|
232
|
+
A.dark = (t, e) => pe(t, Ee("default", { theme: "dark", ...e }));
|
|
233
|
+
function hr(t) {
|
|
234
|
+
ir(t);
|
|
235
|
+
}
|
|
236
|
+
A.dismiss = hr;
|
|
237
|
+
A.clearWaitingQueue = or;
|
|
238
|
+
A.isActive = It;
|
|
239
|
+
A.update = (t, e = {}) => {
|
|
240
|
+
let r = ar(t, e);
|
|
241
|
+
if (r) {
|
|
242
|
+
let { props: n, content: s } = r, a = { delay: 100, ...n, ...e, toastId: e.toastId || t, updateId: Ot() };
|
|
243
|
+
a.toastId !== t && (a.staleId = t);
|
|
244
|
+
let i = a.render || s;
|
|
245
|
+
delete a.render, pe(i, a);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
A.done = (t) => {
|
|
249
|
+
A.update(t, { progress: 1 });
|
|
250
|
+
};
|
|
251
|
+
A.onChange = dr;
|
|
252
|
+
A.play = (t) => Rt(!0, t);
|
|
253
|
+
A.pause = (t) => Rt(!1, t);
|
|
254
|
+
function mr(t) {
|
|
255
|
+
var e;
|
|
256
|
+
let { subscribe: r, getSnapshot: n, setProps: s } = le(lr(t)).current;
|
|
257
|
+
s(t);
|
|
258
|
+
let a = (e = Ut(r, n, n)) == null ? void 0 : e.slice();
|
|
259
|
+
function i(o) {
|
|
260
|
+
if (!a) return [];
|
|
261
|
+
let c = /* @__PURE__ */ new Map();
|
|
262
|
+
return t.newestOnTop && a.reverse(), a.forEach((l) => {
|
|
263
|
+
let { position: u } = l.props;
|
|
264
|
+
c.has(u) || c.set(u, []), c.get(u).push(l);
|
|
265
|
+
}), Array.from(c, (l) => o(l[0], l[1]));
|
|
266
|
+
}
|
|
267
|
+
return { getToastToRender: i, isToastActive: It, count: a == null ? void 0 : a.length };
|
|
268
|
+
}
|
|
269
|
+
function pr(t) {
|
|
270
|
+
let [e, r] = Re(!1), [n, s] = Re(!1), a = le(null), i = le({ start: 0, delta: 0, removalDistance: 0, canCloseOnClick: !0, canDrag: !1, didMove: !1 }).current, { autoClose: o, pauseOnHover: c, closeToast: l, onClick: u, closeOnClick: C } = t;
|
|
271
|
+
cr({ id: t.toastId, containerId: t.containerId, fn: r }), Te(() => {
|
|
272
|
+
if (t.pauseOnFocusLoss) return j(), () => {
|
|
273
|
+
Z();
|
|
274
|
+
};
|
|
275
|
+
}, [t.pauseOnFocusLoss]);
|
|
276
|
+
function j() {
|
|
277
|
+
document.hasFocus() || T(), window.addEventListener("focus", E), window.addEventListener("blur", T);
|
|
278
|
+
}
|
|
279
|
+
function Z() {
|
|
280
|
+
window.removeEventListener("focus", E), window.removeEventListener("blur", T);
|
|
281
|
+
}
|
|
282
|
+
function P(w) {
|
|
283
|
+
if (t.draggable === !0 || t.draggable === w.pointerType) {
|
|
284
|
+
p();
|
|
285
|
+
let O = a.current;
|
|
286
|
+
i.canCloseOnClick = !0, i.canDrag = !0, O.style.transition = "none", t.draggableDirection === "x" ? (i.start = w.clientX, i.removalDistance = O.offsetWidth * (t.draggablePercent / 100)) : (i.start = w.clientY, i.removalDistance = O.offsetHeight * (t.draggablePercent === 80 ? t.draggablePercent * 1.5 : t.draggablePercent) / 100);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
function N(w) {
|
|
290
|
+
let { top: O, bottom: V, left: H, right: U } = a.current.getBoundingClientRect();
|
|
291
|
+
w.nativeEvent.type !== "touchend" && t.pauseOnHover && w.clientX >= H && w.clientX <= U && w.clientY >= O && w.clientY <= V ? T() : E();
|
|
292
|
+
}
|
|
293
|
+
function E() {
|
|
294
|
+
r(!0);
|
|
295
|
+
}
|
|
296
|
+
function T() {
|
|
297
|
+
r(!1);
|
|
298
|
+
}
|
|
299
|
+
function p() {
|
|
300
|
+
i.didMove = !1, document.addEventListener("pointermove", b), document.addEventListener("pointerup", R);
|
|
301
|
+
}
|
|
302
|
+
function g() {
|
|
303
|
+
document.removeEventListener("pointermove", b), document.removeEventListener("pointerup", R);
|
|
304
|
+
}
|
|
305
|
+
function b(w) {
|
|
306
|
+
let O = a.current;
|
|
307
|
+
if (i.canDrag && O) {
|
|
308
|
+
i.didMove = !0, e && T(), t.draggableDirection === "x" ? i.delta = w.clientX - i.start : i.delta = w.clientY - i.start, i.start !== w.clientX && (i.canCloseOnClick = !1);
|
|
309
|
+
let V = t.draggableDirection === "x" ? `${i.delta}px, var(--y)` : `0, calc(${i.delta}px + var(--y))`;
|
|
310
|
+
O.style.transform = `translate3d(${V},0)`, O.style.opacity = `${1 - Math.abs(i.delta / i.removalDistance)}`;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
function R() {
|
|
314
|
+
g();
|
|
315
|
+
let w = a.current;
|
|
316
|
+
if (i.canDrag && i.didMove && w) {
|
|
317
|
+
if (i.canDrag = !1, Math.abs(i.delta) > i.removalDistance) {
|
|
318
|
+
s(!0), t.closeToast(!0), t.collapseAll();
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
w.style.transition = "transform 0.2s, opacity 0.2s", w.style.removeProperty("transform"), w.style.removeProperty("opacity");
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
let L = { onPointerDown: P, onPointerUp: N };
|
|
325
|
+
return o && c && (L.onMouseEnter = T, t.stacked || (L.onMouseLeave = E)), C && (L.onClick = (w) => {
|
|
326
|
+
u && u(w), i.canCloseOnClick && l(!0);
|
|
327
|
+
}), { playToast: E, pauseToast: T, isRunning: e, preventExitTransition: n, toastRef: a, eventHandlers: L };
|
|
328
|
+
}
|
|
329
|
+
var gr = typeof window < "u" ? pt : Te, Oe = ({ theme: t, type: e, isLoading: r, ...n }) => I.createElement("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", fill: t === "colored" ? "currentColor" : `var(--toastify-icon-color-${e})`, ...n });
|
|
330
|
+
function yr(t) {
|
|
331
|
+
return I.createElement(Oe, { ...t }, I.createElement("path", { d: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z" }));
|
|
332
|
+
}
|
|
333
|
+
function vr(t) {
|
|
334
|
+
return I.createElement(Oe, { ...t }, I.createElement("path", { d: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z" }));
|
|
335
|
+
}
|
|
336
|
+
function _r(t) {
|
|
337
|
+
return I.createElement(Oe, { ...t }, I.createElement("path", { d: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z" }));
|
|
338
|
+
}
|
|
339
|
+
function br(t) {
|
|
340
|
+
return I.createElement(Oe, { ...t }, I.createElement("path", { d: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z" }));
|
|
341
|
+
}
|
|
342
|
+
function xr() {
|
|
343
|
+
return I.createElement("div", { className: "Toastify__spinner" });
|
|
344
|
+
}
|
|
345
|
+
var Le = { info: vr, warning: yr, success: _r, error: br, spinner: xr }, kr = (t) => t in Le;
|
|
346
|
+
function wr({ theme: t, type: e, isLoading: r, icon: n }) {
|
|
347
|
+
let s = null, a = { theme: t, type: e };
|
|
348
|
+
return n === !1 || (W(n) ? s = n({ ...a, isLoading: r }) : Ce(n) ? s = Fe(n, a) : r ? s = Le.spinner() : kr(e) && (s = Le[e](a))), s;
|
|
349
|
+
}
|
|
350
|
+
var Tr = (t) => {
|
|
351
|
+
let { isRunning: e, preventExitTransition: r, toastRef: n, eventHandlers: s, playToast: a } = pr(t), { closeButton: i, children: o, autoClose: c, onClick: l, type: u, hideProgressBar: C, closeToast: j, transition: Z, position: P, className: N, style: E, progressClassName: T, updateId: p, role: g, progress: b, rtl: R, toastId: L, deleteToast: w, isIn: O, isLoading: V, closeOnClick: H, theme: U, ariaLabel: K } = t, ge = ee("Toastify__toast", `Toastify__toast-theme--${U}`, `Toastify__toast--${u}`, { "Toastify__toast--rtl": R }, { "Toastify__toast--close-on-click": H }), Bt = W(N) ? N({ rtl: R, position: P, type: u, defaultClassName: ge }) : ee(ge, N), qe = wr(t), He = !!b || !c, Ne = { closeToast: j, type: u, theme: U }, ye = null;
|
|
352
|
+
return i === !1 || (W(i) ? ye = i(Ne) : Ce(i) ? ye = Fe(i, Ne) : ye = Kt(Ne)), I.createElement(Z, { isIn: O, done: w, position: P, preventExitTransition: r, nodeRef: n, playToast: a }, I.createElement("div", { id: L, tabIndex: 0, onClick: l, "data-in": O, className: Bt, ...s, style: E, ref: n, ...O && { role: g, "aria-label": K } }, qe != null && I.createElement("div", { className: ee("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter": !V }) }, qe), At(o, t, !e), ye, !t.customProgressBar && I.createElement(er, { ...p && !He ? { key: `p-${p}` } : {}, rtl: R, theme: U, delay: c, isRunning: e, isIn: O, closeToast: j, hide: C, type: u, className: T, controlledProgress: He, progress: b || 0 })));
|
|
353
|
+
}, Cr = (t, e = !1) => ({ enter: `Toastify--animate Toastify__${t}-enter`, exit: `Toastify--animate Toastify__${t}-exit`, appendPosition: e }), Er = Gt(Cr("bounce", !0)), Ar = { position: "top-right", transition: Er, autoClose: 5e3, closeButton: !0, pauseOnHover: !0, pauseOnFocusLoss: !0, draggable: "touch", draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light", "aria-label": "Notifications Alt+T", hotKeys: (t) => t.altKey && t.code === "KeyT" };
|
|
354
|
+
function wn(t) {
|
|
355
|
+
let e = { ...Ar, ...t }, r = t.stacked, [n, s] = Re(!0), a = le(null), { getToastToRender: i, isToastActive: o, count: c } = mr(e), { className: l, style: u, rtl: C, containerId: j, hotKeys: Z } = e;
|
|
356
|
+
function P(E) {
|
|
357
|
+
let T = ee("Toastify__toast-container", `Toastify__toast-container--${E}`, { "Toastify__toast-container--rtl": C });
|
|
358
|
+
return W(l) ? l({ position: E, rtl: C, defaultClassName: T }) : ee(T, Ze(l));
|
|
359
|
+
}
|
|
360
|
+
function N() {
|
|
361
|
+
r && (s(!0), A.play());
|
|
362
|
+
}
|
|
363
|
+
return gr(() => {
|
|
364
|
+
var E;
|
|
365
|
+
if (r) {
|
|
366
|
+
let T = a.current.querySelectorAll('[data-in="true"]'), p = 12, g = (E = e.position) == null ? void 0 : E.includes("top"), b = 0, R = 0;
|
|
367
|
+
Array.from(T).reverse().forEach((L, w) => {
|
|
368
|
+
let O = L;
|
|
369
|
+
O.classList.add("Toastify__toast--stacked"), w > 0 && (O.dataset.collapsed = `${n}`), O.dataset.pos || (O.dataset.pos = g ? "top" : "bot");
|
|
370
|
+
let V = b * (n ? 0.2 : 1) + (n ? 0 : p * w);
|
|
371
|
+
O.style.setProperty("--y", `${g ? V : V * -1}px`), O.style.setProperty("--g", `${p}`), O.style.setProperty("--s", `${1 - (n ? R : 0)}`), b += O.offsetHeight, R += 0.025;
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}, [n, c, r]), Te(() => {
|
|
375
|
+
function E(T) {
|
|
376
|
+
var p;
|
|
377
|
+
let g = a.current;
|
|
378
|
+
Z(T) && ((p = g.querySelector('[tabIndex="0"]')) == null || p.focus(), s(!1), A.pause()), T.key === "Escape" && (document.activeElement === g || g != null && g.contains(document.activeElement)) && (s(!0), A.play());
|
|
379
|
+
}
|
|
380
|
+
return document.addEventListener("keydown", E), () => {
|
|
381
|
+
document.removeEventListener("keydown", E);
|
|
382
|
+
};
|
|
383
|
+
}, [Z]), I.createElement("section", { ref: a, className: "Toastify", id: j, onMouseEnter: () => {
|
|
384
|
+
r && (s(!1), A.pause());
|
|
385
|
+
}, onMouseLeave: N, "aria-live": "polite", "aria-atomic": "false", "aria-relevant": "additions text", "aria-label": e["aria-label"] }, i((E, T) => {
|
|
386
|
+
let p = T.length ? { ...u } : { ...u, pointerEvents: "none" };
|
|
387
|
+
return I.createElement("div", { tabIndex: -1, className: P(E), "data-stacked": r, style: p, key: `c-${E}` }, T.map(({ content: g, props: b }) => I.createElement(Tr, { ...b, stacked: r, collapseAll: N, isIn: o(b.toastId, b.containerId), key: `t-${b.key}` }, g)));
|
|
388
|
+
}));
|
|
389
|
+
}
|
|
390
|
+
const Tn = ({
|
|
391
|
+
title: t,
|
|
392
|
+
description: e,
|
|
393
|
+
children: r,
|
|
394
|
+
onConfirm: n,
|
|
395
|
+
...s
|
|
396
|
+
}) => {
|
|
397
|
+
const { t: a } = gt();
|
|
398
|
+
return /* @__PURE__ */ F(yt, { ...s, children: [
|
|
399
|
+
r && /* @__PURE__ */ M(vt, { children: r }),
|
|
400
|
+
/* @__PURE__ */ F(_t, { children: [
|
|
401
|
+
/* @__PURE__ */ F(bt, { children: [
|
|
402
|
+
/* @__PURE__ */ M(xt, { children: t || a("Are you absolutely sure?") }),
|
|
403
|
+
/* @__PURE__ */ M(Wt, { children: e || a(
|
|
404
|
+
"This action cannot be undone. This will permanently delete your data from our servers."
|
|
405
|
+
) })
|
|
406
|
+
] }),
|
|
407
|
+
/* @__PURE__ */ F(kt, { children: [
|
|
408
|
+
/* @__PURE__ */ M(wt, { className: "mt-0", children: a("Cancel") }),
|
|
409
|
+
/* @__PURE__ */ M(Tt, { onClick: n, children: a("Confirm") })
|
|
410
|
+
] })
|
|
411
|
+
] })
|
|
412
|
+
] });
|
|
413
|
+
}, Ye = (t, e, r) => {
|
|
414
|
+
if (t && "reportValidity" in t) {
|
|
415
|
+
const n = je(r, e);
|
|
416
|
+
t.setCustomValidity(n && n.message || ""), t.reportValidity();
|
|
417
|
+
}
|
|
418
|
+
}, ze = (t, e) => {
|
|
419
|
+
for (const r in e.fields) {
|
|
420
|
+
const n = e.fields[r];
|
|
421
|
+
n && n.ref && "reportValidity" in n.ref ? Ye(n.ref, r, t) : n && n.refs && n.refs.forEach((s) => Ye(s, r, t));
|
|
422
|
+
}
|
|
423
|
+
}, Je = (t, e) => {
|
|
424
|
+
e.shouldUseNativeValidation && ze(t, e);
|
|
425
|
+
const r = {};
|
|
426
|
+
for (const n in t) {
|
|
427
|
+
const s = je(e.fields, n), a = Object.assign(t[n] || {}, { ref: s && s.ref });
|
|
428
|
+
if (Or(e.names || Object.keys(t), n)) {
|
|
429
|
+
const i = Object.assign({}, je(r, n));
|
|
430
|
+
Ie(i, "root", a), Ie(r, n, i);
|
|
431
|
+
} else Ie(r, n, a);
|
|
432
|
+
}
|
|
433
|
+
return r;
|
|
434
|
+
}, Or = (t, e) => {
|
|
435
|
+
const r = Qe(e);
|
|
436
|
+
return t.some((n) => Qe(n).match(`^${r}\\.\\d+`));
|
|
437
|
+
};
|
|
438
|
+
function Qe(t) {
|
|
439
|
+
return t.replace(/\]|\[/g, "");
|
|
440
|
+
}
|
|
441
|
+
function jt(t, e, r) {
|
|
442
|
+
function n(o, c) {
|
|
443
|
+
var l;
|
|
444
|
+
Object.defineProperty(o, "_zod", {
|
|
445
|
+
value: o._zod ?? {},
|
|
446
|
+
enumerable: !1
|
|
447
|
+
}), (l = o._zod).traits ?? (l.traits = /* @__PURE__ */ new Set()), o._zod.traits.add(t), e(o, c);
|
|
448
|
+
for (const u in i.prototype)
|
|
449
|
+
u in o || Object.defineProperty(o, u, { value: i.prototype[u].bind(o) });
|
|
450
|
+
o._zod.constr = i, o._zod.def = c;
|
|
451
|
+
}
|
|
452
|
+
const s = (r == null ? void 0 : r.Parent) ?? Object;
|
|
453
|
+
class a extends s {
|
|
454
|
+
}
|
|
455
|
+
Object.defineProperty(a, "name", { value: t });
|
|
456
|
+
function i(o) {
|
|
457
|
+
var c;
|
|
458
|
+
const l = r != null && r.Parent ? new a() : this;
|
|
459
|
+
n(l, o), (c = l._zod).deferred ?? (c.deferred = []);
|
|
460
|
+
for (const u of l._zod.deferred)
|
|
461
|
+
u();
|
|
462
|
+
return l;
|
|
463
|
+
}
|
|
464
|
+
return Object.defineProperty(i, "init", { value: n }), Object.defineProperty(i, Symbol.hasInstance, {
|
|
465
|
+
value: (o) => {
|
|
466
|
+
var c, l;
|
|
467
|
+
return r != null && r.Parent && o instanceof r.Parent ? !0 : (l = (c = o == null ? void 0 : o._zod) == null ? void 0 : c.traits) == null ? void 0 : l.has(t);
|
|
468
|
+
}
|
|
469
|
+
}), Object.defineProperty(i, "name", { value: t }), i;
|
|
470
|
+
}
|
|
471
|
+
class Nr extends Error {
|
|
472
|
+
constructor() {
|
|
473
|
+
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
const Ir = {};
|
|
477
|
+
function Zt(t) {
|
|
478
|
+
return Ir;
|
|
479
|
+
}
|
|
480
|
+
function Sr(t, e) {
|
|
481
|
+
return typeof e == "bigint" ? e.toString() : e;
|
|
482
|
+
}
|
|
483
|
+
const $t = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
|
|
484
|
+
};
|
|
485
|
+
function ve(t) {
|
|
486
|
+
return typeof t == "string" ? t : t == null ? void 0 : t.message;
|
|
487
|
+
}
|
|
488
|
+
function Pt(t, e, r) {
|
|
489
|
+
var s, a, i, o, c, l;
|
|
490
|
+
const n = { ...t, path: t.path ?? [] };
|
|
491
|
+
if (!t.message) {
|
|
492
|
+
const u = ve((i = (a = (s = t.inst) == null ? void 0 : s._zod.def) == null ? void 0 : a.error) == null ? void 0 : i.call(a, t)) ?? ve((o = e == null ? void 0 : e.error) == null ? void 0 : o.call(e, t)) ?? ve((c = r.customError) == null ? void 0 : c.call(r, t)) ?? ve((l = r.localeError) == null ? void 0 : l.call(r, t)) ?? "Invalid input";
|
|
493
|
+
n.message = u;
|
|
494
|
+
}
|
|
495
|
+
return delete n.inst, delete n.continue, e != null && e.reportInput || delete n.input, n;
|
|
496
|
+
}
|
|
497
|
+
const Lt = (t, e) => {
|
|
498
|
+
t.name = "$ZodError", Object.defineProperty(t, "_zod", {
|
|
499
|
+
value: t._zod,
|
|
500
|
+
enumerable: !1
|
|
501
|
+
}), Object.defineProperty(t, "issues", {
|
|
502
|
+
value: e,
|
|
503
|
+
enumerable: !1
|
|
504
|
+
}), Object.defineProperty(t, "message", {
|
|
505
|
+
get() {
|
|
506
|
+
return JSON.stringify(e, Sr, 2);
|
|
507
|
+
},
|
|
508
|
+
enumerable: !0
|
|
509
|
+
// configurable: false,
|
|
510
|
+
}), Object.defineProperty(t, "toString", {
|
|
511
|
+
value: () => t.message,
|
|
512
|
+
enumerable: !1
|
|
513
|
+
});
|
|
514
|
+
}, Rr = jt("$ZodError", Lt), zt = jt("$ZodError", Lt, { Parent: Error }), jr = (t) => (e, r, n, s) => {
|
|
515
|
+
const a = n ? Object.assign(n, { async: !1 }) : { async: !1 }, i = e._zod.run({ value: r, issues: [] }, a);
|
|
516
|
+
if (i instanceof Promise)
|
|
517
|
+
throw new Nr();
|
|
518
|
+
if (i.issues.length) {
|
|
519
|
+
const o = new ((s == null ? void 0 : s.Err) ?? t)(i.issues.map((c) => Pt(c, a, Zt())));
|
|
520
|
+
throw $t(o, s == null ? void 0 : s.callee), o;
|
|
521
|
+
}
|
|
522
|
+
return i.value;
|
|
523
|
+
}, Zr = /* @__PURE__ */ jr(zt), $r = (t) => async (e, r, n, s) => {
|
|
524
|
+
const a = n ? Object.assign(n, { async: !0 }) : { async: !0 };
|
|
525
|
+
let i = e._zod.run({ value: r, issues: [] }, a);
|
|
526
|
+
if (i instanceof Promise && (i = await i), i.issues.length) {
|
|
527
|
+
const o = new ((s == null ? void 0 : s.Err) ?? t)(i.issues.map((c) => Pt(c, a, Zt())));
|
|
528
|
+
throw $t(o, s == null ? void 0 : s.callee), o;
|
|
529
|
+
}
|
|
530
|
+
return i.value;
|
|
531
|
+
}, Pr = /* @__PURE__ */ $r(zt);
|
|
532
|
+
function Ge(t, e) {
|
|
533
|
+
try {
|
|
534
|
+
var r = t();
|
|
535
|
+
} catch (n) {
|
|
536
|
+
return e(n);
|
|
537
|
+
}
|
|
538
|
+
return r && r.then ? r.then(void 0, e) : r;
|
|
539
|
+
}
|
|
540
|
+
function Lr(t, e) {
|
|
541
|
+
for (var r = {}; t.length; ) {
|
|
542
|
+
var n = t[0], s = n.code, a = n.message, i = n.path.join(".");
|
|
543
|
+
if (!r[i]) if ("unionErrors" in n) {
|
|
544
|
+
var o = n.unionErrors[0].errors[0];
|
|
545
|
+
r[i] = { message: o.message, type: o.code };
|
|
546
|
+
} else r[i] = { message: a, type: s };
|
|
547
|
+
if ("unionErrors" in n && n.unionErrors.forEach(function(u) {
|
|
548
|
+
return u.errors.forEach(function(C) {
|
|
549
|
+
return t.push(C);
|
|
550
|
+
});
|
|
551
|
+
}), e) {
|
|
552
|
+
var c = r[i].types, l = c && c[n.code];
|
|
553
|
+
r[i] = Ct(i, e, r, s, l ? [].concat(l, n.message) : n.message);
|
|
554
|
+
}
|
|
555
|
+
t.shift();
|
|
556
|
+
}
|
|
557
|
+
return r;
|
|
558
|
+
}
|
|
559
|
+
function zr(t, e) {
|
|
560
|
+
for (var r = {}; t.length; ) {
|
|
561
|
+
var n = t[0], s = n.code, a = n.message, i = n.path.join(".");
|
|
562
|
+
if (!r[i]) if (n.code === "invalid_union" && n.errors.length > 0) {
|
|
563
|
+
var o = n.errors[0][0];
|
|
564
|
+
r[i] = { message: o.message, type: o.code };
|
|
565
|
+
} else r[i] = { message: a, type: s };
|
|
566
|
+
if (n.code === "invalid_union" && n.errors.forEach(function(u) {
|
|
567
|
+
return u.forEach(function(C) {
|
|
568
|
+
return t.push(C);
|
|
569
|
+
});
|
|
570
|
+
}), e) {
|
|
571
|
+
var c = r[i].types, l = c && c[n.code];
|
|
572
|
+
r[i] = Ct(i, e, r, s, l ? [].concat(l, n.message) : n.message);
|
|
573
|
+
}
|
|
574
|
+
t.shift();
|
|
575
|
+
}
|
|
576
|
+
return r;
|
|
577
|
+
}
|
|
578
|
+
function Mr(t, e, r) {
|
|
579
|
+
if (r === void 0 && (r = {}), (function(n) {
|
|
580
|
+
return "_def" in n && typeof n._def == "object" && "typeName" in n._def;
|
|
581
|
+
})(t)) return function(n, s, a) {
|
|
582
|
+
try {
|
|
583
|
+
return Promise.resolve(Ge(function() {
|
|
584
|
+
return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](n, e)).then(function(i) {
|
|
585
|
+
return a.shouldUseNativeValidation && ze({}, a), { errors: {}, values: r.raw ? Object.assign({}, n) : i };
|
|
586
|
+
});
|
|
587
|
+
}, function(i) {
|
|
588
|
+
if ((function(o) {
|
|
589
|
+
return Array.isArray(o == null ? void 0 : o.issues);
|
|
590
|
+
})(i)) return { values: {}, errors: Je(Lr(i.errors, !a.shouldUseNativeValidation && a.criteriaMode === "all"), a) };
|
|
591
|
+
throw i;
|
|
592
|
+
}));
|
|
593
|
+
} catch (i) {
|
|
594
|
+
return Promise.reject(i);
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
if ((function(n) {
|
|
598
|
+
return "_zod" in n && typeof n._zod == "object";
|
|
599
|
+
})(t)) return function(n, s, a) {
|
|
600
|
+
try {
|
|
601
|
+
return Promise.resolve(Ge(function() {
|
|
602
|
+
return Promise.resolve((r.mode === "sync" ? Zr : Pr)(t, n, e)).then(function(i) {
|
|
603
|
+
return a.shouldUseNativeValidation && ze({}, a), { errors: {}, values: r.raw ? Object.assign({}, n) : i };
|
|
604
|
+
});
|
|
605
|
+
}, function(i) {
|
|
606
|
+
if ((function(o) {
|
|
607
|
+
return o instanceof Rr;
|
|
608
|
+
})(i)) return { values: {}, errors: Je(zr(i.issues, !a.shouldUseNativeValidation && a.criteriaMode === "all"), a) };
|
|
609
|
+
throw i;
|
|
610
|
+
}));
|
|
611
|
+
} catch (i) {
|
|
612
|
+
return Promise.reject(i);
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
throw new Error("Invalid input: not a Zod schema");
|
|
616
|
+
}
|
|
617
|
+
var k;
|
|
618
|
+
(function(t) {
|
|
619
|
+
t.assertEqual = (s) => {
|
|
620
|
+
};
|
|
621
|
+
function e(s) {
|
|
622
|
+
}
|
|
623
|
+
t.assertIs = e;
|
|
624
|
+
function r(s) {
|
|
625
|
+
throw new Error();
|
|
626
|
+
}
|
|
627
|
+
t.assertNever = r, t.arrayToEnum = (s) => {
|
|
628
|
+
const a = {};
|
|
629
|
+
for (const i of s)
|
|
630
|
+
a[i] = i;
|
|
631
|
+
return a;
|
|
632
|
+
}, t.getValidEnumValues = (s) => {
|
|
633
|
+
const a = t.objectKeys(s).filter((o) => typeof s[s[o]] != "number"), i = {};
|
|
634
|
+
for (const o of a)
|
|
635
|
+
i[o] = s[o];
|
|
636
|
+
return t.objectValues(i);
|
|
637
|
+
}, t.objectValues = (s) => t.objectKeys(s).map(function(a) {
|
|
638
|
+
return s[a];
|
|
639
|
+
}), t.objectKeys = typeof Object.keys == "function" ? (s) => Object.keys(s) : (s) => {
|
|
640
|
+
const a = [];
|
|
641
|
+
for (const i in s)
|
|
642
|
+
Object.prototype.hasOwnProperty.call(s, i) && a.push(i);
|
|
643
|
+
return a;
|
|
644
|
+
}, t.find = (s, a) => {
|
|
645
|
+
for (const i of s)
|
|
646
|
+
if (a(i))
|
|
647
|
+
return i;
|
|
648
|
+
}, t.isInteger = typeof Number.isInteger == "function" ? (s) => Number.isInteger(s) : (s) => typeof s == "number" && Number.isFinite(s) && Math.floor(s) === s;
|
|
649
|
+
function n(s, a = " | ") {
|
|
650
|
+
return s.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
|
|
651
|
+
}
|
|
652
|
+
t.joinValues = n, t.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
653
|
+
})(k || (k = {}));
|
|
654
|
+
var Ke;
|
|
655
|
+
(function(t) {
|
|
656
|
+
t.mergeShapes = (e, r) => ({
|
|
657
|
+
...e,
|
|
658
|
+
...r
|
|
659
|
+
// second overwrites first
|
|
660
|
+
});
|
|
661
|
+
})(Ke || (Ke = {}));
|
|
662
|
+
const h = k.arrayToEnum([
|
|
663
|
+
"string",
|
|
664
|
+
"nan",
|
|
665
|
+
"number",
|
|
666
|
+
"integer",
|
|
667
|
+
"float",
|
|
668
|
+
"boolean",
|
|
669
|
+
"date",
|
|
670
|
+
"bigint",
|
|
671
|
+
"symbol",
|
|
672
|
+
"function",
|
|
673
|
+
"undefined",
|
|
674
|
+
"null",
|
|
675
|
+
"array",
|
|
676
|
+
"object",
|
|
677
|
+
"unknown",
|
|
678
|
+
"promise",
|
|
679
|
+
"void",
|
|
680
|
+
"never",
|
|
681
|
+
"map",
|
|
682
|
+
"set"
|
|
683
|
+
]), X = (t) => {
|
|
684
|
+
switch (typeof t) {
|
|
685
|
+
case "undefined":
|
|
686
|
+
return h.undefined;
|
|
687
|
+
case "string":
|
|
688
|
+
return h.string;
|
|
689
|
+
case "number":
|
|
690
|
+
return Number.isNaN(t) ? h.nan : h.number;
|
|
691
|
+
case "boolean":
|
|
692
|
+
return h.boolean;
|
|
693
|
+
case "function":
|
|
694
|
+
return h.function;
|
|
695
|
+
case "bigint":
|
|
696
|
+
return h.bigint;
|
|
697
|
+
case "symbol":
|
|
698
|
+
return h.symbol;
|
|
699
|
+
case "object":
|
|
700
|
+
return Array.isArray(t) ? h.array : t === null ? h.null : t.then && typeof t.then == "function" && t.catch && typeof t.catch == "function" ? h.promise : typeof Map < "u" && t instanceof Map ? h.map : typeof Set < "u" && t instanceof Set ? h.set : typeof Date < "u" && t instanceof Date ? h.date : h.object;
|
|
701
|
+
default:
|
|
702
|
+
return h.unknown;
|
|
703
|
+
}
|
|
704
|
+
}, d = k.arrayToEnum([
|
|
705
|
+
"invalid_type",
|
|
706
|
+
"invalid_literal",
|
|
707
|
+
"custom",
|
|
708
|
+
"invalid_union",
|
|
709
|
+
"invalid_union_discriminator",
|
|
710
|
+
"invalid_enum_value",
|
|
711
|
+
"unrecognized_keys",
|
|
712
|
+
"invalid_arguments",
|
|
713
|
+
"invalid_return_type",
|
|
714
|
+
"invalid_date",
|
|
715
|
+
"invalid_string",
|
|
716
|
+
"too_small",
|
|
717
|
+
"too_big",
|
|
718
|
+
"invalid_intersection_types",
|
|
719
|
+
"not_multiple_of",
|
|
720
|
+
"not_finite"
|
|
721
|
+
]);
|
|
722
|
+
class q extends Error {
|
|
723
|
+
get errors() {
|
|
724
|
+
return this.issues;
|
|
725
|
+
}
|
|
726
|
+
constructor(e) {
|
|
727
|
+
super(), this.issues = [], this.addIssue = (n) => {
|
|
728
|
+
this.issues = [...this.issues, n];
|
|
729
|
+
}, this.addIssues = (n = []) => {
|
|
730
|
+
this.issues = [...this.issues, ...n];
|
|
731
|
+
};
|
|
732
|
+
const r = new.target.prototype;
|
|
733
|
+
Object.setPrototypeOf ? Object.setPrototypeOf(this, r) : this.__proto__ = r, this.name = "ZodError", this.issues = e;
|
|
734
|
+
}
|
|
735
|
+
format(e) {
|
|
736
|
+
const r = e || function(a) {
|
|
737
|
+
return a.message;
|
|
738
|
+
}, n = { _errors: [] }, s = (a) => {
|
|
739
|
+
for (const i of a.issues)
|
|
740
|
+
if (i.code === "invalid_union")
|
|
741
|
+
i.unionErrors.map(s);
|
|
742
|
+
else if (i.code === "invalid_return_type")
|
|
743
|
+
s(i.returnTypeError);
|
|
744
|
+
else if (i.code === "invalid_arguments")
|
|
745
|
+
s(i.argumentsError);
|
|
746
|
+
else if (i.path.length === 0)
|
|
747
|
+
n._errors.push(r(i));
|
|
748
|
+
else {
|
|
749
|
+
let o = n, c = 0;
|
|
750
|
+
for (; c < i.path.length; ) {
|
|
751
|
+
const l = i.path[c];
|
|
752
|
+
c === i.path.length - 1 ? (o[l] = o[l] || { _errors: [] }, o[l]._errors.push(r(i))) : o[l] = o[l] || { _errors: [] }, o = o[l], c++;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
};
|
|
756
|
+
return s(this), n;
|
|
757
|
+
}
|
|
758
|
+
static assert(e) {
|
|
759
|
+
if (!(e instanceof q))
|
|
760
|
+
throw new Error(`Not a ZodError: ${e}`);
|
|
761
|
+
}
|
|
762
|
+
toString() {
|
|
763
|
+
return this.message;
|
|
764
|
+
}
|
|
765
|
+
get message() {
|
|
766
|
+
return JSON.stringify(this.issues, k.jsonStringifyReplacer, 2);
|
|
767
|
+
}
|
|
768
|
+
get isEmpty() {
|
|
769
|
+
return this.issues.length === 0;
|
|
770
|
+
}
|
|
771
|
+
flatten(e = (r) => r.message) {
|
|
772
|
+
const r = {}, n = [];
|
|
773
|
+
for (const s of this.issues)
|
|
774
|
+
if (s.path.length > 0) {
|
|
775
|
+
const a = s.path[0];
|
|
776
|
+
r[a] = r[a] || [], r[a].push(e(s));
|
|
777
|
+
} else
|
|
778
|
+
n.push(e(s));
|
|
779
|
+
return { formErrors: n, fieldErrors: r };
|
|
780
|
+
}
|
|
781
|
+
get formErrors() {
|
|
782
|
+
return this.flatten();
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
q.create = (t) => new q(t);
|
|
786
|
+
const Me = (t, e) => {
|
|
787
|
+
let r;
|
|
788
|
+
switch (t.code) {
|
|
789
|
+
case d.invalid_type:
|
|
790
|
+
t.received === h.undefined ? r = "Required" : r = `Expected ${t.expected}, received ${t.received}`;
|
|
791
|
+
break;
|
|
792
|
+
case d.invalid_literal:
|
|
793
|
+
r = `Invalid literal value, expected ${JSON.stringify(t.expected, k.jsonStringifyReplacer)}`;
|
|
794
|
+
break;
|
|
795
|
+
case d.unrecognized_keys:
|
|
796
|
+
r = `Unrecognized key(s) in object: ${k.joinValues(t.keys, ", ")}`;
|
|
797
|
+
break;
|
|
798
|
+
case d.invalid_union:
|
|
799
|
+
r = "Invalid input";
|
|
800
|
+
break;
|
|
801
|
+
case d.invalid_union_discriminator:
|
|
802
|
+
r = `Invalid discriminator value. Expected ${k.joinValues(t.options)}`;
|
|
803
|
+
break;
|
|
804
|
+
case d.invalid_enum_value:
|
|
805
|
+
r = `Invalid enum value. Expected ${k.joinValues(t.options)}, received '${t.received}'`;
|
|
806
|
+
break;
|
|
807
|
+
case d.invalid_arguments:
|
|
808
|
+
r = "Invalid function arguments";
|
|
809
|
+
break;
|
|
810
|
+
case d.invalid_return_type:
|
|
811
|
+
r = "Invalid function return type";
|
|
812
|
+
break;
|
|
813
|
+
case d.invalid_date:
|
|
814
|
+
r = "Invalid date";
|
|
815
|
+
break;
|
|
816
|
+
case d.invalid_string:
|
|
817
|
+
typeof t.validation == "object" ? "includes" in t.validation ? (r = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (r = `${r} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? r = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? r = `Invalid input: must end with "${t.validation.endsWith}"` : k.assertNever(t.validation) : t.validation !== "regex" ? r = `Invalid ${t.validation}` : r = "Invalid";
|
|
818
|
+
break;
|
|
819
|
+
case d.too_small:
|
|
820
|
+
t.type === "array" ? r = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? r = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? r = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "bigint" ? r = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? r = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : r = "Invalid input";
|
|
821
|
+
break;
|
|
822
|
+
case d.too_big:
|
|
823
|
+
t.type === "array" ? r = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "less than"} ${t.maximum} element(s)` : t.type === "string" ? r = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "under"} ${t.maximum} character(s)` : t.type === "number" ? r = `Number must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "bigint" ? r = `BigInt must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "date" ? r = `Date must be ${t.exact ? "exactly" : t.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(t.maximum))}` : r = "Invalid input";
|
|
824
|
+
break;
|
|
825
|
+
case d.custom:
|
|
826
|
+
r = "Invalid input";
|
|
827
|
+
break;
|
|
828
|
+
case d.invalid_intersection_types:
|
|
829
|
+
r = "Intersection results could not be merged";
|
|
830
|
+
break;
|
|
831
|
+
case d.not_multiple_of:
|
|
832
|
+
r = `Number must be a multiple of ${t.multipleOf}`;
|
|
833
|
+
break;
|
|
834
|
+
case d.not_finite:
|
|
835
|
+
r = "Number must be finite";
|
|
836
|
+
break;
|
|
837
|
+
default:
|
|
838
|
+
r = e.defaultError, k.assertNever(t);
|
|
839
|
+
}
|
|
840
|
+
return { message: r };
|
|
841
|
+
};
|
|
842
|
+
let Dr = Me;
|
|
843
|
+
function Vr() {
|
|
844
|
+
return Dr;
|
|
845
|
+
}
|
|
846
|
+
const Br = (t) => {
|
|
847
|
+
const { data: e, path: r, errorMaps: n, issueData: s } = t, a = [...r, ...s.path || []], i = {
|
|
848
|
+
...s,
|
|
849
|
+
path: a
|
|
850
|
+
};
|
|
851
|
+
if (s.message !== void 0)
|
|
852
|
+
return {
|
|
853
|
+
...s,
|
|
854
|
+
path: a,
|
|
855
|
+
message: s.message
|
|
856
|
+
};
|
|
857
|
+
let o = "";
|
|
858
|
+
const c = n.filter((l) => !!l).slice().reverse();
|
|
859
|
+
for (const l of c)
|
|
860
|
+
o = l(i, { data: e, defaultError: o }).message;
|
|
861
|
+
return {
|
|
862
|
+
...s,
|
|
863
|
+
path: a,
|
|
864
|
+
message: o
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
function f(t, e) {
|
|
868
|
+
const r = Vr(), n = Br({
|
|
869
|
+
issueData: e,
|
|
870
|
+
data: t.data,
|
|
871
|
+
path: t.path,
|
|
872
|
+
errorMaps: [
|
|
873
|
+
t.common.contextualErrorMap,
|
|
874
|
+
// contextual error map is first priority
|
|
875
|
+
t.schemaErrorMap,
|
|
876
|
+
// then schema-bound map if available
|
|
877
|
+
r,
|
|
878
|
+
// then global override map
|
|
879
|
+
r === Me ? void 0 : Me
|
|
880
|
+
// then global default map
|
|
881
|
+
].filter((s) => !!s)
|
|
882
|
+
});
|
|
883
|
+
t.common.issues.push(n);
|
|
884
|
+
}
|
|
885
|
+
class z {
|
|
886
|
+
constructor() {
|
|
887
|
+
this.value = "valid";
|
|
888
|
+
}
|
|
889
|
+
dirty() {
|
|
890
|
+
this.value === "valid" && (this.value = "dirty");
|
|
891
|
+
}
|
|
892
|
+
abort() {
|
|
893
|
+
this.value !== "aborted" && (this.value = "aborted");
|
|
894
|
+
}
|
|
895
|
+
static mergeArray(e, r) {
|
|
896
|
+
const n = [];
|
|
897
|
+
for (const s of r) {
|
|
898
|
+
if (s.status === "aborted")
|
|
899
|
+
return y;
|
|
900
|
+
s.status === "dirty" && e.dirty(), n.push(s.value);
|
|
901
|
+
}
|
|
902
|
+
return { status: e.value, value: n };
|
|
903
|
+
}
|
|
904
|
+
static async mergeObjectAsync(e, r) {
|
|
905
|
+
const n = [];
|
|
906
|
+
for (const s of r) {
|
|
907
|
+
const a = await s.key, i = await s.value;
|
|
908
|
+
n.push({
|
|
909
|
+
key: a,
|
|
910
|
+
value: i
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
return z.mergeObjectSync(e, n);
|
|
914
|
+
}
|
|
915
|
+
static mergeObjectSync(e, r) {
|
|
916
|
+
const n = {};
|
|
917
|
+
for (const s of r) {
|
|
918
|
+
const { key: a, value: i } = s;
|
|
919
|
+
if (a.status === "aborted" || i.status === "aborted")
|
|
920
|
+
return y;
|
|
921
|
+
a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || s.alwaysSet) && (n[a.value] = i.value);
|
|
922
|
+
}
|
|
923
|
+
return { status: e.value, value: n };
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
const y = Object.freeze({
|
|
927
|
+
status: "aborted"
|
|
928
|
+
}), ce = (t) => ({ status: "dirty", value: t }), D = (t) => ({ status: "valid", value: t }), et = (t) => t.status === "aborted", tt = (t) => t.status === "dirty", se = (t) => t.status === "valid", _e = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
929
|
+
var m;
|
|
930
|
+
(function(t) {
|
|
931
|
+
t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
932
|
+
})(m || (m = {}));
|
|
933
|
+
class Q {
|
|
934
|
+
constructor(e, r, n, s) {
|
|
935
|
+
this._cachedPath = [], this.parent = e, this.data = r, this._path = n, this._key = s;
|
|
936
|
+
}
|
|
937
|
+
get path() {
|
|
938
|
+
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
const rt = (t, e) => {
|
|
942
|
+
if (se(e))
|
|
943
|
+
return { success: !0, data: e.value };
|
|
944
|
+
if (!t.common.issues.length)
|
|
945
|
+
throw new Error("Validation failed but no issues detected.");
|
|
946
|
+
return {
|
|
947
|
+
success: !1,
|
|
948
|
+
get error() {
|
|
949
|
+
if (this._error)
|
|
950
|
+
return this._error;
|
|
951
|
+
const r = new q(t.common.issues);
|
|
952
|
+
return this._error = r, this._error;
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
};
|
|
956
|
+
function _(t) {
|
|
957
|
+
if (!t)
|
|
958
|
+
return {};
|
|
959
|
+
const { errorMap: e, invalid_type_error: r, required_error: n, description: s } = t;
|
|
960
|
+
if (e && (r || n))
|
|
961
|
+
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
962
|
+
return e ? { errorMap: e, description: s } : { errorMap: (i, o) => {
|
|
963
|
+
const { message: c } = t;
|
|
964
|
+
return i.code === "invalid_enum_value" ? { message: c ?? o.defaultError } : typeof o.data > "u" ? { message: c ?? n ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: c ?? r ?? o.defaultError };
|
|
965
|
+
}, description: s };
|
|
966
|
+
}
|
|
967
|
+
class x {
|
|
968
|
+
get description() {
|
|
969
|
+
return this._def.description;
|
|
970
|
+
}
|
|
971
|
+
_getType(e) {
|
|
972
|
+
return X(e.data);
|
|
973
|
+
}
|
|
974
|
+
_getOrReturnCtx(e, r) {
|
|
975
|
+
return r || {
|
|
976
|
+
common: e.parent.common,
|
|
977
|
+
data: e.data,
|
|
978
|
+
parsedType: X(e.data),
|
|
979
|
+
schemaErrorMap: this._def.errorMap,
|
|
980
|
+
path: e.path,
|
|
981
|
+
parent: e.parent
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
_processInputParams(e) {
|
|
985
|
+
return {
|
|
986
|
+
status: new z(),
|
|
987
|
+
ctx: {
|
|
988
|
+
common: e.parent.common,
|
|
989
|
+
data: e.data,
|
|
990
|
+
parsedType: X(e.data),
|
|
991
|
+
schemaErrorMap: this._def.errorMap,
|
|
992
|
+
path: e.path,
|
|
993
|
+
parent: e.parent
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
_parseSync(e) {
|
|
998
|
+
const r = this._parse(e);
|
|
999
|
+
if (_e(r))
|
|
1000
|
+
throw new Error("Synchronous parse encountered promise.");
|
|
1001
|
+
return r;
|
|
1002
|
+
}
|
|
1003
|
+
_parseAsync(e) {
|
|
1004
|
+
const r = this._parse(e);
|
|
1005
|
+
return Promise.resolve(r);
|
|
1006
|
+
}
|
|
1007
|
+
parse(e, r) {
|
|
1008
|
+
const n = this.safeParse(e, r);
|
|
1009
|
+
if (n.success)
|
|
1010
|
+
return n.data;
|
|
1011
|
+
throw n.error;
|
|
1012
|
+
}
|
|
1013
|
+
safeParse(e, r) {
|
|
1014
|
+
const n = {
|
|
1015
|
+
common: {
|
|
1016
|
+
issues: [],
|
|
1017
|
+
async: (r == null ? void 0 : r.async) ?? !1,
|
|
1018
|
+
contextualErrorMap: r == null ? void 0 : r.errorMap
|
|
1019
|
+
},
|
|
1020
|
+
path: (r == null ? void 0 : r.path) || [],
|
|
1021
|
+
schemaErrorMap: this._def.errorMap,
|
|
1022
|
+
parent: null,
|
|
1023
|
+
data: e,
|
|
1024
|
+
parsedType: X(e)
|
|
1025
|
+
}, s = this._parseSync({ data: e, path: n.path, parent: n });
|
|
1026
|
+
return rt(n, s);
|
|
1027
|
+
}
|
|
1028
|
+
"~validate"(e) {
|
|
1029
|
+
var n, s;
|
|
1030
|
+
const r = {
|
|
1031
|
+
common: {
|
|
1032
|
+
issues: [],
|
|
1033
|
+
async: !!this["~standard"].async
|
|
1034
|
+
},
|
|
1035
|
+
path: [],
|
|
1036
|
+
schemaErrorMap: this._def.errorMap,
|
|
1037
|
+
parent: null,
|
|
1038
|
+
data: e,
|
|
1039
|
+
parsedType: X(e)
|
|
1040
|
+
};
|
|
1041
|
+
if (!this["~standard"].async)
|
|
1042
|
+
try {
|
|
1043
|
+
const a = this._parseSync({ data: e, path: [], parent: r });
|
|
1044
|
+
return se(a) ? {
|
|
1045
|
+
value: a.value
|
|
1046
|
+
} : {
|
|
1047
|
+
issues: r.common.issues
|
|
1048
|
+
};
|
|
1049
|
+
} catch (a) {
|
|
1050
|
+
(s = (n = a == null ? void 0 : a.message) == null ? void 0 : n.toLowerCase()) != null && s.includes("encountered") && (this["~standard"].async = !0), r.common = {
|
|
1051
|
+
issues: [],
|
|
1052
|
+
async: !0
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
return this._parseAsync({ data: e, path: [], parent: r }).then((a) => se(a) ? {
|
|
1056
|
+
value: a.value
|
|
1057
|
+
} : {
|
|
1058
|
+
issues: r.common.issues
|
|
1059
|
+
});
|
|
1060
|
+
}
|
|
1061
|
+
async parseAsync(e, r) {
|
|
1062
|
+
const n = await this.safeParseAsync(e, r);
|
|
1063
|
+
if (n.success)
|
|
1064
|
+
return n.data;
|
|
1065
|
+
throw n.error;
|
|
1066
|
+
}
|
|
1067
|
+
async safeParseAsync(e, r) {
|
|
1068
|
+
const n = {
|
|
1069
|
+
common: {
|
|
1070
|
+
issues: [],
|
|
1071
|
+
contextualErrorMap: r == null ? void 0 : r.errorMap,
|
|
1072
|
+
async: !0
|
|
1073
|
+
},
|
|
1074
|
+
path: (r == null ? void 0 : r.path) || [],
|
|
1075
|
+
schemaErrorMap: this._def.errorMap,
|
|
1076
|
+
parent: null,
|
|
1077
|
+
data: e,
|
|
1078
|
+
parsedType: X(e)
|
|
1079
|
+
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (_e(s) ? s : Promise.resolve(s));
|
|
1080
|
+
return rt(n, a);
|
|
1081
|
+
}
|
|
1082
|
+
refine(e, r) {
|
|
1083
|
+
const n = (s) => typeof r == "string" || typeof r > "u" ? { message: r } : typeof r == "function" ? r(s) : r;
|
|
1084
|
+
return this._refinement((s, a) => {
|
|
1085
|
+
const i = e(s), o = () => a.addIssue({
|
|
1086
|
+
code: d.custom,
|
|
1087
|
+
...n(s)
|
|
1088
|
+
});
|
|
1089
|
+
return typeof Promise < "u" && i instanceof Promise ? i.then((c) => c ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
|
1090
|
+
});
|
|
1091
|
+
}
|
|
1092
|
+
refinement(e, r) {
|
|
1093
|
+
return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof r == "function" ? r(n, s) : r), !1));
|
|
1094
|
+
}
|
|
1095
|
+
_refinement(e) {
|
|
1096
|
+
return new ie({
|
|
1097
|
+
schema: this,
|
|
1098
|
+
typeName: v.ZodEffects,
|
|
1099
|
+
effect: { type: "refinement", refinement: e }
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
superRefine(e) {
|
|
1103
|
+
return this._refinement(e);
|
|
1104
|
+
}
|
|
1105
|
+
constructor(e) {
|
|
1106
|
+
this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = {
|
|
1107
|
+
version: 1,
|
|
1108
|
+
vendor: "zod",
|
|
1109
|
+
validate: (r) => this["~validate"](r)
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
optional() {
|
|
1113
|
+
return J.create(this, this._def);
|
|
1114
|
+
}
|
|
1115
|
+
nullable() {
|
|
1116
|
+
return oe.create(this, this._def);
|
|
1117
|
+
}
|
|
1118
|
+
nullish() {
|
|
1119
|
+
return this.nullable().optional();
|
|
1120
|
+
}
|
|
1121
|
+
array() {
|
|
1122
|
+
return B.create(this);
|
|
1123
|
+
}
|
|
1124
|
+
promise() {
|
|
1125
|
+
return we.create(this, this._def);
|
|
1126
|
+
}
|
|
1127
|
+
or(e) {
|
|
1128
|
+
return xe.create([this, e], this._def);
|
|
1129
|
+
}
|
|
1130
|
+
and(e) {
|
|
1131
|
+
return ke.create(this, e, this._def);
|
|
1132
|
+
}
|
|
1133
|
+
transform(e) {
|
|
1134
|
+
return new ie({
|
|
1135
|
+
..._(this._def),
|
|
1136
|
+
schema: this,
|
|
1137
|
+
typeName: v.ZodEffects,
|
|
1138
|
+
effect: { type: "transform", transform: e }
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
default(e) {
|
|
1142
|
+
const r = typeof e == "function" ? e : () => e;
|
|
1143
|
+
return new Ve({
|
|
1144
|
+
..._(this._def),
|
|
1145
|
+
innerType: this,
|
|
1146
|
+
defaultValue: r,
|
|
1147
|
+
typeName: v.ZodDefault
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
brand() {
|
|
1151
|
+
return new fn({
|
|
1152
|
+
typeName: v.ZodBranded,
|
|
1153
|
+
type: this,
|
|
1154
|
+
..._(this._def)
|
|
1155
|
+
});
|
|
1156
|
+
}
|
|
1157
|
+
catch(e) {
|
|
1158
|
+
const r = typeof e == "function" ? e : () => e;
|
|
1159
|
+
return new Be({
|
|
1160
|
+
..._(this._def),
|
|
1161
|
+
innerType: this,
|
|
1162
|
+
catchValue: r,
|
|
1163
|
+
typeName: v.ZodCatch
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
describe(e) {
|
|
1167
|
+
const r = this.constructor;
|
|
1168
|
+
return new r({
|
|
1169
|
+
...this._def,
|
|
1170
|
+
description: e
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1173
|
+
pipe(e) {
|
|
1174
|
+
return We.create(this, e);
|
|
1175
|
+
}
|
|
1176
|
+
readonly() {
|
|
1177
|
+
return Ue.create(this);
|
|
1178
|
+
}
|
|
1179
|
+
isOptional() {
|
|
1180
|
+
return this.safeParse(void 0).success;
|
|
1181
|
+
}
|
|
1182
|
+
isNullable() {
|
|
1183
|
+
return this.safeParse(null).success;
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
const Ur = /^c[^\s-]{8,}$/i, Fr = /^[0-9a-z]+$/, Wr = /^[0-9A-HJKMNP-TV-Z]{26}$/i, qr = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Hr = /^[a-z0-9_-]{21}$/i, Xr = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Yr = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Jr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Qr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1187
|
+
let Se;
|
|
1188
|
+
const Gr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Kr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, en = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, tn = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, rn = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, nn = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Mt = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", sn = new RegExp(`^${Mt}$`);
|
|
1189
|
+
function Dt(t) {
|
|
1190
|
+
let e = "[0-5]\\d";
|
|
1191
|
+
t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
1192
|
+
const r = t.precision ? "+" : "?";
|
|
1193
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`;
|
|
1194
|
+
}
|
|
1195
|
+
function an(t) {
|
|
1196
|
+
return new RegExp(`^${Dt(t)}$`);
|
|
1197
|
+
}
|
|
1198
|
+
function on(t) {
|
|
1199
|
+
let e = `${Mt}T${Dt(t)}`;
|
|
1200
|
+
const r = [];
|
|
1201
|
+
return r.push(t.local ? "Z?" : "Z"), t.offset && r.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${r.join("|")})`, new RegExp(`^${e}$`);
|
|
1202
|
+
}
|
|
1203
|
+
function cn(t, e) {
|
|
1204
|
+
return !!((e === "v4" || !e) && Gr.test(t) || (e === "v6" || !e) && en.test(t));
|
|
1205
|
+
}
|
|
1206
|
+
function ln(t, e) {
|
|
1207
|
+
if (!Xr.test(t))
|
|
1208
|
+
return !1;
|
|
1209
|
+
try {
|
|
1210
|
+
const [r] = t.split(".");
|
|
1211
|
+
if (!r)
|
|
1212
|
+
return !1;
|
|
1213
|
+
const n = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="), s = JSON.parse(atob(n));
|
|
1214
|
+
return !(typeof s != "object" || s === null || "typ" in s && (s == null ? void 0 : s.typ) !== "JWT" || !s.alg || e && s.alg !== e);
|
|
1215
|
+
} catch {
|
|
1216
|
+
return !1;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
function dn(t, e) {
|
|
1220
|
+
return !!((e === "v4" || !e) && Kr.test(t) || (e === "v6" || !e) && tn.test(t));
|
|
1221
|
+
}
|
|
1222
|
+
class Y extends x {
|
|
1223
|
+
_parse(e) {
|
|
1224
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== h.string) {
|
|
1225
|
+
const a = this._getOrReturnCtx(e);
|
|
1226
|
+
return f(a, {
|
|
1227
|
+
code: d.invalid_type,
|
|
1228
|
+
expected: h.string,
|
|
1229
|
+
received: a.parsedType
|
|
1230
|
+
}), y;
|
|
1231
|
+
}
|
|
1232
|
+
const n = new z();
|
|
1233
|
+
let s;
|
|
1234
|
+
for (const a of this._def.checks)
|
|
1235
|
+
if (a.kind === "min")
|
|
1236
|
+
e.data.length < a.value && (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1237
|
+
code: d.too_small,
|
|
1238
|
+
minimum: a.value,
|
|
1239
|
+
type: "string",
|
|
1240
|
+
inclusive: !0,
|
|
1241
|
+
exact: !1,
|
|
1242
|
+
message: a.message
|
|
1243
|
+
}), n.dirty());
|
|
1244
|
+
else if (a.kind === "max")
|
|
1245
|
+
e.data.length > a.value && (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1246
|
+
code: d.too_big,
|
|
1247
|
+
maximum: a.value,
|
|
1248
|
+
type: "string",
|
|
1249
|
+
inclusive: !0,
|
|
1250
|
+
exact: !1,
|
|
1251
|
+
message: a.message
|
|
1252
|
+
}), n.dirty());
|
|
1253
|
+
else if (a.kind === "length") {
|
|
1254
|
+
const i = e.data.length > a.value, o = e.data.length < a.value;
|
|
1255
|
+
(i || o) && (s = this._getOrReturnCtx(e, s), i ? f(s, {
|
|
1256
|
+
code: d.too_big,
|
|
1257
|
+
maximum: a.value,
|
|
1258
|
+
type: "string",
|
|
1259
|
+
inclusive: !0,
|
|
1260
|
+
exact: !0,
|
|
1261
|
+
message: a.message
|
|
1262
|
+
}) : o && f(s, {
|
|
1263
|
+
code: d.too_small,
|
|
1264
|
+
minimum: a.value,
|
|
1265
|
+
type: "string",
|
|
1266
|
+
inclusive: !0,
|
|
1267
|
+
exact: !0,
|
|
1268
|
+
message: a.message
|
|
1269
|
+
}), n.dirty());
|
|
1270
|
+
} else if (a.kind === "email")
|
|
1271
|
+
Jr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1272
|
+
validation: "email",
|
|
1273
|
+
code: d.invalid_string,
|
|
1274
|
+
message: a.message
|
|
1275
|
+
}), n.dirty());
|
|
1276
|
+
else if (a.kind === "emoji")
|
|
1277
|
+
Se || (Se = new RegExp(Qr, "u")), Se.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1278
|
+
validation: "emoji",
|
|
1279
|
+
code: d.invalid_string,
|
|
1280
|
+
message: a.message
|
|
1281
|
+
}), n.dirty());
|
|
1282
|
+
else if (a.kind === "uuid")
|
|
1283
|
+
qr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1284
|
+
validation: "uuid",
|
|
1285
|
+
code: d.invalid_string,
|
|
1286
|
+
message: a.message
|
|
1287
|
+
}), n.dirty());
|
|
1288
|
+
else if (a.kind === "nanoid")
|
|
1289
|
+
Hr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1290
|
+
validation: "nanoid",
|
|
1291
|
+
code: d.invalid_string,
|
|
1292
|
+
message: a.message
|
|
1293
|
+
}), n.dirty());
|
|
1294
|
+
else if (a.kind === "cuid")
|
|
1295
|
+
Ur.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1296
|
+
validation: "cuid",
|
|
1297
|
+
code: d.invalid_string,
|
|
1298
|
+
message: a.message
|
|
1299
|
+
}), n.dirty());
|
|
1300
|
+
else if (a.kind === "cuid2")
|
|
1301
|
+
Fr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1302
|
+
validation: "cuid2",
|
|
1303
|
+
code: d.invalid_string,
|
|
1304
|
+
message: a.message
|
|
1305
|
+
}), n.dirty());
|
|
1306
|
+
else if (a.kind === "ulid")
|
|
1307
|
+
Wr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1308
|
+
validation: "ulid",
|
|
1309
|
+
code: d.invalid_string,
|
|
1310
|
+
message: a.message
|
|
1311
|
+
}), n.dirty());
|
|
1312
|
+
else if (a.kind === "url")
|
|
1313
|
+
try {
|
|
1314
|
+
new URL(e.data);
|
|
1315
|
+
} catch {
|
|
1316
|
+
s = this._getOrReturnCtx(e, s), f(s, {
|
|
1317
|
+
validation: "url",
|
|
1318
|
+
code: d.invalid_string,
|
|
1319
|
+
message: a.message
|
|
1320
|
+
}), n.dirty();
|
|
1321
|
+
}
|
|
1322
|
+
else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1323
|
+
validation: "regex",
|
|
1324
|
+
code: d.invalid_string,
|
|
1325
|
+
message: a.message
|
|
1326
|
+
}), n.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1327
|
+
code: d.invalid_string,
|
|
1328
|
+
validation: { includes: a.value, position: a.position },
|
|
1329
|
+
message: a.message
|
|
1330
|
+
}), n.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1331
|
+
code: d.invalid_string,
|
|
1332
|
+
validation: { startsWith: a.value },
|
|
1333
|
+
message: a.message
|
|
1334
|
+
}), n.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1335
|
+
code: d.invalid_string,
|
|
1336
|
+
validation: { endsWith: a.value },
|
|
1337
|
+
message: a.message
|
|
1338
|
+
}), n.dirty()) : a.kind === "datetime" ? on(a).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1339
|
+
code: d.invalid_string,
|
|
1340
|
+
validation: "datetime",
|
|
1341
|
+
message: a.message
|
|
1342
|
+
}), n.dirty()) : a.kind === "date" ? sn.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1343
|
+
code: d.invalid_string,
|
|
1344
|
+
validation: "date",
|
|
1345
|
+
message: a.message
|
|
1346
|
+
}), n.dirty()) : a.kind === "time" ? an(a).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1347
|
+
code: d.invalid_string,
|
|
1348
|
+
validation: "time",
|
|
1349
|
+
message: a.message
|
|
1350
|
+
}), n.dirty()) : a.kind === "duration" ? Yr.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1351
|
+
validation: "duration",
|
|
1352
|
+
code: d.invalid_string,
|
|
1353
|
+
message: a.message
|
|
1354
|
+
}), n.dirty()) : a.kind === "ip" ? cn(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1355
|
+
validation: "ip",
|
|
1356
|
+
code: d.invalid_string,
|
|
1357
|
+
message: a.message
|
|
1358
|
+
}), n.dirty()) : a.kind === "jwt" ? ln(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1359
|
+
validation: "jwt",
|
|
1360
|
+
code: d.invalid_string,
|
|
1361
|
+
message: a.message
|
|
1362
|
+
}), n.dirty()) : a.kind === "cidr" ? dn(e.data, a.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1363
|
+
validation: "cidr",
|
|
1364
|
+
code: d.invalid_string,
|
|
1365
|
+
message: a.message
|
|
1366
|
+
}), n.dirty()) : a.kind === "base64" ? rn.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1367
|
+
validation: "base64",
|
|
1368
|
+
code: d.invalid_string,
|
|
1369
|
+
message: a.message
|
|
1370
|
+
}), n.dirty()) : a.kind === "base64url" ? nn.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1371
|
+
validation: "base64url",
|
|
1372
|
+
code: d.invalid_string,
|
|
1373
|
+
message: a.message
|
|
1374
|
+
}), n.dirty()) : k.assertNever(a);
|
|
1375
|
+
return { status: n.value, value: e.data };
|
|
1376
|
+
}
|
|
1377
|
+
_regex(e, r, n) {
|
|
1378
|
+
return this.refinement((s) => e.test(s), {
|
|
1379
|
+
validation: r,
|
|
1380
|
+
code: d.invalid_string,
|
|
1381
|
+
...m.errToObj(n)
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1384
|
+
_addCheck(e) {
|
|
1385
|
+
return new Y({
|
|
1386
|
+
...this._def,
|
|
1387
|
+
checks: [...this._def.checks, e]
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
email(e) {
|
|
1391
|
+
return this._addCheck({ kind: "email", ...m.errToObj(e) });
|
|
1392
|
+
}
|
|
1393
|
+
url(e) {
|
|
1394
|
+
return this._addCheck({ kind: "url", ...m.errToObj(e) });
|
|
1395
|
+
}
|
|
1396
|
+
emoji(e) {
|
|
1397
|
+
return this._addCheck({ kind: "emoji", ...m.errToObj(e) });
|
|
1398
|
+
}
|
|
1399
|
+
uuid(e) {
|
|
1400
|
+
return this._addCheck({ kind: "uuid", ...m.errToObj(e) });
|
|
1401
|
+
}
|
|
1402
|
+
nanoid(e) {
|
|
1403
|
+
return this._addCheck({ kind: "nanoid", ...m.errToObj(e) });
|
|
1404
|
+
}
|
|
1405
|
+
cuid(e) {
|
|
1406
|
+
return this._addCheck({ kind: "cuid", ...m.errToObj(e) });
|
|
1407
|
+
}
|
|
1408
|
+
cuid2(e) {
|
|
1409
|
+
return this._addCheck({ kind: "cuid2", ...m.errToObj(e) });
|
|
1410
|
+
}
|
|
1411
|
+
ulid(e) {
|
|
1412
|
+
return this._addCheck({ kind: "ulid", ...m.errToObj(e) });
|
|
1413
|
+
}
|
|
1414
|
+
base64(e) {
|
|
1415
|
+
return this._addCheck({ kind: "base64", ...m.errToObj(e) });
|
|
1416
|
+
}
|
|
1417
|
+
base64url(e) {
|
|
1418
|
+
return this._addCheck({
|
|
1419
|
+
kind: "base64url",
|
|
1420
|
+
...m.errToObj(e)
|
|
1421
|
+
});
|
|
1422
|
+
}
|
|
1423
|
+
jwt(e) {
|
|
1424
|
+
return this._addCheck({ kind: "jwt", ...m.errToObj(e) });
|
|
1425
|
+
}
|
|
1426
|
+
ip(e) {
|
|
1427
|
+
return this._addCheck({ kind: "ip", ...m.errToObj(e) });
|
|
1428
|
+
}
|
|
1429
|
+
cidr(e) {
|
|
1430
|
+
return this._addCheck({ kind: "cidr", ...m.errToObj(e) });
|
|
1431
|
+
}
|
|
1432
|
+
datetime(e) {
|
|
1433
|
+
return typeof e == "string" ? this._addCheck({
|
|
1434
|
+
kind: "datetime",
|
|
1435
|
+
precision: null,
|
|
1436
|
+
offset: !1,
|
|
1437
|
+
local: !1,
|
|
1438
|
+
message: e
|
|
1439
|
+
}) : this._addCheck({
|
|
1440
|
+
kind: "datetime",
|
|
1441
|
+
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
1442
|
+
offset: (e == null ? void 0 : e.offset) ?? !1,
|
|
1443
|
+
local: (e == null ? void 0 : e.local) ?? !1,
|
|
1444
|
+
...m.errToObj(e == null ? void 0 : e.message)
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1447
|
+
date(e) {
|
|
1448
|
+
return this._addCheck({ kind: "date", message: e });
|
|
1449
|
+
}
|
|
1450
|
+
time(e) {
|
|
1451
|
+
return typeof e == "string" ? this._addCheck({
|
|
1452
|
+
kind: "time",
|
|
1453
|
+
precision: null,
|
|
1454
|
+
message: e
|
|
1455
|
+
}) : this._addCheck({
|
|
1456
|
+
kind: "time",
|
|
1457
|
+
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
1458
|
+
...m.errToObj(e == null ? void 0 : e.message)
|
|
1459
|
+
});
|
|
1460
|
+
}
|
|
1461
|
+
duration(e) {
|
|
1462
|
+
return this._addCheck({ kind: "duration", ...m.errToObj(e) });
|
|
1463
|
+
}
|
|
1464
|
+
regex(e, r) {
|
|
1465
|
+
return this._addCheck({
|
|
1466
|
+
kind: "regex",
|
|
1467
|
+
regex: e,
|
|
1468
|
+
...m.errToObj(r)
|
|
1469
|
+
});
|
|
1470
|
+
}
|
|
1471
|
+
includes(e, r) {
|
|
1472
|
+
return this._addCheck({
|
|
1473
|
+
kind: "includes",
|
|
1474
|
+
value: e,
|
|
1475
|
+
position: r == null ? void 0 : r.position,
|
|
1476
|
+
...m.errToObj(r == null ? void 0 : r.message)
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
startsWith(e, r) {
|
|
1480
|
+
return this._addCheck({
|
|
1481
|
+
kind: "startsWith",
|
|
1482
|
+
value: e,
|
|
1483
|
+
...m.errToObj(r)
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1486
|
+
endsWith(e, r) {
|
|
1487
|
+
return this._addCheck({
|
|
1488
|
+
kind: "endsWith",
|
|
1489
|
+
value: e,
|
|
1490
|
+
...m.errToObj(r)
|
|
1491
|
+
});
|
|
1492
|
+
}
|
|
1493
|
+
min(e, r) {
|
|
1494
|
+
return this._addCheck({
|
|
1495
|
+
kind: "min",
|
|
1496
|
+
value: e,
|
|
1497
|
+
...m.errToObj(r)
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
max(e, r) {
|
|
1501
|
+
return this._addCheck({
|
|
1502
|
+
kind: "max",
|
|
1503
|
+
value: e,
|
|
1504
|
+
...m.errToObj(r)
|
|
1505
|
+
});
|
|
1506
|
+
}
|
|
1507
|
+
length(e, r) {
|
|
1508
|
+
return this._addCheck({
|
|
1509
|
+
kind: "length",
|
|
1510
|
+
value: e,
|
|
1511
|
+
...m.errToObj(r)
|
|
1512
|
+
});
|
|
1513
|
+
}
|
|
1514
|
+
/**
|
|
1515
|
+
* Equivalent to `.min(1)`
|
|
1516
|
+
*/
|
|
1517
|
+
nonempty(e) {
|
|
1518
|
+
return this.min(1, m.errToObj(e));
|
|
1519
|
+
}
|
|
1520
|
+
trim() {
|
|
1521
|
+
return new Y({
|
|
1522
|
+
...this._def,
|
|
1523
|
+
checks: [...this._def.checks, { kind: "trim" }]
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
toLowerCase() {
|
|
1527
|
+
return new Y({
|
|
1528
|
+
...this._def,
|
|
1529
|
+
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
1530
|
+
});
|
|
1531
|
+
}
|
|
1532
|
+
toUpperCase() {
|
|
1533
|
+
return new Y({
|
|
1534
|
+
...this._def,
|
|
1535
|
+
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
get isDatetime() {
|
|
1539
|
+
return !!this._def.checks.find((e) => e.kind === "datetime");
|
|
1540
|
+
}
|
|
1541
|
+
get isDate() {
|
|
1542
|
+
return !!this._def.checks.find((e) => e.kind === "date");
|
|
1543
|
+
}
|
|
1544
|
+
get isTime() {
|
|
1545
|
+
return !!this._def.checks.find((e) => e.kind === "time");
|
|
1546
|
+
}
|
|
1547
|
+
get isDuration() {
|
|
1548
|
+
return !!this._def.checks.find((e) => e.kind === "duration");
|
|
1549
|
+
}
|
|
1550
|
+
get isEmail() {
|
|
1551
|
+
return !!this._def.checks.find((e) => e.kind === "email");
|
|
1552
|
+
}
|
|
1553
|
+
get isURL() {
|
|
1554
|
+
return !!this._def.checks.find((e) => e.kind === "url");
|
|
1555
|
+
}
|
|
1556
|
+
get isEmoji() {
|
|
1557
|
+
return !!this._def.checks.find((e) => e.kind === "emoji");
|
|
1558
|
+
}
|
|
1559
|
+
get isUUID() {
|
|
1560
|
+
return !!this._def.checks.find((e) => e.kind === "uuid");
|
|
1561
|
+
}
|
|
1562
|
+
get isNANOID() {
|
|
1563
|
+
return !!this._def.checks.find((e) => e.kind === "nanoid");
|
|
1564
|
+
}
|
|
1565
|
+
get isCUID() {
|
|
1566
|
+
return !!this._def.checks.find((e) => e.kind === "cuid");
|
|
1567
|
+
}
|
|
1568
|
+
get isCUID2() {
|
|
1569
|
+
return !!this._def.checks.find((e) => e.kind === "cuid2");
|
|
1570
|
+
}
|
|
1571
|
+
get isULID() {
|
|
1572
|
+
return !!this._def.checks.find((e) => e.kind === "ulid");
|
|
1573
|
+
}
|
|
1574
|
+
get isIP() {
|
|
1575
|
+
return !!this._def.checks.find((e) => e.kind === "ip");
|
|
1576
|
+
}
|
|
1577
|
+
get isCIDR() {
|
|
1578
|
+
return !!this._def.checks.find((e) => e.kind === "cidr");
|
|
1579
|
+
}
|
|
1580
|
+
get isBase64() {
|
|
1581
|
+
return !!this._def.checks.find((e) => e.kind === "base64");
|
|
1582
|
+
}
|
|
1583
|
+
get isBase64url() {
|
|
1584
|
+
return !!this._def.checks.find((e) => e.kind === "base64url");
|
|
1585
|
+
}
|
|
1586
|
+
get minLength() {
|
|
1587
|
+
let e = null;
|
|
1588
|
+
for (const r of this._def.checks)
|
|
1589
|
+
r.kind === "min" && (e === null || r.value > e) && (e = r.value);
|
|
1590
|
+
return e;
|
|
1591
|
+
}
|
|
1592
|
+
get maxLength() {
|
|
1593
|
+
let e = null;
|
|
1594
|
+
for (const r of this._def.checks)
|
|
1595
|
+
r.kind === "max" && (e === null || r.value < e) && (e = r.value);
|
|
1596
|
+
return e;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
Y.create = (t) => new Y({
|
|
1600
|
+
checks: [],
|
|
1601
|
+
typeName: v.ZodString,
|
|
1602
|
+
coerce: (t == null ? void 0 : t.coerce) ?? !1,
|
|
1603
|
+
..._(t)
|
|
1604
|
+
});
|
|
1605
|
+
function un(t, e) {
|
|
1606
|
+
const r = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = r > n ? r : n, a = Number.parseInt(t.toFixed(s).replace(".", "")), i = Number.parseInt(e.toFixed(s).replace(".", ""));
|
|
1607
|
+
return a % i / 10 ** s;
|
|
1608
|
+
}
|
|
1609
|
+
class ue extends x {
|
|
1610
|
+
constructor() {
|
|
1611
|
+
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1612
|
+
}
|
|
1613
|
+
_parse(e) {
|
|
1614
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== h.number) {
|
|
1615
|
+
const a = this._getOrReturnCtx(e);
|
|
1616
|
+
return f(a, {
|
|
1617
|
+
code: d.invalid_type,
|
|
1618
|
+
expected: h.number,
|
|
1619
|
+
received: a.parsedType
|
|
1620
|
+
}), y;
|
|
1621
|
+
}
|
|
1622
|
+
let n;
|
|
1623
|
+
const s = new z();
|
|
1624
|
+
for (const a of this._def.checks)
|
|
1625
|
+
a.kind === "int" ? k.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1626
|
+
code: d.invalid_type,
|
|
1627
|
+
expected: "integer",
|
|
1628
|
+
received: "float",
|
|
1629
|
+
message: a.message
|
|
1630
|
+
}), s.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1631
|
+
code: d.too_small,
|
|
1632
|
+
minimum: a.value,
|
|
1633
|
+
type: "number",
|
|
1634
|
+
inclusive: a.inclusive,
|
|
1635
|
+
exact: !1,
|
|
1636
|
+
message: a.message
|
|
1637
|
+
}), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1638
|
+
code: d.too_big,
|
|
1639
|
+
maximum: a.value,
|
|
1640
|
+
type: "number",
|
|
1641
|
+
inclusive: a.inclusive,
|
|
1642
|
+
exact: !1,
|
|
1643
|
+
message: a.message
|
|
1644
|
+
}), s.dirty()) : a.kind === "multipleOf" ? un(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1645
|
+
code: d.not_multiple_of,
|
|
1646
|
+
multipleOf: a.value,
|
|
1647
|
+
message: a.message
|
|
1648
|
+
}), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1649
|
+
code: d.not_finite,
|
|
1650
|
+
message: a.message
|
|
1651
|
+
}), s.dirty()) : k.assertNever(a);
|
|
1652
|
+
return { status: s.value, value: e.data };
|
|
1653
|
+
}
|
|
1654
|
+
gte(e, r) {
|
|
1655
|
+
return this.setLimit("min", e, !0, m.toString(r));
|
|
1656
|
+
}
|
|
1657
|
+
gt(e, r) {
|
|
1658
|
+
return this.setLimit("min", e, !1, m.toString(r));
|
|
1659
|
+
}
|
|
1660
|
+
lte(e, r) {
|
|
1661
|
+
return this.setLimit("max", e, !0, m.toString(r));
|
|
1662
|
+
}
|
|
1663
|
+
lt(e, r) {
|
|
1664
|
+
return this.setLimit("max", e, !1, m.toString(r));
|
|
1665
|
+
}
|
|
1666
|
+
setLimit(e, r, n, s) {
|
|
1667
|
+
return new ue({
|
|
1668
|
+
...this._def,
|
|
1669
|
+
checks: [
|
|
1670
|
+
...this._def.checks,
|
|
1671
|
+
{
|
|
1672
|
+
kind: e,
|
|
1673
|
+
value: r,
|
|
1674
|
+
inclusive: n,
|
|
1675
|
+
message: m.toString(s)
|
|
1676
|
+
}
|
|
1677
|
+
]
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
_addCheck(e) {
|
|
1681
|
+
return new ue({
|
|
1682
|
+
...this._def,
|
|
1683
|
+
checks: [...this._def.checks, e]
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1686
|
+
int(e) {
|
|
1687
|
+
return this._addCheck({
|
|
1688
|
+
kind: "int",
|
|
1689
|
+
message: m.toString(e)
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1692
|
+
positive(e) {
|
|
1693
|
+
return this._addCheck({
|
|
1694
|
+
kind: "min",
|
|
1695
|
+
value: 0,
|
|
1696
|
+
inclusive: !1,
|
|
1697
|
+
message: m.toString(e)
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
negative(e) {
|
|
1701
|
+
return this._addCheck({
|
|
1702
|
+
kind: "max",
|
|
1703
|
+
value: 0,
|
|
1704
|
+
inclusive: !1,
|
|
1705
|
+
message: m.toString(e)
|
|
1706
|
+
});
|
|
1707
|
+
}
|
|
1708
|
+
nonpositive(e) {
|
|
1709
|
+
return this._addCheck({
|
|
1710
|
+
kind: "max",
|
|
1711
|
+
value: 0,
|
|
1712
|
+
inclusive: !0,
|
|
1713
|
+
message: m.toString(e)
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
nonnegative(e) {
|
|
1717
|
+
return this._addCheck({
|
|
1718
|
+
kind: "min",
|
|
1719
|
+
value: 0,
|
|
1720
|
+
inclusive: !0,
|
|
1721
|
+
message: m.toString(e)
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
multipleOf(e, r) {
|
|
1725
|
+
return this._addCheck({
|
|
1726
|
+
kind: "multipleOf",
|
|
1727
|
+
value: e,
|
|
1728
|
+
message: m.toString(r)
|
|
1729
|
+
});
|
|
1730
|
+
}
|
|
1731
|
+
finite(e) {
|
|
1732
|
+
return this._addCheck({
|
|
1733
|
+
kind: "finite",
|
|
1734
|
+
message: m.toString(e)
|
|
1735
|
+
});
|
|
1736
|
+
}
|
|
1737
|
+
safe(e) {
|
|
1738
|
+
return this._addCheck({
|
|
1739
|
+
kind: "min",
|
|
1740
|
+
inclusive: !0,
|
|
1741
|
+
value: Number.MIN_SAFE_INTEGER,
|
|
1742
|
+
message: m.toString(e)
|
|
1743
|
+
})._addCheck({
|
|
1744
|
+
kind: "max",
|
|
1745
|
+
inclusive: !0,
|
|
1746
|
+
value: Number.MAX_SAFE_INTEGER,
|
|
1747
|
+
message: m.toString(e)
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
get minValue() {
|
|
1751
|
+
let e = null;
|
|
1752
|
+
for (const r of this._def.checks)
|
|
1753
|
+
r.kind === "min" && (e === null || r.value > e) && (e = r.value);
|
|
1754
|
+
return e;
|
|
1755
|
+
}
|
|
1756
|
+
get maxValue() {
|
|
1757
|
+
let e = null;
|
|
1758
|
+
for (const r of this._def.checks)
|
|
1759
|
+
r.kind === "max" && (e === null || r.value < e) && (e = r.value);
|
|
1760
|
+
return e;
|
|
1761
|
+
}
|
|
1762
|
+
get isInt() {
|
|
1763
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && k.isInteger(e.value));
|
|
1764
|
+
}
|
|
1765
|
+
get isFinite() {
|
|
1766
|
+
let e = null, r = null;
|
|
1767
|
+
for (const n of this._def.checks) {
|
|
1768
|
+
if (n.kind === "finite" || n.kind === "int" || n.kind === "multipleOf")
|
|
1769
|
+
return !0;
|
|
1770
|
+
n.kind === "min" ? (r === null || n.value > r) && (r = n.value) : n.kind === "max" && (e === null || n.value < e) && (e = n.value);
|
|
1771
|
+
}
|
|
1772
|
+
return Number.isFinite(r) && Number.isFinite(e);
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
ue.create = (t) => new ue({
|
|
1776
|
+
checks: [],
|
|
1777
|
+
typeName: v.ZodNumber,
|
|
1778
|
+
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
1779
|
+
..._(t)
|
|
1780
|
+
});
|
|
1781
|
+
class fe extends x {
|
|
1782
|
+
constructor() {
|
|
1783
|
+
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1784
|
+
}
|
|
1785
|
+
_parse(e) {
|
|
1786
|
+
if (this._def.coerce)
|
|
1787
|
+
try {
|
|
1788
|
+
e.data = BigInt(e.data);
|
|
1789
|
+
} catch {
|
|
1790
|
+
return this._getInvalidInput(e);
|
|
1791
|
+
}
|
|
1792
|
+
if (this._getType(e) !== h.bigint)
|
|
1793
|
+
return this._getInvalidInput(e);
|
|
1794
|
+
let n;
|
|
1795
|
+
const s = new z();
|
|
1796
|
+
for (const a of this._def.checks)
|
|
1797
|
+
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1798
|
+
code: d.too_small,
|
|
1799
|
+
type: "bigint",
|
|
1800
|
+
minimum: a.value,
|
|
1801
|
+
inclusive: a.inclusive,
|
|
1802
|
+
message: a.message
|
|
1803
|
+
}), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1804
|
+
code: d.too_big,
|
|
1805
|
+
type: "bigint",
|
|
1806
|
+
maximum: a.value,
|
|
1807
|
+
inclusive: a.inclusive,
|
|
1808
|
+
message: a.message
|
|
1809
|
+
}), s.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1810
|
+
code: d.not_multiple_of,
|
|
1811
|
+
multipleOf: a.value,
|
|
1812
|
+
message: a.message
|
|
1813
|
+
}), s.dirty()) : k.assertNever(a);
|
|
1814
|
+
return { status: s.value, value: e.data };
|
|
1815
|
+
}
|
|
1816
|
+
_getInvalidInput(e) {
|
|
1817
|
+
const r = this._getOrReturnCtx(e);
|
|
1818
|
+
return f(r, {
|
|
1819
|
+
code: d.invalid_type,
|
|
1820
|
+
expected: h.bigint,
|
|
1821
|
+
received: r.parsedType
|
|
1822
|
+
}), y;
|
|
1823
|
+
}
|
|
1824
|
+
gte(e, r) {
|
|
1825
|
+
return this.setLimit("min", e, !0, m.toString(r));
|
|
1826
|
+
}
|
|
1827
|
+
gt(e, r) {
|
|
1828
|
+
return this.setLimit("min", e, !1, m.toString(r));
|
|
1829
|
+
}
|
|
1830
|
+
lte(e, r) {
|
|
1831
|
+
return this.setLimit("max", e, !0, m.toString(r));
|
|
1832
|
+
}
|
|
1833
|
+
lt(e, r) {
|
|
1834
|
+
return this.setLimit("max", e, !1, m.toString(r));
|
|
1835
|
+
}
|
|
1836
|
+
setLimit(e, r, n, s) {
|
|
1837
|
+
return new fe({
|
|
1838
|
+
...this._def,
|
|
1839
|
+
checks: [
|
|
1840
|
+
...this._def.checks,
|
|
1841
|
+
{
|
|
1842
|
+
kind: e,
|
|
1843
|
+
value: r,
|
|
1844
|
+
inclusive: n,
|
|
1845
|
+
message: m.toString(s)
|
|
1846
|
+
}
|
|
1847
|
+
]
|
|
1848
|
+
});
|
|
1849
|
+
}
|
|
1850
|
+
_addCheck(e) {
|
|
1851
|
+
return new fe({
|
|
1852
|
+
...this._def,
|
|
1853
|
+
checks: [...this._def.checks, e]
|
|
1854
|
+
});
|
|
1855
|
+
}
|
|
1856
|
+
positive(e) {
|
|
1857
|
+
return this._addCheck({
|
|
1858
|
+
kind: "min",
|
|
1859
|
+
value: BigInt(0),
|
|
1860
|
+
inclusive: !1,
|
|
1861
|
+
message: m.toString(e)
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
negative(e) {
|
|
1865
|
+
return this._addCheck({
|
|
1866
|
+
kind: "max",
|
|
1867
|
+
value: BigInt(0),
|
|
1868
|
+
inclusive: !1,
|
|
1869
|
+
message: m.toString(e)
|
|
1870
|
+
});
|
|
1871
|
+
}
|
|
1872
|
+
nonpositive(e) {
|
|
1873
|
+
return this._addCheck({
|
|
1874
|
+
kind: "max",
|
|
1875
|
+
value: BigInt(0),
|
|
1876
|
+
inclusive: !0,
|
|
1877
|
+
message: m.toString(e)
|
|
1878
|
+
});
|
|
1879
|
+
}
|
|
1880
|
+
nonnegative(e) {
|
|
1881
|
+
return this._addCheck({
|
|
1882
|
+
kind: "min",
|
|
1883
|
+
value: BigInt(0),
|
|
1884
|
+
inclusive: !0,
|
|
1885
|
+
message: m.toString(e)
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
multipleOf(e, r) {
|
|
1889
|
+
return this._addCheck({
|
|
1890
|
+
kind: "multipleOf",
|
|
1891
|
+
value: e,
|
|
1892
|
+
message: m.toString(r)
|
|
1893
|
+
});
|
|
1894
|
+
}
|
|
1895
|
+
get minValue() {
|
|
1896
|
+
let e = null;
|
|
1897
|
+
for (const r of this._def.checks)
|
|
1898
|
+
r.kind === "min" && (e === null || r.value > e) && (e = r.value);
|
|
1899
|
+
return e;
|
|
1900
|
+
}
|
|
1901
|
+
get maxValue() {
|
|
1902
|
+
let e = null;
|
|
1903
|
+
for (const r of this._def.checks)
|
|
1904
|
+
r.kind === "max" && (e === null || r.value < e) && (e = r.value);
|
|
1905
|
+
return e;
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
fe.create = (t) => new fe({
|
|
1909
|
+
checks: [],
|
|
1910
|
+
typeName: v.ZodBigInt,
|
|
1911
|
+
coerce: (t == null ? void 0 : t.coerce) ?? !1,
|
|
1912
|
+
..._(t)
|
|
1913
|
+
});
|
|
1914
|
+
class nt extends x {
|
|
1915
|
+
_parse(e) {
|
|
1916
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== h.boolean) {
|
|
1917
|
+
const n = this._getOrReturnCtx(e);
|
|
1918
|
+
return f(n, {
|
|
1919
|
+
code: d.invalid_type,
|
|
1920
|
+
expected: h.boolean,
|
|
1921
|
+
received: n.parsedType
|
|
1922
|
+
}), y;
|
|
1923
|
+
}
|
|
1924
|
+
return D(e.data);
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
nt.create = (t) => new nt({
|
|
1928
|
+
typeName: v.ZodBoolean,
|
|
1929
|
+
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
1930
|
+
..._(t)
|
|
1931
|
+
});
|
|
1932
|
+
class be extends x {
|
|
1933
|
+
_parse(e) {
|
|
1934
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== h.date) {
|
|
1935
|
+
const a = this._getOrReturnCtx(e);
|
|
1936
|
+
return f(a, {
|
|
1937
|
+
code: d.invalid_type,
|
|
1938
|
+
expected: h.date,
|
|
1939
|
+
received: a.parsedType
|
|
1940
|
+
}), y;
|
|
1941
|
+
}
|
|
1942
|
+
if (Number.isNaN(e.data.getTime())) {
|
|
1943
|
+
const a = this._getOrReturnCtx(e);
|
|
1944
|
+
return f(a, {
|
|
1945
|
+
code: d.invalid_date
|
|
1946
|
+
}), y;
|
|
1947
|
+
}
|
|
1948
|
+
const n = new z();
|
|
1949
|
+
let s;
|
|
1950
|
+
for (const a of this._def.checks)
|
|
1951
|
+
a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1952
|
+
code: d.too_small,
|
|
1953
|
+
message: a.message,
|
|
1954
|
+
inclusive: !0,
|
|
1955
|
+
exact: !1,
|
|
1956
|
+
minimum: a.value,
|
|
1957
|
+
type: "date"
|
|
1958
|
+
}), n.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (s = this._getOrReturnCtx(e, s), f(s, {
|
|
1959
|
+
code: d.too_big,
|
|
1960
|
+
message: a.message,
|
|
1961
|
+
inclusive: !0,
|
|
1962
|
+
exact: !1,
|
|
1963
|
+
maximum: a.value,
|
|
1964
|
+
type: "date"
|
|
1965
|
+
}), n.dirty()) : k.assertNever(a);
|
|
1966
|
+
return {
|
|
1967
|
+
status: n.value,
|
|
1968
|
+
value: new Date(e.data.getTime())
|
|
1969
|
+
};
|
|
1970
|
+
}
|
|
1971
|
+
_addCheck(e) {
|
|
1972
|
+
return new be({
|
|
1973
|
+
...this._def,
|
|
1974
|
+
checks: [...this._def.checks, e]
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
min(e, r) {
|
|
1978
|
+
return this._addCheck({
|
|
1979
|
+
kind: "min",
|
|
1980
|
+
value: e.getTime(),
|
|
1981
|
+
message: m.toString(r)
|
|
1982
|
+
});
|
|
1983
|
+
}
|
|
1984
|
+
max(e, r) {
|
|
1985
|
+
return this._addCheck({
|
|
1986
|
+
kind: "max",
|
|
1987
|
+
value: e.getTime(),
|
|
1988
|
+
message: m.toString(r)
|
|
1989
|
+
});
|
|
1990
|
+
}
|
|
1991
|
+
get minDate() {
|
|
1992
|
+
let e = null;
|
|
1993
|
+
for (const r of this._def.checks)
|
|
1994
|
+
r.kind === "min" && (e === null || r.value > e) && (e = r.value);
|
|
1995
|
+
return e != null ? new Date(e) : null;
|
|
1996
|
+
}
|
|
1997
|
+
get maxDate() {
|
|
1998
|
+
let e = null;
|
|
1999
|
+
for (const r of this._def.checks)
|
|
2000
|
+
r.kind === "max" && (e === null || r.value < e) && (e = r.value);
|
|
2001
|
+
return e != null ? new Date(e) : null;
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
be.create = (t) => new be({
|
|
2005
|
+
checks: [],
|
|
2006
|
+
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
2007
|
+
typeName: v.ZodDate,
|
|
2008
|
+
..._(t)
|
|
2009
|
+
});
|
|
2010
|
+
class st extends x {
|
|
2011
|
+
_parse(e) {
|
|
2012
|
+
if (this._getType(e) !== h.symbol) {
|
|
2013
|
+
const n = this._getOrReturnCtx(e);
|
|
2014
|
+
return f(n, {
|
|
2015
|
+
code: d.invalid_type,
|
|
2016
|
+
expected: h.symbol,
|
|
2017
|
+
received: n.parsedType
|
|
2018
|
+
}), y;
|
|
2019
|
+
}
|
|
2020
|
+
return D(e.data);
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
st.create = (t) => new st({
|
|
2024
|
+
typeName: v.ZodSymbol,
|
|
2025
|
+
..._(t)
|
|
2026
|
+
});
|
|
2027
|
+
class at extends x {
|
|
2028
|
+
_parse(e) {
|
|
2029
|
+
if (this._getType(e) !== h.undefined) {
|
|
2030
|
+
const n = this._getOrReturnCtx(e);
|
|
2031
|
+
return f(n, {
|
|
2032
|
+
code: d.invalid_type,
|
|
2033
|
+
expected: h.undefined,
|
|
2034
|
+
received: n.parsedType
|
|
2035
|
+
}), y;
|
|
2036
|
+
}
|
|
2037
|
+
return D(e.data);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
at.create = (t) => new at({
|
|
2041
|
+
typeName: v.ZodUndefined,
|
|
2042
|
+
..._(t)
|
|
2043
|
+
});
|
|
2044
|
+
class it extends x {
|
|
2045
|
+
_parse(e) {
|
|
2046
|
+
if (this._getType(e) !== h.null) {
|
|
2047
|
+
const n = this._getOrReturnCtx(e);
|
|
2048
|
+
return f(n, {
|
|
2049
|
+
code: d.invalid_type,
|
|
2050
|
+
expected: h.null,
|
|
2051
|
+
received: n.parsedType
|
|
2052
|
+
}), y;
|
|
2053
|
+
}
|
|
2054
|
+
return D(e.data);
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
it.create = (t) => new it({
|
|
2058
|
+
typeName: v.ZodNull,
|
|
2059
|
+
..._(t)
|
|
2060
|
+
});
|
|
2061
|
+
class ot extends x {
|
|
2062
|
+
constructor() {
|
|
2063
|
+
super(...arguments), this._any = !0;
|
|
2064
|
+
}
|
|
2065
|
+
_parse(e) {
|
|
2066
|
+
return D(e.data);
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
ot.create = (t) => new ot({
|
|
2070
|
+
typeName: v.ZodAny,
|
|
2071
|
+
..._(t)
|
|
2072
|
+
});
|
|
2073
|
+
class ct extends x {
|
|
2074
|
+
constructor() {
|
|
2075
|
+
super(...arguments), this._unknown = !0;
|
|
2076
|
+
}
|
|
2077
|
+
_parse(e) {
|
|
2078
|
+
return D(e.data);
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
ct.create = (t) => new ct({
|
|
2082
|
+
typeName: v.ZodUnknown,
|
|
2083
|
+
..._(t)
|
|
2084
|
+
});
|
|
2085
|
+
class G extends x {
|
|
2086
|
+
_parse(e) {
|
|
2087
|
+
const r = this._getOrReturnCtx(e);
|
|
2088
|
+
return f(r, {
|
|
2089
|
+
code: d.invalid_type,
|
|
2090
|
+
expected: h.never,
|
|
2091
|
+
received: r.parsedType
|
|
2092
|
+
}), y;
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
G.create = (t) => new G({
|
|
2096
|
+
typeName: v.ZodNever,
|
|
2097
|
+
..._(t)
|
|
2098
|
+
});
|
|
2099
|
+
class lt extends x {
|
|
2100
|
+
_parse(e) {
|
|
2101
|
+
if (this._getType(e) !== h.undefined) {
|
|
2102
|
+
const n = this._getOrReturnCtx(e);
|
|
2103
|
+
return f(n, {
|
|
2104
|
+
code: d.invalid_type,
|
|
2105
|
+
expected: h.void,
|
|
2106
|
+
received: n.parsedType
|
|
2107
|
+
}), y;
|
|
2108
|
+
}
|
|
2109
|
+
return D(e.data);
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
lt.create = (t) => new lt({
|
|
2113
|
+
typeName: v.ZodVoid,
|
|
2114
|
+
..._(t)
|
|
2115
|
+
});
|
|
2116
|
+
class B extends x {
|
|
2117
|
+
_parse(e) {
|
|
2118
|
+
const { ctx: r, status: n } = this._processInputParams(e), s = this._def;
|
|
2119
|
+
if (r.parsedType !== h.array)
|
|
2120
|
+
return f(r, {
|
|
2121
|
+
code: d.invalid_type,
|
|
2122
|
+
expected: h.array,
|
|
2123
|
+
received: r.parsedType
|
|
2124
|
+
}), y;
|
|
2125
|
+
if (s.exactLength !== null) {
|
|
2126
|
+
const i = r.data.length > s.exactLength.value, o = r.data.length < s.exactLength.value;
|
|
2127
|
+
(i || o) && (f(r, {
|
|
2128
|
+
code: i ? d.too_big : d.too_small,
|
|
2129
|
+
minimum: o ? s.exactLength.value : void 0,
|
|
2130
|
+
maximum: i ? s.exactLength.value : void 0,
|
|
2131
|
+
type: "array",
|
|
2132
|
+
inclusive: !0,
|
|
2133
|
+
exact: !0,
|
|
2134
|
+
message: s.exactLength.message
|
|
2135
|
+
}), n.dirty());
|
|
2136
|
+
}
|
|
2137
|
+
if (s.minLength !== null && r.data.length < s.minLength.value && (f(r, {
|
|
2138
|
+
code: d.too_small,
|
|
2139
|
+
minimum: s.minLength.value,
|
|
2140
|
+
type: "array",
|
|
2141
|
+
inclusive: !0,
|
|
2142
|
+
exact: !1,
|
|
2143
|
+
message: s.minLength.message
|
|
2144
|
+
}), n.dirty()), s.maxLength !== null && r.data.length > s.maxLength.value && (f(r, {
|
|
2145
|
+
code: d.too_big,
|
|
2146
|
+
maximum: s.maxLength.value,
|
|
2147
|
+
type: "array",
|
|
2148
|
+
inclusive: !0,
|
|
2149
|
+
exact: !1,
|
|
2150
|
+
message: s.maxLength.message
|
|
2151
|
+
}), n.dirty()), r.common.async)
|
|
2152
|
+
return Promise.all([...r.data].map((i, o) => s.type._parseAsync(new Q(r, i, r.path, o)))).then((i) => z.mergeArray(n, i));
|
|
2153
|
+
const a = [...r.data].map((i, o) => s.type._parseSync(new Q(r, i, r.path, o)));
|
|
2154
|
+
return z.mergeArray(n, a);
|
|
2155
|
+
}
|
|
2156
|
+
get element() {
|
|
2157
|
+
return this._def.type;
|
|
2158
|
+
}
|
|
2159
|
+
min(e, r) {
|
|
2160
|
+
return new B({
|
|
2161
|
+
...this._def,
|
|
2162
|
+
minLength: { value: e, message: m.toString(r) }
|
|
2163
|
+
});
|
|
2164
|
+
}
|
|
2165
|
+
max(e, r) {
|
|
2166
|
+
return new B({
|
|
2167
|
+
...this._def,
|
|
2168
|
+
maxLength: { value: e, message: m.toString(r) }
|
|
2169
|
+
});
|
|
2170
|
+
}
|
|
2171
|
+
length(e, r) {
|
|
2172
|
+
return new B({
|
|
2173
|
+
...this._def,
|
|
2174
|
+
exactLength: { value: e, message: m.toString(r) }
|
|
2175
|
+
});
|
|
2176
|
+
}
|
|
2177
|
+
nonempty(e) {
|
|
2178
|
+
return this.min(1, e);
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
B.create = (t, e) => new B({
|
|
2182
|
+
type: t,
|
|
2183
|
+
minLength: null,
|
|
2184
|
+
maxLength: null,
|
|
2185
|
+
exactLength: null,
|
|
2186
|
+
typeName: v.ZodArray,
|
|
2187
|
+
..._(e)
|
|
2188
|
+
});
|
|
2189
|
+
function ne(t) {
|
|
2190
|
+
if (t instanceof S) {
|
|
2191
|
+
const e = {};
|
|
2192
|
+
for (const r in t.shape) {
|
|
2193
|
+
const n = t.shape[r];
|
|
2194
|
+
e[r] = J.create(ne(n));
|
|
2195
|
+
}
|
|
2196
|
+
return new S({
|
|
2197
|
+
...t._def,
|
|
2198
|
+
shape: () => e
|
|
2199
|
+
});
|
|
2200
|
+
} else return t instanceof B ? new B({
|
|
2201
|
+
...t._def,
|
|
2202
|
+
type: ne(t.element)
|
|
2203
|
+
}) : t instanceof J ? J.create(ne(t.unwrap())) : t instanceof oe ? oe.create(ne(t.unwrap())) : t instanceof re ? re.create(t.items.map((e) => ne(e))) : t;
|
|
2204
|
+
}
|
|
2205
|
+
class S extends x {
|
|
2206
|
+
constructor() {
|
|
2207
|
+
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
2208
|
+
}
|
|
2209
|
+
_getCached() {
|
|
2210
|
+
if (this._cached !== null)
|
|
2211
|
+
return this._cached;
|
|
2212
|
+
const e = this._def.shape(), r = k.objectKeys(e);
|
|
2213
|
+
return this._cached = { shape: e, keys: r }, this._cached;
|
|
2214
|
+
}
|
|
2215
|
+
_parse(e) {
|
|
2216
|
+
if (this._getType(e) !== h.object) {
|
|
2217
|
+
const l = this._getOrReturnCtx(e);
|
|
2218
|
+
return f(l, {
|
|
2219
|
+
code: d.invalid_type,
|
|
2220
|
+
expected: h.object,
|
|
2221
|
+
received: l.parsedType
|
|
2222
|
+
}), y;
|
|
2223
|
+
}
|
|
2224
|
+
const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
2225
|
+
if (!(this._def.catchall instanceof G && this._def.unknownKeys === "strip"))
|
|
2226
|
+
for (const l in s.data)
|
|
2227
|
+
i.includes(l) || o.push(l);
|
|
2228
|
+
const c = [];
|
|
2229
|
+
for (const l of i) {
|
|
2230
|
+
const u = a[l], C = s.data[l];
|
|
2231
|
+
c.push({
|
|
2232
|
+
key: { status: "valid", value: l },
|
|
2233
|
+
value: u._parse(new Q(s, C, s.path, l)),
|
|
2234
|
+
alwaysSet: l in s.data
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
if (this._def.catchall instanceof G) {
|
|
2238
|
+
const l = this._def.unknownKeys;
|
|
2239
|
+
if (l === "passthrough")
|
|
2240
|
+
for (const u of o)
|
|
2241
|
+
c.push({
|
|
2242
|
+
key: { status: "valid", value: u },
|
|
2243
|
+
value: { status: "valid", value: s.data[u] }
|
|
2244
|
+
});
|
|
2245
|
+
else if (l === "strict")
|
|
2246
|
+
o.length > 0 && (f(s, {
|
|
2247
|
+
code: d.unrecognized_keys,
|
|
2248
|
+
keys: o
|
|
2249
|
+
}), n.dirty());
|
|
2250
|
+
else if (l !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
2251
|
+
} else {
|
|
2252
|
+
const l = this._def.catchall;
|
|
2253
|
+
for (const u of o) {
|
|
2254
|
+
const C = s.data[u];
|
|
2255
|
+
c.push({
|
|
2256
|
+
key: { status: "valid", value: u },
|
|
2257
|
+
value: l._parse(
|
|
2258
|
+
new Q(s, C, s.path, u)
|
|
2259
|
+
//, ctx.child(key), value, getParsedType(value)
|
|
2260
|
+
),
|
|
2261
|
+
alwaysSet: u in s.data
|
|
2262
|
+
});
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
return s.common.async ? Promise.resolve().then(async () => {
|
|
2266
|
+
const l = [];
|
|
2267
|
+
for (const u of c) {
|
|
2268
|
+
const C = await u.key, j = await u.value;
|
|
2269
|
+
l.push({
|
|
2270
|
+
key: C,
|
|
2271
|
+
value: j,
|
|
2272
|
+
alwaysSet: u.alwaysSet
|
|
2273
|
+
});
|
|
2274
|
+
}
|
|
2275
|
+
return l;
|
|
2276
|
+
}).then((l) => z.mergeObjectSync(n, l)) : z.mergeObjectSync(n, c);
|
|
2277
|
+
}
|
|
2278
|
+
get shape() {
|
|
2279
|
+
return this._def.shape();
|
|
2280
|
+
}
|
|
2281
|
+
strict(e) {
|
|
2282
|
+
return m.errToObj, new S({
|
|
2283
|
+
...this._def,
|
|
2284
|
+
unknownKeys: "strict",
|
|
2285
|
+
...e !== void 0 ? {
|
|
2286
|
+
errorMap: (r, n) => {
|
|
2287
|
+
var a, i;
|
|
2288
|
+
const s = ((i = (a = this._def).errorMap) == null ? void 0 : i.call(a, r, n).message) ?? n.defaultError;
|
|
2289
|
+
return r.code === "unrecognized_keys" ? {
|
|
2290
|
+
message: m.errToObj(e).message ?? s
|
|
2291
|
+
} : {
|
|
2292
|
+
message: s
|
|
2293
|
+
};
|
|
2294
|
+
}
|
|
2295
|
+
} : {}
|
|
2296
|
+
});
|
|
2297
|
+
}
|
|
2298
|
+
strip() {
|
|
2299
|
+
return new S({
|
|
2300
|
+
...this._def,
|
|
2301
|
+
unknownKeys: "strip"
|
|
2302
|
+
});
|
|
2303
|
+
}
|
|
2304
|
+
passthrough() {
|
|
2305
|
+
return new S({
|
|
2306
|
+
...this._def,
|
|
2307
|
+
unknownKeys: "passthrough"
|
|
2308
|
+
});
|
|
2309
|
+
}
|
|
2310
|
+
// const AugmentFactory =
|
|
2311
|
+
// <Def extends ZodObjectDef>(def: Def) =>
|
|
2312
|
+
// <Augmentation extends ZodRawShape>(
|
|
2313
|
+
// augmentation: Augmentation
|
|
2314
|
+
// ): ZodObject<
|
|
2315
|
+
// extendShape<ReturnType<Def["shape"]>, Augmentation>,
|
|
2316
|
+
// Def["unknownKeys"],
|
|
2317
|
+
// Def["catchall"]
|
|
2318
|
+
// > => {
|
|
2319
|
+
// return new ZodObject({
|
|
2320
|
+
// ...def,
|
|
2321
|
+
// shape: () => ({
|
|
2322
|
+
// ...def.shape(),
|
|
2323
|
+
// ...augmentation,
|
|
2324
|
+
// }),
|
|
2325
|
+
// }) as any;
|
|
2326
|
+
// };
|
|
2327
|
+
extend(e) {
|
|
2328
|
+
return new S({
|
|
2329
|
+
...this._def,
|
|
2330
|
+
shape: () => ({
|
|
2331
|
+
...this._def.shape(),
|
|
2332
|
+
...e
|
|
2333
|
+
})
|
|
2334
|
+
});
|
|
2335
|
+
}
|
|
2336
|
+
/**
|
|
2337
|
+
* Prior to zod@1.0.12 there was a bug in the
|
|
2338
|
+
* inferred type of merged objects. Please
|
|
2339
|
+
* upgrade if you are experiencing issues.
|
|
2340
|
+
*/
|
|
2341
|
+
merge(e) {
|
|
2342
|
+
return new S({
|
|
2343
|
+
unknownKeys: e._def.unknownKeys,
|
|
2344
|
+
catchall: e._def.catchall,
|
|
2345
|
+
shape: () => ({
|
|
2346
|
+
...this._def.shape(),
|
|
2347
|
+
...e._def.shape()
|
|
2348
|
+
}),
|
|
2349
|
+
typeName: v.ZodObject
|
|
2350
|
+
});
|
|
2351
|
+
}
|
|
2352
|
+
// merge<
|
|
2353
|
+
// Incoming extends AnyZodObject,
|
|
2354
|
+
// Augmentation extends Incoming["shape"],
|
|
2355
|
+
// NewOutput extends {
|
|
2356
|
+
// [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
|
|
2357
|
+
// ? Augmentation[k]["_output"]
|
|
2358
|
+
// : k extends keyof Output
|
|
2359
|
+
// ? Output[k]
|
|
2360
|
+
// : never;
|
|
2361
|
+
// },
|
|
2362
|
+
// NewInput extends {
|
|
2363
|
+
// [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
|
|
2364
|
+
// ? Augmentation[k]["_input"]
|
|
2365
|
+
// : k extends keyof Input
|
|
2366
|
+
// ? Input[k]
|
|
2367
|
+
// : never;
|
|
2368
|
+
// }
|
|
2369
|
+
// >(
|
|
2370
|
+
// merging: Incoming
|
|
2371
|
+
// ): ZodObject<
|
|
2372
|
+
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
|
2373
|
+
// Incoming["_def"]["unknownKeys"],
|
|
2374
|
+
// Incoming["_def"]["catchall"],
|
|
2375
|
+
// NewOutput,
|
|
2376
|
+
// NewInput
|
|
2377
|
+
// > {
|
|
2378
|
+
// const merged: any = new ZodObject({
|
|
2379
|
+
// unknownKeys: merging._def.unknownKeys,
|
|
2380
|
+
// catchall: merging._def.catchall,
|
|
2381
|
+
// shape: () =>
|
|
2382
|
+
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
|
2383
|
+
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
2384
|
+
// }) as any;
|
|
2385
|
+
// return merged;
|
|
2386
|
+
// }
|
|
2387
|
+
setKey(e, r) {
|
|
2388
|
+
return this.augment({ [e]: r });
|
|
2389
|
+
}
|
|
2390
|
+
// merge<Incoming extends AnyZodObject>(
|
|
2391
|
+
// merging: Incoming
|
|
2392
|
+
// ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
|
|
2393
|
+
// ZodObject<
|
|
2394
|
+
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
|
2395
|
+
// Incoming["_def"]["unknownKeys"],
|
|
2396
|
+
// Incoming["_def"]["catchall"]
|
|
2397
|
+
// > {
|
|
2398
|
+
// // const mergedShape = objectUtil.mergeShapes(
|
|
2399
|
+
// // this._def.shape(),
|
|
2400
|
+
// // merging._def.shape()
|
|
2401
|
+
// // );
|
|
2402
|
+
// const merged: any = new ZodObject({
|
|
2403
|
+
// unknownKeys: merging._def.unknownKeys,
|
|
2404
|
+
// catchall: merging._def.catchall,
|
|
2405
|
+
// shape: () =>
|
|
2406
|
+
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
|
2407
|
+
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
2408
|
+
// }) as any;
|
|
2409
|
+
// return merged;
|
|
2410
|
+
// }
|
|
2411
|
+
catchall(e) {
|
|
2412
|
+
return new S({
|
|
2413
|
+
...this._def,
|
|
2414
|
+
catchall: e
|
|
2415
|
+
});
|
|
2416
|
+
}
|
|
2417
|
+
pick(e) {
|
|
2418
|
+
const r = {};
|
|
2419
|
+
for (const n of k.objectKeys(e))
|
|
2420
|
+
e[n] && this.shape[n] && (r[n] = this.shape[n]);
|
|
2421
|
+
return new S({
|
|
2422
|
+
...this._def,
|
|
2423
|
+
shape: () => r
|
|
2424
|
+
});
|
|
2425
|
+
}
|
|
2426
|
+
omit(e) {
|
|
2427
|
+
const r = {};
|
|
2428
|
+
for (const n of k.objectKeys(this.shape))
|
|
2429
|
+
e[n] || (r[n] = this.shape[n]);
|
|
2430
|
+
return new S({
|
|
2431
|
+
...this._def,
|
|
2432
|
+
shape: () => r
|
|
2433
|
+
});
|
|
2434
|
+
}
|
|
2435
|
+
/**
|
|
2436
|
+
* @deprecated
|
|
2437
|
+
*/
|
|
2438
|
+
deepPartial() {
|
|
2439
|
+
return ne(this);
|
|
2440
|
+
}
|
|
2441
|
+
partial(e) {
|
|
2442
|
+
const r = {};
|
|
2443
|
+
for (const n of k.objectKeys(this.shape)) {
|
|
2444
|
+
const s = this.shape[n];
|
|
2445
|
+
e && !e[n] ? r[n] = s : r[n] = s.optional();
|
|
2446
|
+
}
|
|
2447
|
+
return new S({
|
|
2448
|
+
...this._def,
|
|
2449
|
+
shape: () => r
|
|
2450
|
+
});
|
|
2451
|
+
}
|
|
2452
|
+
required(e) {
|
|
2453
|
+
const r = {};
|
|
2454
|
+
for (const n of k.objectKeys(this.shape))
|
|
2455
|
+
if (e && !e[n])
|
|
2456
|
+
r[n] = this.shape[n];
|
|
2457
|
+
else {
|
|
2458
|
+
let a = this.shape[n];
|
|
2459
|
+
for (; a instanceof J; )
|
|
2460
|
+
a = a._def.innerType;
|
|
2461
|
+
r[n] = a;
|
|
2462
|
+
}
|
|
2463
|
+
return new S({
|
|
2464
|
+
...this._def,
|
|
2465
|
+
shape: () => r
|
|
2466
|
+
});
|
|
2467
|
+
}
|
|
2468
|
+
keyof() {
|
|
2469
|
+
return Vt(k.objectKeys(this.shape));
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
S.create = (t, e) => new S({
|
|
2473
|
+
shape: () => t,
|
|
2474
|
+
unknownKeys: "strip",
|
|
2475
|
+
catchall: G.create(),
|
|
2476
|
+
typeName: v.ZodObject,
|
|
2477
|
+
..._(e)
|
|
2478
|
+
});
|
|
2479
|
+
S.strictCreate = (t, e) => new S({
|
|
2480
|
+
shape: () => t,
|
|
2481
|
+
unknownKeys: "strict",
|
|
2482
|
+
catchall: G.create(),
|
|
2483
|
+
typeName: v.ZodObject,
|
|
2484
|
+
..._(e)
|
|
2485
|
+
});
|
|
2486
|
+
S.lazycreate = (t, e) => new S({
|
|
2487
|
+
shape: t,
|
|
2488
|
+
unknownKeys: "strip",
|
|
2489
|
+
catchall: G.create(),
|
|
2490
|
+
typeName: v.ZodObject,
|
|
2491
|
+
..._(e)
|
|
2492
|
+
});
|
|
2493
|
+
class xe extends x {
|
|
2494
|
+
_parse(e) {
|
|
2495
|
+
const { ctx: r } = this._processInputParams(e), n = this._def.options;
|
|
2496
|
+
function s(a) {
|
|
2497
|
+
for (const o of a)
|
|
2498
|
+
if (o.result.status === "valid")
|
|
2499
|
+
return o.result;
|
|
2500
|
+
for (const o of a)
|
|
2501
|
+
if (o.result.status === "dirty")
|
|
2502
|
+
return r.common.issues.push(...o.ctx.common.issues), o.result;
|
|
2503
|
+
const i = a.map((o) => new q(o.ctx.common.issues));
|
|
2504
|
+
return f(r, {
|
|
2505
|
+
code: d.invalid_union,
|
|
2506
|
+
unionErrors: i
|
|
2507
|
+
}), y;
|
|
2508
|
+
}
|
|
2509
|
+
if (r.common.async)
|
|
2510
|
+
return Promise.all(n.map(async (a) => {
|
|
2511
|
+
const i = {
|
|
2512
|
+
...r,
|
|
2513
|
+
common: {
|
|
2514
|
+
...r.common,
|
|
2515
|
+
issues: []
|
|
2516
|
+
},
|
|
2517
|
+
parent: null
|
|
2518
|
+
};
|
|
2519
|
+
return {
|
|
2520
|
+
result: await a._parseAsync({
|
|
2521
|
+
data: r.data,
|
|
2522
|
+
path: r.path,
|
|
2523
|
+
parent: i
|
|
2524
|
+
}),
|
|
2525
|
+
ctx: i
|
|
2526
|
+
};
|
|
2527
|
+
})).then(s);
|
|
2528
|
+
{
|
|
2529
|
+
let a;
|
|
2530
|
+
const i = [];
|
|
2531
|
+
for (const c of n) {
|
|
2532
|
+
const l = {
|
|
2533
|
+
...r,
|
|
2534
|
+
common: {
|
|
2535
|
+
...r.common,
|
|
2536
|
+
issues: []
|
|
2537
|
+
},
|
|
2538
|
+
parent: null
|
|
2539
|
+
}, u = c._parseSync({
|
|
2540
|
+
data: r.data,
|
|
2541
|
+
path: r.path,
|
|
2542
|
+
parent: l
|
|
2543
|
+
});
|
|
2544
|
+
if (u.status === "valid")
|
|
2545
|
+
return u;
|
|
2546
|
+
u.status === "dirty" && !a && (a = { result: u, ctx: l }), l.common.issues.length && i.push(l.common.issues);
|
|
2547
|
+
}
|
|
2548
|
+
if (a)
|
|
2549
|
+
return r.common.issues.push(...a.ctx.common.issues), a.result;
|
|
2550
|
+
const o = i.map((c) => new q(c));
|
|
2551
|
+
return f(r, {
|
|
2552
|
+
code: d.invalid_union,
|
|
2553
|
+
unionErrors: o
|
|
2554
|
+
}), y;
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
get options() {
|
|
2558
|
+
return this._def.options;
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
xe.create = (t, e) => new xe({
|
|
2562
|
+
options: t,
|
|
2563
|
+
typeName: v.ZodUnion,
|
|
2564
|
+
..._(e)
|
|
2565
|
+
});
|
|
2566
|
+
function De(t, e) {
|
|
2567
|
+
const r = X(t), n = X(e);
|
|
2568
|
+
if (t === e)
|
|
2569
|
+
return { valid: !0, data: t };
|
|
2570
|
+
if (r === h.object && n === h.object) {
|
|
2571
|
+
const s = k.objectKeys(e), a = k.objectKeys(t).filter((o) => s.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2572
|
+
for (const o of a) {
|
|
2573
|
+
const c = De(t[o], e[o]);
|
|
2574
|
+
if (!c.valid)
|
|
2575
|
+
return { valid: !1 };
|
|
2576
|
+
i[o] = c.data;
|
|
2577
|
+
}
|
|
2578
|
+
return { valid: !0, data: i };
|
|
2579
|
+
} else if (r === h.array && n === h.array) {
|
|
2580
|
+
if (t.length !== e.length)
|
|
2581
|
+
return { valid: !1 };
|
|
2582
|
+
const s = [];
|
|
2583
|
+
for (let a = 0; a < t.length; a++) {
|
|
2584
|
+
const i = t[a], o = e[a], c = De(i, o);
|
|
2585
|
+
if (!c.valid)
|
|
2586
|
+
return { valid: !1 };
|
|
2587
|
+
s.push(c.data);
|
|
2588
|
+
}
|
|
2589
|
+
return { valid: !0, data: s };
|
|
2590
|
+
} else return r === h.date && n === h.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2591
|
+
}
|
|
2592
|
+
class ke extends x {
|
|
2593
|
+
_parse(e) {
|
|
2594
|
+
const { status: r, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
2595
|
+
if (et(a) || et(i))
|
|
2596
|
+
return y;
|
|
2597
|
+
const o = De(a.value, i.value);
|
|
2598
|
+
return o.valid ? ((tt(a) || tt(i)) && r.dirty(), { status: r.value, value: o.data }) : (f(n, {
|
|
2599
|
+
code: d.invalid_intersection_types
|
|
2600
|
+
}), y);
|
|
2601
|
+
};
|
|
2602
|
+
return n.common.async ? Promise.all([
|
|
2603
|
+
this._def.left._parseAsync({
|
|
2604
|
+
data: n.data,
|
|
2605
|
+
path: n.path,
|
|
2606
|
+
parent: n
|
|
2607
|
+
}),
|
|
2608
|
+
this._def.right._parseAsync({
|
|
2609
|
+
data: n.data,
|
|
2610
|
+
path: n.path,
|
|
2611
|
+
parent: n
|
|
2612
|
+
})
|
|
2613
|
+
]).then(([a, i]) => s(a, i)) : s(this._def.left._parseSync({
|
|
2614
|
+
data: n.data,
|
|
2615
|
+
path: n.path,
|
|
2616
|
+
parent: n
|
|
2617
|
+
}), this._def.right._parseSync({
|
|
2618
|
+
data: n.data,
|
|
2619
|
+
path: n.path,
|
|
2620
|
+
parent: n
|
|
2621
|
+
}));
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
ke.create = (t, e, r) => new ke({
|
|
2625
|
+
left: t,
|
|
2626
|
+
right: e,
|
|
2627
|
+
typeName: v.ZodIntersection,
|
|
2628
|
+
..._(r)
|
|
2629
|
+
});
|
|
2630
|
+
class re extends x {
|
|
2631
|
+
_parse(e) {
|
|
2632
|
+
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2633
|
+
if (n.parsedType !== h.array)
|
|
2634
|
+
return f(n, {
|
|
2635
|
+
code: d.invalid_type,
|
|
2636
|
+
expected: h.array,
|
|
2637
|
+
received: n.parsedType
|
|
2638
|
+
}), y;
|
|
2639
|
+
if (n.data.length < this._def.items.length)
|
|
2640
|
+
return f(n, {
|
|
2641
|
+
code: d.too_small,
|
|
2642
|
+
minimum: this._def.items.length,
|
|
2643
|
+
inclusive: !0,
|
|
2644
|
+
exact: !1,
|
|
2645
|
+
type: "array"
|
|
2646
|
+
}), y;
|
|
2647
|
+
!this._def.rest && n.data.length > this._def.items.length && (f(n, {
|
|
2648
|
+
code: d.too_big,
|
|
2649
|
+
maximum: this._def.items.length,
|
|
2650
|
+
inclusive: !0,
|
|
2651
|
+
exact: !1,
|
|
2652
|
+
type: "array"
|
|
2653
|
+
}), r.dirty());
|
|
2654
|
+
const a = [...n.data].map((i, o) => {
|
|
2655
|
+
const c = this._def.items[o] || this._def.rest;
|
|
2656
|
+
return c ? c._parse(new Q(n, i, n.path, o)) : null;
|
|
2657
|
+
}).filter((i) => !!i);
|
|
2658
|
+
return n.common.async ? Promise.all(a).then((i) => z.mergeArray(r, i)) : z.mergeArray(r, a);
|
|
2659
|
+
}
|
|
2660
|
+
get items() {
|
|
2661
|
+
return this._def.items;
|
|
2662
|
+
}
|
|
2663
|
+
rest(e) {
|
|
2664
|
+
return new re({
|
|
2665
|
+
...this._def,
|
|
2666
|
+
rest: e
|
|
2667
|
+
});
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2670
|
+
re.create = (t, e) => {
|
|
2671
|
+
if (!Array.isArray(t))
|
|
2672
|
+
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2673
|
+
return new re({
|
|
2674
|
+
items: t,
|
|
2675
|
+
typeName: v.ZodTuple,
|
|
2676
|
+
rest: null,
|
|
2677
|
+
..._(e)
|
|
2678
|
+
});
|
|
2679
|
+
};
|
|
2680
|
+
class dt extends x {
|
|
2681
|
+
get keySchema() {
|
|
2682
|
+
return this._def.keyType;
|
|
2683
|
+
}
|
|
2684
|
+
get valueSchema() {
|
|
2685
|
+
return this._def.valueType;
|
|
2686
|
+
}
|
|
2687
|
+
_parse(e) {
|
|
2688
|
+
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2689
|
+
if (n.parsedType !== h.map)
|
|
2690
|
+
return f(n, {
|
|
2691
|
+
code: d.invalid_type,
|
|
2692
|
+
expected: h.map,
|
|
2693
|
+
received: n.parsedType
|
|
2694
|
+
}), y;
|
|
2695
|
+
const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, c], l) => ({
|
|
2696
|
+
key: s._parse(new Q(n, o, n.path, [l, "key"])),
|
|
2697
|
+
value: a._parse(new Q(n, c, n.path, [l, "value"]))
|
|
2698
|
+
}));
|
|
2699
|
+
if (n.common.async) {
|
|
2700
|
+
const o = /* @__PURE__ */ new Map();
|
|
2701
|
+
return Promise.resolve().then(async () => {
|
|
2702
|
+
for (const c of i) {
|
|
2703
|
+
const l = await c.key, u = await c.value;
|
|
2704
|
+
if (l.status === "aborted" || u.status === "aborted")
|
|
2705
|
+
return y;
|
|
2706
|
+
(l.status === "dirty" || u.status === "dirty") && r.dirty(), o.set(l.value, u.value);
|
|
2707
|
+
}
|
|
2708
|
+
return { status: r.value, value: o };
|
|
2709
|
+
});
|
|
2710
|
+
} else {
|
|
2711
|
+
const o = /* @__PURE__ */ new Map();
|
|
2712
|
+
for (const c of i) {
|
|
2713
|
+
const l = c.key, u = c.value;
|
|
2714
|
+
if (l.status === "aborted" || u.status === "aborted")
|
|
2715
|
+
return y;
|
|
2716
|
+
(l.status === "dirty" || u.status === "dirty") && r.dirty(), o.set(l.value, u.value);
|
|
2717
|
+
}
|
|
2718
|
+
return { status: r.value, value: o };
|
|
2719
|
+
}
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
dt.create = (t, e, r) => new dt({
|
|
2723
|
+
valueType: e,
|
|
2724
|
+
keyType: t,
|
|
2725
|
+
typeName: v.ZodMap,
|
|
2726
|
+
..._(r)
|
|
2727
|
+
});
|
|
2728
|
+
class he extends x {
|
|
2729
|
+
_parse(e) {
|
|
2730
|
+
const { status: r, ctx: n } = this._processInputParams(e);
|
|
2731
|
+
if (n.parsedType !== h.set)
|
|
2732
|
+
return f(n, {
|
|
2733
|
+
code: d.invalid_type,
|
|
2734
|
+
expected: h.set,
|
|
2735
|
+
received: n.parsedType
|
|
2736
|
+
}), y;
|
|
2737
|
+
const s = this._def;
|
|
2738
|
+
s.minSize !== null && n.data.size < s.minSize.value && (f(n, {
|
|
2739
|
+
code: d.too_small,
|
|
2740
|
+
minimum: s.minSize.value,
|
|
2741
|
+
type: "set",
|
|
2742
|
+
inclusive: !0,
|
|
2743
|
+
exact: !1,
|
|
2744
|
+
message: s.minSize.message
|
|
2745
|
+
}), r.dirty()), s.maxSize !== null && n.data.size > s.maxSize.value && (f(n, {
|
|
2746
|
+
code: d.too_big,
|
|
2747
|
+
maximum: s.maxSize.value,
|
|
2748
|
+
type: "set",
|
|
2749
|
+
inclusive: !0,
|
|
2750
|
+
exact: !1,
|
|
2751
|
+
message: s.maxSize.message
|
|
2752
|
+
}), r.dirty());
|
|
2753
|
+
const a = this._def.valueType;
|
|
2754
|
+
function i(c) {
|
|
2755
|
+
const l = /* @__PURE__ */ new Set();
|
|
2756
|
+
for (const u of c) {
|
|
2757
|
+
if (u.status === "aborted")
|
|
2758
|
+
return y;
|
|
2759
|
+
u.status === "dirty" && r.dirty(), l.add(u.value);
|
|
2760
|
+
}
|
|
2761
|
+
return { status: r.value, value: l };
|
|
2762
|
+
}
|
|
2763
|
+
const o = [...n.data.values()].map((c, l) => a._parse(new Q(n, c, n.path, l)));
|
|
2764
|
+
return n.common.async ? Promise.all(o).then((c) => i(c)) : i(o);
|
|
2765
|
+
}
|
|
2766
|
+
min(e, r) {
|
|
2767
|
+
return new he({
|
|
2768
|
+
...this._def,
|
|
2769
|
+
minSize: { value: e, message: m.toString(r) }
|
|
2770
|
+
});
|
|
2771
|
+
}
|
|
2772
|
+
max(e, r) {
|
|
2773
|
+
return new he({
|
|
2774
|
+
...this._def,
|
|
2775
|
+
maxSize: { value: e, message: m.toString(r) }
|
|
2776
|
+
});
|
|
2777
|
+
}
|
|
2778
|
+
size(e, r) {
|
|
2779
|
+
return this.min(e, r).max(e, r);
|
|
2780
|
+
}
|
|
2781
|
+
nonempty(e) {
|
|
2782
|
+
return this.min(1, e);
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
he.create = (t, e) => new he({
|
|
2786
|
+
valueType: t,
|
|
2787
|
+
minSize: null,
|
|
2788
|
+
maxSize: null,
|
|
2789
|
+
typeName: v.ZodSet,
|
|
2790
|
+
..._(e)
|
|
2791
|
+
});
|
|
2792
|
+
class ut extends x {
|
|
2793
|
+
get schema() {
|
|
2794
|
+
return this._def.getter();
|
|
2795
|
+
}
|
|
2796
|
+
_parse(e) {
|
|
2797
|
+
const { ctx: r } = this._processInputParams(e);
|
|
2798
|
+
return this._def.getter()._parse({ data: r.data, path: r.path, parent: r });
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
ut.create = (t, e) => new ut({
|
|
2802
|
+
getter: t,
|
|
2803
|
+
typeName: v.ZodLazy,
|
|
2804
|
+
..._(e)
|
|
2805
|
+
});
|
|
2806
|
+
class ft extends x {
|
|
2807
|
+
_parse(e) {
|
|
2808
|
+
if (e.data !== this._def.value) {
|
|
2809
|
+
const r = this._getOrReturnCtx(e);
|
|
2810
|
+
return f(r, {
|
|
2811
|
+
received: r.data,
|
|
2812
|
+
code: d.invalid_literal,
|
|
2813
|
+
expected: this._def.value
|
|
2814
|
+
}), y;
|
|
2815
|
+
}
|
|
2816
|
+
return { status: "valid", value: e.data };
|
|
2817
|
+
}
|
|
2818
|
+
get value() {
|
|
2819
|
+
return this._def.value;
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
ft.create = (t, e) => new ft({
|
|
2823
|
+
value: t,
|
|
2824
|
+
typeName: v.ZodLiteral,
|
|
2825
|
+
..._(e)
|
|
2826
|
+
});
|
|
2827
|
+
function Vt(t, e) {
|
|
2828
|
+
return new ae({
|
|
2829
|
+
values: t,
|
|
2830
|
+
typeName: v.ZodEnum,
|
|
2831
|
+
..._(e)
|
|
2832
|
+
});
|
|
2833
|
+
}
|
|
2834
|
+
class ae extends x {
|
|
2835
|
+
_parse(e) {
|
|
2836
|
+
if (typeof e.data != "string") {
|
|
2837
|
+
const r = this._getOrReturnCtx(e), n = this._def.values;
|
|
2838
|
+
return f(r, {
|
|
2839
|
+
expected: k.joinValues(n),
|
|
2840
|
+
received: r.parsedType,
|
|
2841
|
+
code: d.invalid_type
|
|
2842
|
+
}), y;
|
|
2843
|
+
}
|
|
2844
|
+
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
|
|
2845
|
+
const r = this._getOrReturnCtx(e), n = this._def.values;
|
|
2846
|
+
return f(r, {
|
|
2847
|
+
received: r.data,
|
|
2848
|
+
code: d.invalid_enum_value,
|
|
2849
|
+
options: n
|
|
2850
|
+
}), y;
|
|
2851
|
+
}
|
|
2852
|
+
return D(e.data);
|
|
2853
|
+
}
|
|
2854
|
+
get options() {
|
|
2855
|
+
return this._def.values;
|
|
2856
|
+
}
|
|
2857
|
+
get enum() {
|
|
2858
|
+
const e = {};
|
|
2859
|
+
for (const r of this._def.values)
|
|
2860
|
+
e[r] = r;
|
|
2861
|
+
return e;
|
|
2862
|
+
}
|
|
2863
|
+
get Values() {
|
|
2864
|
+
const e = {};
|
|
2865
|
+
for (const r of this._def.values)
|
|
2866
|
+
e[r] = r;
|
|
2867
|
+
return e;
|
|
2868
|
+
}
|
|
2869
|
+
get Enum() {
|
|
2870
|
+
const e = {};
|
|
2871
|
+
for (const r of this._def.values)
|
|
2872
|
+
e[r] = r;
|
|
2873
|
+
return e;
|
|
2874
|
+
}
|
|
2875
|
+
extract(e, r = this._def) {
|
|
2876
|
+
return ae.create(e, {
|
|
2877
|
+
...this._def,
|
|
2878
|
+
...r
|
|
2879
|
+
});
|
|
2880
|
+
}
|
|
2881
|
+
exclude(e, r = this._def) {
|
|
2882
|
+
return ae.create(this.options.filter((n) => !e.includes(n)), {
|
|
2883
|
+
...this._def,
|
|
2884
|
+
...r
|
|
2885
|
+
});
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
ae.create = Vt;
|
|
2889
|
+
class ht extends x {
|
|
2890
|
+
_parse(e) {
|
|
2891
|
+
const r = k.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2892
|
+
if (n.parsedType !== h.string && n.parsedType !== h.number) {
|
|
2893
|
+
const s = k.objectValues(r);
|
|
2894
|
+
return f(n, {
|
|
2895
|
+
expected: k.joinValues(s),
|
|
2896
|
+
received: n.parsedType,
|
|
2897
|
+
code: d.invalid_type
|
|
2898
|
+
}), y;
|
|
2899
|
+
}
|
|
2900
|
+
if (this._cache || (this._cache = new Set(k.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
2901
|
+
const s = k.objectValues(r);
|
|
2902
|
+
return f(n, {
|
|
2903
|
+
received: n.data,
|
|
2904
|
+
code: d.invalid_enum_value,
|
|
2905
|
+
options: s
|
|
2906
|
+
}), y;
|
|
2907
|
+
}
|
|
2908
|
+
return D(e.data);
|
|
2909
|
+
}
|
|
2910
|
+
get enum() {
|
|
2911
|
+
return this._def.values;
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
ht.create = (t, e) => new ht({
|
|
2915
|
+
values: t,
|
|
2916
|
+
typeName: v.ZodNativeEnum,
|
|
2917
|
+
..._(e)
|
|
2918
|
+
});
|
|
2919
|
+
class we extends x {
|
|
2920
|
+
unwrap() {
|
|
2921
|
+
return this._def.type;
|
|
2922
|
+
}
|
|
2923
|
+
_parse(e) {
|
|
2924
|
+
const { ctx: r } = this._processInputParams(e);
|
|
2925
|
+
if (r.parsedType !== h.promise && r.common.async === !1)
|
|
2926
|
+
return f(r, {
|
|
2927
|
+
code: d.invalid_type,
|
|
2928
|
+
expected: h.promise,
|
|
2929
|
+
received: r.parsedType
|
|
2930
|
+
}), y;
|
|
2931
|
+
const n = r.parsedType === h.promise ? r.data : Promise.resolve(r.data);
|
|
2932
|
+
return D(n.then((s) => this._def.type.parseAsync(s, {
|
|
2933
|
+
path: r.path,
|
|
2934
|
+
errorMap: r.common.contextualErrorMap
|
|
2935
|
+
})));
|
|
2936
|
+
}
|
|
2937
|
+
}
|
|
2938
|
+
we.create = (t, e) => new we({
|
|
2939
|
+
type: t,
|
|
2940
|
+
typeName: v.ZodPromise,
|
|
2941
|
+
..._(e)
|
|
2942
|
+
});
|
|
2943
|
+
class ie extends x {
|
|
2944
|
+
innerType() {
|
|
2945
|
+
return this._def.schema;
|
|
2946
|
+
}
|
|
2947
|
+
sourceType() {
|
|
2948
|
+
return this._def.schema._def.typeName === v.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2949
|
+
}
|
|
2950
|
+
_parse(e) {
|
|
2951
|
+
const { status: r, ctx: n } = this._processInputParams(e), s = this._def.effect || null, a = {
|
|
2952
|
+
addIssue: (i) => {
|
|
2953
|
+
f(n, i), i.fatal ? r.abort() : r.dirty();
|
|
2954
|
+
},
|
|
2955
|
+
get path() {
|
|
2956
|
+
return n.path;
|
|
2957
|
+
}
|
|
2958
|
+
};
|
|
2959
|
+
if (a.addIssue = a.addIssue.bind(a), s.type === "preprocess") {
|
|
2960
|
+
const i = s.transform(n.data, a);
|
|
2961
|
+
if (n.common.async)
|
|
2962
|
+
return Promise.resolve(i).then(async (o) => {
|
|
2963
|
+
if (r.value === "aborted")
|
|
2964
|
+
return y;
|
|
2965
|
+
const c = await this._def.schema._parseAsync({
|
|
2966
|
+
data: o,
|
|
2967
|
+
path: n.path,
|
|
2968
|
+
parent: n
|
|
2969
|
+
});
|
|
2970
|
+
return c.status === "aborted" ? y : c.status === "dirty" || r.value === "dirty" ? ce(c.value) : c;
|
|
2971
|
+
});
|
|
2972
|
+
{
|
|
2973
|
+
if (r.value === "aborted")
|
|
2974
|
+
return y;
|
|
2975
|
+
const o = this._def.schema._parseSync({
|
|
2976
|
+
data: i,
|
|
2977
|
+
path: n.path,
|
|
2978
|
+
parent: n
|
|
2979
|
+
});
|
|
2980
|
+
return o.status === "aborted" ? y : o.status === "dirty" || r.value === "dirty" ? ce(o.value) : o;
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
if (s.type === "refinement") {
|
|
2984
|
+
const i = (o) => {
|
|
2985
|
+
const c = s.refinement(o, a);
|
|
2986
|
+
if (n.common.async)
|
|
2987
|
+
return Promise.resolve(c);
|
|
2988
|
+
if (c instanceof Promise)
|
|
2989
|
+
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2990
|
+
return o;
|
|
2991
|
+
};
|
|
2992
|
+
if (n.common.async === !1) {
|
|
2993
|
+
const o = this._def.schema._parseSync({
|
|
2994
|
+
data: n.data,
|
|
2995
|
+
path: n.path,
|
|
2996
|
+
parent: n
|
|
2997
|
+
});
|
|
2998
|
+
return o.status === "aborted" ? y : (o.status === "dirty" && r.dirty(), i(o.value), { status: r.value, value: o.value });
|
|
2999
|
+
} else
|
|
3000
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && r.dirty(), i(o.value).then(() => ({ status: r.value, value: o.value }))));
|
|
3001
|
+
}
|
|
3002
|
+
if (s.type === "transform")
|
|
3003
|
+
if (n.common.async === !1) {
|
|
3004
|
+
const i = this._def.schema._parseSync({
|
|
3005
|
+
data: n.data,
|
|
3006
|
+
path: n.path,
|
|
3007
|
+
parent: n
|
|
3008
|
+
});
|
|
3009
|
+
if (!se(i))
|
|
3010
|
+
return y;
|
|
3011
|
+
const o = s.transform(i.value, a);
|
|
3012
|
+
if (o instanceof Promise)
|
|
3013
|
+
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
3014
|
+
return { status: r.value, value: o };
|
|
3015
|
+
} else
|
|
3016
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => se(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({
|
|
3017
|
+
status: r.value,
|
|
3018
|
+
value: o
|
|
3019
|
+
})) : y);
|
|
3020
|
+
k.assertNever(s);
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
ie.create = (t, e, r) => new ie({
|
|
3024
|
+
schema: t,
|
|
3025
|
+
typeName: v.ZodEffects,
|
|
3026
|
+
effect: e,
|
|
3027
|
+
..._(r)
|
|
3028
|
+
});
|
|
3029
|
+
ie.createWithPreprocess = (t, e, r) => new ie({
|
|
3030
|
+
schema: e,
|
|
3031
|
+
effect: { type: "preprocess", transform: t },
|
|
3032
|
+
typeName: v.ZodEffects,
|
|
3033
|
+
..._(r)
|
|
3034
|
+
});
|
|
3035
|
+
class J extends x {
|
|
3036
|
+
_parse(e) {
|
|
3037
|
+
return this._getType(e) === h.undefined ? D(void 0) : this._def.innerType._parse(e);
|
|
3038
|
+
}
|
|
3039
|
+
unwrap() {
|
|
3040
|
+
return this._def.innerType;
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
J.create = (t, e) => new J({
|
|
3044
|
+
innerType: t,
|
|
3045
|
+
typeName: v.ZodOptional,
|
|
3046
|
+
..._(e)
|
|
3047
|
+
});
|
|
3048
|
+
class oe extends x {
|
|
3049
|
+
_parse(e) {
|
|
3050
|
+
return this._getType(e) === h.null ? D(null) : this._def.innerType._parse(e);
|
|
3051
|
+
}
|
|
3052
|
+
unwrap() {
|
|
3053
|
+
return this._def.innerType;
|
|
3054
|
+
}
|
|
3055
|
+
}
|
|
3056
|
+
oe.create = (t, e) => new oe({
|
|
3057
|
+
innerType: t,
|
|
3058
|
+
typeName: v.ZodNullable,
|
|
3059
|
+
..._(e)
|
|
3060
|
+
});
|
|
3061
|
+
class Ve extends x {
|
|
3062
|
+
_parse(e) {
|
|
3063
|
+
const { ctx: r } = this._processInputParams(e);
|
|
3064
|
+
let n = r.data;
|
|
3065
|
+
return r.parsedType === h.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
3066
|
+
data: n,
|
|
3067
|
+
path: r.path,
|
|
3068
|
+
parent: r
|
|
3069
|
+
});
|
|
3070
|
+
}
|
|
3071
|
+
removeDefault() {
|
|
3072
|
+
return this._def.innerType;
|
|
3073
|
+
}
|
|
3074
|
+
}
|
|
3075
|
+
Ve.create = (t, e) => new Ve({
|
|
3076
|
+
innerType: t,
|
|
3077
|
+
typeName: v.ZodDefault,
|
|
3078
|
+
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
3079
|
+
..._(e)
|
|
3080
|
+
});
|
|
3081
|
+
class Be extends x {
|
|
3082
|
+
_parse(e) {
|
|
3083
|
+
const { ctx: r } = this._processInputParams(e), n = {
|
|
3084
|
+
...r,
|
|
3085
|
+
common: {
|
|
3086
|
+
...r.common,
|
|
3087
|
+
issues: []
|
|
3088
|
+
}
|
|
3089
|
+
}, s = this._def.innerType._parse({
|
|
3090
|
+
data: n.data,
|
|
3091
|
+
path: n.path,
|
|
3092
|
+
parent: {
|
|
3093
|
+
...n
|
|
3094
|
+
}
|
|
3095
|
+
});
|
|
3096
|
+
return _e(s) ? s.then((a) => ({
|
|
3097
|
+
status: "valid",
|
|
3098
|
+
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
3099
|
+
get error() {
|
|
3100
|
+
return new q(n.common.issues);
|
|
3101
|
+
},
|
|
3102
|
+
input: n.data
|
|
3103
|
+
})
|
|
3104
|
+
})) : {
|
|
3105
|
+
status: "valid",
|
|
3106
|
+
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
3107
|
+
get error() {
|
|
3108
|
+
return new q(n.common.issues);
|
|
3109
|
+
},
|
|
3110
|
+
input: n.data
|
|
3111
|
+
})
|
|
3112
|
+
};
|
|
3113
|
+
}
|
|
3114
|
+
removeCatch() {
|
|
3115
|
+
return this._def.innerType;
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
Be.create = (t, e) => new Be({
|
|
3119
|
+
innerType: t,
|
|
3120
|
+
typeName: v.ZodCatch,
|
|
3121
|
+
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
3122
|
+
..._(e)
|
|
3123
|
+
});
|
|
3124
|
+
class mt extends x {
|
|
3125
|
+
_parse(e) {
|
|
3126
|
+
if (this._getType(e) !== h.nan) {
|
|
3127
|
+
const n = this._getOrReturnCtx(e);
|
|
3128
|
+
return f(n, {
|
|
3129
|
+
code: d.invalid_type,
|
|
3130
|
+
expected: h.nan,
|
|
3131
|
+
received: n.parsedType
|
|
3132
|
+
}), y;
|
|
3133
|
+
}
|
|
3134
|
+
return { status: "valid", value: e.data };
|
|
3135
|
+
}
|
|
3136
|
+
}
|
|
3137
|
+
mt.create = (t) => new mt({
|
|
3138
|
+
typeName: v.ZodNaN,
|
|
3139
|
+
..._(t)
|
|
3140
|
+
});
|
|
3141
|
+
class fn extends x {
|
|
3142
|
+
_parse(e) {
|
|
3143
|
+
const { ctx: r } = this._processInputParams(e), n = r.data;
|
|
3144
|
+
return this._def.type._parse({
|
|
3145
|
+
data: n,
|
|
3146
|
+
path: r.path,
|
|
3147
|
+
parent: r
|
|
3148
|
+
});
|
|
3149
|
+
}
|
|
3150
|
+
unwrap() {
|
|
3151
|
+
return this._def.type;
|
|
3152
|
+
}
|
|
3153
|
+
}
|
|
3154
|
+
class We extends x {
|
|
3155
|
+
_parse(e) {
|
|
3156
|
+
const { status: r, ctx: n } = this._processInputParams(e);
|
|
3157
|
+
if (n.common.async)
|
|
3158
|
+
return (async () => {
|
|
3159
|
+
const a = await this._def.in._parseAsync({
|
|
3160
|
+
data: n.data,
|
|
3161
|
+
path: n.path,
|
|
3162
|
+
parent: n
|
|
3163
|
+
});
|
|
3164
|
+
return a.status === "aborted" ? y : a.status === "dirty" ? (r.dirty(), ce(a.value)) : this._def.out._parseAsync({
|
|
3165
|
+
data: a.value,
|
|
3166
|
+
path: n.path,
|
|
3167
|
+
parent: n
|
|
3168
|
+
});
|
|
3169
|
+
})();
|
|
3170
|
+
{
|
|
3171
|
+
const s = this._def.in._parseSync({
|
|
3172
|
+
data: n.data,
|
|
3173
|
+
path: n.path,
|
|
3174
|
+
parent: n
|
|
3175
|
+
});
|
|
3176
|
+
return s.status === "aborted" ? y : s.status === "dirty" ? (r.dirty(), {
|
|
3177
|
+
status: "dirty",
|
|
3178
|
+
value: s.value
|
|
3179
|
+
}) : this._def.out._parseSync({
|
|
3180
|
+
data: s.value,
|
|
3181
|
+
path: n.path,
|
|
3182
|
+
parent: n
|
|
3183
|
+
});
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3186
|
+
static create(e, r) {
|
|
3187
|
+
return new We({
|
|
3188
|
+
in: e,
|
|
3189
|
+
out: r,
|
|
3190
|
+
typeName: v.ZodPipeline
|
|
3191
|
+
});
|
|
3192
|
+
}
|
|
3193
|
+
}
|
|
3194
|
+
class Ue extends x {
|
|
3195
|
+
_parse(e) {
|
|
3196
|
+
const r = this._def.innerType._parse(e), n = (s) => (se(s) && (s.value = Object.freeze(s.value)), s);
|
|
3197
|
+
return _e(r) ? r.then((s) => n(s)) : n(r);
|
|
3198
|
+
}
|
|
3199
|
+
unwrap() {
|
|
3200
|
+
return this._def.innerType;
|
|
3201
|
+
}
|
|
3202
|
+
}
|
|
3203
|
+
Ue.create = (t, e) => new Ue({
|
|
3204
|
+
innerType: t,
|
|
3205
|
+
typeName: v.ZodReadonly,
|
|
3206
|
+
..._(e)
|
|
3207
|
+
});
|
|
3208
|
+
var v;
|
|
3209
|
+
(function(t) {
|
|
3210
|
+
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
|
3211
|
+
})(v || (v = {}));
|
|
3212
|
+
const hn = Y.create;
|
|
3213
|
+
G.create;
|
|
3214
|
+
B.create;
|
|
3215
|
+
const mn = S.create;
|
|
3216
|
+
xe.create;
|
|
3217
|
+
ke.create;
|
|
3218
|
+
re.create;
|
|
3219
|
+
ae.create;
|
|
3220
|
+
we.create;
|
|
3221
|
+
J.create;
|
|
3222
|
+
oe.create;
|
|
3223
|
+
const pn = (t) => mn({
|
|
3224
|
+
password: hn().nonempty(t("required", { field: t("Password"), ns: "validation" }))
|
|
3225
|
+
}), Cn = ({
|
|
3226
|
+
title: t,
|
|
3227
|
+
description: e,
|
|
3228
|
+
children: r,
|
|
3229
|
+
onSubmit: n,
|
|
3230
|
+
...s
|
|
3231
|
+
}) => {
|
|
3232
|
+
const { t: a } = gt(), i = Ft(() => pn(a), [a]), o = qt({
|
|
3233
|
+
resolver: Mr(i),
|
|
3234
|
+
defaultValues: {
|
|
3235
|
+
password: ""
|
|
3236
|
+
}
|
|
3237
|
+
});
|
|
3238
|
+
return /* @__PURE__ */ F(yt, { ...s, children: [
|
|
3239
|
+
r && /* @__PURE__ */ M(vt, { children: r }),
|
|
3240
|
+
/* @__PURE__ */ M(_t, { children: /* @__PURE__ */ M(Ht, { ...o, children: /* @__PURE__ */ F("form", { onSubmit: o.handleSubmit(n), className: "space-y-3", children: [
|
|
3241
|
+
/* @__PURE__ */ F(bt, { children: [
|
|
3242
|
+
/* @__PURE__ */ M(xt, { children: t ?? a("Confirm your password") }),
|
|
3243
|
+
/* @__PURE__ */ F("div", { className: "text-secondary text-body-sm-medium space-y-3", children: [
|
|
3244
|
+
e ?? a("Enter your account password to complete this action"),
|
|
3245
|
+
/* @__PURE__ */ M(
|
|
3246
|
+
Xt,
|
|
3247
|
+
{
|
|
3248
|
+
required: !0,
|
|
3249
|
+
type: "password",
|
|
3250
|
+
control: o.control,
|
|
3251
|
+
name: "password",
|
|
3252
|
+
placeholder: a("Password")
|
|
3253
|
+
}
|
|
3254
|
+
)
|
|
3255
|
+
] })
|
|
3256
|
+
] }),
|
|
3257
|
+
/* @__PURE__ */ F(kt, { children: [
|
|
3258
|
+
/* @__PURE__ */ M(wt, { type: "reset", onClick: () => o.reset(), children: a("Cancel") }),
|
|
3259
|
+
/* @__PURE__ */ M(Tt, { type: "submit", children: a("Confirm") })
|
|
3260
|
+
] })
|
|
3261
|
+
] }) }) })
|
|
3262
|
+
] });
|
|
3263
|
+
};
|
|
3264
|
+
export {
|
|
3265
|
+
Tn as C,
|
|
3266
|
+
wn as L,
|
|
3267
|
+
Cn as P,
|
|
3268
|
+
A as y
|
|
3269
|
+
};
|
|
3270
|
+
//# sourceMappingURL=PasswordConfirm-DYTMNa33.es.js.map
|