103 lines
290 KiB
JavaScript
Executable File
103 lines
290 KiB
JavaScript
Executable File
/*
|
|
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 B_=Object.create;var ys=Object.defineProperty;var D_=Object.getOwnPropertyDescriptor;var N_=Object.getOwnPropertyNames;var W_=Object.getPrototypeOf,Z_=Object.prototype.hasOwnProperty;var rm=r=>{throw TypeError(r)};var M_=(r,e,t)=>e in r?ys(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Y_=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},X_=(r,e)=>{for(var t in e)ys(r,t,{get:e[t],enumerable:!0})},nm=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of N_(e))!Z_.call(r,o)&&o!==t&&ys(r,o,{get:()=>e[o],enumerable:!(n=D_(e,o))||n.enumerable});return r};var Wr=(r,e,t)=>(t=r!=null?B_(W_(r)):{},nm(e||!r||!r.__esModule?ys(t,"default",{value:r,enumerable:!0}):t,r)),U_=r=>nm(ys({},"__esModule",{value:!0}),r);var m=(r,e,t)=>M_(r,typeof e!="symbol"?e+"":e,t),ec=(r,e,t)=>e.has(r)||rm("Cannot "+t);var C=(r,e,t)=>(ec(r,e,"read from private field"),t?t.call(r):e.get(r)),ee=(r,e,t)=>e.has(r)?rm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),z=(r,e,t,n)=>(ec(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),ae=(r,e,t)=>(ec(r,e,"access private method"),t);var wr=Y_((ac,no)=>{(function(r,e){typeof ac=="object"&&typeof no!="undefined"?no.exports=e():typeof define=="function"&&define.amd?define(e):r.moment=e()})(ac,(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 u(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 c(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<p;++d)l.push(s(i[d],d));return l}function I(i,s){for(var l in s)a(s,l)&&(i[l]=s[l]);return a(s,"toString")&&(i.toString=s.toString),a(s,"valueOf")&&(i.valueOf=s.valueOf),i}function g(i,s,l,d){return Bf(i,s,l,d,!0).utc()}function v(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function y(i){return i._pf==null&&(i._pf=v()),i._pf}var w;Array.prototype.some?w=Array.prototype.some:w=function(i){var s=Object(this),l=s.length>>>0,d;for(d=0;d<l;d++)if(d in s&&i.call(this,s[d],d,s))return!0;return!1};function x(i){var s=null,l=!1,d=i._d&&!isNaN(i._d.getTime());if(d&&(s=y(i),l=w.call(s.parsedDateParts,function(p){return p!=null}),d=s.overflow<0&&!s.empty&&!s.invalidEra&&!s.invalidMonth&&!s.invalidWeekday&&!s.weekdayMismatch&&!s.nullInput&&!s.invalidFormat&&!s.userInvalidated&&(!s.meridiem||s.meridiem&&l),i._strict&&(d=d&&s.charsLeftOver===0&&s.unusedTokens.length===0&&s.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(i))i._isValid=d;else return d;return i._isValid}function k(i){var s=g(NaN);return i!=null?I(y(s),i):y(s).userInvalidated=!0,s}var B=e.momentProperties=[],F=!1;function P(i,s){var l,d,p,_=B.length;if(c(s._isAMomentObject)||(i._isAMomentObject=s._isAMomentObject),c(s._i)||(i._i=s._i),c(s._f)||(i._f=s._f),c(s._l)||(i._l=s._l),c(s._strict)||(i._strict=s._strict),c(s._tzm)||(i._tzm=s._tzm),c(s._isUTC)||(i._isUTC=s._isUTC),c(s._offset)||(i._offset=s._offset),c(s._pf)||(i._pf=y(s)),c(s._locale)||(i._locale=s._locale),_>0)for(l=0;l<_;l++)d=B[l],p=s[d],c(p)||(i[d]=p);return i}function ie(i){P(this,i),this._d=new Date(i._d!=null?i._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),F===!1&&(F=!0,e.updateOffset(this),F=!1)}function Y(i){return i instanceof ie||i!=null&&i._isAMomentObject!=null}function pe(i){e.suppressDeprecationWarnings===!1&&typeof console!="undefined"&&console.warn&&console.warn("Deprecation warning: "+i)}function _e(i,s){var l=!0;return I(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,i),l){var d=[],p,_,S,W=arguments.length;for(_=0;_<W;_++){if(p="",typeof arguments[_]=="object"){p+=`
|
|
[`+_+"] ";for(S in arguments[0])a(arguments[0],S)&&(p+=S+": "+arguments[0][S]+", ");p=p.slice(0,-2)}else p=arguments[_];d.push(p)}pe(i+`
|
|
Arguments: `+Array.prototype.slice.call(d).join("")+`
|
|
`+new Error().stack),l=!1}return s.apply(this,arguments)},s)}var Ge={};function He(i,s){e.deprecationHandler!=null&&e.deprecationHandler(i,s),Ge[i]||(pe(s),Ge[i]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function he(i){return typeof Function!="undefined"&&i instanceof Function||Object.prototype.toString.call(i)==="[object Function]"}function Lt(i){var s,l;for(l in i)a(i,l)&&(s=i[l],he(s)?this[l]=s:this["_"+l]=s);this._config=i,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Ze(i,s){var l=I({},i),d;for(d in s)a(s,d)&&(o(i[d])&&o(s[d])?(l[d]={},I(l[d],i[d]),I(l[d],s[d])):s[d]!=null?l[d]=s[d]:delete l[d]);for(d in i)a(i,d)&&!a(s,d)&&o(i[d])&&(l[d]=I({},l[d]));return l}function rt(i){i!=null&&this.set(i)}var At;Object.keys?At=Object.keys:At=function(i){var s,l=[];for(s in i)a(i,s)&&l.push(s);return l};var Kt={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Q(i,s,l){var d=this._calendar[i]||this._calendar.sameElse;return he(d)?d.call(s,l):d}function oe(i,s,l){var d=""+Math.abs(i),p=s-d.length,_=i>=0;return(_?l?"+":"":"-")+Math.pow(10,Math.max(0,p)).toString().substr(1)+d}var N=/(\[[^\[]*\])|(\\)?([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,le=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,De={},E={};function G(i,s,l,d){var p=d;typeof d=="string"&&(p=function(){return this[d]()}),i&&(E[i]=p),s&&(E[s[0]]=function(){return oe(p.apply(this,arguments),s[1],s[2])}),l&&(E[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(N),l,d;for(l=0,d=s.length;l<d;l++)E[s[l]]?s[l]=E[s[l]]:s[l]=_t(s[l]);return function(p){var _="",S;for(S=0;S<d;S++)_+=he(s[S])?s[S].call(p,i):s[S];return _}}function ut(i,s){return i.isValid()?(s=Ve(s,i.localeData()),De[s]=De[s]||Je(s),De[s](i)):i.localeData().invalidDate()}function Ve(i,s){var l=5;function d(p){return s.longDateFormat(p)||p}for(le.lastIndex=0;l>=0&&le.test(i);)i=i.replace(le,d),le.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(N).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",Tu=/\d{1,2}/;function $g(i){return this._ordinal.replace("%d",i)}var Pg={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 Hg(i,s,l,d){var p=this._relativeTime[l];return he(p)?p(i,s,l,d):p.replace(/%d/i,i)}function Jg(i,s){var l=this._relativeTime[i>0?"future":"past"];return he(l)?l(s):l.replace(/%s/i,s)}var ff={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"?ff[i]||ff[i.toLowerCase()]:void 0}function Eu(i){var s={},l,d;for(d in i)a(i,d)&&(l=_r(d),l&&(s[l]=i[d]));return s}var jg={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 zg(i){var s=[],l;for(l in i)a(i,l)&&s.push({unit:l,priority:jg[l]});return s.sort(function(d,p){return d.priority-p.priority}),s}var mf=/\d/,or=/\d\d/,pf=/\d{3}/,Gu=/\d{4}/,ba=/[+-]?\d{6}/,Me=/\d\d?/,hf=/\d\d\d\d?/,gf=/\d\d\d\d\d\d?/,va=/\d{1,3}/,Bu=/\d{1,4}/,ya=/[+-]?\d{1,6}/,Hi=/\d+/,_a=/[+-]?\d+/,Kg=/Z|[+-]\d\d:?\d\d/gi,Ia=/Z|[+-]\d\d(?::?\d\d)?/gi,qg=/[+-]?\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?/,Du=/^([1-9]\d|\d)/,wa;wa={};function Z(i,s,l){wa[i]=he(s)?s:function(d,p){return d&&l?l:s}}function eb(i,s){return a(wa,i)?wa[i](s._strict,s._locale):new RegExp(tb(i))}function tb(i){return _n(i.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(s,l,d,p,_){return l||d||p||_}))}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 Nu={};function Re(i,s){var l,d=s,p;for(typeof i=="string"&&(i=[i]),f(s)&&(d=function(_,S){S[s]=fe(_)}),p=i.length,l=0;l<p;l++)Nu[i[l]]=d}function ds(i,s){Re(i,function(l,d,p,_){p._w=p._w||{},s(l,p._w,p,_)})}function rb(i,s,l){s!=null&&a(Nu,i)&&Nu[i](s,l._a,l,i)}function Ca(i){return i%4===0&&i%100!==0||i%400===0}var Dt=0,In=1,Jr=2,ct=3,Dr=4,wn=5,Ci=6,nb=7,ib=8;G("Y",0,0,function(){var i=this.year();return i<=9999?oe(i,4):"+"+i}),G(0,["YY",2],0,function(){return this.year()%100}),G(0,["YYYY",4],0,"year"),G(0,["YYYYY",5],0,"year"),G(0,["YYYYYY",6,!0],0,"year"),Z("Y",_a),Z("YY",Me,or),Z("YYYY",Bu,Gu),Z("YYYYY",ya,ba),Z("YYYYYY",ya,ba),Re(["YYYYY","YYYYYY"],Dt),Re("YYYY",function(i,s){s[Dt]=i.length===2?e.parseTwoDigitYear(i):fe(i)}),Re("YY",function(i,s){s[Dt]=e.parseTwoDigitYear(i)}),Re("Y",function(i,s){s[Dt]=parseInt(i,10)});function fs(i){return Ca(i)?366:365}e.parseTwoDigitYear=function(i){return fe(i)+(fe(i)>68?1900:2e3)};var bf=ji("FullYear",!0);function ob(){return Ca(this.year())}function ji(i,s){return function(l){return l!=null?(vf(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 vf(i,s,l){var d,p,_,S,W;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}_=l,S=i.month(),W=i.date(),W=W===29&&S===1&&!Ca(_)?28:W,p?d.setUTCFullYear(_,S,W):d.setFullYear(_,S,W)}}function sb(i){return i=_r(i),he(this[i])?this[i]():this}function ab(i,s){if(typeof i=="object"){i=Eu(i);var l=zg(i),d,p=l.length;for(d=0;d<p;d++)this[l[d].unit](i[l[d].unit])}else if(i=_r(i),he(this[i]))return this[i](s);return this}function lb(i,s){return(i%s+s)%s}var je;Array.prototype.indexOf?je=Array.prototype.indexOf:je=function(i){var s;for(s=0;s<this.length;++s)if(this[s]===i)return s;return-1};function Wu(i,s){if(isNaN(i)||isNaN(s))return NaN;var l=lb(s,12);return i+=(s-l)/12,l===1?Ca(i)?29:28:31-l%7%2}G("M",["MM",2],"Mo",function(){return this.month()+1}),G("MMM",0,0,function(i){return this.localeData().monthsShort(this,i)}),G("MMMM",0,0,function(i){return this.localeData().months(this,i)}),Z("M",Me,Ji),Z("MM",Me,or),Z("MMM",function(i,s){return s.monthsShortRegex(i)}),Z("MMMM",function(i,s){return s.monthsRegex(i)}),Re(["M","MM"],function(i,s){s[In]=fe(i)-1}),Re(["MMM","MMMM"],function(i,s,l,d){var p=l._locale.monthsParse(i,d,l._strict);p!=null?s[In]=p:y(l).invalidMonth=i});var ub="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),yf="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),_f=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,cb=cs,db=cs;function fb(i,s){return i?n(this._months)?this._months[i.month()]:this._months[(this._months.isFormat||_f).test(s)?"format":"standalone"][i.month()]:n(this._months)?this._months:this._months.standalone}function mb(i,s){return i?n(this._monthsShort)?this._monthsShort[i.month()]:this._monthsShort[_f.test(s)?"format":"standalone"][i.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function pb(i,s,l){var d,p,_,S=i.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],d=0;d<12;++d)_=g([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(_,"").toLocaleLowerCase(),this._longMonthsParse[d]=this.months(_,"").toLocaleLowerCase();return l?s==="MMM"?(p=je.call(this._shortMonthsParse,S),p!==-1?p:null):(p=je.call(this._longMonthsParse,S),p!==-1?p:null):s==="MMM"?(p=je.call(this._shortMonthsParse,S),p!==-1?p:(p=je.call(this._longMonthsParse,S),p!==-1?p:null)):(p=je.call(this._longMonthsParse,S),p!==-1?p:(p=je.call(this._shortMonthsParse,S),p!==-1?p:null))}function hb(i,s,l){var d,p,_;if(this._monthsParseExact)return pb.call(this,i,s,l);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;d<12;d++){if(p=g([2e3,d]),l&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(p,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(p,"").replace(".","")+"$","i")),!l&&!this._monthsParse[d]&&(_="^"+this.months(p,"")+"|^"+this.monthsShort(p,""),this._monthsParse[d]=new RegExp(_.replace(".",""),"i")),l&&s==="MMMM"&&this._longMonthsParse[d].test(i))return d;if(l&&s==="MMM"&&this._shortMonthsParse[d].test(i))return d;if(!l&&this._monthsParse[d].test(i))return d}}function If(i,s){if(!i.isValid())return i;if(typeof s=="string"){if(/^\d+$/.test(s))s=fe(s);else if(s=i.localeData().monthsParse(s),!f(s))return i}var l=s,d=i.date();return d=d<29?d:Math.min(d,Wu(i.year(),l)),i._isUTC?i._d.setUTCMonth(l,d):i._d.setMonth(l,d),i}function wf(i){return i!=null?(If(this,i),e.updateOffset(this,!0),this):ms(this,"Month")}function gb(){return Wu(this.year(),this.month())}function bb(i){return this._monthsParseExact?(a(this,"_monthsRegex")||Cf.call(this),i?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=cb),this._monthsShortStrictRegex&&i?this._monthsShortStrictRegex:this._monthsShortRegex)}function vb(i){return this._monthsParseExact?(a(this,"_monthsRegex")||Cf.call(this),i?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=db),this._monthsStrictRegex&&i?this._monthsStrictRegex:this._monthsRegex)}function Cf(){function i(te,ge){return ge.length-te.length}var s=[],l=[],d=[],p,_,S,W;for(p=0;p<12;p++)_=g([2e3,p]),S=_n(this.monthsShort(_,"")),W=_n(this.months(_,"")),s.push(S),l.push(W),d.push(W),d.push(S);s.sort(i),l.sort(i),d.sort(i),this._monthsRegex=new RegExp("^("+d.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function yb(i,s,l,d,p,_,S){var W;return i<100&&i>=0?(W=new Date(i+400,s,l,d,p,_,S),isFinite(W.getFullYear())&&W.setFullYear(i)):W=new Date(i,s,l,d,p,_,S),W}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 xa(i,s,l){var d=7+s-l,p=(7+ps(i,0,d).getUTCDay()-s)%7;return-p+d-1}function xf(i,s,l,d,p){var _=(7+l-d)%7,S=xa(i,d,p),W=1+7*(s-1)+_+S,te,ge;return W<=0?(te=i-1,ge=fs(te)+W):W>fs(i)?(te=i+1,ge=W-fs(i)):(te=i,ge=W),{year:te,dayOfYear:ge}}function hs(i,s,l){var d=xa(i.year(),s,l),p=Math.floor((i.dayOfYear()-d-1)/7)+1,_,S;return p<1?(S=i.year()-1,_=p+Cn(S,s,l)):p>Cn(i.year(),s,l)?(_=p-Cn(i.year(),s,l),S=i.year()+1):(S=i.year(),_=p),{week:_,year:S}}function Cn(i,s,l){var d=xa(i,s,l),p=xa(i+1,s,l);return(fs(i)-d+p)/7}G("w",["ww",2],"wo","week"),G("W",["WW",2],"Wo","isoWeek"),Z("w",Me,Ji),Z("ww",Me,or),Z("W",Me,Ji),Z("WW",Me,or),ds(["w","ww","W","WW"],function(i,s,l,d){s[d.substr(0,1)]=fe(i)});function _b(i){return hs(i,this._week.dow,this._week.doy).week}var Ib={dow:0,doy:6};function wb(){return this._week.dow}function Cb(){return this._week.doy}function xb(i){var s=this.localeData().week(this);return i==null?s:this.add((i-s)*7,"d")}function Ab(i){var s=hs(this,1,4).week;return i==null?s:this.add((i-s)*7,"d")}G("d",0,"do","day"),G("dd",0,0,function(i){return this.localeData().weekdaysMin(this,i)}),G("ddd",0,0,function(i){return this.localeData().weekdaysShort(this,i)}),G("dddd",0,0,function(i){return this.localeData().weekdays(this,i)}),G("e",0,0,"weekday"),G("E",0,0,"isoWeekday"),Z("d",Me),Z("e",Me),Z("E",Me),Z("dd",function(i,s){return s.weekdaysMinRegex(i)}),Z("ddd",function(i,s){return s.weekdaysShortRegex(i)}),Z("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 kb(i,s){return typeof i!="string"?i:isNaN(i)?(i=s.weekdaysParse(i),typeof i=="number"?i:null):parseInt(i,10)}function Sb(i,s){return typeof i=="string"?s.weekdaysParse(i)%7||7:isNaN(i)?null:i}function Zu(i,s){return i.slice(s,7).concat(i.slice(0,s))}var Rb="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Af="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Fb="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Tb=cs,Eb=cs,Gb=cs;function Bb(i,s){var l=n(this._weekdays)?this._weekdays:this._weekdays[i&&i!==!0&&this._weekdays.isFormat.test(s)?"format":"standalone"];return i===!0?Zu(l,this._week.dow):i?l[i.day()]:l}function Db(i){return i===!0?Zu(this._weekdaysShort,this._week.dow):i?this._weekdaysShort[i.day()]:this._weekdaysShort}function Nb(i){return i===!0?Zu(this._weekdaysMin,this._week.dow):i?this._weekdaysMin[i.day()]:this._weekdaysMin}function Wb(i,s,l){var d,p,_,S=i.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)_=g([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(_,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(_,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(_,"").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 Zb(i,s,l){var d,p,_;if(this._weekdaysParseExact)return Wb.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]||(_="^"+this.weekdays(p,"")+"|^"+this.weekdaysShort(p,"")+"|^"+this.weekdaysMin(p,""),this._weekdaysParse[d]=new RegExp(_.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 Mb(i){if(!this.isValid())return i!=null?this:NaN;var s=ms(this,"Day");return i!=null?(i=kb(i,this.localeData()),this.add(i-s,"d")):s}function Yb(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 Xb(i){if(!this.isValid())return i!=null?this:NaN;if(i!=null){var s=Sb(i,this.localeData());return this.day(this.day()%7?s:s-7)}else return this.day()||7}function Ub(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Mu.call(this),i?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Tb),this._weekdaysStrictRegex&&i?this._weekdaysStrictRegex:this._weekdaysRegex)}function Qb(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Mu.call(this),i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Eb),this._weekdaysShortStrictRegex&&i?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Vb(i){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Mu.call(this),i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Gb),this._weekdaysMinStrictRegex&&i?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Mu(){function i(Ot,Rn){return Rn.length-Ot.length}var s=[],l=[],d=[],p=[],_,S,W,te,ge;for(_=0;_<7;_++)S=g([2e3,1]).day(_),W=_n(this.weekdaysMin(S,"")),te=_n(this.weekdaysShort(S,"")),ge=_n(this.weekdays(S,"")),s.push(W),l.push(te),d.push(ge),p.push(W),p.push(te),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 Yu(){return this.hours()%12||12}function Lb(){return this.hours()||24}G("H",["HH",2],0,"hour"),G("h",["hh",2],0,Yu),G("k",["kk",2],0,Lb),G("hmm",0,0,function(){return""+Yu.apply(this)+oe(this.minutes(),2)}),G("hmmss",0,0,function(){return""+Yu.apply(this)+oe(this.minutes(),2)+oe(this.seconds(),2)}),G("Hmm",0,0,function(){return""+this.hours()+oe(this.minutes(),2)}),G("Hmmss",0,0,function(){return""+this.hours()+oe(this.minutes(),2)+oe(this.seconds(),2)});function kf(i,s){G(i,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),s)})}kf("a",!0),kf("A",!1);function Sf(i,s){return s._meridiemParse}Z("a",Sf),Z("A",Sf),Z("H",Me,Du),Z("h",Me,Ji),Z("k",Me,Ji),Z("HH",Me,or),Z("hh",Me,or),Z("kk",Me,or),Z("hmm",hf),Z("hmmss",gf),Z("Hmm",hf),Z("Hmmss",gf),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 Ob(i){return(i+"").toLowerCase().charAt(0)==="p"}var $b=/[ap]\.?m?\.?/i,Pb=ji("Hours",!0);function Hb(i,s,l){return i>11?l?"pm":"PM":l?"am":"AM"}var Rf={calendar:Kt,longDateFormat:wi,invalidDate:yn,ordinal:us,dayOfMonthOrdinalParse:Tu,relativeTime:Pg,months:ub,monthsShort:yf,week:Ib,weekdays:Rb,weekdaysMin:Fb,weekdaysShort:Af,meridiemParse:$b},Ue={},gs={},bs;function Jb(i,s){var l,d=Math.min(i.length,s.length);for(l=0;l<d;l+=1)if(i[l]!==s[l])return l;return d}function Ff(i){return i&&i.toLowerCase().replace("_","-")}function jb(i){for(var s=0,l,d,p,_;s<i.length;){for(_=Ff(i[s]).split("-"),l=_.length,d=Ff(i[s+1]),d=d?d.split("-"):null;l>0;){if(p=Aa(_.slice(0,l).join("-")),p)return p;if(d&&d.length>=l&&Jb(_,d)>=l-1)break;l--}s++}return bs}function zb(i){return!!(i&&i.match("^[^/\\\\]*$"))}function Aa(i){var s=null,l;if(Ue[i]===void 0&&typeof no!="undefined"&&no&&no.exports&&zb(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&&(c(s)?l=xn(i):l=Xu(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 Xu(i,s){if(s!==null){var l,d=Rf;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=Aa(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){Xu(p.name,p.config)}),ri(i),Ue[i]}else return delete Ue[i],null}function Kb(i,s){if(s!=null){var l,d,p=Rf;Ue[i]!=null&&Ue[i].parentLocale!=null?Ue[i].set(Ze(Ue[i]._config,s)):(d=Aa(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=Aa(i),s)return s;i=[i]}return jb(i)}function qb(){return At(Ue)}function Uu(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]>Wu(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&&(s<Dt||s>Jr)&&(s=Jr),y(i)._overflowWeeks&&s===-1&&(s=nb),y(i)._overflowWeekday&&s===-1&&(s=ib),y(i).overflow=s),i}var ev=/^\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)?)?$/,tv=/^\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)?)?$/,rv=/Z|[+-]\d\d(?::?\d\d)?/,ka=[["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]],Qu=[["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/]],nv=/^\/?Date\((-?\d+)/i,iv=/^(?:(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}))$/,ov={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Tf(i){var s,l,d=i._i,p=ev.exec(d)||tv.exec(d),_,S,W,te,ge=ka.length,Ot=Qu.length;if(p){for(y(i).iso=!0,s=0,l=ge;s<l;s++)if(ka[s][1].exec(p[1])){S=ka[s][0],_=ka[s][2]!==!1;break}if(S==null){i._isValid=!1;return}if(p[3]){for(s=0,l=Ot;s<l;s++)if(Qu[s][1].exec(p[3])){W=(p[2]||" ")+Qu[s][0];break}if(W==null){i._isValid=!1;return}}if(!_&&W!=null){i._isValid=!1;return}if(p[4])if(rv.exec(p[4]))te="Z";else{i._isValid=!1;return}i._f=S+(W||"")+(te||""),Lu(i)}else i._isValid=!1}function sv(i,s,l,d,p,_){var S=[av(i),yf.indexOf(s),parseInt(l,10),parseInt(d,10),parseInt(p,10)];return _&&S.push(parseInt(_,10)),S}function av(i){var s=parseInt(i,10);return s<=49?2e3+s:s<=999?1900+s:s}function lv(i){return i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function uv(i,s,l){if(i){var d=Af.indexOf(i),p=new Date(s[0],s[1],s[2]).getDay();if(d!==p)return y(l).weekdayMismatch=!0,l._isValid=!1,!1}return!0}function cv(i,s,l){if(i)return ov[i];if(s)return 0;var d=parseInt(l,10),p=d%100,_=(d-p)/100;return _*60+p}function Ef(i){var s=iv.exec(lv(i._i)),l;if(s){if(l=sv(s[4],s[3],s[2],s[5],s[6],s[7]),!uv(s[1],l,i))return;i._a=l,i._tzm=cv(s[8],s[9],s[10]),i._d=ps.apply(null,i._a),i._d.setUTCMinutes(i._d.getUTCMinutes()-i._tzm),y(i).rfc2822=!0}else i._isValid=!1}function dv(i){var s=nv.exec(i._i);if(s!==null){i._d=new Date(+s[1]);return}if(Tf(i),i._isValid===!1)delete i._isValid;else return;if(Ef(i),i._isValid===!1)delete i._isValid;else return;i._strict?i._isValid=!1:e.createFromInputFallback(i)}e.createFromInputFallback=_e("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(i){i._d=new Date(i._i+(i._useUTC?" UTC":""))});function zi(i,s,l){return i!=null?i:s!=null?s:l}function fv(i){var s=new Date(e.now());return i._useUTC?[s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()]:[s.getFullYear(),s.getMonth(),s.getDate()]}function Vu(i){var s,l,d=[],p,_,S;if(!i._d){for(p=fv(i),i._w&&i._a[Jr]==null&&i._a[In]==null&&mv(i),i._dayOfYear!=null&&(S=zi(i._a[Dt],p[Dt]),(i._dayOfYear>fs(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:yb).apply(null,d),_=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!==_&&(y(i).weekdayMismatch=!0)}}function mv(i){var s,l,d,p,_,S,W,te,ge;s=i._w,s.GG!=null||s.W!=null||s.E!=null?(_=1,S=4,l=zi(s.GG,i._a[Dt],hs(Ye(),1,4).year),d=zi(s.W,1),p=zi(s.E,1),(p<1||p>7)&&(te=!0)):(_=i._locale._week.dow,S=i._locale._week.doy,ge=hs(Ye(),_,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)&&(te=!0)):s.e!=null?(p=s.e+_,(s.e<0||s.e>6)&&(te=!0)):p=_),d<1||d>Cn(l,_,S)?y(i)._overflowWeeks=!0:te!=null?y(i)._overflowWeekday=!0:(W=xf(l,d,p,_,S),i._a[Dt]=W.year,i._dayOfYear=W.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Lu(i){if(i._f===e.ISO_8601){Tf(i);return}if(i._f===e.RFC_2822){Ef(i);return}i._a=[],y(i).empty=!0;var s=""+i._i,l,d,p,_,S,W=s.length,te=0,ge,Ot;for(p=Ve(i._f,i._locale).match(N)||[],Ot=p.length,l=0;l<Ot;l++)_=p[l],d=(s.match(eb(_,i))||[])[0],d&&(S=s.substr(0,s.indexOf(d)),S.length>0&&y(i).unusedInput.push(S),s=s.slice(s.indexOf(d)+d.length),te+=d.length),E[_]?(d?y(i).empty=!1:y(i).unusedTokens.push(_),rb(_,d,i)):i._strict&&!d&&y(i).unusedTokens.push(_);y(i).charsLeftOver=W-te,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]=pv(i._locale,i._a[ct],i._meridiem),ge=y(i).era,ge!==null&&(i._a[Dt]=i._locale.erasConvertYear(ge,i._a[Dt])),Vu(i),Uu(i)}function pv(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 hv(i){var s,l,d,p,_,S,W=!1,te=i._f.length;if(te===0){y(i).invalidFormat=!0,i._d=new Date(NaN);return}for(p=0;p<te;p++)_=0,S=!1,s=P({},i),i._useUTC!=null&&(s._useUTC=i._useUTC),s._f=i._f[p],Lu(s),x(s)&&(S=!0),_+=y(s).charsLeftOver,_+=y(s).unusedTokens.length*10,y(s).score=_,W?_<d&&(d=_,l=s):(d==null||_<d||S)&&(d=_,l=s,S&&(W=!0));I(i,l||s)}function gv(i){if(!i._d){var s=Eu(i._i),l=s.day===void 0?s.date:s.day;i._a=b([s.year,s.month,l,s.hour,s.minute,s.second,s.millisecond],function(d){return d&&parseInt(d,10)}),Vu(i)}}function bv(i){var s=new ie(Uu(Gf(i)));return s._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function Gf(i){var s=i._i,l=i._f;return i._locale=i._locale||xn(i._l),s===null||l===void 0&&s===""?k({nullInput:!0}):(typeof s=="string"&&(i._i=s=i._locale.preparse(s)),Y(s)?new ie(Uu(s)):(h(s)?i._d=s:n(l)?hv(i):l?Lu(i):vv(i),x(i)||(i._d=null),i))}function vv(i){var s=i._i;c(s)?i._d=new Date(e.now()):h(s)?i._d=new Date(s.valueOf()):typeof s=="string"?dv(i):n(s)?(i._a=b(s.slice(0),function(l){return parseInt(l,10)}),Vu(i)):o(s)?gv(i):f(s)?i._d=new Date(s):e.createFromInputFallback(i)}function Bf(i,s,l,d,p){var _={};return(s===!0||s===!1)&&(d=s,s=void 0),(l===!0||l===!1)&&(d=l,l=void 0),(o(i)&&u(i)||n(i)&&i.length===0)&&(i=void 0),_._isAMomentObject=!0,_._useUTC=_._isUTC=p,_._l=l,_._i=i,_._f=s,_._strict=d,bv(_)}function Ye(i,s,l,d){return Bf(i,s,l,d,!1)}var yv=_e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var i=Ye.apply(null,arguments);return this.isValid()&&i.isValid()?i<this?this:i:k()}),_v=_e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var i=Ye.apply(null,arguments);return this.isValid()&&i.isValid()?i>this?this:i:k()});function Df(i,s){var l,d;if(s.length===1&&n(s[0])&&(s=s[0]),!s.length)return Ye();for(l=s[0],d=1;d<s.length;++d)(!s[d].isValid()||s[d][i](l))&&(l=s[d]);return l}function Iv(){var i=[].slice.call(arguments,0);return Df("isBefore",i)}function wv(){var i=[].slice.call(arguments,0);return Df("isAfter",i)}var Cv=function(){return Date.now?Date.now():+new Date},vs=["year","quarter","month","week","day","hour","minute","second","millisecond"];function xv(i){var s,l=!1,d,p=vs.length;for(s in i)if(a(i,s)&&!(je.call(vs,s)!==-1&&(i[s]==null||!isNaN(i[s]))))return!1;for(d=0;d<p;++d)if(i[vs[d]]){if(l)return!1;parseFloat(i[vs[d]])!==fe(i[vs[d]])&&(l=!0)}return!0}function Av(){return this._isValid}function kv(){return Nr(NaN)}function Sa(i){var s=Eu(i),l=s.year||0,d=s.quarter||0,p=s.month||0,_=s.week||s.isoWeek||0,S=s.day||0,W=s.hour||0,te=s.minute||0,ge=s.second||0,Ot=s.millisecond||0;this._isValid=xv(s),this._milliseconds=+Ot+ge*1e3+te*6e4+W*1e3*60*60,this._days=+S+_*7,this._months=+p+d*3+l*12,this._data={},this._locale=xn(),this._bubble()}function Ra(i){return i instanceof Sa}function Ou(i){return i<0?Math.round(-1*i)*-1:Math.round(i)}function Sv(i,s,l){var d=Math.min(i.length,s.length),p=Math.abs(i.length-s.length),_=0,S;for(S=0;S<d;S++)(l&&i[S]!==s[S]||!l&&fe(i[S])!==fe(s[S]))&&_++;return _+p}function Nf(i,s){G(i,0,0,function(){var l=this.utcOffset(),d="+";return l<0&&(l=-l,d="-"),d+oe(~~(l/60),2)+s+oe(~~l%60,2)})}Nf("Z",":"),Nf("ZZ",""),Z("Z",Ia),Z("ZZ",Ia),Re(["Z","ZZ"],function(i,s,l){l._useUTC=!0,l._tzm=$u(Ia,i)});var Rv=/([\+\-]|\d\d)/gi;function $u(i,s){var l=(s||"").match(i),d,p,_;return l===null?null:(d=l[l.length-1]||[],p=(d+"").match(Rv)||["-",0,0],_=+(p[1]*60)+fe(p[2]),_===0?0:p[0]==="+"?_:-_)}function Pu(i,s){var l,d;return s._isUTC?(l=s.clone(),d=(Y(i)||h(i)?i.valueOf():Ye(i).valueOf())-l.valueOf(),l._d.setTime(l._d.valueOf()+d),e.updateOffset(l,!1),l):Ye(i).local()}function Hu(i){return-Math.round(i._d.getTimezoneOffset())}e.updateOffset=function(){};function Fv(i,s,l){var d=this._offset||0,p;if(!this.isValid())return i!=null?this:NaN;if(i!=null){if(typeof i=="string"){if(i=$u(Ia,i),i===null)return this}else Math.abs(i)<16&&!l&&(i=i*60);return!this._isUTC&&s&&(p=Hu(this)),this._offset=i,this._isUTC=!0,p!=null&&this.add(p,"m"),d!==i&&(!s||this._changeInProgress?Yf(this,Nr(i-d,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?d:Hu(this)}function Tv(i,s){return i!=null?(typeof i!="string"&&(i=-i),this.utcOffset(i,s),this):-this.utcOffset()}function Ev(i){return this.utcOffset(0,i)}function Gv(i){return this._isUTC&&(this.utcOffset(0,i),this._isUTC=!1,i&&this.subtract(Hu(this),"m")),this}function Bv(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var i=$u(Kg,this._i);i!=null?this.utcOffset(i):this.utcOffset(0,!0)}return this}function Dv(i){return this.isValid()?(i=i?Ye(i).utcOffset():0,(this.utcOffset()-i)%60===0):!1}function Nv(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Wv(){if(!c(this._isDSTShifted))return this._isDSTShifted;var i={},s;return P(i,this),i=Gf(i),i._a?(s=i._isUTC?g(i._a):Ye(i._a),this._isDSTShifted=this.isValid()&&Sv(i._a,s.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Zv(){return this.isValid()?!this._isUTC:!1}function Mv(){return this.isValid()?this._isUTC:!1}function Wf(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Yv=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Xv=/^(-|\+)?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,_,S;return Ra(i)?l={ms:i._milliseconds,d:i._days,M:i._months}:f(i)||!isNaN(+i)?(l={},s?l[s]=+i:l.milliseconds=+i):(d=Yv.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(Ou(d[Ci]*1e3))*p}):(d=Xv.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=Uv(Ye(l.from),Ye(l.to)),l={},l.ms=S.milliseconds,l.M=S.months),_=new Sa(l),Ra(i)&&a(i,"_locale")&&(_._locale=i._locale),Ra(i)&&a(i,"_isValid")&&(_._isValid=i._isValid),_}Nr.fn=Sa.prototype,Nr.invalid=kv;function xi(i,s){var l=i&&parseFloat(i.replace(",","."));return(isNaN(l)?0:l)*s}function Zf(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 Uv(i,s){var l;return i.isValid()&&s.isValid()?(s=Pu(s,i),i.isBefore(s)?l=Zf(i,s):(l=Zf(s,i),l.milliseconds=-l.milliseconds,l.months=-l.months),l):{milliseconds:0,months:0}}function Mf(i,s){return function(l,d){var p,_;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."),_=l,l=d,d=_),p=Nr(l,d),Yf(this,p,i),this}}function Yf(i,s,l,d){var p=s._milliseconds,_=Ou(s._days),S=Ou(s._months);i.isValid()&&(d=d==null?!0:d,S&&If(i,ms(i,"Month")+S*l),_&&vf(i,"Date",ms(i,"Date")+_*l),p&&i._d.setTime(i._d.valueOf()+p*l),d&&e.updateOffset(i,_||S))}var Qv=Mf(1,"add"),Vv=Mf(-1,"subtract");function Xf(i){return typeof i=="string"||i instanceof String}function Lv(i){return Y(i)||h(i)||Xf(i)||f(i)||$v(i)||Ov(i)||i===null||i===void 0}function Ov(i){var s=o(i)&&!u(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,_,S=d.length;for(p=0;p<S;p+=1)_=d[p],l=l||a(i,_);return s&&l}function $v(i){var s=n(i),l=!1;return s&&(l=i.filter(function(d){return!f(d)&&Xf(i)}).length===0),s&&l}function Pv(i){var s=o(i)&&!u(i),l=!1,d=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],p,_;for(p=0;p<d.length;p+=1)_=d[p],l=l||a(i,_);return s&&l}function Hv(i,s){var l=i.diff(s,"days",!0);return l<-6?"sameElse":l<-1?"lastWeek":l<0?"lastDay":l<1?"sameDay":l<2?"nextDay":l<7?"nextWeek":"sameElse"}function Jv(i,s){arguments.length===1&&(arguments[0]?Lv(arguments[0])?(i=arguments[0],s=void 0):Pv(arguments[0])&&(s=arguments[0],i=void 0):(i=void 0,s=void 0));var l=i||Ye(),d=Pu(l,this).startOf("day"),p=e.calendarFormat(this,d)||"sameElse",_=s&&(he(s[p])?s[p].call(this,l):s[p]);return this.format(_||this.localeData().calendar(p,this,Ye(l)))}function jv(){return new ie(this)}function zv(i,s){var l=Y(i)?i:Ye(i);return this.isValid()&&l.isValid()?(s=_r(s)||"millisecond",s==="millisecond"?this.valueOf()>l.valueOf():l.valueOf()<this.clone().startOf(s).valueOf()):!1}function Kv(i,s){var l=Y(i)?i:Ye(i);return this.isValid()&&l.isValid()?(s=_r(s)||"millisecond",s==="millisecond"?this.valueOf()<l.valueOf():this.clone().endOf(s).valueOf()<l.valueOf()):!1}function qv(i,s,l,d){var p=Y(i)?i:Ye(i),_=Y(s)?s:Ye(s);return this.isValid()&&p.isValid()&&_.isValid()?(d=d||"()",(d[0]==="("?this.isAfter(p,l):!this.isBefore(p,l))&&(d[1]===")"?this.isBefore(_,l):!this.isAfter(_,l))):!1}function ey(i,s){var l=Y(i)?i:Ye(i),d;return this.isValid()&&l.isValid()?(s=_r(s)||"millisecond",s==="millisecond"?this.valueOf()===l.valueOf():(d=l.valueOf(),this.clone().startOf(s).valueOf()<=d&&d<=this.clone().endOf(s).valueOf())):!1}function ty(i,s){return this.isSame(i,s)||this.isAfter(i,s)}function ry(i,s){return this.isSame(i,s)||this.isBefore(i,s)}function ny(i,s,l){var d,p,_;if(!this.isValid())return NaN;if(d=Pu(i,this),!d.isValid())return NaN;switch(p=(d.utcOffset()-this.utcOffset())*6e4,s=_r(s),s){case"year":_=Fa(this,d)/12;break;case"month":_=Fa(this,d);break;case"quarter":_=Fa(this,d)/3;break;case"second":_=(this-d)/1e3;break;case"minute":_=(this-d)/6e4;break;case"hour":_=(this-d)/36e5;break;case"day":_=(this-d-p)/864e5;break;case"week":_=(this-d-p)/6048e5;break;default:_=this-d}return l?_:Ir(_)}function Fa(i,s){if(i.date()<s.date())return-Fa(s,i);var l=(s.year()-i.year())*12+(s.month()-i.month()),d=i.clone().add(l,"months"),p,_;return s-d<0?(p=i.clone().add(l-1,"months"),_=(s-d)/(d-p)):(p=i.clone().add(l+1,"months"),_=(s-d)/(p-d)),-(l+_)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function iy(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function oy(i){if(!this.isValid())return null;var s=i!==!0,l=s?this.clone().utc():this;return l.year()<0||l.year()>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 sy(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var i="moment",s="",l,d,p,_;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",_=s+'[")]',this.format(l+d+p+_)}function ay(i){i||(i=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var s=ut(this,i);return this.localeData().postformat(s)}function ly(i,s){return this.isValid()&&(Y(i)&&i.isValid()||Ye(i).isValid())?Nr({to:this,from:i}).locale(this.locale()).humanize(!s):this.localeData().invalidDate()}function uy(i){return this.from(Ye(),i)}function cy(i,s){return this.isValid()&&(Y(i)&&i.isValid()||Ye(i).isValid())?Nr({from:this,to:i}).locale(this.locale()).humanize(!s):this.localeData().invalidDate()}function dy(i){return this.to(Ye(),i)}function Uf(i){var s;return i===void 0?this._locale._abbr:(s=xn(i),s!=null&&(this._locale=s),this)}var Qf=_e("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 Vf(){return this._locale}var Ta=1e3,Ki=60*Ta,Ea=60*Ki,Lf=(365*400+97)*24*Ea;function qi(i,s){return(i%s+s)%s}function Of(i,s,l){return i<100&&i>=0?new Date(i+400,s,l)-Lf:new Date(i,s,l).valueOf()}function $f(i,s,l){return i<100&&i>=0?Date.UTC(i+400,s,l)-Lf:Date.UTC(i,s,l)}function fy(i){var s,l;if(i=_r(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(l=this._isUTC?$f:Of,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),Ea);break;case"minute":s=this._d.valueOf(),s-=qi(s,Ki);break;case"second":s=this._d.valueOf(),s-=qi(s,Ta);break}return this._d.setTime(s),e.updateOffset(this,!0),this}function my(i){var s,l;if(i=_r(i),i===void 0||i==="millisecond"||!this.isValid())return this;switch(l=this._isUTC?$f:Of,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+=Ea-qi(s+(this._isUTC?0:this.utcOffset()*Ki),Ea)-1;break;case"minute":s=this._d.valueOf(),s+=Ki-qi(s,Ki)-1;break;case"second":s=this._d.valueOf(),s+=Ta-qi(s,Ta)-1;break}return this._d.setTime(s),e.updateOffset(this,!0),this}function py(){return this._d.valueOf()-(this._offset||0)*6e4}function hy(){return Math.floor(this.valueOf()/1e3)}function gy(){return new Date(this.valueOf())}function by(){var i=this;return[i.year(),i.month(),i.date(),i.hour(),i.minute(),i.second(),i.millisecond()]}function vy(){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 yy(){return this.isValid()?this.toISOString():null}function _y(){return x(this)}function Iy(){return I({},y(this))}function wy(){return y(this).overflow}function Cy(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}G("N",0,0,"eraAbbr"),G("NN",0,0,"eraAbbr"),G("NNN",0,0,"eraAbbr"),G("NNNN",0,0,"eraName"),G("NNNNN",0,0,"eraNarrow"),G("y",["y",1],"yo","eraYear"),G("y",["yy",2],0,"eraYear"),G("y",["yyy",3],0,"eraYear"),G("y",["yyyy",4],0,"eraYear"),Z("N",Ju),Z("NN",Ju),Z("NNN",Ju),Z("NNNN",Dy),Z("NNNNN",Ny),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}),Z("y",Hi),Z("yy",Hi),Z("yyy",Hi),Z("yyyy",Hi),Z("yo",Wy),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 xy(i,s){var l,d,p,_=this._eras||xn("en")._eras;for(l=0,d=_.length;l<d;++l)switch(typeof _[l].since==="string"&&(p=e(_[l].since).startOf("day"),_[l].since=p.valueOf()),typeof _[l].until){case"undefined":_[l].until=1/0;break;case"string":p=e(_[l].until).startOf("day").valueOf(),_[l].until=p.valueOf();break}return _}function Ay(i,s,l){var d,p,_=this.eras(),S,W,te;for(i=i.toUpperCase(),d=0,p=_.length;d<p;++d)if(S=_[d].name.toUpperCase(),W=_[d].abbr.toUpperCase(),te=_[d].narrow.toUpperCase(),l)switch(s){case"N":case"NN":case"NNN":if(W===i)return _[d];break;case"NNNN":if(S===i)return _[d];break;case"NNNNN":if(te===i)return _[d];break}else if([S,W,te].indexOf(i)>=0)return _[d]}function ky(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 Sy(){var i,s,l,d=this.localeData().eras();for(i=0,s=d.length;i<s;++i)if(l=this.clone().startOf("day").valueOf(),d[i].since<=l&&l<=d[i].until||d[i].until<=l&&l<=d[i].since)return d[i].name;return""}function Ry(){var i,s,l,d=this.localeData().eras();for(i=0,s=d.length;i<s;++i)if(l=this.clone().startOf("day").valueOf(),d[i].since<=l&&l<=d[i].until||d[i].until<=l&&l<=d[i].since)return d[i].narrow;return""}function Fy(){var i,s,l,d=this.localeData().eras();for(i=0,s=d.length;i<s;++i)if(l=this.clone().startOf("day").valueOf(),d[i].since<=l&&l<=d[i].until||d[i].until<=l&&l<=d[i].since)return d[i].abbr;return""}function Ty(){var i,s,l,d,p=this.localeData().eras();for(i=0,s=p.length;i<s;++i)if(l=p[i].since<=p[i].until?1:-1,d=this.clone().startOf("day").valueOf(),p[i].since<=d&&d<=p[i].until||p[i].until<=d&&d<=p[i].since)return(this.year()-e(p[i].since).year())*l+p[i].offset;return this.year()}function Ey(i){return a(this,"_erasNameRegex")||ju.call(this),i?this._erasNameRegex:this._erasRegex}function Gy(i){return a(this,"_erasAbbrRegex")||ju.call(this),i?this._erasAbbrRegex:this._erasRegex}function By(i){return a(this,"_erasNarrowRegex")||ju.call(this),i?this._erasNarrowRegex:this._erasRegex}function Ju(i,s){return s.erasAbbrRegex(i)}function Dy(i,s){return s.erasNameRegex(i)}function Ny(i,s){return s.erasNarrowRegex(i)}function Wy(i,s){return s._eraYearOrdinalRegex||Hi}function ju(){var i=[],s=[],l=[],d=[],p,_,S,W,te,ge=this.eras();for(p=0,_=ge.length;p<_;++p)S=_n(ge[p].name),W=_n(ge[p].abbr),te=_n(ge[p].narrow),s.push(S),i.push(W),l.push(te),d.push(S),d.push(W),d.push(te);this._erasRegex=new RegExp("^("+d.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+s.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+l.join("|")+")","i")}G(0,["gg",2],0,function(){return this.weekYear()%100}),G(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ga(i,s){G(0,[i,i.length],0,s)}Ga("gggg","weekYear"),Ga("ggggg","weekYear"),Ga("GGGG","isoWeekYear"),Ga("GGGGG","isoWeekYear"),Z("G",_a),Z("g",_a),Z("GG",Me,or),Z("gg",Me,or),Z("GGGG",Bu,Gu),Z("gggg",Bu,Gu),Z("GGGGG",ya,ba),Z("ggggg",ya,ba),ds(["gggg","ggggg","GGGG","GGGGG"],function(i,s,l,d){s[d.substr(0,2)]=fe(i)}),ds(["gg","GG"],function(i,s,l,d){s[d]=e.parseTwoDigitYear(i)});function Zy(i){return Pf.call(this,i,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function My(i){return Pf.call(this,i,this.isoWeek(),this.isoWeekday(),1,4)}function Yy(){return Cn(this.year(),1,4)}function Xy(){return Cn(this.isoWeekYear(),1,4)}function Uy(){var i=this.localeData()._week;return Cn(this.year(),i.dow,i.doy)}function Qy(){var i=this.localeData()._week;return Cn(this.weekYear(),i.dow,i.doy)}function Pf(i,s,l,d,p){var _;return i==null?hs(this,d,p).year:(_=Cn(i,d,p),s>_&&(s=_),Vy.call(this,i,s,l,d,p))}function Vy(i,s,l,d,p){var _=xf(i,s,l,d,p),S=ps(_.year,0,_.dayOfYear);return this.year(S.getUTCFullYear()),this.month(S.getUTCMonth()),this.date(S.getUTCDate()),this}G("Q",0,"Qo","quarter"),Z("Q",mf),Re("Q",function(i,s){s[In]=(fe(i)-1)*3});function Ly(i){return i==null?Math.ceil((this.month()+1)/3):this.month((i-1)*3+this.month()%3)}G("D",["DD",2],"Do","date"),Z("D",Me,Ji),Z("DD",Me,or),Z("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(Me)[0])});var Hf=ji("Date",!0);G("DDD",["DDDD",3],"DDDo","dayOfYear"),Z("DDD",va),Z("DDDD",pf),Re(["DDD","DDDD"],function(i,s,l){l._dayOfYear=fe(i)});function Oy(i){var s=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return i==null?s:this.add(i-s,"d")}G("m",["mm",2],0,"minute"),Z("m",Me,Du),Z("mm",Me,or),Re(["m","mm"],Dr);var $y=ji("Minutes",!1);G("s",["ss",2],0,"second"),Z("s",Me,Du),Z("ss",Me,or),Re(["s","ss"],wn);var Py=ji("Seconds",!1);G("S",0,0,function(){return~~(this.millisecond()/100)}),G(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),G(0,["SSS",3],0,"millisecond"),G(0,["SSSS",4],0,function(){return this.millisecond()*10}),G(0,["SSSSS",5],0,function(){return this.millisecond()*100}),G(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),G(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),G(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),G(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Z("S",va,mf),Z("SS",va,or),Z("SSS",va,pf);var ni,Jf;for(ni="SSSS";ni.length<=9;ni+="S")Z(ni,Hi);function Hy(i,s){s[Ci]=fe(("0."+i)*1e3)}for(ni="S";ni.length<=9;ni+="S")Re(ni,Hy);Jf=ji("Milliseconds",!1),G("z",0,0,"zoneAbbr"),G("zz",0,0,"zoneName");function Jy(){return this._isUTC?"UTC":""}function jy(){return this._isUTC?"Coordinated Universal Time":""}var T=ie.prototype;T.add=Qv,T.calendar=Jv,T.clone=jv,T.diff=ny,T.endOf=my,T.format=ay,T.from=ly,T.fromNow=uy,T.to=cy,T.toNow=dy,T.get=sb,T.invalidAt=wy,T.isAfter=zv,T.isBefore=Kv,T.isBetween=qv,T.isSame=ey,T.isSameOrAfter=ty,T.isSameOrBefore=ry,T.isValid=_y,T.lang=Qf,T.locale=Uf,T.localeData=Vf,T.max=_v,T.min=yv,T.parsingFlags=Iy,T.set=ab,T.startOf=fy,T.subtract=Vv,T.toArray=by,T.toObject=vy,T.toDate=gy,T.toISOString=oy,T.inspect=sy,typeof Symbol!="undefined"&&Symbol.for!=null&&(T[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),T.toJSON=yy,T.toString=iy,T.unix=hy,T.valueOf=py,T.creationData=Cy,T.eraName=Sy,T.eraNarrow=Ry,T.eraAbbr=Fy,T.eraYear=Ty,T.year=bf,T.isLeapYear=ob,T.weekYear=Zy,T.isoWeekYear=My,T.quarter=T.quarters=Ly,T.month=wf,T.daysInMonth=gb,T.week=T.weeks=xb,T.isoWeek=T.isoWeeks=Ab,T.weeksInYear=Uy,T.weeksInWeekYear=Qy,T.isoWeeksInYear=Yy,T.isoWeeksInISOWeekYear=Xy,T.date=Hf,T.day=T.days=Mb,T.weekday=Yb,T.isoWeekday=Xb,T.dayOfYear=Oy,T.hour=T.hours=Pb,T.minute=T.minutes=$y,T.second=T.seconds=Py,T.millisecond=T.milliseconds=Jf,T.utcOffset=Fv,T.utc=Ev,T.local=Gv,T.parseZone=Bv,T.hasAlignedHourOffset=Dv,T.isDST=Nv,T.isLocal=Zv,T.isUtcOffset=Mv,T.isUtc=Wf,T.isUTC=Wf,T.zoneAbbr=Jy,T.zoneName=jy,T.dates=_e("dates accessor is deprecated. Use date instead.",Hf),T.months=_e("months accessor is deprecated. Use month instead",wf),T.years=_e("years accessor is deprecated. Use year instead",bf),T.zone=_e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Tv),T.isDSTShifted=_e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Wv);function zy(i){return Ye(i*1e3)}function Ky(){return Ye.apply(null,arguments).parseZone()}function jf(i){return i}var Ce=rt.prototype;Ce.calendar=Q,Ce.longDateFormat=qt,Ce.invalidDate=ti,Ce.ordinal=$g,Ce.preparse=jf,Ce.postformat=jf,Ce.relativeTime=Hg,Ce.pastFuture=Jg,Ce.set=Lt,Ce.eras=xy,Ce.erasParse=Ay,Ce.erasConvertYear=ky,Ce.erasAbbrRegex=Gy,Ce.erasNameRegex=Ey,Ce.erasNarrowRegex=By,Ce.months=fb,Ce.monthsShort=mb,Ce.monthsParse=hb,Ce.monthsRegex=vb,Ce.monthsShortRegex=bb,Ce.week=_b,Ce.firstDayOfYear=Cb,Ce.firstDayOfWeek=wb,Ce.weekdays=Bb,Ce.weekdaysMin=Nb,Ce.weekdaysShort=Db,Ce.weekdaysParse=Zb,Ce.weekdaysRegex=Ub,Ce.weekdaysShortRegex=Qb,Ce.weekdaysMinRegex=Vb,Ce.isPM=Ob,Ce.meridiem=Hb;function Ba(i,s,l,d){var p=xn(),_=g().set(d,s);return p[l](_,i)}function zf(i,s,l){if(f(i)&&(s=i,i=void 0),i=i||"",s!=null)return Ba(i,s,l,"month");var d,p=[];for(d=0;d<12;d++)p[d]=Ba(i,d,l,"month");return p}function zu(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?p._week.dow:0,S,W=[];if(l!=null)return Ba(s,(l+_)%7,d,"day");for(S=0;S<7;S++)W[S]=Ba(s,(S+_)%7,d,"day");return W}function qy(i,s){return zf(i,s,"months")}function e_(i,s){return zf(i,s,"monthsShort")}function t_(i,s,l){return zu(i,s,l,"weekdays")}function r_(i,s,l){return zu(i,s,l,"weekdaysShort")}function n_(i,s,l){return zu(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=_e("moment.lang is deprecated. Use moment.locale instead.",ri),e.langData=_e("moment.langData is deprecated. Use moment.localeData instead.",xn);var An=Math.abs;function i_(){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 Kf(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 o_(i,s){return Kf(this,i,s,1)}function s_(i,s){return Kf(this,i,s,-1)}function qf(i){return i<0?Math.floor(i):Math.ceil(i)}function a_(){var i=this._milliseconds,s=this._days,l=this._months,d=this._data,p,_,S,W,te;return i>=0&&s>=0&&l>=0||i<=0&&s<=0&&l<=0||(i+=qf(Ku(l)+s)*864e5,s=0,l=0),d.milliseconds=i%1e3,p=Ir(i/1e3),d.seconds=p%60,_=Ir(p/60),d.minutes=_%60,S=Ir(_/60),d.hours=S%24,s+=Ir(S/24),te=Ir(em(s)),l+=te,s-=qf(Ku(te)),W=Ir(l/12),l%=12,d.days=s,d.months=l,d.years=W,this}function em(i){return i*4800/146097}function Ku(i){return i*146097/4800}function l_(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+em(s),i){case"month":return l;case"quarter":return l/3;case"year":return l/12}else switch(s=this._days+Math.round(Ku(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 tm=kn("ms"),u_=kn("s"),c_=kn("m"),d_=kn("h"),f_=kn("d"),m_=kn("w"),p_=kn("M"),h_=kn("Q"),g_=kn("y"),b_=tm;function v_(){return Nr(this)}function y_(i){return i=_r(i),this.isValid()?this[i+"s"]():NaN}function Ai(i){return function(){return this.isValid()?this._data[i]:NaN}}var __=Ai("milliseconds"),I_=Ai("seconds"),w_=Ai("minutes"),C_=Ai("hours"),x_=Ai("days"),A_=Ai("months"),k_=Ai("years");function S_(){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 R_(i,s,l,d,p){return p.relativeTime(s||1,!!l,i,d)}function F_(i,s,l,d){var p=Nr(i).abs(),_=Sn(p.as("s")),S=Sn(p.as("m")),W=Sn(p.as("h")),te=Sn(p.as("d")),ge=Sn(p.as("M")),Ot=Sn(p.as("w")),Rn=Sn(p.as("y")),ii=_<=l.ss&&["s",_]||_<l.s&&["ss",_]||S<=1&&["m"]||S<l.m&&["mm",S]||W<=1&&["h"]||W<l.h&&["hh",W]||te<=1&&["d"]||te<l.d&&["dd",te];return l.w!=null&&(ii=ii||Ot<=1&&["w"]||Ot<l.w&&["ww",Ot]),ii=ii||ge<=1&&["M"]||ge<l.M&&["MM",ge]||Rn<=1&&["y"]||["yy",Rn],ii[2]=s,ii[3]=+i>0,ii[4]=d,R_.apply(null,ii)}function T_(i){return i===void 0?Sn:typeof i=="function"?(Sn=i,!0):!1}function E_(i,s){return eo[i]===void 0?!1:s===void 0?eo[i]:(eo[i]=s,i==="s"&&(eo.ss=s-1),!0)}function G_(i,s){if(!this.isValid())return this.localeData().invalidDate();var l=!1,d=eo,p,_;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(),_=F_(this,!l,d,p),l&&(_=p.pastFuture(+this,_)),p.postformat(_)}var qu=Math.abs;function to(i){return(i>0)-(i<0)||+i}function Da(){if(!this.isValid())return this.localeData().invalidDate();var i=qu(this._milliseconds)/1e3,s=qu(this._days),l=qu(this._months),d,p,_,S,W=this.asSeconds(),te,ge,Ot,Rn;return W?(d=Ir(i/60),p=Ir(d/60),i%=60,d%=60,_=Ir(l/12),l%=12,S=i?i.toFixed(3).replace(/\.?0+$/,""):"",te=W<0?"-":"",ge=to(this._months)!==to(W)?"-":"",Ot=to(this._days)!==to(W)?"-":"",Rn=to(this._milliseconds)!==to(W)?"-":"",te+"P"+(_?ge+_+"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 Ie=Sa.prototype;Ie.isValid=Av,Ie.abs=i_,Ie.add=o_,Ie.subtract=s_,Ie.as=l_,Ie.asMilliseconds=tm,Ie.asSeconds=u_,Ie.asMinutes=c_,Ie.asHours=d_,Ie.asDays=f_,Ie.asWeeks=m_,Ie.asMonths=p_,Ie.asQuarters=h_,Ie.asYears=g_,Ie.valueOf=b_,Ie._bubble=a_,Ie.clone=v_,Ie.get=y_,Ie.milliseconds=__,Ie.seconds=I_,Ie.minutes=w_,Ie.hours=C_,Ie.days=x_,Ie.weeks=S_,Ie.months=A_,Ie.years=k_,Ie.humanize=G_,Ie.toISOString=Da,Ie.toString=Da,Ie.toJSON=Da,Ie.locale=Uf,Ie.localeData=Vf,Ie.toIsoString=_e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Da),Ie.lang=Qf,G("X",0,0,"unix"),G("x",0,0,"valueOf"),Z("x",_a),Z("X",qg),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(Ye),e.fn=T,e.min=Iv,e.max=wv,e.now=Cv,e.utc=g,e.unix=zy,e.months=qy,e.isDate=h,e.locale=ri,e.invalid=k,e.duration=Nr,e.isMoment=Y,e.weekdays=t_,e.parseZone=Ky,e.localeData=xn,e.isDuration=Ra,e.monthsShort=e_,e.weekdaysMin=n_,e.defineLocale=Xu,e.updateLocale=Kb,e.locales=qb,e.weekdaysShort=r_,e.normalizeUnits=_r,e.relativeTimeRounding=T_,e.relativeTimeThreshold=E_,e.calendarFormat=Hv,e.prototype=T,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 NC={};X_(NC,{default:()=>Fu});module.exports=U_(NC);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 tc(r){let e=r.lastIndexOf("/");return(e===-1?r:r.slice(e+1)).replace(/\.md$/i,"")}function rc(r,e){let t=new Map;for(let a of r){let u=t.get(a.sequenceId);u===void 0?t.set(a.sequenceId,[a]):u.push(a)}let n=[],o=[];for(let a of t.values()){let u=a[a.length-1];if(u.event==="message_delete")continue;(u.atSeconds>e?n:o).push({sequenceId:u.sequenceId,atSeconds:u.atSeconds})}return{pending:n,delivered:o}}var nc="obr-";function Is(r){return r.startsWith(nc)}var Q_=16777619,V_=2166136261,L_=2654435769;function im(r,e){let t=e;for(let n=0;n<r.length;n++)t^=r.charCodeAt(n),t=Math.imul(t,Q_);return t>>>0}var O_=`
|
|
`;function om(r,e){return`${r}${O_}${e}`}function sm(r,e,t){let n=om(r,e),o=im(n,V_).toString(36),a=im(n,L_).toString(36),u=`${nc}${o}${a}`;return t===0?u:`${u}-${t}`}function ic(r){var o;let e=[...r].sort((a,u)=>a.file!==u.file?a.file<u.file?-1:1:a.rowNumber-u.rowNumber),t=new Map,n=new Map;for(let a of e){let u=om(a.file,a.title),c=(o=t.get(u))!=null?o:0;t.set(u,c+1),n.set(a,sm(a.file,a.title,c))}return n}var $_=10,P_=1440*60;function oc(r){let{reminders:e,serverPending:t,serverDelivered:n=[],now:o,defaultTime:a,minLeadSeconds:u=$_,horizonSeconds:c=P_}=r,f=o.getTimeInMillis(a),h=f+u*1e3,b=f+c*1e3,I=ic(e),g=new Map;for(let F of e){let P=F.time.getTimeInMillis(a),ie=I.get(F);g.set(ie,Math.floor(P/1e3))}let v=new Map;for(let F of e){let P=F.time.getTimeInMillis(a);if(P<=h||P>b)continue;let ie=I.get(F);v.set(ie,{sequenceId:ie,atSeconds:Math.floor(P/1e3),reminder:F})}let y=new Map;for(let F of t)y.set(F.sequenceId,F);let w=[];for(let F of v.values()){let P=y.get(F.sequenceId);(P===void 0||P.atSeconds!==F.atSeconds)&&w.push(F)}let x=[],k=new Set;function B(F){k.has(F)||(k.add(F),x.push({sequenceId:F}))}for(let F of t)Is(F.sequenceId)&&(v.has(F.sequenceId)||am(F,g)&&B(F.sequenceId));for(let F of n)am(F,g)&&B(F.sequenceId);return{publish:w,delete:x}}function am(r,e){if(!Is(r.sequenceId))return!1;let t=e.get(r.sequenceId);return t===void 0||t!==r.atSeconds}function sc(r){return r.map(e=>e.sequenceId).filter(Is)}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 lm(r){return io(r,"minutes")}function lc(r){return io(r,"hours")}function H_(r){return io(r,"days")}function J_(r){return io(r,"weeks")}function j_(r){return io(r,"months")}function z_(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 uc(){return()=>new $((0,sr.default)().add(1,"days"),!1)}function um(){return()=>new $((0,sr.default)().add(1,"weeks"),!1)}function K_(){return()=>new $((0,sr.default)().add(1,"months"),!1)}function q_(){return()=>new $((0,sr.default)().add(1,"years"),!1)}var Xe=class{constructor(e,t){m(this,"label",e);m(this,"later",t)}};function cm(r){return r.split(`
|
|
`).map(e=>eI(e.trim()))}function eI(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}`,lm(t))}case"hour":case"hours":{let n=t==1?"hour":"hours";return new Xe(`In ${t} ${n}`,lc(t))}case"day":case"days":{let n=t==1?"day":"days";return new Xe(`In ${t} ${n}`,H_(t))}case"week":case"weeks":{let n=t==1?"week":"weeks";return new Xe(`In ${t} ${n}`,J_(t))}case"month":case"months":{let n=t==1?"month":"months";return new Xe(`In ${t} ${n}`,j_(t))}case"year":case"years":{let n=t==1?"year":"years";return new Xe(`In ${t} ${n}`,z_(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",uc());case"week":return new Xe("Next week",um());case"month":return new Xe("Next month",K_());case"year":return new Xe("Next year",q_());default:throw`Unsupported weekday: ${e}`}}else if(r==="tomorrow")return new Xe("Tomorrow",uc());throw`Unsupported format: ${r}`}var dc=[new Xe("In 30 minutes",lm(30)),new Xe("In 1 hours",lc(1)),new Xe("In 3 hours",lc(3)),new Xe("Tomorrow",uc()),new Xe("Next week",um())],cc=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 cc;var Wa=require("obsidian");var tI=1800*1e3,rI=10*1e3,ws=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()},tI))}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()},rI))}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{pending:o}=await this.fetchServerState(t,n),a=sc(o);for(let u of a)await this.deleteScheduled(t,n,u)}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{pending:o,delivered:a}=await this.fetchServerState(t,n),u=oc({reminders:this.deps.reminders(),serverPending:o,serverDelivered:a,now:$.now(),defaultTime:this.deps.defaultTime()});for(let c of u.delete)await this.deleteScheduled(t,n,c.sequenceId);for(let c of u.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 fetchServerState(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 the topic's scheduled messages: status=${n.status}`);let o=[];for(let u of n.text.split(`
|
|
`)){let c=u.trim();if(c.length===0)continue;let f;try{f=JSON.parse(c)}catch(h){console.error("[ntfy] Failed to parse a poll response line: %o",h);continue}f.event!=="message"&&f.event!=="message_delete"||f.sequence_id===void 0||f.time===void 0||o.push({event:f.event,sequenceId:f.sequence_id,atSeconds:f.time})}let a=Math.floor(Date.now()/1e3);return rc(o,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:tc(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 kp=require("obsidian");var dm=require("obsidian");function fm(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 dm.Notice(`Muted ${n} reminder${n===1?"":"s"}`),!0}var fc=require("obsidian");var mm=require("obsidian");var Za=class extends mm.SuggestModal{constructor(t,n,o,a){super(t);m(this,"laters",n);m(this,"onSelect",o);m(this,"onCloseCallback",a);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)}onClose(){var t;(t=this.onCloseCallback)==null||t.call(this)}};function nI(r,e){let t=e.later();r.data.dndUntil.value=t,r.data.save(!0),r.ui.refreshDndStatusBar(),new fc.Notice(`Reminder notifications paused until ${t.format("YYYY-MM-DD HH:mm")}`)}function Ma(r){r.data.dndUntil.value=null,r.data.save(!0),r.ui.refreshDndStatusBar(),new fc.Notice("Reminder notifications resumed")}function Ya(r,e){new Za(r.app,r.settings.laters.value,t=>{nI(r,t)},e).open()}function pm(r,e){return r||Ya(e),!0}function oo(r,e){return r==null?!1:e.getTimeInMillis()<r.getTimeInMillis()}function hm(r,e){return oo(e.data.dndUntil.value,$.now())?(r||Ma(e),!0):!1}function gm(r,e){return r||e.fileSystem.reloadRemindersInAllFiles(),!0}function bm(r,e){return r||e.showReminderList(),!0}var si=class si{constructor(e,t,n,o,a){m(this,"lineIndex",e);m(this,"prefix",t);m(this,"check",n);m(this,"suffix",o);m(this,"body",a)}static parse(e,t){let n=si.regexp.exec(t);return n?new si(e,n.groups.prefix,n.groups.check,n.groups.suffix,n.groups.body):null}toMarkdown(){return`${this.prefix}${this.check}${this.suffix}${this.body}`}isChecked(){return si.checkedStatuses.some(e=>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",/^(?<prefix>((> ?)*)?\s*[-*+][ ]+\[)(?<check>.)(?<suffix>\]\s+)(?<body>.*)$/),m(si,"checkedStatuses",["x","-"]);var so=si;function vm(r){if(so.parse(0,r)!==null)return r;let e=/^(?<lead>(?:> ?)*\s*)(?<rest>.*)$/.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=/^(?<marker>[-*+])[ ]+(?<content>.*)$/.exec(n);if(o){let a=o.groups.marker,u=o.groups.content;return`${t}${a} [ ] ${u}`}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 u=Xa.fenceRegexp.exec(o),c=u==null?void 0:u.groups.fence,f=u==null?void 0:u.groups.info;if(t===null){if(c!==void 0&&(c[0]!=="`"||!f.includes("`"))){t=c[0],n=c.length;return}}else{c!==void 0&&c[0]===t&&c.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*(?<fence>`{3,}|~{3,})(?<info>.*)$/);var Fn=Xa;var _m=require("obsidian"),ym=window.require?window.require("electron"):void 0;function Ua(){new _m.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 u=vm(e);if(u==null)return null;let c=n==null?void 0:n+(u.length-e.length);return r.appendReminder(u,t,c)}async function Im(r,e){return ym&&(await ym.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;o<this.reminders.length;o++){let a=this.reminders[o];if(a.isExpired(t,e))n.push(a);else break}return n}muteExpiredReminders(e){let t=0;for(let n of this.getExpiredReminders(e))n.muteNotification||(n.muteNotification=!0,t++);return t}byDate(e){return this.reminders.filter(t=>t.time.toYYYYMMDD()===e.toYYYYMMDD())}removeReminder(e){console.debug("Remove reminder: %o",e),this.reminders.remove(e);let t=this.fileToReminders.get(e.file);t&&(t.remove(e),t.length===0&&this.fileToReminders.delete(e.file)),this.onChange()}clear(){this.fileToReminders.clear(),this.reminders=[],this.onChange()}removeByFile(e){return this.fileToReminders.delete(e)?(this.sortReminders(),!0):!1}replaceFile(e,t){let n=this.fileToReminders.get(e);if(n){if(this.equals(n,t))return!1;let o=new Map;for(let a of n)o.set(a.key(),a.muteNotification);for(let a of t){let u=o.get(a.key());o.set(a.key(),a.muteNotification),u!==void 0&&(a.muteNotification=u)}}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,u)=>a.equals(o[u]))}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,u;let o=t.time.getTimeInMillis((a=this.reminderTime)==null?void 0:a.value)-n.time.getTimeInMillis((u=this.reminderTime)==null?void 0:u.value);return o>0?1:o<0?-1:0})}},Cm=[{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 wm(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",u=>u.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 xm(r,e,t){let n=$.now(),o=n.getTimeInMillis(),a=[],u=[],c=[],f=wm(n,n,e,t);for(let h=0;h<r.length;h++){let b=r[h];if(b.muteNotification||b.isExpired(o,e)){c.push(b);continue}let I=wm(b.time,n,e,t);I.name!==f.name&&((u.length>0||f.isToday)&&a.push(new Cs(f,u)),u=[]),u.push(b),f=I}if(u.length>0&&a.push(new Cs(f,u)),c.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 Cs(h,c))}return a}var Cs=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,xs=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 xs)}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 u=new ao(e.file,o,a,t.lineIndex,t.isChecked()),c=n.computeSpan(),f=t.getHeaderLength();return{reminder:u,columnStart:c.start+f,columnEnd:c.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),u=o.getHeaderLength();return n!=null&&(n-=u),a!=null?a.setTime(t,n):(a=this.newReminder(o.body,t,n),a.setTime(t)),o.body=a.toMarkdown(),{insertedLine:o.toMarkdown(),caretPosition:u+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 Ac=Wr(wr(),1);var Am="(?<open>[[(])(?<pre>\\s*)(?<key>[\\p{L}\\p{N}_-]+)::(?<mid>\\s*)(?<value>[^[\\]()]*?)(?<post>\\s*)(?<close>[)\\]])";function iI(r,e){return r==="["&&e==="]"?"bracket":r==="("&&e===")"?"paren":null}function km(r){let e=new RegExp(Am,"gu"),t=[],n;for(;(n=e.exec(r))!==null;){let o=n.groups,a=iI(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 Sm(r,e,t){let n=r.slice(e.start,e.end),a=new RegExp(`^${Am}$`,"u").exec(n);if(a==null)return r;let u=a.groups,c=u.open.length+u.pre.length+u.key.length+2+u.mid.length,f=u.value.length,h=n.slice(0,c)+t+n.slice(c+f);return r.slice(0,e.start)+h+r.slice(e.end)}function Rm(r,e,t,n="bracket"){let[o,a]=n==="bracket"?["[","]"]:["(",")"],u=`${o}${e}:: ${t}${a}`;if(r.length===0)return u;let c=/\s$/.test(r)?"":" ";return`${r}${c}${u}`}function mc(r,e){let t=e.start,n=e.end;return t>0&&r[t-1]===" "?t-=1:n<r.length&&r[n]===" "&&(n+=1),r.slice(0,t)+r.slice(n)}var Ka=Wr(wr(),1);var As=["MO","TU","WE","TH","FR","SA","SU"],nt=(function(){function r(e,t){if(t===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return r.fromStr=function(e){return new r(As.indexOf(e))},r.prototype.nth=function(e){return this.n===e?this:new r(this.weekday,e)},r.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},r.prototype.toString=function(){var e=As[this.weekday];return this.n&&(e=(this.n>0?"+":"")+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"},pc=function(r){return typeof r=="string"&&As.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<e;n++)t.push(n);return t};var me=function(r,e){var t=0,n=[];if(kt(r))for(;t<e;t++)n[t]=[].concat(r);else for(;t<e;t++)n[t]=r;return n},Fm=function(r){return kt(r)?r:[r]};function Si(r,e,t){t===void 0&&(t=" ");var n=String(r);return e=e>>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 Tm=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))},oI=[31,28,31,30,31,30,31,31,30,31,30,31],Gm=1e3*60*60*24,$a=9999,Bm=zr(1970,1,1),sI=[6,0,1,2,3,4,5];var lo=function(r){return r%4===0&&r%100!==0||r%400===0},hc=function(r){return r instanceof Date},Ri=function(r){return hc(r)&&!isNaN(r.getTime())};var aI=function(r,e){var t=r.getTime(),n=e.getTime(),o=t-n;return Math.round(o/Gm)},ks=function(r){return aI(r,Bm)},Pa=function(r){return new Date(Bm.getTime()+r*Gm)},lI=function(r){var e=r.getUTCMonth();return e===1&&lo(r.getUTCFullYear())?29:oI[e]},Tn=function(r){return sI[r.getUTCDay()]},gc=function(r,e){var t=zr(r,e+1,1);return[Tn(t),lI(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},bc=function(r){for(var e=[],t=0;t<r.length;t++)e.push(Ja(r[t]));return e},En=function(r){r.sort(function(e,t){return e.getTime()-t.getTime()})},uo=function(r,e){e===void 0&&(e=!0);var t=new Date(r);return[Si(t.getUTCFullYear().toString(),4,"0"),Si(t.getUTCMonth()+1,2,"0"),Si(t.getUTCDate(),2,"0"),"T",Si(t.getUTCHours(),2,"0"),Si(t.getUTCMinutes(),2,"0"),Si(t.getUTCSeconds(),2,"0"),e?"Z":""].join("")},Ss=function(r){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/,t=e.exec(r);if(!t)throw new Error("Invalid UNTIL value: ".concat(r));return new Date(Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[5],10)||0,parseInt(t[6],10)||0,parseInt(t[7],10)||0))},Em=function(r,e){var t=r.toLocaleString("sv-SE",{timeZone:e});return t.replace(" ","T")+"Z"},Dm=function(r,e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date(Em(r,t)),o=new Date(Em(r,e!=null?e:"UTC")),a=o.getTime()-n.getTime();return new Date(r.getTime()-a)};var uI=(function(){function r(e,t){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=t,e==="between"?(this.maxDate=t.inc?t.before:new Date(t.before.getTime()-1),this.minDate=t.inc?t.after:new Date(t.after.getTime()+1)):e==="before"?this.maxDate=t.inc?t.dt:new Date(t.dt.getTime()-1):e==="after"&&(this.minDate=t.inc?t.dt:new Date(t.dt.getTime()+1))}return r.prototype.accept=function(e){++this.total;var t=this.minDate&&e<this.minDate,n=this.maxDate&&e>this.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=uI;var vc=function(r,e){return vc=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])},vc(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");vc(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;n<o;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},St.apply(this,arguments)};function D(r,e,t){if(t||arguments.length===2)for(var n=0,o=e.length,a;n<o;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}var cI=(function(r){co(e,r);function e(t,n,o){var a=r.call(this,t,n)||this;return a.iterator=o,a}return e.prototype.add=function(t){return this.iterator(t,this._result.length)?(this._result.push(t),!0):!1},e})(Gn),yc=cI;var dI={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},Fi=dI;var Nm=function(r,e){return r.indexOf(e)!==-1},fI=function(r){return r.toString()},mI=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},pI=(function(){function r(e,t,n,o){if(t===void 0&&(t=fI),n===void 0&&(n=Fi),o===void 0&&(o=mI),this.text=[],this.language=n||Fi,this.gettext=t,this.dateFormatter=o,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var a=[].concat(this.options.bymonthday),u=[].concat(this.options.bynmonthday);a.sort(function(b,I){return b-I}),u.sort(function(b,I){return I-b}),this.bymonthday=a.concat(u),this.bymonthday.length||(this.bymonthday=null)}if(Ne(this.origOptions.byweekday)){var c=kt(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],f=String(c);this.byweekday={allWeeks:c.filter(function(b){return!b.n}),someWeeks:c.filter(function(b){return!!b.n}),isWeekdays:f.indexOf("MO")!==-1&&f.indexOf("TU")!==-1&&f.indexOf("WE")!==-1&&f.indexOf("TH")!==-1&&f.indexOf("FR")!==-1&&f.indexOf("SA")===-1&&f.indexOf("SU")===-1,isEveryDay:f.indexOf("MO")!==-1&&f.indexOf("TU")!==-1&&f.indexOf("WE")!==-1&&f.indexOf("TH")!==-1&&f.indexOf("FR")!==-1&&f.indexOf("SA")!==-1&&f.indexOf("SU")!==-1};var h=function(b,I){return b.weekday-I.weekday};this.byweekday.allWeeks.sort(h),this.byweekday.someWeeks.sort(h),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return r.isFullyConvertible=function(e){var t=!0;if(!(e.options.freq in r.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(Nm(["dtstart","tzid","wkst","freq"],n))return!0;if(!Nm(r.IMPLEMENTED[e.options.freq],n))return!1}return t},r.prototype.isFullyConvertible=function(){return r.isFullyConvertible(this.rrule)},r.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in r.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[U.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var t=this.options.until;this.add(this.dateFormatter(t.getUTCFullYear(),this.language.monthNames[t.getUTCMonth()],t.getUTCDate()))}else this.options.count&&this.add(e("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?e("times"):e("time"));return this.isFullyConvertible()||this.add(e("(~ approximate)")),this.text.join("")},r.prototype.HOURLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},r.prototype.MINUTELY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},r.prototype.DAILY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},r.prototype.WEEKLY=function(){var e=this.gettext;this.options.interval!==1&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?this.options.interval===1?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(this.options.interval===1&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.origOptions.byhour&&this._byhour())},r.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},r.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(this.options.interval!==1&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(this.options.interval!==1&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},r.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},r.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},r.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},r.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},r.prototype.nth=function(e){e=parseInt(e.toString(),10);var t,n=this.gettext;if(e===-1)return n("last");var o=Math.abs(e);switch(o){case 1:case 21:case 31:t=o+n("st");break;case 2:case 22:t=o+n("nd");break;case 3:case 23:t=o+n("rd");break;default:t=o+n("th")}return e<0?t+" "+n("last"):t},r.prototype.monthtext=function(e){return this.language.monthNames[e-1]},r.prototype.weekdaytext=function(e){var t=ar(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},r.prototype.plural=function(e){return e%100!==1},r.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},r.prototype.list=function(e,t,n,o){var a=this;o===void 0&&(o=","),kt(e)||(e=[e]);var u=function(f,h,b){for(var I="",g=0;g<f.length;g++)g!==0&&(g===f.length-1?I+=" "+b+" ":I+=h+" "),I+=f[g];return I};t=t||function(f){return f.toString()};var c=function(f){return t&&t.call(a,f)};return n?u(e.map(c),o,n):e.map(c).join(o+" ")},r})(),Kr=pI;var hI=(function(){function r(e){this.done=!0,this.rules=e}return r.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},r.prototype.isDone=function(){return this.done&&this.symbol===null},r.prototype.nextSymbol=function(){var e,t;this.symbol=null,this.value=null;do{if(this.done)return!1;var n=void 0;e=null;for(var o in this.rules){n=this.rules[o];var a=n.exec(this.text);a&&(e===null||a[0].length>e[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 Rs(r,e){e===void 0&&(e=Fi);var t={},n=new hI(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()&&(u(),I());break;case"weekday(s)":t.freq=U.WEEKLY,t.byweekday=[U.MO,U.TU,U.WE,U.TH,U.FR],n.nextSymbol(),u(),I();break;case"week(s)":t.freq=U.WEEKLY,n.nextSymbol()&&(a(),u(),I());break;case"hour(s)":t.freq=U.HOURLY,n.nextSymbol()&&(a(),I());break;case"minute(s)":t.freq=U.MINUTELY,n.nextSymbol()&&(a(),I());break;case"month(s)":t.freq=U.MONTHLY,n.nextSymbol()&&(a(),I());break;case"year(s)":t.freq=U.YEARLY,n.nextSymbol()&&(a(),I());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()}u(),b(),I();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=[c()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var w=c();if(!w)throw new Error("Unexpected symbol "+n.symbol+", expected month");t.bymonth.push(w),n.nextSymbol()}a(),I();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(),x=c();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 k=n.acceptNumber();if(!k)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(t.byweekno=[parseInt(k[0],10)];n.accept("comma");){if(k=n.acceptNumber(),!k)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.byweekno.push(parseInt(k[0],10))}}else if(x)n.nextSymbol(),t.bymonth||(t.bymonth=[]),t.bymonth.push(x);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function u(){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 c(){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 I(){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 Fs(r){return r<ue.HOURLY}var Wm=function(r,e){return e===void 0&&(e=Fi),new U(Rs(r,e)||void 0)},fo=["count","until","interval","byweekday","bymonthday","bymonth"];Kr.IMPLEMENTED=[];Kr.IMPLEMENTED[ue.HOURLY]=fo;Kr.IMPLEMENTED[ue.MINUTELY]=fo;Kr.IMPLEMENTED[ue.DAILY]=["byhour"].concat(fo);Kr.IMPLEMENTED[ue.WEEKLY]=fo;Kr.IMPLEMENTED[ue.MONTHLY]=fo;Kr.IMPLEMENTED[ue.YEARLY]=["byweekno","byyearday"].concat(fo);var Zm=function(r,e,t,n){return new Kr(r,e,t,n).toString()},Mm=Kr.isFullyConvertible;var mo=(function(){function r(e,t,n,o){this.hour=e,this.minute=t,this.second=n,this.millisecond=o||0}return r.prototype.getHours=function(){return this.hour},r.prototype.getMinutes=function(){return this.minute},r.prototype.getSeconds=function(){return this.second},r.prototype.getMilliseconds=function(){return this.millisecond},r.prototype.getTime=function(){return(this.hour*60*60+this.minute*60+this.second)*1e3+this.millisecond},r})();var Ym=(function(r){co(e,r);function e(t,n,o,a,u,c,f){var h=r.call(this,a,u,c,f)||this;return h.year=t,h.month=n,h.day=o,h}return e.fromDate=function(t){return new this(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.valueOf()%1e3)},e.prototype.getWeekday=function(){return Tn(new Date(this.getTime()))},e.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},e.prototype.getDay=function(){return this.day},e.prototype.getMonth=function(){return this.month},e.prototype.getYear=function(){return this.year},e.prototype.addYears=function(t){this.year+=t},e.prototype.addMonths=function(t){if(this.month+=t,this.month>12){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),u=a.div,c=a.mod;if(u&&(this.hour=c,this.addDaily(u)),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 u=Oa(this.minute,60),c=u.div,f=u.mod;if(c&&(this.minute=f,this.addHours(c,!1,o)),(lr(o)||be(o,this.hour))&&(lr(a)||be(a,this.minute)))break}},e.prototype.addSeconds=function(t,n,o,a,u){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var c=Oa(this.second,60),f=c.div,h=c.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(u)||be(u,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=gc(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=gc(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var o=t.freq,a=t.interval,u=t.wkst,c=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,u);case ue.DAILY:return this.addDaily(a);case ue.HOURLY:return this.addHours(a,n,c);case ue.MINUTELY:return this.addMinutes(a,n,c,f);case ue.SECONDLY:return this.addSeconds(a,n,c,f,h)}},e})(mo);function _c(r){for(var e=[],t=Object.keys(r),n=0,o=t;n<o.length;n++){var a=o[n];be(Qm,a)||e.push(a),hc(r[a])&&!Ri(r[a])&&e.push(a)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return St({},r)}function Xm(r){var e=St(St({},Ts),_c(r));if(Ne(e.byeaster)&&(e.freq=U.YEARLY),!(Ne(e.freq)&&U.FREQUENCIES[e.freq]))throw new Error("Invalid frequency: ".concat(e.freq," ").concat(r.freq));if(e.dtstart||(e.dtstart=new Date(new Date().setMilliseconds(0))),Ne(e.wkst)?ar(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=U.MO.weekday,Ne(e.bysetpos)){ar(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var t=0;t<e.bysetpos.length;t++){var n=e.bysetpos[t];if(n===0||!(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;t<e.bymonthday.length;t++){var n=e.bymonthday[t];n>0?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(pc(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 u=[],c=[],t=0;t<e.byweekday.length;t++){var f=e.byweekday[t];if(ar(f)){u.push(f);continue}else if(pc(f)){u.push(nt.fromStr(f).weekday);continue}!f.n||e.freq>U.MONTHLY?u.push(f.weekday):c.push([f.weekday,f.n])}e.byweekday=ze(u)?u:null,e.bynweekday=ze(c)?c:null}return Ne(e.byhour)?ar(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<U.HOURLY?[e.dtstart.getUTCHours()]:null,Ne(e.byminute)?ar(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<U.MINUTELY?[e.dtstart.getUTCMinutes()]:null,Ne(e.bysecond)?ar(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<U.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function Um(r){var e=r.dtstart.getTime()%1e3;if(!Fs(r.freq))return[];var t=[];return r.byhour.forEach(function(n){r.byminute.forEach(function(o){r.bysecond.forEach(function(a){t.push(new mo(n,o,a,e))})})}),t}function Gs(r){var e=r.split(`
|
|
`).map(gI).filter(function(t){return t!==null});return St(St({},e[0]),e[1])}function Es(r){var e={},t=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(r);if(!t)return e;var n=t[1],o=t[2];return n&&(e.tzid=n),e.dtstart=Ss(o),e}function gI(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return Vm(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return Vm(r);case"DTSTART":return Es(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function Vm(r){var e=r.replace(/^RRULE:/i,""),t=Es(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(o){var a=o.split("="),u=a[0],c=a[1];switch(u.toUpperCase()){case"FREQ":t.freq=ue[c.toUpperCase()];break;case"WKST":t.wkst=xr[c.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var f=bI(c),h=u.toLowerCase();t[h]=f;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=vI(c);break;case"DTSTART":case"TZID":var b=Es(r);t.tzid=b.tzid,t.dtstart=b.dtstart;break;case"UNTIL":t.until=Ss(c);break;case"BYEASTER":t.byeaster=Number(c);break;default:throw new Error("Unknown RRULE property '"+u+"'")}}),t}function bI(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(Lm)}return Lm(r)}function Lm(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function vI(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return xr[t];var n=t.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!n||n.length<3)throw new SyntaxError("Invalid weekday string: ".concat(t));var o=Number(n[1]),a=n[2],u=xr[a].weekday;return new nt(u,o)})}var Ti=(function(){function r(e,t){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=t}return Object.defineProperty(r.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),r.prototype.toString=function(){var e=uo(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},r.prototype.getTime=function(){return this.date.getTime()},r.prototype.rezonedDate=function(){return this.isUTC?this.date:Dm(this.date,this.tzid)},r})();function Bs(r){for(var e=[],t="",n=Object.keys(r),o=Object.keys(Ts),a=0;a<n.length;a++)if(n[a]!=="tzid"&&be(o,n[a])){var u=n[a].toUpperCase(),c=r[n[a]],f="";if(!(!Ne(c)||kt(c)&&!c.length)){switch(u){case"FREQ":f=U.FREQUENCIES[r.freq];break;case"WKST":ar(c)?f=new nt(c).toString():f=c.toString();break;case"BYWEEKDAY":u="BYDAY",f=Fm(c).map(function(v){return v instanceof nt?v:kt(v)?new nt(v[0],v[1]):new nt(v)}).toString();break;case"DTSTART":t=yI(c,r.tzid);break;case"UNTIL":f=uo(c,!r.tzid);break;default:if(kt(c)){for(var h=[],b=0;b<c.length;b++)h[b]=String(c[b]);f=h.toString()}else f=String(c)}f&&e.push([u,f])}}var I=e.map(function(v){var y=v[0],w=v[1];return"".concat(y,"=").concat(w.toString())}).join(";"),g="";return I!==""&&(g="RRULE:".concat(I)),[t,g].filter(function(v){return!!v}).join(`
|
|
`)}function yI(r,e){return r?"DTSTART"+new Ti(new Date(r),e).toString():""}function _I(r,e){return Array.isArray(r)?!Array.isArray(e)||r.length!==e.length?!1:r.every(function(t,n){return t.getTime()===e[n].getTime()}):r instanceof Date?e instanceof Date&&r.getTime()===e.getTime():r===e}var Om=(function(){function r(){this.all=!1,this.before=[],this.after=[],this.between=[]}return r.prototype._cacheAdd=function(e,t,n){t&&(t=t instanceof Date?Ja(t):bc(t)),e==="all"?this.all=t:(n._value=t,this[e].push(n))},r.prototype._cacheGet=function(e,t){var n=!1,o=t?Object.keys(t):[],a=function(b){for(var I=0;I<o.length;I++){var g=o[I];if(!_I(t[g],b[g]))return!0}return!1},u=this[e];if(e==="all")n=this.all;else if(kt(u))for(var c=0;c<u.length;c++){var f=u[c];if(!(o.length&&a(f))){n=f._value;break}}if(!n&&this.all){for(var h=new Gn(e,t),c=0;c<this.all.length&&h.accept(this.all[c]);c++);n=h.getValue(),this._cacheAdd(e,n,t)}return kt(n)?bc(n):n instanceof Date?Ja(n):n},r})();var $m=D(D(D(D(D(D(D(D(D(D(D(D(D([],me(1,31),!0),me(2,28),!0),me(3,31),!0),me(4,30),!0),me(5,31),!0),me(6,30),!0),me(7,31),!0),me(8,31),!0),me(9,30),!0),me(10,31),!0),me(11,30),!0),me(12,31),!0),me(1,7),!0),Pm=D(D(D(D(D(D(D(D(D(D(D(D(D([],me(1,31),!0),me(2,29),!0),me(3,31),!0),me(4,30),!0),me(5,31),!0),me(6,30),!0),me(7,31),!0),me(8,31),!0),me(9,30),!0),me(10,31),!0),me(11,30),!0),me(12,31),!0),me(1,7),!0),II=Cr(1,29),wI=Cr(1,30),ui=Cr(1,31),Zt=Cr(1,32),Hm=D(D(D(D(D(D(D(D(D(D(D(D(D([],Zt,!0),wI,!0),Zt,!0),ui,!0),Zt,!0),ui,!0),Zt,!0),Zt,!0),ui,!0),Zt,!0),ui,!0),Zt,!0),Zt.slice(0,7),!0),Jm=D(D(D(D(D(D(D(D(D(D(D(D(D([],Zt,!0),II,!0),Zt,!0),ui,!0),Zt,!0),ui,!0),Zt,!0),Zt,!0),ui,!0),Zt,!0),ui,!0),Zt,!0),Zt.slice(0,7),!0),CI=Cr(-28,0),xI=Cr(-29,0),ci=Cr(-30,0),Mt=Cr(-31,0),jm=D(D(D(D(D(D(D(D(D(D(D(D(D([],Mt,!0),xI,!0),Mt,!0),ci,!0),Mt,!0),ci,!0),Mt,!0),Mt,!0),ci,!0),Mt,!0),ci,!0),Mt,!0),Mt.slice(0,7),!0),zm=D(D(D(D(D(D(D(D(D(D(D(D(D([],Mt,!0),CI,!0),Mt,!0),ci,!0),Mt,!0),ci,!0),Mt,!0),Mt,!0),ci,!0),Mt,!0),ci,!0),Mt,!0),Mt.slice(0,7),!0),Km=[0,31,60,91,121,152,182,213,244,274,305,335,366],qm=[0,31,59,90,120,151,181,212,243,273,304,334,365],Ic=(function(){for(var r=[],e=0;e<55;e++)r=r.concat(Cr(7));return r})();function ep(r,e){var t=zr(r,1,1),n=lo(r)?366:365,o=lo(r+1)?366:365,a=ks(t),u=Tn(t),c=St(St({yearlen:n,nextyearlen:o,yearordinal:a,yearweekday:u},AI(r)),{wnomask:null});if(lr(e.byweekno))return c;c.wnomask=me(0,n+7);var f,h,b=f=Wt(7-u+e.wkst,7);b>=4?(b=0,h=c.yearlen+Wt(u-e.wkst,7)):h=n-b;for(var I=Math.floor(h/7),g=Wt(h,7),v=Math.floor(I+g/4),y=0;y<e.byweekno.length;y++){var w=e.byweekno[y];if(w<0&&(w+=v+1),w>0&&w<=v){var x=void 0;w>1?(x=b+(w-1)*7,b!==f&&(x-=7-f)):x=b;for(var k=0;k<7&&(c.wnomask[x]=1,x++,c.wdaymask[x]!==e.wkst);k++);}}if(be(e.byweekno,1)){var x=b+v*7;if(b!==f&&(x-=7-f),x<n)for(var y=0;y<7&&(c.wnomask[x]=1,x+=1,c.wdaymask[x]!==e.wkst);y++);}if(b){var B=void 0;if(be(e.byweekno,-1))B=-1;else{var F=Tn(zr(r-1,1,1)),P=Wt(7-F.valueOf()+e.wkst,7),ie=lo(r-1)?366:365,Y=void 0;P>=4?(P=0,Y=ie+Wt(F-e.wkst,7)):Y=n-b,B=Math.floor(52+Wt(Y,7)/4)}if(be(e.byweekno,B))for(var x=0;x<b;x++)c.wnomask[x]=1}return c}function AI(r){var e=lo(r)?366:365,t=zr(r,1,1),n=Tn(t);return e===365?{mmask:$m,mdaymask:Jm,nmdaymask:zm,wdaymask:Ic.slice(n),mrange:qm}:{mmask:Pm,mdaymask:Hm,nmdaymask:jm,wdaymask:Ic.slice(n),mrange:Km}}function tp(r,e,t,n,o,a){var u={lastyear:r,lastmonth:e,nwdaymask:[]},c=[];if(a.freq===U.YEARLY)if(lr(a.bymonth))c=[[0,t]];else for(var f=0;f<a.bymonth.length;f++)e=a.bymonth[f],c.push(n.slice(e-1,e+1));else a.freq===U.MONTHLY&&(c=[n.slice(e-1,e+1)]);if(lr(c))return u;u.nwdaymask=me(0,t);for(var f=0;f<c.length;f++)for(var h=c[f],b=h[0],I=h[1]-1,g=0;g<a.bynweekday.length;g++){var v=void 0,y=a.bynweekday[g],w=y[0],x=y[1];x<0?(v=I+(x+1)*7,v-=Wt(o[v]-w,7)):(v=b+(x-1)*7,v+=Wt(7-o[v]+w,7)),b<=v&&v<=I&&(u.nwdaymask[v]=1)}return u}function rp(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),o=r%100,a=Math.floor(n/4),u=n%4,c=Math.floor((n+8)/25),f=Math.floor((n-c+1)/3),h=Math.floor(19*t+n-a-f+15)%30,b=Math.floor(o/4),I=o%4,g=Math.floor(32+2*u+2*b-h-I)%7,v=Math.floor((t+11*h+22*g)/451),y=Math.floor((h+g-7*v+114)/31),w=(h+g-7*v+114)%31+1,x=Date.UTC(r,y-1,w+e),k=Date.UTC(r,0,1);return[Math.ceil((x-k)/(1e3*60*60*24))]}var kI=(function(){function r(e){this.options=e}return r.prototype.rebuild=function(e,t){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=ep(e,n)),ze(n.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var o=this.yearinfo,a=o.yearlen,u=o.mrange,c=o.wdaymask;this.monthinfo=tp(e,t,a,u,c,n)}Ne(n.byeaster)&&(this.eastermask=rp(e,n.byeaster))},Object.defineProperty(r.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),r.prototype.ydayset=function(){return[Cr(this.yearlen),0,this.yearlen]},r.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],o=this.mrange[t],a=me(null,this.yearlen),u=n;u<o;u++)a[u]=u;return[a,n,o]},r.prototype.wdayset=function(e,t,n){for(var o=me(null,this.yearlen+7),a=ks(zr(e,t,n))-this.yearordinal,u=a,c=0;c<7&&(o[a]=a,++a,this.wdaymask[a]!==this.options.wkst);c++);return[o,u,a]},r.prototype.ddayset=function(e,t,n){var o=me(null,this.yearlen),a=ks(zr(e,t,n))-this.yearordinal;return o[a]=a,[o,a,a+1]},r.prototype.htimeset=function(e,t,n,o){var a=this,u=[];return this.options.byminute.forEach(function(c){u=u.concat(a.mtimeset(e,c,n,o))}),En(u),u},r.prototype.mtimeset=function(e,t,n,o){var a=this.options.bysecond.map(function(u){return new mo(e,t,u,o)});return En(a),a},r.prototype.stimeset=function(e,t,n,o){return[new mo(e,t,n,o)]},r.prototype.getdayset=function(e){switch(e){case ue.YEARLY:return this.ydayset.bind(this);case ue.MONTHLY:return this.mdayset.bind(this);case ue.WEEKLY:return this.wdayset.bind(this);case ue.DAILY:return this.ddayset.bind(this);default:return this.ddayset.bind(this)}},r.prototype.gettimeset=function(e){switch(e){case ue.HOURLY:return this.htimeset.bind(this);case ue.MINUTELY:return this.mtimeset.bind(this);case ue.SECONDLY:return this.stimeset.bind(this)}},r})(),np=kI;function ip(r,e,t,n,o,a){for(var u=[],c=0;c<r.length;c++){var f=void 0,h=void 0,b=r[c];b<0?(f=Math.floor(b/e.length),h=Wt(b,e.length)):(f=Math.floor((b-1)/e.length),h=Wt(b-1,e.length));for(var I=[],g=t;g<n;g++){var v=a[g];Ne(v)&&I.push(v)}var y=void 0;f<0?y=I.slice(f)[0]:y=I[f];var w=e[h],x=Pa(o.yearordinal+y),k=Ha(x,w);be(u,k)||u.push(k)}return En(u),u}function ja(r,e){var t=e.dtstart,n=e.freq,o=e.interval,a=e.until,u=e.bysetpos,c=e.count;if(c===0||o===0)return Bn(r);var f=Ym.fromDate(t),h=new np(e);h.rebuild(f.year,f.month);for(var b=FI(h,f,e);;){var I=h.getdayset(n)(f.year,f.month,f.day),g=I[0],v=I[1],y=I[2],w=RI(g,v,y,h,e);if(ze(u))for(var x=ip(u,b,v,y,h,g),k=0;k<x.length;k++){var B=x[k];if(a&&B>a)return Bn(r);if(B>=t){var F=op(B,e);if(!r.accept(F)||c&&(--c,!c))return Bn(r)}}else for(var k=v;k<y;k++){var P=g[k];if(Ne(P))for(var ie=Pa(h.yearordinal+P),Y=0;Y<b.length;Y++){var pe=b[Y],B=Ha(ie,pe);if(a&&B>a)return Bn(r);if(B>=t){var F=op(B,e);if(!r.accept(F)||c&&(--c,!c))return Bn(r)}}}if(e.interval===0||(f.add(e,w),f.year>$a))return Bn(r);Fs(n)||(b=h.gettimeset(n)(f.hour,f.minute,f.second,0)),h.rebuild(f.year,f.month)}}function SI(r,e,t){var n=t.bymonth,o=t.byweekno,a=t.byweekday,u=t.byeaster,c=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]||u!==null&&!be(r.eastermask,e)||(ze(c)||ze(f))&&!be(c,r.mdaymask[e])&&!be(f,r.nmdaymask[e])||ze(h)&&(e<r.yearlen&&!be(h,e+1)&&!be(h,-r.yearlen+e)||e>=r.yearlen&&!be(h,e+1-r.yearlen)&&!be(h,-r.nextyearlen+e-r.yearlen))}function op(r,e){return new Ti(r,e.tzid).rezonedDate()}function Bn(r){return r.getValue()}function RI(r,e,t,n,o){for(var a=!1,u=e;u<t;u++){var c=r[u];a=SI(n,c,o),a&&(r[c]=null)}return a}function FI(r,e,t){var n=t.freq,o=t.byhour,a=t.byminute,u=t.bysecond;return Fs(n)?Um(t):n>=U.HOURLY&&ze(o)&&!be(o,e.hour)||n>=U.MINUTELY&&ze(a)&&!be(a,e.minute)||n>=U.SECONDLY&&ze(u)&&!be(u,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)},Ts={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},Qm=Object.keys(Ts),U=(function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new Om,this.origOptions=_c(e);var n=Xm(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return Rs(e,t)},r.fromText=function(e,t){return Wm(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 yc("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 yc("between",a,o));var u=this._cacheGet("between",a);return u===!1&&(u=this._iter(new Gn("between",a)),this._cacheAdd("between",u,a)),u},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 Bs(this.origOptions)},r.prototype.toText=function(e,t,n){return Zm(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return Mm(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=Gs,r.optionsToString=Bs,r})();function sp(r,e,t,n,o,a){var u={},c=r.accept;function f(g,v){t.forEach(function(y){y.between(g,v,!0).forEach(function(w){u[Number(w)]=!0})})}o.forEach(function(g){var v=new Ti(g,a).rezonedDate();u[Number(v)]=!0}),r.accept=function(g){var v=Number(g);return isNaN(v)?c.call(this,g):!u[v]&&(f(new Date(v-1),new Date(v+1)),!u[v])?(u[v]=!0,c.call(this,g)):!0},r.method==="between"&&(f(r.args.after,r.args.before),r.accept=function(g){var v=Number(g);return u[v]?!0:(u[v]=!0,c.call(this,g))});for(var h=0;h<n.length;h++){var b=new Ti(n[h],a).rezonedDate();if(!r.accept(new Date(b.getTime())))break}e.forEach(function(g){ja(r,g.options)});var I=r._result;switch(En(I),r.method){case"all":case"between":return I;case"before":return I.length&&I[I.length-1]||null;default:return I.length&&I[0]||null}}var ap={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function TI(r,e){var t=[],n=[],o=[],a=[],u=Es(r),c=u.dtstart,f=u.tzid,h=NI(r,e.unfold);return h.forEach(function(b){var I;if(b){var g=DI(b),v=g.name,y=g.parms,w=g.value;switch(v.toUpperCase()){case"RRULE":if(y.length)throw new Error("unsupported RRULE parm: ".concat(y.join(",")));t.push(Gs(b));break;case"RDATE":var x=(I=/RDATE(?:;TZID=([^:=]+))?/i.exec(b))!==null&&I!==void 0?I:[],k=x[1];k&&!f&&(f=k),n=n.concat(lp(w,y));break;case"EXRULE":if(y.length)throw new Error("unsupported EXRULE parm: ".concat(y.join(",")));o.push(Gs(w));break;case"EXDATE":a=a.concat(lp(w,y));break;case"DTSTART":break;default:throw new Error("unsupported property: "+v)}}}),{dtstart:c,tzid:f,rrulevals:t,rdatevals:n,exrulevals:o,exdatevals:a}}function EI(r,e){var t=TI(r,e),n=t.rrulevals,o=t.rdatevals,a=t.exrulevals,u=t.exdatevals,c=t.dtstart,f=t.tzid,h=e.cache===!1;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||n.length>1||o.length||a.length||u.length){var b=new Cc(h);return b.dtstart(c),b.tzid(f||void 0),n.forEach(function(g){b.rrule(new U(wc(g,c,f),h))}),o.forEach(function(g){b.rdate(g)}),a.forEach(function(g){b.exrule(new U(wc(g,c,f),h))}),u.forEach(function(g){b.exdate(g)}),e.compatible&&e.dtstart&&b.rdate(c),b}var I=n[0]||{};return new U(wc(I,I.dtstart||e.dtstart||c,I.tzid||e.tzid||f),h)}function za(r,e){return e===void 0&&(e={}),EI(r,GI(e))}function wc(r,e,t){return St(St({},r),{dtstart:e,tzid:t})}function GI(r){var e=[],t=Object.keys(r),n=Object.keys(ap);if(t.forEach(function(o){be(n,o)||e.push(o)}),e.length)throw new Error("Invalid options: "+e.join(", "));return St(St({},ap),r)}function BI(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=Tm(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function DI(r){var e=BI(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 NI(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;n<t.length;){var o=t[n]=t[n].replace(/\s+$/g,"");o?n>0&&o[0]===" "?(t[n-1]+=o.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function WI(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function lp(r,e){return WI(e),r.split(",").map(function(t){return Ss(t)})}function up(r){var e=this;return function(t){if(t!==void 0&&(e["_".concat(r)]=t),e["_".concat(r)]!==void 0)return e["_".concat(r)];for(var n=0;n<e._rrule.length;n++){var o=e._rrule[n].origOptions[r];if(o)return o}}}var Cc=(function(r){co(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=up.apply(n,["dtstart"]),n.tzid=up.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return sp(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){cp(t,this._rrule)},e.prototype.exrule=function(t){cp(t,this._exrule)},e.prototype.rdate=function(t){dp(t,this._rdate)},e.prototype.exdate=function(t){dp(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return za(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return za(t.toString())})},e.prototype.rdates=function(){return this._rdate.map(function(t){return new Date(t.getTime())})},e.prototype.exdates=function(){return this._exdate.map(function(t){return new Date(t.getTime())})},e.prototype.valueOf=function(){var t=[];return!this._rrule.length&&this._dtstart&&(t=t.concat(Bs({dtstart:this._dtstart}))),this._rrule.forEach(function(n){t=t.concat(n.toString().split(`
|
|
`))}),this._exrule.forEach(function(n){t=t.concat(n.toString().split(`
|
|
`).map(function(o){return o.replace(/^RRULE:/,"EXRULE:")}).filter(function(o){return!/^DTSTART/.test(o)}))}),this._rdate.length&&t.push(fp("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(fp("EXDATE",this._exdate,this.tzid())),t},e.prototype.toString=function(){return this.valueOf().join(`
|
|
`)},e.prototype.clone=function(){var t=new e(!!this._cache);return this._rrule.forEach(function(n){return t.rrule(n.clone())}),this._exrule.forEach(function(n){return t.exrule(n.clone())}),this._rdate.forEach(function(n){return t.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return t.exdate(new Date(n.getTime()))}),t},e})(U);function cp(r,e){if(!(r instanceof U))throw new TypeError(String(r)+" is not RRule instance");be(e.map(String),String(r))||e.push(r)}function dp(r,e){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");be(e.map(Number),Number(r))||(e.push(r),En(e))}function fp(r,e,t){var n=!t||t.toUpperCase()==="UTC",o=n?"".concat(r,":"):"".concat(r,";TZID=").concat(t,":"),a=e.map(function(u){return uo(u.valueOf(),n)}).join(",");return"".concat(o).concat(a)}function po(r,e,t){let n;try{n=U.parseText(r)}catch(h){console.warn("Failed to parse recurrence text: recurrence=%s, error=%o",r,h);return}if(!n)return;e=e.clone();let o=t.moment().clone();o.set("hour",e.get("hour")),o.set("minute",e.get("minute")),o.set("second",e.get("second")),o.set("millisecond",e.get("millisecond")),o.isAfter(e)&&(e=o);let a=e.clone();n.dtstart=e.utc(!0).toDate();let c=new U(n).after(e.toDate(),!1);if(c==null)return;let f=c.getTime()-n.dtstart.getTime();return a.add(f,"millisecond"),a.toDate()}function qa(r){return r.replace(/#[\p{L}\p{N}\p{M}_/-]+/gu,"").trim()}var ho=class extends li{modifyReminder(e,t,n,o){if(!super.modifyReminder(e,t,n,o))return!1;if(o.checked!==void 0)if(o.checked){let a=n.getRecurrence();if(a!==null){let u=t.clone(),c=n.clone(),f=n.getDueDate(),h=this.config.getParameter(Qe.now);if(this.usesSeparateReminderDate(n)){let b=n.getTime();if(b==null)return!1;let I=po(a,b.moment(),h);if(I==null)return!1;if(c.setTime(new $((0,Ka.default)(I),b.hasTimePart)),f!=null){let g=po(a,f.moment(),h);if(g==null)return!1;c.setDueDate(new $((0,Ka.default)(g),f.hasTimePart))}}else{if(f==null)return!1;let b=po(a,f.moment(),h);if(b==null)return!1;let I=new $((0,Ka.default)(b),f.hasTimePart);c.setTime(I)}u.body=c.toMarkdown(),u.setChecked(!1),e.insertTodo(t.lineIndex,u)}n.setDoneDate(this.config.getParameter(Qe.now))}else n.setDoneDate(void 0);return!0}};var ZI=["YYYY-MM-DDTHH:mm","YYYY-MM-DD HH:mm"],kc="YYYY-MM-DD";function xc(r){for(let t of ZI){let n=(0,Ac.default)(r,t,!0);if(n.isValid())return new $(n,!0)}let e=(0,Ac.default)(r,kc,!0);return e.isValid()?new $(e,!1):null}function mp(r){return r.hasTimePart?r.format("YYYY-MM-DDTHH:mm"):r.format(kc)}var Ei="due",el="completion",pp="repeat",MI="scheduled",YI="start",XI=[Ei,el,pp,MI,YI],tl=class r{constructor(e,t,n){m(this,"text",e);m(this,"reminderFieldName",t);m(this,"removeTags",n)}static parse(e,t,n){return new r(e,t.toLowerCase(),n!=null?n:!1)}fields(){return km(this.text)}fieldsByKey(e){return this.fields().filter(t=>t.key.toLowerCase()===e)}firstField(e){var t;return(t=this.fieldsByKey(e)[0])!=null?t:null}hasReminderField(){return this.firstField(this.reminderFieldName)!=null}hasAnySourceField(){return this.hasReminderField()||this.firstField(Ei)!=null}reminderSourceField(){var e;return(e=this.firstField(this.reminderFieldName))!=null?e:this.firstField(Ei)}getTitle(){let e=new Set([...XI,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=mc(n,o);return n=n.trim(),this.removeTags&&(n=qa(n)),n}getTime(){let e=this.reminderSourceField();return e==null?null:xc(e.value)}setTime(e){var o;let t=this.reminderSourceField(),n=(o=t==null?void 0:t.key)!=null?o:Ei;this.setFieldValue(n,mp(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:xc(e.value)}setDueDate(e){this.setFieldValue(Ei,mp(e))}getRecurrence(){var t;let e=this.firstField(pp);return(t=e==null?void 0:e.value)!=null?t:null}getDoneDate(){let e=this.firstField(el);return e==null?null:xc(e.value)}setDoneDate(e){if(e==null){this.removeFieldByKey(el);return}let t=e instanceof $?e.format(kc):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=Sm(this.text,n,t):this.text=Rm(this.text,e,t,"bracket")}removeFieldByKey(e){let t=this.firstField(e);t!=null&&(this.text=mc(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 hp=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 u=n.groups.title2;t&&(a=a.replace("[[",""),a=a.replace("]]",""));let c=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,c=b)}return new qr(t,o,a,u,c)}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",/^(?<title1>.*?)\(@(?<time>.+?)\)(?<title2>.*)$/),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 u=n.getTime();if(u!==null){let c=po(a,u.moment(),this.config.getParameter(Qe.now));if(c!==void 0){let f=n.clone();f.setTime(new $((0,hp.default)(c),u.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 Sc=Wr(wr(),1);function sl(r){return r.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}var UI=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 c,f;if(!window)return t;let n=(f=(c=window==null?void 0:window.app)==null?void 0:c.plugins)==null?void 0:f.plugins;if(!n)return t;let o=n["obsidian-kanban"];if(!o||!o.settings)return t;let u=o.settings[e];return u==null?t:u}},ul=class ul{constructor(e){m(this,"setting",e)}get dateRegExp(){return this.setting.linkDateToDailyNote?new RegExp(`${sl(this.setting.dateTrigger)}\\[\\[(?<date>.+?)\\]\\]`):new RegExp(`${sl(this.setting.dateTrigger)}\\{(?<date>.+?)\\}`)}get timeRegExp(){return new RegExp(`${sl(this.setting.timeTrigger)}\\{(?<time>.+?)\\}`)}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,u=this.dateRegExp,c=u.exec(e);if(c)o=c.groups.date,e=e.replace(u,"");else return{title:n};let f=c.index,h=f+c[0].length,b={start:f,end:h},I=this.timeRegExp,g=I.exec(e);if(g){a=g.groups.time,e=e.replace(I,"");let x=g.index>=f?g.index+c[0].length:g.index,k=x+g[0].length;b={start:Math.min(f,x),end:Math.max(h,k)}}let v=e.trim();if(a){let x=[this.setting.timeFormat,...["h:mm A","hh:mm A","HH:mm"].filter(k=>k!==this.setting.timeFormat)];for(let k of x){let B=(0,Sc.default)(`${o} ${a}`,`${this.setting.dateFormat} ${k}`,!0);if(B.isValid())return{title:v,time:new $(B,!0),span:b}}return{title:n}}let y=t!=null?t:!0,w=new $((0,Sc.default)(o,this.setting.dateFormat,y),!1);return w.isValid()?{title:v,time:w,span:b}:{title:n}}};m(ul,"instance",new ul(UI));var Ds=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=Ds.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+Ds.instance.format(this.time).length;return{start:e,end:t}}toMarkdown(){return`${this.title.trim()} ${Ds.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 Rc=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,u){let c=this.getToken(e);if(c===null){if(!o)return null;if(e instanceof Zr?c={symbol:e.primary,text:t}:c={symbol:e,text:t},a&&c.symbol!==""&&!c.text.startsWith(" ")&&(c.text=" "+c.text),this.tokens.length>0){let f=this.tokens[this.tokens.length-1];this.isTokenEndsWithSpace(f)||(f.text+=" ")}if(u==null)this.tokens.push(c);else{let f=0,h=-1,b=0;for(let I of this.tokens){let g=f+I.symbol.length+I.text.length;if(b>0&&g>u){h=b;break}f=g,b++}h==-1?this.tokens.push(c):(this.tokens.splice(h,0,c),h<this.tokens.length-1&&(c.text=c.text+" "))}return c}return this.replaceTokenText(c,t,n),c}length(){return this.tokens.length}replaceTokenText(e,t,n=!1){if(!n){e.text=t;return}e.text=e.text.replace(/^(\s*).*?(\s*)$/,`$1${t}$2`)}isTokenEndsWithSpace(e){return e.text.match(/^.*\s$/)}getToken(e){for(let t of this.tokens)if(e instanceof Zr){if(e.isSymbol(t.symbol))return t}else if(e===t.symbol)return t;return null}getTokenText(e,t=!1){let n=this.getToken(e);return n===null?null:t?n.text.replace(/^\s*(.*?)\s*$/,"$1"):n.text}removeToken(e){this.tokens=this.tokens.filter(t=>!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 gp(r,e){let t=[...r],n="",o=null,a=[],u=()=>{o===null?a.push({symbol:"",text:n}):o.text=n};return t.forEach(c=>{e.filter(h=>h.isSymbol(c)).length>0?(u(),o={symbol:c,text:""},a.push(o),n=""):o!==null&&c==="#"&&(n.length===0||/\s$/.test(n))?(u(),o=null,n=c):n+=c}),n.length>0&&u(),a}var se=class se{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 se(t!=null?t:!1,n!=null?n:!1,o!=null?o:!0,a!=null?a:!1,new dl(gp(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(se.symbolDueDate)}setDueDate(e){this.setDate(se.symbolDueDate,e)}setRawTime(e){return this.setDate(this.writeReminderSymbol(),e),!0}resolveReminderSymbol(){if(!this.useCustomEmoji)return se.symbolDueDate;if(!this.useDueDateFallback)return se.symbolReminder;let e=[se.symbolReminder,se.symbolDueDate,se.symbolScheduled,se.symbolStart];for(let t of e)if(this.tokens.getToken(t)!=null)return t;return se.symbolReminder}writeReminderSymbol(){return this.useCustomEmoji?se.symbolReminder:se.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(se.symbolDoneDate)}setDoneDate(e){this.setDate(se.symbolDoneDate,e)}getRecurrence(){return this.tokens.getTokenText(se.symbolRecurrence,!0)}clone(){return se.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===se.symbolReminder)return jr.parse(t);if(e===se.symbolDueDate){let o=(0,Rc.default)(t,se.dueDateTimeFormat,!0);if(o.isValid())return new $(o,!0)}let n=(0,Rc.default)(t,se.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===se.symbolReminder?o=jr.toString(t):e===se.symbolDueDate&&t.hasTimePart?o=t.format(se.dueDateTimeFormat):o=t.format(se.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:!(e<t)}};m(se,"dateFormat","YYYY-MM-DD"),m(se,"dueDateTimeFormat","YYYY-MM-DD HH:mm"),m(se,"symbolDueDate",Zr.ofChars([..."\u{1F4C5}\u{1F4C6}\u{1F5D3}"])),m(se,"symbolDoneDate",Zr.ofChar("\u2705")),m(se,"symbolRecurrence",Zr.ofChar("\u{1F501}")),m(se,"symbolReminder",Zr.ofChar("\u23F0")),m(se,"symbolScheduled",Zr.ofChar("\u23F3")),m(se,"symbolStart",Zr.ofChar("\u{1F6EB}")),m(se,"allSymbols",[se.symbolDueDate,se.symbolDoneDate,se.symbolRecurrence,se.symbolReminder,se.symbolStart,se.symbolScheduled]);var fl=se,pl=class pl extends ho{parseReminder(e){let t=fl.parse(e.body,this.useCustomEmoji(),this.removeTagsEnabled(),this.isStrictDateFormat(),this.useDueDateFallback());if(this.useCustomEmoji()){if(this.useDueDateFallback()){if(t.getTime()==null)return null}else if(t.getDueDate()==null)return null}return t}removeTagsEnabled(){return this.config.getParameter(Qe.removeTagsForTasksPlugin)}useCustomEmoji(){return this.config.getParameter(Qe.useCustomEmojiForTasksPlugin)}useDueDateFallback(){return this.config.getParameter(Qe.useReminderTimeFallbackForTasksPlugin)}usesSeparateReminderDate(){return this.useCustomEmoji()}newReminder(e,t,n){let o=fl.parse(e,this.useCustomEmoji(),this.removeTagsEnabled(),this.isStrictDateFormat(),this.useDueDateFallback());return o.setTime(t,n),this.useCustomEmoji()&&o.getDueDate()==null&&o.setDueDate(t),o.setTitle(e),o}};m(pl,"instance",new pl);var ml=pl;var bo=new La;bo.resetFormat([go.instance]);var vo=class{constructor(e,t,n,o,a){m(this,"name",e);m(this,"description",t);m(this,"example",n);m(this,"format",o);m(this,"defaultEnabled",a)}};function yo(r){return bo.parse(r)}async function hl(r,e,t){return bo.modify(r,e,t)}function bp(r){r.length===0?bo.resetFormat([go.instance]):bo.resetFormat(r.map(e=>e.format))}function vp(r){bo.setConfig(r)}var Fc=new vo("ReminderPluginReminderFormat","Reminder plugin format","(@2021-09-08)",go.instance,!0),Tc=new vo("TasksPluginReminderFormat","Tasks plugin format","\u{1F4C5} 2021-09-08",ml.instance,!1),Ec=new vo("KanbanPluginReminderFormat","Kanban plugin format","@{2021-09-08}",ll.instance,!1),Gc=new vo("DataviewReminderFormat","Dataview format","[due:: 2021-09-08]",rl.instance,!1),_o=[Fc,Tc,Ec,Gc];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 yp=require("obsidian");var gl=class extends yp.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 _p(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 QI(r,e,t){let n=0,o=r.app.vault;for(let a of o.getMarkdownFiles()){let u=new Dn(a.path,await o.read(a)),c=0;await u.modifyReminderLines(f=>{let h;return f.time.hasTimePart?h=f.time.format(t):h=f.time.format(e),n++,c++,{rawTime:h}}),c>0&&await o.modify(a,u.getContent())}return r.settings.dateFormat.rawValue.value=e,r.settings.dateTimeFormat.rawValue.value=t,n>0&&await r.fileSystem.reloadRemindersInAllFiles(),n}function Ip(r,e){return r||Im("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&&_p(e.app,(n,o)=>{QI(e,n,o).catch(()=>{})})}),!0}function wp(r,e,t){if(r)return!0;t.showAutoComplete(e)}async function VI(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(u=>u.rowNumber===t);if(a)await o.updateReminder(a,{checked:!a.done});else{let u=o.getTodos().find(c=>c.lineIndex===t);if(!u)return;u.setChecked(!u.isChecked())}await n.modify(e,o.getContent())}function Cp(r,e,t){if(r)return!0;e&&e.file&&VI(t,e.file,e.editor.getCursor().line)}var xp=require("obsidian");var bl=class extends xp.SuggestModal{constructor(t,n){super(t);m(this,"onSelect",n)}getSuggestions(t){return Cm.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"}),u=$.now(),c=o.createDiv({cls:"reminder-preset-previews"});c.createEl("div",{cls:"reminder-preset-preview-line",text:"Year/Month: "+u.format(t.format.yearMonthFormat)}),c.createEl("div",{cls:"reminder-preset-preview-line",text:"Month/Day: "+u.format(t.format.monthDayFormat)}),c.createEl("div",{cls:"reminder-preset-preview-line",text:"Short: "+u.format(t.format.shortDateWithWeekdayFormat)}),c.createEl("div",{cls:"reminder-preset-preview-line",text:"Time: "+u.format(t.format.timeFormat)}),a.style.fontWeight="600",a.style.marginBottom="4px",c.style.opacity="0.8",c.style.fontSize="12px",c.style.display="grid",c.style.gridAutoRows="min-content",c.style.rowGap="2px"}onChooseSuggestion(t){this.onSelect(t)}};function Ap(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 Sp(r){r.addCommand({id:"scan-reminders",name:"Scan reminders",checkCallback:e=>gm(e,r)}),r.addCommand({id:"show-reminders",name:"Show reminders",checkCallback:e=>bm(e,r.ui)}),r.addCommand({id:"convert-reminder-time-format",name:"Convert reminder time format",checkCallback:e=>Ip(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)=>wp(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 kp.MarkdownView?Cp(e,n,r):!1}),r.addCommand({id:"set-date-display-format",name:"Set date display format",checkCallback:e=>Ap(e,r)}),r.addCommand({id:"pause-notifications",name:"Pause reminder notifications",checkCallback:e=>pm(e,r)}),r.addCommand({id:"resume-notifications",name:"Resume reminder notifications",checkCallback:e=>hm(e,r)}),r.addCommand({id:"mute-all-reminders",name:"Mute all current reminders",checkCallback:e=>fm(e,r)})}var Rp=require("obsidian");function Fp(r){if(!Rp.Platform.isMobile)return;let e=`${r.manifest.dir}/logs.txt`,t=[],n=o=>(...a)=>{t.push(`
|
|
[${o}]`);for(let u of a)t.push(String(u));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 LI=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",()=>{Ma(this.plugin)}),this.plugin.registerInterval(window.setInterval(()=>this.refresh(),LI)),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"),Ns=Symbol("legacy props"),Ep=Symbol(""),_l=Symbol("proxy path"),Il=Symbol("attributes"),Ws=Symbol("class"),Bc=Symbol("style"),Zs=Symbol("text"),di=Symbol("form reset"),Dc=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")}},Tp,Nc=!!((Tp=globalThis.document)!=null&&Tp.contentType)&&globalThis.document.contentType.includes("xml");var Io=3,Ar=8;var Bp,Dp,Gp=(Dp=(Bp=globalThis.process)==null?void 0:Bp.env)==null?void 0:Dp.NODE_ENV,R=Gp&&!Gp.toLowerCase().startsWith("prod");var kr=Array.isArray,Np=Array.prototype.indexOf,fi=Array.prototype.includes,wo=Array.from,Wc=Object.keys,Rt=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,wl=Object.getOwnPropertyDescriptors,Zc=Object.prototype,Wp=Array.prototype,Gi=Object.getPrototypeOf,Mc=Object.isExtensible;var tn=()=>{};function Zp(r){return r()}function Co(r){for(var e=0;e<r.length;e++)r[e]()}function Cl(){var r,e,t=new Promise((n,o)=>{r=n,e=o});return{promise:t,resolve:r,reject:e}}function xl(r){return r===this.v}function Yc(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function Al(r){return!Yc(r,this.v)}function Mp(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 Xp(){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 Xc(){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 Up(){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 Uc(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 Qp(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 Vp(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 Lp(){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 Op(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 $p(){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 Pp(){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 Hp(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 Jp(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 jp(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 zp(){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 Kp(){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 qp(){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 eh(){if(R){let r=new Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var it=!1,rn=!1,Mr=!1;function th(){rn=!0}var Wn={};var Be=Symbol("uninitialized"),Sr=Symbol("filename");var kl="http://www.w3.org/1999/xhtml";var Ms=null;function Yt(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 Yr(r){let e=new Error,t=$I();return t.length===0?null:(t.unshift(`
|
|
`),Rt(e,"stack",{value:t.join(`
|
|
`)}),Rt(e,"name",{value:r}),e)}function $I(){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<t.length;o++){let a=t[o],u=a.replaceAll("\\","/");if(a.trim()!=="Error"){if(a.includes("validate_each_keys"))return[];u.includes("svelte/src/internal")||u.includes("node_modules/.vite")||n.push(a)}}return n}function nh(r,e){if(!R)throw new Error("invariant(...) was not guarded by if (DEV)");r||Mp(e)}var q=null;function Zn(r){q=r}var nn=null;function Ao(r){nn=r}var Xr=null;function Fl(r){Xr=r}function Ke(r,e=!1,t){q={p:q,i:!1,c:null,e:null,s:r,x:null,r:M,l:rn&&!e?{s:null,u:null,$:[]}:null},R&&(q.function=t,Xr=t)}function qe(r){var o;var e=q,t=e.e;if(t!==null){e.e=null;for(var n of t)Qc(n)}return r!==void 0&&(e.x=r),e.i=!0,q=e.p,R&&(Xr=(o=q==null?void 0:q.function)!=null?o:null),r!=null?r:{}}function on(){return!rn||q!==null&&q.l===null}var Bi=[];function ih(){var r=Bi;Bi=[],Co(r)}function et(r){if(Bi.length===0&&!Di){var e=Bi;queueMicrotask(()=>{e===Bi&&ih()})}Bi.push(r)}function oh(){for(;Bi.length>0;)ih()}var sn="font-weight: bold",an="font-weight: normal";function sh(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 ah(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 lh(){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 uh(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 ch(){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 dh(){R?console.warn("%c[svelte] select_multiple_invalid_value\n%cThe `value` property of a `<select multiple>` element should be an array, but it received a non-array value. The selection will be kept as is.\nhttps://svelte.dev/e/select_multiple_invalid_value",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 fh(){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 mh(){R?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",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 Xs(r){if(!r||r.nodeType!==Ar)throw Ni(),Wn;return r.data}var PI=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function Mn(r){if(typeof r!="object"||r===null||dt in r)return r;let e=Gi(r);if(e!==Zc&&e!==Wp)return r;var t=new Map,n=kr(r),o=un(0),a=R&&Mr?Yr("created at"):null,u=pi,c=I=>{if(pi===u)return I();var g=H,v=pi;mt(null),Vc(u);var y=I();return mt(g),Vc(v),y};n&&(t.set("length",un(r.length,a)),R&&(r=JI(r)));var f="";let h=!1;function b(I){if(!h){h=!0,f=I,Yt(o,`${f} version`);for(let[g,v]of t)Yt(v,Wi(f,g));h=!1}}return new Proxy(r,{defineProperty(I,g,v){(!("value"in v)||v.configurable===!1||v.enumerable===!1||v.writable===!1)&&zp();var y=t.get(g);return y===void 0?c(()=>{var w=un(v.value,a);return t.set(g,w),R&&typeof g=="string"&&Yt(w,Wi(f,g)),w}):K(y,v.value,!0),!0},deleteProperty(I,g){var v=t.get(g);if(v===void 0){if(g in I){let y=c(()=>un(Be,a));t.set(g,y),Zi(o),R&&Yt(y,Wi(f,g))}}else K(v,Be),Zi(o);return!0},get(I,g,v){var k;if(g===dt)return r;if(R&&g===_l)return b;var y=t.get(g),w=g in I;if(y===void 0&&(!w||(k=$t(I,g))!=null&&k.writable)&&(y=c(()=>{var B=Mn(w?I[g]:Be),F=un(B,a);return R&&Yt(F,Wi(f,g)),F}),t.set(g,y)),y!==void 0){var x=A(y);return x===Be?void 0:x}return Reflect.get(I,g,v)},getOwnPropertyDescriptor(I,g){var v=Reflect.getOwnPropertyDescriptor(I,g);if(v&&"value"in v){var y=t.get(g);y&&(v.value=A(y))}else if(v===void 0){var w=t.get(g),x=w==null?void 0:w.v;if(w!==void 0&&x!==Be)return{enumerable:!0,configurable:!0,value:x,writable:!0}}return v},has(I,g){var x;if(g===dt)return!0;var v=t.get(g),y=v!==void 0&&v.v!==Be||Reflect.has(I,g);if(v!==void 0||M!==null&&(!y||(x=$t(I,g))!=null&&x.writable)){v===void 0&&(v=c(()=>{var k=y?Mn(I[g]):Be,B=un(k,a);return R&&Yt(B,Wi(f,g)),B}),t.set(g,v));var w=A(v);if(w===Be)return!1}return y},set(I,g,v,y){var pe;var w=t.get(g),x=g in I;if(n&&g==="length")for(var k=v;k<w.v;k+=1){var B=t.get(k+"");B!==void 0?K(B,Be):k in I&&(B=c(()=>un(Be,a)),t.set(k+"",B),R&&Yt(B,Wi(f,k)))}if(w===void 0)(!x||(pe=$t(I,g))!=null&&pe.writable)&&(w=c(()=>un(void 0,a)),R&&Yt(w,Wi(f,g)),K(w,Mn(v)),t.set(g,w));else{x=w.v!==Be;var F=c(()=>Mn(v));K(w,F)}var P=Reflect.getOwnPropertyDescriptor(I,g);if(P!=null&&P.set&&P.set.call(y,v),!x){if(n&&typeof g=="string"){var ie=t.get("length"),Y=Number(g);Number.isInteger(Y)&&Y>=ie.v&&K(ie,Y+1)}Zi(o)}return!0},ownKeys(I){A(o);var g=Reflect.ownKeys(I).filter(w=>{var x=t.get(w);return x===void 0||x.v!==Be});for(var[v,y]of t)y.v!==Be&&!(v in I)&&g.push(v);return g},setPrototypeOf(){Kp()}})}function Wi(r,e){var t;return typeof e=="symbol"?`${r}[Symbol(${(t=e.description)!=null?t:""})]`:PI.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 Lc(r,e){return Object.is(Fo(r),Fo(e))}var HI=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function JI(r){return new Proxy(r,{get(e,t,n){var o=Reflect.get(e,t,n);return HI.has(t)?function(...a){ph();var u=o.apply(this,a);return El(),u}:o}})}function hh(){let r=Array.prototype,e=Array.__svelte_cleanup;e&&e();let{indexOf:t,lastIndexOf:n,includes:o}=r;r.indexOf=function(a,u){let c=t.call(this,a,u);if(c===-1){for(let f=u!=null?u:0;f<this.length;f+=1)if(Fo(this[f])===a){Tl("array.indexOf(...)");break}}return c},r.lastIndexOf=function(a,u){let c=n.call(this,a,u!=null?u:this.length-1);if(c===-1){for(let f=0;f<=(u!=null?u:this.length-1);f+=1)if(Fo(this[f])===a){Tl("array.lastIndexOf(...)");break}}return c},r.includes=function(a,u){let c=o.call(this,a,u);if(!c){for(let f=0;f<this.length;f+=1)if(Fo(this[f])===a){Tl("array.includes(...)");break}}return c},Array.__svelte_cleanup=()=>{r.indexOf=t,r.lastIndexOf=n,r.includes=o}}var Us,gh,Qs,bh,vh;function Gl(){if(Us===void 0){Us=window,gh=document,Qs=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;bh=$t(e,"firstChild").get,vh=$t(e,"nextSibling").get,Mc(r)&&(r[Ws]=void 0,r[Il]=null,r[Bc]=void 0,r.__e=void 0),Mc(t)&&(t[Zs]=void 0),R&&(r.__svelte_meta=null,hh())}}function wt(r=""){return document.createTextNode(r)}function Xt(r){return bh.call(r)}function Gt(r){return vh.call(r)}function J(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 Vs(r){r.textContent=""}function Bl(){if(!it||tr!==null)return!1;var r=M.f;return(r&32768)!==0}function Yn(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 Oc=new WeakMap;function Nl(r){var e=M;if(e===null)return H.f|=8388608,r;if(R&&r instanceof Error&&!Oc.has(r)&&Oc.set(r,jI(r,e)),(e.f&32768)===0&&(e.f&4)===0)throw R&&!e.parent&&r instanceof Error&&yh(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&&yh(r),r}}function jI(r,e){var u,c,f;let t=$t(r,"message");if(!(t&&!t.configurable)){for(var n=Qs?" ":" ",o=`
|
|
${n}in ${((u=e.fn)==null?void 0:u.name)||"<unknown>"}`,a=e.ctx;a!==null;)o+=`
|
|
${n}in ${(c=a.function)==null?void 0:c[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 yh(r){let e=Oc.get(r);e&&(Rt(r,"message",{value:e.message}),Rt(r,"stack",{value:e.stack}))}var zI=-7169;function Ae(r,e){r.f=r.f&zI|e}function Eo(r){(r.f&512)!==0||r.deps===null?Ae(r,1024):Ae(r,4096)}function _h(r){if(r!==null)for(let e of r)(e.f&2)===0||(e.f&65536)===0||(e.f^=65536,_h(e.deps))}function Wl(r,e,t){(r.f&2048)!==0?e.add(r):(r.f&4096)!==0&&t.add(r),_h(r.deps),Ae(r,1024)}var Ih=!1,Zl=!1;function $c(r){var e=Zl;try{return Zl=!1,[r(),Zl]}finally{Zl=e}}var wh=!1;function Ml(){wh||(wh=!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=H,t=M;mt(null),tt(null);try{return r()}finally{mt(e),tt(t)}}function Yl(r,e,t,n=t){r.addEventListener(e,()=>Tr(t));let o=r[di];o?r[di]=()=>{o(),n(!0)}:r[di]=()=>n(!0),Ml()}function Ch(r){let e=0,t=Vt(0),n;return R&&Yt(t,"createSubscriber version"),()=>{mi()&&(A(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 qI=589824;function Kc(r,e,t,n){new Pc(r,e,t,n)}var ur,Os,Er,Mi,nr,Gr,Pt,cr,Un,Yi,gi,Bo,$s,Ps,cn,Ql,Ee,Ah,kh,Hc,Sh,Jc,Xl,Ul,jc,zc,Pc=class{constructor(e,t,n,o){ee(this,Ee);m(this,"parent");m(this,"is_pending",!1);m(this,"transform_error");ee(this,ur);ee(this,Os,L?ne:null);ee(this,Er);ee(this,Mi);ee(this,nr);ee(this,Gr,null);ee(this,Pt,null);ee(this,cr,null);ee(this,Un,null);ee(this,Yi,0);ee(this,gi,0);ee(this,Bo,!1);ee(this,$s,new Set);ee(this,Ps,new Set);ee(this,cn,null);ee(this,Ql,Ch(()=>(z(this,cn,Vt(C(this,Yi))),R&&Yt(C(this,cn),"$effect.pending()"),()=>{z(this,cn,null)})));var a,u;z(this,ur,e),z(this,Er,t),z(this,Mi,c=>{var f=M;f.b=this,f.f|=128,n(c)}),this.parent=M.b,this.transform_error=(u=o!=null?o:(a=this.parent)==null?void 0:a.transform_error)!=null?u:(c=>c),z(this,nr,mr(()=>{if(L){let c=C(this,Os);Et();let f=c.data==="[!";if(c.data.startsWith("[?")){let b=JSON.parse(c.data.slice("[?".length));ae(this,Ee,kh).call(this,b)}else f?ae(this,Ee,Sh).call(this):ae(this,Ee,Ah).call(this)}else ae(this,Ee,Jc).call(this)},qI)),L&&z(this,ur,ne)}defer_effect(e){Wl(e,C(this,$s),C(this,Ps))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!C(this,Er).pending}update_pending_count(e,t){ae(this,Ee,jc).call(this,e,t),z(this,Yi,C(this,Yi)+e),!(!C(this,cn)||C(this,Bo))&&(z(this,Bo,!0),et(()=>{z(this,Bo,!1),C(this,cn)&&Vr(C(this,cn),C(this,Yi))}))}get_effect_pending(){return C(this,Ql).call(this),A(C(this,cn))}error(e){var t;if(!C(this,Er).onerror&&!C(this,Er).failed)throw e;(t=O)!=null&&t.is_fork?(C(this,Gr)&&O.skip_effect(C(this,Gr)),C(this,Pt)&&O.skip_effect(C(this,Pt)),C(this,cr)&&O.skip_effect(C(this,cr)),O.oncommit(()=>{ae(this,Ee,zc).call(this,e)})):ae(this,Ee,zc).call(this,e)}};ur=new WeakMap,Os=new WeakMap,Er=new WeakMap,Mi=new WeakMap,nr=new WeakMap,Gr=new WeakMap,Pt=new WeakMap,cr=new WeakMap,Un=new WeakMap,Yi=new WeakMap,gi=new WeakMap,Bo=new WeakMap,$s=new WeakMap,Ps=new WeakMap,cn=new WeakMap,Ql=new WeakMap,Ee=new WeakSet,Ah=function(){try{z(this,Gr,bt(()=>C(this,Mi).call(this,C(this,ur))))}catch(e){this.error(e)}},kh=function(e){let t=C(this,Er).failed,{reset:n,invoke_onerror:o}=ae(this,Ee,Hc).call(this,e);et(o),t&&z(this,cr,bt(()=>{t(C(this,ur),()=>e,()=>n)}))},Hc=function(e){var t=!1,n=!1;let o=()=>{if(t){mh();return}t=!0,n&&eh(),C(this,cr)!==null&&dn(C(this,cr),()=>{z(this,cr,null)}),ae(this,Ee,Ul).call(this,()=>{ae(this,Ee,Jc).call(this)})};return{reset:o,invoke_onerror:()=>{var u,c;try{n=!0,(c=(u=C(this,Er)).onerror)==null||c.call(u,e,o),n=!1}catch(f){Qr(f,C(this,nr)&&C(this,nr).parent)}}}},Sh=function(){let e=C(this,Er).pending;e&&(this.is_pending=!0,z(this,Pt,bt(()=>e(C(this,ur)))),et(()=>{var t=z(this,Un,document.createDocumentFragment()),n=wt();t.append(n),z(this,Gr,ae(this,Ee,Ul).call(this,()=>bt(()=>C(this,Mi).call(this,n)))),C(this,gi)===0&&(C(this,ur).before(t),z(this,Un,null),dn(C(this,Pt),()=>{z(this,Pt,null)}),ae(this,Ee,Xl).call(this,O))}))},Jc=function(){try{if(this.is_pending=this.has_pending_snippet(),z(this,gi,0),z(this,Yi,0),z(this,Gr,bt(()=>{C(this,Mi).call(this,C(this,ur))})),C(this,gi)>0){var e=z(this,Un,document.createDocumentFragment());Do(C(this,Gr),e);let t=C(this,Er).pending;z(this,Pt,bt(()=>t(C(this,ur))))}else ae(this,Ee,Xl).call(this,O)}catch(t){this.error(t)}},Xl=function(e){this.is_pending=!1,e.transfer_effects(C(this,$s),C(this,Ps))},Ul=function(e){var t=M,n=H,o=q;tt(C(this,nr)),mt(C(this,nr)),Zn(C(this,nr).ctx);try{return fr.ensure(),e()}catch(a){return Nl(a),null}finally{tt(t),mt(n),Zn(o)}},jc=function(e,t){var n;if(!this.has_pending_snippet()){this.parent&&ae(n=this.parent,Ee,jc).call(n,e,t);return}z(this,gi,C(this,gi)+e),C(this,gi)===0&&(ae(this,Ee,Xl).call(this,t),C(this,Pt)&&dn(C(this,Pt),()=>{z(this,Pt,null)}),C(this,Un)&&(C(this,ur).before(C(this,Un)),z(this,Un,null)))},zc=function(e){C(this,Gr)&&(Oe(C(this,Gr)),z(this,Gr,null)),C(this,Pt)&&(Oe(C(this,Pt)),z(this,Pt,null)),C(this,cr)&&(Oe(C(this,cr)),z(this,cr,null)),L&&(Fe(C(this,Os)),Ro(),Fe(ln()));let t=C(this,Er).failed,n=o=>{let{reset:a,invoke_onerror:u}=ae(this,Ee,Hc).call(this,o);u(),t&&z(this,cr,ae(this,Ee,Ul).call(this,()=>{try{return bt(()=>{var c=M;c.b=this,c.f|=128,t(C(this,ur),()=>o,()=>a)})}catch(c){return Qr(c,C(this,nr).parent),null}}))};et(()=>{var o;try{o=this.transform_error(e)}catch(a){Qr(a,C(this,nr)&&C(this,nr).parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(n,a=>Qr(a,C(this,nr)&&C(this,nr).parent)):n(o)})};function Vl(r,e,t,n){let o=on()?bi:Vn;var a=r.filter(v=>!v.settled),u=e.map(o);if(R&&u.forEach((v,y)=>{v.label=e[y].toString().replace("() => ","").replaceAll("$.eager(() => ","$state.eager(").replace(/\$\.get\((.+?)\)/g,(w,x)=>x)}),t.length===0&&a.length===0){n(u);return}var c=M,f=Rh(),h=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(v=>v.promise)):null;function b(v){if((c.f&16384)===0){f();try{n([...u,...v])}catch(y){Qr(y,c)}No()}}var I=qc();if(t.length===0){h.then(()=>b([])).finally(I);return}function g(){Promise.all(t.map(v=>td(v))).then(b).catch(v=>Qr(v,c)).finally(I)}h?h.then(()=>{f(),g(),No()}):g()}function Rh(){var r=M,e=H,t=q,n=O;if(R)var o=nn;return function(u=!0){tt(r),mt(e),Zn(t),u&&(r.f&16384)===0&&(n==null||n.activate(),n==null||n.apply()),R&&(ed(null),Ao(o))}}function No(r=!0){var e;tt(null),mt(null),Zn(null),r&&((e=O)==null||e.deactivate()),R&&(ed(null),Ao(null))}function qc(){var r=M,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 ed(r){ir=r}var Hs=new Set;function bi(r){var e=2050;M!==null&&(M.f|=524288);let t={ctx:q,deps:null,effects:null,equals:xl,f:e,fn:r,reactions:null,rv:0,v:Be,wv:0,parent:M,ac:null};return R&&Mr&&(t.created=Yr("created at")),t}var Wo=Symbol("obsolete");function td(r,e,t){let n=M;n===null&&Xp();var o=void 0,a=Vt(Be);R&&(a.label=e!=null?e:r.toString());var u=!H,c=new Set;return Eh(()=>{var v,y;var f=M;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<Ht;w+=1)ir.effect_deps.add(f.deps[w]);if(Ct!==null)for(let w=0;w<Ct.length;w+=1)ir.effect_deps.add(Ct[w])}ir=null}var b=O;if(u){if((f.f&32768)!==0)var I=qc();if((v=n.b)!=null&&v.is_rendered())(y=b.async_deriveds.get(f))==null||y.reject(Wo);else for(let w of c.values())w.reject(Wo);c.add(h),b.async_deriveds.set(f,h)}let g=(w,x=void 0)=>{R&&(ir=null),I==null||I(),c.delete(h),x!==Wo&&(b.activate(),x?(a.f|=8388608,Vr(a,x)):((a.f&8388608)!==0&&(a.f^=8388608),R&&t!==void 0&&!a.equals(w)&&(Hs.add(a),setTimeout(()=>{Hs.has(a)&&(f.f&16384)===0&&(ah(a.label,t),Hs.delete(a))})),Vr(a,w)),b.deactivate())};h.promise.then(g,w=>g(null,w||"unknown"))}),pt(()=>{for(let f of c)f.reject(Wo)}),R&&(a.f|=4194304),new Promise(f=>{function h(b){function I(){b===o?f(a):h(o)}b.then(I,I)}h(o)})}function Vn(r){let e=bi(r);return e.equals=Al,e}function Fh(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)Oe(e[t])}}var rd=[];function Js(r){var e,t=M,n=r.parent;if(!pr&&n!==null&&r.v!==Be&&(n.f&24576)!==0)return lh(),r.v;if(tt(n),R){let o=Xi;Ll(new Set);try{fi.call(rd,r)&&Up(),rd.push(r),r.f&=-65537,Fh(r),e=Ol(r)}finally{tt(t),Ll(o),rd.pop()}}else try{r.f&=-65537,Fh(r),e=Ol(r)}finally{tt(t)}return e}function nd(r){var t,n,o;var e=Js(r);if(!r.equals(e)&&(r.wv=Zo(),(!((t=O)!=null&&t.is_fork)||r.deps===null)&&(O!==null?(O.capture(r,e,!0),(n=fn)==null||n.capture(r,e,!0)):r.v=e,r.deps===null))){Ae(r,1024);return}pr||(st!==null?(mi()||(o=O)!=null&&o.is_fork)&&st.set(r,e):Eo(r))}function Th(r){var e;if(r.effects!==null)for(let t of r.effects)(t.teardown||t.ac)&&((e=t.teardown)==null||e.call(t),t.ac!==null&&Tr(()=>{t.ac.abort(Nn),t.ac=null}),t.fn!==null&&(t.teardown=tn),Ui(t,0),js(t))}function id(r){if(r.effects!==null)for(let e of r.effects)e.teardown&&e.fn!==null&&Lr(e)}var $l=null,Mo=null,O=null,fn=null,st=null,ld=null,Di=!1,sd=!1,Qi=null,qs=null,Gh=0,ad=new Set,rw=1,Xo,Ln,On,Uo,Qo,Vo,$n,Lo,Jt,ea,Pn,Or,mn,Oo,vi,ke,ud,zs,cd,Dh,Nh,Yo,Wh,Ks,Pl=class Pl{constructor(){ee(this,ke);m(this,"id",rw++);ee(this,Xo,!1);m(this,"linked",!0);ee(this,Ln,null);ee(this,On,null);m(this,"async_deriveds",new Map);m(this,"current",new Map);m(this,"previous",new Map);ee(this,Uo,new Set);ee(this,Qo,new Set);ee(this,Vo,0);ee(this,$n,new Map);ee(this,Lo,null);ee(this,Jt,[]);ee(this,ea,[]);ee(this,Pn,new Set);ee(this,Or,new Set);ee(this,mn,new Map);ee(this,Oo,new Set);m(this,"is_fork",!1);ee(this,vi,!1);Mo===null?$l=Mo=this:(z(Mo,On,this),z(this,Ln,Mo)),Mo=this}skip_effect(e){C(this,mn).has(e)||C(this,mn).set(e,{d:[],m:[]}),C(this,Oo).delete(e)}unskip_effect(e,t=n=>this.schedule(n)){var n=C(this,mn).get(e);if(n){C(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)}C(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&&ad.clear(),sd=!0,O=this,ae(this,ke,zs).call(this)}finally{if(Gh=0,ld=null,Qi=null,qs=null,sd=!1,O=null,st=null,Hn.clear(),R)for(let e of ad)e.updated=null}}discard(){var e;for(let t of C(this,Qo))t(this);C(this,Qo).clear();for(let t of this.async_deriveds.values())t.reject(Wo);ae(this,ke,Ks).call(this),(e=C(this,Lo))==null||e.resolve()}register_created_effect(e){C(this,ea).push(e)}increment(e,t){var n;if(z(this,Vo,C(this,Vo)+1),e){let o=(n=C(this,$n).get(t))!=null?n:0;C(this,$n).set(t,o+1)}}decrement(e,t){var n;if(z(this,Vo,C(this,Vo)-1),e){let o=(n=C(this,$n).get(t))!=null?n:0;o===1?C(this,$n).delete(t):C(this,$n).set(t,o-1)}C(this,vi)||(z(this,vi,!0),et(()=>{z(this,vi,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(let n of e)C(this,Pn).add(n);for(let n of t)C(this,Or).add(n);e.clear(),t.clear()}oncommit(e){C(this,Uo).add(e)}ondiscard(e){C(this,Qo).add(e)}settled(){var e;return((e=C(this,Lo))!=null?e:z(this,Lo,Cl())).promise}static ensure(){if(O===null){let e=O=new Pl;!sd&&!Di&&et(()=>{C(e,Xo)||e.flush()})}return O}apply(){if(!it||!this.is_fork&&C(this,Ln)===null&&C(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=C(t,On))if(!(t===this||t.is_fork)){var e=!1;if(t.id<this.id){for(let[n,[,o]]of t.current)if(!o&&this.current.has(n)){e=!0;break}}if(!e)for(let[n,o]of t.previous)st.has(n)||st.set(n,o)}}schedule(e){var o;if(ld=e,(o=e.b)!=null&&o.is_pending&&(e.f&16777228)!==0&&(e.f&32768)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(Qi!==null&&t===M&&(it||(H===null||(H.f&2)===0)&&!Ih))return;if((n&96)!==0){if((n&1024)===0)return;t.f^=1024}}C(this,Jt).push(t)}};Xo=new WeakMap,Ln=new WeakMap,On=new WeakMap,Uo=new WeakMap,Qo=new WeakMap,Vo=new WeakMap,$n=new WeakMap,Lo=new WeakMap,Jt=new WeakMap,ea=new WeakMap,Pn=new WeakMap,Or=new WeakMap,mn=new WeakMap,Oo=new WeakMap,vi=new WeakMap,ke=new WeakSet,ud=function(){if(this.is_fork)return!0;for(let n of C(this,$n).keys()){for(var e=n,t=!1;e.parent!==null;){if(C(this,mn).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1},zs=function(){var f,h,b,I;if(z(this,Xo,!0),Gh++>1e3&&(ae(this,ke,Ks).call(this),nw()),R)for(let g of this.current.keys())ad.add(g);for(let g of C(this,Pn))C(this,Or).delete(g),Ae(g,2048),this.schedule(g);for(let g of C(this,Or))Ae(g,4096),this.schedule(g);let e=C(this,Jt);z(this,Jt,[]),this.apply();var t=Qi=[],n=[],o=qs=[];for(let g of e)try{ae(this,ke,cd).call(this,g,t,n)}catch(v){throw Yh(g),ae(this,ke,ud).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,qs=null,ae(this,ke,ud).call(this)){ae(this,ke,Yo).call(this,n),ae(this,ke,Yo).call(this,t);for(let[g,v]of C(this,mn))Mh(g,v);o.length>0&&ae(f=O,ke,zs).call(f);return}let u=ae(this,ke,Dh).call(this);if(u){ae(this,ke,Yo).call(this,n),ae(this,ke,Yo).call(this,t),ae(h=u,ke,Nh).call(h,this);return}C(this,Pn).clear(),C(this,Or).clear();for(let g of C(this,Uo))g(this);C(this,Uo).clear(),fn=this,Bh(n),Bh(t),fn=null,(b=C(this,Lo))==null||b.resolve();var c=O;if(C(this,Vo)===0&&(C(this,Jt).length===0||c!==null)&&(ae(this,ke,Ks).call(this),it&&(ae(this,ke,Wh).call(this),O=c)),C(this,Jt).length>0)if(c!==null){let g=c;C(g,Jt).push(...C(this,Jt).filter(v=>!C(g,Jt).includes(v)))}else c=this;c!==null&&ae(I=c,ke,zs).call(I)},cd=function(e,t,n){e.f^=1024;for(var o=e.first;o!==null;){var a=o.f,u=(a&96)!==0,c=u&&(a&1024)!==0,f=c||(a&8192)!==0||C(this,mn).has(o);if(!f&&o.fn!==null){u?o.f^=1024:(a&4)!==0?t.push(o):it&&(a&16777224)!==0?n.push(o):Jn(o)&&((a&16)!==0&&C(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}}},Dh=function(){for(var e=C(this,Ln);e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=C(e,Ln)}return null},Nh=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 u=this.async_deriveds.get(o);u&&a.promise.then(u.resolve).catch(u.reject)}e.async_deriveds.clear(),this.transfer_effects(C(e,Pn),C(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 u=f.f;if((u&2)!==0)t(f);else{var c=f;u&4194320&&!this.async_deriveds.has(c)&&(C(this,Or).delete(c),Ae(c,2048),this.schedule(c))}}};for(let o of this.current.keys())t(o);this.oncommit(()=>e.discard()),ae(n=e,ke,Ks).call(n),O=this,ae(this,ke,zs).call(this)},Yo=function(e){for(var t=0;t<e.length;t+=1)Wl(e[t],C(this,Pn),C(this,Or))},Wh=function(){var I;for(let g=$l;g!==null;g=C(g,On)){var e=g.id<this.id,t=[];for(let[v,[y,w]]of this.current){if(g.current.has(v)){var n=g.current.get(v)[0];if(e&&y!==n)g.current.set(v,[y,w]);else continue}t.push(v)}if(e)for(let[v,y]of this.async_deriveds){let w=g.async_deriveds.get(v);w&&y.promise.then(w.resolve).catch(w.reject)}var o=[...g.current.keys()].filter(v=>!g.current.get(v)[1]);if(!(!C(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&&!C(g,vi)&&nh(C(g,Jt).length===0,"Batch has scheduled roots"),e)for(let v of C(this,Oo))g.unskip_effect(v,y=>{var w;(y.f&4194320)!==0?g.schedule(y):ae(w=g,ke,Yo).call(w,[y])});g.activate();var u=new Set,c=new Map;for(var f of t)Zh(f,a,u,c);c=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 C(this,ea))(v.f&155648)===0&&dd(v,h,c)&&((v.f&4194320)!==0?(Ae(v,2048),g.schedule(v)):C(g,Pn).add(v));if(C(g,Jt).length>0&&!C(g,vi)){g.apply();for(var b of C(g,Jt))ae(I=g,ke,cd).call(I,b,[],[]);z(g,Jt,[])}g.deactivate()}}}},Ks=function(){if(this.linked){var e=C(this,Ln),t=C(this,On);e===null?$l=t:z(e,On,t),t===null?Mo=e:z(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(oh(),O===null)return t;O.flush()}}finally{Di=e}}function nw(){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{$p()}catch(n){R&&Rt(n,"stack",{value:""}),Qr(n,ld)}}var tr=null;function Bh(r){var e=r.length;if(e!==0){for(var t=0;t<e;){var n=r[t++];if((n.f&24576)===0&&Jn(n)&&(tr=new Set,Lr(n),n.deps===null&&n.first===null&&n.nodes===null&&n.teardown===null&&n.ac===null&&fd(n),(tr==null?void 0:tr.size)>0)){Hn.clear();for(let o of tr){if((o.f&24576)!==0)continue;let a=[o],u=o.parent;for(;u!==null;)tr.has(u)&&(tr.delete(u),a.push(u)),u=u.parent;for(let c=a.length-1;c>=0;c--){let f=a[c];(f.f&24576)===0&&Lr(f)}}tr.clear()}}tr=null}}function Zh(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?Zh(o,e,t,n):(a&4194320)!==0&&(a&2048)===0&&dd(o,e,n)&&(Ae(o,2048),ra(o))}}function dd(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&&dd(o,e,t))return t.set(o,!0),!0}return t.set(r,!1),!1}function ra(r){O.schedule(r)}function Mh(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;)Mh(t,e),t=t.next}}function Yh(r){Ae(r,1024);for(var e=r.first;e!==null;)Yh(e),e=e.next}var Xi=new Set,Hn=new Map;function Ll(r){Xi=r}var md=!1;function ph(){md=!0}function Vt(r,e){var t={f:0,v:r,reactions:null,equals:xl,rv:0,wv:0};return R&&Mr&&(t.created=e!=null?e:Yr("created at"),t.updated=null,t.set_during_effect=!1,t.trace=null),t}function un(r,e){let t=Vt(r,e);return od(t),t}function xe(r,e=!1,t=!0){var o,a;let n=Vt(r);return e||(n.equals=Al),rn&&t&&q!==null&&q.l!==null&&((a=(o=q.l).s)!=null?a:o.s=[]).push(n),n}function pd(r,e){return K(r,V(()=>A(r))),e}function K(r,e,t=!1){H!==null&&(!jt||(H.f&131072)!==0)&&on()&&(H.f&4325394)!==0&&(hr===null||!hr.has(r))&&qp();let n=t?Mn(e):e;return R&&Rl(n,r.label),Vr(r,n,qs)}function Vr(r,e,t=null){var o,a,u;if(!r.equals(e)){Hn.set(r,pr?e:r.v);var n=fr.ensure();if(n.capture(r,e),R){if(Mr||M!==null){(o=r.updated)!=null||(r.updated=new Map);let c=((u=(a=r.updated.get(""))==null?void 0:a.count)!=null?u:0)+1;if(r.updated.set("",{error:null,count:c}),Mr||c>5){let f=Yr("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++}}}M!==null&&(r.set_during_effect=!0)}if((r.f&2)!==0){let c=r;(r.f&2048)!==0&&Js(c),st===null&&Eo(c)}r.wv=Zo(),Uh(r,2048,t),on()&&M!==null&&(M.f&1024)!==0&&(M.f&96)===0&&(gr===null?Qh([r]):gr.push(r)),!n.is_fork&&Xi.size>0&&!md&&El()}return e}function El(){md=!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){K(r,r.v+1)}function Uh(r,e,t){var g;var n=r.reactions;if(n!==null)for(var o=on(),a=n.length,u=0;u<a;u++){var c=n[u],f=c.f;if(!(!o&&c===M)){var h=(f&2048)===0;if(h&&Ae(c,e),(f&131072)!==0)Xi.add(c);else if((f&2)!==0){var b=c;(g=st)==null||g.delete(b),(f&65536)===0&&(f&512&&(M===null||(M.f&2097152)===0)&&(c.f|=65536),Uh(b,4096,t))}else if(h){var I=c;(f&16)!==0&&tr!==null&&tr.add(I),t!==null?t.push(I):ra(I)}}}}var Vh=null;var Hl=!1,pr=!1;function hd(r){pr=r}var H=null,jt=!1;function mt(r){H=r}var M=null;function tt(r){M=r}var hr=null;function od(r){H!==null&&(!it||(H.f&2)!==0)&&(hr!=null?hr:hr=new Set).add(r)}var Ct=null,Ht=0,gr=null;function Qh(r){gr=r}var Lh=1,Li=0,pi=Li;function Vc(r){pi=r}function Zo(){return++Lh}function Jn(r){var e=r.f;if((e&2048)!==0)return!0;if(e&2&&(r.f&=-65537),(e&4096)!==0){for(var t=r.deps,n=t.length,o=0;o<n;o++){var a=t[o];if(Jn(a)&&nd(a),a.wv>r.wv)return!0}(e&512)!==0&&st===null&&Ae(r,1024)}return!1}function Oh(r,e,t=!0){var n=r.reactions;if(n!==null&&!(!it&&hr!==null&&hr.has(r)))for(var o=0;o<n.length;o++){var a=n[o];(a.f&2)!==0?Oh(a,e,!1):e===a&&(t?Ae(a,2048):(a.f&1024)!==0&&Ae(a,4096),ra(a))}}function Ol(r){var w,x,k;var e=Ct,t=Ht,n=gr,o=H,a=hr,u=q,c=jt,f=pi,h=r.f;Ct=null,Ht=0,gr=null,H=(h&96)===0?r:null,hr=null,Zn(r.ctx),jt=!1,pi=++Li,r.ac!==null&&(Tr(()=>{r.ac.abort(Nn)}),r.ac=null);try{r.f|=2097152;var b=r.fn,I=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<Ct.length;y++)g[Ht+y]=Ct[y];else r.deps=g=Ct;if(mi()&&(r.f&512)!==0)for(y=Ht;y<g.length;y++)((k=(x=g[y]).reactions)!=null?k:x.reactions=[]).push(r)}else!v&&g!==null&&Ht<g.length&&(Ui(r,Ht),g.length=Ht);if(on()&&gr!==null&&!jt&&g!==null&&(r.f&6146)===0)for(y=0;y<gr.length;y++)Oh(gr[y],r);if(o!==null&&o!==r){if(Li++,o.deps!==null)for(let B=0;B<t;B+=1)o.deps[B].rv=Li;if(e!==null)for(let B of e)B.rv=Li;gr!==null&&(n===null?n=gr:n.push(...gr))}return(r.f&8388608)!==0&&(r.f^=8388608),I}catch(B){return Nl(B)}finally{r.f^=2097152,Ct=e,Ht=t,gr=n,H=o,hr=a,Zn(u),jt=c,pi=f}}function ow(r,e){let t=e.reactions;if(t!==null){var n=Np.call(t,r);if(n!==-1){var o=t.length-1;o===0?t=e.reactions=null:(t[n]=t[o],t.pop())}}if(t===null&&(e.f&2)!==0&&(Ct===null||!fi.call(Ct,e))){var a=e;(a.f&512)!==0&&(a.f^=512,a.f&=-65537),a.v!==Be&&Eo(a),a.ac!==null&&Tr(()=>{a.ac.abort(Nn),a.ac=null,Ae(a,2048)}),Th(a),Ui(a,0)}}function Ui(r,e){var t=r.deps;if(t!==null)for(var n=e;n<t.length;n++)ow(r,t[n])}function Lr(r){var f;var e=r.f;if((e&16384)===0){Ae(r,1024);var t=M,n=Hl;if(M=r,Hl=(e&96)===0,R){var o=Xr;Fl(r.component_function);var a=nn;Ao((f=r.dev_stack)!=null?f:nn)}try{(e&16777232)!==0?Hh(r):js(r),gd(r);var u=Ol(r);if(r.teardown=typeof u=="function"?u:null,r.wv=Lh,R&&Mr&&(r.f&2048)!==0&&r.deps!==null)for(var c of r.deps)c.set_during_effect&&(c.wv=Zo(),c.set_during_effect=!1)}finally{Hl=n,M=t,R&&(Fl(o),Ao(a))}}}async function jn(){if(it)return new Promise(r=>{requestAnimationFrame(()=>r()),setTimeout(()=>r())});await Promise.resolve(),j()}function A(r){var v,y,w;var e=r.f,t=(e&2)!==0;if((v=Vh)==null||v.add(r),H!==null&&!jt){var n=M!==null&&(M.f&16384)!==0;if(!n&&(hr===null||!hr.has(r))){var o=H.deps;if((H.f&2097152)!==0)r.rv<Li&&(r.rv=Li,Ct===null&&o!==null&&o[Ht]===r?Ht++:Ct===null?Ct=[r]:Ct.push(r));else{(y=H.deps)!=null||(H.deps=[]),fi.call(H.deps,r)||H.deps.push(r);var a=r.reactions;a===null?r.reactions=[H]:fi.call(a,H)||a.push(H)}}}if(R){if(!jt&&ir&&O===null&&fn===null&&!ir.warned&&(ir.effect.f&2097152)===0&&!ir.effect_deps.has(r)){ir.warned=!0,sh(r.label);var u=Yr("traced at");u&&console.warn(u)}if(Hs.delete(r),Mr&&!jt&&Ms!==null&&H!==null&&Ms.reaction===H){if(r.trace)r.trace();else if(u=Yr("traced at"),u){var c=Ms.entries.get(r);c===void 0&&(c={traces:[]},Ms.entries.set(r,c));var f=c.traces[c.traces.length-1];u.stack!==(f==null?void 0:f.stack)&&c.traces.push(u)}}}if(pr&&Hn.has(r))return Hn.get(r);if(t){var h=r;if(pr){var b=h.v;return((h.f&1024)===0&&h.reactions!==null||Ph(h))&&(b=Js(h)),Hn.set(h,b),b}var I=(h.f&512)===0&&!jt&&H!==null&&(Hl||(H.f&512)!==0),g=(h.f&32768)===0;Jn(h)&&(I&&(h.f|=512),nd(h)),I&&!g&&(id(h),$h(h))}if((w=st)!=null&&w.has(r))return st.get(r);if((r.f&8388608)!==0)throw r.v;return r.v}function $h(r){var e;if(r.f|=512,r.deps!==null)for(let t of r.deps)((e=t.reactions)!=null?e:t.reactions=[]).push(r),(t.f&2)!==0&&(t.f&512)===0&&(id(t),$h(t))}function Ph(r){if(r.v===Be)return!0;if(r.deps===null)return!1;for(let e of r.deps)if(Hn.has(e)||(e.f&2)!==0&&Ph(e))return!0;return!1}function V(r){var e=jt;try{return jt=!0,r()}finally{jt=e}}function at(r){if(!(typeof r!="object"||!r||r instanceof EventTarget)){if(dt in r)Jl(r);else if(!Array.isArray(r))for(let e in r){let t=r[e];typeof t=="object"&&t&&dt in t&&Jl(t)}}}function Jl(r,e=new Set){if(typeof r=="object"&&r!==null&&!(r instanceof EventTarget)&&!e.has(r)){e.add(r),r instanceof Date&&r.getTime();for(let n in r)try{Jl(r[n],e)}catch(o){}let t=Gi(r);if(t!==Object.prototype&&t!==Array.prototype&&t!==Map.prototype&&t!==Set.prototype&&t!==Date.prototype){let n=wl(t);for(let o in n){let a=n[o].get;if(a)try{a.call(r)}catch(u){}}}}}function bd(r){M===null&&(H===null&&Op(r),Lp()),pr&&Vp(r)}function sw(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function $r(r,e){var u,c;var t=M;if(R)for(;t!==null&&(t.f&131072)!==0;)t=t.parent;t!==null&&(t.f&8192)!==0&&(r|=8192);var n={ctx:q,deps:null,nodes:null,f:r|2048|512,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};R&&(n.component_function=Xr),(u=O)==null||u.register_created_effect(n);var o=n;if((r&4)!==0)Qi!==null?Qi.push(n):fr.ensure().schedule(n);else if(e!==null){try{Lr(n)}catch(f){throw Oe(n),f}o.deps===null&&o.teardown===null&&o.nodes===null&&o.first===o.last&&(o.f&524288)===0&&(o=o.first,(r&16)!==0&&(r&65536)!==0&&o!==null&&(o.f|=65536))}if(o!==null&&(o.parent=t,t!==null&&sw(o,t),H!==null&&(H.f&2)!==0&&(r&64)===0)){var a=H;((c=a.effects)!=null?c:a.effects=[]).push(o)}return n}function mi(){return H!==null&&!jt}function pt(r){let e=$r(8,null);return Ae(e,1024),e.teardown=r,e}function Po(r){var o;bd("$effect"),R&&Rt(r,"name",{value:"$effect"});var e=M.f,t=!H&&(e&32)!==0&&q!==null&&!q.i;if(t){var n=q;((o=n.e)!=null?o:n.e=[]).push(r)}else return Qc(r)}function Qc(r){return $r(1048580,r)}function na(r){return bd("$effect.pre"),R&&Rt(r,"name",{value:"$effect.pre"}),$r(1048584,r)}function vd(r){fr.ensure();let e=$r(524352,r);return()=>{Oe(e)}}function zh(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=q,n={effect:null,ran:!1,deps:r};t.l.$.push(n),n.effect=gt(()=>{if(r(),!n.ran){n.ran=!0;var o=M;try{tt(o.parent),V(e)}finally{tt(o)}}})}function ia(){var r=q;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 Eh(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(A))})})}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 gd(r){var e=r.teardown;if(e!==null){let t=pr,n=H;hd(!0),mt(null);try{e.call(null)}finally{hd(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 Hh(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&&(Kh(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();gd(r),r.f^=33554432,r.f|=16384;var o=r.parent;o!==null&&o.first!==null&&fd(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 Kh(r,e){for(;r!==null;){var t=r===e?null:Gt(r);r.remove(),r=t}}function fd(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=[];qh(r,n,!0);var o=()=>{t&&Oe(r),e&&e()},a=n.length;if(a>0){var u=()=>--a||o();for(var c of n)c.out(u)}else o()}function qh(r,e,t){if((r.f&8192)===0){r.f^=8192;var n=r.nodes&&r.nodes.t;if(n!==null)for(let c of n)(c.is_global||t)&&e.push(c);for(var o=r.first;o!==null;){var a=o.next;if((o.f&64)===0){var u=(o.f&65536)!==0||(o.f&32)!==0&&(r.f&16)!==0;qh(o,e,u?t:!1)}o=a}}}function Ho(r){eg(r,!0)}function eg(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;eg(t,o?e:!1),t=n}var a=r.nodes&&r.nodes.t;if(a!==null)for(let u of a)(u.is_global||e)&&u.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"),rg=new Set,yd=new Set;function ng(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},u=ng(r,e,t,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&pt(()=>{e.removeEventListener(r,u,a)})}var tg=null;function zl(r){var w,x;var e=this,t=e.ownerDocument,n=r.type,o=((w=r.composedPath)==null?void 0:w.call(r))||[],a=o[0]||r.target;tg=r;var u=0,c=tg===r&&r[jl];if(c){var f=o.indexOf(c);if(f!==-1&&(e===document||e===window)){r[jl]=e;return}var h=o.indexOf(e);if(h===-1)return;f<=h&&(u=f)}if(a=o[u]||r.target,a!==e){Rt(r,"currentTarget",{configurable:!0,get(){return a||t}});var b=H,I=M;mt(null),tt(null);try{for(var g,v=[];a!==null&&a!==e;){try{var y=(x=a[jl])==null?void 0:x[n];y!=null&&(!a.disabled||r.target===a)&&y.call(a,r)}catch(k){g?v.push(k):g=k}if(r.cancelBubble)break;u++,a=u<o.length?o[u]:null}if(g){for(let k of v)queueMicrotask(()=>{throw k});throw g}}finally{r[jl]=e,delete r.currentTarget,mt(b),tt(I)}}}var ig,_d=((ig=globalThis==null?void 0:globalThis.window)==null?void 0:ig.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:r=>r});function og(r){var e;return(e=_d==null?void 0:_d.createHTML(r))!=null?e:r}function Id(r){var e=Yn("template");return e.innerHTML=og(r.replaceAll("<!>","<!---->")),e.content}function zn(r,e){var t=M;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=Id(a?r:"<!>"+r),t||(o=Xt(o)));var u=n||Qs?document.importNode(o,!0):o.cloneNode(!0);if(t){var c=Xt(u),f=u.lastChild;zn(c,f)}else zn(u,u);return u}}function de(r,e){if(L){var t=M;((t.f&32768)===0||t.nodes.end===null)&&(t.nodes.end=ne),Et();return}r!==null&&r.before(e)}var fw=["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 m1=[...fw,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var mw=["touchstart","touchmove"];function sg(r){return mw.includes(r)}var pw=["$state","$state.raw","$derived","$derived.by"],p1=[...pw,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];var Cd=!0;function Pe(r,e){var n,o;var t=e==null?"":typeof e=="object"?`${e}`:e;t!==((o=r[n=Zs])!=null?o:r[n]=r.nodeValue)&&(r[Zs]=t,r.nodeValue=`${t}`)}function ql(r,e){return ag(r,e)}function Ad(r,e){var u;Gl(),e.intro=(u=e.intro)!=null?u:!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 c=ag(r,{...e,anchor:a});return ft(!1),c}catch(c){if(c instanceof Error&&c.message.split(`
|
|
`).some(f=>f.startsWith("https://svelte.dev/e/")))throw c;return c!==Wn&&console.warn("Failed to hydrate: ",c),e.recover===!1&&Pp(),Gl(),Vs(t),ft(!1),ql(r,e)}finally{ft(n),Fe(o)}}var Kl=new Map;function ag(r,{target:e,anchor:t,props:n={},events:o,context:a,intro:u=!0,transformError:c}){Gl();var f=void 0,h=zh(()=>{var b=t!=null?t:e.appendChild(wt());Kc(b,{pending:()=>{}},v=>{Ke({});var y=q;if(a&&(y.c=a),o&&(n.$$events=o),L&&zn(v,null),Cd=u,f=r(v,n)||{},Cd=!0,L&&(M.nodes.end=ne,ne===null||ne.nodeType!==Ar||ne.data!=="]"))throw Ni(),Wn;qe()},c);var I=new Set,g=v=>{for(var y=0;y<v.length;y++){var w=v[y];if(!I.has(w)){I.add(w);var x=sg(w);for(let F of[e,document]){var k=Kl.get(F);k===void 0&&(k=new Map,Kl.set(F,k));var B=k.get(w);B===void 0?(F.addEventListener(w,zl,{passive:x}),k.set(w,1)):k.set(w,B+1)}}}};return g(wo(rg)),yd.add(g),()=>{var x;for(var v of I)for(let k of[e,document]){var y=Kl.get(k),w=y.get(v);--w==0?(k.removeEventListener(v,zl),y.delete(v),y.size===0&&Kl.delete(k)):y.set(v,w)}yd.delete(g),b!==t&&((x=b.parentNode)==null||x.removeChild(b))}});return xd.set(f,h),f}var xd=new WeakMap;function kd(r,e){let t=xd.get(r);return t?(xd.delete(r),t(e)):(R&&(dt in r?fh():ch()),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 Sd(r)}var Kn,Br,Sd=class{constructor(e){ee(this,Kn);ee(this,Br);var a,u;var t=new Map,n=(c,f)=>{var h=xe(f,!1,!1);return t.set(c,h),h};let o=new Proxy({...e.props||{},$$events:{}},{get(c,f){var h;return A((h=t.get(f))!=null?h:n(f,Reflect.get(c,f)))},has(c,f){var h;return f===Ns?!0:(A((h=t.get(f))!=null?h:n(f,Reflect.get(c,f))),Reflect.has(c,f))},set(c,f,h){var b;return K((b=t.get(f))!=null?b:n(f,h),h),Reflect.set(c,f,h)}});z(this,Br,(e.hydrate?Ad: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&&(!((u=e==null?void 0:e.props)!=null&&u.$$host)||e.sync===!1)&&j(),z(this,Kn,o.$$events);for(let c of Object.keys(C(this,Br)))c==="$set"||c==="$destroy"||c==="$on"||Rt(this,c,{get(){return C(this,Br)[c]},set(f){C(this,Br)[c]=f},enumerable:!0});C(this,Br).$set=c=>{Object.assign(o,c)},C(this,Br).$destroy=()=>{kd(C(this,Br))}}$set(e){C(this,Br).$set(e)}$on(e,t){C(this,Kn)[e]=C(this,Kn)[e]||[];let n=(...o)=>t.call(this,...o);return C(this,Kn)[e].push(n),()=>{C(this,Kn)[e]=C(this,Kn)[e].filter(o=>o!==n)}}$destroy(){C(this,Br).$destroy()}};Kn=new WeakMap,Br=new WeakMap;var lg,ug,cg;typeof window!="undefined"&&((cg=(ug=(lg=window.__svelte)!=null?lg:window.__svelte={}).v)!=null?cg:ug.v=new Set).add("5");th();var Pr,pn,vr,Oi,oa,sa,ru,qn=class{constructor(e,t=!0){m(this,"anchor");ee(this,Pr,new Map);ee(this,pn,new Map);ee(this,vr,new Map);ee(this,Oi,new Set);ee(this,oa,!0);ee(this,sa,e=>{if(C(this,Pr).has(e)){var t=C(this,Pr).get(e),n=C(this,pn).get(t);if(n)Ho(n),C(this,Oi).delete(t);else{var o=C(this,vr).get(t);o&&(Ho(o.effect),C(this,pn).set(t,o.effect),C(this,vr).delete(t),R&&(o.fragment.lastChild[Dc]=this.anchor),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),n=o.effect)}for(let[a,u]of C(this,Pr)){if(C(this,Pr).delete(a),a===e)break;let c=C(this,vr).get(u);c&&(Oe(c.effect),C(this,vr).delete(u))}for(let[a,u]of C(this,pn)){if(a===t||C(this,Oi).has(a))continue;let c=()=>{if(Array.from(C(this,Pr).values()).includes(a)){var h=document.createDocumentFragment();Do(u,h),h.append(wt()),C(this,vr).set(a,{effect:u,fragment:h})}else Oe(u);C(this,Oi).delete(a),C(this,pn).delete(a)};C(this,oa)||!n?(C(this,Oi).add(a),dn(u,c,!1)):c()}}});ee(this,ru,e=>{C(this,Pr).delete(e);let t=Array.from(C(this,Pr).values());for(let[n,o]of C(this,vr))t.includes(n)||(Oe(o.effect),C(this,vr).delete(n))});this.anchor=e,z(this,oa,t)}ensure(e,t){var n=O,o=Bl();if(t&&!C(this,pn).has(e)&&!C(this,vr).has(e))if(o){var a=document.createDocumentFragment(),u=wt();a.append(u),C(this,vr).set(e,{effect:bt(()=>t(u)),fragment:a})}else C(this,pn).set(e,bt(()=>t(this.anchor)));if(C(this,Pr).set(n,e),o){for(let[c,f]of C(this,pn))c===e?n.unskip_effect(f):n.skip_effect(f);for(let[c,f]of C(this,vr))c===e?n.unskip_effect(f.effect):n.skip_effect(f.effect);n.oncommit(C(this,sa)),n.ondiscard(C(this,ru))}else L&&(this.anchor=ne),C(this,sa).call(this,n)}};Pr=new WeakMap,pn=new WeakMap,vr=new WeakMap,Oi=new WeakMap,oa=new WeakMap,sa=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;jp(e)},set:n=>{t=n}})}};r("$state"),r("$effect"),r("$derived"),r("$inspect"),r("$props"),r("$bindable")}function Jo(r){q===null&&xo("onMount"),rn&&q.l!==null?mg(q).m.push(r):Po(()=>{let e=V(r);if(typeof e=="function")return e})}function ww(r,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(r,{detail:e,bubbles:t,cancelable:n})}function jo(){let r=q;return r===null&&xo("createEventDispatcher"),(e,t,n)=>{var a;let o=(a=r.s.$$events)==null?void 0:a[e];if(o){let u=kr(o)?o.slice():[o],c=ww(e,t,n);for(let f of u)f.call(r.x,c);return!c.defaultPrevented}return!0}}function fg(r){q===null&&xo("afterUpdate"),q.l===null&&Hp("afterUpdate"),mg(q).a.push(r)}function mg(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 u(c,f){if(L){var h=Xs(n);if(c!==parseInt(h.substring(1))){var b=ln();Fe(b),o.anchor=b,ft(!1),o.ensure(c,f),ft(!0);return}}o.ensure(c,f)}mr(()=>{var c=!1;e((f,h=0)=>{c=!0,u(h,f)}),c||u(-1,null)},a)}function Fd(r,e){return e}function Tw(r,e,t){var I;for(var n=[],o=e.length,a,u=e.length,c=0;c<o;c++){let g=e[c];dn(g,()=>{if(a){if(a.pending.delete(g),a.done.add(g),a.pending.size===0){var v=r.outrogroups;Rd(r,wo(a.done)),v.delete(a),v.size===0&&(r.outrogroups=null)}}else u-=1},!1)}if(u===0){var f=n.length===0&&t!==null;if(f){var h=t,b=h.parentNode;Vs(b),b.append(h),r.items.clear()}Rd(r,e,!f)}else a={pending:new Set(e),done:new Set},((I=r.outrogroups)!=null?I:r.outrogroups=new Set).add(a)}function Rd(r,e,t=!0){var n;if(r.pending.size>0){n=new Set;for(let u of r.pending.values())for(let c of u)n.add(r.items.get(c).e)}for(var o=0;o<e.length;o++){var a=e[o];if(n!=null&&n.has(a)){a.f|=33554432;let u=document.createDocumentFragment();Do(a,u)}else Oe(e[o],t)}}var zo;function zt(r,e,t,n,o,a=null){var u=r,c=new Map,f=(e&4)!==0;if(f){var h=r;u=L?Fe(Xt(h)):h.appendChild(wt())}L&&Et();var b=null,I=Vn(()=>{var F=t();return kr(F)?F:F==null?[]:wo(F)});R&&Yt(I,"{#each ...}");var g,v=new Map,y=!0;function w(F){(B.effect.f&16384)===0&&(B.pending.delete(F),B.fallback=b,Ew(B,g,u,e,n),b!==null&&(g.length===0?(b.f&33554432)===0?Ho(b):(b.f^=33554432,la(b,null,u)):dn(b,()=>{b=null})))}function x(F){B.pending.delete(F)}var k=mr(()=>{g=A(I);var F=g.length;let P=!1;if(L){var ie=Xs(u)==="[!";ie!==(F===0)&&(u=ln(),Fe(u),ft(!1),P=!0)}for(var Y=new Set,pe=O,_e=Bl(),Ge=0;Ge<F;Ge+=1){L&&ne.nodeType===Ar&&ne.data==="]"&&(u=ne,P=!0,ft(!1));var He=g[Ge],he=n(He,Ge);if(R){var Lt=n(He,Ge);he!==Lt&&Qp(String(Ge),String(he),String(Lt))}var Ze=y?null:c.get(he);Ze?(Ze.v&&Vr(Ze.v,He),Ze.i&&Vr(Ze.i,Ge),_e&&pe.unskip_effect(Ze.e)):(Ze=Gw(c,y?u:zo!=null?zo:zo=wt(),He,he,Ge,o,e,t),y||(Ze.e.f|=33554432),c.set(he,Ze)),Y.add(he)}if(F===0&&a&&!b&&(y?b=bt(()=>a(u)):(b=bt(()=>a(zo!=null?zo:zo=wt())),b.f|=33554432)),F>Y.size&&(R?Bw(g,n):Uc("","","")),L&&F>0&&Fe(ln()),!y)if(v.set(pe,Y),_e){for(let[rt,At]of c)Y.has(rt)||pe.skip_effect(At.e);pe.oncommit(w),pe.ondiscard(x)}else w(pe);P&&ft(!0),A(I)}),B={effect:k,flags:e,items:c,pending:v,outrogroups:null,fallback:b};y=!1,L&&(u=ne)}function aa(r){for(;r!==null&&(r.f&32)===0;)r=r.next;return r}function Ew(r,e,t,n,o){var He,he,Lt,Ze,rt,At,Kt,Q,oe;var a=(n&8)!==0,u=e.length,c=r.items,f=aa(r.effect.first),h,b=null,I,g=[],v=[],y,w,x,k;if(a)for(k=0;k<u;k+=1)y=e[k],w=o(y,k),x=c.get(w).e,(x.f&33554432)===0&&((he=(He=x.nodes)==null?void 0:He.a)==null||he.measure(),(I!=null?I:I=new Set).add(x));for(k=0;k<u;k+=1){if(y=e[k],w=o(y,k),x=c.get(w).e,r.outrogroups!==null)for(let N of r.outrogroups)N.pending.delete(x),N.done.delete(x);if((x.f&8192)!==0&&(Ho(x),a&&((Ze=(Lt=x.nodes)==null?void 0:Lt.a)==null||Ze.unfix(),(I!=null?I:I=new Set).delete(x))),(x.f&33554432)!==0)if(x.f^=33554432,x===f)la(x,null,t);else{var B=b?b.next:f;x===r.effect.last&&(r.effect.last=x.prev),x.prev&&(x.prev.next=x.next),x.next&&(x.next.prev=x.prev),_i(r,b,x),_i(r,x,B),la(x,B,t),b=x,g=[],v=[],f=aa(b.next);continue}if(x!==f){if(h!==void 0&&h.has(x)){if(g.length<v.length){var F=v[0],P;b=F.prev;var ie=g[0],Y=g[g.length-1];for(P=0;P<g.length;P+=1)la(g[P],F,t);for(P=0;P<v.length;P+=1)h.delete(v[P]);_i(r,ie.prev,Y.next),_i(r,b,ie),_i(r,Y,F),f=F,b=Y,k-=1,g=[],v=[]}else h.delete(x),la(x,f,t),_i(r,x.prev,x.next),_i(r,x,b===null?r.effect.first:b.next),_i(r,b,x),b=x;continue}for(g=[],v=[];f!==null&&f!==x;)(h!=null?h:h=new Set).add(f),v.push(f),f=aa(f.next);if(f===null)continue}(x.f&33554432)===0&&g.push(x),b=x,f=aa(x.next)}if(r.outrogroups!==null){for(let N of r.outrogroups)N.pending.size===0&&(Rd(r,wo(N.done)),(rt=r.outrogroups)==null||rt.delete(N));r.outrogroups.size===0&&(r.outrogroups=null)}if(f!==null||h!==void 0){var pe=[];if(h!==void 0)for(x of h)(x.f&8192)===0&&pe.push(x);for(;f!==null;)(f.f&8192)===0&&f!==r.fallback&&pe.push(f),f=aa(f.next);var _e=pe.length;if(_e>0){var Ge=(n&4)!==0&&u===0?t:null;if(a){for(k=0;k<_e;k+=1)(Kt=(At=pe[k].nodes)==null?void 0:At.a)==null||Kt.measure();for(k=0;k<_e;k+=1)(oe=(Q=pe[k].nodes)==null?void 0:Q.a)==null||oe.fix()}Tw(r,pe,Ge)}}a&&et(()=>{var N,le;if(I!==void 0)for(x of I)(le=(N=x.nodes)==null?void 0:N.a)==null||le.apply()})}function Gw(r,e,t,n,o,a,u,c){var f=(u&1)!==0?(u&16)===0?xe(t,!1,!1):Vt(t):null,h=(u&2)!==0?Vt(o):null;return R&&f&&(f.trace=()=>{var b;c()[(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,c),()=>{r.delete(n)}))}}function la(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 u=Gt(n);if(a.before(n),n===o)return;n=u}}function _i(r,e,t){e===null?r.effect.first=t:e.next=t,t===null?r.effect.last=e:t.prev=e}function Bw(r,e){let t=new Map,n=r.length;for(let o=0;o<n;o++){let a=e(r[o],o);if(t.has(a)){let u=String(t.get(a)),c=String(o),f=String(a);f.startsWith("[object ")&&(f=null),Uc(u,c,f)}t.set(a,o)}}function Td(r,e,t,n,o){var c;L&&Et();var a=(c=e.$$slots)==null?void 0:c[t],u=!1;a===!0&&(a=e[t==="default"?"children":t],u=!0),a===void 0?o!==null&&o(r):a(r,u?()=>n:n)}var gg=[...`
|
|
\r\f\xA0\v\uFEFF`];function bg(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,u=0;(u=n.indexOf(o,u))>=0;){var c=u+a;(u===0||gg.includes(n[u-1]))&&(c===n.length||gg.includes(n[c]))?n=(u===0?"":n.substring(0,u))+n.substring(c+1):u=c}}return n===""?null:n}function bn(r,e,t,n,o,a){var u=r[Ws];if(L||u!==t||u===void 0){var c=bg(t,n,a);(!L||c!==r.getAttribute("class"))&&(c==null?r.removeAttribute("class"):e?r.className=c:r.setAttribute("class",c)),r[Ws]=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 dh();for(var n of r.options)n.selected=e.includes(ua(n));return}for(n of r.options){var o=ua(n);if(Lc(o,e)){n.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function Ed(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 ca(r,e,t=e){var n=new WeakSet,o=!0;Yl(r,"change",a=>{var h;var u=a?"[selected]":":checked",c;if(r.multiple)c=[].map.call(r.querySelectorAll(u),ua);else{var f=(h=r.querySelector(u))!=null?h:r.querySelector("option:not([disabled])");c=f&&ua(f)}t(c),r.__value=c,O!==null&&n.add(O)}),br(()=>{var a=e();if(r===document.activeElement){var u=it?fn:O;if(n.has(u))return}if(nu(r,a,o),o&&a===void 0){var c=r.querySelector(":checked");c!==null&&(a=ua(c),t(a))}r.__value=a,o=!1}),Ed(r)}function ua(r){return"__value"in r?r.__value:r.value}var Qw=Symbol("is custom element"),Vw=Symbol("is html"),Lw=Nc?"link":"LINK";function Bd(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),Ml()}}function Dd(r,e){e?r.hasAttribute("selected")||r.setAttribute("selected",""):r.removeAttribute("selected")}function Hr(r,e,t,n){var o=Ow(r);if(L&&(o[e]=r.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&r.nodeName===Lw)){n||Pw(r,e,t!=null?t:"");return}o[e]!==(o[e]=t)&&(e==="loading"&&(r[Ep]=t),t==null?r.removeAttribute(e):typeof t!="string"&&$w(r).includes(e)?r[e]=t:r.setAttribute(e,t))}function Ow(r){var e,t;return(t=r[e=Il])!=null?t:r[e]={[Qw]:r.nodeName.includes("-"),[Vw]:r.namespaceURI===kl}}var vg=new Map;function $w(r){var e=r.getAttribute("is")||r.nodeName,t=vg.get(e);if(t)return t;vg.set(e,t=[]);for(var n,o=r,a=Element.prototype;a!==o;){n=wl(o);for(var u in n)n[u].set&&u!=="innerHTML"&&u!=="textContent"&&u!=="innerText"&&t.push(u);o=Gi(o)}return t}function Pw(r,e,t){var n;R&&(e==="srcset"&&Hw(r,t)||Gd((n=r.getAttribute(e))!=null?n:"",t)||uh(e,r.outerHTML.replace(r.innerHTML,r.innerHTML&&"..."),String(t)))}function Gd(r,e){return r===e?!0:new URL(r,document.baseURI).href===new URL(e,document.baseURI).href}function yg(r){return r.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function Hw(r,e){var t=yg(r.srcset),n=yg(e);return n.length===t.length&&n.every(([o,a],u)=>a===t[u][1]&&(Gd(t[u][0],o)||Gd(o,t[u][0])))}function Zd(r,e,t=e){var n=new WeakSet;Yl(r,"input",async o=>{R&&r.type==="checkbox"&&Xc();var a=o?r.defaultValue:r.value;if(a=Nd(r)?Wd(a):a,t(a),O!==null&&n.add(O),await jn(),a!==(a=e())){var u=r.selectionStart,c=r.selectionEnd,f=r.value.length;if(r.value=a!=null?a:"",c!==null){var h=r.value.length;u===c&&c===f&&h>f?(r.selectionStart=h,r.selectionEnd=h):(r.selectionStart=u,r.selectionEnd=Math.min(c,h))}}}),(L&&r.defaultValue!==r.value||V(e)==null&&r.value)&&(t(Nd(r)?Wd(r.value):r.value),O!==null&&n.add(O)),gt(()=>{R&&r.type==="checkbox"&&Xc();var o=e();if(r===document.activeElement){var a=it?fn:O;if(n.has(a))return}Nd(r)&&o===Wd(r.value)||r.type==="date"&&!o&&!r.value||o!==r.value&&(r.value=o!=null?o:"")})}function Nd(r){var e=r.type;return e==="number"||e==="range"}function Wd(r){return r===""?null:+r}function Md(r,e,t){var n=$t(r,e);n&&n.set&&(r[e]=t,pt(()=>{r[e]=null}))}function Yd(r,e){return r===e||(r==null?void 0:r[dt])===e}function xt(r={},e,t,n){var o=q.r,a=M;return br(()=>{var u,c;return gt(()=>{u=c,c=(n==null?void 0:n())||[],V(()=>{Yd(t(...c),r)||(e(r,...c),u&&Yd(t(...u),r)&&e(null,...u))})}),()=>{let f=a;for(;f!==o&&f.parent!==null&&f.parent.f&33554432;)f=f.parent;let h=()=>{c&&Yd(t(...c),r)&&e(null,...c)},b=f.teardown;f.teardown=()=>{h(),b==null||b()}}}),r}function Bt(r=!1){let e=q,t=e.l.u;if(!t)return;let n=()=>at(e.s);if(r){let o=0,a={},u=bi(()=>{let c=!1,f=e.s;for(let h in f)f[h]!==a[h]&&(a[h]=f[h],c=!0);return c&&o++,o});n=()=>A(u)}t.b.length&&na(()=>{Ig(e,n),Co(t.b)}),Po(()=>{let o=V(()=>t.m.map(Zp));return()=>{for(let a of o)typeof a=="function"&&a()}}),t.a.length&&Po(()=>{Ig(e,n),Co(t.a)})}function Ig(r,e){if(r.l.s)for(let t of r.l.s)A(t);e()}function Xd(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 P,ie;var o=!rn||(t&2)!==0,a=(t&8)!==0,u=(t&16)!==0,c=n,f=!0,h=void 0,b=()=>u&&o?(h!=null||(h=bi(n)),A(h)):(f&&(f=!1,c=u?V(n):n),c);let I;if(a){var g=dt in r||Ns in r;I=(ie=(P=$t(r,e))==null?void 0:P.set)!=null?ie:g&&e in r?Y=>r[e]=Y:void 0}var v,y=!1;a?[v,y]=$c(()=>r[e]):v=r[e],v===void 0&&n!==void 0&&(v=b(),I&&(o&&Jp(e),I(v)));var w;if(o?w=()=>{var Y=r[e];return Y===void 0?b():(f=!0,Y)}:w=()=>{var Y=r[e];return Y!==void 0&&(c=void 0),Y===void 0?c:Y},o&&(t&4)===0)return w;if(I){var x=r.$$legacy;return(function(Y,pe){return arguments.length>0?((!o||!pe||x||y)&&I(pe?w():Y),Y):w()})}var k=!1,B=((t&1)!==0?bi:Vn)(()=>(k=!1,w()));R&&(B.label=e),a&&A(B);var F=M;return(function(Y,pe){if(arguments.length>0){let _e=pe?A(B):o&&a?Mn(Y):Y;return K(B,_e),k=!0,c!==void 0&&(c=_e),Y}return pr&&k||(F.f&16384)!==0?B.v:A(B)})}var tC;typeof HTMLElement=="function"&&(tC=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 u=Yn("slot");o!=="default"&&(u.name=o),de(a,u)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},n=rC(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]=Ud(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=vd(()=>{gt(()=>{var o;this.$$r=!0;for(let a of Wc(this.$$c)){if(!((o=this.$$p_d[a])!=null&&o.reflect))continue;this.$$d[a]=this.$$c[a];let u=Ud(a,this.$$d[a],this.$$p_d,"toAttribute");u==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,u)}this.$$r=!1})});for(let o in this.$$l)for(let a of this.$$l[o]){let u=this.$$c.$on(o,a);this.$$l_u.set(a,u)}this.$$l={}}}attributeChangedCallback(e,t,n){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ud(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 Wc(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Ud(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 rC(r){let e={};return r.childNodes.forEach(t=>{e[t.slot||"default"]=!0}),e}var wg=require("obsidian");var nC=ve('<span><span class="reminder-markdown"></span></span>');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();fg(()=>{A(o).empty(),wg.MarkdownRenderer.renderMarkdown(n(),A(o),t(),window.app.plugins.plugins["obsidian-reminder-plugin"]),A(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 u=nC(),c=J(u);return xt(c,f=>K(o,f),()=>A(o)),X(u),de(r,u),qe(a)}var iC=ve('<div class="reminder-list-item no-reminders svelte-18c89ir">No reminders</div>'),oC=ve('<button class="reminder-list-item hover-highlight svelte-18c89ir" draggable="true"><span class="reminder-time svelte-18c89ir"> </span> <div class="reminder-title-container svelte-18c89ir"><span class="reminder-title svelte-18c89ir"><!></span> <span class="reminder-file svelte-18c89ir"> </span></div></button>'),sC=ve("<div></div>"),aC=ve('<div class="reminder-group svelte-18c89ir"><!></div>');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 u(g){return`[${g.time.toString()}] ${g.title} - ${g.getFileName()}`}var c={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=aC(),h=J(f);{var b=g=>{var v=iC();de(g,v)},I=g=>{var v=sC();zt(v,5,t,y=>y.key(),(y,w)=>{var x=oC(),k=J(x),B=J(k,!0);X(k);var F=we(k,2),P=J(F),ie=J(P);Ko(ie,{get markdown(){return A(w),V(()=>A(w).title)},get sourcePath(){return A(w),V(()=>A(w).file)}}),X(P);var Y=we(P,2),pe=J(Y,!0);X(Y),X(F),X(x),$e((_e,Ge,He,he)=>{Hr(x,"aria-label",_e),Hr(x,"title",Ge),Pe(B,He),Pe(pe,he)},[()=>(A(w),V(()=>u(A(w)))),()=>(A(w),V(()=>u(A(w)))),()=>(at(o()),A(w),V(()=>o()(A(w).time))),()=>(A(w),V(()=>A(w).getFileName()))]),ce("dragstart",x,_e=>{var Ge;(Ge=_e.dataTransfer)==null||Ge.setData("text/plain",a()(A(w)))}),ce("click",x,()=>{n()(A(w))}),de(y,x)}),X(v),de(g,v)};hn(h,g=>{at(t()),V(()=>t().length===0)?g(b):g(I,-1)})}return X(f),de(r,f),qe(c)}var lC=ve('<span class="group-count svelte-6tg2e0"> </span>'),uC=ve("<div> <!></div> <!>",1),cC=ve("<main><div></div></main>");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)},u=cC(),c=J(u);return zt(c,5,t,f=>f.name,(f,h)=>{var b=uC(),I=To(b);let g;var v=J(I),y=we(v);{var w=k=>{var B=lC(),F=J(B,!0);X(B),$e(()=>Pe(F,(A(h),V(()=>A(h).reminders.length)))),de(k,B)};hn(y,k=>{A(h),V(()=>A(h).reminders.length>0)&&k(w)})}X(I);var x=we(I,2);qo(x,{get reminders(){return A(h),V(()=>A(h).reminders)},get onOpenReminder(){return n()},timeToString:k=>A(h).timeToString(k),get generateLink(){return o()}}),$e(()=>{var k;g=bn(I,1,"group-name svelte-6tg2e0",null,g,{"group-name-overdue":A(h).isOverdue}),Pe(v,`${(k=(A(h),V(()=>A(h).name)))!=null?k:""} `)}),de(f,b)}),X(c),X(u),de(r,u),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 xm(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 kg=require("obsidian");var Ag=Wr(wr(),1);var Cg=Wr(wr()),Od=require("obsidian");var ts=Wr(wr());var Qd=Wr(wr(),1);var Vd=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())}},Ld=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 Vd(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 Ld(n.clone())),n.add(1,"week")}isThisMonth(e){return this.monthStart.month()===e.month()&&this.monthStart.year()===e.year()}},da=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,Qd.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,Qd.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 u;a.date&&this._current.isThisMonth(a.date)?u=a.date.format("DD"):u=" ",o=o+u+" "}),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 dC=ve('<th class="svelte-1lru178"> </th>'),fC=ve('<td><button tabindex="-1"> </button></td>'),mC=ve("<tr></tr>"),pC=ve('<div class="reminder-calendar svelte-1lru178" tabindex="0" role="grid"><div class="year-month svelte-1lru178"><button tabindex="-1" class="month-nav svelte-1lru178"><</button> <span class="month svelte-1lru178"> </span> <span class="year svelte-1lru178"> </span> <button tabindex="-1" class="month-nav svelte-1lru178">></button></div> <table><thead><tr></tr></thead><tbody></tbody></table> <div class="footer"><!></div></div>');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),u=jo(),c=xe(),f=xe(),h=xe();function b(){A(h).focus()}function I(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(){u("select",o())}let x=new es;function k(Q){if(Q.key>="0"&&Q.key<="9"){Q.preventDefault();let oe=x.handle(Q.key);switch(oe.length){case 1:{let N=parseInt(oe);N>0&&o(o().set("date",N));break}case 2:oe.startsWith("0")&&(oe=oe.slice(1)),o(o().set("date",parseInt(oe)));break;case 4:{let N=oe.slice(0,2),le=oe.slice(2,4);N.startsWith("0")&&(N=N.slice(1)),le.startsWith("0")&&(le=le.slice(1)),o(o().set("month",parseInt(N)-1)),o(o().set("date",parseInt(le)))}break}return}x.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(()=>{pd(f,A(f).style.width=A(c).clientWidth+"px")}),yi(()=>(da,ts.default,at(o()),at(a())),()=>{K(t,new da((0,ts.default)().startOf("day"),o().startOf("day"),a()))}),yi(()=>(ts.default,A(t)),()=>{K(n,Array.from({length:7},(Q,oe)=>(0,ts.default)().day((A(t).weekStart+oe)%7).format("ddd")))}),ia();var B={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,oe)=>vt(e,Q,oe)};Bt();var F=pC(),P=J(F),ie=J(P),Y=we(ie,2),pe=J(Y,!0);X(Y);var _e=we(Y,2),Ge=J(_e,!0);X(_e);var He=we(_e,2);X(P);var he=we(P,2),Lt=J(he),Ze=J(Lt);zt(Ze,5,()=>A(n),Q=>Q,(Q,oe)=>{var N=dC(),le=J(N,!0);X(N),$e(()=>Pe(le,A(oe))),de(Q,N)}),X(Ze),X(Lt);var rt=we(Lt);zt(rt,5,()=>(A(t),V(()=>A(t).current.weeks)),Q=>Q.key,(Q,oe)=>{var N=mC();zt(N,5,()=>(A(oe),V(()=>A(oe).days)),le=>le.date.valueOf(),(le,De)=>{var E=fC(),G=J(E);let _t;var Je=J(G,!0);X(G),X(E),$e((ut,Ve)=>{_t=bn(G,1,"calendar-date svelte-1lru178",null,_t,ut),Pe(Je,Ve)},[()=>({"is-selected":A(De).isToday(o()),"other-month":!A(t).current.isThisMonth(A(De).date),"is-holiday":A(De).isHoliday(),"is-past":A(De).date.isBefore(A(t).today)}),()=>(A(De),V(()=>A(De).date.format("D")))]),ce("click",G,()=>I(A(De).date)),ce("dblclick",G,()=>g(A(De).date)),de(le,E)}),X(N),de(Q,N)}),X(rt),X(he),xt(he,Q=>K(c,Q),()=>A(c));var At=we(he,2),Kt=J(At);return Td(Kt,e,"footer",{},null),X(At),xt(At,Q=>K(f,Q),()=>A(f)),X(F),xt(F,Q=>K(h,Q),()=>A(h)),$e((Q,oe)=>{Pe(pe,Q),Pe(Ge,oe)},[()=>(A(t),V(()=>A(t).current.monthStart.format("MMM"))),()=>(A(t),V(()=>A(t).current.monthStart.format("YYYY")))]),ce("click",ie,()=>v()),ce("click",He,()=>y()),ce("focus",F,()=>{u("focus")}),ce("blur",F,()=>{u("blur")}),ce("keydown",F,k),de(r,F),Md(e,"focus",b),qe(B)}var hC=ve("<option> </option>"),gC=ve('<select class="time-picker svelte-16e079f"></select>');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 u(){o("focus")}function c(){o("blur")}function f(){let y=[];for(let w=0;w<1440;w+=n()){let x=Math.floor(w/60),k=w%60;y.push(`${x.toString().padStart(2,"0")}:${k.toString().padStart(2,"0")}`)}return y}let h=f(),b=new es;function I(y){if(y.key>="0"&&y.key<="9"){y.preventDefault();let w=b.handle(y.key);switch(w.length){case 1:{let x=w.padStart(2,"0"),k=h.filter(B=>B.startsWith(x));k.length>1&&t(k[0])}break;case 2:{let x=w+":",k=h.filter(B=>B.startsWith(x));k.length>1&&t(k[0]);break}case 4:{let x=w.slice(0,2)+":"+w.slice(2,4);h.includes(x)&&t(x)}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=gC();return zt(v,5,()=>h,y=>y,(y,w)=>{var x=hC(),k=J(x,!0);X(x);var B={};$e(()=>{var F;Pe(k,A(w)),B!==(B=A(w))&&(x.value=(F=x.__value=A(w))!=null?F:"")}),de(y,x)}),X(v),ca(v,t),ce("dblclick",v,a),ce("focus",v,u),ce("blur",v,c),ce("keydown",v,I),de(r,v),qe(g)}var bC=ve('<div slot="footer"><hr class="dtchooser-divider svelte-1twe6ts"/> <!></div>'),vC=ve('<div class="dtchooser-calendar-area svelte-1twe6ts"><button type="button" class="dtchooser-mode-toggle dtchooser-mode-toggle-overlay svelte-1twe6ts" aria-label="Show quick date picks" title="Show quick date picks"><span class="dtchooser-mode-toggle-icon svelte-1twe6ts"></span></button> <!></div> <div class="dtchooser-wrapper svelte-1twe6ts"><div class="dtchooser-time-picker svelte-1twe6ts"><span class="svelte-1twe6ts">Time:</span> <!></div> <button class="mod-cta">OK</button></div>',1),yC=ve('<button type="button"> </button>'),_C=ve('<div class="dtchooser-header svelte-1twe6ts"><input type="text" class="dtchooser-quick-pick-filter svelte-1twe6ts" placeholder="Filter..."/> <button type="button" class="dtchooser-mode-toggle svelte-1twe6ts" aria-label="Show calendar" title="Show calendar"><span class="dtchooser-mode-toggle-icon svelte-1twe6ts"></span></button></div> <div class="dtchooser-calendar-area svelte-1twe6ts"><div class="dtchooser-quick-picks svelte-1twe6ts"></div></div>',1),IC=ve('<div class="dtchooser svelte-1twe6ts"><!></div>');function rs(r,e){var rt,At,Kt,Q,oe;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),u=re(e,"weekStart",12,0),c=re(e,"initialTime",12,void 0),f=re(e,"date",28,()=>{var N,le;return(le=(N=c())==null?void 0:N.moment().clone())!=null?le:(0,Cg.default)()}),h=xe((rt=c())!=null&&rt.hasTimePart?c().format("HH:mm"):(Kt=(At=n().reminderTime)==null?void 0:At.value.toString())!=null?Kt:"10:00"),b=xe((oe=(Q=c())==null?void 0:Q.hasTimePart)!=null?oe:!1),I=xe("calendar"),g=xe(""),v=xe(0),y=xe(),w=xe(),x=xe();function k(){let[N,le]=A(h).split(":"),De=f().clone();A(b)?(De.set({hour:parseInt(N),minute:parseInt(le)}),o()(new $(De,!0))):o()(new $(De,!1))}function B(N){o()(N.later())}async function F(){var N;K(I,"quickpick"),K(g,""),K(v,0),await jn(),(N=A(y))==null||N.focus()}async function P(){var N;K(I,"calendar"),K(g,""),await jn(),(N=A(x))==null||N.focus()}function ie(){A(I)==="calendar"?F():P()}let Y=["INPUT","SELECT","TEXTAREA"];function pe(N){if(A(I)!=="calendar"||N.key!=="+")return;let le=N.target;le&&Y.includes(le.tagName)||(F(),N.preventDefault())}function _e(N){switch(N.key){case"ArrowDown":N.preventDefault(),A(t).length>0&&K(v,(A(v)+1)%A(t).length);break;case"ArrowUp":N.preventDefault(),A(t).length>0&&K(v,(A(v)-1+A(t).length)%A(t).length);break;case"Enter":{N.preventDefault();let le=A(t)[A(v)];le&&B(le);break}case"Escape":N.preventDefault(),N.stopPropagation(),P();break}}yi(()=>(A(w),Od.setIcon,A(I)),()=>{A(w)&&(0,Od.setIcon)(A(w),A(I)==="calendar"?"clock":"calendar")}),yi(()=>(dc,A(g)),()=>{K(t,dc.filter(N=>N.label.toLowerCase().includes(A(g).toLowerCase())))}),yi(()=>A(g),()=>{A(g)!==void 0&&K(v,0)}),ia();var Ge={get reminders(){return n()},set reminders(N){n(N),j()},get onSelect(){return o()},set onSelect(N){o(N),j()},get timeStep(){return a()},set timeStep(N){a(N),j()},get weekStart(){return u()},set weekStart(N){u(N),j()},get initialTime(){return c()},set initialTime(N){c(N),j()},get date(){return f()},set date(N){f(N),j()},$set:yt,$on:(N,le)=>vt(e,N,le)};Bt();var He=IC(),he=J(He);{var Lt=N=>{var le=vC(),De=To(le),E=J(De),G=J(E);xt(G,qt=>K(w,qt),()=>A(w)),X(E);var _t=we(E,2);xt(cu(_t,{get weekStart(){return u()},get value(){return f()},set value(qt){f(qt)},$$events:{select:()=>k()},$$slots:{footer:(qt,yn)=>{var ti=bC(),us=we(J(ti),2);{let Tu=Vn(()=>(at(n()),at($),at(f()),V(()=>n().byDate(new $(f(),!1)))));qo(us,{get reminders(){return A(Tu)}})}X(ti),de(qt,ti)}},$$legacy:!0}),qt=>K(x,qt),()=>A(x)),X(De);var Je=we(De,2),ut=J(Je),Ve=we(J(ut),2);du(Ve,{get step(){return a()},get value(){return A(h)},set value(qt){K(h,qt)},$$events:{select:()=>{k()},focus:()=>{K(b,!0)}},$$legacy:!0}),X(ut);var wi=we(ut,2);X(Je),ce("click",E,ie),ce("click",wi,k),de(N,le)},Ze=N=>{var le=_C(),De=To(le),E=J(De);Bd(E),xt(E,Ve=>K(y,Ve),()=>A(y));var G=we(E,2),_t=J(G);xt(_t,Ve=>K(w,Ve),()=>A(w)),X(G),X(De);var Je=we(De,2),ut=J(Je);zt(ut,7,()=>A(t),Ve=>Ve.label,(Ve,wi,qt)=>{var yn=yC();let ti;var us=J(yn,!0);X(yn),$e(()=>{ti=bn(yn,1,"dtchooser-quick-pick svelte-1twe6ts",null,ti,{"is-selected":A(qt)===A(v)}),Pe(us,(A(wi),V(()=>A(wi).label)))}),ce("click",yn,()=>B(A(wi))),ce("mouseenter",yn,()=>K(v,A(qt))),de(Ve,yn)}),X(ut),X(Je),Zd(E,()=>A(g),Ve=>K(g,Ve)),ce("keydown",E,_e),ce("click",G,ie),de(N,le)};hn(he,N=>{A(I)==="calendar"?N(Lt):N(Ze,-1)})}return X(He),ce("keydown",He,pe),de(r,He),qe(Ge)}var $i=8;function xg(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,Ag.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 I,g,v;let t=this.editorView.coordsAtPos(e),n=this.editorView.dom.getBoundingClientRect(),o=(I=t==null?void 0:t.top)!=null?I:n.top,a=(g=t==null?void 0:t.bottom)!=null?g:n.top,u=(v=t==null?void 0:t.left)!=null?v:n.left,{width:c,height:f}=this.view.getBoundingClientRect(),h=a;h+f>window.innerHeight-$i&&(h=o-f),h=xg(h,$i,Math.max(window.innerHeight-f-$i,$i));let b=xg(u,$i,Math.max(window.innerWidth-c-$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 $d=class extends fu.Modal{constructor(t,n,o,a,u,c,f){super(t);m(this,"reminders",n);m(this,"onSelect",o);m(this,"onCancel",a);m(this,"timeStep",u);m(this,"weekStart",c);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,u)=>{new $d(r,e,a,u,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(kg.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 u=a.state.selection.main.head;o=new ns(a,n,this.timeStep.value,Number(this.weekStart.value)).show(u)}}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),u={line:o.line,ch:a.length};n||(a=a.substring(0,o.ch-this.trigger.value.length));let c=this.primaryFormat.value.format;try{let h=(f=Qa(c,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},u)}catch(h){console.error(h)}}};var Sg=require("@codemirror/state"),Rg=require("@codemirror/view"),Fg=require("obsidian");function Tg(r,e,t){return Rg.ViewPlugin.fromClass(class{constructor(){m(this,"activePopup");m(this,"destroyed",!1)}update(n){n.docChanged&&n.changes.iterChanges((o,a,u,c,f)=>{let h=n.state.doc,b=h.sliceString(c-2,c);if(f.length===0)return;let I=t.autoCompleteTrigger.value,g=t.reminderTimeStep.value,v=Number(t.weekStart.value);if(I===b){let y;Fg.Platform.isDesktopApp?y=new Promise((w,x)=>{setTimeout(()=>{var B;if(this.destroyed){x();return}(B=this.activePopup)==null||B.cancel();let k=new ns(n.view,e,g,v);this.activePopup=k,k.show(c).finally(()=>{this.activePopup===k&&(this.activePopup=void 0)}).then(w,x)},0)}):y=Pi(r,e,g,v),y.then(w=>{let x=t.primaryFormat.value.format;try{let k=h.lineAt(c),B=k.text.lastIndexOf(I),F=B+I.length;I.startsWith("(")&&k.text.charAt(F)===")"&&F++;let P=k.text.substring(0,B)+k.text.substring(F),ie=Qa(x,P,w,B,t.convertNonTaskLines.value);if(ie==null){Ua(),console.error("Cannot append reminder time to the line: line=%s, date=%s",k.text,w);return}let Y=n.view.state.update({changes:{from:k.from,to:k.to,insert:ie.insertedLine},selection:Sg.EditorSelection.cursor(k.from+ie.caretPosition)});n.view.update([Y])}catch(k){console.error(k)}}).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 Eg(r,e,t){return Math.min(Math.max(r,e),t)}function Gg(r,e){let t=[];for(let{reminder:a,columnStart:u,columnEnd:c}of e){let f=a.rowNumber+1;if(f<1||f>r.lines)continue;let h=r.line(f),b=Eg(h.from+u,h.from,h.to),I=Eg(h.from+c,b,h.to);b>=I||t.push({from:b,to:I,reminder:a,text:r.sliceString(b,I)})}t.sort((a,u)=>a.from-u.from);let n=[],o=-1;for(let a of t)a.from<o||(n.push(a),o=a.to);return n}var Bg=require("@codemirror/state"),fa=Bg.StateEffect.define();var Ng=require("@codemirror/view"),Wg=require("obsidian");var wC=ve('<span class="reminder-pill svelte-1r4kx8j" role="button" tabindex="0"> </span>');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 u(b){(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),b.stopPropagation(),o("activate"))}var c={get label(){return t()},set label(b){t(b),j()},get title(){return n()},set title(b){n(b),j()},$set:yt,$on:(b,I)=>vt(e,b,I)};Bt();var f=wC(),h=J(f,!0);return X(f),$e(()=>{Hr(f,"title",n()),Pe(h,t())}),ce("click",f,a),ce("keydown",f,u),ce("mousedown",f,tu(eu(function(b){Xd.call(this,e,b)}))),de(r,f),qe(c)}var hu=class extends Ng.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 CC(t,this.plugin,n)}catch(o){}}};function Dg(r,e){var h,b,I;if(!r.dom.contains(e))return null;let t=r.posAtDOM(e),n=r.state.doc.lineAt(t),o=(I=(b=(h=r.state.field(Wg.editorInfoField,!1))==null?void 0:h.file)==null?void 0:b.path)!=null?I:"",a=new Fn(o,r.state.doc.toString()),u=yo(a).filter(g=>g.reminder.rowNumber===n.number-1),c=null,f=Number.POSITIVE_INFINITY;for(let g of u){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<f&&(f=w,c=g)}return c==null?null:{md:a,span:c}}async function CC(r,e,t){var b;let n=Dg(r,t);if(n==null)return;let o=await Pi(e.app,e.reminders,e.settings.reminderTimeStep.value,Number(e.settings.weekStart.value),n.span.reminder.time),a=Dg(r,t);if(a==null||!await hl(a.md,a.span.reminder,{time:o}))return;let c=a.span.reminder.rowNumber,f=(b=a.md.toMarkdown().split(`
|
|
`)[c])!=null?b:"",h=r.state.doc.line(c+1);r.dispatch({changes:{from:h.from,to:h.to,insert:f},effects:[fa.of()]})}var xC=300,Zg=is.Annotation.define();function Hd(r,e){var t,n,o,a;try{if(!r.settings.editorReminderDisplay.value)return[];if(!((t=e.field(gu.editorLivePreviewField,!1))!=null&&t))return[];let u=(a=(o=(n=e.field(gu.editorInfoField,!1))==null?void 0:n.file)==null?void 0:o.path)!=null?a:"",c=new Fn(u,e.doc.toString());return Gg(e.doc,yo(c))}catch(u){return console.error("Failed to parse reminders for editor pills.",u),[]}}function Pd(r,e,t){let n=r.selection.main.head,o=new is.RangeSetBuilder;for(let a of e)n>=a.from&&n<=a.to||o.add(a.from,a.to,os.Decoration.replace({widget:new hu(a,t)}));return o.finish()}function AC(r,e){let t=[];for(let n of r){let o=e.mapPos(n.from),a=e.mapPos(n.to,1);o<a&&t.push({...n,from:o,to:a})}return t}function kC(r){return is.StateField.define({create(e){let t=Hd(r,e);return{decos:Pd(e,t,r),cache:t}},update(e,t){let n=e.decos.map(t.changes),o=t.docChanged?AC(e.cache,t.changes):e.cache,a=t.annotation(Zg);a!==void 0&&(o=a);let u=t.docChanged&&o.some(b=>t.changes.touchesRange(b.from,b.to)),c=t.effects.some(b=>b.is(fa));if(u||t.reconfigured||c&&a===void 0)return o=Hd(r,t.state),n=Pd(t.state,o,r),{decos:n,cache:o};let h=!t.startState.selection.eq(t.state.selection);return(a!==void 0||h)&&(n=Pd(t.state,o,r)),{decos:n,cache:o}},provide:e=>os.EditorView.decorations.from(e,t=>t.decos)})}function SC(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=Hd(r,this.view.state);this.view.dispatch({annotations:Zg.of(t),effects:[fa.of()]})},xC))}destroy(){this.debounceTimer!==void 0&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=void 0)}})}function Jd(r){return[kC(r),SC(r)]}var bu=require("@codemirror/state"),Ii=require("@codemirror/view"),jd=bu.StateEffect.define();function RC(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 FC=bu.StateField.define({create(){return Ii.Decoration.none},update(r,e){let t=e.effects.find(n=>n.is(jd));return t!==void 0?RC(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 Mg(){return FC}var Xg=require("obsidian");var Yg=require("obsidian");var TC=ve('<div class="icon-text svelte-1qeb5yo"><span class="icon svelte-1qeb5yo"></span> <span class="text svelte-1qeb5yo"> </span></div>');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,Yg.setIcon)(A(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,I)=>vt(e,b,I)};Bt();var u=TC(),c=J(u);xt(c,b=>K(o,b),()=>A(o));var f=we(c,2),h=J(f,!0);return X(f),X(u),$e(()=>Pe(h,n())),de(r,u),qe(a)}var EC=ve('<button class="reminder-toast-close svelte-1u4loek" aria-label="Close">\xD7</button>'),GC=ve("<option> </option>"),BC=ve('<div class="reminder-secondary-actions svelte-1u4loek"><button class="reminder-footer-action svelte-1u4loek" title="Pause all notifications for a chosen duration. Reminders are not muted: anything still overdue notifies you again after the pause ends.">Pause all notifications\u2026</button> <button class="reminder-footer-action svelte-1u4loek" title="Mute every currently overdue reminder. Muted reminders stay silent (even across restarts) until you snooze them or change their date.">Mute all reminders\u2026</button></div>'),DC=ve('<main tabindex="-1"><!> <h3 class="reminder-title svelte-1u4loek"><!></h3> <button class="reminder-file svelte-1u4loek" title="Alt+O / Ctrl+O" aria-keyshortcuts="Alt+O Control+O"><!></button> <div class="reminder-actions svelte-1u4loek"><button class="mod-cta svelte-1u4loek" title="Alt+D / Ctrl+D" aria-keyshortcuts="Alt+D Control+D"><!><span><span class="mnemonic svelte-1u4loek">D</span>one</span></button> <button title="Alt+M / Ctrl+M" aria-keyshortcuts="Alt+M Control+M" class="svelte-1u4loek"><!><span><span class="mnemonic svelte-1u4loek">M</span>ute</span></button> <select class="dropdown later-select svelte-1u4loek" title="Alt+S / Ctrl+S" aria-keyshortcuts="Alt+S Control+S"><option selected="" disabled="" hidden="">Snooze</option><!></select></div> <!></main>');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),u=re(e,"onMute",12),c=re(e,"onPauseAllNotifications",12),f=re(e,"onMuteAll",12),h=re(e,"variant",12,"modal"),b=re(e,"onClose",12,void 0),I=re(e,"focusDone",12,!1),g=re(e,"shortcutsEnabled",12,!0),v=xe(),y=re(e,"laters",28,()=>[]),w=xe(),x=xe(),k=xe();function B(){let E=y()[A(v)];E!=null&&n()(E.later())}function F(E){if(!g())return;let G=E.altKey&&!E.ctrlKey,_t=E.ctrlKey&&!E.altKey;if(!(!G&&!_t||E.metaKey||E.shiftKey))switch(E.code){case"KeyD":E.preventDefault(),E.stopPropagation(),o()();break;case"KeyM":E.preventDefault(),E.stopPropagation(),u()();break;case"KeyO":E.preventDefault(),E.stopPropagation(),a()();break;case"KeyS":E.preventDefault(),E.stopPropagation(),A(x).focus();break}}Jo(async()=>{h()!=="toast"&&(await jn(),I()?A(w).focus():A(k).focus())});var P={get reminder(){return t()},set reminder(E){t(E),j()},get onRemindMeLater(){return n()},set onRemindMeLater(E){n(E),j()},get onDone(){return o()},set onDone(E){o(E),j()},get onOpenFile(){return a()},set onOpenFile(E){a(E),j()},get onMute(){return u()},set onMute(E){u(E),j()},get onPauseAllNotifications(){return c()},set onPauseAllNotifications(E){c(E),j()},get onMuteAll(){return f()},set onMuteAll(E){f(E),j()},get variant(){return h()},set variant(E){h(E),j()},get onClose(){return b()},set onClose(E){b(E),j()},get focusDone(){return I()},set focusDone(E){I(E),j()},get shortcutsEnabled(){return g()},set shortcutsEnabled(E){g(E),j()},get laters(){return y()},set laters(E){y(E),j()},$set:yt,$on:(E,G)=>vt(e,E,G)};Bt();var ie=DC();ce("keydown",Us,F,!0);let Y;var pe=J(ie);{var _e=E=>{var G=EC();ce("click",G,function(..._t){var Je;(Je=b())==null||Je.apply(this,_t)}),de(E,G)};hn(pe,E=>{h()==="toast"&&E(_e)})}var Ge=we(pe,2),He=J(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=J(he);ss(Lt,{icon:"link",get text(){return at(t()),V(()=>t().file)}}),X(he);var Ze=we(he,2),rt=J(Ze),At=J(rt);ss(At,{icon:"check-small"}),Ro(),X(rt),xt(rt,E=>K(w,E),()=>A(w));var Kt=we(rt,2),Q=J(Kt);ss(Q,{icon:"minus-with-circle"}),Ro(),X(Kt);var oe=we(Kt,2),N=we(J(oe));zt(N,1,y,Fd,(E,G,_t)=>{var Je=GC(),ut=J(Je,!0);X(Je),Je.value=Je.__value=_t,$e(()=>{Dd(Je,A(v)===_t),Pe(ut,(A(G),V(()=>A(G).label)))}),de(E,Je)}),X(oe),xt(oe,E=>K(x,E),()=>A(x)),X(Ze);var le=we(Ze,2);{var De=E=>{var G=BC(),_t=J(G),Je=we(_t,2);X(G),ce("click",_t,function(...ut){var Ve;(Ve=c())==null||Ve.apply(this,ut)}),ce("click",Je,function(...ut){var Ve;(Ve=f())==null||Ve.apply(this,ut)}),de(E,G)};hn(le,E=>{h()==="modal"&&E(De)})}return X(ie),xt(ie,E=>K(k,E),()=>A(k)),$e(()=>{Y=bn(ie,1,"svelte-1u4loek",null,Y,{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(...E){var G;(G=a())==null||G.apply(this,E)}),ce("click",rt,function(...E){var G;(G=o())==null||G.apply(this,E)}),ce("click",Kt,function(...E){var G;(G=u())==null||G.apply(this,E)}),ca(oe,()=>A(v),E=>K(v,E)),ce("change",oe,B),de(r,ie),qe(P)}var vu=class extends Xg.Modal{constructor(t,n,o,a,u){super(t);m(this,"laters",n);m(this,"reminder",o);m(this,"actions",a);m(this,"focusDoneButtonOnPopup",u);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.actions.remindMeLater(n),this.canceled=!1,this.close()},onDone:()=>{this.canceled=!1,this.actions.done(),this.close()},onOpenFile:()=>{this.canceled=!0,this.actions.openFile(),this.close()},onMute:()=>{this.canceled=!0,this.close()},onPauseAllNotifications:()=>{this.pausingAll=!0,this.actions.pauseAll(),this.close()},onMuteAll:()=>{this.mutingAll=!0,this.actions.muteAll(),this.close()}}})}onClose(){this.reminder.beingDisplayed=!1;let{contentEl:t}=this;t.empty(),this.pausingAll||this.mutingAll||this.canceled&&this.actions.mute()}};var yu=class{constructor(){m(this,"containerEl");m(this,"toasts",new Map)}show(e,t,n){let o=e.key();this.remove(o);let a=this.getContainer().createDiv("reminder-toast-card"),u=new as({target:a,props:{reminder:e,laters:t,variant:"toast",shortcutsEnabled:!0,onRemindMeLater:c=>{n.remindMeLater(c),this.remove(o)},onDone:()=>{n.done(),this.remove(o)},onOpenFile:()=>{n.openFile(),n.mute(),this.remove(o)},onMute:()=>{n.mute(),this.remove(o)},onClose:()=>{n.mute(),this.remove(o)},onPauseAllNotifications:()=>{n.pauseAll(),this.remove(o)},onMuteAll:()=>{n.muteAll(),this.remove(o)}}});this.toasts.set(o,{el:a,component:u}),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 Ug=window.require?window.require("electron"):void 0,_u=class{constructor(e,t,n,o){m(this,"laters",e);m(this,"openNoteOnReminderClick",t);m(this,"keepSystemNotificationOnScreen",n);m(this,"showBuiltinReminder",o);m(this,"systemNotifications",new Map)}isAvailable(){return Ug!==void 0}show(e,t,n){let o=e.key();this.close(o);let a=Ug.remote.Notification,u=new a({title:"Obsidian Reminder",body:e.title,timeoutType:this.keepSystemNotificationOnScreen.value?"never":"default"}),c={notification:u,closedByPlugin:!1};if(this.systemNotifications.set(o,c),u.on("click",()=>{if(this.close(o),this.openNoteOnReminderClick.value){t.openFile();return}n||this.showBuiltinReminder(e,t)}),u.on("close",()=>{this.systemNotifications.get(o)===c&&this.systemNotifications.delete(o),!(n||c.closedByPlugin)&&t.mute()}),!n){let f=this.laters.value;u.on("action",(b,I)=>{if(I===0){t.done();return}let g=f[I-1];t.remindMeLater(g.later())});let h=[{type:"button",text:"Mark as Done"}];f.forEach(b=>{h.push({type:"button",text:b.label})}),u.actions=h}u.show()}destroy(){for(let e of Array.from(this.systemNotifications.keys()))this.close(e);this.systemNotifications.clear()}sync(e){for(let t of Array.from(this.systemNotifications.keys()))e.has(t)||this.close(t)}close(e){let t=this.systemNotifications.get(e);t&&(t.closedByPlugin=!0,this.systemNotifications.delete(e),t.notification.close())}};var Iu=class{constructor(e,t,n,o,a,u,c,f){m(this,"app",e);m(this,"useSystemNotification",t);m(this,"laters",n);m(this,"showPopupWithSystemNotification",a);m(this,"focusDoneButtonOnPopup",c);m(this,"notificationPopupStyle",f);m(this,"toastManager",new yu);m(this,"systemNotifier");this.systemNotifier=new _u(n,o,u,(h,b)=>this.showBuiltinReminder(h,b))}destroy(){this.toastManager.destroy(),this.systemNotifier.destroy()}sync(e){this.toastManager.sync(e),this.systemNotifier.sync(e)}show(e,t){if(!this.isSystemNotification()){this.showBuiltinReminder(e,t);return}let n=this.showPopupWithSystemNotification.value;n&&this.showBuiltinReminder(e,t),this.systemNotifier.show(e,t,n)}showBuiltinReminder(e,t){if(this.notificationPopupStyle.value==="toast"){this.toastManager.show(e,this.laters.value,t);return}new vu(this.app,this.laters.value,e,t,this.focusDoneButtonOnPopup.value).open()}isSystemNotification(){return this.systemNotifier.isAvailable()?this.useSystemNotification.value:!1}};var ma=class{constructor(e){m(this,"plugin",e);m(this,"autoComplete");m(this,"editDetector");m(this,"reminderNotifier");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 zd(e.settings.editDetectionSec),this.reminderNotifier=new Iu(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 Kd(this.plugin.app,this.plugin)),this.plugin.registerDomEvent(document,"keydown",()=>{this.editDetector.fileChanged()}),vn.Platform.isDesktopApp&&(this.plugin.registerEditorExtension(Tg(this.plugin.app,this.plugin.reminders,this.plugin.settings)),this.plugin.registerEditorExtension(Jd(this.plugin)),this.plugin.registerEditorExtension(Mg()),this.plugin.settings.editorReminderDisplay.rawValue.onChanged(()=>{this.plugin.app.workspace.updateOptions()})),Sp(this.plugin)}onLayoutReady(){this.plugin.data.debug.value&&Fp(this.plugin),this.viewProxy.openView()}onunload(){this.detachReminderList(),this.reminderNotifier.destroy()}isEditing(){return this.editDetector.isEditing()}invalidate(){this.viewProxy.invalidate(),this.overdueStatusBar.refresh(),this.reminderNotifier.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()}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 u=o.cm;if(u){let c=u.state.doc.line(e.rowNumber+1);u.dispatch({effects:jd.of({from:c.from,to:c.to})})}}showReminder(e){e.muteNotification=!0;let t={remindMeLater:n=>{console.debug("Remind me later: time=%o",n),e.time=n,e.muteNotification=!1,this.plugin.fileSystem.updateReminder(e,!1),this.plugin.data.save(!0)},done:()=>{console.debug("done"),e.muteNotification=!1,this.plugin.fileSystem.updateReminder(e,!0),this.plugin.reminders.removeReminder(e),this.plugin.data.save(!0)},mute:()=>{console.debug("Mute"),e.muteNotification=!0,this.reload(!0),this.plugin.data.save(!0)},openFile:()=>{console.debug("Open"),this.openReminderFile(e)},pauseAll:()=>{console.debug("Pause all notifications"),Ya(this.plugin,()=>{e.muteNotification=!1})},muteAll:()=>{console.debug("Mute all reminders");let n=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 ${n} reminder${n===1?"":"s"}`)}};this.reminderNotifier.show(e,t)}},zd=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<this.editDetectionSec.value}},Kd=class extends vn.PluginSettingTab{constructor(t,n){super(t,n);m(this,"plugin",n)}display(){let{containerEl:t}=this;this.plugin.settings.settings.displayOn(t)}};function Qg(r){return r.trim().replace(/^\/+/,"").replace(/\/+$/,"")}function Vg(r,e){let t=Qg(r);return e.some(n=>{let o=Qg(n);return o.length===0?!1:t===o||t.startsWith(`${o}/`)})}var qd=require("obsidian");var pa=class{constructor(e,t,n,o,a){m(this,"vault",e);m(this,"reminders",t);m(this,"onRemindersChanged",n);m(this,"excludedPaths",o);m(this,"dataLoaded",a)}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 qd.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(Vg(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(){await this.dataLoaded(),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 qd.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 Lg=Wr(wr(),1);var cf=require("obsidian");var ef=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)}},tf=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}},rf=class{constructor(e){m(this,"registry",e);m(this,"context");this.context=new tf(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 wu(this.context,!1,e)}textArea(e){return new wu(this.context,!0,e)}number(e){return new nf(this.context,e)}toggle(e){return new of(this.context,e)}dropdown(e){return new af(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 ha(this.context,e,this.initValue,t)}wireTextComponent(e,t,n,o){e.setPlaceholder(t).setValue(n).onChange(async a=>{o(a)})}},wu=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 u=c=>{var f;this.wireTextComponent(c,(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(c=>{u(c)}):n.addText(c=>{u(c)})})}},nf=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(u=>{var c;this.wireTextComponent(u,(c=this._placeHolder)!=null?c:"",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()})})})}},of=class extends ls{build(e){return new ha(this.context,e,this.initValue,({setting:t,rawValue:n})=>{t.addToggle(o=>o.setValue(n.value).onChange(async a=>{n.value=a,this.onValueChange()}))})}},sf=class{constructor(e,t){m(this,"label",e);m(this,"value",t)}},af=class extends ls{constructor(){super(...arguments);m(this,"options",[])}addOption(t,n){return this.options.push(new sf(t,n)),this}build(t){return new ha(this.context,t,this.initValue,({setting:n,rawValue:o})=>{n.addDropdown(a=>{this.options.forEach(u=>{a.addOption(u.value,u.label)}),a.setValue(o.value),a.onChange(async u=>{o.value=u,this.onValueChange()})})})}},ha=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 cf.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)}},lf=class{constructor(e){m(this,"name",e);m(this,"settings",[])}addSettings(...e){this.settings.push(...e)}},uf=class{constructor(e){m(this,"name",e);m(this,"groups",[])}newGroup(e){let t=new lf(e);return this.groups.push(t),t}},Cu=class{constructor(){m(this,"pages",[]);m(this,"registry",new ef);m(this,"activeTabIndex",0)}newSettingBuilder(){return new rf(this.registry)}newPage(e){let t=new uf(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,u)=>{let c=t.createEl("button",{cls:"reminder-settings-tab",text:a.name});return c.setAttribute("role","tab"),c.setAttribute("type","button"),c.addEventListener("click",()=>{this.activeTabIndex=u,this.updateTabButtons(n),this.renderActivePage(o)}),c});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 cf.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)})})})}},xu=class{unmarshal(e){return Na.parse(e)}marshal(e){return e.toString()}},ye=class{unmarshal(e){return e}marshal(e){return e}},Au=class{unmarshal(e){return cm(e)}marshal(e){return e.map(t=>t.label).join(`
|
|
`)}},ku=class{unmarshal(e){return e.split(`
|
|
`).map(t=>t.trim()).filter(t=>t.length>0)}marshal(e){return e.join(`
|
|
`)}},Su=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",Ru=class{constructor(){m(this,"settings",new Cu);m(this,"reminderTime");m(this,"reminderTimeStep");m(this,"enableNotification");m(this,"reNotifyMutedOnStartup");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 df(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 xu),this.reminderTimeStep=this.settings.newSettingBuilder().key("reminderTimeStep").name("Reminder time step (minutes)").desc("Step of time for reminder time (minutes)").number(15).build(new ye),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 ye),this.reNotifyMutedOnStartup=this.settings.newSettingBuilder().key("reNotifyMutedOnStartup").name("Re-notify muted reminders on startup").desc('When enabled, reminders you previously muted are notified again the next time Obsidian starts. Useful if you rely on startup notifications to review overdue reminders. If many reminders are overdue, they are shown one after another \u2014 use the "Mute all current reminders" command to silence them again.').toggle(!1).build(new ye),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 ye),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 ye),this.useSystemNotification=this.settings.newSettingBuilder().key("useSystemNotification").name("Use system notification").desc("Use system notification for reminder notifications").toggle(!1).build(new ye),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 ye),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 ye),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 ye),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 Au);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,u)=>{let c=(0,Lg.default)().day(u).format("dddd");t.addOption(c,u.toString())}),this.weekStart=t.build(new ye),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 ye),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 ye),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 ye),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 ye),this.autoCompleteTrigger=this.settings.newSettingBuilder().key("autoCompleteTrigger").name("Calendar popup trigger").desc("Trigger text to show calendar popup").text("(@").placeHolder("(@").onAnyValueChanged(a=>{let u=this.autoCompleteTrigger.value;a.setInfo(`Popup is ${u.length===0?"disabled":"enabled"}`)}).build(new ye),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 ye),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 ye);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 Su),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 ku),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),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 ye),this.settings.newPage("Notifications").newGroup().addSettings(this.reminderTime,this.reminderTimeStep,this.laters,this.enableNotification,this.reNotifyMutedOnStartup,this.notificationPopupStyle,this.openNoteOnReminderClick,this.useSystemNotification,this.showPopupWithSystemNotification,this.keepSystemNotificationOnScreen,this.focusDoneButtonOnPopup,this.showOverdueCountInStatusBar),this.settings.newPage("Editor").newGroup().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 xs;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),vp(e)}forEach(e){this.settings.forEach(e)}},df=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(Fc),this.enableTasksPluginReminderFormat=this.createUseReminderFormatSetting(Tc),this.enableKanbanPluginReminderFormat=this.createUseReminderFormatSetting(Ec),this.enableDataviewReminderFormat=this.createUseReminderFormatSetting(Gc)}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 ye);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);bp(e)}};var ga=class{constructor(e,t){m(this,"store",e);m(this,"reminders",t);m(this,"restoring",!0);m(this,"resolveLoaded",()=>{});m(this,"loaded",new Promise(e=>{this.resolveLoaded=e}));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 Ru);this._settings.wireReminderFormatConfig(),this.settings.forEach(n=>{n.rawValue.onChanged(()=>{this.restoring||(n.hasTag(yr)&&(this.scanned.value=!1),this.changed=!0)})})}async load(){try{await this.doLoad()}finally{this.resolveLoaded()}}async doLoad(){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(o=>{o.load(e.settings)});let t=!this.settings.reNotifyMutedOnStartup.value,n=e.reminders;n&&Object.keys(n).forEach(o=>{let a=n[o];a&&this.reminders.replaceFile(o,a.map(u=>{var f;let c=new ao(o,u.title,$.parse(u.time),u.rowNumber,!1);return c.muteNotification=t&&((f=u.muted)!=null?f:!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((u,c)=>{t[c]=u.map(f=>({title:f.title,time:f.time.toString(),rowNumber:f.rowNumber,muted:f.muteNotification}))});let n={};this.settings.forEach(u=>{u.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 Og=require("obsidian");var Fu=class extends Og.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 ga(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 ma(this),this._fileSystem=new pa(t.vault,this.reminders,()=>{this.ui.reload(!0)},()=>this.settings.excludedPaths.value,()=>this.data.loaded),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 ws({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 */ |