"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[515],{6950:(z,S,a)=>{a.d(S,{A:()=>E});var e=a(8322),v=a(7115);const x=v.default.nav` ${({theme:r})=>(0,v.css)` color: ${r.colors.blue}; &.breadcrumbs--white { color: ${r.colors.white}; .breadcrumbs__list-item > svg { fill: ${r.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: ${r.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 $=a(5468),_=a(7334);const E=({className:r,breadcrumbs:y,breadcrumbColor:w})=>!y||!Array.isArray(y)?null:e.createElement(x,{className:`breadcrumbs breadcrumbs--${w} ${r}`,"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($.default,{className:"breadcrumbs__link",uri:_.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"}))))))},6129:(z,S,a)=>{a.r(S),a.d(S,{default:()=>re});var e=a(8322),v=a(3266),F=a(2546),x=a(2347),$=a(3183),_=a(4646),k=a(8368),E=a(7167),r=a(7115);const w=r.default.div` ${({theme:{colors:t,mq:s}})=>(0,r.css)` .course-listing__main { margin-top: 4.8rem; @media ${s.large} { display: grid; grid-template-columns: 1fr 3fr; grid-gap: 4rem; } } .course-listing__info { margin-bottom: 2.4rem; min-height: 2.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}; } } `} `;var C=a(383);const b=r.default.div` ${({theme:{colors:t,mq:s}})=>(0,r.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; } `} `,B=({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)):[],J=r.default.div` ${()=>(0,r.css)``} `,G=r.default.article` ${({theme:{colors:t,mq:s}})=>(0,r.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 Q=a(5468),V=a(3548);const T=({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,$.A)().width>=_.C.medium;return e.createElement(G,{className:"course-listing-card"},t&&e.createElement("div",{className:"course-listing-card__data-row"},e.createElement("span",{className:"label"},"Course name"),e.createElement(Q.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"},"Study mode"),e.createElement("span",{className:"study-mode"},c?.map((f,P,{length:O})=>e.createElement("p",{key:`mode-${P}`},f.duration," ",(0,V.zb)(f.mode),P+1!=O?", ":"")))),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"))},W={id:"",mapper:(t=[])=>t},Z=({isLoading:t,labels:s,filters:c,searchTerm:u})=>{const[n,g]=(0,e.useState)(W),{results:m}=(0,x.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(J,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(B,{labels:s}),i.map(l=>e.createElement(T,{...l,key:l.id}))))},X=r.default.div` ${({theme:{colors:t,mq:s}})=>(0,r.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; } } `} `,Y=({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(X,{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 q=a(8052),ee=a(6950),te=a(685),se=a(6117),I=a(3909);const U=r.default.div` ${({theme:{colors:t}})=>(0,r.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_c6dbfead-ed95-4ad1-a471-f1a997229e5b/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_c6dbfead-ed95-4ad1-a471-f1a997229e5b/static-main/img/button-bg.svg') center right no-repeat; &:hover, &:focus { text-decoration: underline; } } `} `,le=({clearFilters:t,handleChange:s,handleSearchReset:c,handleSubmit:u,filters:n,term:g,updateSelectedFilters:m,updateSearchTerm:i})=>e.createElement(U,{as:"aside"},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(I.A,{filters:n,clearFilters:t,updateSelectedFilters:m,showReset:!1}),e.createElement("button",{className:"course-listing__search-btn",onClick:()=>i(g)},"Search"),e.createElement("button",{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(U,null,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(se.A,{openTitle:"Filter courses",closeTitle:"Close filter",breakpoint:_.C.large},e.createElement("h2",{className:"sr-only"},"Course search filters"),e.createElement(I.A,{filters:n,clearFilters:t,updateSelectedFilters:m,showReset:!1}),e.createElement("button",{className:"course-listing__reset",onClick:()=>i(g)},"Search"),e.createElement("button",{className:"course-listing__reset",onClick:c},"Reset"))),re=({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:P,updateSelectedFilters:O,updateSearchTerm:D}=(0,x.iQ)({mappers:C.A}),[R,M]=(0,e.useState)(h||""),ne=(0,v.d4)(F.DT.selectors.selectCurrentLocation),H=(0,$.A)().width>=_.C.large,ie=A=>{M(A.target.value)},oe=A=>{A.preventDefault(),D(R)},ce=()=>{i(),D(""),M("")};(0,e.useEffect)(()=>{M(h||"")},[h]);const K={clearFilters:i,handleChange:ie,handleSubmit:oe,handleSearchReset:ce,filters:o,term:R,updateSelectedFilters:O,updateSearchTerm:D};return e.createElement(E.A,null,e.createElement(w,null,e.createElement(te.A,{...u}),e.createElement("div",{className:"wrapper"},e.createElement(ee.A,{...n}),e.createElement("h1",null,ne.search.includes("clearing")?c:s),e.createElement("div",{className:"course-listing__main"},H&&e.createElement(le,{...K}),e.createElement("section",{className:"course-listing__results"},!p&&e.createElement("p",{className:"course-listing__info",dangerouslySetInnerHTML:{__html:L.courseListingResultsText}}),!H&&e.createElement(ae,{...K}),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(Y,{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:P}),e.createElement("div",{className:"internal-courses__results"},e.createElement(B,{labels:g}),l.map(A=>e.createElement(T,{...A,key:A.id})))),e.createElement(q.A,{paging:d,updatePageIndex:f})),e.createElement("section",{className:"online-courses"},e.createElement(Z,{labels:m,isLoading:p,filters:o,searchTerm:R})))))))}},3909:(z,S,a)=>{a.d(S,{A:()=>k});var e=a(8322),v=a(7115);const x=v.default.div` ${({theme:{mq:E,layout:r}})=>(0,v.css)` @media ${E.mlarge} { flex-basis: 25%; } h5 { margin-top: 0; } > div { padding-bottom: ${r.gutter.smedium}; } .dropdown__select { max-width: 100%; min-width: 100%; } .checkbox { padding: ${r.gutter.smedium} 0; } .search-reset { width: 100%; } `} `;var $=a(548);const k=({title:E,filters:r,showReset:y=!0,clearFilters:w,updateSelectedFilters:C})=>r?e.createElement(x,null,Object.entries(r).length?e.createElement(e.Fragment,null,E&&e.createElement("h5",null,"Course Filter"),Object.entries(r).map(([N,b])=>b.title?e.createElement($.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}}]);