import{u as y}from"./widget-jbnupkVY.js";import{M}from"./MkContainer-CNBcUt5w.js";import{Q as C,_ as B}from"./app-QjDgb7aF.js";import{b as P,w as S,g as m,i,t as j,u as r,j as s,q as a,p,F as D,G as L,J as E,a as h,E as F,D as H}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const I={class:"ekmkgxbj"},N={key:1,class:"feed"},V=["href","title"],g="rss",$=P({__name:"rss",props:{widget:{}},emits:["updateProps"],setup(b,{expose:_,emit:k}){const w={url:{type:"string",default:"http://feeds.afpbb.com/rss/afpbb/afpbbnews"},height:{type:"number",default:300},showHeader:{type:"boolean",default:!0}},n=b,v=k,{widgetProps:o,configure:l}=y(g,w,n,v),u=h([]),d=h(!0),c=()=>{fetch(`/api/fetch-rss?url=${o.url}`,{}).then(f=>{f.json().then(e=>{u.value=e.items,d.value=!1})})};return S(()=>o.url,c),C(c,6e4,{immediate:!0,afterMounted:!0}),_({name:g,configure:l,id:n.widget?n.widget.id:null}),(f,e)=>{const x=F("MkLoading");return s(),m(M,{"show-header":r(o).showHeader,class:"mkw-rss",scrollable:!0,style:j(`height: ${r(o).height}px;`)},{header:i(()=>[...e[1]||(e[1]=[a("i",{class:"ph-rss ph-bold ph-lg"},null,-1),E("RSS",-1)])]),func:i(()=>[a("button",{class:"_button",onClick:e[0]||(e[0]=(...t)=>r(l)&&r(l)(...t))},[...e[2]||(e[2]=[a("i",{class:"ph-gear-six ph-bold ph-lg"},null,-1)])])]),default:i(()=>[a("div",I,[d.value?(s(),m(x,{key:0})):(s(),p("div",N,[(s(!0),p(D,null,L(u.value,t=>(s(),p("a",{class:"item",href:t.link,rel:"nofollow noopener",target:"_blank",title:t.title},H(t.title),9,V))),256))]))])]),_:1},8,["show-header","style"])}}}),T=B($,[["__scopeId","data-v-17333eb6"]]);export{T as default};
//# sourceMappingURL=rss-DIl_2OqA.js.map
