PageSourceSearch

https://dalea.ai/_next/static/chunks/app/admin/layout-f1248b682dc11eca.js

js dalea.ai collected 2026-10-05 13:43:07 UTC 7,440 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91],{3566:function(e,s,t){Promise.resolve().then(t.bind(t,8827))},8827:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return y}});var a=t(7437),n=t(2265),r=t(2749),l=t(4033),i=t(1396),c=t.n(i),o=t(2457),d=t(8253),m=t(9865),h=t(6637),x=t(9409),u=t(2549),f=t(5883),g=t(8004),p=t(826);function y(e){var s,t;let{children:i}=e,{data:y,status:b}=(0,r.useSession)(),[N,j]=(0,n.useState)([]),[v,w]=(0,n.useState)(!1),k=(0,l.usePathname)();async function _(){try{let e=await (0,p.S)("/api/users/me/roles");j(e)}catch(e){console.error("Failed to load user roles:",e)}}if((0,n.useEffect)(()=>{"unauthenticated"===b&&(0,r.signIn)("google")},[b]),(0,n.useEffect)(()=>{"authenticated"===b&&_()},[b]),"loading"===b)return(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600 mx-auto mb-4"}),(0,a.jsx)("p",{className:"text-gray-600",children:"Loading..."})]})});if("unauthenticated"===b)return null;let A=N.some(e=>"super_admin"===e.role_type||"SUPER_ADMIN"===e.role_type),E=N.some(e=>"org_admin"===e.role_type||"ORG_ADMIN"===e.role_type);N.some(e=>"div_admin"===e.role_type||"DIV_ADMIN"===e.role_type),N.some(e=>"teacher"===e.role_type||"TEACHER"===e.role_type);let C=[{name:"Metrics",href:"/admin/metrics",icon:o.Z,show:!0},{name:"Organizations",href:"/admin/organizations",icon:d.Z,show:A||E},{name:"Classes",href:"/admin/classes",icon:m.Z,show:!0},{name:"Assignments",href:"/admin/assignments",icon:h.Z,show:!0},{name:"Settings",href:"/admin/settings",icon:x.Z,show:A||E}];return(0,a.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[v&&(0,a.jsxs)("div",{className:"fixed inset-0 z-50 lg:hidden",children:[(0,a.jsx)("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-75",onClick:()=>w(!1)}),(0,a.jsxs)("div",{className:"fixed inset-y-0 left-0 flex w-64 flex-col bg-white shadow-xl",children:[(0,a.jsxs)("div",{className:"flex h-16 shrink-0 items-center justify-between px-6 border-b",children:[(0,a.jsxs)(c(),{href:"/",className:"flex items-center gap-3 hover:opacity-80 transition-opacity",children:[(0,a.jsx)("img",{src:"/logo.png",alt:"Dalea Logo",className:"h-8 w-8 rounded-lg"}),(0,a.jsx)("h1",{className:"text-xl font-bold text-gray-900",children:"Dalea Admin"})]}),(0,a.jsx)("button",{onClick:()=>w(!1),className:"text-gray-400 hover:text-gray-600",children:(0,a.jsx)(u.Z,{className:"h-5 w-5"})})]}),(0,a.jsx)("nav",{className:"flex-1 px-4 py-4",children:C.filter(e=>e.show).map(e=>(0,a.jsxs)(c(),{href:e.href,onClick:()=>w(!1),className:"group flex items-center px-2 py-2 text-sm font-medium rounded-md mb-1 ".concat(k===e.href?"bg-blue-100 text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[(0,a.jsx)(e.icon,{className:"mr-3 h-5 w-5"}),e.name]},e.name))})]})]}),(0,a.jsx)("div",{className:"hidden lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col",children:(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col bg-white border-r border-gray-200",children:[(0,a.jsx)("div",{className:"flex h-16 shrink-0 items-center px-6 border-b",children:(0,a.jsxs)(c(),{href:"/",className:"flex items-center gap-3 hover:opacity-80 transition-opacity",children:[(0,a.jsx)("img",{src:"/logo.png",alt:"Dalea Logo",className:"h-8 w-8 rounded-lg"}),(0,a.jsx)("h1",{className:"text-xl font-bold text-gray-900",children:"Dalea Admin"})]})}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col overflow-y-auto",children:[(0,a.jsx)("nav",{className:"flex-1 px-4 py-4",children:C.filter(e=>e.show).map(e=>(0,a.jsxs)(c(),{href:e.href,className:"group flex items-center px-2 py-2 text-sm font-medium rounded-md mb-1 ".concat(k===e.href?"bg-blue-100 text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[(0,a.jsx)(e.icon,{className:"mr-3 h-5 w-5"}),e.name]},e.name))}),(0,a.jsx)("div",{className:"border-t border-gray-200 p-4",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-900 truncate",children:(null==y?void 0:null===(s=y.user)||void 0===s?void 0:s.name)||(null==y?void 0:null===(t=y.user)||void 0===t?void 0:t.email)}),(0,a.jsx)("p",{className:"text-xs text-gray-500 truncate",children:N.map(e=>e.role_type).join(", ")})]}),(0,a.jsx)("button",{onClick:async()=>{await (0,r.signOut)({callbackUrl:"/",redirect:!1}),window.location.href="/"},className:"ml-3 flex-shrink-0 p-1 text-gray-400 hover:text-gray-600",children:(0,a.jsx)(f.Z,{className:"h-4 w-4"})})]})})]})]})}),(0,a.jsxs)("div",{className:"lg:pl-64",children:[(0,a.jsxs)("div",{className:"sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b border-gray-200 bg-white px-4 shadow-sm lg:hidden",children:[(0,a.jsx)("button",{onClick:()=>w(!0),className:"text-gray-700 hover:text-gray-900",children:(0,a.jsx)(g.Z,{className:"h-6 w-6"})}),(0,a.jsxs)("div",{className:"flex flex-1 gap-x-4 self-stretch lg:gap-x-6",children:[(0,a.jsx)("div",{className:"flex flex-1 items-center",children:(0,a.jsx)("h1",{className:"text-lg font-semibold text-gray-900",children:"Admin Portal"})}),(0,a.jsx)("div",{className:"flex items-center gap-x-4 lg:gap-x-6",children:(0,a.jsx)("button",{onClick:async()=>{await (0,r.signOut)({callbackUrl:"/",redirect:!1}),window.location.href="/"},className:"text-gray-400 hover:text-gray-600",children:(0,a.jsx)(f.Z,{className:"h-5 w-5"})})})]})]}),(0,a.jsx)("main",{className:"py-6",children:(0,a.jsx)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:i})})]})]})}},826:function(e,s,t){"use strict";t.d(s,{S:function(){return r}});var a=t(1651),n=t(2749);async function r(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{let t=await (0,n.getSession)(),r=null==t?void 0:t.idToken;console.log("API Request:",{url:"".concat(a.vc.apiUrl).concat(e),method:s.method||"GET",hasAuth:!!r,session:!!t,tokenLength:r?r.length:0});let l="undefined"!=typeof FormData&&s.body instanceof FormData,i=await fetch("".concat(a.vc.apiUrl).concat(e),{...s,headers:{...l?{}:{"Content-Type":"application/json"},...s.headers||{},...r?{Authorization:"Bearer ".concat(r)}:{}},cache:"no-store"});if(console.log("API Response:",{status:i.status,statusText:i.statusText,url:i.url}),!i.ok){let e=await i.text().catch(()=>"");throw console.error("API Error Response:",e),Error("".concat(i.status," ").concat(i.statusText,": ").concat(e))}if((i.headers.get("content-type")||"").includes("application/json"))return i.json();return i.text()}catch(e){throw console.error("API Fetch Error:",e),console.error("Error type:",e.constructor.name),console.error("Error message:",e.message),e}}},1651:function(e,s,t){"use strict";t.d(s,{Hv:function(){return n},vc:function(){return a}});let a={apiUrl:t(2601).env.NEXT_PUBLIC_API_URL||"",siteName:"Dalea",siteDescription:"AI-powered dance practice app where students compare their recordings with teacher videos to perfect their technique at home.",contactEmail:"[email protected]",supp
1ortPhone:"+1 (847) 452-7663",social:{twitter:"",facebook:"",instagram:"",linkedin:""},features:{enableAnalytics:!0,enableErrorReporting:!0}},n={contact:"".concat(a.apiUrl,"/api/public/contact"),feedback:"".concat(a.apiUrl,"/api/public/feedback")}}},function(e){e.O(0,[749,837,971,938,744],function(){return e(e.s=3566)}),_N_E=e.O()}]);

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.