1import{b6 as o}from"./vendor-zhMaIzr7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"sdui-frontend@production-2025.1.0-76805658161c38b7d3a7323645f40433d6ce9cc2"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="57cf7cca-334b-41bd-9e09-23a2f19efec0",e._sentryDebugIdIdentifier="sentry-dbid-57cf7cca-334b-41bd-9e09-23a2f19efec0")}catch{}})();var l=(e=>(e.SESSION="session",e.INTERACTION="interaction",e.ACTION="action",e.START_ACTION="startAction",e.END_ACTION="endAction",e))(l||{}),u=(e=>(e.ABSENCE="absence",e.ADMIN="admin",e.APP="app",e.APP_SWITCHER="appSwitcher",e.AUTH="auth",e.CALENDAR="calendar",e.CALENDAR_EVENT="calendarEvent",e.CHANNEL="channel",e.CHANNEL_MESSAGE="channelMessage",e.CHAT="chat",e.CHAT_MESSAGE="chatMessage",e.CLASSBOOK="classbook",e.CLOUD="cloud",e.COURSE_MEMBER="courseMember",e.DIGITAL_CLASS="digitalClass",e.DISCOVERY="discovery",e.GROUP="group",e.GROUPS="groups",e.HOMEWORK="homework",e.MORE="more",e.NEWS="news",e.AI="ai",e.NOTICE="notice",e.NOTIFICATION_CENTER="notificationCenter",e.PUSH="push",e.STUDENT_STATISTICS="studentStatistics",e.SURVEY="survey",e.TABLE="table",e.TIMETABLE="timetable",e.TRANSLATE="translate",e.TUTORIAL="tutorial",e.USER_AUTHENTICATION="userAuthentication",e.USER_SETTINGS="userSettings",e))(u||{}),d=(e=>(e.USE="use",e.SESSION="session",e))(d||{}),g=(e=>(e.FEATURE="feature",e))(g||{});async function h(e){const t=(n=>{const s=encodeURIComponent(n),r=new Uint8Array(s.length);for(let a=0;a<s.length;a++)r[a]=s.charCodeAt(a);return r})(e),i=n=>Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("");return crypto?crypto.subtle.digest("SHA-256",t).then(n=>i(n)):window.msCrypto.subtle.digest("SHA-256",t).then(n=>i(n))}function f(e,t){const i=["app_key","url"].filter(n=>!e[n]);i.length>0&&console.error(`[${t}] Missing required config: ${i.join(", ")}`);try{new URL(e.url)}catch{console.error(`[${t}] Invalid server URL format`)}}function p(e,t,i){if(!e||typeof e!="string")return!1;const n=e.split("-");if(n.length<2)return!1;const s=n[n.length-1];if(!Object.values(t).includes(s))return!1;const r=e.substring(0,e.lastIndexOf("-"));return Object.values(i).some(a=>r===a)}const c=["sessions","events","views","users","feedback","remote-config","content"];class m{constructor(t,i=()=>({}),n=()=>{var s;return(s=window==null?void 0:window.location)==null?void 0:s.pathname}){this.getSegmentation=i,this.getRouteName=n,this.active=!1,this.pageChangeTimeout=null,this.initPromise=null,f(t,"SduiAnalytics"),this.config=t}async init(t){if(this.initPromise)return this.initPromise;if(!this.active)return this.initPromise=this.initialize(t),this.initPromise}async initialize(t){try{const i=t?await h(t.id):void 0;this.setupCountlyConfig(i),this.startTracking(),this.enableTrackingFeatures(),this.setProfile(t)}catch(i){console.error("[SduiAnalytics] Failed to initialize Countly",i)}finally{this.initPromise=null}}setupCountlyConfig(t){t&&(o.getViewUrl=this.getRouteName.bind(this),o.getViewName=this.getRouteName.bind(this),o.init({...this.config,require_consent:!0,clear_stored_id:!0,enable_orientation_tracking:!1,namespace:"user",device_id:t,remote_config:!0}))}async setProfile(t){t&&o.user_details({organization:t.organization,custom:t.custom})}startTracking(){o.add_consent(c),this.active=!0}enableTrackingFeatures(){o.track_sessions(),o.track_pageview(),o.content.enterContentZone()}stopTracking(){this.active&&(o.remove_consent(c),this.active=!1)}handleRouteNavigation(t,i){if(!this.active)return;const n=this.getRouteName(t),s=this.getRouteName(i);t.path===i.path&&n===s||(this.pageChangeTimeout&&clearTimeout(this.pageChangeTimeout),this.pageChangeTimeout=setTimeout(()=>{console.info(`%c ROUTER => Route: ${n}!`,"background: #e23467; color: #fff"),this.trackNewPageView()},0))}trackNewPageView(){var t;o.track_pageview(void 0,void 0,(t=this.getSegmentation)==null?void 0:t.call(this))}addEvent(t,i){var s;if(!this.active){console.warn("[SduiAnalytics] is not active");return}if(!p(t,l,u)){console.error(`[SduiAnalytics] Event ${t}
1 not valid!`);return}const n={key:t,segmentation:{...(s=this.getSegmentation)==null?void 0:s.call(this),...this.actionParamsToKebabCase(i)}};o.q.push([this.config.app_key,"add_event",n])}actionParamsToKebabCase(t){return t.action?{...t,action:t.action.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:t}handleFeedbackWidgets(t,i,n,s){if(s){console.log(s);return}const r=n.find(a=>a._id===t);if(!r){console.error(`[Countly] No ${t} widget found`);return}o.q.push([this.config.app_key,"present_feedback_widget",r,i,void 0,void 0])}reportFeedback({widgetId:t,selectorId:i}){this.active&&o.q.push([this.config.app_key,"get_available_feedback_widgets",(n,s)=>{this.handleFeedbackWidgets(t,i,n,s)}])}fetchConfig(t){if(this.active)try{return o.get_remote_config(t)}catch(i){return console.error("[SduiAnalytics] Failed to fetch config",i),null}}closeSurvey({widgetId:t}){this.active&&o.q.push([this.config.app_key,"add_event",{key:"[CLY]_survey",segmentation:{widget_id:t,closed:1}}])}}const y=["events","users","location"];class v{constructor(t,i=()=>({})){this.getSegmentation=i,this.active=!1,this.initPromise=null,f(t,"GlobalAnalytics"),this.config=t}async init(t){if(this.initPromise)return this.initPromise;if(!this.active)return this.initPromise=this.initialize(t),this.initPromise}async initialize(t){try{const i=t&&await h(t.uuid);this.setupCountlyConfig(i),o.q.push([this.config.app_key,"add_consent",y]),this.setProfile(t),this.active=!0}catch(i){console.error("[GlobalAnalytics] Failed to initialize Countly",i)}finally{this.initPromise=null}}setupCountlyConfig(t){t&&o.q.push(["init",{app_key:this.config.app_key,url:this.config.url,debug:this.config.debug,device_id:t,clear_stored_id:!0,enable_orientation_tracking:!1,namespace:"global",require_consent:!0}])}handleRouteNavigation(){}async setProfile(t){t&&o.q.push([this.config.app_key,"user_details",{organization:t.organization,custom:t.custom}])}stopTracking(){this.active&&(this.active=!1)}trackNewPageView(){var t;o.q.push([this.config.app_key,"track_pageview",void 0,void 0,(t=this.getSegmentation)==null?void 0:t.call(this)])}addEvent(t,i){var s;if(!this.active){console.warn("[GlobalAnalytics] is not active");return}if(!p(t,d,g)){console.error(`[GlobalAnalytics] Event ${t} not valid!`);return}const n={key:t,segmentation:{...(s=this.getSegmentation)==null?void 0:s.call(this),...i}};o.q.push([this.config.app_key,"add_event",n])}reportFeedback({widgetId:t,selectorId:i}){this.active&&console.log("reportFeedback",t,i,this.config.app_key)}}export{v as T,m as y}; 2//# sourceMappingURL=sdui-tracking-4enUAsiT.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.