PageSourceSearch

https://xterns.ai/assets/XternLearning-TWxfJ1Iz.js

js xterns.ai collected 2026-10-05 13:24:07 UTC 23,264 bytes, 52 lines download raw bytes

1import{f as he,r as j,s as V,u as xe,j as e,B,A as de,h as Q,i as se,J as A,k as te,l as ge,m as W,a4 as fe,a7 as me,T as je,o as Ne,aK as _e,bt as be,bu as ve,a6 as ye,X as Se}from"./index-DLd_kDlx.js";import{u as we}from"./useAILearningRecommendations-jJczlYHr.js";import{B as D}from"./book-open-BSYsXyfC.js";import{S as Ee}from"./star-BH1OFEcs.js";import{E as Ce}from"./external-link-D0CFvOTk.js";import{P as Te}from"./play-rljZUdXx.js";import{B as Le}from"./book-D_JgnLFI.js";import{V as Ie}from"./video-DM4J6B9K.js";import{L as pe}from"./loader-circle-D2miE2xB.js";import{T as Ae,a as Re,b as Z,c as ee}from"./tabs-DKw2ItQa.js";import{T as ke}from"./textarea-C6X-I43k.js";import{S as J}from"./search-DFH5eAlA.js";import{L as Pe}from"./lightbulb-BpXO0eKD.js";import{X as Me}from"./XternTopbar-CTWW4Hoo.js";import{R as Oe}from"./refresh-cw-CoPjtj5-.js";import"./useLearningResources-UHJHnByl.js";import"./index-lTaZyIGy.js";import"./index-Deh-4PO1.js";import"./NotificationIcon-C1wwYnH5.js";import"./popover-BMD5FOmU.js";import"./scroll-area-BXTuUF24.js";import"./index-BdQq_4o_.js";import"./NotificationItem-Dc2WXW-y.js";import"./formatDistanceToNow-57P64IbE.js";import"./en-US-9SRVm7yB.js";import"./differenceInCalendarMonths-BA0TPVs2.js";import"./endOfDay-DkR3ZXc8.js";import"./endOfMonth-CYn6pTOm.js";import"./message-square-CtxeCfRz.js";import"./trophy-DBX-jNOC.js";import"./triangle-alert-Chqk_WK7.js";import"./arrow-right-left-C4CM-5rU.js";const Be=()=>{const{user:s}=he(),[u,h]=j.useState({pods:[],projects:[],stories:[],tasks:[],isLoading:!0,error:null});return j.useEffect(()=>{if(!(s!=null&&s.id))return;(async()=>{try{h(r=>({...r,isLoading:!0,error:null}));const{data:i,error:d}=await V.from("pod_members").select(`
2            pod_id,
3            pods!inner (
4              id,
5              pod_name,
6              project_id,
7              status,
8              tech_lead_id,
9              projects!inner (
10                id,
11                title,
12                description,
13                technologies,
14                difficulty_level
15              )
16            )
17          `).eq("user_id",s.id).eq("status","active");if(d)throw d;const b=(i==null?void 0:i.map(r=>r.pods))||[],g=b.map(r=>r.projects).filter(Boolean),o=g.map(r=>r.id);let f=[],p=[];if(o.length>0){const{data:r,error:S}=await V.from("roadmap_stories").select(`
18              id,
19              title,
20              description,
21              status,
22              assignee_id,
23              acceptance_criteria,
24              epic_id,
25              roadmap_epics!inner (
26                project_id
27              )
28            `).in("roadmap_epics.project_id",o).or(`assignee_id.eq.${s.id},assignee_id.is.null`);if(S)throw S;f=r||[];const v=f.map(w=>w.id);if(v.length>0){const{data:w,error:$}=await V.from("roadmap_tasks").select("*").in("story_id",v).or(`assignee_id.eq.${s.id},assignee_id.is.null`);if($)throw $;p=w||[]}}h({pods:b,projects:g,stories:f,tasks:p,isLoading:!1,error:null})}catch(i){console.error("Error fetching project context:",i),h(d=>({...d,isLoading:!1,error:i.message||"Failed to fetch project context"}))}})()},[s==null?void 0:s.id]),u},De=()=>{const[s,u]=j.useState([]),[h,x]=j.useState([]),[i,d]=j.useState([]),[b,g]=j.useState(!0),[o,f]=j.useState(null),{user:p}=he(),r=async()=>{if(!(p!=null&&p.id))return null;const{data:t,error:_}=await V.from("xterns_profiles").select("skills, preferred_roles").eq("user_id",p.id).maybeSingle();return _&&_.code!=="PGRST116"&&console.error("Error fetching user profile:",_),t},S=(t,_)=>{if(_.length===0||!t||t.length===0)return!0;const E={frontend:["frontend","fullstack"],backend:["backend","fullstack"],fullstack:["frontend","backend","fullstack"],"database-admin":["database-admin","devops","backend"],devops:["devops","database-admin"],"arvr-dev":["arvr-dev","frontend"]};return _.some(C=>{const L=E[C]||[C];return t.some(R=>L.includes(R))})},v=(t,_,E)=>{var I,k,n,c;let C=0;const L=((I=t.projects.career_paths)==null?void 0:I.filter(a=>E.includes(a)).length)||0,R=L>0?L/Math.max(((k=t.projects.career_paths)==null?void 0:k.length)||1,E.length)*60:0,F=((n=t.projects.te
28chnologies)==null?void 0:n.filter(a=>_.some(N=>N.toLowerCase().includes(a.toLowerCase())||a.toLowerCase().includes(N.toLowerCase()))).length)||0,U=F>0?F/Math.max(((c=t.projects.technologies)==null?void 0:c.length)||1,_.length)*40:0;return C=R+U,Math.round(C*100)/100},w=async()=>{try{g(!0),f(null);const t=await r(),_=(t==null?void 0:t.skills)||[],E=(t==null?void 0:t.preferred_roles)||[];d(E);const{data:C}=await V.from("project_applications").select("project_id, pod_id").eq("user_id",p==null?void 0:p.id).eq("status","pending"),L=new Set((C||[]).filter(a=>a.pod_id).map(a=>a.pod_id)),R=new Set((C||[]).filter(a=>!a.pod_id).map(a=>a.project_id)),{data:F,error:U}=await V.from("pods").select(`
29          id,
30          pod_name,
31          project_id,
32          tech_lead_id,
33          max_members,
34          current_members,
35          status,
36          recruiting_phase,
37          completion_deadline,
38          created_at,
39          projects (
40            title,
41            description,
42            career_paths,
43            technologies,
44            duration_weeks,
45            difficulty_level
46          ),
47          tech_leads_public_v (
48            full_name,
49            bio,
50            years_experience
51          )
52        `).eq("status","recruiting").in("recruiting_phase",["active_recruiting","waiting_minimum"]).order("created_at",{ascending:!1});if(U)throw U;let I=(F||[]).map(a=>({...a,tech_leads:a.tech_leads_public_v}));I=I.filter(a=>!L.has(a.id)&&!R.has(a.project_id));const k=I.filter(a=>S(a.projects.career_paths,E)),c=k.map(a=>({...a,match_score:v(a,_,E)})).filter(a=>a.match_score>=30).sort((a,N)=>(N.match_score||0)-(a.match_score||0));u(c),x(k)}catch(t){console.error("Error fetching pods:",t),f(t instanceof Error?t.message:"Failed to fetch pods")}finally{g(!1)}},$=(t,_)=>!t.projects.career_paths||t.projects.career_paths.length===0?!0:S(t.projects.career_paths,_);return j.useEffect(()=>{w()},[p==null?void 0:p.id]),{recommendedPods:s,allPods:h,userCareerPaths:i,isLoading:b,error:o,canApplyToPod:$,refetch:w}},$e=({recommendations:s,storyId:u,storyTitle:h,isLoading:x,onRes
52ourceClick:i,isModalContext:d=!1})=>{const b=xe(),g=r=>{switch(r){case"beginner":return"bg-green-100 text-green-800";case"intermediate":return"bg-yellow-100 text-yellow-800";case"advanced":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},o=r=>{switch(r){case"video":return e.jsx(Ie,{className:"w-4 h-4"});case"article":return e.jsx(me,{className:"w-4 h-4"});case"course":return e.jsx(Le,{className:"w-4 h-4"});case"tutorial":return e.jsx(Te,{className:"w-4 h-4"});case"documentation":return e.jsx(D,{className:"w-4 h-4"});default:return e.jsx(me,{className:"w-4 h-4"})}},f=r=>{d?b(`/xterns/learning/resource/${r.id}`,{state:{resource:r}}):i?i(r):window.open(r.url,"_blank")},p=()=>{b("/xterns/learning?tab=recommendations")};return x?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),e.jsx("span",{className:"ml-2 text-gray-600",children:"Generating personalized learning recommendations..."})]}):s.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(D,{className:"w-12 h-12 mx-auto mb-4 text-gray-400"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Learning Recommendations"}),e.jsx("p",{className:"text-gray-600",children:"Generate recommendations from the projects tab or try a custom search."})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:["Learning Recommendations for: ",h]}),e.jsxs("p",{className:"text-gray-600",children:["Found ",s.length," personalized learning resources"]})]}),d&&e.jsxs(B,{onClick:p,variant:"outline",size:"sm",children:["View All",e.jsx(de,{className:"w-4 h-4 ml-2"})]})]}),e.jsx("div",{className:`grid gap-4 ${d?"md:grid-cols-1 lg:grid-cols-2":"md:grid-cols-2 lg:grid-cols-3"}`,children:s.slice(0,d?6:s.length).map(r=>e.jsxs(Q,{className:"hover:shadow-md transition-shadow",children:[e.jsxs(se,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o(r.type),e.jsx(A,{variant:"outline",className:"text-xs capitalize",children:r.type})]}),e.jsx(A,{className:g(r.difficulty),children:r.difficulty})]}),e.jsx(te,{className:"text-sm leading-tight line-clamp-2",children:r.title}),e.jsx(ge,{className:"text-xs line-clamp-2",children:r.description})]}),e.jsxs(W,{className:"pt-0 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[e.jsx("span",{className:"truncate",children:r.provider}),r.duration&&e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx(fe,{className:"w-3 h-3"}),r.duration]})]}),e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx(Ee,{className:"w-3 h-3 text-yellow-500 fill-current"}),e.jsxs("span",{children:[(r.relevanceScore*100).toFixed(0),"% relevant"]})]}),r.tags.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1",children:[r.tags.slice(0,2).map((S,v)=>e.jsx(A,{variant:"secondary",className:"text-xs",children:S},v)),r.tags.length>2&&e.jsxs(A,{variant:"secondary",className:"text-xs",children:["+",r.tags.length-2]})]}),e.jsx(B,{onClick:()=>f(r),className:"w-full",size:"sm",children:d?e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"w-3 h-3 mr-2"}),"View Details"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{className:"w-3 h-3 mr-2"}),"Open ",r.type]})})]})]},r.id))}),d&&s.length>6&&e.jsx("div",{className:"text-center pt-4",children:e.jsxs(B,{onClick:p,variant:"outline",children:["View All ",s.length," Recommendations",e.jsx(de,{className:"w-4 h-4 ml-2"})]})})]})},Fe=({project:s,pod:u,onGenerateRecommendations:h,storiesCount:x,tasksCount:i,isLoading:d=!1})=>{const b=o=>{switch(o==null?void 0:o.toLowerCase()){case"beginner":return"bg-green-100 text-green-800";case"intermediate":return"bg-yellow-100 text-yellow-800";case"advanced":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},g=()=>{h(s.id,s.title,{...s,pod_name:u.pod_name,stories_count:x,tasks_count:i})};return e.jsxs(Q,{className:"h-full rounded-[20px] border-slate-200/70 shadow-[0_10px_30px_rgba(15,23,42,0.04)] transition-all hover:-translate-y-1 hover:shadow-[0_18px_42px_rgba(15,23,42,0.08)]",children:[e.jsx(se,{className:"p-5 pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(te,{className:"line-clamp-1 text-base font-semibold text-slate-950",children:s.title}),e.jsxs(ge,{className:"mt-1 text-sm text-slate-500",children:["Pod: ",u.pod_name]})]}),e.jsx(A,{className:`${b(s.difficulty_level)} rounded-full border-0`,children:s.difficulty_level||"Intermediate"})]})}),e.jsxs(W,{className:"space-y-4 p-5 pt-2",children:[e.jsx("p",{className:"line-clamp-2 text-sm leading-6 text-slate-600",children:s.description}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-slate-500",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(je,{className:"w-4 h-4"}),x," stories"]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(D,{className:"w-4 h-4"}),i," tasks"]})]}
52),s.technologies&&s.technologies.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.technologies.slice(0,4).map((o,f)=>e.jsx(A,{variant:"outline",className:"text-xs",children:o},f)),s.technologies.length>4&&e.jsxs(A,{variant:"outline",className:"text-xs",children:["+",s.technologies.length-4," more"]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(B,{onClick:g,className:"h-9 rounded-full bg-blue-600 px-4 hover:bg-blue-700",size:"sm",disabled:d,children:d?e.jsxs(e.Fragment,{children:[e.jsx(pe,{className:"mr-2 h-4 w-4 animate-spin"}),"Generating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"mr-2 h-4 w-4"}),"Recommendations"]})})})]})]})},Ue=({onSearch:s,isSearching:u,projectContext:h})=>{const[x,i]=j.useState(""),d=()=>{x.trim()&&s(x.trim(),h)},b=o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),d())},g=["React hooks best practices","TypeScript for beginners","Database design fundamentals","API testing with Postman","CSS Grid vs Flexbox","Git workflow strategies"];return e.jsxs(Q,{id:"custom-search-panel",children:[e.jsx(se,{children:e.jsxs(te,{className:"flex items-center gap-2",children:[e.jsx(J,{className:"w-5 h-5"}),"Custom Learning Search"]})}),e.jsxs(W,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ke,{placeholder:"Describe what you want to learn... e.g., 'Show me beginner-friendly React tutorials' or 'I need help with database normalization'",value:x,onChange:o=>i(o.target.value),onKeyPress:b,rows:3,className:"resize-none"}),e.jsx(B,{onClick:d,disabled:!x.trim()||u,className:"w-full",children:u?e.jsxs(e.Fragment,{children:[e.jsx(pe,{className:"w-4 h-4 mr-2 animate-spin"}),"Searching..."]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),"Search for Resources"]})})]}),h&&e.jsxs("div",{className:"p-3 bg-blue-50 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Pe,{className:"w-4 h-4 text-blue-600"}),e.jsx("span",{className:"text-sm font-medium text-blue-900",children:"Enhanced with your project context"})]}),e.jsx("p",{className:"text-xs text-blue-700",children:"Your search will be enhanced with context from your current projects and technologies."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Quick suggestions:"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:g.map((o,f)=>e.jsx(A,{variant:"outline",className:"cursor-pointer hover:bg-gray-100 text-xs",onClick:()=>i(o),children:o},f))})]})]})]})},Ve="rounded-2xl border border-gray-200/80 bg-white shadow-[0_12px_36px_rgba(15,23,42,0.06)]",bs=()=>{const s=Be(),{userCareerPaths:u}=De(),{recommendations:h,isLoading:x,generateRecommendations:i,clearRecommendations:d}=we(),[b,g]=j.useState("projects"),[o,f]=Ne(),[p,r]=j.useState(null),[S,v]=j.useState(null),w=j.useRef(!1),$=xe(),t={RECOMMENDATIONS:"xtern-learning-recommendations",ACTIVE_TAB:"xtern-learning-active-tab",SOURCE_LABEL:"xtern-learning-source-label",CACHE_TIMESTAMP:"xtern-learning-cache-timestamp"},_=1800*1e3;j.useEffect(()=>{const n=sessionStorage.getItem(t.RECOMMENDATIONS),c=sessionStorage.getItem(t.ACTIVE_TAB),a=sessionStorage.getItem(t.SOURCE_LABEL),N=sessionStorage.getItem(t.CACHE_TIMESTAMP),m=N&&Date.now()-parseInt(N)<_;if(c&&["projects","recommendations","custom"].includes(c)&&g(c),a&&m&&v(a),n&&m)try{JSON.parse(n).length>0&&(w.current=!0,console.log("Loaded cached recommendations, skipping preload"))}catch(l){console.error("Error parsing cached recommendations:",l),sessionStorage.removeItem(t.RECOMMENDATIONS),sessionStorage.removeItem(t.CACHE_TIMESTAMP)}else m||(sessionStorage.removeItem(t.RECOMMENDATIONS),sessionStorage.removeItem(t.CACHE_TIMESTAMP),sessionStorage.removeItem(t.SOURCE_LABEL))},[]);const E=()=>{sessionStorage.setItem(t.RECOMMENDATIONS,JSON.stringify(h)),sessionStorage.setItem(t.ACTIVE_TAB,b),sessionStorage.setItem(t.CACHE_TIMESTAMP,Date.now().toString()),S&&sessionStorage.setItem(t.SOURCE_LABEL,S)};j.useEffect(()=>{h.length>0&&(sessionStorage.setItem(t.RECOMMENDATIONS,JSON.stringify(h)),sessionStorage.setItem(t.CACHE_TIMESTAMP,Date.now().toString()))},[h]),j.useEffect(()=>{const n=o.get("story"),c=o.get("context");o.get("tab")==="recommendations"&&g("recommendations"),n&&c&&(i({id:n,title:c,description:`Learning resources for story: ${c}`}),g("recommendations"))},[o,i]),j.useEffect(()=>{if(!(!s.isLoading&&h.length===0&&!x&&!w.current&&!o.get("story")&&!o.get("context")))return;w.current=!0,(async()=>{var a,N,m;if(console.log("Preloading learning recommendations..."),((a=s.projects)==null?void 0:a.length)>0){const l=s.projects.reduce((M,T)=>{var K,ae,re,ne,oe,ie,ce,le;const q=(((ae=(K=s.stories)==null?void 0:K.filter(O=>{var y;return((y=O.roadmap_epics)==null?void 0:y.project_id)===T.id}))==null?void 0:ae.length)||0)+(((ne=(re=s.tasks)==null?void 0:re.filter(O=>{var H,z;
52const y=(H=s.stories)==null?void 0:H.find(Y=>Y.id===O.story_id);return((z=y==null?void 0:y.roadmap_epics)==null?void 0:z.project_id)===T.id}))==null?void 0:ne.length)||0),X=(((ie=(oe=s.stories)==null?void 0:oe.filter(O=>{var y;return((y=O.roadmap_epics)==null?void 0:y.project_id)===M.id}))==null?void 0:ie.length)||0)+(((le=(ce=s.tasks)==null?void 0:ce.filter(O=>{var H,z;const y=(H=s.stories)==null?void 0:H.find(Y=>Y.id===O.story_id);return((z=y==null?void 0:y.roadmap_epics)==null?void 0:z.project_id)===M.id}))==null?void 0:le.length)||0);return q>X?T:M}),P=((N=s.stories)==null?void 0:N.filter(M=>{var T;return((T=M.roadmap_epics)==null?void 0:T.project_id)===l.id}))||[],G=((m=s.tasks)==null?void 0:m.filter(M=>{var q,X;const T=(q=s.stories)==null?void 0:q.find(K=>K.id===M.story_id);return((X=T==null?void 0:T.roadmap_epics)==null?void 0:X.project_id)===l.id}))||[],ue={projects:[l],stories:P,tasks:G,userLevel:"beginner"};v(`Based on your project: ${l.title}`),await i(void 0,void 0,ue,void 0,{silentSave:!0,silentToast:!0});return}if((u==null?void 0:u.length)>0){const l=`Learning resources for ${u[0]}`;v(`Based on your career path: ${u[0]}`),await i(void 0,l,void 0,void 0,{silentSave:!0,silentToast:!0});return}v("Getting you started"),await i(void 0,"Beginner-friendly software engineering learning resources",void 0,void 0,{silentSave:!0,silentToast:!0})})().catch(console.error)},[s.isLoading,s.projects,s.stories,s.tasks,h.length,x,u,i,o]);const C=async(n,c,a)=>{console.log("Generating recommendations for project:",{projectId:n,projectTitle:c,projectData:a}),r(n);const N={projects:[a||{id:n,title:c}],stories:s.stories.filter(m=>{var l;return((l=m.roadmap_epics)==null?void 0:l.project_id)===n}),tasks:s.tasks.filter(m=>{var P;const l=s.stories.find(G=>G.id===m.story_id);return((P=l==null?void 0:l.roadmap_epics)==null?void 0:P.project_id)===n}),userLevel:"beginner"};try{const m=`Based on your project: ${c}`;v(m),sessionStorage.setItem(t.SOURCE_LABEL,m),await i(void 0,void 0,N),g("recommendations"),f({tab:"recommendations"})}catch(m){console.error("Error generating project recommendations:",m)}finally{r(null)}},L=async(n,c)=>{g("recommendations"),f({tab:"recommendations"});const a=`Results for: "${n}"`;v(a),sessionStorage.setItem(t.SOURCE_LABEL,a);try{await i(void 0,n,c)}catch(N){console.error("Error generating custom recommendations:",N)}},R=()=>s.isLoading?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),e.jsx("span",{className:"ml-2 text-gray-600",children:"Loading your projects..."})]}):s.projects.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(D,{className:"w-12 h-12 mx-auto mb-4 text-gray-400"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Projects Found"}),e.jsx("p",{className:"text-gray-600",children:"You're not currently assigned to any projects."})]}):e.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:s.projects.map(n=>{const c=s.pods.find(m=>m.project_id===n.id),a=s.stories.filter(m=>{var l;return((l=m.roadmap_epics)==null?void 0:l.project_id)===n.id}).length,N=s.tasks.filter(m=>{var P;const l=s.stories.find(G=>G.id===m.story_id);return((P=l==null?void 0:l.roadmap_epics)==null?void 0:P.project_id)===n.id}).length;return e.jsx(Fe,{project:n,pod:c||{pod_name:"Unknown Pod"},onGenerateRecommendations:C,storiesCount:a,tasksCount:N,isLoading:p===n.id},n.id)})}),F=async()=>{sessionStorage.removeItem(t.RECOMMENDATIONS),sessionStorage.removeItem(t.CACHE_TIMESTAMP),w.current=!1;const n=o.get("story"),c=o.get("context");n&&c?await i({id:n,title:c,description:`Learning resources for story: ${c}`}):location.reload()},U=()=>{d(),v(null),w.current=!1,sessionStorage.removeItem(t.RECOMMENDATIONS),sessionStorage.removeItem(t.SOURCE_LABEL),sessionStorage.removeItem(t.CACHE_TIMESTAMP),f({})},I=()=>e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("h3",{className:"font-display text-2xl font-normal text-xterns-navy",children:o.get("context")||S||"Learning Recommendations"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(B,{variant:"outline",size:"sm",onClick:F,disabled:x,className:"flex items-center gap-2 rounded-xl",children:[e.jsx(Oe,{className:`w-4 h-4 ${x?"animate-spin":""}`}),"Refresh"]}),e.jsxs(B,{variant:"outline",size:"sm",onClick:U,disabled:x,className:"flex items-center gap-2 rounded-xl",children:[e.jsx(Se,{className:"w-4 h-4"}),"Clear"]})]})]}),e.jsx($e,{recommendations:h,storyId:o.get("story")||"default-story",storyTitle:o.get("context")||S||"Learning Recommendations",isLoading:x,onRes
52ourceClick:n=>{E(),$(`/xterns/learning/resource/${n.id}`,{state:{resource:n}})}})]}),k=()=>e.jsx(Ue,{onSearch:L,isSearching:x,projectContext:{projects:s.projects,stories:s.stories,tasks:s.tasks}});return e.jsx(_e,{children:e.jsxs("div",{className:"flex min-h-screen w-full bg-gray-50 font-sans",children:[e.jsx(be,{}),e.jsxs(ve,{className:"flex-1",children:[e.jsx(Me,{title:"Learning Menu"}),e.jsxs("main",{className:"flex-1 px-4 py-8 sm:px-8 lg:px-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{id:"learning-hub-header",className:"mb-2 font-display text-3xl font-normal tracking-tight text-xterns-navy sm:text-4xl",children:"Xtern Learning Hub"}),e.jsx("p",{className:"text-muted-foreground",children:"Explore learning resources tailored to your projects and interests."})]}),e.jsx(Q,{className:Ve,children:e.jsx(W,{id:"learning-hub-content",className:"p-6",children:e.jsxs(Ae,{value:b,onValueChange:n=>{g(n),sessionStorage.setItem(t.ACTIVE_TAB,n),(n==="projects"||n==="custom")&&(d(),f({}),sessionStorage.removeItem(t.RECOMMENDATIONS),sessionStorage.removeItem(t.SOURCE_LABEL))},className:"w-full",children:[e.jsxs(Re,{className:"h-auto w-full justify-start gap-1 overflow-x-auto rounded-xl bg-gray-100/80 p-1 sm:w-auto",children:[e.jsxs(Z,{className:"rounded-lg px-4 data-[state=active]:text-xterns-blue",id:"learning-projects-tab",value:"projects",children:[e.jsx(D,{className:"w-4 h-4 mr-2"}),"My Projects"]}),e.jsxs(Z,{className:"rounded-lg px-4 data-[state=active]:text-xterns-blue",id:"learning-recommendations-tab",value:"recommendations",children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),"Recommendations"]}),e.jsxs(Z,{className:"rounded-lg px-4 data-[state=active]:text-xterns-blue",id:"custom-search-tab",value:"custom",children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),"Custom Search"]})]}),e.jsx(ye,{className:"my-4"}),e.jsx(ee,{value:"projects",children:R()}),e.jsx(ee,{value:"recommendations",children:I()}),e.jsx(ee,{value:"custom",children:k()})]})})})]})]})]})})};export{bs as default};

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.