PageSourceSearch

https://www.internships.com/assets/find-your-fit-C7DhpqQ6.js

js internships.com collected 2026-10-02 04:15:01 UTC 9,381 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/find-your-fit-BZt-EeLb.js","assets/main-DO3vLohi.js","assets/main-Ddz38Tdj.css"])))=>i.map(i=>d[i]);
2import{aV as j,r as m,hA as V,db as S,j as e,B as g,L as y,c8 as w,bn as D,aW as C,I as A,b3 as P,U as M,b2 as x,gC as Y}from"./main-DO3vLohi.js";import{u as O}from"./useMutation-D1SAI5XB.js";import{a as U,b,c as K}from"./PageHeader-BfheAfxH.js";import{a as q}from"./useSentenceRoles-B5Y3KMGS.js";import{r as W}from"./sentence-storage-CiFkHLaY.js";import{S as Q}from"./StarLatticeLoader-kryehLf0.js";import{u as $}from"./use-track-component-viewed-BmvT51hD.js";import"./major-seed-BcgR6bbV.js";function z(t,s){const r=j(s);return B({filters:{...t,status:"pending"}},r).length}function k(t,s){return t.findAll(s.filters).map(r=>s.select?s.select(r):r.state)}function B(t={},s){const r=j(s).getMutationCache(),c=m.useRef(t),a=m.useRef(null);return a.current===null&&(a.current=k(r,t)),m.useEffect(()=>{c.current=t}),m.useSyncExternalStore(m.useCallback(l=>r.subscribe(()=>{const u=V(a.current,k(r,c.current));a.current!==u&&(a.current=u,S.schedule(l))}),[r]),()=>a.current,()=>a.current)}function H(t){return t===1?"At least 1 open internship":`${t.toLocaleString("en-US")}+ open internships`}function G({path:t,onDecide:s}){return e.jsxs("article",{"data-testid":"fit-path-card","data-role":t.roleValue,className:"flex h-full flex-col rounded-xl border border-hairline bg-surface-white p-5 shadow-card",children:[e.jsx("p",{className:"text-[11px] font-bold uppercase tracking-wide text-text-muted",children:t.group}),e.jsx("h3",{className:"mt-1 text-base font-bold text-text-strong",children:t.label}),e.jsx("p",{className:"mt-1.5 text-sm text-text-muted",children:t.reason}),e.jsx("p",{className:"mt-3 text-xs font-semibold text-text-strong",children:H(t.openCount)}),t.samples.length>0&&e.jsx("ul",{className:"mt-2 space-y-1","aria-label":"Example internships",children:t.samples.map(r=>e.jsxs("li",{className:"text-sm leading-snug",children:[e.jsx("span",{className:"font-medium text-text-strong",children:r.title}),r.companyName&&e.jsxs("span",{className:"text-text-muted",children:[" · ",r.companyName]})]},r.jobId))}),e.jsxs("div",{className:"mt-auto pt-4",children:[e.jsx(g,{asChild:!0,variant:"orange",size:"sm",children:e.jsxs(y,{to:w,search:()=>({roles:t.roleValue}),"data-amp-track-surface":"find_your_fit","data-amp-track-action":"open","data-amp-track-target":"search","data-amp-track-placement":t.placement,children:["See ",t.label," internships"]})}),s&&e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-2",children:[e.jsx(g,{type:"button",variant:"outline",size:"sm",onClick:()=>s("accepted"),"data-amp-track-surface":"find_your_fit","data-amp-track-action":"add","data-amp-track-target":"role_target","data-amp-track-placement":t.placement,children:"Add to my targets"}),e.jsx("button",{type:"button",onClick:()=>s("declined"),className:"text-sm font-medium text-text-muted transition-colors hover:text-text-strong","data-amp-track-surface":"find_your_fit","data-amp-track-action":"dismiss","data-amp-track-target":"role_target","data-amp-track-placement":t.placement,children:"Not for me"})]})]})]})}function J(t){switch(t.basis){case"profile":return"Picked from your profile, plus a few from other fields. Each card says why.";case"major":return t.majorLabel?`Picked from your ${t.majorLabel} major, plus a few from other fields. Each card says why.`:"Picked from your major, plus a few from other fields. Each card says why.";case"none":return"The kinds of internship with the most openings right now."}}function N({title:t,subtitle:s,paths:r,testId:c,onDecide:a}){return r.length===0?null:e.jsxs("section",{"data-testid":c,className:"mt-8","aria-label":t,children:[e.jsx("h2",{className:"text-lg font-bold text-text-strong",children:t}),e.jsx("p",{className:"mt-0.5 text-sm text-text-muted",children:s}),e.jsx("ul",{className:"mt-4 grid gap-4 sm:grid-cols-2",children:r.map(l=>e.jsx("li",{children:e.jsx(G,{path:l,onDecide:a&&(u=>a(l,u))})},l.roleValue))})]})}function X({result:t,onDecide:s,decidedAll:r=!1}){const c=t.closest.length===0&&t.worthALook.length===0,a=t.basis==="none",l=a&&!t.majorLabel;return e.jsxs(e.Fragment,{children:[e.jsx(U,{children:"Find your fit"}),e.jsxs(b,{className:"pt-2 pb-10",children:[e.jsx(K,{children:"Not sure what to aim for? Start here."}),e.jsx("p",{className:"mt-3 max-w-2xl text-sm text-text-muted",children:J(t)}),l&&e.jsxs("p",{className:"mt-2 text-sm text-text-muted",children:[e.jsx(y,{to:D,className:"font-medium text-text-strong underline underline-offset-4","data-amp-track-surface":"find_your_fit","data-amp-track-action":"open","data-amp-track-target":"profile",children:"Add your major"})," ","and these get picked for you."]}),c?e.jsxs("div",{"data-testid":"find-your-fit-empty",className:"mt-8 rounded-xl border border-hairline bg-surface-white p-6 text-sm text-text-muted",children:[r?"You've decided on every path we had for you.":"There are no open internships to suggest right now."," ",e.jsx(y,{to:w,className:"font-medium text-text-strong underline underline-offset-4","data-amp-track-surface":"find_your_fit","data-amp-track-action":"open","data-amp-track-target":"search","data-amp-track-placement":r?"decided_all":"empty",children:"Browse every internship"})]}):e.jsxs(e.Fragment,{children:[e.jsx(N,{testId:"fit-closest",title:a?"Popular starting points":"Closest fits",subtitle:a?"Fields with the most openings right now.":"Start with these.",paths:t.closest,onDecide:s}),e.jsx(N,{testId:"fit-worth-a-look",title:a?"More fields to explore":"Worth a look",subtitle:a?"The next busiest fields.":t.closest.length>0?"A different field from the ones above.":"A few different fields.",paths:t.worthALook,onDecide:s})]})]})]})}const Z=["find-your-fit"],E=["find-your-fit-decided"],F=["find-your-fit-decide"],h=[],p="find-your-fit-decision";async function tt(){const t=Date.now(),{getFitPaths:s}=await P(async()=>{const{getFitPaths:c}=await import("./find-your-fit-BZt-EeLb.js");return{getFitPaths:c}},__vite__mapDeps([0,1,2]));return{result:await s(),durationMs:Date.now()-t}}function et(){const t=j(),s=M(),{data:r=h}=C({queryKey:E,queryFn:()=>h,initialData:h,staleTime:Number.POSITIVE_INFINITY}),c=z({mutationKey:F})>0,a=o=>t.setQueryData(E,n=>o(n??h)),l=o=>a(n=>n.filter(d=>d!==o)),u=O({mutationKey:F,mutationFn:async({path:o,decision:n})=>{const{decideFitPath:d}=await P(async()=>{const{decideFitPath:f}=await import("./find-your-fit-BZt-EeLb.js");return{decideFitPath:f}},__vite__mapDeps([0,1,2])),i=await d({data:{roleValue:o.roleValue,decision:n}});if(i.status===null)throw new Error("fit-path decision not recorded");return{changed:i.changed,status:i.status}},onMutate:({path:o})=>{a(n=>n.includes(o.roleValue)?n:[...n,o.roleValue])},onError:(o,{path:n})=>{l(n.roleValue),x.error("Couldn't save that just now. Try again.",{id:p})},onSuccess:(o,{path:n,decision:d,basis:i})=>{if(o.changed&&A("fit_path_decided",{decision:d,placement:n.placement,basis:i,roleValue:n.roleValue}),o.status!==d){x(o.status==="accepted"?`${n.label} is already one of your targets.`:`You passed on ${n.label} earlier, so it wasn't added.`,{id:p});return}d==="accepted"&&(q({value:n.roleValue,label:n.label}),x.success(`Added ${n.label} to your targets.`,{id:p,action:{label:"See internships",onClick:()=>{const f=W();s({to:w,search:()=>f?Y(f):{}})}}}))}});return{hidden:r,deciding:c,decide:u.mutate}}function at(t,s){if(s.length===0)return t;const r=new Set(s),c=a=>a.near&&r.has(a.near.roleValue)?{...a,reason:a.near.reasonWithout}:a;return{...t,closest:t.closest.filter(a=>!r.has(a.roleValue)),worthALook:t.worthALook.filter(a=>!r.has(a.roleValue)).map(c)}}function v(){return e.jsxs(b,{className:"flex flex-col items-center pt-24 pb-10 text-center",children:[e.jsx(Q,{size:96}),e.jsx("p",{className:"mt-4 text-sm font-medium text-text-muted","aria-live":"polite","data-testid":"find-your-fit-loading",children:"Matching you against every kind of internship..."})]})}function st(){const{data:t,dataUpdatedAt:s,isError:r,isFetching:c,refetch:a,isRefetching:l}=C({queryKey:Z,staleTime:0,refetchOnWindowFocus:!1,retry:!1,queryFn:tt}),{hidden:u,deciding:o,decide:n}=et(),d=t?.result,i=m.useMemo(()=>d?at(d,u):null,[d,u]),f=i!==null&&u.length>0&&i.closest.length===0&&i.worthALook.length===0;m.useEffect(()=>{f&&!o&&a({cancelRefetch:!1})},[f,o,a]);const T=m.useRef(s),_=m.useRef(0);if(m.useEffect(()=>{!t||!i||s===T.current||s===_.current||(_.current=s,A("fit_paths_shown",{basis:i.basis,closestCount:i.closest.length,worthA
2LookCount:i.worthALook.length,durationMs:t.durationMs}))},[t,s,i]),i){if(f&&(o||c))return e.jsx(v,{});const{basis:I}=i;return e.jsx(X,{result:i,decidedAll:f,onDecide:(L,R)=>n({path:L,decision:R,basis:I})})}return r?e.jsxs(b,{className:"pt-24 pb-10 text-center",children:[e.jsx("p",{className:"text-sm text-text-muted","data-testid":"find-your-fit-error",children:"We could not load your paths just now."}),e.jsx(g,{type:"button",variant:"outline",size:"sm",className:"mt-3",disabled:l,onClick:()=>{a()},"data-amp-track-surface":"find_your_fit","data-amp-track-action":"retry",children:"Try again"})]}):e.jsx(v,{})}function mt(){const t=$("FindYourFitView",{surface:"find_your_fit"});return e.jsx("div",{ref:t,"data-testid":"find-your-fit-page",className:"h-full",children:e.jsx(st,{})})}export{mt as component};

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.