react-luminus-components 1.3.89 → 1.3.91

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.
Files changed (387) hide show
  1. package/README.md +349 -349
  2. package/dist/.vite/manifest.json +183 -0
  3. package/dist/FullScreenContainer-BHOMIeza.cjs +1 -0
  4. package/dist/FullScreenContainer-DalqTwrK.js +27 -0
  5. package/dist/Loading-BDj5dLz0.js +17 -0
  6. package/dist/Loading-BgYSq3VS.cjs +1 -0
  7. package/dist/ResponsiveContextDropdown-D7dyws1-.js +24266 -0
  8. package/dist/ResponsiveContextDropdown-ZEwJJoab.cjs +279 -0
  9. package/dist/SimpleTooltip-BLerwS-Y.js +5 -0
  10. package/dist/SimpleTooltip-sYuU_O38.cjs +1 -0
  11. package/dist/components/BnfTableValueFormats/UserAvatarValueFormat/UserAvatarValueFormat.d.ts +4 -0
  12. package/dist/components/BnfTableValueFormats/index.d.ts +1 -0
  13. package/dist/components/Buttons/ContextButton/ContextButton.d.ts +13 -0
  14. package/dist/components/Buttons/ContextButton/FileUploadContextButton.d.ts +11 -0
  15. package/dist/components/Buttons/FileUploadButton/FileUploadButton.d.ts +11 -0
  16. package/dist/components/Buttons/FloatingSubmit/FloatingFormSubmit.d.ts +9 -0
  17. package/dist/components/Buttons/IconButton/IconButton.d.ts +12 -0
  18. package/dist/components/Buttons/PrimaryButton/PrimaryButton.d.ts +13 -0
  19. package/dist/components/Buttons/index.d.ts +6 -0
  20. package/dist/components/Documents/Documents.d.ts +10 -0
  21. package/dist/components/Documents/components/DocumentDirectory/DocumentDirectory.d.ts +5 -0
  22. package/dist/components/Documents/components/DocumentDirectory/components/DocumentDirectoryLabel/DocumentDirectoryLabel.d.ts +7 -0
  23. package/dist/components/Documents/components/DocumentDirectory/components/index.d.ts +1 -0
  24. package/dist/components/Documents/components/DocumentsActions/DocumentsActions.d.ts +7 -0
  25. package/dist/components/Documents/components/DocumentsActions/components/DocActionButton/DocActionButton.d.ts +10 -0
  26. package/dist/components/Documents/components/DocumentsActions/components/DocumentsUpload/DocumentsUpload.d.ts +10 -0
  27. package/dist/components/Documents/components/DocumentsActions/components/DocumentsUpload/componenets/UploadFilesModal/UploadFilesModal.d.ts +7 -0
  28. package/dist/components/Documents/components/DocumentsActions/components/DocumentsUpload/componenets/UploadFilesModal/hooks/useUploadFilesFormSchema.d.ts +18 -0
  29. package/dist/components/Documents/components/DocumentsActions/components/DocumentsUpload/componenets/index.d.ts +1 -0
  30. package/dist/components/Documents/components/DocumentsActions/components/index.d.ts +2 -0
  31. package/dist/components/Documents/components/DocumentsFilesTable/DocumentsFilesTable.d.ts +6 -0
  32. package/dist/components/Documents/components/DocumentsFilesTable/hooks/useDocumentsFilesColumns.d.ts +11 -0
  33. package/dist/components/Documents/components/DocumentsModals/DocumentsModals.d.ts +2 -0
  34. package/dist/components/Documents/components/DocumentsModals/components/CreateFolderModal/CreateFolderModal.d.ts +5 -0
  35. package/dist/components/Documents/components/DocumentsModals/components/CreateFolderModal/hooks/useDocCreateFolderForm.d.ts +13 -0
  36. package/dist/components/Documents/components/DocumentsModals/components/EditFileModal/EditFileModal.d.ts +5 -0
  37. package/dist/components/Documents/components/DocumentsModals/components/EditFileModal/EditFileModalInner.d.ts +8 -0
  38. package/dist/components/Documents/components/DocumentsModals/components/EditFileModal/hooks/useEditFileForm.d.ts +18 -0
  39. package/dist/components/Documents/components/DocumentsModals/components/index.d.ts +2 -0
  40. package/dist/components/Documents/components/DocumentsModals/types/DocumentsModalType.d.ts +2 -0
  41. package/dist/components/Documents/components/DocumentsRoot/DocumentsRoot.d.ts +5 -0
  42. package/dist/components/Documents/components/FileExtensionIcon/FileExtensionIcon.d.ts +7 -0
  43. package/dist/components/Documents/components/index.d.ts +6 -0
  44. package/dist/components/Documents/contexts/DocumentsContext.d.ts +13 -0
  45. package/dist/components/Documents/hooks/useDocContextApiActions.d.ts +17 -0
  46. package/dist/components/Documents/hooks/useDocumentsApiActions.d.ts +7 -0
  47. package/dist/components/Documents/hooks/useDocumentsDrag.d.ts +19 -0
  48. package/dist/components/Documents/hooks/useDocumentsReducer.d.ts +91 -0
  49. package/dist/components/Documents/index.d.ts +2 -0
  50. package/dist/components/Documents/types/ui/DocumentFile.d.ts +6 -0
  51. package/dist/components/Documents/types/ui/DocumentFolder.d.ts +10 -0
  52. package/dist/components/Documents/types/ui/DocumentState.d.ts +2 -0
  53. package/dist/components/Documents/types/ui/DocumentsActionsObj.d.ts +14 -0
  54. package/dist/components/Documents/types/ui/DocumentsFolderId.d.ts +2 -0
  55. package/dist/components/Documents/types/ui/FileDirType.d.ts +2 -0
  56. package/dist/components/Documents/utils/documentsConstants.d.ts +1 -0
  57. package/dist/components/Documents/utils/documentsDataUtils.d.ts +12 -0
  58. package/dist/components/Documents/utils/documentsTypeUtils.d.ts +4 -0
  59. package/dist/components/Documents/utils/documentsUtils.d.ts +7 -0
  60. package/dist/components/Dropdown/Dropdown.d.ts +8 -0
  61. package/dist/components/Dropdown/comps/DropdownDivider/DropdownDivider.d.ts +7 -0
  62. package/dist/components/Dropdown/comps/DropdownItem/DropdownItem.d.ts +10 -0
  63. package/dist/components/Dropdown/comps/DropdownItem/FileUploadDropdownItem.d.ts +11 -0
  64. package/dist/components/Dropdown/comps/DropdownToggle/DropdownToggle.d.ts +7 -0
  65. package/dist/components/Dropdown/comps/SimpleToggle/SimpleToggle.d.ts +11 -0
  66. package/dist/components/Dropdown/comps/UserAvatarToggle/UserAvatarToggle.d.ts +9 -0
  67. package/dist/components/Dropdown/comps/index.d.ts +6 -0
  68. package/dist/components/Dropdown/index.d.ts +2 -0
  69. package/dist/components/Flexmonster/Flexmonster.d.ts +15 -0
  70. package/dist/components/Flexmonster/ReportPage.d.ts +16 -0
  71. package/dist/components/Flexmonster/components/ReportSharingModal/ReportSharingModal.d.ts +12 -0
  72. package/dist/components/Flexmonster/components/ReportSharingModal/hooks/useReportSharingApi.d.ts +6 -0
  73. package/dist/components/Flexmonster/components/index.d.ts +1 -0
  74. package/dist/components/Flexmonster/hooks/useReportMappings.d.ts +4 -0
  75. package/dist/components/Flexmonster/hooks/useReportVersionApi.d.ts +10 -0
  76. package/dist/components/Flexmonster/index.d.ts +2 -0
  77. package/dist/components/Flexmonster/types/api/ReportModel.d.ts +7 -0
  78. package/dist/components/Flexmonster/types/api/ReportRestrictItem.d.ts +4 -0
  79. package/dist/components/Flexmonster/types/api/ReportRestrictModel.d.ts +6 -0
  80. package/dist/components/Flexmonster/types/api/ReportVersionModel.d.ts +15 -0
  81. package/dist/components/Flexmonster/types/api/ReportVersionUserModel.d.ts +7 -0
  82. package/dist/components/Flexmonster/types/ui/ReportSettings.d.ts +5 -0
  83. package/dist/components/Flexmonster/utils/flexMonsterUtils.d.ts +12 -0
  84. package/dist/components/Form/CheckInput/CheckInput.d.ts +4 -0
  85. package/dist/components/Form/DropdownPicker/DropdownPicker.d.ts +4 -0
  86. package/dist/components/Form/NumericStepperInput/NumericStepperInput.d.ts +4 -0
  87. package/dist/components/Form/NumericTextInput/NumericTextInput.d.ts +4 -0
  88. package/dist/components/Form/SelectInput/SelectInput.d.ts +4 -0
  89. package/dist/components/Form/TextAreaInput/TextAreaInput.d.ts +4 -0
  90. package/dist/components/Form/TextInput/TextInput.d.ts +4 -0
  91. package/dist/components/Form/index.d.ts +7 -0
  92. package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +4 -0
  93. package/dist/components/HookForm/CustomSelectInput/CustomSelectInput.d.ts +4 -0
  94. package/dist/components/HookForm/DropdownPicker/HookFormDropdownPicker.d.ts +5 -0
  95. package/dist/components/HookForm/FileInput/HookFormFileInput.d.ts +4 -0
  96. package/dist/components/HookForm/FloatingSubmit/HookFormFloatingSubmit.d.ts +9 -0
  97. package/dist/components/HookForm/NumericStepperInput/HookFormNumericStepperInput.d.ts +4 -0
  98. package/dist/components/HookForm/NumericTextInput/HookFormNumericTextInput.d.ts +4 -0
  99. package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +4 -0
  100. package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +4 -0
  101. package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +4 -0
  102. package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +4 -0
  103. package/dist/components/HookForm/index.d.ts +11 -0
  104. package/dist/components/InputContainers/FloatingLabelInput/FloatingLabelInput.d.ts +33 -0
  105. package/dist/components/InputContainers/InputAnchorContainer/InputAnchorContainer.d.ts +9 -0
  106. package/dist/components/InputContainers/NoInputContainer/NoInputContainer.d.ts +33 -0
  107. package/dist/components/InputContainers/RowLabelInput/RowLabelInput.d.ts +33 -0
  108. package/dist/components/InputContainers/index.d.ts +4 -0
  109. package/dist/components/Layout/MessageBoard/MessageBoard.d.ts +15 -0
  110. package/dist/components/Layout/MessageBoard/components/MessageList/MessageList.d.ts +12 -0
  111. package/dist/components/Layout/MessageBoard/components/MessageList/comps/MessageFilters/MessageFilters.d.ts +7 -0
  112. package/dist/components/Layout/MessageBoard/components/MessageList/comps/MessageItem/MessageItem.d.ts +11 -0
  113. package/dist/components/Layout/MessageBoard/components/MessageList/comps/index.d.ts +2 -0
  114. package/dist/components/Layout/MessageBoard/components/index.d.ts +1 -0
  115. package/dist/components/Layout/index.d.ts +1 -0
  116. package/dist/components/NewTabs/Tab/Tab.d.ts +12 -0
  117. package/dist/components/NewTabs/TabPanel/TabPanel.d.ts +10 -0
  118. package/dist/components/NewTabs/Tabs/Tabs.d.ts +13 -0
  119. package/dist/components/NewTabs/index.d.ts +3 -0
  120. package/dist/components/ResponsiveContextDropdown/ResponsiveContextDropdown.d.ts +13 -0
  121. package/dist/components/ResponsiveContextDropdown/components/ResponsiveContextDropdownItem/ResponsiveContextDropdownItem.d.ts +22 -0
  122. package/dist/components/ResponsiveContextDropdown/components/index.d.ts +1 -0
  123. package/dist/components/ResponsiveContextDropdown/index.d.ts +2 -0
  124. package/dist/components/ResponsiveContextDropdown/utils/responsiveContextDropdownUtils.d.ts +5 -0
  125. package/dist/components/Tabs/Tabs.d.ts +9 -0
  126. package/dist/components/Tabs/comps/Tab/Tab.d.ts +7 -0
  127. package/dist/components/Tabs/comps/index.d.ts +1 -0
  128. package/dist/components/Tabs/index.d.ts +2 -0
  129. package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +25 -0
  130. package/dist/components/Tooltip/SimpleTooltip/SimpleTooltip.d.ts +9 -0
  131. package/dist/components/Tooltip/index.d.ts +2 -0
  132. package/dist/components/UserAvatar/AvatarIcon/AvatarIcon.d.ts +7 -0
  133. package/dist/components/UserAvatar/index.d.ts +1 -0
  134. package/dist/components/common/Alert/Alert.d.ts +8 -0
  135. package/dist/components/common/AlertItem/AlertItem.d.ts +8 -0
  136. package/dist/components/common/ApiFileDownloadButton/ApiFileDownloadButton.d.ts +9 -0
  137. package/dist/components/common/AppSearch/AppSearch.d.ts +9 -0
  138. package/dist/components/common/AppSearch/comps/AutocompleteWindow/AutocompleteWindow.d.ts +12 -0
  139. package/dist/components/common/AppSearch/comps/TypeSelector/TypeSelector.d.ts +10 -0
  140. package/dist/components/common/AppSearch/comps/index.d.ts +2 -0
  141. package/dist/components/common/AppSearch/hooks/useSearchItems.d.ts +7 -0
  142. package/dist/components/common/AuthTemplate/AuthTemplate.d.ts +7 -0
  143. package/dist/components/common/Backdrop/Backdrop.d.ts +6 -0
  144. package/dist/components/common/Badge/Badge.d.ts +9 -0
  145. package/dist/components/common/BarChart/BarChart.d.ts +14 -0
  146. package/dist/components/common/Card/Card.d.ts +28 -0
  147. package/dist/components/common/Collapse/Collapse.d.ts +19 -0
  148. package/dist/components/common/ConfirmDialog/ConfirmDialog.d.ts +2 -0
  149. package/dist/components/common/DisabledRowLabelLink/DisabledRowLabelLink.d.ts +9 -0
  150. package/dist/components/common/DynamicForm/DynamicForm.d.ts +24 -0
  151. package/dist/components/common/DynamicForm/comps/DynamicFormErrors/DynamicFormErrors.d.ts +9 -0
  152. package/dist/components/common/DynamicForm/comps/DynamicFormMasterPicker/DynamicFormMasterPicker.d.ts +10 -0
  153. package/dist/components/common/DynamicForm/comps/DynamicFormTable/DynamicFormTable.d.ts +17 -0
  154. package/dist/components/common/DynamicForm/comps/DynamicFormTable/comps/DynamicFormCreateTableRow/DynamicFormCreateTableRow.d.ts +9 -0
  155. package/dist/components/common/DynamicForm/comps/DynamicFormTable/comps/DynamicFormTableRow/DynamicFormTableRow.d.ts +11 -0
  156. package/dist/components/common/DynamicForm/comps/DynamicFormTable/comps/comps/DynamicFormInput/DynamicFormInput.d.ts +17 -0
  157. package/dist/components/common/DynamicForm/comps/DynamicFormTable/comps/comps/index.d.ts +1 -0
  158. package/dist/components/common/DynamicForm/comps/DynamicFormTable/comps/index.d.ts +2 -0
  159. package/dist/components/common/DynamicForm/comps/index.d.ts +3 -0
  160. package/dist/components/common/DynamicForm/utils/itemTransformers.d.ts +4 -0
  161. package/dist/components/common/EmployeeSmallPhoto/EmployeeSmallPhoto.d.ts +9 -0
  162. package/dist/components/common/ErrorBoundary/ErrorBoundary.d.ts +10 -0
  163. package/dist/components/common/FloatingActionContainer/FloatingActionContainer.d.ts +6 -0
  164. package/dist/components/common/FromToDatePicker/FromToDatePicker.d.ts +11 -0
  165. package/dist/components/common/FromToDatePicker/components/FromToDatePickerDropdownToggle/FromToDatePickerDropdownToggle.d.ts +8 -0
  166. package/dist/components/common/FromToDatePicker/components/index.d.ts +1 -0
  167. package/dist/components/common/FromToDatePicker/constants/TimeRanges.d.ts +3 -0
  168. package/dist/components/common/FromToDatePicker/hooks/useFromToDatePicker.d.ts +10 -0
  169. package/dist/components/common/FromToDatePicker/utils/utilsFromToDatePicker.d.ts +11 -0
  170. package/dist/components/common/HomeDashboard/HomeDashboard.d.ts +10 -0
  171. package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +9 -0
  172. package/dist/components/common/HomeDashboard/comps/WidgetPicker/WidgetPicker.d.ts +11 -0
  173. package/dist/components/common/HomeDashboard/comps/index.d.ts +1 -0
  174. package/dist/components/common/HomeDashboard/hooks/useUserDashboard.d.ts +7 -0
  175. package/dist/components/common/ImgApi/ImgApi.d.ts +4 -0
  176. package/dist/components/common/ImgApi/hooks/useGetImgData.d.ts +9 -0
  177. package/dist/components/common/ImgDirect/ImgDirect.d.ts +4 -0
  178. package/dist/components/common/InvalidFeedback/InvalidFeedback.d.ts +5 -0
  179. package/dist/components/common/LanguageSwitch/LanguageSwitch.d.ts +2 -0
  180. package/dist/components/common/Loading/Loading.d.ts +2 -0
  181. package/dist/components/common/Loading/LoadingBlock.d.ts +5 -0
  182. package/dist/components/common/MonthPicker/MonthPicker.d.ts +11 -0
  183. package/dist/components/common/MonthPickerSearchParams/MonthPickerSearchParams.d.ts +8 -0
  184. package/dist/components/common/NumericFormat/NumericFormat.d.ts +9 -0
  185. package/dist/components/common/PhotoLibrary/PhotoLibrary.d.ts +14 -0
  186. package/dist/components/common/PhotoLightbox/PhotoLightbox.d.ts +18 -0
  187. package/dist/components/common/PieChart/PieChart.d.ts +12 -0
  188. package/dist/components/common/PromptDialog/PromptDialog.d.ts +2 -0
  189. package/dist/components/common/SearchBox/SearchBox.d.ts +8 -0
  190. package/dist/components/common/SettingsFormPicker/SettingsFormPicker.d.ts +19 -0
  191. package/dist/components/common/SimplePicker/SimplePicker.d.ts +26 -0
  192. package/dist/components/common/Timeline/Timeline.d.ts +7 -0
  193. package/dist/components/common/TypedFormGroup/TypedFormGroup.d.ts +9 -0
  194. package/dist/components/common/Typography/Typography.d.ts +8 -0
  195. package/dist/components/common/VersionInfo/VersionInfo.d.ts +5 -0
  196. package/dist/components/common/Widget/WidgetCard.d.ts +9 -0
  197. package/dist/components/common/Widget/WidgetWrapper.d.ts +8 -0
  198. package/dist/components/common/YearPicker/YearPicker.d.ts +9 -0
  199. package/dist/components/common/YearPickerSearchParams/YearPickerSearchParams.d.ts +9 -0
  200. package/dist/components/common/index.d.ts +41 -0
  201. package/dist/contexts/auth/AuthContext.d.ts +9 -0
  202. package/dist/contexts/auth/AuthProvider.d.ts +16 -0
  203. package/dist/contexts/confirm/ConfirmContext.d.ts +8 -0
  204. package/dist/contexts/confirm/ConfirmProvider.d.ts +5 -0
  205. package/dist/contexts/delegation/DelegationContext.d.ts +24 -0
  206. package/dist/contexts/delegation/DelegationProvider.d.ts +6 -0
  207. package/dist/contexts/index.d.ts +12 -0
  208. package/dist/contexts/loading/LoadingContext.d.ts +7 -0
  209. package/dist/contexts/loading/LoadingProvider.d.ts +5 -0
  210. package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +22 -0
  211. package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +18 -0
  212. package/dist/contexts/prompt/PromptContext.d.ts +13 -0
  213. package/dist/contexts/prompt/PromptProvider.d.ts +7 -0
  214. package/dist/contexts/user/UserContext.d.ts +11 -0
  215. package/dist/contexts/user/UserProvider.d.ts +5 -0
  216. package/dist/contexts.cjs.js +1 -0
  217. package/dist/contexts.d.ts +1 -0
  218. package/dist/contexts.es.js +280 -0
  219. package/dist/hooks/index.d.ts +17 -0
  220. package/dist/hooks/useAuth/hooks/useDevAuth.d.ts +7 -0
  221. package/dist/hooks/useAuth/hooks/useMsalAuth.d.ts +8 -0
  222. package/dist/hooks/useAuth/useAuth.d.ts +8 -0
  223. package/dist/hooks/useAxios/useAxios.d.ts +12 -0
  224. package/dist/hooks/useClickOutside/useClickOutside.d.ts +4 -0
  225. package/dist/hooks/useClipboard/useClipboard.d.ts +4 -0
  226. package/dist/hooks/useConfirm/useConfirm.d.ts +8 -0
  227. package/dist/hooks/useEmployeePhotoPath/useEmployeePhotoPath.d.ts +5 -0
  228. package/dist/hooks/useFormControlType/useFormControlType.d.ts +2 -0
  229. package/dist/hooks/useGetApiData/useGetApiData.d.ts +9 -0
  230. package/dist/hooks/useGetDataBound/useGetDataBound.d.ts +4 -0
  231. package/dist/hooks/useKeyPress/useKeyPress.d.ts +2 -0
  232. package/dist/hooks/useLocalStorageState/useLocalStorageState.d.ts +2 -0
  233. package/dist/hooks/useNotifications/useNotifications.d.ts +4 -0
  234. package/dist/hooks/usePermissions/usePermissions.d.ts +4 -0
  235. package/dist/hooks/usePrompt/usePrompt.d.ts +9 -0
  236. package/dist/hooks/useSearchQuery/useSearchQuery.d.ts +5 -0
  237. package/dist/hooks/useSearchQueryState/useSearchQueryState.d.ts +15 -0
  238. package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +75 -0
  239. package/dist/hooks.cjs.js +1 -0
  240. package/dist/hooks.d.ts +1 -0
  241. package/dist/hooks.es.js +60 -0
  242. package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +4 -0
  243. package/dist/layout/MainContainer/MainContainer.d.ts +4 -0
  244. package/dist/layout/PageTitle/PageTitle.d.ts +7 -0
  245. package/dist/layout/SideContentBar/SideContentBar.d.ts +8 -0
  246. package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +11 -0
  247. package/dist/layout/SideMenu/SideMenu.d.ts +12 -0
  248. package/dist/layout/TopBar/TopBar.d.ts +8 -0
  249. package/dist/layout/index.d.ts +5 -0
  250. package/dist/layout.cjs.js +1 -0
  251. package/dist/layout.d.ts +1 -0
  252. package/dist/layout.es.js +124 -0
  253. package/dist/main.cjs.js +9 -0
  254. package/dist/main.d.ts +49 -0
  255. package/dist/main.es.js +3976 -0
  256. package/dist/models/api/documents/DocType.d.ts +6 -0
  257. package/dist/models/api/documents/DocumentFileModel.d.ts +18 -0
  258. package/dist/models/api/documents/DocumentFolderModel.d.ts +9 -0
  259. package/dist/models/api/documents/DocumentListModel.d.ts +8 -0
  260. package/dist/models/api/documents/DocumentUploadModel.d.ts +6 -0
  261. package/dist/models/api/documents/DocumentsCreateFolderModel.d.ts +8 -0
  262. package/dist/models/index.d.ts +83 -0
  263. package/dist/models/luminus-context-types/CommonLuminusIcons.d.ts +2 -0
  264. package/dist/models/luminus-context-types/ILocalizationContext.d.ts +8 -0
  265. package/dist/models/prop-types/ContainerProps.d.ts +11 -0
  266. package/dist/models/prop-types/DashboardWidgetCommonProps.d.ts +6 -0
  267. package/dist/models/prop-types/FormInputProps/FormCheckInputProps.d.ts +8 -0
  268. package/dist/models/prop-types/FormInputProps/FormFileInputProps.d.ts +12 -0
  269. package/dist/models/prop-types/FormInputProps/FormNumericStepperInputProps.d.ts +9 -0
  270. package/dist/models/prop-types/FormInputProps/FormNumericTextInputProps.d.ts +8 -0
  271. package/dist/models/prop-types/FormInputProps/FormRadioInputProps.d.ts +7 -0
  272. package/dist/models/prop-types/FormInputProps/FormSelectInputProps.d.ts +8 -0
  273. package/dist/models/prop-types/FormInputProps/FormTextAreaInputProps.d.ts +8 -0
  274. package/dist/models/prop-types/FormInputProps/FormTextInputProps.d.ts +8 -0
  275. package/dist/models/prop-types/HookFormInputProps/HookFormCheckInputProps.d.ts +5 -0
  276. package/dist/models/prop-types/HookFormInputProps/HookFormDropdownPickerProps.d.ts +5 -0
  277. package/dist/models/prop-types/HookFormInputProps/HookFormFileInputProps.d.ts +5 -0
  278. package/dist/models/prop-types/HookFormInputProps/HookFormInputBaseProps.d.ts +8 -0
  279. package/dist/models/prop-types/HookFormInputProps/HookFormInputProps.d.ts +10 -0
  280. package/dist/models/prop-types/HookFormInputProps/HookFormNumericStepperInputProps.d.ts +5 -0
  281. package/dist/models/prop-types/HookFormInputProps/HookFormNumericTextInputProps.d.ts +5 -0
  282. package/dist/models/prop-types/HookFormInputProps/HookFormRadioInputProps.d.ts +5 -0
  283. package/dist/models/prop-types/HookFormInputProps/HookFormSelectInputProps.d.ts +5 -0
  284. package/dist/models/prop-types/HookFormInputProps/HookFormTextAreaInputProps.d.ts +8 -0
  285. package/dist/models/prop-types/HookFormInputProps/HookFormTextInputProps.d.ts +5 -0
  286. package/dist/models/prop-types/ImgProps.d.ts +8 -0
  287. package/dist/models/prop-types/InputContainerProps.d.ts +25 -0
  288. package/dist/models/prop-types/InputProps/CheckInputProps.d.ts +6 -0
  289. package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +24 -0
  290. package/dist/models/prop-types/InputProps/FileInputProps.d.ts +7 -0
  291. package/dist/models/prop-types/InputProps/InputBaseProps.d.ts +16 -0
  292. package/dist/models/prop-types/InputProps/NumericInputProps.d.ts +14 -0
  293. package/dist/models/prop-types/InputProps/RadioInputProps.d.ts +7 -0
  294. package/dist/models/prop-types/InputProps/SelectInputProps.d.ts +11 -0
  295. package/dist/models/prop-types/InputProps/TextAreaInputProps.d.ts +6 -0
  296. package/dist/models/prop-types/InputProps/TextInputProps.d.ts +10 -0
  297. package/dist/models/texts/AppSearchTexts.d.ts +5 -0
  298. package/dist/models/texts/AxiosTexts.d.ts +8 -0
  299. package/dist/models/texts/ClipboardTexts.d.ts +5 -0
  300. package/dist/models/texts/ComponentsContextTexts.d.ts +34 -0
  301. package/dist/models/texts/ConfirmTexts.d.ts +7 -0
  302. package/dist/models/texts/CustomSelectTexts.d.ts +5 -0
  303. package/dist/models/texts/DateTexts.d.ts +8 -0
  304. package/dist/models/texts/DocumentsTexts.d.ts +45 -0
  305. package/dist/models/texts/DropdownPickerTexts.d.ts +5 -0
  306. package/dist/models/texts/DynamicFormsTexts.d.ts +13 -0
  307. package/dist/models/texts/ErrorBoundaryTexts.d.ts +6 -0
  308. package/dist/models/texts/FormSubmitTexts.d.ts +4 -0
  309. package/dist/models/texts/FormValidationTexts.d.ts +7 -0
  310. package/dist/models/texts/HomeDashboardTexts.d.ts +6 -0
  311. package/dist/models/texts/MessageBoardTexts.d.ts +4 -0
  312. package/dist/models/texts/ReportsTexts.d.ts +30 -0
  313. package/dist/models/texts/WidgetTexts.d.ts +4 -0
  314. package/dist/models/types/ApiErrorResult.d.ts +9 -0
  315. package/dist/models/types/BaseMessageBoardModel.d.ts +8 -0
  316. package/dist/models/types/DashboardConfig.d.ts +6 -0
  317. package/dist/models/types/DashboardWidget.d.ts +10 -0
  318. package/dist/models/types/DashboardWidgetConfig.d.ts +5 -0
  319. package/dist/models/types/DropdownPickerOption.d.ts +8 -0
  320. package/dist/models/types/EmployeeIndexModel.d.ts +14 -0
  321. package/dist/models/types/ErrorField.d.ts +5 -0
  322. package/dist/models/types/FormSelectOption.d.ts +5 -0
  323. package/dist/models/types/FromTo.d.ts +5 -0
  324. package/dist/models/types/HookFormInputProps.d.ts +10 -0
  325. package/dist/models/types/LoginState.d.ts +7 -0
  326. package/dist/models/types/MenuItemType.d.ts +10 -0
  327. package/dist/models/types/MenuItemTypeExtended.d.ts +7 -0
  328. package/dist/models/types/NameIdIntModel.d.ts +5 -0
  329. package/dist/models/types/NameIdIntOptionalModel.d.ts +5 -0
  330. package/dist/models/types/NameIdStringModel.d.ts +5 -0
  331. package/dist/models/types/NameIdStringOptionalModel.d.ts +5 -0
  332. package/dist/models/types/PhotoAction.d.ts +8 -0
  333. package/dist/models/types/PhotoLibraryItemModel.d.ts +7 -0
  334. package/dist/models/types/PromptOptions.d.ts +7 -0
  335. package/dist/models/types/SaveFileFromResponseOptions.d.ts +6 -0
  336. package/dist/models/types/SearchResultGroupKeyModel.d.ts +6 -0
  337. package/dist/models/types/SearchResultGroupModel.d.ts +8 -0
  338. package/dist/models/types/SearchResultModel.d.ts +9 -0
  339. package/dist/models/types/SearchType.d.ts +6 -0
  340. package/dist/models/types/TimelineStep.d.ts +11 -0
  341. package/dist/models/types/TimelineStepState.d.ts +5 -0
  342. package/dist/models/types/ToLiteral.d.ts +5 -0
  343. package/dist/models/types/UseGetApiDataOptions.d.ts +11 -0
  344. package/dist/models/types/UseGetDataBoundOptions.d.ts +5 -0
  345. package/dist/models/types/UserLoginState.d.ts +8 -0
  346. package/dist/models/types/UserModel.d.ts +12 -0
  347. package/dist/models/types/common/NullsOptional.d.ts +12 -0
  348. package/dist/models/types/common/RequireAtLeastOne.d.ts +4 -0
  349. package/dist/models/types/common/SharedProperties.d.ts +33 -0
  350. package/dist/models/types/dynamicForms/formPickerTypes/SettingsFormGroup.d.ts +8 -0
  351. package/dist/models/types/dynamicForms/formPickerTypes/SettingsFormItem.d.ts +8 -0
  352. package/dist/models/types/dynamicForms/index.d.ts +8 -0
  353. package/dist/models/types/dynamicForms/types/DynamicFormColumnDef.d.ts +12 -0
  354. package/dist/models/types/dynamicForms/types/DynamicFormColumnSchemaModel.d.ts +13 -0
  355. package/dist/models/types/dynamicForms/types/DynamicFormColumnValueSchemaModel.d.ts +5 -0
  356. package/dist/models/types/dynamicForms/types/DynamicFormFilters.d.ts +4 -0
  357. package/dist/models/types/dynamicForms/types/DynamicFormIndexModel.d.ts +7 -0
  358. package/dist/models/types/dynamicForms/types/DynamicFormSchemaModel.d.ts +16 -0
  359. package/dist/models/types/dynamicForms/types/DynamicFormValueTypes.d.ts +12 -0
  360. package/dist/searchUtils-DuVe5YHX.js +14 -0
  361. package/dist/searchUtils-GR6YgdCs.cjs +1 -0
  362. package/dist/style.css +1 -0
  363. package/dist/useClipboard-BdDtrG_v.cjs +1 -0
  364. package/dist/useClipboard-Cn05DXm8.js +70 -0
  365. package/dist/useGetApiData-BhzRnuk9.js +52 -0
  366. package/dist/useGetApiData-DFCqg0Qo.cjs +1 -0
  367. package/dist/useLocalStorageState-BFc8Gc8H.cjs +1 -0
  368. package/dist/useLocalStorageState-Bt99kkCr.js +17 -0
  369. package/dist/usePermissions-DpgiUP05.js +20 -0
  370. package/dist/usePermissions-MVy72H28.cjs +1 -0
  371. package/dist/utils/apiErrorFields/apiErrorFieldsUtils.d.ts +5 -0
  372. package/dist/utils/bnfValueFormat/bnfValueFormat.d.ts +7 -0
  373. package/dist/utils/color/colorUtils.d.ts +2 -0
  374. package/dist/utils/date/dateUtils.d.ts +47 -0
  375. package/dist/utils/file/fileUtils.d.ts +9 -0
  376. package/dist/utils/hookForm/hookFormUtils.d.ts +4 -0
  377. package/dist/utils/index.d.ts +11 -0
  378. package/dist/utils/number/numberUtils.d.ts +1 -0
  379. package/dist/utils/object/objectUtils.d.ts +6 -0
  380. package/dist/utils/search/searchUtils.d.ts +5 -0
  381. package/dist/utils/text/string.d.ts +18 -0
  382. package/dist/utils/text/textUtils.d.ts +11 -0
  383. package/dist/utils.cjs.js +1 -0
  384. package/dist/utils.d.ts +1 -0
  385. package/dist/utils.es.js +83 -0
  386. package/dist/variables.scss +171 -171
  387. package/package.json +115 -115
@@ -0,0 +1,3976 @@
1
+ import { j as r, c as w, t as ve, a as pt, s as _n, g as Nn, m as ya, d as _t, b as ba, e as wa, f as Le, h as _a, i as Na, k as Ca, l as Sa, n as ka, o as Ia, p as Da, T as sr, q as or, r as Cn, E as $a, u as ir, v as an, w as lr, x as Fa, y as ue, z as $t, A as Oa, B as cr, C as Ft, D as Ea, F as Qt, G as dr, H as Ta, S as Zt, N as ur, I as sn, J as on, K as La, L as Ra, M as Aa, O as Ma, P as Va, Q as fr, R as Ba, U as Pa, V as Ha, W as Wa, X as za, Y as Ua, Z as Ga, _ as Ya, $ as Jt, a0 as Ka, a1 as Mt, a2 as J, a3 as ge, a4 as Xt, a5 as qa, a6 as Qa, a7 as Za, a8 as mr, a9 as xt, aa as re, ab as ln, ac as ye, ad as cn, ae as Ve, af as Ja, ag as ot, ah as hr, ai as Xa, aj as gr, ak as es, al as ts, am as ns, an as dn, ao as un, ap as pr, aq as Qe, ar as rs, as as Je, at as as, au as St, av as xr, aw as Oe, ax as ss, ay as os, az as is, aA as Ot, aB as ls, aC as vr, aD as cs, aE as Xe, aF as ds, aG as jr, aH as yr, aI as br, aJ as Be, aK as us, aL as fs, aM as Fe, aN as ms, aO as vt, aP as hs, aQ as Et, aR as wr, aS as Tt, aT as Vt, aU as Pe, aV as Sn, aW as gs, aX as ps, aY as et, aZ as xs, a_ as vs, a$ as js, b0 as ys, b1 as bs } from "./ResponsiveContextDropdown-D7dyws1-.js";
2
+ import { b5 as Hd, b6 as Wd, b3 as zd, b2 as Ud, b7 as Gd, b8 as Yd, b4 as Kd } from "./ResponsiveContextDropdown-D7dyws1-.js";
3
+ import * as oe from "react";
4
+ import Ce, { useCallback as S, useMemo as ne, useContext as q, useRef as te, useEffect as M, useState as E, useId as ws, Component as _s, isValidElement as Ns, Suspense as Cs, useReducer as Ss, useLayoutEffect as ks } from "react";
5
+ import { c as Re, L as kn } from "./Loading-BDj5dLz0.js";
6
+ import { InteractionType as Is } from "@azure/msal-browser";
7
+ import { MsalAuthenticationTemplate as Ds } from "@azure/msal-react";
8
+ import { Link as Ze, Navigate as wt, generatePath as kt, useNavigate as $s, useParams as Fs } from "react-router-dom";
9
+ import { useFormContext as He, Controller as fn } from "react-hook-form";
10
+ import { Pivot as Os } from "react-flexmonster";
11
+ import { S as mn } from "./SimpleTooltip-BLerwS-Y.js";
12
+ import { u as Es, a as _r, b as Nr, c as Ts, d as Ls, e as Rs } from "./useClipboard-Cn05DXm8.js";
13
+ import It from "react-dom";
14
+ import { l as ht, s as en } from "./searchUtils-DuVe5YHX.js";
15
+ import { u as As } from "./useGetApiData-BhzRnuk9.js";
16
+ import { F as Ms } from "./FullScreenContainer-DalqTwrK.js";
17
+ const Jc = ({ fileLoader: e, fileName: t, children: n }) => {
18
+ const a = S(async () => {
19
+ var c, l;
20
+ const s = await e();
21
+ if (!s)
22
+ return;
23
+ const o = window.URL.createObjectURL(new Blob([s])), i = document.createElement("a");
24
+ i.href = o, i.setAttribute("download", t), (c = document.body) == null || c.appendChild(i), i.click(), (l = document.body) == null || l.removeChild(i);
25
+ }, [e, t]);
26
+ return /* @__PURE__ */ r.jsx("div", { role: "button", onClick: a, children: n });
27
+ }, Vs = ({ className: e, ...t }) => /* @__PURE__ */ r.jsxs("div", { className: w("luminus-loading", Re.loading, Re.loadingBlock, Re.loadingBlock), ...t, children: [
28
+ /* @__PURE__ */ r.jsx("div", { className: w("spinner-grow", Re.spinnerGrow, "text-primary"), role: "status" }),
29
+ /* @__PURE__ */ r.jsx("div", { className: w("spinner-grow", Re.spinnerGrow, "text-primary", Re.second), role: "status" }),
30
+ /* @__PURE__ */ r.jsx("div", { className: w("spinner-grow", Re.spinnerGrow, "text-primary", Re.third), role: "status" })
31
+ ] });
32
+ function Cr(e, t) {
33
+ const n = ve(e);
34
+ if (isNaN(t)) return pt(e, NaN);
35
+ if (!t)
36
+ return n;
37
+ const a = n.getDate(), s = pt(e, n.getTime());
38
+ s.setMonth(n.getMonth() + t + 1, 0);
39
+ const o = s.getDate();
40
+ return a >= o ? s : (n.setFullYear(
41
+ s.getFullYear(),
42
+ s.getMonth(),
43
+ a
44
+ ), n);
45
+ }
46
+ function Bs(e, t) {
47
+ return Cr(e, t * 12);
48
+ }
49
+ function Ps(e, t) {
50
+ const n = ve(e), a = ve(t), s = n.getTime() - a.getTime();
51
+ return s < 0 ? -1 : s > 0 ? 1 : s;
52
+ }
53
+ function In(e, t) {
54
+ const n = ve(e), a = ve(t), s = n.getFullYear() - a.getFullYear(), o = n.getMonth() - a.getMonth();
55
+ return s * 12 + o;
56
+ }
57
+ function Dn(e) {
58
+ const t = ve(e);
59
+ return Math.trunc(t.getMonth() / 3) + 1;
60
+ }
61
+ function Bt(e, t) {
62
+ const n = ve(e), a = ve(t), s = n.getFullYear() - a.getFullYear(), o = Dn(n) - Dn(a);
63
+ return s * 4 + o;
64
+ }
65
+ function $n(e, t, n) {
66
+ const a = _n(e, n), s = _n(t, n), o = +a - Nn(a), i = +s - Nn(s);
67
+ return Math.round((o - i) / ya);
68
+ }
69
+ function Pt(e, t) {
70
+ const n = ve(e), a = ve(t);
71
+ return n.getFullYear() - a.getFullYear();
72
+ }
73
+ function Hs(e, t) {
74
+ const n = ve(e), a = ve(t), s = Fn(n, a), o = Math.abs(_t(n, a));
75
+ n.setDate(n.getDate() - s * o);
76
+ const i = +(Fn(n, a) === -s), c = s * (o - i);
77
+ return c === 0 ? 0 : c;
78
+ }
79
+ function Fn(e, t) {
80
+ const n = e.getFullYear() - t.getFullYear() || e.getMonth() - t.getMonth() || e.getDate() - t.getDate() || e.getHours() - t.getHours() || e.getMinutes() - t.getMinutes() || e.getSeconds() - t.getSeconds() || e.getMilliseconds() - t.getMilliseconds();
81
+ return n < 0 ? -1 : n > 0 ? 1 : n;
82
+ }
83
+ function hn(e) {
84
+ return (t) => {
85
+ const a = (e ? Math[e] : Math.trunc)(t);
86
+ return a === 0 ? 0 : a;
87
+ };
88
+ }
89
+ function gn(e, t) {
90
+ return +ve(e) - +ve(t);
91
+ }
92
+ function On(e, t, n) {
93
+ const a = gn(e, t) / ba;
94
+ return hn(n == null ? void 0 : n.roundingMethod)(a);
95
+ }
96
+ function En(e, t, n) {
97
+ const a = gn(e, t) / wa;
98
+ return hn(n == null ? void 0 : n.roundingMethod)(a);
99
+ }
100
+ function Ht(e, t, n) {
101
+ const a = gn(e, t) / 1e3;
102
+ return hn(n == null ? void 0 : n.roundingMethod)(a);
103
+ }
104
+ function tn(e, t) {
105
+ const n = ve(e);
106
+ if (isNaN(n.getTime()))
107
+ throw new RangeError("Invalid time value");
108
+ const a = (t == null ? void 0 : t.format) ?? "extended", s = (t == null ? void 0 : t.representation) ?? "complete";
109
+ let o = "", i = "";
110
+ const c = a === "extended" ? "-" : "", l = a === "extended" ? ":" : "";
111
+ if (s !== "time") {
112
+ const u = Le(n.getDate(), 2), d = Le(n.getMonth() + 1, 2);
113
+ o = `${Le(n.getFullYear(), 4)}${c}${d}${c}${u}`;
114
+ }
115
+ if (s !== "date") {
116
+ const u = n.getTimezoneOffset();
117
+ if (u !== 0) {
118
+ const p = Math.abs(u), g = Le(Math.trunc(p / 60), 2), j = Le(p % 60, 2);
119
+ i = `${u < 0 ? "+" : "-"}${g}:${j}`;
120
+ } else
121
+ i = "Z";
122
+ const d = Le(n.getHours(), 2), m = Le(n.getMinutes(), 2), x = Le(n.getSeconds(), 2), v = o === "" ? "" : "T", h = [d, m, x].join(l);
123
+ o = `${o}${v}${h}${i}`;
124
+ }
125
+ return o;
126
+ }
127
+ function Ws(e) {
128
+ const t = ve(e), n = t.getFullYear(), a = t.getMonth(), s = pt(e, 0);
129
+ return s.setFullYear(n, a + 1, 0), s.setHours(0, 0, 0, 0), s.getDate();
130
+ }
131
+ function zs(e, t, n) {
132
+ let a = 0, s;
133
+ const o = ve(e), i = ve(t);
134
+ if (n != null && n.unit)
135
+ s = n == null ? void 0 : n.unit, s === "second" ? a = Ht(o, i) : s === "minute" ? a = En(o, i) : s === "hour" ? a = On(o, i) : s === "day" ? a = _t(o, i) : s === "week" ? a = $n(o, i) : s === "month" ? a = In(o, i) : s === "quarter" ? a = Bt(o, i) : s === "year" && (a = Pt(o, i));
136
+ else {
137
+ const l = Ht(o, i);
138
+ Math.abs(l) < _a ? (a = Ht(o, i), s = "second") : Math.abs(l) < Na ? (a = En(o, i), s = "minute") : Math.abs(l) < Ca && Math.abs(_t(o, i)) < 1 ? (a = On(o, i), s = "hour") : Math.abs(l) < Sa && (a = _t(o, i)) && Math.abs(a) < 7 ? s = "day" : Math.abs(l) < ka ? (a = $n(o, i), s = "week") : Math.abs(l) < Ia ? (a = In(o, i), s = "month") : Math.abs(l) < Da && Bt(o, i) < 4 ? (a = Bt(o, i), s = "quarter") : (a = Pt(o, i), s = "year");
139
+ }
140
+ return new Intl.RelativeTimeFormat(n == null ? void 0 : n.locale, {
141
+ localeMatcher: n == null ? void 0 : n.localeMatcher,
142
+ numeric: (n == null ? void 0 : n.numeric) || "auto",
143
+ style: n == null ? void 0 : n.style
144
+ }).format(a, s);
145
+ }
146
+ function Us(e, t) {
147
+ const n = ve(e), a = n.getFullYear(), s = n.getDate(), o = pt(e, 0);
148
+ o.setFullYear(a, t, 15), o.setHours(0, 0, 0, 0);
149
+ const i = Ws(o);
150
+ return n.setMonth(t, Math.min(s, i)), n;
151
+ }
152
+ function Sr(e, t) {
153
+ const n = ve(e);
154
+ return isNaN(+n) ? pt(e, NaN) : (n.setFullYear(t), n);
155
+ }
156
+ function mt(...e) {
157
+ return e.filter((t) => t != null).reduce((t, n) => {
158
+ if (typeof n != "function")
159
+ throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");
160
+ return t === null ? n : function(...s) {
161
+ t.apply(this, s), n.apply(this, s);
162
+ };
163
+ }, null);
164
+ }
165
+ const Gs = {
166
+ height: ["marginTop", "marginBottom"],
167
+ width: ["marginLeft", "marginRight"]
168
+ };
169
+ function Ys(e, t) {
170
+ const n = `offset${e[0].toUpperCase()}${e.slice(1)}`, a = t[n], s = Gs[e];
171
+ return a + // @ts-ignore
172
+ parseInt(Cn(t, s[0]), 10) + // @ts-ignore
173
+ parseInt(Cn(t, s[1]), 10);
174
+ }
175
+ const Ks = {
176
+ [$a]: "collapse",
177
+ [ir]: "collapsing",
178
+ [an]: "collapsing",
179
+ [lr]: "collapse show"
180
+ }, kr = /* @__PURE__ */ Ce.forwardRef(({
181
+ onEnter: e,
182
+ onEntering: t,
183
+ onEntered: n,
184
+ onExit: a,
185
+ onExiting: s,
186
+ className: o,
187
+ children: i,
188
+ dimension: c = "height",
189
+ in: l = !1,
190
+ timeout: u = 300,
191
+ mountOnEnter: d = !1,
192
+ unmountOnExit: m = !1,
193
+ appear: x = !1,
194
+ getDimensionValue: v = Ys,
195
+ ...h
196
+ }, p) => {
197
+ const g = typeof c == "function" ? c() : c, j = ne(() => mt((k) => {
198
+ k.style[g] = "0";
199
+ }, e), [g, e]), b = ne(() => mt((k) => {
200
+ const I = `scroll${g[0].toUpperCase()}${g.slice(1)}`;
201
+ k.style[g] = `${k[I]}px`;
202
+ }, t), [g, t]), f = ne(() => mt((k) => {
203
+ k.style[g] = null;
204
+ }, n), [g, n]), y = ne(() => mt((k) => {
205
+ k.style[g] = `${v(g, k)}px`, Fa(k);
206
+ }, a), [a, v, g]), N = ne(() => mt((k) => {
207
+ k.style[g] = null;
208
+ }, s), [g, s]);
209
+ return /* @__PURE__ */ r.jsx(sr, {
210
+ ref: p,
211
+ addEndListener: or,
212
+ ...h,
213
+ "aria-expanded": h.role ? l : null,
214
+ onEnter: j,
215
+ onEntering: b,
216
+ onEntered: f,
217
+ onExit: y,
218
+ onExiting: N,
219
+ childRef: i.ref,
220
+ in: l,
221
+ timeout: u,
222
+ mountOnEnter: d,
223
+ unmountOnExit: m,
224
+ appear: x,
225
+ children: (k, I) => /* @__PURE__ */ Ce.cloneElement(i, {
226
+ ...I,
227
+ className: w(o, i.props.className, Ks[k], g === "width" && "collapse-horizontal")
228
+ })
229
+ });
230
+ }), Ir = $t("h4");
231
+ Ir.displayName = "DivStyledAsH4";
232
+ const Dr = /* @__PURE__ */ oe.forwardRef(({
233
+ className: e,
234
+ bsPrefix: t,
235
+ as: n = Ir,
236
+ ...a
237
+ }, s) => (t = ue(t, "alert-heading"), /* @__PURE__ */ r.jsx(n, {
238
+ ref: s,
239
+ className: w(e, t),
240
+ ...a
241
+ })));
242
+ Dr.displayName = "AlertHeading";
243
+ const $r = /* @__PURE__ */ oe.forwardRef(({
244
+ className: e,
245
+ bsPrefix: t,
246
+ as: n = Oa,
247
+ ...a
248
+ }, s) => (t = ue(t, "alert-link"), /* @__PURE__ */ r.jsx(n, {
249
+ ref: s,
250
+ className: w(e, t),
251
+ ...a
252
+ })));
253
+ $r.displayName = "AlertLink";
254
+ const Fr = /* @__PURE__ */ oe.forwardRef((e, t) => {
255
+ const {
256
+ bsPrefix: n,
257
+ show: a = !0,
258
+ closeLabel: s = "Close alert",
259
+ closeVariant: o,
260
+ className: i,
261
+ children: c,
262
+ variant: l = "primary",
263
+ onClose: u,
264
+ dismissible: d,
265
+ transition: m = Qt,
266
+ ...x
267
+ } = cr(e, {
268
+ show: "onClose"
269
+ }), v = ue(n, "alert"), h = Ft((j) => {
270
+ u && u(!1, j);
271
+ }), p = m === !0 ? Qt : m, g = /* @__PURE__ */ r.jsxs("div", {
272
+ role: "alert",
273
+ ...p ? void 0 : x,
274
+ ref: t,
275
+ className: w(i, v, l && `${v}-${l}`, d && `${v}-dismissible`),
276
+ children: [d && /* @__PURE__ */ r.jsx(Ea, {
277
+ onClick: h,
278
+ "aria-label": s,
279
+ variant: o
280
+ }), c]
281
+ });
282
+ return p ? /* @__PURE__ */ r.jsx(p, {
283
+ unmountOnExit: !0,
284
+ ...x,
285
+ ref: void 0,
286
+ in: a,
287
+ children: g
288
+ }) : a ? g : null;
289
+ });
290
+ Fr.displayName = "Alert";
291
+ const qs = Object.assign(Fr, {
292
+ Link: $r,
293
+ Heading: Dr
294
+ }), pn = /* @__PURE__ */ oe.forwardRef(({
295
+ className: e,
296
+ bsPrefix: t,
297
+ as: n = "div",
298
+ ...a
299
+ }, s) => (t = ue(t, "card-body"), /* @__PURE__ */ r.jsx(n, {
300
+ ref: s,
301
+ className: w(e, t),
302
+ ...a
303
+ })));
304
+ pn.displayName = "CardBody";
305
+ const Or = /* @__PURE__ */ oe.forwardRef(({
306
+ className: e,
307
+ bsPrefix: t,
308
+ as: n = "div",
309
+ ...a
310
+ }, s) => (t = ue(t, "card-footer"), /* @__PURE__ */ r.jsx(n, {
311
+ ref: s,
312
+ className: w(e, t),
313
+ ...a
314
+ })));
315
+ Or.displayName = "CardFooter";
316
+ const Er = /* @__PURE__ */ oe.createContext(null);
317
+ Er.displayName = "CardHeaderContext";
318
+ const Tr = /* @__PURE__ */ oe.forwardRef(({
319
+ bsPrefix: e,
320
+ className: t,
321
+ // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
322
+ as: n = "div",
323
+ ...a
324
+ }, s) => {
325
+ const o = ue(e, "card-header"), i = ne(() => ({
326
+ cardHeaderBsPrefix: o
327
+ }), [o]);
328
+ return /* @__PURE__ */ r.jsx(Er.Provider, {
329
+ value: i,
330
+ children: /* @__PURE__ */ r.jsx(n, {
331
+ ref: s,
332
+ ...a,
333
+ className: w(t, o)
334
+ })
335
+ });
336
+ });
337
+ Tr.displayName = "CardHeader";
338
+ const Lr = /* @__PURE__ */ oe.forwardRef(
339
+ // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
340
+ ({
341
+ bsPrefix: e,
342
+ className: t,
343
+ variant: n,
344
+ as: a = "img",
345
+ ...s
346
+ }, o) => {
347
+ const i = ue(e, "card-img");
348
+ return /* @__PURE__ */ r.jsx(a, {
349
+ ref: o,
350
+ className: w(n ? `${i}-${n}` : i, t),
351
+ ...s
352
+ });
353
+ }
354
+ );
355
+ Lr.displayName = "CardImg";
356
+ const Rr = /* @__PURE__ */ oe.forwardRef(({
357
+ className: e,
358
+ bsPrefix: t,
359
+ as: n = "div",
360
+ ...a
361
+ }, s) => (t = ue(t, "card-img-overlay"), /* @__PURE__ */ r.jsx(n, {
362
+ ref: s,
363
+ className: w(e, t),
364
+ ...a
365
+ })));
366
+ Rr.displayName = "CardImgOverlay";
367
+ const Ar = /* @__PURE__ */ oe.forwardRef(({
368
+ className: e,
369
+ bsPrefix: t,
370
+ as: n = "a",
371
+ ...a
372
+ }, s) => (t = ue(t, "card-link"), /* @__PURE__ */ r.jsx(n, {
373
+ ref: s,
374
+ className: w(e, t),
375
+ ...a
376
+ })));
377
+ Ar.displayName = "CardLink";
378
+ const Qs = $t("h6"), Mr = /* @__PURE__ */ oe.forwardRef(({
379
+ className: e,
380
+ bsPrefix: t,
381
+ as: n = Qs,
382
+ ...a
383
+ }, s) => (t = ue(t, "card-subtitle"), /* @__PURE__ */ r.jsx(n, {
384
+ ref: s,
385
+ className: w(e, t),
386
+ ...a
387
+ })));
388
+ Mr.displayName = "CardSubtitle";
389
+ const Vr = /* @__PURE__ */ oe.forwardRef(({
390
+ className: e,
391
+ bsPrefix: t,
392
+ as: n = "p",
393
+ ...a
394
+ }, s) => (t = ue(t, "card-text"), /* @__PURE__ */ r.jsx(n, {
395
+ ref: s,
396
+ className: w(e, t),
397
+ ...a
398
+ })));
399
+ Vr.displayName = "CardText";
400
+ const Zs = $t("h5"), Br = /* @__PURE__ */ oe.forwardRef(({
401
+ className: e,
402
+ bsPrefix: t,
403
+ as: n = Zs,
404
+ ...a
405
+ }, s) => (t = ue(t, "card-title"), /* @__PURE__ */ r.jsx(n, {
406
+ ref: s,
407
+ className: w(e, t),
408
+ ...a
409
+ })));
410
+ Br.displayName = "CardTitle";
411
+ const Pr = /* @__PURE__ */ oe.forwardRef(({
412
+ bsPrefix: e,
413
+ className: t,
414
+ bg: n,
415
+ text: a,
416
+ border: s,
417
+ body: o = !1,
418
+ children: i,
419
+ // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
420
+ as: c = "div",
421
+ ...l
422
+ }, u) => {
423
+ const d = ue(e, "card");
424
+ return /* @__PURE__ */ r.jsx(c, {
425
+ ref: u,
426
+ ...l,
427
+ className: w(t, d, n && `bg-${n}`, a && `text-${a}`, s && `border-${s}`),
428
+ children: o ? /* @__PURE__ */ r.jsx(pn, {
429
+ children: i
430
+ }) : i
431
+ });
432
+ });
433
+ Pr.displayName = "Card";
434
+ const Tn = Object.assign(Pr, {
435
+ Img: Lr,
436
+ Title: Br,
437
+ Subtitle: Mr,
438
+ Body: pn,
439
+ Link: Ar,
440
+ Text: Vr,
441
+ Header: Tr,
442
+ Footer: Or,
443
+ ImgOverlay: Rr
444
+ }), Lt = /* @__PURE__ */ oe.forwardRef(({
445
+ className: e,
446
+ bsPrefix: t,
447
+ as: n = "span",
448
+ ...a
449
+ }, s) => (t = ue(t, "input-group-text"), /* @__PURE__ */ r.jsx(n, {
450
+ ref: s,
451
+ className: w(e, t),
452
+ ...a
453
+ })));
454
+ Lt.displayName = "InputGroupText";
455
+ const Js = (e) => /* @__PURE__ */ r.jsx(Lt, {
456
+ children: /* @__PURE__ */ r.jsx(dr, {
457
+ type: "checkbox",
458
+ ...e
459
+ })
460
+ }), Xs = (e) => /* @__PURE__ */ r.jsx(Lt, {
461
+ children: /* @__PURE__ */ r.jsx(dr, {
462
+ type: "radio",
463
+ ...e
464
+ })
465
+ }), Hr = /* @__PURE__ */ oe.forwardRef(({
466
+ bsPrefix: e,
467
+ size: t,
468
+ hasValidation: n,
469
+ className: a,
470
+ // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
471
+ as: s = "div",
472
+ ...o
473
+ }, i) => {
474
+ e = ue(e, "input-group");
475
+ const c = ne(() => ({}), []);
476
+ return /* @__PURE__ */ r.jsx(Ta.Provider, {
477
+ value: c,
478
+ children: /* @__PURE__ */ r.jsx(s, {
479
+ ref: i,
480
+ ...o,
481
+ className: w(a, e, t && `${e}-${t}`, n && "has-validation")
482
+ })
483
+ });
484
+ });
485
+ Hr.displayName = "InputGroup";
486
+ const Nt = Object.assign(Hr, {
487
+ Text: Lt,
488
+ Radio: Xs,
489
+ Checkbox: Js
490
+ }), Wr = /* @__PURE__ */ oe.createContext(null), eo = ["as", "active", "eventKey"];
491
+ function to(e, t) {
492
+ if (e == null) return {};
493
+ var n = {};
494
+ for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
495
+ if (t.indexOf(a) >= 0) continue;
496
+ n[a] = e[a];
497
+ }
498
+ return n;
499
+ }
500
+ function zr({
501
+ key: e,
502
+ onClick: t,
503
+ active: n,
504
+ id: a,
505
+ role: s,
506
+ disabled: o
507
+ }) {
508
+ const i = q(Zt), c = q(ur), l = q(Wr);
509
+ let u = n;
510
+ const d = {
511
+ role: s
512
+ };
513
+ if (c) {
514
+ !s && c.role === "tablist" && (d.role = "tab");
515
+ const m = c.getControllerId(e ?? null), x = c.getControlledId(e ?? null);
516
+ d[sn("event-key")] = e, d.id = m || a, u = n == null && e != null ? c.activeKey === e : n, (u || !(l != null && l.unmountOnExit) && !(l != null && l.mountOnEnter)) && (d["aria-controls"] = x);
517
+ }
518
+ return d.role === "tab" && (d["aria-selected"] = u, u || (d.tabIndex = -1), o && (d.tabIndex = -1, d["aria-disabled"] = !0)), d.onClick = Ft((m) => {
519
+ o || (t == null || t(m), e != null && i && !m.isPropagationStopped() && i(e, m));
520
+ }), [d, {
521
+ isActive: u
522
+ }];
523
+ }
524
+ const Ur = /* @__PURE__ */ oe.forwardRef((e, t) => {
525
+ let {
526
+ as: n = La,
527
+ active: a,
528
+ eventKey: s
529
+ } = e, o = to(e, eo);
530
+ const [i, c] = zr(Object.assign({
531
+ key: on(s, o.href),
532
+ active: a
533
+ }, o));
534
+ return i[sn("active")] = c.isActive, /* @__PURE__ */ r.jsx(n, Object.assign({}, o, i, {
535
+ ref: t
536
+ }));
537
+ });
538
+ Ur.displayName = "NavItem";
539
+ const no = Ur, ro = ["as", "onSelect", "activeKey", "role", "onKeyDown"];
540
+ function ao(e, t) {
541
+ if (e == null) return {};
542
+ var n = {};
543
+ for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
544
+ if (t.indexOf(a) >= 0) continue;
545
+ n[a] = e[a];
546
+ }
547
+ return n;
548
+ }
549
+ const Ln = () => {
550
+ }, Rn = sn("event-key"), Gr = /* @__PURE__ */ oe.forwardRef((e, t) => {
551
+ let {
552
+ // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
553
+ as: n = "div",
554
+ onSelect: a,
555
+ activeKey: s,
556
+ role: o,
557
+ onKeyDown: i
558
+ } = e, c = ao(e, ro);
559
+ const l = Ra(), u = te(!1), d = q(Zt), m = q(Wr);
560
+ let x, v;
561
+ m && (o = o || "tablist", s = m.activeKey, x = m.getControlledId, v = m.getControllerId);
562
+ const h = te(null), p = (f) => {
563
+ const y = h.current;
564
+ if (!y) return null;
565
+ const N = Va(y, `[${Rn}]:not([aria-disabled=true])`), k = y.querySelector("[aria-selected=true]");
566
+ if (!k || k !== document.activeElement) return null;
567
+ const I = N.indexOf(k);
568
+ if (I === -1) return null;
569
+ let D = I + f;
570
+ return D >= N.length && (D = 0), D < 0 && (D = N.length - 1), N[D];
571
+ }, g = (f, y) => {
572
+ f != null && (a == null || a(f, y), d == null || d(f, y));
573
+ }, j = (f) => {
574
+ if (i == null || i(f), !m)
575
+ return;
576
+ let y;
577
+ switch (f.key) {
578
+ case "ArrowLeft":
579
+ case "ArrowUp":
580
+ y = p(-1);
581
+ break;
582
+ case "ArrowRight":
583
+ case "ArrowDown":
584
+ y = p(1);
585
+ break;
586
+ default:
587
+ return;
588
+ }
589
+ y && (f.preventDefault(), g(y.dataset[Ma("EventKey")] || null, f), u.current = !0, l());
590
+ };
591
+ M(() => {
592
+ if (h.current && u.current) {
593
+ const f = h.current.querySelector(`[${Rn}][aria-selected=true]`);
594
+ f == null || f.focus();
595
+ }
596
+ u.current = !1;
597
+ });
598
+ const b = Aa(t, h);
599
+ return /* @__PURE__ */ r.jsx(Zt.Provider, {
600
+ value: g,
601
+ children: /* @__PURE__ */ r.jsx(ur.Provider, {
602
+ value: {
603
+ role: o,
604
+ // used by NavLink to determine it's role
605
+ activeKey: on(s),
606
+ getControlledId: x || Ln,
607
+ getControllerId: v || Ln
608
+ },
609
+ children: /* @__PURE__ */ r.jsx(n, Object.assign({}, c, {
610
+ onKeyDown: j,
611
+ ref: b,
612
+ role: o
613
+ }))
614
+ })
615
+ });
616
+ });
617
+ Gr.displayName = "Nav";
618
+ const so = Object.assign(Gr, {
619
+ Item: no
620
+ }), xn = /* @__PURE__ */ oe.forwardRef(({
621
+ bsPrefix: e,
622
+ active: t,
623
+ disabled: n,
624
+ eventKey: a,
625
+ className: s,
626
+ variant: o,
627
+ action: i,
628
+ as: c,
629
+ ...l
630
+ }, u) => {
631
+ e = ue(e, "list-group-item");
632
+ const [d, m] = zr({
633
+ key: on(a, l.href),
634
+ active: t,
635
+ ...l
636
+ }), x = Ft((h) => {
637
+ if (n) {
638
+ h.preventDefault(), h.stopPropagation();
639
+ return;
640
+ }
641
+ d.onClick(h);
642
+ });
643
+ n && l.tabIndex === void 0 && (l.tabIndex = -1, l["aria-disabled"] = !0);
644
+ const v = c || (i ? l.href ? "a" : "button" : "div");
645
+ return process.env.NODE_ENV !== "production" && fr(c || !(!i && l.href), "`action=false` and `href` should not be used together."), /* @__PURE__ */ r.jsx(v, {
646
+ ref: u,
647
+ ...l,
648
+ ...d,
649
+ onClick: x,
650
+ className: w(s, e, m.isActive && "active", n && "disabled", o && `${e}-${o}`, i && `${e}-action`)
651
+ });
652
+ });
653
+ xn.displayName = "ListGroupItem";
654
+ const Yr = /* @__PURE__ */ oe.forwardRef((e, t) => {
655
+ const {
656
+ className: n,
657
+ bsPrefix: a,
658
+ variant: s,
659
+ horizontal: o,
660
+ numbered: i,
661
+ // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
662
+ as: c = "div",
663
+ ...l
664
+ } = cr(e, {
665
+ activeKey: "onSelect"
666
+ }), u = ue(a, "list-group");
667
+ let d;
668
+ return o && (d = o === !0 ? "horizontal" : `horizontal-${o}`), process.env.NODE_ENV !== "production" && fr(!(o && s === "flush"), '`variant="flush"` and `horizontal` should not be used together.'), /* @__PURE__ */ r.jsx(so, {
669
+ ref: t,
670
+ ...l,
671
+ as: c,
672
+ className: w(n, u, s && `${u}-${s}`, d && `${u}-${d}`, i && `${u}-numbered`)
673
+ });
674
+ });
675
+ Yr.displayName = "ListGroup";
676
+ const oo = Object.assign(Yr, {
677
+ Item: xn
678
+ }), nn = /* @__PURE__ */ new WeakMap(), An = (e, t) => {
679
+ if (!e || !t) return;
680
+ const n = nn.get(t) || /* @__PURE__ */ new Map();
681
+ nn.set(t, n);
682
+ let a = n.get(e);
683
+ return a || (a = t.matchMedia(e), a.refCount = 0, n.set(a.media, a)), a;
684
+ };
685
+ function io(e, t = typeof window > "u" ? void 0 : window) {
686
+ const n = An(e, t), [a, s] = E(() => n ? n.matches : !1);
687
+ return Ba(() => {
688
+ let o = An(e, t);
689
+ if (!o)
690
+ return s(!1);
691
+ let i = nn.get(t);
692
+ const c = () => {
693
+ s(o.matches);
694
+ };
695
+ return o.refCount++, o.addListener(c), c(), () => {
696
+ o.removeListener(c), o.refCount--, o.refCount <= 0 && (i == null || i.delete(o.media)), o = void 0;
697
+ };
698
+ }, [e]), a;
699
+ }
700
+ function lo(e) {
701
+ const t = Object.keys(e);
702
+ function n(c, l) {
703
+ return c === l ? l : c ? `${c} and ${l}` : l;
704
+ }
705
+ function a(c) {
706
+ return t[Math.min(t.indexOf(c) + 1, t.length - 1)];
707
+ }
708
+ function s(c) {
709
+ const l = a(c);
710
+ let u = e[l];
711
+ return typeof u == "number" ? u = `${u - 0.2}px` : u = `calc(${u} - 0.2px)`, `(max-width: ${u})`;
712
+ }
713
+ function o(c) {
714
+ let l = e[c];
715
+ return typeof l == "number" && (l = `${l}px`), `(min-width: ${l})`;
716
+ }
717
+ function i(c, l, u) {
718
+ let d;
719
+ typeof c == "object" ? (d = c, u = l, l = !0) : (l = l || !0, d = {
720
+ [c]: l
721
+ });
722
+ let m = ne(() => Object.entries(d).reduce((x, [v, h]) => ((h === "up" || h === !0) && (x = n(x, o(v))), (h === "down" || h === !0) && (x = n(x, s(v))), x), ""), [JSON.stringify(d)]);
723
+ return io(m, u);
724
+ }
725
+ return i;
726
+ }
727
+ const co = lo({
728
+ xs: 0,
729
+ sm: 576,
730
+ md: 768,
731
+ lg: 992,
732
+ xl: 1200,
733
+ xxl: 1400
734
+ }), Kr = /* @__PURE__ */ oe.forwardRef(({
735
+ className: e,
736
+ bsPrefix: t,
737
+ as: n = "div",
738
+ ...a
739
+ }, s) => (t = ue(t, "offcanvas-body"), /* @__PURE__ */ r.jsx(n, {
740
+ ref: s,
741
+ className: w(e, t),
742
+ ...a
743
+ })));
744
+ Kr.displayName = "OffcanvasBody";
745
+ const uo = {
746
+ [an]: "show",
747
+ [lr]: "show"
748
+ }, qr = /* @__PURE__ */ oe.forwardRef(({
749
+ bsPrefix: e,
750
+ className: t,
751
+ children: n,
752
+ in: a = !1,
753
+ mountOnEnter: s = !1,
754
+ unmountOnExit: o = !1,
755
+ appear: i = !1,
756
+ ...c
757
+ }, l) => (e = ue(e, "offcanvas"), /* @__PURE__ */ r.jsx(sr, {
758
+ ref: l,
759
+ addEndListener: or,
760
+ in: a,
761
+ mountOnEnter: s,
762
+ unmountOnExit: o,
763
+ appear: i,
764
+ ...c,
765
+ childRef: n.ref,
766
+ children: (u, d) => /* @__PURE__ */ oe.cloneElement(n, {
767
+ ...d,
768
+ className: w(t, n.props.className, (u === an || u === ir) && `${e}-toggling`, uo[u])
769
+ })
770
+ })));
771
+ qr.displayName = "OffcanvasToggling";
772
+ const Qr = /* @__PURE__ */ oe.forwardRef(({
773
+ bsPrefix: e,
774
+ className: t,
775
+ closeLabel: n = "Close",
776
+ closeButton: a = !1,
777
+ ...s
778
+ }, o) => (e = ue(e, "offcanvas-header"), /* @__PURE__ */ r.jsx(Pa, {
779
+ ref: o,
780
+ ...s,
781
+ className: w(t, e),
782
+ closeLabel: n,
783
+ closeButton: a
784
+ })));
785
+ Qr.displayName = "OffcanvasHeader";
786
+ const fo = $t("h5"), Zr = /* @__PURE__ */ oe.forwardRef(({
787
+ className: e,
788
+ bsPrefix: t,
789
+ as: n = fo,
790
+ ...a
791
+ }, s) => (t = ue(t, "offcanvas-title"), /* @__PURE__ */ r.jsx(n, {
792
+ ref: s,
793
+ className: w(e, t),
794
+ ...a
795
+ })));
796
+ Zr.displayName = "OffcanvasTitle";
797
+ function mo(e) {
798
+ return /* @__PURE__ */ r.jsx(qr, {
799
+ ...e
800
+ });
801
+ }
802
+ function ho(e) {
803
+ return /* @__PURE__ */ r.jsx(Qt, {
804
+ ...e
805
+ });
806
+ }
807
+ const Jr = /* @__PURE__ */ oe.forwardRef(({
808
+ bsPrefix: e,
809
+ className: t,
810
+ children: n,
811
+ "aria-labelledby": a,
812
+ placement: s = "start",
813
+ responsive: o,
814
+ /* BaseModal props */
815
+ show: i = !1,
816
+ backdrop: c = !0,
817
+ keyboard: l = !0,
818
+ scroll: u = !1,
819
+ onEscapeKeyDown: d,
820
+ onShow: m,
821
+ onHide: x,
822
+ container: v,
823
+ autoFocus: h = !0,
824
+ enforceFocus: p = !0,
825
+ restoreFocus: g = !0,
826
+ restoreFocusOptions: j,
827
+ onEntered: b,
828
+ onExit: f,
829
+ onExiting: y,
830
+ onEnter: N,
831
+ onEntering: k,
832
+ onExited: I,
833
+ backdropClassName: D,
834
+ manager: C,
835
+ renderStaticNode: L = !1,
836
+ ...O
837
+ }, _) => {
838
+ const W = te();
839
+ e = ue(e, "offcanvas");
840
+ const {
841
+ onToggle: V
842
+ } = q(Ha) || {}, [X, R] = E(!1), $ = co(o || "xs", "up");
843
+ M(() => {
844
+ R(o ? i && !$ : i);
845
+ }, [i, o, $]);
846
+ const P = Ft(() => {
847
+ V == null || V(), x == null || x();
848
+ }), U = ne(() => ({
849
+ onHide: P
850
+ }), [P]);
851
+ function Z() {
852
+ return C || (u ? (W.current || (W.current = new Ua({
853
+ handleContainerOverflow: !1
854
+ })), W.current) : Ga());
855
+ }
856
+ const Q = (z, ...me) => {
857
+ z && (z.style.visibility = "visible"), N == null || N(z, ...me);
858
+ }, F = (z, ...me) => {
859
+ z && (z.style.visibility = ""), I == null || I(...me);
860
+ }, ee = S((z) => /* @__PURE__ */ r.jsx("div", {
861
+ ...z,
862
+ className: w(`${e}-backdrop`, D)
863
+ }), [D, e]), A = (z) => /* @__PURE__ */ r.jsx("div", {
864
+ ...z,
865
+ ...O,
866
+ className: w(t, o ? `${e}-${o}` : e, `${e}-${s}`),
867
+ "aria-labelledby": a,
868
+ children: n
869
+ });
870
+ return /* @__PURE__ */ r.jsxs(r.Fragment, {
871
+ children: [!X && (o || L) && A({}), /* @__PURE__ */ r.jsx(Wa.Provider, {
872
+ value: U,
873
+ children: /* @__PURE__ */ r.jsx(za, {
874
+ show: X,
875
+ ref: _,
876
+ backdrop: c,
877
+ container: v,
878
+ keyboard: l,
879
+ autoFocus: h,
880
+ enforceFocus: p && !u,
881
+ restoreFocus: g,
882
+ restoreFocusOptions: j,
883
+ onEscapeKeyDown: d,
884
+ onShow: m,
885
+ onHide: P,
886
+ onEnter: Q,
887
+ onEntering: k,
888
+ onEntered: b,
889
+ onExit: f,
890
+ onExiting: y,
891
+ onExited: F,
892
+ manager: Z(),
893
+ transition: mo,
894
+ backdropTransition: ho,
895
+ renderBackdrop: ee,
896
+ renderDialog: A
897
+ })
898
+ })]
899
+ });
900
+ });
901
+ Jr.displayName = "Offcanvas";
902
+ const Mn = Object.assign(Jr, {
903
+ Body: Kr,
904
+ Header: Qr,
905
+ Title: Zr
906
+ });
907
+ function Xr({
908
+ animation: e,
909
+ bg: t,
910
+ bsPrefix: n,
911
+ size: a,
912
+ ...s
913
+ }) {
914
+ n = ue(n, "placeholder");
915
+ const [{
916
+ className: o,
917
+ ...i
918
+ }] = Ya(s);
919
+ return {
920
+ ...i,
921
+ className: w(o, e ? `${n}-${e}` : n, a && `${n}-${a}`, t && `bg-${t}`)
922
+ };
923
+ }
924
+ const ea = /* @__PURE__ */ oe.forwardRef((e, t) => {
925
+ const n = Xr(e);
926
+ return /* @__PURE__ */ r.jsx(Jt, {
927
+ ...n,
928
+ ref: t,
929
+ disabled: !0,
930
+ tabIndex: -1
931
+ });
932
+ });
933
+ ea.displayName = "PlaceholderButton";
934
+ const ta = /* @__PURE__ */ oe.forwardRef(({
935
+ as: e = "span",
936
+ ...t
937
+ }, n) => {
938
+ const a = Xr(t);
939
+ return /* @__PURE__ */ r.jsx(e, {
940
+ ...a,
941
+ ref: n
942
+ });
943
+ });
944
+ ta.displayName = "Placeholder";
945
+ const Ae = Object.assign(ta, {
946
+ Button: ea
947
+ }), vn = /* @__PURE__ */ oe.forwardRef(({
948
+ bsPrefix: e,
949
+ variant: t,
950
+ animation: n = "border",
951
+ size: a,
952
+ // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
953
+ as: s = "div",
954
+ className: o,
955
+ ...i
956
+ }, c) => {
957
+ e = ue(e, "spinner");
958
+ const l = `${e}-${n}`;
959
+ return /* @__PURE__ */ r.jsx(s, {
960
+ ref: c,
961
+ ...i,
962
+ className: w(o, l, a && `${l}-${a}`, t && `text-${t}`)
963
+ });
964
+ });
965
+ vn.displayName = "Spinner";
966
+ const Xc = ({ heading: e, content: t, placement: n, children: a, trigger: s, popoverClassName: o, ...i }) => /* @__PURE__ */ r.jsx(Ka, { placement: n, overlay: /* @__PURE__ */ r.jsxs(Mt, { className: w("luminus-popover", o), onClick: (c) => c.stopPropagation(), children: [
967
+ e && /* @__PURE__ */ r.jsx(Mt.Header, { children: typeof e == "string" ? /* @__PURE__ */ r.jsx(J, { variant: "h6", className: "text-primary", children: e }) : e }),
968
+ /* @__PURE__ */ r.jsx(Mt.Body, { children: t })
969
+ ] }), trigger: s ?? "hover", rootClose: !0, show: i.controlled ? i.isOpen : void 0, onToggle: i.controlled ? (c) => i.setIsOpen(c) : void 0, children: a }), go = ({ children: e, onStorno: t, noSpacer: n }) => {
970
+ const { texts: { formSubmit: a } } = q(ge);
971
+ return /* @__PURE__ */ r.jsxs(gl, { noSpacer: n, children: [
972
+ /* @__PURE__ */ r.jsxs(Xt, { as: "button", color: "primary", size: "lg", type: "submit", children: [
973
+ /* @__PURE__ */ r.jsx(qa, {}),
974
+ e
975
+ ] }),
976
+ t && /* @__PURE__ */ r.jsxs(Xt, { as: "button", color: "secondary", variant: "outlined", size: "lg", onClick: t, children: [
977
+ /* @__PURE__ */ r.jsx(Qa, {}),
978
+ a.storno
979
+ ] })
980
+ ] });
981
+ }, na = ({ color: e = "primary", icon: t = /* @__PURE__ */ r.jsx(mr, { size: 12 }), inputId: n = "context-file-input", accept: a = "*", onUpload: s, className: o, children: i, multiple: c, ...l }) => {
982
+ const u = (d) => {
983
+ d.target.files && (s(d.target.files), d.target.value = "");
984
+ };
985
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
986
+ /* @__PURE__ */ r.jsxs("label", { htmlFor: n, className: w(`luminus-context-button btn text-${e} ${o ?? ""}`, Za.button), ...l, children: [
987
+ t,
988
+ i
989
+ ] }),
990
+ /* @__PURE__ */ r.jsx("input", { id: n, type: "file", accept: a, onChange: u, hidden: !0, multiple: c })
991
+ ] });
992
+ }, ed = ({ onUpload: e, accept: t, children: n, className: a, size: s = "md" }) => {
993
+ const o = S(async (c) => {
994
+ if (c.target.files)
995
+ try {
996
+ await e(c.target.files);
997
+ } finally {
998
+ c.target.value = "";
999
+ }
1000
+ }, [e]), i = ws();
1001
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1002
+ /* @__PURE__ */ r.jsx("label", { htmlFor: i, className: w("btn luminus-context-button text-primary", `btn-${s}`, a), children: n }),
1003
+ /* @__PURE__ */ r.jsx("input", { id: i, type: "file", accept: t, onChange: o, hidden: !0 })
1004
+ ] });
1005
+ }, po = "_select_dlv1t_1", Wt = {
1006
+ select: po
1007
+ }, xo = ({ month: e, onChangeMonth: t, locale: n, yearMin: a = 2e3, yearMax: s = 2050 }) => {
1008
+ const o = S((l) => {
1009
+ const u = Cr(e, l);
1010
+ u.getFullYear() < a || u.getFullYear() > s || t(u);
1011
+ }, [e, t, a, s]), i = ne(() => {
1012
+ const l = [];
1013
+ for (let u = a; u <= s; u++)
1014
+ l.push(u);
1015
+ return l;
1016
+ }, [a, s]), c = ne(() => {
1017
+ const d = [];
1018
+ for (let m = 0; m <= 11; m++)
1019
+ d.push({
1020
+ id: m,
1021
+ name: xt(new Date(2024, m, 1), "LLLL", { locale: n })
1022
+ });
1023
+ return d;
1024
+ }, [n]);
1025
+ return /* @__PURE__ */ r.jsxs("div", { className: "card d-flex flex-row align-items-center m-0 p-1 gap-2", children: [
1026
+ /* @__PURE__ */ r.jsx(re, { onClick: () => o(-1), disabled: e.getFullYear() < a || e.getFullYear() === a && e.getMonth() <= 0, children: /* @__PURE__ */ r.jsx(ln, {}) }),
1027
+ /* @__PURE__ */ r.jsx(ye.Select, { value: e.getMonth(), onChange: (l) => {
1028
+ var u;
1029
+ return ((u = l.target) == null ? void 0 : u.value) && t(Us(e, Number(l.target.value)));
1030
+ }, className: w(Wt.select, Wt.month), children: c.map((l) => /* @__PURE__ */ r.jsx("option", { value: l.id, children: l.name }, l.id)) }),
1031
+ /* @__PURE__ */ r.jsx(ye.Select, { value: e.getFullYear(), onChange: (l) => {
1032
+ var u;
1033
+ return ((u = l.target) == null ? void 0 : u.value) && t(Sr(e, Number(l.target.value)));
1034
+ }, className: w(Wt.select), children: i.map((l) => /* @__PURE__ */ r.jsx("option", { value: l, children: l }, l)) }),
1035
+ /* @__PURE__ */ r.jsx(re, { onClick: () => o(1), disabled: e.getFullYear() > s || e.getFullYear() === s && e.getMonth() >= 11, children: /* @__PURE__ */ r.jsx(cn, {}) })
1036
+ ] });
1037
+ }, vo = "_select_pywmr_1", jo = {
1038
+ select: vo
1039
+ }, yo = ({ year: e, onChangeYear: t, optionMin: n = 2e3, optionMax: a = 2050, className: s }) => {
1040
+ const o = S((c) => {
1041
+ const l = e.getFullYear() + c;
1042
+ l < n || l > a || t(Bs(e, c));
1043
+ }, [e, t, a, n]), i = ne(() => {
1044
+ const c = [];
1045
+ for (let l = n; l <= a; l++)
1046
+ c.push(l);
1047
+ return c;
1048
+ }, [n, a]);
1049
+ return /* @__PURE__ */ r.jsxs("div", { className: w("card d-flex flex-row align-items-center m-0 p-1 gap-2", s ?? ""), children: [
1050
+ /* @__PURE__ */ r.jsx(re, { onClick: () => o(-1), disabled: e.getFullYear() <= n, children: /* @__PURE__ */ r.jsx(ln, {}) }),
1051
+ /* @__PURE__ */ r.jsx(ye.Select, { value: e.getFullYear(), onChange: (c) => {
1052
+ var l;
1053
+ return ((l = c.target) == null ? void 0 : l.value) && t(Sr(e, Number(c.target.value)));
1054
+ }, className: jo.select, children: i.map((c) => /* @__PURE__ */ r.jsx("option", { value: c, children: c }, c)) }),
1055
+ /* @__PURE__ */ r.jsx(re, { onClick: () => o(1), disabled: e.getFullYear() >= a, children: /* @__PURE__ */ r.jsx(cn, {}) })
1056
+ ] });
1057
+ }, bo = "_widget_etgh3_1", wo = {
1058
+ widget: bo
1059
+ }, _o = ({ show: e, widgets: t, handleClose: n, onWidgetPicked: a, texts: s }) => /* @__PURE__ */ r.jsxs(Ve, { show: e, onHide: () => n(), children: [
1060
+ /* @__PURE__ */ r.jsx(Ve.Header, { closeButton: !0, children: /* @__PURE__ */ r.jsx(Ve.Title, { children: s.pickWidgetToAdd }) }),
1061
+ /* @__PURE__ */ r.jsx(Ve.Body, { children: /* @__PURE__ */ r.jsx("div", { className: "list-group", children: t.filter((o) => o.id >= 0).map((o) => /* @__PURE__ */ r.jsx("div", { role: "button", className: "list-group-item bg-white", onClick: () => a(o.id), children: /* @__PURE__ */ r.jsx(J, { variant: "body", children: o.name }) })) }) })
1062
+ ] }), Vn = ({ availableWidgets: e, onAdd: t, texts: n }) => {
1063
+ const [a, s] = E(!1);
1064
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1065
+ /* @__PURE__ */ r.jsx("div", { className: w("luminus-empty-widget", wo.widget), children: /* @__PURE__ */ r.jsx(re, { onClick: () => s(!0), children: /* @__PURE__ */ r.jsx(Ja, {}) }) }),
1066
+ /* @__PURE__ */ r.jsx(_o, { show: a, widgets: e, handleClose: () => s(!1), onWidgetPicked: (o) => {
1067
+ s(!1), t(o);
1068
+ }, texts: n })
1069
+ ] });
1070
+ }, No = (e) => {
1071
+ const [t, n] = E({ widgets: [] });
1072
+ M(() => {
1073
+ const s = localStorage.getItem("dashboardConfig");
1074
+ s ? n(JSON.parse(s)) : e && n(e);
1075
+ }, [e]);
1076
+ const a = S((s) => {
1077
+ n(s), localStorage.setItem("dashboardConfig", JSON.stringify(s));
1078
+ }, []);
1079
+ return { dashboardConfig: t, onChangeDashboardConfig: a };
1080
+ }, Co = "_dashboard_16plm_1", So = "_widgets-grid_16plm_1", ko = "_widget-wrapper_16plm_8", Io = "_full-width_16plm_13", Do = "_widget-edit_16plm_16", $o = "_remove-icon_16plm_19", Fo = "_full-width-icon_16plm_26", Oo = "_widget-edit-overlay_16plm_36", Ee = {
1081
+ dashboard: Co,
1082
+ "widgets-grid": "_widgets-grid_16plm_1",
1083
+ widgetsGrid: So,
1084
+ "widget-wrapper": "_widget-wrapper_16plm_8",
1085
+ widgetWrapper: ko,
1086
+ "full-width": "_full-width_16plm_13",
1087
+ fullWidth: Io,
1088
+ "widget-edit": "_widget-edit_16plm_16",
1089
+ widgetEdit: Do,
1090
+ "remove-icon": "_remove-icon_16plm_19",
1091
+ removeIcon: $o,
1092
+ "full-width-icon": "_full-width-icon_16plm_26",
1093
+ fullWidthIcon: Fo,
1094
+ "widget-edit-overlay": "_widget-edit-overlay_16plm_36",
1095
+ widgetEditOverlay: Oo
1096
+ };
1097
+ class Eo extends _s {
1098
+ constructor(t) {
1099
+ super(t), this.state = { hasError: !1 }, this.reload = this.reload.bind(this);
1100
+ }
1101
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1102
+ static getDerivedStateFromError(t) {
1103
+ return { hasError: !0 };
1104
+ }
1105
+ componentDidUpdate(t) {
1106
+ this.state.hasError && t.keyForErrorState !== this.props.keyForErrorState && this.setState({ hasError: !1 });
1107
+ }
1108
+ componentDidCatch(t, n) {
1109
+ console.error("Error:", t, n);
1110
+ }
1111
+ reload() {
1112
+ this.setState({ hasError: !1 });
1113
+ }
1114
+ render() {
1115
+ const { fallback: t, children: n, texts: a, reloadButtonDisplay: s = "append-after-child" } = this.props;
1116
+ return this.state.hasError ? s === "inject-to-child" && Ns(t) ? Ce.cloneElement(t, {
1117
+ ...t.props
1118
+ }, /* @__PURE__ */ r.jsxs("div", { className: "translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2", children: [
1119
+ ...t.props.children,
1120
+ /* @__PURE__ */ r.jsx(ot, { type: "button", onClick: this.reload, children: a.reloadButtonContent })
1121
+ ] })) : /* @__PURE__ */ r.jsxs("div", { className: "translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2", children: [
1122
+ t,
1123
+ s === "none" ? null : /* @__PURE__ */ r.jsx(ot, { type: "button", onClick: this.reload, children: a.reloadButtonContent })
1124
+ ] }) : n;
1125
+ }
1126
+ }
1127
+ const To = (e) => (n) => {
1128
+ const { texts: { errorBoundary: a } } = q(ge);
1129
+ return /* @__PURE__ */ r.jsx(e, { texts: a, ...n });
1130
+ }, Lo = To(Eo), Ro = "_widget-card_e9tsb_1", Ao = {
1131
+ "widget-card": "_widget-card_e9tsb_1",
1132
+ widgetCard: Ro
1133
+ }, Bn = ({ children: e, title: t, headerContent: n }) => /* @__PURE__ */ r.jsx(Ri, { className: w(Ao.widgetCard, "luminus-widget"), title: t, headerContent: n, contentClassName: "h-100 overflow-auto", children: e }), Mo = ({ children: e, title: t }) => {
1134
+ const { texts: { widget: n } } = q(ge);
1135
+ return /* @__PURE__ */ r.jsx(Lo, { fallback: /* @__PURE__ */ r.jsx(Bn, { title: t, children: n.fallbackError }), reloadButtonDisplay: "inject-to-child", children: /* @__PURE__ */ r.jsx(Cs, { fallback: /* @__PURE__ */ r.jsx(Bn, { title: t, children: /* @__PURE__ */ r.jsx(Vs, {}) }), children: e }) });
1136
+ }, td = ({ availableWidgets: e, editMode: t, defaultDashboardConfig: n }) => {
1137
+ var d;
1138
+ const { texts: { homeDashboard: a } } = q(ge), { dashboardConfig: s, onChangeDashboardConfig: o } = No(n), i = S((m, x) => {
1139
+ var v, h;
1140
+ m === ((v = s.widgets) == null ? void 0 : v.length) ? o({
1141
+ ...s,
1142
+ widgets: [...s.widgets, { widgetId: x, fullWidth: !1 }]
1143
+ }) : o({
1144
+ ...s,
1145
+ widgets: ((h = s.widgets) == null ? void 0 : h.map((p, g) => g === m ? { widgetId: x, fullWidth: !1 } : p)) ?? []
1146
+ });
1147
+ }, [s, o]), c = S((m) => {
1148
+ var x, v;
1149
+ ((x = s.widgets[m]) == null ? void 0 : x.widgetId) === -1 ? o({
1150
+ ...s,
1151
+ widgets: ((v = s.widgets) == null ? void 0 : v.filter((h, p) => p !== m)) ?? []
1152
+ }) : i(m, -1);
1153
+ }, [s, o, i]), l = S((m) => {
1154
+ var x;
1155
+ o({
1156
+ ...s,
1157
+ widgets: ((x = s.widgets) == null ? void 0 : x.map((v, h) => h === m ? { ...v, fullWidth: !v.fullWidth } : v)) ?? []
1158
+ });
1159
+ }, [s, o]), u = S((m, x, v) => m ? /* @__PURE__ */ r.jsxs("div", { className: w(Ee.widgetWrapper, {
1160
+ [Ee.widgetEdit]: t && m.id !== -1
1161
+ }, { [Ee.fullWidth]: v }), children: [
1162
+ t && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1163
+ /* @__PURE__ */ r.jsx(re, { color: "danger", onClick: () => c(x), className: w(Ee.removeIcon), children: /* @__PURE__ */ r.jsx(hr, {}) }),
1164
+ /* @__PURE__ */ r.jsx(re, { color: v ? "danger" : "primary", onClick: () => l(x), className: w(Ee.fullWidthIcon), children: /* @__PURE__ */ r.jsx(Xa, {}) })
1165
+ ] }),
1166
+ m.id === -1 ? t && /* @__PURE__ */ r.jsx("div", { className: Ee.widgetWrapper, children: /* @__PURE__ */ r.jsx(Vn, { availableWidgets: e, onAdd: (h) => i(x, h), texts: a }) }) : /* @__PURE__ */ r.jsx(Mo, { title: m.title, children: /* @__PURE__ */ r.jsx(m.WidgetElement, { title: m.title }) }),
1167
+ m.id > -1 && t && /* @__PURE__ */ r.jsx("div", { className: Ee.widgetEditOverlay })
1168
+ ] }, x) : /* @__PURE__ */ r.jsx(r.Fragment, {}), [
1169
+ t,
1170
+ i,
1171
+ c,
1172
+ l,
1173
+ e,
1174
+ a
1175
+ ]);
1176
+ return /* @__PURE__ */ r.jsx("div", { className: Ee.dashboard, children: /* @__PURE__ */ r.jsxs("div", { className: Ee.widgetsGrid, children: [
1177
+ (d = s.widgets) == null ? void 0 : d.map((m, x) => u(e.find((v) => v.id === m.widgetId), x, m.fullWidth)),
1178
+ t && /* @__PURE__ */ r.jsx(Vn, { availableWidgets: e, onAdd: (m) => {
1179
+ var x;
1180
+ return i((x = s.widgets) == null ? void 0 : x.length, m);
1181
+ }, texts: a })
1182
+ ] }) });
1183
+ }, Vo = "_badge_193ci_1", Bo = "_sm_193ci_6", Po = "_md_193ci_10", Ho = "_lg_193ci_14", Wo = "_light_193ci_18", zt = {
1184
+ badge: Vo,
1185
+ sm: Bo,
1186
+ md: Po,
1187
+ lg: Ho,
1188
+ light: Wo
1189
+ }, nd = ({ children: e, color: t = "primary", size: n = "md", rounded: a, className: s, ...o }) => /* @__PURE__ */ r.jsx("span", { className: w(`luminus-badge badge bg-${t} ${s ?? ""}`, { "rounded-pill": a }, { "text-dark": t === "light" }, { [zt.light]: t === "light" }, zt.badge, zt[n]), ...o, children: e }), zo = "_collapse-icon_1ahhn_1", Uo = "_collapsed_1ahhn_6", Pn = {
1190
+ "collapse-icon": "_collapse-icon_1ahhn_1",
1191
+ collapseIcon: zo,
1192
+ collapsed: Uo
1193
+ }, Go = ({ title: e, children: t, className: n, ...a }) => {
1194
+ const s = a.controlled ? !1 : a.defaultOpen ?? !1, [o, i] = E(s), c = a.controlled ? a.isOpen : o;
1195
+ return M(() => {
1196
+ i(s);
1197
+ }, [s]), /* @__PURE__ */ r.jsxs("div", { className: n ?? "", children: [
1198
+ /* @__PURE__ */ r.jsxs("div", { role: "button", className: "d-flex align-items-center justify-content-between pb-3 pt-2", onClick: () => a.controlled ? a.onToggle(!a.isOpen) : i(!o), children: [
1199
+ /* @__PURE__ */ r.jsx(J, { variant: "h6", children: e }),
1200
+ /* @__PURE__ */ r.jsx(gr, { className: w(Pn.collapseIcon, {
1201
+ [Pn.collapsed]: c
1202
+ }) })
1203
+ ] }),
1204
+ /* @__PURE__ */ r.jsx(kr, { in: c, children: /* @__PURE__ */ r.jsx("div", { children: t }) }),
1205
+ /* @__PURE__ */ r.jsx("hr", { className: `my-0 ${c ? "mt-3" : ""}` })
1206
+ ] });
1207
+ };
1208
+ function Yo(e, t, n) {
1209
+ var a = this, s = te(null), o = te(0), i = te(null), c = te([]), l = te(), u = te(), d = te(e), m = te(!0);
1210
+ d.current = e;
1211
+ var x = typeof window < "u", v = !t && t !== 0 && x;
1212
+ if (typeof e != "function") throw new TypeError("Expected a function");
1213
+ t = +t || 0;
1214
+ var h = !!(n = n || {}).leading, p = !("trailing" in n) || !!n.trailing, g = "maxWait" in n, j = "debounceOnServer" in n && !!n.debounceOnServer, b = g ? Math.max(+n.maxWait || 0, t) : null;
1215
+ M(function() {
1216
+ return m.current = !0, function() {
1217
+ m.current = !1;
1218
+ };
1219
+ }, []);
1220
+ var f = ne(function() {
1221
+ var y = function(L) {
1222
+ var O = c.current, _ = l.current;
1223
+ return c.current = l.current = null, o.current = L, u.current = d.current.apply(_, O);
1224
+ }, N = function(L, O) {
1225
+ v && cancelAnimationFrame(i.current), i.current = v ? requestAnimationFrame(L) : setTimeout(L, O);
1226
+ }, k = function(L) {
1227
+ if (!m.current) return !1;
1228
+ var O = L - s.current;
1229
+ return !s.current || O >= t || O < 0 || g && L - o.current >= b;
1230
+ }, I = function(L) {
1231
+ return i.current = null, p && c.current ? y(L) : (c.current = l.current = null, u.current);
1232
+ }, D = function L() {
1233
+ var O = Date.now();
1234
+ if (k(O)) return I(O);
1235
+ if (m.current) {
1236
+ var _ = t - (O - s.current), W = g ? Math.min(_, b - (O - o.current)) : _;
1237
+ N(L, W);
1238
+ }
1239
+ }, C = function() {
1240
+ if (x || j) {
1241
+ var L = Date.now(), O = k(L);
1242
+ if (c.current = [].slice.call(arguments), l.current = a, s.current = L, O) {
1243
+ if (!i.current && m.current) return o.current = s.current, N(D, t), h ? y(s.current) : u.current;
1244
+ if (g) return N(D, t), y(s.current);
1245
+ }
1246
+ return i.current || N(D, t), u.current;
1247
+ }
1248
+ };
1249
+ return C.cancel = function() {
1250
+ i.current && (v ? cancelAnimationFrame(i.current) : clearTimeout(i.current)), o.current = 0, c.current = s.current = l.current = i.current = null;
1251
+ }, C.isPending = function() {
1252
+ return !!i.current;
1253
+ }, C.flush = function() {
1254
+ return i.current ? I(Date.now()) : u.current;
1255
+ }, C;
1256
+ }, [h, g, t, b, p, v, x, j]);
1257
+ return f;
1258
+ }
1259
+ function Ko(e, t) {
1260
+ return e === t;
1261
+ }
1262
+ function qo(e, t) {
1263
+ return t;
1264
+ }
1265
+ function ra(e, t, n) {
1266
+ var a = Ko, s = Ss(qo, e), o = s[0], i = s[1], c = Yo(S(function(u) {
1267
+ return i(u);
1268
+ }, [i]), t, n), l = te(e);
1269
+ return a(l.current, e) || (c(e), l.current = e), a(o, e) && c.cancel(), [o, c];
1270
+ }
1271
+ const Qo = "_wrapper_1kgb8_1", Zo = "_open_1kgb8_9", Jo = "_dropdown_1kgb8_13", Xo = "_search-input-container_1kgb8_19", ei = "_search-input_1kgb8_19", ti = "_loading-container_1kgb8_25", ni = "_items-container_1kgb8_32", ri = "_header-row_1kgb8_38", ai = "_item_1kgb8_32", si = "_name_1kgb8_57", oi = "_column-item_1kgb8_62", ii = "_icon_1kgb8_66", li = "_action-buttons-container_1kgb8_74", ci = "_reverse_1kgb8_82", di = "_action-button_1kgb8_74", be = {
1272
+ wrapper: Qo,
1273
+ open: Zo,
1274
+ dropdown: Jo,
1275
+ "search-input-container": "_search-input-container_1kgb8_19",
1276
+ searchInputContainer: Xo,
1277
+ "search-input": "_search-input_1kgb8_19",
1278
+ searchInput: ei,
1279
+ "loading-container": "_loading-container_1kgb8_25",
1280
+ loadingContainer: ti,
1281
+ "items-container": "_items-container_1kgb8_32",
1282
+ itemsContainer: ni,
1283
+ "header-row": "_header-row_1kgb8_38",
1284
+ headerRow: ri,
1285
+ item: ai,
1286
+ name: si,
1287
+ "column-item": "_column-item_1kgb8_62",
1288
+ columnItem: oi,
1289
+ icon: ii,
1290
+ "action-buttons-container": "_action-buttons-container_1kgb8_74",
1291
+ actionButtonsContainer: li,
1292
+ reverse: ci,
1293
+ "action-button": "_action-button_1kgb8_74",
1294
+ actionButton: di
1295
+ }, jn = ({ show: e, onCancel: t, items: n, currentSelection: a, onSelectionChange: s, onSearchQueryChange: o, texts: i, itemsNameWidth: c, additionalColumns: l, displayIdAsName: u = !1, autoHideSearch: d = !1, allItemsLength: m, disabled: x, isLoading: v = !1, inputRef: h }) => {
1296
+ var We;
1297
+ const p = te(null), g = te(null), j = te(null), b = te(null), f = te(null), [y, N] = E(""), [k] = ra(y, 500), [, I] = E(!1), { copyToClipboard: D } = Es(), C = (We = h.current) == null ? void 0 : We.getBoundingClientRect(), L = (C == null ? void 0 : C.x) ?? 0, O = ((C == null ? void 0 : C.x) ?? 0) + ((C == null ? void 0 : C.width) ?? 0), _ = (C == null ? void 0 : C.y) ?? 0, W = ((C == null ? void 0 : C.y) ?? 0) + ((C == null ? void 0 : C.height) ?? 0), V = (C == null ? void 0 : C.width) ?? 0, X = (C == null ? void 0 : C.height) ?? 0, R = 5, $ = ne(() => L ? L > window.innerWidth / 2 : !1, [L]), P = ne(() => _ ? _ > window.innerHeight / 2 : !1, [_]);
1298
+ M(() => {
1299
+ var Y;
1300
+ e && ((Y = b.current) == null || Y.focus());
1301
+ }, [b, e]), M(() => {
1302
+ e || N("");
1303
+ }, [e]), M(() => {
1304
+ o(k);
1305
+ }, [k, o]);
1306
+ const [U, Z] = E(null);
1307
+ M(() => {
1308
+ e && n.length > 0 ? Z(0) : Z(null);
1309
+ }, [n, e]);
1310
+ const Q = ne(() => U !== null ? n.at(U) ?? null : null, [U, n]), F = S((Y, fe) => {
1311
+ var ze, tt;
1312
+ const _e = document.getElementById(`item-${Y}`);
1313
+ if (_e) {
1314
+ const T = _e.clientHeight ?? 0;
1315
+ fe === "down" ? (ze = f.current) == null || ze.scrollBy({
1316
+ left: 0,
1317
+ top: T,
1318
+ behavior: "smooth"
1319
+ }) : (tt = f.current) == null || tt.scrollBy({
1320
+ left: 0,
1321
+ top: -T,
1322
+ behavior: "smooth"
1323
+ });
1324
+ }
1325
+ }, []), ee = S((Y) => {
1326
+ if (U === null || x)
1327
+ return;
1328
+ const fe = U + Y;
1329
+ fe < 0 || fe >= n.length || Z((_e) => (_e !== null && F(_e, Y > 0 ? "down" : "up"), fe));
1330
+ }, [U, n, x, F]), A = S((Y) => {
1331
+ if (e)
1332
+ switch (Y.key) {
1333
+ case "Escape":
1334
+ Y.stopPropagation(), Y.preventDefault(), t();
1335
+ break;
1336
+ case "Enter":
1337
+ Y.stopPropagation(), Y.preventDefault(), x || s(Q);
1338
+ break;
1339
+ case "ArrowUp":
1340
+ Y.stopPropagation(), Y.preventDefault(), ee(-1);
1341
+ break;
1342
+ case "ArrowDown":
1343
+ Y.stopPropagation(), Y.preventDefault(), ee(1);
1344
+ break;
1345
+ }
1346
+ }, [t, e, ee, Q, x, s]), z = S(() => {
1347
+ I((Y) => !Y);
1348
+ }, []);
1349
+ M(() => (window.addEventListener("scroll", z), () => {
1350
+ window.removeEventListener("scroll", z);
1351
+ }), [z]), M(() => (window.addEventListener("resize", z), () => {
1352
+ window.removeEventListener("resize", z);
1353
+ }), [z]), _r(A), Nr([p, g, j], t);
1354
+ const me = c ?? (l && l.length > 0 ? 250 : 0), G = (l == null ? void 0 : l.reduce((Y, fe) => Y + (fe.width ?? 100), 0)) ?? 0, pe = `calc(max(${V}px, ${me}px + ${G}px))`, Ne = ne(() => (a && e && !x) ?? !1, [a, e, x]), Ie = ne(() => (a && e) ?? !1, [a, e]);
1355
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1356
+ /* @__PURE__ */ r.jsx(oa, { show: e, onClick: t }),
1357
+ /* @__PURE__ */ r.jsxs("div", { className: w("luminus-dropdown-picker-actions", be.actionButtonsContainer, {
1358
+ [be.reverse]: $
1359
+ }), style: {
1360
+ top: `calc(${_}px + ${X / 2}px - 12px)`,
1361
+ left: $ ? Ne && Ie ? `calc(${L}px - 24px - 8px - 24px - 4px)` : `calc(${L}px - 24px - 8px)` : `calc(${O}px + 8px)`
1362
+ }, children: [
1363
+ Ne && /* @__PURE__ */ r.jsx("button", { ref: g, type: "button", className: w("luminus-dropdown-picker-clear-button", be.actionButton), onClick: () => !x && s(null), children: /* @__PURE__ */ r.jsx(J, { variant: "caption", className: "text-danger", children: /* @__PURE__ */ r.jsx(hr, { size: 16 }) }) }),
1364
+ Ie && /* @__PURE__ */ r.jsx("button", { ref: j, type: "button", className: w("luminus-dropdown-picker-copy-button", be.actionButton), onClick: () => {
1365
+ var Y, fe;
1366
+ D(u ? ((Y = a == null ? void 0 : a.id) == null ? void 0 : Y.toString()) ?? "" : ((fe = a == null ? void 0 : a.name) == null ? void 0 : fe.toString()) ?? ""), t();
1367
+ }, children: /* @__PURE__ */ r.jsx(J, { variant: "caption", className: "text-info", children: /* @__PURE__ */ r.jsx(es, { size: 16 }) }) })
1368
+ ] }),
1369
+ /* @__PURE__ */ r.jsx("div", { className: w("luminus-dropdown-picker", be.wrapper, {
1370
+ [be.open]: e
1371
+ }), style: {
1372
+ top: P ? `calc(${_}px - 50vh - 8px)` : `calc(${W}px + 8px)`,
1373
+ left: $ ? `calc(${O}px - ${pe})` : L,
1374
+ right: $ ? `${O}px` : `calc(${L}px + ${pe})`,
1375
+ width: pe,
1376
+ justifyContent: P ? "flex-end" : "flex-start"
1377
+ }, children: /* @__PURE__ */ r.jsx("div", { ref: p, className: w("shadow rounded", be.dropdown), children: !x && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1378
+ d && (m ?? n.length) <= R ? null : /* @__PURE__ */ r.jsx("div", { className: w("search-input-container border-bottom", be.searchInputContainer), children: /* @__PURE__ */ r.jsx(ye.Control, { ref: b, type: "search", size: "sm", className: be.searchInput, placeholder: i.searchPlaceholder, value: y, onChange: (Y) => {
1379
+ var fe;
1380
+ return N(((fe = Y.target) == null ? void 0 : fe.value) ?? "");
1381
+ } }) }),
1382
+ v ? /* @__PURE__ */ r.jsx("div", { className: be.loadingContainer, children: /* @__PURE__ */ r.jsx(vn, { animation: "border", variant: "primary" }) }) : n.length > 0 && /* @__PURE__ */ r.jsxs("div", { ref: f, className: w("items", be.itemsContainer), children: [
1383
+ l && l.length > 0 && /* @__PURE__ */ r.jsxs("div", { className: w("header-row border-bottom", be.headerRow), children: [
1384
+ /* @__PURE__ */ r.jsx("div", { className: be.name }),
1385
+ l == null ? void 0 : l.map((Y) => /* @__PURE__ */ r.jsx("div", { className: be.columnItem, style: {
1386
+ width: `${Y.width ?? 100}px`,
1387
+ minWidth: `${Y.width ?? 100}px`,
1388
+ maxWidth: `${Y.width ?? 100}px`
1389
+ }, children: /* @__PURE__ */ r.jsx(J, { variant: "caption", children: Y.name }) }, Y.key))
1390
+ ] }),
1391
+ n == null ? void 0 : n.map((Y, fe) => /* @__PURE__ */ r.jsxs("button", { id: `item-${fe}`, type: "button", className: w("item cursor-pointer", be.item, {
1392
+ [be.focused]: U === fe
1393
+ }, {
1394
+ focused: U === fe
1395
+ }), onClick: () => !x && s(Y), onMouseEnter: () => Z(fe), children: [
1396
+ /* @__PURE__ */ r.jsx("div", { className: be.name, children: /* @__PURE__ */ r.jsx(J, { variant: "body2", children: u ? Y.id : Y.name }) }),
1397
+ l == null ? void 0 : l.map((_e) => /* @__PURE__ */ r.jsx("div", { className: be.columnItem, style: {
1398
+ width: `${_e.width ?? 100}px`,
1399
+ minWidth: `${_e.width ?? 100}px`,
1400
+ maxWidth: `${_e.width ?? 100}px`
1401
+ }, children: /* @__PURE__ */ r.jsx(J, { variant: "caption", className: w("text-muted"), children: Y.additionalColumns && Y.additionalColumns[_e.key] }) }, _e.key))
1402
+ ] }, Y.id))
1403
+ ] })
1404
+ ] }) }) })
1405
+ ] });
1406
+ }, rd = ({ color: e = "primary", icon: t = /* @__PURE__ */ r.jsx(mr, { size: 12 }), inputId: n = "context-file-input", accept: a = "*", onUpload: s, multiple: o, className: i, children: c, ...l }) => {
1407
+ const u = (d) => {
1408
+ d.target.files && (s(d.target.files), d.target.value = "");
1409
+ };
1410
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1411
+ /* @__PURE__ */ r.jsxs("label", { htmlFor: n, className: w(`btn luminus-dropdown-item text-nowrap rounded text-${e} ${i ?? ""}`, ts.item), ...l, children: [
1412
+ t,
1413
+ c
1414
+ ] }),
1415
+ /* @__PURE__ */ r.jsx("input", { id: n, type: "file", accept: a, onChange: u, hidden: !0, multiple: o })
1416
+ ] });
1417
+ }, ui = "_divider_1e6rk_1", fi = {
1418
+ divider: ui
1419
+ }, ad = ({ className: e }) => /* @__PURE__ */ r.jsx(ns.Divider, { className: w("luminus-dropdown-divider", e, fi.divider) }), mi = ({ searchTypes: e, selectedType: t, setSelectedType: n }) => /* @__PURE__ */ r.jsx(dn, { toggle: /* @__PURE__ */ r.jsx(un, { as: pr, icon: null, text: t == null ? void 0 : t.text }), children: e.map((a) => /* @__PURE__ */ r.jsx(Qe, { icon: null, onClick: () => n(a.key), children: a.text }, a.key)) }), hi = "_dropdown_1ddrg_1", gi = "_open_1ddrg_12", pi = "_loading-container_1ddrg_15", xi = "_groups-container_1ddrg_22", vi = "_group_1ddrg_22", ji = "_header_1ddrg_26", yi = "_item_1ddrg_33", Ue = {
1420
+ dropdown: hi,
1421
+ open: gi,
1422
+ "loading-container": "_loading-container_1ddrg_15",
1423
+ loadingContainer: pi,
1424
+ "groups-container": "_groups-container_1ddrg_22",
1425
+ groupsContainer: xi,
1426
+ group: vi,
1427
+ header: ji,
1428
+ item: yi
1429
+ }, bi = ({ show: e, query: t, onCancel: n, groups: a, isLoading: s, searchTypes: o }) => {
1430
+ const { texts: { appSearch: i } } = q(ge), c = te(null), l = S((u) => {
1431
+ var m;
1432
+ const d = (m = o.find((x) => x.key === u.type)) == null ? void 0 : m.toPath;
1433
+ return d ? `${d}/${u.searchKey}` : "/not-found";
1434
+ }, [o]);
1435
+ return Nr([c], n), /* @__PURE__ */ r.jsx("div", { ref: c, className: w("luminus-app-search-dropdown shadow rounded", Ue.dropdown, {
1436
+ [Ue.open]: e
1437
+ }), children: s ? /* @__PURE__ */ r.jsx("div", { className: Ue.loadingContainer, children: /* @__PURE__ */ r.jsx(vn, { animation: "border", variant: "primary" }) }) : /* @__PURE__ */ r.jsx("div", { className: Ue.groupsContainer, children: a == null ? void 0 : a.map((u) => {
1438
+ var d;
1439
+ return /* @__PURE__ */ r.jsxs("div", { className: w(Ue.group), children: [
1440
+ /* @__PURE__ */ r.jsxs(Ze, { to: `/search?query=${t}&type=${u.key.category}`, className: w("group-header", Ue.header), onClick: n, children: [
1441
+ /* @__PURE__ */ r.jsx(J, { variant: "body", className: "text-primary", children: u.key.categoryName }),
1442
+ /* @__PURE__ */ r.jsxs(J, { variant: "caption", children: [
1443
+ u.items.length,
1444
+ " ",
1445
+ i.amountFrom,
1446
+ " ",
1447
+ u.key.totalCount
1448
+ ] })
1449
+ ] }),
1450
+ (d = u.items) == null ? void 0 : d.map((m, x) => /* @__PURE__ */ r.jsxs(
1451
+ Ze,
1452
+ {
1453
+ to: l(m),
1454
+ className: w("search-item d-flex gap-3 align-items-center justify-content-between", Ue.item),
1455
+ onClick: n,
1456
+ children: [
1457
+ /* @__PURE__ */ r.jsx(J, { variant: "body2", className: "text-nowrap text-truncate", children: m.name }),
1458
+ /* @__PURE__ */ r.jsx(J, { variant: "caption", className: "text-primary", children: /* @__PURE__ */ r.jsx(rs, {}) })
1459
+ ]
1460
+ },
1461
+ x
1462
+ ))
1463
+ ] }, u.key.category);
1464
+ }) }) });
1465
+ }, wi = "_input-group_1lkfy_1", _i = "_input-group-text_1lkfy_5", Ni = "_left_1lkfy_9", Ci = "_right_1lkfy_13", Si = "_input_1lkfy_1", ki = "_submit-button_1lkfy_20", Ge = {
1466
+ "input-group": "_input-group_1lkfy_1",
1467
+ inputGroup: wi,
1468
+ "input-group-text": "_input-group-text_1lkfy_5",
1469
+ inputGroupText: _i,
1470
+ left: Ni,
1471
+ right: Ci,
1472
+ input: Si,
1473
+ "submit-button": "_submit-button_1lkfy_20",
1474
+ submitButton: ki
1475
+ }, Ii = (e, t) => {
1476
+ const n = Je(), [a, s] = E(!1), [o, i] = E([]), c = !e || !e.key, l = S(() => {
1477
+ if (t.length < 3) {
1478
+ i([]);
1479
+ return;
1480
+ }
1481
+ s(!0), n.get(`/search/${t}?count=${c ? 5 : 20}${c ? "" : `&type=${e.key}`}`).then(({ data: u }) => {
1482
+ i(u), s(!1);
1483
+ }).catch(() => {
1484
+ s(!1);
1485
+ });
1486
+ }, [e, t, n, c]);
1487
+ return M(() => {
1488
+ l();
1489
+ }, [l]), { isLoading: a, searchItems: o };
1490
+ }, sd = ({ searchTypes: e, navigateFunction: t, currentPath: n }) => {
1491
+ var p;
1492
+ const { texts: { appSearch: a } } = q(ge), [s, o] = E(e.length > 0 ? ((p = e.at(0)) == null ? void 0 : p.key) ?? null : null), i = ne(() => e.find((g) => g.key === s) ?? null, [e, s]), [c, l] = E(""), [u, d] = ra(c, 500), { isLoading: m, searchItems: x } = Ii(i, u), [v, h] = E(!1);
1493
+ return M(() => {
1494
+ (x.length > 0 || m) && h(!0);
1495
+ }, [x, m]), M(() => {
1496
+ l("");
1497
+ }, [n]), /* @__PURE__ */ r.jsx(ye, { onSubmit: (g) => {
1498
+ g.preventDefault(), g.stopPropagation(), d.flush(), h(!1), c.length > 2 && t(`/search?query=${c}${i && i.key && `&type=${i == null ? void 0 : i.key}`}`);
1499
+ }, children: /* @__PURE__ */ r.jsxs(Nt, { className: Ge.inputGroup, children: [
1500
+ /* @__PURE__ */ r.jsx(Nt.Text, { className: w("p-1 rounded", Ge.inputGroupText, Ge.left), children: /* @__PURE__ */ r.jsx(mi, { searchTypes: e, selectedType: i, setSelectedType: o }) }),
1501
+ /* @__PURE__ */ r.jsx(ye.Control, { placeholder: a.searchPlaceholder, type: "text", size: "sm", className: w("luminus-app-search-input", Ge.input), value: c, onChange: (g) => {
1502
+ var j;
1503
+ return l(((j = g.target) == null ? void 0 : j.value) ?? "");
1504
+ }, onFocus: () => x.length > 0 && h(!0) }),
1505
+ /* @__PURE__ */ r.jsx(Nt.Text, { className: w("p-0 rounded", Ge.inputGroupText, Ge.right), children: /* @__PURE__ */ r.jsx("button", { type: "submit", className: w("text-primary", Ge.submitButton), children: /* @__PURE__ */ r.jsx(as, {}) }) }),
1506
+ /* @__PURE__ */ r.jsx(bi, { query: u, searchTypes: e, show: v, onCancel: () => h(!1), groups: x, isLoading: m })
1507
+ ] }) });
1508
+ }, Di = "_card_19733_1", $i = "_header_19733_6", Fi = "_header-content_19733_13", Oi = "_title_19733_19", Ei = "_collapse-icon_19733_22", Ti = "_collapsed_19733_27", Li = "_content_19733_30", Ye = {
1509
+ card: Di,
1510
+ header: $i,
1511
+ "header-content": "_header-content_19733_13",
1512
+ headerContent: Fi,
1513
+ title: Oi,
1514
+ "collapse-icon": "_collapse-icon_19733_22",
1515
+ collapseIcon: Ei,
1516
+ collapsed: Ti,
1517
+ content: Li
1518
+ }, Ri = ({ title: e, headerContent: t, children: n, className: a, headerClassName: s, contentClassName: o, dontRenderIfNoChildren: i, ...c }) => {
1519
+ const l = c.collapsible ? c.controlled ? !1 : c.defaultOpen ?? !1 : !0, [u, d] = E(l), m = c.collapsible ? c.controlled ? c.isOpen : u : !0;
1520
+ M(() => {
1521
+ d(l);
1522
+ }, [l]);
1523
+ const x = ne(() => !n || !n.toString() || n.toString().split(",").filter((v) => v && v !== "false").length === 0, [n]);
1524
+ return i && x ? null : /* @__PURE__ */ r.jsxs("div", { className: w("luminus-card rounded shadow-sm", Ye.card, {
1525
+ [a ?? ""]: a
1526
+ }), children: [
1527
+ /* @__PURE__ */ r.jsxs("div", { role: c.collapsible ? "button" : void 0, className: w("header", Ye.header, {
1528
+ [s ?? ""]: s
1529
+ }), onClick: () => {
1530
+ c.collapsible && (c.controlled ? c.onToggle(!c.isOpen) : d(!u));
1531
+ }, children: [
1532
+ /* @__PURE__ */ r.jsxs("div", { className: w("header-content", Ye.headerContent), children: [
1533
+ /* @__PURE__ */ r.jsx(J, { variant: "h6", className: w("text-primary", Ye.title), children: e }),
1534
+ t ?? null
1535
+ ] }),
1536
+ c.collapsible && /* @__PURE__ */ r.jsx(gr, { className: w(Ye.collapseIcon, {
1537
+ [Ye.collapsed]: m
1538
+ }) })
1539
+ ] }),
1540
+ /* @__PURE__ */ r.jsx(kr, { in: m, children: /* @__PURE__ */ r.jsx("div", { className: w("card-content border-top border-primary", Ye.content, {
1541
+ [o ?? ""]: o
1542
+ }), children: n }) })
1543
+ ] });
1544
+ };
1545
+ var Ai = !!(typeof window < "u" && window.document && window.document.createElement), Mi = /* @__PURE__ */ function() {
1546
+ function e(t, n) {
1547
+ for (var a = 0; a < n.length; a++) {
1548
+ var s = n[a];
1549
+ s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(t, s.key, s);
1550
+ }
1551
+ }
1552
+ return function(t, n, a) {
1553
+ return n && e(t.prototype, n), a && e(t, a), t;
1554
+ };
1555
+ }();
1556
+ function Vi(e, t) {
1557
+ if (!(e instanceof t))
1558
+ throw new TypeError("Cannot call a class as a function");
1559
+ }
1560
+ function Bi(e, t) {
1561
+ if (!e)
1562
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1563
+ return t && (typeof t == "object" || typeof t == "function") ? t : e;
1564
+ }
1565
+ function Pi(e, t) {
1566
+ if (typeof t != "function" && t !== null)
1567
+ throw new TypeError("Super expression must either be null or a function, not " + typeof t);
1568
+ e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
1569
+ }
1570
+ var aa = function(e) {
1571
+ Pi(t, e);
1572
+ function t() {
1573
+ return Vi(this, t), Bi(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments));
1574
+ }
1575
+ return Mi(t, [{
1576
+ key: "componentWillUnmount",
1577
+ value: function() {
1578
+ this.defaultNode && document.body.removeChild(this.defaultNode), this.defaultNode = null;
1579
+ }
1580
+ }, {
1581
+ key: "render",
1582
+ value: function() {
1583
+ return Ai ? (!this.props.node && !this.defaultNode && (this.defaultNode = document.createElement("div"), document.body.appendChild(this.defaultNode)), It.createPortal(this.props.children, this.props.node || this.defaultNode)) : null;
1584
+ }
1585
+ }]), t;
1586
+ }(Ce.Component);
1587
+ aa.propTypes = {
1588
+ children: St.node.isRequired,
1589
+ node: St.any
1590
+ };
1591
+ var Hi = /* @__PURE__ */ function() {
1592
+ function e(t, n) {
1593
+ for (var a = 0; a < n.length; a++) {
1594
+ var s = n[a];
1595
+ s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(t, s.key, s);
1596
+ }
1597
+ }
1598
+ return function(t, n, a) {
1599
+ return n && e(t.prototype, n), a && e(t, a), t;
1600
+ };
1601
+ }();
1602
+ function Wi(e, t) {
1603
+ if (!(e instanceof t))
1604
+ throw new TypeError("Cannot call a class as a function");
1605
+ }
1606
+ function zi(e, t) {
1607
+ if (!e)
1608
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1609
+ return t && (typeof t == "object" || typeof t == "function") ? t : e;
1610
+ }
1611
+ function Ui(e, t) {
1612
+ if (typeof t != "function" && t !== null)
1613
+ throw new TypeError("Super expression must either be null or a function, not " + typeof t);
1614
+ e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
1615
+ }
1616
+ var sa = function(e) {
1617
+ Ui(t, e);
1618
+ function t() {
1619
+ return Wi(this, t), zi(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments));
1620
+ }
1621
+ return Hi(t, [{
1622
+ key: "componentDidMount",
1623
+ value: function() {
1624
+ this.renderPortal();
1625
+ }
1626
+ }, {
1627
+ key: "componentDidUpdate",
1628
+ value: function(a) {
1629
+ this.renderPortal();
1630
+ }
1631
+ }, {
1632
+ key: "componentWillUnmount",
1633
+ value: function() {
1634
+ It.unmountComponentAtNode(this.defaultNode || this.props.node), this.defaultNode && document.body.removeChild(this.defaultNode), this.defaultNode = null, this.portal = null;
1635
+ }
1636
+ }, {
1637
+ key: "renderPortal",
1638
+ value: function(a) {
1639
+ !this.props.node && !this.defaultNode && (this.defaultNode = document.createElement("div"), document.body.appendChild(this.defaultNode));
1640
+ var s = this.props.children;
1641
+ typeof this.props.children.type == "function" && (s = Ce.cloneElement(this.props.children)), this.portal = It.unstable_renderSubtreeIntoContainer(this, s, this.props.node || this.defaultNode);
1642
+ }
1643
+ }, {
1644
+ key: "render",
1645
+ value: function() {
1646
+ return null;
1647
+ }
1648
+ }]), t;
1649
+ }(Ce.Component);
1650
+ sa.propTypes = {
1651
+ children: St.node.isRequired,
1652
+ node: St.any
1653
+ };
1654
+ var rn = void 0;
1655
+ It.createPortal ? rn = aa : rn = sa;
1656
+ const Gi = "_lightbox_14acg_1", Yi = "_show_14acg_16", Ki = "_header_14acg_20", qi = "_photo-actions_14acg_26", Qi = "_photo-container_14acg_31", Zi = "_photo_14acg_26", Ji = "_nav-button_14acg_41", Xi = "_photos-preview_14acg_49", el = "_selected_14acg_62", tl = "_default-indicator_14acg_66", ke = {
1657
+ lightbox: Gi,
1658
+ show: Yi,
1659
+ header: Ki,
1660
+ "photo-actions": "_photo-actions_14acg_26",
1661
+ photoActions: qi,
1662
+ "photo-container": "_photo-container_14acg_31",
1663
+ photoContainer: Qi,
1664
+ photo: Zi,
1665
+ "nav-button": "_nav-button_14acg_41",
1666
+ navButton: Ji,
1667
+ "photos-preview": "_photos-preview_14acg_49",
1668
+ photosPreview: Xi,
1669
+ selected: el,
1670
+ "default-indicator": "_default-indicator_14acg_66",
1671
+ defaultIndicator: tl
1672
+ }, nl = "_backdrop_3huvf_1", rl = "_show_3huvf_11", Hn = {
1673
+ backdrop: nl,
1674
+ show: rl
1675
+ }, oa = ({ show: e, onClick: t }) => /* @__PURE__ */ r.jsx("div", { className: w("luminus-backdrop", Hn.backdrop, {
1676
+ [Hn.show]: e
1677
+ }), onClick: () => t && t() }), ia = ({ src: e, alt: t, baseUrl: n, customToken: a, placeholder: s, ...o }) => /* @__PURE__ */ r.jsx("img", { ...o, alt: t ?? "", src: e ?? s }), al = ({ show: e, onClose: t, photos: n, defaultIndex: a, uploadPhotosText: s, noPhotosText: o, onUploadPhotos: i, photoActions: c, baseUrl: l, customToken: u, placeholder: d, ImgComponent: m = ia }) => {
1678
+ const x = te(null), [v, h] = E(a), p = n.at(v), g = v > 0, j = v < n.length - 1;
1679
+ M(() => {
1680
+ e && h(a);
1681
+ }, [a, e]), M(() => {
1682
+ v >= n.length && h(n.length - 1);
1683
+ }, [n, v]);
1684
+ const b = S((f) => {
1685
+ switch (f.key) {
1686
+ case "ArrowLeft":
1687
+ f.stopPropagation(), g && h((y) => y - 1);
1688
+ break;
1689
+ case "ArrowRight":
1690
+ f.stopPropagation(), j && h((y) => y + 1);
1691
+ break;
1692
+ case "Escape":
1693
+ f.stopPropagation(), t();
1694
+ break;
1695
+ }
1696
+ }, [j, g, t]);
1697
+ return _r(b), /* @__PURE__ */ r.jsxs(rn, { children: [
1698
+ /* @__PURE__ */ r.jsx(oa, { show: e, onClick: t }),
1699
+ /* @__PURE__ */ r.jsxs("div", { ref: x, className: w("luminus-lightbox rounded shadow", ke.lightbox, {
1700
+ [ke.show]: e
1701
+ }), children: [
1702
+ /* @__PURE__ */ r.jsxs("div", { className: ke.header, children: [
1703
+ /* @__PURE__ */ r.jsxs("div", { className: w("rounded", ke.photoActions), children: [
1704
+ i && /* @__PURE__ */ r.jsx(na, { accept: ".jpg,.jpeg,.png", onUpload: (f) => {
1705
+ f.length > 0 && i(Array.from(f));
1706
+ }, icon: /* @__PURE__ */ r.jsx(xr, { style: { fontSize: 18 } }), multiple: !0, className: "me-3", children: s ?? null }),
1707
+ p && (c == null ? void 0 : c.map(({ label: f, onClick: y, ...N }, k) => /* @__PURE__ */ r.jsx(
1708
+ ot,
1709
+ {
1710
+ onClick: () => y(p.id),
1711
+ ...N,
1712
+ children: f
1713
+ },
1714
+ `action-${k}`
1715
+ )))
1716
+ ] }),
1717
+ /* @__PURE__ */ r.jsx("div", { role: "button", onClick: t, children: /* @__PURE__ */ r.jsx(Oe, { style: { fontSize: "32px" } }) })
1718
+ ] }),
1719
+ n.length === 0 && /* @__PURE__ */ r.jsx("div", { className: "w-100 h-100 d-flex align-items-center justify-content-center", children: /* @__PURE__ */ r.jsx(J, { variant: "body", children: o ?? "No photos available" }) }),
1720
+ p && /* @__PURE__ */ r.jsxs("div", { className: ke.photoContainer, children: [
1721
+ /* @__PURE__ */ r.jsx("div", { role: g ? "button" : void 0, className: w("align-items-start", ke.navButton), onClick: () => g && h((f) => f - 1), children: g && /* @__PURE__ */ r.jsx(ln, { style: { fontSize: "40px" } }) }),
1722
+ /* @__PURE__ */ r.jsx(m, { src: p.lgSrc, alt: p.alt, className: w("rounded", ke.photo), baseUrl: l, customToken: u, placeholder: d }),
1723
+ /* @__PURE__ */ r.jsx("div", { role: j ? "button" : void 0, className: w("align-items-end", ke.navButton), onClick: () => j && h((f) => f + 1), children: j && /* @__PURE__ */ r.jsx(cn, { style: { fontSize: "40px" } }) })
1724
+ ] }),
1725
+ /* @__PURE__ */ r.jsx("div", { className: ke.photosPreview, children: n.map((f, y) => /* @__PURE__ */ r.jsxs("div", { role: "button", onClick: () => h(y), className: "position-relative", children: [
1726
+ /* @__PURE__ */ r.jsx(m, { role: y !== v ? "button" : void 0, src: f.smSrc, alt: f.alt, className: w("rounded", ke.photo, {
1727
+ [ke.selected]: y === v
1728
+ }), baseUrl: l, customToken: u, placeholder: d }, f.id),
1729
+ f.isDefault && /* @__PURE__ */ r.jsx("div", { className: w("text-primary", ke.defaultIndicator), children: /* @__PURE__ */ r.jsx(ss, {}) })
1730
+ ] })) })
1731
+ ] })
1732
+ ] });
1733
+ }, sl = ({ photos: e, onUploadPhotos: t, uploadPhotosText: n, photoActions: a, baseUrl: s, customToken: o, placeholder: i, ImgComponent: c = ia }) => {
1734
+ const [l, u] = E(null), d = l !== null ? e[l] : null, [m, x] = E(!1);
1735
+ return M(() => {
1736
+ if (e.length === 0) {
1737
+ u(null), x(!1);
1738
+ return;
1739
+ }
1740
+ const v = e.findIndex((h) => h.isDefault);
1741
+ u(v > -1 ? v : 0);
1742
+ }, [e]), d ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1743
+ /* @__PURE__ */ r.jsx(c, { role: "button", src: d.smSrc, alt: d.alt, className: "rounded w-100", onClick: () => x(!0), baseUrl: s, customToken: o, placeholder: i }),
1744
+ /* @__PURE__ */ r.jsx(al, { show: m, onClose: () => x(!1), photos: e, defaultIndex: l ?? 0, uploadPhotosText: n, onUploadPhotos: t, photoActions: a, baseUrl: s, customToken: o, placeholder: i, ImgComponent: c })
1745
+ ] }) : t ? /* @__PURE__ */ r.jsx(na, { accept: ".jpg,.jpeg,.png", onUpload: (v) => {
1746
+ v.length > 0 && t(Array.from(v));
1747
+ }, icon: /* @__PURE__ */ r.jsx(xr, { style: { fontSize: 18 } }), multiple: !0, children: n ?? null }) : null;
1748
+ }, od = ({ children: e }) => {
1749
+ var c, l, u;
1750
+ const { useMsal: t, msalScopes: n } = q(os), { isAuthenticated: a } = is(), { userLoginState: s } = q(Ot), o = s.state === ls.LOGGING_IN, i = s.user && ((c = s.user) == null ? void 0 : c.permissions) && ((u = (l = s.user) == null ? void 0 : l.permissions) == null ? void 0 : u.length) > 0;
1751
+ return t ? /* @__PURE__ */ r.jsx(Ds, { interactionType: Is.Redirect, authenticationRequest: { scopes: n }, children: o || !a() ? /* @__PURE__ */ r.jsx(kn, {}) : s.user ? i ? /* @__PURE__ */ r.jsx(r.Fragment, { children: e }) : /* @__PURE__ */ r.jsx(wt, { to: "/user-not-permitted", replace: !0 }) : /* @__PURE__ */ r.jsx(wt, { to: "/no-user-login", replace: !0 }) }) : o ? /* @__PURE__ */ r.jsx(kn, {}) : !a() || !s.user ? /* @__PURE__ */ r.jsx(wt, { to: "/login", replace: !0 }) : i ? e : /* @__PURE__ */ r.jsx(wt, { to: "/user-not-permitted", replace: !0 });
1752
+ }, la = (e) => {
1753
+ const { variant: t, children: n, className: a, size: s = "md", typographyVariant: o = s === "sm" ? "body2" : "body", ...i } = { ...e };
1754
+ return /* @__PURE__ */ r.jsx(qs, { variant: t, className: `text-center ${s === "sm" ? "p-1" : s === "md" ? "p-3" : "p-4"} bg-${t} bg-opacity-10 border-none ${a ?? ""}`, ...i, children: /* @__PURE__ */ r.jsx(J, { variant: o, children: n }) });
1755
+ }, ol = "_item_1lf6j_1", il = "_level-success_1lf6j_4", ll = "_level-info_1lf6j_10", cl = "_level-warning_1lf6j_16", dl = "_level-danger_1lf6j_22", ul = "_type-icon_1lf6j_28", Ut = {
1756
+ item: ol,
1757
+ "level-success": "_level-success_1lf6j_4",
1758
+ levelSuccess: il,
1759
+ "level-info": "_level-info_1lf6j_10",
1760
+ levelInfo: ll,
1761
+ "level-warning": "_level-warning_1lf6j_16",
1762
+ levelWarning: cl,
1763
+ "level-danger": "_level-danger_1lf6j_22",
1764
+ levelDanger: dl,
1765
+ "type-icon": "_type-icon_1lf6j_28",
1766
+ typeIcon: ul
1767
+ }, fl = ({ level: e, children: t, customIcon: n, noIcon: a }) => {
1768
+ const { ProjectIconComponent: s } = q(ge), o = S(() => {
1769
+ switch (e) {
1770
+ case "info":
1771
+ return /* @__PURE__ */ r.jsx(s, { icon: "info" });
1772
+ case "warning":
1773
+ return /* @__PURE__ */ r.jsx(s, { icon: "warning" });
1774
+ case "danger":
1775
+ return /* @__PURE__ */ r.jsx(s, { icon: "danger" });
1776
+ default:
1777
+ return /* @__PURE__ */ r.jsx(s, { icon: "check" });
1778
+ }
1779
+ }, [s, e]);
1780
+ return /* @__PURE__ */ r.jsxs("div", { className: w("p-2 rounded d-flex gap-1 align-items-center justify-content-between", { "ps-1": !a }, Ut.item, Ut[`level-${e}`]), children: [
1781
+ !a && /* @__PURE__ */ r.jsx("div", { className: w(Ut.typeIcon), children: n ?? o() }),
1782
+ /* @__PURE__ */ r.jsx(J, { variant: "body2", className: "w-100", children: t })
1783
+ ] });
1784
+ }, id = ({ version: e }) => /* @__PURE__ */ r.jsx("div", { className: "rounded", style: {
1785
+ position: "fixed",
1786
+ right: "0px",
1787
+ bottom: "0px",
1788
+ zIndex: "10000",
1789
+ backgroundColor: "rgba(255, 255, 255, 0.5)",
1790
+ padding: "4px",
1791
+ pointerEvents: "all"
1792
+ }, children: /* @__PURE__ */ r.jsxs(J, { variant: "caption", className: "w-100 text-end", children: [
1793
+ "verze ",
1794
+ e
1795
+ ] }) }), ml = "_submit-container_a9slg_1", hl = "_spacer_a9slg_14", Wn = {
1796
+ "submit-container": "_submit-container_a9slg_1",
1797
+ submitContainer: ml,
1798
+ spacer: hl
1799
+ }, gl = ({ children: e, noSpacer: t = !1 }) => /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1800
+ !t && /* @__PURE__ */ r.jsx("div", { className: Wn.spacer }),
1801
+ /* @__PURE__ */ r.jsx("div", { className: w("luminus-floating-action-container shadow", Wn.submitContainer), children: e })
1802
+ ] }), pl = "_timeline_g1754_1", xl = "_step-container_g1754_1", vl = "_step-date_g1754_1", jl = "_step-content_g1754_4", yl = "_content-header_g1754_8", bl = "_content-text_g1754_11", wl = "_step-icon_g1754_14", Ke = {
1803
+ timeline: pl,
1804
+ "step-container": "_step-container_g1754_1",
1805
+ stepContainer: xl,
1806
+ "step-date": "_step-date_g1754_1",
1807
+ stepDate: vl,
1808
+ "step-content": "_step-content_g1754_4",
1809
+ stepContent: jl,
1810
+ "content-header": "_content-header_g1754_8",
1811
+ contentHeader: yl,
1812
+ "content-text": "_content-text_g1754_11",
1813
+ contentText: bl,
1814
+ "step-icon": "_step-icon_g1754_14",
1815
+ stepIcon: wl
1816
+ }, ld = ({ steps: e }) => /* @__PURE__ */ r.jsx("div", { className: Ke.timeline, children: e.sort((t, n) => Ps(t.date ?? /* @__PURE__ */ new Date(), n.date ?? /* @__PURE__ */ new Date())).map((t, n) => /* @__PURE__ */ r.jsxs("div", { className: w("row g-0 gx-3", Ke.stepContainer), children: [
1817
+ /* @__PURE__ */ r.jsx("div", { className: "col-3", children: t.date && /* @__PURE__ */ r.jsxs(J, { variant: "caption", className: w("h-100 d-flex flex-column align-items-end justify-content-center gap-0", Ke.stepDate), children: [
1818
+ /* @__PURE__ */ r.jsx("div", { children: xt(t.date, "dd.MM.yyyy") }),
1819
+ /* @__PURE__ */ r.jsx("div", { children: xt(t.date, "HH:mm") })
1820
+ ] }) }),
1821
+ /* @__PURE__ */ r.jsx("div", { className: "col-9", children: /* @__PURE__ */ r.jsxs("div", { className: w("h-100 d-flex flex-column gap-1 border-start border-2 p-3", Ke.stepContent), children: [
1822
+ /* @__PURE__ */ r.jsxs("div", { className: w("d-flex gap-2 align-items-center", Ke.contentHeader), children: [
1823
+ t.person && /* @__PURE__ */ r.jsx(vr, { name: t.person.name ?? "", size: 22, fontSize: 12 }),
1824
+ typeof t.title == "string" ? /* @__PURE__ */ r.jsx(J, { variant: "body", className: "fw-bold", children: t.title }) : t.title
1825
+ ] }),
1826
+ t.text && /* @__PURE__ */ r.jsx(J, { variant: "body2", className: Ke.contentText, children: t.text }),
1827
+ /* @__PURE__ */ r.jsx("div", { className: w("text-primary", Ke.stepIcon), children: t.icon ?? /* @__PURE__ */ r.jsx(cs, {}) })
1828
+ ] }) })
1829
+ ] }, n)) }), _l = (e, t, n, a = !0) => {
1830
+ const s = Je({ silent: a, differentBaseUrl: t, customToken: n }), [o, i] = E(!1), [c, l] = E(null), u = S(async (d) => {
1831
+ i(!0), l(null), s.get(e, {
1832
+ signal: d,
1833
+ responseType: "blob"
1834
+ }).then((m) => {
1835
+ i(!1), l(m.data);
1836
+ }).catch(() => {
1837
+ i(!1), l(null);
1838
+ });
1839
+ }, [s, e]);
1840
+ return M(() => {
1841
+ const d = new AbortController();
1842
+ return u(d.signal), () => {
1843
+ d.abort();
1844
+ };
1845
+ }, [u]), { data: c, setData: l, reloadData: u, isLoading: o };
1846
+ }, zn = ({ src: e, alt: t, baseUrl: n, customToken: a, placeholder: s, ...o }) => {
1847
+ const { data: i } = _l(e, n, a), [c, l] = E(null);
1848
+ return M(() => {
1849
+ let u = null;
1850
+ return i !== null ? (u = URL.createObjectURL(i), l(u)) : l(null), () => {
1851
+ u !== null && URL.revokeObjectURL(u);
1852
+ };
1853
+ }, [i]), c === null && !s ? null : /* @__PURE__ */ r.jsx("img", { ...o, alt: t ?? "", src: c ?? s });
1854
+ }, ca = ({ currentSelection: e, selectedItemNavigateTo: t, children: n }) => {
1855
+ if (!e || !e.id || !t)
1856
+ return /* @__PURE__ */ r.jsx("div", { className: "luminus-input-container position-relative w-100", children: n });
1857
+ const a = t(e);
1858
+ return /* @__PURE__ */ r.jsx(Ze, { to: a, className: "luminus-input-container position-relative w-100 text-decoration-none", children: n });
1859
+ }, da = ({ InputContainer: e = Xe, label: t, value: n, onChange: a, hidden: s, disabled: o, className: i, type: c, withoutLabel: l, indeterminate: u }) => {
1860
+ const d = te(null);
1861
+ return M(() => {
1862
+ d.current && (d.current.indeterminate = u ?? !1);
1863
+ }, [d, u]), /* @__PURE__ */ r.jsx(e, { isForCheckInput: !0, hidden: s, label: t ?? "", withoutLabel: l, className: i, children: /* @__PURE__ */ r.jsx(ye.Check, { ref: d, id: `check-${t}`, type: c ?? "checkbox", label: t ?? "", checked: n, onChange: (m) => {
1864
+ var x;
1865
+ a && a(((x = m.target) == null ? void 0 : x.checked) ?? !1);
1866
+ }, className: i ?? "", hidden: s ?? !1, disabled: o ?? !1 }) });
1867
+ }, at = ({ InputContainer: e = Xe, type: t, value: n, onChange: a, debounceMs: s, label: o, withoutLabel: i, placeholder: c, size: l, hidden: u, disabled: d, showClearIcon: m, clearValue: x, list: v, className: h, step: p, noSelectOnFocus: g }) => {
1868
+ const j = t === "number", b = S(() => {
1869
+ if (!a)
1870
+ return;
1871
+ const O = x ?? null;
1872
+ a(j ? O ? Number(O) : null : (O == null ? void 0 : O.toString()) ?? "");
1873
+ }, [x, j, a]), f = te(null), [y, N] = E((n == null ? void 0 : n.toString()) ?? ""), k = S((O) => {
1874
+ const _ = O;
1875
+ a && (j && a(_ == null || _ === "" ? null : Number(_)), a(_ || null));
1876
+ }, [j, a]), I = S((O) => {
1877
+ var W;
1878
+ const _ = (W = O.target) == null ? void 0 : W.value;
1879
+ if (!s) {
1880
+ k(_);
1881
+ return;
1882
+ }
1883
+ N(_), f.current !== null && window.clearTimeout(f.current), f.current = window.setTimeout(() => {
1884
+ k(_);
1885
+ }, s);
1886
+ }, [s, k]);
1887
+ M(() => {
1888
+ N(n === null ? "" : n.toString());
1889
+ }, [n]);
1890
+ const [D, C] = E(!1), L = ds(t, n ? n.toString() ?? null : null, D);
1891
+ return /* @__PURE__ */ r.jsxs(e, { withoutLabel: i, label: o ?? "", hidden: u, className: h, children: [
1892
+ /* @__PURE__ */ r.jsx(ye.Control, { type: L, placeholder: c ?? o, size: l, value: s ? y : (n == null ? void 0 : n.toString()) ?? "", onChange: I, className: h ?? "", hidden: u, disabled: d ?? !1, list: v, onFocus: (O) => {
1893
+ C(!0), !g && O.target.select();
1894
+ }, onBlur: () => C(!1), step: p }),
1895
+ m && n !== null && a && !d && /* @__PURE__ */ r.jsx("div", { className: `luminus-input-remove-icon ${t !== "text" ? "inset" : ""}`, children: /* @__PURE__ */ r.jsx(re, { color: "secondary", size: "sm", onClick: b, children: /* @__PURE__ */ r.jsx(Oe, {}) }) })
1896
+ ] });
1897
+ }, Dt = ({
1898
+ InputContainer: e = Xe,
1899
+ value: t,
1900
+ options: n,
1901
+ onChange: a,
1902
+ label: s,
1903
+ withoutLabel: o,
1904
+ isNumber: i,
1905
+ size: c,
1906
+ hidden: l,
1907
+ disabled: u,
1908
+ showClearIcon: d,
1909
+ clearValue: m,
1910
+ noSortOptions: x,
1911
+ className: v,
1912
+ noEmptyOption: h
1913
+ // it will still add the empty option if there is no value provided or value is empty string or null
1914
+ }) => {
1915
+ const p = S(() => {
1916
+ if (!a)
1917
+ return;
1918
+ const g = m ?? null;
1919
+ a(i ? g ? Number(g) : null : (g == null ? void 0 : g.toString()) ?? "");
1920
+ }, [m, i, a]);
1921
+ return /* @__PURE__ */ r.jsxs(e, { withoutLabel: o, label: s ?? "", hidden: l, className: v, children: [
1922
+ /* @__PURE__ */ r.jsxs(ye.Select, { size: c, value: t ?? "", onChange: (g) => {
1923
+ var b;
1924
+ if (!a)
1925
+ return;
1926
+ const j = (b = g.target) == null ? void 0 : b.value;
1927
+ i && a(j ? parseInt(j, 10) : null), a(j || null);
1928
+ }, className: v ?? "", hidden: l, disabled: u ?? !1, children: [
1929
+ !h && /* @__PURE__ */ r.jsx("option", { value: "" }),
1930
+ n == null ? void 0 : n.sort((g, j) => x ? 0 : (g.name ?? "").localeCompare(j.name ?? "")).map((g) => /* @__PURE__ */ r.jsx("option", { value: g.id ?? "", children: g.name }, g.id))
1931
+ ] }),
1932
+ d && t && a && !u && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon inset", children: /* @__PURE__ */ r.jsx(re, { color: "secondary", size: "sm", onClick: p, children: /* @__PURE__ */ r.jsx(Oe, {}) }) })
1933
+ ] });
1934
+ }, cd = ({ InputContainer: e = Xe, items: t, defaultSelection: n, selectedItemNavigateTo: a, onSearchQueryChange: s, texts: o, isLoading: i, isNumber: c, onSelect: l, label: u, withoutLabel: d, size: m, dropdownItemsNameWidth: x, additionalColumns: v, hidden: h, disabled: p, displayIdAsName: g, CustomOnChangeComponent: j, className: b }) => {
1935
+ var _, W;
1936
+ const [f, y] = E(n), [N, k] = E(!1);
1937
+ M(() => {
1938
+ y(n);
1939
+ }, [n]);
1940
+ const I = S((V) => {
1941
+ y(V);
1942
+ }, []), D = S((V) => {
1943
+ k(!1), I(V);
1944
+ }, [I]);
1945
+ M(() => {
1946
+ l && l(f);
1947
+ }, [f, l]);
1948
+ const C = te(null), L = a !== void 0, O = L && f !== null;
1949
+ return /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(e, { withoutLabel: d, label: u ?? "", hidden: h, inputContainerClassName: w({ "luminus-dropdown-select-open": N }), className: b, children: [
1950
+ /* @__PURE__ */ r.jsxs(ca, { currentSelection: f, selectedItemNavigateTo: a, children: [
1951
+ g && (f == null ? void 0 : f.name) && /* @__PURE__ */ r.jsx(J, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: f.name }),
1952
+ /* @__PURE__ */ r.jsxs(ye.Select, { ref: C, size: m, value: (f == null ? void 0 : f.id) ?? "", onChange: (V) => y({
1953
+ id: c ? Number(V.target.value) ?? null : V.target.value,
1954
+ name: ""
1955
+ }), onMouseDown: (V) => {
1956
+ V.currentTarget.focus(), V.preventDefault();
1957
+ }, onClick: () => {
1958
+ !L && !p && k(!0);
1959
+ }, className: w("w-100", {
1960
+ "luminus-dropdown-picker-disabled": p,
1961
+ "luminus-dropdown-picker-link": O
1962
+ }), hidden: h, children: [
1963
+ /* @__PURE__ */ r.jsx("option", { value: "" }),
1964
+ n && /* @__PURE__ */ r.jsx("option", { value: n.id ?? void 0, children: n.name && ((_ = n.name) == null ? void 0 : _.length) > 0 ? n.name : n.id }),
1965
+ f && /* @__PURE__ */ r.jsx("option", { value: f.id ?? void 0, children: f.name && ((W = f.name) == null ? void 0 : W.length) > 0 ? f.name : f.id })
1966
+ ] }),
1967
+ j || !p && L ? /* @__PURE__ */ r.jsxs("div", { className: "custom-picker-button", children: [
1968
+ !j && !p && L && /* @__PURE__ */ r.jsx(re, { size: "sm", color: "secondary", onClick: (V) => {
1969
+ V.preventDefault(), V.stopPropagation(), k(!0);
1970
+ }, children: /* @__PURE__ */ r.jsx(jr, {}) }),
1971
+ j ?? null
1972
+ ] }) : null
1973
+ ] }),
1974
+ C.current && /* @__PURE__ */ r.jsx(jn, { show: N, onCancel: () => k(!1), items: t, currentSelection: f, onSelectionChange: D, onSearchQueryChange: s, texts: o, itemsNameWidth: x, additionalColumns: v, isLoading: i, disabled: p, inputRef: C })
1975
+ ] }) });
1976
+ }, dd = ({ InputContainer: e = Xe, value: t, onChange: n, label: a, size: s, showClearIcon: o, clearValue: i, hidden: c, disabled: l, rows: u, withoutLabel: d, debounceMs: m, className: x }) => {
1977
+ const v = S(() => {
1978
+ if (!n)
1979
+ return;
1980
+ const f = i ?? null;
1981
+ n((f == null ? void 0 : f.toString()) ?? "");
1982
+ }, [i, n]), h = te(null), [p, g] = E((t == null ? void 0 : t.toString()) ?? ""), j = S((f) => {
1983
+ const y = f;
1984
+ n && n(y || null);
1985
+ }, [n]), b = S((f) => {
1986
+ var N;
1987
+ const y = (N = f.target) == null ? void 0 : N.value;
1988
+ if (!m) {
1989
+ j(y);
1990
+ return;
1991
+ }
1992
+ g(y), h.current !== null && window.clearTimeout(h.current), h.current = window.setTimeout(() => {
1993
+ j(y);
1994
+ }, m);
1995
+ }, [m, j]);
1996
+ return M(() => {
1997
+ g(t === null ? "" : t.toString());
1998
+ }, [t]), /* @__PURE__ */ r.jsxs(e, { label: a ?? "", hidden: c, withoutLabel: d, className: x, isForTextAreaInput: !0, children: [
1999
+ /* @__PURE__ */ r.jsx(ye.Control, { as: "textarea", size: s, value: m ? p : t ?? "", onChange: b, hidden: c, disabled: l, rows: u ?? 2, className: "w-100" }),
2000
+ o && t && n && !l && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(re, { color: "secondary", size: "sm", onClick: v, children: /* @__PURE__ */ r.jsx(Oe, {}) }) })
2001
+ ] });
2002
+ }, ud = ({ InputContainer: e = Xe, value: t, onChange: n, debounceMs: a, label: s, withoutLabel: o, placeholder: i, size: c, hidden: l, disabled: u, showClearIcon: d, clearValue: m, className: x, step: v, stepperStep: h = 1, min: p, max: g }) => {
2003
+ const j = S(() => {
2004
+ if (!n)
2005
+ return;
2006
+ const I = m ?? null;
2007
+ n(I ? Number(I) : null);
2008
+ }, [m, n]), b = te(null), [f, y] = E((t == null ? void 0 : t.toString()) ?? ""), N = S((I) => {
2009
+ const D = I;
2010
+ n && n(D == null || D === "" ? null : ht(Number(D), p, g));
2011
+ }, [g, p, n]), k = S((I) => {
2012
+ var C;
2013
+ const D = (C = I.target) == null ? void 0 : C.value;
2014
+ if (!a) {
2015
+ N(D);
2016
+ return;
2017
+ }
2018
+ y(ht(Number(D), p, g).toString()), b.current !== null && window.clearTimeout(b.current), b.current = window.setTimeout(() => {
2019
+ N(D);
2020
+ }, a);
2021
+ }, [a, N, g, p]);
2022
+ return M(() => {
2023
+ y(t === null ? "" : ht(t, p, g).toString());
2024
+ }, [g, p, t]), /* @__PURE__ */ r.jsx(e, { withoutLabel: o, label: s ?? "", hidden: l, className: x, children: /* @__PURE__ */ r.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
2025
+ /* @__PURE__ */ r.jsx(ye.Control, { type: "number", placeholder: i ?? s, size: c, value: a ? f : t ?? "", onChange: k, className: `luminus-numeric-stepper ${x ?? ""}`, hidden: l, disabled: u ?? !1, step: v }),
2026
+ /* @__PURE__ */ r.jsx("div", { className: "stepper-icon left", children: !u && /* @__PURE__ */ r.jsx(re, { size: "sm", onClick: (I) => {
2027
+ I.preventDefault(), I.stopPropagation(), N(((t ?? 0) - h).toString());
2028
+ }, children: /* @__PURE__ */ r.jsx(yr, {}) }) }),
2029
+ /* @__PURE__ */ r.jsx("div", { className: "stepper-icon right", children: !u && /* @__PURE__ */ r.jsx(re, { size: "sm", onClick: (I) => {
2030
+ I.preventDefault(), I.stopPropagation(), N(((t ?? 0) + h).toString());
2031
+ }, children: /* @__PURE__ */ r.jsx(br, {}) }) }),
2032
+ d && t && n && !u && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(re, { color: "secondary", size: "sm", onClick: j, children: /* @__PURE__ */ r.jsx(Oe, {}) }) })
2033
+ ] }) });
2034
+ };
2035
+ function ua(e, t) {
2036
+ var n = {};
2037
+ for (var a in e)
2038
+ Object.prototype.hasOwnProperty.call(e, a) && t.indexOf(a) < 0 && (n[a] = e[a]);
2039
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
2040
+ for (var s = 0, a = Object.getOwnPropertySymbols(e); s < a.length; s++)
2041
+ t.indexOf(a[s]) < 0 && Object.prototype.propertyIsEnumerable.call(e, a[s]) && (n[a[s]] = e[a[s]]);
2042
+ return n;
2043
+ }
2044
+ var jt;
2045
+ (function(e) {
2046
+ e.event = "event", e.props = "prop";
2047
+ })(jt || (jt = {}));
2048
+ function Me() {
2049
+ }
2050
+ function Nl(e) {
2051
+ var t, n = void 0;
2052
+ return function() {
2053
+ for (var a = [], s = arguments.length; s--; ) a[s] = arguments[s];
2054
+ return t && a.length === t.length && a.every(function(o, i) {
2055
+ return o === t[i];
2056
+ }) || (t = a, n = e.apply(void 0, a)), n;
2057
+ };
2058
+ }
2059
+ function yt(e) {
2060
+ return !!(e || "").match(/\d/);
2061
+ }
2062
+ function st(e) {
2063
+ return e == null;
2064
+ }
2065
+ function Cl(e) {
2066
+ return typeof e == "number" && isNaN(e);
2067
+ }
2068
+ function fa(e) {
2069
+ return st(e) || Cl(e) || typeof e == "number" && !isFinite(e);
2070
+ }
2071
+ function ma(e) {
2072
+ return e.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
2073
+ }
2074
+ function Sl(e) {
2075
+ switch (e) {
2076
+ case "lakh":
2077
+ return /(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;
2078
+ case "wan":
2079
+ return /(\d)(?=(\d{4})+(?!\d))/g;
2080
+ case "thousand":
2081
+ default:
2082
+ return /(\d)(?=(\d{3})+(?!\d))/g;
2083
+ }
2084
+ }
2085
+ function kl(e, t, n) {
2086
+ var a = Sl(n), s = e.search(/[1-9]/);
2087
+ return s = s === -1 ? e.length : s, e.substring(0, s) + e.substring(s, e.length).replace(a, "$1" + t);
2088
+ }
2089
+ function Il(e) {
2090
+ var t = te(e);
2091
+ t.current = e;
2092
+ var n = te(function() {
2093
+ for (var a = [], s = arguments.length; s--; ) a[s] = arguments[s];
2094
+ return t.current.apply(t, a);
2095
+ });
2096
+ return n.current;
2097
+ }
2098
+ function yn(e, t) {
2099
+ t === void 0 && (t = !0);
2100
+ var n = e[0] === "-", a = n && t;
2101
+ e = e.replace("-", "");
2102
+ var s = e.split("."), o = s[0], i = s[1] || "";
2103
+ return {
2104
+ beforeDecimal: o,
2105
+ afterDecimal: i,
2106
+ hasNegation: n,
2107
+ addNegation: a
2108
+ };
2109
+ }
2110
+ function Dl(e) {
2111
+ if (!e)
2112
+ return e;
2113
+ var t = e[0] === "-";
2114
+ t && (e = e.substring(1, e.length));
2115
+ var n = e.split("."), a = n[0].replace(/^0+/, "") || "0", s = n[1] || "";
2116
+ return (t ? "-" : "") + a + (s ? "." + s : "");
2117
+ }
2118
+ function ha(e, t, n) {
2119
+ for (var a = "", s = n ? "0" : "", o = 0; o <= t - 1; o++)
2120
+ a += e[o] || s;
2121
+ return a;
2122
+ }
2123
+ function Un(e, t) {
2124
+ return Array(t + 1).join(e);
2125
+ }
2126
+ function ga(e) {
2127
+ var t = e + "", n = t[0] === "-" ? "-" : "";
2128
+ n && (t = t.substring(1));
2129
+ var a = t.split(/[eE]/g), s = a[0], o = a[1];
2130
+ if (o = Number(o), !o)
2131
+ return n + s;
2132
+ s = s.replace(".", "");
2133
+ var i = 1 + o, c = s.length;
2134
+ return i < 0 ? s = "0." + Un("0", Math.abs(i)) + s : i >= c ? s = s + Un("0", i - c) : s = (s.substring(0, i) || "0") + "." + s.substring(i), n + s;
2135
+ }
2136
+ function Gn(e, t, n) {
2137
+ if (["", "-"].indexOf(e) !== -1)
2138
+ return e;
2139
+ var a = (e.indexOf(".") !== -1 || n) && t, s = yn(e), o = s.beforeDecimal, i = s.afterDecimal, c = s.hasNegation, l = parseFloat("0." + (i || "0")), u = i.length <= t ? "0." + i : l.toFixed(t), d = u.split("."), m = o;
2140
+ o && Number(d[0]) && (m = o.split("").reverse().reduce(function(p, g, j) {
2141
+ return p.length > j ? (Number(p[0]) + Number(g)).toString() + p.substring(1, p.length) : g + p;
2142
+ }, d[0]));
2143
+ var x = ha(d[1] || "", t, n), v = c ? "-" : "", h = a ? "." : "";
2144
+ return "" + v + m + h + x;
2145
+ }
2146
+ function qe(e, t) {
2147
+ if (e.value = e.value, e !== null) {
2148
+ if (e.createTextRange) {
2149
+ var n = e.createTextRange();
2150
+ return n.move("character", t), n.select(), !0;
2151
+ }
2152
+ return e.selectionStart || e.selectionStart === 0 ? (e.focus(), e.setSelectionRange(t, t), !0) : (e.focus(), !1);
2153
+ }
2154
+ }
2155
+ var pa = Nl(function(e, t) {
2156
+ for (var n = 0, a = 0, s = e.length, o = t.length; e[n] === t[n] && n < s; )
2157
+ n++;
2158
+ for (; e[s - 1 - a] === t[o - 1 - a] && o - a > n && s - a > n; )
2159
+ a++;
2160
+ return {
2161
+ from: { start: n, end: s - a },
2162
+ to: { start: n, end: o - a }
2163
+ };
2164
+ }), $l = function(e, t) {
2165
+ var n = Math.min(e.selectionStart, t);
2166
+ return {
2167
+ from: { start: n, end: e.selectionEnd },
2168
+ to: { start: n, end: t }
2169
+ };
2170
+ };
2171
+ function Fl(e, t, n) {
2172
+ return Math.min(Math.max(e, t), n);
2173
+ }
2174
+ function Gt(e) {
2175
+ return Math.max(e.selectionStart, e.selectionEnd);
2176
+ }
2177
+ function Ol() {
2178
+ return typeof navigator < "u" && !(navigator.platform && /iPhone|iPod/.test(navigator.platform));
2179
+ }
2180
+ function El(e) {
2181
+ return {
2182
+ from: {
2183
+ start: 0,
2184
+ end: 0
2185
+ },
2186
+ to: {
2187
+ start: 0,
2188
+ end: e.length
2189
+ },
2190
+ lastValue: ""
2191
+ };
2192
+ }
2193
+ function Tl(e) {
2194
+ var t = e.currentValue, n = e.formattedValue, a = e.currentValueIndex, s = e.formattedValueIndex;
2195
+ return t[a] === n[s];
2196
+ }
2197
+ function Ll(e, t, n, a, s, o, i) {
2198
+ i === void 0 && (i = Tl);
2199
+ var c = s.findIndex(function(y) {
2200
+ return y;
2201
+ }), l = e.slice(0, c);
2202
+ !t && !n.startsWith(l) && (t = l, n = l + n, a = a + l.length);
2203
+ for (var u = n.length, d = e.length, m = {}, x = new Array(u), v = 0; v < u; v++) {
2204
+ x[v] = -1;
2205
+ for (var h = 0, p = d; h < p; h++) {
2206
+ var g = i({
2207
+ currentValue: n,
2208
+ lastValue: t,
2209
+ formattedValue: e,
2210
+ currentValueIndex: v,
2211
+ formattedValueIndex: h
2212
+ });
2213
+ if (g && m[h] !== !0) {
2214
+ x[v] = h, m[h] = !0;
2215
+ break;
2216
+ }
2217
+ }
2218
+ }
2219
+ for (var j = a; j < u && (x[j] === -1 || !o(n[j])); )
2220
+ j++;
2221
+ var b = j === u || x[j] === -1 ? d : x[j];
2222
+ for (j = a - 1; j > 0 && x[j] === -1; )
2223
+ j--;
2224
+ var f = j === -1 || x[j] === -1 ? 0 : x[j] + 1;
2225
+ return f > b ? b : a - f < b - a ? f : b;
2226
+ }
2227
+ function Yn(e, t, n, a) {
2228
+ var s = e.length;
2229
+ if (t = Fl(t, 0, s), a === "left") {
2230
+ for (; t >= 0 && !n[t]; )
2231
+ t--;
2232
+ t === -1 && (t = n.indexOf(!0));
2233
+ } else {
2234
+ for (; t <= s && !n[t]; )
2235
+ t++;
2236
+ t > s && (t = n.lastIndexOf(!0));
2237
+ }
2238
+ return t === -1 && (t = s), t;
2239
+ }
2240
+ function Rl(e) {
2241
+ for (var t = Array.from({ length: e.length + 1 }).map(function() {
2242
+ return !0;
2243
+ }), n = 0, a = t.length; n < a; n++)
2244
+ t[n] = !!(yt(e[n]) || yt(e[n - 1]));
2245
+ return t;
2246
+ }
2247
+ function xa(e, t, n, a, s, o) {
2248
+ o === void 0 && (o = Me);
2249
+ var i = Il(function(h, p) {
2250
+ var g, j;
2251
+ return fa(h) ? (j = "", g = "") : typeof h == "number" || p ? (j = typeof h == "number" ? ga(h) : h, g = a(j)) : (j = s(h, void 0), g = a(j)), { formattedValue: g, numAsString: j };
2252
+ }), c = E(function() {
2253
+ return i(st(e) ? t : e, n);
2254
+ }), l = c[0], u = c[1], d = function(h, p) {
2255
+ h.formattedValue !== l.formattedValue && u({
2256
+ formattedValue: h.formattedValue,
2257
+ numAsString: h.value
2258
+ }), o(h, p);
2259
+ }, m = e, x = n;
2260
+ st(e) && (m = l.numAsString, x = !0);
2261
+ var v = i(m, x);
2262
+ return ne(function() {
2263
+ u(v);
2264
+ }, [v.formattedValue]), [l, d];
2265
+ }
2266
+ function Al(e) {
2267
+ return e.replace(/[^0-9]/g, "");
2268
+ }
2269
+ function Ml(e) {
2270
+ return e;
2271
+ }
2272
+ function Vl(e) {
2273
+ var t = e.type;
2274
+ t === void 0 && (t = "text");
2275
+ var n = e.displayType;
2276
+ n === void 0 && (n = "input");
2277
+ var a = e.customInput, s = e.renderText, o = e.getInputRef, i = e.format;
2278
+ i === void 0 && (i = Ml);
2279
+ var c = e.removeFormatting;
2280
+ c === void 0 && (c = Al);
2281
+ var l = e.defaultValue, u = e.valueIsNumericString, d = e.onValueChange, m = e.isAllowed, x = e.onChange;
2282
+ x === void 0 && (x = Me);
2283
+ var v = e.onKeyDown;
2284
+ v === void 0 && (v = Me);
2285
+ var h = e.onMouseUp;
2286
+ h === void 0 && (h = Me);
2287
+ var p = e.onFocus;
2288
+ p === void 0 && (p = Me);
2289
+ var g = e.onBlur;
2290
+ g === void 0 && (g = Me);
2291
+ var j = e.value, b = e.getCaretBoundary;
2292
+ b === void 0 && (b = Rl);
2293
+ var f = e.isValidInputCharacter;
2294
+ f === void 0 && (f = yt);
2295
+ var y = e.isCharacterSame, N = ua(e, ["type", "displayType", "customInput", "renderText", "getInputRef", "format", "removeFormatting", "defaultValue", "valueIsNumericString", "onValueChange", "isAllowed", "onChange", "onKeyDown", "onMouseUp", "onFocus", "onBlur", "value", "getCaretBoundary", "isValidInputCharacter", "isCharacterSame"]), k = xa(j, l, !!u, i, c, d), I = k[0], D = I.formattedValue, C = I.numAsString, L = k[1], O = te(), _ = te({ formattedValue: D, numAsString: C }), W = function(T, B) {
2296
+ _.current = { formattedValue: T.formattedValue, numAsString: T.value }, L(T, B);
2297
+ }, V = E(!1), X = V[0], R = V[1], $ = te(null), P = te({
2298
+ setCaretTimeout: null,
2299
+ focusTimeout: null
2300
+ });
2301
+ M(function() {
2302
+ return R(!0), function() {
2303
+ clearTimeout(P.current.setCaretTimeout), clearTimeout(P.current.focusTimeout);
2304
+ };
2305
+ }, []);
2306
+ var U = i, Z = function(T, B) {
2307
+ var K = parseFloat(B);
2308
+ return {
2309
+ formattedValue: T,
2310
+ value: B,
2311
+ floatValue: isNaN(K) ? void 0 : K
2312
+ };
2313
+ }, Q = function(T, B, K) {
2314
+ T.selectionStart === 0 && T.selectionEnd === T.value.length || (qe(T, B), P.current.setCaretTimeout = setTimeout(function() {
2315
+ T.value === K && T.selectionStart !== B && qe(T, B);
2316
+ }, 0));
2317
+ }, F = function(T, B, K) {
2318
+ return Yn(T, B, b(T), K);
2319
+ }, ee = function(T, B, K) {
2320
+ var le = b(B), we = Ll(B, D, T, K, le, f, y);
2321
+ return we = Yn(B, we, le), we;
2322
+ }, A = function(T) {
2323
+ var B = T.formattedValue;
2324
+ B === void 0 && (B = "");
2325
+ var K = T.input, le = T.source, we = T.event, ce = T.numAsString, se;
2326
+ if (K) {
2327
+ var Se = T.inputValue || K.value, De = Gt(K);
2328
+ K.value = B, se = ee(Se, B, De), se !== void 0 && Q(K, se, B);
2329
+ }
2330
+ B !== D && W(Z(B, ce), { event: we, source: le });
2331
+ };
2332
+ M(function() {
2333
+ var T = _.current, B = T.formattedValue, K = T.numAsString;
2334
+ (D !== B || C !== K) && W(Z(D, C), {
2335
+ event: void 0,
2336
+ source: jt.props
2337
+ });
2338
+ }, [D, C]);
2339
+ var z = $.current ? Gt($.current) : void 0, me = typeof window < "u" ? ks : M;
2340
+ me(function() {
2341
+ var T = $.current;
2342
+ if (D !== _.current.formattedValue && T) {
2343
+ var B = ee(_.current.formattedValue, D, z);
2344
+ T.value = D, Q(T, B, D);
2345
+ }
2346
+ }, [D]);
2347
+ var G = function(T, B, K) {
2348
+ var le = B.target, we = O.current ? $l(O.current, le.selectionEnd) : pa(D, T), ce = Object.assign(Object.assign({}, we), { lastValue: D }), se = c(T, ce), Se = U(se);
2349
+ if (se = c(Se, void 0), m && !m(Z(Se, se))) {
2350
+ var De = B.target, H = Gt(De), ae = ee(T, D, H);
2351
+ return De.value = D, Q(De, ae, D), !1;
2352
+ }
2353
+ return A({
2354
+ formattedValue: Se,
2355
+ numAsString: se,
2356
+ inputValue: T,
2357
+ event: B,
2358
+ source: K,
2359
+ input: B.target
2360
+ }), !0;
2361
+ }, pe = function(T, B) {
2362
+ B === void 0 && (B = 0);
2363
+ var K = T.selectionStart, le = T.selectionEnd;
2364
+ O.current = { selectionStart: K, selectionEnd: le + B };
2365
+ }, Ne = function(T) {
2366
+ var B = T.target, K = B.value, le = G(K, T, jt.event);
2367
+ le && x(T), O.current = void 0;
2368
+ }, Ie = function(T) {
2369
+ var B = T.target, K = T.key, le = B.selectionStart, we = B.selectionEnd, ce = B.value;
2370
+ ce === void 0 && (ce = "");
2371
+ var se;
2372
+ K === "ArrowLeft" || K === "Backspace" ? se = Math.max(le - 1, 0) : K === "ArrowRight" ? se = Math.min(le + 1, ce.length) : K === "Delete" && (se = le);
2373
+ var Se = 0;
2374
+ K === "Delete" && le === we && (Se = 1);
2375
+ var De = K === "ArrowLeft" || K === "ArrowRight";
2376
+ if (se === void 0 || le !== we && !De) {
2377
+ v(T), pe(B, Se);
2378
+ return;
2379
+ }
2380
+ var H = se;
2381
+ if (De) {
2382
+ var ae = K === "ArrowLeft" ? "left" : "right";
2383
+ H = F(ce, se, ae), H !== se && T.preventDefault();
2384
+ } else K === "Delete" && !f(ce[se]) ? H = F(ce, se, "right") : K === "Backspace" && !f(ce[se]) && (H = F(ce, se, "left"));
2385
+ H !== se && Q(B, H, ce), v(T), pe(B, Se);
2386
+ }, We = function(T) {
2387
+ var B = T.target, K = function() {
2388
+ var le = B.selectionStart, we = B.selectionEnd, ce = B.value;
2389
+ if (ce === void 0 && (ce = ""), le === we) {
2390
+ var se = F(ce, le);
2391
+ se !== le && Q(B, se, ce);
2392
+ }
2393
+ };
2394
+ K(), requestAnimationFrame(function() {
2395
+ K();
2396
+ }), h(T), pe(B);
2397
+ }, Y = function(T) {
2398
+ T.persist && T.persist();
2399
+ var B = T.target, K = T.currentTarget;
2400
+ $.current = B, P.current.focusTimeout = setTimeout(function() {
2401
+ var le = B.selectionStart, we = B.selectionEnd, ce = B.value;
2402
+ ce === void 0 && (ce = "");
2403
+ var se = F(ce, le);
2404
+ se !== le && !(le === 0 && we === ce.length) && Q(B, se, ce), p(Object.assign(Object.assign({}, T), { currentTarget: K }));
2405
+ }, 0);
2406
+ }, fe = function(T) {
2407
+ $.current = null, clearTimeout(P.current.focusTimeout), clearTimeout(P.current.setCaretTimeout), g(T);
2408
+ }, _e = X && Ol() ? "numeric" : void 0, ze = Object.assign({ inputMode: _e }, N, {
2409
+ type: t,
2410
+ value: D,
2411
+ onChange: Ne,
2412
+ onKeyDown: Ie,
2413
+ onMouseUp: We,
2414
+ onFocus: Y,
2415
+ onBlur: fe
2416
+ });
2417
+ if (n === "text")
2418
+ return s ? Ce.createElement(Ce.Fragment, null, s(D, N) || null) : Ce.createElement("span", Object.assign({}, N, { ref: o }), D);
2419
+ if (a) {
2420
+ var tt = a;
2421
+ return Ce.createElement(tt, Object.assign({}, ze, { ref: o }));
2422
+ }
2423
+ return Ce.createElement("input", Object.assign({}, ze, { ref: o }));
2424
+ }
2425
+ function Kn(e, t) {
2426
+ var n = t.decimalScale, a = t.fixedDecimalScale, s = t.prefix;
2427
+ s === void 0 && (s = "");
2428
+ var o = t.suffix;
2429
+ o === void 0 && (o = "");
2430
+ var i = t.allowNegative, c = t.thousandsGroupStyle;
2431
+ if (c === void 0 && (c = "thousand"), e === "" || e === "-")
2432
+ return e;
2433
+ var l = Rt(t), u = l.thousandSeparator, d = l.decimalSeparator, m = n !== 0 && e.indexOf(".") !== -1 || n && a, x = yn(e, i), v = x.beforeDecimal, h = x.afterDecimal, p = x.addNegation;
2434
+ return n !== void 0 && (h = ha(h, n, !!a)), u && (v = kl(v, u, c)), s && (v = s + v), o && (h = h + o), p && (v = "-" + v), e = v + (m && d || "") + h, e;
2435
+ }
2436
+ function Rt(e) {
2437
+ var t = e.decimalSeparator;
2438
+ t === void 0 && (t = ".");
2439
+ var n = e.thousandSeparator, a = e.allowedDecimalSeparators;
2440
+ return n === !0 && (n = ","), a || (a = [t, "."]), {
2441
+ decimalSeparator: t,
2442
+ thousandSeparator: n,
2443
+ allowedDecimalSeparators: a
2444
+ };
2445
+ }
2446
+ function Bl(e, t) {
2447
+ e === void 0 && (e = "");
2448
+ var n = new RegExp("(-)"), a = new RegExp("(-)(.)*(-)"), s = n.test(e), o = a.test(e);
2449
+ return e = e.replace(/-/g, ""), s && !o && t && (e = "-" + e), e;
2450
+ }
2451
+ function Pl(e, t) {
2452
+ return new RegExp("(^-)|[0-9]|" + ma(e), "g");
2453
+ }
2454
+ function Hl(e, t, n) {
2455
+ return e === "" ? !0 : !(t != null && t.match(/\d/)) && !(n != null && n.match(/\d/)) && typeof e == "string" && !isNaN(Number(e));
2456
+ }
2457
+ function Wl(e, t, n) {
2458
+ var a;
2459
+ t === void 0 && (t = El(e));
2460
+ var s = n.allowNegative, o = n.prefix;
2461
+ o === void 0 && (o = "");
2462
+ var i = n.suffix;
2463
+ i === void 0 && (i = "");
2464
+ var c = n.decimalScale, l = t.from, u = t.to, d = u.start, m = u.end, x = Rt(n), v = x.allowedDecimalSeparators, h = x.decimalSeparator, p = e[m] === h;
2465
+ if (yt(e) && (e === o || e === i) && t.lastValue === "")
2466
+ return e;
2467
+ if (m - d === 1 && v.indexOf(e[d]) !== -1) {
2468
+ var g = c === 0 ? "" : h;
2469
+ e = e.substring(0, d) + g + e.substring(d + 1, e.length);
2470
+ }
2471
+ var j = function($, P, U) {
2472
+ var Z = !1, Q = !1;
2473
+ o.startsWith("-") ? Z = !1 : $.startsWith("--") ? (Z = !1, Q = !0) : i.startsWith("-") && $.length === i.length ? Z = !1 : $[0] === "-" && (Z = !0);
2474
+ var F = Z ? 1 : 0;
2475
+ return Q && (F = 2), F && ($ = $.substring(F), P -= F, U -= F), { value: $, start: P, end: U, hasNegation: Z };
2476
+ }, b = j(e, d, m), f = b.hasNegation;
2477
+ a = b, e = a.value, d = a.start, m = a.end;
2478
+ var y = j(t.lastValue, l.start, l.end), N = y.start, k = y.end, I = y.value, D = e.substring(d, m);
2479
+ e.length && I.length && (N > I.length - i.length || k < o.length) && !(D && i.startsWith(D)) && (e = I);
2480
+ var C = 0;
2481
+ e.startsWith(o) ? C += o.length : d < o.length && (C = d), e = e.substring(C), m -= C;
2482
+ var L = e.length, O = e.length - i.length;
2483
+ e.endsWith(i) ? L = O : (m > O || m > e.length - i.length) && (L = m), e = e.substring(0, L), e = Bl(f ? "-" + e : e, s), e = (e.match(Pl(h)) || []).join("");
2484
+ var _ = e.indexOf(h);
2485
+ e = e.replace(new RegExp(ma(h), "g"), function($, P) {
2486
+ return P === _ ? "." : "";
2487
+ });
2488
+ var W = yn(e, s), V = W.beforeDecimal, X = W.afterDecimal, R = W.addNegation;
2489
+ return u.end - u.start < l.end - l.start && V === "" && p && !parseFloat(X) && (e = R ? "-" : ""), e;
2490
+ }
2491
+ function zl(e, t) {
2492
+ var n = t.prefix;
2493
+ n === void 0 && (n = "");
2494
+ var a = t.suffix;
2495
+ a === void 0 && (a = "");
2496
+ var s = Array.from({ length: e.length + 1 }).map(function() {
2497
+ return !0;
2498
+ }), o = e[0] === "-";
2499
+ s.fill(!1, 0, n.length + (o ? 1 : 0));
2500
+ var i = e.length;
2501
+ return s.fill(!1, i - a.length + 1, i + 1), s;
2502
+ }
2503
+ function Ul(e) {
2504
+ var t = Rt(e), n = t.thousandSeparator, a = t.decimalSeparator, s = e.prefix;
2505
+ s === void 0 && (s = "");
2506
+ var o = e.allowNegative;
2507
+ if (o === void 0 && (o = !0), n === a)
2508
+ throw new Error(`
2509
+ Decimal separator can't be same as thousand separator.
2510
+ thousandSeparator: ` + n + ` (thousandSeparator = {true} is same as thousandSeparator = ",")
2511
+ decimalSeparator: ` + a + ` (default value for decimalSeparator is .)
2512
+ `);
2513
+ return s.startsWith("-") && o && (console.error(`
2514
+ Prefix can't start with '-' when allowNegative is true.
2515
+ prefix: ` + s + `
2516
+ allowNegative: ` + o + `
2517
+ `), o = !1), Object.assign(Object.assign({}, e), { allowNegative: o });
2518
+ }
2519
+ function Gl(e) {
2520
+ e = Ul(e), e.decimalSeparator, e.allowedDecimalSeparators, e.thousandsGroupStyle;
2521
+ var t = e.suffix, n = e.allowNegative, a = e.allowLeadingZeros, s = e.onKeyDown;
2522
+ s === void 0 && (s = Me);
2523
+ var o = e.onBlur;
2524
+ o === void 0 && (o = Me);
2525
+ var i = e.thousandSeparator, c = e.decimalScale, l = e.fixedDecimalScale, u = e.prefix;
2526
+ u === void 0 && (u = "");
2527
+ var d = e.defaultValue, m = e.value, x = e.valueIsNumericString, v = e.onValueChange, h = ua(e, ["decimalSeparator", "allowedDecimalSeparators", "thousandsGroupStyle", "suffix", "allowNegative", "allowLeadingZeros", "onKeyDown", "onBlur", "thousandSeparator", "decimalScale", "fixedDecimalScale", "prefix", "defaultValue", "value", "valueIsNumericString", "onValueChange"]), p = Rt(e), g = p.decimalSeparator, j = p.allowedDecimalSeparators, b = function(R) {
2528
+ return Kn(R, e);
2529
+ }, f = function(R, $) {
2530
+ return Wl(R, $, e);
2531
+ }, y = st(m) ? d : m, N = x ?? Hl(y, u, t);
2532
+ st(m) ? st(d) || (N = N || typeof d == "number") : N = N || typeof m == "number";
2533
+ var k = function(R) {
2534
+ return fa(R) ? R : (typeof R == "number" && (R = ga(R)), N && typeof c == "number" ? Gn(R, c, !!l) : R);
2535
+ }, I = xa(k(m), k(d), !!N, b, f, v), D = I[0], C = D.numAsString, L = D.formattedValue, O = I[1], _ = function(R) {
2536
+ var $ = R.target, P = R.key, U = $.selectionStart, Z = $.selectionEnd, Q = $.value;
2537
+ if (Q === void 0 && (Q = ""), (P === "Backspace" || P === "Delete") && Z < u.length) {
2538
+ R.preventDefault();
2539
+ return;
2540
+ }
2541
+ if (U !== Z) {
2542
+ s(R);
2543
+ return;
2544
+ }
2545
+ P === "Backspace" && Q[0] === "-" && U === u.length + 1 && n && qe($, 1), c && l && (P === "Backspace" && Q[U - 1] === g ? (qe($, U - 1), R.preventDefault()) : P === "Delete" && Q[U] === g && R.preventDefault()), j != null && j.includes(P) && Q[U] === g && qe($, U + 1);
2546
+ var F = i === !0 ? "," : i;
2547
+ P === "Backspace" && Q[U - 1] === F && qe($, U - 1), P === "Delete" && Q[U] === F && qe($, U + 1), s(R);
2548
+ }, W = function(R) {
2549
+ var $ = C;
2550
+ if ($.match(/\d/g) || ($ = ""), a || ($ = Dl($)), l && c && ($ = Gn($, c, l)), $ !== C) {
2551
+ var P = Kn($, e);
2552
+ O({
2553
+ formattedValue: P,
2554
+ value: $,
2555
+ floatValue: parseFloat($)
2556
+ }, {
2557
+ event: R,
2558
+ source: jt.event
2559
+ });
2560
+ }
2561
+ o(R);
2562
+ }, V = function(R) {
2563
+ return R === g ? !0 : yt(R);
2564
+ }, X = function(R) {
2565
+ var $ = R.currentValue, P = R.lastValue, U = R.formattedValue, Z = R.currentValueIndex, Q = R.formattedValueIndex, F = $[Z], ee = U[Q], A = pa(P, $), z = A.to;
2566
+ return Z >= z.start && Z < z.end && j && j.includes(F) && ee === g ? !0 : F === ee;
2567
+ };
2568
+ return Object.assign(Object.assign({}, h), {
2569
+ value: L,
2570
+ valueIsNumericString: !1,
2571
+ isValidInputCharacter: V,
2572
+ isCharacterSame: X,
2573
+ onValueChange: O,
2574
+ format: b,
2575
+ removeFormatting: f,
2576
+ getCaretBoundary: function(R) {
2577
+ return zl(R, e);
2578
+ },
2579
+ onKeyDown: _,
2580
+ onBlur: W
2581
+ });
2582
+ }
2583
+ function bn(e) {
2584
+ var t = Gl(e);
2585
+ return Ce.createElement(Vl, Object.assign({}, t));
2586
+ }
2587
+ const fd = ({ InputContainer: e = Xe, value: t, onChange: n, debounceMs: a, label: s, withoutLabel: o, placeholder: i, size: c, hidden: l, disabled: u, showClearIcon: d, clearValue: m, className: x, step: v, noSelectOnFocus: h, decimalScale: p, numberPrefix: g, numberSuffix: j, min: b, max: f }) => {
2588
+ const y = S(() => {
2589
+ if (!n)
2590
+ return;
2591
+ const L = m ?? null;
2592
+ n(L ? Number(L) : null);
2593
+ }, [m, n]), N = te(null), [k, I] = E((t == null ? void 0 : t.toString()) ?? ""), D = S((L) => {
2594
+ const O = L;
2595
+ n && n(O == null || O === "" ? null : Number(O));
2596
+ }, [n]), C = S((L) => {
2597
+ var _, W;
2598
+ let O = parseFloat(((W = (_ = L.target) == null ? void 0 : _.value) == null ? void 0 : W.replaceAll(" ", "")) ?? 0);
2599
+ if (Number.isNaN(O) && (O = 0), !a) {
2600
+ D(O.toString());
2601
+ return;
2602
+ }
2603
+ I(O.toString()), N.current !== null && window.clearTimeout(N.current), N.current = window.setTimeout(() => {
2604
+ D(O.toString());
2605
+ }, a);
2606
+ }, [a, D]);
2607
+ return M(() => {
2608
+ I(t === null ? "" : t.toString());
2609
+ }, [f, b, t]), M(() => {
2610
+ f !== void 0 && Number(k) > f && I(f.toString()), b !== void 0 && Number(k) < b && I(b.toString());
2611
+ }, [k, f, b, I]), M(() => {
2612
+ !n || t === null || (f !== void 0 && t > f && n(f), b !== void 0 && t < b && n(b));
2613
+ }, [t, f, b, n]), /* @__PURE__ */ r.jsxs(e, { withoutLabel: o, label: s ?? "", hidden: l, className: x, children: [
2614
+ /* @__PURE__ */ r.jsx(bn, { displayType: "input", thousandSeparator: " ", decimalScale: p, prefix: g, suffix: j, defaultValue: "", value: a ? k : (t == null ? void 0 : t.toString()) ?? "", placeholder: i ?? s, onFocus: (L) => {
2615
+ !h && L.target.select();
2616
+ }, onChange: C, hidden: l, disabled: u, className: w("form-control text-end w-100", {
2617
+ [`form-control-${c}`]: c
2618
+ }), step: v, min: b, max: f }),
2619
+ d && t !== null && n && !u && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon inset", children: /* @__PURE__ */ r.jsx(re, { color: "secondary", size: "sm", onClick: y, children: /* @__PURE__ */ r.jsx(Oe, {}) }) })
2620
+ ] });
2621
+ }, qn = [
2622
+ ["D", "day"],
2623
+ // ['W', 'week'],
2624
+ ["M", "month"],
2625
+ ["Y", "year"],
2626
+ ["C", "custom"]
2627
+ ], Yl = "_wrapper_qfqux_1", Kl = "_lg_qfqux_7", ql = "_sm_qfqux_11", Ql = "_md_qfqux_14", Qn = {
2628
+ wrapper: Yl,
2629
+ lg: Kl,
2630
+ sm: ql,
2631
+ md: Ql
2632
+ }, Ct = (e) => {
2633
+ const t = new Date(e), n = Be(t.toISOString());
2634
+ t.setMonth(t.getMonth() + 1), t.setDate(t.getDate() - 1);
2635
+ const a = Be(t.toISOString());
2636
+ return { from: n, to: a };
2637
+ }, gt = (e) => {
2638
+ const t = new Date(e), n = Be(t.toISOString());
2639
+ t.setFullYear(t.getFullYear() + 1), t.setDate(t.getDate() - 1);
2640
+ const a = Be(t.toISOString());
2641
+ return { from: n, to: a };
2642
+ }, Zl = (e, t) => {
2643
+ if (e === null || t === null)
2644
+ return "C";
2645
+ if (e === t)
2646
+ return "D";
2647
+ const n = new Date(e);
2648
+ return Ct(n).to === t ? "M" : gt(n).to === t ? "Y" : (console.log(gt(n), t), "C");
2649
+ }, Jl = (e, t, n) => {
2650
+ const a = S((i, c) => {
2651
+ if (e === "C") {
2652
+ n((l) => ({ ...l, [i]: c }));
2653
+ return;
2654
+ }
2655
+ switch (i) {
2656
+ case "from":
2657
+ n((l) => {
2658
+ if (c === null)
2659
+ return l;
2660
+ const u = new Date(c);
2661
+ if (e === "D") {
2662
+ const d = Be(u.toISOString());
2663
+ return {
2664
+ from: d,
2665
+ to: d
2666
+ };
2667
+ }
2668
+ return e === "M" ? Ct(u) : e === "Y" ? gt(u) : l;
2669
+ });
2670
+ break;
2671
+ case "to":
2672
+ t("C"), n((l) => ({ ...l, [i]: c }));
2673
+ break;
2674
+ }
2675
+ }, [e, n, t]), s = S((i) => {
2676
+ n((c) => {
2677
+ if (c.from === null || c.to === null)
2678
+ return c;
2679
+ const l = new Date(c.from);
2680
+ l.setHours(l.getHours() - l.getTimezoneOffset() / 60);
2681
+ const u = new Date(c.to);
2682
+ if (e === "D") {
2683
+ l.setDate(l.getDate() + i);
2684
+ const d = Be(l.toISOString());
2685
+ return {
2686
+ from: d,
2687
+ to: d
2688
+ };
2689
+ }
2690
+ return e === "M" ? (l.setMonth(l.getMonth() + i), Ct(l)) : e === "Y" ? (l.setFullYear(l.getFullYear() + i), gt(l)) : {
2691
+ from: Be(l.toISOString()),
2692
+ to: Be(u.toISOString())
2693
+ };
2694
+ });
2695
+ }, [e, n]), o = S((i) => {
2696
+ i === "D" ? n((c) => ({ from: c.from, to: c.from })) : i === "M" ? n((c) => {
2697
+ if (c.from === null)
2698
+ return c;
2699
+ const l = us(c.from);
2700
+ return Ct(l);
2701
+ }) : i === "Y" && n((c) => {
2702
+ if (c.from === null)
2703
+ return c;
2704
+ const l = fs(new Date(c.from).getFullYear());
2705
+ return gt(l);
2706
+ }), t(i);
2707
+ }, [n, t]);
2708
+ return { setFromToProp: a, handleArrowClick: s, handleRangeChange: o };
2709
+ }, md = ({ fromtoState: [e, t], className: n, size: a }) => {
2710
+ const { texts: { date: s }, ProjectIconComponent: o } = q(ge), [i, c] = E("C"), { handleArrowClick: l, handleRangeChange: u, setFromToProp: d } = Jl(i, c, t), m = ne(() => i === "C", [i]), x = te(!0);
2711
+ return M(() => {
2712
+ if (x.current) {
2713
+ const v = Zl(e.from, e.to);
2714
+ c(v), x.current = !1;
2715
+ }
2716
+ }, [e.from, e.to]), /* @__PURE__ */ r.jsxs("div", { className: w("d-inline-flex align-items-center gap-1", Qn.wrapper, Qn[a ?? "md"], n), children: [
2717
+ /* @__PURE__ */ r.jsx(re, { disabled: m, onClick: () => {
2718
+ l(-1);
2719
+ }, children: /* @__PURE__ */ r.jsx(o, { icon: "chevron-left" }) }),
2720
+ /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-center gap-1", children: [
2721
+ /* @__PURE__ */ r.jsx(at, { type: "date", value: e.from, onChange: (v) => d("from", v === null ? null : v.toString()), InputContainer: Fe, size: a }),
2722
+ /* @__PURE__ */ r.jsx(dn, { toggle: /* @__PURE__ */ r.jsx(un, { text: s[qn.find((v) => v[0] === i)[1]].substring(0, 1), as: ms }), children: qn.map((v) => /* @__PURE__ */ r.jsx(Qe, { disabled: v[0] === i, className: w(v[0] === i ? "text-black-50" : ""), onClick: () => u(v[0]), role: "button", children: s[v[1]] }, v[0])) }),
2723
+ /* @__PURE__ */ r.jsx(at, { type: "date", value: e.to, onChange: (v) => d("to", v === null ? null : v.toString()), InputContainer: Fe, size: a })
2724
+ ] }) }),
2725
+ /* @__PURE__ */ r.jsx(re, { disabled: m, onClick: () => {
2726
+ l(1);
2727
+ }, children: /* @__PURE__ */ r.jsx(o, { icon: "chevron-right" }) })
2728
+ ] });
2729
+ }, hd = ({ defaultMonth: e, searchKey: t = "monthFrom", yearMin: n, yearMax: a }) => {
2730
+ const { localizationContext: s } = q(ge), { dateFnsLocale: o } = q(s), { searchParams: i, setSearch: c } = Ts(), l = i.get(t), u = l ? vt(l) : e, d = S((m) => {
2731
+ c(t, tn(m, { representation: "date" }));
2732
+ }, [t, c]);
2733
+ return /* @__PURE__ */ r.jsx(xo, { month: u, onChangeMonth: d, locale: o, yearMin: n, yearMax: a });
2734
+ }, gd = ({ defaultYear: e, searchKey: t = "yearFrom", optionMin: n, optionMax: a, className: s }) => {
2735
+ const [o, i] = Ls(t, tn(e, { representation: "date" })), c = o ? vt(o) : e, l = S((u) => {
2736
+ i(tn(u, { representation: "date" }));
2737
+ }, [i]);
2738
+ return /* @__PURE__ */ r.jsx(yo, { year: c, onChangeYear: l, optionMin: n, optionMax: a, className: s });
2739
+ }, pd = ({ data: e, showLegend: t = !1, legendPosition: n = "left", onClick: a }) => {
2740
+ const { chartColorPalette: s } = q(ge);
2741
+ return /* @__PURE__ */ r.jsx(hs, { data: e, margin: {
2742
+ top: 50,
2743
+ right: t && n === "right" ? 200 : 100,
2744
+ bottom: 50,
2745
+ left: t && n === "left" ? 200 : 100
2746
+ }, innerRadius: 0.4, padAngle: 4, cornerRadius: 2, activeOuterRadiusOffset: 10, borderWidth: 2, borderColor: {
2747
+ from: "color",
2748
+ modifiers: [["darker", 0.5]]
2749
+ }, colors: s, arcLinkLabelsSkipAngle: 10, arcLinkLabelsTextColor: { from: "color", modifiers: [["darker", 0.5]] }, arcLinkLabelsThickness: 2, arcLinkLabelsColor: { from: "color" }, enableArcLabels: !1, legends: t ? [
2750
+ {
2751
+ anchor: n,
2752
+ direction: n === "left" || n === "right" ? "column" : "row",
2753
+ justify: !1,
2754
+ translateX: n === "left" ? -200 : n === "right" ? 200 : 0,
2755
+ translateY: n === "top" ? -50 : n === "bottom" ? 50 : 0,
2756
+ itemsSpacing: 4,
2757
+ itemWidth: 120,
2758
+ itemHeight: 18,
2759
+ itemTextColor: "#1e2832",
2760
+ itemDirection: "left-to-right",
2761
+ itemOpacity: 1,
2762
+ symbolSize: 18,
2763
+ symbolShape: "circle",
2764
+ padding: 10
2765
+ }
2766
+ ] : [], onClick: (o) => a && a(o.data) });
2767
+ }, Xl = ({ errors: e, schema: t }) => {
2768
+ const n = (a) => {
2769
+ var s, o;
2770
+ return a.toLowerCase() === "others" ? "Obecné" : ((o = (s = t.columns) == null ? void 0 : s.find((i) => i.field === a)) == null ? void 0 : o.caption) ?? a;
2771
+ };
2772
+ return /* @__PURE__ */ r.jsx("div", { className: "alert alert-danger w-100 m-0 p-2", children: /* @__PURE__ */ r.jsx("table", { children: /* @__PURE__ */ r.jsx("tbody", { children: e.map((a) => /* @__PURE__ */ r.jsxs("tr", { children: [
2773
+ /* @__PURE__ */ r.jsx("td", { className: "fw-bold pe-2", children: /* @__PURE__ */ r.jsxs(J, { variant: "body", children: [
2774
+ n(a.name),
2775
+ ":"
2776
+ ] }) }),
2777
+ /* @__PURE__ */ r.jsx("td", { className: "", children: /* @__PURE__ */ r.jsx(J, { variant: "body", children: a.errors }) })
2778
+ ] }, a.name)) }) }) });
2779
+ }, va = (e) => {
2780
+ const t = {};
2781
+ return Object.keys(e).forEach((n) => {
2782
+ if (e[n].value === !0) {
2783
+ t[n] = 1;
2784
+ return;
2785
+ }
2786
+ if (e[n].value === !1) {
2787
+ t[n] = 0;
2788
+ return;
2789
+ }
2790
+ t[n] = e[n].value;
2791
+ }), t;
2792
+ }, Zn = (e, t) => {
2793
+ const n = {};
2794
+ return Object.keys(e).forEach((a) => {
2795
+ var i;
2796
+ const s = e[a], o = (i = t.columns) == null ? void 0 : i.find((c) => c.field === a);
2797
+ if ((o == null ? void 0 : o.type) === "BIT" && (s === 1 || s === 0)) {
2798
+ n[a] = { value: s === 1, defaultValue: s === 1 };
2799
+ return;
2800
+ }
2801
+ n[a] = { value: s, defaultValue: s };
2802
+ }), n;
2803
+ }, ec = "_table_1klfy_1", tc = "_table-header_1klfy_10", nc = "_table-row_1klfy_10", rc = "_table-head_1klfy_10", ac = "_filters-row_1klfy_19", sc = "_table-body_1klfy_30", oc = "_table-cell_1klfy_30", ic = "_action-column_1klfy_43", lc = "_sticky-top_1klfy_47", cc = "_sticky-first_1klfy_54", dc = "_sticky-last_1klfy_61", uc = "_sticky-bottom_1klfy_68", de = {
2804
+ table: ec,
2805
+ "table-header": "_table-header_1klfy_10",
2806
+ tableHeader: tc,
2807
+ "table-row": "_table-row_1klfy_10",
2808
+ tableRow: nc,
2809
+ "table-head": "_table-head_1klfy_10",
2810
+ tableHead: rc,
2811
+ "filters-row": "_filters-row_1klfy_19",
2812
+ filtersRow: ac,
2813
+ "table-body": "_table-body_1klfy_30",
2814
+ tableBody: sc,
2815
+ "table-cell": "_table-cell_1klfy_30",
2816
+ tableCell: oc,
2817
+ "action-column": "_action-column_1klfy_43",
2818
+ actionColumn: ic,
2819
+ "sticky-top": "_sticky-top_1klfy_47",
2820
+ stickyTop: lc,
2821
+ "sticky-first": "_sticky-first_1klfy_54",
2822
+ stickyFirst: cc,
2823
+ "sticky-last": "_sticky-last_1klfy_61",
2824
+ stickyLast: dc,
2825
+ "sticky-bottom": "_sticky-bottom_1klfy_68",
2826
+ stickyBottom: uc
2827
+ }, fc = "_input_13mhy_1", nt = {
2828
+ input: fc
2829
+ }, ja = ({ type: e, value: t, field: n, isPrimary: a, isReadonly: s, primaryEditable: o = !1, valuesForSelect: i, onChangeHandler: c, hideClearIcon: l, clearValue: u }) => {
2830
+ switch (e) {
2831
+ case "NUM":
2832
+ return i && i.length > 0 ? /* @__PURE__ */ r.jsx(Dt, { withoutLabel: !0, InputContainer: Fe, className: nt.input, size: "sm", value: (t == null ? void 0 : t.toString()) ?? "", onChange: (d) => c(n, d === null ? null : Number(d)), options: i, disabled: s || o ? !1 : a, showClearIcon: !l, clearValue: u }) : /* @__PURE__ */ r.jsx(at, { withoutLabel: !0, InputContainer: Fe, className: nt.input, size: "sm", type: "number", value: t === null ? null : Number(t), onChange: (d) => c(n, d === null ? null : Number(d)), disabled: s || o ? !1 : a, showClearIcon: !l, clearValue: u });
2833
+ case "STR":
2834
+ return i && i.length > 0 ? /* @__PURE__ */ r.jsx(Dt, { withoutLabel: !0, InputContainer: Fe, className: nt.input, size: "sm", value: (t == null ? void 0 : t.toString()) ?? "", onChange: (d) => c(n, (d == null ? void 0 : d.toString()) ?? null), options: i, disabled: s || o ? !1 : a, showClearIcon: !l, clearValue: u }) : /* @__PURE__ */ r.jsx(at, { withoutLabel: !0, InputContainer: Fe, className: nt.input, size: "sm", type: "text", value: (t == null ? void 0 : t.toString()) ?? "", onChange: (d) => c(n, (d == null ? void 0 : d.toString()) ?? null), disabled: s || o ? !1 : a, showClearIcon: !l, clearValue: u });
2835
+ case "BIT":
2836
+ return /* @__PURE__ */ r.jsx(da, { InputContainer: Fe, className: nt.input, value: t === !0, onChange: (d) => c(n, d), disabled: s || o ? !1 : a });
2837
+ case "DT":
2838
+ return /* @__PURE__ */ r.jsx(at, { withoutLabel: !0, InputContainer: Fe, className: nt.input, size: "sm", type: "date", value: t ? t.toString().split("T")[0] ?? "" : "", onChange: (d) => c(n, (d == null ? void 0 : d.toString()) ?? null), disabled: s || o ? !1 : a, showClearIcon: !l, clearValue: u });
2839
+ default:
2840
+ return /* @__PURE__ */ r.jsx("div", { className: "alert alert-warning p-1 m-0", children: /* @__PURE__ */ r.jsxs(J, { variant: "body", children: [
2841
+ "Neznámý typ ",
2842
+ e
2843
+ ] }) });
2844
+ }
2845
+ }, mc = ({ schema: e, columns: t, initialItem: n, onEdit: a, onDelete: s }) => {
2846
+ const { ProjectIconComponent: o } = q(ge), [i, c] = E(n), l = S((m, x) => {
2847
+ console.log("changeValue", m, x), c((v) => ({
2848
+ ...v,
2849
+ [m]: {
2850
+ ...v[m],
2851
+ value: x
2852
+ }
2853
+ }));
2854
+ }, []), u = (m) => (m == null ? void 0 : m.value) !== (m == null ? void 0 : m.defaultValue), d = S(() => Object.keys(i).some((m) => u(i[m])), [i]);
2855
+ return M(() => {
2856
+ c(n);
2857
+ }, [n]), /* @__PURE__ */ r.jsxs("tr", { className: w("table-row", de.tableRow), children: [
2858
+ /* @__PURE__ */ r.jsx("td", { className: w("table-cell", de.tableCell, de.stickyFirst), children: d() && /* @__PURE__ */ r.jsx(re, { color: "success", onClick: () => a(va(i)), children: /* @__PURE__ */ r.jsx(o, { icon: "check" }) }) }),
2859
+ t.map((m) => {
2860
+ var x, v;
2861
+ return /* @__PURE__ */ r.jsx("td", { className: w("table-cell", de.tableCell), children: /* @__PURE__ */ r.jsx(ja, { type: m.type, value: (x = i[m.field ?? ""]) == null ? void 0 : x.value, field: m.field, isReadonly: m.readOnly, isPrimary: e.primaryKey === m.field, valuesForSelect: m.valuesForSelect, onChangeHandler: l, hideClearIcon: !u(i[m.field ?? ""]), clearValue: (v = i[m.field ?? ""].defaultValue) == null ? void 0 : v.toString() }) }, `${e.id}-${m.field}`);
2862
+ }),
2863
+ /* @__PURE__ */ r.jsx("td", { className: w("table-cell", de.tableCell, de.stickyLast), children: /* @__PURE__ */ r.jsx(re, { color: "danger", onClick: () => s(i[e.primaryKey ?? ""].value), children: /* @__PURE__ */ r.jsx(o, { icon: "delete" }) }) })
2864
+ ] });
2865
+ }, hc = ({ schema: e, columns: t, onCreate: n }) => {
2866
+ const { ProjectIconComponent: a } = q(ge), [s, o] = E(null), i = S(() => {
2867
+ var u;
2868
+ const l = {};
2869
+ (u = e.columns) == null || u.forEach((d) => {
2870
+ const m = d.type === "BIT" ? !1 : d.type === "NUM" ? 0 : d.type === "STR" ? "" : null;
2871
+ l[d.field ?? ""] = {
2872
+ value: m,
2873
+ defaultValue: m
2874
+ };
2875
+ }), o(l);
2876
+ }, [e]), c = S((l, u) => {
2877
+ o((d) => d && {
2878
+ ...d,
2879
+ [l]: {
2880
+ ...d[l],
2881
+ value: u
2882
+ }
2883
+ });
2884
+ }, []);
2885
+ return s ? /* @__PURE__ */ r.jsxs("tr", { className: "sticky-bottom shadow", children: [
2886
+ /* @__PURE__ */ r.jsx("td", { className: "sticky-first", children: /* @__PURE__ */ r.jsx(re, { color: "success", onClick: async () => {
2887
+ const l = va(s);
2888
+ l && await n(l) && o(null);
2889
+ }, children: /* @__PURE__ */ r.jsx(a, { icon: "check" }) }) }),
2890
+ t.map((l) => /* @__PURE__ */ r.jsx("td", { children: /* @__PURE__ */ r.jsx(ja, { type: l.type, value: s[l.field ?? ""].value, field: l.field, isReadonly: l.readOnly, isPrimary: e.primaryKey === l.field, valuesForSelect: l.valuesForSelect, onChangeHandler: c, primaryEditable: !0 }) }, `${e.id}-${l.field}`)),
2891
+ /* @__PURE__ */ r.jsx("td", { className: "sticky-last", children: /* @__PURE__ */ r.jsx(re, { color: "danger", onClick: () => o(null), children: /* @__PURE__ */ r.jsx(a, { icon: "cancel" }) }) })
2892
+ ] }) : /* @__PURE__ */ r.jsxs("tr", { className: "sticky-bottom shadow", children: [
2893
+ /* @__PURE__ */ r.jsx("td", { className: "sticky-first", children: /* @__PURE__ */ r.jsx(re, { onClick: i, children: /* @__PURE__ */ r.jsx(a, { icon: "add" }) }) }),
2894
+ /* @__PURE__ */ r.jsx("td", { colSpan: t.length + 1 })
2895
+ ] });
2896
+ }, gc = ({ column: e, children: t }) => e.description ? /* @__PURE__ */ r.jsx(mn, { placement: "bottom", text: e.description ?? "", children: /* @__PURE__ */ r.jsx("div", { children: t }) }) : /* @__PURE__ */ r.jsx(r.Fragment, { children: t }), pc = ({ schema: e, items: t, onEditItem: n, onDeleteItem: a, onCreateItem: s, filters: o, setFilter: i, sortByField: c, sortByType: l, setSortBy: u, selectedMaster: d }) => {
2897
+ const { texts: { dynamicForms: m }, ProjectIconComponent: x } = q(ge), [v, h] = E([]);
2898
+ return M(() => {
2899
+ var p, g, j;
2900
+ h([
2901
+ ...((j = (g = (p = e.columns) == null ? void 0 : p.filter((b) => !b.hidden)) == null ? void 0 : g.filter((b) => e.masterReference ? b.field !== e.masterReferenceColumn : !0)) == null ? void 0 : j.map((b) => {
2902
+ var f;
2903
+ return {
2904
+ label: b.caption ?? "",
2905
+ description: b.description ?? null,
2906
+ field: b.field ?? "",
2907
+ type: b.type,
2908
+ readOnly: b.readOnly,
2909
+ valuesForSelect: ((f = b.values) == null ? void 0 : f.filter((y) => b.valuesFilteredByMaster ? y.masterValue === d : !0).map((y) => ({ id: y.id ?? "", name: y.name }))) ?? void 0
2910
+ };
2911
+ })) ?? []
2912
+ ]);
2913
+ }, [e, d]), /* @__PURE__ */ r.jsxs("table", { id: `dynamic-table-${e.id}`, className: w("table table-borderless luminus-df-table", de.table), children: [
2914
+ /* @__PURE__ */ r.jsxs("thead", { className: w("text-nowrap table-header", de.stickyTop, de.tableHeader), children: [
2915
+ /* @__PURE__ */ r.jsxs("tr", { className: w("table-row", de.tableRow), children: [
2916
+ /* @__PURE__ */ r.jsx("th", { className: w("table-head", de.tableHead, de.actionColumn, de.stickyFirst) }),
2917
+ v.map((p) => /* @__PURE__ */ r.jsx("th", { className: w("table-head", de.tableHead), onClick: () => {
2918
+ const g = c === p.field ? l : null;
2919
+ if (g === "asc") {
2920
+ u(p.field, "desc");
2921
+ return;
2922
+ }
2923
+ if (g === "desc") {
2924
+ u(p.field, null);
2925
+ return;
2926
+ }
2927
+ u(p.field, "asc");
2928
+ }, children: /* @__PURE__ */ r.jsx(gc, { column: p, children: /* @__PURE__ */ r.jsxs("div", { className: "d-flex justify-content-between align-items-center", children: [
2929
+ p.label,
2930
+ c === p.field && /* @__PURE__ */ r.jsx(x, { icon: l === "asc" ? "chevron-up" : "chevron-down" })
2931
+ ] }) }) }, `${e.id}-${p.field}`)),
2932
+ /* @__PURE__ */ r.jsx("th", { className: w("table-head", de.tableHead, de.actionColumn, de.stickyLast) })
2933
+ ] }),
2934
+ /* @__PURE__ */ r.jsxs("tr", { className: w("table-row filters-row", de.tableRow, de.filtersRow), children: [
2935
+ /* @__PURE__ */ r.jsx("th", { className: w("table-head", de.tableHead, de.actionColumn, de.stickyFirst) }),
2936
+ v.map((p) => /* @__PURE__ */ r.jsx("th", { className: w("table-head", de.tableHead), children: p.valuesForSelect && p.valuesForSelect.length > 0 || p.type === "BIT" ? /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsx(Dt, { InputContainer: Fe, withoutLabel: !0, size: "sm", value: o[p.field] ?? "", onChange: (g) => i(p.field, (g == null ? void 0 : g.toString()) ?? null), options: p.type === "BIT" ? [
2937
+ { id: 1, name: m.yes },
2938
+ { id: 0, name: m.no }
2939
+ ] : p.valuesForSelect ?? [], isNumber: p.type === "BIT", showClearIcon: !0 }) }) : /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsx(at, { InputContainer: Fe, withoutLabel: !0, size: "sm", type: p.type === "NUM" ? "number" : p.type === "DT" ? "date" : "text", value: o[p.field] ?? "", onChange: (g) => i(p.field, (g == null ? void 0 : g.toString()) ?? null) }) }) }, `${e.id}-${p.field}`)),
2940
+ /* @__PURE__ */ r.jsx("th", { className: w("table-head", de.tableHead, de.actionColumn, de.stickyLast) })
2941
+ ] })
2942
+ ] }),
2943
+ /* @__PURE__ */ r.jsxs("tbody", { className: w("table-body", de.tableBody), children: [
2944
+ t.filter((p) => p[e.primaryKey ?? ""]).map((p) => /* @__PURE__ */ r.jsx(mc, { schema: e, columns: v, initialItem: p, onEdit: n, onDelete: a }, `${e.id}-${p[e.primaryKey ?? ""].value}`)),
2945
+ /* @__PURE__ */ r.jsx(hc, { schema: e, columns: v, onCreate: s })
2946
+ ] })
2947
+ ] });
2948
+ }, xc = ({ master: e, onChange: t, options: n, label: a }) => /* @__PURE__ */ r.jsx(Dt, { label: a, value: e, onChange: (s) => t(s ? s.toString() : null), options: n, size: "sm" }), vc = "_pagination_gujwe_1", Jn = {
2949
+ pagination: vc
2950
+ }, Xn = {
2951
+ appDetail: "/settings/:id"
2952
+ }, rt = {
2953
+ apiSchemaGet: "/dynamicForms/schema",
2954
+ apiDataGet: "/dynamicForms/data",
2955
+ apiItemPost: "/dynamicForms/update",
2956
+ apiItemDelete: "/dynamicForms/delete",
2957
+ apiItemCreate: "/dynamicForms/insert"
2958
+ }, xd = ({ id: e, page: t, setPage: n, filters: a, setFilter: s, sortByField: o, sortByType: i, setSortBy: c, appUrls: { appDetail: l = Xn.appDetail } = Xn, apiUrls: { apiSchemaGet: u = rt.apiSchemaGet, apiDataGet: d = rt.apiDataGet, apiItemPost: m = rt.apiItemPost, apiItemDelete: x = rt.apiItemDelete, apiItemCreate: v = rt.apiItemCreate } = rt }) => {
2959
+ var le, we, ce, se, Se, De;
2960
+ const { texts: { dynamicForms: h }, ProjectIconComponent: p } = q(ge), g = Je(), { startLoading: j, stopLoading: b } = q(Et), [f, y] = E(null), [N, k] = E(null), [I, D] = E(null), [C, L] = E(null), [O, _] = E(!1), { addNotification: W } = wr(), [V, X] = E([]), { confirm: R } = Tt(), $ = 20, P = $ + 1, U = C ? Math.ceil(C.length / $) : 1, Z = t ? t > 1 : !1, Q = t ? t < U : !1, F = t ? (t - 1) * $ : 0, ee = t ? t * $ : $, [A, z] = E(!1), me = A ? C == null ? void 0 : C.slice(F, ee) : C, [G, pe] = E(null);
2961
+ M(() => {
2962
+ y(null), k(null), _(!1), X([]), pe(null);
2963
+ }, [e]);
2964
+ const Ne = S(async () => {
2965
+ j("dynamicFormSchema"), await g.get(`${u}?id=${e}`).then(({ data: H }) => {
2966
+ y(H), b("dynamicFormSchema");
2967
+ }).catch(() => b("dynamicFormSchema"));
2968
+ }, [g, e, j, b, u]), Ie = S(async () => {
2969
+ var H;
2970
+ if (!(f === null || ((H = f.id) == null ? void 0 : H.toString()) !== e)) {
2971
+ if (f.masterReference && !G) {
2972
+ k([]);
2973
+ return;
2974
+ }
2975
+ j("dynamicFormData"), await g.get(`${d}?id=${e}&showArchive=${O}${f.masterReference ? `&master=${G}` : ""}`).then(({ data: ae }) => {
2976
+ const he = ae.map((ie) => {
2977
+ var xe;
2978
+ return Object.fromEntries(((xe = f.columns) == null ? void 0 : xe.filter((je) => je.field).map((je) => [
2979
+ je.field,
2980
+ { value: ie[je.field ?? ""], defaultValue: ie[je.field ?? ""] }
2981
+ ])) ?? []);
2982
+ });
2983
+ k(he), b("dynamicFormData");
2984
+ }).catch(() => b("dynamicFormData"));
2985
+ }
2986
+ }, [g, e, f, j, b, O, G, d]), We = S(async (H) => (j("dynamicFormEdit"), g.post(`${m}?id=${e}`, H).then(() => (b("dynamicFormEdit"), X([]), !0)).catch((ae) => (b("dynamicFormEdit"), X(Vt(ae)), !1))), [g, e, j, b, m]), Y = S(async (H) => (j("dynamicFormDelete"), g.delete(`${x}?id=${e}&pk=${H}`).then(() => (b("dynamicFormDelete"), X([]), !0)).catch((ae) => (b("dynamicFormDelete"), X(Vt(ae)), !1))), [g, e, j, b, x]), fe = S(async (H) => (j("dynamicFormCreate"), g.post(`${v}?id=${e}`, H).then(({ data: ae }) => (b("dynamicFormCreate"), X([]), ae)).catch((ae) => (b("dynamicFormCreate"), X(Vt(ae)), null))), [g, e, j, b, v]), _e = S(async (H) => {
2987
+ f && await We(f.masterReference ? { ...H, [f.masterReferenceColumn ?? ""]: G } : H) && (W(h.editSuccess, "success"), k((ae) => ae && ae.map((he) => {
2988
+ var ie;
2989
+ return ((ie = he[(f == null ? void 0 : f.primaryKey) ?? ""]) == null ? void 0 : ie.value) === H[(f == null ? void 0 : f.primaryKey) ?? ""] ? Zn(H, f) : he;
2990
+ })));
2991
+ }, [W, We, f, G, h]), ze = S(async (H) => {
2992
+ await R(h.deleteConfirm) && await Y(H) && (W(h.deleteSuccess, "success"), k((ae) => ae && ae.filter((he) => {
2993
+ var ie;
2994
+ return ((ie = he[(f == null ? void 0 : f.primaryKey) ?? ""]) == null ? void 0 : ie.value) !== H;
2995
+ })));
2996
+ }, [W, Y, h, R, f]), tt = S(async (H) => {
2997
+ if (!f)
2998
+ return !1;
2999
+ const ae = await fe(f.masterReference ? { ...H, [f.masterReferenceColumn ?? ""]: G } : H);
3000
+ if (ae !== null) {
3001
+ W(h.createSuccess, "success");
3002
+ const he = Zn(H, f);
3003
+ return he[(f == null ? void 0 : f.primaryKey) ?? ""] = { value: ae, defaultValue: ae }, k((ie) => [...ie ?? [], he]), !0;
3004
+ }
3005
+ return !1;
3006
+ }, [W, fe, h, f, G]), T = (H) => {
3007
+ H > U ? n(U) : H < 1 && n(1), n(H);
3008
+ }, B = S(() => {
3009
+ if (!N || !f) {
3010
+ D(null);
3011
+ return;
3012
+ }
3013
+ const H = N.filter((ae) => Object.entries(a).every(([he, ie]) => {
3014
+ var ct, dt, ut;
3015
+ if (ie === null)
3016
+ return !0;
3017
+ const xe = (ct = ae[he]) == null ? void 0 : ct.value;
3018
+ if (xe == null)
3019
+ return !1;
3020
+ const je = (dt = f.columns) == null ? void 0 : dt.find((bt) => bt.field === he), it = je == null ? void 0 : je.type, lt = (je == null ? void 0 : je.values) && ((ut = je == null ? void 0 : je.values) == null ? void 0 : ut.length) > 0;
3021
+ if (!it)
3022
+ return !1;
3023
+ switch (it) {
3024
+ case "STR":
3025
+ return lt ? xe === ie : xe.toString().toLowerCase().includes(ie.toLowerCase());
3026
+ case "NUM":
3027
+ return lt ? Number(xe) === Number(ie) : xe.toString().toLowerCase().includes(ie.toLowerCase());
3028
+ case "DT":
3029
+ return xe.toString().toLowerCase().includes(ie.toLowerCase());
3030
+ case "BIT":
3031
+ return Number(xe) === Number(ie);
3032
+ default:
3033
+ return xe.toString().toLowerCase().includes(ie.toLowerCase());
3034
+ }
3035
+ }));
3036
+ D(H);
3037
+ }, [N, a, f]), K = S(() => {
3038
+ if (!I || !f) {
3039
+ L([]);
3040
+ return;
3041
+ }
3042
+ if (!o) {
3043
+ L(I);
3044
+ return;
3045
+ }
3046
+ L([...I].sort((H, ae) => {
3047
+ var it, lt, ct, dt, ut, bt;
3048
+ const he = ((lt = (it = H[o]) == null ? void 0 : it.value) == null ? void 0 : lt.toString()) ?? "", ie = ((dt = (ct = ae[o]) == null ? void 0 : ct.value) == null ? void 0 : dt.toString()) ?? "", xe = f.columns.find(($e) => $e.field === o), je = xe == null ? void 0 : xe.type;
3049
+ if (!xe || !je || !he && !ie)
3050
+ return 0;
3051
+ if (!he)
3052
+ return 1;
3053
+ if (!ie)
3054
+ return -1;
3055
+ if (xe.values && xe.values.length > 0) {
3056
+ const $e = ((ut = xe.values.find((At) => {
3057
+ var ft;
3058
+ return ((ft = At.id) == null ? void 0 : ft.toString()) === he;
3059
+ })) == null ? void 0 : ut.name) ?? "", Te = ((bt = xe.values.find((At) => {
3060
+ var ft;
3061
+ return ((ft = At.id) == null ? void 0 : ft.toString()) === ie;
3062
+ })) == null ? void 0 : bt.name) ?? "";
3063
+ return i === "asc" ? $e.localeCompare(Te) : Te.localeCompare($e);
3064
+ }
3065
+ if (je === "NUM") {
3066
+ const $e = Number(he), Te = Number(ie);
3067
+ return i === "asc" ? $e - Te : Te - $e;
3068
+ }
3069
+ if (je === "DT") {
3070
+ const $e = vt(he == null ? void 0 : he.toString()).getTime(), Te = vt(ie == null ? void 0 : ie.toString()).getTime();
3071
+ return i === "asc" ? $e - Te : Te - $e;
3072
+ }
3073
+ return i === "asc" ? he.toString().localeCompare(ie.toString()) : ie.toString().localeCompare(he.toString());
3074
+ }));
3075
+ }, [I, f, o, i]);
3076
+ return M(() => {
3077
+ Ne();
3078
+ }, [Ne]), M(() => {
3079
+ Ie();
3080
+ }, [Ie]), M(() => {
3081
+ B();
3082
+ }, [B]), M(() => {
3083
+ K();
3084
+ }, [K]), M(() => {
3085
+ C && C.length > P ? (z(!0), t || n(1)) : (z(!1), C && n(null));
3086
+ }, [C, n, t, P]), M(() => {
3087
+ !A || !t || (t > U && n(U), t < 1 && n(1));
3088
+ }, [t, A, U, n]), /* @__PURE__ */ r.jsxs("div", { className: "h-100 w-100 d-flex flex-column", children: [
3089
+ /* @__PURE__ */ r.jsxs("div", { className: "mb-3 d-flex justify-content-between align-items-center", children: [
3090
+ /* @__PURE__ */ r.jsx(J, { variant: "h3", children: (f == null ? void 0 : f.name) ?? "" }),
3091
+ /* @__PURE__ */ r.jsx(da, { label: h.showArchived, value: O === !0, onChange: (H) => _(H) })
3092
+ ] }),
3093
+ (f == null ? void 0 : f.description) && /* @__PURE__ */ r.jsx(J, { variant: "body2", className: "mb-3", children: f == null ? void 0 : f.description }),
3094
+ (f == null ? void 0 : f.masterReference) && /* @__PURE__ */ r.jsx("div", { className: "mb-3 d-flex", children: /* @__PURE__ */ r.jsx(xc, { label: ((we = (le = f.columns) == null ? void 0 : le.find((H) => H.field === f.masterReferenceColumn)) == null ? void 0 : we.caption) ?? "", options: ((se = (ce = f.columns) == null ? void 0 : ce.find((H) => H.field === f.masterReferenceColumn)) == null ? void 0 : se.values) ?? [], master: G, onChange: (H) => pe(H) }) }),
3095
+ (f == null ? void 0 : f.slaves) && f.slaves.length > 0 && /* @__PURE__ */ r.jsx("div", { className: "mb-3 d-flex align-items-center flex-start", children: f.slaves.map((H) => {
3096
+ var ae;
3097
+ return /* @__PURE__ */ r.jsx(ot, { as: "link", href: `${kt(l, { id: (ae = H.id) == null ? void 0 : ae.toString() })}?type=dynamic-form`, children: H.name }, H.id);
3098
+ }) }),
3099
+ f != null && f.masterReference && !G ? /* @__PURE__ */ r.jsx(la, { variant: "warning", children: h.selectMaster(((De = (Se = f.columns) == null ? void 0 : Se.find((H) => H.field === f.masterReferenceColumn)) == null ? void 0 : De.caption) ?? "").toLowerCase() }) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3100
+ f && V.length > 0 && /* @__PURE__ */ r.jsx("div", { className: "mb-2", children: /* @__PURE__ */ r.jsx(Xl, { errors: V, schema: f }) }),
3101
+ f && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3102
+ /* @__PURE__ */ r.jsx("div", { className: w("rounded border overflow-auto", Jn.tableContainer), children: /* @__PURE__ */ r.jsx(pc, { schema: f, items: (A ? me : C) ?? [], onEditItem: _e, onDeleteItem: ze, onCreateItem: tt, filters: a, setFilter: s, sortByField: o, sortByType: i, setSortBy: c, selectedMaster: (G == null ? void 0 : G.toString()) ?? null }) }),
3103
+ A && t && /* @__PURE__ */ r.jsxs("div", { className: w(Jn.pagination, "d-flex align-items-center gap-3 p-1 border-bottom border-start border-end rounded"), children: [
3104
+ /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-center gap-1", children: [
3105
+ /* @__PURE__ */ r.jsx(re, { color: "primary", onClick: () => T(1), disabled: !Z, children: /* @__PURE__ */ r.jsx(p, { icon: "chevron-double-left" }) }),
3106
+ /* @__PURE__ */ r.jsx(re, { color: "primary", onClick: () => T(t - 1), disabled: !Z, children: /* @__PURE__ */ r.jsx(p, { icon: "chevron-left" }) }),
3107
+ /* @__PURE__ */ r.jsx(re, { color: "primary", onClick: () => T(t + 1), disabled: !Q, children: /* @__PURE__ */ r.jsx(p, { icon: "chevron-right" }) }),
3108
+ /* @__PURE__ */ r.jsx(re, { color: "primary", onClick: () => T(U), disabled: !Q, children: /* @__PURE__ */ r.jsx(p, { icon: "chevron-double-right" }) })
3109
+ ] }),
3110
+ /* @__PURE__ */ r.jsxs(J, { variant: "body", children: [
3111
+ h.tablePage,
3112
+ " ",
3113
+ t,
3114
+ " ",
3115
+ h.tablePageFrom,
3116
+ " ",
3117
+ U
3118
+ ] })
3119
+ ] })
3120
+ ] })
3121
+ ] })
3122
+ ] });
3123
+ }, er = {
3124
+ appDetail: "/settings/:id"
3125
+ }, tr = {
3126
+ apiDynamicFormsGet: "/dynamicForms"
3127
+ }, jc = ({ item: e, children: t }) => e.description ? /* @__PURE__ */ r.jsx(mn, { placement: "left", text: e.description ?? "", children: /* @__PURE__ */ r.jsx("div", { children: t }) }) : /* @__PURE__ */ r.jsx(r.Fragment, { children: t }), vd = ({ activeId: e, otherForms: t = [], groupsDefs: n = [], searchQuery: a, fullSize: s, appUrls: { appDetail: o = er.appDetail } = er, apiUrls: { apiDynamicFormsGet: i = tr.apiDynamicFormsGet } = tr }) => {
3128
+ const c = Je(), { startLoading: l, stopLoading: u } = q(Et), [d, m] = E(null), x = ne(() => [
3129
+ ...(d == null ? void 0 : d.map((p) => ({
3130
+ ...p,
3131
+ type: "dynamic-form"
3132
+ }))) ?? [],
3133
+ ...t
3134
+ ].filter((p) => en(p.name, a) || en(p.description, a)).sort((p, g) => (p.name ?? "").localeCompare(g.name ?? "")) ?? [], [d, t, a]), v = ne(() => n.map((p) => ({
3135
+ id: p.id,
3136
+ name: p.name ?? "",
3137
+ items: x.filter((g) => g.group === p.id)
3138
+ })).filter((p) => p.items.length > 0), [n, x]), h = S(async () => {
3139
+ l("dynamicForms"), await c.get(i).then(({ data: p }) => {
3140
+ m(p), u("dynamicForms");
3141
+ }).catch(() => u("dynamicForms"));
3142
+ }, [c, l, u, i]);
3143
+ return M(() => {
3144
+ !d && h();
3145
+ }, [h, d]), x.length > 0 ? /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsx("div", { className: "w-auto list-group forms-items overflow-x-hidden", children: v.map((p) => /* @__PURE__ */ r.jsx(Go, { title: p.name, defaultOpen: !0, children: p.items.map((g) => {
3146
+ var j, b, f, y;
3147
+ return s ? /* @__PURE__ */ r.jsxs(Ze, { to: `${kt(o, { id: (j = g.id) == null ? void 0 : j.toString() })}?type=${g.type}`, className: `text-nowrap list-group-item list-group-item-action ${(e == null ? void 0 : e.toString()) === ((b = g.id) == null ? void 0 : b.toString()) ? "active" : ""}`, children: [
3148
+ /* @__PURE__ */ r.jsx(J, { variant: "body", children: g.name }),
3149
+ g.description && /* @__PURE__ */ r.jsx(J, { variant: "body2", className: "text-muted mt-2", children: g.description })
3150
+ ] }, g.id) : /* @__PURE__ */ r.jsx(jc, { item: g, children: /* @__PURE__ */ r.jsx(Ze, { to: `${kt(o, { id: (f = g.id) == null ? void 0 : f.toString() })}?type=${g.type}`, className: `text-nowrap list-group-item list-group-item-action ${(e == null ? void 0 : e.toString()) === ((y = g.id) == null ? void 0 : y.toString()) ? "active" : ""}`, children: /* @__PURE__ */ r.jsx(J, { variant: "body2", children: g.name }) }) }, g.id);
3151
+ }) }, p.id)) }) }) : null;
3152
+ }, jd = ({ label: e, to: t, value: n }) => /* @__PURE__ */ r.jsxs(Pe, { label: e, children: [
3153
+ /* @__PURE__ */ r.jsx("input", { disabled: !0, className: "form-control d-none" }),
3154
+ t ? /* @__PURE__ */ r.jsx(Ze, { to: t, className: "border-bottom luminus-dropdown-picker-link form-control d-flex justify-content-end align-items-center", children: n }) : /* @__PURE__ */ r.jsx("div", { className: "luminus-dropdown-picker-link form-control d-flex justify-content-end align-items-center", children: n })
3155
+ ] }), yd = () => {
3156
+ const { localizationContext: e } = q(ge), { language: t, setLanguage: n } = q(e), a = (s) => {
3157
+ n(s);
3158
+ };
3159
+ return /* @__PURE__ */ r.jsx(Qe, { onClick: (s) => {
3160
+ a(t === "cz" ? "en" : "cz"), s.stopPropagation();
3161
+ }, children: t === "cz" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3162
+ /* @__PURE__ */ r.jsx("strong", { children: "CZ" }),
3163
+ /* @__PURE__ */ r.jsx(Sn, {}),
3164
+ /* @__PURE__ */ r.jsx("span", { children: "EN" })
3165
+ ] }) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3166
+ /* @__PURE__ */ r.jsx("strong", { children: "EN" }),
3167
+ /* @__PURE__ */ r.jsx(Sn, {}),
3168
+ /* @__PURE__ */ r.jsx("span", { children: "CZ" })
3169
+ ] }) });
3170
+ }, bd = ({ controlId: e, ...t }) => /* @__PURE__ */ r.jsx(ye.Group, { controlId: e, ...t }), wd = ({ employeeId: e, alt: t, noPhotoImage: n, cafmApiUrl: a, showLargeInLightBox: s = !1 }) => {
3171
+ const { user: o } = q(Ot), { photoPath: i, photoPathSm: c } = Rs(e);
3172
+ return /* @__PURE__ */ r.jsx(r.Fragment, { children: e && /* @__PURE__ */ r.jsx(r.Fragment, { children: s ? /* @__PURE__ */ r.jsx(sl, { baseUrl: a, customToken: o.cafmToken ?? void 0, photos: [
3173
+ {
3174
+ id: e.toString(),
3175
+ alt: t ?? "",
3176
+ isDefault: !0,
3177
+ smSrc: c,
3178
+ lgSrc: i
3179
+ }
3180
+ ], placeholder: n, ImgComponent: zn }) : /* @__PURE__ */ r.jsx(zn, { baseUrl: a, customToken: o.cafmToken ?? void 0, src: c, alt: t, placeholder: n, className: "rounded w-100" }) }) });
3181
+ }, _d = ({ text: e, setText: t, onSearchButtonClick: n, className: a }) => {
3182
+ const s = (o) => {
3183
+ t(o);
3184
+ };
3185
+ return /* @__PURE__ */ r.jsxs(Nt, { className: `${a}`, children: [
3186
+ /* @__PURE__ */ r.jsx(ye.Control, { value: e, onChange: (o) => t(o.target.value) }),
3187
+ e && /* @__PURE__ */ r.jsx(Jt, { onClick: () => s(""), variant: "link", className: "border text-muted", children: /* @__PURE__ */ r.jsx(Oe, {}) }),
3188
+ /* @__PURE__ */ r.jsx(Jt, { onClick: () => n && n(e), variant: "link", className: "border", children: /* @__PURE__ */ r.jsx(gs, {}) })
3189
+ ] });
3190
+ }, Nd = ({ value: e, numberPrefix: t, numberSuffix: n, decimalScale: a = 2, className: s }) => /* @__PURE__ */ r.jsx(bn, { value: e, displayType: "text", thousandSeparator: " ", decimalScale: a, defaultValue: "", prefix: t, suffix: n, className: s }), Cd = ({ data: e, keys: t, colors: n, tooltipLabel: a }) => /* @__PURE__ */ r.jsx(ps, { data: e.map((s) => ({ name: s.name, ...s.values })), indexBy: "name", keys: t, margin: {
3191
+ top: 20,
3192
+ right: 50,
3193
+ bottom: 30,
3194
+ left: 150
3195
+ }, layout: "horizontal", colors: n, padding: 0.2, borderRadius: 2, borderWidth: 2, borderColor: {
3196
+ from: "color",
3197
+ modifiers: [["darker", 0.5]]
3198
+ }, axisTop: null, axisRight: null, axisBottom: {
3199
+ tickSize: 5,
3200
+ tickPadding: 5,
3201
+ tickRotation: 0
3202
+ }, axisLeft: {
3203
+ tickSize: 5,
3204
+ tickPadding: 5,
3205
+ tickRotation: 0
3206
+ }, labelSkipWidth: 12, labelSkipHeight: 12, labelTextColor: {
3207
+ from: "color",
3208
+ modifiers: [["darker", 1.6]]
3209
+ }, tooltipLabel: a }), Sd = ({ InputContainer: e = Pe, formField: t, label: n, resetsFields: a, type: s, required: o, hidden: i, disabled: c, withoutLabel: l, className: u }) => {
3210
+ const { register: d, formState: m, setValue: x } = He(), [v, h] = E(void 0), [p, g] = E(!1);
3211
+ M(() => {
3212
+ const b = t.split(".");
3213
+ let f = m.errors;
3214
+ b.forEach((y) => {
3215
+ f !== void 0 && (f = f[y]);
3216
+ }), h(f);
3217
+ }, [m, t]), M(() => {
3218
+ m.isSubmitted && g(!0);
3219
+ }, [m]);
3220
+ const j = v !== void 0;
3221
+ return /* @__PURE__ */ r.jsxs(e, { isForCheckInput: !0, hidden: i, label: `${n}${o ? " *" : ""}`, isInvalid: j, withoutLabel: l, className: u, children: [
3222
+ /* @__PURE__ */ r.jsx(ye.Check, { id: `check-${t}`, type: s ?? "checkbox", label: `${n}${o ? " *" : ""}`, ...d(t, {
3223
+ onChange: () => {
3224
+ a && a.forEach((b) => x(b, null, { shouldDirty: !0, shouldValidate: p }));
3225
+ }
3226
+ }), isInvalid: j, hidden: i, disabled: c, className: "w-100" }),
3227
+ v && /* @__PURE__ */ r.jsx(et, { message: v.message })
3228
+ ] });
3229
+ }, kd = ({ InputContainer: e = Pe, label: t, formField: n, options: a, resetsFields: s, required: o, disabled: i, hidden: c, className: l }) => {
3230
+ const { register: u, formState: d, setValue: m, watch: x } = He(), [v, h] = E(void 0), [p, g] = E(!1), j = ne(() => a, [a]);
3231
+ M(() => {
3232
+ const f = n.split(".");
3233
+ let y = d.errors;
3234
+ f.forEach((N) => {
3235
+ y !== void 0 && (y = y[N]);
3236
+ }), h(y);
3237
+ }, [d, n]), M(() => {
3238
+ d.isSubmitted && g(!0);
3239
+ }, [d]);
3240
+ const b = v !== void 0;
3241
+ return /* @__PURE__ */ r.jsxs(e, { isForRadioInput: !0, hidden: c, withoutLabel: !t, label: `${t}${o ? " *" : ""}`, isInvalid: b, className: l, children: [
3242
+ j.map((f) => /* @__PURE__ */ r.jsx(ye.Check, { id: `radio-${f.id}`, label: f.name, type: "radio", value: f.id ?? "", checked: x(n) === f.id, ...u(n, {
3243
+ onChange: () => {
3244
+ s && s.forEach((y) => m(y, null, { shouldDirty: !0, shouldValidate: p }));
3245
+ }
3246
+ }), isInvalid: b, hidden: c, disabled: i, className: "w-100" }, f.id)),
3247
+ v && /* @__PURE__ */ r.jsx(et, { message: v.message })
3248
+ ] });
3249
+ }, Id = ({ InputContainer: e = Pe, formField: t, label: n, size: a, defaultSelection: s, resetsFields: o, isNumber: i, required: c, hidden: l, disabled: u, items: d, onSearchQueryChange: m, selectedItemNavigateTo: x, texts: v, dropdownItemsNameWidth: h, isLoading: p, withoutLabel: g, additionalColumns: j, CustomOnChangeComponent: b, displayIdAsName: f, onSelect: y, className: N }) => {
3250
+ const { formState: k, setValue: I, watch: D, control: C } = He(), [L, O] = E(void 0), [_, W] = E(!1), [V, X] = E(!1), R = D(t) ?? null, $ = R === (s == null ? void 0 : s.id) ? s == null ? void 0 : s.name : D(`${t}-DropdownName`), P = ne(() => R == null ? null : { id: R ?? null, name: $ ?? "" }, [R, $]), U = S(() => {
3251
+ const G = t.split(".");
3252
+ let pe = k.errors;
3253
+ G.forEach((Ne) => {
3254
+ pe !== void 0 && (pe = pe[Ne]);
3255
+ }), O(pe);
3256
+ }, [k, t]), Z = S((G) => {
3257
+ if ((G == null ? void 0 : G.id) === R)
3258
+ return;
3259
+ if (y && y(G), o && o.forEach((Ne) => I(Ne, null, { shouldDirty: !0, shouldValidate: V })), G === null) {
3260
+ I(t, null, {
3261
+ shouldDirty: !0,
3262
+ shouldValidate: V
3263
+ }), I(`${t}-DropdownName`, null);
3264
+ return;
3265
+ }
3266
+ let pe = null;
3267
+ i ? pe = (G == null ? void 0 : G.id) !== null && (G == null ? void 0 : G.id) !== "" ? parseInt(G.id.toString(), 10) : null : pe = G.id === null || G.id === void 0 || G.id === "" ? null : G.id, I(t, pe, {
3268
+ shouldDirty: !0,
3269
+ shouldValidate: V
3270
+ }), I(`${t}-DropdownName`, G.name ?? "");
3271
+ }, [I, t, V, i, o, R, y]), Q = S((G) => {
3272
+ W(!1), Z(G);
3273
+ }, [Z]), F = S(() => {
3274
+ W(!1);
3275
+ }, []);
3276
+ M(() => {
3277
+ U();
3278
+ }, [U]), M(() => {
3279
+ k.isSubmitted && X(!0);
3280
+ }, [k]);
3281
+ const ee = te(null), A = L !== void 0, z = x !== void 0, me = z && P !== null;
3282
+ return /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(e, { label: `${n}${c ? " *" : ""}`, hidden: l, withoutLabel: g, isInvalid: A, inputContainerClassName: w({ "luminus-dropdown-select-open": _ }), className: N, children: [
3283
+ /* @__PURE__ */ r.jsxs(ca, { currentSelection: P, selectedItemNavigateTo: x, children: [
3284
+ f && (P == null ? void 0 : P.name) && /* @__PURE__ */ r.jsx(J, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: P.name }),
3285
+ /* @__PURE__ */ r.jsx(fn, { control: C, name: t, render: () => /* @__PURE__ */ r.jsx(ye.Select, { size: a, onMouseDown: (G) => {
3286
+ G.currentTarget.focus(), G.preventDefault();
3287
+ }, onClick: () => {
3288
+ !z && !u && W(!0);
3289
+ }, ref: ee, value: R ?? "", onChange: () => {
3290
+ }, isInvalid: A, hidden: l, className: w("w-100", {
3291
+ "luminus-dropdown-picker-disabled": u,
3292
+ "luminus-dropdown-picker-link": me
3293
+ }), children: /* @__PURE__ */ r.jsx("option", { value: R, children: f ? R : ($ == null ? void 0 : $.length) > 0 ? $ : R }) }) }),
3294
+ b || !u && z ? /* @__PURE__ */ r.jsxs("div", { className: "custom-picker-button", children: [
3295
+ !b && !u && z && /* @__PURE__ */ r.jsx(re, { size: "sm", color: "secondary", onClick: (G) => {
3296
+ G.preventDefault(), G.stopPropagation(), W(!0);
3297
+ }, children: /* @__PURE__ */ r.jsx(jr, {}) }),
3298
+ b ?? null
3299
+ ] }) : null
3300
+ ] }),
3301
+ L && /* @__PURE__ */ r.jsx(et, { message: L.message }),
3302
+ ee.current && /* @__PURE__ */ r.jsx(jn, { show: _, onCancel: F, items: d, currentSelection: P, onSelectionChange: Q, onSearchQueryChange: m, texts: v, itemsNameWidth: h, additionalColumns: j, displayIdAsName: f, isLoading: p, disabled: u, inputRef: ee })
3303
+ ] }) });
3304
+ }, Dd = ({ InputContainer: e = Pe, label: t, formField: n, hidden: a, required: s, placeholder: o, disabled: i, showClearIcon: c, resetsFields: l, multiple: u, accept: d, withoutLabel: m, className: x }) => {
3305
+ const { watch: v, setValue: h, register: p, formState: g } = He(), [j, b] = E(!1), [f, y] = E(void 0), N = S(() => {
3306
+ h(n, "");
3307
+ }, [h, n]), k = S(() => {
3308
+ const D = n.split(".");
3309
+ let C = g.errors;
3310
+ D.forEach((L) => {
3311
+ C !== void 0 && (C = C[L]);
3312
+ }), y(C);
3313
+ }, [g, n]);
3314
+ M(k, [k]), M(() => {
3315
+ g.isSubmitted && b(!0);
3316
+ }, [g]);
3317
+ const I = f !== void 0;
3318
+ return /* @__PURE__ */ r.jsxs(e, { label: `${t}${s ? "*" : ""}`, hidden: a, withoutLabel: m, isInvalid: I, className: x, children: [
3319
+ /* @__PURE__ */ r.jsx(xs, { type: "file", multiple: u, accept: d.join(", "), placeholder: o ?? t, isInvalid: I, hidden: a, disabled: i, className: "w-100", ...p(n, {
3320
+ onChange: () => {
3321
+ l && l.forEach((D) => h(D, null, { shouldDirty: !0, shouldValidate: j }));
3322
+ }
3323
+ }) }),
3324
+ c && v(n) && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(re, { color: "secondary", size: "sm", onClick: N, children: /* @__PURE__ */ r.jsx(Oe, {}) }) }),
3325
+ f && /* @__PURE__ */ r.jsx(et, { message: f.message })
3326
+ ] });
3327
+ }, $d = ({ children: e, onStorno: t, noSpacer: n }) => {
3328
+ const { formState: a } = He(), [s, o] = E(!1);
3329
+ return M(() => {
3330
+ o(Object.keys(a.dirtyFields).length > 0);
3331
+ }, [a]), s ? /* @__PURE__ */ r.jsx(go, { onStorno: t, noSpacer: n, children: e }) : null;
3332
+ }, Fd = ({ InputContainer: e = Pe, options: t, formField: n, label: a, size: s, resetsFields: o, isNumber: i, required: c, hidden: l, disabled: u, withoutLabel: d, noSortOptions: m, suffixIdToName: x, onSelect: v, className: h }) => {
3333
+ const { texts: { customSelect: p } } = q(ge), { formState: g, setValue: j, watch: b, control: f } = He(), [y, N] = E(void 0), [k, I] = E(!1), [D, C] = E(!1), [L, O] = E(""), _ = b(n), W = ne(() => t.find((F) => F.id === _) ?? null, [t, _]), V = S(() => {
3334
+ const F = n.split(".");
3335
+ let ee = g.errors;
3336
+ F.forEach((A) => {
3337
+ ee !== void 0 && (ee = ee[A]);
3338
+ }), N(ee);
3339
+ }, [g, n]), X = S((F) => {
3340
+ if ((F == null ? void 0 : F.id) === _)
3341
+ return;
3342
+ if (v && v(F), o && o.forEach((A) => j(A, null, { shouldDirty: !0, shouldValidate: D })), F === null) {
3343
+ j(n, null, {
3344
+ shouldDirty: !0,
3345
+ shouldValidate: D
3346
+ });
3347
+ return;
3348
+ }
3349
+ let ee = null;
3350
+ i ? ee = (F == null ? void 0 : F.id) !== null && (F == null ? void 0 : F.id) !== "" ? parseInt(F.id.toString(), 10) : null : ee = F.id === null || F.id === void 0 || F.id === "" ? null : F.id, j(n, ee, {
3351
+ shouldDirty: !0,
3352
+ shouldValidate: D
3353
+ });
3354
+ }, [j, n, i, o, _, D, v]), R = S((F) => {
3355
+ I(!1), X(F);
3356
+ }, [X]), $ = S((F) => {
3357
+ O(F);
3358
+ }, []);
3359
+ M(() => {
3360
+ V();
3361
+ }, [V]), M(() => {
3362
+ g.isSubmitted && C(!0);
3363
+ }, [g]);
3364
+ const P = S((F) => {
3365
+ var ee;
3366
+ return F === null ? "" : !F.name || F.name.length === 0 ? ((ee = F.id) == null ? void 0 : ee.toString()) ?? "" : x ? `${F.name} (${F.id})` : F.name;
3367
+ }, [x]), U = ne(() => t.map((F) => ({
3368
+ id: F.id,
3369
+ name: P(F)
3370
+ })).filter((F) => en(F.name, L)).sort((F, ee) => m ? 0 : (F.name ?? "").localeCompare(ee.name ?? "")), [t, m, L, P]), Z = te(null), Q = y !== void 0;
3371
+ return /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(e, { label: `${a}${c ? " *" : ""}`, hidden: l, withoutLabel: d, isInvalid: Q, inputContainerClassName: w({ "luminus-dropdown-select-open": k }), className: h, children: [
3372
+ /* @__PURE__ */ r.jsx(fn, { control: f, name: n, render: () => /* @__PURE__ */ r.jsx(ye.Select, { size: s, onMouseDown: (F) => {
3373
+ F.currentTarget.focus(), F.preventDefault();
3374
+ }, onClick: () => {
3375
+ I(!0);
3376
+ }, ref: Z, value: _ ?? "", onChange: () => {
3377
+ }, isInvalid: Q, hidden: l, disabled: u, className: "w-100", children: /* @__PURE__ */ r.jsx("option", { value: (W == null ? void 0 : W.id) ?? "", children: P(W) }) }) }),
3378
+ y && /* @__PURE__ */ r.jsx(et, { message: y.message }),
3379
+ Z.current && /* @__PURE__ */ r.jsx(jn, { show: k, onCancel: () => I(!1), items: U, currentSelection: W ?? null, onSelectionChange: R, onSearchQueryChange: $, texts: p, disabled: u, inputRef: Z, autoHideSearch: !0, allItemsLength: t.length })
3380
+ ] }) });
3381
+ }, Od = ({ InputContainer: e = Pe, formField: t, label: n, placeholder: a, size: s, resetsFields: o, showClearIcon: i, clearValue: c, required: l, hidden: u, disabled: d, withoutLabel: m, step: x, stepperStep: v = 1, className: h, min: p, max: g }) => {
3382
+ const { register: j, formState: b, setValue: f, watch: y } = He(), [N, k] = E(void 0), [I, D] = E(!1), C = S((V, X, R) => {
3383
+ f(V, ht(X, p, g), R);
3384
+ }, [g, p, f]), L = S(() => {
3385
+ const V = c ?? null;
3386
+ C(t, V !== null ? Number(V) : null, {
3387
+ shouldDirty: !0,
3388
+ shouldValidate: I
3389
+ });
3390
+ }, [c, C, t, I]), O = S(() => {
3391
+ const V = t.split(".");
3392
+ let X = b.errors;
3393
+ V.forEach((R) => {
3394
+ X !== void 0 && (X = X[R]);
3395
+ }), k(X);
3396
+ }, [b, t]);
3397
+ M(() => {
3398
+ O();
3399
+ }, [O]), M(() => {
3400
+ b.isSubmitted && D(!0);
3401
+ }, [b]);
3402
+ const _ = N !== void 0, W = y(t);
3403
+ return /* @__PURE__ */ r.jsxs(e, { label: `${n}${l ? " *" : ""}`, hidden: u, withoutLabel: m, isInvalid: _, className: h, children: [
3404
+ /* @__PURE__ */ r.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
3405
+ /* @__PURE__ */ r.jsx(ye.Control, { type: "number", placeholder: a ?? n, size: s, ...j(t, {
3406
+ setValueAs: (V) => V == null || V === "" ? null : ht(Number(V), p, g),
3407
+ min: p,
3408
+ max: g,
3409
+ onChange: () => {
3410
+ o && o.forEach((V) => f(V, null, { shouldDirty: !0, shouldValidate: I }));
3411
+ }
3412
+ }), isInvalid: _, hidden: u, disabled: d, className: "w-100 luminus-numeric-stepper", step: x, min: p, max: g }),
3413
+ /* @__PURE__ */ r.jsx("div", { className: "stepper-icon left", children: !d && /* @__PURE__ */ r.jsx(re, { size: "sm", onClick: (V) => {
3414
+ V.preventDefault(), V.stopPropagation(), C(t, ((W ? Number(W) : 0) - v).toString(), { shouldDirty: !0, shouldValidate: I });
3415
+ }, children: /* @__PURE__ */ r.jsx(yr, {}) }) }),
3416
+ /* @__PURE__ */ r.jsx("div", { className: "stepper-icon right", children: !d && /* @__PURE__ */ r.jsx(re, { size: "sm", onClick: (V) => {
3417
+ V.preventDefault(), V.stopPropagation(), C(t, ((W ? Number(W) : 0) + v).toString(), { shouldDirty: !0, shouldValidate: I });
3418
+ }, children: /* @__PURE__ */ r.jsx(br, {}) }) })
3419
+ ] }),
3420
+ i && y(t) && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ r.jsx(re, { color: "secondary", size: "sm", onClick: L, children: /* @__PURE__ */ r.jsx(Oe, {}) }) }),
3421
+ N && /* @__PURE__ */ r.jsx(et, { message: N.message })
3422
+ ] });
3423
+ }, Ed = ({ InputContainer: e = Pe, formField: t, label: n, placeholder: a, resetsFields: s, showClearIcon: o, clearValue: i, required: c, hidden: l, disabled: u, withoutLabel: d, step: m, size: x, CustomOnChangeComponent: v, noSelectOnFocus: h, className: p, decimalScale: g = 2, numberPrefix: j, numberSuffix: b, min: f, max: y }) => {
3424
+ const { formState: N, setValue: k, watch: I, control: D } = He(), [C, L] = E(void 0), [O, _] = E(!1), W = S(() => {
3425
+ const $ = i ?? null;
3426
+ k(t, $ !== null ? Number($) : null, {
3427
+ shouldDirty: !0,
3428
+ shouldValidate: O
3429
+ });
3430
+ }, [i, k, t, O]), V = S(() => {
3431
+ const $ = t.split(".");
3432
+ let P = N.errors;
3433
+ $.forEach((U) => {
3434
+ P !== void 0 && (P = P[U]);
3435
+ }), L(P);
3436
+ }, [N, t]);
3437
+ M(() => {
3438
+ V();
3439
+ }, [V]), M(() => {
3440
+ N.isSubmitted && _(!0);
3441
+ }, [N]);
3442
+ const X = I(t);
3443
+ M(() => {
3444
+ y !== void 0 && X > y && k(t, y), f !== void 0 && X < f && k(t, f);
3445
+ }, [t, X, y, f, k]);
3446
+ const R = C !== void 0;
3447
+ return /* @__PURE__ */ r.jsxs(e, { label: `${n}${c ? " *" : ""}`, hidden: l, withoutLabel: d, isInvalid: R, className: p, children: [
3448
+ /* @__PURE__ */ r.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
3449
+ /* @__PURE__ */ r.jsx(fn, { control: D, name: t, render: ({ field: { ref: $, onChange: P, name: U, value: Z } }) => /* @__PURE__ */ r.jsx(bn, { displayType: "input", thousandSeparator: " ", decimalScale: g, prefix: j, suffix: b, defaultValue: "", name: U, value: Z, placeholder: a ?? n, onFocus: (Q) => {
3450
+ !h && Q.target.select();
3451
+ }, onChange: (Q) => {
3452
+ var ee, A;
3453
+ const F = parseFloat(((A = (ee = Q.target) == null ? void 0 : ee.value) == null ? void 0 : A.replaceAll(" ", "")) ?? 0);
3454
+ s && s.forEach((z) => k(z, null, { shouldDirty: !0, shouldValidate: O })), P(F == null || Number.isNaN(F) ? null : Number(F));
3455
+ }, hidden: l, disabled: u, className: w("form-control text-end w-100", {
3456
+ "is-invalid": R
3457
+ }, {
3458
+ [`form-control-${x}`]: x
3459
+ }), step: m, getInputRef: $, min: f, max: y }) }),
3460
+ v && /* @__PURE__ */ r.jsx("div", { className: "custom-picker-button", children: v })
3461
+ ] }),
3462
+ o && I(t) && /* @__PURE__ */ r.jsx("div", { className: "luminus-input-remove-icon inset", children: /* @__PURE__ */ r.jsx(re, { color: "secondary", size: "sm", onClick: W, children: /* @__PURE__ */ r.jsx(Oe, {}) }) }),
3463
+ C && /* @__PURE__ */ r.jsx(et, { message: C.message })
3464
+ ] });
3465
+ }, wn = ["slice", "options", "formats", "conditions"], nr = (e) => {
3466
+ const t = e.current.flexmonster.getReport({ withDefaults: !0 });
3467
+ if (typeof t == "string")
3468
+ throw alert("report is string"), new Error("report is string");
3469
+ const n = {};
3470
+ return wn.forEach((a) => {
3471
+ n[a] = t[a];
3472
+ }), JSON.stringify(n);
3473
+ }, yc = (e) => {
3474
+ if (e.settings) {
3475
+ const t = JSON.parse(e.settings);
3476
+ return wn.forEach((n) => {
3477
+ t[n] === void 0 && (t[n] = null);
3478
+ }), t;
3479
+ }
3480
+ return {};
3481
+ }, bc = (e) => {
3482
+ const t = {};
3483
+ return wn.forEach((n) => {
3484
+ t[n] = (e == null ? void 0 : e[n]) ?? void 0;
3485
+ }), t;
3486
+ }, wc = ({ dataSource: e, settings: t, pivotRef: n, localization: a, licenseKey: s, enabled: o = !0 }) => {
3487
+ const { texts: { reports: i } } = q(ge), [c, l] = E(!1), u = te(null), d = n ?? u, m = ne(() => ({
3488
+ localization: a
3489
+ }), [a]), x = S((h) => {
3490
+ delete h[0], delete h[1], delete h[2];
3491
+ const p = [
3492
+ {
3493
+ id: "fm-tab-expand",
3494
+ title: i.expandAll,
3495
+ handler: d.current.flexmonster.expandAllData,
3496
+ icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>'
3497
+ },
3498
+ {
3499
+ id: "fm-tab-collapse",
3500
+ title: i.collapseAll,
3501
+ handler: d.current.flexmonster.collapseAllData,
3502
+ icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'
3503
+ }
3504
+ ];
3505
+ return h.unshift({
3506
+ id: "fm-tab-expand",
3507
+ title: i.expand,
3508
+ icon: '<svg height="42" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d=" M16 4 L28 4 L28 16 L24 12 L20 16 L16 12 L20 8z M4 16 L8 20 L12 16 L16 20 L12 24 L16 28 L4 28z "/></svg>',
3509
+ menu: p,
3510
+ rightGroup: !0
3511
+ }), h;
3512
+ }, [d, i.collapseAll, i.expand, i.expandAll]), v = (h) => {
3513
+ const p = h.getTabs();
3514
+ h.getTabs = () => x(p);
3515
+ };
3516
+ return M(() => {
3517
+ var h;
3518
+ c && o && ((h = d.current) == null || h.flexmonster.updateData(e), console.log("Updating flexmonster dataSource to: ", e));
3519
+ }, [e, o, c, d]), M(() => {
3520
+ var h, p, g;
3521
+ if (c && o) {
3522
+ const { options: j, conditions: b, formats: f, slice: y, ...N } = (h = d.current) == null ? void 0 : h.flexmonster.getReport();
3523
+ if (N === void 0 || typeof N == "string")
3524
+ return;
3525
+ const k = bc(t);
3526
+ k.options = {
3527
+ ...t == null ? void 0 : t.options,
3528
+ grid: { ...(p = t == null ? void 0 : t.options) == null ? void 0 : p.grid, autoSwitchToCompact: !1 }
3529
+ };
3530
+ const I = { ...N, ...k };
3531
+ (g = d.current) == null || g.flexmonster.setReport(I), console.log("Refreshing flexmonster settings. New report: ", I);
3532
+ }
3533
+ }, [o, c, d, t]), /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsx(
3534
+ Os,
3535
+ {
3536
+ ref: d,
3537
+ global: m,
3538
+ licenseKey: s,
3539
+ toolbar: !0,
3540
+ height: "100%",
3541
+ beforetoolbarcreated: v,
3542
+ ready: () => {
3543
+ l(!0);
3544
+ },
3545
+ width: "100%"
3546
+ }
3547
+ ) });
3548
+ }, _c = (e, t, n, a) => {
3549
+ const { texts: { reports: s } } = q(ge), { prompt: o } = vs(), { confirm: i } = Tt(), c = Je(), { user: l } = q(Ot), { startLoading: u, stopLoading: d } = q(Et), { addNotification: m } = wr(), x = S(async (j) => {
3550
+ u("report-versionSavingAs");
3551
+ try {
3552
+ const b = await c.post("/reports/version", j);
3553
+ m(s.saveSuccessful, "success"), await a(b.data);
3554
+ } finally {
3555
+ d("report-versionSavingAs");
3556
+ }
3557
+ }, [m, a, c, s.saveSuccessful, u, d]), v = S(async () => {
3558
+ if (n === null) {
3559
+ m("none open", "warning");
3560
+ return;
3561
+ }
3562
+ if (!await i(s.confirmOverwriteSave))
3563
+ return;
3564
+ const b = nr(t);
3565
+ x({
3566
+ reportSourceName: e,
3567
+ reportVersionId: n,
3568
+ settings: b
3569
+ });
3570
+ }, [
3571
+ m,
3572
+ i,
3573
+ t,
3574
+ e,
3575
+ s.confirmOverwriteSave,
3576
+ x,
3577
+ n
3578
+ ]), h = S(async () => {
3579
+ const j = await o(s.enterName, { input: "input", required: !0 });
3580
+ if (j === null)
3581
+ return;
3582
+ const b = nr(t);
3583
+ x({
3584
+ reportSourceName: e,
3585
+ name: j,
3586
+ settings: b
3587
+ });
3588
+ }, [t, o, e, s.enterName, x]), p = S(async () => {
3589
+ u("report-versionSavingAs");
3590
+ try {
3591
+ await c.post("/reports/version", {
3592
+ reportVersionId: n ?? void 0,
3593
+ reportSourceName: e,
3594
+ isArchived: !0
3595
+ }), m(s.deleteSuccessful, "success");
3596
+ } finally {
3597
+ d("report-versionSavingAs");
3598
+ }
3599
+ }, [
3600
+ m,
3601
+ c,
3602
+ e,
3603
+ s.deleteSuccessful,
3604
+ n,
3605
+ u,
3606
+ d
3607
+ ]), g = S(async () => {
3608
+ u("report-versionSavingAs");
3609
+ try {
3610
+ await c.post("/reports/version-restrictions", {
3611
+ reportVersionId: n ?? void 0,
3612
+ userRestricts: [
3613
+ {
3614
+ employeeId: l.personalNumber,
3615
+ addRights: !1
3616
+ }
3617
+ ]
3618
+ }), m(s.detachSuccessful, "success");
3619
+ } finally {
3620
+ d("report-versionSavingAs");
3621
+ }
3622
+ }, [
3623
+ m,
3624
+ c,
3625
+ s.detachSuccessful,
3626
+ n,
3627
+ u,
3628
+ d,
3629
+ l.personalNumber
3630
+ ]);
3631
+ return { saveAs: h, save: v, archive: p, detach: g };
3632
+ }, Nc = (e) => {
3633
+ const t = Je(), { startLoading: n, stopLoading: a } = q(Et);
3634
+ return { changeEmployeeRights: S(async (o, i) => {
3635
+ let c = null;
3636
+ n("reportSharing-addPerson");
3637
+ try {
3638
+ c = (await t.post("/reports/version-restrictions", {
3639
+ reportVersionId: e,
3640
+ userRestricts: [
3641
+ {
3642
+ employeeId: o,
3643
+ addRights: i
3644
+ }
3645
+ ]
3646
+ })).data;
3647
+ } finally {
3648
+ a("reportSharing-addPerson");
3649
+ }
3650
+ return c;
3651
+ }, [t, e, n, a]) };
3652
+ }, Cc = ({ isOpen: e, onHide: t, usersData: n, setUsersData: a, reportVersionId: s, EmployeePicker: o }) => {
3653
+ const { ProjectIconComponent: i, texts: { reports: c } } = q(ge), { confirm: l } = Tt(), [u, d] = E(null), { changeEmployeeRights: m } = Nc(s), x = S(async () => {
3654
+ if (u === null)
3655
+ return;
3656
+ const h = await m(u, !0);
3657
+ a(s, h);
3658
+ }, [u, m, s, a]), v = S(async (h) => {
3659
+ if (!await l(c.removeSharingWith(h)))
3660
+ return;
3661
+ const g = await m(h, !1);
3662
+ a(s, g);
3663
+ }, [m, l, s, c, a]);
3664
+ return /* @__PURE__ */ r.jsxs(Ve, { show: e, onHide: t, children: [
3665
+ /* @__PURE__ */ r.jsx(Ve.Header, { closeButton: !0, children: /* @__PURE__ */ r.jsx(Ve.Title, { children: c.reportSharing }) }),
3666
+ /* @__PURE__ */ r.jsxs(Ve.Body, { children: [
3667
+ /* @__PURE__ */ r.jsx(J, { variant: "h6", children: c.sharedWith }),
3668
+ /* @__PURE__ */ r.jsxs(oo, { variant: "flush", children: [
3669
+ n && n.length === 0 ? /* @__PURE__ */ r.jsx("div", { className: "px-2", children: c.noone.toLowerCase() }) : null,
3670
+ n == null ? void 0 : n.map((h) => /* @__PURE__ */ r.jsxs(xn, { className: "d-flex justify-content-between align-items-center gap-3 border-bottom px-2 py-1", children: [
3671
+ h.lastName,
3672
+ " ",
3673
+ h.firstName,
3674
+ " [",
3675
+ h.id,
3676
+ "]",
3677
+ /* @__PURE__ */ r.jsx(re, { color: "danger", onClick: () => v(h.id), children: /* @__PURE__ */ r.jsx(i, { icon: "delete" }) })
3678
+ ] }, h.id))
3679
+ ] }),
3680
+ /* @__PURE__ */ r.jsx(J, { variant: "h6", className: "mt-2 mb-2", children: c.addSharing }),
3681
+ /* @__PURE__ */ r.jsxs("div", { className: "d-flex gap-2 align-items-center", children: [
3682
+ /* @__PURE__ */ r.jsx("div", { className: "flex-grow-1", children: /* @__PURE__ */ r.jsx(o, { defaultSelection: null, label: c.shareWith, onSelect: (h) => {
3683
+ d(h === null ? null : Number(h.id));
3684
+ } }) }),
3685
+ /* @__PURE__ */ r.jsx(Xt, { onClick: x, disabled: u === null, children: c.add })
3686
+ ] })
3687
+ ] })
3688
+ ] });
3689
+ }, Sc = (e, t) => {
3690
+ const [n, a] = E(null);
3691
+ return M(() => {
3692
+ e.then(({ default: s }) => {
3693
+ const o = t !== void 0 ? t(s) : s;
3694
+ a(o);
3695
+ });
3696
+ }, [t, e]), { mappings: n };
3697
+ }, Td = ({ reportType: e, title: t, data: n, filterElements: a, getReportRoute: s, localization: o, licenseKey: i, EmployeePicker: c, localizationJsonFile: l, localizationTransformer: u }) => {
3698
+ const { texts: { reports: d } } = q(ge), { confirm: m } = Tt(), x = $s(), { id: v } = Fs(), h = ne(() => v === void 0 ? null : Number(v), [v]), p = S((A) => {
3699
+ const z = A === null ? "" : A.toString();
3700
+ x(kt(s(e), { id: z }), {
3701
+ replace: !0
3702
+ });
3703
+ }, [s, x, e]), [g, j] = E(!1), b = te(null), { user: f } = q(Ot), { data: y, reloadData: N, setData: k } = As(`/reports/${e}`), { mappings: I } = Sc(l, u), [D, C] = E({}), L = S((A) => {
3704
+ if (y === null)
3705
+ return;
3706
+ const z = A.target.value, me = z === "" ? null : Number(z);
3707
+ p(me);
3708
+ }, [y, p]), O = S(async (A) => {
3709
+ await N(), p(A);
3710
+ }, [N, p]), _ = ne(() => {
3711
+ if (y === null)
3712
+ return null;
3713
+ const A = y.reportVersions.find((z) => z.reportVersionId === h);
3714
+ return A === void 0 ? null : A;
3715
+ }, [y, h]);
3716
+ M(() => {
3717
+ var z;
3718
+ if (y === null)
3719
+ return;
3720
+ if (_ === null) {
3721
+ C({});
3722
+ return;
3723
+ }
3724
+ const A = yc(_) ?? {};
3725
+ C(A), (z = b.current) == null || z.flexmonster.refresh();
3726
+ }, [y, _, h]);
3727
+ const { save: W, saveAs: V, archive: X, detach: R } = _c(e, b, h, O), $ = ne(() => ({
3728
+ data: n ?? [],
3729
+ mapping: I ?? void 0
3730
+ }), [n, I]), P = S(async () => {
3731
+ var z;
3732
+ await m(d.confirmRevertChanges) && ((z = b.current) == null || z.flexmonster.setReport({ dataSource: $, ...D }));
3733
+ }, [m, $, d.confirmRevertChanges, D]), U = ne(() => (_ == null ? void 0 : _.ownerId) === f.personalNumber, [_ == null ? void 0 : _.ownerId, f.personalNumber]), Z = ne(() => {
3734
+ var A;
3735
+ return (A = _ == null ? void 0 : _.users) == null ? void 0 : A.some((z) => z.id === f.personalNumber && !z.isReportOwner);
3736
+ }, [_ == null ? void 0 : _.users, f.personalNumber]), Q = S((A, z) => {
3737
+ k((me) => {
3738
+ const G = me == null ? void 0 : me.reportVersions.findIndex((Ie) => Ie.reportVersionId === A);
3739
+ if (G === void 0 || me === null)
3740
+ return me;
3741
+ const pe = {
3742
+ ...me.reportVersions[G],
3743
+ users: z.filter((Ie) => Ie.isReportOwner === !1)
3744
+ }, Ne = [...me.reportVersions];
3745
+ return Ne[G] = pe, {
3746
+ ...me,
3747
+ reportVersions: Ne
3748
+ };
3749
+ });
3750
+ }, [k]), F = S(async () => {
3751
+ await m(d.confirmDelete(_ == null ? void 0 : _.name)) && (await X(), p(null), await N());
3752
+ }, [X, m, N, _ == null ? void 0 : _.name, d, p]), ee = S(async () => {
3753
+ await m(d.confirmDetach(_ == null ? void 0 : _.name)) && (await R(), p(null), await N());
3754
+ }, [m, R, N, _ == null ? void 0 : _.name, d, p]);
3755
+ return M(() => {
3756
+ var A;
3757
+ h === null && p(((A = y == null ? void 0 : y.reportVersions.find((z) => z.isSystem === !0)) == null ? void 0 : A.reportVersionId) ?? null);
3758
+ }, [y == null ? void 0 : y.reportVersions, h, p]), /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3759
+ /* @__PURE__ */ r.jsx(Ms, { title: /* @__PURE__ */ r.jsxs("div", { className: "d-flex justify-content-start gap-3", children: [
3760
+ /* @__PURE__ */ r.jsx(J, { variant: "h3", children: t }),
3761
+ a,
3762
+ /* @__PURE__ */ r.jsxs("div", { className: "d-flex gap-1 align-items-center", children: [
3763
+ /* @__PURE__ */ r.jsxs(js, { size: "sm", value: h ?? void 0, onChange: L, children: [
3764
+ /* @__PURE__ */ r.jsx("optgroup", { label: d.versionSelectSystem, children: y == null ? void 0 : y.reportVersions.filter((A) => A.isSystem === !0).map((A) => /* @__PURE__ */ r.jsx("option", { value: A.reportVersionId, children: A.name }, A.reportVersionId)) }),
3765
+ /* @__PURE__ */ r.jsx("optgroup", { label: d.versionSelectYour, children: y == null ? void 0 : y.reportVersions.filter((A) => A.ownerId === f.personalNumber).map((A) => /* @__PURE__ */ r.jsx("option", { value: A.reportVersionId, children: A.name }, A.reportVersionId)) }),
3766
+ /* @__PURE__ */ r.jsx("optgroup", { label: d.versionSelectSharedWithYou, children: y == null ? void 0 : y.reportVersions.filter((A) => A.isSystem === !1 && A.ownerId !== f.personalNumber).map((A) => /* @__PURE__ */ r.jsx("option", { value: A.reportVersionId, children: `${A.name} [${A.ownerId}]` }, A.reportVersionId)) })
3767
+ ] }),
3768
+ /* @__PURE__ */ r.jsx(ot, { icon: /* @__PURE__ */ r.jsx(ys, {}), onClick: W, disabled: h === null || (_ == null ? void 0 : _.isSystem) || !U, children: d.save }),
3769
+ /* @__PURE__ */ r.jsx(ot, { icon: /* @__PURE__ */ r.jsx(bs, {}), onClick: V, className: "flex-shrink-0", children: d.saveAs }),
3770
+ /* @__PURE__ */ r.jsxs(dn, { toggle: /* @__PURE__ */ r.jsx(un, { as: pr }), children: [
3771
+ /* @__PURE__ */ r.jsx(Qe, { onClick: P, children: d.revertChanges }),
3772
+ /* @__PURE__ */ r.jsx(Qe, { onClick: () => j(!0), disabled: !U || (_ == null ? void 0 : _.isSystem), children: d.share }),
3773
+ U && !(_ != null && _.isSystem) ? /* @__PURE__ */ r.jsx(Qe, { color: "danger", onClick: F, children: d.delete }) : null,
3774
+ Z && !(_ != null && _.isSystem) ? /* @__PURE__ */ r.jsx(Qe, { color: "danger", onClick: ee, children: d.detach }) : null
3775
+ ] })
3776
+ ] })
3777
+ ] }), children: /* @__PURE__ */ r.jsx("div", { className: w("h-100 w-100", $.data && $.data.length > 0 ? "" : "d-none"), children: /* @__PURE__ */ r.jsx(wc, { dataSource: $, settings: D, pivotRef: b, enabled: $.data && $.data.length > 0, localization: o, licenseKey: i }) }) }),
3778
+ _ !== null ? /* @__PURE__ */ r.jsx(Cc, { isOpen: g, onHide: () => j(!1), usersData: _.users ?? null, setUsersData: Q, reportVersionId: _ == null ? void 0 : _.reportVersionId, EmployeePicker: c }) : null
3779
+ ] });
3780
+ }, Ld = ({ cell: { value: e } }) => /* @__PURE__ */ r.jsx(r.Fragment, { children: e ? /* @__PURE__ */ r.jsx(vr, { name: e, size: 21, fontSize: 12 }) : /* @__PURE__ */ r.jsx(r.Fragment, {}) }), kc = ({ knownTypes: e, typeFilters: t, onChangeTypeFilters: n }) => /* @__PURE__ */ r.jsx("div", { className: "mb-1 d-flex justify-content-center gap-2", children: e.map((a) => /* @__PURE__ */ r.jsx("div", { role: "button", style: {
3781
+ height: "14px",
3782
+ width: "14px",
3783
+ borderRadius: "50%",
3784
+ border: "2px solid transparent",
3785
+ backgroundColor: "transparent"
3786
+ }, className: w(`border-${a}`, t.includes(a) && `bg-${a}`), onClick: () => {
3787
+ t.includes(a) ? n(t.filter((s) => s !== a)) : n([...t, a]);
3788
+ } }, a)) }), Ic = ({ linksTo: e, onClick: t, children: n }) => e ? /* @__PURE__ */ r.jsx(Ze, { to: e, className: "text-decoration-none", onClick: t, children: n }) : /* @__PURE__ */ r.jsx(r.Fragment, { children: n }), Dc = ({ message: e, onDeleteMessage: t, onClickMessage: n, getIcon: a, getLinksTo: s }) => {
3789
+ const { ProjectIconComponent: o, localizationContext: i } = q(ge), { dateFnsLocale: c } = q(i), l = e.dateTime ? vt(e.dateTime) : null, u = l ? Hs(new Date(Date.now()), l) : 0;
3790
+ return /* @__PURE__ */ r.jsxs("div", { children: [
3791
+ l && /* @__PURE__ */ r.jsx("div", { className: "d-flex justify-content-end", children: /* @__PURE__ */ r.jsx(mn, { text: xt(l, "dd.MM.yyyy HH:mm"), placement: "left", children: /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsx(J, { variant: "caption", children: u > 2 ? xt(l, "dd.MM.yyyy") : zs(l, new Date(Date.now()), {
3792
+ locale: c.code
3793
+ }) }) }) }) }),
3794
+ /* @__PURE__ */ r.jsx(Ic, { linksTo: s(e) ?? void 0, onClick: n, children: /* @__PURE__ */ r.jsx(fl, { level: e.type, noIcon: !0, children: /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-start gap-2", children: [
3795
+ a(e),
3796
+ /* @__PURE__ */ r.jsxs("div", { className: "d-flex flex-column gap-1 w-100", children: [
3797
+ /* @__PURE__ */ r.jsxs("div", { className: "d-flex align-items-start justify-content-between gap-3", children: [
3798
+ /* @__PURE__ */ r.jsx(J, { variant: "body2", className: "fw-bold", children: e.subject }),
3799
+ /* @__PURE__ */ r.jsx(re, { size: "sm", onClick: (d) => {
3800
+ d.preventDefault(), d.stopPropagation(), t(e.id);
3801
+ }, children: /* @__PURE__ */ r.jsx(o, { icon: "delete" }) })
3802
+ ] }),
3803
+ /* @__PURE__ */ r.jsx(J, { variant: "body2", children: e.text })
3804
+ ] })
3805
+ ] }) }) })
3806
+ ] });
3807
+ }, rr = ["info", "warning", "danger"], ar = ({ messages: e, isLoading: t, onDeleteMessage: n, onClickMessage: a, getIcon: s, getLinksTo: o }) => {
3808
+ const { texts: { messageBoard: i } } = q(ge), [c, l] = E(rr), u = ne(() => e.filter((d) => c.includes(d.type ?? "")), [c, e]);
3809
+ return /* @__PURE__ */ r.jsxs("div", { className: "h-100 d-flex flex-column overflow-hidden", children: [
3810
+ /* @__PURE__ */ r.jsx(kc, { knownTypes: rr, typeFilters: c, onChangeTypeFilters: (d) => l(d) }),
3811
+ t && /* @__PURE__ */ r.jsxs("div", { className: "p-3 w-100", children: [
3812
+ /* @__PURE__ */ r.jsx(Ae, { as: Tn.Title, animation: "glow", children: /* @__PURE__ */ r.jsx(Ae, { xs: 6 }) }),
3813
+ /* @__PURE__ */ r.jsxs(Ae, { as: Tn.Text, animation: "glow", children: [
3814
+ /* @__PURE__ */ r.jsx(Ae, { xs: 7 }),
3815
+ " ",
3816
+ /* @__PURE__ */ r.jsx(Ae, { xs: 4 }),
3817
+ " ",
3818
+ /* @__PURE__ */ r.jsx(Ae, { xs: 4 }),
3819
+ " ",
3820
+ /* @__PURE__ */ r.jsx(Ae, { xs: 6 }),
3821
+ " ",
3822
+ /* @__PURE__ */ r.jsx(Ae, { xs: 8 })
3823
+ ] })
3824
+ ] }),
3825
+ !t && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3826
+ e.length === 0 && /* @__PURE__ */ r.jsx(la, { variant: "info", size: "sm", className: "mt-2", children: i.noMessages }),
3827
+ /* @__PURE__ */ r.jsx("div", { className: "h-100 overflow-y-auto d-flex flex-column gap-2 luminus-thin-scrollbar", children: u.map((d) => /* @__PURE__ */ r.jsx(Dc, { message: d, onDeleteMessage: n, onClickMessage: a, getIcon: s, getLinksTo: o }, d.id)) })
3828
+ ] })
3829
+ ] });
3830
+ }, Yt = {
3831
+ apiGet: "/messageBoard",
3832
+ apiDelete: "/messageBoard/"
3833
+ }, Rd = ({ renderAsNotifPanel: e, notifIcon: t, apiUrls: { apiGet: n = Yt.apiGet, apiDelete: a = Yt.apiDelete } = Yt, getIcon: s, getLinksTo: o }) => {
3834
+ const c = Je(), [l, u] = E([]), [d, m] = E(!1), [x, v] = E(!1), [h, p] = E(!1), g = S(async () => {
3835
+ v(!0), await c.get(n).then(({ data: N }) => {
3836
+ u(N), m(!0), v(!1);
3837
+ }).catch(() => {
3838
+ u([]), v(!1);
3839
+ });
3840
+ }, [n, c]), j = S(async (N) => c.delete(`${a}${N}`).then(() => !0).catch(() => !1), [a, c]), b = S((N) => {
3841
+ j(N).then((k) => {
3842
+ k && u(l.filter((I) => I.id !== N));
3843
+ });
3844
+ }, [j, l]);
3845
+ M(() => {
3846
+ g();
3847
+ const N = setInterval(() => g(), 60 * 1e3);
3848
+ return () => {
3849
+ clearInterval(N);
3850
+ };
3851
+ }, [g]);
3852
+ const f = l.filter((N) => N.type === "danger").length, y = d ? !1 : x;
3853
+ return e ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3854
+ /* @__PURE__ */ r.jsxs("div", { className: "position-relative", children: [
3855
+ /* @__PURE__ */ r.jsx(re, { size: "md", onClick: () => p(!h), children: t }),
3856
+ f > 0 && /* @__PURE__ */ r.jsx("div", { className: "badge rounded-pill bg-danger p-1 px-2 text-white", style: { position: "absolute", top: "-6px", right: "-10px", fontSize: "10px" }, children: f })
3857
+ ] }),
3858
+ /* @__PURE__ */ r.jsx(Mn, { show: h, onHide: () => p(!1), placement: "end", children: /* @__PURE__ */ r.jsx(Mn.Body, { children: /* @__PURE__ */ r.jsx(ar, { messages: l, isLoading: y, onDeleteMessage: b, onClickMessage: () => p(!1), getIcon: s, getLinksTo: o }) }) })
3859
+ ] }) : /* @__PURE__ */ r.jsx(ar, { messages: l, isLoading: y, onDeleteMessage: b, getIcon: s, getLinksTo: o });
3860
+ }, $c = "_tab-panel_d8l8q_1", Fc = "_full-height-no-overflow_d8l8q_5", Oc = "_disabled_d8l8q_12", Kt = {
3861
+ "tab-panel": "_tab-panel_d8l8q_1",
3862
+ tabPanel: $c,
3863
+ "full-height-no-overflow": "_full-height-no-overflow_d8l8q_5",
3864
+ fullHeightNoOverflow: Fc,
3865
+ disabled: Oc
3866
+ }, Ad = ({ eventKey: e, activeTab: t, fullHeightNoOverflow: n, disabled: a, className: s, children: o }) => e !== t ? null : /* @__PURE__ */ r.jsx("div", { className: w("luminus-tab-panel", Kt.tabPanel, { [Kt.fullHeightNoOverflow]: n }, { disabled: a }, { [Kt.disabled]: a }, s), children: o }), Ec = "_join-line_1q9e8_1", Tc = {
3867
+ "join-line": "_join-line_1q9e8_1",
3868
+ joinLine: Ec
3869
+ }, Md = ({ activeTab: e, onSelect: t, children: n, vertical: a, verticalStepper: s }) => /* @__PURE__ */ r.jsx("div", { className: w("luminus-tabs d-flex mb-2", { "gap-1": !s }, { "gap-0": s }, {
3870
+ "flex-column": a || s
3871
+ }), children: n.map((o, i) => {
3872
+ const c = o.type, l = o.props;
3873
+ if (!l)
3874
+ return null;
3875
+ const u = l.eventKey, d = l.children, m = l.className, x = l.onClick;
3876
+ return /* @__PURE__ */ r.jsxs(Ce.Fragment, { children: [
3877
+ /* @__PURE__ */ r.jsx(c, { ...l, className: w({ active: e === u }, m), onClick: () => {
3878
+ t(u), x && x(u);
3879
+ }, vertical: a || s, children: d }),
3880
+ s && i < n.length - 1 && /* @__PURE__ */ r.jsx("div", { className: w("join-line", Tc.joinLine) })
3881
+ ] }, l.eventKey);
3882
+ }) }), Lc = "_tab_1tbi7_1", Rc = "_disabled_1tbi7_7", Ac = "_vertical_1tbi7_13", qt = {
3883
+ tab: Lc,
3884
+ disabled: Rc,
3885
+ vertical: Ac
3886
+ }, Vd = ({ eventKey: e, className: t, onClick: n, disabled: a, vertical: s, children: o }) => /* @__PURE__ */ r.jsx("div", { role: "button", className: w("luminus-tab text-primary rounded", qt.tab, t, {
3887
+ disabled: a
3888
+ }, { [qt.disabled]: a }, { vertical: s }, { [qt.vertical]: s }), onClick: () => n && !a && n(e), children: typeof o == "string" ? /* @__PURE__ */ r.jsx(J, { variant: s ? "body" : "h6", className: s ? "" : "text-primary", children: o }) : o });
3889
+ export {
3890
+ la as Alert,
3891
+ fl as AlertItem,
3892
+ Jc as ApiFileDownloadButton,
3893
+ sd as AppSearch,
3894
+ od as AuthTemplate,
3895
+ vr as AvatarIcon,
3896
+ oa as Backdrop,
3897
+ nd as Badge,
3898
+ Cd as BarChart,
3899
+ Ri as Card,
3900
+ da as CheckInput,
3901
+ Go as Collapse,
3902
+ ot as ContextButton,
3903
+ jd as DisabledRowLabelLink,
3904
+ Hd as Documents,
3905
+ dn as Dropdown,
3906
+ ad as DropdownDivider,
3907
+ Qe as DropdownItem,
3908
+ cd as DropdownPicker,
3909
+ un as DropdownToggle,
3910
+ xd as DynamicForm,
3911
+ wd as EmployeeSmallPhoto,
3912
+ Lo as ErrorBoundary,
3913
+ Wd as FileExtensionIcon,
3914
+ ed as FileUploadButton,
3915
+ na as FileUploadContextButton,
3916
+ rd as FileUploadDropdownItem,
3917
+ wc as Flexmonster,
3918
+ gl as FloatingActionContainer,
3919
+ go as FloatingFormSubmit,
3920
+ Xe as FloatingLabelInput,
3921
+ md as FromToDatePicker,
3922
+ td as HomeDashboard,
3923
+ Sd as HookFormCheckInput,
3924
+ Id as HookFormDropdownPicker,
3925
+ Dd as HookFormFileInput,
3926
+ $d as HookFormFloatingSubmit,
3927
+ Od as HookFormNumericStepperInput,
3928
+ Ed as HookFormNumericTextInput,
3929
+ kd as HookFormRadioInput,
3930
+ Fd as HookFormSelectInput,
3931
+ zd as HookFormTextAreaInput,
3932
+ Ud as HookFormTextInput,
3933
+ Xc as HtmlTooltip,
3934
+ re as IconButton,
3935
+ zn as ImgApi,
3936
+ ia as ImgDirect,
3937
+ et as InvalidFeedback,
3938
+ yd as LanguageSwitch,
3939
+ kn as Loading,
3940
+ Vs as LoadingBlock,
3941
+ Rd as MessageBoard,
3942
+ xo as MonthPicker,
3943
+ hd as MonthPickerSearchParams,
3944
+ Fe as NoInputContainer,
3945
+ Nd as NumericFormat,
3946
+ ud as NumericStepperInput,
3947
+ fd as NumericTextInput,
3948
+ sl as PhotoLibrary,
3949
+ al as PhotoLightbox,
3950
+ pd as PieChart,
3951
+ Xt as PrimaryButton,
3952
+ Td as ReportPage,
3953
+ Gd as ResponsiveContextDropdown,
3954
+ Yd as ResponsiveContextDropdownItem,
3955
+ Pe as RowLabelInput,
3956
+ _d as SearchBox,
3957
+ Dt as SelectInput,
3958
+ vd as SettingsFormPicker,
3959
+ jn as SimplePicker,
3960
+ pr as SimpleToggle,
3961
+ mn as SimpleTooltip,
3962
+ Vd as Tab,
3963
+ Ad as TabPanel,
3964
+ Md as Tabs,
3965
+ dd as TextAreaInput,
3966
+ at as TextInput,
3967
+ ld as Timeline,
3968
+ bd as TypedFormGroup,
3969
+ J as Typography,
3970
+ Kd as UserAvatarToggle,
3971
+ Ld as UserAvatarValueFormat,
3972
+ id as VersionInfo,
3973
+ Bn as WidgetCard,
3974
+ yo as YearPicker,
3975
+ gd as YearPickerSearchParams
3976
+ };