2025-10-02 05:02:41 -04:00
|
|
|
|
(()=>{"use strict";var e,t,r,n={4084:(e,t,r)=>{var n,i=r(35810),a=r(61338),o=r(53334),s=r(85471),c=r(65043),l=r(63814);async function u(e,t){const r=(0,l.KT)("/apps/files_reminders/api/v1/{fileId}",{fileId:e});return(await c.Ay.put(r,{dueDate:t.toISOString()})).data.ocs.data}async function d(e){const t=(0,l.KT)("/apps/files_reminders/api/v1/{fileId}",{fileId:e});return(await c.Ay.delete(t)).data.ocs.data}function m(){const e=new Date;return e.setHours(0,0,0,0),e.setDate(e.getDate()-e.getDay()+1),new Date(e)}function E(e){new Date(e).setHours(0,0,0,0);const t=new Date(e.getFullYear(),0,1,0,0,0,0),r=(e.getTime()-t.getTime())/864e5;return Math.ceil((r+t.getDay()+1)/7)}function p(e){return{[n.LaterToday]:()=>{const e=new Date,t=new Date;t.setHours(18,0,0,0);const r=new Date;return r.setHours(17,0,0,0),e>=r?null:t},[n.Tomorrow]:()=>{const e=new Date,t=new Date;return t.setDate(e.getDate()+1),t.setHours(8,0,0,0),t},[n.ThisWeekend]:()=>{const e=new Date;if([5,6,0].includes(e.getDay()))return null;const t=new Date,r=m();return t.setDate(r.getDate()+5),t.setHours(8,0,0,0),t},[n.NextWeek]:()=>{if(0===(new Date).getDay())return null;const e=new Date,t=m();return e.setDate(t.getDate()+7),e.setHours(8,0,0,0),e}}[e]()}function f(e){let t={hour:"numeric",minute:"2-digit"};const r=new Date;var n,i;return i=r,((n=e).getDate()!==i.getDate()||n.getMonth()!==i.getMonth()||n.getFullYear()!==i.getFullYear())&&(t={...t,weekday:"short"}),function(e,t){return E(e)===E(t)&&e.getFullYear()===t.getFullYear()}(e,r)||(t={...t,month:"short",day:"numeric"}),e.getFullYear()!==r.getFullYear()&&(t={...t,year:"numeric"}),e.toLocaleString((0,o.lO)(),t)}function h(e){let t={month:"long",day:"numeric",weekday:"long",hour:"numeric",minute:"2-digit"};const r=new Date;return e.getFullYear()!==r.getFullYear()&&(t={...t,year:"numeric"}),e.toLocaleString((0,o.lO)(),t)}!function(e){e.LaterToday="later-today",e.Tomorrow="tomorrow",e.ThisWeekend="this-weekend",e.NextWeek="next-week"}(n||(n={}));const T=new i.hY({id:"clear-reminder",displayName:()=>(0,o.Tl)("files_reminders","Clear reminder"),title:e=>{const t=e.at(0),r=new Date(t.attributes["reminder-due-date"]);return`${(0,o.Tl)("files_reminders","Clear reminder")} – ${h(r)}`},iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-alarm-off" viewBox="0 0 24 24"><path d="M8,3.28L6.6,1.86L5.74,2.57L7.16,4M16.47,18.39C15.26,19.39 13.7,20 12,20A7,7 0 0,1 5,13C5,11.3 5.61,9.74 6.61,8.53M2.92,2.29L1.65,3.57L3,4.9L1.87,5.83L3.29,7.25L4.4,6.31L5.2,7.11C3.83,8.69 3,10.75 3,13A9,9 0 0,0 12,22C14.25,22 16.31,21.17 17.89,19.8L20.09,22L21.36,20.73L3.89,3.27L2.92,2.29M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72M12,6A7,7 0 0,1 19,13C19,13.84 18.84,14.65 18.57,15.4L20.09,16.92C20.67,15.73 21,14.41 21,13A9,9 0 0,0 12,4C10.59,4 9.27,4.33 8.08,4.91L9.6,6.43C10.35,6.16 11.16,6 12,6Z" /></svg>',enabled:e=>{if(1!==e.length)return!1;const t=e.at(0).attributes["reminder-due-date"];return Boolean(t)},async exec(e){if(e.fileid)try{return await d(e.fileid),s.Ay.set(e.attributes,"reminder-due-date",""),(0,a.Ic)("files:node:updated",e),!0}catch{return!1}return null},order:19}),g='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-alarm" viewBox="0 0 24 24"><path d="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z" /></svg>';var A=r(85168),I=r(74095),N=r(4604),_=r(48198),D=r(94219),b=r(31133);const v=(0,r(35947).YK)().setApp("files_reminders").detectUser().build(),L=s.Ay.extend({name:"SetCustomReminderModal",components:{NcButton:I.A,NcDateTime:N.A,NcDateTimePickerNative:_.A,NcDialog:D.A,NcNoteCard:b.A},data:()=>({node:void 0,hasDueDate:!1,opened:!1,isValid:!0,customDueDate:null,nowDate:new Date}),computed:{fileId(){return this.node?.fileid},fileName(){return this.node?.basename},name(){return this.fileName?(0,o.Tl)("files_reminders",'Set reminder for "{fileName}"',{fileName:this.fileName}):""},label:()=>
|