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oBAAXK,EAAwBA,EAAO/N,EAAM0N,mBAAqBK,W","sources":["webpack://_N_E/./src/lib/currency.ts","webpack://_N_E/./src/modules/Course/CourseVideoJs.tsx","webpack://_N_E/./src/modules/Course/VideoPlayer/EndedOverlay.tsx","webpack://_N_E/./src/modules/Course/mediaStore.ts","webpack://_N_E/./src/modules/Home/homeStore.ts"],"sourcesContent":["export const formatCurrency = (number: number) =>\n new Intl.NumberFormat(\"id-ID\").format(number);\n\nexport const formatBankString = (str: string) => {\n try {\n str\n .split(\"_\")\n .map((s) => {\n return s[0].toUpperCase() + s.substring(1).toLowerCase();\n })\n .join(\" \");\n } catch {\n return \"\";\n }\n};\n","import { CONST } from \"lib/const\";\nimport { useAuthStore } from \"modules/Auth/authStore\";\nimport { useRouter } from \"next/router\";\nimport { useEffect, useRef, useState } from \"react\";\nimport videojs from \"video.js\";\nimport Player from \"video.js/dist/types/player\";\n// import { VideoJsPlayerOptions } from \"video.js\";\nimport \"video.js/dist/video-js.css\";\nimport \"videojs-contrib-quality-levels\";\nimport \"videojs-hls-quality-selector\";\nimport \"videojs-mux\";\nimport { EndedOverlay } from \"./VideoPlayer/EndedOverlay\";\nimport { trackEvent, trackEventGA, trackEventGTM } from \"lib/amplitude\";\nimport {\n getLessonIdBySlug,\n getLessonNumberBySlug,\n useCourseStore,\n} from \"./courseStore\";\nimport { useIsSubdomain, useIsTenant, isMalukuURL, isGateURL } from \"lib/host\";\nimport \"videojs-youtube\";\nimport Hls from \"hls.js\";\n// import {\n// deleteVideoFromIndexedDB,\n// getVideoFromIndexedDB,\n// saveVideoToIndexedDB,\n// } from \"lib/video\";\nimport { useToastStore } from \"components/Toast/toastStore\";\nimport { useMediaStore } from \"./mediaStore\";\n\nexport const VideoJS = ({ url, isHovering = false, handleInterrupt }) => {\n const videoRef = useRef(null);\n const playerRef = useRef(null);\n const isSubdomainTenant = useIsSubdomain();\n const isMoodle = useIsTenant();\n const isMalukuTenant =\n typeof window !== \"undefined\" && isMalukuURL(window.location.hostname);\n const isGate =\n typeof window !== \"undefined\" && isGateURL(window.location.hostname);\n // const currentLesson = useCourseStore((state) => state.currentLesson);\n\n const [courseStatus, courseEnrollmentId, currentLesson] = useCourseStore(\n (state) => [\n state.courseStatus,\n state.courseEnrollmentId,\n state.currentLesson,\n ]\n );\n const showToast = useToastStore((state) => state.showToast);\n\n const [isEnded, setEnded] = useState(false);\n\n const router = useRouter();\n\n const currentUserId = useAuthStore((s) => s?.currentUser?.id);\n\n const lessonSlug =\n typeof router.query.lesson == \"string\" ? router.query.lesson : \"\";\n const courseSlug =\n typeof router.query.courseSlug == \"string\" ? router.query.courseSlug : \"\";\n // const { options, onReady } = props;\n\n const videoTitle = lessonSlug || courseSlug;\n\n const getVideoTitle = (title: string, name: any) => {\n if (name) return name;\n\n return (\n title\n .split(\"-\")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \") || \"untitled\"\n );\n };\n\n let videoCDN = \"Cloudflare\";\n // let videoCDN = \"Cloudfront\";\n let videoStreamingType = \"VOD\";\n\n if (url?.includes(\"fast.gokampus.com\")) videoCDN = \"Fastly\";\n else if (url?.includes(\"gokampus.cachefly.net\")) videoCDN = \"CacheFly\";\n\n const currentSource = url?.includes(\"youtube\")\n ? { src: url, type: \"video/youtube\" }\n : url?.includes(\"blob\")\n ? { src: url, type: \"video/mp4\" }\n : { src: url };\n\n let playerName = \"GoKampus Player\";\n\n if (isGate) {\n playerName = \"GoKampus App Player\";\n }\n\n if (isMalukuTenant) {\n playerName = \"GoKampus Maluku Player\";\n }\n\n if (isHovering) {\n playerName += \" (Hover)\";\n }\n\n const options = {\n autoplay: url !== \"\",\n controls: !isHovering,\n // Change to false to show playbackRates on mobile\n responsive: false,\n playsinline: true,\n // Docs: https://videojs.com/guides/options/#playbackrates\n playbackRates: [2, 1.5, 1, 0.5],\n controlBar: {\n skipButtons: {\n backward: 10,\n forward: 10,\n },\n pictureInPictureToggle: true,\n },\n userActions: {\n // default hotkeys:\n // - 'f' for toggle fullscreen\n // - 'space' for toggle play/pause\n // - 'm' for toggle mute\n hotkeys: true,\n },\n // fluid: true,\n // https://stackoverflow.com/questions/49930680/how-to-handle-uncaught-in-promise-domexception-play-failed-because-the-use/50742427#50742427\n muted: isHovering,\n preload: true,\n sources: [currentSource],\n plugins: {\n mux: {\n debug: false,\n data: {\n env_key: CONST.MUX_ENV_KEY,\n // Metadata\n player_name: playerName,\n viewer_user_id: currentUserId,\n video_id: lessonSlug,\n video_cdn: videoCDN,\n video_stream_type: videoStreamingType,\n video_title: lessonSlug,\n },\n },\n },\n html5: {\n hls: {\n enableLowInitialPlaylist: true,\n smoothQualityChange: true,\n overrideNative: true,\n },\n },\n };\n\n const { setPlayerVideoJs } = useMediaStore();\n\n useEffect(() => {\n if (playerRef) {\n setPlayerVideoJs(playerRef);\n }\n // Make sure Video.js player is only initialized once\n if (!playerRef.current) {\n // The Video.js player needs to be _inside_ the component el for React 18 Strict Mode.\n const videoElement = document.createElement(\"video-js\");\n\n videoElement.classList.add(\"vjs-big-play-centered\");\n videoRef.current.appendChild(videoElement);\n\n const player: any = (playerRef.current = videojs(\n videoElement,\n options,\n () => {\n // videojs.log(\"player is ready\");\n // onReady && onReady(player);\n }\n ));\n\n player.hlsQualitySelector({\n displayCurrentQuality: true,\n });\n\n // Initialize quality levels\n const qualityLevels = player.qualityLevels();\n\n // Example: Log available quality levels\n qualityLevels.on(\"addqualitylevel\", (event) => {\n console.log(\"New quality level added:\", event.qualityLevel);\n trackEventGTM({\n event: \"lms_video_setting_quality_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n },\n });\n trackEventGA({\n event: \"lms_video_setting_quality_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n },\n });\n });\n\n // Example: Log when quality level changes\n qualityLevels.on(\"change\", () => {\n const selectedQuality = qualityLevels[qualityLevels.selectedIndex];\n console.log(\"Selected quality level:\", selectedQuality);\n trackEventGTM({\n event: \"lms_video_setting_quality_selected_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n quality: selectedQuality,\n },\n });\n trackEventGA({\n event: \"lms_video_setting_quality_selected_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n quality: selectedQuality,\n },\n });\n });\n\n // Example: Enable/disable specific quality levels\n for (let i = 0; i < qualityLevels.length; i++) {\n const quality = qualityLevels[i];\n if (quality.height >= 720) {\n quality.enabled = true;\n } else {\n quality.enabled = false;\n }\n }\n\n // You could update an existing player in the `else` block here\n // on prop change, for example:\n } else {\n const player = playerRef.current;\n\n player.autoplay(options.autoplay);\n player.src(options.sources);\n }\n }, [videoRef, isHovering, url, playerRef]);\n\n // const displayVideo = async () => {\n // try {\n // const videoBlob: any = await getVideoFromIndexedDB(videoTitle);\n // if (videoBlob) {\n // const url = URL.createObjectURL(videoBlob.blob);\n // playerRef.current.src({ type: videoBlob.type, src: url });\n // }\n // } catch (error) {\n // console.error(\"Failed to load video from IndexedDB\", error);\n // }\n // };\n\n let hls;\n const videoEl = videoRef.current;\n\n const fetchVideoFromNetwork = (url) => {\n console.log(\"🚀 2 url \", url);\n\n var dataStream = {\n video: [],\n audio: [],\n };\n if (url.includes(\".m3u8\")) {\n if (Hls.isSupported()) {\n hls = new Hls();\n\n // @ts-ignore\n window.hls = hls;\n\n hls.loadSource(url);\n hls.attachMedia(videoEl);\n hls.on(Hls.Events.MANIFEST_PARSED, function (event, a) {\n console.log(\"🚀 3 apending data\", a);\n\n videoEl.play();\n hls.on(Hls.Events.BUFFER_APPENDING, function (event, data) {\n console.log(\"🚀 3 apending\", data);\n dataStream[data.type].push(data.data);\n });\n });\n }\n }\n\n console.log(\"🚀 4 dataStream\", dataStream);\n };\n\n const fetchVideo = (url?: string) => {\n fetchVideoFromNetwork(url);\n };\n\n useEffect(() => {\n if (url) {\n console.log(\"🚀 1\", url);\n fetchVideo(url);\n }\n // else {\n // displayVideo();\n // }\n }, [url]);\n\n // useEffect(() => {\n // const player = playerRef.current;\n\n // if (!isHovering) player.pause()\n // }, [isHovering])\n\n // Dispose the Video.js player when the functional component unmounts\n useEffect(() => {\n const player = playerRef.current;\n\n const onPlay = () => {\n handleInterrupt();\n trackEventGTM({\n event: \"lms_video_playpause_a\",\n property: {\n course_slug: courseSlug,\n is_play: true,\n lesson_slug: lessonSlug,\n current_video_time: player.currentTime(),\n },\n });\n trackEventGA({\n event: \"lms_video_playpause_a\",\n property: {\n course_slug: courseSlug,\n is_play: true,\n lesson_slug: lessonSlug,\n current_video_time: player.currentTime(),\n },\n });\n };\n const onPause = () => {\n trackEventGTM({\n event: \"lms_video_playpause_a\",\n property: {\n course_slug: courseSlug,\n is_play: false,\n lesson_slug: lessonSlug,\n current_video_time: player.currentTime(),\n },\n });\n trackEventGA({\n event: \"lms_video_playpause_a\",\n property: {\n course_slug: courseSlug,\n is_play: false,\n lesson_slug: lessonSlug,\n current_video_time: player.currentTime(),\n },\n });\n };\n const onEnterPip = () => {\n trackEventGTM({\n event: \"lms_video_pip_a\",\n property: {\n course_slug: courseSlug,\n is_pip: true,\n lesson_slug: lessonSlug,\n current_video_time: player.currentTime(),\n },\n });\n trackEventGA({\n event: \"lms_video_pip_a\",\n property: {\n course_slug: courseSlug,\n is_pip: true,\n lesson_slug: lessonSlug,\n current_video_time: player.currentTime(),\n },\n });\n };\n const onLeavePip = () => {\n trackEventGTM({\n event: \"lms_video_pip_a\",\n property: {\n course_slug: courseSlug,\n is_pip: false,\n lesson_slug: lessonSlug,\n current_video_time: player.currentTime(),\n },\n });\n trackEventGA({\n event: \"lms_video_pip_a\",\n property: {\n course_slug: courseSlug,\n is_pip: false,\n lesson_slug: lessonSlug,\n current_video_time: player.currentTime(),\n },\n });\n };\n const onEnded = () => {\n setEnded(true);\n trackEventGTM({\n event: \"lms_lesson_complete_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n course_enrollment_id: courseEnrollmentId,\n type: currentLesson?.type,\n lesson_num: getLessonNumberBySlug(lessonSlug, courseStatus),\n is_marked_as_done: false,\n marked_lesson_slug: lessonSlug,\n },\n });\n trackEventGA({\n event: \"lms_lesson_complete_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n course_enrollment_id: courseEnrollmentId,\n type: currentLesson?.type,\n lesson_num: getLessonNumberBySlug(lessonSlug, courseStatus),\n is_marked_as_done: false,\n marked_lesson_slug: lessonSlug,\n },\n });\n };\n\n const onClickSeekbar = () => {\n trackEventGTM({\n event: \"lms_video_timeline_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n current_video_time: player.currentTime(),\n },\n });\n trackEventGA({\n event: \"lms_video_timeline_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n current_video_time: player.currentTime(),\n },\n });\n };\n\n const onVolumeChange = () => {\n trackEventGTM({\n event: \"lms_video_volume_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n current_video_time: player.volume(),\n },\n });\n trackEventGA({\n event: \"lms_video_volume_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n current_video_time: player.volume(),\n },\n });\n };\n\n const onFullScreenChange = () => {\n trackEventGTM({\n event: \"lms_video_fullscreen_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n is_fullscreen: player.isFullscreen(),\n },\n });\n trackEventGA({\n event: \"lms_video_fullscreen_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n is_fullscreen: player.isFullscreen(),\n },\n });\n };\n const onPlaybackChange = () => {\n const eventProperties = {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n course_enrollment_id: courseEnrollmentId,\n type: currentLesson?.type,\n course_id: courseStatus.id,\n chapter_num: getLessonIdBySlug(courseStatus.chapters, lessonSlug)\n ?.chapterNum,\n lesson_id: getLessonIdBySlug(courseStatus.chapters, lessonSlug)\n ?.lessonId,\n lesson_num: getLessonNumberBySlug(currentLesson?.slug, courseStatus),\n speed: player.playbackRate(),\n };\n trackEventGTM({\n event: \"lms_video_setting_speed_selected_a\",\n property: eventProperties,\n });\n trackEventGA({\n event: \"lms_video_setting_speed_selected_a\",\n property: eventProperties,\n });\n };\n\n const onSkipBackward = () => {\n const eventProperties = {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n course_enrollment_id: courseEnrollmentId,\n type: currentLesson?.type,\n course_id: courseStatus.id,\n chapter_num: getLessonIdBySlug(courseStatus.chapters, lessonSlug)\n ?.chapterNum,\n lesson_id: getLessonIdBySlug(courseStatus.chapters, lessonSlug)\n ?.lessonId,\n lesson_num: getLessonNumberBySlug(currentLesson?.slug, courseStatus),\n current_video_time: player.currentTime(),\n };\n trackEventGTM({\n event: \"lms_video_backward_a\",\n property: eventProperties,\n });\n trackEventGA({\n event: \"lms_video_backward_a\",\n property: eventProperties,\n });\n };\n\n const onSkipForward = () => {\n const eventProperties = {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n course_enrollment_id: courseEnrollmentId,\n type: currentLesson?.type,\n course_id: courseStatus.id,\n chapter_num: getLessonIdBySlug(courseStatus.chapters, lessonSlug)\n ?.chapterNum,\n lesson_id: getLessonIdBySlug(courseStatus.chapters, lessonSlug)\n ?.lessonId,\n lesson_num: getLessonNumberBySlug(currentLesson?.slug, courseStatus),\n current_video_time: player.currentTime(),\n };\n trackEventGTM({\n event: \"lms_video_forward_a\",\n property: eventProperties,\n });\n trackEventGA({\n event: \"lms_video_forward_a\",\n property: eventProperties,\n });\n };\n\n player.on(\"play\", onPlay);\n player.on(\"pause\", onPause);\n player.on(\"enterpictureinpicture\", onEnterPip);\n player.on(\"leavepictureinpicture\", onLeavePip);\n player.on(\"ended\", onEnded);\n player.on(\"volumechange\", onVolumeChange);\n player.on(\"fullscreenchange\", onFullScreenChange);\n player.on(\"ratechange\", onPlaybackChange);\n\n // @ts-ignore\n player.controlBar?.skipBackward?.on(\"click\", onSkipBackward);\n\n // @ts-ignore\n player.controlBar?.skipForward?.on(\"click\", onSkipForward);\n\n // @ts-ignore\n player.controlBar?.progressControl?.seekBar?.on(\"click\", onClickSeekbar);\n\n return () => {\n if (player && !player.isDisposed()) {\n player.off(\"play\", onPlay);\n player.off(\"pause\", onPause);\n player.off(\"enterpictureinpicture\", onEnterPip);\n player.off(\"leavepictureinpicture\", onLeavePip);\n player.off(\"ended\", onEnded);\n player.off(\"volumechange\", onVolumeChange);\n player.off(\"fullscreenchange\", onFullScreenChange);\n\n // @ts-ignore\n player.controlBar?.progressControl?.seekBar?.off(\n \"click\",\n onClickSeekbar\n );\n\n player.dispose();\n playerRef.current = null;\n }\n };\n }, [playerRef]);\n\n return isEnded && !isHovering ? (\n
\n {\n setEnded(false);\n }}\n />\n
\n ) : (\n
\n
\n
\n );\n};\n","import Button from \"components/Button\";\nimport Link from \"next/link\";\nimport { useRouter } from \"next/router\";\nimport { useEffect, useState } from \"react\";\nimport {\n useCourseDetailApi,\n useCourseGetStatus,\n useCourseSetLessonDone,\n} from \"../courseApi\";\nimport {\n CourseStatus,\n getLessonNumberBySlug,\n getNextLesson,\n useCourseStore,\n} from \"../courseStore\";\nimport { trackEvent, trackEventGA, trackEventGTM } from \"lib/amplitude\";\nimport { formatCurrency } from \"lib/currency\";\nimport { useAuthStore } from \"modules/Auth/authStore\";\nimport useTranslation from \"next-translate/useTranslation\";\nimport { useIsSubdomain, useIsTenant } from \"lib/host\";\nimport { useHomeStore } from \"modules/Home/homeStore\";\n\nexport const EndedOverlay: React.FC<{ onClickNext: () => void }> = (props) => {\n const { t } = useTranslation(\"course\");\n const router = useRouter();\n const courseSlug =\n typeof router.query.courseSlug == \"string\" ? router.query.courseSlug : \"\";\n\n const lessonSlug =\n typeof router.query.lesson == \"string\" ? router.query.lesson : \"\";\n\n const bundleSlug =\n typeof router.query.lesson == \"string\" ? router.query.bundle : \"\";\n\n const { setCurrentTab, currentTab, setShowModalQuiz, currentCourse } =\n useCourseStore((s) => ({\n setCurrentTab: s.setCurrentTab,\n currentTab: s.currentTab,\n setShowModalQuiz: s.setShowModalQuiz,\n currentCourse: s.currentCourse,\n }));\n\n const currentUser = useAuthStore((state) => state.currentUser);\n const isEnterprisePlus =\n currentUser?.tenant !== undefined &&\n [\n \"Enterprise Plus\",\n \"Pro Plus\",\n `Pro Custom (${currentUser?.referral})`,\n ].includes((currentUser?.tenant as any)?.plan?.name);\n\n const courseChapters = currentCourse?.chapters || [];\n const courseSetLessonDone = useCourseSetLessonDone();\n const courseGetStatus = useCourseGetStatus(courseSlug);\n\n const setNewLessonComplete = useHomeStore((state) => state.setNewLessonComplete);\n\n const isCourseFree: boolean =\n // @ts-ignore\n currentCourse?.discounted_price === 0 ||\n // @ts-ignore\n currentCourse?.original_price === 0;\n\n const isB2B = useIsSubdomain() || useIsTenant();\n const isAnyQuizLesson =\n (currentCourse as any)?.chapters &&\n (currentCourse as any)?.chapters.some((a) =>\n a.lessons.some((x) => x.type === \"Quiz\")\n );\n const nextLesson = getNextLesson(courseChapters as any, lessonSlug);\n\n const [\n courseStatus,\n setPaywallShown,\n currentLesson,\n courseEnrollmentId,\n setCourseStatus,\n ] = useCourseStore((c) => [\n c.courseStatus,\n c.setPaywallShown,\n c.currentLesson,\n c.courseEnrollmentId,\n c.setCourseStatus,\n ]);\n\n const hasUserPaid = courseStatus?.is_paid;\n const hasPaywall: boolean =\n currentCourse?.is_paywall_enabled === undefined\n ? true\n : currentCourse?.is_paywall_enabled;\n const [counter, setCounter] = useState(1);\n\n // TODO: Only use if countdown being used again\n // useEffect(() => {\n // let setCounterInterval;\n\n // if ( (nextLesson?.is_free && nextLesson?.type !== \"Webinar\") || (!nextLesson?.is_free && hasUserPaid)) {\n // setCounterInterval = setInterval(() => {\n // setCounter((c) => c - 1);\n // }, 1000);\n // } else {\n // clearInterval(setCounterInterval);\n // }\n\n // if(counter==0) {\n // courseSetLessonDone.doFetch(\n // {\n // slug: lessonSlug,\n // },\n // {\n // onSuccess(data) {\n // courseGetStatus.doFetch({\n // slug: courseSlug,\n // });\n // },\n // }\n // );\n // }\n\n // return () => clearInterval(setCounterInterval);\n // }, [nextLesson]);\n\n const redirectNextLesson = () => {\n props.onClickNext();\n if (nextLesson) {\n let queriesCourse = {\n courseSlug: courseSlug,\n lesson: nextLesson?.slug,\n };\n /// Set showmodalquiz in store to Show Quiz directly after countdown\n if (nextLesson?.type == \"Quiz\" || nextLesson?.type == \"Assignment\") {\n setShowModalQuiz(true);\n }\n\n router.replace(\n nextLesson?.type == \"Webinar\" && !hasUserPaid\n ? {\n pathname: \"/course/webinar/[courseSlug]/[lessonSlug]\",\n query: {\n courseSlug: courseSlug,\n lessonSlug: nextLesson?.slug,\n },\n }\n : {\n pathname: \"/course/[courseSlug]\",\n query: queriesCourse,\n },\n undefined,\n {\n shallow: true,\n }\n );\n }\n };\n\n const isSubdomainTenant = useIsSubdomain();\n const isTenatURL = useIsTenant();\n\n const getAccess = (lesson: any) => {\n if (isSubdomainTenant || isTenatURL) {\n if (lesson?.is_free || isEnterprisePlus || hasUserPaid) return true;\n else if (lesson?.is_premium || !isEnterprisePlus) return false;\n } else {\n if (!lesson?.is_free || lesson?.is_premium) return false;\n else if (lesson?.is_free || hasUserPaid) return true;\n }\n };\n\n useEffect(() => {\n // if (counter === 0) {\n /// Hit API Course done & redirect directly after video finished\n courseSetLessonDone.doFetch(\n {\n slug: lessonSlug,\n },\n {\n onSuccess(data) {\n setNewLessonComplete(true);\n courseGetStatus.doFetch({\n slug: courseSlug,\n });\n trackEventGTM({\n event: \"lms_video_next_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n },\n });\n trackEventGA({\n event: \"lms_video_next_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n },\n }); \n },\n }\n );\n\n if (getAccess(nextLesson)) redirectNextLesson();\n\n // }\n }, [counter]);\n\n useEffect(() => {\n // if (!isCourseFree && !nextLesson?.is_free && !hasUserPaid) {\n // setPaywallShown(true);\n // }\n if (\n (!isCourseFree &&\n (!nextLesson?.is_free ||\n !nextLesson ||\n nextLesson?.type == \"Webinar\") &&\n !hasUserPaid) ||\n (!nextLesson && isCourseFree)\n ) {\n if (currentTab !== \"Rekomendasi Kursus Lainnya\") {\n setCurrentTab(\"Rekomendasi Kursus Lainnya\");\n\n trackEvent({\n event: \"lms_recommended_auto_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n },\n });\n }\n }\n }, [nextLesson?.is_free, nextLesson?.type, hasUserPaid, isCourseFree]);\n\n useEffect(() => {\n if (!nextLesson) {\n courseSetLessonDone.doFetch(\n {\n slug: lessonSlug,\n },\n {\n onSuccess(data) {\n setNewLessonComplete(true);\n courseGetStatus.doFetch(\n { slug: courseSlug },\n {\n onSuccess(data) {\n setCourseStatus(data?.data as CourseStatus);\n },\n }\n );\n },\n }\n );\n }\n }, []);\n\n return (\n \n {(nextLesson?.is_free && nextLesson?.type !== \"Webinar\") ||\n (!nextLesson?.is_free && hasUserPaid) ? (\n
\n
\n Materi Selanjutnya dalam{\" \"}\n {counter}\n
\n
\n
{nextLesson?.name}
\n
\n
\n {/* {\n // @ts-ignore\n trackEvent({\n event: \"lms_video_next_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: lessonSlug,\n },\n });\n trackEvent({\n // @ts-ignore\n event: \"lms_lesson_view_a\",\n property: {\n course_slug: courseSlug,\n lesson_slug: currentLesson?.slug,\n course_enrollment_id: courseEnrollmentId,\n type: currentLesson?.type,\n bundle_slug: bundleSlug,\n //@ts-ignore\n lesson_num: getLessonNumberBySlug(currentLesson?.slug, courseStatus)\n },\n });\n setShowModalQuiz(true);\n props.onClickNext();\n }}\n shallow\n href={\n nextLesson?.type == \"Webinar\" && !hasUserPaid\n ? {\n pathname: \"/course/webinar/[courseSlug]/[lessonSlug]\",\n query: {\n courseSlug: courseSlug,\n lessonSlug: nextLesson?.slug,\n },\n }\n : {\n pathname: \"/course/[courseSlug]\",\n query: {\n courseSlug: courseSlug,\n lesson: nextLesson?.slug,\n },\n }\n }\n > */}\n {\n redirectNextLesson();\n }}\n >\n {t(\"startNow\")}\n \n {/* */}\n {/*
Cancel
*/}\n
\n
\n ) : !isCourseFree &&\n (!(nextLesson?.is_free === false) ||\n !nextLesson ||\n nextLesson?.type === \"Webinar\") &&\n !hasUserPaid &&\n hasPaywall &&\n !isEnterprisePlus &&\n // Hide certificate option if b2b & doesn't have quiz type lesson\n (!isB2B || isAnyQuizLesson) ? (\n
\n
\n Dapatkan Sertifikat Resmi {/* @ts-ignore */}\n {currentCourse?.institution?.name} hanya dengan Rp\n {formatCurrency(\n // @ts-ignore\n\n currentCourse?.discounted_price ||\n //@ts-ignore\n currentCourse?.original_priceoriginal_price\n )}\n !\n
\n
\n {\n setPaywallShown(true);\n }}\n >\n Upgrade Kursus\n \n
\n ) : !isCourseFree &&\n !nextLesson &&\n courseStatus?.course_lesson_count - courseStatus?.course_lesson_done >\n 1 &&\n hasPaywall &&\n // Hide certificate option if b2b & doesn't have quiz type lesson\n (!isB2B || isAnyQuizLesson) ? (\n
\n
\n Selesaikan pelajaranmu dan dapatkan sertifikat!\n
\n
\n ) : !nextLesson &&\n courseStatus?.course_lesson_count ===\n courseStatus?.course_lesson_done ? (\n
\n
Materi telah selesai
\n
\n \n router.replace({\n pathname: \"/course/[courseSlug]\",\n query: {\n courseSlug,\n },\n })\n }\n >\n {t(\"rewatch\")}\n \n
\n ) : (\n
\n
Materi telah selesai
\n
\n \n router.replace({\n pathname: \"/course/[courseSlug]\",\n query: {\n courseSlug,\n },\n })\n }\n >\n {t(\"rewatch\")}\n \n
\n )}\n
\n );\n};\n","import { MediaPlayerInstance } from \"@vidstack/react\";\nimport { MutableRefObject, SetStateAction } from \"react\";\nimport Player from \"video.js/dist/types/player\";\nimport createStore from \"zustand\";\n\nexport type MediaStore = {\n // state\n player: MutableRefObject;\n playerVideoJs: MutableRefObject;\n isPlayerReady: boolean;\n\n // actions\n setPlayer: (player: MutableRefObject) => void;\n setPlayerVideoJs: (player: MutableRefObject) => void;\n setIsPlayerReady: (isReady: SetStateAction) => void;\n};\n\nexport const useMediaStore = createStore((set) => ({\n // state\n player: null,\n playerVideoJs: null,\n isPlayerReady: false,\n\n // actions\n setPlayer(player) {\n set({ player });\n },\n setPlayerVideoJs(player) {\n set({ playerVideoJs: player });\n },\n setIsPlayerReady: (isReady) =>\n set((state) => ({\n isPlayerReady:\n typeof isReady === \"function\" ? isReady(state.isPlayerReady) : isReady,\n })),\n}));\n","import createStore from \"zustand\";\nimport { paths } from \"lib/__generatedApiSpec\";\nimport { OpReturnType } from \"openapi-typescript-fetch\";\nimport { SetStateAction } from \"react\";\n\n//@ts-ignore\ntype NotifData = OpReturnType[\"data\"];\n\nexport type HomeStore = {\n // States\n userNotifications: NotifData | null;\n newLessonComplete: Boolean;\n renderingStep: number;\n isShowSearchModal: boolean;\n\n // Actions\n setNotification: (notif: NotifData) => void;\n setNewLessonComplete: (lessonCompleted: Boolean) => void;\n setRenderingStep: (step: SetStateAction) => void;\n setIsShowSearchModal: (isShow: SetStateAction) => void;\n};\n\nexport const useHomeStore = createStore((set) => ({\n // States\n userNotifications: null,\n newLessonComplete: false,\n renderingStep: 1,\n isShowSearchModal: true,\n\n // Actions\n setNotification(userNotifications) {\n set({\n userNotifications,\n });\n },\n setNewLessonComplete(newLessonComplete) {\n set({\n newLessonComplete,\n });\n },\n setRenderingStep: (step) =>\n set((state) => ({\n renderingStep:\n typeof step === \"function\" ? step(state.renderingStep) : step,\n })),\n setIsShowSearchModal: (isShow) =>\n set((state) => ({\n isShowSearchModal:\n typeof isShow === \"function\" ? isShow(state.isShowSearchModal) : isShow,\n })),\n}));\n"],"names":["formatCurrency","number","Intl","NumberFormat","format","VideoJS","url","isHovering","handleInterrupt","videoRef","useRef","playerRef","isMalukuTenant","useIsSubdomain","useIsTenant","isMalukuURL","window","location","hostname","isGate","isGateURL","courseStatus","courseEnrollmentId","currentLesson","useCourseStore","state","isEnded","setEnded","useToastStore","showToast","useState","router","useRouter","currentUserId","useAuthStore","s","currentUser","id","lessonSlug","query","lesson","courseSlug","videoCDN","includes","currentSource","src","type","playerName","options","autoplay","controls","responsive","playsinline","playbackRates","controlBar","skipButtons","backward","forward","pictureInPictureToggle","userActions","hotkeys","muted","preload","sources","plugins","mux","debug","data","env_key","CONST","player_name","viewer_user_id","video_id","video_cdn","video_stream_type","video_title","html5","hls","enableLowInitialPlaylist","smoothQualityChange","overrideNative","setPlayerVideoJs","useMediaStore","useEffect","current","player","videoElement","document","createElement","classList","add","appendChild","videojs","hlsQualitySelector","displayCurrentQuality","qualityLevels","on","event","console","log","qualityLevel","trackEventGTM","property","course_slug","lesson_slug","trackEventGA","selectedQuality","selectedIndex","quality","i","length","height","enabled","videoEl","fetchVideo","dataStream","video","audio","Hls","loadSource","attachMedia","a","play","push","fetchVideoFromNetwork","onPlay","is_play","current_video_time","currentTime","onPause","onEnterPip","is_pip","onLeavePip","onEnded","course_enrollment_id","lesson_num","getLessonNumberBySlug","is_marked_as_done","marked_lesson_slug","onClickSeekbar","onVolumeChange","volume","onFullScreenChange","is_fullscreen","isFullscreen","getLessonIdBySlug","eventProperties","course_id","chapter_num","chapters","chapterNum","lesson_id","lessonId","slug","speed","playbackRate","skipBackward","skipForward","progressControl","seekBar","isDisposed","off","dispose","div","className","EndedOverlay","onClickNext","data-vjs-player","ref","props","currentCourse","t","useTranslation","setCurrentTab","currentTab","setShowModalQuiz","bundle","isEnterprisePlus","undefined","tenant","referral","plan","name","courseChapters","courseSetLessonDone","useCourseSetLessonDone","courseGetStatus","useCourseGetStatus","setNewLessonComplete","useHomeStore","isCourseFree","discounted_price","original_price","isB2B","isAnyQuizLesson","some","lessons","x","nextLesson","getNextLesson","setPaywallShown","setCourseStatus","c","hasUserPaid","is_paid","hasPaywall","is_paywall_enabled","counter","setCounter","redirectNextLesson","queriesCourse","replace","pathname","shallow","isSubdomainTenant","isTenatURL","doFetch","onSuccess","is_free","is_premium","getAccess","trackEvent","style","backgroundImage","image_cover_url","span","Button","variant","onClick","course_lesson_count","course_lesson_done","institution","original_priceoriginal_price","createStore","set","playerVideoJs","isPlayerReady","setPlayer","setIsPlayerReady","isReady","userNotifications","newLessonComplete","renderingStep","isShowSearchModal","setNotification","setRenderingStep","step","setIsShowSearchModal","isShow"],"sourceRoot":""}