"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[515],{56950:(B,$,r)=>{r.d($,{A:()=>E});var e=r(48322),v=r(67115);const S=v.default.nav` ${({theme:a})=>(0,v.css)` color: ${a.colors.blue}; &.breadcrumbs--white { color: ${a.colors.white}; .breadcrumbs__list-item > svg { fill: ${a.colors.white}; } } .breadcrumbs__list { display: flex; flex-wrap: wrap; padding: 0; margin: 1.6rem 0 0 0; list-style: none; color: inherit; } .breadcrumbs__list-item { display: flex; align-items: center; color: inherit; font-size: 1.4rem; line-height: 2em; & svg { display: none; fill: ${a.colors.blue}; } &:not(:last-of-type) svg { display: block; margin: 0 1rem 0 1.2rem; width: 9px; height: 9px; } } .breadcrumbs__link { font-size: inherit; color: inherit; text-transform: capitalize; } `}; `;var x=r(75468),A=r(77334);const E=({className:a,breadcrumbs:y,breadcrumbColor:w})=>!y||!Array.isArray(y)?null:e.createElement(S,{className:`breadcrumbs breadcrumbs--${w} ${a}`,"aria-label":"Breadcrumb"},e.createElement("ol",{className:"breadcrumbs__list"},y.map((C,N)=>y.length-1===N?e.createElement("li",{className:"breadcrumbs__list-item breadcrumbs__list-item--current-item",key:N},C.title):e.createElement("li",{className:"breadcrumbs__list-item",key:N},e.createElement(x.default,{className:"breadcrumbs__link",uri:A.A.resolveRelativeUrl(C.path)},C.title),e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#00325B",viewBox:"0 0 9 9",role:"img"},e.createElement("path",{d:"M3.32685 4.36316.0778214.977951c-.1037619-.103762-.1037619-.207522 0-.311284L.661479.0830094C.778211-.0207524.881971-.0272374.972763.0635542L4.94163 4.20752C4.98055 4.24643 5 4.29831 5 4.36316c0 .06486-.01945.11674-.05837.15565L.972763 8.66278c-.103762.10376-.207522.10376-.311284 0l-.5836576-.60312c-.1037619-.10376-.1037619-.20752 0-.31128L3.32685 4.36316Z"}))))))},67585:(B,$,r)=>{r.r($),r.d($,{default:()=>ce});var e=r(48322),v=r(43266),O=r(52546),S=r(72347),x=r(93183),A=r(14646),k=r(95987),E=r(16731),a=r(67115);const w=a.default.div` ${({theme:{colors:t,mq:s}})=>(0,a.css)` .course-listing__main { margin-top: 4.8rem; @media ${s.large} { display: grid; grid-template-columns: 1fr 3fr; grid-gap: 4rem; } } .course-listing__results { margin-bottom: 4rem; & h2 { margin-top: 0; margin-bottom: 2rem; } .internal-courses__results { margin-bottom: 6rem; } .internal-courses__results, .online-courses__results { border: 1px solid ${t.greyLight}; } } .course-filters--desktop { display: none; @media ${s.large} { display: block; } } .course-filters--mobile { display: block; @media ${s.large} { display: none; } } `} `;var C=r(80383);const b=a.default.div` ${({theme:{colors:t,mq:s}})=>(0,a.css)` display: none; padding: 2rem; font-size: 1.4rem; font-weight: bold; color: ${t.blueAlt}; background-color: ${t.greyLight}; & > span { flex: 0 1 25%; } & > span:first-of-type { flex: 1 0 35%; } & > span:last-of-type { flex: 0 1 20%; } @media ${s.medium} { display: flex; } `} `,T=({labels:t})=>e.createElement(b,null,t?.map(s=>e.createElement("span",{key:`col-${s}`},s))),J=t=>t?.data?Object.values(t.data).map((s,c)=>({title:s?.productName??"No product name provided",path:s?.url??"No url provided",minDuration:s?.minDuration??"No min duration provided",maxDuration:s?.maxDuration??"No max duration provided",intakes:s?.intakes??"No intakes provided",level:s?.level??"No level provided",id:s?.id??`${c}`})).sort((s,c)=>s.title.charCodeAt(0)-c.title?.charCodeAt(0)):[],G=a.default.div` ${()=>(0,a.css)``} `,Q=a.default.article` ${({theme:{colors:t,mq:s}})=>(0,a.css)` padding: 2rem; @media ${s.medium} { display: flex; } :nth-of-type(even) { background-color: ${t.greyLight}; } .course-listing-card__link { margin: 0; } .course-listing-card__title { margin: 0; font-size: 1.6rem; line-height: 1.675em; } .course-listing-card__data-row { flex: 0 1 25%; display: block; margin-bottom: 2rem; &:first-of-type { flex: 1 0 35%; } &:last-of-type { flex: 0 1 20%; } &:not(:last-of-type) { padding-right: 2rem; } @media ${s.xsmall} { display: flex; } @media ${s.medium} { display: flex; flex-direction: column; margin: 0; } & span.label { display: block; margin-right: 2rem; font-size: 1.4rem; font-weight: bold; color: ${t.blueAlt}; @media ${s.xsmall} { flex: 0 0 100px; } @media ${s.medium} { display: none; visibility: hidden; } } } .course-listing-card__badge { display: inline-block; padding: 0.4rem 0.8rem; margin: 0 1.2rem 1.2rem 0; font-size: 1.4rem; font-style: italic; color: white; background-color: ${t.blueAlt}; &.clearing__badge { background-color: ${t.red}; } @media ${s.medium} { align-self: flex-start; margin: 1.2rem 0 0 0; } } `} `;var V=r(75468),W=r(68786);const I=({title:t,courseCode:s,studyModes:c,minDuration:u,maxDuration:n,intakes:g,inClearing:m,level:i,path:o,placement:d,joint:l,distance:L,mPhilOption:p})=>{const h=(0,x.A)().width>=A.C.medium;return e.createElement(Q,{className:"course-listing-card"},t&&e.createElement("div",{className:"course-listing-card__data-row"},e.createElement("span",{className:"label"},"Course name"),e.createElement(V.default,{uri:o,className:"course-listing-card__link"},e.createElement("h3",{className:"course-listing-card__title"},t)),h&&d&&d.some(f=>f.key==="0/2/24/834/838")&&e.createElement("div",{className:"course-listing-card__badge"},"Placement offered"),h&&l&&e.createElement("div",{className:"course-listing-card__badge"},"Joint honors"),h&&L&&e.createElement("div",{className:"course-listing-card__badge"},"Distance learning"),h&&p&&e.createElement("div",{className:"course-listing-card__badge"},"MPhil option available"),h&&m&&e.createElement("div",{className:"course-listing-card__badge clearing__badge"},"Available in Clearing")),(u||n)&&e.createElement("div",{className:"course-listing-card__data-row"},e.createElement("span",{className:"label"},"Duration"),"Minimum: ",u,n&&n?.length>1?`; Maximum: ${n}`:null),e.createElement("div",{className:"course-listing-card__data-row"},s&&e.createElement(e.Fragment,null,e.createElement("span",{className:"label"},"Course code"),s)),c&&e.createElement("div",{className:"course-listing-card__data-row"},e.createElement("span",{className:"label"},"¹û¶³´«Ã½Â鶹Éç mode"),e.createElement("span",{className:"study-mode"},c?.map((f,F,{length:R})=>e.createElement("p",{key:`mode-${F}`},f.duration," ",(0,W.zb)(f.mode),F+1!=R?", ":"")))),g&&e.createElement("div",{className:"course-listing-card__data-row"},e.createElement("span",{className:"label"},"Intakes"),g),i&&e.createElement("div",{className:"course-listing-card__data-row"},e.createElement("span",{className:"label"},"Level"),i),!h&&d&&d.some(f=>f.key==="0/2/24/834/838")&&e.createElement("div",{className:"course-listing-card__badge"},"Placement offered"),!h&&l&&e.createElement("div",{className:"course-listing-card__badge"},"Joint honors"),!h&&L&&e.createElement("div",{className:"course-listing-card__badge"},"Distance learning"),!h&&p&&e.createElement("div",{className:"course-listing-card__badge"},"MPhil option available"),!h&&m&&e.createElement("div",{className:"course-listing-card__badge clearing__badge"},"Available in Clearing"))},Z={id:"",mapper:(t=[])=>t},X=({isLoading:t,labels:s,filters:c,searchTerm:u})=>{const[n,g]=(0,e.useState)(Z),{results:m}=(0,S.zK)(n);(0,e.useEffect)(()=>{g({id:"online",config:{customApi:{uri:"https://www.edology.com/api/products/?school=Brunel%20University%20London"}},mapper:J})},[]);let i=[];const o=c.courseLevel?.items?.filter(l=>l.isSelected).map(l=>l.title?.toLowerCase()),d=c.startDate?.items?.filter(l=>l.isSelected).map(l=>l.title?.toLowerCase());return u&&u!==""&&(i=m.filter(l=>l.title.toLowerCase().includes(u.toLowerCase()))),o&&o.length>0&&(i=m.filter(l=>{if(o.indexOf(l.level.toLowerCase())>=0)return l})),d&&d.length>0&&(i=m.filter(l=>{if(l?.intakes&&(l?.intakes.toLowerCase().split(",")).some(p=>p.includes(d)))return l})),!u&&(!o||o.length===0)&&(!d||d.length===0)&&(i=m),!i||i.length===0?null:e.createElement(G,null,e.createElement("h2",null,"Online courses"),t&&e.createElement(k.Rh,{container:{height:"400px",margin:"20px auto",textAlign:"center"}}),!t&&e.createElement("div",{className:"online-courses__results"},e.createElement(T,{labels:s}),i.map(l=>e.createElement(I,{...l,key:l.id}))))},Y=a.default.div` ${({theme:{colors:t,mq:s}})=>(0,a.css)` margin-bottom: 1rem; ul { display: inline; margin-left: 1rem; padding: 0; list-style-type: none; } li { display: inline; } button { border: none; background: none; cursor: pointer; color: ${t.blueAlt}; text-decoration: underline; &.active { color: black; text-decoration: none; cursor: default; } } `} `,q=({options:t,text:s="Results per page:",separator:c="|",className:u="nor__container",pageSize:n,updatePageSize:g})=>{const[m,i]=(0,e.useState)(t||[]);return(0,e.useEffect)(()=>{if(!t||!n)return;const o=[...t];t.some(l=>l.value===n)||(o.push({value:n,label:n.toString()}),o.sort((l,L)=>l.value>=L.value?1:-1)),i(o)},[t,n]),!t||!n?null:e.createElement(Y,{className:u},e.createElement("span",{className:"nor__text"},s),e.createElement("ul",{className:"nor__ul"},m.map((o,d)=>{const l=o.value===n;return e.createElement("li",{key:`nor-option-${o.label}`,className:"nor__li"},e.createElement("button",{className:`nor__button${l?" active":""}`,disabled:l,onClick:()=>g(o.value)},o.label),m[d+1]&&e.createElement("span",{className:"nor__separator"},c))})))};var ee=r(8052),te=r(56950),se=r(30685),le=r(16117),U=r(13909);const K=a.default.div` ${({theme:{colors:t}})=>(0,a.css)` .course-listing__search { margin-bottom: 2rem; font-size: 1.4rem; label { display: block; font-size: inherit; font-weight: 600; color: ${t.blueAlt}; white-space: nowrap; } input[type='search'] { padding: 1.6rem; margin-top: 1.2rem; border: 1px solid ${t.grey}; width: 100%; font-size: 1.6rem; } } .course-listing__reset { display: block; padding: 1.6rem; margin-top: 2rem; border: 0; width: 100%; text-decoration: none; text-align: center; color: ${t.white}; font-weight: 700; background: ${t.pink} url('/_MB34Eg_2f94b5a9-e748-4b41-8c9a-9c82f59c8b8e/static-main/img/button-bg.svg') center right no-repeat; cursor: pointer; &:hover, &:focus { text-decoration: underline; } } .course-listing__search-btn { display: block; padding: 1.6rem; margin-top: 2rem; border: 0; width: 100%; text-decoration: none; text-align: center; font-weight: 700; color: ${t.white}; cursor: pointer; background: #00615e url('/_MB34Eg_2f94b5a9-e748-4b41-8c9a-9c82f59c8b8e/static-main/img/button-bg.svg') center right no-repeat; &:hover, &:focus { text-decoration: underline; } } `} `;var P=r(10191);const re=({clearFilters:t,handleChange:s,handleSearchReset:c,handleSubmit:u,filters:n,term:g,updateSelectedFilters:m,updateSearchTerm:i})=>e.createElement(K,{as:"aside",className:"course-filters--desktop"},e.createElement("h2",{className:"sr-only"},"Course search filters"),e.createElement("form",{className:"course-listing__search",onSubmit:u},e.createElement("label",{htmlFor:"search"},"Search"),e.createElement("input",{type:"search",id:"search",title:"search",name:"search",placeholder:"Search course by keyword(s)",onChange:s,value:g})),e.createElement(U.A,{filters:n,clearFilters:t,updateSelectedFilters:m,showReset:!1}),e.createElement(P.A,{className:"course-listing__search-btn",onClick:()=>i(g)},"Search"),e.createElement(P.A,{className:"course-listing__reset",onClick:c},"Reset")),ae=({clearFilters:t,handleChange:s,handleSearchReset:c,handleSubmit:u,filters:n,term:g,updateSelectedFilters:m,updateSearchTerm:i})=>e.createElement(K,{className:"course-filters--mobile"},e.createElement("form",{className:"course-listing__search",onSubmit:u},e.createElement("label",{htmlFor:"search"},"Search"),e.createElement("input",{type:"search",id:"search",title:"search",name:"search",placeholder:"Search course by keyword(s)",onChange:s,value:g})),e.createElement(le.A,{openTitle:"Filter courses",closeTitle:"Close filter",breakpoint:A.C.large},e.createElement("h2",{className:"sr-only"},"Course search filters"),e.createElement(U.A,{filters:n,clearFilters:t,updateSelectedFilters:m,showReset:!1}),e.createElement(P.A,{className:"course-listing__reset",onClick:()=>i(g)},"Search"),e.createElement(P.A,{className:"course-listing__reset",onClick:c},"Reset"))),ne=({info:t})=>t?e.createElement(ie,null,t?.currentCount===0?e.createElement("span",null,"No courses found "):e.createElement("span",null,t.currentCount," courses found "),t?.activeTerm&&e.createElement("span",null,"for the search term ",e.createElement("strong",null,t.activeTerm)),t?.activeFilters?e.createElement("span",null,t?.activeTerm?", ":"when"," filtered by"," ",e.createElement("strong",null,t?.activeFilters)):""):null,ie=a.default.p` ${()=>(0,a.css)` margin-bottom: 2.4rem; min-height: 2.4rem; `} `,oe=ne,ce=({mappedEntry:t})=>{const{title:s,clearingTitle:c,meta:u,breadcrumbs:n,internalLabels:g,onlineLabels:m}=t||{},{clearFilters:i,filters:o,paging:d,results:l,resultsInfo:L,isLoading:p,searchTerm:h,updatePageIndex:f,updatePageSize:F,updateSelectedFilters:R,updateSearchTerm:D}=(0,S.iQ)({mappers:C.A}),[M,z]=(0,e.useState)(h||""),me=(0,v.d4)(O.DT.selectors.selectCurrentLocation),j=(0,x.A)().width>=A.C.large,de=_=>{z(_.target.value)},ue=_=>{_.preventDefault(),D(M)},ge=()=>{i(),D(""),z("")};(0,e.useEffect)(()=>{z(h||"")},[h]);const H={clearFilters:i,handleChange:de,handleSubmit:ue,handleSearchReset:ge,filters:o,term:M,updateSelectedFilters:R,updateSearchTerm:D};return e.createElement(E.A,null,e.createElement(w,null,e.createElement(se.A,{...u}),e.createElement("div",{className:"wrapper"},e.createElement(te.A,{...n}),e.createElement("h1",null,me.search.includes("clearing")?c:s),e.createElement("div",{className:"course-listing__main"},j&&e.createElement(re,{...H}),e.createElement("section",{className:"course-listing__results"},!p&&e.createElement(oe,{info:L?.courseListingResultsText}),!j&&e.createElement(ae,{...H}),e.createElement("section",{className:"internal-courses"},p&&e.createElement(k.Rh,{container:{height:"600px",margin:"20px auto",textAlign:"center"}}),!p&&l?.length>0&&e.createElement(e.Fragment,null,e.createElement("h2",{className:"sr-only"},"Course search results"),e.createElement(q,{options:[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"},{value:1e4,label:"all"}],pageSize:d.pageSize,updatePageSize:F}),e.createElement("div",{className:"internal-courses__results"},e.createElement(T,{labels:g}),l.map(_=>e.createElement(I,{..._,key:_.id})))),e.createElement(ee.A,{paging:d,updatePageIndex:f})),e.createElement("section",{className:"online-courses"},e.createElement(X,{labels:m,isLoading:p,filters:o,searchTerm:M})))))))}},13909:(B,$,r)=>{r.d($,{A:()=>k});var e=r(48322),v=r(67115);const S=v.default.div` ${({theme:{mq:E,layout:a}})=>(0,v.css)` @media ${E.mlarge} { flex-basis: 25%; } h5 { margin-top: 0; } > div { padding-bottom: ${a.gutter.smedium}; } .dropdown__select { max-width: 100%; min-width: 100%; } .checkbox { padding: ${a.gutter.smedium} 0; } .search-reset { width: 100%; } `} `;var x=r(20548);const k=({title:E,filters:a,showReset:y=!0,clearFilters:w,updateSelectedFilters:C})=>a?e.createElement(S,null,Object.entries(a).length?e.createElement(e.Fragment,null,E&&e.createElement("h5",null,"Course Filter"),Object.entries(a).map(([N,b])=>b.title?e.createElement(x.A,{key:N,className:b?.items?.length===1?"checkbox":"",clearFilters:w,defaultValue:`Select ${b.title.toLowerCase()}`,filterGroupKey:N,filters:b.items,label:`Filter by ${b.title.toLowerCase()}`,multiSelect:!b.isSingleSelect,updateSelectedFilters:C}):null)):null,y&&e.createElement("button",{className:"search-reset",onClick:()=>w()},"Clear filters")):null}}]);