/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ var hZe=Object.create;var fv=Object.defineProperty;var Rse=Object.getOwnPropertyDescriptor;var gZe=Object.getOwnPropertyNames;var yZe=Object.getPrototypeOf,vZe=Object.prototype.hasOwnProperty;var Fse=r=>{throw TypeError(r)};var kZe=(r,e,t)=>e in r?fv(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var y=(r,e)=>()=>(r&&(e=r(r=0)),e);var x=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),at=(r,e)=>{for(var t in e)fv(r,t,{get:e[t],enumerable:!0})},Ose=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of gZe(e))!vZe.call(r,a)&&a!==t&&fv(r,a,{get:()=>e[a],enumerable:!(n=Rse(e,a))||n.enumerable});return r};var st=(r,e,t)=>(t=r!=null?hZe(yZe(r)):{},Ose(e||!r||!r.__esModule?fv(t,"default",{value:r,enumerable:!0}):t,r)),NA=r=>Ose(fv({},"__esModule",{value:!0}),r),tt=(r,e,t,n)=>{for(var a=n>1?void 0:n?Rse(e,t):e,i=r.length-1,s;i>=0;i--)(s=r[i])&&(a=(n?s(e,t,a):s(a))||a);return n&&a&&fv(e,t,a),a};var I=(r,e,t)=>kZe(r,typeof e!="symbol"?e+"":e,t),Lse=(r,e,t)=>e.has(r)||Fse("Cannot "+t);var In=(r,e,t)=>(Lse(r,e,"read from private field"),t?t.call(r):e.get(r)),Tc=(r,e,t)=>e.has(r)?Fse("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),xo=(r,e,t,n)=>(Lse(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t);var bZe,Z5t,RA,zse,pB,mB,TZe,jse,Q5t,wZe,SZe,J5t,fB,hv=y(()=>{bZe=Math.pow(10,8)*24*60*60*1e3,Z5t=-bZe,RA=6048e5,zse=864e5,pB=6e4,mB=36e5,TZe=3600,jse=TZe*24,Q5t=jse*7,wZe=jse*365.2425,SZe=wZe/12,J5t=SZe*3,fB=Symbol.for("constructDateFrom")});function Bn(r,e){return typeof r=="function"?r(e):r&&typeof r=="object"&&fB in r?r[fB](e):r instanceof Date?new r.constructor(e):new Date(e)}var Pl=y(()=>{hv()});function ft(r,e){return Bn(e||r,r)}var Nn=y(()=>{Pl()});function yh(r,e,t){let n=ft(r,t==null?void 0:t.in);return isNaN(e)?Bn((t==null?void 0:t.in)||r,NaN):(e&&n.setDate(n.getDate()+e),n)}var FA=y(()=>{Pl();Nn()});function OA(r,e,t){let n=ft(r,t==null?void 0:t.in);if(isNaN(e))return Bn((t==null?void 0:t.in)||r,NaN);if(!e)return n;let a=n.getDate(),i=Bn((t==null?void 0:t.in)||r,n.getTime());i.setMonth(n.getMonth()+e+1,0);let s=i.getDate();return a>=s?i:(n.setFullYear(i.getFullYear(),i.getMonth(),a),n)}var hB=y(()=>{Pl();Nn()});var $se=y(()=>{});var Bse=y(()=>{});var Use=y(()=>{});var Hse=y(()=>{});var Vse=y(()=>{});var qse=y(()=>{});var Wse=y(()=>{});function wc(){return xZe}var xZe,gv=y(()=>{xZe={}});function Ni(r,e){var o,l,c,d,u,p,m,f;let t=wc(),n=(f=(m=(d=(c=e==null?void 0:e.weekStartsOn)!=null?c:(l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)!=null?d:t.weekStartsOn)!=null?m:(p=(u=t.locale)==null?void 0:u.options)==null?void 0:p.weekStartsOn)!=null?f:0,a=ft(r,e==null?void 0:e.in),i=a.getDay(),s=(i{gv();Nn()});function vh(r,e){return Ni(r,{...e,weekStartsOn:1})}var nS=y(()=>{yv()});function LA(r,e){let t=ft(r,e==null?void 0:e.in),n=t.getFullYear(),a=Bn(t,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);let i=vh(a),s=Bn(t,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);let o=vh(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}var zA=y(()=>{Pl();nS();Nn()});function gB(r){let e=ft(r),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+r-+t}var Yse=y(()=>{Nn()});function jA(r,...e){let t=Bn.bind(null,r||e.find(n=>typeof n=="object"));return e.map(t)}var yB=y(()=>{Pl()});function Ml(r,e){let t=ft(r,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}var $A=y(()=>{Nn()});function Gse(r,e,t){let[n,a]=jA(t==null?void 0:t.in,r,e),i=Ml(n),s=Ml(a),o=+i-gB(i),l=+s-gB(s);return Math.round((o-l)/zse)}var vB=y(()=>{Yse();yB();hv();$A()});function Kse(r,e){let t=LA(r,e),n=Bn((e==null?void 0:e.in)||r,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),vh(n)}var kB=y(()=>{Pl();zA();nS()});var Zse=y(()=>{});var Qse=y(()=>{});var Jse=y(()=>{});var Xse=y(()=>{});var eoe=y(()=>{});function toe(r,e,t){return yh(r,e*7,t)}var roe=y(()=>{FA()});function noe(r,e,t){return OA(r,e*12,t)}var aoe=y(()=>{hB()});var ioe=y(()=>{});var soe=y(()=>{});var ooe=y(()=>{});var loe=y(()=>{});var coe=y(()=>{});var doe=y(()=>{});var uoe=y(()=>{});var poe=y(()=>{});var moe=y(()=>{});var foe=y(()=>{});function bB(r,e,t){let[n,a]=jA(t==null?void 0:t.in,r,e);return+Ml(n)==+Ml(a)}var hoe=y(()=>{yB();$A()});function goe(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}var TB=y(()=>{});function Ca(r){return!(!goe(r)&&typeof r!="number"||isNaN(+ft(r)))}var wB=y(()=>{TB();Nn()});var yoe=y(()=>{});var voe=y(()=>{});var koe=y(()=>{});var boe=y(()=>{});var Toe=y(()=>{});var woe=y(()=>{});var Soe=y(()=>{});var xoe=y(()=>{});var Coe=y(()=>{});var Eoe=y(()=>{});var Doe=y(()=>{});var Poe=y(()=>{});var Moe=y(()=>{});var Aoe=y(()=>{});function aS(r,e){let t=ft(r,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}var _oe=y(()=>{Nn()});function BA(r,e){let t=ft(r,e==null?void 0:e.in),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}var Ioe=y(()=>{Nn()});var Noe=y(()=>{});var Roe=y(()=>{});var Foe=y(()=>{});var Ooe=y(()=>{});var Loe=y(()=>{});var zoe=y(()=>{});var joe=y(()=>{});var $oe=y(()=>{});var Boe=y(()=>{});var Uoe=y(()=>{});var Hoe=y(()=>{});var Voe=y(()=>{});var qoe=y(()=>{});var Woe=y(()=>{});function UA(r,e){let t=ft(r,e==null?void 0:e.in);return t.setDate(1),t.setHours(0,0,0,0),t}var Yoe=y(()=>{Nn()});var Goe=y(()=>{});function Koe(r,e){let t=ft(r,e==null?void 0:e.in),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}var Zoe=y(()=>{Nn()});function HA(r,e){let t=ft(r,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}var SB=y(()=>{Nn()});var Qoe=y(()=>{});var Joe=y(()=>{});var Xoe=y(()=>{});var ele=y(()=>{});function vv(r,e){var o,l,c,d,u,p,m,f;let t=wc(),n=(f=(m=(d=(c=e==null?void 0:e.weekStartsOn)!=null?c:(l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)!=null?d:t.weekStartsOn)!=null?m:(p=(u=t.locale)==null?void 0:u.options)==null?void 0:p.weekStartsOn)!=null?f:0,a=ft(r,e==null?void 0:e.in),i=a.getDay(),s=(i{gv();Nn()});var rle=y(()=>{});var nle=y(()=>{});var ale=y(()=>{});var ile=y(()=>{});var sle=y(()=>{});var ole=y(()=>{});var lle=y(()=>{});var cle=y(()=>{});var CZe,dle,ule=y(()=>{CZe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},dle=(r,e,t)=>{let n,a=CZe[r];return typeof a=="string"?n=a:e===1?n=a.one:n=a.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n}});function VA(r){return(e={})=>{let t=e.width?String(e.width):r.defaultWidth;return r.formats[t]||r.formats[r.defaultWidth]}}var ple=y(()=>{});var EZe,DZe,PZe,mle,fle=y(()=>{ple();EZe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},DZe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},PZe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},mle={date:VA({formats:EZe,defaultWidth:"full"}),time:VA({formats:DZe,defaultWidth:"full"}),dateTime:VA({formats:PZe,defaultWidth:"full"})}});var MZe,hle,gle=y(()=>{MZe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},hle=(r,e,t,n)=>MZe[r]});function kv(r){return(e,t)=>{let n=t!=null&&t.context?String(t.context):"standalone",a;if(n==="formatting"&&r.formattingValues){let s=r.defaultFormattingWidth||r.defaultWidth,o=t!=null&&t.width?String(t.width):s;a=r.formattingValues[o]||r.formattingValues[s]}else{let s=r.defaultWidth,o=t!=null&&t.width?String(t.width):r.defaultWidth;a=r.values[o]||r.values[s]}let i=r.argumentCallback?r.argumentCallback(e):e;return a[i]}}var yle=y(()=>{});var AZe,_Ze,IZe,NZe,RZe,FZe,OZe,vle,kle=y(()=>{yle();AZe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_Ze={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},IZe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},NZe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},RZe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},FZe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},OZe=(r,e)=>{let t=Number(r),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},vle={ordinalNumber:OZe,era:kv({values:AZe,defaultWidth:"wide"}),quarter:kv({values:_Ze,defaultWidth:"wide",argumentCallback:r=>r-1}),month:kv({values:IZe,defaultWidth:"wide"}),day:kv({values:NZe,defaultWidth:"wide"}),dayPeriod:kv({values:RZe,defaultWidth:"wide",formattingValues:FZe,defaultFormattingWidth:"wide"})}});function bv(r){return(e,t={})=>{let n=t.width,a=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],i=e.match(a);if(!i)return null;let s=i[0],o=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(o)?zZe(o,u=>u.test(s)):LZe(o,u=>u.test(s)),c;c=r.valueCallback?r.valueCallback(l):l,c=t.valueCallback?t.valueCallback(c):c;let d=e.slice(s.length);return{value:c,rest:d}}}function LZe(r,e){for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&e(r[t]))return t}function zZe(r,e){for(let t=0;t{});function Tle(r){return(e,t={})=>{let n=e.match(r.matchPattern);if(!n)return null;let a=n[0],i=e.match(r.parsePattern);if(!i)return null;let s=r.valueCallback?r.valueCallback(i[0]):i[0];s=t.valueCallback?t.valueCallback(s):s;let o=e.slice(a.length);return{value:s,rest:o}}}var wle=y(()=>{});var jZe,$Ze,BZe,UZe,HZe,VZe,qZe,WZe,YZe,GZe,KZe,ZZe,Sle,xle=y(()=>{ble();wle();jZe=/^(\d+)(th|st|nd|rd)?/i,$Ze=/\d+/i,BZe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},UZe={any:[/^b/i,/^(a|c)/i]},HZe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},VZe={any:[/1/i,/2/i,/3/i,/4/i]},qZe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},WZe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},YZe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},GZe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},KZe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ZZe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Sle={ordinalNumber:Tle({matchPattern:jZe,parsePattern:$Ze,valueCallback:r=>parseInt(r,10)}),era:bv({matchPatterns:BZe,defaultMatchWidth:"wide",parsePatterns:UZe,defaultParseWidth:"any"}),quarter:bv({matchPatterns:HZe,defaultMatchWidth:"wide",parsePatterns:VZe,defaultParseWidth:"any",valueCallback:r=>r+1}),month:bv({matchPatterns:qZe,defaultMatchWidth:"wide",parsePatterns:WZe,defaultParseWidth:"any"}),day:bv({matchPatterns:YZe,defaultMatchWidth:"wide",parsePatterns:GZe,defaultParseWidth:"any"}),dayPeriod:bv({matchPatterns:KZe,defaultMatchWidth:"any",parsePatterns:ZZe,defaultParseWidth:"any"})}});var xB,Cle=y(()=>{ule();fle();gle();kle();xle();xB={code:"en-US",formatDistance:dle,formatLong:mle,formatRelative:hle,localize:vle,match:Sle,options:{weekStartsOn:0,firstWeekContainsDate:1}}});var Ele=y(()=>{Cle()});function Dle(r,e){let t=ft(r,e==null?void 0:e.in);return Gse(t,HA(t))+1}var CB=y(()=>{vB();SB();Nn()});function Ple(r,e){let t=ft(r,e==null?void 0:e.in),n=+vh(t)-+Kse(t);return Math.round(n/RA)+1}var EB=y(()=>{hv();nS();kB();Nn()});function qA(r,e){var d,u,p,m,f,h,g,v;let t=ft(r,e==null?void 0:e.in),n=t.getFullYear(),a=wc(),i=(v=(g=(m=(p=e==null?void 0:e.firstWeekContainsDate)!=null?p:(u=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)!=null?m:a.firstWeekContainsDate)!=null?g:(h=(f=a.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)!=null?v:1,s=Bn((e==null?void 0:e.in)||r,0);s.setFullYear(n+1,0,i),s.setHours(0,0,0,0);let o=Ni(s,e),l=Bn((e==null?void 0:e.in)||r,0);l.setFullYear(n,0,i),l.setHours(0,0,0,0);let c=Ni(l,e);return+t>=+o?n+1:+t>=+c?n:n-1}var WA=y(()=>{gv();Pl();yv();Nn()});function Mle(r,e){var o,l,c,d,u,p,m,f;let t=wc(),n=(f=(m=(d=(c=e==null?void 0:e.firstWeekContainsDate)!=null?c:(l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)!=null?d:t.firstWeekContainsDate)!=null?m:(p=(u=t.locale)==null?void 0:u.options)==null?void 0:p.firstWeekContainsDate)!=null?f:1,a=qA(r,e),i=Bn((e==null?void 0:e.in)||r,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),Ni(i,e)}var DB=y(()=>{gv();Pl();WA();yv()});function Ale(r,e){let t=ft(r,e==null?void 0:e.in),n=+Ni(t,e)-+Mle(t,e);return Math.round(n/RA)+1}var PB=y(()=>{hv();yv();DB();Nn()});function vr(r,e){let t=r<0?"-":"",n=Math.abs(r).toString().padStart(e,"0");return t+n}var MB=y(()=>{});var au,_le=y(()=>{MB();au={y(r,e){let t=r.getFullYear(),n=t>0?t:1-t;return vr(e==="yy"?n%100:n,e.length)},M(r,e){let t=r.getMonth();return e==="M"?String(t+1):vr(t+1,2)},d(r,e){return vr(r.getDate(),e.length)},a(r,e){let t=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(r,e){return vr(r.getHours()%12||12,e.length)},H(r,e){return vr(r.getHours(),e.length)},m(r,e){return vr(r.getMinutes(),e.length)},s(r,e){return vr(r.getSeconds(),e.length)},S(r,e){let t=e.length,n=r.getMilliseconds(),a=Math.trunc(n*Math.pow(10,t-3));return vr(a,e.length)}}});function Ile(r,e=""){let t=r>0?"-":"+",n=Math.abs(r),a=Math.trunc(n/60),i=n%60;return i===0?t+String(a):t+String(a)+e+vr(i,2)}function Nle(r,e){return r%60===0?(r>0?"-":"+")+vr(Math.abs(r)/60,2):kh(r,e)}function kh(r,e=""){let t=r>0?"-":"+",n=Math.abs(r),a=vr(Math.trunc(n/60),2),i=vr(n%60,2);return t+a+e+i}var Tv,AB,Rle=y(()=>{CB();EB();zA();PB();WA();MB();_le();Tv={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},AB={G:function(r,e,t){let n=r.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){let n=r.getFullYear(),a=n>0?n:1-n;return t.ordinalNumber(a,{unit:"year"})}return au.y(r,e)},Y:function(r,e,t,n){let a=qA(r,n),i=a>0?a:1-a;if(e==="YY"){let s=i%100;return vr(s,2)}return e==="Yo"?t.ordinalNumber(i,{unit:"year"}):vr(i,e.length)},R:function(r,e){let t=LA(r);return vr(t,e.length)},u:function(r,e){let t=r.getFullYear();return vr(t,e.length)},Q:function(r,e,t){let n=Math.ceil((r.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return vr(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,e,t){let n=Math.ceil((r.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return vr(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,e,t){let n=r.getMonth();switch(e){case"M":case"MM":return au.M(r,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(r,e,t){let n=r.getMonth();switch(e){case"L":return String(n+1);case"LL":return vr(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(r,e,t,n){let a=Ale(r,n);return e==="wo"?t.ordinalNumber(a,{unit:"week"}):vr(a,e.length)},I:function(r,e,t){let n=Ple(r);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):vr(n,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getDate(),{unit:"date"}):au.d(r,e)},D:function(r,e,t){let n=Dle(r);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):vr(n,e.length)},E:function(r,e,t){let n=r.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(r,e,t,n){let a=r.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return vr(i,2);case"eo":return t.ordinalNumber(i,{unit:"day"});case"eee":return t.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(a,{width:"short",context:"formatting"});case"eeee":default:return t.day(a,{width:"wide",context:"formatting"})}},c:function(r,e,t,n){let a=r.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return vr(i,e.length);case"co":return t.ordinalNumber(i,{unit:"day"});case"ccc":return t.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(a,{width:"narrow",context:"standalone"});case"cccccc":return t.day(a,{width:"short",context:"standalone"});case"cccc":default:return t.day(a,{width:"wide",context:"standalone"})}},i:function(r,e,t){let n=r.getDay(),a=n===0?7:n;switch(e){case"i":return String(a);case"ii":return vr(a,e.length);case"io":return t.ordinalNumber(a,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(r,e,t){let a=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(r,e,t){let n=r.getHours(),a;switch(n===12?a=Tv.noon:n===0?a=Tv.midnight:a=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(r,e,t){let n=r.getHours(),a;switch(n>=17?a=Tv.evening:n>=12?a=Tv.afternoon:n>=4?a=Tv.morning:a=Tv.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){let n=r.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return au.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getHours(),{unit:"hour"}):au.H(r,e)},K:function(r,e,t){let n=r.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):vr(n,e.length)},k:function(r,e,t){let n=r.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):vr(n,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getMinutes(),{unit:"minute"}):au.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getSeconds(),{unit:"second"}):au.s(r,e)},S:function(r,e){return au.S(r,e)},X:function(r,e,t){let n=r.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return Nle(n);case"XXXX":case"XX":return kh(n);case"XXXXX":case"XXX":default:return kh(n,":")}},x:function(r,e,t){let n=r.getTimezoneOffset();switch(e){case"x":return Nle(n);case"xxxx":case"xx":return kh(n);case"xxxxx":case"xxx":default:return kh(n,":")}},O:function(r,e,t){let n=r.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ile(n,":");case"OOOO":default:return"GMT"+kh(n,":")}},z:function(r,e,t){let n=r.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ile(n,":");case"zzzz":default:return"GMT"+kh(n,":")}},t:function(r,e,t){let n=Math.trunc(+r/1e3);return vr(n,e.length)},T:function(r,e,t){return vr(+r,e.length)}}});var Fle,Ole,QZe,Lle,zle=y(()=>{Fle=(r,e)=>{switch(r){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Ole=(r,e)=>{switch(r){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},QZe=(r,e)=>{let t=r.match(/(P+)(p+)?/)||[],n=t[1],a=t[2];if(!a)return Fle(r,e);let i;switch(n){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",Fle(n,e)).replace("{{time}}",Ole(a,e))},Lle={p:Ole,P:QZe}});function jle(r){return JZe.test(r)}function $le(r){return XZe.test(r)}function Ble(r,e,t){let n=tQe(r,e,t);if(console.warn(n),eQe.includes(r))throw new RangeError(n)}function tQe(r,e,t){let n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var JZe,XZe,eQe,Ule=y(()=>{JZe=/^D+$/,XZe=/^Y+$/,eQe=["D","DD","YY","YYYY"]});function M(r,e,t){var d,u,p,m,f,h,g,v,b,k,w,S,C,E,D,P,O,z;let n=wc(),a=(u=(d=t==null?void 0:t.locale)!=null?d:n.locale)!=null?u:xB,i=(k=(b=(h=(f=t==null?void 0:t.firstWeekContainsDate)!=null?f:(m=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)!=null?h:n.firstWeekContainsDate)!=null?b:(v=(g=n.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)!=null?k:1,s=(z=(O=(E=(C=t==null?void 0:t.weekStartsOn)!=null?C:(S=(w=t==null?void 0:t.locale)==null?void 0:w.options)==null?void 0:S.weekStartsOn)!=null?E:n.weekStartsOn)!=null?O:(P=(D=n.locale)==null?void 0:D.options)==null?void 0:P.weekStartsOn)!=null?z:0,o=ft(r,t==null?void 0:t.in);if(!Ca(o))throw new RangeError("Invalid time value");let l=e.match(nQe).map(R=>{let A=R[0];if(A==="p"||A==="P"){let F=Lle[A];return F(R,a.formatLong)}return R}).join("").match(rQe).map(R=>{if(R==="''")return{isToken:!1,value:"'"};let A=R[0];if(A==="'")return{isToken:!1,value:oQe(R)};if(AB[A])return{isToken:!0,value:R};if(A.match(sQe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+A+"`");return{isToken:!1,value:R}});a.localize.preprocessor&&(l=a.localize.preprocessor(o,l));let c={firstWeekContainsDate:i,weekStartsOn:s,locale:a};return l.map(R=>{if(!R.isToken)return R.value;let A=R.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&$le(A)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&jle(A))&&Ble(A,e,String(r));let F=AB[A[0]];return F(o,A,a.localize,c)}).join("")}function oQe(r){let e=r.match(aQe);return e?e[1].replace(iQe,"'"):r}var rQe,nQe,aQe,iQe,sQe,Hle=y(()=>{Ele();gv();Rle();zle();Ule();wB();Nn();rQe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nQe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,aQe=/^'([^]*?)'?$/,iQe=/''/g,sQe=/[a-zA-Z]/});var Vle=y(()=>{});var qle=y(()=>{});var Wle=y(()=>{});var Yle=y(()=>{});var Gle=y(()=>{});var Kle=y(()=>{});var Zle=y(()=>{});var Qle=y(()=>{});var Jle=y(()=>{});var Xle=y(()=>{});var ece=y(()=>{});var tce=y(()=>{});var rce=y(()=>{});var nce=y(()=>{});var ace=y(()=>{});var ice=y(()=>{});var sce=y(()=>{});var oce=y(()=>{});var lce=y(()=>{});var cce=y(()=>{});var dce=y(()=>{});var uce=y(()=>{});var pce=y(()=>{});var mce=y(()=>{});var fce=y(()=>{});var hce=y(()=>{});var gce=y(()=>{});var yce=y(()=>{});var vce=y(()=>{});var kce=y(()=>{});var bce=y(()=>{});var Tce=y(()=>{});var wce=y(()=>{});var Sce=y(()=>{});var xce=y(()=>{});var Cce=y(()=>{});var Ece=y(()=>{});var Dce=y(()=>{});var Pce=y(()=>{});var Mce=y(()=>{});var Ace=y(()=>{});function _B(r,e){return+ft(r)<+ft(e)}var _ce=y(()=>{Nn()});var Ice=y(()=>{});var Nce=y(()=>{});var Rce=y(()=>{});var Fce=y(()=>{});var Oce=y(()=>{});var Lce=y(()=>{});var zce=y(()=>{});var jce=y(()=>{});var $ce=y(()=>{});var Bce=y(()=>{});var Uce=y(()=>{});var Hce=y(()=>{});var Vce=y(()=>{});var qce=y(()=>{});var Wce=y(()=>{});var Yce=y(()=>{});var Gce=y(()=>{});var Kce=y(()=>{});var Zce=y(()=>{});var Qce=y(()=>{});var Jce=y(()=>{});var Xce=y(()=>{});var ede=y(()=>{});var tde=y(()=>{});var rde=y(()=>{});var nde=y(()=>{});var ade=y(()=>{});var ide=y(()=>{});var sde=y(()=>{});var ode=y(()=>{});var lde=y(()=>{});var cde=y(()=>{});var dde=y(()=>{});var ude=y(()=>{});var pde=y(()=>{});var mde=y(()=>{});var fde=y(()=>{});var hde=y(()=>{});var gde=y(()=>{});var yde=y(()=>{});function wv(r,e,t){return yh(r,-e,t)}var vde=y(()=>{FA()});var kde=y(()=>{});var bde=y(()=>{});var Tde=y(()=>{});var wde=y(()=>{});var Sde=y(()=>{});var xde=y(()=>{});var Cde=y(()=>{});var Ede=y(()=>{});var Dde=y(()=>{});var Pde=y(()=>{});var Mde=y(()=>{});var Ade=y(()=>{});var _de=y(()=>{});var Ide=y(()=>{});var Nde=y(()=>{});var Rde=y(()=>{});var Fde=y(()=>{});var Ode=y(()=>{});var Lde=y(()=>{});var zde=y(()=>{});var jde=y(()=>{});var $de=y(()=>{});var Bde=y(()=>{});var Ude=y(()=>{});var Hde=y(()=>{});function Us(r,e){var c;let t=()=>Bn(e==null?void 0:e.in,NaN),n=(c=e==null?void 0:e.additionalDigits)!=null?c:2,a=uQe(r),i;if(a.date){let d=pQe(a.date,n);i=mQe(d.restDateString,d.year)}if(!i||isNaN(+i))return t();let s=+i,o=0,l;if(a.time&&(o=fQe(a.time),isNaN(o)))return t();if(a.timezone){if(l=hQe(a.timezone),isNaN(l))return t()}else{let d=new Date(s+o),u=ft(0,e==null?void 0:e.in);return u.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),u.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),u}return ft(s+o+l,e==null?void 0:e.in)}function uQe(r){let e={},t=r.split(YA.dateTimeDelimiter),n;if(t.length>2)return e;if(/:/.test(t[0])?n=t[0]:(e.date=t[0],n=t[1],YA.timeZoneDelimiter.test(e.date)&&(e.date=r.split(YA.timeZoneDelimiter)[0],n=r.substr(e.date.length,r.length))),n){let a=YA.timezone.exec(n);a?(e.time=n.replace(a[1],""),e.timezone=a[1]):e.time=n}return e}function pQe(r,e){let t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=r.match(t);if(!n)return{year:NaN,restDateString:""};let a=n[1]?parseInt(n[1]):null,i=n[2]?parseInt(n[2]):null;return{year:i===null?a:i*100,restDateString:r.slice((n[1]||n[2]).length)}}function mQe(r,e){if(e===null)return new Date(NaN);let t=r.match(lQe);if(!t)return new Date(NaN);let n=!!t[4],a=iS(t[1]),i=iS(t[2])-1,s=iS(t[3]),o=iS(t[4]),l=iS(t[5])-1;if(n)return bQe(e,o,l)?gQe(e,o,l):new Date(NaN);{let c=new Date(0);return!vQe(e,i,s)||!kQe(e,a)?new Date(NaN):(c.setUTCFullYear(e,i,Math.max(a,s)),c)}}function iS(r){return r?parseInt(r):1}function fQe(r){let e=r.match(cQe);if(!e)return NaN;let t=IB(e[1]),n=IB(e[2]),a=IB(e[3]);return TQe(t,n,a)?t*mB+n*pB+a*1e3:NaN}function IB(r){return r&&parseFloat(r.replace(",","."))||0}function hQe(r){if(r==="Z")return 0;let e=r.match(dQe);if(!e)return 0;let t=e[1]==="+"?-1:1,n=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return wQe(n,a)?t*(n*mB+a*pB):NaN}function gQe(r,e,t){let n=new Date(0);n.setUTCFullYear(r,0,4);let a=n.getUTCDay()||7,i=(e-1)*7+t+1-a;return n.setUTCDate(n.getUTCDate()+i),n}function Vde(r){return r%400===0||r%4===0&&r%100!==0}function vQe(r,e,t){return e>=0&&e<=11&&t>=1&&t<=(yQe[e]||(Vde(r)?29:28))}function kQe(r,e){return e>=1&&e<=(Vde(r)?366:365)}function bQe(r,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function TQe(r,e,t){return r===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&r>=0&&r<25}function wQe(r,e){return e>=0&&e<=59}var YA,lQe,cQe,dQe,yQe,qde=y(()=>{hv();Pl();Nn();YA={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},lQe=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,cQe=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,dQe=/^([+-])(\d{2})(?::?(\d{2}))?$/;yQe=[31,null,31,30,31,30,31,31,30,31,30,31]});var Wde=y(()=>{});var Yde=y(()=>{});var Gde=y(()=>{});var Kde=y(()=>{});var Zde=y(()=>{});var Qde=y(()=>{});var Jde=y(()=>{});var Xde=y(()=>{});var eue=y(()=>{});var tue=y(()=>{});var rue=y(()=>{});var nue=y(()=>{});var aue=y(()=>{});var iue=y(()=>{});var sue=y(()=>{});var oue=y(()=>{});var lue=y(()=>{});var cue=y(()=>{});var due=y(()=>{});var uue=y(()=>{});var pue=y(()=>{});var mue=y(()=>{});var fue=y(()=>{});var hue=y(()=>{});var gue=y(()=>{});var yue=y(()=>{});var vue=y(()=>{});var kue=y(()=>{});var bue=y(()=>{});var Tue=y(()=>{});var wue=y(()=>{});var Sue=y(()=>{});var xue=y(()=>{});var Cue=y(()=>{});var Eue=y(()=>{});var Due=y(()=>{});var Pue=y(()=>{});var Mue=y(()=>{});var Aue=y(()=>{});var _ue=y(()=>{});var Iue=y(()=>{});var Nue=y(()=>{});var Rue=y(()=>{});var Fue=y(()=>{});var Oue=y(()=>{});var Lue=y(()=>{});var Wr=y(()=>{$se();Vse();FA();Wse();Qse();qse();Jse();hB();Xse();eoe();roe();aoe();ioe();loe();coe();doe();uoe();poe();Pl();moe();foe();yoe();vB();voe();koe();boe();woe();Soe();xoe();Coe();Eoe();Poe();Moe();Aoe();Roe();Foe();Ooe();Loe();zoe();joe();$oe();Boe();Uoe();Voe();qoe();Woe();Goe();Qoe();Joe();_oe();Xoe();ele();rle();nle();ale();Ioe();ile();sle();ole();lle();tle();Zoe();cle();Hle();Vle();qle();Wle();Yle();Gle();Kle();Zle();Qle();Jle();Xle();ece();tce();rce();nce();CB();ace();sce();oce();lce();cce();dce();EB();zA();uce();pce();mce();fce();hce();Toe();gce();yce();vce();PB();kce();WA();Tce();wce();Sce();xce();Cce();Ece();Dce();Pce();Mce();Ace();_ce();TB();Ice();Nce();Rce();Fce();Oce();Noe();ice();Hce();Vce();qce();hoe();Yce();Kce();Zce();Jce();Xce();ede();rde();Gce();nde();Bse();Use();ade();ide();sde();ode();lde();cde();dde();ude();pde();mde();fde();hde();wB();gde();Hse();yde();kde();bde();wde();Sde();bce();xde();Tde();Cde();Ede();soe();Dde();Pde();Mde();Ade();ooe();_de();Ide();Nde();Rde();Fde();Ode();Lde();zde();jde();$de();Bde();Ude();Hde();Uce();qde();Wde();Yde();Gde();Kde();Zde();Qde();Jde();Xde();eue();tue();rue();nue();aue();iue();sue();oue();cue();due();$ce();uue();pue();mue();Bce();jce();Zse();fue();hue();lue();gue();yue();zce();vue();kue();$A();bue();Wce();nS();kB();Qce();Yoe();Hoe();tde();Tue();wue();yv();DB();SB();Sue();Cue();Eue();vde();Due();Doe();Pue();Mue();xue();Aue();_ue();Iue();Nue();Nn();Lce();Rue();Fue();Oue();Lue()});var iu=x(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});var Tn=require("obsidian"),NB="YYYY-MM-DD",RB="gggg-[W]ww",zue="YYYY-MM",jue="YYYY-[Q]Q",$ue="YYYY";function sS(r){var t,n;let e=window.app.plugins.getPlugin("periodic-notes");return e&&((n=(t=e.settings)==null?void 0:t[r])==null?void 0:n.enabled)}function oS(){var r,e,t,n;try{let{internalPlugins:a,plugins:i}=window.app;if(sS("daily")){let{format:c,folder:d,template:u}=((e=(r=i.getPlugin("periodic-notes"))==null?void 0:r.settings)==null?void 0:e.daily)||{};return{format:c||NB,folder:(d==null?void 0:d.trim())||"",template:(u==null?void 0:u.trim())||""}}let{folder:s,format:o,template:l}=((n=(t=a.getPluginById("daily-notes"))==null?void 0:t.instance)==null?void 0:n.options)||{};return{format:o||NB,folder:(s==null?void 0:s.trim())||"",template:(l==null?void 0:l.trim())||""}}catch(a){console.info("No custom daily note settings found!",a)}}function lS(){var r,e,t,n,a,i,s;try{let o=window.app.plugins,l=(r=o.getPlugin("calendar"))==null?void 0:r.options,c=(t=(e=o.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.weekly;if(sS("weekly"))return{format:c.format||RB,folder:((n=c.folder)==null?void 0:n.trim())||"",template:((a=c.template)==null?void 0:a.trim())||""};let d=l||{};return{format:d.weeklyNoteFormat||RB,folder:((i=d.weeklyNoteFolder)==null?void 0:i.trim())||"",template:((s=d.weeklyNoteTemplate)==null?void 0:s.trim())||""}}catch(o){console.info("No custom weekly note settings found!",o)}}function cS(){var e,t,n,a;let r=window.app.plugins;try{let i=sS("monthly")&&((t=(e=r.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.monthly)||{};return{format:i.format||zue,folder:((n=i.folder)==null?void 0:n.trim())||"",template:((a=i.template)==null?void 0:a.trim())||""}}catch(i){console.info("No custom monthly note settings found!",i)}}function dS(){var e,t,n,a;let r=window.app.plugins;try{let i=sS("quarterly")&&((t=(e=r.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.quarterly)||{};return{format:i.format||jue,folder:((n=i.folder)==null?void 0:n.trim())||"",template:((a=i.template)==null?void 0:a.trim())||""}}catch(i){console.info("No custom quarterly note settings found!",i)}}function uS(){var e,t,n,a;let r=window.app.plugins;try{let i=sS("yearly")&&((t=(e=r.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.yearly)||{};return{format:i.format||$ue,folder:((n=i.folder)==null?void 0:n.trim())||"",template:((a=i.template)==null?void 0:a.trim())||""}}catch(i){console.info("No custom yearly note settings found!",i)}}function Bue(...r){let e=[];for(let n=0,a=r.length;n{let b=n(),k=r.clone().set({hour:b.get("hour"),minute:b.get("minute"),second:b.get("second")});return f&&k.add(parseInt(h,10),g),v?k.format(v.substring(1).trim()):k.format(i)}).replace(/{{\s*yesterday\s*}}/gi,r.clone().subtract(1,"day").format(i)).replace(/{{\s*tomorrow\s*}}/gi,r.clone().add(1,"d").format(i)));return e.foldManager.save(u,l),u}catch(u){console.error(`Failed to create file: '${d}'`,u),new Tn.Notice("Unable to create new file.")}}function DQe(r,e){var t;return(t=e[Al(r,"day")])!=null?t:null}function PQe(){let{vault:r}=window.app,{folder:e}=oS(),t=r.getAbstractFileByPath(Tn.normalizePath(e));if(!t)throw new FB("Failed to find daily notes folder");let n={};return Tn.Vault.recurseChildren(t,a=>{if(a instanceof Tn.TFile){let i=xv(a,"day");if(i){let s=Al(i,"day");n[s]=a}}}),n}var OB=class extends Error{};function MQe(){let{moment:r}=window,e=r.localeData()._week.dow,t=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;e;)t.push(t.shift()),e--;return t}function AQe(r){return MQe().indexOf(r.toLowerCase())}async function que(r){let{vault:e}=window.app,{template:t,format:n,folder:a}=lS(),[i,s]=await Sv(t),o=r.format(n),l=await pS(a,o);try{let c=await e.create(l,i.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,u,p,m,f,h)=>{let g=window.moment(),v=r.clone().set({hour:g.get("hour"),minute:g.get("minute"),second:g.get("second")});return p&&v.add(parseInt(m,10),f),h?v.format(h.substring(1).trim()):v.format(n)}).replace(/{{\s*title\s*}}/gi,o).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(d,u,p)=>{let m=AQe(u);return r.weekday(m).format(p.trim())}));return window.app.foldManager.save(c,s),c}catch(c){console.error(`Failed to create file: '${l}'`,c),new Tn.Notice("Unable to create new file.")}}function _Qe(r,e){var t;return(t=e[Al(r,"week")])!=null?t:null}function IQe(){let r={};if(!Yue())return r;let{vault:e}=window.app,{folder:t}=lS(),n=e.getAbstractFileByPath(Tn.normalizePath(t));if(!n)throw new OB("Failed to find weekly notes folder");return Tn.Vault.recurseChildren(n,a=>{if(a instanceof Tn.TFile){let i=xv(a,"week");if(i){let s=Al(i,"week");r[s]=a}}}),r}var LB=class extends Error{};async function Wue(r){let{vault:e}=window.app,{template:t,format:n,folder:a}=cS(),[i,s]=await Sv(t),o=r.format(n),l=await pS(a,o);try{let c=await e.create(l,i.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,u,p,m,f,h)=>{let g=window.moment(),v=r.clone().set({hour:g.get("hour"),minute:g.get("minute"),second:g.get("second")});return p&&v.add(parseInt(m,10),f),h?v.format(h.substring(1).trim()):v.format(n)}).replace(/{{\s*date\s*}}/gi,o).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,o));return window.app.foldManager.save(c,s),c}catch(c){console.error(`Failed to create file: '${l}'`,c),new Tn.Notice("Unable to create new file.")}}function NQe(r,e){var t;return(t=e[Al(r,"month")])!=null?t:null}function RQe(){let r={};if(!Gue())return r;let{vault:e}=window.app,{folder:t}=cS(),n=e.getAbstractFileByPath(Tn.normalizePath(t));if(!n)throw new LB("Failed to find monthly notes folder");return Tn.Vault.recurseChildren(n,a=>{if(a instanceof Tn.TFile){let i=xv(a,"month");if(i){let s=Al(i,"month");r[s]=a}}}),r}var zB=class extends Error{};async function FQe(r){let{vault:e}=window.app,{template:t,format:n,folder:a}=dS(),[i,s]=await Sv(t),o=r.format(n),l=await pS(a,o);try{let c=await e.create(l,i.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,u,p,m,f,h)=>{let g=window.moment(),v=r.clone().set({hour:g.get("hour"),minute:g.get("minute"),second:g.get("second")});return p&&v.add(parseInt(m,10),f),h?v.format(h.substring(1).trim()):v.format(n)}).replace(/{{\s*date\s*}}/gi,o).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,o));return window.app.foldManager.save(c,s),c}catch(c){console.error(`Failed to create file: '${l}'`,c),new Tn.Notice("Unable to create new file.")}}function OQe(r,e){var t;return(t=e[Al(r,"quarter")])!=null?t:null}function LQe(){let r={};if(!Kue())return r;let{vault:e}=window.app,{folder:t}=dS(),n=e.getAbstractFileByPath(Tn.normalizePath(t));if(!n)throw new zB("Failed to find quarterly notes folder");return Tn.Vault.recurseChildren(n,a=>{if(a instanceof Tn.TFile){let i=xv(a,"quarter");if(i){let s=Al(i,"quarter");r[s]=a}}}),r}var jB=class extends Error{};async function zQe(r){let{vault:e}=window.app,{template:t,format:n,folder:a}=uS(),[i,s]=await Sv(t),o=r.format(n),l=await pS(a,o);try{let c=await e.create(l,i.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,u,p,m,f,h)=>{let g=window.moment(),v=r.clone().set({hour:g.get("hour"),minute:g.get("minute"),second:g.get("second")});return p&&v.add(parseInt(m,10),f),h?v.format(h.substring(1).trim()):v.format(n)}).replace(/{{\s*date\s*}}/gi,o).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,o));return window.app.foldManager.save(c,s),c}catch(c){console.error(`Failed to create file: '${l}'`,c),new Tn.Notice("Unable to create new file.")}}function jQe(r,e){var t;return(t=e[Al(r,"year")])!=null?t:null}function $Qe(){let r={};if(!Zue())return r;let{vault:e}=window.app,{folder:t}=uS(),n=e.getAbstractFileByPath(Tn.normalizePath(t));if(!n)throw new jB("Failed to find yearly notes folder");return Tn.Vault.recurseChildren(n,a=>{if(a instanceof Tn.TFile){let i=xv(a,"year");if(i){let s=Al(i,"year");r[s]=a}}}),r}function BQe(){var n,a;let{app:r}=window,e=r.internalPlugins.plugins["daily-notes"];if(e&&e.enabled)return!0;let t=r.plugins.getPlugin("periodic-notes");return t&&((a=(n=t.settings)==null?void 0:n.daily)==null?void 0:a.enabled)}function Yue(){var t,n;let{app:r}=window;if(r.plugins.getPlugin("calendar"))return!0;let e=r.plugins.getPlugin("periodic-notes");return e&&((n=(t=e.settings)==null?void 0:t.weekly)==null?void 0:n.enabled)}function Gue(){var t,n;let{app:r}=window,e=r.plugins.getPlugin("periodic-notes");return e&&((n=(t=e.settings)==null?void 0:t.monthly)==null?void 0:n.enabled)}function Kue(){var t,n;let{app:r}=window,e=r.plugins.getPlugin("periodic-notes");return e&&((n=(t=e.settings)==null?void 0:t.quarterly)==null?void 0:n.enabled)}function Zue(){var t,n;let{app:r}=window,e=r.plugins.getPlugin("periodic-notes");return e&&((n=(t=e.settings)==null?void 0:t.yearly)==null?void 0:n.enabled)}function UQe(r){let e={day:oS,week:lS,month:cS,quarter:dS,year:uS}[r];return e()}function HQe(r,e){return{day:Vue,month:Wue,week:que}[r](e)}_t.DEFAULT_DAILY_NOTE_FORMAT=NB;_t.DEFAULT_MONTHLY_NOTE_FORMAT=zue;_t.DEFAULT_QUARTERLY_NOTE_FORMAT=jue;_t.DEFAULT_WEEKLY_NOTE_FORMAT=RB;_t.DEFAULT_YEARLY_NOTE_FORMAT=$ue;_t.appHasDailyNotesPluginLoaded=BQe;_t.appHasMonthlyNotesPluginLoaded=Gue;_t.appHasQuarterlyNotesPluginLoaded=Kue;_t.appHasWeeklyNotesPluginLoaded=Yue;_t.appHasYearlyNotesPluginLoaded=Zue;_t.createDailyNote=Vue;_t.createMonthlyNote=Wue;_t.createPeriodicNote=HQe;_t.createQuarterlyNote=FQe;_t.createWeeklyNote=que;_t.createYearlyNote=zQe;_t.getAllDailyNotes=PQe;_t.getAllMonthlyNotes=RQe;_t.getAllQuarterlyNotes=LQe;_t.getAllWeeklyNotes=IQe;_t.getAllYearlyNotes=$Qe;_t.getDailyNote=DQe;_t.getDailyNoteSettings=oS;_t.getDateFromFile=xv;_t.getDateFromPath=EQe;_t.getDateUID=Al;_t.getMonthlyNote=NQe;_t.getMonthlyNoteSettings=cS;_t.getPeriodicNoteSettings=UQe;_t.getQuarterlyNote=OQe;_t.getQuarterlyNoteSettings=dS;_t.getTemplateInfo=Sv;_t.getWeeklyNote=_Qe;_t.getWeeklyNoteSettings=lS;_t.getYearlyNote=jQe;_t.getYearlyNoteSettings=uS});function Que(r){return r.replace(/\\/g,"/").replace(/^\/+/,"").replace(/\/+$/,"")}function Sc(r){let e=Array.isArray(r)?r:typeof r=="string"?r.split(","):[];return Array.from(new Set(e.map(t=>Que(t.trim())).filter(t=>t.length>0)))}function Cv(r,e){let t=Que(r);return e.some(n=>t===n||t.startsWith(`${n}/`))}var mS=y(()=>{});function VQe(r){let e=r.toLowerCase();return e==="true"||e==="false"?e==="true":r}function fS(r){let e=r.trim();return(e.startsWith("#")?e.slice(1).trim():e).replace(/\s+/g,"-")}function $B(r){return r.trim().toLowerCase()==="tags"}function qQe(r){return typeof r=="string"&&r.trim().length===0}function Jue(r,e){return r===e}function xc(r){let e=[],t=new Set,n=a=>{let i=fS(String(a));!i||t.has(i)||(t.add(i),e.push(i))};return Array.isArray(r)?(r.forEach(n),e):typeof r=="string"&&r.trim().length>0?(n(r),e):[]}function Ev(r,e,t){if(!e||!t)return;if($B(e)){let i=xc(r.tags),s=fS(t);i.some(l=>fS(l)===s)||i.push(s),r.tags=i;return}let n=VQe(t),a=r[e];if(Array.isArray(a)){a.some(i=>Jue(i,n))||a.push(n),r[e]=a;return}if(a==null||qQe(a)){r[e]=n;return}if(Jue(a,n)){r[e]=a;return}r[e]=[a,n]}var Dv=y(()=>{});var ipe,spe,su,Pv,Mv,ii,ot,is,ou,lu,cu,Ri,Wp,ope,lpe,Yr=y(()=>{ipe="tasknotes-mini-calendar-view",spe="tasknotes-agenda-view",su="tasknotes-pomodoro-view",Pv="tasknotes-pomodoro-stats-view",Mv="tasknotes-stats-view",ii="data-changed",ot="task-updated",is="task-deleted",ou="pomodoro-start",lu="pomodoro-complete",cu="pomodoro-interrupt",Ri="pomodoro-tick",Wp="date-changed",ope=[{id:"title",label:"Title",category:"text",supportedOperators:["is","is-not","contains","does-not-contain","is-empty","is-not-empty"],valueInputType:"text"},{id:"path",label:"Path",category:"select",supportedOperators:["contains","does-not-contain","is-empty","is-not-empty"],valueInputType:"select"},{id:"status",label:"Status",category:"select",supportedOperators:["is","is-not","is-empty","is-not-empty"],valueInputType:"select"},{id:"priority",label:"Priority",category:"select",supportedOperators:["is","is-not","is-empty","is-not-empty"],valueInputType:"select"},{id:"tags",label:"Tags",category:"select",supportedOperators:["contains","does-not-contain","is-empty","is-not-empty"],valueInputType:"select"},{id:"contexts",label:"Contexts",category:"select",supportedOperators:["contains","does-not-contain","is-empty","is-not-empty"],valueInputType:"select"},{id:"projects",label:"Projects",category:"select",supportedOperators:["contains","does-not-contain","is-empty","is-not-empty"],valueInputType:"select"},{id:"blockedBy",label:"Blocked By",category:"select",supportedOperators:["contains","does-not-contain","is-empty","is-not-empty"],valueInputType:"text"},{id:"blocking",label:"Blocking",category:"select",supportedOperators:["contains","does-not-contain","is-empty","is-not-empty"],valueInputType:"text"},{id:"due",label:"Due Date",category:"date",supportedOperators:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],valueInputType:"date"},{id:"scheduled",label:"Scheduled Date",category:"date",supportedOperators:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],valueInputType:"date"},{id:"completedDate",label:"Completed Date",category:"date",supportedOperators:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],valueInputType:"date"},{id:"dateCreated",label:"Created Date",category:"date",supportedOperators:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],valueInputType:"date"},{id:"dateModified",label:"Modified Date",category:"date",supportedOperators:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],valueInputType:"date"},{id:"archived",label:"Archived",category:"boolean",supportedOperators:["is-checked","is-not-checked"],valueInputType:"none"},{id:"hasSubtasks",label:"Has Subtasks",category:"boolean",supportedOperators:["is-checked","is-not-checked"],valueInputType:"none"},{id:"timeEstimate",label:"Time Estimate",category:"numeric",supportedOperators:["is","is-not","is-greater-than","is-less-than","is-greater-than-or-equal","is-less-than-or-equal"],valueInputType:"number"},{id:"recurrence",label:"Recurrence",category:"special",supportedOperators:["is-empty","is-not-empty"],valueInputType:"none"},{id:"status.isCompleted",label:"Completed",category:"boolean",supportedOperators:["is-checked","is-not-checked"],valueInputType:"none"},{id:"dependencies.isBlocked",label:"Blocked",category:"boolean",supportedOperators:["is-checked","is-not-checked"],valueInputType:"none"},{id:"dependencies.isBlocking",label:"Blocking Others",category:"boolean",supportedOperators:["is-checked","is-not-checked"],valueInputType:"none"}],lpe=[{id:"is",label:"is",requiresValue:!0},{id:"is-not",label:"is not",requiresValue:!0},{id:"contains",label:"contains",requiresValue:!0},{id:"does-not-contain",label:"does not contain",requiresValue:!0},{id:"is-before",label:"is before",requiresValue:!0},{id:"is-after",label:"is after",requiresValue:!0},{id:"is-on-or-before",label:"is on or before",requiresValue:!0},{id:"is-on-or-after",label:"is on or after",requiresValue:!0},{id:"is-empty",label:"is empty",requiresValue:!1},{id:"is-not-empty",label:"is not empty",requiresValue:!1},{id:"is-checked",label:"is checked",requiresValue:!1},{id:"is-not-checked",label:"is not checked",requiresValue:!1},{id:"is-greater-than",label:"is greater than",requiresValue:!0},{id:"is-less-than",label:"is less than",requiresValue:!0},{id:"is-greater-than-or-equal",label:"is equal or greater than",requiresValue:!0},{id:"is-less-than-or-equal",label:"is equal or less than",requiresValue:!0}]});var fpe={};at(fpe,{DEFAULT_CORE_FIELDS:()=>dpe,DEFAULT_FIELD_GROUPS:()=>cpe,createDefaultFieldConfig:()=>upe,getFieldsByGroup:()=>rJe,getFieldsForModal:()=>ppe,initializeFieldConfig:()=>Cc,migrateUserFieldsToFieldConfig:()=>mpe});function upe(){return{version:1,fields:[...dpe],groups:[...cpe]}}function ppe(r,e){return r.fields.filter(t=>t.enabled).filter(t=>e?t.visibleInCreation:t.visibleInEdit).sort((t,n)=>{var o,l;let a=r.groups.find(c=>c.id===t.group),i=r.groups.find(c=>c.id===n.group),s=((o=a==null?void 0:a.order)!=null?o:0)-((l=i==null?void 0:i.order)!=null?l:0);return s!==0?s:t.order-n.order})}function rJe(r,e){let t=ppe(r,e),n=new Map;for(let a of t){let i=n.get(a.group)||[];i.push(a),n.set(a.group,i)}return n}function mpe(r){return!r||r.length===0?[]:r.map((e,t)=>({id:e.id||`user-${t}`,fieldType:"user",group:"custom",displayName:e.displayName||`Field ${t+1}`,visibleInCreation:!0,visibleInEdit:!0,order:t,enabled:!0}))}function Cc(r,e){if(r)return r;let t=upe();if(e&&e.length>0){let n=mpe(e);t.fields.push(...n)}return t}var cpe,dpe,vS=y(()=>{cpe=[{id:"basic",displayName:"Basic Information",order:0,collapsible:!1,defaultCollapsed:!1},{id:"metadata",displayName:"Metadata",order:1,collapsible:!0,defaultCollapsed:!1},{id:"organization",displayName:"Organization",order:2,collapsible:!0,defaultCollapsed:!1},{id:"dependencies",displayName:"Dependencies",order:3,collapsible:!0,defaultCollapsed:!1},{id:"custom",displayName:"Custom Fields",order:4,collapsible:!0,defaultCollapsed:!1}],dpe=[{id:"title",fieldType:"core",group:"basic",displayName:"Title",visibleInCreation:!0,visibleInEdit:!0,order:0,enabled:!0,required:!0},{id:"details",fieldType:"core",group:"basic",displayName:"Details",visibleInCreation:!0,visibleInEdit:!0,order:1,enabled:!0},{id:"contexts",fieldType:"core",group:"metadata",displayName:"Contexts",visibleInCreation:!0,visibleInEdit:!0,order:0,enabled:!0},{id:"tags",fieldType:"core",group:"metadata",displayName:"Tags",visibleInCreation:!0,visibleInEdit:!0,order:1,enabled:!0},{id:"time-estimate",fieldType:"core",group:"metadata",displayName:"Time Estimate",visibleInCreation:!0,visibleInEdit:!0,order:2,enabled:!0},{id:"projects",fieldType:"organization",group:"organization",displayName:"Projects",visibleInCreation:!0,visibleInEdit:!0,order:0,enabled:!0},{id:"subtasks",fieldType:"organization",group:"organization",displayName:"Subtasks",visibleInCreation:!0,visibleInEdit:!0,order:1,enabled:!0},{id:"blocked-by",fieldType:"dependency",group:"dependencies",displayName:"Blocked By",visibleInCreation:!0,visibleInEdit:!0,order:0,enabled:!0},{id:"blocking",fieldType:"dependency",group:"dependencies",displayName:"Blocking",visibleInCreation:!0,visibleInEdit:!0,order:1,enabled:!0}]});function hpe(r,e,t){if(!(e!=null&&e.fields))return!0;let n=e.fields.find(i=>i.id===r);if(!n)return!0;let a=t?n.visibleInCreation:n.visibleInEdit;return!!n.enabled&&!!a}function gpe(r,e){let{getFieldsByGroup:t}=(vS(),NA(fpe)),n=t(r,e);return[...r.groups||[]].sort((i,s)=>i.order-s.order).map(i=>({id:i.id,fields:n.get(i.id)||[]})).filter(i=>i.fields.length>0)}var VB=y(()=>{});function qB(r){let{container:e,fieldConfig:t,fieldRenderers:n,renderUserField:a}=r,i=n[t.id];return i?(i(e,t),!0):t.fieldType==="user"?(a(e,t),!0):!1}function ype(r){let e=gpe(r.config,r.isCreationMode),t={groupsRendered:0,fieldsRendered:0,ignoredFieldIds:[]};for(let n of e){let a=n.id==="basic"?n.fields.filter(s=>!nJe.has(s.id)):n.fields;if(a.length===0)continue;let i=r.container.createDiv({cls:"task-modal__field-group"});t.groupsRendered+=1;for(let s of a)qB({container:i,fieldConfig:s,fieldRenderers:r.fieldRenderers,renderUserField:r.renderUserField})?t.fieldsRendered+=1:t.ignoredFieldIds.push(s.id)}return t}var nJe,vpe=y(()=>{VB();nJe=new Set(["title","details"])});function WB(r){let e=typeof r=="function"?r():r,t=e==null?void 0:e.trim();return t||null}function aJe(r,e,t={}){let n=["TaskNotes"],a=WB(r);return a&&n.push(a),t.category&&n.push(t.category),t.operation&&n.push(t.operation),`${n.map(i=>`[${i}]`).join("")} ${e}`}function GA(r,e,t,n,a){let i=[aJe(t,n,a)];a!=null&&a.details&&i.push(a.details),(a==null?void 0:a.error)!==void 0&&i.push(a.error),r[e](...i)}function N(r={}){var n,a;let e=(n=r.sink)!=null?n:console,t=(a=r.isDebugEnabled)!=null?a:(()=>!1);return{debug(i,s){t()&&GA(e,"debug",r.tag,i,s)},info(i,s){GA(e,"info",r.tag,i,s)},warn(i,s){GA(e,"warn",r.tag,i,s)},error(i,s){GA(e,"error",r.tag,i,s)},child(i){let s=r.tag;return N({...r,tag:()=>{let o=WB(s),l=WB(i);return[o,l].filter(Boolean).join("/")}})}}}var K=y(()=>{});function kpe(r,e){let t=Object.keys(e).map(n=>iJe(r,n,e[n]));return t.length===1?t[0]:function(){t.forEach(n=>n())}}function iJe(r,e,t){let n=r[e],a=r.hasOwnProperty(e),i=a?n:function(){return Object.getPrototypeOf(r)[e].apply(this,arguments)},s=t(i);return n&&Object.setPrototypeOf(s,n),Object.setPrototypeOf(o,s),r[e]=o,l;function o(...c){return s===i&&r[e]===o&&l(),s.apply(this,c)}function l(){r[e]===o&&(a?r[e]=i:delete r[e]),s!==i&&(s=i,Object.setPrototypeOf(o,n||Function))}}var bpe=y(()=>{});var KB={};at(KB,{EmbeddableMarkdownEditor:()=>GB,getMarkdownEditorTooltipParent:()=>wpe});function sJe(r){let e=r.workspace.getActiveFile();if(!(e instanceof KA.TFile))throw new Error("Cannot resolve markdown editor prototype without an active markdown file.");let t=r.embedRegistry.embedByExtension.md({app:r,containerEl:activeWindow.createDiv()},e,"");t.editable=!0,t.showEditor();let n=t.editMode;if(!n)throw t.unload(),new Error("Markdown editor edit mode was not initialized");let a=Object.getPrototypeOf(Object.getPrototypeOf(n));return t.unload(),a.constructor}function oJe(){return typeof app=="undefined"?class{constructor(e,t,n){this.containerEl=activeWindow.createDiv();this.editor={cm:new du.EditorView};this.editorEl=activeWindow.createDiv();this.owner={editMode:null,editor:null};this._loaded=!1;this.app=e,this.containerEl=t}set(e){let t=this.editor.cm;t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e}})}onUpdate(e,t){}buildLocalExtensions(){return[]}destroy(){}unload(){}}:sJe(app)}function wpe(r){var e,t;return(t=(e=r.ownerDocument)==null?void 0:e.body)!=null?t:activeDocument.body}var KA,Ec,du,Tpe,YB,GB,ZB=y(()=>{KA=require("obsidian"),Ec=require("@codemirror/state"),du=require("@codemirror/view");bpe();Tpe={cursorLocation:void 0,value:"",cls:"",placeholder:"",onEnter:()=>!1,onEscape:()=>{},onTab:()=>!1,onSubmit:()=>{},onBlur:()=>{},onPaste:()=>{},onChange:()=>{},extensions:[],enterVimInsertMode:!1,file:void 0};YB=class{constructor(e){this.view=e}getDoc(){return this}getValue(){return this.view.state.doc.toString()}setValue(e){this.view.dispatch({changes:{from:0,to:this.view.state.doc.length,insert:e}})}getLine(e){return this.view.state.doc.line(e+1).text}lineCount(){return this.view.state.doc.lines}lastLine(){return this.lineCount()-1}getSelection(){let e=this.view.state.selection.main;return this.view.state.doc.sliceString(e.from,e.to)}somethingSelected(){return!this.view.state.selection.main.empty}setHeading(e){let t=Math.max(0,Math.min(6,Number(e)||0)),n=t>0?`${"#".repeat(t)} `:"";this.updateSelectedLines(a=>{let i=a.replace(/^ {0,3}#{1,6}\s+/,"");return`${n}${i}`})}toggleBulletList(){let t=this.getSelectedLines().some(n=>/^\s*[-*+]\s+/.test(n.text));this.updateSelectedLines(n=>{var s;if(t)return n.replace(/^(\s*)[-*+]\s+/,"$1");let[,a="",i=""]=(s=n.match(/^(\s*)(.*)$/))!=null?s:[];return`${a}- ${i}`})}toggleNumberedList(){let t=this.getSelectedLines().some(n=>/^\s*\d+[.)]\s+/.test(n.text));this.updateSelectedLines((n,a)=>{var o;if(t)return n.replace(/^(\s*)\d+[.)]\s+/,"$1");let[,i="",s=""]=(o=n.match(/^(\s*)(.*)$/))!=null?o:[];return`${i}${a+1}. ${s}`})}toggleNumberList(){this.toggleNumberedList()}toggleCheckListStatus(){this.updateSelectedLines(e=>{var a;if(/^(\s*[-*+]\s+\[[ xX]\]\s*)/.test(e))return e.replace(/^(\s*[-*+]\s+\[)([ xX])(\]\s*)/,(i,s,o,l)=>`${s}${o.toLowerCase()==="x"?" ":"x"}${l}`);if(/^\s*[-*+]\s+/.test(e))return e.replace(/^(\s*[-*+]\s+)/,"$1[ ] ");let[,t="",n=""]=(a=e.match(/^(\s*)(.*)$/))!=null?a:[];return`${t}- [ ] ${n}`})}toggleCheckList(){this.toggleCheckListStatus()}getRange(e,t){return this.view.state.doc.sliceString(this.posToOffset(e),this.posToOffset(t))}replaceSelection(e){let t=this.view.state.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Ec.EditorSelection.cursor(n.from+e.length)}));this.view.dispatch(t)}replaceRange(e,t,n){this.view.dispatch({changes:{from:this.posToOffset(t),to:this.posToOffset(n!=null?n:t),insert:e}})}getCursor(e="head"){let t=this.view.state.selection.main;switch(e){case"from":return this.offsetToPos(t.from);case"to":return this.offsetToPos(t.to);case"anchor":return this.offsetToPos(t.anchor);case"head":default:return this.offsetToPos(t.head)}}listSelections(){return this.view.state.selection.ranges.map(e=>({anchor:this.offsetToPos(e.anchor),head:this.offsetToPos(e.head)}))}setCursor(e,t){if(typeof e=="number"){this.setSelection({line:e,ch:t!=null?t:0});return}this.setSelection(e)}setSelection(e,t){this.view.dispatch({selection:Ec.EditorSelection.range(this.posToOffset(e),this.posToOffset(t!=null?t:e))})}setSelections(e,t=0){e.length!==0&&this.view.dispatch({selection:Ec.EditorSelection.create(e.map(n=>{var a;return Ec.EditorSelection.range(this.posToOffset(n.anchor),this.posToOffset((a=n.head)!=null?a:n.anchor))}),t)})}focus(){this.view.focus()}blur(){this.view.contentDOM.blur()}hasFocus(){return this.view.hasFocus}transaction(e){var a,i;if(e.replaceSelection!==void 0){this.replaceSelection(e.replaceSelection);return}let t=(a=e.changes)==null?void 0:a.map(s=>{var o;return{from:this.posToOffset(s.from),to:this.posToOffset((o=s.to)!=null?o:s.from),insert:s.text}}),n=(i=e.selections)!=null?i:e.selection?[e.selection]:void 0;this.view.dispatch({...t?{changes:t}:{},...n&&n.length>0?{selection:Ec.EditorSelection.create(n.map(s=>{var o;return Ec.EditorSelection.range(this.posToOffset(s.from),this.posToOffset((o=s.to)!=null?o:s.from))}))}:{}})}posToOffset(e){let t=Math.max(1,Math.min(e.line+1,this.view.state.doc.lines)),n=this.view.state.doc.line(t);return Math.max(n.from,Math.min(n.from+e.ch,n.to))}offsetToPos(e){let t=Math.max(0,Math.min(e,this.view.state.doc.length)),n=this.view.state.doc.lineAt(t);return{line:n.number-1,ch:t-n.from}}getSelectedLines(){let e=this.view.state.doc,t=new Set;for(let n of this.view.state.selection.ranges){let a=Math.min(n.from,n.to),i=Math.max(n.from,n.to),s=e.lineAt(a).number,o=e.lineAt(i).number;o>s&&i===e.line(o).from&&(o-=1);for(let l=s;l<=o;l+=1)t.add(l)}return Array.from(t).sort((n,a)=>n-a).map(n=>{let a=e.line(n);return{number:n,text:a.text}})}updateSelectedLines(e){let t=this.view.state.doc,n=this.getSelectedLines().map((a,i)=>{let s=t.line(a.number);return{from:s.from,to:s.to,insert:e(a.text,i)}});n.length!==0&&this.view.dispatch({changes:n})}},GB=class extends oJe(){constructor(t,n,a={}){super(t,n,{app:t,onMarkdownScroll:()=>{},getMode:()=>"source"});this.hasEnteredVimInsertMode=!1;this.options={...Tpe,...a},this.initial_value=this.options.value,this.scope=new KA.Scope(this.app.scope),this.scope.register(["Mod"],"Enter",(i,s)=>!0),this.scope.register(["Mod","Shift"],"Enter",(i,s)=>!0),this.owner.editMode=this,this.owner.editor=this.editor,this.activeEditorOwner={editMode:this,editor:new YB(this.editor.cm),file:this.getActiveEditorFile(),getMode:()=>"source"},this.set(a.value||""),this.uninstaller=kpe(this.app.workspace,{setActiveLeaf:i=>function(...s){var o;(o=this.activeCM)!=null&&o.hasFocus||i.call(this,...s)}}),this.options.onBlur!==Tpe.onBlur&&this.editor.cm.contentDOM.addEventListener("blur",()=>{this.app.keymap.popScope(this.scope),this._loaded&&this.options.onBlur(this)}),this.editor.cm.contentDOM.addEventListener("focusin",()=>{this.app.keymap.pushScope(this.scope),this.activeEditorOwner.file=this.getActiveEditorFile(),this.app.workspace.activeEditor=this.activeEditorOwner,this.options.enterVimInsertMode&&!this.hasEnteredVimInsertMode&&(this.hasEnteredVimInsertMode=!0,this.enterVimInsertMode())}),a.cls&&this.editorEl.classList.add(a.cls),a.cursorLocation&&this.editor.cm.dispatch({selection:Ec.EditorSelection.range(a.cursorLocation.anchor,a.cursorLocation.head)})}getActiveEditorFile(){var t;return this.options.file!==void 0?(t=this.options.file)!=null?t:null:this.app.workspace.getActiveFile()}get value(){return this.editor.cm.state.doc.toString()}setValue(t){this.set(t)}enterVimInsertMode(){window.setTimeout(()=>{var t,n;try{if(!this.app.vault.getConfig("vimMode"))return;let i=(t=window.CodeMirrorAdapter)==null?void 0:t.Vim;if(!i)return;let s=(n=this.editor.cm.cm)!=null?n:this.activeCM;if(!s)return;i.handleKey(s,"i","api")}catch(a){}},50)}onUpdate(t,n){super.onUpdate(t,n),n&&this.options.onChange(this.value,t)}buildLocalExtensions(){let t=super.buildLocalExtensions();return t.push((0,du.tooltips)({parent:wpe(this.containerEl)})),this.options.placeholder&&t.push((0,du.placeholder)(this.options.placeholder)),t.push(du.EditorView.domEventHandlers({paste:n=>{this.options.onPaste(n,this)}})),t.push(Ec.Prec.highest(du.keymap.of([{key:"Enter",run:n=>this.options.onEnter(this,!1,!1),shift:n=>this.options.onEnter(this,!1,!0)},{key:"Shift-Mod-Enter",run:n=>(this.options.onSubmit(this,!0),!0)},{key:"Mod-Enter",run:n=>(this.options.onSubmit(this,!1),!0)},{key:"Escape",run:n=>(this.options.onEscape(this),!0)},{key:"Tab",run:n=>this.options.onTab(this,!1)},{key:"Shift-Tab",run:n=>this.options.onTab(this,!0)}]))),this.options.extensions&&this.options.extensions.length>0&&t.push(...this.options.extensions),t}destroy(){this._loaded&&this.unload(),this.app.keymap.popScope(this.scope);let t=this.app.workspace;t.activeEditor===this.activeEditorOwner&&(t.activeEditor=null),this.uninstaller&&(this.uninstaller(),this.uninstaller=void 0),this.containerEl.empty(),super.destroy()}onunload(){this.destroy()}}});function cJe(){return(ZB(),NA(KB)).EmbeddableMarkdownEditor}function ZA(r,e,t){try{let n=cJe();return new n(r,e,{...t,onSubmit:(a,i)=>t.onSubmit(i),onTab:(a,i)=>t.onTab(i)})}catch(n){lJe.error("Failed to create markdown editor:",{category:"persistence",operation:"create-markdown-editor",error:n});let a=e.createEl("textarea",{cls:t.cls+"-fallback",placeholder:t.placeholder});return a.value=t.value,a.addEventListener("input",i=>{t.onChange(i.target.value)}),a.addEventListener("keydown",i=>{i.key==="Enter"&&(i.ctrlKey||i.metaKey)?(i.preventDefault(),t.onSubmit(i.shiftKey)):i.key==="Escape"?(i.preventDefault(),t.onEscape()):i.key==="Tab"&&t.onTab(i.shiftKey)&&i.preventDefault()}),null}}var lJe,QB=y(()=>{K();lJe=N({tag:"Modals/TaskModalEditorAdapter"})});function Spe(r){var n;let e=r.parent.createDiv("detail-label");e.textContent=r.label;let t=r.parent.createDiv("tn-task-modal__markdown-editor tn-task-modal__markdown-editor--details");return ZA(r.app,t,{value:r.value,placeholder:r.placeholder,cls:"details-editor",onChange:r.onChange,onSubmit:r.onSubmit,onEscape:r.onEscape,onTab:a=>r.tabMovesFocus?a?r.focusPreviousField():r.focusNextField():!1,file:(n=r.file)!=null?n:null})}function xpe(r,e){r==null||r.setValue(e)}function Cpe(r){r==null||r.destroy()}var JB=y(()=>{QB()});function dJe(r){if(r==null)return;let t=(Array.isArray(r)?r:[r]).filter(n=>typeof n=="string").map(n=>n.trim()).filter(n=>n.length>0);return t.length>0?t:void 0}function _pe(r){let e=hJe(r),t=e.match(e2);if(t){let[,a,i,s]=t,o=Number(a),l=Number(i),c=Number(s);if(!Ipe(o,l,c))throw new Error(`Invalid date "${r}".`);return new Date(Date.UTC(o,l-1,c,0,0,0,0))}if(!gJe(e))throw new Error(`Invalid date "${r}".`);let n=new Date(e);if(!Npe(n))throw new Error(`Invalid date "${r}".`);return n}function pJe(r){if(!Npe(r))return"";let e=r.getUTCFullYear(),t=String(r.getUTCMonth()+1).padStart(2,"0"),n=String(r.getUTCDate()).padStart(2,"0");return`${e}-${t}-${n}`}function mJe(r){if(!/^\d{4}-\d{2}-\d{2}$/.test(r))throw new Error(`Invalid date "${r}". Expected YYYY-MM-DD.`);return _pe(r),r}function fJe(r){if(!r)return"";let e=r.trim();if(e2.test(e))return e;let t=e.indexOf("T");if(t>-1)return e.slice(0,t);let n=e.indexOf(" ");return n>-1&&e2.test(e.slice(0,n))?e.slice(0,n):pJe(_pe(e))}function Epe(r){let e=[],t=new Set;for(let n of r)if(typeof n=="string")try{let a=mJe(fJe(n.trim()));t.has(a)||(t.add(a),e.push(a))}catch(a){}return e}function hJe(r,e="Date string cannot be empty"){if(!r||r.trim().length===0)throw new Error(e);return r.trim()}function gJe(r){let e=r.match(uJe);if(!e)return!1;let[,t,n,a,i,s,o,,l,c,d]=e;return Ipe(Number(t),Number(n),Number(a))&&yJe(Number(i),Number(s),Number(o))&&vJe(l,c,d)}function Ipe(r,e,t){let n=new Date(Date.UTC(r,e-1,t,0,0,0,0));return n.getUTCFullYear()===r&&n.getUTCMonth()===e-1&&n.getUTCDate()===t}function yJe(r,e,t){return r>=0&&r<=23&&e>=0&&e<=59&&t>=0&&t<=59}function vJe(r,e,t){if(!r)return!0;let n=Number(e),a=Number(t);return!(n>14||a>59||n===14&&a!==0)}function Npe(r){return r instanceof Date&&!Number.isNaN(r.getTime())}function n2(r,e){return r[e]}function Fpe(r){if(typeof r=="string")return r;if(Array.isArray(r))return r.map(e=>String(e)).join(", ");if(r!=null){if(typeof r=="object")return"";if(typeof r=="number"||typeof r=="boolean")return String(r)}}function Yp(r,e=Mpe){return Bpe(Xn(r),e)}function Gp(r,e=Ape){return Bpe(Xn(r),e)}function XA(r){let e=[],t=new Set,n=a=>{let i=Ope(String(a));!i||t.has(i)||(t.add(i),e.push(i))};return Array.isArray(r)?(r.forEach(n),e):(typeof r=="string"&&r.trim().length>0&&n(r),e)}function Ope(r){let e=r.trim();return(e.startsWith("#")?e.slice(1).trim():e).replace(/\s+/g,"-")}function a2(r,e,t,n=!1,a=[],i=Mpe,s=Ape){if(!e)return{};let o={path:t};if(typeof e.id=="string"&&e.id.trim().length>0&&(o.id=e.id),e[r.title]!==void 0){let l=Fpe(e[r.title]);l!==void 0&&l.trim().length>0?o.title=l:o.title=Dpe(t)}else(n||t)&&(o.title=Dpe(t));if(e[r.status]!==void 0&&(o.status=Yp(e[r.status],i)),e[r.priority]!==void 0&&(o.priority=Gp(e[r.priority],s)),e[r.due]!==void 0&&(o.due=Xn(e[r.due])),e[r.scheduled]!==void 0&&(o.scheduled=Xn(e[r.scheduled])),e[r.contexts]!==void 0&&(o.contexts=QA(e[r.contexts])),e[r.projects]!==void 0&&(o.projects=QA(e[r.projects])),e[r.attachments]!==void 0&&(o.attachments=dJe(e[r.attachments])),e[r.timeEstimate]!==void 0&&(o.timeEstimate=kJe(e[r.timeEstimate])),e[r.completedDate]!==void 0&&(o.completedDate=Xn(e[r.completedDate])),e[r.recurrence]!==void 0&&(o.recurrence=Xn(e[r.recurrence])),e[r.recurrenceAnchor]!==void 0){let l=e[r.recurrenceAnchor];l==="scheduled"||l==="completion"?o.recurrence_anchor=l:l!=null&&!Upe(l)&&(o.recurrence_anchor="scheduled")}if(e[r.dateCreated]!==void 0&&(o.dateCreated=Xn(e[r.dateCreated])),e[r.dateModified]!==void 0&&(o.dateModified=Xn(e[r.dateModified])),e[r.timeEntries]!==void 0&&(o.timeEntries=Array.isArray(e[r.timeEntries])?e[r.timeEntries]:[]),e[r.completeInstances]!==void 0){let l=e[r.completeInstances];o.complete_instances=Epe(Array.isArray(l)?l:[l])}if(e[r.skippedInstances]!==void 0){let l=e[r.skippedInstances];o.skipped_instances=Epe(Array.isArray(l)?l:[l])}if(e[r.recurrenceParent]!==void 0&&(o.recurrence_parent=Xn(e[r.recurrenceParent])),e[r.occurrenceDate]!==void 0&&(o.occurrence_date=Xn(e[r.occurrenceDate])),e[r.occurrenceMaterialization]!==void 0){let l=Xn(e[r.occurrenceMaterialization]);(l==="manual"||l==="on_completion"||l==="rolling")&&(o.occurrence_materialization=l)}if(e[r.occurrenceNextTrigger]!==void 0){let l=Xn(e[r.occurrenceNextTrigger]);(l==="completion"||l==="completion_or_skip")&&(o.occurrence_next_trigger=l)}if(e[r.occurrenceTemplate]!==void 0&&(o.occurrence_template=Xn(e[r.occurrenceTemplate])),e[r.occurrencePastHorizon]!==void 0&&(o.occurrence_past_horizon=Xn(e[r.occurrencePastHorizon])),e[r.occurrenceFutureHorizon]!==void 0&&(o.occurrence_future_horizon=Xn(e[r.occurrenceFutureHorizon])),r.blockedBy&&e[r.blockedBy]!==void 0&&(o.blockedBy=jpe(e[r.blockedBy])),e[r.icsEventId]!==void 0&&(o.icsEventId=QA(e[r.icsEventId])),e[r.googleCalendarEventId]!==void 0&&(o.googleCalendarEventId=Xn(e[r.googleCalendarEventId])),e[r.googleCalendarExceptionEventId]!==void 0&&(o.googleCalendarExceptionEventId=Xn(e[r.googleCalendarExceptionEventId])),e[r.googleCalendarExceptionOriginalScheduled]!==void 0&&(o.googleCalendarExceptionOriginalScheduled=Xn(e[r.googleCalendarExceptionOriginalScheduled])),e[r.googleCalendarMovedOriginalDates]!==void 0&&(o.googleCalendarMovedOriginalDates=QA(e[r.googleCalendarMovedOriginalDates])),e[r.reminders]!==void 0&&(o.reminders=bJe(e[r.reminders])),e[r.sortOrder]!==void 0&&(o.sortOrder=Xn(e[r.sortOrder])),e.tags!==void 0){let l=XA(e.tags);o.tags=l,o.archived=l.includes(r2(r.archiveTag))}if(a.length>0){let l={},c=o;for(let d of a)e[d.key]!==void 0&&(c[d.key]=e[d.key],l[d.key]=e[d.key]);Object.keys(l).length>0&&(o.customProperties={...o.customProperties,...l})}return o}function i2(r,e,t,n=!1,a=[]){let i={};if(e.title!==void 0&&!n&&(i[r.title]=e.title),e.status!==void 0&&(i[r.status]=Lpe(e.status)),e.priority!==void 0&&(i[r.priority]=e.priority),e.due!==void 0&&(i[r.due]=e.due),e.scheduled!==void 0&&(i[r.scheduled]=e.scheduled),e.contexts!==void 0&&(!Array.isArray(e.contexts)||e.contexts.length>0)&&(i[r.contexts]=e.contexts),e.projects!==void 0&&(!Array.isArray(e.projects)||e.projects.length>0)&&(i[r.projects]=e.projects),e.attachments!==void 0&&e.attachments.length>0&&(i[r.attachments]=e.attachments),e.timeEstimate!==void 0&&(i[r.timeEstimate]=e.timeEstimate),e.completedDate!==void 0&&(i[r.completedDate]=e.completedDate),e.recurrence!==void 0&&(i[r.recurrence]=e.recurrence),e.recurrence_anchor!==void 0&&(i[r.recurrenceAnchor]=e.recurrence_anchor),e.recurrence_parent!==void 0&&(i[r.recurrenceParent]=e.recurrence_parent),e.occurrence_date!==void 0&&(i[r.occurrenceDate]=e.occurrence_date),e.occurrence_materialization!==void 0&&(i[r.occurrenceMaterialization]=e.occurrence_materialization),e.occurrence_next_trigger!==void 0&&(i[r.occurrenceNextTrigger]=e.occurrence_next_trigger),e.occurrence_template!==void 0&&(i[r.occurrenceTemplate]=e.occurrence_template),e.occurrence_past_horizon!==void 0&&(i[r.occurrencePastHorizon]=e.occurrence_past_horizon),e.occurrence_future_horizon!==void 0&&(i[r.occurrenceFutureHorizon]=e.occurrence_future_horizon),e.dateCreated!==void 0&&(i[r.dateCreated]=e.dateCreated),e.dateModified!==void 0&&(i[r.dateModified]=e.dateModified),e.sortOrder!==void 0&&(i[r.sortOrder]=e.sortOrder),e.timeEntries!==void 0&&(i[r.timeEntries]=e.timeEntries),e.complete_instances!==void 0&&(i[r.completeInstances]=e.complete_instances),e.skipped_instances!==void 0&&e.skipped_instances.length>0&&(i[r.skippedInstances]=e.skipped_instances),e.blockedBy!==void 0){let u=Array.isArray(e.blockedBy)?e.blockedBy.map(d2).filter(p=>!!p):[];u.length>0&&(i[r.blockedBy]=$pe(u))}e.icsEventId!==void 0&&e.icsEventId.length>0&&(i[r.icsEventId]=e.icsEventId),e.googleCalendarEventId!==void 0&&(i[r.googleCalendarEventId]=e.googleCalendarEventId),e.googleCalendarExceptionEventId!==void 0&&(i[r.googleCalendarExceptionEventId]=e.googleCalendarExceptionEventId),e.googleCalendarExceptionOriginalScheduled!==void 0&&(i[r.googleCalendarExceptionOriginalScheduled]=e.googleCalendarExceptionOriginalScheduled),e.googleCalendarMovedOriginalDates!==void 0&&e.googleCalendarMovedOriginalDates.length>0&&(i[r.googleCalendarMovedOriginalDates]=e.googleCalendarMovedOriginalDates),e.reminders!==void 0&&e.reminders.length>0&&(i[r.reminders]=e.reminders);let s=XA(e.tags),o=t?r2(t):"",l=r2(r.archiveTag);o&&!s.includes(o)&&s.push(o),e.archived===!0&&!s.includes(l)?s.push(l):e.archived===!1&&(s=s.filter(u=>u!==l)),s.length>0&&(i.tags=s);let c=e.customProperties,d=e;for(let u of a)Object.prototype.hasOwnProperty.call(d,u.key)&&d[u.key]!==void 0?i[u.key]=d[u.key]:c&&Object.prototype.hasOwnProperty.call(c,u.key)&&c[u.key]!==void 0&&(i[u.key]=c[u.key]);return i}function Lpe(r){let e=r.toLowerCase();return e==="true"||e==="false"?e==="true":r}function e_(r,e){for(let[t,n]of Object.entries(r))if(n===e)return t;return null}function s2(r,e){return e_(r,e)!==null}function o2(r,e,t){return r[t]===e}function l2(r,e){return e.map(t=>r[t])}function c2(r){let e=[],t=Object.keys(r);for(let a of t)(!r[a]||r[a].trim()==="")&&e.push(`Field "${a}" cannot be empty`);let n=Object.values(r);return n.length!==new Set(n).size&&e.push("Field mappings must have unique property names"),{valid:e.length===0,errors:e}}function zpe(r){return Rpe.includes(r)}function d2(r){if(typeof r=="string"){let s=JA(r.trim());return s?{uid:s,reltype:t2}:null}if(!r||typeof r!="object")return null;let e=r,t=typeof e.uid=="string"?e.uid.trim():"";if(!t)return null;let n=typeof e.reltype=="string"?e.reltype.trim().toUpperCase():"",a=zpe(n)?n:t2,i=typeof e.gap=="string"&&e.gap.trim().length>0?e.gap.trim():void 0;return i?{uid:JA(t),reltype:a,gap:i}:{uid:JA(t),reltype:a}}function jpe(r){if(r==null)return;let e=(Array.isArray(r)?r:[r]).map(d2).filter(t=>!!t);return e.length>0?e:void 0}function $pe(r){return r.map(e=>{let n={uid:e.uid.startsWith("[[")?e.uid:`[[${e.uid}]]`,reltype:e.reltype};return e.gap&&e.gap.trim().length>0&&(n.gap=e.gap),n})}function JA(r){let e=r.trim(),t=e.match(/^\[\[([^|\]#]+)(?:#[^\]|]+)?(?:\|[^\]]+)?\]\]$/);if(t)return t[1].trim();let n=e.match(/^\[[^\]]+\]\(([^)#]+)(?:#[^)]+)?\)$/);return n?decodeURI(n[1].trim()):e}function Bpe(r,e=[]){if(r===void 0||e.length===0)return r;let t=e.find(o=>o.value===r);if(t)return t.value;let n=XB(e,o=>o.label===r);if(n)return n.value;let a=r.trim().toLocaleLowerCase();if(a.length===0)return r;let i=XB(e,o=>o.value.trim().toLocaleLowerCase()===a);if(i)return i.value;let s=XB(e,o=>o.label.trim().toLocaleLowerCase()===a);return s?s.value:r}function XB(r,e){let t=r.filter(e);return t.length===1?t[0]:void 0}function Xn(r){if(r!=null){if(typeof r=="string")return Upe(r)?void 0:r;if(typeof r=="number"||typeof r=="boolean")return String(r);if(Array.isArray(r))return r.length===1?Xn(r[0]):void 0}}function QA(r){return Array.isArray(r)?r.map(String):[String(r)]}function kJe(r){if(typeof r=="number")return r;if(typeof r=="string"&&r.trim()!==""){let e=Number(r);return Number.isNaN(e)?void 0:e}}function bJe(r){if(Array.isArray(r)){let e=r.filter(t=>t!=null);return e.length>0?e:void 0}return r!=null?[r]:void 0}function r2(r){var e;return(e=XA(r)[0])!=null?e:""}function Dpe(r){var e;return((e=r.split("/").pop())==null?void 0:e.replace(/\.md$/i,"").trim())||void 0}function Upe(r){return typeof r=="string"&&r.trim().length===0}var Ppe,Mpe,Ape,e2,uJe,t2,Rpe,u2=y(()=>{Ppe={title:"title",status:"status",priority:"priority",due:"due",scheduled:"scheduled",contexts:"contexts",projects:"projects",attachments:"attachments",timeEstimate:"timeEstimate",completedDate:"completedDate",dateCreated:"dateCreated",dateModified:"dateModified",recurrence:"recurrence",recurrenceAnchor:"recurrence_anchor",recurrenceParent:"recurrence_parent",occurrenceDate:"occurrence_date",occurrenceMaterialization:"occurrence_materialization",occurrenceNextTrigger:"occurrence_next_trigger",occurrenceTemplate:"occurrence_template",occurrencePastHorizon:"occurrence_past_horizon",occurrenceFutureHorizon:"occurrence_future_horizon",archiveTag:"archived",timeEntries:"timeEntries",completeInstances:"complete_instances",skippedInstances:"skipped_instances",blockedBy:"blockedBy",pomodoros:"pomodoros",icsEventId:"icsEventId",icsEventTag:"ics_event",googleCalendarEventId:"googleCalendarEventId",googleCalendarExceptionEventId:"googleCalendarExceptionEventId",googleCalendarExceptionOriginalScheduled:"googleCalendarExceptionOriginalScheduled",googleCalendarMovedOriginalDates:"googleCalendarMovedOriginalDates",reminders:"reminders",sortOrder:"tasknotes_manual_order"},Mpe=[{id:"none",value:"none",label:"None",color:"#cccccc",isCompleted:!1,excludeFromCycle:!1,order:0,autoArchive:!1,autoArchiveDelay:5},{id:"open",value:"open",label:"Open",color:"#808080",isCompleted:!1,excludeFromCycle:!1,order:1,autoArchive:!1,autoArchiveDelay:5},{id:"in-progress",value:"in-progress",label:"In progress",color:"#0066cc",isCompleted:!1,excludeFromCycle:!1,order:2,autoArchive:!1,autoArchiveDelay:5},{id:"done",value:"done",label:"Done",color:"#00aa00",isCompleted:!0,excludeFromCycle:!1,order:3,autoArchive:!1,autoArchiveDelay:5}],Ape=[{id:"none",value:"none",label:"None",color:"#cccccc",weight:0},{id:"low",value:"low",label:"Low",color:"#00aa00",weight:1},{id:"normal",value:"normal",label:"Normal",color:"#ffaa00",weight:2},{id:"high",value:"high",label:"High",color:"#ff0000",weight:3}];e2=/^(\d{4})-(\d{2})-(\d{2})$/,uJe=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d{1,3})?(?:Z|([+-])(\d{2}):(\d{2}))?$/;t2="FINISHTOSTART",Rpe=["FINISHTOSTART","FINISHTOFINISH","STARTTOSTART","STARTTOFINISH"]});var kS=y(()=>{u2()});var bh,p2=y(()=>{kS();bh=class{constructor(e,t=[],n=[],a=[]){this.mapping=e;this.userFields=t;this.statuses=n;this.priorities=a}updateUserFields(e){this.userFields=e}updateConfiguredValues(e,t){this.statuses=e,this.priorities=t}getUserFields(){return[...this.userFields]}toUserField(e){return n2(this.mapping,e)}mapFromFrontmatter(e,t,n){let a=e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0;return a2(this.mapping,a,t,n,this.userFields,this.statuses,this.priorities)}mapToFrontmatter(e,t,n){return i2(this.mapping,e,t,n,this.userFields)}updateMapping(e){this.mapping=e}getMapping(){return{...this.mapping}}lookupMappingKey(e){return e_(this.mapping,e)}isRecognizedProperty(e){return s2(this.mapping,e)}isPropertyForField(e,t){return o2(this.mapping,e,t)}toUserFields(e){return l2(this.mapping,e)}fromUserField(e){return this.lookupMappingKey(e)}static validateMapping(e){return c2(e)}}});var bS,t_=y(()=>{u2();bS=Ppe});var Av,Un,Th=y(()=>{Av=["MO","TU","WE","TH","FR","SA","SU"],Un=(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(Av.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=Av[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})()});function wh(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+=Ut(t,e/t.length)),t.slice(0,e)+String(n))}var Gr,Hs,m2,Ra,Co,Ut,Hpe,Vpe,si,r_,Vs,Hn,Wt,Fi=y(()=>{Th();Gr=function(r){return r!=null},Hs=function(r){return typeof r=="number"},m2=function(r){return typeof r=="string"&&Av.includes(r)},Ra=Array.isArray,Co=function(r,e){e===void 0&&(e=r),arguments.length===1&&(e=r,r=0);for(var t=[],n=r;n{Fi();_l=function(r,e,t,n,a,i){return n===void 0&&(n=0),a===void 0&&(a=0),i===void 0&&(i=0),new Date(Date.UTC(r,e-1,t,n,a,i))},TJe=[31,28,31,30,31,30,31,31,30,31,30,31],Wpe=1e3*60*60*24,n_=9999,Ype=_l(1970,1,1),wJe=[6,0,1,2,3,4,5],_v=function(r){return r%4===0&&r%100!==0||r%400===0},f2=function(r){return r instanceof Date},Sh=function(r){return f2(r)&&!isNaN(r.getTime())},SJe=function(r,e){var t=r.getTime(),n=e.getTime(),a=t-n;return Math.round(a/Wpe)},TS=function(r){return SJe(r,Ype)},a_=function(r){return new Date(Ype.getTime()+r*Wpe)},xJe=function(r){var e=r.getUTCMonth();return e===1&&_v(r.getUTCFullYear())?29:TJe[e]},uu=function(r){return wJe[r.getUTCDay()]},h2=function(r,e){var t=_l(r,e+1,1);return[uu(t),xJe(t)]},i_=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()))},s_=function(r){var e=new Date(r.getTime());return e},g2=function(r){for(var e=[],t=0;t{CJe=(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&&ethis.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;case"before":case"after":default:return e.length?e[e.length-1]:null}},r.prototype.clone=function(){return new r(this.method,this.args)},r})(),mu=CJe});function Nv(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");y2(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function pe(r,e,t){if(t||arguments.length===2)for(var n=0,a=e.length,i;n{y2=function(r,e){return y2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])},y2(r,e)};Fa=function(){return Fa=Object.assign||function(e){for(var t,n=1,a=arguments.length;n{fu();o_();EJe=(function(r){Nv(e,r);function e(t,n,a){var i=r.call(this,t,n)||this;return i.iterator=a,i}return e.prototype.add=function(t){return this.iterator(t,this._result.length)?(this._result.push(t),!0):!1},e})(mu),v2=EJe});var DJe,xh,l_=y(()=>{DJe={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}},xh=DJe});var Zpe,PJe,MJe,AJe,Dc,Qpe=y(()=>{l_();Eo();Fi();Zpe=function(r,e){return r.indexOf(e)!==-1},PJe=function(r){return r.toString()},MJe=function(r,e,t){return"".concat(e," ").concat(t,", ").concat(r)},AJe=(function(){function r(e,t,n,a){if(t===void 0&&(t=PJe),n===void 0&&(n=xh),a===void 0&&(a=MJe),this.text=[],this.language=n||xh,this.gettext=t,this.dateFormatter=a,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var i=[].concat(this.options.bymonthday),s=[].concat(this.options.bynmonthday);i.sort(function(d,u){return d-u}),s.sort(function(d,u){return u-d}),this.bymonthday=i.concat(s),this.bymonthday.length||(this.bymonthday=null)}if(Gr(this.origOptions.byweekday)){var o=Ra(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],l=String(o);this.byweekday={allWeeks:o.filter(function(d){return!d.n}),someWeeks:o.filter(function(d){return!!d.n}),isWeekdays:l.indexOf("MO")!==-1&&l.indexOf("TU")!==-1&&l.indexOf("WE")!==-1&&l.indexOf("TH")!==-1&&l.indexOf("FR")!==-1&&l.indexOf("SA")===-1&&l.indexOf("SU")===-1,isEveryDay:l.indexOf("MO")!==-1&&l.indexOf("TU")!==-1&&l.indexOf("WE")!==-1&&l.indexOf("TH")!==-1&&l.indexOf("FR")!==-1&&l.indexOf("SA")!==-1&&l.indexOf("SU")!==-1};var c=function(d,u){return d.weekday-u.weekday};this.byweekday.allWeeks.sort(c),this.byweekday.someWeeks.sort(c),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(Zpe(["dtstart","tzid","wkst","freq"],n))return!0;if(!Zpe(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[ke.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 a=Math.abs(e);switch(a){case 1:case 21:case 31:t=a+n("st");break;case 2:case 22:t=a+n("nd");break;case 3:case 23:t=a+n("rd");break;default:t=a+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=Hs(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,a){var i=this;a===void 0&&(a=","),Ra(e)||(e=[e]);var s=function(l,c,d){for(var u="",p=0;p366)throw new Error("Nth out of range: "+p);return n.nextSymbol(),n.accept("last")?-p:p;default:return!1}}function d(){n.accept("on"),n.accept("the");var p=c();if(p)for(t.bymonthday=[p],n.nextSymbol();n.accept("comma");){if(p=c(),!p)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");t.bymonthday.push(p),n.nextSymbol()}}function u(){if(n.symbol==="until"){var p=Date.parse(n.text);if(!p)throw new Error("Cannot parse until date:"+n.text);t.until=new Date(p)}else n.accept("for")&&(t.count=parseInt(n.value[0],10),n.expect("number"))}}var _Je,Jpe=y(()=>{l_();Eo();_Je=(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 a in this.rules){n=this.rules[a];var i=n.exec(this.text);i&&(e===null||i[0].length>e[0].length)&&(e=i,t=a)}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 xS(r){return r{(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"})(xt||(xt={}))});var Xpe,Rv,eme,tme,rme=y(()=>{Qpe();Jpe();Eo();hu();l_();Xpe=function(r,e){return e===void 0&&(e=xh),new ke(SS(r,e)||void 0)},Rv=["count","until","interval","byweekday","bymonthday","bymonth"];Dc.IMPLEMENTED=[];Dc.IMPLEMENTED[xt.HOURLY]=Rv;Dc.IMPLEMENTED[xt.MINUTELY]=Rv;Dc.IMPLEMENTED[xt.DAILY]=["byhour"].concat(Rv);Dc.IMPLEMENTED[xt.WEEKLY]=Rv;Dc.IMPLEMENTED[xt.MONTHLY]=Rv;Dc.IMPLEMENTED[xt.YEARLY]=["byweekno","byyearday"].concat(Rv);eme=function(r,e,t,n){return new Dc(r,e,t,n).toString()},tme=Dc.isFullyConvertible});var Fv,nme,c_=y(()=>{fu();hu();Fi();oi();Fv=(function(){function r(e,t,n,a){this.hour=e,this.minute=t,this.second=n,this.millisecond=a||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})(),nme=(function(r){Nv(e,r);function e(t,n,a,i,s,o,l){var c=r.call(this,i,s,o,l)||this;return c.year=t,c.month=n,c.day=a,c}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 uu(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),a=si(this.month,12);this.month=a,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,a){for(n&&(this.hour+=Math.floor((23-this.hour)/t)*t);;){this.hour+=t;var i=r_(this.hour,24),s=i.div,o=i.mod;if(s&&(this.hour=o,this.addDaily(s)),Vs(a)||Wt(a,this.hour))break}},e.prototype.addMinutes=function(t,n,a,i){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/t)*t);;){this.minute+=t;var s=r_(this.minute,60),o=s.div,l=s.mod;if(o&&(this.minute=l,this.addHours(o,!1,a)),(Vs(a)||Wt(a,this.hour))&&(Vs(i)||Wt(i,this.minute)))break}},e.prototype.addSeconds=function(t,n,a,i,s){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/t)*t);;){this.second+=t;var o=r_(this.second,60),l=o.div,c=o.mod;if(l&&(this.second=c,this.addMinutes(l,!1,a,i)),(Vs(a)||Wt(a,this.hour))&&(Vs(i)||Wt(i,this.minute))&&(Vs(s)||Wt(s,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var t=h2(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>n_))return;t=h2(this.year,this.month-1)[1]}}},e.prototype.add=function(t,n){var a=t.freq,i=t.interval,s=t.wkst,o=t.byhour,l=t.byminute,c=t.bysecond;switch(a){case xt.YEARLY:return this.addYears(i);case xt.MONTHLY:return this.addMonths(i);case xt.WEEKLY:return this.addWeekly(i,s);case xt.DAILY:return this.addDaily(i);case xt.HOURLY:return this.addHours(i,n,o);case xt.MINUTELY:return this.addMinutes(i,n,o,l);case xt.SECONDLY:return this.addSeconds(i,n,o,l,c)}},e})(Fv)});function k2(r){for(var e=[],t=Object.keys(r),n=0,a=t;n=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(e.byweekno||Hn(e.byweekno)||Hn(e.byyearday)||e.bymonthday||Hn(e.bymonthday)||Gr(e.byweekday)||Gr(e.byeaster)))switch(e.freq){case ke.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case ke.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case ke.WEEKLY:e.byweekday=[uu(e.dtstart)];break}if(Gr(e.bymonth)&&!Ra(e.bymonth)&&(e.bymonth=[e.bymonth]),Gr(e.byyearday)&&!Ra(e.byyearday)&&Hs(e.byyearday)&&(e.byyearday=[e.byyearday]),!Gr(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(Ra(e.bymonthday)){for(var a=[],i=[],t=0;t0?a.push(n):n<0&&i.push(n)}e.bymonthday=a,e.bynmonthday=i}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(Gr(e.byweekno)&&!Ra(e.byweekno)&&(e.byweekno=[e.byweekno]),!Gr(e.byweekday))e.bynweekday=null;else if(Hs(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(m2(e.byweekday))e.byweekday=[Un.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof Un)!e.byweekday.n||e.freq>ke.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var s=[],o=[],t=0;tke.MONTHLY?s.push(l.weekday):o.push([l.weekday,l.n])}e.byweekday=Hn(s)?s:null,e.bynweekday=Hn(o)?o:null}return Gr(e.byhour)?Hs(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq{fu();hu();Fi();Eo();oi();Th();c_()});function DS(r){var e=r.split(` `).map(IJe).filter(function(t){return t!==null});return Fa(Fa({},e[0]),e[1])}function ES(r){var e={},t=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(r);if(!t)return e;var n=t[1],a=t[2];return n&&(e.tzid=n),e.dtstart=wS(a),e}function IJe(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var e=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!e)return ome(r);var t=e[1];switch(t.toUpperCase()){case"RRULE":case"EXRULE":return ome(r);case"DTSTART":return ES(r);default:throw new Error("Unsupported RFC prop ".concat(t," in ").concat(r))}}function ome(r){var e=r.replace(/^RRULE:/i,""),t=ES(e),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(a){var i=a.split("="),s=i[0],o=i[1];switch(s.toUpperCase()){case"FREQ":t.freq=xt[o.toUpperCase()];break;case"WKST":t.wkst=Do[o.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var l=NJe(o),c=s.toLowerCase();t[c]=l;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=RJe(o);break;case"DTSTART":case"TZID":var d=ES(r);t.tzid=d.tzid,t.dtstart=d.dtstart;break;case"UNTIL":t.until=wS(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+s+"'")}}),t}function NJe(r){if(r.indexOf(",")!==-1){var e=r.split(",");return e.map(lme)}return lme(r)}function lme(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function RJe(r){var e=r.split(",");return e.map(function(t){if(t.length===2)return Do[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 a=Number(n[1]),i=n[2],s=Do[i].weekday;return new Un(s,a)})}var T2=y(()=>{fu();hu();Th();oi();Eo()});var Ch,d_=y(()=>{oi();Ch=(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=Iv(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:Gpe(this.date,this.tzid)},r})()});function PS(r){for(var e=[],t="",n=Object.keys(r),a=Object.keys(CS),i=0;i{Eo();Fi();Th();oi();d_()});function OJe(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 cme,dme=y(()=>{o_();oi();Fi();cme=(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?s_(t):g2(t)),e==="all"?this.all=t:(n._value=t,this[e].push(n))},r.prototype._cacheGet=function(e,t){var n=!1,a=t?Object.keys(t):[],i=function(d){for(var u=0;u{fu();Fi();ume=pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe([],Ut(1,31),!0),Ut(2,28),!0),Ut(3,31),!0),Ut(4,30),!0),Ut(5,31),!0),Ut(6,30),!0),Ut(7,31),!0),Ut(8,31),!0),Ut(9,30),!0),Ut(10,31),!0),Ut(11,30),!0),Ut(12,31),!0),Ut(1,7),!0),pme=pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe([],Ut(1,31),!0),Ut(2,29),!0),Ut(3,31),!0),Ut(4,30),!0),Ut(5,31),!0),Ut(6,30),!0),Ut(7,31),!0),Ut(8,31),!0),Ut(9,30),!0),Ut(10,31),!0),Ut(11,30),!0),Ut(12,31),!0),Ut(1,7),!0),LJe=Co(1,29),zJe=Co(1,30),Kp=Co(1,31),li=Co(1,32),mme=pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe([],li,!0),zJe,!0),li,!0),Kp,!0),li,!0),Kp,!0),li,!0),li,!0),Kp,!0),li,!0),Kp,!0),li,!0),li.slice(0,7),!0),fme=pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe([],li,!0),LJe,!0),li,!0),Kp,!0),li,!0),Kp,!0),li,!0),li,!0),Kp,!0),li,!0),Kp,!0),li,!0),li.slice(0,7),!0),jJe=Co(-28,0),$Je=Co(-29,0),Zp=Co(-30,0),ci=Co(-31,0),hme=pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe([],ci,!0),$Je,!0),ci,!0),Zp,!0),ci,!0),Zp,!0),ci,!0),ci,!0),Zp,!0),ci,!0),Zp,!0),ci,!0),ci.slice(0,7),!0),gme=pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe(pe([],ci,!0),jJe,!0),ci,!0),Zp,!0),ci,!0),Zp,!0),ci,!0),ci,!0),Zp,!0),ci,!0),Zp,!0),ci,!0),ci.slice(0,7),!0),yme=[0,31,60,91,121,152,182,213,244,274,305,335,366],vme=[0,31,59,90,120,151,181,212,243,273,304,334,365],S2=(function(){for(var r=[],e=0;e<55;e++)r=r.concat(Co(7));return r})()});function bme(r,e){var t=_l(r,1,1),n=_v(r)?366:365,a=_v(r+1)?366:365,i=TS(t),s=uu(t),o=Fa(Fa({yearlen:n,nextyearlen:a,yearordinal:i,yearweekday:s},BJe(r)),{wnomask:null});if(Vs(e.byweekno))return o;o.wnomask=Ut(0,n+7);var l,c,d=l=si(7-s+e.wkst,7);d>=4?(d=0,c=o.yearlen+si(s-e.wkst,7)):c=n-d;for(var u=Math.floor(c/7),p=si(c,7),m=Math.floor(u+p/4),f=0;f0&&h<=m){var g=void 0;h>1?(g=d+(h-1)*7,d!==l&&(g-=7-l)):g=d;for(var v=0;v<7&&(o.wnomask[g]=1,g++,o.wdaymask[g]!==e.wkst);v++);}}if(Wt(e.byweekno,1)){var g=d+m*7;if(d!==l&&(g-=7-l),g=4?(w=0,C=S+si(k-e.wkst,7)):C=n-d,b=Math.floor(52+si(C,7)/4)}if(Wt(e.byweekno,b))for(var g=0;g{fu();oi();Fi();kme()});function wme(r,e,t,n,a,i){var s={lastyear:r,lastmonth:e,nwdaymask:[]},o=[];if(i.freq===ke.YEARLY)if(Vs(i.bymonth))o=[[0,t]];else for(var l=0;l{Eo();Fi()});function xme(r,e){e===void 0&&(e=0);var t=r%19,n=Math.floor(r/100),a=r%100,i=Math.floor(n/4),s=n%4,o=Math.floor((n+8)/25),l=Math.floor((n-o+1)/3),c=Math.floor(19*t+n-i-l+15)%30,d=Math.floor(a/4),u=a%4,p=Math.floor(32+2*s+2*d-c-u)%7,m=Math.floor((t+11*c+22*p)/451),f=Math.floor((c+p-7*m+114)/31),h=(c+p-7*m+114)%31+1,g=Date.UTC(r,f-1,h+e),v=Date.UTC(r,0,1);return[Math.ceil((g-v)/(1e3*60*60*24))]}var Cme=y(()=>{});var UJe,Eme,Dme=y(()=>{Fi();hu();Tme();Sme();Cme();c_();oi();UJe=(function(){function r(e){this.options=e}return r.prototype.rebuild=function(e,t){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=bme(e,n)),Hn(n.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var a=this.yearinfo,i=a.yearlen,s=a.mrange,o=a.wdaymask;this.monthinfo=wme(e,t,i,s,o,n)}Gr(n.byeaster)&&(this.eastermask=xme(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[Co(this.yearlen),0,this.yearlen]},r.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],a=this.mrange[t],i=Ut(null,this.yearlen),s=n;s{oi();Fi()});function u_(r,e){var t=e.dtstart,n=e.freq,a=e.interval,i=e.until,s=e.bysetpos,o=e.count;if(o===0||a===0)return gu(r);var l=nme.fromDate(t),c=new Eme(e);c.rebuild(l.year,l.month);for(var d=qJe(c,l,e);;){var u=c.getdayset(n)(l.year,l.month,l.day),p=u[0],m=u[1],f=u[2],h=VJe(p,m,f,c,e);if(Hn(s))for(var g=Pme(s,d,m,f,c,p),v=0;vi)return gu(r);if(b>=t){var k=Ame(b,e);if(!r.accept(k)||o&&(--o,!o))return gu(r)}}else for(var v=m;vi)return gu(r);if(b>=t){var k=Ame(b,e);if(!r.accept(k)||o&&(--o,!o))return gu(r)}}}if(e.interval===0||(l.add(e,h),l.year>n_))return gu(r);xS(n)||(d=c.gettimeset(n)(l.hour,l.minute,l.second,0)),c.rebuild(l.year,l.month)}}function HJe(r,e,t){var n=t.bymonth,a=t.byweekno,i=t.byweekday,s=t.byeaster,o=t.bymonthday,l=t.bynmonthday,c=t.byyearday;return Hn(n)&&!Wt(n,r.mmask[e])||Hn(a)&&!r.wnomask[e]||Hn(i)&&!Wt(i,r.wdaymask[e])||Hn(r.nwdaymask)&&!r.nwdaymask[e]||s!==null&&!Wt(r.eastermask,e)||(Hn(o)||Hn(l))&&!Wt(o,r.mdaymask[e])&&!Wt(l,r.nmdaymask[e])||Hn(c)&&(e=r.yearlen&&!Wt(c,e+1-r.yearlen)&&!Wt(c,-r.nextyearlen+e-r.yearlen))}function Ame(r,e){return new Ch(r,e.tzid).rezonedDate()}function gu(r){return r.getValue()}function VJe(r,e,t,n,a){for(var i=!1,s=e;s=ke.HOURLY&&Hn(a)&&!Wt(a,e.hour)||n>=ke.MINUTELY&&Hn(i)&&!Wt(i,e.minute)||n>=ke.SECONDLY&&Hn(s)&&!Wt(s,e.second)?[]:r.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var x2=y(()=>{hu();oi();Dme();Eo();b2();Fi();d_();Mme();c_()});var Do,CS,sme,ke,Eo=y(()=>{oi();o_();Kpe();rme();hu();b2();T2();w2();dme();Th();x2();Do={MO:new Un(0),TU:new Un(1),WE:new Un(2),TH:new Un(3),FR:new Un(4),SA:new Un(5),SU:new Un(6)},CS={freq:xt.YEARLY,dtstart:null,interval:1,wkst:Do.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},sme=Object.keys(CS),ke=(function(){function r(e,t){e===void 0&&(e={}),t===void 0&&(t=!1),this._cache=t?null:new cme,this.origOptions=k2(e);var n=ame(e).parsedOptions;this.options=n}return r.parseText=function(e,t){return SS(e,t)},r.fromText=function(e,t){return Xpe(e,t)},r.fromString=function(e){return new r(r.parseString(e)||void 0)},r.prototype._iter=function(e){return u_(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 v2("all",{},e));var t=this._cacheGet("all");return t===!1&&(t=this._iter(new mu("all",{})),this._cacheAdd("all",t)),t},r.prototype.between=function(e,t,n,a){if(n===void 0&&(n=!1),!Sh(e)||!Sh(t))throw new Error("Invalid date passed in to RRule.between");var i={before:t,after:e,inc:n};if(a)return this._iter(new v2("between",i,a));var s=this._cacheGet("between",i);return s===!1&&(s=this._iter(new mu("between",i)),this._cacheAdd("between",s,i)),s},r.prototype.before=function(e,t){if(t===void 0&&(t=!1),!Sh(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},a=this._cacheGet("before",n);return a===!1&&(a=this._iter(new mu("before",n)),this._cacheAdd("before",a,n)),a},r.prototype.after=function(e,t){if(t===void 0&&(t=!1),!Sh(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},a=this._cacheGet("after",n);return a===!1&&(a=this._iter(new mu("after",n)),this._cacheAdd("after",a,n)),a},r.prototype.count=function(){return this.all().length},r.prototype.toString=function(){return PS(this.origOptions)},r.prototype.toText=function(e,t,n){return eme(this,e,t,n)},r.prototype.isFullyConvertibleToText=function(){return tme(this)},r.prototype.clone=function(){return new r(this.origOptions)},r.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],r.YEARLY=xt.YEARLY,r.MONTHLY=xt.MONTHLY,r.WEEKLY=xt.WEEKLY,r.DAILY=xt.DAILY,r.HOURLY=xt.HOURLY,r.MINUTELY=xt.MINUTELY,r.SECONDLY=xt.SECONDLY,r.MO=Do.MO,r.TU=Do.TU,r.WE=Do.WE,r.TH=Do.TH,r.FR=Do.FR,r.SA=Do.SA,r.SU=Do.SU,r.parseString=DS,r.optionsToString=PS,r})()});function _me(r,e,t,n,a,i){var s={},o=r.accept;function l(p,m){t.forEach(function(f){f.between(p,m,!0).forEach(function(h){s[Number(h)]=!0})})}a.forEach(function(p){var m=new Ch(p,i).rezonedDate();s[Number(m)]=!0}),r.accept=function(p){var m=Number(p);return isNaN(m)?o.call(this,p):!s[m]&&(l(new Date(m-1),new Date(m+1)),!s[m])?(s[m]=!0,o.call(this,p)):!0},r.method==="between"&&(l(r.args.after,r.args.before),r.accept=function(p){var m=Number(p);return s[m]?!0:(s[m]=!0,o.call(this,p))});for(var c=0;c{d_();x2();oi()});function WJe(r,e){var t=[],n=[],a=[],i=[],s=ES(r),o=s.dtstart,l=s.tzid,c=QJe(r,e.unfold);return c.forEach(function(d){var u;if(d){var p=ZJe(d),m=p.name,f=p.parms,h=p.value;switch(m.toUpperCase()){case"RRULE":if(f.length)throw new Error("unsupported RRULE parm: ".concat(f.join(",")));t.push(DS(d));break;case"RDATE":var g=(u=/RDATE(?:;TZID=([^:=]+))?/i.exec(d))!==null&&u!==void 0?u:[],v=g[1];v&&!l&&(l=v),n=n.concat(Rme(h,f));break;case"EXRULE":if(f.length)throw new Error("unsupported EXRULE parm: ".concat(f.join(",")));a.push(DS(h));break;case"EXDATE":i=i.concat(Rme(h,f));break;case"DTSTART":break;default:throw new Error("unsupported property: "+m)}}}),{dtstart:o,tzid:l,rrulevals:t,rdatevals:n,exrulevals:a,exdatevals:i}}function YJe(r,e){var t=WJe(r,e),n=t.rrulevals,a=t.rdatevals,i=t.exrulevals,s=t.exdatevals,o=t.dtstart,l=t.tzid,c=e.cache===!1;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||n.length>1||a.length||i.length||s.length){var d=new p_(c);return d.dtstart(o),d.tzid(l||void 0),n.forEach(function(p){d.rrule(new ke(C2(p,o,l),c))}),a.forEach(function(p){d.rdate(p)}),i.forEach(function(p){d.exrule(new ke(C2(p,o,l),c))}),s.forEach(function(p){d.exdate(p)}),e.compatible&&e.dtstart&&d.rdate(o),d}var u=n[0]||{};return new ke(C2(u,u.dtstart||e.dtstart||o,u.tzid||e.tzid||l),c)}function MS(r,e){return e===void 0&&(e={}),YJe(r,GJe(e))}function C2(r,e,t){return Fa(Fa({},r),{dtstart:e,tzid:t})}function GJe(r){var e=[],t=Object.keys(r),n=Object.keys(Nme);if(t.forEach(function(a){Wt(n,a)||e.push(a)}),e.length)throw new Error("Invalid options: "+e.join(", "));return Fa(Fa({},Nme),r)}function KJe(r){if(r.indexOf(":")===-1)return{name:"RRULE",value:r};var e=Vpe(r,":",1),t=e[0],n=e[1];return{name:t,value:n}}function ZJe(r){var e=KJe(r),t=e.name,n=e.value,a=t.split(";");if(!a)throw new Error("empty property name");return{name:a[0].toUpperCase(),parms:a.slice(1),value:n}}function QJe(r,e){if(e===void 0&&(e=!1),r=r&&r.trim(),!r)throw new Error("Invalid empty string");if(!e)return r.split(/\s/);for(var t=r.split(` `),n=0;n0&&a[0]===" "?(t[n-1]+=a.slice(1),t.splice(n,1)):n+=1:t.splice(n,1)}return t}function JJe(r){r.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function Rme(r,e){return JJe(e),r.split(",").map(function(t){return wS(t)})}var Nme,E2=y(()=>{fu();Eo();D2();oi();Fi();T2();Nme={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null}});function Fme(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{fu();Eo();oi();Fi();Ime();E2();w2();p_=(function(r){Nv(e,r);function e(t){t===void 0&&(t=!1);var n=r.call(this,{},t)||this;return n.dtstart=Fme.apply(n,["dtstart"]),n.tzid=Fme.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(t){return _me(t,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(t){Ome(t,this._rrule)},e.prototype.exrule=function(t){Ome(t,this._exrule)},e.prototype.rdate=function(t){Lme(t,this._rdate)},e.prototype.exdate=function(t){Lme(t,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(t){return MS(t.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(t){return MS(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(PS({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(a){return a.replace(/^RRULE:/,"EXRULE:")}).filter(function(a){return!/^DTSTART/.test(a)}))}),this._rdate.length&&t.push(zme("RDATE",this._rdate,this.tzid())),this._exdate.length&&t.push(zme("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})(ke)});var Qp={};at(Qp,{ALL_WEEKDAYS:()=>Av,Frequency:()=>xt,RRule:()=>ke,RRuleSet:()=>p_,Weekday:()=>Un,datetime:()=>_l,rrulestr:()=>MS});var Ov=y(()=>{Eo();D2();E2();hu();Th();oi()});function vu(r){let e=Bme(r),t=e.match(m_);if(t){let[,a,i,s]=t,o=Number(a),l=Number(i),c=Number(s);if(!Hme(o,l,c))throw new Error(`Invalid date "${r}".`);return new Date(Date.UTC(o,l-1,c,0,0,0,0))}if(!Ume(e))throw new Error(`Invalid date "${r}".`);let n=new Date(e);if(!f_(n))throw new Error(`Invalid date "${r}".`);return n}function eXe(r){let e=Bme(r),t=e.match(m_);if(t){let[,a,i,s]=t,o=Number(a),l=Number(i),c=Number(s),d=new Date(o,l-1,c,0,0,0,0);if(!f_(d)||d.getFullYear()!==o||d.getMonth()!==l-1||d.getDate()!==c)throw new Error(`Invalid date "${r}".`);return d}if(!Ume(e))throw new Error(`Invalid date "${r}".`);let n=new Date(e);if(!f_(n))throw new Error(`Invalid date "${r}".`);return n}function yu(r){if(!f_(r))return"";let e=r.getUTCFullYear(),t=String(r.getUTCMonth()+1).padStart(2,"0"),n=String(r.getUTCDate()).padStart(2,"0");return`${e}-${t}-${n}`}function tXe(r){return yu(r)}function rXe(){let r=new Date,e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return`${e}-${t}-${n}`}function M2(r){return vu(A2(r))}function nXe(r){return r?/T\d{2}:\d{2}/.test(r):!1}function A2(r){if(!r)return"";let e=r.trim();if(m_.test(e))return e;let t=e.indexOf("T");if(t>-1)return e.slice(0,t);let n=e.indexOf(" ");return n>-1&&m_.test(e.slice(0,n))?e.slice(0,n):yu(vu(e))}function Bme(r,e="Date string cannot be empty"){if(!r||r.trim().length===0)throw new Error(e);return r.trim()}function Ume(r){let e=r.match(XJe);if(!e)return!1;let[,t,n,a,i,s,o,,l,c,d]=e;return Hme(Number(t),Number(n),Number(a))&&aXe(Number(i),Number(s),Number(o))&&iXe(l,c,d)}function Hme(r,e,t){let n=new Date(Date.UTC(r,e-1,t,0,0,0,0));return n.getUTCFullYear()===r&&n.getUTCMonth()===e-1&&n.getUTCDate()===t}function aXe(r,e,t){return r>=0&&r<=23&&e>=0&&e<=59&&t>=0&&t<=59}function iXe(r,e,t){if(!r)return!0;let n=Number(e),a=Number(t);return!(n>14||a>59||n===14&&a!==0)}function f_(r){return r instanceof Date&&!Number.isNaN(r.getTime())}function I2(r,e){if(!r.recurrence||typeof r.recurrence!="string")return!0;try{let t=Kme(r);if(!t)return!1;let n=M2(tXe(e));return t.between(n,new Date(n.getTime()+1440*60*1e3-1),!0).length>0}catch(t){return!0}}function h_(r,e,t="done"){if(!r.recurrence)return r.status||"open";let n=yu(e);return(Array.isArray(r.complete_instances)?r.complete_instances:[]).includes(n)?t:r.status||"open"}function Jp(r,e,t){if(!r.recurrence||typeof r.recurrence!="string")return[];try{let n=Kme(r);if(!n)return[];let a=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),0,0,0,0)),i=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),23,59,59,999));return n.between(a,i,!0)}catch(n){let a=[],i=new Date(e);for(;i<=t;)I2(r,i)&&a.push(new Date(i)),i.setUTCDate(i.getUTCDate()+1);return a}}function Vme(r){if(!r.recurrence||typeof r.recurrence!="string")return null;let e=r.recurrence.match(/(?:^|;)COUNT=(\d+)(?:;|$)/);if(e){let t=Number.parseInt(e[1],10);return Number.isFinite(t)&&t>0?t:null}if(!/(?:^|;)UNTIL=/.test(r.recurrence))return null;try{let t=Zme(r),n=oXe(r.recurrence);if(!t||!n||n=sXe?null:a.length>0?a.length:null}catch(t){return null}}function N2(r,e={}){return r.recurrence?(r.recurrence_anchor||"scheduled")==="completion"?dXe(r,e):cXe(r,e):null}function qme(r,e=!0,t={}){let n=N2(r,t),a=null,i=null,s=null;if(n){try{let o=r.scheduled?vu(A2(r.scheduled)):null,l=r.due?vu(A2(r.due)):null;if(o&&l){let c=!e&&l.getTime()=t)return c}return null}function dXe(r,e){if(!r.recurrence||typeof r.recurrence!="string")return null;let t=vu(e.today||$me()),n=Jme(r.recurrence),a=R2(r.recurrence),i=a||t,s=new Date(i.getTime()+n*24*60*60*1e3),o=Jp(r,i,s),l=new Set(r.skipped_instances||[]),c=a?a.getTime():0;for(let d of o){let u=yu(d);if(d.getTime()>c&&d>=t&&!l.has(u))return d}return null}var m_,XJe,$me,P2,jme,_2,sXe,F2=y(()=>{Ov();m_=/^(\d{4})-(\d{2})-(\d{2})$/,XJe=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d{1,3})?(?:Z|([+-])(\d{2}):(\d{2}))?$/;$me=rXe;P2=Reflect.get(Qp,"default"),_2=(jme=ke)!=null?jme:P2==null?void 0:P2.RRule,sXe=1e4});var U2={};at(U2,{NATURAL_LANGUAGE_DATE_PATTERNS:()=>AS,addDaysToDateString:()=>Eh,addDaysToDateTime:()=>Lv,addMonthsToDateString:()=>fXe,addWeeksToDateString:()=>L2,addYearsToDateString:()=>hXe,combineDateAndTime:()=>La,convertUTCToLocalCalendarDate:()=>ku,createSafeDate:()=>mXe,createSafeUTCDate:()=>y_,createTimeFormatHelper:()=>SXe,createUTCDateForRRule:()=>Xp,createUTCDateFromLocalCalendarDate:()=>wn,formatDateAsUTCString:()=>PXe,formatDateForDisplay:()=>bu,formatDateForStorage:()=>ce,formatDateStringTime:()=>nfe,formatDateTime:()=>rfe,formatDateTimeForDisplay:()=>Vn,formatTime:()=>em,formatTimestampForDisplay:()=>v_,generateUTCCalendarDates:()=>$2,getCurrentDateString:()=>Il,getCurrentDateTimeString:()=>EXe,getCurrentTimestamp:()=>Ge,getDatePart:()=>de,getEndOfMonthString:()=>kXe,getEndOfWeekString:()=>yXe,getEndOfYearString:()=>TXe,getNaturalLanguageDateSuggestions:()=>AXe,getStartOfMonthString:()=>vXe,getStartOfWeekString:()=>gXe,getStartOfYearString:()=>bXe,getTimePart:()=>Oi,getTodayLocal:()=>Er,getTodayString:()=>nn,getUTCEndOfMonth:()=>w_,getUTCEndOfWeek:()=>B2,getUTCStartOfMonth:()=>T_,getUTCStartOfWeek:()=>b_,hasTimeComponent:()=>mr,isBeforeDateSafe:()=>Dh,isBeforeDateTimeAware:()=>Tu,isNaturalLanguageDate:()=>S_,isOverdueTimeAware:()=>Nl,isPastDate:()=>z2,isSameDateSafe:()=>Po,isToday:()=>_S,isTodayTimeAware:()=>k_,isTodayUTC:()=>j2,isValidDateInput:()=>MXe,normalizeCalendarBoundariesToUTC:()=>DXe,normalizeDateString:()=>pXe,parseDate:()=>uXe,parseDateAsLocal:()=>Ph,parseDateToLocal:()=>it,parseDateToUTC:()=>kt,parseTimestamp:()=>tfe,resolveNaturalLanguageDate:()=>Pc,startOfDayForDateString:()=>wXe,validateCompleteInstances:()=>CXe,validateDateInput:()=>O2,validateDateTimeInput:()=>xXe});function Oa(r){if(!r){let t=new Error("Date string cannot be empty");throw We.error("Date parsing error:",{category:"validation",operation:"date-parsing",details:{dateString:r},error:t.message}),t}let e=r.trim();try{let t=e.match(/^(\d{4}-\d{2}-\d{2})\s+(Mon|Tue|Wed|Thu|Fri|Sat|Sun|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday)$/i);if(t){let n=t[1];return Oa(n)}if(e.startsWith("T")&&/^T\d{2}:\d{2}(:\d{2})?/.test(e)){let n=new Error(`Invalid date format - time without date: ${r}`);throw We.warn("Date parsing error - incomplete time format:",{category:"validation",operation:"date-parsing-incomplete-time-format",details:{original:r,trimmed:e},error:n.message}),n}if(/^\d{4}-W\d{2}$/.test(e)){let[n,a]=e.split("-W"),i=parseInt(n,10),s=parseInt(a,10);if(isNaN(i)||isNaN(s)){let u=new Error(`Invalid numeric values in ISO week format: ${r}`);throw We.warn("Date parsing error - invalid ISO week numbers:",{category:"validation",operation:"date-parsing-invalid-iso-week-numbers",details:{original:r,year:n,week:a,yearNum:i,weekNum:s}}),u}if(s<1||s>53){let u=new Error(`Invalid week number in ISO week format: ${r} (week must be 1-53)`);throw We.warn("Date parsing error - week number out of range:",{category:"validation",operation:"date-parsing-week-number-out-of-range",details:{original:r,weekNum:s},error:u.message}),u}let o=new Date(i,0,4),l=o.getDay(),c=new Date(o);c.setDate(o.getDate()-(l===0?6:l-1));let d=new Date(c);if(d.setDate(c.getDate()+(s-1)*7),!Ca(d)){let u=new Error(`Failed to calculate date from ISO week format: ${r}`);throw We.error("Date parsing error - ISO week calculation failed:",{category:"validation",operation:"date-parsing-iso-week-calculation",details:{original:r,yearNum:i,weekNum:s,jan4:o.toISOString(),targetWeekMonday:d.toString()}}),u}return d}if(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}(:\d{2})?/.test(e)){let n=e.replace(" ","T"),a=Us(n);if(!Ca(a)){let i=new Error(`Invalid space-separated datetime: ${r}`);throw We.warn("Date parsing error - space-separated datetime invalid:",{category:"validation",operation:"date-parsing-space-separated-datetime-invalid",details:{original:r,converted:n},error:i.message}),i}return a}if(e.includes("T")||e.includes("Z")||e.match(/[+-]\d{2}:\d{2}$/)){let n=Us(e);if(!Ca(n)){let a=new Error(`Invalid timezone-aware date: ${r}`);throw We.warn("Date parsing error - timezone-aware format invalid:",{category:"validation",operation:"date-parsing-timezone-aware-format-invalid",details:{original:r,trimmed:e},error:a.message}),a}return n}else{let n=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!n){let l=new Error(`Invalid date-only string: ${r} (expected format: yyyy-MM-dd)`);throw We.warn("Date parsing error - date-only format invalid:",{category:"validation",operation:"date-parsing-date-only-format-invalid",details:{original:r,trimmed:e,expectedFormat:"yyyy-MM-dd"},error:l.message}),l}let[,a,i,s]=n,o=new Date(parseInt(a,10),parseInt(i,10)-1,parseInt(s,10));if(!Ca(o)||o.getFullYear()!==parseInt(a,10)||o.getMonth()!==parseInt(i,10)-1||o.getDate()!==parseInt(s,10)){let l=new Error(`Invalid date values: ${r}`);throw We.warn("Date parsing error - invalid date values:",{category:"validation",operation:"date-parsing-invalid-date-values",details:{original:r,year:a,month:i,day:s},error:l.message}),l}return o}}catch(t){if(t instanceof Error&&t.message.includes("Invalid date"))throw t;let n=new Error(`Unexpected error parsing date "${r}": ${t instanceof Error?t.message:String(t)}`);throw We.error("Unexpected date parsing error:",{category:"validation",operation:"unexpected-date-parsing",details:{original:r,trimmed:e,stack:t instanceof Error?t.stack:void 0},error:t instanceof Error?t.message:String(t)}),n}}function kt(r){if(!r){let t=new Error("Date string cannot be empty");throw We.error("Date parsing error:",{category:"validation",operation:"date-parsing",details:{dateString:r},error:t.message}),t}let e=r.trim();try{let t=e.match(/^(\d{4}-\d{2}-\d{2})\s+(Mon|Tue|Wed|Thu|Fri|Sat|Sun|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday)$/i);if(t){let a=t[1];return kt(a)}let n=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(n){let[,a,i,s]=n,o=parseInt(a,10),l=parseInt(i,10),c=parseInt(s,10);if(l<1||l>12)throw new Error(`Invalid month in date: ${r}`);if(c<1||c>31)throw new Error(`Invalid day in date: ${r}`);let d=new Date(Date.UTC(o,l-1,c));if(d.getUTCFullYear()!==o||d.getUTCMonth()!==l-1||d.getUTCDate()!==c)throw new Error(`Invalid date values: ${r}`);return d}return Oa(e)}catch(t){let n=new Error(`Failed to parse date to UTC: ${e}`);throw We.error("Date parsing error:",{category:"validation",operation:"date-parsing",details:{dateString:r,trimmed:e,stack:t instanceof Error?t.stack:void 0},error:t instanceof Error?t.message:String(t)}),n}}function it(r){return Oa(r)}function uXe(r){return Oa(r)}function Po(r,e){try{let t=de(r),n=de(e),a=kt(t),i=kt(n);return a.getTime()===i.getTime()}catch(t){return We.error("Error comparing dates:",{category:"validation",operation:"comparing-dates",details:{date1:r,date2:e},error:t}),!1}}function Dh(r,e){try{let t=de(r),n=de(e),a=kt(t),i=kt(n);return a.getTime()=0?"+":"-",n=m=>String(Math.abs(m)).padStart(2,"0"),a=n(Math.floor(Math.abs(e)/60)),i=n(Math.abs(e)%60),s=r.getFullYear(),o=n(r.getMonth()+1),l=n(r.getDate()),c=n(r.getHours()),d=n(r.getMinutes()),u=n(r.getSeconds()),p=String(r.getMilliseconds()).padStart(3,"0");return`${s}-${o}-${l}T${c}:${d}:${u}.${p}${t}${a}:${i}`}function Il(){let r=new Date,e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return`${e}-${t}-${n}`}function tfe(r){try{if(!r)throw new Error("Timestamp string cannot be empty");let e=Us(r);if(!Ca(e))throw new Error(`Invalid timestamp: ${r}`);return e}catch(e){throw We.error("Error parsing timestamp:",{category:"validation",operation:"parsing-timestamp",details:{timestampString:r},error:e}),e}}function v_(r,e,t="24"){if(!r)return r;try{let n=tfe(r);return Ca(n)?M(n,e||(t==="12"?"MMM d, yyyy h:mm a":"MMM d, yyyy HH:mm")):r}catch(n){return We.error("Error formatting timestamp for display:",{category:"validation",operation:"formatting-timestamp-display",details:{timestampString:r},error:n}),r}}function mr(r){return r?/T\d{2}:\d{2}/.test(r):!1}function de(r){if(!r)return"";try{if(/^\d{4}-\d{2}-\d{2}$/.test(r))return r;let e=r.indexOf("T");if(e>-1)return r.substring(0,e);let t=kt(r);return ce(t)}catch(e){return We.error("Error extracting date part:",{category:"validation",operation:"extracting-date-part",details:{dateString:r},error:e}),r}}function Oi(r){if(!r||!mr(r))return null;try{let e=Oa(r);return M(e,"HH:mm")}catch(e){return We.error("Error extracting time part:",{category:"validation",operation:"extracting-time-part",details:{dateString:r},error:e}),null}}function em(r,e="24"){return Ca(r)?M(r,e==="12"?"h:mm a":"HH:mm"):(We.warn("Invalid date provided to formatTime:",{category:"validation",operation:"invalid-date-provided-formattime",details:{value:r}}),"")}function rfe(r,e="24"){return Ca(r)?M(r,e==="12"?"MMM d, yyyy h:mm a":"MMM d, yyyy HH:mm"):(We.warn("Invalid date provided to formatDateTime:",{category:"validation",operation:"invalid-date-provided-formatdatetime",details:{value:r}}),"")}function nfe(r,e="24"){if(!r||!mr(r))return r;try{let t=it(r);return em(t,e)}catch(t){return We.error("Error formatting date string time:",{category:"validation",operation:"formatting-date-string-time",details:{dateString:r},error:t}),r}}function SXe(r){return{formatDateTimeForDisplay:(e,t={})=>Vn(e,{...t,userTimeFormat:r}),formatTime:e=>em(e,r),formatDateTime:e=>rfe(e,r),formatDateStringTime:e=>nfe(e,r)}}function La(r,e){if(!r)return"";if(!e)return r;try{let t=r.match(/^(\d{4}-\d{2}-\d{2})$/);if(t)return/^\d{2}:\d{2}$/.test(e)?`${t[1]}T${e}`:(We.warn("Invalid time format, expected HH:mm:",{category:"validation",operation:"invalid-time-format-expected-hh-mm",details:{value:e}}),r);let n=de(r);return!n||!/^\d{4}-\d{2}-\d{2}$/.test(n)?(We.warn("Invalid date part from dateString:",{category:"validation",operation:"invalid-date-part-datestring",details:{dateString:r,datePart:n}}),r):/^\d{2}:\d{2}$/.test(e)?`${n}T${e}`:(We.warn("Invalid time format, expected HH:mm:",{category:"validation",operation:"invalid-time-format-expected-hh-mm",details:{value:e}}),r)}catch(t){return We.error("Error combining date and time:",{category:"validation",operation:"combining-date-and-time",details:{dateString:r,timeString:e},error:t}),r}}function Vn(r,e={}){if(!r)return"";let{dateFormat:t="MMM d, yyyy",timeFormat:n,showTime:a=!0,userTimeFormat:i="24"}=e,s=n||(i==="12"?"h:mm a":"HH:mm");try{let o=Oa(r);return mr(r)&&a?!t||t.trim()===""?M(o,s):M(o,`${t} ${s}`):!t||t.trim()===""?"":M(o,t)}catch(o){return We.error("Error formatting datetime for display:",{category:"validation",operation:"formatting-datetime-display",details:{dateString:r},error:o}),r}}function Tu(r,e){try{let t=kt(r),n=kt(e),a=t,i=n;if(mr(r)){let s=Oi(r);if(s){let[o,l]=s.split(":").map(Number);a=new Date(t),a.setUTCHours(o,l,0,0)}}if(mr(e)){let s=Oi(e);if(s){let[o,l]=s.split(":").map(Number);i=new Date(n),i.setUTCHours(o,l,0,0)}}return mr(r)&&!mr(e)?(i=new Date(n),i.setUTCHours(23,59,59,999)):!mr(r)&&mr(e)&&(a=new Date(t),a.setUTCHours(23,59,59,999)),a.getTime(){if(typeof e!="string"||!e.trim())return!1;let t=e.trim();if(t.startsWith("T")&&/^T\d{2}:\d{2}(:\d{2})?/.test(t)||!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;try{return Oa(t),!0}catch(n){return We.warn("Invalid complete_instances entry (date parsing failed):",{category:"validation",operation:"invalid-complete-instances-entry-date-parsing",details:{value:e},error:n}),!1}}).map(e=>e.trim()):[]}function EXe(){return M(new Date,"yyyy-MM-dd'T'HH:mm")}function Lv(r,e){try{let t=Oa(r),n=yh(t,e);return mr(r)?M(n,"yyyy-MM-dd'T'HH:mm"):M(n,"yyyy-MM-dd")}catch(t){throw We.error("Error adding days to datetime:",{category:"validation",operation:"adding-days-datetime",details:{dateString:r,days:e},error:t}),t}}function Xp(r){try{let e=r.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!e)throw new Error(`Invalid date format for RRULE: ${r}`);let[,t,n,a]=e,i=parseInt(t,10),s=parseInt(n,10),o=parseInt(a,10);if(s<1||s>12)throw new Error(`Invalid month in date: ${r}`);if(o<1||o>31)throw new Error(`Invalid day in date: ${r}`);let l=new Date(Date.UTC(i,s-1,o));if(l.getUTCFullYear()!==i||l.getUTCMonth()!==s-1||l.getUTCDate()!==o)throw new Error(`Invalid date values: ${r}`);return l}catch(e){throw We.error("Error creating UTC date for RRULE:",{category:"validation",operation:"creating-utc-date-rrule",details:{dateString:r},error:e}),e}}function wn(r){let e=r.getFullYear(),t=r.getMonth(),n=r.getDate();return new Date(Date.UTC(e,t,n,0,0,0,0))}function j2(r){try{let e=Er(),t=wn(e);return r.getUTCFullYear()===t.getUTCFullYear()&&r.getUTCMonth()===t.getUTCMonth()&&r.getUTCDate()===t.getUTCDate()}catch(e){return We.error("Error in isTodayUTC:",{category:"validation",operation:"istodayutc",error:e}),!1}}function DXe(r,e){try{let t=M(r,"yyyy-MM-dd"),n=M(e,"yyyy-MM-dd"),a=Xp(t),i=Xp(n);return{utcStart:a,utcEnd:i}}catch(t){throw We.error("Error normalizing calendar boundaries to UTC:",{category:"provider",operation:"normalizing-calendar-boundaries-utc",details:{startDate:r,endDate:e},error:t}),t}}function PXe(r){try{let e=r.getUTCFullYear(),t=String(r.getUTCMonth()+1).padStart(2,"0"),n=String(r.getUTCDate()).padStart(2,"0");return`${e}-${t}-${n}`}catch(e){return We.error("Error formatting date as UTC string:",{category:"validation",operation:"formatting-date-as-utc-string",details:{date:r},error:e}),r.toISOString().split("T")[0]}}function ce(r){try{if(!r||!(r instanceof Date)||isNaN(r.getTime()))return We.warn("formatDateForStorage received invalid date:",{category:"validation",operation:"formatdateforstorage-received-invalid-date",details:{value:r}}),"";let e=r.getUTCFullYear(),t=String(r.getUTCMonth()+1).padStart(2,"0"),n=String(r.getUTCDate()).padStart(2,"0");return`${e}-${t}-${n}`}catch(e){return We.error("Error formatting date for storage:",{category:"validation",operation:"formatting-date-storage",details:{date:r},error:e}),""}}function $2(r,e){let t=[],n=ce(r),a=ce(e),i=Xp(n),s=Xp(a);for(;i<=s;)t.push(new Date(i)),i.setUTCDate(i.getUTCDate()+1);return t}function b_(r,e=1){let t=Xp(ce(r)),a=(t.getUTCDay()-e+7)%7,i=new Date(t);return i.setUTCDate(i.getUTCDate()-a),i}function B2(r,e=1){let t=b_(r,e),n=new Date(t);return n.setUTCDate(n.getUTCDate()+6),n}function T_(r){let e=Xp(ce(r));return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1))}function w_(r){let e=Xp(ce(r));return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+1,0))}function S_(r){if(!r||typeof r!="string")return!1;let e=r.toLowerCase().trim().replace(/\s+/g," ");return e in AS?!0:[/^in\s+(\d+)\s+(days?)$/,/^(\d+)\s+(days?)\s+ago$/,/^in\s+(\d+)\s+(weeks?)$/,/^(\d+)\s+(weeks?)\s+ago$/].some(n=>n.test(e))}function MXe(r){if(typeof r!="string")return!1;let e=r.trim();if(e===""||S_(e))return!0;try{let t=Oa(e);return Ca(t)}catch(t){return!1}}function Pc(r){if(!r||typeof r!="string")return r;let e=r.toLowerCase().trim().replace(/\s+/g," ");if(e in AS)try{return AS[e]()}catch(t){return We.error("Error resolving natural language date:",{category:"validation",operation:"resolving-natural-language-date",details:{value:r},error:t}),r}try{let t=e.match(/^in\s+(\d+)\s+(days?)$/);if(t){let n=parseInt(t[1],10);return Eh(nn(),n)}if(t=e.match(/^(\d+)\s+(days?)\s+ago$/),t){let n=parseInt(t[1],10);return Eh(nn(),-n)}if(t=e.match(/^in\s+(\d+)\s+(weeks?)$/),t){let n=parseInt(t[1],10);return L2(nn(),n)}if(t=e.match(/^(\d+)\s+(weeks?)\s+ago$/),t){let n=parseInt(t[1],10);return L2(nn(),-n)}}catch(t){We.error("Error parsing relative natural language date:",{category:"validation",operation:"parsing-relative-natural-language-date",details:{value:r},error:t})}return r}function AXe(){let r=Object.keys(AS),e=["in 3 days","2 days ago","in 1 week","2 weeks ago"];return[...r,...e].sort()}var We,AS,Me=y(()=>{Wr();K();We=N({tag:"Utils/DateUtils"});AS={today:()=>nn(),tomorrow:()=>Eh(nn(),1),yesterday:()=>Eh(nn(),-1),"next week":()=>Eh(nn(),7),"last week":()=>Eh(nn(),-7)}});function Mh(r){return Yme(sfe(r))}function ife(r,e,t){return Gme(sfe(r),e,t)}function H2(r,e){var t;return N2(r,{today:(t=e==null?void 0:e.minOccurrenceDate)!=null?t:nn()})}function wu(r,e=!0,t){var n;return qme(r,e,{today:(n=t==null?void 0:t.minOccurrenceDate)!=null?n:nn()})}function sfe(r){let e=afe(r.scheduled),t=afe(r.dateCreated);return e===r.scheduled&&t===r.dateCreated?r:{...r,scheduled:e,dateCreated:t}}function afe(r){if(!r)return r;let e=r.trim().match(/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2})(Z|[+-]\d{2}:\d{2})?$/);if(!e)return r;let[,t,n,a=""]=e;return`${t}T${n}:00${a}`}var Ah=y(()=>{F2();F2();Me()});function _r(r,e=""){var a;let t=(a=r==null?void 0:r.trim())!=null?a:"";if(!t)return e;let n=t.toLowerCase();if(V2.has(n))return`var(--color-${n})`;if(n==="accent")return"var(--color-accent)";if(n.startsWith("color-")){let i=n.slice(6);if(V2.has(i)||i==="accent")return`var(--${n})`}return n.startsWith("--")?`var(${t})`:t}function Su(r){var i;let e=(i=r==null?void 0:r.trim())!=null?i:"",t=e.match(_Xe);if(!t)return e;let n=t[1].toLowerCase();if(n==="--color-accent")return"accent";let a=n.replace(/^--color-/,"");return V2.has(a)?a:e}function xu(r){return _r(r).startsWith("var(")}function C_(r){let e=_r(r);return e?!!(IXe.test(e)||xu(e)||lfe.test(e)):!1}function zv(r,e){let t=_r(r);if(!t)return`rgba(128, 128, 128, ${e})`;if(xu(t)||lfe.test(t))return`color-mix(in srgb, ${t} ${Math.round(e*100)}%, transparent)`;let n=t.replace("#","");if(/^[0-9a-f]{3}$/i.test(n)){let o=parseInt(n[0]+n[0],16),l=parseInt(n[1]+n[1],16),c=parseInt(n[2]+n[2],16);return`rgba(${o}, ${l}, ${c}, ${e})`}if(!/^[0-9a-f]{6}$/i.test(n))return`rgba(128, 128, 128, ${e})`;let a=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);return`rgba(${a}, ${i}, ${s}, ${e})`}var ofe,V2,_Xe,IXe,lfe,x_,cfe,Mc=y(()=>{ofe=["red","orange","yellow","green","cyan","blue","purple","pink"],V2=new Set(ofe),_Xe=/^var\(\s*(--[a-z0-9_-]+)\s*\)$/i,IXe=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,lfe=/^(?:rgb|rgba|hsl|hsla|oklch|lab|color|color-mix)\(/i,x_="#6366f1, red, blue, cyan",cfe=[...ofe,"accent","var(--color-accent)"]});async function jv(r,e){var a;let n=((a=E_.get(r))!=null?a:Promise.resolve()).catch(()=>{}).then(e);E_.set(r,n);try{return await n}finally{E_.get(r)===n&&E_.delete(r)}}async function Fr(r,e,t){await jv(e,()=>IS(r,e,t))}async function IS(r,e,t){await r.fileManager.processFrontMatter(e,t)}async function NS(r,e,t){return jv(e,()=>RS(r,e,t))}async function RS(r,e,t){return r.vault.process(e,t)}async function _h(r,e,t){return r.vault.create(e,t)}async function FS(r,e){await r.vault.createFolder(e)}async function Mo(r,e,t){await jv(e,()=>r.vault.modify(e,t))}async function q2(r,e,t){await r.vault.rename(e,t)}var E_,W2=y(()=>{E_=new WeakMap});function pfe(r){return window.moment(r)}function D_(r){if(!r.startsWith("---"))return{};let e=r.indexOf("---",3);if(e===-1)return{};let t=r.substring(3,e);try{return(0,Nh.parseYaml)(t)||{}}catch(n){return Ih.error("Error parsing frontmatter:",{category:"validation",operation:"parsing-frontmatter",error:n}),{}}}async function tm(r,e){try{let n=(0,Nh.normalizePath)(e).split("/").filter(i=>i.length>0),a="";for(let i of n)if(a=a?`${a}/${i}`:i,!await r.adapter.exists(a))try{await r.createFolder(a)}catch(s){if(!await r.adapter.exists(a))throw new Error(`Failed to create folder "${a}"`)}}catch(t){let n=t instanceof Error?t.message:String(t),a=t instanceof Error?t.stack:void 0;Ih.error("Error creating folder structure:",{category:"internal",operation:"creating-folder-structure",details:{stack:a,folderPath:e,normalizedPath:(0,Nh.normalizePath)(e)},error:n});let i=new Error(`Failed to create folder "${e}": ${n}`);throw a&&(i.stack=a),i}}function NXe(r,e){try{let t=new Date(r),n=new Date(e);if(isNaN(t.getTime())||isNaN(n.getTime()))return Ih.error("Invalid timestamps for duration calculation:",{category:"validation",operation:"invalid-timestamps-duration-calculation",details:{startTime:r,endTime:e}}),0;if(n<=t)return Ih.error("End time is not after start time:",{category:"internal",operation:"end-time-not-start-time",details:{startTime:r,endTime:e}}),0;let a=n.getTime()-t.getTime(),i=Math.round(a/(1e3*60));return Math.max(0,i)}catch(t){return Ih.error("Error calculating duration:",{category:"internal",operation:"calculating-duration",details:{startTime:r,endTime:e},error:t}),0}}function Li(r){return!r||!Array.isArray(r)?0:r.reduce((e,t)=>{if(!t.startTime||!t.endTime)return e;let n=NXe(t.startTime,t.endTime);return e+n},0)}function P_(r){return!r||!Array.isArray(r)?null:r.find(e=>e.startTime&&!e.endTime)||null}function M_(r){if(!r||r===0||isNaN(r))return"0m";let e=Math.floor(r/60),t=r%60;return e===0?`${t}m`:t===0?`${e}h`:`${e}h ${t}m`}function OS(r){if(r==="none")return"";let e=new Date,t;switch(r){case"today":t=e;break;case"tomorrow":t=new Date(e),t.setDate(e.getDate()+1);break;case"next-week":t=new Date(e),t.setDate(e.getDate()+7);break;default:return""}return M(t,"yyyy-MM-dd")}function RXe(r){return typeof r=="string"&&/^([01]\d|2[0-3]):[0-5]\d$/.test(r)}function Ac(r,e){let t=OS(r);return!t||!RXe(e)?t:La(t,e)}function Y2(r,e){return r.getUTCFullYear()===e.getUTCFullYear()&&r.getUTCMonth()===e.getUTCMonth()&&r.getUTCDate()===e.getUTCDate()}function mfe(r,e,t,n,a,i,s){var d;let o=r.metadataCache.getFileCache(n),l=o==null?void 0:o.frontmatter;if(l)if(a){let u=a.mapFromFrontmatter(l,t,i);return{title:u.title||"Untitled task",status:u.status||s||"open",priority:u.priority||"normal",due:u.due,scheduled:u.scheduled,path:t,archived:u.archived||!1,tags:u.tags||[],contexts:u.contexts||[],projects:u.projects||[],attachments:u.attachments||[],recurrence:u.recurrence,complete_instances:u.complete_instances,completedDate:u.completedDate,timeEstimate:u.timeEstimate,timeEntries:u.timeEntries,dateCreated:u.dateCreated,dateModified:u.dateModified,reminders:u.reminders}}else{let p=new bh(bS).mapFromFrontmatter(l,t,i);return{title:p.title||"Untitled task",status:p.status||s||"open",priority:p.priority||"normal",due:p.due,scheduled:p.scheduled,path:t,archived:p.archived||!1,tags:p.tags||[],contexts:p.contexts||[],projects:p.projects||[],attachments:p.attachments||[],recurrence:p.recurrence,complete_instances:p.complete_instances,completedDate:p.completedDate,timeEstimate:p.timeEstimate,timeEntries:p.timeEntries,dateCreated:p.dateCreated,dateModified:p.dateModified,reminders:p.reminders}}return{title:((d=t.split("/").pop())==null?void 0:d.replace(".md",""))||"Untitled",status:s||"open",priority:"normal",path:t,archived:!1,reminders:[]}}function rm(r){if(r.startsWith("---")){let e=r.match(/^---\s*\r?\n([\s\S]*?)\r?\n---\s*\r?\n?([\s\S]*)$/);if(e)return{frontmatter:e[1],body:e[2]||""}}return{frontmatter:null,body:r}}function ffe(r){let e=/^(\s*)([-*+]|\d+\.)(\s+\[)[xX](\].*)/gm,t=!1;return{content:r.replace(e,(a,i,s,o,l)=>(t=!0,`${i}${s}${o} ${l}`)),changed:t}}function A_(r,e){return I2(r,e)}function $v(r,e,t){return h_(r,e,t)}function Bv(r,e,t){return Jp(r,e,t)}function hfe(r){return Vme(r)}function gfe(r,e=!0){return wu(r,e)}function yfe(r){return Wme(r)}function dfe(r,e=!1){if(e&&r==="24:00")return ufe;let t=/^([0-1]?[0-9]|2[0-3]):([0-5][0-9])$/.exec(r);return t?Number(t[1])*60+Number(t[2]):null}function FXe(r){if(!r||typeof r!="object")return!1;let e=r;if(!e.id||typeof e.id!="string"||!e.title||typeof e.title!="string"||!e.startTime||typeof e.startTime!="string"||!e.endTime||typeof e.endTime!="string")return!1;let t=dfe(e.startTime),n=dfe(e.endTime,!0);if(t===null||n===null||(e.endTime==="00:00"&&t>0?ufe:n)<=t||e.attachments&&!Array.isArray(e.attachments))return!1;if(e.attachments){for(let i of e.attachments)if(typeof i!="string"||!i.trim())return!1}return!(e.color&&typeof e.color!="string"||e.description&&typeof e.description!="string")}function OXe(r,e){try{let t=D_(r);if(!t||!t.timeblocks||!Array.isArray(t.timeblocks))return[];let n=[];for(let a of t.timeblocks)FXe(a)?n.push(a):Ih.warn(`Invalid timeblock in ${e}:`,{category:"validation",operation:"invalid-timeblock",details:{value:a}});return n}catch(t){return Ih.error(`Error extracting timeblocks from ${e}:`,{category:"internal",operation:"extracting-timeblocks",error:t}),[]}}function G2(){return`tb-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}function LXe(r,e,t){return{...r,id:G2(),startTime:e,endTime:t,attachments:r.attachments?[...r.attachments]:void 0}}async function K2(r,e,t,n,a,i){let{getDailyNote:s,getAllDailyNotes:o,appHasDailyNotesPluginLoaded:l}=await Promise.resolve().then(()=>st(iu()));if(!l())throw new Error("Daily Notes plugin is not enabled");let c=o(),d=pfe(t),u=s(d,c);if(!u)throw new Error(`Daily note for ${t} not found`);let p=await r.vault.read(u),m=OXe(p,u.path),f=m.findIndex(v=>v.id===e);if(f===-1)throw new Error(`Timeblock ${e} not found`);let h=m[f];if(t===n){await zXe(r,u,e,a,i);return}await jXe(r,u,e);let g={...h,startTime:a,endTime:i};await kfe(r,n,g)}async function vfe(r,e,t,n,a){let i=LXe(t,n,a);return await kfe(r,e,i),i}async function zXe(r,e,t,n,a){let i=await r.vault.read(e),s=D_(i)||{};if(!s.timeblocks||!Array.isArray(s.timeblocks))throw new Error("No timeblocks found in frontmatter");let o=s.timeblocks.findIndex(l=>l.id===t);if(o===-1)throw new Error(`Timeblock ${t} not found`);s.timeblocks[o].startTime=n,s.timeblocks[o].endTime=a,await Z2(r,e,s,i)}async function jXe(r,e,t){let n=await r.vault.read(e),a=D_(n)||{};!a.timeblocks||!Array.isArray(a.timeblocks)||(a.timeblocks=a.timeblocks.filter(i=>i.id!==t),await Z2(r,e,a,n))}async function kfe(r,e,t){let{createDailyNote:n,getDailyNote:a,getAllDailyNotes:i}=await Promise.resolve().then(()=>st(iu())),s=pfe(e),o=i(),l=a(s,o);if(!l){try{l=await n(s)}catch(u){let p=u instanceof Error?u.message:String(u);throw new Error(`Failed to create daily note: ${p}. Please check your Daily Notes plugin configuration and ensure the daily notes folder exists.`)}if(!l)throw new Error("Failed to create daily note. Please check your Daily Notes plugin configuration and ensure the daily notes folder exists.")}let c=await r.vault.read(l),d=D_(c)||{};d.timeblocks||(d.timeblocks=[]),d.timeblocks.push(t),await Z2(r,l,d,c)}async function Z2(r,e,t,n){let a=n;if(n.startsWith("---")){let o=n.indexOf("---",3);o!==-1&&(a=n.substring(o+3))}let s=`--- ${(0,Nh.stringifyYaml)(t)}---${a}`;await Mo(r,e,s)}function Rl(r){return!r||!Array.isArray(r)?[]:r.filter(e=>{if(typeof e!="string")return!1;let t=e.trim();return!(t.length===0||t==='""'||t==="''")})}function bfe(r,e){return g_(r,e)}function Tfe(r,e,t){return ife(r,e,t)}function za(r){return!r||typeof r!="string"?"":r.split(",").map(e=>fS(e)).filter(e=>e.length>0).join(", ")}function Cu(r){return!r||typeof r!="string"?"":r.replace(/[^a-zA-Z0-9-]/g,"-").toLowerCase()}var Nh,Ih,ufe,Ct=y(()=>{Nh=require("obsidian");Wr();p2();t_();Ah();Me();Dv();Mc();K();W2();Ih=N({tag:"Utils/Helpers"}),ufe=1440});function J(r){var e;if(r==null)return"";if(typeof r=="string")return r;if(typeof r=="number")return Number.prototype.toString.call(r);if(typeof r=="bigint")return BigInt.prototype.toString.call(r);if(typeof r=="boolean")return r?"true":"false";if(typeof r=="symbol")return(e=r.description)!=null?e:"";if(r instanceof Date)return r.toISOString();if(Array.isArray(r))return r.map(t=>J(t)).filter(t=>t.length>0).join(", ");try{let t=JSON.stringify(r);return typeof t=="string"?t:""}catch(t){return""}}function __(r){return Array.isArray(r)?r.map(e=>J(e)):[J(r)]}var kr=y(()=>{});var Ssr,nm,I_=y(()=>{kr();K();Ssr=N({tag:"Utils/ProjectMetadataResolver"}),nm=class{constructor(e){this.deps=e}buildMetadataRows(e,t,n){var s;let a=[],i=Math.min(e.length,3);for(let o=0;o0&&a.push(d.join(" "))}catch(c){}}return a}stringifyFmValue(e){if(e==null)return"";if(Array.isArray(e))return e.map(a=>this.stringifyFmValue(a)).filter(Boolean).join(", ");let t=typeof e;if(t==="string"){let a=e.trim(),i=a.match(/^\[\[([^\]]+)\]\]$/);if(i){let l=i[1].split("|");if(l.length>1&&l[1].trim())return l[1].trim();let c=l[0].split("#")[0].trim();return(c.split("/").pop()||c).replace(/\.md$/i,"")}let s=a.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return s?s[1].trim():a}if(t==="number"||t==="boolean")return J(e);if(t==="object"){let n=e;if(typeof n.path=="string"){let a=n.path;return(a.split("/").pop()||a).replace(/\.md$/i,"")}return""}return""}resolve(e,t){if(!e)return"";if(e.startsWith("file."))switch(e){case"file.basename":return t.basename||"";case"file.name":return t.name||"";case"file.path":return t.path||"";case"file.parent":return t.parent||"";default:return""}if(e==="title")return t.title||"";if(e==="aliases"){let i=t.aliases||[];return i.length?i.join(", "):""}let n=e;e.startsWith("frontmatter:")&&(n=e.slice(12));let a=this.deps.getFrontmatter(t)||{};return this.stringifyFmValue(a[n])}}});function $Xe(r){let e=[],t="",n=0;for(;na.length>0)}function BXe(r){return r.replace(/\\\|/g,"|").replace(/\\\)/g,")")}function _c(r){let e=[];if(!r)return e;let t=/\{([^}]*)\}/g,n,a=0;for(;(n=t.exec(r))!==null;){let s=r.slice(a,n.index);s.length>0&&e.push({property:`literal:${s}`,showName:!1}),a=t.lastIndex;let o=n[1].trim();if(!o)continue;let l=$Xe(o);if(l.length===0)continue;let c=l[0];if(!c)throw new Error("Missing property name in token");let d={property:c,showName:!1};for(let u=1;u0&&e.push({property:`literal:${i}`,showName:!1}),e}var LS=y(()=>{});function wfe(r){return r!=null?r.trim():""}function UXe(r){let e=wfe(r);return e.length>0?e.split(",").map(t=>t.trim()).filter(Boolean):[]}function HXe(r){return r?r.trim():""}function Uv(r){let e=HXe(r==null?void 0:r.propertyKey),t=wfe(r==null?void 0:r.propertyValue);return{key:e,value:t,enabled:e.length>0}}function Hv(r,e){if(!e.enabled)return!0;if(!r||typeof r!="object"||!(e.key in r))return!1;let t=r[e.key],n=UXe(e.value);if(n.length===0)return t!=null;let a=new Set(n.map(s=>s.toLowerCase())),i=s=>{if(s==null)return!1;if(Array.isArray(s))return s.some(o=>i(o));if(typeof s=="string")return a.has(s.trim().toLowerCase());if(typeof s=="number"||typeof s=="boolean")return a.has(String(s).toLowerCase());if(typeof s=="object")try{return a.has(JSON.stringify(s).toLowerCase())}catch(o){return!1}return a.has(J(s).toLowerCase())};return i(t)}var N_=y(()=>{kr()});var ja,Eu,Rh,br,Du=y(()=>{Me();ja=class extends Error{constructor(t,n,a){super(t);this.field=n;this.nodeId=a;this.name="FilterValidationError"}},Eu=class extends Error{constructor(t,n){super(t);this.nodeId=n;this.name="FilterEvaluationError"}},Rh=class Rh{static generateId(){return`filter_${Date.now()}_${++this.idCounter}`}static deepCloneFilterQuery(e){return JSON.parse(JSON.stringify(e))}static validateFilterNode(e,t=!0){if(!e||typeof e!="object")throw new ja("Filter node must be an object");if(!("id"in e)||!e.id||typeof e.id!="string")throw new ja("Filter node must have a valid string ID",void 0,"id"in e?String(e.id):"unknown");if(e.type==="condition")this.validateCondition(e,t);else if(e.type==="group")this.validateGroup(e,t);else{let n=e;throw new ja(`Unknown filter node type: ${String(n.type)}`,void 0,typeof n.id=="string"?n.id:void 0)}}static validateCondition(e,t=!0){if(typeof e.property!="string")throw new ja("Condition must have a valid property","property",e.id);if(t&&e.property==="")throw new ja("Property must be selected","property",e.id);if(e.property==="")return;if(!e.operator||typeof e.operator!="string")throw new ja("Condition must have a valid operator","operator",e.id);if(!this.getValidOperatorsForProperty(e.property).includes(e.operator))throw new ja(`Operator '${e.operator}' is not valid for property '${e.property}'`,"operator",e.id);if(t&&this.operatorRequiresValue(e.operator)&&(e.value===null||e.value===void 0||e.value===""))throw new ja(`Operator '${e.operator}' requires a value`,"value",e.id)}static validateGroup(e,t=!0){if(!e.conjunction||!["and","or"].includes(e.conjunction))throw new ja("Group must have a valid conjunction (and/or)","conjunction",e.id);if(!Array.isArray(e.children))throw new ja("Group must have a children array","children",e.id);e.children.forEach((n,a)=>{try{this.validateFilterNode(n,t)}catch(i){throw i instanceof ja?new ja(`Child ${a}: ${i.message}`,i.field,e.id):i}})}static getValidOperatorsForProperty(e){return typeof e=="string"&&e.startsWith("user:")?["is","is-not","contains","does-not-contain","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty","is-checked","is-not-checked","is-greater-than","is-less-than","is-greater-than-or-equal","is-less-than-or-equal"]:{"":[],title:["is","is-not","contains","does-not-contain","is-empty","is-not-empty"],path:["contains","does-not-contain","is-empty","is-not-empty"],status:["is","is-not","is-empty","is-not-empty"],priority:["is","is-not","is-empty","is-not-empty"],tags:["contains","does-not-contain","is-empty","is-not-empty"],contexts:["contains","does-not-contain","is-empty","is-not-empty"],projects:["contains","does-not-contain","is-empty","is-not-empty"],blockedBy:["contains","does-not-contain","is-empty","is-not-empty"],blocking:["contains","does-not-contain","is-empty","is-not-empty"],due:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],scheduled:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],completedDate:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],dateCreated:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],dateModified:["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"],archived:["is-checked","is-not-checked"],hasSubtasks:["is-checked","is-not-checked"],"dependencies.isBlocked":["is-checked","is-not-checked"],"dependencies.isBlocking":["is-checked","is-not-checked"],timeEstimate:["is","is-not","is-greater-than","is-less-than","is-greater-than-or-equal","is-less-than-or-equal"],recurrence:["is-empty","is-not-empty"],"status.isCompleted":["is-checked","is-not-checked"]}[e]||[]}static isFilterNodeComplete(e){try{return this.validateFilterNode(e,!0),!0}catch(t){return!1}}static operatorRequiresValue(e){return!["is-empty","is-not-empty","is-checked","is-not-checked"].includes(e)}static getTaskPropertyValue(e,t){var n;switch(t){case"title":return e.title;case"path":return e.path;case"status":return e.status;case"priority":return e.priority;case"tags":return e.tags||[];case"contexts":return e.contexts||[];case"projects":return e.projects||[];case"blockedBy":return((n=e.blockedBy)==null?void 0:n.map(a=>a.uid))||[];case"blocking":return e.blocking||[];case"due":return e.due;case"scheduled":return e.scheduled;case"completedDate":return e.completedDate;case"dateCreated":return e.dateCreated;case"dateModified":return e.dateModified;case"archived":return e.archived;case"hasSubtasks":return e.hasSubtasks===!0;case"timeEstimate":return e.timeEstimate;case"recurrence":return e.recurrence;case"status.isCompleted":return;case"dependencies.isBlocked":return e.isBlocked===!0;case"dependencies.isBlocking":return e.isBlocking===!0;default:throw new Eu(`Unknown property: ${t}`)}}static applyOperator(e,t,n,a,i){try{switch(t){case"is":return this.isEqual(e,n,i);case"is-not":return!this.isEqual(e,n,i);case"contains":return this.contains(e,n,i);case"does-not-contain":return!this.contains(e,n,i);case"is-before":return this.isBefore(e,n);case"is-after":return this.isAfter(e,n);case"is-on-or-before":return this.isOnOrBefore(e,n);case"is-on-or-after":return this.isOnOrAfter(e,n);case"is-empty":return this.isEmpty(e);case"is-not-empty":return!this.isEmpty(e);case"is-checked":return e===!0;case"is-not-checked":return e!==!0;case"is-greater-than":return this.isGreaterThan(e,n);case"is-less-than":return this.isLessThan(e,n);case"is-greater-than-or-equal":return this.isGreaterThanOrEqual(e,n);case"is-less-than-or-equal":return this.isLessThanOrEqual(e,n);default:throw new Eu("Unknown operator",a)}}catch(s){throw s instanceof Eu?s:new Eu(`Error applying operator '${t}': ${s.message}`,a)}}static isEqual(e,t,n){if(n&&this.isDateProperty(n)&&typeof e=="string"&&typeof t=="string"&&(e||S_(t)))return this.isEqualDate(e,t);let a=(i,s)=>this.hasNumericComparison(i,s)?this.toFiniteNumber(i)===this.toFiniteNumber(s):i===s;return Array.isArray(e)?Array.isArray(t)?e.some(i=>t.some(s=>a(i,s))):e.some(i=>a(i,t)):Array.isArray(t)?t.some(i=>a(e,i)):a(e,t)}static hasNumericComparison(e,t){return!(typeof e=="number")&&!(typeof t=="number")?!1:this.toFiniteNumber(e)!==void 0&&this.toFiniteNumber(t)!==void 0}static toFiniteNumber(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(typeof e!="string")return;let t=e.trim();if(!t)return;let n=Number(t);return Number.isFinite(n)?n:void 0}static matchesHierarchicalTag(e,t){if(!e||!t)return!1;let n=e.toLowerCase(),a=t.toLowerCase();return!!(n===a||n.startsWith(a+"/")||n.includes(a))}static matchesHierarchicalTagExact(e,t){if(!e||!t)return!1;let n=e.toLowerCase(),a=t.toLowerCase();return!!(n===a||n.startsWith(a+"/"))}static matchesTagConditions(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(t.length===0)return!0;let n=[],a=[];for(let i of t)if(typeof i=="string"&&i.startsWith("-")){let s=i.slice(1);s&&a.push(s)}else typeof i=="string"&&n.push(i);for(let i of a)if(e.some(o=>this.matchesHierarchicalTag(o,i)))return!1;return n.length>0?n.some(i=>e.some(s=>this.matchesHierarchicalTag(s,i))):!0}static contains(e,t,n){if(Array.isArray(e))if(Array.isArray(t))if(n==="tags"){let a=e.filter(s=>typeof s=="string"),i=t.filter(s=>typeof s=="string");return Rh.matchesTagConditions(a,i)}else return t.some(a=>e.some(i=>typeof i=="string"&&typeof a=="string"&&i.toLowerCase().includes(a.toLowerCase())));else{let a=typeof t=="string"?t:String(t!=null?t:"");if(n==="tags"){let i=e.filter(s=>typeof s=="string");return Rh.matchesTagConditions(i,[a])}else{let i=a.toLowerCase();return e.some(s=>typeof s=="string"&&s.toLowerCase().includes(i))}}else if(typeof e=="string")if(Array.isArray(t))if(n==="tags"){let a=t.filter(i=>typeof i=="string");return Rh.matchesTagConditions([e],a)}else return t.some(a=>typeof a=="string"&&e.toLowerCase().includes(a.toLowerCase()));else return n==="tags"&&typeof t=="string"?Rh.matchesTagConditions([e],[t]):typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase());return!1}static isBefore(e,t){if(!e||!t)return!1;try{let n=Pc(t);return Tu(e,n)}catch(n){return!1}}static isAfter(e,t){if(!e||!t)return!1;try{let n=Pc(t);return Tu(n,e)}catch(n){return!1}}static isOnOrBefore(e,t){if(!e||!t)return!1;try{let n=Pc(t);return Tu(e,n)||Po(de(e),de(n))}catch(n){return!1}}static isOnOrAfter(e,t){if(!e||!t)return!1;try{let n=Pc(t);return Tu(n,e)||Po(de(e),de(n))}catch(n){return!1}}static isDateProperty(e){return["due","scheduled","completedDate","dateCreated","dateModified"].includes(e)}static isEqualDate(e,t){try{let n=Pc(t);return Po(de(e),de(n))}catch(n){return!1}}static isEmpty(e){return e==null?!0:typeof e=="string"?e.trim()==="":Array.isArray(e)?e.length===0?!0:e.every(t=>{if(typeof t!="string")return!1;let n=t.trim();return n.length===0||n==='""'||n==="''"}):!1}static isGreaterThan(e,t){let n=typeof e=="number"?e:parseFloat(e),a=typeof t=="number"?t:parseFloat(t);return isNaN(n)||isNaN(a)?!1:n>a}static isLessThan(e,t){let n=typeof e=="number"?e:parseFloat(e),a=typeof t=="number"?t:parseFloat(t);return isNaN(n)||isNaN(a)?!1:n=a}static isLessThanOrEqual(e,t){let n=typeof e=="number"?e:parseFloat(e),a=typeof t=="number"?t:parseFloat(t);return isNaN(n)||isNaN(a)?!1:n<=a}};Rh.idCounter=0;br=Rh});function Vv(r){var n,a,i;let e=new Set;for(let s of(n=r==null?void 0:r.tags)!=null?n:[])J2(e,s.tag);let t=(a=r==null?void 0:r.frontmatter)!=null?a:null;for(let s of(i=(0,Sfe.parseFrontMatterTags)(t))!=null?i:[])J2(e,s);return Q2(e,t==null?void 0:t.tags),Q2(e,t==null?void 0:t.tag),Array.from(e)}function Q2(r,e){if(Array.isArray(e)){for(let t of e)Q2(r,t);return}if(typeof e=="string")for(let t of e.split(/[,\s]+/))J2(r,t)}function J2(r,e){if(typeof e!="string")return;let t=e.trim().replace(/^#/,"");t&&r.add(t)}var Sfe,R_=y(()=>{Sfe=require("obsidian")});function zS(r,e){if(!r||!e)return 0;let t=r.toLowerCase().split(" ").filter(Boolean),n=e.toLowerCase(),a=0,i=0;for(let s=0;s0&&l===a&&(i+=5),a=l+o.length}return i}var xfe=y(()=>{});var eU={};at(eU,{FileSuggestHelper:()=>X2,getActiveFolderPath:()=>F_,isPathInIncludedFolders:()=>O_,resolveIncludeFolders:()=>Dfe});function VXe(r){var t;let e=(t=r==null?void 0:r.app)==null?void 0:t.vault;return typeof(e==null?void 0:e.getFiles)=="function"?e.getFiles():typeof(e==null?void 0:e.getMarkdownFiles)=="function"?e.getMarkdownFiles():[]}function qXe(r,e){var t,n;if(e.extension==="md"){let a=(n=(t=r.app.metadataCache).fileToLinktext)==null?void 0:n.call(t,e,"",!0);return typeof a=="string"&&a.trim()?a:e.basename}return e.name||e.path.split("/").pop()||e.basename}function Efe(r){return r.trim().replace(/\\/g,"/").replace(/^\/+/,"").replace(/\/+$/,"")}function WXe(r,e=""){let t=Efe(e).split("/").filter(Boolean);for(let n of r.replace(/\\/g,"/").split("/"))!n||n==="."||(n===".."?t.pop():t.push(n));return t.join("/")}function YXe(r,e){let t=Efe(r);return t==="."||t===".."||t.startsWith("./")||t.startsWith("../")?WXe(t,e):t}function F_(r){var t,n,a,i;let e=(a=(n=(t=r==null?void 0:r.app)==null?void 0:t.workspace)==null?void 0:n.getActiveFile)==null?void 0:a.call(n);if(((i=e==null?void 0:e.parent)==null?void 0:i.path)!==void 0)return e.parent.path;if(typeof(e==null?void 0:e.path)=="string")return e.path.split("/").slice(0,-1).join("/")}function Dfe(r,e){return r.filter(t=>t.trim().length>0).map(t=>YXe(t,e))}function O_(r,e,t){return Dfe(e,t).some(a=>a===""||r===a||r.startsWith(`${a}/`))}var Cfe,X2,jS=y(()=>{Cfe=require("obsidian");xfe();LS();N_();Du();mS();R_();X2={async suggest(r,e,t=20,n,a=F_(r)){var o,l;let i=async()=>{var w,S,C,E,D,P,O;let c=VXe(r),d=[],u=Sc((w=r.settings)==null?void 0:w.excludedFolders),p=((E=(C=(S=r.settings)==null?void 0:S.projectAutosuggest)==null?void 0:C.rows)!=null?E:[]).slice(0,3),m=new Set;for(let z of p)try{let R=_c(z);for(let A of R)A.searchable&&!A.property.startsWith("literal:")&&m.add(A.property)}catch(R){}let f=(e||"").toLowerCase(),h=(D=n==null?void 0:n.requiredTags)!=null?D:[],g=(P=n==null?void 0:n.includeFolders)!=null?P:[],v=Uv(n);for(let z of c){if(Cv(z.path,u))continue;let R=r.app.metadataCache.getFileCache(z);if(h.length>0&&!br.matchesTagConditions(Vv(R),h)||g.length>0&&!O_(z.path,g,a))continue;if(v.enabled){let G=R==null?void 0:R.frontmatter;if(!Hv(G,v))continue}let A=z.basename,F="";if(R!=null&&R.frontmatter){let G=r.fieldMapper.mapFromFrontmatter(R.frontmatter,z.path,r.settings.storeTitleInFilename);F=typeof G.title=="string"?G.title:""}let $=R!=null&&R.frontmatter?(0,Cfe.parseFrontMatterAliases)(R.frontmatter)||[]:[],B=0,Q=f.length>0?zS(e,A):1;if(Q>0&&(B=Math.max(B,Q+15)),F){let G=zS(e,F);G>0&&(B=Math.max(B,G+5))}if(Array.isArray($)){for(let G of $)if(typeof G=="string"){let ie=zS(e,G);ie>0&&(B=Math.max(B,ie))}}if(m.size>0){let G=(R==null?void 0:R.frontmatter)||{};for(let ie of m){let Ee="";if(ie==="file.path")Ee=z.path;else if(ie==="file.parent")Ee=((O=z.parent)==null?void 0:O.path)||"";else if(ie==="file.basename")Ee=A;else if(ie==="title")Ee=F;else if(ie==="aliases")Ee=(Array.isArray($)?$.filter(re=>typeof re=="string"):[]).join(" ");else{let ee=G[ie];ee!=null&&(Array.isArray(ee)?Ee=ee.filter(re=>typeof re=="string").join(" "):typeof ee=="object"?Ee=JSON.stringify(ee):(typeof ee=="string"||typeof ee=="number"||typeof ee=="boolean")&&(Ee=String(ee)))}if(Ee){let ee=zS(e,Ee),re=ee>0?ee:Ee.toLowerCase().includes(f)?30:0;re>0&&(B=Math.max(B,re))}}}if(B>0){let G=[];F&&F!==A&&G.push(`title: ${F}`);let ie=Array.isArray($)?$.filter(ee=>typeof ee=="string"):[];ie.length&&G.push(`aliases: ${ie.join(", ")}`);let Ee=G.length?`${A} [${G.join(" | ")}]`:A;d.push({insertText:qXe(r,z),displayText:Ee,path:z.path,score:B})}}d.sort((z,R)=>R.score-z.score);let b=[],k=new Set;for(let z of d)if(!k.has(z.insertText)&&(b.push(z),k.add(z.insertText),b.length>=t))break;return b},s=(l=(o=r.settings)==null?void 0:o.suggestionDebounceMs)!=null?l:0;return s?new Promise(c=>{let d=r;d.__fileSuggestTimer&&window.clearTimeout(d.__fileSuggestTimer),d.__fileSuggestTimer=window.setTimeout(()=>{(async()=>{let u=await i();c(u)})()},s)}):i()}}});var Ic,GXe,Ao,qv=y(()=>{Ic=require("obsidian");I_();LS();N_();Du();R_();jS();K();GXe=N({tag:"Modals/ProjectSelectModal"}),Ao=class extends Ic.FuzzySuggestModal{constructor(e,t,n){super(e),this.plugin=t,this.onChoose=n,this.setPlaceholder("Type to search for project notes..."),this.setInstructions([{command:"\u2191\u2193",purpose:"to navigate"},{command:"\u21B5",purpose:"to select"},{command:"esc",purpose:"to cancel"}])}getItems(){var s,o,l,c,d,u,p;let e=this.app.vault.getAllLoadedFiles().filter(m=>m instanceof Ic.TFile&&m.extension==="md"&&!m.path.includes(".trash")),t=(l=(o=(s=this.plugin.settings)==null?void 0:s.projectAutosuggest)==null?void 0:o.requiredTags)!=null?l:[],n=(u=(d=(c=this.plugin.settings)==null?void 0:c.projectAutosuggest)==null?void 0:d.includeFolders)!=null?u:[],a=Uv((p=this.plugin.settings)==null?void 0:p.projectAutosuggest),i=F_(this.plugin);return t.length===0&&n.length===0&&!a.enabled?e:e.filter(m=>{if(!(m instanceof Ic.TFile))return!1;let f=this.app.metadataCache.getFileCache(m);if(t.length>0&&!br.matchesTagConditions(Vv(f),t)||n.length>0&&!O_(m.path,n,i))return!1;if(a.enabled){let h=f==null?void 0:f.frontmatter;if(!Hv(h,a))return!1}return!0})}getItemText(e){var s,o,l,c;if(!(e instanceof Ic.TFile))return e.name;let t=`${e.name} ${e.path}`,n=(l=(o=(s=this.plugin.settings)==null?void 0:s.projectAutosuggest)==null?void 0:o.rows)!=null?l:[],a=new Set;for(let d of n)try{let u=_c(d);for(let p of u)p.searchable&&!p.property.startsWith("literal:")&&a.add(p.property)}catch(u){}let i=this.app.metadataCache.getFileCache(e);if(i!=null&&i.frontmatter){let d=this.plugin.fieldMapper.mapFromFrontmatter(i.frontmatter,e.path,this.plugin.settings.storeTitleInFilename),u=typeof d.title=="string"?d.title:"";u&&(t+=` ${u}`);let p=(0,Ic.parseFrontMatterAliases)(i.frontmatter)||[];Array.isArray(p)&&p.length>0&&(t+=` ${p.join(" ")}`);for(let m of a){let f="";switch(m){case"file.path":f=e.path;break;case"file.parent":f=((c=e.parent)==null?void 0:c.name)||"";break;case"file.basename":f=e.basename;break;case"title":case"aliases":break;default:{let h=i.frontmatter[m];h!=null&&(f=Array.isArray(h)?h.join(" "):String(h));break}}f&&(t+=` ${f}`)}}return t}renderSuggestion(e,t){var s,o,l,c;let n=e.item;if(t.empty(),!(n instanceof Ic.TFile)){t.textContent=n.name;return}let a=t.createDiv({cls:"project-suggestion"}),i=((l=(o=(s=this.plugin.settings)==null?void 0:s.projectAutosuggest)==null?void 0:o.rows)!=null?l:[]).slice(0,3);if(i.length===0){a.createSpan({cls:"project-name",text:n.basename});return}try{let d=this.app.metadataCache.getFileCache(n),u=(d==null?void 0:d.frontmatter)||{},p=this.plugin.fieldMapper.mapFromFrontmatter(u,n.path,this.plugin.settings.storeTitleInFilename),m=typeof p.title=="string"?p.title:"",f=(0,Ic.parseFrontMatterAliases)(u)||[],h=Array.isArray(f)?f.filter(k=>typeof k=="string"):[],g={basename:n.basename,name:n.name,path:n.path,parent:((c=n.parent)==null?void 0:c.path)||"",title:m,aliases:h,frontmatter:u},v=new nm({getFrontmatter:()=>u});a.createDiv({cls:"project-name",text:n.basename});let b=v.buildMetadataRows(i,g,_c);for(let k of b){let w=a.createDiv({cls:"project-meta"});w.textContent=k}}catch(d){GXe.error("Error rendering project suggestion:",{category:"internal",operation:"rendering-project-suggestion",error:d}),a.createSpan({cls:"project-name",text:n.basename})}}onChooseItem(e,t){this.onChoose(e)}}});function qs(r){if(r==null)return[];let e=[],t="",n=0,a=null;for(let s=0;s0){n--,t+="]]",s++;continue}if(!n&&(o==='"'||o==="'")){a===null?a=o:a===o&&(a=null),t+=o;continue}if(o===","&&n===0&&a===null){let c=t.trim();c&&e.push(c),t="";continue}t+=o}let i=t.trim();return i&&e.push(i),e}var am=y(()=>{});function L_(r){let e=r.search(/[#^]/);return(e===-1?r:r.slice(0,e)).trim()}function Et(r){if(!r)return r;let e=r.trim();if(e.startsWith("<")&&e.endsWith(">")){let n=e.slice(1,-1).trim(),a=/\.md$/i.test(n);try{n=decodeURIComponent(n)}catch(s){Pfe.debug("Failed to decode URI component:",{category:"internal",operation:"decode-uri-component",details:{value:n},error:s})}let i=L_(n);return a?n:i||n}if(e.startsWith("[[")&&e.endsWith("]]")){let n=e.slice(2,-2).trim(),a=n.indexOf("|"),i=a!==-1?n.substring(0,a):n;return L_(i)}let t=e.match(/^\[([^\]]*)\]\(([^)]+)\)$/);if(t){let n=t[2].trim();n.startsWith("<")&&n.endsWith(">")&&(n=n.slice(1,-1).trim());let a=/\.md$/i.test(n);try{n=decodeURIComponent(n)}catch(s){Pfe.debug("Failed to decode URI component:",{category:"internal",operation:"decode-uri-component",details:{value:n},error:s})}let i=L_(n);return a?n:i}return e}function Fl(r,e){if(!r)return"";let t=r.trim(),n=t.match(/^\[([^\]]+)\]\(([^)]+)\)$/);if(n){let a=n[1].trim(),i=n[2].trim(),s=Et(i),o=Mfe(s,e,a);if(o)return o;if(a)return a;let l=s.replace(/\.md$/i,""),c=l.split("/");return c[c.length-1]||l}if(t.startsWith("[[")&&t.endsWith("]]")){let a=t.slice(2,-2).trim(),i=a.indexOf("|");if(i!==-1){let d=a.slice(i+1).trim();if(d)return d}let s=L_(a.split("|")[0]||a)||Et(t),o=Mfe(s,e);if(o)return o;let l=s.replace(/\.md$/i,""),c=l.split("/");return c[c.length-1]||l}return t}function Mfe(r,e,t){let n=e==null?void 0:e.metadataCache.getFirstLinkpathDest(r,"");if(!n)return null;let a=KXe(n,e);return a&&ZXe(t,n,r)?a:(t==null?void 0:t.trim())||n.basename}function KXe(r,e){var a,i,s,o;let t=(s=e==null?void 0:e.metadataCache.getFileCache(r))!=null?s:(i=(a=e==null?void 0:e.metadataCache)==null?void 0:a.getCache)==null?void 0:i.call(a,r.path),n=(o=t==null?void 0:t.frontmatter)==null?void 0:o.title;return typeof n=="string"&&n.trim().length>0?n.trim():null}function ZXe(r,e,t){let n=(r==null?void 0:r.trim())||"";if(!n)return!0;let a=e.path.replace(/\.md$/i,""),i=t.replace(/\.md$/i,"");return new Set([e.name,e.basename,e.path,a,t,i]).has(n)}function Ws(r,e,t,n,a,i){if(i)return r.fileManager.generateMarkdownLink(e,t,n||"",a||"");let o=`[[${r.metadataCache.fileToLinktext(e,t,!0)}`;return n&&(o+=n),a&&(o+=`|${a}`),o+="]]",o}function z_(r,e,t,n,a){return Ws(r,e,t,"",n,a)}var Pfe,qn=y(()=>{K();Pfe=N({tag:"Utils/LinkUtils"})});function JXe(r){return QXe.includes(r)}function tU(r){if(typeof r=="string")return r;if(typeof r=="object"&&r!==null){let e=r.uid;return typeof e=="string"?e:""}return""}function os(r){if(typeof r=="string"){let e=r.trim();return e?{uid:Et(e),reltype:ss}:null}if(typeof r=="object"&&r!==null){let e=r,t=typeof e.uid=="string"?e.uid.trim():"";if(!t)return null;let n=Et(t),a=typeof e.reltype=="string"?e.reltype.trim().toUpperCase():"",i=JXe(a)?a:ss,s=typeof e.gap=="string"&&e.gap.trim().length>0?e.gap.trim():void 0;return s?{uid:n,reltype:i,gap:s}:{uid:n,reltype:i}}return null}function Fh(r){if(r==null)return;let e=Array.isArray(r)?r:[r],t=[];for(let n of e){let a=os(n);a&&t.push(a)}return t.length>0?t:void 0}function Afe(r){return r.map(e=>{let n={uid:e.uid.startsWith("[[")?e.uid:`[[${e.uid}]]`,reltype:e.reltype};return e.gap&&e.gap.trim().length>0&&(n.gap=e.gap),n})}function Ol(r,e,t){let n=tU(t);if(!n)return null;let a=Et(n);if(!a)return null;let i=new Set;i.add(a),a.endsWith(".md")&&i.add(a.replace(/\.md$/i,""));let s=(0,Wv.parseLinktext)(a);s.path&&s.path!==a&&i.add(s.path);for(let o of i){let l=r.metadataCache.getFirstLinkpathDest(o,e);if(l instanceof Wv.TFile)return{path:l.path,file:l};let c=r.vault.getAbstractFileByPath(o);if(c instanceof Wv.TFile)return{path:c.path,file:c}}return null}function _o(r,e,t,n){let a=r.vault.getAbstractFileByPath(t);return a instanceof Wv.TFile?Ws(r,a,e,"","",n):`[[${(t.split("/").pop()||t).replace(/\.md$/i,"")}]]`}var Wv,ss,QXe,Io=y(()=>{Wv=require("obsidian");am();qn();ss="FINISHTOSTART",QXe=["FINISHTOSTART","FINISHTOFINISH","STARTTOSTART","STARTTOFINISH"]});function j_(r,e){var t;return new _fe.Setting(r).setName(e.label).addButton(n=>{n.setButtonText(e.buttonText).setTooltip(e.buttonTooltip).onClick(e.onButtonClick),n.buttonEl.addClasses(["tn-btn","tn-btn--ghost"])}),(t=e.listElement)!=null?t:r.createDiv({cls:"task-projects-list"})}function Ife(r,e){return j_(e.container,{label:r.translate("modals.task.organization.projects"),buttonText:r.translate("modals.task.organization.addToProjectButton"),buttonTooltip:r.translate("modals.task.projectsTooltip"),onButtonClick:e.onButtonClick,listElement:e.listElement})}function Nfe(r,e){return j_(e.container,{label:r.translate("modals.task.organization.subtasks"),buttonText:r.translate("modals.task.organization.addSubtasksButton"),buttonTooltip:r.translate("modals.task.organization.addSubtasksTooltip"),onButtonClick:e.onButtonClick,listElement:e.listElement})}function Rfe(r,e){return j_(e.container,{label:r.translate("modals.task.dependencies.blockedBy"),buttonText:r.translate("modals.task.dependencies.addTaskButton"),buttonTooltip:r.translate("modals.task.dependencies.selectTaskTooltip"),onButtonClick:e.onButtonClick,listElement:e.listElement})}function Ffe(r,e){return j_(e.container,{label:r.translate("modals.task.dependencies.blocking"),buttonText:r.translate("modals.task.dependencies.addTaskButton"),buttonTooltip:r.translate("modals.task.dependencies.selectTaskTooltip"),onButtonClick:e.onButtonClick,listElement:e.listElement})}var _fe,Ofe=y(()=>{_fe=require("obsidian")});function zfe(r){let{task:e,plugin:t,excludeSelector:n,onSingleClick:a,onDoubleClick:i,contextMenuHandler:s,createBatchContextMenu:o}=r,l=n?`${Lfe}, ${n}`:Lfe,c=null,d=(S=!1)=>{let C=t.app.vault.getAbstractFileByPath(e.path);C instanceof rU.TFile&&(S?t.app.workspace.openLinkText(e.path,"",!0):t.app.workspace.getLeaf(!1).openFile(C))},u=async()=>{await t.openTaskEditModal(e)},p=async S=>{if(a){await a(S);return}if(S.ctrlKey||S.metaKey){d(!0);return}let C=t.settings.singleClickAction;C==="edit"?await u():C==="openNote"&&d(!1)},m=async S=>{if(i){await i(S);return}let C=t.settings.doubleClickAction;C==="edit"?await u():C==="openNote"&&d()},f=async S=>{if(S.target.closest(l))return;let E=t.taskSelectionService;if(E){if(S.shiftKey){S.stopPropagation(),E.isSelectionModeActive()||E.enterSelectionMode(),E.toggleSelection(e.path);return}E.isSelectionModeActive()&&(E.clearSelection(),E.exitSelectionMode())}if(S.stopPropagation(),t.settings.doubleClickAction==="none"){await p(S);return}c?(window.clearTimeout(c),c=null,await m(S)):c=window.setTimeout(()=>{c=null,p(S)},250)},h=S=>{f(S)},g=S=>{S.button!==1||S.target.closest(l)||(S.preventDefault(),S.stopPropagation(),c&&(window.clearTimeout(c),c=null),d(!0))},v=S=>{g(S)},b=S=>{},k=async S=>{S.preventDefault(),S.stopPropagation();let C=t.taskSelectionService;if(S.shiftKey&&C){if(C.isSelectionModeActive()||C.enterSelectionMode(),C.isSelected(e.path)||C.addToSelection(e.path),C.getSelectionCount()>0){let E=o==null?void 0:o(C.getSelectedPaths(),()=>{});E==null||E.show(S)}return}if(C&&C.getSelectionCount()>1){C.isSelected(e.path)||C.addToSelection(e.path);let E=o==null?void 0:o(C.getSelectedPaths(),()=>{});E==null||E.show(S);return}C!=null&&C.isSelectionModeActive()&&(C.clearSelection(),C.exitSelectionMode()),s&&await s(S)};return{clickHandler:h,auxclickHandler:v,dblclickHandler:b,contextmenuHandler:S=>{k(S)},cleanup:()=>{c&&(window.clearTimeout(c),c=null)}}}function jfe(r,e){return t=>{e.app.vault.getAbstractFileByPath(r.path)&&e.app.workspace.trigger("hover-link",{event:t,source:"tasknotes-task-card",hoverParent:t.currentTarget,targetEl:t.currentTarget,linktext:r.path,sourcePath:r.path})}}async function $fe(r,e,t,n,a){let i=(d=!1)=>{let u=e.app.vault.getAbstractFileByPath(r.path);u instanceof rU.TFile&&(d?e.app.workspace.openLinkText(r.path,"",!0):e.app.workspace.getLeaf(!1).openFile(u))},s=async()=>{await e.openTaskEditModal(r,a?()=>a():void 0)},o=async d=>{if(d.ctrlKey||d.metaKey){i(!0);return}let u=e.settings.singleClickAction;u==="edit"?await s():u==="openNote"&&i(!1)},l=async d=>{let u=e.settings.doubleClickAction;u==="edit"?await s():u==="openNote"&&i()};if(e.settings.doubleClickAction==="none"){await o(t);return}let c=$_.get(n);if(c)window.clearTimeout(c),$_.delete(n),await l(t);else{let d=window.setTimeout(()=>{$_.delete(n),o(t)},250);$_.set(n,d)}}var rU,Lfe,$_,nU=y(()=>{rU=require("obsidian"),Lfe=["a","button","input","textarea","select",'[role="button"]','[data-tn-no-drag="true"]','[data-tn-click-exclude="true"]',".tag"].join(", ");$_=new Map});var Bfe,Ea,Pu=y(()=>{Bfe=require("obsidian"),Ea=class extends Bfe.Menu{show(e){var t;if(e.instanceOf(MouseEvent))this.showAtMouseEvent(e);else if(e.instanceOf(KeyboardEvent)){let n=e.currentTarget;if(!n||!((t=n.instanceOf)!=null&&t.call(n,HTMLElement)))return;this.showAtPosition({x:n.getBoundingClientRect().left,y:n.getBoundingClientRect().bottom+4})}}}});var Ufe=y(()=>{});var Hfe,aU=y(()=>{Hfe={triggers:[{propertyId:"tags",trigger:"#",enabled:!0},{propertyId:"contexts",trigger:"@",enabled:!0},{propertyId:"projects",trigger:"+",enabled:!0},{propertyId:"status",trigger:"*",enabled:!0},{propertyId:"priority",trigger:"!",enabled:!1}]}});var Vfe,qfe=y(()=>{Vfe={code:"en",name:"English",chronoLocale:"en",dateTriggers:{due:["due","deadline","must be done by","by"],scheduled:["scheduled for","start on","begin on","work on","on","scheduled","start"]},recurrence:{frequencies:{daily:["daily","every day"],weekly:["weekly","every week"],monthly:["monthly","every month"],yearly:["yearly","annually","every year"]},every:["every"],other:["other"],weekdays:{monday:["monday"],tuesday:["tuesday"],wednesday:["wednesday"],thursday:["thursday"],friday:["friday"],saturday:["saturday"],sunday:["sunday"]},pluralWeekdays:{monday:["mondays"],tuesday:["tuesdays"],wednesday:["wednesdays"],thursday:["thursdays"],friday:["fridays"],saturday:["saturdays"],sunday:["sundays"]},ordinals:{first:["first"],second:["second"],third:["third"],fourth:["fourth"],last:["last"]},periods:{day:["day","days"],week:["week","weeks"],month:["month","months"],year:["year","years"]}},timeEstimate:{hours:["h","hr","hrs","hour","hours"],minutes:["m","min","mins","minute","minutes"]},fallbackStatus:{open:["todo","to do","open"],inProgress:["in progress","in-progress","doing"],done:["done","completed","finished"],cancelled:["cancelled","canceled"],waiting:["waiting","blocked","on hold"]},fallbackPriority:{urgent:["urgent","critical","highest"],high:["high","important"],normal:["medium","normal"],low:["low","minor"]}}});var Wfe,Yfe=y(()=>{Wfe={code:"es",name:"Espa\xF1ol",chronoLocale:"es",dateTriggers:{due:["vence","fecha l\xEDmite","debe terminarse","para el","antes del"],scheduled:["programado para","programado el","comenzar el","empezar el","trabajar en","el"]},recurrence:{frequencies:{daily:["diario","diaria","diariamente","cada d\xEDa","todos los d\xEDas","a diario"],weekly:["semanal","semanalmente","cada semana","todas las semanas","por semana"],monthly:["mensual","mensualmente","cada mes","todos los meses","por mes"],yearly:["anual","anualmente","cada a\xF1o","todos los a\xF1os","por a\xF1o"]},every:["cada","todos los","todas las"],other:["otro","otra"],weekdays:{monday:["lunes"],tuesday:["martes"],wednesday:["mi\xE9rcoles"],thursday:["jueves"],friday:["viernes"],saturday:["s\xE1bado"],sunday:["domingo"]},pluralWeekdays:{monday:["lunes"],tuesday:["martes"],wednesday:["mi\xE9rcoles"],thursday:["jueves"],friday:["viernes"],saturday:["s\xE1bados"],sunday:["domingos"]},ordinals:{first:["primer","primera","primero"],second:["segundo","segunda"],third:["tercer","tercera","tercero"],fourth:["cuarto","cuarta"],last:["\xFAltimo","\xFAltima"]},periods:{day:["d\xEDa","d\xEDas"],week:["semana","semanas"],month:["mes","meses"],year:["a\xF1o","a\xF1os"]}},timeEstimate:{hours:["h","hr","hrs","hora","horas"],minutes:["m","min","mins","minuto","minutos"]},fallbackStatus:{open:["pendiente","por hacer","abierto","todo"],inProgress:["en progreso","en curso","haciendo","trabajando"],done:["hecho","terminado","completado","finalizado"],cancelled:["cancelado","anulado"],waiting:["esperando","bloqueado","en espera"]},fallbackPriority:{urgent:["urgente","cr\xEDtico","cr\xEDtica","m\xE1ximo","m\xE1xima","prioritario","prioritaria"],high:["alto","alta","importante","elevado","elevada"],normal:["medio","media","normal","regular","est\xE1ndar"],low:["bajo","baja","menor","m\xEDnimo","m\xEDnima"]}}});var Gfe,Kfe=y(()=>{Gfe={code:"fr",name:"Fran\xE7ais",chronoLocale:"fr",dateTriggers:{due:["\xE9ch\xE9ance","date limite","doit \xEAtre termin\xE9","pour le","avant le"],scheduled:["programm\xE9 pour","programm\xE9 le","commencer le","d\xE9buter le","travailler sur","le"]},recurrence:{frequencies:{daily:["quotidien","quotidienne","quotidiennement","chaque jour","tous les jours","journalier","journali\xE8re"],weekly:["hebdomadaire","chaque semaine","toutes les semaines","par semaine"],monthly:["mensuel","mensuelle","mensuellement","chaque mois","tous les mois","par mois"],yearly:["annuel","annuelle","annuellement","chaque ann\xE9e","tous les ans","par an","par ann\xE9e"]},every:["chaque","tous les","toutes les"],other:["autre"],weekdays:{monday:["lundi"],tuesday:["mardi"],wednesday:["mercredi"],thursday:["jeudi"],friday:["vendredi"],saturday:["samedi"],sunday:["dimanche"]},pluralWeekdays:{monday:["lundis"],tuesday:["mardis"],wednesday:["mercredis"],thursday:["jeudis"],friday:["vendredis"],saturday:["samedis"],sunday:["dimanches"]},ordinals:{first:["premier","premi\xE8re"],second:["deuxi\xE8me","second","seconde"],third:["troisi\xE8me"],fourth:["quatri\xE8me"],last:["dernier","derni\xE8re"]},periods:{day:["jour","jours"],week:["semaine","semaines"],month:["mois"],year:["an","ans","ann\xE9e","ann\xE9es"]}},timeEstimate:{hours:["h","hr","hrs","heure","heures"],minutes:["m","min","mins","minute","minutes"]},fallbackStatus:{open:["\xE0 faire","ouvert","en attente","todo"],inProgress:["en cours","en progression","en train de faire"],done:["termin\xE9","fini","accompli","fait"],cancelled:["annul\xE9","abandonn\xE9"],waiting:["en attente","bloqu\xE9","suspendu"]},fallbackPriority:{urgent:["urgent","urgente","critique","maximum","prioritaire"],high:["\xE9lev\xE9","\xE9lev\xE9e","haut","haute","important","importante","sup\xE9rieur","sup\xE9rieure"],normal:["moyen","moyenne","normal","normale","standard","r\xE9gulier","r\xE9guli\xE8re"],low:["faible","bas","basse","mineur","mineure","minimum"]}}});var Zfe,Qfe=y(()=>{Zfe={code:"de",name:"Deutsch",chronoLocale:"de",dateTriggers:{due:["f\xE4llig","termin","abgabe","deadline","bis zum","bis"],scheduled:["geplant f\xFCr","geplant am","beginnen am","anfangen am","arbeiten an","am","geplant","starten"]},recurrence:{frequencies:{daily:["t\xE4glich","jeden Tag","alle Tage","tagaus tagein"],weekly:["w\xF6chentlich","jede Woche","alle Wochen"],monthly:["monatlich","jeden Monat","alle Monate"],yearly:["j\xE4hrlich","jedes Jahr","alle Jahre"]},every:["jede","jeden","jedes","alle"],other:["andere","anderen","anderes"],weekdays:{monday:["montag"],tuesday:["dienstag"],wednesday:["mittwoch"],thursday:["donnerstag"],friday:["freitag"],saturday:["samstag"],sunday:["sonntag"]},pluralWeekdays:{monday:["montags"],tuesday:["dienstags"],wednesday:["mittwochs"],thursday:["donnerstags"],friday:["freitags"],saturday:["samstags"],sunday:["sonntags"]},ordinals:{first:["erste","ersten","erster"],second:["zweite","zweiten","zweiter"],third:["dritte","dritten","dritter"],fourth:["vierte","vierten","vierter"],last:["letzte","letzten","letzter"]},periods:{day:["tag","tage"],week:["woche","wochen"],month:["monat","monate"],year:["jahr","jahre"]}},timeEstimate:{hours:["h","std","stunde","stunden"],minutes:["m","min","minute","minuten"]},fallbackStatus:{open:["offen","zu erledigen","ausstehend","todo"],inProgress:["in bearbeitung","wird bearbeitet","l\xE4uft","in arbeit"],done:["erledigt","fertig","abgeschlossen","gemacht"],cancelled:["abgebrochen","storniert","abgesagt"],waiting:["wartend","warten","blockiert","pausiert"]},fallbackPriority:{urgent:["dringend","eilig","kritisch","sofort","h\xF6chste"],high:["hoch","hohe","wichtig","priorit\xE4r"],normal:["normal","mittel","mittlere","standard"],low:["niedrig","niedrige","gering","geringe"]}}});var Jfe,Xfe=y(()=>{Jfe={code:"ru",name:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",chronoLocale:"ru",dateTriggers:{due:["\u0441\u0440\u043E\u043A","\u0434\u0435\u0434\u043B\u0430\u0439\u043D","\u0434\u043E","\u043A","\u0441\u0434\u0430\u0442\u044C \u0434\u043E"],scheduled:["\u0437\u0430\u043F\u043B\u0430\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u043D\u0430","\u043D\u0430\u0447\u0430\u0442\u044C","\u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u043D\u0430\u0434","\u043D\u0430"]},recurrence:{frequencies:{daily:["\u0435\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u043E","\u043A\u0430\u0436\u0434\u044B\u0439 \u0434\u0435\u043D\u044C","\u0435\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u044B\u0439","\u043A\u0430\u0436\u0434\u043E\u0434\u043D\u0435\u0432\u043D\u044B\u0439"],weekly:["\u0435\u0436\u0435\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u043E","\u043A\u0430\u0436\u0434\u0443\u044E \u043D\u0435\u0434\u0435\u043B\u044E","\u0435\u0436\u0435\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u044B\u0439"],monthly:["\u0435\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u043E","\u043A\u0430\u0436\u0434\u044B\u0439 \u043C\u0435\u0441\u044F\u0446","\u0435\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439"],yearly:["\u0435\u0436\u0435\u0433\u043E\u0434\u043D\u043E","\u043A\u0430\u0436\u0434\u044B\u0439 \u0433\u043E\u0434","\u0435\u0436\u0435\u0433\u043E\u0434\u043D\u044B\u0439"]},every:["\u043A\u0430\u0436\u0434\u044B\u0439","\u043A\u0430\u0436\u0434\u0443\u044E","\u043A\u0430\u0436\u0434\u043E\u0435","\u0432\u0441\u0435"],other:["\u0434\u0440\u0443\u0433\u043E\u0439","\u0434\u0440\u0443\u0433\u0443\u044E","\u0434\u0440\u0443\u0433\u043E\u0435"],weekdays:{monday:["\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A"],tuesday:["\u0432\u0442\u043E\u0440\u043D\u0438\u043A"],wednesday:["\u0441\u0440\u0435\u0434\u0430"],thursday:["\u0447\u0435\u0442\u0432\u0435\u0440\u0433"],friday:["\u043F\u044F\u0442\u043D\u0438\u0446\u0430"],saturday:["\u0441\u0443\u0431\u0431\u043E\u0442\u0430"],sunday:["\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435"]},pluralWeekdays:{monday:["\u043F\u043E \u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430\u043C"],tuesday:["\u043F\u043E \u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430\u043C"],wednesday:["\u043F\u043E \u0441\u0440\u0435\u0434\u0430\u043C"],thursday:["\u043F\u043E \u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430\u043C"],friday:["\u043F\u043E \u043F\u044F\u0442\u043D\u0438\u0446\u0430\u043C"],saturday:["\u043F\u043E \u0441\u0443\u0431\u0431\u043E\u0442\u0430\u043C"],sunday:["\u043F\u043E \u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F\u043C"]},ordinals:{first:["\u043F\u0435\u0440\u0432\u044B\u0439","\u043F\u0435\u0440\u0432\u0430\u044F","\u043F\u0435\u0440\u0432\u043E\u0435"],second:["\u0432\u0442\u043E\u0440\u043E\u0439","\u0432\u0442\u043E\u0440\u0430\u044F","\u0432\u0442\u043E\u0440\u043E\u0435"],third:["\u0442\u0440\u0435\u0442\u0438\u0439","\u0442\u0440\u0435\u0442\u044C\u044F","\u0442\u0440\u0435\u0442\u044C\u0435"],fourth:["\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044B\u0439","\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0430\u044F","\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435"],last:["\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439","\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F","\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435"]},periods:{day:["\u0434\u0435\u043D\u044C","\u0434\u043D\u0438"],week:["\u043D\u0435\u0434\u0435\u043B\u044F","\u043D\u0435\u0434\u0435\u043B\u0438"],month:["\u043C\u0435\u0441\u044F\u0446","\u043C\u0435\u0441\u044F\u0446\u044B"],year:["\u0433\u043E\u0434","\u0433\u043E\u0434\u044B"]}},timeEstimate:{hours:["\u0447","\u0447\u0430\u0441","\u0447\u0430\u0441\u0430","\u0447\u0430\u0441\u043E\u0432"],minutes:["\u043C","\u043C\u0438\u043D","\u043C\u0438\u043D\u0443\u0442\u0430","\u043C\u0438\u043D\u0443\u0442\u044B","\u043C\u0438\u043D\u0443\u0442"]},fallbackStatus:{open:["\u043E\u0442\u043A\u0440\u044B\u0442\u043E","\u043A \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044E","\u043D\u043E\u0432\u043E\u0435","todo"],inProgress:["\u0432 \u0440\u0430\u0431\u043E\u0442\u0435","\u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F","\u0432 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0435"],done:["\u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u043E","\u0433\u043E\u0442\u043E\u0432\u043E","\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E","\u0441\u0434\u0435\u043B\u0430\u043D\u043E"],cancelled:["\u043E\u0442\u043C\u0435\u043D\u0435\u043D\u043E","\u043E\u0442\u043C\u0435\u043D\u0451\u043D","\u043E\u0442\u043C\u0435\u043D\u0435\u043D\u0430"],waiting:["\u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0435","\u0437\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u043D\u043E","\u043D\u0430 \u043F\u0430\u0443\u0437\u0435"]},fallbackPriority:{urgent:["\u0441\u0440\u043E\u0447\u043D\u043E","\u043A\u0440\u0438\u0442\u0438\u0447\u043D\u043E","\u044D\u043A\u0441\u0442\u0440\u0435\u043D\u043D\u043E","\u043D\u0435\u043C\u0435\u0434\u043B\u0435\u043D\u043D\u043E"],high:["\u0432\u044B\u0441\u043E\u043A\u0438\u0439","\u0432\u044B\u0441\u043E\u043A\u0430\u044F","\u0432\u0430\u0436\u043D\u043E","\u043F\u0440\u0438\u043E\u0440\u0438\u0442\u0435\u0442\u043D\u043E"],normal:["\u043D\u043E\u0440\u043C\u0430\u043B\u044C\u043D\u044B\u0439","\u043D\u043E\u0440\u043C\u0430\u043B\u044C\u043D\u0430\u044F","\u0441\u0440\u0435\u0434\u043D\u0438\u0439","\u0441\u0440\u0435\u0434\u043D\u044F\u044F"],low:["\u043D\u0438\u0437\u043A\u0438\u0439","\u043D\u0438\u0437\u043A\u0430\u044F","\u043D\u0435\u0432\u0430\u0436\u043D\u043E","\u043C\u043E\u0436\u043D\u043E \u043F\u043E\u0437\u0436\u0435"]}}});var ehe,the=y(()=>{ehe={code:"zh",name:"\u4E2D\u6587",chronoLocale:"zh",dateTriggers:{due:["\u622A\u6B62","\u5230\u671F","\u671F\u9650","\u5728","\u4E4B\u524D"],scheduled:["\u5B89\u6392\u5728","\u8BA1\u5212\u5728","\u5F00\u59CB\u5728","\u5728"]},recurrence:{frequencies:{daily:["\u6BCF\u5929","\u6BCF\u65E5","\u5929\u5929","\u65E5\u5E38"],weekly:["\u6BCF\u5468","\u6BCF\u661F\u671F","\u5468\u5468"],monthly:["\u6BCF\u6708","\u6BCF\u4E2A\u6708","\u6708\u6708"],yearly:["\u6BCF\u5E74","\u5E74\u5E74","\u6BCF\u4E00\u5E74"]},every:["\u6BCF","\u6BCF\u4E2A","\u6BCF\u4E00\u4E2A"],other:["\u5176\u4ED6","\u53E6\u4E00\u4E2A"],weekdays:{monday:["\u5468\u4E00","\u661F\u671F\u4E00","\u793C\u62DC\u4E00"],tuesday:["\u5468\u4E8C","\u661F\u671F\u4E8C","\u793C\u62DC\u4E8C"],wednesday:["\u5468\u4E09","\u661F\u671F\u4E09","\u793C\u62DC\u4E09"],thursday:["\u5468\u56DB","\u661F\u671F\u56DB","\u793C\u62DC\u56DB"],friday:["\u5468\u4E94","\u661F\u671F\u4E94","\u793C\u62DC\u4E94"],saturday:["\u5468\u516D","\u661F\u671F\u516D","\u793C\u62DC\u516D"],sunday:["\u5468\u65E5","\u661F\u671F\u65E5","\u793C\u62DC\u65E5"]},pluralWeekdays:{monday:["\u5468\u4E00","\u661F\u671F\u4E00","\u793C\u62DC\u4E00"],tuesday:["\u5468\u4E8C","\u661F\u671F\u4E8C","\u793C\u62DC\u4E8C"],wednesday:["\u5468\u4E09","\u661F\u671F\u4E09","\u793C\u62DC\u4E09"],thursday:["\u5468\u56DB","\u661F\u671F\u56DB","\u793C\u62DC\u56DB"],friday:["\u5468\u4E94","\u661F\u671F\u4E94","\u793C\u62DC\u4E94"],saturday:["\u5468\u516D","\u661F\u671F\u516D","\u793C\u62DC\u516D"],sunday:["\u5468\u65E5","\u661F\u671F\u65E5","\u793C\u62DC\u65E5"]},ordinals:{first:["\u7B2C\u4E00\u4E2A","\u7B2C\u4E00","\u9996\u4E2A"],second:["\u7B2C\u4E8C\u4E2A","\u7B2C\u4E8C"],third:["\u7B2C\u4E09\u4E2A","\u7B2C\u4E09"],fourth:["\u7B2C\u56DB\u4E2A","\u7B2C\u56DB"],last:["\u6700\u540E\u4E00\u4E2A","\u6700\u540E","\u672B\u5C3E"]},periods:{day:["\u5929","\u65E5"],week:["\u5468","\u661F\u671F"],month:["\u6708","\u4E2A\u6708"],year:["\u5E74"]}},timeEstimate:{hours:["\u5C0F\u65F6","\u65F6","\u4E2A\u5C0F\u65F6"],minutes:["\u5206\u949F","\u5206","\u4E2A\u5206\u949F"]},fallbackStatus:{open:["\u5F85\u529E","\u672A\u5B8C\u6210","\u5F00\u653E","\u65B0\u5EFA"],inProgress:["\u8FDB\u884C\u4E2D","\u6B63\u5728\u5904\u7406","\u5904\u7406\u4E2D","\u5DE5\u4F5C\u4E2D"],done:["\u5B8C\u6210","\u5DF2\u5B8C\u6210","\u7ED3\u675F","\u641E\u5B9A"],cancelled:["\u53D6\u6D88","\u5DF2\u53D6\u6D88","\u5E9F\u5F03"],waiting:["\u7B49\u5F85","\u6682\u505C","\u963B\u585E","\u5F85\u5B9A"]},fallbackPriority:{urgent:["\u7D27\u6025","\u6025\u8FEB","\u7ACB\u5373","\u9A6C\u4E0A"],high:["\u9AD8","\u91CD\u8981","\u9AD8\u4F18\u5148\u7EA7"],normal:["\u6B63\u5E38","\u666E\u901A","\u4E2D\u7B49","\u6807\u51C6"],low:["\u4F4E","\u4E0D\u91CD\u8981","\u4F4E\u4F18\u5148\u7EA7","\u6B21\u8981"]}}});var rhe,nhe=y(()=>{rhe={code:"ja",name:"\u65E5\u672C\u8A9E",chronoLocale:"ja",dateTriggers:{due:["\u671F\u9650","\u7DE0\u5207","\u3006\u5207","\u307E\u3067","\u307E\u3067\u306B","\u306B"],scheduled:["\u4E88\u5B9A","\u8A08\u753B","\u958B\u59CB","\u304B\u3089","\u306B\u958B\u59CB","\u3092\u958B\u59CB"]},recurrence:{frequencies:{daily:["\u6BCE\u65E5","\u65E5\u3005","\u6BCE\u65E5\u6BCE\u65E5","\u9023\u65E5"],weekly:["\u6BCE\u9031","\u9031\u6BCE","\u9031\u4E00","\u6BCE\u9031\u6BCE\u9031"],monthly:["\u6BCE\u6708","\u6708\u6BCE","\u6708\u4E00","\u6BCE\u6708\u6BCE\u6708"],yearly:["\u6BCE\u5E74","\u5E74\u6BCE","\u5E74\u4E00","\u6BCE\u5E74\u6BCE\u5E74","\u5E74\u6B21"]},every:["\u6BCE","\u5404","\u5168\u3066"],other:["\u4ED6\u306E","\u5225\u306E","\u7570\u306A\u308B"],weekdays:{monday:["\u6708\u66DC\u65E5","\u6708\u66DC","\u6708","\u3052\u3064\u3088\u3046\u3073"],tuesday:["\u706B\u66DC\u65E5","\u706B\u66DC","\u706B","\u304B\u3088\u3046\u3073"],wednesday:["\u6C34\u66DC\u65E5","\u6C34\u66DC","\u6C34","\u3059\u3044\u3088\u3046\u3073"],thursday:["\u6728\u66DC\u65E5","\u6728\u66DC","\u6728","\u3082\u304F\u3088\u3046\u3073"],friday:["\u91D1\u66DC\u65E5","\u91D1\u66DC","\u91D1","\u304D\u3093\u3088\u3046\u3073"],saturday:["\u571F\u66DC\u65E5","\u571F\u66DC","\u571F","\u3069\u3088\u3046\u3073"],sunday:["\u65E5\u66DC\u65E5","\u65E5\u66DC","\u65E5","\u306B\u3061\u3088\u3046\u3073"]},pluralWeekdays:{monday:["\u6708\u66DC\u65E5","\u6708\u66DC","\u6708","\u3052\u3064\u3088\u3046\u3073"],tuesday:["\u706B\u66DC\u65E5","\u706B\u66DC","\u706B","\u304B\u3088\u3046\u3073"],wednesday:["\u6C34\u66DC\u65E5","\u6C34\u66DC","\u6C34","\u3059\u3044\u3088\u3046\u3073"],thursday:["\u6728\u66DC\u65E5","\u6728\u66DC","\u6728","\u3082\u304F\u3088\u3046\u3073"],friday:["\u91D1\u66DC\u65E5","\u91D1\u66DC","\u91D1","\u304D\u3093\u3088\u3046\u3073"],saturday:["\u571F\u66DC\u65E5","\u571F\u66DC","\u571F","\u3069\u3088\u3046\u3073"],sunday:["\u65E5\u66DC\u65E5","\u65E5\u66DC","\u65E5","\u306B\u3061\u3088\u3046\u3073"]},ordinals:{first:["\u6700\u521D\u306E","\u7B2C\u4E00\u306E","\u4E00\u756A\u76EE\u306E","\u521D\u56DE"],second:["\u4E8C\u756A\u76EE\u306E","\u7B2C\u4E8C\u306E","\u6B21\u306E"],third:["\u4E09\u756A\u76EE\u306E","\u7B2C\u4E09\u306E"],fourth:["\u56DB\u756A\u76EE\u306E","\u7B2C\u56DB\u306E"],last:["\u6700\u5F8C\u306E","\u6700\u7D42\u306E","\u7D42\u308F\u308A\u306E"]},periods:{day:["\u65E5","\u65E5\u9593"],week:["\u9031","\u9031\u9593"],month:["\u6708","\u6708\u9593","\u30F6\u6708"],year:["\u5E74","\u5E74\u9593"]}},timeEstimate:{hours:["\u6642\u9593","\u6642","\u3058\u304B\u3093"],minutes:["\u5206","\u5206\u9593","\u3075\u3093","\u3077\u3093"]},fallbackStatus:{open:["\u672A\u7740\u624B","\u65B0\u898F","\u30AA\u30FC\u30D7\u30F3","\u958B\u59CB\u524D","\u5F85\u6A5F"],inProgress:["\u9032\u884C\u4E2D","\u4F5C\u696D\u4E2D","\u5B9F\u884C\u4E2D","\u51E6\u7406\u4E2D","\u9032\u884C"],done:["\u5B8C\u4E86","\u7D42\u4E86","\u6E08\u307F","\u7D42\u308F\u308A","\u9054\u6210"],cancelled:["\u30AD\u30E3\u30F3\u30BB\u30EB","\u4E2D\u6B62","\u53D6\u6D88","\u5EC3\u6B62","\u505C\u6B62"],waiting:["\u5F85\u6A5F","\u4FDD\u7559","\u30D6\u30ED\u30C3\u30AF","\u4E00\u6642\u505C\u6B62","\u5F85\u3061"]},fallbackPriority:{urgent:["\u7DCA\u6025","\u81F3\u6025","\u6025\u52D9","\u6700\u512A\u5148","\u3059\u3050\u306B"],high:["\u9AD8","\u91CD\u8981","\u9AD8\u512A\u5148\u5EA6","\u91CD\u70B9"],normal:["\u666E\u901A","\u901A\u5E38","\u6A19\u6E96","\u4E00\u822C","\u30CE\u30FC\u30DE\u30EB"],low:["\u4F4E","\u8EFD\u5FAE","\u5F8C\u56DE\u3057","\u4F4E\u512A\u5148\u5EA6","\u4F59\u88D5"]}}});var ahe,ihe=y(()=>{ahe={code:"it",name:"Italiano",chronoLocale:"it",dateTriggers:{due:["scadenza","entro","entro il","deve essere fatto entro","per il","termine"],scheduled:["programmato per","programmato il","iniziare il","lavorare su","il","per"]},recurrence:{frequencies:{daily:["giornaliero","giornaliera","quotidiano","quotidiana","ogni giorno","tutti i giorni","giornalmente"],weekly:["settimanale","ogni settimana","tutte le settimane","settimanalmente","alla settimana"],monthly:["mensile","ogni mese","tutti i mesi","mensilmente","al mese"],yearly:["annuale","ogni anno","tutti gli anni","annualmente","all'anno"]},every:["ogni","tutti i","tutte le"],other:["altro","altra","altri","altre"],weekdays:{monday:["luned\xEC"],tuesday:["marted\xEC"],wednesday:["mercoled\xEC"],thursday:["gioved\xEC"],friday:["venerd\xEC"],saturday:["sabato"],sunday:["domenica"]},pluralWeekdays:{monday:["luned\xEC"],tuesday:["marted\xEC"],wednesday:["mercoled\xEC"],thursday:["gioved\xEC"],friday:["venerd\xEC"],saturday:["sabati"],sunday:["domeniche"]},ordinals:{first:["primo","prima"],second:["secondo","seconda"],third:["terzo","terza"],fourth:["quarto","quarta"],last:["ultimo","ultima"]},periods:{day:["giorno","giorni"],week:["settimana","settimane"],month:["mese","mesi"],year:["anno","anni"]}},timeEstimate:{hours:["h","hr","ore","ora","o"],minutes:["m","min","minuto","minuti"]},fallbackStatus:{open:["da fare","aperto","pendente","todo","in sospeso"],inProgress:["in corso","in progresso","facendo","lavorando"],done:["fatto","completato","finito","terminato","chiuso"],cancelled:["cancellato","annullato","rimosso"],waiting:["in attesa","aspettando","bloccato","fermo"]},fallbackPriority:{urgent:["urgente","critico","critica","massimo","massima","prioritario","prioritaria"],high:["alto","alta","importante","elevato","elevata"],normal:["medio","media","normale","regolare","standard"],low:["basso","bassa","minore","minimo","minima"]}}});var she,ohe=y(()=>{she={code:"nl",name:"Nederlands",chronoLocale:"nl",dateTriggers:{due:["vervalt op","deadline","moet klaar zijn op","tegen","uiterlijk","voor"],scheduled:["gepland voor","gepland op","beginnen op","werken aan","op","voor"]},recurrence:{frequencies:{daily:["dagelijks","elke dag","alle dagen","per dag"],weekly:["wekelijks","elke week","alle weken","per week"],monthly:["maandelijks","elke maand","alle maanden","per maand"],yearly:["jaarlijks","elk jaar","alle jaren","per jaar"]},every:["elke","alle","iedere"],other:["andere","ander"],weekdays:{monday:["maandag"],tuesday:["dinsdag"],wednesday:["woensdag"],thursday:["donderdag"],friday:["vrijdag"],saturday:["zaterdag"],sunday:["zondag"]},pluralWeekdays:{monday:["maandagen"],tuesday:["dinsdagen"],wednesday:["woensdagen"],thursday:["donderdagen"],friday:["vrijdagen"],saturday:["zaterdagen"],sunday:["zondagen"]},ordinals:{first:["eerste"],second:["tweede"],third:["derde"],fourth:["vierde"],last:["laatste"]},periods:{day:["dag","dagen"],week:["week","weken"],month:["maand","maanden"],year:["jaar","jaren"]}},timeEstimate:{hours:["u","uur","uren","h"],minutes:["m","min","minuut","minuten"]},fallbackStatus:{open:["te doen","open","nog te doen","todo","openstaand"],inProgress:["bezig","in behandeling","aan het werk","lopend","in uitvoering"],done:["klaar","voltooid","gedaan","afgerond","gesloten"],cancelled:["geannuleerd","afgezegd","ingetrokken"],waiting:["wachtend","in de wacht","geblokkeerd","uitgesteld"]},fallbackPriority:{urgent:["urgent","kritiek","hoogste","spoed","direct"],high:["hoog","hoge","belangrijk","belangrijke"],normal:["normaal","normale","gemiddeld","standaard"],low:["laag","lage","klein","kleine","onbelangrijk"]}}});var lhe,che=y(()=>{lhe={code:"pt",name:"Portugu\xEAs",chronoLocale:"pt",dateTriggers:{due:["vencimento","prazo","deve estar pronto at\xE9","at\xE9","para","limite"],scheduled:["programado para","agendado para","come\xE7ar em","trabalhar em","em","no"]},recurrence:{frequencies:{daily:["di\xE1rio","di\xE1ria","diariamente","todos os dias","cada dia","por dia"],weekly:["semanal","semanalmente","toda semana","todas as semanas","por semana"],monthly:["mensal","mensalmente","todo m\xEAs","todos os meses","por m\xEAs"],yearly:["anual","anualmente","todo ano","todos os anos","por ano"]},every:["todo","toda","todos","todas","cada"],other:["outro","outra","outros","outras"],weekdays:{monday:["segunda","segunda-feira"],tuesday:["ter\xE7a","ter\xE7a-feira"],wednesday:["quarta","quarta-feira"],thursday:["quinta","quinta-feira"],friday:["sexta","sexta-feira"],saturday:["s\xE1bado"],sunday:["domingo"]},pluralWeekdays:{monday:["segundas","segundas-feiras"],tuesday:["ter\xE7as","ter\xE7as-feiras"],wednesday:["quartas","quartas-feiras"],thursday:["quintas","quintas-feiras"],friday:["sextas","sextas-feiras"],saturday:["s\xE1bados"],sunday:["domingos"]},ordinals:{first:["primeiro","primeira"],second:["segundo","segunda"],third:["terceiro","terceira"],fourth:["quarto","quarta"],last:["\xFAltimo","\xFAltima"]},periods:{day:["dia","dias"],week:["semana","semanas"],month:["m\xEAs","meses"],year:["ano","anos"]}},timeEstimate:{hours:["h","hr","hora","horas"],minutes:["m","min","minuto","minutos"]},fallbackStatus:{open:["a fazer","pendente","aberto","todo","por fazer"],inProgress:["em andamento","em progresso","fazendo","trabalhando","executando"],done:["feito","conclu\xEDdo","terminado","finalizado","completo"],cancelled:["cancelado","anulado","suspenso"],waiting:["aguardando","esperando","bloqueado","em espera"]},fallbackPriority:{urgent:["urgente","cr\xEDtico","cr\xEDtica","m\xE1ximo","m\xE1xima","priorit\xE1rio","priorit\xE1ria"],high:["alto","alta","importante","elevado","elevada"],normal:["m\xE9dio","m\xE9dia","normal","regular","padr\xE3o"],low:["baixo","baixa","menor","m\xEDnimo","m\xEDnima"]}}});var dhe,uhe=y(()=>{dhe={code:"sv",name:"Svenska",chronoLocale:"sv",dateTriggers:{due:["f\xF6rfaller","deadline","m\xE5ste vara klar","senast","till","innan"],scheduled:["schemalagd","planerad f\xF6r","b\xF6rja","arbeta med","den","p\xE5"]},recurrence:{frequencies:{daily:["dagligen","varje dag","alla dagar","per dag"],weekly:["veckovis","varje vecka","alla veckor","per vecka"],monthly:["m\xE5nadsvis","varje m\xE5nad","alla m\xE5nader","per m\xE5nad"],yearly:["\xE5rligen","varje \xE5r","alla \xE5r","per \xE5r"]},every:["varje","alla","var"],other:["annan","annat","andra"],weekdays:{monday:["m\xE5ndag"],tuesday:["tisdag"],wednesday:["onsdag"],thursday:["torsdag"],friday:["fredag"],saturday:["l\xF6rdag"],sunday:["s\xF6ndag"]},pluralWeekdays:{monday:["m\xE5ndagar"],tuesday:["tisdagar"],wednesday:["onsdagar"],thursday:["torsdagar"],friday:["fredagar"],saturday:["l\xF6rdagar"],sunday:["s\xF6ndagar"]},ordinals:{first:["f\xF6rsta"],second:["andra"],third:["tredje"],fourth:["fj\xE4rde"],last:["sista"]},periods:{day:["dag","dagar"],week:["vecka","veckor"],month:["m\xE5nad","m\xE5nader"],year:["\xE5r"]}},timeEstimate:{hours:["t","tim","timme","timmar","h"],minutes:["m","min","minut","minuter"]},fallbackStatus:{open:["att g\xF6ra","\xF6ppen","kvar","todo","v\xE4ntande"],inProgress:["p\xE5g\xE5ende","arbetar","g\xF6r","i process","under arbete"],done:["klar","f\xE4rdig","slutf\xF6rd","avslutad","gjord"],cancelled:["avbruten","inst\xE4lld","avbokad"],waiting:["v\xE4ntar","blockerad","pausad","vilande"]},fallbackPriority:{urgent:["br\xE5dskande","kritisk","h\xF6gsta","akut","omedelbar"],high:["h\xF6g","viktig","f\xF6rh\xF6jd","prioriterad"],normal:["normal","medel","standard","vanlig"],low:["l\xE5g","mindre","minimal","obetydlig"]}}});var phe,mhe=y(()=>{phe={code:"uk",name:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",chronoLocale:"uk",dateTriggers:{due:["\u0442\u0435\u0440\u043C\u0456\u043D","\u0434\u0435\u0434\u043B\u0430\u0439\u043D","\u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u0433\u043E\u0442\u043E\u0432\u043E \u0434\u043E","\u0434\u043E","\u043D\u0435 \u043F\u0456\u0437\u043D\u0456\u0448\u0435","\u043A\u0440\u0430\u0439\u043D\u0456\u0439 \u0442\u0435\u0440\u043C\u0456\u043D"],scheduled:["\u0437\u0430\u043F\u043B\u0430\u043D\u043E\u0432\u0430\u043D\u043E \u043D\u0430","\u0437\u0430\u043F\u043B\u0430\u043D\u043E\u0432\u0430\u043D\u0438\u0439","\u043F\u043E\u0447\u0430\u0442\u0438","\u043F\u0440\u0430\u0446\u044E\u0432\u0430\u0442\u0438 \u043D\u0430\u0434","\u043D\u0430","\u0432"]},recurrence:{frequencies:{daily:["\u0449\u043E\u0434\u043D\u044F","\u0449\u043E\u0434\u0435\u043D\u043D\u043E","\u043A\u043E\u0436\u0435\u043D \u0434\u0435\u043D\u044C","\u0432\u0441\u0456 \u0434\u043D\u0456","\u043D\u0430 \u0434\u0435\u043D\u044C"],weekly:["\u0449\u043E\u0442\u0438\u0436\u043D\u044F","\u0449\u043E\u0442\u0438\u0436\u043D\u0435\u0432\u043E","\u043A\u043E\u0436\u0435\u043D \u0442\u0438\u0436\u0434\u0435\u043D\u044C","\u0432\u0441\u0456 \u0442\u0438\u0436\u043D\u0456","\u043D\u0430 \u0442\u0438\u0436\u0434\u0435\u043D\u044C"],monthly:["\u0449\u043E\u043C\u0456\u0441\u044F\u0446\u044F","\u0449\u043E\u043C\u0456\u0441\u044F\u0447\u043D\u043E","\u043A\u043E\u0436\u0435\u043D \u043C\u0456\u0441\u044F\u0446\u044C","\u0432\u0441\u0456 \u043C\u0456\u0441\u044F\u0446\u0456","\u043D\u0430 \u043C\u0456\u0441\u044F\u0446\u044C"],yearly:["\u0449\u043E\u0440\u043E\u043A\u0443","\u0449\u043E\u0440\u0456\u0447\u043D\u043E","\u043A\u043E\u0436\u0435\u043D \u0440\u0456\u043A","\u0432\u0441\u0456 \u0440\u043E\u043A\u0438","\u043D\u0430 \u0440\u0456\u043A"]},every:["\u043A\u043E\u0436\u0435\u043D","\u043A\u043E\u0436\u043D\u0430","\u043A\u043E\u0436\u043D\u0435","\u0432\u0441\u0456"],other:["\u0456\u043D\u0448\u0438\u0439","\u0456\u043D\u0448\u0430","\u0456\u043D\u0448\u0435","\u0456\u043D\u0448\u0456"],weekdays:{monday:["\u043F\u043E\u043D\u0435\u0434\u0456\u043B\u043E\u043A"],tuesday:["\u0432\u0456\u0432\u0442\u043E\u0440\u043E\u043A"],wednesday:["\u0441\u0435\u0440\u0435\u0434\u0430"],thursday:["\u0447\u0435\u0442\u0432\u0435\u0440"],friday:["\u043F'\u044F\u0442\u043D\u0438\u0446\u044F"],saturday:["\u0441\u0443\u0431\u043E\u0442\u0430"],sunday:["\u043D\u0435\u0434\u0456\u043B\u044F"]},pluralWeekdays:{monday:["\u043F\u043E\u043D\u0435\u0434\u0456\u043B\u043A\u0438"],tuesday:["\u0432\u0456\u0432\u0442\u043E\u0440\u043A\u0438"],wednesday:["\u0441\u0435\u0440\u0435\u0434\u0438"],thursday:["\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0438"],friday:["\u043F'\u044F\u0442\u043D\u0438\u0446\u0456"],saturday:["\u0441\u0443\u0431\u043E\u0442\u0438"],sunday:["\u043D\u0435\u0434\u0456\u043B\u0456"]},ordinals:{first:["\u043F\u0435\u0440\u0448\u0438\u0439","\u043F\u0435\u0440\u0448\u0430","\u043F\u0435\u0440\u0448\u0435"],second:["\u0434\u0440\u0443\u0433\u0438\u0439","\u0434\u0440\u0443\u0433\u0430","\u0434\u0440\u0443\u0433\u0435"],third:["\u0442\u0440\u0435\u0442\u0456\u0439","\u0442\u0440\u0435\u0442\u044F","\u0442\u0440\u0435\u0442\u0454"],fourth:["\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0438\u0439","\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0430","\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0435"],last:["\u043E\u0441\u0442\u0430\u043D\u043D\u0456\u0439","\u043E\u0441\u0442\u0430\u043D\u043D\u044F","\u043E\u0441\u0442\u0430\u043D\u043D\u0454"]},periods:{day:["\u0434\u0435\u043D\u044C","\u0434\u043D\u0456","\u0434\u043D\u0456\u0432"],week:["\u0442\u0438\u0436\u0434\u0435\u043D\u044C","\u0442\u0438\u0436\u043D\u0456","\u0442\u0438\u0436\u043D\u0456\u0432"],month:["\u043C\u0456\u0441\u044F\u0446\u044C","\u043C\u0456\u0441\u044F\u0446\u0456","\u043C\u0456\u0441\u044F\u0446\u0456\u0432"],year:["\u0440\u0456\u043A","\u0440\u043E\u043A\u0438","\u0440\u043E\u043A\u0456\u0432"]}},timeEstimate:{hours:["\u0433","\u0433\u043E\u0434","\u0433\u043E\u0434\u0438\u043D\u0430","\u0433\u043E\u0434\u0438\u043D\u0438","\u0433\u043E\u0434\u0438\u043D"],minutes:["\u0445\u0432","\u043C\u0456\u043D","\u0445\u0432\u0438\u043B\u0438\u043D\u0430","\u0445\u0432\u0438\u043B\u0438\u043D\u0438","\u0445\u0432\u0438\u043B\u0438\u043D"]},fallbackStatus:{open:["\u0437\u0440\u043E\u0431\u0438\u0442\u0438","\u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438\u0439","\u043E\u0447\u0456\u043A\u0443\u0454","todo","\u0432 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u043D\u0456"],inProgress:["\u0432 \u0440\u043E\u0431\u043E\u0442\u0456","\u0432\u0438\u043A\u043E\u043D\u0443\u0454\u0442\u044C\u0441\u044F","\u0440\u043E\u0431\u043B\u044E","\u043F\u0440\u0430\u0446\u044E\u044E","\u0432 \u043F\u0440\u043E\u0446\u0435\u0441\u0456"],done:["\u0433\u043E\u0442\u043E\u0432\u043E","\u0432\u0438\u043A\u043E\u043D\u0430\u043D\u043E","\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E","\u0437\u0430\u043A\u0456\u043D\u0447\u0435\u043D\u043E","\u0437\u0440\u043E\u0431\u043B\u0435\u043D\u043E"],cancelled:["\u0441\u043A\u0430\u0441\u043E\u0432\u0430\u043D\u043E","\u0432\u0456\u0434\u043C\u0456\u043D\u0435\u043D\u043E","\u043F\u0440\u0438\u043F\u0438\u043D\u0435\u043D\u043E"],waiting:["\u0447\u0435\u043A\u0430\u044E","\u043E\u0447\u0456\u043A\u0443\u044E","\u0437\u0430\u0431\u043B\u043E\u043A\u043E\u0432\u0430\u043D\u043E","\u043F\u0440\u0438\u0437\u0443\u043F\u0438\u043D\u0435\u043D\u043E"]},fallbackPriority:{urgent:["\u0442\u0435\u0440\u043C\u0456\u043D\u043E\u0432\u043E","\u043A\u0440\u0438\u0442\u0438\u0447\u043D\u043E","\u043D\u0430\u0439\u0432\u0438\u0449\u0438\u0439","\u043D\u0435\u0432\u0456\u0434\u043A\u043B\u0430\u0434\u043D\u043E","\u043F\u0440\u0456\u043E\u0440\u0438\u0442\u0435\u0442\u043D\u043E"],high:["\u0432\u0438\u0441\u043E\u043A\u0438\u0439","\u0432\u0438\u0441\u043E\u043A\u0430","\u0432\u0430\u0436\u043B\u0438\u0432\u043E","\u043F\u0456\u0434\u0432\u0438\u0449\u0435\u043D\u0438\u0439"],normal:["\u0441\u0435\u0440\u0435\u0434\u043D\u0456\u0439","\u0441\u0435\u0440\u0435\u0434\u043D\u044F","\u043D\u043E\u0440\u043C\u0430\u043B\u044C\u043D\u043E","\u0437\u0432\u0438\u0447\u0430\u0439\u043D\u043E","\u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E"],low:["\u043D\u0438\u0437\u044C\u043A\u0438\u0439","\u043D\u0438\u0437\u044C\u043A\u0430","\u043C\u0435\u043D\u0448\u0438\u0439","\u043C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0438\u0439","\u043D\u0435\u0437\u043D\u0430\u0447\u043D\u0438\u0439"]}}});var fhe=y(()=>{});function ghe(r){return hhe[r]||hhe.en}var hhe,iU=y(()=>{qfe();Yfe();Kfe();Qfe();Xfe();the();nhe();ihe();ohe();che();uhe();mhe();fhe();hhe={en:Vfe,es:Wfe,fr:Gfe,de:Zfe,ru:Jfe,zh:ehe,ja:rhe,it:ahe,nl:she,pt:lhe,sv:dhe,uk:phe}});var B_,sU=y(()=>{B_=class{constructor(e,t=[]){this.config=e,this.userFields=t,this.triggerMap=new Map,this.propertyMap=new Map,this.buildMaps()}buildMaps(){this.triggerMap.clear(),this.propertyMap.clear();for(let e of this.config.triggers)e.enabled&&(this.triggerMap.set(e.trigger,e),this.propertyMap.set(e.propertyId,e))}getTriggerForProperty(e){return this.propertyMap.get(e)}getPropertyForTrigger(e){var t;return(t=this.triggerMap.get(e))==null?void 0:t.propertyId}getAllEnabledTriggers(){return this.config.triggers.filter(e=>e.enabled)}getTriggersOrderedByLength(){return this.getAllEnabledTriggers().sort((e,t)=>t.trigger.length-e.trigger.length)}usesNativeTagSuggester(){let e=this.getTriggerForProperty("tags");return(e==null?void 0:e.trigger)==="#"&&(e==null?void 0:e.enabled)}getTagTrigger(){let e=this.getTriggerForProperty("tags");return e!=null&&e.enabled?e.trigger:void 0}getContextTrigger(){let e=this.getTriggerForProperty("contexts");return e!=null&&e.enabled?e.trigger:void 0}getProjectTrigger(){let e=this.getTriggerForProperty("projects");return e!=null&&e.enabled?e.trigger:void 0}getStatusTrigger(){let e=this.getTriggerForProperty("status");return e!=null&&e.enabled?e.trigger:void 0}getPriorityTrigger(){let e=this.getTriggerForProperty("priority");return e!=null&&e.enabled?e.trigger:void 0}getUserField(e){return this.userFields.find(t=>t.id===e)}isUserField(e){return this.userFields.some(t=>t.id===e)}getSuggesterType(e){if(e==="tags")return this.usesNativeTagSuggester()?"native-tag":"list";if(e==="contexts")return"list";if(e==="projects")return"file";if(e==="status")return"status";if(e==="priority")return"priority";let t=this.getUserField(e);if(t)switch(t.type){case"text":return t.autosuggestFilter?"file":"list";case"list":return"list";case"boolean":return"boolean";default:return"none"}return"none"}updateConfig(e){this.config=e,this.buildMaps()}updateUserFields(e){this.userFields=e}}});var yhe=x((oU,lU)=>{(function(r,e){typeof oU=="object"&&typeof lU!="undefined"?lU.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs_plugin_quarterOfYear=e()})(oU,(function(){"use strict";var r="month",e="quarter";return function(t,n){var a=n.prototype;a.quarter=function(o){return this.$utils().u(o)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(o-1))};var i=a.add;a.add=function(o,l){return o=Number(o),this.$utils().p(l)===e?this.add(3*o,r):i.bind(this)(o,l)};var s=a.startOf;a.startOf=function(o,l){var c=this.$utils(),d=!!c.u(l)||l;if(c.p(o)===e){var u=this.quarter()-1;return d?this.month(3*u).startOf(r).startOf("day"):this.month(3*u+2).endOf(r).endOf("day")}return s.bind(this)(o,l)}}}))});var tr=x((cU,dU)=>{(function(r,e){typeof cU=="object"&&typeof dU!="undefined"?dU.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=e()})(cU,(function(){"use strict";var r=1e3,e=6e4,t=36e5,n="millisecond",a="second",i="minute",s="hour",o="day",l="week",c="month",d="quarter",u="year",p="date",m="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(R){var A=["th","st","nd","rd"],F=R%100;return"["+R+(A[(F-20)%10]||A[F]||A[0])+"]"}},v=function(R,A,F){var $=String(R);return!$||$.length>=A?R:""+Array(A+1-$.length).join(F)+R},b={s:v,z:function(R){var A=-R.utcOffset(),F=Math.abs(A),$=Math.floor(F/60),B=F%60;return(A<=0?"+":"-")+v($,2,"0")+":"+v(B,2,"0")},m:function R(A,F){if(A.date()1)return R(Q[0])}else{var G=A.name;w[G]=A,B=G}return!$&&B&&(k=B),B||!$&&k},D=function(R,A){if(C(R))return R.clone();var F=typeof A=="object"?A:{};return F.date=R,F.args=arguments,new O(F)},P=b;P.l=E,P.i=C,P.w=function(R,A){return D(R,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var O=(function(){function R(F){this.$L=E(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[S]=!0}var A=R.prototype;return A.parse=function(F){this.$d=(function($){var B=$.date,ue=$.utc;if(B===null)return new Date(NaN);if(P.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var Q=B.match(f);if(Q){var G=Q[2]-1||0,ie=(Q[7]||"0").substring(0,3);return ue?new Date(Date.UTC(Q[1],G,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,ie)):new Date(Q[1],G,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,ie)}}return new Date(B)})(F),this.init()},A.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},A.$utils=function(){return P},A.isValid=function(){return this.$d.toString()!==m},A.isSame=function(F,$){var B=D(F);return this.startOf($)<=B&&B<=this.endOf($)},A.isAfter=function(F,$){return D(F){(function(r){r[r.AM=0]="AM",r[r.PM=1]="PM"})(H||(H={}));(function(r){r[r.SUNDAY=0]="SUNDAY",r[r.MONDAY=1]="MONDAY",r[r.TUESDAY=2]="TUESDAY",r[r.WEDNESDAY=3]="WEDNESDAY",r[r.THURSDAY=4]="THURSDAY",r[r.FRIDAY=5]="FRIDAY",r[r.SATURDAY=6]="SATURDAY"})(Ye||(Ye={}));(function(r){r[r.JANUARY=1]="JANUARY",r[r.FEBRUARY=2]="FEBRUARY",r[r.MARCH=3]="MARCH",r[r.APRIL=4]="APRIL",r[r.MAY=5]="MAY",r[r.JUNE=6]="JUNE",r[r.JULY=7]="JULY",r[r.AUGUST=8]="AUGUST",r[r.SEPTEMBER=9]="SEPTEMBER",r[r.OCTOBER=10]="OCTOBER",r[r.NOVEMBER=11]="NOVEMBER",r[r.DECEMBER=12]="DECEMBER"})(Ys||(Ys={}))});function vhe(r,e){r.assign("day",e.getDate()),r.assign("month",e.getMonth()+1),r.assign("year",e.getFullYear())}function khe(r,e){r.assign("hour",e.getHours()),r.assign("minute",e.getMinutes()),r.assign("second",e.getSeconds()),r.assign("millisecond",e.getMilliseconds()),r.assign("meridiem",e.getHours()<12?H.AM:H.PM)}function U_(r,e){r.imply("day",e.getDate()),r.imply("month",e.getMonth()+1),r.imply("year",e.getFullYear())}function bhe(r,e){r.imply("hour",e.getHours()),r.imply("minute",e.getMinutes()),r.imply("second",e.getSeconds()),r.imply("millisecond",e.getMilliseconds()),r.imply("meridiem",e.getHours()<12?H.AM:H.PM)}var uU=y(()=>{Ht()});function im(r,e,t,n,a=0){let i=0,s=0;for(;s{pU=st(tr(),1);Ht();eet={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:{timezoneOffsetDuringDst:120,timezoneOffsetNonDst:60,dstStart:r=>The(r,Ys.MARCH,Ye.SUNDAY,2),dstEnd:r=>The(r,Ys.OCTOBER,Ye.SUNDAY,3)},CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CT:{timezoneOffsetDuringDst:-300,timezoneOffsetNonDst:-360,dstStart:r=>im(r,Ys.MARCH,Ye.SUNDAY,2,2),dstEnd:r=>im(r,Ys.NOVEMBER,Ye.SUNDAY,1,2)},CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:{timezoneOffsetDuringDst:-240,timezoneOffsetNonDst:-300,dstStart:r=>im(r,Ys.MARCH,Ye.SUNDAY,2,2),dstEnd:r=>im(r,Ys.NOVEMBER,Ye.SUNDAY,1,2)},FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MT:{timezoneOffsetDuringDst:-360,timezoneOffsetNonDst:-420,dstStart:r=>im(r,Ys.MARCH,Ye.SUNDAY,2,2),dstEnd:r=>im(r,Ys.NOVEMBER,Ye.SUNDAY,1,2)},MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:{timezoneOffsetDuringDst:-420,timezoneOffsetNonDst:-480,dstStart:r=>im(r,Ys.MARCH,Ye.SUNDAY,2,2),dstEnd:r=>im(r,Ys.NOVEMBER,Ye.SUNDAY,1,2)},PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360}});function whe(r,e){var n,a,i,s,o,l,c;let t=new Date(r);if(e.y&&(e.year=e.y,delete e.y),e.mo&&(e.month=e.mo,delete e.mo),e.M&&(e.month=e.M,delete e.M),e.w&&(e.week=e.w,delete e.w),e.d&&(e.day=e.d,delete e.d),e.h&&(e.hour=e.h,delete e.h),e.m&&(e.minute=e.m,delete e.m),e.s&&(e.second=e.s,delete e.s),e.ms&&(e.millisecond=e.ms,delete e.ms),"year"in e){let d=Math.floor(e.year);t.setFullYear(t.getFullYear()+d);let u=e.year-d;u>0&&(e.month=(n=e==null?void 0:e.month)!=null?n:0,e.month+=u*12)}if("quarter"in e){let d=Math.floor(e.quarter);t.setMonth(t.getMonth()+d*3)}if("month"in e){let d=Math.floor(e.month);t.setMonth(t.getMonth()+d);let u=e.month-d;u>0&&(e.week=(a=e==null?void 0:e.week)!=null?a:0,e.week+=u*4)}if("week"in e){let d=Math.floor(e.week);t.setDate(t.getDate()+d*7);let u=e.week-d;u>0&&(e.day=(i=e==null?void 0:e.day)!=null?i:0,e.day+=Math.round(u*7))}if("day"in e){let d=Math.floor(e.day);t.setDate(t.getDate()+d);let u=e.day-d;u>0&&(e.hour=(s=e==null?void 0:e.hour)!=null?s:0,e.hour+=Math.round(u*24))}if("hour"in e){let d=Math.floor(e.hour);t.setHours(t.getHours()+d);let u=e.hour-d;u>0&&(e.minute=(o=e==null?void 0:e.minute)!=null?o:0,e.minute+=Math.round(u*60))}if("minute"in e){let d=Math.floor(e.minute);t.setMinutes(t.getMinutes()+d);let u=e.minute-d;u>0&&(e.second=(l=e==null?void 0:e.second)!=null?l:0,e.second+=Math.round(u*60))}if("second"in e){let d=Math.floor(e.second);t.setSeconds(t.getSeconds()+d);let u=e.second-d;u>0&&(e.millisecond=(c=e==null?void 0:e.millisecond)!=null?c:0,e.millisecond+=Math.round(u*1e3))}if("millisecond"in e){let d=Math.floor(e.millisecond);t.setMilliseconds(t.getMilliseconds()+d)}return t}function Yv(r){let e={};for(let t in r)e[t]=-r[t];return e}var $S=y(()=>{});var She,fU,rr,te,Yt,pt=y(()=>{She=st(yhe(),1),fU=st(tr(),1);uU();mU();$S();fU.default.extend(She.default);rr=class r{constructor(e,t){I(this,"instant");I(this,"timezoneOffset");this.instant=e!=null?e:new Date,this.timezoneOffset=t!=null?t:null}static fromDate(e){return new r(e)}static fromInput(e,t){var i;if(e instanceof Date)return r.fromDate(e);let n=(i=e==null?void 0:e.instant)!=null?i:new Date,a=H_(e==null?void 0:e.timezone,n,t);return new r(n,a)}getDateWithAdjustedTimezone(){let e=new Date(this.instant);return this.timezoneOffset!==null&&e.setMinutes(e.getMinutes()-this.getSystemTimezoneAdjustmentMinute(this.instant)),e}getSystemTimezoneAdjustmentMinute(e,t){var i;(!e||e.getTime()<0)&&(e=new Date);let n=-e.getTimezoneOffset(),a=(i=t!=null?t:this.timezoneOffset)!=null?i:n;return n-a}getTimezoneOffset(){var e;return(e=this.timezoneOffset)!=null?e:-this.instant.getTimezoneOffset()}},te=class r{constructor(e,t){I(this,"knownValues");I(this,"impliedValues");I(this,"reference");I(this,"_tags",new Set);if(this.reference=e,this.knownValues={},this.impliedValues={},t)for(let a in t)this.knownValues[a]=t[a];let n=e.getDateWithAdjustedTimezone();this.imply("day",n.getDate()),this.imply("month",n.getMonth()+1),this.imply("year",n.getFullYear()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}get(e){return e in this.knownValues?this.knownValues[e]:e in this.impliedValues?this.impliedValues[e]:null}isCertain(e){return e in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(e,t){return e in this.knownValues?this:(this.impliedValues[e]=t,this)}assign(e,t){return this.knownValues[e]=t,delete this.impliedValues[e],this}delete(e){delete this.knownValues[e],delete this.impliedValues[e]}clone(){let e=new r(this.reference);e.knownValues={},e.impliedValues={};for(let t in this.knownValues)e.knownValues[t]=this.knownValues[t];for(let t in this.impliedValues)e.impliedValues[t]=this.impliedValues[t];return e}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")&&!this.isCertain("year")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isDateWithUnknownYear(){return this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let e=this.dateWithoutTimezoneAdjustment();return!(e.getFullYear()!==this.get("year")||e.getMonth()!==this.get("month")-1||e.getDate()!==this.get("day")||this.get("hour")!=null&&e.getHours()!=this.get("hour")||this.get("minute")!=null&&e.getMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents { tags: ${JSON.stringify(Array.from(this._tags).sort())}, knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`}dayjs(){return(0,fU.default)(this.dateWithoutTimezoneAdjustment())}date(){let e=this.dateWithoutTimezoneAdjustment(),t=this.reference.getSystemTimezoneAdjustmentMinute(e,this.get("timezoneOffset"));return new Date(e.getTime()+t*6e4)}addTag(e){return this._tags.add(e),this}addTags(e){for(let t of e)this._tags.add(t);return this}tags(){return new Set(this._tags)}dateWithoutTimezoneAdjustment(){let e=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return e.setFullYear(this.get("year")),e}static createRelativeFromReference(e,t){let n=whe(e.getDateWithAdjustedTimezone(),t),a=new r(e);return a.addTag("result/relativeDate"),t.hour||t.minute||t.second?(a.addTag("result/relativeDateAndTime"),khe(a,n),vhe(a,n),a.assign("timezoneOffset",e.getTimezoneOffset())):(bhe(a,n),a.imply("timezoneOffset",e.getTimezoneOffset()),t.day?(a.assign("day",n.getDate()),a.assign("month",n.getMonth()+1),a.assign("year",n.getFullYear()),a.assign("weekday",n.getDay())):t.week?(a.assign("day",n.getDate()),a.assign("month",n.getMonth()+1),a.assign("year",n.getFullYear()),a.imply("weekday",n.getDay())):(a.imply("day",n.getDate()),t.month?(a.assign("month",n.getMonth()+1),a.assign("year",n.getFullYear())):(a.imply("month",n.getMonth()+1),t.year?a.assign("year",n.getFullYear()):a.imply("year",n.getFullYear())))),a}},Yt=class r{constructor(e,t,n,a,i){I(this,"refDate");I(this,"index");I(this,"text");I(this,"reference");I(this,"start");I(this,"end");this.reference=e,this.refDate=e.instant,this.index=t,this.text=n,this.start=a||new te(e),this.end=i}clone(){let e=new r(this.reference,this.index,this.text);return e.start=this.start?this.start.clone():null,e.end=this.end?this.end.clone():null,e}date(){return this.start.date()}addTag(e){return this.start.addTag(e),this.end&&this.end.addTag(e),this}addTags(e){return this.start.addTags(e),this.end&&this.end.addTags(e),this}tags(){let e=new Set(this.start.tags());if(this.end)for(let t of this.end.tags())e.add(t);return e}toString(){let e=Array.from(this.tags()).sort();return`[ParsingResult {index: ${this.index}, text: '${this.text}', tags: ${JSON.stringify(e)} ...}]`}}});function zi(r,e,t="\\s{0,5},?\\s{0,5}"){let n=e.replace(/\((?!\?)/g,"(?:");return`${r}${n}(?:${t}${n}){0,10}`}function tet(r){let e;return r instanceof Array?e=[...r]:r instanceof Map?e=Array.from(r.keys()):e=Object.keys(r),e}function oe(r){return`(?:${tet(r).sort((t,n)=>n.length-t.length).join("|").replace(/\./g,"\\.")})`}var Ot=y(()=>{});function ls(r){return r<100&&(r>50?r=r+1900:r=r+2e3),r}function fr(r,e,t){let n=(0,xhe.default)(r),a=n;a=a.month(t-1),a=a.date(e),a=a.year(n.year());let i=a.add(1,"y"),s=a.add(-1,"y");return Math.abs(i.diff(n)){xhe=st(tr(),1)});function ret(r){let e=r.toLowerCase();return hU[e]!==void 0?hU[e]:e==="a"||e==="an"||e=="the"?1:e.match(/few/)?3:e.match(/half/)?.5:e.match(/couple/)?2:e.match(/several/)?7:parseFloat(e)}function Kv(r){let e=r.toLowerCase();return gU[e]!==void 0?gU[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}function om(r){if(/BE/i.test(r))return r=r.replace(/BE/i,""),parseInt(r)-543;if(/BCE?/i.test(r))return r=r.replace(/BCE?/i,""),-parseInt(r);if(/(AD|CE)/i.test(r))return r=r.replace(/(AD|CE)/i,""),parseInt(r);let e=parseInt(r);return ls(e)}function Ro(r){let e={},t=r,n=Che.exec(t);for(;n;)aet(e,n),t=t.substring(n[0].length).trim(),n=Che.exec(t);return Object.keys(e).length==0?null:e}function aet(r,e){if(e[0].match(/^[a-zA-Z]+$/))return;let t=ret(e[1]),n=BS[e[2].toLowerCase()];r[n]=t}var V_,yU,No,hU,gU,Ehe,BS,Dhe,Gv,sm,Phe,Che,net,Mhe,Mu,lm,da=y(()=>{Ot();Rn();V_={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6},yU={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},No={...yU,jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12},hU={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},gU={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31},Ehe={second:"second",seconds:"second",minute:"minute",minutes:"minute",hour:"hour",hours:"hour",day:"d",days:"d",week:"week",weeks:"week",month:"month",months:"month",quarter:"quarter",quarters:"quarter",year:"year",years:"year"},BS={s:"second",sec:"second",second:"second",seconds:"second",m:"minute",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",d:"d",day:"d",days:"d",w:"w",week:"week",weeks:"week",mo:"month",mon:"month",mos:"month",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year",...Ehe},Dhe=`(?:${oe(hU)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|the|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;Gv=`(?:${oe(gU)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;sm="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9]|2[0-5])";Phe=`(${Dhe})\\s{0,3}(${oe(BS)})`,Che=new RegExp(Phe,"i"),net=`(${Dhe})\\s{0,3}(${oe(Ehe)})`,Mhe="\\s{0,5},?(?:\\s*and)?\\s{0,5}",Mu=zi("(?:(?:about|around)\\s{0,3})?",Phe,Mhe),lm=zi("(?:(?:about|around)\\s{0,3})?",net,Mhe)});var q,xe=y(()=>{q=class{constructor(){I(this,"cachedInnerPattern",null);I(this,"cachedPattern",null)}innerPatternHasChange(e,t){return this.innerPattern(e)!==t}patternLeftBoundary(){return"(\\W|^)"}pattern(e){return this.cachedInnerPattern&&!this.innerPatternHasChange(e,this.cachedInnerPattern)?this.cachedPattern:(this.cachedInnerPattern=this.innerPattern(e),this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${this.cachedInnerPattern.source}`,this.cachedInnerPattern.flags),this.cachedPattern)}extract(e,t){var a;let n=(a=t[1])!=null?a:"";t.index=t.index+n.length,t[0]=t[0].substring(n.length);for(let i=2;i{da();pt();xe();iet=new RegExp(`(?:(?:within|in|for)\\s*)?(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Mu})(?=\\W|$)`,"i"),set=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Mu})(?=\\W|$)`,"i"),oet=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${lm})(?=\\W|$)`,"i"),US=class extends q{constructor(t){super();I(this,"strictMode");this.strictMode=t}innerPattern(t){return this.strictMode?oet:t.option.forwardDate?iet:set}innerExtract(t,n){if(n[0].match(/^for\s*the\s*\w+/))return null;let a=Ro(n[1]);return a?(t.debug(()=>{console.log(a),console.log(te.createRelativeFromReference(t.reference,a))}),te.createRelativeFromReference(t.reference,a)):null}}});var cet,_he,Ihe,det,Nhe,HS,Rhe=y(()=>{Rn();da();da();da();Ot();xe();cet=new RegExp(`(?:on\\s{0,3})?(${Gv})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${Gv}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${oe(No)})(?:(?:-|/|,?\\s{0,3})(${sm}(?!\\w)))?(?=\\W|$)`,"i"),_he=1,Ihe=2,det=3,Nhe=4,HS=class extends q{innerPattern(){return cet}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),a=No[t[det].toLowerCase()],i=Kv(t[_he]);if(i>31)return t.index=t.index+t[_he].length,null;if(n.start.assign("month",a),n.start.assign("day",i),t[Nhe]){let s=om(t[Nhe]);n.start.assign("year",s)}else{let s=fr(e.refDate,i,a);n.start.imply("year",s)}if(t[Ihe]){let s=Kv(t[Ihe]);n.end=n.start.clone(),n.end.assign("day",s)}return n}}});var uet,pet,Fhe,vU,kU,VS,Ohe=y(()=>{Rn();da();da();da();Ot();xe();uet=new RegExp(`(${oe(No)})(?:-|/|\\s*,?\\s*)(${Gv})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${Gv})\\s*)?(?:(?:-|/|\\s*,\\s*|\\s+)(${sm}))?(?=\\W|$)(?!\\:\\d)`,"i"),pet=1,Fhe=2,vU=3,kU=4,VS=class extends q{constructor(t){super();I(this,"shouldSkipYearLikeDate");this.shouldSkipYearLikeDate=t}innerPattern(){return uet}innerExtract(t,n){let a=No[n[pet].toLowerCase()],i=Kv(n[Fhe]);if(i>31||this.shouldSkipYearLikeDate&&!n[vU]&&!n[kU]&&n[Fhe].match(/^2[0-5]$/))return null;let s=t.createParsingComponents({day:i,month:a}).addTag("parser/ENMonthNameMiddleEndianParser");if(n[kU]){let c=om(n[kU]);s.assign("year",c)}else{let c=fr(t.refDate,i,a);s.imply("year",c)}if(!n[vU])return s;let o=Kv(n[vU]),l=t.createParsingResult(n.index,n[0]);return l.start=s,l.end=s.clone(),l.end.assign("day",o),l}}});var met,fet,het,Lhe,qS,zhe=y(()=>{da();Rn();Ot();da();xe();met=new RegExp(`((?:in)\\s*)?(${oe(No)})\\s*(?:(?:,|-|of)?\\s*(${sm})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),fet=1,het=2,Lhe=3,qS=class extends q{innerPattern(){return met}innerExtract(e,t){let n=t[het].toLowerCase();if(t[0].length<=3&&!yU[n])return null;let a=e.createParsingResult(t.index+(t[fet]||"").length,t.index+t[0].length);a.start.imply("day",1),a.start.addTag("parser/ENMonthNameParser");let i=No[n];if(a.start.assign("month",i),t[Lhe]){let s=om(t[Lhe]);a.start.assign("year",s)}else{let s=fr(e.refDate,1,i);a.start.imply("year",s)}return a}}});var get,yet,vet,jhe,ket,WS,$he=y(()=>{da();Ot();xe();get=new RegExp(`([0-9]{4})[-\\.\\/\\s](?:(${oe(No)})|([0-9]{1,2}))[-\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),yet=1,vet=2,jhe=3,ket=4,WS=class extends q{constructor(t){super();I(this,"strictMonthDateOrder");this.strictMonthDateOrder=t}innerPattern(){return get}innerExtract(t,n){let a=parseInt(n[yet]),i=parseInt(n[ket]),s=n[jhe]?parseInt(n[jhe]):No[n[vet].toLowerCase()];if(s<1||s>12){if(this.strictMonthDateOrder)return null;i>=1&&i<=12&&([s,i]=[i,s])}return i<1||i>31?null:{day:i,month:s,year:a}}}});var bet,Tet,wet,YS,Bhe=y(()=>{xe();bet=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),Tet=1,wet=2,YS=class extends q{innerPattern(){return bet}innerExtract(e,t){let n=parseInt(t[wet]),a=parseInt(t[Tet]);return e.createParsingComponents().imply("day",1).assign("month",a).assign("year",n)}}});function xet(r,e,t,n){return new RegExp(`${r}${e}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,n)}function Cet(r,e){return new RegExp(`^(${r})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}var Uhe,Zv,q_,W_,GS,Da,Au=y(()=>{Ht();Uhe=2,Zv=3,q_=4,W_=5,GS=6,Da=class{constructor(e=!1){I(this,"strictMode");I(this,"cachedPrimaryPrefix",null);I(this,"cachedPrimarySuffix",null);I(this,"cachedPrimaryTimePattern",null);I(this,"cachedFollowingPhase",null);I(this,"cachedFollowingSuffix",null);I(this,"cachedFollowingTimePatten",null);this.strictMode=e}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?!/)(?=\\W|$)"}followingSuffix(){return"(?!/)(?=\\W|$)"}pattern(e){return this.getPrimaryTimePatternThroughCache()}extract(e,t){let n=this.extractPrimaryTimeComponents(e,t);if(!n)return t[0].match(/^\d{4}/)?(t.index+=4,null):(t.index+=t[0].length,null);let a=t.index+t[1].length,i=t[0].substring(t[1].length),s=e.createParsingResult(a,i,n);t.index+=t[0].length;let o=e.text.substring(t.index),c=this.getFollowingTimePatternThroughCache().exec(o);return i.match(/^\d{3,4}/)&&c&&(c[0].match(/^\s*([+-])\s*\d{2,4}$/)||c[0].match(/^\s*([+-])\s*\d{2}\W\d{2}/))?null:!c||c[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(s):(s.end=this.extractFollowingTimeComponents(e,c,s),s.end&&(s.text+=c[0]),this.checkAndReturnWithFollowingPattern(s))}extractPrimaryTimeComponents(e,t,n=!1){let a=e.createParsingComponents(),i=0,s=null,o=parseInt(t[Uhe]);if(o>100){if(this.strictMode||t[Zv]!=null)return null;i=o%100,o=Math.floor(o/100)}if(o>24)return null;if(t[Zv]!=null){if(t[Zv].length==1&&!t[GS])return null;i=parseInt(t[Zv])}if(i>=60)return null;if(o>12&&(s=H.PM),t[GS]!=null){if(o>12)return null;let l=t[GS][0].toLowerCase();l=="a"&&(s=H.AM,o==12&&(o=0)),l=="p"&&(s=H.PM,o!=12&&(o+=12))}if(a.assign("hour",o),a.assign("minute",i),s!==null?a.assign("meridiem",s):o<12?a.imply("meridiem",H.AM):a.imply("meridiem",H.PM),t[W_]!=null){let l=parseInt(t[W_].substring(0,3));if(l>=1e3)return null;a.assign("millisecond",l)}if(t[q_]!=null){let l=parseInt(t[q_]);if(l>=60)return null;a.assign("second",l)}return a}extractFollowingTimeComponents(e,t,n){let a=e.createParsingComponents();if(t[W_]!=null){let l=parseInt(t[W_].substring(0,3));if(l>=1e3)return null;a.assign("millisecond",l)}if(t[q_]!=null){let l=parseInt(t[q_]);if(l>=60)return null;a.assign("second",l)}let i=parseInt(t[Uhe]),s=0,o=-1;if(t[Zv]!=null?s=parseInt(t[Zv]):i>100&&(s=i%100,i=Math.floor(i/100)),s>=60||i>24)return null;if(i>=12&&(o=H.PM),t[GS]!=null){if(i>12)return null;let l=t[GS][0].toLowerCase();l=="a"&&(o=H.AM,i==12&&(i=0,a.isCertain("day")||a.imply("day",a.get("day")+1))),l=="p"&&(o=H.PM,i!=12&&(i+=12)),n.start.isCertain("meridiem")||(o==H.AM?(n.start.imply("meridiem",H.AM),n.start.get("hour")==12&&n.start.assign("hour",0)):(n.start.imply("meridiem",H.PM),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}return a.assign("hour",i),a.assign("minute",s),o>=0?a.assign("meridiem",o):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>i?a.imply("meridiem",H.AM):i<=12&&(a.assign("hour",i+12),a.assign("meridiem",H.PM)):i>12?a.imply("meridiem",H.PM):i<=12&&a.imply("meridiem",H.AM),a.date().getTime()24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;let t=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(t){if(this.strictMode)return null;let n=t[1],a=t[2];if(a.includes(".")&&!a.match(/\d(\.\d{2})+$/))return null;let i=parseInt(a),s=parseInt(n);if(i>24||s>24)return null}return e}getPrimaryTimePatternThroughCache(){let e=this.primaryPrefix(),t=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===t?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=xet(this.primaryPatternLeftBoundary(),e,t,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=t,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){let e=this.followingPhase(),t=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===t?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=Cet(e,t),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=t,this.cachedFollowingTimePatten)}}});var KS,Hhe=y(()=>{Ht();Au();KS=class extends Da{constructor(e){super(e)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|until|through|till|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(!n)return n;if(t[0].endsWith("night")){let a=n.get("hour");a>=6&&a<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",H.PM)):a<6&&n.assign("meridiem",H.AM)}if(t[0].endsWith("afternoon")){n.assign("meridiem",H.PM);let a=n.get("hour");a>=0&&a<=6&&n.assign("hour",n.get("hour")+12)}return t[0].endsWith("morning")&&(n.assign("meridiem",H.AM),n.get("hour")<12&&n.assign("hour",n.get("hour"))),n.addTag("parser/ENTimeExpressionParser")}extractFollowingTimeComponents(e,t,n){let a=super.extractFollowingTimeComponents(e,t,n);return a&&a.addTag("parser/ENTimeExpressionParser"),a}}});var Eet,Det,ZS,Vhe=y(()=>{da();pt();xe();$S();Eet=new RegExp(`(${Mu})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),Det=new RegExp(`(${lm})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),ZS=class extends q{constructor(t){super();I(this,"strictMode");this.strictMode=t}innerPattern(){return this.strictMode?Det:Eet}innerExtract(t,n){let a=Ro(n[1]);return a?te.createRelativeFromReference(t.reference,Yv(a)):null}}});var Pet,Met,Aet,QS,qhe=y(()=>{da();pt();xe();Pet=new RegExp(`(${Mu})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),Met=new RegExp(`(${lm})\\s{0,5}(later|after|from now)(?=\\W|$)`,"i"),Aet=1,QS=class extends q{constructor(t){super();I(this,"strictMode");this.strictMode=t}innerPattern(){return this.strictMode?Met:Pet}innerExtract(t,n){let a=Ro(n[Aet]);return a?te.createRelativeFromReference(t.reference,a):null}}});var Qv,cs,_u=y(()=>{Qv=class{refine(e,t){return t.filter(n=>this.isValid(e,n))}},cs=class{refine(e,t){if(t.length<2)return t;let n=[],a=t[0],i=null;for(let s=1;s{console.log(`${this.constructor.name} merged ${l} and ${c} into ${d}`)}),a=d}}return a!=null&&n.push(a),n}}});var an,Fo=y(()=>{_u();an=class extends cs{shouldMergeResults(e,t,n){return!t.end&&!n.end&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){if(!t.start.isOnlyWeekdayComponent()&&!n.start.isOnlyWeekdayComponent()&&(n.start.getCertainComponents().forEach(i=>{t.start.isCertain(i)||t.start.imply(i,n.start.get(i))}),t.start.getCertainComponents().forEach(i=>{n.start.isCertain(i)||n.start.imply(i,t.start.get(i))})),t.start.date().getTime()>n.start.date().getTime()){let i=t.start.dayjs(),s=n.start.dayjs();n.start.isOnlyWeekdayComponent()&&s.add(7,"days").isAfter(i)?(s=s.add(7,"days"),n.start.imply("day",s.date()),n.start.imply("month",s.month()+1),n.start.imply("year",s.year())):t.start.isOnlyWeekdayComponent()&&i.add(-7,"days").isBefore(s)?(i=i.add(-7,"days"),t.start.imply("day",i.date()),t.start.imply("month",i.month()+1),t.start.imply("year",i.year())):n.start.isDateWithUnknownYear()&&s.add(1,"years").isAfter(i)?(s=s.add(1,"years"),n.start.imply("year",s.year())):t.start.isDateWithUnknownYear()&&i.add(-1,"years").isBefore(s)?(i=i.add(-1,"years"),t.start.imply("year",i.year())):[n,t]=[t,n]}let a=t.clone();return a.start=t.start,a.end=n.start,a.index=Math.min(t.index,n.index),t.index{Fo();JS=class extends an{patternBetween(){return/^\s*(to|-|–|until|through|till)\s*$/i}}});function Ll(r,e){e=e.add(1,"day"),Kr(r,e),Nc(r,e)}function Yhe(r,e){e=e.add(1,"day"),bU(r,e),Nc(r,e)}function Kr(r,e){r.assign("day",e.date()),r.assign("month",e.month()+1),r.assign("year",e.year())}function Ghe(r,e){r.assign("hour",e.hour()),r.assign("minute",e.minute()),r.assign("second",e.second()),r.assign("millisecond",e.millisecond()),r.get("hour")<12?r.assign("meridiem",H.AM):r.assign("meridiem",H.PM)}function bU(r,e){r.imply("day",e.date()),r.imply("month",e.month()+1),r.imply("year",e.year())}function Nc(r,e){r.imply("hour",e.hour()),r.imply("minute",e.minute()),r.imply("second",e.second()),r.imply("millisecond",e.millisecond())}var Gs=y(()=>{Ht()});function TU(r,e){let t=r.clone(),n=r.start,a=e.start;if(t.start=Khe(n,a),r.end!=null||e.end!=null){let i=r.end==null?r.start:r.end,s=e.end==null?e.start:e.end,o=Khe(i,s);if(r.end==null&&o.date().getTime(){Ht();Gs()});var sn,Oo=y(()=>{_u();Zhe();sn=class extends cs{shouldMergeResults(e,t,n){return(t.start.isOnlyDate()&&n.start.isOnlyTime()||n.start.isOnlyDate()&&t.start.isOnlyTime())&&e.match(this.patternBetween())!=null}mergeResults(e,t,n){let a=t.start.isOnlyDate()?TU(t,n):TU(n,t);return a.index=t.index,a.text=t.text+e+n.text,a}}});var Jv,Qhe=y(()=>{Oo();Jv=class extends sn{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-|\\.|\u2219|:)?\\s*$")}}});var _et,XS,Jhe=y(()=>{mU();_et=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),XS=class{constructor(e){I(this,"timezoneOverrides");this.timezoneOverrides=e}refine(e,t){var a;let n=(a=e.option.timezones)!=null?a:{};return t.forEach(i=>{var m,f;let s=e.text.substring(i.index+i.text.length),o=_et.exec(s);if(!o)return;let l=o[1].toUpperCase(),c=(f=(m=i.start.date())!=null?m:i.refDate)!=null?f:new Date,d={...this.timezoneOverrides,...n},u=H_(l,c,d);if(u==null)return;e.debug(()=>{console.log(`Extracting timezone: '${l}' into: ${u} for: ${i.start}`)});let p=i.start.get("timezoneOffset");p!==null&&u!=p&&(i.start.isCertain("timezoneOffset")||l!=o[1])||i.start.isOnlyDate()&&l!=o[1]||(i.text+=o[0],i.start.isCertain("timezoneOffset")||i.start.assign("timezoneOffset",u),i.end!=null&&!i.end.isCertain("timezoneOffset")&&i.end.assign("timezoneOffset",u))}),t}}});var Iet,Net,Ret,Fet,zl,ex=y(()=>{Iet=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),Net=1,Ret=2,Fet=3,zl=class{refine(e,t){return t.forEach(function(n){if(n.start.isCertain("timezoneOffset"))return;let a=e.text.substring(n.index+n.text.length),i=Iet.exec(a);if(!i)return;e.debug(()=>{console.log(`Extracting timezone: '${i[0]}' into : ${n}`)});let s=parseInt(i[Ret]),o=parseInt(i[Fet]||"0"),l=s*60+o;l>840||(i[Net]==="-"&&(l=-l),n.end!=null&&n.end.assign("timezoneOffset",l),n.start.assign("timezoneOffset",l),n.text+=i[0])}),t}}});var cm,wU=y(()=>{cm=class{refine(e,t){if(t.length<2)return t;let n=[],a=t[0];for(let i=1;i=a.index+a.text.length){n.push(a),a=s;continue}let o=null,l=null;s.text.length>a.text.length?(o=s,l=a):(o=a,l=s),e.debug(()=>{console.log(`${this.constructor.name} remove ${l} by ${o}`)}),a=o}return a!=null&&n.push(a),n}}});var Xhe,tx,ege=y(()=>{Xhe=st(tr(),1);uU();tx=class{refine(e,t){return e.option.forwardDate&&t.forEach(n=>{let a=(0,Xhe.default)(e.reference.getDateWithAdjustedTimezone());if(n.start.isOnlyTime()&&e.reference.instant>n.start.date()){let i=e.reference.getDateWithAdjustedTimezone(),s=new Date(i);s.setDate(s.getDate()+1),U_(n.start,s),e.debug(()=>{console.log(`${this.constructor.name} adjusted ${n} time from the ref date (${i}) to the following day (${s})`)}),n.end&&n.end.isOnlyTime()&&(U_(n.end,s),n.start.date()>n.end.date()&&(s.setDate(s.getDate()+1),U_(n.end,s)))}if(n.start.isOnlyWeekdayComponent()&&a.isAfter(n.start.dayjs())&&(a.day()>=n.start.get("weekday")?a=a.day(n.start.get("weekday")+7):a=a.day(n.start.get("weekday")),n.start.imply("day",a.date()),n.start.imply("month",a.month()+1),n.start.imply("year",a.year()),e.debug(()=>{console.log(`${this.constructor.name} adjusted ${n} weekday (${n.start})`)}),n.end&&n.end.isOnlyWeekdayComponent()&&(a.day()>n.end.get("weekday")?a=a.day(n.end.get("weekday")+7):a=a.day(n.end.get("weekday")),n.end.imply("day",a.date()),n.end.imply("month",a.month()+1),n.end.imply("year",a.year()),e.debug(()=>{console.log(`${this.constructor.name} adjusted ${n} weekday (${n.end})`)}))),n.start.isDateWithUnknownYear()&&a.isAfter(n.start.dayjs()))for(let i=0;i<3&&a.isAfter(n.start.dayjs());i++)n.start.imply("year",n.start.get("year")+1),e.debug(()=>{console.log(`${this.constructor.name} adjusted ${n} year (${n.start})`)}),n.end&&!n.end.isCertain("year")&&(n.end.imply("year",n.end.get("year")+1),e.debug(()=>{console.log(`${this.constructor.name} adjusted ${n} month (${n.start})`)}))}),t}}});var rx,tge=y(()=>{_u();rx=class extends Qv{constructor(t){super();I(this,"strictMode");this.strictMode=t}isValid(t,n){return n.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(t.debug(()=>{console.log(`Removing unlikely result '${n.text}'`)}),!1):n.start.isValidDate()?n.end&&!n.end.isValidDate()?(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.end})`)}),!1):this.strictMode?this.isStrictModeValid(t,n):!0:(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.start})`)}),!1)}isStrictModeValid(t,n){return n.start.isOnlyWeekdayComponent()?(t.debug(()=>{console.log(`(Strict) Removing weekday only component: ${n} (${n.end})`)}),!1):!0}}});var Oet,Let,zet,jet,rge,$et,nge,age,Bet,ige,sge,Iu,Y_=y(()=>{xe();Oet=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),Let=1,zet=2,jet=3,rge=4,$et=5,nge=6,age=7,Bet=8,ige=9,sge=10,Iu=class extends q{innerPattern(){return Oet}innerExtract(e,t){let n=e.createParsingComponents({year:parseInt(t[Let]),month:parseInt(t[zet]),day:parseInt(t[jet])});if(t[rge]!=null&&(n.assign("hour",parseInt(t[rge])),n.assign("minute",parseInt(t[$et])),t[nge]!=null&&n.assign("second",parseInt(t[nge])),t[age]!=null&&n.assign("millisecond",parseInt(t[age])),t[Bet]!=null)){let a=0;if(t[ige]){let i=parseInt(t[ige]),s=0;t[sge]!=null&&(s=parseInt(t[sge])),a=i*60,a<0?a-=s:a+=s}n.assign("timezoneOffset",a)}return n.addTag("parser/ISOFormatParser")}}});var Oh,SU=y(()=>{_u();Oh=class extends cs{mergeResults(e,t,n){let a=n.clone();return a.index=t.index,a.text=t.text+e+a.text,a.start.assign("weekday",t.start.get("weekday")),a.end&&a.end.assign("weekday",t.start.get("weekday")),a}shouldMergeResults(e,t,n){return t.start.isOnlyWeekdayComponent()&&!t.start.isCertain("hour")&&n.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}}});function mn(r,e=!1){return r.parsers.unshift(new Iu),r.refiners.unshift(new Oh),r.refiners.unshift(new zl),r.refiners.unshift(new cm),r.refiners.push(new XS),r.refiners.push(new cm),r.refiners.push(new tx),r.refiners.push(new rx(e)),r}var Ks=y(()=>{Jhe();ex();wU();ege();tge();Y_();SU()});function di(r){let e=(0,dm.default)(r.getDateWithAdjustedTimezone()),t=new te(r,{});return Kr(t,e),Ghe(t,e),t.assign("timezoneOffset",r.getTimezoneOffset()),t.addTag("casualReference/now"),t}function Pa(r){let e=(0,dm.default)(r.getDateWithAdjustedTimezone()),t=new te(r,{});return Kr(t,e),Nc(t,e),t.addTag("casualReference/today"),t}function ui(r){return Lh(r,1).addTag("casualReference/yesterday")}function Lh(r,e){return Rc(r,-e)}function pi(r){return Rc(r,1).addTag("casualReference/tomorrow")}function Rc(r,e){let t=(0,dm.default)(r.getDateWithAdjustedTimezone()),n=new te(r,{});return t=t.add(e,"day"),Kr(n,t),Nc(n,t),n}function oge(r,e=22){let t=(0,dm.default)(r.getDateWithAdjustedTimezone()),n=new te(r,{});return Kr(n,t),n.imply("hour",e),n.imply("meridiem",H.PM),n.addTag("casualReference/tonight"),n}function G_(r,e=0){let t=(0,dm.default)(r.getDateWithAdjustedTimezone()),n=new te(r,{});return t.hour()<6&&(t=t.add(-1,"day")),Kr(n,t),n.imply("hour",e),n}function Xv(r,e=20){let t=new te(r,{});return t.imply("meridiem",H.PM),t.imply("hour",e),t.addTag("casualReference/evening"),t}function K_(r,e=20){let t=(0,dm.default)(r.getDateWithAdjustedTimezone()),n=new te(r,{});return t=t.add(-1,"day"),Kr(n,t),n.imply("hour",e),n.imply("meridiem",H.PM),n.addTag("casualReference/yesterday"),n.addTag("casualReference/evening"),n}function zh(r){let e=new te(r,{}),t=(0,dm.default)(r.getDateWithAdjustedTimezone());return t.hour()>2&&Yhe(e,t),e.assign("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("millisecond",0),e.addTag("casualReference/midnight"),e}function ek(r,e=6){let t=new te(r,{});return t.imply("meridiem",H.AM),t.imply("hour",e),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/morning"),t}function lge(r,e=15){let t=new te(r,{});return t.imply("meridiem",H.PM),t.imply("hour",e),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/afternoon"),t}function tk(r){let e=new te(r,{});return e.imply("meridiem",H.AM),e.assign("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("millisecond",0),e.addTag("casualReference/noon"),e}var dm,Zs=y(()=>{pt();dm=st(tr(),1);Gs();Ht()});var cge,Uet,nx,dge=y(()=>{cge=st(tr(),1);xe();Gs();Zs();Uet=/(now|today|tonight|tomorrow|overmorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,nx=class extends q{innerPattern(e){return Uet}innerExtract(e,t){let n=(0,cge.default)(e.refDate),a=t[0].toLowerCase(),i=e.createParsingComponents();switch(a){case"now":i=di(e.reference);break;case"today":i=Pa(e.reference);break;case"yesterday":i=ui(e.reference);break;case"tomorrow":case"tmr":case"tmrw":i=pi(e.reference);break;case"tonight":i=oge(e.reference);break;case"overmorrow":i=Rc(e.reference,2);break;default:a.match(/last\s*night/)&&(n.hour()>6&&(n=n.add(-1,"day")),Kr(i,n),i.imply("hour",0));break}return i.addTag("parser/ENCasualDateParser"),i}}});var Het,ax,uge=y(()=>{xe();Zs();Het=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i,ax=class extends q{innerPattern(){return Het}innerExtract(e,t){let n=null;switch(t[1].toLowerCase()){case"afternoon":n=lge(e.reference);break;case"evening":case"night":n=Xv(e.reference);break;case"midnight":n=zh(e.reference);break;case"morning":n=ek(e.reference);break;case"noon":case"midday":n=tk(e.reference);break}return n&&n.addTag("parser/ENCasualTimeParser"),n}}});function ea(r){let e={};for(let t in r)e[t]=-r[t];return e}function Z_(r,e){let t=r.clone(),n=r.dayjs();for(let a in e)n=n.add(e[a],a);return("day"in e||"d"in e||"week"in e||"month"in e||"year"in e)&&(t.imply("day",n.date()),t.imply("month",n.month()+1),t.imply("year",n.year())),("second"in e||"minute"in e||"hour"in e)&&(t.imply("second",n.second()),t.imply("minute",n.minute()),t.imply("hour",n.hour())),t}var Qs=y(()=>{});function ta(r,e,t){let n=r.getDateWithAdjustedTimezone(),a=Vet(n,e,t),i=new te(r);return i=Z_(i,{day:a}),i.assign("weekday",e),i}function Vet(r,e,t){let n=r.getDay();switch(t){case"this":return Q_(r,e);case"last":return pge(r,e);case"next":return n==Ye.SUNDAY?e==Ye.SUNDAY?7:e:n==Ye.SATURDAY?e==Ye.SATURDAY?7:e==Ye.SUNDAY?8:1+e:e=0&&(n-=7),n}var jl=y(()=>{Ht();pt();Qs()});var Wet,Yet,Get,Ket,ix,mge=y(()=>{da();Ot();xe();jl();Ht();Wet=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${oe(V_)}|weekend|weekday)(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),Yet=1,Get=2,Ket=3,ix=class extends q{innerPattern(){return Wet}innerExtract(e,t){let n=t[Yet],a=t[Ket],i=n||a;i=i||"",i=i.toLowerCase();let s=null;i=="last"||i=="past"?s="last":i=="next"?s="next":i=="this"&&(s="this");let o=t[Get].toLowerCase(),l;if(V_[o]!==void 0)l=V_[o];else if(o=="weekend")l=s=="last"?Ye.SUNDAY:Ye.SATURDAY;else if(o=="weekday"){let c=e.reference.getDateWithAdjustedTimezone().getDay();c==Ye.SUNDAY||c==Ye.SATURDAY?l=s=="last"?Ye.FRIDAY:Ye.MONDAY:(l=c-1,l=s=="last"?l-1:l+1,l=l%5+1)}else return null;return ta(e.reference,l,s)}}});var fge,Zet,Qet,Jet,sx,hge=y(()=>{da();pt();fge=st(tr(),1);xe();Ot();Zet=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${oe(BS)})(?=\\s*)(?=\\W|$)`,"i"),Qet=1,Jet=2,sx=class extends q{innerPattern(){return Zet}innerExtract(e,t){let n=t[Qet].toLowerCase(),a=t[Jet].toLowerCase(),i=BS[a];if(n=="next"||n.startsWith("after")){let l={};return l[i]=1,te.createRelativeFromReference(e.reference,l)}if(n=="last"||n=="past"){let l={};return l[i]=-1,te.createRelativeFromReference(e.reference,l)}let s=e.createParsingComponents(),o=(0,fge.default)(e.reference.instant);return a.match(/week/i)?(o=o.add(-o.get("d"),"d"),s.imply("day",o.date()),s.imply("month",o.month()+1),s.imply("year",o.year())):a.match(/month/i)?(o=o.add(-o.date()+1,"d"),s.imply("day",o.date()),s.assign("year",o.year()),s.assign("month",o.month()+1)):a.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),s.imply("day",o.date()),s.imply("month",o.month()+1),s.assign("year",o.year())),s}}});var Xet,ett,ttt,gge,yge,xU,ua,Nu=y(()=>{Rn();Xet=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),ett=1,ttt=5,gge=2,yge=3,xU=4,ua=class{constructor(e){I(this,"groupNumberMonth");I(this,"groupNumberDay");this.groupNumberMonth=e?yge:gge,this.groupNumberDay=e?gge:yge}pattern(){return Xet}extract(e,t){let n=t.index+t[ett].length,a=t.index+t[0].length-t[ttt].length;if(n>0&&e.text.substring(0,n).match("\\d/?$")||a12)&&o>12)if(l>=1&&l<=12&&o<=31)[l,o]=[o,l];else return null;if(l<1||l>31)return null;if(s.start.assign("day",l),s.start.assign("month",o),t[xU]){let c=parseInt(t[xU]),d=ls(c);s.start.assign("year",d)}else{let c=fr(e.refDate,l,o);s.start.imply("year",c)}return s.addTag("parser/SlashDateFormatParser")}}});var rtt,ntt,ox,vge=y(()=>{da();pt();xe();$S();rtt=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Mu})(?=\\W|$)`,"i"),ntt=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${lm})(?=\\W|$)`,"i"),ox=class extends q{constructor(t=!0){super();I(this,"allowAbbreviations");this.allowAbbreviations=t}innerPattern(){return this.allowAbbreviations?rtt:ntt}innerExtract(t,n){let a=n[1].toLowerCase(),i=Ro(n[2]);if(!i)return null;switch(a){case"last":case"past":case"-":i=Yv(i);break}return te.createRelativeFromReference(t.reference,i)}}});function att(r){return r.text.match(/^[+-]/i)!=null}function kge(r){return r.text.match(/^-/i)!=null}var lx,bge=y(()=>{_u();pt();da();Qs();lx=class extends cs{shouldMergeResults(e,t,n){return e.match(/^\s*$/i)?att(n)||kge(n):!1}mergeResults(e,t,n,a){let i=Ro(n.text);kge(n)&&(i=ea(i));let s=te.createRelativeFromReference(rr.fromDate(t.start.date()),i);return new Yt(t.reference,t.index,`${t.text}${e}${n.text}`,s)}}});function Tge(r){return r.text.match(/\s+(before|from)$/i)!=null}function itt(r){return r.text.match(/\s+(after|since)$/i)!=null}var cx,wge=y(()=>{_u();pt();da();$S();cx=class extends cs{patternBetween(){return/^\s*$/i}shouldMergeResults(e,t,n){return!e.match(this.patternBetween())||!Tge(t)&&!itt(t)?!1:!!n.start.get("day")&&!!n.start.get("month")&&!!n.start.get("year")}mergeResults(e,t,n){let a=Ro(t.text);Tge(t)&&(a=Yv(a));let i=te.createRelativeFromReference(rr.fromDate(n.start.date()),a);return new Yt(n.reference,t.index,`${t.text}${e}${n.text}`,i)}}});var stt,ott,dx,Sge=y(()=>{da();stt=new RegExp(`^\\s*(${sm})`,"i"),ott=1,dx=class{refine(e,t){return t.forEach(function(n){if(!n.start.isDateWithUnknownYear())return;let a=e.text.substring(n.index+n.text.length),i=stt.exec(a);if(!i||i[0].trim().length<=3)return;e.debug(()=>{console.log(`Extracting year: '${i[0]}' into : ${n}`)});let s=om(i[ott]);n.end!=null&&n.end.assign("year",s),n.start.assign("year",s),n.text+=i[0]}),t}}});var ux,xge=y(()=>{_u();ux=class extends Qv{constructor(){super()}isValid(e,t){let n=t.text.trim();return n===e.text.trim()?!0:n.toLowerCase()==="may"&&!e.text.substring(0,t.index).trim().match(/\b(in)$/i)?(e.debug(()=>{console.log(`Removing unlikely result: ${t}`)}),!1):n.toLowerCase().endsWith("the second")?(e.text.substring(t.index+t.text.length).trim().length>0&&e.debug(()=>{console.log(`Removing unlikely result: ${t}`)}),!1):!0}}});var jh,CU=y(()=>{Ahe();Rhe();Ohe();zhe();$he();Bhe();Hhe();Vhe();qhe();Whe();Qhe();Ks();dge();uge();mge();hge();Nu();vge();bge();wge();wU();Sge();xge();jh=class{createCasualConfiguration(e=!1){let t=this.createConfiguration(!1,e);return t.parsers.push(new nx),t.parsers.push(new ax),t.parsers.push(new qS),t.parsers.push(new sx),t.parsers.push(new ox),t.refiners.push(new ux),t}createConfiguration(e=!0,t=!1){let n=mn({parsers:[new ua(t),new US(e),new HS,new VS(t),new ix,new YS,new KS(e),new ZS(e),new QS(e)],refiners:[new Jv]},e);return n.parsers.unshift(new WS(e)),n.refiners.unshift(new cx),n.refiners.unshift(new lx),n.refiners.unshift(new cm),n.refiners.push(new Jv),n.refiners.push(new dx),n.refiners.push(new JS),n}}});var Be,px,ds=y(()=>{pt();CU();Be=class r{constructor(e){I(this,"parsers");I(this,"refiners");I(this,"defaultConfig",new jh);e=e||this.defaultConfig.createCasualConfiguration(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new r({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,t,n){let a=this.parse(e,t,n);return a.length>0?a[0].start.date():null}parse(e,t,n){let a=new px(e,t,n),i=[];return this.parsers.forEach(s=>{let o=r.executeParser(a,s);i=i.concat(o)}),i.sort((s,o)=>s.index-o.index),this.refiners.forEach(function(s){i=s.refine(a,i)}),i}static executeParser(e,t){let n=[],a=t.pattern(e),i=e.text,s=e.text,o=a.exec(s);for(;o;){let l=o.index+i.length-s.length;o.index=l;let c=t.extract(e,o);if(!c){s=i.substring(o.index+1),o=a.exec(s);continue}let d=null;c instanceof Yt?d=c:c instanceof te?(d=e.createParsingResult(o.index,o[0]),d.start=c):d=e.createParsingResult(o.index,o[0],c);let u=d.index,p=d.text;e.debug(()=>console.log(`${t.constructor.name} extracted (at index=${u}) '${p}'`)),n.push(d),s=i.substring(u+p.length),o=a.exec(s)}return n}},px=class{constructor(e,t,n){I(this,"text");I(this,"option");I(this,"reference");I(this,"refDate");this.text=e,this.option=n!=null?n:{},this.reference=rr.fromInput(t,this.option.timezones),this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof te?e:new te(this.reference,e)}createParsingResult(e,t,n,a){let i=typeof t=="string"?t:this.text.substring(e,t),s=n?this.createParsingComponents(n):null,o=a?this.createParsingComponents(a):null;return new Yt(this.reference,e,i,s,o)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}}});var DU={};at(DU,{Chrono:()=>Be,GB:()=>ltt,Meridiem:()=>H,ParsingComponents:()=>te,ParsingResult:()=>Yt,ReferenceWithTimezone:()=>rr,Weekday:()=>Ye,casual:()=>mx,configuration:()=>J_,parse:()=>ctt,parseDate:()=>dtt,strict:()=>EU});function ctt(r,e,t){return mx.parse(r,e,t)}function dtt(r,e,t){return mx.parseDate(r,e,t)}var J_,mx,EU,ltt,Cge=y(()=>{ds();pt();Ht();CU();J_=new jh,mx=new Be(J_.createCasualConfiguration(!1)),EU=new Be(J_.createConfiguration(!0,!1)),ltt=new Be(J_.createCasualConfiguration(!0))});var fx,Ege=y(()=>{Au();fx=class extends Da{primaryPrefix(){return"(?:(?:um|von)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|bis)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}}});function IU(r){let e=r.toLowerCase();return PU[e]!==void 0?PU[e]:e==="ein"||e==="einer"||e==="einem"||e==="einen"||e==="eine"?1:e.match(/wenigen/)?2:e.match(/halb/)||e.match(/halben/)?.5:e.match(/einigen/)?3:e.match(/mehreren/)?7:parseFloat(e)}function Mge(r){if(/v/i.test(r))return-parseInt(r.replace(/[^0-9]+/gi,""));if(/n/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));if(/z/i.test(r))return parseInt(r.replace(/[^0-9]+/gi,""));let e=parseInt(r);return ls(e)}function Ige(r){let e={},t=r,n=Dge.exec(t);for(;n;)utt(e,n),t=t.substring(n[0].length),n=Dge.exec(t);return e}function utt(r,e){let t=IU(e[1]),n=hx[e[2].toLowerCase()];r[n]=t}var MU,AU,PU,hx,_U,Pge,Age,Dge,_ge,rk=y(()=>{Ot();Rn();MU={sonntag:0,so:0,montag:1,mo:1,dienstag:2,di:2,mittwoch:3,mi:3,donnerstag:4,do:4,freitag:5,fr:5,samstag:6,sa:6},AU={januar:1,j\u00E4nner:1,janner:1,jan:1,"jan.":1,februar:2,feber:2,feb:2,"feb.":2,m\u00E4rz:3,maerz:3,m\u00E4r:3,"m\xE4r.":3,mrz:3,"mrz.":3,april:4,apr:4,"apr.":4,mai:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,august:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,dezember:12,dez:12,"dez.":12},PU={eins:1,eine:1,einem:1,einen:1,einer:1,zwei:2,drei:3,vier:4,f\u00FCnf:5,fuenf:5,sechs:6,sieben:7,acht:8,neun:9,zehn:10,elf:11,zw\u00F6lf:12,zwoelf:12},hx={sek:"second",sekunde:"second",sekunden:"second",min:"minute",minute:"minute",minuten:"minute",h:"hour",std:"hour",stunde:"hour",stunden:"hour",tag:"d",tage:"d",tagen:"d",woche:"week",wochen:"week",monat:"month",monate:"month",monaten:"month",monats:"month",quartal:"quarter",quartals:"quarter",quartale:"quarter",quartalen:"quarter",a:"year",j:"year",jr:"year",jahr:"year",jahre:"year",jahren:"year",jahres:"year"},_U=`(?:${oe(PU)}|[0-9]+|[0-9]+\\.[0-9]+|halb?|halbe?|einigen?|wenigen?|mehreren?)`;Pge="(?:[0-9]{1,4}(?:\\s*[vn]\\.?\\s*(?:C(?:hr)?|(?:u\\.?|d\\.?(?:\\s*g\\.?)?)?\\s*Z)\\.?|\\s*(?:u\\.?|d\\.?(?:\\s*g\\.)?)\\s*Z\\.?)?)";Age=`(${_U})\\s{0,5}(${oe(hx)})\\s{0,5}`,Dge=new RegExp(Age,"i"),_ge=zi("",Age)});var ptt,mtt,ftt,htt,gx,Nge=y(()=>{rk();Ot();xe();jl();ptt=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:a[mn]\\s*?)?(?:(diese[mn]|letzte[mn]|n(?:\xE4|ae)chste[mn])\\s*)?(${oe(MU)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(diese|letzte|n(?:\xE4|ae)chste)\\s*woche)?(?=\\W|$)`,"i"),mtt=1,ftt=3,htt=2,gx=class extends q{innerPattern(){return ptt}innerExtract(e,t){let n=t[htt].toLowerCase(),a=MU[n],i=t[mtt],s=t[ftt],o=i||s;o=o||"",o=o.toLowerCase();let l=null;return o.match(/letzte/)?l="last":o.match(/chste/)?l="next":o.match(/diese/)&&(l="this"),ta(e.reference,a,l)}}});var gtt,ytt,vtt,Rge,Fge,Oge,yx,Lge=y(()=>{Ht();gtt=new RegExp("(^|\\s|T)(?:(?:um|von)\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),ytt=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|bis(?:\\s+um)?|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s)?)?(?:\\s*Uhr)?(?:\\s*(morgens|vormittags|nachmittags|abends|nachts|am\\s+(?:Morgen|Vormittag|Nachmittag|Abend)|in\\s+der\\s+Nacht))?(?=\\W|$)","i"),vtt=2,Rge=3,Fge=4,Oge=5,yx=class r{pattern(e){return gtt}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=r.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let a=e.text.substring(t.index+t[0].length),i=ytt.exec(a);return i&&(n.end=r.extractTimeComponent(n.start.clone(),i),n.end&&(n.text+=i[0])),n}static extractTimeComponent(e,t){let n=0,a=0,i=null;if(n=parseInt(t[vtt]),t[Rge]!=null&&(a=parseInt(t[Rge])),a>=60||n>24)return null;if(n>=12&&(i=H.PM),t[Oge]!=null){if(n>12)return null;let s=t[Oge].toLowerCase();s.match(/morgen|vormittag/)&&(i=H.AM,n==12&&(n=0)),s.match(/nachmittag|abend/)&&(i=H.PM,n!=12&&(n+=12)),s.match(/nacht/)&&(n==12?(i=H.AM,n=0):n<6?i=H.AM:(i=H.PM,n+=12))}if(e.assign("hour",n),e.assign("minute",a),i!==null?e.assign("meridiem",i):n<12?e.imply("meridiem",H.AM):e.imply("meridiem",H.PM),t[Fge]!=null){let s=parseInt(t[Fge]);if(s>=60)return null;e.assign("second",s)}return e}}});var vx,zge=y(()=>{Fo();vx=class extends an{patternBetween(){return/^\s*(bis(?:\s*(?:am|zum))?|-)\s*$/i}}});var kx,jge=y(()=>{Oo();kx=class extends sn{patternBetween(){return new RegExp("^\\s*(T|um|am|,|-)?\\s*$")}}});var $ge,$h,NU=y(()=>{$ge=st(tr(),1);Ht();xe();Gs();Qs();$h=class r extends q{innerPattern(e){return/(diesen)?\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht)(?=\W|$)/i}innerExtract(e,t){let n=(0,$ge.default)(e.refDate),a=t[2].toLowerCase(),i=e.createParsingComponents();return Nc(i,n),r.extractTimeComponents(i,a)}static extractTimeComponents(e,t){switch(t){case"morgen":e.imply("hour",6),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",H.AM);break;case"vormittag":e.imply("hour",9),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",H.AM);break;case"mittag":case"mittags":e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",H.AM);break;case"nachmittag":e.imply("hour",15),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",H.PM);break;case"abend":e.imply("hour",18),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",H.PM);break;case"nacht":e.imply("hour",22),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",H.PM);break;case"mitternacht":e.get("hour")>1&&(e=Z_(e,{day:1})),e.imply("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("meridiem",H.AM);break}return e}}});var Bge,ktt,btt,Ttt,bx,Uge=y(()=>{Bge=st(tr(),1);xe();Gs();NU();Zs();ktt=new RegExp("(jetzt|heute|morgen|\xFCbermorgen|uebermorgen|gestern|vorgestern|letzte\\s*nacht)(?:\\s*(morgen|vormittag|mittags?|nachmittag|abend|nacht|mitternacht))?(?=\\W|$)","i"),btt=1,Ttt=2,bx=class extends q{innerPattern(e){return ktt}innerExtract(e,t){let n=(0,Bge.default)(e.refDate),a=(t[btt]||"").toLowerCase(),i=(t[Ttt]||"").toLowerCase(),s=e.createParsingComponents();switch(a){case"jetzt":s=di(e.reference);break;case"heute":s=Pa(e.reference);break;case"morgen":Ll(s,n);break;case"\xFCbermorgen":case"uebermorgen":n=n.add(1,"day"),Ll(s,n);break;case"gestern":n=n.add(-1,"day"),Kr(s,n),Nc(s,n);break;case"vorgestern":n=n.add(-2,"day"),Kr(s,n),Nc(s,n);break;default:a.match(/letzte\s*nacht/)&&(n.hour()>6&&(n=n.add(-1,"day")),Kr(s,n),s.imply("hour",0));break}return i&&(s=$h.extractTimeComponents(s,i)),s}}});var wtt,Hge,Vge,Stt,qge,Tx,Wge=y(()=>{Rn();rk();rk();Ot();xe();wtt=new RegExp(`(?:am\\s*?)?(?:den\\s*?)?([0-9]{1,2})\\.(?:\\s*(?:bis(?:\\s*(?:am|zum))?|\\-|\\\u2013|\\s)\\s*([0-9]{1,2})\\.?)?\\s*(${oe(AU)})(?:(?:-|/|,?\\s*)(${Pge}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Hge=1,Vge=2,Stt=3,qge=4,Tx=class extends q{innerPattern(){return wtt}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),a=AU[t[Stt].toLowerCase()],i=parseInt(t[Hge]);if(i>31)return t.index=t.index+t[Hge].length,null;if(n.start.assign("month",a),n.start.assign("day",i),t[qge]){let s=Mge(t[qge]);n.start.assign("year",s)}else{let s=fr(e.refDate,i,a);n.start.imply("year",s)}if(t[Vge]){let s=parseInt(t[Vge]);n.end=n.start.clone(),n.end.assign("day",s)}return n}}});var wx,Yge=y(()=>{rk();pt();xe();Qs();Ot();wx=class extends q{constructor(){super()}innerPattern(){return new RegExp(`(?:\\s*((?:n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?|vor|in)\\s*)?(${_U})?(?:\\s*(n\xE4chste|kommende|folgende|letzte|vergangene|vorige|vor(?:her|an)gegangene)(?:s|n|m|r)?)?\\s*(${oe(hx)})`,"i")}innerExtract(e,t){let n=t[2]?IU(t[2]):1,a=hx[t[4].toLowerCase()],i={};i[a]=n;let s=t[1]||t[3]||"";if(s=s.toLowerCase(),!!s)return(/vor/.test(s)||/letzte/.test(s)||/vergangen/.test(s))&&(i=ea(i)),te.createRelativeFromReference(e.reference,i)}}});var Sx,Gge=y(()=>{rk();pt();xe();Sx=class extends q{innerPattern(){return new RegExp(`(?:in|f\xFCr|w\xE4hrend)\\s*(${_ge})(?=\\W|$)`,"i")}innerExtract(e,t){let n=Ige(t[1]);return te.createRelativeFromReference(e.reference,n)}}});var OU={};at(OU,{Chrono:()=>Be,Meridiem:()=>H,ParsingComponents:()=>te,ParsingResult:()=>Yt,ReferenceWithTimezone:()=>rr,Weekday:()=>Ye,casual:()=>RU,createCasualConfiguration:()=>Kge,createConfiguration:()=>FU,parse:()=>Ctt,parseDate:()=>Ett,strict:()=>xtt});function Ctt(r,e,t){return RU.parse(r,e,t)}function Ett(r,e,t){return RU.parseDate(r,e,t)}function Kge(r=!0){let e=FU(!1,r);return e.parsers.unshift(new $h),e.parsers.unshift(new bx),e.parsers.unshift(new wx),e}function FU(r=!0,e=!0){return mn({parsers:[new Iu,new ua(e),new fx,new yx,new Tx,new gx,new Sx],refiners:[new vx,new kx]},r)}var RU,xtt,Zge=y(()=>{Ks();ds();pt();Ht();Nu();Y_();Ege();Nge();Lge();zge();jge();Uge();NU();Wge();Yge();Gge();RU=new Be(Kge()),xtt=new Be(FU(!0))});var Qge,xx,Jge=y(()=>{Qge=st(tr(),1);Ht();xe();Gs();Zs();xx=class extends q{innerPattern(e){return/(maintenant|aujourd'hui|demain|hier|cette\s*nuit|la\s*veille)(?=\W|$)/i}innerExtract(e,t){let n=(0,Qge.default)(e.refDate),a=t[0].toLowerCase(),i=e.createParsingComponents();switch(a){case"maintenant":return di(e.reference);case"aujourd'hui":return Pa(e.reference);case"hier":return ui(e.reference);case"demain":return pi(e.reference);default:a.match(/cette\s*nuit/)?(Kr(i,n),i.imply("hour",22),i.imply("meridiem",H.PM)):a.match(/la\s*veille/)&&(n=n.add(-1,"day"),Kr(i,n),i.imply("hour",0))}return i}}});var Cx,Xge=y(()=>{Ht();xe();Cx=class extends q{innerPattern(e){return/(cet?)?\s*(matin|soir|après-midi|aprem|a midi|à minuit)(?=\W|$)/i}innerExtract(e,t){let n=t[2].toLowerCase(),a=e.createParsingComponents();switch(n){case"apr\xE8s-midi":case"aprem":a.imply("hour",14),a.imply("minute",0),a.imply("meridiem",H.PM);break;case"soir":a.imply("hour",18),a.imply("minute",0),a.imply("meridiem",H.PM);break;case"matin":a.imply("hour",8),a.imply("minute",0),a.imply("meridiem",H.AM);break;case"a midi":a.imply("hour",12),a.imply("minute",0),a.imply("meridiem",H.AM);break;case"\xE0 minuit":a.imply("hour",0),a.imply("meridiem",H.AM);break}return a}}});var Ex,eye=y(()=>{Au();Ex=class extends Da{primaryPrefix(){return"(?:(?:[\xE0a])\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}}});var Dx,tye=y(()=>{Oo();Dx=class extends sn{patternBetween(){return new RegExp("^\\s*(T|\xE0|a|au|vers|de|,|-)?\\s*$")}}});var Px,rye=y(()=>{Fo();Px=class extends an{patternBetween(){return/^\s*(à|a|au|-)\s*$/i}}});function BU(r){let e=r.toLowerCase();return LU[e]!==void 0?LU[e]:e==="une"||e==="un"?1:e.match(/quelques?/)?3:e.match(/demi-?/)?.5:parseFloat(e)}function HU(r){let e=r.toLowerCase();return e=e.replace(/(?:er)$/i,""),parseInt(e)}function iye(r){if(/AC/i.test(r))return r=r.replace(/BC/i,""),-parseInt(r);if(/AD/i.test(r)||/C/i.test(r))return r=r.replace(/[^\d]+/i,""),parseInt(r);let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}function eI(r){let e={},t=r,n=nye.exec(t);for(;n;)Dtt(e,n),t=t.substring(n[0].length),n=nye.exec(t);return e}function Dtt(r,e){let t=BU(e[1]),n=Mx[e[2].toLowerCase()];r[n]=t}var zU,jU,LU,Mx,$U,UU,aye,sye,nye,X_,um=y(()=>{Ot();zU={dimanche:0,dim:0,lundi:1,lun:1,mardi:2,mar:2,mercredi:3,mer:3,jeudi:4,jeu:4,vendredi:5,ven:5,samedi:6,sam:6},jU={janvier:1,jan:1,"jan.":1,f\u00E9vrier:2,f\u00E9v:2,"f\xE9v.":2,fevrier:2,fev:2,"fev.":2,mars:3,mar:3,"mar.":3,avril:4,avr:4,"avr.":4,mai:5,juin:6,jun:6,juillet:7,juil:7,jul:7,"jul.":7,ao\u00FBt:8,aout:8,septembre:9,sep:9,"sep.":9,sept:9,"sept.":9,octobre:10,oct:10,"oct.":10,novembre:11,nov:11,"nov.":11,d\u00E9cembre:12,decembre:12,dec:12,"dec.":12},LU={un:1,deux:2,trois:3,quatre:4,cinq:5,six:6,sept:7,huit:8,neuf:9,dix:10,onze:11,douze:12,treize:13},Mx={sec:"second",seconde:"second",secondes:"second",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",heure:"hour",heures:"hour",jour:"d",jours:"d",semaine:"week",semaines:"week",mois:"month",trimestre:"quarter",trimestres:"quarter",ans:"year",ann\u00E9e:"year",ann\u00E9es:"year"},$U=`(?:${oe(LU)}|[0-9]+|[0-9]+\\.[0-9]+|une?\\b|quelques?|demi-?)`;UU="(?:[0-9]{1,2}(?:er)?)";aye="(?:[1-9][0-9]{0,3}\\s*(?:AC|AD|p\\.\\s*C(?:hr?)?\\.\\s*n\\.)|[1-2][0-9]{3}|[5-9][0-9])";sye=`(${$U})\\s{0,5}(${oe(Mx)})\\s{0,5}`,nye=new RegExp(sye,"i"),X_=zi("",sye)});var Ptt,Mtt,Att,Ax,oye=y(()=>{um();Ot();xe();jl();Ptt=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(?:ce)\\s*)?(${oe(zU)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(dernier|prochain)\\s*)?(?=\\W|\\d|$)`,"i"),Mtt=1,Att=2,Ax=class extends q{innerPattern(){return Ptt}innerExtract(e,t){let n=t[Mtt].toLowerCase(),a=zU[n];if(a===void 0)return null;let i=t[Att];i=i||"",i=i.toLowerCase();let s=null;return i=="dernier"?s="last":i=="prochain"&&(s="next"),ta(e.reference,a,s)}}});var _tt,Itt,Ntt,lye,cye,dye,_x,uye=y(()=>{Ht();_tt=new RegExp("(^|\\s|T)(?:(?:[\xE0a])\\s*)?(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),Itt=new RegExp("^\\s*(\\-|\\\u2013|\\~|\\\u301C|[\xE0a]|\\?)\\s*(\\d{1,2})(?:h|:)?(?:(\\d{1,2})(?:m|:)?)?(?:(\\d{1,2})(?:s|:)?)?(?:\\s*(A\\.M\\.|P\\.M\\.|AM?|PM?))?(?=\\W|$)","i"),Ntt=2,lye=3,cye=4,dye=5,_x=class r{pattern(e){return _tt}extract(e,t){let n=e.createParsingResult(t.index+t[1].length,t[0].substring(t[1].length));if(n.text.match(/^\d{4}$/)||(n.start=r.extractTimeComponent(n.start.clone(),t),!n.start))return t.index+=t[0].length,null;let a=e.text.substring(t.index+t[0].length),i=Itt.exec(a);return i&&(n.end=r.extractTimeComponent(n.start.clone(),i),n.end&&(n.text+=i[0])),n}static extractTimeComponent(e,t){let n=0,a=0,i=null;if(n=parseInt(t[Ntt]),t[lye]!=null&&(a=parseInt(t[lye])),a>=60||n>24)return null;if(n>=12&&(i=H.PM),t[dye]!=null){if(n>12)return null;let s=t[dye][0].toLowerCase();s=="a"&&(i=H.AM,n==12&&(n=0)),s=="p"&&(i=H.PM,n!=12&&(n+=12))}if(e.assign("hour",n),e.assign("minute",a),i!==null?e.assign("meridiem",i):n<12?e.imply("meridiem",H.AM):e.imply("meridiem",H.PM),t[cye]!=null){let s=parseInt(t[cye]);if(s>=60)return null;e.assign("second",s)}return e}}});var Rtt,pye,mye,Ftt,fye,Ix,hye=y(()=>{Rn();um();um();um();Ot();xe();Rtt=new RegExp(`(?:on\\s*?)?(${UU})(?:\\s*(?:au|\\-|\\\u2013|jusqu'au?|\\s)\\s*(${UU}))?(?:-|/|\\s*(?:de)?\\s*)(${oe(jU)})(?:(?:-|/|,?\\s*)(${aye}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),pye=1,mye=2,Ftt=3,fye=4,Ix=class extends q{innerPattern(){return Rtt}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),a=jU[t[Ftt].toLowerCase()],i=HU(t[pye]);if(i>31)return t.index=t.index+t[pye].length,null;if(n.start.assign("month",a),n.start.assign("day",i),t[fye]){let s=iye(t[fye]);n.start.assign("year",s)}else{let s=fr(e.refDate,i,a);n.start.imply("year",s)}if(t[mye]){let s=HU(t[mye]);n.end=n.start.clone(),n.end.assign("day",s)}return n}}});var Nx,gye=y(()=>{um();pt();xe();Qs();Nx=class extends q{constructor(){super()}innerPattern(){return new RegExp(`il y a\\s*(${X_})(?=(?:\\W|$))`,"i")}innerExtract(e,t){let n=eI(t[1]),a=ea(n);return te.createRelativeFromReference(e.reference,a)}}});var Rx,yye=y(()=>{um();pt();xe();Rx=class extends q{innerPattern(){return new RegExp(`(?:dans|en|pour|pendant|de)\\s*(${X_})(?=\\W|$)`,"i")}innerExtract(e,t){let n=eI(t[1]);return te.createRelativeFromReference(e.reference,n)}}});var Fx,vye=y(()=>{um();pt();xe();Qs();Ot();Fx=class extends q{constructor(){super()}innerPattern(){return new RegExp(`(?:les?|la|l'|du|des?)\\s*(${$U})?(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?\\s*(${oe(Mx)})(?:\\s*(prochaine?s?|derni[e\xE8]re?s?|pass[\xE9e]e?s?|pr[\xE9e]c[\xE9e]dents?|suivante?s?))?`,"i")}innerExtract(e,t){let n=t[1]?BU(t[1]):1,a=Mx[t[3].toLowerCase()],i={};i[a]=n;let s=t[2]||t[4]||"";if(s=s.toLowerCase(),!!s)return(/derni[eè]re?s?/.test(s)||/pass[ée]e?s?/.test(s)||/pr[ée]c[ée]dents?/.test(s))&&(i=ea(i)),te.createRelativeFromReference(e.reference,i)}}});var WU={};at(WU,{Chrono:()=>Be,Meridiem:()=>H,ParsingComponents:()=>te,ParsingResult:()=>Yt,ReferenceWithTimezone:()=>rr,Weekday:()=>Ye,casual:()=>VU,createCasualConfiguration:()=>kye,createConfiguration:()=>qU,parse:()=>Ltt,parseDate:()=>ztt,strict:()=>Ott});function Ltt(r,e,t){return VU.parse(r,e,t)}function ztt(r,e,t){return VU.parseDate(r,e,t)}function kye(r=!0){let e=qU(!1,r);return e.parsers.unshift(new xx),e.parsers.unshift(new Cx),e.parsers.unshift(new Fx),e}function qU(r=!0,e=!0){return mn({parsers:[new ua(e),new Ix,new Ex,new _x,new Nx,new Rx,new Ax],refiners:[new Dx,new Px]},r)}var VU,Ott,bye=y(()=>{Ks();ds();pt();Ht();Jge();Xge();Nu();eye();tye();rye();oye();uye();hye();gye();yye();vye();VU=new Be(kye()),Ott=new Be(qU(!0))});function ji(r){return String(r).replace(/\u2019/g,"'").replace(/\u201D/g,'"').replace(/\u3000/g," ").replace(/\uFFE5/g,"\xA5").replace(/[\uFF01\uFF03-\uFF06\uFF08\uFF09\uFF0C-\uFF19\uFF1C-\uFF1F\uFF21-\uFF3B\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5E]/g,jtt)}function jtt(r){return String.fromCharCode(r.charCodeAt(0)-65248)}function Bh(r){let e=0;for(let t=0;t{Fc={\u96F6:0,"\u3007":0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10},nk={\u65E5:0,\u6708:1,\u706B:2,\u6C34:3,\u6728:4,\u91D1:5,\u571F:6}});var wye,$tt,Tye,Btt,YU,Utt,Htt,Vtt,Ox,Sye=y(()=>{ak();Rn();wye=st(tr(),1),$tt=/(?:(?:([同今本])|((昭和|平成|令和)?([0-90-9]{1,4}|元)))年\s*)?([0-90-9]{1,2})月\s*([0-90-9]{1,2})日/i,Tye=1,Btt=2,YU=3,Utt=4,Htt=5,Vtt=6,Ox=class{pattern(){return $tt}extract(e,t){let n=parseInt(ji(t[Htt])),a=parseInt(ji(t[Vtt])),i=e.createParsingComponents({day:a,month:n});if(t[Tye]&&t[Tye].match("\u540C|\u4ECA|\u672C")){let s=(0,wye.default)(e.refDate);i.assign("year",s.year())}if(t[Btt]){let s=t[Utt],o=s=="\u5143"?1:parseInt(ji(s));t[YU]=="\u4EE4\u548C"?o+=2018:t[YU]=="\u5E73\u6210"?o+=1988:t[YU]=="\u662D\u548C"&&(o+=1925),i.assign("year",o)}else{let s=fr(e.refDate,a,n);i.imply("year",s)}return i}}});var Lx,xye=y(()=>{Fo();Lx=class extends an{patternBetween(){return/^\s*(から|-|ー|-|~|~)\s*$/i}}});function Wtt(r){switch(r){case"\u304D\u3087\u3046":return"\u4ECA\u65E5";case"\u307B\u3093\u3058\u3064":return"\u672C\u65E5";case"\u304D\u306E\u3046":return"\u6628\u65E5";case"\u3042\u3057\u305F":return"\u660E\u65E5";case"\u3053\u3093\u3084":return"\u4ECA\u591C";case"\u3053\u3093\u3086\u3046":return"\u4ECA\u5915";case"\u3053\u3093\u3070\u3093":return"\u4ECA\u6669";case"\u3051\u3055":return"\u4ECA\u671D";default:return r}}var Cye,qtt,zx,Eye=y(()=>{Cye=st(tr(),1);Ht();Zs();qtt=/今日|きょう|本日|ほんじつ|昨日|きのう|明日|あした|今夜|こんや|今夕|こんゆう|今晩|こんばん|今朝|けさ/i;zx=class{pattern(){return qtt}extract(e,t){let n=Wtt(t[0]),a=(0,Cye.default)(e.refDate),i=e.createParsingComponents();switch(n){case"\u6628\u65E5":return ui(e.reference);case"\u660E\u65E5":return pi(e.reference);case"\u672C\u65E5":case"\u4ECA\u65E5":return Pa(e.reference)}return n=="\u4ECA\u591C"||n=="\u4ECA\u5915"||n=="\u4ECA\u6669"?(i.imply("hour",22),i.assign("meridiem",H.PM)):n.match("\u4ECA\u671D")&&(i.imply("hour",6),i.assign("meridiem",H.AM)),i.assign("day",a.date()),i.assign("month",a.month()+1),i.assign("year",a.year()),i}}});var Ytt,jx,Dye=y(()=>{ak();jl();Ytt=new RegExp("((?\u524D\u306E|\u6B21\u306E|\u4ECA\u9031))?(?"+Object.keys(nk).join("|")+")(?:\u66DC\u65E5|\u66DC)","i"),jx=class{pattern(){return Ytt}extract(e,t){let n=t.groups.weekday,a=nk[n];if(a===void 0)return null;let i=t.groups.prefix||"",s=null;return i.match(/前の/)?s="last":i.match(/次の/)?s="next":i.match(/今週/)&&(s="this"),ta(e.reference,a,s)}}});var Gtt,Pye,Ktt,Ztt,$x,Mye=y(()=>{Rn();ak();Gtt=new RegExp("([0-9\uFF10-\uFF19]{4}[\\/|\\\uFF0F])?([0-1\uFF10-\uFF11]{0,1}[0-9\uFF10-\uFF19]{1})(?:[\\/|\\\uFF0F]([0-3\uFF10-\uFF13]{0,1}[0-9\uFF10-\uFF19]{1}))","i"),Pye=1,Ktt=2,Ztt=3,$x=class{pattern(){return Gtt}extract(e,t){let n=e.createParsingComponents(),a=parseInt(ji(t[Ktt])),i=parseInt(ji(t[Ztt]));if(a<1||a>12||i<1||i>31)return null;if(n.assign("day",i),n.assign("month",a),t[Pye]){let s=parseInt(ji(t[Pye])),o=ls(s);n.assign("year",o)}else{let s=fr(e.reference.instant,i,a);n.imply("year",s)}return n}}});var Qtt,Jtt,tI,rI,pm,ik,nI,Bx,Aye=y(()=>{xe();Ht();ak();Qtt=new RegExp("(?:(\u5348\u524D|\u5348\u5F8C|A.M.|P.M.|AM|PM))?(?:[\\s,\uFF0C\u3001]*)(?:([0-9\uFF10-\uFF19]+|["+Object.keys(Fc).join("")+"]+)(?:\\s*)(?:\u6642|:|\uFF1A)(?:\\s*)([0-9\uFF10-\uFF19]+|\u534A|["+Object.keys(Fc).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)([0-9\uFF10-\uFF19]+|["+Object.keys(Fc).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Jtt=new RegExp("(?:^\\s*(?:\u304B\u3089|\\-|\\\u2013|\\\uFF0D|\\~|\\\u301C)\\s*)(?:(\u5348\u524D|\u5348\u5F8C|A.M.|P.M.|AM|PM))?(?:[\\s,\uFF0C\u3001]*)(?:([0-9\uFF10-\uFF19]+|["+Object.keys(Fc).join("")+"]+)(?:\\s*)(?:\u6642|:|\uFF1A)(?:\\s*)([0-9\uFF10-\uFF19]+|\u534A|["+Object.keys(Fc).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)([0-9\uFF10-\uFF19]+|["+Object.keys(Fc).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),tI=1,rI=2,pm=3,ik=4,nI=5,Bx=class extends q{innerPattern(){return Qtt}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=e.createParsingResult(t.index,t[0]),a=0,i=0,s=-1;if(t[ik]){let o=parseInt(ji(t[ik]));if(isNaN(o)&&(o=Bh(t[ik])),o>=60)return null;n.start.assign("second",o)}if(a=parseInt(ji(t[rI])),isNaN(a)&&(a=Bh(t[rI])),t[pm]?t[pm]==="\u534A"?i=30:(i=parseInt(ji(t[pm])),isNaN(i)&&(i=Bh(t[pm]))):a>100&&(i=a%100,a=Math.floor(a/100)),i>=60||a>24)return null;if(a>=12&&(s=H.PM),t[tI]){if(a>12)return null;let o=t[tI],l=o[0].toLowerCase();o==="\u5348\u524D"||l==="a"?(s=H.AM,a===12&&(a=0)):(o==="\u5348\u5F8C"||l==="p")&&(s=H.PM,a!=12&&(a+=12))}else if(t[nI]){if(a>12)return null;let o=t[nI][0].toLowerCase();o==="a"&&(s=H.AM,a===12&&(a=0)),o==="p"&&(s=H.PM,a!=12&&(a+=12))}if(n.start.assign("hour",a),n.start.assign("minute",i),s>=0?n.start.assign("meridiem",s):a<12?n.start.imply("meridiem",0):n.start.imply("meridiem",1),t=Jtt.exec(e.text.substring(n.index+n.text.length)),!t)return n.text.match(/^\d+$/)?null:n;if(n.end=e.createParsingComponents(),a=0,i=0,s=-1,t[ik]){let o=parseInt(ji(t[ik]));if(isNaN(o)&&(o=Bh(t[ik])),o>=60)return null;n.end.assign("second",o)}if(a=parseInt(ji(t[rI])),isNaN(a)&&(a=Bh(t[rI])),t[pm]?t[pm]==="\u534A"?i=30:(i=parseInt(ji(t[pm])),isNaN(i)&&(i=Bh(t[pm]))):a>100&&(i=a%100,a=Math.floor(a/100)),i>=60||a>24)return null;if(a>=12&&(s=H.PM),t[tI]){if(a>12)return null;let o=t[tI],l=o[0].toLowerCase();o==="\u5348\u524D"||l==="a"?(s=H.AM,a===12&&(a=0)):(o==="\u5348\u5F8C"||l==="p")&&(s=H.PM,a!=12&&(a+=12)),n.start.isCertain("meridiem")||(s===H.AM?(n.start.imply("meridiem",H.AM),n.start.get("hour")===12&&n.start.assign("hour",0)):(n.start.imply("meridiem",1),n.start.get("hour")!=12&&n.start.assign("hour",n.start.get("hour")+12)))}else if(t[nI]){if(a>12)return null;let o=t[nI][0].toLowerCase();o==="a"&&(s=H.AM,a===12&&(a=0)),o==="p"&&(s=H.PM,a!=12&&(a+=12))}return n.text=n.text+t[0],n.end.assign("hour",a),n.end.assign("minute",i),s>=0?n.end.assign("meridiem",s):n.start.isCertain("meridiem")&&n.start.get("hour")>12?n.start.get("hour")-12>a?n.end.imply("meridiem",H.AM):a<=12&&(n.end.assign("hour",a+12),n.end.assign("meridiem",H.PM)):a>12?n.end.imply("meridiem",H.PM):a<=12&&n.end.imply("meridiem",H.AM),n.end.date().getTime(){Oo();Ux=class extends sn{patternBetween(){return/^\s*(の)?\s*$/i}}});var Hx,Iye=y(()=>{_u();Hx=class extends cs{mergeResults(e,t,n){let a=t.clone();return a.text=t.text+e+n.text,a.start.assign("weekday",n.start.get("weekday")),a.end&&a.end.assign("weekday",n.start.get("weekday")),a}shouldMergeResults(e,t,n){return t.start.isCertain("day")&&n.start.isOnlyWeekdayComponent()&&!n.start.isCertain("hour")&&e.match(/^[,、の]?\s*$/)!==null}}});var Xtt,Vx,Nye=y(()=>{ak();jl();Xtt=new RegExp("(?:\\(|\\\uFF08)(?"+Object.keys(nk).join("|")+")(?:\\)|\\\uFF09)","i"),Vx=class{pattern(){return Xtt}extract(e,t){let n=t.groups.weekday,a=nk[n];return a===void 0?null:ta(e.reference,a)}}});var ZU={};at(ZU,{Chrono:()=>Be,Meridiem:()=>H,ParsingComponents:()=>te,ParsingResult:()=>Yt,ReferenceWithTimezone:()=>rr,Weekday:()=>Ye,casual:()=>GU,createCasualConfiguration:()=>Rye,createConfiguration:()=>KU,parse:()=>trt,parseDate:()=>rrt,strict:()=>ert});function trt(r,e,t){return GU.parse(r,e,t)}function rrt(r,e,t){return GU.parseDate(r,e,t)}function Rye(){let r=KU(!1);return r.parsers.unshift(new zx),r}function KU(r=!0){let e=mn({parsers:[new Ox,new jx,new Vx,new $x,new Bx],refiners:[new Hx,new Ux,new Lx]},r);return e.refiners=e.refiners.filter(t=>!(t instanceof Oh)),e}var GU,ert,Fye=y(()=>{Sye();xye();Eye();Dye();Mye();Aye();_ye();ds();pt();Ht();Iye();Nye();Ks();SU();GU=new Be(Rye()),ert=new Be(KU(!0))});function Lye(r){if(r.match(/^[0-9]{1,4}$/)){let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}return r.match(/a\.?\s*c\.?/i)?(r=r.replace(/a\.?\s*c\.?/i,""),-parseInt(r)):parseInt(r)}var QU,JU,Oye,aI=y(()=>{QU={domingo:0,dom:0,segunda:1,"segunda-feira":1,seg:1,ter\u00E7a:2,"ter\xE7a-feira":2,ter:2,quarta:3,"quarta-feira":3,qua:3,quinta:4,"quinta-feira":4,qui:4,sexta:5,"sexta-feira":5,sex:5,s\u00E1bado:6,sabado:6,sab:6},JU={janeiro:1,jan:1,"jan.":1,fevereiro:2,fev:2,"fev.":2,mar\u00E7o:3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,maio:5,mai:5,"mai.":5,junho:6,jun:6,"jun.":6,julho:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,setembro:9,set:9,"set.":9,outubro:10,out:10,"out.":10,novembro:11,nov:11,"nov.":11,dezembro:12,dez:12,"dez.":12},Oye="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?"});var nrt,art,irt,srt,qx,zye=y(()=>{aI();Ot();xe();jl();nrt=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|passado|pr[o\xF3]ximo)\\s*)?(${oe(QU)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|passado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),art=1,irt=2,srt=3,qx=class extends q{innerPattern(){return nrt}innerExtract(e,t){let n=t[irt].toLowerCase(),a=QU[n];if(a===void 0)return null;let i=t[art],s=t[srt],o=i||s||"";o=o.toLowerCase();let l=null;return o=="passado"?l="this":o=="pr\xF3ximo"||o=="proximo"?l="next":o=="este"&&(l="this"),ta(e.reference,a,l)}}});var Wx,jye=y(()=>{Au();Wx=class extends Da{primaryPrefix(){return"(?:(?:ao?|\xE0s?|das|da|de|do)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:o)?|\\?)\\s*"}}});var Yx,$ye=y(()=>{Oo();Yx=class extends sn{patternBetween(){return new RegExp("^\\s*(?:,|\xE0)?\\s*$")}}});var Gx,Bye=y(()=>{Fo();Gx=class extends an{patternBetween(){return/^\s*(?:-)\s*$/i}}});var ort,Uye,Hye,lrt,Vye,Kx,qye=y(()=>{Rn();aI();aI();Ot();xe();ort=new RegExp(`([0-9]{1,2})(?:\xBA|\xAA|\xB0)?(?:\\s*(?:desde|de|\\-|\\\u2013|ao?|\\s)\\s*([0-9]{1,2})(?:\xBA|\xAA|\xB0)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${oe(JU)})(?:\\s*(?:de|,)?\\s*(${Oye}))?(?=\\W|$)`,"i"),Uye=1,Hye=2,lrt=3,Vye=4,Kx=class extends q{innerPattern(){return ort}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),a=JU[t[lrt].toLowerCase()],i=parseInt(t[Uye]);if(i>31)return t.index=t.index+t[Uye].length,null;if(n.start.assign("month",a),n.start.assign("day",i),t[Vye]){let s=Lye(t[Vye]);n.start.assign("year",s)}else{let s=fr(e.refDate,i,a);n.start.imply("year",s)}if(t[Hye]){let s=parseInt(t[Hye]);n.end=n.start.clone(),n.end.assign("day",s)}return n}}});var Zx,Wye=y(()=>{xe();Zs();Zx=class extends q{innerPattern(e){return/(agora|hoje|amanha|amanhã|ontem)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),a=e.createParsingComponents();switch(n){case"agora":return di(e.reference);case"hoje":return Pa(e.reference);case"amanha":case"amanh\xE3":return pi(e.reference);case"ontem":return ui(e.reference)}return a}}});var Yye,Qx,Gye=y(()=>{Ht();xe();Gs();Yye=st(tr(),1),Qx=class extends q{innerPattern(){return/(?:esta\s*)?(manha|manhã|tarde|meia-noite|meio-dia|noite)(?=\W|$)/i}innerExtract(e,t){let n=(0,Yye.default)(e.refDate),a=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":a.imply("meridiem",H.PM),a.imply("hour",15);break;case"noite":a.imply("meridiem",H.PM),a.imply("hour",22);break;case"manha":case"manh\xE3":a.imply("meridiem",H.AM),a.imply("hour",6);break;case"meia-noite":Ll(a,n),a.imply("hour",0),a.imply("minute",0),a.imply("second",0);break;case"meio-dia":a.imply("meridiem",H.AM),a.imply("hour",12);break}return a}}});var tH={};at(tH,{Chrono:()=>Be,Meridiem:()=>H,ParsingComponents:()=>te,ParsingResult:()=>Yt,ReferenceWithTimezone:()=>rr,Weekday:()=>Ye,casual:()=>XU,createCasualConfiguration:()=>Kye,createConfiguration:()=>eH,parse:()=>drt,parseDate:()=>urt,strict:()=>crt});function drt(r,e,t){return XU.parse(r,e,t)}function urt(r,e,t){return XU.parseDate(r,e,t)}function Kye(r=!0){let e=eH(!1,r);return e.parsers.push(new Zx),e.parsers.push(new Qx),e}function eH(r=!0,e=!0){return mn({parsers:[new ua(e),new qx,new Wx,new Kx],refiners:[new Yx,new Gx]},r)}var XU,crt,Zye=y(()=>{Ks();ds();pt();Ht();Nu();zye();jye();$ye();Bye();qye();Wye();Gye();XU=new Be(Kye()),crt=new Be(eH(!0))});var Jx,Qye=y(()=>{Fo();Jx=class extends an{patternBetween(){return/^\s*(tot|-)\s*$/i}}});var Xx,Jye=y(()=>{Oo();Xx=class extends sn{patternBetween(){return new RegExp("^\\s*(om|na|voor|in de|,|-)?\\s*$")}}});var eC,Xye=y(()=>{xe();Zs();eC=class extends q{innerPattern(e){return/(nu|vandaag|morgen|morgend|gisteren)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),a=e.createParsingComponents();switch(n){case"nu":return di(e.reference);case"vandaag":return Pa(e.reference);case"morgen":case"morgend":return pi(e.reference);case"gisteren":return ui(e.reference)}return a}}});var eve,prt,mrt,tC,tve=y(()=>{Ht();xe();eve=st(tr(),1);Gs();prt=1,mrt=2,tC=class extends q{innerPattern(){return/(deze)?\s*(namiddag|avond|middernacht|ochtend|middag|'s middags|'s avonds|'s ochtends)(?=\W|$)/i}innerExtract(e,t){let n=(0,eve.default)(e.refDate),a=e.createParsingComponents();switch(t[prt]==="deze"&&(a.assign("day",e.refDate.getDate()),a.assign("month",e.refDate.getMonth()+1),a.assign("year",e.refDate.getFullYear())),t[mrt].toLowerCase()){case"namiddag":case"'s namiddags":a.imply("meridiem",H.PM),a.imply("hour",15);break;case"avond":case"'s avonds'":a.imply("meridiem",H.PM),a.imply("hour",20);break;case"middernacht":Ll(a,n),a.imply("hour",0),a.imply("minute",0),a.imply("second",0);break;case"ochtend":case"'s ochtends":a.imply("meridiem",H.AM),a.imply("hour",6);break;case"middag":case"'s middags":a.imply("meridiem",H.AM),a.imply("hour",12);break}return a}}});function hrt(r){let e=r.toLowerCase();return rH[e]!==void 0?rH[e]:e==="paar"?2:e==="half"||e.match(/halve?/)?.5:parseFloat(e.replace(",","."))}function sH(r){let e=r.toLowerCase();return nH[e]!==void 0?nH[e]:(e=e.replace(/(?:ste|de)$/i,""),parseInt(e))}function sI(r){if(/voor Christus/i.test(r))return r=r.replace(/voor Christus/i,""),-parseInt(r);if(/na Christus/i.test(r))return r=r.replace(/na Christus/i,""),parseInt(r);let e=parseInt(r);return ls(e)}function mm(r){let e={},t=r,n=rve.exec(t);for(;n;)grt(e,n),t=t.substring(n[0].length),n=rve.exec(t);return e}function grt(r,e){let t=hrt(e[1]),n=rC[e[2].toLowerCase()];r[n]=t}var aH,Ru,rH,nH,rC,frt,iH,iI,nve,rve,Oc,Js=y(()=>{Ot();Rn();aH={zondag:0,zon:0,"zon.":0,zo:0,"zo.":0,maandag:1,ma:1,"ma.":1,dinsdag:2,din:2,"din.":2,di:2,"di.":2,woensdag:3,woe:3,"woe.":3,wo:3,"wo.":3,donderdag:4,dond:4,"dond.":4,do:4,"do.":4,vrijdag:5,vrij:5,"vrij.":5,vr:5,"vr.":5,zaterdag:6,zat:6,"zat.":6,za:6,"za.":6},Ru={januari:1,jan:1,"jan.":1,februari:2,feb:2,"feb.":2,maart:3,mar:3,"mar.":3,mrt:3,"mrt.":3,april:4,apr:4,"apr.":4,mei:5,juni:6,jun:6,"jun.":6,juli:7,jul:7,"jul.":7,augustus:8,aug:8,"aug.":8,september:9,sep:9,"sep.":9,sept:9,"sept.":9,oktober:10,okt:10,"okt.":10,november:11,nov:11,"nov.":11,december:12,dec:12,"dec.":12},rH={een:1,twee:2,drie:3,vier:4,vijf:5,zes:6,zeven:7,acht:8,negen:9,tien:10,elf:11,twaalf:12},nH={eerste:1,tweede:2,derde:3,vierde:4,vijfde:5,zesde:6,zevende:7,achtste:8,negende:9,tiende:10,elfde:11,twaalfde:12,dertiende:13,veertiende:14,vijftiende:15,zestiende:16,zeventiende:17,achttiende:18,negentiende:19,twintigste:20,eenentwintigste:21,twee\u00EBntwintigste:22,drieentwintigste:23,vierentwintigste:24,vijfentwintigste:25,zesentwintigste:26,zevenentwintigste:27,achtentwintig:28,negenentwintig:29,dertigste:30,eenendertigste:31},rC={sec:"second",second:"second",seconden:"second",min:"minute",mins:"minute",minute:"minute",minuut:"minute",minuten:"minute",minuutje:"minute",h:"hour",hr:"hour",hrs:"hour",uur:"hour",u:"hour",uren:"hour",dag:"d",dagen:"d",week:"week",weken:"week",maand:"month",maanden:"month",jaar:"year",jr:"year",jaren:"year"},frt=`(?:${oe(rH)}|[0-9]+|[0-9]+[\\.,][0-9]+|halve?|half|paar)`;iH=`(?:${oe(nH)}|[0-9]{1,2}(?:ste|de)?)`;iI="(?:[1-9][0-9]{0,3}\\s*(?:voor Christus|na Christus)|[1-2][0-9]{3}|[5-9][0-9])";nve=`(${frt})\\s{0,5}(${oe(rC)})\\s{0,5}`,rve=new RegExp(nve,"i"),Oc=zi("(?:(?:binnen|in)\\s*)?",nve)});var nC,ave=y(()=>{Js();pt();xe();nC=class extends q{innerPattern(){return new RegExp("(?:binnen|in|binnen de|voor)\\s*("+Oc+")(?=\\W|$)","i")}innerExtract(e,t){let n=mm(t[1]);return te.createRelativeFromReference(e.reference,n)}}});var yrt,vrt,krt,brt,aC,ive=y(()=>{Js();Ot();xe();jl();yrt=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:op\\s*?)?(?:(deze|vorige|volgende)\\s*(?:week\\s*)?)?(${oe(aH)})(?=\\W|$)`,"i"),vrt=1,krt=2,brt=3,aC=class extends q{innerPattern(){return yrt}innerExtract(e,t){let n=t[krt].toLowerCase(),a=aH[n],i=t[vrt],s=t[brt],o=i||s;o=o||"",o=o.toLowerCase();let l=null;return o=="vorige"?l="last":o=="volgende"?l="next":o=="deze"&&(l="this"),ta(e.reference,a,l)}}});var Trt,wrt,sve,ove,lve,iC,cve=y(()=>{Rn();Js();Js();Js();Ot();xe();Trt=new RegExp(`(?:on\\s*?)?(${iH})(?:\\s*(?:tot|\\-|\\\u2013|until|through|till|\\s)\\s*(${iH}))?(?:-|/|\\s*(?:of)?\\s*)(`+oe(Ru)+`)(?:(?:-|/|,?\\s*)(${iI}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),wrt=3,sve=1,ove=2,lve=4,iC=class extends q{innerPattern(){return Trt}innerExtract(e,t){let n=Ru[t[wrt].toLowerCase()],a=sH(t[sve]);if(a>31)return t.index=t.index+t[sve].length,null;let i=e.createParsingComponents({day:a,month:n});if(t[lve]){let l=sI(t[lve]);i.assign("year",l)}else{let l=fr(e.refDate,a,n);i.imply("year",l)}if(!t[ove])return i;let s=sH(t[ove]),o=e.createParsingResult(t.index,t[0]);return o.start=i,o.end=i.clone(),o.end.assign("day",s),o}}});var Srt,xrt,dve,sk,uve=y(()=>{Js();Rn();Ot();Js();xe();Srt=new RegExp(`(${oe(Ru)})\\s*(?:[,-]?\\s*(${iI})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),xrt=1,dve=2,sk=class extends q{innerPattern(){return Srt}innerExtract(e,t){let n=e.createParsingComponents();n.imply("day",1);let a=t[xrt],i=Ru[a.toLowerCase()];if(n.assign("month",i),t[dve]){let s=sI(t[dve]);n.assign("year",s)}else{let s=fr(e.refDate,1,i);n.imply("year",s)}return n}}});var Crt,Ert,Drt,sC,pve=y(()=>{xe();Crt=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),Ert=1,Drt=2,sC=class extends q{innerPattern(){return Crt}innerExtract(e,t){let n=parseInt(t[Drt]),a=parseInt(t[Ert]);return e.createParsingComponents().imply("day",1).assign("month",a).assign("year",n)}}});var oC,mve=y(()=>{Au();oC=class extends Da{primaryPrefix(){return"(?:(?:om)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|om|\\?)\\s*"}primarySuffix(){return"(?:\\s*(?:uur))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(e,t){return t[0].match(/^\s*\d{4}\s*$/)?null:super.extractPrimaryTimeComponents(e,t)}}});var Prt,Mrt,Art,fve,_rt,lC,hve=y(()=>{Js();Ot();xe();Prt=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${oe(Ru)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),Mrt=1,Art=2,fve=3,_rt=4,lC=class extends q{innerPattern(){return Prt}innerExtract(e,t){let n=t[fve]?parseInt(t[fve]):Ru[t[Art].toLowerCase()];if(n<1||n>12)return null;let a=parseInt(t[Mrt]);return{day:parseInt(t[_rt]),month:n,year:a}}}});var gve,Irt,Nrt,cC,yve=y(()=>{xe();Ht();Gs();gve=st(tr(),1),Irt=1,Nrt=2,cC=class extends q{innerPattern(e){return/(gisteren|morgen|van)(ochtend|middag|namiddag|avond|nacht)(?=\W|$)/i}innerExtract(e,t){let n=t[Irt].toLowerCase(),a=t[Nrt].toLowerCase(),i=e.createParsingComponents(),s=(0,gve.default)(e.refDate);switch(n){case"gisteren":Kr(i,s.add(-1,"day"));break;case"van":Kr(i,s);break;case"morgen":Ll(i,s);break}switch(a){case"ochtend":i.imply("meridiem",H.AM),i.imply("hour",6);break;case"middag":i.imply("meridiem",H.AM),i.imply("hour",12);break;case"namiddag":i.imply("meridiem",H.PM),i.imply("hour",15);break;case"avond":i.imply("meridiem",H.PM),i.imply("hour",20);break}return i}}});var Rrt,Frt,Ort,dC,vve=y(()=>{Js();pt();xe();Qs();Rrt=new RegExp(`(dit|deze|vorig|afgelopen|(?:aan)?komend|over|\\+|-)e?\\s*(${Oc})(?=\\W|$)`,"i"),Frt=1,Ort=2,dC=class extends q{innerPattern(){return Rrt}innerExtract(e,t){let n=t[Frt].toLowerCase(),a=mm(t[Ort]);switch(n){case"vorig":case"afgelopen":case"-":a=ea(a);break}return te.createRelativeFromReference(e.reference,a)}}});var kve,Lrt,zrt,jrt,uC,bve=y(()=>{Js();pt();kve=st(tr(),1);xe();Ot();Lrt=new RegExp(`(dit|deze|(?:aan)?komend|volgend|afgelopen|vorig)e?\\s*(${oe(rC)})(?=\\s*)(?=\\W|$)`,"i"),zrt=1,jrt=2,uC=class extends q{innerPattern(){return Lrt}innerExtract(e,t){let n=t[zrt].toLowerCase(),a=t[jrt].toLowerCase(),i=rC[a];if(n=="volgend"||n=="komend"||n=="aankomend"){let l={};return l[i]=1,te.createRelativeFromReference(e.reference,l)}if(n=="afgelopen"||n=="vorig"){let l={};return l[i]=-1,te.createRelativeFromReference(e.reference,l)}let s=e.createParsingComponents(),o=(0,kve.default)(e.reference.instant);return a.match(/week/i)?(o=o.add(-o.get("d"),"d"),s.imply("day",o.date()),s.imply("month",o.month()+1),s.imply("year",o.year())):a.match(/maand/i)?(o=o.add(-o.date()+1,"d"),s.imply("day",o.date()),s.assign("year",o.year()),s.assign("month",o.month()+1)):a.match(/jaar/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),s.imply("day",o.date()),s.imply("month",o.month()+1),s.assign("year",o.year())),s}}});var $rt,Brt,pC,Tve=y(()=>{Js();pt();xe();Qs();$rt=new RegExp("("+Oc+")(?:geleden|voor|eerder)(?=(?:\\W|$))","i"),Brt=new RegExp("("+Oc+")geleden(?=(?:\\W|$))","i"),pC=class extends q{constructor(t){super();I(this,"strictMode");this.strictMode=t}innerPattern(){return this.strictMode?Brt:$rt}innerExtract(t,n){let a=mm(n[1]),i=ea(a);return te.createRelativeFromReference(t.reference,i)}}});var Urt,Hrt,Vrt,mC,wve=y(()=>{Js();pt();xe();Urt=new RegExp("("+Oc+")(later|na|vanaf nu|voortaan|vooruit|uit)(?=(?:\\W|$))","i"),Hrt=new RegExp("("+Oc+")(later|vanaf nu)(?=(?:\\W|$))","i"),Vrt=1,mC=class extends q{constructor(t){super();I(this,"strictMode");this.strictMode=t}innerPattern(){return this.strictMode?Hrt:Urt}innerExtract(t,n){let a=mm(n[Vrt]);return te.createRelativeFromReference(t.reference,a)}}});var cH={};at(cH,{Chrono:()=>Be,Meridiem:()=>H,ParsingComponents:()=>te,ParsingResult:()=>Yt,ReferenceWithTimezone:()=>rr,Weekday:()=>Ye,casual:()=>oH,createCasualConfiguration:()=>Sve,createConfiguration:()=>lH,parse:()=>Wrt,parseDate:()=>Yrt,strict:()=>qrt});function Wrt(r,e,t){return oH.parse(r,e,t)}function Yrt(r,e,t){return oH.parseDate(r,e,t)}function Sve(r=!0){let e=lH(!1,r);return e.parsers.unshift(new eC),e.parsers.unshift(new tC),e.parsers.unshift(new cC),e.parsers.unshift(new sk),e.parsers.unshift(new uC),e.parsers.unshift(new dC),e}function lH(r=!0,e=!0){return mn({parsers:[new ua(e),new nC,new iC,new sk,new aC,new lC,new sC,new oC(r),new pC(r),new mC(r)],refiners:[new Xx,new Jx]},r)}var oH,qrt,xve=y(()=>{Ks();ds();pt();Ht();Qye();Jye();Xye();tve();Nu();ave();ive();cve();uve();pve();mve();hve();yve();vve();bve();Tve();wve();oH=new Be(Sve()),qrt=new Be(lH(!0))});function zo(r){let e=0;for(let t=0;t{Ma={\u96F6:0,"\u3007":0,\u4E00:1,\u4E8C:2,\u4E24:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10},ok={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6}});var Dve,dH,Eve,uH,Uh,pH=y(()=>{Dve=st(tr(),1);xe();lk();dH=1,Eve=2,uH=3,Uh=class extends q{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(Ma).join("")+"]{4}|["+Object.keys(Ma).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(Ma).join("")+"]{1,3})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(Ma).join("")+"]{1,3})?(?:\\s*)(?:\u65E5|\u53F7)?")}innerExtract(e,t){let n=(0,Dve.default)(e.refDate),a=e.createParsingResult(t.index,t[0]),i=parseInt(t[Eve]);if(isNaN(i)&&(i=zo(t[Eve])),a.start.assign("month",i),t[uH]){let s=parseInt(t[uH]);isNaN(s)&&(s=zo(t[uH])),a.start.assign("day",s)}else a.start.imply("day",n.date());if(t[dH]){let s=parseInt(t[dH]);isNaN(s)&&(s=Cve(t[dH])),a.start.assign("year",s)}else a.start.imply("year",n.year());return a}}});var Pve,Grt,mH,Krt,Hh,fH=y(()=>{Pve=st(tr(),1);xe();lk();Grt=new RegExp("(\\d+|["+Object.keys(Ma).join("")+"]+|\u534A|\u51E0)(?:\\s*)(?:\u4E2A)?(\u79D2(?:\u949F)?|\u5206\u949F|\u5C0F\u65F6|\u949F|\u65E5|\u5929|\u661F\u671F|\u793C\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u8FC7)?\u540E|(?:\u4E4B)?\u5185)","i"),mH=1,Krt=2,Hh=class extends q{innerPattern(){return Grt}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),a=parseInt(t[mH]);if(isNaN(a)&&(a=zo(t[mH])),isNaN(a)){let l=t[mH];if(l==="\u51E0")a=3;else if(l==="\u534A")a=.5;else return null}let i=(0,Pve.default)(e.refDate),o=t[Krt][0];return o.match(/[日天星礼月年]/)?(o=="\u65E5"||o=="\u5929"?i=i.add(a,"d"):o=="\u661F"||o=="\u793C"?i=i.add(a*7,"d"):o=="\u6708"?i=i.add(a,"month"):o=="\u5E74"&&(i=i.add(a,"year")),n.start.assign("year",i.year()),n.start.assign("month",i.month()+1),n.start.assign("day",i.date()),n):(o=="\u79D2"?i=i.add(a,"second"):o=="\u5206"?i=i.add(a,"minute"):(o=="\u5C0F"||o=="\u949F")&&(i=i.add(a,"hour")),n.start.imply("year",i.year()),n.start.imply("month",i.month()+1),n.start.imply("day",i.date()),n.start.assign("hour",i.hour()),n.start.assign("minute",i.minute()),n.start.assign("second",i.second()),n)}}});var Mve,Zrt,Vh,hH=y(()=>{Mve=st(tr(),1);xe();lk();Zrt=new RegExp("(?\u4E0A|\u4E0B|\u8FD9)(?:\u4E2A)?(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(ok).join("|")+")"),Vh=class extends q{innerPattern(){return Zrt}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),a=t.groups.weekday,i=ok[a];if(i===void 0)return null;let s=null,o=t.groups.prefix;o=="\u4E0A"?s="last":o=="\u4E0B"?s="next":o=="\u8FD9"&&(s="this");let l=(0,Mve.default)(e.refDate),c=!1,d=l.day();return s=="last"||s=="past"?(l=l.day(i-7),c=!0):s=="next"?(l=l.day(i+7),c=!0):s=="this"?l=l.day(i):Math.abs(i-7-d){Ave=st(tr(),1);xe();lk();Qrt=new RegExp("(?:\u4ECE|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Ma).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Ma).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Ma).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Jrt=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Ma).join("")+"]+)(?:\\s*)(?:\u70B9|\u65F6|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Ma).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Ma).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),oI=1,lI=2,cI=3,dI=4,uI=5,pI=6,jo=7,ck=8,mI=9,qh=class extends q{innerPattern(){return Qrt}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=(0,Ave.default)(e.refDate),a=e.createParsingResult(t.index,t[0]),i=n.clone();if(t[oI]){let d=t[oI];d=="\u660E"?n.hour()>1&&(i=i.add(1,"day")):d=="\u6628"?i=i.add(-1,"day"):d=="\u524D"?i=i.add(-2,"day"):d=="\u5927\u524D"?i=i.add(-3,"day"):d=="\u540E"?i=i.add(2,"day"):d=="\u5927\u540E"&&(i=i.add(3,"day")),a.start.assign("day",i.date()),a.start.assign("month",i.month()+1),a.start.assign("year",i.year())}else if(t[dI]){let d=t[dI];d=="\u660E"?i=i.add(1,"day"):d=="\u6628"?i=i.add(-1,"day"):d=="\u524D"?i=i.add(-2,"day"):d=="\u5927\u524D"?i=i.add(-3,"day"):d=="\u540E"?i=i.add(2,"day"):d=="\u5927\u540E"&&(i=i.add(3,"day")),a.start.assign("day",i.date()),a.start.assign("month",i.month()+1),a.start.assign("year",i.year())}else a.start.imply("day",i.date()),a.start.imply("month",i.month()+1),a.start.imply("year",i.year());let s=0,o=0,l=-1;if(t[ck]){let d=parseInt(t[ck]);if(isNaN(d)&&(d=zo(t[ck])),d>=60)return null;a.start.assign("second",d)}if(s=parseInt(t[pI]),isNaN(s)&&(s=zo(t[pI])),t[jo]?t[jo]=="\u534A"?o=30:t[jo]=="\u6B63"||t[jo]=="\u6574"?o=0:(o=parseInt(t[jo]),isNaN(o)&&(o=zo(t[jo]))):s>100&&(o=s%100,s=Math.floor(s/100)),o>=60||s>24)return null;if(s>=12&&(l=1),t[mI]){if(s>12)return null;let d=t[mI][0].toLowerCase();d=="a"&&(l=0,s==12&&(s=0)),d=="p"&&(l=1,s!=12&&(s+=12))}else if(t[lI]){let u=t[lI][0];u=="\u65E9"?(l=0,s==12&&(s=0)):u=="\u665A"&&(l=1,s!=12&&(s+=12))}else if(t[cI]){let u=t[cI][0];u=="\u4E0A"||u=="\u65E9"||u=="\u51CC"?(l=0,s==12&&(s=0)):(u=="\u4E0B"||u=="\u665A")&&(l=1,s!=12&&(s+=12))}else if(t[uI]){let u=t[uI][0];u=="\u4E0A"||u=="\u65E9"||u=="\u51CC"?(l=0,s==12&&(s=0)):(u=="\u4E0B"||u=="\u665A")&&(l=1,s!=12&&(s+=12))}if(a.start.assign("hour",s),a.start.assign("minute",o),l>=0?a.start.assign("meridiem",l):s<12?a.start.imply("meridiem",0):a.start.imply("meridiem",1),t=Jrt.exec(e.text.substring(a.index+a.text.length)),!t)return a.text.match(/^\d+$/)?null:a;let c=i.clone();if(a.end=e.createParsingComponents(),t[oI]){let d=t[oI];d=="\u660E"?n.hour()>1&&(c=c.add(1,"day")):d=="\u6628"?c=c.add(-1,"day"):d=="\u524D"?c=c.add(-2,"day"):d=="\u5927\u524D"?c=c.add(-3,"day"):d=="\u540E"?c=c.add(2,"day"):d=="\u5927\u540E"&&(c=c.add(3,"day")),a.end.assign("day",c.date()),a.end.assign("month",c.month()+1),a.end.assign("year",c.year())}else if(t[dI]){let d=t[dI];d=="\u660E"?c=c.add(1,"day"):d=="\u6628"?c=c.add(-1,"day"):d=="\u524D"?c=c.add(-2,"day"):d=="\u5927\u524D"?c=c.add(-3,"day"):d=="\u540E"?c=c.add(2,"day"):d=="\u5927\u540E"&&(c=c.add(3,"day")),a.end.assign("day",c.date()),a.end.assign("month",c.month()+1),a.end.assign("year",c.year())}else a.end.imply("day",c.date()),a.end.imply("month",c.month()+1),a.end.imply("year",c.year());if(s=0,o=0,l=-1,t[ck]){let d=parseInt(t[ck]);if(isNaN(d)&&(d=zo(t[ck])),d>=60)return null;a.end.assign("second",d)}if(s=parseInt(t[pI]),isNaN(s)&&(s=zo(t[pI])),t[jo]?t[jo]=="\u534A"?o=30:t[jo]=="\u6B63"||t[jo]=="\u6574"?o=0:(o=parseInt(t[jo]),isNaN(o)&&(o=zo(t[jo]))):s>100&&(o=s%100,s=Math.floor(s/100)),o>=60||s>24)return null;if(s>=12&&(l=1),t[mI]){if(s>12)return null;let d=t[mI][0].toLowerCase();d=="a"&&(l=0,s==12&&(s=0)),d=="p"&&(l=1,s!=12&&(s+=12)),a.start.isCertain("meridiem")||(l==0?(a.start.imply("meridiem",0),a.start.get("hour")==12&&a.start.assign("hour",0)):(a.start.imply("meridiem",1),a.start.get("hour")!=12&&a.start.assign("hour",a.start.get("hour")+12)))}else if(t[lI]){let u=t[lI][0];u=="\u65E9"?(l=0,s==12&&(s=0)):u=="\u665A"&&(l=1,s!=12&&(s+=12))}else if(t[cI]){let u=t[cI][0];u=="\u4E0A"||u=="\u65E9"||u=="\u51CC"?(l=0,s==12&&(s=0)):(u=="\u4E0B"||u=="\u665A")&&(l=1,s!=12&&(s+=12))}else if(t[uI]){let u=t[uI][0];u=="\u4E0A"||u=="\u65E9"||u=="\u51CC"?(l=0,s==12&&(s=0)):(u=="\u4E0B"||u=="\u665A")&&(l=1,s!=12&&(s+=12))}return a.text=a.text+t[0],a.end.assign("hour",s),a.end.assign("minute",o),l>=0?a.end.assign("meridiem",l):a.start.isCertain("meridiem")&&a.start.get("meridiem")==1&&a.start.get("hour")>s?a.end.imply("meridiem",0):s>12&&a.end.imply("meridiem",1),a.end.date().getTime(){_ve=st(tr(),1);xe();lk();Xrt=new RegExp("(?:\u661F\u671F|\u793C\u62DC|\u5468)(?"+Object.keys(ok).join("|")+")"),Wh=class extends q{innerPattern(){return Xrt}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),a=t.groups.weekday,i=ok[a];if(i===void 0)return null;let s=(0,_ve.default)(e.refDate),o=!1,l=s.day();return Math.abs(i-7-l){Fve=st(tr(),1);xe();ent=1,Ive=2,tnt=3,Nve=4,Rve=5,rnt=6,Yh=class extends q{innerPattern(e){return new RegExp("(\u800C\u5BB6|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,a=e.createParsingResult(n,t[0]),i=(0,Fve.default)(e.refDate),s=i;if(t[ent])a.start.imply("hour",i.hour()),a.start.imply("minute",i.minute()),a.start.imply("second",i.second()),a.start.imply("millisecond",i.millisecond());else if(t[Ive]){let o=t[Ive],l=t[tnt];o=="\u660E"||o=="\u807D"?i.hour()>1&&(s=s.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?s=s.add(-1,"day"):o=="\u524D"?s=s.add(-2,"day"):o=="\u5927\u524D"?s=s.add(-3,"day"):o=="\u5F8C"?s=s.add(2,"day"):o=="\u5927\u5F8C"&&(s=s.add(3,"day")),l=="\u65E9"||l=="\u671D"?a.start.imply("hour",6):l=="\u665A"&&(a.start.imply("hour",22),a.start.imply("meridiem",1))}else if(t[Nve]){let l=t[Nve][0];l=="\u65E9"||l=="\u671D"||l=="\u4E0A"?a.start.imply("hour",6):l=="\u4E0B"||l=="\u664F"?(a.start.imply("hour",15),a.start.imply("meridiem",1)):l=="\u4E2D"?(a.start.imply("hour",12),a.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(a.start.imply("hour",22),a.start.imply("meridiem",1)):l=="\u51CC"&&a.start.imply("hour",0)}else if(t[Rve]){let o=t[Rve];o=="\u660E"||o=="\u807D"?i.hour()>1&&(s=s.add(1,"day")):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?s=s.add(-1,"day"):o=="\u524D"?s=s.add(-2,"day"):o=="\u5927\u524D"?s=s.add(-3,"day"):o=="\u5F8C"?s=s.add(2,"day"):o=="\u5927\u5F8C"&&(s=s.add(3,"day"));let l=t[rnt];if(l){let c=l[0];c=="\u65E9"||c=="\u671D"||c=="\u4E0A"?a.start.imply("hour",6):c=="\u4E0B"||c=="\u664F"?(a.start.imply("hour",15),a.start.imply("meridiem",1)):c=="\u4E2D"?(a.start.imply("hour",12),a.start.imply("meridiem",1)):c=="\u591C"||c=="\u665A"?(a.start.imply("hour",22),a.start.imply("meridiem",1)):c=="\u51CC"&&a.start.imply("hour",0)}}return a.start.assign("day",s.date()),a.start.assign("month",s.month()+1),a.start.assign("year",s.year()),a}}});function $o(r){let e=0;for(let t=0;t{Aa={\u96F6:0,\u4E00:1,\u4E8C:2,\u5169:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6,\u4E03:7,\u516B:8,\u4E5D:9,\u5341:10,\u5EFF:20,\u5345:30},dk={\u5929:0,\u65E5:0,\u4E00:1,\u4E8C:2,\u4E09:3,\u56DB:4,\u4E94:5,\u516D:6}});var zve,kH,Lve,bH,Gh,TH=y(()=>{zve=st(tr(),1);xe();uk();kH=1,Lve=2,bH=3,Gh=class extends q{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(Aa).join("")+"]{4}|["+Object.keys(Aa).join("")+"]{2})?(?:\\s*)(?:\u5E74)?(?:[\\s|,|\uFF0C]*)(\\d{1,2}|["+Object.keys(Aa).join("")+"]{1,2})(?:\\s*)(?:\u6708)(?:\\s*)(\\d{1,2}|["+Object.keys(Aa).join("")+"]{1,2})?(?:\\s*)(?:\u65E5|\u865F)?")}innerExtract(e,t){let n=(0,zve.default)(e.refDate),a=e.createParsingResult(t.index,t[0]),i=parseInt(t[Lve]);if(isNaN(i)&&(i=$o(t[Lve])),a.start.assign("month",i),t[bH]){let s=parseInt(t[bH]);isNaN(s)&&(s=$o(t[bH])),a.start.assign("day",s)}else a.start.imply("day",n.date());if(t[kH]){let s=parseInt(t[kH]);isNaN(s)&&(s=Ove(t[kH])),a.start.assign("year",s)}else a.start.imply("year",n.year());return a}}});var jve,nnt,wH,ant,Kh,SH=y(()=>{jve=st(tr(),1);xe();uk();nnt=new RegExp("(\\d+|["+Object.keys(Aa).join("")+"]+|\u534A|\u5E7E)(?:\\s*)(?:\u500B)?(\u79D2(?:\u9418)?|\u5206\u9418|\u5C0F\u6642|\u9418|\u65E5|\u5929|\u661F\u671F|\u79AE\u62DC|\u6708|\u5E74)(?:(?:\u4E4B|\u904E)?\u5F8C|(?:\u4E4B)?\u5167)","i"),wH=1,ant=2,Kh=class extends q{innerPattern(){return nnt}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),a=parseInt(t[wH]);if(isNaN(a)&&(a=$o(t[wH])),isNaN(a)){let l=t[wH];if(l==="\u5E7E")a=3;else if(l==="\u534A")a=.5;else return null}let i=(0,jve.default)(e.refDate),o=t[ant][0];return o.match(/[日天星禮月年]/)?(o=="\u65E5"||o=="\u5929"?i=i.add(a,"d"):o=="\u661F"||o=="\u79AE"?i=i.add(a*7,"d"):o=="\u6708"?i=i.add(a,"month"):o=="\u5E74"&&(i=i.add(a,"year")),n.start.assign("year",i.year()),n.start.assign("month",i.month()+1),n.start.assign("day",i.date()),n):(o=="\u79D2"?i=i.add(a,"second"):o=="\u5206"?i=i.add(a,"minute"):(o=="\u5C0F"||o=="\u9418")&&(i=i.add(a,"hour")),n.start.imply("year",i.year()),n.start.imply("month",i.month()+1),n.start.imply("day",i.date()),n.start.assign("hour",i.hour()),n.start.assign("minute",i.minute()),n.start.assign("second",i.second()),n)}}});var $ve,int,Zh,xH=y(()=>{$ve=st(tr(),1);xe();uk();int=new RegExp("(?\u4E0A|\u4ECA|\u4E0B|\u9019|\u5462)(?:\u500B)?(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(dk).join("|")+")"),Zh=class extends q{innerPattern(){return int}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),a=t.groups.weekday,i=dk[a];if(i===void 0)return null;let s=null,o=t.groups.prefix;o=="\u4E0A"?s="last":o=="\u4E0B"?s="next":(o=="\u4ECA"||o=="\u9019"||o=="\u5462")&&(s="this");let l=(0,$ve.default)(e.refDate),c=!1,d=l.day();return s=="last"||s=="past"?(l=l.day(i-7),c=!0):s=="next"?(l=l.day(i+7),c=!0):s=="this"?l=l.day(i):Math.abs(i-7-d){Bve=st(tr(),1);xe();uk();snt=new RegExp("(?:\u7531|\u5F9E|\u81EA)?(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Aa).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Aa).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Aa).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),ont=new RegExp("(?:^\\s*(?:\u5230|\u81F3|\\-|\\\u2013|\\~|\\\u301C)\\s*)(?:(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(\u65E9|\u671D|\u665A)|(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u5F8C|\u5927\u5F8C|\u807D|\u6628|\u5C0B|\u7434)(?:\u65E5|\u5929)(?:[\\s,\uFF0C]*)(?:(\u4E0A(?:\u5348|\u665D)|\u671D(?:\u65E9)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348|\u665D)|\u664F(?:\u665D)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?)?(?:[\\s,\uFF0C]*)(?:(\\d+|["+Object.keys(Aa).join("")+"]+)(?:\\s*)(?:\u9EDE|\u6642|:|\uFF1A)(?:\\s*)(\\d+|\u534A|\u6B63|\u6574|["+Object.keys(Aa).join("")+"]+)?(?:\\s*)(?:\u5206|:|\uFF1A)?(?:\\s*)(\\d+|["+Object.keys(Aa).join("")+"]+)?(?:\\s*)(?:\u79D2)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),fI=1,hI=2,gI=3,yI=4,vI=5,kI=6,Bo=7,pk=8,bI=9,Qh=class extends q{innerPattern(){return snt}innerExtract(e,t){if(t.index>0&&e.text[t.index-1].match(/\w/))return null;let n=(0,Bve.default)(e.refDate),a=e.createParsingResult(t.index,t[0]),i=n.clone();if(t[fI]){var s=t[fI];s=="\u660E"||s=="\u807D"?n.hour()>1&&(i=i.add(1,"day")):s=="\u6628"||s=="\u5C0B"||s=="\u7434"?i=i.add(-1,"day"):s=="\u524D"?i=i.add(-2,"day"):s=="\u5927\u524D"?i=i.add(-3,"day"):s=="\u5F8C"?i=i.add(2,"day"):s=="\u5927\u5F8C"&&(i=i.add(3,"day")),a.start.assign("day",i.date()),a.start.assign("month",i.month()+1),a.start.assign("year",i.year())}else if(t[yI]){var o=t[yI];o=="\u660E"||o=="\u807D"?i=i.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?i=i.add(-1,"day"):o=="\u524D"?i=i.add(-2,"day"):o=="\u5927\u524D"?i=i.add(-3,"day"):o=="\u5F8C"?i=i.add(2,"day"):o=="\u5927\u5F8C"&&(i=i.add(3,"day")),a.start.assign("day",i.date()),a.start.assign("month",i.month()+1),a.start.assign("year",i.year())}else a.start.imply("day",i.date()),a.start.imply("month",i.month()+1),a.start.imply("year",i.year());let l=0,c=0,d=-1;if(t[pk]){var u=parseInt(t[pk]);if(isNaN(u)&&(u=$o(t[pk])),u>=60)return null;a.start.assign("second",u)}if(l=parseInt(t[kI]),isNaN(l)&&(l=$o(t[kI])),t[Bo]?t[Bo]=="\u534A"?c=30:t[Bo]=="\u6B63"||t[Bo]=="\u6574"?c=0:(c=parseInt(t[Bo]),isNaN(c)&&(c=$o(t[Bo]))):l>100&&(c=l%100,l=Math.floor(l/100)),c>=60||l>24)return null;if(l>=12&&(d=1),t[bI]){if(l>12)return null;var p=t[bI][0].toLowerCase();p=="a"&&(d=0,l==12&&(l=0)),p=="p"&&(d=1,l!=12&&(l+=12))}else if(t[hI]){var m=t[hI],f=m[0];f=="\u671D"||f=="\u65E9"?(d=0,l==12&&(l=0)):f=="\u665A"&&(d=1,l!=12&&(l+=12))}else if(t[gI]){var h=t[gI],g=h[0];g=="\u4E0A"||g=="\u671D"||g=="\u65E9"||g=="\u51CC"?(d=0,l==12&&(l=0)):(g=="\u4E0B"||g=="\u664F"||g=="\u665A")&&(d=1,l!=12&&(l+=12))}else if(t[vI]){var v=t[vI],b=v[0];b=="\u4E0A"||b=="\u671D"||b=="\u65E9"||b=="\u51CC"?(d=0,l==12&&(l=0)):(b=="\u4E0B"||b=="\u664F"||b=="\u665A")&&(d=1,l!=12&&(l+=12))}if(a.start.assign("hour",l),a.start.assign("minute",c),d>=0?a.start.assign("meridiem",d):l<12?a.start.imply("meridiem",0):a.start.imply("meridiem",1),t=ont.exec(e.text.substring(a.index+a.text.length)),!t)return a.text.match(/^\d+$/)?null:a;let k=i.clone();if(a.end=e.createParsingComponents(),t[fI]){var s=t[fI];s=="\u660E"||s=="\u807D"?n.hour()>1&&(k=k.add(1,"day")):s=="\u6628"||s=="\u5C0B"||s=="\u7434"?k=k.add(-1,"day"):s=="\u524D"?k=k.add(-2,"day"):s=="\u5927\u524D"?k=k.add(-3,"day"):s=="\u5F8C"?k=k.add(2,"day"):s=="\u5927\u5F8C"&&(k=k.add(3,"day")),a.end.assign("day",k.date()),a.end.assign("month",k.month()+1),a.end.assign("year",k.year())}else if(t[yI]){var o=t[yI];o=="\u660E"||o=="\u807D"?k=k.add(1,"day"):o=="\u6628"||o=="\u5C0B"||o=="\u7434"?k=k.add(-1,"day"):o=="\u524D"?k=k.add(-2,"day"):o=="\u5927\u524D"?k=k.add(-3,"day"):o=="\u5F8C"?k=k.add(2,"day"):o=="\u5927\u5F8C"&&(k=k.add(3,"day")),a.end.assign("day",k.date()),a.end.assign("month",k.month()+1),a.end.assign("year",k.year())}else a.end.imply("day",k.date()),a.end.imply("month",k.month()+1),a.end.imply("year",k.year());if(l=0,c=0,d=-1,t[pk]){var u=parseInt(t[pk]);if(isNaN(u)&&(u=$o(t[pk])),u>=60)return null;a.end.assign("second",u)}if(l=parseInt(t[kI]),isNaN(l)&&(l=$o(t[kI])),t[Bo]?t[Bo]=="\u534A"?c=30:t[Bo]=="\u6B63"||t[Bo]=="\u6574"?c=0:(c=parseInt(t[Bo]),isNaN(c)&&(c=$o(t[Bo]))):l>100&&(c=l%100,l=Math.floor(l/100)),c>=60||l>24)return null;if(l>=12&&(d=1),t[bI]){if(l>12)return null;var p=t[bI][0].toLowerCase();p=="a"&&(d=0,l==12&&(l=0)),p=="p"&&(d=1,l!=12&&(l+=12)),a.start.isCertain("meridiem")||(d==0?(a.start.imply("meridiem",0),a.start.get("hour")==12&&a.start.assign("hour",0)):(a.start.imply("meridiem",1),a.start.get("hour")!=12&&a.start.assign("hour",a.start.get("hour")+12)))}else if(t[hI]){var m=t[hI],f=m[0];f=="\u671D"||f=="\u65E9"?(d=0,l==12&&(l=0)):f=="\u665A"&&(d=1,l!=12&&(l+=12))}else if(t[gI]){var h=t[gI],g=h[0];g=="\u4E0A"||g=="\u671D"||g=="\u65E9"||g=="\u51CC"?(d=0,l==12&&(l=0)):(g=="\u4E0B"||g=="\u664F"||g=="\u665A")&&(d=1,l!=12&&(l+=12))}else if(t[vI]){var v=t[vI],b=v[0];b=="\u4E0A"||b=="\u671D"||b=="\u65E9"||b=="\u51CC"?(d=0,l==12&&(l=0)):(b=="\u4E0B"||b=="\u664F"||b=="\u665A")&&(d=1,l!=12&&(l+=12))}return a.text=a.text+t[0],a.end.assign("hour",l),a.end.assign("minute",c),d>=0?a.end.assign("meridiem",d):a.start.isCertain("meridiem")&&a.start.get("meridiem")==1&&a.start.get("hour")>l?a.end.imply("meridiem",0):l>12&&a.end.imply("meridiem",1),a.end.date().getTime(){Uve=st(tr(),1);xe();uk();lnt=new RegExp("(?:\u661F\u671F|\u79AE\u62DC|\u9031)(?"+Object.keys(dk).join("|")+")"),Jh=class extends q{innerPattern(){return lnt}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),a=t.groups.weekday,i=dk[a];if(i===void 0)return null;let s=(0,Uve.default)(e.refDate),o=!1,l=s.day();return Math.abs(i-7-l){Fo();Xh=class extends an{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}}});var eg,PH=y(()=>{Oo();eg=class extends sn{patternBetween(){return/^\s*$/i}}});var TI={};at(TI,{Chrono:()=>Be,Meridiem:()=>H,ParsingComponents:()=>te,ParsingResult:()=>Yt,ReferenceWithTimezone:()=>rr,Weekday:()=>Ye,casual:()=>MH,createCasualConfiguration:()=>AH,createConfiguration:()=>_H,hant:()=>cnt,parse:()=>unt,parseDate:()=>pnt,strict:()=>dnt});function unt(r,e,t){return MH.parse(r,e,t)}function pnt(r,e,t){return MH.parseDate(r,e,t)}function AH(){let r=_H();return r.parsers.unshift(new Yh),r}function _H(){let r=mn({parsers:[new Gh,new Zh,new Jh,new Qh,new Kh],refiners:[new Xh,new eg]});return r.refiners=r.refiners.filter(e=>!(e instanceof zl)),r}var cnt,MH,dnt,Hve=y(()=>{ex();Ks();ds();pt();Ht();vH();TH();SH();xH();CH();EH();DH();PH();cnt=new Be(AH()),MH=new Be(AH()),dnt=new Be(_H())});var Yve,mnt,Vve,fnt,qve,Wve,hnt,fC,Gve=y(()=>{Yve=st(tr(),1);xe();mnt=1,Vve=2,fnt=3,qve=4,Wve=5,hnt=6,fC=class extends q{innerPattern(e){return new RegExp("(\u73B0\u5728|\u7ACB(?:\u523B|\u5373)|\u5373\u523B)|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(\u65E9|\u665A)|(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668))|(\u4ECA|\u660E|\u524D|\u5927\u524D|\u540E|\u5927\u540E|\u6628)(?:\u65E5|\u5929)(?:[\\s|,|\uFF0C]*)(?:(\u4E0A(?:\u5348)|\u65E9(?:\u4E0A)|\u4E0B(?:\u5348)|\u665A(?:\u4E0A)|\u591C(?:\u665A)?|\u4E2D(?:\u5348)|\u51CC(?:\u6668)))?","i")}innerExtract(e,t){let n=t.index,a=e.createParsingResult(n,t[0]),i=(0,Yve.default)(e.refDate),s=i;if(t[mnt])a.start.imply("hour",i.hour()),a.start.imply("minute",i.minute()),a.start.imply("second",i.second()),a.start.imply("millisecond",i.millisecond());else if(t[Vve]){let o=t[Vve],l=t[fnt];o=="\u660E"?i.hour()>1&&(s=s.add(1,"day")):o=="\u6628"?s=s.add(-1,"day"):o=="\u524D"?s=s.add(-2,"day"):o=="\u5927\u524D"?s=s.add(-3,"day"):o=="\u540E"?s=s.add(2,"day"):o=="\u5927\u540E"&&(s=s.add(3,"day")),l=="\u65E9"?a.start.imply("hour",6):l=="\u665A"&&(a.start.imply("hour",22),a.start.imply("meridiem",1))}else if(t[qve]){let l=t[qve][0];l=="\u65E9"||l=="\u4E0A"?a.start.imply("hour",6):l=="\u4E0B"?(a.start.imply("hour",15),a.start.imply("meridiem",1)):l=="\u4E2D"?(a.start.imply("hour",12),a.start.imply("meridiem",1)):l=="\u591C"||l=="\u665A"?(a.start.imply("hour",22),a.start.imply("meridiem",1)):l=="\u51CC"&&a.start.imply("hour",0)}else if(t[Wve]){let o=t[Wve];o=="\u660E"?i.hour()>1&&(s=s.add(1,"day")):o=="\u6628"?s=s.add(-1,"day"):o=="\u524D"?s=s.add(-2,"day"):o=="\u5927\u524D"?s=s.add(-3,"day"):o=="\u540E"?s=s.add(2,"day"):o=="\u5927\u540E"&&(s=s.add(3,"day"));let l=t[hnt];if(l){let c=l[0];c=="\u65E9"||c=="\u4E0A"?a.start.imply("hour",6):c=="\u4E0B"?(a.start.imply("hour",15),a.start.imply("meridiem",1)):c=="\u4E2D"?(a.start.imply("hour",12),a.start.imply("meridiem",1)):c=="\u591C"||c=="\u665A"?(a.start.imply("hour",22),a.start.imply("meridiem",1)):c=="\u51CC"&&a.start.imply("hour",0)}}return a.start.assign("day",s.date()),a.start.assign("month",s.month()+1),a.start.assign("year",s.year()),a}}});var hC,Kve=y(()=>{Fo();hC=class extends an{patternBetween(){return/^\s*(至|到|-|~|~|-|ー)\s*$/i}}});var gC,Zve=y(()=>{Oo();gC=class extends sn{patternBetween(){return/^\s*$/i}}});var wI={};at(wI,{Chrono:()=>Be,Meridiem:()=>H,ParsingComponents:()=>te,ParsingResult:()=>Yt,ReferenceWithTimezone:()=>rr,Weekday:()=>Ye,casual:()=>IH,createCasualConfiguration:()=>NH,createConfiguration:()=>RH,hans:()=>gnt,parse:()=>vnt,parseDate:()=>knt,strict:()=>ynt});function vnt(r,e,t){return IH.parse(r,e,t)}function knt(r,e,t){return IH.parseDate(r,e,t)}function NH(){let r=RH();return r.parsers.unshift(new fC),r}function RH(){let r=mn({parsers:[new Uh,new Vh,new Wh,new qh,new Hh],refiners:[new hC,new gC]});return r.refiners=r.refiners.filter(e=>!(e instanceof zl)),r}var gnt,IH,ynt,Qve=y(()=>{ex();Ks();ds();pt();Ht();Gve();pH();fH();hH();gH();yH();Kve();Zve();gnt=new Be(NH()),IH=new Be(NH()),ynt=new Be(RH())});var LH={};at(LH,{Chrono:()=>Be,Meridiem:()=>H,ParsingComponents:()=>te,ParsingResult:()=>Yt,ReferenceWithTimezone:()=>rr,Weekday:()=>Ye,casual:()=>FH,createCasualConfiguration:()=>Jve,createConfiguration:()=>OH,hans:()=>wI,hant:()=>TI,parse:()=>Tnt,parseDate:()=>wnt,strict:()=>bnt});function Tnt(r,e,t){return FH.parse(r,e,t)}function wnt(r,e,t){return FH.parseDate(r,e,t)}function Jve(){let r=OH();return r.parsers.unshift(new Yh),r}function OH(){let r=mn({parsers:[new Gh,new Uh,new Zh,new Vh,new Jh,new Wh,new Qh,new qh,new Kh,new Hh],refiners:[new Xh,new eg]});return r.refiners=r.refiners.filter(e=>!(e instanceof zl)),r}var FH,bnt,Xve=y(()=>{Ks();ds();pt();Ht();ex();pH();fH();hH();gH();yH();vH();TH();SH();xH();CH();EH();DH();PH();Hve();Qve();FH=new Be(Jve()),bnt=new Be(OH())});function xnt(r){let e=r.toLowerCase();return jH[e]!==void 0?jH[e]:e.match(/несколько/)?3:e.match(/пол/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}function VH(r){let e=r.toLowerCase();return $H[e]!==void 0?$H[e]:parseInt(e)}function xI(r){if(/(год|года|г|г.)/i.test(r)&&(r=r.replace(/(год|года|г|г.)/i,"")),/(до н.э.|до н. э.)/i.test(r))return r=r.replace(/(до н.э.|до н. э.)/i,""),-parseInt(r);if(/(н. э.|н.э.)/i.test(r))return r=r.replace(/(н. э.|н.э.)/i,""),parseInt(r);let e=parseInt(r);return ls(e)}function hk(r){let e={},t=r,n=eke.exec(t);for(;n;)Cnt(e,n),t=t.substring(n[0].length).trim(),n=eke.exec(t);return e}function Cnt(r,e){let t=xnt(e[1]),n=yC[e[2].toLowerCase()];r[n]=t}var Xs,BH,UH,mk,jH,$H,yC,Snt,HH,zH,SI,tke,eke,fk,eo=y(()=>{Ot();Rn();Xs={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"},BH={\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435:0,\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u044F:0,\u0432\u0441\u043A:0,"\u0432\u0441\u043A.":0,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0442\u043E\u0440\u043D\u0438\u043A:2,\u0432\u0442\u043E\u0440\u043D\u0438\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0440\u0435\u0434\u0430:3,\u0441\u0440\u0435\u0434\u044B:3,\u0441\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440\u0433:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0442:4,"\u0447\u0442.":4,\u043F\u044F\u0442\u043D\u0438\u0446\u0430:5,\u043F\u044F\u0442\u043D\u0438\u0446\u0443:5,\u043F\u044F\u0442\u043D\u0438\u0446\u044B:5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u0431\u043E\u0442\u0443:6,\u0441\u0443\u0431\u0431\u043E\u0442\u044B:6,\u0441\u0431:6,"\u0441\u0431.":6},UH={\u044F\u043D\u0432\u0430\u0440\u044C:1,\u044F\u043D\u0432\u0430\u0440\u044F:1,\u044F\u043D\u0432\u0430\u0440\u0435:1,\u0444\u0435\u0432\u0440\u0430\u043B\u044C:2,\u0444\u0435\u0432\u0440\u0430\u043B\u044F:2,\u0444\u0435\u0432\u0440\u0430\u043B\u0435:2,\u043C\u0430\u0440\u0442:3,\u043C\u0430\u0440\u0442\u0430:3,\u043C\u0430\u0440\u0442\u0435:3,\u0430\u043F\u0440\u0435\u043B\u044C:4,\u0430\u043F\u0440\u0435\u043B\u044F:4,\u0430\u043F\u0440\u0435\u043B\u0435:4,\u043C\u0430\u0439:5,\u043C\u0430\u044F:5,\u043C\u0430\u0435:5,\u0438\u044E\u043D\u044C:6,\u0438\u044E\u043D\u044F:6,\u0438\u044E\u043D\u0435:6,\u0438\u044E\u043B\u044C:7,\u0438\u044E\u043B\u044F:7,\u0438\u044E\u043B\u0435:7,\u0430\u0432\u0433\u0443\u0441\u0442:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0430:8,\u0430\u0432\u0433\u0443\u0441\u0442\u0435:8,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044C:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u044F:9,\u0441\u0435\u043D\u0442\u044F\u0431\u0440\u0435:9,\u043E\u043A\u0442\u044F\u0431\u0440\u044C:10,\u043E\u043A\u0442\u044F\u0431\u0440\u044F:10,\u043E\u043A\u0442\u044F\u0431\u0440\u0435:10,\u043D\u043E\u044F\u0431\u0440\u044C:11,\u043D\u043E\u044F\u0431\u0440\u044F:11,\u043D\u043E\u044F\u0431\u0440\u0435:11,\u0434\u0435\u043A\u0430\u0431\u0440\u044C:12,\u0434\u0435\u043A\u0430\u0431\u0440\u044F:12,\u0434\u0435\u043A\u0430\u0431\u0440\u0435:12},mk={...UH,\u044F\u043D\u0432:1,"\u044F\u043D\u0432.":1,\u0444\u0435\u0432:2,"\u0444\u0435\u0432.":2,\u043C\u0430\u0440:3,"\u043C\u0430\u0440.":3,\u0430\u043F\u0440:4,"\u0430\u043F\u0440.":4,\u0430\u0432\u0433:8,"\u0430\u0432\u0433.":8,\u0441\u0435\u043D:9,"\u0441\u0435\u043D.":9,\u043E\u043A\u0442:10,"\u043E\u043A\u0442.":10,\u043D\u043E\u044F:11,"\u043D\u043E\u044F.":11,\u0434\u0435\u043A:12,"\u0434\u0435\u043A.":12},jH={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0439:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0435:2,\u0434\u0432\u0430:2,\u0434\u0432\u0443\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u0435\u0445:3,\u0442\u0440\u0451\u0445:3,\u0447\u0435\u0442\u044B\u0440\u0435:4,\u0447\u0435\u0442\u044B\u0440\u0435\u0445:4,\u0447\u0435\u0442\u044B\u0440\u0451\u0445:4,\u043F\u044F\u0442\u044C:5,\u043F\u044F\u0442\u0438:5,\u0448\u0435\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0435\u043C\u044C:7,\u0441\u0435\u043C\u0438:7,\u0432\u043E\u0441\u0435\u043C\u044C:8,\u0432\u043E\u0441\u044C\u043C\u0438:8,\u0434\u0435\u0432\u044F\u0442\u044C:9,\u0434\u0435\u0432\u044F\u0442\u0438:9,\u0434\u0435\u0441\u044F\u0442\u044C:10,\u0434\u0435\u0441\u044F\u0442\u0438:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u044C:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u0438:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u044C:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u0438:12},$H={\u043F\u0435\u0440\u0432\u043E\u0435:1,\u043F\u0435\u0440\u0432\u043E\u0433\u043E:1,\u0432\u0442\u043E\u0440\u043E\u0435:2,\u0432\u0442\u043E\u0440\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u044C\u0435:3,\u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,\u043F\u044F\u0442\u043E\u0435:5,\u043F\u044F\u0442\u043E\u0433\u043E:5,\u0448\u0435\u0441\u0442\u043E\u0435:6,\u0448\u0435\u0441\u0442\u043E\u0433\u043E:6,\u0441\u0435\u0434\u044C\u043C\u043E\u0435:7,\u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u043E\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,\u0434\u0435\u0432\u044F\u0442\u043E\u0435:9,\u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E:9,\u0434\u0435\u0441\u044F\u0442\u043E\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:11,\u043E\u0434\u0438\u043D\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:12,\u0434\u0432\u0435\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:13,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:14,\u0447\u0435\u0442\u044B\u0440\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:14,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:15,\u043F\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:15,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:16,\u0448\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:16,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:17,\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:17,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:18,\u0432\u043E\u0441\u0435\u043C\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:18,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0435:19,\u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:19,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0435:20,\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u0442\u043E\u0440\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u0435\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u043F\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0448\u0435\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0441\u0435\u0434\u044C\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044C \u0434\u0435\u0432\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0435:30,\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044C \u043F\u0435\u0440\u0432\u043E\u0433\u043E":31},yC={\u0441\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u044B:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u043C\u0438\u043D:"minute",\u043C\u0438\u043D\u0443\u0442\u0430:"minute",\u043C\u0438\u043D\u0443\u0442:"minute",\u043C\u0438\u043D\u0443\u0442\u044B:"minute",\u043C\u0438\u043D\u0443\u0442\u0443:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043A\u0443:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u0447\u0435\u043A:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u0447\u043A\u0438:"minute",\u043C\u0438\u043D\u0443\u0442\u043E\u0447\u043A\u0443:"minute",\u0447\u0430\u0441:"hour",\u0447\u0430\u0441\u043E\u0432:"hour",\u0447\u0430\u0441\u0430:"hour",\u0447\u0430\u0441\u0443:"hour",\u0447\u0430\u0441\u0438\u043A\u043E\u0432:"hour",\u0447\u0430\u0441\u0438\u043A\u0430:"hour",\u0447\u0430\u0441\u0438\u043A\u0435:"hour",\u0447\u0430\u0441\u0438\u043A:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0435\u0439:"d",\u0441\u0443\u0442\u043E\u043A:"d",\u0441\u0443\u0442\u043A\u0438:"d",\u043D\u0435\u0434\u0435\u043B\u044F:"week",\u043D\u0435\u0434\u0435\u043B\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u044E:"week",\u043D\u0435\u0434\u0435\u043B\u044C:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0435:"week",\u043D\u0435\u0434\u0435\u043B\u044C\u043A\u0438:"week",\u043D\u0435\u0434\u0435\u043B\u0435\u043A:"week",\u043C\u0435\u0441\u044F\u0446:"month",\u043C\u0435\u0441\u044F\u0446\u0435:"month",\u043C\u0435\u0441\u044F\u0446\u0435\u0432:"month",\u043C\u0435\u0441\u044F\u0446\u0430:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0435:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u043E\u0432:"quarter",\u0433\u043E\u0434:"year",\u0433\u043E\u0434\u0430:"year",\u0433\u043E\u0434\u0443:"year",\u0433\u043E\u0434\u043E\u0432:"year",\u043B\u0435\u0442:"year",\u0433\u043E\u0434\u0438\u043A:"year",\u0433\u043E\u0434\u0438\u043A\u0430:"year",\u0433\u043E\u0434\u0438\u043A\u043E\u0432:"year"},Snt=`(?:${oe(jH)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u043E\u043B|\u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E|\u043F\u0430\u0440(?:\u044B|\u0443)|\\s{0,3})`;HH=`(?:${oe($H)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435|\u043E\u0435)?)`;zH="(?:\\s+(?:\u0433\u043E\u0434\u0443|\u0433\u043E\u0434\u0430|\u0433\u043E\u0434|\u0433|\u0433.))?",SI=`(?:[1-9][0-9]{0,3}${zH}\\s*(?:\u043D.\u044D.|\u0434\u043E \u043D.\u044D.|\u043D. \u044D.|\u0434\u043E \u043D. \u044D.)|[1-2][0-9]{3}${zH}|[5-9][0-9]${zH})`;tke=`(${Snt})\\s{0,3}(${oe(yC)})`,eke=new RegExp(tke,"i"),fk=zi("(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s{0,3})?",tke)});var rke,vC,nke=y(()=>{eo();pt();xe();rke=`(?:(?:\u043E\u043A\u043E\u043B\u043E|\u043F\u0440\u0438\u043C\u0435\u0440\u043D\u043E)\\s*(?:~\\s*)?)?(${fk})${Xs.rightBoundary}`,vC=class extends q{patternLeftBoundary(){return Xs.leftBoundary}innerPattern(e){return e.option.forwardDate?new RegExp(rke,Xs.flags):new RegExp(`(?:\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0435|\u0432 \u0442\u0435\u0447\u0435\u043D\u0438\u0438)\\s*${rke}`,Xs.flags)}innerExtract(e,t){let n=hk(t[1]);return te.createRelativeFromReference(e.reference,n)}}});var tg,us,Fu=y(()=>{xe();eo();tg=class extends q{patternLeftBoundary(){return Xs.leftBoundary}innerPattern(e){return new RegExp(this.innerPatternString(e),Xs.flags)}innerPatternHasChange(e,t){return!1}},us=class extends tg{innerPattern(e){return new RegExp(`${this.innerPatternString(e)}${Xs.rightBoundary}`,Xs.flags)}}});var ake,ike,Ent,ske,kC,oke=y(()=>{Rn();eo();eo();eo();Ot();Fu();ake=1,ike=2,Ent=3,ske=4,kC=class extends us{innerPatternString(e){return`(?:\u0441)?\\s*(${HH})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${HH}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${oe(mk)})(?:(?:-|\\/|,?\\s{0,3})(${SI}(?![^\\s]\\d)))?`}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),a=mk[t[Ent].toLowerCase()],i=VH(t[ake]);if(i>31)return t.index=t.index+t[ake].length,null;if(n.start.assign("month",a),n.start.assign("day",i),t[ske]){let s=xI(t[ske]);n.start.assign("year",s)}else{let s=fr(e.refDate,i,a);n.start.imply("year",s)}if(t[ike]){let s=VH(t[ike]);n.end=n.start.clone(),n.end.assign("day",s)}return n}}});var Dnt,lke,bC,cke=y(()=>{eo();Rn();Ot();eo();Fu();Dnt=2,lke=3,bC=class extends tg{innerPatternString(e){return`((?:\u0432)\\s*)?(${oe(mk)})\\s*(?:[,-]?\\s*(${SI})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`}innerExtract(e,t){let n=t[Dnt].toLowerCase();if(t[0].length<=3&&!UH[n])return null;let a=e.createParsingResult(t.index,t.index+t[0].length);a.start.imply("day",1);let i=mk[n];if(a.start.assign("month",i),t[lke]){let s=xI(t[lke]);a.start.assign("year",s)}else{let s=fr(e.refDate,1,i);a.start.imply("year",s)}return a}}});var TC,dke=y(()=>{Ht();Au();eo();TC=class extends Da{constructor(e){super(e)}patternFlags(){return Xs.flags}primaryPatternLeftBoundary(){return"(^|\\s|T|(?:[^\\p{L}\\p{N}_]))"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|\u0434\u043E|\u0438|\u043F\u043E|\\?)\\s*"}primaryPrefix(){return"(?:(?:\u0432|\u0441)\\s*)??"}primarySuffix(){return`(?:\\s*(?:\u0443\u0442\u0440\u0430|\u0432\u0435\u0447\u0435\u0440\u0430|\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F))?(?!\\/)${Xs.rightBoundary}`}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("\u0432\u0435\u0447\u0435\u0440\u0430")){let a=n.get("hour");a>=6&&a<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",H.PM)):a<6&&n.assign("meridiem",H.AM)}if(t[0].endsWith("\u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043B\u0443\u0434\u043D\u044F")){n.assign("meridiem",H.PM);let a=n.get("hour");a>=0&&a<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0443\u0442\u0440\u0430")&&(n.assign("meridiem",H.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}}});var wC,uke=y(()=>{eo();pt();Qs();Fu();wC=class extends tg{innerPatternString(e){return`(${fk})\\s{0,5}\u043D\u0430\u0437\u0430\u0434(?=(?:\\W|$))`}innerExtract(e,t){let n=hk(t[1]),a=ea(n);return te.createRelativeFromReference(e.reference,a)}}});var SC,pke=y(()=>{Fo();SC=class extends an{patternBetween(){return/^\s*(и до|и по|до|по|-)\s*$/i}}});var xC,mke=y(()=>{Oo();xC=class extends sn{patternBetween(){return new RegExp("^\\s*(T|\u0432|,|-)?\\s*$")}}});var CC,fke=y(()=>{Zs();Fu();CC=class extends us{innerPatternString(e){return"(?:\u0441|\u0441\u043E)?\\s*(\u0441\u0435\u0433\u043E\u0434\u043D\u044F|\u0432\u0447\u0435\u0440\u0430|\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0441\u043B\u0435\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430)"}innerExtract(e,t){let n=t[1].toLowerCase(),a=e.createParsingComponents();switch(n){case"\u0441\u0435\u0433\u043E\u0434\u043D\u044F":return Pa(e.reference);case"\u0432\u0447\u0435\u0440\u0430":return ui(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return pi(e.reference);case"\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return Rc(e.reference,2);case"\u043F\u043E\u0441\u043B\u0435\u043F\u043E\u0441\u043B\u0435\u0437\u0430\u0432\u0442\u0440\u0430":return Rc(e.reference,3);case"\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return Lh(e.reference,2);case"\u043F\u043E\u0437\u0430\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430":return Lh(e.reference,3)}return a}}});var hke,EC,gke=y(()=>{Zs();Gs();hke=st(tr(),1);Fu();EC=class extends us{innerPatternString(e){return"(\u0441\u0435\u0439\u0447\u0430\u0441|\u043F\u0440\u043E\u0448\u043B\u044B\u043C\\s*\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u043F\u0440\u043E\u0448\u043B\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u0441\u0435\u0433\u043E\u0434\u043D\u044F\\s*\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u043E\u0439\\s*\u043D\u043E\u0447\u044C\u044E|\u043D\u043E\u0447\u044C\u044E|\u044D\u0442\u0438\u043C \u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u043E\u043C|\u0443\u0442\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440\u043E\u043C|\u0432\u0435\u0447\u0435\u0440\u0430|\u0432\\s*\u043F\u043E\u043B\u043D\u043E\u0447\u044C)"}innerExtract(e,t){let n=(0,hke.default)(e.refDate),a=t[0].toLowerCase(),i=e.createParsingComponents();if(a==="\u0441\u0435\u0439\u0447\u0430\u0441")return di(e.reference);if(a==="\u0432\u0435\u0447\u0435\u0440\u043E\u043C"||a==="\u0432\u0435\u0447\u0435\u0440\u0430")return Xv(e.reference);if(a.endsWith("\u0443\u0442\u0440\u043E\u043C")||a.endsWith("\u0443\u0442\u0440\u0430"))return ek(e.reference);if(a.match(/в\s*полдень/))return tk(e.reference);if(a.match(/прошлой\s*ночью/))return G_(e.reference);if(a.match(/прошлым\s*вечером/))return K_(e.reference);if(a.match(/следующей\s*ночью/)){let s=n.hour()<22?1:2;n=n.add(s,"day"),Kr(i,n),i.imply("hour",0)}return a.match(/в\s*полночь/)||a.endsWith("\u043D\u043E\u0447\u044C\u044E")?zh(e.reference):i}}});var Pnt,Mnt,Ant,DC,yke=y(()=>{eo();Ot();jl();Fu();Pnt=1,Mnt=2,Ant=3,DC=class extends us{innerPatternString(e){return`(?:(?:,|\\(|\uFF08)\\s*)?(?:\u0432\\s*?)?(?:(\u044D\u0442\u0443|\u044D\u0442\u043E\u0442|\u043F\u0440\u043E\u0448\u043B\u044B\u0439|\u043F\u0440\u043E\u0448\u043B\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E)\\s*)?(${oe(BH)})(?:\\s*(?:,|\\)|\uFF09))?(?:\\s*\u043D\u0430\\s*(\u044D\u0442\u043E\u0439|\u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439)\\s*\u043D\u0435\u0434\u0435\u043B\u0435)?`}innerExtract(e,t){let n=t[Mnt].toLowerCase(),a=BH[n],i=t[Pnt],s=t[Ant],o=i||s;o=o||"",o=o.toLowerCase();let l=null;return o=="\u043F\u0440\u043E\u0448\u043B\u044B\u0439"||o=="\u043F\u0440\u043E\u0448\u043B\u0443\u044E"||o=="\u043F\u0440\u043E\u0448\u043B\u043E\u0439"?l="last":o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||o=="\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E"?l="next":(o=="\u044D\u0442\u043E\u0442"||o=="\u044D\u0442\u0443"||o=="\u044D\u0442\u043E\u0439")&&(l="this"),ta(e.reference,a,l)}}});var vke,_nt,Int,PC,kke=y(()=>{eo();pt();vke=st(tr(),1);Ot();Fu();_nt=1,Int=2,PC=class extends us{innerPatternString(e){return`(\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C|\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439|\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439|\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C|\u043D\u0430 \u044D\u0442\u043E\u0439|\u0432 \u044D\u0442\u043E\u043C)\\s*(${oe(yC)})`}innerExtract(e,t){let n=t[_nt].toLowerCase(),a=t[Int].toLowerCase(),i=yC[a];if(n=="\u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439"||n=="\u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C"){let l={};return l[i]=1,te.createRelativeFromReference(e.reference,l)}if(n=="\u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C"||n=="\u043D\u0430 \u043F\u0440\u043E\u0448\u043B\u043E\u0439"){let l={};return l[i]=-1,te.createRelativeFromReference(e.reference,l)}let s=e.createParsingComponents(),o=(0,vke.default)(e.reference.instant);return i.match(/week/i)?(o=o.add(-o.get("d"),"d"),s.imply("day",o.date()),s.imply("month",o.month()+1),s.imply("year",o.year())):i.match(/month/i)?(o=o.add(-o.date()+1,"d"),s.imply("day",o.date()),s.assign("year",o.year()),s.assign("month",o.month()+1)):i.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),s.imply("day",o.date()),s.imply("month",o.month()+1),s.assign("year",o.year())),s}}});var MC,bke=y(()=>{eo();pt();Qs();Fu();MC=class extends us{innerPatternString(e){return`(\u044D\u0442\u0438|\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435|\u043F\u0440\u043E\u0448\u043B\u044B\u0435|\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435|\u043F\u043E\u0441\u043B\u0435|\u0441\u043F\u0443\u0441\u0442\u044F|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${fk})`}innerExtract(e,t){let n=t[1].toLowerCase(),a=hk(t[2]);switch(n){case"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435":case"\u043F\u0440\u043E\u0448\u043B\u044B\u0435":case"-":a=ea(a);break}return te.createRelativeFromReference(e.reference,a)}}});var YH={};at(YH,{Chrono:()=>Be,Meridiem:()=>H,ParsingComponents:()=>te,ParsingResult:()=>Yt,ReferenceWithTimezone:()=>rr,Weekday:()=>Ye,casual:()=>qH,createCasualConfiguration:()=>Tke,createConfiguration:()=>WH,parse:()=>Rnt,parseDate:()=>Fnt,strict:()=>Nnt});function Rnt(r,e,t){return qH.parse(r,e,t)}function Fnt(r,e,t){return qH.parseDate(r,e,t)}function Tke(){let r=WH(!1);return r.parsers.unshift(new CC),r.parsers.unshift(new EC),r.parsers.unshift(new bC),r.parsers.unshift(new PC),r.parsers.unshift(new MC),r}function WH(r=!0){return mn({parsers:[new ua(!0),new vC,new kC,new DC,new TC(r),new wC],refiners:[new xC,new SC]},r)}var qH,Nnt,wke=y(()=>{nke();oke();cke();dke();uke();pke();mke();Ks();fke();gke();yke();kke();ds();pt();Ht();Nu();bke();qH=new Be(Tke()),Nnt=new Be(WH(!0))});function Lnt(r){let e=r.toLowerCase();return GH[e]!==void 0?GH[e]:e==="un"||e==="una"||e==="uno"?1:e.match(/algunos?/)||e.match(/unos?/)?3:e.match(/media?/)?.5:parseFloat(e)}function Eke(r){if(r.match(/^[0-9]{1,4}$/)){let e=parseInt(r);return e<100&&(e>50?e=e+1900:e=e+2e3),e}return r.match(/a\.?\s*c\.?/i)?(r=r.replace(/a\.?\s*c\.?/i,""),-parseInt(r)):parseInt(r)}function Mke(r){let e={},t=r,n=Ske.exec(t);for(;n;)znt(e,n),t=t.substring(n[0].length),n=Ske.exec(t);return e}function znt(r,e){let t=Lnt(e[1]),n=xke[e[2].toLowerCase()];r[n]=t}var KH,ZH,GH,xke,Ont,Cke,Dke,Ske,Pke,AC=y(()=>{Ot();KH={domingo:0,dom:0,lunes:1,lun:1,martes:2,mar:2,mi\u00E9rcoles:3,miercoles:3,mi\u00E9:3,mie:3,jueves:4,jue:4,viernes:5,vie:5,s\u00E1bado:6,sabado:6,s\u00E1b:6,sab:6},ZH={enero:1,ene:1,"ene.":1,febrero:2,feb:2,"feb.":2,marzo:3,mar:3,"mar.":3,abril:4,abr:4,"abr.":4,mayo:5,may:5,"may.":5,junio:6,jun:6,"jun.":6,julio:7,jul:7,"jul.":7,agosto:8,ago:8,"ago.":8,septiembre:9,setiembre:9,sep:9,"sep.":9,octubre:10,oct:10,"oct.":10,noviembre:11,nov:11,"nov.":11,diciembre:12,dic:12,"dic.":12},GH={uno:1,dos:2,tres:3,cuatro:4,cinco:5,seis:6,siete:7,ocho:8,nueve:9,diez:10,once:11,doce:12,trece:13},xke={sec:"second",segundo:"second",segundos:"second",min:"minute",mins:"minute",minuto:"minute",minutos:"minute",h:"hour",hr:"hour",hrs:"hour",hora:"hour",horas:"hour",d\u00EDa:"d",d\u00EDas:"d",semana:"week",semanas:"week",mes:"month",meses:"month",cuarto:"quarter",cuartos:"quarter",a\u00F1o:"year",a\u00F1os:"year"},Ont=`(?:${oe(GH)}|[0-9]+|[0-9]+\\.[0-9]+|un?|uno?|una?|algunos?|unos?|demi-?)`;Cke="[0-9]{1,4}(?![^\\s]\\d)(?:\\s*[a|d]\\.?\\s*c\\.?|\\s*a\\.?\\s*d\\.?)?";Dke=`(${Ont})\\s{0,5}(${oe(xke)})\\s{0,5}`,Ske=new RegExp(Dke,"i"),Pke=zi("",Dke)});var jnt,$nt,Bnt,Unt,_C,Ake=y(()=>{AC();Ot();xe();jl();jnt=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:(este|esta|pasado|pr[o\xF3]ximo)\\s*)?(${oe(KH)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(este|esta|pasado|pr[\xF3o]ximo)\\s*semana)?(?=\\W|\\d|$)`,"i"),$nt=1,Bnt=2,Unt=3,_C=class extends q{innerPattern(){return jnt}innerExtract(e,t){let n=t[Bnt].toLowerCase(),a=KH[n];if(a===void 0)return null;let i=t[$nt],s=t[Unt],o=i||s||"";o=o.toLowerCase();let l=null;return o=="pasado"?l="this":o=="pr\xF3ximo"||o=="proximo"?l="next":o=="este"&&(l="this"),ta(e.reference,a,l)}}});var IC,_ke=y(()=>{Au();IC=class extends Da{primaryPrefix(){return"(?:(?:aslas|deslas|las?|al?|de|del)\\s*)?"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|a(?:l)?|\\?)\\s*"}}});var NC,Ike=y(()=>{Oo();NC=class extends sn{patternBetween(){return new RegExp("^\\s*(?:,|de|aslas|a)?\\s*$")}}});var RC,Nke=y(()=>{Fo();RC=class extends an{patternBetween(){return/^\s*(?:-)\s*$/i}}});var Hnt,Rke,Fke,Vnt,Oke,FC,Lke=y(()=>{Rn();AC();AC();Ot();xe();Hnt=new RegExp(`([0-9]{1,2})(?:\xBA|\xAA|\xB0)?(?:\\s*(?:desde|de|\\-|\\\u2013|ao?|\\s)\\s*([0-9]{1,2})(?:\xBA|\xAA|\xB0)?)?\\s*(?:de)?\\s*(?:-|/|\\s*(?:de|,)?\\s*)(${oe(ZH)})(?:\\s*(?:de|,)?\\s*(${Cke}))?(?=\\W|$)`,"i"),Rke=1,Fke=2,Vnt=3,Oke=4,FC=class extends q{innerPattern(){return Hnt}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),a=ZH[t[Vnt].toLowerCase()],i=parseInt(t[Rke]);if(i>31)return t.index=t.index+t[Rke].length,null;if(n.start.assign("month",a),n.start.assign("day",i),t[Oke]){let s=Eke(t[Oke]);n.start.assign("year",s)}else{let s=fr(e.refDate,i,a);n.start.imply("year",s)}if(t[Fke]){let s=parseInt(t[Fke]);n.end=n.start.clone(),n.end.assign("day",s)}return n}}});var OC,zke=y(()=>{xe();Zs();OC=class extends q{innerPattern(e){return/(ahora|hoy|mañana|ayer)(?=\W|$)/i}innerExtract(e,t){let n=t[0].toLowerCase(),a=e.createParsingComponents();switch(n){case"ahora":return di(e.reference);case"hoy":return Pa(e.reference);case"ma\xF1ana":return pi(e.reference);case"ayer":return ui(e.reference)}return a}}});var jke,LC,$ke=y(()=>{Ht();xe();Gs();jke=st(tr(),1),LC=class extends q{innerPattern(){return/(?:esta\s*)?(mañana|tarde|medianoche|mediodia|mediodía|noche)(?=\W|$)/i}innerExtract(e,t){let n=(0,jke.default)(e.refDate),a=e.createParsingComponents();switch(t[1].toLowerCase()){case"tarde":a.imply("meridiem",H.PM),a.imply("hour",15);break;case"noche":a.imply("meridiem",H.PM),a.imply("hour",22);break;case"ma\xF1ana":a.imply("meridiem",H.AM),a.imply("hour",6);break;case"medianoche":Ll(a,n),a.imply("hour",0),a.imply("minute",0),a.imply("second",0);break;case"mediodia":case"mediod\xEDa":a.imply("meridiem",H.AM),a.imply("hour",12);break}return a}}});var zC,Bke=y(()=>{AC();pt();xe();zC=class extends q{innerPattern(){return new RegExp(`(?:en|por|durante|de|dentro de)\\s*(${Pke})(?=\\W|$)`,"i")}innerExtract(e,t){let n=Mke(t[1]);return te.createRelativeFromReference(e.reference,n)}}});var XH={};at(XH,{Chrono:()=>Be,Meridiem:()=>H,ParsingComponents:()=>te,ParsingResult:()=>Yt,ReferenceWithTimezone:()=>rr,Weekday:()=>Ye,casual:()=>QH,createCasualConfiguration:()=>Uke,createConfiguration:()=>JH,parse:()=>Wnt,parseDate:()=>Ynt,strict:()=>qnt});function Wnt(r,e,t){return QH.parse(r,e,t)}function Ynt(r,e,t){return QH.parseDate(r,e,t)}function Uke(r=!0){let e=JH(!1,r);return e.parsers.push(new OC),e.parsers.push(new LC),e}function JH(r=!0,e=!0){return mn({parsers:[new ua(e),new _C,new IC,new FC,new zC],refiners:[new NC,new RC]},r)}var QH,qnt,Hke=y(()=>{Ks();ds();pt();Ht();Nu();Ake();_ke();Ike();Nke();Lke();zke();$ke();Bke();QH=new Be(Uke()),qnt=new Be(JH(!0))});function Knt(r){let e=r.toLowerCase();return tV[e]!==void 0?tV[e]:e.match(/декілька/)?2:e.match(/пів/)?.5:e.match(/пар/)?2:e===""?1:parseFloat(e)}function sV(r){let e=r.toLowerCase();return rV[e]!==void 0?rV[e]:parseInt(e)}function EI(r){if(/(рік|року|р|р.)/i.test(r)&&(r=r.replace(/(рік|року|р|р.)/i,"")),/(до н.е.|до н. е.)/i.test(r))return r=r.replace(/(до н.е.|до н. е.)/i,""),-parseInt(r);if(/(н. е.|н.е.)/i.test(r))return r=r.replace(/(н. е.|н.е.)/i,""),parseInt(r);let e=parseInt(r);return ls(e)}function vk(r){let e={},t=r,n=Vke.exec(t);for(;n;)Znt(e,n),t=t.substring(n[0].length).trim(),n=Vke.exec(t);return e}function Znt(r,e){let t=Knt(e[1]),n=jC[e[2].toLowerCase()];r[n]=t}var Uo,nV,aV,gk,tV,rV,jC,Gnt,iV,eV,CI,qke,Vke,yk,to=y(()=>{Ot();Rn();Uo={leftBoundary:"([^\\p{L}\\p{N}_]|^)",rightBoundary:"(?=[^\\p{L}\\p{N}_]|$)",flags:"iu"},nV={\u043D\u0435\u0434\u0456\u043B\u044F:0,\u043D\u0435\u0434\u0456\u043B\u0456:0,\u043D\u0435\u0434\u0456\u043B\u044E:0,\u043D\u0434:0,"\u043D\u0434.":0,\u043F\u043E\u043D\u0435\u0434\u0456\u043B\u043E\u043A:1,\u043F\u043E\u043D\u0435\u0434\u0456\u043B\u043A\u0430:1,\u043F\u043D:1,"\u043F\u043D.":1,\u0432\u0456\u0432\u0442\u043E\u0440\u043E\u043A:2,\u0432\u0456\u0432\u0442\u043E\u0440\u043A\u0430:2,\u0432\u0442:2,"\u0432\u0442.":2,\u0441\u0435\u0440\u0435\u0434\u0430:3,\u0441\u0435\u0440\u0435\u0434\u0438:3,\u0441\u0435\u0440\u0435\u0434\u0443:3,\u0441\u0440:3,"\u0441\u0440.":3,\u0447\u0435\u0442\u0432\u0435\u0440:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0443:4,\u0447\u0442:4,"\u0447\u0442.":4,"\u043F'\u044F\u0442\u043D\u0438\u0446\u044F":5,"\u043F'\u044F\u0442\u043D\u0438\u0446\u0456":5,"\u043F'\u044F\u0442\u043D\u0438\u0446\u044E":5,\u043F\u0442:5,"\u043F\u0442.":5,\u0441\u0443\u0431\u043E\u0442\u0430:6,\u0441\u0443\u0431\u043E\u0442\u0438:6,\u0441\u0443\u0431\u043E\u0442\u0443:6,\u0441\u0431:6,"\u0441\u0431.":6},aV={\u0441\u0456\u0447\u0435\u043D\u044C:1,\u0441\u0456\u0447\u043D\u044F:1,\u0441\u0456\u0447\u043D\u0456:1,\u043B\u044E\u0442\u0438\u0439:2,\u043B\u044E\u0442\u043E\u0433\u043E:2,\u043B\u044E\u0442\u043E\u043C\u0443:2,\u0431\u0435\u0440\u0435\u0437\u0435\u043D\u044C:3,\u0431\u0435\u0440\u0435\u0437\u043D\u044F:3,\u0431\u0435\u0440\u0435\u0437\u043D\u0456:3,\u043A\u0432\u0456\u0442\u0435\u043D\u044C:4,\u043A\u0432\u0456\u0442\u043D\u044F:4,\u043A\u0432\u0456\u0442\u043D\u0456:4,\u0442\u0440\u0430\u0432\u0435\u043D\u044C:5,\u0442\u0440\u0430\u0432\u043D\u044F:5,\u0442\u0440\u0430\u0432\u043D\u0456:5,\u0447\u0435\u0440\u0432\u0435\u043D\u044C:6,\u0447\u0435\u0440\u0432\u043D\u044F:6,\u0447\u0435\u0440\u0432\u043D\u0456:6,\u043B\u0438\u043F\u0435\u043D\u044C:7,\u043B\u0438\u043F\u043D\u044F:7,\u043B\u0438\u043F\u043D\u0456:7,\u0441\u0435\u0440\u043F\u0435\u043D\u044C:8,\u0441\u0435\u0440\u043F\u043D\u044F:8,\u0441\u0435\u0440\u043F\u043D\u0456:8,\u0432\u0435\u0440\u0435\u0441\u0435\u043D\u044C:9,\u0432\u0435\u0440\u0435\u0441\u043D\u044F:9,\u0432\u0435\u0440\u0435\u0441\u043D\u0456:9,\u0436\u043E\u0432\u0442\u0435\u043D\u044C:10,\u0436\u043E\u0432\u0442\u043D\u044F:10,\u0436\u043E\u0432\u0442\u043D\u0456:10,\u043B\u0438\u0441\u0442\u043E\u043F\u0430\u0434:11,\u043B\u0438\u0441\u0442\u043E\u043F\u0430\u0434\u0430:11,\u043B\u0438\u0441\u0442\u043E\u043F\u0430\u0434\u0443:11,\u0433\u0440\u0443\u0434\u0435\u043D\u044C:12,\u0433\u0440\u0443\u0434\u043D\u044F:12,\u0433\u0440\u0443\u0434\u043D\u0456:12},gk={...aV,\u0441\u0456\u0447:1,"\u0441\u0456\u0447.":1,\u043B\u044E\u0442:2,"\u043B\u044E\u0442.":2,\u0431\u0435\u0440:3,"\u0431\u0435\u0440.":3,\u043A\u0432\u0456\u0442:4,"\u043A\u0432\u0456\u0442.":4,\u0442\u0440\u0430\u0432:5,"\u0442\u0440\u0430\u0432.":5,\u0447\u0435\u0440\u0432:6,"\u0447\u0435\u0440\u0432.":6,\u043B\u0438\u043F:7,"\u043B\u0438\u043F.":7,\u0441\u0435\u0440\u043F:8,"\u0441\u0435\u0440\u043F.":8,\u0441\u0435\u0440:8,"c\u0435\u0440.":8,\u0432\u0435\u0440:9,"\u0432\u0435\u0440.":9,\u0432\u0435\u0440\u0435\u0441:9,"\u0432\u0435\u0440\u0435\u0441.":9,\u0436\u043E\u0432\u0442:10,"\u0436\u043E\u0432\u0442.":10,\u043B\u0438\u0441\u0442\u043E\u043F:11,"\u043B\u0438\u0441\u0442\u043E\u043F.":11,\u0433\u0440\u0443\u0434:12,"\u0433\u0440\u0443\u0434.":12},tV={\u043E\u0434\u0438\u043D:1,\u043E\u0434\u043D\u0430:1,\u043E\u0434\u043D\u043E\u0457:1,\u043E\u0434\u043D\u0443:1,\u0434\u0432\u0456:2,\u0434\u0432\u0430:2,\u0434\u0432\u043E\u0445:2,\u0442\u0440\u0438:3,\u0442\u0440\u044C\u043E\u0445:3,\u0447\u043E\u0442\u0438\u0440\u0438:4,\u0447\u043E\u0442\u0438\u0440\u044C\u043E\u0445:4,"\u043F'\u044F\u0442\u044C":5,"\u043F'\u044F\u0442\u0438":5,\u0448\u0456\u0441\u0442\u044C:6,\u0448\u0435\u0441\u0442\u0438:6,\u0441\u0456\u043C:7,\u0441\u0435\u043C\u0438:7,\u0432\u0456\u0441\u0456\u043C:8,\u0432\u043E\u0441\u044C\u043C\u0438:8,"\u0434\u0435\u0432'\u044F\u0442\u044C":9,"\u0434\u0435\u0432'\u044F\u0442\u0438":9,\u0434\u0435\u0441\u044F\u0442\u044C:10,\u0434\u0435\u0441\u044F\u0442\u0438:10,\u043E\u0434\u0438\u043D\u0430\u0434\u0446\u044F\u0442\u044C:11,\u043E\u0434\u0438\u043D\u0430\u0434\u0446\u044F\u0442\u0438:11,\u0434\u0432\u0430\u043D\u0430\u0434\u0446\u044F\u0442\u044C:12,\u0434\u0432\u0430\u043D\u0430\u0434\u0446\u044F\u0442\u0438:12},rV={\u043F\u0435\u0440\u0448\u0435:1,\u043F\u0435\u0440\u0448\u043E\u0433\u043E:1,\u0434\u0440\u0443\u0433\u0435:2,\u0434\u0440\u0443\u0433\u043E\u0433\u043E:2,\u0442\u0440\u0435\u0442\u0454:3,\u0442\u0440\u0435\u0442\u044C\u043E\u0433\u043E:3,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0435:4,\u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E:4,"\u043F'\u044F\u0442\u0435":5,"\u043F'\u044F\u0442\u043E\u0433\u043E":5,\u0448\u043E\u0441\u0442\u0435:6,\u0448\u043E\u0441\u0442\u043E\u0433\u043E:6,\u0441\u044C\u043E\u043C\u0435:7,\u0441\u044C\u043E\u043C\u043E\u0433\u043E:7,\u0432\u043E\u0441\u044C\u043C\u0435:8,\u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E:8,"\u0434\u0435\u0432'\u044F\u0442\u0435":9,"\u0434\u0435\u0432'\u044F\u0442\u043E\u0433\u043E":9,\u0434\u0435\u0441\u044F\u0442\u0435:10,\u0434\u0435\u0441\u044F\u0442\u043E\u0433\u043E:10,\u043E\u0434\u0438\u043D\u0430\u0434\u0446\u044F\u0442\u0435:11,\u043E\u0434\u0438\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:11,\u0434\u0432\u0430\u043D\u0430\u0434\u0446\u044F\u0442\u0435:12,\u0434\u0432\u0430\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:12,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u044F\u0442\u0435:13,\u0442\u0440\u0438\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:13,\u0447\u043E\u0442\u0438\u0440\u043D\u0430\u0434\u0446\u044F\u0442\u0435:14,\u0447\u043E\u0442\u0438\u043D\u0440\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:14,"\u043F'\u044F\u0442\u043D\u0430\u0434\u0446\u044F\u0442\u0435":15,"\u043F'\u044F\u0442\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E":15,\u0448\u0456\u0441\u0442\u043D\u0430\u0434\u0446\u044F\u0442\u0435:16,\u0448\u0456\u0441\u0442\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:16,\u0441\u0456\u043C\u043D\u0430\u0434\u0446\u044F\u0442\u0435:17,\u0441\u0456\u043C\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:17,\u0432\u0456\u0441\u0456\u043C\u043D\u0430\u0434\u0446\u044F\u0442\u0435:18,\u0432\u0456\u0441\u0456\u043C\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:18,"\u0434\u0435\u0432'\u044F\u0442\u043D\u0430\u0434\u0446\u044F\u0442\u0435":19,"\u0434\u0435\u0432'\u044F\u0442\u043D\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E":19,\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u0435:20,\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u043E\u0433\u043E:20,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u043F\u0435\u0440\u0448\u0435":21,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u043F\u0435\u0440\u0448\u043E\u0433\u043E":21,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0434\u0440\u0443\u0433\u0435":22,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0434\u0440\u0443\u0433\u043E\u0433\u043E":22,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0442\u0440\u0435\u0442\u0454":23,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0442\u0440\u0435\u0442\u044C\u043E\u0433\u043E":23,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0435":24,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043E\u0433\u043E":24,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u043F'\u044F\u0442\u0435":25,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u043F'\u044F\u0442\u043E\u0433\u043E":25,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0448\u043E\u0441\u0442\u0435":26,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0448\u043E\u0441\u0442\u043E\u0433\u043E":26,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0441\u044C\u043E\u043C\u0435":27,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0441\u044C\u043E\u043C\u043E\u0433\u043E":27,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u0435":28,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0432\u043E\u0441\u044C\u043C\u043E\u0433\u043E":28,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0434\u0435\u0432'\u044F\u0442\u0435":29,"\u0434\u0432\u0430\u0434\u0446\u044F\u0442\u044C \u0434\u0435\u0432'\u044F\u0442\u043E\u0433\u043E":29,\u0442\u0440\u0438\u0434\u0446\u044F\u0442\u0435:30,\u0442\u0440\u0438\u0434\u0446\u044F\u0442\u043E\u0433\u043E:30,"\u0442\u0440\u0438\u0434\u0446\u044F\u0442\u044C \u043F\u0435\u0440\u0448\u0435":31,"\u0442\u0440\u0438\u0434\u0446\u044F\u0442\u044C \u043F\u0435\u0440\u0448\u043E\u0433\u043E":31},jC={\u0441\u0435\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0430:"second",\u0441\u0435\u043A\u0443\u043D\u0434:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u0443:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043E\u043A:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0438:"second",\u0441\u0435\u043A\u0443\u043D\u0434\u043E\u0447\u043A\u0443:"second",\u0445\u0432:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u0430:"minute",\u0445\u0432\u0438\u043B\u0438\u043D:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u0438:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u0443:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u043E\u043A:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u043A\u0438:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u043A\u0443:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u043E\u0447\u043E\u043A:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u043E\u0447\u043A\u0438:"minute",\u0445\u0432\u0438\u043B\u0438\u043D\u043E\u0447\u043A\u0443:"minute",\u0433\u043E\u0434:"hour",\u0433\u043E\u0434\u0438\u043D\u0430:"hour",\u0433\u043E\u0434\u0438\u043D:"hour",\u0433\u043E\u0434\u0438\u043D\u0438:"hour",\u0433\u043E\u0434\u0438\u043D\u0443:"hour",\u0433\u043E\u0434\u0438\u043D\u043A\u0430:"hour",\u0433\u043E\u0434\u0438\u043D\u043E\u043A:"hour",\u0433\u043E\u0434\u0438\u043D\u043A\u0438:"hour",\u0433\u043E\u0434\u0438\u043D\u043A\u0443:"hour",\u0434\u0435\u043D\u044C:"d",\u0434\u043D\u044F:"d",\u0434\u043D\u0456\u0432:"d",\u0434\u043D\u0456:"d",\u0434\u043E\u0431\u0430:"d",\u0434\u043E\u0431\u0443:"d",\u0442\u0438\u0436\u0434\u0435\u043D\u044C:"week",\u0442\u0438\u0436\u043D\u044E:"week",\u0442\u0438\u0436\u043D\u044F:"week",\u0442\u0438\u0436\u043D\u0456:"week",\u0442\u0438\u0436\u043D\u0456\u0432:"week",\u043C\u0456\u0441\u044F\u0446\u044C:"month",\u043C\u0456\u0441\u044F\u0446\u0456\u0432:"month",\u043C\u0456\u0441\u044F\u0446\u0456:"month",\u043C\u0456\u0441\u044F\u0446\u044F:"month",\u043A\u0432\u0430\u0440\u0442\u0430\u043B:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0443:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0430:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0456\u0432:"quarter",\u043A\u0432\u0430\u0440\u0442\u0430\u043B\u0456:"quarter",\u0440\u0456\u043A:"year",\u0440\u043E\u043A\u0443:"year",\u0440\u043E\u0446\u0456:"year",\u0440\u043E\u043A\u0456\u0432:"year",\u0440\u043E\u043A\u0438:"year"},Gnt=`(?:${oe(tV)}|[0-9]+|[0-9]+\\.[0-9]+|\u043F\u0456\u0432|\u0434\u0435\u043A\u0456\u043B\u044C\u043A\u0430|\u043F\u0430\u0440(?:\u0443)|\\s{0,3})`;iV=`(?:${oe(rV)}|[0-9]{1,2}(?:\u0433\u043E|\u043E\u0433\u043E|\u0435)?)`;eV="(?:\\s+(?:\u0440\u043E\u043A\u0443|\u0440\u0456\u043A|\u0440|\u0440.))?",CI=`(?:[1-9][0-9]{0,3}${eV}\\s*(?:\u043D.\u0435.|\u0434\u043E \u043D.\u0435.|\u043D. \u0435.|\u0434\u043E \u043D. \u0435.)|[1-2][0-9]{3}${eV}|[5-9][0-9]${eV})`;qke=`(${Gnt})\\s{0,3}(${oe(jC)})`,Vke=new RegExp(qke,"i"),yk=zi("(?:(?:\u0431\u043B\u0438\u0437\u044C\u043A\u043E|\u043F\u0440\u0438\u0431\u043B\u0438\u0437\u043D\u043E)\\s{0,3})?",qke)});var Wke,$C,Yke=y(()=>{to();pt();xe();Wke=`(?:(?:\u043F\u0440\u0438\u0431\u043B\u0438\u0437\u043D\u043E|\u043E\u0440\u0456\u0454\u043D\u0442\u043E\u0432\u043D\u043E)\\s*(?:~\\s*)?)?(${yk})${Uo.rightBoundary}`,$C=class extends q{patternLeftBoundary(){return Uo.leftBoundary}innerPattern(e){return e.option.forwardDate?new RegExp(Wke,"i"):new RegExp(`(?:\u043F\u0440\u043E\u0442\u044F\u0433\u043E\u043C|\u043D\u0430 \u043F\u0440\u043E\u0442\u044F\u0437\u0456|\u043F\u0440\u043E\u0442\u044F\u0433\u043E\u043C|\u0443\u043F\u0440\u043E\u0434\u043E\u0432\u0436|\u0432\u043F\u0440\u043E\u0434\u043E\u0432\u0436)\\s*${Wke}`,Uo.flags)}innerExtract(e,t){let n=vk(t[1]);return te.createRelativeFromReference(e.reference,n)}}});var rg,ps,Ou=y(()=>{xe();to();rg=class extends q{patternLeftBoundary(){return Uo.leftBoundary}innerPattern(e){return new RegExp(this.innerPatternString(e),Uo.flags)}innerPatternHasChange(e,t){return!1}},ps=class extends rg{innerPattern(e){return new RegExp(`${this.innerPatternString(e)}${Uo.rightBoundary}`,Uo.flags)}}});var Gke,Kke,Qnt,Zke,BC,Qke=y(()=>{Rn();to();to();to();Ot();Ou();Gke=1,Kke=2,Qnt=3,Zke=4,BC=class extends ps{innerPatternString(e){return`(?:\u0437|\u0456\u0437)?\\s*(${iV})(?:\\s{0,3}(?:\u043F\u043E|-|\u2013|\u0434\u043E)?\\s{0,3}(${iV}))?(?:-|\\/|\\s{0,3}(?:of)?\\s{0,3})(${oe(gk)})(?:(?:-|\\/|,?\\s{0,3})(${CI}(?![^\\s]\\d)))?`}innerExtract(e,t){let n=e.createParsingResult(t.index,t[0]),a=gk[t[Qnt].toLowerCase()],i=sV(t[Gke]);if(i>31)return t.index=t.index+t[Gke].length,null;if(n.start.assign("month",a),n.start.assign("day",i),t[Zke]){let s=EI(t[Zke]);n.start.assign("year",s)}else{let s=fr(e.reference.instant,i,a);n.start.imply("year",s)}if(t[Kke]){let s=sV(t[Kke]);n.end=n.start.clone(),n.end.assign("day",s)}return n}}});var Jnt,Jke,UC,Xke=y(()=>{to();Rn();Ot();to();Ou();Jnt=2,Jke=3,UC=class extends rg{innerPatternString(e){return`((?:\u0432|\u0443)\\s*)?(${oe(gk)})\\s*(?:[,-]?\\s*(${CI})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`}innerExtract(e,t){let n=t[Jnt].toLowerCase();if(t[0].length<=3&&!aV[n])return null;let a=e.createParsingResult(t.index,t.index+t[0].length);a.start.imply("day",1);let i=gk[n];if(a.start.assign("month",i),t[Jke]){let s=EI(t[Jke]);a.start.assign("year",s)}else{let s=fr(e.reference.instant,1,i);a.start.imply("year",s)}return a}}});var HC,ebe=y(()=>{Ht();Au();to();HC=class extends Da{constructor(e){super(e)}patternFlags(){return Uo.flags}primaryPatternLeftBoundary(){return"(^|\\s|T|(?:[^\\p{L}\\p{N}_]))"}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|\u0434\u043E|\u0456|\u043F\u043E|\\?)\\s*"}primaryPrefix(){return"(?:(?:\u0432|\u0443|\u043E|\u043E\u0431|\u0437|\u0456\u0437|\u0432\u0456\u0434)\\s*)??"}primarySuffix(){return`(?:\\s*(?:\u0440\u0430\u043D\u043A\u0443|\u0432\u0435\u0447\u043E\u0440\u0430|\u043F\u043E \u043E\u0431\u0456\u0434\u0456|\u043F\u0456\u0441\u043B\u044F \u043E\u0431\u0456\u0434\u0443))?(?!\\/)${Uo.rightBoundary}`}extractPrimaryTimeComponents(e,t){let n=super.extractPrimaryTimeComponents(e,t);if(n){if(t[0].endsWith("\u0432\u0435\u0447\u043E\u0440\u0430")){let a=n.get("hour");a>=6&&a<12?(n.assign("hour",n.get("hour")+12),n.assign("meridiem",H.PM)):a<6&&n.assign("meridiem",H.AM)}if(t[0].endsWith("\u043F\u043E \u043E\u0431\u0456\u0434\u0456")||t[0].endsWith("\u043F\u0456\u0441\u043B\u044F \u043E\u0431\u0456\u0434\u0443")){n.assign("meridiem",H.PM);let a=n.get("hour");a>=0&&a<=6&&n.assign("hour",n.get("hour")+12)}t[0].endsWith("\u0440\u0430\u043D\u043A\u0443")&&(n.assign("meridiem",H.AM),n.get("hour")<12&&n.assign("hour",n.get("hour")))}return n}}});var VC,tbe=y(()=>{to();pt();Qs();Ou();VC=class extends rg{innerPatternString(e){return`(${yk})\\s{0,5}\u0442\u043E\u043C\u0443(?=(?:\\W|$))`}innerExtract(e,t){let n=vk(t[1]),a=ea(n);return te.createRelativeFromReference(e.reference,a)}}});var qC,rbe=y(()=>{Fo();qC=class extends an{patternBetween(){return/^\s*(і до|і по|до|по|-)\s*$/i}}});var WC,nbe=y(()=>{Oo();WC=class extends sn{patternBetween(){return new RegExp("^\\s*(T|\u0432|\u0443|\u043E|,|-)?\\s*$")}}});var YC,abe=y(()=>{Zs();Ou();YC=class extends ps{innerPatternString(e){return"(?:\u0437|\u0456\u0437|\u0432\u0456\u0434)?\\s*(\u0441\u044C\u043E\u0433\u043E\u0434\u043D\u0456|\u0432\u0447\u043E\u0440\u0430|\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u0456\u0441\u043B\u044F\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u0456\u0441\u043B\u044F\u043F\u0456\u0441\u043B\u044F\u0437\u0430\u0432\u0442\u0440\u0430|\u043F\u043E\u0437\u0430\u043F\u043E\u0437\u0430\u0432\u0447\u043E\u0440\u0430|\u043F\u043E\u0437\u0430\u0432\u0447\u043E\u0440\u0430)"}innerExtract(e,t){let n=t[1].toLowerCase(),a=e.createParsingComponents();switch(n){case"\u0441\u044C\u043E\u0433\u043E\u0434\u043D\u0456":return Pa(e.reference);case"\u0432\u0447\u043E\u0440\u0430":return ui(e.reference);case"\u0437\u0430\u0432\u0442\u0440\u0430":return pi(e.reference);case"\u043F\u0456\u0441\u043B\u044F\u0437\u0430\u0432\u0442\u0440\u0430":return Rc(e.reference,2);case"\u043F\u0456\u0441\u043B\u044F\u043F\u0456\u0441\u043B\u044F\u0437\u0430\u0432\u0442\u0440\u0430":return Rc(e.reference,3);case"\u043F\u043E\u0437\u0430\u0432\u0447\u043E\u0440\u0430":return Lh(e.reference,2);case"\u043F\u043E\u0437\u0430\u043F\u043E\u0437\u0430\u0432\u0447\u043E\u0440\u0430":return Lh(e.reference,3)}return a}}});var ibe,GC,sbe=y(()=>{Zs();Gs();ibe=st(tr(),1);Ou();GC=class extends ps{innerPatternString(e){return"(\u0437\u0430\u0440\u0430\u0437|\u043C\u0438\u043D\u0443\u043B\u043E\u0433\u043E\\s*\u0432\u0435\u0447\u043E\u0440\u0430|\u043C\u0438\u043D\u0443\u043B\u043E\u0457\\s*\u043D\u043E\u0447\u0456|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u0457\\s*\u043D\u043E\u0447\u0456|\u0441\u044C\u043E\u0433\u043E\u0434\u043D\u0456\\s*\u0432\u043D\u043E\u0447\u0456|\u0446\u0456\u0454\u0457\\s*\u043D\u043E\u0447\u0456|\u0446\u044C\u043E\u0433\u043E \u0440\u0430\u043D\u043A\u0443|\u0432\u0440\u0430\u043D\u0446\u0456|\u0440\u0430\u043D\u043A\u0443|\u0437\u0440\u0430\u043D\u043A\u0443|\u043E\u043F\u0456\u0432\u0434\u043D\u0456|\u0432\u0432\u0435\u0447\u0435\u0440\u0456|\u0432\u0435\u0447\u043E\u0440\u0430|\u043E\u043F\u0456\u0432\u043D\u043E\u0447\u0456|\u0432\u043D\u043E\u0447\u0456)"}innerExtract(e,t){let n=(0,ibe.default)(e.reference.instant),a=t[0].toLowerCase(),i=e.createParsingComponents();if(a==="\u0437\u0430\u0440\u0430\u0437")return di(e.reference);if(a==="\u0432\u0432\u0435\u0447\u0435\u0440\u0456"||a==="\u0432\u0435\u0447\u043E\u0440\u0430")return Xv(e.reference);if(a.endsWith("\u0432\u0440\u0430\u043D\u0446\u0456")||a.endsWith("\u0440\u0430\u043D\u043A\u0443")||a.endsWith("\u0437\u0440\u0430\u043D\u043A\u0443"))return ek(e.reference);if(a.endsWith("\u043E\u043F\u0456\u0432\u0434\u043D\u0456"))return tk(e.reference);if(a.match(/минулої\s*ночі/))return G_(e.reference);if(a.match(/минулого\s*вечора/))return K_(e.reference);if(a.match(/наступної\s*ночі/)){let s=n.hour()<22?1:2;n=n.add(s,"day"),Kr(i,n),i.imply("hour",1)}return a.match(/цієї\s*ночі/)?zh(e.reference):a.endsWith("\u043E\u043F\u0456\u0432\u043D\u043E\u0447\u0456")||a.endsWith("\u0432\u043D\u043E\u0447\u0456")?zh(e.reference):i}}});var Xnt,eat,tat,KC,obe=y(()=>{to();Ot();jl();Ou();Xnt=1,eat=2,tat=3,KC=class extends ps{innerPatternString(e){return`(?:(?:,|\\(|\uFF08)\\s*)?(?:\u0432\\s*?)?(?:\u0443\\s*?)?(?:(\u0446\u0435\u0439|\u043C\u0438\u043D\u0443\u043B\u043E\u0433\u043E|\u043C\u0438\u043D\u0443\u043B\u0438\u0439|\u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u0456\u0439|\u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044C\u043E\u0433\u043E|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u0433\u043E|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0438\u0439|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443)\\s*)?(${oe(nV)})(?:\\s*(?:,|\\)|\uFF09))?(?:\\s*(\u043D\u0430|\u0443|\u0432)\\s*(\u0446\u044C\u043E\u043C\u0443|\u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443)\\s*\u0442\u0438\u0436\u043D\u0456)?`}innerExtract(e,t){let n=t[eat].toLocaleLowerCase(),a=nV[n],i=t[Xnt],s=t[tat],o=i||s;o=o||"",o=o.toLocaleLowerCase();let l=null;return o=="\u043C\u0438\u043D\u0443\u043B\u043E\u0433\u043E"||o=="\u043C\u0438\u043D\u0443\u043B\u0438\u0439"||o=="\u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u0456\u0439"||o=="\u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044C\u043E\u0433\u043E"?l="last":o=="\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u0433\u043E"||o=="\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0438\u0439"?l="next":(o=="\u0446\u0435\u0439"||o=="\u0446\u044C\u043E\u0433\u043E"||o=="\u0446\u044C\u043E\u043C\u0443")&&(l="this"),ta(e.reference,a,l)}}});var lbe,rat,nat,ZC,cbe=y(()=>{to();pt();lbe=st(tr(),1);Ot();Ou();rat=1,nat=2,ZC=class extends ps{innerPatternString(e){return`(\u0432 \u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443|\u0443 \u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443|\u043D\u0430 \u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443|\u043C\u0438\u043D\u0443\u043B\u043E\u0433\u043E|\u043D\u0430 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443|\u0432 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443|\u0443 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u0433\u043E|\u043D\u0430 \u0446\u044C\u043E\u043C\u0443|\u0432 \u0446\u044C\u043E\u043C\u0443|\u0443 \u0446\u044C\u043E\u043C\u0443|\u0446\u044C\u043E\u0433\u043E)\\s*(${oe(jC)})(?=\\s*)`}innerExtract(e,t){let n=t[rat].toLowerCase(),a=t[nat].toLowerCase(),i=jC[a];if(n=="\u043D\u0430 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443"||n=="\u0432 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443"||n=="\u0443 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u043C\u0443"||n=="\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u043E\u0433\u043E"){let l={};return l[i]=1,te.createRelativeFromReference(e.reference,l)}if(n=="\u043D\u0430 \u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443"||n=="\u0432 \u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443"||n=="\u0443 \u043C\u0438\u043D\u0443\u043B\u043E\u043C\u0443"||n=="\u043C\u0438\u043D\u0443\u043B\u043E\u0433\u043E"){let l={};return l[i]=-1,te.createRelativeFromReference(e.reference,l)}let s=e.createParsingComponents(),o=(0,lbe.default)(e.reference.instant);return i.match(/week/i)?(o=o.add(-o.get("d"),"d"),s.imply("day",o.date()),s.imply("month",o.month()+1),s.imply("year",o.year())):i.match(/month/i)?(o=o.add(-o.date()+1,"d"),s.imply("day",o.date()),s.assign("year",o.year()),s.assign("month",o.month()+1)):i.match(/year/i)&&(o=o.add(-o.date()+1,"d"),o=o.add(-o.month(),"month"),s.imply("day",o.date()),s.imply("month",o.month()+1),s.assign("year",o.year())),s}}});var QC,dbe=y(()=>{to();pt();Qs();Ou();QC=class extends ps{innerPatternString(e){return`(\u0446\u0456|\u043E\u0441\u0442\u0430\u043D\u043D\u0456|\u043C\u0438\u043D\u0443\u043B\u0456|\u043C\u0430\u0439\u0431\u0443\u0442\u043D\u0456|\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0456|\u043F\u0456\u0441\u043B\u044F|\u0447\u0435\u0440\u0435\u0437|\\+|-)\\s*(${yk})`}innerExtract(e,t){let n=t[1].toLowerCase(),a=vk(t[3]);switch(n){case"\u043E\u0441\u0442\u0430\u043D\u043D\u0456":case"\u043C\u0438\u043D\u0443\u043B\u0456":case"-":a=ea(a);break}return te.createRelativeFromReference(e.reference,a)}}});var cV={};at(cV,{Chrono:()=>Be,Meridiem:()=>H,ParsingComponents:()=>te,ParsingResult:()=>Yt,ReferenceWithTimezone:()=>rr,Weekday:()=>Ye,casual:()=>oV,createCasualConfiguration:()=>ube,createConfiguration:()=>lV,parse:()=>iat,parseDate:()=>sat,strict:()=>aat});function ube(){let r=lV(!1);return r.parsers.unshift(new YC),r.parsers.unshift(new GC),r.parsers.unshift(new UC),r.parsers.unshift(new ZC),r.parsers.unshift(new QC),r}function lV(r){return mn({parsers:[new Iu,new ua(!0),new $C,new BC,new KC,new HC(r),new VC],refiners:[new WC,new qC]},r)}function iat(r,e,t){return oV.parse(r,e,t)}function sat(r,e,t){return oV.parseDate(r,e,t)}var oV,aat,pbe=y(()=>{Yke();Qke();Xke();ebe();tbe();rbe();nbe();Ks();abe();sbe();obe();cbe();ds();pt();Ht();Nu();dbe();Y_();oV=new Be(ube()),aat=new Be(lV(!0))});var DI={};at(DI,{Chrono:()=>Be,Meridiem:()=>H,ParsingComponents:()=>te,ParsingContext:()=>px,ParsingResult:()=>Yt,ReferenceWithTimezone:()=>rr,Weekday:()=>Ye,casual:()=>dV,de:()=>OU,en:()=>DU,es:()=>XH,fr:()=>WU,ja:()=>ZU,nl:()=>cH,parse:()=>lat,parseDate:()=>cat,pt:()=>tH,ru:()=>YH,strict:()=>oat,uk:()=>cV,zh:()=>LH});function lat(r,e,t){return dV.parse(r,e,t)}function cat(r,e,t){return dV.parseDate(r,e,t)}var oat,dV,mbe=y(()=>{Cge();ds();pt();Ht();Zge();bye();Fye();Zye();xve();Xve();wke();Hke();pbe();oat=EU,dV=mx});var dat,PI,fbe=y(()=>{Wr();mbe();Ov();iU();sU();aU();dat=ke,PI=class{constructor(e=[],t=[],n=!0,a="en",i,s,o={}){this.isValidDateString=c=>/^\d{4}-\d{2}-\d{2}$/.test(c),this.isValidTimeString=c=>/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/.test(c),this.escapeRegex=c=>c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),this.cleanupWhitespace=c=>c.replace(/\s+/g," ").replace(/^\s+|\s+$/g,"").trim(),this.defaultToScheduled=n,this.languageConfig=ghe(a),this.options=o,this.statusConfigs=e,this.priorityConfigs=t;let l=i||Hfe;this.triggerConfig=new B_(l,s||[]),this.boundaries=this.createBoundaryConfig(),this.recurrencePatterns=this.buildRecurrencePatterns(),this.processingPipeline=this.buildProcessingPipeline()}createBoundaryConfig(){let e=["ru","zh","ja","uk","fr"].includes(this.languageConfig.code);return{boundary:e?"(?:^|\\s)":"\\b",endBoundary:e?"(?=\\s|$)":"\\b",isNonAscii:e}}getChronoParser(){let e=this.languageConfig.chronoLocale;return DI[e]||DI}buildProcessingPipeline(){return[{name:"extractTags",process:(e,t)=>this.extractTags(e,t)},{name:"extractContexts",process:(e,t)=>this.extractContexts(e,t)},{name:"extractProjects",process:(e,t)=>this.extractProjects(e,t)},{name:"extractPriority",process:(e,t)=>this.extractPriority(e,t)},{name:"extractStatus",process:(e,t)=>this.extractStatus(e,t)},{name:"extractRecurrence",process:(e,t)=>this.extractRecurrence(e,t)},{name:"extractTimeEstimate",process:(e,t)=>this.extractTimeEstimate(e,t)},{name:"extractUserFields",process:(e,t)=>this.extractUserFields(e,t)},{name:"parseUnifiedDatesAndTimes",process:(e,t)=>this.parseUnifiedDatesAndTimes(e,t)}]}parseInput(e){let t={title:"",tags:[],contexts:[],projects:[]},n=this.protectNlpLiterals(e),a=this.normalizeNumericDateLiterals(n.text),[i,s]=this.extractTitleAndDetails(a);s&&(t.details=s);let o=i;for(let c of this.processingPipeline)try{o=c.process(o,t)}catch(d){console.debug(`Error in processor ${c.name}:`,d)}t.title=o.trim();let l=this.validateAndCleanupResult(t);return this.restoreProtectedLiterals(l,n.literals),l}protectNlpLiterals(e){let t=this.protectQuotedLiterals(e);return this.protectEscapedLiterals(t.text,t.literals)}protectQuotedLiterals(e){let t=[],n="",a=0;for(;a=e.length||!this.shouldProtectEscapedLiteral(e,a,i)){n+=e[a],a+=1;continue}let s=i;for(;sthis.restoreProtectedLiteralsInText(i,t))}restoreProtectedLiteralsInText(e,t){let n=e;return t.forEach((a,i)=>{n=n.replace(`__TASKNOTES_NLP_LITERAL_${i}__`,a)}),n}isQuoteDelimiter(e){return e==='"'||e==="'"||e==="`"}isEligibleQuoteStart(e,t){if(e[t]!=="'")return!0;let a=t>0?e[t-1]:"";return!this.isWordCharacter(a)}isEligibleQuoteEnd(e,t){if(e[t]!=="'")return!0;let a=t+10?e[a-1]:"")==="\\"))return a;return-1}shouldProtectEscapedLiteral(e,t,n){if(this.startsWithEscapableTrigger(e,n))return!0;let a=t>0?e[t-1]:"";return a&&!/\s/u.test(a)?!1:/[\p{L}\p{N}]/u.test(e[n])}startsWithEscapableTrigger(e,t){return this.getEscapableTriggers().some(n=>e.startsWith(n,t))}getEscapableTriggers(){let e=this.triggerConfig.getTriggersOrderedByLength().map(t=>t.trigger).filter(t=>t.length>0);return e.length>0?e:["#","@","+","*","!"]}normalizeNumericDateLiterals(e){let t=e.replace(/(^|[^\p{L}\p{N}_])(\d{4})[/.](\d{1,2})[/.](\d{1,2})(?=$|[^\p{L}\p{N}_])/gu,(n,a,i,s,o)=>{let l=this.toValidatedISODate(Number(i),Number(s),Number(o));return l?`${a}${l}`:n});return this.getNumericDateOrder()!=="day-first"?t:t.replace(/(^|[^\p{L}\p{N}_])(\d{1,2})[/.](\d{1,2})[/.](\d{4})(?=$|[^\p{L}\p{N}_])/gu,(n,a,i,s,o)=>{let l=this.toValidatedISODate(Number(o),Number(s),Number(i));return l?`${a}${l}`:n})}getNumericDateOrder(){if(this.options.dateOrder)return this.options.dateOrder;let e=this.options.dateLocale||this.languageConfig.code;try{let n=new Intl.DateTimeFormat(e).formatToParts(new Date(2006,10,22)).find(a=>a.type==="day"||a.type==="month"||a.type==="year");if((n==null?void 0:n.type)==="day")return"day-first"}catch(t){}return"month-first"}toValidatedISODate(e,t,n){let a=new Date(Date.UTC(e,t-1,n));return a.getUTCFullYear()!==e||a.getUTCMonth()!==t-1||a.getUTCDate()!==n?null:`${e}-${this.padDatePart(t)}-${this.padDatePart(n)}`}padDatePart(e){return String(e).padStart(2,"0")}extractTitleAndDetails(e){let t=e.trim(),n=t.indexOf(` `);if(n!==-1){let a=t.substring(0,n).trim(),i=t.substring(n+1).trim();return[a,i]}return[t,void 0]}extractTags(e,t){let n=this.triggerConfig.getTagTrigger();if(!n)return e;let a=this.escapeRegex(n),i=new RegExp(`${a}[\\p{L}\\p{N}\\p{M}_/-]+`,"gu"),s=e.match(i);return s?(t.tags.push(...s.map(o=>o.substring(n.length))),this.cleanupWhitespace(e.replace(i,""))):e}extractContexts(e,t){let n=this.triggerConfig.getContextTrigger();if(!n)return e;let a=this.escapeRegex(n),i=new RegExp(`${a}[\\p{L}\\p{N}\\p{M}_/-]+`,"gu"),s=e.match(i);return s?(t.contexts.push(...s.map(o=>o.substring(n.length))),this.cleanupWhitespace(e.replace(i,""))):e}extractProjects(e,t){let n=this.triggerConfig.getProjectTrigger();if(!n)return e;let a=e,i=this.escapeRegex(n),s=new RegExp(`${i}\\[\\[.*?\\]\\]`,"g"),o=a.match(s);o&&(t.projects.push(...o.map(d=>d.slice(n.length))),a=this.cleanupWhitespace(a.replace(s,"")));let l=new RegExp(`${i}[\\p{L}\\p{N}\\p{M}_/-]+`,"gu"),c=a.match(l);return c&&(t.projects.push(...c.map(d=>d.substring(n.length))),a=this.cleanupWhitespace(a.replace(l,""))),a}extractUserFields(e,t){let n=e,a=this.triggerConfig.getAllEnabledTriggers().filter(i=>this.triggerConfig.isUserField(i.propertyId));for(let i of a){let s=this.triggerConfig.getUserField(i.propertyId);if(!s)continue;let o=this.escapeRegex(i.trigger);if(s.type==="list"){let l=new RegExp(`${o}(?:"([^"]+)"|([\\p{L}\\p{N}\\p{M}_/-]+))`,"gu"),c=[],d;for(;(d=l.exec(n))!==null;){let u=d[1]||d[2];c.push(u)}c.length>0&&(t.userFields||(t.userFields={}),t.userFields[s.id]=c,n=this.cleanupWhitespace(n.replace(l,"")))}else if(s.type==="text"||s.type==="boolean"||s.type==="number"){let l=new RegExp(`${o}(?:"([^"]+)"|([\\p{L}\\p{N}\\p{M}_/-]+))`,"u"),c=n.match(l);if(c){let d=c[1]||c[2];t.userFields||(t.userFields={}),s.type==="boolean"?t.userFields[s.id]=d.toLowerCase()==="true"?"true":"false":t.userFields[s.id]=d,n=this.cleanupWhitespace(n.replace(l,""))}}else if(s.type==="date"){let l=new RegExp(`${o}(?:"([^"]+)"|([\\p{L}\\p{N}\\p{M}_/-]+))`,"u"),c=n.match(l);if(c){let d=c[1]||c[2];t.userFields||(t.userFields={}),t.userFields[s.id]=d,n=this.cleanupWhitespace(n.replace(l,""))}}}return n}extractPriority(e,t){if(this.priorityConfigs.length>0){let i=[...this.priorityConfigs].sort((l,c)=>c.label.length-l.label.length),s=this.triggerConfig.getTriggerForProperty("priority"),o=s!=null&&s.enabled?s.trigger:"";for(let l of i){let c=[l.label,l.value];for(let d of c){if(!d||d.trim()==="")continue;if(o){let p=o+d,m=this.findTextMatch(e,p);if(m)return t.priority=l.value,this.cleanupWhitespace(e.replace(m.fullMatch,""))}let u=this.findTextMatch(e,d);if(u)return t.priority=l.value,this.cleanupWhitespace(e.replace(u.fullMatch,""))}}return e}let n=this.languageConfig.fallbackPriority,a=this.findPhraseValueMatch(e,[{value:"urgent",phrases:n.urgent},{value:"high",phrases:n.high},{value:"normal",phrases:n.normal},{value:"low",phrases:n.low}]);return a?(t.priority=a.value,this.removePhraseMatch(e,a.match)):e}extractStatus(e,t){if(this.statusConfigs.length>0){let i=[...this.statusConfigs].sort((l,c)=>c.label.length-l.label.length),s=this.triggerConfig.getTriggerForProperty("status"),o=s!=null&&s.enabled?s.trigger:"";for(let l of i){let c=[l.label,l.value];for(let d of c){if(!d||d.trim()==="")continue;if(o){let p=o+d,m=this.findTextMatch(e,p);if(m)return t.status=l.value,this.cleanupWhitespace(e.replace(m.fullMatch,""))}let u=this.findTextMatch(e,d);if(u)return t.status=l.value,this.cleanupWhitespace(e.replace(u.fullMatch,""))}}return e}let n=this.languageConfig.fallbackStatus,a=this.findPhraseValueMatch(e,[{value:"open",phrases:n.open},{value:"in-progress",phrases:n.inProgress},{value:"done",phrases:n.done},{value:"cancelled",phrases:n.cancelled},{value:"waiting",phrases:n.waiting}]);return a?(t.status=a.value,this.removePhraseMatch(e,a.match)):e}findTextMatch(e,t){let n=this.findPhraseMatch(e,[t]);if(!n)return null;let a=this.includeTrailingPhraseSeparator(e,n.endIndex);return{fullMatch:e.substring(n.startIndex,a),startIndex:n.startIndex}}findPhraseMatch(e,t){let n=t.filter(s=>s&&s.trim()!=="").sort((s,o)=>o.length-s.length);if(n.length===0)return null;let a=e.toLowerCase(),i=null;for(let s of n){let o=s.toLowerCase(),l=0;for(;l<=a.length;){let c=a.indexOf(o,l);if(c===-1)break;let d=c+s.length;if(this.hasPhraseBoundaries(e,c,d)){let u={fullMatch:e.substring(c,d),phrase:s,startIndex:c,endIndex:d};(!i||u.startIndexi.phrase.length)&&(i=u)}l=c+1}}return i}findPhraseValueMatch(e,t){let n=null;for(let a of t){let i=this.findPhraseMatch(e,a.phrases);i&&(!n||i.startIndexn.match.phrase.length)&&(n={value:a.value,match:i})}return n}removePhraseMatch(e,t){let n=this.includeTrailingPhraseSeparator(e,t.endIndex);return this.cleanupWhitespace(e.substring(0,t.startIndex)+e.substring(n))}hasPhraseBoundaries(e,t,n){if(["zh","ja"].includes(this.languageConfig.code))return!0;let a=this.getCodePointBefore(e,t),i=this.getCodePointAt(e,n);return!this.isWordCharacter(a)&&!this.isWordCharacter(i)}getCodePointBefore(e,t){return t<=0?"":Array.from(e.slice(0,t)).pop()||""}getCodePointAt(e,t){return t>=e.length?"":Array.from(e.slice(t))[0]||""}isWordCharacter(e){return e!==""&&/[\p{L}\p{N}\p{M}_]/u.test(e)}includeTrailingPhraseSeparator(e,t){return/[:,;]/.test(e[t]||"")?t+1:t}parseUnifiedDatesAndTimes(e,t){var a,i;let n=e;try{let s=this.getChronoParser(),o=this.languageConfig.dateTriggers,l=[{type:"due",phrases:o.due},{type:"scheduled",phrases:o.scheduled}],c=!1;for(let v of l){let b=this.findPhraseMatch(n,v.phrases);if(b){let k=n.substring(b.endIndex),w=this.parseChronoFromPosition(k);if(w.success){c=!0,v.type==="due"?(t.dueDate=w.date,w.time&&(t.dueTime=w.time)):(t.scheduledDate=w.date,w.time&&(t.scheduledTime=w.time));let S=this.getChronoMatchOffset(k,w),C=w.matchedText?b.endIndex+S+w.matchedText.length:b.endIndex;n=n.substring(0,b.startIndex)+n.substring(C),n=this.cleanupWhitespace(n)}}}if(c)return n;let d=s.parse(e,new Date,{forwardDate:!0});if(d.length===0)return e;let u=d[0],p=u.text,m=u.start.date(),f=(a=u.end)==null?void 0:a.date(),h=this.findPhraseMatch(u.text,o.due)!==null,g=this.findPhraseMatch(u.text,o.scheduled)!==null;if(f&&Ca(f)&&f.getTime()!==m.getTime())t.scheduledDate=M(m,"yyyy-MM-dd"),u.start.isCertain("hour")&&(t.scheduledTime=M(m,"HH:mm")),t.dueDate=M(f,"yyyy-MM-dd"),(i=u.end)!=null&&i.isCertain("hour")&&(t.dueTime=M(f,"HH:mm"));else if(Ca(m)){let v=M(m,"yyyy-MM-dd"),b=u.start.isCertain("hour")?M(m,"HH:mm"):void 0;h&&!g?(t.dueDate=v,t.dueTime=b):g&&!h||this.defaultToScheduled?(t.scheduledDate=v,t.scheduledTime=b):(t.dueDate=v,t.dueTime=b)}n=n.replace(p,"").trim(),n=this.cleanupWhitespace(n)}catch(s){console.debug("Error in unified date parsing:",s)}return n}parseChronoFromPosition(e){try{let n=this.getChronoParser().parse(e,new Date,{forwardDate:!0});if(n.length>0){let a=n[0];if(a.index<=3){let i=a.start.date();if(Ca(i)){let s={success:!0,date:M(i,"yyyy-MM-dd"),matchedText:a.text,startIndex:a.index};return a.start.isCertain("hour")&&(s.time=M(i,"HH:mm")),s}}}}catch(t){console.debug("Error parsing date with chrono:",t)}return{success:!1}}getChronoMatchOffset(e,t){var i;let n=(i=t.startIndex)!=null?i:0;if(!t.matchedText)return n;let a=e.indexOf(t.matchedText);return a!==-1?a:n}buildRecurrencePatterns(){let e=this.languageConfig.recurrence,t=[],{boundary:n,endBoundary:a}=this.boundaries,i=s=>s.map(o=>this.escapeRegex(o)).join("|");return t.push(...this.buildOrdinalWeekdayPatterns(e,n,a,i)),t.push(...this.buildIntervalPatterns(e,n,a,i)),t.push(...this.buildEveryOtherPatterns(e,n,a,i)),t.push(...this.buildWeekdayPatterns(e,n,a,i)),t.push(...this.buildFrequencyPatterns(e,n,a,i)),t}buildOrdinalWeekdayPatterns(e,t,n,a){let i=a(e.every),s=a([...e.ordinals.first,...e.ordinals.second,...e.ordinals.third,...e.ordinals.fourth,...e.ordinals.last]),o=a([...e.weekdays.monday,...e.weekdays.tuesday,...e.weekdays.wednesday,...e.weekdays.thursday,...e.weekdays.friday,...e.weekdays.saturday,...e.weekdays.sunday]);return[{regex:new RegExp(`${t}(${i})\\s+(${s})\\s+(${o})${n}`,"i"),handler:l=>{let c=l[2].toLowerCase(),d=l[3].toLowerCase(),u=1;return e.ordinals.second.some(m=>m.toLowerCase()===c)?u=2:e.ordinals.third.some(m=>m.toLowerCase()===c)?u=3:e.ordinals.fourth.some(m=>m.toLowerCase()===c)?u=4:e.ordinals.last.some(m=>m.toLowerCase()===c)&&(u=-1),`FREQ=MONTHLY;BYDAY=${this.getWeekdayRRuleCode(d,e)};BYSETPOS=${u}`}}]}buildIntervalPatterns(e,t,n,a){let i=a(e.every),s=a([...e.periods.day,...e.periods.week,...e.periods.month,...e.periods.year]);return[{regex:new RegExp(`${t}(${i})\\s+(\\d+)\\s+(${s})${n}`,"i"),handler:o=>{let l=parseInt(o[2]),c=o[3].toLowerCase();return`FREQ=${this.getPeriodFrequency(c,e)};INTERVAL=${l}`}}]}buildEveryOtherPatterns(e,t,n,a){let i=a(e.every),s=a(e.other),o=a([...e.periods.day,...e.periods.week,...e.periods.month,...e.periods.year]);return[{regex:new RegExp(`${t}(${i})\\s+(${s})\\s+(${o})${n}`,"i"),handler:l=>{let c=l[3].toLowerCase();return`FREQ=${this.getPeriodFrequency(c,e)};INTERVAL=2`}}]}buildWeekdayPatterns(e,t,n,a){let i=a(e.every),s=a([...e.weekdays.monday,...e.weekdays.tuesday,...e.weekdays.wednesday,...e.weekdays.thursday,...e.weekdays.friday,...e.weekdays.saturday,...e.weekdays.sunday]),o=a([...e.pluralWeekdays.monday,...e.pluralWeekdays.tuesday,...e.pluralWeekdays.wednesday,...e.pluralWeekdays.thursday,...e.pluralWeekdays.friday,...e.pluralWeekdays.saturday,...e.pluralWeekdays.sunday]);return[{regex:new RegExp(`${t}(${i})\\s+(${s})${n}`,"i"),handler:l=>{let c=l[2].toLowerCase();return`FREQ=WEEKLY;BYDAY=${this.getWeekdayRRuleCode(c,e)}`}},{regex:new RegExp(`${t}(${o})${n}`,"i"),handler:l=>{let c=l[1].toLowerCase();return`FREQ=WEEKLY;BYDAY=${this.getPluralWeekdayRRuleCode(c,e)}`}}]}buildFrequencyPatterns(e,t,n,a){return[{regex:new RegExp(`${t}(${a(e.frequencies.daily)})${n}`,"i"),handler:()=>"FREQ=DAILY"},{regex:new RegExp(`${t}(${a(e.frequencies.weekly)})${n}`,"i"),handler:()=>"FREQ=WEEKLY"},{regex:new RegExp(`${t}(${a(e.frequencies.monthly)})${n}`,"i"),handler:()=>"FREQ=MONTHLY"},{regex:new RegExp(`${t}(${a(e.frequencies.yearly)})${n}`,"i"),handler:()=>"FREQ=YEARLY"}]}getPeriodFrequency(e,t){return t.periods.week.some(n=>n.toLowerCase()===e)?"WEEKLY":t.periods.month.some(n=>n.toLowerCase()===e)?"MONTHLY":t.periods.year.some(n=>n.toLowerCase()===e)?"YEARLY":"DAILY"}getWeekdayRRuleCode(e,t){return t.weekdays.tuesday.some(n=>n.toLowerCase()===e)?"TU":t.weekdays.wednesday.some(n=>n.toLowerCase()===e)?"WE":t.weekdays.thursday.some(n=>n.toLowerCase()===e)?"TH":t.weekdays.friday.some(n=>n.toLowerCase()===e)?"FR":t.weekdays.saturday.some(n=>n.toLowerCase()===e)?"SA":t.weekdays.sunday.some(n=>n.toLowerCase()===e)?"SU":"MO"}getPluralWeekdayRRuleCode(e,t){return t.pluralWeekdays.tuesday.some(n=>n.toLowerCase()===e)?"TU":t.pluralWeekdays.wednesday.some(n=>n.toLowerCase()===e)?"WE":t.pluralWeekdays.thursday.some(n=>n.toLowerCase()===e)?"TH":t.pluralWeekdays.friday.some(n=>n.toLowerCase()===e)?"FR":t.pluralWeekdays.saturday.some(n=>n.toLowerCase()===e)?"SA":t.pluralWeekdays.sunday.some(n=>n.toLowerCase()===e)?"SU":"MO"}extractRecurrence(e,t){for(let n of this.recurrencePatterns){let a=e.match(n.regex);if(a){let i=n.handler(a);if(this.isValidRRuleString(i))return t.recurrence=i,this.cleanupWhitespace(e.replace(n.regex,""))}}return e}isValidRRuleString(e){if(e.includes("BYDAY=undefined")||e.includes("BYDAY=;")||e.includes("BYDAY=")){let t=e.match(/BYDAY=([^;]*)/);if(t&&(!t[1]||t[1]==="undefined"||t[1].trim()===""))return!1}return!!e.includes("FREQ=")}extractTimeEstimate(e,t){let n=this.languageConfig.timeEstimate,{boundary:a,endBoundary:i}=this.boundaries,s=[{regex:new RegExp(`${a}(\\d+)(${n.hours.map(c=>this.escapeRegex(c)).join("|")})\\s*(\\d+)(${n.minutes.map(c=>this.escapeRegex(c)).join("|")})${i}`,"i"),handler:c=>parseInt(c[1])*60+parseInt(c[3])},{regex:new RegExp(`${a}(\\d+)\\s*(${n.hours.map(c=>this.escapeRegex(c)).join("|")})${i}`,"i"),handler:c=>parseInt(c[1])*60},{regex:new RegExp(`${a}(\\d+)\\s*(${n.minutes.map(c=>this.escapeRegex(c)).join("|")})${i}`,"i"),handler:c=>parseInt(c[1])}],o=e,l=0;for(let c of s){let d=o.match(c.regex);d&&(l+=c.handler(d),o=this.cleanupWhitespace(o.replace(c.regex,"")))}return l>0&&(t.estimate=l),o}validateAndCleanupResult(e){return e.title.trim()||(e.title="Untitled Task"),e.tags=[...new Set(e.tags.filter(Boolean))],e.contexts=[...new Set(e.contexts.filter(Boolean))],e.projects=[...new Set(e.projects.filter(Boolean))],e.dueDate&&!this.isValidDateString(e.dueDate)&&delete e.dueDate,e.scheduledDate&&!this.isValidDateString(e.scheduledDate)&&delete e.scheduledDate,e.dueTime&&!this.isValidTimeString(e.dueTime)&&delete e.dueTime,e.scheduledTime&&!this.isValidTimeString(e.scheduledTime)&&delete e.scheduledTime,e}getPreviewData(e){let t=[];if(e.title&&t.push({icon:"edit-3",text:`"${e.title}"`}),e.details&&t.push({icon:"file-text",text:`Details: "${e.details.substring(0,50)}${e.details.length>50?"...":""}"`}),e.dueDate){let n=e.dueTime?`${e.dueDate} at ${e.dueTime}`:e.dueDate;t.push({icon:"calendar",text:`Due: ${n}`})}if(e.scheduledDate){let n=e.scheduledTime?`${e.scheduledDate} at ${e.scheduledTime}`:e.scheduledDate;t.push({icon:"calendar-clock",text:`Scheduled: ${n}`})}if(e.priority&&t.push({icon:"alert-triangle",text:`Priority: ${e.priority}`}),e.status&&t.push({icon:"activity",text:`Status: ${e.status}`}),e.contexts&&e.contexts.length>0&&t.push({icon:"map-pin",text:`Contexts: ${e.contexts.map(n=>"@"+n).join(", ")}`}),e.projects&&e.projects.length>0){let n=e.projects.map(a=>`+${a}`).join(", ");t.push({icon:"folder",text:`Projects: ${n}`})}if(e.tags&&e.tags.length>0&&t.push({icon:"tag",text:`Tags: ${e.tags.map(n=>"#"+n).join(", ")}`}),e.recurrence){let n="Invalid recurrence";try{e.recurrence.includes("FREQ=")&&this.isValidRRuleString(e.recurrence)&&(n=dat.fromString(e.recurrence).toText())}catch(a){console.debug("Error parsing rrule for preview:",a)}t.push({icon:"repeat",text:`Recurrence: ${n}`})}if(e.estimate&&t.push({icon:"clock",text:`Estimate: ${e.estimate} min`}),e.userFields&&Object.keys(e.userFields).length>0)for(let[n,a]of Object.entries(e.userFields)){let i=this.triggerConfig.getUserField(n),s=(i==null?void 0:i.displayName)||n,o;Array.isArray(a)?o=a.join(", "):o=a,t.push({icon:"box",text:`${s}: ${o}`})}return t}getPreviewText(e){return this.getPreviewData(e).map(t=>t.text).join(" \u2022 ")}getStatusSuggestions(e,t=10){let n=e.toLowerCase();return this.statusConfigs.filter(a=>a&&typeof a.value=="string"&&typeof a.label=="string").filter(a=>a.value.trim()!==""&&a.label.trim()!=="").filter(a=>a.value.toLowerCase().includes(n)||a.label.toLowerCase().includes(n)).slice(0,t).map(a=>({value:a.value,label:a.label,display:a.label}))}}});var hbe=y(()=>{Ufe();aU();iU();sU();fbe()});function uat(){return typeof navigator!="undefined"&&navigator.language?navigator.language:void 0}function pat(r){var t,n;let e=(n=(t=r.settings.calendarViewSettings)==null?void 0:t.locale)==null?void 0:n.trim();return e||uat()||r.settings.nlpLanguage||"en"}var ra,Lc=y(()=>{hbe();ra=class r extends PI{static fromPlugin(e){let t=e.settings;return new r(t.customStatuses,t.customPriorities,t.nlpDefaultToScheduled,t.nlpLanguage,t.nlpTriggers,t.userFields,{dateLocale:pat(e)})}constructor(e=[],t=[],n=!0,a="en",i,s,o){super(e,t,n,a,i,s,o),this.taskNotesNlpTriggers=i,this.taskNotesStatusConfigs=e,this.taskNotesUserFields=s||[],this.taskNotesPriorityConfigs=t}parseInput(e){let t=super.parseInput(e),n=this.applyTriggeredStatusMatch(e,t),a=this.removePriorityShortcutResidue(e,n),i=this.extractLinkedUserFields(e,a);return this.normalizeUserFieldValues(i)}applyTriggeredStatusMatch(e,t){let n=this.findTriggeredStatusMatch(e);if(!n)return t;t.status=n.config.value;let a=t.title;for(let i of this.getStatusShortcutResidues(n.token))a=this.removeTokenFragment(a,i);return t.title=a||"Untitled Task",t}findTriggeredStatusMatch(e){var a;let t=this.getStatusTrigger();if(!t||this.taskNotesStatusConfigs.length===0)return null;let n=[];for(let i of this.taskNotesStatusConfigs)for(let s of this.getStatusPhrases(i))n.push({config:i,token:`${t}${s}${t}`}),n.push({config:i,token:`${t}${s}`});return n.sort((i,s)=>s.token.length-i.token.length),(a=n.find(i=>this.containsToken(e,i.token)))!=null?a:null}getStatusShortcutResidues(e){let t=new Set([e]);for(let n of this.taskNotesStatusConfigs)for(let a of this.getStatusPhrases(n)){let i=this.removeFirstCaseInsensitive(e,a);i&&i!==e&&this.addStatusShortcutResidue(t,i)}return Array.from(t).filter(n=>n.trim().length>0).sort((n,a)=>a.length-n.length)}addStatusShortcutResidue(e,t){e.add(t),e.add(t.replace(/\s+/g," ").trim())}getStatusPhrases(e){return[e.value,e.label].filter(t=>typeof t=="string"&&t.trim().length>0).map(t=>t.trim())}removePriorityShortcutResidue(e,t){if(!t.priority||this.taskNotesPriorityConfigs.length===0)return t;let n=this.taskNotesPriorityConfigs.find(c=>c.value===t.priority);if(!n)return t;let a=this.getPriorityTrigger(),i=[n.value,n.label].filter(c=>typeof c=="string"&&c.trim().length>0).flatMap(c=>a?[`${a}${c}`,c]:[c]),s=[n.label,n.value].filter(c=>typeof c=="string"&&c.trim().length>0),o=new Set;for(let c of i)if(this.containsToken(e,c))for(let d of s){let u=this.removeFirstCaseInsensitive(c,d);!u||u===c||o.add(u)}let l=t.title;for(let c of Array.from(o).sort((d,u)=>u.length-d.length))l=this.removeTokenFragment(l,c);return t.title=l||"Untitled Task",t}getPriorityTrigger(){var t;let e=(t=this.taskNotesNlpTriggers)==null?void 0:t.triggers.find(n=>n.propertyId==="priority");return(e==null?void 0:e.trigger)||""}getStatusTrigger(){var t;let e=(t=this.taskNotesNlpTriggers)==null?void 0:t.triggers.find(n=>n.propertyId==="status");return(e==null?void 0:e.enabled)===!1?"":(e==null?void 0:e.trigger)||"*"}containsToken(e,t){let n=this.escapeRegexLiteral(t);return new RegExp(`(^|\\s)${n}(?=\\s|$)`,"iu").test(e)}removeTokenFragment(e,t){let n=this.escapeRegexLiteral(t);return e.replace(new RegExp(`(^|\\s)${n}(?=\\s|$)`,"giu"),"$1").replace(/\s+/g," ").trim()}removeFirstCaseInsensitive(e,t){let n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?null:`${e.slice(0,n)}${e.slice(n+t.length)}`}normalizeUserFieldValues(e){var n;if(!e.userFields)return e;let t=e.userFields;for(let a of this.taskNotesUserFields){let i=t[a.id];if(typeof i=="string")if(a.type==="boolean"){let s=i.trim().toLowerCase();s==="true"?t[a.id]=!0:s==="false"&&(t[a.id]=!1)}else a.type==="date"&&(t[a.id]=(n=this.normalizeDateUserFieldValue(i))!=null?n:i)}return e}normalizeDateUserFieldValue(e){let t=e.trim();if(!t)return null;let n=super.parseInput(t);return n.scheduledDate||n.dueDate||null}extractLinkedUserFields(e,t){var i;let n=((i=this.taskNotesNlpTriggers)==null?void 0:i.triggers)||[];if(n.length===0||this.taskNotesUserFields.length===0)return t;let a=t.title;for(let s of n){if(!s.enabled)continue;let o=this.taskNotesUserFields.find(p=>p.id===s.propertyId);if(!o)continue;let l=this.escapeRegexLiteral(s.trigger),c=new RegExp(`${l}(\\[\\[[^\\]]+\\]\\]|\\[[^\\]]+\\]\\([^\\)]+\\))`,"gu"),d=Array.from(e.matchAll(c));if(d.length===0)continue;let u=d.map(p=>p[1]).filter(p=>typeof p=="string"&&p.length>0);if(u.length!==0){if(t.userFields||(t.userFields={}),o.type==="list"){let p=t.userFields[o.id],m=Array.isArray(p)?p:typeof p=="string"?[p]:[];t.userFields[o.id]=[...m,...u]}else t.userFields[o.id]=u[u.length-1];a=a.replace(c,"").replace(/\s+/g," ").trim()}}return t.title=a,t}escapeRegexLiteral(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}});function gbe(r){return r.padStart(2,"0")}function ybe(r,e,t){let n=Number(r),a=Number(e),i=Number(t),s=new Date(n,a-1,i);return s.getFullYear()!==n||s.getMonth()!==a-1||s.getDate()!==i?null:`${r}-${gbe(e)}-${gbe(t)}`}function uV(r){let e=r.trim();if(!e)return null;let t=mat.exec(e);if(t)return ybe(t[1],t[2],t[3]);let n=fat.exec(e);return n?ybe(n[1],n[2],n[3]):null}function pV(r,e,t){var n;r.value=e,(n=t.onCommit)==null||n.call(t,e),r.dispatchEvent(new Event("input",{bubbles:!0})),r.dispatchEvent(new Event("change",{bubbles:!0}))}function hat(r){return r.key.length===1&&/\d/.test(r.key)&&!r.altKey&&!r.ctrlKey&&!r.metaKey}function zc(r,e={}){var c,d;let t="",n=0,a=(c=e.now)!=null?c:(()=>Date.now()),i=(d=e.typeBufferResetMs)!=null?d:1500,s=u=>{if(!hat(u))return;let p=a();p-n>i&&(t=""),n=p,t=`${t}${u.key}`.slice(-8);let m=uV(t);m&&(u.preventDefault(),t="",pV(r,m,e))},o=u=>{var f,h;let p=(h=(f=u.clipboardData)==null?void 0:f.getData("text"))!=null?h:"",m=uV(p);m&&(u.preventDefault(),t="",pV(r,m,e))},l=()=>{let u=uV(r.value);!u||u===r.value||(t="",pV(r,u,e))};return r.addEventListener("keydown",s),r.addEventListener("paste",o),r.addEventListener("input",l),()=>{r.removeEventListener("keydown",s),r.removeEventListener("paste",o),r.removeEventListener("input",l)}}var mat,fat,JC=y(()=>{mat=/^(\d{4})(\d{2})(\d{2})$/,fat=/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})$/});var wbe={};at(wbe,{DateTimePickerModal:()=>$l,formatCalendarDate:()=>kbe,getParsedDateTimeSelection:()=>bbe,parseNaturalLanguageDateTime:()=>Tbe});function vbe(r){return String(r).padStart(2,"0")}function kbe(r,e,t){return`${r}-${vbe(e+1)}-${vbe(t)}`}function bbe(r,e){let t=r.scheduledDate||r.dueDate,n=r.scheduledDate?r.scheduledTime:r.dueTime;if(e==="due"?(t=r.dueDate,n=r.dueTime):e==="scheduled"&&(t=r.scheduledDate,n=r.scheduledTime),t)return{date:t,time:n||null};let a=e==="due"?r.scheduledDate:r.dueDate,i=e==="due"?r.scheduledTime:r.dueTime;return a?{date:a,time:i||null}:null}function Tbe(r,e,t){let n=r.trim();return n?bbe(e.parseInput(n),t):null}function gat(r,e){let t=new Date(r);return t.setDate(t.getDate()+e),t}function yat(r){let e=new Date(r),t=(1-e.getDay()+7)%7||7;return e.setDate(e.getDate()+t),e}var ng,$l,kk=y(()=>{ng=require("obsidian");Lc();JC();$l=class extends ng.Modal{constructor(t,n){var a;super(t);this.naturalLanguageInput=null;this.dateInput=null;this.timeInput=null;this.selectButtonEl=null;this.detachDateInputBehavior=null;this.options=n,this.selectedDate=(a=n.currentDate)!=null?a:null}onOpen(){let{contentEl:t}=this;t.empty(),t.addClass("tasknotes-plugin","date-time-picker-modal"),this.options.title&&t.createEl("h3",{text:this.options.title,cls:"date-time-picker-modal__title"}),this.renderQuickActions(t),this.renderNaturalLanguageInput(t),this.renderDateInput(t),this.shouldShowTime()&&this.renderTimeInput(t),this.renderActions(t),this.updateSelectButtonState(),window.setTimeout(()=>{var n;this.canUseNaturalLanguageInput()&&this.naturalLanguageInput?this.naturalLanguageInput.focus():(n=this.dateInput)==null||n.focus()},100)}onClose(){var t;(t=this.detachDateInputBehavior)==null||t.call(this),this.detachDateInputBehavior=null,this.contentEl.empty()}renderQuickActions(t){let n=new Date,a=[{label:"Today",date:n},{label:"Tomorrow",date:gat(n,1)},{label:"Next week",date:yat(n)}],i=t.createDiv({cls:"date-time-picker-modal__quick-actions"});for(let s of a)i.createEl("button",{text:s.label,cls:"date-time-picker-modal__quick-button",attr:{type:"button"}}).addEventListener("click",()=>{this.selectDate(kbe(s.date.getFullYear(),s.date.getMonth(),s.date.getDate()))})}renderNaturalLanguageInput(t){if(!this.canUseNaturalLanguageInput())return;let n=t.createDiv({cls:"date-time-picker-modal__nlp-row"});this.naturalLanguageInput=n.createEl("input",{cls:"date-time-picker-modal__nlp-input",attr:{type:"text",placeholder:"Tomorrow at 3pm","aria-label":"Natural language date"}}),this.naturalLanguageInput.addEventListener("keydown",i=>{i.key==="Enter"&&(i.preventDefault(),this.applyNaturalLanguageInput())});let a=n.createEl("button",{cls:"clickable-icon date-time-picker-modal__nlp-button",attr:{type:"button","aria-label":"Apply natural language date",title:"Apply natural language date"}});(0,ng.setIcon)(a,"wand"),a.addEventListener("click",()=>this.applyNaturalLanguageInput())}renderDateInput(t){var o;let n=t.createDiv({cls:"date-time-picker-modal__date-field"});n.createEl("label",{text:"Date",cls:"date-time-picker-modal__field-label",attr:{for:"tasknotes-date-time-picker-date"}});let a=n.createDiv({cls:"date-time-picker-modal__native-date-control"});this.dateInput=a.createEl("input",{cls:"date-time-picker-modal__date-input",attr:{id:"tasknotes-date-time-picker-date",type:"date",value:(o=this.selectedDate)!=null?o:"","aria-label":"Date"}});let i=()=>{var l;this.updateSelectedDate(((l=this.dateInput)==null?void 0:l.value)||null)};this.dateInput.addEventListener("input",i),this.dateInput.addEventListener("change",i),this.detachDateInputBehavior=zc(this.dateInput,{onCommit:l=>this.updateSelectedDate(l)}),this.dateInput.addEventListener("keydown",l=>{var c;l.key==="Enter"&&((c=this.dateInput)!=null&&c.value)&&(l.preventDefault(),this.updateSelectedDate(this.dateInput.value),this.confirmSelectedDate())});let s=a.createEl("button",{cls:"clickable-icon date-time-picker-modal__native-date-button",attr:{type:"button","aria-label":"Open native date picker",title:"Open native date picker"}});(0,ng.setIcon)(s,"calendar-days"),s.addEventListener("click",()=>{var l,c,d;(c=(l=this.dateInput)==null?void 0:l.showPicker)==null||c.call(l),(d=this.dateInput)==null||d.focus()})}renderTimeInput(t){var a;let n=t.createDiv({cls:"date-time-picker-modal__time-field"});n.createEl("label",{text:"Time (optional)",cls:"date-time-picker-modal__field-label",attr:{for:"tasknotes-date-time-picker-time"}}),this.timeInput=n.createEl("input",{cls:"date-time-picker-modal__time-input",attr:{id:"tasknotes-date-time-picker-time",type:"time",value:(a=this.options.currentTime)!=null?a:""}}),this.timeInput.addEventListener("keydown",i=>{i.key==="Enter"&&this.selectedDate&&(i.preventDefault(),this.confirmSelectedDate())})}renderActions(t){let n=t.createDiv({cls:"date-time-picker-modal__actions"});this.options.currentDate&&n.createEl("button",{text:"Clear date",cls:"date-time-picker-modal__action-button",attr:{type:"button"}}).addEventListener("click",()=>{this.options.onSelect(null,null),this.close()}),n.createEl("button",{text:"Cancel",cls:"date-time-picker-modal__action-button",attr:{type:"button"}}).addEventListener("click",()=>this.close()),this.selectButtonEl=n.createEl("button",{text:"Select",cls:"mod-cta date-time-picker-modal__action-button",attr:{type:"button"}}),this.selectButtonEl.addEventListener("click",()=>this.confirmSelectedDate())}selectDate(t){this.updateSelectedDate(t),this.confirmSelectedDate()}updateSelectedDate(t){this.selectedDate=t,this.dateInput&&this.dateInput.value!==(t!=null?t:"")&&(this.dateInput.value=t!=null?t:""),this.updateSelectButtonState()}confirmSelectedDate(){var t;this.selectedDate&&(this.options.onSelect(this.selectedDate,this.shouldShowTime()&&((t=this.timeInput)==null?void 0:t.value)||null),this.close())}updateSelectButtonState(){this.selectButtonEl&&(this.selectButtonEl.disabled=!this.selectedDate)}canUseNaturalLanguageInput(){var t;return this.options.naturalLanguageParser?!0:!!((t=this.options.plugin)!=null&&t.settings.enableNaturalLanguageInput)}shouldShowTime(){return this.options.showTime!==!1}getNaturalLanguageParser(){var t;return this.options.naturalLanguageParser?this.options.naturalLanguageParser:(t=this.options.plugin)!=null&&t.settings.enableNaturalLanguageInput?ra.fromPlugin(this.options.plugin):null}applyNaturalLanguageInput(){var i,s;let t=this.getNaturalLanguageParser(),n=(s=(i=this.naturalLanguageInput)==null?void 0:i.value)!=null?s:"",a=t?Tbe(n,t,this.options.dateRole):null;if(!a){new ng.Notice("Could not find a date in that text.");return}this.options.onSelect(a.date,this.shouldShowTime()?a.time:null),this.close()}}});var xbe={};at(xbe,{DateContextMenu:()=>Bl});function kat(r){if(!r||typeof r!="object")return null;let e=r;return e.nodeType!==1||typeof e.closest!="function"?null:e}function bat(){return(0,Sbe.moment)()}function Tat(r){return r.setSubmenu()}var Sbe,vat,$a,Bl,bk=y(()=>{Sbe=require("obsidian");Pu();kk();Me();K();vat=N({tag:"Components/DateContextMenu"});$a=class $a{constructor(e){this.menu=new Ea,this.options=e,this.buildMenu()}t(e,t,n){var a;return((a=this.options.plugin)==null?void 0:a.i18n.translate(e,n))||t||e}getFirstDayOfWeek(){var t,n,a;let e=(a=(n=(t=this.options.plugin)==null?void 0:t.settings)==null?void 0:n.calendarViewSettings)==null?void 0:a.firstDay;return typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=6?e:0}buildMenu(){this.options.title&&(this.menu.addItem(i=>{i.setTitle(this.options.title||""),i.setIcon("calendar"),i.setDisabled(!0)}),this.menu.addSeparator());let e=this.getDateOptions(),t=e.filter(i=>i.category==="increment");t.length>0&&(t.forEach(i=>{this.menu.addItem(s=>{i.icon&&s.setIcon(i.icon),s.setTitle(i.label),s.onClick(async()=>{this.options.onSelect(i.value,null)})})}),this.menu.addSeparator()),e.filter(i=>i.category==="basic").forEach(i=>{this.menu.addItem(s=>{i.icon&&s.setIcon(i.icon);let l=i.value&&i.value===this.options.currentValue?this.t("contextMenus.date.selected","\u2713 {label}",{label:i.label}):i.label;s.setTitle(l),s.onClick(async()=>{this.options.onSelect(i.value,null)})})});let a=e.filter(i=>i.category==="weekday");a.length>0&&(this.menu.addSeparator(),this.menu.addItem(i=>{i.setTitle(this.t("contextMenus.date.weekdaysLabel","Weekdays")),i.setIcon("calendar");let s=Tat(i);a.forEach(o=>{s.addItem(l=>{let d=o.value&&o.value===this.options.currentValue?this.t("contextMenus.date.selected","\u2713 {label}",{label:o.label}):o.label;l.setTitle(d),l.setIcon("calendar"),l.onClick(async()=>{this.options.onSelect(o.value,null)})})})})),this.menu.addSeparator(),this.menu.addItem(i=>{i.setTitle(this.t("contextMenus.date.pickDateTime","Pick date & time\u2026")),i.setIcon("calendar"),i.onClick(async()=>{this.showDateTimePicker()})}),this.options.currentValue&&this.menu.addItem(i=>{i.setTitle(this.t("contextMenus.date.clearDate","Clear date")),i.setIcon("x"),i.onClick(async()=>{this.options.onSelect(null,null)})})}static closeActiveMenu(){let e=$a.activeMenu;$a.activeMenu=null,$a.activeTrigger=null,e==null||e.hide()}static getTriggerFromEvent(e){var n;let t=kat(e.target);return(n=t==null?void 0:t.closest('[data-tn-action="edit-date"], .task-card__metadata-date'))!=null?n:null}showWithTrigger(e,t){if(e&&$a.activeMenu&&$a.activeTrigger===e){$a.closeActiveMenu();return}$a.closeActiveMenu(),$a.activeMenu=this.menu,$a.activeTrigger=e,this.menu.onHide(()=>{$a.activeMenu===this.menu&&($a.activeMenu=null,$a.activeTrigger=null)}),t()}getDateOptions(){let e=bat(),t=[];this.options.currentValue&&(t.push({label:this.t("contextMenus.date.increment.plusOneDay","+1 day"),value:Lv(this.options.currentValue,1),icon:"plus",category:"increment"}),t.push({label:this.t("contextMenus.date.increment.minusOneDay","-1 day"),value:Lv(this.options.currentValue,-1),icon:"minus",category:"increment"}),t.push({label:this.t("contextMenus.date.increment.plusOneWeek","+1 week"),value:Lv(this.options.currentValue,7),icon:"plus-circle",category:"increment"}),t.push({label:this.t("contextMenus.date.increment.minusOneWeek","-1 week"),value:Lv(this.options.currentValue,-7),icon:"minus-circle",category:"increment"})),t.push({label:this.t("contextMenus.date.basic.today","Today"),value:e.format("YYYY-MM-DD"),icon:"calendar-check",isToday:!0,category:"basic"}),t.push({label:this.t("contextMenus.date.basic.tomorrow","Tomorrow"),value:e.clone().add(1,"day").format("YYYY-MM-DD"),icon:"calendar-plus",category:"basic"});let n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],a=this.getFirstDayOfWeek();[...n.slice(a),...n.slice(0,a)].forEach(c=>{let d=n.indexOf(c),u=e.clone().day(d);u.isSameOrBefore(e,"day")&&(u=u.add(1,"week"));let p=this.t(`common.weekdays.${c.toLowerCase()}`,c);t.push({label:p,value:u.format("YYYY-MM-DD"),icon:"calendar",category:"weekday"})});let s=e.clone().day(6);(s.isBefore(e)||s.isSame(e,"day"))&&s.add(1,"week"),t.push({label:this.t("contextMenus.date.basic.thisWeekend","This weekend"),value:s.format("YYYY-MM-DD"),icon:"calendar-days",category:"basic"});let o=e.clone().day(1).add(1,"week");t.push({label:this.t("contextMenus.date.basic.nextWeek","Next week"),value:o.format("YYYY-MM-DD"),icon:"calendar-plus",category:"basic"});let l=e.clone().add(1,"month").startOf("month");return t.push({label:this.t("contextMenus.date.basic.nextMonth","Next month"),value:l.format("YYYY-MM-DD"),icon:"calendar-range",category:"basic"}),t}show(e){this.showWithTrigger($a.getTriggerFromEvent(e),()=>{this.menu.show(e)})}showAtElement(e){this.showWithTrigger(e,()=>{this.menu.showAtPosition({x:e.getBoundingClientRect().left,y:e.getBoundingClientRect().bottom+4})})}showDateTimePicker(){var n;let e=this.options.app||((n=this.options.plugin)==null?void 0:n.app);if(!e){vat.error("DateContextMenu: No app instance available for modal",{category:"validation",operation:"datecontextmenu-no-app-instance-modal"});return}new $l(e,{currentDate:this.options.currentValue||null,currentTime:this.options.currentTime||null,title:this.t("contextMenus.date.modal.title","Set date & time"),dateRole:this.options.dateRole,plugin:this.options.plugin,onSelect:(a,i)=>{this.options.onSelect(a,i)}}).open()}};$a.activeMenu=null,$a.activeTrigger=null;Bl=$a});async function Ir(r,e){return new XC(r,e).show()}var MI,XC,ro=y(()=>{MI=require("obsidian"),XC=class extends MI.Modal{constructor(e,t){super(e),this.options={confirmText:"Confirm",cancelText:"Cancel",isDestructive:!1,...t}}show(){return new Promise(e=>{this.resolve=e,this.open()})}onOpen(){let{contentEl:e}=this;e.empty(),new MI.Setting(e).setName(this.options.title).setHeading(),e.createEl("p",{text:this.options.message});let t=e.createDiv({cls:"modal-button-container"});t.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),t.classList.add("tn-static-display-flex-75816cae"),t.classList.remove("tn-static-display-flex-8bb39979","tn-static-gap-0-5rem-ce2fca4d","tn-static-gap-12px-ed7b3d87","tn-static-gap-6px-f0abc1db","tn-static-gap-8px-33fcd4c3"),t.classList.add("tn-static-gap-10px-f3d7ce77"),t.classList.remove("tn-static-justify-content-center-03c4bb6f","tn-static-justify-content-space-between-a562f4fd"),t.classList.add("tn-static-justify-content-flex-end-455f8cca"),t.classList.remove("tn-static-font-size-12px-b0cc7e05","tn-static-margin-top-0-5rem-3dc98b5e","tn-static-margin-top-0-d462248a","tn-static-margin-top-12px-91e0f558","tn-static-margin-top-16px-1b0f4999","tn-static-margin-top-1rem-2239d6d5","tn-static-margin-top-30px-2fbbbcd4","tn-static-margin-top-4px-96ad6099","tn-static-margin-top-8px-8a77e5a3","tn-static-margin-top-8px-f4f01e68"),t.classList.add("tn-static-margin-top-20px-a26bda7d");let n=null;this.options.thirdButtonText&&(n=t.createEl("button",{text:this.options.thirdButtonText}),n.addEventListener("click",()=>{this.options.onThirdButton&&this.options.onThirdButton(),this.close()}));let a=t.createEl("button",{text:this.options.cancelText});a.addEventListener("click",()=>{this.resolve(!1),this.close()});let i=t.createEl("button",{text:this.options.confirmText,cls:this.options.isDestructive?"mod-warning":"mod-cta"});this.options.isDestructive&&(i.classList.remove("tn-static-background-color-var-background-mo-94b219f0","tn-static-background-color-var-background-se-9087a23e","tn-static-background-color-var-color-base-40-ef5f175e","tn-static-background-color-var-text-accent-a954c70f"),i.classList.add("tn-static-background-color-var-color-red-134bc721"),i.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-muted-5872de20","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),i.classList.add("tn-static-color-white-0a43e56a")),i.addEventListener("click",()=>{this.resolve(!0),this.close()}),window.setTimeout(()=>{this.options.defaultToConfirm?i.focus():a.focus()},0)}onClose(){let{contentEl:e}=this;e.empty(),this.resolve&&this.resolve(!1)}}});async function Tk(r,e){return new mV(r,e).show()}var eE,mV,fV=y(()=>{eE=require("obsidian"),mV=class extends eE.Modal{constructor(e,t){super(e),this.options={confirmText:"Confirm",cancelText:"Cancel",...t}}show(){return new Promise(e=>{this.resolve=e,this.open()})}onOpen(){let{contentEl:e}=this;e.empty(),new eE.Setting(e).setName(this.options.title).setHeading(),new eE.Setting(e).addText(i=>{var s,o;this.inputEl=i.inputEl,i.setPlaceholder(this.options.placeholder||"").setValue(this.options.initialValue||"").onChange(()=>{}),window.setTimeout(()=>{this.inputEl.focus(),this.inputEl.select()},100),(o=(s=this.options).onInputReady)==null||o.call(s,this.inputEl)});let t=e.createDiv({cls:"modal-button-container"});t.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),t.classList.add("tn-static-display-flex-75816cae"),t.classList.remove("tn-static-display-flex-8bb39979","tn-static-gap-0-5rem-ce2fca4d","tn-static-gap-12px-ed7b3d87","tn-static-gap-6px-f0abc1db","tn-static-gap-8px-33fcd4c3"),t.classList.add("tn-static-gap-10px-f3d7ce77"),t.classList.remove("tn-static-justify-content-center-03c4bb6f","tn-static-justify-content-space-between-a562f4fd"),t.classList.add("tn-static-justify-content-flex-end-455f8cca"),t.classList.remove("tn-static-font-size-12px-b0cc7e05","tn-static-margin-top-0-5rem-3dc98b5e","tn-static-margin-top-0-d462248a","tn-static-margin-top-12px-91e0f558","tn-static-margin-top-16px-1b0f4999","tn-static-margin-top-1rem-2239d6d5","tn-static-margin-top-30px-2fbbbcd4","tn-static-margin-top-4px-96ad6099","tn-static-margin-top-8px-8a77e5a3","tn-static-margin-top-8px-f4f01e68"),t.classList.add("tn-static-margin-top-20px-a26bda7d");let n=t.createEl("button",{text:this.options.cancelText});n.addEventListener("click",()=>{this.resolve(null),this.close()});let a=t.createEl("button",{text:this.options.confirmText,cls:"mod-cta"});a.addEventListener("click",()=>{let i=this.inputEl.value.trim();this.resolve(i||null),this.close()}),this.inputEl.addEventListener("keydown",i=>{i.key==="Enter"?(i.preventDefault(),a.click()):i.key==="Escape"&&(i.preventDefault(),n.click())})}onClose(){let{contentEl:e}=this;e.empty(),this.resolve&&this.resolve(null)}}});function jc(r){let e=r.trim();return e.startsWith("#")?e.slice(1):e}function wat(r,e){let t=jc(r),n=jc(e);return!t||!n?!1:t.toLowerCase()===n.toLowerCase()}function AI(r,e,t="all"){let n=jc(r),a=jc(e);return t==="exact-only"?wat(n,a):br.matchesHierarchicalTagExact(n,a)}function Lu(r,e,t="all"){return r.filter(n=>!AI(n,e,t))}function hV(r){return r.taskIdentificationMethod==="tag"&&!!r.hideIdentifyingTagsInCards&&!!r.taskTag}function _I(r,e){return hV(e)?Lu(r,e.taskTag,e.hideIdentifyingTagsMode):[...r]}function Cbe(r,e,t,n="all"){let a=[...r],i=e.filter(o=>AI(o,t,n)).map(jc),s=i.length>0?i:[jc(t)];for(let o of s)o&&(a.some(l=>jc(l)===o)||a.push(o));return a}var fm=y(()=>{Du()});function Ebe(r,e){r.addEventListener("focus",e),r.addEventListener("click",e)}var RI,Sat,II,hm,NI,tE=y(()=>{RI=require("obsidian");fm();K();Sat=N({tag:"Modals/TaskModalSuggests"});II=class extends RI.AbstractInputSuggest{constructor(e,t,n){super(e,t),this.plugin=n,this.input=t,Ebe(this.input,()=>this.open())}async getSuggestions(e){let t=this.input.value.split(",").map(s=>s.trim()),n=t[t.length-1],a=this.plugin.cacheManager.getAllContexts(),i=t.slice(0,-1);return a.filter(s=>s&&typeof s=="string").filter(s=>!i.includes(s)&&(!n||s.toLowerCase().includes(n.toLowerCase()))).slice(0,10).map(s=>({value:s,display:s,type:"context",toString(){return this.value}}))}renderSuggestion(e,t){t.textContent=e.display}selectSuggestion(e){let t=this.input.value.split(",").map(n=>n.trim());t[t.length-1]=e.value,this.input.value=t.join(", ")+", ",this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.focus()}},hm=class extends RI.AbstractInputSuggest{constructor(e,t,n){super(e,t),this.plugin=n,this.input=t,Ebe(this.input,()=>this.open())}async getSuggestions(e){let t=this.input.value.split(",").map(s=>s.trim()),n=t[t.length-1],a=_I(this.plugin.cacheManager.getAllTags(),this.plugin.settings),i=t.slice(0,-1);return a.filter(s=>s&&typeof s=="string").filter(s=>!i.includes(s)&&(!n||s.toLowerCase().includes(n.toLowerCase()))).slice(0,10).map(s=>({value:s,display:s,type:"tag",toString(){return this.value}}))}renderSuggestion(e,t){t.textContent=e.display}selectSuggestion(e){let t=this.input.value.split(",").map(n=>n.trim());t[t.length-1]=e.value,this.input.value=t.join(", ")+", ",this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.focus()}},NI=class extends RI.AbstractInputSuggest{constructor(e,t,n,a){super(e,t),this.plugin=n,this.input=t,this.fieldConfig=a}async getSuggestions(e){let t=this.fieldConfig.type==="list",n="",a=[];if(t?(a=this.input.value.split(",").map(o=>o.trim()),n=a[a.length-1]||""):n=this.input.value.trim(),!n)return[];let i=n.match(/\[\[([^\]]*)$/);if(i){let o=i[1]||"",{FileSuggestHelper:l}=await Promise.resolve().then(()=>(jS(),eU));return(await l.suggest(this.plugin,o,20,this.fieldConfig.autosuggestFilter)).map(d=>({value:d.insertText,display:d.displayText,type:"user-field",fieldKey:this.fieldConfig.key,toString(){return this.value}}))}return(await this.getExistingUserFieldValues(this.fieldConfig.key)).filter(o=>o&&typeof o=="string").filter(o=>o.toLowerCase().includes(n.toLowerCase())&&(!t||!a.slice(0,-1).includes(o))).slice(0,10).map(o=>({value:o,display:o,type:"user-field",fieldKey:this.fieldConfig.key,toString(){return this.value}}))}async getExistingUserFieldValues(e){var a,i;let t=async()=>{try{let s=this.plugin.app.vault.getMarkdownFiles(),o=new Set;for(let l of s)try{let c=this.plugin.app.metadataCache.getFileCache(l),d=c==null?void 0:c.frontmatter;if(d&&d[e]!==void 0){let u=d[e];Array.isArray(u)?u.forEach(p=>{typeof p=="string"&&p.trim()&&o.add(p.trim())}):typeof u=="string"&&u.trim()?o.add(u.trim()):(typeof u=="number"||typeof u=="boolean")&&o.add(u.toString())}if(o.size>=200)break}catch(c){continue}return Array.from(o).sort()}catch(s){return Sat.error("Error getting user field values:",{category:"persistence",operation:"getting-user-field-values",error:s}),[]}},n=(i=(a=this.plugin.settings)==null?void 0:a.suggestionDebounceMs)!=null?i:0;return n?new Promise(s=>{let o=this.plugin;o.__userFieldSuggestTimer&&window.clearTimeout(o.__userFieldSuggestTimer),o.__userFieldSuggestTimer=window.setTimeout(()=>{(async()=>s(await t()))()},n)}):t()}renderSuggestion(e,t){t.textContent=e.display}selectSuggestion(e){var n;if(this.fieldConfig.type==="list"){let a=this.input.value.split(","),i=(n=a.pop())!=null?n:"",s=a.join(","),o=i.trim(),l=/\[\[/.test(o)?o.replace(/\[\[[^\]]*$/,`[[${e.value}]]`):e.value,c=(s?s+", ":"")+l;this.input.value=c.endsWith(",")?c+" ":c+", "}else{let a=this.input.value,i=a.replace(/\[\[[^\]]*$/,`[[${e.value}]]`);this.input.value=i===a?e.value:i}this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.focus()}}});function FI(r,e,t=n=>n.path){return r.map(n=>{switch(e){case"filenames":return Dbe(n.path);case"markdown-links":return`[[${t(n)}]]`;case"titles":return n.title||Dbe(n.path);case"paths":return n.path}}).join(` `)}function Dbe(r){return(r.split("/").pop()||r).replace(/\.md$/i,"")}var gV=y(()=>{});function wk(r){let e=new Set,t=[];for(let n of r!=null?r:[]){if(typeof n!="string")continue;let a=jc(n);!a||e.has(a)||(e.add(a),t.push(a))}return t}function rE(r){return!r||typeof r!="string"?[]:wk(r.split(","))}function Pbe(r,e){let t=wk(r.tags);return e.taskIdentificationMethod!=="tag"?t:Lu(t,e.taskTag,e.hideIdentifyingTagsMode)}function OI(r,e){let t=wk(r),n=new Set(t);for(let a of e){let i=jc(a);!i||n.has(i)||(n.add(i),t.push(i))}return t.length>0?t:void 0}function nE(r,e){let t=new Set(rE(e.join(",")));if(t.size===0){let a=wk(r);return a.length>0?a:void 0}let n=wk(r).filter(a=>!t.has(a));return n.length>0?n:void 0}function LI(r,e){let t=wk(r);if(e.taskIdentificationMethod!=="tag")return;let n=t.filter(a=>AI(a,e.taskTag,e.hideIdentifyingTagsMode));return n.length>0?n:void 0}var yV=y(()=>{fm()});function Sk(r){return r.setSubmenu()}function Mbe(r){var t,n;let e=r;return(n=(t=e.dom)!=null?t:e.domEl)!=null?n:null}var na,gm,xk,vV=y(()=>{na=require("obsidian");bk();Pu();ro();fV();tE();gV();yV();K();gm=N({tag:"Components/BatchContextMenu"});xk=class{constructor(e){this.menu=new Ea,this.options=e,this.buildMenu()}t(e,t){return this.options.plugin.i18n.translate(e,t)}buildMenu(){let{selectedPaths:e}=this.options,t=e.length;this.menu.addItem(n=>{n.setTitle(`${t} tasks selected`),n.setIcon("check-square"),n.setDisabled(!0)}),this.menu.addSeparator(),this.menu.addItem(n=>{n.setTitle(this.t("contextMenus.task.status")),n.setIcon("circle");let a=Sk(n);this.addStatusOptions(a)}),this.menu.addItem(n=>{n.setTitle(this.t("contextMenus.task.priority")),n.setIcon("star");let a=Sk(n);this.addPriorityOptions(a)}),this.menu.addItem(n=>{n.setTitle(this.t("contextMenus.task.tags")),n.setIcon("tags");let a=Sk(n);this.addTagOptions(a)}),this.menu.addSeparator(),this.menu.addItem(n=>{n.setTitle(this.t("contextMenus.task.dueDate")),n.setIcon("calendar");let a=Sk(n);this.addDateOptions(a,"due")}),this.menu.addItem(n=>{n.setTitle(this.t("contextMenus.task.scheduledDate")),n.setIcon("calendar-clock");let a=Sk(n);this.addDateOptions(a,"scheduled")}),this.menu.addSeparator(),this.menu.addItem(n=>{n.setTitle(this.t("contextMenus.task.archive")),n.setIcon("archive"),n.onClick(async()=>{await this.batchArchive(!0)})}),this.menu.addItem(n=>{n.setTitle(this.t("contextMenus.task.unarchive")),n.setIcon("archive-restore"),n.onClick(async()=>{await this.batchArchive(!1)})}),this.menu.addSeparator(),this.menu.addItem(n=>{n.setTitle("Copy selected tasks"),n.setIcon("copy");let a=Sk(n);this.addCopyOptions(a)}),this.menu.addSeparator(),this.menu.addItem(n=>{n.setTitle("Clear selection"),n.setIcon("x"),n.onClick(()=>{var a,i;(a=this.options.plugin.taskSelectionService)==null||a.clearSelection(),(i=this.options.plugin.taskSelectionService)==null||i.exitSelectionMode()})}),this.menu.addSeparator(),this.menu.addItem(n=>{n.setTitle(`Delete ${t} tasks`),n.setIcon("trash"),n.onClick(async()=>{await this.batchDelete()})})}addTagOptions(e){e.addItem(t=>{t.setTitle(this.t("contextMenus.task.addTag")),t.setIcon("plus"),t.onClick(()=>{this.openBatchTagInput("add")})}),e.addItem(t=>{t.setTitle(this.t("contextMenus.task.removeTagInput")),t.setIcon("x"),t.onClick(()=>{this.openBatchTagInput("remove")})}),e.addSeparator(),e.addItem(t=>{t.setTitle(this.t("contextMenus.task.clearTags")),t.setIcon("eraser"),t.onClick(async()=>{await this.batchUpdateTags(n=>LI(n.tags,this.options.plugin.settings))})})}addCopyOptions(e){let t=[{title:"Copy filenames",icon:"file-text",format:"filenames"},{title:"Copy Markdown links",icon:"link",format:"markdown-links"},{title:"Copy titles",icon:"text",format:"titles"},{title:"Copy paths",icon:"copy",format:"paths"}];for(let n of t)e.addItem(a=>{a.setTitle(n.title),a.setIcon(n.icon),a.onClick(async()=>{await this.copySelectedTasks(n.format)})})}addStatusOptions(e){let n=[...this.options.plugin.settings.customStatuses].sort((a,i)=>a.order-i.order);for(let a of n)e.addItem(i=>{i.setTitle(a.label),i.setIcon(a.icon||"circle"),i.onClick(async()=>{await this.batchUpdateProperty("status",a.value)}),a.color&&window.setTimeout(()=>{let s=Mbe(i);if(s){let o=s.querySelector(".menu-item-icon");o&&(o.style.color=a.color)}},10)})}addPriorityOptions(e){let t=this.options.plugin.priorityManager.getPrioritiesByWeight();for(let n of t)e.addItem(a=>{a.setTitle(n.label),a.setIcon("star"),a.onClick(async()=>{await this.batchUpdateProperty("priority",n.value)}),n.color&&window.setTimeout(()=>{let i=Mbe(a);if(i){let s=i.querySelector(".menu-item-icon");s&&(s.style.color=n.color)}},10)});e.addSeparator(),e.addItem(n=>{n.setTitle(this.t("contextMenus.priority.clearPriority")),n.setIcon("x"),n.onClick(async()=>{await this.batchUpdateProperty("priority",void 0)})})}addDateOptions(e,t){let i=new Bl({currentValue:void 0,onSelect:()=>{},plugin:this.options.plugin,app:this.options.plugin.app}).getDateOptions().filter(s=>s.category==="basic");for(let s of i)e.addItem(o=>{s.icon&&o.setIcon(s.icon),o.setTitle(s.label),o.onClick(async()=>{await this.batchUpdateProperty(t,s.value)})});e.addSeparator(),e.addItem(s=>{s.setTitle(this.t("contextMenus.date.clearDate")),s.setIcon("x"),s.onClick(async()=>{await this.batchUpdateProperty(t,void 0)})})}async openBatchTagInput(e){let{plugin:t}=this.options,n=await Tk(t.app,{title:e==="add"?this.t("contextMenus.task.addTag"):this.t("contextMenus.task.removeTagInput"),placeholder:this.t("contextMenus.task.tagPlaceholder"),confirmText:this.t("common.confirm"),cancelText:this.t("common.cancel"),onInputReady:i=>{new hm(t.app,i,t)}}),a=rE(n);a.length!==0&&await this.batchUpdateTags(i=>e==="add"?OI(i.tags,a):nE(i.tags,a))}async copySelectedTasks(e){let{plugin:t,selectedPaths:n}=this.options,a=[];for(let s of n){let o=await t.cacheManager.getTaskInfo(s);a.push({path:s,title:o==null?void 0:o.title})}let i=FI(a,e,s=>this.getMarkdownLinkText(s.path));await navigator.clipboard.writeText(i),new na.Notice(`Copied ${a.length} tasks`)}getMarkdownLinkText(e){let t=this.options.plugin.app.vault.getAbstractFileByPath(e);return t instanceof na.TFile?this.options.plugin.app.metadataCache.fileToLinktext(t,""):e}async batchUpdateTags(e){var s,o;let{plugin:t,selectedPaths:n,onUpdate:a}=this.options,i=n.length;try{new na.Notice(`Updating tags on ${i} tasks...`);let l=0,c=0;for(let d of n)try{let u=await t.cacheManager.getTaskInfo(d);u?(await t.taskService.updateProperty(u,"tags",e(u)),l++):c++}catch(u){gm.error(`[BatchContextMenu] Failed to update tags for ${d}:`,{category:"validation",operation:"update-tags",error:u}),c++}c===0?new na.Notice(`Updated tags on ${l} tasks`):new na.Notice(`Updated tags on ${l} tasks, ${c} failed`),(s=t.taskSelectionService)==null||s.clearSelection(),(o=t.taskSelectionService)==null||o.exitSelectionMode(),a==null||a()}catch(l){gm.error("[BatchContextMenu] Batch tag update failed:",{category:"validation",operation:"batch-tag-update",error:l}),new na.Notice(this.t("contextMenus.task.notices.updateTagsFailed"))}}async batchUpdateProperty(e,t){var o,l;let{plugin:n,selectedPaths:a,onUpdate:i}=this.options,s=a.length;try{new na.Notice(`Updating ${s} tasks...`);let c=0,d=0;for(let u of a)try{let p=await n.cacheManager.getTaskInfo(u);p?(await n.taskService.updateProperty(p,e,t),c++):d++}catch(p){gm.error(`[BatchContextMenu] Failed to update task ${u}:`,{category:"validation",operation:"update-task",error:p}),d++}d===0?new na.Notice(`Updated ${c} tasks`):new na.Notice(`Updated ${c} tasks, ${d} failed`),(o=n.taskSelectionService)==null||o.clearSelection(),(l=n.taskSelectionService)==null||l.exitSelectionMode(),i==null||i()}catch(c){gm.error("[BatchContextMenu] Batch update failed:",{category:"validation",operation:"batch-update",error:c}),new na.Notice("Failed to update tasks")}}async batchArchive(e){var s,o;let{plugin:t,selectedPaths:n,onUpdate:a}=this.options,i=n.length;try{new na.Notice(`${e?"Archiving":"Unarchiving"} ${i} tasks...`);let l=0,c=0;for(let d of n)try{let u=await t.cacheManager.getTaskInfo(d);u&&u.archived!==e?(await t.toggleTaskArchive(u),l++):u?l++:c++}catch(u){gm.error(`[BatchContextMenu] Failed to archive task ${d}:`,{category:"persistence",operation:"archive-task",error:u}),c++}c===0?new na.Notice(`${e?"Archived":"Unarchived"} ${l} tasks`):new na.Notice(`${e?"Archived":"Unarchived"} ${l} tasks, ${c} failed`),(s=t.taskSelectionService)==null||s.clearSelection(),(o=t.taskSelectionService)==null||o.exitSelectionMode(),a==null||a()}catch(l){gm.error("[BatchContextMenu] Batch archive failed:",{category:"persistence",operation:"batch-archive",error:l}),new na.Notice("Failed to archive tasks")}}async batchDelete(){var s,o;let{plugin:e,selectedPaths:t,onUpdate:n}=this.options,a=t.length;if(await Ir(e.app,{title:"Delete tasks",message:`Are you sure you want to delete ${a} tasks? This action cannot be undone.`,confirmText:"Delete",cancelText:this.t("common.cancel"),isDestructive:!0}))try{new na.Notice(`Deleting ${a} tasks...`);let l=0,c=0;for(let d of t)try{let u=await e.cacheManager.getTaskInfo(d);u?(await e.taskService.deleteTask(u),l++):c++}catch(u){gm.error(`[BatchContextMenu] Failed to delete task ${d}:`,{category:"persistence",operation:"delete-task",error:u}),c++}c===0?new na.Notice(`Deleted ${l} tasks`):new na.Notice(`Deleted ${l} tasks, ${c} failed`),(s=e.taskSelectionService)==null||s.clearSelection(),(o=e.taskSelectionService)==null||o.exitSelectionMode(),n==null||n()}catch(l){gm.error("[BatchContextMenu] Batch delete failed:",{category:"persistence",operation:"batch-delete",error:l}),new na.Notice("Failed to delete tasks")}}show(e){this.menu.showAtMouseEvent(e)}showAtPosition(e,t){this.menu.showAtPosition({x:e,y:t})}}});function Cat(r){return xat.includes(r)}function $i(r,e){return r.map(t=>Cat(t)?t:t in e.fieldMapper.getMapping()?e.fieldMapper.toUserField(t):t)}function Ck(r,e,t){return t.fieldMapper.isPropertyForField(r,e)}var xat,$c=y(()=>{xat=["tags","blocked","blocking"]});var aE,Eat,Dat,Pat,Mat,Aat,_at,Iat,kV,pa,ag=y(()=>{t_();t_();aE=["status","priority","due","scheduled","projects","contexts"],Eat=[{id:"none",value:"none",label:"None",color:"#cccccc",isCompleted:!1,excludeFromCycle:!1,order:0,autoArchive:!1,autoArchiveDelay:5},{id:"open",value:"open",label:"Open",color:"#808080",isCompleted:!1,excludeFromCycle:!1,order:1,autoArchive:!1,autoArchiveDelay:5},{id:"in-progress",value:"in-progress",label:"In progress",color:"#0066cc",isCompleted:!1,excludeFromCycle:!1,order:2,autoArchive:!1,autoArchiveDelay:5},{id:"done",value:"done",label:"Done",color:"#00aa00",isCompleted:!0,excludeFromCycle:!1,order:3,autoArchive:!1,autoArchiveDelay:5}],Dat=[{id:"none",value:"none",label:"None",color:"#cccccc",weight:0},{id:"low",value:"low",label:"Low",color:"#00aa00",weight:1},{id:"normal",value:"normal",label:"Normal",color:"#ffaa00",weight:2},{id:"high",value:"high",label:"High",color:"#ff0000",weight:3}],Pat={defaultContexts:"",defaultTags:"",defaultProjects:"",useParentNoteForTaskCreation:!1,useParentNoteAsProject:!1,useParentHeaderAsProject:!1,inheritParentTaskProperties:!1,defaultTimeEstimate:0,defaultRecurrence:"none",defaultDueDate:"none",defaultDueTime:"none",defaultScheduledDate:"today",defaultScheduledTime:"none",bodyTemplate:"",useBodyTemplate:!1,occurrenceBodyTemplate:"",useOccurrenceBodyTemplate:!1,defaultReminders:[]},Mat={defaultView:"dayGridMonth",customDayCount:3,slotDuration:"00:30:00",slotMinTime:"00:00:00",slotMaxTime:"24:00:00",scrollTime:"08:00:00",firstDay:1,timeFormat:"24",showWeekends:!0,locale:"",defaultShowScheduled:!0,defaultShowDue:!0,defaultShowDueWhenScheduled:!0,defaultShowScheduledToDueSpan:!1,defaultShowTimeEntries:!1,defaultShowRecurring:!0,defaultShowICSEvents:!0,enableTimeblocking:!1,defaultShowTimeblocks:!0,defaultTimeblockColor:"#6366f1",timeblockAttachmentSearchOrder:"name-asc",nowIndicator:!0,selectMirror:!0,weekNumbers:!1,showTodayHighlight:!0,eventMinHeight:15,slotEventOverlap:!0,eventMaxStack:null,dayMaxEvents:!0,dayMaxEventRows:!1},Aat={defaultNoteTemplate:"",defaultNoteFolder:"",icsNoteFilenameFormat:"title",customICSNoteFilenameTemplate:"{title}",enableAutoExport:!1,autoExportPath:"tasknotes-calendar.ics",autoExportInterval:60,useDurationForExport:!1,excludeArchivedFromExport:!1,excludeCompletedFromExport:!1,requireDueDateForExport:!1,requireScheduledDateForExport:!1,useICSEndAsDue:!1,recurringEventRelatedNotesMode:"series"},_at={enabled:!1,targetCalendarId:"",syncOnTaskCreate:!0,syncOnTaskUpdate:!0,syncOnTaskComplete:!0,syncOnTaskDelete:!0,eventTitleTemplate:"{{title}}",includeDescription:!0,eventColorId:null,syncTrigger:"scheduled",createAsAllDay:!0,defaultEventDuration:60,includeObsidianLink:!0,defaultReminderMinutes:null},Iat={enableFuzzy:!1,rows:["{title|n(Title)}","{aliases|n(Aliases)}","{file.path|n(Path)}"],showAdvanced:!1,requiredTags:[],includeFolders:[],propertyKey:"",propertyValue:""},kV={triggers:[{propertyId:"tags",trigger:"#",enabled:!0},{propertyId:"contexts",trigger:"@",enabled:!0},{propertyId:"projects",trigger:"+",enabled:!0},{propertyId:"status",trigger:"*",enabled:!0},{propertyId:"priority",trigger:"!",enabled:!1}]},pa={tasksFolder:"TaskNotes/Tasks",moveArchivedTasks:!1,archiveFolder:"TaskNotes/Archive",taskTag:"task",taskIdentificationMethod:"tag",hideIdentifyingTagsInCards:!1,hideIdentifyingTagsMode:"all",taskPropertyName:"",taskPropertyValue:"",excludedFolders:"",defaultTaskPriority:"normal",defaultTaskStatus:"open",taskOrgFiltersCollapsed:!1,taskFilenameFormat:"zettel",storeTitleInFilename:!0,customFilenameTemplate:"{{title}}",occurrenceFilenameTemplate:"",occurrenceFilenameTemplateProperty:"occurrenceFilenameTemplate",taskCreationDefaults:Pat,openTaskAfterCreation:"none",calendarViewSettings:Mat,pomodoroWorkDuration:25,pomodoroShortBreakDuration:5,pomodoroLongBreakDuration:15,pomodoroLongBreakInterval:4,pomodoroAutoStartBreaks:!0,pomodoroAutoStartWork:!1,pomodoroNotifications:!0,pomodoroSoundEnabled:!0,pomodoroSoundVolume:50,pomodoroStorageLocation:"plugin",pomodoroMobileSidebar:"tab",showPomodoroInStatusBar:!0,enableTaskLinkOverlay:!0,disableOverlayOnAlias:!1,enableInstantTaskConvert:!0,useDefaultsOnInstantConvert:!0,preserveCheckboxOnConvert:!1,taskModalTabMovesFocus:!0,enableNaturalLanguageInput:!0,nlpDefaultToScheduled:!0,nlpLanguage:"en",uiLanguage:"system",statusSuggestionTrigger:"*",nlpTriggers:kV,singleClickAction:"edit",doubleClickAction:"openNote",projectAutosuggest:Iat,inlineTaskConvertFolder:"{{currentNotePath}}",disableNoteIndexing:!1,suggestionDebounceMs:0,fieldMapping:bS,customStatuses:Eat,customPriorities:Dat,recurrenceMigrated:!1,lastSeenVersion:void 0,showReleaseNotesOnUpdate:!0,checkForUpdatesOnStartup:!0,lastNotifiedReleaseVersion:void 0,starterNoteCreated:!1,showTrackedTasksInStatusBar:!1,autoStopTimeTrackingOnComplete:!0,autoStopTimeTrackingNotification:!1,showRelationships:!0,relationshipsPosition:"bottom",showTaskCardInNote:!0,showCompletedTaskStrikethrough:!0,showExpandableSubtasks:!0,expandSubtasksByDefault:!1,subtaskChevronPosition:"right",viewsButtonAlignment:"right",hideCompletedFromOverdue:!0,icsIntegration:Aat,savedViews:[],enableNotifications:!0,notificationType:"system",notificationSoundEnabled:!1,notificationSoundVolume:50,enableAPI:!1,apiPort:8080,apiAuthToken:"",enableMCP:!1,webhooks:[],userFields:[],modalFieldsConfig:void 0,enableModalSplitLayout:!0,defaultVisibleProperties:["status","priority","due","scheduled","projects","contexts","tags","blocked","blocking"],inlineVisibleProperties:["status","priority","due","scheduled","recurrence"],enableBases:!0,enableMdbaseSpec:!1,autoCreateDefaultBasesFiles:!0,commandFileMapping:{"open-calendar-view":"TaskNotes/Views/mini-calendar-default.base","open-kanban-view":"TaskNotes/Views/kanban-default.base","open-tasks-view":"TaskNotes/Views/tasks-default.base","open-advanced-calendar-view":"TaskNotes/Views/calendar-default.base","open-agenda-view":"TaskNotes/Views/agenda-default.base","pomodoro-stats-base":"TaskNotes/Views/pomodoro-stats.base",relationships:"TaskNotes/Views/relationships.base"},maintainDueDateOffsetInRecurring:!1,resetCheckboxesOnRecurrence:!1,useFrontmatterMarkdownLinks:!1,enableGoogleCalendar:!1,enableMicrosoftCalendar:!1,disableCalendarOnMobile:!1,enabledGoogleCalendars:[],googleCalendarSyncTokens:{},enabledMicrosoftCalendars:[],microsoftCalendarSyncTokens:{},googleCalendarExport:_at,enableDebugLogging:!1}});function Abe(r){return Rat.has(r.trim().toLowerCase())}function jI(r){return typeof r=="object"&&r!==null&&typeof r.renderTo=="function"&&typeof r.toString=="function"}function zI(r){let e=r.toString();return e==="[object Object]"?"":e}function bV(r){var t;return r==null||((t=r.constructor)==null?void 0:t.name)==="NullValue"?!0:jI(r)&&Abe(zI(r))}function iE(r){return bV(r)?!0:Array.isArray(r)?r.every(iE):typeof r=="string"?r.trim()===""||Abe(r):jI(r)?zI(r).trim()==="":!1}function $I(r,e,t){if(!jI(e)||bV(e))return!1;try{e.renderTo(r,t),!r.hasChildNodes()&&!r.textContent&&(r.textContent=zI(e))}catch(n){Nat.debug("[TaskNotes] Error rendering Bases value:",{category:"persistence",operation:"rendering-bases-value",error:n}),r.textContent=zI(e)}return!0}function zu(r){if(bV(r))return"";if(jI(r))return r;if(r&&typeof r=="object"&&"icon"in r){let e=r;if(e.icon==="lucide-link"&&"data"in e&&e.data!==null&&e.data!==void 0){let t=J(e.data);if(!t.match(/^[a-z]+:\/\//i)){let a="display"in e&&e.display?J(e.display):null;return a&&a!==t?`[[${t}|${a}]]`:`[[${t}]]`}let n="display"in e&&e.display?J(e.display):null;return n?`[${n}](${t})`:t}return"display"in e&&e.display!==null&&e.display!==void 0?e.display:"date"in e&&e.date!==null&&e.date!==void 0?e.date:"data"in e&&e.data!==null&&e.data!==void 0?e.data:e.icon==="lucide-file-question"||e.icon==="lucide-help-circle"?"":e.icon?J(e.icon).replace("lucide-",""):""}return r}function BI(r,e={},t){var a;let n=(a=e.propertyLabels)==null?void 0:a[r];return n&&n.trim()!==""?n:t&&t.trim()!==""?t:r.startsWith("formula.")?r.substring(8):r.charAt(0).toUpperCase()+r.slice(1)}var Nat,Rat,sE=y(()=>{kr();K();Nat=N({tag:"Ui/TaskCardPresentation"}),Rat=new Set(["null","undefined"])});function TV(r){return r!==null&&typeof r=="object"&&typeof r.getValue=="function"?r:null}function _be(r){return Object.prototype.hasOwnProperty.call(Nbe,r)}function Ibe(r,e){return Nbe[e](r)}function SV(r,e,t){try{let n=t.fieldMapper.lookupMappingKey(e);if(n&&_be(n))return Ibe(r,n);if(_be(e))return Ibe(r,e);if(e.startsWith("user:"))return Fat(r,e,t);if(r.customProperties&&e in r.customProperties)return zu(r.customProperties[e]);if(r.customProperties){let i=`file.${e}`;if(i in r.customProperties)return zu(r.customProperties[i])}if(e.startsWith("file.")){let i=TV(r.basesData);if(i)try{let s=i.getValue(e);if(s!=null)return zu(s)}catch(s){}}if(e.startsWith("formula."))try{let i=TV(r.basesData);if(!i)return"";let s=i.getValue(e);if(s==null)return"";let o=zu(s);return o!==""?o:""}catch(i){return wV.debug(`[TaskNotes] Error computing formula ${e}:`,{category:"validation",operation:"computing-formula",error:i}),"[Formula Error]"}let a=TV(r.basesData);if(a)try{let i=`note.${e}`,s=a.getValue(i);if(s!=null)return zu(s)}catch(i){}if(r.path){let i=Rbe(r.path,e,t);if(i!==void 0)return i}return null}catch(n){return wV.warn(`TaskCard: Error getting property ${e}:`,{category:"persistence",operation:"taskcard-getting-property",error:n}),null}}function Fat(r,e,t){var s;let n=e.slice(5),a=(s=t.settings.userFields)==null?void 0:s.find(o=>o.id===n);if(!(a!=null&&a.key))return null;let i=r[a.key];return i===void 0&&(i=Rbe(r.path,a.key,t)),i}function Rbe(r,e,t){try{let n=t.app.metadataCache.getCache(r);return n!=null&&n.frontmatter?n.frontmatter[e]:void 0}catch(n){wV.warn(`TaskCard: Error accessing frontmatter for ${r}:`,{category:"validation",operation:"taskcard-accessing-frontmatter",error:n});return}}var wV,Nbe,Fbe=y(()=>{sE();K();wV=N({tag:"Ui/TaskCardPropertyAccess"});Nbe={due:r=>r.due,scheduled:r=>r.scheduled,projects:r=>r.projects,contexts:r=>r.contexts,tags:r=>r.tags,blocked:r=>r.isBlocked,blocking:r=>r.isBlocking,blockedBy:r=>r.blockedBy,blockingTasks:r=>r.blocking,timeEstimate:r=>r.timeEstimate,timeEntries:r=>r.timeEntries,totalTrackedTime:r=>r.totalTrackedTime,recurrence:r=>r.recurrence,recurrenceParent:r=>r.recurrence_parent,occurrenceDate:r=>r.occurrence_date,occurrenceMaterialization:r=>r.occurrence_materialization,occurrenceNextTrigger:r=>r.occurrence_next_trigger,occurrenceTemplate:r=>r.occurrence_template,occurrencePastHorizon:r=>r.occurrence_past_horizon,occurrenceFutureHorizon:r=>r.occurrence_future_horizon,completedDate:r=>r.completedDate,reminders:r=>r.reminders,icsEventId:r=>r.icsEventId,completeInstances:r=>r.complete_instances,skippedInstances:r=>r.skipped_instances,dateCreated:r=>r.dateCreated,dateModified:r=>r.dateModified,sortOrder:r=>r.sortOrder,googleCalendarSync:r=>r.path,checklistProgress:r=>r.path}});function no(r,e,t){return r.i18n.translate(`ui.taskCard.${e}`,t)}function Bc(r,e,t){let n=t==null?void 0:t[r];if(n&&n.trim()!=="")return n;let a=Oat(r,e,t),i={due:no(e,"labels.due"),scheduled:no(e,"labels.scheduled"),recurrence:no(e,"labels.recurrence"),completedDate:no(e,"labels.completed"),dateCreated:no(e,"labels.created"),dateModified:no(e,"labels.modified"),blocked:no(e,"labels.blocked"),blocking:no(e,"labels.blocking")};return BI(r,{propertyLabels:a?{[r]:a}:t},i[r])}function Oat(r,e,t){var n,a;if(t){for(let[i,s]of Object.entries(t))if(!(i===r||s.trim()==="")&&((a=(n=e.fieldMapper)==null?void 0:n.lookupMappingKey)==null?void 0:a.call(n,i))===r)return s}}function oE(r,e,t){return no(r,"recurrenceTooltip",{label:Bc("recurrence",r,t),value:yfe(e)})}function xV(r,e){return e===1?no(r,"reminderTooltipOne"):no(r,"reminderTooltipMany",{count:e})}function UI(r,e){return e?no(r,"collapseSubtasks"):no(r,"expandSubtasks")}var CV=y(()=>{Ct();sE();Fbe()});function Lbe(r,e,t){r.createEl("a",{text:t,attr:{href:e,target:"_blank",rel:"noopener"}}).classList.add("external-link")}function jat(r){return zat.test(r)}function Ul(r,e,t,n,a={}){var p;let{cssClass:i="internal-link",hoverSource:s="tasknotes-property-link",showErrorNotices:o=!1,onPrimaryNavigate:l}=a,c=(p=n.sourcePath)!=null?p:"",d=Et(e),u=r.createEl("a",{cls:i,text:t,attr:{"data-href":d,role:"link",tabindex:"0"}});u.addEventListener("click",m=>{m.preventDefault(),m.stopPropagation(),(async()=>{try{if(m.ctrlKey||m.metaKey){n.workspace.openLinkText(d,c,!0);return}if(l&&await l(d,m)!==!1)return;let f=n.metadataCache.getFirstLinkpathDest(d,c)||n.metadataCache.getFirstLinkpathDest(d,"");f instanceof ym.TFile?await n.workspace.getLeaf(!1).openFile(f):o&&new ym.Notice(`Note "${t}" not found`)}catch(f){Obe.error("[TaskNotes] Error opening internal link:",{category:"internal",operation:"opening-internal-link",details:{filePath:e},error:f}),o&&new ym.Notice(`Failed to open note "${t}"`)}})()}),u.addEventListener("auxclick",m=>{m.button===1&&(m.preventDefault(),m.stopPropagation(),(async()=>{try{(n.metadataCache.getFirstLinkpathDest(d,c)||n.metadataCache.getFirstLinkpathDest(d,""))instanceof ym.TFile&&n.workspace.openLinkText(d,c,!0)}catch(f){Obe.error("[TaskNotes] Error opening internal link:",{category:"internal",operation:"opening-internal-link",details:{filePath:e},error:f})}})())}),u.addEventListener("keydown",m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),u.click())}),u.addEventListener("mouseover",m=>{let f=n.metadataCache.getFirstLinkpathDest(d,c)||n.metadataCache.getFirstLinkpathDest(d,"");if(f instanceof ym.TFile){let h={event:m,source:s,hoverParent:r,targetEl:u,linktext:d,sourcePath:c||f.path};n.workspace.trigger("hover-link",h)}})}function Uc(r,e,t,n){let a=0,i;for(;(i=Lat.exec(e))!==null;){let[o,l,c,d,u,p]=i,m=i.index;if(m>a&&r.appendChild(activeDocument.createTextNode(e.slice(a,m))),l){let f=l,h=f,g=f;if(f.includes("|")){let[v,b]=f.split("|");h=v,g=b}Ul(r,h,g,t)}else if(c&&d){let f=String(d).trim(),h=String(c).trim();jat(f)?Lbe(r,f,h):Ul(r,f,h,t)}else if(u||p){let f=String(u||p);Lbe(r,f,f)}else r.appendChild(activeDocument.createTextNode(o));a=m+o.length}let s=e.slice(a);if(s&&(n!=null&&n.onTagClick)){let o=/(^|\s)(#[\p{L}\p{N}\p{M}_/-]+)/gu,l=0,c;for(;(c=o.exec(s))!==null;){let[,d,u]=c,p=c.index;p>l&&r.appendChild(activeDocument.createTextNode(s.slice(l,p))),d&&r.appendChild(activeDocument.createTextNode(d));let m=r.createEl("a",{cls:"tag",text:u,attr:{href:u,role:"button",tabindex:"0","data-tn-click-exclude":"true"}});m.addEventListener("click",f=>{f.preventDefault(),f.stopPropagation(),n.onTagClick(u,f)}),m.addEventListener("keydown",f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),f.stopPropagation(),n.onTagClick(u,f))}),l=p+d.length+u.length}l0}function Bat(r){return!r||typeof r!="string"?!1:/^\[([^\]]*)\]\(([^)]+)\)$/.test(r)}function Uat(r){let e=r.match(/^\[([^\]]*)\]\(([^)]+)\)$/);if(!e)return null;let t=e[1].trim(),n=e[2].trim(),a=Et(n);return{displayText:t,filePath:a}}function zbe(r,e,t){var u,p;let n=(u=t.sourcePath)!=null?u:"",a=Et(r),i=t.metadataCache.getFirstLinkpathDest(a,n)||t.metadataCache.getFirstLinkpathDest(a,"");if(!(i instanceof ym.TFile))return e;let s=t.metadataCache.getCache(i.path),o=(p=s==null?void 0:s.frontmatter)==null?void 0:p.title;if(typeof o!="string"||o.trim().length===0)return e;let l=(e==null?void 0:e.trim())||"",c=i.name,d=i.basename;return l===""||l===c||l===d||l===i.path||l===a?o:e}function Ek(r,e,t,n={}){r.innerHTML="",e.flat(2).filter(i=>i!=null&&typeof i=="string").forEach((i,s)=>{if(s>0&&r.appendChild(activeDocument.createTextNode(", ")),r.appendChild(activeDocument.createTextNode("+")),$at(i)){let o=i.slice(2,-2),l=o,c=o;if(o.includes("|")){let u=o.split("|");l=u[0].trim(),c=u[1].trim()}let d=zbe(l,c,t);Ul(r,l,d,t,{cssClass:"task-card__project-link internal-link",hoverSource:"tasknotes-project-link",showErrorNotices:!0,onPrimaryNavigate:n.onPrimaryNavigate})}else if(Bat(i)){let o=Uat(i);if(o){let l=zbe(o.filePath,o.displayText,t);Ul(r,o.filePath,l,t,{cssClass:"task-card__project-link internal-link",hoverSource:"tasknotes-project-link",showErrorNotices:!0,onPrimaryNavigate:n.onPrimaryNavigate})}else r.appendChild(activeDocument.createTextNode(i))}else r.appendChild(activeDocument.createTextNode(i))})}var ym,Obe,Lat,zat,vm=y(()=>{ym=require("obsidian");qn();K();Obe=N({tag:"Ui/Renderers/LinkRenderer"}),Lat=/\[\[([^[\]]+)\]\]|\[([^\]]+)\]\(([^)]+)\)|<(https?:\/\/[^\s>]+)>|(https?:\/\/[^\s<>()]+[^\s<>().,;:!?])|\[([^\]]+)\]\s*\[([^\]]*)\]/g,zat=/^[a-z][a-z0-9+.-]*:/i});function jbe(r,e,t){if(!e||typeof e!="string")return;let n=qat(e);if(!n)return;let a=r.createEl("a",{cls:"tag",text:n,attr:{href:n,role:"button",tabindex:"0","data-tn-click-exclude":"true"}});t!=null&&t.onTagClick&&(a.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),t.onTagClick(n,i)}),a.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),i.stopPropagation(),t.onTagClick(n,i))}))}function Ube(r,e,t){if(typeof e=="string"){jbe(r,e,t);return}if(Array.isArray(e)){e.flat(2).filter(a=>a!=null&&typeof a=="string").forEach((a,i)=>{i>0&&r.appendChild(activeDocument.createTextNode(" ")),jbe(r,String(a),t)});return}e!=null&&r.appendChild(activeDocument.createTextNode(J(e)))}function Hbe(r,e,t){if(typeof e=="string"){$be(r,e,t);return}if(Array.isArray(e)){e.flat(2).filter(a=>a!=null&&typeof a=="string").forEach((a,i)=>{i>0&&r.appendChild(activeDocument.createTextNode(", ")),$be(r,a,t)||r.appendChild(activeDocument.createTextNode(String(a)))});return}e!=null&&r.appendChild(activeDocument.createTextNode(J(e)))}function $be(r,e,t){let n=Hat(e);if(t!=null&&t.linkServices&&Vat(n)){let o=Bbe(n),l=r.createSpan({cls:`context-tag context-tag--link ${o}`,attr:{"data-tn-click-exclude":"true"}});return l.appendChild(activeDocument.createTextNode("@")),Uc(l,n,t.linkServices),!0}let a=Yat(e);if(!a)return!1;let i=Bbe(a),s=r.createSpan({cls:`context-tag ${i}`,text:a,attr:{role:"button",tabindex:"0","data-tn-click-exclude":"true"}});return t!=null&&t.onTagClick&&(s.addEventListener("click",o=>{var l;o.preventDefault(),o.stopPropagation(),(l=t.onTagClick)==null||l.call(t,a,o)}),s.addEventListener("keydown",o=>{var l;(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),o.stopPropagation(),(l=t.onTagClick)==null||l.call(t,a,o))})),!0}function Hat(r){let e=r.trim();return e.startsWith("@")?e.slice(1).trim():e}function Vat(r){return/\[\[[^[\]]+\]\]/.test(r)||/\[[^\]]+\]\([^)]+\)/.test(r)||/]+>/i.test(r)||/https?:\/\/[^\s<>()]+[^\s<>().,;:!?]/i.test(r)}function qat(r){if(!r||typeof r!="string")return null;let e=r.trim();if(!e)return null;let t=e.startsWith("#"),n=e.replace(/[^\p{L}\p{N}_#/-]/gu,"");return t?n.length>1?n:null:n?`#${n}`:null}function Wat(r){let e=5381;for(let t=0;t>>0}function Bbe(r){if(!r||typeof r!="string")return"context-tag--color-0";let e=r.replace(/^@/,"").toLowerCase();return e?`context-tag--color-${Wat(e)%20}`:"context-tag--color-0"}function Yat(r){if(!r||typeof r!="string")return null;let e=r.trim();if(!e)return null;let t=e.startsWith("@"),n=e.replace(/[^\p{L}\p{N}_@/-]/gu,"");return t?n.length>1?n:null:n?`@${n}`:null}var Vbe=y(()=>{kr();vm()});function km(r,e,t){return r.i18n.translate(`ui.taskCard.${e}`,t)}function Gat(r){if(r.setAttribute("role","button"),r.tabIndex=0,r.dataset.tnNoDrag==="true"){r.setAttribute("draggable","false");return}r.dataset.tnNoDrag="true",r.setAttribute("draggable","false"),r.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation()}),r.addEventListener("keydown",e=>{e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),e.stopPropagation(),r.click())})}function Kat(r){return(Array.isArray(r)?r:r?[r]:[]).filter(t=>typeof t=="string").map(t=>t.trim()).filter(Boolean)}function Zat(r,e){let t=r.start?Vn(r.start,{userTimeFormat:e.settings.calendarViewSettings.timeFormat}):"";return t?`${r.title} (${t})`:r.title}function qbe(r){var e;return((e=r.split("/").pop())==null?void 0:e.replace(/\.md$/i,""))||r}function Qat(r,e,t){let n=os(r);if(n){let a=Ol(t.app,e.path,n),i=(a==null?void 0:a.path)||n.uid;return i?{path:i,displayText:(a==null?void 0:a.file.basename)||qbe(i)}:null}if(typeof r=="object"&&r!==null){let a=r.path;if(typeof a=="string"&&a.trim()!=="")return{path:a.trim(),displayText:qbe(a)}}return null}function Kbe(r,e,t,n){Gat(r),r.addEventListener("click",a=>{a.stopPropagation();let i=n==="due"?e.due:e.scheduled;new Bl({currentValue:de(i||""),currentTime:Oi(i||""),onSelect:(o,l)=>{(async()=>{try{let c;o?l?c=`${o}T${l}`:c=o:c=void 0,await t.updateTaskProperty(e,n,c)}catch(c){let d=c instanceof Error?c.message:String(c);DV.error(`Error updating ${n} date:`,{category:"persistence",operation:"updating",details:{value:d}});let u=n==="due"?"contextMenus.task.notices.updateDueDateFailure":"contextMenus.task.notices.updateScheduledFailure";new Dk.Notice(t.i18n.translate(u,{message:d}))}})()},dateRole:n,plugin:t,app:t.app}).show(a)})}function Zbe(r){let e=[...aE,"tags","blocked","blocking","googleCalendarSync"];return $i(e,r)}function Jat(r){return r.trim().toLowerCase()}function Xat(r,e){let t=e.app.vault.getAbstractFileByPath(r);if(!(t instanceof Dk.TFile))return null;let n=e.app.metadataCache.getFileCache(t);return eit(n)}function eit(r){if(r==null)return null;let e=r.listItems;if(!Array.isArray(e)||e.length===0)return null;let t=0,n=0;for(let a of e){if(!a||typeof a.task!="string"||typeof a.parent=="number"&&a.parent>=0)continue;let s=Jat(a.task);s!=="-"&&(t+=1,s==="x"&&(n+=1))}return t===0?null:{completed:n,total:t,percent:Math.round(n/t*100)}}function Qbe(r,e,t,n,a={}){let i=SV(t,e,n);if(!VI(i))return null;let s=r.createSpan({cls:`task-card__metadata-property task-card__metadata-property--${e.replace(":","-")}`});try{let l=n.fieldMapper.lookupMappingKey(e)||e;return l in Wbe?Wbe[l](s,i,t,n,a):e.startsWith("user:")?tit(s,e,i,n):rit(s,e,i,n,Bc(e,n,a.propertyLabels)),!s.textContent&&!s.hasChildNodes()?(s.remove(),null):s}catch(o){return DV.warn(`TaskCard: Error rendering property ${e}:`,{category:"persistence",operation:"taskcard-rendering-property",error:o}),s.textContent=`${e}: (error)`,s}}function VI(r){return!iE(r)}function tit(r,e,t,n){var c;let a=e.slice(5),i=(c=n.settings.userFields)==null?void 0:c.find(d=>d.id===a);if(!i){r.textContent=`${a}: (not found)`;return}let s=i.displayName||a;r.createSpan({text:`${s}: `});let o=r.createSpan({cls:"task-card__metadata-value"}),l={metadataCache:n.app.metadataCache,workspace:n.app.workspace};if(typeof t=="string"&&t.trim()!==""){let d=t.trim();EV(d)?Uc(o,d,l):o.textContent=Gbe(t,i)}else if(i.type==="list"&&Array.isArray(t))t.map(u=>zu(u)).filter(VI).forEach((u,p)=>{if(p>0&&o.appendChild(activeDocument.createTextNode(", ")),typeof u=="string"&&u.trim()!==""){let m=u.trim();if(EV(m)){let f=o.createSpan();Uc(f,m,l)}else o.appendChild(activeDocument.createTextNode(String(u)))}else o.appendChild(activeDocument.createTextNode(String(u)))});else{let d=Gbe(t,i);o.textContent=d.trim()!==""?d:"(empty)"}}function rit(r,e,t,n,a){let i=BI(e,{},a);r.createSpan({text:`${i}: `});let s=r.createSpan({cls:"task-card__metadata-value"});Array.isArray(t)?t.map(l=>zu(l)).filter(VI).forEach((l,c)=>{c>0&&s.appendChild(activeDocument.createTextNode(", ")),Ybe(s,l,n)}):Ybe(s,t,n)}function Ybe(r,e,t){if(!VI(e)||t&&$I(r,e,t.app.renderContext))return;if(typeof e=="string"&&t){let a={metadataCache:t.app.metadataCache,workspace:t.app.workspace};if(EV(e)){Uc(r,e,a,{onTagClick:async i=>{let s=i.startsWith("#")?i.slice(1):i;await t.openTagsPane(`#${s}`)}});return}r.appendChild(activeDocument.createTextNode(e));return}let n;if(typeof e=="object"&&e!==null)if(e instanceof Date)n=Vn(e.toISOString(),{dateFormat:"MMM d, yyyy",timeFormat:"",showTime:!1});else{let a=Object.entries(e);n=a.length<=3?a.map(([i,s])=>`${i}: ${J(s)}`).join(", "):J(e)}else typeof e=="boolean"?n=e?"\u2713":"\u2717":typeof e=="number"?n=Number.isInteger(e)?String(e):e.toFixed(2):n=J(e);n.length>100&&(n=n.substring(0,97)+"..."),r.appendChild(activeDocument.createTextNode(n))}function EV(r){return r.includes("[[")||r.includes("](")||/]+>/i.test(r)||/(^|\s)https?:\/\/[^\s<>()]+/i.test(r)||r.includes("[")&&r.includes("](")||r.includes("#")&&/\s#\w+|#\w+/.test(r)}function Gbe(r,e){if(r==null)return"";try{switch(e.type){case"text":case"number":return J(r);case"date":return Vn(J(r),{dateFormat:"MMM d, yyyy",timeFormat:"",showTime:!1});case"boolean":return r?"\u2713":"\u2717";case"list":return Array.isArray(r)?r.flat(2).map(J).join(", "):J(r);default:return J(r)}}catch(t){return DV.warn("TaskCard: Error formatting user property value:",{category:"validation",operation:"taskcard-formatting-user-property-value",error:t}),J(r)}}function HI(r){let e=Number(de(r).slice(0,4));return Number.isInteger(e)&&e!==new Date().getFullYear()?"MMM d, yyyy":"MMM d"}function nit(r,e,t,n,a){var p,m;let i=k_(e),s=n.statusManager.isCompletedStatus(t.status),o=(m=(p=n.settings)==null?void 0:p.hideCompletedFromOverdue)!=null?m:!0,l=Nl(e,s,o),c=n.settings.calendarViewSettings.timeFormat,d=Bc("due",n,a),u="";if(i){let f=Vn(e,{dateFormat:"",showTime:!0,userTimeFormat:c});u=f.trim()===""?km(n,"dueToday",{label:d}):km(n,"dueTodayAt",{label:d,time:f})}else if(l){let f=Vn(e,{dateFormat:HI(e),showTime:!0,userTimeFormat:c});u=km(n,"dueOverdue",{label:d,display:f})}else{let f=Vn(e,{dateFormat:HI(e),showTime:!0,userTimeFormat:c});u=km(n,"dueLabel",{label:d,display:f})}r.textContent=u,r.classList.add("task-card__metadata-date","task-card__metadata-date--due"),l&&r.classList.add("task-card__metadata-date--overdue"),r.dataset.tnAction="edit-date",r.dataset.tnDateType="due",Kbe(r,t,n,"due")}function ait(r,e,t,n,a){var p,m;let i=k_(e),s=n.statusManager.isCompletedStatus(t.status),o=(m=(p=n.settings)==null?void 0:p.hideCompletedFromOverdue)!=null?m:!0,l=Nl(e,s,o),c=n.settings.calendarViewSettings.timeFormat,d=Bc("scheduled",n,a),u="";if(i){let f=Vn(e,{dateFormat:"",showTime:!0,userTimeFormat:c});u=f.trim()===""?km(n,"scheduledToday",{label:d}):km(n,"scheduledTodayAt",{label:d,time:f})}else if(l){let f=Vn(e,{dateFormat:HI(e),showTime:!0,userTimeFormat:c});u=km(n,"scheduledPast",{label:d,display:f})}else{let f=Vn(e,{dateFormat:HI(e),showTime:!0,userTimeFormat:c});u=km(n,"scheduledLabel",{label:d,display:f})}r.textContent=u,r.classList.add("task-card__metadata-date","task-card__metadata-date--scheduled"),l&&r.classList.add("task-card__metadata-date--past"),r.dataset.tnAction="edit-date",r.dataset.tnDateType="scheduled",Kbe(r,t,n,"scheduled")}function Jbe(r,e){r.style.display=e.length>0?"":"none"}var Dk,DV,Wbe,Xbe=y(()=>{Dk=require("obsidian");bk();ag();Ct();fm();Me();kr();$c();sE();CV();vm();Vbe();Io();K();DV=N({tag:"Ui/TaskCardProperties"});Wbe={due:(r,e,t,n,a)=>{typeof e=="string"&&nit(r,e,t,n,a==null?void 0:a.propertyLabels)},scheduled:(r,e,t,n,a)=>{typeof e=="string"&&ait(r,e,t,n,a==null?void 0:a.propertyLabels)},projects:(r,e,t,n)=>{if(Array.isArray(e)){let a={metadataCache:n.app.metadataCache,workspace:n.app.workspace,sourcePath:t.path};Ek(r,e,a)}},contexts:(r,e,t,n)=>{if(Array.isArray(e)){let a={onTagClick:async i=>{let s=i.startsWith("@")?i.slice(1):i;await n.openTagsPane(`#${s}`)},linkServices:{metadataCache:n.app.metadataCache,workspace:n.app.workspace,sourcePath:t.path}};Hbe(r,e,a)}},tags:(r,e,t,n)=>{if(Array.isArray(e)){let a=e;n.settings.taskIdentificationMethod==="tag"&&n.settings.hideIdentifyingTagsInCards&&(a=Lu(e,n.settings.taskTag,n.settings.hideIdentifyingTagsMode)),a.length>0&&Ube(r,a,{onTagClick:async s=>{let o=s.startsWith("#")?s.slice(1):s;await n.openTagsPane(`#${o}`)}})}},timeEstimate:(r,e,t,n)=>{typeof e=="number"&&(r.textContent=`${n.formatTime(e)} estimated`)},totalTrackedTime:(r,e,t,n)=>{typeof e=="number"&&e>0&&(r.textContent=`${n.formatTime(e)} tracked`)},recurrence:(r,e,t,n,a)=>{typeof e=="string"&&(r.textContent=oE(n,e,a==null?void 0:a.propertyLabels))},recurrenceParent:(r,e,t,n)=>{if(typeof e=="string"&&e.trim()!==""){r.createSpan({text:"Parent: "});let a={metadataCache:n.app.metadataCache,workspace:n.app.workspace,sourcePath:t.path};Uc(r,e,a)}},occurrenceDate:(r,e,t,n)=>{var a;typeof e=="string"&&(r.textContent=`Occurrence: ${Vn(e,{dateFormat:"MMM d",showTime:!1,userTimeFormat:(a=n.settings.calendarViewSettings)==null?void 0:a.timeFormat})}`,r.classList.add("task-card__metadata-pill--occurrence"))},occurrenceMaterialization:(r,e)=>{e==="manual"?r.textContent="Occurrence notes: manual":e==="on_completion"?r.textContent="Occurrence notes: after completion":e==="rolling"&&(r.textContent="Occurrence notes: rolling")},occurrenceNextTrigger:(r,e)=>{e==="completion"?r.textContent="Next note: completion":e==="completion_or_skip"&&(r.textContent="Next note: completion or skip")},occurrenceTemplate:(r,e,t,n)=>{if(typeof e=="string"&&e.trim()!==""){r.createSpan({text:"Template: "});let a={metadataCache:n.app.metadataCache,workspace:n.app.workspace,sourcePath:t.path};Uc(r,e,a)}},completeInstances:(r,e,t)=>{var n;if(Array.isArray(e)&&e.length>0){let a=e.length,i=((n=t.skipped_instances)==null?void 0:n.length)||0,s=hfe(t);if(s){let o=Math.max(s,a+i),l=Math.round(a/o*100);r.textContent=`\u2713 ${a}/${o} completed (${l}%)`}else r.textContent=`\u2713 ${a} completed`;r.classList.add("task-card__metadata-pill--completed-instances")}},skippedInstances:(r,e)=>{Array.isArray(e)&&e.length>0&&(r.textContent=`\u2298 ${e.length} skipped`,r.classList.add("task-card__metadata-pill--skipped-instances"))},completedDate:(r,e,t,n,a)=>{if(typeof e=="string"){let i=Bc("completedDate",n,a==null?void 0:a.propertyLabels);r.textContent=`${i}: ${Vn(e,{dateFormat:"MMM d",showTime:!1,userTimeFormat:n.settings.calendarViewSettings.timeFormat})}`}},dateCreated:(r,e,t,n,a)=>{if(typeof e=="string"){let i=Bc("dateCreated",n,a==null?void 0:a.propertyLabels);r.textContent=`${i}: ${Vn(e,{dateFormat:"MMM d",showTime:!1,userTimeFormat:n.settings.calendarViewSettings.timeFormat})}`}},dateModified:(r,e,t,n,a)=>{if(typeof e=="string"){let i=Bc("dateModified",n,a==null?void 0:a.propertyLabels);r.textContent=`${i}: ${Vn(e,{dateFormat:"MMM d",showTime:!1,userTimeFormat:n.settings.calendarViewSettings.timeFormat})}`}},blocked:(r,e,t,n,a)=>{var i,s;if(e===!0){let o=(s=(i=t.blockedBy)==null?void 0:i.length)!=null?s:0,l=Bc("blocked",n,a==null?void 0:a.propertyLabels);r.textContent=o>0?`${l} (${o})`:l,r.classList.add("task-card__metadata-pill--blocked")}},blocking:(r,e,t,n,a)=>{var i,s;if(e===!0){let o=(s=(i=t.blocking)==null?void 0:i.length)!=null?s:0,l=Bc("blocking",n,a==null?void 0:a.propertyLabels);r.textContent=o>0?`${l} (${o})`:l,r.classList.add("task-card__metadata-pill--blocking")}},blockedBy:(r,e,t,n)=>{if(Array.isArray(e)&&e.length>0){r.createSpan({text:"Blocked by: "});let a=r.createSpan(),i={metadataCache:n.app.metadataCache,workspace:n.app.workspace,sourcePath:t.path};e.forEach((s,o)=>{o>0&&a.appendChild(activeDocument.createTextNode(", "));let l=Qat(s,t,n);l&&Ul(a,l.path,l.displayText,i)})}},blockingTasks:(r,e,t,n)=>{if(Array.isArray(e)&&e.length>0){r.createSpan({text:"Blocking: "});let a=r.createSpan();e.forEach((i,s)=>{var l;s>0&&a.appendChild(activeDocument.createTextNode(", "));let o=a.createEl("a",{cls:"internal-link",attr:{href:i}});o.textContent=((l=i.split("/").pop())==null?void 0:l.replace(".md",""))||i,o.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),n.app.workspace.openLinkText(i,"",!1)})})}},timeEntries:(r,e,t,n)=>{if(Array.isArray(e)&&e.length>0){let a=Li(e);a>0&&(r.textContent=`${n.formatTime(a)} tracked (${e.length} ${e.length===1?"entry":"entries"})`)}},reminders:(r,e)=>{Array.isArray(e)&&e.length>0&&(r.textContent=`${e.length} ${e.length===1?"reminder":"reminders"}`)},icsEventId:(r,e,t,n)=>{let a=Kat(e);if(a.length===0)return;let i=a.map(s=>{var o;return(o=n.icsNoteService.findEventById(s))==null?void 0:o.event}).filter(s=>!!s).map(s=>Zat(s,n));i.length>0?r.textContent=`Calendar: ${i.join(", ")}`:r.textContent=`Linked to ${a.length} calendar ${a.length===1?"event":"events"}`},checklistProgress:(r,e,t,n)=>{let a=Xat(t.path,n);if(!a)return;let i=r.createSpan({cls:"task-card__progress"}),o=i.createSpan({cls:"task-card__progress-bar"}).createSpan({cls:"task-card__progress-fill"});o.style.width=`${a.percent}%`,a.percent>0&&a.percent<5&&(o.classList.remove("tn-static-min-width-0-3922d326"),o.classList.add("tn-static-min-width-2px-709d7da0")),i.createSpan({cls:"task-card__progress-label",text:`${a.completed}/${a.total}`}),(0,Dk.setTooltip)(i,`${a.percent}% complete (${a.completed}/${a.total})`,{placement:"top"})}}});function iit(r){if(typeof r=="number")return r===1?"show-all":"inherit";let e=J(r).trim().toLowerCase().replace(/^['"]|['"]$/g,"").replace(/[_\s]+/g,"-");return e==="show-all"||e==="1"?"show-all":"inherit"}function qI(r,e={}){var a,i;if(iit((i=(a=e.resolveExpandedRelationshipFilterMode)==null?void 0:a.call(e))!=null?i:e.expandedRelationshipFilterMode)!=="inherit")return r;let n=e.expandedRelationshipTaskPaths;return n?r.filter(s=>n.has(s.path)):r}function eTe(r,e={},t){let n=e.expandedRelationshipTaskOrder;if(!n||n.size===0)return t([...r]);let a=[],i=[];for(let s of r)n.has(s.path)?a.push(s):i.push(s);return a.sort((s,o)=>{let l=n.get(s.path),c=n.get(o.path);return l===void 0||c===void 0?0:l-c}),[...a,...t([...i])]}function ig(r,e){let t=Array.isArray(r.blockedBy)?r.blockedBy:[],n=new Set;for(let a of t){let i=os(a);if(!i)continue;let s=Ol(e,r.path,i),o=(s==null?void 0:s.path)||i.uid;o&&n.add(o)}return Array.from(n)}var WI=y(()=>{Io();kr()});function Hl(r){if(r.setAttribute("role","button"),r.tabIndex=0,r.dataset.tnNoDrag==="true"){r.setAttribute("draggable","false");return}r.dataset.tnNoDrag="true",r.setAttribute("draggable","false"),r.addEventListener("mousedown",e=>{e.preventDefault(),e.stopPropagation()}),r.addEventListener("keydown",e=>{e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),e.stopPropagation(),r.click())})}function Hc(r){let{container:e,className:t,icon:n,tooltip:a,ariaLabel:i,onClick:s,visible:o=!0}=r;if(!o)return null;let l=e.createDiv({cls:t,attr:{"aria-label":i||a}});return(0,lE.setIcon)(l,n),(0,lE.setTooltip)(l,a,{placement:"top"}),s&&(Hl(l),l.addEventListener("click",c=>{c.stopPropagation(),s(c)})),l}function sg(r,e,t){let n=r.querySelector(e);if(!t.shouldExist)return n==null||n.remove(),null;if(n)return n.setAttribute("aria-label",t.ariaLabel||t.tooltip),(0,lE.setTooltip)(n,t.tooltip,{placement:"top"}),t.onClick&&Hl(n),n;let i=r.querySelector(".task-card__badges")||r.querySelector(".task-card__main-row");return i?Hc({container:i,...t}):null}var lE,cE=y(()=>{lE=require("obsidian")});var tTe={};at(tTe,{PriorityContextMenu:()=>ju});var ju,dE=y(()=>{Pu();ju=class{constructor(e){this.targetDoc=activeDocument;this.menu=new Ea,this.options=e,this.buildMenu()}buildMenu(){this.sortedPriorities=this.options.plugin.priorityManager.getPrioritiesByWeightAsc(),this.sortedPriorities.forEach(e=>{this.menu.addItem(t=>{let n=e.label;t.setIcon("star"),e.value===this.options.currentValue&&(n=`\u2713 ${e.label}`),t.setTitle(n),t.onClick(async()=>{this.options.onSelect(e.value)})})})}show(e){var t,n;(n=(t=e.target)==null?void 0:t.instanceOf)!=null&&n.call(t,HTMLElement)&&(this.targetDoc=e.target.ownerDocument),this.menu.show(e),window.setTimeout(()=>{this.applyColorStyling()},10)}showAtElement(e){this.targetDoc=e.ownerDocument,this.menu.showAtPosition({x:e.getBoundingClientRect().left,y:e.getBoundingClientRect().bottom+4}),window.setTimeout(()=>{this.applyColorStyling()},10)}applyColorStyling(){let e=this.targetDoc.querySelector(".menu");if(!e)return;let t=e.querySelectorAll(".menu-item");this.sortedPriorities.forEach((n,a)=>{let i=t[a];if(i&&n.color){let s=i.querySelector(".menu-item-icon");s&&(s.style.color=n.color)}})}}});var lTe={};at(lTe,{RecurrenceContextMenu:()=>Vl,buildCustomRecurrenceRule:()=>oTe,buildRecurrenceOptions:()=>sTe,buildWeekdaysOnlyRecurrenceRule:()=>GI,formatDateForDTSTART:()=>iTe,formatDateForInput:()=>MV,getMonthDayOptions:()=>AV,getOrderedRecurrenceWeekdays:()=>nTe,getPluginCalendarLocale:()=>pE,getRecurrenceStartDate:()=>uE,getWeekdayOnlyRRuleCodes:()=>aTe});function rTe(r){if(r)try{let e=Intl.Locale;return e?new e(r).weekInfo:void 0}catch(e){return}}function sit(r,e){var n;if(typeof r=="number"&&Number.isInteger(r)&&r>=0&&r<=6)return r;let t=(n=rTe(e))==null?void 0:n.firstDay;return typeof t=="number"?t%7:1}function pE(r){var n,a,i;let e=(i=(a=(n=r.settings)==null?void 0:n.calendarViewSettings)==null?void 0:a.locale)==null?void 0:i.trim();if(e)return e;let t=typeof navigator!="undefined"?navigator.language:"";if(t)return t;try{return Intl.DateTimeFormat().resolvedOptions().locale}catch(s){return}}function nTe(r,e){let t=sit(r,e),n=YI.findIndex(i=>i.dateIndex===t),a=n>=0?n:1;return[...YI.slice(a),...YI.slice(0,a)]}function aTe(r){var a,i;let e=(i=(a=rTe(r))==null?void 0:a.weekend)==null?void 0:i.map(s=>s%7).filter(s=>s>=0&&s<=6);if(!e||e.length===0)return["MO","TU","WE","TH","FR"];let t=new Set(e),n=YI.filter(s=>!t.has(s.dateIndex)).map(s=>s.code);return n.length>0&&n.length<7?n:["MO","TU","WE","TH","FR"]}function GI(r,e){return`DTSTART:${r};FREQ=WEEKLY;BYDAY=${aTe(e).join(",")}`}function uE(r,e=new Date){let t=r==null?void 0:r.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!t)return e;let n=parseInt(t[1],10),a=parseInt(t[2],10),i=parseInt(t[3],10),s=new Date(n,a-1,i);return s.getFullYear()!==n||s.getMonth()!==a-1||s.getDate()!==i?e:s}function iTe(r){let e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return`${e}${t}${n}`}function MV(r){let e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return`${e}-${t}-${n}`}function oit(r){if(!(r!=null&&r.includes("T")))return;let e=r.match(/T(\d{2}):(\d{2})/);if(e)return`${e[1]}${e[2]}00Z`}function PV(r){let e=["th","st","nd","rd"],t=r%100;return r+(e[(t-20)%10]||e[t]||e[0])}function sTe(r){let e=[],t=uE(r.scheduledDate),n=["SU","MO","TU","WE","TH","FR","SA"],a=["January","February","March","April","May","June","July","August","September","October","November","December"],i=n[t.getDay()],s=t.getDate(),o=t.getMonth()+1,l=a[t.getMonth()],c=t.toLocaleDateString(r.calendarLocale||void 0,{weekday:"long"}),d=iTe(t);if(r.currentValue){let u=r.currentValue.match(/DTSTART:(\d{8}(?:T\d{6}Z?)?)/);if(u&&u[1].includes("T")){let p=u[1].split("T")[1];d=`${d}T${p}`}}else{let u=oit(r.scheduledDate);u&&(d=`${d}T${u}`)}return e.push({label:r.translate("components.recurrenceContextMenu.daily"),value:`DTSTART:${d};FREQ=DAILY;INTERVAL=1`,icon:"calendar-days"}),e.push({label:r.translate("components.recurrenceContextMenu.weeklyOn",{day:c}),value:`DTSTART:${d};FREQ=WEEKLY;INTERVAL=1;BYDAY=${i}`,icon:"calendar"}),e.push({label:r.translate("components.recurrenceContextMenu.everyTwoWeeksOn",{day:c}),value:`DTSTART:${d};FREQ=WEEKLY;INTERVAL=2;BYDAY=${i}`,icon:"calendar"}),e.push({label:r.translate("components.recurrenceContextMenu.monthlyOnThe",{ordinal:PV(s)}),value:`DTSTART:${d};FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=${s}`,icon:"calendar-range"}),e.push({label:r.translate("components.recurrenceContextMenu.everyThreeMonthsOnThe",{ordinal:PV(s)}),value:`DTSTART:${d};FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=${s}`,icon:"calendar-range"}),e.push({label:r.translate("components.recurrenceContextMenu.yearlyOn",{month:l,ordinal:PV(s)}),value:`DTSTART:${d};FREQ=YEARLY;INTERVAL=1;BYMONTH=${o};BYMONTHDAY=${s}`,icon:"calendar-clock"}),e.push({label:r.translate("components.recurrenceContextMenu.weekdaysOnly"),value:GI(d,r.calendarLocale),icon:"briefcase"}),e.push({label:"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",value:"",icon:void 0}),e.push({label:r.translate("components.recurrenceContextMenu.dailyAfterCompletion"),value:`DTSTART:${d};FREQ=DAILY;INTERVAL=1`,icon:"calendar-days",anchor:"completion"}),e.push({label:r.translate("components.recurrenceContextMenu.every3DaysAfterCompletion"),value:`DTSTART:${d};FREQ=DAILY;INTERVAL=3`,icon:"calendar-days",anchor:"completion"}),e.push({label:r.translate("components.recurrenceContextMenu.weeklyAfterCompletion"),value:`DTSTART:${d};FREQ=WEEKLY;INTERVAL=1`,icon:"calendar",anchor:"completion"}),e.push({label:r.translate("components.recurrenceContextMenu.monthlyAfterCompletion"),value:`DTSTART:${d};FREQ=MONTHLY;INTERVAL=1`,icon:"calendar-range",anchor:"completion"}),e}function oTe(r){let e=[],t=r.recurrenceAnchor==="completion";if(r.dtstart){let n=r.dtstart.replace(/-/g,"");if(r.dtstartTime){let a=r.dtstartTime.replace(":","")+"00";n=`${n}T${a}`}e.push(`DTSTART:${n}`)}switch(e.push(`FREQ=${r.frequency}`),r.interval>1&&e.push(`INTERVAL=${r.interval}`),r.frequency){case"DAILY":!t&&r.byDay.length>0&&e.push(`BYDAY=${r.byDay.join(",")}`);break;case"WEEKLY":!t&&r.byDay.length>0&&e.push(`BYDAY=${r.byDay.join(",")}`);break;case"MONTHLY":if(t)break;if(r.monthlyType==="bydate"){let n=r.byMonthDay.length>0?r.byMonthDay[0]:new Date().getDate();e.push(`BYMONTHDAY=${n}`)}else if(r.monthlyType==="byday"&&r.byDay.length>0){let n=r.bySetPos||1;e.push(`BYDAY=${n}${r.byDay[0]}`)}break;case"YEARLY":if(t)break;if(r.yearlyType==="bydate"){let n=r.byMonth.length>0?r.byMonth[0]:new Date().getMonth()+1,a=r.byMonthDay.length>0?r.byMonthDay[0]:new Date().getDate();e.push(`BYMONTH=${n}`),e.push(`BYMONTHDAY=${a}`)}else if(r.yearlyType==="byday"){let n=r.byMonth.length>0?r.byMonth[0]:new Date().getMonth()+1;if(e.push(`BYMONTH=${n}`),r.byDay.length>0){let a=r.bySetPos||1;e.push(`BYDAY=${a}${r.byDay[0]}`)}}break}switch(r.endType){case"count":r.count&&r.count>0&&e.push(`COUNT=${r.count}`);break;case"until":r.until&&e.push(`UNTIL=${r.until.replace(/-/g,"")}`);break}return e.join(";")}function AV(){return[...Array.from({length:31},(r,e)=>{let t=e+1;return{value:t.toString(),text:t.toString()}}),{value:"-1",text:"Last day"}]}var Ho,YI,Vl,_V,Pk=y(()=>{Ho=require("obsidian");Pu();JC();YI=[{dateIndex:0,code:"SU",nameKey:"sunday",shortKey:"sun"},{dateIndex:1,code:"MO",nameKey:"monday",shortKey:"mon"},{dateIndex:2,code:"TU",nameKey:"tuesday",shortKey:"tue"},{dateIndex:3,code:"WE",nameKey:"wednesday",shortKey:"wed"},{dateIndex:4,code:"TH",nameKey:"thursday",shortKey:"thu"},{dateIndex:5,code:"FR",nameKey:"friday",shortKey:"fri"},{dateIndex:6,code:"SA",nameKey:"saturday",shortKey:"sat"}];Vl=class{constructor(e){this.menu=new Ea,this.options=e,this.translate=e.plugin.i18n.translate.bind(e.plugin.i18n),this.buildMenu()}buildMenu(){this.getRecurrenceOptions().forEach(t=>{if(t.label.startsWith("\u2500")){this.menu.addSeparator();return}this.menu.addItem(n=>{let a=t.label;t.icon&&n.setIcon(t.icon),t.value===this.options.currentValue&&(a=`\u2713 ${t.label}`),n.setTitle(a),n.onClick(async()=>{let i=t.anchor||"scheduled";this.options.onSelect(t.value,i)})})}),this.menu.addSeparator(),this.menu.addItem(t=>{t.setTitle(this.translate("components.recurrenceContextMenu.customRecurrence")),t.setIcon("settings"),t.onClick(async()=>{this.showCustomRecurrenceModal()})}),this.options.currentValue&&this.menu.addItem(t=>{t.setTitle(this.translate("components.recurrenceContextMenu.clearRecurrence")),t.setIcon("x"),t.onClick(async()=>{this.options.onSelect(null)})})}getRecurrenceOptions(){return sTe({currentValue:this.options.currentValue,scheduledDate:this.options.scheduledDate,calendarLocale:pE(this.options.plugin),translate:this.translate})}showCustomRecurrenceModal(){new _V(this.options.app,this.options.currentValue||"",this.options.currentAnchor||"scheduled",this.options.scheduledDate,this.options.plugin,(e,t)=>{e&&this.options.onSelect(e,t)}).open()}show(e){this.menu.show(e)}},_V=class extends Ho.Modal{constructor(t,n,a,i,s,o){super(t);this.frequency="DAILY";this.interval=1;this.byDay=[];this.byMonthDay=[];this.byMonth=[];this.until="";this.endType="never";this.dtstart="";this.dtstartTime="";this.recurrenceAnchor="scheduled";this.currentValue=n,this.recurrenceAnchor=a,this.scheduledDate=i,this.plugin=s,this.translate=s.i18n.translate.bind(s.i18n),this.onSubmit=o,this.parseCurrentValue()}parseCurrentValue(){if(!this.currentValue){if(this.dtstart=MV(uE(this.scheduledDate)),this.scheduledDate&&this.scheduledDate.includes("T")){let n=this.scheduledDate.match(/T(\d{2}):(\d{2})/);n&&(this.dtstartTime=`${n[1]}:${n[2]}`)}return}let t=this.currentValue.split(";");for(let n of t){let a=n.includes(":")&&n.startsWith("DTSTART")?":":"=",[i,s]=n.split(a);switch(i){case"DTSTART":if(s.length>=8){if(this.dtstart=`${s.slice(0,4)}-${s.slice(4,6)}-${s.slice(6,8)}`,s.length>8&&s.includes("T")){let o=s.slice(9);o.length>=4&&(this.dtstartTime=`${o.slice(0,2)}:${o.slice(2,4)}`)}}else{let o=new Date(s);isNaN(o.getTime())?this.dtstart=MV(uE(this.scheduledDate)):this.dtstart=s}break;case"FREQ":this.frequency=s;break;case"INTERVAL":this.interval=parseInt(s)||1;break;case"BYDAY":{let o=s.split(","),l=[];for(let c of o){let d=c.match(/^(-?\d+)([A-Z]{2})$/);d?(this.bySetPos=parseInt(d[1]),l.push(d[2])):l.push(c)}this.byDay=l;break}case"BYMONTHDAY":this.byMonthDay=s.split(",").map(o=>parseInt(o));break;case"BYMONTH":this.byMonth=s.split(",").map(o=>parseInt(o));break;case"BYSETPOS":this.bySetPos=parseInt(s);break;case"COUNT":this.count=parseInt(s),this.endType="count";break;case"UNTIL":s.length===8?this.until=`${s.slice(0,4)}-${s.slice(4,6)}-${s.slice(6,8)}`:this.until=s,this.endType="until";break}}}onOpen(){var _n,Bs;let{contentEl:t}=this;t.empty();let n=pE(this.plugin),a=(Bs=(_n=this.plugin.settings)==null?void 0:_n.calendarViewSettings)==null?void 0:Bs.firstDay,i=nTe(a,n),s=uE(this.scheduledDate);t.createEl("h2",{text:this.translate("components.recurrenceContextMenu.customRecurrenceModal.title")}),new Ho.Setting(t).setName("Start date").setDesc("The date when the recurrence pattern begins").addText(se=>{se.inputEl.type="date",se.setValue(this.dtstart).onChange(De=>{this.dtstart=De}),zc(se.inputEl,{onCommit:De=>{this.dtstart=De}})}),new Ho.Setting(t).setName("Start time").setDesc("The time when recurring instances should appear (optional)").addText(se=>{se.inputEl.type="time",se.setValue(this.dtstartTime).onChange(De=>{this.dtstartTime=De})}),new Ho.Setting(t).setName("Recur from").setDesc("When should the next occurrence be calculated from?").addDropdown(se=>{se.addOption("scheduled","Scheduled date (fixed schedule)").addOption("completion","Completion date (flexible schedule)").setValue(this.recurrenceAnchor).onChange(De=>{this.recurrenceAnchor=De,this.updateFrequencySpecificVisibility()})}),new Ho.Setting(t).setName("Frequency").addDropdown(se=>{se.addOption("DAILY","Daily").addOption("WEEKLY","Weekly").addOption("MONTHLY","Monthly").addOption("YEARLY","Yearly").setValue(this.frequency).onChange(De=>{this.frequency=De,this.updateFrequencySpecificVisibility()})}),new Ho.Setting(t).setName("Interval").setDesc("Every X days/weeks/months/years").addText(se=>{se.setValue(this.interval.toString()).onChange(De=>{this.interval=parseInt(De)||1})});let o=new Ho.Setting(t).setName("Days of week").setDesc("Select specific days (for daily or weekly recurrence)"),l=o.controlEl.createDiv("days-container");i.map(se=>({key:se.code,label:this.translate(`components.recurrenceContextMenu.customRecurrenceModal.weekdaysShort.${se.shortKey}`)})).forEach(se=>{let De=l.createEl("label",{cls:"day-checkbox"});De.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),De.classList.add("tn-static-display-inline-block-60e32dcb"),De.classList.remove("tn-static-margin-right-4px-c6b76b85"),De.classList.add("tn-static-margin-right-8px-539fa9a0");let bn=De.createEl("input",{type:"checkbox"});bn.checked=this.byDay.includes(se.key),bn.addEventListener("change",()=>{bn.checked?this.byDay.includes(se.key)||this.byDay.push(se.key):this.byDay=this.byDay.filter(gh=>gh!==se.key)}),De.createSpan({text:` ${se.label}`})});let d=new Ho.Setting(t).setName("Monthly recurrence").setDesc("Choose how to repeat monthly"),u=d.controlEl.createDiv("monthly-options"),p=u.createEl("label",{cls:"radio-option"});p.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),p.classList.add("tn-static-display-block-2a1b75c9"),p.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),p.classList.add("tn-static-margin-bottom-8px-fdf33f23");let m=p.createEl("input",{type:"radio",value:"bydate"});m.name="monthly-type",m.checked=this.byMonthDay.length>0||this.byDay.length===0&&this.bySetPos===void 0,p.createSpan({text:" On "});let f=p.createEl("select");f.classList.add("tn-static-margin-left-4px-46cec891"),f.classList.remove("tn-static-margin-right-8px-539fa9a0"),f.classList.add("tn-static-margin-right-4px-c6b76b85");for(let se of AV()){let De=f.createEl("option",{value:se.value,text:se.text}),bn=parseInt(se.value,10);(this.byMonthDay.length>0&&this.byMonthDay[0]===bn||this.byMonthDay.length===0&&bn===s.getDate())&&(De.selected=!0)}p.createSpan({text:" of each month"});let h=u.createEl("label",{cls:"radio-option"});h.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),h.classList.add("tn-static-display-block-2a1b75c9"),h.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),h.classList.add("tn-static-margin-bottom-8px-fdf33f23");let g=h.createEl("input",{type:"radio",value:"byday"});g.name="monthly-type",g.checked=this.byDay.length>0&&this.bySetPos!==void 0,h.createSpan({text:" On the "});let v=h.createEl("select");v.classList.add("tn-static-margin-left-4px-46cec891"),v.classList.remove("tn-static-margin-right-8px-539fa9a0"),v.classList.add("tn-static-margin-right-4px-c6b76b85");let b=[{value:"1",text:"first"},{value:"2",text:"second"},{value:"3",text:"third"},{value:"4",text:"fourth"},{value:"-1",text:"last"}];b.forEach(se=>{let De=v.createEl("option",{value:se.value,text:se.text});(this.bySetPos===parseInt(se.value)||!this.bySetPos&&se.value==="1")&&(De.selected=!0)});let k=h.createEl("select");k.classList.add("tn-static-margin-left-4px-46cec891"),k.classList.remove("tn-static-margin-right-8px-539fa9a0"),k.classList.add("tn-static-margin-right-4px-c6b76b85");let w=i.map(se=>({value:se.code,text:this.translate(`components.recurrenceContextMenu.customRecurrenceModal.weekdays.${se.nameKey}`)})),S=["SU","MO","TU","WE","TH","FR","SA"][s.getDay()];w.forEach(se=>{let De=k.createEl("option",{value:se.value,text:se.text});(this.byDay.length>0&&this.byDay[0]===se.value||this.byDay.length===0&&se.value===S)&&(De.selected=!0)}),h.createSpan({text:" of each month"});let C=new Ho.Setting(t).setName("Yearly recurrence").setDesc("Choose how to repeat yearly"),E=C.controlEl.createDiv("yearly-options"),D=E.createEl("label",{cls:"radio-option"});D.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),D.classList.add("tn-static-display-block-2a1b75c9"),D.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),D.classList.add("tn-static-margin-bottom-8px-fdf33f23");let P=D.createEl("input",{type:"radio",value:"bydate"});P.name="yearly-type",P.checked=this.byMonthDay.length>0||this.byDay.length===0&&this.bySetPos===void 0,D.createSpan({text:" On "});let O=D.createEl("select");O.classList.add("tn-static-margin-left-4px-46cec891"),O.classList.remove("tn-static-margin-right-8px-539fa9a0"),O.classList.add("tn-static-margin-right-4px-c6b76b85");let z=["January","February","March","April","May","June","July","August","September","October","November","December"];z.forEach((se,De)=>{let bn=O.createEl("option",{value:(De+1).toString(),text:se});(this.byMonth.length>0&&this.byMonth[0]===De+1||this.byMonth.length===0&&De+1===s.getMonth()+1)&&(bn.selected=!0)});let R=D.createEl("select");R.classList.add("tn-static-margin-left-4px-46cec891"),R.classList.remove("tn-static-margin-right-8px-539fa9a0"),R.classList.add("tn-static-margin-right-4px-c6b76b85");for(let se of AV()){let De=R.createEl("option",{value:se.value,text:se.text}),bn=parseInt(se.value,10);(this.byMonthDay.length>0&&this.byMonthDay[0]===bn||this.byMonthDay.length===0&&bn===s.getDate())&&(De.selected=!0)}D.createSpan({text:" each year"});let A=E.createEl("label",{cls:"radio-option"});A.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),A.classList.add("tn-static-display-block-2a1b75c9"),A.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),A.classList.add("tn-static-margin-bottom-8px-fdf33f23");let F=A.createEl("input",{type:"radio",value:"byday"});F.name="yearly-type",F.checked=this.byDay.length>0&&this.bySetPos!==void 0,A.createSpan({text:" On the "});let $=A.createEl("select");$.classList.add("tn-static-margin-left-4px-46cec891"),$.classList.remove("tn-static-margin-right-8px-539fa9a0"),$.classList.add("tn-static-margin-right-4px-c6b76b85"),b.forEach(se=>{let De=$.createEl("option",{value:se.value,text:se.text});(this.bySetPos===parseInt(se.value)||!this.bySetPos&&se.value==="1")&&(De.selected=!0)});let B=A.createEl("select");B.classList.add("tn-static-margin-left-4px-46cec891"),B.classList.remove("tn-static-margin-right-8px-539fa9a0"),B.classList.add("tn-static-margin-right-4px-c6b76b85"),w.forEach(se=>{let De=B.createEl("option",{value:se.value,text:se.text});(this.byDay.length>0&&this.byDay[0]===se.value||this.byDay.length===0&&se.value===S)&&(De.selected=!0)});let ue=A.createEl("select");ue.classList.add("tn-static-margin-left-4px-46cec891"),ue.classList.remove("tn-static-margin-right-8px-539fa9a0"),ue.classList.add("tn-static-margin-right-4px-c6b76b85"),z.forEach((se,De)=>{let bn=ue.createEl("option",{value:(De+1).toString(),text:se});(this.byMonth.length>0&&this.byMonth[0]===De+1||this.byMonth.length===0&&De+1===s.getMonth()+1)&&(bn.selected=!0)}),A.createSpan({text:" each year"}),new Ho.Setting(t).setName("End condition").setDesc("Choose when the recurrence should end");let Q=t.createDiv("end-condition-container"),G=Q.createEl("label",{cls:"radio-option"});G.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),G.classList.add("tn-static-display-block-2a1b75c9"),G.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),G.classList.add("tn-static-margin-bottom-8px-fdf33f23");let ie=G.createEl("input",{type:"radio",value:"never"});ie.name="end-type",ie.checked=this.endType==="never",G.createSpan({text:" Never ends"});let Ee=Q.createEl("label",{cls:"radio-option"});Ee.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),Ee.classList.add("tn-static-display-block-2a1b75c9"),Ee.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),Ee.classList.add("tn-static-margin-bottom-8px-fdf33f23");let ee=Ee.createEl("input",{type:"radio",value:"count"});ee.name="end-type",ee.checked=this.endType==="count",Ee.createSpan({text:" End after "});let re=Ee.createEl("input",{type:"number",placeholder:"10"});re.classList.remove("tn-static-width-100-0466783d","tn-static-width-12px-fbf353fb","tn-static-width-16px-7375d50b","tn-static-width-1px-aa77e27e","tn-static-width-200px-2acaf3b5","tn-static-width-80px-8573bae3"),re.classList.add("tn-static-width-60px-bd09c419"),re.classList.add("tn-static-margin-left-4px-46cec891"),re.classList.remove("tn-static-margin-right-8px-539fa9a0"),re.classList.add("tn-static-margin-right-4px-c6b76b85"),re.value=this.count?this.count.toString():"",Ee.createSpan({text:" occurrences"});let et=Q.createEl("label",{cls:"radio-option"});et.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),et.classList.add("tn-static-display-block-2a1b75c9"),et.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-20px-49f14f8f"),et.classList.add("tn-static-margin-bottom-8px-fdf33f23");let fe=et.createEl("input",{type:"radio",value:"until"});fe.name="end-type",fe.checked=this.endType==="until",et.createSpan({text:" End on "});let ut=et.createEl("input",{type:"date"});ut.classList.add("tn-static-margin-left-4px-46cec891"),ut.value=this.until?this.until.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"):"",zc(ut,{onCommit:se=>{this.until=se.replace(/-/g,""),fe.checked=!0,this.endType="until"}}),ie.addEventListener("change",()=>{ie.checked&&(this.endType="never")}),ee.addEventListener("change",()=>{ee.checked&&(this.endType="count")}),fe.addEventListener("change",()=>{fe.checked&&(this.endType="until")}),re.addEventListener("input",()=>{this.count=parseInt(re.value)||void 0,re.value&&(ee.checked=!0,this.endType="count")}),ut.addEventListener("input",()=>{this.until=ut.value?ut.value.replace(/-/g,""):"",ut.value&&(fe.checked=!0,this.endType="until")}),this.updateFrequencySpecificVisibility=()=>{let se=this.recurrenceAnchor==="completion";o.settingEl.style.display=(this.frequency==="DAILY"||this.frequency==="WEEKLY")&&!se?"flex":"none",d.settingEl.style.display=this.frequency==="MONTHLY"&&!se?"flex":"none",C.settingEl.style.display=this.frequency==="YEARLY"&&!se?"flex":"none"},this.updateFrequencySpecificVisibility();let Je=t.createDiv("button-container");Je.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),Je.classList.add("tn-static-display-flex-75816cae"),Je.classList.remove("tn-static-justify-content-center-03c4bb6f","tn-static-justify-content-space-between-a562f4fd"),Je.classList.add("tn-static-justify-content-flex-end-455f8cca"),Je.classList.remove("tn-static-display-flex-8bb39979","tn-static-gap-0-5rem-ce2fca4d","tn-static-gap-10px-f3d7ce77","tn-static-gap-12px-ed7b3d87","tn-static-gap-6px-f0abc1db"),Je.classList.add("tn-static-gap-8px-33fcd4c3"),Je.classList.remove("tn-static-font-size-12px-b0cc7e05","tn-static-margin-top-0-5rem-3dc98b5e","tn-static-margin-top-0-d462248a","tn-static-margin-top-12px-91e0f558","tn-static-margin-top-1rem-2239d6d5","tn-static-margin-top-20px-a26bda7d","tn-static-margin-top-30px-2fbbbcd4","tn-static-margin-top-4px-96ad6099","tn-static-margin-top-8px-8a77e5a3","tn-static-margin-top-8px-f4f01e68"),Je.classList.add("tn-static-margin-top-16px-1b0f4999"),Je.createEl("button",{text:"Cancel"}).addEventListener("click",()=>{this.close()}),Je.createEl("button",{text:"Save",cls:"mod-cta"}).addEventListener("click",()=>{let se=m.checked?"bydate":"byday",De=P.checked?"bydate":"byday";this.frequency==="MONTHLY"?se==="bydate"?(this.byMonthDay=[parseInt(f.value)],this.byDay=[],this.bySetPos=void 0):(this.byMonthDay=[],this.byDay=[k.value],this.bySetPos=parseInt(v.value)):this.frequency==="YEARLY"&&(De==="bydate"?(this.byMonth=[parseInt(O.value)],this.byMonthDay=[parseInt(R.value)],this.byDay=[],this.bySetPos=void 0):(this.byMonth=[parseInt(ue.value)],this.byMonthDay=[],this.byDay=[B.value],this.bySetPos=parseInt($.value)));let bn=this.buildRRule(se,De);this.onSubmit(bn,this.recurrenceAnchor),this.close()})}updateFrequencySpecificVisibility(){}buildRRule(t,n){return oTe({frequency:this.frequency,interval:this.interval,dtstart:this.dtstart,dtstartTime:this.dtstartTime,recurrenceAnchor:this.recurrenceAnchor,byDay:this.byDay,byMonthDay:this.byMonthDay,byMonth:this.byMonth,bySetPos:this.bySetPos,endType:this.endType,count:this.count,until:this.until,monthlyType:t,yearlyType:n})}onClose(){let{contentEl:t}=this;t.empty()}}});var cTe={};at(cTe,{ReminderModal:()=>ql});var fn,IV,NV,ql,Mk=y(()=>{fn=require("obsidian");Me();JC();K();IV=N({tag:"Modals/ReminderModal"}),NV="reminder-modal__fields--hidden",ql=class extends fn.Modal{constructor(t,n,a,i){super(t);this.selectedType="relative";this.relativeAnchor="due";this.relativeOffset=15;this.relativeUnit="minutes";this.relativeDirection="before";this.absoluteDate="";this.absoluteTime="";this.description="";this.plugin=n,this.task=a,this.reminders=a.reminders?[...a.reminders]:[],this.originalReminders=a.reminders?[...a.reminders]:[],this.onSave=i}onOpen(){let{contentEl:t}=this;t.empty(),t.addClass("tasknotes-plugin"),t.addClass("tasknotes-reminder-modal"),t.createDiv({cls:"reminder-modal__loading"}).createDiv({text:"Loading reminders..."}),this.initializeWithFreshData().catch(a=>{IV.error("Failed to initialize reminder modal:",{category:"internal",operation:"initialize-reminder-modal",error:a}),t.empty(),t.addClass("tasknotes-plugin"),t.addClass("tasknotes-reminder-modal"),t.createDiv({cls:"reminder-modal__error",text:"Failed to load task data. Please try again."})})}async initializeWithFreshData(){let{contentEl:t}=this;if(this.task.path&&this.task.path.trim()!==""){let s=await this.plugin.cacheManager.getTaskInfo(this.task.path);s?(this.task=s,this.reminders=s.reminders?[...s.reminders]:[],this.originalReminders=s.reminders?[...s.reminders]:[]):(this.reminders=this.task.reminders?[...this.task.reminders]:[],this.originalReminders=this.task.reminders?[...this.task.reminders]:[])}else this.reminders=this.task.reminders?[...this.task.reminders]:[],this.originalReminders=this.task.reminders?[...this.task.reminders]:[];t.empty(),t.addClass("tasknotes-plugin"),t.addClass("tasknotes-reminder-modal");let n=t.createDiv({cls:"reminder-modal__header"});n.createEl("h2",{text:"Task reminders"}),n.createDiv({cls:"reminder-modal__task-title",text:this.task.title});let a=this.getTaskContextInfo();if(a){let s=n.createDiv({cls:"reminder-modal__task-dates"});s.textContent=a}let i=t.createDiv({cls:"reminder-modal__content"});this.renderExistingReminders(i),this.renderAddReminderForm(i),this.renderActionButtons(t),this.setupKeyboardHandlers(),this.updateSaveButtonState()}renderActionButtons(t){let n=t.createDiv({cls:"reminder-modal__actions"});this.saveBtn=n.createEl("button",{text:"Save changes",cls:"mod-cta reminder-modal__save-btn"}),this.saveBtn.disabled=!0,this.saveBtn.onclick=async()=>{await this.save()};let a=n.createEl("button",{text:"Cancel",cls:"reminder-modal__cancel-btn"});a.onclick=()=>{this.cancel()}}getTaskContextInfo(){let t=[];return this.task.due&&t.push(`Due: ${bu(this.task.due)}`),this.task.scheduled&&t.push(`Scheduled: ${bu(this.task.scheduled)}`),t.length>0?t.join(" \u2022 "):null}setupKeyboardHandlers(){let t=n=>{n.key==="Enter"&&(n.ctrlKey||n.metaKey)&&!this.saveBtn.disabled?(n.preventDefault(),this.save()):n.key==="Escape"&&(n.preventDefault(),this.cancel())};this.contentEl.addEventListener("keydown",t),this.onClose=()=>{this.contentEl.removeEventListener("keydown",t);let{contentEl:n}=this;n.empty()}}updateSaveButtonState(){if(!this.saveBtn)return;let t=this.remindersHaveChanged();this.saveBtn.disabled=!t,this.saveBtn.textContent=t?"Save Changes":"No Changes"}renderExistingReminders(t){let n=t.createDiv({cls:"reminder-modal__section"}),a=n.createDiv({cls:"reminder-modal__section-header"});if(a.createEl("h3",{text:"Current reminders"}),this.reminders.length>0&&a.createSpan({cls:"reminder-modal__reminder-count",text:`(${this.reminders.length})`}),this.reminders.length===0){let s=n.createDiv({cls:"reminder-modal__empty-state"});(0,fn.setIcon)(s.createDiv({cls:"reminder-modal__empty-icon"}),"bell-off"),s.createDiv({cls:"reminder-modal__empty-text",text:"No reminders set"});return}let i=n.createDiv({cls:"reminder-modal__reminder-list"});this.reminders.forEach((s,o)=>{let l=i.createDiv({cls:"reminder-modal__reminder-card"}),c=l.createDiv({cls:"reminder-modal__reminder-icon"}),d=s.type==="absolute"?"calendar-clock":"timer";(0,fn.setIcon)(c,d);let u=l.createDiv({cls:"reminder-modal__reminder-content"}),p=u.createDiv({cls:"reminder-modal__reminder-primary"});if(p.textContent=this.formatReminderDisplayText(s),s.description){let h=u.createDiv({cls:"reminder-modal__reminder-description"});h.textContent=`"${s.description}"`}let f=l.createDiv({cls:"reminder-modal__reminder-actions"}).createEl("button",{cls:"reminder-modal__action-btn reminder-modal__remove-btn"});(0,fn.setIcon)(f,"trash-2"),(0,fn.setTooltip)(f,"Delete this reminder"),f.onclick=async h=>{h.stopPropagation(),await this.removeReminder(o)}})}formatReminderDisplayText(t){if(t.type==="absolute"){if(t.absoluteTime)try{let n=new Date(t.absoluteTime);return`${n.toLocaleDateString()} at ${n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`}catch(n){return`At ${t.absoluteTime}`}return"Absolute reminder"}else{let n=t.relatedTo==="due"?"due date":"scheduled date";return`${this.formatOffset(t.offset||"")} ${n}`}}renderQuickActions(t){if(!(this.task.due||this.task.scheduled))return;let i=t.createDiv({cls:"reminder-modal__quick-actions"}).createDiv({cls:"reminder-modal__quick-buttons"});[{label:"5m",fullLabel:"5 minutes before",offset:"-PT5M",icon:"clock"},{label:"15m",fullLabel:"15 minutes before",offset:"-PT15M",icon:"clock"},{label:"1h",fullLabel:"1 hour before",offset:"-PT1H",icon:"clock"},{label:"1d",fullLabel:"1 day before",offset:"-P1D",icon:"calendar"}].forEach(({label:o,fullLabel:l,offset:c,icon:d})=>{let u=this.task.due?"due":"scheduled",p=i.createEl("button",{cls:"reminder-modal__quick-btn"}),m=p.createSpan({cls:"reminder-modal__quick-btn-icon"});(0,fn.setIcon)(m,d),p.createSpan({cls:"reminder-modal__quick-btn-label",text:o}),(0,fn.setTooltip)(p,`Add reminder ${l} ${u} date`),p.onclick=async()=>{await this.addQuickReminder(u,c,l)}})}async addQuickReminder(t,n,a){let i={id:`rem_${Date.now()}`,type:"relative",relatedTo:t,offset:n,description:a};await this.addReminder(i),new fn.Notice(`Added reminder: ${a}`)}renderAddReminderForm(t){let n=t.createDiv({cls:"reminder-modal__section"});n.createDiv({cls:"reminder-modal__section-header"}).createEl("h3",{text:"Add new reminder"}),this.renderQuickActions(n);let i=n.createDiv({cls:"reminder-modal__form"}),s=i.createDiv({cls:"reminder-modal__type-selector"}),o=s.createEl("button",{cls:"reminder-modal__type-tab reminder-modal__type-tab--active",text:"Relative",attr:{"data-type":"relative"}}),l=s.createEl("button",{cls:"reminder-modal__type-tab",text:"Absolute",attr:{"data-type":"absolute"}});o.classList.toggle("reminder-modal__type-tab--active",this.selectedType==="relative"),l.classList.toggle("reminder-modal__type-tab--active",this.selectedType==="absolute");let c=f=>{this.selectedType=f,o.classList.toggle("reminder-modal__type-tab--active",f==="relative"),l.classList.toggle("reminder-modal__type-tab--active",f==="absolute"),this.updateFormVisibility(i,this.selectedType)};o.onclick=()=>c("relative"),l.onclick=()=>c("absolute");let d=i.createDiv({cls:"relative-fields"});new fn.Setting(d).setName("Time").addText(f=>{f.setPlaceholder("15").setValue(String(this.relativeOffset)).onChange(h=>{this.relativeOffset=parseInt(h)||0})}).addDropdown(f=>{f.addOption("minutes","Minutes").addOption("hours","Hours").addOption("days","Days").setValue(this.relativeUnit).onChange(h=>{this.relativeUnit=h})}),new fn.Setting(d).setName("Direction").addDropdown(f=>{f.addOption("before","Before").addOption("after","After").setValue(this.relativeDirection).onChange(h=>{this.relativeDirection=h})}),new fn.Setting(d).setName("Relative to").addDropdown(f=>{let h={};this.task.due&&(h.due=`Due date (${bu(this.task.due)})`),this.task.scheduled&&(h.scheduled=`Scheduled date (${bu(this.task.scheduled)})`),Object.keys(h).length===0?(h.none="No dates available",f.setDisabled(!0)):(Object.entries(h).forEach(([g,v])=>{f.addOption(g,v)}),f.setValue(this.relativeAnchor)),f.onChange(g=>{this.relativeAnchor=g})});let u=i.createDiv({cls:`absolute-fields ${NV}`});new fn.Setting(u).setName("Date").addText(f=>{f.setPlaceholder("Yyyy-mm-dd").setValue(this.absoluteDate).onChange(h=>{this.absoluteDate=h}),f.inputEl.type="date",zc(f.inputEl,{onCommit:h=>{this.absoluteDate=h}})}),new fn.Setting(u).setName("Time").addText(f=>{f.setPlaceholder("Hh:mm").setValue(this.absoluteTime).onChange(h=>{this.absoluteTime=h}),f.inputEl.type="time"}),new fn.Setting(i).setName("Description (optional)").addText(f=>{f.setPlaceholder("Custom reminder message").setValue(this.description).onChange(h=>{this.description=h})});let p=i.createEl("button",{cls:"reminder-add-btn"}),m=p.createSpan({cls:"reminder-add-btn-icon"});(0,fn.setIcon)(m,"plus"),p.createSpan({cls:"reminder-add-btn-text",text:"Add Reminder"}),p.onclick=async()=>{p.disabled=!0,p.classList.add("reminder-add-btn--loading");try{let f=this.createReminder(this.selectedType,this.relativeAnchor,this.relativeOffset,this.relativeUnit,this.relativeDirection,this.absoluteDate,this.absoluteTime,this.description);f&&(await this.addReminder(f),this.selectedType==="relative"?(this.relativeOffset=15,this.relativeUnit="minutes",this.description=""):(this.absoluteDate="",this.absoluteTime="",this.description=""),this.resetFormInputs(i))}catch(f){IV.error("Error adding reminder:",{category:"internal",operation:"adding-reminder",error:f}),new fn.Notice("Failed to add reminder. Please check your inputs.")}finally{p.disabled=!1,p.classList.remove("reminder-add-btn--loading")}},this.updateFormVisibility(i,this.selectedType)}updateFormVisibility(t,n){let a=t.querySelector(".relative-fields"),i=t.querySelector(".absolute-fields");a.classList.toggle(NV,n!=="relative"),i.classList.toggle(NV,n!=="absolute")}createReminder(t,n,a,i,s,o,l,c){let d=`rem_${Date.now()}`;if(t==="relative"){if(!(n==="due"?this.task.due:this.task.scheduled))return new fn.Notice(`Cannot create reminder: Task has no ${n} date`),null;let p="PT";return i==="days"?p=`P${a}D`:i==="hours"?p=`PT${a}H`:p=`PT${a}M`,s==="before"&&(p="-"+p),{id:d,type:"relative",relatedTo:n,offset:p,description:c||void 0}}else{if(!o||!l)return new fn.Notice("Please specify both date and time for absolute reminder"),null;let u=`${o}T${l}:00`;return{id:d,type:"absolute",absoluteTime:u,description:c||void 0}}}formatReminderTiming(t){if(t.type==="absolute")return"Absolute reminder";{let n=t.relatedTo==="due"?"due date":"scheduled date";return`${this.formatOffset(t.offset||"")} ${n}`}}formatReminderDetails(t){if(t.type==="absolute")return`At ${bu(t.absoluteTime||"")}`;{let n=t.relatedTo==="due"?this.task.due:this.task.scheduled;return n?`When ${t.relatedTo} date is ${bu(n)}`:`Relative to ${t.relatedTo} date (not set)`}}formatReminderDescription(t){if(t.description)return t.description;if(t.type==="absolute")return`At ${bu(t.absoluteTime||"")}`;{let n=t.relatedTo==="due"?"due date":"scheduled date";return`${this.formatOffset(t.offset||"")} ${n}`}}formatOffset(t){let n=t.startsWith("-"),i=(n?t.substring(1):t).match(/P(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?)?/);if(!i)return t;let[,s,o,l]=i,c=[];if(s&&c.push(`${s} day${s!=="1"?"s":""}`),o&&c.push(`${o} hour${o!=="1"?"s":""}`),l&&c.push(`${l} minute${l!=="1"?"s":""}`),c.length===0)return"At time of";let d=c.join(" ");return n?`${d} before`:`${d} after`}async addReminder(t){this.reminders.push(t),this.refreshRemindersListOnly(),this.task.path&&this.plugin.emitter.trigger("reminder-preview-changed",{taskPath:this.task.path,currentReminders:[...this.reminders],action:"added",reminder:t})}async removeReminder(t){let n=this.reminders[t];this.reminders.splice(t,1),this.refreshRemindersListOnly(),this.task.path&&n&&this.plugin.emitter.trigger("reminder-preview-changed",{taskPath:this.task.path,currentReminders:[...this.reminders],action:"removed",reminder:n})}async refresh(){await this.initializeWithFreshData()}refreshRemindersListOnly(){let t=this.contentEl.querySelector(".reminder-modal__content");if(t){let n=t.querySelector(".reminder-modal__section");n&&n.remove();let a=activeWindow.createDiv();this.renderExistingReminders(a);let i=a.firstChild;i&&t.insertBefore(i,t.firstChild)}this.updateSaveButtonState()}resetFormInputs(t){let n=t.querySelector('input[placeholder="15"]');n&&(n.value=String(this.relativeOffset));let a=t.querySelector('input[placeholder="Custom reminder message"]');a&&(a.value=this.description);let i=t.querySelector('input[type="date"]');i&&(i.value=this.absoluteDate);let s=t.querySelector('input[type="time"]');s&&(s.value=this.absoluteTime);let o=t.querySelector('.setting-item:has(input[placeholder="15"]) select');o&&(o.value=this.relativeUnit);let l=t.querySelector(".setting-item:nth-child(2) select");l&&(l.value=this.relativeDirection);let c=t.querySelector(".setting-item:nth-child(3) select");c&&(c.value=this.relativeAnchor)}async save(){var t;this.saveBtn.disabled=!0,this.saveBtn.textContent="Saving...";try{this.task.path&&this.task.path.trim()!==""&&((t=this.plugin.notificationService)==null||t.clearProcessedRemindersForTask(this.task.path));let n=this.remindersHaveChanged();this.onSave(this.reminders),n&&this.task.path&&this.plugin.emitter.trigger("reminder-changed",{taskPath:this.task.path,oldReminders:this.originalReminders,newReminders:[...this.reminders]}),this.close()}catch(n){IV.error("Failed to save reminders:",{category:"persistence",operation:"save-reminders",error:n}),new fn.Notice("Failed to save reminders. Please try again."),this.saveBtn.disabled=!1,this.saveBtn.textContent="Save changes"}}cancel(){this.remindersHaveChanged()&&this.task.path&&this.plugin.emitter.trigger("reminder-preview-changed",{taskPath:this.task.path,currentReminders:[...this.originalReminders],action:"cancelled"}),this.close()}remindersHaveChanged(){return this.reminders.length!==this.originalReminders.length?!0:!this.reminders.every((t,n)=>{let a=this.originalReminders[n];return a?t.id===a.id&&t.type===a.type&&t.relatedTo===a.relatedTo&&t.offset===a.offset&&t.absoluteTime===a.absoluteTime&&t.description===a.description:!1})}onClose(){let{contentEl:t}=this;t.empty()}}});function KI(r){return N({tag:"TaskCard/Actions",isDebugEnabled:()=>r.settings.enableDebugLogging})}function RV(r){let{task:e,plugin:t,targetDate:n,updateStatusVisuals:a}=r;return i=>{i.stopPropagation(),(async()=>{let s=KI(t);try{if(e.recurrence){let p=await t.toggleRecurringTaskComplete(e,n),m=$v(p,n,t.statusManager.getCompletedStatuses()[0]),f=t.statusManager.isCompletedStatus(m);a(p,m,f);return}let o=await t.cacheManager.getTaskInfo(e.path);if(!o){new Ak.Notice("Task not found");return}let l=o.status||t.settings.defaultTaskStatus,c=i.shiftKey?t.statusManager.getPreviousStatus(l):t.statusManager.getNextStatus(l),d=await t.updateTaskProperty(o,"status",c),u=t.statusManager.isCompletedStatus(c);a(d,c,u)}catch(o){let l=o instanceof Error?o.message:String(o);s.error("Error cycling task status",{category:"persistence",operation:"cycle-status",details:{taskPath:e.path,errorMessage:l},error:o}),new Ak.Notice(`Failed to update task status: ${l}`)}})()}}function FV(r,e){return t=>{t.stopPropagation(),new ju({currentValue:r.priority,onSelect:a=>{(async()=>{let i=KI(e);try{await e.updateTaskProperty(r,"priority",a)}catch(s){i.error("Error updating priority",{category:"persistence",operation:"update-priority",details:{taskPath:r.path,newPriority:a},error:s}),new Ak.Notice("Failed to update priority")}})()},plugin:e}).show(t)}}function OV(r,e){return t=>{t.stopPropagation(),new Vl({currentValue:typeof r.recurrence=="string"?r.recurrence:void 0,currentAnchor:r.recurrence_anchor||"scheduled",scheduledDate:r.scheduled,onSelect:(a,i)=>{(async()=>{let s=KI(e);try{await e.updateTaskProperty(r,"recurrence",a||void 0),i!==void 0&&await e.updateTaskProperty(r,"recurrence_anchor",i)}catch(o){s.error("Error updating recurrence",{category:"persistence",operation:"update-recurrence",details:{taskPath:r.path,newRecurrence:a,anchor:i},error:o}),new Ak.Notice("Failed to update recurrence")}})()},app:e.app,plugin:e}).show(t)}}function LV(r,e){return()=>{new ql(e.app,e,r,n=>{(async()=>{let a=KI(e);try{await e.updateTaskProperty(r,"reminders",n.length>0?n:void 0)}catch(i){a.error("Error updating reminders",{category:"persistence",operation:"update-reminders",details:{taskPath:r.path,reminderCount:n.length},error:i}),new Ak.Notice("Failed to update reminders")}})()}).open()}}var Ak,zV=y(()=>{Ak=require("obsidian");dE();Pk();Mk();Ct();K()});function Ne(r,e){return r.createElement(e,{})}var ms=y(()=>{});function ZI(r){return N({tag:"TaskCard/Relationships",isDebugEnabled:()=>{var e;return((e=r.settings)==null?void 0:e.enableDebugLogging)===!0}})}function jV(r,e){var t,n;return(n=(t=r.getRelationshipOptions)==null?void 0:t.call(r,e))!=null?n:{}}function lit(r,e){let t=()=>e.classList.add("task-card--nested-interactive-hover"),n=()=>e.classList.remove("task-card--nested-interactive-hover");r.addEventListener("mouseenter",t),r.addEventListener("mouseleave",n)}function cit(r){let e=r,t=e._clickHandler;t&&(r.removeEventListener("click",t),delete e._clickHandler)}function ao(r,e){let t=r.querySelector(e);t&&(r.classList.remove("task-card--nested-interactive-hover"),cit(t),t.remove())}function dTe(r){ao(r,".task-card__subtasks"),ao(r,".task-card__blocking"),ao(r,".task-card__blocked-by")}function $V(r,e,t,n={}){let a=r.querySelector(e);if(a)return a;let i=Ne(r.ownerDocument,"div");i.className=t;let s=o=>{o.stopPropagation()};return i.addEventListener("click",s),i._clickHandler=s,n.stopExtraPointerEvents&&(i.addEventListener("dblclick",o=>o.stopPropagation()),i.addEventListener("contextmenu",o=>o.stopPropagation())),lit(i,r),r.appendChild(i),i}function dit(r){var n;let e=[],t=r.closest(".task-card");for(;t;){let a=t._taskPath;typeof a=="string"&&e.unshift(a),t=(n=t.parentElement)==null?void 0:n.closest(".task-card")}return e}function BV(r){for(;r.firstChild;)r.removeChild(r.firstChild)}function uTe(r,e,t,n,a){for(let i of e){let s=t.renderTaskCard(i,n);s.classList.add(a),r.appendChild(s)}}async function UV(r,e,t,n){let{plugin:a}=r,i=ZI(a);try{if(!n){ao(e,".task-card__subtasks");return}let s=$V(e,".task-card__subtasks","task-card__subtasks");BV(s);let o=s.createDiv({cls:"task-card__subtasks-loading",text:a.i18n.translate("contextMenus.task.subtasks.loading")});try{let l=a.app.vault.getAbstractFileByPath(t.path);if(!(l instanceof mE.TFile))throw new Error("Task file not found");if(!a.projectSubtasksService)throw new Error("projectSubtasksService not initialized");let c=jV(r,e),d=qI(await a.projectSubtasksService.getTasksLinkedToProject(l),c);if(o.remove(),d.length===0){s.createDiv({cls:"task-card__subtasks-loading",text:a.i18n.translate("contextMenus.task.subtasks.noSubtasks")});return}let u=eTe(d,c,m=>a.projectSubtasksService.sortTasks(m)),p=dit(e);for(let m of u){if(p.includes(m.path)){i.warn("Skipped circular task relationship",{category:"validation",operation:"render-subtasks",details:{taskPath:t.path,subtaskPath:m.path,parentChain:p}});continue}let f=r.renderTaskCard(m,c);f.classList.add("task-card--subtask"),s.appendChild(f)}}catch(l){i.error("Error loading subtasks",{category:"provider",operation:"load-subtasks",details:{taskPath:t.path},error:l}),o.textContent=a.i18n.translate("contextMenus.task.subtasks.loadFailed")}}catch(s){throw i.error("Error toggling subtasks",{category:"internal",operation:"toggle-subtasks",details:{taskPath:t.path,expanded:n},error:s}),s}}async function pTe(r,e,t,n){let{plugin:a}=r,i=ZI(a);if(!n){ao(e,".task-card__blocking");return}let s=$V(e,".task-card__blocking","task-card__blocking",{stopExtraPointerEvents:!0});BV(s);let o=s.createDiv({cls:"task-card__blocking-loading",text:a.i18n.translate("ui.taskCard.loadingDependencies")});try{let l=t.blocking?await Promise.all(t.blocking.map(u=>a.cacheManager.getTaskInfo(u))):[],c=jV(r,e),d=qI(l.filter(u=>!!u),c);if(o.remove(),d.length===0){s.createDiv({cls:"task-card__blocking-empty",text:a.i18n.translate("ui.taskCard.blockingEmpty")});return}uTe(s,d,r,c,"task-card--dependency")}catch(l){i.error("Error loading blocking tasks",{category:"provider",operation:"load-blocking-tasks",details:{taskPath:t.path},error:l}),o.textContent=a.i18n.translate("ui.taskCard.blockingLoadError")}}async function mTe(r,e,t,n){let{plugin:a}=r,i=ZI(a);if(!n){ao(e,".task-card__blocked-by");return}let s=$V(e,".task-card__blocked-by","task-card__blocked-by",{stopExtraPointerEvents:!0});BV(s);let o=s.createDiv({cls:"task-card__blocked-by-loading",text:a.i18n.translate("ui.taskCard.loadingDependencies")});try{let l=ig(t,a.app),c=await Promise.all(l.map(p=>a.cacheManager.getTaskInfo(p))),d=jV(r,e),u=qI(c.filter(p=>!!p),d);if(o.remove(),u.length===0){s.createDiv({cls:"task-card__blocked-by-empty",text:a.i18n.translate("ui.taskCard.blockedBadge")});return}uTe(s,u,r,d,"task-card--dependency")}catch(l){i.error("Error loading blocked-by tasks",{category:"provider",operation:"load-blocked-by-tasks",details:{taskPath:t.path},error:l}),o.textContent=a.i18n.translate("ui.taskCard.blockingLoadError")}}async function fTe(r,e,t){let{plugin:n}=r,a=ZI(n);if(!e.projects||e.projects.length===0)return;let i=0,s=10;for(;iwindow.setTimeout(l,10)),i++}let o=t.querySelectorAll(".task-card__chevron--expanded");for(let l of o){let c=l.closest(".task-card");if(!c)continue;let d=c.dataset.taskPath;if(!d)continue;let u=n.app.vault.getAbstractFileByPath(d);if(!(u instanceof mE.TFile))continue;let p=u.basename;if(!(!e.projects.flat(2).some(h=>{if(h&&typeof h=="string"&&h.startsWith("[[")&&h.endsWith("]]")){let g=h.slice(2,-2).trim(),v=(0,mE.parseLinktext)(g).path,b=n.app.metadataCache.getFirstLinkpathDest(v,"");return v===p||b&&b.path===d}return h===p||h===d})||!c.querySelector(".task-card__subtasks")))try{let h=await n.cacheManager.getTaskInfo(d);h&&await UV(r,c,h,!0)}catch(h){a.error("Error refreshing parent task subtasks",{category:"provider",operation:"refresh-parent-subtasks",details:{taskPath:e.path,projectTaskPath:d},error:h})}}}var mE,HV=y(()=>{mE=require("obsidian");K();ms();WI()});function _k(r){return N({tag:"TaskCard/Badges",isDebugEnabled:()=>r.settings.enableDebugLogging})}function Ik(r,e,t){return r.i18n.translate(`ui.taskCard.${e}`,t)}function QI(r){var e;return((e=r.settings)==null?void 0:e.showExpandableSubtasks)===!0}function VV(r){var e;return((e=r.settings)==null?void 0:e.expandSubtasksByDefault)===!0&&QI(r)}function hTe(r,e){var t;return QI(e)&&((t=e.expandedProjectsService)==null?void 0:t.isExpanded(r.path,VV(e)))||!1}function pit(r){for(let e of uit)for(let t of r.querySelectorAll(e))t.remove();ao(r,".task-card__subtasks"),ao(r,".task-card__blocking"),ao(r,".task-card__blocked-by")}function qV(r,e,t){r.classList.toggle("task-card__chevron--expanded",t);let n=UI(e,t);r.setAttribute("aria-label",n),(0,og.setTooltip)(r,n,{placement:"top"})}function gTe(r,e,t,n){return()=>{(async()=>{let a=_k(e);try{if(!e.expandedProjectsService){new og.Notice("Service not available. Please try reloading the plugin.");return}let i=t.querySelector(".task-card__chevron");if(!i)return;let s=e.expandedProjectsService.toggle(r.path,VV(e));qV(i,e,s),await n.toggleSubtasks(t,r,s)}catch(i){a.error("Error toggling subtasks",{category:"internal",operation:"toggle-subtasks",details:{taskPath:r.path},error:i}),new og.Notice("Failed to toggle subtasks")}})()}}function yTe(r,e,t,n){return()=>{(async()=>{let a=_k(e);try{if(!e.expandedProjectsService){new og.Notice("Service not available. Please try reloading the plugin.");return}let i=e.expandedProjectsService.toggle(r.path,VV(e)),s=t.querySelector(".task-card__chevron");s&&qV(s,e,i),await n.toggleSubtasks(t,r,i)}catch(i){a.error("Error toggling project subtasks",{category:"internal",operation:"toggle-project-subtasks",details:{taskPath:r.path},error:i}),new og.Notice("Failed to toggle subtasks")}})()}}function vTe(r,e,t){return()=>{(async()=>{let n=e.querySelector(".task-card__blocking-toggle");if(!n)return;let a=n.classList.toggle("task-card__blocking-toggle--expanded");await t.toggleBlockingTasks(e,r,a)})()}}function kTe(r,e,t,n){return()=>{WV({card:t,task:r,plugin:e,handlers:n})}}function mit(r,e){let t=r.querySelector(".task-card__blocked-toggle");t&&(t.classList.toggle("task-card__blocked-toggle--expanded",e),t.setAttribute("aria-expanded",String(e)));for(let n of r.querySelectorAll(".task-card__metadata-pill--blocked"))n.getAttribute("role")==="button"&&n.setAttribute("aria-expanded",String(e))}async function WV(r){let{card:e,task:t,handlers:n}=r,a=!e.querySelector(".task-card__blocked-by");mit(e,a),await n.toggleBlockedByTasks(e,t,a)}function fit(r,e){let{card:t,task:n,plugin:a,handlers:i}=r;if(!a.projectSubtasksService.isTaskUsedAsProjectSync(n.path))return;let o=hTe(n,a),l=QI(a);Hc({container:e,className:"task-card__project-indicator",icon:"folder",tooltip:Ik(a,l?"projectTooltip":"projectIndicatorTooltip"),onClick:l?yTe(n,a,t,i):void 0}),l&&Hc({container:e,className:`task-card__chevron${o?" task-card__chevron--expanded":""}`,icon:"chevron-right",tooltip:UI(a,o),onClick:gTe(n,a,t,i)}),o&&i.toggleSubtasks(t,n,!0).catch(c=>{_k(a).error("Error showing initial subtasks",{category:"internal",operation:"show-initial-subtasks",details:{taskPath:n.path},error:c})})}function hit(r,e){let{card:t,task:n,plugin:a,handlers:i}=r;if(n.blocking&&n.blocking.length>0){let o=n.blocking.length,l=a.i18n.translate("ui.taskCard.blockingToggle",{count:o}),c=Hc({container:e,className:"task-card__blocking-toggle is-visible",icon:"git-branch",tooltip:l,onClick:vTe(n,t,i)});c&&(c.dataset.count=String(o))}let s=ig(n,a.app);if(s.length>0){let o=`${Ik(a,"blockedBadge")} (${s.length})`,l=Hc({container:e,className:"task-card__blocked-toggle is-visible",icon:"git-merge",tooltip:o,onClick:kTe(n,a,t,i)});l&&(l.dataset.count=String(s.length))}}function bTe(r){let{badgesContainer:e,task:t,plugin:n,hasDetails:a,propertyOptions:i}=r;if(!(!e||i.showSecondaryBadges===!1)){if(t.recurrence&&Hc({container:e,className:"task-card__recurring-indicator",icon:"rotate-ccw",tooltip:oE(n,t.recurrence,i.propertyLabels),onClick:OV(t,n)}),t.reminders&&t.reminders.length>0){let s=t.reminders.length;Hc({container:e,className:"task-card__reminder-indicator",icon:"bell",tooltip:xV(n,s),onClick:LV(t,n)})}a&&Hc({container:e,className:"task-card__details-indicator",icon:"file-text",tooltip:Ik(n,"detailsTooltip")}),fit(r,e),hit(r,e)}}function git(r){let{card:e,mainRow:t,task:n,plugin:a,handlers:i}=r,s=_k(a);a.projectSubtasksService.isTaskUsedAsProject(n.path).then(o=>{var f,h,g,v;(f=e.querySelector(".task-card__project-indicator-placeholder"))==null||f.remove(),(h=e.querySelector(".task-card__chevron-placeholder"))==null||h.remove();let l=QI(a),c=e.querySelector(".task-card__project-indicator"),d=(c==null?void 0:c.getAttribute("role"))==="button";o&&c&&d!==l&&c.remove(),sg(e,".task-card__project-indicator",{shouldExist:o,className:"task-card__project-indicator",icon:"folder",tooltip:Ik(a,l?"projectTooltip":"projectIndicatorTooltip"),onClick:l?yTe(n,a,e,i):void 0});let u=o&&l,p=e.querySelector(".task-card__chevron"),m=o&&hTe(n,a);u&&!p?Hc({container:(v=(g=e.querySelector(".task-card__badges"))!=null?g:t)!=null?v:e,className:`task-card__chevron${m?" task-card__chevron--expanded":""}`,icon:"chevron-right",tooltip:UI(a,m),onClick:gTe(n,a,e,i)}):u&&p?qV(p,a,m):!u&&p&&p.remove(),m?i.toggleSubtasks(e,n,!0).catch(b=>{s.error("Error showing subtasks in update",{category:"internal",operation:"show-subtasks-update",details:{taskPath:n.path},error:b})}):ao(e,".task-card__subtasks")}).catch(o=>{s.error("Error checking if task is used as project in update",{category:"internal",operation:"check-project-task",details:{taskPath:n.path},error:o})})}function yit(r){var c,d;let{card:e,task:t,plugin:n,handlers:a}=r,i=(d=(c=t.blocking)==null?void 0:c.length)!=null?d:0,s=i>0,o=n.i18n.translate("ui.taskCard.blockingToggle",{count:i}),l=sg(e,".task-card__blocking-toggle",{shouldExist:s,className:"task-card__blocking-toggle is-visible",icon:"git-branch",tooltip:o,onClick:vTe(t,e,a)});if(!s){ao(e,".task-card__blocking");return}l&&(l.classList.add("is-visible"),l.classList.remove("is-hidden"),l.dataset.count=String(i),l.classList.contains("task-card__blocking-toggle--expanded")&&a.toggleBlockingTasks(e,t,!0).catch(u=>{_k(n).error("Error refreshing blocking tasks",{category:"internal",operation:"refresh-blocking-tasks",details:{taskPath:t.path,blockingCount:i},error:u})}))}function vit(r){let{card:e,task:t,plugin:n,handlers:a}=r,i=ig(t,n.app),s=i.length>0,o=`${Ik(n,"blockedBadge")} (${i.length})`,l=sg(e,".task-card__blocked-toggle",{shouldExist:s,className:"task-card__blocked-toggle is-visible",icon:"git-merge",tooltip:o,onClick:kTe(t,n,e,a)});if(!s){ao(e,".task-card__blocked-by");return}l&&(l.classList.add("is-visible"),l.classList.remove("is-hidden"),l.dataset.count=String(i.length),l.classList.contains("task-card__blocked-toggle--expanded")&&a.toggleBlockedByTasks(e,t,!0).catch(c=>{_k(n).error("Error refreshing blocked-by tasks",{category:"internal",operation:"refresh-blocked-by-tasks",details:{taskPath:t.path,blockedByCount:i.length},error:c})}))}function TTe(r){var c,d;let{card:e,mainRow:t,task:n,plugin:a,hasDetails:i,propertyOptions:s}=r,o=e.querySelector(".task-card__badges");if(!o||s.showSecondaryBadges===!1){pit(e);return}sg(e,".task-card__recurring-indicator",{shouldExist:!!n.recurrence,className:"task-card__recurring-indicator",icon:"rotate-ccw",tooltip:n.recurrence?oE(a,n.recurrence,s.propertyLabels):"",onClick:OV(n,a)});let l=(d=(c=n.reminders)==null?void 0:c.length)!=null?d:0;sg(e,".task-card__reminder-indicator",{shouldExist:l>0,className:"task-card__reminder-indicator",icon:"bell",tooltip:xV(a,l),onClick:LV(n,a)}),sg(e,".task-card__details-indicator",{shouldExist:i,className:"task-card__details-indicator",icon:"file-text",tooltip:Ik(a,"detailsTooltip")}),git({...r,mainRow:t!=null?t:o}),yit(r),vit(r)}var og,uit,YV=y(()=>{og=require("obsidian");K();zV();CV();cE();HV();WI();uit=[".task-card__recurring-indicator",".task-card__reminder-indicator",".task-card__details-indicator",".task-card__project-indicator",".task-card__chevron",".task-card__blocking-toggle",".task-card__blocked-toggle"]});function kit(r,e){return r||(e.settings.defaultVisibleProperties?$i(e.settings.defaultVisibleProperties,e):Zbe(e))}function bit(r){var u,p;let{metadataLine:e,card:t,task:n,plugin:a,onBlockedByToggle:i}=r;if(!n.isBlocked)return null;let s=a.i18n.translate("ui.taskCard.blockedBadge"),o=ig(n,a.app),l=(p=(u=n.blockedBy)==null?void 0:u.length)!=null?p:0,c=l>0?`${s} (${l})`:s,d=e.createSpan({cls:"task-card__metadata-pill task-card__metadata-pill--blocked",text:c});if(o.length>0){let m=`${s} (${o.length})`;Hl(d),d.setAttribute("aria-label",m),d.setAttribute("aria-expanded",String(!!t.querySelector(".task-card__blocked-by"))),(0,$u.setTooltip)(d,m,{placement:"top"}),d.addEventListener("click",f=>{f.stopPropagation(),i()})}else(0,$u.setTooltip)(d,a.i18n.translate("ui.taskCard.blockedBadgeTooltip"),{placement:"top"});return d}function Tit(r){var l,c;let{metadataLine:e,task:t,plugin:n}=r;if(!t.isBlocking)return null;let a=n.i18n.translate("ui.taskCard.blockingBadge"),i=(c=(l=t.blocking)==null?void 0:l.length)!=null?c:0,s=i>0?`${a} (${i})`:a,o=e.createSpan({cls:"task-card__metadata-pill task-card__metadata-pill--blocking",text:s});return(0,$u.setTooltip)(o,n.i18n.translate("ui.taskCard.blockingBadgeTooltip"),{placement:"top"}),o}function wit(r){let{metadataLine:e,task:t,plugin:n}=r;if(!t.googleCalendarEventId)return null;let a=e.createSpan({cls:"task-card__metadata-pill task-card__metadata-pill--google-calendar"});return(0,$u.setIcon)(a,"calendar"),(0,$u.setTooltip)(a,n.i18n.translate("ui.taskCard.googleCalendarSyncTooltip"),{placement:"top"}),a}function Sit(r){var s;let{metadataLine:e,task:t,plugin:n}=r;if(!t.recurrence_parent||!t.occurrence_date)return null;let a=Vn(t.occurrence_date,{dateFormat:"MMM d",showTime:!1,userTimeFormat:(s=n.settings.calendarViewSettings)==null?void 0:s.timeFormat}),i=e.createSpan({cls:"task-card__metadata-pill task-card__metadata-pill--occurrence"});return(0,$u.setIcon)(i,"refresh-ccw"),i.createSpan({text:`Occurrence: ${a}`}),Hl(i),i.setAttribute("aria-label",`Open recurring parent for occurrence on ${t.occurrence_date}`),(0,$u.setTooltip)(i,`Occurrence of ${t.recurrence_parent} on ${t.occurrence_date}`,{placement:"top"}),i.addEventListener("click",o=>{o.stopPropagation();let l=Et(t.recurrence_parent||"");n.app.workspace.openLinkText(l,t.path,!1)}),i}function xit(r){let{metadataLine:e,task:t,plugin:n,visibleProperties:a,propertyOptions:i={}}=r;e.empty();let s=[],o=kit(a,n),l=Sit(r);l&&s.push(l);for(let c of o){if(Ck(c,"status",n)||Ck(c,"priority",n))continue;if(c==="blocked"){let u=bit(r);u&&s.push(u);continue}if(c==="blocking"){let u=Tit(r);u&&s.push(u);continue}if(c==="googleCalendarSync"){let u=wit(r);u&&s.push(u);continue}let d=Qbe(e,c,t,n,i);d&&s.push(d)}return Jbe(e,s),s}function GV(r){let{metadataLine:e,card:t,task:n,plugin:a,visibleProperties:i,propertyOptions:s,handlers:o}=r;return xit({metadataLine:e,card:t,task:n,plugin:a,visibleProperties:i,propertyOptions:s,onBlockedByToggle:()=>void WV({card:t,task:n,plugin:a,handlers:o})})}var $u,wTe=y(()=>{$u=require("obsidian");Me();qn();$c();Xbe();WI();cE();YV()});function STe(r,e,t=!1){return!t&&(!r||r.some(n=>Ck(n,"status",e)))}function xTe(r,e){return!r||r.some(t=>Ck(t,"priority",e))}function JI(r,e,t){let n=t.statusManager.getStatusConfig(e);n!=null&&n.color?r.style.setProperty("--current-status-color",n.color):r.style.removeProperty("--current-status-color");let a=t.statusManager.getNextStatus(e),i=t.statusManager.getStatusConfig(a);i!=null&&i.color?r.style.setProperty("--next-status-color",i.color):r.style.removeProperty("--next-status-color")}function ZV(r,e,t){let n=t.priorityManager.getPriorityConfig(e.priority);return n!=null&&n.color?(r.style.setProperty("--priority-color",n.color),r.style.setProperty("--current-priority-color",n.color)):(r.style.removeProperty("--priority-color"),r.style.removeProperty("--current-priority-color")),n}function XI(r,e){e!=null&&e.color?r.style.borderColor=e.color:r.style.removeProperty("border-color"),e!=null&&e.icon?(r.addClass("task-card__status-dot--icon"),r.empty(),(0,KV.setIcon)(r,e.icon)):(r.removeClass("task-card__status-dot--icon"),r.empty(),r.removeAttribute("data-icon"),r.classList.remove("has-icon"))}function QV(r){let{mainRow:e,card:t,task:n,plugin:a,effectiveStatus:i,visibleProperties:s,hideStatusIndicator:o,onClick:l}=r;if(!STe(s,a,o)||!e)return null;let c=e.createSpan({cls:"task-card__status-dot"});return XI(c,a.statusManager.getStatusConfig(i)),Hl(c),c.addEventListener("click",l),c.dataset.taskPath=n.path,JI(t,i,a),c}function CTe(r,e,t){let n=r.querySelector(t);if(n){n.insertAdjacentElement("afterend",e);return}let a=r.querySelector(".task-card__checkbox");if(a){a.insertAdjacentElement("afterend",e);return}r.insertBefore(e,r.firstChild)}function ETe(r){let{mainRow:e,card:t,plugin:n,effectiveStatus:a,visibleProperties:i,hideStatusIndicator:s}=r,o=t.querySelector(".task-card__status-dot");if(JI(t,a,n),!STe(i,n,s))return o==null||o.remove(),null;if(o)return XI(o,n.statusManager.getStatusConfig(a)),o;if(!e)return null;let l=QV(r);return l&&CTe(e,l,".task-card__checkbox"),l}function DTe(r,e,t){r.style.borderColor=e.color,r.setAttribute("aria-label",t.i18n.translate("ui.taskCard.priorityAriaLabel",{label:e.label})),r.replaceChildren(),r.classList.toggle("task-card__priority-dot--icon",!!e.icon),e.icon?(0,KV.setIcon)(r,e.icon):(r.removeAttribute("data-icon"),r.classList.remove("has-icon"))}function JV(r){let{mainRow:e,task:t,plugin:n,visibleProperties:a,onClick:i}=r,s=n.priorityManager.getPriorityConfig(t.priority);if(!t.priority||!s||!xTe(a,n)||!e)return null;let o=e.createSpan({cls:"task-card__priority-dot"});return DTe(o,s,n),Hl(o),o.addEventListener("click",i),o}function PTe(r){var c,d;let{mainRow:e,card:t,task:n,plugin:a,visibleProperties:i}={...r,card:(d=(c=r.mainRow)==null?void 0:c.closest(".task-card"))!=null?d:r.mainRow};if(!t)return null;let s=t.querySelector(".task-card__priority-dot"),o=a.priorityManager.getPriorityConfig(n.priority);if(!n.priority||!o||!xTe(i,a))return s==null||s.remove(),null;if(!s){if(!e)return null;let u=JV(r);return u&&CTe(e,u,".task-card__status-dot"),u}DTe(s,o,a);let l=s.cloneNode(!0);return Hl(l),l.addEventListener("click",r.onClick),s.replaceWith(l),l}var KV,XV=y(()=>{KV=require("obsidian");$c();cE()});function Cit(r){let e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(r);if(!e)return null;let[,t,n,a]=e;return new Date(Date.UTC(Number(t),Number(n)-1,Number(a)))}function Eit(){let r=new Date;return new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate()))}function Dit(r){if(r.recurrence&&r.recurrence_anchor!=="completion"&&r.scheduled){let e=Cit(de(r.scheduled));if(e)return e}return Eit()}function eq(r,e){var n,a,i;if(typeof r.details=="string")return r.details.trim().length>0;if(!e||!r.path)return!1;let t=(i=(a=(n=e.app.metadataCache).getCache)==null?void 0:a.call(n,r.path))==null?void 0:i.sections;return t?t.some(s=>s.type!=="yaml"):!1}function tq(r){var e;return((e=r.settings)==null?void 0:e.showCompletedTaskStrikethrough)!==!1}function rq(r){let e=new Set;for(let t of Rl(r.projects||[])){let n=Cu(t);n&&e.add(`task-card--project-${n}`)}return Array.from(e)}function Pit(r,e,t){var i;let n=["task-card"];t.layout!=="default"&&n.push(`task-card--layout-${t.layout}`),t.isCompleted&&n.push("task-card--completed"),t.isCompleted&&tq(e)&&n.push("task-card--completed-strikethrough"),t.isSkipped&&n.push("task-card--skipped"),r.archived&&n.push("task-card--archived"),t.isActivelyTracked&&n.push("task-card--actively-tracked"),t.isRecurring&&n.push("task-card--recurring"),t.isMaterializedOccurrence&&n.push("task-card--materialized-occurrence"),t.hasDetails&&n.push("task-card--has-details"),r.priority&&n.push(`task-card--priority-${Cu(r.priority)}`),t.effectiveStatus&&n.push(`task-card--status-${Cu(t.effectiveStatus)}`),((i=e.settings)==null?void 0:i.subtaskChevronPosition)==="left"&&n.push("task-card--chevron-left");let a=rq(r);return a.length>0&&n.push("task-card--has-projects",...a),n}function nq(r,e,t={}){var c,d;let n=t.targetDate||Dit(r),a=r.recurrence?$v(r,n,e.statusManager.getCompletedStatuses()[0]):r.status,i=t.layout||"default",s=r.recurrence?((c=r.complete_instances)==null?void 0:c.includes(ce(n)))||!1:e.statusManager.isCompletedStatus(a),o=r.recurrence&&((d=r.skipped_instances)==null?void 0:d.includes(ce(n)))||!1,l={targetDate:n,effectiveStatus:a,layout:i,isCompleted:s,isSkipped:o,isRecurring:!!r.recurrence,isMaterializedOccurrence:!!(r.recurrence_parent&&r.occurrence_date),isActivelyTracked:e.getActiveTimeSession(r)!==null,hasDetails:eq(r,e)};return{...l,cardClasses:Pit(r,e,l)}}var aq=y(()=>{Me();Ct()});function Te(r,e,t){r==null||r.trigger(iq,{message:e,timeout:t})}var iq,fs=y(()=>{iq="user-notice"});function eN(r,e,t){return r.i18n.translate(e,t)}function Mit(r){let e=new Set,t=[];for(let n of r){let a=n.trim();!a||e.has(a)||(e.add(a),t.push(a))}return t}function ATe(r,e,t){return Ws(r.app,e,t,"","",r.settings.useFrontmatterMarkdownLinks)}function Ait(r,e,t){var s,o;let n=e.trim();if(!n)return"";let a=Et(n),i=(o=(s=r.app.metadataCache).getFirstLinkpathDest)==null?void 0:o.call(s,a,t);return i instanceof MTe.TFile?ATe(r,i,t):n}async function Nk(r,e,t){let n=Ws(r.app,t,e.path,"","",r.settings.useFrontmatterMarkdownLinks),a=`[[${t.basename}]]`,i=Array.isArray(e.projects)?e.projects:[];if(i.includes(n)||i.includes(a))return Te(r.emitter,eN(r,"contextMenus.task.organization.notices.alreadyInProject")),null;let o=[...i.filter(c=>c!==a),n],l=await r.updateTaskProperty(e,"projects",o);return Te(r.emitter,eN(r,"contextMenus.task.organization.notices.addedToProject",{project:t.basename})),l}async function tN(r,e,t){let n=Ws(r.app,e,t.path,"","",r.settings.useFrontmatterMarkdownLinks),a=`[[${e.basename}]]`,i=Array.isArray(t.projects)?t.projects:[];if(i.includes(n)||i.includes(a))return Te(r.emitter,eN(r,"contextMenus.task.organization.notices.alreadySubtask")),null;let o=[...i.filter(c=>c!==a),n],l=await r.updateTaskProperty(t,"projects",o);return Te(r.emitter,eN(r,"contextMenus.task.organization.notices.addedAsSubtask",{subtask:t.title,parent:e.basename})),l}function _Te(r,e,t){var c;let n=!!((c=r.settings.taskCreationDefaults)!=null&&c.inheritParentTaskProperties),a=ATe(r,t,e.path),i=Array.isArray(e.tags)?e.tags:[],s=n?Array.isArray(e.projects)?e.projects.map(d=>Ait(r,d,e.path)):[]:[],o=n?r.settings.taskIdentificationMethod==="tag"?Lu(i,r.settings.taskTag,r.settings.hideIdentifyingTagsMode):[...i]:[],l={projects:Mit([...s,a])};return o.length>0&&(l.tags=o),n&&Array.isArray(e.contexts)&&e.contexts.length>0&&(l.contexts=[...e.contexts]),n&&e.priority&&(l.priority=e.priority),l}var MTe,rN=y(()=>{MTe=require("obsidian");qn();fm();fs()});var Ba=y(()=>{W2()});function sq(r){return!!(r.googleCalendarEventId||r.googleCalendarExceptionEventId||r.googleCalendarExceptionOriginalScheduled||r.googleCalendarMovedOriginalDates&&r.googleCalendarMovedOriginalDates.length>0)&&!!r.recurrence&&(r.recurrence_anchor||"scheduled")==="scheduled"}function _it(r){let e=r.googleCalendarExceptionOriginalScheduled||r.scheduled||r.due;return de(e||"")||void 0}function nN(r,e,t){if(!sq(r)||e===r.scheduled)return;let n=_it(r);if(!n)return;let a=typeof e=="string"?de(e):"";t.googleCalendarExceptionOriginalScheduled=a&&a!==n?n:void 0}function lg(r){sq(r)||(r.googleCalendarExceptionOriginalScheduled=void 0,r.googleCalendarMovedOriginalDates=void 0)}function oq(r,e,t){if(!sq(r))return;let n=de(r.googleCalendarExceptionOriginalScheduled||"");if(!n)return;let a=de(r.scheduled||"");!a||e!==a||(t.googleCalendarMovedOriginalDates=Array.from(new Set([...r.googleCalendarMovedOriginalDates||[],n])).sort(),t.googleCalendarExceptionOriginalScheduled=void 0)}var aN=y(()=>{Me()});function bm(r){return Array.isArray(r)?r.filter(e=>typeof e=="string"):[]}function Iit(r){let e=r.match(/(?:^|;)INTERVAL=(\d+)(?:;|$)/),t=e?Number.parseInt(e[1],10):1;return r.includes("FREQ=DAILY")?Math.max(30,t*2):r.includes("FREQ=WEEKLY")?Math.max(90,t*7*2):r.includes("FREQ=MONTHLY")?Math.max(400,t*31*2):r.includes("FREQ=YEARLY")?Math.max(800,t*366*2):365}function Nit(r,e){if(!r.recurrence)return null;let t=Jp(r,e,e),n=ce(e);if(t.some(l=>ce(l)===n))return e;let a=new Set([...r.complete_instances||[],...r.skipped_instances||[]]),i=Iit(r.recurrence),s=new Date(e.getTime()-i*24*60*60*1e3),o=Jp(r,s,e);for(let l=o.length-1;l>=0;l--)if(!a.has(ce(o[l])))return o[l];return H2(r,{minOccurrenceDate:n})}function ITe(r,e){return(r.recurrence_anchor||"scheduled")==="completion"||r.googleCalendarExceptionOriginalScheduled?null:Nit(r,e)}function NTe(r,e){let t=ce(e);if(!r)return t;let n=de(r);return`${t}${r.slice(n.length)}`}function RTe(r,e,t){if((e.recurrence_anchor||"scheduled")!=="scheduled")return r;let n=new Set;for(let d of e.googleCalendarMovedOriginalDates||[]){let u=de(d);u&&n.add(u)}let a=de(e.googleCalendarExceptionOriginalScheduled||""),i=de(e.scheduled||"");a&&a!==t&&i===t&&n.add(a);let s=new Set(bm(r.complete_instances)),o=bm(r.skipped_instances),l=new Set(o),c=Array.from(n).filter(d=>!s.has(d)&&!l.has(d)).sort();return c.length===0?r:{...r,skipped_instances:[...o,...c]}}function sN(r,e){if(e)return e;if(r.recurrence_anchor!=="completion"&&r.scheduled)return kt(de(r.scheduled));let t=Er();return wn(t)}function FTe({freshTask:r,targetDate:e,currentTimestamp:t,maintainDueDateOffsetInRecurring:n}){if(!r.recurrence)throw new Error("Task is not recurring");let a=r.recurrence_anchor||"scheduled",i=ITe(r,e),s=i!=null?i:e,o=ce(s),l=bm(r.complete_instances),d=!l.includes(o),u={...r,dateModified:t};if(d){l.includes(o)||(u.complete_instances=[...l,o]);let v=bm(r.skipped_instances);u.skipped_instances=v.filter(b=>b!==o)}else{u.complete_instances=l.filter(b=>b!==o);let v=bm(r.skipped_instances);u.skipped_instances=v.filter(b=>b!==o)}if(d&&typeof u.recurrence=="string"){if(a==="completion"){let v=g_(u.recurrence,o);v&&(u.recurrence=v)}else if(!u.recurrence.includes("DTSTART:")){let v=Mh(u);v&&(u.recurrence=v)}}let p=i?{...u,scheduled:NTe(u.scheduled,i)}:u,m=RTe(p,r,o),f=nn(),h=o>f?o:f,g=wu(m,n,{minOccurrenceDate:h});return g.scheduled&&(u.scheduled=g.scheduled),g.due&&(u.due=g.due),oq(r,o,u),lg(u),{updatedTask:u,targetDate:e,dateStr:o,newComplete:d,dateModified:t,originalRecurrence:r.recurrence}}function OTe({frontmatter:r,completeInstancesField:e,skippedInstancesField:t,dateModifiedField:n,scheduledField:a,dueField:i,recurrenceField:s,googleCalendarExceptionOriginalScheduledField:o,googleCalendarMovedOriginalDatesField:l,plan:c}){r[e]||(r[e]=[]),r[t]||(r[t]=[]);let d=bm(r[e]);c.newComplete?d.includes(c.dateStr)||(r[e]=[...d,c.dateStr]):r[e]=d.filter(u=>u!==c.dateStr),r[t]=c.updatedTask.skipped_instances||[],c.updatedTask.recurrence!==c.originalRecurrence&&(r[s]=c.updatedTask.recurrence),c.updatedTask.scheduled&&(r[a]=c.updatedTask.scheduled),c.updatedTask.due&&(r[i]=c.updatedTask.due),iN(r,o,c.updatedTask.googleCalendarExceptionOriginalScheduled),iN(r,l,c.updatedTask.googleCalendarMovedOriginalDates),r[n]=c.dateModified}function LTe({freshTask:r,targetDate:e,currentTimestamp:t,maintainDueDateOffsetInRecurring:n}){if(!r.recurrence)throw new Error("Task is not recurring");let a=ITe(r,e),i=a!=null?a:e,s=ce(i),o=bm(r.skipped_instances),c=!o.includes(s),d={...r,dateModified:t};if(c){o.includes(s)||(d.skipped_instances=[...o,s]);let g=bm(r.complete_instances);d.complete_instances=g.filter(v=>v!==s)}else d.skipped_instances=o.filter(g=>g!==s);let u=a?{...d,scheduled:NTe(d.scheduled,a)}:d,p=RTe(u,r,s),m=nn(),f=s>m?s:m,h=wu(p,n,{minOccurrenceDate:f});return h.scheduled&&(d.scheduled=h.scheduled),h.due&&(d.due=h.due),oq(r,s,d),lg(d),{updatedTask:d,targetDate:e,dateStr:s,newSkipped:c,dateModified:t}}function zTe({frontmatter:r,skippedField:e,completeField:t,dateModifiedField:n,scheduledField:a,dueField:i,googleCalendarExceptionOriginalScheduledField:s,googleCalendarMovedOriginalDatesField:o,plan:l}){r[e]||(r[e]=[]),r[e]=l.updatedTask.skipped_instances||[],r[t]||(r[t]=[]),r[t]=l.updatedTask.complete_instances||[],l.updatedTask.scheduled&&(r[a]=l.updatedTask.scheduled),l.updatedTask.due&&(r[i]=l.updatedTask.due),iN(r,s,l.updatedTask.googleCalendarExceptionOriginalScheduled),iN(r,o,l.updatedTask.googleCalendarMovedOriginalDates),r[n]=l.dateModified}function iN(r,e,t){if(t==null||Array.isArray(t)&&t.length===0){delete r[e];return}r[e]=t}var lq=y(()=>{Ah();Me();aN()});function Bu(r,e,t={}){let n=Ge(),a={title:e.title.trim(),status:e.status||r.settings.defaultTaskStatus,priority:e.priority||r.settings.defaultTaskPriority,dateCreated:n,dateModified:n};if(t.creationContext&&(a.creationContext=t.creationContext),e.dueDate&&(a.due=e.dueTime?La(e.dueDate,e.dueTime):e.dueDate),e.scheduledDate&&(a.scheduled=e.scheduledTime?La(e.scheduledDate,e.scheduledTime):e.scheduledDate),e.contexts&&e.contexts.length>0&&(a.contexts=e.contexts),e.projects&&e.projects.length>0&&(a.projects=e.projects),e.tags&&e.tags.length>0&&(a.tags=e.tags.map(i=>za(i))),e.details&&(a.details=e.details),e.recurrence&&(a.recurrence=e.recurrence),e.estimate&&e.estimate>0&&(a.timeEstimate=e.estimate),e.userFields){let i=r.settings.userFields||[],s={};for(let[o,l]of Object.entries(e.userFields)){let c=i.find(d=>d.id===o);c&&(s[c.key]=Array.isArray(l)?l.join(", "):l)}Object.keys(s).length>0&&(a.customFrontmatter=s)}return a}var fE=y(()=>{Me();Ct()});function Rit(r,e){if(!r.recurrence)return!1;let t=ce(e);return(Array.isArray(r.complete_instances)?r.complete_instances:[]).includes(t)}function jTe(r,e,t,n="open"){let a=t.getCompletedStatuses()[0]||"done",i=h_(r,e,a)||n;return!r.recurrence||Rit(r,e)?i:t.isCompletedStatus(i)?n:i}function cg(r,e,t,n="open"){return t.isCompletedStatus(jTe(r,e,t,n))}function oN(r,e,t,n="open"){let a=jTe(r,e,t,n);return a===r.status?r:{...r,status:a}}var lN=y(()=>{Ah();Me()});var Fk,Fit,Rk,cq=y(()=>{Fk=require("obsidian");Lc();I_();LS();fm();K();Fit=N({tag:"Modals/TaskCreationSuggest"}),Rk=class extends Fk.AbstractInputSuggest{constructor(t,n,a){super(t,n);this.currentTrigger=null;this.projectMetadataResolver=null;this.plugin=a,this.textarea=n,this.obsidianApp=t}getCursorPosition(){var t;return(t=this.textarea.selectionStart)!=null?t:this.textarea.value.length}isBoundary(t,n){if(n===-1)return!1;if(n===0)return!0;let a=t[n-1];return!/\w/.test(a)}findActiveTrigger(t){let n=t.lastIndexOf("@"),a=t.lastIndexOf("#"),i=t.lastIndexOf("+"),s=(this.plugin.settings.statusSuggestionTrigger||"").trim(),o=s?t.lastIndexOf(s):-1,l=[{type:"@",index:n},{type:"#",index:a},{type:"+",index:i},{type:"status",index:o}].filter(m=>this.isBoundary(t,m.index));if(l.length===0)return{trigger:null,triggerIndex:-1,queryAfterTrigger:""};l.sort((m,f)=>f.index-m.index);let c=l[0].index,d=l[0].type,u=d==="status"?(s==null?void 0:s.length)||0:1,p=t.slice(c+u);return{trigger:d,triggerIndex:c,queryAfterTrigger:p}}shouldEndSuggestionContext(t,n){return!!(t==="+"&&/^\[\[[^\]]*\]\]/.test(n)||(t==="@"||t==="#"||t==="status")&&(n.includes(" ")||n.includes(` `)))}getContextSuggestions(t){return this.plugin.cacheManager.getAllContexts().filter(a=>a&&typeof a=="string").filter(a=>a.toLowerCase().includes(t.toLowerCase())).slice(0,10).map(a=>({value:a,display:a,type:"context",toString(){return this.value}}))}getStatusSuggestions(t){return ra.fromPlugin(this.plugin).getStatusSuggestions(t,10).map(a=>({...a,type:"status",toString(){return this.value}}))}getTagSuggestions(t){return _I(this.plugin.cacheManager.getAllTags(),this.plugin.settings).filter(a=>a&&typeof a=="string").filter(a=>a.toLowerCase().includes(t.toLowerCase())).slice(0,10).map(a=>({value:a,display:a,type:"tag",toString(){return this.value}}))}getProjectMetadataResolver(){var t;if(!this.projectMetadataResolver){let n=(t=this.obsidianApp)!=null?t:this.plugin.app;this.projectMetadataResolver=new nm({getFrontmatter:a=>{let i=n==null?void 0:n.vault.getAbstractFileByPath(a.path),s=i instanceof Fk.TFile?n==null?void 0:n.metadataCache.getFileCache(i):void 0;return(s==null?void 0:s.frontmatter)||{}}})}return this.projectMetadataResolver}async getProjectSuggestions(t){var s,o,l,c;let{FileSuggestHelper:n}=await Promise.resolve().then(()=>(jS(),eU)),a=await n.suggest(this.plugin,t,20,this.plugin.settings.projectAutosuggest),i=(s=this.obsidianApp)!=null?s:this.plugin.app;try{let d=this.getProjectMetadataResolver(),u=((c=(l=(o=this.plugin.settings)==null?void 0:o.projectAutosuggest)==null?void 0:l.rows)!=null?c:[]).slice(0,3);return a.map(p=>{var C;let m=i==null?void 0:i.vault.getMarkdownFiles().find(E=>E.path===p.path);if(!m)return{basename:p.insertText,displayName:p.displayText,linkText:p.insertText,type:"project",toString(){return this.basename}};let f=i==null?void 0:i.metadataCache.getFileCache(m),h=(f==null?void 0:f.frontmatter)||{},g=this.plugin.fieldMapper.mapFromFrontmatter(h,m.path,this.plugin.settings.storeTitleInFilename),v=typeof g.title=="string"?g.title:"",b=(0,Fk.parseFrontMatterAliases)(h)||[],k=Array.isArray(b)?b.filter(E=>typeof E=="string"):[],w={basename:m.basename,name:m.name,path:m.path,parent:((C=m.parent)==null?void 0:C.path)||"",title:v,aliases:k,frontmatter:h},S=this.generateProjectDisplayName(u,w,d,m.basename);return{basename:m.basename,displayName:S,linkText:p.insertText,type:"project",entry:{basename:w.basename,name:w.name,path:w.path,parent:w.parent,title:w.title,aliases:w.aliases,frontmatter:w.frontmatter},toString(){return this.basename}}})}catch(d){return Fit.error("Enhanced project autosuggest failed, falling back to basic suggestions",{category:"persistence",operation:"enhanced-project-autosuggest-falling-back-basic-suggestions",error:d}),a.map(u=>({basename:u.insertText,displayName:u.displayText,linkText:u.insertText,type:"project",toString(){return this.basename}}))}}generateProjectDisplayName(t,n,a,i){var o;let s=[];for(let l of t)try{let c=_c(l),d=[];for(let p of c){if(p.property.startsWith("literal:")){d.push(p.property.slice(8));continue}let m=a.resolve(p.property,n)||"";if(m)if(p.showName){let f=(o=p.displayName)!=null?o:p.property;d.push(`${f}: ${m}`)}else d.push(m)}let u=d.join(" ");u.trim()&&s.push(u)}catch(c){}return s.join(" | ")||i}async getSuggestions(t){let n=this.getCursorPosition(),a=this.textarea.value.slice(0,n),{trigger:i,triggerIndex:s,queryAfterTrigger:o}=this.findActiveTrigger(a);if(!i||s===-1)return this.currentTrigger=null,[];if(this.shouldEndSuggestionContext(i,o))return this.currentTrigger=null,[];switch(this.currentTrigger=i,i){case"@":return this.getContextSuggestions(o);case"status":return this.getStatusSuggestions(o);case"#":return this.getTagSuggestions(o);case"+":return await this.getProjectSuggestions(o);default:return[]}}renderSuggestion(t,n){var c,d,u,p,m;n.setAttribute("role","option");let a=t.type==="project"?t.displayName:t.display;n.setAttribute("aria-label",`${t.type}: ${a}`);let i=n.createSpan("nlp-suggest-icon");i.textContent=this.currentTrigger==="status"?this.plugin.settings.statusSuggestionTrigger||"":this.currentTrigger||"",i.setAttribute("aria-hidden","true");let s=n.createSpan("nlp-suggest-text"),o=(f,h)=>{if(!h)return;let g=h.toLowerCase().split(/\s+/).filter(Boolean);if(!g.length)return;let v=b=>{var k;if(b.nodeType===Node.TEXT_NODE){let w=b.nodeValue||"",S=w.toLowerCase(),C=[];for(let O of g){let z=S.indexOf(O);for(;z!==-1;)C.push({start:z,end:z+O.length}),z=S.indexOf(O,z+1)}C.sort((O,z)=>O.start-z.start);let E=[];for(let O of C)(!E.length||O.start>=E[E.length-1].end)&&E.push(O);if(!E.length)return;let D=activeWindow.createFragment(),P=0;for(let O of E){O.start>P&&D.appendChild(activeDocument.createTextNode(w.slice(P,O.start)));let z=activeWindow.createEl("mark");z.textContent=w.slice(O.start,O.end),D.appendChild(z),P=O.end}P0&&t.entry){let g=this.getProjectMetadataResolver();for(let v=0;vgE,getTaskSelectorQueryRank:()=>dq,openTaskSelector:()=>Fn,openTaskSelectorWithCreate:()=>Lit,taskMatchesSelectorQuery:()=>BTe});function hE(r,e){return r==null||typeof r!="string"&&typeof r!="number"&&typeof r!="boolean"?!1:String(r).toLowerCase().includes(e)}function cN(r,e){if(r==null||typeof r!="string"&&typeof r!="number"&&typeof r!="boolean")return null;let t=String(r).toLowerCase();return t.includes(e)?t===e?0:t.startsWith(e)?1:t.split(/[^a-z0-9]+/).some(a=>a.startsWith(e))?2:3:null}function $Te(r,e){let t=null;for(let n of r){let a=cN(n,e);a!==null&&(t=t===null?a:Math.min(t,a))}return t}function BTe(r,e){var n;return!!(hE(r.title,e)||hE(r.due,e)||r.priority!=="normal"&&hE(r.priority,e)||(n=r.contexts)!=null&&n.some(a=>hE(a,e))||Rl(r.projects||[]).some(a=>hE(a,e)))}function dq(r,e){let t=cN(r.title,e);if(t!==null)return t;let n=$Te(r.contexts||[],e);if(n!==null)return 10+n;let a=Rl(r.projects||[]),i=$Te(a,e);if(i!==null)return 20+i;if(r.priority!=="normal"){let o=cN(r.priority,e);if(o!==null)return 30+o}let s=cN(r.due,e);return s!==null?40+s:Number.MAX_SAFE_INTEGER}async function Lit(r,e){let t=await r.cacheManager.getAllTasks();return new Promise(n=>{new gE(r.app,r,t,{onResult:n,...e}).open()})}function Fn(r,e,t,n){new gE(r.app,r,e,{placeholder:n==null?void 0:n.placeholder,title:n==null?void 0:n.title,targetDate:n==null?void 0:n.targetDate,onResult:i=>{i.type==="selected"||i.type==="created"?t(i.task):t(null)}}).open()}var Vc,Oit,gE,Vo=y(()=>{Vc=require("obsidian");Ct();Lc();mi();fE();lN();cq();K();Oit=N({tag:"Modals/TaskSelectorWithCreateModal"});gE=class extends Vc.SuggestModal{constructor(t,n,a,i){super(t);this.nlpSuggest=null;this.createFooterEl=null;this.currentQuery="";this.resultHandled=!1;this.isCreatingTask=!1;this.handleCreateFooterActivation=t=>{!this.createFooterEl||this.createFooterEl.classList.contains("tn-static-display-none-6b99de8b")||(t.preventDefault(),t.stopPropagation(),this.createNewTask())};this.handleCreateFooterKeydown=t=>{t.key!=="Enter"&&t.key!==" "||this.handleCreateFooterActivation(t)};this.handleInputChange=()=>{let t=this.inputEl.value.trim();this.currentQuery=t,this.updateCreateFooter(t)};this.plugin=n,this.tasks=a,this.options=i,this.targetDate=i.targetDate||new Date,this.translate=n.i18n.translate.bind(n.i18n),this.nlParser=ra.fromPlugin(n),this.setPlaceholder(i.placeholder||this.translate("modals.taskSelectorWithCreate.placeholder")),this.setInstructions([{command:"\u2191\u2193",purpose:this.translate("modals.taskSelector.instructions.navigate")},{command:"\u21B5",purpose:this.translate("modals.taskSelector.instructions.select")},{command:"\u21E7\u21B5",purpose:this.translate("modals.taskSelectorWithCreate.instructions.create")},{command:"esc",purpose:this.translate("modals.taskSelector.instructions.dismiss")}]),this.titleEl.setText(i.title||this.translate("modals.taskSelectorWithCreate.title")),this.titleEl.setAttribute("id","task-selector-with-create-title"),this.containerEl.setAttribute("aria-labelledby","task-selector-with-create-title"),this.containerEl.setAttribute("role","dialog"),this.containerEl.setAttribute("aria-modal","true"),this.containerEl.addClass("task-selector-with-create-modal"),this.containerEl.addClass("tasknotes-plugin")}onOpen(){super.onOpen(),this.scope.register(["Shift"],"Enter",t=>(t.preventDefault(),t.stopPropagation(),this.createNewTask(),!1)),this.inputEl.addEventListener("input",this.handleInputChange),this.nlpSuggest=new Rk(this.app,this.inputEl,this.plugin),window.setTimeout(()=>this.createFooter(),0)}createFooter(){var n;let t=((n=this.modalEl.querySelector(".prompt"))==null?void 0:n.parentElement)||this.modalEl;this.createFooterEl=t.createDiv({cls:"task-selector-create-footer"}),this.createFooterEl.setAttribute("role","button"),this.createFooterEl.setAttribute("aria-hidden","true"),this.createFooterEl.tabIndex=-1,this.createFooterEl.addEventListener("click",this.handleCreateFooterActivation),this.createFooterEl.addEventListener("keydown",this.handleCreateFooterKeydown),this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-none-6b99de8b"),this.currentQuery&&this.updateCreateFooter(this.currentQuery)}updateCreateFooter(t){if(!this.createFooterEl)return;if(!t){this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-none-6b99de8b"),this.createFooterEl.setAttribute("aria-hidden","true"),this.createFooterEl.removeAttribute("aria-label"),this.createFooterEl.tabIndex=-1,this.createFooterEl.empty();return}let n=this.nlParser.parseInput(t);if(n.title&&n.title!=="Untitled Task"){this.createFooterEl.empty(),this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-flex-75816cae"),this.createFooterEl.setAttribute("aria-hidden","false"),this.createFooterEl.setAttribute("aria-label",`${this.translate("modals.taskSelectorWithCreate.footer.createLabel").trim()} ${n.title}`.trim()),this.createFooterEl.tabIndex=0;let a=this.createFooterEl.createDiv({cls:"task-selector-create-footer__icon"});(0,Vc.setIcon)(a,"plus-circle");let i=this.createFooterEl.createDiv({cls:"task-selector-create-footer__content"});i.createDiv({cls:"task-selector-create-footer__title-line"}).createSpan({cls:"task-selector-create-footer__title",text:n.title});let o=this.buildMetadataParts(n);if(o.length>0){let c=i.createDiv({cls:"task-selector-create-footer__meta"});o.forEach(d=>{let u=c.createSpan({cls:`task-selector-create-footer__chip task-selector-create-footer__chip--${d.type}`}),p=u.createSpan({cls:"task-selector-create-footer__chip-icon"});(0,Vc.setIcon)(p,d.icon),u.createSpan({cls:"task-selector-create-footer__chip-text",text:d.text})})}let l=i.createDiv({cls:"task-selector-create-footer__hint"});l.createSpan({cls:"task-selector-create-footer__shortcut",text:"\u21E7\u21B5"}),l.createSpan({cls:"task-selector-create-footer__hint-text",text:this.translate("modals.taskSelectorWithCreate.footer.createLabel")})}else this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-none-6b99de8b"),this.createFooterEl.setAttribute("aria-hidden","true"),this.createFooterEl.removeAttribute("aria-label"),this.createFooterEl.tabIndex=-1,this.createFooterEl.empty()}buildMetadataParts(t){let n=[];if(t.dueDate){let a=t.dueTime?`${t.dueDate} ${t.dueTime}`:t.dueDate;n.push({icon:"calendar",text:a,type:"due"})}if(t.scheduledDate){let a=t.scheduledTime?`${t.scheduledDate} ${t.scheduledTime}`:t.scheduledDate;n.push({icon:"calendar-clock",text:a,type:"scheduled"})}if(t.priority&&t.priority!=="normal"&&n.push({icon:"flag",text:t.priority,type:"priority"}),t.status){let a=this.plugin.statusManager.getStatusConfig(t.status);n.push({icon:"circle-dot",text:(a==null?void 0:a.label)||t.status,type:"status"})}if(t.contexts&&t.contexts.length>0&&t.contexts.forEach(a=>{n.push({icon:"at-sign",text:a,type:"context"})}),t.projects&&t.projects.length>0&&t.projects.forEach(a=>{n.push({icon:"folder",text:a.replace(/^\[\[|\]\]$/g,""),type:"project"})}),t.tags&&t.tags.length>0&&t.tags.forEach(a=>{n.push({icon:"hash",text:a,type:"tag"})}),t.recurrence&&n.push({icon:"repeat",text:t.recurrence,type:"recurrence"}),t.estimate&&t.estimate>0){let a=Math.floor(t.estimate/60),i=t.estimate%60,s=a>0?`${a}h ${i}m`:`${i}m`;n.push({icon:"timer",text:s,type:"estimate"})}if(t.details){let a=t.details.length>30?t.details.substring(0,30)+"...":t.details;n.push({icon:"file-text",text:a,type:"details"})}if(t.userFields){let a=this.plugin.settings.userFields||[];for(let[i,s]of Object.entries(t.userFields)){let o=a.find(d=>d.id===i),l=(o==null?void 0:o.displayName)||i,c=Array.isArray(s)?s.join(", "):s;n.push({icon:"sliders-horizontal",text:`${l}: ${c}`,type:"userfield"})}}return n}async createNewTask(){if(this.isCreatingTask)return;let t=this.inputEl.value.trim();if(!t){new Vc.Notice(this.translate("modals.taskSelectorWithCreate.notices.emptyQuery"));return}this.isCreatingTask=!0;try{let n=this.nlParser.parseInput(t);if(!n.title||n.title==="Untitled Task"){new Vc.Notice(this.translate("modals.taskSelectorWithCreate.notices.invalidTitle"));return}let a=this.buildTaskDataFromParsed(n),i=await this.plugin.taskService.createTask(a);new Vc.Notice(this.translate("modals.taskCreation.notices.success",{title:i.taskInfo.title})),this.resultHandled=!0,this.close(),this.options.onResult({type:"created",task:i.taskInfo})}catch(n){Oit.error("Failed to create task:",{category:"persistence",operation:"create-task",error:n});let a=n instanceof Error?n.message:String(n);new Vc.Notice(this.translate("modals.taskCreation.notices.failure",{message:a}))}finally{this.isCreatingTask=!1}}buildTaskDataFromParsed(t){return Bu(this.plugin,t)}getSuggestions(t){return this.currentQuery=t,this.getFilteredTasks(t)}getFilteredTasks(t){let n=t.trim().toLowerCase(),a=n.length>0;return this.tasks.filter(i=>!i.archived).filter(i=>a?BTe(i,n):!0).sort((i,s)=>{var p,m;if(a){let f=dq(i,n)-dq(s,n);if(f!==0)return f}let o=cg(i,this.targetDate,this.plugin.statusManager,this.plugin.settings.defaultTaskStatus),l=cg(s,this.targetDate,this.plugin.statusManager,this.plugin.settings.defaultTaskStatus);if(o!==l)return o?1:-1;if(a){let f=i.title.localeCompare(s.title);if(f!==0)return f}if(i.due&&!s.due)return-1;if(!i.due&&s.due)return 1;if(i.due&&s.due){let f=i.due.localeCompare(s.due);if(f!==0)return f}let c={high:0,normal:1,low:2},d=(p=c[i.priority])!=null?p:1,u=(m=c[s.priority])!=null?m:1;return d!==u?d-u:i.title.localeCompare(s.title)})}renderSuggestion(t,n){let a=oN(t,this.targetDate,this.plugin.statusManager,this.plugin.settings.defaultTaskStatus),i=Dr(a,this.plugin,void 0,{layout:"default",targetDate:this.targetDate});i.classList.add("task-selector-modal__suggestion");let s=i.cloneNode(!0);n.appendChild(s)}onChooseSuggestion(t,n){this.resultHandled=!0,this.options.onResult({type:"selected",task:t})}onClose(){var t;this.inputEl.removeEventListener("input",this.handleInputChange),(t=this.nlpSuggest)==null||t.close(),this.nlpSuggest=null,this.createFooterEl&&(this.createFooterEl.removeEventListener("click",this.handleCreateFooterActivation),this.createFooterEl.removeEventListener("keydown",this.handleCreateFooterKeydown),this.createFooterEl.remove(),this.createFooterEl=null),window.setTimeout(()=>{this.resultHandled||this.options.onResult({type:"cancelled"})},0),super.onClose()}}});function UTe(r){let e=String(r.getHours()).padStart(2,"0"),t=String(r.getMinutes()).padStart(2,"0");return`${e}:${t}`}function HTe(r,e){let t=null;if(r.scheduled)try{t=it(r.scheduled)}catch(i){t=null}(!t||isNaN(t.getTime()))&&(t=new Date(e)),isNaN(t.getTime())&&(t=new Date),(!r.scheduled||!mr(r.scheduled))&&t.setHours(9,0,0,0);let n=r.timeEstimate&&r.timeEstimate>0?r.timeEstimate:60,a=new Date(t.getTime()+n*60*1e3);return{date:ce(t),startTime:UTe(t),endTime:UTe(a)}}var VTe=y(()=>{Me()});function Tm(r,e,t){new pq(r.app,r,{placeholder:t==null?void 0:t.placeholder,title:t==null?void 0:t.title,filter:t==null?void 0:t.filter,newFileFolder:t==null?void 0:t.newFileFolder,sortOrder:t==null?void 0:t.sortOrder,onResult:a=>{a.type==="selected"||a.type==="created"?e(a.file):e(null)}}).open()}var _a,zit,pq,yE=y(()=>{_a=require("obsidian");K();Ba();zit=N({tag:"Modals/FileSelectorModal"}),pq=class extends _a.SuggestModal{constructor(t,n,a){super(t);this.currentQuery="";this.resultHandled=!1;this.createFooterEl=null;this.handleInputChange=()=>{this.currentQuery=this.inputEl.value.trim(),this.updateCreateFooter()};this.plugin=n,this.options=a,this.setPlaceholder(a.placeholder||"Search files or type to create new..."),this.setInstructions([{command:"\u2191\u2193",purpose:"to navigate"},{command:"\u21B5",purpose:"to select"},{command:"\u21E7\u21B5",purpose:"to create new"},{command:"esc",purpose:"to cancel"}]),a.title&&this.titleEl.setText(a.title),this.containerEl.addClass("file-selector-modal"),this.containerEl.addClass("tasknotes-plugin")}onOpen(){super.onOpen(),this.scope.register(["Shift"],"Enter",t=>(t.preventDefault(),t.stopPropagation(),this.createNewFile(),!1)),this.inputEl.addEventListener("input",this.handleInputChange),window.setTimeout(()=>this.createFooter(),0)}createFooter(){var n;let t=this.modalEl.querySelector(".prompt");t&&(this.createFooterEl=((n=t.parentElement)==null?void 0:n.createDiv({cls:"file-selector-create-footer"}))||null,this.createFooterEl&&(this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-none-6b99de8b")))}updateCreateFooter(){if(!this.createFooterEl)return;if(!this.currentQuery){this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-none-6b99de8b");return}this.createFooterEl.empty(),this.createFooterEl.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),this.createFooterEl.classList.add("tn-static-display-flex-75816cae");let n=this.createFooterEl.createDiv({cls:"file-selector-create-footer__content"}).createDiv({cls:"file-selector-create-footer__title-line"});n.createSpan({cls:"file-selector-create-footer__shortcut",text:"\u21E7\u21B5"}),n.createSpan({cls:"file-selector-create-footer__hint-text",text:" to create: "}),n.createSpan({cls:"file-selector-create-footer__filename",text:this.getNewFileName()})}getNewFileName(){let t=this.currentQuery;return t.toLowerCase().endsWith(".md")&&(t=t.slice(0,-3)),t+".md"}async createNewFile(){if(!this.currentQuery){new _a.Notice("Please enter a file name");return}try{let t=this.currentQuery;t.toLowerCase().endsWith(".md")&&(t=t.slice(0,-3));let n=this.options.newFileFolder||"",a=n?`${n}/${t}.md`:`${t}.md`;if(this.app.vault.getAbstractFileByPath(a)){new _a.Notice(`File "${a}" already exists`);return}n&&!await this.app.vault.adapter.exists(n)&&await FS(this.app,n);let s=await _h(this.app,a,"");this.resultHandled=!0,this.close(),this.options.onResult({type:"created",file:s})}catch(t){zit.error("Error creating file:",{category:"persistence",operation:"creating-file",error:t}),new _a.Notice("Failed to create file")}}getSuggestions(t){this.currentQuery=t.trim(),this.updateCreateFooter();let n=this.app.vault.getAllLoadedFiles(),a=t.toLowerCase(),i,s=this.options.filter||"markdown";typeof s=="function"?i=n.filter(s):s==="markdown"?i=n.filter(c=>c instanceof _a.TFile&&c.extension==="md"&&!c.path.includes(".trash")):i=n.filter(c=>c instanceof _a.TFile&&!c.path.includes(".trash"));let o=this.options.sortOrder||"name-asc",l=[...i].sort((c,d)=>{let u=c instanceof _a.TFile?c.stat.ctime:0,p=d instanceof _a.TFile?d.stat.ctime:0,m=c instanceof _a.TFile?c.stat.mtime:0,f=d instanceof _a.TFile?d.stat.mtime:0;switch(o){case"name-desc":return d.name.localeCompare(c.name);case"path-asc":return c.path.localeCompare(d.path);case"path-desc":return d.path.localeCompare(c.path);case"created-recent":return p-u;case"created-oldest":return u-p;case"modified-recent":return f-m;case"modified-oldest":return m-f;case"name-asc":default:return c.name.localeCompare(d.name)}});return t?l.filter(c=>this.getSearchText(c).toLowerCase().includes(a)).slice(0,50):l.slice(0,50)}getSearchText(t){let n=`${t.name} ${t.path}`;if(t instanceof _a.TFile){let a=this.app.metadataCache.getFileCache(t);if(a!=null&&a.frontmatter){let i=this.plugin.fieldMapper.toUserField("title"),s=a.frontmatter[i];s&&(n+=` ${s}`);let o=(0,_a.parseFrontMatterAliases)(a.frontmatter);o&&o.length>0&&(n+=` ${o.join(" ")}`)}}return n}renderSuggestion(t,n){let a=n.createDiv({cls:"file-selector-suggestion"});if(a.createDiv({cls:"file-selector-suggestion__name",text:t.name}),t instanceof _a.TFile){let i=this.app.metadataCache.getFileCache(t);if(i!=null&&i.frontmatter){let s=this.plugin.fieldMapper.toUserField("title"),o=i.frontmatter[s];if(o)a.createDiv({cls:"file-selector-suggestion__title",text:o});else{let l=(0,_a.parseFrontMatterAliases)(i.frontmatter);l&&l.length>0&&a.createDiv({cls:"file-selector-suggestion__aliases",text:l.join(", ")})}}}t.parent&&t.parent.path!=="/"&&a.createDiv({cls:"file-selector-suggestion__path",text:t.parent.path})}onChooseSuggestion(t,n){this.resultHandled=!0,this.options.onResult({type:"selected",file:t})}onClose(){this.inputEl.removeEventListener("input",this.handleInputChange),this.createFooterEl&&(this.createFooterEl.remove(),this.createFooterEl=null),window.setTimeout(()=>{this.resultHandled||this.options.onResult({type:"cancelled"})},0),super.onClose()}}});function $it(){return(0,wm.requireApiVersion)("1.11.0")}function hs(r){Promise.resolve().then(r).catch(e=>{jit.error("TaskNotes settings callback failed:",{category:"configuration",operation:"settings-callback",error:e})})}function Dt(r,e,t){if($it()){let n=new wm.SettingGroup(r).setHeading(e.heading);if(e.className&&n.addClass(e.className),e.description){let a=e.description;n.addSetting(i=>{i.setDesc(a),i.settingEl.addClass("settings-view__group-description")})}return t(n),n}else{let n=new mq(r).setHeading(e.heading);if(e.className&&n.addClass(e.className),e.description){let a=e.description;n.addSetting(i=>{i.setDesc(a),i.settingEl.addClass("settings-view__group-description")})}return t(n),n}}function he(r,e){return r.setName(e.name).setDesc(e.desc).addToggle(t=>{t.setValue(e.getValue()).onChange(n=>{hs(()=>e.setValue(n))})})}function Sn(r,e){return r.setName(e.name).setDesc(e.desc).addText(t=>{t.setValue(e.getValue());let n=a=>{hs(()=>e.setValue(a))};if(e.debounceMs&&e.debounceMs>0){let a=Ok(n,e.debounceMs);t.onChange(a)}else t.onChange(n);return e.placeholder&&t.setPlaceholder(e.placeholder),e.ariaLabel&&t.inputEl.setAttribute("aria-label",e.ariaLabel),t.inputEl.addClass("settings-view__input"),t})}function on(r,e){return r.setName(e.name).setDesc(e.desc).addDropdown(t=>(e.options.forEach(n=>{t.addOption(n.value,n.label)}),t.setValue(e.getValue()).onChange(n=>{hs(()=>e.setValue(n))}),e.ariaLabel&&t.selectEl.setAttribute("aria-label",e.ariaLabel),t))}function Bi(r,e){let t=e.debounceMs?Ok(n=>{hs(()=>e.setValue(n))},e.debounceMs):n=>{hs(()=>e.setValue(n))};return r.setName(e.name).setDesc(e.desc).addText(n=>(n.setValue(e.getValue().toString()).onChange(a=>{let i=parseInt(a);if(!isNaN(i)){if(e.min!==void 0&&ie.max)return;t(i)}}),n.inputEl.type="number",e.placeholder&&n.setPlaceholder(e.placeholder),e.min!==void 0&&n.inputEl.setAttribute("min",e.min.toString()),e.max!==void 0&&n.inputEl.setAttribute("max",e.max.toString()),e.ariaLabel&&n.inputEl.setAttribute("aria-label",e.ariaLabel),n.inputEl.addClass("settings-view__input"),n))}function qc(r,e){return r.setName(e.name).setDesc(e.desc).addButton(t=>(t.setButtonText(e.buttonText).onClick(()=>{hs(e.onClick)}),e.buttonClass?t.buttonEl.addClass(e.buttonClass):t.buttonEl.addClasses(["tn-btn","tn-btn--ghost"]),t))}function Sm(r,e){return new wm.Setting(r).setName(e).setHeading()}function Wc(r,e){return r.createEl("p",{text:e,cls:"settings-view__help-note"})}function Ok(r,e,t=!1){let n,a,i,s=function(...o){a=o,i=this;let l=()=>{n=void 0,a=void 0,t||r.apply(i,o)},c=t&&!n;window.clearTimeout(n),n=window.setTimeout(l,e),c&&r.apply(this,o)};return s.flush=()=>{n&&a&&(window.clearTimeout(n),n=void 0,r.apply(i,a),a=void 0)},s}var wm,jit,mq,Yc=y(()=>{wm=require("obsidian");K();jit=N({tag:"Settings/Components/SettingHelpers"});mq=class{constructor(e){this.containerEl=e}setHeading(e){return new wm.Setting(this.containerEl).setName(e).setHeading(),this}addClass(e){return this}addSetting(e){let t=new wm.Setting(this.containerEl);return e(t),this}}});function Tr(r,e){let t=r.createDiv("tasknotes-settings__card");e.id&&t.setAttribute("data-card-id",e.id),e.draggable&&t.addClass("tasknotes-settings__card--draggable"),e.collapsible&&(t.addClass("tasknotes-settings__card--collapsible"),e.defaultCollapsed&&t.addClass("tasknotes-settings__card--collapsed"));let n=t.createDiv("tasknotes-settings__card-header"),a=null;e.draggable&&(n.addClass("tasknotes-settings__card-header--with-drag-handle"),a=n.createDiv("tasknotes-settings__card-drag-handle"),a.textContent="\u22EE\u22EE",a.draggable=!0,a.title="Drag to reorder");let i=n.createDiv();if(i.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),i.classList.add("tn-static-display-flex-75816cae"),i.classList.remove("tn-static-align-items-baseline-4b95b5c7","tn-static-align-items-flex-start-0486f781"),i.classList.add("tn-static-align-items-center-7c619740"),i.classList.remove("tn-static-flex-1-14e3b769","tn-static-margin-top-12px-91e0f558"),i.classList.add("tn-static-flex-1-97445a8d"),i.classList.remove("tn-static-min-width-2px-709d7da0"),i.classList.add("tn-static-min-width-0-3922d326"),e.colorIndicator){let c=i.createDiv("tasknotes-settings__card-color-indicator");c.style.backgroundColor=_r(e.colorIndicator.color),e.colorIndicator.cssVar&&c.style.setProperty("--card-color",_r(e.colorIndicator.color))}let s=i.createDiv("tasknotes-settings__card-info"),o=s.createSpan("tasknotes-settings__card-primary-text");if(o.textContent=e.header.primaryText,e.header.secondaryText){let c=s.createSpan("tasknotes-settings__card-secondary-text");c.textContent=e.header.secondaryText}let l=n.createDiv();if(l.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),l.classList.add("tn-static-display-flex-75816cae"),l.classList.remove("tn-static-align-items-baseline-4b95b5c7","tn-static-align-items-flex-start-0486f781"),l.classList.add("tn-static-align-items-center-7c619740"),l.classList.remove("tn-static-display-flex-8bb39979","tn-static-gap-10px-f3d7ce77","tn-static-gap-12px-ed7b3d87","tn-static-gap-6px-f0abc1db","tn-static-gap-8px-33fcd4c3"),l.classList.add("tn-static-gap-0-5rem-ce2fca4d"),e.header.meta&&e.header.meta.length>0){let c=l.createDiv("tasknotes-settings__card-meta");e.header.meta.forEach(d=>{c.appendChild(d)})}if(e.header.actions&&e.header.actions.length>0){let c=l.querySelector(".tasknotes-settings__card-header-actions")||l.createDiv("tasknotes-settings__card-header-actions");e.header.actions.forEach(d=>{let u=c.createEl("button",{cls:"tasknotes-settings__card-header-btn"});d.variant==="delete"&&u.addClass("tasknotes-settings__card-header-btn--delete");let p=u.createSpan();(0,vE.setIcon)(p,d.icon),d.tooltip&&(u.title=d.tooltip),u.onclick=m=>{m.stopPropagation(),hs(d.onClick)}})}if(e.collapsible){let c=()=>{var u,p;t.hasClass("tasknotes-settings__card--collapsed")?(t.removeClass("tasknotes-settings__card--collapsed"),n.title="Collapse card",(u=e.onCollapseChange)==null||u.call(e,!1)):(t.addClass("tasknotes-settings__card--collapsed"),n.title="Expand card",(p=e.onCollapseChange)==null||p.call(e,!0))};n.addClass("tasknotes-settings__card-header--clickable"),n.title=e.defaultCollapsed?"Expand card":"Collapse card",n.onclick=d=>{d.target.closest(".tasknotes-settings__card-header-actions")||c()}}if(e.content&&e.content.sections.length>0){let c=t.createDiv("tasknotes-settings__card-content");e.draggable&&c.addClass("tasknotes-settings__card-content--with-drag-handle"),e.content.sections.forEach(d=>{d.rows.forEach(u=>{let p=c.createDiv("tasknotes-settings__card-config-row");u.fullWidth&&(p.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-min-height-800px-997b4c8c"),p.classList.add("tn-static-flex-direction-column-06c8b5ed"),p.classList.remove("tn-static-align-items-baseline-4b95b5c7","tn-static-align-items-center-7c619740"),p.classList.add("tn-static-align-items-flex-start-0486f781"),p.classList.remove("tn-static-display-flex-8bb39979","tn-static-gap-10px-f3d7ce77","tn-static-gap-12px-ed7b3d87","tn-static-gap-6px-f0abc1db","tn-static-gap-8px-33fcd4c3"),p.classList.add("tn-static-gap-0-5rem-ce2fca4d"));let m=p.createSpan("tasknotes-settings__card-config-label");m.textContent=u.label,p.appendChild(u.input)})})}if(e.actions&&e.actions.buttons.length>0){let c=t.createDiv("tasknotes-settings__card-actions");e.draggable&&c.addClass("tasknotes-settings__card-actions--with-drag-handle"),e.actions.buttons.forEach(d=>{let u=c.createEl("button",{text:d.text,cls:"tasknotes-settings__card-action-btn"});if(d.variant&&u.addClass(`tasknotes-settings__card-action-btn--${d.variant}`),d.icon){let p=u.createSpan();(0,vE.setIcon)(p,d.icon),u.insertBefore(p,u.firstChild)}d.disabled&&(u.disabled=!0),u.onclick=()=>{hs(d.onClick)}})}return t}function Ui(r,e="default"){let t=activeWindow.createSpan();return t.addClass("tasknotes-settings__card-status-badge"),t.addClass(`tasknotes-settings__card-status-badge--${e}`),t.textContent=r,t}function Wl(r,e){return{icon:"trash-2",variant:"delete",tooltip:e||"Delete",onClick:r}}function Ke(r="text",e,t){let n=activeWindow.createEl("input");return n.type=r,n.addClass("tasknotes-settings__card-input"),e&&(n.placeholder=e),t&&(n.value=t),n}function qit(){if(activeDocument.getElementById(hq))return;let r=activeWindow.createEl("datalist");r.id=hq;for(let e of cfe)r.createEl("option",{value:e});activeDocument.body.appendChild(r)}function fq(r){let e=r==null?void 0:r.trim().match(Vit);if(!e)return null;let t=e[1].toLowerCase();return t.length===3?`#${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}`:`#${t}`}function Wit(r){r.dispatchEvent(new Event("input",{bubbles:!0})),r.dispatchEvent(new Event("change",{bubbles:!0}))}function Yit(r){var i;if(!r.parentElement)return;if((i=r.tasknotesThemeColorPicker)!=null&&i.isConnected){let s=fq(r.value);s&&(r.tasknotesThemeColorPicker.value=s);return}let t=activeWindow.createEl("input");t.type="color",t.addClass(Bit),t.value=fq(r.value)||Hit,t.title="Open color picker",t.setAttribute("aria-label","Open color picker");let n=()=>{r.value!==t.value&&(r.value=t.value,Wit(r))},a=()=>{let s=fq(r.value);s&&(t.value=s)};t.addEventListener("input",n),t.addEventListener("change",n),r.addEventListener("input",a),r.addEventListener("change",a),r.insertAdjacentElement("afterend",t),r.tasknotesThemeColorPicker=t}function dg(r){let e=r;r.type="text",r.addClass(Uit),r.placeholder=x_,r.setAttribute("list",hq),r.title=x_,qit(),Yit(e)}function Lk(r){let e=Ke("text",x_,Su(r));return dg(e),e}function zk(r,e){let t=_r(r.value,e);return r.value=Su(t),t}function xn(r=!1,e){let t=activeWindow.createDiv(),n=new vE.Setting(t),a=null;if(n.addToggle(i=>{i.setValue(r),e&&i.onChange(s=>{hs(()=>e(s))}),a=i.toggleEl}),!a)throw new Error("Failed to create card toggle");return a}function ma(r,e){let t=activeWindow.createEl("select");return t.addClass("tasknotes-settings__card-input"),r.forEach(n=>{let a=t.createEl("option",{value:n.value,text:n.label});e===n.value&&(a.selected=!0)}),t}function jk(r,e,t){let n=r.querySelector(".tasknotes-settings__card-drag-handle");if(!n)return;let a=r.getAttribute("data-card-id");a&&(n.addEventListener("dragstart",i=>{i.dataTransfer&&(i.dataTransfer.setData("text/plain",a),r.addClass("tasknotes-settings__card--dragging"))}),n.addEventListener("dragend",()=>{r.removeClass("tasknotes-settings__card--dragging")}),r.addEventListener("dragover",i=>{i.preventDefault();let s=e.querySelector(".tasknotes-settings__card--dragging");if(s&&s!==r){let o=r.getBoundingClientRect(),l=o.top+o.height/2;r.removeClass("tasknotes-settings__card--drag-over-top","tasknotes-settings__card--drag-over-bottom"),i.clientY{r.removeClass("tasknotes-settings__card--drag-over-top","tasknotes-settings__card--drag-over-bottom")}),r.addEventListener("drop",i=>{var l;i.preventDefault(),r.removeClass("tasknotes-settings__card--drag-over-top","tasknotes-settings__card--drag-over-bottom");let s=(l=i.dataTransfer)==null?void 0:l.getData("text/plain");if(!s)return;let o=a;if(s!==o){let c=r.getBoundingClientRect(),d=c.top+c.height/2,u=i.clientY{vE=require("obsidian");Mc();Yc();hq="tasknotes-theme-color-options",Bit="tasknotes-theme-color-picker",Uit="tasknotes-theme-color-text-input",Hit="#6366f1",Vit=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i});function vq(r){return r instanceof Error?r.message:typeof r=="string"?r:""}function Git(r=Cm.getAllDailyNotes){try{return r()}catch(e){let t=vq(e),n=t?`: ${t}`:"";throw new Error(`Failed to read daily notes${n}. ${uN}`)}}function Kit(r){let e=vq(r);return e?`Failed to create timeblock: ${e}`:"Failed to create timeblock. Check console for details."}function Zit(r){return(0,wr.moment)(r)}var wr,Cm,yq,uN,Bk,kq=y(()=>{wr=require("obsidian");Ct();yE();Vo();Me();Mc();fi();Ba();Cm=st(iu());K();yq=N({tag:"Modals/TimeblockCreationModal"}),uN="Check the Daily Notes core plugin settings and make sure the configured daily notes folder exists.";Bk=class extends wr.Modal{constructor(t,n,a){super(t);this.selectedAttachments=[];this.keyboardHandler=null;this.plugin=n,this.options=a,this.translate=n.i18n.translate.bind(n.i18n)}onOpen(){let{contentEl:t}=this;t.empty(),t.addClass("timeblock-creation-modal"),this.keyboardHandler=l=>{l.key==="Enter"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),this.handleSubmit())},this.containerEl.addEventListener("keydown",this.keyboardHandler),new wr.Setting(t).setName(this.translate("modals.timeblockCreation.heading")).setHeading();let n=t.createDiv({cls:"timeblock-date-display"});n.createEl("strong",{text:this.translate("modals.timeblockCreation.dateLabel")});let a=Ph(this.options.date);n.createSpan({text:a.toLocaleDateString()}),new wr.Setting(t).setName(this.translate("modals.timeblockCreation.titleLabel")).setDesc(this.translate("modals.timeblockCreation.titleDesc")).addText(l=>{this.titleInput=l.inputEl,l.setPlaceholder(this.translate("modals.timeblockCreation.titlePlaceholder")).setValue(this.options.prefilledTitle||"").onChange(()=>this.validateForm()),window.setTimeout(()=>this.titleInput.focus(),100)}),new wr.Setting(t).setName(this.translate("modals.timeblockCreation.startTimeLabel")).setDesc(this.translate("modals.timeblockCreation.startTimeDesc")).addText(l=>{this.startTimeInput=l.inputEl,l.setPlaceholder(this.translate("modals.timeblockCreation.startTimePlaceholder")).setValue(this.options.startTime||"").onChange(()=>this.validateForm()),this.startTimeInput.type="time"}),new wr.Setting(t).setName(this.translate("modals.timeblockCreation.endTimeLabel")).setDesc(this.translate("modals.timeblockCreation.endTimeDesc")).addText(l=>{this.endTimeInput=l.inputEl,l.setPlaceholder(this.translate("modals.timeblockCreation.endTimePlaceholder")).setValue(this.options.endTime||"").onChange(()=>{this.validateForm()}),this.endTimeInput.type="time"}),new wr.Setting(t).setName(this.translate("modals.timeblockCreation.descriptionLabel")).setDesc(this.translate("modals.timeblockCreation.descriptionDesc")).addTextArea(l=>{this.descriptionInput=l.inputEl,l.setPlaceholder(this.translate("modals.timeblockCreation.descriptionPlaceholder")).setValue(""),this.descriptionInput.rows=3}),new wr.Setting(t).setName(this.translate("modals.timeblockCreation.colorLabel")).setDesc(this.translate("modals.timeblockCreation.colorDesc")).addText(l=>{this.colorInput=l.inputEl,l.setPlaceholder(this.translate("modals.timeblockCreation.colorPlaceholder")).setValue(Su(this.plugin.settings.calendarViewSettings.defaultTimeblockColor)),dg(this.colorInput)}),new wr.Setting(t).setName(this.translate("modals.timeblockCreation.attachmentsLabel")).setDesc(this.translate("modals.timeblockCreation.attachmentsDesc")).addButton(l=>{l.setButtonText(this.translate("modals.timeblockCreation.addAttachmentButton")).setTooltip(this.translate("modals.timeblockCreation.addAttachmentTooltip")).onClick(()=>{Tm(this.plugin,c=>{c instanceof wr.TAbstractFile&&this.addAttachment(c)},{placeholder:"Search files or type to create new...",filter:"all",sortOrder:this.plugin.settings.calendarViewSettings.timeblockAttachmentSearchOrder})})}).addButton(l=>{l.setButtonText("Add task").setTooltip("Select task").onClick(()=>{this.openTaskSelectorForTitle()})}),this.attachmentsList=t.createDiv({cls:"timeblock-attachments-list"}),this.initializePrefilledAttachments(),this.renderAttachmentsList();let i=t.createDiv({cls:"timeblock-modal-buttons"});i.createEl("button",{text:this.translate("common.cancel")}).addEventListener("click",()=>this.close()),i.createEl("button",{text:this.translate("modals.timeblockCreation.createButton"),cls:"mod-cta timeblock-create-button"}).addEventListener("click",()=>{this.handleSubmit()}),this.validateForm()}validateForm(){var o,l,c;let t=this.contentEl.querySelector(".timeblock-create-button");if(!t)return;let n=(o=this.titleInput)==null?void 0:o.value.trim(),a=(l=this.startTimeInput)==null?void 0:l.value,i=(c=this.endTimeInput)==null?void 0:c.value,s=!!(n&&a&&i);if(s&&a&&i){let[d,u]=a.split(":").map(Number),[p,m]=i.split(":").map(Number),f=d*60+u,h=p*60+m;i==="00:00"&&f>0&&(h=1440),h<=f&&(s=!1)}t.disabled=!s,t.style.opacity=s?"1":"0.5"}initializePrefilledAttachments(){let t=this.options.prefilledAttachmentPaths||[];if(t.length===0)return;let n=new Set(t.filter(a=>typeof a=="string"&&a.trim().length>0));for(let a of n){let i=this.app.vault.getAbstractFileByPath(a);i&&this.selectedAttachments.push(i)}}async handleSubmit(){var t,n;try{let a=this.titleInput.value.trim(),i=this.startTimeInput.value,s=this.endTimeInput.value,o=this.descriptionInput.value.trim(),l=_r(this.colorInput.value,this.plugin.settings.calendarViewSettings.defaultTimeblockColor);if(!a||!i||!s){new wr.Notice(this.translate("notices.timeblockRequiredFieldsMissing"));return}let c=this.selectedAttachments.map(p=>`[[${p.path}]]`),d={id:G2(),title:a,startTime:i,endTime:s};o&&(d.description=o),l&&(d.color=l),c.length>0&&(d.attachments=c);let u=await this.saveTimeblockToDailyNote(d);this.plugin.emitter.trigger("data-changed"),(n=(t=this.options).onCreated)==null||n.call(t,{timeblock:d,date:this.options.date,dailyNote:u}),new wr.Notice(`Timeblock "${a}" created successfully`),this.close()}catch(a){yq.error("Error creating timeblock:",{category:"internal",operation:"creating-timeblock",error:a}),new wr.Notice(Kit(a))}}async saveTimeblockToDailyNote(t){if(!(0,Cm.appHasDailyNotesPluginLoaded)())throw new Error(`Daily Notes core plugin is not enabled. ${uN}`);let n=Zit(this.options.date),a=Git(),i=(0,Cm.getDailyNote)(n,a);if(!i){try{i=await(0,Cm.createDailyNote)(n)}catch(u){let p=vq(u),m=p?`: ${p}`:"";throw new Error(`Failed to create daily note${m}. ${uN}`)}if(!i)throw new Error(`Failed to create daily note. ${uN}`)}let s=await this.app.vault.read(i),o={},l=s;if(s.startsWith("---")){let u=s.indexOf("---",3);if(u!==-1){let p=s.substring(3,u);l=s.substring(u+3);try{o=(0,wr.parseYaml)(p)||{}}catch(m){yq.error("Error parsing existing frontmatter:",{category:"validation",operation:"parsing-existing-frontmatter",error:m}),o={}}}}o.timeblocks||(o.timeblocks=[]),o.timeblocks.push(t);let d=`--- ${(0,wr.stringifyYaml)(o)}---${l}`;return await Mo(this.app,i,d),i}addAttachment(t){if(this.selectedAttachments.some(n=>n.path===t.path)){new wr.Notice(this.translate("notices.timeblockAttachmentExists",{fileName:t.name}));return}if(this.titleInput&&!this.titleInput.value.trim()){let n=t instanceof wr.TFile?t.basename:t.name;this.titleInput.value=n,this.validateForm()}this.selectedAttachments.push(t),this.renderAttachmentsList(),new wr.Notice(this.translate("notices.timeblockAttachmentAdded",{fileName:t.name}))}async openTaskSelectorForTitle(){var t,n,a;try{let s=((a=await((n=(t=this.plugin.cacheManager).getAllTasks)==null?void 0:n.call(t)))!=null?a:[]).filter(o=>!o.archived);if(s.length===0){new wr.Notice("No tasks available to select");return}Fn(this.plugin,s,o=>{if(!o)return;this.titleInput.value=o.title||"",this.validateForm();let l=this.app.vault.getAbstractFileByPath(o.path);l&&this.addAttachment(l)},{title:"Select task"})}catch(i){yq.error("Failed to open task selector for timeblock creation:",{category:"persistence",operation:"open-task-selector-timeblock-creation",error:i}),new wr.Notice("Failed to open task selector")}}removeAttachment(t){this.selectedAttachments=this.selectedAttachments.filter(n=>n.path!==t.path),this.renderAttachmentsList(),new wr.Notice(this.translate("notices.timeblockAttachmentRemoved",{fileName:t.name}))}renderAttachmentsList(){if(this.attachmentsList.empty(),this.selectedAttachments.length===0){let t=this.attachmentsList.createDiv({cls:"timeblock-attachments-empty"});t.textContent="No attachments added yet";return}this.selectedAttachments.forEach(t=>{let n=this.attachmentsList.createDiv({cls:"timeblock-attachment-item"}),a=n.createDiv({cls:"timeblock-attachment-info"}),i=a.createSpan({cls:"timeblock-attachment-name"});if(i.textContent=t.name,t.path!==t.name){let o=a.createDiv({cls:"timeblock-attachment-path"});o.textContent=t.path}let s=n.createEl("button",{cls:"timeblock-attachment-remove",text:"\xD7"});(0,wr.setTooltip)(s,"Remove attachment",{placement:"top"}),s.addEventListener("click",()=>{this.removeAttachment(t)})})}onClose(){this.keyboardHandler&&(this.containerEl.removeEventListener("keydown",this.keyboardHandler),this.keyboardHandler=null);let{contentEl:t}=this;t.empty()}}});var qTe,Em,bq=y(()=>{Wr();K();qTe=N({tag:"Services/CalendarExportService"}),Em=class{static generateCalendarURL(e){let{type:t,task:n,useScheduledAsDue:a=!0}=e;switch(t){case"google":return this.generateGoogleCalendarURL(n,a);case"outlook":return this.generateOutlookCalendarURL(n,a);case"yahoo":return this.generateYahooCalendarURL(n,a);case"ics":return this.generateICSDownloadURL(n);default:throw new Error("Unsupported calendar type")}}static generateGoogleCalendarURL(e,t){let n="https://calendar.google.com/calendar/render",a=new URLSearchParams;a.append("action","TEMPLATE"),a.append("text",e.title);let i=this.formatGoogleDates(e,t);i&&a.append("dates",i);let s=this.buildDescription(e);return s&&a.append("details",s),e.contexts&&e.contexts.length>0&&a.append("location",e.contexts.join(", ")),`${n}?${a.toString()}`}static generateOutlookCalendarURL(e,t){let n="https://outlook.live.com/calendar/0/deeplink/compose",a=new URLSearchParams;a.append("subject",e.title);let{startISO:i,endISO:s}=this.getTaskDateRange(e,t);i&&a.append("startdt",i),s&&a.append("enddt",s);let o=this.buildDescription(e);return o&&a.append("body",o),e.contexts&&e.contexts.length>0&&a.append("location",e.contexts.join(", ")),a.append("path","/calendar/action/compose"),a.append("rru","addevent"),`${n}?${a.toString()}`}static generateYahooCalendarURL(e,t){let n="https://calendar.yahoo.com/",a=new URLSearchParams;a.append("v","60"),a.append("title",e.title);let{startYahoo:i,endYahoo:s}=this.getYahooDateFormat(e,t);i&&a.append("st",i),s&&a.append("et",s);let o=this.buildDescription(e);return o&&a.append("desc",o),e.contexts&&e.contexts.length>0&&a.append("in_loc",e.contexts.join(", ")),`${n}?${a.toString()}`}static generateICSDownloadURL(e){let t=this.generateICSContent(e);return`data:text/calendar;charset=utf8,${encodeURIComponent(t)}`}static generateICSContent(e,t){let n=`${e.path.replace(/[^a-zA-Z0-9]/g,"-")}-${Date.now()}@tasknotes`,a=new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),i=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//TaskNotes//Task Export//EN","CALSCALE:GREGORIAN","METHOD:PUBLISH","BEGIN:VEVENT",`UID:${n}`,`DTSTAMP:${a}`];i.push(`SUMMARY:${this.escapeICSText(e.title)}`);let{startLine:s,endLine:o}=this.getICSDateProperties(e,!0,t);s&&i.push(s),o&&i.push(o);let l=this.buildDescription(e,t);if(l&&i.push(`DESCRIPTION:${this.escapeICSText(l)}`),e.contexts&&e.contexts.length>0&&i.push(`LOCATION:${this.escapeICSText(e.contexts.join(", "))}`),e.tags&&e.tags.length>0&&i.push(`CATEGORIES:${e.tags.map(c=>this.escapeICSText(c)).join(",")}`),e.priority){let d={highest:"1",high:"3",medium:"5",low:"7",lowest:"9"}[e.priority]||"5";i.push(`PRIORITY:${d}`)}return e.status&&i.push(`STATUS:${this.getVEventStatus(e.status)}`),i.push("END:VEVENT"),i.push("END:VCALENDAR"),i.join(`\r `)}static buildDescription(e,t){let n=[],a=[];e.priority&&a.push(`Priority: ${e.priority}`),e.status&&a.push(`Status: ${e.status}`),e.projects&&e.projects.length>0&&a.push(`Projects: ${e.projects.join(", ")}`),e.tags&&e.tags.length>0&&a.push(`Tags: ${e.tags.join(", ")}`),e.contexts&&e.contexts.length>0&&a.push(`Contexts: ${e.contexts.join(", ")}`),e.timeEstimate&&a.push(`Estimated time: ${e.timeEstimate} minutes`),a.length>0&&n.push(...a),n.length>0&&n.push(""),n.push(`Exported from TaskNotes: ${e.path}`);let i=this.buildObsidianOpenUri(e,t);return i&&n.push(`Open in Obsidian: ${i}`),n.join(` `)}static buildObsidianOpenUri(e,t){return!(t!=null&&t.includeObsidianLink)||!t.vaultName?null:`obsidian://open?vault=${encodeURIComponent(t.vaultName)}&file=${encodeURIComponent(e.path)}`}static formatGoogleDates(e,t){let{startICS:n,endICS:a}=this.getICSDateFormat(e,t);if(!n)return null;if(a)return`${n}/${a}`;let i=this.parseICSDate(n),s=new Date(i.getTime()+3600*1e3),o=this.formatDateToICS(s);return`${n}/${o}`}static getTaskDateRange(e,t,n){let a=null,i=null;if(e.scheduled)try{a=this.parseTaskDate(e.scheduled).toISOString()}catch(s){qTe.warn("Invalid scheduled date:",{category:"provider",operation:"invalid-scheduled-date",details:{value:e.scheduled}})}if(n!=null&&n.useDurationForExport&&a&&e.timeEstimate&&e.timeEstimate>0){let s=new Date(a);i=new Date(s.getTime()+e.timeEstimate*60*1e3).toISOString()}else if(e.due)try{i=this.parseTaskDate(e.due).toISOString()}catch(s){qTe.warn("Invalid due date:",{category:"provider",operation:"invalid-due-date",details:{value:e.due}})}else if(t&&a){let s=new Date(a);i=new Date(s.getTime()+3600*1e3).toISOString()}return{startISO:a,endISO:i}}static getYahooDateFormat(e,t){let{startISO:n,endISO:a}=this.getTaskDateRange(e,t),i=s=>{let o=new Date(s);return M(o,"yyyyMMdd'T'HHmmss")};return{startYahoo:n?i(n):null,endYahoo:a?i(a):null}}static getICSDateFormat(e,t=!0,n){let{startISO:a,endISO:i}=this.getTaskDateRange(e,t,n),s=o=>{let l=new Date(o);return this.formatDateToICS(l)};return{startICS:a?s(a):null,endICS:i?s(i):null}}static getICSDateProperties(e,t=!0,n){if(e.scheduled&&!this.hasTimeComponent(e.scheduled)){let s=e.scheduled,o=this.getAllDayEndDate(e,t,n)||s;return{startLine:`DTSTART;VALUE=DATE:${this.formatDateOnlyToICS(s)}`,endLine:`DTEND;VALUE=DATE:${this.formatDateOnlyToICS(o)}`}}let{startICS:a,endICS:i}=this.getICSDateFormat(e,t,n);return{startLine:a?`DTSTART:${a}`:null,endLine:i?`DTEND:${i}`:null}}static formatDateToICS(e){return e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,"")}static parseICSDate(e){let t=e.slice(0,4),n=e.slice(4,6),a=e.slice(6,8),i=e.slice(9,11),s=e.slice(11,13),o=e.slice(13,15);return new Date(`${t}-${n}-${a}T${i}:${s}:${o}Z`)}static parseTaskDate(e){let t=e.trim().replace(" ","T");return this.hasTimeComponent(t)?Us(t):Us(`${t}T00:00:00`)}static hasTimeComponent(e){return/\d{4}-\d{2}-\d{2}[T\s]\d{2}:\d{2}/.test(e)}static formatDateOnlyToICS(e){return e.split(/[T\s]/)[0].replace(/-/g,"")}static getAllDayEndDate(e,t,n){if(!e.scheduled)return null;let a=e.scheduled;if(n!=null&&n.useDurationForExport&&e.timeEstimate&&e.timeEstimate>0){let i=Math.max(1,Math.ceil(e.timeEstimate/1440));return this.addDaysToDateString(e.scheduled,i)}if(e.due)a=e.due;else if(!t)return null;return this.addDaysToDateString(a,1)}static addDaysToDateString(e,t){let n=Us(`${e.split(/[T\s]/)[0]}T00:00:00`);return n.setDate(n.getDate()+t),M(n,"yyyy-MM-dd")}static escapeICSText(e){return e.replace(/\\/g,"\\\\").replace(/;/g,"\\;").replace(/,/g,"\\,").replace(/\n/g,"\\n").replace(/\r/g,"")}static foldICSLines(e){let t=e.split(`\r `),n=[];return t.forEach(a=>{if(a.length<=75)n.push(a);else{let i=a;for(;i.length>75;)n.push(i.substring(0,75)),i=" "+i.substring(75);i.length>0&&n.push(i)}}),n.join(`\r `)}static generateMultipleTasksICSContent(e,t){let n=new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),a=this.filterTasksForExport(e,t),i=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//TaskNotes//EN","CALSCALE:GREGORIAN"];return a.forEach((s,o)=>{let l=`${s.path.replace(/[^a-zA-Z0-9]/g,"-")}-${o}-${Date.now()}@tasknotes`;i.push("BEGIN:VEVENT"),i.push(`UID:${l}`),i.push(`DTSTAMP:${n}`),i.push(`SUMMARY:${this.escapeICSText(s.title)}`);let{startLine:c,endLine:d}=this.getICSDateProperties(s,!0,t);if(c){if(!d){let p=c.split(":",2)[1];if(c.includes("VALUE=DATE")){let m=Us(`${p.slice(0,4)}-${p.slice(4,6)}-${p.slice(6,8)}T00:00:00`);m.setDate(m.getDate()+1),d=`DTEND;VALUE=DATE:${M(m,"yyyyMMdd")}`}else{let m=this.parseICSDate(p),f=new Date(m.getTime()+3600*1e3);d=`DTEND:${this.formatDateToICS(f)}`}}}else{let p;if(s.dateCreated?p=new Date(s.dateCreated):p=new Date,c=`DTSTART:${this.formatDateToICS(p)}`,!d){let f=new Date(p.getTime()+36e5);d=`DTEND:${this.formatDateToICS(f)}`}}i.push(c),i.push(d);let u=this.buildDescription(s,t);if(u&&i.push(`DESCRIPTION:${this.escapeICSText(u)}`),s.contexts&&s.contexts.length>0&&i.push(`LOCATION:${this.escapeICSText(s.contexts.join(", "))}`),s.tags&&s.tags.length>0&&i.push(`CATEGORIES:${s.tags.map(p=>this.escapeICSText(p)).join(",")}`),s.priority){let m={highest:"1",high:"3",medium:"5",low:"7",lowest:"9"}[s.priority]||"5";i.push(`PRIORITY:${m}`)}s.status&&i.push(`STATUS:${this.getVEventStatus(s.status)}`),i.push("END:VEVENT")}),i.push("END:VCALENDAR"),this.foldICSLines(i.join(`\r `))}static filterTasksForExport(e,t){var a;if(!(t!=null&&t.excludeArchived)&&!(t!=null&&t.excludeCompleted)&&!(t!=null&&t.requireDueDate)&&!(t!=null&&t.requireScheduledDate))return e;let n=new Set((a=t.completedStatuses)!=null&&a.length?t.completedStatuses:["done"]);return e.filter(i=>!(t.excludeArchived&&i.archived||t.excludeCompleted&&n.has(i.status)||t.requireDueDate&&!i.due||t.requireScheduledDate&&!i.scheduled))}static getVEventStatus(e){let t=e.trim().toLowerCase();return t==="cancelled"||t==="canceled"?"CANCELLED":t==="tentative"?"TENTATIVE":"CONFIRMED"}static createMultipleTasksICSDownload(e,t){if(!e||e.length===0)return null;let n=this.filterTasksForExport(e,t);if(n.length===0)return null;let a=new Date().toISOString().split("T")[0];return{content:this.generateMultipleTasksICSContent(n,t),filename:`tasknotes-all-tasks-${a}.ics`,taskCount:n.length}}static createTaskICSDownload(e,t){return{content:this.generateICSContent(e,t),filename:`${e.title.replace(/[^a-zA-Z0-9]/g,"-")}.ics`,taskCount:1}}}});function Xe(r,e){return e===void 0?new Tq.Notice(r):new Tq.Notice(r,e)}var Tq,Uu=y(()=>{Tq=require("obsidian")});var YTe={};at(YTe,{downloadAllTasksICSFile:()=>Qit,downloadTaskICSFile:()=>Sq,openCalendarURL:()=>kE});function Uk(r,e,t,n){return r?r(e,n):t}function WTe(r){let e=new Blob([r.content],{type:"text/calendar"}),t=URL.createObjectURL(e);try{let n=activeWindow.createEl("a");n.href=t,n.download=r.filename,n.click()}finally{URL.revokeObjectURL(t)}}function kE(r,e){try{let t=Em.generateCalendarURL(r);window.open(t,"_blank")}catch(t){wq.error("Failed to generate calendar URL:",{category:"provider",operation:"generate-calendar-url",error:t}),Xe(Uk(e,"services.calendarExport.notices.generateLinkFailed","Failed to generate calendar link"))}}function Qit(r,e,t){try{let n=Em.createMultipleTasksICSDownload(r,t);if(!n){Xe(Uk(e,"services.calendarExport.notices.noTasksToExport","No tasks found to export"));return}WTe(n);let a=n.taskCount===1?"":"s";Xe(Uk(e,"services.calendarExport.notices.downloadSuccess",`Downloaded ${n.filename} with ${n.taskCount} task${a}`,{filename:n.filename,count:n.taskCount,plural:a}))}catch(n){wq.error("Failed to download all tasks ICS file:",{category:"provider",operation:"download-all-tasks-ics-file",error:n}),Xe(Uk(e,"services.calendarExport.notices.downloadFailed","Failed to download calendar file"))}}function Sq(r,e,t){try{let n=Em.createTaskICSDownload(r,t);WTe(n),Xe(Uk(e,"services.calendarExport.notices.singleDownloadSuccess",`Downloaded ${n.filename}`,{filename:n.filename}))}catch(n){wq.error("Failed to download ICS file:",{category:"provider",operation:"download-ics-file",error:n}),Xe(Uk(e,"services.calendarExport.notices.downloadFailed","Failed to download calendar file"))}}var wq,xq=y(()=>{bq();K();Uu();wq=N({tag:"UI/CalendarExportActions"})});async function KTe(r){let{plugin:e,path:t,openInNewLeaf:n=!1}=r,a=e.app.vault.getAbstractFileByPath(t);if(a instanceof ug.TFile){await e.app.workspace.getLeaf(n).openFile(a);return}await e.app.workspace.openLinkText(t,"",n)}async function Hk(r){let{plugin:e,parentTask:t,targetDate:n,openInNewLeaf:a=!1,onUpdate:i}=r,s=ce(n);try{let o=await e.taskService.findMaterializedOccurrence(t,n),l=await e.taskService.materializeOccurrence(t,n);return await KTe({plugin:e,path:l.path,openInNewLeaf:a}),i==null||i(),new ug.Notice(o?`Opened occurrence note for ${s}`:`Created occurrence note for ${s}`),l}catch(o){let l=o instanceof Error?o.message:String(o);return GTe.error("Error opening or creating occurrence note:",{category:"persistence",operation:"open-or-create-occurrence-note",details:{taskPath:t.path,targetDate:s},error:l}),new ug.Notice(`Failed to open occurrence note: ${l}`),null}}async function pN(r){let{plugin:e,occurrenceTask:t,openInNewLeaf:n=!1}=r;try{let a=await e.taskService.getMaterializedOccurrenceParent(t);return a?(await KTe({plugin:e,path:a.path,openInNewLeaf:n}),a):(new ug.Notice("Recurring parent not found"),null)}catch(a){let i=a instanceof Error?a.message:String(a);return GTe.error("Error opening materialized occurrence parent:",{category:"persistence",operation:"open-materialized-occurrence-parent",details:{taskPath:t.path,occurrenceDate:t.occurrence_date},error:i}),new ug.Notice(`Failed to open recurring parent: ${i}`),null}}var ug,GTe,mN=y(()=>{ug=require("obsidian");Me();K();GTe=N({tag:"UI/OccurrenceNoteActions"})});function fN(r){return r.trim()}function bE(r){let e=new Set,t=[];for(let n of r!=null?r:[]){if(typeof n!="string")continue;let a=fN(n);!a||e.has(a)||(e.add(a),t.push(a))}return t}function QTe(r,e){let t=fN(e),n=bE(r);return t?n.includes(t)?n:[...n,t]:n.length>0?n:void 0}function Jit(r,e){let t=fN(e),n=bE(r).filter(a=>a!==t);return n.length>0?n:void 0}function Xit(r,e){let t=fN(e),n=bE(r);return t?n.includes(t)?Jit(n,t):QTe(n,t):n.length>0?n:void 0}function fa(r){return r.setSubmenu()}function ZTe(r){var t,n;let e=r;return(n=(t=e.dom)!=null?t:e.domEl)!=null?n:null}function Vk(r,e=""){let n=(typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r=="bigint"?String(r):"").trim();return n.length>0?n:e}var Le,Sr,Yl,TE=y(()=>{Le=require("obsidian");Me();Mk();rN();Ba();lq();ro();bk();kk();Pk();fV();tE();Vo();qv();Io();qn();Pu();VTe();kq();yV();xq();mN();K();Sr=N({tag:"Components/TaskContextMenu"});Yl=class r{constructor(e,t=new Ea){this.targetDoc=activeDocument;this.menu=t,this.options=e,this.buildMenu()}static addToMenu(e,t){new r(t,e)}t(e,t){return this.options.plugin.i18n.translate(e,t)}buildMenu(){let{task:e,plugin:t}=this.options,n=this.addPromotedOccurrenceControls(e,t);this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.status")),a.setIcon("circle");let i=fa(a);this.addStatusOptions(i,e,t)}),this.menu.addSeparator(),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.priority")),a.setIcon("star");let i=fa(a);this.addPriorityOptions(i,e,t)}),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.tags")),a.setIcon("tags");let i=fa(a);this.addTagOptions(i,e,t)}),this.menu.addSeparator(),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.dueDate")),a.setIcon("calendar");let i=fa(a);this.addDateOptions(i,e.due,async s=>{var o,l;try{await t.updateTaskProperty(e,"due",s||void 0),(l=(o=this.options).onUpdate)==null||l.call(o)}catch(c){let d=c instanceof Error?c.message:String(c);Sr.error("Error updating task due date:",{category:"validation",operation:"updating-task-due-date",details:{taskPath:e.path},error:d}),new Le.Notice(this.t("contextMenus.task.notices.updateDueDateFailure",{message:d}))}},()=>{t.openDueDateModal(e)})}),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.scheduledDate")),a.setIcon("calendar-clock");let i=fa(a);this.addDateOptions(i,e.scheduled,async s=>{var o,l;try{await t.updateTaskProperty(e,"scheduled",s||void 0),(l=(o=this.options).onUpdate)==null||l.call(o)}catch(c){let d=c instanceof Error?c.message:String(c);Sr.error("Error updating task scheduled date:",{category:"validation",operation:"updating-task-scheduled-date",details:{taskPath:e.path},error:d}),new Le.Notice(this.t("contextMenus.task.notices.updateScheduledFailure",{message:d}))}},()=>{t.openScheduledDateModal(e)})}),this.addCustomDateFieldMenuItems(e,t),e.recurrence&&this.addRecurringInstanceMenuItems(e,t),!n&&e.recurrence_parent&&e.occurrence_date&&this.addMaterializedOccurrenceMenuItems(e,t),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.reminders")),a.setIcon("bell");let i=fa(a);this.addQuickRemindersSection(i,e,t,"due",this.t("contextMenus.task.remindBeforeDue")),this.addQuickRemindersSection(i,e,t,"scheduled",this.t("contextMenus.task.remindBeforeScheduled")),i.addSeparator(),i.addItem(s=>{s.setTitle(this.t("contextMenus.task.manageReminders")),s.setIcon("settings"),s.onClick(()=>{new ql(t.app,t,e,l=>{(async()=>{var c,d;try{await t.updateTaskProperty(e,"reminders",l.length>0?l:void 0),(d=(c=this.options).onUpdate)==null||d.call(c)}catch(u){Sr.error("Error updating reminders:",{category:"persistence",operation:"updating-reminders",error:u}),new Le.Notice(this.t("contextMenus.task.notices.updateRemindersFailure"))}})()}).open()})}),e.reminders&&e.reminders.length>0&&i.addItem(s=>{s.setTitle(this.t("contextMenus.task.clearReminders")),s.setIcon("trash"),s.onClick(async()=>{var o,l;try{await t.updateTaskProperty(e,"reminders",void 0),(l=(o=this.options).onUpdate)==null||l.call(o)}catch(c){Sr.error("Error clearing reminders:",{category:"persistence",operation:"clearing-reminders",error:c}),new Le.Notice(this.t("contextMenus.task.notices.clearRemindersFailure"))}})})}),this.menu.addSeparator(),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.dependencies.title")),a.setIcon("git-branch");let i=fa(a);this.addDependencyMenuItems(i,e,t)}),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.organization.title")),a.setIcon("folder-tree");let i=fa(a);this.addOrganizationMenuItems(i,e,t)}),this.menu.addSeparator(),this.menu.addItem(a=>{let i=t.getActiveTimeSession(e);a.setTitle(i?this.t("contextMenus.task.stopTimeTracking"):this.t("contextMenus.task.startTimeTracking")),a.setIcon(i?"pause":"play"),a.onClick(async()=>{var o,l;t.getActiveTimeSession(e)?await t.stopTimeTracking(e):await t.startTimeTracking(e),(l=(o=this.options).onUpdate)==null||l.call(o)})}),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.editTimeEntries")),a.setIcon("clock"),a.onClick(()=>{t.openTimeEntryEditor(e)})}),t.settings.calendarViewSettings.enableTimeblocking&&this.menu.addItem(a=>{a.setTitle("Create timeblock"),a.setIcon("calendar-plus"),a.onClick(()=>{let i=HTe(e,this.options.targetDate);new Bk(t.app,t,{date:i.date,startTime:i.startTime,endTime:i.endTime,prefilledTitle:e.title,prefilledAttachmentPaths:[e.path]}).open()})}),this.menu.addItem(a=>{a.setTitle(e.archived?this.t("contextMenus.task.unarchive"):this.t("contextMenus.task.archive")),a.setIcon(e.archived?"archive-restore":"archive"),a.onClick(async()=>{var i,s;try{await t.toggleTaskArchive(e),(s=(i=this.options).onUpdate)==null||s.call(i)}catch(o){let l=o instanceof Error?o.message:String(o);Sr.error("Error toggling task archive:",{category:"persistence",operation:"toggling-task-archive",details:{taskPath:e.path},error:l}),new Le.Notice(this.t("contextMenus.task.notices.archiveFailure",{message:l}))}})}),this.menu.addSeparator(),this.menu.addItem(a=>{a.setTitle(this.t("modals.taskEdit.title")),a.setIcon("pencil"),a.onClick(()=>{t.openTaskEditModal(e,()=>{var i,s;(s=(i=this.options).onUpdate)==null||s.call(i)})})}),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.openNote")),a.setIcon("file-text"),a.onClick(()=>{let i=t.app.vault.getAbstractFileByPath(e.path);i instanceof Le.TFile&&t.app.workspace.getLeaf(!1).openFile(i)})}),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.openNoteInNewTab")),a.setIcon("external-link"),a.onClick(()=>{t.app.vault.getAbstractFileByPath(e.path)instanceof Le.TFile&&t.app.workspace.openLinkText(e.path,"",!0)})}),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.copyTitle")),a.setIcon("copy"),a.onClick(async()=>{try{await navigator.clipboard.writeText(e.title),new Le.Notice(this.t("contextMenus.task.notices.copyTitleSuccess"))}catch(i){new Le.Notice(this.t("contextMenus.task.notices.copyFailure"))}})}),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.noteActions")),a.setIcon("file-text");let i=fa(a),s=t.app.vault.getAbstractFileByPath(e.path);if(s instanceof Le.TFile){try{t.app.workspace.trigger("file-menu",i,s,"tasknotes-context-menu")}catch(o){Sr.debug("Native file menu not available, using fallback",{category:"stale-data",operation:"native-file-menu-not-using-fallback"})}i.addItem(o=>{o.setTitle(this.t("contextMenus.task.rename")),o.setIcon("pencil"),o.onClick(async()=>{try{let l=s.basename,c=await Tk(t.app,{title:this.t("contextMenus.task.renameTitle"),placeholder:this.t("contextMenus.task.renamePlaceholder"),initialValue:l});if(c&&c.trim()!==""&&c!==l){let d=s.extension,u=c.endsWith(`.${d}`)?c:`${c}.${d}`,p=s.parent?`${s.parent.path}/${u}`:u;await q2(t.app,s,p),new Le.Notice(this.t("contextMenus.task.notices.renameSuccess",{name:u})),this.options.onUpdate&&this.options.onUpdate()}}catch(l){Sr.error("Error renaming file:",{category:"persistence",operation:"renaming-file",error:l}),new Le.Notice(this.t("contextMenus.task.notices.renameFailure"))}})}),i.addItem(o=>{o.setTitle(this.t("contextMenus.task.delete")),o.setIcon("trash"),o.onClick(async()=>{if(await Ir(t.app,{title:this.t("contextMenus.task.deleteTitle"),message:this.t("contextMenus.task.deleteMessage",{name:s.name}),confirmText:this.t("contextMenus.task.deleteConfirm"),cancelText:this.t("common.cancel"),isDestructive:!0}))try{await t.taskService.deleteTask(e),this.options.onUpdate&&this.options.onUpdate()}catch(c){let d=c instanceof Error?c.message:String(c);Sr.error("Error deleting task:",{category:"persistence",operation:"deleting-task",error:c}),new Le.Notice(`Failed to delete task: ${d}`)}})}),i.addSeparator(),i.addItem(o=>{o.setTitle(this.t("contextMenus.task.copyPath")),o.setIcon("copy"),o.onClick(()=>{navigator.clipboard.writeText(s.path).then(()=>{new Le.Notice(this.t("contextMenus.task.notices.copyPathSuccess"))}).catch(()=>{new Le.Notice(this.t("contextMenus.task.notices.copyFailure"))})})}),i.addItem(o=>{o.setTitle(this.t("contextMenus.task.copyUrl")),o.setIcon("link"),o.onClick(()=>{let l=`obsidian://open?vault=${encodeURIComponent(t.app.vault.getName())}&file=${encodeURIComponent(s.path)}`;navigator.clipboard.writeText(l).then(()=>{new Le.Notice(this.t("contextMenus.task.notices.copyUrlSuccess"))}).catch(()=>{new Le.Notice(this.t("contextMenus.task.notices.copyFailure"))})})}),i.addSeparator(),i.addItem(o=>{o.setTitle(this.t("contextMenus.task.showInExplorer")),o.setIcon("folder-open"),o.onClick(()=>{t.app.workspace.getLeaf().setViewState({type:"file-explorer",state:{}}).then(()=>{let l=t.app.workspace.getLeavesOfType("file-explorer")[0];l!=null&&l.view&&"revealInFolder"in l.view&&l.view.revealInFolder(s)}).catch(l=>{Sr.warn("Failed to reveal task in file explorer:",{category:"persistence",operation:"reveal-task-file-explorer",error:l})})})})}}),this.menu.addSeparator(),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.addToCalendar")),a.setIcon("calendar-plus");let i=fa(a);i.addItem(s=>{s.setTitle(this.t("contextMenus.task.calendar.google")),s.setIcon("external-link"),s.onClick(()=>{kE({type:"google",task:e,useScheduledAsDue:!0},this.t.bind(this))})}),i.addItem(s=>{s.setTitle(this.t("contextMenus.task.calendar.outlook")),s.setIcon("external-link"),s.onClick(()=>{kE({type:"outlook",task:e,useScheduledAsDue:!0},this.t.bind(this))})}),i.addItem(s=>{s.setTitle(this.t("contextMenus.task.calendar.yahoo")),s.setIcon("external-link"),s.onClick(()=>{kE({type:"yahoo",task:e,useScheduledAsDue:!0},this.t.bind(this))})}),i.addSeparator(),i.addItem(s=>{s.setTitle(this.t("contextMenus.task.calendar.downloadIcs")),s.setIcon("download"),s.onClick(()=>{Sq(e,this.t.bind(this),{includeObsidianLink:!0,vaultName:t.app.vault.getName()})})}),i.addSeparator(),i.addItem(s=>{s.setTitle(this.t("contextMenus.task.calendar.syncToGoogle")),s.setIcon("refresh-cw"),s.onClick(async()=>{var o,l,c;if(!((o=t.taskCalendarSyncService)!=null&&o.isEnabled())){new Le.Notice(this.t("contextMenus.task.calendar.syncToGoogleNotConfigured"));return}try{await t.taskCalendarSyncService.syncTaskToCalendar(e),new Le.Notice(this.t("contextMenus.task.calendar.syncToGoogleSuccess")),(c=(l=this.options).onUpdate)==null||c.call(l)}catch(d){Sr.error("Failed to sync task to Google Calendar:",{category:"provider",operation:"sync-task-google-calendar",error:d}),new Le.Notice(this.t("contextMenus.task.calendar.syncToGoogleFailed"))}})})}),this.menu.addSeparator(),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.recurrence")),a.setIcon("refresh-ccw");let i=fa(a),s=typeof e.recurrence=="string"?e.recurrence:void 0;this.addRecurrenceOptions(i,s,async o=>{var l,c;try{await t.updateTaskProperty(e,"recurrence",o||void 0),(c=(l=this.options).onUpdate)==null||c.call(l)}catch(d){let u=d instanceof Error?d.message:String(d);Sr.error("Error updating task recurrence:",{category:"persistence",operation:"updating-task-recurrence",details:{taskPath:e.path},error:u}),new Le.Notice(this.t("contextMenus.task.notices.updateRecurrenceFailure",{message:u}))}},t),s&&this.addOccurrencePolicyOptions(i,e,t)}),this.menu.addSeparator(),this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.createSubtask")),a.setIcon("plus"),a.onClick(()=>{let i=t.app.vault.getAbstractFileByPath(e.path);i instanceof Le.TFile&&t.openTaskCreationModal({..._Te(t,e,i)})})}),this.addMobileDismissOption(),window.setTimeout(()=>{this.updateMainMenuIconColors(e,t)},10)}addMobileDismissOption(){Le.Platform.isMobile&&(this.menu.addSeparator(),this.menu.addItem(e=>{e.setTitle(this.t("common.close")),e.setIcon("x"),e.onClick(()=>{this.menu.hide()})}))}addRecurringInstanceMenuItems(e,t){var c,d;let n=ce(this.options.targetDate),a=((c=e.complete_instances)==null?void 0:c.includes(n))||!1;this.menu.addItem(u=>{u.setTitle(a?this.t("contextMenus.task.markIncomplete"):this.t("contextMenus.task.markComplete")),u.setIcon(a?"x":"check"),u.onClick(async()=>{var p,m;try{await t.toggleRecurringTaskComplete(e,this.options.targetDate),(m=(p=this.options).onUpdate)==null||m.call(p)}catch(f){let h=f instanceof Error?f.message:String(f);Sr.error("Error toggling recurring task completion:",{category:"persistence",operation:"toggling-recurring-task-completion",details:{taskPath:e.path},error:h}),new Le.Notice(this.t("contextMenus.task.notices.toggleCompletionFailure",{message:h}))}})});let i=this.options.occurrenceDate,s=i!=null?i:sN(e),o=ce(s),l=((d=e.skipped_instances)==null?void 0:d.includes(o))||!1;this.menu.addItem(u=>{u.setTitle(l?this.t("contextMenus.task.unskipInstance"):this.t("contextMenus.task.skipInstance")),u.setIcon(l?"undo":"x-circle"),u.onClick(async()=>{var p,m;try{await t.taskService.toggleRecurringTaskSkipped(e,i),(m=(p=this.options).onUpdate)==null||m.call(p)}catch(f){let h=f instanceof Error?f.message:String(f);Sr.error("Error toggling recurring task skip:",{category:"persistence",operation:"toggling-recurring-task-skip",details:{taskPath:e.path},error:h}),new Le.Notice(this.t("contextMenus.task.notices.toggleSkipFailure",{message:h}))}})}),this.options.promoteOccurrenceControls||this.addOccurrenceNoteMenuItem(e,t)}addPromotedOccurrenceControls(e,t){if(!this.options.promoteOccurrenceControls)return!1;let n=!1;return e.recurrence&&(this.addOccurrenceNoteMenuItem(e,t),n=!0),e.recurrence_parent&&e.occurrence_date&&(this.addMaterializedOccurrenceMenuItems(e,t),n=!0),n&&this.menu.addSeparator(),n}addOccurrenceNoteMenuItem(e,t){this.menu.addItem(n=>{n.setTitle("Open or create occurrence note"),n.setIcon("file-plus"),n.onClick(async()=>{await Hk({plugin:t,parentTask:e,targetDate:this.getOccurrenceNoteTargetDate(e),onUpdate:this.options.onUpdate})})})}getOccurrenceNoteTargetDate(e){if(this.options.promoteOccurrenceControls||e.recurrence_anchor!=="completion")return this.options.targetDate;try{let t=de(e.scheduled||"");return t?kt(t):this.options.targetDate}catch(t){return this.options.targetDate}}addMaterializedOccurrenceMenuItems(e,t){this.menu.addItem(i=>{i.setTitle("Open recurring parent"),i.setIcon("refresh-ccw"),i.onClick(async()=>{await pN({plugin:t,occurrenceTask:e})})});let n=this.getSkippedStatusValue(t),a=this.isSkippedMaterializedOccurrence(e,t);!n&&!a||this.menu.addItem(i=>{i.setTitle(a?"Unskip occurrence":"Skip occurrence"),i.setIcon(a?"undo":"x-circle"),i.onClick(async()=>{var s,o;try{let l=a?await t.taskService.unskipMaterializedOccurrence(e):await t.taskService.skipMaterializedOccurrence(e,n);Object.assign(e,l),(o=(s=this.options).onUpdate)==null||o.call(s)}catch(l){let c=l instanceof Error?l.message:String(l);Sr.error("Error updating materialized occurrence skip state:",{category:"persistence",operation:"updating-materialized-occurrence-skip-state",details:{taskPath:e.path,occurrenceDate:e.occurrence_date},error:c}),new Le.Notice(`Failed to update occurrence: ${c}`)}})})}getSkippedStatusValue(e){var t,n;return(n=(t=e.settings.customStatuses)==null?void 0:t.find(a=>a.isSkipped))==null?void 0:n.value}isSkippedMaterializedOccurrence(e,t){var n;return((n=t.settings.customStatuses)==null?void 0:n.some(a=>a.isSkipped&&a.value===e.status))===!0}addDependencyMenuItems(e,t,n){var s,o;e.addItem(l=>{l.setTitle(this.t("contextMenus.task.dependencies.addBlockedBy")),l.setIcon("link-2"),l.onClick(()=>{this.menu.hide(),this.openBlockedBySelector(t,n)})});let a=(s=t.blockedBy)!=null?s:[];a.length>0&&e.addItem(l=>{l.setTitle(this.t("contextMenus.task.dependencies.removeBlockedBy")),l.setIcon("unlink");let c=fa(l);a.forEach((d,u)=>{c.addItem(p=>{let m=Vk(tU(d),this.t("contextMenus.task.dependencies.unknownDependency"));p.setTitle(m),p.onClick(async()=>{var f,h;try{let g=a.filter((b,k)=>k!==u),v=await n.updateTaskProperty(t,"blockedBy",g.length>0?g:void 0);Object.assign(t,v),new Le.Notice(this.t("contextMenus.task.dependencies.notices.blockedByRemoved")),(h=(f=this.options).onUpdate)==null||h.call(f)}catch(g){Sr.error("Failed to remove blocked-by dependency:",{category:"persistence",operation:"remove-blocked-by-dependency",error:g}),new Le.Notice(this.t("contextMenus.task.dependencies.notices.updateFailed"))}})})})}),e.addSeparator(),e.addItem(l=>{l.setTitle(this.t("contextMenus.task.dependencies.addBlocking")),l.setIcon("git-branch-plus"),l.onClick(()=>{this.menu.hide(),this.openBlockingSelector(t,n)})});let i=(o=t.blocking)!=null?o:[];i.length>0&&e.addItem(l=>{l.setTitle(this.t("contextMenus.task.dependencies.removeBlocking")),l.setIcon("git-branch-minus");let c=fa(l);i.forEach(d=>{let u=n.app.vault.getAbstractFileByPath(d),p=u instanceof Le.TFile?n.app.metadataCache.fileToLinktext(u,t.path,!1):d.split("/").pop()||d;c.addItem(m=>{m.setTitle(p),m.onClick(async()=>{var f,h;try{await n.taskService.updateBlockingRelationships(t,[],[d],{});let g=await n.cacheManager.getTaskInfo(t.path);g&&Object.assign(t,g),new Le.Notice(this.t("contextMenus.task.dependencies.notices.blockingRemoved")),(h=(f=this.options).onUpdate)==null||h.call(f)}catch(g){Sr.error("Failed to remove blocking dependency:",{category:"persistence",operation:"remove-blocking-dependency",error:g}),new Le.Notice(this.t("contextMenus.task.dependencies.notices.updateFailed"))}})})})})}dedupeDependencyEntries(e){let t=new Map;for(let n of e){let a=os(n);if(!a)continue;let i=this.getDependencyKey(a);t.has(i)||t.set(i,a)}return Array.from(t.values())}async openBlockedBySelector(e,t){let n=new Set((Array.isArray(e.blockedBy)?e.blockedBy:[]).map(a=>a.uid));await this.openTaskDependencySelector(t,a=>{if(a.path===e.path)return!1;let i=_o(t.app,e.path,a.path,t.settings.useFrontmatterMarkdownLinks);return!n.has(i)},async a=>{await this.handleBlockedBySelection(e,t,a)})}async openBlockingSelector(e,t){var a;let n=new Set((a=e.blocking)!=null?a:[]);await this.openTaskDependencySelector(t,i=>i.path===e.path?!1:!n.has(i.path),async i=>{await this.handleBlockingSelection(e,t,i)})}async openTaskDependencySelector(e,t,n){try{let i=(await e.cacheManager.getAllTasks()).filter(t);if(i.length===0){new Le.Notice(this.t("contextMenus.task.dependencies.notices.noEligibleTasks"));return}Fn(e,i,s=>{s&&n(s)})}catch(a){Sr.error("Failed to open task selector for dependencies:",{category:"persistence",operation:"open-task-selector-dependencies",error:a}),new Le.Notice(this.t("contextMenus.task.dependencies.notices.updateFailed"))}}async handleBlockedBySelection(e,t,n){var a,i;if(n.path!==e.path)try{let s={uid:_o(t.app,e.path,n.path,t.settings.useFrontmatterMarkdownLinks),reltype:ss},o=Array.isArray(e.blockedBy)?e.blockedBy:[],l=this.dedupeDependencyEntries([...o,s]);if(l.length===o.length)return;let c=await t.updateTaskProperty(e,"blockedBy",l);Object.assign(e,c),new Le.Notice(this.t("contextMenus.task.dependencies.notices.blockedByAdded",{count:1})),(i=(a=this.options).onUpdate)==null||i.call(a)}catch(s){Sr.error("Failed to add blocked-by dependency via selector:",{category:"persistence",operation:"add-blocked-by-dependency-via-selector",error:s}),new Le.Notice(this.t("contextMenus.task.dependencies.notices.updateFailed"))}}async handleBlockingSelection(e,t,n){var i,s,o;let a=n.path;if(a!==e.path&&!((i=e.blocking)!=null&&i.includes(a)))try{let l={uid:_o(t.app,a,e.path,t.settings.useFrontmatterMarkdownLinks),reltype:ss};await t.taskService.updateBlockingRelationships(e,[a],[],{[a]:l});let c=await t.cacheManager.getTaskInfo(e.path);c?Object.assign(e,c):Array.isArray(e.blocking)?e.blocking=Array.from(new Set([...e.blocking,a])):e.blocking=[a],new Le.Notice(this.t("contextMenus.task.dependencies.notices.blockingAdded",{count:1})),(o=(s=this.options).onUpdate)==null||o.call(s)}catch(l){Sr.error("Failed to add blocking dependency via selector:",{category:"persistence",operation:"add-blocking-dependency-via-selector",error:l}),new Le.Notice(this.t("contextMenus.task.dependencies.notices.updateFailed"))}}getDependencyKey(e){var t;return`${e.uid}::${e.reltype}::${(t=e.gap)!=null?t:""}`}addOrganizationMenuItems(e,t,n){e.addItem(a=>{a.setTitle(this.t("contextMenus.task.organization.contexts")),a.setIcon("at-sign");let i=fa(a);this.addContextMenuItems(i,t,n)}),e.addSeparator(),e.addItem(a=>{a.setTitle(this.t("contextMenus.task.organization.addToProject")),a.setIcon("folder-plus"),a.onClick(()=>{this.menu.hide(),this.openProjectSelector(t,n)})}),e.addItem(a=>{a.setTitle(this.t("contextMenus.task.organization.addSubtasks")),a.setIcon("indent"),a.onClick(()=>{this.menu.hide(),this.openSubtaskAssignmentSelector(t,n)})})}addContextMenuItems(e,t,n){let a=bE(t.contexts),i=this.getContextOptions(t,n);if(e.addItem(s=>{s.setTitle(this.t("contextMenus.task.organization.addContext")),s.setIcon("plus"),s.onClick(()=>{this.menu.hide(),this.openContextInput(t,n)})}),i.length>0){e.addSeparator();for(let s of i)e.addItem(o=>{let l=a.includes(s);o.setTitle(l?this.t("contextMenus.task.organization.contextSelected",{context:s}):s),o.setIcon(l?"check":"at-sign"),o.onClick(async()=>{await this.updateTaskContexts(t,n,Xit(t.contexts,s))})})}a.length>0&&(e.addSeparator(),e.addItem(s=>{s.setTitle(this.t("contextMenus.task.organization.clearContexts")),s.setIcon("x"),s.onClick(async()=>{await this.updateTaskContexts(t,n,void 0)})}))}getContextOptions(e,t){var i,s,o,l;let n=(o=(s=(i=t.cacheManager).getAllContexts)==null?void 0:s.call(i))!=null?o:[];return bE([...n,...(l=e.contexts)!=null?l:[]]).sort((c,d)=>c.localeCompare(d))}async openContextInput(e,t){let n=await Tk(t.app,{title:this.t("contextMenus.task.organization.addContext"),placeholder:this.t("contextMenus.task.organization.contextPlaceholder"),confirmText:this.t("common.confirm"),cancelText:this.t("common.cancel")});n&&await this.updateTaskContexts(e,t,QTe(e.contexts,n))}async updateTaskContexts(e,t,n){var a,i;try{let s=await t.updateTaskProperty(e,"contexts",n);Object.assign(e,s),(i=(a=this.options).onUpdate)==null||i.call(a)}catch(s){Sr.error("Failed to update task contexts:",{category:"validation",operation:"update-task-contexts",error:s}),new Le.Notice(this.t("contextMenus.task.organization.notices.updateContextsFailed"))}}addTagOptions(e,t,n){let a=Pbe(t,n.settings);if(e.addItem(i=>{i.setTitle(this.t("contextMenus.task.addTag")),i.setIcon("plus"),i.onClick(()=>{this.menu.hide(),this.openTagInput(t,n,"add")})}),a.length>0){e.addSeparator();for(let i of a)e.addItem(s=>{s.setTitle(this.t("contextMenus.task.removeTag",{tag:`#${i}`})),s.setIcon("x"),s.onClick(async()=>{await this.updateTaskTags(t,n,nE(t.tags,[i]))})});e.addSeparator(),e.addItem(i=>{i.setTitle(this.t("contextMenus.task.clearTags")),i.setIcon("eraser"),i.onClick(async()=>{await this.updateTaskTags(t,n,LI(t.tags,n.settings))})})}}async openTagInput(e,t,n){let a=await Tk(t.app,{title:n==="add"?this.t("contextMenus.task.addTag"):this.t("contextMenus.task.removeTagInput"),placeholder:this.t("contextMenus.task.tagPlaceholder"),confirmText:this.t("common.confirm"),cancelText:this.t("common.cancel"),onInputReady:o=>{new hm(t.app,o,t)}}),i=rE(a);if(i.length===0)return;let s=n==="add"?OI(e.tags,i):nE(e.tags,i);await this.updateTaskTags(e,t,s)}async updateTaskTags(e,t,n){var a,i;try{let s=await t.updateTaskProperty(e,"tags",n);Object.assign(e,s),(i=(a=this.options).onUpdate)==null||i.call(a)}catch(s){Sr.error("Failed to update task tags:",{category:"validation",operation:"update-task-tags",error:s}),new Le.Notice(this.t("contextMenus.task.notices.updateTagsFailed"))}}async openProjectSelector(e,t){try{new Ao(t.app,t,a=>{a&&this.addTaskToProject(e,t,a)}).open()}catch(n){Sr.error("Failed to open project selector:",{category:"persistence",operation:"open-project-selector",error:n}),new Le.Notice(this.t("contextMenus.task.organization.notices.projectSelectFailed"))}}async openSubtaskAssignmentSelector(e,t){try{let a=(await t.cacheManager.getAllTasks()).filter(i=>i.path!==e.path);if(a.length===0){new Le.Notice(this.t("contextMenus.task.organization.notices.noEligibleSubtasks"));return}Fn(t,a,i=>{i&&this.assignTaskAsSubtask(e,t,i)})}catch(n){Sr.error("Failed to open subtask assignment selector:",{category:"persistence",operation:"open-subtask-assignment-selector",error:n}),new Le.Notice(this.t("contextMenus.task.organization.notices.subtaskSelectFailed"))}}async addTaskToProject(e,t,n){var a,i;try{if(!(n instanceof Le.TFile)){new Le.Notice(this.t("contextMenus.task.organization.notices.projectSelectFailed"));return}let s=await Nk(t,e,n);s&&(Object.assign(e,s),(i=(a=this.options).onUpdate)==null||i.call(a))}catch(s){Sr.error("Failed to add task to project:",{category:"persistence",operation:"add-task-project",error:s}),new Le.Notice(this.t("contextMenus.task.organization.notices.addToProjectFailed"))}}async assignTaskAsSubtask(e,t,n){var a,i;try{let s=t.app.vault.getAbstractFileByPath(e.path);if(!(s instanceof Le.TFile)){new Le.Notice(this.t("contextMenus.task.organization.notices.currentTaskNotFound"));return}let o=await tN(t,s,n);o&&(Object.assign(n,o),(i=(a=this.options).onUpdate)==null||i.call(a))}catch(s){Sr.error("Failed to assign task as subtask:",{category:"persistence",operation:"assign-task-as-subtask",error:s}),new Le.Notice(this.t("contextMenus.task.organization.notices.addAsSubtaskFailed"))}}buildProjectReference(e,t,n){return Ws(n.app,e,t,"","",n.settings.useFrontmatterMarkdownLinks)}updateMainMenuIconColors(e,t){let n=this.targetDoc.querySelector(".menu");if(!n)return;let a=n.querySelectorAll(".menu-item"),i=this.t("contextMenus.task.status"),s=this.t("contextMenus.task.priority");a.forEach(o=>{let l=o.querySelector(".menu-item-title"),c=o.querySelector(".menu-item-icon");if(l&&c){let d=l.textContent;if(d===i){let u=t.settings.customStatuses.find(p=>p.value===e.status);u&&u.color&&(c.style.color=u.color)}else if(d===s){let u=t.settings.customPriorities.find(p=>p.value===e.priority);u&&u.color&&(c.style.color=u.color)}}})}addStatusOptions(e,t,n){this.getStatusOptions(t,n).forEach((i,s)=>{e.addItem(o=>{let l=Vk(i.label,i.value),c=l;o.setIcon(i.icon||"circle"),i.value===t.status&&(c=this.t("contextMenus.task.statusSelected",{label:l})),o.setTitle(c),o.onClick(async()=>{var u,p;try{await n.updateTaskProperty(t,"status",i.value),(p=(u=this.options).onUpdate)==null||p.call(u)}catch(m){let f=m instanceof Error?m.message:String(m);Sr.error("Error updating task status:",{category:"persistence",operation:"updating-task-status",details:{taskPath:t.path},error:f}),new Le.Notice(`Failed to update task status: ${f}`)}});let d=i.color;d&&window.setTimeout(()=>{let u=ZTe(o);if(u){let p=u.querySelector(".menu-item-icon");p&&(p.style.color=d)}},10)})})}addPriorityOptions(e,t,n){n.priorityManager.getPrioritiesByWeight().forEach(i=>{let s=Vk(i.value);if(!s)return;let o=Vk(i.label,s);e.addItem(l=>{let c=o;l.setIcon("star"),s===t.priority&&(c=this.t("contextMenus.task.prioritySelected",{label:o})),l.setTitle(c),l.onClick(async()=>{var d,u;try{await n.updateTaskProperty(t,"priority",s),(u=(d=this.options).onUpdate)==null||u.call(d)}catch(p){let m=p instanceof Error?p.message:String(p);Sr.error("Error updating task priority:",{category:"persistence",operation:"updating-task-priority",details:{taskPath:t.path},error:m}),new Le.Notice(`Failed to update task priority: ${m}`)}}),i.color&&window.setTimeout(()=>{let d=ZTe(l);if(d){let u=d.querySelector(".menu-item-icon");u&&(u.style.color=i.color)}},10)})})}addDateOptions(e,t,n,a,i={}){let o=new Bl({currentValue:t,onSelect:u=>{n(u)},onCustomDate:a,plugin:this.options.plugin,app:this.options.plugin.app}).getDateOptions(),l=o.filter(u=>u.category==="increment");l.length>0&&(l.forEach(u=>{e.addItem(p=>{u.icon&&p.setIcon(u.icon),p.setTitle(u.label),p.onClick(()=>{n(u.value)})})}),e.addSeparator()),o.filter(u=>u.category==="basic").forEach(u=>{e.addItem(p=>{u.icon&&p.setIcon(u.icon);let f=u.value===t?this.t("contextMenus.date.selected",{label:u.label}):u.label;p.setTitle(f),p.onClick(()=>{n(u.value)})})});let d=o.filter(u=>u.category==="weekday");d.length>0&&(e.addSeparator(),e.addItem(u=>{u.setTitle(this.t("contextMenus.date.weekdaysLabel")),u.setIcon("calendar");let p=fa(u);d.forEach(m=>{p.addItem(f=>{let g=m.value===t?this.t("contextMenus.date.selected",{label:m.label}):m.label;f.setTitle(g),f.setIcon("calendar"),f.onClick(()=>{n(m.value)})})})})),e.addSeparator(),e.addItem(u=>{var p;u.setTitle((p=i.pickDateTitle)!=null?p:this.t("contextMenus.date.pickDateTime")),u.setIcon("calendar"),u.onClick(a)}),t&&e.addItem(u=>{u.setTitle(this.t("contextMenus.date.clearDate")),u.setIcon("x"),u.onClick(()=>{n(null)})})}addCustomDateFieldMenuItems(e,t){let n=this.getCustomDateFields(t);n.length!==0&&this.menu.addItem(a=>{a.setTitle(this.t("contextMenus.task.customDates")),a.setIcon("calendar-days");let i=fa(a);n.forEach(s=>{i.addItem(o=>{let l=this.getCustomFieldLabel(s);o.setTitle(l),o.setIcon("calendar");let c=fa(o),d=this.getCustomDateFieldValue(e,s);this.addDateOptions(c,d,async u=>{await this.updateCustomDateField(e,t,s,u)},()=>{this.openCustomDateFieldPicker(e,t,s,d)},{pickDateTitle:this.t("modals.task.userFields.pickDate",{field:l})})})})})}getCustomDateFields(e){return(e.settings.userFields||[]).filter(t=>t.type==="date"&&t.key.trim().length>0)}getCustomFieldLabel(e){return e.displayName.trim()||e.key||e.id}getCustomDateFieldValue(e,t){var i,s;let a=(s=e[t.key])!=null?s:(i=e.customProperties)==null?void 0:i[t.key];return typeof a=="string"&&a.trim().length>0?a:void 0}openCustomDateFieldPicker(e,t,n,a){this.menu.hide();let i=this.getCustomFieldLabel(n);new $l(t.app,{currentDate:a||null,title:this.t("modals.task.userFields.pickDate",{field:i}),showTime:!1,plugin:t,onSelect:o=>{this.updateCustomDateField(e,t,n,o)}}).open()}async updateCustomDateField(e,t,n,a){var s,o;let i=this.getCustomFieldLabel(n);try{let l=await t.updateTaskProperty(e,n.key,a||void 0);Object.assign(e,l),(o=(s=this.options).onUpdate)==null||o.call(s)}catch(l){let c=l instanceof Error?l.message:String(l);Sr.error("Error updating custom date field:",{category:"persistence",operation:"updating-custom-date-field",details:{taskPath:e.path,field:n.key},error:c}),new Le.Notice(this.t("contextMenus.task.notices.updateCustomDateFailure",{field:i,message:c}))}}addRecurrenceOptions(e,t,n,a){let i=new Date,s=["SU","MO","TU","WE","TH","FR","SA"],o=[a.i18n.translate("common.months.january"),a.i18n.translate("common.months.february"),a.i18n.translate("common.months.march"),a.i18n.translate("common.months.april"),a.i18n.translate("common.months.may"),a.i18n.translate("common.months.june"),a.i18n.translate("common.months.july"),a.i18n.translate("common.months.august"),a.i18n.translate("common.months.september"),a.i18n.translate("common.months.october"),a.i18n.translate("common.months.november"),a.i18n.translate("common.months.december")],l=s[i.getDay()],c=i.getDate(),d=i.getMonth()+1,u=o[i.getMonth()],p=pE(a),m=i.toLocaleDateString(p||void 0,{weekday:"long"}),f=b=>{let k=b.getFullYear(),w=String(b.getMonth()+1).padStart(2,"0"),S=String(b.getDate()).padStart(2,"0");return`${k}${w}${S}`},h=b=>{let k=["th","st","nd","rd"],w=b%100;return b+(k[(w-20)%10]||k[w]||k[0])},g=f(i);[{label:this.t("modals.task.recurrence.daily"),value:`DTSTART:${g};FREQ=DAILY;INTERVAL=1`,icon:"calendar-days"},{label:this.t("modals.task.recurrence.weeklyOn",{days:m}),value:`DTSTART:${g};FREQ=WEEKLY;INTERVAL=1;BYDAY=${l}`,icon:"calendar"},{label:this.t("modals.task.recurrence.everyTwoWeeks"),value:`DTSTART:${g};FREQ=WEEKLY;INTERVAL=2;BYDAY=${l}`,icon:"calendar"},{label:this.t("modals.task.recurrence.monthlyOnOrdinal",{ordinal:h(c)}),value:`DTSTART:${g};FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=${c}`,icon:"calendar-range"},{label:this.t("modals.task.recurrence.everyThreeMonths"),value:`DTSTART:${g};FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=${c}`,icon:"calendar-range"},{label:this.t("modals.task.recurrence.yearlyOn",{month:u,day:h(c)}),value:`DTSTART:${g};FREQ=YEARLY;INTERVAL=1;BYMONTH=${d};BYMONTHDAY=${c}`,icon:"calendar-clock"},{label:this.t("modals.task.recurrence.weekdays"),value:GI(g,p),icon:"briefcase"}].forEach(b=>{e.addItem(k=>{let w=b.value===t;k.setTitle(w?`\u2713 ${b.label}`:b.label),k.setIcon(b.icon),k.onClick(()=>{n(b.value)})})}),e.addSeparator(),e.addItem(b=>{b.setTitle(this.t("contextMenus.task.customRecurrence")),b.setIcon("settings"),b.onClick(()=>{new Vl({currentValue:typeof t=="string"?t:void 0,currentAnchor:this.options.task.recurrence_anchor||"scheduled",scheduledDate:this.options.task.scheduled,onSelect:w=>{n(w)},app:a.app,plugin:a}).showCustomRecurrenceModal()})}),t&&e.addItem(b=>{b.setTitle(this.t("contextMenus.task.clearRecurrence")),b.setIcon("x"),b.onClick(()=>{n(null)})})}addOccurrencePolicyOptions(e,t,n){let a=t.occurrence_materialization||"manual",i=t.occurrence_next_trigger||"completion";e.addSeparator(),e.addItem(s=>{s.setTitle("Occurrence notes"),s.setIcon("files");let o=fa(s),l=(d,u,p)=>{o.addItem(m=>{m.setTitle(a===d?`\u2713 ${u}`:u),m.setIcon(p),m.onClick(async()=>{await this.updateOccurrenceMaterializationPolicy(t,n,d)})})};if(l("manual","Create manually","file-plus"),l("on_completion","Create next after completion","check-circle"),o.addItem(d=>{d.setTitle(a==="rolling"?"\u2713 Rolling window (not automated yet)":"Rolling window (not automated yet)"),d.setIcon("calendar-range"),d.setDisabled(!0)}),a!=="on_completion")return;o.addSeparator(),[{value:"completion",label:"Completion only",icon:"check"},{value:"completion_or_skip",label:"Completion or skip",icon:"check-check"}].forEach(d=>{o.addItem(u=>{u.setTitle(i===d.value?`\u2713 ${d.label}`:d.label),u.setIcon(d.icon),u.onClick(async()=>{await this.updateOccurrenceNextTrigger(t,n,d.value)})})})})}async updateOccurrenceMaterializationPolicy(e,t,n){var a,i;try{let s=await t.updateTaskProperty(e,"occurrence_materialization",n==="manual"?void 0:n);if(Object.assign(e,s),n!=="on_completion"&&e.occurrence_next_trigger){let o=await t.updateTaskProperty(e,"occurrence_next_trigger",void 0);Object.assign(e,o)}(i=(a=this.options).onUpdate)==null||i.call(a),new Le.Notice(n==="manual"?"Occurrence notes set to manual creation":"Occurrence notes will be created after completion")}catch(s){let o=s instanceof Error?s.message:String(s);Sr.error("Error updating occurrence materialization policy:",{category:"persistence",operation:"updating-occurrence-materialization-policy",details:{taskPath:e.path,mode:n},error:o}),new Le.Notice(`Failed to update occurrence notes setting: ${o}`)}}async updateOccurrenceNextTrigger(e,t,n){var a,i;try{let s=await t.updateTaskProperty(e,"occurrence_next_trigger",n==="completion"?void 0:n);Object.assign(e,s),(i=(a=this.options).onUpdate)==null||i.call(a),new Le.Notice(n==="completion"?"Next occurrence note will be created after completion":"Next occurrence note will be created after completion or skip")}catch(s){let o=s instanceof Error?s.message:String(s);Sr.error("Error updating occurrence next trigger:",{category:"persistence",operation:"updating-occurrence-next-trigger",details:{taskPath:e.path,trigger:n},error:o}),new Le.Notice(`Failed to update occurrence trigger: ${o}`)}}getStatusOptions(e,t){let n=t.settings.customStatuses,a=[];return n&&n.length>0&&[...n].sort((s,o)=>s.order-o.order).forEach(s=>{let o=Vk(s.value);o&&a.push({label:Vk(s.label,o),value:o,color:typeof s.color=="string"?s.color:void 0,icon:typeof s.icon=="string"?s.icon:void 0})}),a}addQuickRemindersSection(e,t,n,a,i){if(!(a==="due"?t.due:t.scheduled)){e.addItem(o=>{o.setTitle(i),o.setIcon("bell"),o.setDisabled(!0)});return}e.addItem(o=>{o.setTitle(i),o.setIcon("bell");let l=fa(o);[{labelKey:"contextMenus.task.quickReminders.atTime",offset:"PT0M"},{labelKey:"contextMenus.task.quickReminders.fiveMinutes",offset:"-PT5M"},{labelKey:"contextMenus.task.quickReminders.fifteenMinutes",offset:"-PT15M"},{labelKey:"contextMenus.task.quickReminders.oneHour",offset:"-PT1H"},{labelKey:"contextMenus.task.quickReminders.oneDay",offset:"-P1D"}].forEach(d=>{l.addItem(u=>{let p=this.t(d.labelKey);u.setTitle(p),u.onClick(()=>{this.addQuickReminder(t,n,a,d.offset,p)})})})})}async addQuickReminder(e,t,n,a,i){var l,c;let s={id:`rem_${Date.now()}`,type:"relative",relatedTo:n,offset:a,description:i},o=[...e.reminders||[],s];try{await t.updateTaskProperty(e,"reminders",o),(c=(l=this.options).onUpdate)==null||c.call(l)}catch(d){Sr.error("Error adding reminder:",{category:"persistence",operation:"adding-reminder",error:d}),new Le.Notice("Failed to add reminder")}}show(e){var t,n;(n=(t=e.target)==null?void 0:t.instanceOf)!=null&&n.call(t,HTMLElement)&&(this.targetDoc=e.target.ownerDocument),this.menu.showAtMouseEvent(e)}showAtElement(e){this.targetDoc=e.ownerDocument,this.menu.showAtPosition({x:e.getBoundingClientRect().left,y:e.getBoundingClientRect().bottom+4})}}});function est(r,e,t){return r.i18n.translate(`ui.taskCard.${e}`,t)}function tst(r){return N({tag:"TaskCard/ContextMenu",isDebugEnabled:()=>r.settings.enableDebugLogging})}function JTe(r){let{mainRow:e,taskPath:t,plugin:n,targetDate:a,promoteOccurrenceControls:i}=r,s=est(n,"taskOptions"),o=e.createDiv({cls:"task-card__context-menu",attr:{"aria-label":s}});return(0,Kc.setIcon)(o,"ellipsis-vertical"),(0,Kc.setTooltip)(o,s,{placement:"top"}),Hl(o),o.addEventListener("click",l=>{if(l.stopPropagation(),l.preventDefault(),i===void 0){qo(l,t,n,a);return}qo(l,t,n,a,{promoteOccurrenceControls:i})}),o}async function qo(r,e,t,n,a={}){let i=t.app.vault.getAbstractFileByPath(e),s=()=>{i instanceof Kc.TFile&&rst(r,i,t)};try{let o=await t.cacheManager.getTaskInfo(e);if(!o){s();return}new Yl({task:o,plugin:t,targetDate:n,occurrenceDate:a.occurrenceDate,promoteOccurrenceControls:a.promoteOccurrenceControls,onUpdate:()=>{t.app.workspace.trigger("tasknotes:refresh-views")}}).show(r)}catch(o){let l=o instanceof Error?o.message:String(o);tst(t).error("Error creating context menu",{category:"internal",operation:"create-context-menu",details:{taskPath:e,errorMessage:l},error:o}),new Kc.Notice(`Failed to create context menu: ${l}`),s()}}function rst(r,e,t){var i,s;let n=new Kc.Menu,a=!1;try{t.app.workspace.trigger("file-menu",n,e,"tasknotes-bases-view"),a=((s=(i=n.items)==null?void 0:i.length)!=null?s:0)>0}catch(o){a=!1}a||(n.addItem(o=>{o.setTitle("Open"),o.setIcon("file-text"),o.onClick(()=>{t.app.workspace.getLeaf(!1).openFile(e)})}),n.addItem(o=>{o.setTitle("Open in new tab"),o.setIcon("external-link"),o.onClick(()=>{t.app.workspace.openLinkText(e.path,"",!0)})})),n.showAtMouseEvent(r)}var Kc,Cq=y(()=>{Kc=require("obsidian");TE();K();cE()});function nst(r,e){return J(e).trim()||J(r.title)}function XTe(r,e,t,n){r.empty();let a={metadataCache:t.app.metadataCache,workspace:t.app.workspace,sourcePath:e.path};Uc(r,nst(e,n),a)}function Eq(r,e){let t=r.querySelector(".task-card__title"),n=r.querySelector(".task-card__title-text");t==null||t.classList.toggle("completed",e),n==null||n.classList.toggle("completed",e)}function ewe(r){let{contentContainer:e,layout:t,task:n,plugin:a,displayText:i,isCompleted:s=!1}=r,o=e.createEl(t==="inline"?"span":"div",{cls:"task-card__title"}),l=o.createSpan({cls:"task-card__title-text"});return XTe(l,n,a,i),o.classList.toggle("completed",s),l.classList.toggle("completed",s),{titleEl:o,titleTextEl:l}}function twe(r){let{card:e,task:t,plugin:n,displayText:a,isCompleted:i=!1}=r,s=e.querySelector(".task-card__title-text");s&&XTe(s,t,n,a),Eq(e,i)}var Dq=y(()=>{kr();vm()});function ast(r,e,t,n,a){var o;r.classList.toggle("task-card--completed",n),r.classList.toggle("task-card--completed-strikethrough",n&&tq(t)),r.classList.toggle("task-card--archived",!!e.archived),r.classList.toggle("task-card--actively-tracked",t.getActiveTimeSession(e)!==null),r.classList.toggle("task-card--recurring",!!e.recurrence),r.classList.toggle("task-card--chevron-left",((o=t.settings)==null?void 0:o.subtaskChevronPosition)==="left");let i=eq(e,t);r.classList.toggle("task-card--has-details",i),r.dataset.hasDetails=i?"true":"false",Pq(r,"task-card--priority-"),e.priority&&r.classList.add(`task-card--priority-${Cu(e.priority)}`),Pq(r,"task-card--status-"),a&&r.classList.add(`task-card--status-${Cu(a)}`),Pq(r,"task-card--project-");let s=rq(e);r.classList.toggle("task-card--has-projects",s.length>0),s.forEach(l=>r.classList.add(l)),r.dataset.status=a,Eq(r,n)}function Mq({card:r,statusDot:e,plugin:t,updatedTask:n,effectiveStatus:a,isCompleted:i}){XI(e,t.statusManager.getStatusConfig(a)),JI(r,a,t);let s=r.querySelector(".task-card__checkbox");s&&(s.checked=i),ast(r,n,t,i,a)}function Pq(r,e){for(let t of Array.from(r.classList))t.startsWith(e)&&r.classList.remove(t)}var rwe=y(()=>{Ct();aq();XV();Dq()});async function nwe(r,e){return new Promise((t,n)=>{new Aq(e.app,r,async()=>{try{await e.taskService.deleteTask(r),t()}catch(i){n(i instanceof Error?i:new Error(String(i)))}}).open()})}var wE,ist,Aq,awe=y(()=>{wE=require("obsidian");K();ist=N({tag:"Ui/TaskCardDeletion"}),Aq=class extends wE.Modal{constructor(e,t,n){super(e),this.task=t,this.onConfirm=n}onOpen(){let{contentEl:e}=this;e.empty(),e.createEl("h2",{text:"Delete task"});let t=e.createEl("p");t.appendText('Are you sure you want to delete the task "'),t.createEl("strong",{text:this.task.title}),t.appendText('"?'),e.createEl("p",{cls:"mod-warning",text:"This action cannot be undone. The task file will be permanently deleted."});let n=e.createDiv({cls:"modal-button-container"});n.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),n.classList.add("tn-static-display-flex-75816cae"),n.classList.remove("tn-static-display-flex-8bb39979","tn-static-gap-0-5rem-ce2fca4d","tn-static-gap-12px-ed7b3d87","tn-static-gap-6px-f0abc1db","tn-static-gap-8px-33fcd4c3"),n.classList.add("tn-static-gap-10px-f3d7ce77"),n.classList.remove("tn-static-justify-content-center-03c4bb6f","tn-static-justify-content-space-between-a562f4fd"),n.classList.add("tn-static-justify-content-flex-end-455f8cca"),n.classList.remove("tn-static-font-size-12px-b0cc7e05","tn-static-margin-top-0-5rem-3dc98b5e","tn-static-margin-top-0-d462248a","tn-static-margin-top-12px-91e0f558","tn-static-margin-top-16px-1b0f4999","tn-static-margin-top-1rem-2239d6d5","tn-static-margin-top-30px-2fbbbcd4","tn-static-margin-top-4px-96ad6099","tn-static-margin-top-8px-8a77e5a3","tn-static-margin-top-8px-f4f01e68"),n.classList.add("tn-static-margin-top-20px-a26bda7d");let a=n.createEl("button",{text:"Cancel"});a.addEventListener("click",()=>{this.close()});let i=n.createEl("button",{text:"Delete",cls:"mod-warning"});i.classList.remove("tn-static-background-color-var-background-mo-94b219f0","tn-static-background-color-var-background-se-9087a23e","tn-static-background-color-var-color-base-40-ef5f175e","tn-static-background-color-var-text-accent-a954c70f"),i.classList.add("tn-static-background-color-var-color-red-134bc721"),i.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-muted-5872de20","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),i.classList.add("tn-static-color-white-0a43e56a"),i.addEventListener("click",()=>{(async()=>{try{await this.onConfirm(),this.close(),new wE.Notice("Task deleted successfully")}catch(s){let o=s instanceof Error?s.message:String(s);new wE.Notice(`Failed to delete task: ${o}`),ist.error("Error in delete confirmation:",{category:"persistence",operation:"delete-confirmation",error:s})}})()}),a.focus()}onClose(){let{contentEl:e}=this;e.empty()}}});var qk={};at(qk,{DEFAULT_TASK_CARD_OPTIONS:()=>_q,cleanupTaskCard:()=>lst,createTaskCard:()=>Dr,refreshParentTaskSubtasks:()=>cst,showDeleteConfirmationModal:()=>nwe,showTaskContextMenu:()=>qo,toggleBlockedByTasks:()=>lwe,toggleBlockingTasks:()=>owe,toggleSubtasks:()=>swe,updateTaskCard:()=>ost});function sst(r){var e;return(e=r._taskCardOptions)!=null?e:{}}function hN(r){return{plugin:r,getRelationshipOptions:sst,renderTaskCard:(e,t)=>Dr(e,r,void 0,t)}}function iwe(r){return{toggleSubtasks:(e,t,n)=>swe(e,t,r,n),toggleBlockingTasks:(e,t,n)=>owe(e,t,r,n),toggleBlockedByTasks:(e,t,n)=>lwe(e,t,r,n)}}function Dr(r,e,t,n={}){let a={..._q,...n},i=nq(r,e,a),{targetDate:s,effectiveStatus:o,layout:l,isCompleted:c,hasDetails:d}=i,u=activeWindow.createEl(l==="inline"?"span":"div"),p=u;p._taskPath=r.path,p._taskCardOptions=a,u.className=i.cardClasses.join(" "),u.dataset.taskPath=r.path,u.dataset.key=r.path,u.dataset.status=o,r.priority?u.dataset.priority=r.priority:delete u.dataset.priority,u.dataset.hasDetails=d?"true":"false";let m=u.createEl(l==="inline"?"span":"div",{cls:"task-card__main-row"});ZV(u,r,e),QV({mainRow:m,card:u,task:r,plugin:e,effectiveStatus:o,visibleProperties:t,hideStatusIndicator:a.hideStatusIndicator,onClick:RV({task:r,plugin:e,targetDate:s,updateStatusVisuals:(C,E,D)=>{let P=u.querySelector(".task-card__status-dot");P&&Mq({card:u,statusDot:P,plugin:e,updatedTask:C,effectiveStatus:E,isCompleted:D})}})}),JV({mainRow:m,task:r,plugin:e,visibleProperties:t,onClick:FV(r,e)});let f=m.createEl(l==="inline"?"span":"div",{cls:"task-card__content"}),h=l!=="inline"?m.createDiv({cls:"task-card__badges"}):null,g=iwe(e);bTe({card:u,badgesContainer:h,task:r,plugin:e,hasDetails:d,propertyOptions:a,handlers:g}),JTe({mainRow:m,taskPath:r.path,plugin:e,targetDate:s,promoteOccurrenceControls:a.promoteOccurrenceControlsInContextMenu}),ewe({contentContainer:f,layout:l,task:r,plugin:e,displayText:a.displayText,isCompleted:c});let v=f.createEl(l==="inline"?"span":"div",{cls:"task-card__metadata"});GV({metadataLine:v,card:u,task:r,plugin:e,visibleProperties:t,propertyOptions:a,handlers:g});let{clickHandler:b,auxclickHandler:k,dblclickHandler:w,contextmenuHandler:S}=zfe({task:r,plugin:e,contextMenuHandler:C=>{let E=u.dataset.taskPath;if(E){if(a.promoteOccurrenceControlsInContextMenu===void 0){qo(C,E,e,s);return}qo(C,E,e,s,{promoteOccurrenceControls:a.promoteOccurrenceControlsInContextMenu})}},createBatchContextMenu:(C,E)=>new xk({plugin:e,selectedPaths:C,onUpdate:E})});return u.addEventListener("click",b),u.addEventListener("auxclick",k),u.addEventListener("dblclick",w),u.addEventListener("contextmenu",S),a.enableHoverPreview&&u.addEventListener("mouseover",jfe(r,e)),u}function ost(r,e,t,n,a={}){let i={..._q,...a},s=nq(e,t,i),{targetDate:o,effectiveStatus:l,isCompleted:c,hasDetails:d}=s;r.className=s.cardClasses.join(" "),r.dataset.status=l,e.priority?r.dataset.priority=e.priority:delete r.dataset.priority,r.dataset.hasDetails=d?"true":"false";let u=r.querySelector(".task-card__main-row");ZV(r,e,t);let p=r.querySelector(".task-card__checkbox");p&&(p.checked=t.statusManager.isCompletedStatus(l)),ETe({mainRow:u,card:r,task:e,plugin:t,effectiveStatus:l,visibleProperties:n,hideStatusIndicator:i.hideStatusIndicator,onClick:RV({task:e,plugin:t,targetDate:o,updateStatusVisuals:(g,v,b)=>{let k=r.querySelector(".task-card__status-dot");k&&Mq({card:r,statusDot:k,plugin:t,updatedTask:g,effectiveStatus:v,isCompleted:b})}})}),PTe({mainRow:u,task:e,plugin:t,visibleProperties:n,onClick:FV(e,t)});let m=iwe(t);TTe({card:r,mainRow:u,task:e,plugin:t,hasDetails:d,propertyOptions:i,handlers:m}),twe({card:r,task:e,plugin:t,displayText:i.displayText,isCompleted:c});let f=r.querySelector(".task-card__badge--blocked");f&&f.remove();let h=r.querySelector(".task-card__metadata");h&&GV({metadataLine:h,card:r,task:e,plugin:t,visibleProperties:n,propertyOptions:i,handlers:m})}function lst(r){dTe(r)}async function swe(r,e,t,n){await UV(hN(t),r,e,n)}async function owe(r,e,t,n){await pTe(hN(t),r,e,n)}async function lwe(r,e,t,n){await mTe(hN(t),r,e,n)}async function cst(r,e,t){await fTe(hN(e),r,t)}var _q,mi=y(()=>{nU();vV();wTe();HV();zV();XV();aq();YV();Cq();Dq();rwe();awe();Cq();_q={layout:"default",showSecondaryBadges:!0,enableHoverPreview:!0}});function Iq({plugin:r,sourcePath:e},t){return{dependency:{uid:_o(r.app,e,t.path,r.settings.useFrontmatterMarkdownLinks),reltype:ss},path:t.path,name:t.basename}}function cwe({plugin:r,sourcePath:e},t){var s;let n=os(t);if(!n){let o=typeof t=="object"&&t&&"uid"in t&&typeof t.uid=="string"?t.uid:J(t);return{dependency:{uid:o,reltype:ss},name:o,unresolved:!0}}let a=Ol(r.app,e,n);if(a){let o=((s=a.file)==null?void 0:s.basename)||a.path.split("/").pop()||n.uid;return{dependency:n,path:a.path,name:o}}let i=n.uid.replace(/^\[\[/,"").replace(/\]\]$/,"");return{dependency:n,name:i||t.uid,unresolved:!0}}function dwe({plugin:r,sourcePath:e},t){let n=r.app.vault.getAbstractFileByPath(t);if(n instanceof SE.TFile)return Iq({plugin:r,sourcePath:e},n);let i=(t.split("/").pop()||t).replace(/\.md$/i,"");return{dependency:{uid:`[[${i}]]`,reltype:ss},path:t,name:i,unresolved:!0}}function dst(r,e){return r.some(t=>t.dependency.uid===e.dependency.uid||!!e.path&&t.path===e.path)}function Nq(r,e){return dst(r,e)?[...r]:[...r,e]}function Rq(r,e){return r.filter((t,n)=>n!==e)}async function uwe({plugin:r,listEl:e,items:t,linkServices:n,translate:a,onRemove:i}){if(e&&(e.empty(),t.length!==0))for(let[s,o]of t.entries()){let l=!!(o.path&&!o.unresolved),c=e.createDiv({cls:l?"task-project-item task-project-item--task-card":"task-project-item"});o.unresolved&&(c.addClass("task-project-item--unresolved"),(0,SE.setTooltip)(c,a("contextMenus.task.dependencies.notices.unresolved",{entries:o.dependency.uid}),{placement:"top"}));let d=c.createDiv({cls:l?"task-project-card-host":"task-project-info"});o.path&&!o.unresolved?await ust(r,d,o,n):pst(d,o);let u=c.createEl("button",{cls:"task-project-remove",text:"\xD7"});(0,SE.setTooltip)(u,a("modals.task.dependencies.removeTaskTooltip"),{placement:"top"}),u.addEventListener("click",p=>{p.preventDefault(),p.stopPropagation(),i(s)})}}async function ust(r,e,t,n){if(!t.path)return;let a=await r.cacheManager.getCachedTaskInfo(t.path);if(a){let s=Dr(a,r,void 0,{layout:"default",showSecondaryBadges:!1,enableHoverPreview:!1});e.appendChild(s);return}let i=e.createSpan({cls:"task-project-name clickable-dependency"});Ul(i,t.path,t.name,n,{cssClass:"task-dependency-link internal-link",hoverSource:"tasknotes-dependency-link",showErrorNotices:!0}),t.path!==t.name&&e.createDiv({cls:"task-project-path",text:t.path})}function pst(r,e){var a;let t=r.createSpan({cls:"task-project-name"});t.textContent=e.name;let n=(a=e.path)!=null?a:e.dependency.uid;r.createDiv({cls:"task-project-path",text:n})}function pwe(r,e,t){return _o(r.app,e,t.path,r.settings.useFrontmatterMarkdownLinks)}function mwe({plugin:r,sourcePath:e,allTasks:t,existingItems:n,currentPath:a}){let i=new Set(n.map(s=>s.dependency.uid));return t.filter(s=>{if(a&&s.path===a)return!1;let o=pwe(r,e,s);return!i.has(o)})}function fwe({plugin:r,sourcePath:e,allTasks:t,existingItems:n,currentPath:a}){let i=new Set(n.map(o=>o.path).filter(o=>typeof o=="string")),s=new Set(n.map(o=>o.dependency.uid));return t.filter(o=>{if(a&&o.path===a||i.has(o.path))return!1;let l=pwe(r,e,o);return!s.has(l)})}var SE,hwe=y(()=>{SE=require("obsidian");Io();vm();mi();kr()});function mst(r){return parseInt(r)||0}function gwe(r,e){let t=null,n=new gN.Setting(e.container);if(n.settingEl.addClass("tn-task-modal__wide-text-setting"),n.setName(r.translate("modals.task.contextsLabel")).addText(a=>{a.setPlaceholder(r.translate("modals.task.contextsPlaceholder")).setValue(e.value).onChange(e.onChange),t=a.inputEl,r.attachMobileKeyboardScrollGuard(a.inputEl),new II(r.app,a.inputEl,r.plugin)}),!t)throw new Error("Failed to create contexts input");return t}function ywe(r,e){let t=null,n=new gN.Setting(e.container);if(n.settingEl.addClass("tn-task-modal__wide-text-setting"),n.setName(r.translate("modals.task.tagsLabel")).addText(a=>{a.setPlaceholder(r.translate("modals.task.tagsPlaceholder")).setValue(e.value).onChange(i=>{e.onChange(za(i))}),t=a.inputEl,r.attachMobileKeyboardScrollGuard(a.inputEl),new hm(r.app,a.inputEl,r.plugin)}),!t)throw new Error("Failed to create tags input");return t}function vwe(r,e){let t=null;if(new gN.Setting(e.container).setName(r.translate("modals.task.timeEstimateLabel")).addText(n=>{n.setPlaceholder(r.translate("modals.task.timeEstimatePlaceholder")).setValue(e.value.toString()).onChange(a=>{e.onChange(mst(a))}),t=n.inputEl,r.attachMobileKeyboardScrollGuard(n.inputEl)}),!t)throw new Error("Failed to create time estimate input");return t}var gN,kwe=y(()=>{gN=require("obsidian");Ct();tE()});function Dm(r){return r==null?"":typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(r):Array.isArray(r)?r.map(Dm).join(", "):""}function Twe(r){return Array.isArray(r)?r.map(Dm).join(", "):Dm(r)}function Fq(r){return r.split(",").map(e=>e.trim()).filter(e=>e.length>0)}function wwe(r){let e=Fq(r);return e.length>0?e:null}function Oq(r){let e=parseFloat(r);return isNaN(e)?null:e}function yN(r){return r||null}function Lq(r){return r===!0||r==="true"}function Swe(r){let e={};for(let[t,n]of Object.entries(r))n!=null&&n!==""&&(e[t]=n);return e}function xwe(r,e,t){let n={};for(let a of t){if(!(a!=null&&a.key))continue;let i=r[a.key],s=e[a.key];fst(i,s)&&(n[a.key]=i==null||i===""?null:i)}return n}function fst(r,e){let t=bwe(r),n=bwe(e);return Array.isArray(t)||Array.isArray(n)?JSON.stringify(t)!==JSON.stringify(n):t!==n}function bwe(r){return r==null||r===""?null:r}var vN=y(()=>{});function Cwe(r,e){let{container:t,field:n,values:a,inputRefs:i,toggleRefs:s,onValueChange:o}=e,l=new Hu.Setting(t).setName(n.displayName);switch(n.type){case"text":case"list":{l.addText(c=>{let d=a[n.key],u=Array.isArray(d)?d.map(Dm).join(", "):Dm(d);c.setValue(u).onChange(p=>{o(n.key,n.type==="list"?Fq(p):p)}),pg(r,i,n,c.inputEl)});break}case"number":{l.addText(c=>{let d=a[n.key];c.setValue(Dm(d)).onChange(u=>{o(n.key,Oq(u))}),c.inputEl.type="number",pg(r,i,n,c.inputEl,{attachSuggest:!1})});break}case"date":{l.addText(c=>{let d=a[n.key];c.setValue(Dm(d)).onChange(u=>{o(n.key,u)}),c.inputEl.type="date",zc(c.inputEl,{onCommit:u=>{o(n.key,u)}}),pg(r,i,n,c.inputEl,{attachSuggest:!1})});break}case"boolean":{l.addToggle(c=>{let d=a[n.key];c.setValue(d===!0).onChange(u=>{o(n.key,u)}),s.set(n.key,c)});break}}}function Ewe(r,e){let{container:t,fields:n}=e;n.length>0&&t.createDiv({cls:"tn-task-modal__user-fields"}).createDiv({text:r.translate("modals.task.customFieldsLabel"),cls:"tn-task-modal__section-label"});for(let a of n)!a||!a.key||!a.displayName||hst(r,e,a)}function Dwe(r){for(let e of r.fields){let t=r.values[e.key],n=r.inputRefs.get(e.key);n&&(n.value=Twe(t));let a=r.toggleRefs.get(e.key);a&&a.setValue(Lq(t))}}function hst(r,e,t){let n=e.values[t.key]||"";switch(t.type){case"boolean":new Hu.Setting(e.container).setName(t.displayName).addToggle(a=>{a.setValue(Lq(n)).onChange(i=>{e.onValueChange(t.key,i)}),e.toggleRefs.set(t.key,a)});break;case"number":new Hu.Setting(e.container).setName(t.displayName).addText(a=>{a.setPlaceholder(r.translate("modals.task.userFields.numberPlaceholder")).setValue(n?J(n):"").onChange(i=>{e.onValueChange(t.key,Oq(i))}),pg(r,e.inputRefs,t,a.inputEl,{attachSuggest:!1})});break;case"date":gst(r,e,t,n);break;case"list":new Hu.Setting(e.container).setName(t.displayName).addText(a=>{var o;let i=Array.isArray(n)?n.join(", "):n?J(n):"";a.setPlaceholder(r.translate("modals.task.userFields.listPlaceholder")).setValue(i).onChange(l=>{e.onValueChange(t.key,wwe(l))}),pg(r,e.inputRefs,t,a.inputEl);let s=e.container.querySelector(".user-field-link-preview");s&&((o=s.detach)==null||o.call(s))});break;case"text":default:new Hu.Setting(e.container).setName(t.displayName).addText(a=>{a.setPlaceholder(r.translate("modals.task.userFields.textPlaceholder",{field:t.displayName})).setValue(n?J(n):"").onChange(i=>{e.onValueChange(t.key,yN(i))}),pg(r,e.inputRefs,t,a.inputEl)});break}}function gst(r,e,t,n){new Hu.Setting(e.container).setName(t.displayName).addText(a=>{a.setPlaceholder(r.translate("modals.task.userFields.datePlaceholder")).setValue(n?J(n):"").onChange(o=>{e.onValueChange(t.key,yN(o))}),pg(r,e.inputRefs,t,a.inputEl,{attachSuggest:!1});let i=a.inputEl.parentElement;i&&i.addClass("tn-date-control"),zc(a.inputEl,{onCommit:o=>{e.onValueChange(t.key,o)}});let s=i==null?void 0:i.createEl("button",{cls:"user-field-date-picker-btn"});s&&(s.setAttribute("aria-label",r.translate("modals.task.userFields.pickDate",{field:t.displayName})),(0,Hu.setIcon)(s,"calendar"),s.addEventListener("click",o=>{o.preventDefault(),new $l(r.app,{currentDate:yst(a)||null,title:r.translate("modals.task.userFields.pickDate",{field:t.displayName}),showTime:!1,plugin:r.plugin,onSelect:c=>{a.setValue(c||""),e.onValueChange(t.key,yN(c))}}).open()}))})}function pg(r,e,t,n,a={}){e.set(t.key,n),r.attachMobileKeyboardScrollGuard(n),a.attachSuggest!==!1&&new NI(r.app,n,r.plugin,t)}function yst(r){return typeof r.getValue=="function"?r.getValue():r.inputEl.value}var Hu,Pwe=y(()=>{Hu=require("obsidian");kk();JC();kr();tE();vN()});function kN(r,e){var i;let t=e.container.createDiv("modal-button-container tn-task-modal__button-bar");for(let s of(i=e.leadingButtons)!=null?i:[])t.createEl("button",{cls:s.className,text:s.text}).addEventListener("click",s.onClick);let n=t.createEl("button",{cls:"mod-cta",text:r.translate("modals.task.buttons.save")});return n.addEventListener("click",()=>{vst(n,e.onSave,e.onSaved)}),t.createEl("button",{text:r.translate("common.cancel")}).addEventListener("click",e.onCancel),t}async function vst(r,e,t){r.disabled=!0;try{await e(),t()}finally{r.disabled=!1}}var zq=y(()=>{});function jq(r,e){let t=r.createDiv("action-icon");t.setAttribute("aria-label",e.tooltip),t.setAttribute("data-initial-tooltip",e.tooltip),t.setAttribute("tabindex","0"),t.setAttribute("role","button"),e.dataType&&t.setAttribute("data-type",e.dataType),(0,bN.setTooltip)(t,e.tooltip,{placement:"top"});let n=t.createSpan("icon");(0,bN.setIcon)(n,e.iconName);let a=i=>{i.preventDefault(),i.stopPropagation(),e.onClick(t,i)};return t.addEventListener("click",a),t.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&a(i)}),t}function Mwe(r,e){return e.map(t=>jq(r,t))}var bN,Awe=y(()=>{bN=require("obsidian")});function Iwe(r,e,t){r&&(_we(r,e,"due-date",t.dueDate,{activeTooltipKey:"modals.task.tooltips.dueValue",defaultTooltipKey:"modals.task.actions.due"}),_we(r,e,"scheduled-date",t.scheduledDate,{activeTooltipKey:"modals.task.tooltips.scheduledValue",defaultTooltipKey:"modals.task.actions.scheduled"}),bst(r,e,t),Tst(r,e,t),wst(r,e,t),Sst(r,e,t.reminderCount))}function _we(r,e,t,n,a){let i=xE(r,t);if(i){if(n){i.classList.add("has-value"),(0,Vu.setTooltip)(i,e.translate(a.activeTooltipKey,{value:n}),{placement:"top"});return}i.classList.remove("has-value"),(0,Vu.setTooltip)(i,e.translate(a.defaultTooltipKey),{placement:"top"})}}function bst(r,e,t){let n=xE(r,"status");if(!n)return;let a=t.statusConfigs.find(s=>s.value===t.status),i=a?a.label:t.status;Nwe(n,e,{isActive:!!(t.status&&a&&a.value!==t.defaultStatus),activeTooltipKey:"modals.task.tooltips.statusValue",defaultTooltipKey:"modals.task.actions.status",label:i,color:a==null?void 0:a.color})}function Tst(r,e,t){let n=xE(r,"priority");if(!n)return;let a=t.priorityConfigs.find(s=>s.value===t.priority),i=a?a.label:t.priority;Nwe(n,e,{isActive:!!(t.priority&&a&&a.value!==t.defaultPriority),activeTooltipKey:"modals.task.tooltips.priorityValue",defaultTooltipKey:"modals.task.actions.priority",label:i,color:a==null?void 0:a.color})}function Nwe(r,e,t){t.isActive?(r.classList.add("has-value"),(0,Vu.setTooltip)(r,e.translate(t.activeTooltipKey,{value:t.label}),{placement:"top"})):(r.classList.remove("has-value"),(0,Vu.setTooltip)(r,e.translate(t.defaultTooltipKey),{placement:"top"}));let n=r.querySelector(".icon");if(n){if(t.color){n.style.color=t.color;return}n.classList.remove(...kst),n.style.removeProperty("color")}}function wst(r,e,t){let n=xE(r,"recurrence");if(n){if(t.recurrenceRule.trim()){n.classList.add("has-value"),(0,Vu.setTooltip)(n,e.translate("modals.task.tooltips.recurrenceValue",{value:t.recurrenceDisplayText}),{placement:"top"});return}n.classList.remove("has-value"),(0,Vu.setTooltip)(n,e.translate("modals.task.actions.recurrence"),{placement:"top"})}}function Sst(r,e,t){let n=xE(r,"reminders");if(n){if(t>0){n.classList.add("has-value");let a=t===1?e.translate("modals.task.tooltips.remindersSingle"):e.translate("modals.task.tooltips.remindersPlural",{count:t});(0,Vu.setTooltip)(n,a,{placement:"top"});return}n.classList.remove("has-value"),(0,Vu.setTooltip)(n,e.translate("modals.task.actions.reminders"),{placement:"top"})}}function xE(r,e){return r.querySelector(`[data-type="${e}"]`)}var Vu,kst,Rwe=y(()=>{Vu=require("obsidian"),kst=["tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-muted-5872de20","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-color-white-0a43e56a","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"]});function Fwe(r){return!r||r.length===0?"open":[...r].sort((t,n)=>t.order-n.order)[0].value}function Owe(r){return!r||r.length===0?"normal":[...r].sort((t,n)=>t.weight-n.weight)[0].value}function Lwe(r){return r?r.includes("FREQ=DAILY")?"Daily":r.includes("FREQ=WEEKLY")?Est(r):r.includes("FREQ=MONTHLY")?Dst(r):r.includes("FREQ=YEARLY")?Pst(r):`Custom${Mst(r)}`:""}function zwe(r){let e=["th","st","nd","rd"],t=r%100;return r+(e[(t-20)%10]||e[t]||e[0])}function Est(r){if(r.includes("INTERVAL=2"))return"Every 2 weeks";if(r.includes("BYDAY=MO,TU,WE,TH,FR"))return"Weekdays";if(!r.includes("BYDAY="))return"Weekly";let e=r.match(/BYDAY=([A-Z]{2})/);return e?`Weekly on ${xst[e[1]]||e[1]}`:"Weekly"}function Dst(r){if(r.includes("INTERVAL=3"))return"Every 3 months";if(r.includes("BYMONTHDAY=")){let e=r.match(/BYMONTHDAY=(\d+)/);return e?`Monthly on the ${zwe(Number.parseInt(e[1],10))}`:"Monthly"}return r.includes("BYDAY=")?"Monthly (by weekday)":"Monthly"}function Pst(r){if(r.includes("BYMONTH=")&&r.includes("BYMONTHDAY=")){let e=r.match(/BYMONTH=(\d+)/),t=r.match(/BYMONTHDAY=(\d+)/);if(e&&t){let n=Cst[Number.parseInt(e[1],10)],a=zwe(Number.parseInt(t[1],10));return`Yearly on ${n} ${a}`}}return"Yearly"}function Mst(r){if(r.includes("COUNT=")){let e=r.match(/COUNT=(\d+)/);return e?` (${e[1]} times)`:""}if(r.includes("UNTIL=")){let e=r.match(/UNTIL=(\d{8})/);if(e){let t=e[1];return` (until ${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)})`}}return""}var xst,Cst,jwe=y(()=>{xst={SU:"Sunday",MO:"Monday",TU:"Tuesday",WE:"Wednesday",TH:"Thursday",FR:"Friday",SA:"Saturday"},Cst=["","January","February","March","April","May","June","July","August","September","October","November","December"]});function $we(r){return{title:r.title,status:r.status,priority:r.priority,dueDate:r.dueDate,scheduledDate:r.scheduledDate,recurrenceRule:r.recurrenceRule,recurrenceAnchor:r.recurrenceAnchor,reminders:r.reminders||[]}}function Bwe(r){return{app:r.app,plugin:r.plugin,translate:r.translate,getState:r.getState,setDate:(e,t)=>{if(e==="due"){r.setDueDate(t);return}r.setScheduledDate(t)},setStatus:r.setStatus,setPriority:r.setPriority,setRecurrence:(e,t)=>{r.setRecurrenceRule(e),t!==void 0&&r.setRecurrenceAnchor(t)},setReminders:r.setReminders,onChange:r.onChange}}function Uwe(r,e){let t=e.statusConfigs||[],n=e.priorityConfigs||[];return{dueDate:r.dueDate,scheduledDate:r.scheduledDate,status:r.status,priority:r.priority,recurrenceRule:r.recurrenceRule,recurrenceDisplayText:Lwe(r.recurrenceRule),reminderCount:r.reminders.length,defaultStatus:Fwe(t),defaultPriority:Owe(n),statusConfigs:t,priorityConfigs:n}}var Hwe=y(()=>{jwe()});var TN,Vwe=y(()=>{Mk();Pu();TN=class{constructor(e,t,n,a){this.plugin=e,this.task=t,this.triggerElement=n,this.onUpdate=a}show(e){let t=new Ea;this.addQuickRemindersSection(t,"due",this.plugin.i18n.translate("components.reminderContextMenu.remindBeforeDue")),this.addQuickRemindersSection(t,"scheduled",this.plugin.i18n.translate("components.reminderContextMenu.remindBeforeScheduled")),t.addSeparator(),t.addItem(n=>{n.setTitle(this.plugin.i18n.translate("components.reminderContextMenu.manageAllReminders")).setIcon("settings").onClick(()=>{this.openReminderModal()})}),this.task.reminders&&this.task.reminders.length>0&&t.addItem(n=>{n.setTitle(this.plugin.i18n.translate("components.reminderContextMenu.clearAllReminders")).setIcon("trash").onClick(async()=>{await this.clearAllReminders()})}),t.show(e)}addQuickRemindersSection(e,t,n){if(!(t==="due"?this.task.due:this.task.scheduled)){e.addItem(i=>{i.setTitle(n).setIcon("bell").setDisabled(!0)});return}e.addItem(i=>{i.setTitle(n),i.setIcon("bell"),this.addQuickReminderSubmenu(i.setSubmenu(),t)})}addQuickReminderSubmenu(e,t){[{label:this.plugin.i18n.translate("components.reminderContextMenu.quickReminders.atTime"),offset:"PT0M"},{label:this.plugin.i18n.translate("components.reminderContextMenu.quickReminders.fiveMinutesBefore"),offset:"-PT5M"},{label:this.plugin.i18n.translate("components.reminderContextMenu.quickReminders.fifteenMinutesBefore"),offset:"-PT15M"},{label:this.plugin.i18n.translate("components.reminderContextMenu.quickReminders.oneHourBefore"),offset:"-PT1H"},{label:this.plugin.i18n.translate("components.reminderContextMenu.quickReminders.oneDayBefore"),offset:"-P1D"}].forEach(a=>{e.addItem(i=>{i.setTitle(a.label).onClick(async()=>{await this.addQuickReminder(t,a.offset,a.label)})})})}async addQuickReminder(e,t,n){let a={id:`rem_${Date.now()}`,type:"relative",relatedTo:e,offset:t,description:n},i=[...this.task.reminders||[],a];await this.saveReminders(i)}async clearAllReminders(){await this.saveReminders([])}async saveReminders(e){let t;if(this.task.path&&this.task.path.trim()!==""){let n=await this.plugin.cacheManager.getTaskInfo(this.task.path);n?(t={...n,reminders:e},await this.plugin.taskService.updateProperty(t,"reminders",e)):t={...this.task,reminders:e}}else t={...this.task,reminders:e};this.onUpdate(t)}openReminderModal(){new ql(this.plugin.app,this.plugin,this.task,t=>{this.saveReminders(t)}).open()}}});var wN,qwe=y(()=>{Pu();wN=class{constructor(e){this.targetDoc=activeDocument;this.menu=new Ea,this.options=e,this.buildMenu()}buildMenu(){this.getStatusOptions().forEach((t,n)=>{this.menu.addItem(a=>{let i=t.label;a.setIcon(t.icon||"circle"),t.value===this.options.currentValue&&(i=`\u2713 ${t.label}`),a.setTitle(i),a.onClick(async()=>{this.options.onSelect(t.value)})})})}getStatusOptions(){let e=this.options.plugin.settings.customStatuses,t=[];return e&&e.length>0&&[...e].sort((a,i)=>a.order-i.order).forEach(a=>{t.push({label:a.label,value:a.value,color:a.color,icon:a.icon})}),t}capitalizeFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}show(e){var t,n;(n=(t=e.target)==null?void 0:t.instanceOf)!=null&&n.call(t,HTMLElement)&&(this.targetDoc=e.target.ownerDocument),this.menu.show(e),window.setTimeout(()=>{this.applyColorStyling()},10)}showAtElement(e){this.targetDoc=e.ownerDocument,this.menu.showAtPosition({x:e.getBoundingClientRect().left,y:e.getBoundingClientRect().bottom+4}),window.setTimeout(()=>{this.applyColorStyling()},10)}applyColorStyling(){let e=this.getStatusOptions(),t=this.targetDoc.querySelector(".menu");if(!t)return;let n=t.querySelectorAll(".menu-item");e.forEach((a,i)=>{let s=n[i];if(s&&a.color){let o=s.querySelector(".menu-item-icon");o&&(o.style.color=a.color)}})}}});function Wwe(r,e){let t=Ist(r.getState(),e);new $l(r.app,{currentDate:t?de(t):void 0,currentTime:t?Oi(t):void 0,title:Nst(r,e),dateRole:e,plugin:r.plugin,onSelect:(a,i)=>{r.setDate(e,Ast(a,i)),r.onChange()}}).open()}function Ywe(r,e){new wN({currentValue:r.getState().status,onSelect:n=>{r.setStatus(n),r.onChange()},plugin:r.plugin}).show(e)}function Gwe(r,e){new ju({currentValue:r.getState().priority,onSelect:n=>{r.setPriority(n),r.onChange()},plugin:r.plugin}).show(e)}function Kwe(r,e){let t=r.getState();new Vl({currentValue:t.recurrenceRule,currentAnchor:t.recurrenceAnchor,scheduledDate:t.scheduledDate,onSelect:(a,i)=>{r.setRecurrence(a||"",i),r.onChange()},app:r.app,plugin:r.plugin}).show(e)}function SN(r,e,t){new TN(r.plugin,_st(r.getState(),t),e.target,a=>{r.setReminders(a.reminders||[]),r.onChange()}).show(e)}function Ast(r,e){return r?e?La(r,e):r:""}function _st(r,e){return{...e,title:r.title,status:r.status,priority:r.priority,due:r.dueDate,scheduled:r.scheduledDate,path:(e==null?void 0:e.path)||"",archived:(e==null?void 0:e.archived)||!1,reminders:r.reminders}}function Ist(r,e){return e==="due"?r.dueDate:r.scheduledDate}function Nst(r,e){return e==="due"?r.translate("modals.task.dateMenu.dueTitle"):r.translate("modals.task.dateMenu.scheduledTitle")}var $q=y(()=>{dE();Pk();Vwe();qwe();Me();kk()});function xN(r,e){return{file:r,name:r.basename,link:e}}function Jwe(r,e,t){let n=[...r];for(let a of e){let i=Rst(a,t);!i||Bq(n,i)||n.push(i)}return n}function Xwe(r,e){return r.filter(t=>t!==e)}function eSe(r){return r.map(e=>e.link).join(", ")}function Rst(r,e){if(!r||typeof r!="string"||r.trim()==="")return null;let t=r.match(/^\[\[([^\]]+)\]\]$/);if(t)return Ost(r,t[1],e);let n=r.match(/^\[([^\]]*)\]\(([^)]+)\)$/);return n?Lst(r,n,e):zst(r,e)}function Bq(r,e){let t=Zwe(e);return r.some(n=>{let a=Zwe(n);return t.some(i=>a.includes(i))})}function Zwe(r){var n;let e=new Set;(n=r.file)!=null&&n.path&&e.add(`path:${Qwe(r.file.path)}`);let t=Et(r.link);return t&&e.add(`path:${Qwe(t)}`),r.link&&e.add(`link:${r.link.trim().toLowerCase()}`),Array.from(e)}function Qwe(r){return r.trim().replace(/\.md$/i,"").toLowerCase()}function tSe({app:r,listEl:e,items:t,sourcePath:n,translate:a,onRemove:i}){if(!e||(e.empty(),t.length===0))return;let s={metadataCache:r.metadataCache,workspace:r.workspace};for(let o of t){let l=e.createDiv({cls:"task-project-item"});o.unresolved&&l.addClass("task-project-item--unresolved");let c=l.createDiv({cls:"task-project-info"}),d=c.createDiv({cls:"task-project-name clickable-project"});if(o.file){let p=z_(r,o.file,n,o.file.name);Fst(d,[p],s),o.file.path!==o.file.name&&c.createDiv({cls:"task-project-path",text:o.file.path})}else d.textContent=o.name,(0,Wk.setTooltip)(d,a("contextMenus.task.dependencies.notices.unresolved",{name:o.name}),{placement:"top"});let u=l.createEl("button",{cls:"task-project-remove",text:"\xD7"});(0,Wk.setTooltip)(u,a("modals.task.projectsRemoveTooltip"),{placement:"top"}),u.addEventListener("click",()=>{i(o)})}}function Fst(r,e,t){Ek(r,e,t),Array.from(r.childNodes).forEach(n=>{var a;n.nodeType===Node.TEXT_NODE&&((a=n.textContent)==null?void 0:a.trim())==="+"&&n.remove()})}function Ost(r,e,t){let n=t.resolveLink(e,t.sourcePath);return n instanceof Wk.TFile?xN(n,r):{name:e.split("|")[0],link:r,unresolved:!0}}function Lst(r,e,t){let n=Et(r),a=t.resolveLink(n,t.sourcePath);return a instanceof Wk.TFile?xN(a,r):{name:e[1]||n,link:r,unresolved:!0}}function zst(r,e){let t=e.getMarkdownFiles().find(n=>n.basename===r||n.name===`${r}.md`);return t?{file:t,name:t.basename,link:`[[${t.basename}]]`}:{name:r,link:r,unresolved:!0}}var Wk,rSe=y(()=>{Wk=require("obsidian");vm();qn()});function nSe(r,e,t){let n=new Set(e.map(a=>a.path));return r.filter(a=>t&&a.path===t?!1:!n.has(a.path))}function aSe(r,e){return jst(r,e)?[...r]:[...r,e]}function iSe(r,e){return r.filter(t=>t.path!==e.path)}function jst(r,e){return r.some(t=>t.path===e.path)}async function sSe({app:r,listEl:e,files:t,sourcePath:n,getCachedTaskInfo:a,createTaskCard:i,translate:s,onRemove:o}){if(!e||(e.empty(),t.length===0))return;let l={metadataCache:r.metadataCache,workspace:r.workspace};for(let c of t){if(!(c instanceof CN.TFile))return;let d=e.createDiv({cls:"task-project-item task-project-item--task-card"}),u=d.createDiv({cls:"task-project-card-host"}),p=await a(c.path);p?u.appendChild(i(p)):$st(r,u,c,n,l);let m=d.createEl("button",{cls:"task-project-remove",text:"\xD7"});(0,CN.setTooltip)(m,s("modals.task.organization.removeSubtaskTooltip"),{placement:"top"}),m.addEventListener("click",()=>{o(c)})}}function $st(r,e,t,n,a){let i=e.createDiv({cls:"task-project-info"}),s=i.createDiv({cls:"task-project-name clickable-project"}),o=z_(r,t,n,t.name);Bst(s,[o],a),t.path!==t.name&&i.createDiv({cls:"task-project-path",text:t.path})}function Bst(r,e,t){Ek(r,e,t),Array.from(r.childNodes).forEach(n=>{var a;n.nodeType===Node.TEXT_NODE&&((a=n.textContent)==null?void 0:a.trim())==="+"&&n.remove()})}var CN,oSe=y(()=>{CN=require("obsidian");vm();qn()});async function EN({plugin:r,getAllTasks:e=async()=>{var u,p,m;return(m=await((p=(u=r.cacheManager).getAllTasks)==null?void 0:p.call(u)))!=null?m:[]},getCandidates:t,onSelect:n,translate:a,noEligibleTasksMessageKey:i,openFailedMessageKey:s,logOperation:o,openSelector:l=Fn,showNotice:c=u=>{new lSe.Notice(u)},logger:d=Ust}){var u;try{let p=(u=await e())!=null?u:[],m=[...t(p)];return m.length===0?(c(a(i)),"empty"):(l(r,m,f=>{f&&n(f)}),"opened")}catch(p){return d.error("Failed to open task selector",{category:"stale-data",operation:o,error:p}),c(a(s)),"error"}}var lSe,Ust,cSe=y(()=>{lSe=require("obsidian");K();Vo();Ust=N({tag:"TaskModal/TaskSelector"})});function pSe({container:r,className:e,placeholder:t,value:n,onChange:a,attachFocusScrollGuard:i}){let s=r.createEl("textarea",{cls:e});return s.placeholder=t,s.rows=1,s.spellcheck=!0,s.setAttribute("aria-label",t),s.addEventListener("keydown",o=>{o.key==="Enter"&&!o.ctrlKey&&!o.metaKey&&o.preventDefault()}),Hst(s,{value:n,onChange:a,attachFocusScrollGuard:i}),s}function Hst(r,{value:e,onChange:t,attachFocusScrollGuard:n}){r.value=e,r.addEventListener("input",a=>{let i=a.target,s=Vst(i.value);i.value!==s&&(i.value=s),t(s),dSe(i)}),n==null||n(r),dSe(r)}function Vst(r){return r.replace(/\s*\n+\s*/g," ")}function dSe(r){var u;let e=r.ownerDocument.defaultView,t=(u=e==null?void 0:e.HTMLTextAreaElement)!=null?u:HTMLTextAreaElement;if(!(r instanceof t))return;let n=e==null?void 0:e.getComputedStyle(r),a=n?Number.parseFloat(n.lineHeight):0,i=n&&Number.parseFloat(n.paddingTop)||0,s=n&&Number.parseFloat(n.paddingBottom)||0,o=n&&Number.parseFloat(n.borderTopWidth)||0,l=n&&Number.parseFloat(n.borderBottomWidth)||0,c=(a>0?a*3:72)+i+s+o+l;uSe(r,{"--tn-task-modal-title-height":"auto"});let d=Math.min(r.scrollHeight,c);uSe(r,{"--tn-task-modal-title-height":`${d}px`,"--tn-task-modal-title-overflow-y":r.scrollHeight>c?"auto":"hidden"})}function uSe(r,e){if(typeof r.setCssProps=="function"){r.setCssProps(e);return}for(let[t,n]of Object.entries(e))r.style.setProperty(t,n)}var mSe=y(()=>{});function MN({detailsContainer:r,splitRightColumn:e}){PN(r),r.classList.add(DN),e&&(PN(e),e.classList.add(DN))}function kSe({containerEl:r,detailsContainer:e,splitRightColumn:t,timerWindow:n}){var i;PN(e,DN),e.classList.add(Wst),r.classList.add("expanded"),t&&(PN(t,DN),t.style.removeProperty("display")),e.classList.remove(hSe,gSe),e.classList.add(fSe),e.classList.remove(vSe),e.classList.add(ySe),((i=n!=null?n:e.ownerDocument.defaultView)!=null?i:window).setTimeout(()=>{e.classList.remove(hSe,fSe),e.classList.add(gSe),e.classList.remove(ySe),e.classList.add(vSe)},50)}function PN(r,...e){r.classList.remove(...qst,...e)}var qst,DN,Wst,fSe,hSe,gSe,ySe,vSe,Uq=y(()=>{qst=["tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"],DN="tn-static-display-none-6b99de8b",Wst="tn-static-display-block-2a1b75c9",fSe="tn-static-opacity-0-8d919cb5",hSe="tn-static-opacity-0-6-d95b59ac",gSe="tn-static-opacity-1-c6e7979d",ySe="tn-static-transform-translatey-10px-5b91bf02",vSe="tn-static-transform-translatey-0-1b976432"});function bSe(r,e){var t;return((t=r.instanceOf)==null?void 0:t.call(r,e))===!0||Object.prototype.isPrototypeOf.call(e.prototype,r)}var AN,TSe=y(()=>{AN=class{constructor(e){this.guardedTitleInputs=new WeakSet;this.guardedMobileKeyboardInputs=new WeakSet;this.pendingTitleFocusScrollPositions=null;this.mobileKeyboardFocusCleanups=[];this.mobileKeyboardScrollTimers=[];this.elements=e}focusTitleInput(e){this.getWindow().setTimeout(()=>{this.pendingTitleFocusScrollPositions=this.captureTitleFocusScrollPositions(e),e.focus({preventScroll:!0}),e.select(),this.restoreTitleFocusScrollPositions(this.pendingTitleFocusScrollPositions)},this.getInitialFocusDelay())}getInitialFocusDelay(){return this.isMobileLikeEnvironment()?350:100}isMobileLikeEnvironment(){var n,a;let e=this.elements.containerEl.ownerDocument,t=e.defaultView||window;return e.body.classList.contains("is-mobile")||((a=(n=t.matchMedia)==null?void 0:n.call(t,"(pointer: coarse)"))==null?void 0:a.matches)===!0}attachTitleFocusScrollGuard(e){if(this.guardedTitleInputs.has(e))return;this.guardedTitleInputs.add(e);let t=()=>{this.pendingTitleFocusScrollPositions=this.captureTitleFocusScrollPositions(e)};e.addEventListener("pointerdown",t,{capture:!0}),e.addEventListener("touchstart",t,{capture:!0}),e.addEventListener("focus",()=>{this.pendingTitleFocusScrollPositions&&this.scheduleTitleFocusScrollRestore(this.pendingTitleFocusScrollPositions)})}attachMobileKeyboardScrollGuard(e,t={}){var s;if(this.guardedMobileKeyboardInputs.has(e))return;this.guardedMobileKeyboardInputs.add(e);let n=(s=t.scrollOnFocus)!=null?s:!0,a=()=>{this.isMobileLikeEnvironment()&&(this.elements.containerEl.addClass("is-mobile-keyboard-focused"),n&&this.scheduleMobileKeyboardScrollIntoView(e))},i=()=>{(e.ownerDocument.defaultView||window).setTimeout(()=>{let l=e.ownerDocument.activeElement;(!l||!this.elements.modalEl.contains(l)||!this.isKeyboardTextEntryElement(l))&&this.elements.containerEl.removeClass("is-mobile-keyboard-focused")},100)};e.addEventListener("focus",a),e.addEventListener("blur",i),this.mobileKeyboardFocusCleanups.push(()=>{e.removeEventListener("focus",a),e.removeEventListener("blur",i)})}destroy(){for(let t of this.mobileKeyboardFocusCleanups)t();this.mobileKeyboardFocusCleanups=[];let e=this.getWindow();for(let t of this.mobileKeyboardScrollTimers)e.clearTimeout(t);this.mobileKeyboardScrollTimers=[],this.elements.containerEl.removeClass("is-mobile-keyboard-focused"),this.pendingTitleFocusScrollPositions=null}captureTitleFocusScrollPositions(e){if(!this.isMobileLikeEnvironment())return null;let t=new Set,n=i=>{var l;let s=i==null?void 0:i.ownerDocument.defaultView,o=(l=s==null?void 0:s.HTMLElement)!=null?l:HTMLElement;i instanceof o&&t.add(i)};n(this.elements.containerEl),n(this.elements.modalEl),n(this.elements.contentEl),this.elements.modalEl.querySelectorAll(".modal-content, .minimalist-modal-container, .modal-split-content, .modal-split-left, .modal-split-right, .details-container").forEach(n);let a=e.parentElement;for(;a&&a!==this.elements.containerEl.parentElement;)n(a),a=a.parentElement;return Array.from(t).map(i=>({element:i,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft}))}restoreTitleFocusScrollPositions(e){if(e)for(let{element:t,scrollTop:n,scrollLeft:a}of e)t.scrollTop=n,t.scrollLeft=a}scheduleTitleFocusScrollRestore(e){this.restoreTitleFocusScrollPositions(e);let t=this.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(()=>this.restoreTitleFocusScrollPositions(e)):t.setTimeout(()=>this.restoreTitleFocusScrollPositions(e),16),t.setTimeout(()=>this.restoreTitleFocusScrollPositions(e),50),t.setTimeout(()=>{this.restoreTitleFocusScrollPositions(e),this.pendingTitleFocusScrollPositions===e&&(this.pendingTitleFocusScrollPositions=null)},250)}isKeyboardTextEntryElement(e){var s,o;let t=e.ownerDocument.defaultView||window,n=(s=t.HTMLInputElement)!=null?s:HTMLInputElement,a=(o=t.HTMLTextAreaElement)!=null?o:HTMLTextAreaElement;return bSe(e,a)?!0:bSe(e,n)?!new Set(["button","checkbox","color","file","hidden","radio","range","reset","submit"]).has(e.type):!1}scheduleMobileKeyboardScrollIntoView(e){let t=e.ownerDocument.defaultView||window;for(let n of[0,150,350]){let a=t.setTimeout(()=>{this.mobileKeyboardScrollTimers=this.mobileKeyboardScrollTimers.filter(i=>i!==a),this.scrollMobileKeyboardTargetIntoView(e)},n);this.mobileKeyboardScrollTimers.push(a)}}scrollMobileKeyboardTargetIntoView(e){var n;if(!this.isMobileLikeEnvironment())return;let t=(n=e.closest(".setting-item"))!=null?n:e;t.scrollIntoView({block:"nearest",inline:"nearest",behavior:"auto"}),this.nudgeFocusedFieldInsideVisualViewport(t)}nudgeFocusedFieldInsideVisualViewport(e){var d,u,p;let t=e.ownerDocument.defaultView||window,n=t.visualViewport,a=n&&Number.isFinite(n.height)?n.offsetTop+n.height:t.innerHeight;if(!Number.isFinite(a)||a<=0)return;let i=(u=(d=e.closest(".modal-split-content"))!=null?d:e.closest(".modal-content"))!=null?u:this.elements.contentEl,s=e.getBoundingClientRect(),o=i.getBoundingClientRect(),l=Math.max((p=n==null?void 0:n.offsetTop)!=null?p:0,o.top)+24,c=Math.min(a,o.bottom)-24;s.bottom>c?i.scrollTop+=s.bottom-c:s.top{CE=require("obsidian");VB();vpe();JB();Ct();qv();Io();qn();Ofe();mi();hwe();kwe();Pwe();zq();Awe();Rwe();Hwe();$q();rSe();oSe();cSe();mSe();Uq();TSe();K();Yst=N({tag:"Modals/TaskModal"}),Yk=class extends CE.Modal{constructor(t,n){super(t);this.keyboardHandler=null;this.title="";this.details="";this.originalDetails="";this.dueDate="";this.scheduledDate="";this.priority="normal";this.status="open";this.contexts="";this.projects="";this.tags="";this.timeEstimate=0;this.recurrenceRule="";this.recurrenceAnchor="scheduled";this.reminders=[];this.userFields={};this.userFieldInputs=new Map;this.userFieldToggles=new Map;this.blockedByItems=[];this.blockingItems=[];this.blockedByList=void 0;this.blockingList=void 0;this.selectedProjectItems=[];this.selectedSubtaskFiles=[];this.initialSubtaskFiles=[];this.titleInput=void 0;this.detailsInput=void 0;this.detailsMarkdownEditor=null;this.contextsInput=void 0;this.projectsInput=void 0;this.tagsInput=void 0;this.timeEstimateInput=void 0;this.projectsList=void 0;this.subtasksList=void 0;this.actionBar=void 0;this.detailsContainer=void 0;this.isExpanded=!1;this.splitRightColumn=void 0;this.plugin=n,this.focusGuards=new AN({containerEl:this.containerEl,modalEl:this.modalEl,contentEl:this.contentEl})}createDependencyItemFromFile(t,n={}){var a;return Iq({plugin:this.plugin,sourcePath:(a=n.sourcePath)!=null?a:this.getDependencySourcePath()},t)}createDependencyItemFromDependency(t,n){return cwe({plugin:this.plugin,sourcePath:n!=null?n:this.getDependencySourcePath()},t)}createDependencyItemFromPath(t){return dwe({plugin:this.plugin,sourcePath:this.getDependencySourcePath()},t)}getDependencySourcePath(){var t;return this.getCurrentTaskPath()||((t=this.plugin.app.workspace.getActiveFile())==null?void 0:t.path)||""}getCurrentTaskPath(){}getModalEditorFile(){let t=this.getCurrentTaskPath();if(!t)return this.app.workspace.getActiveFile();let n=this.app.vault.getAbstractFileByPath(t);return n instanceof CE.TFile?n:this.app.workspace.getActiveFile()}async openTaskNote(){}renderDependencyLists(){this.renderBlockedByList(),this.renderBlockingList()}getLinkServices(){var t;return{metadataCache:this.plugin.app.metadataCache,workspace:this.plugin.app.workspace,sourcePath:this.getCurrentTaskPath()||((t=this.plugin.app.workspace.getActiveFile())==null?void 0:t.path)||""}}renderBlockedByList(){this.renderDependencyList(this.blockedByList,this.blockedByItems,t=>{this.blockedByItems=Rq(this.blockedByItems,t),this.renderBlockedByList()})}renderBlockingList(){this.renderDependencyList(this.blockingList,this.blockingItems,t=>{this.blockingItems=Rq(this.blockingItems,t),this.renderBlockingList()})}async renderDependencyList(t,n,a){t&&await uwe({plugin:this.plugin,listEl:t,items:n,linkServices:this.getLinkServices(),translate:(i,s)=>this.t(i,s),onRemove:a})}extractDetailsFromContent(t){let{body:n}=rm(t);return n.replace(/\r\n/g,` `).trimEnd()}normalizeDetails(t){return t.replace(/\r\n/g,` `).trimEnd()}addBlockedByTask(t){let n={uid:_o(this.plugin.app,this.getDependencySourcePath(),t.path,this.plugin.settings.useFrontmatterMarkdownLinks),reltype:ss};this.addBlockedByDependency(n)}addBlockingTask(t){this.addBlockingTaskFromPath(t.path)}addBlockedByDependency(t){let n=this.getDependencySourcePath(),a=this.createDependencyItemFromDependency(t,n),i=Nq(this.blockedByItems,a);i.length!==this.blockedByItems.length&&(this.blockedByItems=i,this.renderBlockedByList())}addBlockingTaskFromPath(t){let n=this.getCurrentTaskPath();if(n&&t===n)return;let a=this.createDependencyItemFromPath(t),i=Nq(this.blockingItems,a);i.length!==this.blockingItems.length&&(this.blockingItems=i,this.renderBlockingList())}async openBlockedBySelector(){let t=this.getDependencySourcePath();await EN({plugin:this.plugin,getCandidates:n=>mwe({plugin:this.plugin,sourcePath:t,allTasks:n,existingItems:this.blockedByItems,currentPath:this.getCurrentTaskPath()}),onSelect:n=>{let a={uid:_o(this.plugin.app,t,n.path),reltype:ss};this.addBlockedByDependency(a)},translate:n=>this.t(n),noEligibleTasksMessageKey:"contextMenus.task.dependencies.notices.noEligibleTasks",openFailedMessageKey:"contextMenus.task.dependencies.notices.updateFailed",logOperation:"open-blocked-by-selector"})}async openBlockingSelector(){let t=this.getDependencySourcePath();await EN({plugin:this.plugin,getCandidates:n=>fwe({plugin:this.plugin,sourcePath:t,allTasks:n,existingItems:this.blockingItems,currentPath:this.getCurrentTaskPath()}),onSelect:n=>{this.addBlockingTaskFromPath(n.path)},translate:n=>this.t(n),noEligibleTasksMessageKey:"contextMenus.task.dependencies.notices.noEligibleTasks",openFailedMessageKey:"contextMenus.task.dependencies.notices.updateFailed",logOperation:"open-blocking-selector"})}getApp(){return this.app}getPlugin(){return this.plugin}t(t,n){return this.plugin.i18n.translate(t,n)}getFileByPath(t){return this.app.vault.getAbstractFileByPath(t)}getMarkdownFiles(){return this.app.vault.getMarkdownFiles()}getFileCache(t){return this.app.metadataCache.getFileCache(t)}resolveLink(t,n){return this.app.metadataCache.getFirstLinkpathDest(t,n)}isEditMode(){return!1}isCreationMode(){return!1}async handleSubmitShortcut(t){await this.handleSave()}onOpen(){this.containerEl.addClass("tasknotes-plugin","minimalist-task-modal"),this.plugin.settings.enableModalSplitLayout&&this.containerEl.addClass("split-layout-enabled"),this.modalEl.addClass("mod-tasknotes"),this.titleEl.setText(this.getModalTitle()),this.keyboardHandler=t=>{if(t.key==="Enter"&&(t.ctrlKey||t.metaKey)){if(t.target.closest(".cm-editor"))return;t.preventDefault(),this.handleSubmitShortcut(t.shiftKey)}},this.containerEl.addEventListener("keydown",this.keyboardHandler),this.initializeFormData().then(()=>{this.createModalContent(),this.focusTitleInput()})}createModalContent(){let{contentEl:t}=this;t.empty();let n=t.createDiv("minimalist-modal-container");this.splitContentWrapper=n.createDiv("modal-split-content"),this.splitLeftColumn=this.splitContentWrapper.createDiv("modal-split-left"),this.createPrimaryInput(this.splitLeftColumn),this.createActionBar(this.splitLeftColumn),this.splitRightColumn=this.splitLeftColumn.createDiv("modal-split-right"),this.createDetailsSection(n),this.createAdditionalSections(this.splitLeftColumn),this.createActionButtons(n)}createPrimaryInput(t){this.createTitleInput(t)}createAdditionalSections(t){}createTitleInput(t){let n=t.createDiv("title-input-container");this.titleInput=this.createTitleTextarea(n,"title-input",this.t("modals.task.titlePlaceholder"))}createTitleTextarea(t,n,a){return pSe({container:t,className:n,placeholder:a,value:this.title,onChange:i=>{this.title=i},attachFocusScrollGuard:i=>{this.attachTitleFocusScrollGuard(i),this.attachMobileKeyboardScrollGuard(i,{scrollOnFocus:!1})}})}createActionBar(t){this.actionBar=t.createDiv("tn-task-modal__action-bar"),this.createCoreActionIcons(this.actionBar),this.updateIconStates()}createCoreActionIcons(t){return Mwe(t,this.getCoreActionIconSpecs())}getCoreActionIconSpecs(){return[{iconName:"dot-square",tooltip:this.t("modals.task.actions.status"),onClick:(t,n)=>{this.showStatusContextMenu(n)},dataType:"status"},{iconName:"star",tooltip:this.t("modals.task.actions.priority"),onClick:(t,n)=>{this.showPriorityContextMenu(n)},dataType:"priority"},{iconName:"calendar",tooltip:this.t("modals.task.actions.due"),onClick:(t,n)=>{this.showDateContextMenu(n,"due")},dataType:"due-date"},{iconName:"calendar-clock",tooltip:this.t("modals.task.actions.scheduled"),onClick:(t,n)=>{this.showDateContextMenu(n,"scheduled")},dataType:"scheduled-date"},{iconName:"refresh-ccw",tooltip:this.t("modals.task.actions.recurrence"),onClick:(t,n)=>{this.showRecurrenceContextMenu(n)},dataType:"recurrence"},{iconName:"bell",tooltip:this.t("modals.task.actions.reminders"),onClick:(t,n)=>{this.showReminderContextMenu(n)},dataType:"reminders"}]}createActionIcon(t,n,a,i,s){return jq(t,{iconName:n,tooltip:a,onClick:i,dataType:s})}createDetailsSection(t){this.userFieldInputs.clear(),this.userFieldToggles.clear(),this.detailsContainer=this.splitLeftColumn?this.splitLeftColumn.createDiv("details-container"):t.createDiv("details-container"),this.isExpanded||MN({detailsContainer:this.detailsContainer,splitRightColumn:this.splitRightColumn});let n=this.plugin.settings.modalFieldsConfig,a=this.shouldShowField("title",n),i=this.shouldShowField("details",n);this.splitContentWrapper.classList.toggle("modal-split-content--right-empty",!i);let s=this.isEditMode(),o=this.isCreationMode()&&this.plugin.settings.enableNaturalLanguageInput;if(a&&(s||o)){let l=this.detailsContainer.createDiv("detail-label");l.textContent=this.t("modals.task.titleLabel");let c=this.createTitleTextarea(this.detailsContainer,"title-input-detailed",this.t("modals.task.titleDetailedPlaceholder"));(s||o)&&!this.titleInput&&(this.titleInput=c)}if(i){let l=this.splitRightColumn||this.detailsContainer;this.detailsMarkdownEditor=Spe({app:this.app,parent:l,label:this.t("modals.task.detailsLabel"),value:this.details,placeholder:this.t("modals.task.detailsPlaceholder"),file:this.getModalEditorFile(),tabMovesFocus:this.plugin.settings.taskModalTabMovesFocus,onChange:c=>{this.details=c},onSubmit:c=>{this.handleSubmitShortcut(c)},onEscape:()=>{this.close()},focusNextField:()=>this.focusNextField(),focusPreviousField:()=>this.focusPreviousField()})}this.createAdditionalFields(this.detailsContainer)}shouldShowField(t,n){return hpe(t,n,this.isCreationMode())}createAdditionalFields(t){let n=this.plugin.settings.modalFieldsConfig;if(!n){Yst.error("TaskModal: modalFieldsConfig is not initialized. This should never happen.",{category:"configuration",operation:"taskmodal-modalfieldsconfig-not-initialized-this-should-never-happen"});return}this.createFieldsFromConfig(t,n)}createFieldsFromConfig(t,n){ype({container:t,config:n,isCreationMode:this.isCreationMode(),fieldRenderers:this.getFieldRenderers(),renderUserField:(a,i)=>{this.createUserFieldByConfig(a,i)}})}createField(t,n){qB({container:t,fieldConfig:n,fieldRenderers:this.getFieldRenderers(),renderUserField:(a,i)=>{this.createUserFieldByConfig(a,i)}})}getFieldRenderers(){return{contexts:t=>this.createContextsField(t),tags:t=>this.createTagsField(t),"time-estimate":t=>this.createTimeEstimateField(t),projects:t=>this.createProjectsField(t),subtasks:t=>this.createSubtasksField(t),"blocked-by":t=>this.createBlockedByField(t),blocking:t=>this.createBlockingField(t)}}createContextsField(t){this.contextsInput=gwe(this.getMetadataFieldContext(),{container:t,value:this.contexts,onChange:n=>{this.contexts=n}})}createTagsField(t){this.tagsInput=ywe(this.getMetadataFieldContext(),{container:t,value:this.tags,onChange:n=>{this.tags=n}})}createTimeEstimateField(t){this.timeEstimateInput=vwe(this.getMetadataFieldContext(),{container:t,value:this.timeEstimate,onChange:n=>{this.timeEstimate=n}})}getMetadataFieldContext(){return{app:this.app,plugin:this.plugin,translate:t=>this.t(t),attachMobileKeyboardScrollGuard:t=>{this.attachMobileKeyboardScrollGuard(t)}}}createProjectsField(t){this.projectsList=Ife(this.getOrganizationFieldContext(),{container:t,onButtonClick:()=>{new Ao(this.app,this.plugin,a=>{this.addProject(a)}).open()},listElement:this.projectsList}),this.renderOrganizationLists()}createSubtasksField(t){this.subtasksList=Nfe(this.getOrganizationFieldContext(),{container:t,onButtonClick:()=>{this.openSubtaskSelector()},listElement:this.subtasksList}),this.renderOrganizationLists()}getOrganizationFieldContext(){return{translate:t=>this.t(t)}}getUserFieldContext(){return{app:this.app,plugin:this.plugin,translate:(t,n)=>this.t(t,n),attachMobileKeyboardScrollGuard:t=>{this.attachMobileKeyboardScrollGuard(t)}}}createBlockedByField(t){this.blockedByList=Rfe(this.getOrganizationFieldContext(),{container:t,onButtonClick:()=>{this.openBlockedBySelector()},listElement:this.blockedByList}),this.renderDependencyLists()}createBlockingField(t){this.blockingList=Ffe(this.getOrganizationFieldContext(),{container:t,onButtonClick:()=>{this.openBlockingSelector()},listElement:this.blockingList}),this.renderDependencyLists()}createUserFieldByConfig(t,n){var i;let a=(i=this.plugin.settings.userFields)==null?void 0:i.find(s=>s.id===n.id);a&&Cwe(this.getUserFieldContext(),{container:t,field:a,values:this.userFields,inputRefs:this.userFieldInputs,toggleRefs:this.userFieldToggles,onValueChange:(s,o)=>{this.userFields[s]=o}})}updateUserFieldControls(){var t;Dwe({fields:((t=this.plugin.settings)==null?void 0:t.userFields)||[],values:this.userFields,inputRefs:this.userFieldInputs,toggleRefs:this.userFieldToggles})}createUserFields(t){var n;Ewe(this.getUserFieldContext(),{container:t,fields:((n=this.plugin.settings)==null?void 0:n.userFields)||[],values:this.userFields,inputRefs:this.userFieldInputs,toggleRefs:this.userFieldToggles,onValueChange:(a,i)=>{this.userFields[a]=i}})}createActionButtons(t){let n=[];this.isEditMode()&&n.push({className:"tn-task-modal__open-note-button",text:this.t("modals.task.buttons.openNote"),onClick:()=>{this.openTaskNote()}}),kN(this.getActionButtonContext(),{container:t,leadingButtons:n,onSave:()=>this.handleSave(),onSaved:()=>{this.close()},onCancel:()=>{this.close()}})}getActionButtonContext(){return{translate:t=>this.t(t)}}expandModal(){this.isExpanded||(this.isExpanded=!0,kSe({containerEl:this.containerEl,detailsContainer:this.detailsContainer,splitRightColumn:this.splitRightColumn}))}showDateContextMenu(t,n){Wwe(this.getActionMenuContext(),n)}showStatusContextMenu(t){Ywe(this.getActionMenuContext(),t)}showPriorityContextMenu(t){Gwe(this.getActionMenuContext(),t)}showRecurrenceContextMenu(t){Kwe(this.getActionMenuContext(),t)}showReminderContextMenu(t){SN(this.getActionMenuContext(),t)}getActionMenuState(){return $we({title:this.title,status:this.status,priority:this.priority,dueDate:this.dueDate,scheduledDate:this.scheduledDate,recurrenceRule:this.recurrenceRule,recurrenceAnchor:this.recurrenceAnchor,reminders:this.reminders})}getActionMenuContext(){return Bwe({app:this.app,plugin:this.plugin,translate:(t,n)=>this.t(t,n),getState:()=>this.getActionMenuState(),setDueDate:t=>{this.dueDate=t},setScheduledDate:t=>{this.scheduledDate=t},setStatus:t=>{this.status=t},setPriority:t=>{this.priority=t},setRecurrenceRule:t=>{this.recurrenceRule=t},setRecurrenceAnchor:t=>{this.recurrenceAnchor=t},setReminders:t=>{this.reminders=t},onChange:()=>this.updateIconStates()})}updateDateIconState(){this.updateIconStates()}updateStatusIconState(){this.updateIconStates()}updatePriorityIconState(){this.updateIconStates()}updateRecurrenceIconState(){this.updateIconStates()}updateReminderIconState(){this.updateIconStates()}updateIconStates(){let t=this.getActionMenuState();Iwe(this.actionBar,{translate:(n,a)=>this.t(n,a)},Uwe(t,{statusConfigs:this.plugin.settings.customStatuses||[],priorityConfigs:this.plugin.settings.customPriorities||[]}))}focusTitleInput(){this.focusGuards.focusTitleInput(this.titleInput)}getInitialFocusDelay(){return this.focusGuards.getInitialFocusDelay()}isMobileLikeEnvironment(){return this.focusGuards.isMobileLikeEnvironment()}attachTitleFocusScrollGuard(t){this.focusGuards.attachTitleFocusScrollGuard(t)}attachMobileKeyboardScrollGuard(t,n){this.focusGuards.attachMobileKeyboardScrollGuard(t,n)}addProject(t){if(t instanceof CE.TFile){let n=xN(t,this.buildProjectReference(t,this.getCurrentTaskPath()||""));if(Bq(this.selectedProjectItems,n))return;this.selectedProjectItems.push(n)}this.updateProjectsFromFiles(),this.renderProjectsList()}removeProject(t){this.selectedProjectItems=Xwe(this.selectedProjectItems,t),this.updateProjectsFromFiles(),this.renderProjectsList()}updateProjectsFromFiles(){this.projects=eSe(this.selectedProjectItems)}buildProjectReference(t,n){return Ws(this.app,t,n,"","",this.plugin.settings.useFrontmatterMarkdownLinks)}initializeProjectsFromStrings(t){this.selectedProjectItems=[],this.addProjectsFromStrings(t)}addProjectsFromStrings(t){this.selectedProjectItems=Jwe(this.selectedProjectItems,t,this.getProjectStringContext()),this.updateProjectsFromFiles()}getProjectStringContext(){return{sourcePath:this.getCurrentTaskPath()||"",getMarkdownFiles:()=>this.getMarkdownFiles(),resolveLink:(t,n)=>this.resolveLink(t,n)}}renderProjectsList(){tSe({app:this.app,listEl:this.projectsList,items:this.selectedProjectItems,sourcePath:this.getCurrentTaskPath()||"",translate:(t,n)=>this.t(t,n),onRemove:t=>this.removeProject(t)})}async openSubtaskSelector(){await EN({plugin:this.plugin,getCandidates:t=>nSe(t,this.selectedSubtaskFiles,this.getCurrentTaskPath()),onSelect:t=>{let n=this.app.vault.getAbstractFileByPath(t.path);n&&this.addSubtask(n)},translate:t=>this.t(t),noEligibleTasksMessageKey:"modals.task.organization.notices.noEligibleSubtasks",openFailedMessageKey:"modals.task.organization.notices.subtaskSelectFailed",logOperation:"open-subtask-selector"})}addSubtask(t){let n=aSe(this.selectedSubtaskFiles,t);n.length!==this.selectedSubtaskFiles.length&&(this.selectedSubtaskFiles=n,this.renderSubtasksList())}removeSubtask(t){this.selectedSubtaskFiles=iSe(this.selectedSubtaskFiles,t),this.renderSubtasksList()}async renderSubtasksList(){await sSe({app:this.app,listEl:this.subtasksList,files:this.selectedSubtaskFiles,sourcePath:this.getCurrentTaskPath()||"",getCachedTaskInfo:t=>this.plugin.cacheManager.getCachedTaskInfo(t),createTaskCard:t=>Dr(t,this.plugin,void 0,{layout:"default",showSecondaryBadges:!1,enableHoverPreview:!1}),translate:(t,n)=>this.t(t,n),onRemove:t=>this.removeSubtask(t)})}renderOrganizationLists(){this.renderProjectsList(),this.renderSubtasksList()}toggleProjectsList(){this.projectsList&&this.projectsList.toggleClass("collapsed",!this.projectsList.hasClass("collapsed"))}toggleSubtasksList(){this.subtasksList&&this.subtasksList.toggleClass("collapsed",!this.subtasksList.hasClass("collapsed"))}validateForm(){return this.title.trim().length>0}focusNextField(){let t=this.contextsInput||this.tagsInput||this.timeEstimateInput;return t?(window.setTimeout(()=>{t.focus()},50),!0):!1}focusPreviousField(){return this.titleInput?(window.setTimeout(()=>{var t;(t=this.titleInput)==null||t.focus()},50),!0):!1}onClose(){this.keyboardHandler&&(this.containerEl.removeEventListener("keydown",this.keyboardHandler),this.keyboardHandler=null),this.focusGuards.destroy(),Cpe(this.detailsMarkdownEditor),this.detailsMarkdownEditor=null,super.onClose()}}});var _N,wSe=y(()=>{_N=class{constructor(e,t=[]){this.config=e,this.userFields=t,this.triggerMap=new Map,this.propertyMap=new Map,this.buildMaps()}buildMaps(){this.triggerMap.clear(),this.propertyMap.clear();for(let e of this.config.triggers)e.enabled&&(this.triggerMap.set(e.trigger,e),this.propertyMap.set(e.propertyId,e))}getTriggerForProperty(e){return this.propertyMap.get(e)}getPropertyForTrigger(e){var t;return(t=this.triggerMap.get(e))==null?void 0:t.propertyId}getAllEnabledTriggers(){return this.config.triggers.filter(e=>e.enabled)}getTriggersOrderedByLength(){return this.getAllEnabledTriggers().sort((e,t)=>t.trigger.length-e.trigger.length)}usesNativeTagSuggester(){let e=this.getTriggerForProperty("tags");return(e==null?void 0:e.trigger)==="#"&&(e==null?void 0:e.enabled)}getTagTrigger(){let e=this.getTriggerForProperty("tags");return e!=null&&e.enabled?e.trigger:void 0}getContextTrigger(){let e=this.getTriggerForProperty("contexts");return e!=null&&e.enabled?e.trigger:void 0}getProjectTrigger(){let e=this.getTriggerForProperty("projects");return e!=null&&e.enabled?e.trigger:void 0}getStatusTrigger(){let e=this.getTriggerForProperty("status");return e!=null&&e.enabled?e.trigger:void 0}getPriorityTrigger(){let e=this.getTriggerForProperty("priority");return e!=null&&e.enabled?e.trigger:void 0}getUserField(e){return this.userFields.find(t=>t.id===e)}isUserField(e){return this.userFields.some(t=>t.id===e)}getSuggesterType(e){if(e==="tags")return this.usesNativeTagSuggester()?"native-tag":"list";if(e==="contexts")return"list";if(e==="projects")return"file";if(e==="status")return"status";if(e==="priority")return"priority";let t=this.getUserField(e);if(t)switch(t.type){case"text":case"list":return t.autosuggestFilter?"file":"list";case"boolean":return"boolean";default:return"none"}return"none"}updateConfig(e){this.config=e,this.buildMaps()}updateUserFields(e){this.userFields=e}}});function xSe(r){let e=(0,Zc.autocompletion)({override:[Zst(r)],activateOnTyping:!0,closeOnBlur:!0,maxRenderedOptions:10,addToOptions:[{render:(n,a,i)=>Qst(n,i.dom.ownerDocument),position:100}]}),t=Vq.Prec.high(SSe.keymap.of([{key:"ArrowDown",run:(0,Zc.moveCompletionSelection)(!0)},{key:"ArrowUp",run:(0,Zc.moveCompletionSelection)(!1)},{key:"Enter",run:Zc.acceptCompletion},{key:"Tab",run:Zc.acceptCompletion},{key:"Escape",run:Zc.closeCompletion}]));return[Vq.Prec.high(e),t]}function Zst(r){return async e=>{let t=new _N(r.settings.nlpTriggers,r.settings.userFields||[]),n=e.state.doc.lineAt(e.pos),a=n.text.slice(0,e.pos-n.from),i=(f,h)=>{if(f===-1)return!1;if(f===0)return!0;let g=h[f-1];return!/\w/.test(g)},s=t.getTriggersOrderedByLength(),o=[];for(let f of s){if(f.propertyId==="tags"&&f.trigger==="#")continue;let h=a.lastIndexOf(f.trigger);i(h,a)&&o.push({propertyId:f.propertyId,trigger:f.trigger,index:h,triggerLength:f.trigger.length})}if(o.length===0)return null;o.sort((f,h)=>h.index-f.index);let l=o[0],c=l.index+l.triggerLength,d=a.slice(c);if(l.propertyId==="projects"&&/^\[\[[^\]]*\]\]/.test(d)||l.propertyId!=="projects"&&(d.includes(" ")||d.includes(` `)))return null;let u=await Jst(l.propertyId,d,r,t);if(!u||u.length===0)return null;let p=e.pos,m=n.text.slice(e.pos-n.from);return l.propertyId==="status"&&m.startsWith(l.trigger)&&(p=Math.min(n.to,e.pos+l.triggerLength)),{from:n.from+l.index+l.triggerLength,to:p,options:u,validFor:/^[\w\s-]*$/}}}function Qst(r,e=activeDocument){let t=r;if(!t.projectMetadata)return null;let n=Ne(e,"div");n.className="cm-project-suggestion__metadata";for(let a of t.projectMetadata){let i=Ne(e,"div");i.className="cm-project-suggestion__meta",a.forEach((s,o)=>{o>0&&i.appendChild(e.createTextNode(" "));let l=Ne(e,"span");l.className=s.kind==="value"?"cm-project-suggestion__meta-value":s.kind==="label"?"cm-project-suggestion__meta-label":"cm-project-suggestion__meta-literal",s.searchable&&l.classList.add("cm-project-suggestion__meta-searchable"),s.searchable&&t.projectQuery?rot(l,s.text,t.projectQuery):l.textContent=s.text,i.appendChild(l)}),n.appendChild(i)}return n}async function Jst(r,e,t,n){switch(n.getSuggesterType(r)){case"list":return Xst(r,e,t);case"file":return eot(r,e,t,n);case"status":return not(e,t);case"priority":return aot(e,t);case"boolean":return iot(e);case"native-tag":return null;default:return null}}function Xst(r,e,t){let n=[],a=r;switch(r){case"tags":n=t.cacheManager.getAllTags(),a="Tag";break;case"contexts":n=t.cacheManager.getAllContexts(),a="Context";break;default:n=[],a=r;break}return n.filter(i=>i&&typeof i=="string").filter(i=>i.toLowerCase().includes(e.toLowerCase())).slice(0,10).map(i=>({label:i,apply:i+" ",type:"text",info:a}))}async function eot(r,e,t,n){var a,i,s;try{let o;if(r==="projects")o=t.settings.projectAutosuggest;else{let c=n.getUserField(r);o=c==null?void 0:c.autosuggestFilter}let l=await X2.suggest(t,e,20,o);if(r==="projects"){let c=new nm({getFrontmatter:u=>u.frontmatter}),d=((s=(i=(a=t.settings)==null?void 0:a.projectAutosuggest)==null?void 0:i.rows)!=null?s:[]).slice(0,3);return l.map(u=>{var g;let p=u.displayText||u.insertText,m=u.insertText,f=t.app.vault.getMarkdownFiles().find(v=>v.path===u.path),h=[];if(f&&d.length>0){let v=t.app.metadataCache.getFileCache(f),b=(v==null?void 0:v.frontmatter)||{},k=t.fieldMapper.mapFromFrontmatter(b,f.path,t.settings.storeTitleInFilename),w=typeof k.title=="string"?k.title:"",S=Array.isArray(b.aliases)?b.aliases.filter(E=>typeof E=="string"):[],C={basename:f.basename,name:f.name,path:f.path,parent:((g=f.parent)==null?void 0:g.path)||"",title:w,aliases:S,frontmatter:b};h=tot(d,C,c)}return{label:p,apply:`[[${m}]] `,type:"text",info:"Project",projectMetadata:h.length>0?h:void 0,projectQuery:e}})}return l.map(c=>{let d=c.displayText||c.insertText,u=c.insertText;return{label:d,apply:`[[${u}]] `,type:"text",info:r==="projects"?"Project":r}})}catch(o){return Gst.error(`Error getting file suggestions for ${r}:`,{category:"persistence",operation:"getting-file-suggestions",error:o}),[]}}function tot(r,e,t){var i;let n=[],a=Math.min(r.length,3);for(let s=0;sd.text.trim().length>0)&&n.push(c)}catch(l){}}return n}function rot(r,e,t){let n=r.ownerDocument,a=t.toLowerCase().split(/\s+/).filter(Boolean);if(a.length===0){r.textContent=e;return}let i=e.toLowerCase(),s=[];for(let c of a){let d=i.indexOf(c);for(;d!==-1;)s.push({start:d,end:d+c.length}),d=i.indexOf(c,d+1)}s.sort((c,d)=>c.start-d.start);let o=[];for(let c of s){let d=o[o.length-1];(!d||c.start>=d.end)&&o.push(c)}if(o.length===0){r.textContent=e;return}let l=0;for(let c of o){c.start>l&&r.appendChild(n.createTextNode(e.slice(l,c.start)));let d=Ne(n,"mark");d.textContent=e.slice(c.start,c.end),r.appendChild(d),l=c.end}l({label:a.display,apply:a.value+" ",type:"text",info:"Status"}))}function aot(r,e){return(e.settings.customPriorities||[]).filter(n=>n.label.toLowerCase().includes(r.toLowerCase())).slice(0,10).map(n=>({label:n.label,apply:n.value+" ",type:"text",info:"Priority"}))}function iot(r){return["true","false"].filter(t=>t.toLowerCase().includes(r.toLowerCase())).map(t=>({label:t,apply:t+" ",type:"text",info:"Boolean"}))}var Zc,Vq,SSe,Gst,Kst,CSe=y(()=>{Zc=require("@codemirror/autocomplete"),Vq=require("@codemirror/state"),SSe=require("@codemirror/view");Lc();wSe();jS();I_();LS();K();ms();Gst=N({tag:"Editor/NLPCodeMirrorAutocomplete"}),Kst=new Set(["title","aliases","file.basename"])});function ESe(r){let e=Ge(),t=r.contexts.split(",").map(l=>l.trim()).filter(l=>l.length>0),n=qs(r.projects),a=za(r.tags).split(",").map(l=>l.trim()).filter(l=>l.length>0);r.taskIdentificationMethod==="tag"&&r.taskTag&&!a.includes(r.taskTag)&&a.unshift(r.taskTag);let i={title:r.title.trim(),due:r.dueDate||void 0,scheduled:r.scheduledDate||void 0,priority:r.priority,status:r.status,contexts:t.length>0?t:void 0,projects:n.length>0?n:void 0,tags:a.length>0?a:void 0,timeEstimate:r.timeEstimate>0?r.timeEstimate:void 0,recurrence:r.recurrenceRule||void 0,recurrence_anchor:r.recurrenceRule?r.recurrenceAnchor:void 0,reminders:r.reminders.length>0?r.reminders:void 0,creationContext:r.creationContext||"manual-creation",dateCreated:e,dateModified:e,customFrontmatter:Swe(r.userFields)},s=r.blockedByItems.map(l=>({...l.dependency}));s.length>0&&(i.blockedBy=s);let o=r.normalizeDetails(r.details).trimEnd();return o.length>0&&(i.details=o),i}function DSe(r){let e=[],t={},n=[];return r.forEach(a=>{a.path?e.includes(a.path)||(e.push(a.path),t[a.path]={...a.dependency}):n.push(a.dependency.uid)}),{added:e,raw:t,unresolved:n}}var PSe=y(()=>{Me();Ct();am();vN()});var _Se={};at(_Se,{convertDefaultRemindersToReminders:()=>EE,hasAnyUserFieldsEnabled:()=>MSe,isUserFieldConfigComplete:()=>ASe,isUserFieldEnabled:()=>sot});function EE(r,e){return r.map(t=>{let n={id:`rem_${Date.now()}_${Math.random().toString(36).slice(2,11)}`,type:t.type,description:t.description};if(t.type==="relative"){if(t.relatedTo&&t.offset!==void 0&&t.unit&&t.direction){let a="PT";t.unit==="days"?a=`P${t.offset}D`:t.unit==="hours"?a=`PT${t.offset}H`:a=`PT${t.offset}M`,t.direction==="before"&&(a="-"+a),n.relatedTo=t.relatedTo,n.offset=a}}else t.type==="absolute"&&t.absoluteDate&&t.absoluteTime&&(n.absoluteTime=`${t.absoluteDate}T${t.absoluteTime}:00`);return n}).filter(t=>t.type==="relative"?t.relatedTo&&t.offset:!!t.absoluteTime)}function MSe(r){let e=r.userFields;return!e||e.length===0?!1:e.some(t=>!!(t&&t.displayName&&t.key&&t.type))}function ASe(r){return!r||!r.enabled?!1:!!(r.displayName&&r.key&&r.type)}function sot(r){return r.userFields&&r.userFields.length>0?MSe(r):ASe(r.userField)}var IN=y(()=>{});function ISe(r){let e=r.taskCreationDefaults,t={title:"",dueDate:Ac(e.defaultDueDate,e.defaultDueTime),scheduledDate:Ac(e.defaultScheduledDate,e.defaultScheduledTime),priority:r.defaultPriority,status:r.defaultStatus,contexts:e.defaultContexts||"",tags:e.defaultTags||"",projectStrings:e.defaultProjects?qs(e.defaultProjects):[],timeEstimate:e.defaultTimeEstimate&&e.defaultTimeEstimate>0?e.defaultTimeEstimate:0,recurrenceRule:"",recurrenceAnchor:"scheduled",reminders:e.defaultReminders&&e.defaultReminders.length>0?EE(e.defaultReminders):[],userFields:oot(r.userFields||[])};return r.prePopulatedValues&&cot(t,r.prePopulatedValues,r.taskTag),t}function oot(r){let e={};for(let t of r)if(t.defaultValue!==void 0){if(t.type==="date"&&typeof t.defaultValue=="string"){let n=lot(t.defaultValue);n&&(e[t.key]=n);continue}e[t.key]=t.defaultValue}return e}function lot(r){return r!=="none"&&r!=="today"&&r!=="tomorrow"&&r!=="next-week"?"":OS(r)}function cot(r,e,t){if(e.title!==void 0&&(r.title=e.title),e.due!==void 0&&(r.dueDate=e.due),e.scheduled!==void 0&&(r.scheduledDate=e.scheduled),e.priority!==void 0&&(r.priority=e.priority),e.status!==void 0&&(r.status=e.status),e.contexts!==void 0&&(r.contexts=e.contexts.join(", ")),e.projects!==void 0&&(r.projectStrings=e.projects.filter(n=>n&&typeof n=="string"&&n.trim()!=="")),e.tags!==void 0&&(r.tags=za(e.tags.filter(n=>n!==t).join(", "))),e.timeEstimate!==void 0&&(r.timeEstimate=e.timeEstimate),e.recurrence!==void 0&&typeof e.recurrence=="string"&&(r.recurrenceRule=e.recurrence),e.recurrence_anchor!==void 0&&(r.recurrenceAnchor=e.recurrence_anchor),e.customFrontmatter)for(let[n,a]of Object.entries(e.customFrontmatter))r.userFields[n]=a}var NSe=y(()=>{Ct();IN();am()});async function RSe(r){var t;let e={updated:0,missing:0,skipped:0,failed:0};if(!r.currentTaskFile)return e;for(let n of r.subtaskFiles)try{let a=await r.getTaskInfo(n.path);if(!a){e.missing+=1;continue}let i=r.buildProjectReference(r.currentTaskFile,n.path),s=qq(a.projects,i,dot(r.currentTaskFile));if(!s){e.skipped+=1;continue}await r.updateTaskProjects(a,s),e.updated+=1}catch(a){e.failed+=1,(t=r.onError)==null||t.call(r,a,n)}return e}function qq(r,e,t){let a=(Array.isArray(r)?r:[]).filter(i=>typeof i=="string");return a.includes(e)||a.includes(t)?null:[...a,e]}function dot(r){return`[[${r.basename}]]`}var Wq=y(()=>{});function FSe(r){return r.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\/+/,"")}async function OSe(r,e){return r.getAbstractFileByPath(e)?!0:r.adapter.exists(e,!1)}function LSe(r,e){if(!r||!e)throw new Error("Invalid context or settings provided");if(!r.title||typeof r.title!="string")throw new Error("Context must have a valid title");if(r.title.trim().length===0)throw new Error("Title cannot be empty");let t=r.date||new Date;if(!(t instanceof Date)||isNaN(t.getTime()))throw new Error("Invalid date provided in context");try{let n=e.icsIntegration;if(n)switch(n.icsNoteFilenameFormat){case"title":return Zr(r.title);case"zettel":return mg(t);case"timestamp":return jSe(t);case"custom":{let a={icsEventTitle:r.icsEventTitle?Zr(r.icsEventTitle):Zr(r.title),icsEventLocation:r.icsEventLocation?Zr(r.icsEventLocation):"",icsEventDescription:r.icsEventDescription?Zr(r.icsEventDescription.substring(0,50)):"",icsEventTitleWithDate:Zr(`${r.icsEventTitle||r.title} - ${M(t,"PPP")}`)};return Yq(r,n.customICSNoteFilenameTemplate,t,a)}default:return Zr(r.title)}return Zr(r.title)}catch(n){return fg.error("Error generating ICS note filename:",{category:"provider",operation:"generating-ics-note-filename",error:n}),Zr(r.title)}}function zSe(r,e){if(!r||!e)throw new Error("Invalid context or settings provided");if(!r.title||typeof r.title!="string")throw new Error("Context must have a valid title");if(r.title.trim().length===0)throw new Error("Title cannot be empty");let t=r.date||new Date;if(!(t instanceof Date)||isNaN(t.getTime()))throw new Error("Invalid date provided in context");if(e.storeTitleInFilename)return Zr(r.title);try{switch(e.taskFilenameFormat){case"title":return Zr(r.title);case"zettel":return mg(t);case"timestamp":return jSe(t);case"uuid":return $Se();case"custom":return Yq(r,e.customFilenameTemplate,t);default:return mg(t)}}catch(n){return fg.error("Error generating filename:",{category:"persistence",operation:"generating-filename",error:n}),mg(t)}}function NN(r,e,t){if(!r.storeTitleInFilename&&r.taskFilenameFormat!=="title")return!1;let n=Zr(e);return t.startsWith("task-")&&t!==n}function mg(r){let e=M(r,"yyMMdd"),t=new Date(r);t.setHours(0,0,0,0);let a=Math.floor((r.getTime()-t.getTime())/1e3).toString(36);return`${e}${a}`}function jSe(r){return M(r,"yyyy-MM-dd-HHmmss")}function $Se(){let r=typeof window!="undefined"?window.crypto:void 0;if(typeof(r==null?void 0:r.randomUUID)=="function")return r.randomUUID();let e=new Uint8Array(16);if(typeof(r==null?void 0:r.getRandomValues)=="function")r.getRandomValues(e);else for(let n=0;nn.toString(16).padStart(2,"0"));return`${t.slice(0,4).join("")}-${t.slice(4,6).join("")}-${t.slice(6,8).join("")}-${t.slice(8,10).join("")}-${t.slice(10,16).join("")}`}function uot(r){return Array.isArray(r)?r.map(e=>Fl(e).trim()).filter(e=>e.length>0).map(e=>Zr(e)):[]}function pot(r){return r?r.replace(/[^a-zA-Z0-9]/g,"").substring(0,4).toUpperCase():""}function Yq(r,e,t,n){var a;if(!r||!e||!t)throw new Error("Invalid inputs for custom filename generation");if(typeof e!="string"||e.trim().length===0)throw new Error("Template must be a non-empty string");if(!(t instanceof Date)||isNaN(t.getTime()))throw new Error("Invalid date for filename generation");try{let i=Zr(r.title),s=r.priority&&["low","normal","medium","high"].includes(r.priority)?r.priority:"normal",o=r.status?Zr(r.status):"open",l=Array.isArray(r.contexts)?r.contexts:[],c=uot(r.projects),d=Array.isArray(r.tags)?r.tags:[],u={title:i,date:M(t,"yyyy-MM-dd"),time:M(t,"HHmmss"),priority:s,status:o,timestamp:M(t,"yyyy-MM-dd-HHmmss"),dateTime:M(t,"yyyy-MM-dd-HHmm"),year:M(t,"yyyy"),month:M(t,"MM"),day:M(t,"dd"),hour:M(t,"HH"),minute:M(t,"mm"),second:M(t,"ss"),dueDate:r.dueDate||"",scheduledDate:r.scheduledDate||"",context:l[0]?Zr(l[0]):"",contexts:l.map(m=>Zr(m)).join("/"),project:c[0]||"",projects:c.join("/"),projectId:pot(c[0]),tags:d.map(m=>Zr(m)).join(", "),hashtags:d.map(m=>`#${Zr(m)}`).join(" "),timeEstimate:((a=r.timeEstimate)==null?void 0:a.toString())||"",details:r.details?Zr(r.details.substring(0,50)):"",parentNote:r.parentNote?Zr(r.parentNote):"",shortDate:M(t,"yyMMdd"),shortYear:M(t,"yy"),monthName:M(t,"MMMM"),monthNameShort:M(t,"MMM"),dayName:M(t,"EEEE"),dayNameShort:M(t,"EEE"),week:M(t,"ww"),quarter:M(t,"q"),time12:M(t,"hh:mm a"),time24:M(t,"HH:mm"),hourPadded:M(t,"HH"),hour12:M(t,"hh"),ampm:M(t,"a"),unix:Math.floor(t.getTime()/1e3).toString(),unixMs:t.getTime().toString(),milliseconds:M(t,"SSS"),ms:M(t,"SSS"),timezone:M(t,"xxx"),timezoneShort:M(t,"xx"),utcOffset:M(t,"xxx"),utcOffsetShort:M(t,"xx"),utcZ:"Z",priorityShort:s.substring(0,1).toUpperCase(),statusShort:o.substring(0,1).toUpperCase(),titleLower:i.toLowerCase(),titleUpper:i.toUpperCase(),titleSnake:i.toLowerCase().replace(/\s+/g,"_"),titleKebab:i.toLowerCase().replace(/\s+/g,"-"),titleCamel:i.replace(/(?:^\w|[A-Z]|\b\w)/g,(m,f)=>f===0?m.toLowerCase():m.toUpperCase()).replace(/\s+/g,""),titlePascal:i.replace(/(?:^\w|[A-Z]|\b\w)/g,m=>m.toUpperCase()).replace(/\s+/g,""),zettel:mg(t),uuid:$Se(),nano:Date.now().toString()+Math.random().toString(36).substring(2,7),...n||{}},p=e;if(e.length>500)throw new Error("Template too long");return Object.entries(u).forEach(([m,f])=>{try{let h=new RegExp(`\\{\\{${m}\\}\\}`,"g");p=p.replace(h,f);let g=new RegExp(`\\{${m}\\}`,"g");p=p.replace(g,f)}catch(h){fg.warn(`Error replacing template variable ${m}:`,{category:"persistence",operation:"replacing-template-variable",error:h})}}),p=p.replace(/\{\{[^}]+\}\}/g,""),p=p.replace(/\{[^}]+\}/g,""),p.trim()||(p=i||mg(t)),Zr(p)}catch(i){return fg.error("Error generating custom filename:",{category:"persistence",operation:"generating-custom-filename",error:i}),Zr(r.title)||mg(t)}}function Zr(r){if(!r||typeof r!="string")return"untitled";try{let e=r.trim().replace(/\s+/g," ").replace(/[<>:"/\\|?*#[\]]/g,"").replace(/./g,n=>{let a=n.charCodeAt(0);return a<=31||a>=127&&a<=159?"":n}).replace(/^\.+|\.+$/g,"").trim();return(!e||e.length===0)&&(e="untitled"),["CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9"].includes(e.toUpperCase())&&(e=`task-${e}`),e}catch(e){return fg.error("Error sanitizing filename:",{category:"persistence",operation:"sanitizing-filename",error:e}),"untitled"}}async function Gk(r,e,t){if(!r||typeof r!="string")throw new Error("Base filename must be a non-empty string");if(typeof e!="string")throw new Error("Folder path must be a string");if(!t)throw new Error("Vault must be provided");let n=Zr(r);if(!n)throw new Error("Base filename cannot be sanitized to a valid name");let a=e.replace(/\.\./g,"").trim();try{let i=FSe(`${a}/${n}.md`);if(i.length>260)throw new Error("Generated path too long");if(!await OSe(t,i))return n;for(let l=2;l<=999;l++){let c=`${n}-${l}`,d=FSe(`${a}/${c}.md`);if(d.length>260)break;if(!await OSe(t,d))return c}let s=Date.now().toString(36),o=`${n.substring(0,50)}-${s}`;return Zr(o)}catch(i){return fg.error("Error generating unique filename:",{category:"persistence",operation:"generating-unique-filename",error:i}),`task-${Date.now().toString(36)}`}}function mot(r){let e=it(r);if(!(e instanceof Date)||isNaN(e.getTime()))throw new Error(`Invalid occurrence date: ${r}`);return{occurrenceDate:M(e,"yyyy-MM-dd"),occurrenceWeek:M(e,"RRRR-'W'II"),occurrenceMonth:M(e,"yyyy-MM"),occurrenceYear:M(e,"yyyy"),occurrenceMonthName:M(e,"MMMM")}}function BSe(r,e,t){try{let n=mot(t);return Yq(r,e,r.date||new Date,n)}catch(n){return fg.error("Error generating occurrence filename:",{category:"persistence",operation:"generating-occurrence-filename",error:n}),Zr(r.title)}}var fg,Kk=y(()=>{Wr();qn();K();Me();fg=N({tag:"Utils/FilenameGenerator"})});var WSe={};at(WSe,{TaskCreationModal:()=>Pm,getTaskCreationFailureNoticeMessage:()=>HSe,openCreatedTaskFileAfterSave:()=>qSe,shouldOpenCreatedTaskAfterSave:()=>VSe});function got(r){return r.disabled?!1:r.tabIndex>=0||hot.has(r.tagName)}function HSe(r){let e=r instanceof Error&&r.message?r.message:String(r);return e.startsWith(USe)?e.slice(USe.length):e}function VSe(r,e,t){return(r==="same-tab"||r==="new-tab")&&!e.createAnother&&!t}async function qSe(r,e,t){await(t==="new-tab"?r.workspace.getLeaf("tab"):r.workspace.getLeaf(!1)).openFile(e)}function yot(r,e,t){let n=(ZB(),NA(KB));return new n.EmbeddableMarkdownEditor(r,e,t)}var io,RN,USe,fot,hot,Pm,FN=y(()=>{io=require("obsidian");Hq();Ct();Lc();Me();CSe();PSe();NSe();Wq();cq();Kk();JB();Uq();K();RN=N({tag:"Modals/TaskCreationModal"}),USe="Failed to create task: ",fot=["button","a[href]","input","select","textarea","[tabindex]:not([tabindex='-1'])",".tn-task-modal__markdown-editor--nlp"].join(", "),hot=new Set(["A","BUTTON","INPUT","SELECT","TEXTAREA"]);Pm=class r extends Yk{constructor(t,n,a={}){super(t,n);this.nlInput=void 0;this.nlMarkdownEditor=null;this.nlPreviewContainer=void 0;this.nlButtonContainer=void 0;this.nlpSuggest=null;this.eventListeners=[];this.options=a,this.nlParser=ra.fromPlugin(n)}getModalTitle(){return this.t("modals.taskCreation.title")}isCreationMode(){return!0}addTrackedEventListener(t,n,a){t.addEventListener(n,a),this.eventListeners.push({element:t,event:n,handler:a})}removeAllEventListeners(){for(let{element:t,event:n,handler:a}of this.eventListeners)t.removeEventListener(n,a);this.eventListeners=[]}createPrimaryInput(t){this.plugin.settings.enableNaturalLanguageInput?this.createNaturalLanguageInput(t):(this.createTitleInput(t),this.isExpanded=!0,this.containerEl.addClass("expanded"))}createAdditionalSections(t){(this.options.prePopulatedValues&&this.options.prePopulatedValues.projects||this.selectedProjectItems.length>0)&&this.renderProjectsList()}createNaturalLanguageInput(t){let n=t.createDiv("nl-input-container"),a=n.createDiv("tn-task-modal__markdown-editor tn-task-modal__markdown-editor--nlp");a.setAttribute("role","textbox"),a.setAttribute("aria-label",this.t("modals.taskCreation.nlPlaceholder")),a.setAttribute("aria-multiline","true"),this.nlPreviewContainer=n.createDiv("nl-preview-container"),this.nlPreviewContainer.setAttribute("role","status"),this.nlPreviewContainer.setAttribute("aria-live","polite"),this.nlPreviewContainer.setAttribute("aria-label","Task preview");try{let i=xSe(this.plugin);this.nlMarkdownEditor=yot(this.app,a,{value:"",placeholder:this.t("modals.taskCreation.nlPlaceholder"),cls:"nlp-editor",extensions:i,enterVimInsertMode:!0,onChange:s=>{s.trim()?this.updateNaturalLanguagePreview(s.trim()):this.clearNaturalLanguagePreview()},onSubmit:(s,o)=>{this.handleSubmitShortcut(o)},onEscape:()=>{this.close()},onTab:(s,o)=>o?this.focusPreviousNaturalLanguageField(a):(this.isExpanded||this.expandModal(),window.setTimeout(()=>{let l=this.modalEl.querySelector(".title-input-detailed");l&&l.focus()},50),!0),onEnter:(s,o,l)=>!!o})}catch(i){RN.error("Failed to create NLP markdown editor:",{category:"persistence",operation:"create-nlp-markdown-editor",error:i}),this.nlInput=a.createEl("textarea",{cls:"nl-input",attr:{placeholder:this.t("modals.taskCreation.nlPlaceholder"),rows:"3"}});let s=()=>{let l=this.nlInput.value.trim();l?this.updateNaturalLanguagePreview(l):this.clearNaturalLanguagePreview()};this.addTrackedEventListener(this.nlInput,"input",s);let o=l=>{let c=this.nlInput.value.trim();if(!c)return;let d=l;d.key==="Enter"&&(d.ctrlKey||d.metaKey)?(d.preventDefault(),this.handleSubmitShortcut(d.shiftKey)):d.key==="Tab"&&d.shiftKey&&(d.preventDefault(),this.parseAndFillForm(c))};this.addTrackedEventListener(this.nlInput,"keydown",o),this.nlpSuggest=new Rk(this.app,this.nlInput,this.plugin)}}focusPreviousNaturalLanguageField(t){let n=this.modalEl.contains(t)?this.modalEl:this.contentEl,a=Array.from(n.querySelectorAll(fot)),i=a.findIndex(o=>o===t||t.contains(o));if(i<=0)return!0;let s=a.slice(0,i).reverse().find(got);return s&&window.setTimeout(()=>{s.focus()},50),!0}focusTitleInput(){if(!this.plugin.settings.enableNaturalLanguageInput){super.focusTitleInput();return}window.setTimeout(()=>{var n,a;let t=(a=(n=this.nlMarkdownEditor)==null?void 0:n.editor)==null?void 0:a.cm;if(t){t.focus(),t.scrollDOM.scrollTop=0;return}this.nlInput&&(this.nlInput.focus({preventScroll:!0}),this.nlInput.select())},this.getInitialFocusDelay())}updateNaturalLanguagePreview(t){if(!this.nlPreviewContainer)return;let n=this.nlParser.parseInput(t),a=this.nlParser.getPreviewData(n);a.length>0&&n.title?(this.nlPreviewContainer.empty(),this.nlPreviewContainer.classList.add("nl-preview-container--visible"),this.nlPreviewContainer.classList.remove("tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),a.forEach(i=>{let s=this.nlPreviewContainer.createDiv("nl-preview-item");s.textContent=i.text})):this.clearNaturalLanguagePreview()}clearNaturalLanguagePreview(){this.nlPreviewContainer&&(this.nlPreviewContainer.empty(),this.nlPreviewContainer.classList.remove("nl-preview-container--visible"),this.nlPreviewContainer.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"))}getNLPInputValue(){return this.nlMarkdownEditor?this.nlMarkdownEditor.value:this.nlInput?this.nlInput.value:""}createActionBar(t){if(this.actionBar=t.createDiv("tn-task-modal__action-bar"),this.plugin.settings.enableNaturalLanguageInput){this.createActionIcon(this.actionBar,"wand",this.t("modals.taskCreation.actions.fillFromNaturalLanguage"),(a,i)=>{let s=this.getNLPInputValue().trim();s&&this.parseAndFillForm(s)}),this.createActionIcon(this.actionBar,this.isExpanded?"chevron-up":"chevron-down",this.isExpanded?this.t("modals.taskCreation.actions.hideDetailedOptions"):this.t("modals.taskCreation.actions.showDetailedOptions"),(a,i)=>{this.toggleDetailedForm();let s=a.querySelector(".icon");s&&(0,io.setIcon)(s,this.isExpanded?"chevron-up":"chevron-down"),(0,io.setTooltip)(a,this.isExpanded?this.t("modals.taskCreation.actions.hideDetailedOptions"):this.t("modals.taskCreation.actions.showDetailedOptions"),{placement:"top"})});let n=this.actionBar.createDiv("action-separator");n.classList.remove("tn-static-width-100-0466783d","tn-static-width-12px-fbf353fb","tn-static-width-16px-7375d50b","tn-static-width-200px-2acaf3b5","tn-static-width-60px-bd09c419","tn-static-width-80px-8573bae3"),n.classList.add("tn-static-width-1px-aa77e27e"),n.classList.remove("tn-static-display-flex-4d51fc62","tn-static-height-0-7a31cef0","tn-static-height-100-62264068","tn-static-height-12px-06c0747e","tn-static-height-16px-30de4aee","tn-static-min-height-800px-997b4c8c"),n.classList.add("tn-static-height-24px-29a11d37"),n.classList.remove("tn-static-background-color-var-background-se-9087a23e","tn-static-background-color-var-color-base-40-ef5f175e","tn-static-background-color-var-color-red-134bc721","tn-static-background-color-var-text-accent-a954c70f"),n.classList.add("tn-static-background-color-var-background-mo-94b219f0"),n.classList.remove("tn-static-margin-0-11696618","tn-static-margin-0-auto-266e9b04","tn-static-margin-0-db0d5f36","tn-static-margin-2px-0-edce9b14","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-12px-43bef435","tn-static-padding-20px-ebe8e48c"),n.classList.add("tn-static-margin-0-var-size-4-2-77f7dc08")}this.createCoreActionIcons(this.actionBar),this.updateIconStates()}parseAndFillForm(t){let n=this.nlParser.parseInput(t);this.applyParsedData(n),this.isExpanded||this.expandModal()}applyParsedData(t){var n;if(t.title&&(this.title=t.title),t.status&&(this.status=t.status),t.priority&&(this.priority=t.priority),t.dueDate&&(this.dueDate=t.dueTime?La(t.dueDate,t.dueTime):t.dueDate),t.scheduledDate&&(this.scheduledDate=t.scheduledTime?La(t.scheduledDate,t.scheduledTime):t.scheduledDate),t.contexts&&t.contexts.length>0&&(this.contexts=t.contexts.join(", ")),t.tags&&t.tags.length>0&&(this.tags=za(t.tags.join(", "))),t.details&&(this.details=t.details),t.recurrence&&(this.recurrenceRule=t.recurrence),t.estimate!==void 0&&(this.timeEstimate=t.estimate>0?t.estimate:0,this.timeEstimateInput&&(this.timeEstimateInput.value=this.timeEstimate>0?this.timeEstimate.toString():"")),this.titleInput&&(this.titleInput.value=this.title),this.detailsInput&&(this.detailsInput.value=this.details),xpe(this.detailsMarkdownEditor,this.details),this.contextsInput&&(this.contextsInput.value=this.contexts),this.tagsInput&&(this.tagsInput.value=this.tags),t.projects&&t.projects.length>0&&(this.addProjectsFromStrings(t.projects),this.renderProjectsList()),t.userFields){for(let[a,i]of Object.entries(t.userFields)){let s=(n=this.plugin.settings.userFields)==null?void 0:n.find(o=>o.id===a);s&&(this.userFields[s.key]=i)}this.updateUserFieldControls()}this.updateIconStates()}toggleDetailedForm(){this.isExpanded?(this.isExpanded=!1,MN({detailsContainer:this.detailsContainer,splitRightColumn:this.splitRightColumn}),this.containerEl.removeClass("expanded")):this.expandModal()}async initializeFormData(){let t=ISe({defaultPriority:this.plugin.settings.defaultTaskPriority,defaultStatus:this.plugin.settings.defaultTaskStatus,taskCreationDefaults:this.plugin.settings.taskCreationDefaults,taskTag:this.plugin.settings.taskTag,userFields:this.plugin.settings.userFields,prePopulatedValues:this.options.prePopulatedValues});this.title=t.title,this.dueDate=t.dueDate,this.scheduledDate=t.scheduledDate,this.priority=t.priority,this.status=t.status,this.contexts=t.contexts,this.tags=t.tags,this.timeEstimate=t.timeEstimate,this.recurrenceRule=t.recurrenceRule,this.recurrenceAnchor=t.recurrenceAnchor,this.reminders=t.reminders,this.userFields=t.userFields,t.projectStrings.length>0&&this.initializeProjectsFromStrings(t.projectStrings),this.details=this.normalizeDetails(this.details),this.originalDetails=this.details}async handleSubmitShortcut(t){await this.handleSave({createAnother:t})}async handleSave(t={}){if(this.plugin.settings.enableNaturalLanguageInput){let n=this.getNLPInputValue().trim();if(n&&!this.title.trim()){let a=this.nlParser.parseInput(n);this.applyParsedData(a)}}if(!this.validateForm()){new io.Notice(this.t("modals.taskCreation.notices.titleRequired"));return}try{let n=this.buildTaskData(),a=await this.plugin.taskService.createTask(n,{applyDefaults:!1}),i=a.taskInfo;if(NN(this.plugin.settings,a.taskInfo.title,a.file.basename)?new io.Notice(this.t("modals.taskCreation.notices.successShortened",{title:i.title})):new io.Notice(this.t("modals.taskCreation.notices.success",{title:i.title})),this.blockingItems.length>0){let s=DSe(this.blockingItems);if(s.added.length>0){await this.plugin.taskService.updateBlockingRelationships(i,s.added,[],s.raw);let o=await this.plugin.cacheManager.getTaskInfo(i.path);o&&(i=o)}s.unresolved.length>0&&new io.Notice(this.t("modals.taskCreation.notices.blockingUnresolved",{entries:s.unresolved.join(", ")})),this.blockingItems=[]}this.selectedSubtaskFiles.length>0&&await this.applySubtaskAssignments(i),this.options.onTaskCreated&&this.options.onTaskCreated(i),await this.openCreatedTaskIfConfigured(a.file,t),this.close(),t.createAnother&&window.setTimeout(()=>{new r(this.app,this.plugin,this.options).open()},0)}catch(n){RN.error("Failed to create task:",{category:"persistence",operation:"create-task",error:n});let a=HSe(n);new io.Notice(this.t("modals.taskCreation.notices.failure",{message:a}))}}async openCreatedTaskIfConfigured(t,n){var i;let a=(i=this.plugin.settings.openTaskAfterCreation)!=null?i:"none";if(VSe(a,n,!!this.options.onTaskCreated))try{await qSe(this.app,t,a)}catch(s){RN.error("Failed to open created task note:",{category:"persistence",operation:"open-created-task-note",error:s}),new io.Notice(this.t("modals.taskCreation.notices.openCreatedTaskFailure"))}}buildTaskData(){var a;let t=ESe({title:this.title,dueDate:this.dueDate,scheduledDate:this.scheduledDate,priority:this.priority,status:this.status,contexts:this.contexts,projects:this.projects,tags:this.tags,timeEstimate:this.timeEstimate,recurrenceRule:this.recurrenceRule,recurrenceAnchor:this.recurrenceAnchor,reminders:this.reminders,blockedByItems:this.blockedByItems,details:this.details,userFields:this.userFields,creationContext:this.options.creationContext,taskIdentificationMethod:this.plugin.settings.taskIdentificationMethod,taskTag:this.plugin.settings.taskTag,normalizeDetails:i=>this.normalizeDetails(i)}),n=(a=this.options.prePopulatedValues)==null?void 0:a.customFrontmatter;return n&&(t.customFrontmatter={...n,...t.customFrontmatter}),t}createTitleInput(t){this.plugin.settings.enableNaturalLanguageInput||super.createTitleInput(t)}async applySubtaskAssignments(t){let n=this.app.vault.getAbstractFileByPath(t.path);n instanceof io.TFile&&await RSe({currentTaskFile:n,subtaskFiles:this.selectedSubtaskFiles,getTaskInfo:a=>this.plugin.cacheManager.getTaskInfo(a),buildProjectReference:(a,i)=>this.buildProjectReference(a,i),updateTaskProjects:(a,i)=>this.plugin.updateTaskProperty(a,"projects",i),onError:a=>{RN.error("Failed to assign subtask:",{category:"persistence",operation:"assign-subtask",error:a})}})}onClose(){this.nlMarkdownEditor&&(this.nlMarkdownEditor.destroy(),this.nlMarkdownEditor=null),this.nlpSuggest&&(this.nlpSuggest.close(),this.nlpSuggest=null),this.removeAllEventListeners(),super.onClose()}}});var Jk,BN,nW=y(()=>{Jk=class{constructor(){this.inFlightRequests=new Map;this.prefetchQueue=new Set;this.prefetchPromises=new Map;this.activeTimeouts=new Set}async execute(e,t,n=5e3){if(this.inFlightRequests.has(e))return this.inFlightRequests.get(e);let a=this.createRequest(e,t,n);return this.inFlightRequests.set(e,a),a}async createRequest(e,t,n){try{let a=await t(),i=window.setTimeout(()=>{this.inFlightRequests.delete(e),this.activeTimeouts.delete(i)},n);return this.activeTimeouts.add(i),a}catch(a){throw this.inFlightRequests.delete(e),a}}prefetch(e,t,n="low"){if(!(this.inFlightRequests.has(e)||this.prefetchPromises.has(e)))if(n==="high")this.executePrefetch(e,t);else if(this.prefetchQueue.add(e),"requestIdleCallback"in window)requestIdleCallback(()=>{this.processPrefetchQueue(e,t)});else{let i=window.setTimeout(()=>{this.processPrefetchQueue(e,t),this.activeTimeouts.delete(i)},50);this.activeTimeouts.add(i)}}async executePrefetch(e,t){try{let n=t();this.prefetchPromises.set(e,n),await n;let a=window.setTimeout(()=>{this.prefetchPromises.delete(e),this.activeTimeouts.delete(a)},3e4);this.activeTimeouts.add(a)}catch(n){this.prefetchPromises.delete(e)}}processPrefetchQueue(e,t){this.prefetchQueue.has(e)&&(this.prefetchQueue.delete(e),this.executePrefetch(e,t))}getPrefetchedData(e){return this.prefetchPromises.get(e)||null}cancel(e){this.inFlightRequests.delete(e),this.prefetchPromises.delete(e),this.prefetchQueue.delete(e)}cancelAll(){this.inFlightRequests.clear(),this.prefetchPromises.clear(),this.prefetchQueue.clear();for(let e of this.activeTimeouts)window.clearTimeout(e);this.activeTimeouts.clear()}getStats(){return{inFlightCount:this.inFlightRequests.size,prefetchCount:this.prefetchPromises.size,queuedCount:this.prefetchQueue.size}}},BN=class{constructor(e){this.lastAccessTime=new Map;this.deduplicator=e}recordAccess(e,t,n){let a=this.getDateKey(e);this.lastAccessTime.set(a,Date.now()),this.prefetchAdjacentDates(e,t,n)}prefetchAdjacentDates(e,t,n){this.getAdjacentDates(e).forEach(({date:i,priority:s})=>{let o=`${t}-${this.getDateKey(i)}`;this.deduplicator.prefetch(o,()=>n(i),s)})}getAdjacentDates(e){let t=[],n=new Date(e);n.setDate(e.getDate()-1),t.push({date:n,priority:"high"});let a=new Date(e);a.setDate(e.getDate()+1),t.push({date:a,priority:"high"});for(let i=2;i<=7;i++){let s=new Date(e);s.setDate(e.getDate()-i),t.push({date:s,priority:"low"});let o=new Date(e);o.setDate(e.getDate()+i),t.push({date:o,priority:"low"})}return t}getDateKey(e){return e.toISOString().split("T")[0]}cleanup(){let e=Date.now(),t=1440*60*1e3;for(let[n,a]of this.lastAccessTime)e-a>t&&this.lastAccessTime.delete(n)}}});var Oot,Xk,UN,yxe=y(()=>{K();Oot=N({tag:"Utils/DOMReconciler"}),Xk=class{constructor(){this.updateQueue=[];this.isProcessing=!1;this.activeTimeouts=new Set}scheduleUpdate(e){this.updateQueue.push(e),this.isProcessing||(this.isProcessing=!0,window.requestAnimationFrame(()=>{this.processUpdates()}))}processUpdates(){let e=[...this.updateQueue];this.updateQueue=[];try{e.forEach(t=>{try{t()}catch(n){Oot.error("Error processing DOM update:",{category:"validation",operation:"processing-dom-update",error:n})}})}finally{this.isProcessing=!1,this.updateQueue.length>0&&window.requestAnimationFrame(()=>{this.processUpdates()})}}updateAttributes(e,t){for(let[n,a]of Object.entries(t))a===null?e.removeAttribute(n):e.getAttribute(n)!==a&&e.setAttribute(n,a)}updateClasses(e,t){for(let[n,a]of Object.entries(t))a?e.classList.add(n):e.classList.remove(n)}updateTextContent(e,t){e.textContent!==t&&(e.textContent=t)}updateStyles(e,t){for(let[n,a]of Object.entries(t))a===null?e.style.removeProperty(n):e.style.setProperty(n,a)}preserveState(e){let t={scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,focused:activeDocument.activeElement===e,selection:null};return(e.instanceOf(HTMLInputElement)||e.instanceOf(HTMLTextAreaElement))&&(t.selection={start:e.selectionStart||0,end:e.selectionEnd||0}),t}restoreState(e,t){e.scrollTop=t.scrollTop,e.scrollLeft=t.scrollLeft,t.focused&&e.focus(),t.selection&&(e.instanceOf(HTMLInputElement)||e.instanceOf(HTMLTextAreaElement))&&e.setSelectionRange(t.selection.start,t.selection.end)}animateUpdate(e,t,n=1500){e.classList.add(`task-${t}`);let a=window.setTimeout(()=>{e.classList.remove(`task-${t}`),this.activeTimeouts.delete(a)},n);this.activeTimeouts.add(a)}updateList(e,t,n,a,i){let s=new Map,o=new Set;Array.from(e.children).forEach(d=>{let u=d.dataset.key;u&&(s.set(u,d),o.add(u))});let l=new Set(t.map(n)),c=activeWindow.createFragment();t.forEach(d=>{let u=n(d),p=s.get(u);if(p)i&&i(p,d),c.appendChild(p);else{let m=a(d);m.dataset.key=u,c.appendChild(m)}}),o.forEach(d=>{if(!l.has(d)){let u=s.get(d);u&&u.parentNode&&u.remove()}}),e.replaceChildren(c)}createOptimisticUpdate(e,t,n){return t(e),{commit:()=>{},revert:()=>{n(e)}}}destroy(){this.updateQueue=[],this.isProcessing=!1;for(let e of this.activeTimeouts)window.clearTimeout(e);this.activeTimeouts.clear()}},UN=class{constructor(){this.stateMap=new Map}saveState(e,t){let n=new Xk;this.stateMap.set(e,n.preserveState(t))}restoreState(e,t){let n=this.stateMap.get(e);n&&new Xk().restoreState(t,n)}clearState(e){e?this.stateMap.delete(e):this.stateMap.clear()}destroy(){this.stateMap.clear()}}});var vxe=y(()=>{p2()});var eb,aW=y(()=>{kS();Mc();eb=class r{constructor(e,t="open"){this.statuses=e;this.defaultStatus=t}normalizeStatusValue(e){var t;return(t=Yp(e,this.statuses))!=null?t:String(e)}findStatusIndex(e,t){let n=this.normalizeStatusValue(t);return e.findIndex(a=>this.normalizeStatusValue(a.value)===n)}getCycleStatuses(){return this.getStatusesByOrder().filter(e=>!e.excludeFromCycle)}getNextStatus(e){var l,c;let t=this.getStatusConfig(e),n=t?this.normalizeStatusValue(t.value):void 0,a=t!=null&&t.nextStatus?this.normalizeStatusValue(t.nextStatus):void 0,i=a&&a!==n?this.getStatusConfig(a):void 0;if(i)return i.value;let s=this.getCycleStatuses(),o=this.findStatusIndex(s,e);if(s.length===0)return(t==null?void 0:t.value)||this.defaultStatus;if(o!==-1){let d=(o+1)%s.length;return s[d].value}return t?((c=s.find(d=>d.order>t.order))==null?void 0:c.value)||s[0].value:((l=s[0])==null?void 0:l.value)||this.defaultStatus}getPreviousStatus(e){var i,s,o;let t=this.getCycleStatuses(),n=this.findStatusIndex(t,e);if(t.length===0)return((i=this.getStatusConfig(e))==null?void 0:i.value)||this.defaultStatus;if(n!==-1){let l=(n-1+t.length)%t.length;return t[l].value}let a=this.getStatusConfig(e);return a?((o=[...t].reverse().find(l=>l.orderthis.normalizeStatusValue(n.value)===t)}getCompletedStatuses(){return this.statuses.filter(e=>e.isCompleted).map(e=>e.value)}getOpenStatuses(){return this.statuses.filter(e=>!e.isCompleted).map(e=>e.value)}getStatusesByOrder(){return[...this.statuses].sort((e,t)=>e.order-t.order)}isCompletedStatus(e){let t=this.getStatusConfig(e);return(t==null?void 0:t.isCompleted)||!1}getStatusOrder(e){let t=this.getStatusConfig(e);return(t==null?void 0:t.order)||0}getStatusColorVariables(){return this.statuses.map(e=>[`--status-${e.value.replace(/[^a-zA-Z0-9-]/g,"-")}-color`,_r(e.color)])}getAllStatuses(){return[...this.statuses]}getNonCompletionStatuses(){return this.statuses.filter(e=>!e.isCompleted)}updateStatuses(e){this.statuses=e}static validateStatuses(e){let t=[];e.length<2&&t.push("At least 2 statuses are required"),e.some(l=>l.isCompleted)||t.push("At least one status must be marked as completed");let a=e.map(l=>l.value),i=new Set(a);a.length!==i.size&&t.push("Status values must be unique");let s=e.map(l=>l.id),o=new Set(s);s.length!==o.size&&t.push("Status IDs must be unique");for(let l of e){if(!l.value||l.value.trim()===""){t.push("Status values cannot be empty");break}if(!l.label||l.label.trim()===""){t.push("Status labels cannot be empty");break}if(!C_(l.color)){t.push("Status colors must be valid CSS colors or Obsidian theme colors");break}}return{valid:t.length===0,errors:t}}static generateStatusId(e){let t=new Set(e.map(i=>i.id)),n=1,a=`status-${n}`;for(;t.has(a);)n++,a=`status-${n}`;return a}static createDefaultStatus(e){let t=r.generateStatusId(e),n=Math.max(...e.map(a=>a.order),0)+1;return{id:t,value:"new-status",label:"New status",color:"#808080",isCompleted:!1,excludeFromCycle:!1,order:n,autoArchive:!1,autoArchiveDelay:5}}}});var HN,kxe=y(()=>{kS();Mc();HN=class r{constructor(e){this.priorities=e}normalizePriorityValue(e){var t;return(t=Gp(e,this.priorities))!=null?t:String(e)}getPriorityConfig(e){let t=this.normalizePriorityValue(e);return this.priorities.find(n=>n.value===t)}getPrioritiesByWeight(){return[...this.priorities].sort((e,t)=>t.weight-e.weight)}getPrioritiesByWeightAsc(){return[...this.priorities].sort((e,t)=>e.weight-t.weight)}getNextPriority(e){var s;let t=this.getPrioritiesByWeightAsc(),n=this.normalizePriorityValue(e),a=t.findIndex(o=>o.value===n);if(a===-1)return((s=t[0])==null?void 0:s.value)||"normal";let i=(a+1)%t.length;return t[i].value}comparePriorities(e,t){let n=this.getPriorityConfig(e),a=this.getPriorityConfig(t),i=(n==null?void 0:n.weight)||0;return((a==null?void 0:a.weight)||0)-i}getPriorityColorVariables(){return this.priorities.map(e=>[`--priority-${e.value.replace(/[^a-zA-Z0-9-]/g,"-")}-color`,_r(e.color)])}getAllPriorities(){return[...this.priorities]}updatePriorities(e){this.priorities=e}getHighestPriority(){var t;return(t=this.getPrioritiesByWeight()[0])==null?void 0:t.value}getLowestPriority(){var t;return(t=this.getPrioritiesByWeightAsc()[0])==null?void 0:t.value}getPriorityWeight(e){let t=this.getPriorityConfig(e);return(t==null?void 0:t.weight)||0}isHigherPriority(e,t){return this.comparePriorities(e,t)>0}static validatePriorities(e){let t=[];e.length<1&&t.push("At least 1 priority is required");let n=e.map(c=>c.value),a=new Set(n);n.length!==a.size&&t.push("Priority values must be unique");let i=e.map(c=>c.id),s=new Set(i);i.length!==s.size&&t.push("Priority IDs must be unique");let o=e.map(c=>c.weight),l=new Set(o);o.length!==l.size&&t.push("Priority weights must be unique");for(let c of e){if(!c.value||c.value.trim()===""){t.push("Priority values cannot be empty");break}if(!c.label||c.label.trim()===""){t.push("Priority labels cannot be empty");break}if(!C_(c.color)){t.push("Priority colors must be valid CSS colors or Obsidian theme colors");break}if(typeof c.weight!="number"||c.weight<0){t.push("Priority weights must be non-negative numbers");break}}return{valid:t.length===0,errors:t}}static generatePriorityId(e){let t=new Set(e.map(i=>i.id)),n=1,a=`priority-${n}`;for(;t.has(a);)n++,a=`priority-${n}`;return a}static generatePriorityWeight(e){let t=e.map(n=>n.weight);return t.length===0?1:Math.max(...t)+1}static createDefaultPriority(e){let t=r.generatePriorityId(e),n=r.generatePriorityWeight(e);return{id:t,value:"new-priority",label:"New priority",color:"#808080",weight:n}}}});function bxe({path:r,mappedTask:e,defaultTaskStatus:t,isBlocked:n,blockingTasks:a}){let i=e.timeEntries?Li(e.timeEntries):0;return{...e,id:r,path:r,title:e.title||"Untitled task",status:e.status||t,priority:e.priority||"normal",archived:e.archived||!1,tags:Array.isArray(e.tags)?e.tags:[],contexts:Array.isArray(e.contexts)?e.contexts:[],projects:Array.isArray(e.projects)?e.projects:[],totalTrackedTime:i,isBlocked:n,isBlocking:a.length>0,blocking:a.length>0?a:void 0}}var Txe=y(()=>{Ct()});function Lot(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}function wxe(r,e){if(typeof r=="boolean"){let t=e.toLowerCase();if(t==="true"||t==="false")return r===(t==="true")}return r===e}function Sxe(r,e){if(!Lot(r))return!1;if(e.taskIdentificationMethod==="property"){let n=e.taskPropertyName,a=e.taskPropertyValue;if(!n||!a)return!1;let i=r[n];return i===void 0?!1:Array.isArray(i)?i.some(s=>wxe(s,a)):wxe(i,a)}return xc(r.tags).some(n=>br.matchesHierarchicalTagExact(n,e.taskTag))}var xxe=y(()=>{Du();Dv()});var Wo,gg,VN,Cxe=y(()=>{Wo=require("obsidian");Yr();kS();Me();mS();Txe();xxe();K();gg=N({tag:"Utils/TaskManager"}),VN=class extends Wo.Events{constructor(t,n,a){super();this.initialized=!1;this.eventListeners=[];this.debouncedHandlers=new Map;this.DEBOUNCE_DELAY=300;this.pendingTaskInfoByPath=new Map;this.filterIndexesBuilt=!1;this.indexedTaskPaths=new Set;this.taskFilterEntries=new Map;this.statusIndex=new Map;this.priorityIndex=new Map;this.dueDateIndex=new Map;this.scheduledDateIndex=new Map;this.tagCounts=new Map;this.contextCounts=new Map;this.projectCounts=new Map;this._dependencyCache=void 0;this.app=t,this.settings=n,this.taskTag=n.taskTag,this.excludedFolders=Sc(n.excludedFolders),this.fieldMapper=a,this.disableNoteIndexing=n.disableNoteIndexing,this.storeTitleInFilename=n.storeTitleInFilename}initialize(){this.initialized||(this.setupNativeEventListeners(),this.initialized=!0,this.trigger("cache-initialized",{message:"Task manager ready"}))}getApp(){return this.app}isTaskFile(t){return Sxe(t,this.settings)}setupNativeEventListeners(){let t=this.app.metadataCache.on("changed",(i,s,o)=>{i instanceof Wo.TFile&&i.extension==="md"&&this.isValidFile(i.path)&&this.handleFileChangedDebounced(i,o)});this.eventListeners.push(t);let n=this.app.metadataCache.on("deleted",(i,s)=>{i instanceof Wo.TFile&&i.extension==="md"&&this.handleFileDeleted(i.path,s)});this.eventListeners.push(n);let a=this.app.vault.on("rename",(i,s)=>{i instanceof Wo.TFile&&i.extension==="md"&&this.handleFileRenamed(i,s)});this.eventListeners.push(a)}handleFileChangedDebounced(t,n){let a=t.path,i=this.debouncedHandlers.get(a);i&&window.clearTimeout(i);let s=window.setTimeout(()=>{this.debouncedHandlers.delete(a),this.handleFileChanged(t,n)},this.DEBOUNCE_DELAY);this.debouncedHandlers.set(a,s)}async handleFileChanged(t,n){let a=null,i=!1;if(n&&typeof n=="object"&&"frontmatter"in n){let s=n.frontmatter;if(s&&this.isTaskFile(s)){let o=this.extractTaskInfoFromNative(t.path,s),l=this.getPendingTaskInfo(t.path);l&&this.shouldUsePendingTaskInfo(l,o)?a=l:(this.pendingTaskInfoByPath.delete(t.path),a=o)}else this.pendingTaskInfoByPath.delete(t.path)}i=this.updateFilterIndexesForFile(t.path,n),this.trigger("file-updated",{path:t.path,file:t,updatedTask:a,filterIndexChanged:i}),a&&this.trigger(ot,{path:t.path,task:a,taskInfo:a,updatedTask:a}),this.trigger("data-changed")}handleFileDeleted(t,n){this.pendingTaskInfoByPath.delete(t),this.removeFilterIndexEntry(t);let a=this.debouncedHandlers.get(t);a&&(window.clearTimeout(a),this.debouncedHandlers.delete(t)),this.trigger("file-deleted",{path:t,prevCache:n}),this.trigger("data-changed")}handleFileRenamed(t,n){let a=this.pendingTaskInfoByPath.get(n);a&&(this.pendingTaskInfoByPath.delete(n),this.pendingTaskInfoByPath.set(t.path,{...a,id:t.path,path:t.path}));let i=this.debouncedHandlers.get(n);i&&(window.clearTimeout(i),this.debouncedHandlers.delete(n)),this.removeFilterIndexEntry(n),this.updateFilterIndexesForFile(t.path,this.app.metadataCache.getFileCache(t)),this.trigger("file-renamed",{oldPath:n,newPath:t.path,file:t}),this.trigger("data-changed")}isValidFile(t){return!Cv(t,this.excludedFolders)}async getTaskInfo(t){if(!this.isValidFile(t))return null;let n=this.app.vault.getAbstractFileByPath(t);if(!(n instanceof Wo.TFile))return null;let a=this.getPendingTaskInfo(t),i=this.app.metadataCache.getFileCache(n);if(!(i!=null&&i.frontmatter)){if(a)return a;if(i)return null;let o=await this.readFrontmatterFromFile(n);return!o||!this.isTaskFile(o)?null:this.extractTaskInfoFromNative(t,o)}let s=this.isTaskFile(i.frontmatter)?this.extractTaskInfoFromNative(t,i.frontmatter):null;return a&&this.shouldUsePendingTaskInfo(a,s)?a:(this.pendingTaskInfoByPath.delete(t),s)}getPendingTaskInfo(t){var a;let n=this.pendingTaskInfoByPath.get(t);return n?{...n,id:(a=n.id)!=null?a:t,path:t}:null}shouldUsePendingTaskInfo(t,n){return n?t.dateModified?n.dateModified!==t.dateModified:!1:!0}extractTaskInfoFromNative(t,n){if(!n||!this.fieldMapper||!this.isTaskFile(n))return null;try{let a=this.fieldMapper.mapFromFrontmatter(n,t,this.storeTitleInFilename),i=!1,s=[];return this._dependencyCache?(i=this._dependencyCache.isTaskBlocked(t),s=this._dependencyCache.getBlockedTaskPaths(t)):i=Array.isArray(a.blockedBy)&&a.blockedBy.length>0,bxe({path:t,mappedTask:a,defaultTaskStatus:this.settings.defaultTaskStatus,isBlocked:i,blockingTasks:s})}catch(a){return gg.error(`Error extracting task info from native metadata for ${t}:`,{category:"persistence",operation:"extracting-task-info-native-metadata",error:a}),null}}ensureFilterIndexes(){if(!this.filterIndexesBuilt){this.clearFilterIndexes();for(let t of this.app.vault.getMarkdownFiles()){if(!this.isValidFile(t.path))continue;let n=this.app.metadataCache.getFileCache(t);if(n!=null&&n.frontmatter&&this.isTaskFile(n.frontmatter)){let a=this.createFilterIndexEntry(t.path,n.frontmatter);this.addFilterIndexEntry(a)}}this.filterIndexesBuilt=!0}}updateFilterIndexesForFile(t,n){var o;if(!this.filterIndexesBuilt)return!0;if(!this.isValidFile(t))return this.removeFilterIndexEntry(t);let a=(o=this.getFrontmatterFromCache(n))!=null?o:this.getFrontmatterForPath(t);if(!a||!this.isTaskFile(a))return this.removeFilterIndexEntry(t);let i=this.createFilterIndexEntry(t,a),s=this.taskFilterEntries.get(t);return(s==null?void 0:s.signature)===i.signature?!1:(s&&this.removeFilterIndexEntry(t),this.addFilterIndexEntry(i),!0)}updateFilterIndexesFromTaskInfo(t,n){if(!this.filterIndexesBuilt)return!0;if(!this.isValidFile(t))return this.removeFilterIndexEntry(t);let a=this.createFilterIndexEntryFromTaskInfo(t,n),i=this.taskFilterEntries.get(t);return(i==null?void 0:i.signature)===a.signature?!1:(i&&this.removeFilterIndexEntry(t),this.addFilterIndexEntry(a),!0)}getFrontmatterFromCache(t){if(!t||typeof t!="object"||!("frontmatter"in t))return null;let n=t.frontmatter;return!n||typeof n!="object"||Array.isArray(n)?null:n}getFrontmatterForPath(t){let n=this.app.vault.getAbstractFileByPath(t);return n instanceof Wo.TFile?this.getFrontmatterFromCache(this.app.metadataCache.getFileCache(n)):null}createFilterIndexEntry(t,n){var S,C,E,D,P,O,z,R,A,F;let a=((S=this.fieldMapper)==null?void 0:S.toUserField("status"))||"status",i=((C=this.fieldMapper)==null?void 0:C.toUserField("priority"))||"priority",s=((E=this.fieldMapper)==null?void 0:E.toUserField("scheduled"))||"scheduled",o=((D=this.fieldMapper)==null?void 0:D.toUserField("due"))||"due",l=((P=this.fieldMapper)==null?void 0:P.toUserField("contexts"))||"context",c=((O=this.fieldMapper)==null?void 0:O.toUserField("projects"))||"project",d=((z=this.fieldMapper)==null?void 0:z.toUserField("timeEstimate"))||"timeEstimate",u=(R=Yp(n[a],this.settings.customStatuses))!=null?R:void 0,p=(A=Gp(n[i],this.settings.customPriorities))!=null?A:void 0,m=this.normalizeDateValue(n[o]),f=this.normalizeDateValue(n[s]),h=this.normalizeStringValues(n.tags,!1),g=this.normalizeStringValues(n[l],!0),v=this.normalizeStringValues(n[c],!0),b=n[d],k=typeof b=="number"&&b>0?b:void 0,w=((F=this.settings.customStatuses)==null?void 0:F.some($=>$.value===u&&$.isCompleted))||!1;return this.withFilterIndexSignature({path:t,status:u,priority:p,dueDate:m,scheduledDate:f,tags:h,contexts:g,projects:v,timeEstimate:k,isCompleted:w,signature:""})}createFilterIndexEntryFromTaskInfo(t,n){var m,f,h;let a=(m=Yp(n.status,this.settings.customStatuses))!=null?m:void 0,i=(f=Gp(n.priority,this.settings.customPriorities))!=null?f:void 0,s=this.normalizeDateValue(n.due),o=this.normalizeDateValue(n.scheduled),l=this.normalizeStringValues(n.tags,!1),c=this.normalizeStringValues(n.contexts,!0),d=this.normalizeStringValues(n.projects,!0),u=typeof n.timeEstimate=="number"&&n.timeEstimate>0?n.timeEstimate:void 0,p=((h=this.settings.customStatuses)==null?void 0:h.some(g=>g.value===a&&g.isCompleted))||!1;return this.withFilterIndexSignature({path:t,status:a,priority:i,dueDate:s,scheduledDate:o,tags:l,contexts:c,projects:d,timeEstimate:u,isCompleted:p,signature:""})}withFilterIndexSignature(t){return{...t,signature:JSON.stringify({contexts:t.contexts,dueDate:t.dueDate,isCompleted:t.isCompleted,priority:t.priority,projects:t.projects,scheduledDate:t.scheduledDate,status:t.status,tags:t.tags,timeEstimate:t.timeEstimate})}}normalizeDateValue(t){if(typeof t!="string"||t.length===0)return;let n=de(t);return n.length>0?n:void 0}normalizeStringValues(t,n){let a=Array.isArray(t)?t:n&&t?[t]:[],i=new Set;for(let s of a){if(typeof s!="string")continue;let o=s.trim();o&&i.add(o)}return Array.from(i).sort()}addFilterIndexEntry(t){this.taskFilterEntries.set(t.path,t),this.indexedTaskPaths.add(t.path),this.addPathToIndex(this.statusIndex,t.status,t.path),this.addPathToIndex(this.priorityIndex,t.priority,t.path),this.addPathToIndex(this.dueDateIndex,t.dueDate,t.path),this.addPathToIndex(this.scheduledDateIndex,t.scheduledDate,t.path),this.incrementValues(this.tagCounts,t.tags),this.incrementValues(this.contextCounts,t.contexts),this.incrementValues(this.projectCounts,t.projects)}removeFilterIndexEntry(t){if(!this.filterIndexesBuilt)return!1;let n=this.taskFilterEntries.get(t);return n?(this.taskFilterEntries.delete(t),this.indexedTaskPaths.delete(t),this.removePathFromIndex(this.statusIndex,n.status,t),this.removePathFromIndex(this.priorityIndex,n.priority,t),this.removePathFromIndex(this.dueDateIndex,n.dueDate,t),this.removePathFromIndex(this.scheduledDateIndex,n.scheduledDate,t),this.decrementValues(this.tagCounts,n.tags),this.decrementValues(this.contextCounts,n.contexts),this.decrementValues(this.projectCounts,n.projects),!0):!1}addPathToIndex(t,n,a){if(!n)return;let i=t.get(n);if(i){i.add(a);return}t.set(n,new Set([a]))}removePathFromIndex(t,n,a){if(!n)return;let i=t.get(n);i&&(i.delete(a),i.size===0&&t.delete(n))}incrementValues(t,n){var a;for(let i of n)t.set(i,((a=t.get(i))!=null?a:0)+1)}decrementValues(t,n){var a;for(let i of n){let s=((a=t.get(i))!=null?a:0)-1;s>0?t.set(i,s):t.delete(i)}}sortedCountKeys(t){return Array.from(t.keys()).sort()}clearFilterIndexes(){this.indexedTaskPaths.clear(),this.taskFilterEntries.clear(),this.statusIndex.clear(),this.priorityIndex.clear(),this.dueDateIndex.clear(),this.scheduledDateIndex.clear(),this.tagCounts.clear(),this.contextCounts.clear(),this.projectCounts.clear()}async getAllTasks(){let t=[],n=this.app.vault.getMarkdownFiles();for(let a of n){if(!this.isValidFile(a.path))continue;let i=await this.getTaskInfo(a.path);i&&t.push(i)}return t}getAllCachedTasks(){let t=[],n=this.app.vault.getMarkdownFiles();for(let a of n){if(!this.isValidFile(a.path))continue;let i=this.getCachedTaskInfoSync(a.path);i&&t.push(i)}return t}getAllTaskPaths(){return this.ensureFilterIndexes(),new Set(this.indexedTaskPaths)}getTasksForDate(t){var a,i;let n=de(t);return this.ensureFilterIndexes(),Array.from(new Set([...(a=this.scheduledDateIndex.get(n))!=null?a:[],...(i=this.dueDateIndex.get(n))!=null?i:[]]))}getTaskPathsForDateRange(t,n,a){this.ensureFilterIndexes();let i=de(a),s=t==="due"?this.dueDateIndex:this.scheduledDateIndex,o=new Set;for(let[l,c]of s)if(this.matchesDateRange(l,n,i))for(let d of c)o.add(d);return o}matchesDateRange(t,n,a){switch(n){case"is-before":return ta;case"is-on-or-before":return t<=a;case"is-on-or-after":return t>=a;default:return!1}}getTaskPathsByStatus(t){var a,i;let n=(a=Yp(t,this.settings.customStatuses))!=null?a:t;return this.ensureFilterIndexes(),Array.from((i=this.statusIndex.get(n))!=null?i:[])}getTaskPathsByPriority(t){var a,i;let n=(a=Gp(t,this.settings.customPriorities))!=null?a:t;return this.ensureFilterIndexes(),Array.from((i=this.priorityIndex.get(n))!=null?i:[])}getOverdueTaskPaths(){let t=new Set,n=nn();this.ensureFilterIndexes();for(let[a,i]of this.dueDateIndex)if(Dh(a,n))for(let s of i){let o=this.taskFilterEntries.get(s);o&&!o.isCompleted&&t.add(s)}return t}getAllStatuses(){return this.ensureFilterIndexes(),Array.from(this.statusIndex.keys()).sort()}getAllPriorities(){return this.ensureFilterIndexes(),Array.from(this.priorityIndex.keys()).sort()}getAllTags(){return this.ensureFilterIndexes(),this.sortedCountKeys(this.tagCounts)}getAllContexts(){return this.ensureFilterIndexes(),this.sortedCountKeys(this.contextCounts)}getAllProjects(){return this.ensureFilterIndexes(),this.sortedCountKeys(this.projectCounts)}getAllTimeEstimates(){let t=new Map;this.ensureFilterIndexes();for(let[n,a]of this.taskFilterEntries)a.timeEstimate!==void 0&&t.set(n,a.timeEstimate);return t}async getNotesForDate(t){if(this.disableNoteIndexing)return[];let n=[],a=ce(t),i=this.app.vault.getMarkdownFiles();for(let s of i){if(!this.isValidFile(s.path))continue;let o=this.app.metadataCache.getFileCache(s);if(!(o!=null&&o.frontmatter)||this.isTaskFile(o.frontmatter))continue;(o.frontmatter.date||o.frontmatter.scheduled)===a&&n.push({path:s.path,title:this.storeTitleInFilename?s.basename:o.frontmatter.title||s.basename,tags:o.frontmatter.tags||[]})}return n}async getTaskByPath(t){return this.getTaskInfo(t)}async getCachedTaskInfo(t){return this.getTaskInfo(t)}getCachedTaskInfoSync(t){if(!this.isValidFile(t))return null;let n=this.app.vault.getAbstractFileByPath(t);if(!(n instanceof Wo.TFile))return null;let a=this.getPendingTaskInfo(t),i=this.app.metadataCache.getFileCache(n);if(!(i!=null&&i.frontmatter))return a;let s=this.isTaskFile(i.frontmatter)?this.extractTaskInfoFromNative(t,i.frontmatter):null;return a&&this.shouldUsePendingTaskInfo(a,s)?a:(this.pendingTaskInfoByPath.delete(t),s)}async readFrontmatterFromFile(t){try{let n=await this.app.vault.read(t);return this.parseFrontmatterFromContent(n,t.path)}catch(n){return gg.warn(`TaskManager: Failed to read frontmatter fallback for ${t.path}`,{category:"validation",operation:"taskmanager-read-frontmatter-fallback",error:n}),null}}parseFrontmatterFromContent(t,n){let a=t.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!a)return null;try{let i=(0,Wo.parseYaml)(a[1]||"");return!i||typeof i!="object"||Array.isArray(i)?null:i}catch(i){let s=n?` for ${n}`:"";return gg.warn(`TaskManager: Failed to parse frontmatter fallback${s}`,{category:"validation",operation:"taskmanager-parse-frontmatter-fallback",details:n?{path:n}:void 0,error:i}),null}}isInitialized(){return this.initialized}destroy(){this.debouncedHandlers.forEach(t=>{window.clearTimeout(t)}),this.debouncedHandlers.clear(),this.eventListeners.forEach(t=>{this.app.metadataCache.offref(t)}),this.eventListeners=[],this.clearFilterIndexes(),this.filterIndexesBuilt=!1,this.initialized=!1}setDependencyCache(t){this._dependencyCache=t}getBlockingTaskPaths(t){return this._dependencyCache?this._dependencyCache.getBlockingTaskPaths(t):(gg.warn("DependencyCache not set in TaskManager",{category:"stale-data",operation:"dependencycache-not-set-taskmanager"}),[])}getBlockedTaskPaths(t){return this._dependencyCache?this._dependencyCache.getBlockedTaskPaths(t):(gg.warn("DependencyCache not set in TaskManager",{category:"stale-data",operation:"dependencycache-not-set-taskmanager"}),[])}isTaskBlocked(t){return this._dependencyCache?this._dependencyCache.isTaskBlocked(t):!1}getTasksReferencingProject(t){return this._dependencyCache?this._dependencyCache.getTasksReferencingProject(t):(gg.warn("DependencyCache not set in TaskManager",{category:"stale-data",operation:"dependencycache-not-set-taskmanager"}),[])}isFileUsedAsProject(t){return this._dependencyCache?this._dependencyCache.isFileUsedAsProject(t):!1}async waitForFreshTaskData(t,n=10){let a=typeof t=="string"?t:t.path,i=typeof t=="string"?this.app.vault.getAbstractFileByPath(a):t;if(!(i instanceof Wo.TFile)){await new Promise(s=>window.setTimeout(s,100));return}for(let s=0;swindow.setTimeout(l,50*(s+1)))}gg.warn(`TaskManager: Metadata cache not ready for ${a} after ${n} retries`,{category:"stale-data",operation:"taskmanager-metadata-cache-not-ready"})}updateConfig(t){this.settings=t,this.taskTag=t.taskTag,this.excludedFolders=Sc(t.excludedFolders),this.disableNoteIndexing=t.disableNoteIndexing,this.storeTitleInFilename=t.storeTitleInFilename,this.clearFilterIndexes(),this.filterIndexesBuilt=!1,this.pruneExcludedPendingTaskInfo(),this.trigger("data-changed")}pruneExcludedPendingTaskInfo(){for(let t of this.pendingTaskInfoByPath.keys())this.isValidFile(t)||this.pendingTaskInfoByPath.delete(t)}subscribe(t,n){return this.on(t,n),()=>{this.off(t,n)}}async getCalendarData(t,n){let a=await this.getAllTasks(),i={};for(let s of a)s.scheduled&&(i[s.scheduled]||(i[s.scheduled]=[]),i[s.scheduled].push(s)),s.due&&(i[s.due]||(i[s.due]=[]),i[s.due].includes(s)||i[s.due].push(s));return i}async getTaskInfoForDate(t){let n=ce(t),a=this.getTasksForDate(n),i=[];for(let s of a){let o=await this.getTaskInfo(s);o&&i.push(o)}return i}getTaskPathsByDate(t){return new Set(this.getTasksForDate(t))}getAllProjectsWithDetails(){return[]}getAllProjectFiles(){return[]}async rebuildDailyNotesCache(t,n){}async clearAllCaches(){this.pendingTaskInfoByPath.clear(),this.clearFilterIndexes(),this.filterIndexesBuilt=!1,this.trigger("data-changed")}clearCacheEntry(t){this.pendingTaskInfoByPath.delete(t),this.removeFilterIndexEntry(t)}updateTaskInfoInCache(t,n){var i;let a=!1;if(!this.isValidFile(t)){this.pendingTaskInfoByPath.delete(t),a=this.removeFilterIndexEntry(t),this.trigger("data-changed");return}this.pendingTaskInfoByPath.set(t,{...n,id:(i=n.id)!=null?i:t,path:t}),a=this.updateFilterIndexesFromTaskInfo(t,n),this.trigger("file-updated",{path:t,updatedTask:n,filterIndexChanged:a})}}});var yg,qN,Am,WN,iW=y(()=>{yg=require("obsidian");Io();mS();K();qN=N({tag:"Utils/DependencyCache"}),Am="dependency-cache-changed",WN=class extends yg.Events{constructor(t,n,a,i,s){super();this.dependencySources=new Map;this.dependencyTargets=new Map;this.activeDependencySources=new Map;this.activeDependencyTargets=new Map;this.projectReferences=new Map;this.projectReferenceSources=new Map;this.relationshipFingerprints=new Map;this.completedStatusByPath=new Map;this.initialized=!1;this.indexesBuilt=!1;this.eventListeners=[];this.app=t,this.settings=n,this.excludedFolders=Sc(n.excludedFolders),this.fieldMapper=a,this.statusManager=i,this.isTaskFileCallback=s}initialize(){this.initialized||(this.setupEventListeners(),this.initialized=!0)}async buildIndexes(){if(this.indexesBuilt)return;let t=this.app.vault.getMarkdownFiles();for(let n of t){if(!this.isValidFile(n.path))continue;let a=this.app.metadataCache.getFileCache(n);!(a!=null&&a.frontmatter)||!this.isTaskFileCallback(a.frontmatter)||this.indexTaskFile(n.path,a.frontmatter)}this.indexesBuilt=!0,this.trigger(Am)}setupEventListeners(){let t=this.app.metadataCache.on("changed",(i,s,o)=>{i instanceof yg.TFile&&i.extension==="md"&&this.handleFileChanged(i,o)});this.eventListeners.push(t);let n=this.app.metadataCache.on("deleted",(i,s)=>{i instanceof yg.TFile&&i.extension==="md"&&this.handleFileDeleted(i.path)});this.eventListeners.push(n);let a=this.app.vault.on("rename",(i,s)=>{i instanceof yg.TFile&&i.extension==="md"&&this.handleFileRenamed(i,s)});this.eventListeners.push(a)}handleFileChanged(t,n){var o;let a=this.getFileRelationshipSignature(t.path);if(!this.isValidFile(t.path)){this.clearFileFromIndexes(t.path),this.triggerIfFileRelationshipsChanged(t.path,a);return}let i=(o=this.getFrontmatterFromCache(n))!=null?o:this.getFrontmatterForFile(t);if(this.updateCompletionState(t.path,i),!i){this.hasForwardRelationships(t.path)&&this.clearForwardDependencies(t.path),this.triggerIfFileRelationshipsChanged(t.path,a);return}if(!this.isTaskFileCallback(i)){this.hasForwardRelationships(t.path)&&this.clearForwardDependencies(t.path),this.triggerIfFileRelationshipsChanged(t.path,a);return}let s=this.buildRelationshipFingerprint(i);if(this.relationshipFingerprints.get(t.path)===s){this.triggerIfFileRelationshipsChanged(t.path,a);return}this.clearForwardDependencies(t.path),this.indexTaskFile(t.path,i),this.triggerIfFileRelationshipsChanged(t.path,a)}triggerIfFileRelationshipsChanged(t,n){this.getFileRelationshipSignature(t)!==n&&this.trigger(Am)}getFileRelationshipSignature(t){let n=this.sortedSetValues(this.dependencySources.get(t)),a=this.sortedSetValues(this.activeDependencyTargets.get(t)),i=this.sortedSetValues(this.projectReferenceSources.get(t)),s=this.sortedSetValues(this.projectReferences.get(t));return JSON.stringify({blockedTasks:a,blockingTasks:n,projectTasks:s,referencedProjects:i})}sortedSetValues(t){return t?Array.from(t).sort():[]}handleFileDeleted(t){this.clearFileFromIndexes(t),this.trigger(Am)}handleFileRenamed(t,n){let a=this.getFrontmatterForFile(t);this.clearFileFromIndexes(n),this.isValidFile(t.path)&&a&&this.isTaskFileCallback(a)&&this.indexTaskFile(t.path,a),this.trigger(Am)}getFrontmatterForFile(t){let n=this.app.metadataCache.getFileCache(t);return this.getFrontmatterFromCache(n)}getFrontmatterFromCache(t){if(!t||typeof t!="object"||!("frontmatter"in t))return null;let n=t.frontmatter;return!n||typeof n!="object"||Array.isArray(n)?null:n}resolveProjectReference(t,n){if(!n||typeof n!="string")return null;let a=n.trim();if(!a)return null;let i=Ol(this.app,t,a);return(i==null?void 0:i.path)||null}indexTaskFile(t,n){var l,c;if(!this.isValidFile(t))return;this.relationshipFingerprints.set(t,this.buildRelationshipFingerprint(n)),this.completedStatusByPath.set(t,this.isCompletedFrontmatter(n));let a=((l=this.fieldMapper)==null?void 0:l.toUserField("blockedBy"))||"blockedBy",i=((c=this.fieldMapper)==null?void 0:c.toUserField("projects"))||"project",s=n[a];if(s){let d=Fh(s);if(d){let u=new Set;for(let p of d){let m=Ol(this.app,t,p);m!=null&&m.path&&this.isValidFile(m.path)&&this.addDependencyLink(t,m.path,u)}u.size>0&&this.dependencySources.set(t,u)}}let o=n[i];if(o){let d=Array.isArray(o)?o:[o];for(let u of d)if(typeof u=="string"){let p=this.resolveProjectReference(t,u);p&&this.isValidFile(p)&&(this.projectReferences.has(p)||this.projectReferences.set(p,new Set),this.projectReferences.get(p).add(t),this.projectReferenceSources.has(t)||this.projectReferenceSources.set(t,new Set),this.projectReferenceSources.get(t).add(p))}}}addDependencyLink(t,n,a){a.add(n),this.dependencyTargets.has(n)||this.dependencyTargets.set(n,new Set),this.dependencyTargets.get(n).add(t),this.isCompletedPath(n)||this.addActiveDependencyLink(t,n)}addActiveDependencyLink(t,n){this.activeDependencySources.has(t)||this.activeDependencySources.set(t,new Set),this.activeDependencySources.get(t).add(n),this.activeDependencyTargets.has(n)||this.activeDependencyTargets.set(n,new Set),this.activeDependencyTargets.get(n).add(t)}removeActiveDependencyLink(t,n){let a=this.activeDependencySources.get(t);a&&(a.delete(n),a.size===0&&this.activeDependencySources.delete(t));let i=this.activeDependencyTargets.get(n);i&&(i.delete(t),i.size===0&&this.activeDependencyTargets.delete(n))}rebuildActiveLinksForBlocker(t){let n=this.dependencyTargets.get(t);if(this.activeDependencyTargets.delete(t),!!n){for(let a of n){let i=this.activeDependencySources.get(a);i&&(i.delete(t),i.size===0&&this.activeDependencySources.delete(a))}if(!this.isCompletedPath(t))for(let a of n)this.addActiveDependencyLink(a,t)}}buildRelationshipFingerprint(t){var o,l,c;let n=((o=this.fieldMapper)==null?void 0:o.toUserField("blockedBy"))||"blockedBy",a=((l=this.fieldMapper)==null?void 0:l.toUserField("projects"))||"project",i=((c=Fh(t[n]))!=null?c:[]).map(d=>d.uid).filter(d=>d.length>0).sort(),s=this.normalizeProjectFingerprintValues(t[a]);return JSON.stringify({dependencies:i,projects:s})}normalizeProjectFingerprintValues(t){let n=Array.isArray(t)?t:t?[t]:[],a=new Set;for(let i of n){if(typeof i!="string")continue;let s=i.trim();s&&a.add(s)}return Array.from(a).sort()}hasForwardRelationships(t){return this.relationshipFingerprints.has(t)||this.dependencySources.has(t)||this.projectReferenceSources.has(t)}updateCompletionState(t,n){var s;let a=(s=this.completedStatusByPath.get(t))!=null?s:!1,i=n?this.isCompletedFrontmatter(n):!1;this.completedStatusByPath.set(t,i),a!==i&&this.rebuildActiveLinksForBlocker(t)}isCompletedPath(t){let n=this.completedStatusByPath.get(t);if(n!==void 0)return n;let a=this.app.vault.getAbstractFileByPath(t);if(!(a instanceof yg.TFile))return this.completedStatusByPath.set(t,!1),!1;let i=this.getFrontmatterForFile(a),s=i?this.isCompletedFrontmatter(i):!1;return this.completedStatusByPath.set(t,s),s}isCompletedFrontmatter(t){var s;let n=((s=this.fieldMapper)==null?void 0:s.toUserField("status"))||"status",a=t[n],i=this.stringifyStatusValue(a);return!!(i&&this.statusManager.isCompletedStatus(i))}stringifyStatusValue(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):null}clearForwardDependencies(t){let n=this.dependencySources.get(t);if(n){for(let i of n){let s=this.dependencyTargets.get(i);s&&(s.delete(t),s.size===0&&this.dependencyTargets.delete(i)),this.removeActiveDependencyLink(t,i)}this.dependencySources.delete(t)}this.activeDependencySources.delete(t);let a=this.projectReferenceSources.get(t);if(a){for(let i of a){let s=this.projectReferences.get(i);s&&(s.delete(t),s.size===0&&this.projectReferences.delete(i))}this.projectReferenceSources.delete(t)}this.relationshipFingerprints.delete(t)}clearFileFromIndexes(t){let n=this.dependencySources.get(t);if(n){for(let o of n){let l=this.dependencyTargets.get(o);l&&(l.delete(t),l.size===0&&this.dependencyTargets.delete(o)),this.removeActiveDependencyLink(t,o)}this.dependencySources.delete(t)}this.activeDependencySources.delete(t);let a=this.dependencyTargets.get(t);if(a){for(let o of a){let l=this.dependencySources.get(o);l&&(l.delete(t),l.size===0&&this.dependencySources.delete(o)),this.removeActiveDependencyLink(o,t)}this.dependencyTargets.delete(t)}this.activeDependencyTargets.delete(t);let i=this.projectReferenceSources.get(t);if(i){for(let o of i){let l=this.projectReferences.get(o);l&&(l.delete(t),l.size===0&&this.projectReferences.delete(o))}this.projectReferenceSources.delete(t)}let s=this.projectReferences.get(t);if(s){for(let o of s){let l=this.projectReferenceSources.get(o);l&&(l.delete(t),l.size===0&&this.projectReferenceSources.delete(o))}this.projectReferences.delete(t)}this.relationshipFingerprints.delete(t),this.completedStatusByPath.delete(t)}getBlockingTaskPaths(t){this.indexesBuilt||(qN.warn("DependencyCache: getBlockingTaskPaths called before indexes built, building now...",{category:"stale-data",operation:"dependencycache-getblockingtaskpaths-called-indexes-built-building-now"}),this.buildIndexesSync());let n=this.dependencySources.get(t);return n?Array.from(n):[]}getBlockedTaskPaths(t){this.indexesBuilt||(qN.warn("DependencyCache: getBlockedTaskPaths called before indexes built, building now...",{category:"stale-data",operation:"dependencycache-getblockedtaskpaths-called-indexes-built-building-now"}),this.buildIndexesSync());let n=this.activeDependencyTargets.get(t);return n?Array.from(n):[]}isTaskBlocked(t){var n,a;return this.indexesBuilt||this.buildIndexesSync(),((a=(n=this.activeDependencySources.get(t))==null?void 0:n.size)!=null?a:0)>0}getTasksReferencingProject(t){this.indexesBuilt||(qN.warn("DependencyCache: getTasksReferencingProject called before indexes built, building now...",{category:"stale-data",operation:"dependencycache-gettasksreferencingproject-called-indexes-built-building-now"}),this.buildIndexesSync());let n=this.projectReferences.get(t);return n?Array.from(n):[]}isFileUsedAsProject(t){return this.indexesBuilt||(qN.warn("DependencyCache: isFileUsedAsProject called before indexes built, building now...",{category:"stale-data",operation:"dependencycache-isfileusedasproject-called-indexes-built-building-now"}),this.buildIndexesSync()),this.projectReferences.has(t)}buildIndexesSync(){if(this.indexesBuilt)return;let t=this.app.vault.getMarkdownFiles();for(let n of t){if(!this.isValidFile(n.path))continue;let a=this.app.metadataCache.getFileCache(n);!(a!=null&&a.frontmatter)||!this.isTaskFileCallback(a.frontmatter)||this.indexTaskFile(n.path,a.frontmatter)}this.indexesBuilt=!0,this.trigger(Am)}updateConfig(t){this.settings=t,this.excludedFolders=Sc(t.excludedFolders),this.clearIndexes(),this.indexesBuilt=!1}isValidFile(t){return!Cv(t,this.excludedFolders)}clearIndexes(){this.dependencySources.clear(),this.dependencyTargets.clear(),this.activeDependencySources.clear(),this.activeDependencyTargets.clear(),this.projectReferences.clear(),this.projectReferenceSources.clear(),this.relationshipFingerprints.clear(),this.completedStatusByPath.clear()}destroy(){this.eventListeners.forEach(t=>{this.app.metadataCache.offref(t)}),this.eventListeners=[],this.clearIndexes(),this.initialized=!1,this.indexesBuilt=!1}}});function Yo(r){let e=Ixe(r),t=e.match(GN);if(t){let[,a,i,s]=t,o=Number(a),l=Number(i),c=Number(s);if(!Rxe(o,l,c))throw new Error(`Invalid date "${r}".`);return new Date(Date.UTC(o,l-1,c,0,0,0,0))}if(!Nxe(e))throw new Error(`Invalid date "${r}".`);let n=new Date(e);if(!KN(n))throw new Error(`Invalid date "${r}".`);return n}function jot(r){let e=Ixe(r),t=e.match(GN);if(t){let[,a,i,s]=t,o=Number(a),l=Number(i),c=Number(s),d=new Date(o,l-1,c,0,0,0,0);if(!KN(d)||d.getFullYear()!==o||d.getMonth()!==l-1||d.getDate()!==c)throw new Error(`Invalid date "${r}".`);return d}if(!Nxe(e))throw new Error(`Invalid date "${r}".`);let n=new Date(e);if(!KN(n))throw new Error(`Invalid date "${r}".`);return n}function Jc(r){if(!KN(r))return"";let e=r.getUTCFullYear(),t=String(r.getUTCMonth()+1).padStart(2,"0"),n=String(r.getUTCDate()).padStart(2,"0");return`${e}-${t}-${n}`}function $ot(r){return Jc(r)}function Bot(){let r=new Date,e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return`${e}-${t}-${n}`}function oW(r){return Yo(_m(r))}function Uot(r){if(!/^\d{4}-\d{2}-\d{2}$/.test(r))throw new Error(`Invalid date "${r}". Expected YYYY-MM-DD.`);return Yo(r),r}function Hot(r){return r?/T\d{2}:\d{2}/.test(r):!1}function _m(r){if(!r)return"";let e=r.trim();if(GN.test(e))return e;let t=e.indexOf("T");if(t>-1)return e.slice(0,t);let n=e.indexOf(" ");return n>-1&&GN.test(e.slice(0,n))?e.slice(0,n):Jc(Yo(e))}function Ixe(r,e="Date string cannot be empty"){if(!r||r.trim().length===0)throw new Error(e);return r.trim()}function Nxe(r){let e=r.match(zot);if(!e)return!1;let[,t,n,a,i,s,o,,l,c,d]=e;return Rxe(Number(t),Number(n),Number(a))&&Vot(Number(i),Number(s),Number(o))&&qot(l,c,d)}function Rxe(r,e,t){let n=new Date(Date.UTC(r,e-1,t,0,0,0,0));return n.getUTCFullYear()===r&&n.getUTCMonth()===e-1&&n.getUTCDate()===t}function Vot(r,e,t){return r>=0&&r<=23&&e>=0&&e<=59&&t>=0&&t<=59}function qot(r,e,t){if(!r)return!0;let n=Number(e),a=Number(t);return!(n>14||a>59||n===14&&a!==0)}function KN(r){return r instanceof Date&&!Number.isNaN(r.getTime())}function Fxe(r,e){if(!r.recurrence||typeof r.recurrence!="string")return!0;try{let t=Lxe(r);if(!t)return!1;let n=oW($ot(e));return t.between(n,new Date(n.getTime()+1440*60*1e3-1),!0).length>0}catch(t){return!0}}function Oxe(r,e,t){if(!r.recurrence||typeof r.recurrence!="string")return[];try{let n=Lxe(r);if(!n)return[];let a=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),0,0,0,0)),i=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),23,59,59,999));return n.between(a,i,!0)}catch(n){let a=[],i=new Date(e);for(;i<=t;)Fxe(r,i)&&a.push(new Date(i)),i.setUTCDate(i.getUTCDate()+1);return a}}function Wot(r,e={}){return r.recurrence?(r.recurrence_anchor||"scheduled")==="completion"?tlt(r,e):elt(r,e):null}function Yot(r,e=!0,t={}){let n=Wot(r,t),a=null,i=null,s=null;if(n){try{let o=r.scheduled?Yo(_m(r.scheduled)):null,l=r.due?Yo(_m(r.due)):null;if(o&&l){let c=!e&&l.getTime()=t)return c}return null}function tlt(r,e){if(!r.recurrence||typeof r.recurrence!="string")return null;let t=Yo(e.today||_xe()),n=zxe(r.recurrence),a=lW(r.recurrence),i=a||t,s=new Date(i.getTime()+n*24*60*60*1e3),o=Oxe(r,i,s),l=new Set(r.skipped_instances||[]),c=a?a.getTime():0;for(let d of o){let u=Jc(d);if(d.getTime()>c&&d>=t&&!l.has(u))return d}return null}function rlt(r){let e=r.toLowerCase();return e==="true"||e==="false"?e==="true":r}function nlt(r){let e=r.trim(),t=e.match(/^\[\[([^|\]#]+)(?:#[^\]|]+)?(?:\|[^\]]+)?\]\]$/);if(t)return t[1].trim();let n=e.match(/^\[[^\]]+\]\(([^)#]+)(?:#[^)]+)?\)$/);return n?decodeURI(n[1].trim()):e}function $xe(r,e="manual"){return slt(r.occurrence_materialization)?r.occurrence_materialization:e}function alt(r,e="completion"){return olt(r.occurrence_next_trigger)?r.occurrence_next_trigger:e}function AE(r){return typeof r.recurrence_parent=="string"&&typeof r.occurrence_date=="string"}function vg(r){return r?nlt(r).replace(/\\/g,"/").replace(/^\/+/,"").replace(/\.md$/i,"").trim().toLowerCase():""}function Bxe(r){return`[[${r.path.replace(/\.md$/i,"")}]]`}function cW(r,e,t,n=Bxe(e)){let a=vg(e.path),i=vg(n);return r.find(s=>{if(s.occurrence_date!==t||!s.recurrence_parent)return!1;let o=vg(s.recurrence_parent);return o===a||o===i})}function dW({parentTask:r,targetDate:e,currentTimestamp:t,existingOccurrences:n=[],parentLink:a,defaultStatus:i=r.status,defaultPriority:s=r.priority,templateTask:o={},overrides:l={},allowNonGeneratedTarget:c=!0}){var v,b,k,w,S,C,E,D,P,O,z,R,A,F;if(!r.recurrence)throw new Error("occurrence_parent_not_recurring");let d=uW(e),u=a||Bxe(r),p=cW(n,r,d,u),m=[];if(hlt(r,d)||m.push({code:"materialization_target_not_generated",message:`Target date "${d}" is not generated by the parent recurrence rule.`,severity:c?"warning":"error",field:"occurrence_date"}),p)return{kind:"occurrence.materialize",parentTask:r,targetDate:d,parentReference:u,created:!1,existingOccurrence:p,occurrenceTask:p,fields:tb(p),issues:m,metadata:{idempotent:!0}};let f=llt(r,d),h=mlt(f.customProperties,o.customProperties,l.customProperties),g=Kxe({...f,...o,...l,id:void 0,path:void 0,archived:void 0,status:(b=(v=l.status)!=null?v:o.status)!=null?b:i,priority:(S=(w=(k=l.priority)!=null?k:o.priority)!=null?w:r.priority)!=null?S:s,scheduled:(D=(E=(C=l.scheduled)!=null?C:o.scheduled)!=null?E:f.scheduled)!=null?D:d,due:(O=(P=l.due)!=null?P:o.due)!=null?O:f.due,customProperties:h,recurrence:void 0,recurrence_anchor:void 0,complete_instances:void 0,skipped_instances:void 0,recurrence_parent:u,occurrence_date:d,occurrence_materialization:void 0,occurrence_next_trigger:void 0,occurrence_template:void 0,occurrence_past_horizon:void 0,occurrence_future_horizon:void 0,completedDate:void 0,timeEntries:void 0,totalTrackedTime:void 0,icsEventId:void 0,googleCalendarEventId:void 0,googleCalendarExceptionEventId:void 0,googleCalendarExceptionOriginalScheduled:void 0,googleCalendarMovedOriginalDates:void 0,basesData:void 0,blocking:void 0,isBlocked:void 0,isBlocking:void 0,hasSubtasks:void 0,dateCreated:(R=(z=l.dateCreated)!=null?z:o.dateCreated)!=null?R:t,dateModified:(F=(A=l.dateModified)!=null?A:o.dateModified)!=null?F:t});return{kind:"occurrence.materialize",parentTask:r,targetDate:d,parentReference:u,created:!0,occurrenceTask:g,fields:tb(g),issues:m,metadata:{idempotent:!1,template:r.occurrence_template}}}function Uxe({occurrenceTask:r,parentTask:e,completedStatus:t,currentTimestamp:n,targetDate:a,completionDate:i,maintainDueDateOffsetInRecurring:s}){let o=ZN(r,a);if(QN(r,o),!e.recurrence)throw new Error("occurrence_parent_not_recurring");let l=i===void 0?o:uW(i),c=(e.recurrence_anchor||"scheduled")==="completion"?l:o,d=Zxe(rb(e.complete_instances),o),u=rb(e.skipped_instances).filter(v=>v!==o),p=Gxe({parentTask:e,targetDate:c,completeInstances:d,skippedInstances:u,currentTimestamp:n,maintainDueDateOffsetInRecurring:s,advanceCompletionAnchor:!0}),m={status:t,completedDate:l,dateModified:n},f={...e,...p},h={...r,...m},g=$xe(e)==="on_completion"?_m(f.scheduled||""):void 0;return JN({kind:"occurrence.complete",targetDate:o,occurrenceTask:r,parentTask:e,updatedOccurrenceTask:h,updatedParentTask:f,occurrenceUpdates:m,parentUpdates:p,currentTimestamp:n,materializeNextDate:g,metadata:{trigger:"completion"}})}function Hxe({occurrenceTask:r,parentTask:e,activeStatus:t,currentTimestamp:n,targetDate:a}){let i=ZN(r,a);QN(r,i);let s={complete_instances:rb(e.complete_instances).filter(l=>l!==i),dateModified:n},o={status:t,completedDate:void 0,dateModified:n};return JN({kind:"occurrence.uncomplete",targetDate:i,occurrenceTask:r,parentTask:e,updatedOccurrenceTask:{...r,...o},updatedParentTask:{...e,...s},occurrenceUpdates:o,parentUpdates:s,currentTimestamp:n,metadata:{trigger:"uncomplete"}})}function Vxe({occurrenceTask:r,parentTask:e,skippedStatus:t,currentTimestamp:n,targetDate:a,maintainDueDateOffsetInRecurring:i}){if(!t)throw new Error("missing_skipped_status");let s=ZN(r,a);if(QN(r,s),!e.recurrence)throw new Error("occurrence_parent_not_recurring");let o=Zxe(rb(e.skipped_instances),s),l=rb(e.complete_instances).filter(m=>m!==s),c=Gxe({parentTask:e,targetDate:s,completeInstances:l,skippedInstances:o,currentTimestamp:n,maintainDueDateOffsetInRecurring:i,advanceCompletionAnchor:!1}),d={status:t,completedDate:void 0,dateModified:n},u={...e,...c},p=$xe(e)==="on_completion"&&alt(e)==="completion_or_skip"?_m(u.scheduled||""):void 0;return JN({kind:"occurrence.skip",targetDate:s,occurrenceTask:r,parentTask:e,updatedOccurrenceTask:{...r,...d},updatedParentTask:u,occurrenceUpdates:d,parentUpdates:c,currentTimestamp:n,materializeNextDate:p,metadata:{trigger:"skip"}})}function qxe({occurrenceTask:r,parentTask:e,activeStatus:t,currentTimestamp:n,targetDate:a}){let i=ZN(r,a);QN(r,i);let s={skipped_instances:rb(e.skipped_instances).filter(l=>l!==i),dateModified:n},o={status:t,completedDate:void 0,dateModified:n};return JN({kind:"occurrence.unskip",targetDate:i,occurrenceTask:r,parentTask:e,updatedOccurrenceTask:{...r,...o},updatedParentTask:{...e,...s},occurrenceUpdates:o,parentUpdates:s,currentTimestamp:n,metadata:{trigger:"unskip"}})}function Wxe(r,e){let t=[];for(let[n,a]of Object.entries(r)){let i=ilt(e,n);i&&(a===void 0||Array.isArray(a)&&a.length===0?t.push({op:"delete",field:i}):n==="status"?t.push({op:"set",field:i,value:rlt(String(a))}):t.push({op:"set",field:i,value:a}))}return t}function tb(r){let e={};return Hr(e,"title",r.title),Hr(e,"status",r.status),Hr(e,"priority",r.priority),Hr(e,"due",r.due),Hr(e,"scheduled",r.scheduled),Hr(e,"completedDate",r.completedDate),Hr(e,"dateCreated",r.dateCreated),Hr(e,"dateModified",r.dateModified),Hr(e,"recurrence",r.recurrence),Hr(e,"recurrenceAnchor",r.recurrence_anchor),Hr(e,"completeInstances",r.complete_instances),Hr(e,"skippedInstances",r.skipped_instances),Hr(e,"recurrenceParent",r.recurrence_parent),Hr(e,"occurrenceDate",r.occurrence_date),Hr(e,"occurrenceMaterialization",r.occurrence_materialization),Hr(e,"occurrenceNextTrigger",r.occurrence_next_trigger),Hr(e,"occurrenceTemplate",r.occurrence_template),Hr(e,"occurrencePastHorizon",r.occurrence_past_horizon),Hr(e,"occurrenceFutureHorizon",r.occurrence_future_horizon),Hr(e,"timeEntries",r.timeEntries),Hr(e,"tags",r.tags),Hr(e,"contexts",r.contexts),Hr(e,"projects",r.projects),Hr(e,"attachments",r.attachments),Hr(e,"timeEstimate",r.timeEstimate),Hr(e,"blockedBy",r.blockedBy),Hr(e,"reminders",r.reminders),e}function ilt(r,e){let n={title:"title",status:"status",priority:"priority",due:"due",scheduled:"scheduled",contexts:"contexts",projects:"projects",attachments:"attachments",timeEstimate:"timeEstimate",completedDate:"completedDate",dateCreated:"dateCreated",dateModified:"dateModified",recurrence:"recurrence",recurrence_anchor:"recurrenceAnchor",complete_instances:"completeInstances",skipped_instances:"skippedInstances",recurrence_parent:"recurrenceParent",occurrence_date:"occurrenceDate",occurrence_materialization:"occurrenceMaterialization",occurrence_next_trigger:"occurrenceNextTrigger",occurrence_template:"occurrenceTemplate",occurrence_past_horizon:"occurrencePastHorizon",occurrence_future_horizon:"occurrenceFutureHorizon",timeEntries:"timeEntries",blockedBy:"blockedBy",reminders:"reminders",sortOrder:"sortOrder"}[e];return n?r[n]:void 0}function slt(r){return r==="manual"||r==="on_completion"||r==="rolling"}function olt(r){return r==="completion"||r==="completion_or_skip"}function uW(r){return Uot(r instanceof Date?Jc(r):_m(r))}function ZN(r,e){var t;return uW((t=e!=null?e:r.occurrence_date)!=null?t:"")}function QN(r,e){if(!r.recurrence_parent||!r.occurrence_date)throw new Error("task_not_materialized_occurrence");if(r.occurrence_date!==e)throw new Error("occurrence_date_mismatch")}function llt(r,e){let t=r.scheduled?Dxe(r.scheduled,r.scheduled,e):e,n=r.due?Dxe(r.due,r.scheduled||r.due,e):void 0;return Kxe({title:r.title,priority:r.priority,due:n,scheduled:t,contexts:YN(r.contexts),projects:YN(r.projects),attachments:YN(r.attachments),tags:YN(r.tags),timeEstimate:r.timeEstimate,reminders:Pxe(r.reminders),blockedBy:Pxe(r.blockedBy),details:r.details,customProperties:plt(r.customProperties)})}function Dxe(r,e,t){try{let n=_m(r),a=_m(e);if(!n||!a)return;let i=dlt(a,n),s=ult(t,i);return clt(r,s)}catch(n){return}}function clt(r,e){var a;let n=r.trim().match(/^(\d{4}-\d{2}-\d{2})(.*)$/);return n?`${e}${(a=n[2])!=null?a:""}`:e}function dlt(r,e){let n=Yo(r).getTime(),a=Yo(e).getTime();return Math.round((a-n)/864e5)}function ult(r,e){let t=Yo(r);return t.setUTCDate(t.getUTCDate()+e),Jc(t)}function YN(r){return Array.isArray(r)?[...r]:void 0}function Pxe(r){return Array.isArray(r)?r.map(e=>({...e})):void 0}function plt(r){if(!(!r||Object.keys(r).length===0))return Yxe(r)}function mlt(...r){let e={};for(let t of r)t&&Object.assign(e,Yxe(t));return Object.keys(e).length>0?e:void 0}function Yxe(r){let e={};for(let[t,n]of Object.entries(r))Array.isArray(n)?e[t]=[...n]:flt(n)?e[t]={...n}:e[t]=n;return e}function flt(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function hlt(r,e){try{return Fxe(r,Yo(e))}catch(t){return!1}}function Gxe({parentTask:r,targetDate:e,completeInstances:t,skippedInstances:n,currentTimestamp:a,maintainDueDateOffsetInRecurring:i,advanceCompletionAnchor:s}){let o=r.recurrence;typeof o=="string"&&o.length>0&&(s&&(r.recurrence_anchor||"scheduled")==="completion"?o=Kot(o,e)||o:o.includes("DTSTART:")||(o=Got(r)||o));let l={...r,recurrence:o,complete_instances:t,skipped_instances:n},c=Yot(l,i,{today:e}),d={recurrence:o,complete_instances:t,skipped_instances:n,dateModified:a};return c.scheduled&&(d.scheduled=c.scheduled),c.due&&(d.due=c.due),d}function JN({kind:r,targetDate:e,occurrenceTask:t,parentTask:n,updatedOccurrenceTask:a,updatedParentTask:i,occurrenceUpdates:s,parentUpdates:o,currentTimestamp:l,materializeNextDate:c,metadata:d}){return{kind:r,targetDate:e,updatedOccurrenceTask:a,updatedParentTask:i,occurrenceUpdates:s,parentUpdates:o,occurrenceFields:tb(s),parentFields:tb(o),dateModified:l,changed:Mxe(t,s)||Mxe(n,o),materializeNextDate:c||void 0,metadata:d}}function Mxe(r,e){return Object.entries(e).some(([t,n])=>r[t]!==n)}function Kxe(r){let e={};for(let[t,n]of Object.entries(r))n!==void 0&&(e[t]=n);return e}function Hr(r,e,t){t!==void 0&&(r[e]=t)}function Zxe(r,e){return r.includes(e)?r:[...r,e]}function rb(r){return Array.isArray(r)?r.filter(e=>typeof e=="string"):[]}var GN,zot,_xe,sW,Axe,Exe,pW=y(()=>{Ov();GN=/^(\d{4})-(\d{2})-(\d{2})$/,zot=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d{1,3})?(?:Z|([+-])(\d{2}):(\d{2}))?$/;_xe=Bot;sW=Reflect.get(Qp,"default"),Exe=(Axe=ke)!=null?Axe:sW==null?void 0:sW.RRule});function hr(r){if(r&&typeof r=="object")switch(r[Hi]){case Gl:case qu:return!0}return!1}function Vt(r){if(r&&typeof r=="object")switch(r[Hi]){case XN:case Gl:case so:case qu:return!0}return!1}var XN,eR,Gl,mW,so,qu,Hi,Go,Ko,Zo,Lt,ht,Qo,tR,nr=y(()=>{XN=Symbol.for("yaml.alias"),eR=Symbol.for("yaml.document"),Gl=Symbol.for("yaml.map"),mW=Symbol.for("yaml.pair"),so=Symbol.for("yaml.scalar"),qu=Symbol.for("yaml.seq"),Hi=Symbol.for("yaml.node.type"),Go=r=>!!r&&typeof r=="object"&&r[Hi]===XN,Ko=r=>!!r&&typeof r=="object"&&r[Hi]===eR,Zo=r=>!!r&&typeof r=="object"&&r[Hi]===Gl,Lt=r=>!!r&&typeof r=="object"&&r[Hi]===mW,ht=r=>!!r&&typeof r=="object"&&r[Hi]===so,Qo=r=>!!r&&typeof r=="object"&&r[Hi]===qu;tR=r=>(ht(r)||hr(r))&&!!r.anchor});function Kl(r,e){let t=Jxe(e);Ko(r)?nb(null,r.contents,t,Object.freeze([r]))===Xc&&(r.contents=null):nb(null,r,t,Object.freeze([]))}function nb(r,e,t,n){let a=Xxe(r,e,t,n);if(Vt(a)||Lt(a))return eCe(r,n,a),nb(r,a,t,n);if(typeof a!="symbol"){if(hr(e)){n=Object.freeze(n.concat(e));for(let i=0;i{nr();gs=Symbol("break visit"),Qxe=Symbol("skip children"),Xc=Symbol("remove node");Kl.BREAK=gs;Kl.SKIP=Qxe;Kl.REMOVE=Xc;_E.BREAK=gs;_E.SKIP=Qxe;_E.REMOVE=Xc});var glt,ylt,ed,fW=y(()=>{nr();IE();glt={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ylt=r=>r.replace(/[!,[\]{}]/g,e=>glt[e]),ed=class r{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},r.defaultYaml,e),this.tags=Object.assign({},r.defaultTags,t)}clone(){let e=new r(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new r(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:r.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},r.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:r.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},r.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),a=n.shift();switch(a){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[i,s]=n;return this.tags[i]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=n;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let s=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,s),!1}}default:return t(0,`Unknown directive ${a}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),s)}let[,n,a]=e.match(/^(.*!)([^!]*)$/s);a||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(a)}catch(s){return t(String(s)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+ylt(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),a;if(e&&n.length>0&&Vt(e.contents)){let i={};Kl(e.contents,(s,o)=>{Vt(o)&&o.tag&&(i[o.tag]=!0)}),a=Object.keys(i)}else a=[];for(let[i,s]of n)i==="!!"&&s==="tag:yaml.org,2002:"||(!e||a.some(o=>o.startsWith(s)))&&t.push(`%TAG ${i} ${s}`);return t.join(` `)}};ed.defaultYaml={explicit:!1,version:"1.2"};ed.defaultTags={"!!":"tag:yaml.org,2002:"}});function rR(r){if(/[\x00-\x19\s,[\]{}]/.test(r)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(r)}`;throw new Error(t)}return!0}function hW(r){let e=new Set;return Kl(r,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function gW(r,e){for(let t=1;;++t){let n=`${r}${t}`;if(!e.has(n))return n}}function tCe(r,e){let t=[],n=new Map,a=null;return{onAnchor:i=>{t.push(i),a!=null||(a=hW(r));let s=gW(e,a);return a.add(s),s},setAnchors:()=>{for(let i of t){let s=n.get(i);if(typeof s=="object"&&s.anchor&&(ht(s.node)||hr(s.node)))s.node.anchor=s.anchor;else{let o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=i,o}}},sourceObjects:n}}var nR=y(()=>{nr();IE()});function Im(r,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let a=0,i=n.length;a{});function ga(r,e,t){if(Array.isArray(r))return r.map((n,a)=>ga(n,String(a),t));if(r&&typeof r.toJSON=="function"){if(!t||!tR(r))return r.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(r,n),t.onCreate=i=>{n.res=i,delete t.onCreate};let a=r.toJSON(e,t);return t.onCreate&&t.onCreate(a),a}return typeof r=="bigint"&&!(t!=null&&t.keep)?Number(r):r}var Nm=y(()=>{nr()});var Rm,aR=y(()=>{yW();nr();Nm();Rm=class{constructor(e){Object.defineProperty(this,Hi,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:a,reviver:i}={}){if(!Ko(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},o=ga(this,"",s);if(typeof a=="function")for(let{count:l,res:c}of s.anchors.values())a(c,l);return typeof i=="function"?Im(i,{"":o},"",o):o}}});function iR(r,e,t){if(Go(e)){let n=e.resolve(r),a=t&&n&&t.get(n);return a?a.count*a.aliasCount:0}else if(hr(e)){let n=0;for(let a of e.items){let i=iR(r,a,t);i>n&&(n=i)}return n}else if(Lt(e)){let n=iR(r,e.key,t),a=iR(r,e.value,t);return Math.max(n,a)}return 1}var td,NE=y(()=>{nR();IE();nr();aR();Nm();td=class extends Rm{constructor(e){super(XN),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if((t==null?void 0:t.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let n;t!=null&&t.aliasResolveCache?n=t.aliasResolveCache:(n=[],Kl(e,{Node:(i,s)=>{(Go(s)||tR(s))&&n.push(s)}}),t&&(t.aliasResolveCache=n));let a;for(let i of n){if(i===this)break;i.anchor===this.source&&(a=i)}return a}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:a,maxAliasCount:i}=t,s=this.resolve(a,t);if(!s){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=n.get(s);if(o||(ga(s,null,t),o=n.get(s)),(o==null?void 0:o.res)===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=iR(a,s,n)),o.count*o.aliasCount>i)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(e,t,n){let a=`*${this.source}`;if(e){if(rR(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${a} `}return a}}});var sR,Ae,aa=y(()=>{nr();aR();Nm();sR=r=>!r||typeof r!="function"&&typeof r!="object",Ae=class extends Rm{constructor(e){super(so),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:ga(this.value,e,t)}toString(){return String(this.value)}};Ae.BLOCK_FOLDED="BLOCK_FOLDED";Ae.BLOCK_LITERAL="BLOCK_LITERAL";Ae.PLAIN="PLAIN";Ae.QUOTE_DOUBLE="QUOTE_DOUBLE";Ae.QUOTE_SINGLE="QUOTE_SINGLE"});function klt(r,e,t){var n;if(e){let a=t.filter(s=>s.tag===e),i=(n=a.find(s=>!s.format))!=null?n:a[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(a=>{var i;return((i=a.identify)==null?void 0:i.call(a,r))&&!a.format})}function Wu(r,e,t){var u,p,m,f;if(Ko(r)&&(r=r.contents),Vt(r))return r;if(Lt(r)){let h=(p=(u=t.schema[Gl]).createNode)==null?void 0:p.call(u,t.schema,null,t);return h.items.push(r),h}(r instanceof String||r instanceof Number||r instanceof Boolean||typeof BigInt!="undefined"&&r instanceof BigInt)&&(r=r.valueOf());let{aliasDuplicateObjects:n,onAnchor:a,onTagObj:i,schema:s,sourceObjects:o}=t,l;if(n&&r&&typeof r=="object"){if(l=o.get(r),l)return(m=l.anchor)!=null||(l.anchor=a(r)),new td(l.anchor);l={anchor:null,node:null},o.set(r,l)}e!=null&&e.startsWith("!!")&&(e=vlt+e.slice(2));let c=klt(r,e,s.tags);if(!c){if(r&&typeof r.toJSON=="function"&&(r=r.toJSON()),!r||typeof r!="object"){let h=new Ae(r);return l&&(l.node=h),h}c=r instanceof Map?s[Gl]:Symbol.iterator in Object(r)?s[qu]:s[Gl]}i&&(i(c),delete t.onTagObj);let d=c!=null&&c.createNode?c.createNode(t.schema,r,t):typeof((f=c==null?void 0:c.nodeClass)==null?void 0:f.from)=="function"?c.nodeClass.from(t.schema,r,t):new Ae(r);return e?d.tag=e:c.default||(d.tag=c.tag),l&&(l.node=d),d}var vlt,RE=y(()=>{NE();nr();aa();vlt="tag:yaml.org,2002:"});function FE(r,e,t){let n=t;for(let a=e.length-1;a>=0;--a){let i=e[a];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let s=[];s[i]=n,n=s}else n=new Map([[i,n]])}return Wu(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:r,sourceObjects:new Map})}var sb,ib,oR=y(()=>{RE();nr();aR();sb=r=>r==null||typeof r=="object"&&!!r[Symbol.iterator]().next().done,ib=class extends Rm{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>Vt(n)||Lt(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(sb(e))this.add(t);else{let[n,...a]=e,i=this.get(n,!0);if(hr(i))i.addIn(a,t);else if(i===void 0&&this.schema)this.set(n,FE(this.schema,a,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${a}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let a=this.get(t,!0);if(hr(a))return a.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...a]=e,i=this.get(n,!0);return a.length===0?!t&&ht(i)?i.value:i:hr(i)?i.getIn(a,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Lt(t))return!1;let n=t.value;return n==null||e&&ht(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let a=this.get(t,!0);return hr(a)?a.hasIn(n):!1}setIn(e,t){let[n,...a]=e;if(a.length===0)this.set(n,t);else{let i=this.get(n,!0);if(hr(i))i.setIn(a,t);else if(i===void 0&&this.schema)this.set(n,FE(this.schema,a,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${a}`)}}}});function Jo(r,e){return/^\n+$/.test(r)?r.substring(1):e?r.replace(/^(?! *$)/gm,e):r}var rCe,rd,OE=y(()=>{rCe=r=>r.replace(/^(?!$)(?: $)?/gm,"#");rd=(r,e,t)=>r.endsWith(` `)?Jo(t,e):t.includes(` `)?` `+Jo(t,e):(r.endsWith(" ")?"":" ")+t});function zE(r,e,t="flow",{indentAtStart:n,lineWidth:a=80,minContentWidth:i=20,onFold:s,onOverflow:o}={}){if(!a||a<0)return r;aa-Math.max(2,i)?c.push(0):u=a-n);let p,m,f=!1,h=-1,g=-1,v=-1;t===lR&&(h=nCe(r,h,e.length),h!==-1&&(u=h+l));for(let k;k=r[h+=1];){if(t===LE&&k==="\\"){switch(g=h,r[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}v=h}if(k===` `)t===lR&&(h=nCe(r,h,e.length)),u=h+e.length+l,p=void 0;else{if(k===" "&&m&&m!==" "&&m!==` `&&m!==" "){let w=r[h+1];w&&w!==" "&&w!==` `&&w!==" "&&(p=h)}if(h>=u)if(p)c.push(p),u=p+l,p=void 0;else if(t===LE){for(;m===" "||m===" ";)m=k,k=r[h+=1],f=!0;let w=h>v+1?h-2:g-1;if(d[w])return r;c.push(w),d[w]=!0,u=w+l,p=void 0}else f=!0}m=k}if(f&&o&&o(),c.length===0)return r;s&&s();let b=r.slice(0,c[0]);for(let k=0;k{vW="flow",lR="block",LE="quoted"});function blt(r,e,t){if(!e||e<0)return!1;let n=e-t,a=r.length;if(a<=n)return!1;for(let i=0,s=0;in)return!0;if(s=i+1,a-s<=n)return!1}return!0}function jE(r,e){let t=JSON.stringify(r);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,a=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(uR(r)?" ":""),s="",o=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(s+=t.slice(o,l)+"\\ ",l+=1,o=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{s+=t.slice(o,l);let d=t.substr(l+2,4);switch(d){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:d.substr(0,2)==="00"?s+="\\x"+d.substr(2):s+=t.substr(l,6)}l+=5,o=l+1}break;case"n":if(n||t[l+2]==='"'||t.length `;let u,p;for(p=t.length;p>0;--p){let S=t[p-1];if(S!==` `&&S!==" "&&S!==" ")break}let m=t.substring(p),f=m.indexOf(` `);f===-1?u="-":t===m||f!==m.length-1?(u="+",i&&i()):u="",m&&(t=t.slice(0,-m.length),m[m.length-1]===` `&&(m=m.slice(0,-1)),m=m.replace(bW,`$&${c}`));let h=!1,g,v=-1;for(g=0;g{C=!0});let D=zE(`${b}${S}${m}`,c,lR,E);if(!C)return`>${w} ${c}${D}`}return t=t.replace(/\n+/g,`$&${c}`),`|${w} ${c}${b}${t}${m}`}function Tlt(r,e,t,n){let{type:a,value:i}=r,{actualString:s,implicitKey:o,indent:l,indentStep:c,inFlow:d}=e;if(o&&i.includes(` `)||d&&/[[\]{},]/.test(i))return ob(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return o||d||!i.includes(` `)?ob(i,e):cR(r,e,t,n);if(!o&&!d&&a!==Ae.PLAIN&&i.includes(` `))return cR(r,e,t,n);if(uR(i)){if(l==="")return e.forceBlockIndent=!0,cR(r,e,t,n);if(o&&l===c)return ob(i,e)}let u=i.replace(/\n+/g,`$& ${l}`);if(s){let p=h=>{var g;return h.default&&h.tag!=="tag:yaml.org,2002:str"&&((g=h.test)==null?void 0:g.test(u))},{compat:m,tags:f}=e.doc.schema;if(f.some(p)||m!=null&&m.some(p))return ob(i,e)}return o?u:zE(u,l,vW,dR(e,!1))}function Yu(r,e,t,n){let{implicitKey:a,inFlow:i}=e,s=typeof r.value=="string"?r:Object.assign({},r,{value:String(r.value)}),{type:o}=r;o!==Ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(o=Ae.QUOTE_DOUBLE);let l=d=>{switch(d){case Ae.BLOCK_FOLDED:case Ae.BLOCK_LITERAL:return a||i?ob(s.value,e):cR(s,e,t,n);case Ae.QUOTE_DOUBLE:return jE(s.value,e);case Ae.QUOTE_SINGLE:return kW(s.value,e);case Ae.PLAIN:return Tlt(s,e,t,n);default:return null}},c=l(o);if(c===null){let{defaultKeyType:d,defaultStringType:u}=e.options,p=a&&d||u;if(c=l(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}var dR,uR,bW,$E=y(()=>{aa();aCe();dR=(r,e)=>({indentAtStart:e?r.indent.length:r.indentAtStart,lineWidth:r.options.lineWidth,minContentWidth:r.options.minContentWidth}),uR=r=>/^(%|---|\.\.\.)/m.test(r);try{bW=new RegExp(`(^|(?c.tag===e.tag);if(l.length>0)return(a=l.find(c=>c.format===e.format))!=null?a:l[0]}let t,n;if(ht(e)){n=e.value;let l=r.filter(c=>{var d;return(d=c.identify)==null?void 0:d.call(c,n)});if(l.length>1){let c=l.filter(d=>d.test);c.length>0&&(l=c)}t=(i=l.find(c=>c.format===e.format))!=null?i:l.find(c=>!c.format)}else n=e,t=r.find(l=>l.nodeClass&&n instanceof l.nodeClass);if(!t){let l=(o=(s=n==null?void 0:n.constructor)==null?void 0:s.name)!=null?o:n===null?"null":typeof n;throw new Error(`Tag not resolved for ${l} value`)}return t}function Slt(r,e,{anchors:t,doc:n}){var o;if(!n.directives)return"";let a=[],i=(ht(r)||hr(r))&&r.anchor;i&&rR(i)&&(t.add(i),a.push(`&${i}`));let s=(o=r.tag)!=null?o:e.default?null:e.tag;return s&&a.push(n.directives.tagString(s)),a.join(" ")}function Gu(r,e,t,n){var l,c;if(Lt(r))return r.toString(e,t,n);if(Go(r)){if(e.doc.directives)return r.toString(e);if((l=e.resolvedAliases)!=null&&l.has(r))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(r):e.resolvedAliases=new Set([r]),r=r.resolve(e.doc)}let a,i=Vt(r)?r:e.doc.createNode(r,{onTagObj:d=>a=d});a!=null||(a=wlt(e.doc.schema.tags,i));let s=Slt(i,a,e);s.length>0&&(e.indentAtStart=((c=e.indentAtStart)!=null?c:0)+s.length+1);let o=typeof a.stringify=="function"?a.stringify(i,e,t,n):ht(i)?Yu(i,e,t,n):i.toString(e,t,n);return s?ht(i)||o[0]==="{"||o[0]==="["?`${s} ${o}`:`${s} ${e.indent}${o}`:o}var BE=y(()=>{nR();nr();OE();$E()});function iCe({key:r,value:e},t,n,a){var E,D;let{allNullValues:i,doc:s,indent:o,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:u}}=t,p=Vt(r)&&r.comment||null;if(u){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(hr(r)||!Vt(r)&&typeof r=="object"){let P="With simple keys, collection cannot be used as a key value";throw new Error(P)}}let m=!u&&(!r||p&&e==null&&!t.inFlow||hr(r)||(ht(r)?r.type===Ae.BLOCK_FOLDED||r.type===Ae.BLOCK_LITERAL:typeof r=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(u||!i),indent:o+l});let f=!1,h=!1,g=Gu(r,t,()=>f=!0,()=>h=!0);if(!m&&!t.inFlow&&g.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(i||e==null)return f&&n&&n(),g===""?"?":m?`? ${g}`:g}else if(i&&!u||e==null&&m)return g=`? ${g}`,p&&!f?g+=rd(g,t.indent,c(p)):h&&a&&a(),g;f&&(p=null),m?(p&&(g+=rd(g,t.indent,c(p))),g=`? ${g} ${o}:`):(g=`${g}:`,p&&(g+=rd(g,t.indent,c(p))));let v,b,k;Vt(e)?(v=!!e.spaceBefore,b=e.commentBefore,k=e.comment):(v=!1,b=null,k=null,e&&typeof e=="object"&&(e=s.createNode(e))),t.implicitKey=!1,!m&&!p&&ht(e)&&(t.indentAtStart=g.length+1),h=!1,!d&&l.length>=2&&!t.inFlow&&!m&&Qo(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let w=!1,S=Gu(e,t,()=>w=!0,()=>h=!0),C=" ";if(p||v||b){if(C=v?` `:"",b){let P=c(b);C+=` ${Jo(P,t.indent)}`}S===""&&!t.inFlow?C===` `&&k&&(C=` `):C+=` ${t.indent}`}else if(!m&&hr(e)){let P=S[0],O=S.indexOf(` `),z=O!==-1,R=(D=(E=t.inFlow)!=null?E:e.flow)!=null?D:e.items.length===0;if(z||!R){let A=!1;if(z&&(P==="&"||P==="!")){let F=S.indexOf(" ");P==="&"&&F!==-1&&F{nr();aa();BE();OE()});function mR(r,e){(r==="debug"||r==="warn")&&console.warn(e)}var TW=y(()=>{});function SW(r,e,t){let n=lCe(r,t);if(Qo(n))for(let a of n.items)wW(r,e,a);else if(Array.isArray(n))for(let a of n)wW(r,e,a);else wW(r,e,n)}function wW(r,e,t){let n=lCe(r,t);if(!Zo(n))throw new Error("Merge sources must be maps or map aliases");let a=n.toJSON(null,r,Map);for(let[i,s]of a)e instanceof Map?e.has(i)||e.set(i,s):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function lCe(r,e){return r&&Go(e)?e.resolve(r.doc,r):e}var fR,Zl,oCe,hR=y(()=>{nr();aa();fR="<<",Zl={identify:r=>r===fR||typeof r=="symbol"&&r.description===fR,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ae(Symbol(fR)),{addToJSMap:SW}),stringify:()=>fR},oCe=(r,e)=>(Zl.identify(e)||ht(e)&&(!e.type||e.type===Ae.PLAIN)&&Zl.identify(e.value))&&(r==null?void 0:r.doc.schema.tags.some(t=>t.tag===Zl.tag&&t.default))});function gR(r,e,{key:t,value:n}){if(Vt(t)&&t.addToJSMap)t.addToJSMap(r,e,n);else if(oCe(r,t))SW(r,e,n);else{let a=ga(t,"",r);if(e instanceof Map)e.set(a,ga(n,a,r));else if(e instanceof Set)e.add(a);else{let i=xlt(t,a,r),s=ga(n,i,r);i in e?Object.defineProperty(e,i,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[i]=s}}return e}function xlt(r,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Vt(r)&&(t!=null&&t.doc)){let n=pR(t.doc,{});n.anchors=new Set;for(let i of t.anchors.keys())n.anchors.add(i.anchor);n.inFlow=!0,n.inStringifyKey=!0;let a=r.toString(n);if(!t.mapKeyWarned){let i=JSON.stringify(a);i.length>40&&(i=i.substring(0,36)+'..."'),mR(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return a}return JSON.stringify(e)}var xW=y(()=>{TW();hR();BE();nr();Nm()});function lb(r,e,t){let n=Wu(r,void 0,t),a=Wu(e,void 0,t);return new Cn(n,a)}var Cn,Fm=y(()=>{RE();sCe();xW();nr();Cn=class r{constructor(e,t=null){Object.defineProperty(this,Hi,{value:mW}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return Vt(t)&&(t=t.clone(e)),Vt(n)&&(n=n.clone(e)),new r(t,n)}toJSON(e,t){let n=t!=null&&t.mapAsMap?new Map:{};return gR(t,n,this)}toString(e,t,n){return e!=null&&e.doc?iCe(this,e,t,n):JSON.stringify(this)}}});function vR(r,e,t){var i;return(((i=e.inFlow)!=null?i:r.flow)?Elt:Clt)(r,e,t)}function Clt({comment:r,items:e},t,{blockItemPrefix:n,flowChars:a,itemIndent:i,onChompKeep:s,onComment:o}){let{indent:l,options:{commentString:c}}=t,d=Object.assign({},t,{indent:i,type:null}),u=!1,p=[];for(let f=0;fg=null,()=>u=!0);g&&(v+=rd(v,i,c(g))),u&&g&&(u=!1),p.push(n+v)}let m;if(p.length===0)m=a.start+a.end;else{m=p[0];for(let f=1;fg=null);c||(c=u.length>d||v.includes(` `)),f0&&(c||(c=u.reduce((b,k)=>b+k.length+2,2)+(v.length+2)>e.options.lineWidth)),c&&(v+=",")),g&&(v+=rd(v,n,o(g))),u.push(v),d=u.length}let{start:p,end:m}=t;if(u.length===0)return p+m;if(!c){let f=u.reduce((h,g)=>h+g.length+2,2);c=e.options.lineWidth>0&&f>e.options.lineWidth}if(c){let f=p;for(let h of u)f+=h?` ${i}${a}${h}`:` `;return`${f} ${a}${m}`}else return`${p}${s}${u.join(" ")}${s}${m}`}function yR({indent:r,options:{commentString:e}},t,n,a){if(n&&a&&(n=n.replace(/^\n+/,"")),n){let i=Jo(e(n),r);t.push(i.trimStart())}}var CW=y(()=>{nr();BE();OE()});function Om(r,e){let t=ht(e)?e.value:e;for(let n of r)if(Lt(n)&&(n.key===e||n.key===t||ht(n.key)&&n.key.value===t))return n}var On,Lm=y(()=>{CW();xW();oR();nr();Fm();aa();On=class extends ib{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Gl,e),this.items=[]}static from(e,t,n){let{keepUndefined:a,replacer:i}=n,s=new this(e),o=(l,c)=>{if(typeof i=="function")c=i.call(t,l,c);else if(Array.isArray(i)&&!i.includes(l))return;(c!==void 0||a)&&s.items.push(lb(l,c,n))};if(t instanceof Map)for(let[l,c]of t)o(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))o(l,t[l]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,t){var s;let n;Lt(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Cn(e,e==null?void 0:e.value):n=new Cn(e.key,e.value);let a=Om(this.items,n.key),i=(s=this.schema)==null?void 0:s.sortMapEntries;if(a){if(!t)throw new Error(`Key ${n.key} already set`);ht(a.value)&&sR(n.value)?a.value.value=n.value:a.value=n.value}else if(i){let o=this.items.findIndex(l=>i(n,l)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=Om(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){var i;let n=Om(this.items,e),a=n==null?void 0:n.value;return(i=!t&&ht(a)?a.value:a)!=null?i:void 0}has(e){return!!Om(this.items,e)}set(e,t){this.add(new Cn(e,t),!0)}toJSON(e,t,n){let a=n?new n:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(a);for(let i of this.items)gR(t,a,i);return a}toString(e,t,n){if(!e)return JSON.stringify(this);for(let a of this.items)if(!Lt(a))throw new Error(`Map items must all be pairs; found ${JSON.stringify(a)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),vR(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}});var Ql,cb=y(()=>{nr();Lm();Ql={collection:"map",default:!0,nodeClass:On,tag:"tag:yaml.org,2002:map",resolve(r,e){return Zo(r)||e("Expected a mapping for this tag"),r},createNode:(r,e,t)=>On.from(r,e,t)}});function kR(r){let e=ht(r)?r.value:r;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}var Ua,zm=y(()=>{RE();CW();oR();nr();aa();Nm();Ua=class extends ib{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(qu,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=kR(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=kR(e);if(typeof n!="number")return;let a=this.items[n];return!t&&ht(a)?a.value:a}has(e){let t=kR(e);return typeof t=="number"&&t{nr();zm();Jl={collection:"seq",default:!0,nodeClass:Ua,tag:"tag:yaml.org,2002:seq",resolve(r,e){return Qo(r)||e("Expected a sequence for this tag"),r},createNode:(r,e,t)=>Ua.from(r,e,t)}});var jm,UE=y(()=>{$E();jm={identify:r=>typeof r=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r=>r,stringify(r,e,t,n){return e=Object.assign({actualString:!0},e),Yu(r,e,t,n)}}});var kg,bR=y(()=>{aa();kg={identify:r=>r==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ae(null),stringify:({source:r},e)=>typeof r=="string"&&kg.test.test(r)?r:e.options.nullStr}});var HE,EW=y(()=>{aa();HE={identify:r=>typeof r=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:r=>new Ae(r[0]==="t"||r[0]==="T"),stringify({source:r,value:e},t){if(r&&HE.test.test(r)){let n=r[0]==="t"||r[0]==="T";if(e===n)return r}return e?t.options.trueStr:t.options.falseStr}}});function hi({format:r,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let a=typeof n=="number"?n:Number(n);if(!isFinite(a))return isNaN(a)?".nan":a<0?"-.inf":".inf";let i=Object.is(n,-0)?"-0":JSON.stringify(n);if(!r&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let s=i.indexOf(".");s<0&&(s=i.length,i+=".");let o=e-(i.length-s-1);for(;o-- >0;)i+="0"}return i}var ub=y(()=>{});var TR,wR,SR,DW=y(()=>{aa();ub();TR={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:hi},wR={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():hi(r)}},SR={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(r){let e=new Ae(parseFloat(r)),t=r.indexOf(".");return t!==-1&&r[r.length-1]==="0"&&(e.minFractionDigits=r.length-t-1),e},stringify:hi}});function cCe(r,e,t){let{value:n}=r;return xR(n)&&n>=0?t+n.toString(e):hi(r)}var xR,PW,CR,ER,DR,MW=y(()=>{ub();xR=r=>typeof r=="bigint"||Number.isInteger(r),PW=(r,e,t,{intAsBigInt:n})=>n?BigInt(r):parseInt(r.substring(e),t);CR={identify:r=>xR(r)&&r>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(r,e,t)=>PW(r,2,8,t),stringify:r=>cCe(r,8,"0o")},ER={identify:xR,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(r,e,t)=>PW(r,0,10,t),stringify:hi},DR={identify:r=>xR(r)&&r>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(r,e,t)=>PW(r,2,16,t),stringify:r=>cCe(r,16,"0x")}});var dCe,uCe=y(()=>{cb();bR();db();UE();EW();DW();MW();dCe=[Ql,Jl,jm,kg,HE,CR,ER,DR,TR,wR,SR]});function pCe(r){return typeof r=="bigint"||Number.isInteger(r)}var PR,Dlt,Plt,mCe,fCe=y(()=>{aa();cb();db();PR=({value:r})=>JSON.stringify(r),Dlt=[{identify:r=>typeof r=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r=>r,stringify:PR},{identify:r=>r==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:PR},{identify:r=>typeof r=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:r=>r==="true",stringify:PR},{identify:pCe,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(r,e,{intAsBigInt:t})=>t?BigInt(r):parseInt(r,10),stringify:({value:r})=>pCe(r)?r.toString():JSON.stringify(r)},{identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:r=>parseFloat(r),stringify:PR}],Plt={default:!0,tag:"",test:/^/,resolve(r,e){return e(`Unresolved plain scalar ${JSON.stringify(r)}`),r}},mCe=[Ql,Jl].concat(Dlt,Plt)});var VE,AW=y(()=>{aa();$E();VE={identify:r=>r instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(r,e){if(typeof atob=="function"){let t=atob(r.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let a=0;a1&&e("Each pair must have its own sequence indicator");let i=a.items[0]||new Cn(new Ae(null));if(a.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${a.commentBefore} ${i.key.commentBefore}`:a.commentBefore),a.comment){let s=(t=i.value)!=null?t:i.key;s.comment=s.comment?`${a.comment} ${s.comment}`:a.comment}a=i}r.items[n]=Lt(a)?a:new Cn(a)}}else e("Expected a sequence for this tag");return r}function IW(r,e,t){let{replacer:n}=t,a=new Ua(r);a.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(i++),s));let o,l;if(Array.isArray(s))if(s.length===2)o=s[0],l=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let c=Object.keys(s);if(c.length===1)o=c[0],l=s[o];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else o=s;a.items.push(lb(o,l,t))}return a}var qE,MR=y(()=>{nr();Fm();aa();zm();qE={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:_W,createNode:IW}});var pb,WE,NW=y(()=>{nr();Nm();Lm();zm();MR();pb=class r extends Ua{constructor(){super(),this.add=On.prototype.add.bind(this),this.delete=On.prototype.delete.bind(this),this.get=On.prototype.get.bind(this),this.has=On.prototype.has.bind(this),this.set=On.prototype.set.bind(this),this.tag=r.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t!=null&&t.onCreate&&t.onCreate(n);for(let a of this.items){let i,s;if(Lt(a)?(i=ga(a.key,"",t),s=ga(a.value,i,t)):i=ga(a,"",t),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,s)}return n}static from(e,t,n){let a=IW(e,t,n),i=new this;return i.items=a.items,i}};pb.tag="tag:yaml.org,2002:omap";WE={collection:"seq",identify:r=>r instanceof Map,nodeClass:pb,default:!1,tag:"tag:yaml.org,2002:omap",resolve(r,e){let t=_W(r,e),n=[];for(let{key:a}of t.items)ht(a)&&(n.includes(a.value)?e(`Ordered maps must not include duplicate keys: ${a.value}`):n.push(a.value));return Object.assign(new pb,t)},createNode:(r,e,t)=>pb.from(r,e,t)}});function hCe({value:r,source:e},t){return e&&(r?RW:FW).test.test(e)?e:r?t.options.trueStr:t.options.falseStr}var RW,FW,gCe=y(()=>{aa();RW={identify:r=>r===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ae(!0),stringify:hCe},FW={identify:r=>r===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ae(!1),stringify:hCe}});var yCe,vCe,kCe,bCe=y(()=>{aa();ub();yCe={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:hi},vCe={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r.replace(/_/g,"")),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():hi(r)}},kCe={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(r){let e=new Ae(parseFloat(r.replace(/_/g,""))),t=r.indexOf(".");if(t!==-1){let n=r.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:hi}});function AR(r,e,t,{intAsBigInt:n}){let a=r[0];if((a==="-"||a==="+")&&(e+=1),r=r.substring(e).replace(/_/g,""),n){switch(t){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let s=BigInt(r);return a==="-"?BigInt(-1)*s:s}let i=parseInt(r,t);return a==="-"?-1*i:i}function OW(r,e,t){let{value:n}=r;if(YE(n)){let a=n.toString(e);return n<0?"-"+t+a.substr(1):t+a}return hi(r)}var YE,TCe,wCe,SCe,xCe,CCe=y(()=>{ub();YE=r=>typeof r=="bigint"||Number.isInteger(r);TCe={identify:YE,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(r,e,t)=>AR(r,2,2,t),stringify:r=>OW(r,2,"0b")},wCe={identify:YE,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(r,e,t)=>AR(r,1,8,t),stringify:r=>OW(r,8,"0")},SCe={identify:YE,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(r,e,t)=>AR(r,0,10,t),stringify:hi},xCe={identify:YE,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(r,e,t)=>AR(r,2,16,t),stringify:r=>OW(r,16,"0x")}});var mb,GE,LW=y(()=>{nr();Fm();Lm();mb=class r extends On{constructor(e){super(e),this.tag=r.tag}add(e){let t;Lt(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Cn(e.key,null):t=new Cn(e,null),Om(this.items,t.key)||this.items.push(t)}get(e,t){let n=Om(this.items,e);return!t&&Lt(n)?ht(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Om(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Cn(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:a}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let s of t)typeof a=="function"&&(s=a.call(t,s,s)),i.items.push(lb(s,null,n));return i}};mb.tag="tag:yaml.org,2002:set";GE={collection:"map",identify:r=>r instanceof Set,nodeClass:mb,default:!1,tag:"tag:yaml.org,2002:set",createNode:(r,e,t)=>mb.from(r,e,t),resolve(r,e){if(Zo(r)){if(r.hasAllNullValues(!0))return Object.assign(new mb,r);e("Set items must all have null values")}else e("Expected a mapping for this tag");return r}}});function zW(r,e){let t=r[0],n=t==="-"||t==="+"?r.substring(1):r,a=s=>e?BigInt(s):Number(s),i=n.replace(/_/g,"").split(":").reduce((s,o)=>s*a(60)+a(o),a(0));return t==="-"?a(-1)*i:i}function ECe(r){let{value:e}=r,t=s=>s;if(typeof e=="bigint")t=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return hi(r);let n="";e<0&&(n="-",e*=t(-1));let a=t(60),i=[e%a];return e<60?i.unshift(0):(e=(e-i[0])/a,i.unshift(e%a),e>=60&&(e=(e-i[0])/a,i.unshift(e))),n+i.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var _R,IR,fb,jW=y(()=>{ub();_R={identify:r=>typeof r=="bigint"||Number.isInteger(r),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(r,e,{intAsBigInt:t})=>zW(r,t),stringify:ECe},IR={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:r=>zW(r,!1),stringify:ECe},fb={identify:r=>r instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(r){let e=r.match(fb.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,a,i,s,o]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,a,i||0,s||0,o||0,l),d=e[8];if(d&&d!=="Z"){let u=zW(d,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:r})=>{var e;return(e=r==null?void 0:r.toISOString().replace(/(T00:00:00)?\.000Z$/,""))!=null?e:""}}});var $W,DCe=y(()=>{cb();bR();db();UE();AW();gCe();bCe();CCe();hR();NW();MR();LW();jW();$W=[Ql,Jl,jm,kg,RW,FW,TCe,wCe,SCe,xCe,yCe,vCe,kCe,VE,Zl,WE,qE,GE,_R,IR,fb]});function NR(r,e,t){let n=PCe.get(e);if(n&&!r)return t&&!n.includes(Zl)?n.concat(Zl):n.slice();let a=n;if(!a)if(Array.isArray(r))a=[];else{let i=Array.from(PCe.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(r))for(let i of r)a=a.concat(i);else typeof r=="function"&&(a=r(a.slice()));return t&&(a=a.concat(Zl)),a.reduce((i,s)=>{let o=typeof s=="string"?MCe[s]:s;if(!o){let l=JSON.stringify(s),c=Object.keys(MCe).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return i.includes(o)||i.push(o),i},[])}var PCe,MCe,ACe,_Ce=y(()=>{cb();bR();db();UE();EW();DW();MW();uCe();fCe();AW();hR();NW();MR();DCe();LW();jW();PCe=new Map([["core",dCe],["failsafe",[Ql,Jl,jm]],["json",mCe],["yaml11",$W],["yaml-1.1",$W]]),MCe={binary:VE,bool:HE,float:SR,floatExp:wR,floatNaN:TR,floatTime:IR,int:ER,intHex:DR,intOct:CR,intTime:_R,map:Ql,merge:Zl,null:kg,omap:WE,pairs:qE,seq:Jl,set:GE,timestamp:fb},ACe={"tag:yaml.org,2002:binary":VE,"tag:yaml.org,2002:merge":Zl,"tag:yaml.org,2002:omap":WE,"tag:yaml.org,2002:pairs":qE,"tag:yaml.org,2002:set":GE,"tag:yaml.org,2002:timestamp":fb}});var Mlt,hb,BW=y(()=>{nr();cb();db();UE();_Ce();Mlt=(r,e)=>r.keye.key?1:0,hb=class r{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:a,schema:i,sortMapEntries:s,toStringDefaults:o}){this.compat=Array.isArray(e)?NR(e,"compat"):e?NR(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=a?ACe:{},this.tags=NR(t,this.name,n),this.toStringOptions=o!=null?o:null,Object.defineProperty(this,Gl,{value:Ql}),Object.defineProperty(this,so,{value:jm}),Object.defineProperty(this,qu,{value:Jl}),this.sortMapEntries=typeof s=="function"?s:s===!0?Mlt:null}clone(){let e=Object.create(r.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}});function ICe(r,e){var l;let t=[],n=e.directives===!0;if(e.directives!==!1&&r.directives){let c=r.directives.toString(r);c?(t.push(c),n=!0):r.directives.docStart&&(n=!0)}n&&t.push("---");let a=pR(r,e),{commentString:i}=a.options;if(r.commentBefore){t.length!==1&&t.unshift("");let c=i(r.commentBefore);t.unshift(Jo(c,""))}let s=!1,o=null;if(r.contents){if(Vt(r.contents)){if(r.contents.spaceBefore&&n&&t.push(""),r.contents.commentBefore){let u=i(r.contents.commentBefore);t.push(Jo(u,""))}a.forceBlockIndent=!!r.comment,o=r.contents.comment}let c=o?void 0:()=>s=!0,d=Gu(r.contents,a,()=>o=null,c);o&&(d+=rd(d,"",i(o))),(d[0]==="|"||d[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${d}`:t.push(d)}else t.push(Gu(r.contents,a));if((l=r.directives)!=null&&l.docEnd)if(r.comment){let c=i(r.comment);c.includes(` `)?(t.push("..."),t.push(Jo(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=r.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||o)&&t[t.length-1]!==""&&t.push(""),t.push(Jo(i(c),"")))}return t.join(` `)+` `}var NCe=y(()=>{nr();BE();OE()});function gb(r){if(hr(r))return!0;throw new Error("Expected a YAML collection as document contents")}var nd,KE=y(()=>{NE();oR();nr();Fm();Nm();BW();NCe();nR();yW();RE();fW();nd=class r{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Hi,{value:eR});let a=null;typeof t=="function"||Array.isArray(t)?a=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:s}=i;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new ed({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,a,n)}clone(){let e=Object.create(r.prototype,{[Hi]:{value:eR}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Vt(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){gb(this.contents)&&this.contents.add(e)}addIn(e,t){gb(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=hW(this);e.anchor=!t||n.has(t)?gW(t||"a",n):t}return new td(e.anchor)}createNode(e,t,n){let a;if(typeof t=="function")e=t.call({"":e},"",e),a=t;else if(Array.isArray(t)){let g=b=>typeof b=="number"||b instanceof String||b instanceof Number,v=t.filter(g).map(String);v.length>0&&(t=t.concat(v)),a=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:s,flow:o,keepUndefined:l,onTagObj:c,tag:d}=n!=null?n:{},{onAnchor:u,setAnchors:p,sourceObjects:m}=tCe(this,s||"a"),f={aliasDuplicateObjects:i!=null?i:!0,keepUndefined:l!=null?l:!1,onAnchor:u,onTagObj:c,replacer:a,schema:this.schema,sourceObjects:m},h=Wu(e,d,f);return o&&hr(h)&&(h.flow=!0),p(),h}createPair(e,t,n={}){let a=this.createNode(e,null,n),i=this.createNode(t,null,n);return new Cn(a,i)}delete(e){return gb(this.contents)?this.contents.delete(e):!1}deleteIn(e){return sb(e)?this.contents==null?!1:(this.contents=null,!0):gb(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return hr(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return sb(e)?!t&&ht(this.contents)?this.contents.value:this.contents:hr(this.contents)?this.contents.getIn(e,t):void 0}has(e){return hr(this.contents)?this.contents.has(e):!1}hasIn(e){return sb(e)?this.contents!==void 0:hr(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=FE(this.schema,[e],t):gb(this.contents)&&this.contents.set(e,t)}setIn(e,t){sb(e)?this.contents=t:this.contents==null?this.contents=FE(this.schema,Array.from(e),t):gb(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ed({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ed({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let a=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${a}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new hb(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:a,onAnchor:i,reviver:s}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},l=ga(this.contents,t!=null?t:"",o);if(typeof i=="function")for(let{count:c,res:d}of o.anchors.values())i(d,c);return typeof s=="function"?Im(s,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return ICe(this,e)}}});var yb,oo,vb,ZE,QE=y(()=>{yb=class extends Error{constructor(e,t,n,a){super(),this.name=e,this.code=n,this.message=a,this.pos=t}},oo=class extends yb{constructor(e,t,n){super("YAMLParseError",e,t,n)}},vb=class extends yb{constructor(e,t,n){super("YAMLWarning",e,t,n)}},ZE=(r,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(o=>e.linePos(o));let{line:n,col:a}=t.linePos[0];t.message+=` at line ${n}, column ${a}`;let i=a-1,s=r.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(i>=60&&s.length>80){let o=Math.min(i-39,s.length-79);s="\u2026"+s.substring(o),i-=o-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(s.substring(0,i))){let o=r.substring(e.lineStarts[n-2],e.lineStarts[n-1]);o.length>80&&(o=o.substring(0,79)+`\u2026 `),s=o+s}if(/[^ ]/.test(s)){let o=1,l=t.linePos[1];(l==null?void 0:l.line)===n&&l.col>a&&(o=Math.max(1,Math.min(l.col-a,80-i)));let c=" ".repeat(i)+"^".repeat(o);t.message+=`: ${s} ${c} `}}});function ad(r,{flow:e,indicator:t,next:n,offset:a,onError:i,parentIndent:s,startOnNewline:o}){let l=!1,c=o,d=o,u="",p="",m=!1,f=!1,h=null,g=null,v=null,b=null,k=null,w=null,S=null;for(let D of r)switch(f&&(D.type!=="space"&&D.type!=="newline"&&D.type!=="comma"&&i(D.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),h&&(c&&D.type!=="comment"&&D.type!=="newline"&&i(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),D.type){case"space":!e&&(t!=="doc-start"||(n==null?void 0:n.type)!=="flow-collection")&&D.source.includes(" ")&&(h=D),d=!0;break;case"comment":{d||i(D,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let P=D.source.substring(1)||" ";u?u+=p+P:u=P,p="",c=!1;break}case"newline":c?u?u+=D.source:(!w||t!=="seq-item-ind")&&(l=!0):p+=D.source,c=!0,m=!0,(g||v)&&(b=D),d=!0;break;case"anchor":g&&i(D,"MULTIPLE_ANCHORS","A node can have at most one anchor"),D.source.endsWith(":")&&i(D.offset+D.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=D,S!=null||(S=D.offset),c=!1,d=!1,f=!0;break;case"tag":{v&&i(D,"MULTIPLE_TAGS","A node can have at most one tag"),v=D,S!=null||(S=D.offset),c=!1,d=!1,f=!0;break}case t:(g||v)&&i(D,"BAD_PROP_ORDER",`Anchors and tags must be after the ${D.source} indicator`),w&&i(D,"UNEXPECTED_TOKEN",`Unexpected ${D.source} in ${e!=null?e:"collection"}`),w=D,c=t==="seq-item-ind"||t==="explicit-key-ind",d=!1;break;case"comma":if(e){k&&i(D,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=D,c=!1,d=!1;break}default:i(D,"UNEXPECTED_TOKEN",`Unexpected ${D.type} token`),c=!1,d=!1}let C=r[r.length-1],E=C?C.offset+C.source.length:a;return f&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&i(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(c&&h.indent<=s||(n==null?void 0:n.type)==="block-map"||(n==null?void 0:n.type)==="block-seq")&&i(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:w,spaceBefore:l,comment:u,hasNewline:m,anchor:g,tag:v,newlineAfterProp:b,end:E,start:S!=null?S:E}}var JE=y(()=>{});function $m(r){if(!r)return null;switch(r.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(r.source.includes(` `))return!0;if(r.end){for(let e of r.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of r.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if($m(e.key)||$m(e.value))return!0}return!1;default:return!0}}var RR=y(()=>{});function XE(r,e,t){if((e==null?void 0:e.type)==="flow-collection"){let n=e.end[0];n.indent===r&&(n.source==="]"||n.source==="}")&&$m(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}var UW=y(()=>{RR()});function FR(r,e,t){let{uniqueKeys:n}=r.options;if(n===!1)return!1;let a=typeof n=="function"?n:(i,s)=>i===s||ht(i)&&ht(s)&&i.value===s.value;return e.some(i=>a(i.key,t))}var HW=y(()=>{nr()});function FCe({composeNode:r,composeEmptyNode:e},t,n,a,i){var d,u;let s=(d=i==null?void 0:i.nodeClass)!=null?d:On,o=new s(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let p of n.items){let{start:m,key:f,sep:h,value:g}=p,v=ad(m,{indicator:"explicit-key-ind",next:f!=null?f:h==null?void 0:h[0],offset:l,onError:a,parentIndent:n.indent,startOnNewline:!0}),b=!v.found;if(b){if(f&&(f.type==="block-seq"?a(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&a(l,"BAD_INDENT",RCe)),!v.anchor&&!v.tag&&!h){c=v.end,v.comment&&(o.comment?o.comment+=` `+v.comment:o.comment=v.comment);continue}(v.newlineAfterProp||$m(f))&&a(f!=null?f:m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((u=v.found)==null?void 0:u.indent)!==n.indent&&a(l,"BAD_INDENT",RCe);t.atKey=!0;let k=v.end,w=f?r(t,f,v,a):e(t,k,m,null,v,a);t.schema.compat&&XE(n.indent,f,a),t.atKey=!1,FR(t,o.items,w)&&a(k,"DUPLICATE_KEY","Map keys must be unique");let S=ad(h!=null?h:[],{indicator:"map-value-ind",next:g,offset:w.range[2],onError:a,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=S.end,S.found){b&&((g==null?void 0:g.type)==="block-map"&&!S.hasNewline&&a(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&v.start{Fm();Lm();JE();RR();UW();HW();RCe="All mapping items must start at the same column"});function LCe({composeNode:r,composeEmptyNode:e},t,n,a,i){var d;let s=(d=i==null?void 0:i.nodeClass)!=null?d:Ua,o=new s(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=n.offset,c=null;for(let{start:u,value:p}of n.items){let m=ad(u,{indicator:"seq-item-ind",next:p,offset:l,onError:a,parentIndent:n.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||p)(p==null?void 0:p.type)==="block-seq"?a(m.end,"BAD_INDENT","All sequence items must start at the same column"):a(l,"MISSING_CHAR","Sequence item without - indicator");else{c=m.end,m.comment&&(o.comment=m.comment);continue}let f=p?r(t,p,m,a):e(t,m.end,u,null,m,a);t.schema.compat&&XE(n.indent,p,a),l=f.range[2],o.items.push(f)}return o.range=[n.offset,l,c!=null?c:l],o}var zCe=y(()=>{zm();JE();UW()});function id(r,e,t,n){let a="";if(r){let i=!1,s="";for(let o of r){let{source:l,type:c}=o;switch(c){case"space":i=!0;break;case"comment":{t&&!i&&n(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=l.substring(1)||" ";a?a+=s+d:a=d,s="";break}case"newline":a&&(s+=l),i=!0;break;default:n(o,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:a,offset:e}}var kb=y(()=>{});function jCe({composeNode:r,composeEmptyNode:e},t,n,a,i){var g,v,b;let s=n.start.source==="{",o=s?"flow map":"flow sequence",l=(g=i==null?void 0:i.nodeClass)!=null?g:s?On:Ua,c=new l(t.schema);c.flow=!0;let d=t.atRoot;d&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=n.offset+n.start.source.length;for(let k=0;k0){let k=id(f,h,t.options.strict,a);k.comment&&(c.comment?c.comment+=` `+k.comment:c.comment=k.comment),c.range=[n.offset,h,k.offset]}else c.range=[n.offset,h,h];return c}var VW,qW,$Ce=y(()=>{nr();Fm();Lm();zm();kb();JE();RR();HW();VW="Block collections are not allowed within flow collections",qW=r=>r&&(r.type==="block-map"||r.type==="block-seq")});function WW(r,e,t,n,a,i){let s=t.type==="block-map"?FCe(r,e,t,n,i):t.type==="block-seq"?LCe(r,e,t,n,i):jCe(r,e,t,n,i),o=s.constructor;return a==="!"||a===o.tagName?(s.tag=o.tagName,s):(a&&(s.tag=a),s)}function BCe(r,e,t,n,a){var p,m,f;let i=n.tag,s=i?e.directives.tagName(i.source,h=>a(i,"TAG_RESOLVE_FAILED",h)):null;if(t.type==="block-seq"){let{anchor:h,newlineAfterProp:g}=n,v=h&&i?h.offset>i.offset?h:i:h!=null?h:i;v&&(!g||g.offseth.tag===s&&h.collection===o);if(!l){let h=e.schema.knownTags[s];if((h==null?void 0:h.collection)===o)e.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?a(i,"BAD_COLLECTION_TYPE",`${h.tag} used for ${o} collection, but expects ${(p=h.collection)!=null?p:"scalar"}`,!0):a(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),WW(r,e,t,a,s)}let c=WW(r,e,t,a,s,l),d=(f=(m=l.resolve)==null?void 0:m.call(l,c,h=>a(i,"TAG_RESOLVE_FAILED",h),e.options))!=null?f:c,u=Vt(d)?d:new Ae(d);return u.range=c.range,u.tag=s,l!=null&&l.format&&(u.format=l.format),u}var UCe=y(()=>{nr();aa();Lm();zm();OCe();zCe();$Ce()});function OR(r,e,t){let n=e.offset,a=Alt(e,r.options.strict,t);if(!a)return{value:"",type:null,comment:"",range:[n,n,n]};let i=a.mode===">"?Ae.BLOCK_FOLDED:Ae.BLOCK_LITERAL,s=e.source?_lt(e.source):[],o=s.length;for(let h=s.length-1;h>=0;--h){let g=s[h][1];if(g===""||g==="\r")o=h;else break}if(o===0){let h=a.chomp==="+"&&s.length>0?` `.repeat(Math.max(1,s.length-1)):"",g=n+a.length;return e.source&&(g+=e.source.length),{value:h,type:i,comment:a.comment,range:[n,g,g]}}let l=e.indent+a.indent,c=e.offset+a.length,d=0;for(let h=0;hl&&(l=g.length);else{g.length=o;--h)s[h][0].length>l&&(o=h+1);let u="",p="",m=!1;for(let h=0;hl||v[0]===" "?(p===" "?p=` `:!m&&p===` `&&(p=` `),u+=p+g.slice(l)+v,p=` `,m=!0):v===""?p===` `?u+=` `:p=` `:(u+=p+v,p=" ",m=!1)}switch(a.chomp){case"-":break;case"+":for(let h=o;h{aa()});function LR(r,e,t){let{offset:n,type:a,source:i,end:s}=r,o,l,c=(p,m,f)=>t(n+p,m,f);switch(a){case"scalar":o=Ae.PLAIN,l=Ilt(i,c);break;case"single-quoted-scalar":o=Ae.QUOTE_SINGLE,l=Nlt(i,c);break;case"double-quoted-scalar":o=Ae.QUOTE_DOUBLE,l=Rlt(i,c);break;default:return t(r,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${a}`),{value:"",type:null,comment:"",range:[n,n+i.length,n+i.length]}}let d=n+i.length,u=id(s,d,e,t);return{value:l,type:o,comment:u.comment,range:[n,d,u.offset]}}function Ilt(r,e){let t="";switch(r[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${r[0]}`;break}case"@":case"`":{t=`reserved character ${r[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),HCe(r)}function Nlt(r,e){return(r[r.length-1]!=="'"||r.length===1)&&e(r.length,"MISSING_CHAR","Missing closing 'quote"),HCe(r.slice(1,-1)).replace(/''/g,"'")}function HCe(r){var l;let e,t;try{e=new RegExp(`(.*?)(?i?r.slice(i,n+1):a)}else t+=a}return(r[r.length-1]!=='"'||r.length===1)&&e(r.length,"MISSING_CHAR",'Missing closing "quote'),t}function Flt(r,e){let t="",n=r[e+1];for(;(n===" "||n===" "||n===` `||n==="\r")&&!(n==="\r"&&r[e+2]!==` `);)n===` `&&(t+=` `),e+=1,n=r[e+1];return t||(t=" "),{fold:t,offset:e}}function Llt(r,e,t,n){let a=r.substr(e,t),s=a.length===t&&/^[0-9a-fA-F]+$/.test(a)?parseInt(a,16):NaN;try{return String.fromCodePoint(s)}catch(o){let l=r.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}var Olt,GW=y(()=>{aa();kb();Olt={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "}});function KW(r,e,t,n){let{value:a,type:i,comment:s,range:o}=e.type==="block-scalar"?OR(r,e,n):LR(e,r.options.strict,n),l=t?r.directives.tagName(t.source,u=>n(t,"TAG_RESOLVE_FAILED",u)):null,c;r.options.stringKeys&&r.atKey?c=r.schema[so]:l?c=zlt(r.schema,a,l,t,n):e.type==="scalar"?c=jlt(r,a,e,n):c=r.schema[so];let d;try{let u=c.resolve(a,p=>n(t!=null?t:e,"TAG_RESOLVE_FAILED",p),r.options);d=ht(u)?u:new Ae(u)}catch(u){let p=u instanceof Error?u.message:String(u);n(t!=null?t:e,"TAG_RESOLVE_FAILED",p),d=new Ae(a)}return d.range=o,d.source=a,i&&(d.type=i),l&&(d.tag=l),c.format&&(d.format=c.format),s&&(d.comment=s),d}function zlt(r,e,t,n,a){var o;if(t==="!")return r[so];let i=[];for(let l of r.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)i.push(l);else return l;for(let l of i)if((o=l.test)!=null&&o.test(e))return l;let s=r.knownTags[t];return s&&!s.collection?(r.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(a(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),r[so])}function jlt({atKey:r,directives:e,schema:t},n,a,i){var o;let s=t.tags.find(l=>{var c;return(l.default===!0||r&&l.default==="key")&&((c=l.test)==null?void 0:c.test(n))})||t[so];if(t.compat){let l=(o=t.compat.find(c=>{var d;return c.default&&((d=c.test)==null?void 0:d.test(n))}))!=null?o:t[so];if(s.tag!==l.tag){let c=e.tagString(s.tag),d=e.tagString(l.tag),u=`Value may be parsed as either ${c} or ${d}`;i(a,"TAG_RESOLVE_FAILED",u,!0)}}return s}var VCe=y(()=>{nr();aa();YW();GW()});function qCe(r,e,t){if(e){t!=null||(t=e.length);for(let n=t-1;n>=0;--n){let a=e[n];switch(a.type){case"space":case"comment":case"newline":r-=a.source.length;continue}for(a=e[++n];(a==null?void 0:a.type)==="space";)r+=a.source.length,a=e[++n];break}}return r}var WCe=y(()=>{});function ZW(r,e,t,n){let a=r.atKey,{spaceBefore:i,comment:s,anchor:o,tag:l}=t,c,d=!0;switch(e.type){case"alias":c=Blt(r,e,n),(o||l)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=KW(r,e,l,n),o&&(c.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=BCe($lt,r,e,t,n),o&&(c.anchor=o.source.substring(1))}catch(u){let p=u instanceof Error?u.message:String(u);n(e,"RESOURCE_EXHAUSTION",p)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",u),d=!1}}return c!=null||(c=zR(r,e.offset,void 0,null,t,n)),o&&c.anchor===""&&n(o,"BAD_ALIAS","Anchor cannot be an empty string"),a&&r.options.stringKeys&&(!ht(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l!=null?l:e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(c.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?c.comment=s:c.commentBefore=s),r.options.keepSourceTokens&&d&&(c.srcToken=e),c}function zR(r,e,t,n,{spaceBefore:a,comment:i,anchor:s,tag:o,end:l},c){let d={type:"scalar",offset:qCe(e,t,n),indent:-1,source:""},u=KW(r,d,o,c);return s&&(u.anchor=s.source.substring(1),u.anchor===""&&c(s,"BAD_ALIAS","Anchor cannot be an empty string")),a&&(u.spaceBefore=!0),i&&(u.comment=i,u.range[2]=l),u}function Blt({options:r},{offset:e,source:t,end:n},a){let i=new td(t.substring(1));i.source===""&&a(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&a(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+t.length,o=id(n,s,r.strict,a);return i.range=[e,s,o.offset],o.comment&&(i.comment=o.comment),i}var $lt,YCe=y(()=>{NE();nr();UCe();VCe();kb();WCe();$lt={composeNode:ZW,composeEmptyNode:zR}});function GCe(r,e,{offset:t,start:n,value:a,end:i},s){let o=Object.assign({_directives:e},r),l=new nd(void 0,o),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=ad(n,{indicator:"doc-start",next:a!=null?a:i==null?void 0:i[0],offset:t,onError:s,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,a&&(a.type==="block-map"||a.type==="block-seq")&&!d.hasNewline&&s(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=a?ZW(c,a,d,s):zR(c,d.end,n,null,d,s);let u=l.contents.range[2],p=id(i,u,!1,s);return p.comment&&(l.comment=p.comment),l.range=[t,u,p.offset],l}var KCe=y(()=>{KE();YCe();kb();JE()});function eD(r){if(typeof r=="number")return[r,r+1];if(Array.isArray(r))return r.length===2?r:[r[0],r[1]];let{offset:e,source:t}=r;return[e,e+(typeof t=="string"?t.length:1)]}function ZCe(r){var a;let e="",t=!1,n=!1;for(let i=0;i{fW();KE();QE();nr();KCe();kb();bg=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,a,i)=>{let s=eD(t);i?this.warnings.push(new vb(s,n,a)):this.errors.push(new oo(s,n,a))},this.directives=new ed({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:a}=ZCe(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment} ${n}`:n;else if(a||e.directives.docStart||!i)e.commentBefore=n;else if(hr(i)&&!i.flow&&i.items.length>0){let s=i.items[0];Lt(s)&&(s=s.key);let o=s.commentBefore;s.commentBefore=o?`${n} ${o}`:n}else{let s=i.commentBefore;i.commentBefore=s?`${n} ${s}`:n}}if(t){for(let i=0;i{let i=eD(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,a)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=GCe(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new oo(eD(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new oo(eD(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=id(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n} ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new oo(eD(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),a=new nd(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),a.range=[0,t,t],this.decorate(a,!1),yield a}}}});function QCe(r,e=!0,t){if(r){let n=(a,i,s)=>{let o=typeof a=="number"?a:Array.isArray(a)?a[0]:a.offset;if(t)t(o,i,s);else throw new oo([o,o+1],i,s)};switch(r.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return LR(r,e,n);case"block-scalar":return OR({options:{strict:e}},r,n)}}return null}function JCe(r,e){var c;let{implicitKey:t=!1,indent:n,inFlow:a=!1,offset:i=-1,type:s="PLAIN"}=e,o=Yu({type:s,value:r},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),l=(c=e.end)!=null?c:[{type:"newline",offset:-1,indent:n,source:` `}];switch(o[0]){case"|":case">":{let d=o.indexOf(` `),u=o.substring(0,d),p=o.substring(d+1)+` `,m=[{type:"block-scalar-header",offset:i,indent:n,source:u}];return eEe(m,l)||m.push({type:"newline",offset:-1,indent:n,source:` `}),{type:"block-scalar",offset:i,indent:n,props:m,source:p}}case'"':return{type:"double-quoted-scalar",offset:i,indent:n,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:i,indent:n,source:o,end:l};default:return{type:"scalar",offset:i,indent:n,source:o,end:l}}}function XCe(r,e,t={}){let{afterKey:n=!1,implicitKey:a=!1,inFlow:i=!1,type:s}=t,o="indent"in r?r.indent:null;if(n&&typeof o=="number"&&(o+=2),!s)switch(r.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let c=r.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let l=Yu({type:s,value:e},{implicitKey:a||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Ult(r,l);break;case'"':JW(r,l,"double-quoted-scalar");break;case"'":JW(r,l,"single-quoted-scalar");break;default:JW(r,l,"scalar")}}function Ult(r,e){let t=e.indexOf(` `),n=e.substring(0,t),a=e.substring(t+1)+` `;if(r.type==="block-scalar"){let i=r.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=n,r.source=a}else{let{offset:i}=r,s="indent"in r?r.indent:-1,o=[{type:"block-scalar-header",offset:i,indent:s,source:n}];eEe(o,"end"in r?r.end:void 0)||o.push({type:"newline",offset:-1,indent:s,source:` `});for(let l of Object.keys(r))l!=="type"&&l!=="offset"&&delete r[l];Object.assign(r,{type:"block-scalar",indent:s,props:o,source:a})}}function eEe(r,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":r.push(t);break;case"newline":return r.push(t),!0}return!1}function JW(r,e,t){switch(r.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":r.type=t,r.source=e;break;case"block-scalar":{let n=r.props.slice(1),a=e.length;r.props[0].type==="block-scalar-header"&&(a-=r.props[0].source.length);for(let i of n)i.offset+=a;delete r.props,Object.assign(r,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let a={type:"newline",offset:r.offset+e.length,indent:r.indent,source:` `};delete r.items,Object.assign(r,{type:t,source:e,end:[a]});break}default:{let n="indent"in r?r.indent:-1,a="end"in r&&Array.isArray(r.end)?r.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(r))i!=="type"&&i!=="offset"&&delete r[i];Object.assign(r,{type:t,indent:n,source:e,end:a})}}}var tEe=y(()=>{YW();GW();QE();$E()});function $R(r){switch(r.type){case"block-scalar":{let e="";for(let t of r.props)e+=$R(t);return e+r.source}case"block-map":case"block-seq":{let e="";for(let t of r.items)e+=jR(t);return e}case"flow-collection":{let e=r.start.source;for(let t of r.items)e+=jR(t);for(let t of r.end)e+=t.source;return e}case"document":{let e=jR(r);if(r.end)for(let t of r.end)e+=t.source;return e}default:{let e=r.source;if("end"in r&&r.end)for(let t of r.end)e+=t.source;return e}}}function jR({start:r,key:e,sep:t,value:n}){let a="";for(let i of r)a+=i.source;if(e&&(a+=$R(e)),t)for(let i of t)a+=i.source;return n&&(a+=$R(n)),a}var rEe,nEe=y(()=>{rEe=r=>"type"in r?$R(r):jR(r)});function Bm(r,e){"type"in r&&r.type==="document"&&(r={start:r.start,value:r.value}),iEe(Object.freeze([]),r,e)}function iEe(r,e,t){let n=t(e,r);if(typeof n=="symbol")return n;for(let a of["key","value"]){let i=e[a];if(i&&"items"in i){for(let s=0;s{XW=Symbol("break visit"),Hlt=Symbol("skip children"),aEe=Symbol("remove item");Bm.BREAK=XW;Bm.SKIP=Hlt;Bm.REMOVE=aEe;Bm.itemAtPath=(r,e)=>{let t=r;for(let[n,a]of e){let i=t==null?void 0:t[n];if(i&&"items"in i)t=i.items[a];else return}return t};Bm.parentCollection=(r,e)=>{let t=Bm.itemAtPath(r,e.slice(0,-1)),n=e[e.length-1][0],a=t==null?void 0:t[n];if(a&&"items"in a)return a;throw new Error("Parent collection not found")}});var t4={};at(t4,{BOM:()=>tD,DOCUMENT:()=>rD,FLOW_END:()=>nD,SCALAR:()=>bb,createScalarToken:()=>JCe,isCollection:()=>Vlt,isScalar:()=>qlt,prettyToken:()=>Wlt,resolveAsScalar:()=>QCe,setScalarValue:()=>XCe,stringify:()=>rEe,tokenType:()=>e4,visit:()=>Bm});function Wlt(r){switch(r){case tD:return"";case rD:return"";case nD:return"";case bb:return"";default:return JSON.stringify(r)}}function e4(r){switch(r){case tD:return"byte-order-mark";case rD:return"doc-mode";case nD:return"flow-error-end";case bb:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(r[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}var tD,rD,nD,bb,Vlt,qlt,BR=y(()=>{tEe();nEe();sEe();tD="\uFEFF",rD="",nD="",bb="",Vlt=r=>!!r&&"items"in r,qlt=r=>!!r&&(r.type==="scalar"||r.type==="single-quoted-scalar"||r.type==="double-quoted-scalar"||r.type==="block-scalar")});function Xl(r){switch(r){case void 0:case" ":case` `:case"\r":case" ":return!0;default:return!1}}var oEe,Ylt,UR,Glt,r4,Tb,n4=y(()=>{BR();oEe=new Set("0123456789ABCDEFabcdef"),Ylt=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),UR=new Set(",[]{}"),Glt=new Set(` ,[]{} \r `),r4=r=>!r||Glt.has(r),Tb=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){var a;if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=(a=this.next)!=null?a:"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===` `?!0:t==="\r"?this.buffer[e+1]===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let a=this.buffer[n+e+1];if(a===` `||!a&&!this.atEnd)return e+n+1}return t===` `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Xl(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Xl(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Xl(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(r4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let a=this.getLine();if(a===null)return this.setNext("flow");if((n!==-1&&n"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>Xl(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let i=this.pos;n=this.buffer[i];++i)switch(n){case" ":t+=1;break;case` `:e=i,t=0;break;case"\r":{let s=this.buffer[i+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===` `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(` `,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let a=e+1;for(n=this.buffer[a];n===" ";)n=this.buffer[++a];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===` `;)n=this.buffer[++a];e=a-1}else if(!this.blockScalarKeep)do{let i=e-1,s=this.buffer[i];s==="\r"&&(s=this.buffer[--i]);let o=i;for(;s===" ";)s=this.buffer[--i];if(s===` `&&i>=this.pos&&i+1+t>o)e=i;else break}while(!0);return yield bb,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,a;for(;a=this.buffer[++n];)if(a===":"){let i=this.buffer[n+1];if(Xl(i)||e&&UR.has(i))break;t=n}else if(Xl(a)){let i=this.buffer[n+1];if(a==="\r"&&(i===` `?(n+=1,a=` `,i=this.buffer[n+1]):t=n),i==="#"||e&&UR.has(i))break;if(a===` `){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&UR.has(a))break;t=n}return!a&&!this.atEnd?this.setNext("plain-scalar"):(yield bb,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(r4),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(Xl(n)||t&&UR.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!Xl(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Ylt.has(t))t=this.buffer[++e];else if(t==="%"&&oEe.has(this.buffer[e+1])&&oEe.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let a=t-this.pos;return a>0&&(yield this.buffer.substr(this.pos,a),this.pos=t),a}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}});var wb,a4=y(()=>{wb=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t>1;this.lineStarts[i]=0;)switch(r[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((t=r[++e])==null?void 0:t.type)==="space";);return r.splice(e,r.length)}function VR(r,e){if(e.length<1e5)Array.prototype.push.apply(r,e);else for(let t=0;t{BR();n4();Tg=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Tb,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=e4(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(e==null?void 0:e.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e!=null?e:this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&cEe(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let a=n.items[n.items.length-1];if(a.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(a.sep)a.value=t;else{Object.assign(a,{key:t,sep:[]}),this.onKeyLine=!a.explicitKey;return}break}case"block-seq":{let a=n.items[n.items.length-1];a.value?n.items.push({start:[],value:t}):a.value=t;break}case"flow-collection":{let a=n.items[n.items.length-1];!a||a.value?n.items.push({start:[],key:t,sep:[]}):a.sep?a.value=t:Object.assign(a,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let a=t.items[t.items.length-1];a&&!a.sep&&!a.value&&a.start.length>0&&lEe(a.start)===-1&&(t.indent===0||a.start.every(i=>i.type!=="comment"||i.indent=e.indent){let a=!this.onKeyLine&&this.indent===e.indent,i=a&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&t.sep&&!t.value){let o=[];for(let l=0;le.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Um(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(dEe(t.key)&&!Um(t.sep,"newline")){let o=Sb(t.start),l=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:c}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(Um(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Sb(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Um(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||t.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!Um(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else a&&e.items.push({start:s});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var n;let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let a="end"in t.value?t.value.end:void 0,i=Array.isArray(a)?a[a.length-1]:void 0;(i==null?void 0:i.type)==="comment"?a==null||a.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let a=e.items[e.items.length-2],i=(n=a==null?void 0:a.value)==null?void 0:n.end;if(Array.isArray(i)){VR(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||Um(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let a=this.startBlockValue(e);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while((n==null?void 0:n.type)==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:a,sep:[]}):t.sep?this.stack.push(a):Object.assign(t,{key:a,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let a=HR(n),i=Sb(a);cEe(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(` `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(` `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=HR(e),n=Sb(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=HR(e),n=Sb(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}});function uEe(r){let e=r.prettyErrors!==!1;return{lineCounter:r.lineCounter||e&&new wb||null,prettyErrors:e}}function pEe(r,e={}){let{lineCounter:t,prettyErrors:n}=uEe(e),a=new Tg(t==null?void 0:t.addNewLine),i=new bg(e),s=Array.from(i.compose(a.parse(r)));if(n&&t)for(let o of s)o.errors.forEach(ZE(r,t)),o.warnings.forEach(ZE(r,t));return s.length>0?s:Object.assign([],{empty:!0},i.streamInfo())}function s4(r,e={}){let{lineCounter:t,prettyErrors:n}=uEe(e),a=new Tg(t==null?void 0:t.addNewLine),i=new bg(e),s=null;for(let o of i.compose(a.parse(r),!0,r.length))if(!s)s=o;else if(s.options.logLevel!=="silent"){s.errors.push(new oo(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(s.errors.forEach(ZE(r,t)),s.warnings.forEach(ZE(r,t))),s}function mEe(r,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let a=s4(r,t);if(!a)return null;if(a.warnings.forEach(i=>mR(a.options.logLevel,i)),a.errors.length>0){if(a.options.logLevel!=="silent")throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:n},t))}function fEe(r,e,t){var a;let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(r===void 0){let{keepUndefined:i}=(a=t!=null?t:e)!=null?a:{};if(!i)return}return Ko(r)&&!n?r.toString(t):new nd(r,n,t).toString(t)}var hEe=y(()=>{QW();KE();QE();TW();nr();a4();i4()});var o4={};at(o4,{Alias:()=>td,CST:()=>t4,Composer:()=>bg,Document:()=>nd,Lexer:()=>Tb,LineCounter:()=>wb,Pair:()=>Cn,Parser:()=>Tg,Scalar:()=>Ae,Schema:()=>hb,YAMLError:()=>yb,YAMLMap:()=>On,YAMLParseError:()=>oo,YAMLSeq:()=>Ua,YAMLWarning:()=>vb,isAlias:()=>Go,isCollection:()=>hr,isDocument:()=>Ko,isMap:()=>Zo,isNode:()=>Vt,isPair:()=>Lt,isScalar:()=>ht,isSeq:()=>Qo,parse:()=>mEe,parseAllDocuments:()=>pEe,parseDocument:()=>s4,stringify:()=>fEe,visit:()=>Kl,visitAsync:()=>_E});var l4=y(()=>{QW();KE();BW();QE();NE();nr();Fm();aa();Lm();zm();BR();n4();a4();i4();hEe();IE()});var xb,aD=y(()=>{l4();l4();xb=o4});function iD(r,e){let t=Klt(r),n=t.frontmatter?Zlt(t.frontmatter,e):{},a=Qlt(t.body,e);return{frontmatter:n,body:a}}function Klt(r){var t,n;let e=r.split(` `);if(((t=e[0])==null?void 0:t.trim())==="---"){let a=-1;for(let i=1;i0){let s=e.slice(1,a).join(` `),l=e.slice(a+1).join(` `);return{frontmatter:s.trim()||null,body:l}}}return{frontmatter:null,body:r}}function Zlt(r,e){try{let t=Xlt(Jlt(r,e)),n=xb.parse(t);return typeof n!="object"||n===null?(gEe.warn("Template frontmatter did not parse to a valid object",{category:"validation",operation:"template-frontmatter-did-not-parse-valid-object"}),{}):n}catch(t){return gEe.error("Error processing template frontmatter:",{category:"validation",operation:"processing-template-frontmatter",error:t}),{}}}function Qlt(r,e){return tct(r,e)}function Jlt(r,e){var g;let t=r,n=new Date,a=e.title||"";t=wg(t,"title",a),t=t.replace(/\{\{priority\}\}/g,e.priority||""),t=t.replace(/\{\{status\}\}/g,e.status||"");let i=Array.isArray(e.contexts)?e.contexts.join(", "):"";t=t.replace(/\{\{contexts\}\}/g,i);let s=Array.isArray(e.tags)?e.tags.join(", "):"";t=t.replace(/\{\{tags\}\}/g,s);let o=Array.isArray(e.tags)?e.tags.map(v=>`#${v}`).join(" "):"";t=t.replace(/\{\{hashtags\}\}/g,o),t=t.replace(/\{\{timeEstimate\}\}/g,((g=e.timeEstimate)==null?void 0:g.toString())||""),t=t.replace(/\{\{dueDate\}\}/g,e.dueDate||""),t=t.replace(/\{\{scheduledDate\}\}/g,e.scheduledDate||""),t=t.replace(/\{\{details\}\}/g,e.details||"");let l=e.parentNote||"";t=wg(t,"parentNote",l,{alwaysQuote:!0}),t=t.replace(/\{\{date\}\}/g,M(n,"yyyy-MM-dd")),t=t.replace(/\{\{time\}\}/g,M(n,"HH:mm")),t=t.replace(/\{\{year\}\}/g,M(n,"yyyy")),t=t.replace(/\{\{month\}\}/g,M(n,"MM")),t=t.replace(/\{\{day\}\}/g,M(n,"dd")),t=t.replace(/\{\{hour\}\}/g,M(n,"HH")),t=t.replace(/\{\{minute\}\}/g,M(n,"mm")),t=t.replace(/\{\{second\}\}/g,M(n,"ss")),t=t.replace(/\{\{timestamp\}\}/g,M(n,"yyyy-MM-dd-HHmmss")),t=t.replace(/\{\{dateTime\}\}/g,M(n,"yyyy-MM-dd-HHmm")),t=t.replace(/\{\{shortDate\}\}/g,M(n,"yyMMdd")),t=t.replace(/\{\{shortYear\}\}/g,M(n,"yy")),t=t.replace(/\{\{monthName\}\}/g,M(n,"MMMM")),t=t.replace(/\{\{monthNameShort\}\}/g,M(n,"MMM")),t=t.replace(/\{\{dayName\}\}/g,M(n,"EEEE")),t=t.replace(/\{\{dayNameShort\}\}/g,M(n,"EEE")),t=t.replace(/\{\{week\}\}/g,M(n,"ww")),t=t.replace(/\{\{quarter\}\}/g,M(n,"q")),t=t.replace(/\{\{time12\}\}/g,M(n,"hh:mm a")),t=t.replace(/\{\{time24\}\}/g,M(n,"HH:mm")),t=t.replace(/\{\{hourPadded\}\}/g,M(n,"HH")),t=t.replace(/\{\{hour12\}\}/g,M(n,"hh")),t=t.replace(/\{\{ampm\}\}/g,M(n,"a")),t=t.replace(/\{\{unix\}\}/g,Math.floor(n.getTime()/1e3).toString()),t=t.replace(/\{\{unixMs\}\}/g,n.getTime().toString()),t=t.replace(/\{\{milliseconds\}\}/g,M(n,"SSS")),t=t.replace(/\{\{ms\}\}/g,M(n,"SSS")),t=t.replace(/\{\{timezone\}\}/g,M(n,"xxx")),t=t.replace(/\{\{timezoneShort\}\}/g,M(n,"xx")),t=t.replace(/\{\{utcOffset\}\}/g,M(n,"xxx")),t=t.replace(/\{\{utcOffsetShort\}\}/g,M(n,"xx")),t=t.replace(/\{\{utcZ\}\}/g,"Z");let c=M(n,"yyMMdd"),d=new Date(n);d.setHours(0,0,0,0);let u=Math.floor((n.getTime()-d.getTime())/1e3),p=`${c}${u.toString(36)}`;t=t.replace(/\{\{zettel\}\}/g,p),t=t.replace(/\{\{nano\}\}/g,Date.now().toString()+Math.random().toString(36).substring(2,7));let m=e.priority||"",f=e.status||"";t=t.replace(/\{\{priorityShort\}\}/g,m.substring(0,1).toUpperCase()),t=t.replace(/\{\{statusShort\}\}/g,f.substring(0,1).toUpperCase());let h=e.title||"";if(t=t.replace(/\{\{titleLower\}\}/g,h.toLowerCase()),t=t.replace(/\{\{titleUpper\}\}/g,h.toUpperCase()),t=t.replace(/\{\{titleSnake\}\}/g,h.toLowerCase().replace(/\s+/g,"_")),t=t.replace(/\{\{titleKebab\}\}/g,h.toLowerCase().replace(/\s+/g,"-")),t=t.replace(/\{\{titleCamel\}\}/g,h.replace(/(?:^\w|[A-Z]|\b\w)/g,(v,b)=>b===0?v.toLowerCase():v.toUpperCase()).replace(/\s+/g,"")),t=t.replace(/\{\{titlePascal\}\}/g,h.replace(/(?:^\w|[A-Z]|\b\w)/g,v=>v.toUpperCase()).replace(/\s+/g,"")),"icsEventTitle"in e){let v=e,b=v.icsEventTitle||"";t=wg(t,"icsEventTitle",b),t=t.replace(/\{\{icsEventStart\}\}/g,v.icsEventStart||""),t=t.replace(/\{\{icsEventEnd\}\}/g,v.icsEventEnd||"");let k=v.icsEventLocation||"";t=wg(t,"icsEventLocation",k);let w=v.icsEventDescription||"";t=wg(t,"icsEventDescription",w),t=t.replace(/\{\{icsEventUrl\}\}/g,v.icsEventUrl||"");let S=v.icsEventSubscription||"";t=wg(t,"icsEventSubscription",S);let C=v.icsEventId||"";t=wg(t,"icsEventId",C,{alwaysQuote:!0})}return t}function wg(r,e,t,n={}){let a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`(["'])\\{\\{${a}\\}\\}\\1`,"g"),s=t||"",o=r.replace(i,(d,u)=>{let p=u==="'"?s.replace(/'/g,"''"):c4(s);return`${u}${p}${u}`}),l=s&&(n.alwaysQuote||ect(s))?`"${c4(s)}"`:s,c=new RegExp(`\\{\\{${a}\\}\\}`,"g");return o=o.replace(c,l),o}function Xlt(r){return r.replace(/^(\s*[^#\n][^:\n]*:\s*)(<%.*?%>)(\s*)$/gm,(e,t,n,a)=>`${t}"${c4(n)}"${a}`)}function ect(r){if(!r)return!1;let e=/[[\]{}:>|*&!%#`@,]/,t=/^[-?]/,n=/^\d+\.?\d*$/,a=/^(true|false|yes|no|on|off)$/i;return e.test(r)||t.test(r)||n.test(r)||a.test(r)}function c4(r){return r?r.replace(/\\/g,"\\\\").replace(/"/g,'\\"'):""}function tct(r,e){var f;let t=r,n=new Date;t=t.replace(/\{\{title\}\}/g,e.title||""),t=t.replace(/\{\{priority\}\}/g,e.priority||""),t=t.replace(/\{\{status\}\}/g,e.status||"");let a=Array.isArray(e.contexts)?e.contexts.join(", "):"";t=t.replace(/\{\{contexts\}\}/g,a);let i=Array.isArray(e.tags)?e.tags.join(", "):"";t=t.replace(/\{\{tags\}\}/g,i);let s=Array.isArray(e.tags)?e.tags.map(h=>`#${h}`).join(" "):"";t=t.replace(/\{\{hashtags\}\}/g,s),t=t.replace(/\{\{timeEstimate\}\}/g,((f=e.timeEstimate)==null?void 0:f.toString())||""),t=t.replace(/\{\{dueDate\}\}/g,e.dueDate||""),t=t.replace(/\{\{scheduledDate\}\}/g,e.scheduledDate||""),t=t.replace(/\{\{details\}\}/g,e.details||""),t=t.replace(/\{\{parentNote\}\}/g,e.parentNote||""),t=t.replace(/\{\{date\}\}/g,M(n,"yyyy-MM-dd")),t=t.replace(/\{\{time\}\}/g,M(n,"HH:mm")),t=t.replace(/\{\{year\}\}/g,M(n,"yyyy")),t=t.replace(/\{\{month\}\}/g,M(n,"MM")),t=t.replace(/\{\{day\}\}/g,M(n,"dd")),t=t.replace(/\{\{hour\}\}/g,M(n,"HH")),t=t.replace(/\{\{minute\}\}/g,M(n,"mm")),t=t.replace(/\{\{second\}\}/g,M(n,"ss")),t=t.replace(/\{\{timestamp\}\}/g,M(n,"yyyy-MM-dd-HHmmss")),t=t.replace(/\{\{dateTime\}\}/g,M(n,"yyyy-MM-dd-HHmm")),t=t.replace(/\{\{shortDate\}\}/g,M(n,"yyMMdd")),t=t.replace(/\{\{shortYear\}\}/g,M(n,"yy")),t=t.replace(/\{\{monthName\}\}/g,M(n,"MMMM")),t=t.replace(/\{\{monthNameShort\}\}/g,M(n,"MMM")),t=t.replace(/\{\{dayName\}\}/g,M(n,"EEEE")),t=t.replace(/\{\{dayNameShort\}\}/g,M(n,"EEE")),t=t.replace(/\{\{week\}\}/g,M(n,"ww")),t=t.replace(/\{\{quarter\}\}/g,M(n,"q")),t=t.replace(/\{\{time12\}\}/g,M(n,"hh:mm a")),t=t.replace(/\{\{time24\}\}/g,M(n,"HH:mm")),t=t.replace(/\{\{hourPadded\}\}/g,M(n,"HH")),t=t.replace(/\{\{hour12\}\}/g,M(n,"hh")),t=t.replace(/\{\{ampm\}\}/g,M(n,"a")),t=t.replace(/\{\{unix\}\}/g,Math.floor(n.getTime()/1e3).toString()),t=t.replace(/\{\{unixMs\}\}/g,n.getTime().toString()),t=t.replace(/\{\{milliseconds\}\}/g,M(n,"SSS")),t=t.replace(/\{\{ms\}\}/g,M(n,"SSS")),t=t.replace(/\{\{timezone\}\}/g,M(n,"xxx")),t=t.replace(/\{\{timezoneShort\}\}/g,M(n,"xx")),t=t.replace(/\{\{utcOffset\}\}/g,M(n,"xxx")),t=t.replace(/\{\{utcOffsetShort\}\}/g,M(n,"xx")),t=t.replace(/\{\{utcZ\}\}/g,"Z");let o=M(n,"yyMMdd"),l=new Date(n);l.setHours(0,0,0,0);let c=Math.floor((n.getTime()-l.getTime())/1e3),d=`${o}${c.toString(36)}`;t=t.replace(/\{\{zettel\}\}/g,d),t=t.replace(/\{\{nano\}\}/g,Date.now().toString()+Math.random().toString(36).substring(2,7));let u=e.priority||"",p=e.status||"";t=t.replace(/\{\{priorityShort\}\}/g,u.substring(0,1).toUpperCase()),t=t.replace(/\{\{statusShort\}\}/g,p.substring(0,1).toUpperCase());let m=e.title||"";if(t=t.replace(/\{\{titleLower\}\}/g,m.toLowerCase()),t=t.replace(/\{\{titleUpper\}\}/g,m.toUpperCase()),t=t.replace(/\{\{titleSnake\}\}/g,m.toLowerCase().replace(/\s+/g,"_")),t=t.replace(/\{\{titleKebab\}\}/g,m.toLowerCase().replace(/\s+/g,"-")),t=t.replace(/\{\{titleCamel\}\}/g,m.replace(/(?:^\w|[A-Z]|\b\w)/g,(h,g)=>g===0?h.toLowerCase():h.toUpperCase()).replace(/\s+/g,"")),t=t.replace(/\{\{titlePascal\}\}/g,m.replace(/(?:^\w|[A-Z]|\b\w)/g,h=>h.toUpperCase()).replace(/\s+/g,"")),"icsEventTitle"in e){let h=e;t=t.replace(/\{\{icsEventTitle\}\}/g,h.icsEventTitle||""),t=t.replace(/\{\{icsEventStart\}\}/g,h.icsEventStart||""),t=t.replace(/\{\{icsEventEnd\}\}/g,h.icsEventEnd||""),t=t.replace(/\{\{icsEventLocation\}\}/g,h.icsEventLocation||""),t=t.replace(/\{\{icsEventDescription\}\}/g,h.icsEventDescription||""),t=t.replace(/\{\{icsEventUrl\}\}/g,h.icsEventUrl||""),t=t.replace(/\{\{icsEventSubscription\}\}/g,h.icsEventSubscription||""),t=t.replace(/\{\{icsEventId\}\}/g,h.icsEventId||"")}return t}function yEe(r,e){return{...e,...r}}var gEe,qR=y(()=>{Wr();aD();K();gEe=N({tag:"Utils/TemplateProcessor"})});function ict(r,e){return r.replace(act,t=>M(e,nct[t]))}function sct(r){return r.replace(/\\/g,"/").split("/").some(e=>e==="."||e==="..")}function oct(r){let e=r.replace(/\\/g,"/"),t=e.endsWith("/"),n=[];for(let i of e.split("/"))if(!(!i||i===".")){if(i===".."){n.pop();continue}n.push(i)}let a=n.join("/");return t&&a?`${a}/`:a}function WR(r){return r.replace(/\.md$/i,"")}function lct(r){let e=r.trim();if(!e)return"";if(e.startsWith("[[")&&e.endsWith("]]")){let n=e.slice(2,-2).trim(),a=n.indexOf("|"),i=a!==-1?n.slice(0,a):n;return WR(i.trim())}let t=e.match(/^\[[^\]]*\]\(([^)]+)\)$/);if(t){let n=t[1].trim();n.startsWith("<")&&n.endsWith(">")&&(n=n.slice(1,-1).trim());try{n=decodeURIComponent(n)}catch(a){rct.debug("Failed to decode project path:",{category:"persistence",operation:"decode-project-path",details:{value:n},error:a})}return WR(n)}return WR(e)}function cct(r){return WR(r.trim()).replace(/\\/g,"/").split("/").filter(t=>t.length>0).map(t=>t.replace(/[<>:"|?*]/g,"_")).join("/")}function d4(r,e){let t=e?e(r):lct(r);return cct(t)}function vEe(r,e){let t=d4(r,e);return t?t.split("/").slice(0,-1).join("/"):""}function YR(r,e={}){if(!r)return r;let{date:t=new Date,taskData:n,icsData:a,extractProjectBasename:i,extractProjectFilePath:s}=e,o=r,l=sct(r);if(o=ict(o,t),n){let u=Array.isArray(n.contexts)&&n.contexts.length>0?n.contexts[0]:"";o=o.replace(/\{\{context\}\}/g,u);let p=Array.isArray(n.projects)&&n.projects.length>0?i?i(n.projects[0]):n.projects[0]:"";o=o.replace(/\{\{project\}\}/g,p);let m=Array.isArray(n.projects)&&n.projects.length>0?n.projects.map(B=>i?i(B):B).join("/"):"";o=o.replace(/\{\{projects\}\}/g,m);let f=Array.isArray(n.projects)&&n.projects.length>0?d4(n.projects[0],s):"";o=o.replace(/\{\{projectFilePath\}\}/g,f);let h=Array.isArray(n.projects)&&n.projects.length>0?n.projects.map(B=>d4(B,s)).filter(B=>B.length>0).join("/"):"";o=o.replace(/\{\{projectFilePaths\}\}/g,h);let g=Array.isArray(n.projects)&&n.projects.length>0?vEe(n.projects[0],s):"";o=o.replace(/\{\{projectFolder\}\}/g,g);let v=Array.isArray(n.projects)&&n.projects.length>0?n.projects.map(B=>vEe(B,s)).filter(B=>B.length>0).join("/"):"";o=o.replace(/\{\{projectFolders\}\}/g,v);let b=Array.isArray(n.contexts)&&n.contexts.length>0?n.contexts.join("/"):"";o=o.replace(/\{\{contexts\}\}/g,b);let k=n.priority||"";o=o.replace(/\{\{priority\}\}/g,k);let w=n.status||"";o=o.replace(/\{\{status\}\}/g,w);let S=n.title?n.title.replace(/[<>:"/\\|?*]/g,"_"):"";o=o.replace(/\{\{title\}\}/g,S);let C=n.due||"";o=o.replace(/\{\{dueDate\}\}/g,C);let E=n.scheduled||"";o=o.replace(/\{\{scheduledDate\}\}/g,E);let D=k?k.substring(0,1).toUpperCase():"";o=o.replace(/\{\{priorityShort\}\}/g,D);let P=w?w.substring(0,1).toUpperCase():"";o=o.replace(/\{\{statusShort\}\}/g,P);let O=S?S.toLowerCase():"";o=o.replace(/\{\{titleLower\}\}/g,O);let z=S?S.toUpperCase():"";o=o.replace(/\{\{titleUpper\}\}/g,z);let R=S?S.toLowerCase().replace(/\s+/g,"_"):"";o=o.replace(/\{\{titleSnake\}\}/g,R);let A=S?S.toLowerCase().replace(/\s+/g,"-"):"";o=o.replace(/\{\{titleKebab\}\}/g,A);let F=S?S.replace(/(?:^\w|[A-Z]|\b\w)/g,(B,ue)=>ue===0?B.toLowerCase():B.toUpperCase()).replace(/\s+/g,""):"";o=o.replace(/\{\{titleCamel\}\}/g,F);let $=S?S.replace(/(?:^\w|[A-Z]|\b\w)/g,B=>B.toUpperCase()).replace(/\s+/g,""):"";o=o.replace(/\{\{titlePascal\}\}/g,$)}if(a){let u=a.title?a.title.replace(/[<>:"/\\|?*]/g,"_"):"";o=o.replace(/\{\{icsEventTitle\}\}/g,u);let p=u?u.toLowerCase():"";o=o.replace(/\{\{icsEventTitleLower\}\}/g,p);let m=u?u.toUpperCase():"";o=o.replace(/\{\{icsEventTitleUpper\}\}/g,m);let f=u?u.toLowerCase().replace(/\s+/g,"_"):"";o=o.replace(/\{\{icsEventTitleSnake\}\}/g,f);let h=u?u.toLowerCase().replace(/\s+/g,"-"):"";o=o.replace(/\{\{icsEventTitleKebab\}\}/g,h);let g=u?u.replace(/(?:^\w|[A-Z]|\b\w)/g,(w,S)=>S===0?w.toLowerCase():w.toUpperCase()).replace(/\s+/g,""):"";o=o.replace(/\{\{icsEventTitleCamel\}\}/g,g);let v=u?u.replace(/(?:^\w|[A-Z]|\b\w)/g,w=>w.toUpperCase()).replace(/\s+/g,""):"";o=o.replace(/\{\{icsEventTitlePascal\}\}/g,v);let b=a.location?a.location.replace(/[<>:"/\\|?*]/g,"_"):"";o=o.replace(/\{\{icsEventLocation\}\}/g,b);let k=a.description?a.description.replace(/[<>:"/\\|?*]/g,"_"):"";o=o.replace(/\{\{icsEventDescription\}\}/g,k)}o=o.replace(/\{\{year\}\}/g,M(t,"yyyy")),o=o.replace(/\{\{month\}\}/g,M(t,"MM")),o=o.replace(/\{\{day\}\}/g,M(t,"dd")),o=o.replace(/\{\{date\}\}/g,M(t,"yyyy-MM-dd")),o=o.replace(/\{\{time\}\}/g,M(t,"HHmmss")),o=o.replace(/\{\{timestamp\}\}/g,M(t,"yyyy-MM-dd-HHmmss")),o=o.replace(/\{\{dateTime\}\}/g,M(t,"yyyy-MM-dd-HHmm")),o=o.replace(/\{\{hour\}\}/g,M(t,"HH")),o=o.replace(/\{\{minute\}\}/g,M(t,"mm")),o=o.replace(/\{\{second\}\}/g,M(t,"ss")),o=o.replace(/\{\{shortDate\}\}/g,M(t,"yyMMdd")),o=o.replace(/\{\{shortYear\}\}/g,M(t,"yy")),o=o.replace(/\{\{monthName\}\}/g,M(t,"MMMM")),o=o.replace(/\{\{monthNameShort\}\}/g,M(t,"MMM")),o=o.replace(/\{\{dayName\}\}/g,M(t,"EEEE")),o=o.replace(/\{\{dayNameShort\}\}/g,M(t,"EEE")),o=o.replace(/\{\{week\}\}/g,M(t,"ww")),o=o.replace(/\{\{quarter\}\}/g,M(t,"q")),o=o.replace(/\{\{time12\}\}/g,M(t,"hh:mm a")),o=o.replace(/\{\{time24\}\}/g,M(t,"HH:mm")),o=o.replace(/\{\{hourPadded\}\}/g,M(t,"HH")),o=o.replace(/\{\{hour12\}\}/g,M(t,"hh")),o=o.replace(/\{\{ampm\}\}/g,M(t,"a")),o=o.replace(/\{\{unix\}\}/g,Math.floor(t.getTime()/1e3).toString()),o=o.replace(/\{\{unixMs\}\}/g,t.getTime().toString()),o=o.replace(/\{\{milliseconds\}\}/g,M(t,"SSS")),o=o.replace(/\{\{ms\}\}/g,M(t,"SSS")),o=o.replace(/\{\{timezone\}\}/g,M(t,"xxx")),o=o.replace(/\{\{timezoneShort\}\}/g,M(t,"xx")),o=o.replace(/\{\{utcOffset\}\}/g,M(t,"xxx")),o=o.replace(/\{\{utcOffsetShort\}\}/g,M(t,"xx")),o=o.replace(/\{\{utcZ\}\}/g,"Z");let c=(()=>{let u=M(t,"yyMMdd"),p=new Date(t);p.setHours(0,0,0,0);let f=Math.floor((t.getTime()-p.getTime())/1e3).toString(36);return`${u}${f}`})();o=o.replace(/\{\{zettel\}\}/g,c);let d=Date.now().toString()+Math.random().toString(36).substring(2,7);return o=o.replace(/\{\{nano\}\}/g,d),l?oct(o):o}var rct,nct,act,u4=y(()=>{Wr();K();rct=N({tag:"Utils/FolderTemplateProcessor"}),nct={YYYY:"yyyy",YY:"yy",MMMM:"MMMM",MMM:"MMM",MM:"MM",DD:"dd",dddd:"EEEE",ddd:"EEE"},act=/YYYY|MMMM|dddd|MMM|ddd|YY|MM|DD/g});var kEe,GR,KR,bEe=y(()=>{kEe=require("obsidian");Yr();Ah();Kk();Ct();Me();kr();qR();Dv();K();GR=N({tag:"Services/TaskService/TaskCreationService"}),KR=class{constructor(e){this.deps=e}setWebhookNotifier(e){this.deps.webhookNotifier=e}async createTask(e,t={}){var s,o,l;let{applyDefaults:n=!0,applyTemplate:a=!0}=t,{runtime:i}=this.deps;try{if(n&&(e=await this.deps.applyTaskCreationDefaults(e)),!e.title||!e.title.trim())throw new Error("Title is required");let c=e.title.trim(),d=this.deps.sanitizeTitleForStorage(c),u=i.settings.storeTitleInFilename?this.deps.sanitizeTitleForFilename(c):d,p=e.priority||i.settings.defaultTaskPriority,m=e.status||i.settings.defaultTaskStatus,f=e.dateCreated||Ge(),h=e.dateModified||Ge(),g=e.recurrence||void 0,v=g?void 0:e.completedDate||((s=i.statusManager)!=null&&s.isCompletedStatus(m)?Il():void 0),b=e.contexts||[],k=e.projects||[],w=xc(e.tags||[]);if(i.settings.taskIdentificationMethod==="tag"){let fe=(o=xc(i.settings.taskTag)[0])!=null?o:i.settings.taskTag;fe&&!w.includes(fe)&&(w=[fe,...w])}let S={title:u,priority:p,status:m,date:new Date,dueDate:e.due,scheduledDate:e.scheduled,contexts:b,projects:k,tags:w,timeEstimate:e.timeEstimate,details:e.details,parentNote:e.parentNote},C=(l=e.occurrenceFilenameTemplate)==null?void 0:l.trim(),E=C&&e.occurrence_date?BSe(S,C,e.occurrence_date):zSe(S,i.settings),D=await this.resolveTargetFolder(e);D&&await tm(i.app.vault,D);let P=await Gk(E,D,i.app.vault),O=D?`${D}/${P}.md`:`${P}.md`,z=C&&e.occurrence_date?E:u,R=i.settings.storeTitleInFilename&&P===z&&d===u,A={title:d,status:m,priority:p,due:e.due||void 0,scheduled:e.scheduled||void 0,contexts:b.length>0?b:void 0,projects:k.length>0?k:void 0,timeEstimate:e.timeEstimate&&e.timeEstimate>0?e.timeEstimate:void 0,dateCreated:f,dateModified:h,recurrence:g,completedDate:v,recurrence_anchor:e.recurrence_anchor||void 0,recurrence_parent:e.recurrence_parent||void 0,occurrence_date:e.occurrence_date||void 0,occurrence_materialization:e.occurrence_materialization||void 0,occurrence_next_trigger:e.occurrence_next_trigger||void 0,occurrence_template:e.occurrence_template||void 0,occurrence_past_horizon:e.occurrence_past_horizon||void 0,occurrence_future_horizon:e.occurrence_future_horizon||void 0,reminders:e.reminders&&e.reminders.length>0?e.reminders:void 0,customProperties:e.customProperties||void 0,icsEventId:e.icsEventId||void 0,blockedBy:e.blockedBy&&e.blockedBy.length>0?e.blockedBy:void 0},F=i.fieldMapper.getUserFields();if(F.length>0){let fe=e,ut=A;for(let Je of F)Object.prototype.hasOwnProperty.call(fe,Je.key)&&fe[Je.key]!==void 0&&(ut[Je.key]=fe[Je.key])}if(A.recurrence&&typeof A.recurrence=="string"&&!A.recurrence.includes("DTSTART:")){let fe={...A,title:d,status:m,priority:p,path:"",archived:!1},ut=Mh(fe);ut&&(A.recurrence=ut)}let B=i.settings.taskIdentificationMethod==="tag"?i.settings.taskTag:void 0,ue=i.fieldMapper.mapToFrontmatter(A,B,R);if(i.settings.taskIdentificationMethod==="property"){let fe=i.settings.taskPropertyName,ut=i.settings.taskPropertyValue;fe&&ut&&Ev(ue,fe,ut),w.length>0&&(ue.tags=w)}else ue.tags=w;let Q=a?await this.deps.applyTemplate(e):{frontmatter:{},body:""},G=Q.body?Q.body.replace(/\r\n/g,` `).trimEnd():e.details?e.details.replace(/\r\n/g,` `).trimEnd():"",ie=yEe(ue,Q.frontmatter);e.customFrontmatter&&(ie={...ie,...e.customFrontmatter}),R&&delete ie[i.fieldMapper.toUserField("title")],i.settings.taskIdentificationMethod==="property"&&Ev(ie,i.settings.taskPropertyName,i.settings.taskPropertyValue),w=xc(ie.tags);let ee=`--- ${(0,kEe.stringifyYaml)(ie)}--- `;G.length>0&&(ee+=`${G} `);let re=await i.app.vault.create(O,ee),et={...A,...ie,title:J(ie.title||A.title||d),status:J(ie.status||A.status||m),priority:J(ie.priority||A.priority||p),path:re.path,tags:w,archived:!1,details:G};try{i.cacheManager.waitForFreshTaskData&&await i.cacheManager.waitForFreshTaskData(re),i.cacheManager.updateTaskInfoInCache(re.path,et)}catch(fe){GR.error("Error updating cache for new task:",{category:"stale-data",operation:"updating-cache-new-task",error:fe})}if(i.emitter.trigger(ot,{path:re.path,updatedTask:et}),this.deps.webhookNotifier)try{await this.deps.webhookNotifier.triggerWebhook("task.created",{task:et})}catch(fe){GR.warn("Failed to trigger webhook for task creation:",{category:"provider",operation:"trigger-webhook-task-creation",error:fe})}return i.taskCalendarSyncService&&i.settings.googleCalendarExport.enabled&&i.settings.googleCalendarExport.syncOnTaskCreate&&i.taskCalendarSyncService.syncTaskToCalendar(et).catch(fe=>{GR.warn("Failed to sync task to Google Calendar:",{category:"provider",operation:"sync-task-google-calendar",error:fe})}),{file:re,taskInfo:et}}catch(c){let d=c instanceof Error?c.message:String(c);throw GR.error("Error creating task:",{category:"persistence",operation:"creating-task",details:{stack:c instanceof Error?c.stack:void 0,taskData:e},error:d}),new Error(`Failed to create task: ${d}`)}}resolveCurrentNoteFolderVariables(e){var n;if(!e.includes("{{currentNotePath}}")&&!e.includes("{{currentNoteTitle}}"))return e;let t=this.deps.runtime.app.workspace.getActiveFile();return e.replace(/\{\{currentNotePath\}\}/g,((n=t==null?void 0:t.parent)==null?void 0:n.path)||"").replace(/\{\{currentNoteTitle\}\}/g,(t==null?void 0:t.basename)||"")}async resolveTargetFolder(e){let{runtime:t}=this.deps,n="";if(e.creationContext==="inline-conversion"||e.creationContext==="modal-inline-creation"){let i=t.settings.inlineTaskConvertFolder||"";if(i.trim())return n=this.resolveCurrentNoteFolderVariables(i),this.deps.processFolderTemplate(n,e);let s=this.resolveCurrentNoteFolderVariables(t.settings.tasksFolder||"");return this.deps.processFolderTemplate(s,e)}let a=this.resolveCurrentNoteFolderVariables(t.settings.tasksFolder||"");return this.deps.processFolderTemplate(a,e)}}});function TEe(r){return Array.isArray(r.timeEntries)?{...r,timeEntries:r.timeEntries.map(dct)}:{...r}}function dct(r){let e={...r};return delete e.duration,e}function wEe(r){return Object.prototype.hasOwnProperty.call(r,"details")?typeof r.details=="string"?r.details.replace(/\r\n/g,` `):"":null}function SEe({originalTask:r,updates:e,maintainDueDateOffsetInRecurring:t,updateToNextScheduledOccurrenceFn:n=wu,addDTSTARTToRecurrenceRuleFn:a=Mh}){let i={};if(e.recurrence!==void 0&&e.recurrence!==r.recurrence){let o={...r,...e},l=n(o,t);if(l.scheduled&&(i.scheduled=l.scheduled),l.due&&(i.due=l.due),typeof e.recurrence=="string"&&e.recurrence&&!e.recurrence.includes("DTSTART:")){let c={...r,...e,...i},d=a(c);d&&(i.recurrence=d)}}else if(e.recurrence!==void 0&&!r.recurrence&&e.recurrence&&typeof e.recurrence=="string"&&!e.recurrence.includes("DTSTART:")){let o={...r,...e},l=a(o);l&&(i.recurrence=l)}if(e.scheduled!==void 0&&e.scheduled!==r.scheduled&&r.recurrence&&typeof r.recurrence=="string"&&!r.recurrence.includes("DTSTART:")){let o={...r,...e},l=a(o);l&&(i.recurrence=l)}if(Object.prototype.hasOwnProperty.call(e,"scheduled")){let o={...r,...e,...i};nN(r,e.scheduled,o),i.googleCalendarExceptionOriginalScheduled=o.googleCalendarExceptionOriginalScheduled}let s={...r,...e,...i};return lg(s),i.googleCalendarExceptionOriginalScheduled=s.googleCalendarExceptionOriginalScheduled,i.googleCalendarMovedOriginalDates=s.googleCalendarMovedOriginalDates,i}function xEe({frontmatter:r,originalTask:e,updates:t,recurrenceUpdates:n,dateModified:a,fieldMapper:i,taskIdentification:s,storeTitleInFilename:o,updateCompletedDateInFrontmatter:l}){let c={...e,...t,...n,dateModified:a},d=i.mapToFrontmatter(c,s.method==="tag"?s.tag:void 0,o);if(uct(r,t,d,i),Object.entries(d).forEach(([u,p])=>{p!==void 0&&(r[u]=p)}),t.status!==void 0&&l(r,t.status,!!e.recurrence),s.method==="property"&&pct(r,s),t.customFrontmatter&&Object.entries(t.customFrontmatter).forEach(([u,p])=>{p===null?delete r[u]:r[u]=p}),mct(r,{...t,...n},i),o&&delete r[i.toUserField("title")],Object.prototype.hasOwnProperty.call(t,"tags")){let u=xc(t.tags);u.length>0?r.tags=u:delete r.tags}return s.method==="property"&&Ev(r,s.propertyName,s.propertyValue),{finalTags:xc(r.tags)}}function uct(r,e,t,n){if(Object.prototype.hasOwnProperty.call(e,"title"))return;let a=n.toUserField("title");Object.prototype.hasOwnProperty.call(r,a)&&delete t[a]}function pct(r,e){e.propertyName&&e.propertyValue&&Ev(r,e.propertyName,e.propertyValue)}function mct(r,e,t){if(Object.prototype.hasOwnProperty.call(e,"due")&&e.due===void 0&&delete r[t.toUserField("due")],Object.prototype.hasOwnProperty.call(e,"scheduled")&&e.scheduled===void 0&&delete r[t.toUserField("scheduled")],Object.prototype.hasOwnProperty.call(e,"contexts")&&(!Array.isArray(e.contexts)||e.contexts.length===0)&&delete r[t.toUserField("contexts")],Object.prototype.hasOwnProperty.call(e,"projects")){let n=t.toUserField("projects"),a=Array.isArray(e.projects)?e.projects:[];a.length>0?r[n]=a:delete r[n]}Object.prototype.hasOwnProperty.call(e,"timeEstimate")&&e.timeEstimate===void 0&&delete r[t.toUserField("timeEstimate")],Object.prototype.hasOwnProperty.call(e,"completedDate")&&e.completedDate===void 0&&delete r[t.toUserField("completedDate")],Object.prototype.hasOwnProperty.call(e,"recurrence")&&e.recurrence===void 0&&delete r[t.toUserField("recurrence")],Object.prototype.hasOwnProperty.call(e,"googleCalendarExceptionOriginalScheduled")&&e.googleCalendarExceptionOriginalScheduled===void 0&&delete r[t.toUserField("googleCalendarExceptionOriginalScheduled")],Object.prototype.hasOwnProperty.call(e,"googleCalendarMovedOriginalDates")&&(!Array.isArray(e.googleCalendarMovedOriginalDates)||e.googleCalendarMovedOriginalDates.length===0)&&delete r[t.toUserField("googleCalendarMovedOriginalDates")],Object.prototype.hasOwnProperty.call(e,"blockedBy")&&(!Array.isArray(e.blockedBy)||e.blockedBy.length===0)&&delete r[t.toUserField("blockedBy")],Object.prototype.hasOwnProperty.call(e,"reminders")&&(!Array.isArray(e.reminders)||e.reminders.length===0)&&delete r[t.toUserField("reminders")]}function CEe({originalTask:r,updates:e,recurrenceUpdates:t,newPath:n,dateModified:a,currentDateString:i,normalizedDetails:s,finalTags:o,isCompletedStatus:l}){let c={...r,...e,...t,path:n,dateModified:a};return o&&(c.tags=o),s!==null&&(c.details=s),e.status!==void 0&&!r.recurrence&&(l(e.status)?r.completedDate||(c.completedDate=i):c.completedDate=void 0),c}var EEe=y(()=>{Ah();aN();Dv()});var ZR,Cb,QR,DEe=y(()=>{ZR=require("obsidian");Yr();Ct();Kk();Me();EEe();K();Ba();Cb=N({tag:"Services/TaskService/TaskUpdateService"}),QR=class{constructor(e){this.deps=e}setWebhookNotifier(e){this.deps.webhookNotifier=e}setAutoArchiveService(e){this.deps.autoArchiveService=e}async updateTask(e,t){var a;let{runtime:n}=this.deps;try{let i=TEe(t),s=n.app.vault.getAbstractFileByPath(e.path);if(!(s instanceof ZR.TFile))throw new Error(`Cannot find task file: ${e.path}`);let o=n.settings.storeTitleInFilename&&i.title&&i.title!==e.title,l=e.path;if(o&&i.title){let h=s.parent?s.parent.path:"",g=await Gk(i.title,h,n.app.vault);l=h?`${h}/${g}.md`:`${g}.md`}let c=SEe({originalTask:e,updates:i,maintainDueDateOffsetInRecurring:n.settings.maintainDueDateOffsetInRecurring}),d=wEe(i),u,p=Ge(),m=i.status!==void 0&&!e.recurrence?Il():"";if(await Fr(n.app,s,h=>{u=xEe({frontmatter:h,originalTask:e,updates:i,recurrenceUpdates:c,dateModified:p,fieldMapper:n.fieldMapper,taskIdentification:{method:n.settings.taskIdentificationMethod,tag:n.settings.taskTag,propertyName:n.settings.taskPropertyName,propertyValue:n.settings.taskPropertyValue},storeTitleInFilename:n.settings.storeTitleInFilename,updateCompletedDateInFrontmatter:(v,b,k)=>this.deps.updateCompletedDateInFrontmatter(v,b,k)}).finalTags}),o&&await n.app.fileManager.renameFile(s,l),d!==null){let h=n.app.vault.getAbstractFileByPath(l);h instanceof ZR.TFile&&await NS(n.app,h,g=>{let{frontmatter:v}=rm(g),b=v!==null?`--- ${v} --- `:"",k=d.trimEnd(),w=k.length>0?`${k} `:"";return`${b}${w}`})}let f=CEe({originalTask:e,updates:i,recurrenceUpdates:c,newPath:l,dateModified:p,currentDateString:m,normalizedDetails:d,finalTags:u,isCompletedStatus:h=>n.statusManager.isCompletedStatus(h)});o&&(n.cacheManager.clearCacheEntry(e.path),n.expandedProjectsService.renamePath(e.path,l),n.projectSubtasksService.invalidateIndex());try{let h=n.app.vault.getAbstractFileByPath(l);if(h instanceof ZR.TFile&&n.cacheManager.waitForFreshTaskData){let g={};i.title!==void 0&&(g.title=i.title),i.status!==void 0&&(g.status=i.status),i.priority!==void 0&&(g.priority=i.priority),Object.keys(g).length>0&&await n.cacheManager.waitForFreshTaskData(h)}n.cacheManager.updateTaskInfoInCache(l,f)}catch(h){Cb.error("Error updating task cache:",{category:"stale-data",operation:"updating-task-cache",details:{taskPath:l},error:h instanceof Error?h.message:String(h)})}try{n.emitter.trigger(ot,{path:l,originalTask:e,updatedTask:f})}catch(h){Cb.error("Error emitting task update event:",{category:"validation",operation:"emitting-task-update-event",details:{taskPath:l},error:h instanceof Error?h.message:String(h)})}if(this.deps.webhookNotifier)try{let h=n.statusManager.isCompletedStatus(e.status),g=n.statusManager.isCompletedStatus(f.status);!h&&g?await this.deps.webhookNotifier.triggerWebhook("task.completed",{task:f}):await this.deps.webhookNotifier.triggerWebhook("task.updated",{task:f,previous:e})}catch(h){Cb.warn("Failed to trigger webhook for task update:",{category:"provider",operation:"trigger-webhook-task-update",error:h})}if((a=n.taskCalendarSyncService)!=null&&a.isEnabled()){let h=n.statusManager.isCompletedStatus(e.status),g=n.statusManager.isCompletedStatus(f.status);(!h&&g?n.taskCalendarSyncService.completeTaskInCalendar(f):n.taskCalendarSyncService.updateTaskInCalendar(f,e)).catch(b=>{Cb.warn("Failed to sync task update to Google Calendar:",{category:"provider",operation:"sync-task-update-google-calendar",error:b})})}return await this.handleAutoArchive(e,f,i.status),f}catch(i){let s=i instanceof Error?i.message:String(i);throw Cb.error("Error updating task:",{category:"validation",operation:"updating-task",details:{stack:i instanceof Error?i.stack:void 0,taskPath:e.path,updates:t},error:s}),new Error(`Failed to update task: ${s}`)}}async handleAutoArchive(e,t,n){if(!(!this.deps.autoArchiveService||n===void 0||n===e.status))try{let a=this.deps.runtime.statusManager.getStatusConfig(t.status);if(!a)return;a.autoArchive?await this.deps.autoArchiveService.scheduleAutoArchive(t,a):await this.deps.autoArchiveService.cancelAutoArchive(t.path)}catch(a){Cb.warn("Failed to handle auto-archive for status change:",{category:"validation",operation:"handle-auto-archive-status-change",error:a})}}}});function PEe(r,e,t={}){var l,c,d,u;let n=e.taskCreationDefaults,a=(l=t.calculateDefaultDate)!=null?l:OS,i=(c=t.calculateDefaultDateTime)!=null?c:Ac,s=(d=t.convertDefaultRemindersToReminders)!=null?d:EE,o={...r,customFrontmatter:r.customFrontmatter?{...r.customFrontmatter}:void 0};return o.due===void 0&&n.defaultDueDate!=="none"&&(o.due=i(n.defaultDueDate,n.defaultDueTime)),o.scheduled===void 0&&n.defaultScheduledDate!=="none"&&(o.scheduled=i(n.defaultScheduledDate,n.defaultScheduledTime)),!o.contexts&&n.defaultContexts&&(o.contexts=p4(n.defaultContexts)),!o.projects&&n.defaultProjects&&(o.projects=p4(n.defaultProjects)),!o.tags&&n.defaultTags&&(o.tags=p4(n.defaultTags)),!o.timeEstimate&&n.defaultTimeEstimate>0&&(o.timeEstimate=n.defaultTimeEstimate),!o.recurrence&&n.defaultRecurrence!=="none"&&(o.recurrence=fct[n.defaultRecurrence]),!o.reminders&&n.defaultReminders&&n.defaultReminders.length>0&&(o.reminders=s(n.defaultReminders)),hct(o,(u=e.userFields)!=null?u:[],a),o}function p4(r){return r.split(",").map(e=>e.trim()).filter(e=>e.length>0)}function hct(r,e,t){if(e.length!==0){r.customFrontmatter||(r.customFrontmatter={});for(let n of e){let a=gct(n);if(a!==void 0&&r.customFrontmatter[n.key]===void 0)if(n.type==="date"&&typeof a=="string"){let i=t(a);i&&(r.customFrontmatter[n.key]=i)}else r.customFrontmatter[n.key]=a}}}function gct(r){if(r.defaultValue!==void 0)return r.defaultValue;if(r.type==="boolean")return!1}var fct,MEe=y(()=>{Ct();IN();fct={none:void 0,daily:"FREQ=DAILY",weekly:"FREQ=WEEKLY",monthly:"FREQ=MONTHLY",yearly:"FREQ=YEARLY"}});function _Ee(r){return r.replace(/./g,e=>{let t=e.charCodeAt(0);return t<=31||t>=127&&t<=159?"":e})}function IEe(r){return r.trim().replace(/\s+/g," ")}function NEe(r){return r.length>0?r:sD}function REe(r){if(!r||typeof r!="string")return sD;try{let e=_Ee(IEe(r)).replace(/[<>:"/\\|?*#[\]]/g,"").replace(/^\.+|\.+$/g,"").trim();return NEe(e)}catch(e){return AEe.error("Error sanitizing title:",{category:"validation",operation:"sanitizing-title",error:e}),sD}}function FEe(r){if(!r||typeof r!="string")return sD;try{return NEe(_Ee(IEe(r)).trim())}catch(e){return AEe.error("Error sanitizing title:",{category:"validation",operation:"sanitizing-title",error:e}),sD}}var AEe,sD,OEe=y(()=>{K();AEe=N({tag:"Services/TaskService/TaskTitleSanitizer"}),sD="untitled"});function m4(r,e,t,n){return e!=="status"?null:{wasCompleted:r.statusManager.isCompletedStatus(r.normalizeStatusValue(t)),isCompleted:r.statusManager.isCompletedStatus(r.normalizeStatusValue(n))}}async function yct(r,e){try{r.cacheManager.waitForFreshTaskData&&await r.cacheManager.waitForFreshTaskData(e.file),r.cacheManager.updateTaskInfoInCache(e.originalTask.path,e.updatedTask)}catch(t){Eb.error("Error updating task cache:",{category:"stale-data",operation:"updating-task-cache",details:{taskPath:e.originalTask.path},error:t instanceof Error?t.message:String(t)})}}async function vct(r,e){try{r.emitter.trigger(ot,{path:e.originalTask.path,originalTask:e.originalTask,updatedTask:e.updatedTask});let t=m4(r,e.property,e.oldValue,e.newValue);if(!t||t.wasCompleted===t.isCompleted)return;let n=r.cacheManager.getBlockedTaskPaths(e.originalTask.path);for(let a of n)try{let i=await r.cacheManager.getTaskInfo(a);i&&r.emitter.trigger(ot,{path:a,originalTask:i,updatedTask:i})}catch(i){Eb.error(`Error triggering update for dependent task ${a}:`,{category:"validation",operation:"triggering-update-dependent-task",error:i})}}catch(t){Eb.error("Error emitting task update event:",{category:"validation",operation:"emitting-task-update-event",details:{taskPath:e.originalTask.path},error:t instanceof Error?t.message:String(t)})}}async function kct(r,e){if(r.webhookNotifier)try{let t=m4(r,e.property,e.oldValue,e.newValue);if(t&&!t.wasCompleted&&t.isCompleted){await r.webhookNotifier.triggerWebhook("task.completed",{task:e.updatedTask});return}await r.webhookNotifier.triggerWebhook("task.updated",{task:e.updatedTask,previous:e.originalTask})}catch(t){Eb.warn("Failed to trigger webhook for property update:",{category:"provider",operation:"trigger-webhook-property-update",error:t})}}function bct(r,e){var a;if(!((a=r.taskCalendarSyncService)!=null&&a.isEnabled()))return;let t=m4(r,e.property,e.oldValue,e.newValue);(t&&!t.wasCompleted&&t.isCompleted?r.taskCalendarSyncService.completeTaskInCalendar(e.updatedTask):r.taskCalendarSyncService.updateTaskInCalendar(e.updatedTask,e.originalTask)).catch(i=>{Eb.warn("Failed to sync task update to Google Calendar:",{category:"provider",operation:"sync-task-update-google-calendar",error:i})})}async function Tct(r,e){if(!(!r.autoArchiveService||e.property!=="status"||e.newValue===e.oldValue))try{let t=r.statusManager.getStatusConfig(e.newValue);if(!t)return;t.autoArchive?await r.autoArchiveService.scheduleAutoArchive(e.updatedTask,t):await r.autoArchiveService.cancelAutoArchive(e.updatedTask.path)}catch(t){Eb.warn("Failed to handle auto-archive for status property change:",{category:"persistence",operation:"handle-auto-archive-status-property-change",error:t})}}async function LEe(r,e){await yct(r,e),await vct(r,e),await kct(r,e),bct(r,e),await Tct(r,e)}var Eb,zEe=y(()=>{Yr();K();Eb=N({tag:"Services/TaskService/TaskPropertyChangeSideEffects"})});function Sct(r,e){return typeof r=="string"&&Object.prototype.hasOwnProperty.call(e,r)}function Sg(r,e="frontmatter field"){if(typeof r!="string")throw new Error(`${e} resolved to a non-string frontmatter field name`);if(r.trim().length===0)throw new Error(`${e} resolved to an invalid frontmatter field name: ${r}`);return r}function jEe(r,e){let t=r.getMapping();if(Sct(e,t))return Sg(r.toUserField(e),`field mapping for ${String(e)}`);let n=wct[e];return n?Sg(r.toUserField(n),`field mapping for ${String(e)}`):Sg(String(e),`task property ${String(e)}`)}var wct,f4=y(()=>{wct={recurrence_anchor:"recurrenceAnchor",complete_instances:"completeInstances",skipped_instances:"skippedInstances",recurrence_parent:"recurrenceParent",occurrence_date:"occurrenceDate",occurrence_materialization:"occurrenceMaterialization",occurrence_next_trigger:"occurrenceNextTrigger",occurrence_template:"occurrenceTemplate",occurrence_past_horizon:"occurrencePastHorizon",occurrence_future_horizon:"occurrenceFutureHorizon"}});function xct(r,e,t){return r==="status"?t(e):r==="blockedBy"?Cct(e):e}function Cct(r){if(r==null)return;let t=(Array.isArray(r)?r:[r]).map(n=>os(n)).filter(n=>!!n);return t.length>0?t:void 0}function $Ee({freshTask:r,property:e,value:t,currentTimestamp:n,currentDateString:a,normalizeStatusValue:i,isCompletedStatus:s}){let o=xct(e,t,i),l={...r};if(l[e]=o,l.dateModified=n,e==="status"&&!r.recurrence){let c=i(o);s(c)?l.completedDate=a:l.completedDate=void 0}return{updatedTask:l,normalizedValue:o,dateModified:n}}function Ect(r){let e=r.toLowerCase();return e==="true"||e==="false"?e==="true":r}function h4(r,e,t,n,a,i){if(!t){if(a(e)){r[n]=i;return}r[n]&&delete r[n]}}function BEe({frontmatter:r,property:e,fieldName:t,rawValue:n,normalizedValue:a,dateModified:i,dateModifiedField:s,completedDateField:o,isRecurring:l,normalizeStatusValue:c,isCompletedStatus:d,currentDateString:u}){let p=Sg(t,`task property ${String(e)}`),m=Sg(s,"dateModified field mapping"),f=Sg(o,"completedDate field mapping");if(e==="status"){let h=c(a);r[p]=Ect(h),h4(r,h,l,f,d,u)}else if((e==="due"||e==="scheduled")&&!n)delete r[p];else if(e==="blockedBy"){let h=Array.isArray(a)?a:[];h.length>0?r[p]=Afe(h):delete r[p]}else r[p]=a;r[m]=i}var UEe=y(()=>{Io();f4()});function HEe(r,e,t){let n=!!r.archived,a={...r};a.archived=!n,a.dateModified=t;let i=Array.isArray(a.tags)?a.tags:[];return n?a.tags=i.filter(s=>s!==e):i.includes(e)?a.tags=[...i]:a.tags=[...i,e],{updatedTask:a,isCurrentlyArchived:n,operation:n?"unarchiving":"archiving",dateModified:t}}function VEe({frontmatter:r,archiveTag:e,isCurrentlyArchived:t,dateModified:n,dateModifiedField:a}){if(t){let i=r.tags;if(Array.isArray(i)){let s=i.filter(o=>o!==e);s.length===0?delete r.tags:r.tags=s}}else r.tags?Array.isArray(r.tags)||(r.tags=[r.tags]):r.tags=[],r.tags.includes(e)||r.tags.push(e);r[a]=n}function qEe({isCurrentlyArchived:r,moveArchivedTasks:e,archiveFolderTemplate:t,tasksFolderTemplate:n,fileName:a,taskData:i,processFolderTemplate:s}){if(!e)return null;let o=r?n==null?void 0:n.trim():t==null?void 0:t.trim();if(!o)return null;let l=r?"tasks":"archive",c=s(o,{title:i.title||"",priority:i.priority,status:i.status,contexts:i.contexts,projects:i.projects});return{operation:r?"unarchiving":"archiving",destinationKind:l,destinationFolder:c,newPath:`${c}/${a}`}}var WEe=y(()=>{});function JR(r){let e={...r};return delete e.duration,e}function XR(r){return Array.isArray(r)?r.map(JR):[]}function g4(r,e,t=e,n="Work session"){let a={startTime:t,description:n};return{updatedTask:{...r,dateModified:e,timeEntries:[...XR(r.timeEntries),a]},newEntry:a,dateModified:e}}function y4(r,e,t,n=t){let a={...r,dateModified:t},i=XR(r.timeEntries),s=i.findIndex(o=>o.startTime===e.startTime&&!o.endTime);return s!==-1&&(i[s]={...i[s],endTime:n},a.timeEntries=i),{updatedTask:a,stopTimestamp:n,dateModified:t}}function v4(r,e,t){if(!Array.isArray(r.timeEntries))throw new Error("Task has no time entries");if(e<0||e>=r.timeEntries.length)throw new Error("Invalid time entry index");return{updatedTask:{...r,dateModified:t,timeEntries:XR(r.timeEntries).filter((n,a)=>a!==e)},timeEntryIndex:e,dateModified:t}}var YEe=y(()=>{});function GEe({frontmatter:r,timeEntriesField:e,dateModifiedField:t,newEntry:n,dateModified:a}){r[e]||(r[e]=[]),Array.isArray(r[e])&&(r[e]=r[e].map(JR)),r[e].push(n),r[t]=a}function KEe({frontmatter:r,timeEntriesField:e,dateModifiedField:t,timeEntryIndex:n,dateModified:a}){r[e]&&Array.isArray(r[e])&&(r[e]=r[e].filter((i,s)=>s!==n)),r[t]=a}function ZEe({frontmatter:r,timeEntriesField:e,dateModifiedField:t,activeSession:n,stopTimestamp:a,dateModified:i}){if(r[e]&&Array.isArray(r[e])){let s=r[e].map(JR),o=s.findIndex(l=>l.startTime===n.startTime&&!l.endTime);o!==-1&&(s[o].endTime=a),r[e]=s}r[t]=i}var QEe=y(()=>{YEe()});function JEe(r,e){return{uniqueAdditions:Array.from(new Set(r)),uniqueRemovals:Array.from(new Set(e))}}function XEe({blockedTask:r,blockingTaskPath:e,action:t,rawEntry:n,useFrontmatterMarkdownLinks:a,resolveDependencyPath:i,formatDependencyLink:s}){var u;let o=Array.isArray(r.blockedBy)?r.blockedBy.map(p=>os(p)).filter(p=>!!p):[];if(o.length===0&&t==="remove")return null;let l=!1,c=!1,d=[];for(let p of o){if(i(r.path,p)===e&&(c=!0,t==="remove")){l=!0;continue}d.push(p)}if(t==="add"&&!c){let p=n?os(n):null,m={uid:s(r.path,e,a),reltype:(u=p==null?void 0:p.reltype)!=null?u:ss};p!=null&&p.gap&&(m.gap=p.gap),d.push(m),l=!0}return l?d:null}function k4(r){return r===null?null:{blockedBy:r.length>0?r:void 0}}var eDe=y(()=>{Io()});var Wn,lr,eF,tDe=y(()=>{Yr();pW();Wn=require("obsidian");qR();Ct();Io();qn();Me();Ah();u4();bEe();fs();DEe();MEe();OEe();zEe();UEe();WEe();QEe();lq();aN();eDe();f4();Ba();K();lr=N({tag:"Services/TaskService"}),eF=class{constructor(e){this.plugin=e;this.taskCreationService=new KR({runtime:this.plugin,webhookNotifier:this.webhookNotifier,applyTaskCreationDefaults:t=>Promise.resolve(PEe(t,this.plugin.settings)),applyTemplate:t=>this.applyTemplate(t),processFolderTemplate:(t,n,a)=>this.processFolderTemplate(t,n,a),sanitizeTitleForFilename:REe,sanitizeTitleForStorage:FEe}),this.taskUpdateService=new QR({runtime:this.plugin,webhookNotifier:this.webhookNotifier,autoArchiveService:this.autoArchiveService,updateCompletedDateInFrontmatter:(t,n,a)=>this.updateCompletedDateInFrontmatter(t,n,a)})}hasGoogleCalendarLinks(e){return!!(e.googleCalendarEventId||e.googleCalendarExceptionEventId)}createArchiveCalendarDeletionTask(e,t){return{...t,googleCalendarEventId:e.googleCalendarEventId,googleCalendarExceptionEventId:e.googleCalendarExceptionEventId,googleCalendarExceptionOriginalScheduled:e.googleCalendarExceptionOriginalScheduled,googleCalendarMovedOriginalDates:e.googleCalendarMovedOriginalDates?[...e.googleCalendarMovedOriginalDates]:void 0}}clearGoogleCalendarMetadata(e){e.googleCalendarEventId=void 0,e.googleCalendarExceptionEventId=void 0,e.googleCalendarExceptionOriginalScheduled=void 0,e.googleCalendarMovedOriginalDates=void 0}writeOptionalFrontmatterField(e,t,n){if(n==null||Array.isArray(n)&&n.length===0){delete e[t];return}e[t]=n}async deleteArchivedTaskFromCalendar(e){return!this.plugin.taskCalendarSyncService||await this.plugin.taskCalendarSyncService.deleteTaskFromCalendar(e)?!0:(lr.warn("Failed to delete archived task from Google Calendar during archive:",{category:"provider",operation:"delete-archived-task-google-calendar-archive",details:{taskPath:e.path,eventId:e.googleCalendarEventId}}),!1)}translate(e,t){return this.plugin.i18n.translate(e,t)}setWebhookNotifier(e){this.webhookNotifier=e,this.taskCreationService.setWebhookNotifier(e),this.taskUpdateService.setWebhookNotifier(e)}setAutoArchiveService(e){this.autoArchiveService=e,this.taskUpdateService.setAutoArchiveService(e)}normalizeStatusValue(e){return typeof e=="boolean"?e?"true":"false":typeof e=="string"?e:typeof e=="number"?String(e):""}getCompletionDateForTask(e){return Il()}processFolderTemplate(e,t,n=new Date){let a=t?{title:t.title,priority:t.priority,status:t.status,contexts:t.contexts,projects:t.projects,due:t.due,scheduled:t.scheduled}:void 0;return YR(e,{date:n,taskData:a,extractProjectBasename:i=>this.extractProjectBasename(i),extractProjectFilePath:i=>this.extractProjectFilePath(i)})}async createTask(e,t={}){return this.taskCreationService.createTask(e,t)}async applyTemplate(e){var n,a,i,s;let t=this.plugin.settings.taskCreationDefaults;if(!t.useBodyTemplate||!((n=t.bodyTemplate)!=null&&n.trim()))return{frontmatter:{},body:((a=e.details)==null?void 0:a.trim())||""};try{let o=(0,Wn.normalizePath)(t.bodyTemplate.trim());o.endsWith(".md")||(o+=".md");let l=this.plugin.app.vault.getAbstractFileByPath(o);if(l instanceof Wn.TFile){let c=await this.plugin.app.vault.read(l),d={title:e.title||"",priority:e.priority||"",status:e.status||"",contexts:Array.isArray(e.contexts)?e.contexts:[],tags:Array.isArray(e.tags)?e.tags:[],timeEstimate:e.timeEstimate||0,dueDate:e.due||"",scheduledDate:e.scheduled||"",details:e.details||"",parentNote:e.parentNote||""};return iD(c,d)}else return lr.warn(`Task body template not found: ${o}`,{category:"persistence",operation:"task-body-template-not-found"}),Te(this.plugin.emitter,this.translate("services.task.notices.templateNotFound",{path:o})),{frontmatter:{},body:((i=e.details)==null?void 0:i.trim())||""}}catch(o){return lr.error("Error reading task body template:",{category:"persistence",operation:"reading-task-body-template",error:o}),Te(this.plugin.emitter,this.translate("services.task.notices.templateReadError",{template:t.bodyTemplate})),{frontmatter:{},body:((s=e.details)==null?void 0:s.trim())||""}}}getOccurrenceTemplateReference(e){var a,i;let t=(a=e.occurrence_template)==null?void 0:a.trim();if(t)return t;let n=this.plugin.settings.taskCreationDefaults;return n.useOccurrenceBodyTemplate&&((i=n.occurrenceBodyTemplate)!=null&&i.trim())?n.occurrenceBodyTemplate.trim():null}resolveTemplateFile(e,t){var o,l,c,d,u,p,m,f;let n=Et(e).trim();if(!n)return null;let a=(f=(u=(l=(o=this.plugin.app.metadataCache).getFirstLinkpathDest)==null?void 0:l.call(o,n,t))!=null?u:(d=(c=this.plugin.app.metadataCache).getFirstLinkpathDest)==null?void 0:d.call(c,n.replace(/\.md$/i,""),t))!=null?f:(m=(p=this.plugin.app.metadataCache).getFirstLinkpathDest)==null?void 0:m.call(p,n,"");if(a instanceof Wn.TFile)return a;let i=(0,Wn.normalizePath)(n),s=/\.md$/i.test(i)?[i]:[`${i}.md`,i];for(let h of s){let g=this.plugin.app.vault.getAbstractFileByPath(h);if(g instanceof Wn.TFile)return g}return null}buildOccurrenceTemplateData(e,t){return{title:e.title||t.title||"",priority:e.priority||t.priority||"",status:e.status||"",contexts:Array.isArray(e.contexts)?e.contexts:[],tags:Array.isArray(e.tags)?e.tags:[],timeEstimate:e.timeEstimate||0,dueDate:e.due||"",scheduledDate:e.scheduled||"",details:e.details||"",parentNote:this.buildOccurrenceParentReference(t)}}extractTemplateCustomFrontmatter(e){let t=new Set(this.plugin.fieldMapper.getUserFields().map(a=>a.key)),n={};for(let[a,i]of Object.entries(e))a==="tags"||t.has(a)||this.plugin.fieldMapper.lookupMappingKey(a)||(n[a]=i);return Object.keys(n).length>0?n:void 0}buildOccurrenceTemplateTask(e){let t=this.plugin.fieldMapper.mapFromFrontmatter(e.frontmatter,"",!1),n=e.body.replace(/\r\n/g,` `).trimEnd(),a={...t};return n.trim().length>0&&(a.details=n),{templateTask:a,customFrontmatter:this.extractTemplateCustomFrontmatter(e.frontmatter)}}async resolveOccurrenceTemplate(e,t){let n=this.getOccurrenceTemplateReference(e);if(!n)return{configured:!1};let a=this.resolveTemplateFile(n,e.path);if(!a)return lr.warn(`Occurrence note template not found: ${n}`,{category:"persistence",operation:"occurrence-template-not-found"}),Te(this.plugin.emitter,this.translate("services.task.notices.occurrenceTemplateNotFound",{path:n})),{configured:!0};try{let i=await this.plugin.app.vault.read(a),s=iD(i,this.buildOccurrenceTemplateData(t,e));return{configured:!0,...this.buildOccurrenceTemplateTask(s)}}catch(i){return lr.error("Error reading occurrence note template:",{category:"persistence",operation:"reading-occurrence-template",error:i}),Te(this.plugin.emitter,this.translate("services.task.notices.occurrenceTemplateReadError",{template:n})),{configured:!0}}}async toggleStatus(e){try{let n=this.plugin.statusManager.isCompletedStatus(e.status)?this.plugin.settings.defaultTaskStatus:this.plugin.statusManager.getCompletedStatuses()[0]||"done";return await this.updateProperty(e,"status",n)}catch(t){let n=t instanceof Error?t.message:String(t);throw lr.error("Error toggling task status:",{category:"persistence",operation:"toggling-task-status",details:{stack:t instanceof Error?t.stack:void 0,taskPath:e.path,currentStatus:e.status},error:n}),new Error(`Failed to toggle task status: ${n}`)}}async updateProperty(e,t,n,a={}){try{let i=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(i instanceof Wn.TFile))throw new Error(`Cannot find task file: ${e.path}`);let s=await this.plugin.cacheManager.getTaskInfo(e.path)||e,o=$Ee({freshTask:s,property:t,value:n,currentTimestamp:Ge(),currentDateString:this.getCompletionDateForTask(s),normalizeStatusValue:l=>this.normalizeStatusValue(l),isCompletedStatus:l=>this.plugin.statusManager.isCompletedStatus(l)});return t==="scheduled"&&nN(s,o.normalizedValue,o.updatedTask),(t==="recurrence"||t==="recurrence_anchor")&&lg(o.updatedTask),await Fr(this.plugin.app,i,l=>{let c=jEe(this.plugin.fieldMapper,t),d=this.plugin.fieldMapper.toUserField("dateModified"),u=this.plugin.fieldMapper.toUserField("completedDate");BEe({frontmatter:l,property:t,fieldName:c,rawValue:n,normalizedValue:o.normalizedValue,dateModified:o.dateModified,dateModifiedField:d,completedDateField:u,isRecurring:!!s.recurrence,normalizeStatusValue:p=>this.normalizeStatusValue(p),isCompletedStatus:p=>this.plugin.statusManager.isCompletedStatus(p),currentDateString:this.getCompletionDateForTask(s)}),this.writeOptionalFrontmatterField(l,this.plugin.fieldMapper.toUserField("googleCalendarExceptionOriginalScheduled"),o.updatedTask.googleCalendarExceptionOriginalScheduled),this.writeOptionalFrontmatterField(l,this.plugin.fieldMapper.toUserField("googleCalendarMovedOriginalDates"),o.updatedTask.googleCalendarMovedOriginalDates)}),await this.applyPropertyChangeSideEffects(i,s,o.updatedTask,t,s[t],o.normalizedValue),await this.reconcileMaterializedOccurrenceStatusChange(s,o.updatedTask,t,s[t],o.normalizedValue),o.updatedTask}catch(i){let s=i instanceof Error?i.message:String(i);throw lr.error("Error updating task property:",{category:"persistence",operation:"updating-task-property",details:{stack:i instanceof Error?i.stack:void 0,taskPath:e.path,property:t,value:n},error:s}),new Error(`Failed to update task property: ${s}`)}}async applyPropertyChangeSideEffects(e,t,n,a,i,s){await LEe({cacheManager:this.plugin.cacheManager,emitter:this.plugin.emitter,statusManager:this.plugin.statusManager,taskCalendarSyncService:this.plugin.taskCalendarSyncService,webhookNotifier:this.webhookNotifier,autoArchiveService:this.autoArchiveService,normalizeStatusValue:o=>this.normalizeStatusValue(o)},{file:e,originalTask:t,updatedTask:n,property:a,oldValue:i,newValue:s})}async materializeOccurrence(e,t,n={}){let a=await this.plugin.cacheManager.getTaskInfo(e.path)||e;if(!a.recurrence)throw new Error("Task is not recurring");let i=await this.plugin.cacheManager.getAllTasks(),s={parentTask:a,targetDate:t,currentTimestamp:Ge(),existingOccurrences:i,parentLink:this.buildOccurrenceParentReference(a),defaultStatus:this.plugin.settings.defaultTaskStatus,defaultPriority:this.plugin.settings.defaultTaskPriority,overrides:n},o=dW(s);if(!o.created&&o.existingOccurrence)return o.existingOccurrence;let l=await this.resolveOccurrenceTemplate(a,o.occurrenceTask),d={...(l.templateTask||l.customFrontmatter?dW({...s,templateTask:l.templateTask}):o).occurrenceTask,creationContext:"api",customFrontmatter:l.customFrontmatter,occurrenceFilenameTemplate:this.resolveOccurrenceFilenameTemplate(a)},{taskInfo:u}=await this.createTask(d,{applyDefaults:!1,applyTemplate:!l.configured});return u}resolveOccurrenceFilenameTemplate(e){var t,n,a;try{let i=((t=this.plugin.settings.occurrenceFilenameTemplateProperty)==null?void 0:t.trim())||"occurrenceFilenameTemplate",s=this.plugin.app.vault.getAbstractFileByPath(e.path),o=s instanceof Wn.TFile?(n=this.plugin.app.metadataCache.getFileCache(s))==null?void 0:n.frontmatter:void 0,l=o==null?void 0:o[i],c=typeof l=="string"&&l.trim()?l:this.plugin.settings.occurrenceFilenameTemplate;return typeof c=="string"&&c.trim()?c:void 0}catch(i){return lr.warn("Failed to resolve occurrence filename template:",{category:"persistence",operation:"resolving-occurrence-filename-template",error:i}),((a=this.plugin.settings.occurrenceFilenameTemplate)==null?void 0:a.trim())||void 0}}async findMaterializedOccurrence(e,t){let n=await this.plugin.cacheManager.getTaskInfo(e.path)||e;if(!n.recurrence)return;let a=typeof t=="string"?t.slice(0,10):ce(t),i=await this.plugin.cacheManager.getAllTasks();return cW(i,n,a,this.buildOccurrenceParentReference(n))}async toggleRecurringTaskCompleteWithOccurrenceNotes(e,t){let n=await this.plugin.cacheManager.getTaskInfo(e.path)||e;if(!n.recurrence)throw new Error("Task is not recurring");let a=this.getRecurringTaskActionDate(n,t),i=ce(a),s=await this.findMaterializedOccurrence(n,a);if(s)return this.toggleStatus(s);let o=Array.isArray(n.complete_instances)?n.complete_instances.filter(l=>typeof l=="string"):[];if(n.occurrence_materialization==="on_completion"&&!o.includes(i)){let l=await this.materializeOccurrence(n,a);return this.toggleStatus(l)}return this.toggleRecurringTaskComplete(n,a)}async getMaterializedOccurrenceParent(e){let t=await this.plugin.cacheManager.getTaskInfo(e.path)||e;return this.resolveOccurrenceParentTask(t)}async skipMaterializedOccurrence(e,t=this.getDefaultSkippedOccurrenceStatus()){let n=await this.plugin.cacheManager.getTaskInfo(e.path)||e,a=await this.resolveOccurrenceParentTask(n);if(!a)throw new Error("Cannot resolve occurrence parent");let i=Vxe({occurrenceTask:n,parentTask:a,skippedStatus:t,currentTimestamp:Ge(),maintainDueDateOffsetInRecurring:this.plugin.settings.maintainDueDateOffsetInRecurring}),s=await this.persistTaskInfoUpdates(n,i.occurrenceUpdates,"skip-materialized-occurrence"),o=await this.persistTaskInfoUpdates(a,i.parentUpdates,"reconcile-skipped-materialized-occurrence-parent");if(i.materializeNextDate)try{await this.materializeOccurrence(o,i.materializeNextDate)}catch(l){lr.warn("Failed to materialize next occurrence after skip:",{category:"persistence",operation:"materialize-next-occurrence-after-skip",details:{parentPath:o.path,nextDate:i.materializeNextDate},error:l})}return s}async unskipMaterializedOccurrence(e){let t=await this.plugin.cacheManager.getTaskInfo(e.path)||e,n=await this.resolveOccurrenceParentTask(t);if(!n)throw new Error("Cannot resolve occurrence parent");let a=qxe({occurrenceTask:t,parentTask:n,activeStatus:this.plugin.settings.defaultTaskStatus,currentTimestamp:Ge()}),i=await this.persistTaskInfoUpdates(t,a.occurrenceUpdates,"unskip-materialized-occurrence");return await this.persistTaskInfoUpdates(n,a.parentUpdates,"reconcile-unskipped-materialized-occurrence-parent"),i}getDefaultSkippedOccurrenceStatus(){var e;return(e=this.plugin.settings.customStatuses.find(t=>t.isSkipped))==null?void 0:e.value}async reconcileMaterializedOccurrenceStatusChange(e,t,n,a,i){if(n!=="status"||!AE(t))return;let s=this.plugin.statusManager.isCompletedStatus(this.normalizeStatusValue(a)),o=this.plugin.statusManager.isCompletedStatus(this.normalizeStatusValue(i));if(s===o)return;let l=await this.resolveOccurrenceParentTask(t);if(!l){lr.warn("Could not resolve materialized occurrence parent:",{category:"persistence",operation:"resolve-materialized-occurrence-parent",details:{taskPath:t.path,parent:t.recurrence_parent}});return}let c=Ge(),d=o?Uxe({occurrenceTask:t,parentTask:l,completedStatus:this.normalizeStatusValue(i),currentTimestamp:c,completionDate:t.completedDate||Il(),maintainDueDateOffsetInRecurring:this.plugin.settings.maintainDueDateOffsetInRecurring}):Hxe({occurrenceTask:e,parentTask:l,activeStatus:this.normalizeStatusValue(i),currentTimestamp:c});o&&(d=this.adjustRescheduledOccurrenceCompletionProgression(d,t,l,c));let u=await this.persistTaskInfoUpdates(l,d.parentUpdates,"reconcile-materialized-occurrence-parent");if(o&&this.webhookNotifier)try{await this.webhookNotifier.triggerWebhook("recurring.instance.completed",{task:u,occurrence:t,date:d.targetDate})}catch(p){lr.warn("Failed to trigger materialized occurrence webhook:",{category:"provider",operation:"trigger-materialized-occurrence-webhook",error:p})}if(o&&d.materializeNextDate)try{await this.materializeOccurrence(u,d.materializeNextDate)}catch(p){lr.warn("Failed to materialize next occurrence after completion:",{category:"persistence",operation:"materialize-next-occurrence-after-completion",details:{parentPath:u.path,nextDate:d.materializeNextDate},error:p})}}adjustRescheduledOccurrenceCompletionProgression(e,t,n,a){var p;let i=this.getRescheduledOccurrenceProgressionDate(t);if(!i||typeof n.recurrence!="string")return e;let s=typeof e.updatedParentTask.recurrence=="string"?e.updatedParentTask.recurrence:n.recurrence;if((e.updatedParentTask.recurrence_anchor||"scheduled")==="completion")return e;let l=wu({...e.updatedParentTask,recurrence:s,scheduled:t.scheduled||i,due:(p=t.due)!=null?p:n.due},this.plugin.settings.maintainDueDateOffsetInRecurring,{minOccurrenceDate:i}),c={...e.parentUpdates,recurrence:s,dateModified:a};l.scheduled?c.scheduled=l.scheduled:delete c.scheduled,l.due?c.due=l.due:delete c.due;let d={...n,...c},u=e.materializeNextDate?de(d.scheduled||""):void 0;return{...e,updatedParentTask:d,parentUpdates:c,parentFields:tb(c),materializeNextDate:u||void 0,changed:!0}}getRescheduledOccurrenceProgressionDate(e){let t=this.getSafeDatePart(e.occurrence_date),n=this.getSafeDatePart(e.scheduled);return!t||!n||n<=t?null:n}getSafeDatePart(e){if(!e)return"";try{return de(e)}catch(t){return""}}async resolveOccurrenceParentTask(e){var i,s;if(!e.recurrence_parent)return null;let t=Et(e.recurrence_parent),n=new Set([t]);t&&!t.endsWith(".md")&&n.add(`${t}.md`);for(let o of n){let l=await this.plugin.cacheManager.getTaskInfo(o);if(l)return l}let a=(s=(i=this.plugin.app.metadataCache).getFirstLinkpathDest)==null?void 0:s.call(i,t,e.path);return a instanceof Wn.TFile?await this.plugin.cacheManager.getTaskInfo(a.path):null}buildOccurrenceParentReference(e){let t=this.plugin.app.vault.getAbstractFileByPath(e.path);return t instanceof Wn.TFile?Ws(this.plugin.app,t,"",void 0,void 0,this.plugin.settings.useFrontmatterMarkdownLinks):`[[${e.path.replace(/\.md$/i,"")}]]`}applyModelTaskUpdatesToFrontmatter(e,t){let n=Wxe(t,this.plugin.fieldMapper.getMapping());for(let a of n)a.op==="delete"?delete e[a.field]:e[a.field]=a.value}async persistTaskInfoUpdates(e,t,n){var s;if(Object.keys(t).length===0)return e;let a=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(a instanceof Wn.TFile))throw new Error(`Cannot find task file: ${e.path}`);let i={...e,...t};await Fr(this.plugin.app,a,o=>{this.applyModelTaskUpdatesToFrontmatter(o,t)});try{this.plugin.cacheManager.waitForFreshTaskData&&await this.plugin.cacheManager.waitForFreshTaskData(a),this.plugin.cacheManager.updateTaskInfoInCache(e.path,i)}catch(o){lr.error("Error updating cache for model task updates:",{category:"stale-data",operation:"persist-model-task-updates-cache",details:{taskPath:e.path,sourceOperation:n},error:o})}return this.plugin.emitter.trigger(ot,{path:e.path,originalTask:e,updatedTask:i}),(s=this.plugin.taskCalendarSyncService)!=null&&s.isEnabled()&&this.plugin.taskCalendarSyncService.updateTaskInCalendar(i,e).catch(o=>{lr.warn("Failed to sync model task update to Google Calendar:",{category:"provider",operation:"sync-model-task-update-google-calendar",details:{taskPath:e.path,sourceOperation:n},error:o})}),i}async toggleArchive(e){var u,p;let t=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(t instanceof Wn.TFile))throw new Error(`Cannot find task file: ${e.path}`);let n=this.plugin.fieldMapper.getMapping().archiveTag,a=HEe(e,n,Ge()),{updatedTask:i,isCurrentlyArchived:s,dateModified:o}=a;await Fr(this.plugin.app,t,m=>{let f=this.plugin.fieldMapper.toUserField("dateModified");VEe({frontmatter:m,archiveTag:n,isCurrentlyArchived:s,dateModified:o,dateModifiedField:f})});let l=t,c=qEe({isCurrentlyArchived:s,moveArchivedTasks:this.plugin.settings.moveArchivedTasks,archiveFolderTemplate:this.plugin.settings.archiveFolder,tasksFolderTemplate:this.plugin.settings.tasksFolder,fileName:t.name,taskData:{title:i.title||"",priority:i.priority,status:i.status,contexts:i.contexts,projects:i.projects},processFolderTemplate:(m,f)=>this.processFolderTemplate(m,f)});if(c)try{if(await tm(this.plugin.app.vault,c.destinationFolder),this.plugin.app.vault.getAbstractFileByPath(c.newPath))throw new Error(`A file named "${t.name}" already exists in the ${c.destinationKind} folder "${c.destinationFolder}". Cannot move task to avoid overwriting existing file.`);await this.plugin.app.fileManager.renameFile(t,c.newPath);let f=this.plugin.app.vault.getAbstractFileByPath(c.newPath);if(!(f instanceof Wn.TFile))throw new Error(`Failed to resolve moved task file: ${c.newPath}`);l=f,i.path=c.newPath,this.plugin.cacheManager.clearCacheEntry(e.path)}catch(m){let f=m instanceof Error?m.message:String(m),h=c.operation;lr.error(`Error moving ${h} task:`,{category:"persistence",operation:"moving",details:{value:f}}),Te(this.plugin.emitter,this.translate("services.task.notices.moveTaskFailed",{operation:h,error:f}))}let d=!0;if((u=this.plugin.taskCalendarSyncService)!=null&&u.isEnabled()&&i.archived&&this.hasGoogleCalendarLinks(e)){let m=this.createArchiveCalendarDeletionTask(e,i);d=await this.deleteArchivedTaskFromCalendar(m),d&&this.clearGoogleCalendarMetadata(i)}try{l instanceof Wn.TFile&&this.plugin.cacheManager.waitForFreshTaskData&&await this.plugin.cacheManager.waitForFreshTaskData(l),this.plugin.cacheManager.updateTaskInfoInCache(i.path,i)}catch(m){lr.error("Error updating cache for archived task:",{category:"stale-data",operation:"updating-cache-archived-task",error:m})}if(this.plugin.emitter.trigger(ot,{path:i.path,originalTask:e,updatedTask:i}),this.webhookNotifier)try{i.archived?await this.webhookNotifier.triggerWebhook("task.archived",{task:i}):await this.webhookNotifier.triggerWebhook("task.unarchived",{task:i})}catch(m){lr.warn("Failed to trigger webhook for task archive/unarchive:",{category:"provider",operation:"trigger-webhook-task-archive-unarchive",error:m})}return(p=this.plugin.taskCalendarSyncService)!=null&&p.isEnabled()&&(i.archived?!d&&this.hasGoogleCalendarLinks(i)&&lr.warn("Archived task still has Google Calendar links and will need retry cleanup:",{category:"provider",operation:"archived-task-still-has-google-calendar-links-and-will-need-retry-cleanup",details:{value:i.path}}):this.plugin.taskCalendarSyncService.updateTaskInCalendar(i,e).catch(m=>{lr.warn("Failed to sync unarchived task to Google Calendar:",{category:"provider",operation:"sync-unarchived-task-google-calendar",error:m})})),i}async startTimeTracking(e){var o;let t=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(t instanceof Wn.TFile))throw new Error(`Cannot find task file: ${e.path}`);if(this.plugin.getActiveTimeSession(e))throw new Error("Time tracking is already active for this task");let a=g4(e,Ge(),new Date().toISOString()),{updatedTask:i,newEntry:s}=a;await Fr(this.plugin.app,t,l=>{let c=this.plugin.fieldMapper.toUserField("timeEntries"),d=this.plugin.fieldMapper.toUserField("dateModified");GEe({frontmatter:l,timeEntriesField:c,dateModifiedField:d,newEntry:s,dateModified:a.dateModified})});try{this.plugin.cacheManager.waitForFreshTaskData&&await this.plugin.cacheManager.waitForFreshTaskData(t),this.plugin.cacheManager.updateTaskInfoInCache(e.path,i)}catch(l){lr.error("Error updating cache for time tracking start:",{category:"stale-data",operation:"updating-cache-time-tracking-start",error:l})}if(this.plugin.emitter.trigger(ot,{path:e.path,originalTask:e,updatedTask:i}),this.webhookNotifier)try{await this.webhookNotifier.triggerWebhook("time.started",{task:i,session:(o=i.timeEntries)==null?void 0:o[i.timeEntries.length-1]})}catch(l){lr.warn("Failed to trigger webhook for time tracking start:",{category:"provider",operation:"trigger-webhook-time-tracking-start",error:l})}return i}async stopTimeTracking(e){var s;let t=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(t instanceof Wn.TFile))throw new Error(`Cannot find task file: ${e.path}`);let n=this.plugin.getActiveTimeSession(e);if(!n)throw new Error("No active time tracking session for this task");let a=y4(e,n,Ge(),new Date().toISOString()),{updatedTask:i}=a;await Fr(this.plugin.app,t,o=>{let l=this.plugin.fieldMapper.toUserField("timeEntries"),c=this.plugin.fieldMapper.toUserField("dateModified");ZEe({frontmatter:o,timeEntriesField:l,dateModifiedField:c,activeSession:n,stopTimestamp:a.stopTimestamp,dateModified:a.dateModified})});try{this.plugin.cacheManager.waitForFreshTaskData&&await this.plugin.cacheManager.waitForFreshTaskData(t),this.plugin.cacheManager.updateTaskInfoInCache(e.path,i)}catch(o){lr.error("Error updating cache for time tracking stop:",{category:"stale-data",operation:"updating-cache-time-tracking-stop",error:o})}if(this.plugin.emitter.trigger(ot,{path:e.path,originalTask:e,updatedTask:i}),this.webhookNotifier)try{await this.webhookNotifier.triggerWebhook("time.stopped",{task:i,session:(s=i.timeEntries)==null?void 0:s[i.timeEntries.length-1]})}catch(o){lr.warn("Failed to trigger webhook for time tracking stop:",{category:"provider",operation:"trigger-webhook-time-tracking-stop",error:o})}return i}async updateTask(e,t){return this.taskUpdateService.updateTask(e,t)}async updateBlockingRelationships(e,t,n,a={}){let{uniqueAdditions:i,uniqueRemovals:s}=JEe(t,n);for(let o of s){let l=await this.plugin.cacheManager.getTaskInfo(o);if(!l)continue;let c=k4(this.computeBlockedByUpdate(l,e.path,"remove"));c&&await this.updateTask(l,c)}for(let o of i){let l=await this.plugin.cacheManager.getTaskInfo(o);if(!l)continue;let c=k4(this.computeBlockedByUpdate(l,e.path,"add",a[o]));c&&await this.updateTask(l,c)}}computeBlockedByUpdate(e,t,n,a){return XEe({blockedTask:e,blockingTaskPath:t,action:n,rawEntry:a,useFrontmatterMarkdownLinks:this.plugin.settings.useFrontmatterMarkdownLinks,resolveDependencyPath:(i,s)=>{var o,l;return(l=(o=Ol(this.plugin.app,i,s))==null?void 0:o.path)!=null?l:null},formatDependencyLink:(i,s,o)=>_o(this.plugin.app,i,s,o)})}async deleteTask(e){try{let t=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(t instanceof Wn.TFile))throw new Error(`Cannot find task file: ${e.path}`);if(this.plugin.taskCalendarSyncService&&this.hasGoogleCalendarLinks(e))try{await this.plugin.taskCalendarSyncService.deleteTaskFromCalendarByPath(e.path,e.googleCalendarEventId,e.googleCalendarExceptionEventId)}catch(n){lr.warn("Failed to delete task from Google Calendar:",{category:"provider",operation:"delete-task-google-calendar",error:n})}if(await this.plugin.app.fileManager.trashFile(t),this.plugin.cacheManager.clearCacheEntry(e.path),this.plugin.emitter.trigger(is,{path:e.path,deletedTask:e}),this.webhookNotifier)try{await this.webhookNotifier.triggerWebhook("task.deleted",{task:e})}catch(n){lr.warn("Failed to trigger webhook for task deletion:",{category:"provider",operation:"trigger-webhook-task-deletion",error:n})}}catch(t){let n=t instanceof Error?t.message:String(t);throw lr.error("Error deleting task:",{category:"persistence",operation:"deleting-task",details:{stack:t instanceof Error?t.stack:void 0,taskPath:e.path},error:n}),new Error(`Failed to delete task: ${n}`)}}async resolveRecurringTaskActionDate(e,t){if(t)return t;let n=await this.plugin.cacheManager.getTaskInfo(e.path)||e;return this.getRecurringTaskActionDate(n)}getRecurringTaskActionDate(e,t){return sN(e,t)}async toggleRecurringTaskComplete(e,t){var d;let n=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(n instanceof Wn.TFile))throw new Error(`Cannot find task file: ${e.path}`);let a=await this.plugin.cacheManager.getTaskInfo(e.path)||e;if(!a.recurrence)throw new Error("Task is not recurring");let i=FTe({freshTask:a,targetDate:this.getRecurringTaskActionDate(a,t),currentTimestamp:Ge(),maintainDueDateOffsetInRecurring:this.plugin.settings.maintainDueDateOffsetInRecurring}),{updatedTask:s,dateStr:o,newComplete:l,targetDate:c}=i;if(await Fr(this.plugin.app,n,u=>{let p=this.plugin.fieldMapper.toUserField("completeInstances"),m=this.plugin.fieldMapper.toUserField("skippedInstances"),f=this.plugin.fieldMapper.toUserField("dateModified"),h=this.plugin.fieldMapper.toUserField("scheduled"),g=this.plugin.fieldMapper.toUserField("due"),v=this.plugin.fieldMapper.toUserField("recurrence"),b=this.plugin.fieldMapper.toUserField("googleCalendarExceptionOriginalScheduled"),k=this.plugin.fieldMapper.toUserField("googleCalendarMovedOriginalDates");OTe({frontmatter:u,completeInstancesField:p,skippedInstancesField:m,dateModifiedField:f,scheduledField:h,dueField:g,recurrenceField:v,googleCalendarExceptionOriginalScheduledField:b,googleCalendarMovedOriginalDatesField:k,plan:i})}),l&&this.plugin.settings.resetCheckboxesOnRecurrence){let u=null;await NS(this.plugin.app,n,p=>{let{frontmatter:m,body:f}=rm(p),{content:h,changed:g}=ffe(f);if(!g)return p;let v=m!==null?`--- ${m} --- `:"",b=h.trimEnd();return u=h.replace(/\r\n/g,` `).trimEnd(),b.length>0?`${v}${b} `:v}),u!==null&&(s.details=u)}try{if(this.plugin.cacheManager.waitForFreshTaskData){let u={complete_instances:s.complete_instances};s.scheduled!==a.scheduled&&(u.scheduled=s.scheduled),s.due!==a.due&&(u.due=s.due),await this.plugin.cacheManager.waitForFreshTaskData(n)}this.plugin.cacheManager.updateTaskInfoInCache(a.path,s)}catch(u){lr.error("Error updating cache for recurring task:",{category:"stale-data",operation:"updating-cache-recurring-task",error:u})}if(this.plugin.emitter.trigger(ot,{path:a.path,originalTask:a,updatedTask:s}),l&&this.webhookNotifier)try{await this.webhookNotifier.triggerWebhook("recurring.instance.completed",{task:s,date:o,targetDate:c})}catch(u){lr.error("Error triggering recurring task completion webhook:",{category:"provider",operation:"triggering-recurring-task-completion-webhook",error:u})}return(d=this.plugin.taskCalendarSyncService)!=null&&d.isEnabled()&&this.plugin.taskCalendarSyncService.updateTaskInCalendar(s,a).catch(u=>{lr.warn("Failed to sync recurring task update to Google Calendar:",{category:"provider",operation:"sync-recurring-task-update-google-calendar",error:u})}),s}async toggleRecurringTaskSkipped(e,t){var d;let n=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(n instanceof Wn.TFile))throw new Error(`Cannot find task file: ${e.path}`);let a=await this.plugin.cacheManager.getTaskInfo(e.path)||e;if(!a.recurrence)throw new Error("Task is not recurring");let i=LTe({freshTask:a,targetDate:this.getRecurringTaskActionDate(a,t),currentTimestamp:Ge(),maintainDueDateOffsetInRecurring:this.plugin.settings.maintainDueDateOffsetInRecurring}),{updatedTask:s,dateStr:o,newSkipped:l,targetDate:c}=i;await Fr(this.plugin.app,n,u=>{let p=this.plugin.fieldMapper.toUserField("skippedInstances"),m=this.plugin.fieldMapper.toUserField("completeInstances"),f=this.plugin.fieldMapper.toUserField("dateModified"),h=this.plugin.fieldMapper.toUserField("scheduled"),g=this.plugin.fieldMapper.toUserField("due"),v=this.plugin.fieldMapper.toUserField("googleCalendarExceptionOriginalScheduled"),b=this.plugin.fieldMapper.toUserField("googleCalendarMovedOriginalDates");zTe({frontmatter:u,skippedField:p,completeField:m,dateModifiedField:f,scheduledField:h,dueField:g,googleCalendarExceptionOriginalScheduledField:v,googleCalendarMovedOriginalDatesField:b,plan:i})});try{this.plugin.cacheManager.waitForFreshTaskData&&await this.plugin.cacheManager.waitForFreshTaskData(n),this.plugin.cacheManager.updateTaskInfoInCache(a.path,s)}catch(u){lr.error("Error updating cache for skipped recurring task:",{category:"stale-data",operation:"updating-cache-skipped-recurring-task",error:u})}if(this.plugin.emitter.trigger(ot,{path:a.path,originalTask:a,updatedTask:s}),l&&this.webhookNotifier)try{await this.webhookNotifier.triggerWebhook("recurring.instance.skipped",{task:s,date:o,targetDate:c})}catch(u){lr.error("Error triggering recurring task skip webhook:",{category:"provider",operation:"triggering-recurring-task-skip-webhook",error:u})}return(d=this.plugin.taskCalendarSyncService)!=null&&d.isEnabled()&&this.plugin.taskCalendarSyncService.updateTaskInCalendar(s,a).catch(u=>{lr.warn("Failed to sync recurring task skip to Google Calendar:",{category:"provider",operation:"sync-recurring-task-skip-google-calendar",error:u})}),s}async deleteTimeEntry(e,t){let n=this.plugin.app.vault.getAbstractFileByPath(e.path);if(!(n instanceof Wn.TFile))throw new Error(`Cannot find task file: ${e.path}`);let a=v4(e,t,Ge()),{updatedTask:i}=a;await Fr(this.plugin.app,n,s=>{let o=this.plugin.fieldMapper.toUserField("timeEntries"),l=this.plugin.fieldMapper.toUserField("dateModified");KEe({frontmatter:s,timeEntriesField:o,dateModifiedField:l,timeEntryIndex:a.timeEntryIndex,dateModified:a.dateModified})});try{this.plugin.cacheManager.waitForFreshTaskData&&await this.plugin.cacheManager.waitForFreshTaskData(n),this.plugin.cacheManager.updateTaskInfoInCache(e.path,i)}catch(s){lr.error("Error updating cache for time entry deletion:",{category:"stale-data",operation:"updating-cache-time-entry-deletion",error:s})}return this.plugin.emitter.trigger(ot,{path:e.path,originalTask:e,updatedTask:i}),i}updateCompletedDateInFrontmatter(e,t,n){if(n)return;let a=this.plugin.fieldMapper.toUserField("completedDate");h4(e,t,n,a,i=>this.plugin.statusManager.isCompletedStatus(i),Il())}extractProjectBasename(e){return Fl(e,this.plugin.app)}extractProjectFilePath(e){var a,i,s;let t=Et(e),n=(i=(a=this.plugin.app.metadataCache).getFirstLinkpathDest)==null?void 0:i.call(a,t,"");return((s=n==null?void 0:n.path)!=null?s:t).replace(/\.md$/i,"")}}});var sd,oD=y(()=>{sd=class{constructor(){this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{let n=this.events[e];if(!n)return;let a=n.filter(i=>i!==t);a.length>0?this.events[e]=a:delete this.events[e]}}emit(e,...t){this.events[e]&&this.events[e].forEach(n=>{n(...t)})}removeAllListeners(e){e?delete this.events[e]:this.events={}}}});var tF,rDe=y(()=>{kr();Me();tF=class{constructor(e){this.deps=e;this.indexQueryCache=new Map;this.cacheTimers=new Map;this.cacheTimeout=3e4}getIndexOptimizedTaskPaths(e){let t=this.analyzeQueryOptimizationSafety(e);if(!t.canOptimize)return this.deps.cacheManager.getAllTaskPaths();if(t.strategy==="intersect"){let n=this.getPathsForIndexableCondition(t.conditions[0]);for(let a=1;aa.type==="condition"&&this.isIndexableCondition(a)).length===t.length}hasIndexableConditionInOrGroup(e,t){return this.checkNodeForOrWithIndexable(e,t)}checkNodeForOrWithIndexable(e,t){if(e.type==="condition")return!1;if(e.type==="group"){if(e.conjunction==="or"&&e.children.some(a=>a.type==="condition"&&t.includes(a)))return!0;for(let n of e.children)if(this.checkNodeForOrWithIndexable(n,t))return!0}return!1}findIndexableConditions(e){let t=[];if(e.type==="condition")this.isIndexableCondition(e)&&t.push(e);else if(e.type==="group")for(let n of e.children)t.push(...this.findIndexableConditions(n));return t}isIndexableCondition(e){let{property:t,operator:n,value:a}=e;return!!(t==="status"&&n==="is"&&a||t==="priority"&&n==="is"&&a||t==="due"&&(n==="is"||n==="is-before"||n==="is-after")&&a||t==="scheduled"&&(n==="is"||n==="is-before"||n==="is-after")&&a)}getCachedIndexResult(e,t){let n=this.indexQueryCache.get(e);if(n)return new Set(n);let a=t();this.indexQueryCache.set(e,new Set(a));let i=this.cacheTimers.get(e);i&&this.deps.timer.clearTimeout(i);let s=this.deps.timer.setTimeout(()=>{this.indexQueryCache.delete(e),this.cacheTimers.delete(e)},this.cacheTimeout);return this.cacheTimers.set(e,s),a}getPathsForIndexableCondition(e){let{property:t,operator:n,value:a}=e,i=`${t}:${n}:${J(a)}`;return this.getCachedIndexResult(i,()=>t==="status"&&n==="is"&&a&&typeof a=="string"?new Set(this.deps.cacheManager.getTaskPathsByStatus(a)):t==="priority"&&n==="is"&&a&&typeof a=="string"?new Set(this.deps.cacheManager.getTaskPathsByPriority(a)):(t==="due"||t==="scheduled")&&n==="is"&&a&&typeof a=="string"?new Set(this.deps.cacheManager.getTasksForDate(Pc(a))):(t==="due"||t==="scheduled")&&(n==="is-before"||n==="is-after")&&a&&typeof a=="string"?this.getTaskPathsForDateRange(t,n,Pc(a)):this.deps.cacheManager.getAllTaskPaths())}getTaskPathsForDateRange(e,t,n){return(e==="due"||e==="scheduled")&&(t==="is-before"||t==="is-after")?this.deps.cacheManager.getTaskPathsForDateRange(e,t,n):this.deps.cacheManager.getAllTaskPaths()}intersectPathSets(e,t){let n=new Set;for(let a of e)t.has(a)&&n.add(a);return n}}});function aDe(r){return r.id||r.key}function rF(r,e){return r==null?1:e==null?-1:r.localeCompare(e)}function nF(r){if(typeof r=="boolean")return r;if(r==null)return;let e=J(r).trim().toLowerCase();if(e==="true")return!0;if(e==="false")return!1}function iDe(r){if(typeof r=="number")return String(r);if(typeof r!="string")return;let e=r.match(/^(\d+(?:\.\d+)?)/);return e?e[1]:void 0}function nDe(r){if(Array.isArray(r))return Db(r)[0];if(typeof r=="string")return r.trim().length===0?"":Db(r)[0]}function Db(r){let e=[],t=i=>{if(!i)return;let s=String(i).trim();if(!s)return;let o=s.match(/^\[\[([^|\]]+)(?:\|([^\]]+))?\]\]$/);if(o){let l=o[1]||"",d=o[2]||l.split("#")[0].split("/").pop()||l;d&&e.push(d),e.push(s);return}e.push(s)};if(Array.isArray(r))for(let i of r)t(J(i));else if(typeof r=="string"){let i=qs(r);for(let s of i)t(s)}else r!=null&&t(J(r));let n=new Set,a=[];for(let i of e)n.has(i)||(n.add(i),a.push(i));return a}function xg(r,e){return r==null?void 0:r.find(t=>aDe(t)===e)}function sDe(r,e){return r==null?void 0:r.find(t=>aDe(t)===e||t.key===e)}function oDe(r,e){switch(r.type){case"boolean":return typeof e=="boolean"?e:J(e).toLowerCase()==="true";case"number":return typeof e=="number"?e:e!=null?parseFloat(J(e)):void 0;case"list":return Db(e);case"date":case"text":default:return e!=null?J(e):void 0}}function lDe(r,e,t){switch(r.type){case"number":{let n=typeof e=="number"?e:e!=null?parseFloat(J(e)):NaN,a=typeof t=="number"?t:t!=null?parseFloat(J(t)):NaN,i=!isNaN(n),s=!isNaN(a);return i&&s?n-a:i&&!s?-1:!i&&s?1:0}case"boolean":{let n=nF(e),a=nF(t);return n===a?0:n===!0?-1:a===!0?1:n===!1?-1:a===!1?1:0}case"date":{let n=e?Date.parse(J(e)):NaN,a=t?Date.parse(J(t)):NaN,i=!isNaN(n),s=!isNaN(a);return i&&s?n-a:i&&!s?-1:!i&&s?1:0}case"list":{let n=nDe(e),a=nDe(t);return(n==null||n==="")&&(a==null||a==="")?0:n==null||n===""?1:a==null||a===""?-1:n.localeCompare(a)}case"text":default:{let n=e!=null?J(e):"",a=t!=null?J(t):"";return n.localeCompare(a)}}}function cDe(r,e,t=Dct){var n;if(!r)return t.unknownField;try{switch(r.type){case"boolean":{let a=nF(e);return a==null?t.noValue:a?"true":"false"}case"number":return(n=iDe(e))!=null?n:typeof e=="string"?t.nonNumeric:t.noValue;case"date":return e?J(e):t.noDate;case"list":{if(Array.isArray(e)){let a=Db(e);return a.length>0?a[0]:t.empty}if(typeof e=="string"){if(e.trim().length===0)return t.empty;let a=Db(e);return a.length>0?a[0]:t.empty}return t.noValue}case"text":default:return e?J(e).trim()||t.empty:t.noValue}}catch(a){return t.error}}function dDe(r,e,t){if(!r)return[t];switch(r.type){case"boolean":{let n=nF(e);return n==null?[t]:[n?"true":"false"]}case"number":{let n=iDe(e);return n?[n]:[t]}case"date":return e?[J(e)]:[t];case"list":{let n=Db(e).filter(a=>!/^\[\[/.test(a));return n.length>0?n:[t]}case"text":default:{let n=J(e).trim();return n?[n]:[t]}}}function uDe(r,e){let t=[...r];if(!e)return t.sort();switch(e.type){case"number":return t.sort((n,a)=>{let i=parseFloat(n),s=parseFloat(a),o=!isNaN(i),l=!isNaN(s);return o&&l?s-i:o&&!l?-1:!o&&l?1:rF(n,a)});case"boolean":return t.sort((n,a)=>n==="true"&&a==="false"?-1:n==="false"&&a==="true"?1:rF(n,a));case"date":return t.sort((n,a)=>{let i=Date.parse(n),s=Date.parse(a),o=!isNaN(i),l=!isNaN(s);return o&&l?i-s:o&&!l?-1:!o&&l?1:rF(n,a)});case"text":case"list":default:return t.sort(rF)}}var Dct,lD=y(()=>{am();kr();Dct={unknownField:"unknown-field",noValue:"no-value",noDate:"no-date",empty:"empty",nonNumeric:"non-numeric",error:"error"}});function pDe(r,e){return!!r&&de(r)!==e}function Pb(r,e,t){return!!r&&Nl(r,e,t)}function mDe(r,e){if(r.recurrence)return A_(r,kt(e.dateStr));if(r.due&&de(r.due)===e.dateStr||r.scheduled&&de(r.scheduled)===e.dateStr)return!0;if(e.includeOverdue&&e.isViewingToday){let t=e.isCompletedStatus(r.status);if(pDe(r.due,e.dateStr)&&Pb(r.due,t,e.hideCompletedFromOverdue)||pDe(r.scheduled,e.dateStr)&&Pb(r.scheduled,t,e.hideCompletedFromOverdue))return!0}return!1}function fDe(r,e){let t=e.isCompletedStatus(r.status);return r.recurrence&&!(t&&e.hideCompletedFromOverdue)&&Pct(r,e.todayString)?!0:Pb(r.due,t,e.hideCompletedFromOverdue)||Pb(r.scheduled,t,e.hideCompletedFromOverdue)}function Pct(r,e=nn()){if(!r.recurrence)return!1;let t=kt(e),n=new Date(t);n.setUTCDate(n.getUTCDate()-1);let a=Mct(r,t);if(a>n)return!1;let i=new Set(r.complete_instances||[]),s=new Set(r.skipped_instances||[]);return Bv(r,a,n).some(l=>{let c=ce(l);return ca?de(a):"").filter(a=>a.length>0).map(a=>kt(a)).reduce((a,i)=>i{Ct();Me()});function aF(r,e,t,n){return r.type==="condition"?_ct(r,e,t,n):r.type==="group"?Act(r,e,t,n):!0}function Act(r,e,t,n){if(r.children.length===0)return!0;let a=r.children.filter(i=>i.type==="condition"?br.isFilterNodeComplete(i):!0);return a.length===0?!0:r.conjunction==="and"?a.every(i=>aF(i,e,t,n)):r.conjunction==="or"?a.some(i=>aF(i,e,t,n)):!0}function _ct(r,e,t,n){let{property:a,operator:i,value:s}=r;if(typeof a=="string"&&a.startsWith("user:"))return Ict(r,e,t);let o=br.getTaskPropertyValue(e,a);if(a==="hasSubtasks"&&t.projectSubtasksService&&(o=t.projectSubtasksService.isTaskUsedAsProjectSync(e.path)),a==="status.isCompleted"){let l=$v(e,n||new Date,t.getCompletedStatuses()[0]);o=t.isCompletedStatus(l)}return a==="projects"&&(i==="contains"||i==="does-not-contain")?Nct(o,i,s,t.app):br.applyOperator(o,i,s,r.id,a)}function Ict(r,e,t){let{property:n,operator:a,value:i}=r,s=n.slice(5),o=xg(t.userFields,s),l=o?oDe(o,t.getUserFieldRawValue(e,o.key)):void 0;if((o==null?void 0:o.type)==="list"&&(a==="contains"||a==="does-not-contain")){let d=Array.isArray(l)?l:l!=null?[String(l)]:[],p=(Array.isArray(i)?i:[String(i!=null?i:"")]).some(m=>typeof m=="string"&&d.some(f=>typeof f=="string"&&f.toLowerCase().includes(m.toLowerCase())));return a==="contains"?p:!p}let c=(o==null?void 0:o.type)==="date"?"due":n;return br.applyOperator(l,a,i,r.id,c)}function Nct(r,e,t,n){if(!Array.isArray(r)||typeof t!="string")return!1;let a=gDe(t,n);if(!a)return!1;let i=r.some(s=>{if(!s||typeof s!="string")return!1;let o=gDe(s,n);return o?o===a?!0:Rct(s,t,n):!1});return e==="contains"?i:!i}function gDe(r,e){if(!r||typeof r!="string")return null;let t=Fl(r,e);return t||null}function Rct(r,e,t){if(!t)return!1;let n=yDe(r),a=yDe(e);if(!n||!a)return!1;let i=t.metadataCache.getFirstLinkpathDest(n,""),s=t.metadataCache.getFirstLinkpathDest(a,"");return i&&s?i.path===s.path:!1}function yDe(r){return!r||typeof r!="string"?null:r.startsWith("[[")&&r.endsWith("]]")?r.slice(2,-2):r}var vDe=y(()=>{Du();Ct();qn();lD()});function w4(r,e,t,n){var i;if(e==="none")return new Map([["all",r]]);let a=new Map;for(let s of r){let o=zct(s,e,t,n);for(let l of o)a.has(l)||a.set(l,[]),(i=a.get(l))==null||i.push(s)}return Fct(a,e,t)}function Fct(r,e,t){let n=new Map,a=jct(r,e,t);for(let i of a){let s=r.get(i);s&&n.set(i,s)}return n}function Oct(r,e,t){var s;let n=t||new Date;n.setHours(0,0,0,0);let a=e.isCompletedStatus(r.status),i=(s=e.hideCompletedFromOverdue)!=null?s:!0;if(r.recurrence){if(A_(r,n)){let o=M(n,"yyyy-MM-dd");return b4(o,e,a,i)}return r.due?b4(r.due,e,a,i):Hm("none",e)}return r.due?b4(r.due,e,a,i):Hm("none",e)}function Lct(r,e){var t;return r.scheduled?Bct(r.scheduled,e,e.isCompletedStatus(r.status),(t=e.hideCompletedFromOverdue)!=null?t:!0):Cg("none",e)}function zct(r,e,t,n){if(e==="project"){let a=Rl(r.projects||[]);return a.length===0?[bDe(t)]:a.map(i=>t.resolveProjectToAbsolutePath(i))}if(e==="tags"){let a=r.tags||[];return a.length>0?a:[TDe(t)]}if(typeof e=="string"&&e.startsWith("user:"))return[$ct(r,e,t)];switch(e){case"status":return[r.status||"no-status"];case"priority":return[r.priority||"unknown"];case"context":return[r.contexts&&r.contexts.length>0?r.contexts[0]:"none"];case"due":return[Oct(r,t,n)];case"scheduled":return[Lct(r,t)];case"completedDate":return[Uct(r,t)];default:return["unknown"]}}function jct(r,e,t){if(typeof e=="string"&&e.startsWith("user:")){let n=Hct(Array.from(r.keys()),e,t);return t.currentSortKey===e&&t.currentSortDirection==="desc"&&n.reverse(),n}switch(e){case"priority":return Array.from(r.keys()).sort((n,a)=>t.getPriorityWeight(a)-t.getPriorityWeight(n));case"status":return Array.from(r.keys()).sort((n,a)=>t.getStatusOrder(n)-t.getStatusOrder(a));case"due":{let n=["overdue","today","tomorrow","nextSevenDays","later","none"],a=new Map(n.map((i,s)=>[Hm(i,t),s]));return Array.from(r.keys()).sort((i,s)=>{var c,d;let o=(c=a.get(i))!=null?c:n.length,l=(d=a.get(s))!=null?d:n.length;return o-l})}case"scheduled":{let n=["past","today","tomorrow","nextSevenDays","later","none"],a=new Map(n.map((i,s)=>[Cg(i,t),s]));return Array.from(r.keys()).sort((i,s)=>{var c,d;let o=(c=a.get(i))!=null?c:n.length,l=(d=a.get(s))!=null?d:n.length;return o-l})}case"project":return Array.from(r.keys()).sort((n,a)=>kDe(n,a,bDe(t),t.getLocale()));case"tags":return Array.from(r.keys()).sort((n,a)=>kDe(n,a,TDe(t),t.getLocale()));case"completedDate":return Array.from(r.keys()).sort((n,a)=>{if(n==="Not completed")return 1;if(a==="Not completed")return-1;if(n==="Invalid date")return 1;if(a==="Invalid date")return-1;if(n==null||a==null){if(n==null)return 1;if(a==null)return-1}return a.localeCompare(n)});default:return Array.from(r.keys()).sort((n,a)=>n==null?1:a==null?-1:n.localeCompare(a,t.getLocale()))}}function $ct(r,e,t){let n=e.slice(5),a=xg(t.userFields||[],n),i=a?t.getUserFieldRawValue(r,a.key):void 0;return cDe(a,i)}function b4(r,e,t,n){let a=nn();if(Nl(r,t,n))return Hm("overdue",e);let i=de(r);if(Po(i,a))return Hm("today",e);try{let s=new Date;s.setDate(s.getDate()+1);let o=M(s,"yyyy-MM-dd");if(Po(i,o))return Hm("tomorrow",e);let l=new Date;l.setDate(l.getDate()+7);let c=M(l,"yyyy-MM-dd");return Dh(i,c)||Po(i,c)?Hm("nextSevenDays",e):Hm("later",e)}catch(s){return T4.error(`Error categorizing date ${r}:`,{category:"validation",operation:"categorizing-date",error:s}),cD(e)}}function Bct(r,e,t,n){let a=nn();if(Nl(r,t,n))return Cg("past",e);let i=de(r);if(Po(i,a))return Cg("today",e);try{let s=new Date;s.setDate(s.getDate()+1);let o=M(s,"yyyy-MM-dd");if(Po(i,o))return Cg("tomorrow",e);let l=new Date;l.setDate(l.getDate()+7);let c=M(l,"yyyy-MM-dd");return Dh(i,c)||Po(i,c)?Cg("nextSevenDays",e):Cg("later",e)}catch(s){return T4.error(`Error categorizing scheduled date ${r}:`,{category:"validation",operation:"categorizing-scheduled-date",error:s}),cD(e)}}function Uct(r,e){if(!r.completedDate)return"Not completed";try{return M(Us(r.completedDate),"yyyy-MM-dd")}catch(t){return T4.error(`Error formatting completed date ${r.completedDate}:`,{category:"validation",operation:"formatting-completed-date",error:t}),cD(e)}}function Hct(r,e,t){let n=e.slice(5),a=xg(t.userFields||[],n);return uDe(r,a)}function kDe(r,e,t,n){return r===t?1:e===t?-1:r==null?1:e==null?-1:r.localeCompare(e,n)}function Hm(r,e){switch(r){case"overdue":return e.translate("services.filter.groupLabels.due.overdue","Overdue");case"today":return e.translate("services.filter.groupLabels.due.today","Today");case"tomorrow":return e.translate("services.filter.groupLabels.due.tomorrow","Tomorrow");case"nextSevenDays":return e.translate("services.filter.groupLabels.due.nextSevenDays","Next seven days");case"later":return e.translate("services.filter.groupLabels.due.later","Later");case"none":return e.translate("services.filter.groupLabels.due.none","No due date");case"invalid":default:return cD(e)}}function Cg(r,e){switch(r){case"past":return e.translate("services.filter.groupLabels.scheduled.past","Past scheduled");case"today":return e.translate("services.filter.groupLabels.scheduled.today","Today");case"tomorrow":return e.translate("services.filter.groupLabels.scheduled.tomorrow","Tomorrow");case"nextSevenDays":return e.translate("services.filter.groupLabels.scheduled.nextSevenDays","Next seven days");case"later":return e.translate("services.filter.groupLabels.scheduled.later","Later");case"none":return e.translate("services.filter.groupLabels.scheduled.none","No scheduled date");case"invalid":default:return cD(e)}}function bDe(r){return r.translate("services.filter.groupLabels.noProject","No project")}function TDe(r){return r.translate("services.filter.groupLabels.noTags","No tags")}function cD(r){return r.translate("services.filter.groupLabels.invalidDate","Invalid date")}var T4,wDe=y(()=>{Wr();Me();Ct();lD();K();T4=N({tag:"Services/FilterService/FilterTaskGrouping"})});function SDe(r,e,t,n){return r.sort((a,i)=>{let s=qct(a,i,e,n);return s!==0?t==="desc"?-s:s:Zct(a,i,e,n)})}function Mb(r,e){if(!r&&!e)return 0;if(!r)return 1;if(!e)return-1;try{return Tu(r,e)?-1:Tu(e,r)?1:0}catch(t){return Vct.error("Error comparing dates time-aware:",{category:"validation",operation:"comparing-dates-time-aware",details:{dateA:r,dateB:e},error:t}),r.localeCompare(e)}}function qct(r,e,t,n){if(typeof t=="string"&&t.startsWith("user:"))return Qct(r,e,t,n);switch(t){case"due":return Mb(r.due,e.due);case"scheduled":return Mb(r.scheduled,e.scheduled);case"priority":return Yct(r.priority,e.priority,n);case"status":return Gct(r.status,e.status,n);case"title":return r.title.localeCompare(e.title);case"dateCreated":return Mb(r.dateCreated,e.dateCreated);case"completedDate":return Mb(r.completedDate,e.completedDate);case"tags":return Kct(r.tags,e.tags);default:return 0}}function Wct(r,e,t){let n=t.getPriorityWeight(r);return t.getPriorityWeight(e)-n}function Yct(r,e,t){let n=t.getPriorityWeight(r),a=t.getPriorityWeight(e);return n-a}function Gct(r,e,t){return t.getStatusOrder(r)-t.getStatusOrder(e)}function Kct(r,e){let t=r&&r.length>0?r:[],n=e&&e.length>0?e:[];return t.length===0&&n.length===0?0:t.length===0?1:n.length===0?-1:t[0].toLowerCase().localeCompare(n[0].toLowerCase())}function Zct(r,e,t,n){let i=["due","scheduled","priority","title"].filter(s=>s!==t);for(let s of i){let o=0;switch(s){case"scheduled":o=Mb(r.scheduled,e.scheduled);break;case"due":o=Mb(r.due,e.due);break;case"priority":o=Wct(r.priority,e.priority,n);break;case"title":o=r.title.localeCompare(e.title);break}if(o!==0)return o}return 0}function Qct(r,e,t,n){let a=t.slice(5),i=xg(n.userFields||[],a);return i?lDe(i,n.getUserFieldRawValue(r,i.key),n.getUserFieldRawValue(e,i.key)):0}var Vct,xDe=y(()=>{Me();lD();K();Vct=N({tag:"Services/FilterService/FilterTaskSorting"})});function CDe(r){return{statuses:r.statuses,priorities:r.priorities,contexts:r.contexts,projects:r.projects,tags:r.tags,folders:Jct(r.taskPaths,r.rootFolderLabel),userProperties:Xct(r.userFields||[])}}function Jct(r,e){let t=new Set;for(let n of r){let a=n.lastIndexOf("/");a>0?t.add(n.substring(0,a)):a===-1&&t.add("")}return Array.from(t).sort().map(n=>n===""?e:n)}function Xct(r){let e=[];for(let t of r)!t||!t.key||!t.displayName||e.push({id:`user:${t.id||t.key}`,label:t.displayName,category:edt(t.type),supportedOperators:rdt(t.type),valueInputType:tdt(t.type)});return e}function edt(r){switch(r){case"boolean":return"boolean";case"number":return"numeric";case"date":return"date";case"list":case"text":default:return"text"}}function tdt(r){switch(r){case"number":return"number";case"date":return"date";case"boolean":return"none";case"list":case"text":default:return"text"}}function rdt(r){switch(r){case"number":return["is","is-not","is-greater-than","is-less-than","is-greater-than-or-equal","is-less-than-or-equal","is-empty","is-not-empty"];case"date":return["is","is-not","is-before","is-after","is-on-or-before","is-on-or-after","is-empty","is-not-empty"];case"boolean":return["is-checked","is-not-checked"];case"list":return["contains","does-not-contain","is-empty","is-not-empty"];case"text":default:return["is","is-not","contains","does-not-contain","is-empty","is-not-empty"]}}var EDe=y(()=>{});function S4(r){return{type:"group",id:r(),conjunction:"and",children:[],sortKey:"due",sortDirection:"asc",groupKey:"none"}}function PDe(r,e,t,n){let a=adt(r);if(ndt(a,e),!t){let i=DDe[e];a.children.push({type:"condition",id:n(),...i})}return a}function MDe(r,e){let t=S4(e);return{...t,...r,type:"group",id:r.id||t.id,conjunction:r.conjunction||t.conjunction,children:r.children||t.children,sortKey:r.sortKey||t.sortKey,sortDirection:r.sortDirection||t.sortDirection,groupKey:r.groupKey||t.groupKey}}function ndt(r,e){let t=DDe[e].property;r.children=r.children.filter(n=>n.type==="condition"?n.property!==t:!0)}function adt(r){return JSON.parse(JSON.stringify(r))}var DDe,ADe=y(()=>{DDe={showCompleted:{property:"status.isCompleted",operator:"is-not-checked",value:null},showArchived:{property:"archived",operator:"is-not-checked",value:null},showRecurrent:{property:"recurrence",operator:"is-empty",value:null}}});var _De={};at(_De,{HierarchicalGroupingService:()=>C4});function x4(r){return r==null?"":typeof r=="string"?r.trim():typeof r=="number"||typeof r=="boolean"?String(r):""}var C4,IDe=y(()=>{C4=class{constructor(e){this.resolveUserFieldValues=e}group(e,t,n,a="asc",i=[]){let s=new Map,o=(c,d)=>{var p,m,f,h,g,v,b,k;if(!d||d==="none")return["all"];let u=w=>{let S=w.map(x4).filter(C=>C!=="");return S.length?S:[]};if(d.startsWith("user:")){let w=d.slice(5);if(this.resolveUserFieldValues){let E=this.resolveUserFieldValues(c,w)||[],D=u(E);return D.length?D:[`No ${w}`]}let S=(p=c.customProperties)==null?void 0:p[w];if(Array.isArray(S)){let E=u(S);return E.length?E:[`No ${w}`]}let C=x4(S);return C!==""?[C]:[`No ${w}`]}switch(d){case"status":return[((m=c.status)!=null?m:"").trim()||"No Status"];case"priority":return[((f=c.priority)!=null?f:"").trim()||"No Priority"];case"context":{let w=u((h=c.contexts)!=null?h:[]);return w.length?w:["No Context"]}case"project":{let w=u((g=c.projects)!=null?g:[]).map(E=>{let D=E.match(/^\[\[([^|\]]+)(?:\|([^\]]+))?\]\]$/);if(D){let P=D[1]||"";return D[2]||P.split("#")[0].split("/").pop()||P||E}return E}),S=[],C=new Set;for(let E of w)C.has(E)||(C.add(E),S.push(E));return S.length?S:["No Project"]}case"tags":{let w=u((v=c.tags)!=null?v:[]);return w.length?w:["No Tag"]}case"due":{let w=((b=c.due)!=null?b:"").trim();return w?[w.split("T")[0]]:["No Due Date"]}case"scheduled":{let w=((k=c.scheduled)!=null?k:"").trim();return w?[w.split("T")[0]]:["No Scheduled Date"]}default:{let S=c[d];if(Array.isArray(S)){let E=u(S);return E.length?E:[`No ${d}`]}let C=x4(S);return C!==""?[C]:[`No ${d}`]}}};for(let c of e){let d=o(c,t),u=o(c,n);for(let p of d){s.has(p)||s.set(p,new Map);let m=s.get(p);for(let f of u)m.has(f)||m.set(f,[]),m.get(f).push(c)}}let l=new Map;for(let[c,d]of s){let u=this.sortSubgroups(d,n,a,i);l.set(c,u)}return l}sortSubgroups(e,t,n,a){let i=Array.from(e.keys()),s=this.sortSubgroupKeys(i,t,n,a),o=new Map;for(let l of s)o.set(l,e.get(l));return o}sortSubgroupKeys(e,t,n,a){let i=o=>/^No\s/i.test(o);if(typeof t=="string"&&t.startsWith("user:")){let o=t.slice(5),l=a.find(u=>(u.id||u.key)===o),c=(u,p)=>{if(i(u)&&!i(p))return-1;if(!i(u)&&i(p))return 1;if((l==null?void 0:l.type)==="number"){let m=parseFloat(u),f=parseFloat(p),h=isNaN(m)?Number.POSITIVE_INFINITY:m,g=isNaN(f)?Number.POSITIVE_INFINITY:f;if(h!==g)return h-g}else if((l==null?void 0:l.type)==="boolean"){let m=u==="true"?0:u==="false"?1:2,f=p==="true"?0:p==="false"?1:2;if(m!==f)return m-f}else if((l==null?void 0:l.type)==="date"){let m=Date.parse(u),f=Date.parse(p),h=isNaN(m)?Number.POSITIVE_INFINITY:m,g=isNaN(f)?Number.POSITIVE_INFINITY:f;if(h!==g)return h-g}return u.localeCompare(p)},d=e.slice().sort(c);return n==="desc"?d.reverse():d}let s=e.slice().sort((o,l)=>i(o)&&!i(l)?-1:!i(o)&&i(l)?1:o.localeCompare(l));return n==="desc"?s.reverse():s}}});var NDe,iF,Ab,sF,RDe=y(()=>{NDe=require("obsidian");qn();oD();Du();Wr();Me();rDe();lD();hDe();vDe();wDe();xDe();EDe();ADe();K();iF=N({tag:"Services/FilterService"}),Ab=class Ab extends sd{constructor(t,n,a,i){super();this.runtime=i;this.filterOptionsCache=null;this.filterOptionsCacheTimestamp=0;this.filterOptionsCacheTTL=3e5;this.filterOptionsComputeCount=0;this.filterOptionsCacheHits=0;this.cacheManager=t,this.statusManager=n,this.priorityManager=a,this.queryPlanner=new tF({cacheManager:t,timer:{setTimeout:(s,o)=>window.setTimeout(s,o),clearTimeout:s=>window.clearTimeout(s)}}),Ab.lastInstance=this}translate(t,n,a){var i;try{if((i=this.runtime)!=null&&i.i18n)return this.runtime.i18n.translate(t,a)}catch(s){iF.error("FilterService translation error:",{category:"internal",operation:"filterservice-translation",error:s})}return n}static translateStatic(t,n){let a=Ab.lastInstance;return a?a.translate(t,n):n}getLocale(){var t,n,a;try{let i=(a=(n=(t=this.runtime)==null?void 0:t.i18n)==null?void 0:n.getCurrentLocale)==null?void 0:a.call(n);if(i)return i}catch(i){iF.error("FilterService locale error:",{category:"internal",operation:"filterservice-locale",error:i})}return"en"}getNoProjectLabel(){return this.translate("services.filter.groupLabels.noProject","No project")}async getGroupedTasks(t,n){try{br.validateFilterNode(t,!1);let a=this.queryPlanner.getIndexOptimizedTaskPaths(t),s=(await this.pathsToTaskInfos(Array.from(a))).filter(l=>this.evaluateFilterNode(t,l,n)),o=this.sortTasks(s,t.sortKey||"due",t.sortDirection||"asc");return this.currentSortKey=t.sortKey||"due",this.currentSortDirection=t.sortDirection||"asc",w4(o,t.groupKey||"none",this.createTaskGroupingContext(),n)}catch(a){if(a instanceof ja||a instanceof Eu)return iF.error("Filter error:",{category:"internal",operation:"filter",details:{values:[a.message,{nodeId:a.nodeId,field:a.field}]}}),new Map;throw a}}async getHierarchicalGroupedTasks(t,n){var a,i;try{br.validateFilterNode(t,!1);let s=this.queryPlanner.getIndexOptimizedTaskPaths(t),l=(await this.pathsToTaskInfos(Array.from(s))).filter(p=>this.evaluateFilterNode(t,p,n)),c=this.sortTasks(l,t.sortKey||"due",t.sortDirection||"asc");this.currentSortKey=t.sortKey||"due",this.currentSortDirection=t.sortDirection||"asc";let d=w4(c,t.groupKey||"none",this.createTaskGroupingContext(),n),u=t.subgroupKey;if(u&&u!=="none"&&t.groupKey&&t.groupKey!=="none"){let{HierarchicalGroupingService:p}=await Promise.resolve().then(()=>(IDe(),_De)),m=(b,k)=>{var D,P;let w=((P=(D=this.runtime)==null?void 0:D.settings)==null?void 0:P.userFields)||[],S=sDe(w,k),C=`No ${(S==null?void 0:S.displayName)||(S==null?void 0:S.key)||k}`,E=S?this.getUserFieldRawValue(b,S.key):void 0;return dDe(S,E,C)},h=new p(m).group(c,t.groupKey,u,this.currentSortDirection,((i=(a=this.runtime)==null?void 0:a.settings)==null?void 0:i.userFields)||[]),g=Array.from(d.keys()),v=new Map;for(let b of g){let k=h.get(b);k&&v.set(b,k)}for(let[b,k]of h)v.has(b)||v.set(b,k);return{groups:d,hierarchicalGroups:v}}return{groups:d}}catch(s){if(s instanceof ja||s instanceof Eu)return iF.error("Filter error (hierarchical):",{category:"internal",operation:"filter-hierarchical",details:{values:[s.message,{nodeId:s.nodeId}]}}),{groups:new Map};throw s}}getCacheStats(){return this.queryPlanner.getCacheStats()}async pathsToTaskInfos(t){let n=[];for(let i=0;ithis.cacheManager.getCachedTaskInfo(l)));for(let l of o)l&&n.push(l)}return n}evaluateFilterNode(t,n,a){return aF(t,n,this.createPredicateEvaluationContext(),a)}createPredicateEvaluationContext(){var t,n,a,i;return{app:(t=this.runtime)==null?void 0:t.app,userFields:((a=(n=this.runtime)==null?void 0:n.settings)==null?void 0:a.userFields)||[],projectSubtasksService:(i=this.runtime)==null?void 0:i.projectSubtasksService,getUserFieldRawValue:(s,o)=>this.getUserFieldRawValue(s,o),getCompletedStatuses:()=>this.statusManager.getCompletedStatuses(),isCompletedStatus:s=>this.statusManager.isCompletedStatus(s)}}resolveProjectToAbsolutePath(t){var i;if(!t||typeof t!="string")return t||"";if(!((i=this.runtime)!=null&&i.app))return t;let n=this.parseLinkToPath(t),a=this.runtime.app.metadataCache.getFirstLinkpathDest(n,"");return a?a.path.replace(/\.md$/,""):n.replace(/\.md$/,"")}parseLinkToPath(t){return Et(t)}getPreferredProjectFormat(t){let n=this.getNoProjectLabel();return!t||t===n?t:t.includes("/")||t.endsWith(".md")?`[[${t}]]`:`[[${t}]]`}getOverdueTaskPaths(){return this.cacheManager.getOverdueTaskPaths()}sortTasks(t,n,a){return SDe(t,n,a,this.createTaskSortingContext())}createTaskGroupingContext(){var t,n,a,i;return{userFields:((n=(t=this.runtime)==null?void 0:t.settings)==null?void 0:n.userFields)||[],hideCompletedFromOverdue:(i=(a=this.runtime)==null?void 0:a.settings)==null?void 0:i.hideCompletedFromOverdue,currentSortKey:this.currentSortKey,currentSortDirection:this.currentSortDirection,isCompletedStatus:s=>this.statusManager.isCompletedStatus(s),getPriorityWeight:s=>this.priorityManager.getPriorityWeight(s),getStatusOrder:s=>this.statusManager.getStatusOrder(s),getUserFieldRawValue:(s,o)=>this.getUserFieldRawValue(s,o),resolveProjectToAbsolutePath:s=>this.resolveProjectToAbsolutePath(s),translate:(s,o,l)=>this.translate(s,o,l),getLocale:()=>this.getLocale()}}createTaskSortingContext(){var t,n;return{userFields:((n=(t=this.runtime)==null?void 0:t.settings)==null?void 0:n.userFields)||[],getPriorityWeight:a=>this.priorityManager.getPriorityWeight(a),getStatusOrder:a=>this.statusManager.getStatusOrder(a),getUserFieldRawValue:(a,i)=>this.getUserFieldRawValue(a,i)}}getUserFieldRawValue(t,n){var a;try{let i=this.cacheManager.getApp(),s=i.vault.getAbstractFileByPath(t.path),o=s instanceof NDe.TFile?(a=i.metadataCache.getFileCache(s))==null?void 0:a.frontmatter:void 0;return o?o[n]:void 0}catch(i){return}}async getFilterOptions(){var a,i;let t=Date.now();if(this.filterOptionsCache&&t-this.filterOptionsCacheTimestamp0?(this.filterOptionsCacheHits/i*100).toFixed(1)+"%":"0%";return{cacheHits:this.filterOptionsCacheHits,computeCount:this.filterOptionsComputeCount,hitRate:s,isCurrentlyCached:!!this.filterOptionsCache,cacheAge:n,ttlRemaining:a}}createDefaultQuery(){return S4(()=>br.generateId())}addQuickToggleCondition(t,n,a){return PDe(t,n,a,()=>br.generateId())}normalizeQuery(t){return MDe(t,()=>br.generateId())}initialize(){this.cacheManager.on("file-updated",t=>{(t==null?void 0:t.filterIndexChanged)!==!1&&this.handleFilterIndexChanged(),this.emit("data-changed")}),this.cacheManager.on("file-added",()=>{this.handleFilterIndexChanged(),this.emit("data-changed")}),this.cacheManager.on("file-deleted",()=>{this.handleFilterIndexChanged(),this.emit("data-changed")}),this.cacheManager.on("file-renamed",()=>{this.handleFilterIndexChanged(),this.emit("data-changed")}),this.cacheManager.on("indexes-built",()=>{this.handleFilterIndexChanged(),this.emit("data-changed")})}cleanup(){this.queryPlanner.clearIndexQueryCache(),this.invalidateFilterOptionsCache(),this.removeAllListeners()}static createDateRangeFromDates(t){if(t.length===0)throw new Error(Ab.translateStatic("services.filter.errors.noDatesProvided","No dates provided"));let n=t[0],a=t[t.length-1];return{start:M(n,"yyyy-MM-dd"),end:M(a,"yyyy-MM-dd")}}static shouldIncludeOverdueForRange(t,n){if(!n)return!1;let i=M(new Date,"yyyy-MM-dd");return t.some(s=>M(s,"yyyy-MM-dd")===i)}async getTasksForDate(t,n,a=!1){var p,m,f;let i=ce(t),s=_S(i),o=this.cacheManager.getAllTaskPaths(),c=(await this.pathsToTaskInfos(Array.from(o))).filter(h=>this.evaluateFilterNode(n,h)),d=(f=(m=(p=this.runtime)==null?void 0:p.settings)==null?void 0:m.hideCompletedFromOverdue)!=null?f:!0,u=c.filter(h=>mDe(h,{dateStr:i,isViewingToday:s,includeOverdue:a,hideCompletedFromOverdue:d,isCompletedStatus:g=>this.statusManager.isCompletedStatus(g)}));return this.sortTasks(u,n.sortKey||"due",n.sortDirection||"asc")}async getOverdueTasks(t){var l,c,d;let n=this.cacheManager.getAllTaskPaths(),i=(await this.pathsToTaskInfos(Array.from(n))).filter(u=>this.evaluateFilterNode(t,u)),s=(d=(c=(l=this.runtime)==null?void 0:l.settings)==null?void 0:c.hideCompletedFromOverdue)!=null?d:!0,o=i.filter(u=>fDe(u,{hideCompletedFromOverdue:s,isCompletedStatus:p=>this.statusManager.isCompletedStatus(p)}));return this.sortTasks(o,t.sortKey||"due",t.sortDirection||"asc")}async getAgendaDataWithOverdue(t,n,a=!1){let i=[];for(let o of t){let l=await this.getTasksForDate(o,n,!1);i.push({date:new Date(o),tasks:l})}let s=a?await this.getOverdueTasks(n):[];return{dailyData:i,overdueTasks:s}}async getAgendaData(t,n,a=!1){let i=[];for(let s of t){let o=await this.getTasksForDate(s,n,a&&j2(s));i.push({date:new Date(s),tasks:o})}return i}async getFlatAgendaData(t,n,a=!1){let i=await this.getAgendaData(t,n,a),s=[];for(let o of i)for(let l of o.tasks)s.push({...l,agendaDate:o.date});return s}};Ab.lastInstance=null;sF=Ab});var _b,E4=y(()=>{_b=class{constructor(e,t){this.cache=e;this.statusManager=t}getStats(e){let t={},n={},a=0,i=0,s=0,o=0,l=0,c=0,d=new Date().toISOString().split("T")[0];for(let u of e){t[u.status]=(t[u.status]||0)+1,n[u.priority]=(n[u.priority]||0)+1;let p=this.statusManager.isCompletedStatus(u.status);u.archived&&o++,p&&a++,!p&&!u.archived&&i++,u.due&&u.due0&&(l++,c+=u.totalTrackedTime||0)}return{total:e.length,statusCounts:t,priorityCounts:n,completed:a,active:i,overdue:s,archived:o,withTimeEntries:l,totalTrackedMinutes:c,totalTrackedHours:Math.round(c/60*100)/100}}async getAggregatedTimeEstimate(e){let t=this.cache.getAllTimeEstimates();if(t.size===0)return 0;let{start:n,end:a}=this.getDateRange(e),i=0;for(let[s,o]of t.entries()){let l=await this.cache.getTaskInfo(s);l&&this.isTaskInRange(l,n,a)&&(i+=o)}return i}isTaskInRange(e,t,n){let a=e.due||e.scheduled;if(!a)return!1;let i=new Date(a);return i>=t&&i<=n}getDateRange(e){if(typeof e!="string")return e;let t=new Date,n=new Date(t),a=new Date(t);switch(e){case"daily":n.setHours(0,0,0,0),a.setHours(23,59,59,999);break;case"weekly":{let i=t.getDay(),s=t.getDate()-i+(i===0?-6:1);n.setDate(s),n.setHours(0,0,0,0),a.setDate(n.getDate()+6),a.setHours(23,59,59,999);break}case"monthly":n.setDate(1),n.setHours(0,0,0,0),a.setMonth(n.getMonth()+1),a.setDate(0),a.setHours(23,59,59,999);break;case"yearly":n.setMonth(0,1),n.setHours(0,0,0,0),a.setFullYear(n.getFullYear()+1),a.setDate(0),a.setHours(23,59,59,999);break}return{start:n,end:a}}}});var Vm,oF,FDe=y(()=>{oD();Du();K();Vm=N({tag:"Services/ViewStateManager"}),oF=class extends sd{constructor(t,n){super();this.filterState={};this.viewPreferences={};this.savedViews=[];this.storageKey="tasknotes-view-filter-state";this.preferencesStorageKey="tasknotes-view-preferences";this.savedViewsStorageKey="tasknotes-saved-views";this.app=t,this.plugin=n,this.loadFromStorage(),this.loadPreferencesFromStorage(),this.savedViews=[...this.plugin.settings.savedViews]}async initializeSavedViews(){await this.migrateAndLoadSavedViews()}getFilterState(t){let n=this.filterState[t];if(n){if(typeof n!="object"||n.type!=="group"||!Array.isArray(n.children)||typeof n.conjunction!="string"){Vm.warn(`ViewStateManager: Ignoring old format filter state for ${t}, will use default`,{category:"validation",operation:"viewstatemanager-ignoring-old-format-filter-state"}),delete this.filterState[t],this.saveToStorage();return}return br.deepCloneFilterQuery(n)}}setFilterState(t,n){this.filterState[t]=br.deepCloneFilterQuery(n),this.saveToStorage(),this.emit("filter-state-changed",{viewType:t,query:br.deepCloneFilterQuery(n)})}clearFilterState(t){delete this.filterState[t],this.saveToStorage(),this.emit("filter-state-cleared",{viewType:t})}clearAllFilterStates(){this.filterState={},this.saveToStorage(),this.emit("all-filter-states-cleared")}getViewPreferences(t){return this.viewPreferences[t]}setViewPreferences(t,n){this.viewPreferences[t]={...n},this.savePreferencesToStorage(),this.emit("view-preferences-changed",{viewType:t,preferences:n})}clearViewPreferences(t){delete this.viewPreferences[t],this.savePreferencesToStorage(),this.emit("view-preferences-cleared",{viewType:t})}clearAllViewPreferences(){this.viewPreferences={},this.savePreferencesToStorage(),this.emit("all-view-preferences-cleared")}loadFromStorage(){try{let t=this.app.loadLocalStorage(this.storageKey);t&&typeof t=="string"&&(this.filterState=JSON.parse(t))}catch(t){Vm.warn("Failed to load view filter state from storage:",{category:"persistence",operation:"load-view-filter-state-storage",error:t}),this.filterState={}}}saveToStorage(){try{this.app.saveLocalStorage(this.storageKey,JSON.stringify(this.filterState))}catch(t){Vm.warn("Failed to save view filter state to storage:",{category:"persistence",operation:"save-view-filter-state-storage",error:t})}}loadPreferencesFromStorage(){try{let t=this.app.loadLocalStorage(this.preferencesStorageKey);t&&typeof t=="string"&&(this.viewPreferences=JSON.parse(t))}catch(t){Vm.warn("Failed to load view preferences from storage:",{category:"configuration",operation:"load-view-preferences-storage",error:t}),this.viewPreferences={}}}savePreferencesToStorage(){try{this.app.saveLocalStorage(this.preferencesStorageKey,JSON.stringify(this.viewPreferences))}catch(t){Vm.warn("Failed to save view preferences to storage:",{category:"configuration",operation:"save-view-preferences-storage",error:t})}}getAllFilterStates(){return{...this.filterState}}getSavedViews(){return this.savedViews.map(t=>({...t,query:br.deepCloneFilterQuery(t.query),viewOptions:t.viewOptions?{...t.viewOptions}:void 0}))}saveView(t,n,a,i){let s={id:this.generateId(),name:t,query:br.deepCloneFilterQuery(n),viewOptions:a?{...a}:void 0,visibleProperties:i?[...i]:void 0};return this.savedViews.push(s),this.saveSavedViewsToPluginData(),this.emit("saved-views-changed",this.getSavedViews()),s}updateView(t,n){let a=this.savedViews.findIndex(s=>s.id===t);if(a===-1)throw new Error(`Saved view with ID ${t} not found`);let i={...n};i.query&&(i.query=br.deepCloneFilterQuery(i.query)),i.viewOptions&&(i.viewOptions={...i.viewOptions}),this.savedViews[a]={...this.savedViews[a],...i},this.saveSavedViewsToPluginData(),this.emit("saved-views-changed",this.getSavedViews())}deleteView(t){let n=this.savedViews.findIndex(a=>a.id===t);if(n===-1)throw new Error(`Saved view with ID ${t} not found`);this.savedViews.splice(n,1),this.saveSavedViewsToPluginData(),this.emit("saved-views-changed",this.getSavedViews())}getSavedView(t){let n=this.savedViews.find(a=>a.id===t);if(n)return{...n,query:br.deepCloneFilterQuery(n.query),viewOptions:n.viewOptions?{...n.viewOptions}:void 0,visibleProperties:n.visibleProperties?[...n.visibleProperties]:void 0}}clearAllSavedViews(){this.savedViews=[],this.saveSavedViewsToPluginData(),this.emit("saved-views-changed",this.getSavedViews())}updateSavedViewProperties(t,n){let a=this.savedViews.find(i=>i.id===t);a&&(a.visibleProperties=n,this.saveSavedViewsToPluginData(),this.emit("saved-views-changed",this.getSavedViews()))}getSavedViewProperties(t){let n=this.savedViews.find(a=>a.id===t);return n==null?void 0:n.visibleProperties}reorderSavedViews(t,n){if(t<0||t>=this.savedViews.length||n<0||n>this.savedViews.length||t===n)return;n=Math.min(n,this.savedViews.length-1);let[a]=this.savedViews.splice(t,1);this.savedViews.splice(n,0,a),this.saveSavedViewsToPluginData(),this.emit("saved-views-changed",this.getSavedViews())}generateId(){return Date.now().toString(36)+Math.random().toString(36).slice(2,11)}async migrateAndLoadSavedViews(){try{this.savedViews=[...this.plugin.settings.savedViews];let t=this.app.loadLocalStorage(this.savedViewsStorageKey);if(t&&typeof t=="string"&&this.savedViews.length===0){let n=JSON.parse(t);this.savedViews=[...n],await this.saveSavedViewsToPluginData(),this.app.saveLocalStorage(this.savedViewsStorageKey,null)}}catch(t){Vm.warn("Failed to load/migrate saved views:",{category:"persistence",operation:"load-migrate-saved-views",error:t}),this.savedViews=[]}}async saveSavedViewsToPluginData(){try{this.plugin.settings.savedViews=[...this.savedViews],await this.plugin.saveSettings()}catch(t){Vm.warn("Failed to save saved views to plugin data:",{category:"persistence",operation:"save-saved-views-plugin-data",error:t})}}needsMigration(){let n=!!this.app.loadLocalStorage(this.savedViewsStorageKey),a=this.plugin.settings.savedViews&&this.plugin.settings.savedViews.length>0;return n&&!a}async performMigration(){try{this.clearAllFilterStates(),await this.migrateAndLoadSavedViews(),this.emit("migration-complete")}catch(t){Vm.error("Error during ViewStateManager migration:",{category:"configuration",operation:"viewstatemanager-migration",error:t}),this.savedViews=[],await this.saveSavedViewsToPluginData()}}cleanup(){this.removeAllListeners()}}});var ODe,D4,lF,LDe=y(()=>{ODe=require("obsidian");qn();K();D4=N({tag:"Services/ProjectSubtasksService"}),lF=class{constructor(e){this.cacheEventRefs=[];this.projectIndex=new Map;this.indexLastBuilt=0;this.INDEX_TTL=3e4;this.stats={indexBuilds:0,indexHits:0,indexMisses:0};this.plugin=e,this.registerCacheInvalidation()}registerCacheInvalidation(){var t;if(!((t=this.plugin.cacheManager)!=null&&t.on))return;let e=()=>this.invalidateIndex();this.cacheEventRefs=[this.plugin.cacheManager.on("file-updated",e),this.plugin.cacheManager.on("file-renamed",e),this.plugin.cacheManager.on("file-deleted",e)]}getFilesLinkingToProject(e){let t=this.plugin.app.metadataCache.resolvedLinks,n=[];for(let[a,i]of Object.entries(t))i&&i[e]>0&&n.push(a);return n}getUnresolvedProjectReferences(e){let n=this.plugin.app.metadataCache.unresolvedLinks[e];return n?Object.keys(n).filter(a=>!a.includes("#")&&!a.includes("|")):[]}async getTasksLinkedToProject(e){try{let t=this.getFilesLinkingToProject(e.path),n=[];for(let a of t){let i=await this.plugin.cacheManager.getTaskInfo(a);i&&await this.isLinkFromProjectsField(a,e.path)&&n.push(i)}return n}catch(t){return D4.error("Error getting tasks linked to project:",{category:"persistence",operation:"getting-tasks-linked-project",error:t}),[]}}async isTaskUsedAsProject(e){return this.isTaskUsedAsProjectSync(e)}async isLinkFromProjectsField(e,t){var n;try{let a=this.plugin.app.vault.getAbstractFileByPath(e);if(!(a instanceof ODe.TFile))return!1;let i=this.plugin.app.metadataCache.getFileCache(a),s=this.plugin.fieldMapper.toUserField("projects");if(!((n=i==null?void 0:i.frontmatter)!=null&&n[s]))return!1;let o=i.frontmatter[s];if(!Array.isArray(o))return!1;for(let l of o){if(!l||typeof l!="string")continue;let c=Et(l);if(c===l&&!l.startsWith("[["))continue;let d=this.plugin.app.metadataCache.getFirstLinkpathDest(c,e);if(d&&d.path===t)return!0}return!1}catch(a){return D4.error("Error checking if link is from projects field:",{category:"persistence",operation:"checking-if-link-projects-field",error:a}),!1}}isTaskUsedAsProjectSync(e){return this.ensureIndexBuilt(),this.projectIndex.has(e)?(this.stats.indexHits++,this.projectIndex.get(e)):(this.stats.indexMisses++,!1)}buildProjectIndex(){this.projectIndex.clear(),this.stats.indexBuilds++;try{let e=this.plugin.app.metadataCache.resolvedLinks,t=new Set;for(let[n,a]of Object.entries(e)){if(!a)continue;let i=this.plugin.app.metadataCache.getCache(n);if(!(i!=null&&i.frontmatter)||!this.plugin.cacheManager.isTaskFile(i.frontmatter))continue;let s=this.plugin.fieldMapper.toUserField("projects"),o=i.frontmatter[s];if(Array.isArray(o))for(let l of o){if(!l||typeof l!="string")continue;let c=Et(l);if(c===l&&!l.startsWith("[["))continue;let d=this.plugin.app.metadataCache.getFirstLinkpathDest(c,n);d&&t.add(d.path)}}for(let n of t)this.projectIndex.set(n,!0);this.indexLastBuilt=Date.now()}catch(e){D4.error("Error building project index:",{category:"persistence",operation:"building-project-index",error:e})}}ensureIndexBuilt(){Date.now()-this.indexLastBuilt>this.INDEX_TTL&&this.buildProjectIndex()}invalidateIndex(){this.projectIndex.clear(),this.indexLastBuilt=0}destroy(){for(let e of this.cacheEventRefs)this.plugin.cacheManager.offref(e);this.cacheEventRefs=[],this.invalidateIndex(),this.stats={indexBuilds:0,indexHits:0,indexMisses:0}}sortTasks(e){return e.sort((t,n)=>{let a=this.plugin.statusManager.isCompletedStatus(t.status),i=this.plugin.statusManager.isCompletedStatus(n.status);if(a!==i)return a?1:-1;let s=this.plugin.priorityManager.getPriorityWeight(t.priority),o=this.plugin.priorityManager.getPriorityWeight(n.priority);return s!==o?o-s:t.due&&n.due?new Date(t.due).getTime()-new Date(n.due).getTime():t.due?-1:n.due?1:t.title.localeCompare(n.title)})}}});var cF,zDe=y(()=>{cF=class{constructor(e){this.expandedProjects=new Set;this.collapsedDefaultExpandedProjects=new Set;this.plugin=e}isExpanded(e,t=!1){return t?!this.collapsedDefaultExpandedProjects.has(e):this.expandedProjects.has(e)}toggle(e,t=!1){return t?this.collapsedDefaultExpandedProjects.has(e)?(this.collapsedDefaultExpandedProjects.delete(e),!0):(this.collapsedDefaultExpandedProjects.add(e),this.expandedProjects.delete(e),!1):(this.collapsedDefaultExpandedProjects.delete(e),this.expandedProjects.has(e)?(this.expandedProjects.delete(e),!1):(this.expandedProjects.add(e),!0))}setExpanded(e,t,n=!1){if(n){t?this.collapsedDefaultExpandedProjects.delete(e):(this.collapsedDefaultExpandedProjects.add(e),this.expandedProjects.delete(e));return}this.collapsedDefaultExpandedProjects.delete(e),t?this.expandedProjects.add(e):this.expandedProjects.delete(e)}renamePath(e,t){e!==t&&(this.expandedProjects.delete(e)&&this.expandedProjects.add(t),this.collapsedDefaultExpandedProjects.delete(e)&&this.collapsedDefaultExpandedProjects.add(t))}getExpandedProjects(){return Array.from(this.expandedProjects)}clearAll(){this.expandedProjects.clear(),this.collapsedDefaultExpandedProjects.clear()}collapseAll(){this.clearAll()}}});var Ib,dF,jDe=y(()=>{K();Ib=N({tag:"Services/AutoArchiveService"}),dF=class{constructor(e){this.processorTimer=null;this.isRunning=!1;this.PROCESSOR_INTERVAL_MS=6e4;this.plugin=e}hasGoogleCalendarLink(e){return!!e.googleCalendarEventId}normalizeStatusValue(e){return typeof e=="boolean"?e?"true":"false":String(e)}getCalendarCleanupState(){let e=this.plugin.settings.googleCalendarExport;return!(e!=null&&e.enabled)||!(e!=null&&e.syncOnTaskDelete)?"skip":this.plugin.taskCalendarSyncService&&this.plugin.taskCalendarSyncService.isEnabled()?"ready":"retry"}async start(){this.stop(),this.isRunning=!0,await this.processQueue(),this.scheduleNextProcess()}stop(){this.isRunning=!1,this.processorTimer!==null&&(window.clearTimeout(this.processorTimer),this.processorTimer=null)}scheduleNextProcess(){this.isRunning&&(this.processorTimer=window.setTimeout(()=>{this.processorTimer=null,this.processQueue().catch(e=>{Ib.error("Error processing auto-archive queue:",{category:"persistence",operation:"processing-auto-archive-queue",error:e})}).finally(()=>{this.isRunning&&this.scheduleNextProcess()})},this.PROCESSOR_INTERVAL_MS))}async scheduleAutoArchive(e,t){if(!t.autoArchive)return;if(e.recurrence){await this.cancelAutoArchive(e.path);return}let n=Date.now(),a=n+t.autoArchiveDelay*60*1e3,i={taskPath:e.path,statusChangeTimestamp:n,archiveAfterTimestamp:a,statusValue:t.value};await this.cancelAutoArchive(e.path);let s=await this.getQueue();s.push(i),await this.saveQueue(s)}async cancelAutoArchive(e){let t=await this.getQueue(),n=t.filter(a=>a.taskPath!==e);n.length!==t.length&&await this.saveQueue(n)}async processQueue(){let e=await this.getQueue();if(e.length===0)return;let t=Date.now(),n=[],a=[];for(let o of e)t>=o.archiveAfterTimestamp?n.push(o):a.push(o);if(n.length===0)return;let i=[];for(let o of n)try{await this.processItem(o)||i.push(o)}catch(l){Ib.error(`Error processing auto-archive for ${o.taskPath}:`,{category:"persistence",operation:"processing-auto-archive",error:l}),i.push(o)}let s=[...i,...a];await this.saveQueue(s)}async processItem(e){let t=await this.plugin.cacheManager.getTaskByPath(e.taskPath);if(!t||this.normalizeStatusValue(t.status)!==this.normalizeStatusValue(e.statusValue))return!0;if(t.archived){if(this.hasGoogleCalendarLink(t)){let n=this.getCalendarCleanupState();if(n==="skip")return!0;if(n==="retry")return Ib.warn(`Auto-archive Google cleanup deferred until calendar sync is ready for ${e.taskPath}`,{category:"provider",operation:"auto-archive-google-cleanup-deferred-until-calendar-sync-ready"}),!1;let a=await this.plugin.taskCalendarSyncService.deleteTaskFromCalendar(t);return a||Ib.warn(`Auto-archive Google cleanup still pending for ${e.taskPath}`,{category:"provider",operation:"auto-archive-google-cleanup-still-pending"}),a}return!0}try{let n=await this.plugin.taskService.toggleArchive(t);if(n.archived&&this.hasGoogleCalendarLink(n)){e.taskPath=n.path;let a=this.getCalendarCleanupState();return a==="skip"?!0:(a==="retry"&&Ib.warn(`Auto-archive Google cleanup deferred until calendar sync is ready for ${e.taskPath}`,{category:"provider",operation:"auto-archive-google-cleanup-deferred-until-calendar-sync-ready"}),!1)}return!0}catch(n){return Ib.error(`Failed to archive task ${e.taskPath}:`,{category:"persistence",operation:"archive-task",error:n}),!1}}async getQueue(){let e=await this.plugin.loadData();return(e==null?void 0:e.autoArchiveQueue)||[]}async saveQueue(e){let t=await this.plugin.loadPluginDataForSafeWrite("save-auto-archive-queue");t&&(t.autoArchiveQueue=e,await this.plugin.saveData(t))}async clearQueue(){await this.saveQueue([])}async getQueueStatus(){let e=await this.getQueue();return{count:e.length,items:e}}}});function qm(r,e){for(var t in e)r[t]=e[t];return r}function GDe(r){var e=r.parentNode;e&&e.removeChild(r)}function _(r,e,t){var n,a,i,s={};for(i in e)i=="key"?n=e[i]:i=="ref"?a=e[i]:s[i]=e[i];if(arguments.length>2&&(s.children=arguments.length>3?hF.call(arguments,2):t),typeof r=="function"&&r.defaultProps!=null)for(i in r.defaultProps)s[i]===void 0&&(s[i]=r.defaultProps[i]);return uF(r,s,n,a,null)}function uF(r,e,t,n,a){var i={type:r,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:a==null?++VDe:a};return a==null&&Ue.vnode!=null&&Ue.vnode(i),i}function En(){return{current:null}}function Gt(r){return r.children}function sdt(r,e,t,n,a){var i;for(i in t)i==="children"||i==="key"||i in e||mF(r,i,null,t[i],n);for(i in e)a&&typeof e[i]!="function"||i==="children"||i==="key"||i==="value"||i==="checked"||t[i]===e[i]||mF(r,i,e[i],t[i],n)}function BDe(r,e,t){e[0]==="-"?r.setProperty(e,t==null?"":t):r[e]=t==null?"":typeof t!="number"||idt.test(e)?t:t+"px"}function mF(r,e,t,n,a){var i;e:if(e==="style")if(typeof t=="string")r.style.cssText=t;else{if(typeof n=="string"&&(r.style.cssText=n=""),n)for(e in n)t&&e in t||BDe(r.style,e,"");if(t)for(e in t)n&&t[e]===n[e]||BDe(r.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")i=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in r?e.toLowerCase().slice(2):e.slice(2),r.l||(r.l={}),r.l[e+i]=t,t?n||r.addEventListener(e,i?HDe:UDe,i):r.removeEventListener(e,i?HDe:UDe,i);else if(e!=="dangerouslySetInnerHTML"){if(a)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e in r)try{r[e]=t==null?"":t;break e}catch(s){}typeof t=="function"||(t==null||t===!1&&e.indexOf("-")==-1?r.removeAttribute(e):r.setAttribute(e,t))}}function UDe(r){Nb=!0;try{return this.l[r.type+!1](Ue.event?Ue.event(r):r)}finally{Nb=!1}}function HDe(r){Nb=!0;try{return this.l[r.type+!0](Ue.event?Ue.event(r):r)}finally{Nb=!1}}function Ha(r,e){this.props=r,this.context=e}function dD(r,e){if(e==null)return r.__?dD(r.__,r.__.__k.indexOf(r)+1):null;for(var t;ee&&Eg.sort(function(l,c){return l.__v.__b-c.__v.__b}));fF.__r=0}function ZDe(r,e,t,n,a,i,s,o,l,c){var d,u,p,m,f,h,g,v=n&&n.__k||YDe,b=v.length;for(t.__k=[],d=0;d0?uF(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)!=null){if(m.__=t,m.__b=t.__b+1,(p=v[d])===null||p&&m.key==p.key&&m.type===p.type)v[d]=void 0;else for(u=0;u=0;e--)if((t=r.__k[e])&&(n=XDe(t)))return n}return null}function A4(r,e,t,n,a,i,s,o,l){var c,d,u,p,m,f,h,g,v,b,k,w,S,C,E,D=e.type;if(e.constructor!==void 0)return null;t.__h!=null&&(l=t.__h,o=e.__e=t.__e,e.__h=null,i=[o]),(c=Ue.__b)&&c(e);try{e:if(typeof D=="function"){if(g=e.props,v=(c=D.contextType)&&n[c.__c],b=c?v?v.props.value:c.__:n,t.__c?h=(d=e.__c=t.__c).__=d.__E:("prototype"in D&&D.prototype.render?e.__c=d=new D(g,b):(e.__c=d=new Ha(g,b),d.constructor=D,d.render=cdt),v&&v.sub(d),d.props=g,d.state||(d.state={}),d.context=b,d.__n=n,u=d.__d=!0,d.__h=[],d._sb=[]),d.__s==null&&(d.__s=d.state),D.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=qm({},d.__s)),qm(d.__s,D.getDerivedStateFromProps(g,d.__s))),p=d.props,m=d.state,d.__v=e,u)D.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(D.getDerivedStateFromProps==null&&g!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(g,b),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(g,d.__s,b)===!1||e.__v===t.__v){for(e.__v!==t.__v&&(d.props=g,d.state=d.__s,d.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(P){P&&(P.__=e)}),k=0;k{pF={},YDe=[],idt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;hF=YDe.slice,Ue={__e:function(r,e,t,n){for(var a,i,s;e=e.__;)if((a=e.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(r)),s=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(r,n||{}),s=a.__d),s)return a.__E=a}catch(o){r=o}throw r}},VDe=0,M4=function(r){return r!=null&&r.constructor===void 0},Nb=!1,Ha.prototype.setState=function(r,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=qm({},this.state),typeof r=="function"&&(r=r(qm({},t),this.props)),r&&qm(t,r),r!=null&&this.__v&&(e&&this._sb.push(e),P4(this))},Ha.prototype.forceUpdate=function(r){this.__v&&(this.__e=!0,r&&this.__h.push(r),P4(this))},Ha.prototype.render=Gt,Eg=[],qDe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fF.__r=0,WDe=0});function pdt(){for(var r;r=dPe.shift();)if(r.__P&&r.__H)try{r.__H.__h.forEach(yF),r.__H.__h.forEach(N4),r.__H.__h=[]}catch(e){r.__H.__h=[],Ue.__e(e,r.__v)}}function mdt(r){var e,t=function(){clearTimeout(n),cPe&&cancelAnimationFrame(e),setTimeout(r)},n=setTimeout(t,100);cPe&&(e=requestAnimationFrame(t))}function yF(r){var e=od,t=r.__c;typeof t=="function"&&(r.__c=void 0,t()),od=e}function N4(r){var e=od;r.__c=r.__(),od=e}var udt,od,_4,nPe,dPe,I4,aPe,iPe,sPe,oPe,lPe,cPe,R4=y(()=>{Ku();dPe=[],I4=[],aPe=Ue.__b,iPe=Ue.__r,sPe=Ue.diffed,oPe=Ue.__c,lPe=Ue.unmount;Ue.__b=function(r){od=null,aPe&&aPe(r)},Ue.__r=function(r){iPe&&iPe(r),udt=0;var e=(od=r.__c).__H;e&&(_4===od?(e.__h=[],od.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=I4,t.__N=t.i=void 0})):(e.__h.forEach(yF),e.__h.forEach(N4),e.__h=[])),_4=od},Ue.diffed=function(r){sPe&&sPe(r);var e=r.__c;e&&e.__H&&(e.__H.__h.length&&(dPe.push(e)!==1&&nPe===Ue.requestAnimationFrame||((nPe=Ue.requestAnimationFrame)||mdt)(pdt)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==I4&&(t.__=t.__V),t.i=void 0,t.__V=I4})),_4=od=null},Ue.__c=function(r,e){e.some(function(t){try{t.__h.forEach(yF),t.__h=t.__h.filter(function(n){return!n.__||N4(n)})}catch(n){e.some(function(a){a.__h&&(a.__h=[])}),e=[],Ue.__e(n,t.__v)}}),oPe&&oPe(r,e)},Ue.unmount=function(r){lPe&&lPe(r);var e,t=r.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{yF(n)}catch(a){e=a}}),t.__H=void 0,e&&Ue.__e(e,t.__v))};cPe=typeof requestAnimationFrame=="function"});function fdt(r,e){for(var t in e)r[t]=e[t];return r}function uPe(r,e){for(var t in r)if(t!=="__source"&&!(t in e))return!0;for(var n in e)if(n!=="__source"&&r[n]!==e[n])return!0;return!1}function pPe(r){this.props=r}function bPe(r,e,t){return r&&(r.__c&&r.__c.__H&&(r.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),r.__c.__H=null),(r=fdt({},r)).__c!=null&&(r.__c.__P===t&&(r.__c.__P=e),r.__c=null),r.__k=r.__k&&r.__k.map(function(n){return bPe(n,e,t)})),r}function TPe(r,e,t){return r&&(r.__v=null,r.__k=r.__k&&r.__k.map(function(n){return TPe(n,e,t)}),r.__c&&r.__c.__P===e&&(r.__e&&t.insertBefore(r.__e,r.__d),r.__c.__e=!0,r.__c.__P=t)),r}function F4(){this.__u=0,this.t=null,this.__b=null}function wPe(r){var e=r.__.__c;return e&&e.__a&&e.__a(r)}function vF(){this.u=null,this.o=null}function gdt(r){return this.getChildContext=function(){return r.context},r.children}function ydt(r){var e=this,t=r.i;e.componentWillUnmount=function(){Wm(null,e.l),e.l=null,e.i=null},e.i&&e.i!==t&&e.componentWillUnmount(),r.__v?(e.l||(e.i=t,e.l={nodeType:1,parentNode:t,childNodes:[],appendChild:function(n){this.childNodes.push(n),e.i.appendChild(n)},insertBefore:function(n,a){this.childNodes.push(n),e.i.appendChild(n)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),e.i.removeChild(n)}}),Wm(_(gdt,{context:e.context},r.__v),e.l)):e.l&&e.componentWillUnmount()}function O4(r,e){var t=_(ydt,{__v:r,i:e});return t.containerInfo=e,t}function wdt(){}function Sdt(){return this.cancelBubble}function xdt(){return this.defaultPrevented}var mPe,SLr,hdt,fPe,hPe,vdt,kdt,bdt,Tdt,gPe,Cdt,yPe,vPe,kPe,pD=y(()=>{Ku();Ku();R4();R4();(pPe.prototype=new Ha).isPureReactComponent=!0,pPe.prototype.shouldComponentUpdate=function(r,e){return uPe(this.props,r)||uPe(this.state,e)};mPe=Ue.__b;Ue.__b=function(r){r.type&&r.type.__f&&r.ref&&(r.props.ref=r.ref,r.ref=null),mPe&&mPe(r)};SLr=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,hdt=Ue.__e;Ue.__e=function(r,e,t,n){if(r.then){for(var a,i=e;i=i.__;)if((a=i.__c)&&a.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),a.__c(r,e)}hdt(r,e,t,n)};fPe=Ue.unmount;Ue.unmount=function(r){var e=r.__c;e&&e.__R&&e.__R(),e&&r.__h===!0&&(r.type=null),fPe&&fPe(r)},(F4.prototype=new Ha).__c=function(r,e){var t=e.__c,n=this;n.t==null&&(n.t=[]),n.t.push(t);var a=wPe(n.__v),i=!1,s=function(){i||(i=!0,t.__R=null,a?a(o):o())};t.__R=s;var o=function(){if(!--n.__u){if(n.state.__a){var c=n.state.__a;n.__v.__k[0]=TPe(c,c.__c.__P,c.__c.__O)}var d;for(n.setState({__a:n.__b=null});d=n.t.pop();)d.forceUpdate()}},l=e.__h===!0;n.__u++||l||n.setState({__a:n.__b=n.__v.__k[0]}),r.then(s,s)},F4.prototype.componentWillUnmount=function(){this.t=[]},F4.prototype.render=function(r,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=bPe(this.__b,t,n.__O=n.__P)}this.__b=null}var a=e.__a&&_(Gt,null,r.fallback);return a&&(a.__h=null),[_(Gt,null,e.__a?null:r.children),a]};hPe=function(r,e,t){if(++t[1]===t[0]&&r.o.delete(e),r.props.revealOrder&&(r.props.revealOrder[0]!=="t"||!r.o.size))for(t=r.u;t;){for(;t.length>3;)t.pop()();if(t[1]{jPe(e,r)})}function LPe(r){r.isConnected&&r.getRootNode&&zPe(r.getRootNode())}function zPe(r){let e=Y4.get(r);if(!e||!e.isConnected){if(e=r.querySelector("style[data-fullcalendar]"),!e){e=document.createElement("style"),e.setAttribute("data-fullcalendar","");let t=Ddt();t&&(e.nonce=t);let n=r===document?document.head:r,a=r===document?n.querySelector("script,link[rel=stylesheet],link[as=style],style"):n.firstChild;n.insertBefore(e,a)}Y4.set(r,e),Edt(e)}}function Edt(r){for(let e of OPe)jPe(r,e)}function jPe(r,e){let{sheet:t}=r,n=t.cssRules.length;e.split("}").forEach((a,i)=>{a=a.trim(),a&&t.insertRule(a+"}",n+i)})}function Ddt(){return L4===void 0&&(L4=Pdt()),L4}function Pdt(){let r=document.querySelector('meta[name="csp-nonce"]');if(r&&r.hasAttribute("content"))return r.getAttribute("content");let e=document.querySelector("script[nonce]");return e&&e.nonce||""}function PD(r){r.parentNode&&r.parentNode.removeChild(r)}function ya(r,e){if(r.closest)return r.closest(e);if(!document.documentElement.contains(r))return null;do{if(FF(r,e))return r;r=r.parentElement||r.parentNode}while(r!==null&&r.nodeType===1);return null}function FF(r,e){return(r.matches||r.matchesSelector||r.msMatchesSelector).call(r,e)}function $Pe(r,e){let t=r instanceof HTMLElement?[r]:r,n=[];for(let a=0;a{let n=ya(t.target,r);n&&e.call(n,t,n)}}function a3(r,e,t,n){let a=_dt(t,n);return r.addEventListener(e,a),()=>{r.removeEventListener(e,a)}}function BPe(r,e,t,n){let a;return a3(r,"mouseover",e,(i,s)=>{if(s!==a){a=s,t(i,s);let o=l=>{a=null,n(l,s),s.removeEventListener("mouseleave",o)};s.addEventListener("mouseleave",o)}})}function i3(r,e){let t=n=>{e(n),xPe.forEach(a=>{r.removeEventListener(a,t)})};xPe.forEach(n=>{r.addEventListener(n,t)})}function UPe(r){return Object.assign({onClick:r},HPe(r))}function HPe(r){return{tabIndex:0,onKeyDown(e){(e.key==="Enter"||e.key===" ")&&(r(e),e.preventDefault())}}}function tp(){return CPe+=1,String(CPe)}function jb(){document.body.classList.add("fc-not-allowed")}function $b(){document.body.classList.remove("fc-not-allowed")}function s3(r){r.style.userSelect="none",r.style.webkitUserSelect="none",r.addEventListener("selectstart",MD)}function o3(r){r.style.userSelect="",r.style.webkitUserSelect="",r.removeEventListener("selectstart",MD)}function l3(r){r.addEventListener("contextmenu",MD)}function c3(r){r.removeEventListener("contextmenu",MD)}function VPe(r){let e=[],t=[],n,a;for(typeof r=="string"?t=r.split(/\s*,\s*/):typeof r=="function"?t=[r]:Array.isArray(r)&&(t=r),n=0;nn.replace("$"+i,a||""),r):t}function d3(r,e){return r-e}function mD(r){return r%1===0}function Ndt(r){let e=r.querySelector(".fc-scrollgrid-shrink-frame"),t=r.querySelector(".fc-scrollgrid-shrink-cushion");if(!e)throw new Error("needs fc-scrollgrid-shrink-frame className");if(!t)throw new Error("needs fc-scrollgrid-shrink-cushion className");return r.getBoundingClientRect().width-e.getBoundingClientRect().width+t.getBoundingClientRect().width}function mt(r,e){return typeof r=="string"?Fdt(r):typeof r=="object"&&r?DPe(r):typeof r=="number"?DPe({[e||"milliseconds"]:r}):null}function Fdt(r){let e=Rdt.exec(r);if(e){let t=e[1]?-1:1;return{years:0,months:0,days:t*(e[2]?parseInt(e[2],10):0),milliseconds:t*((e[3]?parseInt(e[3],10):0)*60*60*1e3+(e[4]?parseInt(e[4],10):0)*60*1e3+(e[5]?parseInt(e[5],10):0)*1e3+(e[6]?parseInt(e[6],10):0))}}return null}function DPe(r){let e={years:r.years||r.year||0,months:r.months||r.month||0,days:r.days||r.day||0,milliseconds:(r.hours||r.hour||0)*60*60*1e3+(r.minutes||r.minute||0)*60*1e3+(r.seconds||r.second||0)*1e3+(r.milliseconds||r.millisecond||r.ms||0)},t=r.weeks||r.week;return t&&(e.days+=t*7,e.specifiedWeeks=!0),e}function Odt(r,e){return r.years===e.years&&r.months===e.months&&r.days===e.days&&r.milliseconds===e.milliseconds}function AD(r,e){return{years:r.years+e.years,months:r.months+e.months,days:r.days+e.days,milliseconds:r.milliseconds+e.milliseconds}}function YPe(r,e){return{years:r.years-e.years,months:r.months-e.months,days:r.days-e.days,milliseconds:r.milliseconds-e.milliseconds}}function u3(r,e){return{years:r.years*e,months:r.months*e,days:r.days*e,milliseconds:r.milliseconds*e}}function Ldt(r){return Rb(r)/365}function zdt(r){return Rb(r)/30}function Rb(r){return lo(r)/864e5}function lo(r){return r.years*(365*864e5)+r.months*(30*864e5)+r.days*864e5+r.milliseconds}function _D(r,e){let t=null;for(let n=0;n=1?Math.min(a,i):a}function z4(r,e,t,n){let a=ys([e,0,1+Ydt(e,t,n)]),i=gr(r),s=Math.round(md(a,i));return Math.floor(s/7)+1}function Ydt(r,e,t){let n=7+e-t;return-((7+ys([r,0,n]).getUTCDay()-e)%7)+n-1}function PPe(r){return[r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()]}function MPe(r){return new Date(r[0],r[1]||0,r[2]==null?1:r[2],r[3]||0,r[4]||0,r[5]||0)}function Gm(r){return[r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()]}function ys(r){return r.length===1&&(r=r.concat([0])),new Date(Date.UTC(...r))}function m3(r){return!isNaN(r.valueOf())}function Km(r){return r.getUTCHours()*1e3*60*60+r.getUTCMinutes()*1e3*60+r.getUTCSeconds()*1e3+r.getUTCMilliseconds()}function zF(r,e,t=!1){let n=r.toISOString();return n=n.replace(".000",""),t&&(n=n.replace("T00:00:00Z","")),n.length>10&&(e==null?n=n.replace("Z",""):e!==0&&(n=n.replace("Z",h3(e,!0)))),n}function ef(r){return r.toISOString().replace(/T.*$/,"")}function Ub(r){return r.toISOString().match(/^\d{4}-\d{2}/)[0]}function f3(r){return Pg(r.getUTCHours(),2)+":"+Pg(r.getUTCMinutes(),2)+":"+Pg(r.getUTCSeconds(),2)}function h3(r,e=!1){let t=r<0?"-":"+",n=Math.abs(r),a=Math.floor(n/60),i=Math.round(n%60);return e?`${t+Pg(a,2)}:${Pg(i,2)}`:`GMT${t}${a}${i?`:${Pg(i,2)}`:""}`}function _e(r,e,t){let n,a;return function(...i){if(!n)a=r.apply(this,i);else if(!pd(n,i)){t&&t(a);let s=r.apply(this,i);(!e||!e(s,a))&&(a=s)}return n=i,a}}function Hb(r,e,t){let n,a;return i=>{if(!n)a=r.call(this,i);else if(!gi(n,i)){t&&t(a);let s=r.call(this,i);(!e||!e(s,a))&&(a=s)}return n=i,a}}function APe(r,e,t){let n=Object.keys(r).length;return n===1&&r.timeZoneName==="short"?a=>h3(a.timeZoneOffset):n===0&&e.week?a=>rut(t.computeWeekNumber(a.marker),t.weekText,t.weekTextLong,t.locale,e.week):Jdt(r,e,t)}function Jdt(r,e,t){r=Object.assign({},r),e=Object.assign({},e),Xdt(r,e),r.timeZone="UTC";let n=new Intl.DateTimeFormat(t.locale.codes,r),a;if(e.omitZeroMinute){let i=Object.assign({},r);delete i.minute,a=new Intl.DateTimeFormat(t.locale.codes,i)}return i=>{let{marker:s}=i,o;a&&!s.getUTCMinutes()?o=a:o=n;let l=o.format(s);return eut(l,i,r,e,t)}}function Xdt(r,e){r.timeZoneName&&(r.hour||(r.hour="2-digit"),r.minute||(r.minute="2-digit")),r.timeZoneName==="long"&&(r.timeZoneName="short"),e.omitZeroMinute&&(r.second||r.millisecond)&&delete e.omitZeroMinute}function eut(r,e,t,n,a){return r=r.replace(Zdt,""),t.timeZoneName==="short"&&(r=tut(r,a.timeZone==="UTC"||e.timeZoneOffset==null?"UTC":h3(e.timeZoneOffset))),n.omitCommas&&(r=r.replace(Gdt,"").trim()),n.omitZeroMinute&&(r=r.replace(":00","")),n.meridiem===!1?r=r.replace(kF,"").trim():n.meridiem==="narrow"?r=r.replace(kF,(i,s)=>s.toLocaleLowerCase()):n.meridiem==="short"?r=r.replace(kF,(i,s)=>`${s.toLocaleLowerCase()}m`):n.meridiem==="lowercase"&&(r=r.replace(kF,i=>i.toLocaleLowerCase())),r=r.replace(Kdt," "),r=r.trim(),r}function tut(r,e){let t=!1;return r=r.replace(Qdt,()=>(t=!0,e)),t||(r+=` ${e}`),r}function rut(r,e,t,n,a){let i=[];return a==="long"?i.push(t):(a==="short"||a==="narrow")&&i.push(e),(a==="long"||a==="short")&&i.push(" "),i.push(n.simpleNumberFormat.format(r)),n.options.direction==="rtl"&&i.reverse(),i.join("")}function nut(r,e,t){return t.getMarkerYear(r)!==t.getMarkerYear(e)?5:t.getMarkerMonth(r)!==t.getMarkerMonth(e)?4:t.getMarkerDay(r)!==t.getMarkerDay(e)?2:Km(r)!==Km(e)?1:0}function aut(r,e){let t={};for(let n in r)(!(n in EF)||EF[n]<=e)&&(t[n]=r[n]);return t}function iut(r,e,t,n){let a=0;for(;a=0;i-=1){let s=r[i][n];if(typeof s=="object"&&s)a.unshift(s);else if(s!==void 0){t[n]=s;break}}a.length&&(t[n]=$F(a))}}for(let n=r.length-1;n>=0;n-=1){let a=r[n];for(let i in a)i in t||(t[i]=a[i])}return t}function Zu(r,e){let t={};for(let n in r)e(r[n],n)&&(t[n]=r[n]);return t}function el(r,e){let t={};for(let n in r)t[n]=e(r[n],n);return t}function k3(r){let e={};for(let t of r)e[t]=!0;return e}function BF(r){let e=[];for(let t in r)e.push(r[t]);return e}function gi(r,e){if(r===e)return!0;for(let t in r)if(PF.call(r,t)&&!(t in e))return!1;for(let t in e)if(PF.call(e,t)&&r[t]!==e[t])return!1;return!0}function out(r,e){let t=lut(r,e);for(let n of t)if(!sut.test(n))return!1;return!0}function lut(r,e){let t=[];for(let n in r)PF.call(r,n)&&(n in e||t.push(n));for(let n in e)PF.call(e,n)&&r[n]!==e[n]&&t.push(n);return t}function xF(r,e,t={}){if(r===e)return!0;for(let n in e)if(!(n in r&&cut(r[n],e[n],t[n])))return!1;for(let n in r)if(!(n in e))return!1;return!0}function cut(r,e,t){return r===e||t===!0?!0:t?t(r,e):!1}function QPe(r,e=0,t,n=1){let a=[];t==null&&(t=Object.keys(r).length);for(let i=e;i{this.props.value!==s.value&&i.forEach(o=>{o.context=s.value,o.forceUpdate()})},this.sub=s=>{i.push(s);let o=s.componentWillUnmount;s.componentWillUnmount=()=>{i.splice(i.indexOf(s),1),o&&o.call(s)}}}return a},e}function t0e(r,e,t,n,a,i,s,o,l,c,d,u,p,m){return{dateEnv:a,nowManager:i,options:t,pluginHooks:o,emitter:d,dispatch:l,getCurrentData:c,calendarApi:u,viewSpec:r,viewApi:e,dateProfileGenerator:n,theme:s,isRtl:t.direction==="rtl",addResizeHandler(f){d.on("_resize",f)},removeResizeHandler(f){d.off("_resize",f)},createScrollResponder(f){return new MF(f,d,mt(t.scrollTime),t.scrollTimeReset)},registerInteractiveComponent:p,unregisterInteractiveComponent:m}}function mut(r){let e=Object.create(this.prototype.propEquality);Object.assign(e,r),this.prototype.propEquality=e}function fut(r){let e=Object.create(this.prototype.stateEquality);Object.assign(e,r),this.prototype.stateEquality=e}function uo(r,e){typeof r=="function"?r(e):r&&(r.current=e)}function X4(r,e){var t;return!!(e.handleCustomRendering&&r&&(!((t=e.customRenderingMetaMap)===null||t===void 0)&&t[r]))}function b3(r,e,t){let n=Object.assign(Object.assign({},r.elAttrs),{ref:t});return(r.elClasses||e)&&(n.className=(r.elClasses||[]).concat(e||[]).concat(n.className||[]).filter(Boolean).join(" ")),r.elStyle&&(n.style=r.elStyle),n}function hut(r){return!!r}function gut(r,e){let t=r.props;return _(yD,Object.assign({renderProps:t.renderProps,generatorName:t.generatorName,customGenerator:t.customGenerator,defaultGenerator:t.defaultGenerator,renderId:r.context},e))}function yut(r,e){let t=typeof r=="function"?r(e):r||[];return typeof t=="string"?[t]:t}function w3(r){return[`fc-${r.type}-view`,"fc-view"]}function vut(r,e){let t=null,n=null;return r.start&&(t=e.createMarker(r.start)),r.end&&(n=e.createMarker(r.end)),!t&&!n||t&&n&&nn&&t.push({start:n,end:i.start}),i.end>n&&(n=i.end);return ne.start)&&(r.start===null||e.end===null||r.start=r.start)&&(r.end===null||e.end!==null&&e.end<=r.end)}function Xo(r,e){return(r.start===null||e>=r.start)&&(r.end===null||e=e.end?new Date(e.end.valueOf()-1):r}function n0e(r){let e=Math.floor(md(r.start,r.end))||1,t=gr(r.start),n=hn(t,e);return{start:t,end:n}}function HF(r,e=mt(0)){let t=null,n=null;if(r.end){n=gr(r.end);let a=r.end.valueOf()-n.valueOf();a&&a>=lo(e)&&(n=hn(n,1))}return r.start&&(t=gr(r.start),n&&n<=t&&(n=hn(t,1))),{start:t,end:n}}function S3(r){let e=HF(r);return md(e.start,e.end)>1}function Zm(r,e,t,n){return n==="year"?mt(t.diffWholeYears(r,e),"year"):n==="month"?mt(t.diffWholeMonths(r,e),"month"):GPe(r,e)}function qb(r,e,t,n){return{instanceId:tp(),defId:r,range:e,forcedStartTzo:t==null?null:t,forcedEndTzo:n==null?null:n}}function Tut(r,e,t,n){for(let a=0;a!s[l.defId].recurringDef);for(let l in s){let c=s[l];if(c.recurringDef){let{duration:d}=c.recurringDef;d||(d=c.allDay?i.defaultAllDayEventDuration:i.defaultTimedEventDuration);let u=wut(c,d,e,n,a.recurringTypes);for(let p of u){let m=qb(l,{start:p,end:n.add(p,d)});o[m.instanceId]=m}}}return{defs:s,instances:o}}function wut(r,e,t,n,a){let s=a[r.recurringDef.typeId].expand(r.recurringDef.typeData,{start:n.subtract(t.start,e),end:t.end},n);return r.allDay&&(s=s.map(gr)),s}function i0e(r,e,t,n,a=x3(t),i,s){let{refined:o,extra:l}=ND(r,t,a),c=Cut(e,t),d=Tut(o,c,t.dateEnv,t.pluginHooks.recurringTypes);if(d){let p=Ob(o,l,e?e.sourceId:"",d.allDay,!!d.duration,t,i);return p.recurringDef={typeId:d.typeId,typeData:d.typeData,duration:d.duration},{def:p,instance:null}}let u=xut(o,c,t,n);if(u){let p=Ob(o,l,e?e.sourceId:"",u.allDay,u.hasEnd,t,i),m=qb(p.defId,u.range,u.forcedStartTzo,u.forcedEndTzo);return s&&p.publicId&&s[p.publicId]&&(m.instanceId=s[p.publicId]),{def:p,instance:m}}return null}function ND(r,e,t=x3(e)){return ID(r,t)}function x3(r){return Object.assign(Object.assign(Object.assign({},AF),Sut),r.pluginHooks.eventRefiners)}function Ob(r,e,t,n,a,i,s){let o={title:r.title||"",groupId:r.groupId||"",publicId:r.id||"",url:r.url||"",recurringDef:null,defId:(s&&r.id?s[r.id]:"")||tp(),sourceId:t,allDay:n,hasEnd:a,interactive:r.interactive,ui:Wb(r,i),extendedProps:Object.assign(Object.assign({},r.extendedProps||{}),e)};for(let l of i.pluginHooks.eventDefMemberAdders)Object.assign(o,l(r));return Object.freeze(o.ui.classNames),Object.freeze(o.extendedProps),o}function xut(r,e,t,n){let{allDay:a}=r,i,s=null,o=!1,l,c=null,d=r.start!=null?r.start:r.date;if(i=t.dateEnv.createMarkerMeta(d),i)s=i.marker;else if(!n)return null;return r.end!=null&&(l=t.dateEnv.createMarkerMeta(r.end)),a==null&&(e!=null?a=e:a=(!i||i.isTimeUnspecified)&&(!l||l.isTimeUnspecified)),a&&s&&(s=gr(s)),l&&(c=l.marker,a&&(c=gr(c)),s&&c<=s&&(c=null)),c?o=!0:n||(o=t.options.forceEventDuration||!1,c=t.dateEnv.add(s,a?t.options.defaultAllDayEventDuration:t.options.defaultTimedEventDuration)),{allDay:a,hasEnd:o,range:{start:s,end:c},forcedStartTzo:i?i.forcedTzo:null,forcedEndTzo:l?l.forcedTzo:null}}function Cut(r,e){let t=null;return r&&(t=r.defaultAllDay),t==null&&(t=e.options.defaultAllDay),t}function vD(r,e,t,n,a,i){let s=va(),o=x3(t);for(let l of r){let c=i0e(l,e,t,n,o,a,i);c&&Ig(c,s)}return s}function Ig(r,e=va()){return e.defs[r.def.defId]=r.def,r.instance&&(e.instances[r.instance.instanceId]=r.instance),e}function RD(r,e){let t=r.instances[e];if(t){let n=r.defs[t.defId],a=qF(r,i=>Eut(n,i));return a.defs[n.defId]=n,a.instances[t.instanceId]=t,a}return va()}function Eut(r,e){return!!(r.groupId&&r.groupId===e.groupId)}function va(){return{defs:{},instances:{}}}function VF(r,e){return{defs:Object.assign(Object.assign({},r.defs),e.defs),instances:Object.assign(Object.assign({},r.instances),e.instances)}}function qF(r,e){let t=Zu(r.defs,e),n=Zu(r.instances,a=>t[a.defId]);return{defs:t,instances:n}}function Dut(r,e){let{defs:t,instances:n}=r,a={},i={};for(let s in t)e.defs[s]||(a[s]=t[s]);for(let s in n)!e.instances[s]&&a[n[s].defId]&&(i[s]=n[s]);return{defs:a,instances:i}}function Put(r,e){return Array.isArray(r)?vD(r,null,e,!0):typeof r=="object"&&r?vD([r],null,e,!0):r!=null?String(r):null}function e3(r){return Array.isArray(r)?r:typeof r=="string"?r.split(/\s+/):[]}function Wb(r,e){let t=Put(r.constraint,e);return{display:r.display||null,startEditable:r.startEditable!=null?r.startEditable:r.editable,durationEditable:r.durationEditable!=null?r.durationEditable:r.editable,constraints:t!=null?[t]:[],overlap:r.overlap!=null?r.overlap:null,allows:r.allow!=null?[r.allow]:[],backgroundColor:r.backgroundColor||r.color||"",borderColor:r.borderColor||r.color||"",textColor:r.textColor||"",classNames:(r.className||[]).concat(r.classNames||[])}}function C3(r){return r.reduce(Aut,Mut)}function Aut(r,e){return{display:e.display!=null?e.display:r.display,startEditable:e.startEditable!=null?e.startEditable:r.startEditable,durationEditable:e.durationEditable!=null?e.durationEditable:r.durationEditable,constraints:r.constraints.concat(e.constraints),overlap:typeof e.overlap=="boolean"?e.overlap:r.overlap,allows:r.allows.concat(e.allows),backgroundColor:e.backgroundColor||r.backgroundColor,borderColor:e.borderColor||r.borderColor,textColor:e.textColor||r.textColor,classNames:r.classNames.concat(e.classNames)}}function E3(r,e,t=D3(e)){let n;if(typeof r=="string"?n={url:r}:typeof r=="function"||Array.isArray(r)?n={events:r}:typeof r=="object"&&r&&(n=r),n){let{refined:a,extra:i}=ID(n,t),s=Iut(a,e);if(s)return{_raw:r,isFetching:!1,latestFetchId:"",fetchRange:null,defaultAllDay:a.defaultAllDay,eventDataTransform:a.eventDataTransform,success:a.success,failure:a.failure,publicId:a.id||"",sourceId:tp(),sourceDefId:s.sourceDefId,meta:s.meta,ui:Wb(a,e),extendedProps:i}}return null}function D3(r){return Object.assign(Object.assign(Object.assign({},AF),_ut),r.pluginHooks.eventSourceRefiners)}function Iut(r,e){let t=e.pluginHooks.eventSourceDefs;for(let n=t.length-1;n>=0;n-=1){let i=t[n].parseMeta(r);if(i)return{sourceDefId:n,meta:i}}return null}function s0e(r,e,t,n,a){switch(e.type){case"RECEIVE_EVENTS":return Nut(r,t[e.sourceId],e.fetchId,e.fetchRange,e.rawEvents,a);case"RESET_RAW_EVENTS":return Rut(r,t[e.sourceId],e.rawEvents,n.activeRange,a);case"ADD_EVENTS":return Fut(r,e.eventStore,n?n.activeRange:null,a);case"RESET_EVENTS":return e.eventStore;case"MERGE_EVENTS":return VF(r,e.eventStore);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return n?_g(r,n.activeRange,a):r;case"REMOVE_EVENTS":return Dut(r,e.eventStore);case"REMOVE_EVENT_SOURCE":return l0e(r,e.sourceId);case"REMOVE_ALL_EVENT_SOURCES":return qF(r,i=>!i.sourceId);case"REMOVE_ALL_EVENTS":return va();default:return r}}function Nut(r,e,t,n,a,i){if(e&&t===e.latestFetchId){let s=vD(o0e(a,e,i),e,i);return n&&(s=_g(s,n,i)),VF(l0e(r,e.sourceId),s)}return r}function Rut(r,e,t,n,a){let{defIdMap:i,instanceIdMap:s}=Lut(r),o=vD(o0e(t,e,a),e,a,!1,i,s);return _g(o,n,a)}function o0e(r,e,t){let n=t.options.eventDataTransform,a=e?e.eventDataTransform:null;return a&&(r=NPe(r,a)),n&&(r=NPe(r,n)),r}function NPe(r,e){let t;if(!e)t=r;else{t=[];for(let n of r){let a=e(n);a?t.push(a):a==null&&t.push(n)}}return t}function Fut(r,e,t,n){return t&&(e=_g(e,t,n)),VF(r,e)}function P3(r,e,t){let{defs:n}=r,a=el(r.instances,i=>n[i.defId].allDay?i:Object.assign(Object.assign({},i),{range:{start:t.createMarker(e.toDate(i.range.start,i.forcedStartTzo)),end:t.createMarker(e.toDate(i.range.end,i.forcedEndTzo))},forcedStartTzo:t.canComputeOffset?null:i.forcedStartTzo,forcedEndTzo:t.canComputeOffset?null:i.forcedEndTzo}));return{defs:n,instances:a}}function l0e(r,e){return qF(r,t=>t.sourceId!==e)}function Out(r,e){return{defs:r.defs,instances:Zu(r.instances,t=>!e[t.instanceId])}}function Lut(r){let{defs:e,instances:t}=r,n={},a={};for(let i in e){let s=e[i],{publicId:o}=s;o&&(n[o]=i)}for(let i in t){let s=t[i],o=e[s.defId],{publicId:l}=o;l&&(a[l]=i)}return{defIdMap:n,instanceIdMap:a}}function zut(r,e,t){(r[e]||(r[e]=[])).push(t)}function jut(r,e,t){t?r[e]&&(r[e]=r[e].filter(n=>n!==t)):delete r[e]}function M3(r,e){return vD(But(r),null,e)}function But(r){let e;return r===!0?e=[{}]:Array.isArray(r)?e=r.filter(t=>t.daysOfWeek):typeof r=="object"&&r?e=[r]:e=[],e=e.map(t=>Object.assign(Object.assign({},$ut),t)),e}function WF(r,e,t){t.emitter.trigger("select",Object.assign(Object.assign({},A3(r,t)),{jsEvent:e?e.origEvent:null,view:t.viewApi||t.calendarApi.view}))}function Uut(r,e){e.emitter.trigger("unselect",{jsEvent:r?r.origEvent:null,view:e.viewApi||e.calendarApi.view})}function A3(r,e){let t={};for(let n of e.pluginHooks.dateSpanTransforms)Object.assign(t,n(r,e));return Object.assign(t,ept(r,e.dateEnv)),t}function kD(r,e,t){let{dateEnv:n,options:a}=t,i=e;return r?(i=gr(i),i=n.add(i,a.defaultAllDayEventDuration)):i=n.add(i,a.defaultTimedEventDuration),i}function FD(r,e,t,n){let a=_F(r.defs,e),i=va();for(let s in r.defs){let o=r.defs[s];i.defs[s]=Hut(o,a[s],t,n)}for(let s in r.instances){let o=r.instances[s],l=i.defs[o.defId];i.instances[s]=Vut(o,l,a[o.defId],t,n)}return i}function Hut(r,e,t,n){let a=t.standardProps||{};a.hasEnd==null&&e.durationEditable&&(t.startDelta||t.endDelta)&&(a.hasEnd=!0);let i=Object.assign(Object.assign(Object.assign({},r),a),{ui:Object.assign(Object.assign({},r.ui),a.ui)});t.extendedProps&&(i.extendedProps=Object.assign(Object.assign({},i.extendedProps),t.extendedProps));for(let s of n.pluginHooks.eventDefMutationAppliers)s(i,t,n);return!i.hasEnd&&n.options.forceEventDuration&&(i.hasEnd=!0),i}function Vut(r,e,t,n,a){let{dateEnv:i}=a,s=n.standardProps&&n.standardProps.allDay===!0,o=n.standardProps&&n.standardProps.hasEnd===!1,l=Object.assign({},r);return s&&(l.range=n0e(l.range)),n.datesDelta&&t.startEditable&&(l.range={start:i.add(l.range.start,n.datesDelta),end:i.add(l.range.end,n.datesDelta)}),n.startDelta&&t.durationEditable&&(l.range={start:i.add(l.range.start,n.startDelta),end:l.range.end}),n.endDelta&&t.durationEditable&&(l.range={start:l.range.start,end:i.add(l.range.end,n.endDelta)}),o&&(l.range={start:l.range.start,end:kD(e.allDay,l.range.start,a)}),e.allDay&&(l.range={start:gr(l.range.start),end:gr(l.range.end)}),l.range.endd0e(t,e))}function d0e(r,e){let t=[];return e[""]&&t.push(e[""]),e[r.defId]&&t.push(e[r.defId]),t.push(r.ui),C3(t)}function Bg(r,e){let t=r.map(qut);return t.sort((n,a)=>qPe(n,a,e)),t.map(n=>n._seg)}function qut(r){let{eventRange:e}=r,t=e.def,n=e.instance?e.instance.range:e.range,a=n.start?n.start.valueOf():0,i=n.end?n.end.valueOf():0;return Object.assign(Object.assign(Object.assign({},t.extendedProps),t),{id:t.publicId,start:a,end:i,duration:i-a,allDay:Number(t.allDay),_seg:r})}function Wut(r,e){let{pluginHooks:t}=e,n=t.isDraggableTransformers,{def:a,ui:i}=r.eventRange,s=i.startEditable;for(let o of n)s=o(s,a,i,e);return s}function Yut(r,e){return r.isStart&&r.eventRange.ui.durationEditable&&e.options.eventResizableFromStart}function Gut(r,e){return r.isEnd&&r.eventRange.ui.durationEditable}function rf(r,e,t,n,a,i,s){let{dateEnv:o,options:l}=t,{displayEventTime:c,displayEventEnd:d}=l,u=r.eventRange.def,p=r.eventRange.instance;c==null&&(c=n!==!1),d==null&&(d=a!==!1);let m=p.range.start,f=p.range.end,h=i||r.start||r.eventRange.range.start,g=s||r.end||r.eventRange.range.end,v=gr(m).valueOf()===gr(h).valueOf(),b=gr(ld(f,-1)).valueOf()===gr(ld(g,-1)).valueOf();return c&&!u.allDay&&(v||b)?(h=v?m:h,g=b?f:g,d&&u.hasEnd?o.formatRange(h,g,e,{forcedStartTzo:i?null:p.forcedStartTzo,forcedEndTzo:s?null:p.forcedEndTzo}):o.format(h,e,{forcedTzo:i?null:p.forcedStartTzo})):""}function po(r,e,t){let n=r.eventRange.range;return{isPast:n.end<=(t||e.start),isFuture:n.start>=(t||e.end),isToday:e&&Xo(e,n.start)}}function Kut(r){let e=["fc-event"];return r.isMirror&&e.push("fc-event-mirror"),r.isDraggable&&e.push("fc-event-draggable"),(r.isStartResizable||r.isEndResizable)&&e.push("fc-event-resizable"),r.isDragging&&e.push("fc-event-dragging"),r.isResizing&&e.push("fc-event-resizing"),r.isSelected&&e.push("fc-event-selected"),r.isStart&&e.push("fc-event-start"),r.isEnd&&e.push("fc-event-end"),r.isPast&&e.push("fc-event-past"),r.isToday&&e.push("fc-event-today"),r.isFuture&&e.push("fc-event-future"),e}function OD(r){return r.instance?r.instance.instanceId:`${r.def.defId}:${r.range.start.toISOString()}`}function Yb(r,e){let{def:t,instance:n}=r.eventRange,{url:a}=t;if(a)return{href:a};let{emitter:i,options:s}=e,{eventInteractive:o}=s;return o==null&&(o=t.interactive,o==null&&(o=!!i.hasHandlers("eventClick"))),o?HPe(l=>{i.trigger("eventClick",{el:l.target,event:new Or(e,t,n),jsEvent:l,view:e.viewApi})}):{}}function Qut(r,e,t){let n=Jut(r,e),{range:a}=n;if(!a.start)return null;if(!a.end){if(t==null)return null;a.end=e.add(a.start,t)}return n}function Jut(r,e){let{refined:t,extra:n}=ID(r,Zut),a=t.start?e.createMarkerMeta(t.start):null,i=t.end?e.createMarkerMeta(t.end):null,{allDay:s}=t;return s==null&&(s=a&&a.isTimeUnspecified&&(!i||i.isTimeUnspecified)),Object.assign({range:{start:a?a.marker:null,end:i?i.marker:null},allDay:s},n)}function I3(r,e){return r0e(r.range,e.range)&&r.allDay===e.allDay&&Xut(r,e)}function Xut(r,e){for(let t in e)if(t!=="range"&&t!=="allDay"&&r[t]!==e[t])return!1;for(let t in r)if(!(t in e))return!1;return!0}function ept(r,e){return Object.assign(Object.assign({},u0e(r.range,e,r.allDay)),{allDay:r.allDay})}function N3(r,e,t){return Object.assign(Object.assign({},u0e(r,e,t)),{timeZone:e.timeZone})}function u0e(r,e,t){return{start:e.toDate(r.start),end:e.toDate(r.end),startStr:e.formatIso(r.start,{omitTime:t}),endStr:e.formatIso(r.end,{omitTime:t})}}function tpt(r,e,t){let n=ND({editable:!1},t),a=Ob(n.refined,n.extra,"",r.allDay,!0,t);return{def:a,ui:d0e(a,e),instance:qb(a.defId,r.range),range:r.range,isStart:!0,isEnd:!0}}function R3(r,e,t){let n=!1,a=function(o){n||(n=!0,e(o))},i=function(o){n||(n=!0,t(o))},s=r(a,i);s&&typeof s.then=="function"&&s.then(a,i)}function F3(r,e,t){r=r.toUpperCase();let n={method:r};return r==="GET"?e+=(e.indexOf("?")===-1?"?":"&")+new URLSearchParams(t):(n.body=new URLSearchParams(t),n.headers={"Content-Type":"application/x-www-form-urlencoded"}),fetch(e,n).then(a=>{if(a.ok)return a.json().then(i=>[i,a],()=>{throw new IF("Failure parsing JSON",a)});throw new IF("Request failed",a)})}function O3(){return $4==null&&($4=rpt()),$4}function rpt(){if(typeof document=="undefined")return!0;let r=document.createElement("div");r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.innerHTML="
",r.querySelector("table").style.height="100px",r.querySelector("div").style.height="100%",document.body.appendChild(r);let t=r.querySelector("div").offsetHeight>0;return document.body.removeChild(r),t}function p0e(r,e){return{component:r,el:e.el,useEventCenter:e.useEventCenter!=null?e.useEventCenter:!0,isHitComboAllowed:e.isHitComboAllowed||null}}function LD(r){return{[r.component.uid]:r}}function npt(r){let e=gr(r),t=hn(e,1);return{start:e,end:t}}function L3(r,e){return r.left>=e.left&&r.left=e.top&&r.topt:e&&r>=e.end)}}function Gb(r,e){let t=["fc-day",`fc-day-${jdt[r.dow]}`];return r.isDisabled?t.push("fc-day-disabled"):(r.isToday&&(t.push("fc-day-today"),t.push(e.getClass("today"))),r.isPast&&t.push("fc-day-past"),r.isFuture&&t.push("fc-day-future"),r.isOther&&t.push("fc-day-other")),t}function gd(r,e,t="day",n=!0){let{dateEnv:a,options:i,calendarApi:s}=r,o=a.format(e,t==="week"?spt:ipt);if(i.navLinks){let l=a.toDate(e),c=d=>{let u=t==="day"?i.navLinkDayClick:t==="week"?i.navLinkWeekClick:null;typeof u=="function"?u.call(s,a.toDate(e),d):(typeof u=="string"&&(t=u),s.zoomTo(e,t))};return Object.assign({title:Bb(i.navLinkHint,[o,l],o),"data-navlink":""},n?UPe(c):{onClick:c})}return{"aria-label":o}}function m0e(){return U4===null&&(U4=opt()),U4}function opt(){let r=document.createElement("div");$g(r,{position:"absolute",top:-1e3,left:0,border:0,padding:0,overflow:"scroll",direction:"rtl"}),r.innerHTML="
",document.body.appendChild(r);let t=r.firstChild.getBoundingClientRect().left>r.getBoundingClientRect().left;return PD(r),t}function f0e(){return H4||(H4=lpt()),H4}function lpt(){let r=document.createElement("div");r.style.overflow="scroll",r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",document.body.appendChild(r);let e=h0e(r);return document.body.removeChild(r),e}function h0e(r){return{x:r.offsetHeight-r.clientHeight,y:r.offsetWidth-r.clientWidth}}function g0e(r,e=!1){let t=window.getComputedStyle(r),n=parseInt(t.borderLeftWidth,10)||0,a=parseInt(t.borderRightWidth,10)||0,i=parseInt(t.borderTopWidth,10)||0,s=parseInt(t.borderBottomWidth,10)||0,o=h0e(r),l=o.y-n-a,c=o.x-i-s,d={borderLeft:n,borderRight:a,borderTop:i,borderBottom:s,scrollbarBottom:c,scrollbarLeft:0,scrollbarRight:0};return m0e()&&t.direction==="rtl"?d.scrollbarLeft=l:d.scrollbarRight=l,e&&(d.paddingLeft=parseInt(t.paddingLeft,10)||0,d.paddingRight=parseInt(t.paddingRight,10)||0,d.paddingTop=parseInt(t.paddingTop,10)||0,d.paddingBottom=parseInt(t.paddingBottom,10)||0),d}function B3(r,e=!1,t){let n=t?r.getBoundingClientRect():jD(r),a=g0e(r,e),i={left:n.left+a.borderLeft+a.scrollbarLeft,right:n.right-a.borderRight-a.scrollbarRight,top:n.top+a.borderTop,bottom:n.bottom-a.borderBottom-a.scrollbarBottom};return e&&(i.left+=a.paddingLeft,i.right-=a.paddingRight,i.top+=a.paddingTop,i.bottom-=a.paddingBottom),i}function jD(r){let e=r.getBoundingClientRect();return{left:e.left+window.scrollX,top:e.top+window.scrollY,right:e.right+window.scrollX,bottom:e.bottom+window.scrollY}}function cpt(r){let e=GF(r),t=r.getBoundingClientRect();for(let n of e){let a=YF(t,n.getBoundingClientRect());if(a)t=a;else return null}return t}function GF(r){let e=[];for(;r instanceof HTMLElement;){let t=window.getComputedStyle(r);if(t.position==="fixed")break;/(auto|scroll)/.test(t.overflow+t.overflowY+t.overflowX)&&e.push(r),r=r.parentNode}return e}function TF(r,e){let t=r.length;if(t!==e.length)return!1;for(let n=0;nt(r[a-1]))return[a,0];for(;ns)n=i+1;else return[i,1]}return[n,0]}function BD(r){let{refined:e,extra:t}=ID(r,upt);return{startTime:e.startTime||null,duration:e.duration||null,create:e.create!=null?e.create:!0,sourceId:e.sourceId,leftoverProps:t}}function y0e(r,e){return!r||e>10?Kt({weekday:"short"}):e>1?Kt({weekday:"short",month:"numeric",day:"numeric",omitCommas:!0}):Kt({weekday:"long"})}function k0e(r){return r.text}function mpt(r,e,t){return r||y0e(e,t)}function wF(r,e){let t=r.activeRange;return e?t:{start:ld(t.start,r.slotMinTime.milliseconds),end:ld(t.end,r.slotMaxTime.milliseconds-864e5)}}function UD(r,e,t){let{instances:n}=r.mutatedEvents;for(let a in n)if(!Vb(e.validRange,n[a].range))return!1;return b0e({eventDrag:r},t)}function H3(r,e,t){return Vb(e.validRange,r.range)?b0e({dateSelection:r},t):!1}function b0e(r,e){let t=e.getCurrentData(),n=Object.assign({businessHours:t.businessHours,dateSelection:"",eventStore:t.eventStore,eventUiBases:t.eventUiBases,eventSelection:"",eventDrag:null,eventResize:null},r);return(e.pluginHooks.isPropsValid||T0e)(n,e)}function T0e(r,e,t={},n){return!(r.eventDrag&&!fpt(r,e,t,n)||r.dateSelection&&!hpt(r,e,t,n))}function fpt(r,e,t,n){let a=e.getCurrentData(),i=r.eventDrag,s=i.mutatedEvents,o=s.defs,l=s.instances,c=_F(o,i.isEvent?r.eventUiBases:{"":a.selectionConfig});n&&(c=el(c,n));let d=Out(r.eventStore,i.affectedEvents.instances),u=d.defs,p=d.instances,m=_F(u,r.eventUiBases);for(let f in l){let h=l[f],g=h.range,v=c[h.defId],b=o[h.defId];if(!w0e(v.constraints,g,d,r.businessHours,e))return!1;let{eventOverlap:k}=e.options,w=typeof k=="function"?k:null;for(let C in p){let E=p[C];if(UF(g,E.range)&&(m[E.defId].overlap===!1&&i.isEvent||v.overlap===!1||w&&!w(new Or(e,u[E.defId],E),new Or(e,b,h))))return!1}let S=a.eventStore;for(let C of v.allows){let E=Object.assign(Object.assign({},t),{range:h.range,allDay:b.allDay}),D=S.defs[b.defId],P=S.instances[f],O;if(D?O=new Or(e,D,P):O=new Or(e,b),!C(A3(E,e),O))return!1}}return!0}function hpt(r,e,t,n){let a=r.eventStore,i=a.defs,s=a.instances,o=r.dateSelection,l=o.range,{selectionConfig:c}=e.getCurrentData();if(n&&(c=n(c)),!w0e(c.constraints,l,a,r.businessHours,e))return!1;let{selectOverlap:d}=e.options,u=typeof d=="function"?d:null;for(let p in s){let m=s[p];if(UF(l,m.range)&&(c.overlap===!1||u&&!u(new Or(e,i[m.defId],m),null)))return!1}for(let p of c.allows){let m=Object.assign(Object.assign({},t),o);if(!p(A3(m,e),null))return!1}return!0}function w0e(r,e,t,n,a){for(let i of r)if(!ypt(gpt(i,e,t,n,a),e))return!1;return!0}function gpt(r,e,t,n,a){return r==="businessHours"?q4(_g(n,e,a)):typeof r=="string"?q4(qF(t,i=>i.groupId===r)):typeof r=="object"&&r?q4(_g(r,e,a)):[]}function q4(r){let{instances:e}=r,t=[];for(let n in e)t.push(e[n].range);return t}function ypt(r,e){for(let t of r)if(Vb(t,e))return!0;return!1}function S0e(r){let e=$Pe(r,".fc-scrollgrid-shrink"),t=0;for(let n of e)t=Math.max(t,Ndt(n));return Math.ceil(t)}function V3(r,e){return r.liquid&&e.liquid}function x0e(r,e){return e.maxHeight!=null||V3(r,e)}function C0e(r,e,t,n){let{expandRows:a}=t;return typeof e.content=="function"?e.content(t):_("table",{role:"presentation",className:[e.tableClassName,r.syncRowHeights?"fc-scrollgrid-sync-table":""].join(" "),style:{minWidth:t.tableMinWidth,width:t.clientWidth,height:a?t.clientHeight:""}},t.tableColGroupNode,_(n?"thead":"tbody",{role:"presentation"},typeof e.rowContent=="function"?e.rowContent(t):e.rowContent))}function E0e(r,e){return pd(r,e,gi)}function D0e(r,e){let t=[];for(let n of r){let a=n.span||1;for(let i=0;ie.eventRange.range.end?r:e}var OPe,Y4,L4,Mdt,Mg,Adt,SPe,xPe,CPe,EPe,Rdt,jdt,j4,EF,kF,Gdt,Kdt,Zdt,Qdt,G4,K4,Z4,g3,fd,y3,v3,tf,ZPe,PF,sut,JPe,Q4,put,hD,Qu,J4,MF,tl,cd,Pt,yD,T3,Ln,co,Ag,CF,a0e,Sut,AF,Mut,_ut,Ju,$ut,Ym,Or,Zut,IF,$4,bD,ec,Ug,vs,TD,B4,wD,ipt,spt,U4,H4,tc,Ng,SD,xD,ia,Rg,DD,Kb,upt,v0e,NF,ppt,RF,Xu,Fg,Og,Lg,SF,zb,ks,Qm,ep,Jm,VD,bpt,Xm,zg,WD,W4,t3,r3,jg,q3=y(()=>{Ku();Ku();pD();OPe=[],Y4=new Map;typeof document!="undefined"&&zPe(document);Mdt=':root{--fc-small-font-size:.85em;--fc-page-bg-color:#fff;--fc-neutral-bg-color:hsla(0,0%,82%,.3);--fc-neutral-text-color:grey;--fc-border-color:#ddd;--fc-button-text-color:#fff;--fc-button-bg-color:#2c3e50;--fc-button-border-color:#2c3e50;--fc-button-hover-bg-color:#1e2b37;--fc-button-hover-border-color:#1a252f;--fc-button-active-bg-color:#1a252f;--fc-button-active-border-color:#151e27;--fc-event-bg-color:#3788d8;--fc-event-border-color:#3788d8;--fc-event-text-color:#fff;--fc-event-selected-overlay-color:rgba(0,0,0,.25);--fc-more-link-bg-color:#d0d0d0;--fc-more-link-text-color:inherit;--fc-event-resizer-thickness:8px;--fc-event-resizer-dot-total-width:8px;--fc-event-resizer-dot-border-width:1px;--fc-non-business-color:hsla(0,0%,84%,.3);--fc-bg-event-color:#8fdf82;--fc-bg-event-opacity:0.3;--fc-highlight-color:rgba(188,232,241,.3);--fc-today-bg-color:rgba(255,220,40,.15);--fc-now-indicator-color:red}.fc-not-allowed,.fc-not-allowed .fc-event{cursor:not-allowed}.fc{display:flex;flex-direction:column;font-size:1em}.fc,.fc *,.fc :after,.fc :before{box-sizing:border-box}.fc table{border-collapse:collapse;border-spacing:0;font-size:1em}.fc th{text-align:center}.fc td,.fc th{padding:0;vertical-align:top}.fc a[data-navlink]{cursor:pointer}.fc a[data-navlink]:hover{text-decoration:underline}.fc-direction-ltr{direction:ltr;text-align:left}.fc-direction-rtl{direction:rtl;text-align:right}.fc-theme-standard td,.fc-theme-standard th{border:1px solid var(--fc-border-color)}.fc-liquid-hack td,.fc-liquid-hack th{position:relative}@font-face{font-family:fcicons;font-style:normal;font-weight:400;src:url("data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBfAAAAC8AAAAYGNtYXAXVtKNAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZgYydxIAAAF4AAAFNGhlYWQUJ7cIAAAGrAAAADZoaGVhB20DzAAABuQAAAAkaG10eCIABhQAAAcIAAAALGxvY2ED4AU6AAAHNAAAABhtYXhwAA8AjAAAB0wAAAAgbmFtZXsr690AAAdsAAABhnBvc3QAAwAAAAAI9AAAACAAAwPAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpBgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6Qb//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAWIAjQKeAskAEwAAJSc3NjQnJiIHAQYUFwEWMjc2NCcCnuLiDQ0MJAz/AA0NAQAMJAwNDcni4gwjDQwM/wANIwz/AA0NDCMNAAAAAQFiAI0CngLJABMAACUBNjQnASYiBwYUHwEHBhQXFjI3AZ4BAA0N/wAMJAwNDeLiDQ0MJAyNAQAMIw0BAAwMDSMM4uINIwwNDQAAAAIA4gC3Ax4CngATACcAACUnNzY0JyYiDwEGFB8BFjI3NjQnISc3NjQnJiIPAQYUHwEWMjc2NCcB87e3DQ0MIw3VDQ3VDSMMDQ0BK7e3DQ0MJAzVDQ3VDCQMDQ3zuLcMJAwNDdUNIwzWDAwNIwy4twwkDA0N1Q0jDNYMDA0jDAAAAgDiALcDHgKeABMAJwAAJTc2NC8BJiIHBhQfAQcGFBcWMjchNzY0LwEmIgcGFB8BBwYUFxYyNwJJ1Q0N1Q0jDA0Nt7cNDQwjDf7V1Q0N1QwkDA0Nt7cNDQwkDLfWDCMN1Q0NDCQMt7gMIw0MDNYMIw3VDQ0MJAy3uAwjDQwMAAADAFUAAAOrA1UAMwBoAHcAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMhMjY1NCYjISIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAAVYRGRkR/qoRGRkRA1UFBAUOCQkVDAsZDf2rDRkLDBUJCA4FBQUFBQUOCQgVDAsZDQJVDRkLDBUJCQ4FBAVVAgECBQMCBwQECAX9qwQJAwQHAwMFAQICAgIBBQMDBwQDCQQCVQUIBAQHAgMFAgEC/oAZEhEZGRESGQAAAAADAFUAAAOrA1UAMwBoAIkAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMzFRQWMzI2PQEzMjY1NCYrATU0JiMiBh0BIyIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAgBkSEhmAERkZEYAZEhIZgBEZGREDVQUEBQ4JCRUMCxkN/asNGQsMFQkIDgUFBQUFBQ4JCBUMCxkNAlUNGQsMFQkJDgUEBVUCAQIFAwIHBAQIBf2rBAkDBAcDAwUBAgICAgEFAwMHBAMJBAJVBQgEBAcCAwUCAQL+gIASGRkSgBkSERmAEhkZEoAZERIZAAABAOIAjQMeAskAIAAAExcHBhQXFjI/ARcWMjc2NC8BNzY0JyYiDwEnJiIHBhQX4uLiDQ0MJAzi4gwkDA0N4uINDQwkDOLiDCQMDQ0CjeLiDSMMDQ3h4Q0NDCMN4uIMIw0MDOLiDAwNIwwAAAABAAAAAQAAa5n0y18PPPUACwQAAAAAANivOVsAAAAA2K85WwAAAAADqwNVAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAOrAAEAAAAAAAAAAAAAAAAAAAALBAAAAAAAAAAAAAAAAgAAAAQAAWIEAAFiBAAA4gQAAOIEAABVBAAAVQQAAOIAAAAAAAoAFAAeAEQAagCqAOoBngJkApoAAQAAAAsAigADAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGZjaWNvbnMAZgBjAGkAYwBvAG4Ac1ZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGZjaWNvbnMAZgBjAGkAYwBvAG4Ac2ZjaWNvbnMAZgBjAGkAYwBvAG4Ac1JlZ3VsYXIAUgBlAGcAdQBsAGEAcmZjaWNvbnMAZgBjAGkAYwBvAG4Ac0ZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") format("truetype")}.fc-icon{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;font-family:fcicons!important;font-style:normal;font-variant:normal;font-weight:400;height:1em;line-height:1;text-align:center;text-transform:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:1em}.fc-icon-chevron-left:before{content:"\\e900"}.fc-icon-chevron-right:before{content:"\\e901"}.fc-icon-chevrons-left:before{content:"\\e902"}.fc-icon-chevrons-right:before{content:"\\e903"}.fc-icon-minus-square:before{content:"\\e904"}.fc-icon-plus-square:before{content:"\\e905"}.fc-icon-x:before{content:"\\e906"}.fc .fc-button{border-radius:0;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible;text-transform:none}.fc .fc-button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.fc .fc-button{-webkit-appearance:button}.fc .fc-button:not(:disabled){cursor:pointer}.fc .fc-button{background-color:transparent;border:1px solid transparent;border-radius:.25em;display:inline-block;font-size:1em;font-weight:400;line-height:1.5;padding:.4em .65em;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle}.fc .fc-button:hover{text-decoration:none}.fc .fc-button:focus{box-shadow:0 0 0 .2rem rgba(44,62,80,.25);outline:0}.fc .fc-button:disabled{opacity:.65}.fc .fc-button-primary{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:hover{background-color:var(--fc-button-hover-bg-color);border-color:var(--fc-button-hover-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:disabled{background-color:var(--fc-button-bg-color);border-color:var(--fc-button-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button-primary:not(:disabled).fc-button-active,.fc .fc-button-primary:not(:disabled):active{background-color:var(--fc-button-active-bg-color);border-color:var(--fc-button-active-border-color);color:var(--fc-button-text-color)}.fc .fc-button-primary:not(:disabled).fc-button-active:focus,.fc .fc-button-primary:not(:disabled):active:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button .fc-icon{font-size:1.5em;vertical-align:middle}.fc .fc-button-group{display:inline-flex;position:relative;vertical-align:middle}.fc .fc-button-group>.fc-button{flex:1 1 auto;position:relative}.fc .fc-button-group>.fc-button.fc-button-active,.fc .fc-button-group>.fc-button:active,.fc .fc-button-group>.fc-button:focus,.fc .fc-button-group>.fc-button:hover{z-index:1}.fc-direction-ltr .fc-button-group>.fc-button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}.fc-direction-ltr .fc-button-group>.fc-button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.fc-direction-rtl .fc-button-group>.fc-button:not(:first-child){border-bottom-right-radius:0;border-top-right-radius:0;margin-right:-1px}.fc-direction-rtl .fc-button-group>.fc-button:not(:last-child){border-bottom-left-radius:0;border-top-left-radius:0}.fc .fc-toolbar{align-items:center;display:flex;justify-content:space-between}.fc .fc-toolbar.fc-header-toolbar{margin-bottom:1.5em}.fc .fc-toolbar.fc-footer-toolbar{margin-top:1.5em}.fc .fc-toolbar-title{font-size:1.75em;margin:0}.fc-direction-ltr .fc-toolbar>*>:not(:first-child){margin-left:.75em}.fc-direction-rtl .fc-toolbar>*>:not(:first-child){margin-right:.75em}.fc-direction-rtl .fc-toolbar-ltr{flex-direction:row-reverse}.fc .fc-scroller{-webkit-overflow-scrolling:touch;position:relative}.fc .fc-scroller-liquid{height:100%}.fc .fc-scroller-liquid-absolute{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-scroller-harness{direction:ltr;overflow:hidden;position:relative}.fc .fc-scroller-harness-liquid{height:100%}.fc-direction-rtl .fc-scroller-harness>.fc-scroller{direction:rtl}.fc-theme-standard .fc-scrollgrid{border:1px solid var(--fc-border-color)}.fc .fc-scrollgrid,.fc .fc-scrollgrid table{table-layout:fixed;width:100%}.fc .fc-scrollgrid table{border-left-style:hidden;border-right-style:hidden;border-top-style:hidden}.fc .fc-scrollgrid{border-bottom-width:0;border-collapse:separate;border-right-width:0}.fc .fc-scrollgrid-liquid{height:100%}.fc .fc-scrollgrid-section,.fc .fc-scrollgrid-section table,.fc .fc-scrollgrid-section>td{height:1px}.fc .fc-scrollgrid-section-liquid>td{height:100%}.fc .fc-scrollgrid-section>*{border-left-width:0;border-top-width:0}.fc .fc-scrollgrid-section-footer>*,.fc .fc-scrollgrid-section-header>*{border-bottom-width:0}.fc .fc-scrollgrid-section-body table,.fc .fc-scrollgrid-section-footer table{border-bottom-style:hidden}.fc .fc-scrollgrid-section-sticky>*{background:var(--fc-page-bg-color);position:sticky;z-index:3}.fc .fc-scrollgrid-section-header.fc-scrollgrid-section-sticky>*{top:0}.fc .fc-scrollgrid-section-footer.fc-scrollgrid-section-sticky>*{bottom:0}.fc .fc-scrollgrid-sticky-shim{height:1px;margin-bottom:-1px}.fc-sticky{position:sticky}.fc .fc-view-harness{flex-grow:1;position:relative}.fc .fc-view-harness-active>.fc-view{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-col-header-cell-cushion{display:inline-block;padding:2px 4px}.fc .fc-bg-event,.fc .fc-highlight,.fc .fc-non-business{bottom:0;left:0;position:absolute;right:0;top:0}.fc .fc-non-business{background:var(--fc-non-business-color)}.fc .fc-bg-event{background:var(--fc-bg-event-color);opacity:var(--fc-bg-event-opacity)}.fc .fc-bg-event .fc-event-title{font-size:var(--fc-small-font-size);font-style:italic;margin:.5em}.fc .fc-highlight{background:var(--fc-highlight-color)}.fc .fc-cell-shaded,.fc .fc-day-disabled{background:var(--fc-neutral-bg-color)}a.fc-event,a.fc-event:hover{text-decoration:none}.fc-event.fc-event-draggable,.fc-event[href]{cursor:pointer}.fc-event .fc-event-main{position:relative;z-index:2}.fc-event-dragging:not(.fc-event-selected){opacity:.75}.fc-event-dragging.fc-event-selected{box-shadow:0 2px 7px rgba(0,0,0,.3)}.fc-event .fc-event-resizer{display:none;position:absolute;z-index:4}.fc-event-selected .fc-event-resizer,.fc-event:hover .fc-event-resizer{display:block}.fc-event-selected .fc-event-resizer{background:var(--fc-page-bg-color);border-color:inherit;border-radius:calc(var(--fc-event-resizer-dot-total-width)/2);border-style:solid;border-width:var(--fc-event-resizer-dot-border-width);height:var(--fc-event-resizer-dot-total-width);width:var(--fc-event-resizer-dot-total-width)}.fc-event-selected .fc-event-resizer:before{bottom:-20px;content:"";left:-20px;position:absolute;right:-20px;top:-20px}.fc-event-selected,.fc-event:focus{box-shadow:0 2px 5px rgba(0,0,0,.2)}.fc-event-selected:before,.fc-event:focus:before{bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:3}.fc-event-selected:after,.fc-event:focus:after{background:var(--fc-event-selected-overlay-color);bottom:-1px;content:"";left:-1px;position:absolute;right:-1px;top:-1px;z-index:1}.fc-h-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-h-event .fc-event-main{color:var(--fc-event-text-color)}.fc-h-event .fc-event-main-frame{display:flex}.fc-h-event .fc-event-time{max-width:100%;overflow:hidden}.fc-h-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-width:0}.fc-h-event .fc-event-title{display:inline-block;left:0;max-width:100%;overflow:hidden;right:0;vertical-align:top}.fc-h-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-start),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-end){border-bottom-left-radius:0;border-left-width:0;border-top-left-radius:0}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-end),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-start){border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.fc-h-event:not(.fc-event-selected) .fc-event-resizer{bottom:0;top:0;width:var(--fc-event-resizer-thickness)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end{cursor:w-resize;left:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start{cursor:e-resize;right:calc(var(--fc-event-resizer-thickness)*-.5)}.fc-h-event.fc-event-selected .fc-event-resizer{margin-top:calc(var(--fc-event-resizer-dot-total-width)*-.5);top:50%}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-start,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-end{left:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-end,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-start{right:calc(var(--fc-event-resizer-dot-total-width)*-.5)}.fc .fc-popover{box-shadow:0 2px 6px rgba(0,0,0,.15);position:absolute;z-index:9999}.fc .fc-popover-header{align-items:center;display:flex;flex-direction:row;justify-content:space-between;padding:3px 4px}.fc .fc-popover-title{margin:0 2px}.fc .fc-popover-close{cursor:pointer;font-size:1.1em;opacity:.65}.fc-theme-standard .fc-popover{background:var(--fc-page-bg-color);border:1px solid var(--fc-border-color)}.fc-theme-standard .fc-popover-header{background:var(--fc-neutral-bg-color)}';ud(Mdt);Mg=class{constructor(e){this.drainedOption=e,this.isRunning=!1,this.isDirty=!1,this.pauseDepths={},this.timeoutId=0}request(e){this.isDirty=!0,this.isPaused()||(this.clearTimeout(),e==null?this.tryDrain():this.timeoutId=setTimeout(this.tryDrain.bind(this),e))}pause(e=""){let{pauseDepths:t}=this;t[e]=(t[e]||0)+1,this.clearTimeout()}resume(e="",t){let{pauseDepths:n}=this;e in n&&(t?delete n[e]:(n[e]-=1,n[e]<=0&&delete n[e]),this.tryDrain())}isPaused(){return Object.keys(this.pauseDepths).length}tryDrain(){if(!this.isRunning&&!this.isPaused()){for(this.isRunning=!0;this.isDirty;)this.isDirty=!1,this.drained();this.isRunning=!1}}clear(){this.clearTimeout(),this.isDirty=!1,this.pauseDepths={}}clearTimeout(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=0)}drained(){this.drainedOption&&this.drainedOption()}};Adt=/(top|left|right|bottom|width|height)$/i;SPe=0;xPe=["webkitTransitionEnd","otransitionend","oTransitionEnd","msTransitionEnd","transitionend"];CPe=0;EPe=["years","months","days","milliseconds"],Rdt=/^(-?)(?:(\d+)\.)?(\d+):(\d\d)(?::(\d\d)(?:\.(\d\d\d))?)?/;jdt=["sun","mon","tue","wed","thu","fri","sat"];j4={week:3,separator:9,omitZeroMinute:9,meridiem:9,omitCommas:9},EF={timeZoneName:7,era:6,year:5,month:4,day:2,weekday:2,hour:1,minute:1,second:1},kF=/\s*([ap])\.?m\.?/i,Gdt=/,/g,Kdt=/\s+/g,Zdt=/\u200e/g,Qdt=/UTC|GMT/,G4=class{constructor(e){let t={},n={},a=9;for(let i in e)i in j4?(n[i]=e[i],j4[i]<9&&(a=Math.min(j4[i],a))):(t[i]=e[i],i in EF&&(a=Math.min(EF[i],a)));this.standardDateProps=t,this.extendedSettings=n,this.smallestUnitNum=a,this.buildFormattingFunc=_e(APe)}format(e,t){return this.buildFormattingFunc(this.standardDateProps,this.extendedSettings,t)(e)}formatRange(e,t,n,a){let{standardDateProps:i,extendedSettings:s}=this,o=nut(e.marker,t.marker,n.calendarSystem);if(!o)return this.format(e,n);let l=o;l>1&&(i.year==="numeric"||i.year==="2-digit")&&(i.month==="numeric"||i.month==="2-digit")&&(i.day==="numeric"||i.day==="2-digit")&&(l=1);let c=this.format(e,n),d=this.format(t,n);if(c===d)return c;let u=aut(i,l),p=APe(u,s,n),m=p(e),f=p(t),h=iut(c,m,d,f),g=s.separator||a||n.defaultSeparator||"";return h?h.before+m+g+f+h.after:c+g+d}getSmallestUnit(){switch(this.smallestUnitNum){case 7:case 6:case 5:return"year";case 4:return"month";case 3:return"week";case 2:return"day";default:return"time"}}};K4=class{constructor(e){this.cmdStr=e}format(e,t,n){return t.cmdFormatter(this.cmdStr,DF(e,null,t,n))}formatRange(e,t,n,a){return n.cmdFormatter(this.cmdStr,DF(e,t,n,a))}},Z4=class{constructor(e){this.func=e}format(e,t,n){return this.func(DF(e,null,t,n))}formatRange(e,t,n,a){return this.func(DF(e,t,n,a))}};g3={navLinkDayClick:U,navLinkWeekClick:U,duration:mt,bootstrapFontAwesome:U,buttonIcons:U,customButtons:U,defaultAllDayEventDuration:mt,defaultTimedEventDuration:mt,nextDayThreshold:mt,scrollTime:mt,scrollTimeReset:Boolean,slotMinTime:mt,slotMaxTime:mt,dayPopoverFormat:Kt,slotDuration:mt,snapDuration:mt,headerToolbar:U,footerToolbar:U,defaultRangeSeparator:String,titleRangeSeparator:String,forceEventDuration:Boolean,dayHeaders:Boolean,dayHeaderFormat:Kt,dayHeaderClassNames:U,dayHeaderContent:U,dayHeaderDidMount:U,dayHeaderWillUnmount:U,dayCellClassNames:U,dayCellContent:U,dayCellDidMount:U,dayCellWillUnmount:U,initialView:String,aspectRatio:Number,weekends:Boolean,weekNumberCalculation:U,weekNumbers:Boolean,weekNumberClassNames:U,weekNumberContent:U,weekNumberDidMount:U,weekNumberWillUnmount:U,editable:Boolean,viewClassNames:U,viewDidMount:U,viewWillUnmount:U,nowIndicator:Boolean,nowIndicatorSnap:U,nowIndicatorClassNames:U,nowIndicatorContent:U,nowIndicatorDidMount:U,nowIndicatorWillUnmount:U,showNonCurrentDates:Boolean,lazyFetching:Boolean,startParam:String,endParam:String,timeZoneParam:String,timeZone:String,locales:U,locale:U,themeSystem:String,dragRevertDuration:Number,dragScroll:Boolean,allDayMaintainDuration:Boolean,unselectAuto:Boolean,dropAccept:U,eventOrder:VPe,eventOrderStrict:Boolean,handleWindowResize:Boolean,windowResizeDelay:Number,longPressDelay:Number,eventDragMinDistance:Number,expandRows:Boolean,height:U,contentHeight:U,direction:String,weekNumberFormat:Kt,eventResizableFromStart:Boolean,displayEventTime:Boolean,displayEventEnd:Boolean,weekText:String,weekTextLong:String,progressiveEventRendering:Boolean,businessHours:U,initialDate:U,now:U,eventDataTransform:U,stickyHeaderDates:U,stickyFooterScrollbar:U,viewHeight:U,defaultAllDay:Boolean,eventSourceFailure:U,eventSourceSuccess:U,eventDisplay:String,eventStartEditable:Boolean,eventDurationEditable:Boolean,eventOverlap:U,eventConstraint:U,eventAllow:U,eventBackgroundColor:String,eventBorderColor:String,eventTextColor:String,eventColor:String,eventClassNames:U,eventContent:U,eventDidMount:U,eventWillUnmount:U,selectConstraint:U,selectOverlap:U,selectAllow:U,droppable:Boolean,unselectCancel:String,slotLabelFormat:U,slotLaneClassNames:U,slotLaneContent:U,slotLaneDidMount:U,slotLaneWillUnmount:U,slotLabelClassNames:U,slotLabelContent:U,slotLabelDidMount:U,slotLabelWillUnmount:U,dayMaxEvents:U,dayMaxEventRows:U,dayMinWidth:Number,slotLabelInterval:mt,allDayText:String,allDayClassNames:U,allDayContent:U,allDayDidMount:U,allDayWillUnmount:U,slotMinWidth:Number,navLinks:Boolean,eventTimeFormat:Kt,rerenderDelay:Number,moreLinkText:U,moreLinkHint:U,selectMinDistance:Number,selectable:Boolean,selectLongPressDelay:Number,eventLongPressDelay:Number,selectMirror:Boolean,eventMaxStack:Number,eventMinHeight:Number,eventMinWidth:Number,eventShortHeight:Number,slotEventOverlap:Boolean,plugins:U,firstDay:Number,dayCount:Number,dateAlignment:String,dateIncrement:mt,hiddenDays:U,fixedWeekCount:Boolean,validRange:U,visibleRange:U,titleFormat:U,eventInteractive:Boolean,noEventsText:String,viewHint:U,navLinkHint:U,closeHint:String,timeHint:String,eventHint:String,moreLinkClick:U,moreLinkClassNames:U,moreLinkContent:U,moreLinkDidMount:U,moreLinkWillUnmount:U,monthStartFormat:Kt,handleCustomRendering:U,customRenderingMetaMap:U,customRenderingReplaces:Boolean},fd={eventDisplay:"auto",defaultRangeSeparator:" - ",titleRangeSeparator:" \u2013 ",defaultTimedEventDuration:"01:00:00",defaultAllDayEventDuration:{day:1},forceEventDuration:!1,nextDayThreshold:"00:00:00",dayHeaders:!0,initialView:"",aspectRatio:1.35,headerToolbar:{start:"title",center:"",end:"today prev,next"},weekends:!0,weekNumbers:!1,weekNumberCalculation:"local",editable:!1,nowIndicator:!1,scrollTime:"06:00:00",scrollTimeReset:!0,slotMinTime:"00:00:00",slotMaxTime:"24:00:00",showNonCurrentDates:!0,lazyFetching:!0,startParam:"start",endParam:"end",timeZoneParam:"timeZone",timeZone:"local",locales:[],locale:"",themeSystem:"standard",dragRevertDuration:500,dragScroll:!0,allDayMaintainDuration:!1,unselectAuto:!0,dropAccept:"*",eventOrder:"start,-duration,allDay,title",dayPopoverFormat:{month:"long",day:"numeric",year:"numeric"},handleWindowResize:!0,windowResizeDelay:100,longPressDelay:1e3,eventDragMinDistance:5,expandRows:!1,navLinks:!1,selectable:!1,eventMinHeight:15,eventMinWidth:30,eventShortHeight:30,monthStartFormat:{month:"long",day:"numeric"},nowIndicatorSnap:"auto"},y3={datesSet:U,eventsSet:U,eventAdd:U,eventChange:U,eventRemove:U,windowResize:U,eventClick:U,eventMouseEnter:U,eventMouseLeave:U,select:U,unselect:U,loading:U,_unmount:U,_beforeprint:U,_afterprint:U,_noEventDrop:U,_noEventResize:U,_resize:U,_scrollRequest:U},v3={buttonText:U,buttonHints:U,views:U,plugins:U,initialEvents:U,events:U,eventSources:U},tf={headerToolbar:Dg,footerToolbar:Dg,buttonText:Dg,buttonHints:Dg,buttonIcons:Dg,dateIncrement:Dg,plugins:bF,events:bF,eventSources:bF,resources:bF};ZPe={type:String,component:U,buttonText:String,buttonTextKey:String,dateProfileGeneratorClass:U,usesMinMaxTime:Boolean,classNames:U,content:U,didMount:U,willUnmount:U};({hasOwnProperty:PF}=Object.prototype);sut=/^on[A-Z]/;JPe={};Q4=class{getMarkerYear(e){return e.getUTCFullYear()}getMarkerMonth(e){return e.getUTCMonth()}getMarkerDay(e){return e.getUTCDate()}arrayToMarker(e){return ys(e)}markerToArray(e){return Gm(e)}};dut("gregory",Q4);put=/^\s*(\d{4})(-?(\d{2})(-?(\d{2})([T ](\d{2}):?(\d{2})(:?(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/;hD=class{constructor(e){let t=this.timeZone=e.timeZone,n=t!=="local"&&t!=="UTC";e.namedTimeZoneImpl&&n&&(this.namedTimeZoneImpl=new e.namedTimeZoneImpl(t)),this.canComputeOffset=!!(!n||this.namedTimeZoneImpl),this.calendarSystem=uut(e.calendarSystem),this.locale=e.locale,this.weekDow=e.locale.week.dow,this.weekDoy=e.locale.week.doy,e.weekNumberCalculation==="ISO"&&(this.weekDow=1,this.weekDoy=4),typeof e.firstDay=="number"&&(this.weekDow=e.firstDay),typeof e.weekNumberCalculation=="function"&&(this.weekNumberFunc=e.weekNumberCalculation),this.weekText=e.weekText!=null?e.weekText:e.locale.options.weekText,this.weekTextLong=(e.weekTextLong!=null?e.weekTextLong:e.locale.options.weekTextLong)||this.weekText,this.cmdFormatter=e.cmdFormatter,this.defaultSeparator=e.defaultSeparator}createMarker(e){let t=this.createMarkerMeta(e);return t===null?null:t.marker}createNowMarker(){return this.canComputeOffset?this.timestampToMarker(new Date().valueOf()):ys(PPe(new Date))}createMarkerMeta(e){if(typeof e=="string")return this.parse(e);let t=null;return typeof e=="number"?t=this.timestampToMarker(e):e instanceof Date?(e=e.valueOf(),isNaN(e)||(t=this.timestampToMarker(e))):Array.isArray(e)&&(t=ys(e)),t===null||!m3(t)?null:{marker:t,isTimeUnspecified:!1,forcedTzo:null}}parse(e){let t=XPe(e);if(t===null)return null;let{marker:n}=t,a=null;return t.timeZoneOffset!==null&&(this.canComputeOffset?n=this.timestampToMarker(n.valueOf()-t.timeZoneOffset*60*1e3):a=t.timeZoneOffset),{marker:n,isTimeUnspecified:t.isTimeUnspecified,forcedTzo:a}}getYear(e){return this.calendarSystem.getMarkerYear(e)}getMonth(e){return this.calendarSystem.getMarkerMonth(e)}getDay(e){return this.calendarSystem.getMarkerDay(e)}add(e,t){let n=this.calendarSystem.markerToArray(e);return n[0]+=t.years,n[1]+=t.months,n[2]+=t.days,n[6]+=t.milliseconds,this.calendarSystem.arrayToMarker(n)}subtract(e,t){let n=this.calendarSystem.markerToArray(e);return n[0]-=t.years,n[1]-=t.months,n[2]-=t.days,n[6]-=t.milliseconds,this.calendarSystem.arrayToMarker(n)}addYears(e,t){let n=this.calendarSystem.markerToArray(e);return n[0]+=t,this.calendarSystem.arrayToMarker(n)}addMonths(e,t){let n=this.calendarSystem.markerToArray(e);return n[1]+=t,this.calendarSystem.arrayToMarker(n)}diffWholeYears(e,t){let{calendarSystem:n}=this;return Km(e)===Km(t)&&n.getMarkerDay(e)===n.getMarkerDay(t)&&n.getMarkerMonth(e)===n.getMarkerMonth(t)?n.getMarkerYear(t)-n.getMarkerYear(e):null}diffWholeMonths(e,t){let{calendarSystem:n}=this;return Km(e)===Km(t)&&n.getMarkerDay(e)===n.getMarkerDay(t)?n.getMarkerMonth(t)-n.getMarkerMonth(e)+(n.getMarkerYear(t)-n.getMarkerYear(e))*12:null}greatestWholeUnit(e,t){let n=this.diffWholeYears(e,t);return n!==null?{unit:"year",value:n}:(n=this.diffWholeMonths(e,t),n!==null?{unit:"month",value:n}:(n=KPe(e,t),n!==null?{unit:"week",value:n}:(n=Fb(e,t),n!==null?{unit:"day",value:n}:(n=$dt(e,t),mD(n)?{unit:"hour",value:n}:(n=Bdt(e,t),mD(n)?{unit:"minute",value:n}:(n=Udt(e,t),mD(n)?{unit:"second",value:n}:{unit:"millisecond",value:t.valueOf()-e.valueOf()}))))))}countDurationsBetween(e,t,n){let a;return n.years&&(a=this.diffWholeYears(e,t),a!==null)?a/Ldt(n):n.months&&(a=this.diffWholeMonths(e,t),a!==null)?a/zdt(n):n.days&&(a=Fb(e,t),a!==null)?a/Rb(n):(t.valueOf()-e.valueOf())/lo(n)}startOf(e,t){return t==="year"?this.startOfYear(e):t==="month"?this.startOfMonth(e):t==="week"?this.startOfWeek(e):t==="day"?gr(e):t==="hour"?Hdt(e):t==="minute"?Vdt(e):t==="second"?qdt(e):null}startOfYear(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e)])}startOfMonth(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e)])}startOfWeek(e){return this.calendarSystem.arrayToMarker([this.calendarSystem.getMarkerYear(e),this.calendarSystem.getMarkerMonth(e),e.getUTCDate()-(e.getUTCDay()-this.weekDow+7)%7])}computeWeekNumber(e){return this.weekNumberFunc?this.weekNumberFunc(this.toDate(e)):Wdt(e,this.weekDow,this.weekDoy)}format(e,t,n={}){return t.format({marker:e,timeZoneOffset:n.forcedTzo!=null?n.forcedTzo:this.offsetForMarker(e)},this)}formatRange(e,t,n,a={}){return a.isEndExclusive&&(t=ld(t,-1)),n.formatRange({marker:e,timeZoneOffset:a.forcedStartTzo!=null?a.forcedStartTzo:this.offsetForMarker(e)},{marker:t,timeZoneOffset:a.forcedEndTzo!=null?a.forcedEndTzo:this.offsetForMarker(t)},this,a.defaultSeparator)}formatIso(e,t={}){let n=null;return t.omitTimeZoneOffset||(t.forcedTzo!=null?n=t.forcedTzo:n=this.offsetForMarker(e)),zF(e,n,t.omitTime)}timestampToMarker(e){return this.timeZone==="local"?ys(PPe(new Date(e))):this.timeZone==="UTC"||!this.namedTimeZoneImpl?new Date(e):ys(this.namedTimeZoneImpl.timestampToArray(e))}offsetForMarker(e){return this.timeZone==="local"?-MPe(Gm(e)).getTimezoneOffset():this.timeZone==="UTC"?0:this.namedTimeZoneImpl?this.namedTimeZoneImpl.offsetForArray(Gm(e)):null}toDate(e,t){return this.timeZone==="local"?MPe(Gm(e)):this.timeZone==="UTC"?new Date(e.valueOf()):this.namedTimeZoneImpl?new Date(e.valueOf()-this.namedTimeZoneImpl.offsetForArray(Gm(e))*1e3*60):new Date(e.valueOf()-(t||0))}},Qu=class{constructor(e){this.iconOverrideOption&&this.setIconOverride(e[this.iconOverrideOption])}setIconOverride(e){let t,n;if(typeof e=="object"&&e){t=Object.assign({},this.iconClasses);for(n in e)t[n]=this.applyIconOverridePrefix(e[n]);this.iconClasses=t}else e===!1&&(this.iconClasses={})}applyIconOverridePrefix(e){let t=this.iconOverridePrefix;return t&&e.indexOf(t)!==0&&(e=t+e),e}getClass(e){return this.classes[e]||""}getIconClass(e,t){let n;return t&&this.rtlIconClasses?n=this.rtlIconClasses[e]||this.iconClasses[e]:n=this.iconClasses[e],n?`${this.baseIconClass} ${n}`:""}getCustomButtonIconClass(e){let t;return this.iconOverrideCustomButtonOption&&(t=e[this.iconOverrideCustomButtonOption],t)?`${this.baseIconClass} ${this.applyIconOverridePrefix(t)}`:""}};Qu.prototype.classes={};Qu.prototype.iconClasses={};Qu.prototype.baseIconClass="";Qu.prototype.iconOverridePrefix="";J4=class extends Ha{render(){return _("div",{})}componentDidMount(){this.setState({})}};MF=class{constructor(e,t,n,a){this.execFunc=e,this.emitter=t,this.scrollTime=n,this.scrollTimeReset=a,this.handleScrollRequest=i=>{this.queuedRequest=Object.assign({},this.queuedRequest||{},i),this.drain()},t.on("_scrollRequest",this.handleScrollRequest),this.fireInitialScroll()}detach(){this.emitter.off("_scrollRequest",this.handleScrollRequest)}update(e){e&&this.scrollTimeReset?this.fireInitialScroll():this.drain()}fireInitialScroll(){this.handleScrollRequest({time:this.scrollTime})}drain(){this.queuedRequest&&this.execFunc(this.queuedRequest)&&(this.queuedRequest=null)}},tl=e0e({});cd=class extends Ha{shouldComponentUpdate(e,t){return!xF(this.props,e,this.propEquality)||!xF(this.state,t,this.stateEquality)}safeSetState(e){xF(this.state,Object.assign(Object.assign({},this.state),e),this.stateEquality)||this.setState(e)}};cd.addPropsEquality=mut;cd.addStateEquality=fut;cd.contextType=tl;cd.prototype.propEquality={};cd.prototype.stateEquality={};Pt=class extends cd{};Pt.contextType=tl;yD=class extends Pt{constructor(){super(...arguments),this.id=tp(),this.queuedDomNodes=[],this.currentDomNodes=[],this.handleEl=e=>{let{options:t}=this.context,{generatorName:n}=this.props;(!t.customRenderingReplaces||!X4(n,t))&&this.updateElRef(e)},this.updateElRef=e=>{this.props.elRef&&uo(this.props.elRef,e)}}render(){let{props:e,context:t}=this,{options:n}=t,{customGenerator:a,defaultGenerator:i,renderProps:s}=e,o=b3(e,[],this.handleEl),l=!1,c,d=[],u;if(a!=null){let p=typeof a=="function"?a(s,_):a;if(p===!0)l=!0;else{let m=p&&typeof p=="object";m&&"html"in p?o.dangerouslySetInnerHTML={__html:p.html}:m&&"domNodes"in p?d=Array.prototype.slice.call(p.domNodes):(m?M4(p):typeof p!="function")?c=p:u=p}}else l=!X4(e.generatorName,n);return l&&i&&(c=i(s)),this.queuedDomNodes=d,this.currentGeneratorMeta=u,_(e.elTag,o,c)}componentDidMount(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentDidUpdate(){this.applyQueueudDomNodes(),this.triggerCustomRendering(!0)}componentWillUnmount(){this.triggerCustomRendering(!1)}triggerCustomRendering(e){var t;let{props:n,context:a}=this,{handleCustomRendering:i,customRenderingMetaMap:s}=a.options;if(i){let o=(t=this.currentGeneratorMeta)!==null&&t!==void 0?t:s==null?void 0:s[n.generatorName];o&&i(Object.assign(Object.assign({id:this.id,isActive:e,containerEl:this.base,reportNewContainerEl:this.updateElRef,generatorMeta:o},n),{elClasses:(n.elClasses||[]).filter(hut)}))}}applyQueueudDomNodes(){let{queuedDomNodes:e,currentDomNodes:t}=this,n=this.base;if(!pd(e,t)){t.forEach(PD);for(let a of e)n.appendChild(a);this.currentDomNodes=e}}};yD.addPropsEquality({elClasses:pd,elStyle:gi,elAttrs:out,renderProps:gi});T3=e0e(0),Ln=class extends Ha{constructor(){super(...arguments),this.InnerContent=gut.bind(void 0,this),this.handleEl=e=>{this.el=e,this.props.elRef&&(uo(this.props.elRef,e),e&&this.didMountMisfire&&this.componentDidMount())}}render(){let{props:e}=this,t=yut(e.classNameGenerator,e.renderProps);if(e.children){let n=b3(e,t,this.handleEl),a=e.children(this.InnerContent,e.renderProps,n);return e.elTag?_(e.elTag,n,a):a}else return _(yD,Object.assign(Object.assign({},e),{elRef:this.handleEl,elTag:e.elTag||"div",elClasses:(e.elClasses||[]).concat(t),renderId:this.context}))}componentDidMount(){var e,t;this.el?(t=(e=this.props).didMount)===null||t===void 0||t.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el})):this.didMountMisfire=!0}componentWillUnmount(){var e,t;(t=(e=this.props).willUnmount)===null||t===void 0||t.call(e,Object.assign(Object.assign({},this.props.renderProps),{el:this.el}))}};Ln.contextType=T3;co=class extends Pt{render(){let{props:e,context:t}=this,{options:n}=t,a={view:t.viewApi};return _(Ln,{elRef:e.elRef,elTag:e.elTag||"div",elAttrs:e.elAttrs,elClasses:[...w3(e.viewSpec),...e.elClasses||[]],elStyle:e.elStyle,renderProps:a,classNameGenerator:n.viewClassNames,generatorName:void 0,didMount:n.viewDidMount,willUnmount:n.viewWillUnmount},()=>e.children)}};Ag=class{constructor(e){this.props=e,this.initHiddenDays()}buildPrev(e,t,n){let{dateEnv:a}=this.props,i=a.subtract(a.startOf(t,e.currentRangeUnit),e.dateIncrement);return this.build(i,-1,n)}buildNext(e,t,n){let{dateEnv:a}=this.props,i=a.add(a.startOf(t,e.currentRangeUnit),e.dateIncrement);return this.build(i,1,n)}build(e,t,n=!0){let{props:a}=this,i,s,o,l,c,d;return i=this.buildValidRange(),i=this.trimHiddenDays(i),n&&(e=but(e,i)),s=this.buildCurrentRangeInfo(e,t),o=/^(year|month|week|day)$/.test(s.unit),l=this.buildRenderRange(this.trimHiddenDays(s.range),s.unit,o),l=this.trimHiddenDays(l),c=l,a.showNonCurrentDates||(c=Vi(c,s.range)),c=this.adjustActiveRange(c),c=Vi(c,i),d=UF(s.range,i),Xo(l,e)||(e=l.start),{currentDate:e,validRange:i,currentRange:s.range,currentRangeUnit:s.unit,isRangeAllDay:o,activeRange:c,renderRange:l,slotMinTime:a.slotMinTime,slotMaxTime:a.slotMaxTime,isValid:d,dateIncrement:this.buildDateIncrement(s.duration)}}buildValidRange(){let e=this.props.validRangeInput,t=typeof e=="function"?e.call(this.props.calendarApi,this.props.dateEnv.toDate(this.props.nowManager.getDateMarker())):e;return this.refineRange(t)||{start:null,end:null}}buildCurrentRangeInfo(e,t){let{props:n}=this,a=null,i=null,s=null,o;return n.duration?(a=n.duration,i=n.durationUnit,s=this.buildRangeFromDuration(e,t,a,i)):(o=this.props.dayCount)?(i="day",s=this.buildRangeFromDayCount(e,t,o)):(s=this.buildCustomVisibleRange(e))?i=n.dateEnv.greatestWholeUnit(s.start,s.end).unit:(a=this.getFallbackDuration(),i=fD(a).unit,s=this.buildRangeFromDuration(e,t,a,i)),{duration:a,unit:i,range:s}}getFallbackDuration(){return mt({day:1})}adjustActiveRange(e){let{dateEnv:t,usesMinMaxTime:n,slotMinTime:a,slotMaxTime:i}=this.props,{start:s,end:o}=e;return n&&(Rb(a)<0&&(s=gr(s),s=t.add(s,a)),Rb(i)>1&&(o=gr(o),o=hn(o,-1),o=t.add(o,i))),{start:s,end:o}}buildRangeFromDuration(e,t,n,a){let{dateEnv:i,dateAlignment:s}=this.props,o,l,c;if(!s){let{dateIncrement:u}=this.props;u&&lo(u){gD(()=>{this.setState({forPrint:!0})})},this.handleAfterPrint=()=>{gD(()=>{this.setState({forPrint:!1})})}}render(){let{props:e}=this,{options:t}=e,{forPrint:n}=this.state,a=n||t.height==="auto"||t.contentHeight==="auto",i=!a&&t.height!=null?t.height:"",s=["fc",n?"fc-media-print":"fc-media-screen",`fc-direction-${t.direction}`,e.theme.getClass("root")];return O3()||s.push("fc-liquid-hack"),e.children(s,i,a,n)}componentDidMount(){let{emitter:e}=this.props;e.on("_beforeprint",this.handleBeforePrint),e.on("_afterprint",this.handleAfterPrint)}componentWillUnmount(){let{emitter:e}=this.props;e.off("_beforeprint",this.handleBeforePrint),e.off("_afterprint",this.handleAfterPrint)}},ec=class{constructor(e){this.component=e.component,this.isHitComboAllowed=e.isHitComboAllowed||null}destroy(){}};Ug={},vs=class extends Ha{constructor(e,t){super(e,t),this.handleRefresh=()=>{let n=this.computeTiming();n.state.nowDate.valueOf()!==this.state.nowDate.valueOf()&&this.setState(n.state),this.clearTimeout(),this.setTimeout(n.waitMs)},this.handleVisibilityChange=()=>{document.hidden||this.handleRefresh()},this.state=this.computeTiming().state}render(){let{props:e,state:t}=this;return e.children(t.nowDate,t.todayRange)}componentDidMount(){this.setTimeout(),this.context.nowManager.addResetListener(this.handleRefresh),document.addEventListener("visibilitychange",this.handleVisibilityChange)}componentDidUpdate(e){e.unit!==this.props.unit&&(this.clearTimeout(),this.setTimeout())}componentWillUnmount(){this.clearTimeout(),this.context.nowManager.removeResetListener(this.handleRefresh),document.removeEventListener("visibilitychange",this.handleVisibilityChange)}computeTiming(){let{props:e,context:t}=this,n=t.nowManager.getDateMarker(),{nowIndicatorSnap:a}=t.options;a==="auto"&&(a=/year|month|week|day/.test(e.unit)||(e.unitValue||1)===1);let i,s;return a?(i=t.dateEnv.startOf(n,e.unit),s=t.dateEnv.add(i,mt(1,e.unit)).valueOf()-n.valueOf()):(i=n,s=1e3*60),s=Math.min(1e3*60*60*24,s),{state:{nowDate:i,todayRange:npt(i)},waitMs:s}}setTimeout(e=this.computeTiming().waitMs){this.timeoutId=setTimeout(()=>{let t=this.computeTiming();this.setState(t.state,()=>{this.setTimeout(t.waitMs)})},e)}clearTimeout(){this.timeoutId&&clearTimeout(this.timeoutId)}};vs.contextType=tl;TD=class{getCurrentData(){return this.currentDataManager.getCurrentData()}dispatch(e){this.currentDataManager.dispatch(e)}get view(){return this.getCurrentData().viewApi}batchRendering(e){e()}updateSize(){this.trigger("_resize",!0)}setOption(e,t){this.dispatch({type:"SET_OPTION",optionName:e,rawOptionValue:t})}getOption(e){return this.currentDataManager.currentCalendarOptionsInput[e]}getAvailableLocaleCodes(){return Object.keys(this.getCurrentData().availableRawLocales)}on(e,t){let{currentDataManager:n}=this;n.currentCalendarOptionsRefiners[e]?n.emitter.on(e,t):console.warn(`Unknown listener name '${e}'`)}off(e,t){this.currentDataManager.emitter.off(e,t)}trigger(e,...t){this.currentDataManager.emitter.trigger(e,...t)}changeView(e,t){this.batchRendering(()=>{if(this.unselect(),t)if(t.start&&t.end)this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e}),this.dispatch({type:"SET_OPTION",optionName:"visibleRange",rawOptionValue:t});else{let{dateEnv:n}=this.getCurrentData();this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e,dateMarker:n.createMarker(t)})}else this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:e})})}zoomTo(e,t){let n=this.getCurrentData(),a;t=t||"day",a=n.viewSpecs[t]||this.getUnitViewSpec(t),this.unselect(),a?this.dispatch({type:"CHANGE_VIEW_TYPE",viewType:a.type,dateMarker:e}):this.dispatch({type:"CHANGE_DATE",dateMarker:e})}getUnitViewSpec(e){let{viewSpecs:t,toolbarConfig:n}=this.getCurrentData(),a=[].concat(n.header?n.header.viewsWithButtons:[],n.footer?n.footer.viewsWithButtons:[]),i,s;for(let o in t)a.push(o);for(i=0;i{this.dispatch({type:"REMOVE_EVENTS",eventStore:c0e(e)})}})}getEventById(e){let t=this.getCurrentData(),{defs:n,instances:a}=t.eventStore;e=String(e);for(let i in n){let s=n[i];if(s.publicId===e){if(s.recurringDef)return new Or(t,s,null);for(let o in a){let l=a[o];if(l.defId===s.defId)return new Or(t,s,l)}}}return null}getEvents(){let e=this.getCurrentData();return hd(e.eventStore,e)}removeAllEvents(){this.dispatch({type:"REMOVE_ALL_EVENTS"})}getEventSources(){let e=this.getCurrentData(),t=e.eventSources,n=[];for(let a in t)n.push(new Ym(e,t[a]));return n}getEventSourceById(e){let t=this.getCurrentData(),n=t.eventSources;e=String(e);for(let a in n)if(n[a].publicId===e)return new Ym(t,n[a]);return null}addEventSource(e){let t=this.getCurrentData();if(e instanceof Ym)return t.eventSources[e.internalEventSource.sourceId]||this.dispatch({type:"ADD_EVENT_SOURCES",sources:[e.internalEventSource]}),e;let n=E3(e,t);return n?(this.dispatch({type:"ADD_EVENT_SOURCES",sources:[n]}),new Ym(t,n)):null}removeAllEventSources(){this.dispatch({type:"REMOVE_ALL_EVENT_SOURCES"})}refetchEvents(){this.dispatch({type:"FETCH_EVENT_SOURCES",isRefetch:!0})}scrollToTime(e){let t=mt(e);t&&this.trigger("_scrollRequest",{time:t})}};B4=va(),wD=class{constructor(){this.getKeysForEventDefs=_e(this._getKeysForEventDefs),this.splitDateSelection=_e(this._splitDateSpan),this.splitEventStore=_e(this._splitEventStore),this.splitIndividualUi=_e(this._splitIndividualUi),this.splitEventDrag=_e(this._splitInteraction),this.splitEventResize=_e(this._splitInteraction),this.eventUiBuilders={}}splitProps(e){let t=this.getKeyInfo(e),n=this.getKeysForEventDefs(e.eventStore),a=this.splitDateSelection(e.dateSelection),i=this.splitIndividualUi(e.eventUiBases,n),s=this.splitEventStore(e.eventStore,n),o=this.splitEventDrag(e.eventDrag),l=this.splitEventResize(e.eventResize),c={};this.eventUiBuilders=el(t,(d,u)=>this.eventUiBuilders[u]||_e(apt));for(let d in t){let u=t[d],p=s[d]||B4,m=this.eventUiBuilders[d];c[d]={businessHours:u.businessHours||e.businessHours,dateSelection:a[d]||null,eventStore:p,eventUiBases:m(e.eventUiBases[""],u.ui,i[d]),eventSelection:p.instances[e.eventSelection]?e.eventSelection:"",eventDrag:o[d]||null,eventResize:l[d]||null}}return c}_splitDateSpan(e){let t={};if(e){let n=this.getKeysForDateSpan(e);for(let a of n)t[a]=e}return t}_getKeysForEventDefs(e){return el(e.defs,t=>this.getKeysForEventDef(t))}_splitEventStore(e,t){let{defs:n,instances:a}=e,i={};for(let s in n)for(let o of t[s])i[o]||(i[o]=va()),i[o].defs[s]=n[s];for(let s in a){let o=a[s];for(let l of t[o.defId])i[l]&&(i[l].instances[s]=o)}return i}_splitIndividualUi(e,t){let n={};for(let a in e)if(a)for(let i of t[a])n[i]||(n[i]={}),n[i][a]=e[a];return n}_splitInteraction(e){let t={};if(e){let n=this._splitEventStore(e.affectedEvents,this._getKeysForEventDefs(e.affectedEvents)),a=this._getKeysForEventDefs(e.mutatedEvents),i=this._splitEventStore(e.mutatedEvents,a),s=o=>{t[o]||(t[o]={affectedEvents:n[o]||B4,mutatedEvents:i[o]||B4,isEvent:e.isEvent})};for(let o in n)s(o);for(let o in i)s(o)}return t}};ipt=Kt({year:"numeric",month:"long",day:"numeric"}),spt=Kt({week:"long"});U4=null;tc=class{constructor(e,t,n,a){this.els=t;let i=this.originClientRect=e.getBoundingClientRect();n&&this.buildElHorizontals(i.left),a&&this.buildElVerticals(i.top)}buildElHorizontals(e){let t=[],n=[];for(let a of this.els){let i=a.getBoundingClientRect();t.push(i.left-e),n.push(i.right-e)}this.lefts=t,this.rights=n}buildElVerticals(e){let t=[],n=[];for(let a of this.els){let i=a.getBoundingClientRect();t.push(i.top-e),n.push(i.bottom-e)}this.tops=t,this.bottoms=n}leftToIndex(e){let{lefts:t,rights:n}=this,a=t.length,i;for(i=0;i=t[i]&&e=t[i]&&e0}canScrollHorizontally(){return this.getMaxScrollLeft()>0}canScrollUp(){return this.getScrollTop()>0}canScrollDown(){return this.getScrollTop()0}canScrollRight(){return this.getScrollLeft()t.thickness||1){this.getEntryThickness=e,this.strictOrder=!1,this.allowReslicing=!1,this.maxCoord=-1,this.maxStackCnt=-1,this.levelCoords=[],this.entriesByLevel=[],this.stackCnts={}}addSegs(e){let t=[];for(let n of e)this.insertEntry(n,t);return t}insertEntry(e,t){let n=this.findInsertion(e);this.isInsertionValid(n,e)?this.insertEntryAt(e,n):this.handleInvalidInsertion(n,e,t)}isInsertionValid(e,t){return(this.maxCoord===-1||e.levelCoord+this.getEntryThickness(t)<=this.maxCoord)&&(this.maxStackCnt===-1||e.stackCnti.end&&this.insertEntry({index:e.index,thickness:e.thickness,span:{start:i.end,end:a.end}},n)}insertEntryAt(e,t){let{entriesByLevel:n,levelCoords:a}=this;t.lateral===-1?(V4(a,t.level,t.levelCoord),V4(n,t.level,[e])):V4(n[t.level],t.lateral,e),this.stackCnts[dd(e)]=t.stackCnt}findInsertion(e){let{levelCoords:t,entriesByLevel:n,strictOrder:a,stackCnts:i}=this,s=t.length,o=0,l=-1,c=-1,d=null,u=0;for(let f=0;f=o+this.getEntryThickness(e))break;let g=n[f],v,b=ED(g,e.span.start,CD),k=b[0]+b[1];for(;(v=g[k])&&v.span.starto&&(o=w,d=v,l=f,c=k),w===o&&(u=Math.max(u,i[dd(v)]+1)),k+=1}}let p=0;if(d)for(p=l+1;p1?gd(this.context,s):{},p=e.toDate(s);e.namedTimeZoneImpl&&(p=ld(p,36e5));let m=Object.assign(Object.assign(Object.assign({date:p,view:a},i.extraRenderProps),{text:d}),l);return _(Ln,{elTag:"th",elClasses:c,elAttrs:Object.assign({role:"columnheader",colSpan:i.colSpan,"data-date":l.isDisabled?void 0:ef(s)},i.extraDataAttrs),renderProps:m,generatorName:"dayHeaderContent",customGenerator:t.dayHeaderContent,defaultGenerator:k0e,classNameGenerator:t.dayHeaderClassNames,didMount:t.dayHeaderDidMount,willUnmount:t.dayHeaderWillUnmount},f=>_("div",{className:"fc-scrollgrid-sync-inner"},!l.isDisabled&&_(f,{elTag:"a",elAttrs:u,elClasses:["fc-col-header-cell-cushion",i.isSticky&&"fc-sticky"]})))}},ppt=Kt({weekday:"long"}),RF=class extends Pt{render(){let{props:e}=this,{dateEnv:t,theme:n,viewApi:a,options:i}=this.context,s=hn(new Date(2592e5),e.dow),o={dow:e.dow,isDisabled:!1,isFuture:!1,isPast:!1,isToday:!1,isOther:!1},l=t.format(s,e.dayHeaderFormat),c=Object.assign(Object.assign(Object.assign(Object.assign({date:s},o),{view:a}),e.extraRenderProps),{text:l});return _(Ln,{elTag:"th",elClasses:[v0e,...Gb(o,n),...e.extraClassNames||[]],elAttrs:Object.assign({role:"columnheader",colSpan:e.colSpan},e.extraDataAttrs),renderProps:c,generatorName:"dayHeaderContent",customGenerator:i.dayHeaderContent,defaultGenerator:k0e,classNameGenerator:i.dayHeaderClassNames,didMount:i.dayHeaderDidMount,willUnmount:i.dayHeaderWillUnmount},d=>_("div",{className:"fc-scrollgrid-sync-inner"},_(d,{elTag:"a",elClasses:["fc-col-header-cell-cushion",e.isSticky&&"fc-sticky"],elAttrs:{"aria-label":t.format(s,ppt)}})))}},Xu=class extends Pt{constructor(){super(...arguments),this.createDayHeaderFormatter=_e(mpt)}render(){let{context:e}=this,{dates:t,dateProfile:n,datesRepDistinctDays:a,renderIntro:i}=this.props,s=this.createDayHeaderFormatter(e.options.dayHeaderFormat,a,t.length);return _(vs,{unit:"day"},(o,l)=>_("tr",{role:"row"},i&&i("day"),t.map(c=>a?_(NF,{key:c.toISOString(),date:c,dateProfile:n,todayRange:l,colCnt:t.length,dayHeaderFormat:s}):_(RF,{key:c.getUTCDay(),dow:c.getUTCDay(),dayHeaderFormat:s}))))}};Fg=class{constructor(e,t){let n=e.start,{end:a}=e,i=[],s=[],o=-1;for(;n=t.length?t[t.length-1]+1:t[n]}},Og=class{constructor(e,t){let{dates:n}=e,a,i,s;if(t){for(i=n[0].getUTCDay(),a=1;a{this.el=e,uo(this.props.elRef,e)}}render(){let{props:e}=this,{liquid:t,liquidIsAbsolute:n}=e,a=t&&n,i=["fc-scroller"];return t&&(n?i.push("fc-scroller-liquid-absolute"):i.push("fc-scroller-liquid")),_("div",{ref:this.handleEl,className:i.join(" "),style:{overflowX:e.overflowX,overflowY:e.overflowY,left:a&&-(e.overcomeLeft||0)||"",right:a&&-(e.overcomeRight||0)||"",bottom:a&&-(e.overcomeBottom||0)||"",marginLeft:!a&&-(e.overcomeLeft||0)||"",marginRight:!a&&-(e.overcomeRight||0)||"",marginBottom:!a&&-(e.overcomeBottom||0)||"",maxHeight:e.maxHeight||""}},e.children)}needsXScrolling(){if(SF.test(this.props.overflowX))return!1;let{el:e}=this,t=this.el.getBoundingClientRect().width-this.getYScrollbarWidth(),{children:n}=e;for(let a=0;at)return!0;return!1}needsYScrolling(){if(SF.test(this.props.overflowY))return!1;let{el:e}=this,t=this.el.getBoundingClientRect().height-this.getXScrollbarWidth(),{children:n}=e;for(let a=0;at)return!0;return!1}getXScrollbarWidth(){return SF.test(this.props.overflowX)?0:this.el.offsetHeight-this.el.clientHeight}getYScrollbarWidth(){return SF.test(this.props.overflowY)?0:this.el.offsetWidth-this.el.clientWidth}},ks=class{constructor(e){this.masterCallback=e,this.currentMap={},this.depths={},this.callbackMap={},this.handleValue=(t,n)=>{let{depths:a,currentMap:i}=this,s=!1,o=!1;t!==null?(s=n in i,i[n]=t,a[n]=(a[n]||0)+1,o=!0):(a[n]-=1,a[n]||(delete i[n],delete this.callbackMap[n],s=!0)),this.masterCallback&&(s&&this.masterCallback(null,String(n)),o&&this.masterCallback(t,String(n)))}}createRef(e){let t=this.callbackMap[e];return t||(t=this.callbackMap[e]=n=>{this.handleValue(n,String(e))}),t}collect(e,t,n){return QPe(this.currentMap,e,t,n)}getAll(){return BF(this.currentMap)}};Qm=class extends Pt{constructor(){super(...arguments),this.processCols=_e(e=>e,E0e),this.renderMicroColGroup=_e(D0e),this.scrollerRefs=new ks,this.scrollerElRefs=new ks(this._handleScrollerEl.bind(this)),this.state={shrinkWidth:null,forceYScrollbars:!1,scrollerClientWidths:{},scrollerClientHeights:{}},this.handleSizing=()=>{this.safeSetState(Object.assign({shrinkWidth:this.computeShrinkWidth()},this.computeScrollerDims()))}}render(){let{props:e,state:t,context:n}=this,a=e.sections||[],i=this.processCols(e.cols),s=this.renderMicroColGroup(i,t.shrinkWidth),o=A0e(e.liquid,n);e.collapsibleWidth&&o.push("fc-scrollgrid-collapsible");let l=a.length,c=0,d,u=[],p=[],m=[];for(;c{}},a);return _(a?"th":"td",{ref:n.elRef,role:"presentation"},_("div",{className:`fc-scroller-harness${d?" fc-scroller-harness-liquid":""}`},_(zb,{ref:this.scrollerRefs.createRef(p),elRef:this.scrollerElRefs.createRef(p),overflowY:u,overflowX:i.liquid?"hidden":"visible",maxHeight:e.maxHeight,liquid:d,liquidIsAbsolute:!0},m)))}_handleScrollerEl(e,t){let n=vpt(this.props.sections,t);n&&uo(n.chunk.scrollerElRef,e)}componentDidMount(){this.handleSizing(),this.context.addResizeHandler(this.handleSizing)}componentDidUpdate(){this.handleSizing()}componentWillUnmount(){this.context.removeResizeHandler(this.handleSizing)}computeShrinkWidth(){return M0e(this.props.cols)?S0e(this.scrollerElRefs.getAll()):0}computeScrollerDims(){let e=f0e(),{scrollerRefs:t,scrollerElRefs:n}=this,a=!1,i={},s={};for(let o in t.currentMap){let l=t.currentMap[o];if(l&&l.needsYScrolling()){a=!0;break}}for(let o of this.props.sections){let l=o.key,c=n.currentMap[l];if(c){let d=c.parentNode;i[l]=Math.floor(d.getBoundingClientRect().width-(a?e.y:0)),s[l]=Math.floor(d.getBoundingClientRect().height)}}return{forceYScrollbars:a,scrollerClientWidths:i,scrollerClientHeights:s}}};Qm.addStateEquality({scrollerClientWidths:gi,scrollerClientHeights:gi});ep=class extends Pt{constructor(){super(...arguments),this.buildPublicEvent=_e((e,t,n)=>new Or(e,t,n)),this.handleEl=e=>{this.el=e,uo(this.props.elRef,e),e&&RPe(e,this.props.seg)}}render(){let{props:e,context:t}=this,{options:n}=t,{seg:a}=e,{eventRange:i}=a,{ui:s}=i,o={event:this.buildPublicEvent(t,i.def,i.instance),view:t.viewApi,timeText:e.timeText,textColor:s.textColor,backgroundColor:s.backgroundColor,borderColor:s.borderColor,isDraggable:!e.disableDragging&&Wut(a,t),isStartResizable:!e.disableResizing&&Yut(a,t),isEndResizable:!e.disableResizing&&Gut(a),isMirror:!!(e.isDragging||e.isResizing||e.isDateSelecting),isStart:!!a.isStart,isEnd:!!a.isEnd,isPast:!!e.isPast,isFuture:!!e.isFuture,isToday:!!e.isToday,isSelected:!!e.isSelected,isDragging:!!e.isDragging,isResizing:!!e.isResizing};return _(Ln,{elRef:this.handleEl,elTag:e.elTag,elAttrs:e.elAttrs,elClasses:[...Kut(o),...a.eventRange.ui.classNames,...e.elClasses||[]],elStyle:e.elStyle,renderProps:o,generatorName:"eventContent",customGenerator:n.eventContent,defaultGenerator:e.defaultGenerator,classNameGenerator:n.eventClassNames,didMount:n.eventDidMount,willUnmount:n.eventWillUnmount},e.children)}componentDidUpdate(e){this.el&&this.props.seg!==e.seg&&RPe(this.el,this.props.seg)}},Jm=class extends Pt{render(){let{props:e,context:t}=this,{options:n}=t,{seg:a}=e,{ui:i}=a.eventRange,s=n.eventTimeFormat||e.defaultTimeFormat,o=rf(a,s,t,e.defaultDisplayEventTime,e.defaultDisplayEventEnd);return _(ep,Object.assign({},e,{elTag:"a",elStyle:{borderColor:i.borderColor,backgroundColor:i.backgroundColor},elAttrs:Yb(a,t),defaultGenerator:kpt,timeText:o}),(l,c)=>_(Gt,null,_(l,{elTag:"div",elClasses:["fc-event-main"],elStyle:{color:c.textColor}}),!!c.isStartResizable&&_("div",{className:"fc-event-resizer fc-event-resizer-start"}),!!c.isEndResizable&&_("div",{className:"fc-event-resizer fc-event-resizer-end"})))}};Jm.addPropsEquality({seg:gi});VD=r=>_(tl.Consumer,null,e=>{let{options:t}=e,n={isAxis:r.isAxis,date:e.dateEnv.toDate(r.date),view:e.viewApi};return _(Ln,{elRef:r.elRef,elTag:r.elTag||"div",elAttrs:r.elAttrs,elClasses:r.elClasses,elStyle:r.elStyle,renderProps:n,generatorName:"nowIndicatorContent",customGenerator:t.nowIndicatorContent,classNameGenerator:t.nowIndicatorClassNames,didMount:t.nowIndicatorDidMount,willUnmount:t.nowIndicatorWillUnmount},r.children)}),bpt=Kt({day:"numeric"}),Xm=class extends Pt{constructor(){super(...arguments),this.refineRenderProps=Hb(Tpt)}render(){let{props:e,context:t}=this,{options:n}=t,a=this.refineRenderProps({date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,isMonthStart:e.isMonthStart||!1,showDayNumber:e.showDayNumber,extraRenderProps:e.extraRenderProps,viewApi:t.viewApi,dateEnv:t.dateEnv,monthStartFormat:n.monthStartFormat});return _(Ln,{elRef:e.elRef,elTag:e.elTag,elAttrs:Object.assign(Object.assign({},e.elAttrs),a.isDisabled?{}:{"data-date":ef(e.date)}),elClasses:[...Gb(a,t.theme),...e.elClasses||[]],elStyle:e.elStyle,renderProps:a,generatorName:"dayCellContent",customGenerator:n.dayCellContent,defaultGenerator:e.defaultGenerator,classNameGenerator:a.isDisabled?void 0:n.dayCellClassNames,didMount:n.dayCellDidMount,willUnmount:n.dayCellWillUnmount},e.children)}};zg=class extends Pt{render(){let{props:e}=this,{seg:t}=e;return _(ep,{elTag:"div",elClasses:["fc-bg-event"],elStyle:{backgroundColor:t.eventRange.ui.backgroundColor},defaultGenerator:wpt,seg:t,timeText:"",isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,isPast:e.isPast,isFuture:e.isFuture,isToday:e.isToday,disableDragging:!0,disableResizing:!0})}};WD=r=>_(tl.Consumer,null,e=>{let{dateEnv:t,options:n}=e,{date:a}=r,i=n.weekNumberFormat||r.defaultFormat,s=t.computeWeekNumber(a),o=t.format(a,i),l={num:s,text:o,date:a};return _(Ln,{elRef:r.elRef,elTag:r.elTag,elAttrs:r.elAttrs,elClasses:r.elClasses,elStyle:r.elStyle,renderProps:l,generatorName:"weekNumberContent",customGenerator:n.weekNumberContent,defaultGenerator:Spt,classNameGenerator:n.weekNumberClassNames,didMount:n.weekNumberDidMount,willUnmount:n.weekNumberWillUnmount},r.children)});W4=10,t3=class extends Pt{constructor(){super(...arguments),this.state={titleId:bs()},this.handleRootEl=e=>{this.rootEl=e,this.props.elRef&&uo(this.props.elRef,e)},this.handleDocumentMouseDown=e=>{let t=OF(e);this.rootEl.contains(t)||this.handleCloseClick()},this.handleDocumentKeyDown=e=>{e.key==="Escape"&&this.handleCloseClick()},this.handleCloseClick=()=>{let{onClose:e}=this.props;e&&e()}}render(){let{theme:e,options:t}=this.context,{props:n,state:a}=this,i=["fc-popover",e.getClass("popover")].concat(n.extraClassNames||[]);return O4(_("div",Object.assign({},n.extraAttrs,{id:n.id,className:i.join(" "),"aria-labelledby":a.titleId,ref:this.handleRootEl}),_("div",{className:"fc-popover-header "+e.getClass("popoverHeader")},_("span",{className:"fc-popover-title",id:a.titleId},n.title),_("span",{className:"fc-popover-close "+e.getIconClass("close"),title:t.closeHint,onClick:this.handleCloseClick})),_("div",{className:"fc-popover-body "+e.getClass("popoverContent")},n.children)),n.parentEl)}componentDidMount(){document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown),this.updateSize()}componentWillUnmount(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown)}updateSize(){let{isRtl:e}=this.context,{alignmentEl:t,alignGridTop:n}=this.props,{rootEl:a}=this,i=cpt(t);if(i){let s=a.getBoundingClientRect(),o=n?ya(t,".fc-scrollgrid").getBoundingClientRect().top:i.top,l=e?i.right-s.width:i.left;o=Math.max(o,W4),l=Math.min(l,document.documentElement.clientWidth-W4-s.width),l=Math.max(l,W4);let c=a.offsetParent.getBoundingClientRect();$g(a,{top:o-c.top,left:l-c.left})}}},r3=class extends ia{constructor(){super(...arguments),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,useEventCenter:!1}):this.context.unregisterInteractiveComponent(this)}}render(){let{options:e,dateEnv:t}=this.context,{props:n}=this,{startDate:a,todayRange:i,dateProfile:s}=n,o=t.format(a,e.dayPopoverFormat);return _(Xm,{elRef:this.handleRootEl,date:a,dateProfile:s,todayRange:i},(l,c,d)=>_(t3,{elRef:d.ref,id:n.id,title:o,extraClassNames:["fc-more-popover"].concat(d.className||[]),extraAttrs:d,parentEl:n.parentEl,alignmentEl:n.alignmentEl,alignGridTop:n.alignGridTop,onClose:n.onClose},Qb(e)&&_(l,{elTag:"div",elClasses:["fc-more-popover-misc"]}),n.children))}queryHit(e,t,n,a){let{rootEl:i,props:s}=this;return e>=0&&e=0&&t{this.linkEl=e,this.props.elRef&&uo(this.props.elRef,e)},this.handleClick=e=>{let{props:t,context:n}=this,{moreLinkClick:a}=n.options,i=FPe(t).start;function s(o){let{def:l,instance:c,range:d}=o.eventRange;return{event:new Or(n,l,c),start:n.dateEnv.toDate(d.start),end:n.dateEnv.toDate(d.end),isStart:o.isStart,isEnd:o.isEnd}}typeof a=="function"&&(a=a({date:i,allDay:!!t.allDayDate,allSegs:t.allSegs.map(s),hiddenSegs:t.hiddenSegs.map(s),jsEvent:e,view:n.viewApi})),!a||a==="popover"?this.setState({isPopoverOpen:!0}):typeof a=="string"&&n.calendarApi.zoomTo(i,a)},this.handlePopoverClose=()=>{this.setState({isPopoverOpen:!1})}}render(){let{props:e,state:t}=this;return _(tl.Consumer,null,n=>{let{viewApi:a,options:i,calendarApi:s}=n,{moreLinkText:o}=i,{moreCnt:l}=e,c=FPe(e),d=typeof o=="function"?o.call(s,l):`+${l} ${o}`,u=Bb(i.moreLinkHint,[l],d),p={num:l,shortText:`+${l}`,text:d,view:a};return _(Gt,null,!!e.moreCnt&&_(Ln,{elTag:e.elTag||"a",elRef:this.handleLinkEl,elClasses:[...e.elClasses||[],"fc-more-link"],elStyle:e.elStyle,elAttrs:Object.assign(Object.assign(Object.assign({},e.elAttrs),UPe(this.handleClick)),{title:u,"aria-expanded":t.isPopoverOpen,"aria-controls":t.isPopoverOpen?t.popoverId:""}),renderProps:p,generatorName:"moreLinkContent",customGenerator:i.moreLinkContent,defaultGenerator:e.defaultGenerator||xpt,classNameGenerator:i.moreLinkClassNames,didMount:i.moreLinkDidMount,willUnmount:i.moreLinkWillUnmount},e.children),t.isPopoverOpen&&_(r3,{id:t.popoverId,startDate:c.start,endDate:c.end,dateProfile:e.dateProfile,todayRange:e.todayRange,extraDateSpan:e.extraDateSpan,parentEl:this.parentEl,alignmentEl:e.alignmentElRef?e.alignmentElRef.current:this.linkEl,alignGridTop:e.alignGridTop,forceTimed:e.forceTimed,onClose:this.handlePopoverClose},e.popoverContent()))})}componentDidMount(){this.updateParentEl()}componentDidUpdate(){this.updateParentEl()}updateParentEl(){this.linkEl&&(this.parentEl=ya(this.linkEl,".fc-view-harness"))}}});function Mpt(r){let e=r.length>0?r[0].code:"en",t=Ppt.concat(r),n={en:j0e};for(let a of t)n[a.code]=a;return{map:n,defaultCode:e}}function $0e(r,e){return typeof r=="object"&&!Array.isArray(r)?B0e(r.code,[r.code],r):Apt(r,e)}function Apt(r,e){let t=[].concat(r||[]),n=_pt(t,e)||j0e;return B0e(r,t,n)}function _pt(r,e){for(let t=0;t0;a-=1){let i=n.slice(0,a).join("-");if(e[i])return e[i]}}return null}function B0e(r,e,t){let n=$F([z0e,t],["buttonText"]);delete n.code;let{week:a}=n;return delete n.week,{codeArg:r,codes:e,week:a,simpleNumberFormat:new Intl.NumberFormat(r),options:n}}function yi(r){return{id:tp(),name:r.name,premiumReleaseDate:r.premiumReleaseDate?new Date(r.premiumReleaseDate):void 0,deps:r.deps||[],reducers:r.reducers||[],isLoadingFuncs:r.isLoadingFuncs||[],contextInit:[].concat(r.contextInit||[]),eventRefiners:r.eventRefiners||{},eventDefMemberAdders:r.eventDefMemberAdders||[],eventSourceRefiners:r.eventSourceRefiners||{},isDraggableTransformers:r.isDraggableTransformers||[],eventDragMutationMassagers:r.eventDragMutationMassagers||[],eventDefMutationAppliers:r.eventDefMutationAppliers||[],dateSelectionTransformers:r.dateSelectionTransformers||[],datePointTransforms:r.datePointTransforms||[],dateSpanTransforms:r.dateSpanTransforms||[],views:r.views||{},viewPropsTransformers:r.viewPropsTransformers||[],isPropsValid:r.isPropsValid||null,externalDefTransforms:r.externalDefTransforms||[],viewContainerAppends:r.viewContainerAppends||[],eventDropTransformers:r.eventDropTransformers||[],componentInteractions:r.componentInteractions||[],calendarInteractions:r.calendarInteractions||[],themeClasses:r.themeClasses||{},eventSourceDefs:r.eventSourceDefs||[],cmdFormatter:r.cmdFormatter,recurringTypes:r.recurringTypes||[],namedTimeZonedImpl:r.namedTimeZonedImpl,initialView:r.initialView||"",elementDraggingImpl:r.elementDraggingImpl,optionChangeHandlers:r.optionChangeHandlers||{},scrollGridImpl:r.scrollGridImpl||null,listenerRefiners:r.listenerRefiners||{},optionRefiners:r.optionRefiners||{},propSetHandlers:r.propSetHandlers||{}}}function Ipt(r,e){let t={},n={premiumReleaseDate:void 0,reducers:[],isLoadingFuncs:[],contextInit:[],eventRefiners:{},eventDefMemberAdders:[],eventSourceRefiners:{},isDraggableTransformers:[],eventDragMutationMassagers:[],eventDefMutationAppliers:[],dateSelectionTransformers:[],datePointTransforms:[],dateSpanTransforms:[],views:{},viewPropsTransformers:[],isPropsValid:null,externalDefTransforms:[],viewContainerAppends:[],eventDropTransformers:[],componentInteractions:[],calendarInteractions:[],themeClasses:{},eventSourceDefs:[],cmdFormatter:null,recurringTypes:[],namedTimeZonedImpl:null,initialView:"",elementDraggingImpl:null,optionChangeHandlers:{},scrollGridImpl:null,listenerRefiners:{},optionRefiners:{},propSetHandlers:{}};function a(i){for(let s of i){let o=s.name,l=t[o];l===void 0?(t[o]=s.id,a(s.deps),n=Rpt(n,s)):l!==s.id&&console.warn(`Duplicate plugin '${o}'`)}}return r&&a(r),a(e),n}function Npt(){let r=[],e=[],t;return(n,a)=>((!t||!pd(n,r)||!pd(a,e))&&(t=Ipt(n,a)),r=n,e=a,t)}function Rpt(r,e){return{premiumReleaseDate:Fpt(r.premiumReleaseDate,e.premiumReleaseDate),reducers:r.reducers.concat(e.reducers),isLoadingFuncs:r.isLoadingFuncs.concat(e.isLoadingFuncs),contextInit:r.contextInit.concat(e.contextInit),eventRefiners:Object.assign(Object.assign({},r.eventRefiners),e.eventRefiners),eventDefMemberAdders:r.eventDefMemberAdders.concat(e.eventDefMemberAdders),eventSourceRefiners:Object.assign(Object.assign({},r.eventSourceRefiners),e.eventSourceRefiners),isDraggableTransformers:r.isDraggableTransformers.concat(e.isDraggableTransformers),eventDragMutationMassagers:r.eventDragMutationMassagers.concat(e.eventDragMutationMassagers),eventDefMutationAppliers:r.eventDefMutationAppliers.concat(e.eventDefMutationAppliers),dateSelectionTransformers:r.dateSelectionTransformers.concat(e.dateSelectionTransformers),datePointTransforms:r.datePointTransforms.concat(e.datePointTransforms),dateSpanTransforms:r.dateSpanTransforms.concat(e.dateSpanTransforms),views:Object.assign(Object.assign({},r.views),e.views),viewPropsTransformers:r.viewPropsTransformers.concat(e.viewPropsTransformers),isPropsValid:e.isPropsValid||r.isPropsValid,externalDefTransforms:r.externalDefTransforms.concat(e.externalDefTransforms),viewContainerAppends:r.viewContainerAppends.concat(e.viewContainerAppends),eventDropTransformers:r.eventDropTransformers.concat(e.eventDropTransformers),calendarInteractions:r.calendarInteractions.concat(e.calendarInteractions),componentInteractions:r.componentInteractions.concat(e.componentInteractions),themeClasses:Object.assign(Object.assign({},r.themeClasses),e.themeClasses),eventSourceDefs:r.eventSourceDefs.concat(e.eventSourceDefs),cmdFormatter:e.cmdFormatter||r.cmdFormatter,recurringTypes:r.recurringTypes.concat(e.recurringTypes),namedTimeZonedImpl:e.namedTimeZonedImpl||r.namedTimeZonedImpl,initialView:r.initialView||e.initialView,elementDraggingImpl:r.elementDraggingImpl||e.elementDraggingImpl,optionChangeHandlers:Object.assign(Object.assign({},r.optionChangeHandlers),e.optionChangeHandlers),scrollGridImpl:e.scrollGridImpl||r.scrollGridImpl,listenerRefiners:Object.assign(Object.assign({},r.listenerRefiners),e.listenerRefiners),optionRefiners:Object.assign(Object.assign({},r.optionRefiners),e.optionRefiners),propSetHandlers:Object.assign(Object.assign({},r.propSetHandlers),e.propSetHandlers)}}function Fpt(r,e){return r===void 0?e:e===void 0?r:new Date(Math.max(r.valueOf(),e.valueOf()))}function Opt(r,e){let t={},n;for(n in r)Y3(n,t,r,e);for(n in e)Y3(n,t,r,e);return t}function Y3(r,e,t,n){if(e[r])return e[r];let a=Lpt(r,e,t,n);return a&&(e[r]=a),a}function Lpt(r,e,t,n){let a=t[r],i=n[r],s=d=>a&&a[d]!==null?a[d]:i&&i[d]!==null?i[d]:null,o=s("component"),l=s("superType"),c=null;if(l){if(l===r)throw new Error("Can't have a custom view type that references itself");c=Y3(l,e,t,n)}return!o&&c&&(o=c.component),o?{type:r,component:o,defaults:Object.assign(Object.assign({},c?c.defaults:{}),a?a.rawOptions:{}),overrides:Object.assign(Object.assign({},c?c.overrides:{}),i?i.rawOptions:{})}:null}function I0e(r){return el(r,zpt)}function zpt(r){let e=typeof r=="function"?{component:r}:r,{component:t}=e;return e.content?t=N0e(e):t&&!(t.prototype instanceof Pt)&&(t=N0e(Object.assign(Object.assign({},e),{content:t}))),{superType:e.type,component:t,rawOptions:e}}function N0e(r){return e=>_(tl.Consumer,null,t=>_(Ln,{elTag:"div",elClasses:w3(t.viewSpec),renderProps:Object.assign(Object.assign({},e),{nextDayThreshold:t.options.nextDayThreshold}),generatorName:void 0,customGenerator:r.content,classNameGenerator:r.classNames,didMount:r.didMount,willUnmount:r.willUnmount}))}function jpt(r,e,t,n){let a=I0e(r),i=I0e(e.views),s=Opt(a,i);return el(s,o=>$pt(o,i,e,t,n))}function $pt(r,e,t,n,a){let i=r.overrides.duration||r.defaults.duration||n.duration||t.duration,s=null,o="",l="",c={};if(i&&(s=Bpt(i),s)){let p=fD(s);o=p.unit,p.value===1&&(l=o,c=e[o]?e[o].rawOptions:{})}let d=p=>{let m=p.buttonText||{},f=r.defaults.buttonTextKey;return f!=null&&m[f]!=null?m[f]:m[r.type]!=null?m[r.type]:m[l]!=null?m[l]:null},u=p=>{let m=p.buttonHints||{},f=r.defaults.buttonTextKey;return f!=null&&m[f]!=null?m[f]:m[r.type]!=null?m[r.type]:m[l]!=null?m[l]:null};return{type:r.type,component:r.component,duration:s,durationUnit:o,singleUnit:l,optionDefaults:r.defaults,optionOverrides:Object.assign(Object.assign({},c),r.overrides),buttonTextOverride:d(n)||d(t)||r.overrides.buttonText,buttonTextDefault:d(a)||r.defaults.buttonText||d(fd)||r.type,buttonTitleOverride:u(n)||u(t)||r.overrides.buttonHint,buttonTitleDefault:u(a)||r.defaults.buttonHint||u(fd)}}function Bpt(r){let e=JSON.stringify(r),t=R0e[e];return t===void 0&&(t=mt(r),R0e[e]=t),t}function Upt(r,e){switch(e.type){case"CHANGE_VIEW_TYPE":r=e.viewType}return r}function Hpt(r,e){switch(e.type){case"CHANGE_DATE":return e.dateMarker;default:return r}}function Vpt(r,e,t){let n=r.initialDate;return n!=null?e.createMarker(n):t.getDateMarker()}function qpt(r,e){switch(e.type){case"SET_OPTION":return Object.assign(Object.assign({},r),{[e.optionName]:e.rawOptionValue});default:return r}}function Wpt(r,e,t,n){let a;switch(e.type){case"CHANGE_VIEW_TYPE":return n.build(e.dateMarker||t);case"CHANGE_DATE":return n.build(e.dateMarker);case"PREV":if(a=n.buildPrev(r,t),a.isValid)return a;break;case"NEXT":if(a=n.buildNext(r,t),a.isValid)return a;break}return r}function Ypt(r,e,t){let n=e?e.activeRange:null;return H0e({},emt(r,t),n,t)}function Gpt(r,e,t,n){let a=t?t.activeRange:null;switch(e.type){case"ADD_EVENT_SOURCES":return H0e(r,e.sources,a,n);case"REMOVE_EVENT_SOURCE":return Zpt(r,e.sourceId);case"PREV":case"NEXT":case"CHANGE_DATE":case"CHANGE_VIEW_TYPE":return t?V0e(r,a,n):r;case"FETCH_EVENT_SOURCES":return r6(r,e.sourceIds?k3(e.sourceIds):q0e(r,n),a,e.isRefetch||!1,n);case"RECEIVE_EVENTS":case"RECEIVE_EVENT_ERROR":return Xpt(r,e.sourceId,e.fetchId,e.fetchRange);case"REMOVE_ALL_EVENT_SOURCES":return{};default:return r}}function Kpt(r,e,t){let n=e?e.activeRange:null;return r6(r,q0e(r,t),n,!0,t)}function U0e(r){for(let e in r)if(r[e].isFetching)return!0;return!1}function H0e(r,e,t,n){let a={};for(let i of e)a[i.sourceId]=i;return t&&(a=V0e(a,t,n)),Object.assign(Object.assign({},r),a)}function Zpt(r,e){return Zu(r,t=>t.sourceId!==e)}function V0e(r,e,t){return r6(r,Zu(r,n=>Qpt(n,e,t)),e,!1,t)}function Qpt(r,e,t){return W0e(r,t)?!t.options.lazyFetching||!r.fetchRange||r.isFetching||e.startr.fetchRange.end:!r.latestFetchId}function r6(r,e,t,n,a){let i={};for(let s in r){let o=r[s];e[s]?i[s]=Jpt(o,t,n,a):i[s]=o}return i}function Jpt(r,e,t,n){let{options:a,calendarApi:i}=n,s=n.pluginHooks.eventSourceDefs[r.sourceDefId],o=tp();return s.fetch({eventSource:r,range:e,isRefetch:t,context:n},l=>{let{rawEvents:c}=l;a.eventSourceSuccess&&(c=a.eventSourceSuccess.call(i,c,l.response)||c),r.success&&(c=r.success.call(i,c,l.response)||c),n.dispatch({type:"RECEIVE_EVENTS",sourceId:r.sourceId,fetchId:o,fetchRange:e,rawEvents:c})},l=>{let c=!1;a.eventSourceFailure&&(a.eventSourceFailure.call(i,l),c=!0),r.failure&&(r.failure(l),c=!0),c||console.warn(l.message,l),n.dispatch({type:"RECEIVE_EVENT_ERROR",sourceId:r.sourceId,fetchId:o,fetchRange:e,error:l})}),Object.assign(Object.assign({},r),{isFetching:!0,latestFetchId:o})}function Xpt(r,e,t,n){let a=r[e];return a&&t===a.latestFetchId?Object.assign(Object.assign({},r),{[e]:Object.assign(Object.assign({},a),{isFetching:!1,fetchRange:n})}):r}function q0e(r,e){return Zu(r,t=>W0e(t,e))}function emt(r,e){let t=D3(e),n=[].concat(r.eventSources||[]),a=[];r.initialEvents&&n.unshift(r.initialEvents),r.events&&n.unshift(r.events);for(let i of n){let s=E3(i,e,t);s&&a.push(s)}return a}function W0e(r,e){return!e.pluginHooks.eventSourceDefs[r.sourceDefId].ignoreRange}function tmt(r,e){switch(e.type){case"UNSELECT_DATES":return null;case"SELECT_DATES":return e.selection;default:return r}}function rmt(r,e){switch(e.type){case"UNSELECT_EVENT":return"";case"SELECT_EVENT":return e.eventInstanceId;default:return r}}function nmt(r,e){let t;switch(e.type){case"UNSET_EVENT_DRAG":return null;case"SET_EVENT_DRAG":return t=e.state,{affectedEvents:t.affectedEvents,mutatedEvents:t.mutatedEvents,isEvent:t.isEvent};default:return r}}function amt(r,e){let t;switch(e.type){case"UNSET_EVENT_RESIZE":return null;case"SET_EVENT_RESIZE":return t=e.state,{affectedEvents:t.affectedEvents,mutatedEvents:t.mutatedEvents,isEvent:t.isEvent};default:return r}}function imt(r,e,t,n,a){let i=r.headerToolbar?F0e(r.headerToolbar,r,e,t,n,a):null,s=r.footerToolbar?F0e(r.footerToolbar,r,e,t,n,a):null;return{header:i,footer:s}}function F0e(r,e,t,n,a,i){let s={},o=[],l=!1;for(let c in r){let d=r[c],u=smt(d,e,t,n,a,i);s[c]=u.widgets,o.push(...u.viewsWithButtons),l=l||u.hasTitle}return{sectionWidgets:s,viewsWithButtons:o,hasTitle:l}}function smt(r,e,t,n,a,i){let s=e.direction==="rtl",o=e.customButtons||{},l=t.buttonText||{},c=e.buttonText||{},d=t.buttonHints||{},u=e.buttonHints||{},p=r?r.split(" "):[],m=[],f=!1;return{widgets:p.map(g=>g.split(",").map(v=>{if(v==="title")return f=!0,{buttonName:v};let b,k,w,S,C,E;if(b=o[v])w=D=>{b.click&&b.click.call(D.target,D,D.target)},(S=n.getCustomButtonIconClass(b))||(S=n.getIconClass(v,s))||(C=b.text),E=b.hint||b.text;else if(k=a[v]){m.push(v),w=()=>{i.changeView(v)},(C=k.buttonTextOverride)||(S=n.getIconClass(v,s))||(C=k.buttonTextDefault);let D=k.buttonTextOverride||k.buttonTextDefault;E=Bb(k.buttonTitleOverride||k.buttonTitleDefault||e.viewHint,[D,v],D)}else if(i[v])if(w=()=>{i[v]()},(C=l[v])||(S=n.getIconClass(v,s))||(C=c[v]),v==="prevYear"||v==="nextYear"){let D=v==="prevYear"?"prev":"next";E=Bb(d[D]||u[D],[c.year||"year","year"],c[v])}else E=D=>Bb(d[v]||u[v],[c[D]||D,D],c[v]);return{buttonName:v,buttonClick:w,buttonIcon:S,buttonText:C,buttonHint:E}})),viewsWithButtons:m,hasTitle:f}}function fmt(r,e,t){let{dateEnv:n,options:a}=t,i,s,o,l,c={};return i=r.startParam,i==null&&(i=a.startParam),s=r.endParam,s==null&&(s=a.endParam),o=r.timeZoneParam,o==null&&(o=a.timeZoneParam),typeof r.extraParams=="function"?l=r.extraParams():l=r.extraParams||{},Object.assign(c,l),c[i]=n.formatIso(e.start),c[s]=n.formatIso(e.end),n.timeZone!=="local"&&(c[o]=n.timeZone),c}function vmt(r,e,t,n,a){let i=r?k3(r):null,s=gr(a.start),o=a.end,l=[];for(e&&(e.milliseconds<0?o=hn(o,1):e.milliseconds>=1e3*60*60*24&&(s=hn(s,-1)));s1?{year:"numeric",month:"short",day:"numeric"}:{year:"numeric",month:"long",day:"numeric"}}function Cmt(r,e,t,n,a,i,s,o){let l=$0e(e||s.defaultCode,s.map);return new hD({calendarSystem:"gregory",timeZone:r,namedTimeZoneImpl:i.namedTimeZonedImpl,locale:l,weekNumberCalculation:t,firstDay:n,weekText:a,cmdFormatter:i.cmdFormatter,defaultSeparator:o})}function Emt(r,e){let t=e.themeClasses[r.themeSystem]||yd;return new t(r)}function Dmt(r){let e=r.dateProfileGeneratorClass||Ag;return new e(r)}function Pmt(r,e,t){return new G3(r,e,t)}function Mmt(r){return el(r,e=>e.ui)}function Amt(r,e,t){let n={"":e};for(let a in r){let i=r[a];i.sourceId&&t[i.sourceId]&&(n[a]=t[i.sourceId])}return n}function _mt(r){let{options:e}=r;return{eventUiSingleBase:Wb({display:e.eventDisplay,editable:e.editable,startEditable:e.eventStartEditable,durationEditable:e.eventDurationEditable,constraint:e.eventConstraint,overlap:typeof e.eventOverlap=="boolean"?e.eventOverlap:void 0,allow:e.eventAllow,backgroundColor:e.eventBackgroundColor,borderColor:e.eventBorderColor,textColor:e.eventTextColor,color:e.eventColor},r),selectionConfig:Wb({constraint:e.selectConstraint,overlap:typeof e.selectOverlap=="boolean"?e.selectOverlap:void 0,allow:e.selectAllow},r)}}function W3(r,e){for(let t of e.pluginHooks.isLoadingFuncs)if(t(r))return!0;return!1}function Imt(r){return M3(r.options.businessHours,r)}function L0e(r,e){for(let t in r)console.warn(`Unknown option '${t}'`+(e?` for view '${e}'`:""))}function Nmt(r,e,t,n,a,i){let s=t.build(a,void 0,!1),o=t.buildPrev(e,n,!1),l=t.buildNext(e,n,!1);return{title:i,activeButton:r.type,navUnit:r.singleUnit,isTodayEnabled:s.isValid&&!Xo(e.currentRange,a),isPrevEnabled:o.isValid,isNextEnabled:l.isValid}}function Rmt(r){return r.map(e=>new e)}var Ppt,z0e,j0e,yd,R0e,G3,omt,lmt,cmt,dmt,umt,pmt,mmt,hmt,gmt,ymt,kmt,wmt,K3,ZF,Z3,Q3,QF,J3,X3,e6,t6,JF,Vg=y(()=>{q3();Ku();pD();Ppt=[],z0e={code:"en",week:{dow:0,doy:4},direction:"ltr",buttonText:{prev:"prev",next:"next",prevYear:"prev year",nextYear:"next year",year:"year",today:"today",month:"month",week:"week",day:"day",list:"list"},weekText:"W",weekTextLong:"Week",closeHint:"Close",timeHint:"Time",eventHint:"Event",allDayText:"all-day",moreLinkText:"more",noEventsText:"No events to display"},j0e=Object.assign(Object.assign({},z0e),{buttonHints:{prev:"Previous $0",next:"Next $0",today(r,e){return e==="day"?"Today":`This ${r}`}},viewHint:"$0 view",navLinkHint:"Go to $0",moreLinkHint(r){return`Show ${r} more event${r===1?"":"s"}`}});yd=class extends Qu{};yd.prototype.classes={root:"fc-theme-standard",tableCellShaded:"fc-cell-shaded",buttonGroup:"fc-button-group",button:"fc-button fc-button-primary",buttonActive:"fc-button-active"};yd.prototype.baseIconClass="fc-icon";yd.prototype.iconClasses={close:"fc-icon-x",prev:"fc-icon-chevron-left",next:"fc-icon-chevron-right",prevYear:"fc-icon-chevrons-left",nextYear:"fc-icon-chevrons-right"};yd.prototype.rtlIconClasses={prev:"fc-icon-chevron-right",next:"fc-icon-chevron-left",prevYear:"fc-icon-chevrons-right",nextYear:"fc-icon-chevrons-left"};yd.prototype.iconOverrideOption="buttonIcons";yd.prototype.iconOverrideCustomButtonOption="icon";yd.prototype.iconOverridePrefix="fc-icon-";R0e={};G3=class{constructor(e,t,n){this.type=e,this.getCurrentData=t,this.dateEnv=n}get calendar(){return this.getCurrentData().calendarApi}get title(){return this.getCurrentData().viewTitle}get activeStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start)}get activeEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end)}get currentStart(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start)}get currentEnd(){return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end)}getOption(e){return this.getCurrentData().options[e]}},omt={ignoreRange:!0,parseMeta(r){return Array.isArray(r.events)?r.events:null},fetch(r,e){e({rawEvents:r.eventSource.meta})}},lmt=yi({name:"array-event-source",eventSourceDefs:[omt]}),cmt={parseMeta(r){return typeof r.events=="function"?r.events:null},fetch(r,e,t){let{dateEnv:n}=r.context,a=r.eventSource.meta;R3(a.bind(null,N3(r.range,n)),i=>e({rawEvents:i}),t)}},dmt=yi({name:"func-event-source",eventSourceDefs:[cmt]}),umt={method:String,extraParams:U,startParam:String,endParam:String,timeZoneParam:String},pmt={parseMeta(r){return r.url&&(r.format==="json"||!r.format)?{url:r.url,format:"json",method:(r.method||"GET").toUpperCase(),extraParams:r.extraParams,startParam:r.startParam,endParam:r.endParam,timeZoneParam:r.timeZoneParam}:null},fetch(r,e,t){let{meta:n}=r.eventSource,a=fmt(n,r.range,r.context);F3(n.method,n.url,a).then(([i,s])=>{e({rawEvents:i,response:s})},t)}},mmt=yi({name:"json-event-source",eventSourceRefiners:umt,eventSourceDefs:[pmt]});hmt={daysOfWeek:U,startTime:mt,endTime:mt,duration:mt,startRecur:U,endRecur:U},gmt={parse(r,e){if(r.daysOfWeek||r.startTime||r.endTime||r.startRecur||r.endRecur){let t={daysOfWeek:r.daysOfWeek||null,startTime:r.startTime||null,endTime:r.endTime||null,startRecur:r.startRecur?e.createMarker(r.startRecur):null,endRecur:r.endRecur?e.createMarker(r.endRecur):null,dateEnv:e},n;return r.duration&&(n=r.duration),!n&&r.startTime&&r.endTime&&(n=YPe(r.endTime,r.startTime)),{allDayGuess:!r.startTime&&!r.endTime,duration:n,typeData:t}}return null},expand(r,e,t){let n=Vi(e,{start:r.startRecur,end:r.endRecur});return n?vmt(r.daysOfWeek,r.startTime,r.dateEnv,t,n):[]}},ymt=yi({name:"simple-recurring-event",recurringTypes:[gmt],eventRefiners:hmt});kmt=yi({name:"change-handler",optionChangeHandlers:{events(r,e){O0e([r],e)},eventSources:O0e}});wmt=[lmt,dmt,mmt,ymt,kmt,yi({name:"misc",isLoadingFuncs:[r=>U0e(r.eventSources)],propSetHandlers:{dateProfile:bmt,eventStore:Tmt}})],K3=class{constructor(e,t){this.runTaskOption=e,this.drainedOption=t,this.queue=[],this.delayedRunner=new Mg(this.drain.bind(this))}request(e,t){this.queue.push(e),this.delayedRunner.request(t)}pause(e){this.delayedRunner.pause(e)}resume(e,t){this.delayedRunner.resume(e,t)}drain(){let{queue:e}=this;for(;e.length;){let t=[],n;for(;n=e.shift();)this.runTask(n),t.push(n);this.drained(t)}}runTask(e){this.runTaskOption&&this.runTaskOption(e)}drained(e){this.drainedOption&&this.drainedOption(e)}};ZF=class{constructor(){this.resetListeners=new Set}handleInput(e,t){let n=this.dateEnv;if(e!==n&&(typeof t=="function"?this.nowFn=t:n||(this.nowAnchorDate=e.toDate(t?e.createMarker(t):e.createNowMarker()),this.nowAnchorQueried=Date.now()),this.dateEnv=e,n))for(let a of this.resetListeners.values())a()}getDateMarker(){return this.nowAnchorDate?this.dateEnv.timestampToMarker(this.nowAnchorDate.valueOf()+(Date.now()-this.nowAnchorQueried)):this.dateEnv.createMarker(this.nowFn())}addResetListener(e){this.resetListeners.add(e)}removeResetListener(e){this.resetListeners.delete(e)}},Z3=class{constructor(e){this.computeCurrentViewData=_e(this._computeCurrentViewData),this.organizeRawLocales=_e(Mpt),this.buildLocale=_e($0e),this.buildPluginHooks=Npt(),this.buildDateEnv=_e(Cmt),this.buildTheme=_e(Emt),this.parseToolbars=_e(imt),this.buildViewSpecs=_e(jpt),this.buildDateProfileGenerator=Hb(Dmt),this.buildViewApi=_e(Pmt),this.buildViewUiProps=Hb(_mt),this.buildEventUiBySource=_e(Mmt,gi),this.buildEventUiBases=_e(Amt),this.parseContextBusinessHours=Hb(Imt),this.buildTitle=_e(Smt),this.nowManager=new ZF,this.emitter=new Ju,this.actionRunner=new K3(this._handleAction.bind(this),this.updateData.bind(this)),this.currentCalendarOptionsInput={},this.currentCalendarOptionsRefined={},this.currentViewOptionsInput={},this.currentViewOptionsRefined={},this.currentCalendarOptionsRefiners={},this.optionsForRefining=[],this.optionsForHandling=[],this.getCurrentData=()=>this.data,this.dispatch=p=>{this.actionRunner.request(p)},this.props=e,this.actionRunner.pause(),this.nowManager=new ZF;let t={},n=this.computeOptionsData(e.optionOverrides,t,e.calendarApi),a=n.calendarOptions.initialView||n.pluginHooks.initialView,i=this.computeCurrentViewData(a,n,e.optionOverrides,t);e.calendarApi.currentDataManager=this,this.emitter.setThisContext(e.calendarApi),this.emitter.setOptions(i.options);let s={nowManager:this.nowManager,dateEnv:n.dateEnv,options:n.calendarOptions,pluginHooks:n.pluginHooks,calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},o=Vpt(n.calendarOptions,n.dateEnv,this.nowManager),l=i.dateProfileGenerator.build(o);Xo(l.activeRange,o)||(o=l.currentRange.start);for(let p of n.pluginHooks.contextInit)p(s);let c=Ypt(n.calendarOptions,l,s),d={dynamicOptionOverrides:t,currentViewType:a,currentDate:o,dateProfile:l,businessHours:this.parseContextBusinessHours(s),eventSources:c,eventUiBases:{},eventStore:va(),renderableEventStore:va(),dateSelection:null,eventSelection:"",eventDrag:null,eventResize:null,selectionConfig:this.buildViewUiProps(s).selectionConfig},u=Object.assign(Object.assign({},s),d);for(let p of n.pluginHooks.reducers)Object.assign(d,p(null,null,u));W3(d,s)&&this.emitter.trigger("loading",!0),this.state=d,this.updateData(),this.actionRunner.resume()}resetOptions(e,t){let{props:n}=this;t===void 0?n.optionOverrides=e:(n.optionOverrides=Object.assign(Object.assign({},n.optionOverrides||{}),e),this.optionsForRefining.push(...t)),(t===void 0||t.length)&&this.actionRunner.request({type:"NOTHING"})}_handleAction(e){let{props:t,state:n,emitter:a}=this,i=qpt(n.dynamicOptionOverrides,e),s=this.computeOptionsData(t.optionOverrides,i,t.calendarApi),o=Upt(n.currentViewType,e),l=this.computeCurrentViewData(o,s,t.optionOverrides,i);t.calendarApi.currentDataManager=this,a.setThisContext(t.calendarApi),a.setOptions(l.options);let c={nowManager:this.nowManager,dateEnv:s.dateEnv,options:s.calendarOptions,pluginHooks:s.pluginHooks,calendarApi:t.calendarApi,dispatch:this.dispatch,emitter:a,getCurrentData:this.getCurrentData},{currentDate:d,dateProfile:u}=n;this.data&&this.data.dateProfileGenerator!==l.dateProfileGenerator&&(u=l.dateProfileGenerator.build(d)),d=Hpt(d,e),u=Wpt(u,e,d,l.dateProfileGenerator),(e.type==="PREV"||e.type==="NEXT"||!Xo(u.currentRange,d))&&(d=u.currentRange.start);let p=Gpt(n.eventSources,e,u,c),m=s0e(n.eventStore,e,p,u,c),h=U0e(p)&&!l.options.progressiveEventRendering&&n.renderableEventStore||m,{eventUiSingleBase:g,selectionConfig:v}=this.buildViewUiProps(c),b=this.buildEventUiBySource(p),k=this.buildEventUiBases(h.defs,g,b),w={dynamicOptionOverrides:i,currentViewType:o,currentDate:d,dateProfile:u,eventSources:p,eventStore:m,renderableEventStore:h,selectionConfig:v,eventUiBases:k,businessHours:this.parseContextBusinessHours(c),dateSelection:tmt(n.dateSelection,e),eventSelection:rmt(n.eventSelection,e),eventDrag:nmt(n.eventDrag,e),eventResize:amt(n.eventResize,e)},S=Object.assign(Object.assign({},c),w);for(let D of s.pluginHooks.reducers)Object.assign(w,D(n,e,S));let C=W3(n,c),E=W3(w,c);!C&&E?a.trigger("loading",!0):C&&!E&&a.trigger("loading",!1),this.state=w,t.onAction&&t.onAction(e)}updateData(){let{props:e,state:t}=this,n=this.data,a=this.computeOptionsData(e.optionOverrides,t.dynamicOptionOverrides,e.calendarApi),i=this.computeCurrentViewData(t.currentViewType,a,e.optionOverrides,t.dynamicOptionOverrides),s=this.data=Object.assign(Object.assign(Object.assign({nowManager:this.nowManager,viewTitle:this.buildTitle(t.dateProfile,i.options,a.dateEnv),calendarApi:e.calendarApi,dispatch:this.dispatch,emitter:this.emitter,getCurrentData:this.getCurrentData},a),i),t),o=a.pluginHooks.optionChangeHandlers,l=n&&n.calendarOptions,c=a.calendarOptions;if(l&&l!==c){l.timeZone!==c.timeZone&&(t.eventSources=s.eventSources=Kpt(s.eventSources,t.dateProfile,s),t.eventStore=s.eventStore=P3(s.eventStore,n.dateEnv,s.dateEnv),t.renderableEventStore=s.renderableEventStore=P3(s.renderableEventStore,n.dateEnv,s.dateEnv));for(let d in o)(this.optionsForHandling.indexOf(d)!==-1||l[d]!==c[d])&&o[d](c[d],s)}this.optionsForHandling=[],e.onData&&e.onData(s)}computeOptionsData(e,t,n){if(!this.optionsForRefining.length&&e===this.stableOptionOverrides&&t===this.stableDynamicOptionOverrides)return this.stableCalendarOptionsData;let{refinedOptions:a,pluginHooks:i,localeDefaults:s,availableLocaleData:o,extra:l}=this.processRawCalendarOptions(e,t);L0e(l);let c=this.buildDateEnv(a.timeZone,a.locale,a.weekNumberCalculation,a.firstDay,a.weekText,i,o,a.defaultRangeSeparator),d=this.buildViewSpecs(i.views,this.stableOptionOverrides,this.stableDynamicOptionOverrides,s),u=this.buildTheme(a,i),p=this.parseToolbars(a,this.stableOptionOverrides,u,d,n);return this.stableCalendarOptionsData={calendarOptions:a,pluginHooks:i,dateEnv:c,viewSpecs:d,theme:u,toolbarConfig:p,localeDefaults:s,availableRawLocales:o.map}}processRawCalendarOptions(e,t){let{locales:n,locale:a}=jF([fd,e,t]),i=this.organizeRawLocales(n),s=i.map,o=this.buildLocale(a||i.defaultCode,s).options,l=this.buildPluginHooks(e.plugins||[],wmt),c=this.currentCalendarOptionsRefiners=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},g3),y3),v3),l.listenerRefiners),l.optionRefiners),d={},u=jF([fd,o,e,t]),p={},m=this.currentCalendarOptionsInput,f=this.currentCalendarOptionsRefined,h=!1;for(let g in u)this.optionsForRefining.indexOf(g)===-1&&(u[g]===m[g]||tf[g]&&g in m&&tf[g](m[g],u[g]))?p[g]=f[g]:c[g]?(p[g]=c[g](u[g]),h=!0):d[g]=m[g];return h&&(this.currentCalendarOptionsInput=u,this.currentCalendarOptionsRefined=p,this.stableOptionOverrides=e,this.stableDynamicOptionOverrides=t),this.optionsForHandling.push(...this.optionsForRefining),this.optionsForRefining=[],{rawOptions:this.currentCalendarOptionsInput,refinedOptions:this.currentCalendarOptionsRefined,pluginHooks:l,availableLocaleData:i,localeDefaults:o,extra:d}}_computeCurrentViewData(e,t,n,a){let i=t.viewSpecs[e];if(!i)throw new Error(`viewType "${e}" is not available. Please make sure you've loaded all neccessary plugins`);let{refinedOptions:s,extra:o}=this.processRawViewOptions(i,t.pluginHooks,t.localeDefaults,n,a);L0e(o),this.nowManager.handleInput(t.dateEnv,s.now);let l=this.buildDateProfileGenerator({dateProfileGeneratorClass:i.optionDefaults.dateProfileGeneratorClass,nowManager:this.nowManager,duration:i.duration,durationUnit:i.durationUnit,usesMinMaxTime:i.optionDefaults.usesMinMaxTime,dateEnv:t.dateEnv,calendarApi:this.props.calendarApi,slotMinTime:s.slotMinTime,slotMaxTime:s.slotMaxTime,showNonCurrentDates:s.showNonCurrentDates,dayCount:s.dayCount,dateAlignment:s.dateAlignment,dateIncrement:s.dateIncrement,hiddenDays:s.hiddenDays,weekends:s.weekends,validRangeInput:s.validRange,visibleRangeInput:s.visibleRange,fixedWeekCount:s.fixedWeekCount}),c=this.buildViewApi(e,this.getCurrentData,t.dateEnv);return{viewSpec:i,options:s,dateProfileGenerator:l,viewApi:c}}processRawViewOptions(e,t,n,a,i){let s=jF([fd,e.optionDefaults,n,a,e.optionOverrides,i]),o=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},g3),y3),v3),ZPe),t.listenerRefiners),t.optionRefiners),l={},c=this.currentViewOptionsInput,d=this.currentViewOptionsRefined,u=!1,p={};for(let m in s)s[m]===c[m]||tf[m]&&tf[m](s[m],c[m])?l[m]=d[m]:(s[m]===this.currentCalendarOptionsInput[m]||tf[m]&&tf[m](s[m],this.currentCalendarOptionsInput[m])?m in this.currentCalendarOptionsRefined&&(l[m]=this.currentCalendarOptionsRefined[m]):o[m]?l[m]=o[m](s[m]):p[m]=s[m],u=!0);return u&&(this.currentViewOptionsInput=s,this.currentViewOptionsRefined=l),{rawOptions:this.currentViewOptionsInput,refinedOptions:this.currentViewOptionsRefined,extra:p}}};Q3=class extends Pt{render(){let e=this.props.widgetGroups.map(t=>this.renderWidgetGroup(t));return _("div",{className:"fc-toolbar-chunk"},...e)}renderWidgetGroup(e){let{props:t}=this,{theme:n}=this.context,a=[],i=!0;for(let s of e){let{buttonName:o,buttonClick:l,buttonText:c,buttonIcon:d,buttonHint:u}=s;if(o==="title")i=!1,a.push(_("h2",{className:"fc-toolbar-title",id:t.titleId},t.title));else{let p=o===t.activeButton,m=!t.isTodayEnabled&&o==="today"||!t.isPrevEnabled&&o==="prev"||!t.isNextEnabled&&o==="next",f=[`fc-${o}-button`,n.getClass("button")];p&&f.push(n.getClass("buttonActive")),a.push(_("button",{type:"button",title:typeof u=="function"?u(t.navUnit):u,disabled:m,"aria-pressed":p,className:f.join(" "),onClick:l},c||(d?_("span",{className:d,role:"img"}):"")))}}if(a.length>1){let s=i&&n.getClass("buttonGroup")||"";return _("div",{className:s},...a)}return a[0]}},QF=class extends Pt{render(){let{model:e,extraClassName:t}=this.props,n=!1,a,i,s=e.sectionWidgets,o=s.center;return s.left?(n=!0,a=s.left):a=s.start,s.right?(n=!0,i=s.right):i=s.end,_("div",{className:[t||"","fc-toolbar",n?"fc-toolbar-ltr":""].join(" ")},this.renderSection("start",a||[]),this.renderSection("center",o||[]),this.renderSection("end",i||[]))}renderSection(e,t){let{props:n}=this;return _(Q3,{key:e,widgetGroups:t,title:n.title,navUnit:n.navUnit,activeButton:n.activeButton,isTodayEnabled:n.isTodayEnabled,isPrevEnabled:n.isPrevEnabled,isNextEnabled:n.isNextEnabled,titleId:n.titleId})}},J3=class extends Pt{constructor(){super(...arguments),this.state={availableWidth:null},this.handleEl=e=>{this.el=e,uo(this.props.elRef,e),this.updateAvailableWidth()},this.handleResize=()=>{this.updateAvailableWidth()}}render(){let{props:e,state:t}=this,{aspectRatio:n}=e,a=["fc-view-harness",n||e.liquid||e.height?"fc-view-harness-active":"fc-view-harness-passive"],i="",s="";return n?t.availableWidth!==null?i=t.availableWidth/n:s=`${1/n*100}%`:i=e.height||"",_("div",{"aria-labelledby":e.labeledById,ref:this.handleEl,className:a.join(" "),style:{height:i,paddingBottom:s}},e.children)}componentDidMount(){this.context.addResizeHandler(this.handleResize)}componentWillUnmount(){this.context.removeResizeHandler(this.handleResize)}updateAvailableWidth(){this.el&&this.props.aspectRatio&&this.setState({availableWidth:this.el.offsetWidth})}},X3=class extends ec{constructor(e){super(e),this.handleSegClick=(t,n)=>{let{component:a}=this,{context:i}=a,s=rp(n);if(s&&a.isValidSegDownEl(t.target)){let o=ya(t.target,".fc-event-forced-url"),l=o?o.querySelector("a[href]").href:"";i.emitter.trigger("eventClick",{el:n,event:new Or(a.context,s.eventRange.def,s.eventRange.instance),jsEvent:t,view:i.viewApi}),l&&!t.defaultPrevented&&(window.location.href=l)}},this.destroy=a3(e.el,"click",".fc-event",this.handleSegClick)}},e6=class extends ec{constructor(e){super(e),this.handleEventElRemove=t=>{t===this.currentSegEl&&this.handleSegLeave(null,this.currentSegEl)},this.handleSegEnter=(t,n)=>{rp(n)&&(this.currentSegEl=n,this.triggerEvent("eventMouseEnter",t,n))},this.handleSegLeave=(t,n)=>{this.currentSegEl&&(this.currentSegEl=null,this.triggerEvent("eventMouseLeave",t,n))},this.removeHoverListeners=BPe(e.el,".fc-event",this.handleSegEnter,this.handleSegLeave)}destroy(){this.removeHoverListeners()}triggerEvent(e,t,n){let{component:a}=this,{context:i}=a,s=rp(n);(!t||a.isValidSegDownEl(t.target))&&i.emitter.trigger(e,{el:n,event:new Or(i,s.eventRange.def,s.eventRange.instance),jsEvent:t,view:i.viewApi})}},t6=class extends cd{constructor(){super(...arguments),this.buildViewContext=_e(t0e),this.buildViewPropTransformers=_e(Rmt),this.buildToolbarProps=_e(Nmt),this.headerRef=En(),this.footerRef=En(),this.interactionsStore={},this.state={viewLabelId:bs()},this.registerInteractiveComponent=(e,t)=>{let n=p0e(e,t),s=[X3,e6].concat(this.props.pluginHooks.componentInteractions).map(o=>new o(n));this.interactionsStore[e.uid]=s,Ug[e.uid]=n},this.unregisterInteractiveComponent=e=>{let t=this.interactionsStore[e.uid];if(t){for(let n of t)n.destroy();delete this.interactionsStore[e.uid]}delete Ug[e.uid]},this.resizeRunner=new Mg(()=>{this.props.emitter.trigger("_resize",!0),this.props.emitter.trigger("windowResize",{view:this.props.viewApi})}),this.handleWindowResize=e=>{let{options:t}=this.props;t.handleWindowResize&&e.target===window&&this.resizeRunner.request(t.windowResizeDelay)}}render(){let{props:e}=this,{toolbarConfig:t,options:n}=e,a=!1,i="",s;e.isHeightAuto||e.forPrint?i="":n.height!=null?a=!0:n.contentHeight!=null?i=n.contentHeight:s=Math.max(n.aspectRatio,.5);let o=this.buildViewContext(e.viewSpec,e.viewApi,e.options,e.dateProfileGenerator,e.dateEnv,e.nowManager,e.theme,e.pluginHooks,e.dispatch,e.getCurrentData,e.emitter,e.calendarApi,this.registerInteractiveComponent,this.unregisterInteractiveComponent),l=t.header&&t.header.hasTitle?this.state.viewLabelId:void 0;return _(tl.Provider,{value:o},_(vs,{unit:"day"},c=>{let d=this.buildToolbarProps(e.viewSpec,e.dateProfile,e.dateProfileGenerator,e.currentDate,c,e.viewTitle);return _(Gt,null,t.header&&_(QF,Object.assign({ref:this.headerRef,extraClassName:"fc-header-toolbar",model:t.header,titleId:l},d)),_(J3,{liquid:a,height:i,aspectRatio:s,labeledById:l},this.renderView(e),this.buildAppendContent()),t.footer&&_(QF,Object.assign({ref:this.footerRef,extraClassName:"fc-footer-toolbar",model:t.footer,titleId:""},d)))}))}componentDidMount(){let{props:e}=this;this.calendarInteractions=e.pluginHooks.calendarInteractions.map(n=>new n(e)),window.addEventListener("resize",this.handleWindowResize);let{propSetHandlers:t}=e.pluginHooks;for(let n in t)t[n](e[n],e)}componentDidUpdate(e){let{props:t}=this,{propSetHandlers:n}=t.pluginHooks;for(let a in n)t[a]!==e[a]&&n[a](t[a],t)}componentWillUnmount(){window.removeEventListener("resize",this.handleWindowResize),this.resizeRunner.clear();for(let e of this.calendarInteractions)e.destroy();this.props.emitter.trigger("_unmount")}buildAppendContent(){let{props:e}=this,t=e.pluginHooks.viewContainerAppends.map(n=>n(e));return _(Gt,{},...t)}renderView(e){let{pluginHooks:t}=e,{viewSpec:n}=e,a={dateProfile:e.dateProfile,businessHours:e.businessHours,eventStore:e.renderableEventStore,eventUiBases:e.eventUiBases,dateSelection:e.dateSelection,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,isHeightAuto:e.isHeightAuto,forPrint:e.forPrint},i=this.buildViewPropTransformers(t.viewPropsTransformers);for(let o of i)Object.assign(a,o.transform(a,e));let s=n.component;return _(s,Object.assign({},a))}};JF=class extends TD{constructor(e,t={}){super(),this.isRendering=!1,this.isRendered=!1,this.currentClassNames=[],this.customContentRenderId=0,this.handleAction=n=>{switch(n.type){case"SET_EVENT_DRAG":case"SET_EVENT_RESIZE":this.renderRunner.tryDrain()}},this.handleData=n=>{this.currentData=n,this.renderRunner.request(n.calendarOptions.rerenderDelay)},this.handleRenderRequest=()=>{if(this.isRendering){this.isRendered=!0;let{currentData:n}=this;gD(()=>{Wm(_(bD,{options:n.calendarOptions,theme:n.theme,emitter:n.emitter},(a,i,s,o)=>(this.setClassNames(a),this.setHeight(i),_(T3.Provider,{value:this.customContentRenderId},_(t6,Object.assign({isHeightAuto:s,forPrint:o},n))))),this.el)})}else this.isRendered&&(this.isRendered=!1,Wm(null,this.el),this.setClassNames([]),this.setHeight(""))},LPe(e),this.el=e,this.renderRunner=new Mg(this.handleRenderRequest),new Z3({optionOverrides:t,calendarApi:this,onAction:this.handleAction,onData:this.handleData})}render(){let e=this.isRendering;e?this.customContentRenderId+=1:this.isRendering=!0,this.renderRunner.request(),e&&this.updateSize()}destroy(){this.isRendering&&(this.isRendering=!1,this.renderRunner.request())}updateSize(){gD(()=>{super.updateSize()})}batchRendering(e){this.renderRunner.pause("batchRendering"),e(),this.renderRunner.resume("batchRendering")}pauseRendering(){this.renderRunner.pause("pauseRendering")}resumeRendering(){this.renderRunner.resume("pauseRendering",!0)}resetOptions(e,t){this.currentDataManager.resetOptions(e,t)}setClassNames(e){if(!pd(e,this.currentClassNames)){let{classList:t}=this.el;for(let n of this.currentClassNames)t.remove(n);for(let n of e)t.add(n);this.currentClassNames=e}}setHeight(e){n3(this.el,"height",e)}}});var qg=y(()=>{q3();Ku();pD()});function Fmt(r){return r.button===0&&!r.ctrlKey}function Omt(){n6+=1,setTimeout(()=>{n6-=1},Kb.touchMouseIgnoreWait)}function Lmt(){XF+=1,XF===1&&window.addEventListener("touchmove",G0e,{passive:!1})}function zmt(){XF-=1,XF||window.removeEventListener("touchmove",G0e,{passive:!1})}function G0e(r){a6&&r.preventDefault()}function jmt(r){let e=r.tagName;return e==="HTML"||e==="BODY"}function aO(r,e){return!r&&!e?!0:!!r!=!!e?!1:I3(r.dateSpan,e.dateSpan)}function f6(r,e){let t={};for(let n of e.pluginHooks.datePointTransforms)Object.assign(t,n(r,e));return Object.assign(t,$mt(r,e.dateEnv)),t}function $mt(r,e){return{date:e.toDate(r.range.start),dateStr:e.formatIso(r.range.start,{omitTime:r.allDay}),allDay:r.allDay}}function Bmt(r){let{options:e}=r.context,t=e.selectLongPressDelay;return t==null&&(t=e.longPressDelay),t}function Umt(r,e,t){let n=r.dateSpan,a=e.dateSpan,i=[n.range.start,n.range.end,a.range.start,a.range.end];i.sort(d3);let s={};for(let o of t){let l=o(r,e);if(l===!1)return null;l&&Object.assign(s,l)}return s.range={start:i[0],end:i[3]},s.allDay=n.allDay,s}function Hmt(r,e,t,n){let a=r.dateSpan,i=e.dateSpan,s=a.range.start,o=i.range.start,l={};a.allDay!==i.allDay&&(l.allDay=i.allDay,l.hasEnd=e.context.options.allDayMaintainDuration,i.allDay?s=gr(t):s=t);let c=Zm(s,o,r.context.dateEnv,r.componentId===e.componentId?r.largeUnit:null);c.milliseconds&&(l.allDay=!1);let d={datesDelta:c,standardProps:l};for(let u of n)u(d,r,e);return d}function Vmt(r){let{options:e}=r.context,t=e.eventLongPressDelay;return t==null&&(t=e.longPressDelay),t}function qmt(r,e,t,n){let a=r.context.dateEnv,i=r.dateSpan.range.start,s=e.dateSpan.range.start,o=Zm(i,s,a,r.largeUnit);if(t){if(a.add(n.start,o)n.start)return{endDelta:o};return null}function Gmt(r,e,t){let n=Object.assign({},e.leftoverProps);for(let d of t.pluginHooks.externalDefTransforms)Object.assign(n,d(r,e));let{refined:a,extra:i}=ND(n,t),s=Ob(a,i,e.sourceId,r.allDay,t.options.forceEventDuration||!!e.duration,t),o=r.range.start;r.allDay&&e.startTime&&(o=t.dateEnv.add(o,e.startTime));let l=e.duration?t.dateEnv.add(o,e.duration):kD(r.allDay,o,t),c=qb(s.defId,{start:o,end:l});return{def:s,instance:c}}function Kmt(r){let e=Zmt(r,"event"),t=e?JSON.parse(e):{create:!1};return BD(t)}function Zmt(r,e){let t=Kb.dataAttrPrefix,n=(t?t+"-":"")+e;return r.getAttribute("data-"+n)||""}var n6,XF,a6,eO,i6,tO,rO,s6,Y0e,o6,nf,l6,Wg,c6,d6,YD,u6,p6,Wmt,Ymt,m6,nO,K0e,h6=y(()=>{Vg();qg();Kb.touchMouseIgnoreWait=500;n6=0,XF=0,a6=!1,eO=class{constructor(e){this.subjectEl=null,this.selector="",this.handleSelector="",this.shouldIgnoreMove=!1,this.shouldWatchScroll=!0,this.isDragging=!1,this.isTouchDragging=!1,this.wasTouchScroll=!1,this.handleMouseDown=t=>{if(!this.shouldIgnoreMouse()&&Fmt(t)&&this.tryStart(t)){let n=this.createEventFromMouse(t,!0);this.emitter.trigger("pointerdown",n),this.initScrollWatch(n),this.shouldIgnoreMove||document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}},this.handleMouseMove=t=>{let n=this.createEventFromMouse(t);this.recordCoords(n),this.emitter.trigger("pointermove",n)},this.handleMouseUp=t=>{document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.emitter.trigger("pointerup",this.createEventFromMouse(t)),this.cleanup()},this.handleTouchStart=t=>{if(this.tryStart(t)){this.isTouchDragging=!0;let n=this.createEventFromTouch(t,!0);this.emitter.trigger("pointerdown",n),this.initScrollWatch(n);let a=t.target;this.shouldIgnoreMove||a.addEventListener("touchmove",this.handleTouchMove),a.addEventListener("touchend",this.handleTouchEnd),a.addEventListener("touchcancel",this.handleTouchEnd),window.addEventListener("scroll",this.handleTouchScroll,!0)}},this.handleTouchMove=t=>{let n=this.createEventFromTouch(t);this.recordCoords(n),this.emitter.trigger("pointermove",n)},this.handleTouchEnd=t=>{if(this.isDragging){let n=t.target;n.removeEventListener("touchmove",this.handleTouchMove),n.removeEventListener("touchend",this.handleTouchEnd),n.removeEventListener("touchcancel",this.handleTouchEnd),window.removeEventListener("scroll",this.handleTouchScroll,!0),this.emitter.trigger("pointerup",this.createEventFromTouch(t)),this.cleanup(),this.isTouchDragging=!1,Omt()}},this.handleTouchScroll=()=>{this.wasTouchScroll=!0},this.handleScroll=t=>{if(!this.shouldIgnoreMove){let n=window.scrollX-this.prevScrollX+this.prevPageX,a=window.scrollY-this.prevScrollY+this.prevPageY;this.emitter.trigger("pointermove",{origEvent:t,isTouch:this.isTouchDragging,subjectEl:this.subjectEl,pageX:n,pageY:a,deltaX:n-this.origPageX,deltaY:a-this.origPageY})}},this.containerEl=e,this.emitter=new Ju,e.addEventListener("mousedown",this.handleMouseDown),e.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),Lmt()}destroy(){this.containerEl.removeEventListener("mousedown",this.handleMouseDown),this.containerEl.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}),zmt()}tryStart(e){let t=this.querySubjectEl(e),n=e.target;return t&&(!this.handleSelector||ya(n,this.handleSelector))?(this.subjectEl=t,this.isDragging=!0,this.wasTouchScroll=!1,!0):!1}cleanup(){a6=!1,this.isDragging=!1,this.subjectEl=null,this.destroyScrollWatch()}querySubjectEl(e){return this.selector?ya(e.target,this.selector):this.containerEl}shouldIgnoreMouse(){return n6||this.isTouchDragging}cancelTouchScroll(){this.isDragging&&(a6=!0)}initScrollWatch(e){this.shouldWatchScroll&&(this.recordCoords(e),window.addEventListener("scroll",this.handleScroll,!0))}recordCoords(e){this.shouldWatchScroll&&(this.prevPageX=e.pageX,this.prevPageY=e.pageY,this.prevScrollX=window.scrollX,this.prevScrollY=window.scrollY)}destroyScrollWatch(){this.shouldWatchScroll&&window.removeEventListener("scroll",this.handleScroll,!0)}createEventFromMouse(e,t){let n=0,a=0;return t?(this.origPageX=e.pageX,this.origPageY=e.pageY):(n=e.pageX-this.origPageX,a=e.pageY-this.origPageY),{origEvent:e,isTouch:!1,subjectEl:this.subjectEl,pageX:e.pageX,pageY:e.pageY,deltaX:n,deltaY:a}}createEventFromTouch(e,t){let n=e.touches,a,i,s=0,o=0;return n&&n.length?(a=n[0].pageX,i=n[0].pageY):(a=e.pageX,i=e.pageY),t?(this.origPageX=a,this.origPageY=i):(s=a-this.origPageX,o=i-this.origPageY),{origEvent:e,isTouch:!0,subjectEl:this.subjectEl,pageX:a,pageY:i,deltaX:s,deltaY:o}}};i6=class{constructor(){this.isVisible=!1,this.sourceEl=null,this.mirrorEl=null,this.sourceElRect=null,this.parentNode=document.body,this.zIndex=9999,this.revertDuration=0}start(e,t,n){this.sourceEl=e,this.sourceElRect=this.sourceEl.getBoundingClientRect(),this.origScreenX=t-window.scrollX,this.origScreenY=n-window.scrollY,this.deltaX=0,this.deltaY=0,this.updateElPosition()}handleMove(e,t){this.deltaX=e-window.scrollX-this.origScreenX,this.deltaY=t-window.scrollY-this.origScreenY,this.updateElPosition()}setIsVisible(e){e?this.isVisible||(this.mirrorEl&&(this.mirrorEl.style.display=""),this.isVisible=e,this.updateElPosition()):this.isVisible&&(this.mirrorEl&&(this.mirrorEl.style.display="none"),this.isVisible=e)}stop(e,t){let n=()=>{this.cleanup(),t()};e&&this.mirrorEl&&this.isVisible&&this.revertDuration&&(this.deltaX||this.deltaY)?this.doRevertAnimation(n,this.revertDuration):setTimeout(n,0)}doRevertAnimation(e,t){let n=this.mirrorEl,a=this.sourceEl.getBoundingClientRect();n.style.transition="top "+t+"ms,left "+t+"ms",$g(n,{left:a.left,top:a.top}),i3(n,()=>{n.style.transition="",e()})}cleanup(){this.mirrorEl&&(PD(this.mirrorEl),this.mirrorEl=null),this.sourceEl=null}updateElPosition(){this.sourceEl&&this.isVisible&&$g(this.getMirrorEl(),{left:this.sourceElRect.left+this.deltaX,top:this.sourceElRect.top+this.deltaY})}getMirrorEl(){let e=this.sourceElRect,t=this.mirrorEl;return t||(t=this.mirrorEl=this.sourceEl.cloneNode(!0),t.style.userSelect="none",t.style.webkitUserSelect="none",t.style.pointerEvents="none",t.classList.add("fc-event-dragging"),$g(t,{position:"fixed",zIndex:this.zIndex,visibility:"",boxSizing:"border-box",width:e.right-e.left,height:e.bottom-e.top,right:"auto",bottom:"auto",margin:0}),this.parentNode.appendChild(t)),t}},tO=class extends Ng{constructor(e,t){super(),this.handleScroll=()=>{this.scrollTop=this.scrollController.getScrollTop(),this.scrollLeft=this.scrollController.getScrollLeft(),this.handleScrollChange()},this.scrollController=e,this.doesListening=t,this.scrollTop=this.origScrollTop=e.getScrollTop(),this.scrollLeft=this.origScrollLeft=e.getScrollLeft(),this.scrollWidth=e.getScrollWidth(),this.scrollHeight=e.getScrollHeight(),this.clientWidth=e.getClientWidth(),this.clientHeight=e.getClientHeight(),this.clientRect=this.computeClientRect(),this.doesListening&&this.getEventTarget().addEventListener("scroll",this.handleScroll)}destroy(){this.doesListening&&this.getEventTarget().removeEventListener("scroll",this.handleScroll)}getScrollTop(){return this.scrollTop}getScrollLeft(){return this.scrollLeft}setScrollTop(e){this.scrollController.setScrollTop(e),this.doesListening||(this.scrollTop=Math.max(Math.min(e,this.getMaxScrollTop()),0),this.handleScrollChange())}setScrollLeft(e){this.scrollController.setScrollLeft(e),this.doesListening||(this.scrollLeft=Math.max(Math.min(e,this.getMaxScrollLeft()),0),this.handleScrollChange())}getClientWidth(){return this.clientWidth}getClientHeight(){return this.clientHeight}getScrollWidth(){return this.scrollWidth}getScrollHeight(){return this.scrollHeight}handleScrollChange(){}},rO=class extends tO{constructor(e,t){super(new SD(e),t)}getEventTarget(){return this.scrollController.el}computeClientRect(){return B3(this.scrollController.el)}},s6=class extends tO{constructor(e){super(new xD,e)}getEventTarget(){return window}computeClientRect(){return{left:this.scrollLeft,right:this.scrollLeft+this.clientWidth,top:this.scrollTop,bottom:this.scrollTop+this.clientHeight}}handleScrollChange(){this.clientRect=this.computeClientRect()}},Y0e=typeof performance=="function"?performance.now:Date.now,o6=class{constructor(){this.isEnabled=!0,this.scrollQuery=[window,".fc-scroller"],this.edgeThreshold=50,this.maxVelocity=300,this.pointerScreenX=null,this.pointerScreenY=null,this.isAnimating=!1,this.scrollCaches=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.animate=()=>{if(this.isAnimating){let e=this.computeBestEdge(this.pointerScreenX+window.scrollX,this.pointerScreenY+window.scrollY);if(e){let t=Y0e();this.handleSide(e,(t-this.msSinceRequest)/1e3),this.requestAnimation(t)}else this.isAnimating=!1}}}start(e,t,n){this.isEnabled&&(this.scrollCaches=this.buildCaches(n),this.pointerScreenX=null,this.pointerScreenY=null,this.everMovedUp=!1,this.everMovedDown=!1,this.everMovedLeft=!1,this.everMovedRight=!1,this.handleMove(e,t))}handleMove(e,t){if(this.isEnabled){let n=e-window.scrollX,a=t-window.scrollY,i=this.pointerScreenY===null?0:a-this.pointerScreenY,s=this.pointerScreenX===null?0:n-this.pointerScreenX;i<0?this.everMovedUp=!0:i>0&&(this.everMovedDown=!0),s<0?this.everMovedLeft=!0:s>0&&(this.everMovedRight=!0),this.pointerScreenX=n,this.pointerScreenY=a,this.isAnimating||(this.isAnimating=!0,this.requestAnimation(Y0e()))}}stop(){if(this.isEnabled){this.isAnimating=!1;for(let e of this.scrollCaches)e.destroy();this.scrollCaches=null}}requestAnimation(e){this.msSinceRequest=e,requestAnimationFrame(this.animate)}handleSide(e,t){let{scrollCache:n}=e,{edgeThreshold:a}=this,i=a-e.distance,s=i*i/(a*a)*this.maxVelocity*t,o=1;switch(e.name){case"left":o=-1;case"right":n.setScrollLeft(n.getScrollLeft()+s*o);break;case"top":o=-1;case"bottom":n.setScrollTop(n.getScrollTop()+s*o);break}}computeBestEdge(e,t){let{edgeThreshold:n}=this,a=null,i=this.scrollCaches||[];for(let s of i){let o=s.clientRect,l=e-o.left,c=o.right-e,d=t-o.top,u=o.bottom-t;l>=0&&c>=0&&d>=0&&u>=0&&(d<=n&&this.everMovedUp&&s.canScrollUp()&&(!a||a.distance>d)&&(a={scrollCache:s,name:"top",distance:d}),u<=n&&this.everMovedDown&&s.canScrollDown()&&(!a||a.distance>u)&&(a={scrollCache:s,name:"bottom",distance:u}),l<=n&&this.everMovedLeft&&s.canScrollLeft()&&(!a||a.distance>l)&&(a={scrollCache:s,name:"left",distance:l}),c<=n&&this.everMovedRight&&s.canScrollRight()&&(!a||a.distance>c)&&(a={scrollCache:s,name:"right",distance:c}))}return a}buildCaches(e){return this.queryScrollEls(e).map(t=>t===window?new s6(!1):new rO(t,!1))}queryScrollEls(e){let t=[];for(let n of this.scrollQuery)typeof n=="object"?t.push(n):t.push(...Array.prototype.slice.call(e.getRootNode().querySelectorAll(n)));return t}},nf=class extends DD{constructor(e,t){super(e),this.containerEl=e,this.delay=null,this.minDistance=0,this.touchScrollAllowed=!0,this.mirrorNeedsRevert=!1,this.isInteracting=!1,this.isDragging=!1,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,this.delayTimeoutId=null,this.onPointerDown=a=>{this.isDragging||(this.isInteracting=!0,this.isDelayEnded=!1,this.isDistanceSurpassed=!1,s3(document.body),l3(document.body),a.isTouch||a.origEvent.preventDefault(),this.emitter.trigger("pointerdown",a),this.isInteracting&&!this.pointer.shouldIgnoreMove&&(this.mirror.setIsVisible(!1),this.mirror.start(a.subjectEl,a.pageX,a.pageY),this.startDelay(a),this.minDistance||this.handleDistanceSurpassed(a)))},this.onPointerMove=a=>{if(this.isInteracting){if(this.emitter.trigger("pointermove",a),!this.isDistanceSurpassed){let i=this.minDistance,s,{deltaX:o,deltaY:l}=a;s=o*o+l*l,s>=i*i&&this.handleDistanceSurpassed(a)}this.isDragging&&(a.origEvent.type!=="scroll"&&(this.mirror.handleMove(a.pageX,a.pageY),this.autoScroller.handleMove(a.pageX,a.pageY)),this.emitter.trigger("dragmove",a))}},this.onPointerUp=a=>{this.isInteracting&&(this.isInteracting=!1,o3(document.body),c3(document.body),this.emitter.trigger("pointerup",a),this.isDragging&&(this.autoScroller.stop(),this.tryStopDrag(a)),this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=null))};let n=this.pointer=new eO(e);n.emitter.on("pointerdown",this.onPointerDown),n.emitter.on("pointermove",this.onPointerMove),n.emitter.on("pointerup",this.onPointerUp),t&&(n.selector=t),this.mirror=new i6,this.autoScroller=new o6}destroy(){this.pointer.destroy(),this.onPointerUp({})}startDelay(e){typeof this.delay=="number"?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=null,this.handleDelayEnd(e)},this.delay):this.handleDelayEnd(e)}handleDelayEnd(e){this.isDelayEnded=!0,this.tryStartDrag(e)}handleDistanceSurpassed(e){this.isDistanceSurpassed=!0,this.tryStartDrag(e)}tryStartDrag(e){this.isDelayEnded&&this.isDistanceSurpassed&&(!this.pointer.wasTouchScroll||this.touchScrollAllowed)&&(this.isDragging=!0,this.mirrorNeedsRevert=!1,this.autoScroller.start(e.pageX,e.pageY,this.containerEl),this.emitter.trigger("dragstart",e),this.touchScrollAllowed===!1&&this.pointer.cancelTouchScroll())}tryStopDrag(e){this.mirror.stop(this.mirrorNeedsRevert,this.stopDrag.bind(this,e))}stopDrag(e){this.isDragging=!1,this.emitter.trigger("dragend",e)}setIgnoreMove(e){this.pointer.shouldIgnoreMove=e}setMirrorIsVisible(e){this.mirror.setIsVisible(e)}setMirrorNeedsRevert(e){this.mirrorNeedsRevert=e}setAutoScrollEnabled(e){this.autoScroller.isEnabled=e}},l6=class{constructor(e){this.el=e,this.origRect=jD(e),this.scrollCaches=GF(e).map(t=>new rO(t,!0))}destroy(){for(let e of this.scrollCaches)e.destroy()}computeLeft(){let e=this.origRect.left;for(let t of this.scrollCaches)e+=t.origScrollLeft-t.getScrollLeft();return e}computeTop(){let e=this.origRect.top;for(let t of this.scrollCaches)e+=t.origScrollTop-t.getScrollTop();return e}isWithinClipping(e,t){let n={left:e,top:t};for(let a of this.scrollCaches)if(!jmt(a.getEventTarget())&&!L3(n,a.clientRect))return!1;return!0}};Wg=class{constructor(e,t){this.useSubjectCenter=!1,this.requireInitial=!0,this.disablePointCheck=!1,this.initialHit=null,this.movingHit=null,this.finalHit=null,this.handlePointerDown=n=>{let{dragging:a}=this;this.initialHit=null,this.movingHit=null,this.finalHit=null,this.prepareHits(),this.processFirstCoord(n),this.initialHit||!this.requireInitial?(a.setIgnoreMove(!1),this.emitter.trigger("pointerdown",n)):a.setIgnoreMove(!0)},this.handleDragStart=n=>{this.emitter.trigger("dragstart",n),this.handleMove(n,!0)},this.handleDragMove=n=>{this.emitter.trigger("dragmove",n),this.handleMove(n)},this.handlePointerUp=n=>{this.releaseHits(),this.emitter.trigger("pointerup",n)},this.handleDragEnd=n=>{this.movingHit&&this.emitter.trigger("hitupdate",null,!0,n),this.finalHit=this.movingHit,this.movingHit=null,this.emitter.trigger("dragend",n)},this.droppableStore=t,e.emitter.on("pointerdown",this.handlePointerDown),e.emitter.on("dragstart",this.handleDragStart),e.emitter.on("dragmove",this.handleDragMove),e.emitter.on("pointerup",this.handlePointerUp),e.emitter.on("dragend",this.handleDragEnd),this.dragging=e,this.emitter=new Ju}processFirstCoord(e){let t={left:e.pageX,top:e.pageY},n=t,a=e.subjectEl,i;a instanceof HTMLElement&&(i=jD(a),n=z3(n,i));let s=this.initialHit=this.queryHitForOffset(n.left,n.top);if(s){if(this.useSubjectCenter&&i){let o=YF(i,s.rect);o&&(n=j3(o))}this.coordAdjust=$3(n,t)}else this.coordAdjust={left:0,top:0}}handleMove(e,t){let n=this.queryHitForOffset(e.pageX+this.coordAdjust.left,e.pageY+this.coordAdjust.top);(t||!aO(this.movingHit,n))&&(this.movingHit=n,this.emitter.trigger("hitupdate",n,!1,e))}prepareHits(){this.offsetTrackers=el(this.droppableStore,e=>(e.component.prepareHits(),new l6(e.el)))}releaseHits(){let{offsetTrackers:e}=this;for(let t in e)e[t].destroy();this.offsetTrackers={}}queryHitForOffset(e,t){let{droppableStore:n,offsetTrackers:a}=this,i=null;for(let s in n){let o=n[s].component,l=a[s];if(l&&l.isWithinClipping(e,t)){let c=l.computeLeft(),d=l.computeTop(),u=e-c,p=t-d,{origRect:m}=l,f=m.right-m.left,h=m.bottom-m.top;if(u>=0&&u=0&&pi.layer)&&(g.componentId=s,g.context=o.context,g.rect.left+=c,g.rect.right+=c,g.rect.top+=d,g.rect.bottom+=d,i=g)}}}return i}};c6=class extends ec{constructor(e){super(e),this.handlePointerDown=n=>{let{dragging:a}=this,i=n.origEvent.target;a.setIgnoreMove(!this.component.isValidDateDownEl(i))},this.handleDragEnd=n=>{let{component:a}=this,{pointer:i}=this.dragging;if(!i.wasTouchScroll){let{initialHit:s,finalHit:o}=this.hitDragging;if(s&&o&&aO(s,o)){let{context:l}=a,c=Object.assign(Object.assign({},f6(s.dateSpan,l)),{dayEl:s.dayEl,jsEvent:n.origEvent,view:l.viewApi||l.calendarApi.view});l.emitter.trigger("dateClick",c)}}},this.dragging=new nf(e.el),this.dragging.autoScroller.isEnabled=!1;let t=this.hitDragging=new Wg(this.dragging,LD(e));t.emitter.on("pointerdown",this.handlePointerDown),t.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}},d6=class extends ec{constructor(e){super(e),this.dragSelection=null,this.handlePointerDown=s=>{let{component:o,dragging:l}=this,{options:c}=o.context,d=c.selectable&&o.isValidDateDownEl(s.origEvent.target);l.setIgnoreMove(!d),l.delay=s.isTouch?Bmt(o):null},this.handleDragStart=s=>{this.component.context.calendarApi.unselect(s)},this.handleHitUpdate=(s,o)=>{let{context:l}=this.component,c=null,d=!1;if(s){let u=this.hitDragging.initialHit;s.componentId===u.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(u,s)||(c=Umt(u,s,l.pluginHooks.dateSelectionTransformers)),(!c||!H3(c,s.dateProfile,l))&&(d=!0,c=null)}c?l.dispatch({type:"SELECT_DATES",selection:c}):o||l.dispatch({type:"UNSELECT_DATES"}),d?jb():$b(),o||(this.dragSelection=c)},this.handlePointerUp=s=>{this.dragSelection&&(WF(this.dragSelection,s,this.component.context),this.dragSelection=null)};let{component:t}=e,{options:n}=t.context,a=this.dragging=new nf(e.el);a.touchScrollAllowed=!1,a.minDistance=n.selectMinDistance||0,a.autoScroller.isEnabled=n.dragScroll;let i=this.hitDragging=new Wg(this.dragging,LD(e));i.emitter.on("pointerdown",this.handlePointerDown),i.emitter.on("dragstart",this.handleDragStart),i.emitter.on("hitupdate",this.handleHitUpdate),i.emitter.on("pointerup",this.handlePointerUp)}destroy(){this.dragging.destroy()}};YD=class r extends ec{constructor(e){super(e),this.subjectEl=null,this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=s=>{let o=s.origEvent.target,{component:l,dragging:c}=this,{mirror:d}=c,{options:u}=l.context,p=l.context;this.subjectEl=s.subjectEl;let m=this.subjectSeg=rp(s.subjectEl),h=(this.eventRange=m.eventRange).instance.instanceId;this.relevantEvents=RD(p.getCurrentData().eventStore,h),c.minDistance=s.isTouch?0:u.eventDragMinDistance,c.delay=s.isTouch&&h!==l.props.eventSelection?Vmt(l):null,u.fixedMirrorParent?d.parentNode=u.fixedMirrorParent:d.parentNode=ya(o,".fc"),d.revertDuration=u.dragRevertDuration;let g=l.isValidSegDownEl(o)&&!ya(o,".fc-event-resizer");c.setIgnoreMove(!g),this.isDragging=g&&s.subjectEl.classList.contains("fc-event-draggable")},this.handleDragStart=s=>{let o=this.component.context,l=this.eventRange,c=l.instance.instanceId;s.isTouch?c!==this.component.props.eventSelection&&o.dispatch({type:"SELECT_EVENT",eventInstanceId:c}):o.dispatch({type:"UNSELECT_EVENT"}),this.isDragging&&(o.calendarApi.unselect(s),o.emitter.trigger("eventDragStart",{el:this.subjectEl,event:new Or(o,l.def,l.instance),jsEvent:s.origEvent,view:o.viewApi}))},this.handleHitUpdate=(s,o)=>{if(!this.isDragging)return;let l=this.relevantEvents,c=this.hitDragging.initialHit,d=this.component.context,u=null,p=null,m=null,f=!1,h={affectedEvents:l,mutatedEvents:va(),isEvent:!0};if(s){u=s.context;let g=u.options;d===u||g.editable&&g.droppable?(p=Hmt(c,s,this.eventRange.instance.range.start,u.getCurrentData().pluginHooks.eventDragMutationMassagers),p&&(m=FD(l,u.getCurrentData().eventUiBases,p,u),h.mutatedEvents=m,UD(h,s.dateProfile,u)||(f=!0,p=null,m=null,h.mutatedEvents=va()))):u=null}this.displayDrag(u,h),f?jb():$b(),o||(d===u&&aO(c,s)&&(p=null),this.dragging.setMirrorNeedsRevert(!p),this.dragging.setMirrorIsVisible(!s||!this.subjectEl.getRootNode().querySelector(".fc-event-mirror")),this.receivingContext=u,this.validMutation=p,this.mutatedRelevantEvents=m)},this.handlePointerUp=()=>{this.isDragging||this.cleanup()},this.handleDragEnd=s=>{if(this.isDragging){let o=this.component.context,l=o.viewApi,{receivingContext:c,validMutation:d}=this,u=this.eventRange.def,p=this.eventRange.instance,m=new Or(o,u,p),f=this.relevantEvents,h=this.mutatedRelevantEvents,{finalHit:g}=this.hitDragging;if(this.clearDrag(),o.emitter.trigger("eventDragStop",{el:this.subjectEl,event:m,jsEvent:s.origEvent,view:l}),d){if(c===o){let v=new Or(o,h.defs[u.defId],p?h.instances[p.instanceId]:null);o.dispatch({type:"MERGE_EVENTS",eventStore:h});let b={oldEvent:m,event:v,relatedEvents:hd(h,o,p),revert(){o.dispatch({type:"MERGE_EVENTS",eventStore:f})}},k={};for(let w of o.getCurrentData().pluginHooks.eventDropTransformers)Object.assign(k,w(d,o));o.emitter.trigger("eventDrop",Object.assign(Object.assign(Object.assign({},b),k),{el:s.subjectEl,delta:d.datesDelta,jsEvent:s.origEvent,view:l})),o.emitter.trigger("eventChange",b)}else if(c){let v={event:m,relatedEvents:hd(f,o,p),revert(){o.dispatch({type:"MERGE_EVENTS",eventStore:f})}};o.emitter.trigger("eventLeave",Object.assign(Object.assign({},v),{draggedEl:s.subjectEl,view:l})),o.dispatch({type:"REMOVE_EVENTS",eventStore:f}),o.emitter.trigger("eventRemove",v);let b=h.defs[u.defId],k=h.instances[p.instanceId],w=new Or(c,b,k);c.dispatch({type:"MERGE_EVENTS",eventStore:h});let S={event:w,relatedEvents:hd(h,c,k),revert(){c.dispatch({type:"REMOVE_EVENTS",eventStore:h})}};c.emitter.trigger("eventAdd",S),s.isTouch&&c.dispatch({type:"SELECT_EVENT",eventInstanceId:p.instanceId}),c.emitter.trigger("drop",Object.assign(Object.assign({},f6(g.dateSpan,c)),{draggedEl:s.subjectEl,jsEvent:s.origEvent,view:g.context.viewApi})),c.emitter.trigger("eventReceive",Object.assign(Object.assign({},S),{draggedEl:s.subjectEl,view:g.context.viewApi}))}}else o.emitter.trigger("_noEventDrop")}this.cleanup()};let{component:t}=this,{options:n}=t.context,a=this.dragging=new nf(e.el);a.pointer.selector=r.SELECTOR,a.touchScrollAllowed=!1,a.autoScroller.isEnabled=n.dragScroll;let i=this.hitDragging=new Wg(this.dragging,Ug);i.useSubjectCenter=e.useEventCenter,i.emitter.on("pointerdown",this.handlePointerDown),i.emitter.on("dragstart",this.handleDragStart),i.emitter.on("hitupdate",this.handleHitUpdate),i.emitter.on("pointerup",this.handlePointerUp),i.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}displayDrag(e,t){let n=this.component.context,a=this.receivingContext;a&&a!==e&&(a===n?a.dispatch({type:"SET_EVENT_DRAG",state:{affectedEvents:t.affectedEvents,mutatedEvents:va(),isEvent:!0}}):a.dispatch({type:"UNSET_EVENT_DRAG"})),e&&e.dispatch({type:"SET_EVENT_DRAG",state:t})}clearDrag(){let e=this.component.context,{receivingContext:t}=this;t&&t.dispatch({type:"UNSET_EVENT_DRAG"}),e!==t&&e.dispatch({type:"UNSET_EVENT_DRAG"})}cleanup(){this.subjectSeg=null,this.isDragging=!1,this.eventRange=null,this.relevantEvents=null,this.receivingContext=null,this.validMutation=null,this.mutatedRelevantEvents=null}};YD.SELECTOR=".fc-event-draggable, .fc-event-resizable";u6=class extends ec{constructor(e){super(e),this.draggingSegEl=null,this.draggingSeg=null,this.eventRange=null,this.relevantEvents=null,this.validMutation=null,this.mutatedRelevantEvents=null,this.handlePointerDown=i=>{let{component:s}=this,o=this.querySegEl(i),l=rp(o),c=this.eventRange=l.eventRange;this.dragging.minDistance=s.context.options.eventDragMinDistance,this.dragging.setIgnoreMove(!this.component.isValidSegDownEl(i.origEvent.target)||i.isTouch&&this.component.props.eventSelection!==c.instance.instanceId)},this.handleDragStart=i=>{let{context:s}=this.component,o=this.eventRange;this.relevantEvents=RD(s.getCurrentData().eventStore,this.eventRange.instance.instanceId);let l=this.querySegEl(i);this.draggingSegEl=l,this.draggingSeg=rp(l),s.calendarApi.unselect(),s.emitter.trigger("eventResizeStart",{el:l,event:new Or(s,o.def,o.instance),jsEvent:i.origEvent,view:s.viewApi})},this.handleHitUpdate=(i,s,o)=>{let{context:l}=this.component,c=this.relevantEvents,d=this.hitDragging.initialHit,u=this.eventRange.instance,p=null,m=null,f=!1,h={affectedEvents:c,mutatedEvents:va(),isEvent:!0};i&&(i.componentId===d.componentId&&this.isHitComboAllowed&&!this.isHitComboAllowed(d,i)||(p=qmt(d,i,o.subjectEl.classList.contains("fc-event-resizer-start"),u.range))),p&&(m=FD(c,l.getCurrentData().eventUiBases,p,l),h.mutatedEvents=m,UD(h,i.dateProfile,l)||(f=!0,p=null,m=null,h.mutatedEvents=null)),m?l.dispatch({type:"SET_EVENT_RESIZE",state:h}):l.dispatch({type:"UNSET_EVENT_RESIZE"}),f?jb():$b(),s||(p&&aO(d,i)&&(p=null),this.validMutation=p,this.mutatedRelevantEvents=m)},this.handleDragEnd=i=>{let{context:s}=this.component,o=this.eventRange.def,l=this.eventRange.instance,c=new Or(s,o,l),d=this.relevantEvents,u=this.mutatedRelevantEvents;if(s.emitter.trigger("eventResizeStop",{el:this.draggingSegEl,event:c,jsEvent:i.origEvent,view:s.viewApi}),this.validMutation){let p=new Or(s,u.defs[o.defId],l?u.instances[l.instanceId]:null);s.dispatch({type:"MERGE_EVENTS",eventStore:u});let m={oldEvent:c,event:p,relatedEvents:hd(u,s,l),revert(){s.dispatch({type:"MERGE_EVENTS",eventStore:d})}};s.emitter.trigger("eventResize",Object.assign(Object.assign({},m),{el:this.draggingSegEl,startDelta:this.validMutation.startDelta||mt(0),endDelta:this.validMutation.endDelta||mt(0),jsEvent:i.origEvent,view:s.viewApi})),s.emitter.trigger("eventChange",m)}else s.emitter.trigger("_noEventResize");this.draggingSeg=null,this.relevantEvents=null,this.validMutation=null};let{component:t}=e,n=this.dragging=new nf(e.el);n.pointer.selector=".fc-event-resizer",n.touchScrollAllowed=!1,n.autoScroller.isEnabled=t.context.options.dragScroll;let a=this.hitDragging=new Wg(this.dragging,LD(e));a.emitter.on("pointerdown",this.handlePointerDown),a.emitter.on("dragstart",this.handleDragStart),a.emitter.on("hitupdate",this.handleHitUpdate),a.emitter.on("dragend",this.handleDragEnd)}destroy(){this.dragging.destroy()}querySegEl(e){return ya(e.subjectEl,".fc-event")}};p6=class{constructor(e){this.context=e,this.isRecentPointerDateSelect=!1,this.matchesCancel=!1,this.matchesEvent=!1,this.onSelect=n=>{n.jsEvent&&(this.isRecentPointerDateSelect=!0)},this.onDocumentPointerDown=n=>{let a=this.context.options.unselectCancel,i=OF(n.origEvent);this.matchesCancel=!!ya(i,a),this.matchesEvent=!!ya(i,YD.SELECTOR)},this.onDocumentPointerUp=n=>{let{context:a}=this,{documentPointer:i}=this,s=a.getCurrentData();if(!i.wasTouchScroll){if(s.dateSelection&&!this.isRecentPointerDateSelect){let o=a.options.unselectAuto;o&&(!o||!this.matchesCancel)&&a.calendarApi.unselect(n)}s.eventSelection&&!this.matchesEvent&&a.dispatch({type:"UNSELECT_EVENT"})}this.isRecentPointerDateSelect=!1};let t=this.documentPointer=new eO(document);t.shouldIgnoreMove=!0,t.shouldWatchScroll=!1,t.emitter.on("pointerdown",this.onDocumentPointerDown),t.emitter.on("pointerup",this.onDocumentPointerUp),e.emitter.on("select",this.onSelect)}destroy(){this.context.emitter.off("select",this.onSelect),this.documentPointer.destroy()}},Wmt={fixedMirrorParent:U},Ymt={dateClick:U,eventDragStart:U,eventDragStop:U,eventDrop:U,eventResizeStart:U,eventResizeStop:U,eventResize:U,drop:U,eventReceive:U,eventLeave:U},m6=class{constructor(e,t){this.receivingContext=null,this.droppableEvent=null,this.suppliedDragMeta=null,this.dragMeta=null,this.handleDragStart=a=>{this.dragMeta=this.buildDragMeta(a.subjectEl)},this.handleHitUpdate=(a,i,s)=>{let{dragging:o}=this.hitDragging,l=null,c=null,d=!1,u={affectedEvents:va(),mutatedEvents:va(),isEvent:this.dragMeta.create};a&&(l=a.context,this.canDropElOnCalendar(s.subjectEl,l)&&(c=Gmt(a.dateSpan,this.dragMeta,l),u.mutatedEvents=Ig(c),d=!UD(u,a.dateProfile,l),d&&(u.mutatedEvents=va(),c=null))),this.displayDrag(l,u),o.setMirrorIsVisible(i||!c||!document.querySelector(".fc-event-mirror")),d?jb():$b(),i||(o.setMirrorNeedsRevert(!c),this.receivingContext=l,this.droppableEvent=c)},this.handleDragEnd=a=>{let{receivingContext:i,droppableEvent:s}=this;if(this.clearDrag(),i&&s){let o=this.hitDragging.finalHit,l=o.context.viewApi,c=this.dragMeta;if(i.emitter.trigger("drop",Object.assign(Object.assign({},f6(o.dateSpan,i)),{draggedEl:a.subjectEl,jsEvent:a.origEvent,view:l})),c.create){let d=Ig(s);i.dispatch({type:"MERGE_EVENTS",eventStore:d}),a.isTouch&&i.dispatch({type:"SELECT_EVENT",eventInstanceId:s.instance.instanceId}),i.emitter.trigger("eventReceive",{event:new Or(i,s.def,s.instance),relatedEvents:[],revert(){i.dispatch({type:"REMOVE_EVENTS",eventStore:d})},draggedEl:a.subjectEl,view:l})}}this.receivingContext=null,this.droppableEvent=null};let n=this.hitDragging=new Wg(e,Ug);n.requireInitial=!1,n.emitter.on("dragstart",this.handleDragStart),n.emitter.on("hitupdate",this.handleHitUpdate),n.emitter.on("dragend",this.handleDragEnd),this.suppliedDragMeta=t}buildDragMeta(e){return typeof this.suppliedDragMeta=="object"?BD(this.suppliedDragMeta):typeof this.suppliedDragMeta=="function"?BD(this.suppliedDragMeta(e)):Kmt(e)}displayDrag(e,t){let n=this.receivingContext;n&&n!==e&&n.dispatch({type:"UNSET_EVENT_DRAG"}),e&&e.dispatch({type:"SET_EVENT_DRAG",state:t})}clearDrag(){this.receivingContext&&this.receivingContext.dispatch({type:"UNSET_EVENT_DRAG"})}canDropElOnCalendar(e,t){let n=t.options.dropAccept;return typeof n=="function"?n.call(t.calendarApi,e):typeof n=="string"&&n?!!FF(e,n):!0}};Kb.dataAttrPrefix="";nO=class{constructor(e,t={}){this.handlePointerDown=a=>{let{dragging:i}=this,{minDistance:s,longPressDelay:o}=this.settings;i.minDistance=s!=null?s:a.isTouch?0:fd.eventDragMinDistance,i.delay=a.isTouch?o!=null?o:fd.longPressDelay:0},this.handleDragStart=a=>{a.isTouch&&this.dragging.delay&&a.subjectEl.classList.contains("fc-event")&&this.dragging.mirror.getMirrorEl().classList.add("fc-event-selected")},this.settings=t;let n=this.dragging=new nf(e);n.touchScrollAllowed=!1,t.itemSelector!=null&&(n.pointer.selector=t.itemSelector),t.appendTo!=null&&(n.mirror.parentNode=t.appendTo),n.emitter.on("pointerdown",this.handlePointerDown),n.emitter.on("dragstart",this.handleDragStart),new m6(n,t.eventData)}destroy(){this.dragging.destroy()}},K0e=yi({name:"@fullcalendar/interaction",componentInteractions:[c6,d6,YD,u6],calendarInteractions:[p6],elementDraggingImpl:nf,optionRefiners:Wmt,listenerRefiners:Ymt})});var iO,Z0e=y(()=>{h6();iO=class{constructor(e){this.draggableInstances=new Map;this.plugin=e}makeTaskCardDraggable(e,t){if(this.draggableInstances.has(e))return;e.dataset.taskPath=t;let n=new nO(e);this.draggableInstances.set(e,n),e.classList.remove("tn-static-cursor-pointer-2723efcc","tn-static-cursor-pointer-3b6a3a65"),e.classList.add("tn-static-cursor-grab-dad79857"),e.addEventListener("dragstart",a=>{e.classList.add("task-card--dragging"),a.dataTransfer&&(a.dataTransfer.setData("text/plain",t),a.dataTransfer.setData("application/x-task-path",t),a.dataTransfer.effectAllowed="copy")}),e.addEventListener("dragend",()=>{e.classList.remove("task-card--dragging")})}removeDraggable(e){let t=this.draggableInstances.get(e);t&&(t.destroy(),this.draggableInstances.delete(e))}destroy(){this.draggableInstances.forEach(e=>{e.destroy()}),this.draggableInstances.clear()}}});function sO(r){if(!r)return null;let e=Date.parse(r);return Number.isFinite(e)?e:null}function af(r){return Number.isFinite(r)?Math.max(1,Math.min(7200,Math.floor(r))):60}function g6(r){return af(r.plannedDuration*60)}function Jb(r,e=Date.now()){var t;return((t=r.activePeriods)!=null?t:[]).reduce((n,a)=>{var l;let i=sO(a.startTime);if(i===null)return n;let s=(l=sO(a.endTime))!=null?l:e,o=Math.max(0,s-i);return n+Math.floor(o/1e3)},0)}function oO(r,e=Date.now()){let t=g6(r),n=Jb(r,e);return Math.max(0,t-n)}function Q0e(r,e=Date.now()){let t=g6(r);if(t<=0)return 0;let n=Jb(r,e);return Math.max(0,Math.min(1,n/t))}function J0e(r,e=Date.now()){let t=Number.isFinite(r)?Math.max(0,Math.floor(r)):0;return e+t*1e3}function X0e(r,e=Date.now()){var n,a;let t=g6(r)*1e3;for(let i of(n=r.activePeriods)!=null?n:[]){let s=sO(i.startTime);if(s===null)continue;let o=(a=sO(i.endTime))!=null?a:e,l=Math.max(0,o-s);if(l>=t)return s+t;t-=l}return null}function eMe(r){let e=new Date(r),t=-e.getTimezoneOffset(),n=t>=0?"+":"-",a=(o,l=2)=>String(Math.abs(o)).padStart(l,"0"),i=a(Math.floor(Math.abs(t)/60)),s=a(Math.abs(t)%60);return`${e.getFullYear()}-${a(e.getMonth()+1)}-${a(e.getDate())}T${a(e.getHours())}:${a(e.getMinutes())}:${a(e.getSeconds())}.${a(e.getMilliseconds(),3)}${n}${i}:${s}`}function Xb(r,e={}){var c;let t=Math.max(0,Math.floor(r)),n=Math.floor(t/60),a=t%60,i=Math.floor(n/60),s=n%60,o=(c=e.padMinutes)!=null?c:!0;return i>0?`${i}:${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`:`${o?n.toString().padStart(2,"0"):n.toString()}:${a.toString().padStart(2,"0")}`}function tMe(r){let e=r.trim();if(!e)return null;let t=e.split(":");if(t.length<1||t.length>3||!t.every(i=>/^\d+$/.test(i)))return null;let n=t.map(i=>Number(i));if(n.some(i=>!Number.isSafeInteger(i)))return null;let a;if(n.length===1)a=n[0]*60;else if(n.length===2){let[i,s]=n;if(s>59)return null;a=i*60+s}else{let[i,s,o]=n;if(s>59||o>59)return null;a=i*3600+s*60+o}return a<=0?null:af(a)}var lO=y(()=>{});var vd,rMe,cO,nMe=y(()=>{Yr();nW();vd=require("obsidian");Vo();lO();K();rMe=N({tag:"Services/StatusBarService"}),cO=class{constructor(e){this.statusBarElement=null;this.pomodoroStatusBarElement=null;this.updateTimeout=null;this.pomodoroUpdateTimeout=null;this.elapsedUpdateInterval=null;this.currentTrackedTasks=[];this.pomodoroEventRefs=[];this.plugin=e,this.requestDeduplicator=new Jk}initialize(){this.ensureTrackedStatusBarElement(),this.ensurePomodoroStatusBarElement(),this.registerPomodoroEvents(),this.updateStatusBar(),this.updatePomodoroStatusBar()}ensureTrackedStatusBarElement(){this.statusBarElement||!this.plugin.settings.showTrackedTasksInStatusBar||(this.statusBarElement=this.plugin.addStatusBarItem(),this.statusBarElement.addClass("tasknotes-status-bar"),this.statusBarElement.classList.remove("tn-static-cursor-grab-dad79857","tn-static-cursor-pointer-2723efcc"),this.statusBarElement.classList.add("tn-static-cursor-pointer-3b6a3a65"),this.statusBarElement.addEventListener("click",()=>{this.handleStatusBarClick()}))}ensurePomodoroStatusBarElement(){this.pomodoroStatusBarElement||!this.plugin.settings.showPomodoroInStatusBar||(this.pomodoroStatusBarElement=this.plugin.addStatusBarItem(),this.pomodoroStatusBarElement.addClass("tasknotes-status-bar"),this.pomodoroStatusBarElement.addClass("tasknotes-pomodoro-status"),this.pomodoroStatusBarElement.classList.remove("tn-static-cursor-grab-dad79857","tn-static-cursor-pointer-2723efcc"),this.pomodoroStatusBarElement.classList.add("tn-static-cursor-pointer-3b6a3a65"),this.pomodoroStatusBarElement.addEventListener("click",()=>{this.plugin.activatePomodoroView()}))}registerPomodoroEvents(){var t;if(this.pomodoroEventRefs.length>0||!((t=this.plugin.emitter)!=null&&t.on))return;let e=()=>this.requestPomodoroUpdate();this.pomodoroEventRefs=[this.plugin.emitter.on(ou,e),this.plugin.emitter.on(Ri,e),this.plugin.emitter.on(lu,e),this.plugin.emitter.on(cu,e)]}async updateStatusBar(){if(!this.statusBarElement){this.stopElapsedTicker();return}if(!this.plugin.settings.showTrackedTasksInStatusBar){this.hide();return}try{let e=await this.requestDeduplicator.execute("update-status-bar",()=>this.getTrackedTasks());this.renderStatusBar(e)}catch(e){rMe.error("Error updating status bar:",{category:"internal",operation:"updating-status-bar",error:e})}}updatePomodoroStatusBar(){if(!this.plugin.settings.showPomodoroInStatusBar){this.hidePomodoroStatusBar();return}if(this.ensurePomodoroStatusBarElement(),!this.pomodoroStatusBarElement||!this.plugin.pomodoroService)return;let e=this.plugin.pomodoroService.getState();if(!e.currentSession){this.hidePomodoroStatusBar();return}this.showElement(this.pomodoroStatusBarElement),this.renderPomodoroStatusBar(e)}async getTrackedTasks(){return this.plugin.cacheManager.getAllCachedTasks().filter(t=>t.archived?!1:this.plugin.getActiveTimeSession(t)!==null)}renderStatusBar(e){if(!this.statusBarElement)return;this.currentTrackedTasks=[...e];let t=e.length;if(t===0){this.stopElapsedTicker(),this.statusBarElement.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.statusBarElement.classList.add("tn-static-display-none-6b99de8b");return}this.startElapsedTicker(),this.statusBarElement.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),this.statusBarElement.style.removeProperty("display"),this.statusBarElement.empty();let n=this.statusBarElement.createSpan({cls:"tasknotes-status-icon"});(0,vd.setIcon)(n,"timer");let a=this.statusBarElement.createSpan({cls:"tasknotes-status-text"});if(t===1){let i=e[0],s=i.title.length>30?i.title.substring(0,30)+"...":i.title,o=this.formatElapsedDuration(this.getActiveElapsedMs(i));a.setText(`Tracking: ${s} (${o})`),(0,vd.setTooltip)(this.statusBarElement,`Currently tracking: ${i.title} Elapsed: ${o}`,{placement:"top"})}else{let i=this.formatElapsedDuration(e.reduce((l,c)=>l+this.getActiveElapsedMs(c),0));a.setText(`Tracking ${t} tasks (${i} total)`);let s=e.slice(0,5).map(l=>`${l.title} - ${this.formatElapsedDuration(this.getActiveElapsedMs(l))}`).join(` `),o=t>5?`${s} ... and ${t-5} more`:s;(0,vd.setTooltip)(this.statusBarElement,`Currently tracking: ${o}`,{placement:"top"})}}renderPomodoroStatusBar(e){if(!this.pomodoroStatusBarElement||!e.currentSession)return;this.pomodoroStatusBarElement.empty();let t=this.pomodoroStatusBarElement.createSpan({cls:"tasknotes-status-icon"});(0,vd.setIcon)(t,e.currentSession.type==="work"?"timer":"coffee");let n=this.pomodoroStatusBarElement.createSpan({cls:"tasknotes-status-text"}),a=Xb(e.timeRemaining),i=this.getPomodoroSessionLabel(e.currentSession.type),s=e.isRunning?i:`${i} paused`;n.setText(`${s}: ${a}`),(0,vd.setTooltip)(this.pomodoroStatusBarElement,`${s} Remaining: ${a} Click to open Pomodoro`,{placement:"top"})}getPomodoroSessionLabel(e){return e==="work"?"Focus":e==="short-break"?"Short break":"Long break"}showElement(e){e.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),e.style.removeProperty("display")}getActiveElapsedMs(e){let t=this.plugin.getActiveTimeSession(e);if(!(t!=null&&t.startTime))return 0;let n=Date.parse(t.startTime);return Number.isFinite(n)?Math.max(0,Date.now()-n):0}formatElapsedDuration(e){let t=Math.floor(e/1e3),n=t%60,a=Math.floor(t/60),i=a%60,s=Math.floor(a/60);return s>0?`${s}:${i.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`:`${i}:${n.toString().padStart(2,"0")}`}startElapsedTicker(){this.elapsedUpdateInterval===null&&(this.elapsedUpdateInterval=window.setInterval(()=>{if(this.currentTrackedTasks.length===0){this.stopElapsedTicker();return}this.renderStatusBar(this.currentTrackedTasks)},1e3))}stopElapsedTicker(){this.elapsedUpdateInterval!==null&&(window.clearInterval(this.elapsedUpdateInterval),this.elapsedUpdateInterval=null),this.currentTrackedTasks=[]}async handleStatusBarClick(){try{let e=await this.getTrackedTasks();if(e.length===0)return;if(e.length===1){let t=e[0],n=this.plugin.app.vault.getAbstractFileByPath(t.path);n instanceof vd.TFile&&await this.plugin.app.workspace.getLeaf(!1).openFile(n)}else Fn(this.plugin,e,t=>{(async()=>{if(t){let n=this.plugin.app.vault.getAbstractFileByPath(t.path);n instanceof vd.TFile&&await this.plugin.app.workspace.getLeaf(!1).openFile(n)}})()})}catch(e){rMe.error("Error handling status bar click:",{category:"internal",operation:"handling-status-bar-click",error:e})}}requestUpdate(){this.updateTimeout&&window.clearTimeout(this.updateTimeout),this.updateTimeout=window.setTimeout(()=>{this.updateStatusBar()},100)}requestPomodoroUpdate(){this.pomodoroUpdateTimeout&&window.clearTimeout(this.pomodoroUpdateTimeout),this.pomodoroUpdateTimeout=window.setTimeout(()=>{this.updatePomodoroStatusBar()},100)}updateVisibility(){this.plugin.settings.showTrackedTasksInStatusBar?this.statusBarElement?this.updateStatusBar():this.ensureTrackedStatusBarElement():this.hide(),this.plugin.settings.showPomodoroInStatusBar?(this.ensurePomodoroStatusBarElement(),this.updatePomodoroStatusBar()):this.hidePomodoroStatusBar()}hide(){this.stopElapsedTicker(),this.statusBarElement&&(this.statusBarElement.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.statusBarElement.classList.add("tn-static-display-none-6b99de8b"))}hidePomodoroStatusBar(){this.pomodoroStatusBarElement&&(this.pomodoroStatusBarElement.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-min-height-800px-997b4c8c"),this.pomodoroStatusBarElement.classList.add("tn-static-display-none-6b99de8b"))}destroy(){var e;this.updateTimeout&&(window.clearTimeout(this.updateTimeout),this.updateTimeout=null),this.pomodoroUpdateTimeout&&(window.clearTimeout(this.pomodoroUpdateTimeout),this.pomodoroUpdateTimeout=null),this.stopElapsedTicker(),(e=this.plugin.emitter)!=null&&e.offref&&this.pomodoroEventRefs.forEach(t=>this.plugin.emitter.offref(t)),this.pomodoroEventRefs=[],this.requestDeduplicator&&this.requestDeduplicator.cancelAll(),this.statusBarElement=null,this.pomodoroStatusBarElement=null}}});var aMe,y6,dO,iMe=y(()=>{aMe=require("obsidian");Yr();Me();K();Uu();y6=N({tag:"Services/NotificationService"}),dO=class{constructor(e){this.notificationQueue=[];this.processedReminders=new Set;this.activeAudioContexts=new Set;this.audioCleanupTimeouts=new Set;this.lastBroadScanTime=Date.now();this.lastQuickCheckTime=Date.now();this.BROAD_SCAN_INTERVAL=300*1e3;this.QUICK_CHECK_INTERVAL=30*1e3;this.QUEUE_WINDOW=300*1e3;this.plugin=e}async initialize(){this.plugin.settings.enableNotifications&&(this.plugin.settings.notificationType==="system"&&typeof Notification!="undefined"&&Notification.permission==="default"&&await Notification.requestPermission(),this.setupTaskUpdateListener(),this.setupFileUpdateListener(),this.startBroadScan(),this.startQuickCheck(),await this.scanTasksAndBuildQueue())}destroy(){this.broadScanInterval&&window.clearInterval(this.broadScanInterval),this.quickCheckInterval&&window.clearInterval(this.quickCheckInterval),this.taskUpdateListener&&this.plugin.emitter.offref(this.taskUpdateListener),this.fileUpdateListener&&this.plugin.emitter.offref(this.fileUpdateListener);for(let e of this.audioCleanupTimeouts)window.clearTimeout(e);this.audioCleanupTimeouts.clear();for(let e of this.activeAudioContexts)e.state!=="closed"&&e.close().catch(()=>{});this.activeAudioContexts.clear(),this.notificationQueue=[],this.processedReminders.clear()}startBroadScan(){this.broadScanInterval=window.setInterval(()=>{(async()=>{let e=Date.now();e-this.lastBroadScanTime>this.BROAD_SCAN_INTERVAL+6e4&&await this.handleSystemWakeUp(),await this.scanTasksAndBuildQueue(),this.lastBroadScanTime=e})()},this.BROAD_SCAN_INTERVAL)}startQuickCheck(){this.quickCheckInterval=window.setInterval(()=>{let e=Date.now();e-this.lastQuickCheckTime>this.QUICK_CHECK_INTERVAL+6e4,this.checkNotificationQueue(),this.lastQuickCheckTime=e},this.QUICK_CHECK_INTERVAL)}async scanTasksAndBuildQueue(){this.notificationQueue=[];let e=this.plugin.cacheManager.getAllCachedTasks(),t=Date.now(),n=t+this.QUEUE_WINDOW;for(let a of e)if(!(!a.reminders||a.reminders.length===0))for(let i of a.reminders){let s=`${a.path}-${i.id}`;if(this.processedReminders.has(s))continue;let o=this.calculateNotificationTime(a,i);o!==null&&o>t&&o<=n&&this.notificationQueue.push({taskPath:a.path,reminder:i,notifyAt:o})}this.notificationQueue.sort((a,i)=>a.notifyAt-i.notifyAt)}calculateNotificationTime(e,t){try{if(t.type==="absolute")return t.absoluteTime?it(t.absoluteTime).getTime():null;if(t.type==="relative"){if(!t.relatedTo||!t.offset)return null;let n=t.relatedTo==="due"?e.due:e.scheduled;if(!n)return null;let a=it(n),i=this.parseISO8601Duration(t.offset);return i===null?null:a.getTime()+i}}catch(n){return y6.error("Error calculating notification time:",{category:"provider",operation:"calculating-notification-time",error:n}),null}return null}parseISO8601Duration(e){let t=e.match(/^(-?)P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/);if(!t)return null;let[,n,a,i,s,o,l,c,d]=t,u=0;return a&&(u+=parseInt(a)*365*24*60*60*1e3),i&&(u+=parseInt(i)*30*24*60*60*1e3),s&&(u+=parseInt(s)*7*24*60*60*1e3),o&&(u+=parseInt(o)*24*60*60*1e3),l&&(u+=parseInt(l)*60*60*1e3),c&&(u+=parseInt(c)*60*1e3),d&&(u+=parseInt(d)*1e3),n==="-"?-u:u}checkNotificationQueue(){let e=Date.now(),t=[];for(let n=0;n=0;n--)this.notificationQueue.splice(t[n],1)}async triggerNotification(e){let t=this.plugin.app.vault.getAbstractFileByPath(e.taskPath);if(!(t instanceof aMe.TFile))return;let n=this.plugin.app.metadataCache.getFileCache(t);if(!n||!n.frontmatter)return;let a=this.plugin.fieldMapper.mapFromFrontmatter(n.frontmatter,e.taskPath,this.plugin.settings.storeTitleInFilename),i=e.reminder.description||this.generateDefaultMessage(a,e.reminder);if(this.playNotificationSound(),this.plugin.settings.notificationType==="system")if("Notification"in window&&Notification.permission==="granted"){let s=new Notification(a.title||"TaskNotes Reminder",{body:i,tag:`tasknotes-${e.taskPath}-${e.reminder.id}`});s.onclick=()=>{this.plugin.app.workspace.openLinkText(e.taskPath,"",!1),s.close()}}else this.showInAppNotice(i,e.taskPath);else this.showInAppNotice(i,e.taskPath);this.plugin.apiService&&await this.plugin.apiService.triggerWebhook("reminder.triggered",{task:a,reminder:e.reminder,notificationTime:new Date(e.notifyAt).toISOString(),message:i,notificationType:this.plugin.settings.notificationType})}playNotificationSound(){if(!this.plugin.settings.notificationSoundEnabled)return;let e=window.AudioContext||window.webkitAudioContext;if(e)try{let t=new e,n=t.createGain(),a=Math.max(0,Math.min(1,this.plugin.settings.notificationSoundVolume/100));n.gain.value=a*.3,n.connect(t.destination);let i=(l,c)=>{let d=t.createOscillator();d.connect(n),d.frequency.value=l,d.type="sine",d.start(),d.stop(t.currentTime+c)};i(880,.12),this.activeAudioContexts.add(t);let s=window.setTimeout(()=>{try{i(1175,.12)}catch(l){y6.error("Failed to play notification sound tone:",{category:"provider",operation:"play-notification-sound-tone",error:l})}},140);this.audioCleanupTimeouts.add(s);let o=window.setTimeout(()=>{this.activeAudioContexts.delete(t),this.audioCleanupTimeouts.delete(s),this.audioCleanupTimeouts.delete(o),t.close().catch(()=>{})},320);this.audioCleanupTimeouts.add(o)}catch(t){y6.error("Failed to play notification sound:",{category:"provider",operation:"play-notification-sound",error:t})}}async sendTestReminderNotification(){let e="TaskNotes Reminder",t="This is a test reminder from TaskNotes.";if(this.playNotificationSound(),this.plugin.settings.notificationType==="system"&&typeof Notification!="undefined"&&(Notification.permission==="default"&&await Notification.requestPermission(),Notification.permission==="granted")){new Notification(e,{body:t,tag:"tasknotes-test-reminder"});return}Xe(t,5e3)}showInAppNotice(e,t){let n=Xe(e,0),a=n.noticeEl;a.addEventListener("click",()=>{this.plugin.app.workspace.openLinkText(t,"",!1),n.hide()}),a.classList.remove("tn-static-cursor-grab-dad79857","tn-static-cursor-pointer-2723efcc"),a.classList.add("tn-static-cursor-pointer-3b6a3a65")}generateDefaultMessage(e,t){if(t.type==="absolute")return`Reminder: ${e.title}`;{let n=t.relatedTo==="due"?"due":"scheduled",a=this.formatDurationForDisplay(t.offset||"");return a.startsWith("-")?`${e.title} is ${n} in ${a.substring(1)}`:a==="PT0S"||a==="PT0M"?`${e.title} is ${n} now`:`${e.title} was ${n} ${a} ago`}}formatDurationForDisplay(e){let t=this.parseISO8601Duration(e);if(t===null)return e;let n=Math.abs(t),a=Math.floor(n/(60*1e3)),i=Math.floor(n/(3600*1e3)),s=Math.floor(n/(1440*60*1e3)),o="";return s>0?o=`${s} day${s>1?"s":""}`:i>0?o=`${i} hour${i>1?"s":""}`:a>0?o=`${a} minute${a>1?"s":""}`:o="now",t<0?`-${o}`:o}async refreshReminders(){await this.scanTasksAndBuildQueue()}queueRemindersForTask(e,t){let n=Date.now(),a=n+this.QUEUE_WINDOW;if(!(!t.reminders||t.reminders.length===0)){for(let i of t.reminders){let s=`${e}-${i.id}`;if(this.processedReminders.has(s))continue;let o=this.calculateNotificationTime(t,i);o!==null&&o>n&&o<=a&&this.notificationQueue.push({taskPath:e,reminder:i,notifyAt:o})}this.notificationQueue.sort((i,s)=>i.notifyAt-s.notifyAt)}}async refreshTaskReminders(e,t){this.removeNotificationsForTask(e),this.clearProcessedRemindersForTask(e);let n=t===void 0?await this.plugin.cacheManager.getTaskInfo(e):t;n&&this.queueRemindersForTask(e,n)}clearProcessedRemindersForTask(e){let t=[];for(let n of this.processedReminders)n.startsWith(`${e}-`)&&t.push(n);t.forEach(n=>this.processedReminders.delete(n))}setupTaskUpdateListener(){this.taskUpdateListener=this.plugin.emitter.on(ot,async({path:e,updatedTask:t})=>{!e||!t||await this.refreshTaskReminders(e,t)})}setupFileUpdateListener(){this.fileUpdateListener=this.plugin.emitter.on("file-updated",async({path:e})=>{e&&await this.refreshTaskReminders(e)})}removeNotificationsForTask(e){this.notificationQueue=this.notificationQueue.filter(t=>t.taskPath!==e)}async handleSystemWakeUp(){let e=Date.now(),t=[];for(let n of this.processedReminders){let[a,i]=n.split("-",2);if(!(!a||!i))try{let s=await this.plugin.cacheManager.getTaskInfo(a);if(s&&s.reminders){let o=s.reminders.find(l=>l.id===i);if(o){let l=this.calculateNotificationTime(s,o);l&&l<=e&&t.push(n)}}}catch(s){t.push(n)}}t.forEach(n=>this.processedReminders.delete(n)),await this.scanTasksAndBuildQueue()}}});var v6,uO,sMe=y(()=>{Yr();K();v6=N({tag:"Services/ViewPerformanceService"}),uO=class{constructor(e){this.globalTaskVersionCache=new Map;this.lastGlobalRefreshTime=0;this.globalTaskCount=0;this.viewHandlers=new Map;this.viewDebounceTimers=new Map;this.viewPendingUpdates=new Map;this.viewConfigs=new Map;this.updateInProgress=new Set;this.eventListener=null;this.plugin=e,this.setupGlobalEventListener()}registerView(e,t){this.viewConfigs.set(e.viewId,{debounceDelay:100,maxBatchSize:5,changeDetectionEnabled:!0,...e}),this.viewHandlers.set(e.viewId,t),this.viewPendingUpdates.set(e.viewId,new Set)}unregisterView(e){let t=this.viewDebounceTimers.get(e);t&&(window.clearTimeout(t),this.viewDebounceTimers.delete(e)),this.viewConfigs.delete(e),this.viewHandlers.delete(e),this.viewPendingUpdates.delete(e),this.updateInProgress.delete(e)}setupGlobalEventListener(){this.eventListener=this.plugin.emitter.on(ot,async({path:e,originalTask:t,updatedTask:n})=>{if(!e||!n){await this.triggerFullRefreshForAllViews();return}n.path||(n.path=e),this.hasTaskChanged(n)&&await this.handleTaskUpdateForAllViews(n,t)})}async handleTaskUpdateForAllViews(e,t){let n=[];for(let[a,i]of this.viewHandlers)i.shouldRefreshForTask&&!i.shouldRefreshForTask(t,e)||n.push(this.scheduleViewUpdate(a,e.path));await Promise.all(n),Math.random()<.1&&await this.cleanupTaskVersionCache()}async scheduleViewUpdate(e,t){let n=this.viewConfigs.get(e);if(!n)return;let a=this.viewPendingUpdates.get(e);a&&a.add(t);let i=this.viewDebounceTimers.get(e);i&&window.clearTimeout(i);let s=window.setTimeout(()=>{this.processPendingUpdatesForView(e)},n.debounceDelay);this.viewDebounceTimers.set(e,s)}async processPendingUpdatesForView(e){if(this.updateInProgress.has(e))return;let t=this.viewConfigs.get(e),n=this.viewHandlers.get(e),a=this.viewPendingUpdates.get(e);if(!(!t||!n||!a||a.size===0)){this.updateInProgress.add(e);try{let i=Array.from(a);if(a.clear(),i.length>t.maxBatchSize)await n.refresh();else{let s=i.map(o=>n.updateForTask(o,"update").catch(l=>{v6.error(`[ViewPerformanceService] Error updating task ${o} in ${e}:`,{category:"persistence",operation:"updating-task",error:l})}));await Promise.all(s)}}catch(i){v6.error(`[ViewPerformanceService] Error processing updates for ${e}:`,{category:"validation",operation:"processing-updates",error:i}),await n.refresh()}finally{this.updateInProgress.delete(e),this.viewDebounceTimers.delete(e)}}}async triggerFullRefreshForAllViews(){let e=[];for(let[t,n]of this.viewHandlers)this.updateInProgress.has(t)||e.push(n.refresh(!0));await Promise.all(e),this.lastGlobalRefreshTime=Date.now()}hasTaskChanged(e){let t=this.globalTaskVersionCache.get(e.path),n=e.dateModified||Date.now().toString();return t!==n?(this.globalTaskVersionCache.set(e.path,n),!0):!1}shouldDoFullRefresh(){let e=Date.now()-this.lastGlobalRefreshTime,t=this.globalTaskVersionCache.size;return e>600*1e3||Math.abs(t-this.globalTaskCount)>20||t===0}async cleanupTaskVersionCache(){try{let e=this.plugin.cacheManager.getAllTaskPaths(),t=new Set(e);for(let n of this.globalTaskVersionCache.keys())t.has(n)||this.globalTaskVersionCache.delete(n);this.globalTaskCount=t.size,this.globalTaskVersionCache.size>2e3&&(this.globalTaskVersionCache.clear(),this.lastGlobalRefreshTime=0)}catch(e){v6.error("[ViewPerformanceService] Error during cache cleanup:",{category:"stale-data",operation:"cache-cleanup",error:e})}}async forceRefreshAll(){this.globalTaskVersionCache.clear(),await this.triggerFullRefreshForAllViews()}getStats(){return{registeredViews:Array.from(this.viewConfigs.keys()),cacheSize:this.globalTaskVersionCache.size,activeUpdates:Array.from(this.updateInProgress),totalPendingUpdates:Array.from(this.viewPendingUpdates.values()).reduce((e,t)=>e+t.size,0),lastGlobalRefresh:new Date(this.lastGlobalRefreshTime).toISOString()}}destroy(){this.eventListener&&(this.plugin.emitter.offref(this.eventListener),this.eventListener=null);for(let e of this.viewDebounceTimers.values())window.clearTimeout(e);this.viewHandlers.clear(),this.viewDebounceTimers.clear(),this.viewPendingUpdates.clear(),this.viewConfigs.clear(),this.updateInProgress.clear(),this.globalTaskVersionCache.clear()}}});function Qmt(r){return r.width>0&&r.height>0}function Jmt(r){let e=r.cacheManager.getAllTaskPaths(),t=[];for(let n of e){let a=r.cacheManager.getCachedTaskInfoSync(n);a&&!a.archived&&t.push(a)}return t}function oMe(r,e){return Qmt(r)?r:e}var np,GD,pO,lMe=y(()=>{np=require("obsidian");Yr();Vo();mi();$c();lN();lO();Me();K();GD=N({tag:"Views/PomodoroView"});pO=class extends np.ItemView{constructor(t,n){super(t);this.timerDisplay=null;this.timerInput=null;this.statusDisplay=null;this.sessionMetaDisplay=null;this.progressCircle=null;this.progressContainer=null;this.startButton=null;this.pauseButton=null;this.stopButton=null;this.taskDisplay=null;this.statsDisplay=null;this.taskSelectButton=null;this.taskClearButton=null;this.currentSelectedTask=null;this.taskCardContainer=null;this.addTimeButton=null;this.subtractTimeButton=null;this.skipBreakButton=null;this.isEditingTimer=!1;this.isTaskSelectorOpen=!1;this.todaysPomodoros=0;this.statElements={pomodoros:null};this.resizeObserver=null;this.resizeTimeout=null;this.functionListeners=[];this.currentCircleSize=300;this.currentCircumference=0;this.listeners=[];this.plugin=n,this.registerEvents()}refreshStats(){this.updateStats().catch(t=>{GD.error("Failed to update stats:",{category:"validation",operation:"update-stats",error:t})})}getViewType(){return su}getDisplayText(){return this.plugin.i18n.translate("views.pomodoro.title")}getIcon(){return"clock"}t(t,n){return this.plugin.i18n.translate(t,n)}registerEvents(){this.listeners.forEach(o=>this.plugin.emitter.offref(o)),this.listeners=[];let t=this.plugin.emitter.on(ou,({session:o,task:l})=>{this.updateDisplay(o,l)});this.listeners.push(t);let n=this.plugin.emitter.on(lu,({session:o,nextType:l})=>{this.onPomodoroComplete(o,l)});this.listeners.push(n);let a=this.plugin.emitter.on(cu,()=>{this.updateDisplay(void 0,void 0,{refreshStats:!0})});this.listeners.push(a);let i=this.plugin.emitter.on(Ri,({timeRemaining:o,session:l})=>{this.updateTimer(o),this.updateDisplay(l)});this.listeners.push(i);let s=this.plugin.emitter.on(ot,async({path:o,originalTask:l,updatedTask:c})=>{if(!o||!c)return;if(this.currentSelectedTask&&(this.currentSelectedTask.path===o||l&&this.currentSelectedTask.path===l.path)){this.currentSelectedTask=c,this.updateTaskCardDisplay(c);let u=this.plugin.pomodoroService.getState();u.currentSession&&l&&l.path!==c.path&&u.currentSession.taskPath===l.path&&await this.plugin.pomodoroService.assignTaskToCurrentSession(c)}});this.listeners.push(s)}async onOpen(){await this.plugin.onReady(),await this.render(),this.ensureResizeHandlingSetup(),this.plugin.app.workspace.layoutReady?window.setTimeout(()=>this.ensureResizeHandlingSetup(),50):this.plugin.app.workspace.onLayoutReady(()=>{this.ensureResizeHandlingSetup()})}async onClose(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.resizeTimeout&&(window.clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.listeners.forEach(t=>this.plugin.emitter.offref(t)),this.functionListeners.forEach(t=>t()),this.timerDisplay=null,this.timerInput=null,this.statusDisplay=null,this.sessionMetaDisplay=null,this.progressCircle=null,this.progressContainer=null,this.startButton=null,this.pauseButton=null,this.stopButton=null,this.taskDisplay=null,this.statsDisplay=null,this.taskSelectButton=null,this.taskClearButton=null,this.currentSelectedTask=null,this.taskCardContainer=null,this.addTimeButton=null,this.subtractTimeButton=null,this.skipBreakButton=null,this.isEditingTimer=!1,this.statElements={pomodoros:null},this.contentEl.empty()}async render(){let t=this.contentEl.createDiv({cls:"tasknotes-plugin pomodoro-view"}),n=t.createDiv({cls:"pomodoro-view__timer-section"}),a=n.createDiv({cls:"pomodoro-view__timer-header"});this.statusDisplay=a.createDiv({cls:"pomodoro-view__status",text:this.t("views.pomodoro.status.ready")}),this.sessionMetaDisplay=a.createDiv({cls:"pomodoro-view__session-meta"}),this.progressContainer=n.createDiv({cls:"pomodoro-view__progress-container"});let i=activeWindow.createSvg("svg");i.setAttribute("class","pomodoro-view__progress-svg"),i.setAttribute("width","300"),i.setAttribute("height","300"),i.setAttribute("viewBox","0 0 300 300"),this.progressContainer.appendChild(i);let s=activeWindow.createSvg("circle");s.setAttributeNS(null,"cx","150"),s.setAttributeNS(null,"cy","150"),s.setAttributeNS(null,"r","140"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"stroke","var(--tn-border-color)"),s.setAttributeNS(null,"stroke-width","2"),i.appendChild(s),this.progressCircle=activeWindow.createSvg("circle"),this.progressCircle.setAttributeNS(null,"cx","150"),this.progressCircle.setAttributeNS(null,"cy","150"),this.progressCircle.setAttributeNS(null,"r","140"),this.progressCircle.setAttributeNS(null,"fill","none"),this.progressCircle.setAttributeNS(null,"stroke","var(--tn-interactive-accent)"),this.progressCircle.setAttributeNS(null,"stroke-width","4"),this.progressCircle.setAttributeNS(null,"stroke-linecap","round");let l=2*Math.PI*140;this.progressCircle.setAttributeNS(null,"stroke-dasharray",l.toString()),this.progressCircle.setAttributeNS(null,"stroke-dashoffset",l.toString()),this.progressCircle.addClass("pomodoro-view__progress-circle"),i.appendChild(this.progressCircle);let c=this.progressContainer.createDiv({cls:"pomodoro-view__timer-overlay"}),u=`${this.plugin.settings.pomodoroWorkDuration.toString().padStart(2,"0")}:00`;this.timerDisplay=c.createDiv({cls:"pomodoro-view__timer-display",text:u}),this.timerDisplay.tabIndex=0,this.timerDisplay.setAttribute("role","button"),this.timerDisplay.setAttribute("aria-label",this.t("views.pomodoro.timer.editLabel")),this.timerInput=c.createEl("input",{cls:"pomodoro-view__timer-input pomodoro-view__timer-input--hidden",attr:{type:"text",inputmode:"numeric","aria-label":this.t("views.pomodoro.timer.inputLabel")}});let p=c.createDiv({cls:"pomodoro-view__time-controls"});this.subtractTimeButton=p.createEl("button",{cls:"pomodoro-view__time-adjust-button pomodoro-view__subtract-time",text:"-1m"}),this.subtractTimeButton.setAttribute("aria-label",this.t("views.pomodoro.buttons.subtractMinute")),this.addTimeButton=p.createEl("button",{cls:"pomodoro-view__time-adjust-button pomodoro-view__add-time",text:"+1m"}),this.addTimeButton.setAttribute("aria-label",this.t("views.pomodoro.buttons.addMinute")),this.taskDisplay=t.createDiv({cls:"pomodoro-view__task-display"});let m=t.createDiv({cls:"pomodoro-view__task-selector"}),f=m.createDiv({cls:"pomodoro-view__task-buttons"});this.taskSelectButton=f.createEl("button",{cls:"pomodoro-view__task-select-button",text:this.t("views.pomodoro.buttons.chooseTask")}),this.taskClearButton=f.createEl("button",{cls:"pomodoro-view__task-clear-button pomodoro-view__task-clear-button--hidden",text:this.t("views.pomodoro.buttons.clearTask")}),this.taskCardContainer=m.createDiv({cls:"pomodoro-view__task-card-container"});let h=t.createDiv({cls:"pomodoro-view__control-section"}),g=h.createDiv({cls:"pomodoro-view__primary-controls"});this.startButton=g.createEl("button",{text:this.t("views.pomodoro.buttons.startFocus"),cls:"pomodoro-view__start-button"}),this.pauseButton=g.createEl("button",{text:this.t("views.pomodoro.buttons.pause"),cls:"pomodoro-view__pause-button"}),this.pauseButton.addClass("pomodoro-view__pause-button--hidden"),this.stopButton=g.createEl("button",{text:this.t("views.pomodoro.buttons.stop"),cls:"pomodoro-view__stop-button"}),this.stopButton.addClass("pomodoro-view__stop-button--hidden"),this.skipBreakButton=h.createEl("button",{cls:"pomodoro-view__skip-break-button",text:this.t("views.pomodoro.buttons.skipBreak")}),this.skipBreakButton.addClass("pomodoro-view__skip-break-button--hidden");let v=t.createDiv({cls:"pomodoro-view__stats-section"});this.statsDisplay=v.createDiv({cls:"pomodoro-view__stats"});let b=this.statsDisplay.createDiv({cls:"pomodoro-view__stat pomodoro-view__stat--clickable"});if(this.statElements.pomodoros=b.createSpan({cls:"pomodoro-view__stat-value",text:"0"}),b.createSpan({cls:"pomodoro-view__stat-label",text:this.t("views.pomodoro.statsLabel")}),this.registerDomEvent(b,"click",()=>{this.plugin.activatePomodoroStatsView()}),this.registerDomEvent(this.startButton,"click",async()=>{var k,w,S;if(!((k=this.startButton)!=null&&k.hasClass("is-loading"))){(w=this.startButton)==null||w.addClass("pomodoro-view__start-button--loading");try{let C=this.plugin.pomodoroService.getState();C.currentSession&&!C.isRunning?await this.plugin.pomodoroService.resumePomodoro():C.nextSessionType==="short-break"?await this.plugin.pomodoroService.startBreak(!1):C.nextSessionType==="long-break"?await this.plugin.pomodoroService.startBreak(!0):await this.plugin.pomodoroService.startPomodoro(this.currentSelectedTask||void 0)}finally{(S=this.startButton)==null||S.removeClass("pomodoro-view__start-button--loading")}}}),this.registerDomEvent(this.pauseButton,"click",()=>{this.plugin.pomodoroService.pausePomodoro()}),this.registerDomEvent(this.stopButton,"click",()=>{this.plugin.pomodoroService.stopPomodoro()}),this.registerDomEvent(this.skipBreakButton,"click",()=>{let k=this.plugin.pomodoroService.getState();k.currentSession?this.plugin.pomodoroService.stopPomodoro():(k.nextSessionType==="short-break"||k.nextSessionType==="long-break")&&this.plugin.pomodoroService.skipBreak()}),this.registerDomEvent(this.addTimeButton,"click",()=>{this.adjustSessionTime(60)}),this.registerDomEvent(this.subtractTimeButton,"click",()=>{this.adjustSessionTime(-60)}),this.registerDomEvent(this.timerDisplay,"click",()=>{this.beginTimerEdit()}),this.registerDomEvent(this.timerDisplay,"keydown",k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),this.beginTimerEdit())}),this.registerDomEvent(this.timerInput,"keydown",k=>{k.key==="Enter"?(k.preventDefault(),this.commitTimerEdit()):k.key==="Escape"&&(k.preventDefault(),this.cancelTimerEdit())}),this.registerDomEvent(this.timerInput,"blur",()=>{this.commitTimerEdit()}),this.registerDomEvent(this.taskSelectButton,"click",async()=>{await this.openTaskSelector()}),this.registerDomEvent(this.taskClearButton,"click",async()=>{await this.selectTask(null)}),this.restoreLastSelectedTask(),this.updateDisplay(),this.refreshStats(),this.plugin.pomodoroService){let k=this.plugin.pomodoroService.getState();this.updateTimer(k.timeRemaining)}}setupResizeHandling(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.resizeTimeout&&(window.clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.functionListeners.forEach(s=>s()),this.functionListeners=[];let t=this.contentEl.ownerDocument.defaultView||window,n=()=>{this.resizeTimeout&&t.clearTimeout(this.resizeTimeout),this.resizeTimeout=t.setTimeout(()=>{this.updateResponsiveLayout()},150)};t.ResizeObserver&&(this.resizeObserver=new t.ResizeObserver(n),this.contentEl.querySelector(".pomodoro-view")&&this.resizeObserver.observe(this.contentEl));let a=this.plugin.app.workspace.on("layout-change",n);this.listeners.push(a),t.addEventListener("resize",n),this.functionListeners.push(()=>t.removeEventListener("resize",n));let i=this.plugin.app.workspace.on("active-leaf-change",s=>{s===this.leaf&&t.setTimeout(()=>{this.updateResponsiveLayout()},100)});this.listeners.push(i),this.updateResponsiveLayout()}ensureResizeHandlingSetup(t=0){let a=Math.min(100*Math.pow(1.5,t),1e3);window.setTimeout(()=>{if(!this.resizeObserver){let i=this.contentEl.querySelector(".pomodoro-view");if(i){let s=this.contentEl.getBoundingClientRect(),o=i.getBoundingClientRect(),{width:l,height:c}=oMe({width:s.width,height:s.height},{width:o.width,height:o.height});l>0&&c>0?this.setupResizeHandling():t<10&&this.ensureResizeHandlingSetup(t+1)}else t<10&&this.ensureResizeHandlingSetup(t+1)}},a)}updateResponsiveLayout(){let t=this.contentEl.querySelector(".pomodoro-view");if(!t)return;let n=t.getBoundingClientRect(),a=this.contentEl.getBoundingClientRect(),{width:i,height:s}=oMe({width:a.width,height:a.height},{width:n.width,height:n.height}),o=Math.min(i/600,1),l=Math.min(s/800,1),c=Math.min(o*.7+l*.3,1);t.classList.remove("pomodoro-view--tiny","pomodoro-view--extra-narrow","pomodoro-view--very-narrow","pomodoro-view--narrow","pomodoro-view--small","pomodoro-view--medium-small","pomodoro-view--medium","pomodoro-view--wide"),i<=200?t.classList.add("pomodoro-view--tiny"):i<=250?t.classList.add("pomodoro-view--extra-narrow"):i<=300?t.classList.add("pomodoro-view--very-narrow"):i<=350?t.classList.add("pomodoro-view--narrow"):i<=400?t.classList.add("pomodoro-view--small"):i<=500?t.classList.add("pomodoro-view--medium-small"):i<=600?t.classList.add("pomodoro-view--medium"):t.classList.add("pomodoro-view--wide");let d=t.querySelector(".pomodoro-view__timer-display"),u=t.querySelector(".pomodoro-view__timer-input");if(d||u){let p,m;i<=200?(p=2,m="700"):i<=250?(p=2.2,m="650"):i<=300?(p=2.5,m="600"):i<=350?(p=3,m="600"):i<=400?(p=3.2,m="550"):i<=500?(p=3.6,m="500"):i<=600?(p=4,m="500"):(p=4.5,m="400");let h=`${Math.max(p*c,1.5).toFixed(1)}rem`;d&&(d.style.fontSize=h,d.style.fontWeight=m),u&&(u.style.fontSize=h,u.style.fontWeight=m)}this.updateProgressCircleSize(i,s)}updateProgressCircleSize(t,n){if(!this.progressContainer)return;let a=this.progressContainer.querySelector(".pomodoro-view__progress-svg");if(!a)return;let i=Math.min(t*.8,n*.4),s;if(t<=200?s=Math.max(120,Math.min(i,t-40)):t<=250?s=Math.max(150,Math.min(i,t-50)):t<=300?s=Math.max(180,Math.min(i,t-60)):t<=350?s=Math.max(200,Math.min(i,t-70)):t<=400?s=Math.max(230,Math.min(i,t-80)):t<=500?s=Math.max(250,Math.min(i,t-100)):t<=600?s=Math.max(280,Math.min(i,300)):s=Math.max(300,Math.min(i,t*.5,400)),s===this.currentCircleSize)return;this.currentCircleSize=s,a.setAttribute("width",s.toString()),a.setAttribute("height",s.toString()),a.setAttribute("viewBox",`0 0 ${s} ${s}`),this.progressContainer.style.width=`${s}px`,this.progressContainer.style.height=`${s}px`;let o=s/2,l=o-20;if(a.querySelectorAll("circle").forEach(d=>{d.setAttribute("cx",o.toString()),d.setAttribute("cy",o.toString()),d.setAttribute("r",l.toString())}),this.progressCircle){let d=2*Math.PI*l;if(this.currentCircumference=d,this.progressCircle.setAttribute("stroke-dasharray",d.toString()),this.progressCircle.setAttribute("stroke-dashoffset",d.toString()),this.plugin.pomodoroService){let u=this.plugin.pomodoroService.getState();this.updateProgress(u)}}}async openTaskSelector(){if(!this.isTaskSelectorOpen){this.isTaskSelectorOpen=!0;try{let t=Jmt(this.plugin),n=new Date;if(t.length===0){new np.Notice(this.t("views.pomodoro.notices.noTasks")),this.isTaskSelectorOpen=!1;return}Fn(this.plugin,t,a=>{this.isTaskSelectorOpen=!1,this.selectTask(a)},{targetDate:n})}catch(t){this.isTaskSelectorOpen=!1,GD.error("Error opening task selector:",{category:"persistence",operation:"opening-task-selector",error:t}),new np.Notice(this.t("views.pomodoro.notices.loadFailed"))}}}async selectTask(t){this.currentSelectedTask=t,this.taskSelectButton&&(t?(this.taskSelectButton.textContent=this.t("views.pomodoro.buttons.changeTask"),(0,np.setTooltip)(this.taskSelectButton,this.t("views.pomodoro.buttons.selectDifferentTask"),{placement:"top"}),this.taskSelectButton.removeClass("pomodoro-view__task-select-button--no-task")):(this.taskSelectButton.textContent=this.t("views.pomodoro.buttons.chooseTask"),this.taskSelectButton.removeAttribute("title"),this.taskSelectButton.addClass("pomodoro-view__task-select-button--no-task"))),this.taskClearButton&&(t?this.taskClearButton.removeClass("pomodoro-view__task-clear-button--hidden"):this.taskClearButton.addClass("pomodoro-view__task-clear-button--hidden")),this.updateTaskCardDisplay(t),await this.plugin.pomodoroService.saveLastSelectedTask(t==null?void 0:t.path);let n=this.plugin.pomodoroService.getState();n.currentSession&&n.currentSession.type==="work"&&await this.plugin.pomodoroService.assignTaskToCurrentSession(t||void 0)}updateTaskCardDisplay(t){if(this.taskCardContainer)if(this.taskCardContainer.empty(),t){let n=this.plugin.settings.defaultVisibleProperties?$i(this.plugin.settings.defaultVisibleProperties,this.plugin):void 0,a=new Date,i=oN(t,a,this.plugin.statusManager,this.plugin.settings.defaultTaskStatus),s=Dr(i,this.plugin,n,{targetDate:a});this.taskCardContainer.appendChild(s),this.taskCardContainer.removeClass("pomodoro-view__task-card-container--empty")}else this.taskCardContainer.addClass("pomodoro-view__task-card-container--empty")}async restoreLastSelectedTask(){try{if(!this.plugin.pomodoroService)return;let t=await this.plugin.pomodoroService.getLastSelectedTaskPath();if(t){let n=await this.plugin.cacheManager.getTaskByPath(t);n&&!cg(n,new Date,this.plugin.statusManager,this.plugin.settings.defaultTaskStatus)&&!n.archived&&await this.selectTask(n)}}catch(t){GD.error("Error restoring last selected task:",{category:"persistence",operation:"restoring-last-selected-task",error:t})}}async updateTaskButtonFromPath(t){try{let n=await this.plugin.cacheManager.getTaskInfo(t);if(n){this.currentSelectedTask=n,this.taskSelectButton&&(this.taskSelectButton.textContent=this.t("views.pomodoro.buttons.changeTask"),(0,np.setTooltip)(this.taskSelectButton,this.t("views.pomodoro.buttons.selectDifferentTask"),{placement:"top"}),this.taskSelectButton.removeClass("pomodoro-no-task"),this.taskSelectButton.removeClass("pomodoro-view__task-select-button--no-task")),this.taskClearButton&&this.taskClearButton.removeClass("pomodoro-view__task-clear-button--hidden"),this.updateTaskCardDisplay(n);return}this.currentSelectedTask=null,this.taskSelectButton&&(this.taskSelectButton.textContent=this.t("views.pomodoro.buttons.chooseTask"),this.taskSelectButton.removeAttribute("title"),this.taskSelectButton.addClass("pomodoro-view__task-select-button--no-task")),this.taskClearButton&&this.taskClearButton.addClass("pomodoro-view__task-clear-button--hidden"),this.updateTaskCardDisplay(null)}catch(n){GD.error("Error updating task button from path:",{category:"persistence",operation:"updating-task-button-path",error:n})}}updateDisplay(t,n,a={}){var s,o;if(!this.plugin.pomodoroService){this.statusDisplay&&(this.statusDisplay.textContent=this.t("views.pomodoro.status.ready"),this.statusDisplay.className="pomodoro-status pomodoro-view__status");return}let i=this.plugin.pomodoroService.getState();if(this.updateTimer(i.timeRemaining),this.updateProgress(i),this.updateSessionMeta(i),this.statusDisplay)if(i.isRunning&&i.currentSession){let l=i.currentSession.type==="work"?this.t("views.pomodoro.status.focus"):i.currentSession.type==="short-break"?this.t("views.pomodoro.status.shortBreak"):this.t("views.pomodoro.status.longBreak");this.statusDisplay.textContent=l,this.statusDisplay.className=`pomodoro-status pomodoro-view__status pomodoro-status-${i.currentSession.type} pomodoro-view__status--${i.currentSession.type}`}else i.currentSession&&!i.isRunning?(this.statusDisplay.textContent=this.t("views.pomodoro.status.paused"),this.statusDisplay.className="pomodoro-status pomodoro-view__status pomodoro-status-paused pomodoro-view__status--paused"):(this.statusDisplay.textContent=this.t("views.pomodoro.status.ready"),this.statusDisplay.className="pomodoro-status pomodoro-view__status");if(this.taskDisplay){let l=(s=i.currentSession)==null?void 0:s.taskPath,c=this.taskDisplay.dataset.currentTaskPath;l!==c&&(this.taskDisplay.empty(),this.taskDisplay.dataset.currentTaskPath=l||"")}if(this.taskSelectButton&&(o=i.currentSession)!=null&&o.taskPath&&!this.currentSelectedTask&&this.updateTaskButtonFromPath(i.currentSession.taskPath),this.startButton&&this.pauseButton&&this.stopButton&&(i.isRunning?(this.startButton.addClass("pomodoro-view__start-button--hidden"),this.pauseButton.removeClass("pomodoro-view__pause-button--hidden"),this.stopButton.removeClass("pomodoro-view__stop-button--hidden")):i.currentSession?(this.startButton.removeClass("pomodoro-view__start-button--hidden"),this.startButton.textContent=this.t("views.pomodoro.buttons.resume"),this.pauseButton.addClass("pomodoro-view__pause-button--hidden"),this.stopButton.removeClass("pomodoro-view__stop-button--hidden")):(this.startButton.removeClass("pomodoro-view__start-button--hidden"),i.nextSessionType==="short-break"?this.startButton.textContent=this.t("views.pomodoro.buttons.startShortBreak"):i.nextSessionType==="long-break"?this.startButton.textContent=this.t("views.pomodoro.buttons.startLongBreak"):this.startButton.textContent=this.t("views.pomodoro.buttons.startFocus"),this.pauseButton.addClass("pomodoro-view__pause-button--hidden"),this.stopButton.addClass("pomodoro-view__stop-button--hidden"))),this.skipBreakButton){let l=i.currentSession&&(i.currentSession.type==="short-break"||i.currentSession.type==="long-break"),c=!i.currentSession&&(i.nextSessionType==="short-break"||i.nextSessionType==="long-break");l||c?(this.skipBreakButton.removeClass("pomodoro-view__skip-break-button--hidden"),this.skipBreakButton.textContent=this.t("views.pomodoro.buttons.skipBreak")):this.skipBreakButton.addClass("pomodoro-view__skip-break-button--hidden")}this.addTimeButton&&this.subtractTimeButton&&(this.addTimeButton.removeClass("pomodoro-view__time-adjust-button--hidden"),this.subtractTimeButton.removeClass("pomodoro-view__time-adjust-button--hidden")),this.timerDisplay&&(this.canEditTimer()?(this.timerDisplay.addClass("pomodoro-view__timer-display--editable"),this.timerDisplay.setAttribute("aria-disabled","false")):(this.timerDisplay.removeClass("pomodoro-view__timer-display--editable"),this.timerDisplay.setAttribute("aria-disabled","true"))),a.refreshStats&&this.refreshStats()}updateSessionMeta(t){if(!this.sessionMetaDisplay)return;let n=Xb(t.timeRemaining,{padMinutes:!1}),a;if(t.currentSession){let i=this.getSessionTypeLabel(t.currentSession.type);if(t.isRunning){let s=em(new Date(J0e(t.timeRemaining)),this.plugin.settings.calendarViewSettings.timeFormat);a=this.t("views.pomodoro.meta.running",{time:n,endTime:s})}else a=this.t("views.pomodoro.meta.paused",{type:i,time:n})}else t.nextSessionType==="short-break"||t.nextSessionType==="long-break"?a=this.t("views.pomodoro.meta.breakReady",{type:this.getSessionTypeLabel(t.nextSessionType),time:n}):a=this.t("views.pomodoro.meta.ready",{time:n,count:this.todaysPomodoros});this.sessionMetaDisplay.textContent=a}getSessionTypeLabel(t){return t==="work"?this.t("views.pomodoro.status.focus"):t==="short-break"?this.t("views.pomodoro.status.shortBreak"):this.t("views.pomodoro.status.longBreak")}canEditTimer(){var n;let t=(n=this.plugin.pomodoroService)==null?void 0:n.getState();return!!(t&&!t.isRunning)}beginTimerEdit(){if(!this.timerDisplay||!this.timerInput||!this.plugin.pomodoroService||!this.canEditTimer())return;let t=this.plugin.pomodoroService.getState();this.isEditingTimer=!0,this.timerInput.value=Xb(t.timeRemaining,{padMinutes:!1}),this.timerDisplay.addClass("pomodoro-view__timer-display--hidden"),this.timerInput.removeClass("pomodoro-view__timer-input--hidden"),this.timerInput.focus(),this.timerInput.select()}commitTimerEdit(){var i,s;if(!this.isEditingTimer||!this.timerInput||!this.timerDisplay)return;let t=tMe(this.timerInput.value);if(this.isEditingTimer=!1,this.timerInput.addClass("pomodoro-view__timer-input--hidden"),this.timerDisplay.removeClass("pomodoro-view__timer-display--hidden"),t===null){new np.Notice(this.t("views.pomodoro.notices.invalidDuration"));let o=(i=this.plugin.pomodoroService)==null?void 0:i.getState();o&&this.updateTimer(o.timeRemaining);return}let n=(s=this.plugin.pomodoroService)==null?void 0:s.getState();if(!n)return;n.currentSession?this.plugin.pomodoroService.setCurrentSessionRemainingTime(t):this.plugin.pomodoroService.adjustPreparedTimer(t);let a=this.plugin.pomodoroService.getState();this.updateTimer(a.timeRemaining),this.updateProgress(a),this.updateSessionMeta(a)}cancelTimerEdit(){var n;if(!this.timerInput||!this.timerDisplay)return;this.isEditingTimer=!1,this.timerInput.addClass("pomodoro-view__timer-input--hidden"),this.timerDisplay.removeClass("pomodoro-view__timer-display--hidden");let t=(n=this.plugin.pomodoroService)==null?void 0:n.getState();t&&this.updateTimer(t.timeRemaining)}updateTimer(t){if(this.timerDisplay){if(this.isEditingTimer)return;let n=Math.max(0,Math.floor(t));this.timerDisplay.textContent=Xb(n),n<=60&&n>0?this.timerDisplay.addClass("pomodoro-view__timer-display--warning"):this.timerDisplay.removeClass("pomodoro-view__timer-display--warning")}}updateProgress(t){if(!this.progressCircle)return;let n=this.currentCircumference;if(n===0){let s=this.progressCircle.getAttribute("r"),o=s?parseInt(s):140;n=2*Math.PI*o,this.currentCircumference=n}if(!t.currentSession){this.progressCircle.setAttributeNS(null,"stroke-dashoffset",n.toString()),this.progressCircle.removeClass("pomodoro-view__progress-circle--work"),this.progressCircle.removeClass("pomodoro-view__progress-circle--short-break"),this.progressCircle.removeClass("pomodoro-view__progress-circle--long-break"),this.progressCircle.removeClass("pomodoro-view__progress-circle--warning");return}let a=t.isRunning?Q0e(t.currentSession):(()=>{let s=Jb(t.currentSession),o=t.currentSession.plannedDuration*60;return o>0?Math.max(0,Math.min(1,s/o)):0})(),i=n-a*n;this.progressCircle.setAttributeNS(null,"stroke-dashoffset",i.toString()),this.progressCircle.removeClass("pomodoro-view__progress-circle--work"),this.progressCircle.removeClass("pomodoro-view__progress-circle--short-break"),this.progressCircle.removeClass("pomodoro-view__progress-circle--long-break"),this.progressCircle.addClass(`pomodoro-view__progress-circle--${t.currentSession.type}`),t.timeRemaining<=60&&t.timeRemaining>0?this.progressCircle.addClass("pomodoro-view__progress-circle--warning"):this.progressCircle.removeClass("pomodoro-view__progress-circle--warning")}async updateStats(){try{if(!this.plugin.pomodoroService){this.statElements.pomodoros&&(this.statElements.pomodoros.textContent="0");return}let t=await this.plugin.pomodoroService.getTodayStats();this.todaysPomodoros=t.pomodorosCompleted,this.statElements.pomodoros&&this.statElements.pomodoros.textContent!==t.pomodorosCompleted.toString()&&(this.statElements.pomodoros.textContent=t.pomodorosCompleted.toString()),this.updateSessionMeta(this.plugin.pomodoroService.getState())}catch(t){GD.error("Failed to update stats:",{category:"validation",operation:"update-stats",error:t}),this.statElements.pomodoros&&(this.statElements.pomodoros.textContent="0")}}adjustSessionTime(t){if(!this.plugin.pomodoroService)return;let n=this.plugin.pomodoroService.getState();if(n.currentSession)this.plugin.pomodoroService.adjustSessionTime(t);else{let a=Math.max(60,n.timeRemaining+t);this.plugin.pomodoroService.adjustPreparedTimer(a)}if(this.plugin.pomodoroService){let a=this.plugin.pomodoroService.getState();this.updateTimer(a.timeRemaining),this.updateProgress(a),this.updateSessionMeta(a)}}onPomodoroComplete(t,n){if(this.updateDisplay(void 0,void 0,{refreshStats:!0}),this.statusDisplay)if(t.type==="work"){let a=n==="long-break",i=this.t(a?"views.pomodoro.status.breakLength.long":"views.pomodoro.status.breakLength.short");this.statusDisplay.textContent=this.t("views.pomodoro.status.breakPrompt",{length:i})}else this.statusDisplay.textContent=this.t("views.pomodoro.status.breakComplete")}}});function mO(r){if(r.activePeriods&&Array.isArray(r.activePeriods))return r.activePeriods.filter(e=>e.endTime).reduce((e,t)=>{let n=new Date(t.startTime),i=new Date(t.endTime).getTime()-n.getTime();return e+Math.round(i/(1e3*60))},0);if(r.duration!==void 0)return r.duration;if(r.startTime&&r.endTime){let e=new Date(r.startTime),n=new Date(r.endTime).getTime()-e.getTime();return Math.round(n/(1e3*60))}return 0}var k6=y(()=>{});function KD(r){return[...r].sort((e,t)=>new Date(e.startTime).getTime()-new Date(t.startTime).getTime())}function Xmt(r){var n;let e=(n=r.match(/^(\d{4}-\d{2}-\d{2})(?:[T\s]|$)/))==null?void 0:n[1];if(e)return e;let t=new Date(r);return isNaN(t.getTime())?"":ce(t)}function eT(r){return Xmt(r.startTime)}function cMe(r,e){return e?r.filter(t=>eT(t)===e):[]}function dMe(r,e,t){let n=ce(e),a=ce(t);if(!n||!a)return[];let[i,s]=n<=a?[n,a]:[a,n];return r.filter(o=>{let l=eT(o);return l>=i&&l<=s})}function uMe(r,e){let t=ce(r),n=ce(e);if(!t||!n)return[];let[a,i]=t<=n?[t,n]:[n,t],[s,o,l]=a.split("-").map(Number),[c,d,u]=i.split("-").map(Number),p=new Date(Date.UTC(s,o-1,l)),m=new Date(Date.UTC(c,d-1,u)),f=[];for(;p<=m;)f.push(ce(p)),p.setUTCDate(p.getUTCDate()+1);return f}function tT(r){let e=KD(r).filter(o=>o.type==="work"),t=e.filter(o=>o.completed),n=0;for(let o=e.length-1;o>=0&&e[o].completed;o--)n++;let a=t.reduce((o,l)=>o+mO(l),0),i=t.length>0?a/t.length:0,s=e.length>0?t.length/e.length*100:0;return{pomodorosCompleted:t.length,currentStreak:n,totalMinutes:a,averageSessionLength:Math.round(i),completionRate:Math.round(s)}}var b6=y(()=>{Me();k6()});function tft(r){return Number.isInteger(r)&&r>=0&&r<=6}var ka,eft,fO,pMe=y(()=>{ka=require("obsidian");Wr();Yr();ro();Me();k6();b6();K();eft=N({tag:"Views/PomodoroStatsView"});fO=class extends ka.ItemView{constructor(t,n){super(t);this.overviewStatsEl=null;this.todayStatsEl=null;this.weekStatsEl=null;this.recentSessionsEl=null;this.overallStatsEl=null;this.plugin=n}getViewType(){return Pv}getDisplayText(){return this.plugin.i18n.translate("views.pomodoroStats.title")}getIcon(){return"bar-chart"}t(t,n){return this.plugin.i18n.translate(t,n)}async onOpen(){await this.plugin.onReady(),await this.waitForPomodoroService(),await this.render()}async onClose(){this.contentEl.empty()}async render(){this.contentEl.empty();let t=this.contentEl.createDiv({cls:"tasknotes-plugin tasknotes-container pomodoro-stats-container pomodoro-stats-view"}),n=t.createDiv({cls:"pomodoro-stats-header pomodoro-stats-view__header"});new ka.Setting(n).setName(this.t("views.pomodoroStats.heading")).setHeading();let a=n.createDiv({cls:"pomodoro-stats-view__header-actions"});this.renderBasesMigrationHelp(a);let i=a.createEl("button",{cls:"pomodoro-stats-refresh-button pomodoro-stats-view__refresh-button",text:this.t("views.pomodoroStats.refresh")});this.registerDomEvent(i,"click",()=>{this.refreshStats()});let s=t.createDiv({cls:"pomodoro-stats-section pomodoro-stats-view__section"});new ka.Setting(s).setName(this.t("views.pomodoroStats.sections.overview")).setHeading(),this.overviewStatsEl=s.createDiv({cls:"pomodoro-overview-grid pomodoro-stats-view__overview-grid"});let o=t.createDiv({cls:"pomodoro-stats-section pomodoro-stats-view__section"});new ka.Setting(o).setName(this.t("views.pomodoroStats.sections.today")).setHeading(),this.todayStatsEl=o.createDiv({cls:"pomodoro-stats-grid pomodoro-stats-view__stats-grid"});let l=t.createDiv({cls:"pomodoro-stats-section pomodoro-stats-view__section"});new ka.Setting(l).setName(this.t("views.pomodoroStats.sections.week")).setHeading(),this.weekStatsEl=l.createDiv({cls:"pomodoro-stats-grid pomodoro-stats-view__stats-grid"});let c=t.createDiv({cls:"pomodoro-stats-section pomodoro-stats-view__section"});new ka.Setting(c).setName(this.t("views.pomodoroStats.sections.allTime")).setHeading(),this.overallStatsEl=c.createDiv({cls:"pomodoro-stats-grid pomodoro-stats-view__stats-grid"});let d=t.createDiv({cls:"pomodoro-stats-section pomodoro-stats-view__section"});new ka.Setting(d).setName(this.t("views.pomodoroStats.sections.recent")).setHeading(),this.recentSessionsEl=d.createDiv({cls:"pomodoro-recent-sessions pomodoro-stats-view__recent-sessions"}),await this.refreshStats()}renderBasesMigrationHelp(t){if(this.plugin.settings.pomodoroStorageLocation==="daily-notes")return;let n=t.createEl("button",{cls:"pomodoro-stats-view__bases-help"}),a=this.t("views.pomodoroStats.basesMigration.title"),i=this.t("views.pomodoroStats.basesMigration.description");(0,ka.setIcon)(n,"help-circle"),n.setAttr("aria-label",`${a}: ${i}`),(0,ka.setTooltip)(n,i,{placement:"bottom"})}async waitForPomodoroService(){let t=Date.now();for(;!this.plugin.pomodoroService&&Date.now()-t<5e3;)await new Promise(n=>window.setTimeout(n,50))}async refreshStats(){try{if(!this.plugin.pomodoroService)return;let t=Er(),n=wn(t),a=new Date(t);a.setDate(a.getDate()-1);let i=wn(a),s=this.plugin.settings.calendarViewSettings.firstDay||0,l={weekStartsOn:tft(s)?s:0},c=Ni(n,l),d=vv(n,l),[u,p,m,f]=await Promise.all([this.plugin.pomodoroService.getTodayStats(),this.plugin.pomodoroService.getStatsForDate(i),this.plugin.pomodoroService.getStatsForDateRange(c,d),this.plugin.pomodoroService.getSessionHistory()]),h=tT(f);this.overviewStatsEl&&this.renderOverviewStats(this.overviewStatsEl,u,h,p),this.todayStatsEl&&this.renderStatsGrid(this.todayStatsEl,u),this.weekStatsEl&&this.renderStatsGrid(this.weekStatsEl,m),this.overallStatsEl&&this.renderStatsGrid(this.overallStatsEl,h),this.recentSessionsEl&&this.renderRecentSessions(this.recentSessionsEl,f)}catch(t){eft.error("Failed to refresh stats:",{category:"stale-data",operation:"refresh-stats",error:t})}}renderRecentSessions(t,n){var i;let a=n.filter(s=>s.type==="work").slice(-10).reverse();if(t.empty(),a.length===0){t.createDiv({cls:"pomodoro-no-sessions pomodoro-stats-view__no-sessions",text:this.t("views.pomodoroStats.recents.empty")});return}for(let s of a){let o=t.createDiv({cls:"pomodoro-session-item pomodoro-stats-view__session-item"});this.registerDomEvent(o,"contextmenu",f=>{f.preventDefault(),this.showSessionContextMenu(f,s)});let l=o.createSpan({cls:"session-date pomodoro-stats-view__session-date"}),c=this.plugin.settings.calendarViewSettings.timeFormat;l.textContent=M(new Date(s.startTime),c==="12"?"MMM d, h:mm a":"MMM d, HH:mm");let d=o.createSpan({cls:"session-duration pomodoro-stats-view__session-duration"}),u=mO(s);d.textContent=this.t("views.pomodoroStats.recents.duration",{minutes:u});let p=o.createSpan({cls:"session-status pomodoro-stats-view__session-status"});if(p.textContent=this.t(s.completed?"views.pomodoroStats.recents.status.completed":"views.pomodoroStats.recents.status.interrupted"),p.addClass(s.completed?"status-completed":"status-interrupted"),p.addClass(s.completed?"pomodoro-stats-view__session-status--completed":"pomodoro-stats-view__session-status--interrupted"),s.taskPath){let f=o.createSpan({cls:"session-task pomodoro-stats-view__session-task"}),h=((i=s.taskPath.split("/").pop())==null?void 0:i.replace(".md",""))||"";f.textContent=h}let m=o.createEl("button",{cls:"pomodoro-stats-view__session-delete-button",attr:{type:"button","aria-label":this.t("views.pomodoroStats.recents.deleteAria")}});(0,ka.setIcon)(m,"trash-2"),(0,ka.setTooltip)(m,this.t("views.pomodoroStats.recents.delete"),{placement:"top"}),this.registerDomEvent(m,"click",f=>{f.preventDefault(),f.stopPropagation(),this.confirmDeleteSession(s)})}}showSessionContextMenu(t,n){let a=new ka.Menu;a.addItem(i=>{i.setTitle(this.t("views.pomodoroStats.recents.delete")),i.setIcon("trash"),i.onClick(()=>{this.confirmDeleteSession(n)})}),a.showAtMouseEvent(t)}async confirmDeleteSession(t){if(!await Ir(this.plugin.app,{title:this.t("views.pomodoroStats.recents.deleteConfirmTitle"),message:this.t("views.pomodoroStats.recents.deleteConfirmMessage"),confirmText:this.t("views.pomodoroStats.recents.deleteConfirmButton"),cancelText:this.t("common.cancel"),isDestructive:!0})||!this.plugin.pomodoroService)return;let a=await this.plugin.pomodoroService.deleteSessionFromHistory(t);new ka.Notice(this.t(a?"views.pomodoroStats.recents.deleteSuccess":"views.pomodoroStats.recents.deleteNotFound")),a&&await this.refreshStats()}renderOverviewStats(t,n,a,i){t.empty();let s=v=>{if(v<60)return`${v}m`;let b=Math.floor(v/60),k=v%60;return k>0?`${b}h${k}m`:`${b}h`},o=n.pomodorosCompleted-i.pomodorosCompleted,l=n.totalMinutes-i.totalMinutes,c=t.createDiv({cls:"pomodoro-overview-card pomodoro-stats-view__overview-card"}),d=c.createDiv({cls:"overview-value pomodoro-stats-view__overview-value"});if(d.textContent=n.pomodorosCompleted.toString(),c.createDiv({cls:"overview-label pomodoro-stats-view__overview-label",text:this.t("views.pomodoroStats.overviewCards.todayPomos.label")}),o!==0){let v=c.createDiv({cls:"overview-change pomodoro-stats-view__overview-change"});v.textContent=o>0?this.t("views.pomodoroStats.overviewCards.todayPomos.change.more",{count:o}):this.t("views.pomodoroStats.overviewCards.todayPomos.change.less",{count:Math.abs(o)}),v.addClass(o>0?"positive":"negative")}let u=t.createDiv({cls:"pomodoro-overview-card pomodoro-stats-view__overview-card"}),p=u.createDiv({cls:"overview-value pomodoro-stats-view__overview-value"});p.textContent=a.pomodorosCompleted.toString(),u.createDiv({cls:"overview-label pomodoro-stats-view__overview-label",text:this.t("views.pomodoroStats.overviewCards.totalPomos.label")});let m=t.createDiv({cls:"pomodoro-overview-card pomodoro-stats-view__overview-card"}),f=m.createDiv({cls:"overview-value pomodoro-stats-view__overview-value"});if(f.textContent=s(n.totalMinutes),m.createDiv({cls:"overview-label pomodoro-stats-view__overview-label",text:this.t("views.pomodoroStats.overviewCards.todayFocus.label")}),l!==0){let v=m.createDiv({cls:"overview-change pomodoro-stats-view__overview-change"});v.textContent=l>0?this.t("views.pomodoroStats.overviewCards.todayFocus.change.more",{duration:s(Math.abs(l))}):this.t("views.pomodoroStats.overviewCards.todayFocus.change.less",{duration:s(Math.abs(l))}),v.addClass(l>0?"positive":"negative")}let h=t.createDiv({cls:"pomodoro-overview-card pomodoro-stats-view__overview-card"}),g=h.createDiv({cls:"overview-value pomodoro-stats-view__overview-value"});g.textContent=s(a.totalMinutes),h.createDiv({cls:"overview-label pomodoro-stats-view__overview-label",text:this.t("views.pomodoroStats.overviewCards.totalFocus.label")})}renderStatsGrid(t,n){t.empty();let a=t.createDiv({cls:"pomodoro-stat-card pomodoro-stats-view__stat-card"});a.createDiv({cls:"stat-value pomodoro-stats-view__stat-value",text:n.pomodorosCompleted.toString()}),a.createDiv({cls:"stat-label pomodoro-stats-view__stat-label",text:this.t("views.pomodoroStats.stats.pomodoros")});let i=t.createDiv({cls:"pomodoro-stat-card pomodoro-stats-view__stat-card"});i.createDiv({cls:"stat-value pomodoro-stats-view__stat-value",text:n.currentStreak.toString()}),i.createDiv({cls:"stat-label pomodoro-stats-view__stat-label",text:this.t("views.pomodoroStats.stats.streak")});let s=t.createDiv({cls:"pomodoro-stat-card pomodoro-stats-view__stat-card"});s.createDiv({cls:"stat-value pomodoro-stats-view__stat-value",text:n.totalMinutes.toString()}),s.createDiv({cls:"stat-label pomodoro-stats-view__stat-label",text:this.t("views.pomodoroStats.stats.minutes")});let o=t.createDiv({cls:"pomodoro-stat-card pomodoro-stats-view__stat-card"});o.createDiv({cls:"stat-value pomodoro-stats-view__stat-value",text:n.averageSessionLength.toString()}),o.createDiv({cls:"stat-label pomodoro-stats-view__stat-label",text:this.t("views.pomodoroStats.stats.average")});let l=t.createDiv({cls:"pomodoro-stat-card pomodoro-stats-view__stat-card"});l.createDiv({cls:"stat-value pomodoro-stats-view__stat-value",text:`${n.completionRate}%`}),l.createDiv({cls:"stat-label pomodoro-stats-view__stat-label",text:this.t("views.pomodoroStats.stats.completion")})}}});function rft(r){return Number.isInteger(r)&&r>=0&&r<=6}function rT(){return{dateRange:"all",selectedProjects:[],minTimeSpent:0}}function aft(r){return typeof r=="string"&&nft.has(r)}function fMe(r){return typeof r=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(r)}function ift(r){if(!r||typeof r!="object")return rT();let e=r,t=rT();aft(e.dateRange)&&(t.dateRange=e.dateRange),fMe(e.customStartDate)&&(t.customStartDate=e.customStartDate),fMe(e.customEndDate)&&(t.customEndDate=e.customEndDate),Array.isArray(e.selectedProjects)&&(t.selectedProjects=e.selectedProjects.filter(a=>typeof a=="string"));let n=typeof e.minTimeSpent=="number"?e.minTimeSpent:Number(e.minTimeSpent);return Number.isFinite(n)&&n>0&&(t.minTimeSpent=Math.floor(n)),t}function sft(r){return r.filter(e=>!e.archived)}function oft(r,e){if(!Array.isArray(r))return[e.noProjectLabel];let t=Rl(r);return t.length===0?[e.noProjectLabel]:t.filter(n=>{var a;return!((a=e.isArchivedProjectReference)!=null&&a.call(e,n))}).map(n=>e.consolidateProjectName(n)).filter(n=>typeof n=="string"&&n.length>0)}var rl,ZD,mMe,nft,hO,hMe=y(()=>{rl=require("obsidian");Wr();Yr();Ct();Me();mi();$c();qn();K();ZD=N({tag:"Views/StatsView"});mMe="tasknotes-stats-view-filters",nft=new Set(["all","7days","30days","90days","custom"]);hO=class extends rl.ItemView{constructor(t,n){super(t);this.overviewStatsEl=null;this.todayStatsEl=null;this.weekStatsEl=null;this.monthStatsEl=null;this.projectsStatsEl=null;this.filtersEl=null;this.currentFilters=rT();this.drilldownModal=null;this.currentDrilldownData=null;this.listeners=[];this.statsCache=new Map;this.lastCacheTime=0;this.CACHE_DURATION=6e4;this.debounceTimeout=null;this.plugin=n}getViewType(){return Mv}getDisplayText(){return this.plugin.i18n.translate("views.stats.title")}getIcon(){return"bar-chart-4"}async onOpen(){await this.plugin.onReady(),this.currentFilters=this.loadPersistedFilters();let t=this.plugin.emitter.on(ot,async({path:n,originalTask:a,updatedTask:i})=>{if(!n||!i||!this.drilldownModal||!this.currentDrilldownData)return;this.currentDrilldownData.tasks.some(o=>o.path===n||a&&o.path===a.path)&&await this.refreshDrilldownModal()});this.listeners.push(t),await this.render()}async onClose(){this.contentEl.empty(),this.listeners.forEach(t=>this.plugin.emitter.offref(t)),this.listeners=[]}loadPersistedFilters(){try{let t=this.plugin.app.loadLocalStorage(mMe);return typeof t!="string"||t.length===0?rT():ift(JSON.parse(t))}catch(t){return ZD.warn("[TaskNotes] Failed to load Stats view filters:",{category:"persistence",operation:"load-stats-view-filters",error:t}),rT()}}savePersistedFilters(){try{this.plugin.app.saveLocalStorage(mMe,JSON.stringify(this.currentFilters))}catch(t){ZD.warn("[TaskNotes] Failed to save Stats view filters:",{category:"persistence",operation:"save-stats-view-filters",error:t})}}async render(){let t=this.contentEl.createDiv({cls:"tasknotes-plugin tasknotes-container stats-container stats-view"}),n=t.createDiv({cls:"stats-header stats-view__header"});new rl.Setting(n).setName(this.plugin.i18n.translate("views.stats.taskProjectStats")).setHeading();let a=n.createEl("button",{cls:"stats-refresh-button stats-view__refresh-button",text:this.plugin.i18n.translate("views.stats.refreshButton")});this.registerDomEvent(a,"click",()=>{this.refreshStats()});let i=t.createDiv({cls:"stats-section stats-view__section"});new rl.Setting(i).setName(this.plugin.i18n.translate("views.stats.sections.filters")).setHeading(),this.filtersEl=i.createDiv({cls:"stats-filters stats-view__filters"}),this.renderFilters();let s=t.createDiv({cls:"stats-section stats-view__section"});new rl.Setting(s).setName(this.plugin.i18n.translate("views.stats.sections.overview")).setHeading(),this.overviewStatsEl=s.createDiv({cls:"stats-overview-grid stats-view__overview-grid"});let o=t.createDiv({cls:"stats-section stats-view__section"});new rl.Setting(o).setName(this.plugin.i18n.translate("views.stats.sections.today")).setHeading(),this.todayStatsEl=o.createDiv({cls:"stats-grid stats-view__stats-grid"});let l=t.createDiv({cls:"stats-section stats-view__section"});new rl.Setting(l).setName(this.plugin.i18n.translate("views.stats.sections.thisWeek")).setHeading(),this.weekStatsEl=l.createDiv({cls:"stats-grid stats-view__stats-grid"});let c=t.createDiv({cls:"stats-section stats-view__section"});new rl.Setting(c).setName(this.plugin.i18n.translate("views.stats.sections.thisMonth")).setHeading(),this.monthStatsEl=c.createDiv({cls:"stats-grid stats-view__stats-grid"});let d=t.createDiv({cls:"stats-section stats-view__section"});new rl.Setting(d).setName(this.plugin.i18n.translate("views.stats.sections.projectBreakdown")).setHeading(),this.projectsStatsEl=d.createDiv({cls:"stats-projects stats-view__projects"}),await this.refreshStats()}async refreshStats(){try{this.clearCache();let t=await Promise.allSettled([this.updateOverviewStats(),this.updateTodayStats(),this.updateWeekStats(),this.updateMonthStats(),this.updateProjectStats()])}catch(t){}}async getAllTasks(){let t=`all-tasks-${JSON.stringify(this.currentFilters)}`;if(this.isCacheValid()&&this.statsCache.has(t)){let i=this.statsCache.get(t);if(i)return i}let n=this.plugin.cacheManager.getAllTaskPaths(),a=[];for(let i of n)try{let s=await this.plugin.cacheManager.getTaskInfo(i);s&&a.push(s)}catch(s){}return a=sft(a),a=this.applyTaskFilters(a),this.statsCache.set(t,a),this.lastCacheTime=Date.now(),a}applyTaskFilters(t){let n=t,a=this.getFilterDateRange();return(a.start||a.end)&&(n=n.filter(i=>{if(i.timeEntries&&i.timeEntries.length>0)return i.timeEntries.some(s=>{if(!s.startTime)return!1;let o=new Date(s.startTime);return!(a.start&&oa.end)});if(i.completedDate){let s=new Date(i.completedDate);return!(a.start&&sa.end)}if(i.dateCreated){let s=new Date(i.dateCreated);return!(a.start&&sa.end)}return!(a.start||a.end)})),this.currentFilters.minTimeSpent>0&&(n=n.filter(i=>Li(i.timeEntries||[])>=this.currentFilters.minTimeSpent)),n}async updateOverviewStats(){if(!this.overviewStatsEl)return;let t=await this.getAllTasks(),n=this.calculateOverallStats(t);this.renderOverviewStats(this.overviewStatsEl,n)}async updateTodayStats(){if(!this.todayStatsEl)return;let t=Er(),n=await this.calculateStatsForRange(Ml(t),aS(t));this.renderTimeRangeStats(this.todayStatsEl,n)}async updateWeekStats(){if(!this.weekStatsEl)return;let t=Er(),n=this.plugin.settings.calendarViewSettings.firstDay||0,i={weekStartsOn:rft(n)?n:0},s=Ni(t,i),o=vv(t,i),l=await this.calculateStatsForRange(s,o);this.renderTimeRangeStats(this.weekStatsEl,l)}async updateMonthStats(){if(!this.monthStatsEl)return;let t=Er(),n=UA(t),a=BA(t),i=await this.calculateStatsForRange(n,a);this.renderTimeRangeStats(this.monthStatsEl,i)}async updateProjectStats(){if(!this.projectsStatsEl)return;let t=await this.getAllTasks(),n=this.calculateProjectStats(t);await this.renderProjectStats(this.projectsStatsEl,n)}consolidateProjectName(t){var a,i;if(!t||typeof t!="string")return t;let n=Fl(t,(a=this.plugin)==null?void 0:a.app);if(n&&n!==t)return n;if(t.startsWith("[[")&&t.endsWith("]]")){let s=this.extractWikilinkPath(t);if(s&&((i=this.plugin)!=null&&i.app)){let o=this.plugin.app.metadataCache.getFirstLinkpathDest(s,"");if(o)return o.basename;let l=this.extractProjectName(t);if(l)return l}}if(t.includes("|")){let s=t.split("|");return s[s.length-1]||t}if(t.includes("/")){let s=t.split("/");return s[s.length-1]||t}return t}extractWikilinkPath(t){if(!t||typeof t!="string"||!t.startsWith("[[")||!t.endsWith("]]"))return null;let n=t.slice(2,-2);return(0,rl.parseLinktext)(n).path}extractProjectName(t){var a;return t&&Fl(t,(a=this.plugin)==null?void 0:a.app)||null}isArchivedProjectReference(t){var n;return((n=this.getProjectReferenceTask(t))==null?void 0:n.archived)===!0}getProjectReferenceTask(t){let n=t.trim();if(!this.isProjectNoteReference(n))return null;let a=Et(n);if(!a)return null;let i=a.replace(/\.md$/i,""),s=this.plugin.app.metadataCache.getFirstLinkpathDest(i,"");if(s){let l=this.plugin.cacheManager.getCachedTaskInfoSync(s.path);if(l)return l}let o=/\.md$/i.test(a)?[a]:[a,`${a}.md`];for(let l of o){let c=this.plugin.cacheManager.getCachedTaskInfoSync(l);if(c)return c}return null}isProjectNoteReference(t){return t.startsWith("[[")&&t.endsWith("]]")||/^\[[^\]]*\]\(.+\)$/.test(t)||t.startsWith("<")&&t.endsWith(">")||t.includes("/")||/\.md$/i.test(t)}calculateOverallStats(t){let n=0,a=0,i=0,s=new Set;for(let o of t){n+=Li(o.timeEntries||[]),a+=o.timeEstimate||0,this.plugin.statusManager.isCompletedStatus(o.status)&&i++;let l=this.getTaskProjects(o);for(let c of l)s.add(c)}return{totalTimeSpent:n,totalTimeEstimate:a,totalTasks:t.length,completedTasks:i,activeProjects:s.size,completionRate:t.length>0?i/t.length*100:0,avgTimePerTask:t.length>0?n/t.length:0}}async calculateStatsForRange(t,n){let i=(await this.getAllTasks()).filter(l=>{if(l.timeEntries&&l.timeEntries.length>0)return l.timeEntries.some(c=>{if(!c.startTime)return!1;let d=new Date(c.startTime);return d>=t&&d<=n});if(l.completedDate){let c=new Date(l.completedDate);return c>=t&&c<=n}if(l.dateCreated){let c=new Date(l.dateCreated);return c>=t&&c<=n}return!1}),s=this.calculateOverallStats(i),o=this.calculateProjectStats(i);return{overall:s,projects:o}}calculateProjectStats(t){let n=new Map;for(let s of t){let o=Li(s.timeEntries||[]),l=s.timeEstimate||0,c=this.plugin.statusManager.isCompletedStatus(s.status),d;s.timeEntries&&s.timeEntries.length>0?d=[...s.timeEntries].sort((m,f)=>new Date(f.startTime).getTime()-new Date(m.startTime).getTime())[0].startTime:s.completedDate?d=s.completedDate:s.dateModified&&(d=s.dateModified);let u=this.getTaskProjects(s);for(let p of u){n.has(p)||n.set(p,{tasks:[],totalTime:0,totalTimeEstimate:0,completedCount:0,lastActivity:void 0});let m=n.get(p);m&&(m.tasks.push(s),m.totalTime+=o,m.totalTimeEstimate+=l,c&&m.completedCount++,d&&(!m.lastActivity||new Date(d)>new Date(m.lastActivity))&&(m.lastActivity=d))}}let a=[];for(let[s,o]of n.entries())a.push({projectName:s,totalTimeSpent:o.totalTime,totalTimeEstimate:o.totalTimeEstimate,taskCount:o.tasks.length,completedTaskCount:o.completedCount,avgTimePerTask:o.tasks.length>0?o.totalTime/o.tasks.length:0,lastActivity:o.lastActivity});let i=this.plugin.i18n.translate("views.stats.noProject");return a.sort((s,o)=>s.projectName===i?1:o.projectName===i?-1:o.totalTimeSpent-s.totalTimeSpent),a}renderFilters(){if(!this.filtersEl)return;this.filtersEl.empty();let t=this.filtersEl.createDiv({cls:"stats-view__filter-grid"}),n=t.createDiv({cls:"stats-view__filter-item"}),a=n.createDiv({cls:"stats-view__filter-label"});a.textContent=this.plugin.i18n.translate("views.stats.sections.dateRange");let i=n.createEl("select",{cls:"stats-view__filter-select"}),s=[{value:"all",text:this.plugin.i18n.translate("views.stats.timeRanges.allTime")},{value:"7days",text:this.plugin.i18n.translate("views.stats.timeRanges.last7Days")},{value:"30days",text:this.plugin.i18n.translate("views.stats.timeRanges.last30Days")},{value:"90days",text:this.plugin.i18n.translate("views.stats.timeRanges.last90Days")},{value:"custom",text:this.plugin.i18n.translate("views.stats.timeRanges.customRange")}];for(let m of s){let f=i.createEl("option",{value:m.value,text:m.text});m.value===this.currentFilters.dateRange&&(f.selected=!0)}this.registerDomEvent(i,"change",()=>{this.currentFilters.dateRange=i.value,this.renderCustomDateInputs(),this.applyFilters()});let o=t.createDiv({cls:"stats-view__custom-dates"});this.currentFilters.dateRange==="custom"&&this.renderCustomDateInputs(o);let l=t.createDiv({cls:"stats-view__filter-item"}),c=l.createDiv({cls:"stats-view__filter-label"});c.textContent=this.plugin.i18n.translate("views.stats.filters.minTime");let d=l.createEl("input",{cls:"stats-view__filter-input",type:"number",value:this.currentFilters.minTimeSpent.toString(),placeholder:"0"});this.registerDomEvent(d,"input",()=>{this.currentFilters.minTimeSpent=parseInt(d.value)||0,this.applyFilters()});let p=t.createDiv({cls:"stats-view__filter-buttons"}).createEl("button",{cls:"stats-view__filter-button stats-view__filter-button--reset",text:this.plugin.i18n.translate("views.stats.resetFiltersButton")});this.registerDomEvent(p,"click",()=>{this.currentFilters=rT(),this.renderFilters(),this.applyFilters()})}renderCustomDateInputs(t){var a;let n=t||((a=this.filtersEl)==null?void 0:a.querySelector(".stats-view__custom-dates"));if(n&&(n.empty(),this.currentFilters.dateRange==="custom")){let i=n.createDiv({cls:"stats-view__date-input-container"});i.createDiv({cls:"stats-view__date-label",text:this.plugin.i18n.translate("views.stats.dateRangeFrom")});let s=i.createEl("input",{cls:"stats-view__date-input",type:"date",value:this.currentFilters.customStartDate||""}),o=n.createDiv({cls:"stats-view__date-input-container"});o.createDiv({cls:"stats-view__date-label",text:this.plugin.i18n.translate("views.stats.dateRangeTo")});let l=o.createEl("input",{cls:"stats-view__date-input",type:"date",value:this.currentFilters.customEndDate||""});this.registerDomEvent(s,"change",()=>{this.currentFilters.customStartDate=s.value,this.applyFilters()}),this.registerDomEvent(l,"change",()=>{this.currentFilters.customEndDate=l.value,this.applyFilters()})}}async applyFilters(){this.savePersistedFilters(),this.debounceTimeout&&window.clearTimeout(this.debounceTimeout),this.debounceTimeout=window.setTimeout(()=>{(async()=>(await this.refreshStats(),this.debounceTimeout=null))()},300)}isCacheValid(){return Date.now()-this.lastCacheTimethis.consolidateProjectName(n),isArchivedProjectReference:n=>this.isArchivedProjectReference(n)})}catch(n){return[this.plugin.i18n.translate("views.stats.noProject")]}}getFilterDateRange(){let t=Er();switch(this.currentFilters.dateRange){case"7days":return{start:Ml(wv(t,7)),end:aS(t)};case"30days":return{start:Ml(wv(t,30)),end:aS(t)};case"90days":return{start:Ml(wv(t,90)),end:aS(t)};case"custom":return{start:this.currentFilters.customStartDate?new Date(`${this.currentFilters.customStartDate}T00:00:00`):void 0,end:this.currentFilters.customEndDate?new Date(`${this.currentFilters.customEndDate}T23:59:59.999`):void 0};case"all":default:return{}}}renderOverviewStats(t,n){t.empty();let a=h=>{if(h<60)return`${Math.round(h)}m`;let g=Math.floor(h/60),v=Math.round(h%60);return v>0?`${g}h ${v}m`:`${g}h`},i=t.createDiv({cls:"stats-overview-card stats-view__overview-card"}),s=i.createDiv({cls:"overview-value stats-view__overview-value"});s.textContent=`${a(n.totalTimeSpent)} / ${a(n.totalTimeEstimate)}`,i.createDiv({cls:"overview-label stats-view__overview-label",text:this.plugin.i18n.translate("views.stats.cards.timeTrackedEstimated")});let o=t.createDiv({cls:"stats-overview-card stats-view__overview-card"}),l=o.createDiv({cls:"overview-value stats-view__overview-value"});l.textContent=n.totalTasks.toString(),o.createDiv({cls:"overview-label stats-view__overview-label",text:this.plugin.i18n.translate("views.stats.cards.totalTasks")});let c=t.createDiv({cls:"stats-overview-card stats-view__overview-card"}),d=c.createDiv({cls:"overview-value stats-view__overview-value"});d.textContent=`${Math.round(n.completionRate)}%`,c.createDiv({cls:"overview-label stats-view__overview-label",text:this.plugin.i18n.translate("views.stats.cards.completionRate")});let u=t.createDiv({cls:"stats-overview-card stats-view__overview-card"}),p=u.createDiv({cls:"overview-value stats-view__overview-value"});p.textContent=n.activeProjects.toString(),u.createDiv({cls:"overview-label stats-view__overview-label",text:this.plugin.i18n.translate("views.stats.cards.activeProjects")});let m=t.createDiv({cls:"stats-overview-card stats-view__overview-card"}),f=m.createDiv({cls:"overview-value stats-view__overview-value"});f.textContent=a(n.avgTimePerTask),m.createDiv({cls:"overview-label stats-view__overview-label",text:this.plugin.i18n.translate("views.stats.cards.avgTimePerTask")})}renderTimeRangeStats(t,n){t.empty();let a=c=>{if(c<60)return`${Math.round(c)}m`;let d=Math.floor(c/60),u=Math.round(c%60);return u>0?`${d}h ${u}m`:`${d}h`},i=t.createDiv({cls:"stats-stat-card stats-view__stat-card"});i.createDiv({cls:"stat-value stats-view__stat-value",text:`${a(n.overall.totalTimeSpent)} / ${a(n.overall.totalTimeEstimate)}`}),i.createDiv({cls:"stat-label stats-view__stat-label",text:this.plugin.i18n.translate("views.stats.cards.timeTrackedEstimated")});let s=t.createDiv({cls:"stats-stat-card stats-view__stat-card"});s.createDiv({cls:"stat-value stats-view__stat-value",text:n.overall.totalTasks.toString()}),s.createDiv({cls:"stat-label stats-view__stat-label",text:this.plugin.i18n.translate("views.stats.labels.tasks")});let o=t.createDiv({cls:"stats-stat-card stats-view__stat-card"});o.createDiv({cls:"stat-value stats-view__stat-value",text:n.overall.completedTasks.toString()}),o.createDiv({cls:"stat-label stats-view__stat-label",text:this.plugin.i18n.translate("views.stats.labels.completed")});let l=t.createDiv({cls:"stats-stat-card stats-view__stat-card"});l.createDiv({cls:"stat-value stats-view__stat-value",text:n.overall.activeProjects.toString()}),l.createDiv({cls:"stat-label stats-view__stat-label",text:this.plugin.i18n.translate("views.stats.labels.projects")})}async renderProjectStats(t,n){if(t.empty(),n.length===0){t.createDiv({cls:"stats-no-data stats-view__no-data",text:this.plugin.i18n.translate("views.stats.noProjectData")});return}let a=s=>{if(s<60)return`${Math.round(s)}m`;let o=Math.floor(s/60),l=Math.round(s%60);return l>0?`${o}h ${l}m`:`${o}h`},i=s=>{if(!s)return this.plugin.i18n.translate("views.stats.notAvailable");try{let o=new Date(s);return M(o,"MMM d, yyyy")}catch(o){return this.plugin.i18n.translate("views.stats.notAvailable")}};for(let s of n){let o=["stats-project-item","stats-view__project-item","stats-view__project-item--clickable"];s.projectName===this.plugin.i18n.translate("views.stats.noProject")&&o.push("stats-view__project-item--no-project");let l=t.createDiv({cls:o.join(" ")});this.registerDomEvent(l,"click",()=>{this.openProjectDrilldown(s.projectName)});let c=l.createDiv({cls:"stats-view__project-header"}),d=c.createDiv({cls:"project-name stats-view__project-name"});d.textContent=s.projectName,c.createDiv({cls:"stats-view__click-indicator",text:"\u2192"});let u=s.taskCount>0?s.completedTaskCount/s.taskCount*100:0,p=l.createDiv({cls:"stats-view__project-content-grid"}),m=p.createDiv({cls:"stats-view__progress-container"});this.renderProgressCircle(m,u,s.completedTaskCount,s.taskCount);let f=p.createDiv({cls:"stats-view__stats-container"});if(s.totalTimeSpent>0||s.totalTimeEstimate>0){let b=f.createDiv({cls:"stats-view__time-bar"}),w=b.createDiv({cls:"stats-view__time-bar-visual"}).createDiv({cls:"stats-view__time-bar-fill"}),S=0;s.totalTimeEstimate>0?S=s.totalTimeSpent/s.totalTimeEstimate*100:s.totalTimeSpent>0&&(S=100,w.classList.remove("tn-static-background-color-var-background-mo-94b219f0","tn-static-background-color-var-background-se-9087a23e","tn-static-background-color-var-color-red-134bc721","tn-static-background-color-var-text-accent-a954c70f"),w.classList.add("tn-static-background-color-var-color-base-40-ef5f175e")),w.style.width=`${Math.min(S,100)}%`,S>100&&(w.classList.remove("tn-static-background-color-var-background-mo-94b219f0","tn-static-background-color-var-background-se-9087a23e","tn-static-background-color-var-color-base-40-ef5f175e","tn-static-background-color-var-text-accent-a954c70f"),w.classList.add("tn-static-background-color-var-color-red-134bc721"));let C=b.createDiv({cls:"stats-view__time-bar-label"});C.textContent=`${a(s.totalTimeSpent)} / ${a(s.totalTimeEstimate)}`}let h=f.createDiv({cls:"project-stats stats-view__project-stats"});if(s.lastActivity){let b=h.createDiv({cls:"project-stat stats-view__project-stat"});b.textContent=`Last activity: ${i(s.lastActivity)}`}if(s.avgTimePerTask>0){let b=h.createDiv({cls:"project-stat stats-view__project-stat"});b.textContent=`Avg: ${a(s.avgTimePerTask)}/task`}let g=f.createDiv({cls:"stats-view__trend-container"}),v=g.createDiv({cls:"stats-view__sparkline"});try{let b=await this.calculateProjectTrend(s.projectName);b.length>0&&b.some(k=>k.value>0)?this.renderSparkline(v,b):g.remove()}catch(b){g.remove()}}}renderProgressCircle(t,n,a,i){let c=2*Math.PI*27.5,d=c-n/100*c,u=activeWindow.createSvg("svg");u.setAttribute("width","60"),u.setAttribute("height","60"),u.setAttribute("viewBox","0 0 60 60"),u.classList.add("stats-view__progress-circle-svg");let p=activeWindow.createSvg("circle");p.setAttribute("cx",(60/2).toString()),p.setAttribute("cy",(60/2).toString()),p.setAttribute("r",27.5.toString()),p.classList.add("stats-view__progress-circle-bg");let m=activeWindow.createSvg("circle");m.setAttribute("cx",(60/2).toString()),m.setAttribute("cy",(60/2).toString()),m.setAttribute("r",27.5.toString()),m.setAttribute("stroke-dasharray",`${c} ${c}`),m.setAttribute("stroke-dashoffset",d.toString()),m.classList.add("stats-view__progress-circle-fg");let f=activeWindow.createSvg("text");f.setAttribute("x","50%"),f.setAttribute("y","50%"),f.setAttribute("dy","0.3em"),f.setAttribute("text-anchor","middle"),f.classList.add("stats-view__progress-circle-text"),f.textContent=`${Math.round(n)}%`,u.appendChild(p),u.appendChild(m),u.appendChild(f),t.appendChild(u);let h=t.createDiv({cls:"stats-view__progress-label"});h.textContent=`${a}/${i} tasks`}async calculateProjectTrend(t){try{let n=this.plugin.cacheManager.getAllTaskPaths(),a=[];for(let o of n)try{let l=await this.plugin.cacheManager.getTaskInfo(o);l&&!l.archived&&this.getTaskProjects(l).includes(t)&&a.push(l)}catch(l){}let i=[],s=Er();for(let o=29;o>=0;o--){let l=wv(s,o),c=M(l,"yyyy-MM-dd"),d=0;for(let u of a)if(u.timeEntries)for(let p of u.timeEntries)p.startTime&&M(new Date(p.startTime),"yyyy-MM-dd")===c&&(d+=Li([p]));i.push({date:c,value:d})}return i}catch(n){return[]}}renderSparkline(t,n){if(t.empty(),n.length===0)return;let a=100,i=20,s=Math.max(...n.map(d=>d.value));if(s===0)return;let o=activeWindow.createSvg("svg");o.setAttribute("width",a.toString()),o.setAttribute("height",i.toString()),o.setAttribute("viewBox",`0 0 ${a} ${i}`),o.classList.add("stats-view__sparkline-svg");let l=activeWindow.createSvg("path"),c="";n.forEach((d,u)=>{let p=u/(n.length-1)*a,m=i-d.value/s*i;u===0?c+=`M ${p} ${m}`:c+=` L ${p} ${m}`}),l.setAttribute("d",c),l.setAttribute("fill","none"),l.setAttribute("stroke","currentColor"),l.setAttribute("stroke-width","1.5"),l.setAttribute("opacity","0.7"),o.appendChild(l),t.appendChild(o)}async openProjectDrilldown(t){this.closeDrilldownModal();let n=this.contentEl.ownerDocument,a=n.body.createDiv({cls:"stats-view__modal-backdrop"});this.drilldownModal=a;let i=a.createDiv({cls:"stats-view__modal tasknotes-plugin"}),s=i.createDiv({cls:"stats-view__modal-header"}),o=s.createDiv({cls:"stats-view__modal-title"});o.textContent=`${t} - Detailed View`;let l=s.createEl("button",{cls:"stats-view__modal-close",text:"\xD7"}),c=i.createDiv({cls:"stats-view__modal-content"});c.textContent=this.plugin.i18n.translate("views.stats.loading"),this.registerDomEvent(l,"click",()=>this.closeDrilldownModal()),this.registerDomEvent(a,"click",u=>{u.target===a&&this.closeDrilldownModal()});let d=u=>{u.key==="Escape"&&(this.closeDrilldownModal(),n.removeEventListener("keydown",d))};n.addEventListener("keydown",d);try{let u=await this.getProjectDrilldownData(t);this.currentDrilldownData=u,this.renderDrilldownContent(c,u)}catch(u){ZD.error("Error loading drill-down data:",{category:"persistence",operation:"loading-drill-down-data",error:u}),c.textContent=this.plugin.i18n.translate("notices.statsLoadingFailed")}}closeDrilldownModal(){this.drilldownModal&&(this.drilldownModal.remove(),this.drilldownModal=null,this.currentDrilldownData=null)}async refreshDrilldownModal(){if(!this.drilldownModal||!this.currentDrilldownData)return;let t=this.drilldownModal.querySelector(".stats-view__modal-content");if(t)try{let n=await this.getProjectDrilldownData(this.currentDrilldownData.projectName);this.currentDrilldownData=n,this.renderDrilldownContent(t,n)}catch(n){ZD.error("Error refreshing drill-down modal:",{category:"stale-data",operation:"refreshing-drill-down-modal",error:n})}}async getProjectDrilldownData(t){var p;let n=this.plugin.cacheManager.getAllTaskPaths(),a=[];for(let m of n)try{let f=await this.plugin.cacheManager.getTaskInfo(m);f&&!f.archived&&this.getTaskProjects(f).includes(t)&&a.push(f)}catch(f){ZD.error(`Failed to get task for drill-down: ${m}`,{category:"persistence",operation:"get-task-drill-down",error:f})}let i=a.reduce((m,f)=>m+Li(f.timeEntries||[]),0),s=a.reduce((m,f)=>m+(f.timeEstimate||0),0),o=a.filter(m=>this.plugin.statusManager.isCompletedStatus(m.status)).length,l=a.length>0?o/a.length*100:0,c=a.filter(m=>{var f;return((f=m.timeEntries)==null?void 0:f.length)||m.completedDate}).sort((m,f)=>{var v,b;let h=(v=m.timeEntries)!=null&&v.length?Math.max(...m.timeEntries.map(k=>new Date(k.startTime).getTime())):m.completedDate?new Date(m.completedDate).getTime():0;return((b=f.timeEntries)!=null&&b.length?Math.max(...f.timeEntries.map(k=>new Date(k.startTime).getTime())):f.completedDate?new Date(f.completedDate).getTime():0)-h}).slice(0,10),d=[],u=Er();for(let m=29;m>=0;m--){let f=wv(u,m),h=M(f,"yyyy-MM-dd"),g=0,v=0,b=0;for(let k of a){if(k.timeEntries){let w=k.timeEntries.filter(S=>M(new Date(S.startTime),"yyyy-MM-dd")===h);w.length>0&&(g+=Li(w),v++)}k.completedDate&&M(new Date(k.completedDate),"yyyy-MM-dd")===h&&(b++,(p=k.timeEntries)!=null&&p.some(w=>M(new Date(w.startTime),"yyyy-MM-dd")===h)||v++)}d.push({date:h,timeSpent:g,taskCount:v,completedTasks:b})}return{projectName:t,tasks:a,totalTimeSpent:i,totalTimeEstimate:s,completionRate:l,timeByDay:d,recentActivity:c}}renderDrilldownContent(t,n){t.empty();let a=S=>{if(S<60)return`${Math.round(S)}m`;let C=Math.floor(S/60),E=Math.round(S%60);return E>0?`${C}h ${E}m`:`${C}h`},s=t.createDiv({cls:"stats-view__drilldown-overview"}).createDiv({cls:"stats-view__drilldown-stats"}),o=s.createDiv({cls:"stats-view__drilldown-card"});o.createDiv({cls:"stats-view__drilldown-value",text:`${a(n.totalTimeSpent)} / ${a(n.totalTimeEstimate)}`}),o.createDiv({cls:"stats-view__drilldown-label",text:"Total Time"});let l=s.createDiv({cls:"stats-view__drilldown-card"});l.createDiv({cls:"stats-view__drilldown-value",text:n.tasks.length.toString()}),l.createDiv({cls:"stats-view__drilldown-label",text:"Total Tasks"});let c=s.createDiv({cls:"stats-view__drilldown-card"});c.createDiv({cls:"stats-view__drilldown-value",text:`${Math.round(n.completionRate)}%`}),c.createDiv({cls:"stats-view__drilldown-label",text:"Completed"});let d=s.createDiv({cls:"stats-view__drilldown-card"}),u=n.tasks.length>0?n.totalTimeSpent/n.tasks.length:0,p=n.tasks.length>0?n.totalTimeEstimate/n.tasks.length:0;d.createDiv({cls:"stats-view__drilldown-value",text:`${a(u)} / ${a(p)}`}),d.createDiv({cls:"stats-view__drilldown-label",text:"Avg per Task"});let m=t.createDiv({cls:"stats-view__drilldown-section"});m.createDiv({cls:"stats-view__drilldown-heading",text:"Activity Over Time (Last 30 Days)"});let f=m.createDiv({cls:"stats-view__activity-chart"});this.renderActivityChart(f,n.timeByDay);let h=t.createDiv({cls:"stats-view__drilldown-section"}),g=h.createDiv({cls:"stats-view__section-header"});g.createDiv({cls:"stats-view__drilldown-heading",text:"All Project Tasks"});let b=g.createDiv({cls:"stats-view__task-filters"}).createEl("select",{cls:"stats-view__filter-select"});b.createEl("option",{value:"all",text:this.plugin.i18n.translate("views.stats.filters.allTasks")}),b.createEl("option",{value:"active",text:this.plugin.i18n.translate("views.stats.filters.activeOnly")}),b.createEl("option",{value:"completed",text:this.plugin.i18n.translate("views.stats.filters.completedOnly")});let k=h.createDiv({cls:"stats-view__task-list"}),w=(S="all")=>{k.empty();let C=n.tasks;if(S==="active"?C=n.tasks.filter(D=>!this.plugin.statusManager.isCompletedStatus(D.status)):S==="completed"&&(C=n.tasks.filter(D=>this.plugin.statusManager.isCompletedStatus(D.status))),C.sort((D,P)=>{let O=this.plugin.statusManager.isCompletedStatus(D.status),z=this.plugin.statusManager.isCompletedStatus(P.status);if(O!==z)return O?1:-1;let R=A=>{var F;return(F=A.timeEntries)!=null&&F.length?Math.max(...A.timeEntries.map($=>new Date($.startTime).getTime())):A.dateModified?new Date(A.dateModified).getTime():0};return R(P)-R(D)}),C.length===0){k.createDiv({cls:"stats-view__no-data",text:this.plugin.i18n.translate("views.stats.noTasks")});return}let E=k.createDiv({cls:"stats-view__task-count"});E.textContent=`Showing ${C.length} task${C.length!==1?"s":""}`;for(let D of C){let P=this.plugin.settings.defaultVisibleProperties?$i(this.plugin.settings.defaultVisibleProperties,this.plugin):void 0,O=Dr(D,this.plugin,P);k.appendChild(O)}};w("all"),this.registerDomEvent(b,"change",()=>{w(b.value)})}renderActivityChart(t,n){if(t.empty(),n.length===0)return;let a=Math.max(...n.map(s=>s.timeSpent));if(a===0){t.createDiv({cls:"stats-view__no-data",text:"No time tracking data"});return}let i=t.createDiv({cls:"stats-view__bar-chart"});for(let s of n){let l=i.createDiv({cls:"stats-view__bar-container"}).createDiv({cls:"stats-view__bar"}),c=s.timeSpent/a*40;l.style.height=`${c}px`;let d=`${M(new Date(s.date),"MMM d")}: ${Math.round(s.timeSpent)}m`;l.setAttribute("title",d)}}}});function lft(r,e=T6){return r.replace(/\(((?:#\d+\s*)(?:,\s*#\d+\s*)*)\)/g,(t,n)=>`(${n.split(",").map(i=>i.trim()).filter(Boolean).map(i=>{let s=i.slice(1);return`[#${s}](${e}/issues/${s})`}).join(", ")})`)}var yO,QD,gMe,T6,gO,w6=y(()=>{yO=require("obsidian");Wr();QD="tasknotes-release-notes",gMe="https://github.com/callumalpass/tasknotes/releases",T6="https://github.com/callumalpass/tasknotes";gO=class extends yO.ItemView{constructor(e,t,n,a){super(e),this.plugin=t,this.releaseNotesBundle=n,this.version=a}getViewType(){return QD}getDisplayText(){return this.plugin.i18n.translate("views.releaseNotes.title",{version:this.version})}getIcon(){return"book-open"}transformIssueLinks(e){return lft(e)}formatDate(e){if(!e)return"";try{let t=Us(e);return M(t,"MMMM d, yyyy")}catch(t){return""}}async renderVersionContent(e,t){let n=this.transformIssueLinks(t.content),a=t.isCurrent?`${this.plugin.i18n.translate("views.releaseNotes.baseFilesNotice")} ${n}`:n;await yO.MarkdownRenderer.render(this.plugin.app,a,e,"",this)}async createVersionSection(e,t,n){let a=e.createDiv({cls:"release-notes-version-section"});a.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-8px-fdf33f23"),a.classList.add("tn-static-margin-bottom-20px-49f14f8f"),a.classList.remove("tn-static-border-none-2eda1daa","tn-static-padding-12px-43bef435"),a.classList.add("tn-static-border-1px-solid-var-background-mo-b65b5121"),a.classList.remove("tn-static-border-radius-4px-c290c56e","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-12px-43bef435","tn-static-padding-20px-ebe8e48c"),a.classList.add("tn-static-border-radius-6px-0dc8408c"),a.classList.remove("tn-static-flex-1-14e3b769"),a.classList.add("tn-static-overflow-hidden-69824400");let i=a.createDiv({cls:"release-notes-version-header"});i.classList.remove("tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-0-16px-16px-16px-f1aa998c","tn-static-padding-0-41d7d7e2","tn-static-padding-12px-43bef435","tn-static-padding-20px-769fed37","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c","tn-static-padding-2px-8px-c8eea84a","tn-static-padding-2rem-42aa6d9c"),i.classList.add("tn-static-padding-16px-287f770e"),i.classList.remove("tn-static-cursor-grab-dad79857","tn-static-cursor-pointer-2723efcc"),i.classList.add("tn-static-cursor-pointer-3b6a3a65"),i.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),i.classList.add("tn-static-display-flex-75816cae"),i.classList.remove("tn-static-justify-content-center-03c4bb6f","tn-static-justify-content-flex-end-455f8cca"),i.classList.add("tn-static-justify-content-space-between-a562f4fd"),i.classList.remove("tn-static-align-items-baseline-4b95b5c7","tn-static-align-items-flex-start-0486f781"),i.classList.add("tn-static-align-items-center-7c619740"),i.style.backgroundColor=t.isCurrent?"var(--background-secondary)":"var(--background-primary)",i.classList.add("tn-static-transition-background-color-0-2s-8142f01e"),i.addEventListener("mouseenter",()=>{i.classList.remove("tn-static-background-color-var-background-mo-94b219f0","tn-static-background-color-var-color-base-40-ef5f175e","tn-static-background-color-var-color-red-134bc721","tn-static-background-color-var-text-accent-a954c70f"),i.classList.add("tn-static-background-color-var-background-se-9087a23e")}),i.addEventListener("mouseleave",()=>{i.style.backgroundColor=t.isCurrent?"var(--background-secondary)":"var(--background-primary)"});let s=i.createDiv({cls:"release-notes-version-info"});s.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-cccfa456","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),s.classList.add("tn-static-display-flex-75816cae"),s.classList.remove("tn-static-align-items-center-7c619740","tn-static-align-items-flex-start-0486f781"),s.classList.add("tn-static-align-items-baseline-4b95b5c7"),s.classList.remove("tn-static-display-flex-8bb39979","tn-static-gap-0-5rem-ce2fca4d","tn-static-gap-10px-f3d7ce77","tn-static-gap-6px-f0abc1db","tn-static-gap-8px-33fcd4c3"),s.classList.add("tn-static-gap-12px-ed7b3d87");let o=s.createEl("h2",{text:t.version});if(o.classList.remove("tn-static-margin-0-auto-266e9b04","tn-static-margin-0-db0d5f36","tn-static-margin-0-var-size-4-2-77f7dc08","tn-static-margin-2px-0-edce9b14","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-12px-43bef435","tn-static-padding-20px-ebe8e48c"),o.classList.add("tn-static-margin-0-11696618"),o.classList.remove("tn-static-font-size-0-75em-948e16e5","tn-static-font-size-0-8em-19dc7c13","tn-static-font-size-0-9em-65025e95","tn-static-font-size-12px-65574819","tn-static-font-size-12px-b0cc7e05","tn-static-font-size-var-tn-font-size-sm-0274a31d","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-margin-top-8px-f4f01e68"),o.classList.add("tn-static-font-size-1-2em-3a352995"),o.classList.remove("tn-static-cursor-pointer-2723efcc","tn-static-font-weight-500-02a2d333","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd"),o.classList.add("tn-static-font-weight-600-eed0f8fb"),t.isCurrent){let p=s.createSpan({text:"Current"});p.classList.remove("tn-static-font-size-0-8em-19dc7c13","tn-static-font-size-0-9em-65025e95","tn-static-font-size-1-2em-3a352995","tn-static-font-size-12px-65574819","tn-static-font-size-12px-b0cc7e05","tn-static-font-size-var-tn-font-size-sm-0274a31d","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-margin-top-8px-f4f01e68"),p.classList.add("tn-static-font-size-0-75em-948e16e5"),p.classList.remove("tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-0-16px-16px-16px-f1aa998c","tn-static-padding-0-41d7d7e2","tn-static-padding-12px-43bef435","tn-static-padding-16px-287f770e","tn-static-padding-20px-769fed37","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c","tn-static-padding-2rem-42aa6d9c"),p.classList.add("tn-static-padding-2px-8px-c8eea84a"),p.classList.remove("tn-static-border-radius-6px-0dc8408c","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-12px-43bef435","tn-static-padding-20px-ebe8e48c"),p.classList.add("tn-static-border-radius-4px-c290c56e"),p.classList.remove("tn-static-background-color-var-background-mo-94b219f0","tn-static-background-color-var-background-se-9087a23e","tn-static-background-color-var-color-base-40-ef5f175e","tn-static-background-color-var-color-red-134bc721"),p.classList.add("tn-static-background-color-var-text-accent-a954c70f"),p.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-muted-5872de20","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-color-white-0a43e56a","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),p.classList.add("tn-static-color-var-text-on-accent-f3e1679d"),p.classList.remove("tn-static-cursor-pointer-2723efcc","tn-static-font-weight-600-eed0f8fb","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd"),p.classList.add("tn-static-font-weight-500-02a2d333")}if(t.date){let p=s.createSpan({text:this.formatDate(t.date)});p.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-color-white-0a43e56a","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),p.classList.add("tn-static-color-var-text-muted-5872de20"),p.classList.remove("tn-static-font-size-0-75em-948e16e5","tn-static-font-size-0-8em-19dc7c13","tn-static-font-size-1-2em-3a352995","tn-static-font-size-12px-65574819","tn-static-font-size-12px-b0cc7e05","tn-static-font-size-var-tn-font-size-sm-0274a31d","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-margin-top-8px-f4f01e68"),p.classList.add("tn-static-font-size-0-9em-65025e95")}let l=i.createSpan({text:n?"\u25BC":"\u25B6"});l.classList.remove("tn-static-font-size-0-75em-948e16e5","tn-static-font-size-0-9em-65025e95","tn-static-font-size-1-2em-3a352995","tn-static-font-size-12px-65574819","tn-static-font-size-12px-b0cc7e05","tn-static-font-size-var-tn-font-size-sm-0274a31d","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-margin-top-8px-f4f01e68"),l.classList.add("tn-static-font-size-0-8em-19dc7c13"),l.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-color-white-0a43e56a","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),l.classList.add("tn-static-color-var-text-muted-5872de20");let c=a.createDiv({cls:"release-notes-version-content"});c.classList.remove("tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-0-41d7d7e2","tn-static-padding-12px-43bef435","tn-static-padding-16px-287f770e","tn-static-padding-20px-769fed37","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c","tn-static-padding-2px-8px-c8eea84a","tn-static-padding-2rem-42aa6d9c"),c.classList.add("tn-static-padding-0-16px-16px-16px-f1aa998c"),c.style.display=n?"block":"none";let d=null,u=()=>(d||(d=this.renderVersionContent(c,t)),d);n&&await u(),i.addEventListener("click",()=>{let p=c.style.display!=="none";c.style.display=p?"none":"block",l.textContent=p?"\u25B6":"\u25BC",p||u()})}async onOpen(){let{contentEl:e}=this;e.empty(),e.addClass("tasknotes-release-notes-view");let t=e.createDiv({cls:"tasknotes-release-notes-container"});t.classList.remove("tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-0-16px-16px-16px-f1aa998c","tn-static-padding-0-41d7d7e2","tn-static-padding-12px-43bef435","tn-static-padding-16px-287f770e","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c","tn-static-padding-2px-8px-c8eea84a","tn-static-padding-2rem-42aa6d9c"),t.classList.add("tn-static-padding-20px-769fed37"),t.classList.add("tn-static-max-width-900px-1d34c094"),t.classList.remove("tn-static-margin-0-11696618","tn-static-margin-0-db0d5f36","tn-static-margin-0-var-size-4-2-77f7dc08","tn-static-margin-2px-0-edce9b14","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-padding-12px-43bef435","tn-static-padding-20px-ebe8e48c"),t.classList.add("tn-static-margin-0-auto-266e9b04");let n=t.createDiv({cls:"release-notes-header"});n.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-8px-fdf33f23"),n.classList.add("tn-static-margin-bottom-20px-49f14f8f"),n.createEl("h1",{text:this.plugin.i18n.translate("views.releaseNotes.header",{version:this.version})});let a=t.createEl("p");a.classList.remove("tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-bottom-0-75rem-c05a3c6e","tn-static-margin-bottom-8px-fdf33f23"),a.classList.add("tn-static-margin-bottom-20px-49f14f8f"),a.classList.remove("tn-static-font-size-0-75em-948e16e5","tn-static-font-size-0-8em-19dc7c13","tn-static-font-size-1-2em-3a352995","tn-static-font-size-12px-65574819","tn-static-font-size-12px-b0cc7e05","tn-static-font-size-var-tn-font-size-sm-0274a31d","tn-static-margin-8px-0-0-0-a2eb8382","tn-static-margin-top-8px-f4f01e68"),a.classList.add("tn-static-font-size-0-9em-65025e95"),a.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-accent-65b47ee3","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-color-white-0a43e56a","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),a.classList.add("tn-static-color-var-text-muted-5872de20");let i=this.plugin.i18n.translate("views.releaseNotes.starMessage"),s=i.toLowerCase().lastIndexOf("github");if(s!==-1){a.appendText(i.substring(0,s));let d=a.createEl("a",{text:i.substring(s,s+6),href:T6});d.classList.remove("tn-static-color-var-color-accent-d2cad743","tn-static-color-var-text-muted-5872de20","tn-static-color-var-text-on-accent-f3e1679d","tn-static-color-var-text-warning-783d5f03","tn-static-color-var-tn-text-muted-a90fb6f3","tn-static-color-white-0a43e56a","tn-static-cursor-pointer-2723efcc","tn-static-font-size-12px-65574819","tn-static-font-weight-bold-0fe8c30d","tn-static-font-weight-bold-e0b452bd","tn-static-margin-2px-0-edce9b14","tn-static-padding-20px-7a035d95","tn-static-padding-20px-ebe8e48c"),d.classList.add("tn-static-color-var-text-accent-65b47ee3"),d.addEventListener("click",u=>{u.preventDefault(),window.open(T6,"_blank")}),a.appendText(i.substring(s+6))}else a.appendText(i);let o=t.createDiv({cls:"release-notes-versions"});for(let d=0;d{d.preventDefault(),window.open(gMe,"_blank")})}async onClose(){let{contentEl:e}=this;e.empty()}}});var yMe,vMe=y(()=>{yMe=`# TaskNotes 4.12.5 ## Fixed - (#2255) Notes with an in-note task card no longer jump while scrolling in reading mode. The card is now restored only after scrolling settles instead of being re-injected every frame against Obsidian's virtualised reading view. Thanks to @logicelf for the detailed diagnosis. - (#2256) Kanban swimlane order now follows the view's sort configuration again: with a formula or property sort applied, the swimlane holding the top-sorted task floats to the top of the board as it did before the swimlane ordering option was introduced. Thanks to @tsweezy for reporting this. - (#2222) The TaskNotes settings tab bar now wraps to a second line instead of clipping the Integrations tab beside the documentation link on narrow settings panes. Thanks to @nextstitch and @YongcaiHuang for reporting this. `});var kMe,bMe=y(()=>{kMe=`# TaskNotes 4.12.4 > [!info] TaskNotes v5 beta > > [TaskNotes v5](https://github.com/callumalpass/tasknotes/releases/tag/5.0.0-beta.0) is available as an opt-in beta alongside TaskNotes 4.12. TaskNotes 4.12 remains the recommended stable release. > > The major change in v5 is support for portable TaskNotes collections. These collections can be used in both Obsidian and the [TaskNotes app](https://app.tasknotes.dev/), which is also available in beta, so the same tasks can be managed through either interface. > > TaskNotes collections are built on [mdbase](https://mdbase.dev/), a Markdown-native collection format. [mdbase Connect](https://mdbase.dev/connect/) provides the permissioned bridge that makes those collections available to the TaskNotes app. Your tasks remain ordinary Markdown files in your vault; mdbase adds a shared structure that compatible tools can understand. > > TaskNotes v5, mdbase Connect, and the TaskNotes app are all under active development. Please use a backed-up vault, expect some rough edges, and [report any problems you encounter](https://github.com/callumalpass/tasknotes/issues). ## Changed - (#2187) Improved TaskNotes startup performance by allowing Bases registration to finish asynchronously. Thanks to @tgrosinger for the contribution. ## Fixed - (#2232) Opening an occurrence note from a completion-anchored recurring task now uses the task's scheduled occurrence date instead of defaulting to today. Thanks to @chmac for reporting this. - (#2247) Creating a new inline task now removes nested wikilink and Markdown-link markup from the inserted task link's display text. Thanks to @bgk0018 for reporting this. - (#2231) Fixed Agenda views with \`showOverdueOnToday\` showing the same task twice when both its scheduled and due dates were overdue. Thanks to @takashit16833 for reporting this. - (#2206) The time entry editor now opens much faster for tasks with many tracked sessions by delaying the heavier description editor setup until a description field is focused. Thanks to @Sapere-Kyle for reporting this. - (#2239) Fixed Task List Bases embedded in mobile notes leaving a large blank gap after the final task card. Thanks to @same774 for reporting this and @prethrive for sharing a workaround. - (#2238) The Relationships widget now stays below long Live Preview Dataview tables and no longer appears twice after switching to Reading mode. Thanks to @Romek1769 for reporting this. - (#2250) Hardened Google Calendar task metadata updates: duplicate Google Calendar fields are now repaired atomically without replacing concurrent task edits, and synchronization finishing after a disconnect no longer writes stale event metadata. Thanks to @3zra47 for reporting the corrupted task data that prompted this review. - (#2229) Google Calendar OAuth authorization now opens in the system browser instead of Obsidian's Web Viewer, avoiding Google's 401 malformed-request page in the in-app browser. Thanks to @prethrive for reporting this and confirming the workaround. - Skipping a recurring task instance from Task List or Kanban now records the task's occurrence date instead of the view's current date. Thanks to @renatomen for the contribution. - (#2130) Tasks added by external sync while Obsidian is closed are now exported to Google Calendar after TaskNotes starts. Thanks to @seththepeacock for reporting this and @raphaelfaouakhiri for the contribution. - (#2246) Fixed materialized recurring occurrences hiding occurrence-template filename suffixes in TaskNotes views. Thanks to @raphaelfaouakhiri for reporting and fixing this issue. - (#2221) Fixed \`PUT /api/tasks/:id\` ignoring empty arrays for \`contexts\` and \`blockedBy\`: sending \`{"contexts": []}\` or \`{"blockedBy": []}\` now clears the corresponding frontmatter field instead of silently leaving the previous value in place. The deletion pass previously fired only on a literal \`undefined\`, which JSON cannot express, so HTTP clients had no way to clear these fields. Thanks to @tgrosinger for the contribution. - (#2191) Completing or skipping a recurring occurrence that was moved earlier than its original date no longer schedules that original date again. Thanks to @martin-forge for the contribution. - (#2193) Google Calendar event descriptions written with formatting now read as plain text in event details, copied text, and generated notes, instead of showing raw HTML tags. Paragraph breaks, list structure, and link addresses are kept. Thanks to @martin-forge for the contribution. - (#2192) Agenda and list cards for Google and Microsoft calendar events now show the name of the calendar the event belongs to, instead of the generic "Calendar" label. Thanks to @martin-forge for the contribution. `});var TMe,wMe=y(()=>{TMe=`# TaskNotes 4.12.3 > [!info] TaskNotes v5 beta > > [TaskNotes v5](https://github.com/callumalpass/tasknotes/releases/tag/5.0.0-beta.0) is available as an opt-in beta alongside TaskNotes 4.12. TaskNotes 4.12 remains the recommended stable release. > > The major change in v5 is support for portable TaskNotes collections. These collections can be used in both Obsidian and the [TaskNotes app](https://app.tasknotes.dev/), which is also available in beta, so the same tasks can be managed through either interface. > > TaskNotes collections are built on [mdbase](https://mdbase.dev/), a Markdown-native collection format. [mdbase Connect](https://mdbase.dev/connect/) provides the permissioned bridge that makes those collections available to the TaskNotes app. Your tasks remain ordinary Markdown files in your vault; mdbase adds a shared structure that compatible tools can understand. > > TaskNotes v5, mdbase Connect, and the TaskNotes app are all under active development. Please use a backed-up vault, expect some rough edges, and [report any problems you encounter](https://github.com/callumalpass/tasknotes/issues). ## Fixed - (#2212) Fixed TaskNotes settings sections appearing offscreen or blank on Obsidian 1.13 desktop. Thanks to @RafaQNunes for reporting this, and to @m4to-3pe and @matthewrishii for confirming it remained in 4.12.2. - (#2213) Runtime plugin-data updates now avoid writing when Obsidian cannot safely read an existing TaskNotes \`data.json\`, preventing calendar sync, Pomodoro, ICS, or auto-archive state writes from replacing saved settings. Thanks to @3zra47 for the follow-up details and file-history evidence. - (#2216) Fixed updated default Kanban Bases grouping every task into the \`None\` column when grouping by status. The generated Kanban templates now use the real status property, and existing Kanban files using \`task.status\` keep grouping from TaskNotes task data. Thanks to @Esvorst for reporting this. - (#2120, #2135) Long all-day event titles in Calendar week and day views now truncate in the all-day row instead of stretching it vertically. Thanks to @same774 and @ks-studio-net for reporting this, and to @Admorei for confirming it remained in 4.12.2. `});var SMe,xMe=y(()=>{SMe=`# TaskNotes 4.12.2 > [!info] TaskNotes v5 beta > > [TaskNotes v5](https://github.com/callumalpass/tasknotes/releases/tag/5.0.0-beta.0) is available as an opt-in beta alongside TaskNotes 4.12. TaskNotes 4.12 remains the recommended stable release. > > The major change in v5 is support for portable TaskNotes collections. These collections can be used in both Obsidian and the [TaskNotes app](https://app.tasknotes.dev/), which is also available in beta, so the same tasks can be managed through either interface. > > TaskNotes collections are built on [mdbase](https://mdbase.dev/), a Markdown-native collection format. [mdbase Connect](https://mdbase.dev/connect/) provides the permissioned bridge that makes those collections available to the TaskNotes app. Your tasks remain ordinary Markdown files in your vault; mdbase adds a shared structure that compatible tools can understand. > > TaskNotes v5, mdbase Connect, and the TaskNotes app are all under active development. Please use a backed-up vault, expect some rough edges, and [report any problems you encounter](https://github.com/callumalpass/tasknotes/issues). ## Fixed - (#2212) Fixed TaskNotes settings sections appearing pushed across the Obsidian settings pane on desktop. Thanks to @RafaQNunes for reporting this. `});var CMe,EMe=y(()=>{CMe=`# TaskNotes 4.12.1 > [!info] TaskNotes v5 beta > > [TaskNotes v5](https://github.com/callumalpass/tasknotes/releases/tag/5.0.0-beta.0) is available as an opt-in beta alongside TaskNotes 4.12. TaskNotes 4.12 remains the recommended stable release. > > The major change in v5 is support for portable TaskNotes collections. These collections can be used in both Obsidian and the [TaskNotes app](https://app.tasknotes.dev/), which is also available in beta, so the same tasks can be managed through either interface. > > TaskNotes collections are built on [mdbase](https://mdbase.dev/), a Markdown-native collection format. [mdbase Connect](https://mdbase.dev/connect/) provides the permissioned bridge that makes those collections available to the TaskNotes app. Your tasks remain ordinary Markdown files in your vault; mdbase adds a shared structure that compatible tools can understand. > > TaskNotes v5, mdbase Connect, and the TaskNotes app are all under active development. Please use a backed-up vault, expect some rough edges, and [report any problems you encounter](https://github.com/callumalpass/tasknotes/issues). ## Changed - (#2204) Public documentation is now published from the dedicated \`tasknotes.dev\` repository. Plugin release notes and internal documentation remain in this repository. - Updated compatibility with Obsidian's current plugin review and settings search. ## Fixed - Fixed TaskNotes interface elements sometimes appearing in the wrong window when using Obsidian pop-out windows. - Improved confirmation dialogs, icons, and modal styling to use Obsidian's current interface APIs. `});var DMe,PMe=y(()=>{DMe=`# TaskNotes 4.12.0 > [!info] TaskNotes v5 beta > > [TaskNotes v5](https://github.com/callumalpass/tasknotes/releases/tag/5.0.0-beta.0) is available as an opt-in beta alongside TaskNotes 4.12. TaskNotes 4.12 remains the recommended stable release. > > The major change in v5 is support for portable TaskNotes collections. These collections can be used in both Obsidian and the [TaskNotes app](https://app.tasknotes.dev/), which is also available in beta, so the same tasks can be managed through either interface. > > TaskNotes collections are built on [mdbase](https://mdbase.dev/), a Markdown-native collection format. [mdbase Connect](https://mdbase.dev/connect/) provides the permissioned bridge that makes those collections available to the TaskNotes app. Your tasks remain ordinary Markdown files in your vault; mdbase adds a shared structure that compatible tools can understand. > > TaskNotes v5, mdbase Connect, and the TaskNotes app are all under active development. Please use a backed-up vault, expect some rough edges, and [report any problems you encounter](https://github.com/callumalpass/tasknotes/issues). ## Security - Calendar OAuth credentials and account tokens are now stored in Obsidian Secret Storage instead of TaskNotes' \`data.json\`, with automatic migration for existing connections. See [Calendar Integration](https://tasknotes.dev/features/calendar-integration/). - Thanks to @mcuste for the contribution - Updated bundled HTTP, address parsing, and schema validation dependencies to versions containing their current security fixes. ## Added - Added portable task attachment references. Attachments now round-trip as an ordered \`attachments\` link list in task frontmatter and are exposed through the TaskNotes model and runtime API. These are collection-file references only; attachment bytes and binary metadata remain owned by the host. - (#2142) MCP \`tasknotes_create_task\` and \`tasknotes_update_task\` now accept \`customProperties\` for configured TaskNotes user fields. Thanks to @phillipadsmith for suggesting this. - (#2126, #2134) Added optional filename templates for materialized recurring occurrence notes, with explicit date, ISO week, month, year, and month-name variables plus per-parent overrides. Existing naming remains unchanged until a template is configured. See [Recurring Tasks](https://tasknotes.dev/features/recurring-tasks/#occurrence-filenames). Thanks to @raphaelfaouakhiri for reporting and implementing this. - (#2105) Added \`{{projectFolder}}\` and \`{{projectFolders}}\` folder template variables for storing tasks alongside linked project notes. See [Template Variables](https://tasknotes.dev/features/template-variables/). Thanks to @carypruitt for this contribution. ## Changed - Generated TaskNotes type contracts now include configured natural-language capture triggers, allowing compatible clients to offer the same field suggestions. - Rebuilt the TaskNotes documentation with reorganized navigation, full-text search, mobile and accessibility improvements, and references generated from the current commands, settings, compatibility metadata, HTTP routes, and default Bases. Added practical guides for adopting TaskNotes in an existing vault, mobile use, custom Bases, and backup and recovery. See the [TaskNotes documentation](https://tasknotes.dev/). - (#2088) Convert current note to task now uses your default scheduled date when the note does not already have \`scheduled\` frontmatter, while the **None** default still leaves converted notes unscheduled. See [Task Properties](https://tasknotes.dev/settings/task-properties/#scheduled-date). Thanks to @e-zz for suggesting this. ## Fixed - Plugin settings now recover when Obsidian briefly returns no data while reloading an externally changed settings file, preventing a post-reload error without overwriting the existing settings. - (#2194) Pomodoro task selection suggestions now keep rich task cards at the menu width, preventing task titles from wrapping one letter per line. Thanks to @Evilgenee for reporting this. - (#2196) Drag-to-reorder now works for Task List Bases embedded in Live Preview notes, matching the behavior of directly opened Bases and Reading mode embeds. Thanks to @jimbo108108 for reporting this. - (#2198) Agenda Bases can now show overdue scheduled or due tasks on today's row with \`showOverdueOnToday\`, and regenerated default Agenda files enable that behavior by default. Thanks to @vicrdguez for reporting this. - (#2182) Checklist progress on task cards now excludes cancelled markdown checklist items such as \`[-]\` from the completed/total count. Thanks to @ctrl-q for reporting this. - (#2180) Inline task cards in Live Preview now keep their click and context menu handlers active on Obsidian 1.13, so clicking a rendered task link opens the edit modal instead of revealing the raw wikilink. Thanks to @npondel for the detailed diagnosis and @minchinweb for confirming the issue. - (#2171) Stopped recurring notification and status-bar scans from reading unindexed notes directly from disk while preserving the fallback for direct task lookups. Thanks to @tgrosinger for identifying and diagnosing the excessive vault reads. - (#2174) **Open or create occurrence note** from Quick Actions now uses the recurring task's scheduled occurrence date, preventing duplicate occurrence notes keyed to the day the action was run. Thanks to @chmac for reporting this. - (#2169) Regenerated default Base views now include tasks whose identifying property is stored as a list containing the configured task value. Thanks to @GlebYavorski for reporting this. - (#2166) Fixed Task List views configured to start collapsed so the first chevron click expands only the selected group instead of expanding every other group. Thanks to @renatomen for reporting and fixing this. - (#2165) **Convert current note to task** now reads configured field mappings, including list-valued title fields such as \`aliases\`, and preserves an existing aliases list when the title is unchanged. Thanks to @jkuball for reporting this. - (#2164) Flat Kanban boards now clear stale swimlane layout state when they rerender, preventing columns from occasionally stacking into one vertical strip after switching tabs. Thanks to @brienna for reporting this. - (#2160, #2161) Generated Kanban Bases now use the correct TaskNotes status property and configuration block. Rich Bases status values render as their configured labels, while pinned columns and saved column order are honored. Thanks to @kevin-4c for the detailed reports and diagnosis. - (#2111, #2159) Recurring task instances now remain visible through the final day of Calendar and Agenda ranges in positive-offset time zones, regardless of the configured first day of the week. Thanks to @Arachnidai and @odxn0803 for reporting this. - (#2155) Regenerated default Calendar Bases now inherit the app-level time slot duration instead of hardcoding 30 minutes. Existing per-Base time settings remain intentional overrides. Thanks to @SZZ504232 for reporting this. - (#2154) Timed ICS events without a \`TZID\` now preserve their floating wall time in the user's local timezone instead of being interpreted as UTC. Thanks to @cloesophia for the reproducible calendar sample. - (#2152) Fixed paginated Google Calendar refreshes for calendars with many events so secondary calendars do not disappear after Google returns a second page. Thanks to @wobafett for reporting and diagnosing this. - (#2141) Fixed Task List groups for tasks without scheduled or due dates showing a raw Bases icon object instead of **None**. Thanks to @ks-studio-net for reporting this. - (#2140) The edit task modal now shows saved task-identification tags when hiding identification tags is disabled. Thanks to @3zra47 for reporting this. - (#2148) Empty list-like frontmatter values no longer become literal \`"null"\` entries when tasks are edited. Thanks to @minchinweb for reporting this. - (#2120, #2135) Long all-day event titles in Calendar week and day views now truncate instead of stretching the all-day row. Thanks to @same774 and @ks-studio-net for reporting this. - (#2124) Fixed a Kanban crash when opening or closing the edit modal immediately after moving a task between list-valued swimlanes such as contexts. Thanks to @Decia-C for reporting this. - (#2114) Completing a rescheduled occurrence for a scheduled-anchored recurring task now advances the parent from the moved occurrence date instead of an earlier original occurrence date. Thanks to @chrabia for reporting this. - (#2113) Failed Google Calendar manual refreshes no longer make the next immediate refresh show a misleading success notice. Thanks to @JohWQ for reporting this. - (#2109) TaskNotes no longer injects instant-conversion controls into embedded or detached Markdown editors, preventing checkbox notes opened from unrelated Bases from freezing Obsidian on mobile. Thanks to @jmartinmcfly for the clear reproduction and recording. - (#2107, #2108) Creating tasks with **Store title in filename** enabled now handles duplicate or case-variant titles without failing or replacing the task title with a suffixed filename. Thanks to @AdmiralClackington for reporting and diagnosing this. - (#2106) Regenerated default Calendar Base files now use your configured first day of the week instead of forcing Sunday. Thanks to @atos2212-blip, @cweekly, @idontcode34, and @hikatamika for reporting this. - (#2100) Tags added while creating a task now keep the same frontmatter order as tags added later from the task context menu. Thanks to @mgrecar for reporting this. - (#2092) New non-recurring tasks created directly in a completed status now get a completed date, so completed-date views can find them immediately. Thanks to @Crell for reporting this. - (#2096) Fixed TaskNotes Kanban swimlanes falling back to **None** when the swimlane used a Bases formula that was not already cached by Bases. Thanks to @ddevaal for reporting this. - (#2093) TaskNotes now retries custom Bases view registration when the Bases core plugin is enabled after TaskNotes, preventing default views from showing **Unknown view type** until TaskNotes is reloaded. Thanks to @yaye-work for reporting this. - (#2084) The Relationships widget no longer prevents editor text selection from autoscrolling when dragging below the bottom edge of a task note. Thanks to @lostwildland for reporting this. - (#2081, #2103) Kept task card and relationships widgets visible in reading mode when Obsidian scroll or preview updates remove their DOM, and refreshed visible widgets promptly after metadata changes. Thanks to @mukhozhuk for reporting and debugging this and @martin-forge for fixing it. - (#2064, #2066) Recurring tasks now advance correctly after their next scheduled date is manually adjusted, preserving due-date offsets and times without jumping back to an earlier occurrence. Thanks to @chmac for reporting and fixing this. - (#2018) Fixed **Hide empty columns** in Kanban views with swimlanes so columns with no visible tasks are hidden while pinned columns remain. Thanks to @scottTomaszewski for reporting and fixing this. - Fixed recurring all-day ICS subscription events keeping the original end date on later instances, which could cause calendar list views to show events under the wrong day. Thanks to @abbiefalls90. - (#2033) Fixed the project folder badge on task cards so, when expandable subtasks are enabled, it expands or collapses inline subtasks instead of showing an unavailable-action notice. Thanks to @abbiefalls90 for the fix and @scottkodai for the follow-up feedback. - (#2040, #2041) Stopped newly created tasks from filling the Google Calendar retry queue when calendar export is disabled. Thanks to @chmac for reporting and fixing this. - (#2046, #2051) The date and time picker now focuses the natural-language input when it is enabled, making keyboard-driven quick actions ready for immediate typing. Thanks to @DevOps-Toast for reporting this and @ther12k for fixing it. - (#2125, #2129) Materialized recurring occurrence notes now record the date they were actually completed, while the parent recurring task continues to track the occurrence date. Thanks to @raphaelfaouakhiri for reporting and fixing this. - (#2173, #2175) Completion-anchored recurring tasks with materialized occurrence notes now schedule the next occurrence from the day the occurrence was actually completed. Thanks to @chmac for reporting and fixing this. - (#1982) Preserved the Task List's own scroll position during Bases refreshes so long mobile lists do not jump back to the top after task updates. Thanks to @3zra47 for the follow-up report. - (#1863) Microsoft Calendar event updates now accept opaque Exchange calendar IDs instead of failing local validation before contacting Microsoft Graph. Thanks to @fmacondray for reporting this and providing the follow-up stack trace. `});var MMe,AMe=y(()=>{MMe=`# TaskNotes 4.11.1 ## Added - (#2024) Added materialized occurrence notes to the Relationships widget, so recurring parent task notes can show their occurrence notes in an **Occurrences** tab. See [Relationships Widget](https://tasknotes.dev/features/inline-tasks/#relationships-widget). Thanks to @3zra47 for requesting this. - (#2022) Added a **Skip instance** / **Unskip instance** action to the recurring task edit modal's completion calendar, so skipped dates can be adjusted from the same date menu as completions. See [Recurring Tasks](https://tasknotes.dev/features/recurring-tasks/#completion-tracking). Thanks to @AmonAmarthFTW for requesting this. - (#2048) Added current due and scheduled dates to the edit modal's task information. Thanks to @1activegeek for requesting this. - (#2058, #2059) Added natural-language parsing and the full date picker to date-type custom fields. Thanks to @chmac for requesting this. - (#2060) Added date-type custom fields to the task right-click menu under **Custom dates**. Thanks to @chmac for requesting this. - (#2067) Added an **Edit task** action to the task card context menu, including inline task cards. Thanks to @DarkCellar for requesting this. - (#2068) Added \`reminders\` input support to the MCP \`tasknotes_create_task\` and \`tasknotes_update_task\` tools. Thanks to @Spirit597 for requesting this. - (#2069) Added an **Add project** action to the Quick Actions palette. Thanks to @chmac for requesting this. ## Fixed - (#2007) Fixed a remaining task creation autocomplete case where a status value containing another status label could leave status fragments in the task title. Thanks to @prepare4robots for the follow-up report. - (#2031) Fixed quick task creation failing when natural language input created a recurring task with a scheduled time. Thanks to @rdefaccio for reporting this. - (#2034) Fixed Advanced Calendar timed events switching to a high-contrast mobile fill when Obsidian is narrowed or split on desktop. Thanks to @RumiaKitinari for reporting this. - (#2039) Fixed broken images on the Workflows and Calendar Setup documentation pages. Thanks to @chmac for reporting this. - (#2045) Fixed custom modal fields assigned to Basic Information not appearing in task creation or edit modals. Thanks to @chmac for reporting this. - (#2063) Fixed project autocomplete storing ambiguous project links without the selected note's folder path. Thanks to @chmac for reporting this. - (#2072) Fixed inline task links to headings so they show both the task title and heading instead of only the heading. Thanks to @spasche for reporting this. - (#2075) Fixed multiday Calendar events being clipped to one day when a Base is embedded in Reading view. Thanks to @ddevaal for reporting this. - (#2079) Fixed the reminder modal's **Absolute** tab so it switches from relative fields to absolute date and time fields. Thanks to @JunwonYoon for reporting this and identifying the CSS specificity issue. ## Changed - Improved local review checks so unsafe direct \`Object.prototype\` method access is caught before submission. `});var _Me,IMe=y(()=>{_Me=`# TaskNotes 4.11.0 ## Added - (#730, #1897, #1942, #1998) Added [Canvas Bases](https://github.com/callumalpass/canvas-bases), an optional companion plugin that turns Obsidian Bases views into canvas-style boards and reusable JSON Canvas snapshots, with TaskNotes badges, task menus, dependency and subtask edges, and assignment zones for supported TaskNotes actions. See [Canvas Bases](https://tasknotes.dev/companion-plugins/canvas-bases/) for setup details. Thanks to @DillPickle80, @BradGaddis, @Hyadhuad, and @AlinaWithAFace for the visual planning requests, and to @renatomen, @prayidae, and @maranqz for the related discussion. - Added a TaskNotes starter note that is created and opened automatically on first install to introduce task creation, inline conversion, and embedded Bases views. - Added a runtime API surface for companion plugins to show or populate the standard TaskNotes task context menu. - (#2000) Added separate settings for using the active note as a project during normal task creation and during inline task creation or instant conversion. Thanks to @BlueScreen32 for suggesting the split. - (#1303, #2001) Added separate templates for materialized occurrence notes, including parent-level \`occurrence_template\` support and a global fallback setting. Thanks to @BrucePlumb for suggesting a separate occurrence-note template and @ak-42 for the related per-recurrence template request. - (#2006) Added the projected local finish time beside the remaining duration while a Pomodoro is running. See [Pomodoro View](https://tasknotes.dev/views/pomodoro-view/) for the timer behavior. Thanks to @abbiefalls90 for suggesting this. - (#2016) Added a setting for recurring external calendar event related notes, so Google, Microsoft, and ICS recurrences can either share notes across the series or keep notes limited to the selected instance. See [Integrations Settings](https://tasknotes.dev/settings/integrations/#calendar-subscriptions-ics) for the setting. Thanks to @akhtsang for reporting this, and to @cathywu and @mdbraber for the earlier series-linking discussion. ## Changed - (#1737) Clarified that changing the task tag does not automatically update existing Base view filters. Thanks to @goldorak00 for reporting this, and to @Domcoppinger and @imsuck for the first-time setup feedback. - (#2005) Excluded archived task notes and archived project-note references from Task & Project Statistics. Thanks to @Xiarno for suggesting this. - Added a local review-type lint check that catches dependency-resolution warnings from Obsidian's online review before submission. - Improved dependency and project relationship cache updates so ordinary note edits avoid unnecessary relationship recalculation, while blocked and blocking state stays current when dependency status changes. - Improved filter and view query caching so filter options update immediately after relevant task-field changes while large Task List, Kanban, and Calendar queries avoid repeated vault scans. - Extended the in-app release notes bundle to include the current major release, with collapsed versions rendered only when opened. ## Fixed - (#2015) Fixed Google Calendar events from the previous six months disappearing from Calendar and Mini Calendar views after a fresh sync. Thanks to @akhtsang for reporting this. - (#2013) Fixed task-card status and priority dots becoming oversized on touch-capable desktop devices. Thanks to @RumiaKitinari for reporting this. - (#2009) Restored Tab and Shift+Tab focus movement in the Create new task modal's natural language input instead of letting the markdown editor indent the title. Thanks to @prepare4robots for reporting this. - (#2007) Fixed status autocomplete in the task creation modal leaving status value fragments in the task title when the editor auto-paired the status trigger. Thanks to @prepare4robots for reporting this. - (#2004) Fixed the Pomodoro start command forgetting the selected task after it was completed, so reopening the task lets it be picked up again. Thanks to @MPourjam for reporting this. - (#1996) Made Kanban card drag-and-drop show a clear drop slot marker while cards are being repositioned, so the landing position remains visible during sorting. Thanks to @phillipadsmith for reporting this. - Fixed runtime API dependency removal so removing the last dependency from a task also clears the mapped \`blockedBy\` property from the note. `});var NMe,RMe=y(()=>{NMe=`# TaskNotes 4.10.2 ## Fixed - (#1995) Fixed Bases Calendar views showing both a materialized occurrence note and its matching virtual recurring task instance. Thanks to @rdefaccio for reporting this. - (Discussion #1994) Fixed timed recurring tasks failing to advance their due dates when due-date offset preservation is enabled. Thanks to @mgrecar for raising this. `});var FMe,OMe=y(()=>{FMe=`# TaskNotes 4.10.1 ## Added - Added a startup check for new compatible TaskNotes releases. When a new release is available, TaskNotes shows a notice that opens the TaskNotes entry in Obsidian's Community Plugins browser. - (#1989) Added a command-palette action plus runtime and HTTP API actions for updating configured default \`.base\` files from the current TaskNotes templates. Thanks to @businessBoris for the request. - (#1115) Added API and MCP support for creating materialized occurrence notes from recurring tasks, and made headless recurring-instance completion respect occurrence notes when the parent uses Create next after completion. Thanks to @gsssr for the original request, @slipstyle for the follow-up, and @martin-forge for identifying the API/MCP gap. ## Fixed - (#1985) Fixed embedded Calendar and Agenda time-grid views drifting out of alignment inside callouts and Reading mode. Thanks to @matesvecenik for reporting and sharing screenshots. - (#1986) Fixed the local HTTP API rejecting requests from the TaskNotes browser extension's Chrome extension origin. Thanks to @n1njaznutz for reporting this. - (#1980) Added mobile bottom spacing to Agenda Calendar views so the last visible tasks can scroll above Obsidian's bottom navigation bar. Thanks to @Jomo94 for reporting and sharing the screenshot. - (#1984) Fixed mobile task link overlays hiding configured inline task card properties such as scheduled date, due date, contexts, and projects. Thanks to @stil-sudo for reporting. - (#1979) Kept the left-positioned subtask chevron from overlapping the task status control on mobile task cards. Thanks to @Jomo94 for reporting and sharing the screenshot. - (#1903) Reduced the Edit Task modal's mobile action-button footer so Open note, Archive, Delete, Save, and Cancel take two rows instead of three on iPhone-sized screens. Thanks to @3zra47 for the original report and @krzyfu for the follow-up about the button area crowding the editor. - (#1982) Preserved scroll position in TaskNotes Bases after task edits and data refreshes, avoiding jumps back to the top on mobile. Thanks to @3zra47 for reporting. - (#1978) Restored Obsidian editor shortcuts such as insert link, headings, and list toggles inside the Edit Task modal's Details editor. Thanks to @krzyfu for reporting this. `});var LMe,zMe=y(()=>{LMe=`# TaskNotes 4.10.0 ## Added - **New companion plugin:** TaskNotes Workflows adds Markdown-defined automation for TaskNotes tasks, events, schedules, and manual commands. It keeps automation workflows outside TaskNotes core while using the runtime API for safe task reads, writes, queries, events, and relationship resolution. See [TaskNotes Workflows](https://tasknotes.dev/companion-plugins/tasknotes-workflows/). - (#1530) \`Auto-start time tracking\` starts a timer when a task moves into active work. Thanks to @Jendrik0 and @benmartinek for the request and follow-up. - (#222, #184) \`Stop time tracking on complete\` stops active timers when a task is completed. Thanks to @bcohen44 and @cathywu for the requests, and @amarjt for the follow-up. - (#265) \`Stamp started timestamp\` records a custom started timestamp when a task first moves into active work. Thanks to @cathywu, @digitaldoctors, and @Leo310 for the request and discussion. - (#1703) \`Clear scheduled when started\` clears the scheduled date when a task moves into active work. Thanks to @kmaustral for the request. - (#1293) \`Rollover overdue scheduled tasks\` moves incomplete tasks with past scheduled dates back to today. Thanks to @grosserfrank for the request. - (#1896) \`Escalate upcoming due tasks\` raises priority as due dates approach. Thanks to @Neptune-Illusion for the request. - (#214, #518, #1785, #1855) The subtask inheritance workflows can copy parent contexts, tags, priority, planning dates, and dependencies into new subtasks. Thanks to @timfidd, @bepolymathe, @AndyEveritt, @lindsaylearns, @tomsymonds, @wedgen, @poulpoulsen, and @misolex for the related requests and discussion. - (#1166) \`Blocked task review\` provides a reminder-style review for blocked tasks without automatically deleting dependency links. Thanks to @jpmoo and @jortscity for the request and follow-up. - Added a versioned TaskNotes JavaScript runtime API for companion plugins, with namespaced model validation, canonical task query validation/normalization/explain helpers, catalogs, query/support helpers, lifecycle events, typed errors/results, task, time-tracking, Pomodoro, recurring-task, settings, NLP, event, and extension-registry surfaces. Runtime API mutations carry source and correlation metadata so companion plugins can debug and coordinate workflow runs. See [JavaScript API](https://tasknotes.dev/javascript-api/). - Added documentation for the companion-plugin model. See [Companion Plugins](https://tasknotes.dev/companion-plugins/). - (#288, #345, #361, #523, #573, #703, #925, #929, #1115, #1137, #1260, #1303, #1324, #1394, #1445, #1509, #1735, #1736, #1743, #1780, #1874, #1951, #1974) Added support for TaskNotes spec 0.2.0 materialized occurrences, including recurrence parent/date fields, generated mdbase schema roles, parent reconciliation when occurrence notes are completed, occurrence notes that inherit parent planning metadata without copying history, occurrence note controls in task, calendar, and edit-modal completion menus, and visible occurrence identity on task cards. This gives recurring tasks a concrete occurrence-note path for per-instance state, related notes, subtasks, templates, scheduling changes, completion history, and calendar behavior without forcing every recurring task to create files. See [Recurring Tasks](https://tasknotes.dev/features/recurring-tasks/#materialized-occurrence-notes) and [Property Types Reference](https://tasknotes.dev/settings/property-types-reference/#materialized-occurrence-properties). Thanks to @LuxBetancourt, @jerzy-dudzic, @luciolebrillante, @BryanWall, @jhedlund, @kazerniel, @nschenone, @realJohnDoe, @cathywu, @Lorite, @EllenGYY, @JcMinarro, @gsssr, @slipstyle, @3zra47, @Leonard-44, @ak-42, @RumiaKitinari, @atos2212-blip, @kmaustral, @eugenedefox, @notDavid, @zitongcharliedeng, and @Jomo94 for the related recurrence, occurrence, completion, and calendar requests. - (#1951) Added Calendar support for recurring tasks stretched between scheduled and due dates when the existing stretch option is enabled. Date-only ranges stay as all-day spans, and timed ranges render once per day in the range. Thanks to @atos2212-blip for the request. - (#1751, #1792, #1969) Added a Task List and Kanban view option to hide top-level subtasks when their parent task is also in the filtered view, while still allowing inherited expanded relationships to show the subtasks under the parent. Thanks to @Glint-Eye and @Proxybat for the request and follow-up, and @stanley-910 and @Spencerduran for the earlier PRs. ## Changed - Moved core TaskNotes model behavior for field mapping, dates, recurrence, time-tracking, and adapter operation planning into a shared package used by the plugin and companion tooling. - Calendar views now coalesce materialized occurrence notes with their matching virtual recurring instances. Dragging a materialized occurrence reschedules that occurrence note without changing the parent recurrence rule or the note's \`occurrence_date\` identity. See [Recurring Tasks](https://tasknotes.dev/features/recurring-tasks/#calendar-drag-and-drop). - Improved the Calendar Bases View Options menu by splitting settings into clearer groups and hiding view-specific controls until they apply to the selected calendar mode. ## Fixed - (#1976) Fixed embedded Calendar and Agenda Bases so "Navigate to date from property" can use the containing note's date property when the Base rows do not have that property. Thanks to @matesvecenik for reporting this. - (#1977) Fixed Calendar and Agenda views showing duplicate all-day entries when a task's scheduled date and due date are the same day. Timed due dates on the same day still show as separate deadline markers. Thanks to @pdgBC for reporting this. - Fixed the release notes view using cramped interface typography instead of regular reading typography. - (#216) Improved inline conversion for Tasks plugin task lines, including Dataview-style fields, priority markers, recurrence text, date aliases, block links, and safer trailing-field parsing. Thanks to @ksdavidc for the request, @natleahh for the Dataview example, and @hangryscribe3 and @nayatiuh for the discussion. - (#1974) Stopped Calendar and Agenda property-based events from logging date parse errors for entries that do not have the selected date property. Thanks to @Jomo94 for suggesting completed-date Agenda events. - (#1973) Reduced unnecessary Calendar view recreations when external calendar providers are reported in a different order, and preserved Calendar scroll position when a config-driven refresh has to recreate the view. Thanks to @e-zz for reporting this. - (#1972) Fixed ICS calendar event related notes so standalone events with similar numeric IDs no longer show unrelated notes or tasks on every event. Thanks to @ks-studio-net for reporting this. - (#1970) Fixed generated default Base filters so updating default files applies configured excluded folders to TaskNotes task views. Thanks to @henrim01 for reporting that templates could still appear in regenerated views. - (#1968) Fixed inline task link overlays collapsing on Obsidian mobile, which could hide the task title and leave a tall empty gap after the widget. Thanks to @renatomen for reporting and diagnosing the containment issue. `});var jMe,$Me=y(()=>{jMe=`# TaskNotes 4.9.2 ## Added - (#1791) Added collapse and expand controls for grouped Bases Task List views, including a default collapsed state option. - Thanks to @renatomen for the contribution. ## Fixed - Fixed Pomodoro storage migration so existing plugin-data history is written to daily notes before switching storage, and clarified that daily notes can come from either the core Daily Notes plugin or Periodic Notes. - (#1964) Fixed Microsoft Calendar OAuth so connecting no longer forces a fresh consent prompt every time, and clarified the Microsoft desktop app setup steps. - Thanks to @thechonta for reporting. - (#1966) Fixed custom priority icons so they render as icons instead of filled squares on task cards. - Thanks to @sruiz-savia for reporting. - (#1963) Fixed Google Calendar sync so duplicate event ID fields are repaired when saving task calendar metadata. - Thanks to @christenbc for reporting. - (#1961) Fixed the default custom filename template so it uses the recommended double-brace syntax and no longer warns on first use. - Thanks to @chmac for reporting. - (#1962) Fixed task tag normalization so tags entered with spaces are saved with hyphens for Obsidian tag compatibility. - Thanks to @christenbc for reporting. - (#1959) Fixed the MCP \`tasknotes_list_tasks\` tool so circular internal task data and live Obsidian object references no longer break task-list responses. - Thanks to @kmaustral for reporting. - (#1957) Fixed the Pomodoro timer layout in vertically split panes so the timer header and progress circle remain reachable when the pane is short. - Thanks to @sumiyalairu03 for reporting. - (#1956) Fixed Google Calendar sync so completing a recurring task updates the linked event title with the completion checkmark. - Thanks to @jacksoluke for reporting. - (#1953) Fixed inline task conversion so source-line wikilinks no longer create nested wikilinks in the replacement link text. - Thanks to @bgk0018 for reporting. - (#1952) Fixed Pomodoro task picker search results so matching task titles are ranked and sorted ahead of due-date ordering. - Thanks to @KFrancoD for reporting. - (#1392, #1949) Fixed due and scheduled date picker fields so typed or pasted date edits stay open until you choose Select, including compact \`YYYYMMDD\` entry when a date is already set. - Thanks to @kazerniel for reporting and following up. - (#982, #1947) Restored larger mobile task-card typography and let secondary card icons wrap below the task details when they no longer fit comfortably on mobile. - Thanks to @3zra47 for reporting the font-size regression, @chrsdk and @scottaltham-payroc for confirming the mobile font-size issue, and @Jomo94 for reporting the mobile card layout problem. `});var BMe,UMe=y(()=>{BMe=`# TaskNotes 4.9.1 ## Added - (#1885) Added Shift+arrow keyboard range selection while bulk task selection mode is active. - Thanks to @chrabia for suggesting bulk selection improvements and @sumiyalairu03 for the keyboard selection idea. ## Fixed - (#781, #1085) Fixed Outlook-published ICS calendar events appearing at the wrong time when their feed used Windows timezone names without matching timezone definitions. - Thanks to @chrlaney for reporting and @mjkrasny for confirming the Outlook timezone case. - (#1696) Fixed Google Calendar export for scheduled recurring tasks when a single occurrence is moved to a different date. - Keeps the recurring master event on its original rule, excludes the original occurrence date, and syncs the moved occurrence as a detached event. - Thanks to @martin-forge for reporting and contributing the fix. - (#1912) Fixed "Create subtask" inserting the full path of the parent task in the Projects field instead of using the normal Obsidian link text. - Thanks to @pkuehne for reporting and @benmartinek for confirming. - (#1921) Fixed Google Calendar and auto-archive updates not running after direct task file edits. - TaskNotes now picks up status, completion, and date changes made directly in a task file without triggering a large one-time Google Calendar rewrite at startup. - Recovery also removes stale Google Calendar links when task files were deleted or replaced outside TaskNotes. - Thanks to @martin-forge for reporting and contributing the fix. - (#1938) Fixed partial HTTP API task updates rewriting native tags with \`#\` prefixes or duplicate task tags. - Thanks to @joseluisgonzalezdelgado-ctrl for reporting. - (#1939) Fixed the task Details field rendering as a small nested textarea when the embedded editor falls back. - Thanks to @g-arthurvanderbilt for reporting and @cookbr for confirming the desktop impact. - Fixed tag and modal preview edge cases found during validation: double-hash tags no longer match the task tag, empty tag lists stay empty when read back, and natural-language previews remain visible when enabled. - (#1941) Fixed mobile Kanban boards scrolling the whole board vertically instead of keeping each list independently scrollable. - Thanks to @pxxush for reporting. - (#1943) Fixed MCP task-query tool instructions so filter operators match the operators TaskNotes actually accepts. - Thanks to @jordankbartos for reporting and proposing a fix in #1944. - (#1945) Fixed Google Calendar export so overlapping sync services do not create duplicate events for the same task while the saved event ID is still catching up. - Thanks to @martin-forge for reporting and contributing the fix. - (#1946) Fixed the bottom task in virtualized Task List Bases being partially hidden behind Obsidian's mobile bottom bar. - Thanks to @3zra47 for reporting. - (#1947) Fixed mobile Task List cards with left-positioned subtask chevrons so the chevron remains visible and project/detail badges stay on the main row. - Thanks to @Jomo94 for reporting. - (#1948) Fixed Agenda Calendar Bases so completed recurring instances can appear on their recorded completion dates, even when recurring task projections are hidden or the completion date is outside the recurrence pattern. - Thanks to @Jomo94 for reporting. `});var HMe,VMe=y(()=>{HMe=`# TaskNotes 4.9.0 ## Security - (#1923) Restricted the HTTP API server to loopback and limited browser CORS access to loopback origins. - Thanks to @martin-forge for reporting. ## Added - (#1932) Added middle-click support for opening task cards in a new tab. - Thanks to @imsuck for the request. ## Fixed - (#1934) Fixed custom priority colors being overridden by default task-card priority styles in views. - Thanks to @KittehBit for reporting. - (#1933) Added the note path to fallback frontmatter parse warnings so malformed task YAML is easier to find. - Thanks to @rayvermey for reporting. - (#1931) Made the Pomodoro task chooser open from cached task data and ignore repeated clicks while it is already opening. - Thanks to @sumiyalairu03 for reporting. - (#1930) Fixed starting the Pomodoro timer from its hotkey without starting time tracking for the selected Pomodoro task. - Thanks to @sumiyalairu03 for reporting. - (#1929) Fixed the bottom Relationships widget overlapping embedded content such as Bases/Kanban views in task notes. - Thanks to @rchaklashiya for reporting and following up with the embed case. - (#1922) Restored the native color picker alongside manual color text entry in Create/Edit Timeblock fields. - Thanks to @AndreMonthy for reporting. - (#1921) Fixed direct frontmatter edits to lifecycle-relevant task fields not triggering Google Calendar sync or auto-archive side effects. - Thanks to @martin-forge for reporting and verifying the direct-edit reproduction. - (#1919) Fixed the Pomodoro view rapidly resizing at certain sidebar sizes. - Thanks to @RumiaKitinari for reporting. - (#1898, #1907) Fixed Calendar time labels shifting into the middle of Day and sidebar calendar grids after switching views. - Thanks to @ddevaal for reporting and confirming the regression, and to @kmaustral for confirming the sidebar case in 4.8.1. - (#1936) Added a Calendar Base drag/drop resolution option so events can snap to smaller increments than the visible time slot grid. - Thanks to @benmartinek for suggesting this. - Improved mobile task cards, inline widgets, modals, and settings layouts so dense controls and long labels fit more comfortably on small screens. - (#1916) Fixed Markdown task links using Obsidian's generated filename label instead of the TaskNote title in the task link overlay. - Thanks to @minchinweb for reporting. - (#1911) Fixed recurrence choices starting from today instead of the selected calendar date when creating a task from Calendar view. - Thanks to @mikhailmarka for reporting. - (#1912) Fixed "Create subtask" pre-filling the parent task's full folder path in the Projects field instead of using the normal Obsidian link text. - Thanks to @pkuehne for reporting and @benmartinek for confirming. `});var qMe,WMe=y(()=>{qMe=`# TaskNotes 4.8.1 ## Fixed - (#1903) Improved the Edit Task modal on iPhone-sized screens so opening a task no longer automatically focuses the title field, and the mobile layout gives the title, fields, and action buttons more usable space. - Thanks to @3zra47 for reporting the issue and sharing the screen recording. - (#1909) Fixed compact Kanban task cards showing oversized status and priority indicators on touch devices. - Thanks to @pxxush for reporting the issue. - (#1908) Restored newly generated Calendar Bases to show the full day by default and inherit the calendar start/end settings instead of hard-coding 06:00-22:00. - Thanks to @AndreMonthy for the report. - (#1907) Fixed calendar time labels drifting away from the left axis in narrow sidebar calendar views. - Thanks to @kmaustral for reporting the issue. - (#1906) Fixed NLP priority shortcuts leaving partial text in task titles when custom priority values include words like \`high\` or \`low\`. - Thanks to @RumiaKitinari for reporting the issue. - (#1904, #1905) Fixed long tags in task cards wrapping instead of forcing horizontal scrolling in TaskNotes Bases views and note cards. - Long tag pills can now wrap across lines and break within very long tag names on narrow screens. - Thanks to @3zra47 for reporting the issue and to @zhouzhou626 for the contribution. - (#1901) Fixed the task context menu creating an \`undefined\` property when adding or removing tags. - Hardened task property updates so invalid frontmatter property names are rejected instead of written. - Thanks to @mgrecar for reporting the issue. - (#1902) Fixed Markdown-style project links in task frontmatter not appearing as subtasks on project pages. - Thanks to @minchinweb for reporting the issue. ## Changed - Improved the internal structure around service notifications, vault writes, and shared utilities to make future fixes easier to test and maintain. `});var YMe,GMe=y(()=>{YMe=`# TaskNotes 4.8.0 ## Added - (#353) Added a \`Has Subtasks\` filter for task queries, so views and API clients can show only project-style tasks or direct tasks. Thanks to @mdbraber for suggesting this. - (#380) Added a test-reminder button in notification settings, so reminder setup can be checked without creating a real task reminder. Thanks to @mdbraber for suggesting this. - (#711, #168) Added an optional task-creation setting to open the new task note after saving, either in the current tab or a new tab. Thanks to @phortx and @23426356587 for suggesting this, and to @edward-peters and @obsilover for the follow-up. - (#1041, #1800) Added copy-drag support for timeblocks: hold Ctrl, Cmd, or Alt/Option while dragging an existing timeblock to duplicate it at the new date and time. Thanks to @0-BSCode and @cweekly for suggesting this. - (#1052) Added a public JavaScript API for in-vault scripts at \`app.plugins.plugins.tasknotes.api.parseNaturalLanguage(text)\`, so Templater, QuickAdd, and MetaBind workflows can use TaskNotes' natural-language parser without running the HTTP API. Thanks to @edakimling for suggesting this. - (#1235) Added a task-card toggle for blocked tasks, so you can expand a blocked task to see the tasks it is waiting on. Thanks to @craziedde for suggesting this. - (#1254) Added \`../\` and \`./\` normalization for folder templates after variables are expanded, so instant task conversion can target sibling folders such as \`{{currentNotePath}}/../Tasks\`. Thanks to @rdick for suggesting this. - (#1267) Added Daily Notes-style date tokens such as \`YYYY\`, \`MM\`, \`DD\`, \`MMMM\`, and \`dddd\` to TaskNotes folder templates. Thanks to @paulsen-it for suggesting this. - (#1380) Added tag actions to task context menus, including add/remove actions for individual tasks and batch-selected tasks. Thanks to @Chuhtra for suggesting this. - (#1377) Added right-click Mini Calendar actions for opening daily notes from day cells and weekly notes from week numbers. Thanks to @hasanyilmaz for suggesting this. - (#1151) Added a Mini Calendar max color note count option, so one-note days can use the strongest heatmap color when that better fits the view. Thanks to @arreme for suggesting this. - (#1376) Added backslash escapes for NLP trigger tokens, so text like \`\\@context\`, \`\\*done\`, or \`\\tomorrow\` can stay in the task title. Thanks to @JerryLu086 for suggesting this. - (#1366) Added CSS variables for compacting nested task-card indentation, with smaller defaults on mobile and documented snippets for tighter task-link lists. Thanks to @rk-kontur for suggesting this. - (#1502, #603) Added calendar indicators for external events that have linked notes or tasks, and showed loaded event titles in task-card calendar metadata instead of only the linked event count. Thanks to @Robubble and @mdbraber for suggesting this, and to @ubidev for the follow-up. - (#1522) Added a per-status option to skip rarely used statuses when cycling task-card status indicators. Thanks to @Glint-Eye for suggesting this. - (#144) Added an "Open note in new tab" action to the task context menu. Thanks to @cathywu for suggesting this and @macbikegeek for the follow-up feedback. - (#167) Added an optional next-status override for each status, so forward cycling can jump to a configured status instead of always following the status order. Thanks to @DanBrazelton for suggesting this, and to @michelebugio, @Moyf, @anareaty, and @vorrermid for the follow-up feedback. - (#1520) Made tag and context fields show available suggestions as soon as the field is focused. Thanks to @Glint-Eye for suggesting this, and to @craziedde for the follow-up. - (#1541) Added \`{{currentNotePath}}\` and \`{{currentNoteTitle}}\` support to the default tasks folder, so normal task creation can place new tasks beside the active note without creating an inline link. Thanks to @ChristianAnyanwu for suggesting this, and to @abbasou and @ttlaylor for the follow-up feedback. - (#648, #1605) Added clickable links in task-card contexts for note links, markdown links, and web URLs while keeping plain contexts as tag-search buttons. Thanks to @trdischat and @Glint-Eye for suggesting this, and to @renatomen for the follow-up feedback. - (#1482) Added clickable custom-field links on task cards for wikilinks, markdown links, autolinks, and bare web URLs. Thanks to @ptbosch-figueiredorj for suggesting this, and to @Soleone for the follow-up use case. - (#1471) Added Kanban column and swimlane-cell add buttons that open the TaskNotes creation modal with the grouped values already filled in. Thanks to @byheaven for suggesting this and @Davincible for the project-board use case. - (#933) Added non-Markdown vault files such as canvases to project suggestions, using extension-qualified link targets so those files can be selected as task projects. Thanks to @Alvin21Bon for suggesting this. - (#1475, #725) Added quote/backtick escapes for NLP input, so literal course codes or date words can stay in task titles without being parsed as estimates or dates. Thanks to @RumiaKitinari and @gavingwebb for suggesting this. - (#1462) Added natural-language date entry to the task date picker, so existing due and scheduled dates can be changed with phrases such as "tomorrow at 3pm" when NLP is enabled. Thanks to @Ruboks-Cube for suggesting this. - (#1526) Added a native date field to the task date picker, so scheduled and due dates can be changed with the device date picker while keeping optional times visible. Thanks to @jmartinmcfly for suggesting this and @23426356587 for the follow-up feedback. - (#1603) Added Calendar view toggles for hiding completed or skipped recurring task instances while keeping future outstanding instances visible. Thanks to @wandererovertheseaofpiss for suggesting this. - (#287, #273, #274) Added linked hover highlighting for Calendar and Agenda events that come from the same task note, so scheduled, due, and recurring entries are easier to connect. Thanks to @girisumit for suggesting this. - (#280) Added project-specific CSS hooks to task cards and Calendar events, so project-based visual styling can be handled with user snippets. Thanks to @girisumit for suggesting this. - (#1625) Added \`Shift\` + \`Cmd\`/\`Ctrl\` + \`Enter\` in the Create Task modal to save the current task and reopen the modal for the next one. Thanks to @tcb678 for suggesting this. - (#1353) Focused the Create Task modal's natural-language input when the modal opens, with a longer mobile delay so the keyboard can open after layout. Thanks to @GiovanH for suggesting this. - (#1664) Added project-based custom filename template variables, including the first project, all projects, and a short \`projectId\`. Thanks to @bendavis987 for the contribution. - (#923) Added \`{{projectFilePath}}\` and \`{{projectFilePaths}}\` folder template variables, so task folders can mirror project note locations in the vault. Thanks to @PacoTaco2 for suggesting this. - (#1697) Added cached Google Calendar, Microsoft Calendar, and ICS events to Mini Calendar days, with compact colored dots and event details from the existing calendar connection. Thanks to @RPGArchivist for suggesting this. - (#1754) Added optional icons for priority values, so task cards can show a configured priority icon instead of only a colored dot. Thanks to @BrucePlumb for suggesting this and @prepare4robots for the follow-up feedback. - (#1761) Added TaskNotes edit and task-action submenu entries to Obsidian's native file context menu for recognized task notes. Thanks to @delzero for suggesting this. - (#1771) Added mobile drag handles to manually sorted Task List Bases views, so dragging can start from the handle without disabling normal text interaction on the rest of the card. Thanks to @PatrickGolz for suggesting this. - (#1776) Allowed calendar timeline end times after midnight, such as \`26:00\` for a 2 AM next-day end. Thanks to @chrabia for suggesting this. - (#1784, #1833) Added a per-view \`pinnedColumns\` option for TaskNotes Kanban views, so selected empty columns can stay visible as drop targets while other empty columns remain hidden. Thanks to @loukandr for suggesting and prototyping this. - (#1794) Added context updates to the task card context menu, so contexts can be added, toggled, or cleared without opening the task edit modal. Thanks to @m13ntrpn for suggesting this. - (#315, #1356, #1748, #1809) Added a subtle task-card indicator and CSS hooks for tasks with note body details, including existing task bodies read through Obsidian's metadata cache. Thanks to @volodxyz, @Karut, @yeHHH1g, and @aliceinwaterdeep for suggesting this, and to @minchinweb for the follow-up. - (#1808) Added advanced Kanban swimlane ordering through \`swimLaneOrder\`, so swimlane rows can stay in a stable configured order. Thanks to @rookledookle for suggesting this, and to @benmartinek and @chrabia for the follow-up feedback. - (#1805) Added an ICS export option to omit completed tasks from generated calendar files. Thanks to @bepolymathe for suggesting this. - (#659) Added Obsidian links to ICS export descriptions, so exported calendar events can open their source task notes. Thanks to @bepolymathe for suggesting this. - (#589) Added an Appearance toggle to turn off strikethrough styling on completed task card titles. Thanks to @BrucePlumb for suggesting this. - (#561) Added a "Last day" option to the custom recurrence month-day picker for month-end repeating tasks. Thanks to @TonyAtlas for suggesting this and @BrucePlumb for the follow-up. - (#217) Added weekday selection to daily custom recurrence rules, so interval rules such as every three days can skip weekends from the recurrence modal. Thanks to @kmaustral for suggesting this. - (#1818) Added an auto-height mode for TaskNotes Calendar Bases views so embedded agenda/list sections can size to their content instead of forcing an inner scroller. Thanks to @martin-forge for suggesting this. - (#1201) Added a Calendar Bases toggle to hide the hourly breakdown in week, custom-days, and day views while keeping the all-day planning row visible. Thanks to @PacoTaco2 for suggesting this. - (#1176) Added advanced Kanban WIP limits through \`wipLimits\`, so column headers can show \`(current/limit)\` counts and highlight exceeded limits. Thanks to @williamcheuk03 for suggesting this. - (#914) Added a generated \`Due in\` countdown to the default Agenda Base and allowed Calendar Bases list agendas to span up to 365 days. Thanks to @williamcheuk03 for suggesting this. - (#900) Added an instant-conversion setting to keep the original Markdown checkbox marker when converting a checkbox into a TaskNote link. Thanks to @dsebastien for suggesting this. - (#898) Added a mobile-only calendar integration opt-out, so synced desktop calendar settings no longer have to trigger external calendar loading on Obsidian Mobile. Thanks to @cathywu for suggesting this. - (#887) Added built-in scheduled and due date presets to the Quick actions palette for current tasks. Thanks to @willgraham345 for suggesting this and @anrie for the related preset feedback. - (#819) Added a command to open Quick actions for the inline task link under the cursor. Thanks to @rlolingo for suggesting this. - (#798, #1732, #1835) Added hotkeyable commands to edit the current task, add a project to the current task, and add an existing task as a subtask of the current note. Thanks to @xorander00 and @prepare4robots for requesting this, and to @musta-code and @ubidev for the follow-up suggestions. - (#791) Added a UUID v4 task filename format and \`{{uuid}}\` custom filename template variable. Thanks to @bangbangbanggit for suggesting this. - (#932) Added hotkeyable commands to cycle the current task's status and priority. Thanks to @rxunique for suggesting this and @luckb0x for the follow-up feedback. - (#1655) Added live elapsed time to the optional active time tracking status bar item. Thanks to @connradolisboa for suggesting this. - (#1622) Allowed multiple comma-separated default reminder offsets for timed Google Calendar task exports. Thanks to @solidabstract for suggesting this. - (#706, #820, #1040) Added direct Pomodoro duration editing, hour-aware timer formatting, clearer one-minute controls, and an optional active Pomodoro status bar countdown. Thanks to @SublunarSage, @lj1446615403-cloud, @0-BSCode, and @thestrike72 for the suggestions and feedback. - (#873) Added an optional built-in sound for task reminder notifications, with volume and preview controls in Settings. Thanks to @berzernberg for suggesting this. - Added a generated Pomodoro statistics Base with daily and monthly summary views for Pomodoro history stored in daily notes. ## Changed - Expanded the bug report template to ask for Obsidian "Show debug info" output, affected task frontmatter, relevant Bases file contents, reproduction steps, and related logs or screenshots. - Release notes now show the default \`.base\` file regeneration reminder only on the current version section, keeping older bundled sections focused on their own changes. - Updated the release notes GitHub prompt to invite feedback while still asking satisfied users to star the project. - (#239) Ordered Kanban status and priority columns by the configured status order and priority weights when no manual column order is saved. Thanks to @ScumbagScalawag for asking about this, and to @nightroman, @lavir, and @elvarb for the follow-up discussion. - (#269) Marked Kanban status columns that come from values outside the configured TaskNotes statuses, so manually edited or external status values are visible as non-standard instead of blending into the board. Thanks to @cstelmach for suggesting this and @digitaldoctors for the follow-up. - Refined Kanban empty columns, swimlane rows, and column drag handles, and added a per-view compact card layout option for denser boards. - Kept Kanban swimlane rows from shrinking to share the viewport so the Max Swimlane Height setting is respected. - Added guidance in Pomodoro statistics and Base file settings explaining that Pomodoro Base views require daily notes storage. - (#323) Reordered task modal action buttons to match the right-click task menu order. Thanks to @23426356587 for suggesting this. - (#1189) Made the Create/Edit Task modal priority picker follow the priority order configured in Settings. Thanks to @n1njaznutz for suggesting this. - Made task-card priority dots and configured priority icons slightly larger for better visibility. - (#1244) Clarified the Task Properties documentation for custom property keys and status values in Bases filters and sorting. Thanks to @Arachnidai for suggesting this. - (#1234) Kept right-aligned subtask chevrons visible on task cards instead of only showing them on hover. Thanks to @n1njaznutz for suggesting this. - (#1237) Made today's date more visible in the Mini Calendar view when another day is selected. Thanks to @riekusr for suggesting this. - (#1348) Let long task titles wrap inside the Create/Edit Task modal title field while keeping saved titles single-line, and widened the contexts and tags fields in the modal details area. Thanks to @hasanyilmaz for suggesting this. - (#1392) Made TaskNotes date fields accept compact \`YYYYMMDD\` typing and pasted dates. Thanks to @kazerniel for suggesting this. - (#1431) Showed the year on task-card due and scheduled dates when the date is outside the current year. Thanks to @kazerniel for suggesting this. - (#1429) Opened TaskNotes view commands in a new tab when they load configured Base files, so they do not replace the active note. Thanks to @Ruboks-Cube for suggesting this. - (#1426) Added copy actions for TaskNotes Bases views, including current-view filenames, links, and titles from the result count menu, plus selected-task copy actions in the batch menu, while keeping the native Bases copy and CSV export actions available. Thanks to @kmaustral for suggesting this. - Improved keyboard access, mobile layout, and theme color consistency across task cards, TaskNotes Kanban, Bases Kanban, calendar controls, stats, settings, and filter popovers. - (#1526) Made the Create/Edit Task modal due and scheduled date buttons open a calendar-first picker where clicking a date saves immediately, with time entry still available in the picker. Thanks to @jmartinmcfly for suggesting this and @23426356587 for the follow-up feedback. - (#1642) Made completion-based custom recurrence use flexible weekly, monthly, and yearly intervals without forcing a fixed weekday, month day, or month. Thanks to @Volker-brdb for suggesting this. - (#1724) Moved recurring task complete/skip instance actions into the date area of the task context menu. Thanks to @prepare4robots for suggesting this. - (#1762) Used the configured Google Calendar task export target as the default calendar when creating manual external calendar events. Thanks to @chrabia for suggesting this. - (#1774) Made expandable project chevrons visible and easier to tap on mobile. Thanks to @sh0nuff for suggesting this. - (#190) Made task-card and inline task-link action controls easier to tap on mobile, including always-visible task options on touch layouts. Thanks to @Poly-0000 for suggesting this. - (#518, #1710, #1785) Added an opt-in setting for Create subtask to inherit the parent task's projects, contexts, priority, and non-identifying tags while always keeping the parent-task project link. Thanks to @bepolymathe, @Jalpara, and @poulpoulsen for reporting this, and to @tomsymonds, @AndyEveritt, @wedgen, @lindsaylearns, and @hokfujow for the follow-up feedback. - (#1790) Extended the identifying-tag hiding setting to task modal tag suggestions, and kept hidden identifying tag children in place when editing other tags. Thanks to @loukandr for suggesting this. - (#1804) Made the inline-created task folder setting visible even when instant conversion is disabled, and clarified that leaving it empty uses the default tasks folder. Thanks to @CaFeZn for suggesting this. - (#1822) Matched the Task Edit Modal subtask list order to the existing relationship sort, so active and higher-priority subtasks appear ahead of completed ones. Thanks to @Glint-Eye for suggesting this. - (#1233, #1339) Added an Appearance setting to expand project subtasks by default in task cards, while still letting individual cards be collapsed. Thanks to @n1njaznutz and @hasanyilmaz for suggesting this and @kazerniel and @benmartinek for the follow-up. - (#763) Made the Relationships widget appear on project notes that match Project Autosuggest tag or property filters, even before any tasks link to the project. Thanks to @ChadHattabaugh for suggesting this. - (#732) Remembered the Task & Project Statistics filters between openings, including the selected date range, custom dates, and minimum time filter. Thanks to @RumiaKitinari for suggesting this. - (#1335) Added optional default times for new task scheduled and due dates, so default-dated tasks can appear as timed calendar events instead of all-day events. Thanks to @echo-saurav for suggesting this. - (#1327) Made TaskNotes Bases search match any word in a multi-word search instead of requiring the whole phrase. Thanks to @craziedde for suggesting this. - (#1318) Made aliased inline task links use the alias text inside the task widget, so \`[[Task title|short label]]\` can display as \`short label\`. Thanks to @3zra47 for suggesting this and @kazerniel for the follow-up. - (#1325) Added \`./\` and \`../\` support to Include folders filters for project and file autosuggest, resolved from the active note's folder. Thanks to @EpolPers for suggesting this. - (#1313) Added generated \`llms.txt\` and \`llms-full.txt\` files to the documentation site, so the primary docs can be shared with LLM tools more easily. Thanks to @JacksonMcDonaldDev for suggesting this. - (#1308) Added a Calendar view option to stop date links from creating missing daily notes, while still opening existing daily notes. Thanks to @Arachnidai for suggesting this. - (#1300) Allowed priority, status, calendar subscription, and timeblock color settings to use Obsidian theme color names such as \`red\`, \`blue\`, and \`cyan\`. Thanks to @thestrike72 for suggesting this. - (#1299) Added a command that creates or opens a task and immediately starts time tracking for it. Thanks to @slipstyle for suggesting this. - (#1284) Added an exact-match option for hiding task identification tags, so \`#task\` can be hidden while nested tags such as \`#task/project\` remain visible. Thanks to @3zra47 for suggesting this. - (#1009) Added a confirmed Delete button to the Edit Task modal, so unwanted task notes can be removed without first opening the note file. Thanks to @jalooc for suggesting this. - Improved the internal structure of Calendar, Kanban, Bases, task cards, and task modals to make future changes easier to test and maintain. ## Fixed - (#697, #1374) Recognized manually authored task notes that use a single scalar tag such as \`tags: task\`, so they appear in TaskNotes views and menus like notes using YAML list tags. Thanks to @aubreyz and @phortx for reporting this, and to @jleewastaken for the follow-up. - Removed the upward hover shift from calendar events while keeping the hover shadow feedback. - Made same-column manual-order drops in TaskNotes Kanban settle immediately when the local order patch is safe, including virtual columns through a stable reorder path that avoids layout jumps. - Made single-card cross-column drops in TaskNotes Kanban settle through a local state patch when the move is safe, reducing the wait for the full Bases refresh. - Fixed Calendar timeblocks created from a selected time range so they appear as soon as Obsidian indexes the daily note update, instead of waiting for a later refresh. - Replaced the external calendar event emoji marker with the calendar icon and kept it in the same top-right event corner. - Restored Task List group toggles and recurring calendar month controls to compact icon buttons instead of inherited boxed theme buttons. - Refined the settings tab navigation styling so tabs read as quieter inline navigation instead of default buttons. - (#263) Made the instant inline task conversion button respond to touch/pointer activation, so mobile multi-line selections can be converted into TaskNotes. Thanks to @cathywu for reporting this. - (#216) Preserved \`@context\` markers when converting Tasks-plugin-style checkbox tasks into TaskNotes, while keeping those contexts out of the created task title. Thanks to @ksdavidc for suggesting this, and to @hangryscribe3, @nayatiuh, and @natleahh for the follow-up feedback. - (#508) Showed project note names instead of full project paths in grouped Kanban and Task List headings, while keeping the headings linked to the project note. Thanks to @elvarb for reporting this and @dmodify for confirming it in Task List. - (#408) Used the task title as the native system notification title for task reminders instead of always showing \`TaskNotes Reminder\`. Thanks to @DudeThatsErin for reporting this and @phillipadsmith for the follow-up. - (#385) Let Mini Calendar month controls shrink and wrap cleanly in narrow sidebars. Thanks to @iholston for reporting this. - Fixed Calendar List view task cards so they use the available row width without duplicate list cells, row-hover backgrounds, or linked-hover styling. - (#552) Made instant task convert buttons appear for checkbox tasks inside callouts, and kept converted links inside the callout list. Thanks to @Oblique82 for reporting this and @ksdavidc for the follow-up. - (#559) Treated notes linked to one loaded recurring calendar event instance as related to the other instances in that series. Thanks to @cathywu for reporting this and @mdbraber for the implementation notes. - (#685) Made Calendar list views respect the All-day slot option by hiding all-day events from the list when that option is turned off. Thanks to @RumiaKitinari for reporting this. - (#643) Stopped custom filename templates such as \`task-{year}{month}{day}{hour}{minute}\` from incorrectly showing the "filename shortened" notice when creating tasks. Thanks to @minchinweb for reporting this. - (#722) Made Skip Break reset a queued Pomodoro break back to the next focus timer without starting a session. Thanks to @Goossiii for reporting this and @YIRU69 for the follow-up. - (#782) Made recurrence weekday choices follow the configured first day of week, and made the quick "Weekdays only" recurrence use locale weekend data instead of assuming Monday through Friday everywhere. Thanks to @BKSalman for reporting this. - (#872) Made note-level task cards appear immediately, and stay visible while editing, when a task note is embedded as a Canvas file node. Thanks to @bangbangbanggit for reporting this and @benmartinek for the follow-up. - (#856) Fixed filters for number custom fields so numeric task values match equivalent filter values entered as text. Thanks to @thoughtcipher for reporting this. - (#1039) Restored clearer TaskNotes Bases grouping for nested project paths, and made the Calendar refresh control an icon button again. Thanks to @dblinnikov for reporting this. - (#1034) Let embedded TaskNotes Calendar views size to their content by default, so month, week, and day embeds no longer reserve full-pane proportions inside notes. Thanks to @same774 for reporting this. - (#1023) Kept task modal custom fields scrollable above the iPhone keyboard while creating or editing tasks. Thanks to @3zra47 for reporting this. - (#1019) Kept active Pomodoro and time-tracking task references working after the tracked task file is renamed. Thanks to @AndreMonthy for reporting this. - (#1037) Let embedded TaskNotes Calendar year views size to their content and kept the year title from wrapping vertically. Thanks to @same774 for reporting this. - (#1047) Wrapped long file paths in the Edit Task modal metadata section, so narrow mobile screens no longer get a sideways scrollbar from the File row. Thanks to @3zra47 for reporting this. - (#1051) Preserved extra values on a property-based task identification field when saving a task, so list properties such as \`class: [task, habit]\` no longer get collapsed to only the identifying value. Thanks to @WhoIsSeanGalt for reporting this. - (#1060) Reused and revealed an already-open Calendar/Base view when running view commands, so a view kept in the sidebar no longer reopens in a new main tab. Thanks to @kmaustral for reporting this. - (#1075) Hid the native WebKit date-input label that could appear as \`Label\` when editing scheduled dates on macOS. Thanks to @3zra47 for reporting this. - (#1076) Allowed timeblocks to end at midnight using \`00:00\`, and accepted \`24:00\` as an explicit end-of-day value in timeblock validation. Thanks to @skoove for reporting this and @gregor202 for the follow-up. - (#1086) Fixed the Calendar \`+ more\` control in dark mode so expanded all-day task groups stay readable. Thanks to @same774 for reporting this. - (#1100) Applied Advanced Calendar View search and title filters to the tasks used for calendar rendering, so filtering controls affect which tasks appear on the calendar. Thanks to @quiet-coder-io for reporting this. - (#1147) Added a delete action for recent Pomodoro statistics sessions, so erroneous Pomodoro history can be removed without editing plugin storage or daily-note frontmatter manually. Thanks to @RumiaKitinari for reporting this and @BrucePlumb for the follow-up. - (#1150) Kept recurring tasks' due dates visible in Calendar Bases views, and showed their scheduled date when recurrence instances are hidden. Thanks to @thomatino for reporting this and @BrucePlumb for the follow-up. - (#1159) Softened Calendar time-entry styling so recorded time blocks no longer visually outweigh task events. Thanks to @hatespinach for reporting this. - (#1191) Aligned the task-card and relationships widgets inside notes with Obsidian's editor margins, including readable-line-width layouts. Thanks to @minchinweb for reporting this. - (#1183) Kept the Calendar create menu open after drag-selecting a time range, so the selected duration can be used when creating a task. Thanks to @randomness42 for reporting this. - (#1179) Stopped Calendar Bases views from repainting after unrelated note updates when the visible calendar data has not changed. Thanks to @same774 for reporting this. - (#1156) Kept property-based task identification through the \`tags\` property from rewriting task tags as a plain text value, and generated default Bases now use tag membership for that setting. Thanks to @seepage87 for the detailed migration report and @chrsdk for the follow-up. - (#1232) Fixed generated Task List Base date filters so recurring tasks scheduled for today appear in the Today view, and today's completed recurring instances stay hidden. Thanks to @mvichosfm for reporting this and @ArthurGideon and @VarunNikam22 for the follow-up. - (#1231) Fixed the generated Task List Base Overdue view so tasks with scheduled dates in the past appear alongside tasks with due dates in the past. Thanks to @Lorite for reporting this and @dictionarymouse for the follow-up. - (#1228) Matched the task details editor's Markdown heading colors to the active Obsidian theme, including themes that customize heading colors. Thanks to @BrucePlumb for requesting this. - (#1227) Refreshed the relationships widget when project references are indexed or updated so project notes can show related tasks automatically again. Thanks to @luckb0x for reporting this. - (#1219) Fixed Kanban drags that start on an expanded subtask card so they move that subtask instead of dragging the parent card. Thanks to @craziedde for reporting this. - (#990) Treated one-item status lists written by Obsidian Properties as the same status value in TaskNotes Kanban, so they no longer create duplicate columns. Thanks to @mlevison for reporting this. - (#983) Let Agenda Calendar views wrap their header controls and task titles inside narrow sidebars, so Today and refresh controls and task icons remain visible without sideways scrolling. Thanks to @3zra47 for reporting this. - (#982) Made TaskNotes task-card typography scale from Obsidian's text font size setting, so Bases and Agenda task text follows larger mobile font settings. Thanks to @3zra47 for suggesting this and @chrsdk and @scottaltham-payroc for the follow-up. - (#966) Made reminder delete buttons larger and always visible on mobile, so reminders can be removed from the Manage All Reminders modal on iPad. Thanks to @PSG2017 for reporting this. - (#964) Made Pomodoro and time-tracking task selection use the current recurring instance status, so a recurring task can still be selected after an earlier instance was completed. Thanks to @lomarcanys for reporting this. - (#944) Preserved number and boolean custom field values when moving tasks between grouped Kanban or Task List columns, and when creating a task from a grouped Kanban column. Thanks to @thoughtcipher for reporting this. - (#935) Fixed Task List priority sorting so descending order puts higher-weighted priorities first, and due dates are used before scheduled dates when priority values tie. Thanks to @Glint-Eye for reporting this and @kacoroski for the follow-up. - (#922) Made the \`Blocked\` task-card pill expand the blocker tasks, and rendered \`blockedBy\` dependencies as clickable links when that property is shown on cards. Thanks to @prayidae for reporting this and following up. - (#919) Fixed exported ICS task events so they use valid calendar event statuses and can be imported by stricter calendar apps. Thanks to @benoitjadinon for reporting this. - (#1213) Fixed embedded Task List Bases in Obsidian pop-out windows so typing below the embed no longer leaves a large blank gap. Thanks to @same774 for reporting this. - (#1243) Removed quoted multi-word custom field NLP expressions from created task titles after saving the custom field value. Thanks to @Arachnidai for reporting this. - (#1252) Hardened the calendar-first task date picker for iPad taps so date buttons use direct touch manipulation. Thanks to @alxandrharris for reporting this. - (#1261) Removed the extra Task List Base scrollbar when an embedded task list note is placed in a sidebar, while keeping normal embedded task lists scrollable in the main note area. Thanks to @cathywu for reporting this. - (#1347) Lowered TaskNotes task-card tag CSS specificity so hierarchical tag colors from Obsidian themes and tag-color plugins can apply correctly. Thanks to @3Fish for reporting this. - (#1374) Recognized status and priority labels entered through Obsidian Properties or Bases as their configured TaskNotes values. Thanks to @phortx for reporting this. - (#1373) Parsed numeric natural-language dates with the configured calendar locale, so \`en-GB\` treats \`11/06/2026\` as 11 June instead of November 6, and \`YYYY/MM/DD\` works consistently. Thanks to @AleMunin for reporting this and @imsuck for the follow-up. - (#1370) Prevented recurring task series from being queued for auto-archive when their parent status uses auto-archive, so ongoing recurring tasks are not moved away after completing an occurrence. Thanks to @Jomo94 for reporting this and @martin-forge for the follow-up discussion. - (#1367) Made recurring task completion counts use the total expected instances for finite \`COUNT\` or \`UNTIL\` recurrences, and stopped showing a made-up percentage for unbounded recurrences. Thanks to @saurinni for reporting this. - (#1365) Preserved email and other URI links from converted inline task titles by moving the original links into the new task body, and rendered \`message:\`/\`mailto:\` markdown links as external links in TaskNotes surfaces. Thanks to @phillipadsmith for reporting this and @hasanyilmaz for the follow-up. - (#1350) Refreshed inline task widgets in Reading mode after task property edits, so changed dates and other visible properties no longer stay stale until the note is reopened. Thanks to @tmsbn for reporting this. - (#1329) Pulled the relationships widget up to the end of the note content without removing its normal spacing, and kept that placement updated while editing and on load so it no longer covers the editor. Thanks to @Volker-brdb for reporting this. - (#1326) Treated empty task frontmatter values as missing, so empty titles fall back to the filename and blank date, priority, and recurrence fields are ignored. Thanks to @craziedde for suggesting this. - (#1316) Stopped stale Workspace state from overriding the configured Calendar view mode, so switching Workspaces no longer forces an old Day/Week/List choice over the view default. Thanks to @kmaustral for reporting this and following up. - (#1302) Read task frontmatter directly from the task file when Obsidian has not indexed its metadata yet, so visible tasks can still be opened, updated, and selected instead of reporting "Task not found". Thanks to @WorldTeacher for reporting this and @Steven-AA for confirming it. - Kept just-written task data available while Obsidian's metadata cache catches up, so immediate reads after task edits no longer briefly return stale values. - (#1297) Made the Create or open task footer tappable, so mobile users can create the typed task without needing the Shift+Enter shortcut. Thanks to @slipstyle for reporting this. - (#1288) Allowed formula properties to appear in Calendar property-based event start and end date selectors. Thanks to @hasanyilmaz for reporting this. - Made TaskNotes Kanban drags show a lightweight held-card preview, so the dragged card remains easy to track while the source column opens the drop slot. - (#1423) Refreshed TaskNotes Bases views when subtasks are deleted, so expanded project cards drop removed subtasks and stop showing project controls when the last subtask is gone. Thanks to @normenmueller for reporting this. - (#1419) Kept custom user field name, key, and default-value edits in Task Properties settings when closing settings without first blurring the field. Thanks to @s33a for reporting this and @kacoroski for the follow-up. - Reduced redundant settings writes by coalescing overlapping saves, so settings changes made in quick succession finish with the latest values without repeating every intermediate save cycle. - (#1331, #1411) Made Agenda Calendar Bases respect the Base sort order within each day instead of falling back to alphabetical title order. Thanks to @bane73 and @ky1ejs for reporting this. - (#1383) Made task modal markdown editors expose the active editor API expected by plugins such as Templater. Thanks to @tomsymonds for reporting this. - Fixed the first-run Create/Edit Task modal so the default fields appear immediately after installing TaskNotes, without needing to open Modal Fields settings or restart Obsidian. - (#1895) Restored the natural-language preview in the Create Task modal. Thanks to @ssonhub for reporting this. - (#1898) Cleared stale Calendar time-axis column widths when switching views, so Day, Week, and 3-day views keep the time labels anchored on the left. Thanks to @ddevaal for reporting this. - (#1439) Fixed generated Bases dependency filters so \`blockedBy\` entries stored as links, strings, or dependency objects are handled consistently in Not Blocked and Relationships views. Thanks to @prayidae for reporting this and following up. - (#1435) Prevented malformed task dependency, status, or priority values from breaking the task context menu. Thanks to @23maverick23 for reporting this. - (#1434) Kept older filename-titled tasks readable after turning off "Store title in filename" by falling back to the filename when a task has no usable title property. Thanks to @hujuDev for reporting this. - (#1433) Made the Due date and Scheduled date weekday picker follow the configured first day of week. Thanks to @sandchipper for reporting this. - (#1430) Showed custom user-field property keys in Modal Fields settings instead of internal field IDs. Thanks to @JerryLu086 for reporting this. - (#1427) Fixed project autosuggest Required Tags filters so frontmatter tags parsed by Obsidian are handled the same way as direct tag-property filters. Thanks to @ProHaller for reporting this. - (#1495) Added an Update default files action for generated Bases views, so task-tag or task-identification setting changes can refresh existing \`.base\` filters without deleting files manually. Thanks to @Liya430 for reporting this. - (#1512) Prevented the split Create/Edit Task modal details pane from collapsing to a one-character-wide column under the Minimal theme. Thanks to @willfanguy for reporting this and sharing detailed CSS notes. - (#1524) Fixed task-card font sizes shrinking when a Bases view is opened in an Obsidian pop-out window. Thanks to @Glint-Eye for reporting this. - (#1535) Fixed the generated Relationships Base Subtasks filter so single project links do not trigger a Bases \`contains\` error. Thanks to @DanaKyle for reporting this. - (#1102) Refreshed task cards when a task status is edited directly in Obsidian frontmatter, so the card no longer stays on the old status until it is clicked. Thanks to @Wayment9504 for reporting this. - (#1105) Added an explicit Close action to the mobile task options menu, so iPhone users do not need to tap near the top system bar to dismiss it. Thanks to @J-R-Troutman for reporting this. - (#1550) Prevented mobile Calendar event drags from opening the task context menu before the drag can begin. Thanks to @stil-sudo for suggesting this. - (#1563) Removed duplicate entries from Calendar event related notes when the same linked file is also a TaskNote. Thanks to @VarunNikam22 for reporting this. - (#1566) Rendered grouped multi-project values as individual links when a Bases group title contains multiple project links. Thanks to @ptsouchlos for suggesting this. - (#1569) Allowed local ICS calendar paths inside the vault to be pasted as absolute filesystem paths, and showed a clearer error when the file is outside the vault. Thanks to @Photon89 for reporting this and following up. - (#1584) Sanitized task-card status and priority class names, so custom values with spaces no longer create invalid CSS classes. Thanks to @omber for reporting this. - (#1587) Stored dependencies added from the task context menu as wikilinks, matching the Edit Task modal. Thanks to @mgrecar for reporting this. - (#1590) Clarified HTTP API task creation docs and OpenAPI schema for writable \`blockedBy\` dependencies, and marked \`blocking\` as a read-only derived relationship. Thanks to @hGriff0n for reporting this. - (#1591) Added a startup guard that avoids saving default settings over an existing settings file if Obsidian temporarily returns no plugin data during an update. Thanks to @GGlider for reporting this. - (#1593) Made the New button in TaskNotes Bases views open the TaskNotes create task modal again, so new tasks respect the configured default tasks folder. Thanks to @katlandreth for reporting this. - (#1594) Made task cards inside recurring task notes complete the task's current scheduled occurrence instead of today's date when no calendar or view date is supplied. Thanks to @ngraham20 for reporting this. - (#1601) Prevented overlapping Live Preview relationship-widget injections from leaving duplicate subtask/relationship sections in a note. Thanks to @wealthychef1 for reporting this and @benmartinek for confirming it. - (#1610) Made expanded subtasks in TaskNotes Bases views follow the current view's sorted task order instead of a fixed fallback order. Thanks to @MrZzard for reporting this and @slipstyle for confirming it. - (#1609) Restored scrolling in wide split-layout task edit modals when the form content is taller than the modal. Thanks to @3zra47 for reporting this. - (#1614) Wrote unchecked boolean custom user-field defaults to new task frontmatter, including tasks created through instant conversion. Thanks to @kobalteule for reporting this. - (#1611) Made generated default Bases urgency scores fall back safely when the next-date distance is missing. Thanks to @benoitjadinon for reporting this and suggesting the formula fix. - (#1623) Honored "Store title in filename" across task creation and edits, so the mapped title property is omitted from frontmatter and stale title fields are removed on save. Thanks to @VenturaNotes for reporting this, and to @Ender367, @slipstyle, and @loukandr for confirming and tracing affected paths. - (#1621) Made Kanban swimlane labels stop freezing on mobile and kept their label column compact, leaving more room for task cards while horizontally scrolling. Thanks to @karenchoe428 for reporting this. - (#1615) Detected Obsidian custom multi-text properties exposed through \`widget: "multitext"\` as list properties, so Kanban can split those values into multiple columns. Thanks to @konton71 for reporting this. - (#1626) Expanded recurring ICS subscription events through the one-year subscription window for high-frequency recurring calendars. Thanks to @pib for reporting this. - (#1628) Refreshed Calendar Bases views promptly when switching between filtered Agenda views, so the previous view's task set does not stay visible until the delayed refresh. Thanks to @Lanalangz for reporting this. - (#1629) Saved \`blockedBy\` dependencies selected in the Create Task modal. Thanks to @obsilover for reporting this. - (#1634) Aligned custom status icons in inline tasks with the default inline status circle. Thanks to @ttlaylor for reporting this and @basbarten for confirming it. - (#1636) Restored the active styling for the Calendar list-view toolbar button. Thanks to @vroablec for reporting this. - (#1493, #1638) Kept task time tracking consistent when switching or clearing tasks during an active Pomodoro. Thanks to @ROS-SDN and @katonapng for reporting this, and to @anomatomato for confirming it. - (#1639) Respected the aliased-link overlay exclusion in Reading mode even when the alias text matches the task title. Thanks to @MiracleXYZ for reporting this. - Fixed actively tracked task cards so the blue time-tracking outline stays visible along the card edges. - (#1657) Preserved Bases view defaults when creating tasks from the TaskNotes Kanban/List view New button, so project-scoped views can pass their project assignment into the create task modal. Thanks to @casualQuads122 for reporting this. - (#728, #1831) Preserved frontmatter defaults supplied by Obsidian's Bases New action when opening the TaskNotes create task modal from custom Bases views, so filtered views can prefill matching tags, projects, contexts, and custom fields. Thanks to @DillPickle80 and @echo-saurav for suggesting this, and to @prayidae and @renatomen for the detailed follow-up. - (#726) Added an instant-conversion option to use the closest heading above the converted line as a project, so checkbox tasks under project headings can inherit that project automatically. Thanks to @ghelton for suggesting this. - (#1662) Preserved frontmatter from ICS event note templates when quoted event variables or Templater expressions are used. Thanks to @victorhg for reporting this. - (#1663) Fixed Japanese and other Unicode tags on task cards so Kanban tag pills keep the same rounded styling as ASCII tags. Thanks to @kutty-1119 for reporting this. - (#1649) Restored daily-note navigation from the Calendar Day view date header. Thanks to @BaccanoMob for reporting this. - (#1648, #1665) Fixed the API endpoint list in Integrations settings so it uses the configured bearer token when API authentication is enabled, instead of reporting the running local server as inaccessible. Thanks to @npondel and @warm-july for reporting this. - (#1668) Fixed the Create Task magic wand so NLP-triggered custom field values are copied into the custom property inputs before saving. Thanks to @hokfujow for reporting this. - (#1669) Stopped the startup settings migration check from rewriting \`data.json\` just because saved calendar defaults are \`false\`, \`0\`, empty, or \`null\`, reducing unnecessary sync churn. Thanks to @thehyperadvisor for reporting this. - (#1674) Improved the timeblock creation error when Daily Notes cannot read its configured folder, so the modal notice points to the Daily Notes core plugin settings instead of only logging the folder lookup failure. Thanks to @Ender367 for reporting this. - (#1680) Fixed TaskNotes Calendar Bases options stored under \`options\`, so Agenda views respect \`showPropertyBasedEvents: false\` and no longer show duplicate property-based rows for the same task. Thanks to @xiaoyaozhu1991 for reporting this and @KondrotM for confirming it. - (#1681) Reduced the cost of inline checkbox convert buttons by only scanning the visible editor range instead of the full document. Thanks to @en-ot for reporting this and @hokfujow for the follow-up. - (#1689) Fixed task reminders added or rescheduled through direct frontmatter edits so the notification queue refreshes immediately and relative reminders recalculate from the latest task dates. Thanks to @garzonjav for reporting this. - (#1693) Fixed generated default Bases formulas so empty due and scheduled dates are checked with \`.isEmpty()\` instead of date-field truthiness. Thanks to @benoitjadinon for reporting this. - (#1702) Removed the forced bottom gap under TaskNotes custom Bases views, so calendar and other TaskNotes views can fill the available pane height. Thanks to @AudreyLooby for reporting this. - (#1719) Fixed task cards in reading mode so Obsidian 1.12.x header changes no longer place the card above the title and properties or drop it after returning to a tab. Thanks to @tholbrook9 for reporting this and tracing the DOM change. - (#1722) Saved the source note immediately after converting an inline checkbox task to a TaskNote, so Kanban views do not keep showing the stale inline task alongside the new task file. Thanks to @literallydope for reporting this and sharing screenshots. - (#1750) Fixed generated default Bases filters for property-based task identification when the identifying property name contains spaces. Thanks to @Igorgro for reporting this. - (#1745) Clarified the inline task documentation so \`Create new inline task\` is distinguished from current-line conversion. Thanks to @yvos for reporting the mismatch. - (#1485) Stopped Google Calendar manual refresh from showing a success notice after token refresh or calendar-list failures. Thanks to @ebanDev for reporting this. - (#1474) Made priority-based Kanban swimlanes follow the configured priority order instead of alphabetical task data order. Thanks to @kanzaki1201 for reporting this and @SoTHISIsFitness for the follow-up investigation. - (#1470) Restored pointer cursors on TaskNotes interactive elements under Obsidian themes that set \`--cursor\` to the default cursor. Thanks to @TheFrostedDev for reporting this. - (#1463) Documented the supported \`FilterQuery\` payload for \`POST /api/tasks/query\`, including context filtering examples and generated API schema details. Thanks to @tcb678 for reporting this and @soloidx for sharing a working query example. - (#1464) Made \`context\` on \`GET /api/tasks\` follow the same filtering guidance as \`project\`, so the API now points clients to \`POST /api/tasks/query\` instead of ignoring the parameter. Thanks to @tcb678 for suggesting this. - (#1457) Rendered scheduled-to-due calendar spans with scheduled times as daily timed events instead of moving them to the all-day section. Thanks to @atos2212-blip for reporting this and @rayvermey for confirming it. - (#1450) Returned configured user fields in HTTP API task responses under \`customProperties\`, while keeping the configured frontmatter keys available on each task. Thanks to @Admorei for reporting this and @nschenone for the follow-up. - (#1449) Let embedded Agenda views use auto-height sizing by default, so one-day list embeds no longer reserve a large empty calendar block. Thanks to @GlebYavorski for reporting this. - (#1446) Kept custom Kanban columns from \`columnOrder\` available when they are empty, so \`hideEmptyColumns: false\` can show drop targets for custom grouped values. Thanks to @akhtsang for reporting this. - (#1459) Avoided double "Failed to create task" prefixes in task creation error notices. Thanks to @Sineapple for reporting this, and to @slipstyle and @Stockemer for the follow-up investigation. - (#1469) Fixed Convert current note to task so saving the untouched edit modal writes the task frontmatter instead of reporting no changes. Thanks to @slipstyle for reporting this, and to @jhoogeboom and @ngraham20 for confirming it. - (#1466) Prefilled the current note as the project when creating a task from an embedded Subtasks/Relationships Base filtered with \`this.file.asLink()\`. Thanks to @jhoogeboom for reporting this, and to @cybersader, @fsmontenegro, and @benmartinek for the follow-up discussion. - (#1476) Showed linked parent-task project titles instead of timestamp filenames in project stats and grouped task views when the linked task has a frontmatter title. Thanks to @RumiaKitinari for reporting this. - (#1487) Let Calendar task event titles wrap instead of clipping long names, and removed the redundant due-date prefix from due task events. Thanks to @Alexander-Bergmann for reporting this. - (#1488, #1739) Enabled Kanban touch dragging on touch-capable desktop and convertible devices, not only mobile Obsidian. Thanks to @tmoyland001 and @mgsima for reporting the drag failures, and @SoTHISIsFitness for investigating related task-property cases. - (#1738) Fixed Outlook calendar subscriptions whose event timezones reference the base Windows timezone name while the feed defines a suffixed timezone name. Thanks to @Mirrimo for reporting this, @rafavital for confirming it, and @rogerfsh for tracing the ICS timezone mismatch. - (#1734) Fixed dependency picker search when task priority values are stored as non-string frontmatter values. Thanks to @MatthewClarkeDev for reporting this and identifying the stack trace. - (#1733) Preserved wikilinks in task titles and rendered them as clickable links on task cards. Thanks to @bitscorch for suggesting this. - (#1728) Applied the "Use parent note as project" default when creating a new task from the command palette or ribbon. Thanks to @greatEmily for reporting this. - (#1759) Advanced stale due dates when recurring tasks move to their next scheduled occurrence, so work-window tasks do not remain overdue after completion. Thanks to @MattPryze for reporting this. - (#1766) Fixed Calendar Bases date navigation from custom note properties, so embedded calendar views can open on the date stored in the selected property instead of falling back to today. Thanks to @chrabia for reporting this. - (#1767) Aligned the start and end time rows in the timeblock creation modal. Thanks to @loiveli for reporting this. - (#1783) Replaced the default browser drag ghost for Kanban cards so dragging a card no longer makes the next card look semi-transparent. Thanks to @loukandr for reporting this and tracing the drag image behavior. - (#1796) Restored expanded subtasks immediately after renaming a parent task file and updating links. Thanks to @bung69 for reporting this. - (#1797) Improved manual ordering so long Kanban columns remain scrollable while dragging, mobile Kanban drops can place a card relative to another card, Kanban/Task List drops resolve the final drop position more reliably, generated manual-order ranks match Bases sorting, and manual-order properties such as \`sort_order\` render on task cards when enabled. Thanks to @SKIERZZ for reporting this and sharing videos. - (#1812) Separated Microsoft OAuth token status from calendar sync status, and surfaced Microsoft calendar fetch errors in the integrations settings card instead of leaving them console-only. Thanks to @henninger80 for the detailed report. - (#1814) Restored NLP project autosuggest in the Create or Open Task command, so \`+\` project suggestions use the same filtered project lookup as the Create Task modal. Thanks to @adammahad for reporting this. - (#1820) Kept API-created tasks readable immediately after creation even if Obsidian has not finished indexing the new file metadata yet. Thanks to @vadminas for reporting and tracing the cache desync. - (#1823) Prevented zero-duration timed external calendar events from rendering under more than one day in list-style calendar views. Thanks to @martin-forge for reporting and tracing the Google Calendar case. - (#1841) Prevented Kanban boards from duplicating columns when wikilinked status values are grouped through Bases. Thanks to @lendamico for reporting and sharing the screen recording. - (#1846) Saved NLP-triggered boolean custom fields as real booleans instead of quoted strings, so they match checkbox-created values and Bases filters. Thanks to @DevOps-Toast for reporting and sharing screenshots. - (#1849) Prevented repeated clicks on task-card scheduled and due date labels from stacking duplicate date menus when Obsidian native menus are disabled. Thanks to @3zra47 for reporting. - (#1850) Added mobile bottom spacing to TaskNotes list views so the final task can scroll above Obsidian's floating mobile controls. Thanks to @AlejandroRigau for reporting and sharing the iPhone screenshot. - (#1852) Improved mobile timed calendar event rendering with shorter time labels, tighter spacing, and event-colored task/calendar blocks. Thanks to @redrumthebum for reporting and sharing screenshots. - (#1757, #1853, #1775) Respected an existing \`mdbase.yaml\` \`types_folder\` when regenerating mdbase task type definitions, so the generated \`task.md\` can live outside the vault-root \`_types\` folder. Thanks to @aldrichtr for the original request and implementation exploration, and @hangryscribe3 for the follow-up request. - (#1858) Included task body details in single-task HTTP API and MCP reads. Thanks to @vanillaflava for reporting and outlining the expected behavior. - (#1859) Clarified the Google Calendar setup guide for OAuth testing-mode \`access_denied\` errors. Thanks to @PE-Boy for reporting and @tiagoarroz for the workaround. - (#1860) Preserved accented characters in tags when converting checkbox tasks to TaskNotes. Thanks to @e-zz for reporting. - (#1869) Preserved Calendar Month View scroll position after task updates. Thanks to @sisyowo for reporting and linking the earlier Kanban fix. - (#1873) Prevented Calendar Bases from rendering in Obsidian pop-out windows because restoring FullCalendar there can freeze Obsidian. Thanks to @misolex for reporting. - (#1497, #1870) Fixed NLP file suggestions for custom fields so selected wikilinks are captured as custom field values, including list-type fields. Thanks to @Naesue and @Sineapple for reporting this, and to @bradleyed and @Xananax for the follow-up details. - (#1888) Allowed project autosuggest required property filters to match any comma-separated value, such as \`project, area\`. Thanks to @BrianHicks for suggesting. - (#1886) Added a command to postpone active overdue scheduled tasks to today. Thanks to @chrabia for the suggestion. - (#1889) Fixed Kanban swimlanes for list-valued properties so tags and contexts use individual list items instead of comma-joined values. Thanks to @pkropotin for reporting. - (#1890) Fixed scheduled-date Kanban columns dropping tasks when date-only and timed tasks on the same day are sorted by a scheduled-time formula. Thanks to @chrabia for reporting and investigating. - (#773) Added ICS export filters for archived tasks, completed tasks, due dates, and scheduled dates. Thanks to @ras0q for suggesting this and @slipstyle for the scheduled-date follow-up. - (#765) Reduced side-pane gutters around embedded TaskNotes Bases views, so embedded task lists use about the same horizontal space as directly opened Bases views. Thanks to @TonyAtlas for suggesting this. - (#1892) Fixed nested Markdown list indentation in the Task Edit Modal details editor. Thanks to @Glint-Eye for reporting. - (#1891) Fixed TaskNotes modal markdown editors collapsing to one-character-wide lines when Pretty Properties is installed. Thanks to @bkennedy-improving for reporting. - (#1499) Respected excluded folders when opening tasks directly from view results and when building dependency/project indexes, so template-folder tasks no longer appear through TaskNotes views. Thanks to @Liya430 for reporting. - (#136, #1500) Made the Pomodoro countdown derive remaining time from the session clock instead of from counted interval ticks, so delayed, backgrounded, or screen-off ticks catch up cleanly without over-recording a completed session. Thanks to @Poly-0000 for reporting and documenting the original background timer issue, @Totobal5 for the earlier worker-based fix, and @CoffeaUrbana for the Android screen-off report. - Restored padding in task modal Markdown editors. - Made the markdown editor areas in task modals easier to click and focus. - Strengthened local CSS linting to catch unscoped selectors, unknown CSS, and fixed-position overlays before review. - Reduced false-positive plugin review warnings by making background auto-export and auto-archive schedulers non-overlapping and tightening type/string conversion paths. - (#1882) Made Google Calendar task descriptions use mobile-friendly plain text for Obsidian links and display labels for wiki-style project/context links. Thanks to @martin-forge for the contribution. - (#1883) Improved Google Calendar task sync recovery so failed deletions, offline sync requests, reconnects, and quick create/update races are retried more reliably. Thanks to @martin-forge for the contribution. `});var KMe,ZMe=y(()=>{KMe=`# TaskNotes 4.7.2 ## Changed - Improved local lint checks so package and CSS issues reported by Obsidian's online review can be caught before submission. - Cleaned up stylesheet compatibility issues reported by Obsidian's online review without changing the intended TaskNotes appearance. - Improved spacing and alignment in task, timeblock, and webhook modals after the stylesheet cleanup. - Reworked optional calendar and ICS subscription refresh scheduling to avoid interval-based network polling while preserving the same refresh intervals. - Cleaned up additional source patterns reported by Obsidian's online review, including unsafe default object stringification and redundant external type unions. - Prevented a console error when plugin listeners are cleaned up after reloads. - Added a local lint check to prevent interval-based polling in files that also perform network requests. `});var QMe,JMe=y(()=>{QMe="# TaskNotes 4.7.1\n\n## Changed\n\n- Release assets are now built with GitHub artifact attestations so users and reviewers can verify the provenance of `main.js`, `manifest.json`, and `styles.css`.\n"});var XMe,eAe=y(()=>{XMe=`# TaskNotes 4.7.0 ## Changed - Enabled lint checks that mirror Obsidian community plugin review findings, including dynamic code execution, Promise handling, deprecated APIs, unsafe stringification, directive comments, Node built-in imports, and explicit \`any\` usage. - Clarified privacy documentation for optional integrations that make periodic background network refreshes. - Cleaned up internal Obsidian and Bases compatibility adapters used by search and grouped views. - (#1839, #1881) Updated default Base urgency scoring so timed tasks earlier in the day sort above later tasks with the same priority and date - Thanks to @loukandr for the contribution ## Fixed - Fixed project autocomplete searches so non-empty \`+\` queries only return files matching the query in the basename, title, aliases, or explicitly searchable metadata rows. - (#1713) Fixed all-tasks ICS export when a task uses a space-separated scheduled datetime such as \`2025-08-12 18:00\` - Thanks to @bepolymathe for requesting this and @m4to-3pe for following up - Fixed Pomodoro stats reopening immediately after a plugin reload before the Pomodoro service has finished initializing. - (#1872) Fixed unarchiving moved tasks so the destination task folder processes template variables such as \`{{project}}\` before moving the file - Thanks to @OXI-717 for reporting - (#1870) Fixed custom user field NLP triggers with file autosuggest so selecting a wikilink suggestion stores the link in the user field instead of leaving it in the task title - Thanks to @Sineapple for reporting - (#1878) Fixed completed tasks still appearing as active blockers for dependent tasks - Thanks to @macbikegeek for reporting - (#1880) Fixed the status bar time-tracking label for task titles that contain a dash - Thanks to @ubidev for reporting - (#1854) Fixed modal task completion so completed tasks receive a completed date consistently - Thanks to @misolex for reporting - (#1124, #1838, #1881) Fixed default Base views and formulas excluding tasks scheduled or due today at a non-midnight time from day-level comparisons - Thanks to @kmaustral for reporting and @loukandr for the fix ## Removed - Removed JavaScript webhook transform support and examples. JSON webhook transform templates remain supported. `});var tAe,rAe=y(()=>{tAe=`# TaskNotes 4.6.0 ## Changed - TaskNotes now requires Obsidian 1.12.2 or later, matching the Obsidian APIs used by the plugin. - Improved internal code quality by resolving lint warnings, moving static inline styles into CSS utilities, and extending sentence-case lint coverage to English localization strings, with no intended behavior changes. ## Fixed - Fixed TaskNotes failing to load when Obsidian opened without an active Markdown file. `});var nAe,aAe=y(()=>{nAe=`# TaskNotes 4.5.3 ## Fixed - (#1834, #1847) Fixed empty Bases formula and custom properties showing \`null\` or \`undefined\` on TaskNotes task cards. - A big thanks to @Glint-Eye and @3zra47 for reporting. - (#1836) Fixed TaskNotes Bases views not refreshing task cards after status, archive, and auto-archive updates. - A big thanks to @kmaustral for reporting. `});var iAe,sAe=y(()=>{iAe=`# TaskNotes 4.5.2 ## Added - (#1342, #1793) Added native tag autocomplete to time entry descriptions by using the embedded markdown editor in the time entry editor modal. - Thanks to @fastrick for the request and @renatomen for the PR. - (#1756, #1798) Added HTTP API support for configured custom user fields so task responses include them and create/update requests can round-trip their values. - Thanks to @Treygec for the request and PR. - (#1777) Added a Modal Fields setting to choose whether Tab/Shift+Tab move focus out of the task details editor or use the markdown editor's indentation behavior. - Thanks to @P-Sc for the PR. ## Changed - Updated the Obsidian API dependency to 1.12.3 and switched the Bases integration to the official API type declarations. - Bases task cards and property-event cards now render metadata values through Obsidian's native Bases value renderer so links, dates, lists, icons, and formula values display more faithfully. ## Fixed - (#1778) Fixed MCP initialize requests using newer protocol versions such as \`2025-11-25\` failing instead of negotiating down to TaskNotes' supported MCP version. - Thanks to @SakulaPor for reporting. - (#1781) Fixed duplicate metadata properties on Bases task cards when bare and \`note.\`-prefixed property IDs map to the same TaskNotes field. - Thanks to @loukandr for reporting and tracing the issue. - (#1787) Removed the "(click to change)" helper text from recurrence tooltips on task cards. - Thanks to @kazerniel for reporting. - (#1828) Fixed subtask creation from a task card dropping the parent task project when natural-language input also adds projects. - Thanks to @prepare4robots for reporting. - (#1786) Fixed TaskNotes task cards and relationships/subtasks widgets appearing inside embedded task-note heading or block sections. - Skips note-level widget injection in detached or embedded Markdown editor contexts used by plugins such as Block Link Plus. - Thanks to @3zra47 for reporting. - (#1815) Fixed the Priority property settings so the NLP trigger character field is visible and editable even when priority NLP parsing is disabled. - Thanks to @spiv for reporting. - (#1035) Fixed the task modal title field causing the modal to jump to the bottom when focused on iPhone. - Thanks to @3zra47 for reporting and following up. - (#1045) Fixed inline linked recurring tasks keeping the previous day's completed state after the calendar day changes. - Thanks to @3zra47 for reporting and following up. - (#1788) Fixed Task List subgroup headers and cards rendering without clear indentation. - Thanks to @renatomen for the PR. - (#1810) Updated Japanese Kanban terminology to use the more natural katakana spelling. - Thanks to @sigma7863 for the PR. - (#1633) Fixed Bases task cards using fallback labels instead of Bases display names for mapped task fields and file properties. - Thanks to @Sarryaz for reporting the Bases task card i18n and field-mapping issue. - (#884) Fixed untranslated strings and English placeholder examples across non-English interface translations. - Thanks to @berzernberg for reporting Russian translation gaps. - (#1765, #1769) Fixed auto-archived tasks leaving stale Google Calendar events when cleanup runs before calendar sync is ready or after the task moves into the archive folder. - Thanks to @martin-forge for reporting and the PR. - (#1764) Fixed Google Calendar sync using stale task metadata after rapid task updates, and fixed late recurring completions/skips recording the completion day instead of the scheduled occurrence date. - Thanks to @martin-forge for the PR and to @jpmoo for reporting the recurring completion issues. - (#1782) Fixed CI test runs resolving the NLP parser package from a local sibling checkout instead of the published dependency. - Thanks to @martin-forge for reporting. - Published [\`mdbase-tasknotes\`](https://github.com/callumalpass/mdbase-tasknotes) 0.1.3 with compatibility fixes for TaskNotes-generated mdbase schemas. - Includes clearer create-path diagnostics, natural-language \`mtn list --due\` filters, timer log datetime filters, home-directory path expansion, project wikilink preservation, and correct \`mtn --version\` reporting. - Thanks to @tparsons9, @anomatomato, @npondel, @plashal, and @waspeer for the reports and PR. - (#1667) Fixed NLP scheduled-date parsing so standalone \`scheduled\` and \`start\` triggers can set scheduled dates alongside due dates. - Thanks to @hokfujow for reporting and @UniqueClone for the NLP core PR. - Fixed NLP parser title cleanup for explicit date triggers and Japanese/Chinese priority phrases. - (#1658) Fixed Pomodoro stats date bucketing for sessions near local midnight. - Pomodoro session stats now compare the recorded session calendar date against UTC-anchored target days without shifting through UTC or the reader's current timezone. - Pomodoro daily-note storage now writes sessions to the daily note matching the recorded session date. - Thanks to @ewgdg for reporting, @AntonIlinykh and @dkchacha for follow-up discussion, and @ITblacksheep for PR #1758. - (#1813) Fixed Pomodoro timer UI stalls caused by refreshing session statistics on every timer tick. - Pomodoro stats now refresh on initial render and session completion instead of once per second. - Pomodoro daily-note stats now read the relevant date/range instead of routing through all history. - Native Pomodoro notifications now respect the notification setting and granted permission before showing. - Thanks to @Szu-Szu for reporting and @its-thex for confirming. - (#1744) Fixed Bases Task List views so changing the per-view \`Expanded relationships\` option takes effect on re-render. - Restores the expected \`show-all\` behavior for setups that hide subtasks at the top level with \`note.projects.isEmpty()\`. - Thanks to @minol-dev for reporting, @Glint-Eye for follow-up discussion, and @stanley-910 for PR #1792 exploring the related standalone-subtask workflow. - Fixed tag clicks in task cards opening the task edit modal in addition to the tag search panel, and kept rendered tag metadata on a single row inside task cards. `});var oAe,lAe=y(()=>{oAe=`# TaskNotes 4.5.1 ## Fixed - (#1672) Fixed custom date ranges in the MCP time summary tool so \`from\` and \`to\` dates work as expected - Thanks to @pib for the fix - (#1742) Fixed calendar week and day views so the time scale stays aligned on the left instead of drifting inward - Thanks to @ysafonov for the report and screenshot `});var cAe,dAe=y(()=>{cAe=`# TaskNotes 4.5.0 ## Fixed - (#1652) Fixed API, MCP, and NLP task creation so it respects your configured filename format when title storage in filenames is disabled - Thanks to @36mimu36 for reporting, and @rafavital and @warm-july for follow-up discussion and reports - (#1601, #1709) Fixed reading-mode relationship widgets sometimes rendering multiple times during startup - Applied the same protection to task cards so overlapping refreshes are coalesced there too - Thanks to @wealthychef1 and @CarlJohnson99 for reporting, and @benmartinek for confirming the behavior - (#1713) Fixed ICS export so date-only scheduled tasks are written as all-day events instead of midnight events - Thanks to @bepolymathe for the request and interoperability details - (#267, #948, #1682, #1717, #1725) Fixed expanded subtasks and dependency cards in Bases Task List and Kanban views so related items can inherit the current view's filters instead of always showing every linked task - Added a per-view "Expanded relationships" option so you can switch between inherited filters and showing all related tasks - Thanks to @mdbraber, @GardarikanetS, @Glint-Eye, @prepare4robots, and @robmcphers0n for the original reports and feature requests, and @marblebyte for follow-up discussion - Improved custom view and search-pane activation when reopening deferred tabs - (#1720) Fixed Bases Task List cards showing icon tokens such as \`clock\` instead of readable date-like values, and fixed property labels to use Bases display names instead of raw property IDs - Thanks to @Sirnii for reporting - (#1633) Fixed interactive task-card labels and ribbon labels so Bases-backed cards use translations and configured display names instead of hardcoded English or raw property IDs - Thanks to @Sarryaz for reporting - (#1651) Fixed date \`is\` query filtering so date-only searches also match timed \`scheduled\` and \`due\` values during prefiltering - Thanks to @36mimu36 for reporting - (#1644) Fixed generated default task views so recurring tasks without a \`complete_instances\` property still appear as incomplete where appropriate - Thanks to @bkennedy-improving for reporting, and @SandroK for follow-up discussion on related default-view behavior - (#1513, #1686) Fixed a calendar issue where creating or editing events and timeblocks could reset the visible date back to today - In-place calendar recreation now preserves the visible date unless you explicitly navigate elsewhere - Thanks to @owenoxen for opening #1513, and @Lorite for opening #1686 and contributing the fix - Fixed documentation deployment CI failures caused by \`docs-builder/src/js/main.js\` being excluded by a broad \`.gitignore\` rule - Reduced background calendar-sync overhead when persisting sync tokens - Prevented duplicate auto-stop time-tracking listeners from accumulating after settings reloads - Fixed a settings-lifecycle issue that could accumulate calendar update callbacks while the Integrations tab is repeatedly opened - (#1630) Fixed TaskNote inline task cards ignoring centered "Readable line length" layout in the Minimal theme - Thanks to @martin-forge for reporting - Fixed a broken docs cross-reference from Property Types Reference to Task Properties settings - Fixed docs site links so internal Markdown links resolve to app routes instead of broken \`.md\` paths - Fixed docs release-note links by building Markdown pages even when they are not listed directly in the sidebar ## Added - (#1704) Added an option to widen the current day column in multi-day calendar time-grid views - You can control the width multiplier and choose whether it applies to week view, custom multi-day view, or both - Thanks to @dictionarymouse for the feature request - Added TaskNotes Obsidian CLI commands for task creation, time tracking, and Pomodoro control - Includes shared NLP-to-task conversion across the CLI, modal, and API capture flows, plus new user documentation for the built-in CLI commands - (#1716) Added roomier subtask and dependency cards inside the task modal while keeping the task options menu available - Thanks to @hokfujow for the feature request - (#1619, #386, #621) Added drag-to-reorder for Kanban and Task List views - Supports grouped Task List moves, manual ordering via the \`tasknotes_manual_order\` property, and improved drag/drop behavior for swimlanes, filtered views, and interactive task controls - To use it, sort the view by the Manual Order field (\`tasknotes_manual_order\` by default), or regenerate the built-in \`.base\` templates from **Settings \u2192 TaskNotes \u2192 General \u2192 Create Default Files** - Thanks to @ac8318740 for the original contribution in PR #1619, @iholston and @dsebastien for opening #386 and #621, and @mdbraber, @elvarb, @LucidToday, @craziedde, @kmaustral, @SKIERZZ, @sookochoff, and @kanzaki1201 for follow-up discussion and testing across the linked issues and PR - Added a standalone [TaskNotes Specification](https://github.com/callumalpass/tasknotes-spec) repo and docs section covering the data model, field mapping, recurrence behavior, validation rules, and conformance tests - Added [tasknotes-tui](https://github.com/callumalpass/tasknotes-tui), a terminal UI for working with TaskNotes vaults - Includes keyboard-driven views, date navigation, time tracking, recurring task support, and a command palette ## Changed - Refactored several internal modules to reduce coupling and make maintenance safer - Updated generated \`_types/task.md\` output so \`dateCreated\` and \`dateModified\` include generated timestamp values, and \`recurrence_anchor\` defaults to \`scheduled\` - Cleaned up API, webhook, NLP, privacy, settings, and view documentation for clarity and accuracy - Expanded Task List and Kanban documentation for drag-to-reorder, including manual-order sorting, grouped and swimlane scope, and filtered-view limitations `});var uAe,pAe=y(()=>{uAe="# TaskNotes 4.4.0\n\n## Added\n\n- [Mdbase](https://mdbase.dev) type generation now includes `tn_role` annotations so external tools can identify each field's role even when frontmatter names are customized\n- (#1618) Mdbase type matching now follows your task identification settings (tag or frontmatter property), with fallback to tag matching when needed\n - Thanks to @jimbo108108 for reporting\n- Mdbase type status fields now include `tn_completed_values` so external tools can reliably identify which status values count as completed\n- (#1576) Added an optional `Checklist Progress` task-card property that renders a compact progress bar and `completed/total` count from top-level markdown checkboxes\n - Uses metadata cache list items and excludes nested checklist entries so progress reflects top-level task steps\n - In Bases views, map `tasks` (`file.tasks`) to `Checklist Progress`\n - Existing `.base` files need `file.tasks` added to the view `order` YAML manually\n - Newly generated `.base` templates now include `file.tasks` in view `order` by default\n - Thanks to @phortx for opening #1576 and for the earlier implementation PR, and @piyushaswani55 for feedback in the issue discussion\n\n## Changed\n\n- Mdbase type generation no longer overwrites `mdbase.yaml` if the file already exists, preserving user customisations\n- Webhooks now fire consistently regardless of whether updates come from the UI, HTTP API, or MCP\n- Webhook runtime state now syncs automatically when plugin settings change\n- Shared HTTP response/body parsing utilities are now consolidated in a dedicated `httpUtils` module\n- Release notes now include a reminder on every release page that default generated `.base` template changes never overwrite existing user `.base` files, and that users can regenerate templates from Settings to pick up updates\n\n## Fixed\n\n- (#1608) Fixed task title frontmatter being removed when `storeTitleInFilename` is enabled\n - `title` is now retained in frontmatter while filename derivation from title remains unchanged\n - Thanks to @victoraraujo105 for the PR\n- (#1602) Fixed time tracking statistics showing incorrect or zero values for Today/Week/Month due to UTC-anchored date range boundaries in Stats View\n - Updated range calculations to use local calendar-day boundaries consistently\n- (#1602) Fixed inconsistent `timeEntries` timestamp formats across create/edit/drag/resize flows\n - Time entry timestamps are now written in canonical UTC ISO format (`toISOString()` with `Z`) across all write paths\n- (#1602) Fixed denormalized `timeEntries.duration` drift after edits\n - Time tracking calculations now derive duration from `startTime`/`endTime`\n - Time entry save paths now strip legacy `duration` values instead of persisting them\n - Thanks to @dy66 for opening #1602\n"});var mAe,fAe=y(()=>{mAe=`# TaskNotes 4.3.3 ## Changed - Published [\`mdbase-tasknotes\`](https://github.com/callumalpass/mdbase-tasknotes) (\`mtn\`), a standalone CLI for managing tasks in markdown files via mdbase - Works on the same vault and \`_types/task.md\` schema that TaskNotes generates, without requiring the plugin or HTTP API - Preferable over [tasknotes-cli](https://github.com/callumalpass/tasknotes-cli) as a lighter-weight alternative and when Obsidian is not running, on remote machines, or in scripts and CI environments - Supports natural language task creation, time tracking, project aggregation, statistics, and an interactive REPL - Extracted shared natural language parsing logic into the standalone npm package [\`tasknotes-nlp-core\`](https://github.com/callumalpass/tasknotes-nlp-core) - The NLP parser and related language configuration are now shared through this package - This keeps behavior consistent between the plugin and CLI tools ## Added - (#1549) Added setting to reset markdown checkboxes when recurring tasks are completed - When enabled, all checked checkboxes (\`- [x]\`) in the task body are reset to unchecked when a recurring task instance is completed and rescheduled - Useful for recurring tasks with subtask checklists that need to be repeated each instance - Configurable via Settings > Features > Recurring Tasks > "Reset checkboxes on recurrence" - Thanks to @phortx for the feature request - (#1548) Added ability to create calendar events on connected external calendars directly from the calendar view - When clicking or dragging to select a time slot, a new "Create calendar event" option appears in the context menu - Opens a modal to enter event title, description, location, and select which calendar to create on - Supports both Google Calendar and Microsoft Calendar providers - Thanks to @Robubble for the feature request - (#1597) Added MCP server for AI agent integration - Exposes TaskNotes tools at \`/mcp\` endpoint, gated behind \`enableMCP\` setting - Supports tasks (CRUD, query, toggle status/archive, parse from text), time tracking, pomodoro, calendar events, and task statistics - Thanks to @dstotijn for the contribution ## Fixed - Fixed generated [mdbase](https://mdbase.dev) type definitions for task dependencies using the wrong field type - In \`_types/task.md\`, \`blockedBy[].uid\` now uses \`type: link\` (was \`type: string\`) - Better matches how dependency links are serialized in task frontmatter (\`[[...]]\`) - Fixed generated mdbase reminder type definitions to better match TaskNotes reminder data - In \`_types/task.md\`, \`reminders[].type\` now uses enum values \`absolute|relative\` - \`reminders[].relatedTo\` now uses enum values \`due|scheduled\` - \`reminders[].absoluteTime\` now uses \`type: datetime\` (was \`type: string\`) - (#1597) Fixed webhook payloads for time tracking start-with-description containing stale data - Thanks to @dstotijn for the fix - (#1581) Fixed Pomodoro starting break instead of work session after app restart - After completing a work session and restarting, pressing Start would incorrectly start a break - Now properly resets \`nextSessionType\` when clearing stale sessions or stopping the timer - Thanks to @Sirnii for the detailed bug report and root cause analysis - (#1577) Fixed Edit Note/Task modal hiding action buttons when content exceeds viewport height - Added vertical scroll to modal content area while keeping buttons pinned at bottom - Thanks to @hossam-elshabory for reporting and @ivannin for helping in discussion - (#1600) Fixed kanban view grouping not working when more than 20 views exist - The \`getGroupByPropertyId()\` method had a hardcoded loop limit of 20 iterations - Views at index 20 or higher would not be found, causing groupBy to return null - Thanks to @IHaveNoShame for reporting - (#1595) Fixed task modal floating buttons blocking content on mobile - Added mobile-specific (\`body.is-mobile\`) CSS to ensure proper flex layout - Button container now stays pinned at bottom without overlapping scrollable content - Thanks to @Jomo94 for reporting - (#1590) Fixed HTTP API not allowing \`blockedBy\` dependencies when creating tasks - Added \`blockedBy\` field support to \`TaskService.createTask()\` - Updated API documentation with \`blockedBy\`, \`recurrence\`, and \`reminders\` fields - Thanks to @hGriff0n for reporting - (#1582) Fixed recurring tasks not appearing at end of visible calendar range for non-UTC timezones - Daily/weekly recurring tasks with times after ~1pm would disappear on the last day of the visible range for users in positive UTC offsets (e.g., UTC+11) - Fixed date boundary comparisons in both \`generateRecurringInstances()\` and \`generateRecurringTaskInstances()\` to compare dates only, not timestamps - Thanks to @benefitbug for reporting - (#1580) Fixed Google Calendar sync failing after OAuth token expires with unhelpful error message - When refresh tokens expire or are revoked (e.g., Google Cloud project in Testing mode, user revoked access), the error message was confusing: "Failed to refresh google token: Request failed, status 400" - Now detects irrecoverable token errors (\`invalid_grant\`, \`invalid_client\`) and automatically disconnects the OAuth connection - Shows actionable error message: "Google Calendar connection expired. Please reconnect in Settings > Integrations." - Prevents repeated failed refresh attempts and error message spam - Thanks to @osxisl for reporting and @Naesue for helping in discussion - (#1584) Fixed DOMTokenList error when task status values contain spaces - Clicking the status ring on a task card threw an error when status contained spaces (e.g., "In Progress") - Status and priority values are now sanitized before being used as CSS class names - Thanks to @omber for reporting `});var hAe,gAe=y(()=>{hAe=`# TaskNotes 4.3.2 ## Added - (#1520) Tag and Context fields in Edit Task modal now show all available suggestions immediately on focus - Previously required typing at least one character before suggestions appeared - Already-selected values are excluded from the suggestion list - Thanks to @Glint-Eye for the suggestion - (#1506) Added setting to configure the default color for new timeblocks - New color picker in Settings > Features > Timeblocking - Previously hardcoded to indigo; now user-configurable - Thanks to @phillipadsmith for the suggestion ## Fixed - Fixed [mdbase-spec](https://mdbase.dev) type definition generation not triggering when settings change - (#1456) Fixed inline tasks jumping visually when marked as completed - Thanks to @3zra47 for reporting - (#1364) Fixed auto-stop time tracking not triggering when completing recurring task instances - Thanks to @slipstyle for reporting - (#1465) Fixed all-day events synced to Google Calendar receiving wrong notification time - All-day events now use Google Calendar's configured all-day notification defaults instead of a minutes-based reminder - Thanks to @Jomo94 for reporting - (#1470) Fixed cursor showing as default instead of pointer on interactive elements - Thanks to @TheFrostedDev for reporting - (#1491) Fixed boolean property values being quoted as strings in Bases filter generation - When using a boolean property (e.g. \`tasknote: true\`) for task identification, the filter now correctly handles the value - Thanks to @denisgorod for reporting - (#1494) Fixed Kanban swimlane resetting to "None" on initial load and after navigation - Thanks to @tnguyen2018 for reporting - (#1555) Fixed "Folder already exists" error when creating tasks or converting inline tasks - Thanks to @jkune5 for reporting - (#1532) Fixed expanded task modal buttons being cut off when content exceeds viewport height - Thanks to @willfanguy for reporting - (#1542) Fixed declined and cancelled events from ICS calendar subscriptions appearing in calendar view - Thanks to @karenchoe428 for reporting - (#1556) Fixed completion-based recurring tasks not rescheduling when the recurrence interval is large - Thanks to @kazerniel for reporting - (#1492) Fixed hardcoded "open" status leaking into filenames, recurring task displays, and parsing fallbacks - Users with custom default statuses (e.g. "inbox") no longer see "open" where their configured default should appear - Recurring tasks now show their actual configured status instead of always displaying "open" when not completed - Thanks to @macdrifter for reporting - (#1501) Fixed Google/Microsoft Calendar event colors not showing in agenda/list view - Per-event and calendar-level colors now display correctly in the list view, matching grid view behavior - Added today indicator highlighting to list view day headers - Thanks to @Robubble for the suggestion `});var yAe,vAe=y(()=>{yAe=`# TaskNotes 4.3.1 ## Added - (#1546) Added sticky kanban column headers that remain visible while scrolling - Thanks to @normenmueller for the contribution - (#1458) Added CSS color classes to context tags for custom styling - Each context tag now receives a unique CSS class based on its name (e.g., \`context-tag--color-0\` through \`context-tag--color-19\`) - Enables styling individual contexts via CSS snippets - Thanks to @phortx for the contribution - Added [mdbase-spec](https://mdbase.dev) type definition generation - New setting in Integrations tab to generate mdbase-spec v0.2.0 type definition files (\`mdbase.yaml\` and \`_types/task.md\`) at the vault root - Type definitions are derived from TaskNotes settings (statuses, priorities, field mappings, user fields) and regenerated automatically when settings change - Enables interoperability with other tools that support the mdbase-spec format ## Fixed - (#1472) Fixed task dependencies not being stored as wikilinks in frontmatter - Dependencies now retain their \`[[wikilink]]\` format when saved, preventing them from breaking on file rename - Thanks to @renekalff for reporting - (#1443) Fixed default status/priority not updating when the referenced custom value is deleted - Deleting a custom status or priority that was set as the default now resets the default to the first available value - Thanks to @l-mb for the contribution - (#1448) Fixed project removals not persisting from the task edit modal - Removing all projects from a task now correctly clears the projects field - Different link formats (e.g., markdown links vs wikilinks) no longer cause false change detection - Thanks to @normenmueller for the contribution - (#1514), (#1517) Fixed task reminders not syncing to Google Calendar - Task-specific reminders (both relative and absolute) now sync to Google Calendar - Previously only the global default reminder setting was used, ignoring per-task reminders - Thanks to @christenbc for the contribution - (#1525), (#1531) Fixed subtask status dot not refreshing visually when clicked - Status dot, checkbox, and card styling now update instantly when cycling status - Thanks to @christenbc for the contribution - (#1537) Fixed Google Calendar errors during bulk sync - Added rate limiting to space out API calls, preventing errors when syncing many tasks at once - Thanks to @Lorite for the contribution - (#1515), (#1540) Fixed time loss when setting recurrence and recurrence not clearing from Google Calendar - Setting recurrence on a task with a scheduled time now preserves the time, preventing Google Calendar events from appearing as all-day - Clearing recurrence from a task now also removes it from the synced Google Calendar event - Thanks to @christenbc for the contribution - (#1428), (#1559) Fixed hierarchical tags with slashes (e.g., \`#project/sub-project\`) being truncated in link text - Tags containing slashes, hyphens, and Unicode characters now render correctly - Thanks to @normenmueller for the contribution and @ysafonov for reporting - (#1565) Fixed Google Calendar target calendar dropdown appearing empty after app restart - The dropdown now re-populates once calendars are fetched during startup - Thanks to @N-HEDGER for reporting - (#1567) Fixed inline task card widgets disappearing momentarily - When the task cache is temporarily cleared (e.g., during Smart Connections processing), the previously-rendered widget is now preserved instead of reverting to a plain wiki link - Thanks to @scztt for reporting - (#1568) Fixed deleted tasks not being removed from Google Calendar - When a task file is deleted outside of TaskNotes (e.g., via Obsidian's file manager), the synced Google Calendar event is now cleaned up automatically - Thanks to @kmaustral for reporting - Fixed Integrations tab spacing and layout issues - Improved positioning of buttons and status indicators across Google Calendar, ICS, and Webhooks sections `});var kAe,bAe=y(()=>{kAe=`# TaskNotes 4.3.0 ## Changed - (#1437) Unified template variable syntax and available variables across filename and body templates - Both systems now use double-brace \`{{variable}}\` syntax consistently - Single-brace \`{variable}\` syntax remains supported for backwards compatibility but is deprecated - Settings UI shows a warning when deprecated single-brace syntax is detected - Filename templates gain body template variables: \`{{contexts}}\`, \`{{tags}}\`, \`{{hashtags}}\`, \`{{timeEstimate}}\`, \`{{details}}\`, \`{{parentNote}}\` - Body templates gain filename template variables: \`{{zettel}}\`, \`{{nano}}\`, and all extended date/time variables - Thanks to @23maverick23 for reporting ## Added - (#1361) Option to disable inline task overlay for aliased wikilinks - New setting in Features \u2192 Inline Tasks: "Disable overlay for aliased links" - When enabled, links with aliases like \`[[Task|Check Status]]\` render as plain links - Links without aliases continue to show the interactive task widget - Useful when embedding tasks in prose where the widget would be disruptive - Thanks to @diegomarzaa for the contribution and @jldiaz for proposing this feature in #1117 - (#1199, #1205) Google Calendar export for tasks - Sync tasks to Google Calendar based on scheduled or due dates - Automatic sync on task create, update, complete, and delete - Configurable event title templates with placeholders (\`{{title}}\`, \`{{status}}\`, \`{{priority}}\`, etc.) - Event descriptions include task metadata and optional Obsidian deep link - Support for all-day or timed events with customizable duration - Event color customization using Google Calendar's color palette - Default reminder setting for popup notifications - Bulk sync and unlink actions in settings - Task-event linking stored in frontmatter (\`googleCalendarEventId\`) - Recurring tasks sync as Google Calendar recurring events - Completed or skipped recurring instances are automatically excluded - Thanks to @someromans and @Leonard-44 for requesting this feature, and @dmantisk, @farangkao, @rayvermey, and @rdpr for their input ## Fixed - (#1413) Fixed angle-bracket links and project title display - Angle-bracket links like \`[Spec]()\` now resolve correctly - Project links display frontmatter \`title\` instead of raw filename/path when available - Dependency values normalize consistently across wikilinks, markdown links, and angle-bracket variants - Many thanks to @normenmueller for the contribution - (#1414) Kanban column headers now display configured priority labels instead of raw values - Many thanks to @normenmueller for the contribution - (#1416) Fixed property-based task identification mutating tags unexpectedly - Tags are only written when explicitly changed by the user - Task tag is only added in tag-based identification mode - Fixes #1391 - Thanks to @loukandr for reporting and @normenmueller for the fix - (#1187) Fixed "Unknown view types" error when opening Bases views after upgrading from pre-V4 - Users who had disabled Bases support in earlier versions could not open Bases views after upgrading - Settings migration now automatically re-enables Bases support since the toggle was removed in V4 - Thanks to @MiracleXYZ for reporting - (#1144) Fixed relationships.base showing empty views for Projects, Blocked By, and Blocking tabs - The top-level task filter was excluding non-task files from the Projects view - Projects can be any file type (not just tasks), so the filter is now applied per-view - Subtasks, Blocked By, and Blocking views retain the task filter; Projects view does not - Users with existing relationships.base files should delete and regenerate them to get the fix - Thanks to @needo37 for reporting, and @n1njaznutz, @nestor50, and @IvyDliu for investigating and confirming the solution - Fixed calendar view type not persisting or applying when changed - View type changes via header buttons (week/day/month) are now saved to the .base file - View type changes via Bases settings panel now apply immediately without reload - (#1441) Fixed task dragging broken with "Span tasks between scheduled and due dates" enabled - Span events can now be dragged to move tasks in time - Dragging shifts both scheduled and due dates proportionally, preserving the span duration - Previously, dragging span events would cause a visual/data mismatch where the calendar showed the wrong position - Thanks to @Peeeet for reporting `});var TAe,wAe=y(()=>{TAe=`# TaskNotes 4.2.1 ## Added - New Calendars API endpoint for access to calendar data - Access calendar provider information and connection status - Query events from Google Calendar, Microsoft Calendar, and ICS subscriptions - Filter events by date range - [\`tasknotes-cli\`](https://github.com/callumalpass/tasknotes-cli) has been updated to make use of this endpoint ## Fixed - (#1424) Fixed "Create New Task" command creating tasks in active folder instead of default folder - "Create New Task" now correctly uses the configured default task folder - "Create New Inline Task" continues to use the inline task folder setting - Thanks to @Gogo-XD for reporting and @TonyAtlas for confirming - (#1421), (#1042) Fixed natural language parser only setting one date when both scheduled and due dates are specified - Entering something like "task due Jan 9 at Jan 9" now correctly sets both the due date and scheduled date - Thanks to @wealthychef1 and @dblinnikov for reporting - (#1410) Fixed vim insert mode not activating in task creation modal - The modal now correctly enters insert mode when vim keybindings are enabled - Thanks to @Leo310 for the feature request - (#1422) Fixed tags with dashes not being parsed correctly - Tags like \`#my-tag\` were being truncated to \`#my\` - Thanks to @JerryLu086 for reporting - (#1419) Fixed custom statuses and priorities not saving in settings - Values entered in text fields were sometimes lost when closing the settings modal - Thanks to @s33a for reporting `});var SAe,xAe=y(()=>{SAe=`# TaskNotes 4.2.0 ## Added - Added Korean (\uD55C\uAD6D\uC5B4) language support - Full translation of all 1911 localization keys - Korean language option now available in Settings \u2192 General \u2192 Language - Adopted Obsidian 1.11.0 API features with backwards compatibility - Settings tab now displays TaskNotes icon in the sidebar (Obsidian 1.11.0+) - Settings sections now use native \`SettingGroup\` for improved visual grouping (Obsidian 1.11.0+) - Falls back gracefully to traditional section headers on older Obsidian versions - (#59) Added \`shortYear\` template variable for custom filename and folder templates - Use \`{shortYear}\` in filename templates (e.g., "25" for 2025) - Use \`{{shortYear}}\` in folder templates - Thanks to @Pixeltica for the feature request - (#1393) Option to prevent auto-creation of default Base view files on startup - New "Auto-create default files" toggle in Settings \u2192 Integrations \u2192 Bases Integration - When disabled, deleted sample Base files will not be recreated on plugin load - The manual "Create Default Files" button remains available for on-demand recreation - Thanks to @wealthychef1 for the feature request - (#1408) Shift+click on status icon to cycle backwards through statuses - Normal click cycles forward through status order - Shift+click cycles in reverse order - Thanks to @JerryLu086 for the feature request - (#1410) Task creation modal now starts in vim insert mode when vim keybindings are enabled - Previously required pressing 'i' before typing when Obsidian vim mode was active - The modal now automatically enters insert mode on focus, allowing immediate typing - Thanks to @Leo310 for the feature request - Added button tooltips to calendar view toolbar - Hovering over navigation and view buttons now shows descriptive hints - Buttons include: Today, Previous, Next, Month, Week, Day, Year, List - Added tooltips to task modal action icons - Icon buttons for status, date, project, priority, recurrence, and reminder now show tooltips on hover - Improves discoverability for new users - (#503) Settings now sync automatically across devices via Obsidian Sync - Changes to custom statuses, priorities, and other settings apply immediately without restart - Thanks to @jhedlund for the feature request and @l-mb for the implementation - (#1403) Kanban view option to consolidate status icons in column headers - New "Show status icon in column header only" toggle in Kanban view settings (disabled by default) - When enabled and grouped by status, shows the icon in the column header and hides it on cards - Reduces visual redundancy when the column already indicates the status - Thanks to @l-mb for the feature request and implementation - (#1401) Calendar view option to span tasks between scheduled and due dates - New "Span tasks between scheduled and due dates" toggle in Calendar view Layout settings - When enabled, tasks with both scheduled and due dates display as multi-day bars - Provides Gantt chart-style visualization for project planning - Thanks to @0atman for the feature request - (#1334) \`{{currentNotePath}}\` now works for "Create new inline task" command - The inline task folder setting with \`{{currentNotePath}}\` previously only worked for checkbox conversion - Now also applies when using the "Create new inline task" command from the command palette - Thanks to @kmaustral for the feature request - (#1264) Option to open Pomodoro timer in mobile sidebar instead of note panel - New "Mobile sidebar" setting in Settings \u2192 Features \u2192 Pomodoro Timer - Choose between: Note panel (default tab behavior), Left sidebar, or Right sidebar - Allows quick swipe access to the timer without switching notes on mobile devices - Thanks to @Evthestrike for the feature request - (#1220) Option to use ICS event end time as task due date - New "Use ICS event end time as task due date" toggle in Settings \u2192 Integrations \u2192 Calendar Subscriptions - When enabled, tasks created from calendar events will have their due date set to the event's end time - For all-day events, uses the event date (not the ICS container end date which is the next day per ICS spec) - For timed events, includes the exact end time - Defaults to disabled to preserve existing behavior - Thanks to @MiserMagus for the feature request - (#1108) Option to use task duration instead of due date for ICS calendar export - New "Use task duration for event length" toggle in Settings \u2192 Integrations \u2192 Automatic ICS Export - When enabled, exported calendar events use scheduled date + time estimate as DTSTART/DTEND - This aligns with GTD workflows where scheduled + duration represents work planning, while due date represents deadlines - When disabled (default), preserves existing behavior using due date as DTEND - Thanks to @bepolymathe for the feature request ## Fixed - (#1421) Fixed natural language parser only capturing one date when both scheduled and due dates are specified - Input like "Task scheduled for tomorrow due next week" now correctly sets both scheduled and due dates - Previously the parser would return early after finding the first date trigger, ignoring any subsequent triggers - Thanks to @wealthychef1 for reporting - (#1384) Fixed title being sanitized even when "Store Task Title in Filename" is disabled - Characters like \`?\`, \`<\`, \`>\`, \`:\`, etc. are now preserved in task titles when they won't be used in filenames - When \`storeTitleInFilename\` is false, only minimal sanitization (whitespace normalization, control character removal) is applied - Thanks to @allison-casey for reporting - (#1028), (#1140), (#1152), (#1354), (#1362) Fixed duplicate task entries appearing in Agenda view - Tasks were shown twice: once as TaskNotes events and again as property-based events with a file icon - Changed default Agenda template to disable property-based events (\`showPropertyBasedEvents: false\`) - Users can re-enable property-based events in view settings if needed for non-task date properties - Thanks to @YIRU69, @jhedlund, @dblinnikov, @Snakiest, @WeiYiAcc, @JacksonMcDonaldDev, @jimbo108108, and @krelltunez for reporting - (#1386) Fixed \`timeEstimateCategory\` formula showing "Long (>2h)" instead of "No estimate" for new tasks - The condition didn't properly handle null values when \`timeEstimate\` property is unset - Also fixed the same issue in \`trackingStatus\` formula - Thanks to @nicou for reporting and @osxisl for the PR - (#1397) Fixed Bases views (Kanban, Calendar, Task List) resetting to Calendar view after a few minutes - Also fixed CalendarView corrupting other view files when saving state on unload - Thanks to @music-soul1-1 for reporting - (#1398) Fixed overdue strikethrough showing on completed tasks - Completed tasks with past due dates no longer display overdue styling - Respects the "Hide completed from overdue" setting which defaults to true - (#1363) Fixed calendar view showing nothing when a task has an invalid date format - Tasks with malformed dates (e.g., "262025-12-16" instead of "2025-12-16") no longer crash the entire calendar - Invalid tasks are now skipped with a console warning, allowing other events to display normally - Thanks to @Erelen for reporting - Fixed today column in week/day calendar views using FullCalendar's default yellow instead of theme accent - Today's column now uses a tint of the theme accent color for consistent styling - (#1399) Fixed drag-and-drop not working in Kanban view on mobile - Cards and columns can now be dragged using long-press gesture on touch devices - Includes haptic feedback and auto-scroll when dragging near edges - Thanks to @l-mb for reporting and the fix - (#1381) Fixed Pomodoro "Change Task" menu not showing newly created tasks - Tasks created while the Pomodoro view was open would not appear in the task selector - Improved metadata cache synchronization to properly wait for new files to be indexed - Thanks to @Ghosthael for reporting - (#1344) Fixed "Unsaved Changes" popup appearing randomly when closing task edit modal - The popup would appear even when no changes were made to the task - Caused by inconsistent trailing whitespace normalization when comparing details content - Thanks to @hasanyilmaz for reporting - (#1402) Fixed Kanban swimlane view showing tasks in wrong column when grouped by formula - After editing task metadata, cards would jump to "None" column until Obsidian reload - Column assignment now uses Bases' computed grouping instead of cached formula outputs - Thanks to @bailob for the fix - (#1352) Fixed date context menu not preserving time when using increment options - Using +1 day, -1 day, +1 week, or -1 week on a task with a time (e.g., \`2025-12-10T16:00\`) now preserves the time - Previously the time would be stripped, changing \`2025-12-10T16:00\` to \`2025-12-11\` instead of \`2025-12-11T16:00\` - Thanks to @cathywu for the feature request - Fixed v3 saved views exporting incorrectly to Bases format - Title filters now correctly use \`file.name\` instead of \`note.title\` - Archived filters now generate valid boolean expressions instead of malformed comparisons - "Is Blocked" filters now generate correct expressions with proper operator precedence - (#1036) Due dates can now be dragged in the calendar view - Previously only scheduled dates were draggable; due dates were locked in place - Dragging a due event now updates the task's due date property - Thanks to @same774 for reporting - Improved calendar view responsiveness for user interactions - Task creation, editing, timeblock changes, and view option toggles now update immediately - Previously these actions waited 5 seconds due to the debounce intended for external file changes - The 5-second debounce is now bypassed for direct user actions while still preventing flicker during typing - Improved visual affordance for Pomodoro timer duration adjustment buttons - The +/- buttons below the timer now have visible backgrounds and borders - Hover states show accent color border for clearer interactivity feedback - Previously buttons were nearly invisible with transparent backgrounds - (#1409), (#1214), (#979) Improved Calendar, Agenda, Kanban, and Stats views in pop-out windows - Drag-and-drop in Kanban view now works correctly when the view is in a new window - Context menus (status, priority, task) now work correctly in pop-out windows - Stats view drill-down modal now appears in the correct window - Search boxes, task cards, and grouped task lists render correctly - Root cause: Code was using global \`document\` and standard \`instanceof\` checks which fail across windows - Solution: Use \`ownerDocument\` for DOM operations and Obsidian's cross-window \`instanceOf()\` method - **Known limitation**: Calendar event dragging does not work in pop-out windows due to FullCalendar library using global \`document\` for mouse event listeners. Use context menus or edit modals as a workaround. - Updated FullCalendar to v6.1.20 - Thanks to @Snakiest, @same774, and @3zra47 for reporting - (#1337) Fixed "Convert current note to task" hotkey not applying default values from settings - When user configured default status/priority as "None", the modal would show "Open" and "Normal" instead - Root cause: Task edit modal was refreshing data from file and overwriting user-configured defaults - Now preserves constructor-provided task data when converting non-task files - Thanks to @guihasparyk for reporting - (#1304) Fixed "Cannot find function map on type Link" error in Blocking view - Error occurred when embedding the Relationships base and opening the Blocking view - Root cause: When \`blockedBy\` contained a single dependency, Bases returned it as a Link object without a \`.map()\` method - Fixed by wrapping \`blockedBy\` with \`list()\` before calling \`.map()\`, consistent with the Blocked By view - Thanks to @prayidae for reporting - (#1295) Fixed missing navigation link to Default Base Templates page on tasknotes.dev - The page existed but was not accessible from the site navigation - Thanks to @Arachnidai for reporting - (#1223) Fixed "Go to today's note" command opening wrong date in positive UTC offset timezones - In timezones like Japan (UTC+9), early morning use of this command opened yesterday's note - Root cause: Incorrectly extracting UTC date components instead of local timezone date - Thanks to @BrucePlumb for reporting `});var CAe,EAe=y(()=>{CAe=`# TaskNotes 4.1.3 This patch fixes a critical performance issue affecting the Calendar views. As a bonus, it adds a configurable "split" view to the task creation/edit modals. ## Added - Split layout for task modals on wide screens (900px+) - Details editor appears in a dedicated right column when the modal is expanded - New setting "Split layout on wide screens" in Modal Fields settings tab to toggle this behavior - Improves usability by showing form fields and details side-by-side ## Fixed - (#1330) Fixed calendar view regression taking 5 seconds to load and respond to user interactions - Initial calendar load is now immediate again - User interactions (drag/drop, creating timeblocks, etc.) respond instantly - Removed redundant date filtering (FullCalendar handles this more efficiently) - Thanks to @ysafonov, @kmaustral, @sunjiawe, @\u041C\u0438\u0437\u0433\u0438\u0440\u044C, and @FiliusIcari for reporting `});var DAe,PAe=y(()=>{DAe=`# TaskNotes 4.1.2 ## Fixed - Significant performance improvements for Bases views (TaskList, Kanban, Calendar) - Reduced \`extractDataItems\` time from ~4 seconds to ~5-10ms for large vaults (6000+ tasks) - Computed file properties (\`file.backlinks\`, \`file.links\`, etc.) are now fetched lazily during render instead of upfront - Only visible items (with virtualization) trigger expensive property computations - Added debouncing to \`onDataUpdated\` to prevent UI freezes during typing - Timeblock generation now uses Obsidian's metadataCache instead of file reads - Added date range filtering for calendar events to skip events outside visible range - (#1285) Calendar view uses 5-second debounce to prevent flickering while typing - Thanks to @steven-murray for reporting - Calendar view switching (month/week/day/list) is now much faster - View type is now saved on unload instead of on every change - Fixed task edit modal archive button being too narrow on mobile devices - (#1319) Added missing properties to Field Mapping settings - \`recurrence_anchor\` - now in Settings > Task Properties > Task Details - \`skipped_instances\` - now in Settings > Task Properties > Metadata Properties - Thanks to @kazerniel for reporting - (#1310) Fixed inline task conversion deleting text when task title exceeds filename limits - Text that cannot fit in the filename is now preserved in the task note's body - Thanks to @prayidae for reporting - (#1301) Fixed inline task wikilinks leaving blank space when no metadata properties are visible - Thanks to @Richard-UMPV for reporting - (#1317) Fixed project autosuggest filters not working correctly when only "Required Property Key" is configured - NLP \`+\` trigger now properly filters by property existence when no property value is specified - Modal "Add to project" button now shows consistent results with inline autosuggest - Thanks to @JacksonMcDonaldDev for reporting - (#1287), (#1307) The "New" button in Bases views now opens the TaskNotes creation modal - Tasks created from Bases views now respect default properties (status, priority, etc.) - Tasks are now created in the configured default folder instead of the views folder - Thanks to @anareaty and @sylvainfct-dot for reporting - (#1291) Fixed Microsoft Calendar OAuth documentation using wrong redirect URI - Added instructions for configuring via Azure manifest editor - Thanks to @PlecotusAustriacus for reporting ## Added - (#803) New command "Convert current note to task" to add task properties to an existing note - Thanks to @GardarikanetS and @diegomarzaa for suggesting - (#1080) Custom user fields now support default values - Each field type has an appropriate input: text field, number input, toggle, date preset dropdown, or comma-separated list - Defaults are applied when creating tasks via modal, instant conversion, "Create or open task" command, or HTTP API - Thanks to @bradyrx for suggesting ## Changed - Added documentation link to settings panel (links to tasknotes.dev) - Reorganized settings panel for improved discoverability - Removed "Defaults" tab - default values are now configured alongside each property in the Task Properties tab - Moved task filename format settings to the Title property section - Moved project autosuggest settings to the Projects property section - Body template setting moved to the Features tab - Added descriptions to each property explaining its purpose - Moved "Folder for converted tasks" setting to General tab under Task Storage for better discoverability - Updated setting description to clarify that leaving empty uses the default tasks folder `});var MAe,AAe=y(()=>{MAe='# TaskNotes 4.1.1\n\n## Added\n\n- (#1277) Icon autosuggestion for custom status settings\n - Type to search through all available Lucide icons\n - Thanks to @Arachnidai for the suggestion\n- New formula properties in default Base templates\n - **Date calculations**: `daysUntilDue`, `daysUntilScheduled`, `daysSinceCreated`, `daysSinceModified`\n - **Boolean helpers**: `isOverdue`, `isDueToday`, `isDueThisWeek`, `isScheduledToday`, `isRecurring`, `hasTimeEstimate`\n - **Time tracking**: `timeRemaining`, `efficiencyRatio`, `timeTrackedThisWeek`, `timeTrackedToday`, `timeTrackedFormatted`\n - **Grouping**: `dueMonth`, `dueWeek`, `scheduledMonth`, `scheduledWeek`, `dueDateCategory`, `timeEstimateCategory`, `ageCategory`, `createdMonth`, `modifiedMonth`, `priorityCategory`, `projectCount`, `contextCount`, `trackingStatus`\n - **Combined due/scheduled**: `nextDate`, `daysUntilNext`, `hasDate`, `isToday`, `isThisWeek`, `nextDateCategory`, `nextDateMonth`, `nextDateWeek` - work with whichever date comes first\n - **Sorting**: `priorityWeight`, `urgencyScore` (combines priority with date proximity)\n - **Display**: `dueDateDisplay` (relative dates like "Today", "Tomorrow", "3d ago")\n - Action-oriented views (Not Blocked, Today, Overdue, This Week) now sort by urgency score, showing most important tasks first\n - See [Default Base Templates documentation](https://tasknotes.dev/views/default-base-templates) for full details\n - **Note**: To get these new formulas, either copy them from the documentation, or delete your `.base` files in `TaskNotes/Views/` and restart Obsidian to regenerate them\n\n## Changed\n\n- (#1282) Added spacing between task title and metadata in inline task widgets for improved readability\n - Thanks to @3zra47 for the suggestion\n- Custom status icons now display in all context menus (task context menu, batch operations menu, and task creation/edit modals)\n- Added embedded video guide for Google Calendar OAuth setup in documentation\n - Thanks to [@antoneheyward](https://www.youtube.com/@antoneheyward) for the tutorial\n\n## Fixed\n\n- (#1279) Fixed Kanban column width setting not being respected on mobile devices\n - Thanks to @guncav for reporting\n- (#1026), (#1177) Fixed recurring task completion from Base views recording the wrong date for users in negative UTC offset timezones (e.g., PST/PDT) when completing tasks in the evening\n - The bug caused `complete_instances` to record the next day instead of the user\'s current calendar day\n - Thanks to @3zra47 and @nslee123 for reporting and providing detailed reproduction steps\n\n'});var _Ae,IAe=y(()=>{_Ae=`# TaskNotes 4.1.0 ## Added - (#1245), (#793) Added custom icon support for task statuses - Configure a Lucide icon name (e.g., \`check\`, \`circle\`, \`clock\`) per status in Settings \u2192 Task Properties \u2192 Task Statuses - Icons display instead of the colored dot, inheriting the status color - Browse available icons at [lucide.dev](https://lucide.dev) - Improves accessibility by allowing shape-based status differentiation - Thanks to @3Fish for the feature request and @Raonmir2, @aubreyz, @prayidae, and @anareaty for the discussion on accessibility and icon-based indicators - (#1259) Added [Property Types Reference](../settings/property-types-reference.md) documentation - Documents expected data types (text, list, date, number) for all frontmatter properties - Includes format specifications, examples, and a complete YAML reference - Thanks to @Oblique82 for the suggestion - (#1248) Added formula property support for sub-grouping in Bases Task List view - Formula properties (e.g., \`formula.myFormula\`) now appear in the Sub-group by dropdown - Supports all Bases Value types including strings, numbers, booleans, dates, and lists - Thanks to @prayidae for the feature request - (#1070) Added formula property support for swimlanes in Bases Kanban view - Formula properties now appear in the Swim Lane dropdown - Fixed swimlanes displaying empty when grouping by formula properties - Note: Dragging tasks between formula-based columns/swimlanes is disabled (formulas are computed values) - Thanks to @cathywu for reporting - (#1010), (#1126) Added batch task selection and editing in Task List and Kanban views - Shift+click to select multiple tasks - Right-click selected tasks to open batch context menu - Batch operations: change status, priority, due date, scheduled date, archive, delete - Drag multiple selected cards in Kanban to move them together - Click the selection count indicator to clear selection - Thanks to @jalooc and @solidabstract for the feature requests - (#1207) Added inline search box to Bases views (Task List, Kanban, Calendar) - Enable via "Enable search box" toggle in view settings - Searches across title, status, priority, tags, contexts, projects, and visible custom properties - Press Escape or click \xD7 to clear search - Thanks to @renatomen for the PR - (#363) Added "Create or open task" command with NLP-based quick task creation - Open via command palette or assign a hotkey - Search existing tasks or type natural language to create new tasks (e.g., "Buy groceries tomorrow #shopping") - Press Enter to select an existing task, Shift+Enter to create a new task - Real-time preview shows parsed title, due date, priority, tags, and other metadata - Can be used when adding sub-tasks to create sub-tasks on-the-fly - Thanks to @luciolebrillante for the feature request - (#1044), (#1222) Added unsaved changes confirmation when closing task edit modal - Detects modifications to any field (title, dates, priority, tags, etc.) - Shows confirmation dialog with Save/Discard/Keep Editing options - Prevents accidental data loss from clicking outside the modal or pressing Escape - Thanks to @renatomen for the PR and @0-BSCode for the feature request - (#904) Added visual highlighting for overdue and past dates on task cards - Overdue due dates now display in red text - Past scheduled dates now display in blue text - Thanks to @ras0q for the suggestion - (#1164) Added \`priorityWeight\` formula to all default Bases templates for priority-based sorting - Formula maps each priority value to a numeric weight based on your custom priority configuration - Sort by \`formula.priorityWeight\` in ascending order to get highest priority tasks first - Example: \`if(priority=="high",0,if(priority=="normal",1,if(priority=="low",2,999)))\` - Thanks to @jhedlund for the suggestion - (#1257), (#1064) Added configurable event stacking options for Bases Calendar view - **Allow events to overlap**: Toggle whether timed events visually overlap or display side-by-side in week/day views - **Max stacked events**: Limit horizontal event stacking in week/day views (0 = unlimited) - **Max events per day**: Limit events shown per day cell in month view (0 = auto based on cell height) - **Max event rows per day**: Limit event rows per day cell in month view (0 = unlimited) - Configure per-view in the Bases Calendar view settings under Layout - Thanks to @3zra47 and @hasanyilmaz for the feature requests ## Changed - Improved inline task conversion to merge TasksPlugin and NLP parsing results - Previously, if a task had hashtags (e.g., \`- [ ] Buy milk tomorrow #groceries\`), NLP parsing was skipped entirely - Now NLP always parses the clean title to extract dates/times, then merges with TasksPlugin-extracted metadata - TasksPlugin explicit values (emoji dates like \u{1F4C5}) take priority over NLP-inferred values - Tags, contexts, and projects from both sources are combined and deduplicated - Polished task card styling for a more native Obsidian look - Simplified hover and focus states to use native Obsidian colors - Removed blur filter and shadows from metadata pills - Fixed subtask chevron vertical alignment with status dot - Reduced swimlane label column width in Kanban view - (#1151) Increased mini calendar heatmap color intensity for better visibility - Days with notes now show more noticeable colors, especially with low note counts - Intensity levels increased from 10/25/45/65% to 25/40/55/70% - Thanks to @arreme for the suggestion ## Fixed - (#1271) Fixed custom user fields not appearing in task modals after creation - New custom fields are now automatically added to both creation and edit modals - Deleting a custom field also removes it from modal configuration - Updating a field's display name syncs to the modal configuration - Thanks to @craziedde for reporting - (#1256) Fixed links in custom properties not rendering as clickable in task cards - Wikilinks (\`[[Note]]\`) now render correctly in Bases views - Markdown links (\`[text](url)\`) now render correctly in all views - Links in list-type properties are also properly rendered - Thanks to @3zra47 for reporting - (#1157) Fixed inline task embeds breaking layout when placed in indented bullet lists - Task titles now wrap naturally within line boundaries instead of forcing the entire card to a new line - Metadata (dates, tags, etc.) stays inline when space permits, with horizontal scrolling on hover when needed - Thanks to @3zra47 for reporting - (#1241) Fixed deleting custom priorities in settings removing the wrong priority when multiple priorities exist - Thanks to @Anthonyhunter100 for reporting - (#1165) Fixed Kanban view grouping by list properties (contexts, tags, projects) treating multiple values as a single combined column - Tasks with multiple values now appear in each individual column (e.g., a task with \`contexts: [work, call]\` appears in both "work" and "call" columns) - Added "Show items in multiple columns" option (enabled by default) to control this behavior - Fixed drag-and-drop to properly add/remove individual values instead of replacing the entire list - Fixed swimlane mode to also respect list property explosion - Thanks to @dictionarymouse for reporting - (#1217) Fixed inconsistent Ctrl+Click/Cmd+Click behavior for opening notes in new tabs - Note cards and internal links now properly support Ctrl/Cmd+Click to open in new tab - Added middle-click support for opening in new tab - Thanks to @diegomarzaa for reporting - (#1265) Fixed task edit modal corrupting markdown-style project links on save - Links like \`[Project Name](path.md)\` were being wrapped in extra brackets: \`[[[Project Name](path.md)]]\` - Plain text project names are now preserved as-is instead of being converted to wikilinks - Markdown-style project links now resolve properly and display as linked (not orange/unresolved) - Thanks to @minchinweb for reporting - (#1266) Fixed Kanban view scroll position resetting to top of column after any change - Clicking status dots, priority, or other task properties no longer jumps the column back to top - Scroll position is now preserved for both regular columns and swimlane cells - Thanks to @essouflenfer for reporting - (#485), (#1221), (#1262) Fixed NLP parser not recognizing non-ASCII characters in tags, contexts, and projects - Tags like \`#investigaci\xF3n\` were being truncated at accented characters (e.g., \`#investigaci\`) - Non-Latin scripts (Chinese, Cyrillic, Japanese, etc.) were not recognized at all (e.g., \`@\u5BB6\`, \`#\u6742\u4E8B\`, \`@\u043E\u0437\u043D\u0430\u043A\u043E\u043C\u0438\u0442\u044C\u0441\u044F\`) - Parser now uses Unicode-aware regex patterns to support all languages and scripts - Thanks to @Arachnidai, @fidelaznar, and @qian1ing for reporting - (#1249) Fixed project preview in task creation modal showing quadruple brackets (\`[[[[Project]]]]\`) - Projects selected from autocomplete were being wrapped in extra wikilink brackets in the preview display - Thanks to @2vzqwz8tvg-png for reporting - (#1249) Fixed custom priority ordering in settings being unclear and non-intuitive - Priority cards are now draggable to reorder (like statuses) - Priorities are displayed in weight order (lowest to highest priority) - New priorities are added at the end (highest priority) instead of with a fixed weight - Thanks to @2vzqwz8tvg-png for reporting - (#1272) Fixed recurrence anchor not being saved when set to "completion" during task creation - Selecting "completion" as the recurrence anchor now correctly persists to the task frontmatter - Thanks to @blaxcky for reporting - (#1128) Fixed NLP parser not allowing slashes in context names - Contexts like \`@shopping/groceries\` were being split into \`@shopping\` and \`/groceries\` - Hierarchical context names now work the same as tags and projects - Thanks to @wealthychef1 for reporting - (#1170) Fixed \`dateCreated\` and \`dateModified\` not using custom property names when creating notes from calendar events - Notes created from ICS events now respect the field mapping configured in settings - Thanks to @maddie-m for reporting - (#1171) Fixed calendar event toggles not responding to changes after initial load - Toggling "Show scheduled tasks", "Show due tasks", and other event filters now correctly updates the calendar - Previously, changing these toggles had no effect until the view was reloaded - Thanks to @hangryscribe3 for reporting - (#1198) Fixed project links being created relative to the wrong file when editing from Bases views - Relative paths in project links are now correctly resolved relative to the task note file - Previously, editing a task from a Bases view would create project links relative to the \`.base\` file - Thanks to @minchinweb for reporting `});var NAe,RAe=y(()=>{NAe=`# TaskNotes 4.0.5 ## Changed - (#790) Task edit modal now shows unresolved project links with appropriate styling - Similar to how dependencies are displayed, unresolved projects now appear with visual indication - Hovering over an unresolved project shows a tooltip explaining it couldn't be resolved - Thanks to @aubreyz for reporting ## Fixed - (#1011) Fixed chevrons incorrectly showing on tasks with no subtasks - Project index was incorrectly adding all linked files instead of only files referenced in the projects field - Now properly parses the projects field and only indexes those specific files as projects - Also fixed alias handling in project and dependency links - aliases are now correctly stripped before link resolution - Thanks to @craziedde for reporting - (#1200) Fixed kanban drag & drop not updating task properties correctly - Dragging tasks to different columns now properly triggers business logic (completedDate, auto-archive, webhooks) - Previously, kanban updates bypassed \`updateProperty\` and directly modified frontmatter - Thanks very much to @tvoklov for the PR - (#1203) Fixed autocomplete dropdown being clipped inside NLP field boundaries - Configure CodeMirror tooltips to render in document.body instead of constrained editor container - Prevents suggestion dropdown from being hidden when it extends beyond the NLP field height - Thanks to @Andrei-Ioda for reporting - (#1172) Fixed task lists and checkboxes rendering incorrectly in task details editor - Remove padding-left override on \`.cm-line\` to allow CodeMirror decorations (checkboxes, indentation) to render properly - Content padding is now handled by \`.cm-content\` while \`.cm-line\` uses natural spacing - Thanks to @nightroman for reporting - Fixed relationships widget not appearing on project notes without frontmatter - Widget now correctly shows on any note referenced as a project by tasks, regardless of whether the note has frontmatter - Fixed task card and relationships widgets not appearing when opening notes in source mode - Removed live preview mode restriction to allow widgets to render in both source and live preview modes - (#901) Fixed calendar view toolbar buttons overflowing on narrow screens - Added \`flex-wrap: wrap\` to calendar header toolbar to allow buttons to wrap to multiple lines - Thanks to @RumiaKitinari for reporting - (#1193), (#1194), (#1185) Fixed new calendar views not respecting user's default calendar settings - Previously, new Bases calendar views used hardcoded inline defaults instead of user-configured preferences - Calendar view initialization now correctly uses \`plugin.settings.calendarViewSettings\` as the fallback - Thanks @ki5ck, @minchinweb and @ThamirysOlv for reporting - Fixed calendar to ensure that it respects user's locale - Tries to use calendar locale, then tries UI language, then system language, then falls back to English - (#1043) Fixed default reminders with "at time of event" (0 offset) not being applied to tasks - UI was displaying "1" instead of "0" for zero-offset reminders in settings - Thanks to @dblinnikov for reporting - (#1206) Fixed NLP status parsing regressions with trigger prefixes and temporal keywords - Manually typing status trigger + label now correctly parses (e.g., \`*Done\` when label is \`Done\`) - Status values containing temporal keywords no longer misparsed as dates (e.g., \`Expedite = Now\`) - Thanks very much to @renatomen for the PR - (#1212) Fixed "Show release notes on update" toggle not saving correctly - Thanks to @Jon-dog for reporting - (#1197) Add Portuguese language to list of translations in general tab settings - Allows users to select the Portuguese translation option - Thanks to @andysteel for the PR - Fixed file properties displaying incorrectly in Bases views - File properties like \`file.name\`, \`file.basename\`, \`file.size\`, etc. were showing as "Title" or returning null - Now correctly extracts and displays all file properties from Obsidian's file metadata - Supports both direct TFile properties (name, basename, extension, path, size, ctime, mtime) and computed properties (links, embeds, tags, backlinks, aliases) `});var FAe,OAe=y(()=>{FAe=`# TaskNotes 4.0.4 ## Added - (#1134, #779) Added CMD+Enter (Mac) / Ctrl+Enter (Windows/Linux) keyboard shortcut support for saving in all modals - Works from any input field in task creation, task edit, time entry, timeblock, and property selector modals - Thanks to @luckb0x, @hamlim and @nightroman for the feature requests ## Fixed - (#1181) Fixed vertical overflow in Kanban view columns with fewer than 15 tasks - Prevents cards from extending beyond column boundaries before virtualization activates - Thanks to @lomarcanys for reporting - (#1177) Bases views now anchor recurring completion and calendar navigation to the right date - Recurring completion from Bases Task List/Kanban uses the task's scheduled/due date instead of "today" (fixes complete_instances) - Bases calendar navigation and property-based events use UTC anchors to avoid previous-day jumps - Thanks to @nslee123 for flagging the issue - Bases calendar navigation now respects UTC-anchored dates to avoid landing on the previous day - Corrected all-day end date calculation to prevent off-by-one spans - Added regression test for the UTC anchor behavior - Thanks to KaCii for [flagging the issue](https://discord.com/channels/686053708261228577/1433165116702199880/1439757826380660767) ## Changed - Refactored plugin styling to better align with Obsidian's native UI conventions - Replaced all \`cursor: pointer\` with \`cursor: var(--cursor)\` (100+ instances) to follow Obsidian's cursor convention - Removed forced \`border: none; box-shadow: none\` rules that were fighting against Obsidian's native button styling - Scoped custom \`.tn-btn\` button system to settings modal only (\`.mod-settings\`), allowing Obsidian's native button styles to work elsewhere - Thanks to @kepano for guidance `});var LAe,zAe=y(()=>{LAe=`# TaskNotes 4.0.3 ## Fixed - (#1157) Fixed task embeds appearing on new line instead of inline with bullets in lists - Changed inline task cards to use span elements instead of divs for proper inline flow - Added max-width constraint to prevent wrapping when tasks are wider than editor - Task embeds now display correctly inline with bullet points during live preview - Thanks to @3zra47 for reporting - (#1168) Fixed mini calendar stealing focus every few seconds when pinned to sidebar - Thanks to @DearHaruHaru for reporting - (#1161, #1162) Fixed "unexpected scalar" YAML parsing error in generated tasks-default.base template - Changed nested quotes in "Not Blocked" filter from double to single quotes - Thanks to @benschifman and @InterstellarRaccoon for reporting, @GarrettKaupp for identifying the fix ## Changed - Updated task modal UI to use native Obsidian patterns for better theme compatibility - Thanks to @kepano for feedback `});var jAe,$Ae=y(()=>{jAe=`# TaskNotes 4.0.2 This release fixes some of the more urgent (and easy-to-fix) bugs that were introduced in the v4 major release. Thanks to everyone for your patience, and to those who have reported issues, for taking the time to do so. There will be more releases over the coming weeks to iron out some of v4's kinks. ## Added - Added "Not Blocked" view to default task list template - Shows incomplete tasks that are ready to work on (not blocked by incomplete dependencies) - Uses Bases \`list.filter()\` to check completion status of each blocking task - This new view can be accessed by regenerating the Task List view, or by copying the filters from the [default base templates documentation](https://tasknotes.dev/views/default-base-templates) ## Fixed - (#1145, #1156) Fixed default Kanban view requiring manual 'Group by' configuration - Default Kanban template now automatically includes \`groupBy\` property set to status - Resolves "Kanban requires a 'Group by' property to be configured" error on first use - Users no longer need to manually configure grouping through the Sort menu - Thanks to @randomness42 and @seepage87 for reporting - Fixed user-defined custom fields appearing as \`user:field_xxx\` in generated base templates - Custom fields now use their actual property names (e.g., \`effort\` instead of \`user:field_1761435303709\`) - Ensures Bases can properly query user-defined properties - Also fixed \`totalTrackedTime\` to correctly map to the configured \`timeEntries\` property name - (#1145) Improved Kanban error message when no 'Group by' property is configured - Now includes instructions: "Click the 'Sort' button and select a property under 'Group by'" - Thanks to @randomness42 for the suggestion - (#1139, #1141) Fixed relationships widget not appearing in project notes - Project references are now resolved to full file paths when indexing - Uses Obsidian's link resolution API to handle wikilinks, markdown links, and relative paths - Restores v3.x behavior where subtasks appear in parent project notes - Thanks to @jhedlund, @n1njaznutz, and @luckb0x for reporting and testing - Fixed dependency blocking status to be status-aware - "Blocked (x)" pill now only appears when tasks have **incomplete** blocking dependencies - Tasks with all completed blocking dependencies no longer show as blocked - Fixed cache invalidation bug causing blocking/blocked pills to disappear when editing tasks - When a task is modified, only forward dependencies are cleared (stored in its frontmatter) - Reverse dependencies are preserved (stored in other tasks' frontmatter) ## Changed - Removed custom TaskNotes icon from task modals - Task creation and edit modals now use Obsidian's standard title styling - Thanks to @kepano for the suggestion - Moved default base templates documentation to \`docs/views/\` - Location: \`docs/views/default-base-templates.md\` - Added cross-references to official Obsidian Bases documentation - Updated code comments to reference new documentation path - Fixed incorrect quote escaping in default base templates documentation - YAML examples now use proper single quotes for strings containing double quotes `});var BAe,UAe=y(()=>{BAe=`# TaskNotes 4 TaskNotes 4.0.1 is a stability-focused major release that finishes the migration to Obsidian's Bases core plugin. Every task-facing view (Task List, Kanban, Calendar, Agenda, Mini Calendar, and the embedded Relationships widget) now runs on \`.base\` files. This refactor simplifies the plugin codebase, removes bespoke UI logic, and lets workflows feel native to Obsidian\u2014views are just files in your vault. ## Highlights **New features and improvements:** - Performance improvements - Virtual scrolling in Task List and Kanban views handles **30,000+ tasks** without performance degradation - **OAuth calendar integration** - Google Calendar and Microsoft Outlook bi-directional sync - Drag calendar events in the TaskNotes calendar to update them online - **Configurable modals and NLP** - New Modal Fields settings tab for moving, hiding, or requiring fields in create/edit modals - Rich markdown editor and customizable NLP triggers, including autocomplete for user fields - **Time management features** - Time Entry Editor Modal - Improved Timeblock creation and management - Completion-based recurrence with \`recurrence_anchor\` field - Skippable recurrence instances **Bases architecture changes:** - **Bases-first architecture** - Task views ship as \`.base\` files inside \`TaskNotes/Views/\` - Commands and ribbon buttons now open files you control - Filtering/grouping/sorting uses Bases YAML instead of TaskNotes-specific UI - Agenda is a dedicated list-mode calendar \`.base\` file for fast daily/weekly reviews - **Inline workflows stay in sync** - Unified Relationships widget embeds a Bases view so project subtasks, dependencies, and blocking tasks stay in one place - Task cards inside notes honor the same Bases filtering/grouping rules as standalone views ## Why Bases? Moving everything to Bases allowed us to delete thousands of lines of bespoke filtering logic, state management, and widget code. The plugin now leans on Obsidian's supported API, which: - Reduces maintenance overhead and improves reliability - Lets advanced users version-control and audit their view definitions - Makes saved views portable between vaults - Keeps TaskNotes behavior consistent with other Obsidian-native workflows ## Upgrade Notes - Obsidian **1.10.1 or later** is required (Bases public API with group-by support) - Enable the **Bases** core plugin before opening TaskNotes views - Run **Settings \u2192 TaskNotes \u2192 General \u2192 Create Default Files** if you need fresh \`.base\` files - Use **Export All Saved Views to Bases** to convert any legacy FilterBar saved views into \`.base\` files - The Relationships widget uses \`TaskNotes/Views/relationships.base\`; adjust that file to change what appears inside notes ## Breaking Changes - The old FilterBar UI has been removed\u2014all filtering and saved views live in \`.base\` files - Legacy widget settings (\`showProjectSubtasks\`, \`showTaskDependencies\`, etc.) were replaced with \`showRelationships\` and \`relationshipsPosition\` - Task view commands now fail if their mapped \`.base\` file is missing; configure paths under **Settings \u2192 TaskNotes \u2192 General \u2192 View Commands** - **Priority sorting now uses alphabetical order instead of custom weights** - In v3, TaskNotes used priority "weights" to determine sort order (higher weight = higher priority) - In v4, Obsidian's Bases plugin sorts priorities alphabetically by their value - The weight field has been removed from the settings UI - **Workaround**: Name your priority values to sort alphabetically in your desired order - Example: \`1-urgent\`, \`2-high\`, \`3-medium\`, \`4-normal\`, \`5-low\` - Or: \`a-urgent\`, \`b-high\`, \`c-medium\`, \`d-normal\`, \`e-low\` - Agenda view has been replaced by the list view in Calendar - Grouping is not supported in this view, so the "Overdue" group is no longer provided - A separate "Overdue" view is available in the "Task List" base file ## Known Issues - Users upgrading from versions prior to 3.x should export saved views to Bases before deleting old plugin data - Embedded Bases views still require the Bases plugin to remain enabled; disabling Bases will hide TaskNotes task views ## Details ### Added - Virtual scrolling and lazy rendering to Bases views for handling thousands of notes without performance degradation - Thanks to @aubreyz and @turingexmachina for reporting performance issues and help with diagnosis - Google Calendar and Microsoft Outlook integration via OAuth 2.0 with automatic syncing - Time Entry Editor Modal for managing time entries (Alt-drag on calendar to create) - Kanban Swimlane Layout with horizontal grouping and configurable column widths - Saved View Converter button in settings to convert v3 saved filter views to \`.base\` files - Context menus for time entries and ICS events in calendar views - Calendar icon to ICS event titles for better visual distinction - Hover tooltips for timeblocks in calendar views - MiniCalendar view for Bases integration with monthly grid and dot indicators - Thanks to @aubreyz and @turingexmachina for reporting performance issues and help with diagnosis - (#1090) Portuguese (Brazil) translation - Thanks to @andysteel for the contribution - Configurable task modal fields with drag-and-drop reordering in new "Modal Fields" settings tab - Rich markdown editor for NLP task creation with syntax highlighting and wikilink support - Customizable NLP triggers with autocomplete and keyboard navigation - Inline task link overlay enhancements with configurable visible properties - Kanban column reordering via drag and drop with saved order per grouping property - Mini calendar enhancements including week numbers, heat map visualization, note preview tooltips, and keyboard navigation - Unified Relationships widget consolidating project subtasks, dependencies, and blocking relationships with automatic tabs - Updated task card styling with improved hover effects, shadows, and gradient accents - (#361) Completion-based recurrence support with \`recurrence_anchor\` field for tasks that recur based on completion date - Thanks to @luciolebrillante for the original feature request, and @jhedlund, @nschenone, @BryanWall, @realJohnDoe, and @kazerniel for additional input and interest - (#416) Support for skipped recurrence instances with \`skipped_instances\` field and right-click skip/unskip in calendar - Thanks to @mdbraber for suggesting the array approach and @jerzy-dudzic for reporting the issue - Sub-grouping support to Bases Task List view with nested grouping by any property and collapsible groups - Documentation for default Bases templates showing all default \`.base\` file templates with examples ### Changed - All views (Calendar, MiniCalendar, Kanban, Tasks, Agenda, Project Subtasks) now use Bases architecture with \`.base\` files - Calendar sources (Google, Microsoft, ICS events) can be toggled independently with improved timezone handling - Reorganized settings tabs with OAuth calendar settings in Integrations tab - Refactored Bases integration to use public API and trust pre-sorted data - Refactored calendar modules to use ES6 imports instead of lazy require() calls - Time entry events now show task context menu on right-click - Replaced MinimalNativeCache with just-in-time TaskManager for zero startup time and always-fresh task data - Completed internationalization with 100% translation coverage across all 6 supported languages - Migrated to i18n-state-manager CLI tool for improved translation management - Bases view templates now generate dynamically based on user settings with adaptive task filters - Updated Bases CalendarView to show TaskNotes in property-based events - NLP system overhaul with consolidated trigger configuration and direct NaturalLanguageParser usage - Simplified TaskCard interface and refactored TaskLinkWidget for consistency - Settings UI enhancements with NLP triggers configurable through Features tab - Refactored Bases views to use Component lifecycle properly with automatic cleanup - Improved development experience by converting ESLint errors to warnings - Renamed "Advanced Calendar" to "Calendar" throughout the UI - Improved timeblock visual styling in calendar views with reduced border width and softer shadows - Updated "Export All Views" button to "Export V3 Views" to clarify it migrates v3 saved views - Improved internationalization (i18n) support in General settings tab with all Bases integration settings using translation keys - Changed default Tasks List template view order with "All Tasks" first and added "Unscheduled" view ### Fixed - (#843) Fixed task tag being added when "Identify tasks by" is set to "Property" - Thanks to @jack2game for reporting - Fixed dark mode calendar borders - Fixed Bases Kanban column ordering - Thanks to @mweichert for reporting - Fixed state management bug in FilterSettingsComponent - Fixed timezone handling for recurring events - (#1022, #684) Fixed tasks randomly disappearing when Smart Connections plugin is enabled by eliminating race condition - Thanks to @alejandrospoz, @seepage87, @amarjt, @luckb0x, and camara-tech for reporting and help debugging - (#992) Fixed "Failed to resolve module specifier 'obsidian'" error when moving recurring task instances in calendar - Thanks to @jalooc for reporting - Fixed task dependencies not displaying on task cards with proper isBlocked and isBlocking flags - Fixed Bases property mapping for user-configured field names - Fixed Bases views not respecting user-configured visible properties - Fixed MiniCalendar UTC anchoring for consistent timezone-independent date handling - Fixed DateValue conversion in BasesDataAdapter for property-based events in CalendarView - (#1084) Fixed word wrapping in NLP preview items - Thanks to @maybetm for the fix - (#975) Fixed advanced calendar list headers not respecting theme colors - Thanks to @hugohil for the fix - (#1089) Fixed embedded task list bases growing unbounded and leaving large empty space - Thanks to @same774 for reporting with screenshot - Fixed "Highlight today" toggle and calendar view type persistence in Bases Calendar view options - (#1050) Fixed task modal adding unwanted empty contexts and projects arrays - Thanks to @nightroman for reporting - Fixed inline task link overlay layout prioritization and horizontal scrolling for metadata - Fixed group collapse/expand functionality in TaskListView - Fixed config loading race condition in KanbanView and CalendarView - Fixed MiniCalendarView to use direct Bases API like other views - (#893) Fixed yearly recurring tasks not always updating scheduled date to next occurrence when completed - Thanks to @VenturaNotes for reporting - (#951) Fixed yearly recurring tasks not showing up in calendar's weekly, 3-day, or day views - Thanks to @bespokecomp for reporting - (#889) Fixed git merge conflicts in calendar subscription metadata by storing in memory instead of disk - Thanks to @karlfrohlich for reporting - Fixed recurrence modal not loading DTSTART date/time when editing existing recurrence rules - (#1097) Fixed custom properties and formulas not displaying in Bases views using getValue() method - Thanks to @cathywu for reporting - (#1099) Fixed issues with default Bases file creation including double-prefix bug and race condition - Thanks to @kmaustral for reporting - (#1110) Fixed open recurring tasks appearing crossed out in Tasks view by using UTC-anchored dates - Thanks to @kmaustral for reporting - (#1118) Fixed user-defined fields not working in inline task conversion to TaskNote - Thanks to @guncav for reporting - Fixed kanban column width CSS constraints not matching settings slider range - Fixed Kanban view showing empty columns for all user-defined statuses when grouping by status - Thanks to @williamcheuk03 for reporting - (#1103) Fixed TaskNotes/Views folder being created unnecessarily on startup - Thanks to @Wayment9504 for reporting - (#1133) Fixed empty priority columns not showing in Kanban view when "Hide empty columns" is disabled - Thanks to @luckb0x for reporting - Fixed OAuth calendar cards showing "Unknown account" by removing non-functional Account field - Thanks to @Oblique for reporting - Fixed incorrect Bases syntax in default template files with correct parameter naming - Fixed incorrect Bases syntax in "Export V3 Views" feature with correct YAML structure - (#1127) Fixed custom priority colors not being respected in Task List and Subtasks sections - Thanks to @HPmattsloper for reporting - (#1043) Fixed inability to set "at time of event" (0 offset) as default reminder in settings - Thanks to @dblinnikov for reporting - (#1055) Fixed break sessions being logged as \`type: work\` when started via command/hotkey - Thanks to @0-BSCode for reporting and debugging - (#1024) Fixed date/time picker immediately closing when selecting time on iPhone by refactoring to native Modal components - Thanks to @3zra47 for reporting - (#1122) Fixed inline task titles being truncated too aggressively with increased max-width - Thanks to @jacorvillo for reporting - Fixed Obsidian crashes when invalid time values entered in Bases calendar view configuration - (#1120) Fixed custom field mappings not being respected throughout the application - Thanks to @kmaustral for reporting - (#1121) Fixed custom user fields being saved with auto-generated IDs instead of user-defined property keys - Thanks to @guncav for reporting - (#1123) Fixed relationships widget only displaying on task notes, now appears on both task and project notes - Thanks to @dblinnikov for reporting - Fixed time entries not showing in calendar view for tasks without scheduled or due dates - (#1091) Fixed task card and relationships widgets appearing inside footnote editors - Thanks to @3zra47 for reporting - (#1086) Fixed calendar "+more" popover showing white text on white background in dark mode - Thanks to @same774 for reporting - (#1076) Fixed inability to create timeblocks ending at midnight (00:00) - Thanks to @skoove for reporting - (#958) Fixed cursor jumping and layout shifts when typing near task card or relationships widgets in live preview - Thanks to @thesmithmode for detailed debugging information - (#513) Fixed task card and relationships widgets not appearing in reading mode and fixed critical memory leak - Thanks to @berzernberg for reporting ### Removed - Removed StatusSuggestionService (functionality consolidated into NaturalLanguageParser) - Removed legacy FilterBar UI - all filtering now lives in \`.base\` files - Removed legacy views `});var HAe,VAe=y(()=>{HAe=`# TaskNotes 4.0.0-beta.3 > **Beta Release** > > You may encounter issues. Report problems on [GitHub Issues](https://github.com/callumalpass/tasknotes/issues). ## Added - Updated task card styling - Increased status dot size from 16px to 18px - Added subtle shadows and transitions to card hover states - Updated hover effects on status and priority dots with scaling and removed glow - Modified metadata pills with backdrop blur and adjusted spacing - Added box shadows to interactive elements (dates, projects, tags) on hover - Updated animations to use cubic-bezier easing - Added gradient accents to subtask and blocking task borders - Fixed subtasks appearing behind parent card hover backgrounds - Fixed subtask click and context menu events bubbling to parent cards - Fixed subtasks inheriting parent priority and status colors - (#361) Added completion-based recurrence support with \`recurrence_anchor\` field - Tasks can now recur based on completion date instead of scheduled date - Set \`recurrence_anchor: completion\` in task frontmatter to enable this behavior - When completing a recurring task, the next occurrence will be scheduled relative to the completion date - The DTSTART in the RRULE automatically updates to the completion date, ensuring calendar views show future occurrences at the correct dates - Defaults to \`scheduled\` (original behavior) if not specified - Useful for tasks like "Exercise weekly" where you want the next occurrence 7 days after you actually complete it, not 7 days after it was scheduled - Example: Complete a weekly task 2 days late, and the next occurrence will be 7 days from the completion date (not the original scheduled date) - Thanks to @luciolebrillante for the original feature request, and @jhedlund, @nschenone, @BryanWall, @realJohnDoe, and @kazerniel for additional input and interest - (#416) Added support for skipped recurrence instances with \`skipped_instances\` field - Recurring tasks can now have individual instances marked as "skipped" without completing them - Skipped instances are stored in the \`skipped_instances\` frontmatter array (e.g., \`["2025-11-15", "2025-11-22"]\`) - Right-click on a recurring task instance in calendar views to skip/unskip it - Visual styling differentiates skipped instances: - Calendar views: Gray background with muted appearance - Task cards: Strike-through text with gray styling - Skipped instances don't affect the recurrence pattern - future instances continue as scheduled - Useful for holidays, vacations, or other planned exceptions to recurring tasks - Thanks to @mdbraber for the suggestion to use an array similar to \`complete_instances\`, and @jerzy-dudzic for reporting the issue ## Fixed - (#893) Fixed yearly recurring tasks not always updating scheduled date to next occurrence when completed - Increased look-ahead period for yearly recurrence from 365 days to 800 days (~2.2 years) - Also optimized look-ahead periods for other frequencies: daily (30 days), weekly (90 days), monthly (400 days) - Ensures the next occurrence is always found when completing recurring task instances - Thanks to @VenturaNotes for reporting - (#951) Fixed yearly recurring tasks not showing up in calendar's weekly, 3-day, or day views - Extended the look-ahead period for yearly recurring tasks when generating calendar instances - Calendar views now look ahead ~2.2 years for yearly tasks to ensure occurrences appear even in short date ranges - Only displays instances that fall within the actual visible calendar range - Weekly recurring tasks were unaffected and continued to work correctly - Thanks to @bespokecomp for reporting - (#889) Fixed git merge conflicts in calendar subscription metadata - Calendar subscription \`lastFetched\` and \`lastError\` fields are now stored in memory instead of being saved to disk - Prevents git conflicts when syncing vaults across multiple computers that independently fetch calendar subscriptions - The "last synced" timestamp in settings will reset on plugin reload, but subscriptions will re-fetch automatically - Thanks to @karlfrohlich for reporting - Fixed recurrence modal not loading DTSTART date/time when editing existing recurrence rules - The custom recurrence modal now correctly parses and displays the start date and time fields - Fixed parser that was splitting on \`=\` instead of \`:\` for DTSTART values - (#1097) Fixed custom properties and formulas not displaying in Bases views - Updated TaskCard to use Bases API's getValue() method for formulas and custom note properties - Formulas now work correctly using \`formula.NAME\` syntax - Custom note properties now work correctly using \`note.PROPERTY\` syntax - Thanks to @cathywu for reporting - (#1099) Fixed issues with default Bases file creation - Fixed double-prefix bug in relationships template that generated invalid filter expressions like \`note.note.projects\` - Fixed race condition where files created during plugin load wouldn't appear in file explorer - Default Bases files now generate with correct property paths and appear reliably in the file explorer - Thanks to @kmaustral for reporting - (#1110) Fixed open recurring tasks appearing crossed out in Tasks view - Removed stale \`selectedDate\` property that was never updated in v4 - Tasks view now uses fresh UTC-anchored "today" for correct recurring task completion status - Fixes issue where tasks completed yesterday would appear crossed out today for users in positive UTC offset timezones - Also fixed KanbanView to use UTC-anchored dates for consistency - Thanks to @kmaustral for reporting - (#1118) Fixed user-defined fields not working in inline task conversion - User-defined fields like \`>customfield value\` now properly convert to frontmatter when using the "TaskNote: Convert task to TaskNote" command - Fixed fields appearing with internal IDs (e.g., \`field_1761435101864\`) instead of configured frontmatter key names - Array values are now properly joined with commas - Added \`userFields\` property to \`ParsedTaskData\` interface to support custom fields throughout the conversion flow - Thanks to @guncav for reporting - Fixed kanban column width CSS constraints not matching settings - Updated CSS min-width from 280px to 200px and max-width from 350px to 500px to match slider range - Column width slider now works correctly across the full 200-500px range - Kanban view now shows empty columns for all user-defined statuses when grouping by status - Empty columns appear for custom statuses defined in settings, even when no tasks have that status - Allows users to drag tasks into empty status columns - Works in both flat kanban view and swimlane mode - Respects the existing "Hide empty columns" setting - Thanks to @williamcheuk03 for reporting this issue `});var qAe,WAe=y(()=>{qAe=`# TaskNotes 4.0.0-beta.2 > **Beta Release** > > You may encounter issues. Report problems on [GitHub Issues](https://github.com/callumalpass/tasknotes/issues). ## Added - (#1090) Portuguese (Brazil) translation - Full Portuguese (pt-BR) localization support - A big thanks to @andysteel for the contribution - **Configurable task modal fields** - New "Modal Fields" settings tab for complete control over task creation and edit modals - Configure which fields appear in creation vs edit modals independently - Drag-and-drop reordering of fields within groups (metadata, organization, dependencies, custom) - Enable/disable individual fields (including core fields like contexts, tags, time estimate) - Organize fields into groups - Automatic migration of existing user-defined fields - Title and details fields support visibility toggling (ordering fixed for consistency) - **Rich markdown editor for NLP task creation** - Replaced plain textarea with full CodeMirror markdown editor - Live preview, syntax highlighting, and wikilink support - Ctrl/Cmd+Enter keyboard shortcut to save task - Esc/Tab keyboard shortcuts for modal control - **Customizable NLP triggers with autocomplete** - Configure custom trigger characters/strings for each property type (tags, contexts, projects, status, priority) - Supports user-defined field triggers - CodeMirror-based autocomplete with keyboard navigation (arrow keys, Enter, Tab) - Quote support for multi-word values in user fields - Native tag suggester integration when using # trigger - **Inline task link overlay enhancements** - Configurable visible properties for inline task cards - PropertySelectorModal for selecting which properties to display - Improved layout: title prioritized, horizontal scrolling for metadata - Real-time updates when task data changes - **New utility services** - \`TriggerConfigService\` - manages NLP trigger configurations - \`PropertySelectorModal\` - reusable multi-select property picker - Property helpers for consistent property handling across views - Kanban column reordering via drag and drop - Drag column headers to reorder columns - Column order is saved per grouping property - Visual feedback during drag operations - Mini calendar enhancements (in progress) - Week numbers column - Heat map intensity visualization - Note preview tooltips on hover - Keyboard navigation - **Unified Relationships widget** - Consolidated project subtasks, task dependencies, and blocking relationships into a single dynamic widget - Four automatic tabs: Subtasks (Kanban), Projects (List), Blocked By (List), Blocking (Kanban) - Tabs automatically show/hide based on available relationship data - Bases views handle all data updates reactively - no manual refresh needed - Single configuration setting: show/hide and position (top/bottom) - Significantly reduced code complexity (430 fewer lines) ## Fixed - (#1084) Fixed word wrapping in NLP preview items - Thanks to @maybetm for the fix - (#975) Fixed advanced calendar list headers not respecting theme colors - Thanks to @hugohil for the fix - (#1089) Fixed embedded task list bases growing unbounded and leaving large empty space - Embedded bases now scroll internally instead of expanding to show all tasks - Consistent behavior between task list and kanban embedded views - Thanks to @same774 for reporting with screenshot - **Bases Calendar view options now working correctly** - Fixed "Highlight today" toggle not applying - now properly adds/removes CSS class when toggled - Fixed calendar view type (month/week/day/etc) not being saved when changed via calendar buttons - View type is now persisted when users click month/week/day buttons in the calendar UI - (#1050) Task modal no longer adds unwanted empty contexts and projects arrays - FieldMapper now checks if arrays are empty before writing to frontmatter - Thanks to @nightroman for reporting this issue - **Inline task link overlay fixes** - Fixed layout prioritization: title now prioritized over metadata - Added horizontal scrolling for metadata to prevent overflow - Fixed real-time update listeners for task data changes - Fixed group collapse/expand functionality in TaskListView - Re-registered click event listener for group headers using Component API - Groups can now be properly collapsed and expanded - Fixed config loading race condition in KanbanView and CalendarView - Config is now properly loaded in onload() lifecycle method - Views wait for config before rendering options - Fixed MiniCalendarView to use direct Bases API like other views - Consistent use of Component lifecycle methods - Proper cleanup in onunload() ## Changed - **NLP system overhaul** - Replaced \`StatusSuggestionService\` wrapper with direct \`NaturalLanguageParser\` usage - Consolidated trigger configuration into unified \`TriggerConfigService\` - Enhanced \`NaturalLanguageParser\` with full trigger and user field support - Removed custom # tag autocomplete in favor of Obsidian's native tag suggester (when using # trigger) - **Task card and editor improvements** - Simplified \`TaskCard\` interface - removed unused options (showCheckbox, showArchiveButton, groupByDate) - Refactored \`TaskLinkWidget\` to use unified \`TaskCard\` component for consistency - Added support for inline vs. block layout modes in task cards - Improved task card BEM CSS with better styling for inline mode - **Settings UI enhancements** - NLP triggers now configurable through Settings > Features tab - Added settings for inline task card visible properties - Improved appearance tab with property selector integration - Better organization of NLP-related settings - Refactored Bases views to use Component lifecycle properly - Views now extend Component and use onload()/onunload() - Automatic cleanup of event listeners via Component.registerDomEvent() - Improved state management and ephemeral state handling - Improved development experience - Converted ESLint errors to warnings for non-blocking development - Fixed various linting issues and unused imports ## Removed - Removed \`StatusSuggestionService\` (functionality consolidated into \`NaturalLanguageParser\`) ## Breaking Changes - **Relationships widget settings consolidated** (automatic migration) - Old settings removed: \`showProjectSubtasks\`, \`projectSubtasksPosition\`, \`showTaskDependencies\`, \`taskDependenciesPosition\` - New unified settings: \`showRelationships\`, \`relationshipsPosition\` - Widget now appears on ALL notes (tasks, projects, regular notes) - Bases filtering controls which tabs are visible - **Migration**: Existing users will see the new unified widget automatically. If you had project subtasks enabled, relationships widget will be enabled by default - **Bases file change**: The command mapping changed from \`'project-subtasks': 'TaskNotes/Views/project-subtasks.base'\` to \`'relationships': 'TaskNotes/Views/relationships.base'\` - Run "Create Default Files" in Settings > General to create the new \`relationships.base\` file `});var YAe,GAe=y(()=>{YAe=`# TaskNotes 4.0.0-beta.1 > **Beta Release** > > You may encounter issues. Report problems on [GitHub Issues](https://github.com/callumalpass/tasknotes/issues). ## Added - Added context menus for time entries and ICS events in calendar - Time entries: Right-click shows task context menu, left-click opens time entry editor modal - ICS/Google/Microsoft Calendar events: Right-click shows ICS event context menu with options to show details, create task/note, link note, and copy info - Added calendar icon to ICS event titles for better visual distinction - Added hover tooltips for timeblocks in calendar views - Added **MiniCalendar view** for Bases integration - Monthly calendar grid with dot indicators on days with notes - Configurable date property (file.ctime, note.dateCreated, etc.) - Fuzzy selector modal for selecting notes on clicked days - Ctrl+click (or Cmd+click on Mac) on any day opens/creates daily note - Added virtual scrolling and lazy rendering to Bases views for high-performance handling of large datasets - TaskListView: Virtual scrolling for 100+ tasks in flat and grouped views with collapsible groups - KanbanView: Virtual scrolling for regular columns (30+ tasks) and swimlane cells (30+ tasks per cell) - Tested with up to **30,000 notes** with no performance degradation - Thanks to @aubreyz and @turingexmachina for their reports of performance issues and diagnosis help ## Changed - Refactored Bases integration to use public API and trust pre-sorted data - Migrated all three views (Task List, Kanban, Calendar) to clean class-based architecture - Removed legacy view files and ~500 lines of redundant sorting/grouping logic - Introduced BasesDataAdapter, PropertyMappingService, and BasesViewBase abstractions - Trusts Bases plugin to provide pre-sorted and pre-grouped data via public API - Reduced code duplication by 40% while maintaining full feature parity - Refactored calendar modules to use ES6 imports instead of lazy require() calls - Removed all dynamic require() calls from calendar-core.ts and calendar-view.ts - Consolidated all imports at module top level - Improves code maintainability, makes dependencies explicit, and follows modern TypeScript best practices - Time entry events now show task context menu on right-click (previously had no context menu) - Replaced MinimalNativeCache with just-in-time TaskManager for improved reliability - Removed complex index synchronization in favor of direct MetadataCache queries - Eliminated 7 internal indexes (tasksByDate, tasksByStatus, overdueTasks, etc.) - Added minimal DependencyCache for task dependencies and project references only - Zero startup time (no index building required) - Always provides fresh, accurate task data from Obsidian's MetadataCache - Completed internationalization with 100% translation coverage across all supported languages - Added 90 missing translation keys to English base - Completed 829 translations across 6 languages (German, Spanish, French, Japanese, Russian, Chinese) - All locales now have complete coverage (1745/1745 keys) - Improved translation quality for migration system, calendar settings, statistics, ICS events, and filter components - Migrated to i18n-state-manager CLI tool for translation management - Replaced custom scripts with more robust i18n-state-manager package - Added i18n-state.config.json for project-specific patterns - New features: find-unused, check-duplicates, improved stale detection - Hash-based state tracking and ripgrep-based scanning for performance - Bases view templates now generate dynamically based on user settings - Task filters adapt to user's task identification method (tag or property) - Property ordering reflects defaultVisibleProperties setting - Uses correct YAML object notation for Bases filters - Maintains backward compatibility with legacy static templates - Updated Bases CalendarView to show TaskNotes in property-based events - Tasks can now be visualized on calendar via any date property (dateCreated, scheduled, due, etc.) - Previously all TaskNotes were filtered out from property-based events ## Fixed - (#1022, #684) Fixed tasks randomly disappearing when Smart Connections plugin is enabled - Eliminated race condition caused by index synchronization delays - TaskManager now reads directly from Obsidian's MetadataCache instead of maintaining separate indexes - No more timing-sensitive code that could conflict with other plugins' metadata processing - Tasks will always be visible regardless of other plugins' processing times - Thanks to @alejandrospoz, @seepage87, @amarjt, @luckb0x, camara-tech for reporting and help debugging. - (#992) Fixed "Failed to resolve module specifier 'obsidian'" error when moving recurring task instances in calendar - Removed unnecessary dynamic imports that were causing module resolution failures - Consolidated imports at top of calendar-core.ts module - Thanks to @jalooc for reporting this issue - Fixed task dependencies not displaying on task cards - TaskManager now properly calculates isBlocked and isBlocking flags from dependency data - Added missing property extractors and renderers in TaskCard for all dependency-related fields - Dependency information now shows correctly in Bases views, task note widgets, and other views - Shows "Blocked (n)" and "Blocking (n)" pills, plus detailed task links - Fixed Bases property mapping for user-configured field names - PropertyMappingService now correctly strips prefixes and applies FieldMapper transformations - Example: User configures "state" \u2192 "status", Bases provides "note.state", now correctly maps to "status" - Ensures TaskCard properly recognizes and renders user-configured properties - Fixed Bases views not respecting user-configured visible properties - Now prioritizes Bases 1.10.0+ public API config.getOrder() method - Removed reliance on internal API paths that no longer work - Filters out blocked/blocking properties when using defaults (only shown when explicitly requested via blockedBy) - Fixed MiniCalendar UTC anchoring for consistent timezone-independent date handling - Fixed DateValue conversion in BasesDataAdapter - DateValue objects have {date: Date, time: boolean} structure - Now properly checks for value.date instanceof Date before legacy conversion methods - Fixes property-based events in CalendarView `});var KAe,ZAe=y(()=>{KAe=`# TaskNotes 4.0.0-beta.0 > **Beta Release** > > You may encounter issues. Report problems on [GitHub Issues](https://github.com/callumalpass/tasknotes/issues). ## What's New in v4 TaskNotes v4 migrates all views to the Bases system. ### Breaking Changes - **Minimum Obsidian version: 1.10.1** - **View commands now use Bases files** - Ribbon icons and command palette commands (Calendar, Kanban, Tasks, Agenda, Project Subtasks) now open \`.base\` files created automatically in your vault - **Saved filter views** - Custom saved views can be converted to \`.base\` files using a conversion button in settings ## Added ### OAuth Calendar Integration - Google Calendar and Microsoft Outlook integration via OAuth 2.0 - View and sync calendar events in Bases calendar - Drag events in the TaskNotes bases calendar to change the event's time online - Events sync every 15 minutes or upon local change - Requires creating your own OAuth application (approximately 15 minutes) - See [Calendar Setup Guide](https://tasknotes.dev/calendar-setup) ### Time Entry Editor Modal - Dedicated interface for managing time entries - Alt-drag on Bases calendar to create time entries - View total tracked time per task - Edit and delete time entries - Access via Task Action Palette (Alt/Opt + Enter) ### Kanban Swimlane Layout - Horizontal swimlane grouping option for Bases Kanban - Group tasks by status, priority, or other fields - Hide empty columns - Configurable column widths - Improved drag-and-drop in swimlane mode ### Saved View Converter - Conversion button in settings to convert saved filter views to \`.base\` files - Original settings preserved - Converted views created in \`TaskNotes/Views/\` ## Changed ### View System Architecture - All views now use Bases architecture - Calendar, Kanban, Tasks, Agenda, and Project Subtasks are \`.base\` files - Views stored in \`TaskNotes/Views/\` - Keyboard shortcuts and ribbon icons map to \`.base\` files - Configure file paths in Settings \u2192 Integrations \u2192 Bases Integration ### Calendar - Control which calendar sources display - Toggle Google Calendar, Microsoft Calendar, and ICS events independently - Configurable list view with custom day count (2-10 days) - Improved timezone handling for recurring events ### Settings - Reorganized settings tabs - OAuth calendar settings in Integrations tab - Updated help text ## Fixed - (#843) Fixed task tag being added when "Identify tasks by" is set to "Property" - TaskCreationModal, TaskEditModal, and InstantTaskConvertService now respect taskIdentificationMethod setting - Thanks to @jack2game - Fixed dark mode calendar borders - Fixed Bases Kanban column ordering - Thanks to @mweichert - Fixed state management bug in FilterSettingsComponent - Fixed timezone handling for recurring events ## Migration Guide ### First Launch 1. Default view files are created automatically in \`TaskNotes/Views/\` 2. Ribbon and command palette commands now open \`.base\` files 3. Review Settings \u2192 General to customize view file paths ### Converting Saved Filter Views 1. Go to Settings \u2192 General 2. Click the conversion button to convert saved filter views to \`.base\` files 3. Converted views appear in a file in \`TaskNotes/Views/\` ### Calendar Integration (Optional) 1. Go to Settings \u2192 Integrations \u2192 OAuth Calendar Integration 2. Follow the [Calendar Setup Guide](https://tasknotes.dev/calendar-setup) 3. Create OAuth applications with Google and/or Microsoft (approximately 15 minutes) 4. Enter Client ID and Secret in calendar cards 5. Click Connect ## Known Limitations - Quick OAuth setup is disabled - only advanced setup (your own credentials) is available - Saved filter views require manual conversion using the button in settings - Migration is one-way - downgrading to v3 may require manual reconfiguration - OAuth setup requires creating applications with Google/Microsoft ## Feedback Report issues on [GitHub](https://github.com/callumalpass/tasknotes/issues). Include: - Obsidian version - Steps to reproduce - Console errors (Ctrl/Cmd + Shift + I) - Whether issue occurs after migration or fresh install `});var QAe,JAe,XAe=y(()=>{vMe();bMe();wMe();xMe();EMe();PMe();AMe();IMe();RMe();OMe();zMe();$Me();UMe();VMe();WMe();GMe();ZMe();JMe();eAe();rAe();aAe();sAe();lAe();dAe();pAe();fAe();gAe();vAe();bAe();wAe();xAe();EAe();PAe();AAe();IAe();RAe();OAe();zAe();$Ae();UAe();VAe();WAe();GAe();ZAe();QAe="4.12.5",JAe=[{version:"4.12.5",content:yMe,date:"2026-08-26T12:59:44+10:00",isCurrent:!0},{version:"4.12.4",content:kMe,date:"2026-08-24T00:23:43+10:00",isCurrent:!1},{version:"4.12.3",content:TMe,date:"2026-08-10T08:08:05+10:00",isCurrent:!1},{version:"4.12.2",content:SMe,date:"2026-08-09T15:41:43+10:00",isCurrent:!1},{version:"4.12.1",content:CMe,date:"2026-08-08T13:02:07+10:00",isCurrent:!1},{version:"4.12.0",content:DMe,date:"2026-08-07T18:42:18+10:00",isCurrent:!1},{version:"4.11.1",content:MMe,date:"2026-06-26T08:38:30+10:00",isCurrent:!1},{version:"4.11.0",content:_Me,date:"2026-06-10T08:09:52+10:00",isCurrent:!1},{version:"4.10.2",content:NMe,date:"2026-06-05T22:52:07+10:00",isCurrent:!1},{version:"4.10.1",content:FMe,date:"2026-06-05T10:16:05+10:00",isCurrent:!1},{version:"4.10.0",content:LMe,date:"2026-06-01T21:50:12+10:00",isCurrent:!1},{version:"4.9.2",content:jMe,date:"2026-05-30T05:43:04+10:00",isCurrent:!1},{version:"4.9.1",content:BMe,date:"2026-05-26T18:40:45+10:00",isCurrent:!1},{version:"4.9.0",content:HMe,date:"2026-05-24T09:35:31+10:00",isCurrent:!1},{version:"4.8.1",content:qMe,date:"2026-05-20T17:46:40+10:00",isCurrent:!1},{version:"4.8.0",content:YMe,date:"2026-05-19T18:47:44+10:00",isCurrent:!1},{version:"4.7.2",content:KMe,date:"2026-05-14T22:13:36+10:00",isCurrent:!1},{version:"4.7.1",content:QMe,date:"2026-05-14T08:02:31+10:00",isCurrent:!1},{version:"4.7.0",content:XMe,date:"2026-05-14T06:40:12+10:00",isCurrent:!1},{version:"4.6.0",content:tAe,date:"2026-05-13T08:24:23+10:00",isCurrent:!1},{version:"4.5.3",content:nAe,date:"2026-04-30T22:32:11+10:00",isCurrent:!1},{version:"4.5.2",content:iAe,date:"2026-04-26T20:11:43+10:00",isCurrent:!1},{version:"4.5.1",content:oAe,date:"2026-03-31T20:39:11+11:00",isCurrent:!1},{version:"4.5.0",content:cAe,date:"2026-03-31T08:48:09+11:00",isCurrent:!1},{version:"4.4.0",content:uAe,date:"2026-02-17T21:53:32+11:00",isCurrent:!1},{version:"4.3.3",content:mAe,date:"2026-02-15T15:09:21+11:00",isCurrent:!1},{version:"4.3.2",content:hAe,date:"2026-02-08T19:22:37+11:00",isCurrent:!1},{version:"4.3.1",content:yAe,date:"2026-02-08T14:06:51+11:00",isCurrent:!1},{version:"4.3.0",content:kAe,date:"2026-01-07T20:31:36+11:00",isCurrent:!1},{version:"4.2.1",content:TAe,date:"2026-01-04T11:51:59+11:00",isCurrent:!1},{version:"4.2.0",content:SAe,date:"2026-01-02T08:38:48+11:00",isCurrent:!1},{version:"4.1.3",content:CAe,date:"2025-12-08T21:28:48+11:00",isCurrent:!1},{version:"4.1.2",content:DAe,date:"2025-12-07T16:22:44+11:00",isCurrent:!1},{version:"4.1.1",content:MAe,date:"2025-12-01T21:44:07+11:00",isCurrent:!1},{version:"4.1.0",content:_Ae,date:"2025-11-30T18:58:10+11:00",isCurrent:!1},{version:"4.0.5",content:NAe,date:"2025-11-23T20:27:09+11:00",isCurrent:!1},{version:"4.0.4",content:FAe,date:"2025-11-20T23:38:28+11:00",isCurrent:!1},{version:"4.0.3",content:LAe,date:"2025-11-20T08:16:00+11:00",isCurrent:!1},{version:"4.0.2",content:jAe,date:"2025-11-19T21:50:00+11:00",isCurrent:!1},{version:"4.0.1",content:BAe,date:"2025-11-18T22:29:23+11:00",isCurrent:!1},{version:"4.0.0-beta.3",content:HAe,date:"2025-11-17T07:51:37+11:00",isCurrent:!1},{version:"4.0.0-beta.2",content:qAe,date:"2025-11-09T20:36:35+11:00",isCurrent:!1},{version:"4.0.0-beta.1",content:YAe,date:"2025-11-04T20:05:28+11:00",isCurrent:!1},{version:"4.0.0-beta.0",content:KAe,date:"2025-10-30T00:02:44+11:00",isCurrent:!1}]});function S6(r){try{return decodeURIComponent(r)}catch(e){return r}}function t_e(r){let e=r.trim();return e.startsWith("<")&&e.endsWith(">")?e.slice(1,-1).trim():e}function vO(r){var a;if(!r)return"";let e=S6(t_e(r));return((a=e.split(/[#!^]/)[0])!=null?a:e).replace(/^\/+/,"").replace(/\.md$/i,"").trim()}function x6(r){return r?S6(r).trim().replace(/^[#^]+/,"").trim():""}function e_e(r){var n;let e=vO(r),t=e.split("/").filter(Boolean);return(n=t[t.length-1])!=null?n:e}function JD(r){if(!r)return;let e=S6(t_e(r)),t=e.search(/[#^]/);if(t!==-1)return x6(e.slice(t))||void 0}function kd(r,e){let t=x6(e);if(!t)return;let n=r==null?void 0:r.trim();return n?`${n} > ${t}`:t}function C6(r,e,t,n){let a=vO(r)||x6(r);if(!a||!e)return!1;let i=vO(e),s=vO(t),o=new Set([i,e_e(i)]);s&&(o.add(s),o.add(e_e(s)));let l=JD(t);if(l){o.add(l);let c=kd(n,l);c&&o.add(c)}return o.has(a)}function nT(r,e,t){let n=r==null?void 0:r.trim();if(n&&!C6(n,e,t))return n}var kO=y(()=>{});var E6={};at(E6,{TaskLinkDetectionService:()=>XD});var Yg,XD,bO=y(()=>{Yg=require("obsidian");K();kO();XD=class{constructor(e,t){this.linkCache=new Map;this.plugin=e,this.logger=t!=null?t:N({tag:"TaskLinkDetectionService",isDebugEnabled:()=>e.settings.enableDebugLogging})}async detectTaskLink(e,t,n="wikilink"){let a=n==="wikilink"?this.parseWikilink(e):this.parseMarkdownLink(e);if(!a)return{isValidTaskLink:!1};let{linkPath:i,displayText:s}=a,o=`${t}:${i}`,l=this.linkCache.get(o);if(l){let p=this.plugin.app.vault.getAbstractFileByPath(i);if(p instanceof Yg.TFile&&p.stat.mtime===l.lastModified)return l.result}let c=this.resolveLinkPath(i,t);if(!c){let p={isValidTaskLink:!1};return this.cacheResult(o,p,0),p}let d=this.plugin.app.vault.getAbstractFileByPath(c);if(!(d instanceof Yg.TFile)){let p={isValidTaskLink:!1};return this.cacheResult(o,p,0),p}try{let p=await this.plugin.cacheManager.getTaskInfo(c);if(p){let m=this.resolveDisplayText(a,n,p,i,s),f={isValidTaskLink:!0,taskPath:c,taskInfo:p,displayText:m};return this.cacheResult(o,f,d.stat.mtime),f}}catch(p){this.logger.debug("Error checking task info for link",{category:"stale-data",operation:"detect-task-link",details:{resolvedPath:c},error:p})}let u={isValidTaskLink:!1};return this.cacheResult(o,u,d.stat.mtime),u}resolveDisplayText(e,t,n,a,i){return t==="markdown"?i?nT(i,n.path,a):kd(n.title,e.subpath):e.hasExplicitAlias?i:kd(n.title,e.subpath)}parseWikilink(e){let t=e.slice(2,-2).trim();if(!t)return null;let n=t.indexOf("|");if(n!==-1){let i=t.slice(0,n).trim(),s=t.slice(n+1).trim();if(!i||!s)return null;let o=(0,Yg.parseLinktext)(i);return{linkPath:o.path,displayText:s,subpath:o.subpath||void 0,hasExplicitAlias:!0}}let a=(0,Yg.parseLinktext)(t);return{linkPath:a.path,subpath:a.subpath||void 0,hasExplicitAlias:!1}}parseMarkdownLink(e){let t=e.match(/^\[([^\]]*)\]\(([^)]+)\)$/);if(!t)return null;let n=t[1].trim(),a=t[2].trim();if(a.startsWith("<")&&a.endsWith(">")&&(a=a.slice(1,-1).trim()),!a)return null;try{a=decodeURIComponent(a)}catch(s){this.logger.debug("Failed to decode URI component",{category:"validation",operation:"parse-markdown-link",details:{linkPath:a},error:s})}let i=(0,Yg.parseLinktext)(a);return{linkPath:i.path,displayText:n||void 0,subpath:i.subpath||void 0,hasExplicitAlias:!!n}}resolveLinkPath(e,t){try{let n=this.plugin.app.metadataCache.getFirstLinkpathDest(e,t);return(n==null?void 0:n.path)||null}catch(n){return this.logger.debug("Error resolving link path",{category:"provider",operation:"resolve-link-path",details:{linkPath:e,sourcePath:t},error:n}),null}}cacheResult(e,t,n){if(this.linkCache.set(e,{result:t,lastModified:n}),this.linkCache.size>1e3){let a=this.linkCache.keys().next().value;this.linkCache.delete(a)}}clearCacheForFile(e){for(let[t]of this.linkCache)t.includes(e)&&this.linkCache.delete(t)}clearCache(){this.linkCache.clear()}findWikilinks(e){let t=[],n=/\[\[([^\]]+)\]\]/g,a;for(;(a=n.exec(e))!==null;)t.push({match:a[0],start:a.index,end:a.index+a[0].length,type:"wikilink"});let i=/\[([^\]]*)\]\(([^)]+)\)/g;for(n.lastIndex=0;(a=i.exec(e))!==null;)t.push({match:a[0],start:a.index,end:a.index+a[0].length,type:"markdown"});return t.sort((s,o)=>s.start-o.start)}cleanup(){this.linkCache.clear()}}});var r_e,Gg,D6=y(()=>{r_e=require("@codemirror/view");TO();mi();$c();Me();Gg=class r extends r_e.WidgetType{constructor(e,t,n,a,i=wn(new Date)){super(),this.taskInfo=e,this.plugin=t,this.originalText=n,this.displayText=a,this.targetDate=i,this.targetDateKey=ce(i)}toDOM(e){let t=this.plugin.settings.inlineVisibleProperties||["status","priority","due","scheduled","recurrence"],n=$i(t,this.plugin),a=activeWindow.createSpan();a.className="tasknotes-plugin tasknotes-inline-widget",a.classList.remove("tn-static-display-block-2a1b75c9","tn-static-display-flex-4d51fc62","tn-static-display-flex-75816cae","tn-static-display-flex-8bb39979","tn-static-display-inline-block-60e32dcb","tn-static-display-inline-flex-f984c520","tn-static-display-none-6b99de8b","tn-static-min-height-800px-997b4c8c"),a.classList.add("tn-static-display-inline-cccfa456"),a.classList.add("tn-static-vertical-align-baseline-657d9c46"),a.addEventListener("pointerdown",s=>{s.stopPropagation()}),a.addEventListener("mousedown",s=>{s.stopPropagation(),s.button===0&&s.preventDefault()}),a.addEventListener("mouseup",s=>{s.stopPropagation()});let i=Dr(this.taskInfo,this.plugin,n,{layout:"inline",targetDate:this.targetDate,displayText:this.displayText});return a.appendChild(i),i.dataset.originalText=this.originalText,i.addEventListener("tasknotes:task-updated",()=>{window.setTimeout(()=>{e&&typeof e.dispatch=="function"&&sf(e,this.taskInfo.path)},50)}),a}eq(e){return e instanceof r?this.taskInfo.path===e.taskInfo.path&&this.taskInfo.status===e.taskInfo.status&&this.taskInfo.title===e.taskInfo.title&&this.taskInfo.priority===e.taskInfo.priority&&this.taskInfo.archived===e.taskInfo.archived&&this.taskInfo.due===e.taskInfo.due&&this.taskInfo.scheduled===e.taskInfo.scheduled&&this.taskInfo.recurrence===e.taskInfo.recurrence&&this.displayText===e.displayText&&this.targetDateKey===e.targetDateKey&&JSON.stringify(this.taskInfo.complete_instances)===JSON.stringify(e.taskInfo.complete_instances)&&JSON.stringify(this.taskInfo.skipped_instances)===JSON.stringify(e.taskInfo.skipped_instances)&&this.taskInfo.dateModified===e.taskInfo.dateModified:!1}ignoreEvent(e){return e.type==="mousedown"||e.type==="click"}get estimatedHeight(){return-1}get block(){return!1}}});function cft(r){let e=new Map,t=new Map;return rc.ViewPlugin.fromClass(class{constructor(n){this.eventListeners=[];this.view=n,this.decorations=this.buildDecorations(n),this.setupEventListeners()}destroy(){this.eventListeners.forEach(n=>{r.emitter.offref(n)}),this.eventListeners=[]}setupEventListeners(){let n=r.emitter.on(ii,()=>{this.refreshDecorations()}),a=r.emitter.on(ot,()=>{this.refreshDecorations()}),i=r.emitter.on(is,l=>{l!=null&&l.path&&t.delete(l.path),this.refreshDecorations()}),s=r.emitter.on(Wp,()=>{t.clear(),this.refreshDecorations()}),o=r.emitter.on("settings-changed",()=>{this.refreshDecorations()});this.eventListeners.push(n,a,i,s,o)}refreshDecorations(){this.view&&typeof this.view.dispatch=="function"&&queueMicrotask(()=>{try{e.clear(),this.view.dispatch({effects:[wO.of({})]})}catch(n){eP.error("Error dispatching task link update:",{category:"validation",operation:"dispatching-task-link-update",error:n})}})}update(n){var i,s;if(this.view=n.view,!((i=r==null?void 0:r.settings)!=null&&i.enableTaskLinkOverlay)){this.decorations=rc.Decoration.none;return}try{if(!n.state.field(nc.editorLivePreviewField)){this.decorations=rc.Decoration.none;return}}catch(o){this.decorations=rc.Decoration.none;return}let a=n.transactions.some(o=>o.effects.some(l=>l.is(wO)));if(n.docChanged||n.selectionSet||a){if(a){let o=(s=n.transactions.flatMap(l=>l.effects).find(l=>l.is(wO)))==null?void 0:s.value;if(o!=null&&o.taskPath)for(let[l]of e.entries())l.includes(o.taskPath)&&e.delete(l);else e.clear()}this.decorations=this.buildDecorations(n.view)}}buildDecorations(n){var a,i;try{if(!((a=r==null?void 0:r.settings)!=null&&a.enableTaskLinkOverlay))return rc.Decoration.none;if(!n.state.field(nc.editorLivePreviewField))return rc.Decoration.none;let o=n.state.field(nc.editorInfoField,!1),l=(i=o==null?void 0:o.file)==null?void 0:i.path;return dft(n.state,r,e,l,t)}catch(s){return eP.error("Error building task link decorations:",{category:"persistence",operation:"building-task-link-decorations",error:s}),rc.Decoration.none}}},{decorations:n=>n.decorations})}function dft(r,e,t,n,a){var l,c;let i=new SO.RangeSetBuilder;if(!r||!e||!t)return i.finish();let s=r.doc;if(!s||!e.app||!e.app.workspace)return i.finish();let o=e.taskLinkDetectionService||new XD(e);if(!n){let d=e.app.workspace.getActiveViewOfType(nc.MarkdownView);if(!d)return i.finish();n=(l=d.file)==null?void 0:l.path}if(!n||typeof n!="string"||n.length===0)return i.finish();try{let d=s.toString();if(typeof d!="string"||d.length>1e5)return i.finish();let u=(c=r.selection)==null?void 0:c.main.head,p=o.findWikilinks(d);if(!Array.isArray(p))return i.finish();for(let m of p)try{if(!m||typeof m.match!="string"||typeof m.start!="number"||typeof m.end!="number"||m.start<0||m.end<=m.start||m.start>=d.length||m.end>d.length||e.settings.disableOverlayOnAlias&&m.type==="wikilink"&&m.match.includes("|"))continue;let f=m.type==="wikilink"?uft(m.match):pft(m.match);if(!f)continue;let{linkPath:h}=f;if(!h||typeof h!="string"||h.trim().length===0)continue;let g=mft(h,n,e);if(!g)continue;let v=fft(g,e);if(v){if(!v.title||typeof v.title!="string"||u!==void 0&&u>=m.start&&u=m.start&&u500)return null;let t=e.indexOf("|");if(t!==-1){let a=e.slice(0,t).trim(),i=e.slice(t+1).trim();if(!a||!i)return null;let s=(0,nc.parseLinktext)(a);return s.path?{linkPath:s.path,displayText:i,subpath:s.subpath||void 0,hasExplicitAlias:!0}:null}let n=(0,nc.parseLinktext)(e);return n.path?{linkPath:n.path,subpath:n.subpath||void 0,hasExplicitAlias:!1}:null}function pft(r){if(!r||typeof r!="string")return null;let e=r.match(/^\[([^\]]*)\]\(([^)]+)\)$/);if(!e)return null;let t=e[1].trim(),n=e[2].trim();if(n.startsWith("<")&&n.endsWith(">")&&(n=n.slice(1,-1).trim()),!n||n.length===0||n.length>500)return null;try{n=decodeURIComponent(n)}catch(i){}let a=(0,nc.parseLinktext)(n);return a.path?{linkPath:a.path,displayText:t||void 0,subpath:a.subpath||void 0,hasExplicitAlias:!!t}:null}function mft(r,e,t){if(!r||typeof r!="string"||r.trim().length===0||!e||typeof e!="string"||!t||!t.app||!t.app.metadataCache)return null;try{let n=t.app.metadataCache.getFirstLinkpathDest(r,e);return!n||!n.path||typeof n.path!="string"?null:n.path}catch(n){return null}}function fft(r,e){if(!r||typeof r!="string"||r.trim().length===0||!e)return null;try{let t=/[<>:"|?*]/,n=r.split("").some(s=>{let o=s.charCodeAt(0);return o<=31||o===127});if(t.test(r)||n)return null;let a=e.cacheManager;if(!a||!a.getCachedTaskInfoSync)return null;let i=a.getCachedTaskInfoSync(r);return i&&typeof i=="object"&&i.title?i:null}catch(t){return null}}function n_e(r){return cft(r)}function sf(r,e){if(!r||typeof r.dispatch!="function"){eP.warn("Invalid EditorView passed to dispatchTaskUpdate:",{category:"validation",operation:"invalid-editorview-passed-dispatchtaskupdate",details:{value:r}});return}try{r.dispatch({effects:[wO.of({taskPath:e})]})}catch(t){eP.error("Error dispatching task update:",{category:"validation",operation:"dispatching-task-update",error:t})}}var SO,rc,nc,eP,wO,TO=y(()=>{SO=require("@codemirror/state"),rc=require("@codemirror/view"),nc=require("obsidian");Yr();bO();D6();K();kO();eP=N({tag:"Editor/TaskLinkOverlay"}),wO=SO.StateEffect.define()});var aT,P6=y(()=>{aT=class{constructor(){this.states=new WeakMap;this.disposed=!1}schedule(e,t){if(this.disposed)return;let n=this.getState(e);if(n.version+=1,n.running){n.rerun=!0;return}n.running=!0,this.runLoop(e,t)}dispose(){this.disposed=!0}getState(e){let t=this.states.get(e);return t||(t={running:!1,rerun:!1,version:0},this.states.set(e,t)),t}async runLoop(e,t){let n=this.getState(e);try{do{n.rerun=!1;let a=n.version;await t({isCurrent:()=>{var i;return!this.disposed&&((i=this.states.get(e))==null?void 0:i.version)===a}})}while(n.rerun&&!this.disposed)}finally{n.running=!1,n.rerun&&!this.disposed&&(n.running=!0,this.runLoop(e,t))}}}});function a_e(r){return!!(r!=null&&r.closest(".canvas-node-content"))}function s_e(r){if(!r||typeof r!="object")return!1;let e=r;return"parent"in e&&e.parent==null}function M6(r){return!!(r!=null&&r.closest(hft))}function iT(r,e=gft){var t,n,a;if(a_e(r.dom))return!1;if(M6(r.dom))return!0;try{let i=r.state.field(i_e.editorInfoField,!1);return((a=(n=(t=i==null?void 0:i.leaf)==null?void 0:t.view)==null?void 0:n.getMode)==null?void 0:a.call(n))==="preview"||s_e(i==null?void 0:i.leaf)?!0:a_e(i==null?void 0:i.containerEl)?!1:M6(i==null?void 0:i.containerEl)}catch(i){return e.debug("Error checking markdown widget editor context",{category:"provider",operation:"check-editor-context",error:i}),!1}}function sT(r){var t;if(s_e(r))return!0;let e=(t=r.view)==null?void 0:t.containerEl;return M6(e)}var i_e,hft,gft,tP=y(()=>{i_e=require("obsidian");K();hft=[".blp-inline-edit-root",".internal-embed.markdown-embed",".markdown-embed",".popover.hover-popover"].join(", "),gft=N({tag:"MarkdownWidgetContext"})});function vft(r,e){if(typeof r.requestAnimationFrame=="function"){let n=r.requestAnimationFrame(e);return{id:n,cancel:()=>r.cancelAnimationFrame(n)}}let t=r.setTimeout(e,0);return{id:t,cancel:()=>r.clearTimeout(t)}}function o_e(r){var e;return typeof((e=r.performance)==null?void 0:e.now)=="function"?r.performance.now():Date.now()}function l_e(r,e){if(r.nodeType!==Node.ELEMENT_NODE)return!1;let t=r;return t.matches(e)||!!t.querySelector(e)}function kft(r,e){return[...Array.from(r.addedNodes),...Array.from(r.removedNodes)].some(n=>l_e(n,e)||l_e(n,".markdown-preview-sizer"))}function bft(r){let e=r.view;return!(e instanceof c_e.MarkdownView)||e.getMode()!=="preview"||sT(r)?null:e.previewMode.containerEl}function xO(r,e,t,n,a,i,s={}){var f;let o=bft(r);if(!o||n.has(o))return;let l=(f=s.scrollQuietPeriodMs)!=null?f:yft,c=null,d=Number.NEGATIVE_INFINITY,u=()=>{var h;d=o_e((h=o.ownerDocument.defaultView)!=null?h:window)};o.addEventListener("scroll",u,{capture:!0,passive:!0});let p=()=>{var g;if(c)return;let h=(g=o.ownerDocument.defaultView)!=null?g:window;c=vft(h,()=>{if(c=null,!o.isConnected||!i(r))return;let v=o.querySelector(".markdown-preview-sizer");if(!(!v||v.querySelector(e))){if(l>0&&o_e(h)-d{h.some(g=>kft(g,e))&&p()});m.observe(o,{childList:!0,subtree:!0}),n.add(o),a.push(()=>{c==null||c.cancel(),o.removeEventListener("scroll",u,{capture:!0}),m.disconnect()})}var c_e,yft,A6=y(()=>{c_e=require("obsidian");tP();yft=200});function Tft(r,e){let t=e;for(;t!=null&&t.parentElement&&t.parentElement!==r;)t=t.parentElement;return(t==null?void 0:t.parentElement)===r?t:null}function wft(r){for(let e=0;e{});function m_e(r){let e=new Set,t=r.previewMode.containerEl.querySelector(".markdown-preview-sizer"),n=r.containerEl.querySelector(".cm-sizer");return t&&e.add(t),n&&e.add(n),Array.from(e).flatMap(a=>oT(a).filter(i=>i.classList.contains(rP)))}function f_e(r){m_e(r).forEach(e=>{var t;(t=e.component)==null||t.unload(),e.remove()})}function oT(r){return Array.from(r.children).filter(e=>e.instanceOf(HTMLElement))}function Eft(r,e){var s;let t=r.settings.projectAutosuggest;if(!t)return!1;let n=(s=t.requiredTags)!=null?s:[];if(n.some(o=>!o.trim().startsWith("-"))&&br.matchesTagConditions(Vv(e),n))return!0;let i=Uv(t);return i.enabled&&Hv(e==null?void 0:e.frontmatter,i)}function EO(r,e,t){var n;return!!((n=r.dependencyCache)!=null&&n.isFileUsedAsProject(e.path)||Eft(r,t))}function Dft(r){var n;let e=r.querySelector(".cm-content");if(e)return(n=e.closest(".cm-contentContainer"))!=null?n:e;let t=oT(r).filter(a=>!a.classList.contains(rP)&&!a.classList.contains("embedded-backlinks")&&!a.classList.contains("markdown-preview-pusher")&&!a.classList.contains("mod-footer"));return t.length>0?t[t.length-1]:null}function d_e(r){let e=Number.parseFloat(r);return Number.isFinite(e)?e:null}function Pft(r){var i;let t=((i=r.ownerDocument.defaultView)!=null?i:window).getComputedStyle(r),n=d_e(t.marginTop);if(n!==null)return n;let a=d_e(t.fontSize);return a!==null?a*1.5:24}function u_e(r){let e=r.getBoundingClientRect();return e.width<=0&&e.height<=0?null:e.bottom}function Mft(r){let e=u_e(r);return r.querySelectorAll("*").forEach(t=>{let n=u_e(t);n!==null&&(e===null||n>e)&&(e=n)}),e}function Aft(r){let e=null;for(let t of r){let n=Mft(t);n!==null&&(e===null||n>e)&&(e=n)}return e}function h_e(r,e){e.style.removeProperty("--tn-relationships-widget-margin-top");let t=r.querySelector(".cm-content");if(!t)return;let n=Aft(oT(t)),a=t.closest(".cm-contentContainer");if(n===null||!a)return;let i=Math.max(0,Math.round(a.getBoundingClientRect().bottom-n));if(i>0){let s=Pft(e),o=Math.round(s-i);e.style.setProperty("--tn-relationships-widget-margin-top",`${o}px`)}}function g_e(r,e){let t=Dft(r);t?CO(t,e):r.appendChild(e),h_e(r,e)}async function y_e(r,e){let t=activeWindow.createDiv();t.className=`tasknotes-plugin ${rP}`,t.setAttribute("contenteditable","false"),t.setAttribute("spellcheck","false"),t.setAttribute("data-widget-type","relationships"),t.setAttribute("data-note-path",e);let n=activeWindow.createDiv();n.className="relationships__bases-container",t.appendChild(n);let a=new Va.Component;a.load(),t.component=a;try{let i=r.settings.commandFileMapping.relationships;if(!i){let o=activeWindow.createDiv();return o.className="relationships__error",o.textContent="Relationships view not configured",n.appendChild(o),t}let s=`![[${i}]]`;await Va.MarkdownRenderer.render(r.app,s,n,e,a)}catch(i){bd.error("[TaskNotes] Error rendering Bases view in relationships widget:",{category:"internal",operation:"rendering-bases-view-relationships-widget",error:i});let s=activeWindow.createDiv();s.className="relationships__error",s.textContent="Failed to load relationships view",n.appendChild(s)}return t}function v_e(r){return p_e.ViewPlugin.fromClass(class extends I6{constructor(e){super(e,r)}destroy(){super.destroy()}})}async function _ft(r,e,t){var c,d,u;let n=r.view;if(!(n instanceof Va.MarkdownView)||n.getMode()!=="preview"||sT(r))return;let a=n.file;if(!a||!e.settings.showRelationships)return;let i=!1,s=!1,o=e.app.metadataCache.getFileCache(a);if(o!=null&&o.frontmatter&&(i=e.cacheManager.isTaskFile(o.frontmatter)),s=EO(e,a,o),!i&&!s){try{let p=m_e(n);(p.some(h=>h.dataset.notePath!==a.path)||o!==null)&&p.forEach(h=>{var g;(g=h.component)==null||g.unload(),h.remove()})}catch(p){bd.debug("[TaskNotes] Error cleaning up relationships widget in reading mode:",{category:"persistence",operation:"cleaning-up-relationships-widget-reading-mode",error:p})}return}let l=null;try{let m=n.previewMode.containerEl;f_e(n);let f=e.settings.relationshipsPosition||"bottom",h=a.path;if(l=await y_e(e,h),t&&!t.isCurrent()){(c=l.component)==null||c.unload(),l.remove();return}let g=m.querySelector(".markdown-preview-sizer");if(!g){(d=l.component)==null||d.unload(),l.remove(),bd.warn("[TaskNotes] Could not find .markdown-preview-sizer for relationships in reading mode",{category:"stale-data",operation:"find-markdown-preview-sizer-relationships-reading-mode"});return}if(f==="top"){let v=oT(g).find(b=>b.classList.contains("tasknotes-task-card-note-widget"));v?CO(v,l):Kg(g,l)}else g_e(g,l)}catch(p){(u=l==null?void 0:l.component)==null||u.unload(),l==null||l.remove(),bd.error("[TaskNotes] Error injecting relationships widget in reading mode:",{category:"persistence",operation:"injecting-relationships-widget-reading-mode",error:p})}}function k_e(r){var C;let e=[],t=[],n=[],a=[],i=new WeakSet,s=new aT,o=E=>{s.schedule(E,D=>_ft(E,r,D))},l=E=>{let D=E.view;return r.settings.showRelationships&&D instanceof Va.MarkdownView&&D.getMode()==="preview"&&!!D.file},c=E=>{xO(E,`.${rP}`,o,i,a,l)},d=()=>{r.app.workspace.getLeavesOfType("markdown").forEach(E=>{c(E)})},u=(E,D)=>{var O;let P=E.view;return P instanceof Va.MarkdownView&&(!D||((O=P.file)==null?void 0:O.path)===D.path)},p=E=>{r.app.workspace.getLeavesOfType("markdown").forEach(P=>{u(P,E)&&(o(P),c(P))})},m=null,f=()=>{m&&window.clearTimeout(m),m=window.setTimeout(()=>{r.app.workspace.getLeavesOfType("markdown").forEach(D=>{o(D)}),d()},100)},h=r.app.workspace.on("layout-change",f);e.push(h);let g=r.app.workspace.on("active-leaf-change",E=>{E&&(o(E),c(E))});e.push(g);let v=r.app.workspace.on("file-open",E=>{p(E instanceof Va.TFile?E:null)});e.push(v);let b=new Map,k=r.app.metadataCache.on("changed",E=>{let D=b.get(E.path);D&&window.clearTimeout(D);let P=r.app.workspace.getLeavesOfType("markdown"),O=P.filter(R=>{var F;let A=R.view;return A instanceof Va.MarkdownView&&((F=A.file)==null?void 0:F.path)===E.path&&A.getMode()==="preview"});if(O.length>0){b.delete(E.path),O.forEach(R=>{o(R),c(R)});return}let z=window.setTimeout(()=>{b.delete(E.path),P.forEach(R=>{var F;let A=R.view;A instanceof Va.MarkdownView&&((F=A.file)==null?void 0:F.path)===E.path&&(o(R),c(R))})},500);b.set(E.path,z)});t.push(k);let w=(C=r.dependencyCache)==null?void 0:C.on(Am,f);return w&&n.push(w),r.app.workspace.getLeavesOfType("markdown").forEach(E=>{o(E)}),d(),()=>{s.dispose(),m&&window.clearTimeout(m),b.forEach(E=>window.clearTimeout(E)),b.clear(),a.forEach(E=>E()),e.forEach(E=>r.app.workspace.offref(E)),t.forEach(E=>r.app.metadataCache.offref(E)),n.forEach(E=>{var D;return(D=r.dependencyCache)==null?void 0:D.offref(E)}),r.app.workspace.getLeavesOfType("markdown").forEach(E=>{E.view instanceof Va.MarkdownView&&f_e(E.view)})}}var p_e,Va,bd,rP,Cft,I6,b_e=y(()=>{p_e=require("@codemirror/view"),Va=require("obsidian");iW();P6();A6();tP();_6();Du();R_();N_();K();bd=N({tag:"Editor/RelationshipsDecorations"}),rP="tasknotes-relationships-widget",Cft="task-card-injected";I6=class{constructor(e,t){this.plugin=t;this.currentFile=null;this.currentWidget=null;this.widgetContainer=null;this.debounceTimer=null;this.eventListeners=[];this.dependencyCacheEventListeners=[];this.injectionRunId=0;this.bottomOffsetFrame=null;this.view=e,this.currentFile=this.getFileFromView(e),this.setupEventListeners(),this.debouncedInjectWidget(e)}update(e){this.view=e.view;let t=this.getFileFromView(e.view);t!==this.currentFile?(this.currentFile=t,this.debouncedInjectWidget(e.view)):(e.docChanged||e.geometryChanged||e.viewportChanged)&&this.scheduleBottomOffsetRefresh()}destroy(){this.injectionRunId++,this.debounceTimer&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=null),this.bottomOffsetFrame!==null&&(window.cancelAnimationFrame(this.bottomOffsetFrame),this.bottomOffsetFrame=null),this.removeWidget(),this.eventListeners.forEach(e=>{this.plugin.emitter.offref(e)}),this.eventListeners=[],this.dependencyCacheEventListeners.forEach(e=>{var t;(t=this.plugin.dependencyCache)==null||t.offref(e)}),this.dependencyCacheEventListeners=[]}setupEventListeners(){var a;let e=this.plugin.emitter.on(Cft,()=>{this.debouncedInjectWidget(this.view)});this.eventListeners.push(e);let t=this.plugin.emitter.on("settings-changed",()=>{this.debouncedInjectWidget(this.view)});this.eventListeners.push(t);let n=(a=this.plugin.dependencyCache)==null?void 0:a.on(Am,()=>{this.debouncedInjectWidget(this.view)});n&&this.dependencyCacheEventListeners.push(n)}debouncedInjectWidget(e){this.debounceTimer&&window.clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{this.debounceTimer=null,this.injectWidget(e)},100)}scheduleBottomOffsetRefresh(){!this.currentWidget||!this.widgetContainer||(this.plugin.settings.relationshipsPosition||"bottom")!=="bottom"||(this.bottomOffsetFrame!==null&&window.cancelAnimationFrame(this.bottomOffsetFrame),this.bottomOffsetFrame=window.requestAnimationFrame(()=>{var e,t;this.bottomOffsetFrame=null,(e=this.currentWidget)!=null&&e.isConnected&&((t=this.widgetContainer)!=null&&t.isConnected)&&h_e(this.widgetContainer,this.currentWidget)}))}getFileFromView(e){try{let t=e.state.field(Va.editorInfoField,!1);return(t==null?void 0:t.file)||null}catch(t){return bd.debug("[TaskNotes] Error getting file from editor view:",{category:"persistence",operation:"getting-file-editor-view",error:t}),null}}isTableCellEditor(e){try{let t=e.dom;if(!t)return!1;if(iT(e)||t.closest("td, th")||t.closest(".cm-table-widget")||t.closest(".popover.hover-popover")||t.closest(".markdown-embed[data-type='footnote']"))return!0;let o=e.state.field(Va.editorInfoField,!1);if(!(o!=null&&o.file)){let l=t.parentElement,c=0,d=20;for(;l&&l!==activeDocument.body&&ca.classList.contains(rP)).forEach(a=>{var s;(s=a.component)==null||s.unload(),a.remove()}),this.currentWidget=null,this.widgetContainer=null}catch(n){bd.error("[TaskNotes] Error cleaning up orphaned relationships widgets:",{category:"stale-data",operation:"cleaning-up-orphaned-relationships-widgets",error:n})}}async injectWidget(e){var n,a;let t=++this.injectionRunId;if(this.removeWidget(),!this.isTableCellEditor(e)){this.cleanupOrphanedWidgets(e);try{if(!this.plugin.settings.showRelationships)return;let i=this.currentFile||this.getFileFromView(e);if(!(i instanceof Va.TFile))return;let s=!1,o=!1,l=this.plugin.app.metadataCache.getFileCache(i);if(l!=null&&l.frontmatter?(s=this.plugin.cacheManager.isTaskFile(l.frontmatter),o=EO(this.plugin,i,l)):o=EO(this.plugin,i,l),!s&&!o)return;let c=i.path,d=this.plugin.settings.relationshipsPosition||"bottom",u=(n=e.dom.closest(".markdown-source-view"))==null?void 0:n.querySelector(".cm-sizer");if(!u){bd.warn("[TaskNotes] Could not find .cm-sizer container for relationships widget",{category:"stale-data",operation:"find-cm-sizer-container-relationships-widget"});return}let p=await y_e(this.plugin,c);if(t!==this.injectionRunId){(a=p.component)==null||a.unload(),p.remove();return}if(this.cleanupOrphanedWidgets(e),this.currentWidget=p,this.widgetContainer=u,d==="top"){let m=oT(u).find(f=>f.classList.contains("tasknotes-task-card-note-widget"));m?CO(m,p):Kg(u,p)}else g_e(u,p),this.scheduleBottomOffsetRefresh()}catch(i){bd.error("[TaskNotes] Error injecting relationships widget:",{category:"internal",operation:"injecting-relationships-widget",error:i}),this.removeWidget()}}}}});function F6(r,e){let t=activeWindow.createDiv();t.className=`tasknotes-plugin task-card-note-widget ${Zg}`,t.setAttribute("contenteditable","false"),t.setAttribute("spellcheck","false"),t.setAttribute("data-widget-type","task-card"),t.setAttribute("data-task-path",e.path);let n=new qi.Component;n.load(),t.component=n;let a=r.settings.defaultVisibleProperties?$i(r.settings.defaultVisibleProperties,r):void 0,i=Dr(e,r,a);return i.classList.add("task-card-note-widget__card"),t.appendChild(i),t}function N6(r){r.querySelectorAll(`.${Zg}`).forEach(e=>{var n;(n=e.component)==null||n.unload(),e.remove()})}function w_e(r){return r.querySelector(".markdown-preview-sizer")}function Nft(r){let e=r,t=r.ownerDocument.defaultView;for(;e;){let n=t==null?void 0:t.getComputedStyle(e);if(e.style.display==="none"||(n==null?void 0:n.display)==="none"||(n==null?void 0:n.visibility)==="hidden")return!0;e=e.parentElement}return!1}function S_e(r,e){if(r.isEditing||e.querySelector(".markdown-source-view, .cm-editor"))return!0;let t=w_e(e);return!!(t&&Nft(t))}function Rft(r,e){let t=Array.from(e.querySelectorAll(`.${Zg}`));if(t.length===0)return!0;let n=t.some(i=>i.parentElement===e),a=t.some(i=>!!i.closest(".markdown-preview-sizer"));return S_e(r,e)?!n:n||!a}function Fft(r){var a;let e=(a=r.view)==null?void 0:a.canvas,t=e==null?void 0:e.nodes,n=t==null?void 0:t.values;return typeof n!="function"?[]:Array.from(n.call(t))}function Oft(r){return typeof r.filePath=="string"&&r.filePath.trim()?r.filePath:typeof r.file=="string"&&r.file.trim()?r.file:r.file instanceof qi.TFile?r.file.path:null}function x_e(r){return T_e.ViewPlugin.fromClass(class extends R6{constructor(e){super(e,r)}destroy(){super.destroy()}})}async function Lft(r,e,t){var s;let n=r.view;if(!(n instanceof qi.MarkdownView)||n.getMode()!=="preview"||sT(r))return;let a=n.file;if(!a||!e.settings.showTaskCardInNote)return;let i=e.cacheManager.getCachedTaskInfoSync(a.path);if(!i){try{let l=n.previewMode.containerEl,d=Array.from(l.querySelectorAll(`.${Zg}`)).some(m=>m.dataset.taskPath!==a.path),u=e.app.metadataCache.getFileCache(a),p=u!==null&&(!u.frontmatter||!e.cacheManager.isTaskFile(u.frontmatter));(d||p)&&N6(l)}catch(o){Td.debug("[TaskNotes] Error cleaning up task card in reading mode:",{category:"persistence",operation:"cleaning-up-task-card-reading-mode",error:o})}return}try{let l=n.previewMode.containerEl;N6(l);let c=F6(e,i);if(t&&!t.isCurrent()){(s=c.component)==null||s.unload(),c.remove();return}let d=l.querySelector(".markdown-preview-sizer");if(!d){Td.warn("[TaskNotes] Could not find .markdown-preview-sizer for task card in reading mode",{category:"stale-data",operation:"find-markdown-preview-sizer-task-card-reading-mode"});return}Kg(d,c)}catch(o){Td.error("[TaskNotes] Error injecting task card widget in reading mode:",{category:"persistence",operation:"injecting-task-card-widget-reading-mode",error:o})}}function C_e(r,e={}){if(r.settings.showTaskCardInNote)for(let t of r.app.workspace.getLeavesOfType("canvas"))for(let n of Fft(t)){let a=Oft(n),i=n.contentEl;if(!a||!i)continue;let s=S_e(n,i),o=i.querySelector(".markdown-source-view, .cm-editor");if(o!=null&&o.querySelector(`.${Zg}`))continue;let l=w_e(i);if(!s&&!l||!e.force&&!Rft(n,i))continue;let c=r.cacheManager.getCachedTaskInfoSync(a);if(N6(i),!c)continue;let d=F6(r,c);s?i.insertBefore(d,i.firstChild):l&&Kg(l,d)}}function E_e(r){let e=[],t=[],n=[],a=[],i=[],s=new WeakSet,o=[],l=new WeakSet,c=new aT,d=A=>{c.schedule(A,F=>Lft(A,r,F))},u=A=>{let F=A.view;return r.settings.showTaskCardInNote&&F instanceof qi.MarkdownView&&F.getMode()==="preview"&&!!F.file},p=A=>{xO(A,`.${Zg}`,d,l,o,u)},m=()=>{r.app.workspace.getLeavesOfType("markdown").forEach(A=>{p(A)})},f=(A,F)=>{var B;let $=A.view;return $ instanceof qi.MarkdownView&&(!F||((B=$.file)==null?void 0:B.path)===F.path)},h=A=>{r.app.workspace.getLeavesOfType("markdown").forEach($=>{f($,A)&&(d($),p($))})},g=null,v=null,b=(A={})=>{v&&window.clearTimeout(v),v=window.setTimeout(()=>{C_e(r,A),v=null},100)},k=()=>{for(let A of r.app.workspace.getLeavesOfType("canvas")){let F=A.view.containerEl;if(!F||s.has(F))continue;let $=new MutationObserver(()=>{b()});$.observe(F,{attributes:!0,attributeFilter:["class","style"],childList:!0,subtree:!0});let B=()=>{b({force:!0})};F.addEventListener("pointerdown",B,!0),F.addEventListener("focusin",B,!0),i.push(()=>{F.removeEventListener("pointerdown",B,!0),F.removeEventListener("focusin",B,!0)}),s.add(F),a.push($)}},w=()=>{g&&window.clearTimeout(g),g=window.setTimeout(()=>{r.app.workspace.getLeavesOfType("markdown").forEach(F=>{d(F)}),m(),k(),b({force:!0})},100)},S=r.app.workspace.on("layout-change",w);e.push(S);let C=r.app.workspace.on("active-leaf-change",A=>{A&&(d(A),p(A),k(),b())});e.push(C);let E=r.app.workspace.on("file-open",A=>{h(A instanceof qi.TFile?A:null),k(),b({force:!0})});e.push(E);let D=new Map,P=r.app.metadataCache.on("changed",A=>{let F=D.get(A.path);F&&window.clearTimeout(F);let $=r.app.workspace.getLeavesOfType("markdown"),B=$.filter(Q=>{var ie;let G=Q.view;return G instanceof qi.MarkdownView&&((ie=G.file)==null?void 0:ie.path)===A.path&&G.getMode()==="preview"});if(B.length>0){D.delete(A.path),B.forEach(Q=>{d(Q),p(Q)}),b({force:!0});return}let ue=window.setTimeout(()=>{D.delete(A.path),$.forEach(Q=>{var ie;let G=Q.view;G instanceof qi.MarkdownView&&((ie=G.file)==null?void 0:ie.path)===A.path&&(d(Q),p(Q))}),b({force:!0})},500);D.set(A.path,ue)});t.push(P);let O=r.emitter.on(ot,w);n.push(O);let z=r.emitter.on(ii,w);return n.push(z),r.app.workspace.getLeavesOfType("markdown").forEach(A=>{d(A)}),m(),k(),b({force:!0}),()=>{g&&window.clearTimeout(g),v&&window.clearTimeout(v),D.forEach(A=>window.clearTimeout(A)),D.clear(),c.dispose(),o.forEach(A=>A()),a.forEach(A=>A.disconnect()),i.forEach(A=>A()),e.forEach(A=>r.app.workspace.offref(A)),t.forEach(A=>r.app.metadataCache.offref(A)),n.forEach(A=>r.emitter.offref(A))}}var T_e,qi,Td,Zg,Ift,R6,D_e=y(()=>{T_e=require("@codemirror/view");Yr();qi=require("obsidian");mi();$c();P6();A6();tP();_6();K();Td=N({tag:"Editor/TaskCardNoteDecorations"}),Zg="tasknotes-task-card-note-widget",Ift="task-card-injected";R6=class{constructor(e,t){this.plugin=t;this.cachedTask=null;this.currentFile=null;this.eventListeners=[];this.currentWidget=null;this.widgetContainer=null;this.debounceTimer=null;this.view=e,this.currentFile=this.getFileFromView(e),this.setupEventListeners(),this.loadTaskForCurrentFile(e)}update(e){this.view=e.view;let t=this.getFileFromView(e.view);t!==this.currentFile&&(this.currentFile=t,this.loadTaskForCurrentFile(e.view))}destroy(){this.debounceTimer&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=null),this.removeWidget(),this.eventListeners.forEach(e=>{this.plugin.emitter.offref(e)}),this.eventListeners=[]}setupEventListeners(){let e=()=>{this.debounceTimer&&window.clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{this.loadTaskForCurrentFile(this.view)},100)},t=this.plugin.emitter.on(ii,e),n=this.plugin.emitter.on(ot,e),a=this.plugin.emitter.on(is,e),i=this.plugin.emitter.on(Wp,e),s=this.plugin.emitter.on("settings-changed",e);this.eventListeners.push(t,n,a,i,s)}removeWidget(){var e;this.currentWidget&&((e=this.currentWidget.component)==null||e.unload(),this.currentWidget.remove(),this.currentWidget=null),this.widgetContainer=null}cleanupOrphanedWidgets(e){var t;try{let n=(t=e.dom.closest(".canvas-node-content"))!=null?t:e.dom.closest(".workspace-leaf-content");if(!n){Td.debug("[TaskNotes] Could not find workspace-leaf-content for orphan cleanup",{category:"stale-data",operation:"find-workspace-leaf-content-orphan-cleanup"});return}n.querySelectorAll(`.${Zg}`).forEach(a=>{var i;a!==this.currentWidget&&((i=a.component)==null||i.unload(),a.remove())})}catch(n){Td.error("[TaskNotes] Error cleaning up orphaned task card widgets:",{category:"stale-data",operation:"cleaning-up-orphaned-task-card-widgets",error:n})}}loadTaskForCurrentFile(e){var n,a,i,s,o,l,c,d,u,p,m,f,h;let t=this.getFileFromView(e);if(t instanceof qi.TFile)try{let g=this.plugin.cacheManager.getCachedTaskInfoSync(t.path),v=k=>!(k!=null&&k.timeEntries)||k.timeEntries.length===0?!1:!k.timeEntries[k.timeEntries.length-1].endTime;(((n=this.cachedTask)==null?void 0:n.title)!==(g==null?void 0:g.title)||((a=this.cachedTask)==null?void 0:a.status)!==(g==null?void 0:g.status)||((i=this.cachedTask)==null?void 0:i.priority)!==(g==null?void 0:g.priority)||((s=this.cachedTask)==null?void 0:s.due)!==(g==null?void 0:g.due)||((o=this.cachedTask)==null?void 0:o.scheduled)!==(g==null?void 0:g.scheduled)||((l=this.cachedTask)==null?void 0:l.path)!==(g==null?void 0:g.path)||((c=this.cachedTask)==null?void 0:c.archived)!==(g==null?void 0:g.archived)||((d=this.cachedTask)==null?void 0:d.timeEstimate)!==(g==null?void 0:g.timeEstimate)||((u=this.cachedTask)==null?void 0:u.recurrence)!==(g==null?void 0:g.recurrence)||v(this.cachedTask)!==v(g)||JSON.stringify(((p=this.cachedTask)==null?void 0:p.tags)||[])!==JSON.stringify((g==null?void 0:g.tags)||[])||JSON.stringify(((m=this.cachedTask)==null?void 0:m.contexts)||[])!==JSON.stringify((g==null?void 0:g.contexts)||[])||JSON.stringify(((f=this.cachedTask)==null?void 0:f.projects)||[])!==JSON.stringify((g==null?void 0:g.projects)||[])||JSON.stringify(((h=this.cachedTask)==null?void 0:h.complete_instances)||[])!==JSON.stringify((g==null?void 0:g.complete_instances)||[]))&&(this.cachedTask=g,this.injectWidget(e))}catch(g){Td.error("[TaskNotes] Error loading task for task note:",{category:"persistence",operation:"loading-task-task-note",error:g})}else this.cachedTask!==null&&(this.cachedTask=null,this.injectWidget(e))}getFileFromView(e){try{let t=e.state.field(qi.editorInfoField,!1);return(t==null?void 0:t.file)||null}catch(t){return Td.debug("[TaskNotes] Error getting file from editor view:",{category:"persistence",operation:"getting-file-editor-view",error:t}),null}}isTableCellEditor(e){try{let t=e.dom;if(!t)return!1;if(iT(e)||t.closest("td, th")||t.closest(".cm-table-widget")||t.closest(".popover.hover-popover")||t.closest(".markdown-embed[data-type='footnote']"))return!0;let o=e.state.field(qi.editorInfoField,!1);if(!(o!=null&&o.file)){let l=t.parentElement,c=0,d=20;for(;l&&l!==activeDocument.body&&c{C_e(this.plugin,{force:!0})},0);return}this.cleanupOrphanedWidgets(e);try{if(!this.plugin.settings.showTaskCardInNote||!this.cachedTask)return;let n=(t=e.dom.closest(".markdown-source-view"))==null?void 0:t.querySelector(".cm-sizer");if(!n){Td.warn("[TaskNotes] Could not find .cm-sizer container for task card widget",{category:"stale-data",operation:"find-cm-sizer-container-task-card-widget"});return}let a=F6(this.plugin,this.cachedTask);this.currentWidget=a,this.widgetContainer=n,Kg(n,a),this.plugin.emitter.trigger(Ift,{container:n})}catch(n){Td.error("[TaskNotes] Error injecting task card widget:",{category:"persistence",operation:"injecting-task-card-widget",error:n}),this.removeWidget()}}}});function zft(r){try{return decodeURIComponent(r)}catch(e){return r}}function nP(r){let e=zft(r).trim();if(!e)return"";if(e.startsWith("app://"))try{e=new URL(e).pathname}catch(t){}return e=e.replace(/^\/+/,""),e=e.split("#")[0].trim(),e.endsWith(".md")&&(e=e.slice(0,-3)),e}function P_e(r){var n;let e=nP(r),t=e.split("/");return(n=t[t.length-1])!=null?n:e}function jft(r,e){let t=nP(r),n=nP(e);return!t||!n?!1:t===n?!0:P_e(t)===P_e(n)}function $ft(r){let e=[],t=/!?\[\[([^\]]+)\]\]/g,n;for(;(n=t.exec(r))!==null;){if(n[0].startsWith("!"))continue;let a=n[1].trim();if(!a)continue;let i=a.indexOf("|"),s=i===-1?a:a.slice(0,i),o=nP(s);o&&e.push({target:o,hasAlias:i!==-1,subpath:JD(s)})}return e}function Bft(r,e,t){let n=nP(t);if(!n)return null;let a=()=>{for(let s=e.index;s0?(e.index=0,a()):null)}function Uft(r,e){return`${r}\0${e}`}function Hft(){return{index:0}}function qft(r){var n;if(!r.disableOverlayOnAlias)return!1;if(r.hasExplicitAlias)return!0;let e=r.linkText.trim(),t=kd(r.taskTitle,(n=r.taskSubpath)!=null?n:JD(r.originalLinkPath));return t&&e===t||C6(e,r.taskPath,r.originalLinkPath,r.taskTitle)?!1:e!==r.originalLinkPath&&e!==r.taskTitle}function Wft(r,e){var t,n,a;try{return(a=(n=(t=r.getSectionInfo)==null?void 0:t.call(r,e))==null?void 0:n.text)!=null?a:""}catch(i){return""}}function M_e(r){return new O6(r).createPostProcessor()}var DO,Vft,O6,A_e=y(()=>{Yr();D6();K();kO();DO=N({tag:"Editor/ReadingModeTaskLinkProcessor"});Vft=".task-inline-preview--reading-mode[data-task-path]";O6=class{constructor(e){this.sourceLinkCursors=new Map;this.refreshTimer=null;this.pendingRefreshAll=!1;this.pendingRefreshTaskPaths=new Set;this.plugin=e,this.setupEventListeners()}createPostProcessor(){return(e,t)=>{var l,c,d;if(!this.plugin.settings.enableTaskLinkOverlay)return;let n=e.querySelectorAll("a"),a=Wft(t,e),i=$ft(a),s=Uft(t.sourcePath,a),o=(l=this.sourceLinkCursors.get(s))!=null?l:Hft();this.sourceLinkCursors.set(s,o);for(let u of Array.from(n)){let p=u,m=p.getAttribute("href"),f=p.getAttribute("data-href")||m||"",h=i.length>0?Bft(i,o,f):null;p.classList.contains("internal-link")?this.processLink(p,t.sourcePath,"internal",(c=h==null?void 0:h.hasAlias)!=null?c:!1,h==null?void 0:h.subpath):m&&!m.startsWith("http://")&&!m.startsWith("https://")&&!m.includes("://")&&this.processLink(p,t.sourcePath,"external",(d=h==null?void 0:h.hasAlias)!=null?d:!1,h==null?void 0:h.subpath)}}}async processLink(e,t,n,a,i){try{let s=e.getAttribute("href");if(!s)return;let o=s;if(n==="internal"){if(s.startsWith("app://")){let d=new URL(s);o=decodeURIComponent(d.pathname),o.startsWith("/")&&(o=o.substring(1))}}else{if(s.startsWith("http://")||s.startsWith("https://")||s.includes("://"))return;o=s}let l=this.resolveLinkPath(o,t);if(!l)return;let c=this.getTaskInfo(l);if(!c)return;await this.replaceWithTaskWidget(e,c,o,a,i)}catch(s){DO.debug("Error processing link in reading mode:",{category:"persistence",operation:"processing-link-reading-mode",error:s})}}setupEventListeners(){this.plugin.registerEvent(this.plugin.emitter.on(ot,e=>{var t,n,a,i;this.scheduleReadingModeWidgetRefresh((i=(n=e==null?void 0:e.path)!=null?n:(t=e==null?void 0:e.updatedTask)==null?void 0:t.path)!=null?i:(a=e==null?void 0:e.task)==null?void 0:a.path)})),this.plugin.registerEvent(this.plugin.emitter.on(is,e=>{this.scheduleReadingModeWidgetRefresh(e==null?void 0:e.path)})),this.plugin.registerEvent(this.plugin.emitter.on(ii,()=>{this.scheduleReadingModeWidgetRefresh()})),this.plugin.registerEvent(this.plugin.emitter.on(Wp,()=>{this.scheduleReadingModeWidgetRefresh()})),this.plugin.registerEvent(this.plugin.emitter.on("settings-changed",()=>{this.scheduleReadingModeWidgetRefresh()})),this.plugin.register(()=>{this.refreshTimer!==null&&(window.clearTimeout(this.refreshTimer),this.refreshTimer=null)})}scheduleReadingModeWidgetRefresh(e){e?this.pendingRefreshAll||this.pendingRefreshTaskPaths.add(e):(this.pendingRefreshAll=!0,this.pendingRefreshTaskPaths.clear()),this.refreshTimer!==null&&window.clearTimeout(this.refreshTimer),this.refreshTimer=window.setTimeout(()=>{this.refreshTimer=null;let t=this.pendingRefreshAll?void 0:new Set(this.pendingRefreshTaskPaths);this.pendingRefreshAll=!1,this.pendingRefreshTaskPaths.clear(),this.refreshReadingModeWidgets(t)},100)}refreshReadingModeWidgets(e){let t=this.getReadingModeContainers();if(t.length!==0)for(let n of t){let a=Array.from(n.querySelectorAll(Vft));for(let i of a){let s=i.dataset.taskPath;if(!s||e&&!e.has(s))continue;if(!this.plugin.settings.enableTaskLinkOverlay){this.replaceWidgetWithOriginalLink(i);continue}let o=this.getTaskInfo(s);if(!o){this.replaceWidgetWithOriginalLink(i);continue}let l=i.dataset.originalLinkPath||o.path,c=i.dataset.originalText||o.title,d=i.dataset.displayText||void 0,u=new Gg(o,this.plugin,c,d),p=this.createReadingModeWidget(u,o,l,c,d);i.replaceWith(p)}}}getReadingModeContainers(){var n,a,i,s,o;let e=(i=(a=(n=this.plugin.app.workspace).getLeavesOfType)==null?void 0:a.call(n,"markdown"))!=null?i:[],t=[];for(let l of e){let c=l.view;if(typeof c.getMode=="function"&&c.getMode()!=="preview")continue;let d=(o=(s=c.previewMode)==null?void 0:s.containerEl)!=null?o:c.containerEl;d&&t.push(d)}return t}replaceWidgetWithOriginalLink(e){let t=e.dataset.originalLinkPath;if(!t){e.remove();return}let n=activeWindow.createEl("a");n.className="internal-link",n.setAttribute("href",t),n.setAttribute("data-href",t),n.textContent=e.dataset.originalText||t,e.replaceWith(n)}resolveLinkPath(e,t){try{let n=this.plugin.app.metadataCache.getFirstLinkpathDest(e,t);return(n==null?void 0:n.path)||null}catch(n){return DO.debug("Error resolving link path:",{category:"persistence",operation:"resolving-link-path",details:{value:e},error:n}),null}}getTaskInfo(e){try{if(!e||typeof e!="string"||e.trim().length===0)return null;let t=this.plugin.cacheManager;if(!t||!t.getCachedTaskInfoSync)return null;let n=t.getCachedTaskInfoSync(e);return n&&typeof n=="object"&&n.title?n:null}catch(t){return DO.debug("Error getting task info for:",{category:"persistence",operation:"getting-task-info",details:{value:e},error:t}),null}}async replaceWithTaskWidget(e,t,n,a,i){var s;try{let o=e.textContent||`[[${n}]]`,l=kd(t.title,i!=null?i:JD(n));if(qft({disableOverlayOnAlias:this.plugin.settings.disableOverlayOnAlias,hasExplicitAlias:a,linkText:e.textContent||"",originalLinkPath:n,taskSubpath:i,taskPath:t.path,taskTitle:t.title}))return;let c,d=e.textContent||"";a?c=d.trim()||void 0:l?c=l:d!==n&&d!==t.title&&(c=nT(d,t.path,n));let u=new Gg(t,this.plugin,o,c),p=this.createReadingModeWidget(u,t,n,o,c);(s=e.parentNode)==null||s.replaceChild(p,e)}catch(o){DO.error("Error replacing wikilink with task widget:",{category:"persistence",operation:"replacing-wikilink-task-widget",error:o})}}createReadingModeWidget(e,t,n,a,i){let s={},o=e.toDOM(s);return o.classList.add("task-inline-preview--reading-mode"),o.dataset.taskPath=t.path,o.dataset.originalLinkPath=n,o.dataset.originalText=a,i&&(o.dataset.displayText=i),o}}});function Kft(r,e,t){let n;switch(r){case"P":e&&e==="-"?t.isNegative=!0:t.isNegative=!1;break;case"D":n="days";break;case"W":n="weeks";break;case"H":n="hours";break;case"M":n="minutes";break;case"S":n="seconds";break;default:return 0}if(n){if(!e&&e!==0)throw new Error('invalid duration value: Missing number before "'+r+'"');let a=parseInt(e,10);if(sP(a))throw new Error('invalid duration value: Invalid number "'+e+'" before "'+r+'"');t[n]=a}return 1}function xr(r){let e={},t=e.component=[];if(e.stack=[t],xr._eachLine(r,function(n,a){xr._handleContentLine(a,e)}),e.stack.length>1)throw new op("invalid ical body. component began but did not end");return e=null,t.length==1?t[0]:t}function rht(r){let e,t,n,a,i;if(!r||r.name!=="vcalendar")return r;for(e=r.getAllSubcomponents(),t=[],n={},i=0;i0&&r[t-1]==="\\")t+=1;else return t;return-1}function Jg(r,e,t){if(!r.length)return 0;let n=0,a=r.length-1,i,s;for(;n<=a;)if(i=n+Math.floor((a-n)/2),s=t(e,r[i]),s<0)a=i-1;else if(s>0)n=i+1;else break;return s<0?i:s>0?i+1:i}function ey(r,e){if(!r||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if("clone"in r)return r.clone();if(Array.isArray(r)){let t=[];for(let n=0;n65535?2:1:(e+=ho.newLineChar+" "+t.slice(0,Math.max(0,n)),t=t.slice(Math.max(0,n)),n=a=0)}return e.slice(ho.newLineChar.length+1)}function Ss(r){switch(typeof r!="string"&&(typeof r=="number"&&(r=parseInt(r)),r=String(r)),r.length){case 0:return"00";case 1:return"0"+r;default:return r}}function Ia(r){return r<0?Math.ceil(r):Math.floor(r)}function ty(r,e){for(let t in r){let n=Object.getOwnPropertyDescriptor(r,t);n&&!Object.getOwnPropertyDescriptor(e,t)&&Object.defineProperty(e,t,n)}return e}function of(r,e,t,n){let a=n;if(n[0]==="+"&&(a=n.slice(1)),a=vi(a),e!==void 0&&n '+e);if(t!==void 0&&n>t)throw new Error(r+': invalid value "'+n+'" must be < '+e);return a}function $6(r,e){return{matches:/.*/,fromICAL:function(n,a){return dht(n,r,a)},toICAL:function(n,a){let i=e;return a&&(i=new RegExp(i.source+"|"+a,i.flags)),n.replace(i,function(s){switch(s){case"\\":return"\\\\";case";":return"\\;";case",":return"\\,";case` `:return"\\n";default:return s}})}}}function cht(r){switch(r){case"\\\\":return"\\";case"\\;":return";";case"\\,":return",";case"\\n":case"\\N":return` `;default:return r}}function dht(r,e,t){return r.indexOf("\\")===-1?r:(t&&(e=new RegExp(e.source+"|\\\\"+t,e.flags)),r.replace(e,cht))}function Dn(r){typeof r[0]=="string"&&(r=[r]);let e=0,t=r.length,n="";for(;ee[0]?1:e[0]>r[0]?-1:0}var RO,Yft,Gft,fo,iP,cT,we,Ie,Zft,FO,j6,Qft,Jft,Xft,eht,op,tht,dT,uT,cr,Pr,Wi,OO,nht,sp,Qg,ws,oP,lT,aht,iht,V_e,sht,__e,ac,L6,z6,oht,lht,I_e,N_e,dr,lP,LO,PO,MO,AO,Ts,R_e,F_e,O_e,U6,H6,uht,sa,pht,mo,mht,fht,hht,ght,yht,ap,L_e,z_e,Mr,NO,j_e,vht,$_e,_O,IO,lf,Xg,cf,wd,df,kht,bht,nl,zO,aP,jO,B6,ho,q_e=y(()=>{RO=class r{constructor(e){I(this,"icaltype","binary");this.value=e}static fromString(e){return new r(e)}decodeValue(){return this._b64_decode(this.value)}setEncodedValue(e){this.value=this._b64_encode(e)}_b64_encode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n,a,i,s,o,l,c,d,u=0,p=0,m="",f=[];if(!e)return e;do n=e.charCodeAt(u++),a=e.charCodeAt(u++),i=e.charCodeAt(u++),d=n<<16|a<<8|i,s=d>>18&63,o=d>>12&63,l=d>>6&63,c=d&63,f[p++]=t.charAt(s)+t.charAt(o)+t.charAt(l)+t.charAt(c);while(u>16&255,a=d>>8&255,i=d&255,l==64?f[p++]=String.fromCharCode(n):c==64?f[p++]=String.fromCharCode(n,a):f[p++]=String.fromCharCode(n,a,i);while(un)-(t0?-1:0}toString(){return this.start+"/"+(this.end||this.duration)}toJSON(){return[this.start.toString(),(this.end||this.duration).toString()]}toICALString(){return this.start.toICALString()+"/"+(this.end||this.duration).toICALString()}},we=class we{constructor(e,t){I(this,"icalclass","icaltime");I(this,"_cachedUnixTime",null);I(this,"zone",null);I(this,"_pendingNormalization",!1);this.wrappedJSObject=this,this._time=Object.create(null),this._time.year=0,this._time.month=1,this._time.day=1,this._time.hour=0,this._time.minute=0,this._time.second=0,this._time.isDate=!1,this.fromData(e,t)}static daysInMonth(e,t){let n=[0,31,28,31,30,31,30,31,31,30,31,30,31],a=30;return e<1||e>12||(a=n[e],e==2&&(a+=we.isLeapYear(t))),a}static isLeapYear(e){return e<=1752?e%4==0:e%4==0&&e%100!=0||e%400==0}static fromDayOfYear(e,t){let n=t,a=e,i=new we;i.auto_normalize=!1;let s=we.isLeapYear(n)?1:0;if(a<1)return n--,s=we.isLeapYear(n)?1:0,a+=we.daysInYearPassedMonth[s][12],we.fromDayOfYear(a,n);if(a>we.daysInYearPassedMonth[s][12])return s=we.isLeapYear(n)?1:0,a-=we.daysInYearPassedMonth[s][12],n++,we.fromDayOfYear(a,n);i.year=n,i.isDate=!0;for(let o=11;o>=0;o--)if(a>we.daysInYearPassedMonth[s][o]){i.month=o+1,i.day=a-we.daysInYearPassedMonth[s][o];break}return i.auto_normalize=!0,i}static fromStringv2(e){return new we({year:parseInt(e.slice(0,4),10),month:parseInt(e.slice(5,7),10),day:parseInt(e.slice(8,10),10),isDate:!0})}static fromDateString(e){return new we({year:vi(e.slice(0,4)),month:vi(e.slice(5,7)),day:vi(e.slice(8,10)),isDate:!0})}static fromDateTimeString(e,t){if(e.length<19)throw new Error('invalid date-time value: "'+e+'"');let n,a;e.slice(-1)==="Z"?n=Pr.utcTimezone:t&&(a=t.getParameter("tzid"),t.parent&&(t.parent.name==="standard"||t.parent.name==="daylight"?n=Pr.localTimezone:a&&(n=t.parent.getTimeZoneByID(a))));let i={year:vi(e.slice(0,4)),month:vi(e.slice(5,7)),day:vi(e.slice(8,10)),hour:vi(e.slice(11,13)),minute:vi(e.slice(14,16)),second:vi(e.slice(17,19))};return a&&!n&&(i.timezone=a),new we(i,n)}static fromString(e,t){return e.length>10?we.fromDateTimeString(e,t):we.fromDateString(e)}static fromJSDate(e,t){return new we().fromJSDate(e,t)}static now(){return we.fromJSDate(new Date,!1)}static weekOneStarts(e,t){let n=we.fromData({year:e,month:1,day:1,isDate:!0}),a=n.dayOfWeek(),i=t||we.DEFAULT_WEEK_START;return a>we.THURSDAY&&(n.day+=7),i>we.THURSDAY&&(n.day-=7),n.day-=a-i,n}static getDominicalLetter(e){let t="GFEDCBA",n=(e+(e/4|0)+(e/400|0)-(e/100|0)-1)%7;return we.isLeapYear(e)?t[(n+6)%7]+t[n]:t[n]}static get epochTime(){return In(this,cT)||xo(this,cT,we.fromData({year:1970,month:1,day:1,hour:0,minute:0,second:0,isDate:!1,timezone:"Z"})),In(this,cT)}static _cmp_attr(e,t,n){return e[n]>t[n]?1:e[n]=0){o.day=1,i!=0&&i--,s=o.day;let l=o.dayOfWeek(),c=e-l;c<0&&(c+=7),s+=c,s-=e,a=e}else{o.day=n;let l=o.dayOfWeek();i++,a=l-e,a<0&&(a+=7),a=n-a}return a+=i*7,s+a}isNthWeekDay(e,t){let n=this.dayOfWeek();return t===0&&n===e||this.nthWeekDay(e,t)===this.day}weekNumber(e){let t=(this.year<<12)+(this.month<<8)+(this.day<<3)+e;if(t in we._wnCache)return we._wnCache[t];let n,a=this.clone();a.isDate=!0;let i=this.year;a.month==12&&a.day>25?(n=we.weekOneStarts(i+1,e),a.compare(n)<0?n=we.weekOneStarts(i,e):i++):(n=we.weekOneStarts(i,e),a.compare(n)<0&&(n=we.weekOneStarts(--i,e)));let s=a.subtractDate(n).toSeconds()/86400,o=Ia(s/7)+1;return we._wnCache[t]=o,o}addDuration(e){let t=e.isNegative?-1:1,n=this.second,a=this.minute,i=this.hour,s=this.day;n+=t*e.seconds,a+=t*e.minutes,i+=t*e.hours,s+=t*e.days,s+=t*7*e.weeks,this.second=n,this.minute=a,this.hour=i,this.day=s,this._cachedUnixTime=null}subtractDate(e){let t=this.toUnixTime()+this.utcOffset(),n=e.toUnixTime()+e.utcOffset();return fo.fromSeconds(t-n)}subtractDateTz(e){let t=this.toUnixTime(),n=e.toUnixTime();return fo.fromSeconds(t-n)}compare(e){if(e instanceof iP)return-1*e.compare(this);{let t=this.toUnixTime(),n=e.toUnixTime();return t>n?1:n>t?-1:0}}compareDateOnlyTz(e,t){let n=this.convertToZone(t),a=e.convertToZone(t),i=0;return(i=we._cmp_attr(n,a,"year"))!=0||(i=we._cmp_attr(n,a,"month"))!=0||(i=we._cmp_attr(n,a,"day"))!=0,i}convertToZone(e){let t=this.clone(),n=this.zone.tzid==e.tzid;return!this.isDate&&!n&&Pr.convert_time(t,this.zone,e),t.zone=e,t}utcOffset(){return this.zone==Pr.localTimezone||this.zone==Pr.utcTimezone?0:this.zone.utcOffset(this)}toICALString(){let e=this.toString();return e.length>10?Mr.icalendar.value["date-time"].toICAL(e):Mr.icalendar.value.date.toICAL(e)}toString(){let e=this.year+"-"+Ss(this.month)+"-"+Ss(this.day);return this.isDate||(e+="T"+Ss(this.hour)+":"+Ss(this.minute)+":"+Ss(this.second),this.zone===Pr.utcTimezone&&(e+="Z")),e}toJSDate(){return this.zone==Pr.localTimezone?this.isDate?new Date(this.year,this.month-1,this.day):new Date(this.year,this.month-1,this.day,this.hour,this.minute,this.second,0):new Date(this.toUnixTime()*1e3)}_normalize(){return this._time.isDate&&(this._time.hour=0,this._time.minute=0,this._time.second=0),this.adjust(0,0,0,0),this}adjust(e,t,n,a,i){let s,o,l=0,c=0,d,u,p,m,f,h=i||this._time;if(h.isDate||(d=h.second+a,h.second=d%60,s=Ia(d/60),h.second<0&&(h.second+=60,s--),u=h.minute+n+s,h.minute=u%60,o=Ia(u/60),h.minute<0&&(h.minute+=60,o--),p=h.hour+t+o,h.hour=p%24,l=Ia(p/24),h.hour<0&&(h.hour+=24,l--)),h.month>12?c=Ia((h.month-1)/12):h.month<1&&(c=Ia(h.month/12)-1),h.year+=c,h.month-=12*c,m=h.day+e+l,m>0)for(;f=we.daysInMonth(h.month,h.year),!(m<=f);)h.month++,h.month>12&&(h.year++,h.month=1),m-=f;else for(;m<=0;)h.month==1?(h.year--,h.month=12):h.month--,m+=we.daysInMonth(h.month,h.year);return h.day=m,this._cachedUnixTime=null,this}fromUnixTime(e){this.zone=Pr.utcTimezone;let t=new Date(e*1e3);this.year=t.getUTCFullYear(),this.month=t.getUTCMonth()+1,this.day=t.getUTCDate(),this._time.isDate?(this.hour=0,this.minute=0,this.second=0):(this.hour=t.getUTCHours(),this.minute=t.getUTCMinutes(),this.second=t.getUTCSeconds()),this._cachedUnixTime=null}toUnixTime(){if(this._cachedUnixTime!==null)return this._cachedUnixTime;let e=this.utcOffset(),t=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second-e);return this._cachedUnixTime=t/1e3,this._cachedUnixTime}toJSON(){let e=["year","month","day","hour","minute","second","isDate"],t=Object.create(null),n=0,a=e.length,i;for(;nt&&(n=-1);let c;if(n!==-1){if(s=r.slice(0,Math.max(0,n)).toLowerCase(),c=xr._parseParameters(r.slice(Math.max(0,n)),0,e.designSet),c[2]==-1)throw new op("Invalid parameters in '"+r+"'");l=c[0];let v;if(typeof c[1]=="string"?v=c[1].length:v=c[1].reduce((b,k)=>b+k.length,0),a=v+c[2]+n,(i=r.slice(Math.max(0,a)).indexOf(FO))!==-1)o=r.slice(Math.max(0,a+i+1));else throw new op("Missing parameter value in '"+r+"'")}else if(t!==-1){if(s=r.slice(0,Math.max(0,t)).toLowerCase(),o=r.slice(Math.max(0,t+1)),s==="begin"){let v=[o.toLowerCase(),[],[]];e.stack.length===1?e.component.push(v):e.component[2].push(v),e.stack.push(e.component),e.component=v,e.designSet||(e.designSet=Mr.getDesignSet(e.component[0]));return}else if(s==="end"){e.component=e.stack.pop();return}}else throw new op('invalid line (no token ";" or ":") "'+r+'"');let d,u=!1,p=!1,m,f,h;e.designSet.propertyGroups&&s.indexOf(".")!==-1?(f=s.split("."),l.group=f[0],h=f[1]):h=s,h in e.designSet.property&&(m=e.designSet.property[h],"multiValue"in m&&(u=m.multiValue),"structuredValue"in m&&(p=m.structuredValue),o&&"detectType"in m&&(d=m.detectType(o))),d||("value"in l?d=l.value.toLowerCase():m?d=m.defaultType:d=Jft),delete l.value;let g;u&&p?(o=xr._parseMultiValue(o,p,d,[],u,e.designSet,p),g=[h,l,d,o]):u?(g=[h,l,d],xr._parseMultiValue(o,u,d,g,null,e.designSet,!1)):p?(o=xr._parseMultiValue(o,p,d,[],null,e.designSet,p),g=[h,l,d,o]):(o=xr._parseValue(o,d,e.designSet,!1),g=[h,l,d,o]),e.component[0]==="vcard"&&e.component[1].length===0&&!(s==="version"&&o==="4.0")&&(e.designSet=Mr.getDesignSet("vcard3")),e.component[1].push(g)};xr._parseValue=function(r,e,t,n){return e in t.value&&"fromICAL"in t.value[e]?t.value[e].fromICAL(r,n):r};xr._parseParameters=function(r,e,t){let n=e,a=0,i=Qft,s={},o,l,c,d=-1,u,p,m;for(;a!==!1&&(a=r.indexOf(i,a+1))!==-1;){if(o=r.slice(n+1,a),o.length==0)throw new op("Empty parameter name in '"+r+"'");if(l=o.toLowerCase(),m=!1,p=!1,l in t.param&&t.param[l].valueType?u=t.param[l].valueType:u=Xft,l in t.param&&(p=t.param[l].multiValue,t.param[l].multiValueSeparateDQuote&&(m=xr._rfc6868Escape('"'+p+'"'))),r[a+1]==='"'){if(d=a+2,a=r.indexOf('"',d),p&&a!=-1){let v=!0;for(;v;)r[a+1]==p&&r[a+2]=='"'?a=r.indexOf('"',a+3):v=!1}if(a===-1)throw new op('invalid line (no matching double quote) "'+r+'"');c=r.slice(d,a),n=r.indexOf(j6,a);let g=r.indexOf(FO,a);(n===-1||g!==-1&&n>g)&&(a=!1)}else{d=a+1;let g=r.indexOf(j6,d),v=r.indexOf(FO,d);v!==-1&&g>v?(g=v,a=!1):g===-1?(v===-1?g=r.length:g=v,a=!1):(n=g,a=g),c=r.slice(d,g)}let h=c.length;if(c=xr._rfc6868Escape(c),d+=h-c.length,p){let g=m||p;c=xr._parseMultiValue(c,g,u,[],null,t)}else c=xr._parseValue(c,u,t);p&&l in s?Array.isArray(s[l])?s[l].push(c):s[l]=[s[l],c]:s[l]=c}return[s,c,d]};xr._rfc6868Escape=function(r){return r.replace(/\^['n^]/g,function(e){return eht[e]})};xr._parseMultiValue=function(r,e,t,n,a,i,s){let o=0,l=0,c;if(e.length===0)return r;for(;(o=U_e(r,e,l))!==-1;)c=r.slice(l,o),a?c=xr._parseMultiValue(c,a,t,[],null,i,s):c=xr._parseValue(c,t,i,s),n.push(c),l=o+e.length;return c=r.slice(l),a?c=xr._parseMultiValue(c,a,t,[],null,i,s):c=xr._parseValue(c,t,i,s),n.push(c),n.length==1?n[0]:n};xr._eachLine=function(r,e){let t=r.length,n=r.search(Zft),a=n,i,s,o;do a=r.indexOf(` `,n)+1,a>1&&r[a-2]==="\r"?o=2:o=1,a===0&&(a=t,o=0),s=r[n],s===" "||s===" "?i+=r.slice(n+1,a-o):(i&&e(null,i),i=r.slice(n,a-o)),n=a;while(a!==t);i=i.trim(),i.length&&e(null,i)};tht=["tzid","location","tznames","latitude","longitude"],cr=class cr{constructor(e){I(this,"tzid","");I(this,"location","");I(this,"tznames","");I(this,"latitude",0);I(this,"longitude",0);I(this,"component",null);I(this,"expandedUntilYear",0);I(this,"icalclass","icaltimezone");this.wrappedJSObject=this,this.fromData(e)}static _compare_change_fn(e,t){return e.yeart.year?1:e.montht.month?1:e.dayt.day?1:e.hourt.hour?1:e.minutet.minute?1:e.secondt.second?1:0}static convert_time(e,t,n){if(e.isDate||t.tzid==n.tzid||t==cr.localTimezone||n==cr.localTimezone)return e.zone=n,e;let a=t.utcOffset(e);return e.adjust(0,0,0,-a),a=n.utcOffset(e),e.adjust(0,0,0,a),null}static fromData(e){return new cr().fromData(e)}static get utcTimezone(){return In(this,dT)||xo(this,dT,cr.fromData({tzid:"UTC"})),In(this,dT)}static get localTimezone(){return In(this,uT)||xo(this,uT,cr.fromData({tzid:"floating"})),In(this,uT)}static adjust_change(e,t,n,a,i){return Ie.prototype.adjust.call(e,t,n,a,i,e)}fromData(e){if(this.expandedUntilYear=0,this.changes=[],e instanceof nl)this.component=e;else{if(e&&"component"in e)if(typeof e.component=="string"){let t=xr(e.component);this.component=new nl(t)}else e.component instanceof nl?this.component=e.component:this.component=null;for(let t of tht)e&&t in e&&(this[t]=e[t])}return this.component instanceof nl&&!this.tzid&&(this.tzid=this.component.getFirstPropertyValue("tzid")),this}utcOffset(e){if(this==cr.utcTimezone||this==cr.localTimezone||(this._ensureCoverage(e.year),!this.changes.length))return 0;let t={year:e.year,month:e.month,day:e.day,hour:e.hour,minute:e.minute,second:e.second},n=this._findNearbyChange(t),a=-1,i=1;for(;;){let l=ey(this.changes[n],!0);if(l.utcOffset=0?a=n:i=-1,i==-1&&a!=-1)break;if(n+=i,n<0)return 0;if(n>=this.changes.length)break}let s=this.changes[a];if(s.utcOffset-s.prevUtcOffset<0&&a>0){let l=ey(s,!0);if(cr.adjust_change(l,0,0,0,l.prevUtcOffset),cr._compare_change_fn(t,l)<0){let c=this.changes[a-1],d=!1;s.is_daylight!=d&&c.is_daylight==d&&(s=c)}}return s.utcOffset}_findNearbyChange(e){let t=Jg(this.changes,e,cr._compare_change_fn);return t>=this.changes.length?this.changes.length-1:t}_ensureCoverage(e){if(cr._minimumExpansionYear==-1){let n=Ie.now();cr._minimumExpansionYear=n.year}let t=e;if(tt||!u));)i.year=u.year,i.month=u.month,i.day=u.day,i.hour=u.hour,i.minute=u.minute,i.second=u.second,i.isDate=u.isDate,cr.adjust_change(i,0,0,0,-i.prevUtcOffset),n.push(i)}}return n}toString(){return this.tznames?this.tznames:this.tzid}};dT=new WeakMap,uT=new WeakMap,Tc(cr,dT,null),Tc(cr,uT,null),I(cr,"_minimumExpansionYear",-1),I(cr,"EXTRA_COVERAGE",5);Pr=cr,Wi=null,OO={get count(){return Wi===null?0:Object.keys(Wi).length},reset:function(){Wi=Object.create(null);let r=Pr.utcTimezone;Wi.Z=r,Wi.UTC=r,Wi.GMT=r},_hard_reset:function(){Wi=null},has:function(r){return Wi===null?!1:!!Wi[r]},get:function(r){return Wi===null&&this.reset(),Wi[r]},register:function(r,e){if(Wi===null&&this.reset(),typeof r=="string"&&e instanceof Pr&&([r,e]=[e,r]),e||(r instanceof Pr?e=r.tzid:r.name==="vtimezone"&&(r=new Pr(r),e=r.tzid)),!e)throw new TypeError("Neither a timezone nor a name was passed");if(r instanceof Pr)Wi[e]=r;else throw new TypeError("timezone must be ICAL.Timezone or ICAL.Component")},remove:function(r){return Wi===null?null:delete Wi[r]}};nht=Object.freeze({__proto__:null,binsearchInsert:Jg,clone:ey,extend:ty,foldline:H_e,formatClassType:ip,isStrictlyNaN:sP,pad2:Ss,strictParseInt:vi,trunc:Ia,unescapedIndexOf:U_e,updateTimezones:rht}),sp=class r{constructor(e){I(this,"hours",0);I(this,"minutes",0);I(this,"factor",1);I(this,"icaltype","utc-offset");this.fromData(e)}static fromString(e){let t={};return t.factor=e[0]==="+"?1:-1,t.hours=vi(e.slice(1,3)),t.minutes=vi(e.slice(4,6)),new r(t)}static fromSeconds(e){let t=new r;return t.fromSeconds(e),t}clone(){return r.fromSeconds(this.toSeconds())}fromData(e){if(e)for(let[t,n]of Object.entries(e))this[t]=n;this._normalize()}fromSeconds(e){let t=Math.abs(e);return this.factor=e<0?-1:1,this.hours=Ia(t/3600),t-=this.hours*3600,this.minutes=Ia(t/60),this}toSeconds(){return this.factor*(60*this.minutes+3600*this.hours)}compare(e){let t=this.toSeconds(),n=e.toSeconds();return(t>n)-(n>t)}_normalize(){let e=this.toSeconds(),t=this.factor;for(;e<-43200;)e+=97200;for(;e>50400;)e-=97200;this.fromSeconds(e),e==0&&(this.factor=t)}toICALString(){return Mr.icalendar.value["utc-offset"].toICAL(this.toString())}toString(){return(this.factor==1?"+":"-")+Ss(this.hours)+":"+Ss(this.minutes)}},Qg=class r extends Ie{constructor(t,n,a){super(t,n);I(this,"icalclass","vcardtime");I(this,"icaltype","date-and-or-time");this.icaltype=a||"date-and-or-time"}static fromDateAndOrTimeString(t,n){function a(g,v,b){return g?vi(g.slice(v,v+b)):null}let i=t.split("T"),s=i[0],o=i[1],l=o?Mr.vcard.value.time._splitZone(o):[],c=l[0],d=l[1],u=s?s.length:0,p=d?d.length:0,m=s&&s[0]=="-"&&s[1]=="-",f=d&&d[0]=="-",h={year:m?null:a(s,0,4),month:m&&(u==4||u==7)?a(s,2,2):u==7||u==10?a(s,5,2):null,day:u==5?a(s,3,2):u==7&&m?a(s,5,2):u==10?a(s,8,2):null,hour:f?null:a(d,0,2),minute:f&&p==3?a(d,1,2):p>4?f?a(d,1,2):a(d,3,2):null,second:p==4?a(d,2,2):p==6?a(d,4,2):p==8?a(d,6,2):null};return c=="Z"?c=Pr.utcTimezone:c&&c[3]==":"?c=sp.fromString(c):c=null,new r(h,c,n)}clone(){return new r(this._time,this.zone,this.icaltype)}_normalize(){return this}utcOffset(){return this.zone instanceof sp?this.zone.toSeconds():Ie.prototype.utcOffset.apply(this,arguments)}toICALString(){return Mr.vcard.value[this.icaltype].toICAL(this.toString())}toString(){let t=this.year,n=this.month,a=this.day,i=this.hour,s=this.minute,o=this.second,l=t!==null,c=n!==null,d=a!==null,u=i!==null,p=s!==null,m=o!==null,f=(l?Ss(t)+(c||d?"-":""):c||d?"--":"")+(c?Ss(n):"")+(d?"-"+Ss(a):""),h=(u?Ss(i):"-")+(u&&p?":":"")+(p?Ss(s):"")+(!u&&!p?"-":"")+(p&&m?":":"")+(m?Ss(o):""),g;switch(this.zone===Pr.utcTimezone?g="Z":this.zone instanceof sp?g=this.zone.toString():this.zone===Pr.localTimezone?g="":this.zone instanceof Pr?g=sp.fromSeconds(this.zone.utcOffset(this)).toString():g="",this.icaltype){case"time":return h+g;case"date-and-or-time":case"date-time":return f+(h=="--"?"":"T"+h+g);case"date":return f}return null}},ws=class ws{constructor(e){I(this,"completed",!1);I(this,"rule",null);I(this,"dtstart",null);I(this,"last",null);I(this,"occurrence_number",0);I(this,"by_indices",null);I(this,"initialized",!1);I(this,"by_data",null);I(this,"days",null);I(this,"days_index",0);this.fromData(e)}fromData(e){if(this.rule=ip(e.rule,ac),!this.rule)throw new Error("iterator requires a (ICAL.Recur) rule");if(this.dtstart=ip(e.dtstart,Ie),!this.dtstart)throw new Error("iterator requires a (ICAL.Time) dtstart");if(e.by_data?this.by_data=e.by_data:this.by_data=ey(this.rule.parts,!0),e.occurrence_number&&(this.occurrence_number=e.occurrence_number),this.days=e.days||[],e.last&&(this.last=ip(e.last,Ie)),this.by_indices=e.by_indices,this.by_indices||(this.by_indices={BYSECOND:0,BYMINUTE:0,BYHOUR:0,BYDAY:0,BYMONTH:0,BYWEEKNO:0,BYMONTHDAY:0}),this.initialized=e.initialized||!1,!this.initialized)try{this.init()}catch(t){if(t instanceof lT)this.completed=!0;else throw t}}init(){this.initialized=!0,this.last=this.dtstart.clone();let e=this.by_data;if("BYDAY"in e&&this.sort_byday_rules(e.BYDAY),"BYYEARDAY"in e&&("BYMONTH"in e||"BYWEEKNO"in e||"BYMONTHDAY"in e))throw new Error("Invalid BYYEARDAY rule");if("BYWEEKNO"in e&&"BYMONTHDAY"in e)throw new Error("BYWEEKNO does not fit to BYMONTHDAY");if(this.rule.freq=="MONTHLY"&&("BYYEARDAY"in e||"BYWEEKNO"in e))throw new Error("For MONTHLY recurrences neither BYYEARDAY nor BYWEEKNO may appear");if(this.rule.freq=="WEEKLY"&&("BYYEARDAY"in e||"BYMONTHDAY"in e))throw new Error("For WEEKLY recurrences neither BYMONTHDAY nor BYYEARDAY may appear");if(this.rule.freq!="YEARLY"&&"BYYEARDAY"in e)throw new Error("BYYEARDAY may only appear in YEARLY rules");if(this.last.second=this.setup_defaults("BYSECOND","SECONDLY",this.dtstart.second),this.last.minute=this.setup_defaults("BYMINUTE","MINUTELY",this.dtstart.minute),this.last.hour=this.setup_defaults("BYHOUR","HOURLY",this.dtstart.hour),this.last.day=this.setup_defaults("BYMONTHDAY","DAILY",this.dtstart.day),this.last.month=this.setup_defaults("BYMONTH","MONTHLY",this.dtstart.month),this.rule.freq=="WEEKLY")if("BYDAY"in e){let[,t]=this.ruleDayOfWeek(e.BYDAY[0],this.rule.wkst),n=t-this.last.dayOfWeek(this.rule.wkst);(this.last.dayOfWeek(this.rule.wkst)=0||n<0)&&(this.last.day+=n)}else{let t=ac.numericDayToIcalDay(this.dtstart.dayOfWeek());e.BYDAY=[t]}if(this.rule.freq=="YEARLY"){let t=this.rule.until?this.rule.until.year:2e4;for(;this.last.year<=t&&(this.expand_year_days(this.last.year),!(this.days.length>0));)this.increment_year(this.rule.interval);if(this.days.length==0)throw new lT;if(!this._nextByYearDay()&&!this.next_year()&&!this.next_year()&&!this.next_year())throw new lT}if(this.rule.freq=="MONTHLY"){if(this.has_by_data("BYDAY")){let t=null,n=this.last.clone(),a=Ie.daysInMonth(this.last.month,this.last.year);for(let i of this.by_data.BYDAY){this.last=n.clone();let[s,o]=this.ruleDayOfWeek(i),l=this.last.nthWeekDay(o,s);if(s>=6||s<=-6)throw new Error("Malformed values in BYDAY part");if(l>a||l<=0){if(t&&t.month==n.month)continue;for(;l>a||l<=0;)this.increment_month(),a=Ie.daysInMonth(this.last.month,this.last.year),l=this.last.nthWeekDay(o,s)}this.last.day=l,(!t||this.last.compare(t)<0)&&(t=this.last.clone())}if(this.last=t.clone(),this.has_by_data("BYMONTHDAY")&&this._byDayAndMonthDay(!0),this.last.day>a||this.last.day==0)throw new Error("Malformed values in BYDAY part")}else if(this.has_by_data("BYMONTHDAY")){this.last.day=1;let t=this.normalizeByMonthDayRules(this.last.year,this.last.month,this.rule.parts.BYMONTHDAY).filter(n=>n>=this.last.day);if(t.length)this.last.day=t[0],this.by_data.BYMONTHDAY=t;else if(!this.next_month()&&!this.next_month()&&!this.next_month())throw new lT}}}next(e=!1){let t=this.last?this.last.clone():null;if((this.rule.count&&this.occurrence_number>=this.rule.count||this.rule.until&&this.last.compare(this.rule.until)>0)&&(this.completed=!0),this.completed)return null;if(this.occurrence_number==0&&this.last.compare(this.dtstart)>=0)return this.occurrence_number++,this.last;let n,a=0;do switch(n=1,this.rule.freq){case"SECONDLY":this.next_second();break;case"MINUTELY":this.next_minute();break;case"HOURLY":this.next_hour();break;case"DAILY":this.next_day();break;case"WEEKLY":this.next_week();break;case"MONTHLY":if(n=this.next_month(),n)a=0;else if(++a==336)return this.completed=!0,null;break;case"YEARLY":if(n=this.next_year(),n)a=0;else if(++a==28)return this.completed=!0,null;break;default:return null}while(!this.check_contracting_rules()||this.last.compare(this.dtstart)<0||!n);if(this.last.compare(t)==0){if(e)throw new Error("Same occurrence found twice, protecting you from death by recursion");this.next(!0)}return this.rule.until&&this.last.compare(this.rule.until)>0?(this.completed=!0,null):(this.occurrence_number++,this.last)}next_second(){return this.next_generic("BYSECOND","SECONDLY","second","minute")}increment_second(e){return this.increment_generic(e,"second",60,"minute")}next_minute(){return this.next_generic("BYMINUTE","MINUTELY","minute","hour","next_second")}increment_minute(e){return this.increment_generic(e,"minute",60,"hour")}next_hour(){return this.next_generic("BYHOUR","HOURLY","hour","monthday","next_minute")}increment_hour(e){this.increment_generic(e,"hour",24,"monthday")}next_day(){let e=this.rule.freq=="DAILY";return this.next_hour()==0||(e?this.increment_monthday(this.rule.interval):this.increment_monthday(1)),0}next_week(){let e=0;if(this.next_weekday_by_week()==0)return e;if(this.has_by_data("BYWEEKNO")){this.by_indices.BYWEEKNO++,this.by_indices.BYWEEKNO==this.by_data.BYWEEKNO.length&&(this.by_indices.BYWEEKNO=0,e=1),this.last.month=1,this.last.day=1;let t=this.by_data.BYWEEKNO[this.by_indices.BYWEEKNO];this.last.day+=7*t,e&&this.increment_year(1)}else this.increment_monthday(7*this.rule.interval);return e}normalizeByMonthDayRules(e,t,n){let a=Ie.daysInMonth(t,e),i=[],s=0,o=n.length,l;for(;sa)){if(l<0)l=a+(l+1);else if(l===0)continue;i.indexOf(l)===-1&&i.push(l)}}return i.sort(function(c,d){return c-d})}_byDayAndMonthDay(e){let t,n=this.by_data.BYDAY,a,i=0,s,o=n.length,l=0,c,d=this,u=this.last.day;function p(){for(c=Ie.daysInMonth(d.last.month,d.last.year),t=d.normalizeByMonthDayRules(d.last.year,d.last.month,d.by_data.BYMONTHDAY),s=t.length;t[i]<=u&&!(e&&t[i]==u)&&ic){m();continue}let h=t[i++];if(h>=a)u=h;else{m();continue}for(let g=0;gt&&(this.last.day=1,this.increment_month(),this.is_day_in_byday(this.last)?(!this.has_by_data("BYSETPOS")||this.check_set_position(1))&&(e=1):e=0)}else if(this.has_by_data("BYMONTHDAY")){if(this.by_indices.BYMONTHDAY++,this.by_indices.BYMONTHDAY>=this.by_data.BYMONTHDAY.length&&(this.by_indices.BYMONTHDAY=0,this.increment_month(),this.by_indices.BYMONTHDAY>=this.by_data.BYMONTHDAY.length))return 0;let t=Ie.daysInMonth(this.last.month,this.last.year),n=this.by_data.BYMONTHDAY[this.by_indices.BYMONTHDAY];n<0&&(n=t+n+1),n>t?(this.last.day=1,e=this.is_day_in_byday(this.last)):this.last.day=n}else{this.increment_month();let t=Ie.daysInMonth(this.last.month,this.last.year);this.by_data.BYMONTHDAY[0]>t?e=0:this.last.day=this.by_data.BYMONTHDAY[0]}return e}next_weekday_by_week(){let e=0;if(this.next_hour()==0)return e;if(!this.has_by_data("BYDAY"))return 1;for(;;){let t=new Ie;this.by_indices.BYDAY++,this.by_indices.BYDAY==Object.keys(this.by_data.BYDAY).length&&(this.by_indices.BYDAY=0,e=1);let n=this.by_data.BYDAY[this.by_indices.BYDAY],i=this.ruleDayOfWeek(n)[1];i-=this.rule.wkst,i<0&&(i+=7),t.year=this.last.year,t.month=this.last.month,t.day=this.last.day;let s=t.startDoyWeek(this.rule.wkst);if(i+s<1&&!e)continue;let o=Ie.fromDayOfYear(s+i,this.last.year);return this.last.year=o.year,this.last.month=o.month,this.last.day=o.day,e}}next_year(){return this.next_hour()==0||(this.days.length==0||++this.days_index==this.days.length)&&(this.days_index=0,this.increment_year(this.rule.interval),this.has_by_data("BYMONTHDAY")&&(this.by_data.BYMONTHDAY=this.normalizeByMonthDayRules(this.last.year,this.last.month,this.rule.parts.BYMONTHDAY)),this.expand_year_days(this.last.year),this.days.length==0)?0:this._nextByYearDay()}_nextByYearDay(){let e=this.days[this.days_index],t=this.last.year;if(Math.abs(e)==366&&!Ie.isLeapYear(this.last.year))return 0;e<1&&(e+=1,t+=1);let n=Ie.fromDayOfYear(e,t);return this.last.day=n.day,this.last.month=n.month,1}ruleDayOfWeek(e,t){let n=e.match(/([+-]?[0-9])?(MO|TU|WE|TH|FR|SA|SU)/);if(n){let a=parseInt(n[1]||0,10);return e=ac.icalDayToNumericDay(n[2],t),[a,e]}else return[0,0]}next_generic(e,t,n,a,i){let s=e in this.by_data,o=this.rule.freq==t,l=0;if(i&&this[i]()==0)return l;if(s){this.by_indices[e]++;let c=this.by_data[e];this.by_indices[e]==c.length&&(this.by_indices[e]=0,l=1),this.last[n]=c[this.by_indices[e]]}else o&&this["increment_"+n](this.rule.interval);return s&&l&&o&&this["increment_"+a](1),l}increment_monthday(e){for(let t=0;tn&&(this.last.day-=n,this.increment_month())}}increment_month(){if(this.last.day=1,this.has_by_data("BYMONTH"))this.by_indices.BYMONTH++,this.by_indices.BYMONTH==this.by_data.BYMONTH.length&&(this.by_indices.BYMONTH=0,this.increment_year(1)),this.last.month=this.by_data.BYMONTH[this.by_indices.BYMONTH];else{this.rule.freq=="MONTHLY"?this.last.month+=this.rule.interval:this.last.month++,this.last.month--;let e=Ia(this.last.month/12);this.last.month%=12,this.last.month++,e!=0&&this.increment_year(e)}this.has_by_data("BYMONTHDAY")&&(this.by_data.BYMONTHDAY=this.normalizeByMonthDayRules(this.last.year,this.last.month,this.rule.parts.BYMONTHDAY))}increment_year(e){this.last.day=1,this.last.year+=e}increment_generic(e,t,n,a){this.last[t]+=e;let i=Ia(this.last[t]/n);this.last[t]%=n,i!=0&&this["increment_"+a](i)}has_by_data(e){return e in this.rule.parts}expand_year_days(e){let t=new Ie;this.days=[];let n={},a=["BYDAY","BYWEEKNO","BYMONTHDAY","BYMONTH","BYYEARDAY"];for(let o of a)o in this.rule.parts&&(n[o]=this.rule.parts[o]);if("BYMONTH"in n&&"BYWEEKNO"in n){let o=1,l={};t.year=e,t.isDate=!0;for(let c=0;c0?(g=v+(f-1)*7,g<=l&&this.days.push(d+g)):(g=b+(f+1)*7,g>0&&this.days.push(d+g))}}this.days.sort(function(o,l){return o-l})}else if(i==2&&"BYDAY"in n&&"BYMONTHDAY"in n){let o=this.expand_by_day(e);for(let l of o){let c=Ie.fromDayOfYear(l,e);this.by_data.BYMONTHDAY.indexOf(c.day)>=0&&this.days.push(l)}}else if(i==3&&"BYDAY"in n&&"BYMONTHDAY"in n&&"BYMONTH"in n){let o=this.expand_by_day(e);for(let l of o){let c=Ie.fromDayOfYear(l,e);this.by_data.BYMONTH.indexOf(c.month)>=0&&this.by_data.BYMONTHDAY.indexOf(c.day)>=0&&this.days.push(l)}}else if(i==2&&"BYDAY"in n&&"BYWEEKNO"in n){let o=this.expand_by_day(e);for(let l of o){let d=Ie.fromDayOfYear(l,e).weekNumber(this.rule.wkst);this.by_data.BYWEEKNO.indexOf(d)&&this.days.push(l)}}else if(!(i==3&&"BYDAY"in n&&"BYWEEKNO"in n&&"BYMONTHDAY"in n))if(i==1&&"BYYEARDAY"in n)this.days=this.days.concat(this.by_data.BYYEARDAY);else if(i==2&&"BYYEARDAY"in n&&"BYDAY"in n){let o=Ie.isLeapYear(e)?366:365,l=new Set(this.expand_by_day(e));for(let c of this.by_data.BYYEARDAY)c<0&&(c+=o+1),l.has(c)&&this.days.push(c)}else this.days=[]}}let s=Ie.isLeapYear(e)?366:365;return this.days.sort((o,l)=>(o<0&&(o+=s+1),l<0&&(l+=s+1),o-l)),0}expand_by_day(e){let t=[],n=this.last.clone();n.year=e,n.month=1,n.day=1,n.isDate=!0;let a=n.dayOfWeek();n.month=12,n.day=31,n.isDate=!0;let i=n.dayOfWeek(),s=n.dayOfYear();for(let o of this.by_data.BYDAY){let l=this.ruleDayOfWeek(o),c=l[0],d=l[1];if(c==0){let u=(d+7-a)%7+1;for(let p=u;p<=s;p+=7)t.push(p)}else if(c>0){let u;d>=a?u=d-a+1:u=d-a+8,t.push(u+(c-1)*7)}else{let u;c=-c,d<=i?u=s-i+d:u=s-i+d-7,t.push(u-(c-1)*7)}}return t}is_day_in_byday(e){if(this.by_data.BYDAY)for(let t of this.by_data.BYDAY){let n=this.ruleDayOfWeek(t),a=n[0],i=n[1],s=e.dayOfWeek();if(a==0&&i==s||e.nthWeekDay(i,a)==e.day)return 1}return 0}check_set_position(e){return this.has_by_data("BYSETPOS")?this.by_data.BYSETPOS.indexOf(e)!==-1:!1}sort_byday_rules(e){for(let t=0;ti){let s=e[t];e[t]=e[n],e[n]=s}}}check_contract_restriction(e,t){let n=ws._indexMap[e],a=ws._expandMap[this.rule.freq][n],i=!1;if(e in this.by_data&&a==ws.CONTRACT){let s=this.by_data[e];for(let o of s)if(o==t){i=!0;break}}else i=!0;return i}check_contracting_rules(){let e=this.last.dayOfWeek(),t=this.last.weekNumber(this.rule.wkst),n=this.last.dayOfYear();return this.check_contract_restriction("BYSECOND",this.last.second)&&this.check_contract_restriction("BYMINUTE",this.last.minute)&&this.check_contract_restriction("BYHOUR",this.last.hour)&&this.check_contract_restriction("BYDAY",ac.numericDayToIcalDay(e))&&this.check_contract_restriction("BYWEEKNO",t)&&this.check_contract_restriction("BYMONTHDAY",this.last.day)&&this.check_contract_restriction("BYMONTH",this.last.month)&&this.check_contract_restriction("BYYEARDAY",n)}setup_defaults(e,t,n){let a=ws._indexMap[e];return ws._expandMap[this.rule.freq][a]!=ws.CONTRACT&&(e in this.by_data||(this.by_data[e]=[n]),this.rule.freq!=t)?this.by_data[e][0]:n}toJSON(){let e=Object.create(null);return e.initialized=this.initialized,e.rule=this.rule.toJSON(),e.dtstart=this.dtstart.toJSON(),e.by_data=this.by_data,e.days=this.days,e.last=this.last.toJSON(),e.by_indices=this.by_indices,e.occurrence_number=this.occurrence_number,e}};I(ws,"_indexMap",{BYSECOND:0,BYMINUTE:1,BYHOUR:2,BYDAY:3,BYMONTHDAY:4,BYYEARDAY:5,BYWEEKNO:6,BYMONTH:7,BYSETPOS:8}),I(ws,"_expandMap",{SECONDLY:[1,1,1,1,1,1,1,1],MINUTELY:[2,1,1,1,1,1,1,1],HOURLY:[2,2,1,1,1,1,1,1],DAILY:[2,2,2,1,1,1,1,1],WEEKLY:[2,2,2,2,3,3,1,1],MONTHLY:[2,2,2,2,2,3,3,1],YEARLY:[2,2,2,2,2,2,2,2]}),I(ws,"UNKNOWN",0),I(ws,"CONTRACT",1),I(ws,"EXPAND",2),I(ws,"ILLEGAL",3);oP=ws,lT=class extends Error{constructor(){super("Recurrence rule has no valid occurrences")}},aht=/^(SU|MO|TU|WE|TH|FR|SA)$/,iht=/^([+-])?(5[0-3]|[1-4][0-9]|[1-9])?(SU|MO|TU|WE|TH|FR|SA)$/,V_e={SU:Ie.SUNDAY,MO:Ie.MONDAY,TU:Ie.TUESDAY,WE:Ie.WEDNESDAY,TH:Ie.THURSDAY,FR:Ie.FRIDAY,SA:Ie.SATURDAY},sht=Object.fromEntries(Object.entries(V_e).map(r=>r.reverse())),__e=["SECONDLY","MINUTELY","HOURLY","DAILY","WEEKLY","MONTHLY","YEARLY"],ac=class r{constructor(e){I(this,"parts",null);I(this,"interval",1);I(this,"wkst",Ie.MONDAY);I(this,"until",null);I(this,"count",null);I(this,"freq",null);I(this,"icalclass","icalrecur");I(this,"icaltype","recur");this.wrappedJSObject=this,this.parts={},e&&typeof e=="object"&&this.fromData(e)}static fromString(e){let t=this._stringToData(e,!1);return new r(t)}static fromData(e){return new r(e)}static _stringToData(e,t){let n=Object.create(null),a=e.split(";"),i=a.length;for(let s=0;s7&&(a-=7),sht[a]}iterator(e){return new oP({rule:this,dtstart:e})}clone(){return new r(this.toJSON())}isFinite(){return!!(this.count||this.until)}isByCount(){return!!(this.count&&!this.until)}addComponent(e,t){let n=e.toUpperCase();n in this.parts?this.parts[n].push(t):this.parts[n]=[t]}setComponent(e,t){this.parts[e.toUpperCase()]=t.slice()}getComponent(e){let t=e.toUpperCase();return t in this.parts?this.parts[t].slice():[]}getNextOccurrence(e,t){let n=this.iterator(e),a;do a=n.next();while(a&&a.compare(t)<=0);return a&&t.zone&&(a.zone=t.zone),a}fromData(e){for(let t in e){let n=t.toUpperCase();n in z6?Array.isArray(e[t])?this.parts[n]=e[t]:this.parts[n]=[e[t]]:this[t]=e[t]}this.interval&&typeof this.interval!="number"&&L6.INTERVAL(this.interval,this),this.wkst&&typeof this.wkst!="number"&&(this.wkst=r.icalDayToNumericDay(this.wkst)),this.until&&!(this.until instanceof Ie)&&(this.until=Ie.fromString(this.until))}toJSON(){let e=Object.create(null);e.freq=this.freq,this.count&&(e.count=this.count),this.interval>1&&(e.interval=this.interval);for(let[t,n]of Object.entries(this.parts))Array.isArray(n)&&n.length==1?e[t.toLowerCase()]=n[0]:e[t.toLowerCase()]=ey(n);return this.until&&(e.until=this.until.toString()),"wkst"in this&&this.wkst!==Ie.DEFAULT_WEEK_START&&(e.wkst=r.numericDayToIcalDay(this.wkst)),e}toString(){let e="FREQ="+this.freq;this.count&&(e+=";COUNT="+this.count),this.interval>1&&(e+=";INTERVAL="+this.interval);for(let[t,n]of Object.entries(this.parts))e+=";"+t+"="+n;return this.until&&(e+=";UNTIL="+this.until.toICALString()),"wkst"in this&&this.wkst!==Ie.DEFAULT_WEEK_START&&(e+=";WKST="+r.numericDayToIcalDay(this.wkst)),e}};L6={FREQ:function(r,e,t){if(__e.indexOf(r)!==-1)e.freq=r;else throw new Error('invalid frequency "'+r+'" expected: "'+__e.join(", ")+'"')},COUNT:function(r,e,t){e.count=vi(r)},INTERVAL:function(r,e,t){e.interval=vi(r),e.interval<1&&(e.interval=1)},UNTIL:function(r,e,t){r.length>10?e.until=Mr.icalendar.value["date-time"].fromICAL(r):e.until=Mr.icalendar.value.date.fromICAL(r),t||(e.until=Ie.fromString(e.until))},WKST:function(r,e,t){if(aht.test(r))e.wkst=ac.icalDayToNumericDay(r);else throw new Error('invalid WKST value "'+r+'"')}},z6={BYSECOND:of.bind(void 0,"BYSECOND",0,60),BYMINUTE:of.bind(void 0,"BYMINUTE",0,59),BYHOUR:of.bind(void 0,"BYHOUR",0,23),BYDAY:function(r){if(iht.test(r))return r;throw new Error('invalid BYDAY value "'+r+'"')},BYMONTHDAY:of.bind(void 0,"BYMONTHDAY",-31,31),BYYEARDAY:of.bind(void 0,"BYYEARDAY",-366,366),BYWEEKNO:of.bind(void 0,"BYWEEKNO",-53,53),BYMONTH:of.bind(void 0,"BYMONTH",1,12),BYSETPOS:of.bind(void 0,"BYSETPOS",-366,366)},oht=/\\\\|\\;|\\,|\\[Nn]/g,lht=/\\|;|,|\n/g,I_e=/\\\\|\\,|\\[Nn]/g,N_e=/\\|,|\n/g;dr={defaultType:"text"},lP={defaultType:"text",multiValue:","},LO={defaultType:"text",structuredValue:";"},PO={defaultType:"integer"},MO={defaultType:"date-time",allowedTypes:["date-time","date"]},AO={defaultType:"date-time"},Ts={defaultType:"uri"},R_e={defaultType:"utc-offset"},F_e={defaultType:"recur"},O_e={defaultType:"date-and-or-time",allowedTypes:["date-time","date","text"]};U6={categories:lP,url:Ts,version:dr,uid:dr},H6={boolean:{values:["TRUE","FALSE"],fromICAL:function(r){switch(r){case"TRUE":return!0;case"FALSE":return!1;default:return!1}},toICAL:function(r){return r?"TRUE":"FALSE"}},float:{matches:/^[+-]?\d+\.\d+$/,fromICAL:function(r){let e=parseFloat(r);return sP(e)?0:e},toICAL:function(r){return String(r)}},integer:{fromICAL:function(r){let e=parseInt(r);return sP(e)?0:e},toICAL:function(r){return String(r)}},"utc-offset":{toICAL:function(r){return r.length<7?r.slice(0,3)+r.slice(4,6):r.slice(0,3)+r.slice(4,6)+r.slice(7,9)},fromICAL:function(r){return r.length<6?r.slice(0,3)+":"+r.slice(3,5):r.slice(0,3)+":"+r.slice(3,5)+":"+r.slice(5,7)},decorate:function(r){return sp.fromString(r)},undecorate:function(r){return r.toString()}}},uht={cutype:{values:["INDIVIDUAL","GROUP","RESOURCE","ROOM","UNKNOWN"],allowXName:!0,allowIanaToken:!0},"delegated-from":{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},"delegated-to":{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},encoding:{values:["8BIT","BASE64"]},fbtype:{values:["FREE","BUSY","BUSY-UNAVAILABLE","BUSY-TENTATIVE"],allowXName:!0,allowIanaToken:!0},member:{valueType:"cal-address",multiValue:",",multiValueSeparateDQuote:!0},partstat:{values:["NEEDS-ACTION","ACCEPTED","DECLINED","TENTATIVE","DELEGATED","COMPLETED","IN-PROCESS"],allowXName:!0,allowIanaToken:!0},range:{values:["THISANDFUTURE"]},related:{values:["START","END"]},reltype:{values:["PARENT","CHILD","SIBLING"],allowXName:!0,allowIanaToken:!0},role:{values:["REQ-PARTICIPANT","CHAIR","OPT-PARTICIPANT","NON-PARTICIPANT"],allowXName:!0,allowIanaToken:!0},rsvp:{values:["TRUE","FALSE"]},"sent-by":{valueType:"cal-address"},tzid:{matches:/^\//},value:{values:["binary","boolean","cal-address","date","date-time","duration","float","integer","period","recur","text","time","uri","utc-offset"],allowXName:!0,allowIanaToken:!0}},sa=ty(H6,{text:$6(oht,lht),uri:{},binary:{decorate:function(r){return RO.fromString(r)},undecorate:function(r){return r.toString()}},"cal-address":{},date:{decorate:function(r,e){return Mr.strict?Ie.fromDateString(r,e):Ie.fromString(r,e)},undecorate:function(r){return r.toString()},fromICAL:function(r){return!Mr.strict&&r.length>=15?sa["date-time"].fromICAL(r):r.slice(0,4)+"-"+r.slice(4,6)+"-"+r.slice(6,8)},toICAL:function(r){let e=r.length;return e==10?r.slice(0,4)+r.slice(5,7)+r.slice(8,10):e>=19?sa["date-time"].toICAL(r):r}},"date-time":{fromICAL:function(r){if(!Mr.strict&&r.length==8)return sa.date.fromICAL(r);{let e=r.slice(0,4)+"-"+r.slice(4,6)+"-"+r.slice(6,8)+"T"+r.slice(9,11)+":"+r.slice(11,13)+":"+r.slice(13,15);return r[15]&&r[15]==="Z"&&(e+="Z"),e}},toICAL:function(r){let e=r.length;if(e==10&&!Mr.strict)return sa.date.toICAL(r);if(e>=19){let t=r.slice(0,4)+r.slice(5,7)+r.slice(8,13)+r.slice(14,16)+r.slice(17,19);return r[19]&&r[19]==="Z"&&(t+="Z"),t}else return r},decorate:function(r,e){return Mr.strict?Ie.fromDateTimeString(r,e):Ie.fromString(r,e)},undecorate:function(r){return r.toString()}},duration:{decorate:function(r){return fo.fromString(r)},undecorate:function(r){return r.toString()}},period:{fromICAL:function(r){let e=r.split("/");return e[0]=sa["date-time"].fromICAL(e[0]),fo.isValueString(e[1])||(e[1]=sa["date-time"].fromICAL(e[1])),e},toICAL:function(r){return r=r.slice(),!Mr.strict&&r[0].length==10?r[0]=sa.date.toICAL(r[0]):r[0]=sa["date-time"].toICAL(r[0]),fo.isValueString(r[1])||(!Mr.strict&&r[1].length==10?r[1]=sa.date.toICAL(r[1]):r[1]=sa["date-time"].toICAL(r[1])),r.join("/")},decorate:function(r,e){return iP.fromJSON(r,e,!Mr.strict)},undecorate:function(r){return r.toJSON()}},recur:{fromICAL:function(r){return ac._stringToData(r,!0)},toICAL:function(r){let e="";for(let[t,n]of Object.entries(r))t=="until"?n.length>10?n=sa["date-time"].toICAL(n):n=sa.date.toICAL(n):t=="wkst"?typeof n=="number"&&(n=ac.numericDayToIcalDay(n)):Array.isArray(n)&&(n=n.join(",")),e+=t.toUpperCase()+"="+n+";";return e.slice(0,Math.max(0,e.length-1))},decorate:function(e){return ac.fromData(e)},undecorate:function(r){return r.toJSON()}},time:{fromICAL:function(r){if(r.length<6)return r;let e=r.slice(0,2)+":"+r.slice(2,4)+":"+r.slice(4,6);return r[6]==="Z"&&(e+="Z"),e},toICAL:function(r){if(r.length<8)return r;let e=r.slice(0,2)+r.slice(3,5)+r.slice(6,8);return r[8]==="Z"&&(e+="Z"),e}}}),pht=ty(U6,{action:dr,attach:{defaultType:"uri"},attendee:{defaultType:"cal-address"},calscale:dr,class:dr,comment:dr,completed:AO,contact:dr,created:AO,description:dr,dtend:MO,dtstamp:AO,dtstart:MO,due:MO,duration:{defaultType:"duration"},exdate:{defaultType:"date-time",allowedTypes:["date-time","date"],multiValue:","},exrule:F_e,freebusy:{defaultType:"period",multiValue:","},geo:{defaultType:"float",structuredValue:";"},"last-modified":AO,location:dr,method:dr,organizer:{defaultType:"cal-address"},"percent-complete":PO,priority:PO,prodid:dr,"related-to":dr,repeat:PO,rdate:{defaultType:"date-time",allowedTypes:["date-time","date","period"],multiValue:",",detectType:function(r){return r.indexOf("/")!==-1?"period":r.indexOf("T")===-1?"date":"date-time"}},"recurrence-id":MO,resources:lP,"request-status":LO,rrule:F_e,sequence:PO,status:dr,summary:dr,transp:dr,trigger:{defaultType:"duration",allowedTypes:["duration","date-time"]},tzoffsetfrom:R_e,tzoffsetto:R_e,tzurl:Ts,tzid:dr,tzname:dr}),mo=ty(H6,{text:$6(I_e,N_e),uri:$6(I_e,N_e),date:{decorate:function(r){return Qg.fromDateAndOrTimeString(r,"date")},undecorate:function(r){return r.toString()},fromICAL:function(r){return r.length==8?sa.date.fromICAL(r):r[0]=="-"&&r.length==6?r.slice(0,4)+"-"+r.slice(4):r},toICAL:function(r){return r.length==10?sa.date.toICAL(r):r[0]=="-"&&r.length==7?r.slice(0,4)+r.slice(5):r}},time:{decorate:function(r){return Qg.fromDateAndOrTimeString("T"+r,"time")},undecorate:function(r){return r.toString()},fromICAL:function(r){let e=mo.time._splitZone(r,!0),t=e[0],n=e[1];return n.length==6?n=n.slice(0,2)+":"+n.slice(2,4)+":"+n.slice(4,6):n.length==4&&n[0]!="-"?n=n.slice(0,2)+":"+n.slice(2,4):n.length==5&&(n=n.slice(0,3)+":"+n.slice(3,5)),t.length==5&&(t[0]=="-"||t[0]=="+")&&(t=t.slice(0,3)+":"+t.slice(3)),n+t},toICAL:function(r){let e=mo.time._splitZone(r),t=e[0],n=e[1];return n.length==8?n=n.slice(0,2)+n.slice(3,5)+n.slice(6,8):n.length==5&&n[0]!="-"?n=n.slice(0,2)+n.slice(3,5):n.length==6&&(n=n.slice(0,3)+n.slice(4,6)),t.length==6&&(t[0]=="-"||t[0]=="+")&&(t=t.slice(0,3)+t.slice(4)),n+t},_splitZone:function(r,e){let t=r.length-1,n=r.length-(e?5:6),a=r[n],i,s;return r[t]=="Z"?(i=r[t],s=r.slice(0,Math.max(0,t))):r.length>6&&(a=="-"||a=="+")?(i=r.slice(n),s=r.slice(0,Math.max(0,n))):(i="",s=r),[i,s]}},"date-time":{decorate:function(r){return Qg.fromDateAndOrTimeString(r,"date-time")},undecorate:function(r){return r.toString()},fromICAL:function(r){return mo["date-and-or-time"].fromICAL(r)},toICAL:function(r){return mo["date-and-or-time"].toICAL(r)}},"date-and-or-time":{decorate:function(r){return Qg.fromDateAndOrTimeString(r,"date-and-or-time")},undecorate:function(r){return r.toString()},fromICAL:function(r){let e=r.split("T");return(e[0]?mo.date.fromICAL(e[0]):"")+(e[1]?"T"+mo.time.fromICAL(e[1]):"")},toICAL:function(r){let e=r.split("T");return mo.date.toICAL(e[0])+(e[1]?"T"+mo.time.toICAL(e[1]):"")}},timestamp:sa["date-time"],"language-tag":{matches:/^[a-zA-Z0-9-]+$/},"phone-number":{fromICAL:function(r){return Array.from(r).filter(function(e){return e==="\\"?void 0:e}).join("")},toICAL:function(r){return Array.from(r).map(function(e){return e===","||e===";"?"\\"+e:e}).join("")}}}),mht={type:{valueType:"text",multiValue:","},value:{values:["text","uri","date","time","date-time","date-and-or-time","timestamp","boolean","integer","float","utc-offset","language-tag"],allowXName:!0,allowIanaToken:!0}},fht=ty(U6,{adr:{defaultType:"text",structuredValue:";",multiValue:","},anniversary:O_e,bday:O_e,caladruri:Ts,caluri:Ts,clientpidmap:LO,email:dr,fburl:Ts,fn:dr,gender:LO,geo:Ts,impp:Ts,key:Ts,kind:dr,lang:{defaultType:"language-tag"},logo:Ts,member:Ts,n:{defaultType:"text",structuredValue:";",multiValue:","},nickname:lP,note:dr,org:{defaultType:"text",structuredValue:";"},photo:Ts,related:Ts,rev:{defaultType:"timestamp"},role:dr,sound:Ts,source:Ts,tel:{defaultType:"uri",allowedTypes:["uri","text"]},title:dr,tz:{defaultType:"text",allowedTypes:["text","utc-offset","uri"]},xml:dr}),hht=ty(H6,{binary:sa.binary,date:mo.date,"date-time":mo["date-time"],"phone-number":mo["phone-number"],uri:sa.uri,text:mo.text,time:sa.time,vcard:sa.text,"utc-offset":{toICAL:function(r){return r.slice(0,7)},fromICAL:function(r){return r.slice(0,7)},decorate:function(r){return sp.fromString(r)},undecorate:function(r){return r.toString()}}}),ght={type:{valueType:"text",multiValue:","},value:{values:["text","uri","date","date-time","phone-number","time","boolean","integer","float","utc-offset","vcard","binary"],allowXName:!0,allowIanaToken:!0}},yht=ty(U6,{fn:dr,n:{defaultType:"text",structuredValue:";",multiValue:","},nickname:lP,photo:{defaultType:"binary",allowedTypes:["binary","uri"]},bday:{defaultType:"date-time",allowedTypes:["date-time","date"],detectType:function(r){return r.indexOf("T")===-1?"date":"date-time"}},adr:{defaultType:"text",structuredValue:";",multiValue:","},label:dr,tel:{defaultType:"phone-number"},email:dr,mailer:dr,tz:{defaultType:"utc-offset",allowedTypes:["utc-offset","text"]},geo:{defaultType:"float",structuredValue:";"},title:dr,role:dr,logo:{defaultType:"binary",allowedTypes:["binary","uri"]},agent:{defaultType:"vcard",allowedTypes:["vcard","text","uri"]},org:LO,note:lP,prodid:dr,rev:{defaultType:"date-time",allowedTypes:["date-time","date"],detectType:function(r){return r.indexOf("T")===-1?"date":"date-time"}},"sort-string":dr,sound:{defaultType:"binary",allowedTypes:["binary","uri"]},class:dr,key:{defaultType:"binary",allowedTypes:["binary","text"]}}),ap={name:"ical",value:sa,param:uht,property:pht,propertyGroups:!1},L_e={name:"vcard4",value:mo,param:mht,property:fht,propertyGroups:!0},z_e={name:"vcard3",value:hht,param:ght,property:yht,propertyGroups:!0},Mr={strict:!0,defaultSet:ap,defaultType:"unknown",components:{vcard:L_e,vcard3:z_e,vevent:ap,vtodo:ap,vjournal:ap,valarm:ap,vtimezone:ap,daylight:ap,standard:ap},icalendar:ap,vcard:L_e,vcard3:z_e,getDesignSet:function(r){return r&&r in Mr.components?Mr.components[r]:Mr.defaultSet}},NO=`\r `,j_e="unknown",vht={'"':"^'","\n":"^n","^":"^^"};Dn.component=function(r,e){let t=r[0].toUpperCase(),n="BEGIN:"+t+NO,a=r[1],i=0,s=a.length,o=r[0];for(o==="vcard"&&r[1].length>0&&!(r[1][0][0]==="version"&&r[1][0][3]==="4.0")&&(o="vcard3"),e=e||Mr.getDesignSet(o);i0&&typeof e[0]=="object"&&"icaltype"in e[0]&&this.resetType(e[0].icaltype),this.isDecorated)for(;n=0;s--)(!n||i[s][cf]===n)&&this._removeObjectByIndex(e,a,s)}addSubcomponent(e){this._components||(this._components=[],this._hydratedComponentCount=0),e.parent&&e.parent.removeSubcomponent(e);let t=this.jCal[df].push(e.jCal);return this._components[t-1]=e,this._hydratedComponentCount++,e.parent=this,e}removeSubcomponent(e){let t=this._removeObject(df,"_components",e);return t&&this._hydratedComponentCount--,t}removeAllSubcomponents(e){let t=this._removeAllObjects(df,"_components",e);return this._hydratedComponentCount=0,t}addProperty(e){if(!(e instanceof Xg))throw new TypeError("must be instance of ICAL.Property");this._properties||(this._properties=[],this._hydratedPropertyCount=0),e.parent&&e.parent.removeProperty(e);let t=this.jCal[wd].push(e.jCal);return this._properties[t-1]=e,this._hydratedPropertyCount++,e.parent=this,e}addPropertyWithValue(e,t){let n=new Xg(e);return n.setValue(t),this.addProperty(n),n}updatePropertyWithValue(e,t){let n=this.getFirstProperty(e);return n?n.setValue(t):n=this.addPropertyWithValue(e,t),n}removeProperty(e){let t=this._removeObject(wd,"_properties",e);return t&&this._hydratedPropertyCount--,t}removeAllProperties(e){let t=this._removeAllObjects(wd,"_properties",e);return this._hydratedPropertyCount=0,t}toJSON(){return this.jCal}toString(){return Dn.component(this.jCal,this._designSet)}getTimeZoneByID(e){if(this.parent)return this.parent.getTimeZoneByID(e);if(!this._timezoneCache)return null;if(this._timezoneCache.has(e))return this._timezoneCache.get(e);let t=this.getAllSubcomponents("vtimezone");for(let n of t)if(n.getFirstProperty("tzid").getFirstValue()===e){let a=new Pr({component:n,tzid:e});return this._timezoneCache.set(e,a),a}return null}},zO=class{constructor(e){I(this,"complete",!1);I(this,"ruleIterators",null);I(this,"ruleDates",null);I(this,"exDates",null);I(this,"ruleDateInc",0);I(this,"exDateInc",0);I(this,"exDate",null);I(this,"ruleDate",null);I(this,"dtstart",null);I(this,"last",null);this.ruleDates=[],this.exDates=[],this.fromData(e)}fromData(e){let t=ip(e.dtstart,Ie);if(t)this.dtstart=t;else throw new Error(".dtstart (ICAL.Time) must be given");if(e.component)this._init(e.component);else{if(this.last=ip(e.last,Ie)||t.clone(),!e.ruleIterators)throw new Error(".ruleIterators or .component must be given");this.ruleIterators=e.ruleIterators.map(function(n){return ip(n,oP)}),this.ruleDateInc=e.ruleDateInc,this.exDateInc=e.exDateInc,e.ruleDates&&(this.ruleDates=e.ruleDates.map(n=>ip(n,Ie)),this.ruleDate=this.ruleDates[this.ruleDateInc]),e.exDates&&(this.exDates=e.exDates.map(n=>ip(n,Ie)),this.exDate=this.exDates[this.exDateInc]),typeof e.complete!="undefined"&&(this.complete=e.complete)}}_compare_special(e,t){return!e.isDate&&t.isDate?new Ie({year:e.year,month:e.month,day:e.day}).compare(t):e.compare(t)}next(){let e,t,n,a=500,i=0;for(;;){if(i++>a)throw new Error("max tries have occurred, rule may be impossible to fulfill.");if(t=this.ruleDate,e=this._nextRecurrenceIter(this.last),!t&&!e){this.complete=!0;break}if((!t||e&&t.compare(e.last)>0)&&(t=e.last.clone(),e.next()),this.ruleDate===t&&this._nextRuleDay(),this.last=t,this.exDate&&(n=this._compare_special(this.last,this.exDate),n>0&&this._nextExDay(),n===0)){this._nextExDay();continue}return this.last}}toJSON(){function e(n){return n.toJSON()}let t=Object.create(null);return t.ruleIterators=this.ruleIterators.map(e),this.ruleDates&&(t.ruleDates=this.ruleDates.map(e)),this.exDates&&(t.exDates=this.exDates.map(e)),t.ruleDateInc=this.ruleDateInc,t.exDateInc=this.exDateInc,t.last=this.last.toJSON(),t.dtstart=this.dtstart.toJSON(),t.complete=this.complete,t}_extractDates(e,t){let n=[],a=e.getAllProperties(t);for(let i=0,s=a.length;ic.compare(d));n.splice(l,0,o)}return n}_init(e){if(this.ruleIterators=[],this.last=this.dtstart.clone(),!e.hasProperty("rdate")&&!e.hasProperty("rrule")&&!e.hasProperty("recurrence-id")){this.ruleDate=this.last.clone(),this.complete=!0;return}if(e.hasProperty("rdate")&&(this.ruleDates=this._extractDates(e,"rdate"),this.ruleDates[0]&&this.ruleDates[0].compare(this.dtstart)<0?(this.ruleDateInc=0,this.last=this.ruleDates[0].clone()):this.ruleDateInc=Jg(this.ruleDates,this.last,(t,n)=>t.compare(n)),this.ruleDate=this.ruleDates[this.ruleDateInc]),e.hasProperty("rrule")){let t=e.getAllProperties("rrule"),n=0,a=t.length,i,s;for(;n0)&&(s=n)}return s}},aP=class aP{constructor(e,t){I(this,"exceptions",null);I(this,"strictExceptions",!1);e instanceof nl||(t=e,e=null),e?this.component=e:this.component=new nl("vevent"),this._rangeExceptionCache=Object.create(null),this.exceptions=Object.create(null),this.rangeExceptions=[],t&&t.strictExceptions&&(this.strictExceptions=t.strictExceptions),t&&t.exceptions?t.exceptions.forEach(this.relateException,this):this.component.parent&&!this.isRecurrenceException()&&this.component.parent.getAllSubcomponents("vevent").forEach(function(n){n.hasProperty("recurrence-id")&&this.relateException(n)},this)}relateException(e){if(this.isRecurrenceException())throw new Error("cannot relate exception to exceptions");if(e instanceof nl&&(e=new aP(e)),this.strictExceptions&&e.uid!==this.uid)throw new Error("attempted to relate unrelated exception");let t=e.recurrenceId.toString();if(this.exceptions[t]=e,e.modifiesFuture()){let n=[e.recurrenceId.toUnixTime(),t],a=Jg(this.rangeExceptions,n,B_e);this.rangeExceptions.splice(a,0,n)}}modifiesFuture(){return this.component.hasProperty("recurrence-id")?this.component.getFirstProperty("recurrence-id").getParameter("range")===aP.THISANDFUTURE:!1}findRangeException(e){if(!this.rangeExceptions.length)return null;let t=e.toUnixTime(),n=Jg(this.rangeExceptions,[t],B_e);if(n-=1,n<0)return null;let a=this.rangeExceptions[n];return t{Tht=Object.freeze({"AUS Central Standard Time":"Australia/Darwin","AUS Eastern Standard Time":"Australia/Sydney","Afghanistan Standard Time":"Asia/Kabul","Alaskan Standard Time":"America/Anchorage","Aleutian Standard Time":"America/Adak","Altai Standard Time":"Asia/Barnaul","Arab Standard Time":"Asia/Riyadh","Arabian Standard Time":"Asia/Dubai","Arabic Standard Time":"Asia/Baghdad","Argentina Standard Time":"America/Buenos_Aires","Astrakhan Standard Time":"Europe/Astrakhan","Atlantic Standard Time":"America/Halifax","Aus Central W. Standard Time":"Australia/Eucla","Azerbaijan Standard Time":"Asia/Baku","Azores Standard Time":"Atlantic/Azores","Bahia Standard Time":"America/Bahia","Bangladesh Standard Time":"Asia/Dhaka","Belarus Standard Time":"Europe/Minsk","Bougainville Standard Time":"Pacific/Bougainville","Canada Central Standard Time":"America/Regina","Cape Verde Standard Time":"Atlantic/Cape_Verde","Caucasus Standard Time":"Asia/Yerevan","Cen. Australia Standard Time":"Australia/Adelaide","Central America Standard Time":"America/Guatemala","Central Asia Standard Time":"Asia/Almaty","Central Brazilian Standard Time":"America/Cuiaba","Central Europe Standard Time":"Europe/Budapest","Central European Standard Time":"Europe/Warsaw","Central Pacific Standard Time":"Pacific/Guadalcanal","Central Standard Time":"America/Chicago","Central Standard Time (Mexico)":"America/Mexico_City","Chatham Islands Standard Time":"Pacific/Chatham","China Standard Time":"Asia/Shanghai","Cuba Standard Time":"America/Havana","Dateline Standard Time":"Etc/GMT+12","E. Africa Standard Time":"Africa/Nairobi","E. Australia Standard Time":"Australia/Brisbane","E. Europe Standard Time":"Europe/Chisinau","E. South America Standard Time":"America/Sao_Paulo","Easter Island Standard Time":"Pacific/Easter","Eastern Standard Time":"America/New_York","Eastern Standard Time (Mexico)":"America/Cancun","Egypt Standard Time":"Africa/Cairo","Ekaterinburg Standard Time":"Asia/Yekaterinburg","FLE Standard Time":"Europe/Kiev","Fiji Standard Time":"Pacific/Fiji","GMT Standard Time":"Europe/London","GTB Standard Time":"Europe/Bucharest","Georgian Standard Time":"Asia/Tbilisi","Greenland Standard Time":"America/Godthab","Greenwich Standard Time":"Atlantic/Reykjavik","Haiti Standard Time":"America/Port-au-Prince","Hawaiian Standard Time":"Pacific/Honolulu","India Standard Time":"Asia/Kolkata","Iran Standard Time":"Asia/Tehran","Israel Standard Time":"Asia/Jerusalem","Jordan Standard Time":"Asia/Amman","Kaliningrad Standard Time":"Europe/Kaliningrad","Korea Standard Time":"Asia/Seoul","Libya Standard Time":"Africa/Tripoli","Line Islands Standard Time":"Pacific/Kiritimati","Lord Howe Standard Time":"Australia/Lord_Howe","Magadan Standard Time":"Asia/Magadan","Magallanes Standard Time":"America/Punta_Arenas","Marquesas Standard Time":"Pacific/Marquesas","Mauritius Standard Time":"Indian/Mauritius","Middle East Standard Time":"Asia/Beirut","Montevideo Standard Time":"America/Montevideo","Morocco Standard Time":"Africa/Casablanca","Mountain Standard Time":"America/Denver","Mountain Standard Time (Mexico)":"America/Chihuahua","Myanmar Standard Time":"Asia/Yangon","N. Central Asia Standard Time":"Asia/Novosibirsk","Namibia Standard Time":"Africa/Windhoek","Nepal Standard Time":"Asia/Katmandu","New Zealand Standard Time":"Pacific/Auckland","Newfoundland Standard Time":"America/St_Johns","Norfolk Standard Time":"Pacific/Norfolk","North Asia East Standard Time":"Asia/Irkutsk","North Asia Standard Time":"Asia/Krasnoyarsk","North Korea Standard Time":"Asia/Pyongyang","Omsk Standard Time":"Asia/Omsk","Pacific SA Standard Time":"America/Santiago","Pacific Standard Time":"America/Los_Angeles","Pacific Standard Time (Mexico)":"America/Tijuana","Pakistan Standard Time":"Asia/Karachi","Paraguay Standard Time":"America/Asuncion","Qyzylorda Standard Time":"Asia/Qyzylorda","Romance Standard Time":"Europe/Paris","Russia Time Zone 10":"Asia/Srednekolymsk","Russia Time Zone 11":"Asia/Kamchatka","Russia Time Zone 3":"Europe/Samara","Russian Standard Time":"Europe/Moscow","SA Eastern Standard Time":"America/Cayenne","SA Pacific Standard Time":"America/Bogota","SA Western Standard Time":"America/La_Paz","SE Asia Standard Time":"Asia/Bangkok","Saint Pierre Standard Time":"America/Miquelon","Sakhalin Standard Time":"Asia/Sakhalin","Samoa Standard Time":"Pacific/Apia","Sao Tome Standard Time":"Africa/Sao_Tome","Saratov Standard Time":"Europe/Saratov","Singapore Standard Time":"Asia/Singapore","South Africa Standard Time":"Africa/Johannesburg","South Sudan Standard Time":"Africa/Juba","Sri Lanka Standard Time":"Asia/Colombo","Sudan Standard Time":"Africa/Khartoum","Syria Standard Time":"Asia/Damascus","Taipei Standard Time":"Asia/Taipei","Tasmania Standard Time":"Australia/Hobart","Tocantins Standard Time":"America/Araguaina","Tokyo Standard Time":"Asia/Tokyo","Tomsk Standard Time":"Asia/Tomsk","Tonga Standard Time":"Pacific/Tongatapu","Transbaikal Standard Time":"Asia/Chita","Turkey Standard Time":"Europe/Istanbul","Turks And Caicos Standard Time":"America/Grand_Turk","US Eastern Standard Time":"America/Indianapolis","US Mountain Standard Time":"America/Phoenix",UTC:"Etc/UTC","UTC+12":"Etc/GMT-12","UTC+13":"Etc/GMT-13","UTC-02":"Etc/GMT+2","UTC-08":"Etc/GMT+8","UTC-09":"Etc/GMT+9","UTC-11":"Etc/GMT+11","Ulaanbaatar Standard Time":"Asia/Ulaanbaatar","Venezuela Standard Time":"America/Caracas","Vladivostok Standard Time":"Asia/Vladivostok","Volgograd Standard Time":"Europe/Volgograd","W. Australia Standard Time":"Australia/Perth","W. Central Africa Standard Time":"Africa/Lagos","W. Europe Standard Time":"Europe/Berlin","W. Mongolia Standard Time":"Asia/Hovd","West Asia Standard Time":"Asia/Tashkent","West Bank Standard Time":"Asia/Hebron","West Pacific Standard Time":"Pacific/Port_Moresby","Yakutsk Standard Time":"Asia/Yakutsk"}),V6=new Map;Y_e=new Map});function Z_e(r){let e=r.getFirstPropertyValue("tzid");return typeof e=="string"?e.trim():null}function Pht(r){let e=r.replace(/\s+\([^)]+\)$/u,"").trim();return e&&e!==r?[e]:[]}function Mht(r,e){var t;return(t=r.getAllSubcomponents("vtimezone").find(n=>Z_e(n)===e))!=null?t:null}function Aht(r,e){let t=new ho.Component(JSON.parse(JSON.stringify(r.toJSON())));return t.updatePropertyWithValue("tzid",e),t}function _ht(r){r.getAllSubcomponents("vtimezone").forEach(t=>{let n=Z_e(t);ho.TimezoneService.register(t),n&&Pht(n).forEach(a=>{let i=Mht(r,a),s=i!=null?i:Aht(t,a),o=new ho.Timezone({component:s,tzid:a});i||r.addSubcomponent(s),ho.TimezoneService.register(o)})})}function Y6(r){if(!Dht.test(r))return null;let[e,t,n]=r.split("-").map(Number);return Date.UTC(e,t-1,n)}function Iht(r){let e=r.getUTCFullYear().toString().padStart(4,"0"),t=(r.getUTCMonth()+1).toString().padStart(2,"0"),n=r.getUTCDate().toString().padStart(2,"0");return`${e}-${t}-${n}`}function Nht(r,e){let t=Y6(r),n=Y6(e);return t===null||n===null||n<=t?null:Math.round((n-t)/K_e)}function Rht(r,e){let t=Y6(r);return t===null?r:Iht(new Date(t+e*K_e))}var BO,cP,xht,Cht,Eht,Dht,K_e,$O,Q_e=y(()=>{BO=require("obsidian");q_e();oD();kr();K();fs();G_e();cP=N({tag:"Services/ICSSubscriptionService"}),xht=365*24*60*60*1e3,Cht=3e3,Eht=1e4,Dht=/^\d{4}-\d{2}-\d{2}$/u,K_e=1440*60*1e3;$O=class extends sd{constructor(t){super();this.subscriptions=[];this.cache=new Map;this.refreshTimers=new Map;this.fileWatchers=new Map;this.pendingRefreshes=new Set;this.lastFetched=new Map;this.lastError=new Map;this.destroyed=!1;this.CACHE_GRACE_PERIOD=300*1e3;this.plugin=t}translate(t,n){return this.plugin.i18n.translate(t,n)}icalTimeToISOString(t,n){var s;if(t.isDate){let o=t.year.toString().padStart(4,"0"),l=t.month.toString().padStart(2,"0"),c=t.day.toString().padStart(2,"0");return`${o}-${l}-${c}`}let a=(s=t.zone)==null?void 0:s.tzid;if(a==="floating"||a===void 0){let o=q6(n);if(o)return W6(t,o);if(!(typeof n=="string"&&n.trim().length>0)){let c=this.getLocalTimeZoneForFloatingTime();if(c)return W6(t,c)}}let i=t.toUnixTime();return new Date(i*1e3).toISOString()}getLocalTimeZoneForFloatingTime(){try{return q6(Intl.DateTimeFormat().resolvedOptions().timeZone)}catch(t){return null}}rawTzidOf(t,n){let a=t.getFirstProperty(n);if(!a)return null;let i=a.getParameter("tzid");return typeof i=="string"?i:null}getRecurringInstanceEnd(t,n,a,i){if(!a)return;if(i){let o=Nht(n,a);return o===null?a:Rht(t,o)}let s=new Date(a).getTime()-new Date(n).getTime();return new Date(new Date(t).getTime()+s).toISOString()}async initialize(){this.destroyed=!1,await this.loadSubscriptions();let t=[];this.subscriptions.forEach(n=>{if(n.enabled){n.type==="remote"?this.startRefreshTimer(n):n.type==="local"&&this.startFileWatcher(n);let a=this.cache.get(n.id);(!a||new Date(a.expires)<=new Date)&&t.push(this.fetchSubscription(n.id))}}),await Promise.allSettled(t),this.emit("data-changed")}async loadSubscriptions(){try{let t=await this.plugin.loadData();this.subscriptions=(t==null?void 0:t.icsSubscriptions)||[]}catch(t){cP.error("Failed to load ICS subscriptions:",{category:"provider",operation:"load-ics-subscriptions",error:t}),this.subscriptions=[]}}async saveSubscriptions(){try{let t=await this.plugin.loadPluginDataForSafeWrite("save-ics-subscriptions");if(!t)return;t.icsSubscriptions=this.subscriptions,await this.plugin.saveData(t)}catch(t){throw cP.error("Failed to save ICS subscriptions:",{category:"provider",operation:"save-ics-subscriptions",error:t}),t}}getSubscriptions(){return[...this.subscriptions]}getLastFetched(t){return this.lastFetched.get(t)}getLastError(t){return this.lastError.get(t)}async addSubscription(t){let n={...t,filePath:t.type==="local"&&t.filePath?this.normalizeLocalICSFilePathIfPossible(t.filePath):t.filePath,id:this.generateId()};return this.subscriptions.push(n),await this.saveSubscriptions(),n.enabled&&(n.type==="remote"?(this.startRefreshTimer(n),await this.fetchSubscription(n.id)):n.type==="local"&&(this.startFileWatcher(n),await this.fetchSubscription(n.id))),this.emit("data-changed"),n}async updateSubscription(t,n){let a=this.subscriptions.findIndex(l=>l.id===t);if(a===-1)throw new Error("Subscription not found");let i=this.subscriptions[a],s={...n};typeof n.filePath=="string"&&(s.filePath=this.normalizeLocalICSFilePathIfPossible(n.filePath));let o={...i,...s};this.subscriptions[a]=o,await this.saveSubscriptions(),this.stopRefreshTimer(t),this.stopFileWatcher(t),o.enabled&&(o.type==="remote"?this.startRefreshTimer(o):o.type==="local"&&this.startFileWatcher(o)),(n.url&&n.url!==i.url||n.filePath&&n.filePath!==i.filePath)&&this.cache.delete(t),this.emit("data-changed")}async removeSubscription(t){let n=this.subscriptions.findIndex(a=>a.id===t);if(n===-1)throw new Error("Subscription not found");this.subscriptions.splice(n,1),await this.saveSubscriptions(),this.stopRefreshTimer(t),this.stopFileWatcher(t),this.cache.delete(t),this.lastFetched.delete(t),this.lastError.delete(t),this.emit("data-changed")}async fetchSubscription(t){let n=this.subscriptions.find(a=>a.id===t);if(!(!n||!n.enabled))try{let a;if(n.type==="remote"){if(!n.url)throw new Error("Remote subscription missing URL");a=(await(0,BO.requestUrl)({url:n.url,method:"GET",headers:{Accept:"text/calendar,*/*;q=0.1","Accept-Language":"en-US,en;q=0.9","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"}})).text}else if(n.type==="local"){if(!n.filePath)throw new Error("Local subscription missing file path");let o=this.normalizeLocalICSFilePath(n.filePath);a=await this.readLocalICSFile(o),n.filePath!==o&&(n.filePath=o,await this.saveSubscriptions())}else throw new Error("Unknown subscription type");let i=this.parseICS(a,n.id),s={subscriptionId:t,events:i,lastUpdated:new Date().toISOString(),expires:new Date(Date.now()+n.refreshInterval*60*1e3).toISOString()};this.cache.set(t,s),this.lastFetched.set(t,new Date().toISOString()),this.lastError.delete(t),this.emit("data-changed")}catch(a){let i=a instanceof Error?a.message:String(a);this.lastError.set(t,i),n.type==="remote"?i.includes("404")?Te(this.plugin.emitter,this.translate("services.icsSubscription.notices.calendarNotFound",{name:n.name})):i.includes("500")||i.includes("OwaBasicUnsupportedException")?Te(this.plugin.emitter,this.translate("services.icsSubscription.notices.calendarAccessDenied",{name:n.name})):Te(this.plugin.emitter,this.translate("services.icsSubscription.notices.fetchRemoteFailed",{name:n.name,error:i})):Te(this.plugin.emitter,this.translate("services.icsSubscription.notices.readLocalFailed",{name:n.name,error:i}))}}parseICS(t,n){try{let a=ho.parse(t),i=new ho.Component(a);_ht(i);let s=i.getAllSubcomponents("vevent"),o=[],l=new Map;return s.forEach(c=>{let d=new ho.Event(c),u=d.uid;if(!u)return;let p=c.getFirstPropertyValue("recurrence-id");if(p){l.has(u)||l.set(u,new Map);let m=J(p);l.get(u).set(m,d)}}),s.forEach(c=>{try{let d=new ho.Event(c);if(c.getFirstPropertyValue("recurrence-id"))return;let p=c.getFirstPropertyValue("status");if(typeof p=="string"&&p.toUpperCase()==="CANCELLED")return;let m=c.getAllProperties("attendee");if(m&&m.length>0&&m.some(R=>{let A=R.getParameter("partstat");return typeof A=="string"&&A.toUpperCase()==="DECLINED"}))return;let f=d.summary||"Untitled Event",h=d.description||void 0,g=d.location||void 0,v=d.startDate,b=d.endDate;if(!v)return;let k=this.rawTzidOf(c,"dtstart"),w=this.rawTzidOf(c,"dtend"),S=v.isDate,C=this.icalTimeToISOString(v,k),E=b?this.icalTimeToISOString(b,w!=null?w:k):void 0,D=d.uid||`${n}-${o.length}`,P=`${n}-${D}`,O={id:P,subscriptionId:n,title:f,description:h,start:C,end:E,allDay:S,location:g,url:d.url||void 0};if(d.isRecurring()){let z=new Set;c.getAllProperties("exdate").forEach(G=>{let ie=G.getFirstValue();ie&&(Array.isArray(ie)?ie:[ie]).forEach(ee=>{ee&&typeof ee.toString=="function"&&z.add(ee.toString())})});let A=l.get(D)||new Map,F=d.iterator(v),$=new ho.Time;$.fromJSDate(new Date(Date.now()+xht));let B,ue=0,Q=0;for(;(B=F.next())&&ue0));){let G=B.toString();if(z.has(G))continue;let ie=`${P}-${Q}`,Ee=A.get(G);if(Ee){let ee=Ee.startDate,re=Ee.endDate,et=Ee.component,fe=et?this.rawTzidOf(et,"dtstart"):null,ut=et?this.rawTzidOf(et,"dtend"):null;ee&&(o.push({id:ie,subscriptionId:n,title:Ee.summary||f,description:Ee.description||h,start:this.icalTimeToISOString(ee,fe),end:re?this.icalTimeToISOString(re,ut!=null?ut:fe):void 0,allDay:ee.isDate,location:Ee.location||g,url:Ee.url||O.url,recurringEventId:P}),Q++)}else{let ee=this.icalTimeToISOString(B,k),re=this.getRecurringInstanceEnd(ee,C,E,S);o.push({...O,id:ie,start:ee,end:re,recurringEventId:P}),Q++}}}else o.push(O)}catch(d){cP.warn("Failed to parse individual event:",{category:"provider",operation:"parse-individual-event",error:d})}}),o}catch(a){throw cP.error("Failed to parse ICS data:",{category:"provider",operation:"parse-ics-data",error:a}),new Error("Invalid ICS format")}}getAllEvents(){let t=[],n=new Date;return this.subscriptions.forEach(a=>{if(!a.enabled)return;let i=this.cache.get(a.id);if(!i){this.pendingRefreshes.has(a.id)||(this.pendingRefreshes.add(a.id),this.fetchSubscription(a.id).finally(()=>this.pendingRefreshes.delete(a.id)));return}let s=new Date(i.expires),o=new Date(s.getTime()+this.CACHE_GRACE_PERIOD);ns&&!this.pendingRefreshes.has(a.id)&&(this.pendingRefreshes.add(a.id),this.fetchSubscription(a.id).finally(()=>this.pendingRefreshes.delete(a.id)))):this.pendingRefreshes.has(a.id)||(this.pendingRefreshes.add(a.id),this.fetchSubscription(a.id).finally(()=>this.pendingRefreshes.delete(a.id)))}),t}getEventsForSubscription(t){let n=this.cache.get(t);if(!n){let l=this.subscriptions.find(c=>c.id===t);return l&&l.enabled&&!this.pendingRefreshes.has(t)&&(this.pendingRefreshes.add(t),this.fetchSubscription(t).finally(()=>this.pendingRefreshes.delete(t))),[]}let a=new Date,i=new Date(n.expires),s=new Date(i.getTime()+this.CACHE_GRACE_PERIOD);return a>=s?(this.pendingRefreshes.has(t)||(this.pendingRefreshes.add(t),this.fetchSubscription(t).finally(()=>this.pendingRefreshes.delete(t))),[]):(a>i&&!this.pendingRefreshes.has(t)&&(this.pendingRefreshes.add(t),this.fetchSubscription(t).finally(()=>this.pendingRefreshes.delete(t))),[...n.events])}async refreshAllSubscriptions(){let t=this.subscriptions.filter(n=>n.enabled);for(let n of t)await this.fetchSubscription(n.id)}getVaultBasePath(){let t=this.plugin.app.vault.adapter;if(typeof(t==null?void 0:t.getBasePath)=="function")try{let n=t.getBasePath();return typeof n=="string"&&n.trim()?n:void 0}catch(n){cP.warn("Failed to resolve vault base path for local ICS file:",{category:"provider",operation:"resolve-vault-base-path-local-ics-file",error:n});return}}normalizePathSeparators(t){return t.trim().replace(/\\/g,"/").replace(/^\.\/+/u,"")}isAbsoluteFilePath(t){return t.startsWith("/")||/^[A-Za-z]:\//u.test(t)}normalizeLocalICSFilePath(t){let n=this.normalizePathSeparators(t);if(!this.isAbsoluteFilePath(n))return n;let a=this.getVaultBasePath();if(a){let i=this.normalizePathSeparators(a).replace(/\/+$/u,"");if(n.startsWith(`${i}/`))return n.slice(i.length+1)}throw new Error('Local ICS files must be inside the current Obsidian vault. Move the file into the vault or use a vault-relative path such as "Calendar.ics".')}normalizeLocalICSFilePathIfPossible(t){try{return this.normalizeLocalICSFilePath(t)}catch(n){return this.normalizePathSeparators(t)}}async readLocalICSFile(t){try{let n=this.normalizeLocalICSFilePath(t),a=this.plugin.app.vault.getAbstractFileByPath(n);if(!a||!(a instanceof BO.TFile))throw new Error(`File not found: ${n}`);if(a.extension!=="ics")throw new Error(`File is not an ICS file: ${n}`);return await this.plugin.app.vault.cachedRead(a)}catch(n){throw new Error(`Failed to read local ICS file "${t}": ${n instanceof Error?n.message:String(n)}`)}}startFileWatcher(t){if(!t.filePath)return;this.stopFileWatcher(t.id);let n=this.normalizeLocalICSFilePathIfPossible(t.filePath),a=(l,c)=>{(l.path===n||c===n)&&window.setTimeout(()=>{this.fetchSubscription(t.id)},1e3)},i=this.plugin.app.vault.on("modify",a),s=this.plugin.app.vault.on("rename",a),o=this.plugin.app.vault.on("delete",l=>{l.path===n&&this.lastError.set(t.id,"Local ICS file was deleted")});this.fileWatchers.set(t.id,()=>{this.plugin.app.vault.offref(i),this.plugin.app.vault.offref(s),this.plugin.app.vault.offref(o)}),this.startFileRefreshTimer(t)}stopFileWatcher(t){let n=this.fileWatchers.get(t);n&&(n(),this.fileWatchers.delete(t))}async refreshSubscription(t){await this.fetchSubscription(t)}startRefreshTimer(t){this.stopRefreshTimer(t.id),this.startRemoteRefreshTimer(t)}startFileRefreshTimer(t){let n=t.refreshInterval*60*1e3,a=window.setTimeout(()=>{this.refreshTimers.delete(t.id),this.fetchSubscription(t.id).finally(()=>{this.shouldContinueRefresh(t.id)&&this.startFileRefreshTimer(t)})},n);this.refreshTimers.set(t.id,a)}startRemoteRefreshTimer(t){let n=t.refreshInterval*60*1e3,a=window.setTimeout(()=>{this.refreshTimers.delete(t.id),this.fetchSubscription(t.id).finally(()=>{this.shouldContinueRefresh(t.id)&&this.startRemoteRefreshTimer(t)})},n);this.refreshTimers.set(t.id,a)}shouldContinueRefresh(t){return!this.destroyed&&this.subscriptions.some(n=>n.id===t&&n.enabled)}stopRefreshTimer(t){let n=this.refreshTimers.get(t);n&&(window.clearTimeout(n),this.refreshTimers.delete(t))}generateId(){return"ics_"+Math.random().toString(36).substring(2,11)+Date.now().toString(36)}destroy(){this.destroyed=!0,this.refreshTimers.forEach(t=>window.clearTimeout(t)),this.refreshTimers.clear(),this.fileWatchers.forEach(t=>t()),this.fileWatchers.clear(),this.cache.clear(),this.pendingRefreshes.clear(),this.removeAllListeners()}getLocalICSFiles(){return this.plugin.app.vault.getFiles().filter(t=>t.extension==="ics").sort((t,n)=>t.path.localeCompare(n.path))}}});var dP,Sd,UO,J_e=y(()=>{dP=require("obsidian");Wr();u4();Me();Kk();Ct();qR();K();fs();Ba();Sd=N({tag:"Services/ICSNoteService"}),UO=class{constructor(e){this.plugin=e}translate(e,t){return this.plugin.i18n.translate(e,t)}findEventById(e){var s,o,l,c,d,u,p,m,f;let t=e.trim();if(!t)return null;let n=(s=this.plugin.icsSubscriptionService)==null?void 0:s.getAllEvents().find(h=>h.id===t);if(n){let h=(l=(o=this.plugin.icsSubscriptionService)==null?void 0:o.getSubscriptions().find(g=>g.id===n.subscriptionId))==null?void 0:l.name;return{event:n,subscriptionName:h}}let a=(c=this.plugin.googleCalendarService)==null?void 0:c.getAllEvents().find(h=>h.id===t);if(a){let h=a.subscriptionId.replace("google-",""),g=((u=(d=this.plugin.googleCalendarService)==null?void 0:d.getAvailableCalendars().find(v=>v.id===h))==null?void 0:u.summary)||"Google Calendar";return{event:a,subscriptionName:g}}let i=(p=this.plugin.microsoftCalendarService)==null?void 0:p.getAllEvents().find(h=>h.id===t);if(i){let h=i.subscriptionId.replace("microsoft-",""),g=((f=(m=this.plugin.microsoftCalendarService)==null?void 0:m.getAvailableCalendars().find(v=>v.id===h))==null?void 0:f.summary)||"Microsoft Calendar";return{event:i,subscriptionName:g}}return null}getLoadedCalendarEvents(){var e,t,n,a,i,s;return[...(t=(e=this.plugin.icsSubscriptionService)==null?void 0:e.getAllEvents())!=null?t:[],...(a=(n=this.plugin.googleCalendarService)==null?void 0:n.getAllEvents())!=null?a:[],...(s=(i=this.plugin.microsoftCalendarService)==null?void 0:i.getAllEvents())!=null?s:[]]}getExplicitSeriesId(e){var n;return((n=e.recurringEventId)==null?void 0:n.trim())||null}getRecurringRelatedNotesMode(){var e,t;return((t=(e=this.plugin.settings)==null?void 0:e.icsIntegration)==null?void 0:t.recurringEventRelatedNotesMode)==="instance"?"instance":"series"}buildEventSeriesIndex(){let e=new Map;for(let a of this.getLoadedCalendarEvents()){let i=this.getExplicitSeriesId(a);if(!i)continue;let s=e.get(i);s||(s=new Set,e.set(i,s)),s.add(a.id)}let t=new Map,n=new Map;for(let[a,i]of e){n.set(a,i);for(let s of i)t.set(s,a)}return{seriesIdByEventId:t,eventIdsBySeriesId:n}}getRelatedEventIds(e,t){var s;let n=new Set([e]);if(this.getRecurringRelatedNotesMode()==="instance")return n;let a=t.seriesIdByEventId.get(e),i=t.eventIdsBySeriesId.has(e)?e:a;if(i){n.add(i);for(let o of(s=t.eventIdsBySeriesId.get(i))!=null?s:[])n.add(o)}return n}eventIdsMatchSeries(e,t,n){for(let a of this.getRelatedEventIds(e,n))if(t.has(a))return!0;return!1}async getRelatedNoteCountsByEventId(){let e=new Map,t=this.plugin.fieldMapper.toUserField("icsEventId"),n=this.buildEventSeriesIndex(),a=(i,s)=>{for(let o of this.normalizeEventIds(i))for(let l of this.getRelatedEventIds(o,n)){let c=e.get(l);c||(c=new Set,e.set(l,c)),c.add(s)}};try{let i=await this.plugin.cacheManager.getAllTasks();for(let o of i)a(o.icsEventId,o.path);let s=this.plugin.app.vault.getMarkdownFiles();for(let o of s){let l=this.plugin.app.metadataCache.getFileCache(o),c=l==null?void 0:l.frontmatter;c&&a(c[t],o.path)}}catch(i){return Sd.error("Error counting related notes for ICS events:",{category:"provider",operation:"counting-related-notes-ics-events",error:i}),new Map}return new Map(Array.from(e.entries()).map(([i,s])=>[i,s.size]))}normalizeEventIds(e){return(Array.isArray(e)?e:e?[e]:[]).filter(n=>typeof n=="string").map(n=>n.trim()).filter(Boolean)}async createTaskFromICS(e,t){var n;try{let a=this.plugin.icsSubscriptionService.getSubscriptions().find(l=>l.id===e.subscriptionId),i=(a==null?void 0:a.name)||"Unknown Calendar",s=(t==null?void 0:t.scheduled)!==void 0?t.scheduled:this.computeScheduledFromICSEvent(e),o={title:(t==null?void 0:t.title)||e.title,status:(t==null?void 0:t.status)||this.plugin.settings.defaultTaskStatus,priority:(t==null?void 0:t.priority)||this.plugin.settings.defaultTaskPriority,due:(t==null?void 0:t.due)!==void 0?t.due:(n=this.plugin.settings.icsIntegration)!=null&&n.useICSEndAsDue?this.computeDueFromICSEnd(e):void 0,scheduled:s,contexts:(t==null?void 0:t.contexts)||(e.location?[e.location]:void 0),projects:t==null?void 0:t.projects,tags:(t==null?void 0:t.tags)||[this.plugin.fieldMapper.toUserField("icsEventTag")],timeEstimate:(t==null?void 0:t.timeEstimate)||this.calculateEventDuration(e),details:(t==null?void 0:t.details)||this.buildICSEventDetails(e,i),icsEventId:[e.id],creationContext:"ics-event",dateCreated:Ge(),dateModified:Ge(),...Object.fromEntries(Object.entries(t||{}).filter(([l])=>l!=="due"))};return await this.plugin.taskService.createTask(o,{applyDefaults:!1})}catch(a){let i=a instanceof Error?a.message:String(a);throw Sd.error("Error creating task from ICS event:",{category:"provider",operation:"creating-task-ics-event",details:{icsEventId:e.id,icsEventTitle:e.title},error:i}),new Error(`Failed to create task from ICS event: ${i}`)}}computeScheduledFromICSEvent(e){try{if(!e.start)return;let t=e.allDay&&/^\d{4}-\d{2}-\d{2}$/.test(e.start)?e.start+"T00:00:00":e.start,n=new Date(t);return e.allDay?ce(n):M(n,"yyyy-MM-dd'T'HH:mm")}catch(t){return Sd.warn("Failed to compute scheduled from ICS event start:",{category:"provider",operation:"compute-scheduled-ics-event-start",details:{start:e.start},error:t}),e.start}}computeDueFromICSEnd(e){try{if(!e.end)return;if(e.allDay){if(!e.start)return;let a=/^\d{4}-\d{2}-\d{2}$/.test(e.start)?e.start+"T00:00:00":e.start,i=new Date(a);return ce(i)}let t=/^\d{4}-\d{2}-\d{2}$/.test(e.end)?e.end+"T00:00:00":e.end,n=new Date(t);return M(n,"yyyy-MM-dd'T'HH:mm")}catch(t){Sd.warn("Failed to compute due from ICS event end:",{category:"provider",operation:"compute-due-ics-event-end",details:{end:e.end},error:t});return}}async createNoteFromICS(e,t){var n;try{let a=this.plugin.icsSubscriptionService.getSubscriptions().find(O=>O.id===e.subscriptionId),i=(a==null?void 0:a.name)||"Unknown Calendar",s=e.allDay&&/^\d{4}-\d{2}-\d{2}$/.test(e.start)?e.start+"T00:00:00":e.start,o=new Date(s),l=(t==null?void 0:t.title)||`${e.title} - ${M(o,"PPP")}`,c=(t==null?void 0:t.folder)||((n=this.plugin.settings.icsIntegration)==null?void 0:n.defaultNoteFolder)||"",d=YR(c,{date:o,icsData:{title:e.title,location:e.location,description:e.description}}),u={title:e.title,priority:"",status:"",date:o,dueDate:e.end,scheduledDate:e.start,icsEventTitle:e.title,icsEventLocation:e.location,icsEventDescription:e.description},p=LSe(u,this.plugin.settings),m=await Gk(p,d,this.plugin.app.vault),f=d?`${d}/${m}.md`:`${m}.md`;d&&await tm(this.plugin.app.vault,d);let h={title:l,priority:"",status:"",contexts:e.location?[e.location]:[],tags:[this.plugin.fieldMapper.toUserField("icsEventTag")],timeEstimate:0,dueDate:e.end||"",scheduledDate:e.start||"",details:e.description||"",parentNote:"",icsEventTitle:e.title,icsEventStart:e.start,icsEventEnd:e.end||"",icsEventLocation:e.location||"",icsEventDescription:e.description||"",icsEventUrl:e.url||"",icsEventSubscription:i,icsEventId:e.id},g=this.plugin.fieldMapper.toUserField("dateCreated"),v=this.plugin.fieldMapper.toUserField("dateModified"),b={title:l,[g]:Ge(),[v]:Ge(),tags:[this.plugin.fieldMapper.toUserField("icsEventTag")],[this.plugin.fieldMapper.toUserField("icsEventId")]:[e.id]},k=this.buildICSEventDetails(e,i);if(t!=null&&t.template)try{let O=(0,dP.normalizePath)(t.template.trim()),z=this.plugin.app.vault.getAbstractFileByPath(O.endsWith(".md")?O:`${O}.md`);if(z instanceof dP.TFile){let R=await this.plugin.app.vault.read(z),A=iD(R,h);b={...b,...A.frontmatter},k=A.body||k}else Sd.warn(`ICS note template not found: ${O}`,{category:"provider",operation:"ics-note-template-not-found"}),Te(this.plugin.emitter,this.translate("services.icsNote.notices.templateNotFound",{path:O}))}catch(O){Sd.error("Error processing ICS note template:",{category:"provider",operation:"processing-ics-note-template",error:O}),Te(this.plugin.emitter,this.translate("services.icsNote.notices.templateProcessError",{template:t.template}))}let S=`${Object.keys(b).length>0?`--- ${Object.entries(b).map(([O,z])=>`${O}: ${this.formatYamlValue(z)}`).join(` `)} --- `:""}${k}`,C=await this.plugin.app.vault.create(f,S),E=Array.isArray(b.tags)?b.tags.filter(O=>typeof O=="string"):[],D=typeof b[g]=="string"?b[g]:void 0,P={title:l,path:C.path,tags:E,createdDate:D,lastModified:Date.now()};return{file:C,noteInfo:P}}catch(a){let i=a instanceof Error?a.message:String(a);throw Sd.error("Error creating note from ICS event:",{category:"provider",operation:"creating-note-ics-event",details:{icsEventId:e.id,icsEventTitle:e.title},error:i}),new Error(`Failed to create note from ICS event: ${i}`)}}async findRelatedNotes(e){try{let t=[],n=new Set,a=this.plugin.fieldMapper.toUserField("icsEventId"),i=this.buildEventSeriesIndex(),s=this.getRelatedEventIds(e.id,i),o=d=>this.normalizeEventIds(d).some(u=>this.eventIdsMatchSeries(u,s,i)),l=await this.plugin.cacheManager.getAllTasks();for(let d of l)if(o(d.icsEventId)){if(n.has(d.path))continue;t.push(d),n.add(d.path)}let c=this.plugin.app.vault.getMarkdownFiles();for(let d of c)try{let u=this.plugin.app.metadataCache.getFileCache(d),p=u==null?void 0:u.frontmatter;if(p&&o(p[a])){if(n.has(d.path))continue;let m={title:p.title||d.basename,path:d.path,tags:p.tags||[],createdDate:p.dateCreated,lastModified:d.stat.mtime};t.push(m),n.add(d.path)}}catch(u){continue}return t}catch(t){return Sd.error("Error finding related notes for ICS event:",{category:"provider",operation:"finding-related-notes-ics-event",error:t}),[]}}async linkNoteToICS(e,t){try{let n=this.plugin.app.vault.getAbstractFileByPath(e);if(!(n instanceof dP.TFile))throw new Error(`Cannot find note file: ${e}`);await Fr(this.plugin.app,n,a=>{let i=this.plugin.fieldMapper.toUserField("icsEventId"),s=a[i],o=s?Array.isArray(s)?[...s]:[s]:[];o.includes(t.id)||o.push(t.id),a[i]=o;let l=this.plugin.fieldMapper.toUserField("dateModified");a[l]=Ge()}),Te(this.plugin.emitter,this.translate("services.icsNote.notices.linkedToEvent",{title:t.title}))}catch(n){let a=n instanceof Error?n.message:String(n);throw Sd.error("Error linking note to ICS event:",{category:"provider",operation:"linking-note-ics-event",details:{notePath:e,icsEventId:t.id},error:a}),new Error(`Failed to link note to ICS event: ${a}`)}}buildICSEventDetails(e,t){let n=[];if(n.push(`# ${e.title}`),n.push(""),e.start){let a=e.allDay&&/^\d{4}-\d{2}-\d{2}$/.test(e.start)?e.start+"T00:00:00":e.start,i=new Date(a);n.push(`**Start:** ${M(i,"PPPp")}`)}if(e.end&&!e.allDay){let a=/^\d{4}-\d{2}-\d{2}$/.test(e.end)?e.end+"T00:00:00":e.end,i=new Date(a);n.push(`**End:** ${M(i,"PPPp")}`)}return e.location&&n.push(`**Location:** ${e.location}`),n.push(`**Calendar:** ${t}`),e.description&&(n.push(""),n.push("## Description"),n.push(e.description)),e.url&&(n.push(""),n.push(`**Event URL:** ${e.url}`)),n.join(` `)}formatYamlValue(e){return typeof e=="string"?e.includes(":")||e.includes("#")||e.includes("[")||e.includes("{")?`"${e.replace(/"/g,'\\"')}"`:e:Array.isArray(e)?`[${e.map(t=>typeof t=="string"?`"${t}"`:t).join(", ")}]`:String(e)}calculateEventDuration(e){if(!(!e.start||!e.end))try{let t=e.allDay&&/^\d{4}-\d{2}-\d{2}$/.test(e.start)?e.start+"T00:00:00":e.start,n=e.allDay&&/^\d{4}-\d{2}-\d{2}$/.test(e.end)?e.end+"T00:00:00":e.end,a=new Date(t).getTime(),i=new Date(n).getTime();if(isNaN(a)||isNaN(i))return;let s=i-a,o=Math.round(s/(1e3*60));return o>0&&o<1440?o:void 0}catch(t){Sd.warn("Error calculating event duration:",{category:"provider",operation:"calculating-event-duration",error:t});return}}}});var HO,go,pT,IBr,mT=y(()=>{HO={TOKEN_REFRESH_BUFFER_MS:3e5,CALLBACK_PORT_START:8080,CALLBACK_PORT_END:8090},go={REFRESH_INTERVAL_MS:900*1e3,MIN_MANUAL_REFRESH_INTERVAL_MS:30*1e3,MAX_RESULTS_PER_REQUEST:2500,VIEW_RANGE:{DAYS_BEFORE:180,DAYS_AFTER:90},DEFAULT_EVENT_DURATION_MS:3600*1e3,MAX_REMINDER_MINUTES:40320,RATE_LIMIT:{MAX_RETRIES:3,INITIAL_BACKOFF_MS:1e3,MAX_BACKOFF_MS:16e3,BACKOFF_MULTIPLIER:2}},pT={REFRESH_INTERVAL_MS:900*1e3,MIN_MANUAL_REFRESH_INTERVAL_MS:30*1e3,MAX_RESULTS_PER_REQUEST:50,VIEW_RANGE:{DAYS_BEFORE:30,DAYS_AFTER:90},DEFAULT_EVENT_DURATION_MS:3600*1e3,RATE_LIMIT:{MAX_RETRIES:3,INITIAL_BACKOFF_MS:1e3,MAX_BACKOFF_MS:16e3,BACKOFF_MULTIPLIER:2}},IBr={SECOND_MS:1e3,MINUTE_MS:60*1e3,HOUR_MS:3600*1e3,DAY_MS:1440*60*1e3}});var uP,pP,xs,ry,VO,qa,uf,fT,al,pf,hT=y(()=>{uP=class extends Error{constructor(t,n){super(t);this.code=n;this.name="TaskNotesServiceError",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},pP=class extends uP{constructor(t,n,a){super(t,a);this.provider=n;this.name="OAuthError"}},xs=class extends pP{constructor(e){super(`${e} authentication expired. Please reconnect.`,e,"TOKEN_EXPIRED"),this.name="TokenExpiredError"}},ry=class extends pP{constructor(t,n,a){let i=`${t} connection expired. Please reconnect in Settings > Integrations.`;super(i,t,"TOKEN_REFRESH_FAILED");this.oauthErrorCode=n;this.oauthErrorDescription=a;this.name="TokenRefreshError"}},VO=class extends pP{constructor(e){super(`${e} OAuth is not configured. Please provide OAuth credentials in settings.`,e,"NOT_CONFIGURED"),this.name="OAuthNotConfiguredError"}},qa=class extends uP{constructor(t,n,a){super(t,a);this.statusCode=n;this.name="GoogleCalendarError"}},uf=class extends qa{constructor(e){super(`Calendar event not found: ${e}`,404,"EVENT_NOT_FOUND"),this.name="EventNotFoundError"}},fT=class extends qa{constructor(e){super(`Calendar not found: ${e}`,404,"CALENDAR_NOT_FOUND"),this.name="CalendarNotFoundError"}},al=class extends qa{constructor(e){let t=e?`Rate limit exceeded. Retry after ${e} seconds.`:"Rate limit exceeded. Please try again later.";super(t,429,"RATE_LIMIT"),this.name="RateLimitError"}},pf=class extends uP{constructor(t,n){super(t,"VALIDATION_ERROR");this.field=n;this.name="ValidationError"}}});function X_e(){if(mf.Platform.isDesktop&&mf.Platform.isDesktopApp)return G6||(G6=require("http")),G6;throw new Error("OAuth redirect handling is only available on desktop.")}var mf,il,G6,qO,eIe=y(()=>{mf=require("obsidian");mT();hT();K();fs();il=N({tag:"Services/OAuthService"}),G6=null;qO=class{constructor(e,t){this.callbackServer=null;this.pendingOAuthState=new Map;this.tokenRefreshPromises=new Map;this.connectionGenerations=new Map;this.configs={google:{provider:"google",clientId:"",redirectUri:"http://127.0.0.1:8080",scope:["https://www.googleapis.com/auth/calendar.readonly","https://www.googleapis.com/auth/calendar.events"],authorizationEndpoint:"https://accounts.google.com/o/oauth2/v2/auth",tokenEndpoint:"https://oauth2.googleapis.com/token",deviceCodeEndpoint:"https://oauth2.googleapis.com/device/code",revocationEndpoint:"https://oauth2.googleapis.com/revoke"},microsoft:{provider:"microsoft",clientId:"",redirectUri:"http://localhost:8080",scope:["Calendars.Read","Calendars.ReadWrite","offline_access"],authorizationEndpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",tokenEndpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/token",deviceCodeEndpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",revocationEndpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/logout"}};this.plugin=e,this.secretStore=t}getCredentials(e){return this.secretStore.getCredentials(e)}setCredentials(e,t){this.secretStore.setCredentials(e,t)}clearCredentials(e){this.secretStore.clearCredentials(e)}getConfig(e){var n;let t=this.secretStore.getCredentials(e);return{...this.configs[e],clientId:(n=t==null?void 0:t.clientId)!=null?n:"",clientSecret:t==null?void 0:t.clientSecret}}async authenticate(e){if(!this.getConfig(e).clientId)throw new VO(e);return await this.authenticateStandard(e)}async authenticateStandard(e){try{let t=this.getConfig(e);if(!mf.Platform.isDesktopApp)throw Te(this.plugin.emitter,"OAUTH authentication requires the desktop app."),new Error("OAuth authentication requires the desktop app.");let n=this.generateCodeVerifier(),a=await this.generateCodeChallenge(n),i=this.generateState(),s=await this.findAvailablePort(HO.CALLBACK_PORT_START,HO.CALLBACK_PORT_END);await this.startCallbackServer(s);let o=t.redirectUri;t.redirectUri=`http://127.0.0.1:${s}`;try{let l=this.buildAuthorizationUrl(t,a,i);this.pendingOAuthState.set(i,{provider:e,codeVerifier:n,resolve:()=>{},reject:()=>{}}),Te(this.plugin.emitter,`Opening browser for ${e} authorization...`),await this.openAuthorizationUrl(l);let c=await this.waitForCallback(i,3e5),d=await this.exchangeCodeForTokens(t,c,n);await this.storeConnection(e,d),Te(this.plugin.emitter,`Successfully connected to ${e} Calendar!`)}finally{t.redirectUri=o}}catch(t){throw il.error(`OAuth authentication failed for ${e}:`,{category:"provider",operation:"oauth-authentication",error:t}),Te(this.plugin.emitter,`Failed to connect to ${e}: ${t.message}`),t}finally{await this.stopCallbackServer()}}async openAuthorizationUrl(e){try{let n=require("electron").shell;if(n!=null&&n.openExternal){await n.openExternal(e);return}}catch(t){il.warn("Failed to open OAuth URL in system browser; falling back to window.open.",{category:"provider",operation:"oauth-open-external",error:t})}window.open(e,"_blank")}async findAvailablePort(e,t){let n=X_e();for(let a=e;a<=t;a++)try{return await new Promise((i,s)=>{let o=n.createServer();o.once("error",s),o.once("listening",()=>{o.close(),i()}),o.listen(a,"127.0.0.1")}),a}catch(i){continue}throw new Error(`No available ports found between ${e} and ${t}`)}generateCodeVerifier(){return this.base64UrlEncode(crypto.getRandomValues(new Uint8Array(32)))}async generateCodeChallenge(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t);return this.base64UrlEncode(new Uint8Array(n))}generateState(){return Array.from(crypto.getRandomValues(new Uint8Array(16))).map(e=>e.toString(16).padStart(2,"0")).join("")}base64UrlEncode(e){let t="";return e.forEach(n=>{t+=String.fromCharCode(n)}),btoa(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}buildAuthorizationUrl(e,t,n){let a=new URLSearchParams({client_id:e.clientId,redirect_uri:e.redirectUri,response_type:"code",scope:e.scope.join(" "),state:n,code_challenge:t,code_challenge_method:"S256"});return e.provider==="google"&&(a.set("access_type","offline"),a.set("prompt","consent")),`${e.authorizationEndpoint}?${a.toString()}`}async startCallbackServer(e){return new Promise((t,n)=>{if(this.callbackServer){t();return}let a;try{a=X_e()}catch(i){n(i instanceof Error?i:new Error(String(i)));return}this.callbackServer=a.createServer((i,s)=>{this.handleCallback(i,s)}),this.callbackServer.once("error",i=>{il.error("OAuth callback server error:",{category:"provider",operation:"oauth-callback-server",error:i}),n(i)}),this.callbackServer.listen(e,"127.0.0.1",()=>{t()})})}async stopCallbackServer(){return new Promise(e=>{if(!this.callbackServer){e();return}this.callbackServer.close(()=>{this.callbackServer=null,e()})})}handleCallback(e,t){let n=e.headers.host,a=Array.isArray(n)?n[0]:n!=null?n:"localhost",i=new URL(e.url||"",`http://${a}`),s=i.searchParams.get("code"),o=i.searchParams.get("state"),l=i.searchParams.get("error");if(t.writeHead(200,{"Content-Type":"text/html"}),l){t.end(` OAuth Error

Authorization Failed

Error: ${l}

You can close this window.

`);let d=o?this.pendingOAuthState.get(o):null;d&&o&&(d.reject(new Error(`OAuth error: ${l}`)),this.pendingOAuthState.delete(o));return}if(!s||!o){t.end(` OAuth Error

Invalid Callback

Missing required parameters.

You can close this window.

`);return}t.end(` OAuth Success

Authorization Successful!

You can close this window and return to Obsidian.