import{u as j}from"./widget-qjKd4HCd.js";import{i,f as g,c as z}from"./app-JmgyQoR0.js";import{M as H}from"./MkContainer-6laePfDX.js";import{X as S}from"./MkTimeline-nT4DjZRf.js";import{b as $,a as D,h as s,i as b,j as _,u as r,z as t,t as l,H as E,E as I,x as N,y as T}from"./vue-y3KLWBaS.js";import"./MkNotes-Z5KXbZLG.js";import"./MkNote-Y7yPCL5J.js";import"./MkReactionsViewer-iZKN4Via.js";import"./MkReactionIcon.vue_vue_type_script_setup_true_lang-MnLL2GJr.js";import"./share-available-LNRVMfAE.js";import"./get-note-summary-7eDLQp-L.js";import"./MkDateSeparatedList.vue_vue_type_style_index_0_lang-bpwwzSpi.js";import"./MkPagination-urywMrXv.js";const V={key:0,class:"ph-house ph-bold ph-lg"},X={key:1,class:"ph-chats-circle ph-bold ph-lg"},O={key:2,class:"ph-share-network ph-bold ph-lg"},W={key:3,class:"ph-planet ph-bold ph-lg"},q={key:4,class:"ph-list-bullets ph-bold ph-lg"},A={key:5,class:"ph-television ph-bold ph-lg"},F={style:{"margin-left":"8px"}},f="timeline",le=$({__name:"timeline",props:{widget:{}},emits:["updateProps"],setup(y,{expose:k,emit:w}){const x={showHeader:{type:"boolean",default:!0},height:{type:"number",default:300},src:{type:"string",default:"home",hidden:!0},antenna:{type:"object",default:null,hidden:!0},list:{type:"object",default:null,hidden:!0}},c=y,v=w,{widgetProps:e,configure:C,save:P}=j(f,x,c,v),p=D(!1),n=a=>{e.src=a,P()},B=async a=>{var u;p.value=!0;const[h,M]=await Promise.all([g("antennas/list"),g("users/lists/list")]),d=h.map(o=>({text:o.name,icon:"ph-flying-saucer ph-bold ph-lg",action:()=>{e.antenna=o,n("antenna")}})),m=M.map(o=>({text:o.name,icon:"ph-list-bullets ph-bold ph-lg",action:()=>{e.list=o,n("list")}}));z([{text:i.ts._timelines.home,icon:"ph-house ph-bold ph-lg",action:()=>{n("home")}},{text:i.ts._timelines.local,icon:"ph-chats-teardrop ph-bold ph-lg",action:()=>{n("local")}},{text:i.ts._timelines.social,icon:"ph-share-network ph-bold ph-lg",action:()=>{n("social")}},{text:i.ts._timelines.global,icon:"ph-planet ph-bold ph-lg",action:()=>{n("global")}},d.length>0?null:void 0,...d,m.length>0?null:void 0,...m],(u=a.currentTarget)!=null?u:a.target).then(()=>{p.value=!1})};return k({name:f,configure:C,id:c.widget?c.widget.id:null}),(a,h)=>(s(),b(H,{"show-header":t(e).showHeader,style:T(`height: ${t(e).height}px;`),scrollable:!0,class:"mkw-timeline"},{header:_(()=>[r("button",{class:"_button",onClick:B},[t(e).src==="home"?(s(),l("i",V)):t(e).src==="local"?(s(),l("i",X)):t(e).src==="social"?(s(),l("i",O)):t(e).src==="global"?(s(),l("i",W)):t(e).src==="list"?(s(),l("i",q)):t(e).src==="antenna"?(s(),l("i",A)):E("",!0),r("span",F,I(t(e).src==="list"?t(e).list.name:t(e).src==="antenna"?t(e).antenna.name:t(i).t("_timelines."+t(e).src)),1),r("i",{class:N(p.value?"ph-caret-up ph-bold ph-lg":"ph-caret-down ph-bold ph-lg"),style:{"margin-left":"8px"}},null,2)])]),default:_(()=>[r("div",null,[(s(),b(S,{key:t(e).src==="list"?`list:${t(e).list.id}`:t(e).src==="antenna"?`antenna:${t(e).antenna.id}`:t(e).src,src:t(e).src,list:t(e).list?t(e).list.id:null,antenna:t(e).antenna?t(e).antenna.id:null},null,8,["src","list","antenna"]))])]),_:1},8,["show-header","style"]))}});export{le as default};
