PageSourceSearch

https://ims.drmgrdu.ac.in/client/chunk-TSLDZNPU.js

js drmgrdu.ac.in collected 2026-09-24 18:46:12 UTC 6,484 bytes, 1 lines download raw bytes

1import{D as B,F as _,a as x,e as z}from"./chunk-CIG4DQXI.js";import{b as O}from"./chunk-L4KS4O4D.js";import{a as d,d as p,e as y,f as F,h as L,i as j,n as I,o as C}from"./chunk-OBL3UMJK.js";import{a as w}from"./chunk-3CO4C5KT.js";import{a as U}from"./chunk-A7DVSW7U.js";import{c as P}from"./chunk-D6CDOXMU.js";import{a as b}from"./chunk-7Q5L7ALI.js";import{H as h,N as v,U as R,Wc as E,_ as k,ba as a,id as A,l as g,n}from"./chunk-32W73H3G.js";var ie=(()=>{class u{loaderService;router;toastr;cookieService;userService;authTokenService;loginService;refreshInFlight=null;static REFRESH_RETRY_HEADER="X-JP-Refresh-Retried";constructor(e,t,s,i,r,l,o){this.loaderService=e,this.router=t,this.toastr=s,this.cookieService=i,this.userService=r,this.authTokenService=l,this.loginService=o}intercept(e,t){let s=this.attachAuthTransport(e);return this.isStudentSession()&&!O(s.url||"")?(this.toastr.error("This action is not available in the student portal. Use the menu or contact support.","Not allowed",{timeOut:5e3,progressBar:!0,closeButton:!0,positionClass:"toast-top-center"}),n(()=>new E({status:403,statusText:"Student API allowlist",url:s.url}))):(this.loaderService.show(),t.handle(s).pipe(h(i=>{if(i.status===401)return this.handleUnauthorizedWithRefresh(s,t,i);if(i.status===403){let r=this.extractErrorMessage(i)||"Sorry!, This feature not available to you.";!this.shouldSuppressAttendanceExtensionQueueForbiddenToast(e,r)&&!this.shouldSuppressAttendanceSessionEditForbiddenToast(e)&&!this.shouldSuppressAttendanceOptionalLessonPlanReadToast(e)&&this.toastr.error(r,"Access Denied",{timeOut:4e3,progressBar:!0,closeButton:!0,positionClass:"toast-top-center"})}else if(i.status>=400){let r=this.extractErrorMessage(i)||"Request failed. Please try again.";this.shouldSuppressExpectedStudentV2UserMissingToast(e,i,r)||!this.shouldSuppressOptionalSubjectInsightToast(e,r)&&!this.shouldSuppressElectiveTimetableToast(e)&&this.toastr.error(r,"Request failed",{timeOut:5e3,progressBar:!0,closeButton:!0,positionClass:"toast-top-center"})}return n(i)}),v(()=>this.loaderService.hide())))}handleUnauthorizedWithRefresh(e,t,s){let i=this.getEffectiveRoutePath().toLowerCase(),r=L(e.url||""),l=d(i),o=i.includes("/student-application/temp-student/")||i.includes("/student-application/revaluation-temp-student/")||i.includes("/student-application/revaluation-login")||i.includes("/student-application/login"),f=!!this.authTokenService.getToken(),M=i.includes("/student-application/");if(r||l||o||f&&M)return n(s);if(!f)return n(s);if(e.url.includes("/api/authendicate/refresh")||e.url.includes("/api/authendicate/logout"))return l||o?n(s):(this.finalizeUnauthorized(),n(s));if(e.headers.has(u.REFRESH_RETRY_HEADER))return this.finalizeUnauthorized(),n(s);let S=this.authTokenService.getToken()||"",m=p(e.url||"");return!!m&&!!S&&m!==S?n(s):g(this.tryRefreshToken()).pipe(R(c=>{if(c){let T=this.attachAuthTransport(e),D=T.clone({headers:T.headers.set(u.REFRESH_RETRY_HEADER,"1")});return t.handle(D)}return this.finalizeUnauthorized(),n(s)}),h(c=>(this.finalizeUnauthorized(),n(c))))}finalizeUnauthorized(){let e=this.getEffectiveRoutePath().toLowerCase();if(d(e)){this.clearAuthSession();return}let t=this.hadValidSessionInTab();if(this.clearAuthSession(),!t){this.router.navigate(["/login"],{replaceUrl:!0});return}z()||this.toastr.info("Login Session Expired","Info",{timeOut:3e3,progressBar:!0,closeButton:!0,positionClass:"toast-top-center"}),this.router.navigate(["/login"],{replaceUrl:!0,queryParams:t?{[x]:"1"}:void 0})}getEffectiveRoutePath(){let e=(window.location.pathname||"").split("?")[0],t=((window.location.hash||"").replace(/^#/,"")||"").split("?")[0],s=((this.router.url||"").replace(/^#/,"")||"").split("?")[0];return!!s&&s!=="/"&&s!=="/#"?s:t&&t!=="/"?t:e||s||"/"}tryRefreshToken(){return this.refreshInFlight?this.refreshInFlight:(this.refreshInFlight=this.loginService.refreshSession().then(e=>{let t=e&&e.token?String(e.token):"";return t?(this.authTokenService.setToken(t),!0):!1}).catch(()=>!1).finally(()=>{this.refreshInFlight=null}),this.refreshInFlight)}
1isStudentSession(){try{let e=this.cookieService.get("currentUser");if(!e)return!1;let t=typeof e=="string"?JSON.parse(e):e;return String(t?.userType||t?.usertype||"").toUpperCase()==="STUDENT"}catch{return!1}}attachAuthTransport(e){let t=e.url||"";if(!F(t))return e;let s=p(t),r=j(t)||I(t)||C(t)?s||"":s||this.authTokenService.getToken()||"";s&&this.authTokenService.rememberToken(s);let l=y(t),o=e.clone({url:l,withCredentials:!0});return r&&(o=o.clone({setHeaders:{Authorization:`Bearer ${r}`}})),o}clearAuthSession(){this.userService.clearSessionCaches(),this.authTokenService.clearToken(),this.cookieService.remove("currentUser");try{sessionStorage.removeItem("jp_session_valid")}catch{}}hadValidSessionInTab(){try{return sessionStorage.getItem("jp_session_valid")==="1"}catch{return!1}}shouldSuppressExpectedStudentV2UserMissingToast(e,t,s){return t.status!==400||!e.url.includes("/api/authendicate/student/v2")||!s.toLowerCase().includes("user not found")?!1:e.url.includes("/api/authendicate/student/v2/start")||e.url.includes("/api/authendicate/student/v2?")}shouldSuppressOptionalSubjectInsightToast(e,t){return e.url.includes("/subCOPOReport/")?t.toLowerCase().includes("invalid id"):!1}shouldSuppressElectiveTimetableToast(e){return e.method==="PUT"&&e.url.includes("/api/subject/timetable/")}shouldSuppressAttendanceExtensionQueueForbiddenToast(e,t){let s=(e.url||"").toLowerCase();return!(s.includes("/api/attendance-extension-request/pending")||s.includes("/api/attendance-extension-request/queue/"))||e.method!=="GET"?!1:t.toLowerCase().includes("attendance extension request")}shouldSuppressAttendanceSessionEditForbiddenToast(e){if(e.method!=="GET")return!1;let t=(e.url||"").toLowerCase();return t.includes("/api/attendance/sessions/")&&t.includes("mode=edit")}shouldSuppressAttendanceOptionalLessonPlanReadToast(e){if(e.method!=="GET")return!1;let t=(e.url||"").toLowerCase();return t.includes("/api/lessonplan/bysubjectid")||t.includes("/api/lessonplan/completedlpd/")}extractErrorMessage(e){let t=e?.error;if(!t)return null;if(typeof t=="string"){let s=t.trim();if(s.startsWith("{"))try{let i=JSON.parse(s);return i?.error||i?.message||null}catch{return s}return s||null}return typeof t=="object"&&(t.error||t.message)||null}static \u0275fac=function(t){return new(t||u)(a(U),a(A),a(b),a(w),a(P),a(_),a(B))};static \u0275prov=k({token:u,factory:u.\u0275fac})}return u})();export{ie as a};

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.