mario-core 1.0.20-es-alpha → 1.0.22-es-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/mario-core.css +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
searchreplace visualblocks code fullscreen
|
|
7
7
|
insertdatetime media table paste code help wordcount media`,toolbar:"undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | image",paste_data_images:!0},G$_={...cn,images_upload_handler:async function(e,t){const _=new FormData;_.append("file",e.blob(),e.filename());try{const{data:n}=await qi(_);t(Jt(n.key))}catch{return}}},B$_={...cn,images_upload_handler:async function(e,t){const _=new FormData;_.append("file",e.blob(),e.filename());try{const{data:n}=await L$_(_);t(Jt(n.key))}catch{return}}},V$_={...cn,height:Yn,images_upload_handler:async function(e,t){const _=new FormData;_.append("file",e.blob(),e.filename());try{const{data:n}=await M$_(_);t(Jt(n.key))}catch{return}}},H$_={...cn,height:Yn,media_live_embeds:!0,plugins:`advlist autolink lists link image charmap print preview anchor
|
|
8
8
|
searchreplace visualblocks code fullscreen
|
|
9
|
-
insertdatetime media table paste code help wordcount media`,toolbar:"undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | image | media",images_upload_handler:async function(e,t){const _=new FormData;_.append("file",e.blob(),e.filename());try{const{data:n}=await To(_);t(Jt(n.key))}catch{return}},file_picker_callback:function(e){var t=document.createElement("input");t.setAttribute("type","file"),t.setAttribute("accept","video/*"),t.onchange=async function(_){const n=_.target.files[0],{name:s}=n,r=new FormData;r.append("file",n,s);const{data:c}=await To(r);e(Jt(c.key))},t.click()}},Mi={email:G$_,question:B$_,answer:V$_,tutorial:H$_},W$_={id:0,subject:"",categoryId:0,body:"",attachments:[]},U$_="/admin/email-template",X$_="Email template detail",Y$_=4194304,Z$_=e=>{let t;const _=$e.useDispatch(),n=wt.useNavigate(),[s,r]=k.useState(W$_),[c,h]=k.useState(!1),l=async()=>{localStorage.setItem(window.location.href,"true"),h(!0)},[g,p]=k.useState([]),[f,v]=k.useState([]);k.useEffect(()=>{document.title=X$_,h(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},[]),k.useEffect(()=>{e&&I()},[e]);const I=k.useCallback(async()=>{var R,D;_(ue(!0));try{const O=await n$_(e);r({id:O.data.id,subject:O.data.subject,categoryId:O.data.category.id,body:O.data.body,attachments:O.data.attachments||[]}),document.title=O.data.subject,t&&t.editor.execCommand("mceSetContent",!1,O.data.body)}catch(O){_(me({type:"danger",message:((D=(R=O.response)==null?void 0:R.data)==null?void 0:D.title)||O.message}))}_(ue(!1))},[e]),A=R=>t=R,C=R=>{t&&t.editor.execCommand("mceInsertContent",!1,` ${R.label}`)},b=k.useCallback(()=>{n(U$_)},[]),E=k.useCallback(async R=>{var D,O;_(ue(!0));try{if(f&&f.length){const oe=(await M()).map(ae=>({key:ae.data.key,name:ae.data.name}));R.attachments=[...R.attachments,...oe]}await(e?a$_:o$_)(R),_(me({type:"success",message:`${e?"Update":"Create"} template successfully`})),b()}catch(V){_(me({type:"danger",message:((O=(D=V.response)==null?void 0:D.data)==null?void 0:O.title)||V.message}))}_(ue(!1))},[e,f]),T=()=>{const R=document.getElementsByClassName("input-attachment"),D=document.createElement("input"),O=document.getElementById("email-detail");O==null||O.append(D),D.className="input-attachment",D.id=`inputAttachment-${R.length+1}`,D.type="file",D.style.display="none",D.setAttribute("multiple","multiple"),D.addEventListener("change",P),D.click()},P=()=>{const R=[];let D=0;const O=document.getElementsByClassName("input-attachment");for(const V of O)for(const J of V.files)D+=J.size,D>Y$_&&(_(me({type:"danger",message:"Max attachment size is 4MB"})),D-=J.size,V.remove());for(const V of O)for(const J of V.files){const{name:oe}=J;!g.includes(J)&&!R.some(ae=>ae.name===oe)&&R.push({name:oe,inputId:V.id})}v(R)},q=(R,D)=>{if(f.filter(O=>O.inputId===R).length===1){const O=document.getElementById(R);O==null||O.remove();let V=f.filter(J=>J.inputId===R);f.filter(J=>J.inputId!==V.inputId),g.push(V),p([...g]),v([...f]);return}p([...g,D])};k.useEffect(()=>{P()},[g]);const M=async()=>{const R=document.getElementsByClassName("input-attachment"),D=[];for(const O of R)for(const V of O.files){const{name:J}=V,oe=new FormData;oe.append("file",V,J),D.push(qi(oe))}return Promise.all(D)};return{emailTemplateDetail:s,setEditorRef:A,addParams:C,backToList:b,confirmData:E,edited:c,setEdited:h,setEditedTrue:l,onAttachFile:T,updateAttachment:P,fileUpload:f,removeAttachment:q}},J$_=_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",e=>e>=1),comment:_t.string(),body:_t.string().required("Template body is required")}),Q$_="create_email_template",K$_="edit_email_template",e1_=()=>{const{id:e}=wt.useParams();if(!e)return o.jsx(on,{});const{t}=vt.useTranslation(),{classFontSize:_}=Jn(),{emailTemplateDetail:n,setEditorRef:s,addParams:r,backToList:c,confirmData:h,edited:l,setEdited:g,setEditedTrue:p,onAttachFile:f,fileUpload:v,removeAttachment:I}=Z$_(parseInt(e)),A=e?K$_:Q$_,C=e?"update":"create",b=$e.useSelector(E=>E.mailCategory.mailCategoryList);return o.jsx(c_.Formik,{initialValues:n,enableReinitialize:!0,validationSchema:J$_,onSubmit:E=>{h(E),g(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},children:E=>{const{values:T,touched:P,errors:q,setFieldValue:M,handleChange:R,handleBlur:D,handleSubmit:O}=E;return o.jsxs("div",{className:`animated fadeIn detail-buttons-padding ${L[_]}`,id:"email-detail",children:[o.jsx(ps,{when:l}),o.jsx("h5",{className:`mb-2 ${L["custom-title-font-size"]}`,children:t(A)}),o.jsxs(S.Row,{className:"my-2",children:[o.jsxs(S.Col,{md:8,children:[o.jsx(zt,{className:` ${L["custom-font-size"]}`,text:t("mail_subject")}),o.jsx(S.Input,{placeholder:t("mail_subject_nm"),name:"subject",value:T.subject,onChange:V=>{R(V),p()},onBlur:D("subject"),className:`selector-input ${L["custom-font-size"]}`}),P.subject&&q.subject&&o.jsx(kt,{text:q.subject})]}),o.jsxs(S.Col,{md:4,children:[o.jsx(zt,{className:` ${L["custom-font-size"]}`,text:t("category")}),o.jsx(y$_,{onChange:V=>{M("categoryId",V.value),p()},id:T.categoryId,className:` ${L["custom-font-size"]}`}),P.categoryId&&q.categoryId&&o.jsx(kt,{text:q.categoryId})]})]}),o.jsxs(S.Row,{className:"mb-2",children:[o.jsx(S.Col,{md:8,children:o.jsxs(S.Row,{children:[o.jsxs(S.Col,{md:12,className:"mb-2",children:[o.jsx(zt,{className:` ${L["custom-font-size"]}`,text:t("mail_body")}),(n.body||!e)&&o.jsx(Al.Editor,{ref:V=>s(V),tinymceScriptSrc:"./tinymce/tinymce.min.js",initialValue:n.body,init:Mi.email,onEditorChange:V=>{M("body",V),p()}}),P.body&&q.body&&o.jsx(kt,{text:q.body})]}),o.jsx(S.Col,{md:12,children:o.jsxs(S.Row,{children:[o.jsx(S.Col,{md:3,children:o.jsx(S.Button,{color:"link",size:"sm",onClick:f,className:`pl-0 ${L["custom-font-size"]}`,children:t("add_attachment")})}),o.jsx(S.Col,{md:12,children:o.jsxs(S.Row,{children:[T.attachments.map(V=>o.jsx(S.Col,{md:2,children:o.jsx(Eo,{label:V.name,onRemove:()=>M("attachments",T.attachments.filter(J=>J.name!==V.name)),className:` ${L["custom-font-size"]}`})},V.key)),v.map((V,J)=>o.jsx(S.Col,{md:2,className:"d-flex align-items-center",children:o.jsx(Eo,{label:V.name,onRemove:()=>I(V.inputId,V.name),className:` ${L["custom-font-size"]}`})},J))]})})]})})]})}),o.jsxs(S.Col,{md:4,children:[o.jsx(S.Label,{className:` ${L["custom-font-size"]}`,children:t("mail_params")}),o.jsx(f$_,{onClick:V=>r(V),isResetPasswordTemplate:T.categoryId==(b&&b.length>0&&b.filter(V=>V.name=="Reset password")[0].id),className:` ${L["custom-font-size"]}`})]})]}),o.jsx(Qn,{confirmText:C,onConfirm:O,onCancel:c,className:` ${L["custom-font-size"]}`})]})}})},t1_=(e,t)=>{const{t:_}=vt.useTranslation(),{header:n,children:s,onConfirm:r,onCancel:c,confirmText:h,cancelText:l,noFooter:g,size:p,edited:f,setEditedFalse:v,className:I}=e,[A,C]=k.useState(!1),b=$e.useDispatch(),E=M=>{var R,D;try{b(Xt({isOpen:!0,type:"warning",message:"Are you sure to cancel?",onConfirm:async()=>{M()}}))}catch(O){b(me({type:"danger",message:((D=(R=O.response)==null?void 0:R.data)==null?void 0:D.title)||O.message}))}},T=()=>{v&&v(),C(!A),A&&c&&c()},P=k.useCallback((M,R)=>{M?E(()=>{T(),R&&R()}):(T(),R&&R())},[A]),q=k.useCallback(()=>{P(!!f,()=>{c&&c()})},[P,c,f]);return k.useImperativeHandle(t,()=>({toggle:P})),o.jsxs(S.Modal,{isOpen:A,toggle:()=>P(!!f),size:p,className:L[I],children:[o.jsx(S.ModalHeader,{className:`${L["custom-title-font-size"]}`,toggle:()=>P(!!f),children:n}),o.jsx(S.ModalBody,{children:s}),!g&&o.jsxs(S.ModalFooter,{className:"text-right",children:[r&&o.jsx(S.Button,{color:"primary",onClick:r,className:` ${L["custom-font-size"]}`,children:h||_("confirm")}),o.jsx(S.Button,{onClick:q,className:` ${L["custom-font-size"]}`,children:l||_("cancel")})]})]})},ln=k.forwardRef(t1_),_1_=_t.object({question:_t.string().required("Question is required"),answer:_t.string().required("Answer is required")}),s1_=(e,t)=>{const{header:_,confirmText:n,onConfirm:s,faqDetail:r,onCancel:c,edited:h,setEdited:l,setEditedTrue:g,setEditedFalse:p}=e;return o.jsx(c_.Formik,{initialValues:r,enableReinitialize:!0,validationSchema:_1_,onSubmit:(f,v)=>{s(f),v.resetForm()},children:f=>{const{values:v,touched:I,errors:A,handleChange:C,handleBlur:b,handleSubmit:E}=f;return o.jsx(ln,{header:_,confirmText:n,onConfirm:E,onCancel:c,ref:t,edited:h,setEdited:l,setEditedFalse:p,children:o.jsxs(S.Row,{children:[o.jsxs(S.Col,{md:12,children:[o.jsx(zt,{text:"Question"}),o.jsx(S.Input,{type:"textarea",name:"question",placeholder:"Question",value:v.question,onChange:T=>{C(T),g()},onBlur:b("question")}),I.question&&A.question&&o.jsx(kt,{text:A.question})]}),o.jsxs(S.Col,{md:12,className:"pt-2",children:[o.jsx(zt,{text:"Answer"}),o.jsx(S.Input,{type:"textarea",rows:5,name:"answer",placeholder:"Answer",value:v.answer,onChange:T=>{C(T),g()},onBlur:b("answer")}),I.answer&&A.answer&&o.jsx(kt,{text:A.answer})]})]})})}})},n1_=k.forwardRef(s1_),zi=U.createAction("faqs/setFaqList"),fs=`${mt}/api/SystemFaq`,o1_=e=>ke.get(fs,{params:e}),a1_=e=>ke.get(`${fs}/${e}`),i1_=e=>ke.post(fs,e),r1_=e=>ke.put(`${fs}/${e.id}`,e),c1_=e=>ke.delete(`${fs}/${e}`),l1_="FAQ list",d1_=()=>{const e=$e.useSelector(h=>h.faqs.faqList),t=$e.useSelector(h=>h.faqs.totalItems),{filters:_,changeFilters:n}=rn(),s=$e.useDispatch(),r=k.useCallback(async()=>{var h,l;s(ue(!0));try{const g=await o1_(_),{items:p,totalItems:f}=g.data;s(zi({faqList:p,totalItems:f}))}catch(g){s(me({type:"danger",message:((l=(h=g.response)==null?void 0:h.data)==null?void 0:l.title)||g.message}))}s(ue(!1))},[s,_]),c=k.useCallback(h=>{var l,g;s(ue(!0));try{s(Xt({isOpen:!0,type:"warning",message:"Do you want to remove this FAQ?",onConfirm:async()=>{await c1_(h),s(me({type:"success",message:"Remove question successfully"})),n({currentPage:1})}}))}catch(p){s(me({type:"danger",message:((g=(l=p.response)==null?void 0:l.data)==null?void 0:g.title)||p.message}))}s(ue(!1))},[_]);return k.useEffect(()=>{document.title=l1_},[]),k.useEffect(()=>{r()},[_]),{faqList:e,totalItems:t,filters:_,changeFilters:n,getData:r,removeData:c}},Ns={question:"",answer:""},u1_=()=>{const e=$e.useDispatch(),[t,_]=k.useState(0),[n,s]=k.useState(Ns),[r,c]=k.useState(!1),h=async()=>{localStorage.setItem(window.location.href,"true"),c(!0)},l=async()=>{localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href),c(!1)};k.useEffect(()=>{t?p():s(Ns)},[t]),k.useEffect(()=>{l()},[]);const g=()=>{s(Ns),_(0)},p=k.useCallback(async()=>{var v,I;e(ue(!0));try{const A=await a1_(t);s(A.data)}catch(A){e(me({type:"danger",message:((I=(v=A.response)==null?void 0:v.data)==null?void 0:I.title)||A.message}))}e(ue(!1))},[t]),f=k.useCallback(async(v,I)=>{var A,C;e(ue(!0));try{await(t?r1_:i1_)(v),e(me({type:"success",message:`${t?"Update":"Create"} FAQ successfully`})),I&&I(),t&&_(0)}catch(b){e(me({type:"danger",message:((C=(A=b.response)==null?void 0:A.data)==null?void 0:C.title)||b.message}))}e(ue(!1))},[t,n]);return{id:t,setId:_,faqDetail:n,confirmData:f,initValue:Ns,reset:g,edited:r,setEdited:c,setEditedTrue:h,setEditedFalse:l}},m1_="FAQ",h1_=()=>{const e=k.useRef(null),{faqList:t,totalItems:_,filters:n,changeFilters:s,getData:r,removeData:c}=d1_(),{id:h,setId:l,faqDetail:g,confirmData:p,reset:f,edited:v,setEdited:I,setEditedTrue:A,setEditedFalse:C}=u1_(),b=q=>{l(q||0),e&&e.current&&e.current.toggle()},E=q=>{p(q,()=>{e&&e.current&&e.current.toggle(),r()}),C()},T=q=>{c(q)},P=()=>f();return o.jsxs("div",{className:"fadeIn animated",children:[o.jsx(n1_,{ref:e,header:h?"Edit FAQ":"Create FAQ",confirmText:h?"Update":"Create",onConfirm:E,onCancel:P,faqDetail:g,edited:v,setEdited:I,setEditedTrue:A,setEditedFalse:C}),o.jsx(ps,{when:v}),o.jsx("h5",{className:"mb-2",children:m1_}),o.jsxs(S.Row,{className:"my-2",children:[o.jsx(S.Col,{md:4,children:o.jsx(ms,{text:"Create FAQ",onClick:()=>b()})}),o.jsxs(S.Col,{md:4,className:"d-flex align-items-center justify-content-end",children:["Total of FAQs: ",_]})]}),o.jsxs(S.Row,{className:"mb-2",children:[o.jsx(S.Col,{md:8,children:t&&t.length>0?o.jsxs(S.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"align-top",children:"Question"}),o.jsx("th",{className:"align-top",children:"Answer"}),o.jsx("th",{className:"text-center",children:"Action"})]})}),o.jsx("tbody",{children:t.map(q=>o.jsxs("tr",{children:[o.jsx("td",{className:"align-middle",children:o.jsx(F_,{label:q.question,onClick:()=>b(q.id)})}),o.jsx("td",{className:"align-middle",children:q.answer}),o.jsx("td",{className:"text-center align-middle",children:o.jsx(hs,{onClick:()=>T(q.id)})})]},q.id))})]}):o.jsx(I_,{label:"FAQ"})}),o.jsx(S.Col,{md:8,children:o.jsx(C_,{filters:n,totalRecordCount:_,changePageSize:q=>s({pageSize:q}),changePage:q=>s({currentPage:q})})})]})]})},ys=`${mt}/api/Skill`,Di=e=>ke.get(ys,{params:e}),g1_=e=>ke.get(`${ys}/${e}`),p1_=e=>ke.post(ys,e),f1_=e=>ke.put(`${ys}/${e.id}`,e),y1_=e=>ke.delete(`${ys}/${e}`),w1_=e=>{const[t,_]=k.useState([]);k.useEffect(()=>{n()},[]);const n=async()=>{try{const l=await Di();_(l.data.items)}catch(l){console.error(l.message)}},{id:s,isDisabled:r,className:c}=e,h=t.map(l=>({id:l.id,value:l.id,label:l.path?`${l.path}/${l.name}`:l.name}));return o.jsx(us,{options:h,defaultValue:s,...e,isDisabled:r,className:c})},v1_=_t.object({name:_t.string().required("Name is required"),description:_t.string()}),b1_=(e,t)=>{const{t:_}=vt.useTranslation(),{header:n,confirmText:s,onConfirm:r,skillDetail:c,onCancel:h,edited:l,setEdited:g,setEditedTrue:p,setEditedFalse:f,isDisabled:v,classFontSize:I}=e;return o.jsx(c_.Formik,{initialValues:c,enableReinitialize:!0,validationSchema:v1_,onSubmit:(A,C)=>{r(A),C.resetForm()},children:A=>{const{values:C,touched:b,errors:E,handleChange:T,handleBlur:P,handleSubmit:q,resetForm:M}=A;return o.jsx(ln,{header:n,confirmText:s,onConfirm:q,ref:t,onCancel:()=>{h(),M()},edited:l,setEdited:g,setEditedFalse:f,className:I,children:o.jsxs(S.Row,{children:[o.jsxs(S.Col,{md:12,className:"mb-2",children:[o.jsx(zt,{className:`${L["custom-font-size"]}`,text:_("name")}),o.jsx(S.Input,{name:"name",placeholder:_("name"),value:C.name,onChange:R=>{T(R),p()},onBlur:P("name"),className:` ${L["custom-font-size"]}`}),b.name&&E.name&&o.jsx(kt,{text:E.name})]}),o.jsxs(S.Col,{md:12,className:"mb-2",children:[o.jsx(S.Label,{className:` ${L["custom-font-size"]}`,children:_("description")}),o.jsx(S.Input,{type:"textarea",rows:5,name:"description",placeholder:_("description"),value:C.description,onChange:R=>{T(R),p()},onBlur:P("description"),className:` ${L["custom-font-size"]}`})]}),o.jsxs(S.Col,{md:12,className:"mb-2",children:[o.jsx(S.Label,{className:` ${L["custom-font-size"]}`,children:_("parent_category")}),o.jsx(w1_,{isDisabled:v,onChange:R=>{A.setFieldValue("parentSkillId",R.value),p()},id:C.parentSkillId,className:` ${L["custom-font-size"]}`})]})]})})}})},$1_=k.forwardRef(b1_),Oi=U.createAction("skills/setSkillList"),k1_=12,x1_=20,I1_="Skill list",C1_=()=>{const e=$e.useSelector(g=>g.skills.skillList),t=$e.useSelector(g=>g.skills.totalItems),_=$e.useSelector(g=>{var p;return(p=g.common)==null?void 0:p.defaultFontSize}),{filters:n,changeFilters:s}=rn(),r=$e.useDispatch(),c=k.useMemo(()=>_==x1_?"font-large":_==k1_?"font-small":"",[_]),h=k.useCallback(async()=>{var g,p;r(ue(!0));try{const f=await Di(n),{items:v,totalItems:I}=f.data;r(Oi({skillList:v,totalItems:I}))}catch(f){r(me({type:"danger",message:((p=(g=f.response)==null?void 0:g.data)==null?void 0:p.title)||f.message}))}r(ue(!1))},[r,n]),l=k.useCallback(g=>{var p,f;r(ue(!0));try{r(Xt({isOpen:!0,type:"warning",message:"Do you want to remove this skill?",onConfirm:async()=>{var v,I;try{await y1_(g),r(me({type:"success",message:"Remove skill successfully"})),s({currentPage:1})}catch(A){r(me({type:"danger",message:((I=(v=A.response)==null?void 0:v.data)==null?void 0:I.title)||A.message||"Error occured"}))}}}))}catch(v){r(me({type:"danger",message:((f=(p=v.response)==null?void 0:p.data)==null?void 0:f.title)||v.message||"Error occured"}))}r(ue(!1))},[n]);return k.useEffect(()=>{document.title=I1_},[]),k.useEffect(()=>{h()},[n]),{skillList:e,totalItems:t,filters:n,changeFilters:s,getData:h,removeData:l,classFontSize:c}},Ps={name:"",description:"",path:"",parentSkillId:null},S1_=()=>{const e=$e.useDispatch(),[t,_]=k.useState(0),[n,s]=k.useState(Ps),[r,c]=k.useState(!1),h=async()=>{localStorage.setItem(window.location.href,"true"),c(!0)},l=async()=>{localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href),c(!1)};k.useEffect(()=>{t?p():s(Ps)},[t]);const g=()=>{_(0),s(Ps)};k.useEffect(()=>{l()},[]);const p=k.useCallback(async()=>{var v,I;e(ue(!0));try{const A=await g1_(t);s(A.data)}catch(A){e(me({type:"danger",message:((I=(v=A.response)==null?void 0:v.data)==null?void 0:I.title)||A.message}))}e(ue(!1))},[t]),f=k.useCallback(async(v,I)=>{var A,C;e(ue(!0));try{await(t?f1_:p1_)(v),e(me({type:"success",message:`${t?"Update":"Create"} skill successfully`})),I&&I(),t&&_(0)}catch(b){e(me({type:"danger",message:((C=(A=b.response)==null?void 0:A.data)==null?void 0:C.title)||b.message}))}e(ue(!1))},[t,n]);return{id:t,setId:_,skillDetail:n,confirmData:f,initValue:Ps,reset:g,edited:r,setEdited:c,setEditedTrue:h,setEditedFalse:l}},A1_=()=>{const e=k.useRef(null),{t}=vt.useTranslation(),{skillList:_,totalItems:n,filters:s,changeFilters:r,getData:c,removeData:h,classFontSize:l}=C1_(),{id:g,setId:p,skillDetail:f,confirmData:v,reset:I,edited:A,setEdited:C,setEditedTrue:b,setEditedFalse:E}=S1_(),T=R=>{p(R||0),e&&e.current&&e.current.toggle()},P=R=>{v(R,()=>{e&&e.current&&e.current.toggle(),c()}),E()},q=R=>{h(R)},M=()=>I();return o.jsxs("div",{className:`fadeIn animated ${L[l]}`,children:[o.jsx($1_,{ref:e,header:t(g?"edit_skill":"create_skill"),confirmText:t(g?"update":"create"),onCancel:M,onConfirm:P,skillDetail:f,edited:A,setEdited:C,setEditedTrue:b,setEditedFalse:E,isDisabled:g,classFontSize:l}),o.jsx(ps,{when:A}),o.jsxs(S.Row,{className:"my-2",children:[o.jsx(S.Col,{md:4,children:o.jsx(ms,{text:t("create_skill"),onClick:()=>T(),className:` ${L["custom-font-size"]}`})}),o.jsxs(S.Col,{md:4,className:`d-flex justify-content-end align-items-center ${L["custom-font-size"]}`,children:[t("total_of_skills"),": ",n]})]}),o.jsxs(S.Row,{className:"mb-2",children:[o.jsx(S.Col,{md:8,children:_&&_.length>0?o.jsxs(S.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:`align-top ${L["custom-font-size"]}`,children:t("name")}),o.jsx("th",{className:`align-top ${L["custom-font-size"]}`,children:t("description")}),o.jsx("th",{className:`text-center ${L["custom-font-size"]}`,children:t("action")})]})}),o.jsx("tbody",{children:_.map(R=>o.jsxs("tr",{children:[o.jsxs("td",{className:`align-middle ${L["custom-font-size"]}`,children:[o.jsx(F_,{label:R.name,onClick:()=>T(R.id),className:`${L["custom-font-size"]}`}),!!R.path&&o.jsx("p",{className:"mb-0 pl-3",children:o.jsx("i",{children:R.path})})]}),o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:R.description}),o.jsx("td",{className:`text-center align-middle ${L["custom-font-size"]}`,children:o.jsx(hs,{onClick:()=>q(R.id)})})]},R.id))})]}):o.jsx(I_,{label:t("skill")})}),o.jsx(S.Col,{md:8,className:"text-right",children:o.jsx(C_,{totalRecordCount:n,filters:s,changePageSize:R=>r({pageSize:R}),changePage:R=>r({currentPage:R}),className:`${L["custom-font-size"]}`})})]})]})},E1_=12,T1_=20,Fi=e=>{const{t}=vt.useTranslation(),_=wt.useNavigate(),n=wt.useLocation(),s=$e.useSelector(v=>v.common.language),{pathname:r}=n,{tabs:c,title:h}=e,l=v=>{if(v.startsWith("/"))_(v);else{const I=r.lastIndexOf("/"),A=r.substring(0,I+1);_(A+v)}};k.useEffect(()=>{Un.changeLanguage(s)},[s]);const g=$e.useSelector(v=>{var I;return(I=v.common)==null?void 0:I.defaultFontSize}),p=k.useMemo(()=>g==T1_?"font-large":g==E1_?"font-small":"",[g]),f=()=>{const v=c.find(A=>{const C=A.path.startsWith("/")?A.path:`/${A.path}`;return r.endsWith(A.path)||r===C});if(!v)return o.jsx(on,{});const I=v.component;return o.jsxs(S.Row,{className:L[p],children:[o.jsx(S.Col,{md:12,children:o.jsx("h5",{children:t(h)})}),o.jsxs(S.Col,{xl:12,children:[o.jsx(S.Nav,{tabs:!0,children:c.map(A=>{const C=r.endsWith(A.path)||r===(A.path.startsWith("/")?A.path:`/${A.path}`);return o.jsx(S.NavItem,{children:o.jsx(S.NavLink,{className:`${C?"active":""} cursor-pointer`,onClick:()=>{l(A.path)},children:t(A.title)})},A.path)})}),o.jsx(S.TabContent,{activeTab:r,className:"border-bottom-0 border-left-0 border-right-0",children:o.jsx(S.TabPane,{tabId:r,children:o.jsx(I,{})})})]})]})};return o.jsx("div",{className:"animated fadeIn",children:f()})},jo=Symbol.for("constructDateFrom");function Gi(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&jo in e?e[jo](t):e instanceof Date?new e.constructor(t):new Date(t)}function j1_(e,...t){const _=Gi.bind(null,t.find(n=>typeof n=="object"));return t.map(_)}function N1_(e,t,_){const[n,s]=j1_(_==null?void 0:_.in,e,t);return n.getFullYear()-s.getFullYear()}const Ws=U.createAction("users/setUserList"),Bi=U.createAction("users/setStudentList"),y_=`${mt}/api/user`,P1_=`${mt}/api/Account/changePassword`,R1_=`${mt}/api/account`,Vi=`${mt}/api/User`,q1_=e=>ke.get(`${y_}`,{params:e}),No=e=>ke.get(`${y_}/${e}`),L1_=e=>ke.post(`${y_}`,e),M1_=e=>ke.put(`${y_}/${e.id}`,e),z1_=e=>ke.delete(`${y_}/${e}`),D1_=e=>ke.post(P1_,e),O1_=e=>ke.post(`${R1_}/forgotchangepassword`,e),F1_=e=>ke.post(`${Vi}/switch-user/${e}`),G1_=e=>ke.get(`${Vi}/student-assign`,{params:e}),B1_=()=>ke.get(`${mt}/api/counselor`),V1_=()=>ke.get(`${mt}/api/assistant`),Hi=e=>ke.get(`${y_}/all/teacher`,{params:e}),H1_=e=>ke.post(`${y_}/student-assign`,e),W1_=e=>ke.get(`${y_}/filters`,{params:e});var jt=(e=>(e[e.Id=0]="Id",e[e.Name=1]="Name",e[e.Email=2]="Email",e[e.Age=3]="Age",e[e.Role=4]="Role",e[e.Status=5]="Status",e[e.CreatedAt=6]="CreatedAt",e))(jt||{}),L_=(e=>(e[e.Id=0]="Id",e[e.Name=1]="Name",e[e.Email=2]="Email",e[e.Role=3]="Role",e[e.Status=4]="Status",e))(L_||{});const Wi={value:10},U1_={searchString:"",currentPage:1,pageSize:Wi.value,isAssigned:!1},X1_=[{name:"name",sortBy:jt.Name,searchBy:L_.Name,className:"align-top",getOption:e=>({label:e||"empty",value:e})},{name:"email",sortBy:jt.Email,searchBy:L_.Email,className:"align-top",getOption:e=>({label:e||"empty",value:e})},{name:"age",sortBy:jt.Age,className:"align-top"},{name:"role",sortBy:jt.Role,searchBy:L_.Role,className:"align-top",getOption:e=>{var t;return{label:e?(t=e==null?void 0:e.replace)==null?void 0:t.call(e,"SecondaryTeacher","SupportTeacher"):"empty",value:e}}},{name:"active_status",sortBy:jt.Status,searchBy:L_.Status,className:"align-top",options:[{label:"Active",value:"true"},{label:"Inactive",value:"false"}]},{name:"created_time",sortBy:jt.CreatedAt,className:"align-top"},{name:"action",className:"text-center"}],Y1_={currentPage:1,pageSize:200},Z1_={searchString:"",currentPage:1,pageSize:Wi.value},J1_={[jt.Id]:"filter-id",[jt.Name]:"filter-name",[jt.Email]:"filter-email",[jt.Age]:"filter-age",[jt.Role]:"filter-role",[jt.Status]:"filter-status",[jt.CreatedAt]:"filter-createdAt"},Q1_=()=>{const[e,t]=k.useState(Z1_);return{filters:e,setFilters:t,changeFilters:n=>{const s={...e,...n};s.searchString&&n.searchString&&n.searchString!=e.searchString&&(s.currentPage=1),t(s)}}},K1_="/admin/user",ek_="/admin/create-user",tk_="User list",_k_="/home",sk_="/home",nk_="/admin/home",ok_="/parent",ak_="/admin/schools",ik_="/my-student?isReadOnly=true",rk_=12,ck_=20,lk_=()=>{const e=wt.useNavigate(),_=new URLSearchParams(location.search).get("query"),n=$e.useSelector(T=>T.users.userList),s=$e.useSelector(T=>T.users.totalItems),r=$e.useSelector(T=>{var P;return(P=T.common)==null?void 0:P.defaultFontSize}),{filters:c,changeFilters:h}=Q1_(),l=_||"",{t:g}=vt.useTranslation(),p=k.useMemo(()=>r==ck_?"font-large":r==rk_?"font-small":"",[r]),f=window.location.host.includes("-district"),v=$e.useDispatch(),I=k.useCallback(async()=>{var T,P;if(c.searchBy!==void 0&&c.searchByStrings!==void 0&&c.searchByStrings.length===0){v(Ws({userList:[],totalItems:0}));return}v(ue(!0));try{const q=await q1_(c),{items:M,totalItems:R}=q.data;for(const D of M)D.roles=D.roles.includes("EduTeacher")?[i_.EDUTEACHER]:D.roles;v(Ws({userList:M,totalItems:R}))}catch(q){v(me({type:"danger",message:((P=(T=q.response)==null?void 0:T.data)==null?void 0:P.title)||q.message}))}v(ue(!1))},[v,JSON.stringify(c)]);k.useEffect(()=>{document.title=tk_},[]),k.useEffect(()=>{h({...c,searchString:l})},[l]),k.useEffect(()=>{I()},[JSON.stringify(c)]);const A=k.useCallback(T=>{var P,q;v(ue(!0));try{v(Xt({isOpen:!0,type:"warning",message:g("do_you_want_to_remove_this_user"),onConfirm:async()=>{await z1_(T),v(me({type:"success",message:"Remove user successfully"})),c.currentPage!==1?h({currentPage:1}):I()}}))}catch(M){v(me({type:"danger",message:((q=(P=M.response)==null?void 0:P.data)==null?void 0:q.title)||M.message}))}v(ue(!1))},[c]),C=T=>{const{token:P,id:q,firstName:M,lastName:R,roles:D,email:O,profileImageFileName:V}=T.data;sessionStorage.getItem(k_)?sessionStorage.setItem(Nt,P):localStorage.setItem(Nt,P),D.includes("Admin")&&localStorage.setItem("ROLES","Admin"),v(nn({id:q,firstName:M,lastName:R,roles:D,email:O,profileImageFileName:V})),f?e(ak_):D.includes("Admin")?e(nk_):D.includes("Teacher")||D.includes("Assistant")||D.includes("Counselor")?e(_k_):D.includes("Student")?e(sk_):D.includes("Parent")?e(ok_):D.includes("EduTeacher")&&e(ik_)},b=k.useCallback(async T=>{var P,q,M;if((P=T==null?void 0:T.roles)!=null&&P.includes("Parent")){v(me({type:"danger",message:"Can't impersonate!"}));return}v(ue(!0));try{const D=(await F1_((T==null?void 0:T.id)||"")).data;v(Xt({isOpen:!0,type:"warning",message:g("do_you_want_to_impersonate_this_user"),onConfirm:async()=>{var O,V;v(ue(!0));try{const J={email:D.email,password:"default",accessToken:D.token},oe=await Ci(J);localStorage.clear(),C(oe)}catch(J){me({type:"danger",message:((V=(O=J.response)==null?void 0:O.data)==null?void 0:V.title)||J.message})}v(ue(!1))}}))}catch(R){v(me({type:"danger",message:((M=(q=R.response)==null?void 0:q.data)==null?void 0:M.title)||R.message}))}v(ue(!1))},[c]);return{fullName:l,userList:n,totalItems:s,filters:c,queryName:_,getData:I,removeData:A,changeFilters:h,reDirectDetailPage:T=>{const P=T?`${K1_}/${T}`:ek_;e(P)},switchUser:b,classFontSize:p}},dk_=({initValue:e,onSearch:t,placeholder:_="Type something to search",className:n="",style:s={}})=>{const[r,c]=k.useState(e);k.useEffect(()=>{c(e)},[e]);const h=k.useCallback(l=>{l.key==="Enter"&&t(r)},[r,t]);return o.jsx(S.Input,{placeholder:_,value:r,onChange:l=>c(l.target.value),onKeyUp:h,className:n,style:s})},ws=k.memo(dk_),uk_={height:38},Ui=({text:e,initValue:t,onClick:_,onSearch:n,placeholder:s="Type something to search"})=>o.jsxs("div",{className:"d-flex align-items-center",children:[o.jsx("div",{children:o.jsx(ms,{text:e,onClick:_})}),o.jsx("div",{className:"flex-grow-1 ml-2",children:o.jsx(ws,{initValue:t,onSearch:n,placeholder:s,style:uk_})})]});function mk_(e){return Pt({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 3H5a1 1 0 0 0-1 1v2.59c0 .523.213 1.037.583 1.407L10 13.414V21a1.001 1.001 0 0 0 1.447.895l4-2c.339-.17.553-.516.553-.895v-5.586l5.417-5.417c.37-.37.583-.884.583-1.407V4a1 1 0 0 0-1-1zm-6.707 9.293A.996.996 0 0 0 14 13v5.382l-2 1V13a.996.996 0 0 0-.293-.707L6 6.59V5h14.001l.002 1.583-5.71 5.71z"}}]})(e)}function hk_(e){return Pt({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.023 16.977a35.13 35.13 0 0 1-1.367-1.384c-.372-.378-.596-.653-.596-.653l-2.8-1.337A6.962 6.962 0 0 0 16 9c0-3.859-3.14-7-7-7S2 5.141 2 9s3.14 7 7 7c1.763 0 3.37-.66 4.603-1.739l1.337 2.8s.275.224.653.596c.387.363.896.854 1.384 1.367l1.358 1.392.604.646 2.121-2.121-.646-.604c-.379-.372-.885-.866-1.391-1.36zM9 14c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5z"}}]})(e)}function gk_(e){return Pt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z",clipRule:"evenodd"}}]})(e)}function pk_(e){return Pt({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]})(e)}function Us(e){return Pt({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M839.6 433.8L749 150.5a9.24 9.24 0 0 0-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 0 0-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 0 0-9.2-9.3zM416 702h-76V172c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v530h-76c-6.7 0-10.5 7.8-6.3 13l112 141.9a8 8 0 0 0 12.6 0l112-141.9c4.1-5.2.4-13-6.3-13z"}}]})(e)}function Xs(e){return Pt({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M839.6 433.8L749 150.5a9.24 9.24 0 0 0-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 0 0-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 0 0-9.2-9.3zM310.3 167.1a8 8 0 0 0-12.6 0L185.7 309c-4.2 5.3-.4 13 6.3 13h76v530c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V322h76c6.7 0 10.5-7.8 6.3-13l-112-141.9z"}}]})(e)}const fk_=(e,t)=>{k.useEffect(()=>{function _(n){e.current&&!e.current.contains(n.target)&&(t==null||t())}return document.addEventListener("mousedown",_),()=>{document.removeEventListener("mousedown",_)}},[e.current])},yk_=e=>{const{isOpen:t,sortBy:_,filters:n,users:s,searchBy:r,defaultOptions:c,selectedOptions:h,searchKey:l,onChangeSearchKey:g,onOptionsChange:p,onSearch:f,onClose:v,onChangeFilters:I,getOption:A}=e,[C,b]=k.useState(),[E,T]=k.useState([]),P=k.useRef(null),q=k.useRef(null);fk_(P,v);const{t:M}=vt.useTranslation(),R=k.useCallback(()=>{var we;if(!t)return;const te=((we=l==null?void 0:l.trim)==null?void 0:we.call(l))??"";r!=null&&!c&&(f==null||f(te,r)),r!=null&&c&&T(c.filter(Me=>Me.label.toLowerCase().includes(te.toLowerCase())))},[r,l,JSON.stringify(c),t]),D=()=>{q.current&&clearTimeout(q.current),q.current=setTimeout(R,500)},O=te=>{const we=te.target.value;g(we)},V=k.useCallback(()=>{p==null||p(C,r),v==null||v()},[JSON.stringify(C)]),J=k.useCallback(te=>{const we=te.target.value??"";let Me=C??[],Oe=Me.indexOf(we);Oe>-1?Me.splice(Oe,1):Me=[...Me,we],b(Me==null?Me:[...Me])},[JSON.stringify(C)]),oe=k.useCallback(te=>{const we=te.target.checked;b(we?void 0:[])},[]),ae=k.useCallback(()=>{I==null||I({...n,sortBy:(n==null?void 0:n.isDescending)===!0?void 0:_,isDescending:(n==null?void 0:n.isDescending)===!0?void 0:!0}),v==null||v()},[JSON.stringify(n),r]),Ce=k.useCallback(()=>{I==null||I({...n,sortBy:(n==null?void 0:n.isDescending)===!1?void 0:_,isDescending:(n==null?void 0:n.isDescending)===!1?void 0:!1}),v==null||v()},[JSON.stringify(n),r]),_e=k.useMemo(()=>A?s.map(te=>A(te,M)):[],[JSON.stringify(s),JSON.stringify(A)]),Q=(n==null?void 0:n.isDescending)==!1&&n.sortBy===_,ve=!!(n!=null&&n.isDescending)&&n.sortBy===_;return k.useEffect(()=>{(n==null?void 0:n.searchBy)!==r?b(void 0):b(h)},[JSON.stringify(h),n==null?void 0:n.searchBy]),k.useEffect(()=>{T(c||[])},[JSON.stringify(c)]),k.useEffect(()=>{D()},[l,t]),{ref:P,options:_e,inputRef:q,sOptions:C,isAscending:Q,isDescending:ve,filteredOptions:E,searchKey:l,handleSearch:R,handleApplyFilter:V,handleOptionSelected:J,handleOptionSelectedAll:oe,handleSortDesc:ae,handleSortAsc:Ce,handleChangeSearchKey:O}},wk_=e=>{const{defaultOptions:t,onClose:_,getOption:n}=e,{ref:s,inputRef:r,options:c,sOptions:h,isAscending:l,isDescending:g,filteredOptions:p,searchKey:f,handleChangeSearchKey:v,handleApplyFilter:I,handleOptionSelected:A,handleOptionSelectedAll:C,handleSortDesc:b,handleSortAsc:E}=yk_(e);return o.jsx(S.Popover,{...e,hideArrow:!0,children:o.jsx(S.PopoverBody,{className:"pb-3",children:o.jsxs("div",{ref:s,className:L.popover,children:[o.jsxs("div",{className:`d-flex flex-column ${L.popover__sort}`,children:[o.jsx(S.Label,{className:"font-weight-bold",children:"Sort"}),o.jsxs("div",{className:`px-1 ${L.popover__sort__item} ${l&&L["popover__sort__item--active"]}`,onClick:E,children:[o.jsx(Us,{className:"mr-1"}),"Ascending"]}),o.jsxs("div",{className:`px-1 mt-1 ${L.popover__sort__item} ${g&&L["popover__sort__item--active"]}`,onClick:b,children:[o.jsx(Xs,{className:"mr-1"}),"Descending"]})]}),(typeof n<"u"||!!t)&&o.jsxs(k.Fragment,{children:[o.jsx("div",{className:"border border-top-1 border-bottom-0 mx-1 my-2"}),o.jsxs("div",{className:"d-flex flex-column",children:[o.jsx(S.Label,{className:"font-weight-bold",children:"Filter"}),o.jsxs("div",{className:`position-relative px-1 ${L.popover__search}`,children:[o.jsx(hk_,{className:`position-absolute ${L.popover__search__icon}`}),o.jsx(S.Input,{ref:r,className:L.popover__search__input,value:f,onChange:v})]}),o.jsxs("div",{className:`mx-1 mt-2 p-2 bg-light ${L.popover__options}`,children:[o.jsxs(S.FormGroup,{className:"d-flex align-items-center",check:!0,children:[o.jsx(S.Input,{type:"checkbox",onChange:C,checked:h==null})," ",o.jsx(S.Label,{check:!0,children:"(Select all)"})]}),!!n&&!t&&c.map(T=>o.jsxs(S.FormGroup,{className:"d-flex align-items-center",check:!0,children:[o.jsx(S.Input,{type:"checkbox",value:T.value,onChange:A,checked:(h==null?void 0:h.includes(T.value))||h==null})," ",o.jsx(S.Label,{check:!0,children:T.label})]},T.value)),!!t&&p.map(T=>o.jsxs(S.FormGroup,{className:"d-flex align-items-center",check:!0,children:[o.jsx(S.Input,{type:"checkbox",value:T.value,onChange:A,checked:(h==null?void 0:h.includes(T.value))||h==null})," ",o.jsx(S.Label,{check:!0,children:T.label})]},T.value))]})]}),o.jsxs("div",{className:"d-flex justify-content-end mt-3",children:[o.jsx(S.Button,{color:"primary",className:"mr-2",size:"sm",onClick:I,children:"Apply Filter"}),o.jsx(S.Button,{color:"secondary",size:"sm",onClick:_,children:"Cancel"})]})]})]})})})},vk_=({data:e,popoverId:t,filters:_,searchString:n,users:s,selectedOptions:r,onOptionsChange:c,onSearch:h,onChangeFilters:l,onOpenFilter:g,onClose:p})=>{var T;const{t:f}=vt.useTranslation(),[v,I]=k.useState(""),A=k.useMemo(()=>e.sortBy!=null?J1_[e.sortBy]:"",[e.sortBy]),C=k.useMemo(()=>t===A,[A,t]),b=()=>{g==null||g(A,e.searchBy,v,e.sortBy)},E=P=>{I(P)};return o.jsx("th",{className:e.className,children:A&&e.sortBy!==void 0?o.jsxs("div",{className:`w-100 d-flex justify-content-between align-items-center ${L["table-filter-icon"]}`,children:[f(e.name),o.jsxs("div",{className:"ml-2 p-1",id:A,onClick:b,style:{cursor:"pointer"},children:[e.sortBy!==void 0&&e.sortBy===(_==null?void 0:_.sortBy)&&o.jsx("span",{children:_.isDescending?o.jsx(Xs,{}):o.jsx(Us,{})}),(T=_==null?void 0:_.searchByStrings)!=null&&T.length&&e.searchBy===(_==null?void 0:_.searchBy)?o.jsx(gk_,{}):o.jsx(mk_,{})]}),o.jsx(wk_,{placement:"bottom-end",target:A,users:s,isOpen:C,filters:_,sortBy:e.sortBy,searchKey:v,searchBy:e.searchBy,searchString:n,defaultOptions:e.options,selectedOptions:r,onClose:p,onSearch:h,getOption:e.getOption,onChangeFilters:l,onOptionsChange:c,onChangeSearchKey:E})]}):f(e.name)})},bk_=e=>{const{filters:t,onChangeFilters:_}=e,[n,s]=k.useState(),[r,c]=k.useState([]),[h,l]=k.useState({...Y1_,isDescending:t.isDescending,searchString:t.searchString}),g=$e.useDispatch(),p=k.useCallback(async()=>{var C,b,E;try{const P=((C=(await W1_(h)).data)==null?void 0:C.items)||[];c(P)}catch(T){g(me({type:"danger",message:((E=(b=T.response)==null?void 0:b.data)==null?void 0:E.title)||T.message}))}},[JSON.stringify(h)]),f=k.useCallback((C,b,E,T)=>{s(C),l({...h,searchBy:b,searchStringBy:E,isDescending:t.sortBy===T?t.isDescending:void 0,searchString:t.searchString})},[JSON.stringify(h),t.isDescending,t.searchString]),v=()=>{s("")},I=k.useCallback((C,b)=>{l({...h,searchBy:b,searchStringBy:C})},[JSON.stringify(h)]),A=k.useCallback((C,b)=>{b&&(_==null||_({...t,[L_[b]]:C}))},[JSON.stringify(t)]);return k.useEffect(()=>{h.searchBy!==void 0&&p()},[JSON.stringify(h)]),{popoverFilters:h,popoverId:n,users:r,handleFilterIcon:f,handleCloseFilter:v,handleSearch:I,handleChangeFilters:A}},$k_=({headers:e,filters:t,onChangeFilters:_})=>{const{popoverId:n,users:s,handleFilterIcon:r,handleCloseFilter:c,handleSearch:h,handleChangeFilters:l}=bk_({filters:t,onChangeFilters:_});return o.jsx("tr",{children:e.map(g=>o.jsx(vk_,{users:s,data:g,filters:t,popoverId:n,selectedOptions:t.searchByStrings,onSearch:h,onClose:c,onOpenFilter:r,onChangeFilters:_,onOptionsChange:l},g.name))})},kk_=e=>e?e.replace(/YYYY/g,"yyyy").replace(/YY/g,"yy").replace(/DD/g,"dd").replace(/Do/g,"do").replace(/MMMM/g,"MMMM").replace(/MMM/g,"MMM").replace(/MM/g,"MM").replace(/HH/g,"HH").replace(/hh/g,"hh").replace(/mm/g,"mm").replace(/ss/g,"ss").replace(/A/g,"aa"):"yyyy-MM-dd",dn=(e,t)=>{if(e===di)return"";try{const _=new Date(e);return isNaN(_.getTime())?"":m_.format(_,kk_(t))}catch{return""}},xk_=()=>{const{fullName:e,queryName:t,userList:_,totalItems:n,filters:s,removeData:r,changeFilters:c,reDirectDetailPage:h,switchUser:l,classFontSize:g}=lk_(),{t:p}=vt.useTranslation();return o.jsxs("div",{className:`fadeIn animated h-100 pt-3 ${L[g]}`,children:[o.jsx("h5",{className:`mb-2 ${L["custom-title-font-size"]}`,children:p("user")}),o.jsxs(S.Row,{className:`my-2 ${L["custom-font-size"]}`,children:[o.jsx(S.Col,{md:8,children:o.jsx(Ui,{text:p("create_user"),onClick:()=>h(),initValue:t||"",onSearch:f=>c({searchString:f}),placeholder:p("type_something_to_search_by_user_name")})}),o.jsxs(S.Col,{md:4,className:`d-flex justify-content-end align-items-center ${L["custom-font-size"]}`,children:[p("total_of_users"),": ",n]})]}),o.jsxs(S.Row,{className:"mb-2",children:[o.jsx(S.Col,{md:12,children:o.jsx("div",{children:o.jsxs(S.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[o.jsx("thead",{children:o.jsx($k_,{headers:X1_,filters:s,fullName:e,onChangeFilters:c})}),o.jsxs("tbody",{children:[_&&_.length>0&&_.map(f=>o.jsxs("tr",{children:[o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:o.jsx(F_,{label:`${f.fullName}`,onClick:()=>h(f.id)})}),o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:f.email}),o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:f.dateOfBirth!==di&&N1_(new Date,El.toZonedTime(f.dateOfBirth,Intl.DateTimeFormat().resolvedOptions().timeZone))}),o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:!!f.roles&&f.roles.map(v=>v==="SecondaryTeacher"?"SupportTeacher":v).join(", ")}),o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:p(f.isActive?"active":"inactive")}),o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:dn(f==null?void 0:f.createTime,"yyyy-MM-DD HH:mm")}),o.jsxs("td",{className:`align-middle text-center ${L["custom-font-size"]}`,children:[o.jsx(Kb_,{style:{fontSize:"18px",marginRight:"10px",cursor:"pointer"},onClick:()=>l(f)}),o.jsx(hs,{onClick:()=>r(f.id)})]})]},f.id)),(!_||!_.length)&&o.jsx("tr",{children:o.jsx("td",{colSpan:12,className:"p-0",children:o.jsx(I_,{className:"mb-0",label:p("user")})})})]})]})})}),o.jsx(S.Col,{md:12,children:o.jsx(C_,{filters:s,totalRecordCount:n,changePageSize:f=>c({pageSize:f}),changePage:f=>c({currentPage:f}),className:`${L["custom-font-size"]}`})})]})]})};function Ee(){return Ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var _=arguments[t];for(var n in _)({}).hasOwnProperty.call(_,n)&&(e[n]=_[n])}return e},Ee.apply(null,arguments)}function x_(e){"@babel/helpers - typeof";return x_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x_(e)}function Ik_(e,t){if(x_(e)!="object"||!e)return e;var _=e[Symbol.toPrimitive];if(_!==void 0){var n=_.call(e,t);if(x_(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xi(e){var t=Ik_(e,"string");return x_(t)=="symbol"?t:t+""}function ss(e,t,_){return(t=Xi(t))in e?Object.defineProperty(e,t,{value:_,enumerable:!0,configurable:!0,writable:!0}):e[t]=_,e}function Po(e,t){var _=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),_.push.apply(_,n)}return _}function Ie(e){for(var t=1;t<arguments.length;t++){var _=arguments[t]!=null?arguments[t]:{};t%2?Po(Object(_),!0).forEach(function(n){ss(e,n,_[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(_)):Po(Object(_)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(_,n))})}return e}function Ck_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ro(e,t){for(var _=0;_<t.length;_++){var n=t[_];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xi(n.key),n)}}function Sk_(e,t,_){return t&&Ro(e.prototype,t),_&&Ro(e,_),Object.defineProperty(e,"prototype",{writable:!1}),e}function zn(e,t){return zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(_,n){return _.__proto__=n,_},zn(e,t)}function Ak_(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zn(e,t)}function Ys(e){return Ys=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ys(e)}function Yi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Yi=function(){return!!e})()}function Ek_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tk_(e,t){if(t&&(x_(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ek_(e)}function jk_(e){var t=Yi();return function(){var _,n=Ys(e);if(t){var s=Ys(this).constructor;_=Reflect.construct(n,arguments,s)}else _=n.apply(this,arguments);return Tk_(this,_)}}function Dn(e,t){(t==null||t>e.length)&&(t=e.length);for(var _=0,n=Array(t);_<t;_++)n[_]=e[_];return n}function Nk_(e){if(Array.isArray(e))return Dn(e)}function Pk_(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Zi(e,t){if(e){if(typeof e=="string")return Dn(e,t);var _={}.toString.call(e).slice(8,-1);return _==="Object"&&e.constructor&&(_=e.constructor.name),_==="Map"||_==="Set"?Array.from(e):_==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_)?Dn(e,t):void 0}}function Rk_(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
9
|
+
insertdatetime media table paste code help wordcount media`,toolbar:"undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | image | media",images_upload_handler:async function(e,t){const _=new FormData;_.append("file",e.blob(),e.filename());try{const{data:n}=await To(_);t(Jt(n.key))}catch{return}},file_picker_callback:function(e){var t=document.createElement("input");t.setAttribute("type","file"),t.setAttribute("accept","video/*"),t.onchange=async function(_){const n=_.target.files[0],{name:s}=n,r=new FormData;r.append("file",n,s);const{data:c}=await To(r);e(Jt(c.key))},t.click()}},Mi={email:G$_,question:B$_,answer:V$_,tutorial:H$_},W$_={id:0,subject:"",categoryId:0,body:"",attachments:[]},U$_="/admin/email-template",X$_="Email template detail",Y$_=4194304,Z$_=e=>{let t;const _=$e.useDispatch(),n=wt.useNavigate(),[s,r]=k.useState(W$_),[c,h]=k.useState(!1),l=async()=>{localStorage.setItem(window.location.href,"true"),h(!0)},[g,p]=k.useState([]),[f,v]=k.useState([]);k.useEffect(()=>{document.title=X$_,h(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},[]),k.useEffect(()=>{e&&I()},[e]);const I=k.useCallback(async()=>{var R,D;_(ue(!0));try{const O=await n$_(e);r({id:O.data.id,subject:O.data.subject,categoryId:O.data.category.id,body:O.data.body,attachments:O.data.attachments||[]}),document.title=O.data.subject,t&&t.editor.execCommand("mceSetContent",!1,O.data.body)}catch(O){_(me({type:"danger",message:((D=(R=O.response)==null?void 0:R.data)==null?void 0:D.title)||O.message}))}_(ue(!1))},[e]),A=R=>t=R,C=R=>{t&&t.editor.execCommand("mceInsertContent",!1,` ${R.label}`)},b=k.useCallback(()=>{n(U$_)},[]),E=k.useCallback(async R=>{var D,O;_(ue(!0));try{if(f&&f.length){const oe=(await M()).map(ae=>({key:ae.data.key,name:ae.data.name}));R.attachments=[...R.attachments,...oe]}await(e?a$_:o$_)(R),_(me({type:"success",message:`${e?"Update":"Create"} template successfully`})),b()}catch(V){_(me({type:"danger",message:((O=(D=V.response)==null?void 0:D.data)==null?void 0:O.title)||V.message}))}_(ue(!1))},[e,f]),T=()=>{const R=document.getElementsByClassName("input-attachment"),D=document.createElement("input"),O=document.getElementById("email-detail");O==null||O.append(D),D.className="input-attachment",D.id=`inputAttachment-${R.length+1}`,D.type="file",D.style.display="none",D.setAttribute("multiple","multiple"),D.addEventListener("change",P),D.click()},P=()=>{const R=[];let D=0;const O=document.getElementsByClassName("input-attachment");for(const V of O)for(const J of V.files)D+=J.size,D>Y$_&&(_(me({type:"danger",message:"Max attachment size is 4MB"})),D-=J.size,V.remove());for(const V of O)for(const J of V.files){const{name:oe}=J;!g.includes(J)&&!R.some(ae=>ae.name===oe)&&R.push({name:oe,inputId:V.id})}v(R)},q=(R,D)=>{if(f.filter(O=>O.inputId===R).length===1){const O=document.getElementById(R);O==null||O.remove();let V=f.filter(J=>J.inputId===R);f.filter(J=>J.inputId!==V.inputId),g.push(V),p([...g]),v([...f]);return}p([...g,D])};k.useEffect(()=>{P()},[g]);const M=async()=>{const R=document.getElementsByClassName("input-attachment"),D=[];for(const O of R)for(const V of O.files){const{name:J}=V,oe=new FormData;oe.append("file",V,J),D.push(qi(oe))}return Promise.all(D)};return{emailTemplateDetail:s,setEditorRef:A,addParams:C,backToList:b,confirmData:E,edited:c,setEdited:h,setEditedTrue:l,onAttachFile:T,updateAttachment:P,fileUpload:f,removeAttachment:q}},J$_=_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",e=>e>=1),comment:_t.string(),body:_t.string().required("Template body is required")}),Q$_="create_email_template",K$_="edit_email_template",e1_=()=>{const{id:e}=wt.useParams();if(!e)return o.jsx(on,{});const{t}=vt.useTranslation(),{classFontSize:_}=Jn(),{emailTemplateDetail:n,setEditorRef:s,addParams:r,backToList:c,confirmData:h,edited:l,setEdited:g,setEditedTrue:p,onAttachFile:f,fileUpload:v,removeAttachment:I}=Z$_(parseInt(e)),A=e?K$_:Q$_,C=e?"update":"create",b=$e.useSelector(E=>E.mailCategory.mailCategoryList);return o.jsx(c_.Formik,{initialValues:n,enableReinitialize:!0,validationSchema:J$_,onSubmit:E=>{h(E),g(!1),localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href)},children:E=>{const{values:T,touched:P,errors:q,setFieldValue:M,handleChange:R,handleBlur:D,handleSubmit:O}=E;return o.jsxs("div",{className:`animated fadeIn detail-buttons-padding ${L[_]}`,id:"email-detail",children:[o.jsx(ps,{when:l}),o.jsx("h5",{className:`mb-2 ${L["custom-title-font-size"]}`,children:t(A)}),o.jsxs(S.Row,{className:"my-2",children:[o.jsxs(S.Col,{md:8,children:[o.jsx(zt,{className:` ${L["custom-font-size"]}`,text:t("mail_subject")}),o.jsx(S.Input,{placeholder:t("mail_subject_nm"),name:"subject",value:T.subject,onChange:V=>{R(V),p()},onBlur:D("subject"),className:`selector-input ${L["custom-font-size"]}`}),P.subject&&q.subject&&o.jsx(kt,{text:q.subject})]}),o.jsxs(S.Col,{md:4,children:[o.jsx(zt,{className:` ${L["custom-font-size"]}`,text:t("category")}),o.jsx(y$_,{onChange:V=>{M("categoryId",V.value),p()},id:T.categoryId,className:` ${L["custom-font-size"]}`}),P.categoryId&&q.categoryId&&o.jsx(kt,{text:q.categoryId})]})]}),o.jsxs(S.Row,{className:"mb-2",children:[o.jsx(S.Col,{md:8,children:o.jsxs(S.Row,{children:[o.jsxs(S.Col,{md:12,className:"mb-2",children:[o.jsx(zt,{className:` ${L["custom-font-size"]}`,text:t("mail_body")}),(n.body||!e)&&o.jsx(Al.Editor,{ref:V=>s(V),tinymceScriptSrc:"./tinymce/tinymce.min.js",initialValue:n.body,init:Mi.email,onEditorChange:V=>{M("body",V),p()}}),P.body&&q.body&&o.jsx(kt,{text:q.body})]}),o.jsx(S.Col,{md:12,children:o.jsxs(S.Row,{children:[o.jsx(S.Col,{md:3,children:o.jsx(S.Button,{color:"link",size:"sm",onClick:f,className:`pl-0 ${L["custom-font-size"]}`,children:t("add_attachment")})}),o.jsx(S.Col,{md:12,children:o.jsxs(S.Row,{children:[T.attachments.map(V=>o.jsx(S.Col,{md:2,children:o.jsx(Eo,{label:V.name,onRemove:()=>M("attachments",T.attachments.filter(J=>J.name!==V.name)),className:` ${L["custom-font-size"]}`})},V.key)),v.map((V,J)=>o.jsx(S.Col,{md:2,className:"d-flex align-items-center",children:o.jsx(Eo,{label:V.name,onRemove:()=>I(V.inputId,V.name),className:` ${L["custom-font-size"]}`})},J))]})})]})})]})}),o.jsxs(S.Col,{md:4,children:[o.jsx(S.Label,{className:` ${L["custom-font-size"]}`,children:t("mail_params")}),o.jsx(f$_,{onClick:V=>r(V),isResetPasswordTemplate:T.categoryId==(b&&b.length>0&&b.filter(V=>V.name=="Reset password")[0].id),className:` ${L["custom-font-size"]}`})]})]}),o.jsx(Qn,{confirmText:C,onConfirm:O,onCancel:c,className:` ${L["custom-font-size"]}`})]})}})},t1_=(e,t)=>{const{t:_}=vt.useTranslation(),{header:n,children:s,onConfirm:r,onCancel:c,confirmText:h,cancelText:l,noFooter:g,size:p,edited:f,setEditedFalse:v,className:I}=e,[A,C]=k.useState(!1),b=$e.useDispatch(),E=M=>{var R,D;try{b(Xt({isOpen:!0,type:"warning",message:"Are you sure to cancel?",onConfirm:async()=>{M()}}))}catch(O){b(me({type:"danger",message:((D=(R=O.response)==null?void 0:R.data)==null?void 0:D.title)||O.message}))}},T=()=>{v&&v(),C(!A),A&&c&&c()},P=k.useCallback((M,R)=>{M?E(()=>{T(),R&&R()}):(T(),R&&R())},[A]),q=k.useCallback(()=>{P(!!f,()=>{c&&c()})},[P,c,f]);return k.useImperativeHandle(t,()=>({toggle:P})),o.jsxs(S.Modal,{isOpen:A,toggle:()=>P(!!f),size:p,className:L[I],children:[o.jsx(S.ModalHeader,{className:`${L["custom-title-font-size"]}`,toggle:()=>P(!!f),children:n}),o.jsx(S.ModalBody,{children:s}),!g&&o.jsxs(S.ModalFooter,{className:"text-right",children:[r&&o.jsx(S.Button,{color:"primary",onClick:r,className:` ${L["custom-font-size"]}`,children:h||_("confirm")}),o.jsx(S.Button,{onClick:q,className:` ${L["custom-font-size"]}`,children:l||_("cancel")})]})]})},ln=k.forwardRef(t1_),_1_=_t.object({question:_t.string().required("Question is required"),answer:_t.string().required("Answer is required")}),s1_=(e,t)=>{const{header:_,confirmText:n,onConfirm:s,faqDetail:r,onCancel:c,edited:h,setEdited:l,setEditedTrue:g,setEditedFalse:p}=e;return o.jsx(c_.Formik,{initialValues:r,enableReinitialize:!0,validationSchema:_1_,onSubmit:(f,v)=>{s(f),v.resetForm()},children:f=>{const{values:v,touched:I,errors:A,handleChange:C,handleBlur:b,handleSubmit:E}=f;return o.jsx(ln,{header:_,confirmText:n,onConfirm:E,onCancel:c,ref:t,edited:h,setEdited:l,setEditedFalse:p,children:o.jsxs(S.Row,{children:[o.jsxs(S.Col,{md:12,children:[o.jsx(zt,{text:"Question"}),o.jsx(S.Input,{type:"textarea",name:"question",placeholder:"Question",value:v.question,onChange:T=>{C(T),g()},onBlur:b("question")}),I.question&&A.question&&o.jsx(kt,{text:A.question})]}),o.jsxs(S.Col,{md:12,className:"pt-2",children:[o.jsx(zt,{text:"Answer"}),o.jsx(S.Input,{type:"textarea",rows:5,name:"answer",placeholder:"Answer",value:v.answer,onChange:T=>{C(T),g()},onBlur:b("answer")}),I.answer&&A.answer&&o.jsx(kt,{text:A.answer})]})]})})}})},n1_=k.forwardRef(s1_),zi=U.createAction("faqs/setFaqList"),fs=`${mt}/api/SystemFaq`,o1_=e=>ke.get(fs,{params:e}),a1_=e=>ke.get(`${fs}/${e}`),i1_=e=>ke.post(fs,e),r1_=e=>ke.put(`${fs}/${e.id}`,e),c1_=e=>ke.delete(`${fs}/${e}`),l1_="FAQ list",d1_=()=>{const e=$e.useSelector(h=>h.faqs.faqList),t=$e.useSelector(h=>h.faqs.totalItems),{filters:_,changeFilters:n}=rn(),s=$e.useDispatch(),r=k.useCallback(async()=>{var h,l;s(ue(!0));try{const g=await o1_(_),{items:p,totalItems:f}=g.data;s(zi({faqList:p,totalItems:f}))}catch(g){s(me({type:"danger",message:((l=(h=g.response)==null?void 0:h.data)==null?void 0:l.title)||g.message}))}s(ue(!1))},[s,_]),c=k.useCallback(h=>{var l,g;s(ue(!0));try{s(Xt({isOpen:!0,type:"warning",message:"Do you want to remove this FAQ?",onConfirm:async()=>{await c1_(h),s(me({type:"success",message:"Remove question successfully"})),n({currentPage:1})}}))}catch(p){s(me({type:"danger",message:((g=(l=p.response)==null?void 0:l.data)==null?void 0:g.title)||p.message}))}s(ue(!1))},[_]);return k.useEffect(()=>{document.title=l1_},[]),k.useEffect(()=>{r()},[_]),{faqList:e,totalItems:t,filters:_,changeFilters:n,getData:r,removeData:c}},Ns={question:"",answer:""},u1_=()=>{const e=$e.useDispatch(),[t,_]=k.useState(0),[n,s]=k.useState(Ns),[r,c]=k.useState(!1),h=async()=>{localStorage.setItem(window.location.href,"true"),c(!0)},l=async()=>{localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href),c(!1)};k.useEffect(()=>{t?p():s(Ns)},[t]),k.useEffect(()=>{l()},[]);const g=()=>{s(Ns),_(0)},p=k.useCallback(async()=>{var v,I;e(ue(!0));try{const A=await a1_(t);s(A.data)}catch(A){e(me({type:"danger",message:((I=(v=A.response)==null?void 0:v.data)==null?void 0:I.title)||A.message}))}e(ue(!1))},[t]),f=k.useCallback(async(v,I)=>{var A,C;e(ue(!0));try{await(t?r1_:i1_)(v),e(me({type:"success",message:`${t?"Update":"Create"} FAQ successfully`})),I&&I(),t&&_(0)}catch(b){e(me({type:"danger",message:((C=(A=b.response)==null?void 0:A.data)==null?void 0:C.title)||b.message}))}e(ue(!1))},[t,n]);return{id:t,setId:_,faqDetail:n,confirmData:f,initValue:Ns,reset:g,edited:r,setEdited:c,setEditedTrue:h,setEditedFalse:l}},m1_="FAQ",h1_=()=>{const e=k.useRef(null),{faqList:t,totalItems:_,filters:n,changeFilters:s,getData:r,removeData:c}=d1_(),{id:h,setId:l,faqDetail:g,confirmData:p,reset:f,edited:v,setEdited:I,setEditedTrue:A,setEditedFalse:C}=u1_(),b=q=>{l(q||0),e&&e.current&&e.current.toggle()},E=q=>{p(q,()=>{e&&e.current&&e.current.toggle(),r()}),C()},T=q=>{c(q)},P=()=>f();return o.jsxs("div",{className:"fadeIn animated",children:[o.jsx(n1_,{ref:e,header:h?"Edit FAQ":"Create FAQ",confirmText:h?"Update":"Create",onConfirm:E,onCancel:P,faqDetail:g,edited:v,setEdited:I,setEditedTrue:A,setEditedFalse:C}),o.jsx(ps,{when:v}),o.jsx("h5",{className:"mb-2",children:m1_}),o.jsxs(S.Row,{className:"my-2",children:[o.jsx(S.Col,{md:4,children:o.jsx(ms,{text:"Create FAQ",onClick:()=>b()})}),o.jsxs(S.Col,{md:4,className:"d-flex align-items-center justify-content-end",children:["Total of FAQs: ",_]})]}),o.jsxs(S.Row,{className:"mb-2",children:[o.jsx(S.Col,{md:8,children:t&&t.length>0?o.jsxs(S.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"align-top",children:"Question"}),o.jsx("th",{className:"align-top",children:"Answer"}),o.jsx("th",{className:"text-center",children:"Action"})]})}),o.jsx("tbody",{children:t.map(q=>o.jsxs("tr",{children:[o.jsx("td",{className:"align-middle",children:o.jsx(F_,{label:q.question,onClick:()=>b(q.id)})}),o.jsx("td",{className:"align-middle",children:q.answer}),o.jsx("td",{className:"text-center align-middle",children:o.jsx(hs,{onClick:()=>T(q.id)})})]},q.id))})]}):o.jsx(I_,{label:"FAQ"})}),o.jsx(S.Col,{md:8,children:o.jsx(C_,{filters:n,totalRecordCount:_,changePageSize:q=>s({pageSize:q}),changePage:q=>s({currentPage:q})})})]})]})},ys=`${mt}/api/Skill`,Di=e=>ke.get(ys,{params:e}),g1_=e=>ke.get(`${ys}/${e}`),p1_=e=>ke.post(ys,e),f1_=e=>ke.put(`${ys}/${e.id}`,e),y1_=e=>ke.delete(`${ys}/${e}`),w1_=e=>{const[t,_]=k.useState([]);k.useEffect(()=>{n()},[]);const n=async()=>{try{const l=await Di();_(l.data.items)}catch(l){console.error(l.message)}},{id:s,isDisabled:r,className:c}=e,h=t.map(l=>({id:l.id,value:l.id,label:l.path?`${l.path}/${l.name}`:l.name}));return o.jsx(us,{options:h,defaultValue:s,...e,isDisabled:r,className:c})},v1_=_t.object({name:_t.string().required("Name is required"),description:_t.string()}),b1_=(e,t)=>{const{t:_}=vt.useTranslation(),{header:n,confirmText:s,onConfirm:r,skillDetail:c,onCancel:h,edited:l,setEdited:g,setEditedTrue:p,setEditedFalse:f,isDisabled:v,classFontSize:I}=e;return o.jsx(c_.Formik,{initialValues:c,enableReinitialize:!0,validationSchema:v1_,onSubmit:(A,C)=>{r(A),C.resetForm()},children:A=>{const{values:C,touched:b,errors:E,handleChange:T,handleBlur:P,handleSubmit:q,resetForm:M}=A;return o.jsx(ln,{header:n,confirmText:s,onConfirm:q,ref:t,onCancel:()=>{h(),M()},edited:l,setEdited:g,setEditedFalse:f,className:I,children:o.jsxs(S.Row,{children:[o.jsxs(S.Col,{md:12,className:"mb-2",children:[o.jsx(zt,{className:`${L["custom-font-size"]}`,text:_("name")}),o.jsx(S.Input,{name:"name",placeholder:_("name"),value:C.name,onChange:R=>{T(R),p()},onBlur:P("name"),className:` ${L["custom-font-size"]}`}),b.name&&E.name&&o.jsx(kt,{text:E.name})]}),o.jsxs(S.Col,{md:12,className:"mb-2",children:[o.jsx(S.Label,{className:` ${L["custom-font-size"]}`,children:_("description")}),o.jsx(S.Input,{type:"textarea",rows:5,name:"description",placeholder:_("description"),value:C.description,onChange:R=>{T(R),p()},onBlur:P("description"),className:` ${L["custom-font-size"]}`})]}),o.jsxs(S.Col,{md:12,className:"mb-2",children:[o.jsx(S.Label,{className:` ${L["custom-font-size"]}`,children:_("parent_category")}),o.jsx(w1_,{isDisabled:v,onChange:R=>{A.setFieldValue("parentSkillId",R.value),p()},id:C.parentSkillId,className:` ${L["custom-font-size"]}`})]})]})})}})},$1_=k.forwardRef(b1_),Oi=U.createAction("skills/setSkillList"),k1_=12,x1_=20,I1_="Skill list",C1_=()=>{const e=$e.useSelector(g=>g.skills.skillList),t=$e.useSelector(g=>g.skills.totalItems),_=$e.useSelector(g=>{var p;return(p=g.common)==null?void 0:p.defaultFontSize}),{filters:n,changeFilters:s}=rn(),r=$e.useDispatch(),c=k.useMemo(()=>_==x1_?"font-large":_==k1_?"font-small":"",[_]),h=k.useCallback(async()=>{var g,p;r(ue(!0));try{const f=await Di(n),{items:v,totalItems:I}=f.data;r(Oi({skillList:v,totalItems:I}))}catch(f){r(me({type:"danger",message:((p=(g=f.response)==null?void 0:g.data)==null?void 0:p.title)||f.message}))}r(ue(!1))},[r,n]),l=k.useCallback(g=>{var p,f;r(ue(!0));try{r(Xt({isOpen:!0,type:"warning",message:"Do you want to remove this skill?",onConfirm:async()=>{var v,I;try{await y1_(g),r(me({type:"success",message:"Remove skill successfully"})),s({currentPage:1})}catch(A){r(me({type:"danger",message:((I=(v=A.response)==null?void 0:v.data)==null?void 0:I.title)||A.message||"Error occured"}))}}}))}catch(v){r(me({type:"danger",message:((f=(p=v.response)==null?void 0:p.data)==null?void 0:f.title)||v.message||"Error occured"}))}r(ue(!1))},[n]);return k.useEffect(()=>{document.title=I1_},[]),k.useEffect(()=>{h()},[n]),{skillList:e,totalItems:t,filters:n,changeFilters:s,getData:h,removeData:l,classFontSize:c}},Ps={name:"",description:"",path:"",parentSkillId:null},S1_=()=>{const e=$e.useDispatch(),[t,_]=k.useState(0),[n,s]=k.useState(Ps),[r,c]=k.useState(!1),h=async()=>{localStorage.setItem(window.location.href,"true"),c(!0)},l=async()=>{localStorage.getItem(window.location.href)&&localStorage.removeItem(window.location.href),c(!1)};k.useEffect(()=>{t?p():s(Ps)},[t]);const g=()=>{_(0),s(Ps)};k.useEffect(()=>{l()},[]);const p=k.useCallback(async()=>{var v,I;e(ue(!0));try{const A=await g1_(t);s(A.data)}catch(A){e(me({type:"danger",message:((I=(v=A.response)==null?void 0:v.data)==null?void 0:I.title)||A.message}))}e(ue(!1))},[t]),f=k.useCallback(async(v,I)=>{var A,C;e(ue(!0));try{await(t?f1_:p1_)(v),e(me({type:"success",message:`${t?"Update":"Create"} skill successfully`})),I&&I(),t&&_(0)}catch(b){e(me({type:"danger",message:((C=(A=b.response)==null?void 0:A.data)==null?void 0:C.title)||b.message}))}e(ue(!1))},[t,n]);return{id:t,setId:_,skillDetail:n,confirmData:f,initValue:Ps,reset:g,edited:r,setEdited:c,setEditedTrue:h,setEditedFalse:l}},A1_=()=>{const e=k.useRef(null),{t}=vt.useTranslation(),{skillList:_,totalItems:n,filters:s,changeFilters:r,getData:c,removeData:h,classFontSize:l}=C1_(),{id:g,setId:p,skillDetail:f,confirmData:v,reset:I,edited:A,setEdited:C,setEditedTrue:b,setEditedFalse:E}=S1_(),T=R=>{p(R||0),e&&e.current&&e.current.toggle()},P=R=>{v(R,()=>{e&&e.current&&e.current.toggle(),c()}),E()},q=R=>{h(R)},M=()=>I();return o.jsxs("div",{className:`fadeIn animated ${L[l]}`,children:[o.jsx($1_,{ref:e,header:t(g?"edit_skill":"create_skill"),confirmText:t(g?"update":"create"),onCancel:M,onConfirm:P,skillDetail:f,edited:A,setEdited:C,setEditedTrue:b,setEditedFalse:E,isDisabled:g,classFontSize:l}),o.jsx(ps,{when:A}),o.jsxs(S.Row,{className:"my-2",children:[o.jsx(S.Col,{md:4,children:o.jsx(ms,{text:t("create_skill"),onClick:()=>T(),className:` ${L["custom-font-size"]}`})}),o.jsxs(S.Col,{md:4,className:`d-flex justify-content-end align-items-center ${L["custom-font-size"]}`,children:[t("total_of_skills"),": ",n]})]}),o.jsxs(S.Row,{className:"mb-2",children:[o.jsx(S.Col,{md:8,children:_&&_.length>0?o.jsxs(S.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:`align-top ${L["custom-font-size"]}`,children:t("name")}),o.jsx("th",{className:`align-top ${L["custom-font-size"]}`,children:t("description")}),o.jsx("th",{className:`text-center ${L["custom-font-size"]}`,children:t("action")})]})}),o.jsx("tbody",{children:_.map(R=>o.jsxs("tr",{children:[o.jsxs("td",{className:`align-middle ${L["custom-font-size"]}`,children:[o.jsx(F_,{label:R.name,onClick:()=>T(R.id),className:`${L["custom-font-size"]}`}),!!R.path&&o.jsx("p",{className:"mb-0 pl-3",children:o.jsx("i",{children:R.path})})]}),o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:R.description}),o.jsx("td",{className:`text-center align-middle ${L["custom-font-size"]}`,children:o.jsx(hs,{onClick:()=>q(R.id)})})]},R.id))})]}):o.jsx(I_,{label:t("skill")})}),o.jsx(S.Col,{md:8,className:"text-right",children:o.jsx(C_,{totalRecordCount:n,filters:s,changePageSize:R=>r({pageSize:R}),changePage:R=>r({currentPage:R}),className:`${L["custom-font-size"]}`})})]})]})},E1_=12,T1_=20,Fi=e=>{const{t}=vt.useTranslation(),_=wt.useNavigate(),n=wt.useLocation(),s=$e.useSelector(v=>v.common.language),{pathname:r}=n,{tabs:c,title:h}=e,l=v=>{if(v.startsWith("/"))_(v);else{const I=r.lastIndexOf("/"),A=r.substring(0,I+1);_(A+v)}};k.useEffect(()=>{Un.changeLanguage(s)},[s]);const g=$e.useSelector(v=>{var I;return(I=v.common)==null?void 0:I.defaultFontSize}),p=k.useMemo(()=>g==T1_?"font-large":g==E1_?"font-small":"",[g]),f=()=>{const v=c.find(A=>{const C=A.path.startsWith("/")?A.path:`/${A.path}`;return r.endsWith(A.path)||r===C});if(!v)return o.jsx(on,{});const I=v.component;return o.jsxs(S.Row,{className:L[p],children:[o.jsx(S.Col,{md:12,children:o.jsx("h5",{children:t(h)})}),o.jsxs(S.Col,{xl:12,children:[o.jsx(S.Nav,{tabs:!0,children:c.map(A=>{const C=r.endsWith(A.path)||r===(A.path.startsWith("/")?A.path:`/${A.path}`);return o.jsx(S.NavItem,{children:o.jsx(S.NavLink,{className:`${C?"active":""} cursor-pointer`,onClick:()=>{l(A.path)},children:t(A.title)})},A.path)})}),o.jsx(S.TabContent,{activeTab:r,className:"border-bottom-0 border-left-0 border-right-0",children:o.jsx(S.TabPane,{tabId:r,children:o.jsx(I,{})})})]})]})};return o.jsx("div",{className:"animated fadeIn",children:f()})},jo=Symbol.for("constructDateFrom");function Gi(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&jo in e?e[jo](t):e instanceof Date?new e.constructor(t):new Date(t)}function j1_(e,...t){const _=Gi.bind(null,t.find(n=>typeof n=="object"));return t.map(_)}function N1_(e,t,_){const[n,s]=j1_(_==null?void 0:_.in,e,t);return n.getFullYear()-s.getFullYear()}const Ws=U.createAction("users/setUserList"),Bi=U.createAction("users/setStudentList"),y_=`${mt}/api/user`,P1_=`${mt}/api/Account/changePassword`,R1_=`${mt}/api/account`,Vi=`${mt}/api/User`,q1_=e=>ke.get(`${y_}`,{params:e}),No=e=>ke.get(`${y_}/${e}`),L1_=e=>ke.post(`${y_}`,e),M1_=e=>ke.put(`${y_}/${e.id}`,e),z1_=e=>ke.delete(`${y_}/${e}`),D1_=e=>ke.post(P1_,e),O1_=e=>ke.post(`${R1_}/forgotchangepassword`,e),F1_=e=>ke.post(`${Vi}/switch-user/${e}`),G1_=e=>ke.get(`${Vi}/student-assign`,{params:e}),B1_=()=>ke.get(`${mt}/api/counselor`),V1_=()=>ke.get(`${mt}/api/assistant`),Hi=e=>ke.get(`${y_}/all/teacher`,{params:e}),H1_=e=>ke.post(`${y_}/student-assign`,e),W1_=e=>ke.get(`${y_}/filters`,{params:e});var jt=(e=>(e[e.Id=0]="Id",e[e.Name=1]="Name",e[e.Email=2]="Email",e[e.Age=3]="Age",e[e.Role=4]="Role",e[e.Status=5]="Status",e[e.CreatedAt=6]="CreatedAt",e))(jt||{}),L_=(e=>(e[e.Id=0]="Id",e[e.Name=1]="Name",e[e.Email=2]="Email",e[e.Role=3]="Role",e[e.Status=4]="Status",e))(L_||{});const Wi={value:10},U1_={searchString:"",currentPage:1,pageSize:Wi.value,isAssigned:!1},X1_=[{name:"name",sortBy:jt.Name,searchBy:L_.Name,className:"align-top",getOption:e=>({label:e||"empty",value:e})},{name:"email",sortBy:jt.Email,searchBy:L_.Email,className:"align-top",getOption:e=>({label:e||"empty",value:e})},{name:"age",sortBy:jt.Age,className:"align-top"},{name:"role",sortBy:jt.Role,searchBy:L_.Role,className:"align-top",getOption:e=>{var t;return{label:e?(t=e==null?void 0:e.replace)==null?void 0:t.call(e,"SecondaryTeacher","SupportTeacher"):"empty",value:e}}},{name:"active_status",sortBy:jt.Status,searchBy:L_.Status,className:"align-top",options:[{label:"Active",value:"true"},{label:"Inactive",value:"false"}]},{name:"created_time",sortBy:jt.CreatedAt,className:"align-top"},{name:"action",className:"text-center"}],Y1_={currentPage:1,pageSize:200},Z1_={searchString:"",currentPage:1,pageSize:Wi.value},J1_={[jt.Id]:"filter-id",[jt.Name]:"filter-name",[jt.Email]:"filter-email",[jt.Age]:"filter-age",[jt.Role]:"filter-role",[jt.Status]:"filter-status",[jt.CreatedAt]:"filter-createdAt"},Q1_=()=>{const[e,t]=k.useState(Z1_);return{filters:e,setFilters:t,changeFilters:n=>{const s={...e,...n};s.searchString&&n.searchString&&n.searchString!=e.searchString&&(s.currentPage=1),t(s)}}},K1_="/admin/user",ek_="/admin/create-user",tk_="User list",_k_="/home",sk_="/home",nk_="/admin/home",ok_="/parent",ak_="/admin/schools",ik_="/my-student?isReadOnly=true",rk_=12,ck_=20,lk_=()=>{const e=wt.useNavigate(),_=new URLSearchParams(location.search).get("query"),n=$e.useSelector(T=>T.users.userList),s=$e.useSelector(T=>T.users.totalItems),r=$e.useSelector(T=>{var P;return(P=T.common)==null?void 0:P.defaultFontSize}),{filters:c,changeFilters:h}=Q1_(),l=_||"",{t:g}=vt.useTranslation(),p=k.useMemo(()=>r==ck_?"font-large":r==rk_?"font-small":"",[r]),f=window.location.host.includes("-district"),v=$e.useDispatch(),I=k.useCallback(async()=>{var T,P;if(c.searchBy!==void 0&&c.searchByStrings!==void 0&&c.searchByStrings.length===0){v(Ws({userList:[],totalItems:0}));return}v(ue(!0));try{const q=await q1_(c),{items:M,totalItems:R}=q.data;for(const D of M)D.roles=D.roles.includes("EduTeacher")?[i_.EDUTEACHER]:D.roles;v(Ws({userList:M,totalItems:R}))}catch(q){v(me({type:"danger",message:((P=(T=q.response)==null?void 0:T.data)==null?void 0:P.title)||q.message}))}v(ue(!1))},[v,JSON.stringify(c)]);k.useEffect(()=>{document.title=tk_},[]),k.useEffect(()=>{h({...c,searchString:l})},[l]),k.useEffect(()=>{I()},[JSON.stringify(c)]);const A=k.useCallback(T=>{var P,q;v(ue(!0));try{v(Xt({isOpen:!0,type:"warning",message:g("do_you_want_to_remove_this_user"),onConfirm:async()=>{await z1_(T),v(me({type:"success",message:"Remove user successfully"})),c.currentPage!==1?h({currentPage:1}):I()}}))}catch(M){v(me({type:"danger",message:((q=(P=M.response)==null?void 0:P.data)==null?void 0:q.title)||M.message}))}v(ue(!1))},[c]),C=T=>{const{token:P,id:q,firstName:M,lastName:R,roles:D,email:O,profileImageFileName:V}=T.data;sessionStorage.getItem(k_)?sessionStorage.setItem(Nt,P):localStorage.setItem(Nt,P),D.includes("Admin")&&localStorage.setItem("ROLES","Admin"),v(nn({id:q,firstName:M,lastName:R,roles:D,email:O,profileImageFileName:V})),f?e(ak_):D.includes("Admin")?e(nk_):D.includes("Teacher")||D.includes("Assistant")||D.includes("Counselor")?e(_k_):D.includes("Student")?e(sk_):D.includes("Parent")?e(ok_):D.includes("EduTeacher")&&e(ik_)},b=k.useCallback(async T=>{var P,q,M;if((P=T==null?void 0:T.roles)!=null&&P.includes("Parent")){v(me({type:"danger",message:"Can't impersonate!"}));return}v(ue(!0));try{const D=(await F1_((T==null?void 0:T.id)||"")).data;v(Xt({isOpen:!0,type:"warning",message:g("do_you_want_to_impersonate_this_user"),onConfirm:async()=>{var O,V;v(ue(!0));try{const J={email:D.email,password:"default",accessToken:D.token},oe=await Ci(J);localStorage.clear(),C(oe)}catch(J){me({type:"danger",message:((V=(O=J.response)==null?void 0:O.data)==null?void 0:V.title)||J.message})}v(ue(!1))}}))}catch(R){v(me({type:"danger",message:((M=(q=R.response)==null?void 0:q.data)==null?void 0:M.title)||R.message}))}v(ue(!1))},[c]);return{fullName:l,userList:n,totalItems:s,filters:c,queryName:_,getData:I,removeData:A,changeFilters:h,reDirectDetailPage:T=>{const P=T?`${K1_}/${T}`:ek_;e(P)},switchUser:b,classFontSize:p}},dk_=({initValue:e,onSearch:t,placeholder:_="Type something to search",className:n="",style:s={}})=>{const[r,c]=k.useState(e);k.useEffect(()=>{c(e)},[e]);const h=k.useCallback(l=>{l.key==="Enter"&&t(r)},[r,t]);return o.jsx(S.Input,{placeholder:_,value:r,onChange:l=>c(l.target.value),onKeyUp:h,className:n,style:s})},ws=k.memo(dk_),uk_={height:38},Ui=({text:e,initValue:t,onClick:_,onSearch:n,placeholder:s="Type something to search"})=>o.jsxs("div",{className:"d-flex align-items-center",children:[o.jsx("div",{children:o.jsx(ms,{text:e,onClick:_})}),o.jsx("div",{className:"flex-grow-1 ml-2",children:o.jsx(ws,{initValue:t,onSearch:n,placeholder:s,style:uk_})})]});function mk_(e){return Pt({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 3H5a1 1 0 0 0-1 1v2.59c0 .523.213 1.037.583 1.407L10 13.414V21a1.001 1.001 0 0 0 1.447.895l4-2c.339-.17.553-.516.553-.895v-5.586l5.417-5.417c.37-.37.583-.884.583-1.407V4a1 1 0 0 0-1-1zm-6.707 9.293A.996.996 0 0 0 14 13v5.382l-2 1V13a.996.996 0 0 0-.293-.707L6 6.59V5h14.001l.002 1.583-5.71 5.71z"}}]})(e)}function hk_(e){return Pt({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.023 16.977a35.13 35.13 0 0 1-1.367-1.384c-.372-.378-.596-.653-.596-.653l-2.8-1.337A6.962 6.962 0 0 0 16 9c0-3.859-3.14-7-7-7S2 5.141 2 9s3.14 7 7 7c1.763 0 3.37-.66 4.603-1.739l1.337 2.8s.275.224.653.596c.387.363.896.854 1.384 1.367l1.358 1.392.604.646 2.121-2.121-.646-.604c-.379-.372-.885-.866-1.391-1.36zM9 14c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5z"}}]})(e)}function gk_(e){return Pt({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z",clipRule:"evenodd"}}]})(e)}function pk_(e){return Pt({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]})(e)}function Us(e){return Pt({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M839.6 433.8L749 150.5a9.24 9.24 0 0 0-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 0 0-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 0 0-9.2-9.3zM416 702h-76V172c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v530h-76c-6.7 0-10.5 7.8-6.3 13l112 141.9a8 8 0 0 0 12.6 0l112-141.9c4.1-5.2.4-13-6.3-13z"}}]})(e)}function Xs(e){return Pt({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M839.6 433.8L749 150.5a9.24 9.24 0 0 0-8.9-6.5h-77.4c-4.1 0-7.6 2.6-8.9 6.5l-91.3 283.3c-.3.9-.5 1.9-.5 2.9 0 5.1 4.2 9.3 9.3 9.3h56.4c4.2 0 7.8-2.8 9-6.8l17.5-61.6h89l17.3 61.5c1.1 4 4.8 6.8 9 6.8h61.2c1 0 1.9-.1 2.8-.4 2.4-.8 4.3-2.4 5.5-4.6 1.1-2.2 1.3-4.7.6-7.1zM663.3 325.5l32.8-116.9h6.3l32.1 116.9h-71.2zm143.5 492.9H677.2v-.4l132.6-188.9c1.1-1.6 1.7-3.4 1.7-5.4v-36.4c0-5.1-4.2-9.3-9.3-9.3h-204c-5.1 0-9.3 4.2-9.3 9.3v43c0 5.1 4.2 9.3 9.3 9.3h122.6v.4L587.7 828.9a9.35 9.35 0 0 0-1.7 5.4v36.4c0 5.1 4.2 9.3 9.3 9.3h211.4c5.1 0 9.3-4.2 9.3-9.3v-43a9.2 9.2 0 0 0-9.2-9.3zM310.3 167.1a8 8 0 0 0-12.6 0L185.7 309c-4.2 5.3-.4 13 6.3 13h76v530c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V322h76c6.7 0 10.5-7.8 6.3-13l-112-141.9z"}}]})(e)}const fk_=(e,t)=>{k.useEffect(()=>{function _(n){e.current&&!e.current.contains(n.target)&&(t==null||t())}return document.addEventListener("mousedown",_),()=>{document.removeEventListener("mousedown",_)}},[e.current])},yk_=e=>{const{isOpen:t,sortBy:_,filters:n,users:s,searchBy:r,defaultOptions:c,selectedOptions:h,searchKey:l,onChangeSearchKey:g,onOptionsChange:p,onSearch:f,onClose:v,onChangeFilters:I,getOption:A}=e,[C,b]=k.useState(),[E,T]=k.useState([]),P=k.useRef(null),q=k.useRef(null);fk_(P,v);const{t:M}=vt.useTranslation(),R=k.useCallback(()=>{var we;if(!t)return;const te=((we=l==null?void 0:l.trim)==null?void 0:we.call(l))??"";r!=null&&!c&&(f==null||f(te,r)),r!=null&&c&&T(c.filter(Me=>Me.label.toLowerCase().includes(te.toLowerCase())))},[r,l,JSON.stringify(c),t]),D=()=>{q.current&&clearTimeout(q.current),q.current=setTimeout(R,500)},O=te=>{const we=te.target.value;g(we)},V=k.useCallback(()=>{p==null||p(C,r),v==null||v()},[JSON.stringify(C)]),J=k.useCallback(te=>{const we=te.target.value??"";let Me=C??[],Oe=Me.indexOf(we);Oe>-1?Me.splice(Oe,1):Me=[...Me,we],b(Me==null?Me:[...Me])},[JSON.stringify(C)]),oe=k.useCallback(te=>{const we=te.target.checked;b(we?void 0:[])},[]),ae=k.useCallback(()=>{I==null||I({...n,sortBy:(n==null?void 0:n.isDescending)===!0?void 0:_,isDescending:(n==null?void 0:n.isDescending)===!0?void 0:!0}),v==null||v()},[JSON.stringify(n),r]),Ce=k.useCallback(()=>{I==null||I({...n,sortBy:(n==null?void 0:n.isDescending)===!1?void 0:_,isDescending:(n==null?void 0:n.isDescending)===!1?void 0:!1}),v==null||v()},[JSON.stringify(n),r]),_e=k.useMemo(()=>A?s.map(te=>A(te,M)):[],[JSON.stringify(s),JSON.stringify(A)]),Q=(n==null?void 0:n.isDescending)==!1&&n.sortBy===_,ve=!!(n!=null&&n.isDescending)&&n.sortBy===_;return k.useEffect(()=>{(n==null?void 0:n.searchBy)!==r?b(void 0):b(h)},[JSON.stringify(h),n==null?void 0:n.searchBy]),k.useEffect(()=>{T(c||[])},[JSON.stringify(c)]),k.useEffect(()=>{D()},[l,t]),{ref:P,options:_e,inputRef:q,sOptions:C,isAscending:Q,isDescending:ve,filteredOptions:E,searchKey:l,handleSearch:R,handleApplyFilter:V,handleOptionSelected:J,handleOptionSelectedAll:oe,handleSortDesc:ae,handleSortAsc:Ce,handleChangeSearchKey:O}},wk_=e=>{const{defaultOptions:t,onClose:_,getOption:n}=e,{ref:s,inputRef:r,options:c,sOptions:h,isAscending:l,isDescending:g,filteredOptions:p,searchKey:f,handleChangeSearchKey:v,handleApplyFilter:I,handleOptionSelected:A,handleOptionSelectedAll:C,handleSortDesc:b,handleSortAsc:E}=yk_(e);return o.jsx(S.Popover,{...e,hideArrow:!0,children:o.jsx(S.PopoverBody,{className:"pb-3",children:o.jsxs("div",{ref:s,className:L.popover,children:[o.jsxs("div",{className:`d-flex flex-column ${L.popover__sort}`,children:[o.jsx(S.Label,{className:"font-weight-bold",children:"Sort"}),o.jsxs("div",{className:`px-1 ${L.popover__sort__item} ${l&&L["popover__sort__item--active"]}`,onClick:E,children:[o.jsx(Us,{className:"mr-1"}),"Ascending"]}),o.jsxs("div",{className:`px-1 mt-1 ${L.popover__sort__item} ${g&&L["popover__sort__item--active"]}`,onClick:b,children:[o.jsx(Xs,{className:"mr-1"}),"Descending"]})]}),(typeof n<"u"||!!t)&&o.jsxs(k.Fragment,{children:[o.jsx("div",{className:"border border-top-1 border-bottom-0 mx-1 my-2"}),o.jsxs("div",{className:"d-flex flex-column",children:[o.jsx(S.Label,{className:"font-weight-bold",children:"Filter"}),o.jsxs("div",{className:`position-relative px-1 ${L.popover__search}`,children:[o.jsx(hk_,{className:`position-absolute ${L.popover__search__icon}`}),o.jsx(S.Input,{ref:r,className:L.popover__search__input,value:f,onChange:v})]}),o.jsxs("div",{className:`mx-1 mt-2 p-2 bg-light ${L.popover__options}`,children:[o.jsxs(S.FormGroup,{className:"d-flex align-items-center",check:!0,children:[o.jsx(S.Input,{type:"checkbox",onChange:C,checked:h==null})," ",o.jsx(S.Label,{check:!0,children:"(Select all)"})]}),!!n&&!t&&c.map(T=>o.jsxs(S.FormGroup,{className:"d-flex align-items-center",check:!0,children:[o.jsx(S.Input,{type:"checkbox",value:T.value,onChange:A,checked:(h==null?void 0:h.includes(T.value))||h==null})," ",o.jsx(S.Label,{check:!0,children:T.label})]},T.value)),!!t&&p.map(T=>o.jsxs(S.FormGroup,{className:"d-flex align-items-center",check:!0,children:[o.jsx(S.Input,{type:"checkbox",value:T.value,onChange:A,checked:(h==null?void 0:h.includes(T.value))||h==null})," ",o.jsx(S.Label,{check:!0,children:T.label})]},T.value))]})]}),o.jsxs("div",{className:"d-flex justify-content-end mt-3",children:[o.jsx(S.Button,{color:"primary",className:"mr-2",size:"sm",onClick:I,children:"Apply Filter"}),o.jsx(S.Button,{color:"secondary",size:"sm",onClick:_,children:"Cancel"})]})]})]})})})},vk_=({data:e,popoverId:t,filters:_,searchString:n,users:s,selectedOptions:r,onOptionsChange:c,onSearch:h,onChangeFilters:l,onOpenFilter:g,onClose:p})=>{var T;const{t:f}=vt.useTranslation(),[v,I]=k.useState(""),A=k.useMemo(()=>e.sortBy!=null?J1_[e.sortBy]:"",[e.sortBy]),C=k.useMemo(()=>t===A,[A,t]),b=()=>{g==null||g(A,e.searchBy,v,e.sortBy)},E=P=>{I(P)};return o.jsx("th",{className:e.className,children:A&&e.sortBy!==void 0?o.jsxs("div",{className:`w-100 d-flex justify-content-between align-items-center ${L["table-filter-icon"]}`,children:[f(e.name),o.jsxs("div",{className:"ml-2 p-1",id:A,onClick:b,style:{cursor:"pointer"},children:[e.sortBy!==void 0&&e.sortBy===(_==null?void 0:_.sortBy)&&o.jsx("span",{children:_.isDescending?o.jsx(Xs,{}):o.jsx(Us,{})}),(T=_==null?void 0:_.searchByStrings)!=null&&T.length&&e.searchBy===(_==null?void 0:_.searchBy)?o.jsx(gk_,{}):o.jsx(mk_,{})]}),o.jsx(wk_,{placement:"bottom-end",target:A,users:s,isOpen:C,filters:_,sortBy:e.sortBy,searchKey:v,searchBy:e.searchBy,searchString:n,defaultOptions:e.options,selectedOptions:r,onClose:p,onSearch:h,getOption:e.getOption,onChangeFilters:l,onOptionsChange:c,onChangeSearchKey:E})]}):f(e.name)})},bk_=e=>{const{filters:t,onChangeFilters:_}=e,[n,s]=k.useState(),[r,c]=k.useState([]),[h,l]=k.useState({...Y1_,isDescending:t.isDescending,searchString:t.searchString}),g=$e.useDispatch(),p=k.useCallback(async()=>{var C,b,E;try{const P=((C=(await W1_(h)).data)==null?void 0:C.items)||[];c(P)}catch(T){g(me({type:"danger",message:((E=(b=T.response)==null?void 0:b.data)==null?void 0:E.title)||T.message}))}},[JSON.stringify(h)]),f=k.useCallback((C,b,E,T)=>{s(C),l({...h,searchBy:b,searchStringBy:E,isDescending:t.sortBy===T?t.isDescending:void 0,searchString:t.searchString})},[JSON.stringify(h),t.isDescending,t.searchString]),v=()=>{s("")},I=k.useCallback((C,b)=>{l({...h,searchBy:b,searchStringBy:C})},[JSON.stringify(h)]),A=k.useCallback((C,b)=>{b&&(_==null||_({...t,[L_[b]]:C}))},[JSON.stringify(t)]);return k.useEffect(()=>{h.searchBy!==void 0&&p()},[JSON.stringify(h)]),{popoverFilters:h,popoverId:n,users:r,handleFilterIcon:f,handleCloseFilter:v,handleSearch:I,handleChangeFilters:A}},$k_=({headers:e,filters:t,onChangeFilters:_})=>{const{popoverId:n,users:s,handleFilterIcon:r,handleCloseFilter:c,handleSearch:h,handleChangeFilters:l}=bk_({filters:t,onChangeFilters:_});return o.jsx("tr",{children:e.map(g=>o.jsx(vk_,{users:s,data:g,filters:t,popoverId:n,selectedOptions:t.searchByStrings,onSearch:h,onClose:c,onOpenFilter:r,onChangeFilters:_,onOptionsChange:l},g.name))})},kk_=e=>e?e.replace(/YYYY/g,"yyyy").replace(/YY/g,"yy").replace(/DD/g,"dd").replace(/D/g,"d").replace(/Do/g,"do").replace(/MMMM/g,"MMMM").replace(/MMM/g,"MMM").replace(/MM/g,"MM").replace(/M/g,"M").replace(/HH/g,"HH").replace(/hh/g,"hh").replace(/mm/g,"mm").replace(/ss/g,"ss").replace(/A/g,"aa"):"yyyy-MM-dd",dn=(e,t)=>{if(e===di)return"";try{const _=new Date(e);return isNaN(_.getTime())?"":m_.format(_,kk_(t))}catch{return""}},xk_=()=>{const{fullName:e,queryName:t,userList:_,totalItems:n,filters:s,removeData:r,changeFilters:c,reDirectDetailPage:h,switchUser:l,classFontSize:g}=lk_(),{t:p}=vt.useTranslation();return o.jsxs("div",{className:`fadeIn animated h-100 pt-3 ${L[g]}`,children:[o.jsx("h5",{className:`mb-2 ${L["custom-title-font-size"]}`,children:p("user")}),o.jsxs(S.Row,{className:`my-2 ${L["custom-font-size"]}`,children:[o.jsx(S.Col,{md:8,children:o.jsx(Ui,{text:p("create_user"),onClick:()=>h(),initValue:t||"",onSearch:f=>c({searchString:f}),placeholder:p("type_something_to_search_by_user_name")})}),o.jsxs(S.Col,{md:4,className:`d-flex justify-content-end align-items-center ${L["custom-font-size"]}`,children:[p("total_of_users"),": ",n]})]}),o.jsxs(S.Row,{className:"mb-2",children:[o.jsx(S.Col,{md:12,children:o.jsx("div",{children:o.jsxs(S.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[o.jsx("thead",{children:o.jsx($k_,{headers:X1_,filters:s,fullName:e,onChangeFilters:c})}),o.jsxs("tbody",{children:[_&&_.length>0&&_.map(f=>o.jsxs("tr",{children:[o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:o.jsx(F_,{label:`${f.fullName}`,onClick:()=>h(f.id)})}),o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:f.email}),o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:f.dateOfBirth!==di&&N1_(new Date,El.toZonedTime(f.dateOfBirth,Intl.DateTimeFormat().resolvedOptions().timeZone))}),o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:!!f.roles&&f.roles.map(v=>v==="SecondaryTeacher"?"SupportTeacher":v).join(", ")}),o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:p(f.isActive?"active":"inactive")}),o.jsx("td",{className:`align-middle ${L["custom-font-size"]}`,children:dn(f==null?void 0:f.createTime,"yyyy-MM-DD HH:mm")}),o.jsxs("td",{className:`align-middle text-center ${L["custom-font-size"]}`,children:[o.jsx(Kb_,{style:{fontSize:"18px",marginRight:"10px",cursor:"pointer"},onClick:()=>l(f)}),o.jsx(hs,{onClick:()=>r(f.id)})]})]},f.id)),(!_||!_.length)&&o.jsx("tr",{children:o.jsx("td",{colSpan:12,className:"p-0",children:o.jsx(I_,{className:"mb-0",label:p("user")})})})]})]})})}),o.jsx(S.Col,{md:12,children:o.jsx(C_,{filters:s,totalRecordCount:n,changePageSize:f=>c({pageSize:f}),changePage:f=>c({currentPage:f}),className:`${L["custom-font-size"]}`})})]})]})};function Ee(){return Ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var _=arguments[t];for(var n in _)({}).hasOwnProperty.call(_,n)&&(e[n]=_[n])}return e},Ee.apply(null,arguments)}function x_(e){"@babel/helpers - typeof";return x_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x_(e)}function Ik_(e,t){if(x_(e)!="object"||!e)return e;var _=e[Symbol.toPrimitive];if(_!==void 0){var n=_.call(e,t);if(x_(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xi(e){var t=Ik_(e,"string");return x_(t)=="symbol"?t:t+""}function ss(e,t,_){return(t=Xi(t))in e?Object.defineProperty(e,t,{value:_,enumerable:!0,configurable:!0,writable:!0}):e[t]=_,e}function Po(e,t){var _=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),_.push.apply(_,n)}return _}function Ie(e){for(var t=1;t<arguments.length;t++){var _=arguments[t]!=null?arguments[t]:{};t%2?Po(Object(_),!0).forEach(function(n){ss(e,n,_[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(_)):Po(Object(_)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(_,n))})}return e}function Ck_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ro(e,t){for(var _=0;_<t.length;_++){var n=t[_];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xi(n.key),n)}}function Sk_(e,t,_){return t&&Ro(e.prototype,t),_&&Ro(e,_),Object.defineProperty(e,"prototype",{writable:!1}),e}function zn(e,t){return zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(_,n){return _.__proto__=n,_},zn(e,t)}function Ak_(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zn(e,t)}function Ys(e){return Ys=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ys(e)}function Yi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Yi=function(){return!!e})()}function Ek_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tk_(e,t){if(t&&(x_(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ek_(e)}function jk_(e){var t=Yi();return function(){var _,n=Ys(e);if(t){var s=Ys(this).constructor;_=Reflect.construct(n,arguments,s)}else _=n.apply(this,arguments);return Tk_(this,_)}}function Dn(e,t){(t==null||t>e.length)&&(t=e.length);for(var _=0,n=Array(t);_<t;_++)n[_]=e[_];return n}function Nk_(e){if(Array.isArray(e))return Dn(e)}function Pk_(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Zi(e,t){if(e){if(typeof e=="string")return Dn(e,t);var _={}.toString.call(e).slice(8,-1);return _==="Object"&&e.constructor&&(_=e.constructor.name),_==="Map"||_==="Set"?Array.from(e):_==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_)?Dn(e,t):void 0}}function Rk_(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
10
10
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M_(e){return Nk_(e)||Pk_(e)||Zi(e)||Rk_()}function qk_(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Lk_(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Mk_=(function(){function e(_){var n=this;this._insertTag=function(s){var r;n.tags.length===0?n.insertionPoint?r=n.insertionPoint.nextSibling:n.prepend?r=n.container.firstChild:r=n.before:r=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(s,r),n.tags.push(s)},this.isSpeedy=_.speedy===void 0?!0:_.speedy,this.tags=[],this.ctr=0,this.nonce=_.nonce,this.key=_.key,this.container=_.container,this.prepend=_.prepend,this.insertionPoint=_.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Lk_(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var r=qk_(s);try{r.insertRule(n,r.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var s;return(s=n.parentNode)==null?void 0:s.removeChild(n)}),this.tags=[],this.ctr=0},e})(),Mt="-ms-",Zs="-moz-",ot="-webkit-",Ji="comm",Kn="rule",eo="decl",zk_="@import",Qi="@keyframes",Dk_="@layer",Ok_=Math.abs,un=String.fromCharCode,Fk_=Object.assign;function Gk_(e,t){return qt(e,0)^45?(((t<<2^qt(e,0))<<2^qt(e,1))<<2^qt(e,2))<<2^qt(e,3):0}function Ki(e){return e.trim()}function Bk_(e,t){return(e=t.exec(e))?e[0]:e}function at(e,t,_){return e.replace(t,_)}function On(e,t){return e.indexOf(t)}function qt(e,t){return e.charCodeAt(t)|0}function cs(e,t,_){return e.slice(t,_)}function e_(e){return e.length}function to(e){return e.length}function Rs(e,t){return t.push(e),e}function Vk_(e,t){return e.map(t).join("")}var mn=1,D_=1,er=0,Gt=0,Ct=0,G_="";function hn(e,t,_,n,s,r,c){return{value:e,root:t,parent:_,type:n,props:s,children:r,line:mn,column:D_,length:c,return:""}}function es(e,t){return Fk_(hn("",null,null,"",null,null,0),e,{length:-e.length},t)}function Hk_(){return Ct}function Wk_(){return Ct=Gt>0?qt(G_,--Gt):0,D_--,Ct===10&&(D_=1,mn--),Ct}function Vt(){return Ct=Gt<er?qt(G_,Gt++):0,D_++,Ct===10&&(D_=1,mn++),Ct}function __(){return qt(G_,Gt)}function Os(){return Gt}function vs(e,t){return cs(G_,e,t)}function ls(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tr(e){return mn=D_=1,er=e_(G_=e),Gt=0,[]}function _r(e){return G_="",e}function Fs(e){return Ki(vs(Gt-1,Fn(e===91?e+2:e===40?e+1:e)))}function Uk_(e){for(;(Ct=__())&&Ct<33;)Vt();return ls(e)>2||ls(Ct)>3?"":" "}function Xk_(e,t){for(;--t&&Vt()&&!(Ct<48||Ct>102||Ct>57&&Ct<65||Ct>70&&Ct<97););return vs(e,Os()+(t<6&&__()==32&&Vt()==32))}function Fn(e){for(;Vt();)switch(Ct){case e:return Gt;case 34:case 39:e!==34&&e!==39&&Fn(Ct);break;case 40:e===41&&Fn(e);break;case 92:Vt();break}return Gt}function Yk_(e,t){for(;Vt()&&e+Ct!==57;)if(e+Ct===84&&__()===47)break;return"/*"+vs(t,Gt-1)+"*"+un(e===47?e:Vt())}function Zk_(e){for(;!ls(__());)Vt();return vs(e,Gt)}function Jk_(e){return _r(Gs("",null,null,null,[""],e=tr(e),0,[0],e))}function Gs(e,t,_,n,s,r,c,h,l){for(var g=0,p=0,f=c,v=0,I=0,A=0,C=1,b=1,E=1,T=0,P="",q=s,M=r,R=n,D=P;b;)switch(A=T,T=Vt()){case 40:if(A!=108&&qt(D,f-1)==58){On(D+=at(Fs(T),"&","&\f"),"&\f")!=-1&&(E=-1);break}case 34:case 39:case 91:D+=Fs(T);break;case 9:case 10:case 13:case 32:D+=Uk_(A);break;case 92:D+=Xk_(Os()-1,7);continue;case 47:switch(__()){case 42:case 47:Rs(Qk_(Yk_(Vt(),Os()),t,_),l);break;default:D+="/"}break;case 123*C:h[g++]=e_(D)*E;case 125*C:case 59:case 0:switch(T){case 0:case 125:b=0;case 59+p:E==-1&&(D=at(D,/\f/g,"")),I>0&&e_(D)-f&&Rs(I>32?Lo(D+";",n,_,f-1):Lo(at(D," ","")+";",n,_,f-2),l);break;case 59:D+=";";default:if(Rs(R=qo(D,t,_,g,p,s,h,P,q=[],M=[],f),r),T===123)if(p===0)Gs(D,t,R,R,q,r,f,h,M);else switch(v===99&&qt(D,3)===110?100:v){case 100:case 108:case 109:case 115:Gs(e,R,R,n&&Rs(qo(e,R,R,0,0,s,h,P,s,q=[],f),M),s,M,f,h,n?q:M);break;default:Gs(D,R,R,R,[""],M,0,h,M)}}g=p=I=0,C=E=1,P=D="",f=c;break;case 58:f=1+e_(D),I=A;default:if(C<1){if(T==123)--C;else if(T==125&&C++==0&&Wk_()==125)continue}switch(D+=un(T),T*C){case 38:E=p>0?1:(D+="\f",-1);break;case 44:h[g++]=(e_(D)-1)*E,E=1;break;case 64:__()===45&&(D+=Fs(Vt())),v=__(),p=f=e_(P=D+=Zk_(Os())),T++;break;case 45:A===45&&e_(D)==2&&(C=0)}}return r}function qo(e,t,_,n,s,r,c,h,l,g,p){for(var f=s-1,v=s===0?r:[""],I=to(v),A=0,C=0,b=0;A<n;++A)for(var E=0,T=cs(e,f+1,f=Ok_(C=c[A])),P=e;E<I;++E)(P=Ki(C>0?v[E]+" "+T:at(T,/&\f/g,v[E])))&&(l[b++]=P);return hn(e,t,_,s===0?Kn:h,l,g,p)}function Qk_(e,t,_){return hn(e,t,_,Ji,un(Hk_()),cs(e,2,-2),0)}function Lo(e,t,_,n){return hn(e,t,_,eo,cs(e,0,n),cs(e,n+1,-1),n)}function z_(e,t){for(var _="",n=to(e),s=0;s<n;s++)_+=t(e[s],s,e,t)||"";return _}function Kk_(e,t,_,n){switch(e.type){case Dk_:if(e.children.length)break;case zk_:case eo:return e.return=e.return||e.value;case Ji:return"";case Qi:return e.return=e.value+"{"+z_(e.children,n)+"}";case Kn:e.value=e.props.join(",")}return e_(_=z_(e.children,n))?e.return=e.value+"{"+_+"}":""}function e2_(e){var t=to(e);return function(_,n,s,r){for(var c="",h=0;h<t;h++)c+=e[h](_,n,s,r)||"";return c}}function t2_(e){return function(t){t.root||(t=t.return)&&e(t)}}function _2_(e){var t=Object.create(null);return function(_){return t[_]===void 0&&(t[_]=e(_)),t[_]}}var s2_=function(t,_,n){for(var s=0,r=0;s=r,r=__(),s===38&&r===12&&(_[n]=1),!ls(r);)Vt();return vs(t,Gt)},n2_=function(t,_){var n=-1,s=44;do switch(ls(s)){case 0:s===38&&__()===12&&(_[n]=1),t[n]+=s2_(Gt-1,_,n);break;case 2:t[n]+=Fs(s);break;case 4:if(s===44){t[++n]=__()===58?"&\f":"",_[n]=t[n].length;break}default:t[n]+=un(s)}while(s=Vt());return t},o2_=function(t,_){return _r(n2_(tr(t),_))},Mo=new WeakMap,a2_=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var _=t.value,n=t.parent,s=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&_.charCodeAt(0)!==58&&!Mo.get(n))&&!s){Mo.set(t,!0);for(var r=[],c=o2_(_,r),h=n.props,l=0,g=0;l<c.length;l++)for(var p=0;p<h.length;p++,g++)t.props[g]=r[l]?c[l].replace(/&\f/g,h[p]):h[p]+" "+c[l]}}},i2_=function(t){if(t.type==="decl"){var _=t.value;_.charCodeAt(0)===108&&_.charCodeAt(2)===98&&(t.return="",t.value="")}};function sr(e,t){switch(Gk_(e,t)){case 5103:return ot+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ot+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ot+e+Zs+e+Mt+e+e;case 6828:case 4268:return ot+e+Mt+e+e;case 6165:return ot+e+Mt+"flex-"+e+e;case 5187:return ot+e+at(e,/(\w+).+(:[^]+)/,ot+"box-$1$2"+Mt+"flex-$1$2")+e;case 5443:return ot+e+Mt+"flex-item-"+at(e,/flex-|-self/,"")+e;case 4675:return ot+e+Mt+"flex-line-pack"+at(e,/align-content|flex-|-self/,"")+e;case 5548:return ot+e+Mt+at(e,"shrink","negative")+e;case 5292:return ot+e+Mt+at(e,"basis","preferred-size")+e;case 6060:return ot+"box-"+at(e,"-grow","")+ot+e+Mt+at(e,"grow","positive")+e;case 4554:return ot+at(e,/([^-])(transform)/g,"$1"+ot+"$2")+e;case 6187:return at(at(at(e,/(zoom-|grab)/,ot+"$1"),/(image-set)/,ot+"$1"),e,"")+e;case 5495:case 3959:return at(e,/(image-set\([^]*)/,ot+"$1$`$1");case 4968:return at(at(e,/(.+:)(flex-)?(.*)/,ot+"box-pack:$3"+Mt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ot+e+e;case 4095:case 3583:case 4068:case 2532:return at(e,/(.+)-inline(.+)/,ot+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(e_(e)-1-t>6)switch(qt(e,t+1)){case 109:if(qt(e,t+4)!==45)break;case 102:return at(e,/(.+:)(.+)-([^]+)/,"$1"+ot+"$2-$3$1"+Zs+(qt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~On(e,"stretch")?sr(at(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(qt(e,t+1)!==115)break;case 6444:switch(qt(e,e_(e)-3-(~On(e,"!important")&&10))){case 107:return at(e,":",":"+ot)+e;case 101:return at(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ot+(qt(e,14)===45?"inline-":"")+"box$3$1"+ot+"$2$3$1"+Mt+"$2box$3")+e}break;case 5936:switch(qt(e,t+11)){case 114:return ot+e+Mt+at(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ot+e+Mt+at(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ot+e+Mt+at(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ot+e+Mt+e+e}return e}var r2_=function(t,_,n,s){if(t.length>-1&&!t.return)switch(t.type){case eo:t.return=sr(t.value,t.length);break;case Qi:return z_([es(t,{value:at(t.value,"@","@"+ot)})],s);case Kn:if(t.length)return Vk_(t.props,function(r){switch(Bk_(r,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return z_([es(t,{props:[at(r,/:(read-\w+)/,":"+Zs+"$1")]})],s);case"::placeholder":return z_([es(t,{props:[at(r,/:(plac\w+)/,":"+ot+"input-$1")]}),es(t,{props:[at(r,/:(plac\w+)/,":"+Zs+"$1")]}),es(t,{props:[at(r,/:(plac\w+)/,Mt+"input-$1")]})],s)}return""})}},c2_=[r2_],l2_=function(t){var _=t.key;if(_==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(C){var b=C.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(C),C.setAttribute("data-s",""))})}var s=t.stylisPlugins||c2_,r={},c,h=[];c=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+_+' "]'),function(C){for(var b=C.getAttribute("data-emotion").split(" "),E=1;E<b.length;E++)r[b[E]]=!0;h.push(C)});var l,g=[a2_,i2_];{var p,f=[Kk_,t2_(function(C){p.insert(C)})],v=e2_(g.concat(s,f)),I=function(b){return z_(Jk_(b),v)};l=function(b,E,T,P){p=T,I(b?b+"{"+E.styles+"}":E.styles),P&&(A.inserted[E.name]=!0)}}var A={key:_,sheet:new Mk_({key:_,container:c,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:r,registered:{},insert:l};return A.sheet.hydrate(h),A};function d2_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qs={exports:{}},it={};/** @license React v16.13.1
|
|
11
11
|
* react-is.production.min.js
|
|
12
12
|
*
|
package/dist/index.modern.js
CHANGED
|
@@ -15062,7 +15062,7 @@ const ck_ = (e, t) => {
|
|
|
15062
15062
|
},
|
|
15063
15063
|
g.name
|
|
15064
15064
|
)) });
|
|
15065
|
-
}, gk_ = (e) => e ? e.replace(/YYYY/g, "yyyy").replace(/YY/g, "yy").replace(/DD/g, "dd").replace(/Do/g, "do").replace(/MMMM/g, "MMMM").replace(/MMM/g, "MMM").replace(/MM/g, "MM").replace(/HH/g, "HH").replace(/hh/g, "hh").replace(/mm/g, "mm").replace(/ss/g, "ss").replace(/A/g, "aa") : "yyyy-MM-dd", vo = (e, t) => {
|
|
15065
|
+
}, gk_ = (e) => e ? e.replace(/YYYY/g, "yyyy").replace(/YY/g, "yy").replace(/DD/g, "dd").replace(/D/g, "d").replace(/Do/g, "do").replace(/MMMM/g, "MMMM").replace(/MMM/g, "MMM").replace(/MM/g, "MM").replace(/M/g, "M").replace(/HH/g, "HH").replace(/hh/g, "hh").replace(/mm/g, "mm").replace(/ss/g, "ss").replace(/A/g, "aa") : "yyyy-MM-dd", vo = (e, t) => {
|
|
15066
15066
|
if (e === Vi) return "";
|
|
15067
15067
|
try {
|
|
15068
15068
|
const _ = new Date(e);
|