Files

90 lines
235 KiB
JavaScript
Raw Permalink Normal View History

2026-10-09 22:06:40 +08:00
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
"use strict";var hs=Object.defineProperty;var mp=Object.getOwnPropertyDescriptor;var pp=Object.getOwnPropertyNames;var hp=Object.prototype.hasOwnProperty;var Iu=r=>{throw TypeError(r)};var gp=(r,e,t)=>e in r?hs(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var bp=(r,e)=>{for(var t in e)hs(r,t,{get:e[t],enumerable:!0})},vp=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pp(e))!hp.call(r,i)&&i!==t&&hs(r,i,{get:()=>e[i],enumerable:!(n=mp(e,i))||n.enumerable});return r};var yp=r=>vp(hs({},"__esModule",{value:!0}),r);var c=(r,e,t)=>gp(r,typeof e!="symbol"?e+"":e,t),fl=(r,e,t)=>e.has(r)||Iu("Cannot "+t);var h=(r,e,t)=>(fl(r,e,"read from private field"),t?t.call(r):e.get(r)),L=(r,e,t)=>e.has(r)?Iu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Z=(r,e,t,n)=>(fl(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),U=(r,e,t)=>(fl(r,e,"access private method"),t);var _b={};bp(_b,{default:()=>ul});module.exports=yp(_b);var ho=class{constructor(e){c(this,"deps",e);c(this,"lastExpiredKeys",new Set)}startPeriodicTask(){let e=!0;this.periodicTask().finally(()=>{e=!1}),this.deps.registerInterval(window.setInterval(()=>{if(e){console.debug("Skip reminder interval task because task is already running.");return}e=!0,this.periodicTask().finally(()=>{e=!1})},this.deps.checkIntervalSec()*1e3))}async periodicTask(){if(this.deps.reloadUI(!1),this.deps.isScanned()||this.deps.reloadRemindersInAllFiles().then(()=>{this.deps.markScanned(),this.deps.saveData()}),this.deps.saveData(!1),this.deps.isPopupIntrusive()&&this.deps.isEditing())return;let e=this.deps.getExpiredReminders(),t=new Set(e.map(i=>i.key()));for(let i of t)if(!this.lastExpiredKeys.has(i)){this.deps.reloadUI(!0);break}if(this.lastExpiredKeys=t,!this.deps.isNotificationEnabled()||this.deps.isNotificationPaused())return;let n;for(let i of e)if(this.deps.isLayoutReady()){if(i.muteNotification)continue;if(n)for(;n.beingDisplayed;)await this.sleep(100);this.deps.showReminder(i),n=i}}async sleep(e){return new Promise(t=>window.setTimeout(t,e))}};function ml(r){let e=r.lastIndexOf("/");return(e===-1?r:r.slice(e+1)).replace(/\.md$/i,"")}function pl(r,e){let t=new Map;for(let o of r){let s=t.get(o.sequenceId);s===void 0?t.set(o.sequenceId,[o]):s.push(o)}let n=[],i=[];for(let o of t.values()){let s=o[o.length-1];if(s.event==="message_delete")continue;(s.atSeconds>e?n:i).push({sequenceId:s.sequenceId,atSeconds:s.atSeconds})}return{pending:n,delivered:i}}var go="obr-";function bo(r){return r.startsWith(go)}var Ip=16777619,_p=2166136261,Cp=2654435769;function _u(r,e){let t=e;for(let n=0;n<r.length;n++)t^=r.charCodeAt(n),t=Math.imul(t,Ip);return t>>>0}var xp=`
`;function Cu(r,e){return`${r}${xp}${e}`}function xu(r,e,t){let n=Cu(r,e),i=_u(n,_p).toString(36),o=_u(n,Cp).toString(36),s=`${go}${i}${o}`;return t===0?s:`${s}-${t}`}function hl(r){var i;let e=[...r].sort((o,s)=>o.file!==s.file?o.file<s.file?-1:1:o.rowNumber-s.rowNumber),t=new Map,n=new Map;for(let o of e){let s=Cu(o.file,o.title),a=(i=t.get(s))!=null?i:0;t.set(s,a+1),n.set(o,xu(o.file,o.title,a))}return n}var wp=10,Ap=1440*60;function gl(r){let{reminders:e,serverPending:t,serverDelivered:n=[],now:i,defaultTime:o,minLeadSeconds:s=wp,horizonSeconds:a=Ap}=r,l=i.getTimeInMillis(o),u=l+s*1e3,d=l+a*1e3,p=hl(e),f=new Map;for(let x of e){let X=x.time.getTimeInMillis(o),K=p.get(x);f.set(K,Math.floor(X/1e3))}let m=new Map;for(let x of e){let X=x.time.getTimeInMillis(o);if(X<=u||X>d)continue;let K=p.get(x);m.set(K,{sequenceId:K,atSeconds:Math.floor(X/1e3),reminder:x})}let b=new Map;for(let x of t)b.set(x.sequenceId,x);let g=[];for(let x of m.values()){let X=b.get(x.sequenceId);(X===void 0||X.atSeconds!==x.atSeconds)&&g.push(x)}let v=[],I=new Set;function w(x){I.has(x)||(I.add(x),v.push({sequenceId:x}))}for(let x of t)bo(x.sequenceId)&&(m.has(x.sequenceId)||wu(x,f)&&w(x.sequenceId));for(let x of n)wu(x,f)&&w(x.sequenceId);return{publish:g,delete:v}}function wu(r,e){if(!bo(r.sequenceId))return!1;let t=e.get(r.sequenceId);return t===void 0||t!==r.atSeconds}function bl(r){return r.map(e=>e.sequenceId).filter(bo)}var Rp=/^[-_A-Za-z0-9]{1,64}$/;function ai(r){return Rp.test(r)}var li=class{constructor(e){c(this,"_value",e)}get value(){return this._value}},bn=class{constructor(e){c(this,"_value",e);c(this,"onChangeFunctions",[])}onChanged(e){this.onChangeFunctions.push(e)}get value(){return this._value}set value(e){let t=this._value;this._value=e,this.onChangeFunctions.forEach(n=>{n(t,e)})}};var Au=require("obsidian"),P=Au.moment;var G=class r{constructor(e,t){c(this,"time",e);c(this,"_hasTimePart",t)}static now(){return new r(P(),!0)}static parse(e){return e.length>10?new r(P(e,"YYYY-MM-DD HH:mm"),!0):new r(P(e,"YYYY-MM-DD"),!1)}static ofEpochMillis(e){return new r(P(e),!0)}static duration(e,t,n,i){return t.fixedTime(i).diff(e.fixedTime(i),n)}getTimeInMillis(e){return this.fixedTime(e).valueOf()}format(e,t){return this.fixedTime(t).format(e)}toYYYYMMMM(e){return this.fixedTime(e).format("YYYY, MMMM")}toYYYYMMDD(e){return this.fixedTime(e).format("YYYY-MM-DD")}add(e,t,n){return new r(this.fixedTime(n).clone().add(e,t),this._hasTimePart)}fixedTime(e){return this._hasTimePart?this.time:e===void 0?this.time:this.time.clone().add(e.minutes,"minutes")}get hasTimePart(){return this._hasTimePart}moment(){return this.time}isValid(){return this.time.isValid()}clone(e){let t=e==null?this._hasTimePart:e,n=this.time.clone();return new r(n,t)}toString(){return this._hasTimePart?this.format("YYYY-MM-DD HH:mm"):this.format("YYYY-MM-DD")}equals(e){return this._hasTimePart===e._hasTimePart&&this.time.isSame(e.time)}},gs=class r{constructor(e,t){c(this,"hour",e);c(this,"minute",t)}static parse(e){if(!e.match(/^\d{1,2}:\d{1,2}$/))throw new Error(`Unexpected format time(${e}). Time must be HH:mm.`);let t=e.split(":");if(t.length!==2)throw new Error(`Unexpected format time(${e}). time must be HH:mm.`);let n=parseInt(t[0]),i=parseInt(t[1]);if(n>23||n<0)throw new Error("hour must be 0~23");if(i>59||i<0)throw new Error("minute must be 0~59");return new r(n,i)}get minutes(){return this.hour*60+this.minute}toString(){let e=t=>t<10?"0"+t:""+t;return`${e(this.hour)}:${e(this.minute)}`}};function ci(r,e){return()=>new G(P(),!0).add(r,e)}function Ru(r){return ci(r,"minutes")}function vl(r){return ci(r,"hours")}function kp(r){return ci(r,"days")}function Fp(r){return ci(r,"weeks")}function Sp(r){return ci(r,"months")}function Ep(r){return ci(r,"years")}function Zn(r){return()=>{let e=P();return e.isoWeekday()<=r?new G(e.isoWeekday(r),!1):new G(e.add(1,"weeks").isoWeekday(r),!1)}}function yl(){return()=>new G(P().add(1,"days"),!1)}function ku(){return()=>new G(P().add(1,"weeks"),!1)}function Tp(){return()=>new G(P().add(1,"months"),!1)}function Gp(){return()=>new G(
`).map(e=>Bp(e.trim()))}function Bp(r){if(r=r.toLowerCase(),r.startsWith("in")){let e=r.split(" ");if(e.length!==3)throw new Error("Unsupported format. Should be 'In N (minutes|hours)'");let t=e[1]==="a"||e[1]==="an"?1:parseInt(e[1]);switch(e[2]){case"minute":case"minutes":{let n=t==1?"minute":"minutes";return new ve(`In ${t} ${n}`,Ru(t))}case"hour":case"hours":{let n=t==1?"hour":"hours";return new ve(`In ${t} ${n}`,vl(t))}case"day":case"days":{let n=t==1?"day":"days";return new ve(`In ${t} ${n}`,kp(t))}case"week":case"weeks":{let n=t==1?"week":"weeks";return new ve(`In ${t} ${n}`,Fp(t))}case"month":case"months":{let n=t==1?"month":"months";return new ve(`In ${t} ${n}`,Sp(t))}case"year":case"years":{let n=t==1?"year":"years";return new ve(`In ${t} ${n}`,Ep(t))}}}else if(r.startsWith("next")){let e=r.substring(5);switch(e){case"sunday":return new ve("Next Sunday",Zn(0));case"monday":return new ve("Next Monday",Zn(1));case"tuesday":return new ve("Next Tuesday",Zn(2));case"wednesday":return new ve("Next Wednesday",Zn(3));case"thursday":return new ve("Next Thursday",Zn(4));case"friday":return new ve("Next Friday",Zn(5));case"saturday":return new ve("Next Saturday",Zn(6));case"day":return new ve("Tomorrow",yl());case"week":return new ve("Next week",ku());case"month":return new ve("Next month",Tp());case"year":return new ve("Next year",Gp());default:throw new Error(`Unsupported weekday: ${e}`)}}else if(r==="tomorrow")return new ve("Tomorrow",yl());throw new Error(`Unsupported format: ${r}`)}var _l=[new ve("In 30 minutes",Ru(30)),new ve("In 1 hours",vl(1)),new ve("In 3 hours",vl(3)),new ve("Tomorrow",yl()),new ve("Next week",ku())],Il=class{constructor(){c(this,"dateFormat",new li("YYYY-MM-DD"));c(this,"dateTimeFormat",new li("YYYY-MM-DD HH:mm"));c(this,"strict",new li(!1))}setTimeFormat(e,t,n){this.dateFormat=e,this.dateTimeFormat=t,this.strict=n}parse(e){let t=this.doParse(e,!0);return t!=null?t:this.strict.value?null:this.doParse(e,!1)}doParse(e,t){let n=P(e,this.dateTimeFormat.value,t);if(n.isValid())return new G(n,!0);let i=P(e,this.dateFormat.value,t);return i.isValid()?new G(i,!1):null}toString(e){return e.hasTimePart?e.format(this.dateTimeFormat.value):e.format(this.dateFormat.value)}},xr=new Il;var Dp=1800*1e3,Np=10*1e3,Zp=200;function bs(r){let e=r.trim();return e.length===0?{}:{Authorization:`Bearer ${e}`}}function Eu(r){return r.trim().replace(/\/+$/,"")}function Tu(r,e){return`${r}/${encodeURIComponent(e)}/json?poll=1&sched=1`}function Gu(r,e,t){return`${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`}function vs(r){let e=r.text.trim().slice(0,Zp);return e.length===0?`status=${r.status}`:`status=${r.status} body=${e}`}function Bu(r){return r===401||r===403}var vo=class{constructor(e){c(this,"deps",e);c(this,"debounceTimer");c(this,"syncing",!1);c(this,"syncQueued",!1);c(this,"stopped",!1);c(this,"previousEnabled");c(this,"authFailureNotified",!1)}start(){this.previousEnabled=this.deps.isEnabled(),this.sync(),this.deps.registerInterval(window.setInterval(()=>{this.sync()},Dp))}stop(){this.stopped=!0,this.debounceTimer!==void 0&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=void 0)}notifyRemindersChanged(){this.stopped||(this.debounceTimer!==void 0&&window.clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{this.debounceTimer=void 0,this.sync()},Np))}notifySettingsChanged(){this.stopped||(this.authFailureNotified=!1,this.checkEnabledTransition(),this.notifyRemindersChanged())}noteAuthFailure(e){!Bu(e)||this.authFailureNotified||(this.authFailureNotified=!0,this.deps.notify(`Reminder: the ntfy server rejected the request (${e}). Scheduled notifications are not being published. Check the ntfy access token in the plugin settings.`))}checkEnabledTransition(){let e=this.deps.isEnabled(),t=this.previousEnabled;this.previousEnabled=e,t===!0&&!e&&this.cleanupAfterDisable()}async cleanupAfterDisable(){let e=this.resolveServerAndTopic();if(e===void 0)return;let{serverUrl:t,topic:n}=e;try{let{pending:i}=await this.fetchServerState(t,n),o=bl(i);for(let s of o)await this.deleteSchedule
`)){let a=s.trim();if(a.length===0)continue;let l;try{l=JSON.parse(a)}catch(u){console.error("[ntfy] Failed to parse a poll response line: %o",u);continue}l.event!=="message"&&l.event!=="message_delete"||l.sequence_id===void 0||l.time===void 0||i.push({event:l.event,sequenceId:l.sequence_id,atSeconds:l.time})}let o=Math.floor(Date.now()/1e3);return pl(i,o)}async publish(e,t,n){let i=await this.deps.request({url:`${e}/`,method:"POST",headers:{...bs(this.deps.accessToken()),"Content-Type":"application/json","X-Sequence-ID":n.sequenceId},body:JSON.stringify({topic:t,title:n.reminder.title,message:ml(n.reminder.file),click:this.buildClickUrl(n.reminder),delay:String(n.atSeconds)})});i.status>=400&&(this.noteAuthFailure(i.status),console.error("[ntfy] Failed to publish a scheduled notification: %s",vs(i)))}async deleteScheduled(e,t,n){let i=await this.deps.request({url:Gu(e,t,n),method:"DELETE",headers:bs(this.deps.accessToken())});i.status>=400&&(this.noteAuthFailure(i.status),console.error("[ntfy] Failed to delete a scheduled notification: %s",vs(i)))}buildClickUrl(e){let t=e.file.replace(/\.md$/i,""),n=encodeURIComponent(this.deps.vaultName()),i=encodeURIComponent(t);return`obsidian://open?vault=${n}&file=${i}`}},Su=`${go}selftest`,Xp=1440*60;function Cl(r,e){let t=vs(e);return Bu(e.status)?`${r} was refused (${t}). Check the access token, and that it has read-write access to this topic.`:e.status===404?`${r} failed (${t}). Check the server URL.`:`${r} failed (${t}).`}async function Du(r,e){let t=Eu(e.serverUrl),n=e.topic.trim();if(t.length===0)return{ok:!1,message:"Set the ntfy server URL first."};if(n.length===0)return{ok:!1,message:"Set the ntfy topic first."};if(!ai(n))return{ok:!1,message:"The ntfy topic is not a valid topic name: use only letters, digits, dashes and underscores (1-64 characters)."};let i=bs(e.accessToken);try{let o=await r({url:Tu(t,n),method:"GET",headers:i});if(o.status>=400)return{ok:!1,message:Cl("Reading the topic",o)};let s=await r({url:`${t}/`,method:"POST",headers:{...i,"Content-Type":"application/json","X-Sequence-ID":Su},body:JSON.stringify({topic:n,title:"Reminder connection test",message:"Published by the Obsidian Reminder plugin to check the ntfy settings, and deleted again right away.",delay:String(Math.floor(Date.now()/1e3)+Xp)})});if(s.status>=400)return{ok:!1,message:Cl("Publishing a test message",s)};let a=await r({url:Gu(t,n,Su),method:"DELETE",headers:i});return a.status>=400?{ok:!1,message:`${Cl("Deleting the test message",a)} It stays scheduled until the next sync removes it.`}:{ok:!0,message:"Connected. Reading, publishing and deleting all succeeded."}}catch(o){return{ok:!1,message:`Could not reach ${t}: ${o instanceof Error?o.message:String(o)}`}}}var Yr=require("obsidian");var Jd=require("obsidian");var Nu=require("obsidian");function Zu(r,e){if(!e.reminders.getExpiredReminders(e.settings.reminderTime.value).some(i=>!i.muteNotification))return!1;if(r)return!0;let n=e.reminders.muteExpiredReminders(e.settings.reminderTime.value);return e.ui.reload(!0),e.data.save(!0),new Nu.Notice(`Muted ${n} reminder${n===1?"":"s"}`),!0}var xl=require("obsidian");var Xu=require("obsidian");var ys=class extends Xu.SuggestModal{constructor(t,n,i,o){super(t);c(this,"laters",n);c(this,"onSelect",i);c(this,"onCloseCallback",o);this.setPlaceholder("Pause reminder notifications for...")}getSuggestions(t){return this.laters.filter(n=>n.label.toLowerCase().includes(t.toLowerCase()))}renderSuggestion(t,n){n.createDiv({text:t.label})}onChooseSuggestion(t){this.onSelect(t)}onClose(){var t;(t=this.onCloseCallback)==null||t.call(this)}};function Up(r,e){let t=e.later();r.data.dndUntil.value=t,r.data.save(!0),r.ui.refreshDndStatusBar(),new xl.Notice(`Reminder notifications paused until ${t.format("YYYY-MM-DD HH:mm")}`)}function Is(r){r.data.dndUntil.value=null,r.data.save(!0),r.ui.refreshDndStatusBar(),new xl.Notice("Reminder notifications resumed")}function _s(r,e){new ys(r.app,r.settings.laters.value,t=>{Up(r,t)},e).open()}function Uu(r,e){return r||_s(e),!0}function ui(r,e){return r==null?!1:e.getTimeIn
`),this.todos=[];let t=null,n=0;this.lines.forEach((i,o)=>{let s=Cs.fenceRegexp.exec(i),a=s==null?void 0:s.groups.fence,l=s==null?void 0:s.groups.info;if(t===null){if(a!==void 0&&(a[0]!=="`"||!l.includes("`"))){t=a[0],n=a.length;return}}else{a!==void 0&&a[0]===t&&a.length>=n&&l.trim()===""&&(t=null);return}let u=di.parse(o,i);u&&this.todos.push(u)})}getTodos(){return this.todos}insertTodo(e,t){t.lineIndex=e,this.lines.splice(e,0,t.toMarkdown());let n=-1;for(let[i,o]of this.todos.entries())o.lineIndex>=e&&(n<0&&(n=i),o.lineIndex++);n<=0?this.todos.splice(0,0,t):this.todos.splice(n,0,t)}getTodo(e){let t=this.todos.find(n=>n.lineIndex===e);return t==null?null:t}applyChanges(){this.todos.forEach(e=>{this.lines[e.lineIndex]=e.toMarkdown()})}toMarkdown(){return this.applyChanges(),this.lines.join(`
`)}};c(Cs,"fenceRegexp",/^\s*(?:> ?)*\s*(?<fence>`{3,}|~{3,})(?<info>.*)$/);var Lr=Cs;var Mu=require("obsidian");var Xn=window.require?window.require("electron"):void 0;function xs(){new Mu.Notice('Cannot insert a reminder here. Reminders can only be added to task lines such as "- [ ] task".')}function ws(r){return(r==null?void 0:r.dom.closest(".kanban-plugin__item-input"))!=null}function As(r,e,t,n,i,o){let s=r.appendReminder(e,t,n);if(s!=null)return s;if(o)return Yu(r,e,t,n);if(!i)return null;let a=Lu(e);if(a==null)return null;let l=n==null?void 0:n+(a.length-e.length);return r.appendReminder(a,t,l)}async function Ou(r,e){return Xn&&(await Xn.remote.dialog.showMessageBox({type:"question",title:"Obsidian Reminder",message:r,detail:e,buttons:["OK","Cancel"],cancelId:1})).response===0?0:1}var fi=class r{constructor(e,t,n,i,o){c(this,"file",e);c(this,"title",t);c(this,"time",n);c(this,"rowNumber",i);c(this,"done",o);c(this,"muteNotification",!1);c(this,"beingDisplayed",!1)}key(){return this.file+this.title+this.time.toString()}isExpired(e,t){return this.time.getTimeInMillis(t)<=e}equals(e){return this.rowNumber===e.rowNumber&&this.title===e.title&&this.time.equals(e.time)&&this.file===e.file}getFileName(){return r.extractFileName(this.file)}static extractFileName(e){let t=e.split(/[/\\]/);return t[t.length-1].replace(/^(.*?)(\..+)?$/,"$1")}},Rs=class{constructor(e){c(this,"onChange",e);c(this,"fileToReminders",new Map);c(this,"reminders",[]);c(this,"reminderTime")}getExpiredReminders(e){let t=new Date().getTime(),n=[];for(let i=0;i<this.reminders.length;i++){let o=this.reminders[i];if(o.isExpired(t,e))n.push(o);else break}return n}muteExpiredReminders(e){let t=0;for(let n of this.getExpiredReminders(e))n.muteNotification||(n.muteNotification=!0,t++);return t}byDate(e){return this.reminders.filter(t=>t.time.toYYYYMMDD()===e.toYYYYMMDD())}removeReminder(e){console.debug("Remove reminder: %o",e),this.reminders.remove(e);let t=this.fileToReminders.get(e.file);t&&(t.remove(e),t.length===0&&this.fileToReminders.delete(e.file)),this.onChange()}clear(){this.fileToReminders.clear(),this.reminders=[],this.onChange()}removeByFile(e){return this.fileToReminders.delete(e)?(this.sortReminders(),!0):!1}replaceFile(e,t){let n=this.fileToReminders.get(e);if(n){if(this.equals(n,t))return!1;let i=new Map;for(let o of n)i.set(o.key(),o.muteNotification);for(let o of t){let s=i.get(o.key());i.set(o.key(),o.muteNotification),s!==void 0&&(o.muteNotification=s)}}return this.fileToReminders.set(e,t),this.sortReminders(),!0}equals(e,t){if(e.length!==t.length)return!1;let n=[...e],i=[...t];return this.sort(n),this.sort(i),n.every((o,s)=>o.equals(i[s]))}sortReminders(){let e=[];for(let t of this.fileToReminders.values())e.push(...t);this.sort(e),this.reminders=e,this.onChange()}sort(e){e.sort((t,n)=>{var o,s;let i=t.time.getTimeInMillis((o=this.reminderTime)==null?void 0:o.value)-n.time.getTimeInMillis((s=this.reminderTime)==null?void 0:s.value);return i>0?1:i<0?-1:0})}},Pu=[{name:"US Style (12h)",format:{yearMonthFormat:"MMMM YYYY",monthDayFormat:"MM/DD",shortDateWithWeekdayFormat:"M/DD (ddd)",timeFormat:"h:mm A"}},{name:"US Style (24h)",format:{yearMonthFormat:"MMMM YYYY",monthDayFormat:"MM/DD",shortDateWithWeekdayFormat:"M/DD (ddd)",timeFormat:"HH:mm"}},{name:"EU Style (24h)",format:{yearMonthFormat:"MMMM YYYY",monthDayFormat:"DD/MM",shortDateWithWeekdayFormat:"D/MM (ddd)",timeFormat:"HH:mm"}},{name:"EU Style (12h)",format:{yearMonthFormat:"MMMM YYYY",monthDayFormat:"DD/MM",shortDateWithWeekdayFormat:"D/MM (ddd)",timeFormat:"h:mm A"}},{name:"JP Style (24h)",format:{yearMonthFormat:"YYYY\u5E74MM\u6708",monthDayFormat:"MM/DD",shortDateWithWeekdayFormat:"M\u6708D\u65E5 (ddd)",timeFormat:"HH:mm"}},{name:"JP Style (12h)",format:{yearMonthFormat:"YYYY\u5E74MM\u6708",monthDayFormat:"MM/DD",shortDateWithWeekdayFormat:"M\u6708D\u65E5 (ddd)",timeFormat:"h:mm A"}}];function $u(r,e,t,n){let i=G.duration(e,r,"days",t);if(i>30)return new yn(r.format(n.yearMonthFormat,t),o=>o.format(n.monthDayFormat,t));if(i>=7)return new yn("Over 1 week",o=>o.format(n.monthDa
`).map(zp).filter(function(t){return t!==null});return nt(nt({},e[0]),e[1])}function Fo(r){var e={},t=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(r);if(!t)return e;var n=t[1],i=t[2];return n&&(e.tzid=n),e.dtstart=wo(i),e}function zp(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return md(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return md(r);case"DTSTART":return Fo(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function md(r){var e=r.replace(/^RRULE:/i,""),t=Fo(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(i){var o=i.split("="),s=o[0],a=o[1];switch(s.toUpperCase()){case"FREQ":t.freq=j[a.toUpperCase()];break;case"WKST":t.wkst=ir[a.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var l=Kp(a),u=s.toLowerCase();t[u]=l;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=qp(a);break;case"DTSTART":case"TZID":var d=Fo(r);t.tzid=d.tzid,t.dtstart=d.dtstart;break;case"UNTIL":t.until=wo(a);break;case"BYEASTER":t.byeaster=Number(a);break;default:throw new Error("Unknown RRULE property '"+s+"'")}}),t}function Kp(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(pd)}return pd(r)}function pd(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function qp(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return ir[t];var n=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!n||n.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var i=Number(n[1]),o=n[2],s=ir[o].weekday;return new Ne(s,i)})}var Vn=(function(){function r(e,t){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=t}return Object.defineProperty(r.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),r.prototype.toString=function(){var e=pi(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},r.prototype.getTime=function(){return this.date.getTime()},r.prototype.rezonedDate=function(){return this.isUTC?this.date:id(this.date,this.tzid)},r})();function Eo(r){for(var e=[],t="",n=Object.keys(r),i=Object.keys(ko),o=0;o<n.length;o++)if(n[o]!=="tzid"&&re(i,n[o])){var s=n[o].toUpperCase(),a=r[n[o]],l="";if(!(!be(a)||rt(a)&&!a.length)){switch(s){case"FREQ":l=F.FREQUENCIES[r.freq];break;case"WKST":Ut(a)?l=new Ne(a).toString():l=a.toString();break;case"BYWEEKDAY":s="BYDAY",l=qu(a).map(function(m){return m instanceof Ne?m:rt(m)?new Ne(m[0],m[1]):new Ne(m)}).toString();break;case"DTSTART":t=eh(a,r.tzid);break;case"UNTIL":l=pi(a,!r.tzid);break;default:if(rt(a)){for(var u=[],d=0;d<a.length;d++)u[d]=String(a[d]);l=u.toString()}else l=String(a)}l&&e.push([s,l])}}var p=e.map(function(m){var b=m[0],g=m[1];return"".concat(b,"=").concat(g.toString())}).join(";"),f="";return p!==""&&(f="RRULE:".concat(p)),[t,f].filter(function(m){return!!m}).join(`
`)}function eh(r,e){return r?"DTSTART"+new Vn(new Date(r),e).toString():""}function th(r,e){return Array.isArray(r)?!Array.isArray(e)||r.length!==e.length?!1:r.every(function(t,n){return t.getTime()===e[n].getTime()}):r instanceof Date?e instanceof Date&&r.getTime()===e.getTime():r===e}var hd=(function(){function r(){this.all=!1,this.before=[],this.after=[],this.between=[]}return r.prototype._cacheAdd=function(e,t,n){t&&(t=t instanceof Date?Gs(t):Fl(t)),e==="all"?this.all=t:(n._value=t,this[e].push(n))},r.prototype._cacheGet=function(e,t){var n=!1,i=t?Object.keys(t):[],o=function(d){for(var p=0;p<i.length;p++){var f=i[p];if(!th(t[f],d[f]))return!0}return!1},s=this[e];if(e==="all")n=this.all;else if(rt(s))for(var a=0;a<s.length;a++){var l=s[a];if(!(i.length&&o(l))){n=l._value;break}}if(!n&&this.all){for(var u=new $r(e,t),a=0;a<this.all.length&&u.accept(this.all[a]);a++);n=u.getValue(),this._cacheAdd(e,n,t)}return rt(n)?Fl(n):n instanceof Date?Gs(n):n},r})();var gd=A(A(A(A(A(A(A(A(A(A(A(A(A([],ee(1,31),!0),ee(2,28),!0),ee(3,31),!0),ee(4,30),!0),ee(5,31),!0),ee(6,30),!0),ee(7,31),!0),ee(8,31),!0),ee(9,30),!0),ee(10,31),!0),ee(11,30),!0),ee(12,31),!0),ee(1,7),!0),bd=A(A(A(A(A(A(A(A(A(A(A(A(A([],ee(1,31),!0),ee(2,29),!0),ee(3,31),!0),ee(4,30),!0),ee(5,31),!0),ee(6,30),!0),ee(7,31),!0),ee(8,31),!0),ee(9,30),!0),ee(10,31),!0),ee(11,30),!0),ee(12,31),!0),ee(1,7),!0),rh=nr(1,29),nh=nr(1,30),_n=nr(1,31),gt=nr(1,32),vd=A(A(A(A(A(A(A(A(A(A(A(A(A([],gt,!0),nh,!0),gt,!0),_n,!0),gt,!0),_n,!0),gt,!0),gt,!0),_n,!0),gt,!0),_n,!0),gt,!0),gt.slice(0,7),!0),yd=A(A(A(A(A(A(A(A(A(A(A(A(A([],gt,!0),rh,!0),gt,!0),_n,!0),gt,!0),_n,!0),gt,!0),gt,!0),_n,!0),gt,!0),_n,!0),gt,!0),gt.slice(0,7),!0),ih=nr(-28,0),oh=nr(-29,0),Cn=nr(-30,0),bt=nr(-31,0),Id=A(A(A(A(A(A(A(A(A(A(A(A(A([],bt,!0),oh,!0),bt,!0),Cn,!0),bt,!0),Cn,!0),bt,!0),bt,!0),Cn,!0),bt,!0),Cn,!0),bt,!0),bt.slice(0,7),!0),_d=A(A(A(A(A(A(A(A(A(A(A(A(A([],bt,!0),ih,!0),bt,!0),Cn,!0),bt,!0),Cn,!0),bt,!0),bt,!0),Cn,!0),bt,!0),Cn,!0),bt,!0),bt.slice(0,7),!0),Cd=[0,31,60,91,121,152,182,213,244,274,305,335,366],xd=[0,31,59,90,120,151,181,212,243,273,304,334,365],Gl=(function(){for(var r=[],e=0;e<55;e++)r=r.concat(nr(7));return r})();function wd(r,e){var t=wr(r,1,1),n=mi(r)?366:365,i=mi(r+1)?366:365,o=xo(t),s=Mr(t),a=nt(nt({yearlen:n,nextyearlen:i,yearordinal:o,yearweekday:s},sh(r)),{wnomask:null});if(Qt(e.byweekno))return a;a.wnomask=ee(0,n+7);var l,u,d=l=ht(7-s+e.wkst,7);d>=4?(d=0,u=a.yearlen+ht(s-e.wkst,7)):u=n-d;for(var p=Math.floor(u/7),f=ht(u,7),m=Math.floor(p+f/4),b=0;b<e.byweekno.length;b++){var g=e.byweekno[b];if(g<0&&(g+=m+1),g>0&&g<=m){var v=void 0;g>1?(v=d+(g-1)*7,d!==l&&(v-=7-l)):v=d;for(var I=0;I<7&&(a.wnomask[v]=1,v++,a.wdaymask[v]!==e.wkst);I++);}}if(re(e.byweekno,1)){var v=d+m*7;if(d!==l&&(v-=7-l),v<n)for(var b=0;b<7&&(a.wnomask[v]=1,v+=1,a.wdaymask[v]!==e.wkst);b++);}if(d){var w=void 0;if(re(e.byweekno,-1))w=-1;else{var x=Mr(wr(r-1,1,1)),X=ht(7-x.valueOf()+e.wkst,7),K=mi(r-1)?366:365,V=void 0;X>=4?(X=0,V=K+ht(x-e.wkst,7)):V=n-d,w=Math.floor(52+ht(V,7)/4)}if(re(e.byweekno,w))for(var v=0;v<d;v++)a.wnomask[v]=1}return a}function sh(r){var e=mi(r)?366:365,t=wr(r,1,1),n=Mr(t);return e===365?{mmask:gd,mdaymask:yd,nmdaymask:_d,wdaymask:Gl.slice(n),mrange:xd}:{mmask:bd,mdaymask:vd,nmdaymask:Id,wdaymask:Gl.slice(n),mrange:Cd}}function Ad(r,e,t,n,i,o){var s={lastyear:r,lastmonth:e,nwdaymask:[]},a=[];if(o.freq===F.YEARLY)if(Qt(o.bymonth))a=[[0,t]];else for(var l=0;l<o.bymonth.length;l++)e=o.bymonth[l],a.push(n.slice(e-1,e+1));else o.freq===F.MONTHLY&&(a=[n.slice(e-1,e+1)]);if(Qt(a))return s;s.nwdaymask=ee(0,t);for(var l=0;l<a.length;l++)for(var u=a[l],d=u[0],p=u[1]-1,f=0;f<o.bynweekday.length;f++){var m=void 0,b=o.bynweekday[f],g=b[0],v=b[1];v<0?(m=p+(v+1)*7,m-=ht(i[m]-g,7)):(m=d+(v-1)*7,m+=ht(7-i[m]+g,7)),d<=m&&m<=p&&(s.nwdaymask[m]=1)}return s}function Rd(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),i=r%100,o=Math.floor(n/4),s=n%4,a=Math.floor((n+8)/25),l=Math.floor((n-a+1)/3),u=Math.floor(19*t+n-o-l+15)%30,d=Math.floor(i/4),p=i%4,f=Math.floor(32+2*s+2*d-u-p)%7,m=Math.floor((t+11*u
`),n=0;n<t.length;){var i=t[n]=t[n].replace(/\s+$/g,"");i?n>0&&i[0]===" "?(t[n-1]+=i.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function bh(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function Gd(r,e){return bh(e),r.split(",").map(function(t){return wo(t)})}function Bd(r){var e=this;return function(t){if(t!==void 0&&(e["_".concat(r)]=t),e["_".concat(r)]!==void 0)return e["_".concat(r)];for(var n=0;n<e._rrule.length;n++){var i=e._rrule[n].origOptions[r];if(i)return i}}}var Dl=(function(r){hi(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=Bd.apply(n,["dtstart"]),n.tzid=Bd.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return Ed(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){Dd(t,this._rrule)},e.prototype.exrule=function(t){Dd(t,this._exrule)},e.prototype.rdate=function(t){Nd(t,this._rdate)},e.prototype.exdate=function(t){Nd(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return Ds(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return Ds(t.toString())})},e.prototype.rdates=function(){return this._rdate.map(function(t){return new Date(t.getTime())})},e.prototype.exdates=function(){return this._exdate.map(function(t){return new Date(t.getTime())})},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(Eo({dtstart:this._dtstart}))),this._rrule.forEach(function(n){t=t.concat(n.toString().split(`
`))}),this._exrule.forEach(function(n){t=t.concat(n.toString().split(`
`).map(function(i){return i.replace(/^RRULE:/,"EXRULE:")}).filter(function(i){return!/^DTSTART/.test(i)}))}),this._rdate.length&&t.push(Zd("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(Zd("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join(`
`)},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach(function(n){return t.rrule(n.clone())}),this._exrule.forEach(function(n){return t.exrule(n.clone())}),this._rdate.forEach(function(n){return t.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return t.exdate(new Date(n.getTime()))}),t},e})(F);function Dd(r,e){if(!(r instanceof F))throw new TypeError(String(r)+" is not RRule instance");re(e.map(String),String(r))||e.push(r)}function Nd(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");re(e.map(Number),Number(r))||(e.push(r),Or(e))}function Zd(r,e,t){var n=!t||t.toUpperCase()==="UTC",i=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),o=e.map(function(s){return pi(s.valueOf(),n)}).join(",");return"".concat(i).concat(o)}function vi(r,e,t){let n;try{n=F.parseText(r)}catch(u){console.warn("Failed to parse recurrence text: recurrence=%s, error=%o",r,u);return}if(!n)return;e=e.clone();let i=t.moment().clone();i.set("hour",e.get("hour")),i.set("minute",e.get("minute")),i.set("second",e.get("second")),i.set("millisecond",e.get("millisecond")),i.isAfter(e)&&(e=i);let o=e.clone();n.dtstart=e.utc(!0).toDate();let a=new F(n).after(e.toDate(),!1);if(a==null)return;let l=a.getTime()-n.dtstart.getTime();return o.add(l,"millisecond"),o.toDate()}function Ns(r){return r.replace(/#[\p{L}\p{N}\p{M}_/-]+/gu,"").trim()}var yi=class extends In{modifyReminder(e,t,n,i){if(!super.modifyReminder(e,t,n,i))return!1;if(i.checked!==void 0)if(i.checked){let o=n.getRecurrence();if(o!==null){let s=t.clone(),a=n.clone(),l=n.getDueDate(),u=this.config.getParameter(_e.now);if(this.usesSeparateReminderDate(n)){let d=n.getTime();if(d==null)return!1;let p=vi(o,d.moment(),u);if(p==null)return!1;if(a.setTime(new G(P(p),d.hasTimePart)),l!=null){let f=vi(o,l.moment(),u);if(f==null)return!1;a.setDueDate(new G(P(f),l.hasTimePart))}}else{if(l==null)return!1;let d=vi(o,l.moment(),u);if(d==null)return!1;let p=new G(P(d),l.hasTimePart);a.setTime(p)}s.body=a.toMarkdown(),s.setChecked(!1),e.insertTodo(t.lineIndex,s)}n.setDoneDate(this.config.getParameter(_e.now))}else n.setDoneDate(void 0);return!0}};var vh=["YYYY-MM-DDTHH:mm","YYYY-MM-DD HH:mm"],Zl="YYYY-MM-DD";function Nl(r){for(let t of vh){let n=P(r,t,!0);if(n.isValid())return new G(n,!0)}let e=P(r,Zl,!0);return e.isValid()?new G(e,!1):null}function Xd(r){return r.hasTimePart?r.format("YYYY-MM-DDTHH:mm"):r.format(Zl)}var Yn="due",Zs="completion",Ud="repeat",yh="scheduled",Ih="start",_h=[Yn,Zs,Ud,yh,Ih],Xs=class r{constructor(e,t,n){c(this,"text",e);c(this,"reminderFieldName",t);c(this,"removeTags",n)}static parse(e,t,n){return new r(e,t.toLowerCase(),n!=null?n:!1)}fields(){return ju(this.text)}fieldsByKey(e){return this.fields().filter(t=>t.key.toLowerCase()===e)}firstField(e){var t;return(t=this.fieldsByKey(e)[0])!=null?t:null}hasReminderField(){return this.firstField(this.reminderFieldName)!=null}hasAnySourceField(){return this.hasReminderField()||this.firstField(Yn)!=null}reminderSourceField(){var e;return(e=this.firstField(this.reminderFieldName))!=null?e:this.firstField(Yn)}getTitle(){let e=new Set([..._h,this.reminderFieldName]),t=this.fields().filter(i=>e.has(i.key.toLowerCase())).sort((i,o)=>o.start-i.start),n=this.text;for(let i of t)n=wl(n,i);return n=n.trim(),this.removeTags&&(n=Ns(n)),n}getTime(){let e=this.reminderSourceField();return e==null?null:Nl(e.value)}setTime(e){var i;let t=this.reminderSourceField(),n=(i=t==null?void 0:t.key)!=null?i:Yn;this.setFieldValue(n,Xd(e))}setRawTime(e){var i;let t=this.reminderSourceField(),n=(i=t==null?void 0:t.key)!=null?i:Yn;return this.setFieldValue(n,e),!0}getDueDate(){let e=this.firstField(Yn);return e==null?null:Nl(e.value)}setDueDate(e){this.setFieldValue(Yn,Xd(e))}getRecurrence(){var t;let e=this.firstField(Ud);return(t=e==null?void 0:e.value)!=null?t:null}getDoneDate(){let e=this.firstField(Zs);return e==null?null:Nl(e.value)}setDoneDate(e){if(e==null){this.removeFieldByKey(Zs);return}let t=e instanceof G?e.format(Zl):e;this.setFieldValue(Zs,t)}getEndOfTimeTextIndex(){let
[${i}]`);for(let s of o)t.push(String(s));r.app.vault.adapter.write(e,t.join(" "))};console.debug=n("debug"),console.error=n("error"),console.info=n("info"),console.log=n("log"),console.warn=n("warn")}var kr="reminder-list";var Ah=10*1e3,ea=class{constructor(e){c(this,"plugin",e);c(this,"el")}onload(){this.el=this.plugin.addStatusBarItem(),this.el.addClasses(["reminder-status-bar-item","reminder-dnd-status-bar","is-hidden"]),this.el.setAttribute("aria-label","Click to resume reminder notifications"),this.plugin.registerDomEvent(this.el,"click",()=>{Is(this.plugin)}),this.plugin.registerInterval(window.setInterval(()=>this.refresh(),Ah)),this.refresh()}refresh(){if(!this.el)return;let e=this.plugin.data.dndUntil.value;if(!ui(e,G.now())){this.el.addClass("is-hidden");return}this.el.setText(`\u{1F515} Until ${this.formatUntil(e)}`),this.el.removeClass("is-hidden")}formatUntil(e){let t=this.plugin.settings.timeDisplayFormat.value,n=e.format(t);if(e.toYYYYMMDD()===G.now().toYYYYMMDD())return n;let i=this.plugin.settings.monthDayDisplayFormat.value;return`${e.format(i)} ${n}`}};var Rh=10*1e3,ta=class{constructor(e){c(this,"plugin",e);c(this,"el")}onload(){this.el=this.plugin.addStatusBarItem(),this.el.addClasses(["reminder-status-bar-item","reminder-overdue-status-bar","is-hidden"]),this.el.setAttribute("aria-label","Overdue reminders \u2014 click to open the reminder list"),this.plugin.registerDomEvent(this.el,"click",()=>{this.plugin.ui.showReminderList()}),this.plugin.settings.showOverdueCountInStatusBar.rawValue.onChanged(()=>this.refresh()),this.plugin.registerInterval(window.setInterval(()=>this.refresh(),Rh)),this.refresh()}refresh(){if(!this.el)return;if(!this.plugin.settings.showOverdueCountInStatusBar.value){this.el.addClass("is-hidden");return}let e=this.plugin.reminders.getExpiredReminders(this.plugin.settings.reminderTime.value).length;if(e===0){this.el.addClass("is-hidden");return}this.el.setText(`\u23F0 ${e}`),this.el.removeClass("is-hidden")}};var La=require("obsidian");var it=Symbol("$state"),ra=Symbol("component"),Go=Symbol("legacy props"),ef=Symbol(""),na=Symbol("proxy path"),ia=Symbol("attributes"),Bo=Symbol("class"),Vl=Symbol("style"),Do=Symbol("text"),xn=Symbol("form reset"),Yl=Symbol("hmr anchor"),Jr=new class extends Error{constructor(){super(...arguments);c(this,"name","StaleReactionError");c(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},qd,Ll=!!((qd=globalThis.document)!=null&&qd.contentType)&&globalThis.document.contentType.includes("xml");var Ai=3,sr=8;var rf,nf,tf=(nf=(rf=globalThis.process)==null?void 0:rf.env)==null?void 0:nf.NODE_ENV,_=tf&&!tf.toLowerCase().startsWith("prod");var Wt=Array.isArray,of=Array.prototype.indexOf,jr=Array.prototype.includes,Ri=Array.from,Ml=Object.keys,Ye=Object.defineProperty,Ct=Object.getOwnPropertyDescriptor,oa=Object.getOwnPropertyDescriptors,Ol=Object.prototype,sf=Array.prototype,Ln=Object.getPrototypeOf,$l=Object.isExtensible;var Fr=()=>{};function af(r){return r()}function ki(r){for(var e=0;e<r.length;e++)r[e]()}function sa(){var r,e,t=new Promise((n,i)=>{r=n,e=i});return{promise:t,resolve:r,reject:e}}function aa(r){return r===this.v}function Pl(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function la(r){return!Pl(r,this.v)}function lf(r){if(_){let e=new Error(`invariant_violation
An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app \u2014 please open an issue at https://github.com/sveltejs/svelte, citing the following message: "${r}"
https://svelte.dev/e/invariant_violation`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/invariant_violation")}function Fi(r){if(_){let e=new Error(`lifecycle_outside_component
\`${r}(...)\` can only be used during component initialisation
https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function uf(){if(_){let r=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function Hl(){if(_){let r=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function df(){if(_){let r=new Error(`derived_references_self
A derived value cannot reference itself recursively
https://svelte.dev/e/derived_references_self`);throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/derived_references_self")}function Jl(r,e,t){if(_){let n=new Error(`each_key_duplicate
${t?`Keyed each block has duplicate key \`${t}\` at indexes ${r} and ${e}`:`Keyed each block has duplicate key at indexes ${r} and ${e}`}
https://svelte.dev/e/each_key_duplicate`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function ff(r,e,t){if(_){let n=new Error(`each_key_volatile
Keyed each block has key that is not idempotent \u2014 the key for item at index ${r} was \`${e}\` but is now \`${t}\`. Keys must be the same each time for a given item
https://svelte.dev/e/each_key_volatile`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_volatile")}function mf(r){if(_){let e=new Error(`effect_in_teardown
\`${r}\` cannot be used inside an effect cleanup function
https://svelte.dev/e/effect_in_teardown`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function pf(){if(_){let r=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function hf(r){if(_){let e=new Error(`effect_orphan
\`${r}\` can only be used inside an effect (e.g. during component initialisation)
https://svelte.dev/e/effect_orphan`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_orphan")}function gf(){if(_){let r=new Error(`effect_update_depth_exceeded
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
https://svelte.dev/e/effect_update_depth_exceeded`);throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function bf(){if(_){let r=new Error(`hydration_failed
Failed to hydrate the application
https://svelte.dev/e/hydration_failed`);throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/hydration_failed")}function vf(r){if(_){let e=new Error(`lifecycle_legacy_only
\`${r}(...)\` cannot be used in runes mode
https://svelte.dev/e/lifecycle_legacy_only`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_legacy_only")}function yf(r){if(_){let e=new Error(`props_invalid_value
Cannot do \`bind:${r}={undefined}\` when \`${r}\` has a fallback value
https://svelte.dev/e/props_invalid_value`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/props_invalid_value")}function If(r){if(_){let e=new Error(`rune_outside_svelte
The \`${r}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
https://svelte.dev/e/rune_outside_svelte`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function _f(){if(_){let r=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Cf(){if(_){let r=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function xf(){if(_){let r=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function wf(){if(_){let r=new Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var Le=!1,Sr=!1,fr=!1;function Af(){Sr=!0}var Vt={};var he=Symbol("uninitialized"),ar=Symbol("filename");var ca="http://www.w3.org/1999/xhtml";var No=null;function vt(r,e){return r.label=e,da(r.v,e),r}function da(r,e){var t;return(t=r==null?void 0:r[na])==null||t.call(r,e),r}function mr(r){let e=new Error,t=Fh();return t.length===0?null:(t.unshift(`
`),Ye(e,"stack",{value:t.join(`
`)}),Ye(e,"name",{value:r}),e)}function Fh(){let r=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let e=new Error().stack;if(Error.stackTraceLimit=r,!e)return[];let t=e.split(`
`),n=[];for(let i=0;i<t.length;i++){let o=t[i],s=o.replaceAll("\\","/");if(o.trim()!=="Error"){if(o.includes("validate_each_keys"))return[];s.includes("svelte/src/internal")||s.includes("node_modules/.vite")||n.push(o)}}return n}function kf(r,e){if(!_)throw new Error("invariant(...) was not guarded by if (DEV)");r||lf(e)}var Y=null;function zr(r){Y=r}var Er=null;function Si(r){Er=r}var pr=null;function fa(r){pr=r}function Se(r,e=!1,t){Y={p:Y,i:!1,c:null,e:null,s:r,x:null,r:k,l:Sr&&!e?{s:null,u:null,$:[]}:null},_&&(Y.function=t,pr=t)}function Ee(r){var i;var e=Y,t=e.e;if(t!==null){e.e=null;for(var n of t)jl(n)}return r!==void 0&&(e.x=r),e.i=!0,Y=e.p,_&&(pr=(i=Y==null?void 0:Y.function)!=null?i:null),Zo(r)}function Zo(r={}){return Ye(r,ra,{value:!0}),r}function Tr(){return!Sr||Y!==null&&Y.l===null}var Mn=[];function Ff(){var r=Mn;Mn=[],ki(r)}function Ze(r){if(Mn.length===0&&!On){var e=Mn;queueMicrotask(()=>{e===Mn&&Ff()})}Mn.push(r)}function Sf(){for(;Mn.length>0;)Ff()}var Kr="font-weight: bold",qr="font-weight: normal";function Ef(r){_?console.warn(`%c[svelte] await_reactivity_loss
%cDetected reactivity loss when reading \`${r}\`. This happens when state is read in an async function after an earlier \`await\`
https://svelte.dev/e/await_reactivity_loss`,Kr,qr):console.warn("https://svelte.dev/e/await_reactivity_loss")}function Tf(r,e){_?console.warn(`%c[svelte] await_waterfall
%cAn async derived, \`${r}\` (${e}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
https://svelte.dev/e/await_waterfall`,Kr,qr):console.warn("https://svelte.dev/e/await_waterfall")}function Gf(){_?console.warn(`%c[svelte] derived_inert
%cReading a derived belonging to a now-destroyed effect may result in stale values
https://svelte.dev/e/derived_inert`,Kr,qr):console.warn("https://svelte.dev/e/derived_inert")}function Bf(r,e,t){_?console.warn(`%c[svelte] hydration_attribute_changed
%cThe \`${r}\` attribute on \`${e}\` changed its value between server and client renders. The client value, \`${t}\`, will be ignored in favour of the server value
https://svelte.dev/e/hydration_attribute_changed`,Kr,qr):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function $n(r){_?console.warn(`%c[svelte] hydration_mismatch
%c${r?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${r}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
https://svelte.dev/e/hydration_mismatch`,Kr,qr):console.warn("https://svelte.dev/e/hydration_mismatch")}function Df(){_?console.warn(`%c[svelte] lifecycle_double_unmount
%cTried to unmount a component that was not mounted
https://svelte.dev/e/lifecycle_double_unmount`,Kr,qr):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Nf(){_?console.warn("%c[svelte] select_multiple_invalid_value\n%cThe `value` property of a `<select multiple>` element should be an array, but it received a non-array value. The selection will be kept as is.\nhttps://svelte.dev/e/select_multiple_invalid_value",Kr,qr):console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function ma(r){_?console.warn(`%c[svelte] state_proxy_equality_mismatch
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${r}\` will produce unexpected results
https://svelte.dev/e/state_proxy_equality_mismatch`,Kr,qr):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function Zf(){_?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Kr,qr):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var S=!1;function Me(r){S=r}var $;function me(r){if(r===null)throw $n(),Vt;return $=r}function lt(){return me(ct($))}function Q(r){if(S){if(ct($)!==null)throw $n(),Vt;$=r}}function Gi(r=1){if(S){for(var e=r,t=$;e--;)t=ct(t);$=t}}function Gr(r=!0){for(var e=0,t=$;;){if(t.nodeType===sr){var n=t.data;if(n==="]"){if(e===0)return t;e-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(e+=1)}var i=ct(t);r&&t.remove(),t=i}}function Pn(r){if(!r||r.nodeType!==sr)throw $n(),Vt;return r.data}var Sh=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function en(r){if(typeof r!="object"||r===null||it in r||ra in r)return r;let e=Ln(r);if(e!==Ol&&e!==sf)return r;var t=new Map,n=Wt(r),i=Br(0),o=_&&fr?mr("created at"):null,s=An,a=p=>{if(An===s)return p();var f=D,m=An;Oe(null),zl(s);var b=p();return Oe(f),zl(m),b};n&&(t.set("length",Br(r.length,o)),_&&(r=Th(r)));var l="";let u=!1;function d(p){if(!u){u=!0,l=p,vt(i,`${l} version`);for(let[f,m]of t)vt(m,Hn(l,f));u=!1}}return new Proxy(r,{defineProperty(p,f,m){(!("value"in m)||m.configurable===!1||m.enumerable===!1||m.writable===!1)&&_f();var b=t.get(f);return b===void 0?a(()=>{var g=Br(m.value,o);return t.set(f,g),_&&typeof f=="string"&&vt(g,Hn(l,f)),g}):W(b,m.value,!0),!0},deleteProperty(p,f){var m=t.get(f);if(m===void 0){if(f in p){let b=a(()=>Br(he,o));t.set(f,b),Jn(i),_&&vt(b,Hn(l,f))}}else W(m,he),Jn(i);return!0},get(p,f,m){var I;if(f===it)return r;if(_&&f===na)return d;var b=t.get(f),g=f in p;if(b===void 0&&(!g||(I=Ct(p,f))!=null&&I.writable)&&(b=a(()=>{var w=en(g?p[f]:he),x=Br(w,o);return _&&vt(x,Hn(l,f)),x}),t.set(f,b)),b!==void 0){var v=y(b);return v===he?void 0:v}return Reflect.get(p,f,m)},getOwnPropertyDescriptor(p,f){var v;(v=this.has)==null||v.call(this,p,f);var m=Reflect.getOwnPropertyDescriptor(p,f),b=t.get(f);if(b!==void 0){var g=y(b);if(g===he)return;if(m&&"value"in m)m.value=g;else return{enumerable:!0,configurable:!0,value:g,writable:!0}}return m},has(p,f){var v;if(f===it)return!0;var m=t.get(f),b=m!==void 0&&m.v!==he||Reflect.has(p,f);if(m!==void 0||k!==null&&(!b||(v=Ct(p,f))!=null&&v.writable)){m===void 0&&(m=a(()=>{var I=b?en(p[f]):he,w=Br(I,o);return _&&vt(w,Hn(l,f)),w}),t.set(f,m));var g=y(m);if(g===he)return!1}return b},set(p,f,m,b){var le;var g=t.get(f),v=f in p;if(n&&f==="length")for(var I=m;I<g.v;I+=1){var w=t.get(I+"");w!==void 0?W(w,he):I in p&&(w=a(()=>Br(he,o)),t.set(I+"",w),_&&vt(w,Hn(l,I)))}if(g===void 0)(!v||(le=Ct(p,f))!=null&&le.writable)&&(g=a(()=>Br(void 0,o)),_&&vt(g,Hn(l,f)),W(g,en(m)),t.set(f,g));else{v=g.v!==he;var x=a(()=>en(m));W(g,x)}var X=Reflect.getOwnPropertyDescriptor(p,f);if(X!=null&&X.set&&X.set.call(b,m),!v){if(n&&typeof f=="string"){var K=t.get("length"),V=Number(f);Number.isInteger(V)&&V>=K.v&&W(K,V+1)}Jn(i)}return!0},ownKeys(p){y(i);var f=Reflect.ownKeys(p).filter(g=>{var v=t.get(g);return v===void 0||v.v!==he});for(var[m,b]of t)b.v!==he&&!(m in p)&&f.push(m);return f},setPrototypeOf(){Cf()}})}function Hn(r,e){var t;return typeof e=="symbol"?`${r}[Symbol(${(t=e.description)!=null?t:""})]`:Sh.test(e)?`${r}.${e}`:/^\d+$/.test(e)?`${r}[${e}]`:`${r}['${e}']`}function Bi(r){try{if(r!==null&&typeof r=="object"&&it in r)return r[it]}catch(e){}return r}function pa(r,e){return Object.is(Bi(r),Bi(e))}var Eh=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function Th(r){return new Proxy(r,{get(e,t,n){var i=Reflect.get(e,t,n);return Eh.has(t)?function(...o){Xf();var s=i.apply(this,o);return ha(),s}:i}})}function Uf(){let r=Array.prototype,e=Array.__svelte_cleanup;e&&e();let{indexOf:t,lastIndexOf:n,includes:i}=r;r.indexOf=function(o,s){let a=t.call(this,o,s);if(a===-1){for(let l=s!=null?s:0;l<this.length;l+=1)
${n}in ${((s=e.fn)==null?void 0:s.name)||"<unknown>"}`,o=e.ctx;o!==null;)i+=`
${n}in ${(a=o.function)==null?void 0:a[ar].split("/").pop()}`,o=o.p;return{message:r.message+`
${i}
`,stack:(l=r.stack)==null?void 0:l.split(`
`).filter(u=>!u.includes("svelte/src/internal")).join(`
`)}}}function Lf(r){let e=Kl.get(r);e&&(Ye(r,"message",{value:e.message}),Ye(r,"stack",{value:e.stack}))}var Bh=-7169;function de(r,e){r.f=r.f&Bh|e}function Ni(r){(r.f&512)!==0||r.deps===null?de(r,1024):de(r,4096)}function ya(r,e,t){(r.f&2048)!==0?e.add(r):(r.f&4096)!==0&&t.add(r),de(r,1024)}var Mf=!1;function Ia(){Mf||(Mf=!0,document.addEventListener("reset",r=>{Promise.resolve().then(()=>{var e;if(!r.defaultPrevented)for(let t of r.target.elements)(e=t[xn])==null||e.call(t)})},{capture:!0}))}function Lt(r){var e=D,t=k;Oe(null),Be(null);try{return r()}finally{Oe(e),Be(t)}}function _a(r,e,t,n=t){r.addEventListener(e,()=>Lt(t));let i=r[xn];i?r[xn]=()=>{i(),n(!0)}:r[xn]=()=>n(!0),Ia()}function Ca(r,e,t,n){let i=Tr()?kn:nn;var o=r.filter(m=>!m.settled),s=e.map(i);if(_&&s.forEach((m,b)=>{m.label=e[b].toString().replace("() => ","").replaceAll("$.eager(() => ","$state.eager(").replace(/\$\.get\((.+?)\)/g,(g,v)=>v)}),t.length===0&&o.length===0){n(s);return}var a=k,l=Of(),u=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(m=>m.promise)):null;function d(m){if((a.f&16384)===0){l();try{n([...s,...m])}catch(b){Tt(b,a)}Xi()}}var p=ql();if(t.length===0){u.then(()=>d([])).finally(p);return}function f(){Promise.all(t.map(m=>tc(m))).then(d).catch(m=>Tt(m,a)).finally(p)}u?u.then(()=>{if((a.f&16384)!==0){p();return}l(),f(),Xi()}):f()}function Of(){var r=k,e=D,t=Y,n=B;if(_)var i=Er;return function(s=!0){Be(r),Oe(e),zr(t),s&&(r.f&16384)===0&&(n==null||n.activate(),n==null||n.apply()),_&&(ec(null),Si(i))}}var Dh=!1;function Xi(r=!0){var e;Dh=!1,Be(null),Oe(null),zr(null),r&&((e=B)==null||e.deactivate()),_&&(ec(null),Si(null))}function ql(){var r=k,e=r.b,t=B,n=!!(e!=null&&e.is_rendered());return e==null||e.update_pending_count(1,t),t.increment(n,r),()=>{e==null||e.update_pending_count(-1,t),t.decrement(n,r)}}var Bt=null;function ec(r){Bt=r}var Yo=new Set;function kn(r){var e=2050;k!==null&&(k.f|=524288);let t={ctx:Y,deps:null,effects:null,equals:aa,f:e,fn:r,reactions:null,rv:0,v:he,wv:0,parent:k,ac:null};return _&&fr&&(t.created=mr("created at")),t}var Ui=Symbol("obsolete");function tc(r,e,t){let n=k;n===null&&uf();var i=void 0,o=It(he);_&&(o.label=e!=null?e:r.toString());var s=!D,a=new Set;return Hf(()=>{var m,b;var l=k;_&&(Bt={effect:l,effect_deps:new Set,warned:!1});var u=sa();i=u.promise;try{Promise.resolve(r()).then(u.resolve,g=>{g!==Jr&&u.reject(g)}).finally(Xi)}catch(g){u.reject(g),Xi()}if(_){if(Bt){if(l.deps!==null)for(let g=0;g<xt;g+=1)Bt.effect_deps.add(l.deps[g]);if(et!==null)for(let g=0;g<et.length;g+=1)Bt.effect_deps.add(et[g])}Bt=null}var d=B;if(s){if((l.f&32768)!==0)var p=ql();if((m=n.b)!=null&&m.is_rendered())(b=d.async_deriveds.get(l))==null||b.reject(Ui);else for(let g of a.values())g.reject(Ui);a.add(u),d.async_deriveds.set(l,u)}let f=(g,v=void 0)=>{_&&(Bt=null),p==null||p(),a.delete(u),v!==Ui&&(d.activate(),v?(o.f|=8388608,br(o,v)):((o.f&8388608)!==0&&(o.f^=8388608),_&&t!==void 0&&!o.equals(g)&&(Yo.add(o),setTimeout(()=>{Yo.has(o)&&(l.f&16384)===0&&(Tf(o.label,t),Yo.delete(o))})),br(o,g)),d.deactivate())};u.promise.then(f,g=>f(null,g||"unknown"))}),Pe(()=>{for(let l of a)l.reject(Ui)}),_&&(o.f|=4194304),new Promise(l=>{function u(d){function p(){d===i?l(o):u(i)}d.then(p,p)}u(i)})}function nn(r){let e=kn(r);return e.equals=la,e}function $f(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)we(e[t])}}var rc=[];function Lo(r){var e,t=k,n=r.parent;if(!Ot&&n!==null&&r.v!==he&&(n.f&24576)!==0)return Gf(),r.v;if(Be(n),_){let i=jn;xa(new Set);try{jr.call(rc,r)&&df(),rc.push(r),$f(r),e=wa(r)}finally{Be(t),xa(i),rc.pop()}}else try{$f(r),e=wa(r)}finally{Be(t)}return e}function nc(r){var t,n,i;var e=Lo(r);if(!r.equals(e)&&(r.wv=Qi(),(!((t=B)!=null&&t.is_fork)||r.deps===null)&&(B!==null?(B.capture(r,e,!0),(n=Mt)==null||n.capture(r,e,!0)):r.v=e,r.deps===null))){de(r,1024);return}Ot||(Ue!==null?(wn()||(i=B)!=null&&i.is_fork)&&Ue.set(r,e):Ni(r))}function Pf(r){var e;if(r.effects!==null)for(let t of r.effects)(t.teardown||t.ac)&&((e=t.teardown)==null||e.call(t),t.ac!==null&&Lt(()=>{t.ac.abort(Jr),t.ac=null}),
`).some(l=>l.startsWith("https://svelte.dev/e/")))throw a;return a!==Vt&&console.warn("Failed to hydrate: ",a),e.recover===!1&&bf(),ga(),Wo(t),Me(!1),Ba(r,e)}finally{Me(n),me(i)}}var Ga=new Map;function Sm(r,{target:e,anchor:t,props:n={},events:i,context:o,intro:s=!0,transformError:a}){ga();var l=void 0,u=hm(()=>{var d=t!=null?t:e.appendChild(Xe());Bc(d,{pending:()=>{}},m=>{Se({});var b=Y;if(o&&(b.c=o),i&&(n.$$events=i),S&&fn(m,null),Dc=s,l=r(m,n)||Zo(),Dc=!0,S&&(k.nodes.end=$,$===null||$.nodeType!==sr||$.data!=="]"))throw $n(),Vt;Ee()},a);var p=new Set,f=m=>{for(var b=0;b<m.length;b++){var g=m[b];if(!p.has(g)){p.add(g);var v=xm(g);for(let x of[e,document]){var I=Ga.get(x);I===void 0&&(I=new Map,Ga.set(x,I));var w=I.get(g);w===void 0?(x.addEventListener(g,Sa,{passive:v}),I.set(g,1)):I.set(g,w+1)}}}};return f(Ri(ym)),wc.add(f),()=>{var v;for(var m of p)for(let I of[e,document]){var b=Ga.get(I),g=b.get(m);--g==0?(I.removeEventListener(m,Sa),b.delete(m),b.size===0&&Ga.delete(I)):b.set(m,g)}wc.delete(f),d!==t&&((v=d.parentNode)==null||v.removeChild(d))}});return Nc.set(l,u),l}var Nc=new WeakMap;function Xc(r,e){let t=Nc.get(r);return t?(Nc.delete(r),t(e)):(_&&Df(),Promise.resolve())}function Da(r){return function(...e){var t=e[0];return t.stopPropagation(),r==null?void 0:r.apply(this,e)}}function Na(r){return function(...e){var t=e[0];return t.preventDefault(),r==null?void 0:r.apply(this,e)}}function We(r){return new Uc(r)}var mn,dr,Uc=class{constructor(e){L(this,mn);L(this,dr);var o,s;var t=new Map,n=(a,l)=>{var u=ue(l,!1,!1);return t.set(a,u),u};let i=new Proxy({...e.props||{},$$events:{}},{get(a,l){var u;return y((u=t.get(l))!=null?u:n(l,Reflect.get(a,l)))},has(a,l){var u;return l===Go?!0:(y((u=t.get(l))!=null?u:n(l,Reflect.get(a,l))),Reflect.has(a,l))},set(a,l,u){var d;return W((d=t.get(l))!=null?d:n(l,u),u),Reflect.set(a,l,u)}});Z(this,dr,(e.hydrate?Zc:Ba)(e.component,{target:e.target,anchor:e.anchor,props:i,context:e.context,intro:(o=e.intro)!=null?o:!1,recover:e.recover,transformError:e.transformError})),!Le&&(!((s=e==null?void 0:e.props)!=null&&s.$$host)||e.sync===!1)&&N(),Z(this,mn,i.$$events);for(let a of Object.keys(h(this,dr)))a==="$set"||a==="$destroy"||a==="$on"||Ye(this,a,{get(){return h(this,dr)[a]},set(l){h(this,dr)[a]=l},enumerable:!0});h(this,dr).$set=a=>{Object.assign(i,a)},h(this,dr).$destroy=()=>{Xc(h(this,dr))}}$set(e){h(this,dr).$set(e)}$on(e,t){h(this,mn)[e]=h(this,mn)[e]||[];let n=(...i)=>t.call(this,...i);return h(this,mn)[e].push(n),()=>{h(this,mn)[e]=h(this,mn)[e].filter(i=>i!==n)}}$destroy(){h(this,dr).$destroy()}};mn=new WeakMap,dr=new WeakMap;var Em,Tm,Gm;typeof window!="undefined"&&((Gm=(Tm=(Em=window.__svelte)!=null?Em:window.__svelte={}).v)!=null?Gm:Tm.v=new Set).add("5");Af();var _r,Ur,er,ni,ns,is,Za,pn=class{constructor(e,t=!0){c(this,"anchor");L(this,_r,new Map);L(this,Ur,new Map);L(this,er,new Map);L(this,ni,new Set);L(this,ns,!0);L(this,is,e=>{if(h(this,_r).has(e)){var t=h(this,_r).get(e),n=h(this,Ur).get(t);if(n)ji(n),h(this,ni).delete(t);else{var i=h(this,er).get(t);i&&(ji(i.effect),h(this,Ur).set(t,i.effect),h(this,er).delete(t),_&&(i.fragment.lastChild[Yl]=this.anchor),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(let[o,s]of h(this,_r)){if(h(this,_r).delete(o),o===e)break;let a=h(this,er).get(s);a&&(we(a.effect),h(this,er).delete(s))}for(let[o,s]of h(this,Ur)){if(o===t||h(this,ni).has(o))continue;let a=()=>{if(Array.from(h(this,_r).values()).includes(o)){var u=document.createDocumentFragment();zi(s,u),u.append(Xe()),h(this,er).set(o,{effect:s,fragment:u})}else we(s);h(this,ni).delete(o),h(this,Ur).delete(o)};h(this,ns)||!n?(h(this,ni).add(o),Nr(s,a,!1)):a()}}});L(this,Za,e=>{h(this,_r).delete(e);let t=Array.from(h(this,_r).values());for(let[n,i]of h(this,er))t.includes(n)||(we(i.effect),h(this,er).delete(n))});this.anchor=e,Z(this,ns,t)}ensure(e,t){var n=B,i=ba();if(t&&!h(this,Ur).has(e)&&!h(this,er).has(e))if(i){var o=document.createDocumentFragment(),s=Xe();o.append(s),h(this,er).set(e,{effect:Je(()=>t(s)),fragment:o})}else h(this,Ur).set(e,Je(()=>
\r\f\xA0\v\uFEFF`];function Qm(r,e,t){var n=r==null?"":""+r;if(e&&(n=n?n+" "+e:e),t){for(var i of Object.keys(t))if(t[i])n=n?n+" "+i:i;else if(n.length)for(var o=i.length,s=0;(s=n.indexOf(i,s))>=0;){var a=s+o;(s===0||Um.includes(n[s-1]))&&(a===n.length||Um.includes(n[a]))?n=(s===0?"":n.substring(0,s))+n.substring(a+1):s=a}}return n===""?null:n}function Vr(r,e,t,n,i,o){var s=r[Bo];if(S||s!==t||s===void 0){var a=Qm(t,n,o);(!S||a!==r.getAttribute("class"))&&(a==null?r.removeAttribute("class"):e?r.className=a:r.setAttribute("class",a)),r[Bo]=t}else if(o&&i!==o)for(var l in o){var u=!!o[l];(i==null||u!==!!i[l])&&r.classList.toggle(l,u)}return o}function as(r,e){e?r.hasAttribute("selected")||r.setAttribute("selected",""):r.removeAttribute("selected")}function yg(r,e){var t=r.__defaultValue,n=r.multiple,i=n?t!=null?t:[]:null;if(!(n&&!Wt(i))){var o=r.selectedIndex,s=e&&n?new Set(r.selectedOptions):null;for(var a of r.options){var l=to(a);as(a,n?i.includes(l):pa(l,t))}if(e)if(s!==null)for(a of r.options){var u=s.has(a);a.selected!==u&&(a.selected=u)}else r.selectedIndex!==o&&(r.selectedIndex=o)}}function Xa(r,e,t=!1){if(r.multiple){if(e==null)return;if(!Wt(e))return Nf();for(var n of r.options)n.selected=e.includes(to(n));return}for(n of r.options){var i=to(n);if(pa(i,e)){n.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function ro(r){var e=new MutationObserver(t=>{t.every(Ig)||("__defaultValue"in r&&yg(r,!1),"__value"in r&&Xa(r,r.__value))});e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Pe(()=>{e.disconnect()})}function ls(r,e,t=e){var n=new WeakSet,i=!0;_a(r,"change",o=>{var u;var s=o?"[selected]":":checked",a;if(r.multiple)a=[].map.call(r.querySelectorAll(s),to);else{var l=(u=r.querySelector(s))!=null?u:r.querySelector("option:not([disabled])");a=l&&to(l)}t(a),r.__value=a,B!==null&&n.add(B)}),Jt(()=>{var o=e();if(r===document.activeElement){var s=Le?Mt:B;if(n.has(s))return}if(Xa(r,o,i),i&&o===void 0){var a=r.querySelector(":checked");a!==null&&(o=to(a),t(o))}r.__value=o,i=!1})}function to(r){return"__value"in r?r.__value:r.value}function Ig(r){if(r.target.closest("selectedcontent")!==null)return!0;if(r.type==="childList"){var e=[...r.addedNodes,...r.removedNodes];return e.length>0&&e.every(t=>t.nodeName==="SELECTEDCONTENT")}return!1}var kg=Symbol("is custom element"),Fg=Symbol("is html"),Sg=Ll?"link":"LINK";function Lc(r){if(S){var e=!1,t=()=>{if(!e){if(e=!0,r.hasAttribute("value")){var n=r.value;Cr(r,"value",null),r.value=n}if(r.hasAttribute("checked")){var i=r.checked;Cr(r,"checked",null),r.checked=i}}};r[xn]=t,Ze(t),Ia()}}function Cr(r,e,t,n){var i=Eg(r);if(S&&(i[e]=r.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&r.nodeName===Sg)){n||Gg(r,e,t!=null?t:"");return}i[e]!==(i[e]=t)&&(e==="loading"&&(r[ef]=t),t==null?r.removeAttribute(e):typeof t!="string"&&Tg(r).has(e)?r[e]=t:r.setAttribute(e,t))}function Eg(r){var e,t;return(t=r[e=ia])!=null?t:r[e]={[kg]:r.nodeName.includes("-"),[Fg]:r.namespaceURI===ca}}var Wm=new Map;function Tg(r){var e=r.getAttribute("is")||r.nodeName,t=Wm.get(e);if(t)return t;Wm.set(e,t=new Set);for(var n,i=r,o=Element.prototype;o!==i;){n=oa(i);for(var s in n)n[s].set&&s!=="innerHTML"&&s!=="textContent"&&s!=="innerText"&&t.add(s);i=Ln(i)}return t}function Gg(r,e,t){var n;_&&(e==="srcset"&&Bg(r,t)||Yc((n=r.getAttribute(e))!=null?n:"",t)||Bf(e,r.outerHTML.replace(r.innerHTML,r.innerHTML&&"..."),String(t)))}function Yc(r,e){return r===e?!0:new URL(r,document.baseURI).href===new URL(e,document.baseURI).href}function Vm(r){return r.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function Bg(r,e){var t=Vm(r.srcset),n=Vm(e);return n.length===t.length&&n.every(([i,o],s)=>o===t[s][1]&&(Yc(t[s][0],i)||Yc(i,t[s][0])))}function $c(r,e,t=e){var n=new WeakSet;_a(r,"input",async i=>{_&&r.type==="checkbox"&&Hl();var o=i?r.defaultValue:r.value;if(o=Mc(r)?Oc(o):o,t(o),B!==null&&n.add(B),await dn(),o!==(o=e())){var s=r.selectionStart,a=r.selectionEnd,l=r.value.length;if(r.value=o!=null?o:"",a!==null){var u=r.value.length;s===a&&a===l&&u>l?(r.selectionStart=u,r.selec
${e}
`;return this._current.weeks.forEach(n=>{let i=" ";n.days.forEach(o=>{let s;o.date&&this._current.isThisMonth(o.date)?s=o.date.format("DD"):s=" ",i=i+s+" "}),t=t+i+`
`}),t}get current(){return this._current}};var oo=class{constructor(){c(this,"digits",[]);c(this,"lastInput",0)}handle(e){let t=new Date().getTime();return t-this.lastInput>1e3&&this.clear(),this.lastInput=t,this.digits.push(e),this.digits.join("")}clear(){this.digits=[]}};var zg=ne('<th class="svelte-1lru178"> </th>'),Kg=ne('<td><button tabindex="-1"> </button></td>'),qg=ne("<tr></tr>"),eb=ne('<div class="reminder-calendar svelte-1lru178" tabindex="0" role="grid"><div class="year-month svelte-1lru178"><button tabindex="-1" class="month-nav svelte-1lru178">&lt;</button> <span class="month svelte-1lru178"> </span> <span class="year svelte-1lru178"> </span> <button tabindex="-1" class="month-nav svelte-1lru178">&gt;</button></div> <table><thead><tr></tr></thead><tbody></tbody></table> <div class="footer"><!></div></div>');function Oa(r,e){if(new.target)return We({component:Oa,...r});Se(e,!1);let t=ue(),n=ue(),i=M(e,"value",28,P),o=M(e,"weekStart",12,0),s=eo(),a=ue(),l=ue(),u=ue();function d(){y(u).focus()}function p(T){i(T)}function f(T){i(T),g()}function m(){i(i().add(-1,"month"))}function b(){i(i().add(1,"month"))}function g(){s("select",i())}let v=new oo;function I(T){if(T.key>="0"&&T.key<="9"){T.preventDefault();let ce=v.handle(T.key);switch(ce.length){case 1:{let R=parseInt(ce);R>0&&i(i().set("date",R));break}case 2:ce.startsWith("0")&&(ce=ce.slice(1)),i(i().set("date",parseInt(ce)));break;case 4:{let R=ce.slice(0,2),ie=ce.slice(2,4);R.startsWith("0")&&(R=R.slice(1)),ie.startsWith("0")&&(ie=ie.slice(1)),i(i().set("month",parseInt(R)-1)),i(i().set("date",parseInt(ie)))}break}return}v.clear(),T.key==="ArrowLeft"||T.ctrlKey&&T.key==="B"?(i(i().add(-1,"day")),T.preventDefault()):T.key==="ArrowRight"||T.ctrlKey&&T.key==="F"?(i(i().add(1,"day")),T.preventDefault()):T.key==="ArrowUp"||T.ctrlKey&&T.key==="P"?i(i().add(-7,"day")):T.key==="ArrowDown"||T.ctrlKey&&T.key==="N"?(i(i().add(7,"day")),T.preventDefault()):T.key==="Enter"&&(g(),T.preventDefault())}qi(()=>{gc(l,y(l).style.width=y(a).clientWidth+"px")}),Sn(()=>(cs,P,Qe(i()),Qe(o())),()=>{W(t,new cs(P().startOf("day"),i().startOf("day"),o()))}),Sn(()=>(P,y(t)),()=>{W(n,Array.from({length:7},(T,ce)=>P().day((y(t).weekStart+ce)%7).format("ddd")))}),Ko();var w={focus:d,get value(){return i()},set value(T){i(T),N()},get weekStart(){return o()},set weekStart(T){o(T),N()},$set:ze,$on:(T,ce)=>je(e,T,ce)};dt();var x=eb(),X=H(x),K=H(X),V=se(K,2),le=Te(V,!0),De=se(V,2),ye=Te(De,!0),Ke=se(De,2);Q(X);var Ie=se(X,2),Zt=H(Ie),ke=H(Zt);Rt(ke,5,()=>y(n),T=>T,(T,ce)=>{var R=zg(),ie=Te(R,!0);Ae(()=>Re(ie,y(ce))),J(T,R)}),Q(ke),Q(Zt);var ft=se(Zt);Rt(ft,5,()=>(y(t),E(()=>y(t).current.weeks)),T=>T.key,(T,ce)=>{var R=qg();Rt(R,5,()=>(y(ce),E(()=>y(ce).days)),ie=>ie.date.valueOf(),(ie,Ce)=>{var C=Kg(),oe=H(C);let mt;var qe=Te(oe,!0);Q(C),Ae((kt,Ve,Nn,Ft,gn)=>{mt=Vr(oe,1,"calendar-date svelte-1lru178",null,mt,{"is-selected":kt,"other-month":Ve,"is-holiday":Nn,"is-past":Ft}),Re(qe,gn)},[()=>y(Ce).isToday(i()),()=>!y(t).current.isThisMonth(y(Ce).date),()=>y(Ce).isHoliday(),()=>y(Ce).date.isBefore(y(t).today),()=>(y(Ce),E(()=>y(Ce).date.format("D")))]),z("click",oe,()=>p(y(Ce).date)),z("dblclick",oe,()=>f(y(Ce).date)),J(ie,C)}),Q(R),J(T,R)}),Q(ft),Q(Ie),tt(Ie,T=>W(a,T),()=>y(a));var Xt=se(Ie,2),rr=H(Xt);return Vc(rr,e,"footer",{},null),Q(Xt),tt(Xt,T=>W(l,T),()=>y(l)),Q(x),tt(x,T=>W(u,T),()=>y(u)),Ae((T,ce)=>{Re(le,T),Re(ye,ce)},[()=>(y(t),E(()=>y(t).current.monthStart.format("MMM"))),()=>(y(t),E(()=>y(t).current.monthStart.format("YYYY")))]),z("click",K,()=>m()),z("click",Ke,()=>b()),z("focus",x,()=>{s("focus")}),z("blur",x,()=>{s("blur")}),z("keydown",x,I),J(r,x),Pc(e,"focus",d),Ee(w)}var tb=ne("<option> </option>"),rb=ne('<select class="time-picker svelte-16e079f"></select>');function $a(r,e){if(new.target)return We({component:$a,...r});Se(e,!1);let t=M(e,"value",12,"00:00"),n=M(e,"step",12,15),i=eo();function o(){i("select",t())}function s(){i("focus")}function a(){i("blur")}function l(){let b=[];for(let g=0;g<1440;g+=n()){let v=Math.floor(g/60),I=g%60;b.push(`${v.toString().padStart(2,"0")}:${
`);if(!i.match(/^\s*- \[.\]\s.*/))return!1;if(i.endsWith(n))return!0}return!1}show(e,t,n){let i;if($m.Platform.isDesktopApp){let o=t.cm;if(o==null)console.error("Cannot get CodeMirror 6 editor view."),i=oi(e,n,this.timeStep.value,Number(this.weekStart.value));else{let s=o.state.selection.main.head;i=new ao(o,n,this.timeStep.value,Number(this.weekStart.value)).show(s)}}else i=oi(e,n,this.timeStep.value,Number(this.weekStart.value));i.then(o=>{this.insert(t,o,!0)}).catch(()=>{})}insert(e,t,n=!1){var l;let i=e.getCursor(),o=e.getLine(i.line),s={line:i.line,ch:o.length};n||(o=o.substring(0,i.ch-this.trigger.value.length));let a=this.primaryFormat.value.format;try{let u=(l=As(a,o,t,void 0,this.convertNonTaskLines.value,ws(e.cm)))==null?void 0:l.insertedLine;if(u==null){xs(),console.error("Cannot append reminder time to the line: line=%s, date=%s",o,t);return}e.replaceRange(u,{line:i.line,ch:0},s)}catch(u){console.error(u)}}};var Pm=require("@codemirror/state"),Hm=require("@codemirror/view"),Jm=require("obsidian");function jm(r,e,t){return Hm.ViewPlugin.fromClass(class{constructor(){c(this,"activePopup");c(this,"destroyed",!1)}update(n){n.docChanged&&n.changes.iterChanges((i,o,s,a,l)=>{let u=n.state.doc,d=u.sliceString(a-2,a);if(l.length===0)return;let p=t.autoCompleteTrigger.value,f=t.reminderTimeStep.value,m=Number(t.weekStart.value);if(p===d){let b;Jm.Platform.isDesktopApp?b=new Promise((g,v)=>{n.view.dom.win.setTimeout(()=>{var w;if(this.destroyed){v(new Error("editor view was destroyed"));return}(w=this.activePopup)==null||w.cancel();let I=new ao(n.view,e,f,m);this.activePopup=I,I.show(a).finally(()=>{this.activePopup===I&&(this.activePopup=void 0)}).then(g,v)},0)}):b=oi(r,e,f,m),b.then(g=>{let v=t.primaryFormat.value.format;try{let I=u.lineAt(a),w=I.text.lastIndexOf(p),x=w+p.length;p.startsWith("(")&&I.text.charAt(x)===")"&&x++;let X=I.text.substring(0,w)+I.text.substring(x),K=As(v,X,g,w,t.convertNonTaskLines.value,ws(n.view));if(K==null){xs(),console.error("Cannot append reminder time to the line: line=%s, date=%s",I.text,g);return}let V=n.view.state.update({changes:{from:I.from,to:I.to,insert:K.insertedLine},selection:Pm.EditorSelection.cursor(I.from+K.caretPosition)});n.view.update([V])}catch(I){console.error(I)}}).catch(()=>{})}})}destroy(){var n;this.destroyed=!0,(n=this.activePopup)==null||n.cancel()}})}var lo=require("@codemirror/state"),co=require("@codemirror/view"),za=require("obsidian");function zm(r,e,t){return Math.min(Math.max(r,e),t)}function Km(r,e){let t=[];for(let{reminder:o,columnStart:s,columnEnd:a}of e){let l=o.rowNumber+1;if(l<1||l>r.lines)continue;let u=r.line(l),d=zm(u.from+s,u.from,u.to),p=zm(u.from+a,d,u.to);d>=p||t.push({from:d,to:p,reminder:o,text:r.sliceString(d,p)})}t.sort((o,s)=>o.from-s.from);let n=[],i=-1;for(let o of t)o.from<i||(n.push(o),i=o.to);return n}var qm=require("@codemirror/state"),us=qm.StateEffect.define();var tp=require("@codemirror/view"),rp=require("obsidian");var lb=ne('<span class="reminder-pill svelte-1r4kx8j" role="button" tabindex="0"> </span>');function Ja(r,e){if(new.target)return We({component:Ja,...r});Se(e,!1);let t=M(e,"label",12),n=M(e,"title",12),i=eo();function o(d){d.preventDefault(),d.stopPropagation(),i("activate")}function s(d){(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),d.stopPropagation(),i("activate"))}var a={get label(){return t()},set label(d){t(d),N()},get title(){return n()},set title(d){n(d),N()},$set:ze,$on:(d,p)=>je(e,d,p)};dt();var l=lb(),u=Te(l,!0);return Ae(()=>{Cr(l,"title",n()),Re(u,t())}),z("click",l,o),z("keydown",l,s),z("mousedown",l,Na(Da(function(d){Jc.call(this,e,d)}))),J(r,l),Ee(a)}var ja=class extends tp.WidgetType{constructor(t,n){super();c(this,"span",t);c(this,"plugin",n);c(this,"component")}eq(t){return this.span.text===t.span.text&&this.span.reminder.title===t.span.reminder.title}toDOM(t){let n=createSpan();return this.component=new Ja({target:n,props:{label:`\u23F0 ${this.span.reminder.time.toString()}`,title:`Reminder: ${this.span.reminder.title}`}}),this.component.$on("activate",()=>{this.activate(t,n)}),n}destroy()
`)[a])!=null?d:"",u=r.state.doc.line(a+1);r.dispatch({changes:{from:u.from,to:u.to,insert:l},effects:[us.of()]})}var ub=300,np=lo.Annotation.define();function nu(r,e){var t,n,i,o;try{if(!r.settings.editorReminderDisplay.value)return[];if(!((t=e.field(za.editorLivePreviewField,!1))!=null&&t))return[];let s=(o=(i=(n=e.field(za.editorInfoField,!1))==null?void 0:n.file)==null?void 0:i.path)!=null?o:"",a=new Lr(s,e.doc.toString());return Km(e.doc,xi(a))}catch(s){return console.error("Failed to parse reminders for editor pills.",s),[]}}function ru(r,e,t){let n=r.selection.main.head,i=new lo.RangeSetBuilder;for(let o of e)n>=o.from&&n<=o.to||i.add(o.from,o.to,co.Decoration.replace({widget:new ja(o,t)}));return i.finish()}function db(r,e){let t=[];for(let n of r){let i=e.mapPos(n.from),o=e.mapPos(n.to,1);i<o&&t.push({...n,from:i,to:o})}return t}function fb(r){return lo.StateField.define({create(e){let t=nu(r,e);return{decos:ru(e,t,r),cache:t}},update(e,t){let n=e.decos.map(t.changes),i=t.docChanged?db(e.cache,t.changes):e.cache,o=t.annotation(np);o!==void 0&&(i=o);let s=t.docChanged&&i.some(d=>t.changes.touchesRange(d.from,d.to)),a=t.effects.some(d=>d.is(us));if(s||t.reconfigured||a&&o===void 0)return i=nu(r,t.state),n=ru(t.state,i,r),{decos:n,cache:i};let u=!t.startState.selection.eq(t.state.selection);return(o!==void 0||u)&&(n=ru(t.state,i,r)),{decos:n,cache:i}},provide:e=>co.EditorView.decorations.from(e,t=>t.decos)})}function mb(r){return co.ViewPlugin.fromClass(class{constructor(e){c(this,"view",e);c(this,"debounceTimer")}update(e){e.docChanged&&(this.debounceTimer!==void 0&&window.clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{this.debounceTimer=void 0;let t=nu(r,this.view.state);this.view.dispatch({annotations:np.of(t),effects:[us.of()]})},ub))}destroy(){this.debounceTimer!==void 0&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=void 0)}})}function iu(r){return[fb(r),mb(r)]}var Ka=require("@codemirror/state"),Dn=require("@codemirror/view"),ou=Ka.StateEffect.define();function pb(r){return r.from>=r.to?Dn.Decoration.none:Dn.Decoration.set([Dn.Decoration.mark({attributes:{style:"background-color: var(--text-highlight-bg);"}}).range(r.from,r.to)])}var hb=Ka.StateField.define({create(){return Dn.Decoration.none},update(r,e){let t=e.effects.find(n=>n.is(ou));return t!==void 0?pb(t.value):e.docChanged||!e.startState.selection.eq(e.state.selection)?Dn.Decoration.none:r.map(e.changes)},provide:r=>Dn.EditorView.decorations.from(r)});function ip(){return hb}var sp=require("obsidian");var op=require("obsidian");var gb=ne('<div class="icon-text svelte-1qeb5yo"><span class="icon svelte-1qeb5yo"></span> <span class="text svelte-1qeb5yo"> </span></div>');function uo(r,e){if(new.target)return We({component:uo,...r});Se(e,!1);let t=M(e,"icon",12,""),n=M(e,"text",12,""),i=ue();qi(()=>{(0,op.setIcon)(y(i),t())});var o={get icon(){return t()},set icon(d){t(d),N()},get text(){return n()},set text(d){n(d),N()},$set:ze,$on:(d,p)=>je(e,d,p)};dt();var s=gb(),a=H(s);tt(a,d=>W(i,d),()=>y(i));var l=se(a,2),u=Te(l,!0);return Q(s),Ae(()=>Re(u,n())),J(r,s),Ee(o)}var bb=ne('<button class="reminder-toast-close svelte-1u4loek" aria-label="Close">\xD7</button>'),vb=ne("<option> </option>"),yb=ne('<div class="reminder-secondary-actions svelte-1u4loek"><button class="reminder-footer-action svelte-1u4loek" title="Pause all notifications for a chosen duration. Reminders are not muted: anything still overdue notifies you again after the pause ends.">Pause all notifications\u2026</button> <button class="reminder-footer-action svelte-1u4loek" title="Mute every currently overdue reminder. Muted reminders stay silent (even across restarts) until you snooze them or change their date.">Mute all reminders\u2026</button></div>'),Ib=ne('<main tabindex="-1"><!> <h3 class="reminder-title svelte-1u4loek"><!></h3> <button class="reminder-file svelte-1u4loek" title="Alt+O / Ctrl+O" aria-keyshortcuts="Alt+O Control+O"><!></button> <div class="reminder-actions svelte-1u4loek"><button class="mod-cta svelte-1u4loek" title="Alt+D / Ctrl+D"
`)}},al=class{unmarshal(e){return e.split(`
`).map(t=>t.trim()).filter(t=>t.length>0)}marshal(e){return e.join(`
`)}},ll=class{unmarshal(e){let t=wi.find(n=>n.name===e);return t!==void 0?t:(console.warn(`Unknown reminder format: ${e}. Falling back to the default format.`),wi[0])}marshal(e){return e.name}};var tr="re-scan",cl=class{constructor(){c(this,"settings",new il);c(this,"reminderTime");c(this,"reminderTimeStep");c(this,"enableNotification");c(this,"reNotifyMutedOnStartup");c(this,"notificationPopupStyle");c(this,"openNoteOnReminderClick");c(this,"useSystemNotification");c(this,"showPopupWithSystemNotification");c(this,"keepSystemNotificationOnScreen");c(this,"focusDoneButtonOnPopup");c(this,"laters");c(this,"weekStart");c(this,"dateFormat");c(this,"dateTimeFormat");c(this,"strictDateFormat");c(this,"autoCompleteTrigger");c(this,"convertNonTaskLines");c(this,"editorReminderDisplay");c(this,"primaryFormat");c(this,"excludedPaths");c(this,"useCustomEmojiForTasksPlugin");c(this,"useReminderTimeFallbackForTasksPlugin");c(this,"removeTagsForTasksPlugin");c(this,"dataviewReminderFieldName");c(this,"linkDatesToDailyNotes");c(this,"yearMonthDisplayFormat");c(this,"monthDayDisplayFormat");c(this,"timeDisplayFormat");c(this,"shortDateWithWeekdayDisplayFormat");c(this,"editDetectionSec");c(this,"reminderCheckIntervalSec");c(this,"showOverdueCountInStatusBar");c(this,"ntfyEnabled");c(this,"ntfyServerUrl");c(this,"ntfyTopic");c(this,"ntfyAccessToken");let e=new yu(this.settings);this.reminderTime=this.settings.newSettingBuilder().key("reminderTime").name("Reminder time").desc("Time when a reminder with no time part will show").tag(tr).text("09:00").placeHolder("Time (hh:mm)").build(new ol),this.reminderTimeStep=this.settings.newSettingBuilder().key("reminderTimeStep").name("Reminder time step (minutes)").desc("Step of time for reminder time (minutes)").number(15).build(new te),this.enableNotification=this.settings.newSettingBuilder().key("enableNotification").name("Enable reminder notifications").desc("If disabled, reminder popups and system notifications are not shown. The reminder list view keeps working.").toggle(!0).build(new te),this.reNotifyMutedOnStartup=this.settings.newSettingBuilder().key("reNotifyMutedOnStartup").name("Re-notify muted reminders on startup").desc('When enabled, reminders you previously muted are notified again the next time Obsidian starts. Useful if you rely on startup notifications to review overdue reminders. If many reminders are overdue, they are shown one after another \u2014 use the "Mute all current notifications" command to silence them again.').toggle(!1).build(new te),this.notificationPopupStyle=this.settings.newSettingBuilder().key("notificationPopupStyle").name("Reminder popup style").desc("Toast: a card in the corner of the window that does not interrupt your work. Modal: a dialog in the center of the window that takes focus.").dropdown("toast").addOption("Toast (corner card)","toast").addOption("Modal (center dialog)","modal").build(new te),this.openNoteOnReminderClick=this.settings.newSettingBuilder().key("openNoteOnReminderClick").name("Open note on reminder click").desc("When clicking a reminder in the reminder list or a system notification, open the note directly instead of showing the reminder popup.").toggle(!1).build(new te),this.useSystemNotification=this.settings.newSettingBuilder().key("useSystemNotification").name("Use system notification").desc("Use system notification for reminder notifications").toggle(!1).build(new te),this.showPopupWithSystemNotification=this.settings.newSettingBuilder().key("showPopupWithSystemNotification").name("Show popup together with system notification").desc("When using system notification, also show the built-in reminder popup at the same time. The popup handles the reminder actions; the system notification acts as an alert only.").toggle(!1).onAnyValueChanged(o=>{o.setEnabled(this.useSystemNotification.value)}).build(new te),this.keepSystemNotificationOnScreen=this.settings.newSettingBuilder().key("keepSystemNotificationOnScreen").name("Keep system notification on screen").desc("Keep the system notification on screen until you interact with it, instead o
In 1 hour
In 3 hours
Tomorrow
Next week`).placeHolder(`In 30 minutes
In 1 hour
In 3 hours
Tomorrow
Next week`).build(new sl);let t=this.settings.newSettingBuilder().key("weekStart").name("Week start").desc("Select the first day of the week").dropdown("0");Array.from({length:7},(o,s)=>{let a=P().day(s).format("dddd");t.addOption(a,s.toString())}),this.weekStart=t.build(new te),this.dateFormat=this.settings.newSettingBuilder().key("dateFormat").name("Date format").desc("moment style date format: https://momentjs.com/docs/#/displaying/format/").tag(tr).text("YYYY-MM-DD").placeHolder("YYYY-MM-DD").onAnyValueChanged(o=>{o.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new te),this.strictDateFormat=this.settings.newSettingBuilder().key("strictDateFormat").name("Strict date format").desc("Strictly parse the date and time").tag(tr).toggle(!1).onAnyValueChanged(o=>{o.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new te),this.dateTimeFormat=this.settings.newSettingBuilder().key("dateTimeFormat").name("Date and time format").desc("moment() style date time format: https://momentjs.com/docs/#/displaying/format/").tag(tr).text("YYYY-MM-DD HH:mm").placeHolder("YYYY-MM-DD HH:mm").onAnyValueChanged(o=>{o.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new te),this.linkDatesToDailyNotes=this.settings.newSettingBuilder().key("linkDatesToDailyNotes").name("Link dates to daily notes").desc("When toggled, Dates link to daily notes.").tag(tr).toggle(!1).onAnyValueChanged(o=>{o.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new te),this.autoCompleteTrigger=this.settings.newSettingBuilder().key("autoCompleteTrigger").name("Calendar popup trigger").desc("Trigger text to show calendar popup").text("(@").placeHolder("(@").onAnyValueChanged(o=>{let s=this.autoCompleteTrigger.value;o.setInfo(`Popup is ${s.length===0?"disabled":"enabled"}`)}).build(new te),this.convertNonTaskLines=this.settings.newSettingBuilder().key("convertNonTaskLines").name("Convert non-task lines when inserting a reminder").desc('When inserting a reminder from the calendar popup on a line that is not a task, convert the line into a task list item ("- [ ] ") automatically. When disabled, a notice is shown instead.').toggle(!0).build(new te),this.editorReminderDisplay=this.settings.newSettingBuilder().key("editorReminderDisplay").name("Show reminder pills in editor").desc("Render each reminder's time as a clickable pill (\u23F0) in Live Preview. Clicking a pill opens the date/time chooser to change it. Disable to show the raw reminder text instead.").toggle(!0).build(new te);let n=this.settings.newSettingBuilder().key("primaryReminderFormat").name("Primary reminder format").desc("Reminder format for generated reminder by calendar popup").dropdown(wi[0].name);wi.forEach(o=>n.addOption(`${o.description} - ${o.example}`,o.name)),this.primaryFormat=n.build(new ll),this.excludedPaths=this.settings.newSettingBuilder().key("excludedPaths").name("Excluded files/folders").desc("Reminders in these files/folders are ignored. One vault-relative path per line (e.g. Templates or Archive/2020).").tag(tr).textArea("").placeHolder(`Templates
Archive/2020`).build(new al),this.useCustomEmojiForTasksPlugin=this.settings.newSettingBuilder().key("useCustomEmojiForTasksPlugin").name("Distinguish between reminder date and due date").desc("Use custom emoji \u23F0 instead of \u{1F4C5} and distinguish between reminder date/time and Tasks Plugin's due date.").tag(tr).toggle(!1).onAnyValueChanged(o=>{o.setEnabled(e.enableTasksPluginReminderFormat.value)}).build(new te),this.useReminderTimeFallbackForTasksPlugin=this.settings.newSettingBuilder().key("useReminderTimeFallbackForTasksPlugin").name("Fall back to due, scheduled, or start date").desc("When the reminder date (\u23F0) is missing, use the due date (\u{1F4C5}), then the scheduled date (\u23F3), then the start date (\u{1F6EB}), in that order.").tag(tr).toggle(!1).onAnyValueChanged(o=>{o.setEnabled(e.enableTasksPluginReminderFormat.value&&this.useCustomEmojiForTasksPlugin.value)}).build(new te),this.removeTagsForTasksPlugin=this.settings.newSettingBuilder().key("removeTagsForTasksPlugin").name("Remove tags from reminder title").desc("If checked, tags(#xxx) are removed from the reminder list view and notification.").tag(tr).toggle(!1).onAnyValueChanged(o=>{o.setEnabled(e.enableTasksPluginReminderFormat.value)}).build(new te),this.dataviewReminderFieldName=this.settings.newSettingBuilder().key("dataviewReminderFieldName").name("Reminder field name").desc("The inline field (e.g. [reminder:: 2021-09-08]) read as the reminder date. On a line that also has a due field, this field takes precedence.").tag(tr).text("reminder").placeHolder("reminder").onAnyValueChanged(o=>{o.setEnabled(e.enableDataviewReminderFormat.value)}).build(new te),this.yearMonthDisplayFormat=this.settings.newSettingBuilder().key("yearMonthDisplayFormat").name("Year & month format").desc(`Moment style year and month format:
https://momentjs.com/docs/#/displaying/format/`).text("YYYY, MMMM").placeHolder("YYYY, MMMM").build(new te),this.monthDayDisplayFormat=this.settings.newSettingBuilder().key("monthDayDisplayFormat").name("Month & day format").desc(`Moment style month and day format:
https://momentjs.com/docs/#/displaying/format/`).text("MM/DD").placeHolder("MM/DD").build(new te),this.shortDateWithWeekdayDisplayFormat=this.settings.newSettingBuilder().key("shortDateWithWeekdayDisplayFormat").name("Short date with weekday format").desc(`Moment style short date with weekday format:
https://momentjs.com/docs/#/displaying/format/`).text("M/DD (ddd)").placeHolder("M/DD (ddd)").build(new te),this.timeDisplayFormat=this.settings.newSettingBuilder().key("timeDisplayFormat").name("Time format").desc(`Moment style time format:
https://momentjs.com/docs/#/displaying/format/`).text("HH:mm").placeHolder("HH:mm").build(new te),this.editDetectionSec=this.settings.newSettingBuilder().key("editDetectionSec").name("Edit detection time").desc("The minimum amount of time (in seconds) after a key is typed that it will be identified as notifiable. Only applies to the Modal popup style; Toast reminders are shown immediately even while typing.").number(10).build(new te),this.reminderCheckIntervalSec=this.settings.newSettingBuilder().key("reminderCheckIntervalSec").name("Reminder check interval").desc("Interval(in seconds) to periodically check whether or not you should be notified of reminders. You will need to restart Obsidian for this setting to take effect.").number(5).build(new te),this.showOverdueCountInStatusBar=this.settings.newSettingBuilder().key("showOverdueCountInStatusBar").name("Show overdue count in status bar").desc("Show the number of overdue reminders in the status bar. Click it to open the reminder list.").toggle(!0).build(new te),this.ntfyEnabled=this.settings.newSettingBuilder().key("ntfyEnabled").name("Enable ntfy scheduled notifications (experimental)").desc("Publish upcoming reminders to the ntfy server below as scheduled push notifications, so you're notified even when Obsidian isn't running (useful on mobile, where plugins can't run in the background). This sends reminder titles to that server, so only enable this if you trust it. Requires an ntfy server running v2.16.0 or later (needed for sequence-ID based scheduled message replacement/deletion). Only reminders due within the next 24 hours are registered \u2014 ntfy itself allows scheduling at most 3 days ahead, and this plugin periodically re-registers reminders to roll that 24-hour window forward.").toggle(!1).build(new te),this.ntfyServerUrl=this.settings.newSettingBuilder().key("ntfyServerUrl").name("ntfy server URL").desc("The ntfy server to publish scheduled notifications to.").text("https://ntfy.sh").placeHolder("https://ntfy.sh").build(new te),this.ntfyTopic=this.settings.newSettingBuilder().key("ntfyTopic").name("ntfy topic").desc("Topic to publish reminders to. Anyone who knows this topic name can subscribe to it and read your reminder titles, so use a long, hard-to-guess name rather than something predictable. May only contain letters, digits, dashes and underscores (1-64 characters).").text("").placeHolder("a-long-random-topic-name").onAnyValueChanged(o=>{let s=this.ntfyTopic.value.trim();o.setValidationError(s.length===0||ai(s)?null:"A topic may only contain letters, digits, dashes and underscores (1-64 characters).")}).build(new te),this.ntfyAccessToken=this.settings.newSettingBuilder().key("ntfyAccessToken").name("ntfy access token").desc("Only needed for a server that requires authentication (a self-hosted instance with access control, for example); leave it empty otherwise. Create one with `ntfy token add <user>` or from the ntfy web app under Account \u2192 Access tokens. The token needs read-write access to the topic above, because this plugin reads, publishes and deletes scheduled messages. It is stored in plain text in this plugin's data.json, which is synced along with your vault if you sync your Obsidian configuration folder.").text("").masked().placeHolder("tk_...").button("Test",async o=>{o.setValidationError(null),o.setInfo("Testing\u2026");let s=await Du(async a=>(0,dp.requestUrl)({...a,throw:!1}),{serverUrl:this.ntfyServerUrl.value,topic:this.ntfyTopic.value,accessToken:this.ntfyAccessToken.value});o.setInfo(s.ok?s.message:null),o.setValidationError(s.ok?null:s.message)}).onAnyValueChanged(o=>{o.setInfo(null)}).build(new te),this.settings.newPage("Notifications").newGroup().addSettings(this.reminderTime,this.reminderTimeStep,this.laters,this.enableNotification,this.reNotifyMutedOnStartup,this.notificationPopupStyle,this.openNoteOnReminderClick,this.useSystemNotification,this.showPopupWithSystemNotification,this.keepSystemNotificationOnScreen,this.focusDoneButtonOnPopup,this.showOverdueCountInStatusBar),this.settings.newPage("Editor").newGroup().addSet
/* nosourcemap */