PageSourceSearch

https://www.hull.ac.uk/_Iwb94w_f379bfb8-a3a9-460c-8441-2e4052e3c537/static/SearchBlock-BA-1gFQ-.js

js hull.ac.uk collected 2026-09-24 08:35:05 UTC 7,399 bytes, 5 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ad7f8cbd-7de5-561e-bf4a-13a855e4d653")}catch(e){}}();
3import{j as t,r as O}from"./components-DyD9lVhy.js";import{g as v,c as x}from"./createLucideIcon-CENCwq7n.js";import{u as T}from"./useQuery-rrQa8atb.js";import{T as N}from"./index-D6_7Lavr.js";import{f as j}from"./format-F015uWqQ.js";import{g as f,l as e}from"./client-CRSsQ2ls.js";import{a as E}from"./FeatureItem-l36CrtAw.js";import{c as S,s as D}from"./misc-tLEzPy92.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a._sentryModuleMetadata=a._sentryModuleMetadata||{},a._sentryModuleMetadata[new a.Error().stack]=(function(i){for(var n=1;n<arguments.length;n++){var l=arguments[n];if(l!=null)for(var s in l)l.hasOwnProperty(s)&&(i[s]=l[s])}return i})({},a._sentryModuleMetadata[new a.Error().stack],{"_sentryBundlerPluginAppKey:uoh-app":!0})}catch{}})();const q=({content:a,className:i,layoutColour:n,queries:l})=>{const{showNews:s=!1,newsThumbs:m,newsCategory:d,showEvents:p=!1,eventThumbs:y,eventsCategory:o,items:u,overrideParent:c}=a,{data:h}=T({queryKey:["newsArticles"],queryFn:()=>l.newsArticles(0,d?.entryDescription,u),enabled:!!s}),{data:g}=T({queryKey:["events"],queryFn:()=>l.events(0,o?.entryDescription,u),enabled:!!p}),b=n==="ink-blue"||n==="mid-blue"?"white":"ink-blue";return t.jsx("section",{className:x("@container/NewsEvents",i),children:t.jsxs("div",{className:x("flex flex-col @min-[57.5rem]/NewsEvents:flex-row",`${["ink-blue","mid-blue"].includes(n)?"[&_a]:hover:text-white":""}`),children:[s&&h&&h.items.length>0&&t.jsx("div",{className:x("w-full max-w-[1400px]",`${["ink-blue","mid-blue"].includes(n)?"border-white/40":"border-blue-d"}`,`${p?"pt-m sm:pt-l @min-[57.5rem]/NewsEvents:pr-l pb-m sm:pb-l border-b @min-[57.5rem]/NewsEvents:basis-1/2 @min-[57.5rem]/NewsEvents:border-r @min-[57.5rem]/NewsEvents:border-b-0 @min-[57.5rem]/NewsEvents:pt-0 @min-[57.5rem]/NewsEvents:pb-0":""}`),children:t.jsxs("div",{className:"lg:gap-l gap-m flex flex-col",children:[t.jsxs("div",{className:"mb-xs flex items-center justify-between lg:mb-0",children:[t.jsx("h2",{children:"Latest news"}),t.jsx(N,{colour:b,data:{externalLink:null,internalLink:{sys:{uri:`${c?.sys.uri||"/news-and-events"}/news/${d?"?categories="+d.entryDescription:""}`}},ariaLabel:"",newWindow:!1,label:"See all",mobileLabel:""},className:"h-fit shrink-0"})]}),h.items.map((r,w)=>t.jsxs("a",{href:r.sys.uri,className:"unstyled-link sm:gap-m gap-s group flex h-full max-w-[80ch]",children:[m&&r.image&&t.jsx("div",{className:"max-h-xl sm:max-h-2xl aspect-square max-w-xl shrink-0 sm:max-w-2xl lg:max-h-[96px] lg:max-w-[96px]",children:t.jsx("img",{className:"h-full w-full object-cover",src:`${v(r.image?.asset.sys.uri)}${r.image?.asset.sys.uri}`,alt:r.image?.altText})}),t.jsxs("div",{className:"sm:gap-xs gap-2xs-plus flex flex-col",children:[t.jsx("div",{className:"tag",children:j(r.date,"dd MMM yyyy")}),t.jsx("div",{className:"lg:text-h4-lg sm:text-h4-md text-base-lg line-clamp-2 font-bold group-hover:underline",children:r.entryTitle}),t.jsx("p",{className:"lg:text-base-lg sm:text-base-md text-base-sm line-clamp-2",children:r.description})]})]},`article-${w}`))]})}),p&&g&&g.items?.length>0&&t.jsx("div",{className:x("w-full max-w-[1400px]",`${s?"pt-m sm:pt-l @min-[57.5rem]/NewsEvents:pl-l @min-[57.5rem]/NewsEvents:basis-1/2 @min-[57.5rem]/NewsEvents:pt-0":""}`),children:t.jsxs("div",{className:"lg:gap-l gap-m flex flex-col",children:[t.jsxs("div",{className:"mb-xs flex items-center justify-between lg:mb-0",children:[t.jsx("h2",{children:"Upcoming events"}),t.jsx(N,{colour:b,data:{externalLink:null,internalLink:{sys:{uri:`${c?.sys.uri||"/news-and-events"}/events/${o?"?cat="+o.entryDescription:""}`}},ariaLabel:"",newWindow:!1,label:"See all",mobileLabel:""},className:"h-fit shrink-0"})]}),g.items.map((r,w)=>t.jsxs("a",{href:r.sys.uri,className:"unstyled-link sm:gap-m gap-s group flex max-w-[80ch]",children:[y&&r.image&&t.jsx("div",{className:"max-h-xl sm:max-h-2xl aspect-square max-w-xl shrink-0 sm:max-w-2xl lg:max-h-[96px] lg:max-w-[9
36px]",children:t.jsx("img",{className:"h-full w-full object-cover",src:`${v(r.image?.asset.sys.uri)}${r.image?.asset.sys.uri}`,alt:r.image?.altText})}),t.jsxs("div",{className:"sm:gap-xs gap-2xs-plus flex flex-col",children:[t.jsx("div",{className:"lg:text-h4-lg sm:text-h4-md text-base-lg line-clamp-2 font-bold group-hover:underline",children:r.entryTitle}),t.jsx("div",{className:"tag",children:j(r.date.from,"dd MMM yyyy")}),t.jsx("p",{className:"lg:text-base-lg sm:text-base-md text-base-sm line-clamp-2",children:r.description})]})]},`event-${w}`))]})})]})})},F=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"})),k=async(a=0,i="",n=10)=>{const l=f(),s=new e.Query(e.Op.equalTo("sys.versionStatus","published"),e.Op.equalTo("sys.contentTypeId","pageEvent"),e.Op.equalTo("sys.dataFormat","entry"),e.Op.equalTo("seoStandard.search",!0),e.Op.greaterThanOrEqualTo("date.to","startOfDay()"));i&&s.where.add(e.Op.and(e.Op.equalTo("categories.entryDescription",i))),s.orderBy=e.OrderBy.asc("date.from"),s.pageSize=n,s.pageIndex=a,s.fields=["entryTitle","description","date","image"];try{return await l.entries.search(s)}catch(m){console.log(m)}},$=async(a=0,i="",n=10)=>{const l=f(),s=new e.Query(e.Op.equalTo("sys.versionStatus","published"),e.Op.equalTo("sys.contentTypeId","pageNewsArticle"),e.Op.equalTo("seoStandard.search",!0),e.Op.equalTo("sys.dataFormat","entry"));i&&s.where.add(e.Op.and(e.Op.equalTo("categories.entryDescription",i))),s.orderBy=e.OrderBy.desc("date"),s.pageSize=n,s.pageIndex=a,s.fields=["entryTitle","description","date","image"];try{return await l.entries.search(s)}catch(m){console.log(m)}},C=a=>O.createElement(q,{...a,queries:{newsArticles:$,events:k}}),M=async(a,i,n,l="",s="")=>{const m=f(),d=a.trim();if(!d)return null;const p=S(d),y=["entryTitle","seoStandard.title","seoStandard.description","seoStandard.search","sys.id","sys.uri","sys.contentTypeId","sys.version","searchContent"],o=new e.Query(e.Op.equalTo("sys.versionStatus","published"),e.Op.equalTo("seoStandard.search",!0),D(d,p));s&&o.where.add(e.Op.or(e.Op.equalTo("category.entryDescription",s),e.Op.equalTo("subcategory.entryDescription",s),e.Op.equalTo("school.entryDescription",s),e.Op.equalTo("subject.entryDescription",s),e.Op.equalTo("subjectGroup.entryDescription",s),e.Op.equalTo("institute.entryDescription",s),e.Op.equalTo("centre.entryDescription",s),e.Op.equalTo("theme.entryDescription",s),e.Op.equalTo("courseVariants.variant.entryDescription",s),e.Op.equalTo("building.entryDescription",s)));const u=n.length>0?n.map(c=>e.Op.equalTo("sys.contentTypeId",c)):[];u.length>0&&o.where.add(e.Op.or(...u)),l&&o.where.add(e.Op.freeText("searchContent",l)),o.pageSize=i,o.fields=y;try{const c=await m.entries.search(o,1);return!c||!c.items?(console.error("No items found in the response"),[]):c.items}catch(c){return console.error("Error during search:",c),[]}},K=a=>O.createElement(E,{...a,searchData:M});export{k as E,C as N,M as S,K as a,$ as b,F as c};
4
5//# debugId=ad7f8cbd-7de5-561e-bf4a-13a855e4d653

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.