1import{j as e}from"./jsx-runtime-CWbFWY2M.js";import{u as I,A as k}from"./useAlgoliaSearch-C9Z8_VqA.js";import{c as d}from"./index-6VkcFi5Q.js";import{i as x,aa as m,y as f,ab as N,$ as C,t as g,u as S}from"./app-D9_mHf2z.js";import{T as L}from"./TraversableList-D3Js8c-d.js";import{C as E,a as D}from"./CustomSortBy-DIpHKqeF.js";import{e as R}from"./search-insights-browser-CSPvHimU.js";import{h as A,C as y,d as T,r as u}from"./react-CydE4nCL.js";import{N as F}from"./Loaders-mT19WgFm.js";import"./vendor-BrssnT-E.js";import"./sendbird-haQy8H9b.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"a156a80817bcc286d094871909811f8803ba8360"};var r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="9c548684-ff48-4b74-9382-f7b918be0608",s._sentryDebugIdIdentifier="sentry-dbid-9c548684-ff48-4b74-9382-f7b918be0608")}catch(a){}})();const O=({hit:s,indexName:r,defaultImage:a,context:l="news-article",style:n="default"})=>{const i=()=>{R("clickedObjectIDsAfterSearch",{index:r,eventName:"Click on Article Item",userToken:C(),objectIDs:[s.objectID],context:l,articles:[s.title]})};function o(t){switch(t){case"news":return g("translations.newsHeading","News");case"blog":return g("translations.blogHeading","Blog");case"pressRelease":return g("translations.pressReleaseHeading","Press Release");case"eventNews":return g("translations.eventNewsHeading","Event News");case"interview":return g("translations.interviewHeading","Interview");case"mobileWorldLive":return g("translations.mobileWorldLiveHeading","Mobile World Live");default:return t}}return e.jsx("li",{className:d("col-span-1 p-4 group transition-all duration-300",x()&&m()!=="nova"&&"rounded-[1.25rem] hover:bg-dark hover:text-white",x()&&m()==="nova"&&"rounded-lg hover:bg-secondary/20"),children:e.jsxs("a",{href:s.url,className:"flex flex-col h-full gap-2",onClick:i,...s.external?{target:"_blank",rel:"noopener"}:{},children:[s.image?e.jsx("img",{src:f(s.image),srcSet:"".concat(f(s.image,500)," 500w,\n ").concat(f(s.image,640)," 640w,\n ").concat(f(s.image,800)," 800w"),sizes:"(min-width:640px) 500px, 100vw",alt:s.image||s.title,className:d("object-cover aspect-video",x()&&m()!=="nova"&&"rounded-[1rem]",x()&&m()==="nova"&&"rounded-lg")}):e.jsx("img",{src:f(a),srcSet:"".concat(f(a,500)," 500w,\n ").concat(f(a,640)," 640w,\n ").concat(f(a,800)," 800w,"),sizes:"(min-width:640px) 500px, 100vw",alt:s.title,className:d("object-cover aspect-video",x()&&"rounded-[1rem]")}),e.jsxs("div",{className:"flex flex-row justify-between items-center min-h-[32px]",children:[e.jsxs("p",{className:d("text-sm",m()==="nova"&&n==="default"&&"text-secondary group-hover:text-black",m()==="nova"&&n==="dark"&&"text-secondary group-hover:text-white"),children:[e.jsx("i",{className:"fa-regular fa-calendar mr-2"}),N(new Date(Number(s.published)*1e3))]}),e.jsxs("div",{className:"flex flex-row gap-2",children:[!["news","eventNews"].includes(s.categories.allCategories.type)&&e.jsxs("div",{className:"text-xs font-medium text-white p-2 px-3 pb-1.5 rounded-[16px] flex flex-row gap-2 justify-center",style:{backgroundColor:"var(--".concat(s.categories.allCategories.type,"-color)")},children:[e.jsx("i",{className:"fa-regular fa-tag text-base"}),e.jsx("span",{children:o(s.categories.allCategories.type)})]}),e.jsx("div",{className:d("hidden group-hover:flex rounded-md items-center justify-center p-2 px-3 text-white transition-all duration-1000",m()!=="nova"&&"bg-primary",m()==="nova"&&"bg-secondary"),children:e.jsx("i",{className:d("fa-regular fa-arrow-right transition-all duration-1000",s.external&&"-rotate-45")})})]})]}),e.jsx("h2",{className:"text-xl font-medium leading-[130%]",children:s.title})]})})},$=({props:s,categories:r})=>{const{blockId:a,index:l,default_image:n}=s,{hits:i}=A();return e.jsxs(e.Fragment,{children:[e.jsxs(L,{blockId:a,fullWidth:!0,children:[e.jsxs("div",{className:"flex px-4 xl:px-0 flex-wrap sm:flex-nowrap sm:justify-end gap-4",children:[s.heading&&e.jsx("h2",{className:d("text-2xl sm:text-3xl grow w-full sm:w-auto",m()!=="nova"&&"font-bold"),children:s.heading}),r.length!==1&&e.jsx(E,{attribute:"categories.allCategories.type",operator:"or"}),e.jsx(D,{items:[{label:g("translations.newestFirstLabel","Newest First"),value:l},{label:g("translations.oldestFirstLabel","Oldest First"),value:l+"_oldest_first"}]})]}),e.jsx(H,{hits:i,blockId:a,indexName:l,defaultImage:n,style:s.style})]}),e.jsx(y,{clickAnalytics:!0})]})},H=({hits:s,blockId:r,indexName:a,defaultImage:l,style:n})=>{const{status:i}=T();return e.jsx("div",{className:"mt-0 lg:scroll-mt-[60px]",id:"traversable-list-"+r,children:e.jsx("ul",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2 mt-4 exhibitor-listing xl:-mx-4",children:s.length===0?e.jsx("li",{children:e.jsx("p",{className:"no-results p-4",children:s.length===0&&i==="idle"?g("translations.noResultsText","No Results"):S(i)})}):s.filter(o=>{var t;return!((t=o.metadata)!=null&&t.hideFromListing)}).map(o=>e.jsx(O,{hit:o,indexName:a,defaultImage:l,style:n},o.objectID))})})},W=({item:s,default_image:r})=>e.jsx("li",{className:d("col-span-1 p-4 hover:bg-dark hover:text-white group transition-colors duration-300",x()&&"rounded-[1.25rem]"),children:e.jsxs("a",{className:"flex flex-col items-start group gap-2",href:s.url,target:"_blank",rel:"noopener noreferrer",children:[s.social_image_url?e.jsx("img",{src:s.social_image_url,alt:s.image_alt||s.image_caption,className:d("bg-gray-100 aspect-video h-full w-full object-cover",x()&&"rounded-[1rem]")}):e.jsx("img",{src:r,alt:s.headline,className:d("bg-gray-100 aspect-video h-full w-full object-cover",x()&&"rounded-[1rem]")}),e.jsxs("p",{className:"text-sm",children:[e.jsx("i",{className:"fa-regular fa-calendar mr-2"}),N(s.releaseDate)]}),e.jsx("h2",{className:"text-xl font-semibold leading-snug",children:s.headline}),e.jsx("p",{className:"leading-snug mt-2",children:s.summary.replaceAll(/<\/?p>/g,"")})]})});function z({options:s,inReverse:r,setInReverse:a}){const[l,n]=u.useState(!1),[i,o]=u.useState("Newest First"),t=u.useRef(null),p=()=>{n(!l)},v=(c,w)=>{a(!r),n(!1),o(w)};return u.useEffect(()=>{const c=w=>{t.current&&!t.current.contains(w.target)&&n(!1)};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[t]),e.jsxs("div",{ref:t,className:"relative inline-block text-left h-full text-dark-grey text-base",children:[e.jsxs("button",{type:"button",onClick:p,"aria-haspopup":"true","aria-expanded":l,className:"inline-flex justify-between w-full lg:w-60 items-center border border-gray-300 rounded-lg px-3 py-[0.62rem] focus:outline-hidden focu
1s:ring-2 focus:ring-offset-2",children:[e.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[i==="Newest First"?e.jsx("i",{className:"fa-regular fa-arrow-down-short-wide"}):e.jsx("i",{className:"fa-regular fa-arrow-up-short-wide"}),i]}),e.jsx("i",{className:d("fa-regular fa-chevron-down ml-2",l&&"rotate-180")})]}),l&&e.jsx("div",{className:"absolute right-0 z-60 w-full bg-white border border-gray-300",role:"menu","aria-orientation":"vertical",children:s.map((c,w)=>e.jsx("button",{onClick:()=>v(c.value,c.label),className:d("block px-3 py-[0.62rem] w-full text-left",i===c.value&&"font-medium",w!==0&&"border-t border-gray-300"),role:"menuitem",tabIndex:0,children:c.label},c.value))})]})}const B=({vpo_domain:s,default_image:r})=>{const[a,l]=u.useState(!1),[n,i]=u.useState(!0),[o,t]=u.useState(!1),[p,v]=u.useState([]),[c,w]=u.useState([]),_=async()=>{i(!0);const b="https://"+s+"/api/newsfeed_releases/list.php?format=json&fields=release_datetime,releaseDate,headline,summary,image_alt,image_caption,social_image_url,url";try{const h=await fetch(b,{method:"GET"}),j=await h.json();h.status===200&&j.release?(v(j.release),t(!1)):t(!0)}catch(h){console.error(h),t(!0)}finally{i(!1)}};return u.useEffect(()=>{if(p.length>0){const b=[...p].sort((h,j)=>a?parseInt(h.release_datetime)-parseInt(j.release_datetime):parseInt(j.release_datetime)-parseInt(h.release_datetime));w(b)}},[a,p]),u.useEffect(()=>{_()},[]),e.jsxs("main",{id:"maincontent",children:[n&&e.jsx(F,{count:9}),o&&e.jsx("p",{className:"my-4 text-center",children:"Oops! There was an error."}),!n&&!o&&c.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex mb-4 mr-4 justify-center sm:justify-end",children:e.jsx(z,{options:[{label:"Newest First",value:"newest_first"},{label:"Oldest First",value:"oldest_first"}],inReverse:a,setInReverse:l})}),e.jsx("ul",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2 px-4 xl:px-0",children:c.map(b=>e.jsx(W,{item:b,default_image:r},b.id))})]}):!n&&!o&&c.length===0&&e.jsx("p",{className:"my-4 text-center",children:"No news was found."})]})},Z=s=>{const{channels:r,algoliaAppId:a,algoliaSearchApiKey:l,index:n,tags:i=""}=s,{searchClient:o}=I(a,l),t=i?i.split(",").map(p=>"categories.allCategories.type:".concat(p.trim())):[];return r==="_vponews_"?e.jsx(B,{vpo_domain:s.vpo_domain,default_image:s.default_image}):e.jsxs(k,{searchClient:o,indexName:n,children:[t.length>0&&e.jsx(y,{filters:t.join(" OR ")}),e.jsx($,{props:s,categories:t})]})};export{Z as default}; 2//# sourceMappingURL=NewsListApp-D7l2RPHd.js.map
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.