PageSourceSearch

https://www.mprnews.org/_next/static/chunks/pages/feed/[...slug]-18ff2ed79d740e32.js

js mprnews.org collected 2026-09-24 08:29:00 UTC 10,164 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4922],{25961:(e,t,n)=>{"use strict";n.d(t,{Et:()=>h,I5:()=>d,J0:()=>s,Jv:()=>p,NR:()=>r,WB:()=>v,WR:()=>f,kf:()=>u,lD:()=>w,lM:()=>k,pq:()=>l,ql:()=>c,ru:()=>b,s3:()=>y});var a=n(37876);n(14232);var o=n(18983),i=n(13134);function r(e){return Math.round(1.8*e+32)}function c(e){return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.floor(e/22.5+.5)%16]}function l(e){return(null==e?void 0:e.title)&&(null==e?void 0:e.canonicalSlug)?{tagName:e.title,to:"".concat(e.canonicalSlug),href:"/[...slug]"}:null}n(65364);let s=e=>e.replace(/%user_agent/,"web");function u(e){return!isNaN(parseFloat(e))&&isFinite(e)}function d(e){return e&&e.sort((e,t)=>e.order-t.order),e}function p(e){try{if("object"==typeof e)for(let[t,n]of Object.entries(e))"__typename"!==t&&(e[t]=JSON.parse(n));return e}catch(e){console.error(e)}}function m(e){var t=e.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/);return!!t&&11==t[7].length&&t[7]}function h(e){let t;switch(new URL(e).hostname){case"www.facebook.com":t="https://www.facebook.com/plugins/video.php?href=".concat(e,"&show_text=0");break;case"player.vimeo.com":case"mpr.apmcdn.org":t=e;break;case"www.youtube.com":t="https://www.youtube.com/embed/".concat(m(e));break;default:console.error(t,"source is not a valid video url")}return t}function w(e,t,n){let o,i=new URL(e.url);if(t)switch(i.hostname){case"www.facebook.com":o=(0,a.jsx)("amp-facebook",{title:n,"data-href":e.url,width:"420",height:"560",layout:"responsive","data-embed-as":"video"});break;case"player.vimeo.com":case"mpr.apmcdn.org":o=(0,a.jsx)("amp-video",{title:n,id:e.credit.name,width:"500",height:"360",autoPlay:"autoplay",muted:"muted",loop:"loop",children:(0,a.jsx)("source",{src:e.url,type:"video/mp4"})});break;case"www.youtube.com":o=(0,a.jsx)("amp-youtube",{title:n,"data-videoid":m(e.url),width:"500",height:"360"});break;default:console.error(o,"source is not a valid video url")}else switch(i.hostname){case"www.facebook.com":o=(0,a.jsx)("div",{className:"iframe-container video facebook",children:(0,a.jsx)("iframe",{title:n,src:"https://www.facebook.com/plugins/video.php?href=".concat(e.url,"&show_text=0"),scrolling:"no",frameBorder:"0",allowFullScreen:!0})});break;case"player.vimeo.com":case"mpr.apmcdn.org":o=(0,a.jsxs)("video",{id:e.credit.name,autoPlay:!0,muted:!0,loop:!0,children:[(0,a.jsx)("source",{src:e.url,type:"video/mp4"}),"Your browser does not support HTML5 video."]});break;case"www.youtube.com":o=(0,a.jsx)("div",{className:"iframe-container video youtube",children:(0,a.jsx)("iframe",{title:n,src:"https://www.youtube.com/embed/".concat(m(e.url)),allowFullScreen:!0})});break;default:console.error(o,"source is not a valid video url")}return o}function f(e){let t;return e<0||e>360?null:(e>=0&&e<=11.25&&(t="N"),e>348.75&&e<=360&&(t="N"),e>11.25&&e<=33.75&&(t="NNE"),e>33.75&&e<=56.25&&(t="NE"),e>56.25&&e<=78.75&&(t="ENE"),e>78.75&&e<=101.25&&(t="E"),e>101.25&&e<=123.75&&(t="ESE"),e>123.75&&e<=146.25&&(t="SE"),e>146.25&&e<=168.75&&(t="SSE"),e>168.75&&e<=191.25&&(t="S"),e>191.25&&e<=213.75&&(t="SSW"),e>213.75&&e<=236.25&&(t="SW"),e>236.25&&e<=258.75&&(t="WSW"),e>258.75&&e<=281.25&&(t="W"),e>281.25&&e<=303.75&&(t="WNW"),e>303.75&&e<=326.25&&(t="NW"),e>326.25&&e<=348.75&&(t="NNW"),t)}function b(e){return e.replace(/^0+/,"").replace(/^0+/,"").replace(/^:+/,"").replace(/^0+/,"")}function g(e){let t=new Date(e);return(0,i.GP)(t,"h:mma")}function y(e,t){let n=new Date,a=(0,o.getTimes)(n,e,t);return{sunrise:g(a.sunrise),sunset:g(a.sunset)}}function v(e){let t=e.getHours(),n=e.getMinutes(),a=t>=12?" PM":" AM";return t%=12,(t=t||12)+":"+(n<10?"0"+n:n)+a}function k(e){let t=Array.isArray(e)?e.filter(e=>"string"==typeof e).map(e=>e.toLowerCase()):[],n=t.includes("latest updates"),a=t.includes("live updates"),o=t.includes("live");return n?"Latest Updates":a?"Live Updates":o?"Live":null}},33780:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/feed/[...slug]",function(){return n(36740)}])},36740:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>m});var a=n(56557),o=n(14232),i=n(71454),r=n(83799),c=n(45639),l=n(25961);function s(e){let t=new URL(decodeURI(e)),n=t.searchParams;return n.has("s")&&n.has("c")&&n.has("f")?t.origin+t.pathname:e}var u=n(65364);let d="ddd, DD MMM YYYY HH:mm:ss ZZ",p=()=>{};p.getInitialProps=async e=>{let{query:{slug:t},req:n,res:p}=e,m=async e=>await fetch(u.env.PRIVATE_GRAPHQL_API,{method:"POST",headers:{"Content-Type":"application/json"},body:e()}).then(e=>e.json()).then(e=>e).catch(e=>{console.error("Error: ",e)});if(!p)return;let h='<?xml version="1.0" encoding="UTF-8"?>',w=n.url.replace(/\/feed/,"");
1h+='<rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:snf="http://www.smartnews.be/snf">',h+="<channel>";let f=await m(()=>JSON.stringify({query:'{collection(contentAreaSlug: "'.concat(u.env.CONTENT_AREA_SLUG,'", slug: "').concat(t.join("/"),'") {\n            canonicalSlug\n            title\n            descriptionText\n            publishDate\n            results(pageSize: 30) {\n              items {\n                ... on Story {\n                  shortTitle\n                }\n                title\n                body\n                embeddedAssets {\n                  audio\n                  attachments\n                  images\n                  oembeds\n                }\n                contributors {\n                  profile {\n                    title\n                  }\n                }\n                descriptionText\n                resourceType\n                canonicalSlug\n                publishDate\n                updatedAt\n                audio {\n                  title\n                  credit\n                  encodings {\n                    format\n                    mediaType\n                    httpFilePath\n                    filename\n                    playFilePath\n                    durationMs\n                  }\n                }\n                primaryVisuals {\n                  thumbnail {\n                    xid\n                    shortCaption\n                    fallback\n                    preferredAspectRatio {\n                      instances {\n                        url\n                        width\n                        height\n                        imageType\n                      }\n                    }\n                  }\n                }\n                ...on Link {\n                  destination\n                }\n              }\n            }\n          }\n        }')})),b=f.data.collection;h+="<title>".concat(b&&f.data.collection.title.replace(/&/,"&amp;")," - MPR News</title>"),h+="<link>https://www.mprnews.org".concat(w,"</link>"),h+='<atom:link\n      href="https://www.mprnews.org/feed/'.concat(b&&f.data.collection.canonicalSlug,'"\n  rel="self"\n  type="application/rss+xml"/> '),h+="<description><![CDATA[".concat(b&&f.data.collection.descriptionText,"]]></description>"),h+="<language>en-us</language>",h+="<lastBuildDate>".concat(a(new Date(b&&f.data.collection.publishDate)).format(d),"</lastBuildDate>"),b&&f.data.collection.results.items.forEach(e=>{let t,n,u=(0,r.C2)(e);"link"!=e.resourceType&&(u="https://www.mprnews.org".concat(u));let p=function(e,t){let n=a(e),o=a(t);return n.isAfter(o)?e:t}(e.publishDate,e.updatedAt),m=a(new Date(p)).format(d),w=e.shortTitle?e.shortTitle:e.title,f=(0,r.Re)(e.contributors),b=o.createElement(c.nB,{nodeData:JSON.parse(e.body),embedded:(0,l.Jv)(e.embeddedAssets),minimal:!1}),g=function(e){var t;let n=e.primaryVisuals.thumbnail,a=null==n||null==(t=n.preferredAspectRatio)?void 0:t.instances.find(e=>e.url==n.fallback);return n?"<img ".concat(function(e,t){let n={src:s(e.fallback)};(null==t?void 0:t.height)&&(n.height=t.height),(null==t?void 0:t.width)&&(n.width=t.width),(null==e?void 0:e.shortCaption)&&(n.alt=e.shortCaption);let a="";return Object.keys(n).forEach(e=>a+="".concat(e,'="').concat(n[e],'" ')),a.trim()}(n,a)," />"):""}(e),y=i.renderToStaticMarkup(b),v=e.audio.length>0&&e.audio[0].encodings.length>0&&e.audio[0].encodings[0].playFilePath;v&&(n=(t=e.audio[0].encodings[0]).playFilePath.split("?")[0].replace(/%user_agent/,"web")),h+="<item>\n                  <title>".concat(w.replace(/&/,"&amp;"),"</title>\n                  <link>").concat(u,'</link>\n                  <guid isPermaLink="true">').concat(u,"</guid>\n                  <dc:creator>").concat(f,"</dc:creator>\n                  <pubDate>").concat(m,"</pubDate>\n                  <description><![CDATA[").concat(e.descriptionText,"]]></description>\n                  <content:encoded><![CDATA[").concat(g).concat(y,"]]></content:encoded>"),g&&(h+=function(e){var t,n,a;let o,i=e.primaryVisuals.thumbnail,r=null==i||null==(t=i.preferredAspectRatio)?void 0:t.instances.find(e=>e.url==i.fallback);return o=i?"\n        <media:content ".concat(function(e,t){let n={url:s(e.fallback),medium:"image"};(null==t?void 0:t.height)&&(n.height=t.height),(null==t?void 0:t.width)&&(n.width=t.width),(null==t?void 0:t.imageType)&&(n.type="image/".concat(t.imageType.replace(/jpg/,"jpeg")));let a="";
1return Object.keys(n).forEach(e=>a+="".concat(e,'="').concat(n[e],'" ')),a.trim()}(i,r),' />\n        <media:description type="plain">').concat(i.shortCaption,'</media:description>\n        <media:thumbnail url="').concat((null==e||null==(a=e.primaryVisuals)||null==(n=a.thumbnail)?void 0:n.fallback)?s(e.primaryVisuals.thumbnail.fallback):"",'" />\n        '):""}(e)),v&&(h+='<enclosure url="'.concat(n,'" length="').concat(t.durationMs,'" type="').concat(t.mediaType,'" />')),h+="</item>"}),h+="</channel>",h+="</rss>",p.setHeader("Content-Type","text/xml"),p.setHeader("Cache-Control","public, max-age=60"),p.write(h),p.end()};let m=p}},e=>{e.O(0,[6593,9109,5639,636,8792],()=>e(e.s=33780)),_N_E=e.O()}]);
2//# sourceMappingURL=[...slug]-18ff2ed79d740e32.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.