1import{aw as H,a8 as I,i as B,av as P}from"./app-BAclpbpz.js";import{u as L}from"./ekSX7_HF.js";import{M as j}from"./DKNgDMmf.js";import{b as N,a as m,c as w,w as k,z as T,g as b,h as n,j as l,s as r,l as i,q as o,B as y,i as z,M as D,N as U,H as V}from"./BI8qgwQJ.js";import"./BTqQ_sdn.js";const $={class:"ekmkgxbj"},q={key:1,class:"_fullinfo"},F=["src"],A=["href","title"],_="rss",Y=N({__name:"WidgetRss",props:{widget:{}},emits:["updateProps"],setup(x,{expose:M,emit:R}){const C={url:{type:"string",default:"http://feeds.afpbb.com/rss/afpbb/afpbbnews"},refreshIntervalSec:{type:"number",default:60},maxEntries:{type:"number",default:15},showHeader:{type:"boolean",default:!0}},d=x,S=R,{widgetProps:t,configure:u}=L(_,C,d,S),c=m([]),f=w(()=>c.value.slice(0,t.maxEntries)),g=m(!0),h=w(()=>{const s=new URL("/api/fetch-rss",H);return s.searchParams.set("url",t.url),s}),p=m(),v=()=>{window.document.visibilityState==="hidden"&&c.value.length!==0||window.fetch(h.value,{}).then(s=>s.json()).then(s=>{c.value=s.items,g.value=!1})};return k(()=>h,v),k(()=>t.refreshIntervalSec,()=>{p.value&&p.value(),p.value=P(v,Math.max(1e4,t.refreshIntervalSec*1e3),{immediate:!0,afterMounted:!0})},{immediate:!0}),M({name:_,configure:u,id:d.widget?d.widget.id:null}),(s,e)=>{const W=T("MkLoading");return n(),b(j,{showHeader:o(t).showHeader,"data-cy-mkw-rss":"",class:"mkw-rss"},{icon:l(()=>e[1]||(e[1]=[r("i",{class:"ph-rss ph-bold ph-lg"},null,-1)])),header:l(()=>e[2]||(e[2]=[V("RSS")])),func:l(({buttonStyleClass:a})=>[r("button",{class:z(["_button",a]),onClick:e[0]||(e[0]=(...E)=>o(u)&&o(u)(...E))},e[3]||(e[3]=[r("i",{class:"ph-gear ph-bold ph-lg"},null,-1)]),2)]),default:l(()=>[r("div",$,[g.value?(n(),b(W,{key:0})):(!f.value||f.value.length===0)&&o(t).showHeader?(n(),i("div",q,[r("img",{src:o(I),draggable:"false"},null,8,F),r("div",null,y(o(B).ts.nothing),1)])):(n(),i("div",{key:2,class:"WidgetRss-feed-eEfl"},[(n(!0),i(D,null,U(f.value,a=>(n(),i("a",{key:a.link,class:"WidgetRss-item-5Tps",href:a.link,rel:"nofollow noopener",target:"_blank",title:a.title},y(a.title),11,A))),128))],2))])]),_:1},8,["showHeader"])}}});export{Y 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.