mario-core 2.0.129-staging → 2.0.131-staging

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 (68) hide show
  1. package/dist/Dashboard-Am5IP9TP.mjs +206 -0
  2. package/dist/Dashboard-CwffUrxW.mjs +206 -0
  3. package/dist/Dashboard-DMYC7woV.js +1 -0
  4. package/dist/Dashboard-w9EdPfpe.js +1 -0
  5. package/dist/EmailTemplateDetail-Bj-u3xKB.js +1 -0
  6. package/dist/EmailTemplateDetail-BrBIai7J.js +1 -0
  7. package/dist/EmailTemplateDetail-SGdYkkOC.mjs +443 -0
  8. package/dist/EmailTemplateDetail-UoRZTSQ9.mjs +443 -0
  9. package/dist/EmailTemplateList-Bk0-8JPw.js +1 -0
  10. package/dist/EmailTemplateList-D3ow5i-c.mjs +170 -0
  11. package/dist/EmailTemplateList-DOmyyEND.mjs +170 -0
  12. package/dist/EmailTemplateList-DSqjpOqs.js +1 -0
  13. package/dist/GalleryList-BfcMXdXn.mjs +329 -0
  14. package/dist/GalleryList-C8x-AOq_.js +1 -0
  15. package/dist/GalleryList-CHABS8NF.mjs +329 -0
  16. package/dist/GalleryList-DoFXfOJC.js +1 -0
  17. package/dist/Login-BN3ofJLz.mjs +1684 -0
  18. package/dist/Login-BWslAbhU.js +1 -0
  19. package/dist/Login-CUbF9qxz.js +1 -0
  20. package/dist/Login-svP30YT3.mjs +1684 -0
  21. package/dist/NotificationList-BmlD8IcW.mjs +3982 -0
  22. package/dist/NotificationList-CGgs0KhE.js +2 -0
  23. package/dist/NotificationList-DS2jvwkV.js +2 -0
  24. package/dist/NotificationList-DqtNmHU8.mjs +3982 -0
  25. package/dist/SkillList-CN3DugqV.mjs +386 -0
  26. package/dist/SkillList-COYgExL0.js +1 -0
  27. package/dist/SkillList-D1tZtp9b.js +1 -0
  28. package/dist/SkillList-DojnQEQ4.mjs +386 -0
  29. package/dist/TeacherSelector-BVHQfoTu.js +1 -0
  30. package/dist/TeacherSelector-BhHtAevB.mjs +30 -0
  31. package/dist/TeacherSelector-CtvxkHIH.js +1 -0
  32. package/dist/TeacherSelector-D6vtcxZd.mjs +30 -0
  33. package/dist/TheContent-CS17bQ_9.js +1 -0
  34. package/dist/TheContent-CVSvJJX2.mjs +38 -0
  35. package/dist/TheContent-QgPPL3sx.js +1 -0
  36. package/dist/TheContent-u5CcarEp.mjs +38 -0
  37. package/dist/UserContainer-ByU1s8FD.js +5 -0
  38. package/dist/UserContainer-CAcu2Tdv.js +5 -0
  39. package/dist/UserContainer-DRZLWi7O.mjs +2902 -0
  40. package/dist/UserContainer-Fy2na4Dz.mjs +2902 -0
  41. package/dist/UserDetail-BFcdMyis.js +1 -0
  42. package/dist/UserDetail-Degxghah.js +1 -0
  43. package/dist/UserDetail-DqT8o4Le.mjs +903 -0
  44. package/dist/UserDetail-HKXlg1kZ.mjs +903 -0
  45. package/dist/UserList-4qk-ABi0.js +7 -0
  46. package/dist/UserList-CTdD-qWv.mjs +1252 -0
  47. package/dist/UserList-DPywN2_y.mjs +1252 -0
  48. package/dist/UserList-DafM5_aR.js +7 -0
  49. package/dist/constants-B0ZetxZb.mjs +286 -0
  50. package/dist/constants-Be1HlVjQ.mjs +286 -0
  51. package/dist/constants-DYwCYHvs.js +1 -0
  52. package/dist/constants-DsKKjzqS.js +1 -0
  53. package/dist/index-BYJLXXZH.mjs +19133 -0
  54. package/dist/index-CnED5v7v.js +15 -0
  55. package/dist/index-DNakdTsN.js +15 -0
  56. package/dist/index-Dq6sgFeE.mjs +19133 -0
  57. package/dist/index.js +1 -1
  58. package/dist/index.modern.js +1 -1
  59. package/dist/mailCategoryService-BWexsTGv.mjs +11 -0
  60. package/dist/mailCategoryService-Cf4V_xDN.js +1 -0
  61. package/dist/mailCategoryService-DEj1xPvu.mjs +11 -0
  62. package/dist/mailCategoryService-dgFCt1Ia.js +1 -0
  63. package/dist/services/userService.d.ts +1 -0
  64. package/dist/userService-BUEw8Ecw.mjs +56 -0
  65. package/dist/userService-BbABnRwE.js +1 -0
  66. package/dist/userService-BfbGXDuL.mjs +55 -0
  67. package/dist/userService-mWzYOxTv.js +1 -0
  68. package/package.json +1 -1
@@ -0,0 +1,206 @@
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 E, Nav as A, NavItem as g, NavLink as p } from "reactstrap";
5
+ import { s as n, h as m, G as H } from "./index-BYJLXXZH.mjs";
6
+ import { Link as v } from "react-router-dom";
7
+ const M = () => /* @__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
+ ] }), w = ({ srcIcon: r, content: t }) => /* @__PURE__ */ a("div", { className: `${n["content-icon"]}`, children: [
24
+ /* @__PURE__ */ e("div", { className: `${n["title-icon"]}`, children: /* @__PURE__ */ e("img", { src: m(r), alt: "icon" }) }),
25
+ /* @__PURE__ */ e(
26
+ "div",
27
+ {
28
+ className: `${n["descriptions-icon"]}`,
29
+ dangerouslySetInnerHTML: { __html: t }
30
+ }
31
+ )
32
+ ] }, t), 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(M, {}) }),
47
+ /* @__PURE__ */ e(u, { md: 12, className: `${n["box-content-home-page"]} d-flex align-items-center`, children: D.map((r) => /* @__PURE__ */ e(
48
+ w,
49
+ {
50
+ srcIcon: r.scrIcon,
51
+ content: r.content
52
+ },
53
+ r.scrIcon
54
+ )) })
55
+ ] });
56
+ function O(r) {
57
+ return H({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M32 96v64h448V96H32zm0 128v64h448v-64H32zm0 128v64h448v-64H32z" } }] })(r);
58
+ }
59
+ const S = 1e4, _ = ({
60
+ data: r,
61
+ duration: t = S
62
+ }) => {
63
+ const [o, l] = N(r.length), s = I(null), d = h((c) => c === o ? `${n.active} ${n.show}` : "", [o]), $ = h((c) => o === 0 && c === r.length - 1 || c === o - 1 ? n.behind : "", [o, r.length]), b = h(() => {
64
+ s && s.current && clearInterval(s.current), s.current = setInterval(() => {
65
+ l((c) => c >= r.length - 1 ? 0 : c + 1);
66
+ }, t);
67
+ }, [t, r.length]);
68
+ return f(() => (b(), () => {
69
+ s && s.current && clearInterval(s.current);
70
+ }), [r.length, t]), /* @__PURE__ */ e("div", { className: `${n["bg-animate"]} position-absolute`, children: r.map((c, i) => /* @__PURE__ */ e(
71
+ "img",
72
+ {
73
+ alt: `Image ${i + 1}`,
74
+ className: `${$(i)} ${d(i)}`,
75
+ src: m(c)
76
+ },
77
+ i
78
+ )) });
79
+ }, j = "/admin/users/user-list", x = "/home", B = "/home", R = "Dashboard", U = "Mario Education", z = [
80
+ "images/landing-page.jpg",
81
+ "images/landing-page2.jpg",
82
+ "images/landing-page3.jpg"
83
+ ], J = ({ version: r }) => {
84
+ const [t, o] = N(!1), l = k((d) => d.common.user), s = () => o(!t);
85
+ return f(() => {
86
+ l ? document.title = R : document.title = U;
87
+ }, [l]), /* @__PURE__ */ a(
88
+ "div",
89
+ {
90
+ className: `${n.login} ${n["red-background"]} position-relative`,
91
+ children: [
92
+ /* @__PURE__ */ e(
93
+ "span",
94
+ {
95
+ className: `${n["version-prod"]}`,
96
+ children: `v ${r}`
97
+ }
98
+ ),
99
+ /* @__PURE__ */ e(_, { data: z }),
100
+ /* @__PURE__ */ a("div", { className: `${n["login-content"]}`, children: [
101
+ /* @__PURE__ */ a(C, { light: !0, expand: "md", children: [
102
+ /* @__PURE__ */ e(y, { href: "/", className: `${n["logo-home"]}`, children: /* @__PURE__ */ e(
103
+ "img",
104
+ {
105
+ src: m("/images/logo-white.svg"),
106
+ alt: "mario"
107
+ }
108
+ ) }),
109
+ /* @__PURE__ */ e(
110
+ O,
111
+ {
112
+ onClick: s,
113
+ className: `${n["hide-in-desktop"]} ${n["hamburger-menu"]}`
114
+ }
115
+ ),
116
+ /* @__PURE__ */ a(
117
+ E,
118
+ {
119
+ isOpen: t,
120
+ navbar: !0,
121
+ className: `${n["collapse-box"]}`,
122
+ children: [
123
+ /* @__PURE__ */ a(
124
+ A,
125
+ {
126
+ className: `${n["nav-home"]} d-md-flex w-100 justify-content-center mr-auto`,
127
+ navbar: !0,
128
+ children: [
129
+ /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(
130
+ p,
131
+ {
132
+ className: `${n["learn-more"]} align-self-md-center`,
133
+ href: "https://marioframework.com/software",
134
+ target: "blank",
135
+ children: "Learn More"
136
+ }
137
+ ) }),
138
+ /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(
139
+ p,
140
+ {
141
+ className: `${n["learn-more"]} align-self-md-center`,
142
+ href: "mailto: Info@marioeducation.com",
143
+ target: "blank",
144
+ children: "Contact"
145
+ }
146
+ ) }),
147
+ /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(
148
+ p,
149
+ {
150
+ className: `${n["learn-more"]} align-self-md-center`,
151
+ href: "/privacy-policy",
152
+ target: "blank",
153
+ children: "Privacy Policy"
154
+ }
155
+ ) })
156
+ ]
157
+ }
158
+ ),
159
+ /* @__PURE__ */ e(
160
+ "div",
161
+ {
162
+ className: `${n["hide-in-mobile"]} d-flex justify-content-end`,
163
+ children: l ? /* @__PURE__ */ e(
164
+ v,
165
+ {
166
+ to: l.roles.includes("Admin") ? j : l.roles.includes("Teacher") ? x : B,
167
+ className: `${n["btn-trans-border"]}`,
168
+ children: "Dashboard"
169
+ }
170
+ ) : /* @__PURE__ */ e(
171
+ v,
172
+ {
173
+ to: "/login",
174
+ className: `${n["btn-trans-border"]}`,
175
+ children: "Login"
176
+ }
177
+ )
178
+ }
179
+ )
180
+ ]
181
+ }
182
+ )
183
+ ] }),
184
+ /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ e(L, {}) }),
185
+ /* @__PURE__ */ e("div", { className: `${n["digital-privacy-icon"]}`, children: /* @__PURE__ */ e(
186
+ "a",
187
+ {
188
+ href: "https://cert.privo.com/#/companies/marioFrameworkLlc",
189
+ target: "blank",
190
+ children: /* @__PURE__ */ e(
191
+ "img",
192
+ {
193
+ src: m("/images/STUDENT.png"),
194
+ alt: "icon"
195
+ }
196
+ )
197
+ }
198
+ ) })
199
+ ] })
200
+ ]
201
+ }
202
+ );
203
+ };
204
+ export {
205
+ J as default
206
+ };
@@ -0,0 +1,206 @@
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 E, Nav as A, NavItem as g, NavLink as p } from "reactstrap";
5
+ import { s as n, h as m, G as H } from "./index-Dq6sgFeE.mjs";
6
+ import { Link as v } from "react-router-dom";
7
+ const M = () => /* @__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
+ ] }), w = ({ srcIcon: r, content: t }) => /* @__PURE__ */ a("div", { className: `${n["content-icon"]}`, children: [
24
+ /* @__PURE__ */ e("div", { className: `${n["title-icon"]}`, children: /* @__PURE__ */ e("img", { src: m(r), alt: "icon" }) }),
25
+ /* @__PURE__ */ e(
26
+ "div",
27
+ {
28
+ className: `${n["descriptions-icon"]}`,
29
+ dangerouslySetInnerHTML: { __html: t }
30
+ }
31
+ )
32
+ ] }, t), 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(M, {}) }),
47
+ /* @__PURE__ */ e(u, { md: 12, className: `${n["box-content-home-page"]} d-flex align-items-center`, children: D.map((r) => /* @__PURE__ */ e(
48
+ w,
49
+ {
50
+ srcIcon: r.scrIcon,
51
+ content: r.content
52
+ },
53
+ r.scrIcon
54
+ )) })
55
+ ] });
56
+ function O(r) {
57
+ return H({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M32 96v64h448V96H32zm0 128v64h448v-64H32zm0 128v64h448v-64H32z" } }] })(r);
58
+ }
59
+ const S = 1e4, _ = ({
60
+ data: r,
61
+ duration: t = S
62
+ }) => {
63
+ const [o, l] = N(r.length), s = I(null), d = h((c) => c === o ? `${n.active} ${n.show}` : "", [o]), $ = h((c) => o === 0 && c === r.length - 1 || c === o - 1 ? n.behind : "", [o, r.length]), b = h(() => {
64
+ s && s.current && clearInterval(s.current), s.current = setInterval(() => {
65
+ l((c) => c >= r.length - 1 ? 0 : c + 1);
66
+ }, t);
67
+ }, [t, r.length]);
68
+ return f(() => (b(), () => {
69
+ s && s.current && clearInterval(s.current);
70
+ }), [r.length, t]), /* @__PURE__ */ e("div", { className: `${n["bg-animate"]} position-absolute`, children: r.map((c, i) => /* @__PURE__ */ e(
71
+ "img",
72
+ {
73
+ alt: `Image ${i + 1}`,
74
+ className: `${$(i)} ${d(i)}`,
75
+ src: m(c)
76
+ },
77
+ i
78
+ )) });
79
+ }, j = "/admin/users/user-list", x = "/home", B = "/home", R = "Dashboard", U = "Mario Education", z = [
80
+ "images/landing-page.jpg",
81
+ "images/landing-page2.jpg",
82
+ "images/landing-page3.jpg"
83
+ ], J = ({ version: r }) => {
84
+ const [t, o] = N(!1), l = k((d) => d.common.user), s = () => o(!t);
85
+ return f(() => {
86
+ l ? document.title = R : document.title = U;
87
+ }, [l]), /* @__PURE__ */ a(
88
+ "div",
89
+ {
90
+ className: `${n.login} ${n["red-background"]} position-relative`,
91
+ children: [
92
+ /* @__PURE__ */ e(
93
+ "span",
94
+ {
95
+ className: `${n["version-prod"]}`,
96
+ children: `v ${r}`
97
+ }
98
+ ),
99
+ /* @__PURE__ */ e(_, { data: z }),
100
+ /* @__PURE__ */ a("div", { className: `${n["login-content"]}`, children: [
101
+ /* @__PURE__ */ a(C, { light: !0, expand: "md", children: [
102
+ /* @__PURE__ */ e(y, { href: "/", className: `${n["logo-home"]}`, children: /* @__PURE__ */ e(
103
+ "img",
104
+ {
105
+ src: m("/images/logo-white.svg"),
106
+ alt: "mario"
107
+ }
108
+ ) }),
109
+ /* @__PURE__ */ e(
110
+ O,
111
+ {
112
+ onClick: s,
113
+ className: `${n["hide-in-desktop"]} ${n["hamburger-menu"]}`
114
+ }
115
+ ),
116
+ /* @__PURE__ */ a(
117
+ E,
118
+ {
119
+ isOpen: t,
120
+ navbar: !0,
121
+ className: `${n["collapse-box"]}`,
122
+ children: [
123
+ /* @__PURE__ */ a(
124
+ A,
125
+ {
126
+ className: `${n["nav-home"]} d-md-flex w-100 justify-content-center mr-auto`,
127
+ navbar: !0,
128
+ children: [
129
+ /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(
130
+ p,
131
+ {
132
+ className: `${n["learn-more"]} align-self-md-center`,
133
+ href: "https://marioframework.com/software",
134
+ target: "blank",
135
+ children: "Learn More"
136
+ }
137
+ ) }),
138
+ /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(
139
+ p,
140
+ {
141
+ className: `${n["learn-more"]} align-self-md-center`,
142
+ href: "mailto: Info@marioeducation.com",
143
+ target: "blank",
144
+ children: "Contact"
145
+ }
146
+ ) }),
147
+ /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(
148
+ p,
149
+ {
150
+ className: `${n["learn-more"]} align-self-md-center`,
151
+ href: "/privacy-policy",
152
+ target: "blank",
153
+ children: "Privacy Policy"
154
+ }
155
+ ) })
156
+ ]
157
+ }
158
+ ),
159
+ /* @__PURE__ */ e(
160
+ "div",
161
+ {
162
+ className: `${n["hide-in-mobile"]} d-flex justify-content-end`,
163
+ children: l ? /* @__PURE__ */ e(
164
+ v,
165
+ {
166
+ to: l.roles.includes("Admin") ? j : l.roles.includes("Teacher") ? x : B,
167
+ className: `${n["btn-trans-border"]}`,
168
+ children: "Dashboard"
169
+ }
170
+ ) : /* @__PURE__ */ e(
171
+ v,
172
+ {
173
+ to: "/login",
174
+ className: `${n["btn-trans-border"]}`,
175
+ children: "Login"
176
+ }
177
+ )
178
+ }
179
+ )
180
+ ]
181
+ }
182
+ )
183
+ ] }),
184
+ /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ e(L, {}) }),
185
+ /* @__PURE__ */ e("div", { className: `${n["digital-privacy-icon"]}`, children: /* @__PURE__ */ e(
186
+ "a",
187
+ {
188
+ href: "https://cert.privo.com/#/companies/marioFrameworkLlc",
189
+ target: "blank",
190
+ children: /* @__PURE__ */ e(
191
+ "img",
192
+ {
193
+ src: m("/images/STUDENT.png"),
194
+ alt: "icon"
195
+ }
196
+ )
197
+ }
198
+ ) })
199
+ ] })
200
+ ]
201
+ }
202
+ );
203
+ };
204
+ export {
205
+ J as default
206
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),p=require("react-redux"),n=require("reactstrap"),s=require("./index-DNakdTsN.js"),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:a})=>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:a}})]},a),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(n.Row,{className:`${s.styles["page-not-login"]}`,children:[e.jsx(n.Col,{md:12,children:e.jsx(j,{})}),e.jsx(n.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.scrIcon))})]});function N(t){return s.GenIcon({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M32 96v64h448V96H32zm0 128v64h448v-64H32zm0 128v64h448v-64H32z"}}]})(t)}const b=1e4,f=({data:t,duration:a=b})=>{const[i,o]=c.useState(t.length),r=c.useRef(null),d=c.useCallback(l=>l===i?`${s.styles.active} ${s.styles.show}`:"",[i]),h=c.useCallback(l=>i===0&&l===t.length-1||l===i-1?s.styles.behind:"",[i,t.length]),u=c.useCallback(()=>{r&&r.current&&clearInterval(r.current),r.current=setInterval(()=>{o(l=>l>=t.length-1?0:l+1)},a)},[a,t.length]);return c.useEffect(()=>(u(),()=>{r&&r.current&&clearInterval(r.current)}),[t.length,a]),e.jsx("div",{className:`${s.styles["bg-animate"]} position-absolute`,children:t.map((l,m)=>e.jsx("img",{alt:`Image ${m+1}`,className:`${h(m)} ${d(m)}`,src:s.getStaticFileUrl(l)},m))})},I="/admin/users/user-list",$="/home",k="/home",C="Dashboard",T="Mario Education",S=["images/landing-page.jpg","images/landing-page2.jpg","images/landing-page3.jpg"],E=({version:t})=>{const[a,i]=c.useState(!1),o=p.useSelector(d=>d.common.user),r=()=>i(!a);return c.useEffect(()=>{o?document.title=C:document.title=T},[o]),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(f,{data:S}),e.jsxs("div",{className:`${s.styles["login-content"]}`,children:[e.jsxs(n.Navbar,{light:!0,expand:"md",children:[e.jsx(n.NavbarBrand,{href:"/",className:`${s.styles["logo-home"]}`,children:e.jsx("img",{src:s.getStaticFileUrl("/images/logo-white.svg"),alt:"mario"})}),e.jsx(N,{onClick:r,className:`${s.styles["hide-in-desktop"]} ${s.styles["hamburger-menu"]}`}),e.jsxs(n.Collapse,{isOpen:a,navbar:!0,className:`${s.styles["collapse-box"]}`,children:[e.jsxs(n.Nav,{className:`${s.styles["nav-home"]} d-md-flex w-100 justify-content-center mr-auto`,navbar:!0,children:[e.jsx(n.NavItem,{children:e.jsx(n.NavLink,{className:`${s.styles["learn-more"]} align-self-md-center`,href:"https://marioframework.com/software",target:"blank",children:"Learn More"})}),e.jsx(n.NavItem,{children:e.jsx(n.NavLink,{className:`${s.styles["learn-more"]} align-self-md-center`,href:"mailto: Info@marioeducation.com",target:"blank",children:"Contact"})}),e.jsx(n.NavItem,{children:e.jsx(n.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:o?e.jsx(g.Link,{to:o.roles.includes("Admin")?I:o.roles.includes("Teacher")?$: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/STUDENT.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"),c=require("react"),p=require("react-redux"),n=require("reactstrap"),s=require("./index-CnED5v7v.js"),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:a})=>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:a}})]},a),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(n.Row,{className:`${s.styles["page-not-login"]}`,children:[e.jsx(n.Col,{md:12,children:e.jsx(j,{})}),e.jsx(n.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.scrIcon))})]});function N(t){return s.GenIcon({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M32 96v64h448V96H32zm0 128v64h448v-64H32zm0 128v64h448v-64H32z"}}]})(t)}const b=1e4,f=({data:t,duration:a=b})=>{const[i,o]=c.useState(t.length),r=c.useRef(null),d=c.useCallback(l=>l===i?`${s.styles.active} ${s.styles.show}`:"",[i]),h=c.useCallback(l=>i===0&&l===t.length-1||l===i-1?s.styles.behind:"",[i,t.length]),u=c.useCallback(()=>{r&&r.current&&clearInterval(r.current),r.current=setInterval(()=>{o(l=>l>=t.length-1?0:l+1)},a)},[a,t.length]);return c.useEffect(()=>(u(),()=>{r&&r.current&&clearInterval(r.current)}),[t.length,a]),e.jsx("div",{className:`${s.styles["bg-animate"]} position-absolute`,children:t.map((l,m)=>e.jsx("img",{alt:`Image ${m+1}`,className:`${h(m)} ${d(m)}`,src:s.getStaticFileUrl(l)},m))})},I="/admin/users/user-list",$="/home",k="/home",C="Dashboard",T="Mario Education",S=["images/landing-page.jpg","images/landing-page2.jpg","images/landing-page3.jpg"],E=({version:t})=>{const[a,i]=c.useState(!1),o=p.useSelector(d=>d.common.user),r=()=>i(!a);return c.useEffect(()=>{o?document.title=C:document.title=T},[o]),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(f,{data:S}),e.jsxs("div",{className:`${s.styles["login-content"]}`,children:[e.jsxs(n.Navbar,{light:!0,expand:"md",children:[e.jsx(n.NavbarBrand,{href:"/",className:`${s.styles["logo-home"]}`,children:e.jsx("img",{src:s.getStaticFileUrl("/images/logo-white.svg"),alt:"mario"})}),e.jsx(N,{onClick:r,className:`${s.styles["hide-in-desktop"]} ${s.styles["hamburger-menu"]}`}),e.jsxs(n.Collapse,{isOpen:a,navbar:!0,className:`${s.styles["collapse-box"]}`,children:[e.jsxs(n.Nav,{className:`${s.styles["nav-home"]} d-md-flex w-100 justify-content-center mr-auto`,navbar:!0,children:[e.jsx(n.NavItem,{children:e.jsx(n.NavLink,{className:`${s.styles["learn-more"]} align-self-md-center`,href:"https://marioframework.com/software",target:"blank",children:"Learn More"})}),e.jsx(n.NavItem,{children:e.jsx(n.NavLink,{className:`${s.styles["learn-more"]} align-self-md-center`,href:"mailto: Info@marioeducation.com",target:"blank",children:"Contact"})}),e.jsx(n.NavItem,{children:e.jsx(n.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:o?e.jsx(g.Link,{to:o.roles.includes("Admin")?I:o.roles.includes("Teacher")?$: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/STUDENT.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"),c=require("reactstrap"),U=require("react-router-dom"),H=require("@tinymce/tinymce-react"),K=require("formik"),l=require("./index-CnED5v7v.js"),z=require("react-i18next"),u=require("react"),V=require("react-select"),k=require("react-redux"),A=require("./mailCategoryService-dgFCt1Ia.js"),G=require("yup");function Q(a){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const n in a)if(n!=="default"){const p=Object.getOwnPropertyDescriptor(a,n);Object.defineProperty(s,n,p.get?p:{enumerable:!0,get:()=>a[n]})}}return s.default=a,Object.freeze(s)}const v=Q(G),W=({onClick:a})=>e.jsx("div",{className:"d-inline text-center cursor-pointer hover-opacity",title:"Delete",onClick:a,children:e.jsx(l.FaPlus,{})}),P=[{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"}],X=({onClick:a,isResetPasswordTemplate:s})=>{const{t:n}=z.useTranslation();let p=s?[...P,{label:"$RESET_LINK$",meaning:"Reset link"}]:P;return e.jsxs(c.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",children:n("params")}),e.jsx("th",{className:"align-top",children:n("meaning")}),e.jsx("th",{})]})}),e.jsx("tbody",{children:p.map(h=>e.jsxs("tr",{children:[e.jsx("td",{className:"align-middle",children:h.label}),e.jsx("td",{className:"align-middle",children:n(h.meaning)}),e.jsx("td",{className:"text-center align-middle",children:e.jsx(W,{onClick:()=>a(h)})})]},h.label))})]})},Z=a=>{const s=k.useDispatch(),n=k.useSelector(r=>r.mailCategory.mailCategoryList);u.useEffect(()=>{p()},[]);const p=async()=>{try{const r=await A.get$1();s(l.setMailCategory(r.data.items))}catch(r){console.error(r)}},{id:h}=a,E=n.map(r=>({id:r.id,value:r.id,label:r.name})),I=h&&E.find(r=>r.value===h)||null;return e.jsx(V,{options:E,value:I,...a})},B=({label:a,onRemove:s})=>e.jsxs(u.Fragment,{children:[e.jsx("span",{className:"mr-2",children:a}),e.jsx("i",{className:"fa fa-times text-danger cursor-pointer hover-opacity",onClick:s})]}),J={id:0,subject:"",categoryId:0,body:"",attachments:[],isDisabled:!1},Y="/admin/email-template",ee="Email template detail",te=4194304,ae=a=>{let s;const n=k.useDispatch(),p=U.useNavigate(),[h,E]=u.useState(J),[I,r]=u.useState(!1),w=async()=>{localStorage.setItem(window.location.href,"true"),r(!0)},[f,D]=u.useState([]),[g,N]=u.useState([]),[L,q]=u.useState("");u.useEffect(()=>{a&&_()},[a]);const _=u.useCallback(async()=>{n(l.setLoading(!0));try{const t=await A.getById(a);E({id:t.data.id,subject:t.data.subject,categoryId:t.data.category.id,body:t.data.body,attachments:t.data.attachments||[],isDisabled:t.data.isDisabled}),document.title=t.data.subject,s&&s.editor.execCommand("mceSetContent",!1,t.data.body)}catch(t){n(l.setAlert({type:"danger",message:t.response?.data?.title||t.message}))}n(l.setLoading(!1))},[a]),j=async()=>{n(l.setLoading(!0));try{const i=(await A.getTinyMCEKeyApi()).data;i&&q(i.key)}catch(t){n(l.setAlert({type:"danger",message:t.response?.data?.title||"Get key failed"}))}n(l.setLoading(!1))},y=t=>s=t,S=t=>{s&&s.editor.execCommand("mceInsertContent",!1,` ${t.label}`)},b=u.useCallback(()=>{p(Y)},[]),C=u.useCallback(async t=>{n(l.setLoading(!0));try{if(g&&g.length){const m=(await o()).map(d=>({key:d.data.key,name:d.data.name}));t.attachments=[...t.attachments,...m]}await(a?A.update:A.create)(t),n(l.setAlert({type:"success",message:`${a?"Update":"Create"} template successfully`})),b()}catch(i){n(l.setAlert({type:"danger",message:i.response?.data?.title||i.message}))}n(l.setLoading(!1))},[a,g]),M=()=>{const t=document.getElementsByClassName("input-attachment"),i=document.createElement("input");document.getElementById("email-detail")?.append(i),i.className="input-attachment",i.id=`inputAttachment-${t.length+1}`,i.type="file",i.style.display="none",i.setAttribute("multiple","multiple"),i.addEventListener("change",T),i.click()},T=()=>{const t=[];let i=0;const x=document.getElementsByClassName("input-attachment");for(const m of x)for(const d of m.files)i+=d.size,i>te&&(n(l.setAlert({type:"danger",message:"Max attachment size is 4MB"})),i-=d.size,m.remove());for(const m of x)for(const d of m.files){const{name:R}=d;!f.includes(d)&&!t.some(O=>O.name===R)&&t.push({name:R,inputId:m.id})}N(t)},$=(t,i)=>{if(g.filter(x=>x.inputId===t).length===1){document.getElementById(t)?.remove();let m=g.filter(d=>d.inputId===t);g.filter(d=>d.inputId!==m.inputId),f.push(m),D([...f]),N([...g]);return}D([...f,i])};u.useEffect(()=>{T()},[f]);const o=async()=>{const t=document.getElementsByClassName("input-attachment"),i=[];for(const x of t)for(const m of x.files){const{name:d}=m,R=new FormData;R.append("file",m,d),i.push(l.systemEmailUpload(R))}return Promise.all(i)};return u.useEffect(()=>{document.title=ee,j(),r(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},[]),{emailTemplateDetail:h,setEditorRef:y,addParams:S,backToList:b,confirmData:C,edited:I,setEdited:r,setEditedTrue:w,onAttachFile:M,updateAttachment:T,fileUpload:g,removeAttachment:$,tinyMCEKey:L}},se=v.object({subject:v.string().required("Template subject is required"),categoryId:v.number().required("Template category is required").test("test category id","Template category is required",a=>a>=1),comment:v.string(),body:v.string().required("Template body is required")}),F={"detail-header":"_detail-header_oasq7_1","form-check-disabled":"_form-check-disabled_oasq7_8","active-status":"_active-status_oasq7_14"},ne="create_email_template",ie="edit_email_template",le=()=>{const{id:a}=U.useParams(),{t:s}=z.useTranslation(),{emailTemplateDetail:n,setEditorRef:p,addParams:h,backToList:E,confirmData:I,edited:r,setEdited:w,setEditedTrue:f,onAttachFile:D,fileUpload:g,removeAttachment:N}=ae(parseInt(a||"0")),L=s(a?ie:ne),q=s(a?"update":"create"),_=k.useSelector(j=>j.mailCategory.mailCategoryList);return e.jsx(K.Formik,{initialValues:n,enableReinitialize:!0,validationSchema:se,onSubmit:j=>{I(j),w(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},children:j=>{const{values:y,touched:S,errors:b,setFieldValue:C,handleChange:M,handleBlur:T,handleSubmit:$}=j;return e.jsxs("div",{className:"animated fadeIn detail-buttons-padding",id:"email-detail",children:[e.jsx(l.QuitPrompt,{when:r}),e.jsx("h5",{className:"mb-2",style:{textTransform:"capitalize"},children:L}),e.jsxs(c.Row,{className:"my-2",children:[e.jsxs(c.Col,{md:8,children:[e.jsx(l.RequiredLabel,{text:s("mail_subject")}),e.jsxs("div",{className:`${F["detail-header"]}`,children:[e.jsx(c.Input,{placeholder:s("mail_subject_nm"),name:"subject",value:y.subject,onChange:o=>{M(o),f()},onBlur:T("subject"),className:"selector-input"}),e.jsxs(c.FormGroup,{check:!0,className:`${F["form-check-disabled"]}`,children:[e.jsx(c.Input,{type:"checkbox",id:"disable-checkbox",checked:!y.isDisabled,onChange:()=>{C("isDisabled",!y.isDisabled)},className:` ${F["active-status"]}`}),e.jsx(c.Label,{check:!0,for:"di-default-checkbox",children:s("enabled")})]})]}),S.subject&&b.subject&&e.jsx(l.ErrorHandler,{text:b.subject})]}),e.jsxs(c.Col,{md:4,children:[e.jsx(l.RequiredLabel,{text:s("category")}),e.jsx(Z,{onChange:o=>{C("categoryId",o.value),f()},id:y.categoryId}),S.categoryId&&b.categoryId&&e.jsx(l.ErrorHandler,{text:b.categoryId})]})]}),e.jsxs(c.Row,{className:"mb-2",children:[e.jsx(c.Col,{md:8,children:e.jsxs(c.Row,{children:[e.jsxs(c.Col,{md:12,className:"mb-2",children:[e.jsx(l.RequiredLabel,{text:s("mail_body")}),(n.body||!a)&&e.jsx(H.Editor,{tinymceScriptSrc:"/tinymce/tinymce.min.js",ref:o=>p(o),initialValue:n.body,init:l.editorConfig.email,onEditorChange:o=>{C("body",o),f()}}),S.body&&b.body&&e.jsx(l.ErrorHandler,{text:b.body})]}),e.jsx(c.Col,{md:12,children:e.jsxs(c.Row,{children:[e.jsx(c.Col,{md:3,children:e.jsx(c.Button,{color:"link",size:"sm",className:"pl-0",onClick:D,children:s("add_attachment")})}),e.jsx(c.Col,{md:12,children:e.jsxs(c.Row,{children:[y.attachments.map(o=>e.jsx(c.Col,{md:2,children:e.jsx(B,{label:o.name,onRemove:()=>C("attachments",y.attachments.filter(t=>t.name!==o.name))})},o.key)),g.map((o,t)=>e.jsx(c.Col,{md:2,className:"d-flex align-items-center",children:e.jsx(B,{label:o.name,onRemove:()=>N(o.inputId,o.name)})},t))]})})]})})]})}),e.jsxs(c.Col,{md:4,children:[e.jsx(c.Label,{children:s("mail_params")}),e.jsx(X,{onClick:o=>h(o),isResetPasswordTemplate:y.categoryId==(_&&_.length>0&&_.filter(o=>o.name=="Reset password")[0].id)})]})]}),e.jsx(l.DetailActionButtons,{confirmText:q,onConfirm:$,onCancel:E})]})}})};exports.default=le;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("reactstrap"),U=require("react-router-dom"),H=require("@tinymce/tinymce-react"),K=require("formik"),l=require("./index-DNakdTsN.js"),z=require("react-i18next"),u=require("react"),V=require("react-select"),k=require("react-redux"),A=require("./mailCategoryService-Cf4V_xDN.js"),G=require("yup");function Q(a){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const n in a)if(n!=="default"){const p=Object.getOwnPropertyDescriptor(a,n);Object.defineProperty(s,n,p.get?p:{enumerable:!0,get:()=>a[n]})}}return s.default=a,Object.freeze(s)}const v=Q(G),W=({onClick:a})=>e.jsx("div",{className:"d-inline text-center cursor-pointer hover-opacity",title:"Delete",onClick:a,children:e.jsx(l.FaPlus,{})}),P=[{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"}],X=({onClick:a,isResetPasswordTemplate:s})=>{const{t:n}=z.useTranslation();let p=s?[...P,{label:"$RESET_LINK$",meaning:"Reset link"}]:P;return e.jsxs(c.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",children:n("params")}),e.jsx("th",{className:"align-top",children:n("meaning")}),e.jsx("th",{})]})}),e.jsx("tbody",{children:p.map(h=>e.jsxs("tr",{children:[e.jsx("td",{className:"align-middle",children:h.label}),e.jsx("td",{className:"align-middle",children:n(h.meaning)}),e.jsx("td",{className:"text-center align-middle",children:e.jsx(W,{onClick:()=>a(h)})})]},h.label))})]})},Z=a=>{const s=k.useDispatch(),n=k.useSelector(r=>r.mailCategory.mailCategoryList);u.useEffect(()=>{p()},[]);const p=async()=>{try{const r=await A.get$1();s(l.setMailCategory(r.data.items))}catch(r){console.error(r)}},{id:h}=a,E=n.map(r=>({id:r.id,value:r.id,label:r.name})),I=h&&E.find(r=>r.value===h)||null;return e.jsx(V,{options:E,value:I,...a})},B=({label:a,onRemove:s})=>e.jsxs(u.Fragment,{children:[e.jsx("span",{className:"mr-2",children:a}),e.jsx("i",{className:"fa fa-times text-danger cursor-pointer hover-opacity",onClick:s})]}),J={id:0,subject:"",categoryId:0,body:"",attachments:[],isDisabled:!1},Y="/admin/email-template",ee="Email template detail",te=4194304,ae=a=>{let s;const n=k.useDispatch(),p=U.useNavigate(),[h,E]=u.useState(J),[I,r]=u.useState(!1),w=async()=>{localStorage.setItem(window.location.href,"true"),r(!0)},[f,D]=u.useState([]),[g,N]=u.useState([]),[L,q]=u.useState("");u.useEffect(()=>{a&&_()},[a]);const _=u.useCallback(async()=>{n(l.setLoading(!0));try{const t=await A.getById(a);E({id:t.data.id,subject:t.data.subject,categoryId:t.data.category.id,body:t.data.body,attachments:t.data.attachments||[],isDisabled:t.data.isDisabled}),document.title=t.data.subject,s&&s.editor.execCommand("mceSetContent",!1,t.data.body)}catch(t){n(l.setAlert({type:"danger",message:t.response?.data?.title||t.message}))}n(l.setLoading(!1))},[a]),j=async()=>{n(l.setLoading(!0));try{const i=(await A.getTinyMCEKeyApi()).data;i&&q(i.key)}catch(t){n(l.setAlert({type:"danger",message:t.response?.data?.title||"Get key failed"}))}n(l.setLoading(!1))},y=t=>s=t,S=t=>{s&&s.editor.execCommand("mceInsertContent",!1,` ${t.label}`)},b=u.useCallback(()=>{p(Y)},[]),C=u.useCallback(async t=>{n(l.setLoading(!0));try{if(g&&g.length){const m=(await o()).map(d=>({key:d.data.key,name:d.data.name}));t.attachments=[...t.attachments,...m]}await(a?A.update:A.create)(t),n(l.setAlert({type:"success",message:`${a?"Update":"Create"} template successfully`})),b()}catch(i){n(l.setAlert({type:"danger",message:i.response?.data?.title||i.message}))}n(l.setLoading(!1))},[a,g]),M=()=>{const t=document.getElementsByClassName("input-attachment"),i=document.createElement("input");document.getElementById("email-detail")?.append(i),i.className="input-attachment",i.id=`inputAttachment-${t.length+1}`,i.type="file",i.style.display="none",i.setAttribute("multiple","multiple"),i.addEventListener("change",T),i.click()},T=()=>{const t=[];let i=0;const x=document.getElementsByClassName("input-attachment");for(const m of x)for(const d of m.files)i+=d.size,i>te&&(n(l.setAlert({type:"danger",message:"Max attachment size is 4MB"})),i-=d.size,m.remove());for(const m of x)for(const d of m.files){const{name:R}=d;!f.includes(d)&&!t.some(O=>O.name===R)&&t.push({name:R,inputId:m.id})}N(t)},$=(t,i)=>{if(g.filter(x=>x.inputId===t).length===1){document.getElementById(t)?.remove();let m=g.filter(d=>d.inputId===t);g.filter(d=>d.inputId!==m.inputId),f.push(m),D([...f]),N([...g]);return}D([...f,i])};u.useEffect(()=>{T()},[f]);const o=async()=>{const t=document.getElementsByClassName("input-attachment"),i=[];for(const x of t)for(const m of x.files){const{name:d}=m,R=new FormData;R.append("file",m,d),i.push(l.systemEmailUpload(R))}return Promise.all(i)};return u.useEffect(()=>{document.title=ee,j(),r(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},[]),{emailTemplateDetail:h,setEditorRef:y,addParams:S,backToList:b,confirmData:C,edited:I,setEdited:r,setEditedTrue:w,onAttachFile:M,updateAttachment:T,fileUpload:g,removeAttachment:$,tinyMCEKey:L}},se=v.object({subject:v.string().required("Template subject is required"),categoryId:v.number().required("Template category is required").test("test category id","Template category is required",a=>a>=1),comment:v.string(),body:v.string().required("Template body is required")}),F={"detail-header":"_detail-header_oasq7_1","form-check-disabled":"_form-check-disabled_oasq7_8","active-status":"_active-status_oasq7_14"},ne="create_email_template",ie="edit_email_template",le=()=>{const{id:a}=U.useParams(),{t:s}=z.useTranslation(),{emailTemplateDetail:n,setEditorRef:p,addParams:h,backToList:E,confirmData:I,edited:r,setEdited:w,setEditedTrue:f,onAttachFile:D,fileUpload:g,removeAttachment:N}=ae(parseInt(a||"0")),L=s(a?ie:ne),q=s(a?"update":"create"),_=k.useSelector(j=>j.mailCategory.mailCategoryList);return e.jsx(K.Formik,{initialValues:n,enableReinitialize:!0,validationSchema:se,onSubmit:j=>{I(j),w(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},children:j=>{const{values:y,touched:S,errors:b,setFieldValue:C,handleChange:M,handleBlur:T,handleSubmit:$}=j;return e.jsxs("div",{className:"animated fadeIn detail-buttons-padding",id:"email-detail",children:[e.jsx(l.QuitPrompt,{when:r}),e.jsx("h5",{className:"mb-2",style:{textTransform:"capitalize"},children:L}),e.jsxs(c.Row,{className:"my-2",children:[e.jsxs(c.Col,{md:8,children:[e.jsx(l.RequiredLabel,{text:s("mail_subject")}),e.jsxs("div",{className:`${F["detail-header"]}`,children:[e.jsx(c.Input,{placeholder:s("mail_subject_nm"),name:"subject",value:y.subject,onChange:o=>{M(o),f()},onBlur:T("subject"),className:"selector-input"}),e.jsxs(c.FormGroup,{check:!0,className:`${F["form-check-disabled"]}`,children:[e.jsx(c.Input,{type:"checkbox",id:"disable-checkbox",checked:!y.isDisabled,onChange:()=>{C("isDisabled",!y.isDisabled)},className:` ${F["active-status"]}`}),e.jsx(c.Label,{check:!0,for:"di-default-checkbox",children:s("enabled")})]})]}),S.subject&&b.subject&&e.jsx(l.ErrorHandler,{text:b.subject})]}),e.jsxs(c.Col,{md:4,children:[e.jsx(l.RequiredLabel,{text:s("category")}),e.jsx(Z,{onChange:o=>{C("categoryId",o.value),f()},id:y.categoryId}),S.categoryId&&b.categoryId&&e.jsx(l.ErrorHandler,{text:b.categoryId})]})]}),e.jsxs(c.Row,{className:"mb-2",children:[e.jsx(c.Col,{md:8,children:e.jsxs(c.Row,{children:[e.jsxs(c.Col,{md:12,className:"mb-2",children:[e.jsx(l.RequiredLabel,{text:s("mail_body")}),(n.body||!a)&&e.jsx(H.Editor,{tinymceScriptSrc:"/tinymce/tinymce.min.js",ref:o=>p(o),initialValue:n.body,init:l.editorConfig.email,onEditorChange:o=>{C("body",o),f()}}),S.body&&b.body&&e.jsx(l.ErrorHandler,{text:b.body})]}),e.jsx(c.Col,{md:12,children:e.jsxs(c.Row,{children:[e.jsx(c.Col,{md:3,children:e.jsx(c.Button,{color:"link",size:"sm",className:"pl-0",onClick:D,children:s("add_attachment")})}),e.jsx(c.Col,{md:12,children:e.jsxs(c.Row,{children:[y.attachments.map(o=>e.jsx(c.Col,{md:2,children:e.jsx(B,{label:o.name,onRemove:()=>C("attachments",y.attachments.filter(t=>t.name!==o.name))})},o.key)),g.map((o,t)=>e.jsx(c.Col,{md:2,className:"d-flex align-items-center",children:e.jsx(B,{label:o.name,onRemove:()=>N(o.inputId,o.name)})},t))]})})]})})]})}),e.jsxs(c.Col,{md:4,children:[e.jsx(c.Label,{children:s("mail_params")}),e.jsx(X,{onClick:o=>h(o),isResetPasswordTemplate:y.categoryId==(_&&_.length>0&&_.filter(o=>o.name=="Reset password")[0].id)})]})]}),e.jsx(l.DetailActionButtons,{confirmText:q,onConfirm:$,onCancel:E})]})}})};exports.default=le;