mario-core 2.0.2 → 2.0.3-release
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/Dashboard-C8i4BvyG.js +1 -0
- package/dist/Dashboard-CZW-qGyN.mjs +206 -0
- package/dist/EmailTemplateDetail-CITCgbC8.mjs +417 -0
- package/dist/EmailTemplateDetail-mdYeUDJg.js +1 -0
- package/dist/EmailTemplateList-BV-QOv5K.mjs +168 -0
- package/dist/EmailTemplateList-Dgf0hucr.js +1 -0
- package/dist/GalleryList-BYwvWx1S.js +1 -0
- package/dist/GalleryList-JJbcEbTi.mjs +329 -0
- package/dist/Login-BWsVc8Np.mjs +1384 -0
- package/dist/Login-SxZya_gO.js +1 -0
- package/dist/NotificationList-BDtxAveg.js +2 -0
- package/dist/NotificationList-BFTZrMUI.mjs +3878 -0
- package/dist/SchoolList-CClJ_UPT.js +1 -0
- package/dist/SchoolList-JmrmL2zE.mjs +5 -0
- package/dist/SkillList-B8uw4QZF.mjs +386 -0
- package/dist/SkillList-D_tQAQqL.js +1 -0
- package/dist/TeacherSelector-BKSay316.mjs +30 -0
- package/dist/TeacherSelector-DXv_vBJI.js +1 -0
- package/dist/TheContent-CDVWxnOm.js +1 -0
- package/dist/TheContent-mTUR10lr.mjs +28 -0
- package/dist/UserContainer-CilrSMeD.mjs +2771 -0
- package/dist/UserContainer-DuoEITq2.js +5 -0
- package/dist/UserDetail-GaRReB9G.mjs +902 -0
- package/dist/UserDetail-qXX-264Q.js +1 -0
- package/dist/UserList-7gE8aU_I.js +5 -0
- package/dist/UserList-B7sk8bc6.mjs +1162 -0
- package/dist/assets/Images.d.ts +14 -14
- package/dist/components/Alerts/CommonAlert.d.ts +3 -3
- package/dist/components/Alerts/EmptyDataAlert.d.ts +8 -8
- package/dist/components/Alerts/ErrorHandler.d.ts +6 -6
- package/dist/components/Alerts/SandboxAlert.d.ts +3 -0
- package/dist/components/Buttons/AddButton.d.ts +7 -7
- package/dist/components/Buttons/AddButtonIcon.d.ts +6 -6
- package/dist/components/Buttons/CloseButton.d.ts +8 -8
- package/dist/components/Buttons/DeleteButtonIcon.d.ts +7 -6
- package/dist/components/Buttons/DetailActionButtons.d.ts +8 -8
- package/dist/components/Buttons/EditButtonIcon.d.ts +7 -6
- package/dist/components/Buttons/LinkEditButton.d.ts +7 -7
- package/dist/components/Buttons/LoginNavButton.d.ts +8 -8
- package/dist/components/Buttons/SyncButton.d.ts +8 -0
- package/dist/components/Buttons/ToggleButton.d.ts +10 -10
- package/dist/components/Buttons/UploadFileButton.d.ts +13 -13
- package/dist/components/Headers/CommonHeader.d.ts +7 -7
- package/dist/components/Image/UploadImage.d.ts +2 -3
- package/dist/components/Inputs/FileInput.d.ts +8 -8
- package/dist/components/Inputs/PasswordInput.d.ts +9 -8
- package/dist/components/Inputs/SearchBox.d.ts +10 -10
- package/dist/components/Inputs/SearchBoxContainer.d.ts +9 -10
- package/dist/components/Labels/RequiredLabel.d.ts +6 -6
- package/dist/components/Loading/Loading.d.ts +3 -3
- package/dist/components/Modals/CommonModal.d.ts +2 -3
- package/dist/components/Modals/NotificationLogoutModal.d.ts +2 -0
- package/dist/components/Modals/NotificationModal.d.ts +2 -3
- package/dist/components/Others/QuitPrompt.d.ts +5 -2
- package/dist/components/Pagination/CustomPagination.d.ts +2 -3
- package/dist/components/Scroll/ScrollToTop.d.ts +3 -0
- package/dist/components/Selectors/AcademicClassSelector.d.ts +2 -3
- package/dist/components/Selectors/CategorySelector.d.ts +2 -0
- package/dist/components/Selectors/CreatableSelector.d.ts +2 -3
- package/dist/components/Selectors/CustomSelector.d.ts +2 -3
- package/dist/components/Selectors/MailCategorySelectors.d.ts +2 -3
- package/dist/components/Selectors/QuestionCategorySelector.d.ts +2 -3
- package/dist/components/Selectors/QuestionTypeSelector.d.ts +2 -3
- package/dist/components/Selectors/StarRatingSelector.d.ts +2 -3
- package/dist/components/Selectors/SuggestionCategorySelector.d.ts +2 -3
- package/dist/components/Selectors/constants/constant.d.ts +10 -0
- package/dist/components/Selectors/hooks/useCategorySelector.d.ts +5 -0
- package/dist/components/Tabs/CustomTab.d.ts +2 -3
- package/dist/components/Tabs/TabsWithComponent.d.ts +10 -0
- package/dist/configs/editorConfig.d.ts +7 -7
- package/dist/constants-CGewtxeZ.mjs +320 -0
- package/dist/constants-CNvNsffe.js +1 -0
- package/dist/containers/Commons/NotFound.d.ts +3 -3
- package/dist/containers/DistrictSchools/views/SchoolList.d.ts +3 -3
- package/dist/containers/EmailTemplate/components/AttachmentFile.d.ts +7 -7
- package/dist/containers/EmailTemplate/components/MailParam.d.ts +7 -7
- package/dist/containers/EmailTemplate/configs/emailTemplateSchema.d.ts +13 -13
- package/dist/containers/EmailTemplate/hooks/useEmailTemplateDetail.d.ts +28 -28
- package/dist/containers/EmailTemplate/hooks/useEmailTemplateList.d.ts +11 -12
- package/dist/containers/EmailTemplate/views/EmailTemplateDetail.d.ts +3 -3
- package/dist/containers/EmailTemplate/views/EmailTemplateList.d.ts +3 -3
- package/dist/containers/Gallery/components/ActionModal.d.ts +2 -3
- package/dist/containers/Gallery/components/Filter.d.ts +8 -8
- package/dist/containers/Gallery/components/Media.d.ts +7 -8
- package/dist/containers/Gallery/components/MediaDetail.d.ts +6 -7
- package/dist/containers/Gallery/components/MediaList.d.ts +7 -7
- package/dist/containers/Gallery/components/MediaNav.d.ts +17 -18
- package/dist/containers/Gallery/constants/gallery.types.d.ts +21 -20
- package/dist/containers/Gallery/extensions/helpers.d.ts +4 -4
- package/dist/containers/Gallery/hooks/useGalleryList.d.ts +30 -31
- package/dist/containers/Gallery/views/GalleryList.d.ts +6 -6
- package/dist/containers/Login/constant/authConfig.d.ts +38 -0
- package/dist/containers/Login/constant/types.d.ts +34 -0
- package/dist/containers/Login/hooks/useCreatePassword.d.ts +12 -0
- package/dist/containers/Login/hooks/useForgotPassword.d.ts +22 -21
- package/dist/containers/Login/hooks/useLogin.d.ts +29 -16
- package/dist/containers/Login/hooks/useLoginTwoFactor.d.ts +4 -4
- package/dist/containers/Login/views/Dashboard.d.ts +3 -3
- package/dist/containers/Login/views/Login.d.ts +9 -9
- package/dist/containers/Login/views/block/BlockBackground.d.ts +7 -0
- package/dist/containers/Login/views/block/BlockCreatePassword.d.ts +2 -0
- package/dist/containers/Login/views/block/BlockForgetPassword.d.ts +6 -3
- package/dist/containers/Login/views/block/BlockLogin.d.ts +21 -7
- package/dist/containers/Login/views/block/BlockResetPassword.d.ts +2 -3
- package/dist/containers/Login/views/block/BlockSelectTeacher.d.ts +10 -0
- package/dist/containers/Login/views/block/BlockTwoFactorLogin.d.ts +2 -3
- package/dist/containers/Login/views/block/CloseBlock.d.ts +6 -6
- package/dist/containers/Login/views/block/ContentHomePage.d.ts +5 -5
- package/dist/containers/Login/views/block/IconContent.d.ts +7 -7
- package/dist/containers/Login/views/block/QuoteContent.d.ts +2 -7
- package/dist/containers/Notifications/components/NotificationButton.d.ts +5 -5
- package/dist/containers/Notifications/components/NotificationStatusSelector.d.ts +6 -7
- package/dist/containers/Notifications/hooks/useNotificationList.d.ts +17 -14
- package/dist/containers/Notifications/hooks/useUnreadNotification.d.ts +4 -4
- package/dist/containers/Notifications/views/NotificationList.d.ts +2 -3
- package/dist/containers/Skill/components/SkillDetailModal.d.ts +2 -3
- package/dist/containers/Skill/components/SkillSelector.d.ts +2 -3
- package/dist/containers/Skill/hooks/useSkillDetail.d.ts +19 -20
- package/dist/containers/Skill/hooks/useSkillList.d.ts +9 -10
- package/dist/containers/Skill/views/SkillList.d.ts +3 -3
- package/dist/containers/User/components/AssignStudentModal.d.ts +20 -0
- package/dist/containers/User/components/DeleteBulkModel copy.d.ts +4 -0
- package/dist/containers/User/components/DeleteBulkModel.d.ts +3 -0
- package/dist/containers/User/components/FilterPopover.d.ts +21 -0
- package/dist/containers/User/components/HeaderCell.d.ts +19 -0
- package/dist/containers/User/components/RemoveAssistant.d.ts +3 -0
- package/dist/containers/User/components/RemoveCounselor.d.ts +3 -0
- package/dist/containers/User/components/RemoveSupportTeacher.d.ts +3 -0
- package/dist/containers/User/components/RemoveTeacher.d.ts +3 -0
- package/dist/containers/User/components/SwitchDataTeacherModel.d.ts +12 -0
- package/dist/containers/User/components/SwitchTeacherModal.d.ts +2 -0
- package/dist/containers/User/components/TableHeader.d.ts +15 -0
- package/dist/containers/User/components/TeacherSelector.d.ts +2 -0
- package/dist/containers/User/components/UploadCSVButton.d.ts +11 -0
- package/dist/containers/User/components/UserDeletedModal.d.ts +2 -0
- package/dist/containers/User/configs/changePasswordSchema.d.ts +11 -0
- package/dist/containers/User/configs/userSchema.d.ts +13 -15
- package/dist/containers/User/configs/utils.d.ts +8 -0
- package/dist/containers/User/constants/constants.d.ts +63 -0
- package/dist/containers/User/constants/types.d.ts +265 -0
- package/dist/containers/User/hooks/useAssignStudent.d.ts +44 -0
- package/dist/containers/User/hooks/useAssignStudentList.d.ts +36 -0
- package/dist/containers/User/hooks/useAssistantList.d.ts +9 -0
- package/dist/containers/User/hooks/useCSVImport.d.ts +37 -0
- package/dist/containers/User/hooks/useCSVImportTab.d.ts +45 -0
- package/dist/containers/User/hooks/useClickOutside.d.ts +2 -0
- package/dist/containers/User/hooks/useCounselorList.d.ts +9 -0
- package/dist/containers/User/hooks/useExportUsersCsv.d.ts +5 -0
- package/dist/containers/User/hooks/useFilterPopover.d.ts +37 -0
- package/dist/containers/User/hooks/useResendMail.d.ts +5 -0
- package/dist/containers/User/hooks/useRosterUserSelector.d.ts +8 -0
- package/dist/containers/User/hooks/useSecondaryTeacherList.d.ts +9 -0
- package/dist/containers/User/hooks/useTableHeader.d.ts +20 -0
- package/dist/containers/User/hooks/useTeacherList.d.ts +9 -0
- package/dist/containers/User/hooks/useUserDeletedList.d.ts +21 -0
- package/dist/containers/User/hooks/useUserDeletedModal.d.ts +13 -0
- package/dist/containers/User/hooks/useUserDetail.d.ts +41 -22
- package/dist/containers/User/hooks/useUserList.d.ts +18 -11
- package/dist/containers/User/hooks/userFilters.d.ts +7 -0
- package/dist/containers/User/views/AssignStudentList.d.ts +2 -0
- package/dist/containers/User/views/CSVImport.d.ts +3 -0
- package/dist/containers/User/views/RosterUserSelector.d.ts +8 -0
- package/dist/containers/User/views/UserContainer.d.ts +2 -0
- package/dist/containers/User/views/UserDeletedList.d.ts +2 -0
- package/dist/containers/User/views/UserDetail.d.ts +2 -3
- package/dist/containers/User/views/UserList.d.ts +2 -3
- package/dist/hooks/useFilters.d.ts +7 -0
- package/dist/hooks/useLanguages.d.ts +9 -0
- package/dist/i18n.d.ts +2 -0
- package/dist/index-B4U_4-fu.js +15 -0
- package/dist/index-CFvswiRi.mjs +17591 -0
- package/dist/index.css +1037 -296
- package/dist/index.d.ts +114 -101
- package/dist/index.esm-B63qcj54.js +1 -0
- package/dist/index.esm-D6Zacg53.mjs +19 -0
- package/dist/index.js +24 -7493
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +28540 -6956
- package/dist/index.modern.js.map +1 -1
- package/dist/layouts/TheContent.d.ts +2 -3
- package/dist/mailCategoryService-CEgGm2FV.js +1 -0
- package/dist/mailCategoryService-Dis1n9kR.mjs +11 -0
- package/dist/mario-core.css +1 -0
- package/dist/redux/assessments/action.d.ts +1 -1
- package/dist/redux/assessments/reducer.d.ts +10 -5
- package/dist/redux/assignment/action.d.ts +1 -1
- package/dist/redux/assignment/reducer.d.ts +4 -2
- package/dist/redux/assistants/action.d.ts +1 -1
- package/dist/redux/assistants/reducer.d.ts +4 -2
- package/dist/redux/badges/action.d.ts +1 -1
- package/dist/redux/badges/reducer.d.ts +4 -2
- package/dist/redux/bandScores/action.d.ts +1 -1
- package/dist/redux/bandScores/reducer.d.ts +4 -2
- package/dist/redux/certificate/action.d.ts +1 -1
- package/dist/redux/certificate/reducer.d.ts +4 -2
- package/dist/redux/classes/action.d.ts +1 -1
- package/dist/redux/classes/reducer.d.ts +4 -2
- package/dist/redux/commons/action.d.ts +23 -8
- package/dist/redux/commons/reducer.d.ts +4 -2
- package/dist/redux/conferenceRubrics/action.d.ts +1 -1
- package/dist/redux/conferenceRubrics/reducer.d.ts +4 -2
- package/dist/redux/customAlert/action.d.ts +1 -1
- package/dist/redux/customAlert/reducer.d.ts +4 -2
- package/dist/redux/dashboard/action.d.ts +5 -4
- package/dist/redux/dashboard/reducer.d.ts +4 -2
- package/dist/redux/dataPlayer/action.d.ts +2 -2
- package/dist/redux/dataPlayer/reducer.d.ts +4 -2
- package/dist/redux/emailTemplates/action.d.ts +1 -1
- package/dist/redux/emailTemplates/reducer.d.ts +4 -2
- package/dist/redux/faqs/action.d.ts +1 -1
- package/dist/redux/faqs/reducer.d.ts +4 -2
- package/dist/redux/feedback/action.d.ts +1 -1
- package/dist/redux/feedback/reducer.d.ts +4 -2
- package/dist/redux/gallery/action.d.ts +2 -2
- package/dist/redux/gallery/reducer.d.ts +4 -2
- package/dist/redux/goalExamples/action.d.ts +1 -1
- package/dist/redux/goalExamples/reducer.d.ts +4 -2
- package/dist/redux/improveMyClass/action.d.ts +1 -1
- package/dist/redux/improveMyClass/reducer.d.ts +4 -2
- package/dist/redux/learningStrategies/action.d.ts +1 -1
- package/dist/redux/learningStrategies/reducer.d.ts +4 -2
- package/dist/redux/learningSupportCategories/action.d.ts +1 -1
- package/dist/redux/learningSupportCategories/reducer.d.ts +4 -2
- package/dist/redux/mailCategories/action.d.ts +1 -1
- package/dist/redux/mailCategories/reducer.d.ts +4 -2
- package/dist/redux/navMobile/action.d.ts +1 -0
- package/dist/redux/navMobile/reducer.d.ts +4 -0
- package/dist/redux/notifications/action.d.ts +3 -3
- package/dist/redux/notifications/reducer.d.ts +4 -2
- package/dist/redux/questionBanks/action.d.ts +1 -1
- package/dist/redux/questionBanks/reducer.d.ts +4 -2
- package/dist/redux/questionByCategory/action.d.ts +8 -8
- package/dist/redux/questionByCategory/reducer.d.ts +4 -2
- package/dist/redux/questionCategory/action.d.ts +1 -1
- package/dist/redux/questionCategory/reducer.d.ts +4 -2
- package/dist/redux/reflectionForms/action.d.ts +1 -1
- package/dist/redux/reflectionForms/reducer.d.ts +4 -2
- package/dist/redux/reflectionResults/action.d.ts +1 -1
- package/dist/redux/reflectionResults/reducer.d.ts +4 -2
- package/dist/redux/schoolBlankDays/action.d.ts +1 -1
- package/dist/redux/schoolBlankDays/reducer.d.ts +4 -2
- package/dist/redux/semester/action.d.ts +1 -1
- package/dist/redux/semester/reducer.d.ts +4 -2
- package/dist/redux/sessionPlayers/action.d.ts +5 -4
- package/dist/redux/sessionPlayers/reducer.d.ts +4 -2
- package/dist/redux/sessionTemplateGeneralClasses/action.d.ts +1 -1
- package/dist/redux/sessionTemplateGeneralClasses/reducer.d.ts +4 -2
- package/dist/redux/sessionTemplates/action.d.ts +1 -1
- package/dist/redux/sessionTemplates/reducer.d.ts +4 -2
- package/dist/redux/skills/action.d.ts +1 -1
- package/dist/redux/skills/reducer.d.ts +4 -2
- package/dist/redux/subjects/action.d.ts +1 -1
- package/dist/redux/subjects/reducer.d.ts +4 -2
- package/dist/redux/suggestionBanks/action.d.ts +1 -1
- package/dist/redux/suggestionBanks/reducer.d.ts +4 -2
- package/dist/redux/teacher/myStudent/action.d.ts +1 -1
- package/dist/redux/teacher/myStudent/reducer.d.ts +4 -2
- package/dist/redux/tutorialScreen/action.d.ts +1 -1
- package/dist/redux/tutorialScreen/reducer.d.ts +10 -5
- package/dist/redux/users/action.d.ts +2 -2
- package/dist/redux/users/reducer.d.ts +4 -2
- package/dist/redux/weeklyQuests/action.d.ts +2 -0
- package/dist/redux/weeklyQuests/reducer.d.ts +12 -0
- package/dist/redux/widget/action.d.ts +1 -1
- package/dist/redux/widget/reducer.d.ts +4 -2
- package/dist/rootReducer.d.ts +106 -48
- package/dist/services/accountService.d.ts +22 -8
- package/dist/services/api.d.ts +3 -3
- package/dist/services/classService.d.ts +1 -1
- package/dist/services/csvImportService.d.ts +9 -0
- package/dist/services/csvService.d.ts +8 -0
- package/dist/services/emailTemplateService.d.ts +7 -6
- package/dist/services/fileServices.d.ts +13 -13
- package/dist/services/galleryService.d.ts +2 -2
- package/dist/services/mailCategoryService.d.ts +1 -1
- package/dist/services/notificationService.d.ts +7 -6
- package/dist/services/questionCategoryService.d.ts +3 -1
- package/dist/services/schoolService.d.ts +2 -0
- package/dist/services/skillService.d.ts +6 -6
- package/dist/services/suggestionCategoryService.d.ts +1 -1
- package/dist/services/userService.d.ts +37 -7
- package/dist/store.d.ts +3 -3
- package/dist/types/Conversation.d.ts +8 -8
- package/dist/types/ConversationMember.d.ts +5 -5
- package/dist/types/Dashboard.d.ts +5 -5
- package/dist/types/Filter.d.ts +16 -10
- package/dist/types/Language.d.ts +8 -0
- package/dist/types/Message.d.ts +13 -13
- package/dist/types/Notification.d.ts +8 -8
- package/dist/types/Payload.d.ts +17 -0
- package/dist/types/user.d.ts +3 -0
- package/dist/types-BvnbDeJF.mjs +5 -0
- package/dist/types-CTFcZUFS.js +1 -0
- package/dist/utils/canAccessRoute.d.ts +2 -2
- package/dist/utils/constants.d.ts +87 -57
- package/dist/utils/debounce.d.ts +2 -2
- package/dist/utils/domHelpers.d.ts +2 -2
- package/dist/utils/encodeParams.d.ts +2 -2
- package/dist/utils/firstCheckToken.d.ts +2 -2
- package/dist/utils/generateRandomString.d.ts +2 -2
- package/dist/utils/getAccessToken.d.ts +2 -2
- package/dist/utils/getCookieValue.d.ts +2 -0
- package/dist/utils/getFileUrl.d.ts +2 -2
- package/dist/utils/getStaticFileUrl.d.ts +2 -0
- package/dist/utils/getTextFromHTML.d.ts +2 -2
- package/dist/utils/utcToLocalTime.d.ts +1 -2
- package/package.json +79 -63
- package/dist/components/Alerts/ReactNotification.d.ts +0 -4
- package/dist/containers/Faq/components/FaqDetailModal.d.ts +0 -3
- package/dist/containers/Faq/hooks/useFaqDetail.d.ts +0 -18
- package/dist/containers/Faq/hooks/useFaqList.d.ts +0 -10
- package/dist/containers/Faq/views/FaqList.d.ts +0 -3
- package/dist/layouts/TheFooter.d.ts +0 -3
- package/dist/layouts/TheHeader.d.ts +0 -3
- package/dist/layouts/TheHeaderDropdown.d.ts +0 -3
- package/dist/layouts/TheLayout.d.ts +0 -3
- package/dist/layouts/TheSidebar.d.ts +0 -3
- package/dist/services/faqService.d.ts +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),u=require("reactstrap"),F=require("react-router-dom"),e=require("./index-B4U_4-fu.js"),q=require("react-redux"),J=require("formik"),we=require("yup"),H=require("react-google-recaptcha-v3"),ie=require("@react-oauth/google"),M=require("./types-CTFcZUFS.js"),K=require("@azure/msal-browser"),ye=require("@amplitude/analytics-browser");function ce(o){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const l in o)if(l!=="default"){const r=Object.getOwnPropertyDescriptor(o,l);Object.defineProperty(n,l,r.get?r:{enumerable:!0,get:()=>o[l]})}}return n.default=o,Object.freeze(n)}const v=ce(we),B=ce(ye),Se={height:"40px",backgroundColor:"#f7f9fc",borderRadius:"4px",marginBottom:"5px",position:"relative"},xe={backgroundColor:"#ffffff",paddingRight:"50px"},Ne={fontSize:"20px",position:"absolute",right:"10px",color:"#316CD9"},je=o=>o.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(n,l)=>l.toUpperCase()),z=({isShowPassword:o,togglePasswordVisible:n,onChange:l,placeholder:r})=>s.jsxs("div",{className:"d-flex align-items-center w-100",style:Se,children:[s.jsx(u.Input,{className:"border password-input",style:xe,type:o?"text":"password",name:"password",onChange:l,placeholder:r||"Password",autocomplete:r?je(r):"password",required:!0}),s.jsx("i",{className:`far ${o?"fa-eye-slash":"fa-eye"} mx-2 cursor-pointer`,style:Ne,onClick:()=>n(),title:o?"Hide":"Show"})]}),Ee=v.object({email:v.string().email("Email is invalid").required("Email is required"),password:v.string().required("Password is required"),rememberMe:v.boolean()}),Ie=({onSuccess:o,onError:n})=>{const l=ie.useGoogleLogin({onSuccess:async r=>{try{const i=await fetch("https://www.googleapis.com/oauth2/v3/userinfo",{headers:{Authorization:`Bearer ${r.access_token}`}}).then(p=>p.json()),h={accessToken:r.access_token,googleId:i.sub,profileObj:{email:i.email,familyName:i.family_name,givenName:i.given_name,imageUrl:i.picture,name:i.name}};o(h)}catch(i){n(i)}},onError:r=>n(r)});return s.jsxs("div",{className:e.styles["btn-login-with-sso"],onClick:()=>l(),children:[s.jsxs("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",width:"24px",height:"24px",style:{marginRight:"8px"},children:[s.jsx("path",{fill:"#EA4335",d:"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"}),s.jsx("path",{fill:"#4285F4",d:"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"}),s.jsx("path",{fill:"#FBBC05",d:"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"}),s.jsx("path",{fill:"#34A853",d:"M24 48c6.48 0 12.38-2.12 16.66-5.73l-7.73-6c-2.15 1.45-4.92 2.3-8.93 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"}),s.jsx("path",{fill:"none",d:"M0 0h48v48H0z"})]}),s.jsx("p",{children:"GOOGLE"})]})},be=({defaultInfo:o,userLogin:n,school:l,isShowPassword:r,setIsShowPassword:i,fnIsCheckLogin:h,googleClientId:p,fnLoginSSO:w,extensionEmail:E,onLoginWidthClever:y})=>{const x=()=>i(!r),c=q.useDispatch(),{executeRecaptcha:f}=H.useGoogleReCaptcha(),C=a.useCallback(async()=>{if(!f){console.log("execute recaptcha undefined");return}return await f("login")},[f]),T=a.useCallback(()=>{},[]),P=async d=>{try{await e.AccountSSOLogApi(d)}catch(S){console.error(S)}},I=async d=>{if(d?.accessToken){let{email:S,familyName:L,givenName:A,imageUrl:$,name:k}=d.profileObj,N=d.accessToken,R=d.googleId;const D=window.location.hostname.split(".marioforme.com")?.[0],G=S.split("@")?.[1],Z=E?.split(",")?.map(U=>U.trim())?.filter(U=>U).some(U=>G.includes(U));if(!G.includes(D)&&!Z){alert("The email address you used does not match the login information in the database. Please check that you are using your school assigned email address to log into MARIO for Me. If you have further trouble please notify your school site administrator"),await P([`${G} is incorrect`]);return}const O={firstName:A,lastName:L,imageUrl:$,fullName:k,email:S,accessToken:N,googleId:R};c(e.setInforUserGoogle(O)),h(M.TypeLogin.Google,O,N,C)}};return s.jsx(a.Fragment,{children:s.jsx(J.Formik,{initialValues:o,validationSchema:Ee,onSubmit:async d=>{try{const S=await C();if(!S)return;d.captcha=S,d.loginType=M.LoginType.Default,n(d)}catch(S){console.error(S)}},children:d=>{const{handleChange:S,handleBlur:L,handleSubmit:A,values:$,touched:k,errors:N,setFieldValue:R}=d,W=k.email&&N.email,D=k.password&&N.password;return s.jsx("div",{className:`${e.styles["box-login"]} w-100`,children:s.jsx(u.Form,{className:`${e.styles["block-login"]}`,onSubmit:A,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsxs("div",{className:"d-flex align-items-center mb-4",children:[s.jsx("img",{hidden:!l?.schoolLogo,src:l?.schoolLogo,className:`${e.styles["school-icon"]} mr-3`}),s.jsx("p",{className:`${e.styles["school-name"]} mb-0`,children:l.schoolName})]}),s.jsx("p",{className:`${e.styles["title-login"]}`,children:"Welcome Back!"}),s.jsx("p",{className:`${e.styles["login-description"]} mb-5`,children:"Please enter your MARIO Education account details"}),s.jsxs(u.FormGroup,{className:`${e.styles["form-user-name"]}`,children:[s.jsx(u.Input,{type:"text",name:"email",placeholder:"Email",value:$.email,onChange:S,autocomplete:"email",onBlur:L("email"),required:!0}),W&&s.jsx(e.ErrorHandler,{text:N.email})]}),s.jsxs(u.FormGroup,{children:[s.jsx(z,{isShowPassword:r,togglePasswordVisible:x,onChange:G=>R("password",G.target.value)}),D&&s.jsx(e.ErrorHandler,{text:N.password})]}),s.jsx(u.FormGroup,{children:s.jsx(H.GoogleReCaptcha,{action:"login",onVerify:T})}),s.jsxs("div",{className:"d-flex justify-content-between",children:[s.jsxs("div",{className:"d-flex align-items-center",style:{gap:"8px"},children:[s.jsx("input",{type:"checkbox",checked:!$.isSessionUserBrowser,className:`${e.styles["checkbox-keep-login"]}`,onChange:()=>R("isSessionUserBrowser",!$.isSessionUserBrowser)}),s.jsx("p",{className:`${e.styles["label-keep-login"]} mb-0 ml-2`,children:"Keep me logged in"})]}),s.jsx(F.Link,{to:"/forgot-password",className:`${e.styles["link-to-login"]}`,children:"Forgot password?"})]}),s.jsx("button",{className:`${e.styles["btn-login"]} mt-5`,type:"submit",children:"LOG IN"}),s.jsx("p",{className:`${e.styles["option-text"]} my-3 text-center`,children:"OR"}),s.jsxs(u.Row,{className:"mb-4",children:[s.jsx(u.Col,{lg:6,md:6,xs:12,className:"pr-md-3",children:!!p&&s.jsx(ie.GoogleOAuthProvider,{clientId:p,children:s.jsx(Ie,{onSuccess:I,onError:()=>console.log("Google login failed")})})}),s.jsx(u.Col,{lg:6,md:6,xs:12,className:`${e.styles["btn-login-sso"]} pl-md-2`,hidden:!l?.schoolId,children:s.jsxs("div",{className:e.styles["btn-login-with-sso"],onClick:()=>w(C),children:[s.jsx("img",{src:"images/microsoft-logo.png"}),s.jsx("p",{children:"MICROSOFT"})]})})]}),s.jsx("div",{className:`${e.styles["btn-login-sso"]}`,children:s.jsxs("div",{className:e.styles["btn-login-with-sso"],onClick:()=>window.open("https://launchpad.classlink.com/login"),children:[s.jsx("img",{src:"images/class-link-icon.png"}),s.jsx("p",{children:"SIGN IN WITH CLASSLINK"})]})}),s.jsx("div",{className:`${e.styles["btn-login-sso"]} mt-4`,children:s.jsxs("div",{className:e.styles["btn-login-with-sso"],onClick:()=>y(),children:[s.jsx("img",{src:"images/clever-icon.png"}),s.jsx("p",{children:"SIGN IN WITH CLEVER"})]})})]})})})}})})},Ce={email:"",captcha:""},ke="/",ae="/login",Le="Log in",de=()=>{const o=new URLSearchParams(F.useLocation().search),n=o.get("token"),l=o.get("key")??"",r=q.useDispatch(),i=F.useNavigate(),[h,p]=a.useState(!1),w=a.useCallback(()=>{p(!h)},[h]),[E,y]=a.useState(!1),[x,c]=a.useState(!1),[f,C]=a.useState({token:"",password:"",reEnterPassword:"",email:"",userId:""}),[T,P]=a.useState(!0),{executeRecaptcha:I}=H.useGoogleReCaptcha();a.useEffect(()=>{document.title=Le,e.getAccessToken()&&i(ke)},[]);const d=a.useCallback(async k=>{r(e.setLoading(!0));try{await e.forgotPassword(k),i(ae),r(e.setAlert({type:"success",message:"A mail to reset password was sent"}))}catch(N){r(e.setAlert({type:"danger",message:N.response?.data?.title||N.message||"Error occured"})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN)}r(e.setLoading(!1))},[]),S=a.useCallback(async(k,N)=>{r(e.setLoading(!0));try{const R=await e.checkResetToken(k,N);R.data?C({...f,token:k,email:R.data}):P(!1)}catch{P(!1)}r(e.setLoading(!1))},[]),L=a.useCallback(async k=>{r(e.setLoading(!0));try{await e.resetPassword({...k,key:l}),i(ae),r(e.setAlert({type:"success",message:"Reset password sucessfully"}))}catch(N){r(e.setAlert({type:"danger",message:N.response?.data?.title||N.message||"Error occured"})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN)}r(e.setLoading(!1))},[]),A=a.useCallback(async()=>{if(!I){console.log("execute recaptcha undefined");return}return await I("forgetPass")},[I]),$=a.useCallback(()=>{},[]);return a.useEffect(()=>{S(n,l)},[]),{defaultInfo:Ce,forgotPasswordRequest:d,checkResetTokenRequest:S,validLink:T,resetPasswordRequest:L,openLogin:h,toggle:w,isShowNewPassword:E,setIsShowNewPassword:y,isShowReTypePassword:x,setIsShowReTypePassword:c,clickHandler:A,handleVerify:$,initialValues:f}},ve={email:"",captcha:""},Pe=v.object({email:v.string().email("Email is invalid").required("Email is required")}),Te=({school:o})=>{const{forgotPasswordRequest:n,clickHandler:l,handleVerify:r}=de();return s.jsx(J.Formik,{initialValues:ve,enableReinitialize:!0,validationSchema:Pe,onSubmit:async i=>{const h=await l();h&&(i.captcha=h,n(i))},children:i=>{const{handleChange:h,handleSubmit:p,values:w,touched:E,errors:y}=i;return s.jsx("div",{className:`${e.styles["box-login"]}`,children:s.jsx("div",{className:`${e.styles["block-login"]}`,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsxs("div",{className:"d-flex align-items-center mb-4",children:[s.jsx("img",{src:o.schoolLogo,className:`${e.styles["school-icon"]} mr-3`}),s.jsx("p",{className:`${e.styles["school-name"]} mb-0`,children:o.schoolName})]}),s.jsx("p",{className:`${e.styles["title-login"]} `,children:"Forgot password"}),s.jsx("p",{className:`${e.styles["recover-account"]} mb-5`,children:"Enter email to recover your account"}),s.jsxs("div",{className:"w-100",children:[s.jsx(u.Input,{type:"text",name:"email",id:"email",placeholder:"Input email",onChange:h,value:w.email}),E.email&&y.email&&s.jsx(e.ErrorHandler,{text:y.email})]}),s.jsx(F.Link,{to:"/login",className:`${e.styles["link-to-login"]} mt-2`,children:"Return to login"}),s.jsx(H.GoogleReCaptcha,{action:"forgetPass",onVerify:r}),s.jsx(u.Col,{className:"p-0",children:s.jsx("button",{className:`${e.styles["btn-login"]} mt-5`,onClick:()=>p(),children:"Continue"})})]})})})}})},Re=v.object({password:v.string().required("New password is required"),reEnterPassword:v.string().required("Please re-enter new password").test("matching","Passwords do not match",function(){return this.parent.password===this.parent.reEnterPassword})}),Ae=()=>{const{validLink:o,resetPasswordRequest:n,isShowNewPassword:l,setIsShowNewPassword:r,isShowReTypePassword:i,setIsShowReTypePassword:h,initialValues:p}=de();return s.jsx(J.Formik,{initialValues:p,enableReinitialize:!0,validationSchema:Re,onSubmit:w=>{n(w)},children:w=>{const{setFieldValue:E,handleSubmit:y,touched:x,errors:c,values:f}=w;return s.jsx(u.Row,{className:`${e.styles["box-login"]}`,children:s.jsx(u.Col,{className:"p-0",children:s.jsx("div",{className:`${e.styles["block-login"]}`,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsx("img",{src:`${e.getStaticFileUrl("/images/horizontal-logo-blue.svg")}`,className:`${e.styles["img-login-rectangle"]}`}),s.jsx("p",{className:`${e.styles["title-login"]}`,children:"Reset Password"}),s.jsx("div",{className:"w-100",children:o?s.jsxs(a.Fragment,{children:[s.jsx(u.FormGroup,{className:`${e.styles["form-user-name"]}`,children:s.jsx(u.Input,{disabled:!0,type:"text",name:"email",placeholder:"Email",value:f.email,autocomplete:"email",required:!0,className:`${e.styles.input}`})}),s.jsxs("div",{className:`${e.styles["form-user-name"]}`,children:[s.jsx(z,{isShowPassword:l,togglePasswordVisible:()=>r(!l),onChange:C=>E("password",C.target.value)}),x.password&&c.password&&s.jsx(e.ErrorHandler,{text:c.password})]}),s.jsxs("div",{className:`${e.styles["form-user-name"]}`,children:[s.jsx(z,{placeholder:"Confirm Password",isShowPassword:i,togglePasswordVisible:()=>h(!i),onChange:C=>E("reEnterPassword",C.target.value)}),x.reEnterPassword&&c.reEnterPassword&&s.jsx(e.ErrorHandler,{text:c.reEnterPassword})]})]}):s.jsxs(a.Fragment,{children:[s.jsx("p",{className:`${e.styles["recover-account"]} mb-5`,children:"Invalid reset password link"}),s.jsx("p",{className:"w-100",children:"It may have been accessed before or expired or you have just tried to reset another account's password"})]})}),o&&s.jsx(u.Col,{className:"p-0",children:s.jsx("button",{className:`${e.styles["btn-login"]} ${e.styles["btn-rounder"]} mt-4`,onClick:()=>y(),children:"SET A NEW PASSWORD"})})]})})})})}})},me=`${e.BASE_URL}/api/school`,$e=()=>e.api.get(`${me}/settings`),Oe=()=>e.api.get(`${me}/info`),_e={auth:{clientId:e.isLocalhost?"a27f8ac9-e039-4bbd-a9e1-3096e52a77bb":"90c6897c-f17b-475e-a7a8-9a19651e0060",authority:"https://login.microsoftonline.com/common",redirectUri:"https://sso.marioforme.com/microsoft-login.html"},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:(o,n,l)=>{if(!l)switch(o){case K.LogLevel.Error:console.error(n);return;case K.LogLevel.Info:console.info(n);return;case K.LogLevel.Verbose:console.debug(n);return;case K.LogLevel.Warning:console.warn(n);return;default:return}}}}},Ge={email:"",password:"",captcha:"",rememberMe:!1,isSessionUserBrowser:!!sessionStorage.getItem(e.IS_USER_SESSION_BROWSER)},Ue="/home",ne="/home",Me="/admin/home",qe="/parent",Fe="/admin/schools",He="/list-student",De="Log in",Ve=()=>{const o=q.useDispatch(),n=F.useNavigate(),[l,r]=a.useState(!1),i=q.useSelector(t=>t.common.isLoginGoogle),[h,p]=a.useState(""),[w,E]=a.useState(""),[y,x]=a.useState(""),c=q.useSelector(t=>t.common.inforUserGoogle),f=new URLSearchParams(location.search),C=f.get("type")==="classlink",T=f.get("token"),P=f.get("isAdminUser"),[I]=a.useState(!1),[d,S]=a.useState({schoolName:"",schoolLogo:"",schoolId:0}),[L,A]=a.useState(null),$=a.useCallback(()=>{r(!l)},[l]),[k,N]=a.useState(!1);a.useEffect(()=>{document.title=De;const t=e.getCookieValue("auth-token");if(t){const g=window.location.hostname;if(localStorage.setItem(e.ACCESS_TOKEN,t),document.cookie=`auth-token=;domain=${g.includes("localhost")?g:".marioforme.com"}; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,document.cookie="redirect-uri=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/",P)return n("/admin/home")}e.getAccessToken()&&n("/"),U()},[P]);const R=()=>{localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN),localStorage.removeItem("USER_EMAIL")};a.useEffect(()=>{C&&T!=""&&D()},[]);const W=()=>{if(e.isLocalhost){const t="https://clever.com/oauth/instant-login?client_id=c3da6c669d239c70d48e&district_id=66132a6f222bda41cc8abe5d";window.location.href=t}else{const t=`https://clever.com/oauth/authorize?response_type=code&redirect_uri=${encodeURIComponent("https://classlink.marioforme.com/api/clever/clever-login")}&client_id=c3da6c669d239c70d48e`;window.location.href=t}},D=async()=>{o(e.setLoading(!0));try{const t={tokenClassLink:T},m=await e.apiInforUserClassLink(t),{email:g,token:j}=m.data;await O({email:g,rememberMe:!1,password:"default",accessToken:j})}catch(t){o(e.setAlert({type:"danger",message:t.response?.data?.title||t.message}))}o(e.setLoading(!1))},G=window.location.host.includes("-district"),Z=a.useCallback(async()=>{o(e.setLoading(!0));try{const t=await Oe(),m=t.data.schoolLogo??"";t.data&&S({schoolName:t.data.schoolName,schoolLogo:m?e.getFileUrl(m):e.getStaticFileUrl("/images/logo_header_blue.png"),schoolId:t.data.schoolId})}catch(t){o(e.setAlert({type:"danger",message:t.response?.data?.title||t.message}))}o(e.setLoading(!1))},[]),O=a.useCallback(async t=>{o(e.setLoading(!0));try{const m=t?.isSessionUserBrowser??!1,g=await e.logIn({...t,email:t?.email?.trim(),password:t?.password?.trim()}),{token:j,id:_,firstName:Y,lastName:V,roles:b,email:Q,profileImageFileName:pe,isLoginFirst:fe}=g.data;if(m?(sessionStorage.setItem(e.ACCESS_TOKEN,j),sessionStorage.setItem(e.IS_USER_SESSION_BROWSER,m)):(sessionStorage.removeItem(e.IS_USER_SESSION_BROWSER),localStorage.setItem(e.ACCESS_TOKEN,j)),localStorage.removeItem(e.NOTIFICATION_ALERT_KEY),o(e.setUser({id:_,firstName:Y,lastName:V,roles:b,email:Q,profileImageFileName:pe})),!localStorage.getItem("ROLES")&&b.includes("Admin")&&localStorage.setItem("ROLES","Admin"),t?.email&&!b.includes("Admin")){B.init(e.isLocalhost?e.INIT_AMPLITUDE_KEY_STAGE:e.INIT_AMPLITUDE_KEY_PROD,t.email,{defaultTracking:!1});const X=window.location.hostname,oe=new B.Identify;oe.set("domain",X),B.identify(oe),B.track("general: session start",{user_id:t.email,domain:X,roles:t?.roles?.toString()}),localStorage.setItem("USER_EMAIL",t.email),fe&&B.track("general: first login",{user_id:t.email,domain:X,roles:t?.roles?.toString()})}G?n(Fe):b.includes("Admin")?n(Me):b.includes("Teacher")||b.includes("Assistant")||b.includes("Counselor")||b.includes("SecondaryTeacher")?n(Ue):b.includes("Student")?n(ne):b.includes("Parent")?n(qe):b.includes("EduTeacher")&&n(He)}catch(m){o(e.setAlert({type:"danger",message:m.response?.data?.title||m.message||"Login failed"})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN)}o(e.setLoading(!1))},[]),U=async()=>{try{const t=await e.getGoogleClientId();p(t.data.googleClientId),E(t.data.googleCaptchaId),x(t.data.extensionEmail)}catch(t){o(e.setAlert({type:"danger",message:t.response?.data?.title||t.message||"Login failed"}))}},ee=a.useCallback(async(t,m,g,j)=>{o(e.setLoading(!0));try{if((await e.checkUserGoogle(t,m)).data){const V={email:m.email,isLoginGoogle:!0,rememberMe:!1,password:"default",accessToken:g,captcha:"",loginType:M.LoginType.Google};if(j!=null){const b=await j();V.captcha=b}await O(V),o(e.setIsLoginGoogle(!1))}else if((await e.registerUserStudent(m))?.data){const b={email:m.email,isLoginGoogle:!0,rememberMe:!1,password:"default",accessToken:g,captcha:"",loginType:M.LoginType.Google};if(j!=null){const Q=await j();b.captcha=Q}await O(b)}}catch(_){o(e.setAlert({type:"danger",message:_.response?.data?.title||_.message||"Login failed"}))}o(e.setLoading(!1))},[]),ge=async(t,m)=>{o(e.setLoading(!0));try{const g={firstName:c.firstName,lastName:c.lastName,imageUrl:c.imageUrl,fullName:c.fullName,email:c.email,accessToken:c.accessToken,teacherId:t};if((await e.registerUserStudent(g)).data){const _=await m(),Y={email:c.email,captcha:_,isLoginGoogle:!0,rememberMe:!1,password:"default",accessToken:c.accessToken,loginType:M.LoginType.Google};o(e.setIsLoginGoogle(!1)),await O(Y),n(ne)}}catch(g){o(e.setAlert({type:"danger",message:g.response?.data?.title||g.message||"Login failed"}))}o(e.setIsLoginGoogle(!1)),o(e.setLoading(!1))},ue=async()=>{try{const t=await $e();o(e.setSandboxMode(t.data.isSandboxMode))}catch(t){console.error(t)}},se=async t=>{L.handleRedirectPromise().then(async m=>{if(d?.schoolId)if(m){let g=m.account;await te(g,t)}else{const g=L.getAllAccounts();if(g.length===0){const j=e.isLocalhost?"https://brightsoft.marioforme.com":"https://sso.marioforme.com";window.location.href=(window.location.hostname==="localhost"?"https://localhost:3000":j)+`/microsoft-login.html?redirect-uri=${window.location.href}&schoolId=${d.schoolId}`}else{let j=g[0];await te(j,t)}}}).catch(m=>{console.error(m)})},te=async(t,m)=>{let g=t.name,j={firstName:g.split(" ").slice(0,-1).join(" "),lastName:g.split(" ").slice(-1).join(" "),fullName:g,imageUrl:"",email:t.username,accessToken:t.idTokenClaims.aio,googleId:t.tenantId};o(e.setInforUserGoogle(j)),await ee(M.TypeLogin.MicrosoftSSO,j,t.idTokenClaims.aio,m)},he=async()=>{const t=new K.PublicClientApplication(_e);await t.initialize(),A(t)};return a.useEffect(()=>{let t=window.location.href;L&&t.includes("code")&&t.includes("client_info")&&se()},[JSON.stringify(L)]),a.useEffect(()=>{ue(),he(),Z()},[]),{defaultInfo:Ge,userLogin:O,openLogin:l,toggle:$,isShowPassword:k,setIsShowPassword:N,fnIsCheckLogin:ee,isLoginGoogle:i,infoUser:c,submitLogin:ge,googleClientId:h,googleRecaptchaId:w,handleCancelModelAssign:R,openModelAssign:I,fnLoginSSO:se,school:d,extensionEmail:y,handleLoginWidthClever:W}},re="/",Be="/login",le="Log in",Ke=()=>{const o=q.useDispatch(),n=F.useNavigate(),l=location.search,i=new URLSearchParams(l).get("userId"),[h,p]=a.useState(!1),[w,E]=a.useState(!1),[y,x]=a.useState({password:"",reEnterPassword:"",email:"",userId:i??"",token:""}),{executeRecaptcha:c}=H.useGoogleReCaptcha(),f=a.useCallback(async I=>{o(e.setLoading(!0));try{const d=await e.getUserNewPassword(I);x({...y,email:d.data})}catch(d){o(e.setAlert({type:"danger",message:d.message}))}o(e.setLoading(!1))},[]),C=a.useCallback(async I=>{o(e.setLoading(!0));try{await e.createPassword(I),n(Be),o(e.setAlert({type:"success",message:"Create password sucessfully"}))}catch(d){o(e.setAlert({type:"danger",message:d.response?.data?.title||d.message||"Error occured"})),localStorage.removeItem(e.ACCESS_TOKEN),sessionStorage.removeItem(e.ACCESS_TOKEN)}o(e.setLoading(!1))},[]),T=a.useCallback(async()=>{if(!c){console.log("execute recaptcha undefined");return}return await c("forgetPass")},[c]),P=a.useCallback(()=>{},[]);return a.useEffect(()=>{document.title=le,e.getAccessToken()&&n(re),i&&f(i)},[i]),a.useEffect(()=>{document.title=le,e.getAccessToken()&&n(re)},[]),{createPasswordRequest:C,isShowNewPassword:h,setIsShowNewPassword:p,isShowReTypePassword:w,setIsShowReTypePassword:E,clickHandler:T,handleVerify:P,initialValues:y}},ze=v.object({password:v.string().required("Password is required"),reEnterPassword:v.string().required("Please re-enter Password").test("matching","Passwords do not match",function(){return this.parent.password===this.parent.reEnterPassword})}),We=()=>{const{createPasswordRequest:o,isShowNewPassword:n,setIsShowNewPassword:l,isShowReTypePassword:r,setIsShowReTypePassword:i,initialValues:h}=Ke();return s.jsx(J.Formik,{initialValues:h,enableReinitialize:!0,validationSchema:ze,onSubmit:p=>{o(p)},children:p=>{const{setFieldValue:w,handleSubmit:E,touched:y,errors:x,values:c}=p;return s.jsx(u.Row,{className:`${e.styles["box-login"]}`,children:s.jsxs(u.Col,{className:"p-0",children:[s.jsx("div",{hidden:!c.email,className:`${e.styles["block-login"]}`,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsx("img",{src:`${e.getStaticFileUrl("/images/horizontal-logo-blue.svg")}`,className:`${e.styles["img-login-rectangle"]}`}),s.jsx("p",{className:`${e.styles["title-login"]}`,children:"Create Your Password"}),s.jsx("div",{className:"w-100",children:s.jsxs(a.Fragment,{children:[s.jsx(u.FormGroup,{className:`${e.styles["form-user-name"]}`,children:s.jsx(u.Input,{disabled:!0,type:"text",name:"email",placeholder:"Email",value:c.email,autocomplete:"email",required:!0,className:`${e.styles.input}`})}),s.jsxs("div",{className:`${e.styles["form-user-name"]}`,children:[s.jsx(z,{isShowPassword:n,togglePasswordVisible:()=>l(!n),onChange:f=>w("password",f.target.value)}),y.password&&x.password&&s.jsx(e.ErrorHandler,{text:x.password})]}),s.jsxs("div",{className:`${e.styles["form-user-name"]}`,children:[s.jsx(z,{placeholder:"Confirm Password",isShowPassword:r,togglePasswordVisible:()=>i(!r),onChange:f=>w("reEnterPassword",f.target.value)}),y.reEnterPassword&&x.reEnterPassword&&s.jsx(e.ErrorHandler,{text:x.reEnterPassword})]})]})}),s.jsx("button",{className:`${e.styles["btn-login"]} ${e.styles["btn-rounder"]} mt-4`,onClick:()=>E(),children:"CREATE YOUR PASSWORD"})]})}),s.jsx("div",{hidden:!!c.email,className:`${e.styles["block-login"]}`,children:s.jsxs("div",{className:`${e.styles["block-form"]}`,children:[s.jsx("img",{src:`${e.getStaticFileUrl("/images/horizontal-logo-blue.svg")}`,className:`${e.styles["img-login-rectangle"]}`}),s.jsx("p",{className:`${e.styles["title-login"]}`,children:"You cannot regenerate the password"})]})})]})})}})},Ye="Log in",Je="Forgot password",Ze="Reset password",Qe=o=>{const{isLogin:n,isForgotPassword:l,isResetPassword:r,isCreatePassword:i}=o,{defaultInfo:h,userLogin:p,googleRecaptchaId:w,handleCancelModelAssign:E,school:y,openModelAssign:x,setIsShowPassword:c,fnIsCheckLogin:f,isLoginGoogle:C,submitLogin:T,infoUser:P,googleClientId:I,isShowPassword:d,fnLoginSSO:S,extensionEmail:L,handleLoginWidthClever:A}=Ve();return a.useEffect(()=>{n&&(document.title=Ye),l&&(document.title=Je),r&&(document.title=Ze)},[n,l,r]),s.jsx("div",{className:`${e.styles.login} container-fluid font-family-lato`,children:s.jsxs(u.Row,{className:"h-100",children:[s.jsxs(u.Col,{lg:8,md:12,xs:12,className:"d-flex justify-content-center h-100 align-items-center p-3 flex-column",children:[!!w&&s.jsxs(H.GoogleReCaptchaProvider,{useRecaptchaNet:!0,reCaptchaKey:w,scriptProps:{async:!0,defer:!0,appendTo:"body"},children:[n&&s.jsx(be,{userLogin:p,defaultInfo:h,onCancelModelAssign:E,openModelAssign:x,school:y,fnIsCheckLogin:f,googleClientId:I,infoUser:P,isLoginGoogle:C,isShowPassword:d,setIsShowPassword:c,submitLogin:T,fnLoginSSO:S,extensionEmail:L,onLoginWidthClever:A}),l&&s.jsx(Te,{school:y})]}),r&&s.jsx(Ae,{}),i&&s.jsx(We,{}),s.jsx("a",{href:"/privacy-policy/",target:"blank",className:`${e.styles["privacy-policy"]}`,children:"Privacy Policy"})]}),s.jsx(u.Col,{className:"p-3 mh-100 d-flex justify-content-end",lg:4,md:12,xs:12,children:s.jsx("img",{src:`${e.getStaticFileUrl(window.innerWidth>992?"/images/img-login.png":"/images/img-login-tablet.png")}`,className:`${e.styles["img-login"]}`})})]})})};exports.default=Qe;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const yt=require("react/jsx-runtime"),Gt=require("reactstrap"),hi=require("./index.esm-B63qcj54.js"),Mt=require("./index-B4U_4-fu.js"),he=require("react"),_e=require("react-redux"),li=require("react-router-dom"),di=require("react-i18next"),pi=[{value:!0,label:"Read"},{value:!1,label:"Unread"}],xi=({value:St,onChange:se})=>{const kt={menu:at=>({...at,zIndex:10})};return yt.jsx(Mt.CustomSelector,{defaultValue:St,options:pi,onChange:se,styles:kt})},vi=he.memo(xi);function yi(St){return St&&St.__esModule&&Object.prototype.hasOwnProperty.call(St,"default")?St.default:St}var yn={exports:{}};var Un;function gi(){return Un||(Un=1,(function(St,se){(function(at,pt){St.exports=pt()})(window,function(){return(function(kt){var at={};function pt(S){if(at[S])return at[S].exports;var y=at[S]={i:S,l:!1,exports:{}};return kt[S].call(y.exports,y,y.exports,pt),y.l=!0,y.exports}return pt.m=kt,pt.c=at,pt.d=function(S,y,Pt){pt.o(S,y)||Object.defineProperty(S,y,{enumerable:!0,get:Pt})},pt.r=function(S){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(S,"__esModule",{value:!0})},pt.t=function(S,y){if(y&1&&(S=pt(S)),y&8||y&4&&typeof S=="object"&&S&&S.__esModule)return S;var Pt=Object.create(null);if(pt.r(Pt),Object.defineProperty(Pt,"default",{enumerable:!0,value:S}),y&2&&typeof S!="string")for(var tt in S)pt.d(Pt,tt,(function(gt){return S[gt]}).bind(null,tt));return Pt},pt.n=function(S){var y=S&&S.__esModule?function(){return S.default}:function(){return S};return pt.d(y,"a",y),y},pt.o=function(S,y){return Object.prototype.hasOwnProperty.call(S,y)},pt.p="",pt(pt.s=3)})([(function(kt,at,pt){var S=this&&this.__extends||(function(){var z=function(T,A){return z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(G,B){G.__proto__=B}||function(G,B){for(var Ct in B)B.hasOwnProperty(Ct)&&(G[Ct]=B[Ct])},z(T,A)};return function(T,A){z(T,A);function G(){this.constructor=T}T.prototype=A===null?Object.create(A):(G.prototype=A.prototype,new G)}})();Object.defineProperty(at,"__esModule",{value:!0});var y=256,Pt=(function(){function z(T){T===void 0&&(T="="),this._paddingCharacter=T}return z.prototype.encodedLength=function(T){return this._paddingCharacter?(T+2)/3*4|0:(T*8+5)/6|0},z.prototype.encode=function(T){for(var A="",G=0;G<T.length-2;G+=3){var B=T[G]<<16|T[G+1]<<8|T[G+2];A+=this._encodeByte(B>>>18&63),A+=this._encodeByte(B>>>12&63),A+=this._encodeByte(B>>>6&63),A+=this._encodeByte(B>>>0&63)}var Ct=T.length-G;if(Ct>0){var B=T[G]<<16|(Ct===2?T[G+1]<<8:0);A+=this._encodeByte(B>>>18&63),A+=this._encodeByte(B>>>12&63),Ct===2?A+=this._encodeByte(B>>>6&63):A+=this._paddingCharacter||"",A+=this._paddingCharacter||""}return A},z.prototype.maxDecodedLength=function(T){return this._paddingCharacter?T/4*3|0:(T*6+7)/8|0},z.prototype.decodedLength=function(T){return this.maxDecodedLength(T.length-this._getPaddingLength(T))},z.prototype.decode=function(T){if(T.length===0)return new Uint8Array(0);for(var A=this._getPaddingLength(T),G=T.length-A,B=new Uint8Array(this.maxDecodedLength(G)),Ct=0,it=0,Ht=0,Jt=0,qt=0,Bt=0,Ut=0;it<G-4;it+=4)Jt=this._decodeChar(T.charCodeAt(it+0)),qt=this._decodeChar(T.charCodeAt(it+1)),Bt=this._decodeChar(T.charCodeAt(it+2)),Ut=this._decodeChar(T.charCodeAt(it+3)),B[Ct++]=Jt<<2|qt>>>4,B[Ct++]=qt<<4|Bt>>>2,B[Ct++]=Bt<<6|Ut,Ht|=Jt&y,Ht|=qt&y,Ht|=Bt&y,Ht|=Ut&y;if(it<G-1&&(Jt=this._decodeChar(T.charCodeAt(it)),qt=this._decodeChar(T.charCodeAt(it+1)),B[Ct++]=Jt<<2|qt>>>4,Ht|=Jt&y,Ht|=qt&y),it<G-2&&(Bt=this._decodeChar(T.charCodeAt(it+2)),B[Ct++]=qt<<4|Bt>>>2,Ht|=Bt&y),it<G-3&&(Ut=this._decodeChar(T.charCodeAt(it+3)),B[Ct++]=Bt<<6|Ut,Ht|=Ut&y),Ht!==0)throw new Error("Base64Coder: incorrect characters for decoding");return B},z.prototype._encodeByte=function(T){var A=T;return A+=65,A+=25-T>>>8&6,A+=51-T>>>8&-75,A+=61-T>>>8&-15,A+=62-T>>>8&3,String.fromCharCode(A)},z.prototype._decodeChar=function(T){var A=y;return A+=(42-T&T-44)>>>8&-y+T-43+62,A+=(46-T&T-48)>>>8&-y+T-47+63,A+=(47-T&T-58)>>>8&-y+T-48+52,A+=(64-T&T-91)>>>8&-y+T-65+0,A+=(96-T&T-123)>>>8&-y+T-97+26,A},z.prototype._getPaddingLength=function(T){var A=0;if(this._paddingCharacter){for(var G=T.length-1;G>=0&&T[G]===this._paddingCharacter;G--)A++;if(T.length<4||A>2)throw new Error("Base64Coder: incorrect padding")}return A},z})();at.Coder=Pt;var tt=new Pt;function gt(z){return tt.encode(z)}at.encode=gt;function xt(z){return tt.decode(z)}at.decode=xt;var vt=(function(z){S(T,z);function T(){return z!==null&&z.apply(this,arguments)||this}return T.prototype._encodeByte=function(A){var G=A;return G+=65,G+=25-A>>>8&6,G+=51-A>>>8&-75,G+=61-A>>>8&-13,G+=62-A>>>8&49,String.fromCharCode(G)},T.prototype._decodeChar=function(A){var G=y;return G+=(44-A&A-46)>>>8&-y+A-45+62,G+=(94-A&A-96)>>>8&-y+A-95+63,G+=(47-A&A-58)>>>8&-y+A-48+52,G+=(64-A&A-91)>>>8&-y+A-65+0,G+=(96-A&A-123)>>>8&-y+A-97+26,G},T})(Pt);at.URLSafeCoder=vt;var st=new vt;function et(z){return st.encode(z)}at.encodeURLSafe=et;function bt(z){return st.decode(z)}at.decodeURLSafe=bt,at.encodedLength=function(z){return tt.encodedLength(z)},at.maxDecodedLength=function(z){return tt.maxDecodedLength(z)},at.decodedLength=function(z){return tt.decodedLength(z)}}),(function(kt,at,pt){Object.defineProperty(at,"__esModule",{value:!0});var S="utf8: invalid string",y="utf8: invalid source encoding";function Pt(xt){for(var vt=new Uint8Array(tt(xt)),st=0,et=0;et<xt.length;et++){var bt=xt.charCodeAt(et);bt<128?vt[st++]=bt:bt<2048?(vt[st++]=192|bt>>6,vt[st++]=128|bt&63):bt<55296?(vt[st++]=224|bt>>12,vt[st++]=128|bt>>6&63,vt[st++]=128|bt&63):(et++,bt=(bt&1023)<<10,bt|=xt.charCodeAt(et)&1023,bt+=65536,vt[st++]=240|bt>>18,vt[st++]=128|bt>>12&63,vt[st++]=128|bt>>6&63,vt[st++]=128|bt&63)}return vt}at.encode=Pt;function tt(xt){for(var vt=0,st=0;st<xt.length;st++){var et=xt.charCodeAt(st);if(et<128)vt+=1;else if(et<2048)vt+=2;else if(et<55296)vt+=3;else if(et<=57343){if(st>=xt.length-1)throw new Error(S);st++,vt+=4}else throw new Error(S)}return vt}at.encodedLength=tt;function gt(xt){for(var vt=[],st=0;st<xt.length;st++){var et=xt[st];if(et&128){var bt=void 0;if(et<224){if(st>=xt.length)throw new Error(y);var z=xt[++st];if((z&192)!==128)throw new Error(y);et=(et&31)<<6|z&63,bt=128}else if(et<240){if(st>=xt.length-1)throw new Error(y);var z=xt[++st],T=xt[++st];if((z&192)!==128||(T&192)!==128)throw new Error(y);et=(et&15)<<12|(z&63)<<6|T&63,bt=2048}else if(et<248){if(st>=xt.length-2)throw new Error(y);var z=xt[++st],T=xt[++st],A=xt[++st];if((z&192)!==128||(T&192)!==128||(A&192)!==128)throw new Error(y);et=(et&15)<<18|(z&63)<<12|(T&63)<<6|A&63,bt=65536}else throw new Error(y);if(et<bt||et>=55296&&et<=57343)throw new Error(y);if(et>=65536){if(et>1114111)throw new Error(y);et-=65536,vt.push(String.fromCharCode(55296|et>>10)),et=56320|et&1023}}vt.push(String.fromCharCode(et))}return vt.join("")}at.decode=gt}),(function(kt,at,pt){(function(S){var y=function(o){var f,a=new Float64Array(16);if(o)for(f=0;f<o.length;f++)a[f]=o[f];return a},Pt=function(){throw new Error("no PRNG")},tt=new Uint8Array(16),gt=new Uint8Array(32);gt[0]=9;var xt=y(),vt=y([1]),st=y([56129,1]),et=y([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),bt=y([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),z=y([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),T=y([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),A=y([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function G(o,f,a,r){o[f]=a>>24&255,o[f+1]=a>>16&255,o[f+2]=a>>8&255,o[f+3]=a&255,o[f+4]=r>>24&255,o[f+5]=r>>16&255,o[f+6]=r>>8&255,o[f+7]=r&255}function B(o,f,a,r,c){var l,d=0;for(l=0;l<c;l++)d|=o[f+l]^a[r+l];return(1&d-1>>>8)-1}function Ct(o,f,a,r){return B(o,f,a,r,16)}function it(o,f,a,r){return B(o,f,a,r,32)}function Ht(o,f,a,r){for(var c=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,l=a[0]&255|(a[1]&255)<<8|(a[2]&255)<<16|(a[3]&255)<<24,d=a[4]&255|(a[5]&255)<<8|(a[6]&255)<<16|(a[7]&255)<<24,_=a[8]&255|(a[9]&255)<<8|(a[10]&255)<<16|(a[11]&255)<<24,C=a[12]&255|(a[13]&255)<<8|(a[14]&255)<<16|(a[15]&255)<<24,I=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,O=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,lt=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,R=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,Y=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,J=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,K=a[16]&255|(a[17]&255)<<8|(a[18]&255)<<16|(a[19]&255)<<24,H=a[20]&255|(a[21]&255)<<8|(a[22]&255)<<16|(a[23]&255)<<24,X=a[24]&255|(a[25]&255)<<8|(a[26]&255)<<16|(a[27]&255)<<24,$=a[28]&255|(a[29]&255)<<8|(a[30]&255)<<16|(a[31]&255)<<24,W=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,j=c,M=l,k=d,N=_,U=C,E=I,p=O,x=lt,m=R,g=Y,b=J,w=K,D=H,V=X,Q=$,Z=W,h,ot=0;ot<20;ot+=2)h=j+D|0,U^=h<<7|h>>>25,h=U+j|0,m^=h<<9|h>>>23,h=m+U|0,D^=h<<13|h>>>19,h=D+m|0,j^=h<<18|h>>>14,h=E+M|0,g^=h<<7|h>>>25,h=g+E|0,V^=h<<9|h>>>23,h=V+g|0,M^=h<<13|h>>>19,h=M+V|0,E^=h<<18|h>>>14,h=b+p|0,Q^=h<<7|h>>>25,h=Q+b|0,k^=h<<9|h>>>23,h=k+Q|0,p^=h<<13|h>>>19,h=p+k|0,b^=h<<18|h>>>14,h=Z+w|0,N^=h<<7|h>>>25,h=N+Z|0,x^=h<<9|h>>>23,h=x+N|0,w^=h<<13|h>>>19,h=w+x|0,Z^=h<<18|h>>>14,h=j+N|0,M^=h<<7|h>>>25,h=M+j|0,k^=h<<9|h>>>23,h=k+M|0,N^=h<<13|h>>>19,h=N+k|0,j^=h<<18|h>>>14,h=E+U|0,p^=h<<7|h>>>25,h=p+E|0,x^=h<<9|h>>>23,h=x+p|0,U^=h<<13|h>>>19,h=U+x|0,E^=h<<18|h>>>14,h=b+g|0,w^=h<<7|h>>>25,h=w+b|0,m^=h<<9|h>>>23,h=m+w|0,g^=h<<13|h>>>19,h=g+m|0,b^=h<<18|h>>>14,h=Z+Q|0,D^=h<<7|h>>>25,h=D+Z|0,V^=h<<9|h>>>23,h=V+D|0,Q^=h<<13|h>>>19,h=Q+V|0,Z^=h<<18|h>>>14;j=j+c|0,M=M+l|0,k=k+d|0,N=N+_|0,U=U+C|0,E=E+I|0,p=p+O|0,x=x+lt|0,m=m+R|0,g=g+Y|0,b=b+J|0,w=w+K|0,D=D+H|0,V=V+X|0,Q=Q+$|0,Z=Z+W|0,o[0]=j>>>0&255,o[1]=j>>>8&255,o[2]=j>>>16&255,o[3]=j>>>24&255,o[4]=M>>>0&255,o[5]=M>>>8&255,o[6]=M>>>16&255,o[7]=M>>>24&255,o[8]=k>>>0&255,o[9]=k>>>8&255,o[10]=k>>>16&255,o[11]=k>>>24&255,o[12]=N>>>0&255,o[13]=N>>>8&255,o[14]=N>>>16&255,o[15]=N>>>24&255,o[16]=U>>>0&255,o[17]=U>>>8&255,o[18]=U>>>16&255,o[19]=U>>>24&255,o[20]=E>>>0&255,o[21]=E>>>8&255,o[22]=E>>>16&255,o[23]=E>>>24&255,o[24]=p>>>0&255,o[25]=p>>>8&255,o[26]=p>>>16&255,o[27]=p>>>24&255,o[28]=x>>>0&255,o[29]=x>>>8&255,o[30]=x>>>16&255,o[31]=x>>>24&255,o[32]=m>>>0&255,o[33]=m>>>8&255,o[34]=m>>>16&255,o[35]=m>>>24&255,o[36]=g>>>0&255,o[37]=g>>>8&255,o[38]=g>>>16&255,o[39]=g>>>24&255,o[40]=b>>>0&255,o[41]=b>>>8&255,o[42]=b>>>16&255,o[43]=b>>>24&255,o[44]=w>>>0&255,o[45]=w>>>8&255,o[46]=w>>>16&255,o[47]=w>>>24&255,o[48]=D>>>0&255,o[49]=D>>>8&255,o[50]=D>>>16&255,o[51]=D>>>24&255,o[52]=V>>>0&255,o[53]=V>>>8&255,o[54]=V>>>16&255,o[55]=V>>>24&255,o[56]=Q>>>0&255,o[57]=Q>>>8&255,o[58]=Q>>>16&255,o[59]=Q>>>24&255,o[60]=Z>>>0&255,o[61]=Z>>>8&255,o[62]=Z>>>16&255,o[63]=Z>>>24&255}function Jt(o,f,a,r){for(var c=r[0]&255|(r[1]&255)<<8|(r[2]&255)<<16|(r[3]&255)<<24,l=a[0]&255|(a[1]&255)<<8|(a[2]&255)<<16|(a[3]&255)<<24,d=a[4]&255|(a[5]&255)<<8|(a[6]&255)<<16|(a[7]&255)<<24,_=a[8]&255|(a[9]&255)<<8|(a[10]&255)<<16|(a[11]&255)<<24,C=a[12]&255|(a[13]&255)<<8|(a[14]&255)<<16|(a[15]&255)<<24,I=r[4]&255|(r[5]&255)<<8|(r[6]&255)<<16|(r[7]&255)<<24,O=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,lt=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,R=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,Y=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,J=r[8]&255|(r[9]&255)<<8|(r[10]&255)<<16|(r[11]&255)<<24,K=a[16]&255|(a[17]&255)<<8|(a[18]&255)<<16|(a[19]&255)<<24,H=a[20]&255|(a[21]&255)<<8|(a[22]&255)<<16|(a[23]&255)<<24,X=a[24]&255|(a[25]&255)<<8|(a[26]&255)<<16|(a[27]&255)<<24,$=a[28]&255|(a[29]&255)<<8|(a[30]&255)<<16|(a[31]&255)<<24,W=r[12]&255|(r[13]&255)<<8|(r[14]&255)<<16|(r[15]&255)<<24,j=c,M=l,k=d,N=_,U=C,E=I,p=O,x=lt,m=R,g=Y,b=J,w=K,D=H,V=X,Q=$,Z=W,h,ot=0;ot<20;ot+=2)h=j+D|0,U^=h<<7|h>>>25,h=U+j|0,m^=h<<9|h>>>23,h=m+U|0,D^=h<<13|h>>>19,h=D+m|0,j^=h<<18|h>>>14,h=E+M|0,g^=h<<7|h>>>25,h=g+E|0,V^=h<<9|h>>>23,h=V+g|0,M^=h<<13|h>>>19,h=M+V|0,E^=h<<18|h>>>14,h=b+p|0,Q^=h<<7|h>>>25,h=Q+b|0,k^=h<<9|h>>>23,h=k+Q|0,p^=h<<13|h>>>19,h=p+k|0,b^=h<<18|h>>>14,h=Z+w|0,N^=h<<7|h>>>25,h=N+Z|0,x^=h<<9|h>>>23,h=x+N|0,w^=h<<13|h>>>19,h=w+x|0,Z^=h<<18|h>>>14,h=j+N|0,M^=h<<7|h>>>25,h=M+j|0,k^=h<<9|h>>>23,h=k+M|0,N^=h<<13|h>>>19,h=N+k|0,j^=h<<18|h>>>14,h=E+U|0,p^=h<<7|h>>>25,h=p+E|0,x^=h<<9|h>>>23,h=x+p|0,U^=h<<13|h>>>19,h=U+x|0,E^=h<<18|h>>>14,h=b+g|0,w^=h<<7|h>>>25,h=w+b|0,m^=h<<9|h>>>23,h=m+w|0,g^=h<<13|h>>>19,h=g+m|0,b^=h<<18|h>>>14,h=Z+Q|0,D^=h<<7|h>>>25,h=D+Z|0,V^=h<<9|h>>>23,h=V+D|0,Q^=h<<13|h>>>19,h=Q+V|0,Z^=h<<18|h>>>14;o[0]=j>>>0&255,o[1]=j>>>8&255,o[2]=j>>>16&255,o[3]=j>>>24&255,o[4]=E>>>0&255,o[5]=E>>>8&255,o[6]=E>>>16&255,o[7]=E>>>24&255,o[8]=b>>>0&255,o[9]=b>>>8&255,o[10]=b>>>16&255,o[11]=b>>>24&255,o[12]=Z>>>0&255,o[13]=Z>>>8&255,o[14]=Z>>>16&255,o[15]=Z>>>24&255,o[16]=p>>>0&255,o[17]=p>>>8&255,o[18]=p>>>16&255,o[19]=p>>>24&255,o[20]=x>>>0&255,o[21]=x>>>8&255,o[22]=x>>>16&255,o[23]=x>>>24&255,o[24]=m>>>0&255,o[25]=m>>>8&255,o[26]=m>>>16&255,o[27]=m>>>24&255,o[28]=g>>>0&255,o[29]=g>>>8&255,o[30]=g>>>16&255,o[31]=g>>>24&255}function qt(o,f,a,r){Ht(o,f,a,r)}function Bt(o,f,a,r){Jt(o,f,a,r)}var Ut=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Xe(o,f,a,r,c,l,d){var _=new Uint8Array(16),C=new Uint8Array(64),I,O;for(O=0;O<16;O++)_[O]=0;for(O=0;O<8;O++)_[O]=l[O];for(;c>=64;){for(qt(C,_,d,Ut),O=0;O<64;O++)o[f+O]=a[r+O]^C[O];for(I=1,O=8;O<16;O++)I=I+(_[O]&255)|0,_[O]=I&255,I>>>=8;c-=64,f+=64,r+=64}if(c>0)for(qt(C,_,d,Ut),O=0;O<c;O++)o[f+O]=a[r+O]^C[O];return 0}function We(o,f,a,r,c){var l=new Uint8Array(16),d=new Uint8Array(64),_,C;for(C=0;C<16;C++)l[C]=0;for(C=0;C<8;C++)l[C]=r[C];for(;a>=64;){for(qt(d,l,c,Ut),C=0;C<64;C++)o[f+C]=d[C];for(_=1,C=8;C<16;C++)_=_+(l[C]&255)|0,l[C]=_&255,_>>>=8;a-=64,f+=64}if(a>0)for(qt(d,l,c,Ut),C=0;C<a;C++)o[f+C]=d[C];return 0}function $e(o,f,a,r,c){var l=new Uint8Array(32);Bt(l,r,c,Ut);for(var d=new Uint8Array(8),_=0;_<8;_++)d[_]=r[_+16];return We(o,f,a,d,l)}function te(o,f,a,r,c,l,d){var _=new Uint8Array(32);Bt(_,l,d,Ut);for(var C=new Uint8Array(8),I=0;I<8;I++)C[I]=l[I+16];return Xe(o,f,a,r,c,C,_)}var ee=function(o){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var f,a,r,c,l,d,_,C;f=o[0]&255|(o[1]&255)<<8,this.r[0]=f&8191,a=o[2]&255|(o[3]&255)<<8,this.r[1]=(f>>>13|a<<3)&8191,r=o[4]&255|(o[5]&255)<<8,this.r[2]=(a>>>10|r<<6)&7939,c=o[6]&255|(o[7]&255)<<8,this.r[3]=(r>>>7|c<<9)&8191,l=o[8]&255|(o[9]&255)<<8,this.r[4]=(c>>>4|l<<12)&255,this.r[5]=l>>>1&8190,d=o[10]&255|(o[11]&255)<<8,this.r[6]=(l>>>14|d<<2)&8191,_=o[12]&255|(o[13]&255)<<8,this.r[7]=(d>>>11|_<<5)&8065,C=o[14]&255|(o[15]&255)<<8,this.r[8]=(_>>>8|C<<8)&8191,this.r[9]=C>>>5&127,this.pad[0]=o[16]&255|(o[17]&255)<<8,this.pad[1]=o[18]&255|(o[19]&255)<<8,this.pad[2]=o[20]&255|(o[21]&255)<<8,this.pad[3]=o[22]&255|(o[23]&255)<<8,this.pad[4]=o[24]&255|(o[25]&255)<<8,this.pad[5]=o[26]&255|(o[27]&255)<<8,this.pad[6]=o[28]&255|(o[29]&255)<<8,this.pad[7]=o[30]&255|(o[31]&255)<<8};ee.prototype.blocks=function(o,f,a){for(var r=this.fin?0:2048,c,l,d,_,C,I,O,lt,R,Y,J,K,H,X,$,W,j,M,k,N=this.h[0],U=this.h[1],E=this.h[2],p=this.h[3],x=this.h[4],m=this.h[5],g=this.h[6],b=this.h[7],w=this.h[8],D=this.h[9],V=this.r[0],Q=this.r[1],Z=this.r[2],h=this.r[3],ot=this.r[4],ft=this.r[5],dt=this.r[6],nt=this.r[7],ut=this.r[8],ht=this.r[9];a>=16;)c=o[f+0]&255|(o[f+1]&255)<<8,N+=c&8191,l=o[f+2]&255|(o[f+3]&255)<<8,U+=(c>>>13|l<<3)&8191,d=o[f+4]&255|(o[f+5]&255)<<8,E+=(l>>>10|d<<6)&8191,_=o[f+6]&255|(o[f+7]&255)<<8,p+=(d>>>7|_<<9)&8191,C=o[f+8]&255|(o[f+9]&255)<<8,x+=(_>>>4|C<<12)&8191,m+=C>>>1&8191,I=o[f+10]&255|(o[f+11]&255)<<8,g+=(C>>>14|I<<2)&8191,O=o[f+12]&255|(o[f+13]&255)<<8,b+=(I>>>11|O<<5)&8191,lt=o[f+14]&255|(o[f+15]&255)<<8,w+=(O>>>8|lt<<8)&8191,D+=lt>>>5|r,R=0,Y=R,Y+=N*V,Y+=U*(5*ht),Y+=E*(5*ut),Y+=p*(5*nt),Y+=x*(5*dt),R=Y>>>13,Y&=8191,Y+=m*(5*ft),Y+=g*(5*ot),Y+=b*(5*h),Y+=w*(5*Z),Y+=D*(5*Q),R+=Y>>>13,Y&=8191,J=R,J+=N*Q,J+=U*V,J+=E*(5*ht),J+=p*(5*ut),J+=x*(5*nt),R=J>>>13,J&=8191,J+=m*(5*dt),J+=g*(5*ft),J+=b*(5*ot),J+=w*(5*h),J+=D*(5*Z),R+=J>>>13,J&=8191,K=R,K+=N*Z,K+=U*Q,K+=E*V,K+=p*(5*ht),K+=x*(5*ut),R=K>>>13,K&=8191,K+=m*(5*nt),K+=g*(5*dt),K+=b*(5*ft),K+=w*(5*ot),K+=D*(5*h),R+=K>>>13,K&=8191,H=R,H+=N*h,H+=U*Z,H+=E*Q,H+=p*V,H+=x*(5*ht),R=H>>>13,H&=8191,H+=m*(5*ut),H+=g*(5*nt),H+=b*(5*dt),H+=w*(5*ft),H+=D*(5*ot),R+=H>>>13,H&=8191,X=R,X+=N*ot,X+=U*h,X+=E*Z,X+=p*Q,X+=x*V,R=X>>>13,X&=8191,X+=m*(5*ht),X+=g*(5*ut),X+=b*(5*nt),X+=w*(5*dt),X+=D*(5*ft),R+=X>>>13,X&=8191,$=R,$+=N*ft,$+=U*ot,$+=E*h,$+=p*Z,$+=x*Q,R=$>>>13,$&=8191,$+=m*V,$+=g*(5*ht),$+=b*(5*ut),$+=w*(5*nt),$+=D*(5*dt),R+=$>>>13,$&=8191,W=R,W+=N*dt,W+=U*ft,W+=E*ot,W+=p*h,W+=x*Z,R=W>>>13,W&=8191,W+=m*Q,W+=g*V,W+=b*(5*ht),W+=w*(5*ut),W+=D*(5*nt),R+=W>>>13,W&=8191,j=R,j+=N*nt,j+=U*dt,j+=E*ft,j+=p*ot,j+=x*h,R=j>>>13,j&=8191,j+=m*Z,j+=g*Q,j+=b*V,j+=w*(5*ht),j+=D*(5*ut),R+=j>>>13,j&=8191,M=R,M+=N*ut,M+=U*nt,M+=E*dt,M+=p*ft,M+=x*ot,R=M>>>13,M&=8191,M+=m*h,M+=g*Z,M+=b*Q,M+=w*V,M+=D*(5*ht),R+=M>>>13,M&=8191,k=R,k+=N*ht,k+=U*ut,k+=E*nt,k+=p*dt,k+=x*ft,R=k>>>13,k&=8191,k+=m*ot,k+=g*h,k+=b*Z,k+=w*Q,k+=D*V,R+=k>>>13,k&=8191,R=(R<<2)+R|0,R=R+Y|0,Y=R&8191,R=R>>>13,J+=R,N=Y,U=J,E=K,p=H,x=X,m=$,g=W,b=j,w=M,D=k,f+=16,a-=16;this.h[0]=N,this.h[1]=U,this.h[2]=E,this.h[3]=p,this.h[4]=x,this.h[5]=m,this.h[6]=g,this.h[7]=b,this.h[8]=w,this.h[9]=D},ee.prototype.finish=function(o,f){var a=new Uint16Array(10),r,c,l,d;if(this.leftover){for(d=this.leftover,this.buffer[d++]=1;d<16;d++)this.buffer[d]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,d=2;d<10;d++)this.h[d]+=r,r=this.h[d]>>>13,this.h[d]&=8191;for(this.h[0]+=r*5,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,a[0]=this.h[0]+5,r=a[0]>>>13,a[0]&=8191,d=1;d<10;d++)a[d]=this.h[d]+r,r=a[d]>>>13,a[d]&=8191;for(a[9]-=8192,c=(r^1)-1,d=0;d<10;d++)a[d]&=c;for(c=~c,d=0;d<10;d++)this.h[d]=this.h[d]&c|a[d];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,l=this.h[0]+this.pad[0],this.h[0]=l&65535,d=1;d<8;d++)l=(this.h[d]+this.pad[d]|0)+(l>>>16)|0,this.h[d]=l&65535;o[f+0]=this.h[0]>>>0&255,o[f+1]=this.h[0]>>>8&255,o[f+2]=this.h[1]>>>0&255,o[f+3]=this.h[1]>>>8&255,o[f+4]=this.h[2]>>>0&255,o[f+5]=this.h[2]>>>8&255,o[f+6]=this.h[3]>>>0&255,o[f+7]=this.h[3]>>>8&255,o[f+8]=this.h[4]>>>0&255,o[f+9]=this.h[4]>>>8&255,o[f+10]=this.h[5]>>>0&255,o[f+11]=this.h[5]>>>8&255,o[f+12]=this.h[6]>>>0&255,o[f+13]=this.h[6]>>>8&255,o[f+14]=this.h[7]>>>0&255,o[f+15]=this.h[7]>>>8&255},ee.prototype.update=function(o,f,a){var r,c;if(this.leftover){for(c=16-this.leftover,c>a&&(c=a),r=0;r<c;r++)this.buffer[this.leftover+r]=o[f+r];if(a-=c,f+=c,this.leftover+=c,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(a>=16&&(c=a-a%16,this.blocks(o,f,c),f+=c,a-=c),a){for(r=0;r<a;r++)this.buffer[this.leftover+r]=o[f+r];this.leftover+=a}};function Oe(o,f,a,r,c,l){var d=new ee(l);return d.update(a,r,c),d.finish(o,f),0}function Ge(o,f,a,r,c,l){var d=new Uint8Array(16);return Oe(d,0,a,r,c,l),Ct(o,f,d,0)}function ke(o,f,a,r,c){var l;if(a<32)return-1;for(te(o,0,f,0,a,r,c),Oe(o,16,o,32,a-32,o),l=0;l<16;l++)o[l]=0;return 0}function Le(o,f,a,r,c){var l,d=new Uint8Array(32);if(a<32||($e(d,0,32,r,c),Ge(f,16,f,32,a-32,d)!==0))return-1;for(te(o,0,f,0,a,r,c),l=0;l<32;l++)o[l]=0;return 0}function Xt(o,f){var a;for(a=0;a<16;a++)o[a]=f[a]|0}function be(o){var f,a,r=1;for(f=0;f<16;f++)a=o[f]+r+65535,r=Math.floor(a/65536),o[f]=a-r*65536;o[0]+=r-1+37*(r-1)}function ne(o,f,a){for(var r,c=~(a-1),l=0;l<16;l++)r=c&(o[l]^f[l]),o[l]^=r,f[l]^=r}function ae(o,f){var a,r,c,l=y(),d=y();for(a=0;a<16;a++)d[a]=f[a];for(be(d),be(d),be(d),r=0;r<2;r++){for(l[0]=d[0]-65517,a=1;a<15;a++)l[a]=d[a]-65535-(l[a-1]>>16&1),l[a-1]&=65535;l[15]=d[15]-32767-(l[14]>>16&1),c=l[15]>>16&1,l[14]&=65535,ne(d,l,1-c)}for(a=0;a<16;a++)o[2*a]=d[a]&255,o[2*a+1]=d[a]>>8}function Ke(o,f){var a=new Uint8Array(32),r=new Uint8Array(32);return ae(a,o),ae(r,f),it(a,0,r,0)}function Kt(o){var f=new Uint8Array(32);return ae(f,o),f[0]&1}function Re(o,f){var a;for(a=0;a<16;a++)o[a]=f[2*a]+(f[2*a+1]<<8);o[15]&=32767}function Ft(o,f,a){for(var r=0;r<16;r++)o[r]=f[r]+a[r]}function wt(o,f,a){for(var r=0;r<16;r++)o[r]=f[r]-a[r]}function F(o,f,a){var r,c,l=0,d=0,_=0,C=0,I=0,O=0,lt=0,R=0,Y=0,J=0,K=0,H=0,X=0,$=0,W=0,j=0,M=0,k=0,N=0,U=0,E=0,p=0,x=0,m=0,g=0,b=0,w=0,D=0,V=0,Q=0,Z=0,h=a[0],ot=a[1],ft=a[2],dt=a[3],nt=a[4],ut=a[5],ht=a[6],Lt=a[7],_t=a[8],At=a[9],Et=a[10],Ot=a[11],Rt=a[12],Tt=a[13],It=a[14],Nt=a[15];r=f[0],l+=r*h,d+=r*ot,_+=r*ft,C+=r*dt,I+=r*nt,O+=r*ut,lt+=r*ht,R+=r*Lt,Y+=r*_t,J+=r*At,K+=r*Et,H+=r*Ot,X+=r*Rt,$+=r*Tt,W+=r*It,j+=r*Nt,r=f[1],d+=r*h,_+=r*ot,C+=r*ft,I+=r*dt,O+=r*nt,lt+=r*ut,R+=r*ht,Y+=r*Lt,J+=r*_t,K+=r*At,H+=r*Et,X+=r*Ot,$+=r*Rt,W+=r*Tt,j+=r*It,M+=r*Nt,r=f[2],_+=r*h,C+=r*ot,I+=r*ft,O+=r*dt,lt+=r*nt,R+=r*ut,Y+=r*ht,J+=r*Lt,K+=r*_t,H+=r*At,X+=r*Et,$+=r*Ot,W+=r*Rt,j+=r*Tt,M+=r*It,k+=r*Nt,r=f[3],C+=r*h,I+=r*ot,O+=r*ft,lt+=r*dt,R+=r*nt,Y+=r*ut,J+=r*ht,K+=r*Lt,H+=r*_t,X+=r*At,$+=r*Et,W+=r*Ot,j+=r*Rt,M+=r*Tt,k+=r*It,N+=r*Nt,r=f[4],I+=r*h,O+=r*ot,lt+=r*ft,R+=r*dt,Y+=r*nt,J+=r*ut,K+=r*ht,H+=r*Lt,X+=r*_t,$+=r*At,W+=r*Et,j+=r*Ot,M+=r*Rt,k+=r*Tt,N+=r*It,U+=r*Nt,r=f[5],O+=r*h,lt+=r*ot,R+=r*ft,Y+=r*dt,J+=r*nt,K+=r*ut,H+=r*ht,X+=r*Lt,$+=r*_t,W+=r*At,j+=r*Et,M+=r*Ot,k+=r*Rt,N+=r*Tt,U+=r*It,E+=r*Nt,r=f[6],lt+=r*h,R+=r*ot,Y+=r*ft,J+=r*dt,K+=r*nt,H+=r*ut,X+=r*ht,$+=r*Lt,W+=r*_t,j+=r*At,M+=r*Et,k+=r*Ot,N+=r*Rt,U+=r*Tt,E+=r*It,p+=r*Nt,r=f[7],R+=r*h,Y+=r*ot,J+=r*ft,K+=r*dt,H+=r*nt,X+=r*ut,$+=r*ht,W+=r*Lt,j+=r*_t,M+=r*At,k+=r*Et,N+=r*Ot,U+=r*Rt,E+=r*Tt,p+=r*It,x+=r*Nt,r=f[8],Y+=r*h,J+=r*ot,K+=r*ft,H+=r*dt,X+=r*nt,$+=r*ut,W+=r*ht,j+=r*Lt,M+=r*_t,k+=r*At,N+=r*Et,U+=r*Ot,E+=r*Rt,p+=r*Tt,x+=r*It,m+=r*Nt,r=f[9],J+=r*h,K+=r*ot,H+=r*ft,X+=r*dt,$+=r*nt,W+=r*ut,j+=r*ht,M+=r*Lt,k+=r*_t,N+=r*At,U+=r*Et,E+=r*Ot,p+=r*Rt,x+=r*Tt,m+=r*It,g+=r*Nt,r=f[10],K+=r*h,H+=r*ot,X+=r*ft,$+=r*dt,W+=r*nt,j+=r*ut,M+=r*ht,k+=r*Lt,N+=r*_t,U+=r*At,E+=r*Et,p+=r*Ot,x+=r*Rt,m+=r*Tt,g+=r*It,b+=r*Nt,r=f[11],H+=r*h,X+=r*ot,$+=r*ft,W+=r*dt,j+=r*nt,M+=r*ut,k+=r*ht,N+=r*Lt,U+=r*_t,E+=r*At,p+=r*Et,x+=r*Ot,m+=r*Rt,g+=r*Tt,b+=r*It,w+=r*Nt,r=f[12],X+=r*h,$+=r*ot,W+=r*ft,j+=r*dt,M+=r*nt,k+=r*ut,N+=r*ht,U+=r*Lt,E+=r*_t,p+=r*At,x+=r*Et,m+=r*Ot,g+=r*Rt,b+=r*Tt,w+=r*It,D+=r*Nt,r=f[13],$+=r*h,W+=r*ot,j+=r*ft,M+=r*dt,k+=r*nt,N+=r*ut,U+=r*ht,E+=r*Lt,p+=r*_t,x+=r*At,m+=r*Et,g+=r*Ot,b+=r*Rt,w+=r*Tt,D+=r*It,V+=r*Nt,r=f[14],W+=r*h,j+=r*ot,M+=r*ft,k+=r*dt,N+=r*nt,U+=r*ut,E+=r*ht,p+=r*Lt,x+=r*_t,m+=r*At,g+=r*Et,b+=r*Ot,w+=r*Rt,D+=r*Tt,V+=r*It,Q+=r*Nt,r=f[15],j+=r*h,M+=r*ot,k+=r*ft,N+=r*dt,U+=r*nt,E+=r*ut,p+=r*ht,x+=r*Lt,m+=r*_t,g+=r*At,b+=r*Et,w+=r*Ot,D+=r*Rt,V+=r*Tt,Q+=r*It,Z+=r*Nt,l+=38*M,d+=38*k,_+=38*N,C+=38*U,I+=38*E,O+=38*p,lt+=38*x,R+=38*m,Y+=38*g,J+=38*b,K+=38*w,H+=38*D,X+=38*V,$+=38*Q,W+=38*Z,c=1,r=l+c+65535,c=Math.floor(r/65536),l=r-c*65536,r=d+c+65535,c=Math.floor(r/65536),d=r-c*65536,r=_+c+65535,c=Math.floor(r/65536),_=r-c*65536,r=C+c+65535,c=Math.floor(r/65536),C=r-c*65536,r=I+c+65535,c=Math.floor(r/65536),I=r-c*65536,r=O+c+65535,c=Math.floor(r/65536),O=r-c*65536,r=lt+c+65535,c=Math.floor(r/65536),lt=r-c*65536,r=R+c+65535,c=Math.floor(r/65536),R=r-c*65536,r=Y+c+65535,c=Math.floor(r/65536),Y=r-c*65536,r=J+c+65535,c=Math.floor(r/65536),J=r-c*65536,r=K+c+65535,c=Math.floor(r/65536),K=r-c*65536,r=H+c+65535,c=Math.floor(r/65536),H=r-c*65536,r=X+c+65535,c=Math.floor(r/65536),X=r-c*65536,r=$+c+65535,c=Math.floor(r/65536),$=r-c*65536,r=W+c+65535,c=Math.floor(r/65536),W=r-c*65536,r=j+c+65535,c=Math.floor(r/65536),j=r-c*65536,l+=c-1+37*(c-1),c=1,r=l+c+65535,c=Math.floor(r/65536),l=r-c*65536,r=d+c+65535,c=Math.floor(r/65536),d=r-c*65536,r=_+c+65535,c=Math.floor(r/65536),_=r-c*65536,r=C+c+65535,c=Math.floor(r/65536),C=r-c*65536,r=I+c+65535,c=Math.floor(r/65536),I=r-c*65536,r=O+c+65535,c=Math.floor(r/65536),O=r-c*65536,r=lt+c+65535,c=Math.floor(r/65536),lt=r-c*65536,r=R+c+65535,c=Math.floor(r/65536),R=r-c*65536,r=Y+c+65535,c=Math.floor(r/65536),Y=r-c*65536,r=J+c+65535,c=Math.floor(r/65536),J=r-c*65536,r=K+c+65535,c=Math.floor(r/65536),K=r-c*65536,r=H+c+65535,c=Math.floor(r/65536),H=r-c*65536,r=X+c+65535,c=Math.floor(r/65536),X=r-c*65536,r=$+c+65535,c=Math.floor(r/65536),$=r-c*65536,r=W+c+65535,c=Math.floor(r/65536),W=r-c*65536,r=j+c+65535,c=Math.floor(r/65536),j=r-c*65536,l+=c-1+37*(c-1),o[0]=l,o[1]=d,o[2]=_,o[3]=C,o[4]=I,o[5]=O,o[6]=lt,o[7]=R,o[8]=Y,o[9]=J,o[10]=K,o[11]=H,o[12]=X,o[13]=$,o[14]=W,o[15]=j}function zt(o,f){F(o,f,f)}function je(o,f){var a=y(),r;for(r=0;r<16;r++)a[r]=f[r];for(r=253;r>=0;r--)zt(a,a),r!==2&&r!==4&&F(a,a,f);for(r=0;r<16;r++)o[r]=a[r]}function Yt(o,f){var a=y(),r;for(r=0;r<16;r++)a[r]=f[r];for(r=250;r>=0;r--)zt(a,a),r!==1&&F(a,a,f);for(r=0;r<16;r++)o[r]=a[r]}function le(o,f,a){var r=new Uint8Array(32),c=new Float64Array(80),l,d,_=y(),C=y(),I=y(),O=y(),lt=y(),R=y();for(d=0;d<31;d++)r[d]=f[d];for(r[31]=f[31]&127|64,r[0]&=248,Re(c,a),d=0;d<16;d++)C[d]=c[d],O[d]=_[d]=I[d]=0;for(_[0]=O[0]=1,d=254;d>=0;--d)l=r[d>>>3]>>>(d&7)&1,ne(_,C,l),ne(I,O,l),Ft(lt,_,I),wt(_,_,I),Ft(I,C,O),wt(C,C,O),zt(O,lt),zt(R,_),F(_,I,_),F(I,C,lt),Ft(lt,_,I),wt(_,_,I),zt(C,_),wt(I,O,R),F(_,I,st),Ft(_,_,O),F(I,I,_),F(_,O,R),F(O,C,c),zt(C,lt),ne(_,C,l),ne(I,O,l);for(d=0;d<16;d++)c[d+16]=_[d],c[d+32]=I[d],c[d+48]=C[d],c[d+64]=O[d];var Y=c.subarray(32),J=c.subarray(16);return je(Y,Y),F(J,J,Y),ae(o,J),0}function me(o,f){return le(o,f,gt)}function fe(o,f){return Pt(f,32),me(o,f)}function de(o,f,a){var r=new Uint8Array(32);return le(r,a,f),Bt(o,tt,r,Ut)}var Ve=ke,Ze=Le;function Qe(o,f,a,r,c,l){var d=new Uint8Array(32);return de(d,c,l),Ve(o,f,a,r,d)}function fn(o,f,a,r,c,l){var d=new Uint8Array(32);return de(d,c,l),Ze(o,f,a,r,d)}var Ne=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function tn(o,f,a,r){for(var c=new Int32Array(16),l=new Int32Array(16),d,_,C,I,O,lt,R,Y,J,K,H,X,$,W,j,M,k,N,U,E,p,x,m,g,b,w,D=o[0],V=o[1],Q=o[2],Z=o[3],h=o[4],ot=o[5],ft=o[6],dt=o[7],nt=f[0],ut=f[1],ht=f[2],Lt=f[3],_t=f[4],At=f[5],Et=f[6],Ot=f[7],Rt=0;r>=128;){for(U=0;U<16;U++)E=8*U+Rt,c[U]=a[E+0]<<24|a[E+1]<<16|a[E+2]<<8|a[E+3],l[U]=a[E+4]<<24|a[E+5]<<16|a[E+6]<<8|a[E+7];for(U=0;U<80;U++)if(d=D,_=V,C=Q,I=Z,O=h,lt=ot,R=ft,Y=dt,J=nt,K=ut,H=ht,X=Lt,$=_t,W=At,j=Et,M=Ot,p=dt,x=Ot,m=x&65535,g=x>>>16,b=p&65535,w=p>>>16,p=(h>>>14|_t<<18)^(h>>>18|_t<<14)^(_t>>>9|h<<23),x=(_t>>>14|h<<18)^(_t>>>18|h<<14)^(h>>>9|_t<<23),m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,p=h&ot^~h&ft,x=_t&At^~_t&Et,m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,p=Ne[U*2],x=Ne[U*2+1],m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,p=c[U%16],x=l[U%16],m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,g+=m>>>16,b+=g>>>16,w+=b>>>16,k=b&65535|w<<16,N=m&65535|g<<16,p=k,x=N,m=x&65535,g=x>>>16,b=p&65535,w=p>>>16,p=(D>>>28|nt<<4)^(nt>>>2|D<<30)^(nt>>>7|D<<25),x=(nt>>>28|D<<4)^(D>>>2|nt<<30)^(D>>>7|nt<<25),m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,p=D&V^D&Q^V&Q,x=nt&ut^nt&ht^ut&ht,m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,g+=m>>>16,b+=g>>>16,w+=b>>>16,Y=b&65535|w<<16,M=m&65535|g<<16,p=I,x=X,m=x&65535,g=x>>>16,b=p&65535,w=p>>>16,p=k,x=N,m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,g+=m>>>16,b+=g>>>16,w+=b>>>16,I=b&65535|w<<16,X=m&65535|g<<16,V=d,Q=_,Z=C,h=I,ot=O,ft=lt,dt=R,D=Y,ut=J,ht=K,Lt=H,_t=X,At=$,Et=W,Ot=j,nt=M,U%16===15)for(E=0;E<16;E++)p=c[E],x=l[E],m=x&65535,g=x>>>16,b=p&65535,w=p>>>16,p=c[(E+9)%16],x=l[(E+9)%16],m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,k=c[(E+1)%16],N=l[(E+1)%16],p=(k>>>1|N<<31)^(k>>>8|N<<24)^k>>>7,x=(N>>>1|k<<31)^(N>>>8|k<<24)^(N>>>7|k<<25),m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,k=c[(E+14)%16],N=l[(E+14)%16],p=(k>>>19|N<<13)^(N>>>29|k<<3)^k>>>6,x=(N>>>19|k<<13)^(k>>>29|N<<3)^(N>>>6|k<<26),m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,g+=m>>>16,b+=g>>>16,w+=b>>>16,c[E]=b&65535|w<<16,l[E]=m&65535|g<<16;p=D,x=nt,m=x&65535,g=x>>>16,b=p&65535,w=p>>>16,p=o[0],x=f[0],m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,g+=m>>>16,b+=g>>>16,w+=b>>>16,o[0]=D=b&65535|w<<16,f[0]=nt=m&65535|g<<16,p=V,x=ut,m=x&65535,g=x>>>16,b=p&65535,w=p>>>16,p=o[1],x=f[1],m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,g+=m>>>16,b+=g>>>16,w+=b>>>16,o[1]=V=b&65535|w<<16,f[1]=ut=m&65535|g<<16,p=Q,x=ht,m=x&65535,g=x>>>16,b=p&65535,w=p>>>16,p=o[2],x=f[2],m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,g+=m>>>16,b+=g>>>16,w+=b>>>16,o[2]=Q=b&65535|w<<16,f[2]=ht=m&65535|g<<16,p=Z,x=Lt,m=x&65535,g=x>>>16,b=p&65535,w=p>>>16,p=o[3],x=f[3],m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,g+=m>>>16,b+=g>>>16,w+=b>>>16,o[3]=Z=b&65535|w<<16,f[3]=Lt=m&65535|g<<16,p=h,x=_t,m=x&65535,g=x>>>16,b=p&65535,w=p>>>16,p=o[4],x=f[4],m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,g+=m>>>16,b+=g>>>16,w+=b>>>16,o[4]=h=b&65535|w<<16,f[4]=_t=m&65535|g<<16,p=ot,x=At,m=x&65535,g=x>>>16,b=p&65535,w=p>>>16,p=o[5],x=f[5],m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,g+=m>>>16,b+=g>>>16,w+=b>>>16,o[5]=ot=b&65535|w<<16,f[5]=At=m&65535|g<<16,p=ft,x=Et,m=x&65535,g=x>>>16,b=p&65535,w=p>>>16,p=o[6],x=f[6],m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,g+=m>>>16,b+=g>>>16,w+=b>>>16,o[6]=ft=b&65535|w<<16,f[6]=Et=m&65535|g<<16,p=dt,x=Ot,m=x&65535,g=x>>>16,b=p&65535,w=p>>>16,p=o[7],x=f[7],m+=x&65535,g+=x>>>16,b+=p&65535,w+=p>>>16,g+=m>>>16,b+=g>>>16,w+=b>>>16,o[7]=dt=b&65535|w<<16,f[7]=Ot=m&65535|g<<16,Rt+=128,r-=128}return r}function re(o,f,a){var r=new Int32Array(8),c=new Int32Array(8),l=new Uint8Array(256),d,_=a;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,c[0]=4089235720,c[1]=2227873595,c[2]=4271175723,c[3]=1595750129,c[4]=2917565137,c[5]=725511199,c[6]=4215389547,c[7]=327033209,tn(r,c,f,a),a%=128,d=0;d<a;d++)l[d]=f[_-a+d];for(l[a]=128,a=256-128*(a<112?1:0),l[a-9]=0,G(l,a-8,_/536870912|0,_<<3),tn(r,c,l,a),d=0;d<8;d++)G(o,8*d,r[d],c[d]);return 0}function we(o,f){var a=y(),r=y(),c=y(),l=y(),d=y(),_=y(),C=y(),I=y(),O=y();wt(a,o[1],o[0]),wt(O,f[1],f[0]),F(a,a,O),Ft(r,o[0],o[1]),Ft(O,f[0],f[1]),F(r,r,O),F(c,o[3],f[3]),F(c,c,bt),F(l,o[2],f[2]),Ft(l,l,l),wt(d,r,a),wt(_,l,c),Ft(C,l,c),Ft(I,r,a),F(o[0],d,_),F(o[1],I,C),F(o[2],C,_),F(o[3],d,I)}function en(o,f,a){var r;for(r=0;r<4;r++)ne(o[r],f[r],a)}function ce(o,f){var a=y(),r=y(),c=y();je(c,f[2]),F(a,f[0],c),F(r,f[1],c),ae(o,r),o[31]^=Kt(a)<<7}function Ue(o,f,a){var r,c;for(Xt(o[0],xt),Xt(o[1],vt),Xt(o[2],vt),Xt(o[3],xt),c=255;c>=0;--c)r=a[c/8|0]>>(c&7)&1,en(o,f,r),we(f,o),we(o,o),en(o,f,r)}function mt(o,f){var a=[y(),y(),y(),y()];Xt(a[0],z),Xt(a[1],T),Xt(a[2],vt),F(a[3],z,T),Ue(o,a,f)}function Ie(o,f,a){var r=new Uint8Array(64),c=[y(),y(),y(),y()],l;for(a||Pt(f,32),re(r,f,32),r[0]&=248,r[31]&=127,r[31]|=64,mt(c,r),ce(o,c),l=0;l<32;l++)f[l+32]=o[l];return 0}var Se=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Me(o,f){var a,r,c,l;for(r=63;r>=32;--r){for(a=0,c=r-32,l=r-12;c<l;++c)f[c]+=a-16*f[r]*Se[c-(r-32)],a=Math.floor((f[c]+128)/256),f[c]-=a*256;f[c]+=a,f[r]=0}for(a=0,c=0;c<32;c++)f[c]+=a-(f[31]>>4)*Se[c],a=f[c]>>8,f[c]&=255;for(c=0;c<32;c++)f[c]-=a*Se[c];for(r=0;r<32;r++)f[r+1]+=f[r]>>8,o[r]=f[r]&255}function Be(o){var f=new Float64Array(64),a;for(a=0;a<64;a++)f[a]=o[a];for(a=0;a<64;a++)o[a]=0;Me(o,f)}function nn(o,f,a,r){var c=new Uint8Array(64),l=new Uint8Array(64),d=new Uint8Array(64),_,C,I=new Float64Array(64),O=[y(),y(),y(),y()];re(c,r,32),c[0]&=248,c[31]&=127,c[31]|=64;var lt=a+64;for(_=0;_<a;_++)o[64+_]=f[_];for(_=0;_<32;_++)o[32+_]=c[32+_];for(re(d,o.subarray(32),a+32),Be(d),mt(O,d),ce(o,O),_=32;_<64;_++)o[_]=r[_];for(re(l,o,a+64),Be(l),_=0;_<64;_++)I[_]=0;for(_=0;_<32;_++)I[_]=d[_];for(_=0;_<32;_++)for(C=0;C<32;C++)I[_+C]+=l[_]*c[C];return Me(o.subarray(32),I),lt}function cn(o,f){var a=y(),r=y(),c=y(),l=y(),d=y(),_=y(),C=y();return Xt(o[2],vt),Re(o[1],f),zt(c,o[1]),F(l,c,et),wt(c,c,o[2]),Ft(l,o[2],l),zt(d,l),zt(_,d),F(C,_,d),F(a,C,c),F(a,a,l),Yt(a,a),F(a,a,c),F(a,a,l),F(a,a,l),F(o[0],a,l),zt(r,o[0]),F(r,r,l),Ke(r,c)&&F(o[0],o[0],A),zt(r,o[0]),F(r,r,l),Ke(r,c)?-1:(Kt(o[0])===f[31]>>7&&wt(o[0],xt,o[0]),F(o[3],o[0],o[1]),0)}function De(o,f,a,r){var c,l=new Uint8Array(32),d=new Uint8Array(64),_=[y(),y(),y(),y()],C=[y(),y(),y(),y()];if(a<64||cn(C,r))return-1;for(c=0;c<a;c++)o[c]=f[c];for(c=0;c<32;c++)o[c+32]=r[c];if(re(d,o,a),Be(d),Ue(_,C,d),mt(C,f.subarray(32)),we(_,C),ce(l,_),a-=64,it(f,0,l,0)){for(c=0;c<a;c++)o[c]=0;return-1}for(c=0;c<a;c++)o[c]=f[c+64];return a}var qe=32,Ce=24,ie=32,Vt=16,pe=32,Te=32,xe=32,ve=32,ze=32,Pe=Ce,un=ie,Wt=Vt,$t=64,oe=32,ue=64,He=32,Zt=64;S.lowlevel={crypto_core_hsalsa20:Bt,crypto_stream_xor:te,crypto_stream:$e,crypto_stream_salsa20_xor:Xe,crypto_stream_salsa20:We,crypto_onetimeauth:Oe,crypto_onetimeauth_verify:Ge,crypto_verify_16:Ct,crypto_verify_32:it,crypto_secretbox:ke,crypto_secretbox_open:Le,crypto_scalarmult:le,crypto_scalarmult_base:me,crypto_box_beforenm:de,crypto_box_afternm:Ve,crypto_box:Qe,crypto_box_open:fn,crypto_box_keypair:fe,crypto_hash:re,crypto_sign:nn,crypto_sign_keypair:Ie,crypto_sign_open:De,crypto_secretbox_KEYBYTES:qe,crypto_secretbox_NONCEBYTES:Ce,crypto_secretbox_ZEROBYTES:ie,crypto_secretbox_BOXZEROBYTES:Vt,crypto_scalarmult_BYTES:pe,crypto_scalarmult_SCALARBYTES:Te,crypto_box_PUBLICKEYBYTES:xe,crypto_box_SECRETKEYBYTES:ve,crypto_box_BEFORENMBYTES:ze,crypto_box_NONCEBYTES:Pe,crypto_box_ZEROBYTES:un,crypto_box_BOXZEROBYTES:Wt,crypto_sign_BYTES:$t,crypto_sign_PUBLICKEYBYTES:oe,crypto_sign_SECRETKEYBYTES:ue,crypto_sign_SEEDBYTES:He,crypto_hash_BYTES:Zt,gf:y,D:et,L:Se,pack25519:ae,unpack25519:Re,M:F,A:Ft,S:zt,Z:wt,pow2523:Yt,add:we,set25519:Xt,modL:Me,scalarmult:Ue,scalarbase:mt};function rn(o,f){if(o.length!==qe)throw new Error("bad key size");if(f.length!==Ce)throw new Error("bad nonce size")}function on(o,f){if(o.length!==xe)throw new Error("bad public key size");if(f.length!==ve)throw new Error("bad secret key size")}function Dt(){for(var o=0;o<arguments.length;o++)if(!(arguments[o]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Fe(o){for(var f=0;f<o.length;f++)o[f]=0}S.randomBytes=function(o){var f=new Uint8Array(o);return Pt(f,o),f},S.secretbox=function(o,f,a){Dt(o,f,a),rn(a,f);for(var r=new Uint8Array(ie+o.length),c=new Uint8Array(r.length),l=0;l<o.length;l++)r[l+ie]=o[l];return ke(c,r,r.length,f,a),c.subarray(Vt)},S.secretbox.open=function(o,f,a){Dt(o,f,a),rn(a,f);for(var r=new Uint8Array(Vt+o.length),c=new Uint8Array(r.length),l=0;l<o.length;l++)r[l+Vt]=o[l];return r.length<32||Le(c,r,r.length,f,a)!==0?null:c.subarray(ie)},S.secretbox.keyLength=qe,S.secretbox.nonceLength=Ce,S.secretbox.overheadLength=Vt,S.scalarMult=function(o,f){if(Dt(o,f),o.length!==Te)throw new Error("bad n size");if(f.length!==pe)throw new Error("bad p size");var a=new Uint8Array(pe);return le(a,o,f),a},S.scalarMult.base=function(o){if(Dt(o),o.length!==Te)throw new Error("bad n size");var f=new Uint8Array(pe);return me(f,o),f},S.scalarMult.scalarLength=Te,S.scalarMult.groupElementLength=pe,S.box=function(o,f,a,r){var c=S.box.before(a,r);return S.secretbox(o,f,c)},S.box.before=function(o,f){Dt(o,f),on(o,f);var a=new Uint8Array(ze);return de(a,o,f),a},S.box.after=S.secretbox,S.box.open=function(o,f,a,r){var c=S.box.before(a,r);return S.secretbox.open(o,f,c)},S.box.open.after=S.secretbox.open,S.box.keyPair=function(){var o=new Uint8Array(xe),f=new Uint8Array(ve);return fe(o,f),{publicKey:o,secretKey:f}},S.box.keyPair.fromSecretKey=function(o){if(Dt(o),o.length!==ve)throw new Error("bad secret key size");var f=new Uint8Array(xe);return me(f,o),{publicKey:f,secretKey:new Uint8Array(o)}},S.box.publicKeyLength=xe,S.box.secretKeyLength=ve,S.box.sharedKeyLength=ze,S.box.nonceLength=Pe,S.box.overheadLength=S.secretbox.overheadLength,S.sign=function(o,f){if(Dt(o,f),f.length!==ue)throw new Error("bad secret key size");var a=new Uint8Array($t+o.length);return nn(a,o,o.length,f),a},S.sign.open=function(o,f){if(Dt(o,f),f.length!==oe)throw new Error("bad public key size");var a=new Uint8Array(o.length),r=De(a,o,o.length,f);if(r<0)return null;for(var c=new Uint8Array(r),l=0;l<c.length;l++)c[l]=a[l];return c},S.sign.detached=function(o,f){for(var a=S.sign(o,f),r=new Uint8Array($t),c=0;c<r.length;c++)r[c]=a[c];return r},S.sign.detached.verify=function(o,f,a){if(Dt(o,f,a),f.length!==$t)throw new Error("bad signature size");if(a.length!==oe)throw new Error("bad public key size");var r=new Uint8Array($t+o.length),c=new Uint8Array($t+o.length),l;for(l=0;l<$t;l++)r[l]=f[l];for(l=0;l<o.length;l++)r[l+$t]=o[l];return De(c,r,r.length,a)>=0},S.sign.keyPair=function(){var o=new Uint8Array(oe),f=new Uint8Array(ue);return Ie(o,f),{publicKey:o,secretKey:f}},S.sign.keyPair.fromSecretKey=function(o){if(Dt(o),o.length!==ue)throw new Error("bad secret key size");for(var f=new Uint8Array(oe),a=0;a<f.length;a++)f[a]=o[32+a];return{publicKey:f,secretKey:new Uint8Array(o)}},S.sign.keyPair.fromSeed=function(o){if(Dt(o),o.length!==He)throw new Error("bad seed size");for(var f=new Uint8Array(oe),a=new Uint8Array(ue),r=0;r<32;r++)a[r]=o[r];return Ie(f,a,!0),{publicKey:f,secretKey:a}},S.sign.publicKeyLength=oe,S.sign.secretKeyLength=ue,S.sign.seedLength=He,S.sign.signatureLength=$t,S.hash=function(o){Dt(o);var f=new Uint8Array(Zt);return re(f,o,o.length),f},S.hash.hashLength=Zt,S.verify=function(o,f){return Dt(o,f),o.length===0||f.length===0||o.length!==f.length?!1:B(o,0,f,0,o.length)===0},S.setPRNG=function(o){Pt=o},(function(){var o=typeof self<"u"?self.crypto||self.msCrypto:null;if(o&&o.getRandomValues){var f=65536;S.setPRNG(function(a,r){var c,l=new Uint8Array(r);for(c=0;c<r;c+=f)o.getRandomValues(l.subarray(c,c+Math.min(r-c,f)));for(c=0;c<r;c++)a[c]=l[c];Fe(l)})}else o=pt(4),o&&o.randomBytes&&S.setPRNG(function(a,r){var c,l=o.randomBytes(r);for(c=0;c<r;c++)a[c]=l[c];Fe(l)})})()})(kt.exports?kt.exports:self.nacl=self.nacl||{})}),(function(kt,at,pt){kt.exports=pt(5).default}),(function(kt,at){}),(function(kt,at,pt){pt.r(at);var S=(function(){function e(t,n){this.lastId=0,this.prefix=t,this.name=n}return e.prototype.create=function(t){this.lastId++;var n=this.lastId,i=this.prefix+n,s=this.name+"["+n+"]",u=!1,v=function(){u||(t.apply(null,arguments),u=!0)};return this[n]=v,{number:n,id:i,name:s,callback:v}},e.prototype.remove=function(t){delete this[t.number]},e})(),y=new S("_pusher_script_","Pusher.ScriptReceivers"),Pt={VERSION:"7.6.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},tt=Pt,gt=(function(){function e(t){this.options=t,this.receivers=t.receivers||y,this.loading={}}return e.prototype.load=function(t,n,i){var s=this;if(s.loading[t]&&s.loading[t].length>0)s.loading[t].push(i);else{s.loading[t]=[i];var u=rt.createScriptRequest(s.getPath(t,n)),v=s.receivers.create(function(P){if(s.receivers.remove(v),s.loading[t]){var q=s.loading[t];delete s.loading[t];for(var L=function(jt){jt||u.cleanup()},ct=0;ct<q.length;ct++)q[ct](P,L)}});u.send(v)}},e.prototype.getRoot=function(t){var n,i=rt.getDocument().location.protocol;return t&&t.useTLS||i==="https:"?n=this.options.cdn_https:n=this.options.cdn_http,n.replace(/\/*$/,"")+"/"+this.options.version},e.prototype.getPath=function(t,n){return this.getRoot(n)+"/"+t+this.options.suffix+".js"},e})(),xt=gt,vt=new S("_pusher_dependencies","Pusher.DependenciesReceivers"),st=new xt({cdn_http:tt.cdn_http,cdn_https:tt.cdn_https,version:tt.VERSION,suffix:tt.dependency_suffix,receivers:vt}),et={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},bt=function(e){var t="See:",n=et.urls[e];if(!n)return"";var i;return n.fullUrl?i=n.fullUrl:n.path&&(i=et.baseUrl+n.path),i?t+" "+i:""},z={buildLogSuffix:bt},T;(function(e){e.UserAuthentication="user-authentication",e.ChannelAuthorization="channel-authorization"})(T||(T={}));var A=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),G=(function(e){A(t,e);function t(n){var i=this.constructor,s=e.call(this,n)||this;return Object.setPrototypeOf(s,i.prototype),s}return t})(Error),B=(function(e){A(t,e);function t(n){var i=this.constructor,s=e.call(this,n)||this;return Object.setPrototypeOf(s,i.prototype),s}return t})(Error),Ct=(function(e){A(t,e);function t(n){var i=this.constructor,s=e.call(this,n)||this;return Object.setPrototypeOf(s,i.prototype),s}return t})(Error),it=(function(e){A(t,e);function t(n){var i=this.constructor,s=e.call(this,n)||this;return Object.setPrototypeOf(s,i.prototype),s}return t})(Error),Ht=(function(e){A(t,e);function t(n){var i=this.constructor,s=e.call(this,n)||this;return Object.setPrototypeOf(s,i.prototype),s}return t})(Error),Jt=(function(e){A(t,e);function t(n){var i=this.constructor,s=e.call(this,n)||this;return Object.setPrototypeOf(s,i.prototype),s}return t})(Error),qt=(function(e){A(t,e);function t(n){var i=this.constructor,s=e.call(this,n)||this;return Object.setPrototypeOf(s,i.prototype),s}return t})(Error),Bt=(function(e){A(t,e);function t(n){var i=this.constructor,s=e.call(this,n)||this;return Object.setPrototypeOf(s,i.prototype),s}return t})(Error),Ut=(function(e){A(t,e);function t(n,i){var s=this.constructor,u=e.call(this,i)||this;return u.status=n,Object.setPrototypeOf(u,s.prototype),u}return t})(Error),Xe=function(e,t,n,i,s){var u=rt.createXHR();u.open("POST",n.endpoint,!0),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var v in n.headers)u.setRequestHeader(v,n.headers[v]);if(n.headersProvider!=null){var P=n.headersProvider();for(var v in P)u.setRequestHeader(v,P[v])}return u.onreadystatechange=function(){if(u.readyState===4)if(u.status===200){var q=void 0,L=!1;try{q=JSON.parse(u.responseText),L=!0}catch{s(new Ut(200,"JSON returned from "+i.toString()+" endpoint was invalid, yet status code was 200. Data was: "+u.responseText),null)}L&&s(null,q)}else{var ct="";switch(i){case T.UserAuthentication:ct=z.buildLogSuffix("authenticationEndpoint");break;case T.ChannelAuthorization:ct="Clients must be authorized to join private or presence channels. "+z.buildLogSuffix("authorizationEndpoint");break}s(new Ut(u.status,"Unable to retrieve auth string from "+i.toString()+" endpoint - "+("received status: "+u.status+" from "+n.endpoint+". "+ct)),null)}},u.send(t),u},We=Xe;function $e(e){return Le(Ge(e))}var te=String.fromCharCode,ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Oe=function(e){var t=e.charCodeAt(0);return t<128?e:t<2048?te(192|t>>>6)+te(128|t&63):te(224|t>>>12&15)+te(128|t>>>6&63)+te(128|t&63)},Ge=function(e){return e.replace(/[^\x00-\x7F]/g,Oe)},ke=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0),i=[ee.charAt(n>>>18),ee.charAt(n>>>12&63),t>=2?"=":ee.charAt(n>>>6&63),t>=1?"=":ee.charAt(n&63)];return i.join("")},Le=window.btoa||function(e){return e.replace(/[\s\S]{1,3}/g,ke)},Xt=(function(){function e(t,n,i,s){var u=this;this.clear=n,this.timer=t(function(){u.timer&&(u.timer=s(u.timer))},i)}return e.prototype.isRunning=function(){return this.timer!==null},e.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},e})(),be=Xt,ne=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})();function ae(e){window.clearTimeout(e)}function Ke(e){window.clearInterval(e)}var Kt=(function(e){ne(t,e);function t(n,i){return e.call(this,setTimeout,ae,n,function(s){return i(),null})||this}return t})(be),Re=(function(e){ne(t,e);function t(n,i){return e.call(this,setInterval,Ke,n,function(s){return i(),s})||this}return t})(be),Ft={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(e){return new Kt(0,e)},method:function(e){var t=Array.prototype.slice.call(arguments,1);return function(n){return n[e].apply(n,t.concat(arguments))}}},wt=Ft;function F(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=0;i<t.length;i++){var s=t[i];for(var u in s)s[u]&&s[u].constructor&&s[u].constructor===Object?e[u]=F(e[u]||{},s[u]):e[u]=s[u]}return e}function zt(){for(var e=["Pusher"],t=0;t<arguments.length;t++)typeof arguments[t]=="string"?e.push(arguments[t]):e.push(ce(arguments[t]));return e.join(" : ")}function je(e,t){var n=Array.prototype.indexOf;if(e===null)return-1;if(n&&e.indexOf===n)return e.indexOf(t);for(var i=0,s=e.length;i<s;i++)if(e[i]===t)return i;return-1}function Yt(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(e[n],n,e)}function le(e){var t=[];return Yt(e,function(n,i){t.push(i)}),t}function me(e){var t=[];return Yt(e,function(n){t.push(n)}),t}function fe(e,t,n){for(var i=0;i<e.length;i++)t.call(n||window,e[i],i,e)}function de(e,t){for(var n=[],i=0;i<e.length;i++)n.push(t(e[i],i,e,n));return n}function Ve(e,t){var n={};return Yt(e,function(i,s){n[s]=t(i)}),n}function Ze(e,t){t=t||function(s){return!!s};for(var n=[],i=0;i<e.length;i++)t(e[i],i,e,n)&&n.push(e[i]);return n}function Qe(e,t){var n={};return Yt(e,function(i,s){(t&&t(i,s,e,n)||i)&&(n[s]=i)}),n}function fn(e){var t=[];return Yt(e,function(n,i){t.push([i,n])}),t}function Ne(e,t){for(var n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1}function tn(e,t){for(var n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0}function re(e){return Ve(e,function(t){return typeof t=="object"&&(t=ce(t)),encodeURIComponent($e(t.toString()))})}function we(e){var t=Qe(e,function(i){return i!==void 0}),n=de(fn(re(t)),wt.method("join","=")).join("&");return n}function en(e){var t=[],n=[];return(function i(s,u){var v,P,q;switch(typeof s){case"object":if(!s)return null;for(v=0;v<t.length;v+=1)if(t[v]===s)return{$ref:n[v]};if(t.push(s),n.push(u),Object.prototype.toString.apply(s)==="[object Array]")for(q=[],v=0;v<s.length;v+=1)q[v]=i(s[v],u+"["+v+"]");else{q={};for(P in s)Object.prototype.hasOwnProperty.call(s,P)&&(q[P]=i(s[P],u+"["+JSON.stringify(P)+"]"))}return q;case"number":case"string":case"boolean":return s}})(e,"$")}function ce(e){try{return JSON.stringify(e)}catch{return JSON.stringify(en(e))}}var Ue=(function(){function e(){this.globalLog=function(t){window.console&&window.console.log&&window.console.log(t)}}return e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.log(this.globalLog,t)},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.log(this.globalLogWarn,t)},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.log(this.globalLogError,t)},e.prototype.globalLogWarn=function(t){window.console&&window.console.warn?window.console.warn(t):this.globalLog(t)},e.prototype.globalLogError=function(t){window.console&&window.console.error?window.console.error(t):this.globalLogWarn(t)},e.prototype.log=function(t){var n=zt.apply(this,arguments);if(Ee.log)Ee.log(n);else if(Ee.logToConsole){var i=t.bind(this);i(n)}},e})(),mt=new Ue,Ie=function(e,t,n,i,s){(n.headers!==void 0||n.headersProvider!=null)&&mt.warn("To send headers with the "+i.toString()+" request, you must use AJAX, rather than JSONP.");var u=e.nextAuthCallbackID.toString();e.nextAuthCallbackID++;var v=e.getDocument(),P=v.createElement("script");e.auth_callbacks[u]=function(ct){s(null,ct)};var q="Pusher.auth_callbacks['"+u+"']";P.src=n.endpoint+"?callback="+encodeURIComponent(q)+"&"+t;var L=v.getElementsByTagName("head")[0]||v.documentElement;L.insertBefore(P,L.firstChild)},Se=Ie,Me=(function(){function e(t){this.src=t}return e.prototype.send=function(t){var n=this,i="Error loading "+n.src;n.script=document.createElement("script"),n.script.id=t.id,n.script.src=n.src,n.script.type="text/javascript",n.script.charset="UTF-8",n.script.addEventListener?(n.script.onerror=function(){t.callback(i)},n.script.onload=function(){t.callback(null)}):n.script.onreadystatechange=function(){(n.script.readyState==="loaded"||n.script.readyState==="complete")&&t.callback(null)},n.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(n.errorScript=document.createElement("script"),n.errorScript.id=t.id+"_error",n.errorScript.text=t.name+"('"+i+"');",n.script.async=n.errorScript.async=!1):n.script.async=!0;var s=document.getElementsByTagName("head")[0];s.insertBefore(n.script,s.firstChild),n.errorScript&&s.insertBefore(n.errorScript,n.script.nextSibling)},e.prototype.cleanup=function(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null},e})(),Be=Me,nn=(function(){function e(t,n){this.url=t,this.data=n}return e.prototype.send=function(t){if(!this.request){var n=we(this.data),i=this.url+"/"+t.number+"?"+n;this.request=rt.createScriptRequest(i),this.request.send(t)}},e.prototype.cleanup=function(){this.request&&this.request.cleanup()},e})(),cn=nn,De=function(e,t){return function(n,i){var s="http"+(t?"s":"")+"://",u=s+(e.host||e.options.host)+e.options.path,v=rt.createJSONPRequest(u,n),P=rt.ScriptReceivers.create(function(q,L){y.remove(P),v.cleanup(),L&&L.host&&(e.host=L.host),i&&i(q,L)});v.send(P)}},qe={name:"jsonp",getAgent:De},Ce=qe;function ie(e,t,n){var i=e+(t.useTLS?"s":""),s=t.useTLS?t.hostTLS:t.hostNonTLS;return i+"://"+s+n}function Vt(e,t){var n="/app/"+e,i="?protocol="+tt.PROTOCOL+"&client=js&version="+tt.VERSION+(t?"&"+t:"");return n+i}var pe={getInitial:function(e,t){var n=(t.httpPath||"")+Vt(e,"flash=false");return ie("ws",t,n)}},Te={getInitial:function(e,t){var n=(t.httpPath||"/pusher")+Vt(e);return ie("http",t,n)}},xe={getInitial:function(e,t){return ie("http",t,t.httpPath||"/pusher")},getPath:function(e,t){return Vt(e)}},ve=(function(){function e(){this._callbacks={}}return e.prototype.get=function(t){return this._callbacks[Pe(t)]},e.prototype.add=function(t,n,i){var s=Pe(t);this._callbacks[s]=this._callbacks[s]||[],this._callbacks[s].push({fn:n,context:i})},e.prototype.remove=function(t,n,i){if(!t&&!n&&!i){this._callbacks={};return}var s=t?[Pe(t)]:le(this._callbacks);n||i?this.removeCallback(s,n,i):this.removeAllCallbacks(s)},e.prototype.removeCallback=function(t,n,i){fe(t,function(s){this._callbacks[s]=Ze(this._callbacks[s]||[],function(u){return n&&n!==u.fn||i&&i!==u.context}),this._callbacks[s].length===0&&delete this._callbacks[s]},this)},e.prototype.removeAllCallbacks=function(t){fe(t,function(n){delete this._callbacks[n]},this)},e})(),ze=ve;function Pe(e){return"_"+e}var un=(function(){function e(t){this.callbacks=new ze,this.global_callbacks=[],this.failThrough=t}return e.prototype.bind=function(t,n,i){return this.callbacks.add(t,n,i),this},e.prototype.bind_global=function(t){return this.global_callbacks.push(t),this},e.prototype.unbind=function(t,n,i){return this.callbacks.remove(t,n,i),this},e.prototype.unbind_global=function(t){return t?(this.global_callbacks=Ze(this.global_callbacks||[],function(n){return n!==t}),this):(this.global_callbacks=[],this)},e.prototype.unbind_all=function(){return this.unbind(),this.unbind_global(),this},e.prototype.emit=function(t,n,i){for(var s=0;s<this.global_callbacks.length;s++)this.global_callbacks[s](t,n);var u=this.callbacks.get(t),v=[];if(i?v.push(n,i):n&&v.push(n),u&&u.length>0)for(var s=0;s<u.length;s++)u[s].fn.apply(u[s].context||window,v);else this.failThrough&&this.failThrough(t,n);return this},e})(),Wt=un,$t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),oe=(function(e){$t(t,e);function t(n,i,s,u,v){var P=e.call(this)||this;return P.initialize=rt.transportConnectionInitializer,P.hooks=n,P.name=i,P.priority=s,P.key=u,P.options=v,P.state="new",P.timeline=v.timeline,P.activityTimeout=v.activityTimeout,P.id=P.timeline.generateUniqueID(),P}return t.prototype.handlesActivityChecks=function(){return!!this.hooks.handlesActivityChecks},t.prototype.supportsPing=function(){return!!this.hooks.supportsPing},t.prototype.connect=function(){var n=this;if(this.socket||this.state!=="initialized")return!1;var i=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(i,this.options)}catch(s){return wt.defer(function(){n.onError(s),n.changeState("closed")}),!1}return this.bindListeners(),mt.debug("Connecting",{transport:this.name,url:i}),this.changeState("connecting"),!0},t.prototype.close=function(){return this.socket?(this.socket.close(),!0):!1},t.prototype.send=function(n){var i=this;return this.state==="open"?(wt.defer(function(){i.socket&&i.socket.send(n)}),!0):!1},t.prototype.ping=function(){this.state==="open"&&this.supportsPing()&&this.socket.ping()},t.prototype.onOpen=function(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0},t.prototype.onError=function(n){this.emit("error",{type:"WebSocketError",error:n}),this.timeline.error(this.buildTimelineMessage({error:n.toString()}))},t.prototype.onClose=function(n){n?this.changeState("closed",{code:n.code,reason:n.reason,wasClean:n.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0},t.prototype.onMessage=function(n){this.emit("message",n)},t.prototype.onActivity=function(){this.emit("activity")},t.prototype.bindListeners=function(){var n=this;this.socket.onopen=function(){n.onOpen()},this.socket.onerror=function(i){n.onError(i)},this.socket.onclose=function(i){n.onClose(i)},this.socket.onmessage=function(i){n.onMessage(i)},this.supportsPing()&&(this.socket.onactivity=function(){n.onActivity()})},t.prototype.unbindListeners=function(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))},t.prototype.changeState=function(n,i){this.state=n,this.timeline.info(this.buildTimelineMessage({state:n,params:i})),this.emit(n,i)},t.prototype.buildTimelineMessage=function(n){return F({cid:this.id},n)},t})(Wt),ue=oe,He=(function(){function e(t){this.hooks=t}return e.prototype.isSupported=function(t){return this.hooks.isSupported(t)},e.prototype.createConnection=function(t,n,i,s){return new ue(this.hooks,t,n,i,s)},e})(),Zt=He,rn=new Zt({urls:pe,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!rt.getWebSocketAPI()},isSupported:function(){return!!rt.getWebSocketAPI()},getSocket:function(e){return rt.createWebSocket(e)}}),on={urls:Te,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Dt=F({getSocket:function(e){return rt.HTTPFactory.createStreamingSocket(e)}},on),Fe=F({getSocket:function(e){return rt.HTTPFactory.createPollingSocket(e)}},on),o={isSupported:function(){return rt.isXHRSupported()}},f=new Zt(F({},Dt,o)),a=new Zt(F({},Fe,o)),r={ws:rn,xhr_streaming:f,xhr_polling:a},c=r,l=new Zt({file:"sockjs",urls:xe,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(e,t){return new window.SockJS(e,null,{js_path:st.getPath("sockjs",{useTLS:t.useTLS}),ignore_null_origin:t.ignoreNullOrigin})},beforeOpen:function(e,t){e.send(JSON.stringify({path:t}))}}),d={isSupported:function(e){var t=rt.isXDRSupported(e.useTLS);return t}},_=new Zt(F({},Dt,d)),C=new Zt(F({},Fe,d));c.xdr_streaming=_,c.xdr_polling=C,c.sockjs=l;var I=c,O=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),lt=(function(e){O(t,e);function t(){var n=e.call(this)||this,i=n;return window.addEventListener!==void 0&&(window.addEventListener("online",function(){i.emit("online")},!1),window.addEventListener("offline",function(){i.emit("offline")},!1)),n}return t.prototype.isOnline=function(){return window.navigator.onLine===void 0?!0:window.navigator.onLine},t})(Wt),R=new lt,Y=(function(){function e(t,n,i){this.manager=t,this.transport=n,this.minPingDelay=i.minPingDelay,this.maxPingDelay=i.maxPingDelay,this.pingDelay=void 0}return e.prototype.createConnection=function(t,n,i,s){var u=this;s=F({},s,{activityTimeout:this.pingDelay});var v=this.transport.createConnection(t,n,i,s),P=null,q=function(){v.unbind("open",q),v.bind("closed",L),P=wt.now()},L=function(ct){if(v.unbind("closed",L),ct.code===1002||ct.code===1003)u.manager.reportDeath();else if(!ct.wasClean&&P){var jt=wt.now()-P;jt<2*u.maxPingDelay&&(u.manager.reportDeath(),u.pingDelay=Math.max(jt/2,u.minPingDelay))}};return v.bind("open",q),v},e.prototype.isSupported=function(t){return this.manager.isAlive()&&this.transport.isSupported(t)},e})(),J=Y,K={decodeMessage:function(e){try{var t=JSON.parse(e.data),n=t.data;if(typeof n=="string")try{n=JSON.parse(t.data)}catch{}var i={event:t.event,channel:t.channel,data:n};return t.user_id&&(i.user_id=t.user_id),i}catch(s){throw{type:"MessageParseError",error:s,data:e.data}}},encodeMessage:function(e){return JSON.stringify(e)},processHandshake:function(e){var t=K.decodeMessage(e);if(t.event==="pusher:connection_established"){if(!t.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:t.data.socket_id,activityTimeout:t.data.activity_timeout*1e3}}else{if(t.event==="pusher:error")return{action:this.getCloseAction(t.data),error:this.getCloseError(t.data)};throw"Invalid handshake"}},getCloseAction:function(e){return e.code<4e3?e.code>=1002&&e.code<=1004?"backoff":null:e.code===4e3?"tls_only":e.code<4100?"refused":e.code<4200?"backoff":e.code<4300?"retry":"refused"},getCloseError:function(e){return e.code!==1e3&&e.code!==1001?{type:"PusherError",data:{code:e.code,message:e.reason||e.message}}:null}},H=K,X=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),$=(function(e){X(t,e);function t(n,i){var s=e.call(this)||this;return s.id=n,s.transport=i,s.activityTimeout=i.activityTimeout,s.bindListeners(),s}return t.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},t.prototype.send=function(n){return this.transport.send(n)},t.prototype.send_event=function(n,i,s){var u={event:n,data:i};return s&&(u.channel=s),mt.debug("Event sent",u),this.send(H.encodeMessage(u))},t.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},t.prototype.close=function(){this.transport.close()},t.prototype.bindListeners=function(){var n=this,i={message:function(u){var v;try{v=H.decodeMessage(u)}catch(P){n.emit("error",{type:"MessageParseError",error:P,data:u.data})}if(v!==void 0){switch(mt.debug("Event recd",v),v.event){case"pusher:error":n.emit("error",{type:"PusherError",data:v.data});break;case"pusher:ping":n.emit("ping");break;case"pusher:pong":n.emit("pong");break}n.emit("message",v)}},activity:function(){n.emit("activity")},error:function(u){n.emit("error",u)},closed:function(u){s(),u&&u.code&&n.handleCloseEvent(u),n.transport=null,n.emit("closed")}},s=function(){Yt(i,function(u,v){n.transport.unbind(v,u)})};Yt(i,function(u,v){n.transport.bind(v,u)})},t.prototype.handleCloseEvent=function(n){var i=H.getCloseAction(n),s=H.getCloseError(n);s&&this.emit("error",s),i&&this.emit(i,{action:i,error:s})},t})(Wt),W=$,j=(function(){function e(t,n){this.transport=t,this.callback=n,this.bindListeners()}return e.prototype.close=function(){this.unbindListeners(),this.transport.close()},e.prototype.bindListeners=function(){var t=this;this.onMessage=function(n){t.unbindListeners();var i;try{i=H.processHandshake(n)}catch(s){t.finish("error",{error:s}),t.transport.close();return}i.action==="connected"?t.finish("connected",{connection:new W(i.id,t.transport),activityTimeout:i.activityTimeout}):(t.finish(i.action,{error:i.error}),t.transport.close())},this.onClosed=function(n){t.unbindListeners();var i=H.getCloseAction(n)||"backoff",s=H.getCloseError(n);t.finish(i,{error:s})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},e.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},e.prototype.finish=function(t,n){this.callback(F({transport:this.transport,action:t},n))},e})(),M=j,k=(function(){function e(t,n){this.timeline=t,this.options=n||{}}return e.prototype.send=function(t,n){this.timeline.isEmpty()||this.timeline.send(rt.TimelineTransport.getAgent(this,t),n)},e})(),N=k,U=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),E=(function(e){U(t,e);function t(n,i){var s=e.call(this,function(u,v){mt.debug("No callbacks on "+n+" for "+u)})||this;return s.name=n,s.pusher=i,s.subscribed=!1,s.subscriptionPending=!1,s.subscriptionCancelled=!1,s}return t.prototype.authorize=function(n,i){return i(null,{auth:""})},t.prototype.trigger=function(n,i){if(n.indexOf("client-")!==0)throw new G("Event '"+n+"' does not start with 'client-'");if(!this.subscribed){var s=z.buildLogSuffix("triggeringClientEvents");mt.warn("Client event triggered before channel 'subscription_succeeded' event . "+s)}return this.pusher.send_event(n,i,this.name)},t.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},t.prototype.handleEvent=function(n){var i=n.event,s=n.data;if(i==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(n);else if(i==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(n);else if(i.indexOf("pusher_internal:")!==0){var u={};this.emit(i,s,u)}},t.prototype.handleSubscriptionSucceededEvent=function(n){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",n.data)},t.prototype.handleSubscriptionCountEvent=function(n){n.data.subscription_count&&(this.subscriptionCount=n.data.subscription_count),this.emit("pusher:subscription_count",n.data)},t.prototype.subscribe=function(){var n=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(i,s){i?(n.subscriptionPending=!1,mt.error(i.toString()),n.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:i.message},i instanceof Ut?{status:i.status}:{}))):n.pusher.send_event("pusher:subscribe",{auth:s.auth,channel_data:s.channel_data,channel:n.name})}))},t.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},t.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},t.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},t})(Wt),p=E,x=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),m=(function(e){x(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.authorize=function(n,i){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:n},i)},t})(p),g=m,b=(function(){function e(){this.reset()}return e.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},e.prototype.each=function(t){var n=this;Yt(this.members,function(i,s){t(n.get(s))})},e.prototype.setMyID=function(t){this.myID=t},e.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},e.prototype.addMember=function(t){return this.get(t.user_id)===null&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},e.prototype.removeMember=function(t){var n=this.get(t.user_id);return n&&(delete this.members[t.user_id],this.count--),n},e.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},e})(),w=b,D=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),V=function(e,t,n,i){function s(u){return u instanceof n?u:new n(function(v){v(u)})}return new(n||(n=Promise))(function(u,v){function P(ct){try{L(i.next(ct))}catch(jt){v(jt)}}function q(ct){try{L(i.throw(ct))}catch(jt){v(jt)}}function L(ct){ct.done?u(ct.value):s(ct.value).then(P,q)}L((i=i.apply(e,t||[])).next())})},Q=function(e,t){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},i,s,u,v;return v={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function P(L){return function(ct){return q([L,ct])}}function q(L){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,s&&(u=L[0]&2?s.return:L[0]?s.throw||((u=s.return)&&u.call(s),0):s.next)&&!(u=u.call(s,L[1])).done)return u;switch(s=0,u&&(L=[L[0]&2,u.value]),L[0]){case 0:case 1:u=L;break;case 4:return n.label++,{value:L[1],done:!1};case 5:n.label++,s=L[1],L=[0];continue;case 7:L=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(L[0]===6||L[0]===2)){n=0;continue}if(L[0]===3&&(!u||L[1]>u[0]&&L[1]<u[3])){n.label=L[1];break}if(L[0]===6&&n.label<u[1]){n.label=u[1],u=L;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(L);break}u[2]&&n.ops.pop(),n.trys.pop();continue}L=t.call(e,n)}catch(ct){L=[6,ct],s=0}finally{i=u=0}if(L[0]&5)throw L[1];return{value:L[0]?L[1]:void 0,done:!0}}},Z=(function(e){D(t,e);function t(n,i){var s=e.call(this,n,i)||this;return s.members=new w,s}return t.prototype.authorize=function(n,i){var s=this;e.prototype.authorize.call(this,n,function(u,v){return V(s,void 0,void 0,function(){var P,q;return Q(this,function(L){switch(L.label){case 0:return u?[3,3]:(v=v,v.channel_data==null?[3,1]:(P=JSON.parse(v.channel_data),this.members.setMyID(P.user_id),[3,3]));case 1:return[4,this.pusher.user.signinDonePromise];case 2:if(L.sent(),this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else return q=z.buildLogSuffix("authorizationEndpoint"),mt.error("Invalid auth response for channel '"+this.name+"', "+("expected 'channel_data' field. "+q+", ")+"or the user should be signed in."),i("Invalid auth response"),[2];L.label=3;case 3:return i(u,v),[2]}})})})},t.prototype.handleEvent=function(n){var i=n.event;if(i.indexOf("pusher_internal:")===0)this.handleInternalEvent(n);else{var s=n.data,u={};n.user_id&&(u.user_id=n.user_id),this.emit(i,s,u)}},t.prototype.handleInternalEvent=function(n){var i=n.event,s=n.data;switch(i){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(n);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(n);break;case"pusher_internal:member_added":var u=this.members.addMember(s);this.emit("pusher:member_added",u);break;case"pusher_internal:member_removed":var v=this.members.removeMember(s);v&&this.emit("pusher:member_removed",v);break}},t.prototype.handleSubscriptionSucceededEvent=function(n){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(n.data),this.emit("pusher:subscription_succeeded",this.members))},t.prototype.disconnect=function(){this.members.reset(),e.prototype.disconnect.call(this)},t})(g),h=Z,ot=pt(1),ft=pt(0),dt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),nt=(function(e){dt(t,e);function t(n,i,s){var u=e.call(this,n,i)||this;return u.key=null,u.nacl=s,u}return t.prototype.authorize=function(n,i){var s=this;e.prototype.authorize.call(this,n,function(u,v){if(u){i(u,v);return}var P=v.shared_secret;if(!P){i(new Error("No shared_secret key in auth payload for encrypted channel: "+s.name),null);return}s.key=Object(ft.decode)(P),delete v.shared_secret,i(null,v)})},t.prototype.trigger=function(n,i){throw new Jt("Client events are not currently supported for encrypted channels")},t.prototype.handleEvent=function(n){var i=n.event,s=n.data;if(i.indexOf("pusher_internal:")===0||i.indexOf("pusher:")===0){e.prototype.handleEvent.call(this,n);return}this.handleEncryptedEvent(i,s)},t.prototype.handleEncryptedEvent=function(n,i){var s=this;if(!this.key){mt.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!i.ciphertext||!i.nonce){mt.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+i);return}var u=Object(ft.decode)(i.ciphertext);if(u.length<this.nacl.secretbox.overheadLength){mt.error("Expected encrypted event ciphertext length to be "+this.nacl.secretbox.overheadLength+", got: "+u.length);return}var v=Object(ft.decode)(i.nonce);if(v.length<this.nacl.secretbox.nonceLength){mt.error("Expected encrypted event nonce length to be "+this.nacl.secretbox.nonceLength+", got: "+v.length);return}var P=this.nacl.secretbox.open(u,v,this.key);if(P===null){mt.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,function(q,L){if(q){mt.error("Failed to make a request to the authEndpoint: "+L+". Unable to fetch new key, so dropping encrypted event");return}if(P=s.nacl.secretbox.open(u,v,s.key),P===null){mt.error("Failed to decrypt event with new key. Dropping encrypted event");return}s.emit(n,s.getDataToEmit(P))});return}this.emit(n,this.getDataToEmit(P))},t.prototype.getDataToEmit=function(n){var i=Object(ot.decode)(n);try{return JSON.parse(i)}catch{return i}},t})(g),ut=nt,ht=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),Lt=(function(e){ht(t,e);function t(n,i){var s=e.call(this)||this;s.state="initialized",s.connection=null,s.key=n,s.options=i,s.timeline=s.options.timeline,s.usingTLS=s.options.useTLS,s.errorCallbacks=s.buildErrorCallbacks(),s.connectionCallbacks=s.buildConnectionCallbacks(s.errorCallbacks),s.handshakeCallbacks=s.buildHandshakeCallbacks(s.errorCallbacks);var u=rt.getNetwork();return u.bind("online",function(){s.timeline.info({netinfo:"online"}),(s.state==="connecting"||s.state==="unavailable")&&s.retryIn(0)}),u.bind("offline",function(){s.timeline.info({netinfo:"offline"}),s.connection&&s.sendActivityCheck()}),s.updateStrategy(),s}return t.prototype.connect=function(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}},t.prototype.send=function(n){return this.connection?this.connection.send(n):!1},t.prototype.send_event=function(n,i,s){return this.connection?this.connection.send_event(n,i,s):!1},t.prototype.disconnect=function(){this.disconnectInternally(),this.updateState("disconnected")},t.prototype.isUsingTLS=function(){return this.usingTLS},t.prototype.startConnecting=function(){var n=this,i=function(s,u){s?n.runner=n.strategy.connect(0,i):u.action==="error"?(n.emit("error",{type:"HandshakeError",error:u.error}),n.timeline.error({handshakeError:u.error})):(n.abortConnecting(),n.handshakeCallbacks[u.action](u))};this.runner=this.strategy.connect(0,i)},t.prototype.abortConnecting=function(){this.runner&&(this.runner.abort(),this.runner=null)},t.prototype.disconnectInternally=function(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var n=this.abandonConnection();n.close()}},t.prototype.updateStrategy=function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})},t.prototype.retryIn=function(n){var i=this;this.timeline.info({action:"retry",delay:n}),n>0&&this.emit("connecting_in",Math.round(n/1e3)),this.retryTimer=new Kt(n||0,function(){i.disconnectInternally(),i.connect()})},t.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},t.prototype.setUnavailableTimer=function(){var n=this;this.unavailableTimer=new Kt(this.options.unavailableTimeout,function(){n.updateState("unavailable")})},t.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},t.prototype.sendActivityCheck=function(){var n=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Kt(this.options.pongTimeout,function(){n.timeline.error({pong_timed_out:n.options.pongTimeout}),n.retryIn(0)})},t.prototype.resetActivityCheck=function(){var n=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new Kt(this.activityTimeout,function(){n.sendActivityCheck()}))},t.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},t.prototype.buildConnectionCallbacks=function(n){var i=this;return F({},n,{message:function(s){i.resetActivityCheck(),i.emit("message",s)},ping:function(){i.send_event("pusher:pong",{})},activity:function(){i.resetActivityCheck()},error:function(s){i.emit("error",s)},closed:function(){i.abandonConnection(),i.shouldRetry()&&i.retryIn(1e3)}})},t.prototype.buildHandshakeCallbacks=function(n){var i=this;return F({},n,{connected:function(s){i.activityTimeout=Math.min(i.options.activityTimeout,s.activityTimeout,s.connection.activityTimeout||1/0),i.clearUnavailableTimer(),i.setConnection(s.connection),i.socket_id=i.connection.id,i.updateState("connected",{socket_id:i.socket_id})}})},t.prototype.buildErrorCallbacks=function(){var n=this,i=function(s){return function(u){u.error&&n.emit("error",{type:"WebSocketError",error:u.error}),s(u)}};return{tls_only:i(function(){n.usingTLS=!0,n.updateStrategy(),n.retryIn(0)}),refused:i(function(){n.disconnect()}),backoff:i(function(){n.retryIn(1e3)}),retry:i(function(){n.retryIn(0)})}},t.prototype.setConnection=function(n){this.connection=n;for(var i in this.connectionCallbacks)this.connection.bind(i,this.connectionCallbacks[i]);this.resetActivityCheck()},t.prototype.abandonConnection=function(){if(this.connection){this.stopActivityCheck();for(var n in this.connectionCallbacks)this.connection.unbind(n,this.connectionCallbacks[n]);var i=this.connection;return this.connection=null,i}},t.prototype.updateState=function(n,i){var s=this.state;if(this.state=n,s!==n){var u=n;u==="connected"&&(u+=" with new socket ID "+i.socket_id),mt.debug("State changed",s+" -> "+u),this.timeline.info({state:n,params:i}),this.emit("state_change",{previous:s,current:n}),this.emit(n,i)}},t.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},t})(Wt),_t=Lt,At=(function(){function e(){this.channels={}}return e.prototype.add=function(t,n){return this.channels[t]||(this.channels[t]=Ot(t,n)),this.channels[t]},e.prototype.all=function(){return me(this.channels)},e.prototype.find=function(t){return this.channels[t]},e.prototype.remove=function(t){var n=this.channels[t];return delete this.channels[t],n},e.prototype.disconnect=function(){Yt(this.channels,function(t){t.disconnect()})},e})(),Et=At;function Ot(e,t){if(e.indexOf("private-encrypted-")===0){if(t.config.nacl)return Tt.createEncryptedChannel(e,t,t.config.nacl);var n="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",i=z.buildLogSuffix("encryptedChannelSupport");throw new Jt(n+". "+i)}else{if(e.indexOf("private-")===0)return Tt.createPrivateChannel(e,t);if(e.indexOf("presence-")===0)return Tt.createPresenceChannel(e,t);if(e.indexOf("#")===0)throw new B('Cannot create a channel with name "'+e+'".');return Tt.createChannel(e,t)}}var Rt={createChannels:function(){return new Et},createConnectionManager:function(e,t){return new _t(e,t)},createChannel:function(e,t){return new p(e,t)},createPrivateChannel:function(e,t){return new g(e,t)},createPresenceChannel:function(e,t){return new h(e,t)},createEncryptedChannel:function(e,t,n){return new ut(e,t,n)},createTimelineSender:function(e,t){return new N(e,t)},createHandshake:function(e,t){return new M(e,t)},createAssistantToTheTransportManager:function(e,t,n){return new J(e,t,n)}},Tt=Rt,It=(function(){function e(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return e.prototype.getAssistant=function(t){return Tt.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},e.prototype.isAlive=function(){return this.livesLeft>0},e.prototype.reportDeath=function(){this.livesLeft-=1},e})(),Nt=It,Bn=(function(){function e(t,n){this.strategies=t,this.loop=!!n.loop,this.failFast=!!n.failFast,this.timeout=n.timeout,this.timeoutLimit=n.timeoutLimit}return e.prototype.isSupported=function(){return Ne(this.strategies,wt.method("isSupported"))},e.prototype.connect=function(t,n){var i=this,s=this.strategies,u=0,v=this.timeout,P=null,q=function(L,ct){ct?n(null,ct):(u=u+1,i.loop&&(u=u%s.length),u<s.length?(v&&(v=v*2,i.timeoutLimit&&(v=Math.min(v,i.timeoutLimit))),P=i.tryStrategy(s[u],t,{timeout:v,failFast:i.failFast},q)):n(!0))};return P=this.tryStrategy(s[u],t,{timeout:v,failFast:this.failFast},q),{abort:function(){P.abort()},forceMinPriority:function(L){t=L,P&&P.forceMinPriority(L)}}},e.prototype.tryStrategy=function(t,n,i,s){var u=null,v=null;return i.timeout>0&&(u=new Kt(i.timeout,function(){v.abort(),s(!0)})),v=t.connect(n,function(P,q){P&&u&&u.isRunning()&&!i.failFast||(u&&u.ensureAborted(),s(P,q))}),{abort:function(){u&&u.ensureAborted(),v.abort()},forceMinPriority:function(P){v.forceMinPriority(P)}}},e})(),ye=Bn,Dn=(function(){function e(t){this.strategies=t}return e.prototype.isSupported=function(){return Ne(this.strategies,wt.method("isSupported"))},e.prototype.connect=function(t,n){return qn(this.strategies,t,function(i,s){return function(u,v){if(s[i].error=u,u){zn(s)&&n(!0);return}fe(s,function(P){P.forceMinPriority(v.transport.priority)}),n(null,v)}})},e})(),hn=Dn;function qn(e,t,n){var i=de(e,function(s,u,v,P){return s.connect(t,n(u,P))});return{abort:function(){fe(i,Hn)},forceMinPriority:function(s){fe(i,function(u){u.forceMinPriority(s)})}}}function zn(e){return tn(e,function(t){return!!t.error})}function Hn(e){!e.error&&!e.aborted&&(e.abort(),e.aborted=!0)}var Fn=(function(){function e(t,n,i){this.strategy=t,this.transports=n,this.ttl=i.ttl||1800*1e3,this.usingTLS=i.useTLS,this.timeline=i.timeline}return e.prototype.isSupported=function(){return this.strategy.isSupported()},e.prototype.connect=function(t,n){var i=this.usingTLS,s=Jn(i),u=[this.strategy];if(s&&s.timestamp+this.ttl>=wt.now()){var v=this.transports[s.transport];v&&(this.timeline.info({cached:!0,transport:s.transport,latency:s.latency}),u.push(new ye([v],{timeout:s.latency*2+1e3,failFast:!0})))}var P=wt.now(),q=u.pop().connect(t,function L(ct,jt){ct?(bn(i),u.length>0?(P=wt.now(),q=u.pop().connect(t,L)):n(ct)):(Xn(i,jt.transport.name,wt.now()-P),n(null,jt))});return{abort:function(){q.abort()},forceMinPriority:function(L){t=L,q&&q.forceMinPriority(L)}}},e})(),Yn=Fn;function ln(e){return"pusherTransport"+(e?"TLS":"NonTLS")}function Jn(e){var t=rt.getLocalStorage();if(t)try{var n=t[ln(e)];if(n)return JSON.parse(n)}catch{bn(e)}return null}function Xn(e,t,n){var i=rt.getLocalStorage();if(i)try{i[ln(e)]=ce({timestamp:wt.now(),transport:t,latency:n})}catch{}}function bn(e){var t=rt.getLocalStorage();if(t)try{delete t[ln(e)]}catch{}}var Wn=(function(){function e(t,n){var i=n.delay;this.strategy=t,this.options={delay:i}}return e.prototype.isSupported=function(){return this.strategy.isSupported()},e.prototype.connect=function(t,n){var i=this.strategy,s,u=new Kt(this.options.delay,function(){s=i.connect(t,n)});return{abort:function(){u.ensureAborted(),s&&s.abort()},forceMinPriority:function(v){t=v,s&&s.forceMinPriority(v)}}},e})(),sn=Wn,$n=(function(){function e(t,n,i){this.test=t,this.trueBranch=n,this.falseBranch=i}return e.prototype.isSupported=function(){var t=this.test()?this.trueBranch:this.falseBranch;return t.isSupported()},e.prototype.connect=function(t,n){var i=this.test()?this.trueBranch:this.falseBranch;return i.connect(t,n)},e})(),Ye=$n,Gn=(function(){function e(t){this.strategy=t}return e.prototype.isSupported=function(){return this.strategy.isSupported()},e.prototype.connect=function(t,n){var i=this.strategy.connect(t,function(s,u){u&&i.abort(),n(s,u)});return i},e})(),Kn=Gn;function Je(e){return function(){return e.isSupported()}}var Vn=function(e,t,n){var i={};function s(jn,ai,fi,ci,ui){var Nn=n(e,jn,ai,fi,ci,ui);return i[jn]=Nn,Nn}var u=Object.assign({},t,{hostNonTLS:e.wsHost+":"+e.wsPort,hostTLS:e.wsHost+":"+e.wssPort,httpPath:e.wsPath}),v=Object.assign({},u,{useTLS:!0}),P=Object.assign({},t,{hostNonTLS:e.httpHost+":"+e.httpPort,hostTLS:e.httpHost+":"+e.httpsPort,httpPath:e.httpPath}),q={loop:!0,timeout:15e3,timeoutLimit:6e4},L=new Nt({lives:2,minPingDelay:1e4,maxPingDelay:e.activityTimeout}),ct=new Nt({lives:2,minPingDelay:1e4,maxPingDelay:e.activityTimeout}),jt=s("ws","ws",3,u,L),Qt=s("wss","ws",3,v,L),ni=s("sockjs","sockjs",1,P),An=s("xhr_streaming","xhr_streaming",1,P,ct),ri=s("xdr_streaming","xdr_streaming",1,P,ct),En=s("xhr_polling","xhr_polling",1,P),ii=s("xdr_polling","xdr_polling",1,P),On=new ye([jt],q),oi=new ye([Qt],q),si=new ye([ni],q),kn=new ye([new Ye(Je(An),An,ri)],q),Ln=new ye([new Ye(Je(En),En,ii)],q),Rn=new ye([new Ye(Je(kn),new hn([kn,new sn(Ln,{delay:4e3})]),Ln)],q),xn=new Ye(Je(Rn),Rn,si),vn;return t.useTLS?vn=new hn([On,new sn(xn,{delay:2e3})]):vn=new hn([On,new sn(oi,{delay:2e3}),new sn(xn,{delay:5e3})]),new Yn(new Kn(new Ye(Je(jt),vn,xn)),i,{ttl:18e5,timeline:t.timeline,useTLS:t.useTLS})},Zn=Vn,Qn=(function(){var e=this;e.timeline.info(e.buildTimelineMessage({transport:e.name+(e.options.useTLS?"s":"")})),e.hooks.isInitialized()?e.changeState("initialized"):e.hooks.file?(e.changeState("initializing"),st.load(e.hooks.file,{useTLS:e.options.useTLS},function(t,n){e.hooks.isInitialized()?(e.changeState("initialized"),n(!0)):(t&&e.onError(t),e.onClose(),n(!1))})):e.onClose()}),tr={getRequest:function(e){var t=new window.XDomainRequest;return t.ontimeout=function(){e.emit("error",new Ct),e.close()},t.onerror=function(n){e.emit("error",n),e.close()},t.onprogress=function(){t.responseText&&t.responseText.length>0&&e.onChunk(200,t.responseText)},t.onload=function(){t.responseText&&t.responseText.length>0&&e.onChunk(200,t.responseText),e.emit("finished",200),e.close()},t},abortRequest:function(e){e.ontimeout=e.onerror=e.onprogress=e.onload=null,e.abort()}},er=tr,nr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),rr=256*1024,ir=(function(e){nr(t,e);function t(n,i,s){var u=e.call(this)||this;return u.hooks=n,u.method=i,u.url=s,u}return t.prototype.start=function(n){var i=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){i.close()},rt.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(n)},t.prototype.close=function(){this.unloader&&(rt.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},t.prototype.onChunk=function(n,i){for(;;){var s=this.advanceBuffer(i);if(s)this.emit("chunk",{status:n,data:s});else break}this.isBufferTooLong(i)&&this.emit("buffer_too_long")},t.prototype.advanceBuffer=function(n){var i=n.slice(this.position),s=i.indexOf(`
|
|
2
|
+
`);return s!==-1?(this.position+=s+1,i.slice(0,s)):null},t.prototype.isBufferTooLong=function(n){return this.position===n.length&&n.length>rr},t})(Wt),or=ir,dn;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSED=3]="CLOSED"})(dn||(dn={}));var ge=dn,sr=1,ar=(function(){function e(t,n){this.hooks=t,this.session=wn(1e3)+"/"+hr(8),this.location=fr(n),this.readyState=ge.CONNECTING,this.openStream()}return e.prototype.send=function(t){return this.sendRaw(JSON.stringify([t]))},e.prototype.ping=function(){this.hooks.sendHeartbeat(this)},e.prototype.close=function(t,n){this.onClose(t,n,!0)},e.prototype.sendRaw=function(t){if(this.readyState===ge.OPEN)try{return rt.createSocketRequest("POST",mn(cr(this.location,this.session))).start(t),!0}catch{return!1}else return!1},e.prototype.reconnect=function(){this.closeStream(),this.openStream()},e.prototype.onClose=function(t,n,i){this.closeStream(),this.readyState=ge.CLOSED,this.onclose&&this.onclose({code:t,reason:n,wasClean:i})},e.prototype.onChunk=function(t){if(t.status===200){this.readyState===ge.OPEN&&this.onActivity();var n,i=t.data.slice(0,1);switch(i){case"o":n=JSON.parse(t.data.slice(1)||"{}"),this.onOpen(n);break;case"a":n=JSON.parse(t.data.slice(1)||"[]");for(var s=0;s<n.length;s++)this.onEvent(n[s]);break;case"m":n=JSON.parse(t.data.slice(1)||"null"),this.onEvent(n);break;case"h":this.hooks.onHeartbeat(this);break;case"c":n=JSON.parse(t.data.slice(1)||"[]"),this.onClose(n[0],n[1],!0);break}}},e.prototype.onOpen=function(t){this.readyState===ge.CONNECTING?(t&&t.hostname&&(this.location.base=ur(this.location.base,t.hostname)),this.readyState=ge.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)},e.prototype.onEvent=function(t){this.readyState===ge.OPEN&&this.onmessage&&this.onmessage({data:t})},e.prototype.onActivity=function(){this.onactivity&&this.onactivity()},e.prototype.onError=function(t){this.onerror&&this.onerror(t)},e.prototype.openStream=function(){var t=this;this.stream=rt.createSocketRequest("POST",mn(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",function(n){t.onChunk(n)}),this.stream.bind("finished",function(n){t.hooks.onFinished(t,n)}),this.stream.bind("buffer_too_long",function(){t.reconnect()});try{this.stream.start()}catch(n){wt.defer(function(){t.onError(n),t.onClose(1006,"Could not start streaming",!1)})}},e.prototype.closeStream=function(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)},e})();function fr(e){var t=/([^\?]*)\/*(\??.*)/.exec(e);return{base:t[1],queryString:t[2]}}function cr(e,t){return e.base+"/"+t+"/xhr_send"}function mn(e){var t=e.indexOf("?")===-1?"?":"&";return e+t+"t="+ +new Date+"&n="+sr++}function ur(e,t){var n=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(e);return n[1]+t+n[3]}function wn(e){return rt.randomInt(e)}function hr(e){for(var t=[],n=0;n<e;n++)t.push(wn(32).toString(32));return t.join("")}var lr=ar,dr={getReceiveURL:function(e,t){return e.base+"/"+t+"/xhr_streaming"+e.queryString},onHeartbeat:function(e){e.sendRaw("[]")},sendHeartbeat:function(e){e.sendRaw("[]")},onFinished:function(e,t){e.onClose(1006,"Connection interrupted ("+t+")",!1)}},pr=dr,xr={getReceiveURL:function(e,t){return e.base+"/"+t+"/xhr"+e.queryString},onHeartbeat:function(){},sendHeartbeat:function(e){e.sendRaw("[]")},onFinished:function(e,t){t===200?e.reconnect():e.onClose(1006,"Connection interrupted ("+t+")",!1)}},vr=xr,yr={getRequest:function(e){var t=rt.getXHRAPI(),n=new t;return n.onreadystatechange=n.onprogress=function(){switch(n.readyState){case 3:n.responseText&&n.responseText.length>0&&e.onChunk(n.status,n.responseText);break;case 4:n.responseText&&n.responseText.length>0&&e.onChunk(n.status,n.responseText),e.emit("finished",n.status),e.close();break}},n},abortRequest:function(e){e.onreadystatechange=null,e.abort()}},gr=yr,_r={createStreamingSocket:function(e){return this.createSocket(pr,e)},createPollingSocket:function(e){return this.createSocket(vr,e)},createSocket:function(e,t){return new lr(e,t)},createXHR:function(e,t){return this.createRequest(gr,e,t)},createRequest:function(e,t,n){return new or(e,t,n)}},Sn=_r;Sn.createXDR=function(e,t){return this.createRequest(er,e,t)};var br=Sn,mr={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:y,DependenciesReceivers:vt,getDefaultStrategy:Zn,Transports:I,transportConnectionInitializer:Qn,HTTPFactory:br,TimelineTransport:Ce,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(e){var t=this;window.Pusher=e;var n=function(){t.onDocumentBody(e.ready)};window.JSON?n():st.load("json2",{},n)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:We,jsonp:Se}},onDocumentBody:function(e){var t=this;document.body?e():setTimeout(function(){t.onDocumentBody(e)},0)},createJSONPRequest:function(e,t){return new cn(e,t)},createScriptRequest:function(e){return new Be(e)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){var e=this.getXHRAPI();return new e},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return R},createWebSocket:function(e){var t=this.getWebSocketAPI();return new t(e)},createSocketRequest:function(e,t){if(this.isXHRSupported())return this.HTTPFactory.createXHR(e,t);if(this.isXDRSupported(t.indexOf("https:")===0))return this.HTTPFactory.createXDR(e,t);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var e=this.getXHRAPI();return!!e&&new e().withCredentials!==void 0},isXDRSupported:function(e){var t=e?"https:":"http:",n=this.getProtocol();return!!window.XDomainRequest&&n===t},addUnloadListener:function(e){window.addEventListener!==void 0?window.addEventListener("unload",e,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",e)},removeUnloadListener:function(e){window.addEventListener!==void 0?window.removeEventListener("unload",e,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",e)},randomInt:function(e){var t=function(){var n=window.crypto||window.msCrypto,i=n.getRandomValues(new Uint32Array(1))[0];return i/Math.pow(2,32)};return Math.floor(t()*e)}},rt=mr,pn;(function(e){e[e.ERROR=3]="ERROR",e[e.INFO=6]="INFO",e[e.DEBUG=7]="DEBUG"})(pn||(pn={}));var an=pn,wr=(function(){function e(t,n,i){this.key=t,this.session=n,this.events=[],this.options=i||{},this.sent=0,this.uniqueID=0}return e.prototype.log=function(t,n){t<=this.options.level&&(this.events.push(F({},n,{timestamp:wt.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},e.prototype.error=function(t){this.log(an.ERROR,t)},e.prototype.info=function(t){this.log(an.INFO,t)},e.prototype.debug=function(t){this.log(an.DEBUG,t)},e.prototype.isEmpty=function(){return this.events.length===0},e.prototype.send=function(t,n){var i=this,s=F({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(s,function(u,v){u||i.sent++,n&&n(u,v)}),!0},e.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},e})(),Sr=wr,Cr=(function(){function e(t,n,i,s){this.name=t,this.priority=n,this.transport=i,this.options=s||{}}return e.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},e.prototype.connect=function(t,n){var i=this;if(this.isSupported()){if(this.priority<t)return Cn(new it,n)}else return Cn(new Bt,n);var s=!1,u=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),v=null,P=function(){u.unbind("initialized",P),u.connect()},q=function(){v=Tt.createHandshake(u,function(Qt){s=!0,jt(),n(null,Qt)})},L=function(Qt){jt(),n(Qt)},ct=function(){jt();var Qt;Qt=ce(u),n(new Ht(Qt))},jt=function(){u.unbind("initialized",P),u.unbind("open",q),u.unbind("error",L),u.unbind("closed",ct)};return u.bind("initialized",P),u.bind("open",q),u.bind("error",L),u.bind("closed",ct),u.initialize(),{abort:function(){s||(jt(),v?v.close():u.close())},forceMinPriority:function(Qt){s||i.priority<Qt&&(v?v.close():u.close())}}},e})(),Tr=Cr;function Cn(e,t){return wt.defer(function(){t(e)}),{abort:function(){},forceMinPriority:function(){}}}var Pr=rt.Transports,Ar=function(e,t,n,i,s,u){var v=Pr[n];if(!v)throw new qt(n);var P=(!e.enabledTransports||je(e.enabledTransports,t)!==-1)&&(!e.disabledTransports||je(e.disabledTransports,t)===-1),q;return P?(s=Object.assign({ignoreNullOrigin:e.ignoreNullOrigin},s),q=new Tr(t,i,u?u.getAssistant(v):v,s)):q=Er,q},Er={isSupported:function(){return!1},connect:function(e,t){var n=wt.defer(function(){t(new Bt)});return{abort:function(){n.ensureAborted()},forceMinPriority:function(){}}}},Or=function(e,t){var n="socket_id="+encodeURIComponent(e.socketId);for(var i in t.params)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t.params[i]);if(t.paramsProvider!=null){var s=t.paramsProvider();for(var i in s)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(s[i])}return n},kr=function(e){if(typeof rt.getAuthorizers()[e.transport]>"u")throw"'"+e.transport+"' is not a recognized auth transport";return function(t,n){var i=Or(t,e);rt.getAuthorizers()[e.transport](rt,i,e,T.UserAuthentication,n)}},Lr=kr,Rr=function(e,t){var n="socket_id="+encodeURIComponent(e.socketId);n+="&channel_name="+encodeURIComponent(e.channelName);for(var i in t.params)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t.params[i]);if(t.paramsProvider!=null){var s=t.paramsProvider();for(var i in s)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(s[i])}return n},jr=function(e){if(typeof rt.getAuthorizers()[e.transport]>"u")throw"'"+e.transport+"' is not a recognized auth transport";return function(t,n){var i=Rr(t,e);rt.getAuthorizers()[e.transport](rt,i,e,T.ChannelAuthorization,n)}},Nr=jr,Ur=function(e,t,n){var i={authTransport:t.transport,authEndpoint:t.endpoint,auth:{params:t.params,headers:t.headers}};return function(s,u){var v=e.channel(s.channelName),P=n(v,i);P.authorize(s.socketId,u)}},Ae=function(){return Ae=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Ae.apply(this,arguments)};function Ir(e,t){var n={activityTimeout:e.activityTimeout||tt.activityTimeout,cluster:e.cluster||tt.cluster,httpPath:e.httpPath||tt.httpPath,httpPort:e.httpPort||tt.httpPort,httpsPort:e.httpsPort||tt.httpsPort,pongTimeout:e.pongTimeout||tt.pongTimeout,statsHost:e.statsHost||tt.stats_host,unavailableTimeout:e.unavailableTimeout||tt.unavailableTimeout,wsPath:e.wsPath||tt.wsPath,wsPort:e.wsPort||tt.wsPort,wssPort:e.wssPort||tt.wssPort,enableStats:qr(e),httpHost:Mr(e),useTLS:Dr(e),wsHost:Br(e),userAuthenticator:zr(e),channelAuthorizer:Fr(e,t)};return"disabledTransports"in e&&(n.disabledTransports=e.disabledTransports),"enabledTransports"in e&&(n.enabledTransports=e.enabledTransports),"ignoreNullOrigin"in e&&(n.ignoreNullOrigin=e.ignoreNullOrigin),"timelineParams"in e&&(n.timelineParams=e.timelineParams),"nacl"in e&&(n.nacl=e.nacl),n}function Mr(e){return e.httpHost?e.httpHost:e.cluster?"sockjs-"+e.cluster+".pusher.com":tt.httpHost}function Br(e){return e.wsHost?e.wsHost:e.cluster?Tn(e.cluster):Tn(tt.cluster)}function Tn(e){return"ws-"+e+".pusher.com"}function Dr(e){return rt.getProtocol()==="https:"?!0:e.forceTLS!==!1}function qr(e){return"enableStats"in e?e.enableStats:"disableStats"in e?!e.disableStats:!1}function zr(e){var t=Ae(Ae({},tt.userAuthentication),e.userAuthentication);return"customHandler"in t&&t.customHandler!=null?t.customHandler:Lr(t)}function Hr(e,t){var n;return"channelAuthorization"in e?n=Ae(Ae({},tt.channelAuthorization),e.channelAuthorization):(n={transport:e.authTransport||tt.authTransport,endpoint:e.authEndpoint||tt.authEndpoint},"auth"in e&&("params"in e.auth&&(n.params=e.auth.params),"headers"in e.auth&&(n.headers=e.auth.headers)),"authorizer"in e&&(n.customHandler=Ur(t,n,e.authorizer))),n}function Fr(e,t){var n=Hr(e,t);return"customHandler"in n&&n.customHandler!=null?n.customHandler:Nr(n)}var Yr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),Jr=(function(e){Yr(t,e);function t(n){var i=e.call(this,function(s,u){mt.debug("No callbacks on watchlist events for "+s)})||this;return i.pusher=n,i.bindWatchlistInternalEvent(),i}return t.prototype.handleEvent=function(n){var i=this;n.data.events.forEach(function(s){i.emit(s.name,s)})},t.prototype.bindWatchlistInternalEvent=function(){var n=this;this.pusher.connection.bind("message",function(i){var s=i.event;s==="pusher_internal:watchlist_events"&&n.handleEvent(i)})},t})(Wt),Xr=Jr;function Wr(){var e,t,n=new Promise(function(i,s){e=i,t=s});return{promise:n,resolve:e,reject:t}}var $r=Wr,Gr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),Kr=(function(e){Gr(t,e);function t(n){var i=e.call(this,function(s,u){mt.debug("No callbacks on user for "+s)})||this;return i.signin_requested=!1,i.user_data=null,i.serverToUserChannel=null,i.signinDonePromise=null,i._signinDoneResolve=null,i._onAuthorize=function(s,u){if(s){mt.warn("Error during signin: "+s),i._cleanup();return}i.pusher.send_event("pusher:signin",{auth:u.auth,user_data:u.user_data})},i.pusher=n,i.pusher.connection.bind("state_change",function(s){var u=s.previous,v=s.current;u!=="connected"&&v==="connected"&&i._signin(),u==="connected"&&v!=="connected"&&(i._cleanup(),i._newSigninPromiseIfNeeded())}),i.watchlist=new Xr(n),i.pusher.connection.bind("message",function(s){var u=s.event;u==="pusher:signin_success"&&i._onSigninSuccess(s.data),i.serverToUserChannel&&i.serverToUserChannel.name===s.channel&&i.serverToUserChannel.handleEvent(s)}),i}return t.prototype.signin=function(){this.signin_requested||(this.signin_requested=!0,this._signin())},t.prototype._signin=function(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))},t.prototype._onSigninSuccess=function(n){try{this.user_data=JSON.parse(n.user_data)}catch{mt.error("Failed parsing user data after signin: "+n.user_data),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){mt.error("user_data doesn't contain an id. user_data: "+this.user_data),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()},t.prototype._subscribeChannels=function(){var n=this,i=function(s){s.subscriptionPending&&s.subscriptionCancelled?s.reinstateSubscription():!s.subscriptionPending&&n.pusher.connection.state==="connected"&&s.subscribe()};this.serverToUserChannel=new p("#server-to-user-"+this.user_data.id,this.pusher),this.serverToUserChannel.bind_global(function(s,u){s.indexOf("pusher_internal:")===0||s.indexOf("pusher:")===0||n.emit(s,u)}),i(this.serverToUserChannel)},t.prototype._cleanup=function(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()},t.prototype._newSigninPromiseIfNeeded=function(){if(this.signin_requested&&!(this.signinDonePromise&&!this.signinDonePromise.done)){var n=$r(),i=n.promise,s=n.resolve;i.done=!1;var u=function(){i.done=!0};i.then(u).catch(u),this.signinDonePromise=i,this._signinDoneResolve=s}},t})(Wt),Vr=Kr,Pn=(function(){function e(t,n){var i=this;if(Zr(t),n=n||{},!n.cluster&&!(n.wsHost||n.httpHost)){var s=z.buildLogSuffix("javascriptQuickStart");mt.warn("You should always specify a cluster when connecting. "+s)}"disableStats"in n&&mt.warn("The disableStats option is deprecated in favor of enableStats"),this.key=t,this.config=Ir(n,this),this.channels=Tt.createChannels(),this.global_emitter=new Wt,this.sessionID=rt.randomInt(1e9),this.timeline=new Sr(this.key,this.sessionID,{cluster:this.config.cluster,features:e.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:an.INFO,version:tt.VERSION}),this.config.enableStats&&(this.timelineSender=Tt.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+rt.TimelineTransport.name}));var u=function(v){return rt.getDefaultStrategy(i.config,v,Ar)};this.connection=Tt.createConnectionManager(this.key,{getStrategy:u,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",function(){i.subscribeAll(),i.timelineSender&&i.timelineSender.send(i.connection.isUsingTLS())}),this.connection.bind("message",function(v){var P=v.event,q=P.indexOf("pusher_internal:")===0;if(v.channel){var L=i.channel(v.channel);L&&L.handleEvent(v)}q||i.global_emitter.emit(v.event,v.data)}),this.connection.bind("connecting",function(){i.channels.disconnect()}),this.connection.bind("disconnected",function(){i.channels.disconnect()}),this.connection.bind("error",function(v){mt.warn(v)}),e.instances.push(this),this.timeline.info({instances:e.instances.length}),this.user=new Vr(this),e.isReady&&this.connect()}return e.ready=function(){e.isReady=!0;for(var t=0,n=e.instances.length;t<n;t++)e.instances[t].connect()},e.getClientFeatures=function(){return le(Qe({ws:rt.Transports.ws},function(t){return t.isSupported({})}))},e.prototype.channel=function(t){return this.channels.find(t)},e.prototype.allChannels=function(){return this.channels.all()},e.prototype.connect=function(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var t=this.connection.isUsingTLS(),n=this.timelineSender;this.timelineSenderTimer=new Re(6e4,function(){n.send(t)})}},e.prototype.disconnect=function(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)},e.prototype.bind=function(t,n,i){return this.global_emitter.bind(t,n,i),this},e.prototype.unbind=function(t,n,i){return this.global_emitter.unbind(t,n,i),this},e.prototype.bind_global=function(t){return this.global_emitter.bind_global(t),this},e.prototype.unbind_global=function(t){return this.global_emitter.unbind_global(t),this},e.prototype.unbind_all=function(t){return this.global_emitter.unbind_all(),this},e.prototype.subscribeAll=function(){var t;for(t in this.channels.channels)this.channels.channels.hasOwnProperty(t)&&this.subscribe(t)},e.prototype.subscribe=function(t){var n=this.channels.add(t,this);return n.subscriptionPending&&n.subscriptionCancelled?n.reinstateSubscription():!n.subscriptionPending&&this.connection.state==="connected"&&n.subscribe(),n},e.prototype.unsubscribe=function(t){var n=this.channels.find(t);n&&n.subscriptionPending?n.cancelSubscription():(n=this.channels.remove(t),n&&n.subscribed&&n.unsubscribe())},e.prototype.send_event=function(t,n,i){return this.connection.send_event(t,n,i)},e.prototype.shouldUseTLS=function(){return this.config.useTLS},e.prototype.signin=function(){this.user.signin()},e.instances=[],e.isReady=!1,e.logToConsole=!1,e.Runtime=rt,e.ScriptReceivers=rt.ScriptReceivers,e.DependenciesReceivers=rt.DependenciesReceivers,e.auth_callbacks=rt.auth_callbacks,e})(),Ee=Pn;function Zr(e){if(e==null)throw"You must pass your app key when you instantiate Pusher."}rt.setup(Pn);var Qr=pt(2),ti=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var u in s)s.hasOwnProperty(u)&&(i[u]=s[u])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})(),ei=(function(e){ti(t,e);function t(n,i){var s=this;return Ee.logToConsole=t.logToConsole,Ee.log=t.log,i=i||{},i.nacl=Qr,s=e.call(this,n,i)||this,s}return t})(Ee);at.default=ei})])})})(yn)),yn.exports}var gn,In;function _i(){return In||(In=1,gn=gi()),gn}var bi=_i();const mi=yi(bi),_n=`${Mt.BASE_URL}/api/notification`,wi=St=>Mt.api.get(_n,{params:{...St}}),Si=St=>Mt.api.put(`${_n}/${St}`),Ci=()=>Mt.api.put(`${_n}/updateAllStatus`),Ti={currentPage:1,pageSize:30,searchString:"",isRead:!1},Pi="Notification list",Mn="NOTIFICATION_CHANNEL",Ai="NEW_NOTIFICATION",Ei=()=>{const St=_e.useDispatch(),{roles:se}=li.useParams(),kt=_e.useSelector(B=>B.common.user),at=kt?.id,pt=kt?.studentId,S=_e.useSelector(B=>B.notification.notificationList),y=_e.useSelector(B=>B.common.user.pusherKey),Pt=_e.useSelector(B=>B.common.user.pusherCluster),tt=_e.useSelector(B=>B.notification.totalItems),gt=_e.useSelector(B=>B.notification.unReadNotification),[xt,vt]=he.useState(Ti),[st,et]=he.useState(!1),bt=B=>vt({...xt,...B}),z=B=>{const{source:Ct,extraData:it}=B;switch(Ct){case"AssessmentAssignment":window.open(`/player/diagnosticsurvey/${Number(it)}`);break;case"NewConferenceCreated":window.open(`/start-conference/${JSON.parse(it)?.[0]}/${JSON.parse(it)?.[1]}/conferenceRubric`);break;case"Class Reflection":window.open(`/start-reflection/${it?.replace(/[\[\]]/g,"")?.split(",")?.[1]}`);break;case"Class Reflection Completed":window.open(`/result-reflection/${it?.replace(/[\[\]]/g,"")?.split(",")?.[1]}`);break;case"External Reflection Completed":window.open(`/result-reflection/${JSON.parse(it)?.[0]}/external`);break;case"NewSessionCreated":window.open(`/start-question/${JSON.parse(it)?.[0]}/${JSON.parse(it)?.[1]}`);break;case"NewSessionComplete":window.open(`/start-question/${JSON.parse(it)?.[0]}/${JSON.parse(it)?.[1]}`);break;case"ActionPointReminder":window.open("/action-point/to-do");break;case"SendNotiPLP":window.open("/personal-learning-plan");break;case"SendNotiGOAL":window.open(`/my-goals/${JSON.parse(it)}`);break;case"CertificateApproved":window.open("/dashboard/certification/2");break;case"RequestCheckIn":window.open(`/start-question/${JSON.parse(it)?.[0]}/${JSON.parse(it)?.[1]}`);case"NewSurveyCreated":pt&&window.open(`/start-survey/${JSON.parse(it)?.[0]}/${pt}`);break;case"StudentCompletedSurvey":window.open(`/start-survey/${JSON.parse(it)?.[0]}/${JSON.parse(it)?.[1]}`);break}},T=he.useCallback(async()=>{St(Mt.setLoading(!0));try{const B=await wi({...xt,roles:se?.trim()?[se]:kt?.roles}),{items:Ct,totalItems:it}=B.data;St(Mt.setNotification({notificationList:Ct,totalItems:it}))}catch(B){St(Mt.setAlert({type:"danger",message:B.response?.data?.title||B.message}))}St(Mt.setLoading(!1))},[xt]);he.useEffect(()=>{document.title=Pi},[]),he.useEffect(()=>{T();const B=new mi(y,{cluster:Pt});return B.subscribe(`${Mn}-${at}`).bind(Ai,T),()=>B.unsubscribe(`${Mn}-${at}`)},[xt,at]);const A=he.useCallback((B,Ct)=>{try{St(Mt.setModal({isOpen:!0,type:"warning",message:`Do you want to mark this notification ${Ct?"read":"unread"}?`,onConfirm:async()=>{await Si(B),T()}}))}catch(it){St(Mt.setAlert({type:"danger",message:it.response?.data?.title||it.message}))}},[S,gt]),G=he.useCallback(async()=>{try{if(S.length===0)throw new Error("There are no unread messages");St(Mt.setModal({isOpen:!0,type:"warning",message:"Do you want to mark all notification ?",onConfirm:async()=>{et(!0),await Ci(),T(),et(!1)}}))}catch(B){St(Mt.setAlert({type:"danger",message:B.response?.data?.title||B.message}))}},[S]);return{notificationList:S,totalItems:tt,unReadNotification:gt,filters:xt,changeFilters:bt,updateNotification:A,viewNotification:z,updateAll:G,toggleUpdateAllStatus:st}},Oi="Notification list",ki=20,Li=()=>{const{notificationList:St,totalItems:se,filters:kt,changeFilters:at,updateNotification:pt,viewNotification:S,updateAll:y,toggleUpdateAllStatus:Pt}=Ei(),{t:tt}=di.useTranslation();return yt.jsxs("div",{className:"animated fadeIn",style:{padding:"56px"},children:[yt.jsx("h5",{className:"mb-2",children:Oi}),yt.jsxs(Gt.Row,{className:"my-2",children:[yt.jsx(Gt.Col,{md:8,children:yt.jsx(Mt.SearchBox,{initValue:kt.searchString,onSearch:gt=>at({searchString:gt}),placeholder:"Type something to search"})}),yt.jsx(Gt.Col,{md:4,children:yt.jsx(vi,{value:kt.isRead,onChange:gt=>at({isRead:gt.value})})})]}),yt.jsx(Gt.Row,{className:"my-2 d-flex justify-content-center",children:yt.jsxs(Gt.Col,{md:12,className:"d-flex justify-content-end align-items-center",children:[kt.isRead===!1&&yt.jsxs("div",{className:"d-flex align-items-center justify-content-end mx-2",children:["Mark all as read",yt.jsx(Gt.Input,{checked:Pt,className:"mx-2",type:"checkbox",id:"status-checkbox",onChange:()=>y()})]}),"Total of notifications: ",se]})}),yt.jsxs(Gt.Row,{className:"mb-2",children:[yt.jsx(Gt.Col,{md:12,children:St&&St.length>0?yt.jsx("div",{children:yt.jsxs(Gt.Table,{bordered:!0,hover:!0,striped:!0,responsive:!0,size:"sm",children:[yt.jsx("thead",{children:yt.jsxs("tr",{children:[yt.jsx("th",{className:"align-top",children:"Text"}),yt.jsx("th",{className:"align-top",children:"Time"}),yt.jsx("th",{className:"text-center",children:"Is read"}),yt.jsx("th",{className:"text-center",children:"Action"})]})}),yt.jsx("tbody",{children:St.map(gt=>yt.jsxs("tr",{children:[yt.jsx("td",{className:"align-middle",children:gt.text}),yt.jsx("td",{className:"align-middle",children:Mt.formatLocalTime(gt.time,"yyyy-MM-DD HH:mm")}),yt.jsx("td",{className:`${Mt.styles["control-input"]} text-center align-middle`,children:yt.jsx(Gt.Input,{type:"checkbox",id:`status-checkbox-${gt.id}`,checked:gt.isRead,onChange:()=>pt(gt.id,!gt.isRead)})}),yt.jsx("td",{className:"text-center align-middle",children:["AssessmentAssignment","NewConferenceCreated","NewSessionCreated","CertificateApproved","Class Reflection","NewSessionComplete","ActionPointReminder","SendNotiPLP","SendNotiGOAL","Class Reflection Completed","External Reflection Completed","RequestCheckIn","NewSurveyCreated","StudentCompletedSurvey"].includes(gt.source)&&yt.jsx(hi.AiOutlineEye,{className:"cursor-pointer",size:ki,title:"Detail",onClick:()=>S(gt)})})]},gt.id))})]})}):yt.jsx(Mt.EmptyDataAlert,{label:tt("notification")})}),yt.jsx(Gt.Col,{md:12,children:yt.jsx(Mt.CustomPagination,{filters:kt,totalRecordCount:se,changePageSize:gt=>at({pageSize:gt}),changePage:gt=>at({currentPage:gt})})})]})]})};exports.default=Li;
|