Help
RSS
API
Feed
Maltego
Contact
Domain > allen.peakmind.in
×
More information on this domain is in
AlienVault OTX
Is this malicious?
Yes
No
DNS Resolutions
Date
IP Address
2024-10-10
18.173.166.127
(
ClassC
)
2024-10-10
18.173.166.97
(
ClassC
)
2025-09-20
18.161.6.80
(
ClassC
)
Port 80
HTTP/1.1 301 Moved PermanentlyServer: CloudFrontDate: Sat, 20 Sep 2025 20:03:10 GMTContent-Type: text/htmlContent-Length: 167Connection: keep-aliveLocation: https://allen.peakmind.in/X-Cache: Redirect from cloudfrontVia: 1.1 a87682502db4b394cc6ba84510da9f98.cloudfront.net (CloudFront)X-Amz-Cf-Pop: HIO52-P1X-Amz-Cf-Id: f41fiL1gxH6IRtFkZ-nElzHBOIEkyyCaBMWE0CN3oQfe_lI2g0RDwwVary: Origin html>head>title>301 Moved Permanently/title>/head>body>center>h1>301 Moved Permanently/h1>/center>hr>center>CloudFront/center>/body>/html>
Port 443
HTTP/1.1 200 OKContent-Type: text/htmlContent-Length: 61175Connection: keep-aliveLast-Modified: Thu, 18 Sep 2025 08:05:27 GMTServer: AmazonS3Date: Sat, 20 Sep 2025 20:03:11 GMTETag: b9ab35025359179fa21db4dca6eceda5X-Cache: RefreshHit from cloudfrontVia: 1.1 8731d2a1a7d15f67b588bf58f652f9f0.cloudfront.net (CloudFront)X-Amz-Cf-Pop: HIO52-P1X-Amz-Cf-Id: h9tO2k1axCG5cZDpDloBwHmkyRAlE177Bju89Os5dKU82WfTAudHRgVary: Origin !DOCTYPE html>html langen-US> head> !-- If you are serving your web app in a path other than the root, change the href value below to reflect the base path you are serving from. The path provided below has to start and end with a slash / in order for it to work correctly. For more details: * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base This is a placeholder for base href that will be replaced by the value of the `--base-href` argument provided to `flutter build`. --> base href/ /> meta charsetUTF-8 /> meta contentIEEdge http-equivX-UA-Compatible /> meta namedescription contentPeakmind is a digital platform enhancing performance, mental health, and wellbeing of students. /> !-- iOS meta tags & icons --> meta nameapple-mobile-web-app-capable contentyes /> meta nameapple-mobile-web-app-status-bar-style contentblack /> meta nameapple-mobile-web-app-title contentpeakmind_app /> link relapple-touch-icon hreficons/Icon-192.png /> meta nameviewport contentwidthdevice-width, initial-scale1.0 /> !-- Favicon --> link relicon typeimage/png hreffavicon.jpg /> script srcscreens/js/meeting_handler.js>/script> title>Peakmind/title> link relpreload href./allen_loading.gif asimage typeimage/gif /> !-- link relmanifest hrefmanifest.json> --> script> // The value below is injected by flutter build, do not touch. const serviceWorkerVersion 1593011319; /script> !-- This script adds the flutter initialization JS code --> script srcflutter.js async>/script> style> body { position: fixed; padding: 0px; margin: 0px; } .loader-container { display: flex; justify-content: center; align-items: center; } .loader-content { height: 100vh; width: 100vw; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; position: relative; background-color: #9480ff; } /* .logo { width: 120px; } */ #lottie-animation { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; /* Lottie is in the background */ } #upper-cloud { position: absolute; top: 0; left: 0; width: 100%; !-- height: 100%; -->z-index: 1; border: 1px; /* Lottie is in the background */ } #peakoo-text { position: absolute; top: 10vw; left: 0; width: 100%; height: 100%; z-index: 1; /* Lottie is in the background */ } #head-text { position: absolute; top: 60vw; left: 0; width: 100%; height: 100%; z-index: 1; color: white; font-size: 20px; /* Lottie is in the background */ } #lower-cloud { position: absolute; top: 10vh; left: 0; width: 100%; height: 100%; z-index: 1; /* Lottie is in the background */ } /* Text overlay styles */ .overlay-text { position: absolute; top: 70%; left: 50%; transform: translate(-50%, -50%); color: white; font-size: 24px; font-weight: bold; text-align: center; z-index: 2; /* Text is on top of Lottie */ padding: 20px; } .overlay-text-2 { position: absolute; top: 27vh; /* left: 10%; */ /* transform: translate(-50%, -50%); */ color: white; font-size: 24px; /* font-weight: bold; */ text-align: center; z-index: 2; /* Text is on top of Lottie */ /* padding: 20px; */ } .bottom-nav { position: fixed; bottom: 0; width: 100%; background-color: #000; /* black background for contrast */ border-top: 1px solid #333; display: flex; justify-content: space-around; padding: 10px 0; z-index: 9999; box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2); } .bottom-nav a { text-decoration: none; color: grey; font-weight: normal; } .bottom-nav a .nav-item { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: grey; } .bottom-nav a.active .nav-item { color: white; } /* Safari */ @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /style> script srchttps://cdn.jsdelivr.net/npm/hls.js@latest typeapplication/javascript >/script> !-- this below line has been added for supporting this package on web --> script typeapplication/javascript src./assets/packages/flutter_inappwebview_web/assets/web/web_support.js defer >/script> script srchttps://cdn.jsdelivr.net/npm/lottie-web@5.7.8/build/player/lottie.min.js>/script> link relpreload href./allen_loading.json asfetch typeapplication/json /> !-- episode id manager script --> script> // initiateSocketConnect(8529e839-fbe4-40e1-8c21-a3c8c849fd9d,globalEpisodeId ) /script> /head> body> div idsleep_main_content styledisplay: flex> div idsleep-content stylez-index: 2>/div> /div> div classloader-content> div idupper-cloud>/div> div idhead-text> Get ready for the next stop br />with Peakoobr /> /div> div idpeakoo-text>/div> div idlower-cloud>/div> /div> div styleopacity: 0; height: 0px idallenId>/div> !-- this div is used just to send message from html to flutter --> div styleopacity: 0; height: 0px idsleep_message_transfer_div>/div> div styleopacity: 0; height: 0px idassessment_message_transfer_div >/div> div styleopacity: 0; height: 0px idrecharge_now_message_transfer_div >/div> div idbottom-navbar style position: fixed; bottom: 0; left: 0; right: 0; /* height: 60px; */ background-color: #ffffff; border-top: 1px solid #ddd; display: flex; justify-content: space-around; align-items: center; z-index: 9999; > div classbottom-nav> a idnav-recharge classactive> div classnav-item> img srchttps://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/be1d2464-77bf-4785-af69-18f940249fb8_image.png altRecharge width24 height24 /> span>Recharge/span> /div> /a> a idnav-coach> div classnav-item> img srchttps://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/bb8b12ac-7c86-4df1-9400-211bb9b3a072_image.png altBoost width24 height24 /> span>Coach/span> /div> /a> a idnav-peakmind> div classnav-item> img srchttps://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/7fc35f01-8e4a-4cc0-9861-6d95be8cfa54_image.png altBoost width24 height24 /> span>Peakmind/span> /div> /a> a idnav-program> div classnav-item> img srchttps://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/acf6d7bf-1daf-40e6-83e0-994f1977ee12_image.png altBoost width24 height24 /> span>Program/span> /div> /a> a idnav-boost> div classnav-item> img srchttps://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/41d4a97f-f53d-4199-b539-b0586bb170f3_image.png altBoost width24 height24 /> span>Boost/span> /div> /a> /div> /div> script srchttps://unpkg.com/tesseract.js@v4.0.2/dist/tesseract.min.js>/script> script> async function _extractText(imagePath, mapData) { var worker await Tesseract.createWorker(); await worker.load(); await worker.loadLanguage(mapData.language); await worker.initialize(mapData.language); await worker.setParameters(mapData.args); var rtn await worker.recognize(imagePath, {}, worker.id); await worker.terminate(); if (mapData.argstessjs_create_hocr) { return rtn.data.hocr; } return rtn.data.text; } /script> !------------------------------------------ SLEEP MANAGEMENT SCRIPT --------------- S --> script> class EpisodeIdManager { timeoutThreshold 1000 * 60 * 5; constructor(firstUserId) { this.globalSocket null; this.globalEpisodeId null; this.periodicIntervalInstance null; this.lastCreatedEpisodeTime () > Date.parse( JSON.parse( localStorage.getItem(flutter.last_episode_id_tracked_time) ) ); this.firstUserId firstUserId; this.isConnectionInProgress false; } fetchAndUpdateEpisodeId() { // Get the last episode creation time from localStorage console.log( ast created episode time : , this.lastCreatedEpisodeTime() ); this.globalEpisodeId localStorage.getItem(flutter.episode_id); const timeDiff new Date().getTime() - this.lastCreatedEpisodeTime(); // Check if lastCreatedEpisodeTime is valid and if more than 5 minutes have passed or if the episode id is null --> create new episode id if ( isNaN(this.lastCreatedEpisodeTime()) || !this.globalEpisodeId || new Date().getTime() - this.lastCreatedEpisodeTime() > this.timeoutThreshold ) { // Generate a new episode ID and store it this.globalEpisodeId Math.random() .toString(36) .substring(2, 10) .toUpperCase(); localStorage.setItem( flutter.episode_id, `${this.globalEpisodeId}` ); this.setLastTrackedTime(); console.log(creating new episode id : , this.globalEpisodeId, new Date(), ); } console.log(common - EPISODE ID : , this.globalEpisodeId); } startSessionTimeoutPeriodicChecker() { if (this.periodicIntervalInstance) { clearInterval(this.periodicIntervalInstance); } this.periodicIntervalInstance setInterval(() > { const timeDiff new Date().getTime() - this.lastCreatedEpisodeTime(); // close current session if 5 minutes have passed without activity (event-tracking) if (timeDiff > this.timeoutThreshold) { this.closeCurrentSession(); clearInterval(this.periodicIntervalInstance); this.periodicIntervalInstance null; } else { // console.log(---> timeDiff : , timeDiff) } // check every 10 seconds }, 10 * 1000); this.setupTouchAndVisibilityEvents(); } // starting point of episode session tracking initiateSocketConnectSession() { this.isConnectionInProgress true; // fetch and update episode id this.fetchAndUpdateEpisodeId(); const socketHost window.location.hostname; console.log(socket host : , socketHost); let apiBaseUrl; if ( socketHost.includes(localhost) || socketHost.includes(qa) || socketHost.includes(127.0.0.1) ) { apiBaseUrl wss://68d6g1kpwg.execute-api.ap-south-1.amazonaws.com/dev; // local QA environment } else if (socketHost.includes(staging)) { apiBaseUrl wss://fr5h8bt4gk.execute-api.ap-south-1.amazonaws.com/staging; // Staging environment } else { apiBaseUrl wss://eyzya68p29.execute-api.ap-south-1.amazonaws.com/production; // Production environment } console.log( connecting with socket : index.html : , `${apiBaseUrl}?user_uuid${this.firstUserId}&episode_id${this.globalEpisodeId}` ); if ( !this.globalSocket || this.globalSocket.readyState ! WebSocket.OPEN ) { this.globalSocket new WebSocket( `${apiBaseUrl}?user_uuid${this.firstUserId}&episode_id${this.globalEpisodeId}` ); this.globalSocket.onopen (e) > { console.log(socket Connection established); this.startSessionTimeoutPeriodicChecker(); this.isConnectionInProgress false; }; this.globalSocket.onclose function (event) { if (event.wasClean) { console.log( `socket Connection closed cleanly, code${event.code} reason${event.reason}` ); } else { console.log(socket Connection died); this.isConnectionInProgress false; } }; this.globalSocket.onerror function (error) { console.log(`socket Error: ${error.message}`); this.isConnectionInProgress false; }; } else { console.log(socket is already open : continuing same session); } } closeCurrentSession() { if (this.globalSocket?.readyState WebSocket.OPEN) { console.log(closing socket : index.html : closeCurrentSession ); this.globalSocket.close(); } localStorage.removeItem(flutter.episode_id); localStorage.removeItem(flutter.last_episode_id_tracked_time); } // setup visibility events, to check connection state when user come back to screen. setupTouchAndVisibilityEvents() { console.log(visibilitychange : , document.visibilityState); let isVisibilityCheckingEnabled false; let isTouchCheckingEnabled false; document.addEventListener(visibilitychange, () > { if ( document.visibilityState visible && !isVisibilityCheckingEnabled ) { console.log(visibilitychange : , document.visibilityState); isVisibilityCheckingEnabled true; setTimeout(() > { this.checkAndRestartSessionAgain(); isVisibilityCheckingEnabled false; }, 500); } }); document.addEventListener(touchstart, () > { if (!isTouchCheckingEnabled) { isTouchCheckingEnabled true; setTimeout(() > { this.checkAndRestartSessionAgain(); isTouchCheckingEnabled false; }, 500); } }); } checkAndRestartSessionAgain() { // if socket is not connected, then restart the session if ( !this.globalSocket || (this.globalSocket.readyState ! WebSocket.OPEN && !this.isConnectionInProgress) ) { console.log(connecting again : checkAndRestartSessionAgain ); this.initiateSocketConnectSession(); } } setLastTrackedTime() { localStorage.setItem( flutter.last_episode_id_tracked_time, `${new Date().toISOString()}` ); } } class PeakMindApp { constructor() { this.firstStart new Date(); this.appStartTimeRoute new Date(); this.rechargeNowRouteOpenCalled false; this.globalIframe document.createElement(iframe); this.initiateAppCoreInstances(); this.initializeRegularTracking(); this.init(); } initializeRegularTracking() { this.peoridicTriggerEventInstance null; this.peoridicTriggerEventIntervalSeconds 15; this.triggerFunction null; this.getTriggerFunction () > this.triggerFunction; this.startTriggerEventCapture(); this.setupVisibilityDetector(); } initiateAppCoreInstances() { this.initResponse null; this.currentUrlPath window.location.pathname; // Initialize user and routing info this.initializeUser(); this.initializeRouting(); this.showOrHideNavbar(); // Set up event listeners this.setupEventListeners(); // Apply initial theme this.applyInitialTheme(); } /* URL and Utility Methods */ pathContainsString(string) { return window.location.pathname.includes(string); } getUrlParam(param) { const urlParams new URLSearchParams(window.location.search); return urlParams.get(param) || undefined; } parseJwt(token) { if (!token || !token.includes(.)) return null; try { const base64Url token.split(.)1; const base64 base64Url.replace(/-/g, +).replace(/_/g, /); const jsonPayload decodeURIComponent( window .atob(base64) .split() .map( (c) > % + (00 + c.charCodeAt(0).toString(16)).slice(-2) ) .join() ); return JSON.parse(jsonPayload); } catch (error) { console.error(JWT parsing error:, error); return null; } } /* User Initialization */ initializeUser() { this.firstUserId this.getUrlParam(user_uuid) || localStorage.getItem(user_id); this.firstOrgUuid this.getUrlParam(org_uuid) || localStorage.getItem(org_uuid); this.tokenValue this.getUrlParam(token); // Handle JWT token if no user_uuid in URL if (this.tokenValue && !this.getUrlParam(user_uuid)) { const parsedJWT this.parseJwt(this.tokenValue); if (parsedJWT?.user_uuid) { this.firstUserId parsedJWT.user_uuid; console.log(Parsed JWT:, parsedJWT); } } // Fallback to flutter.jwt if token is invalid if ( !this.tokenValue || this.tokenValue null || this.tokenValue.startsWith() ) { this.tokenValue JSON.parse(localStorage.getItem(flutter.jwt)); } // Store user info if available if (this.firstUserId && this.tokenValue) { localStorage.setItem(user_id, this.firstUserId); localStorage.setItem(token, this.tokenValue); this.episodeIdManager new EpisodeIdManager(this.firstUserId); this.episodeIdManager.initiateSocketConnectSession(); } if (this.firstOrgUuid) { localStorage.setItem(org_uuid, this.firstOrgUuid); } this.isEmbedUser this.pathContainsString(/embed) || localStorage.getItem(isEmbed) true; } /* Routing Information */ initializeRouting() { this.isAssessmentRouted this.currentUrlPath.includes(assessment) && this.currentUrlPath.includes(embed) && this.currentUrlPath.split(/).filter((item) > item ! ) .length 3; console.log( IsAssessmentRouted:, this.currentUrlPath, this.currentUrlPath.toLowerCase().includes(dashboard) ); this.isRechargeNowRouted this.currentUrlPath.includes(recharge-now); this.isJoinMeetingHandlerRoute this.currentUrlPath.includes(join-meeting); this.isBoostProductivityRouted this.currentUrlPath.includes(embed/activity); this.isDashboardRoute this.currentUrlPath .toLowerCase() .includes(dashboard); } showOrHideNavbar() { // check for allen org id : const isAllenUser this.firstOrgUuid c6071813-1cc1-450a-95bb-a2ff1bc6c344 const shouldShow ( this.isAssessmentRouted || this.isRechargeNowRouted || this.isJoinMeetingHandlerRoute || this.isBoostProductivityRouted || this.isDashboardRoute) && isAllenUser; document.getElementById(bottom-navbar).style.display shouldShow ? flex : none; } /* Native Communication */ generateEventId() { const randLetter String.fromCharCode( 65 + Math.floor(Math.random() * 26) ); return randLetter + Date.now(); } async sendEventToNative(action, uri, query) { const sendPayload {}; if (uri) sendPayload.uri uri; if (query) sendPayload.query query; const payload { id: this.generateEventId(), action: action, payload: Object.keys(sendPayload).length > 0 ? sendPayload : null, }; const message JSON.stringify(payload); console.log(Sending to native:, payload); if (window.webkit?.messageHandlers?.internalWebViewActionDispatcher) { window.webkit.messageHandlers.internalWebViewActionDispatcher.postMessage( message ); } else if (window.internalWebViewActionDispatcher) { try { const response await window.internalWebViewActionDispatcher.handleMessage( message ); console.log(Native response:, response); this.initResponse JSON.parse(response); this.handleThemeChange(this.initResponse.response.theme); } catch (error) { console.error(Native communication error:, error); } } else { console.error(No native handler found); } } backTapped() { this.sendEventToNative(BACK_TAPPED); console.log(Back button tapped); } navigateTo(uri, query) { this.sendEventToNative(NAVIGATION, uri, query); console.log(`Navigation to ${uri} with query:`, query); } forwardNavigateTo(uri, query) { this.sendEventToNative(FORWARD_NAVIGATION, uri, query); console.log(`Forward navigation to ${uri} with query:`, query); } externalNavigateTo(uri) { this.sendEventToNative(EXTERNAL_NAVIGATION, uri); console.log(External navigation to, uri); } handleNativeMessage(event) { const excludedEvents RECHARGE_NOW_PAGE_EVENT, ASSESSMENT_REPORT_CLICK, RECHARGE_NOW_STREAK_PAGE_EVENT, RECHARGE_NOW_STREAK_INFO, BOOST_PRODUCTIVITY_EVENT, ; if ( excludedEvents.includes(event.data.event_type) || typeof event.data ! string ) { return; } try { const eventData JSON.parse(event.data); if (eventData.action INIT) { console.log(INIT action received:, eventData); this.handleThemeChange(eventData.response.theme); this.initResponse eventData; } else if (eventData.action IMAGE_ACTION) { console.log(IMAGE_ACTION received:, eventData); } } catch (error) { console.error(Error parsing native message:, error); } } /* Theme Management */ handleThemeChange(theme) { localStorage.setItem(theme, theme); document.body.style.backgroundColor theme light ? #FFF8F3 : #1A2438; console.log(Theme updated to:, theme); } applyInitialTheme() { if (!this.isEmbedUser) return; let storedTheme localStorage.getItem(theme) || dark; console.log(Applying initial theme:, storedTheme); document.body.style.backgroundColor storedTheme light ? #FFF8F3 : #1A2438; } init() { this.setupIframeStyles(); this.setupEventListeners(); this.setupAnimations(); this.initializePosthog(); this.handleRouting(); // this.setupFlutterInitialization(); } setupIframeStyles() { this.globalIframe.style.width 100vw; this.globalIframe.style.height 100dvh; this.globalIframe.style.border 10px; this.globalIframe.style.overflow auto; this.globalIframe.style.webkitOverflowScrolling touch; } setupEventListeners() { window.addEventListener(message, (event) > this.handleNativeMessage(event) ); document.addEventListener(DOMContentLoaded, () > { this.applyInitialTheme(); this.sendEventToNative(INIT); }); // --- Flutter load Events --- if (this.getUrlParam(openedByApp) ! true) { window.addEventListener(beforeunload, this.handleBeforeUnload); } if (this.getUrlParam(openedByApp) true) { const navbar document.getElementById(bottom-navbar); if (navbar) { navbar.style.display none; } } window.addEventListener(flutter-first-frame, () > { const properties this.getTrackingProperties(); properties.app_loading_duration this.dateDifferenceInSeconds( this.appStartTimeRoute, new Date() ); this.trackData(app_entry_first_frame, properties); document.querySelector(.loader-content).style.display none; document.getElementById(sleep-content).style.display none; document.getElementById(bottom-navbar).style.display none; this.appStartTimeHome new Date(); const loadingIndicator document.getElementById(loader); if (loadingIndicator) { loadingIndicator.remove(); } }); // window.addEventListener(load, (ev) > { // setTimeout(() > { // this.initializeFlutter(); // }, 0); // }); } setupAnimations() { this.loadingAnimation lottie.loadAnimation({ container: document.getElementById(lottie-animation), renderer: svg, loop: true, autoplay: true, path: breath_loader2.json, }); this.upperCloudAnimation lottie.loadAnimation({ container: document.getElementById(upper-cloud), renderer: svg, loop: true, autoplay: true, path: upper_cloud.json, }); this.peakooTextAnimation lottie.loadAnimation({ container: document.getElementById(peakoo-text), renderer: svg, loop: true, autoplay: true, path: peakoo_text1.json, }); this.lowerCloudAnimation lottie.loadAnimation({ container: document.getElementById(lower-cloud), renderer: svg, loop: true, autoplay: true, path: bottom_cloud.json, }); } initializePosthog() { // QA - POSTHOG !(function (t, e) { var o, n, p, r; e.__SV || ((window.posthog e), (e._i ), (e.init function (i, s, a) { function g(t, e) { var o e.split(.); 2 o.length && ((t to0), (e o1)), (te function () { t.push( e.concat(Array.prototype.slice.call(arguments, 0)) ); }); } ((p t.createElement(script)).type text/javascript), (p.async !0), (p.src s.api_host + /static/array.js), (r t.getElementsByTagName( script )0).parentNode.insertBefore(p, r); var u e; for ( void 0 ! a ? (u ea ) : (a posthog), u.people u.people || , u.toString function (t) { var e posthog; return ( posthog ! a && (e + . + a), t || (e + (stub)), e ); }, u.people.toString function () { return u.toString(1) + .people (stub); }, o capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys onSessionId.split( ), n 0; n o.length; n++ ) g(u, on); e._i.push(i, s, a); }), (e.__SV 1)); })(document, window.posthog || ); posthog.init(phc_K5wRZpFGxaxJjUbSN5kuVdXgallq0UuIC1AM1xPXJjK, { api_host: https://d1ydu4tvunsfyq.cloudfront.net, enable_recording_console_log: true, }); posthog.identify(this.firstUserId, { user_uuid: this.firstUserId }); const pathList window.location.pathname .replace(/^\/|\/$/g, ) .split(/); if (pathList.includes(embed)) { pathList.shift(); } const pathName pathList0 ?? ; const properties this.getTrackingProperties(); this.trackData(route_opened, properties); } handleRouting() { const fullPathName window.location.pathname; const iframeContainerDiv document.getElementById(sleep-content); if (this.isJoinMeetingHandlerRoute) { this.handleMeetingRouting(); } else if (fullPathName.includes(sleep)) { this.handleSleepRouting(); } else if (this.isAssessmentRouted) { this.handleAssessmentRouting(); } else if (this.isRechargeNowRouted) { this.handleRechargeNowRouting(); } else if (this.isBoostProductivityRouted) { this.handleBoostProductivityRouting(); } else if (this.isDashboardRoute) { this.handleDashboardRouting(); } else { document.querySelector(.loader-content).style.display flex; } // Bottom Navbar Logic const navRecharge document.getElementById(nav-recharge); const navBoost document.getElementById(nav-boost); const navProgram document.getElementById(nav-program); const navPeakmind document.getElementById(nav-peakmind); const navCoach document.getElementById(nav-coach); const tabImageMap { nav-recharge: { default: https://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/be1d2464-77bf-4785-af69-18f940249fb8_image.png, active: https://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/62a9e59c-ea18-4be7-92e8-30b3078a9800_image.png, }, nav-coach: { default: https://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/bb8b12ac-7c86-4df1-9400-211bb9b3a072_image.png, active: https://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/05029018-3617-489c-8ab9-ea96c00072e1_image.png, }, nav-peakmind: { default: https://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/7fc35f01-8e4a-4cc0-9861-6d95be8cfa54_image.png, active: https://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/7fc35f01-8e4a-4cc0-9861-6d95be8cfa54_image.png, }, nav-program: { default: https://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/acf6d7bf-1daf-40e6-83e0-994f1977ee12_image.png, active: https://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/ca15e734-8a63-4185-9a2b-68c0081c44ff_image.png, }, nav-boost: { default: https://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/41d4a97f-f53d-4199-b539-b0586bb170f3_image.png, active: https://imagebucketspeakmind.s3.ap-south-1.amazonaws.com/activities/b4b201d7-1743-4cf2-a56e-f940fa3a7a61_image.png, }, }; function setActive(tab, iframeSrc) { const id tab.id; document.querySelectorAll(.bottom-nav a).forEach((el) > { el.classList.remove(active); const img el.querySelector(img); if (tabImageMapel.id) { img.src tabImageMapel.id.default; } }); tab.classList.add(active); const activeImg tab.querySelector(img); if (tabImageMapid) { activeImg.src tabImageMapid.active; } } if (this.isRechargeNowRouted) { setActive(navRecharge); this.trackData( breakpage_nav_recharge_now_click, this.getTrackingProperties() ); } else if (this.isBoostProductivityRouted) { setActive(navBoost); } navRecharge.addEventListener(click, () > { setActive(navRecharge); this.handleRechargeNowRouting(); this.trackData( breakpage_nav_recharge_now_click, this.getTrackingProperties() ); }); navBoost.addEventListener(click, () > { setActive(navBoost); this.trackData( breakpage_nav_boost_click, this.getTrackingProperties() ); this.handleBoostProductivityRouting(); }); navProgram.addEventListener(click, () > { setActive(navProgram); this.updateToHomePath(); this.trackData( breakpage_nav_program_click, this.getTrackingProperties() ); document.getElementById( recharge_now_message_transfer_div ).innerText JSON.stringify({ resource_type: RECHARGE_NOW_PAGE_EVENT, resource_details: recharge_now_program_click, }); this._continueFlutterLoading(); }); navCoach.addEventListener(click, () > { setActive(navCoach); this.trackData( breakpage_nav_coach_click, this.getTrackingProperties() ); this.updateToHomePath(); document.getElementById( recharge_now_message_transfer_div ).innerText JSON.stringify({ resource_type: RECHARGE_NOW_PAGE_EVENT, resource_details: recharge_now_coach_click, }); this._continueFlutterLoading(); }); navPeakmind.addEventListener(click, () > { setActive(navPeakmind); this.updateToHomePath(); this.trackData( breakpage_nav_home_click, this.getTrackingProperties() ); this._continueFlutterLoading(); }); } handleSleepRouting() { try { setTimeout(() > { this.trackData(sleep_view_welcome_flash_deep_link, { eventName: sleep_view_welcome_flash_deep_link, appTabName: Sleep Zone, journeyPage: false, pageName: Sleep Welcome Flash Page, pageType: sleep_welcome_flash_page, prevPageName: /, }); }, 100); } catch (error) {} const iframeContainerDiv document.getElementById(sleep-content); iframeContainerDiv.appendChild(this.globalIframe); setTimeout(() > { this.globalIframe.src sleep_initial_page.html; this.trackData(sleep_view_intro_page_deep_link, { eventName: sleep_view_intro_page_deep_link, appTabName: sleep zone, journeyPage: false, pageName: sleep_intro_page, prevPageName: sleep_welcome_flash_page, }); this.globalIframe.addEventListener(load, () > { const iframeWindow this.globalIframe.contentWindow; const iframeDocument this.globalIframe.contentDocument || iframeWindow.document; const continueSleepButton iframeDocument.querySelector( .sleep_intro_continue_button ); const exploreSleepButton iframeDocument.querySelector( .sleep_intro_explore_button ); const takeANapButton iframeDocument.querySelector(.take_a_nap_button); if (continueSleepButton) { continueSleepButton.addEventListener(click, () > { this.onClickSleepButton(sleepContinue); }); } if (exploreSleepButton) { exploreSleepButton.addEventListener(click, () > { this.onClickSleepButton(sleepExplore); }); } if (takeANapButton) { takeANapButton.addEventListener(click, () > { this.onClickSleepButton(sleepTakeaNap); }); } }); }, 2000); } onClickSleepButton(buttonType) { const sessionId crypto.randomUUID(); document.getElementById(sleep_message_transfer_div).innerText JSON.stringify({ button_type: buttonType, session_id: sessionId, }); const isContinueClick buttonType sleepContinue; const isTakeANapClick buttonType sleepTakeaNap; let trackingProperty { eventName: , buttonDisplayName: , event_type: click_button, pageName: sleep_intro_page, buttonType: next, buttonCodeName: , appTabName: sleep zone, pageSubTabName: resources, prevPageName: /sleep_initial_page, metadata: { sleep_session_entry_uuid: sessionId, }, }; if (isContinueClick) { trackingProperty.eventName sleep_click_start_timer_deep_link; trackingProperty.buttonDisplayName start timer; trackingProperty.buttonCodeName sleep_start_timer; } else if (isTakeANapClick) { trackingProperty.eventName sleep_click_take_a_nap_deep_link; trackingProperty.buttonDisplayName Take a Nap; trackingProperty.buttonCodeName sleep_take_a_nap_button; } else { trackingProperty.eventName sleep_explore_sleep_aids_deep_link; trackingProperty.buttonDisplayName Explore Sleep Aids; trackingProperty.buttonCodeName sleep_aid_explore_button; } this.trackData(trackingProperty.eventName, trackingProperty); if (window.globalAppRunner) { window.globalAppRunner.runApp(); } else { window.isContinueFlutterRun true; this.globalIframe.src sleep.html; } } handleAssessmentRouting() { const navbar document.getElementById(bottom-navbar); if (navbar) { navbar.style.display none; } const iframeContainerDiv document.getElementById(sleep-content); this.globalIframe.src screens/assessment_view.html; iframeContainerDiv.appendChild(this.globalIframe); const pathList window.location.pathname .split(/) .filter((i) > i ! ); let assessmentId pathList.length > 0 ? pathList.at(-1) : ; console.log(assessmentId : , assessmentId, window.location.pathname, pathList, ); this.globalIframe.addEventListener(load, () > { window.addEventListener(message, (myEvent) > { const eventData myEvent.data; console.log( IFRAME-ASSESSMENT : message received (index.html) : , eventData ); if (eventData.event_type ASSESSMENT_REPORT_CLICK) { this.handleAssessmentReportClick(eventData); } }); }); } handleAssessmentReportClick(eventData) { const messageData eventData.messageData; const resourceType messageData.resource_type; let resourceName messageData.details?.display_name; let resourceCodeName messageData.details?.code_name; const eventTrackingMapping { connect_to_coach: assessment_report_book_session_click, chatbot: assessment_report_peakoo_click, done: assessment_report_done_click, assessment_initialized_splash: view_assessment_deep_link, generate_report_click: generate_report_click, report_checkout: report_checkout_click, }; const buttonNameMapping { generate_report_click: Generate my Report, chatbot: Talk to Peakoo, done: Done, connect_to_coach: Book session, }; let eventTrackingName, resourceUUID; if (resourceType in eventTrackingMapping) { eventTrackingName eventTrackingMappingresourceType; } else if ( activity, tools, assessment.includes(resourceType) ) { eventTrackingName `assessment_report_${resourceType}_click`; } resourceUUID messageData.resource_id; if (eventTrackingName) { let trackingProperties { artifact_type: resourceType, assessment_id: eventData.assessment_id, event_type: eventTrackingName view_assessment_deep_link ? view_page : click_button, page_name: assessment_iframe_html, app_client_type: this.isEmbedUser ? embed : peakmind, ...(resourceUUID && { artifact_uuid: resourceUUID, parent_resource_id: resourceUUID, }), ...(resourceName && { artifact_display_name: resourceName, report_display_name: resourceName, }), ...(resourceCodeName && { artifact_code_name: resourceCodeName, }), ...(resourceType in buttonNameMapping && { button_display_name: buttonNameMappingresourceType, }), }; this.trackData(eventTrackingName, trackingProperties); } const homeRoutedEvents connect_to_coach, chatbot, activity, tools, assessment, done, report_checkout, ; if (!homeRoutedEvents.includes(resourceType)) return; this.updateToHomePath(); document.getElementById(assessment_message_transfer_div).innerText JSON.stringify({ resource_type: resourceType, resource_details: messageData.details, }); this._continueFlutterLoading(); } handleRechargeNowRouting() { const iframeContainerDiv document.getElementById(sleep-content); this.globalIframe.src screens/recharge_now_view.html; iframeContainerDiv.appendChild(this.globalIframe); this.globalIframe.addEventListener(load, () > { if (!this.rechargeNowRouteOpenCalled) { this.trackData(route_opened_recharge_now, { event_type: view_page, page_name: recharge_now, }); this.rechargeNowRouteOpenCalled true; } }); window.addEventListener(message, (myEvent) > { const eventData myEvent.data; if (eventData.event_type RECHARGE_NOW_PAGE_EVENT) { this.handleRechargeNowPageEvent(eventData); } else if ( eventData.event_type RECHARGE_NOW_STREAK_PAGE_EVENT ) { console.log(RECHARGE_NOW_STREAK_PAGE_EVENT); this.globalIframe.src screens/streak_info_view.html; } else if (eventData.event_type RECHARGE_NOW_PAGE_EVENT_1) { console.log(RECHARGE_NOW_PAGE_EVENT_1); this.globalIframe.src screens/recharge_now_view.html; } }); } handleRechargeNowPageEvent(eventData) { const rechargeEventName eventData.event_name; const rechargeEventData eventData.event_data; this.trackData(rechargeEventName, rechargeEventData); if ( rechargeEventName recharge_now_peakoo_click || rechargeEventName recharge_now_explore_peakmind_click ) { document.getElementById( recharge_now_message_transfer_div ).innerText JSON.stringify({ resource_type: eventData.event_type, resource_details: rechargeEventName, }); if (rechargeEventName recharge_now_explore_peakmind_click) { this.updateToHomePath(); } this._continueFlutterLoading(); } } handleBoostProductivityRouting() { console.log(inside boost productivity); const iframeContainerDiv document.getElementById(sleep-content); this.globalIframe.src screens/boost_productivity.html; iframeContainerDiv.appendChild(this.globalIframe); this.globalIframe.addEventListener(load, () > { this.trackData(route_opened_boost_productivity, { event_type: view_page, page_name: boost_productivity_page, }); this.triggerFunction () > { this.trackData(bypc_trigger_event, { event_type: trigger_event_type, }); }; }); window.addEventListener(message, (myEvent) > { const eventData myEvent.data; if (eventData.event_type BOOST_PRODUCTIVITY_EVENT) { const bpEventName eventData.event_name; const bpEventData eventData.event_data; this.trackData(bpEventName, bpEventData); if (bpEventName bypc_start_now_button_clicked) { this.updateToHomePath(); this._continueFlutterLoading(); } } }); } handleDashboardRouting() { const iframeContainerDiv document.getElementById(sleep-content); this.globalIframe.src screens/dashboard.html; iframeContainerDiv.appendChild(this.globalIframe); this.globalIframe.addEventListener(load, () > { this.trackData(route_opened_dashboard, { event_type: view_page, page_name: dashboard_page, }); }); // Optional: handle post-message events from iframe window.addEventListener(message, (event) > { if (event.data?.event_type DASHBOARD_EVENT) { // Add your logic here } }); } handleBeforeUnload(event) { event.preventDefault(); event.returnValue Are you sure you want to exit?; return Are you sure you want to exit?; } _continueFlutterLoading() { this.stopTriggerEventCapture(); if (window.globalAppRunner) { window.globalAppRunner.runApp(); } else { window.isContinueFlutterRun true; document.querySelector(.loader-content).style.display flex; document.getElementById(sleep-content).style.display none; document.getElementById(bottom-navbar).style.display none; } } updateToHomePath() { const url new URL(window.location.href); url.pathname /embed/home; history.replaceState(null, , url.toString()); } dateDifferenceInSeconds(dateInitial, dateFinal) { return (dateFinal - dateInitial) / 1000; } startTriggerEventCapture() { if (this.peoridicTriggerEventInstance) { clearInterval(this.peoridicTriggerEventInstance); } this.peoridicTriggerEventInstance setInterval(() > { if (this.getTriggerFunction()) { this.getTriggerFunction()(); } }, this.peoridicTriggerEventIntervalSeconds * 1000); } stopTriggerEventCapture() { if (this.peoridicTriggerEventInstance) { clearInterval(this.peoridicTriggerEventInstance); } } setupVisibilityDetector() { let isVisibilityCheckingEnabled false; document.addEventListener(visibilitychange, () > { if (!isVisibilityCheckingEnabled) { setTimeout(() > { if (document.visibilityState visible) { isVisibilityCheckingEnabled true; this.startTriggerEventCapture(); } else { this.stopTriggerEventCapture(); } isVisibilityCheckingEnabled false; }, 500); } }); } // -------------------------- CORE functions ---------------- *** getTrackingProperties() { const pathList window.location.pathname .replace(/^\/|\/$/g, ) .split(/); if (pathList.includes(embed)) { pathList.shift(); } const pathName pathList0 ?? ; const properties { event_type: navigation, app_client_type: this.isEmbedUser ? embed : peakmind, route: window.location.href, path: pathName, event_version: 20250424, }; if (this.firstUserId) { properties.user_id this.firstUserId; } if (this.tokenValue) { properties.token this.tokenValue; } return properties; } trackData(eventName, eventData) { this.episodeIdManager?.checkAndRestartSessionAgain(); console.log(LOGGING EVENT : , eventName, eventData); this.episodeIdManager?.setLastTrackedTime(); eventDataevent_name eventName; eventDataepisode_id this.episodeIdManager?.globalEpisodeId; eventData.user_id this.firstUserId ?? eventData.user_id ?? this.getUrlParam(user_uuid); if (!eventData.app_client_type) { eventData.app_client_type this.isEmbedUser ? embed : peakmind; } posthog.capture(eventName, eventData); let apiBaseUrl; const hostname window.location.hostname; if (hostname.includes(localhost)) { apiBaseUrl https://tkry7yengl.execute-api.ap-south-1.amazonaws.com; } else if (hostname.includes(qa)) { apiBaseUrl https://tkry7yengl.execute-api.ap-south-1.amazonaws.com; } else if (hostname.includes(staging)) { apiBaseUrl https://76um31x0bi.execute-api.ap-south-1.amazonaws.com; } else { apiBaseUrl https://jmfiaoynz9.execute-api.ap-south-1.amazonaws.com; } if (eventData.user_id && eventData.user_id.length > 0) { this.postData(apiBaseUrl, { properties: eventData, event: eventName, user_id: eventData.user_id, }); } else { console.log( user id is not available to track event in backend : , eventName ); } } async postData(apiBaseUrl, data) { try { const response await fetch(`${apiBaseUrl}/create-event-record`, { method: POST, headers: { Content-Type: application/json, Authorization: this.getUrlParam(token), }, body: JSON.stringify(data), }); if (!response.ok) { throw new Error( `Error ${response.status}: ${response.statusText}` ); } const result await response.json(); return result; } catch (error) { console.error(API Error:, error); } } // async initializeFlutter() { // const engineInitializer await _flutter.loader.loadEntrypoint({ // serviceWorker: { // serviceWorkerVersion: serviceWorkerVersion, // }, // }); // const appRunner await engineInitializer.initializeEngine({ // renderer: canvaskit, // useColorEmoji: true, // }); // console.log(loading-tracking: app fully loaded) // document.getElementById(allenId).innerText // JSON.stringify(this.initResponse) ?? no response found, but message is received; // window.globalAppRunner appRunner; // const properties this.getTrackingProperties(); // properties.app_loading_duration_v2 this.dateDifferenceInSeconds( // this.firstStart, // new Date() // ); // this.trackData(app_entry_first_frame_v2, properties); // const windowPath window.location.pathname; // if ( // (!(windowPath.includes(sleep) || this.isAssessmentRouted) && // !(this.isRechargeNowRouted || this.isJoinMeetingHandlerRoute || this.isBoostProductivityRouted) || // window.isContinueFlutterRun true // )) { // appRunner.runApp(); // } // } } // Service worker registration if (serviceWorker in navigator) { window.addEventListener(load, function () { navigator.serviceWorker.register(/firebase-messaging-sw.js); }); } // Initialize the app const peakmindAppInstance new PeakMindApp(); async function initializeApp() { const engineInitializer await _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, }, }); const appRunner await engineInitializer.initializeEngine({ renderer: canvaskit, useColorEmoji: true, }); document.getElementById(allenId).innerText JSON.stringify(peakmindAppInstance.initResponse) ?? no response found, but message is received; window.globalAppRunner appRunner; const properties peakmindAppInstance.getTrackingProperties(); properties.app_loading_duration_v2 peakmindAppInstance.dateDifferenceInSeconds( peakmindAppInstance.firstStart, new Date() ); peakmindAppInstance.trackData(app_entry_first_frame_v2, properties); const windowPath window.location.pathname; if ( (!( windowPath.includes(sleep) || peakmindAppInstance.isAssessmentRouted ) && !( peakmindAppInstance.isRechargeNowRouted || peakmindAppInstance.isJoinMeetingHandlerRoute || peakmindAppInstance.isBoostProductivityRouted || peakmindAppInstance.isDashboardRoute )) || window.isContinueFlutterRun true ) { appRunner.runApp(); } } window.addEventListener(load, function (ev) { // ------------------------ FLUTTER INITIALIZATION ------------------------- // pItem.innerText --initializeFlutter : started setTimeout(() > { initializeApp(); }, 0); // ------------------------ FLUTTER INITIALIZATION ------------------------- }); /script> script defer srchttps://cdn.jsdelivr.net/npm/pdfjs-dist@2.12.313/build/pdf.min.js typetext/javascript > pdfjsLib.GlobalWorkerOptions.workerSrc https://cdn.jsdelivr.net/npm/pdfjs-dist@2.12.313/build/pdf.worker.min.js; pdfRenderOptions { cMapUrl: https://cdn.jsdelivr.net/npm/pdfjs-dist@2.12.313/cmaps/, cMapPacked: true, } /script> script srchttps://checkout.razorpay.com/v1/checkout.js>/script> /body>/html>
View on OTX
|
View on ThreatMiner
Please enable JavaScript to view the
comments powered by Disqus.
Data with thanks to
AlienVault OTX
,
VirusTotal
,
Malwr
and
others
. [
Sitemap
]