1import{_ as me}from"./D9MvgeHQ.js";import{_ as ge}from"./DenpUUh4.js";import{aK as _e,e as c,y as ve,r as y,w as fe,g as be,G as ye,c as i,d as o,a as v,h as m,i as r,v as g,t as d,F as w,m as k,aL as we,aM as pe,aN as Se,aO as U,z as xe,o as n,a3 as C,aP as ke,Y as Ce,aa as Ae,aQ as Ie,aj as Be}from"./hpNDvw06.js";import{f as Me}from"./JrGicTRf.js";import{n as Ne}from"./BWs-39rO.js";import{i as Le}from"./0r6oY6Uk.js";import{a as Te}from"./Cf455Atp.js";const ze=[{date:"2025-05-10",title:"Is air pollution just a human problem? Not even close.",url:"https://www.youtube.com/shorts/fxY-GPZCdNw",image:""},{date:"2025-04-23",title:"Importance of Air Quality Monitoring Networks",url:"https://www.youtube.com/shorts/QvCldF8FdsY",image:""},{date:"2025-04-16",title:"Air Pollution = Climate Change? Here's the Real Connection!",url:"https://www.youtube.com/shorts/rrKInwHWGL0",image:""},{date:"2025-04-03",title:"Meet AirGradient Open Air - The Climate Change Monitor!",url:"https://www.youtube.com/shorts/K_Vi8HEEvoU",image:""}],Ee={class:"container blog-main-container mt-5"},$e={class:"row"},Pe={class:"col-12 order-0"},Ve={key:0,class:"featured-article mb-5"},De=["src","alt"],Fe={class:"text-muted d-block mb-1"},Ge={class:"mb-3"},Oe={key:0,class:"mb-3"},He={class:"col-lg-4 order-lg-2 order-2 sidebar-section"},Re={class:"card mb-4",style:{"margin-top":"0px"}},We={class:"card-body"},je={class:"list-unstyled mb-0"},Ke={class:"text-muted small mb-1"},Ue={key:0},Ye={class:"card mb-4"},qe={class:"card-body"},Qe={class:"list-unstyled mb-0"},Ze={class:"text-muted small mb-1"},Je={key:0},Xe={class:"card mb-4"},et={class:"card-body"},tt={key:0,class:"list-unstyled mb-0"},st={class:"text-muted small mb-1"},at={class:"mb-2 sidebar-content-text"},ot=["onClick"],rt={key:0},lt={key:1},it={class:"col-lg-8 order-lg-1 order-1"},nt={class:"read-more-section"},ct={class:"d-flex justify-content-between align-items-center flex-wrap mb-2"},dt={class:"blog-controls"},ut={class:"search-container",style:{position:"relative"}},ht={width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",style:{position:"absolute",right:"10px",top:"50%",transform:"translateY(-50%)",color:"#6c757d","pointer-events":"none"}},mt={key:0,class:"search-results"},gt={key:0,class:"search-no-results text-muted"},_t=["onMousedown"],vt=["innerHTML"],ft={class:"search-result-meta text-muted"},bt={class:"text-muted"},yt={class:"masonry-grid",id:"blogCardGrid"},wt=["src","alt"],pt={class:"card-body"},St={class:"text-muted small mb-1"},xt={class:"card-title capitalize"},kt={key:0,class:"text-center mt-3 mb-5"},Ct=["id"],At=["onClick"],It={id:"shortVideoContainer",class:"short-video-frame"},Bt=["src","title"],A="/images/blog/blue_map.webp",Vt={__name:"index",async setup(Mt){let I,P;_e({title:"Blog"});const V=xe(),Y=c(()=>{var e;const t=(e=V.public)==null?void 0:e.apiUrl;return String(t||"").replace(/\/+$/,"")}),{data:D}=([I,P]=ve(()=>Te("blog-db-posts",()=>$fetch(`${Y.value}/content-posts/blog`,{query:{locale:"en"}}).catch(()=>[]))),I=await I,P(),I),F=t=>{const e=new Date(t).getTime();return Number.isFinite(e)?e:0},q=c(()=>(Array.isArray(D.value)?D.value:[]).map(e=>{const s=String((e==null?void 0:e.slug)||"").trim();if(!s)return null;const l={_path:`/blog/${s}`,_source:"db",title:String((e==null?void 0:e.title)||""),shortTitle:String((e==null?void 0:e.shortTitle)||""),date:String((e==null?void 0:e.publishedAt)||""),categories:Array.isArray(e==null?void 0:e.categories)?e.categories:[],author:String((e==null?void 0:e.author)||""),description:String((e==null?void 0:e.description)||""),image:String((e==null?void 0:e.heroImage)||""),highlighted:(e==null?void 0:e.highlighted)===!0,commentSection:(e==null?void 0:e.commentSection)===!0,project:(e==null?void 0:e.project)===!0,productAdEnabled:(e==null?void 0:e.productAdEnabled)!==!1};return Le(l.categories)?l:null}).filter(Boolean)),B=c(()=>q.value),h=c(()=>B.value[0]||null),L=c(()=>B.value.slice(1)),_=y(""),M=y(!1),G=c(()=>_.value.trim().toLowerCase()),p=c(()=>G.value.length>=2),T=c(()=>{if(!p.value)return[];const t=G.value;return L.value.filter(e=>`${e.title||""} ${(e.categories||[]).join(" ")}`.toLowerCase().includes(t)).slice(0,8)}),Q=c(()=>M.value&&p.value),N=y(10),z=c(()=>
1{if(!p.value)return L.value;const t=new Set(T.value.map(e=>e._path));return L.value.filter(e=>t.has(e._path))}),Z=c(()=>p.value?z.value:z.value.slice(0,N.value)),J=c(()=>!p.value&&z.value.length>N.value),X=t=>{const e=s=>{const l=Number(s);return!Number.isFinite(l)||l<=0?Number.POSITIVE_INFINITY:l};return(t||[]).slice().sort((s,l)=>{const a=e(s==null?void 0:s.weight),u=e(l==null?void 0:l.weight);if(a!==u)return a-u;const $=F(s==null?void 0:s.date),K=F(l==null?void 0:l.date);return $!==K?K-$:String((s==null?void 0:s._path)||"").localeCompare(String((l==null?void 0:l._path)||""))})},ee=c(()=>{const t=B.value.filter(e=>e.highlighted===!0);return X(t).slice(0,5)}),te=c(()=>B.value.filter(t=>Array.isArray(t.categories)&&t.categories.some(e=>Ne(e)==="company")).slice(0,5)),E=c(()=>ze.slice(0,4)),f=y(!1),S=y(""),x=y("Short video"),se=c(()=>S.value?`https://www.youtube.com/embed/${S.value}?autoplay=1`:""),O=c(()=>{var e;const t=(e=h.value)==null?void 0:e.description;return t||""}),ae=()=>{N.value+=20},oe=t=>Ce(t),re=()=>{M.value=!0},le=()=>{_.value="",M.value=!1},ie=t=>String(t||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),ne=(t,e)=>{const s=ie(t),l=String(e||"").trim();if(!l)return s;const a=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return s.replace(new RegExp(`(${a})`,"ig"),'<span class="search-highlight">$1</span>')},b=t=>Me(t,{weekday:"long",month:"short",day:"numeric",year:"numeric"}),ce=t=>{const e=String(t||"").trim();if(!e)return"";try{const s=new URL(e),l=s.searchParams.get("v");if(/^[A-Za-z0-9_-]{11}$/.test(l||""))return l||"";const a=s.pathname.split("/").filter(Boolean).pop();return/^[A-Za-z0-9_-]{11}$/.test(a||"")&&a||""}catch{const s=e.split("/").filter(Boolean).pop();return/^[A-Za-z0-9_-]{11}$/.test(s||"")&&s||""}},de=t=>{const e=ce(t==null?void 0:t.url);e&&(S.value=e,x.value=(t==null?void 0:t.title)||"Short video",f.value=!0)},ue=()=>{f.value=!1,S.value="",x.value="Short video"},H=t=>{const e=(t==null?void 0:t.imageLarge)||(t==null?void 0:t.image),s=String(e||"").trim();if(!s)return A;if(s.startsWith("http://")||s.startsWith("https://")||s.startsWith("//"))return s;if(s.includes("/blog-images/")){const l=Ae(V),a=Ie(s,l);return Be(a,800)||A}return s.startsWith("/")?s:A},R=t=>{var s;if(!t)return;const e=((s=t.getAttribute)==null?void 0:s.call(t,"src"))||t.src||"";String(e).includes(A)||(t.src=A)},W=t=>{R(t==null?void 0:t.target)},he=()=>{document.querySelectorAll('img[data-blog-image="fallback"]').forEach(e=>{e.complete&&e.naturalWidth===0&&R(e)})};fe(()=>_.value,()=>{N.value=10});const j=t=>{var e,s;(s=(e=t.target)==null?void 0:e.closest)!=null&&s.call(e,".search-container")||(M.value=!1)};return be(()=>{document.addEventListener("click",j),he()}),ye(()=>{document.removeEventListener("click",j)}),(t,e)=>{const s=me,l=ge;return n(),i(w,null,[o("div",Ee,[o("div",$e,[o("div",Pe,[r(h)?(n(),i("div",Ve,[v(s,{to:r(h)._path,class:"featured-media mb-3"},{default:g(()=>[o("img",{src:H(r(h)),alt:r(h).title,class:"featured-img","data-blog-image":"fallback",onError:W,loading:"eager",decoding:"async",sizes:"100vw"},null,40,De)]),_:1},8,["to"]),o("div",null,[o("span",Fe,d(b(r(h).date)),1),o("h3",Ge,[v(s,{to:r(h)._path,class:"text-decoration-none text-dark capitalize"},{default:g(()=>[C(d(r(h).title),1)]),_:1},8,["to"])]),r(O)?(n(),i("p",Oe,d(r(O)),1)):m("",!0),v(s,{to:r(h)._path,class:"btn-small button-orange"},{default:g(()=>[...e[2]||(e[2]=[C("Read the Article",-1)])]),_:1},8,["to"])])])):m("",!0)]),o("div",He,[o("div",Re,[o("div",We,[e[3]||(e[3]=o("h4",{class:"mb-4"},"Most Popular",-1)),o("ul",je,[(n(!0),i(w,null,k(r(ee),(a,u)=>(n(),i("li",{key:a._path,class:"mb-3"},[o("p",Ke,d(b(a.date)),1),v(s,{to:a._path,class:"capitalize sidebar-content-text"},{default:g(()=>[C(d(a.title),1)]),_:2},1032,["to"]),u!==4?(n(),i("hr",Ue)):m("",!0)]))),128))])])]),o("div",Ye,[o("div",qe,[e[4]||(e[4]=o("h4",null,"CEO Corner",-1)),o("ul",Qe,[(n(!0),i(w,null,k(r(te),(a,u)=>(n(),i("li",{key:a._path,class:"mb-3"},[o("p",Ze,d(b(a.date)),1),v(s,{to:a._path,class:"capitalize sidebar-content-text"},{default:g(()=>[C(d(a.title),1)]),_:2},1032,["to"]),u!==4?(n(),i("hr",Je)):m("",!0)]))),128))])])]),o("div",Xe,[o("div",et,[e[5]||
1(e[5]=o("h4",null,"Shorts",-1)),r(E).length?(n(),i("ul",tt,[(n(!0),i(w,null,k(r(E),(a,u)=>(n(),i("li",{key:a.url,class:"shorts-sidebar-item"},[o("p",st,d(b(a.date)),1),o("p",at,d(a.title),1),o("button",{class:"btn-small button-blue shorts-watch-btn",onClick:$=>de(a)}," Watch ",8,ot),u!==r(E).length-1?(n(),i("hr",rt)):m("",!0)]))),128))])):(n(),i("p",lt,"No shorts available."))])])]),o("div",it,[o("div",nt,[o("div",ct,[o("div",dt,[o("div",ut,[we(o("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>U(_)?_.value=a:null),type:"text",placeholder:"Search articles...",class:"form-control",style:{"padding-right":"35px","min-width":"250px"},autocomplete:"off",onFocus:re,onKeydown:Se(le,["escape"])},null,544),[[pe,r(_)]]),(n(),i("svg",ht,[...e[6]||(e[6]=[o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"},null,-1)])])),r(Q)?(n(),i("div",mt,[r(T).length===0?(n(),i("div",gt," No articles found ")):m("",!0),(n(!0),i(w,null,k(r(T),a=>(n(),i("div",{key:a._path,class:"search-result-item",onMousedown:ke(u=>oe(a._path),["prevent"])},[o("div",{class:"search-result-title",innerHTML:ne(a.title,r(_))},null,8,vt),o("div",ft,[C(d(b(a.date))+" ",1),o("div",bt,d((a.categories||[]).join(", ")),1)])],40,_t))),128))])):m("",!0)])])]),o("div",yt,[(n(!0),i(w,null,k(r(Z),a=>(n(),i("div",{key:a._path,class:"masonry-item blog-card-wrapper"},[v(s,{to:a._path,class:"card blog-card","data-categories":JSON.stringify(a.categories||[]),"data-permalink":a._path,style:{cursor:"pointer",height:"100%"}},{default:g(()=>[o("img",{src:H(a),alt:a.title,class:"card-img-top",style:{height:"180px","object-fit":"cover"},"data-blog-image":"fallback",onError:W,loading:"lazy",decoding:"async",sizes:"(max-width: 768px) 100vw, (max-width: 992px) 50vw, 33vw"},null,40,wt),o("div",pt,[o("p",St,d(b(a.date)),1),o("h5",xt,d(a.title),1)])]),_:2},1032,["to","data-categories","data-permalink"])]))),128))]),r(J)?(n(),i("div",kt,[o("button",{class:"btn-small button-blue mx-auto",onClick:ae},"Show More")])):m("",!0)])])])]),v(l,{modelValue:r(f),"onUpdate:modelValue":e[1]||(e[1]=a=>U(f)?f.value=a:null),title:r(x),"max-width":"min(430px, calc(100vw - 1.5rem))","overlay-class":"short-dialog","dialog-class":"short-dialog-content","header-class":"short-dialog-header","body-class":"short-dialog-body","show-close-button":!1,onClose:ue},{header:g(({titleId:a,close:u})=>[o("h2",{id:a,class:"visually-hidden"},d(r(x)),9,Ct),o("button",{class:"close",style:{outline:"none"},type:"button","aria-label":"Close",onClick:u}," Ã ",8,At)]),default:g(()=>[o("div",It,[r(f)&&r(S)?(n(),i("iframe",{key:0,src:r(se),title:r(x),allow:` 2 accelerometer; 3 autoplay; 4 clipboard-write; 5 encrypted-media; 6 gyroscope; 7 picture-in-picture; 8 `,allowfullscreen:"",class:"short-video-frame__iframe"},null,8,Bt)):m("",!0)])]),_:1},8,["modelValue","title"])],64)}}};export{Vt as default};
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.