import{t as a,s as r,V as s,a as e,D as i}from"./dav-D-0Zsvk_.chunk.mjs";import{N as n,a as p,l as m,p as d}from"./index-VDTWCae_.chunk.mjs";import{N as h}from"./NcEmptyContent-DEGDbAVb.chunk.mjs";import{N as c}from"./NcLoadingIcon-Ctb4dpAr.chunk.mjs";import{k as l,n as y}from"./icons-D6kGtfXC.chunk.mjs";import{F as u}from"./FileComponent-Cj4I5Fin.chunk.mjs";import{g as f}from"./PhotoSearch-B-dfikGn.chunk.mjs";import"./NcCheckboxRadioSwitch-Ddl_QlRN-Cj43obgd.chunk.mjs";import"./NcIconToggleSwitch-DCTeQGv5-FeLJtWqi.chunk.mjs";import"./useModelMigration-EhAWvqDD-DCXJrerl.chunk.mjs";import"./GenRandomId-F5ebeBB_-DI-yuh7g.chunk.mjs";import"./he-e5ANWCY1.chunk.mjs";const g={name:"DashboardOnThisDay",components:{FileComponent:u,NcButton:n,NcLoadingIcon:c,NcEmptyContent:h,ImageOutlineIcon:l},data(){return{loading:!0,items:[]}},computed:{moreUrl(){return r("/apps/photos/thisday")}},async created(){try{this.items=await f({firstResult:0,nbResults:1,mimesType:p,onThisDay:!0})}catch(t){m.error("Failed to load on this day pictures",{error:t})}finally{this.loading=!1}},methods:{t:a}};var N=function(){var t=this,o=t._self._c;return o("div",{staticClass:"on-this-day-dashboard"},[t.loading?o("NcLoadingIcon",{attrs:{size:48}}):t.items.length===0?o("NcEmptyContent",{attrs:{name:t.t("photos","No picture for this day"),description:t.t("photos","Picture taken on this day will show up here.")},scopedSlots:t._u([{key:"icon",fn:function(){return[o("ImageOutlineIcon")]},proxy:!0}])}):[o("FileComponent",{staticClass:"on-this-day-dashboard__file",attrs:{file:t.items[0],"allow-selection":!1}}),o("NcButton",{attrs:{href:t.moreUrl}},[t._v(" "+t._s(t.t("photos","More photos from this day"))+" ")])]],2)},w=[],C=y(g,N,w,!1,null,"4ab77429");const D=C.exports;s.prototype.t=a,s.prototype.n=e,window.addEventListener("DOMContentLoaded",()=>{window.OCA.Dashboard.register("photos-onthisday",t=>{i.PhotosOnThisDay=new s({el:t,store:d,render:o=>o(D)})})});
//# sourceMappingURL=photos-dashboard.mjs.map
