mario-core 3.0.8-admin → 3.0.8-es

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 (291) hide show
  1. package/dist/Dashboard-DiUm-pc-.js +186 -0
  2. package/dist/Dashboard-HV1eiElu.cjs +1 -0
  3. package/dist/EmailTemplateDetail-D0D3bpWO.cjs +1 -0
  4. package/dist/EmailTemplateDetail-KvZuTCLF.js +411 -0
  5. package/dist/EmailTemplateList-B3YqSFaY.js +172 -0
  6. package/dist/EmailTemplateList-BAejgUUG.cjs +1 -0
  7. package/dist/FaqList-D5XugT5h.js +320 -0
  8. package/dist/FaqList-DpUzQ2vq.cjs +1 -0
  9. package/dist/GalleryList-B5QA3Rol.cjs +1 -0
  10. package/dist/GalleryList-CTo33BcT.js +53 -0
  11. package/dist/Login-CHAmP5ek.js +897 -0
  12. package/dist/Login-Cxbto5eM.cjs +1 -0
  13. package/dist/NotificationList-2Mf_NsOP.js +3631 -0
  14. package/dist/NotificationList-D1jMOBwH.cjs +8 -0
  15. package/dist/SchoolList-CClJ_UPT.cjs +1 -0
  16. package/dist/SchoolList-JmrmL2zE.js +5 -0
  17. package/dist/SkillList-BMyhRY78.js +406 -0
  18. package/dist/SkillList-DlMx_Evw.cjs +1 -0
  19. package/dist/TeacherSelector-B4zvSVhk.js +71 -0
  20. package/dist/TeacherSelector-DORi8RIb.cjs +1 -0
  21. package/dist/TheContent-BHmlooLu.cjs +1 -0
  22. package/dist/TheContent-V2T-Pqz8.js +38 -0
  23. package/dist/UserContainer-B-4oVOEp.cjs +1 -0
  24. package/dist/UserContainer-BaHMryYI.js +2337 -0
  25. package/dist/UserDetail-B-Mq_itT.cjs +1 -0
  26. package/dist/UserDetail-BBRiU97G.js +665 -0
  27. package/dist/assets/Images.d.ts +14 -14
  28. package/dist/components/Alerts/CommonAlert.d.ts +3 -3
  29. package/dist/components/Alerts/EmptyDataAlert.d.ts +8 -8
  30. package/dist/components/Alerts/ErrorHandler.d.ts +6 -6
  31. package/dist/components/Buttons/AddButton.d.ts +8 -7
  32. package/dist/components/Buttons/AddButtonIcon.d.ts +6 -6
  33. package/dist/components/Buttons/CloseButton.d.ts +8 -8
  34. package/dist/components/Buttons/DeleteButtonIcon.d.ts +6 -6
  35. package/dist/components/Buttons/DetailActionButtons.d.ts +9 -8
  36. package/dist/components/Buttons/EditButtonIcon.d.ts +6 -6
  37. package/dist/components/Buttons/LinkEditButton.d.ts +8 -7
  38. package/dist/components/Buttons/LoginNavButton.d.ts +8 -8
  39. package/dist/components/Buttons/ToggleButton.d.ts +10 -10
  40. package/dist/components/Buttons/UploadFileButton.d.ts +13 -13
  41. package/dist/components/Headers/CommonHeader.d.ts +7 -7
  42. package/dist/components/Image/UploadImage.d.ts +2 -3
  43. package/dist/components/Inputs/FileInput.d.ts +8 -8
  44. package/dist/components/Inputs/PasswordInput.d.ts +8 -8
  45. package/dist/components/Inputs/SearchBox.d.ts +10 -10
  46. package/dist/components/Inputs/SearchBoxContainer.d.ts +9 -10
  47. package/dist/components/Labels/RequiredLabel.d.ts +6 -6
  48. package/dist/components/Loading/Loading.d.ts +3 -3
  49. package/dist/components/Modals/CommonModal.d.ts +2 -3
  50. package/dist/components/Modals/NotificationLogoutModal.d.ts +2 -0
  51. package/dist/components/Modals/NotificationModal.d.ts +2 -3
  52. package/dist/components/Others/QuitPrompt.d.ts +5 -2
  53. package/dist/components/Pagination/CustomPagination.d.ts +2 -3
  54. package/dist/components/Scroll/ScrollToTop.d.ts +3 -3
  55. package/dist/components/Selectors/AcademicClassSelector.d.ts +2 -3
  56. package/dist/components/Selectors/CreatableSelector.d.ts +2 -3
  57. package/dist/components/Selectors/CustomSelector.d.ts +2 -3
  58. package/dist/components/Selectors/MailCategorySelectors.d.ts +2 -3
  59. package/dist/components/Selectors/QuestionCategorySelector.d.ts +2 -3
  60. package/dist/components/Selectors/QuestionTypeSelector.d.ts +2 -3
  61. package/dist/components/Selectors/StarRatingSelector.d.ts +2 -3
  62. package/dist/components/Selectors/SuggestionCategorySelector.d.ts +2 -3
  63. package/dist/components/Tabs/CustomTab.d.ts +2 -3
  64. package/dist/components/Tabs/TabsWithComponent.d.ts +10 -0
  65. package/dist/configs/editorConfig.d.ts +7 -7
  66. package/dist/containers/Commons/NotFound.d.ts +3 -3
  67. package/dist/containers/DistrictSchools/views/SchoolList.d.ts +3 -3
  68. package/dist/containers/EmailTemplate/components/AttachmentFile.d.ts +8 -7
  69. package/dist/containers/EmailTemplate/components/MailParam.d.ts +8 -7
  70. package/dist/containers/EmailTemplate/configs/emailTemplateSchema.d.ts +13 -13
  71. package/dist/containers/EmailTemplate/hooks/useEmailTemplateDetail.d.ts +27 -28
  72. package/dist/containers/EmailTemplate/hooks/useEmailTemplateList.d.ts +11 -11
  73. package/dist/containers/EmailTemplate/views/EmailTemplateDetail.d.ts +3 -3
  74. package/dist/containers/EmailTemplate/views/EmailTemplateList.d.ts +3 -3
  75. package/dist/containers/Faq/components/FaqDetailModal.d.ts +2 -3
  76. package/dist/containers/Faq/hooks/useFaqDetail.d.ts +17 -18
  77. package/dist/containers/Faq/hooks/useFaqList.d.ts +9 -9
  78. package/dist/containers/Faq/views/FaqList.d.ts +3 -3
  79. package/dist/containers/Gallery/components/ActionModal.d.ts +2 -3
  80. package/dist/containers/Gallery/components/Filter.d.ts +9 -8
  81. package/dist/containers/Gallery/components/Media.d.ts +9 -8
  82. package/dist/containers/Gallery/components/MediaDetail.d.ts +7 -7
  83. package/dist/containers/Gallery/components/MediaList.d.ts +7 -7
  84. package/dist/containers/Gallery/components/MediaNav.d.ts +19 -18
  85. package/dist/containers/Gallery/constants/gallery.types.d.ts +21 -21
  86. package/dist/containers/Gallery/extensions/helpers.d.ts +4 -4
  87. package/dist/containers/Gallery/hooks/useGalleryList.d.ts +30 -31
  88. package/dist/containers/Gallery/views/GalleryList.d.ts +6 -6
  89. package/dist/containers/Login/components/GoogleLoginButton.d.ts +10 -0
  90. package/dist/containers/Login/constant/authConfig.d.ts +38 -0
  91. package/dist/containers/Login/constant/types.d.ts +27 -0
  92. package/dist/containers/Login/hooks/useForgotPassword.d.ts +20 -21
  93. package/dist/containers/Login/hooks/useLogin.d.ts +26 -23
  94. package/dist/containers/Login/hooks/useLoginTwoFactor.d.ts +4 -4
  95. package/dist/containers/Login/views/Dashboard.d.ts +3 -3
  96. package/dist/containers/Login/views/Login.d.ts +8 -9
  97. package/dist/containers/Login/views/block/BlockBackground.d.ts +7 -0
  98. package/dist/containers/Login/views/block/BlockForgetPassword.d.ts +6 -3
  99. package/dist/containers/Login/views/block/BlockLogin.d.ts +9 -7
  100. package/dist/containers/Login/views/block/BlockResetPassword.d.ts +2 -3
  101. package/dist/containers/Login/views/block/BlockSelectTeacher.d.ts +11 -12
  102. package/dist/containers/Login/views/block/BlockTwoFactorLogin.d.ts +2 -3
  103. package/dist/containers/Login/views/block/CloseBlock.d.ts +6 -6
  104. package/dist/containers/Login/views/block/ContentHomePage.d.ts +5 -5
  105. package/dist/containers/Login/views/block/IconContent.d.ts +7 -7
  106. package/dist/containers/Login/views/block/QuoteContent.d.ts +2 -3
  107. package/dist/containers/Notifications/components/NotificationButton.d.ts +5 -5
  108. package/dist/containers/Notifications/components/NotificationStatusSelector.d.ts +6 -7
  109. package/dist/containers/Notifications/hooks/useNotificationList.d.ts +17 -17
  110. package/dist/containers/Notifications/hooks/useUnreadNotification.d.ts +4 -4
  111. package/dist/containers/Notifications/views/NotificationList.d.ts +2 -3
  112. package/dist/containers/Skill/components/SkillDetailModal.d.ts +2 -3
  113. package/dist/containers/Skill/components/SkillSelector.d.ts +2 -3
  114. package/dist/containers/Skill/hooks/useSkillDetail.d.ts +19 -20
  115. package/dist/containers/Skill/hooks/useSkillList.d.ts +10 -9
  116. package/dist/containers/Skill/views/SkillList.d.ts +3 -3
  117. package/dist/containers/User/components/AssignStudentModal.d.ts +19 -0
  118. package/dist/containers/User/components/DeleteBulkModel.d.ts +3 -0
  119. package/dist/containers/User/components/FilterPopover.d.ts +21 -0
  120. package/dist/containers/User/components/HeaderCell.d.ts +19 -0
  121. package/dist/containers/User/components/RemoveAssistant.d.ts +3 -0
  122. package/dist/containers/User/components/RemoveCounselor.d.ts +3 -0
  123. package/dist/containers/User/components/RemoveTeacher.d.ts +3 -0
  124. package/dist/containers/User/components/TableHeader.d.ts +14 -0
  125. package/dist/containers/User/components/TeacherSelector.d.ts +2 -0
  126. package/dist/containers/User/configs/changePasswordSchema.d.ts +11 -10
  127. package/dist/containers/User/configs/constants.d.ts +62 -0
  128. package/dist/containers/User/configs/type.d.ts +210 -0
  129. package/dist/containers/User/configs/userSchema.d.ts +15 -15
  130. package/dist/containers/User/hooks/useAssignStudent.d.ts +33 -0
  131. package/dist/containers/User/hooks/useAssignStudentList.d.ts +33 -0
  132. package/dist/containers/User/hooks/useAssistantList.d.ts +9 -0
  133. package/dist/containers/User/hooks/useClickOutside.d.ts +2 -0
  134. package/dist/containers/User/hooks/useCounselorList.d.ts +9 -0
  135. package/dist/containers/User/hooks/useFilterPopover.d.ts +36 -0
  136. package/dist/containers/User/hooks/useTableHeader.d.ts +19 -0
  137. package/dist/containers/User/hooks/useTeacherList.d.ts +9 -0
  138. package/dist/containers/User/hooks/useUserDetail.d.ts +31 -24
  139. package/dist/containers/User/hooks/useUserList.d.ts +14 -11
  140. package/dist/containers/User/hooks/userFilters.d.ts +7 -0
  141. package/dist/containers/User/views/AssignStudentList.d.ts +2 -0
  142. package/dist/containers/User/views/UserContainer.d.ts +2 -0
  143. package/dist/containers/User/views/UserDetail.d.ts +2 -3
  144. package/dist/containers/User/views/UserList.d.ts +2 -3
  145. package/dist/hooks/useClassFontSize.d.ts +4 -0
  146. package/dist/hooks/useFilters.d.ts +7 -8
  147. package/dist/i18n.d.ts +2 -2
  148. package/dist/index-C95SWLrn.js +18163 -0
  149. package/dist/index-DixwqZ17.cjs +29 -0
  150. package/dist/index.d.ts +111 -110
  151. package/dist/index.esm-BckW25l9.cjs +1 -0
  152. package/dist/index.esm-hqKUWCW0.js +15 -0
  153. package/dist/index.js +1 -10373
  154. package/dist/index.modern.js +159 -10213
  155. package/dist/layouts/TheContent.d.ts +3 -3
  156. package/dist/mailCategoryService-BqDtPJRc.js +10 -0
  157. package/dist/mailCategoryService-DBMJOyls.cjs +1 -0
  158. package/dist/mario-core.css +5 -0
  159. package/dist/redux/assessments/action.d.ts +1 -1
  160. package/dist/redux/assessments/reducer.d.ts +10 -5
  161. package/dist/redux/assignment/action.d.ts +1 -1
  162. package/dist/redux/assignment/reducer.d.ts +4 -2
  163. package/dist/redux/assistants/action.d.ts +1 -1
  164. package/dist/redux/assistants/reducer.d.ts +4 -2
  165. package/dist/redux/badges/action.d.ts +1 -1
  166. package/dist/redux/badges/reducer.d.ts +4 -2
  167. package/dist/redux/bandScores/action.d.ts +1 -1
  168. package/dist/redux/bandScores/reducer.d.ts +4 -2
  169. package/dist/redux/certificate/action.d.ts +1 -1
  170. package/dist/redux/certificate/reducer.d.ts +4 -2
  171. package/dist/redux/classes/action.d.ts +1 -1
  172. package/dist/redux/classes/reducer.d.ts +4 -2
  173. package/dist/redux/commons/action.d.ts +18 -18
  174. package/dist/redux/commons/reducer.d.ts +4 -2
  175. package/dist/redux/conferenceRubrics/action.d.ts +1 -1
  176. package/dist/redux/conferenceRubrics/reducer.d.ts +4 -2
  177. package/dist/redux/customAlert/action.d.ts +1 -1
  178. package/dist/redux/customAlert/reducer.d.ts +4 -2
  179. package/dist/redux/dashboard/action.d.ts +5 -5
  180. package/dist/redux/dashboard/reducer.d.ts +4 -2
  181. package/dist/redux/dataPlayer/action.d.ts +2 -2
  182. package/dist/redux/dataPlayer/reducer.d.ts +4 -2
  183. package/dist/redux/emailTemplates/action.d.ts +1 -1
  184. package/dist/redux/emailTemplates/reducer.d.ts +4 -2
  185. package/dist/redux/faqs/action.d.ts +1 -1
  186. package/dist/redux/faqs/reducer.d.ts +4 -2
  187. package/dist/redux/feedback/action.d.ts +1 -1
  188. package/dist/redux/feedback/reducer.d.ts +4 -2
  189. package/dist/redux/gallery/action.d.ts +2 -2
  190. package/dist/redux/gallery/reducer.d.ts +4 -2
  191. package/dist/redux/goalExamples/action.d.ts +1 -1
  192. package/dist/redux/goalExamples/reducer.d.ts +4 -2
  193. package/dist/redux/improveMyClass/action.d.ts +1 -1
  194. package/dist/redux/improveMyClass/reducer.d.ts +4 -2
  195. package/dist/redux/learningStrategies/action.d.ts +1 -1
  196. package/dist/redux/learningStrategies/reducer.d.ts +4 -2
  197. package/dist/redux/learningSupportCategories/action.d.ts +1 -1
  198. package/dist/redux/learningSupportCategories/reducer.d.ts +4 -2
  199. package/dist/redux/mailCategories/action.d.ts +1 -1
  200. package/dist/redux/mailCategories/reducer.d.ts +4 -2
  201. package/dist/redux/navMobile/action.d.ts +1 -1
  202. package/dist/redux/navMobile/reducer.d.ts +4 -2
  203. package/dist/redux/notifications/action.d.ts +3 -3
  204. package/dist/redux/notifications/reducer.d.ts +4 -2
  205. package/dist/redux/questionBanks/action.d.ts +1 -1
  206. package/dist/redux/questionBanks/reducer.d.ts +4 -2
  207. package/dist/redux/questionByCategory/action.d.ts +8 -8
  208. package/dist/redux/questionByCategory/reducer.d.ts +4 -2
  209. package/dist/redux/questionCategory/action.d.ts +1 -1
  210. package/dist/redux/questionCategory/reducer.d.ts +4 -2
  211. package/dist/redux/reflectionForms/action.d.ts +1 -1
  212. package/dist/redux/reflectionForms/reducer.d.ts +4 -2
  213. package/dist/redux/reflectionResults/action.d.ts +1 -1
  214. package/dist/redux/reflectionResults/reducer.d.ts +4 -2
  215. package/dist/redux/schoolBlankDays/action.d.ts +1 -1
  216. package/dist/redux/schoolBlankDays/reducer.d.ts +4 -2
  217. package/dist/redux/semester/action.d.ts +1 -1
  218. package/dist/redux/semester/reducer.d.ts +4 -2
  219. package/dist/redux/sessionPlayers/action.d.ts +5 -5
  220. package/dist/redux/sessionPlayers/reducer.d.ts +4 -2
  221. package/dist/redux/sessionTemplateGeneralClasses/action.d.ts +1 -1
  222. package/dist/redux/sessionTemplateGeneralClasses/reducer.d.ts +4 -2
  223. package/dist/redux/sessionTemplates/action.d.ts +1 -1
  224. package/dist/redux/sessionTemplates/reducer.d.ts +4 -2
  225. package/dist/redux/skills/action.d.ts +1 -1
  226. package/dist/redux/skills/reducer.d.ts +4 -2
  227. package/dist/redux/subjects/action.d.ts +1 -1
  228. package/dist/redux/subjects/reducer.d.ts +4 -2
  229. package/dist/redux/suggestionBanks/action.d.ts +1 -1
  230. package/dist/redux/suggestionBanks/reducer.d.ts +4 -2
  231. package/dist/redux/teacher/myStudent/action.d.ts +1 -1
  232. package/dist/redux/teacher/myStudent/reducer.d.ts +4 -2
  233. package/dist/redux/tutorialScreen/action.d.ts +1 -1
  234. package/dist/redux/tutorialScreen/reducer.d.ts +10 -5
  235. package/dist/redux/users/action.d.ts +2 -2
  236. package/dist/redux/users/reducer.d.ts +4 -2
  237. package/dist/redux/widget/action.d.ts +1 -1
  238. package/dist/redux/widget/reducer.d.ts +4 -2
  239. package/dist/rootReducer.d.ts +96 -49
  240. package/dist/services/accountService.d.ts +13 -12
  241. package/dist/services/api.d.ts +3 -3
  242. package/dist/services/classService.d.ts +1 -1
  243. package/dist/services/emailTemplateService.d.ts +6 -6
  244. package/dist/services/faqService.d.ts +6 -6
  245. package/dist/services/fileServices.d.ts +13 -13
  246. package/dist/services/galleryService.d.ts +2 -2
  247. package/dist/services/languageService.d.ts +1 -0
  248. package/dist/services/mailCategoryService.d.ts +1 -1
  249. package/dist/services/notificationService.d.ts +7 -7
  250. package/dist/services/questionCategoryService.d.ts +1 -1
  251. package/dist/services/schoolService.d.ts +1 -0
  252. package/dist/services/skillService.d.ts +6 -6
  253. package/dist/services/suggestionCategoryService.d.ts +1 -1
  254. package/dist/services/userService.d.ts +21 -9
  255. package/dist/store.d.ts +3 -3
  256. package/dist/types/Conversation.d.ts +8 -8
  257. package/dist/types/ConversationMember.d.ts +5 -5
  258. package/dist/types/Dashboard.d.ts +5 -5
  259. package/dist/types/Filter.d.ts +10 -10
  260. package/dist/types/Language.d.ts +8 -0
  261. package/dist/types/Message.d.ts +13 -13
  262. package/dist/types/Notification.d.ts +8 -8
  263. package/dist/utils/canAccessRoute.d.ts +2 -2
  264. package/dist/utils/constants.d.ts +77 -67
  265. package/dist/utils/debounce.d.ts +2 -2
  266. package/dist/utils/domHelpers.d.ts +2 -2
  267. package/dist/utils/encodeParams.d.ts +2 -2
  268. package/dist/utils/firstCheckToken.d.ts +2 -2
  269. package/dist/utils/generateRandomString.d.ts +2 -2
  270. package/dist/utils/getAccessToken.d.ts +2 -2
  271. package/dist/utils/getCookieValue.d.ts +2 -0
  272. package/dist/utils/getFileUrl.d.ts +2 -2
  273. package/dist/utils/getStaticFileUrl.d.ts +2 -0
  274. package/dist/utils/getTextFromHTML.d.ts +2 -2
  275. package/dist/utils/utcToLocalTime.d.ts +2 -2
  276. package/package.json +68 -77
  277. package/dist/components/Alerts/ReactNotification.d.ts +0 -4
  278. package/dist/containers/Login/constant/type.d.ts +0 -5
  279. package/dist/containers/Login/views/ModelSelectRole.d.ts +0 -4
  280. package/dist/index.css +0 -658
  281. package/dist/index.js.map +0 -1
  282. package/dist/index.modern.js.map +0 -1
  283. package/dist/index.test.d.ts +0 -1
  284. package/dist/layouts/TheFooter.d.ts +0 -3
  285. package/dist/layouts/TheHeader.d.ts +0 -3
  286. package/dist/layouts/TheHeaderDropdown.d.ts +0 -3
  287. package/dist/layouts/TheLanguageDropdown.d.ts +0 -3
  288. package/dist/layouts/TheLayout.d.ts +0 -4
  289. package/dist/layouts/TheSidebar.d.ts +0 -3
  290. package/dist/types/Payload.d.ts +0 -15
  291. package/dist/utils/amplitude.d.ts +0 -1
@@ -0,0 +1,186 @@
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import { useState as N, useRef as I, useCallback as h, useEffect as f } from "react";
3
+ import { useSelector as k } from "react-redux";
4
+ import { Row as T, Col as u, Navbar as C, NavbarBrand as y, Collapse as A, Nav as E, NavItem as g, NavLink as v } from "reactstrap";
5
+ import { h as n, m as i, G as w } from "./index-C95SWLrn.js";
6
+ import { Link as p } from "react-router-dom";
7
+ const H = () => /* @__PURE__ */ a("div", { className: `${n["content-quote"]}`, children: [
8
+ /* @__PURE__ */ a("div", { className: `${n["title-quote"]} d-block`, children: [
9
+ /* @__PURE__ */ e("p", { children: "Powerful" }),
10
+ /* @__PURE__ */ e("p", { children: "Personalized" }),
11
+ /* @__PURE__ */ e("p", { children: "Learning" })
12
+ ] }),
13
+ /* @__PURE__ */ a(
14
+ "div",
15
+ {
16
+ className: `${n["descriptions-quote"]} d-block`,
17
+ children: [
18
+ /* @__PURE__ */ e("p", { children: "Focus on what matters most to you and" }),
19
+ /* @__PURE__ */ e("p", { children: "make learning meaningful." })
20
+ ]
21
+ }
22
+ )
23
+ ] }), M = ({ srcIcon: t, content: r }) => /* @__PURE__ */ a("div", { className: `${n["content-icon"]}`, children: [
24
+ /* @__PURE__ */ e("div", { className: `${n["title-icon"]}`, children: /* @__PURE__ */ e("img", { src: i(t), alt: "icon" }) }),
25
+ /* @__PURE__ */ e(
26
+ "div",
27
+ {
28
+ className: `${n["descriptions-icon"]}`,
29
+ dangerouslySetInnerHTML: { __html: r }
30
+ }
31
+ )
32
+ ] }, r), D = [
33
+ {
34
+ scrIcon: "/images/ChatsTeardrop.svg",
35
+ content: "<p>Understand yourself better through <span>helpful feedback</span>.</p>"
36
+ },
37
+ {
38
+ scrIcon: "/images/Student.svg",
39
+ content: "<p>Create, explore, and share exciting <span>personalized</span> learning journeys.</p>"
40
+ },
41
+ {
42
+ scrIcon: "/images/Confetti.svg",
43
+ content: "<p>Set, monitor, and achieve <span>your goals</span>.</p>"
44
+ }
45
+ ], L = ({}) => /* @__PURE__ */ a(T, { className: `${n["page-not-login"]}`, children: [
46
+ /* @__PURE__ */ e(u, { md: 12, children: /* @__PURE__ */ e(H, {}) }),
47
+ /* @__PURE__ */ e(u, { md: 12, className: `${n["box-content-home-page"]} d-flex align-items-center`, children: D.map((t) => /* @__PURE__ */ e(
48
+ M,
49
+ {
50
+ srcIcon: t.scrIcon,
51
+ content: t.content
52
+ },
53
+ t.content
54
+ )) })
55
+ ] }), O = 10001, S = ({
56
+ data: t,
57
+ duration: r = O
58
+ }) => {
59
+ const [o, m] = N(t.length), s = I(null), d = h((c) => c === o ? `${n.active} ${n.show}` : "", [o]), $ = h((c) => o === 0 && c === t.length - 1 || c === o - 1 ? n.behind : "", [o, t.length]), b = h(() => {
60
+ s && s.current && clearInterval(s.current), s.current = setInterval(() => {
61
+ m((c) => c >= t.length - 1 ? 0 : c + 1);
62
+ }, r);
63
+ }, [r, t.length]);
64
+ return f(() => (b(), () => {
65
+ s && s.current && clearInterval(s.current);
66
+ }), [t.length, r]), /* @__PURE__ */ e("div", { className: `${n["bg-animate"]} position-absolute`, children: t.map((c, l) => /* @__PURE__ */ e(
67
+ "img",
68
+ {
69
+ alt: `Image ${l + 1}`,
70
+ className: `${$(l)} ${d(l)}`,
71
+ src: i(c)
72
+ },
73
+ l
74
+ )) });
75
+ };
76
+ function _(t) {
77
+ return w({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M32 96v64h448V96H32zm0 128v64h448v-64H32zm0 128v64h448v-64H32z" } }] })(t);
78
+ }
79
+ const j = "/admin/users/user-list", x = "/home", B = "/home", R = "Dashboard", U = "Mario Framework", z = [
80
+ "images/landing-page.jpg",
81
+ "images/landing-page2.jpg",
82
+ "images/landing-page3.jpg"
83
+ ], J = ({ version: t }) => {
84
+ const r = k((d) => d.common.user), [o, m] = N(!1), s = () => m(!o);
85
+ return f(() => {
86
+ r ? document.title = R : document.title = U;
87
+ }, [r]), /* @__PURE__ */ a("div", { className: `${n.login} ${n["red-background"]} position-relative`, children: [
88
+ /* @__PURE__ */ e("span", { className: `${n["version-prod"]}`, children: `v ${t}` }),
89
+ /* @__PURE__ */ e(
90
+ S,
91
+ {
92
+ data: z
93
+ }
94
+ ),
95
+ /* @__PURE__ */ a("div", { className: `${n["login-content"]}`, children: [
96
+ /* @__PURE__ */ a(C, { light: !0, expand: "md", children: [
97
+ /* @__PURE__ */ e(y, { href: "/", className: `${n["logo-home"]}`, children: /* @__PURE__ */ e("img", { src: i("/images/logo-white.svg"), alt: "mario" }) }),
98
+ /* @__PURE__ */ e(
99
+ _,
100
+ {
101
+ onClick: s,
102
+ className: `${n["hide-in-desktop"]} ${n["hamburger-menu"]}`
103
+ }
104
+ ),
105
+ /* @__PURE__ */ a(
106
+ A,
107
+ {
108
+ isOpen: o,
109
+ navbar: !0,
110
+ className: `${n["collapse-box"]}`,
111
+ children: [
112
+ /* @__PURE__ */ a(
113
+ E,
114
+ {
115
+ className: `${n["nav-home"]} d-md-flex w-100 justify-content-center mr-auto`,
116
+ navbar: !0,
117
+ children: [
118
+ /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(
119
+ v,
120
+ {
121
+ className: `${n["learn-more"]} align-self-md-center`,
122
+ href: "https://marioframework.com/software",
123
+ target: "blank",
124
+ children: "Learn More"
125
+ }
126
+ ) }),
127
+ /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(
128
+ p,
129
+ {
130
+ className: `${n.contact} align-self-md-center`,
131
+ to: "/contact",
132
+ children: "Contact"
133
+ }
134
+ ) }),
135
+ /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(
136
+ v,
137
+ {
138
+ className: `${n["learn-more"]} align-self-md-center`,
139
+ href: "/privacy-policy",
140
+ target: "blank",
141
+ children: "Privacy Policy"
142
+ }
143
+ ) })
144
+ ]
145
+ }
146
+ ),
147
+ /* @__PURE__ */ e(
148
+ "div",
149
+ {
150
+ className: `${n["hide-in-mobile"]} d-flex justify-content-end`,
151
+ children: r ? /* @__PURE__ */ e(
152
+ p,
153
+ {
154
+ to: r.roles.includes("Admin") ? j : r.roles.includes("Teacher") ? x : B,
155
+ className: `${n["btn-trans-border"]}`,
156
+ children: "Dashboard"
157
+ }
158
+ ) : /* @__PURE__ */ e(
159
+ p,
160
+ {
161
+ to: "/login",
162
+ className: `${n["btn-trans-border"]}`,
163
+ children: "Login"
164
+ }
165
+ )
166
+ }
167
+ )
168
+ ]
169
+ }
170
+ )
171
+ ] }),
172
+ /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ e(L, {}) }),
173
+ /* @__PURE__ */ e("div", { className: `${n["digital-privacy-icon"]}`, children: /* @__PURE__ */ e(
174
+ "a",
175
+ {
176
+ href: "https://cert.privo.com/#/companies/marioFrameworkLlc",
177
+ target: "blank",
178
+ children: /* @__PURE__ */ e("img", { src: i("/images/STUDENT1.png"), alt: "icon" })
179
+ }
180
+ ) })
181
+ ] })
182
+ ] });
183
+ };
184
+ export {
185
+ J as default
186
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),p=require("react-redux"),a=require("reactstrap"),s=require("./index-DixwqZ17.cjs"),g=require("react-router-dom"),j=()=>e.jsxs("div",{className:`${s.styles["content-quote"]}`,children:[e.jsxs("div",{className:`${s.styles["title-quote"]} d-block`,children:[e.jsx("p",{children:"Powerful"}),e.jsx("p",{children:"Personalized"}),e.jsx("p",{children:"Learning"})]}),e.jsxs("div",{className:`${s.styles["descriptions-quote"]} d-block`,children:[e.jsx("p",{children:"Focus on what matters most to you and"}),e.jsx("p",{children:"make learning meaningful."})]})]}),x=({srcIcon:t,content:n})=>e.jsxs("div",{className:`${s.styles["content-icon"]}`,children:[e.jsx("div",{className:`${s.styles["title-icon"]}`,children:e.jsx("img",{src:s.getStaticFileUrl(t),alt:"icon"})}),e.jsx("div",{className:`${s.styles["descriptions-icon"]}`,dangerouslySetInnerHTML:{__html:n}})]},n),v=[{scrIcon:"/images/ChatsTeardrop.svg",content:"<p>Understand yourself better through <span>helpful feedback</span>.</p>"},{scrIcon:"/images/Student.svg",content:"<p>Create, explore, and share exciting <span>personalized</span> learning journeys.</p>"},{scrIcon:"/images/Confetti.svg",content:"<p>Set, monitor, and achieve <span>your goals</span>.</p>"}],y=({})=>e.jsxs(a.Row,{className:`${s.styles["page-not-login"]}`,children:[e.jsx(a.Col,{md:12,children:e.jsx(j,{})}),e.jsx(a.Col,{md:12,className:`${s.styles["box-content-home-page"]} d-flex align-items-center`,children:v.map(t=>e.jsx(x,{srcIcon:t.scrIcon,content:t.content},t.content))})]}),N=10001,b=({data:t,duration:n=N})=>{const[c,m]=i.useState(t.length),r=i.useRef(null),d=i.useCallback(l=>l===c?`${s.styles.active} ${s.styles.show}`:"",[c]),h=i.useCallback(l=>c===0&&l===t.length-1||l===c-1?s.styles.behind:"",[c,t.length]),u=i.useCallback(()=>{r&&r.current&&clearInterval(r.current),r.current=setInterval(()=>{m(l=>l>=t.length-1?0:l+1)},n)},[n,t.length]);return i.useEffect(()=>(u(),()=>{r&&r.current&&clearInterval(r.current)}),[t.length,n]),e.jsx("div",{className:`${s.styles["bg-animate"]} position-absolute`,children:t.map((l,o)=>e.jsx("img",{alt:`Image ${o+1}`,className:`${h(o)} ${d(o)}`,src:s.getStaticFileUrl(l)},o))})};function f(t){return s.GenIcon({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M32 96v64h448V96H32zm0 128v64h448v-64H32zm0 128v64h448v-64H32z"}}]})(t)}const $="/admin/users/user-list",I="/home",k="/home",C="Dashboard",T="Mario Framework",S=["images/landing-page.jpg","images/landing-page2.jpg","images/landing-page3.jpg"],E=({version:t})=>{const n=p.useSelector(d=>d.common.user),[c,m]=i.useState(!1),r=()=>m(!c);return i.useEffect(()=>{n?document.title=C:document.title=T},[n]),e.jsxs("div",{className:`${s.styles.login} ${s.styles["red-background"]} position-relative`,children:[e.jsx("span",{className:`${s.styles["version-prod"]}`,children:`v ${t}`}),e.jsx(b,{data:S}),e.jsxs("div",{className:`${s.styles["login-content"]}`,children:[e.jsxs(a.Navbar,{light:!0,expand:"md",children:[e.jsx(a.NavbarBrand,{href:"/",className:`${s.styles["logo-home"]}`,children:e.jsx("img",{src:s.getStaticFileUrl("/images/logo-white.svg"),alt:"mario"})}),e.jsx(f,{onClick:r,className:`${s.styles["hide-in-desktop"]} ${s.styles["hamburger-menu"]}`}),e.jsxs(a.Collapse,{isOpen:c,navbar:!0,className:`${s.styles["collapse-box"]}`,children:[e.jsxs(a.Nav,{className:`${s.styles["nav-home"]} d-md-flex w-100 justify-content-center mr-auto`,navbar:!0,children:[e.jsx(a.NavItem,{children:e.jsx(a.NavLink,{className:`${s.styles["learn-more"]} align-self-md-center`,href:"https://marioframework.com/software",target:"blank",children:"Learn More"})}),e.jsx(a.NavItem,{children:e.jsx(g.Link,{className:`${s.styles.contact} align-self-md-center`,to:"/contact",children:"Contact"})}),e.jsx(a.NavItem,{children:e.jsx(a.NavLink,{className:`${s.styles["learn-more"]} align-self-md-center`,href:"/privacy-policy",target:"blank",children:"Privacy Policy"})})]}),e.jsx("div",{className:`${s.styles["hide-in-mobile"]} d-flex justify-content-end`,children:n?e.jsx(g.Link,{to:n.roles.includes("Admin")?$:n.roles.includes("Teacher")?I:k,className:`${s.styles["btn-trans-border"]}`,children:"Dashboard"}):e.jsx(g.Link,{to:"/login",className:`${s.styles["btn-trans-border"]}`,children:"Login"})})]})]}),e.jsx("div",{className:"",children:e.jsx(y,{})}),e.jsx("div",{className:`${s.styles["digital-privacy-icon"]}`,children:e.jsx("a",{href:"https://cert.privo.com/#/companies/marioFrameworkLlc",target:"blank",children:e.jsx("img",{src:s.getStaticFileUrl("/images/STUDENT1.png"),alt:"icon"})})})]})]})};exports.default=E;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("reactstrap"),k=require("react-router-dom"),P=require("@tinymce/tinymce-react"),U=require("formik"),s=require("./index-DixwqZ17.cjs"),F=require("react-i18next"),h=require("react"),B=require("react-select"),w=require("react-redux"),_=require("./mailCategoryService-DBMJOyls.cjs"),O=require("yup");function H(n){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const u=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(c,o,u.get?u:{enumerable:!0,get:()=>n[o]})}}return c.default=n,Object.freeze(c)}const T=H(O),V=({onClick:n})=>e.jsx("div",{className:"d-inline text-center cursor-pointer hover-opacity",title:"Delete",onClick:n,children:e.jsx(s.FaPlus,{})}),z=[{label:"$USER_FIRST_NAME$",meaning:"User first name"},{label:"$USER_LAST_NAME$",meaning:"User last name"},{label:"$PASSWORD$",meaning:"Password"},{label:"$USER_NAME$",meaning:"User name"},{label:"$USER_EMAIL$",meaning:"User email"},{label:"$MESSAGE$",meaning:"Message"},{label:"$DOMAIN$",meaning:"DOMAIN"}],G=({onClick:n,isResetPasswordTemplate:c,className:o})=>{const{t:u}=F.useTranslation();let p=c?[...z,{label:"$RESET_LINK$",meaning:"Reset link"}]:z;return e.jsxs(r.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:`align-top ${o}`,children:u("params")}),e.jsx("th",{className:`align-top ${o}`,children:u("meaning")}),e.jsx("th",{})]})}),e.jsx("tbody",{children:p.map(f=>e.jsxs("tr",{children:[e.jsx("td",{className:`align-middle ${o}`,children:f.label}),e.jsx("td",{className:`align-middle ${o}`,children:f.meaning}),e.jsx("td",{className:"text-center align-middle",children:e.jsx(V,{onClick:()=>n(f)})})]},f.label))})]})},K=n=>{const c=w.useDispatch(),o=w.useSelector(d=>d.mailCategory.mailCategoryList);h.useEffect(()=>{u()},[]);const u=async()=>{try{const d=await _.get$1();c(s.setMailCategory(d.data.items))}catch(d){console.error(d)}},{id:p,className:f}=n,S=o.map(d=>({id:d.id,value:d.id,label:d.name})),j=p&&S.find(d=>d.value===p)||null;return e.jsx(B,{options:S,className:f,value:j,...n})},M=({label:n,onRemove:c,className:o})=>e.jsxs(h.Fragment,{children:[e.jsx("span",{className:`mr-2 ${o}`,children:n}),e.jsx("i",{className:"fa fa-times text-danger cursor-pointer hover-opacity",onClick:c})]}),Q={id:0,subject:"",categoryId:0,body:"",attachments:[]},W="/admin/email-template",X="Email template detail",Z=4194304,J=n=>{let c;const o=w.useDispatch(),u=k.useNavigate(),[p,f]=h.useState(Q),[S,j]=h.useState(!1),d=async()=>{localStorage.setItem(window.location.href,"true"),j(!0)},[b,$]=h.useState([]),[g,A]=h.useState([]);h.useEffect(()=>{document.title=X,j(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},[]),h.useEffect(()=>{n&&L()},[n]);const L=h.useCallback(async()=>{var i,l;o(s.setLoading(!0));try{const a=await _.getById(n);f({id:a.data.id,subject:a.data.subject,categoryId:a.data.category.id,body:a.data.body,attachments:a.data.attachments||[]}),document.title=a.data.subject,c&&c.editor.execCommand("mceSetContent",!1,a.data.body)}catch(a){o(s.setAlert({type:"danger",message:((l=(i=a.response)==null?void 0:i.data)==null?void 0:l.title)||a.message}))}o(s.setLoading(!1))},[n]),D=i=>c=i,q=i=>{c&&c.editor.execCommand("mceInsertContent",!1,` ${i.label}`)},N=h.useCallback(()=>{u(W)},[]),x=h.useCallback(async i=>{var l,a;o(s.setLoading(!0));try{if(g&&g.length){const I=(await R()).map(v=>({key:v.data.key,name:v.data.name}));i.attachments=[...i.attachments,...I]}await(n?_.update:_.create)(i),o(s.setAlert({type:"success",message:`${n?"Update":"Create"} template successfully`})),N()}catch(t){o(s.setAlert({type:"danger",message:((a=(l=t.response)==null?void 0:l.data)==null?void 0:a.title)||t.message}))}o(s.setLoading(!1))},[n,g]),E=()=>{const i=document.getElementsByClassName("input-attachment"),l=document.createElement("input"),a=document.getElementById("email-detail");a==null||a.append(l),l.className="input-attachment",l.id=`inputAttachment-${i.length+1}`,l.type="file",l.style.display="none",l.setAttribute("multiple","multiple"),l.addEventListener("change",C),l.click()},C=()=>{const i=[];let l=0;const a=document.getElementsByClassName("input-attachment");for(const t of a)for(const m of t.files)l+=m.size,l>Z&&(o(s.setAlert({type:"danger",message:"Max attachment size is 4MB"})),l-=m.size,t.remove());for(const t of a)for(const m of t.files){const{name:I}=m;!b.includes(m)&&!i.some(v=>v.name===I)&&i.push({name:I,inputId:t.id})}A(i)},y=(i,l)=>{if(g.filter(a=>a.inputId===i).length===1){const a=document.getElementById(i);a==null||a.remove();let t=g.filter(m=>m.inputId===i);g.filter(m=>m.inputId!==t.inputId),b.push(t),$([...b]),A([...g]);return}$([...b,l])};h.useEffect(()=>{C()},[b]);const R=async()=>{const i=document.getElementsByClassName("input-attachment"),l=[];for(const a of i)for(const t of a.files){const{name:m}=t,I=new FormData;I.append("file",t,m),l.push(s.systemEmailUpload(I))}return Promise.all(l)};return{emailTemplateDetail:p,setEditorRef:D,addParams:q,backToList:N,confirmData:x,edited:S,setEdited:j,setEditedTrue:d,onAttachFile:E,updateAttachment:C,fileUpload:g,removeAttachment:y}},Y=T.object({subject:T.string().required("Template subject is required"),categoryId:T.number().required("Template category is required").test("test category id","Template category is required",n=>n>=1),comment:T.string(),body:T.string().required("Template body is required")}),ee="create_email_template",te="edit_email_template",se=()=>{const{id:n}=k.useParams(),{t:c}=F.useTranslation(),{classFontSize:o}=s.useClassFontSize(),{emailTemplateDetail:u,setEditorRef:p,addParams:f,backToList:S,confirmData:j,edited:d,setEdited:b,setEditedTrue:$,onAttachFile:g,fileUpload:A,removeAttachment:L}=J(parseInt(n||"0")),D=n?te:ee,q=n?"update":"create",N=w.useSelector(x=>x.mailCategory.mailCategoryList);return e.jsx(U.Formik,{initialValues:u,enableReinitialize:!0,validationSchema:Y,onSubmit:x=>{j(x),b(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},children:x=>{const{values:E,touched:C,errors:y,setFieldValue:R,handleChange:i,handleBlur:l,handleSubmit:a}=x;return e.jsxs("div",{className:`animated fadeIn detail-buttons-padding ${s.styles[o]}`,id:"email-detail",children:[e.jsx(s.QuitPrompt,{when:d}),e.jsx("h5",{className:`mb-2 ${s.styles["custom-title-font-size"]}`,children:c(D)}),e.jsxs(r.Row,{className:"my-2",children:[e.jsxs(r.Col,{md:8,children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:c("mail_subject")}),e.jsx(r.Input,{placeholder:c("mail_subject_nm"),name:"subject",value:E.subject,onChange:t=>{i(t),$()},onBlur:l("subject"),className:`selector-input ${s.styles["custom-font-size"]}`}),C.subject&&y.subject&&e.jsx(s.ErrorHandler,{text:y.subject})]}),e.jsxs(r.Col,{md:4,children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:c("category")}),e.jsx(K,{onChange:t=>{R("categoryId",t.value),$()},id:E.categoryId,className:` ${s.styles["custom-font-size"]}`}),C.categoryId&&y.categoryId&&e.jsx(s.ErrorHandler,{text:y.categoryId})]})]}),e.jsxs(r.Row,{className:"mb-2",children:[e.jsx(r.Col,{md:8,children:e.jsxs(r.Row,{children:[e.jsxs(r.Col,{md:12,className:"mb-2",children:[e.jsx(s.RequiredLabel,{className:` ${s.styles["custom-font-size"]}`,text:c("mail_body")}),(u.body||!n)&&e.jsx(P.Editor,{ref:t=>p(t),tinymceScriptSrc:"./tinymce/tinymce.min.js",initialValue:u.body,init:s.editorConfig.email,onEditorChange:t=>{R("body",t),$()}}),C.body&&y.body&&e.jsx(s.ErrorHandler,{text:y.body})]}),e.jsx(r.Col,{md:12,children:e.jsxs(r.Row,{children:[e.jsx(r.Col,{md:3,children:e.jsx(r.Button,{color:"link",size:"sm",onClick:g,className:`pl-0 ${s.styles["custom-font-size"]}`,children:c("add_attachment")})}),e.jsx(r.Col,{md:12,children:e.jsxs(r.Row,{children:[E.attachments.map(t=>e.jsx(r.Col,{md:2,children:e.jsx(M,{label:t.name,onRemove:()=>R("attachments",E.attachments.filter(m=>m.name!==t.name)),className:` ${s.styles["custom-font-size"]}`})},t.key)),A.map((t,m)=>e.jsx(r.Col,{md:2,className:"d-flex align-items-center",children:e.jsx(M,{label:t.name,onRemove:()=>L(t.inputId,t.name),className:` ${s.styles["custom-font-size"]}`})},m))]})})]})})]})}),e.jsxs(r.Col,{md:4,children:[e.jsx(r.Label,{className:` ${s.styles["custom-font-size"]}`,children:c("mail_params")}),e.jsx(G,{onClick:t=>f(t),isResetPasswordTemplate:E.categoryId==(N&&N.length>0&&N.filter(t=>t.name=="Reset password")[0].id),className:` ${s.styles["custom-font-size"]}`})]})]}),e.jsx(s.DetailActionButtons,{confirmText:q,onConfirm:a,onCancel:S,className:` ${s.styles["custom-font-size"]}`})]})}})};exports.default=se;
@@ -0,0 +1,411 @@
1
+ import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
+ import { Table as Q, Row as _, Col as f, Input as G, Button as J, Label as W } from "reactstrap";
3
+ import { useNavigate as X, useParams as Z } from "react-router-dom";
4
+ import { Editor as Y } from "@tinymce/tinymce-react";
5
+ import { Formik as ee } from "formik";
6
+ import { H as te, v as ae, s as L, c as x, J as se, x as ne, h as d, Q as oe, R as U, E as B, K as ie, M as le } from "./index-C95SWLrn.js";
7
+ import { useTranslation as H } from "react-i18next";
8
+ import { useEffect as M, Fragment as ce, useState as D, useCallback as P } from "react";
9
+ import re from "react-select";
10
+ import { useDispatch as O, useSelector as K } from "react-redux";
11
+ import { a as me, b as de, u as ue, c as he } from "./mailCategoryService-BqDtPJRc.js";
12
+ import * as R from "yup";
13
+ const pe = ({ onClick: o }) => /* @__PURE__ */ e("div", { className: "d-inline text-center cursor-pointer hover-opacity", title: "Delete", onClick: o, children: /* @__PURE__ */ e(te, {}) }), q = [
14
+ { label: "$USER_FIRST_NAME$", meaning: "User first name" },
15
+ { label: "$USER_LAST_NAME$", meaning: "User last name" },
16
+ { label: "$PASSWORD$", meaning: "Password" },
17
+ { label: "$USER_NAME$", meaning: "User name" },
18
+ { label: "$USER_EMAIL$", meaning: "User email" },
19
+ { label: "$MESSAGE$", meaning: "Message" },
20
+ { label: "$DOMAIN$", meaning: "DOMAIN" }
21
+ ], fe = ({
22
+ onClick: o,
23
+ isResetPasswordTemplate: i,
24
+ className: l
25
+ }) => {
26
+ const { t: u } = H();
27
+ let g = i ? [...q, { label: "$RESET_LINK$", meaning: "Reset link" }] : q;
28
+ return /* @__PURE__ */ m(Q, { bordered: !0, hover: !0, striped: !0, responsive: !0, size: "sm", children: [
29
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ m("tr", { children: [
30
+ /* @__PURE__ */ e("th", { className: `align-top ${l}`, children: u("params") }),
31
+ /* @__PURE__ */ e("th", { className: `align-top ${l}`, children: u("meaning") }),
32
+ /* @__PURE__ */ e("th", {})
33
+ ] }) }),
34
+ /* @__PURE__ */ e("tbody", { children: g.map((h) => /* @__PURE__ */ m("tr", { children: [
35
+ /* @__PURE__ */ e("td", { className: `align-middle ${l}`, children: h.label }),
36
+ /* @__PURE__ */ e("td", { className: `align-middle ${l}`, children: h.meaning }),
37
+ /* @__PURE__ */ e("td", { className: "text-center align-middle", children: /* @__PURE__ */ e(pe, { onClick: () => o(h) }) })
38
+ ] }, h.label)) })
39
+ ] });
40
+ }, ge = (o) => {
41
+ const i = O(), l = K(
42
+ (r) => r.mailCategory.mailCategoryList
43
+ );
44
+ M(() => {
45
+ u();
46
+ }, []);
47
+ const u = async () => {
48
+ try {
49
+ const r = await me();
50
+ i(ae(r.data.items));
51
+ } catch (r) {
52
+ console.error(r);
53
+ }
54
+ }, { id: g, className: h } = o, S = l.map((r) => ({
55
+ id: r.id,
56
+ value: r.id,
57
+ label: r.name
58
+ })), b = g && S.find((r) => r.value === g) || null;
59
+ return /* @__PURE__ */ e(re, { options: S, className: h, value: b, ...o });
60
+ }, V = ({ label: o, onRemove: i, className: l }) => /* @__PURE__ */ m(ce, { children: [
61
+ /* @__PURE__ */ e("span", { className: `mr-2 ${l}`, children: o }),
62
+ /* @__PURE__ */ e(
63
+ "i",
64
+ {
65
+ className: "fa fa-times text-danger cursor-pointer hover-opacity",
66
+ onClick: i
67
+ }
68
+ )
69
+ ] }), ye = {
70
+ id: 0,
71
+ subject: "",
72
+ categoryId: 0,
73
+ body: "",
74
+ attachments: []
75
+ }, be = "/admin/email-template", Ee = "Email template detail", Ie = 4194304, $e = (o) => {
76
+ let i;
77
+ const l = O(), u = X(), [
78
+ g,
79
+ h
80
+ ] = D(ye), [S, b] = D(!1), r = async () => {
81
+ localStorage.setItem(window.location.href, "true"), b(!0);
82
+ }, [E, T] = D([]), [p, w] = D([]);
83
+ M(() => {
84
+ document.title = Ee, b(!1), localStorage.getItem(window.location.href) && localStorage.removeItem(window.location.href);
85
+ }, []), M(() => {
86
+ o && j();
87
+ }, [o]);
88
+ const j = P(async () => {
89
+ var n, s;
90
+ l(L(!0));
91
+ try {
92
+ const a = await de(o);
93
+ h({
94
+ id: a.data.id,
95
+ subject: a.data.subject,
96
+ categoryId: a.data.category.id,
97
+ body: a.data.body,
98
+ attachments: a.data.attachments || []
99
+ }), document.title = a.data.subject, i && i.editor.execCommand(
100
+ "mceSetContent",
101
+ !1,
102
+ a.data.body
103
+ );
104
+ } catch (a) {
105
+ l(
106
+ x({
107
+ type: "danger",
108
+ message: ((s = (n = a.response) == null ? void 0 : n.data) == null ? void 0 : s.title) || a.message
109
+ })
110
+ );
111
+ }
112
+ l(L(!1));
113
+ }, [o]), F = (n) => i = n, k = (n) => {
114
+ i && i.editor.execCommand(
115
+ "mceInsertContent",
116
+ !1,
117
+ ` ${n.label}`
118
+ );
119
+ }, A = P(() => {
120
+ u(be);
121
+ }, []), I = P(
122
+ async (n) => {
123
+ var s, a;
124
+ l(L(!0));
125
+ try {
126
+ if (p && p.length) {
127
+ const C = (await v()).map((z) => ({
128
+ key: z.data.key,
129
+ name: z.data.name
130
+ }));
131
+ n.attachments = [...n.attachments, ...C];
132
+ }
133
+ await (o ? ue : he)(n), l(
134
+ x({
135
+ type: "success",
136
+ message: `${o ? "Update" : "Create"} template successfully`
137
+ })
138
+ ), A();
139
+ } catch (t) {
140
+ l(
141
+ x({
142
+ type: "danger",
143
+ message: ((a = (s = t.response) == null ? void 0 : s.data) == null ? void 0 : a.title) || t.message
144
+ })
145
+ );
146
+ }
147
+ l(L(!1));
148
+ },
149
+ [o, p]
150
+ ), $ = () => {
151
+ const n = document.getElementsByClassName("input-attachment"), s = document.createElement("input"), a = document.getElementById("email-detail");
152
+ a == null || a.append(s), s.className = "input-attachment", s.id = `inputAttachment-${n.length + 1}`, s.type = "file", s.style.display = "none", s.setAttribute("multiple", "multiple"), s.addEventListener("change", N), s.click();
153
+ }, N = () => {
154
+ const n = [];
155
+ let s = 0;
156
+ const a = document.getElementsByClassName(
157
+ "input-attachment"
158
+ );
159
+ for (const t of a)
160
+ for (const c of t.files)
161
+ s += c.size, s > Ie && (l(
162
+ x({
163
+ type: "danger",
164
+ message: "Max attachment size is 4MB"
165
+ })
166
+ ), s -= c.size, t.remove());
167
+ for (const t of a)
168
+ for (const c of t.files) {
169
+ const { name: C } = c;
170
+ !E.includes(c) && !n.some((z) => z.name === C) && n.push({ name: C, inputId: t.id });
171
+ }
172
+ w(n);
173
+ }, y = (n, s) => {
174
+ if (p.filter((a) => a.inputId === n).length === 1) {
175
+ const a = document.getElementById(n);
176
+ a == null || a.remove();
177
+ let t = p.filter(
178
+ (c) => c.inputId === n
179
+ );
180
+ p.filter(
181
+ (c) => c.inputId !== t.inputId
182
+ ), E.push(t), T([...E]), w([...p]);
183
+ return;
184
+ }
185
+ T([...E, s]);
186
+ };
187
+ M(() => {
188
+ N();
189
+ }, [E]);
190
+ const v = async () => {
191
+ const n = document.getElementsByClassName(
192
+ "input-attachment"
193
+ ), s = [];
194
+ for (const a of n)
195
+ for (const t of a.files) {
196
+ const { name: c } = t, C = new FormData();
197
+ C.append("file", t, c), s.push(se(C));
198
+ }
199
+ return Promise.all(s);
200
+ };
201
+ return {
202
+ emailTemplateDetail: g,
203
+ setEditorRef: F,
204
+ addParams: k,
205
+ backToList: A,
206
+ confirmData: I,
207
+ edited: S,
208
+ setEdited: b,
209
+ setEditedTrue: r,
210
+ onAttachFile: $,
211
+ updateAttachment: N,
212
+ fileUpload: p,
213
+ removeAttachment: y
214
+ };
215
+ }, Ne = R.object({
216
+ subject: R.string().required("Template subject is required"),
217
+ categoryId: R.number().required("Template category is required").test(
218
+ "test category id",
219
+ "Template category is required",
220
+ (o) => o >= 1
221
+ ),
222
+ comment: R.string(),
223
+ body: R.string().required("Template body is required")
224
+ }), Ce = "create_email_template", Se = "edit_email_template", je = () => {
225
+ const { id: o } = Z(), { t: i } = H(), { classFontSize: l } = ne(), {
226
+ emailTemplateDetail: u,
227
+ setEditorRef: g,
228
+ addParams: h,
229
+ backToList: S,
230
+ confirmData: b,
231
+ edited: r,
232
+ setEdited: E,
233
+ setEditedTrue: T,
234
+ onAttachFile: p,
235
+ fileUpload: w,
236
+ removeAttachment: j
237
+ } = $e(parseInt(o || "0")), F = o ? Se : Ce, k = o ? "update" : "create", A = K(
238
+ (I) => I.mailCategory.mailCategoryList
239
+ );
240
+ return /* @__PURE__ */ e(
241
+ ee,
242
+ {
243
+ initialValues: u,
244
+ enableReinitialize: !0,
245
+ validationSchema: Ne,
246
+ onSubmit: (I) => {
247
+ b(I), E(!1), localStorage.getItem(window.location.href) && localStorage.removeItem(window.location.href);
248
+ },
249
+ children: (I) => {
250
+ const {
251
+ values: $,
252
+ touched: N,
253
+ errors: y,
254
+ setFieldValue: v,
255
+ handleChange: n,
256
+ handleBlur: s,
257
+ handleSubmit: a
258
+ } = I;
259
+ return /* @__PURE__ */ m(
260
+ "div",
261
+ {
262
+ className: `animated fadeIn detail-buttons-padding ${d[l]}`,
263
+ id: "email-detail",
264
+ children: [
265
+ /* @__PURE__ */ e(oe, { when: r }),
266
+ /* @__PURE__ */ e("h5", { className: `mb-2 ${d["custom-title-font-size"]}`, children: i(F) }),
267
+ /* @__PURE__ */ m(_, { className: "my-2", children: [
268
+ /* @__PURE__ */ m(f, { md: 8, children: [
269
+ /* @__PURE__ */ e(U, { className: ` ${d["custom-font-size"]}`, text: i("mail_subject") }),
270
+ /* @__PURE__ */ e(
271
+ G,
272
+ {
273
+ placeholder: i("mail_subject_nm"),
274
+ name: "subject",
275
+ value: $.subject,
276
+ onChange: (t) => {
277
+ n(t), T();
278
+ },
279
+ onBlur: s("subject"),
280
+ className: `selector-input ${d["custom-font-size"]}`
281
+ }
282
+ ),
283
+ N.subject && y.subject && /* @__PURE__ */ e(B, { text: y.subject })
284
+ ] }),
285
+ /* @__PURE__ */ m(f, { md: 4, children: [
286
+ /* @__PURE__ */ e(U, { className: ` ${d["custom-font-size"]}`, text: i("category") }),
287
+ /* @__PURE__ */ e(
288
+ ge,
289
+ {
290
+ onChange: (t) => {
291
+ v("categoryId", t.value), T();
292
+ },
293
+ id: $.categoryId,
294
+ className: ` ${d["custom-font-size"]}`
295
+ }
296
+ ),
297
+ N.categoryId && y.categoryId && /* @__PURE__ */ e(B, { text: y.categoryId })
298
+ ] })
299
+ ] }),
300
+ /* @__PURE__ */ m(_, { className: "mb-2", children: [
301
+ /* @__PURE__ */ e(f, { md: 8, children: /* @__PURE__ */ m(_, { children: [
302
+ /* @__PURE__ */ m(f, { md: 12, className: "mb-2", children: [
303
+ /* @__PURE__ */ e(U, { className: ` ${d["custom-font-size"]}`, text: i("mail_body") }),
304
+ (u.body || !o) && /* @__PURE__ */ e(
305
+ Y,
306
+ {
307
+ ref: (t) => g(t),
308
+ tinymceScriptSrc: "./tinymce/tinymce.min.js",
309
+ initialValue: u.body,
310
+ init: ie.email,
311
+ onEditorChange: (t) => {
312
+ v(
313
+ "body",
314
+ t
315
+ ), T();
316
+ }
317
+ }
318
+ ),
319
+ N.body && y.body && /* @__PURE__ */ e(B, { text: y.body })
320
+ ] }),
321
+ /* @__PURE__ */ e(f, { md: 12, children: /* @__PURE__ */ m(_, { children: [
322
+ /* @__PURE__ */ e(f, { md: 3, children: /* @__PURE__ */ e(
323
+ J,
324
+ {
325
+ color: "link",
326
+ size: "sm",
327
+ onClick: p,
328
+ className: `pl-0 ${d["custom-font-size"]}`,
329
+ children: i("add_attachment")
330
+ }
331
+ ) }),
332
+ /* @__PURE__ */ e(f, { md: 12, children: /* @__PURE__ */ m(_, { children: [
333
+ $.attachments.map(
334
+ (t) => /* @__PURE__ */ e(
335
+ f,
336
+ {
337
+ md: 2,
338
+ children: /* @__PURE__ */ e(
339
+ V,
340
+ {
341
+ label: t.name,
342
+ onRemove: () => v(
343
+ "attachments",
344
+ $.attachments.filter(
345
+ (c) => c.name !== t.name
346
+ )
347
+ ),
348
+ className: ` ${d["custom-font-size"]}`
349
+ }
350
+ )
351
+ },
352
+ t.key
353
+ )
354
+ ),
355
+ w.map(
356
+ (t, c) => /* @__PURE__ */ e(
357
+ f,
358
+ {
359
+ md: 2,
360
+ className: "d-flex align-items-center",
361
+ children: /* @__PURE__ */ e(
362
+ V,
363
+ {
364
+ label: t.name,
365
+ onRemove: () => j(
366
+ t.inputId,
367
+ t.name
368
+ ),
369
+ className: ` ${d["custom-font-size"]}`
370
+ }
371
+ )
372
+ },
373
+ c
374
+ )
375
+ )
376
+ ] }) })
377
+ ] }) })
378
+ ] }) }),
379
+ /* @__PURE__ */ m(f, { md: 4, children: [
380
+ /* @__PURE__ */ e(W, { className: ` ${d["custom-font-size"]}`, children: i("mail_params") }),
381
+ /* @__PURE__ */ e(
382
+ fe,
383
+ {
384
+ onClick: (t) => h(t),
385
+ isResetPasswordTemplate: $.categoryId == (A && A.length > 0 && A.filter(
386
+ (t) => t.name == "Reset password"
387
+ )[0].id),
388
+ className: ` ${d["custom-font-size"]}`
389
+ }
390
+ )
391
+ ] })
392
+ ] }),
393
+ /* @__PURE__ */ e(
394
+ le,
395
+ {
396
+ confirmText: k,
397
+ onConfirm: a,
398
+ onCancel: S,
399
+ className: ` ${d["custom-font-size"]}`
400
+ }
401
+ )
402
+ ]
403
+ }
404
+ );
405
+ }
406
+ }
407
+ );
408
+ };
409
+ export {
410
+ je as default
411
+ };