/*
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 T_=Object.create;var ys=Object.defineProperty;var E_=Object.getOwnPropertyDescriptor;var G_=Object.getOwnPropertyNames;var B_=Object.getPrototypeOf,D_=Object.prototype.hasOwnProperty;var em=r=>{throw TypeError(r)};var N_=(r,e,t)=>e in r?ys(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var W_=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},Z_=(r,e)=>{for(var t in e)ys(r,t,{get:e[t],enumerable:!0})},tm=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of G_(e))!D_.call(r,o)&&o!==t&&ys(r,o,{get:()=>e[o],enumerable:!(n=E_(e,o))||n.enumerable});return r};var Wr=(r,e,t)=>(t=r!=null?T_(B_(r)):{},tm(e||!r||!r.__esModule?ys(t,"default",{value:r,enumerable:!0}):t,r)),Y_=r=>tm(ys({},"__esModule",{value:!0}),r);var m=(r,e,t)=>N_(r,typeof e!="symbol"?e+"":e,t),Ku=(r,e,t)=>e.has(r)||em("Cannot "+t);var x=(r,e,t)=>(Ku(r,e,"read from private field"),t?t.call(r):e.get(r)),q=(r,e,t)=>e.has(r)?em("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),j=(r,e,t,n)=>(Ku(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),se=(r,e,t)=>(Ku(r,e,"access private method"),t);var wr=W_((ic,no)=>{(function(r,e){typeof ic=="object"&&typeof no!="undefined"?no.exports=e():typeof define=="function"&&define.amd?define(e):r.moment=e()})(ic,(function(){"use strict";var r;function e(){return r.apply(null,arguments)}function t(i){r=i}function n(i){return i instanceof Array||Object.prototype.toString.call(i)==="[object Array]"}function o(i){return i!=null&&Object.prototype.toString.call(i)==="[object Object]"}function a(i,s){return Object.prototype.hasOwnProperty.call(i,s)}function c(i){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(i).length===0;var s;for(s in i)if(a(i,s))return!1;return!0}function u(i){return i===void 0}function f(i){return typeof i=="number"||Object.prototype.toString.call(i)==="[object Number]"}function h(i){return i instanceof Date||Object.prototype.toString.call(i)==="[object Date]"}function b(i,s){var l=[],d,p=i.length;for(d=0;d
>>0,d;for(d=0;d0)for(l=0;l=0;return(I?l?"+":"":"-")+Math.pow(10,Math.max(0,p)).toString().substr(1)+d}var D=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ae=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,De={},T={};function E(i,s,l,d){var p=d;typeof d=="string"&&(p=function(){return this[d]()}),i&&(T[i]=p),s&&(T[s[0]]=function(){return ie(p.apply(this,arguments),s[1],s[2])}),l&&(T[l]=function(){return this.localeData().ordinal(p.apply(this,arguments),i)})}function _t(i){return i.match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"")}function Je(i){var s=i.match(D),l,d;for(l=0,d=s.length;l=0&&ae.test(i);)i=i.replace(ae,d),ae.lastIndex=0,l-=1;return i}var wi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function qt(i){var s=this._longDateFormat[i],l=this._longDateFormat[i.toUpperCase()];return s||!l?s:(this._longDateFormat[i]=l.match(D).map(function(d){return d==="MMMM"||d==="MM"||d==="DD"||d==="dddd"?d.slice(1):d}).join(""),this._longDateFormat[i])}var yn="Invalid date";function ti(){return this._invalidDate}var us="%d",Ru=/\d{1,2}/;function Vg(i){return this._ordinal.replace("%d",i)}var Lg={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Og(i,s,l,d){var p=this._relativeTime[l];return he(p)?p(i,s,l,d):p.replace(/%d/i,i)}function $g(i,s){var l=this._relativeTime[i>0?"future":"past"];return he(l)?l(s):l.replace(/%s/i,s)}var cf={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function _r(i){return typeof i=="string"?cf[i]||cf[i.toLowerCase()]:void 0}function Fu(i){var s={},l,d;for(d in i)a(i,d)&&(l=_r(d),l&&(s[l]=i[d]));return s}var Pg={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Hg(i){var s=[],l;for(l in i)a(i,l)&&s.push({unit:l,priority:Pg[l]});return s.sort(function(d,p){return d.priority-p.priority}),s}var df=/\d/,or=/\d\d/,ff=/\d{3}/,Tu=/\d{4}/,ga=/[+-]?\d{6}/,Ye=/\d\d?/,mf=/\d\d\d\d?/,pf=/\d\d\d\d\d\d?/,ba=/\d{1,3}/,Eu=/\d{1,4}/,va=/[+-]?\d{1,6}/,Hi=/\d+/,ya=/[+-]?\d+/,Jg=/Z|[+-]\d\d:?\d\d/gi,_a=/Z|[+-]\d\d(?::?\d\d)?/gi,jg=/[+-]?\d+(\.\d{1,3})?/,cs=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ji=/^[1-9]\d?/,Gu=/^([1-9]\d|\d)/,Ia;Ia={};function W(i,s,l){Ia[i]=he(s)?s:function(d,p){return d&&l?l:s}}function zg(i,s){return a(Ia,i)?Ia[i](s._strict,s._locale):new RegExp(Kg(i))}function Kg(i){return _n(i.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(s,l,d,p,I){return l||d||p||I}))}function _n(i){return i.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ir(i){return i<0?Math.ceil(i)||0:Math.floor(i)}function fe(i){var s=+i,l=0;return s!==0&&isFinite(s)&&(l=Ir(s)),l}var Bu={};function Re(i,s){var l,d=s,p;for(typeof i=="string"&&(i=[i]),f(s)&&(d=function(I,S){S[s]=fe(I)}),p=i.length,l=0;l68?1900:2e3)};var hf=ji("FullYear",!0);function rb(){return wa(this.year())}function ji(i,s){return function(l){return l!=null?(gf(this,i,l),e.updateOffset(this,s),this):ms(this,i)}}function ms(i,s){if(!i.isValid())return NaN;var l=i._d,d=i._isUTC;switch(s){case"Milliseconds":return d?l.getUTCMilliseconds():l.getMilliseconds();case"Seconds":return d?l.getUTCSeconds():l.getSeconds();case"Minutes":return d?l.getUTCMinutes():l.getMinutes();case"Hours":return d?l.getUTCHours():l.getHours();case"Date":return d?l.getUTCDate():l.getDate();case"Day":return d?l.getUTCDay():l.getDay();case"Month":return d?l.getUTCMonth():l.getMonth();case"FullYear":return d?l.getUTCFullYear():l.getFullYear();default:return NaN}}function gf(i,s,l){var d,p,I,S,N;if(!(!i.isValid()||isNaN(l))){switch(d=i._d,p=i._isUTC,s){case"Milliseconds":return void(p?d.setUTCMilliseconds(l):d.setMilliseconds(l));case"Seconds":return void(p?d.setUTCSeconds(l):d.setSeconds(l));case"Minutes":return void(p?d.setUTCMinutes(l):d.setMinutes(l));case"Hours":return void(p?d.setUTCHours(l):d.setHours(l));case"Date":return void(p?d.setUTCDate(l):d.setDate(l));case"FullYear":break;default:return}I=l,S=i.month(),N=i.date(),N=N===29&&S===1&&!wa(I)?28:N,p?d.setUTCFullYear(I,S,N):d.setFullYear(I,S,N)}}function nb(i){return i=_r(i),he(this[i])?this[i]():this}function ib(i,s){if(typeof i=="object"){i=Fu(i);var l=Hg(i),d,p=l.length;for(d=0;d
=0?(N=new Date(i+400,s,l,d,p,I,S),isFinite(N.getFullYear())&&N.setFullYear(i)):N=new Date(i,s,l,d,p,I,S),N}function ps(i){var s,l;return i<100&&i>=0?(l=Array.prototype.slice.call(arguments),l[0]=i+400,s=new Date(Date.UTC.apply(null,l)),isFinite(s.getUTCFullYear())&&s.setUTCFullYear(i)):s=new Date(Date.UTC.apply(null,arguments)),s}function Ca(i,s,l){var d=7+s-l,p=(7+ps(i,0,d).getUTCDay()-s)%7;return-p+d-1}function wf(i,s,l,d,p){var I=(7+l-d)%7,S=Ca(i,d,p),N=1+7*(s-1)+I+S,ee,ge;return N<=0?(ee=i-1,ge=fs(ee)+N):N>fs(i)?(ee=i+1,ge=N-fs(i)):(ee=i,ge=N),{year:ee,dayOfYear:ge}}function hs(i,s,l){var d=Ca(i.year(),s,l),p=Math.floor((i.dayOfYear()-d-1)/7)+1,I,S;return p<1?(S=i.year()-1,I=p+Cn(S,s,l)):p>Cn(i.year(),s,l)?(I=p-Cn(i.year(),s,l),S=i.year()+1):(S=i.year(),I=p),{week:I,year:S}}function Cn(i,s,l){var d=Ca(i,s,l),p=Ca(i+1,s,l);return(fs(i)-d+p)/7}E("w",["ww",2],"wo","week"),E("W",["WW",2],"Wo","isoWeek"),W("w",Ye,Ji),W("ww",Ye,or),W("W",Ye,Ji),W("WW",Ye,or),ds(["w","ww","W","WW"],function(i,s,l,d){s[d.substr(0,1)]=fe(i)});function bb(i){return hs(i,this._week.dow,this._week.doy).week}var vb={dow:0,doy:6};function yb(){return this._week.dow}function _b(){return this._week.doy}function Ib(i){var s=this.localeData().week(this);return i==null?s:this.add((i-s)*7,"d")}function wb(i){var s=hs(this,1,4).week;return i==null?s:this.add((i-s)*7,"d")}E("d",0,"do","day"),E("dd",0,0,function(i){return this.localeData().weekdaysMin(this,i)}),E("ddd",0,0,function(i){return this.localeData().weekdaysShort(this,i)}),E("dddd",0,0,function(i){return this.localeData().weekdays(this,i)}),E("e",0,0,"weekday"),E("E",0,0,"isoWeekday"),W("d",Ye),W("e",Ye),W("E",Ye),W("dd",function(i,s){return s.weekdaysMinRegex(i)}),W("ddd",function(i,s){return s.weekdaysShortRegex(i)}),W("dddd",function(i,s){return s.weekdaysRegex(i)}),ds(["dd","ddd","dddd"],function(i,s,l,d){var p=l._locale.weekdaysParse(i,d,l._strict);p!=null?s.d=p:y(l).invalidWeekday=i}),ds(["d","e","E"],function(i,s,l,d){s[d]=fe(i)});function Cb(i,s){return typeof i!="string"?i:isNaN(i)?(i=s.weekdaysParse(i),typeof i=="number"?i:null):parseInt(i,10)}function xb(i,s){return typeof i=="string"?s.weekdaysParse(i)%7||7:isNaN(i)?null:i}function Nu(i,s){return i.slice(s,7).concat(i.slice(0,s))}var Ab="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Cf="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),kb="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Sb=cs,Rb=cs,Fb=cs;function Tb(i,s){var l=n(this._weekdays)?this._weekdays:this._weekdays[i&&i!==!0&&this._weekdays.isFormat.test(s)?"format":"standalone"];return i===!0?Nu(l,this._week.dow):i?l[i.day()]:l}function Eb(i){return i===!0?Nu(this._weekdaysShort,this._week.dow):i?this._weekdaysShort[i.day()]:this._weekdaysShort}function Gb(i){return i===!0?Nu(this._weekdaysMin,this._week.dow):i?this._weekdaysMin[i.day()]:this._weekdaysMin}function Bb(i,s,l){var d,p,I,S=i.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)I=g([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(I,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(I,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(I,"").toLocaleLowerCase();return l?s==="dddd"?(p=je.call(this._weekdaysParse,S),p!==-1?p:null):s==="ddd"?(p=je.call(this._shortWeekdaysParse,S),p!==-1?p:null):(p=je.call(this._minWeekdaysParse,S),p!==-1?p:null):s==="dddd"?(p=je.call(this._weekdaysParse,S),p!==-1||(p=je.call(this._shortWeekdaysParse,S),p!==-1)?p:(p=je.call(this._minWeekdaysParse,S),p!==-1?p:null)):s==="ddd"?(p=je.call(this._shortWeekdaysParse,S),p!==-1||(p=je.call(this._weekdaysParse,S),p!==-1)?p:(p=je.call(this._minWeekdaysParse,S),p!==-1?p:null)):(p=je.call(this._minWeekdaysParse,S),p!==-1||(p=je.call(this._weekdaysParse,S),p!==-1)?p:(p=je.call(this._shortWeekdaysParse,S),p!==-1?p:null))}function Db(i,s,l){var d,p,I;if(this._weekdaysParseExact)return Bb.call(this,i,s,l);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;d<7;d++){if(p=g([2e3,1]).day(d),l&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(p,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(p,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(p,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[d]||(I="^"+this.weekdays(p,"")+"|^"+this.weekdaysShort(p,"")+"|^"+this.weekdaysMin(p,""),this._weekdaysParse[d]=new RegExp(I.replace(".",""),"i")),l&&s==="dddd"&&this._fullWeekdaysParse[d].test(i))return d;if(l&&s==="ddd"&&this._shortWeekdaysParse[d].test(i))return d;if(l&&s==="dd"&&this._minWeekdaysParse[d].test(i))return d;if(!l&&this._weekdaysParse[d].test(i))return d}}function Nb(i){if(!this.isValid())return i!=null?this:NaN;var s=ms(this,"Day");return i!=null?(i=Cb(i,this.localeData()),this.add(i-s,"d")):s}function Wb(i){if(!this.isValid())return i!=null?this:NaN;var s=(this.day()+7-this.localeData()._week.dow)%7;return i==null?s:this.add(i-s,"d")}function Zb(i){if(!this.isValid())return i!=null?this:NaN;if(i!=null){var s=xb(i,this.localeData());return this.day(this.day()%7?s:s-7)}else return this.day()||7}function Yb(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Wu.call(this),i?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Sb),this._weekdaysStrictRegex&&i?this._weekdaysStrictRegex:this._weekdaysRegex)}function Mb(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Wu.call(this),i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Rb),this._weekdaysShortStrictRegex&&i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Xb(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Wu.call(this),i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Fb),this._weekdaysMinStrictRegex&&i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Wu(){function i(Ot,Rn){return Rn.length-Ot.length}var s=[],l=[],d=[],p=[],I,S,N,ee,ge;for(I=0;I<7;I++)S=g([2e3,1]).day(I),N=_n(this.weekdaysMin(S,"")),ee=_n(this.weekdaysShort(S,"")),ge=_n(this.weekdays(S,"")),s.push(N),l.push(ee),d.push(ge),p.push(N),p.push(ee),p.push(ge);s.sort(i),l.sort(i),d.sort(i),p.sort(i),this._weekdaysRegex=new RegExp("^("+p.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Zu(){return this.hours()%12||12}function Ub(){return this.hours()||24}E("H",["HH",2],0,"hour"),E("h",["hh",2],0,Zu),E("k",["kk",2],0,Ub),E("hmm",0,0,function(){return""+Zu.apply(this)+ie(this.minutes(),2)}),E("hmmss",0,0,function(){return""+Zu.apply(this)+ie(this.minutes(),2)+ie(this.seconds(),2)}),E("Hmm",0,0,function(){return""+this.hours()+ie(this.minutes(),2)}),E("Hmmss",0,0,function(){return""+this.hours()+ie(this.minutes(),2)+ie(this.seconds(),2)});function xf(i,s){E(i,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),s)})}xf("a",!0),xf("A",!1);function Af(i,s){return s._meridiemParse}W("a",Af),W("A",Af),W("H",Ye,Gu),W("h",Ye,Ji),W("k",Ye,Ji),W("HH",Ye,or),W("hh",Ye,or),W("kk",Ye,or),W("hmm",mf),W("hmmss",pf),W("Hmm",mf),W("Hmmss",pf),Re(["H","HH"],ct),Re(["k","kk"],function(i,s,l){var d=fe(i);s[ct]=d===24?0:d}),Re(["a","A"],function(i,s,l){l._isPm=l._locale.isPM(i),l._meridiem=i}),Re(["h","hh"],function(i,s,l){s[ct]=fe(i),y(l).bigHour=!0}),Re("hmm",function(i,s,l){var d=i.length-2;s[ct]=fe(i.substr(0,d)),s[Dr]=fe(i.substr(d)),y(l).bigHour=!0}),Re("hmmss",function(i,s,l){var d=i.length-4,p=i.length-2;s[ct]=fe(i.substr(0,d)),s[Dr]=fe(i.substr(d,2)),s[wn]=fe(i.substr(p)),y(l).bigHour=!0}),Re("Hmm",function(i,s,l){var d=i.length-2;s[ct]=fe(i.substr(0,d)),s[Dr]=fe(i.substr(d))}),Re("Hmmss",function(i,s,l){var d=i.length-4,p=i.length-2;s[ct]=fe(i.substr(0,d)),s[Dr]=fe(i.substr(d,2)),s[wn]=fe(i.substr(p))});function Qb(i){return(i+"").toLowerCase().charAt(0)==="p"}var Vb=/[ap]\.?m?\.?/i,Lb=ji("Hours",!0);function Ob(i,s,l){return i>11?l?"pm":"PM":l?"am":"AM"}var kf={calendar:Kt,longDateFormat:wi,invalidDate:yn,ordinal:us,dayOfMonthOrdinalParse:Ru,relativeTime:Lg,months:sb,monthsShort:bf,week:vb,weekdays:Ab,weekdaysMin:kb,weekdaysShort:Cf,meridiemParse:Vb},Ue={},gs={},bs;function $b(i,s){var l,d=Math.min(i.length,s.length);for(l=0;l0;){if(p=xa(I.slice(0,l).join("-")),p)return p;if(d&&d.length>=l&&$b(I,d)>=l-1)break;l--}s++}return bs}function Hb(i){return!!(i&&i.match("^[^/\\\\]*$"))}function xa(i){var s=null,l;if(Ue[i]===void 0&&typeof no!="undefined"&&no&&no.exports&&Hb(i))try{s=bs._abbr,l=require,l("./locale/"+i),ri(s)}catch(d){Ue[i]=null}return Ue[i]}function ri(i,s){var l;return i&&(u(s)?l=xn(i):l=Yu(i,s),l?bs=l:typeof console!="undefined"&&console.warn&&console.warn("Locale "+i+" not found. Did you forget to load it?")),bs._abbr}function Yu(i,s){if(s!==null){var l,d=kf;if(s.abbr=i,Ue[i]!=null)He("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),d=Ue[i]._config;else if(s.parentLocale!=null)if(Ue[s.parentLocale]!=null)d=Ue[s.parentLocale]._config;else if(l=xa(s.parentLocale),l!=null)d=l._config;else return gs[s.parentLocale]||(gs[s.parentLocale]=[]),gs[s.parentLocale].push({name:i,config:s}),null;return Ue[i]=new rt(Ze(d,s)),gs[i]&&gs[i].forEach(function(p){Yu(p.name,p.config)}),ri(i),Ue[i]}else return delete Ue[i],null}function Jb(i,s){if(s!=null){var l,d,p=kf;Ue[i]!=null&&Ue[i].parentLocale!=null?Ue[i].set(Ze(Ue[i]._config,s)):(d=xa(i),d!=null&&(p=d._config),s=Ze(p,s),d==null&&(s.abbr=i),l=new rt(s),l.parentLocale=Ue[i],Ue[i]=l),ri(i)}else Ue[i]!=null&&(Ue[i].parentLocale!=null?(Ue[i]=Ue[i].parentLocale,i===ri()&&ri(i)):Ue[i]!=null&&delete Ue[i]);return Ue[i]}function xn(i){var s;if(i&&i._locale&&i._locale._abbr&&(i=i._locale._abbr),!i)return bs;if(!n(i)){if(s=xa(i),s)return s;i=[i]}return Pb(i)}function jb(){return At(Ue)}function Mu(i){var s,l=i._a;return l&&y(i).overflow===-2&&(s=l[In]<0||l[In]>11?In:l[Jr]<1||l[Jr]>Du(l[Dt],l[In])?Jr:l[ct]<0||l[ct]>24||l[ct]===24&&(l[Dr]!==0||l[wn]!==0||l[Ci]!==0)?ct:l[Dr]<0||l[Dr]>59?Dr:l[wn]<0||l[wn]>59?wn:l[Ci]<0||l[Ci]>999?Ci:-1,y(i)._overflowDayOfYear&&(sJr)&&(s=Jr),y(i)._overflowWeeks&&s===-1&&(s=eb),y(i)._overflowWeekday&&s===-1&&(s=tb),y(i).overflow=s),i}var zb=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Kb=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,qb=/Z|[+-]\d\d(?::?\d\d)?/,Aa=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Xu=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ev=/^\/?Date\((-?\d+)/i,tv=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,rv={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Rf(i){var s,l,d=i._i,p=zb.exec(d)||Kb.exec(d),I,S,N,ee,ge=Aa.length,Ot=Xu.length;if(p){for(y(i).iso=!0,s=0,l=ge;sfs(S)||i._dayOfYear===0)&&(y(i)._overflowDayOfYear=!0),l=ps(S,0,i._dayOfYear),i._a[In]=l.getUTCMonth(),i._a[Jr]=l.getUTCDate()),s=0;s<3&&i._a[s]==null;++s)i._a[s]=d[s]=p[s];for(;s<7;s++)i._a[s]=d[s]=i._a[s]==null?s===2?1:0:i._a[s];i._a[ct]===24&&i._a[Dr]===0&&i._a[wn]===0&&i._a[Ci]===0&&(i._nextDay=!0,i._a[ct]=0),i._d=(i._useUTC?ps:gb).apply(null,d),I=i._useUTC?i._d.getUTCDay():i._d.getDay(),i._tzm!=null&&i._d.setUTCMinutes(i._d.getUTCMinutes()-i._tzm),i._nextDay&&(i._a[ct]=24),i._w&&typeof i._w.d!="undefined"&&i._w.d!==I&&(y(i).weekdayMismatch=!0)}}function cv(i){var s,l,d,p,I,S,N,ee,ge;s=i._w,s.GG!=null||s.W!=null||s.E!=null?(I=1,S=4,l=zi(s.GG,i._a[Dt],hs(Me(),1,4).year),d=zi(s.W,1),p=zi(s.E,1),(p<1||p>7)&&(ee=!0)):(I=i._locale._week.dow,S=i._locale._week.doy,ge=hs(Me(),I,S),l=zi(s.gg,i._a[Dt],ge.year),d=zi(s.w,ge.week),s.d!=null?(p=s.d,(p<0||p>6)&&(ee=!0)):s.e!=null?(p=s.e+I,(s.e<0||s.e>6)&&(ee=!0)):p=I),d<1||d>Cn(l,I,S)?y(i)._overflowWeeks=!0:ee!=null?y(i)._overflowWeekday=!0:(N=wf(l,d,p,I,S),i._a[Dt]=N.year,i._dayOfYear=N.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Qu(i){if(i._f===e.ISO_8601){Rf(i);return}if(i._f===e.RFC_2822){Ff(i);return}i._a=[],y(i).empty=!0;var s=""+i._i,l,d,p,I,S,N=s.length,ee=0,ge,Ot;for(p=Ve(i._f,i._locale).match(D)||[],Ot=p.length,l=0;l0&&y(i).unusedInput.push(S),s=s.slice(s.indexOf(d)+d.length),ee+=d.length),T[I]?(d?y(i).empty=!1:y(i).unusedTokens.push(I),qg(I,d,i)):i._strict&&!d&&y(i).unusedTokens.push(I);y(i).charsLeftOver=N-ee,s.length>0&&y(i).unusedInput.push(s),i._a[ct]<=12&&y(i).bigHour===!0&&i._a[ct]>0&&(y(i).bigHour=void 0),y(i).parsedDateParts=i._a.slice(0),y(i).meridiem=i._meridiem,i._a[ct]=dv(i._locale,i._a[ct],i._meridiem),ge=y(i).era,ge!==null&&(i._a[Dt]=i._locale.erasConvertYear(ge,i._a[Dt])),Uu(i),Mu(i)}function dv(i,s,l){var d;return l==null?s:i.meridiemHour!=null?i.meridiemHour(s,l):(i.isPM!=null&&(d=i.isPM(l),d&&s<12&&(s+=12),!d&&s===12&&(s=0)),s)}function fv(i){var s,l,d,p,I,S,N=!1,ee=i._f.length;if(ee===0){y(i).invalidFormat=!0,i._d=new Date(NaN);return}for(p=0;pthis?this:i:A()});function Gf(i,s){var l,d;if(s.length===1&&n(s[0])&&(s=s[0]),!s.length)return Me();for(l=s[0],d=1;dthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Bv(){if(!u(this._isDSTShifted))return this._isDSTShifted;var i={},s;return te(i,this),i=Tf(i),i._a?(s=i._isUTC?g(i._a):Me(i._a),this._isDSTShifted=this.isValid()&&xv(i._a,s.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Dv(){return this.isValid()?!this._isUTC:!1}function Nv(){return this.isValid()?this._isUTC:!1}function Df(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Wv=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Zv=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Nr(i,s){var l=i,d=null,p,I,S;return Sa(i)?l={ms:i._milliseconds,d:i._days,M:i._months}:f(i)||!isNaN(+i)?(l={},s?l[s]=+i:l.milliseconds=+i):(d=Wv.exec(i))?(p=d[1]==="-"?-1:1,l={y:0,d:fe(d[Jr])*p,h:fe(d[ct])*p,m:fe(d[Dr])*p,s:fe(d[wn])*p,ms:fe(Vu(d[Ci]*1e3))*p}):(d=Zv.exec(i))?(p=d[1]==="-"?-1:1,l={y:xi(d[2],p),M:xi(d[3],p),w:xi(d[4],p),d:xi(d[5],p),h:xi(d[6],p),m:xi(d[7],p),s:xi(d[8],p)}):l==null?l={}:typeof l=="object"&&("from"in l||"to"in l)&&(S=Yv(Me(l.from),Me(l.to)),l={},l.ms=S.milliseconds,l.M=S.months),I=new ka(l),Sa(i)&&a(i,"_locale")&&(I._locale=i._locale),Sa(i)&&a(i,"_isValid")&&(I._isValid=i._isValid),I}Nr.fn=ka.prototype,Nr.invalid=Cv;function xi(i,s){var l=i&&parseFloat(i.replace(",","."));return(isNaN(l)?0:l)*s}function Nf(i,s){var l={};return l.months=s.month()-i.month()+(s.year()-i.year())*12,i.clone().add(l.months,"M").isAfter(s)&&--l.months,l.milliseconds=+s-+i.clone().add(l.months,"M"),l}function Yv(i,s){var l;return i.isValid()&&s.isValid()?(s=Ou(s,i),i.isBefore(s)?l=Nf(i,s):(l=Nf(s,i),l.milliseconds=-l.milliseconds,l.months=-l.months),l):{milliseconds:0,months:0}}function Wf(i,s){return function(l,d){var p,I;return d!==null&&!isNaN(+d)&&(He(s,"moment()."+s+"(period, number) is deprecated. Please use moment()."+s+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),I=l,l=d,d=I),p=Nr(l,d),Zf(this,p,i),this}}function Zf(i,s,l,d){var p=s._milliseconds,I=Vu(s._days),S=Vu(s._months);i.isValid()&&(d=d==null?!0:d,S&&yf(i,ms(i,"Month")+S*l),I&&gf(i,"Date",ms(i,"Date")+I*l),p&&i._d.setTime(i._d.valueOf()+p*l),d&&e.updateOffset(i,I||S))}var Mv=Wf(1,"add"),Xv=Wf(-1,"subtract");function Yf(i){return typeof i=="string"||i instanceof String}function Uv(i){return M(i)||h(i)||Yf(i)||f(i)||Vv(i)||Qv(i)||i===null||i===void 0}function Qv(i){var s=o(i)&&!c(i),l=!1,d=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],p,I,S=d.length;for(p=0;pl.valueOf():l.valueOf()9999?ut(l,s?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):he(Date.prototype.toISOString)?s?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ut(l,"Z")):ut(l,s?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ny(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var i="moment",s="",l,d,p,I;return this.isLocal()||(i=this.utcOffset()===0?"moment.utc":"moment.parseZone",s="Z"),l="["+i+'("]',d=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",p="-MM-DD[T]HH:mm:ss.SSS",I=s+'[")]',this.format(l+d+p+I)}function iy(i){i||(i=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var s=ut(this,i);return this.localeData().postformat(s)}function oy(i,s){return this.isValid()&&(M(i)&&i.isValid()||Me(i).isValid())?Nr({to:this,from:i}).locale(this.locale()).humanize(!s):this.localeData().invalidDate()}function sy(i){return this.from(Me(),i)}function ay(i,s){return this.isValid()&&(M(i)&&i.isValid()||Me(i).isValid())?Nr({from:this,to:i}).locale(this.locale()).humanize(!s):this.localeData().invalidDate()}function ly(i){return this.to(Me(),i)}function Mf(i){var s;return i===void 0?this._locale._abbr:(s=xn(i),s!=null&&(this._locale=s),this)}var Xf=ye("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(i){return i===void 0?this.localeData():this.locale(i)});function Uf(){return this._locale}var Fa=1e3,Ki=60*Fa,Ta=60*Ki,Qf=(365*400+97)*24*Ta;function qi(i,s){return(i%s+s)%s}function Vf(i,s,l){return i<100&&i>=0?new Date(i+400,s,l)-Qf:new Date(i,s,l).valueOf()}function Lf(i,s,l){return i<100&&i>=0?Date.UTC(i+400,s,l)-Qf:Date.UTC(i,s,l)}function uy(i){var s,l;if(i=_r(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(l=this._isUTC?Lf:Vf,i){case"year":s=l(this.year(),0,1);break;case"quarter":s=l(this.year(),this.month()-this.month()%3,1);break;case"month":s=l(this.year(),this.month(),1);break;case"week":s=l(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":s=l(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":s=l(this.year(),this.month(),this.date());break;case"hour":s=this._d.valueOf(),s-=qi(s+(this._isUTC?0:this.utcOffset()*Ki),Ta);break;case"minute":s=this._d.valueOf(),s-=qi(s,Ki);break;case"second":s=this._d.valueOf(),s-=qi(s,Fa);break}return this._d.setTime(s),e.updateOffset(this,!0),this}function cy(i){var s,l;if(i=_r(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(l=this._isUTC?Lf:Vf,i){case"year":s=l(this.year()+1,0,1)-1;break;case"quarter":s=l(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":s=l(this.year(),this.month()+1,1)-1;break;case"week":s=l(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":s=l(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":s=l(this.year(),this.month(),this.date()+1)-1;break;case"hour":s=this._d.valueOf(),s+=Ta-qi(s+(this._isUTC?0:this.utcOffset()*Ki),Ta)-1;break;case"minute":s=this._d.valueOf(),s+=Ki-qi(s,Ki)-1;break;case"second":s=this._d.valueOf(),s+=Fa-qi(s,Fa)-1;break}return this._d.setTime(s),e.updateOffset(this,!0),this}function dy(){return this._d.valueOf()-(this._offset||0)*6e4}function fy(){return Math.floor(this.valueOf()/1e3)}function my(){return new Date(this.valueOf())}function py(){var i=this;return[i.year(),i.month(),i.date(),i.hour(),i.minute(),i.second(),i.millisecond()]}function hy(){var i=this;return{years:i.year(),months:i.month(),date:i.date(),hours:i.hours(),minutes:i.minutes(),seconds:i.seconds(),milliseconds:i.milliseconds()}}function gy(){return this.isValid()?this.toISOString():null}function by(){return C(this)}function vy(){return _({},y(this))}function yy(){return y(this).overflow}function _y(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}E("N",0,0,"eraAbbr"),E("NN",0,0,"eraAbbr"),E("NNN",0,0,"eraAbbr"),E("NNNN",0,0,"eraName"),E("NNNNN",0,0,"eraNarrow"),E("y",["y",1],"yo","eraYear"),E("y",["yy",2],0,"eraYear"),E("y",["yyy",3],0,"eraYear"),E("y",["yyyy",4],0,"eraYear"),W("N",Pu),W("NN",Pu),W("NNN",Pu),W("NNNN",Ey),W("NNNNN",Gy),Re(["N","NN","NNN","NNNN","NNNNN"],function(i,s,l,d){var p=l._locale.erasParse(i,d,l._strict);p?y(l).era=p:y(l).invalidEra=i}),W("y",Hi),W("yy",Hi),W("yyy",Hi),W("yyyy",Hi),W("yo",By),Re(["y","yy","yyy","yyyy"],Dt),Re(["yo"],function(i,s,l,d){var p;l._locale._eraYearOrdinalRegex&&(p=i.match(l._locale._eraYearOrdinalRegex)),l._locale.eraYearOrdinalParse?s[Dt]=l._locale.eraYearOrdinalParse(i,p):s[Dt]=parseInt(i,10)});function Iy(i,s){var l,d,p,I=this._eras||xn("en")._eras;for(l=0,d=I.length;l=0)return I[d]}function Cy(i,s){var l=i.since<=i.until?1:-1;return s===void 0?e(i.since).year():e(i.since).year()+(s-i.offset)*l}function xy(){var i,s,l,d=this.localeData().eras();for(i=0,s=d.length;iI&&(s=I),Xy.call(this,i,s,l,d,p))}function Xy(i,s,l,d,p){var I=wf(i,s,l,d,p),S=ps(I.year,0,I.dayOfYear);return this.year(S.getUTCFullYear()),this.month(S.getUTCMonth()),this.date(S.getUTCDate()),this}E("Q",0,"Qo","quarter"),W("Q",df),Re("Q",function(i,s){s[In]=(fe(i)-1)*3});function Uy(i){return i==null?Math.ceil((this.month()+1)/3):this.month((i-1)*3+this.month()%3)}E("D",["DD",2],"Do","date"),W("D",Ye,Ji),W("DD",Ye,or),W("Do",function(i,s){return i?s._dayOfMonthOrdinalParse||s._ordinalParse:s._dayOfMonthOrdinalParseLenient}),Re(["D","DD"],Jr),Re("Do",function(i,s){s[Jr]=fe(i.match(Ye)[0])});var $f=ji("Date",!0);E("DDD",["DDDD",3],"DDDo","dayOfYear"),W("DDD",ba),W("DDDD",ff),Re(["DDD","DDDD"],function(i,s,l){l._dayOfYear=fe(i)});function Qy(i){var s=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return i==null?s:this.add(i-s,"d")}E("m",["mm",2],0,"minute"),W("m",Ye,Gu),W("mm",Ye,or),Re(["m","mm"],Dr);var Vy=ji("Minutes",!1);E("s",["ss",2],0,"second"),W("s",Ye,Gu),W("ss",Ye,or),Re(["s","ss"],wn);var Ly=ji("Seconds",!1);E("S",0,0,function(){return~~(this.millisecond()/100)}),E(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),E(0,["SSS",3],0,"millisecond"),E(0,["SSSS",4],0,function(){return this.millisecond()*10}),E(0,["SSSSS",5],0,function(){return this.millisecond()*100}),E(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),E(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),E(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),E(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),W("S",ba,df),W("SS",ba,or),W("SSS",ba,ff);var ni,Pf;for(ni="SSSS";ni.length<=9;ni+="S")W(ni,Hi);function Oy(i,s){s[Ci]=fe(("0."+i)*1e3)}for(ni="S";ni.length<=9;ni+="S")Re(ni,Oy);Pf=ji("Milliseconds",!1),E("z",0,0,"zoneAbbr"),E("zz",0,0,"zoneName");function $y(){return this._isUTC?"UTC":""}function Py(){return this._isUTC?"Coordinated Universal Time":""}var F=le.prototype;F.add=Mv,F.calendar=$v,F.clone=Pv,F.diff=ey,F.endOf=cy,F.format=iy,F.from=oy,F.fromNow=sy,F.to=ay,F.toNow=ly,F.get=nb,F.invalidAt=yy,F.isAfter=Hv,F.isBefore=Jv,F.isBetween=jv,F.isSame=zv,F.isSameOrAfter=Kv,F.isSameOrBefore=qv,F.isValid=by,F.lang=Xf,F.locale=Mf,F.localeData=Uf,F.max=bv,F.min=gv,F.parsingFlags=vy,F.set=ib,F.startOf=uy,F.subtract=Xv,F.toArray=py,F.toObject=hy,F.toDate=my,F.toISOString=ry,F.inspect=ny,typeof Symbol!="undefined"&&Symbol.for!=null&&(F[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),F.toJSON=gy,F.toString=ty,F.unix=fy,F.valueOf=dy,F.creationData=_y,F.eraName=xy,F.eraNarrow=Ay,F.eraAbbr=ky,F.eraYear=Sy,F.year=hf,F.isLeapYear=rb,F.weekYear=Dy,F.isoWeekYear=Ny,F.quarter=F.quarters=Uy,F.month=_f,F.daysInMonth=mb,F.week=F.weeks=Ib,F.isoWeek=F.isoWeeks=wb,F.weeksInYear=Yy,F.weeksInWeekYear=My,F.isoWeeksInYear=Wy,F.isoWeeksInISOWeekYear=Zy,F.date=$f,F.day=F.days=Nb,F.weekday=Wb,F.isoWeekday=Zb,F.dayOfYear=Qy,F.hour=F.hours=Lb,F.minute=F.minutes=Vy,F.second=F.seconds=Ly,F.millisecond=F.milliseconds=Pf,F.utcOffset=kv,F.utc=Rv,F.local=Fv,F.parseZone=Tv,F.hasAlignedHourOffset=Ev,F.isDST=Gv,F.isLocal=Dv,F.isUtcOffset=Nv,F.isUtc=Df,F.isUTC=Df,F.zoneAbbr=$y,F.zoneName=Py,F.dates=ye("dates accessor is deprecated. Use date instead.",$f),F.months=ye("months accessor is deprecated. Use month instead",_f),F.years=ye("years accessor is deprecated. Use year instead",hf),F.zone=ye("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Sv),F.isDSTShifted=ye("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Bv);function Hy(i){return Me(i*1e3)}function Jy(){return Me.apply(null,arguments).parseZone()}function Hf(i){return i}var Ce=rt.prototype;Ce.calendar=Q,Ce.longDateFormat=qt,Ce.invalidDate=ti,Ce.ordinal=Vg,Ce.preparse=Hf,Ce.postformat=Hf,Ce.relativeTime=Og,Ce.pastFuture=$g,Ce.set=Lt,Ce.eras=Iy,Ce.erasParse=wy,Ce.erasConvertYear=Cy,Ce.erasAbbrRegex=Fy,Ce.erasNameRegex=Ry,Ce.erasNarrowRegex=Ty,Ce.months=ub,Ce.monthsShort=cb,Ce.monthsParse=fb,Ce.monthsRegex=hb,Ce.monthsShortRegex=pb,Ce.week=bb,Ce.firstDayOfYear=_b,Ce.firstDayOfWeek=yb,Ce.weekdays=Tb,Ce.weekdaysMin=Gb,Ce.weekdaysShort=Eb,Ce.weekdaysParse=Db,Ce.weekdaysRegex=Yb,Ce.weekdaysShortRegex=Mb,Ce.weekdaysMinRegex=Xb,Ce.isPM=Qb,Ce.meridiem=Ob;function Ga(i,s,l,d){var p=xn(),I=g().set(d,s);return p[l](I,i)}function Jf(i,s,l){if(f(i)&&(s=i,i=void 0),i=i||"",s!=null)return Ga(i,s,l,"month");var d,p=[];for(d=0;d<12;d++)p[d]=Ga(i,d,l,"month");return p}function Ju(i,s,l,d){typeof i=="boolean"?(f(s)&&(l=s,s=void 0),s=s||""):(s=i,l=s,i=!1,f(s)&&(l=s,s=void 0),s=s||"");var p=xn(),I=i?p._week.dow:0,S,N=[];if(l!=null)return Ga(s,(l+I)%7,d,"day");for(S=0;S<7;S++)N[S]=Ga(s,(S+I)%7,d,"day");return N}function jy(i,s){return Jf(i,s,"months")}function zy(i,s){return Jf(i,s,"monthsShort")}function Ky(i,s,l){return Ju(i,s,l,"weekdays")}function qy(i,s,l){return Ju(i,s,l,"weekdaysShort")}function e_(i,s,l){return Ju(i,s,l,"weekdaysMin")}ri("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(i){var s=i%10,l=fe(i%100/10)===1?"th":s===1?"st":s===2?"nd":s===3?"rd":"th";return i+l}}),e.lang=ye("moment.lang is deprecated. Use moment.locale instead.",ri),e.langData=ye("moment.langData is deprecated. Use moment.localeData instead.",xn);var An=Math.abs;function t_(){var i=this._data;return this._milliseconds=An(this._milliseconds),this._days=An(this._days),this._months=An(this._months),i.milliseconds=An(i.milliseconds),i.seconds=An(i.seconds),i.minutes=An(i.minutes),i.hours=An(i.hours),i.months=An(i.months),i.years=An(i.years),this}function jf(i,s,l,d){var p=Nr(s,l);return i._milliseconds+=d*p._milliseconds,i._days+=d*p._days,i._months+=d*p._months,i._bubble()}function r_(i,s){return jf(this,i,s,1)}function n_(i,s){return jf(this,i,s,-1)}function zf(i){return i<0?Math.floor(i):Math.ceil(i)}function i_(){var i=this._milliseconds,s=this._days,l=this._months,d=this._data,p,I,S,N,ee;return i>=0&&s>=0&&l>=0||i<=0&&s<=0&&l<=0||(i+=zf(ju(l)+s)*864e5,s=0,l=0),d.milliseconds=i%1e3,p=Ir(i/1e3),d.seconds=p%60,I=Ir(p/60),d.minutes=I%60,S=Ir(I/60),d.hours=S%24,s+=Ir(S/24),ee=Ir(Kf(s)),l+=ee,s-=zf(ju(ee)),N=Ir(l/12),l%=12,d.days=s,d.months=l,d.years=N,this}function Kf(i){return i*4800/146097}function ju(i){return i*146097/4800}function o_(i){if(!this.isValid())return NaN;var s,l,d=this._milliseconds;if(i=_r(i),i==="month"||i==="quarter"||i==="year")switch(s=this._days+d/864e5,l=this._months+Kf(s),i){case"month":return l;case"quarter":return l/3;case"year":return l/12}else switch(s=this._days+Math.round(ju(this._months)),i){case"week":return s/7+d/6048e5;case"day":return s+d/864e5;case"hour":return s*24+d/36e5;case"minute":return s*1440+d/6e4;case"second":return s*86400+d/1e3;case"millisecond":return Math.floor(s*864e5)+d;default:throw new Error("Unknown unit "+i)}}function kn(i){return function(){return this.as(i)}}var qf=kn("ms"),s_=kn("s"),a_=kn("m"),l_=kn("h"),u_=kn("d"),c_=kn("w"),d_=kn("M"),f_=kn("Q"),m_=kn("y"),p_=qf;function h_(){return Nr(this)}function g_(i){return i=_r(i),this.isValid()?this[i+"s"]():NaN}function Ai(i){return function(){return this.isValid()?this._data[i]:NaN}}var b_=Ai("milliseconds"),v_=Ai("seconds"),y_=Ai("minutes"),__=Ai("hours"),I_=Ai("days"),w_=Ai("months"),C_=Ai("years");function x_(){return Ir(this.days()/7)}var Sn=Math.round,eo={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function A_(i,s,l,d,p){return p.relativeTime(s||1,!!l,i,d)}function k_(i,s,l,d){var p=Nr(i).abs(),I=Sn(p.as("s")),S=Sn(p.as("m")),N=Sn(p.as("h")),ee=Sn(p.as("d")),ge=Sn(p.as("M")),Ot=Sn(p.as("w")),Rn=Sn(p.as("y")),ii=I<=l.ss&&["s",I]||I0,ii[4]=d,A_.apply(null,ii)}function S_(i){return i===void 0?Sn:typeof i=="function"?(Sn=i,!0):!1}function R_(i,s){return eo[i]===void 0?!1:s===void 0?eo[i]:(eo[i]=s,i==="s"&&(eo.ss=s-1),!0)}function F_(i,s){if(!this.isValid())return this.localeData().invalidDate();var l=!1,d=eo,p,I;return typeof i=="object"&&(s=i,i=!1),typeof i=="boolean"&&(l=i),typeof s=="object"&&(d=Object.assign({},eo,s),s.s!=null&&s.ss==null&&(d.ss=s.s-1)),p=this.localeData(),I=k_(this,!l,d,p),l&&(I=p.pastFuture(+this,I)),p.postformat(I)}var zu=Math.abs;function to(i){return(i>0)-(i<0)||+i}function Ba(){if(!this.isValid())return this.localeData().invalidDate();var i=zu(this._milliseconds)/1e3,s=zu(this._days),l=zu(this._months),d,p,I,S,N=this.asSeconds(),ee,ge,Ot,Rn;return N?(d=Ir(i/60),p=Ir(d/60),i%=60,d%=60,I=Ir(l/12),l%=12,S=i?i.toFixed(3).replace(/\.?0+$/,""):"",ee=N<0?"-":"",ge=to(this._months)!==to(N)?"-":"",Ot=to(this._days)!==to(N)?"-":"",Rn=to(this._milliseconds)!==to(N)?"-":"",ee+"P"+(I?ge+I+"Y":"")+(l?ge+l+"M":"")+(s?Ot+s+"D":"")+(p||d||i?"T":"")+(p?Rn+p+"H":"")+(d?Rn+d+"M":"")+(i?Rn+S+"S":"")):"P0D"}var _e=ka.prototype;_e.isValid=wv,_e.abs=t_,_e.add=r_,_e.subtract=n_,_e.as=o_,_e.asMilliseconds=qf,_e.asSeconds=s_,_e.asMinutes=a_,_e.asHours=l_,_e.asDays=u_,_e.asWeeks=c_,_e.asMonths=d_,_e.asQuarters=f_,_e.asYears=m_,_e.valueOf=p_,_e._bubble=i_,_e.clone=h_,_e.get=g_,_e.milliseconds=b_,_e.seconds=v_,_e.minutes=y_,_e.hours=__,_e.days=I_,_e.weeks=x_,_e.months=w_,_e.years=C_,_e.humanize=F_,_e.toISOString=Ba,_e.toString=Ba,_e.toJSON=Ba,_e.locale=Mf,_e.localeData=Uf,_e.toIsoString=ye("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ba),_e.lang=Xf,E("X",0,0,"unix"),E("x",0,0,"valueOf"),W("x",ya),W("X",jg),Re("X",function(i,s,l){l._d=new Date(parseFloat(i)*1e3)}),Re("x",function(i,s,l){l._d=new Date(fe(i))});return e.version="2.30.1",t(Me),e.fn=F,e.min=vv,e.max=yv,e.now=_v,e.utc=g,e.unix=Hy,e.months=jy,e.isDate=h,e.locale=ri,e.invalid=A,e.duration=Nr,e.isMoment=M,e.weekdays=Ky,e.parseZone=Jy,e.localeData=xn,e.isDuration=Sa,e.monthsShort=zy,e.weekdaysMin=e_,e.defineLocale=Yu,e.updateLocale=Jb,e.locales=jb,e.weekdaysShort=qy,e.normalizeUnits=_r,e.relativeTimeRounding=S_,e.relativeTimeThreshold=R_,e.calendarFormat=Ov,e.prototype=F,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e}))});var GC={};Z_(GC,{default:()=>Su});module.exports=Y_(GC);var _s=class{constructor(e){m(this,"deps",e);m(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(o=>o.key()));for(let o of t)if(!this.lastExpiredKeys.has(o)){this.deps.reloadUI(!0);break}if(this.lastExpiredKeys=t,!this.deps.isNotificationEnabled()||this.deps.isNotificationPaused())return;let n;for(let o of e)if(this.deps.isLayoutReady()){if(o.muteNotification)continue;if(n)for(;n.beingDisplayed;)await this.sleep(100);this.deps.showReminder(o),n=o}}async sleep(e){return new Promise(t=>setTimeout(t,e))}};function qu(r){let e=r.lastIndexOf("/");return(e===-1?r:r.slice(e+1)).replace(/\.md$/i,"")}var ec="obr-";function Da(r){return r.startsWith(ec)}var M_=16777619,X_=2166136261,U_=2654435769;function rm(r,e){let t=e;for(let n=0;n>>0}var Q_=`
`;function nm(r,e){return`${r}${Q_}${e}`}function im(r,e,t){let n=nm(r,e),o=rm(n,X_).toString(36),a=rm(n,U_).toString(36),c=`${ec}${o}${a}`;return t===0?c:`${c}-${t}`}function tc(r){var o;let e=[...r].sort((a,c)=>a.file!==c.file?a.fileh)continue;let G=b.get(C);g.set(G,{sequenceId:G,atSeconds:Math.floor(A/1e3),reminder:C})}let v=new Map;for(let C of t)v.set(C.sequenceId,C);let y=[];for(let C of g.values()){let A=v.get(C.sequenceId);(A===void 0||A.atSeconds!==C.atSeconds)&&y.push(C)}let w=[];for(let C of t){if(!Da(C.sequenceId)||g.has(C.sequenceId))continue;let A=_.get(C.sequenceId);(A===void 0||A!==C.atSeconds)&&w.push({sequenceId:C.sequenceId})}return{publish:y,delete:w}}function nc(r){return r.map(e=>e.sequenceId).filter(Da)}var ro=class{constructor(e){m(this,"_value",e)}get value(){return this._value}},oi=class{constructor(e){m(this,"_value",e);m(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 sr=Wr(wr(),1);var $=class r{constructor(e,t){m(this,"time",e);m(this,"_hasTimePart",t)}static now(){return new r((0,sr.default)(),!0)}static parse(e){return e.length>10?new r((0,sr.default)(e,"YYYY-MM-DD HH:mm"),!0):new r((0,sr.default)(e,"YYYY-MM-DD"),!1)}static ofEpochMillis(e){return new r((0,sr.default)(e),!0)}static duration(e,t,n,o){return t.fixedTime(o).diff(e.fixedTime(o),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)}},Na=class r{constructor(e,t){m(this,"hour",e);m(this,"minute",t)}static parse(e){if(!e.match(/^\d{1,2}:\d{1,2}$/))throw`Unexpected format time(${e}). Time must be HH:mm.`;let t=e.split(":");if(t.length!==2)throw`Unexpected format time(${e}). time must be HH:mm.`;let n=parseInt(t[0]),o=parseInt(t[1]);if(n>23||n<0)throw"hour must be 0~23";if(o>59||o<0)throw"minute must be 0~59";return new r(n,o)}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 io(r,e){return()=>new $((0,sr.default)(),!0).add(r,e)}function om(r){return io(r,"minutes")}function oc(r){return io(r,"hours")}function O_(r){return io(r,"days")}function $_(r){return io(r,"weeks")}function P_(r){return io(r,"months")}function H_(r){return io(r,"years")}function ki(r){return()=>{let e=(0,sr.default)();return e.isoWeekday()<=r?new $(e.isoWeekday(r),!1):new $(e.add(1,"weeks").isoWeekday(r),!1)}}function sc(){return()=>new $((0,sr.default)().add(1,"days"),!1)}function sm(){return()=>new $((0,sr.default)().add(1,"weeks"),!1)}function J_(){return()=>new $((0,sr.default)().add(1,"months"),!1)}function j_(){return()=>new $((0,sr.default)().add(1,"years"),!1)}var Xe=class{constructor(e,t){m(this,"label",e);m(this,"later",t)}};function am(r){return r.split(`
`).map(e=>z_(e.trim()))}function z_(r){if(r=r.toLowerCase(),r.startsWith("in")){let e=r.split(" ");if(e.length!==3)throw"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 Xe(`In ${t} ${n}`,om(t))}case"hour":case"hours":{let n=t==1?"hour":"hours";return new Xe(`In ${t} ${n}`,oc(t))}case"day":case"days":{let n=t==1?"day":"days";return new Xe(`In ${t} ${n}`,O_(t))}case"week":case"weeks":{let n=t==1?"week":"weeks";return new Xe(`In ${t} ${n}`,$_(t))}case"month":case"months":{let n=t==1?"month":"months";return new Xe(`In ${t} ${n}`,P_(t))}case"year":case"years":{let n=t==1?"year":"years";return new Xe(`In ${t} ${n}`,H_(t))}}}else if(r.startsWith("next")){let e=r.substring(5);switch(e){case"sunday":return new Xe("Next Sunday",ki(0));case"monday":return new Xe("Next Monday",ki(1));case"tuesday":return new Xe("Next Tuesday",ki(2));case"wednesday":return new Xe("Next Wednesday",ki(3));case"thursday":return new Xe("Next Thursday",ki(4));case"friday":return new Xe("Next Friday",ki(5));case"saturday":return new Xe("Next Saturday",ki(6));case"day":return new Xe("Tomorrow",sc());case"week":return new Xe("Next week",sm());case"month":return new Xe("Next month",J_());case"year":return new Xe("Next year",j_());default:throw`Unsupported weekday: ${e}`}}else if(r==="tomorrow")return new Xe("Tomorrow",sc());throw`Unsupported format: ${r}`}var lc=[new Xe("In 30 minutes",om(30)),new Xe("In 1 hours",oc(1)),new Xe("In 3 hours",oc(3)),new Xe("Tomorrow",sc()),new Xe("Next week",sm())],ac=class{constructor(){m(this,"dateFormat",new ro("YYYY-MM-DD"));m(this,"dateTimeFormat",new ro("YYYY-MM-DD HH:mm"));m(this,"strict",new ro(!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=(0,sr.default)(e,this.dateTimeFormat.value,t);if(n.isValid())return new $(n,!0);let o=(0,sr.default)(e,this.dateFormat.value,t);return o.isValid()?new $(o,!1):null}toString(e){return e.hasTimePart?e.format(this.dateTimeFormat.value):e.format(this.dateFormat.value)}},jr=new ac;var Wa=require("obsidian");var K_=1800*1e3,q_=10*1e3,Is=class{constructor(e){m(this,"deps",e);m(this,"debounceTimer");m(this,"syncing",!1);m(this,"syncQueued",!1);m(this,"stopped",!1);m(this,"previousEnabled")}start(){this.previousEnabled=this.deps.isEnabled(),this.sync(),this.deps.registerInterval(window.setInterval(()=>{this.sync()},K_))}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()},q_))}notifySettingsChanged(){this.stopped||(this.checkEnabledTransition(),this.notifyRemindersChanged())}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 o=await this.fetchPending(t,n),a=nc(o);for(let c of a)await this.deleteScheduled(t,n,c)}catch(o){console.error("[ntfy] Failed to clean up scheduled notifications after disabling: %o",o)}}async sync(){if(this.syncing){this.syncQueued=!0;return}this.syncing=!0;try{await this.doSync()}finally{this.syncing=!1,this.syncQueued&&(this.syncQueued=!1,this.sync())}}async doSync(){if(!this.deps.isEnabled())return;let e=this.resolveServerAndTopic();if(e===void 0)return;let{serverUrl:t,topic:n}=e;try{let o=await this.fetchPending(t,n),a=rc({reminders:this.deps.reminders(),serverPending:o,now:$.now(),defaultTime:this.deps.defaultTime()});for(let c of a.delete)await this.deleteScheduled(t,n,c.sequenceId);for(let c of a.publish)await this.publish(t,n,c)}catch(o){console.error("[ntfy] Failed to sync scheduled notifications: %o",o)}}resolveServerAndTopic(){let e=this.deps.serverUrl().trim().replace(/\/+$/,""),t=this.deps.topic().trim();if(!(e.length===0||t.length===0))return{serverUrl:e,topic:t}}async fetchPending(e,t){let n=await(0,Wa.requestUrl)({url:`${e}/${encodeURIComponent(t)}/json?poll=1&sched=1`,method:"GET",throw:!1});if(n.status>=400)throw new Error(`ntfy: failed to fetch pending scheduled messages: status=${n.status}`);let o=Math.floor(Date.now()/1e3),a=[];for(let c of n.text.split(`
`)){let u=c.trim();if(u.length===0)continue;let f;try{f=JSON.parse(u)}catch(h){console.error("[ntfy] Failed to parse a poll response line: %o",h);continue}f.event!=="message"||f.sequence_id===void 0||f.time===void 0||f.time<=o||a.push({sequenceId:f.sequence_id,atSeconds:f.time})}return a}async publish(e,t,n){let o=await(0,Wa.requestUrl)({url:`${e}/`,method:"POST",headers:{"Content-Type":"application/json","X-Sequence-ID":n.sequenceId},body:JSON.stringify({topic:t,title:n.reminder.title,message:qu(n.reminder.file),click:this.buildClickUrl(n.reminder),delay:String(n.atSeconds)}),throw:!1});o.status>=400&&console.error("[ntfy] Failed to publish a scheduled notification: status=%d",o.status)}async deleteScheduled(e,t,n){let o=await(0,Wa.requestUrl)({url:`${e}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,method:"DELETE",throw:!1});o.status>=400&&console.error("[ntfy] Failed to delete a scheduled notification: status=%d",o.status)}buildClickUrl(e){let t=e.file.replace(/\.md$/i,""),n=encodeURIComponent(this.deps.vaultName()),o=encodeURIComponent(t);return`obsidian://open?vault=${n}&file=${o}`}};var vn=require("obsidian");var Cp=require("obsidian");var lm=require("obsidian");function um(r,e){if(!e.reminders.getExpiredReminders(e.settings.reminderTime.value).some(o=>!o.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 lm.Notice(`Muted ${n} reminder${n===1?"":"s"}`),!0}var uc=require("obsidian");var cm=require("obsidian");var Za=class extends cm.SuggestModal{constructor(t,n,o){super(t);m(this,"laters",n);m(this,"onSelect",o);this.setPlaceholder("Pause reminder notifications for...")}getSuggestions(t){return this.laters.filter(n=>n.label.toLowerCase().includes(t.toLowerCase()))}renderSuggestion(t,n){n.createEl("div",{text:t.label})}onChooseSuggestion(t){this.onSelect(t)}};function eI(r,e){let t=e.later();r.data.dndUntil.value=t,r.data.save(!0),r.ui.refreshDndStatusBar(),new uc.Notice(`Reminder notifications paused until ${t.format("YYYY-MM-DD HH:mm")}`)}function Ya(r){r.data.dndUntil.value=null,r.data.save(!0),r.ui.refreshDndStatusBar(),new uc.Notice("Reminder notifications resumed")}function Ma(r){new Za(r.app,r.settings.laters.value,e=>{eI(r,e)}).open()}function dm(r,e){return r||Ma(e),!0}function oo(r,e){return r==null?!1:e.getTimeInMillis()e===this.check)}setChecked(e){this.check=e?"x":" "}getHeaderLength(){return this.prefix.length+this.check.length+this.suffix.length}clone(){return si.parse(this.lineIndex,this.toMarkdown())}};m(si,"regexp",/^(?((> ?)*)?\s*[-*+][ ]+\[)(?.)(?\]\s+)(?.*)$/),m(si,"checkedStatuses",["x","-"]);var so=si;function hm(r){if(so.parse(0,r)!==null)return r;let e=/^(?(?:> ?)*\s*)(?.*)$/.exec(r),t=e.groups.lead,n=e.groups.rest;if(/^#{1,6}[ ]/.test(n)||/^\d+[.)][ ]/.test(n)||n.startsWith("|")||n.startsWith("```"))return null;let o=/^(?[-*+])[ ]+(?.*)$/.exec(n);if(o){let a=o.groups.marker,c=o.groups.content;return`${t}${a} [ ] ${c}`}return`${t}- [ ] ${n}`}var Xa=class Xa{constructor(e,t){m(this,"file",e);m(this,"lines",[]);m(this,"todos",[]);this.parse(t)}parse(e){this.lines=e.split(`
`),this.todos=[];let t=null,n=0;this.lines.forEach((o,a)=>{let c=Xa.fenceRegexp.exec(o),u=c==null?void 0:c.groups.fence,f=c==null?void 0:c.groups.info;if(t===null){if(u!==void 0&&(u[0]!=="`"||!f.includes("`"))){t=u[0],n=u.length;return}}else{u!==void 0&&u[0]===t&&u.length>=n&&f.trim()===""&&(t=null);return}let h=so.parse(a,o);h&&this.todos.push(h)})}getTodos(){return this.todos}insertTodo(e,t){t.lineIndex=e,this.lines.splice(e,0,t.toMarkdown());let n=-1;for(let o in this.todos){let a=this.todos[o];a.lineIndex>=e&&(n<0&&(n=parseInt(o)),a.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(`
`)}};m(Xa,"fenceRegexp",/^\s*(?:> ?)*\s*(?`{3,}|~{3,})(?.*)$/);var Fn=Xa;var bm=require("obsidian"),gm=window.require?window.require("electron"):void 0;function Ua(){new bm.Notice('Cannot insert a reminder here. Reminders can only be added to task lines such as "- [ ] Task".')}function Qa(r,e,t,n,o){let a=r.appendReminder(e,t,n);if(a!=null)return a;if(!o)return null;let c=hm(e);if(c==null)return null;let u=n==null?void 0:n+(c.length-e.length);return r.appendReminder(c,t,u)}async function vm(r,e){return gm&&(await gm.remote.dialog.showMessageBox({type:"question",title:"Obsidian Reminder",message:r,detail:e,buttons:["OK","Cancel"],cancelId:1})).response===0?0:1}var ao=class r{constructor(e,t,n,o,a){m(this,"file",e);m(this,"title",t);m(this,"time",n);m(this,"rowNumber",o);m(this,"done",a);m(this,"muteNotification",!1);m(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")}},Va=class{constructor(e){m(this,"onChange",e);m(this,"fileToReminders",new Map);m(this,"reminders",[]);m(this,"reminderTime")}getExpiredReminders(e){let t=new Date().getTime(),n=[];for(let o=0;ot.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 o=new Map;for(let a of n)o.set(a.key(),a.muteNotification);for(let a of t){let c=o.get(a.key());o.set(a.key(),a.muteNotification),c!==void 0&&(a.muteNotification=c)}}return this.fileToReminders.set(e,t),this.sortReminders(),!0}equals(e,t){if(e.length!==t.length)return!1;let n=[...e],o=[...t];return this.sort(n),this.sort(o),n.every((a,c)=>a.equals(o[c]))}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 a,c;let o=t.time.getTimeInMillis((a=this.reminderTime)==null?void 0:a.value)-n.time.getTimeInMillis((c=this.reminderTime)==null?void 0:c.value);return o>0?1:o<0?-1:0})}},_m=[{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 ym(r,e,t,n){let o=$.duration(e,r,"days",t);if(o>30)return new ai(r.format(n.yearMonthFormat,t),a=>a.format(n.monthDayFormat,t));if(o>=7)return new ai("Over 1 week",a=>a.format(n.monthDayFormat,t));if(r.toYYYYMMDD(t)===e.toYYYYMMDD(t)){let a=new ai("Today",c=>c.format(n.timeFormat,t));return a.isToday=!0,a}return r.toYYYYMMDD(t)===e.add(1,"days",t).toYYYYMMDD()?new ai("Tomorrow",a=>a.format(n.timeFormat,t)):new ai(r.format(n.shortDateWithWeekdayFormat,t),a=>a.format(n.timeFormat,t))}var ai=class{constructor(e,t){m(this,"name",e);m(this,"timeToStringFunc",t);m(this,"isToday",!1);m(this,"isOverdue",!1)}timeToString(e){return this.timeToStringFunc(e)}};function Im(r,e,t){let n=$.now(),o=n.getTimeInMillis(),a=[],c=[],u=[],f=ym(n,n,e,t);for(let h=0;h0||f.isToday)&&a.push(new ws(f,c)),c=[]),c.push(b),f=_}if(c.length>0&&a.push(new ws(f,c)),u.length>0){let h=new ai("Overdue",b=>b.toYYYYMMDD(e)===n.toYYYYMMDD(e)?b.format(t.timeFormat,e):b.format(t.monthDayFormat,e));h.isOverdue=!0,a.splice(0,0,new ws(h,u))}return a}var ws=class{constructor(e,t){m(this,"group",e);m(this,"reminders",t)}get name(){return this.group.name}get isOverdue(){return this.group.isOverdue}timeToString(e){return this.group.timeToString(e)}};var Nt=class Nt{constructor(e,t){m(this,"key",e);m(this,"defaultValue",t)}};m(Nt,"now",new Nt("now",$.now())),m(Nt,"useCustomEmojiForTasksPlugin",new Nt("useCustomEmojiForTasksPlugin",!1)),m(Nt,"removeTagsForTasksPlugin",new Nt("removeTagsForTasksPlugin",!1)),m(Nt,"useReminderTimeFallbackForTasksPlugin",new Nt("useReminderTimeFallbackForTasksPlugin",!1)),m(Nt,"dataviewReminderFieldName",new Nt("dataviewReminderFieldName","reminder")),m(Nt,"linkDatesToDailyNotes",new Nt("linkDatesToDailyNotes",!1)),m(Nt,"strictDateFormat",new Nt("strictDateFormat",!1));var Qe=Nt,Cs=class{constructor(){m(this,"parameters",new Map)}setParameter(e,t){this.parameters.set(e.key,()=>t.value)}setParameterFunc(e,t){this.parameters.set(e.key,t)}setParameterValue(e,t){this.parameters.set(e.key,()=>t)}getParameter(e){let t=this.parameters.get(e.key);return t==null?e.defaultValue:t()}},li=class{constructor(){m(this,"config",new Cs)}setConfig(e){this.config=e}parse(e){return e.getTodos().map(t=>{let n=this.parseValidReminder(t);if(n==null)return null;let o=n.getTitle();if(o==null)return null;let a=n.getTime();if(a==null)return null;let c=new ao(e.file,o,a,t.lineIndex,t.isChecked()),u=n.computeSpan(),f=t.getHeaderLength();return{reminder:c,columnStart:u.start+f,columnEnd:u.end+f}}).filter(t=>t!=null)}async modify(e,t,n){let o=e.getTodo(t.rowNumber);if(o===null)return console.warn("Not a todo: reminder=%o",t),!1;let a=this.parseValidReminder(o);return a===null||!this.modifyReminder(e,o,a,n)?!1:(o.body=a.toMarkdown(),!0)}parseValidReminder(e){let t=this.parseReminder(e);return t===null||!this.isValidReminder(t)?null:t}isValidReminder(e){return e.getTime()!==null}modifyReminder(e,t,n,o){if(o.rawTime!==void 0){if(!n.setRawTime(o.rawTime))return console.warn("The reminder doesn't support raw time: parsed=%o",n),!1}else o.time!==void 0&&n.setTime(o.time);return o.checked!==void 0&&t.setChecked(o.checked),!0}appendReminder(e,t,n){let o=so.parse(0,e);if(o==null)return null;let a=this.parseReminder(o),c=o.getHeaderLength();return n!=null&&(n-=c),a!=null?a.setTime(t,n):(a=this.newReminder(o.body,t,n),a.setTime(t)),o.body=a.toMarkdown(),{insertedLine:o.toMarkdown(),caretPosition:c+a.getEndOfTimeTextIndex()}}isStrictDateFormat(){return this.config.getParameter(Qe.strictDateFormat)}},La=class{constructor(){m(this,"config");m(this,"formats",[])}setConfig(e){this.config=e,this.syncConfig()}parse(e){let t=[];for(let n of this.formats){let o=n.parse(e);o!=null&&t.push(...o)}return t}async modify(e,t,n){for(let o of this.formats)if(await o.modify(e,t,n))return!0;return!1}resetFormat(e){this.formats=e,this.syncConfig()}syncConfig(){this.config!=null&&this.formats.forEach(e=>e.setConfig(this.config))}appendReminder(e,t){return this.formats[0]==null?null:this.formats[0].appendReminder(e,t)}};var wc=Wr(wr(),1);var wm="(?[[(])(?\\s*)(?[\\p{L}\\p{N}_-]+)::(?\\s*)(?[^[\\]()]*?)(?\\s*)(?[)\\]])";function tI(r,e){return r==="["&&e==="]"?"bracket":r==="("&&e===")"?"paren":null}function Cm(r){let e=new RegExp(wm,"gu"),t=[],n;for(;(n=e.exec(r))!==null;){let o=n.groups,a=tI(o.open,o.close);a!=null&&t.push({key:o.key,value:o.value,style:a,start:n.index,end:n.index+n[0].length})}return t}function xm(r,e,t){let n=r.slice(e.start,e.end),a=new RegExp(`^${wm}$`,"u").exec(n);if(a==null)return r;let c=a.groups,u=c.open.length+c.pre.length+c.key.length+2+c.mid.length,f=c.value.length,h=n.slice(0,u)+t+n.slice(u+f);return r.slice(0,e.start)+h+r.slice(e.end)}function Am(r,e,t,n="bracket"){let[o,a]=n==="bracket"?["[","]"]:["(",")"],c=`${o}${e}:: ${t}${a}`;if(r.length===0)return c;let u=/\s$/.test(r)?"":" ";return`${r}${u}${c}`}function cc(r,e){let t=e.start,n=e.end;return t>0&&r[t-1]===" "?t-=1:n0?"+":"")+String(this.n)+e),e},r.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},r})();var Ne=function(r){return r!=null},ar=function(r){return typeof r=="number"},dc=function(r){return typeof r=="string"&&xs.includes(r)},kt=Array.isArray,Cr=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n>0,n.length>e?String(n):(e=e-n.length,e>t.length&&(t+=me(t,e/t.length)),t.slice(0,e)+String(n))}var Sm=function(r,e,t){var n=r.split(e);return t?n.slice(0,t).concat([n.slice(t).join(e)]):n},Wt=function(r,e){var t=r%e;return t*e<0?t+e:t},Oa=function(r,e){return{div:Math.floor(r/e),mod:Wt(r,e)}},lr=function(r){return!Ne(r)||r.length===0},ze=function(r){return!lr(r)},be=function(r,e){return ze(r)&&r.indexOf(e)!==-1};var zr=function(r,e,t,n,o,a){return n===void 0&&(n=0),o===void 0&&(o=0),a===void 0&&(a=0),new Date(Date.UTC(r,e-1,t,n,o,a))},rI=[31,28,31,30,31,30,31,31,30,31,30,31],Fm=1e3*60*60*24,$a=9999,Tm=zr(1970,1,1),nI=[6,0,1,2,3,4,5];var lo=function(r){return r%4===0&&r%100!==0||r%400===0},fc=function(r){return r instanceof Date},Ri=function(r){return fc(r)&&!isNaN(r.getTime())};var iI=function(r,e){var t=r.getTime(),n=e.getTime(),o=t-n;return Math.round(o/Fm)},As=function(r){return iI(r,Tm)},Pa=function(r){return new Date(Tm.getTime()+r*Fm)},oI=function(r){var e=r.getUTCMonth();return e===1&&lo(r.getUTCFullYear())?29:rI[e]},Tn=function(r){return nI[r.getUTCDay()]},mc=function(r,e){var t=zr(r,e+1,1);return[Tn(t),oI(t)]},Ha=function(r,e){return e=e||r,new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},Ja=function(r){var e=new Date(r.getTime());return e},pc=function(r){for(var e=[],t=0;tthis.maxDate;if(this.method==="between"){if(t)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return t?!0:(this.add(e),!1);return this.add(e)},r.prototype.add=function(e){return this._result.push(e),!0},r.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;default:return e.length?e[e.length-1]:null}},r.prototype.clone=function(){return new r(this.method,this.args)},r})(),Gn=sI;var hc=function(r,e){return hc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},hc(r,e)};function co(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");hc(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var St=function(){return St=Object.assign||function(e){for(var t,n=1,o=arguments.length;ne[0].length)&&(e=a,t=o)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(t==="SKIP");return this.symbol=t,this.value=e,!0},r.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},r.prototype.acceptNumber=function(){return this.accept("number")},r.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},r})();function Ss(r,e){e===void 0&&(e=Fi);var t={},n=new fI(e.tokens);if(!n.start(r))return null;return o(),t;function o(){n.expect("every");var g=n.acceptNumber();if(g&&(t.interval=parseInt(g[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":t.freq=U.DAILY,n.nextSymbol()&&(c(),_());break;case"weekday(s)":t.freq=U.WEEKLY,t.byweekday=[U.MO,U.TU,U.WE,U.TH,U.FR],n.nextSymbol(),c(),_();break;case"week(s)":t.freq=U.WEEKLY,n.nextSymbol()&&(a(),c(),_());break;case"hour(s)":t.freq=U.HOURLY,n.nextSymbol()&&(a(),_());break;case"minute(s)":t.freq=U.MINUTELY,n.nextSymbol()&&(a(),_());break;case"month(s)":t.freq=U.MONTHLY,n.nextSymbol()&&(a(),_());break;case"year(s)":t.freq=U.YEARLY,n.nextSymbol()&&(a(),_());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":t.freq=U.WEEKLY;var v=n.symbol.substr(0,2).toUpperCase();if(t.byweekday=[U[v]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var y=f();if(!y)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");t.byweekday.push(U[y]),n.nextSymbol()}c(),b(),_();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(t.freq=U.YEARLY,t.bymonth=[u()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var w=u();if(!w)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(w),n.nextSymbol()}a(),_();break;default:throw new Error("Unknown symbol")}}function a(){var g=n.accept("on"),v=n.accept("the");if(g||v)do{var y=h(),w=f(),C=u();if(y)w?(n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(U[w].nth(y))):(t.bymonthday||(t.bymonthday=[]),t.bymonthday.push(y),n.accept("day(s)"));else if(w)n.nextSymbol(),t.byweekday||(t.byweekday=[]),t.byweekday.push(U[w]);else if(n.symbol==="weekday(s)")n.nextSymbol(),t.byweekday||(t.byweekday=[U.MO,U.TU,U.WE,U.TH,U.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var A=n.acceptNumber();if(!A)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(A[0],10)];n.accept("comma");){if(A=n.acceptNumber(),!A)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(A[0],10))}}else if(C)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(C);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function c(){var g=n.accept("at");if(g)do{var v=n.acceptNumber();if(!v)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(t.byhour=[parseInt(v[0],10)];n.accept("comma");){if(v=n.acceptNumber(),!v)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");t.byhour.push(parseInt(v[0],10))}}while(n.accept("comma")||n.accept("at"))}function u(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function f(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function h(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var g=parseInt(n.value[1],10);if(g<-366||g>366)throw new Error("Nth out of range: "+g);return n.nextSymbol(),n.accept("last")?-g:g;default:return!1}}function b(){n.accept("on"),n.accept("the");var g=h();if(g)for(t.bymonthday=[g],n.nextSymbol();n.accept("comma");){if(g=h(),!g)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(g),n.nextSymbol()}}function _(){if(n.symbol==="until"){var g=Date.parse(n.text);if(!g)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(g)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var ue;(function(r){r[r.YEARLY=0]="YEARLY",r[r.MONTHLY=1]="MONTHLY",r[r.WEEKLY=2]="WEEKLY",r[r.DAILY=3]="DAILY",r[r.HOURLY=4]="HOURLY",r[r.MINUTELY=5]="MINUTELY",r[r.SECONDLY=6]="SECONDLY"})(ue||(ue={}));function Rs(r){return r12){var n=Math.floor(this.month/12),o=Wt(this.month,12);this.month=o,this.year+=n,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(t,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+t*7:this.day+=-(this.getWeekday()-n)+t*7,this.fixDay()},e.prototype.addDaily=function(t){this.day+=t,this.fixDay()},e.prototype.addHours=function(t,n,o){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var a=Oa(this.hour,24),c=a.div,u=a.mod;if(c&&(this.hour=u,this.addDaily(c)),lr(o)||be(o,this.hour))break}},e.prototype.addMinutes=function(t,n,o,a){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var c=Oa(this.minute,60),u=c.div,f=c.mod;if(u&&(this.minute=f,this.addHours(u,!1,o)),(lr(o)||be(o,this.hour))&&(lr(a)||be(a,this.minute)))break}},e.prototype.addSeconds=function(t,n,o,a,c){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var u=Oa(this.second,60),f=u.div,h=u.mod;if(f&&(this.second=h,this.addMinutes(f,!1,o,a)),(lr(o)||be(o,this.hour))&&(lr(a)||be(a,this.minute))&&(lr(c)||be(c,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=mc(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,this.month===13&&(this.month=1,++this.year,this.year>$a))return;t=mc(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var o=t.freq,a=t.interval,c=t.wkst,u=t.byhour,f=t.byminute,h=t.bysecond;switch(o){case ue.YEARLY:return this.addYears(a);case ue.MONTHLY:return this.addMonths(a);case ue.WEEKLY:return this.addWeekly(a,c);case ue.DAILY:return this.addDaily(a);case ue.HOURLY:return this.addHours(a,n,u);case ue.MINUTELY:return this.addMinutes(a,n,u,f);case ue.SECONDLY:return this.addSeconds(a,n,u,f,h)}},e})(mo);function bc(r){for(var e=[],t=Object.keys(r),n=0,o=t;n=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(e.byweekno||ze(e.byweekno)||ze(e.byyearday)||e.bymonthday||ze(e.bymonthday)||Ne(e.byweekday)||Ne(e.byeaster)))switch(e.freq){case U.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case U.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case U.WEEKLY:e.byweekday=[Tn(e.dtstart)];break}if(Ne(e.bymonth)&&!kt(e.bymonth)&&(e.bymonth=[e.bymonth]),Ne(e.byyearday)&&!kt(e.byyearday)&&ar(e.byyearday)&&(e.byyearday=[e.byyearday]),!Ne(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(kt(e.bymonthday)){for(var o=[],a=[],t=0;t0?o.push(n):n<0&&a.push(n)}e.bymonthday=o,e.bynmonthday=a}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(Ne(e.byweekno)&&!kt(e.byweekno)&&(e.byweekno=[e.byweekno]),!Ne(e.byweekday))e.bynweekday=null;else if(ar(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(dc(e.byweekday))e.byweekday=[nt.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof nt)!e.byweekday.n||e.freq>U.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var c=[],u=[],t=0;tU.MONTHLY?c.push(f.weekday):u.push([f.weekday,f.n])}e.byweekday=ze(c)?c:null,e.bynweekday=ze(u)?u:null}return Ne(e.byhour)?ar(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq=4?(b=0,h=u.yearlen+Wt(c-e.wkst,7)):h=n-b;for(var _=Math.floor(h/7),g=Wt(h,7),v=Math.floor(_+g/4),y=0;y0&&w<=v){var C=void 0;w>1?(C=b+(w-1)*7,b!==f&&(C-=7-f)):C=b;for(var A=0;A<7&&(u.wnomask[C]=1,C++,u.wdaymask[C]!==e.wkst);A++);}}if(be(e.byweekno,1)){var C=b+v*7;if(b!==f&&(C-=7-f),C=4?(te=0,M=le+Wt(Z-e.wkst,7)):M=n-b,G=Math.floor(52+Wt(M,7)/4)}if(be(e.byweekno,G))for(var C=0;Ca)return Bn(r);if(G>=t){var Z=rp(G,e);if(!r.accept(Z)||u&&(--u,!u))return Bn(r)}}else for(var A=v;Aa)return Bn(r);if(G>=t){var Z=rp(G,e);if(!r.accept(Z)||u&&(--u,!u))return Bn(r)}}}if(e.interval===0||(f.add(e,w),f.year>$a))return Bn(r);Rs(n)||(b=h.gettimeset(n)(f.hour,f.minute,f.second,0)),h.rebuild(f.year,f.month)}}function xI(r,e,t){var n=t.bymonth,o=t.byweekno,a=t.byweekday,c=t.byeaster,u=t.bymonthday,f=t.bynmonthday,h=t.byyearday;return ze(n)&&!be(n,r.mmask[e])||ze(o)&&!r.wnomask[e]||ze(a)&&!be(a,r.wdaymask[e])||ze(r.nwdaymask)&&!r.nwdaymask[e]||c!==null&&!be(r.eastermask,e)||(ze(u)||ze(f))&&!be(u,r.mdaymask[e])&&!be(f,r.nmdaymask[e])||ze(h)&&(e=r.yearlen&&!be(h,e+1-r.yearlen)&&!be(h,-r.nextyearlen+e-r.yearlen))}function rp(r,e){return new Ti(r,e.tzid).rezonedDate()}function Bn(r){return r.getValue()}function AI(r,e,t,n,o){for(var a=!1,c=e;c=U.HOURLY&&ze(o)&&!be(o,e.hour)||n>=U.MINUTELY&&ze(a)&&!be(a,e.minute)||n>=U.SECONDLY&&ze(c)&&!be(c,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var xr={MO:new nt(0),TU:new nt(1),WE:new nt(2),TH:new nt(3),FR:new nt(4),SA:new nt(5),SU:new nt(6)},Fs={freq:ue.YEARLY,dtstart:null,interval:1,wkst:xr.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},Mm=Object.keys(Fs),U=(function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new Qm,this.origOptions=bc(e);var n=Zm(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return Ss(e,t)},r.fromText=function(e,t){return Bm(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return ja(e,this.options)},r.prototype._cacheGet=function(e,t){return this._cache?this._cache._cacheGet(e,t):!1},r.prototype._cacheAdd=function(e,t,n){if(this._cache)return this._cache._cacheAdd(e,t,n)},r.prototype.all=function(e){if(e)return this._iter(new gc("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new Gn("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,o){if(n===void 0&&(n=!1),!Ri(e)||!Ri(t))throw new Error("Invalid date passed in to RRule.between");var a={before:t,after:e,inc:n};if(o)return this._iter(new gc("between",a,o));var c=this._cacheGet("between",a);return c===!1&&(c=this._iter(new Gn("between",a)),this._cacheAdd("between",c,a)),c},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!Ri(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},o=this._cacheGet("before",n);return o===!1&&(o=this._iter(new Gn("before",n)),this._cacheAdd("before",o,n)),o},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!Ri(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},o=this._cacheGet("after",n);return o===!1&&(o=this._iter(new Gn("after",n)),this._cacheAdd("after",o,n)),o},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return Gs(this.origOptions)},r.prototype.toText=function(e,t,n){return Dm(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return Nm(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=ue.YEARLY,r.MONTHLY=ue.MONTHLY,r.WEEKLY=ue.WEEKLY,r.DAILY=ue.DAILY,r.HOURLY=ue.HOURLY,r.MINUTELY=ue.MINUTELY,r.SECONDLY=ue.SECONDLY,r.MO=xr.MO,r.TU=xr.TU,r.WE=xr.WE,r.TH=xr.TH,r.FR=xr.FR,r.SA=xr.SA,r.SU=xr.SU,r.parseString=Es,r.optionsToString=Gs,r})();function np(r,e,t,n,o,a){var c={},u=r.accept;function f(g,v){t.forEach(function(y){y.between(g,v,!0).forEach(function(w){c[Number(w)]=!0})})}o.forEach(function(g){var v=new Ti(g,a).rezonedDate();c[Number(v)]=!0}),r.accept=function(g){var v=Number(g);return isNaN(v)?u.call(this,g):!c[v]&&(f(new Date(v-1),new Date(v+1)),!c[v])?(c[v]=!0,u.call(this,g)):!0},r.method==="between"&&(f(r.args.after,r.args.before),r.accept=function(g){var v=Number(g);return c[v]?!0:(c[v]=!0,u.call(this,g))});for(var h=0;h1||o.length||a.length||c.length){var b=new _c(h);return b.dtstart(u),b.tzid(f||void 0),n.forEach(function(g){b.rrule(new U(yc(g,u,f),h))}),o.forEach(function(g){b.rdate(g)}),a.forEach(function(g){b.exrule(new U(yc(g,u,f),h))}),c.forEach(function(g){b.exdate(g)}),e.compatible&&e.dtstart&&b.rdate(u),b}var _=n[0]||{};return new U(yc(_,_.dtstart||e.dtstart||u,_.tzid||e.tzid||f),h)}function za(r,e){return e===void 0&&(e={}),RI(r,FI(e))}function yc(r,e,t){return St(St({},r),{dtstart:e,tzid:t})}function FI(r){var e=[],t=Object.keys(r),n=Object.keys(ip);if(t.forEach(function(o){be(n,o)||e.push(o)}),e.length)throw new Error("Invalid options: "+e.join(", "));return St(St({},ip),r)}function TI(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=Sm(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function EI(r){var e=TI(r),t=e.name,n=e.value,o=t.split(";");if(!o)throw new Error("empty property name");return{name:o[0].toUpperCase(),parms:o.slice(1),value:n}}function GI(r,e){if(e===void 0&&(e=!1),r=r&&r.trim(),!r)throw new Error("Invalid empty string");if(!e)return r.split(/\s/);for(var t=r.split(`
`),n=0;n0&&o[0]===" "?(t[n-1]+=o.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function BI(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function op(r,e){return BI(e),r.split(",").map(function(t){return ks(t)})}function sp(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;nt.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(Ei)!=null}reminderSourceField(){var e;return(e=this.firstField(this.reminderFieldName))!=null?e:this.firstField(Ei)}getTitle(){let e=new Set([...ZI,this.reminderFieldName]),t=this.fields().filter(o=>e.has(o.key.toLowerCase())).sort((o,a)=>a.start-o.start),n=this.text;for(let o of t)n=cc(n,o);return n=n.trim(),this.removeTags&&(n=qa(n)),n}getTime(){let e=this.reminderSourceField();return e==null?null:Ic(e.value)}setTime(e){var o;let t=this.reminderSourceField(),n=(o=t==null?void 0:t.key)!=null?o:Ei;this.setFieldValue(n,cp(e))}setRawTime(e){var o;let t=this.reminderSourceField(),n=(o=t==null?void 0:t.key)!=null?o:Ei;return this.setFieldValue(n,e),!0}getDueDate(){let e=this.firstField(Ei);return e==null?null:Ic(e.value)}setDueDate(e){this.setFieldValue(Ei,cp(e))}getRecurrence(){var t;let e=this.firstField(dp);return(t=e==null?void 0:e.value)!=null?t:null}getDoneDate(){let e=this.firstField(el);return e==null?null:Ic(e.value)}setDoneDate(e){if(e==null){this.removeFieldByKey(el);return}let t=e instanceof $?e.format(Cc):e;this.setFieldValue(el,t)}getEndOfTimeTextIndex(){let e=this.reminderSourceField();return e!=null?e.end:this.toMarkdown().length}computeSpan(){let e=this.reminderSourceField();return e==null?{start:0,end:0}:{start:e.start,end:e.end}}toMarkdown(){return this.text}clone(){return r.parse(this.toMarkdown(),this.reminderFieldName,this.removeTags)}setFieldValue(e,t){let n=this.firstField(e);n!=null?this.text=xm(this.text,n,t):this.text=Am(this.text,e,t,"bracket")}removeFieldByKey(e){let t=this.firstField(e);t!=null&&(this.text=cc(this.text,t))}},nl=class nl extends ho{parseReminder(e){let t=tl.parse(e.body,this.reminderFieldName(),this.removeTagsEnabled());return t.hasAnySourceField()?t:null}reminderFieldName(){return this.config.getParameter(Qe.dataviewReminderFieldName)}removeTagsEnabled(){return this.config.getParameter(Qe.removeTagsForTasksPlugin)}usesSeparateReminderDate(e){return e.hasReminderField()}newReminder(e,t){let n=tl.parse(e,this.reminderFieldName(),this.removeTagsEnabled());return n.setTime(t),n}};m(nl,"instance",new nl);var rl=nl;var fp=Wr(wr(),1);var qr=class qr{constructor(e,t,n,o,a=null){m(this,"linkDatesToDailyNotes",e);m(this,"title1",t);m(this,"time",n);m(this,"title2",o);m(this,"recurrence",a)}static parse(e,t){t==null&&(t=!1);let n=qr.regexp.exec(e);if(n==null)return null;let o=n.groups.title1,a=n.groups.time;if(a==null)return null;let c=n.groups.title2;t&&(a=a.replace("[[",""),a=a.replace("]]",""));let u=null,f=a.indexOf(qr.recurrenceSymbol);if(f>=0){let h=a.substring(0,f).trim(),b=a.substring(f+qr.recurrenceSymbol.length).trim();b!==""&&(a=h,u=b)}return new qr(t,o,a,c,u)}getTitle(){return`${this.title1.trim()} ${this.title2.trim()}`.trim()}getTime(){return jr.parse(this.time)}setTime(e){this.time=jr.toString(e)}setRawTime(e){return this.time=e,!0}getEndOfTimeTextIndex(){return this.toMarkdown().length-this.title2.length}computeSpan(){let e=this.title1.length,t=this.computeGroupText();return{start:e,end:e+t.length}}toMarkdown(){return`${this.title1}${this.computeGroupText()}${this.title2}`}computeGroupText(){let e=this.recurrence!==null?`${this.time} ${qr.recurrenceSymbol}${this.recurrence}`:this.time;return`(@${this.renderTimeText(e)})`}renderTimeText(e){if(!this.linkDatesToDailyNotes)return e;let t=jr.parse(this.time);if(!t)return e;let n=jr.toString(t.clone(!1));return e.replace(n,`[[${n}]]`)}clone(){return qr.parse(this.toMarkdown(),this.linkDatesToDailyNotes)}};m(qr,"regexp",/^(?.*?)\(@(?.+?)\)(?.*)$/),m(qr,"recurrenceSymbol","\u{1F501}");var il=qr,ol=class ol extends li{parseReminder(e){return il.parse(e.body,this.linkDatesToDailyNotes())}modifyReminder(e,t,n,o){if(!super.modifyReminder(e,t,n,o))return!1;if(o.checked===!0){let a=n.recurrence;if(a!==null){let c=n.getTime();if(c!==null){let u=po(a,c.moment(),this.config.getParameter(Qe.now));if(u!==void 0){let f=n.clone();f.setTime(new $((0,fp.default)(u),c.hasTimePart));let h=t.clone();h.body=f.toMarkdown(),h.setChecked(!1),e.insertTodo(t.lineIndex,h)}}}}return!0}newReminder(e,t,n){let o,a;return n!=null?(o=e.substring(0,n),a=e.substring(n)):(o=e,a=""),new il(this.linkDatesToDailyNotes(),o,t.toString(),a)}linkDatesToDailyNotes(){return this.config.getParameter(Qe.linkDatesToDailyNotes)}};m(ol,"instance",new ol);var go=ol;var xc=Wr(wr(),1);function sl(r){return r.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}var YI=new class{get dateTrigger(){return this.get("date-trigger","@")}get dateFormat(){return this.get("date-format","YYYY-MM-DD")}get timeTrigger(){return this.get("time-trigger","@@")}get timeFormat(){return this.get("time-format","HH:mm")}get linkDateToDailyNote(){return this.get("link-date-to-daily-note",!1)}get(e,t){var u,f;if(!window)return t;let n=(f=(u=window==null?void 0:window.app)==null?void 0:u.plugins)==null?void 0:f.plugins;if(!n)return t;let o=n["obsidian-kanban"];if(!o||!o.settings)return t;let c=o.settings[e];return c==null?t:c}},ul=class ul{constructor(e){m(this,"setting",e)}get dateRegExp(){return this.setting.linkDateToDailyNote?new RegExp(`${sl(this.setting.dateTrigger)}\\[\\[(?.+?)\\]\\]`):new RegExp(`${sl(this.setting.dateTrigger)}\\{(?.+?)\\}`)}get timeRegExp(){return new RegExp(`${sl(this.setting.timeTrigger)}\\{(?.+?)\\}`)}format(e){let t;return this.setting.linkDateToDailyNote?t=`${this.setting.dateTrigger}[[${e.format(this.setting.dateFormat)}]]`:t=`${this.setting.dateTrigger}{${e.format(this.setting.dateFormat)}}`,e.hasTimePart?`${t} ${this.setting.timeTrigger}{${e.format(this.setting.timeFormat)}}`:t}split(e,t){let n=e,o,a,c=this.dateRegExp,u=c.exec(e);if(u)o=u.groups.date,e=e.replace(c,"");else return{title:n};let f=u.index,h=f+u[0].length,b={start:f,end:h},_=this.timeRegExp,g=_.exec(e);if(g){a=g.groups.time,e=e.replace(_,"");let C=g.index>=f?g.index+u[0].length:g.index,A=C+g[0].length;b={start:Math.min(f,C),end:Math.max(h,A)}}let v=e.trim();if(a){let C=[this.setting.timeFormat,...["h:mm A","hh:mm A","HH:mm"].filter(A=>A!==this.setting.timeFormat)];for(let A of C){let G=(0,xc.default)(`${o} ${a}`,`${this.setting.dateFormat} ${A}`,!0);if(G.isValid())return{title:v,time:new $(G,!0),span:b}}return{title:n}}let y=t!=null?t:!0,w=new $((0,xc.default)(o,this.setting.dateFormat,y),!1);return w.isValid()?{title:v,time:w,span:b}:{title:n}}};m(ul,"instance",new ul(YI));var Bs=ul,al=class r{constructor(e,t,n){m(this,"title",e);m(this,"time",t);m(this,"span",n)}static parse(e,t){let n=Bs.instance.split(e,t);return n.time==null?null:new r(n.title,n.time,n.span)}getTitle(){return this.title.trim()}getTime(){return this.time?this.time:null}setTime(e){this.time=e,this.span=void 0}setRawTime(){return!1}getEndOfTimeTextIndex(){return this.toMarkdown().length}computeSpan(){if(this.span)return this.span;let e=this.title.trim().length+1,t=e+Bs.instance.format(this.time).length;return{start:e,end:t}}toMarkdown(){return`${this.title.trim()} ${Bs.instance.format(this.time)}`}},cl=class cl extends li{parseReminder(e){return al.parse(e.body,this.isStrictDateFormat())}newReminder(e,t){let n=new al(e,t);return n.setTime(t),n}};m(cl,"instance",new cl);var ll=cl;var Ac=Wr(wr(),1);var Zr=class r{constructor(e,t){m(this,"primary",e);m(this,"func",t)}static ofChar(e){return new r(e,t=>t===e)}static ofChars(e){if(e.length===0)throw"empty symbol";if(e[0]==null)throw"ch mustn't be null";return e.length===0?this.ofChar(e[0]):new r(e[0],t=>e.filter(n=>t===n).length>0)}isSymbol(e){return this.func(e)}},dl=class{constructor(e){m(this,"tokens",e)}setTokenText(e,t,n=!1,o=!1,a=!1,c){let u=this.getToken(e);if(u===null){if(!o)return null;if(e instanceof Zr?u={symbol:e.primary,text:t}:u={symbol:e,text:t},a&&u.symbol!==""&&!u.text.startsWith(" ")&&(u.text=" "+u.text),this.tokens.length>0){let f=this.tokens[this.tokens.length-1];this.isTokenEndsWithSpace(f)||(f.text+=" ")}if(c==null)this.tokens.push(u);else{let f=0,h=-1,b=0;for(let _ of this.tokens){let g=f+_.symbol.length+_.text.length;if(b>0&&g>c){h=b;break}f=g,b++}h==-1?this.tokens.push(u):(this.tokens.splice(h,0,u),h!e.isSymbol(t.symbol))}forEachTokens(e){this.tokens.forEach(e)}rangeOfSymbol(e){let t=0;for(let n of this.tokens){let o=t+n.symbol.length+n.text.length;if(e.isSymbol(n.symbol))return{start:t,end:o};t=o}}join(){return this.tokens.map(e=>e.symbol+e.text).join("")}};function mp(r,e){let t=[...r],n="",o=null,a=[],c=()=>{o===null?a.push({symbol:"",text:n}):o.text=n};return t.forEach(u=>{e.filter(h=>h.isSymbol(u)).length>0?(c(),o={symbol:u,text:""},a.push(o),n=""):o!==null&&u==="#"&&(n.length===0||/\s$/.test(n))?(c(),o=null,n=u):n+=u}),n.length>0&&c(),a}var oe=class oe{constructor(e,t,n,o,a){m(this,"useCustomEmoji",e);m(this,"removeTags",t);m(this,"strictDateFormat",n);m(this,"useDueDateFallback",o);m(this,"tokens",a)}static parse(e,t,n,o,a){return new oe(t!=null?t:!1,n!=null?n:!1,o!=null?o:!0,a!=null?a:!1,new dl(mp(e,this.allSymbols)))}getTitle(){let e=this.tokens.getTokenText("",!0);return e!=null&&this.removeTags&&(e=qa(e)),e}getTime(){return this.getDate(this.resolveReminderSymbol())}setTime(e,t){this.useCustomEmoji?this.setDate(this.writeReminderSymbol(),e,1):this.setDate(this.writeReminderSymbol(),e,t)}getDueDate(){return this.getDate(oe.symbolDueDate)}setDueDate(e){this.setDate(oe.symbolDueDate,e)}setRawTime(e){return this.setDate(this.writeReminderSymbol(),e),!0}resolveReminderSymbol(){if(!this.useCustomEmoji)return oe.symbolDueDate;if(!this.useDueDateFallback)return oe.symbolReminder;let e=[oe.symbolReminder,oe.symbolDueDate,oe.symbolScheduled,oe.symbolStart];for(let t of e)if(this.tokens.getToken(t)!=null)return t;return oe.symbolReminder}writeReminderSymbol(){return this.useCustomEmoji?oe.symbolReminder:oe.symbolDueDate}getEndOfTimeTextIndex(){let e=this.tokens.rangeOfSymbol(this.resolveReminderSymbol());return e!=null?e.end:this.toMarkdown().length}computeSpan(){let e=this.resolveReminderSymbol(),t=this.tokens.rangeOfSymbol(e),n=this.tokens.getToken(e);if(t==null||n==null)return{start:0,end:0};let o=n.text.replace(/\s+$/,"").length;return{start:t.start,end:t.start+n.symbol.length+o}}toMarkdown(){return this.tokens.join()}setTitle(e){this.tokens.setTokenText("",e,!0,!0)}getDoneDate(){return this.getDate(oe.symbolDoneDate)}setDoneDate(e){this.setDate(oe.symbolDoneDate,e)}getRecurrence(){return this.tokens.getTokenText(oe.symbolRecurrence,!0)}clone(){return oe.parse(this.toMarkdown(),this.useCustomEmoji,this.removeTags,this.strictDateFormat,this.useDueDateFallback)}getDate(e){let t=this.tokens.getTokenText(e,!0);if(t===null)return null;if(e===oe.symbolReminder)return jr.parse(t);if(e===oe.symbolDueDate){let o=(0,Ac.default)(t,oe.dueDateTimeFormat,!0);if(o.isValid())return new $(o,!0)}let n=(0,Ac.default)(t,oe.dateFormat,this.strictDateFormat);return n.isValid()?new $(n,!1):null}setDate(e,t,n){if(t==null){this.tokens.removeToken(e);return}let o;t instanceof $?e===oe.symbolReminder?o=jr.toString(t):e===oe.symbolDueDate&&t.hasTimePart?o=t.format(oe.dueDateTimeFormat):o=t.format(oe.dateFormat):o=t,this.tokens.setTokenText(e,o,!0,!0,this.shouldSplitBetweenSymbolAndText(),n)}shouldSplitBetweenSymbolAndText(){let e=0,t=0;return this.tokens.forEachTokens(n=>{n.symbol!==""&&(n.text.match(/^\s.*$/)?e+=1:t++)}),e>t?!0:!(ee.format))}function hp(r){bo.setConfig(r)}var kc=new vo("ReminderPluginReminderFormat","Reminder plugin format","(@2021-09-08)",go.instance,!0),Sc=new vo("TasksPluginReminderFormat","Tasks plugin format","\u{1F4C5} 2021-09-08",ml.instance,!1),Rc=new vo("KanbanPluginReminderFormat","Kanban plugin format","@{2021-09-08}",ll.instance,!1),Fc=new vo("DataviewReminderFormat","Dataview format","[due:: 2021-09-08]",rl.instance,!1),_o=[kc,Sc,Rc,Fc];var Dn=class{constructor(e,t){m(this,"doc");this.doc=new Fn(e,t)}getReminders(e=!0){let t=yo(this.doc).map(n=>n.reminder);return e?t.filter(n=>!n.done):t}getTodos(){return this.doc.getTodos()}async modifyReminderLines(e){for(let t of this.getReminders(!1)){let n=e(t);if(n===null)return;await this.modifyReminderLine(t,n)}}async updateReminder(e,t){await this.modifyReminderLine(e,t)}async modifyReminderLine(e,t){let n=await hl(this.doc,e,t);return n?console.debug("Reminder was updated: reminder=%o",e):console.warn("Cannot modify reminder because it's not a reminder todo: reminder=%o",e),n}getContent(){return this.doc.toMarkdown()}};var gp=require("obsidian");var gl=class extends gp.FuzzySuggestModal{constructor(t,n,o){super(t);m(this,"suggestions",n);m(this,"onChooseSuggestionFunc",o)}getItems(){return this.suggestions}getItemText(t){return t}onChooseItem(t){this.onChooseSuggestionFunc(t)}};function bp(r,e){new gl(r,["YYYY-MM-DD","YYYY/MM/DD","DD-MM-YYYY","DD/MM/YYYY"],t=>{new gl(r,["YYYY-MM-DD HH:mm","YYYY/MM/DD HH:mm","DD-MM-YYYY HH:mm","DD/MM/YYYY HH:mm","YYYY-MM-DDTHH:mm:ss:SSS"],n=>{e(t,n)}).open()}).open()}async function MI(r,e,t){let n=0,o=r.app.vault;for(let a of o.getMarkdownFiles()){let c=new Dn(a.path,await o.read(a)),u=0;await c.modifyReminderLines(f=>{let h;return f.time.hasTimePart?h=f.time.format(t):h=f.time.format(e),n++,u++,{rawTime:h}}),u>0&&await o.modify(a,c.getContent())}return r.settings.dateFormat.rawValue.value=e,r.settings.dateTimeFormat.rawValue.value=t,n>0&&await r.fileSystem.reloadRemindersInAllFiles(),n}function vp(r,e){return r||vm("Convert reminder time format","This command rewrite reminder dates in all markdown files. You should make a backup of your vault before you execute this. May I continue to convert?").then(t=>{t===0&&bp(e.app,(n,o)=>{MI(e,n,o).catch(()=>{})})}),!0}function yp(r,e,t){if(r)return!0;t.showAutoComplete(e)}async function XI(r,e,t){if(!r.fileSystem.isMarkdownFile(e))return;let n=r.app.vault,o=new Dn(e.path,await n.read(e)),a=o.getReminders(!1).find(c=>c.rowNumber===t);if(a)await o.updateReminder(a,{checked:!a.done});else{let c=o.getTodos().find(u=>u.lineIndex===t);if(!c)return;c.setChecked(!c.isChecked())}await n.modify(e,o.getContent())}function _p(r,e,t){if(r)return!0;e&&e.file&&XI(t,e.file,e.editor.getCursor().line)}var Ip=require("obsidian");var bl=class extends Ip.SuggestModal{constructor(t,n){super(t);m(this,"onSelect",n)}getSuggestions(t){return _m.filter(n=>n.name.toLowerCase().includes(t.toLowerCase()))}renderSuggestion(t,n){let o=n.createDiv({cls:"reminder-preset-suggestion"}),a=o.createEl("div",{text:t.name,cls:"reminder-preset-title"}),c=$.now(),u=o.createDiv({cls:"reminder-preset-previews"});u.createEl("div",{cls:"reminder-preset-preview-line",text:"Year/Month: "+c.format(t.format.yearMonthFormat)}),u.createEl("div",{cls:"reminder-preset-preview-line",text:"Month/Day: "+c.format(t.format.monthDayFormat)}),u.createEl("div",{cls:"reminder-preset-preview-line",text:"Short: "+c.format(t.format.shortDateWithWeekdayFormat)}),u.createEl("div",{cls:"reminder-preset-preview-line",text:"Time: "+c.format(t.format.timeFormat)}),a.style.fontWeight="600",a.style.marginBottom="4px",u.style.opacity="0.8",u.style.fontSize="12px",u.style.display="grid",u.style.gridAutoRows="min-content",u.style.rowGap="2px"}onChooseSuggestion(t){this.onSelect(t)}};function wp(r,e){return r||new bl(e.app,t=>{e.data.settings.monthDayDisplayFormat.rawValue.value=t.format.monthDayFormat,e.data.settings.yearMonthDisplayFormat.rawValue.value=t.format.yearMonthFormat,e.data.settings.shortDateWithWeekdayDisplayFormat.rawValue.value=t.format.shortDateWithWeekdayFormat,e.data.settings.timeDisplayFormat.rawValue.value=t.format.timeFormat,e.data.save(!0),e.ui.invalidate(),e.ui.reload(!0)}).open(),!0}function xp(r){r.addCommand({id:"scan-reminders",name:"Scan reminders",checkCallback:e=>mm(e,r)}),r.addCommand({id:"show-reminders",name:"Show reminders",checkCallback:e=>pm(e,r.ui)}),r.addCommand({id:"convert-reminder-time-format",name:"Convert reminder time format",checkCallback:e=>vp(e,r)}),r.addCommand({id:"show-date-chooser",name:"Show calendar popup",icon:"calendar-with-checkmark",hotkeys:[{modifiers:["Meta","Shift"],key:"2"}],editorCheckCallback:(e,t)=>yp(e,t,r.ui)}),r.addCommand({id:"toggle-checklist-status",name:"Toggle checklist status",hotkeys:[{modifiers:["Meta","Shift"],key:"Enter"}],editorCheckCallback:(e,t,n)=>n instanceof Cp.MarkdownView?_p(e,n,r):!1}),r.addCommand({id:"set-date-display-format",name:"Set date display format",checkCallback:e=>wp(e,r)}),r.addCommand({id:"pause-notifications",name:"Pause reminder notifications",checkCallback:e=>dm(e,r)}),r.addCommand({id:"resume-notifications",name:"Resume reminder notifications",checkCallback:e=>fm(e,r)}),r.addCommand({id:"mute-all-reminders",name:"Mute all current reminders",checkCallback:e=>um(e,r)})}var Ap=require("obsidian");function kp(r){if(!Ap.Platform.isMobile)return;let e=`${r.manifest.dir}/logs.txt`,t=[],n=o=>(...a)=>{t.push(`
[${o}]`);for(let c of a)t.push(String(c));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 en="reminder-list";var UI=10*1e3,vl=class{constructor(e){m(this,"plugin",e);m(this,"el")}onload(){this.el=this.plugin.addStatusBarItem(),this.el.addClass("reminder-dnd-status-bar"),this.el.style.display="none",this.el.style.cursor="pointer",this.el.setAttribute("aria-label","Click to resume reminder notifications"),this.plugin.registerDomEvent(this.el,"click",()=>{Ya(this.plugin)}),this.plugin.registerInterval(window.setInterval(()=>this.refresh(),UI)),this.refresh()}refresh(){if(!this.el)return;let e=this.plugin.data.dndUntil.value;if(!oo(e,$.now())){this.el.style.display="none";return}this.el.setText(`\u{1F515} Until ${this.formatUntil(e)}`),this.el.style.display=""}formatUntil(e){let t=this.plugin.settings.timeDisplayFormat.value,n=e.format(t);if(e.toYYYYMMDD()===$.now().toYYYYMMDD())return n;let o=this.plugin.settings.monthDayDisplayFormat.value;return`${e.format(o)} ${n}`}};var yl=class{constructor(e){m(this,"plugin",e);m(this,"el")}onload(){this.el=this.plugin.addStatusBarItem(),this.el.addClass("reminder-overdue-status-bar"),this.el.style.display="none",this.el.style.cursor="pointer",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(),1e4)),this.refresh()}refresh(){if(!this.el)return;if(!this.plugin.settings.showOverdueCountInStatusBar.value){this.el.style.display="none";return}let e=this.plugin.reminders.getExpiredReminders(this.plugin.settings.reminderTime.value).length;if(e===0){this.el.style.display="none";return}this.el.setText(`\u23F0 ${e}`),this.el.style.display=""}};var lu=require("obsidian");var dt=Symbol("$state"),Ds=Symbol("legacy props"),Rp=Symbol(""),_l=Symbol("proxy path"),Il=Symbol("attributes"),Ns=Symbol("class"),Tc=Symbol("style"),Ws=Symbol("text"),di=Symbol("form reset"),Ec=Symbol("hmr anchor"),Nn=new class extends Error{constructor(){super(...arguments);m(this,"name","StaleReactionError");m(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},Sp,Gc=!!((Sp=globalThis.document)!=null&&Sp.contentType)&&globalThis.document.contentType.includes("xml");var Io=3,Ar=8;var Tp,Ep,Fp=(Ep=(Tp=globalThis.process)==null?void 0:Tp.env)==null?void 0:Ep.NODE_ENV,R=Fp&&!Fp.toLowerCase().startsWith("prod");var kr=Array.isArray,Gp=Array.prototype.indexOf,fi=Array.prototype.includes,wo=Array.from,Bc=Object.keys,Rt=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,wl=Object.getOwnPropertyDescriptors,Dc=Object.prototype,Bp=Array.prototype,Gi=Object.getPrototypeOf,Nc=Object.isExtensible;var tn=()=>{};function Dp(r){return r()}function Co(r){for(var e=0;e{r=n,e=o});return{promise:t,resolve:r,reject:e}}function xl(r){return r===this.v}function Wc(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function Al(r){return!Wc(r,this.v)}function Np(r){if(R){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 xo(r){if(R){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 Zp(){if(R){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 Zc(){if(R){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 Yp(){if(R){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 Yc(r,e,t){if(R){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 Mp(r,e,t){if(R){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 Xp(r){if(R){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 Up(){if(R){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 Qp(r){if(R){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 Vp(){if(R){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 Lp(){if(R){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 Op(r){if(R){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 $p(r){if(R){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 Pp(r){if(R){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 Hp(){if(R){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 Jp(){if(R){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 jp(){if(R){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 zp(){if(R){let r=new Error("svelte_boundary_reset_onerror\nA `` `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 it=!1,rn=!1,Yr=!1;function Kp(){rn=!0}var Wn={};var Be=Symbol("uninitialized"),Sr=Symbol("filename");var kl="http://www.w3.org/1999/xhtml";var Zs=null;function Mt(r,e){return r.label=e,Rl(r.v,e),r}function Rl(r,e){var t;return(t=r==null?void 0:r[_l])==null||t.call(r,e),r}function Mr(r){let e=new Error,t=VI();return t.length===0?null:(t.unshift(`
`),Rt(e,"stack",{value:t.join(`
`)}),Rt(e,"name",{value:r}),e)}function VI(){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 o=0;o{e===Bi&&th()})}Bi.push(r)}function rh(){for(;Bi.length>0;)th()}var sn="font-weight: bold",an="font-weight: normal";function nh(r){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`,sn,an):console.warn("https://svelte.dev/e/await_reactivity_loss")}function ih(r,e){R?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`,sn,an):console.warn("https://svelte.dev/e/await_waterfall")}function oh(){R?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`,sn,an):console.warn("https://svelte.dev/e/derived_inert")}function sh(r,e,t){R?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`,sn,an):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Ni(r){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`,sn,an):console.warn("https://svelte.dev/e/hydration_mismatch")}function ah(){R?console.warn(`%c[svelte] lifecycle_double_unmount
%cTried to unmount a component that was not mounted
https://svelte.dev/e/lifecycle_double_unmount`,sn,an):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function lh(){R?console.warn("%c[svelte] select_multiple_invalid_value\n%cThe `value` property of a `` 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",sn,an):console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Tl(r){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`,sn,an):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function uh(){R?console.warn(`%c[svelte] state_proxy_unmount
%cTried to unmount a state proxy, rather than a component
https://svelte.dev/e/state_proxy_unmount`,sn,an):console.warn("https://svelte.dev/e/state_proxy_unmount")}function ch(){R?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",sn,an):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var L=!1;function ft(r){L=r}var ne;function Fe(r){if(r===null)throw Ni(),Wn;return ne=r}function Et(){return Fe(Gt(ne))}function X(r){if(L){if(Gt(ne)!==null)throw Ni(),Wn;ne=r}}function Ro(r=1){if(L){for(var e=r,t=ne;e--;)t=Gt(t);ne=t}}function ln(r=!0){for(var e=0,t=ne;;){if(t.nodeType===Ar){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 o=Gt(t);r&&t.remove(),t=o}}function Ms(r){if(!r||r.nodeType!==Ar)throw Ni(),Wn;return r.data}var LI=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function Yn(r){if(typeof r!="object"||r===null||dt in r)return r;let e=Gi(r);if(e!==Dc&&e!==Bp)return r;var t=new Map,n=kr(r),o=un(0),a=R&&Yr?Mr("created at"):null,c=pi,u=_=>{if(pi===c)return _();var g=P,v=pi;mt(null),Xc(c);var y=_();return mt(g),Xc(v),y};n&&(t.set("length",un(r.length,a)),R&&(r=$I(r)));var f="";let h=!1;function b(_){if(!h){h=!0,f=_,Mt(o,`${f} version`);for(let[g,v]of t)Mt(v,Wi(f,g));h=!1}}return new Proxy(r,{defineProperty(_,g,v){(!("value"in v)||v.configurable===!1||v.enumerable===!1||v.writable===!1)&&Hp();var y=t.get(g);return y===void 0?u(()=>{var w=un(v.value,a);return t.set(g,w),R&&typeof g=="string"&&Mt(w,Wi(f,g)),w}):z(y,v.value,!0),!0},deleteProperty(_,g){var v=t.get(g);if(v===void 0){if(g in _){let y=u(()=>un(Be,a));t.set(g,y),Zi(o),R&&Mt(y,Wi(f,g))}}else z(v,Be),Zi(o);return!0},get(_,g,v){var A;if(g===dt)return r;if(R&&g===_l)return b;var y=t.get(g),w=g in _;if(y===void 0&&(!w||(A=$t(_,g))!=null&&A.writable)&&(y=u(()=>{var G=Yn(w?_[g]:Be),Z=un(G,a);return R&&Mt(Z,Wi(f,g)),Z}),t.set(g,y)),y!==void 0){var C=k(y);return C===Be?void 0:C}return Reflect.get(_,g,v)},getOwnPropertyDescriptor(_,g){var v=Reflect.getOwnPropertyDescriptor(_,g);if(v&&"value"in v){var y=t.get(g);y&&(v.value=k(y))}else if(v===void 0){var w=t.get(g),C=w==null?void 0:w.v;if(w!==void 0&&C!==Be)return{enumerable:!0,configurable:!0,value:C,writable:!0}}return v},has(_,g){var C;if(g===dt)return!0;var v=t.get(g),y=v!==void 0&&v.v!==Be||Reflect.has(_,g);if(v!==void 0||Y!==null&&(!y||(C=$t(_,g))!=null&&C.writable)){v===void 0&&(v=u(()=>{var A=y?Yn(_[g]):Be,G=un(A,a);return R&&Mt(G,Wi(f,g)),G}),t.set(g,v));var w=k(v);if(w===Be)return!1}return y},set(_,g,v,y){var pe;var w=t.get(g),C=g in _;if(n&&g==="length")for(var A=v;Aun(Be,a)),t.set(A+"",G),R&&Mt(G,Wi(f,A)))}if(w===void 0)(!C||(pe=$t(_,g))!=null&&pe.writable)&&(w=u(()=>un(void 0,a)),R&&Mt(w,Wi(f,g)),z(w,Yn(v)),t.set(g,w));else{C=w.v!==Be;var Z=u(()=>Yn(v));z(w,Z)}var te=Reflect.getOwnPropertyDescriptor(_,g);if(te!=null&&te.set&&te.set.call(y,v),!C){if(n&&typeof g=="string"){var le=t.get("length"),M=Number(g);Number.isInteger(M)&&M>=le.v&&z(le,M+1)}Zi(o)}return!0},ownKeys(_){k(o);var g=Reflect.ownKeys(_).filter(w=>{var C=t.get(w);return C===void 0||C.v!==Be});for(var[v,y]of t)y.v!==Be&&!(v in _)&&g.push(v);return g},setPrototypeOf(){Jp()}})}function Wi(r,e){var t;return typeof e=="symbol"?`${r}[Symbol(${(t=e.description)!=null?t:""})]`:LI.test(e)?`${r}.${e}`:/^\d+$/.test(e)?`${r}[${e}]`:`${r}['${e}']`}function Fo(r){try{if(r!==null&&typeof r=="object"&&dt in r)return r[dt]}catch(e){}return r}function Uc(r,e){return Object.is(Fo(r),Fo(e))}var OI=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function $I(r){return new Proxy(r,{get(e,t,n){var o=Reflect.get(e,t,n);return OI.has(t)?function(...a){dh();var c=o.apply(this,a);return El(),c}:o}})}function fh(){let r=Array.prototype,e=Array.__svelte_cleanup;e&&e();let{indexOf:t,lastIndexOf:n,includes:o}=r;r.indexOf=function(a,c){let u=t.call(this,a,c);if(u===-1){for(let f=c!=null?c:0;f{r.indexOf=t,r.lastIndexOf=n,r.includes=o}}var Xs,mh,Us,ph,hh;function Gl(){if(Xs===void 0){Xs=window,mh=document,Us=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;ph=$t(e,"firstChild").get,hh=$t(e,"nextSibling").get,Nc(r)&&(r[Ns]=void 0,r[Il]=null,r[Tc]=void 0,r.__e=void 0),Nc(t)&&(t[Ws]=void 0),R&&(r.__svelte_meta=null,fh())}}function wt(r=""){return document.createTextNode(r)}function Xt(r){return ph.call(r)}function Gt(r){return hh.call(r)}function H(r,e){if(!L)return Xt(r);var t=Xt(ne);if(t===null)t=ne.appendChild(wt());else if(e&&t.nodeType!==Io){var n=wt();return t==null||t.before(n),Fe(n),n}return e&&Dl(t),Fe(t),t}function To(r,e=!1){var o,a;if(!L){var t=Xt(r);return t instanceof Comment&&t.data===""?Gt(t):t}if(e){if(((o=ne)==null?void 0:o.nodeType)!==Io){var n=wt();return(a=ne)==null||a.before(n),Fe(n),n}Dl(ne)}return ne}function we(r,e=1,t=!1){let n=L?ne:r;for(var o;e--;)o=n,n=Gt(n);if(!L)return n;if(t){if((n==null?void 0:n.nodeType)!==Io){var a=wt();return n===null?o==null||o.after(a):n.before(a),Fe(a),a}Dl(n)}return Fe(n),n}function Qs(r){r.textContent=""}function Bl(){if(!it||tr!==null)return!1;var r=Y.f;return(r&32768)!==0}function Mn(r,e,t){return e==null||e===kl?t?document.createElement(r,{is:t}):document.createElement(r):t?document.createElementNS(e,r,{is:t}):document.createElementNS(e,r)}function Dl(r){if(r.nodeValue.length<65536)return;let e=r.nextSibling;for(;e!==null&&e.nodeType===Io;)e.remove(),r.nodeValue+=e.nodeValue,e=r.nextSibling}var Qc=new WeakMap;function Nl(r){var e=Y;if(e===null)return P.f|=8388608,r;if(R&&r instanceof Error&&!Qc.has(r)&&Qc.set(r,PI(r,e)),(e.f&32768)===0&&(e.f&4)===0)throw R&&!e.parent&&r instanceof Error&&gh(r),r;Qr(r,e)}function Qr(r,e){if(!(e!==null&&(e.f&16384)!==0)){for(;e!==null;){if((e.f&128)!==0){if((e.f&32768)===0)throw r;try{e.b.error(r);return}catch(t){r=t}}e=e.parent}throw R&&r instanceof Error&&gh(r),r}}function PI(r,e){var c,u,f;let t=$t(r,"message");if(!(t&&!t.configurable)){for(var n=Us?" ":" ",o=`
${n}in ${((c=e.fn)==null?void 0:c.name)||""}`,a=e.ctx;a!==null;)o+=`
${n}in ${(u=a.function)==null?void 0:u[Sr].split("/").pop()}`,a=a.p;return{message:r.message+`
${o}
`,stack:(f=r.stack)==null?void 0:f.split(`
`).filter(h=>!h.includes("svelte/src/internal")).join(`
`)}}}function gh(r){let e=Qc.get(r);e&&(Rt(r,"message",{value:e.message}),Rt(r,"stack",{value:e.stack}))}var HI=-7169;function Ae(r,e){r.f=r.f&HI|e}function Eo(r){(r.f&512)!==0||r.deps===null?Ae(r,1024):Ae(r,4096)}function bh(r){if(r!==null)for(let e of r)(e.f&2)===0||(e.f&65536)===0||(e.f^=65536,bh(e.deps))}function Wl(r,e,t){(r.f&2048)!==0?e.add(r):(r.f&4096)!==0&&t.add(r),bh(r.deps),Ae(r,1024)}var vh=!1,Zl=!1;function Vc(r){var e=Zl;try{return Zl=!1,[r(),Zl]}finally{Zl=e}}var yh=!1;function Yl(){yh||(yh=!0,document.addEventListener("reset",r=>{Promise.resolve().then(()=>{var e;if(!r.defaultPrevented)for(let t of r.target.elements)(e=t[di])==null||e.call(t)})},{capture:!0}))}function Tr(r){var e=P,t=Y;mt(null),tt(null);try{return r()}finally{mt(e),tt(t)}}function Ml(r,e,t,n=t){r.addEventListener(e,()=>Tr(t));let o=r[di];o?r[di]=()=>{o(),n(!0)}:r[di]=()=>n(!0),Yl()}function _h(r){let e=0,t=Vt(0),n;return R&&Mt(t,"createSubscriber version"),()=>{mi()&&(k(t),gt(()=>(e===0&&(n=V(()=>r(()=>Zi(t)))),e+=1,()=>{et(()=>{e-=1,e===0&&(n==null||n(),n=void 0,Zi(t))})})))}}var jI=589824;function Jc(r,e,t,n){new Lc(r,e,t,n)}var ur,Ls,Er,Yi,nr,Gr,Pt,cr,Un,Mi,gi,Bo,Os,$s,cn,Ql,Ee,wh,Ch,Oc,xh,$c,Xl,Ul,Pc,Hc,Lc=class{constructor(e,t,n,o){q(this,Ee);m(this,"parent");m(this,"is_pending",!1);m(this,"transform_error");q(this,ur);q(this,Ls,L?ne:null);q(this,Er);q(this,Yi);q(this,nr);q(this,Gr,null);q(this,Pt,null);q(this,cr,null);q(this,Un,null);q(this,Mi,0);q(this,gi,0);q(this,Bo,!1);q(this,Os,new Set);q(this,$s,new Set);q(this,cn,null);q(this,Ql,_h(()=>(j(this,cn,Vt(x(this,Mi))),R&&Mt(x(this,cn),"$effect.pending()"),()=>{j(this,cn,null)})));var a,c;j(this,ur,e),j(this,Er,t),j(this,Yi,u=>{var f=Y;f.b=this,f.f|=128,n(u)}),this.parent=Y.b,this.transform_error=(c=o!=null?o:(a=this.parent)==null?void 0:a.transform_error)!=null?c:(u=>u),j(this,nr,mr(()=>{if(L){let u=x(this,Ls);Et();let f=u.data==="[!";if(u.data.startsWith("[?")){let b=JSON.parse(u.data.slice("[?".length));se(this,Ee,Ch).call(this,b)}else f?se(this,Ee,xh).call(this):se(this,Ee,wh).call(this)}else se(this,Ee,$c).call(this)},jI)),L&&j(this,ur,ne)}defer_effect(e){Wl(e,x(this,Os),x(this,$s))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!x(this,Er).pending}update_pending_count(e,t){se(this,Ee,Pc).call(this,e,t),j(this,Mi,x(this,Mi)+e),!(!x(this,cn)||x(this,Bo))&&(j(this,Bo,!0),et(()=>{j(this,Bo,!1),x(this,cn)&&Vr(x(this,cn),x(this,Mi))}))}get_effect_pending(){return x(this,Ql).call(this),k(x(this,cn))}error(e){var t;if(!x(this,Er).onerror&&!x(this,Er).failed)throw e;(t=O)!=null&&t.is_fork?(x(this,Gr)&&O.skip_effect(x(this,Gr)),x(this,Pt)&&O.skip_effect(x(this,Pt)),x(this,cr)&&O.skip_effect(x(this,cr)),O.oncommit(()=>{se(this,Ee,Hc).call(this,e)})):se(this,Ee,Hc).call(this,e)}};ur=new WeakMap,Ls=new WeakMap,Er=new WeakMap,Yi=new WeakMap,nr=new WeakMap,Gr=new WeakMap,Pt=new WeakMap,cr=new WeakMap,Un=new WeakMap,Mi=new WeakMap,gi=new WeakMap,Bo=new WeakMap,Os=new WeakMap,$s=new WeakMap,cn=new WeakMap,Ql=new WeakMap,Ee=new WeakSet,wh=function(){try{j(this,Gr,bt(()=>x(this,Yi).call(this,x(this,ur))))}catch(e){this.error(e)}},Ch=function(e){let t=x(this,Er).failed,{reset:n,invoke_onerror:o}=se(this,Ee,Oc).call(this,e);et(o),t&&j(this,cr,bt(()=>{t(x(this,ur),()=>e,()=>n)}))},Oc=function(e){var t=!1,n=!1;let o=()=>{if(t){ch();return}t=!0,n&&zp(),x(this,cr)!==null&&dn(x(this,cr),()=>{j(this,cr,null)}),se(this,Ee,Ul).call(this,()=>{se(this,Ee,$c).call(this)})};return{reset:o,invoke_onerror:()=>{var c,u;try{n=!0,(u=(c=x(this,Er)).onerror)==null||u.call(c,e,o),n=!1}catch(f){Qr(f,x(this,nr)&&x(this,nr).parent)}}}},xh=function(){let e=x(this,Er).pending;e&&(this.is_pending=!0,j(this,Pt,bt(()=>e(x(this,ur)))),et(()=>{var t=j(this,Un,document.createDocumentFragment()),n=wt();t.append(n),j(this,Gr,se(this,Ee,Ul).call(this,()=>bt(()=>x(this,Yi).call(this,n)))),x(this,gi)===0&&(x(this,ur).before(t),j(this,Un,null),dn(x(this,Pt),()=>{j(this,Pt,null)}),se(this,Ee,Xl).call(this,O))}))},$c=function(){try{if(this.is_pending=this.has_pending_snippet(),j(this,gi,0),j(this,Mi,0),j(this,Gr,bt(()=>{x(this,Yi).call(this,x(this,ur))})),x(this,gi)>0){var e=j(this,Un,document.createDocumentFragment());Do(x(this,Gr),e);let t=x(this,Er).pending;j(this,Pt,bt(()=>t(x(this,ur))))}else se(this,Ee,Xl).call(this,O)}catch(t){this.error(t)}},Xl=function(e){this.is_pending=!1,e.transfer_effects(x(this,Os),x(this,$s))},Ul=function(e){var t=Y,n=P,o=K;tt(x(this,nr)),mt(x(this,nr)),Zn(x(this,nr).ctx);try{return fr.ensure(),e()}catch(a){return Nl(a),null}finally{tt(t),mt(n),Zn(o)}},Pc=function(e,t){var n;if(!this.has_pending_snippet()){this.parent&&se(n=this.parent,Ee,Pc).call(n,e,t);return}j(this,gi,x(this,gi)+e),x(this,gi)===0&&(se(this,Ee,Xl).call(this,t),x(this,Pt)&&dn(x(this,Pt),()=>{j(this,Pt,null)}),x(this,Un)&&(x(this,ur).before(x(this,Un)),j(this,Un,null)))},Hc=function(e){x(this,Gr)&&(Oe(x(this,Gr)),j(this,Gr,null)),x(this,Pt)&&(Oe(x(this,Pt)),j(this,Pt,null)),x(this,cr)&&(Oe(x(this,cr)),j(this,cr,null)),L&&(Fe(x(this,Ls)),Ro(),Fe(ln()));let t=x(this,Er).failed,n=o=>{let{reset:a,invoke_onerror:c}=se(this,Ee,Oc).call(this,o);c(),t&&j(this,cr,se(this,Ee,Ul).call(this,()=>{try{return bt(()=>{var u=Y;u.b=this,u.f|=128,t(x(this,ur),()=>o,()=>a)})}catch(u){return Qr(u,x(this,nr).parent),null}}))};et(()=>{var o;try{o=this.transform_error(e)}catch(a){Qr(a,x(this,nr)&&x(this,nr).parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(n,a=>Qr(a,x(this,nr)&&x(this,nr).parent)):n(o)})};function Vl(r,e,t,n){let o=on()?bi:Vn;var a=r.filter(v=>!v.settled),c=e.map(o);if(R&&c.forEach((v,y)=>{v.label=e[y].toString().replace("() => ","").replaceAll("$.eager(() => ","$state.eager(").replace(/\$\.get\((.+?)\)/g,(w,C)=>C)}),t.length===0&&a.length===0){n(c);return}var u=Y,f=Ah(),h=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(v=>v.promise)):null;function b(v){if((u.f&16384)===0){f();try{n([...c,...v])}catch(y){Qr(y,u)}No()}}var _=jc();if(t.length===0){h.then(()=>b([])).finally(_);return}function g(){Promise.all(t.map(v=>Kc(v))).then(b).catch(v=>Qr(v,u)).finally(_)}h?h.then(()=>{f(),g(),No()}):g()}function Ah(){var r=Y,e=P,t=K,n=O;if(R)var o=nn;return function(c=!0){tt(r),mt(e),Zn(t),c&&(r.f&16384)===0&&(n==null||n.activate(),n==null||n.apply()),R&&(zc(null),Ao(o))}}function No(r=!0){var e;tt(null),mt(null),Zn(null),r&&((e=O)==null||e.deactivate()),R&&(zc(null),Ao(null))}function jc(){var r=Y,e=r.b,t=O,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 ir=null;function zc(r){ir=r}var Ps=new Set;function bi(r){var e=2050;Y!==null&&(Y.f|=524288);let t={ctx:K,deps:null,effects:null,equals:xl,f:e,fn:r,reactions:null,rv:0,v:Be,wv:0,parent:Y,ac:null};return R&&Yr&&(t.created=Mr("created at")),t}var Wo=Symbol("obsolete");function Kc(r,e,t){let n=Y;n===null&&Zp();var o=void 0,a=Vt(Be);R&&(a.label=e!=null?e:r.toString());var c=!P,u=new Set;return Rh(()=>{var v,y;var f=Y;R&&(ir={effect:f,effect_deps:new Set,warned:!1});var h=Cl();o=h.promise;try{Promise.resolve(r()).then(h.resolve,w=>{w!==Nn&&h.reject(w)}).finally(No)}catch(w){h.reject(w),No()}if(R){if(ir){if(f.deps!==null)for(let w=0;w{R&&(ir=null),_==null||_(),u.delete(h),C!==Wo&&(b.activate(),C?(a.f|=8388608,Vr(a,C)):((a.f&8388608)!==0&&(a.f^=8388608),R&&t!==void 0&&!a.equals(w)&&(Ps.add(a),setTimeout(()=>{Ps.has(a)&&(f.f&16384)===0&&(ih(a.label,t),Ps.delete(a))})),Vr(a,w)),b.deactivate())};h.promise.then(g,w=>g(null,w||"unknown"))}),pt(()=>{for(let f of u)f.reject(Wo)}),R&&(a.f|=4194304),new Promise(f=>{function h(b){function _(){b===o?f(a):h(o)}b.then(_,_)}h(o)})}function Vn(r){let e=bi(r);return e.equals=Al,e}function kh(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t{t.ac.abort(Nn),t.ac=null}),t.fn!==null&&(t.teardown=tn),Ui(t,0),Js(t))}function td(r){if(r.effects!==null)for(let e of r.effects)e.teardown&&e.fn!==null&&Lr(e)}var $l=null,Yo=null,O=null,fn=null,st=null,od=null,Di=!1,nd=!1,Qi=null,Ks=null,Fh=0,id=new Set,qI=1,Xo,Ln,On,Uo,Qo,Vo,$n,Lo,Jt,qs,Pn,Or,mn,Oo,vi,ke,sd,js,ad,Eh,Gh,Mo,Bh,zs,Pl=class Pl{constructor(){q(this,ke);m(this,"id",qI++);q(this,Xo,!1);m(this,"linked",!0);q(this,Ln,null);q(this,On,null);m(this,"async_deriveds",new Map);m(this,"current",new Map);m(this,"previous",new Map);q(this,Uo,new Set);q(this,Qo,new Set);q(this,Vo,0);q(this,$n,new Map);q(this,Lo,null);q(this,Jt,[]);q(this,qs,[]);q(this,Pn,new Set);q(this,Or,new Set);q(this,mn,new Map);q(this,Oo,new Set);m(this,"is_fork",!1);q(this,vi,!1);Yo===null?$l=Yo=this:(j(Yo,On,this),j(this,Ln,Yo)),Yo=this}skip_effect(e){x(this,mn).has(e)||x(this,mn).set(e,{d:[],m:[]}),x(this,Oo).delete(e)}unskip_effect(e,t=n=>this.schedule(n)){var n=x(this,mn).get(e);if(n){x(this,mn).delete(e);for(var o of n.d)Ae(o,2048),t(o);for(o of n.m)Ae(o,4096),t(o)}x(this,Oo).add(e)}capture(e,t,n=!1){e.v!==Be&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&8388608)===0&&(this.current.set(e,[t,n]),st==null||st.set(e,t)),this.is_fork||(e.v=t)}activate(){O=this}deactivate(){O=null,st=null}flush(){try{R&&id.clear(),nd=!0,O=this,se(this,ke,js).call(this)}finally{if(Fh=0,od=null,Qi=null,Ks=null,nd=!1,O=null,st=null,Hn.clear(),R)for(let e of id)e.updated=null}}discard(){var e;for(let t of x(this,Qo))t(this);x(this,Qo).clear();for(let t of this.async_deriveds.values())t.reject(Wo);se(this,ke,zs).call(this),(e=x(this,Lo))==null||e.resolve()}register_created_effect(e){x(this,qs).push(e)}increment(e,t){var n;if(j(this,Vo,x(this,Vo)+1),e){let o=(n=x(this,$n).get(t))!=null?n:0;x(this,$n).set(t,o+1)}}decrement(e,t){var n;if(j(this,Vo,x(this,Vo)-1),e){let o=(n=x(this,$n).get(t))!=null?n:0;o===1?x(this,$n).delete(t):x(this,$n).set(t,o-1)}x(this,vi)||(j(this,vi,!0),et(()=>{j(this,vi,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(let n of e)x(this,Pn).add(n);for(let n of t)x(this,Or).add(n);e.clear(),t.clear()}oncommit(e){x(this,Uo).add(e)}ondiscard(e){x(this,Qo).add(e)}settled(){var e;return((e=x(this,Lo))!=null?e:j(this,Lo,Cl())).promise}static ensure(){if(O===null){let e=O=new Pl;!nd&&!Di&&et(()=>{x(e,Xo)||e.flush()})}return O}apply(){if(!it||!this.is_fork&&x(this,Ln)===null&&x(this,On)===null){st=null;return}st=new Map;for(let[t,[n]]of this.current)st.set(t,n);for(let t=$l;t!==null;t=x(t,On))if(!(t===this||t.is_fork)){var e=!1;if(t.id1e3&&(se(this,ke,zs).call(this),ew()),R)for(let g of this.current.keys())id.add(g);for(let g of x(this,Pn))x(this,Or).delete(g),Ae(g,2048),this.schedule(g);for(let g of x(this,Or))Ae(g,4096),this.schedule(g);let e=x(this,Jt);j(this,Jt,[]),this.apply();var t=Qi=[],n=[],o=Ks=[];for(let g of e)try{se(this,ke,ad).call(this,g,t,n)}catch(v){throw Wh(g),se(this,ke,sd).call(this)||this.discard(),v}if(O=null,o.length>0){var a=Pl.ensure();for(let g of o)a.schedule(g)}if(Qi=null,Ks=null,se(this,ke,sd).call(this)){se(this,ke,Mo).call(this,n),se(this,ke,Mo).call(this,t);for(let[g,v]of x(this,mn))Nh(g,v);o.length>0&&se(f=O,ke,js).call(f);return}let c=se(this,ke,Eh).call(this);if(c){se(this,ke,Mo).call(this,n),se(this,ke,Mo).call(this,t),se(h=c,ke,Gh).call(h,this);return}x(this,Pn).clear(),x(this,Or).clear();for(let g of x(this,Uo))g(this);x(this,Uo).clear(),fn=this,Th(n),Th(t),fn=null,(b=x(this,Lo))==null||b.resolve();var u=O;if(x(this,Vo)===0&&(x(this,Jt).length===0||u!==null)&&(se(this,ke,zs).call(this),it&&(se(this,ke,Bh).call(this),O=u)),x(this,Jt).length>0)if(u!==null){let g=u;x(g,Jt).push(...x(this,Jt).filter(v=>!x(g,Jt).includes(v)))}else u=this;u!==null&&se(_=u,ke,js).call(_)},ad=function(e,t,n){e.f^=1024;for(var o=e.first;o!==null;){var a=o.f,c=(a&96)!==0,u=c&&(a&1024)!==0,f=u||(a&8192)!==0||x(this,mn).has(o);if(!f&&o.fn!==null){c?o.f^=1024:(a&4)!==0?t.push(o):it&&(a&16777224)!==0?n.push(o):Jn(o)&&((a&16)!==0&&x(this,Or).add(o),Lr(o));var h=o.first;if(h!==null){o=h;continue}}for(;o!==null;){var b=o.next;if(b!==null){o=b;break}o=o.parent}}},Eh=function(){for(var e=x(this,Ln);e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=x(e,Ln)}return null},Gh=function(e){var n;for(let[o,a]of e.current)!this.previous.has(o)&&e.previous.has(o)&&this.previous.set(o,e.previous.get(o)),this.current.set(o,a);for(let[o,a]of e.async_deriveds){let c=this.async_deriveds.get(o);c&&a.promise.then(c.resolve).catch(c.reject)}e.async_deriveds.clear(),this.transfer_effects(x(e,Pn),x(e,Or));let t=o=>{var a=o.reactions;if(a!==null&&!((o.f&2)!==0&&(o.f&6144)===0))for(let f of a){var c=f.f;if((c&2)!==0)t(f);else{var u=f;c&4194320&&!this.async_deriveds.has(u)&&(x(this,Or).delete(u),Ae(u,2048),this.schedule(u))}}};for(let o of this.current.keys())t(o);this.oncommit(()=>e.discard()),se(n=e,ke,zs).call(n),O=this,se(this,ke,js).call(this)},Mo=function(e){for(var t=0;t!g.current.get(v)[1]);if(!(!x(g,Xo)||o.length===0)){var a=o.filter(v=>!this.current.has(v));if(a.length===0)e&&g.discard();else if(t.length>0){if(R&&!x(g,vi)&&eh(x(g,Jt).length===0,"Batch has scheduled roots"),e)for(let v of x(this,Oo))g.unskip_effect(v,y=>{var w;(y.f&4194320)!==0?g.schedule(y):se(w=g,ke,Mo).call(w,[y])});g.activate();var c=new Set,u=new Map;for(var f of t)Dh(f,a,c,u);u=new Map;var h=[...g.current].filter(([v,y])=>{let w=this.current.get(v);return w?w[0]!==y[0]||w[1]!==y[1]:!0}).map(([v])=>v);if(h.length>0)for(let v of x(this,qs))(v.f&155648)===0&&ld(v,h,u)&&((v.f&4194320)!==0?(Ae(v,2048),g.schedule(v)):x(g,Pn).add(v));if(x(g,Jt).length>0&&!x(g,vi)){g.apply();for(var b of x(g,Jt))se(_=g,ke,ad).call(_,b,[],[]);j(g,Jt,[])}g.deactivate()}}}},zs=function(){if(this.linked){var e=x(this,Ln),t=x(this,On);e===null?$l=t:j(e,On,t),t===null?Yo=e:j(t,Ln,e),this.linked=!1}};var fr=Pl;function J(r){var e=Di;Di=!0;try{var t;for(r&&(O!==null&&!O.is_fork&&O.flush(),t=r());;){if(rh(),O===null)return t;O.flush()}}finally{Di=e}}function ew(){var t;if(R){var r=new Map;for(let n of O.current.keys())for(let[o,a]of(t=n.updated)!=null?t:[]){var e=r.get(o);e||(e={error:a.error,count:0},r.set(o,e)),e.count+=a.count}for(let n of r.values())n.error&&console.error(n.error)}try{Vp()}catch(n){R&&Rt(n,"stack",{value:""}),Qr(n,od)}}var tr=null;function Th(r){var e=r.length;if(e!==0){for(var t=0;t0)){Hn.clear();for(let o of tr){if((o.f&24576)!==0)continue;let a=[o],c=o.parent;for(;c!==null;)tr.has(c)&&(tr.delete(c),a.push(c)),c=c.parent;for(let u=a.length-1;u>=0;u--){let f=a[u];(f.f&24576)===0&&Lr(f)}}tr.clear()}}tr=null}}function Dh(r,e,t,n){if(!t.has(r)&&(t.add(r),r.reactions!==null))for(let o of r.reactions){let a=o.f;(a&2)!==0?Dh(o,e,t,n):(a&4194320)!==0&&(a&2048)===0&&ld(o,e,n)&&(Ae(o,2048),ta(o))}}function ld(r,e,t){let n=t.get(r);if(n!==void 0)return n;if(r.deps!==null)for(let o of r.deps){if(fi.call(e,o))return!0;if((o.f&2)!==0&&ld(o,e,t))return t.set(o,!0),!0}return t.set(r,!1),!1}function ta(r){O.schedule(r)}function Nh(r,e){if(!((r.f&32)!==0&&(r.f&1024)!==0)){(r.f&2048)!==0?e.d.push(r):(r.f&4096)!==0&&e.m.push(r),Ae(r,1024);for(var t=r.first;t!==null;)Nh(t,e),t=t.next}}function Wh(r){Ae(r,1024);for(var e=r.first;e!==null;)Wh(e),e=e.next}var Xi=new Set,Hn=new Map;function Ll(r){Xi=r}var cd=!1;function dh(){cd=!0}function Vt(r,e){var t={f:0,v:r,reactions:null,equals:xl,rv:0,wv:0};return R&&Yr&&(t.created=e!=null?e:Mr("created at"),t.updated=null,t.set_during_effect=!1,t.trace=null),t}function un(r,e){let t=Vt(r,e);return rd(t),t}function xe(r,e=!1,t=!0){var o,a;let n=Vt(r);return e||(n.equals=Al),rn&&t&&K!==null&&K.l!==null&&((a=(o=K.l).s)!=null?a:o.s=[]).push(n),n}function dd(r,e){return z(r,V(()=>k(r))),e}function z(r,e,t=!1){P!==null&&(!jt||(P.f&131072)!==0)&&on()&&(P.f&4325394)!==0&&(hr===null||!hr.has(r))&&jp();let n=t?Yn(e):e;return R&&Rl(n,r.label),Vr(r,n,Ks)}function Vr(r,e,t=null){var o,a,c;if(!r.equals(e)){Hn.set(r,pr?e:r.v);var n=fr.ensure();if(n.capture(r,e),R){if(Yr||Y!==null){(o=r.updated)!=null||(r.updated=new Map);let u=((c=(a=r.updated.get(""))==null?void 0:a.count)!=null?c:0)+1;if(r.updated.set("",{error:null,count:u}),Yr||u>5){let f=Mr("updated at");if(f!==null){let h=r.updated.get(f.stack);h||(h={error:f,count:0},r.updated.set(f.stack,h)),h.count++}}}Y!==null&&(r.set_during_effect=!0)}if((r.f&2)!==0){let u=r;(r.f&2048)!==0&&Hs(u),st===null&&Eo(u)}r.wv=Zo(),Yh(r,2048,t),on()&&Y!==null&&(Y.f&1024)!==0&&(Y.f&96)===0&&(gr===null?Mh([r]):gr.push(r)),!n.is_fork&&Xi.size>0&&!cd&&El()}return e}function El(){cd=!1;for(let r of Xi){(r.f&1024)!==0&&Ae(r,4096);let e;try{e=Jn(r)}catch(t){e=!0}e&&Lr(r)}Xi.clear()}function Zi(r){z(r,r.v+1)}function Yh(r,e,t){var g;var n=r.reactions;if(n!==null)for(var o=on(),a=n.length,c=0;cr.wv)return!0}(e&512)!==0&&st===null&&Ae(r,1024)}return!1}function Qh(r,e,t=!0){var n=r.reactions;if(n!==null&&!(!it&&hr!==null&&hr.has(r)))for(var o=0;o{r.ac.abort(Nn)}),r.ac=null);try{r.f|=2097152;var b=r.fn,_=b();r.f|=32768;var g=r.deps,v=(w=O)==null?void 0:w.is_fork;if(Ct!==null){var y;if(v||Ui(r,Ht),g!==null&&Ht>0)for(g.length=Ht+Ct.length,y=0;y{a.ac.abort(Nn),a.ac=null,Ae(a,2048)}),Sh(a),Ui(a,0)}}function Ui(r,e){var t=r.deps;if(t!==null)for(var n=e;n{requestAnimationFrame(()=>r()),setTimeout(()=>r())});await Promise.resolve(),J()}function k(r){var v,y,w;var e=r.f,t=(e&2)!==0;if((v=Xh)==null||v.add(r),P!==null&&!jt){var n=Y!==null&&(Y.f&16384)!==0;if(!n&&(hr===null||!hr.has(r))){var o=P.deps;if((P.f&2097152)!==0)r.rv{Oe(e)}}function Hh(r){fr.ensure();let e=$r(524352,r);return(t={})=>new Promise(n=>{t.outro?dn(e,()=>{Oe(e),n(void 0)}):(Oe(e),n(void 0))})}function br(r){return $r(4,r)}function yi(r,e){var t=K,n={effect:null,ran:!1,deps:r};t.l.$.push(n),n.effect=gt(()=>{if(r(),!n.ran){n.ran=!0;var o=Y;try{tt(o.parent),V(e)}finally{tt(o)}}})}function na(){var r=K;gt(()=>{for(var e of r.l.$){e.deps();var t=e.effect;(t.f&1024)!==0&&t.deps!==null&&Ae(t,4096),Jn(t)&&Lr(t),e.ran=!1}})}function Rh(r){return $r(4718592,r)}function gt(r,e=0){return $r(8|e,r)}function $e(r,e=[],t=[],n=[]){Vl(n,e,t,o=>{$r(8,()=>{r(...o.map(k))})})}function mr(r,e=0){var t=$r(16|e,r);return R&&(t.dev_stack=nn),t}function bt(r){return $r(524320,r)}function md(r){var e=r.teardown;if(e!==null){let t=pr,n=P;fd(!0),mt(null);try{e.call(null)}finally{fd(t),mt(n)}}}function Js(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){let o=t.ac;o!==null&&Tr(()=>{o.abort(Nn)});var n=t.next;(t.f&64)!==0?t.parent=null:Oe(t,e),t=n}}function Oh(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&32)===0&&Oe(e),e=t}}function Oe(r,e=!0){var t=!1;(e||(r.f&262144)!==0)&&r.nodes!==null&&r.nodes.end!==null&&(Jh(r.nodes.start,r.nodes.end),t=!0),r.f|=33554432,Js(r,e&&!t),Ui(r,0);var n=r.nodes&&r.nodes.t;if(n!==null)for(let a of n)a.stop();md(r),r.f^=33554432,r.f|=16384;var o=r.parent;o!==null&&o.first!==null&&ud(r),R&&(r.component_function=null),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes=r.ac=r.b=null}function Jh(r,e){for(;r!==null;){var t=r===e?null:Gt(r);r.remove(),r=t}}function ud(r){var e=r.parent,t=r.prev,n=r.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===r&&(e.first=n),e.last===r&&(e.last=t))}function dn(r,e,t=!0){var n=[];jh(r,n,!0);var o=()=>{t&&Oe(r),e&&e()},a=n.length;if(a>0){var c=()=>--a||o();for(var u of n)u.out(c)}else o()}function jh(r,e,t){if((r.f&8192)===0){r.f^=8192;var n=r.nodes&&r.nodes.t;if(n!==null)for(let u of n)(u.is_global||t)&&e.push(u);for(var o=r.first;o!==null;){var a=o.next;if((o.f&64)===0){var c=(o.f&65536)!==0||(o.f&32)!==0&&(r.f&16)!==0;jh(o,e,c?t:!1)}o=a}}}function Ho(r){zh(r,!0)}function zh(r,e){if((r.f&8192)!==0){r.f^=8192,(r.f&1024)===0&&(Ae(r,2048),fr.ensure().schedule(r));for(var t=r.first;t!==null;){var n=t.next,o=(t.f&65536)!==0||(t.f&32)!==0;zh(t,o?e:!1),t=n}var a=r.nodes&&r.nodes.t;if(a!==null)for(let c of a)(c.is_global||e)&&c.in()}}function Do(r,e){if(r.nodes)for(var t=r.nodes.start,n=r.nodes.end;t!==null;){var o=t===n?null:Gt(t);e.append(t),t=o}}var jl=Symbol("events"),qh=new Set,gd=new Set;function eg(r,e,t,n={}){function o(a){if(n.capture||zl.call(e,a),!a.cancelBubble)return Tr(()=>t==null?void 0:t.call(this,a))}return r.startsWith("pointer")||r.startsWith("touch")||r==="wheel"?et(()=>{e.addEventListener(r,o,n)}):e.addEventListener(r,o,n),o}function ce(r,e,t,n,o){var a={capture:n,passive:o},c=eg(r,e,t,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&pt(()=>{e.removeEventListener(r,c,a)})}var Kh=null;function zl(r){var w,C;var e=this,t=e.ownerDocument,n=r.type,o=((w=r.composedPath)==null?void 0:w.call(r))||[],a=o[0]||r.target;Kh=r;var c=0,u=Kh===r&&r[jl];if(u){var f=o.indexOf(u);if(f!==-1&&(e===document||e===window)){r[jl]=e;return}var h=o.indexOf(e);if(h===-1)return;f<=h&&(c=f)}if(a=o[c]||r.target,a!==e){Rt(r,"currentTarget",{configurable:!0,get(){return a||t}});var b=P,_=Y;mt(null),tt(null);try{for(var g,v=[];a!==null&&a!==e;){try{var y=(C=a[jl])==null?void 0:C[n];y!=null&&(!a.disabled||r.target===a)&&y.call(a,r)}catch(A){g?v.push(A):g=A}if(r.cancelBubble)break;c++,a=c{throw A});throw g}}finally{r[jl]=e,delete r.currentTarget,mt(b),tt(_)}}}var tg,bd=((tg=globalThis==null?void 0:globalThis.window)==null?void 0:tg.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:r=>r});function rg(r){var e;return(e=bd==null?void 0:bd.createHTML(r))!=null?e:r}function vd(r){var e=Mn("template");return e.innerHTML=rg(r.replaceAll("","")),e.content}function zn(r,e){var t=Y;t.nodes===null&&(t.nodes={start:r,end:e,a:null,t:null})}function ve(r,e){var t=(e&1)!==0,n=(e&2)!==0,o,a=!r.startsWith("");return()=>{if(L)return zn(ne,null),ne;o===void 0&&(o=vd(a?r:""+r),t||(o=Xt(o)));var c=n||Us?document.importNode(o,!0):o.cloneNode(!0);if(t){var u=Xt(c),f=c.lastChild;zn(u,f)}else zn(c,c);return c}}function de(r,e){if(L){var t=Y;((t.f&32768)===0||t.nodes.end===null)&&(t.nodes.end=ne),Et();return}r!==null&&r.before(e)}var uw=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var l1=[...uw,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var cw=["touchstart","touchmove"];function ng(r){return cw.includes(r)}var dw=["$state","$state.raw","$derived","$derived.by"],u1=[...dw,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];var _d=!0;function Pe(r,e){var n,o;var t=e==null?"":typeof e=="object"?`${e}`:e;t!==((o=r[n=Ws])!=null?o:r[n]=r.nodeValue)&&(r[Ws]=t,r.nodeValue=`${t}`)}function ql(r,e){return ig(r,e)}function wd(r,e){var c;Gl(),e.intro=(c=e.intro)!=null?c:!1;let t=e.target,n=L,o=ne;try{for(var a=Xt(t);a&&(a.nodeType!==Ar||a.data!=="[");)a=Gt(a);if(!a)throw Wn;ft(!0),Fe(a);let u=ig(r,{...e,anchor:a});return ft(!1),u}catch(u){if(u instanceof Error&&u.message.split(`
`).some(f=>f.startsWith("https://svelte.dev/e/")))throw u;return u!==Wn&&console.warn("Failed to hydrate: ",u),e.recover===!1&&Lp(),Gl(),Qs(t),ft(!1),ql(r,e)}finally{ft(n),Fe(o)}}var Kl=new Map;function ig(r,{target:e,anchor:t,props:n={},events:o,context:a,intro:c=!0,transformError:u}){Gl();var f=void 0,h=Hh(()=>{var b=t!=null?t:e.appendChild(wt());Jc(b,{pending:()=>{}},v=>{Ke({});var y=K;if(a&&(y.c=a),o&&(n.$$events=o),L&&zn(v,null),_d=c,f=r(v,n)||{},_d=!0,L&&(Y.nodes.end=ne,ne===null||ne.nodeType!==Ar||ne.data!=="]"))throw Ni(),Wn;qe()},u);var _=new Set,g=v=>{for(var y=0;y{var C;for(var v of _)for(let A of[e,document]){var y=Kl.get(A),w=y.get(v);--w==0?(A.removeEventListener(v,zl),y.delete(v),y.size===0&&Kl.delete(A)):y.set(v,w)}gd.delete(g),b!==t&&((C=b.parentNode)==null||C.removeChild(b))}});return Id.set(f,h),f}var Id=new WeakMap;function Cd(r,e){let t=Id.get(r);return t?(Id.delete(r),t(e)):(R&&(dt in r?uh():ah()),Promise.resolve())}function eu(r){return function(...e){var t=e[0];return t.stopPropagation(),r==null?void 0:r.apply(this,e)}}function tu(r){return function(...e){var t=e[0];return t.preventDefault(),r==null?void 0:r.apply(this,e)}}function lt(r){return new xd(r)}var Kn,Br,xd=class{constructor(e){q(this,Kn);q(this,Br);var a,c;var t=new Map,n=(u,f)=>{var h=xe(f,!1,!1);return t.set(u,h),h};let o=new Proxy({...e.props||{},$$events:{}},{get(u,f){var h;return k((h=t.get(f))!=null?h:n(f,Reflect.get(u,f)))},has(u,f){var h;return f===Ds?!0:(k((h=t.get(f))!=null?h:n(f,Reflect.get(u,f))),Reflect.has(u,f))},set(u,f,h){var b;return z((b=t.get(f))!=null?b:n(f,h),h),Reflect.set(u,f,h)}});j(this,Br,(e.hydrate?wd:ql)(e.component,{target:e.target,anchor:e.anchor,props:o,context:e.context,intro:(a=e.intro)!=null?a:!1,recover:e.recover,transformError:e.transformError})),!it&&(!((c=e==null?void 0:e.props)!=null&&c.$$host)||e.sync===!1)&&J(),j(this,Kn,o.$$events);for(let u of Object.keys(x(this,Br)))u==="$set"||u==="$destroy"||u==="$on"||Rt(this,u,{get(){return x(this,Br)[u]},set(f){x(this,Br)[u]=f},enumerable:!0});x(this,Br).$set=u=>{Object.assign(o,u)},x(this,Br).$destroy=()=>{Cd(x(this,Br))}}$set(e){x(this,Br).$set(e)}$on(e,t){x(this,Kn)[e]=x(this,Kn)[e]||[];let n=(...o)=>t.call(this,...o);return x(this,Kn)[e].push(n),()=>{x(this,Kn)[e]=x(this,Kn)[e].filter(o=>o!==n)}}$destroy(){x(this,Br).$destroy()}};Kn=new WeakMap,Br=new WeakMap;var og,sg,ag;typeof window!="undefined"&&((ag=(sg=(og=window.__svelte)!=null?og:window.__svelte={}).v)!=null?ag:sg.v=new Set).add("5");Kp();var Pr,pn,vr,Oi,ia,oa,ru,qn=class{constructor(e,t=!0){m(this,"anchor");q(this,Pr,new Map);q(this,pn,new Map);q(this,vr,new Map);q(this,Oi,new Set);q(this,ia,!0);q(this,oa,e=>{if(x(this,Pr).has(e)){var t=x(this,Pr).get(e),n=x(this,pn).get(t);if(n)Ho(n),x(this,Oi).delete(t);else{var o=x(this,vr).get(t);o&&(Ho(o.effect),x(this,pn).set(t,o.effect),x(this,vr).delete(t),R&&(o.fragment.lastChild[Ec]=this.anchor),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),n=o.effect)}for(let[a,c]of x(this,Pr)){if(x(this,Pr).delete(a),a===e)break;let u=x(this,vr).get(c);u&&(Oe(u.effect),x(this,vr).delete(c))}for(let[a,c]of x(this,pn)){if(a===t||x(this,Oi).has(a))continue;let u=()=>{if(Array.from(x(this,Pr).values()).includes(a)){var h=document.createDocumentFragment();Do(c,h),h.append(wt()),x(this,vr).set(a,{effect:c,fragment:h})}else Oe(c);x(this,Oi).delete(a),x(this,pn).delete(a)};x(this,ia)||!n?(x(this,Oi).add(a),dn(c,u,!1)):u()}}});q(this,ru,e=>{x(this,Pr).delete(e);let t=Array.from(x(this,Pr).values());for(let[n,o]of x(this,vr))t.includes(n)||(Oe(o.effect),x(this,vr).delete(n))});this.anchor=e,j(this,ia,t)}ensure(e,t){var n=O,o=Bl();if(t&&!x(this,pn).has(e)&&!x(this,vr).has(e))if(o){var a=document.createDocumentFragment(),c=wt();a.append(c),x(this,vr).set(e,{effect:bt(()=>t(c)),fragment:a})}else x(this,pn).set(e,bt(()=>t(this.anchor)));if(x(this,Pr).set(n,e),o){for(let[u,f]of x(this,pn))u===e?n.unskip_effect(f):n.skip_effect(f);for(let[u,f]of x(this,vr))u===e?n.unskip_effect(f.effect):n.skip_effect(f.effect);n.oncommit(x(this,oa)),n.ondiscard(x(this,ru))}else L&&(this.anchor=ne),x(this,oa).call(this,n)}};Pr=new WeakMap,pn=new WeakMap,vr=new WeakMap,Oi=new WeakMap,ia=new WeakMap,oa=new WeakMap,ru=new WeakMap;if(R){let r=function(e){if(!(e in globalThis)){let t;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(t!==void 0)return t;Pp(e)},set:n=>{t=n}})}};r("$state"),r("$effect"),r("$derived"),r("$inspect"),r("$props"),r("$bindable")}function Jo(r){K===null&&xo("onMount"),rn&&K.l!==null?cg(K).m.push(r):Po(()=>{let e=V(r);if(typeof e=="function")return e})}function yw(r,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(r,{detail:e,bubbles:t,cancelable:n})}function jo(){let r=K;return r===null&&xo("createEventDispatcher"),(e,t,n)=>{var a;let o=(a=r.s.$$events)==null?void 0:a[e];if(o){let c=kr(o)?o.slice():[o],u=yw(e,t,n);for(let f of c)f.call(r.x,u);return!u.defaultPrevented}return!0}}function ug(r){K===null&&xo("afterUpdate"),K.l===null&&Op("afterUpdate"),cg(K).a.push(r)}function cg(r){var t;var e=r.l;return(t=e.u)!=null?t:e.u={a:[],b:[],m:[]}}function hn(r,e,t=!1){var n;L&&(n=ne,Et());var o=new qn(r),a=t?65536:0;function c(u,f){if(L){var h=Ms(n);if(u!==parseInt(h.substring(1))){var b=ln();Fe(b),o.anchor=b,ft(!1),o.ensure(u,f),ft(!0);return}}o.ensure(u,f)}mr(()=>{var u=!1;e((f,h=0)=>{u=!0,c(h,f)}),u||c(-1,null)},a)}function kd(r,e){return e}function Sw(r,e,t){var _;for(var n=[],o=e.length,a,c=e.length,u=0;u{if(a){if(a.pending.delete(g),a.done.add(g),a.pending.size===0){var v=r.outrogroups;Ad(r,wo(a.done)),v.delete(a),v.size===0&&(r.outrogroups=null)}}else c-=1},!1)}if(c===0){var f=n.length===0&&t!==null;if(f){var h=t,b=h.parentNode;Qs(b),b.append(h),r.items.clear()}Ad(r,e,!f)}else a={pending:new Set(e),done:new Set},((_=r.outrogroups)!=null?_:r.outrogroups=new Set).add(a)}function Ad(r,e,t=!0){var n;if(r.pending.size>0){n=new Set;for(let c of r.pending.values())for(let u of c)n.add(r.items.get(u).e)}for(var o=0;o{var Z=t();return kr(Z)?Z:Z==null?[]:wo(Z)});R&&Mt(_,"{#each ...}");var g,v=new Map,y=!0;function w(Z){(G.effect.f&16384)===0&&(G.pending.delete(Z),G.fallback=b,Rw(G,g,c,e,n),b!==null&&(g.length===0?(b.f&33554432)===0?Ho(b):(b.f^=33554432,aa(b,null,c)):dn(b,()=>{b=null})))}function C(Z){G.pending.delete(Z)}var A=mr(()=>{g=k(_);var Z=g.length;let te=!1;if(L){var le=Ms(c)==="[!";le!==(Z===0)&&(c=ln(),Fe(c),ft(!1),te=!0)}for(var M=new Set,pe=O,ye=Bl(),Ge=0;Gea(c)):(b=bt(()=>a(zo!=null?zo:zo=wt())),b.f|=33554432)),Z>M.size&&(R?Tw(g,n):Yc("","","")),L&&Z>0&&Fe(ln()),!y)if(v.set(pe,M),ye){for(let[rt,At]of u)M.has(rt)||pe.skip_effect(At.e);pe.oncommit(w),pe.ondiscard(C)}else w(pe);te&&ft(!0),k(_)}),G={effect:A,flags:e,items:u,pending:v,outrogroups:null,fallback:b};y=!1,L&&(c=ne)}function sa(r){for(;r!==null&&(r.f&32)===0;)r=r.next;return r}function Rw(r,e,t,n,o){var He,he,Lt,Ze,rt,At,Kt,Q,ie;var a=(n&8)!==0,c=e.length,u=r.items,f=sa(r.effect.first),h,b=null,_,g=[],v=[],y,w,C,A;if(a)for(A=0;A0){var Ge=(n&4)!==0&&c===0?t:null;if(a){for(A=0;A{var D,ae;if(_!==void 0)for(C of _)(ae=(D=C.nodes)==null?void 0:D.a)==null||ae.apply()})}function Fw(r,e,t,n,o,a,c,u){var f=(c&1)!==0?(c&16)===0?xe(t,!1,!1):Vt(t):null,h=(c&2)!==0?Vt(o):null;return R&&f&&(f.trace=()=>{var b;u()[(b=h==null?void 0:h.v)!=null?b:o]}),{v:f,i:h,e:bt(()=>(a(e,f!=null?f:t,h!=null?h:o,u),()=>{r.delete(n)}))}}function aa(r,e,t){if(r.nodes)for(var n=r.nodes.start,o=r.nodes.end,a=e&&(e.f&33554432)===0?e.nodes.start:t;n!==null;){var c=Gt(n);if(a.before(n),n===o)return;n=c}}function _i(r,e,t){e===null?r.effect.first=t:e.next=t,t===null?r.effect.last=e:t.prev=e}function Tw(r,e){let t=new Map,n=r.length;for(let o=0;on:n)}var mg=[...`
\r\f\xA0\v\uFEFF`];function pg(r,e,t){var n=r==null?"":""+r;if(e&&(n=n?n+" "+e:e),t){for(var o of Object.keys(t))if(t[o])n=n?n+" "+o:o;else if(n.length)for(var a=o.length,c=0;(c=n.indexOf(o,c))>=0;){var u=c+a;(c===0||mg.includes(n[c-1]))&&(u===n.length||mg.includes(n[u]))?n=(c===0?"":n.substring(0,c))+n.substring(u+1):c=u}}return n===""?null:n}function bn(r,e,t,n,o,a){var c=r[Ns];if(L||c!==t||c===void 0){var u=pg(t,n,a);(!L||u!==r.getAttribute("class"))&&(u==null?r.removeAttribute("class"):e?r.className=u:r.setAttribute("class",u)),r[Ns]=t}else if(a&&o!==a)for(var f in a){var h=!!a[f];(o==null||h!==!!o[f])&&r.classList.toggle(f,h)}return a}function nu(r,e,t=!1){if(r.multiple){if(e==null)return;if(!kr(e))return lh();for(var n of r.options)n.selected=e.includes(la(n));return}for(n of r.options){var o=la(n);if(Uc(o,e)){n.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function Rd(r){var e=new MutationObserver(()=>{"__value"in r&&nu(r,r.__value)});e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),pt(()=>{e.disconnect()})}function ua(r,e,t=e){var n=new WeakSet,o=!0;Ml(r,"change",a=>{var h;var c=a?"[selected]":":checked",u;if(r.multiple)u=[].map.call(r.querySelectorAll(c),la);else{var f=(h=r.querySelector(c))!=null?h:r.querySelector("option:not([disabled])");u=f&&la(f)}t(u),r.__value=u,O!==null&&n.add(O)}),br(()=>{var a=e();if(r===document.activeElement){var c=it?fn:O;if(n.has(c))return}if(nu(r,a,o),o&&a===void 0){var u=r.querySelector(":checked");u!==null&&(a=la(u),t(a))}r.__value=a,o=!1}),Rd(r)}function la(r){return"__value"in r?r.__value:r.value}var Mw=Symbol("is custom element"),Xw=Symbol("is html"),Uw=Gc?"link":"LINK";function Td(r){if(L){var e=!1,t=()=>{if(!e){if(e=!0,r.hasAttribute("value")){var n=r.value;Hr(r,"value",null),r.value=n}if(r.hasAttribute("checked")){var o=r.checked;Hr(r,"checked",null),r.checked=o}}};r[di]=t,et(t),Yl()}}function Ed(r,e){e?r.hasAttribute("selected")||r.setAttribute("selected",""):r.removeAttribute("selected")}function Hr(r,e,t,n){var o=Qw(r);if(L&&(o[e]=r.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&r.nodeName===Uw)){n||Lw(r,e,t!=null?t:"");return}o[e]!==(o[e]=t)&&(e==="loading"&&(r[Rp]=t),t==null?r.removeAttribute(e):typeof t!="string"&&Vw(r).includes(e)?r[e]=t:r.setAttribute(e,t))}function Qw(r){var e,t;return(t=r[e=Il])!=null?t:r[e]={[Mw]:r.nodeName.includes("-"),[Xw]:r.namespaceURI===kl}}var hg=new Map;function Vw(r){var e=r.getAttribute("is")||r.nodeName,t=hg.get(e);if(t)return t;hg.set(e,t=[]);for(var n,o=r,a=Element.prototype;a!==o;){n=wl(o);for(var c in n)n[c].set&&c!=="innerHTML"&&c!=="textContent"&&c!=="innerText"&&t.push(c);o=Gi(o)}return t}function Lw(r,e,t){var n;R&&(e==="srcset"&&Ow(r,t)||Fd((n=r.getAttribute(e))!=null?n:"",t)||sh(e,r.outerHTML.replace(r.innerHTML,r.innerHTML&&"..."),String(t)))}function Fd(r,e){return r===e?!0:new URL(r,document.baseURI).href===new URL(e,document.baseURI).href}function gg(r){return r.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function Ow(r,e){var t=gg(r.srcset),n=gg(e);return n.length===t.length&&n.every(([o,a],c)=>a===t[c][1]&&(Fd(t[c][0],o)||Fd(o,t[c][0])))}function Dd(r,e,t=e){var n=new WeakSet;Ml(r,"input",async o=>{R&&r.type==="checkbox"&&Zc();var a=o?r.defaultValue:r.value;if(a=Gd(r)?Bd(a):a,t(a),O!==null&&n.add(O),await jn(),a!==(a=e())){var c=r.selectionStart,u=r.selectionEnd,f=r.value.length;if(r.value=a!=null?a:"",u!==null){var h=r.value.length;c===u&&u===f&&h>f?(r.selectionStart=h,r.selectionEnd=h):(r.selectionStart=c,r.selectionEnd=Math.min(u,h))}}}),(L&&r.defaultValue!==r.value||V(e)==null&&r.value)&&(t(Gd(r)?Bd(r.value):r.value),O!==null&&n.add(O)),gt(()=>{R&&r.type==="checkbox"&&Zc();var o=e();if(r===document.activeElement){var a=it?fn:O;if(n.has(a))return}Gd(r)&&o===Bd(r.value)||r.type==="date"&&!o&&!r.value||o!==r.value&&(r.value=o!=null?o:"")})}function Gd(r){var e=r.type;return e==="number"||e==="range"}function Bd(r){return r===""?null:+r}function Nd(r,e,t){var n=$t(r,e);n&&n.set&&(r[e]=t,pt(()=>{r[e]=null}))}function Wd(r,e){return r===e||(r==null?void 0:r[dt])===e}function xt(r={},e,t,n){var o=K.r,a=Y;return br(()=>{var c,u;return gt(()=>{c=u,u=(n==null?void 0:n())||[],V(()=>{Wd(t(...u),r)||(e(r,...u),c&&Wd(t(...c),r)&&e(null,...c))})}),()=>{let f=a;for(;f!==o&&f.parent!==null&&f.parent.f&33554432;)f=f.parent;let h=()=>{u&&Wd(t(...u),r)&&e(null,...u)},b=f.teardown;f.teardown=()=>{h(),b==null||b()}}}),r}function Bt(r=!1){let e=K,t=e.l.u;if(!t)return;let n=()=>at(e.s);if(r){let o=0,a={},c=bi(()=>{let u=!1,f=e.s;for(let h in f)f[h]!==a[h]&&(a[h]=f[h],u=!0);return u&&o++,o});n=()=>k(c)}t.b.length&&ra(()=>{vg(e,n),Co(t.b)}),Po(()=>{let o=V(()=>t.m.map(Dp));return()=>{for(let a of o)typeof a=="function"&&a()}}),t.a.length&&Po(()=>{vg(e,n),Co(t.a)})}function vg(r,e){if(r.l.s)for(let t of r.l.s)k(t);e()}function Zd(r,e){var a;var t=(a=r.$$events)==null?void 0:a[e.type],n=kr(t)?t.slice():t==null?[]:[t];for(var o of n)o.call(this,e)}function vt(r,e,t){var n;r.$$events||(r.$$events={}),(n=r.$$events)[e]||(n[e]=[]),r.$$events[e].push(t)}function yt(r){for(var e in r)e in this&&(this[e]=r[e])}function re(r,e,t,n){var te,le;var o=!rn||(t&2)!==0,a=(t&8)!==0,c=(t&16)!==0,u=n,f=!0,h=void 0,b=()=>c&&o?(h!=null||(h=bi(n)),k(h)):(f&&(f=!1,u=c?V(n):n),u);let _;if(a){var g=dt in r||Ds in r;_=(le=(te=$t(r,e))==null?void 0:te.set)!=null?le:g&&e in r?M=>r[e]=M:void 0}var v,y=!1;a?[v,y]=Vc(()=>r[e]):v=r[e],v===void 0&&n!==void 0&&(v=b(),_&&(o&&$p(e),_(v)));var w;if(o?w=()=>{var M=r[e];return M===void 0?b():(f=!0,M)}:w=()=>{var M=r[e];return M!==void 0&&(u=void 0),M===void 0?u:M},o&&(t&4)===0)return w;if(_){var C=r.$$legacy;return(function(M,pe){return arguments.length>0?((!o||!pe||C||y)&&_(pe?w():M),M):w()})}var A=!1,G=((t&1)!==0?bi:Vn)(()=>(A=!1,w()));R&&(G.label=e),a&&k(G);var Z=Y;return(function(M,pe){if(arguments.length>0){let ye=pe?k(G):o&&a?Yn(M):M;return z(G,ye),A=!0,u!==void 0&&(u=ye),M}return pr&&A||(Z.f&16384)!==0?G.v:k(G)})}var Kw;typeof HTMLElement=="function"&&(Kw=class extends HTMLElement{constructor(e,t,n){super();m(this,"$$ctor");m(this,"$$s");m(this,"$$c");m(this,"$$cn",!1);m(this,"$$d",{});m(this,"$$r",!1);m(this,"$$p_d",{});m(this,"$$l",{});m(this,"$$l_u",new Map);m(this,"$$me");m(this,"$$shadowRoot",null);this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let o=this.$$c.$on(e,t);this.$$l_u.set(t,o)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let o=this.$$l_u.get(t);o&&(o(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(o){return a=>{let c=Mn("slot");o!=="default"&&(c.name=o),de(a,c)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},n=qw(this);for(let o of this.$$s)o in n&&(o==="default"&&!this.$$d.children?(this.$$d.children=e(o),t.default=!0):t[o]=e(o));for(let o of this.attributes){let a=this.$$g_p(o.name);a in this.$$d||(this.$$d[a]=Yd(a,o.value,this.$$p_d,"toProp"))}for(let o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=lt({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=hd(()=>{gt(()=>{var o;this.$$r=!0;for(let a of Bc(this.$$c)){if(!((o=this.$$p_d[a])!=null&&o.reflect))continue;this.$$d[a]=this.$$c[a];let c=Yd(a,this.$$d[a],this.$$p_d,"toAttribute");c==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,c)}this.$$r=!1})});for(let o in this.$$l)for(let a of this.$$l[o]){let c=this.$$c.$on(o,a);this.$$l_u.set(a,c)}this.$$l={}}}attributeChangedCallback(e,t,n){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Yd(e,n,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Bc(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Yd(r,e,t,n){var a;let o=(a=t[r])==null?void 0:a.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!t[r])return e;if(n==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function qw(r){let e={};return r.childNodes.forEach(t=>{e[t.slot||"default"]=!0}),e}var yg=require("obsidian");var eC=ve(' ');function Ko(r,e){if(new.target)return lt({component:Ko,...r});Ke(e,!1);let t=re(e,"sourcePath",12),n=re(e,"markdown",12),o=xe();ug(()=>{k(o).empty(),yg.MarkdownRenderer.renderMarkdown(n(),k(o),t(),window.app.plugins.plugins["obsidian-reminder-plugin"]),k(o).childNodes.forEach(f=>{f instanceof HTMLElement&&(f.style.display="inline")})});var a={get sourcePath(){return t()},set sourcePath(f){t(f),J()},get markdown(){return n()},set markdown(f){n(f),J()},$set:yt,$on:(f,h)=>vt(e,f,h)};Bt();var c=eC(),u=H(c);return xt(u,f=>z(o,f),()=>k(o)),X(c),de(r,c),qe(a)}var tC=ve('No reminders
'),rC=ve('
'),nC=ve("
"),iC=ve('
');function qo(r,e){if(new.target)return lt({component:qo,...r});Ke(e,!1);let t=re(e,"reminders",12),n=re(e,"onOpenReminder",12,()=>{}),o=re(e,"timeToString",12,g=>g.format("HH:mm")),a=re(e,"generateLink",12,()=>"");function c(g){return`[${g.time.toString()}] ${g.title} - ${g.getFileName()}`}var u={get reminders(){return t()},set reminders(g){t(g),J()},get onOpenReminder(){return n()},set onOpenReminder(g){n(g),J()},get timeToString(){return o()},set timeToString(g){o(g),J()},get generateLink(){return a()},set generateLink(g){a(g),J()},$set:yt,$on:(g,v)=>vt(e,g,v)};Bt();var f=iC(),h=H(f);{var b=g=>{var v=tC();de(g,v)},_=g=>{var v=nC();zt(v,5,t,y=>y.key(),(y,w)=>{var C=rC(),A=H(C),G=H(A,!0);X(A);var Z=we(A,2),te=H(Z),le=H(te);Ko(le,{get markdown(){return k(w),V(()=>k(w).title)},get sourcePath(){return k(w),V(()=>k(w).file)}}),X(te);var M=we(te,2),pe=H(M,!0);X(M),X(Z),X(C),$e((ye,Ge,He,he)=>{Hr(C,"aria-label",ye),Hr(C,"title",Ge),Pe(G,He),Pe(pe,he)},[()=>(k(w),V(()=>c(k(w)))),()=>(k(w),V(()=>c(k(w)))),()=>(at(o()),k(w),V(()=>o()(k(w).time))),()=>(k(w),V(()=>k(w).getFileName()))]),ce("dragstart",C,ye=>{var Ge;(Ge=ye.dataTransfer)==null||Ge.setData("text/plain",a()(k(w)))}),ce("click",C,()=>{n()(k(w))}),de(y,C)}),X(v),de(g,v)};hn(h,g=>{at(t()),V(()=>t().length===0)?g(b):g(_,-1)})}return X(f),de(r,f),qe(u)}var oC=ve(' '),sC=ve("
",1),aC=ve("
");function ou(r,e){if(new.target)return lt({component:ou,...r});Ke(e,!1);let t=re(e,"groups",12),n=re(e,"onOpenReminder",12),o=re(e,"generateLink",12);var a={get groups(){return t()},set groups(f){t(f),J()},get onOpenReminder(){return n()},set onOpenReminder(f){n(f),J()},get generateLink(){return o()},set generateLink(f){o(f),J()},$set:yt,$on:(f,h)=>vt(e,f,h)},c=aC(),u=H(c);return zt(u,5,t,f=>f.name,(f,h)=>{var b=sC(),_=To(b);let g;var v=H(_),y=we(v);{var w=A=>{var G=oC(),Z=H(G,!0);X(G),$e(()=>Pe(Z,(k(h),V(()=>k(h).reminders.length)))),de(A,G)};hn(y,A=>{k(h),V(()=>k(h).reminders.length>0)&&A(w)})}X(_);var C=we(_,2);qo(C,{get reminders(){return k(h),V(()=>k(h).reminders)},get onOpenReminder(){return n()},timeToString:A=>k(h).timeToString(A),get generateLink(){return o()}}),$e(()=>{var A;g=bn(_,1,"group-name svelte-6tg2e0",null,g,{"group-name-overdue":k(h).isOverdue}),Pe(v,`${(A=(k(h),V(()=>k(h).name)))!=null?A:""} `)}),de(f,b)}),X(u),X(c),de(r,c),qe(a)}var su=class extends lu.ItemView{constructor(t,n,o){super(n);m(this,"plugin",t);m(this,"onOpenReminder",o);m(this,"view")}getViewType(){return en}getDisplayText(){return"Reminders"}getIcon(){return"clock"}async onOpen(){this.view=new ou({target:this.contentEl,props:{groups:this.remindersForView(),onOpenReminder:this.onOpenReminder,generateLink:t=>{let n=this.app.vault.getAbstractFileByPath(t.file),o=this.app.workspace.getActiveFile(),a;return!(n instanceof lu.TFile)||o==null?a=`[[${t.getFileName()}]]`:a=this.app.fileManager.generateMarkdownLink(n,o.path),`${t.title} - ${a}`}}})}reload(){this.view!=null&&this.view.$set({groups:this.remindersForView(),onOpenReminder:this.onOpenReminder})}remindersForView(){return Im(this.plugin.reminders.reminders,this.plugin.settings.reminderTime.value,{yearMonthFormat:this.plugin.settings.yearMonthDisplayFormat.value,monthDayFormat:this.plugin.settings.monthDayDisplayFormat.value,shortDateWithWeekdayFormat:this.plugin.settings.shortDateWithWeekdayDisplayFormat.value,timeFormat:this.plugin.settings.timeDisplayFormat.value})}onClose(){return this.view&&this.view.$destroy(),Promise.resolve()}},au=class{constructor(e,t){m(this,"plugin",e);m(this,"onOpenReminder",t);m(this,"valid",!1);[this.plugin.settings.yearMonthDisplayFormat,this.plugin.settings.monthDayDisplayFormat,this.plugin.settings.shortDateWithWeekdayDisplayFormat,this.plugin.settings.timeDisplayFormat].forEach(o=>{o.rawValue.onChanged(()=>{this.invalidate(),this.reload(!0)})})}createView(e){return new su(this.plugin,e,this.onOpenReminder)}openView(){var e;this.plugin.app.workspace.getLeavesOfType(en).length||(e=this.plugin.app.workspace.getRightLeaf(!1))==null||e.setViewState({type:en})}reload(e=!1){if(e||!this.valid){let t=this.getViews();t.length>0?(t.forEach(n=>n==null?void 0:n.reload()),this.valid=!0):(this.valid=!1,console.debug("view is null. Skipping reminder list view reload"))}}getViews(){return this.plugin.app.workspace.getLeavesOfType(en).map(e=>e&&e.view instanceof su?e.view:null).filter(e=>e!=null)}invalidate(){this.valid=!1}};var Cg=require("obsidian");var wg=Wr(wr(),1);var _g=Wr(wr()),Qd=require("obsidian");var ts=Wr(wr());var Md=Wr(wr(),1);var Xd=class{constructor(e){m(this,"date",e)}isToday(e){return this.date===void 0?!1:this.date.date()===e.date()&&this.date.month()===e.month()&&this.date.year()===e.year()}isHoliday(){return[0,6].includes(this.date.day())}},Ud=class{constructor(e){m(this,"weekStart",e);m(this,"days",[]);let t=e.clone();for(let n=0;n<7;n++)this.days.push(new Xd(t.clone())),t.add(1,"day")}get key(){return this.weekStart.valueOf()}},uu=class{constructor(e,t){m(this,"monthStart",e);m(this,"weeks",[]);m(this,"weekStart");this.weekStart=t||0;let n=e.clone().add(-(e.day()-this.weekStart+7)%7,"day");for(let o=0;o<6&&!(o>0&&!this.isThisMonth(n));o++)this.weeks.push(new Ud(n.clone())),n.add(1,"week")}isThisMonth(e){return this.monthStart.month()===e.month()&&this.monthStart.year()===e.year()}},ca=class r{constructor(e,t,n){m(this,"_current");m(this,"today");m(this,"weekStart");this.weekStart=n||0,e?this.today=e:this.today=(0,Md.default)(),t?this._current=new uu(t.clone().set("date",1),this.weekStart):this._current=new uu(this.today.clone().set("date",1),this.weekStart)}nextMonth(){return new r(this.today,this._current.monthStart.clone().add(1,"month"),this.weekStart)}previousMonth(){return new r(this.today,this._current.monthStart.clone().add(-1,"month"),this.weekStart)}calendarString(){let e=Array.from({length:7},(n,o)=>(0,Md.default)().day((this.weekStart+o)%7).format("ddd")).join(" "),t=`${this._current.monthStart.format("YYYY, MMM")}
${e}
`;return this._current.weeks.forEach(n=>{let o=" ";n.days.forEach(a=>{let c;a.date&&this._current.isThisMonth(a.date)?c=a.date.format("DD"):c=" ",o=o+c+" "}),t=t+o+`
`}),t}get current(){return this._current}};var es=class{constructor(){m(this,"digits",[]);m(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 lC=ve(' '),uC=ve(' '),cC=ve(" "),dC=ve('');function cu(r,e){if(new.target)return lt({component:cu,...r});Ke(e,!1);let t=xe(),n=xe(),o=re(e,"value",28,ts.default),a=re(e,"weekStart",12,0),c=jo(),u=xe(),f=xe(),h=xe();function b(){k(h).focus()}function _(Q){o(Q)}function g(Q){o(Q),w()}function v(){o(o().add(-1,"month"))}function y(){o(o().add(1,"month"))}function w(){c("select",o())}let C=new es;function A(Q){if(Q.key>="0"&&Q.key<="9"){Q.preventDefault();let ie=C.handle(Q.key);switch(ie.length){case 1:{let D=parseInt(ie);D>0&&o(o().set("date",D));break}case 2:ie.startsWith("0")&&(ie=ie.slice(1)),o(o().set("date",parseInt(ie)));break;case 4:{let D=ie.slice(0,2),ae=ie.slice(2,4);D.startsWith("0")&&(D=D.slice(1)),ae.startsWith("0")&&(ae=ae.slice(1)),o(o().set("month",parseInt(D)-1)),o(o().set("date",parseInt(ae)))}break}return}C.clear(),Q.key==="ArrowLeft"||Q.ctrlKey&&Q.key==="B"?(o(o().add(-1,"day")),Q.preventDefault()):Q.key==="ArrowRight"||Q.ctrlKey&&Q.key==="F"?(o(o().add(1,"day")),Q.preventDefault()):Q.key==="ArrowUp"||Q.ctrlKey&&Q.key==="P"?o(o().add(-7,"day")):Q.key==="ArrowDown"||Q.ctrlKey&&Q.key==="N"?(o(o().add(7,"day")),Q.preventDefault()):Q.key==="Enter"&&(w(),Q.preventDefault())}Jo(()=>{dd(f,k(f).style.width=k(u).clientWidth+"px")}),yi(()=>(ca,ts.default,at(o()),at(a())),()=>{z(t,new ca((0,ts.default)().startOf("day"),o().startOf("day"),a()))}),yi(()=>(ts.default,k(t)),()=>{z(n,Array.from({length:7},(Q,ie)=>(0,ts.default)().day((k(t).weekStart+ie)%7).format("ddd")))}),na();var G={focus:b,get value(){return o()},set value(Q){o(Q),J()},get weekStart(){return a()},set weekStart(Q){a(Q),J()},$set:yt,$on:(Q,ie)=>vt(e,Q,ie)};Bt();var Z=dC(),te=H(Z),le=H(te),M=we(le,2),pe=H(M,!0);X(M);var ye=we(M,2),Ge=H(ye,!0);X(ye);var He=we(ye,2);X(te);var he=we(te,2),Lt=H(he),Ze=H(Lt);zt(Ze,5,()=>k(n),Q=>Q,(Q,ie)=>{var D=lC(),ae=H(D,!0);X(D),$e(()=>Pe(ae,k(ie))),de(Q,D)}),X(Ze),X(Lt);var rt=we(Lt);zt(rt,5,()=>(k(t),V(()=>k(t).current.weeks)),Q=>Q.key,(Q,ie)=>{var D=cC();zt(D,5,()=>(k(ie),V(()=>k(ie).days)),ae=>ae.date.valueOf(),(ae,De)=>{var T=uC(),E=H(T);let _t;var Je=H(E,!0);X(E),X(T),$e((ut,Ve)=>{_t=bn(E,1,"calendar-date svelte-1lru178",null,_t,ut),Pe(Je,Ve)},[()=>({"is-selected":k(De).isToday(o()),"other-month":!k(t).current.isThisMonth(k(De).date),"is-holiday":k(De).isHoliday(),"is-past":k(De).date.isBefore(k(t).today)}),()=>(k(De),V(()=>k(De).date.format("D")))]),ce("click",E,()=>_(k(De).date)),ce("dblclick",E,()=>g(k(De).date)),de(ae,T)}),X(D),de(Q,D)}),X(rt),X(he),xt(he,Q=>z(u,Q),()=>k(u));var At=we(he,2),Kt=H(At);return Sd(Kt,e,"footer",{},null),X(At),xt(At,Q=>z(f,Q),()=>k(f)),X(Z),xt(Z,Q=>z(h,Q),()=>k(h)),$e((Q,ie)=>{Pe(pe,Q),Pe(Ge,ie)},[()=>(k(t),V(()=>k(t).current.monthStart.format("MMM"))),()=>(k(t),V(()=>k(t).current.monthStart.format("YYYY")))]),ce("click",le,()=>v()),ce("click",He,()=>y()),ce("focus",Z,()=>{c("focus")}),ce("blur",Z,()=>{c("blur")}),ce("keydown",Z,A),de(r,Z),Nd(e,"focus",b),qe(G)}var fC=ve(" "),mC=ve(' ');function du(r,e){if(new.target)return lt({component:du,...r});Ke(e,!1);let t=re(e,"value",12,"00:00"),n=re(e,"step",12,15),o=jo();function a(){o("select",t())}function c(){o("focus")}function u(){o("blur")}function f(){let y=[];for(let w=0;w<1440;w+=n()){let C=Math.floor(w/60),A=w%60;y.push(`${C.toString().padStart(2,"0")}:${A.toString().padStart(2,"0")}`)}return y}let h=f(),b=new es;function _(y){if(y.key>="0"&&y.key<="9"){y.preventDefault();let w=b.handle(y.key);switch(w.length){case 1:{let C=w.padStart(2,"0"),A=h.filter(G=>G.startsWith(C));A.length>1&&t(A[0])}break;case 2:{let C=w+":",A=h.filter(G=>G.startsWith(C));A.length>1&&t(A[0]);break}case 4:{let C=w.slice(0,2)+":"+w.slice(2,4);h.includes(C)&&t(C)}break}return}if(b.clear(),y.key==="Enter"){a(),y.preventDefault();return}}var g={get value(){return t()},set value(y){t(y),J()},get step(){return n()},set step(y){n(y),J()},$set:yt,$on:(y,w)=>vt(e,y,w)};Bt();var v=mC();return zt(v,5,()=>h,y=>y,(y,w)=>{var C=fC(),A=H(C,!0);X(C);var G={};$e(()=>{var Z;Pe(A,k(w)),G!==(G=k(w))&&(C.value=(Z=C.__value=k(w))!=null?Z:"")}),de(y,C)}),X(v),ua(v,t),ce("dblclick",v,a),ce("focus",v,c),ce("blur",v,u),ce("keydown",v,_),de(r,v),qe(g)}var pC=ve('
'),hC=ve('
',1),gC=ve(' '),bC=ve(' ',1),vC=ve('
');function rs(r,e){var rt,At,Kt,Q,ie;if(new.target)return lt({component:rs,...r});Ke(e,!1);let t=xe(),n=re(e,"reminders",12),o=re(e,"onSelect",12),a=re(e,"timeStep",12,15),c=re(e,"weekStart",12,0),u=re(e,"initialTime",12,void 0),f=re(e,"date",28,()=>{var D,ae;return(ae=(D=u())==null?void 0:D.moment().clone())!=null?ae:(0,_g.default)()}),h=xe((rt=u())!=null&&rt.hasTimePart?u().format("HH:mm"):(Kt=(At=n().reminderTime)==null?void 0:At.value.toString())!=null?Kt:"10:00"),b=xe((ie=(Q=u())==null?void 0:Q.hasTimePart)!=null?ie:!1),_=xe("calendar"),g=xe(""),v=xe(0),y=xe(),w=xe(),C=xe();function A(){let[D,ae]=k(h).split(":"),De=f().clone();k(b)?(De.set({hour:parseInt(D),minute:parseInt(ae)}),o()(new $(De,!0))):o()(new $(De,!1))}function G(D){o()(D.later())}async function Z(){var D;z(_,"quickpick"),z(g,""),z(v,0),await jn(),(D=k(y))==null||D.focus()}async function te(){var D;z(_,"calendar"),z(g,""),await jn(),(D=k(C))==null||D.focus()}function le(){k(_)==="calendar"?Z():te()}let M=["INPUT","SELECT","TEXTAREA"];function pe(D){if(k(_)!=="calendar"||D.key!=="+")return;let ae=D.target;ae&&M.includes(ae.tagName)||(Z(),D.preventDefault())}function ye(D){switch(D.key){case"ArrowDown":D.preventDefault(),k(t).length>0&&z(v,(k(v)+1)%k(t).length);break;case"ArrowUp":D.preventDefault(),k(t).length>0&&z(v,(k(v)-1+k(t).length)%k(t).length);break;case"Enter":{D.preventDefault();let ae=k(t)[k(v)];ae&&G(ae);break}case"Escape":D.preventDefault(),D.stopPropagation(),te();break}}yi(()=>(k(w),Qd.setIcon,k(_)),()=>{k(w)&&(0,Qd.setIcon)(k(w),k(_)==="calendar"?"clock":"calendar")}),yi(()=>(lc,k(g)),()=>{z(t,lc.filter(D=>D.label.toLowerCase().includes(k(g).toLowerCase())))}),yi(()=>k(g),()=>{k(g)!==void 0&&z(v,0)}),na();var Ge={get reminders(){return n()},set reminders(D){n(D),J()},get onSelect(){return o()},set onSelect(D){o(D),J()},get timeStep(){return a()},set timeStep(D){a(D),J()},get weekStart(){return c()},set weekStart(D){c(D),J()},get initialTime(){return u()},set initialTime(D){u(D),J()},get date(){return f()},set date(D){f(D),J()},$set:yt,$on:(D,ae)=>vt(e,D,ae)};Bt();var He=vC(),he=H(He);{var Lt=D=>{var ae=hC(),De=To(ae),T=H(De),E=H(T);xt(E,qt=>z(w,qt),()=>k(w)),X(T);var _t=we(T,2);xt(cu(_t,{get weekStart(){return c()},get value(){return f()},set value(qt){f(qt)},$$events:{select:()=>A()},$$slots:{footer:(qt,yn)=>{var ti=pC(),us=we(H(ti),2);{let Ru=Vn(()=>(at(n()),at($),at(f()),V(()=>n().byDate(new $(f(),!1)))));qo(us,{get reminders(){return k(Ru)}})}X(ti),de(qt,ti)}},$$legacy:!0}),qt=>z(C,qt),()=>k(C)),X(De);var Je=we(De,2),ut=H(Je),Ve=we(H(ut),2);du(Ve,{get step(){return a()},get value(){return k(h)},set value(qt){z(h,qt)},$$events:{select:()=>{A()},focus:()=>{z(b,!0)}},$$legacy:!0}),X(ut);var wi=we(ut,2);X(Je),ce("click",T,le),ce("click",wi,A),de(D,ae)},Ze=D=>{var ae=bC(),De=To(ae),T=H(De);Td(T),xt(T,Ve=>z(y,Ve),()=>k(y));var E=we(T,2),_t=H(E);xt(_t,Ve=>z(w,Ve),()=>k(w)),X(E),X(De);var Je=we(De,2),ut=H(Je);zt(ut,7,()=>k(t),Ve=>Ve.label,(Ve,wi,qt)=>{var yn=gC();let ti;var us=H(yn,!0);X(yn),$e(()=>{ti=bn(yn,1,"dtchooser-quick-pick svelte-1twe6ts",null,ti,{"is-selected":k(qt)===k(v)}),Pe(us,(k(wi),V(()=>k(wi).label)))}),ce("click",yn,()=>G(k(wi))),ce("mouseenter",yn,()=>z(v,k(qt))),de(Ve,yn)}),X(ut),X(Je),Dd(T,()=>k(g),Ve=>z(g,Ve)),ce("keydown",T,ye),ce("click",E,le),de(D,ae)};hn(he,D=>{k(_)==="calendar"?D(Lt):D(Ze,-1)})}return X(He),ce("keydown",He,pe),de(r,He),qe(Ge)}var $i=8;function Ig(r,e,t){return Math.min(Math.max(r,e),t)}var ns=class{constructor(e,t,n,o){m(this,"editorView",e);m(this,"reminders",t);m(this,"timeStep",n);m(this,"weekStart",o);m(this,"view");m(this,"dateTimeChooser");m(this,"resultResolve");m(this,"resultReject");m(this,"anchorPos",0);m(this,"onDocumentMouseDown",e=>{this.view.contains(e.target)||this.cancel()});m(this,"onKeyDown",e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this.cancel())});m(this,"onReposition",()=>{this.position(this.anchorPos)});this.view=document.createElement("div"),this.view.addClass("date-time-chooser-popup"),this.view.style.position="fixed"}show(e){var t;return this.anchorPos=e,this.view.style.visibility="hidden",document.body.appendChild(this.view),this.dateTimeChooser=new rs({target:this.view,props:{onSelect:n=>{this.setResult(n),this.hide()},reminders:this.reminders,timeStep:this.timeStep,weekStart:this.weekStart,date:(0,wg.default)()}}),this.position(e),this.view.style.visibility="visible",document.addEventListener("mousedown",this.onDocumentMouseDown,!0),this.view.addEventListener("keydown",this.onKeyDown),this.editorView.scrollDOM.addEventListener("scroll",this.onReposition,{passive:!0}),window.addEventListener("resize",this.onReposition,{passive:!0}),(t=this.view.querySelector(".reminder-calendar"))==null||t.focus(),new Promise((n,o)=>{this.resultResolve=n,this.resultReject=o})}position(e){var _,g,v;let t=this.editorView.coordsAtPos(e),n=this.editorView.dom.getBoundingClientRect(),o=(_=t==null?void 0:t.top)!=null?_:n.top,a=(g=t==null?void 0:t.bottom)!=null?g:n.top,c=(v=t==null?void 0:t.left)!=null?v:n.left,{width:u,height:f}=this.view.getBoundingClientRect(),h=a;h+f>window.innerHeight-$i&&(h=o-f),h=Ig(h,$i,Math.max(window.innerHeight-f-$i,$i));let b=Ig(c,$i,Math.max(window.innerWidth-u-$i,$i));this.view.style.top=`${h}px`,this.view.style.left=`${b}px`}cancel(){this.setResult(null),this.hide()}setResult(e){this.resultReject==null||this.resultResolve==null||(e===null?this.resultReject():this.resultResolve(e),this.resultReject=void 0,this.resultResolve=void 0)}hide(){var e;document.removeEventListener("mousedown",this.onDocumentMouseDown,!0),this.view.removeEventListener("keydown",this.onKeyDown),this.editorView.scrollDOM.removeEventListener("scroll",this.onReposition),window.removeEventListener("resize",this.onReposition),(e=this.dateTimeChooser)==null||e.$destroy(),this.dateTimeChooser=void 0,this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.editorView.focus()}};var fu=require("obsidian");var Vd=class extends fu.Modal{constructor(t,n,o,a,c,u,f){super(t);m(this,"reminders",n);m(this,"onSelect",o);m(this,"onCancel",a);m(this,"timeStep",c);m(this,"weekStart",u);m(this,"initialTime",f);m(this,"selected")}onOpen(){let t;fu.Platform.isDesktop?(this.modalEl.style.minWidth="0px",this.modalEl.style.minHeight="0px",this.modalEl.style.width="auto",t=this.contentEl):t=this.containerEl,new rs({target:t,props:{onSelect:n=>{this.select(n)},reminders:this.reminders,timeStep:this.timeStep,weekStart:this.weekStart,initialTime:this.initialTime}})}select(t){this.selected=t,this.close()}onClose(){this.selected!=null?this.onSelect(this.selected):this.onCancel()}};function Pi(r,e,t=15,n=0,o){return new Promise((a,c)=>{new Vd(r,e,a,c,t,n,o).open()})}var mu=class{constructor(e,t,n,o,a){m(this,"trigger",e);m(this,"timeStep",t);m(this,"primaryFormat",n);m(this,"convertNonTaskLines",o);m(this,"weekStart",a)}isTrigger(e,t){let n=this.trigger.value;if(n.length===0)return!1;if(t.text.contains(n.charAt(n.length-1))){let o=e.getLine(t.from.line).substring(0,t.to.ch)+t.text;if(!o.match(/^\s*- \[.\]\s.*/))return!1;if(o.endsWith(n))return!0}return!1}show(e,t,n){let o;if(Cg.Platform.isDesktopApp){let a=t.cm;if(a==null)console.error("Cannot get CodeMirror 6 editor view."),o=Pi(e,n,this.timeStep.value,Number(this.weekStart.value));else{let c=a.state.selection.main.head;o=new ns(a,n,this.timeStep.value,Number(this.weekStart.value)).show(c)}}else o=Pi(e,n,this.timeStep.value,Number(this.weekStart.value));o.then(a=>{this.insert(t,a,!0)}).catch(()=>{})}insert(e,t,n=!1){var f;let o=e.getCursor(),a=e.getLine(o.line),c={line:o.line,ch:a.length};n||(a=a.substring(0,o.ch-this.trigger.value.length));let u=this.primaryFormat.value.format;try{let h=(f=Qa(u,a,t,void 0,this.convertNonTaskLines.value))==null?void 0:f.insertedLine;if(h==null){Ua(),console.error("Cannot append reminder time to the line: line=%s, date=%s",a,t);return}e.replaceRange(h,{line:o.line,ch:0},c)}catch(h){console.error(h)}}};var xg=require("@codemirror/state"),Ag=require("@codemirror/view"),kg=require("obsidian");function Sg(r,e,t){return Ag.ViewPlugin.fromClass(class{constructor(){m(this,"activePopup");m(this,"destroyed",!1)}update(n){n.docChanged&&n.changes.iterChanges((o,a,c,u,f)=>{let h=n.state.doc,b=h.sliceString(u-2,u);if(f.length===0)return;let _=t.autoCompleteTrigger.value,g=t.reminderTimeStep.value,v=Number(t.weekStart.value);if(_===b){let y;kg.Platform.isDesktopApp?y=new Promise((w,C)=>{setTimeout(()=>{var G;if(this.destroyed){C();return}(G=this.activePopup)==null||G.cancel();let A=new ns(n.view,e,g,v);this.activePopup=A,A.show(u).finally(()=>{this.activePopup===A&&(this.activePopup=void 0)}).then(w,C)},0)}):y=Pi(r,e,g,v),y.then(w=>{let C=t.primaryFormat.value.format;try{let A=h.lineAt(u),G=A.text.lastIndexOf(_),Z=G+_.length;_.startsWith("(")&&A.text.charAt(Z)===")"&&Z++;let te=A.text.substring(0,G)+A.text.substring(Z),le=Qa(C,te,w,G,t.convertNonTaskLines.value);if(le==null){Ua(),console.error("Cannot append reminder time to the line: line=%s, date=%s",A.text,w);return}let M=n.view.state.update({changes:{from:A.from,to:A.to,insert:le.insertedLine},selection:xg.EditorSelection.cursor(A.from+le.caretPosition)});n.view.update([M])}catch(A){console.error(A)}}).catch(()=>{})}})}destroy(){var n;this.destroyed=!0,(n=this.activePopup)==null||n.cancel()}})}var is=require("@codemirror/state"),os=require("@codemirror/view"),gu=require("obsidian");function Rg(r,e,t){return Math.min(Math.max(r,e),t)}function Fg(r,e){let t=[];for(let{reminder:a,columnStart:c,columnEnd:u}of e){let f=a.rowNumber+1;if(f<1||f>r.lines)continue;let h=r.line(f),b=Rg(h.from+c,h.from,h.to),_=Rg(h.from+u,b,h.to);b>=_||t.push({from:b,to:_,reminder:a,text:r.sliceString(b,_)})}t.sort((a,c)=>a.from-c.from);let n=[],o=-1;for(let a of t)a.from ');function pu(r,e){if(new.target)return lt({component:pu,...r});Ke(e,!1);let t=re(e,"label",12),n=re(e,"title",12),o=jo();function a(b){b.preventDefault(),b.stopPropagation(),o("activate")}function c(b){(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),b.stopPropagation(),o("activate"))}var u={get label(){return t()},set label(b){t(b),J()},get title(){return n()},set title(b){n(b),J()},$set:yt,$on:(b,_)=>vt(e,b,_)};Bt();var f=yC(),h=H(f,!0);return X(f),$e(()=>{Hr(f,"title",n()),Pe(h,t())}),ce("click",f,a),ce("keydown",f,c),ce("mousedown",f,tu(eu(function(b){Zd.call(this,e,b)}))),de(r,f),qe(u)}var hu=class extends Gg.WidgetType{constructor(t,n){super();m(this,"span",t);m(this,"plugin",n);m(this,"component")}eq(t){return this.span.text===t.span.text&&this.span.reminder.title===t.span.reminder.title}toDOM(t){let n=document.createElement("span");return this.component=new pu({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(){var t;(t=this.component)==null||t.$destroy(),this.component=void 0}ignoreEvent(){return!1}async activate(t,n){try{await _C(t,this.plugin,n)}catch(o){}}};function Eg(r,e){var h,b,_;if(!r.dom.contains(e))return null;let t=r.posAtDOM(e),n=r.state.doc.lineAt(t),o=(_=(b=(h=r.state.field(Bg.editorInfoField,!1))==null?void 0:h.file)==null?void 0:b.path)!=null?_:"",a=new Fn(o,r.state.doc.toString()),c=yo(a).filter(g=>g.reminder.rowNumber===n.number-1),u=null,f=Number.POSITIVE_INFINITY;for(let g of c){let v=n.from+g.columnStart,y=n.from+g.columnEnd,w=t>=v&&t<=y?0:Math.min(Math.abs(t-v),Math.abs(t-y));w=a.from&&n<=a.to||o.add(a.from,a.to,os.Decoration.replace({widget:new hu(a,t)}));return o.finish()}function wC(r,e){let t=[];for(let n of r){let o=e.mapPos(n.from),a=e.mapPos(n.to,1);ot.changes.touchesRange(b.from,b.to)),u=t.effects.some(b=>b.is(da));if(c||t.reconfigured||u&&a===void 0)return o=Od(r,t.state),n=Ld(t.state,o,r),{decos:n,cache:o};let h=!t.startState.selection.eq(t.state.selection);return(a!==void 0||h)&&(n=Ld(t.state,o,r)),{decos:n,cache:o}},provide:e=>os.EditorView.decorations.from(e,t=>t.decos)})}function xC(r){return os.ViewPlugin.fromClass(class{constructor(e){m(this,"view",e);m(this,"debounceTimer")}update(e){e.docChanged&&(this.debounceTimer!==void 0&&window.clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{this.debounceTimer=void 0;let t=Od(r,this.view.state);this.view.dispatch({annotations:Dg.of(t),effects:[da.of()]})},IC))}destroy(){this.debounceTimer!==void 0&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=void 0)}})}function $d(r){return[CC(r),xC(r)]}var bu=require("@codemirror/state"),Ii=require("@codemirror/view"),Pd=bu.StateEffect.define();function AC(r){return r.from>=r.to?Ii.Decoration.none:Ii.Decoration.set([Ii.Decoration.mark({attributes:{style:"background-color: var(--text-highlight-bg);"}}).range(r.from,r.to)])}var kC=bu.StateField.define({create(){return Ii.Decoration.none},update(r,e){let t=e.effects.find(n=>n.is(Pd));return t!==void 0?AC(t.value):e.docChanged||!e.startState.selection.eq(e.state.selection)?Ii.Decoration.none:r.map(e.changes)},provide:r=>Ii.EditorView.decorations.from(r)});function Ng(){return kC}var Yg=require("obsidian");var Wg=require("obsidian");var SC=ve('
');function ss(r,e){if(new.target)return lt({component:ss,...r});Ke(e,!1);let t=re(e,"icon",12,""),n=re(e,"text",12,""),o=xe();Jo(()=>{(0,Wg.setIcon)(k(o),t())});var a={get icon(){return t()},set icon(b){t(b),J()},get text(){return n()},set text(b){n(b),J()},$set:yt,$on:(b,_)=>vt(e,b,_)};Bt();var c=SC(),u=H(c);xt(u,b=>z(o,b),()=>k(o));var f=we(u,2),h=H(f,!0);return X(f),X(c),$e(()=>Pe(h,n())),de(r,c),qe(a)}var RC=ve('\xD7 '),FC=ve(" "),TC=ve('
'),EC=ve(' D one M ute Snooze
');function as(r,e){if(new.target)return lt({component:as,...r});Ke(e,!1);let t=re(e,"reminder",12),n=re(e,"onRemindMeLater",12),o=re(e,"onDone",12),a=re(e,"onOpenFile",12),c=re(e,"onMute",12),u=re(e,"onPauseAllNotifications",12),f=re(e,"onMuteAll",12),h=re(e,"variant",12,"modal"),b=re(e,"onClose",12,void 0),_=re(e,"focusDone",12,!1),g=re(e,"shortcutsEnabled",12,!0),v=xe(),y=re(e,"laters",28,()=>[]),w=xe(),C=xe(),A=xe();function G(){let T=y()[k(v)];T!=null&&n()(T.later())}function Z(T){if(!g())return;let E=T.altKey&&!T.ctrlKey,_t=T.ctrlKey&&!T.altKey;if(!(!E&&!_t||T.metaKey||T.shiftKey))switch(T.code){case"KeyD":T.preventDefault(),T.stopPropagation(),o()();break;case"KeyM":T.preventDefault(),T.stopPropagation(),c()();break;case"KeyO":T.preventDefault(),T.stopPropagation(),a()();break;case"KeyS":T.preventDefault(),T.stopPropagation(),k(C).focus();break}}Jo(async()=>{h()!=="toast"&&(await jn(),_()?k(w).focus():k(A).focus())});var te={get reminder(){return t()},set reminder(T){t(T),J()},get onRemindMeLater(){return n()},set onRemindMeLater(T){n(T),J()},get onDone(){return o()},set onDone(T){o(T),J()},get onOpenFile(){return a()},set onOpenFile(T){a(T),J()},get onMute(){return c()},set onMute(T){c(T),J()},get onPauseAllNotifications(){return u()},set onPauseAllNotifications(T){u(T),J()},get onMuteAll(){return f()},set onMuteAll(T){f(T),J()},get variant(){return h()},set variant(T){h(T),J()},get onClose(){return b()},set onClose(T){b(T),J()},get focusDone(){return _()},set focusDone(T){_(T),J()},get shortcutsEnabled(){return g()},set shortcutsEnabled(T){g(T),J()},get laters(){return y()},set laters(T){y(T),J()},$set:yt,$on:(T,E)=>vt(e,T,E)};Bt();var le=EC();ce("keydown",Xs,Z,!0);let M;var pe=H(le);{var ye=T=>{var E=RC();ce("click",E,function(..._t){var Je;(Je=b())==null||Je.apply(this,_t)}),de(T,E)};hn(pe,T=>{h()==="toast"&&T(ye)})}var Ge=we(pe,2),He=H(Ge);Ko(He,{get markdown(){return at(t()),V(()=>t().title)},get sourcePath(){return at(t()),V(()=>t().file)}}),X(Ge);var he=we(Ge,2),Lt=H(he);ss(Lt,{icon:"link",get text(){return at(t()),V(()=>t().file)}}),X(he);var Ze=we(he,2),rt=H(Ze),At=H(rt);ss(At,{icon:"check-small"}),Ro(),X(rt),xt(rt,T=>z(w,T),()=>k(w));var Kt=we(rt,2),Q=H(Kt);ss(Q,{icon:"minus-with-circle"}),Ro(),X(Kt);var ie=we(Kt,2),D=we(H(ie));zt(D,1,y,kd,(T,E,_t)=>{var Je=FC(),ut=H(Je,!0);X(Je),Je.value=Je.__value=_t,$e(()=>{Ed(Je,k(v)===_t),Pe(ut,(k(E),V(()=>k(E).label)))}),de(T,Je)}),X(ie),xt(ie,T=>z(C,T),()=>k(C)),X(Ze);var ae=we(Ze,2);{var De=T=>{var E=TC(),_t=H(E),Je=we(_t,2);X(E),ce("click",_t,function(...ut){var Ve;(Ve=u())==null||Ve.apply(this,ut)}),ce("click",Je,function(...ut){var Ve;(Ve=f())==null||Ve.apply(this,ut)}),de(T,E)};hn(ae,T=>{h()==="modal"&&T(De)})}return X(le),xt(le,T=>z(A,T),()=>k(A)),$e(()=>{M=bn(le,1,"svelte-1u4loek",null,M,{toast:h()==="toast"}),Hr(Ge,"aria-label",(at(t()),V(()=>t().title))),Hr(he,"aria-label",(at(t()),V(()=>t().file)))}),ce("click",he,function(...T){var E;(E=a())==null||E.apply(this,T)}),ce("click",rt,function(...T){var E;(E=o())==null||E.apply(this,T)}),ce("click",Kt,function(...T){var E;(E=c())==null||E.apply(this,T)}),ua(ie,()=>k(v),T=>z(v,T)),ce("change",ie,G),de(r,le),qe(te)}var vu=class{constructor(){m(this,"containerEl");m(this,"toasts",new Map)}show(e,t,n,o,a,c,u,f){let h=e.key();this.remove(h);let b=this.getContainer().createDiv("reminder-toast-card"),_=new as({target:b,props:{reminder:e,laters:t,variant:"toast",shortcutsEnabled:!0,onRemindMeLater:g=>{n(g),this.remove(h)},onDone:()=>{o(),this.remove(h)},onOpenFile:()=>{c(),a(),this.remove(h)},onMute:()=>{a(),this.remove(h)},onClose:()=>{a(),this.remove(h)},onPauseAllNotifications:()=>{u(),this.remove(h)},onMuteAll:()=>{f(),this.remove(h)}}});this.toasts.set(h,{el:b,component:_}),this.updateShortcutTarget()}destroy(){var e;this.toasts.forEach(({component:t})=>t.$destroy()),this.toasts.clear(),(e=this.containerEl)==null||e.remove(),this.containerEl=void 0}sync(e){for(let t of Array.from(this.toasts.keys()))e.has(t)||this.remove(t)}remove(e){let t=this.toasts.get(e);t&&(t.component.$destroy(),t.el.remove(),this.toasts.delete(e),this.updateShortcutTarget())}updateShortcutTarget(){let e=Array.from(this.toasts.keys()),t=e[e.length-1];this.toasts.forEach(({component:n},o)=>{n.$set({shortcutsEnabled:o===t})})}getContainer(){if(!this.containerEl){let e=document.body.createDiv("reminder-toast-container");e.style.cssText="position: fixed; right: 16px; bottom: 40px; z-index: var(--layer-notice); display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; width: 360px; max-width: calc(100vw - 32px);",this.containerEl=e}return this.containerEl}};var Zg=window.require?window.require("electron"):void 0,yu=class{constructor(e,t,n,o,a,c,u,f){m(this,"app",e);m(this,"useSystemNotification",t);m(this,"laters",n);m(this,"openNoteOnReminderClick",o);m(this,"showPopupWithSystemNotification",a);m(this,"keepSystemNotificationOnScreen",c);m(this,"focusDoneButtonOnPopup",u);m(this,"notificationPopupStyle",f);m(this,"toastManager",new vu);m(this,"systemNotifications",new Map)}destroy(){this.toastManager.destroy();for(let e of Array.from(this.systemNotifications.keys()))this.closeSystemNotification(e);this.systemNotifications.clear()}sync(e){this.toastManager.sync(e);for(let t of Array.from(this.systemNotifications.keys()))e.has(t)||this.closeSystemNotification(t)}closeSystemNotification(e){let t=this.systemNotifications.get(e);t&&(t.closedByPlugin=!0,this.systemNotifications.delete(e),t.notification.close())}show(e,t,n,o,a,c,u){if(!this.isSystemNotification()){this.showBuiltinReminder(e,t,n,o,a,c,u);return}let f=this.showPopupWithSystemNotification.value;f&&this.showBuiltinReminder(e,t,n,o,a,c,u),this.showSystemNotification(e,t,n,o,a,c,u,f)}showSystemNotification(e,t,n,o,a,c,u,f){let h=e.key();this.closeSystemNotification(h);let b=Zg.remote.Notification,_=new b({title:"Obsidian Reminder",body:e.title,timeoutType:this.keepSystemNotificationOnScreen.value?"never":"default"}),g={notification:_,closedByPlugin:!1};if(this.systemNotifications.set(h,g),_.on("click",()=>{if(this.closeSystemNotification(h),this.openNoteOnReminderClick.value){a();return}f||this.showBuiltinReminder(e,t,n,o,a,c,u)}),_.on("close",()=>{this.systemNotifications.get(h)===g&&this.systemNotifications.delete(h),!(f||g.closedByPlugin)&&o()}),!f){let v=this.laters.value;_.on("action",(w,C)=>{if(C===0){n();return}let A=v[C-1];t(A.later())});let y=[{type:"button",text:"Mark as Done"}];v.forEach(w=>{y.push({type:"button",text:w.label})}),_.actions=y}_.show()}showBuiltinReminder(e,t,n,o,a,c,u){if(this.notificationPopupStyle.value==="toast"){this.toastManager.show(e,this.laters.value,t,n,o,a,c,u);return}new Hd(this.app,this.laters.value,e,t,n,o,a,c,u,this.focusDoneButtonOnPopup.value).open()}isSystemNotification(){return this.isMobile()?!1:this.useSystemNotification.value}isMobile(){return Zg===void 0}},Hd=class extends Yg.Modal{constructor(t,n,o,a,c,u,f,h,b,_){super(t);m(this,"laters",n);m(this,"reminder",o);m(this,"onRemindMeLater",a);m(this,"onDone",c);m(this,"onCancel",u);m(this,"onOpenFile",f);m(this,"onPauseAllNotifications",h);m(this,"onMuteAll",b);m(this,"focusDoneButtonOnPopup",_);m(this,"canceled",!0);m(this,"pausingAll",!1);m(this,"mutingAll",!1)}onOpen(){this.reminder.beingDisplayed=!0;let{contentEl:t}=this;new as({target:t,props:{reminder:this.reminder,laters:this.laters,focusDone:this.focusDoneButtonOnPopup,onRemindMeLater:n=>{this.onRemindMeLater(n),this.canceled=!1,this.close()},onDone:()=>{this.canceled=!1,this.onDone(),this.close()},onOpenFile:()=>{this.canceled=!0,this.onOpenFile(),this.close()},onMute:()=>{this.canceled=!0,this.close()},onPauseAllNotifications:()=>{this.pausingAll=!0,this.onPauseAllNotifications(),this.close()},onMuteAll:()=>{this.mutingAll=!0,this.onMuteAll(),this.close()}}})}onClose(){this.reminder.beingDisplayed=!1;let{contentEl:t}=this;t.empty(),this.pausingAll||this.mutingAll||this.canceled&&this.onCancel()}};var fa=class{constructor(e){m(this,"plugin",e);m(this,"autoComplete");m(this,"editDetector");m(this,"reminderModal");m(this,"viewProxy");m(this,"dndStatusBar");m(this,"overdueStatusBar");this.viewProxy=new au(this.plugin,t=>{if(!this.plugin.settings.openNoteOnReminderClick.value&&t.muteNotification){this.showReminder(t);return}this.openReminderFile(t)}),this.autoComplete=new mu(e.settings.autoCompleteTrigger,e.settings.reminderTimeStep,e.settings.primaryFormat,e.settings.convertNonTaskLines,e.settings.weekStart),this.editDetector=new Jd(e.settings.editDetectionSec),this.reminderModal=new yu(e.app,e.settings.useSystemNotification,e.settings.laters,e.settings.openNoteOnReminderClick,e.settings.showPopupWithSystemNotification,e.settings.keepSystemNotificationOnScreen,e.settings.focusDoneButtonOnPopup,e.settings.notificationPopupStyle),this.dndStatusBar=new vl(e),this.overdueStatusBar=new yl(e)}onload(){this.dndStatusBar.onload(),this.overdueStatusBar.onload(),this.plugin.registerView(en,e=>this.viewProxy.createView(e)),this.plugin.addSettingTab(new jd(this.plugin.app,this.plugin)),this.plugin.registerDomEvent(document,"keydown",()=>{this.editDetector.fileChanged()}),vn.Platform.isDesktopApp&&(this.plugin.registerEditorExtension(Sg(this.plugin.app,this.plugin.reminders,this.plugin.settings)),this.plugin.registerEditorExtension($d(this.plugin)),this.plugin.registerEditorExtension(Ng()),this.plugin.settings.editorReminderDisplay.rawValue.onChanged(()=>{this.plugin.app.workspace.updateOptions()})),xp(this.plugin)}onLayoutReady(){this.plugin.data.debug.value&&kp(this.plugin),this.viewProxy.openView()}onunload(){this.detachReminderList(),this.reminderModal.destroy()}isEditing(){return this.editDetector.isEditing()}invalidate(){this.viewProxy.invalidate(),this.overdueStatusBar.refresh(),this.reminderModal.sync(new Set(this.plugin.reminders.reminders.map(e=>e.key())))}reload(e=!1){this.viewProxy.reload(e),this.overdueStatusBar.refresh()}showAutoComplete(e){this.autoComplete.show(this.plugin.app,e,this.plugin.reminders)}refreshDndStatusBar(){this.dndStatusBar.refresh()}showReminderModal(e,t,n,o,a,c,u){this.reminderModal.show(e,t,n,o,a,c,u)}async showReminderList(){let e=this.plugin.app.workspace,t=e.getLeavesOfType(en)[0];if(t==null){let n=e.getRightLeaf(!1);if(n==null)return;await n.setViewState({type:en}),t=n}await e.revealLeaf(t)}detachReminderList(){this.plugin.app.workspace.getLeavesOfType(en).forEach(e=>e.detach())}async openReminderFile(e){let t=this.plugin.app.workspace.getLeaf(!1);console.debug("Open reminder: ",e);let n=this.plugin.app.vault.getAbstractFileByPath(e.file);if(!(n instanceof vn.TFile)){console.error("Cannot open file because it isn't a TFile: %o",n);return}if(await t.openFile(n),!(t.view instanceof vn.MarkdownView))return;let o=t.view.editor,a=o.getLine(e.rowNumber);o.setCursor({line:e.rowNumber,ch:0}),o.scrollIntoView({from:{line:e.rowNumber,ch:0},to:{line:e.rowNumber,ch:a.length}},!0);let c=o.cm;if(c){let u=c.state.doc.line(e.rowNumber+1);c.dispatch({effects:Pd.of({from:u.from,to:u.to})})}}showReminder(e){e.muteNotification=!0,this.showReminderModal(e,t=>{console.debug("Remind me later: time=%o",t),e.time=t,e.muteNotification=!1,this.plugin.fileSystem.updateReminder(e,!1),this.plugin.data.save(!0)},()=>{console.debug("done"),e.muteNotification=!1,this.plugin.fileSystem.updateReminder(e,!0),this.plugin.reminders.removeReminder(e),this.plugin.data.save(!0)},()=>{console.debug("Mute"),e.muteNotification=!0,this.reload(!0),this.plugin.data.save(!0)},()=>{console.debug("Open"),this.openReminderFile(e)},()=>{console.debug("Pause all notifications"),e.muteNotification=!1,Ma(this.plugin)},()=>{console.debug("Mute all reminders");let t=this.plugin.reminders.muteExpiredReminders(this.plugin.settings.reminderTime.value)+1;e.muteNotification=!0,this.reload(!0),this.plugin.data.save(!0),new vn.Notice(`Muted ${t} reminder${t===1?"":"s"}`)})}},Jd=class{constructor(e){m(this,"editDetectionSec",e);m(this,"lastModified")}fileChanged(){this.lastModified=new Date}isEditing(){return this.editDetectionSec.value<=0||this.lastModified==null?!1:(new Date().getTime()-this.lastModified.getTime())/1e3{let o=Mg(n);return o.length===0?!1:t===o||t.startsWith(`${o}/`)})}var zd=require("obsidian");var ma=class{constructor(e,t,n,o){m(this,"vault",e);m(this,"reminders",t);m(this,"onRemindersChanged",n);m(this,"excludedPaths",o)}onload(e){[this.vault.on("modify",async t=>{await this.reloadRemindersInFile(t)&&this.onRemindersChanged()}),this.vault.on("delete",async t=>{await this.removeRemindersByFile(t.path)&&this.onRemindersChanged()}),this.vault.on("rename",async(t,n)=>{await this.removeRemindersByFile(n)&&(await this.reloadRemindersInFile(t),this.onRemindersChanged())})].forEach(t=>{e.registerEvent(t)})}async removeRemindersByFile(e){return console.debug("Remove file: path=%s",e),this.reminders.removeByFile(e)}async reloadRemindersInFile(e){if(console.debug("Reload file and collect reminders: file=%s",e.path),!(e instanceof zd.TFile))return console.debug("Cannot read file other than TFile: file=%o",e),!1;if(!this.isMarkdownFile(e))return console.debug("Not a markdown file: file=%o",e),!1;if(Xg(e.path,this.excludedPaths()))return console.debug("Excluded file: file=%o",e),this.reminders.removeByFile(e.path);let n=new Dn(e.path,await this.vault.cachedRead(e)).getReminders();if(n.length>0){if(!this.reminders.replaceFile(e.path,n))return!1}else if(!this.reminders.removeByFile(e.path))return!1;return!0}async reloadRemindersInAllFiles(){console.debug("Reload all files and collect reminders"),this.reminders.clear();for(let e of this.vault.getMarkdownFiles())await this.reloadRemindersInFile(e);this.onRemindersChanged()}isMarkdownFile(e){return e.extension.toLowerCase()==="md"}async updateReminder(e,t){let n=this.vault.getAbstractFileByPath(e.file);if(!(n instanceof zd.TFile)){console.error("file is not instance of TFile: %o",n);return}let o=new Dn(n.path,await this.vault.read(n));await o.updateReminder(e,{checked:t,time:e.time}),await this.vault.modify(n,o.getContent())}};var Ug=Wr(wr(),1);var lf=require("obsidian");var Kd=class{constructor(){m(this,"settingContexts",[])}register(e){this.settingContexts.push(e)}findByKey(e){return this.settingContexts.find(t=>t.key===e)}forEach(e){this.settingContexts.forEach(e)}},qd=class{constructor(e){m(this,"_settingRegistry",e);m(this,"validationEl");m(this,"infoEl");m(this,"_setting");m(this,"key");m(this,"name");m(this,"desc");m(this,"tags",[]);m(this,"settingModel");m(this,"anyValueChanged")}init(e,t){this.settingModel=e,this._setting=t,this.validationEl=t.descEl.createDiv("validation",n=>{n.style.color="var(--text-error)",n.style.marginTop="0.25rem",n.style.display="none"}),this.infoEl=t.descEl.createDiv("info",n=>{n.style.color="var(--text-faint)",n.style.marginTop="0.25rem",n.style.display="none"})}setValidationError(e){this.setText(this.validationEl,e)}setInfo(e){this.setText(this.infoEl,e)}setText(e,t){if(!e){console.error("element not created");return}t===null?e.style.display="none":(e.style.display="block",e.textContent=t)}get setting(){return this._setting}get registry(){return this._settingRegistry}hasTag(e){return this.tags.filter(t=>t===e).length>0}update(){this.isInitialized()&&this.anyValueChanged&&this.anyValueChanged(this)}setEnabled(e){this.setting.setDisabled(!e),this.setting.settingEl.toggleClass("reminder-setting-disabled",!e)}findContextByKey(e){return this._settingRegistry.findByKey(e)}booleanValue(){return this.settingModel.value}isInitialized(){return this.settingModel&&this.validationEl&&this.setting}},ef=class{constructor(e){m(this,"registry",e);m(this,"context");this.context=new qd(this.registry),this.registry.register(this.context)}key(e){return this.context.key=e,this}name(e){return this.context.name=e,this}desc(e){return this.context.desc=e,this}tag(e){return this.context.tags.push(e),this}enableWhen(e){return this.context.anyValueChanged=e,this}text(e){return new _u(this.context,!1,e)}textArea(e){return new _u(this.context,!0,e)}number(e){return new tf(this.context,e)}toggle(e){return new rf(this.context,e)}dropdown(e){return new of(this.context,e)}},ls=class{constructor(e,t){m(this,"context",e);m(this,"initValue",t)}onAnyValueChanged(e){return this.context.anyValueChanged=e,this}onValueChange(){this.context.registry.forEach(e=>{e.update()})}buildSettingModel(e,t){return new pa(this.context,e,this.initValue,t)}wireTextComponent(e,t,n,o){e.setPlaceholder(t).setValue(n).onChange(async a=>{o(a)})}},_u=class extends ls{constructor(t,n,o){super(t,o);m(this,"longText",n);m(this,"_placeHolder")}placeHolder(t){return this._placeHolder=t,this}build(t){return this.buildSettingModel(t,({setting:n,rawValue:o,context:a})=>{let c=u=>{var f;this.wireTextComponent(u,(f=this._placeHolder)!=null?f:"",o.value,h=>{try{t.unmarshal(h),o.value=h,a.setValidationError(null),this.onValueChange()}catch(b){b instanceof Error?a.setValidationError(b.message):typeof b=="string"&&a.setValidationError(b)}})};this.longText?n.addTextArea(u=>{c(u)}):n.addText(u=>{c(u)})})}},tf=class extends ls{constructor(t,n){super(t,n);m(this,"_placeHolder")}placeHolder(t){return this._placeHolder=t,this}build(t){return this.buildSettingModel(t,({setting:n,rawValue:o,context:a})=>{n.addText(c=>{var u;this.wireTextComponent(c,(u=this._placeHolder)!=null?u:"",o.value.toString(),f=>{let h=parseInt(f,10);if(Number.isNaN(h)){a.setValidationError("Please enter a valid number.");return}a.setValidationError(null),o.value=h,this.onValueChange()})})})}},rf=class extends ls{build(e){return new pa(this.context,e,this.initValue,({setting:t,rawValue:n})=>{t.addToggle(o=>o.setValue(n.value).onChange(async a=>{n.value=a,this.onValueChange()}))})}},nf=class{constructor(e,t){m(this,"label",e);m(this,"value",t)}},of=class extends ls{constructor(){super(...arguments);m(this,"options",[])}addOption(t,n){return this.options.push(new nf(t,n)),this}build(t){return new pa(this.context,t,this.initValue,({setting:n,rawValue:o})=>{n.addDropdown(a=>{this.options.forEach(c=>{a.addOption(c.value,c.label)}),a.setValue(o.value),a.onChange(async c=>{o.value=c,this.onValueChange()})})})}},pa=class{constructor(e,t,n,o){m(this,"context",e);m(this,"serde",t);m(this,"settingInitializer",o);m(this,"rawValue");if(this.rawValue=new oi(n),e.key==null)throw new Error("key is required.")}createSetting(e){var n,o;let t=new lf.Setting(e).setName((n=this.context.name)!=null?n:"").setDesc((o=this.context.desc)!=null?o:"");return this.context.init(this,t),this.settingInitializer({setting:t,rawValue:this.rawValue,context:this.context}),t}get value(){return this.serde.unmarshal(this.rawValue.value)}get key(){return this.context.key}load(e){if(e===void 0)return;let t=e[this.key];t!==void 0&&(this.rawValue.value=t)}store(e){e[this.key]=this.rawValue.value}hasTag(e){return this.context.hasTag(e)}},sf=class{constructor(e){m(this,"name",e);m(this,"settings",[])}addSettings(...e){this.settings.push(...e)}},af=class{constructor(e){m(this,"name",e);m(this,"groups",[])}newGroup(e){let t=new sf(e);return this.groups.push(t),t}},Iu=class{constructor(){m(this,"pages",[]);m(this,"registry",new Kd);m(this,"activeTabIndex",0)}newSettingBuilder(){return new ef(this.registry)}newPage(e){let t=new af(e);return this.pages.push(t),t}displayOn(e){e.empty();let t=e.createDiv("reminder-settings-tab-bar");t.setAttribute("role","tablist");let n=this.pages.map((a,c)=>{let u=t.createEl("button",{cls:"reminder-settings-tab",text:a.name});return u.setAttribute("role","tab"),u.setAttribute("type","button"),u.addEventListener("click",()=>{this.activeTabIndex=c,this.updateTabButtons(n),this.renderActivePage(o)}),u});this.updateTabButtons(n);let o=e.createDiv("reminder-settings-tab-content");this.renderActivePage(o)}updateTabButtons(e){e.forEach((t,n)=>{let o=n===this.activeTabIndex;t.toggleClass("is-active",o),t.setAttribute("aria-selected",o?"true":"false")})}renderActivePage(e){e.empty();let t=this.pages[this.activeTabIndex];t!==void 0&&(t.groups.forEach(n=>{n.name!==void 0&&new lf.Setting(e).setName(n.name).setHeading(),n.settings.forEach(o=>{o.createSetting(e)})}),this.registry.forEach(n=>n.update()))}forEach(e){this.pages.forEach(t=>{t.groups.forEach(n=>{n.settings.forEach(o=>{e(o)})})})}},wu=class{unmarshal(e){return Na.parse(e)}marshal(e){return e.toString()}},Ie=class{unmarshal(e){return e}marshal(e){return e}},Cu=class{unmarshal(e){return am(e)}marshal(e){return e.map(t=>t.label).join(`
`)}},xu=class{unmarshal(e){return e.split(`
`).map(t=>t.trim()).filter(t=>t.length>0)}marshal(e){return e.join(`
`)}},Au=class{unmarshal(e){let t=_o.find(n=>n.name===e);return t!==void 0?t:(console.warn(`Unknown reminder format: ${e}. Falling back to the default format.`),_o[0])}marshal(e){return e.name}};var yr="re-scan",ku=class{constructor(){m(this,"settings",new Iu);m(this,"reminderTime");m(this,"reminderTimeStep");m(this,"enableNotification");m(this,"notificationPopupStyle");m(this,"openNoteOnReminderClick");m(this,"useSystemNotification");m(this,"showPopupWithSystemNotification");m(this,"keepSystemNotificationOnScreen");m(this,"focusDoneButtonOnPopup");m(this,"laters");m(this,"weekStart");m(this,"dateFormat");m(this,"dateTimeFormat");m(this,"strictDateFormat");m(this,"autoCompleteTrigger");m(this,"convertNonTaskLines");m(this,"editorReminderDisplay");m(this,"primaryFormat");m(this,"excludedPaths");m(this,"useCustomEmojiForTasksPlugin");m(this,"useReminderTimeFallbackForTasksPlugin");m(this,"removeTagsForTasksPlugin");m(this,"dataviewReminderFieldName");m(this,"linkDatesToDailyNotes");m(this,"yearMonthDisplayFormat");m(this,"monthDayDisplayFormat");m(this,"timeDisplayFormat");m(this,"shortDateWithWeekdayDisplayFormat");m(this,"editDetectionSec");m(this,"reminderCheckIntervalSec");m(this,"showOverdueCountInStatusBar");m(this,"ntfyEnabled");m(this,"ntfyServerUrl");m(this,"ntfyTopic");let e=new uf(this.settings);this.reminderTime=this.settings.newSettingBuilder().key("reminderTime").name("Reminder time").desc("Time when a reminder with no time part will show").tag(yr).text("09:00").placeHolder("Time (hh:mm)").build(new wu),this.reminderTimeStep=this.settings.newSettingBuilder().key("reminderTimeStep").name("Reminder time step (minutes)").desc("Step of time for reminder time (minutes)").number(15).build(new Ie),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 Ie),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 Ie),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 Ie),this.useSystemNotification=this.settings.newSettingBuilder().key("useSystemNotification").name("Use system notification").desc("Use system notification for reminder notifications").toggle(!1).build(new Ie),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(a=>{a.setEnabled(this.useSystemNotification.value)}).build(new Ie),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 of it disappearing after a few seconds. Only effective on Windows and Linux; ignored on macOS. Enable this if you use the same vault on multiple devices (e.g. via Obsidian Sync): it allows the plugin to dismiss the notification when you complete or snooze the reminder on another device.").toggle(!1).onAnyValueChanged(a=>{a.setEnabled(this.useSystemNotification.value)}).build(new Ie),this.focusDoneButtonOnPopup=this.settings.newSettingBuilder().key("focusDoneButtonOnPopup").name("Focus Done button on popup").desc("Automatically focus the Done button when a reminder popup opens, so pressing Enter completes the task. Off by default to prevent accidentally completing a reminder you haven't read.").toggle(!1).build(new Ie),this.laters=this.settings.newSettingBuilder().key("laters").name("Remind me later").desc("Line-separated list of remind me later items").textArea(`In 30 minutes
In 1 hour
In 3 hours
Tomorrow
Next week`).placeHolder(`In 30 minutes
In 1 hour
In 3 hours
Tomorrow
Next week`).build(new Cu);let t=this.settings.newSettingBuilder().key("weekStart").name("Week start").desc("Select the first day of the week").dropdown("0");Array.from({length:7},(a,c)=>{let u=(0,Ug.default)().day(c).format("dddd");t.addOption(u,c.toString())}),this.weekStart=t.build(new Ie),this.dateFormat=this.settings.newSettingBuilder().key("dateFormat").name("Date format").desc("moment style date format: https://momentjs.com/docs/#/displaying/format/").tag(yr).text("YYYY-MM-DD").placeHolder("YYYY-MM-DD").onAnyValueChanged(a=>{a.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ie),this.strictDateFormat=this.settings.newSettingBuilder().key("strictDateFormat").name("Strict date format").desc("Strictly parse the date and time").tag(yr).toggle(!1).onAnyValueChanged(a=>{a.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ie),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(yr).text("YYYY-MM-DD HH:mm").placeHolder("YYYY-MM-DD HH:mm").onAnyValueChanged(a=>{a.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ie),this.linkDatesToDailyNotes=this.settings.newSettingBuilder().key("linkDatesToDailyNotes").name("Link dates to daily notes").desc("When toggled, Dates link to daily notes.").tag(yr).toggle(!1).onAnyValueChanged(a=>{a.setEnabled(e.enableReminderPluginReminderFormat.value)}).build(new Ie),this.autoCompleteTrigger=this.settings.newSettingBuilder().key("autoCompleteTrigger").name("Calendar popup trigger").desc("Trigger text to show calendar popup").text("(@").placeHolder("(@").onAnyValueChanged(a=>{let c=this.autoCompleteTrigger.value;a.setInfo(`Popup is ${c.length===0?"disabled":"enabled"}`)}).build(new Ie),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 Ie),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 Ie);let n=this.settings.newSettingBuilder().key("primaryReminderFormat").name("Primary reminder format").desc("Reminder format for generated reminder by calendar popup").dropdown(_o[0].name);_o.forEach(a=>n.addOption(`${a.description} - ${a.example}`,a.name)),this.primaryFormat=n.build(new Au),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(yr).textArea("").placeHolder(`Templates
Archive/2020`).build(new xu),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(yr).toggle(!1).onAnyValueChanged(a=>{a.setEnabled(e.enableTasksPluginReminderFormat.value)}).build(new Ie),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(yr).toggle(!1).onAnyValueChanged(a=>{a.setEnabled(e.enableTasksPluginReminderFormat.value&&this.useCustomEmojiForTasksPlugin.value)}).build(new Ie),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(yr).toggle(!1).onAnyValueChanged(a=>{a.setEnabled(e.enableTasksPluginReminderFormat.value)}).build(new Ie),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(yr).text("reminder").placeHolder("reminder").onAnyValueChanged(a=>{a.setEnabled(e.enableDataviewReminderFormat.value)}).build(new Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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 Ie),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.").text("").placeHolder("a-long-random-topic-name").build(new Ie),this.settings.newPage("Notifications").newGroup().addSettings(this.reminderTime,this.reminderTimeStep,this.laters,this.enableNotification,this.notificationPopupStyle,this.openNoteOnReminderClick,this.useSystemNotification,this.showPopupWithSystemNotification,this.keepSystemNotificationOnScreen,this.focusDoneButtonOnPopup,this.showOverdueCountInStatusBar),this.settings.newPage("Editor").newGroup().addSettings(this.autoCompleteTrigger,this.convertNonTaskLines,this.primaryFormat,this.editorReminderDisplay);let o=this.settings.newPage("Reminder formats");o.newGroup("Reminder plugin format").addSettings(e.enableReminderPluginReminderFormat,this.dateFormat,this.dateTimeFormat,this.strictDateFormat,this.linkDatesToDailyNotes),o.newGroup("Tasks plugin format").addSettings(e.enableTasksPluginReminderFormat,this.useCustomEmojiForTasksPlugin,this.useReminderTimeFallbackForTasksPlugin,this.removeTagsForTasksPlugin),o.newGroup("Dataview format").addSettings(e.enableDataviewReminderFormat,this.dataviewReminderFieldName),o.newGroup("Kanban plugin format").addSettings(e.enableKanbanPluginReminderFormat),this.settings.newPage("Display").newGroup().addSettings(this.yearMonthDisplayFormat,this.monthDayDisplayFormat,this.shortDateWithWeekdayDisplayFormat,this.timeDisplayFormat,this.weekStart),this.settings.newPage("Advanced").newGroup().addSettings(this.excludedPaths,this.editDetectionSec,this.reminderCheckIntervalSec),this.settings.newPage("ntfy").newGroup().addSettings(this.ntfyEnabled,this.ntfyServerUrl,this.ntfyTopic)}wireReminderFormatConfig(){let e=new Cs;e.setParameterFunc(Qe.now,()=>$.now()),e.setParameter(Qe.useCustomEmojiForTasksPlugin,this.useCustomEmojiForTasksPlugin),e.setParameter(Qe.linkDatesToDailyNotes,this.linkDatesToDailyNotes),e.setParameter(Qe.removeTagsForTasksPlugin,this.removeTagsForTasksPlugin),e.setParameter(Qe.useReminderTimeFallbackForTasksPlugin,this.useReminderTimeFallbackForTasksPlugin),e.setParameter(Qe.dataviewReminderFieldName,this.dataviewReminderFieldName),hp(e)}forEach(e){this.settings.forEach(e)}},uf=class{constructor(e){m(this,"settings",e);m(this,"settingKeyToFormatName",new Map);m(this,"reminderFormatSettings",[]);m(this,"enableReminderPluginReminderFormat");m(this,"enableTasksPluginReminderFormat");m(this,"enableKanbanPluginReminderFormat");m(this,"enableDataviewReminderFormat");this.enableReminderPluginReminderFormat=this.createUseReminderFormatSetting(kc),this.enableTasksPluginReminderFormat=this.createUseReminderFormatSetting(Sc),this.enableKanbanPluginReminderFormat=this.createUseReminderFormatSetting(Rc),this.enableDataviewReminderFormat=this.createUseReminderFormatSetting(Fc)}createUseReminderFormatSetting(e){let t=`enable${e.name}`,n=this.settings.newSettingBuilder().key(t).name(`Enable ${e.description}`).desc("Recognize reminders written in this format.").tag(yr).toggle(e.defaultEnabled).onAnyValueChanged(o=>{var a;o.setInfo(`Example: ${(a=e.format.appendReminder("- [ ] Task 1",$.now()))==null?void 0:a.insertedLine}`)}).build(new Ie);return this.settingKeyToFormatName.set(t,e),this.reminderFormatSettings.push(n),n.rawValue.onChanged(()=>{this.updateReminderFormat()}),n}updateReminderFormat(){let e=this.reminderFormatSettings.filter(t=>t.value).map(t=>this.settingKeyToFormatName.get(t.key)).filter(t=>t!==void 0);pp(e)}};var ha=class{constructor(e,t){m(this,"store",e);m(this,"reminders",t);m(this,"restoring",!0);m(this,"changed",!1);m(this,"scanned",new oi(!1));m(this,"debug",new oi(!1));m(this,"dndUntil",new oi(null));m(this,"_settings",new ku);this._settings.wireReminderFormatConfig(),this.settings.forEach(n=>{n.rawValue.onChanged(()=>{this.restoring||(n.hasTag(yr)&&(this.scanned.value=!1),this.changed=!0)})})}async load(){console.debug("Load reminder plugin data");let e=await this.store.loadData();if(!e){this.scanned.value=!1;return}this.scanned.value=e.scanned,e.debug!=null&&(this.debug.value=e.debug),this.dndUntil.value=e.dndUntil!=null?$.ofEpochMillis(e.dndUntil):null,this.settings.forEach(n=>{n.load(e.settings)});let t=e.reminders;t&&Object.keys(t).forEach(n=>{let o=t[n];o&&this.reminders.replaceFile(n,o.map(a=>{var u;let c=new ao(n,a.title,$.parse(a.time),a.rowNumber,!1);return c.muteNotification=(u=a.muted)!=null?u:!1,c}))}),this.changed=!1,this.restoring&&(this.restoring=!1)}async save(e=!1){var o,a;if(!e&&!this.changed)return;console.debug("Save reminder plugin data: force=%s, changed=%s",e,this.changed);let t={};this.reminders.fileToReminders.forEach((c,u)=>{t[u]=c.map(f=>({title:f.title,time:f.time.toString(),rowNumber:f.rowNumber,muted:f.muteNotification}))});let n={};this.settings.forEach(c=>{c.store(n)}),await this.store.saveData({scanned:this.scanned.value,reminders:t,debug:this.debug.value,dndUntil:(a=(o=this.dndUntil.value)==null?void 0:o.getTimeInMillis())!=null?a:null,settings:n}),this.changed=!1}get settings(){return this._settings}};var Qg=require("obsidian");var Su=class extends Qg.Plugin{constructor(t,n){super(t,n);m(this,"_data");m(this,"settings");m(this,"_ui");m(this,"_reminders");m(this,"_fileSystem");m(this,"_notificationWorker");m(this,"_ntfyController");this._reminders=new Va(()=>{this.ui&&this.ui.invalidate(),this.data.changed=!0,this._ntfyController&&this._ntfyController.notifyRemindersChanged()}),this._data=new ha(this,this.reminders),this.settings=this.data.settings,this.reminders.reminderTime=this.settings.reminderTime,jr.setTimeFormat(this.settings.dateFormat,this.settings.dateTimeFormat,this.settings.strictDateFormat),this._ui=new fa(this),this._fileSystem=new ma(t.vault,this.reminders,()=>{this.ui.reload(!0)},()=>this.settings.excludedPaths.value),this._notificationWorker=new _s({registerInterval:o=>this.registerInterval(o),isLayoutReady:()=>this.app.workspace.layoutReady,reloadUI:o=>this.ui.reload(o),isEditing:()=>this.ui.isEditing(),isPopupIntrusive:()=>this.settings.notificationPopupStyle.value!=="toast",showReminder:o=>this.ui.showReminder(o),isScanned:()=>this.data.scanned.value,markScanned:()=>{this.data.scanned.value=!0},saveData:o=>{this.data.save(o)},reloadRemindersInAllFiles:()=>this.fileSystem.reloadRemindersInAllFiles(),getExpiredReminders:()=>this.reminders.getExpiredReminders(this.settings.reminderTime.value),checkIntervalSec:()=>this.settings.reminderCheckIntervalSec.value,isNotificationEnabled:()=>this.settings.enableNotification.value,isNotificationPaused:()=>oo(this.data.dndUntil.value,$.now())}),this._ntfyController=new Is({isEnabled:()=>this.settings.ntfyEnabled.value,serverUrl:()=>this.settings.ntfyServerUrl.value,topic:()=>this.settings.ntfyTopic.value,reminders:()=>this.reminders.reminders,defaultTime:()=>this.settings.reminderTime.value,vaultName:()=>this.app.vault.getName(),registerInterval:o=>this.registerInterval(o)});for(let o of[this.settings.ntfyEnabled,this.settings.ntfyServerUrl,this.settings.ntfyTopic])o.rawValue.onChanged(()=>{this._ntfyController.notifySettingsChanged()})}async onload(){this.ui.onload(),this.app.workspace.onLayoutReady(async()=>{await this.data.load(),this.ui.onLayoutReady(),this.fileSystem.onload(this),this._notificationWorker.startPeriodicTask(),this._ntfyController.start()})}onunload(){this.ui.onunload(),this._ntfyController.stop()}get reminders(){return this._reminders}get ui(){return this._ui}get fileSystem(){return this._fileSystem}get data(){return this._data}};
/*! Bundled license information:
moment/moment.js:
(*! moment.js *)
(*! version : 2.30.1 *)
(*! authors : Tim Wood, Iskren Chernev, Moment.js contributors *)
(*! license : MIT *)
(*! momentjs.com *)
*/
/* nosourcemap */