Files
silverbullet-icalendar/icalendar.plug.js
2026-02-20 21:50:16 +00:00

11 lines
89 KiB
JavaScript

var Br=Object.defineProperty;var ce=(t,e)=>{for(var r in e)Br(t,r,{get:e[r],enumerable:!0})};function yt(t){let e=atob(t),r=e.length,n=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=e.charCodeAt(o);return n}function Le(t){typeof t=="string"&&(t=new TextEncoder().encode(t));let e="",r=t.byteLength;for(let n=0;n<r;n++)e+=String.fromCharCode(t[n]);return btoa(e)}var Rs=new Uint8Array(16);var Ie=class{constructor(e="",r=1e3){this.prefix=e;this.maxCaptureSize=r;this.prefix=e,this.originalConsole={log:console.log.bind(console),info:console.info.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),debug:console.debug.bind(console)},this.patchConsole()}originalConsole;logBuffer=[];patchConsole(){let e=r=>(...n)=>{let o=this.prefix?[this.prefix,...n]:n;this.originalConsole[r](...o),this.captureLog(r,n)};console.log=e("log"),console.info=e("info"),console.warn=e("warn"),console.error=e("error"),console.debug=e("debug")}captureLog(e,r){let n={level:e,timestamp:Date.now(),message:r.map(o=>{if(typeof o=="string")return o;try{return JSON.stringify(o)}catch{return String(o)}}).join(" ")};this.logBuffer.push(n),this.logBuffer.length>this.maxCaptureSize&&this.logBuffer.shift()}async postToServer(e,r){if(this.logBuffer.length>0){let o=[...this.logBuffer];this.logBuffer=[];try{if(!(await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o.map(i=>({...i,source:r})))})).ok)throw new Error("Failed to post logs to server")}catch(a){console.warn("Could not post logs to server",a.message),this.logBuffer.unshift(...o)}}}},ft;function pt(t=""){return ft=new Ie(t),ft}var le=t=>{throw new Error("Not initialized yet")},Ke=typeof window>"u"&&typeof globalThis.WebSocketPair>"u";typeof Deno>"u"&&(self.Deno={args:[],build:{arch:"x86_64"},env:{get(){}}});var Ue=new Map,Ye=0;Ke&&(globalThis.syscall=async(t,...e)=>await new Promise((r,n)=>{Ye++,Ue.set(Ye,{resolve:r,reject:n}),le({type:"sys",id:Ye,name:t,args:e})}));function mt(t,e,r){Ke&&(le=r,self.addEventListener("message",n=>{(async()=>{let o=n.data;switch(o.type){case"inv":{let a=t[o.name];if(!a)throw new Error(`Function not loaded: ${o.name}`);try{let i=await Promise.resolve(a(...o.args||[]));le({type:"invr",id:o.id,result:i})}catch(i){console.error("An exception was thrown as a result of invoking function",o.name,"error:",i.message),le({type:"invr",id:o.id,error:i.message})}}break;case"sysr":{let a=o.id,i=Ue.get(a);if(!i)throw Error("Invalid request id");Ue.delete(a),o.error?i.reject(new Error(o.error)):i.resolve(o.result)}break}})().catch(console.error)}),le({type:"manifest",manifest:e}),pt(`[${e.name} plug]`))}async function jr(t,e){if(typeof t!="string"){let r=new Uint8Array(await t.arrayBuffer()),n=r.length>0?Le(r):void 0;e={method:t.method,headers:Object.fromEntries(t.headers.entries()),base64Body:n},t=t.url}return syscall("sandboxFetch.fetch",t,e)}globalThis.nativeFetch=globalThis.fetch;function Vr(){globalThis.fetch=async function(t,e){let r=e&&e.body?Le(new Uint8Array(await new Response(e.body).arrayBuffer())):void 0,n=await jr(t,e&&{method:e.method,headers:e.headers,base64Body:r});return new Response(n.base64Body?yt(n.base64Body):null,{status:n.status,headers:n.headers})}}Ke&&Vr();var H={};ce(H,{alert:()=>On,configureVimMode:()=>Hn,confirm:()=>Cn,copyToClipboard:()=>zn,deleteLine:()=>Fn,dispatch:()=>kn,downloadFile:()=>pn,filterBox:()=>gn,flashNotification:()=>hn,fold:()=>Pn,foldAll:()=>Ln,getCurrentEditor:()=>Gr,getCurrentPage:()=>Wr,getCurrentPageMeta:()=>Hr,getCurrentPath:()=>$r,getCursor:()=>Qr,getRecentlyOpenedPages:()=>qr,getSelection:()=>Xr,getText:()=>Zr,getUiOption:()=>Mn,goHistory:()=>fn,hidePanel:()=>bn,insertAtCursor:()=>xn,insertAtPos:()=>Tn,invokeCommand:()=>tn,isMobile:()=>qn,moveCursor:()=>Sn,moveCursorToLine:()=>An,moveLineDown:()=>Vn,moveLineUp:()=>jn,navigate:()=>nn,newWindow:()=>yn,openCommandPalette:()=>an,openPageNavigator:()=>on,openSearchPanel:()=>Kn,openUrl:()=>dn,prompt:()=>Dn,rebuildEditorState:()=>cn,redo:()=>Un,reloadConfigAndCommands:()=>ln,reloadPage:()=>sn,reloadUI:()=>un,replaceRange:()=>wn,save:()=>rn,sendMessage:()=>$n,setSelection:()=>en,setText:()=>Jr,setUiOption:()=>Rn,showPanel:()=>vn,showProgress:()=>En,toggleComment:()=>Bn,toggleFold:()=>Nn,undo:()=>Yn,unfold:()=>_n,unfoldAll:()=>In,uploadFile:()=>mn,vimEx:()=>Wn});typeof self>"u"&&(self={syscall:()=>{throw new Error("Not implemented here")}});function y(t,...e){return globalThis.syscall(t,...e)}function Wr(){return y("editor.getCurrentPage")}function Hr(){return y("editor.getCurrentPageMeta")}function $r(){return y("editor.getCurrentPath")}function qr(){return y("editor.getRecentlyOpenedPages")}function Gr(){return y("editor.getCurrentEditor")}function Zr(){return y("editor.getText")}function Jr(t,e=!1){return y("editor.setText",t,e)}function Qr(){return y("editor.getCursor")}function Xr(){return y("editor.getSelection")}function en(t,e){return y("editor.setSelection",t,e)}function tn(t,e){return y("editor.invokeCommand",t,e)}function rn(){return y("editor.save")}function nn(t,e=!1,r=!1){return y("editor.navigate",t,e,r)}function on(t="page"){return y("editor.openPageNavigator",t)}function an(){return y("editor.openCommandPalette")}function sn(){return y("editor.reloadPage")}function un(){return y("editor.reloadUI")}function cn(){return y("editor.rebuildEditorState")}function ln(){return y("editor.reloadConfigAndCommands")}function dn(t,e=!1){return y("editor.openUrl",t,e)}function yn(){return y("editor.newWindow")}function fn(t){return y("editor.goHistory",t)}function pn(t,e){return y("editor.downloadFile",t,e)}function mn(t,e){return y("editor.uploadFile",t,e)}function hn(t,e="info"){return y("editor.flashNotification",t,e)}function gn(t,e,r="",n=""){return y("editor.filterBox",t,e,r,n)}function vn(t,e,r,n=""){return y("editor.showPanel",t,e,r,n)}function bn(t){return y("editor.hidePanel",t)}function En(t,e){return y("editor.showProgress",t,e)}function Tn(t,e){return y("editor.insertAtPos",t,e)}function wn(t,e,r){return y("editor.replaceRange",t,e,r)}function Sn(t,e=!1){return y("editor.moveCursor",t,e)}function An(t,e=1,r=!1){return y("editor.moveCursorToLine",t,e,r)}function xn(t,e=!1,r=!1){return y("editor.insertAtCursor",t,e,r)}function kn(t){return y("editor.dispatch",t)}function Dn(t,e=""){return y("editor.prompt",t,e)}function Cn(t){return y("editor.confirm",t)}function On(t){return y("editor.alert",t)}function Mn(t){return y("editor.getUiOption",t)}function Rn(t,e){return y("editor.setUiOption",t,e)}function Pn(){return y("editor.fold")}function _n(){return y("editor.unfold")}function Nn(){return y("editor.toggleFold")}function Ln(){return y("editor.foldAll")}function In(){return y("editor.unfoldAll")}function Yn(){return y("editor.undo")}function Un(){return y("editor.redo")}function Kn(){return y("editor.openSearchPanel")}function zn(t){return y("editor.copyToClipboard",t)}function Fn(){return y("editor.deleteLine")}function Bn(){return y("editor.toggleComment")}function jn(){return y("editor.moveLineUp")}function Vn(){return y("editor.moveLineDown")}function Wn(t){return y("editor.vimEx",t)}function Hn(){return y("editor.configureVimMode")}function $n(t,e){return y("editor.sendMessage",t,e)}function qn(){return y("editor.isMobile")}var de={};ce(de,{del:()=>eo,get:()=>Xn,set:()=>Qn});function Qn(t,e){return y("clientStore.set",t,e)}function Xn(t){return y("clientStore.get",t)}function eo(t){return y("clientStore.delete",t)}var Hs=new Uint8Array(16);var ye={};ce(ye,{batchDel:()=>po,batchDeletePrefix:()=>go,batchGet:()=>yo,batchSet:()=>co,del:()=>fo,get:()=>lo,listFunctions:()=>bo,query:()=>mo,queryDelete:()=>vo,queryLua:()=>ho,set:()=>uo});function uo(t,e){return y("datastore.set",t,e)}function co(t){return y("datastore.batchSet",t)}function lo(t){return y("datastore.get",t)}function yo(t){return y("datastore.batchGet",t)}function fo(t){return y("datastore.delete",t)}function po(t){return y("datastore.batchDelete",t)}function mo(t){return y("datastore.query",t)}function ho(t,e,r){return y("datastore.queryLua",t,e,r)}function go(t){return y("datastore.batchDeletePrefix",t)}function vo(t,e){return y("datastore.queryDelete",t,e)}function bo(){return y("datastore.listFunctions")}var Te={};ce(Te,{define:()=>ko,get:()=>wo,has:()=>xo,insert:()=>Ao,set:()=>So});function wo(t,e){return y("config.get",t,e)}function So(t,e){return y("config.set",t,e)}function Ao(t,e){return y("config.insert",t,e)}function xo(t){return y("config.has",t)}function ko(t,e){return y("config.define",t,e)}var we={};ce(we,{ensureFullIndex:()=>Mo,getObjectByRef:()=>Oo,indexObjects:()=>Do,queryLuaObjects:()=>Co});function Do(t,e){return y("index.indexObjects",t,e)}function Co(t,e,r,n){return y("index.queryLuaObjects",t,e,r,n)}function Oo(t,e,r){return y("index.getObjectByRef",t,e,r)}function Mo(){return y("index.ensureFullIndex")}var V=t=>Object.fromEntries(Object.entries(t).map(([e,r])=>[r,e])),C=t=>Object.keys(t),St={action:"ACTION",description:"DESCRIPTION",duration:"DURATION",repeat:"REPEAT",summary:"SUMMARY",trigger:"TRIGGER",attachments:"ATTACH",attendees:"ATTENDEE"},At=V(St),su=C(At),uu=C(St),xt={method:"METHOD",prodId:"PRODID",version:"VERSION",name:"X-WR-CALNAME"},kt=V(xt),cu=C(kt),lu=C(xt),Dt={alarms:"ALARM",categories:"CATEGORIES",created:"CREATED",description:"DESCRIPTION",lastModified:"LAST-MODIFIED",location:"LOCATION",exceptionDates:"EXDATE",recurrenceRule:"RRULE",stamp:"DTSTAMP",start:"DTSTART",summary:"SUMMARY",uid:"UID",timeTransparent:"TRANSP",url:"URL",end:"DTEND",duration:"DURATION",geo:"GEO",class:"CLASS",organizer:"ORGANIZER",priority:"PRIORITY",sequence:"SEQUENCE",status:"STATUS",attach:"ATTACH",recurrenceId:"RECURRENCE-ID",attendees:"ATTENDEE",comment:"COMMENT"},Ct=V(Dt),du=C(Ct),yu=C(Dt),Ot={id:"TZID",lastModified:"LAST-MODIFIED",url:"TZURL"},Mt=V(Ot),fu=C(Mt),pu=C(Ot),Rt={comment:"COMMENT",name:"TZNAME",offsetFrom:"TZOFFSETFROM",offsetTo:"TZOFFSETTO",recurrenceDate:"RDATE",recurrenceRule:"RRULE",start:"DTSTART"},Pt=V(Rt),mu=C(Pt),hu=C(Rt),_t={byDay:"BYDAY",byHour:"BYHOUR",byMinute:"BYMINUTE",byMonth:"BYMONTH",byMonthday:"BYMONTHDAY",bySecond:"BYSECOND",bySetPos:"BYSETPOS",byWeekNo:"BYWEEKNO",byYearday:"BYYEARDAY",count:"COUNT",frequency:"FREQ",interval:"INTERVAL",until:"UNTIL",workweekStart:"WKST"},Nt=V(_t),gu=C(Nt),vu=C(_t),Lt={categories:"CATEGORIES",created:"CREATED",description:"DESCRIPTION",lastModified:"LAST-MODIFIED",location:"LOCATION",exceptionDates:"EXDATE",recurrenceRule:"RRULE",stamp:"DTSTAMP",start:"DTSTART",summary:"SUMMARY",uid:"UID",url:"URL",duration:"DURATION",geo:"GEO",class:"CLASS",organizer:"ORGANIZER",priority:"PRIORITY",sequence:"SEQUENCE",status:"STATUS",attach:"ATTACH",recurrenceId:"RECURRENCE-ID",attendees:"ATTENDEE",comment:"COMMENT",completed:"COMPLETED",due:"DUE",percentComplete:"PERCENT-COMPLETE"},It=V(Lt),bu=C(It),Eu=C(Lt),Yt={categories:"CATEGORIES",created:"CREATED",description:"DESCRIPTION",lastModified:"LAST-MODIFIED",exceptionDates:"EXDATE",recurrenceRule:"RRULE",stamp:"DTSTAMP",start:"DTSTART",summary:"SUMMARY",uid:"UID",url:"URL",geo:"GEO",class:"CLASS",organizer:"ORGANIZER",sequence:"SEQUENCE",status:"STATUS",attach:"ATTACH",recurrenceId:"RECURRENCE-ID",attendees:"ATTENDEE",comment:"COMMENT"},Ut=V(Yt),Tu=C(Ut),wu=C(Yt),Kt={stamp:"DTSTAMP",start:"DTSTART",uid:"UID",url:"URL",organizer:"ORGANIZER",attendees:"ATTENDEE",comment:"COMMENT",end:"DTEND",freeBusy:"FREEBUSY"},zt=V(Kt),Su=C(zt),Au=C(Kt),Ft="BEGIN",Bt="END",Ro="VCALENDAR",jt="VTIMEZONE",Po="STANDARD",_o="DAYLIGHT",Vt="VEVENT",Wt="VALARM",Ht="VTODO",$t="VJOURNAL",qt="VFREEBUSY";var ht=t=>new RegExp(`${Ft}:${t}([\\s\\S]*?)${Bt}:${t}`,"g"),No=t=>new RegExp(`${Ft}:${t}|${Bt}:${t}`,"g");var Fe=/\r\n|\r|\n/;var gt=`
`,Lo=":",te=",",Io='"',Be=";";var vt="=";var Yo=Math.pow(10,8)*24*60*60*1e3,xu=-Yo,Uo=6048e5;var Gt=6e4,Zt=36e5,Ko=3600,Jt=Ko*24,ku=Jt*7,zo=Jt*365.2425,Fo=zo/12,Du=Fo*3,bt=Symbol.for("constructDateFrom");function U(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&bt in t?t[bt](e):t instanceof Date?new t.constructor(e):new Date(e)}function E(t,e){return U(e||t,t)}function Ve(t,e,r){let n=E(t,r?.in);return isNaN(e)?U(r?.in||t,NaN):(e&&n.setDate(n.getDate()+e),n)}function Qt(t,e,r){let n=E(t,r?.in);if(isNaN(e))return U(r?.in||t,NaN);if(!e)return n;let o=n.getDate(),a=U(r?.in||t,n.getTime());a.setMonth(n.getMonth()+e+1,0);let i=a.getDate();return o>=i?a:(n.setFullYear(a.getFullYear(),a.getMonth(),o),n)}function ke(t,e,r){return U(r?.in||t,+E(t)+e)}function Bo(t,e,r){return ke(t,e*Zt,r)}var jo={};function De(){return jo}function Ae(t,e){var r,n,o,a;let i=De(),s=e?.weekStartsOn??((n=(r=e?.locale)==null?void 0:r.options)==null?void 0:n.weekStartsOn)??i.weekStartsOn??((a=(o=i.locale)==null?void 0:o.options)==null?void 0:a.weekStartsOn)??0,u=E(t,e?.in),c=u.getDay(),d=(c<s?7:0)+c-s;return u.setDate(u.getDate()-d),u.setHours(0,0,0,0),u}function Vo(t,...e){let r=U.bind(null,t||e.find(n=>typeof n=="object"));return e.map(r)}function Wo(t,e){let r=E(t,e?.in);return r.setHours(0,0,0,0),r}function Xt(t,e,r){let n=E(t,r?.in);return n.setTime(n.getTime()+e*Gt),n}function Ho(t,e,r){return ke(t,e*1e3,r)}function We(t,e,r){return Ve(t,e*7,r)}function er(t,e,r){return Qt(t,e*12,r)}function He(t,e){let r=+E(t)-+E(e);return r<0?-1:r>0?1:r}function Et(t,e){let r=E(t,e?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function $o(t,e){let[r,n]=Vo(t,e.start,e.end);return{start:r,end:n}}function qo(t,e){let{start:r,end:n}=$o(e?.in,t),o=+r>+n,a=o?+r:+n,i=o?n:r;i.setHours(0,0,0,0);let s=e?.step??1;if(!s)return[];s<0&&(s=-s,o=!o);let u=[];for(;+i<=a;)u.push(U(r,i)),i.setDate(i.getDate()+s),i.setHours(0,0,0,0);return o?u.reverse():u}function Tt(t,e){let r=E(t,e?.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Go(t,e){let r=E(t,e?.in),n=r.getFullYear();return r.setFullYear(n+1,0,0),r.setHours(23,59,59,999),r}function Zo(t,e){let r=E(t,e?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function Jo(t,e){var r,n,o,a;let i=E(t,e?.in),s=i.getFullYear(),u=De(),c=e?.firstWeekContainsDate??((n=(r=e?.locale)==null?void 0:r.options)==null?void 0:n.firstWeekContainsDate)??u.firstWeekContainsDate??((a=(o=u.locale)==null?void 0:o.options)==null?void 0:a.firstWeekContainsDate)??1,d=U(e?.in||t,0);d.setFullYear(s+1,0,c),d.setHours(0,0,0,0);let f=Ae(d,e),l=U(e?.in||t,0);l.setFullYear(s,0,c),l.setHours(0,0,0,0);let m=Ae(l,e);return+i>=+f?s+1:+i>=+m?s:s-1}function Qo(t,e){var r,n,o,a;let i=De(),s=e?.firstWeekContainsDate??((n=(r=e?.locale)==null?void 0:r.options)==null?void 0:n.firstWeekContainsDate)??i.firstWeekContainsDate??((a=(o=i.locale)==null?void 0:o.options)==null?void 0:a.firstWeekContainsDate)??1,u=Jo(t,e),c=U(e?.in||t,0);return c.setFullYear(u,0,s),c.setHours(0,0,0,0),Ae(c,e)}function Xo(t,e){let r=E(t,e?.in),n=+Ae(r,e)-+Qo(r,e);return Math.round(n/Uo)+1}function Se(t,e){return E(t,e?.in).getDay()}function tr(t,e){let r=E(t,e?.in),n=r.getFullYear(),o=r.getMonth(),a=U(r,0);return a.setFullYear(n,o+1,0),a.setHours(0,0,0,0),a.getDate()}function ei(t,e){return E(t,e?.in).getHours()}function ti(t,e){return E(t,e?.in).getMinutes()}function rr(t,e){return E(t,e?.in).getMonth()}function ri(t){return E(t).getSeconds()}function ni(t,e){return E(t,e?.in).getFullYear()}function oi(t,e){return+E(t)==+E(e)}function ii(t,e,r){let n=E(t,r?.in),o=Xo(n,r)-e;return n.setDate(n.getDate()-o*7),E(n,r?.in)}function xe(t,e,r){var n,o,a,i;let s=De(),u=r?.weekStartsOn??((o=(n=r?.locale)==null?void 0:n.options)==null?void 0:o.weekStartsOn)??s.weekStartsOn??((i=(a=s.locale)==null?void 0:a.options)==null?void 0:i.weekStartsOn)??0,c=E(t,r?.in),d=c.getDay(),f=(e%7+7)%7,l=7-u,m=e<0||e>6?e-(d+l)%7:(f+l)%7-(d+l)%7;return Ve(c,m,r)}function nr(t,e,r){let n=+E(t,r?.in),[o,a]=[+E(e.start,r?.in),+E(e.end,r?.in)].sort((i,s)=>i-s);return n>=o&&n<=a}function ai(t){let e=t/Zt;return Math.trunc(e)}function si(t){let e=t/Gt;return Math.trunc(e)}function ui(t,e,r){let n=E(t,r?.in),o=n.getFullYear(),a=n.getDate(),i=U(r?.in||t,0);i.setFullYear(o,e,15),i.setHours(0,0,0,0);let s=tr(i);return n.setMonth(e,Math.min(a,s)),n}function ci(t,e,r){let n=E(t,r?.in);return n.setDate(e),n}function li(t,e,r){let n=E(t,r?.in);return n.setMonth(0),n.setDate(e),n}function di(t,e,r){let n=E(t,r?.in);return n.setHours(e),n}function yi(t,e,r){let n=E(t,r?.in);return n.setMinutes(e),n}function fi(t,e,r){let n=E(t,r?.in);return n.setSeconds(e),n}function pi(t,e,r){return ke(t,-e,r)}function mi(t,e,r){return We(t,-e,r)}var hi=[Po,_o];var gi=["SECONDLY","MINUTELY","HOURLY","DAILY","WEEKLY","MONTHLY","YEARLY"];var or=["SU","MO","TU","WE","TH","FR","SA"];var X=(t,e)=>e===void 0?!1:t>=e,vi=(t,{start:e,end:r},n)=>{if(X(n.length,t.count))return;let o=t.frequency,a=t.interval||1;if(!o)return;let i=e;if(o==="SECONDLY"){for(;i<r;){if(X(n.length,t.count))return;i=Ho(i,a),n.push([i])}return}if(o==="MINUTELY"){for(;i<r;){if(X(n.length,t.count))return;i=Xt(i,a),n.push([i])}return}if(o==="HOURLY"){for(;i<r;){if(X(n.length,t.count))return;i=Bo(i,a),n.push([i])}return}if(o==="DAILY"){for(;i<r;){if(X(n.length,t.count))return;i=Ve(i,a),n.push([i])}return}if(o==="WEEKLY"){for(;i<r;){if(X(n.length,t.count))return;i=We(i,a),n.push([i])}return}if(o==="MONTHLY"){for(;i<r;)i=Qt(i,a),n.push([i]);return}if(o==="YEARLY"){for(;i<r;)i=er(i,a),n.push([i]);return}},bi=(t,e,r,n)=>{let o=r.map(({day:a,occurrence:i})=>({occurrence:i,day:or.indexOf(a)}));return t.frequency==="YEARLY"?t.byYearday||t.byMonthday?e.map(a=>a.filter(i=>o.find(({day:s})=>s===Se(i)))):t.byWeekNo?e.map(a=>a.flatMap(i=>o.map(({day:s})=>xe(i,s,{weekStartsOn:n})))):t.byMonth?e.map(a=>a.flatMap(i=>o.flatMap(({day:s,occurrence:u})=>ze($(Tt(i)),$(Et(i)),s,n,u)))):e.map(a=>a.flatMap(i=>o.flatMap(({day:s,occurrence:u})=>ze($(Zo(i)),$(Go(i)),s,n,u)))):t.frequency==="MONTHLY"?t.byMonthday?e.map(a=>a.filter(i=>o.find(({day:s})=>s===Se(i)))):e.map(a=>a.flatMap(i=>o.flatMap(({day:s,occurrence:u})=>ze($(Tt(i)),$(Et(i)),s,n,u)))):t.frequency==="WEEKLY"?e.map(a=>a.flatMap(i=>o.map(({day:s})=>xe(i,s,{weekStartsOn:n})))):e.map(a=>a.filter(i=>o.find(({day:s})=>s===Se(i))))},ze=(t,e,r,n,o)=>{if(o!==void 0){if(!(o<0)){let s=xe(t,r,{weekStartsOn:n}),u=t>s;return We(s,(o||1)-1+(u?1:0))}let a=xe(e,r,{weekStartsOn:n}),i=e<a;return $(Wo(mi(a,-(o||1)-1+(i?1:0))))}return qo({start:t,end:e}).map(a=>$(a)).filter(a=>nr(a,{start:t,end:e})).filter(a=>r===Se(a))},$=t=>Xt(t,-t.getTimezoneOffset()),Ei=(t,e,r)=>t.frequency==="YEARLY"||t.frequency==="MONTHLY"||t.frequency==="WEEKLY"||t.frequency==="DAILY"?e.map(n=>n.flatMap(o=>r.map(a=>di(o,a)))):e.map(n=>n.filter(o=>r.includes(ei(o)))),Ti=(t,e,r)=>t.frequency==="YEARLY"||t.frequency==="MONTHLY"||t.frequency==="WEEKLY"||t.frequency==="DAILY"||t.frequency==="HOURLY"?e.map(n=>n.flatMap(o=>r.map(a=>yi(o,a)))):e.map(n=>n.filter(o=>r.includes(ti(o)))),wi=(t,e,r)=>t.frequency==="YEARLY"?e.map(n=>n.flatMap(o=>r.map(a=>ui(o,a)))):e.map(n=>n.filter(o=>r.includes(rr(o)))),Si=(t,e,r)=>t.frequency==="YEARLY"||t.frequency==="MONTHLY"?e.map(n=>n.flatMap(o=>{let a=tr(o);return r.map(i=>i>a?void 0:ci(o,i)).filter(i=>!!i)})):t.frequency==="WEEKLY"?e:e.map(n=>n.filter(o=>r.includes(rr(o)))),Ai=(t,e,r)=>t.frequency==="YEARLY"||t.frequency==="MONTHLY"||t.frequency==="WEEKLY"||t.frequency==="DAILY"||t.frequency==="HOURLY"||t.frequency==="MINUTELY"?e.map(n=>n.flatMap(o=>r.map(a=>fi(o,a)))):e.map(n=>n.filter(o=>r.includes(ri(o)))),xi=(t,e,r)=>!t.byYearday&&!t.byWeekNo&&!t.byMonthday&&!t.byMonth&&!t.byDay&&!t.byHour&&!t.byMinute&&!t.bySecond?e:e.map(n=>n.sort(He).filter((o,a)=>r.some(i=>i>0?a===0?!1:a%i===0:a===0?n.length-1+i===0:a%(n.length-1+i)===0))),ki=(t,e,r,n)=>t.frequency==="YEARLY"?e.map(o=>o.flatMap(a=>r.map(i=>ii(a,i,{weekStartsOn:n})))):e,Di=(t,e,r)=>t.frequency==="YEARLY"?e.map(n=>n.flatMap(o=>r.map(a=>li(o,a)))):t.frequency==="MONTHLY"||t.frequency==="WEEKLY"||t.frequency==="DAILY"?e:e.map(n=>n.filter(o=>r.includes(ni(o)))),Ci=(t,e,r)=>{let n=r;return t.byMonth&&(n=wi(t,n,t.byMonth)),t.byWeekNo&&(n=ki(t,n,t.byWeekNo,e.weekStartsOn)),t.byYearday&&(n=Di(t,n,t.byYearday)),t.byMonthday&&(n=Si(t,n,t.byMonthday)),t.byDay&&(n=bi(t,n,t.byDay,e.weekStartsOn)),t.byHour&&(n=Ei(t,n,t.byHour)),t.byMinute&&(n=Ti(t,n,t.byMinute)),t.bySecond&&(n=Ai(t,n,t.bySecond)),t.bySetPos&&(n=xi(t,n,t.bySetPos)),n.map(o=>o.sort(He).filter(a=>!(e.exceptions.length>0&&e.exceptions.some(i=>oi(i,a))||!nr(a,{start:e.start,end:e.end}))))},Oi=2,Mi=(t,e)=>{var r;let n=e.start,o=((r=t.until)==null?void 0:r.date)||e?.end||er(n,Oi),a=e.exceptions||[],i=(t.workweekStart?or.indexOf(t.workweekStart):1)%7,s=[[n]];vi(t,{start:n,end:o},s);let u=Ci(t,{start:n,end:o,exceptions:a,weekStartsOn:i},s);return t.count?u.flat().splice(0,t.count):u.flat()},Ri=(t,e)=>e.flatMap(r=>!r.recurrenceRule||r.recurrenceRule.until&&r.recurrenceRule.until.date<t?r:Mi(r.recurrenceRule,{start:r.start,end:t}).map(n=>({...r,start:n}))),je=t=>{let e=t[0]==="+"?1:-1,r=Number(t.slice(1,3)),n=t.length>3?Number(t.slice(3,5)):0,o=t.length>5?Number(t.slice(5,7)):0;return((r*60+n)*60+o)*1e3*e},Pi=(t,e)=>{let r="en-US",n=new Date(e.toLocaleString(r,{timeZone:"UTC"}));try{return new Date(e.toLocaleString(r,{timeZone:t})).getTime()-n.getTime()}catch{return e.getTime()-n.getTime()}},_i=(t,e,r)=>{let n=r?.find(a=>a.id===e);if(n){let a=Ri(t,n.props).sort((u,c)=>He(u.start,c.start));for(let u=0;u<a.length;u+=1)if(t<a[u].start){let c=a[u-1]?a[u-1].offsetTo:a[u].offsetFrom,d=c.length>5?c.substring(0,5):c;return{offset:d,milliseconds:je(d)}}let i=a[a.length-1].offsetTo,s=i.length>5?i.substring(0,5):i;return{offset:s,milliseconds:je(s)}}let o=Pi(e,t);if(!Number.isNaN(o)){let a=o<0,i=Math.abs(ai(o)),s=Math.abs(si(o))-i*60,u=i.toString().length===1?`0${i}`:i.toString(),c=s.toString().length===1?`0${s}`:s.toString();return{offset:`${a?"-":"+"}${u}${c}`,milliseconds:o}}};var x=(t,e)=>{if(t===void 0)return e;let r=t["~standard"].validate(e);if(r instanceof Promise)throw new TypeError("Schema validation must be synchronous");if(r.issues)throw new Error(JSON.stringify(r.issues,null,2));return r.value},Ni=(t,e)=>{var r,n,o,a;let i=((r=e.options)==null?void 0:r.VALUE)==="BINARY"?{type:"binary",encoding:((n=e.options)==null?void 0:n.ENCODING)||"BASE64",binary:e.value,value:(o=e.options)==null?void 0:o.VALUE}:{type:"uri",url:e.value,formatType:(a=e.options)==null?void 0:a.FMTTYPE};return x(t,i)},ee=t=>t.replace(/mailto:/gi,""),me=(t,e)=>{var r,n,o,a,i,s,u,c,d,f,l;return x(t,{email:ee(e.value),delegatedFrom:(r=e.options)!=null&&r["DELEGATED-FROM"]?ee((n=e.options)==null?void 0:n["DELEGATED-FROM"]):void 0,dir:(o=e.options)==null?void 0:o.DIR,member:(a=e.options)!=null&&a.MEMBER?ee(e.options.MEMBER):void 0,name:(i=e.options)==null?void 0:i.CN,partstat:(s=e.options)==null?void 0:s.PARTSTAT,role:(u=e.options)==null?void 0:u.ROLE,sentBy:(c=e.options)!=null&&c["SENT-BY"]?ee(e.options["SENT-BY"]):void 0,rsvp:(d=e.options)!=null&&d.RSVP?((f=e.options)==null?void 0:f.RSVP)==="TRUE"?!0:((l=e.options)==null?void 0:l.RSVP)==="FALSE"?!1:void 0:void 0})},he=(t,e)=>{let r=e.value,n={};r[0]==="-"&&(n.before=!0,r=r.slice(1)),r=r.slice(1);let o=r.split("T"),a=o[0];if(a.includes("D")){let[s,u]=a.split("D");n.days=Number(s),a=u}if(a.includes("W")){let[s,u]=a.split("W");n.weeks=Number(s),a=u}let i=o[1];if(i){if(i.includes("H")){let[s,u]=i.split("H");n.hours=Number(s),i=u}if(i.includes("M")){let[s,u]=i.split("M");n.minutes=Number(s),i=u}if(i.includes("S")){let[s,u]=i.split("S");n.seconds=Number(s),i=u}}return x(t,n)},Li=(t,e)=>{let r=Number.parseInt(e.value.slice(0,4),10),n=Number.parseInt(e.value.slice(4,6),10)-1,o=Number.parseInt(e.value.slice(6,8),10),a=new Date(Date.UTC(r,n,o));return x(t,a)},fe=(t,e)=>{let r=Number.parseInt(e.value.slice(0,4),10),n=Number.parseInt(e.value.slice(4,6),10)-1,o=Number.parseInt(e.value.slice(6,8),10),a=Number.parseInt(e.value.slice(9,11),10),i=Number.parseInt(e.value.slice(11,13),10),s=Number.parseInt(e.value.slice(13,15),10),u=new Date(Date.UTC(r,n,o,a,i,s));return x(t,u)},Ii=(t,e,r)=>{let n=je(r),o=fe(void 0,e),a=pi(o,n);return x(t,a)},Yi=(t,e)=>{var r,n,o,a,i,s;if(((r=t.options)==null?void 0:r.VALUE)==="DATE")return{date:Li(void 0,t),type:(n=t.options)==null?void 0:n.VALUE};let u=((o=t.options)==null?void 0:o.VALUE)||"DATE-TIME",c=fe(void 0,t);if(!((a=t.options)!=null&&a.TZID))return{date:c,type:u};let d=_i(c,t.options.TZID,e?.timezones);return d?{date:ke(c,-d.milliseconds),type:u,local:(i=t.options)!=null&&i.TZID?{date:c,timezone:(s=t.options)==null?void 0:s.TZID,tzoffset:d.offset}:void 0}:{date:c,type:u}},k=(t,e,r)=>x(t,Yi(e,r)),Ui=(t,e,r)=>{var n,o,a,i;let s=((n=e.options)==null?void 0:n.VALUE)==="DATE-TIME"||((o=e.options)==null?void 0:o.VALUE)==="DATE"?{type:"absolute",value:k(void 0,e,r),options:{related:(a=e.options)==null?void 0:a.RELATED}}:{type:"relative",value:he(void 0,e),options:{related:(i=e.options)==null?void 0:i.RELATED}};return x(t,s)},Ki=t=>t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t,ir=t=>t.map(e=>{let[r,...n]=e.split(vt),o=n.join(vt);return{property:r,value:Ki(o)}},{}),zi=t=>t.reduce((e,r)=>(e[r.property]=r.value,e),{}),Fi=t=>zi(ir(t)),Bi=t=>{let e=!1,r;for(let a=0;a<t.length&&r===void 0;a+=1)t.charAt(a)===Io&&(e=!e),t.charAt(a)===Lo&&!e&&(r=a);if(r===void 0)throw Error(`Line not valid: ${t}`);let n=t.substring(0,r),o=t.substring(r+1);return{property:n,value:o}},ji=t=>{let{property:e,value:r}=Bi(t);if(e.includes(Be)){let[n,...o]=e.split(Be),a=Fi(o);return{property:n,line:{options:a,value:r}}}return{property:e,line:{value:r}}},wt=t=>/^[ \t]/.test(t),Vi=t=>/^[A-Z]+(?:-[A-Z]+)*[:;]/.test(t),Wi=t=>{let e=[],r=t.split(Fe);for(;r[0]==="";)r.shift();let n=r.length;for(;n>0&&r[n-1]==="";)n-=1,r.pop();for(let o=0;o<r.length;){let a=r[o];for(o+=1;r[o]!==void 0&&(wt(r[o])||!Vi(r[o]));)r[o]===""?a+=gt:wt(r[o])?a+=r[o].substring(1):(a+=gt,a+=r[o]),o+=1;e.push(a)}return e.filter(o=>o!=="")},Hi=(t,e,r)=>{if(!e)return t;let n={};return Object.entries(e).forEach(([o,a])=>{let i=Object.entries(r||{}).find(([c,d])=>d.name===o);if(!i){n[$i(o)]=a.value;return}let s=i[1].convert(a),u=i[1].schema;if(!u){n[i[0]]=s;return}n[i[0]]=x(u,s)}),t.nonStandard=n,t},$i=t=>{let e=t.startsWith("X-")?t.slice(2):t,r="",n=!1;for(let o of e)o==="-"?n=!0:(r+=n?o.toUpperCase():o.toLowerCase(),n=!1);return r},qi=t=>t.startsWith("X-"),q=(t,e,r)=>{let n=e.replace(No(r?.icsComponent),""),o=[...new Set(Object.values(r.childComponents||{}).flatMap(({icsComponent:f})=>f))],a=Wi(o.reduce((f,l)=>f.replace(ht(l),""),n)),i=r.defaultValues||{},s={};a.forEach(f=>{var l,m;let{property:v,line:b}=ji(f);qi(v)&&(s[v]=b);let h=r.objectKeyMap[v];if(!h)return;let S=(l=r.convertArrayValues)==null?void 0:l[h];if(S){let L=S({line:b});if(!L)return;(i[h]===void 0||i[h]===null||!Array.isArray(i[h]))&&(i[h]=[]),Array.isArray(L)?i[h].push(...L):i[h].push(L);return}let N=(m=r.convertValues)==null?void 0:m[h];if(N){let L=N({line:b});if(!L)return;i[h]=L;return}i[h]=b.value});let u=r.childComponents,c=u?Object.keys(u||{}):[];u&&c.length>0&&c.forEach(f=>{let l=u?.[f];if(!l)return;let m=Array.isArray(l.icsComponent)?l.icsComponent:[l.icsComponent],v=[],b=[];m.forEach(h=>{b.push(...n.matchAll(ht(h)))}),b.map(h=>h[0]).forEach(h=>{let S=l.convert(h,{data:i});S&&v.push(S)}),v.length!==0&&(i[f]=v)});let d=x(t,i);return r!=null&&r.nonStandard?Hi(d,s,r?.nonStandard):d},Ce=(t,e)=>{var r,n,o;return x(t,{name:(r=e.options)==null?void 0:r.CN,dir:(n=e.options)==null?void 0:n.DIR,sentBy:(o=e.options)!=null&&o["SENT-BY"]?ee(e.options["SENT-BY"]):void 0,email:ee(e.value)})},$e=(t,e,r)=>{var n;return x(t,{value:k(void 0,e,r),range:(n=e.options)==null?void 0:n.RANGE})},Gi=t=>{if(t.length===2)return{day:t};let e=t.slice(0,-2);return{day:t.replace(e,""),occurrence:Number(e)}},Zi=(t,e)=>x(t,Gi(e.value)),Ji=(t,e)=>x(t,e.value),Qi=["until"],Xi=t=>Qi.includes(t),ea=["bySecond","byMinute","byHour","byMonthday","byYearday","byWeekNo","bySetPos"],ta=t=>ea.includes(t),ra=["byDay"],na=t=>ra.includes(t),oa=["count","interval"],ia=t=>oa.includes(t),Oe=(t,e,r)=>{let n={};return ir(e.value.split(Be)).forEach(o=>{let{property:a,value:i}=o,s=Nt[a];if(s){if(Xi(s)){n[s]=k(void 0,{value:i,options:{VALUE:i.includes("T")?"DATE-TIME":"DATE"}},{timezones:r?.timezones});return}if(ta(s)){n[s]=i.split(te).map(u=>Number(u));return}if(s==="byMonth"){n[s]=i.split(te).map(u=>Number(u)-1);return}if(na(s)){n[s]=i.split(te).map(u=>Zi(void 0,{value:u}));return}if(ia(s)){n[s]=Number(i);return}if(s==="frequency"){if(!i||!gi.includes(i))return;n[s]=i;return}if(s==="workweekStart"){n[s]=Ji(void 0,{value:i});return}}}),x(t,n)},qe=(t,e)=>x(t,e.value),aa=(t,e)=>x(t,e.value),Ge=(t,e,r)=>x(t,e.value.split(",").map(n=>k(void 0,{value:n,options:e.options},r))),sa=(t,e)=>x(t,e.value),ua=(t,e)=>x(t,e.value),ca=(t,e)=>x(t,e.value),pe=(t,e)=>x(t,Number.parseInt(e.value,10)),la=t=>t.replace(/\\(([,;\\])|([nN]))/g,(e,r,n)=>n||`
`),Y=(t,e)=>x(t,la(e.value)),da=(...t)=>{let[e,r,n]=t;return q(e,r,{icsComponent:Wt,objectKeyMap:At,convertValues:{trigger:({line:o})=>Ui(void 0,o,{timezones:n?.timezones}),duration:({line:o})=>he(void 0,o),repeat:({line:o})=>pe(void 0,o)},convertArrayValues:{attachments:({line:o})=>Ni(void 0,o),attendees:({line:o})=>me(void 0,o)},nonStandard:n?.nonStandard,timezones:n?.timezones})},ya=(...t)=>{let[e,r,n]=t,o,a=q(e,r,{icsComponent:Vt,objectKeyMap:Ct,convertValues:{stamp:({line:i})=>k(void 0,i,{timezones:n?.timezones}),start:({line:i})=>k(void 0,i,{timezones:n?.timezones}),end:({line:i})=>k(void 0,i,{timezones:n?.timezones}),created:({line:i})=>k(void 0,i,{timezones:n?.timezones}),lastModified:({line:i})=>k(void 0,i,{timezones:n?.timezones}),categories:({line:i})=>i.value.split(te),description:({line:i})=>{var s;return(s=i.options)!=null&&s.ALTREP&&(o=i.options.ALTREP),Y(void 0,i)},location:({line:i})=>Y(void 0,i),comment:({line:i})=>Y(void 0,i),summary:({line:i})=>Y(void 0,i),recurrenceRule:({line:i})=>Oe(void 0,i,{timezones:n?.timezones}),duration:({line:i})=>he(void 0,i),organizer:({line:i})=>Ce(void 0,i),sequence:({line:i})=>pe(void 0,i),class:({line:i})=>qe(void 0,i),recurrenceId:({line:i})=>$e(void 0,i,{timezones:n?.timezones}),status:({line:i})=>sa(void 0,i),timeTransparent:({line:i})=>aa(void 0,i)},convertArrayValues:{attendees:({line:i})=>me(void 0,i),exceptionDates:({line:i})=>Ge(void 0,i,{timezones:n?.timezones})},childComponents:{alarms:{icsComponent:Wt,convert:i=>da(void 0,i,{nonStandard:n?.nonStandard,timezones:n?.timezones})}},timezones:n?.timezones,nonStandard:n?.nonStandard});return o&&(a.descriptionAltRep=o),a},fa=(...t)=>{let[e,r,n]=t,o=r.split("BEGIN:")[1].split(Fe)[0],a=hi.includes(o)?o:"STANDARD",i=r.split("TZOFFSETTO:")[1].split(Fe)[0];return q(e,r,{icsComponent:a,objectKeyMap:Pt,defaultValues:{type:a},convertValues:{start:({line:s})=>Ii(void 0,s,i),recurrenceRule:({line:s})=>Oe(void 0,s,{timezones:n?.timezones}),recurrenceDate:({line:s})=>k(void 0,s,{timezones:n?.timezones})},nonStandard:n?.nonStandard,timezones:n?.timezones})},pa=(...t)=>{let[e,r,n]=t;return q(e,r,{icsComponent:jt,objectKeyMap:Mt,convertValues:{lastModified:({line:o})=>fe(void 0,o)},childComponents:{props:{icsComponent:["DAYLIGHT","STANDARD"],convert:o=>fa(void 0,o,{nonStandard:n?.nonStandard,timezones:n?.timezones})}},nonStandard:n?.nonStandard,timezones:n?.timezones})},ma=(...t)=>{let[e,r,n]=t;return q(e,r,{icsComponent:Ht,objectKeyMap:It,convertValues:{stamp:({line:o})=>k(void 0,o,{timezones:n?.timezones}),start:({line:o})=>k(void 0,o,{timezones:n?.timezones}),due:({line:o})=>k(void 0,o,{timezones:n?.timezones}),created:({line:o})=>k(void 0,o,{timezones:n?.timezones}),lastModified:({line:o})=>k(void 0,o,{timezones:n?.timezones}),completed:({line:o})=>k(void 0,o,{timezones:n?.timezones}),categories:({line:o})=>o.value.split(te),description:({line:o})=>Y(void 0,o),location:({line:o})=>Y(void 0,o),comment:({line:o})=>Y(void 0,o),summary:({line:o})=>Y(void 0,o),recurrenceRule:({line:o})=>Oe(void 0,o,{timezones:n?.timezones}),duration:({line:o})=>he(void 0,o),organizer:({line:o})=>Ce(void 0,o),sequence:({line:o})=>pe(void 0,o),percentComplete:({line:o})=>pe(void 0,o),class:({line:o})=>qe(void 0,o),recurrenceId:({line:o})=>$e(void 0,o,{timezones:n?.timezones}),status:({line:o})=>ua(void 0,o)},convertArrayValues:{attendees:({line:o})=>me(void 0,o),exceptionDates:({line:o})=>Ge(void 0,o,{timezones:n?.timezones})},nonStandard:n?.nonStandard,timezones:n?.timezones})},ha=(...t)=>{let[e,r,n]=t;return q(e,r,{icsComponent:$t,objectKeyMap:Ut,convertValues:{stamp:({line:o})=>k(void 0,o,{timezones:n?.timezones}),start:({line:o})=>k(void 0,o,{timezones:n?.timezones}),created:({line:o})=>k(void 0,o,{timezones:n?.timezones}),lastModified:({line:o})=>k(void 0,o,{timezones:n?.timezones}),categories:({line:o})=>o.value.split(te),description:({line:o})=>Y(void 0,o),comment:({line:o})=>Y(void 0,o),summary:({line:o})=>Y(void 0,o),recurrenceRule:({line:o})=>Oe(void 0,o,{timezones:n?.timezones}),organizer:({line:o})=>Ce(void 0,o),sequence:({line:o})=>pe(void 0,o),class:({line:o})=>qe(void 0,o),recurrenceId:({line:o})=>$e(void 0,o,{timezones:n?.timezones}),status:({line:o})=>ca(void 0,o)},convertArrayValues:{attendees:({line:o})=>me(void 0,o),exceptionDates:({line:o})=>Ge(void 0,o,{timezones:n?.timezones})},nonStandard:n?.nonStandard,timezones:n?.timezones})},ga=(t,e)=>{var r;return x(t,{type:(r=e.options)==null?void 0:r.FBTYPE,values:e.value.split(",").map(n=>{let[o,a]=n.split("/"),i=fe(void 0,{value:o});if(a.startsWith("PT")){let u=he(void 0,{value:a});return{start:i,duration:u}}let s=fe(void 0,{value:a});return{start:i,end:s}})})},va=(...t)=>{let[e,r,n]=t;return q(e,r,{icsComponent:qt,objectKeyMap:zt,convertValues:{stamp:({line:o})=>k(void 0,o,{timezones:n?.timezones}),start:({line:o})=>k(void 0,o,{timezones:n?.timezones}),end:({line:o})=>k(void 0,o,{timezones:n?.timezones}),comment:({line:o})=>Y(void 0,o),organizer:({line:o})=>Ce(void 0,o)},convertArrayValues:{attendees:({line:o})=>me(void 0,o),freeBusy:({line:o})=>ga(void 0,o)},nonStandard:n?.nonStandard,timezones:n?.timezones})},ar=(...t)=>{let[e,r,n]=t;return q(e,r,{icsComponent:Ro,objectKeyMap:kt,convertValues:{version:({line:o})=>o.value},childComponents:{timezones:{icsComponent:jt,convert:o=>pa(void 0,o,{nonStandard:n?.nonStandard})},events:{icsComponent:Vt,convert:(o,{data:a})=>ya(void 0,o,{nonStandard:n?.nonStandard,timezones:a.timezones})},todos:{icsComponent:Ht,convert:(o,{data:a})=>ma(void 0,o,{nonStandard:n?.nonStandard,timezones:a.timezones})},journals:{icsComponent:$t,convert:(o,{data:a})=>ha(void 0,o,{nonStandard:n?.nonStandard,timezones:a.timezones})},freeBusy:{icsComponent:qt,convert:(o,{data:a})=>va(void 0,o,{nonStandard:n?.nonStandard,timezones:a.timezones})}},nonStandard:n?.nonStandard})};var Ze=function(t,e){return Ze=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},Ze(t,e)};function re(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ze(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var M=function(){return M=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},M.apply(this,arguments)};function p(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,a;n<o;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var Xe=["MO","TU","WE","TH","FR","SA","SU"],_=function(){function t(e,r){if(r===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=r}return t.fromStr=function(e){return new t(Xe.indexOf(e))},t.prototype.nth=function(e){return this.n===e?this:new t(this.weekday,e)},t.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},t.prototype.toString=function(){var e=Xe[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},t.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},t}(),D=function(t){return t!=null},F=function(t){return typeof t=="number"},sr=function(t){return typeof t=="string"&&Xe.includes(t)},I=Array.isArray,j=function(t,e){e===void 0&&(e=t),arguments.length===1&&(e=t,t=0);for(var r=[],n=t;n<e;n++)r.push(n);return r},T=function(t,e){var r=0,n=[];if(I(t))for(;r<e;r++)n[r]=[].concat(t);else for(;r<e;r++)n[r]=t;return n},ba=function(t){return I(t)?t:[t]};function ne(t,e,r){r===void 0&&(r=" ");var n=String(t);return e=e>>0,n.length>e?String(n):(e=e-n.length,e>r.length&&(r+=T(r,e/r.length)),r.slice(0,e)+String(n))}var Ea=function(t,e,r){var n=t.split(e);return r?n.slice(0,r).concat([n.slice(r).join(e)]):n},K=function(t,e){var r=t%e;return r*e<0?r+e:r},Je=function(t,e){return{div:Math.floor(t/e),mod:K(t,e)}},B=function(t){return!D(t)||t.length===0},O=function(t){return!B(t)},A=function(t,e){return O(t)&&t.indexOf(e)!==-1},Q=function(t,e,r,n,o,a){return n===void 0&&(n=0),o===void 0&&(o=0),a===void 0&&(a=0),new Date(Date.UTC(t,e-1,r,n,o,a))},Ta=[31,28,31,30,31,30,31,31,30,31,30,31],Ar=1e3*60*60*24,xr=9999,kr=Q(1970,1,1),wa=[6,0,1,2,3,4,5],ve=function(t){return t%4===0&&t%100!==0||t%400===0},Dr=function(t){return t instanceof Date},ge=function(t){return Dr(t)&&!isNaN(t.getTime())},Sa=function(t,e){var r=t.getTime(),n=e.getTime(),o=r-n;return Math.round(o/Ar)},et=function(t){return Sa(t,kr)},Cr=function(t){return new Date(kr.getTime()+t*Ar)},Aa=function(t){var e=t.getUTCMonth();return e===1&&ve(t.getUTCFullYear())?29:Ta[e]},ae=function(t){return wa[t.getUTCDay()]},ur=function(t,e){var r=Q(t,e+1,1);return[ae(r),Aa(r)]},Or=function(t,e){return e=e||t,new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))},tt=function(t){var e=new Date(t.getTime());return e},cr=function(t){for(var e=[],r=0;r<t.length;r++)e.push(tt(t[r]));return e},be=function(t){t.sort(function(e,r){return e.getTime()-r.getTime()})},ot=function(t,e){e===void 0&&(e=!0);var r=new Date(t);return[ne(r.getUTCFullYear().toString(),4,"0"),ne(r.getUTCMonth()+1,2,"0"),ne(r.getUTCDate(),2,"0"),"T",ne(r.getUTCHours(),2,"0"),ne(r.getUTCMinutes(),2,"0"),ne(r.getUTCSeconds(),2,"0"),e?"Z":""].join("")},it=function(t){var e=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/,r=e.exec(t);if(!r)throw new Error("Invalid UNTIL value: ".concat(t));return new Date(Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[5],10)||0,parseInt(r[6],10)||0,parseInt(r[7],10)||0))},lr=function(t,e){var r=t.toLocaleString("sv-SE",{timeZone:e});return r.replace(" ","T")+"Z"},xa=function(t,e){var r=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date(lr(t,r)),o=new Date(lr(t,e??"UTC")),a=o.getTime()-n.getTime();return new Date(t.getTime()-a)},ka=function(){function t(e,r){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=r,e==="between"?(this.maxDate=r.inc?r.before:new Date(r.before.getTime()-1),this.minDate=r.inc?r.after:new Date(r.after.getTime()+1)):e==="before"?this.maxDate=r.inc?r.dt:new Date(r.dt.getTime()-1):e==="after"&&(this.minDate=r.inc?r.dt:new Date(r.dt.getTime()+1))}return t.prototype.accept=function(e){++this.total;var r=this.minDate&&e<this.minDate,n=this.maxDate&&e>this.maxDate;if(this.method==="between"){if(r)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return r?!0:(this.add(e),!1);return this.add(e)},t.prototype.add=function(e){return this._result.push(e),!0},t.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}},t.prototype.clone=function(){return new t(this.method,this.args)},t}(),ie=ka,Da=function(t){re(e,t);function e(r,n,o){var a=t.call(this,r,n)||this;return a.iterator=o,a}return e.prototype.add=function(r){return this.iterator(r,this._result.length)?(this._result.push(r),!0):!1},e}(ie),dr=Da,Ca={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}},Me=Ca,yr=function(t,e){return t.indexOf(e)!==-1},Oa=function(t){return t.toString()},Ma=function(t,e,r){return"".concat(e," ").concat(r,", ").concat(t)},Ra=function(){function t(e,r,n,o){if(r===void 0&&(r=Oa),n===void 0&&(n=Me),o===void 0&&(o=Ma),this.text=[],this.language=n||Me,this.gettext=r,this.dateFormatter=o,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var a=[].concat(this.options.bymonthday),i=[].concat(this.options.bynmonthday);a.sort(function(d,f){return d-f}),i.sort(function(d,f){return f-d}),this.bymonthday=a.concat(i),this.bymonthday.length||(this.bymonthday=null)}if(D(this.origOptions.byweekday)){var s=I(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],u=String(s);this.byweekday={allWeeks:s.filter(function(d){return!d.n}),someWeeks:s.filter(function(d){return!!d.n}),isWeekdays:u.indexOf("MO")!==-1&&u.indexOf("TU")!==-1&&u.indexOf("WE")!==-1&&u.indexOf("TH")!==-1&&u.indexOf("FR")!==-1&&u.indexOf("SA")===-1&&u.indexOf("SU")===-1,isEveryDay:u.indexOf("MO")!==-1&&u.indexOf("TU")!==-1&&u.indexOf("WE")!==-1&&u.indexOf("TH")!==-1&&u.indexOf("FR")!==-1&&u.indexOf("SA")!==-1&&u.indexOf("SU")!==-1};var c=function(d,f){return d.weekday-f.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 t.isFullyConvertible=function(e){var r=!0;if(!(e.options.freq in t.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var n in e.origOptions){if(yr(["dtstart","tzid","wkst","freq"],n))return!0;if(!yr(t.IMPLEMENTED[e.options.freq],n))return!1}return r},t.prototype.isFullyConvertible=function(){return t.isFullyConvertible(this.rrule)},t.prototype.toString=function(){var e=this.gettext;if(!(this.options.freq in t.IMPLEMENTED))return e("RRule error: Unable to fully convert this rrule to text");if(this.text=[e("every")],this[g.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var r=this.options.until;this.add(this.dateFormatter(r.getUTCFullYear(),this.language.monthNames[r.getUTCMonth()],r.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("")},t.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"))},t.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"))},t.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()},t.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())},t.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()},t.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")))},t.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")))},t.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"))))},t.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},t.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},t.prototype.nth=function(e){e=parseInt(e.toString(),10);var r,n=this.gettext;if(e===-1)return n("last");var o=Math.abs(e);switch(o){case 1:case 21:case 31:r=o+n("st");break;case 2:case 22:r=o+n("nd");break;case 3:case 23:r=o+n("rd");break;default:r=o+n("th")}return e<0?r+" "+n("last"):r},t.prototype.monthtext=function(e){return this.language.monthNames[e-1]},t.prototype.weekdaytext=function(e){var r=F(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[r]},t.prototype.plural=function(e){return e%100!==1},t.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},t.prototype.list=function(e,r,n,o){var a=this;o===void 0&&(o=","),I(e)||(e=[e]);var i=function(u,c,d){for(var f="",l=0;l<u.length;l++)l!==0&&(l===u.length-1?f+=" "+d+" ":f+=c+" "),f+=u[l];return f};r=r||function(u){return u.toString()};var s=function(u){return r&&r.call(a,u)};return n?i(e.map(s),o,n):e.map(s).join(o+" ")},t}(),W=Ra,Pa=function(){function t(e){this.done=!0,this.rules=e}return t.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},t.prototype.isDone=function(){return this.done&&this.symbol===null},t.prototype.nextSymbol=function(){var e,r;this.symbol=null,this.value=null;do{if(this.done)return!1;var n=void 0;e=null;for(var o in this.rules){n=this.rules[o];var a=n.exec(this.text);a&&(e===null||a[0].length>e[0].length)&&(e=a,r=o)}if(e!=null&&(this.text=this.text.substr(e[0].length),this.text===""&&(this.done=!0)),e==null){this.done=!0,this.symbol=null,this.value=null;return}}while(r==="SKIP");return this.symbol=r,this.value=e,!0},t.prototype.accept=function(e){if(this.symbol===e){if(this.value){var r=this.value;return this.nextSymbol(),r}return this.nextSymbol(),!0}return!1},t.prototype.acceptNumber=function(){return this.accept("number")},t.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},t}();function Mr(t,e){e===void 0&&(e=Me);var r={},n=new Pa(e.tokens);if(!n.start(t))return null;return o(),r;function o(){n.expect("every");var l=n.acceptNumber();if(l&&(r.interval=parseInt(l[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":r.freq=g.DAILY,n.nextSymbol()&&(i(),f());break;case"weekday(s)":r.freq=g.WEEKLY,r.byweekday=[g.MO,g.TU,g.WE,g.TH,g.FR],n.nextSymbol(),i(),f();break;case"week(s)":r.freq=g.WEEKLY,n.nextSymbol()&&(a(),i(),f());break;case"hour(s)":r.freq=g.HOURLY,n.nextSymbol()&&(a(),f());break;case"minute(s)":r.freq=g.MINUTELY,n.nextSymbol()&&(a(),f());break;case"month(s)":r.freq=g.MONTHLY,n.nextSymbol()&&(a(),f());break;case"year(s)":r.freq=g.YEARLY,n.nextSymbol()&&(a(),f());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":r.freq=g.WEEKLY;var m=n.symbol.substr(0,2).toUpperCase();if(r.byweekday=[g[m]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var v=u();if(!v)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");r.byweekday.push(g[v]),n.nextSymbol()}i(),d(),f();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(r.freq=g.YEARLY,r.bymonth=[s()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var b=s();if(!b)throw new Error("Unexpected symbol "+n.symbol+", expected month");r.bymonth.push(b),n.nextSymbol()}a(),f();break;default:throw new Error("Unknown symbol")}}function a(){var l=n.accept("on"),m=n.accept("the");if(l||m)do{var v=c(),b=u(),h=s();if(v)b?(n.nextSymbol(),r.byweekday||(r.byweekday=[]),r.byweekday.push(g[b].nth(v))):(r.bymonthday||(r.bymonthday=[]),r.bymonthday.push(v),n.accept("day(s)"));else if(b)n.nextSymbol(),r.byweekday||(r.byweekday=[]),r.byweekday.push(g[b]);else if(n.symbol==="weekday(s)")n.nextSymbol(),r.byweekday||(r.byweekday=[g.MO,g.TU,g.WE,g.TH,g.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var S=n.acceptNumber();if(!S)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(r.byweekno=[parseInt(S[0],10)];n.accept("comma");){if(S=n.acceptNumber(),!S)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");r.byweekno.push(parseInt(S[0],10))}}else if(h)n.nextSymbol(),r.bymonth||(r.bymonth=[]),r.bymonth.push(h);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function i(){var l=n.accept("at");if(l)do{var m=n.acceptNumber();if(!m)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(r.byhour=[parseInt(m[0],10)];n.accept("comma");){if(m=n.acceptNumber(),!m)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");r.byhour.push(parseInt(m[0],10))}}while(n.accept("comma")||n.accept("at"))}function s(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function u(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function c(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var l=parseInt(n.value[1],10);if(l<-366||l>366)throw new Error("Nth out of range: "+l);return n.nextSymbol(),n.accept("last")?-l:l;default:return!1}}function d(){n.accept("on"),n.accept("the");var l=c();if(l)for(r.bymonthday=[l],n.nextSymbol();n.accept("comma");){if(l=c(),!l)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");r.bymonthday.push(l),n.nextSymbol()}}function f(){if(n.symbol==="until"){var l=Date.parse(n.text);if(!l)throw new Error("Cannot parse until date:"+n.text);r.until=new Date(l)}else n.accept("for")&&(r.count=parseInt(n.value[0],10),n.expect("number"))}}var w;(function(t){t[t.YEARLY=0]="YEARLY",t[t.MONTHLY=1]="MONTHLY",t[t.WEEKLY=2]="WEEKLY",t[t.DAILY=3]="DAILY",t[t.HOURLY=4]="HOURLY",t[t.MINUTELY=5]="MINUTELY",t[t.SECONDLY=6]="SECONDLY"})(w||(w={}));function at(t){return t<w.HOURLY}var _a=function(t,e){return e===void 0&&(e=Me),new g(Mr(t,e)||void 0)},se=["count","until","interval","byweekday","bymonthday","bymonth"];W.IMPLEMENTED=[];W.IMPLEMENTED[w.HOURLY]=se;W.IMPLEMENTED[w.MINUTELY]=se;W.IMPLEMENTED[w.DAILY]=["byhour"].concat(se);W.IMPLEMENTED[w.WEEKLY]=se;W.IMPLEMENTED[w.MONTHLY]=se;W.IMPLEMENTED[w.YEARLY]=["byweekno","byyearday"].concat(se);var Na=function(t,e,r,n){return new W(t,e,r,n).toString()},La=W.isFullyConvertible,Re=function(){function t(e,r,n,o){this.hour=e,this.minute=r,this.second=n,this.millisecond=o||0}return t.prototype.getHours=function(){return this.hour},t.prototype.getMinutes=function(){return this.minute},t.prototype.getSeconds=function(){return this.second},t.prototype.getMilliseconds=function(){return this.millisecond},t.prototype.getTime=function(){return(this.hour*60*60+this.minute*60+this.second)*1e3+this.millisecond},t}(),Ia=function(t){re(e,t);function e(r,n,o,a,i,s,u){var c=t.call(this,a,i,s,u)||this;return c.year=r,c.month=n,c.day=o,c}return e.fromDate=function(r){return new this(r.getUTCFullYear(),r.getUTCMonth()+1,r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.valueOf()%1e3)},e.prototype.getWeekday=function(){return ae(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(r){this.year+=r},e.prototype.addMonths=function(r){if(this.month+=r,this.month>12){var n=Math.floor(this.month/12),o=K(this.month,12);this.month=o,this.year+=n,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(r,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+r*7:this.day+=-(this.getWeekday()-n)+r*7,this.fixDay()},e.prototype.addDaily=function(r){this.day+=r,this.fixDay()},e.prototype.addHours=function(r,n,o){for(n&&(this.hour+=Math.floor((23-this.hour)/r)*r);;){this.hour+=r;var a=Je(this.hour,24),i=a.div,s=a.mod;if(i&&(this.hour=s,this.addDaily(i)),B(o)||A(o,this.hour))break}},e.prototype.addMinutes=function(r,n,o,a){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/r)*r);;){this.minute+=r;var i=Je(this.minute,60),s=i.div,u=i.mod;if(s&&(this.minute=u,this.addHours(s,!1,o)),(B(o)||A(o,this.hour))&&(B(a)||A(a,this.minute)))break}},e.prototype.addSeconds=function(r,n,o,a,i){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/r)*r);;){this.second+=r;var s=Je(this.second,60),u=s.div,c=s.mod;if(u&&(this.second=c,this.addMinutes(u,!1,o,a)),(B(o)||A(o,this.hour))&&(B(a)||A(a,this.minute))&&(B(i)||A(i,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var r=ur(this.year,this.month-1)[1];if(!(this.day<=r))for(;this.day>r;){if(this.day-=r,++this.month,this.month===13&&(this.month=1,++this.year,this.year>xr))return;r=ur(this.year,this.month-1)[1]}}},e.prototype.add=function(r,n){var o=r.freq,a=r.interval,i=r.wkst,s=r.byhour,u=r.byminute,c=r.bysecond;switch(o){case w.YEARLY:return this.addYears(a);case w.MONTHLY:return this.addMonths(a);case w.WEEKLY:return this.addWeekly(a,i);case w.DAILY:return this.addDaily(a);case w.HOURLY:return this.addHours(a,n,s);case w.MINUTELY:return this.addMinutes(a,n,s,u);case w.SECONDLY:return this.addSeconds(a,n,s,u,c)}},e}(Re);function Rr(t){for(var e=[],r=Object.keys(t),n=0,o=r;n<o.length;n++){var a=o[n];A(fs,a)||e.push(a),Dr(t[a])&&!ge(t[a])&&e.push(a)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return M({},t)}function Ya(t){var e=M(M({},st),Rr(t));if(D(e.byeaster)&&(e.freq=g.YEARLY),!(D(e.freq)&&g.FREQUENCIES[e.freq]))throw new Error("Invalid frequency: ".concat(e.freq," ").concat(t.freq));if(e.dtstart||(e.dtstart=new Date(new Date().setMilliseconds(0))),D(e.wkst)?F(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=g.MO.weekday,D(e.bysetpos)){F(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var r=0;r<e.bysetpos.length;r++){var n=e.bysetpos[r];if(n===0||!(n>=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(e.byweekno||O(e.byweekno)||O(e.byyearday)||e.bymonthday||O(e.bymonthday)||D(e.byweekday)||D(e.byeaster)))switch(e.freq){case g.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case g.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case g.WEEKLY:e.byweekday=[ae(e.dtstart)];break}if(D(e.bymonth)&&!I(e.bymonth)&&(e.bymonth=[e.bymonth]),D(e.byyearday)&&!I(e.byyearday)&&F(e.byyearday)&&(e.byyearday=[e.byyearday]),!D(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(I(e.bymonthday)){for(var o=[],a=[],r=0;r<e.bymonthday.length;r++){var n=e.bymonthday[r];n>0?o.push(n):n<0&&a.push(n)}e.bymonthday=o,e.bynmonthday=a}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(D(e.byweekno)&&!I(e.byweekno)&&(e.byweekno=[e.byweekno]),!D(e.byweekday))e.bynweekday=null;else if(F(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(sr(e.byweekday))e.byweekday=[_.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof _)!e.byweekday.n||e.freq>g.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var i=[],s=[],r=0;r<e.byweekday.length;r++){var u=e.byweekday[r];if(F(u)){i.push(u);continue}else if(sr(u)){i.push(_.fromStr(u).weekday);continue}!u.n||e.freq>g.MONTHLY?i.push(u.weekday):s.push([u.weekday,u.n])}e.byweekday=O(i)?i:null,e.bynweekday=O(s)?s:null}return D(e.byhour)?F(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<g.HOURLY?[e.dtstart.getUTCHours()]:null,D(e.byminute)?F(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<g.MINUTELY?[e.dtstart.getUTCMinutes()]:null,D(e.bysecond)?F(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<g.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function Ua(t){var e=t.dtstart.getTime()%1e3;if(!at(t.freq))return[];var r=[];return t.byhour.forEach(function(n){t.byminute.forEach(function(o){t.bysecond.forEach(function(a){r.push(new Re(n,o,a,e))})})}),r}function rt(t){var e=t.split(`
`).map(Ka).filter(function(r){return r!==null});return M(M({},e[0]),e[1])}function Pe(t){var e={},r=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);if(!r)return e;var n=r[1],o=r[2];return n&&(e.tzid=n),e.dtstart=it(o),e}function Ka(t){if(t=t.replace(/^\s+|\s+$/,""),!t.length)return null;var e=/^([A-Z]+?)[:;]/.exec(t.toUpperCase());if(!e)return fr(t);var r=e[1];switch(r.toUpperCase()){case"RRULE":case"EXRULE":return fr(t);case"DTSTART":return Pe(t);default:throw new Error("Unsupported RFC prop ".concat(r," in ").concat(t))}}function fr(t){var e=t.replace(/^RRULE:/i,""),r=Pe(e),n=t.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(o){var a=o.split("="),i=a[0],s=a[1];switch(i.toUpperCase()){case"FREQ":r.freq=w[s.toUpperCase()];break;case"WKST":r.wkst=z[s.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var u=za(s),c=i.toLowerCase();r[c]=u;break;case"BYWEEKDAY":case"BYDAY":r.byweekday=Fa(s);break;case"DTSTART":case"TZID":var d=Pe(t);r.tzid=d.tzid,r.dtstart=d.dtstart;break;case"UNTIL":r.until=it(s);break;case"BYEASTER":r.byeaster=Number(s);break;default:throw new Error("Unknown RRULE property '"+i+"'")}}),r}function za(t){if(t.indexOf(",")!==-1){var e=t.split(",");return e.map(pr)}return pr(t)}function pr(t){return/^[+-]?\d+$/.test(t)?Number(t):t}function Fa(t){var e=t.split(",");return e.map(function(r){if(r.length===2)return z[r];var n=r.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!n||n.length<3)throw new SyntaxError("Invalid weekday string: ".concat(r));var o=Number(n[1]),a=n[2],i=z[a].weekday;return new _(i,o)})}var _e=function(){function t(e,r){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=r}return Object.defineProperty(t.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),t.prototype.toString=function(){var e=ot(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},t.prototype.getTime=function(){return this.date.getTime()},t.prototype.rezonedDate=function(){return this.isUTC?this.date:xa(this.date,this.tzid)},t}();function nt(t){for(var e=[],r="",n=Object.keys(t),o=Object.keys(st),a=0;a<n.length;a++)if(n[a]!=="tzid"&&A(o,n[a])){var i=n[a].toUpperCase(),s=t[n[a]],u="";if(!(!D(s)||I(s)&&!s.length)){switch(i){case"FREQ":u=g.FREQUENCIES[t.freq];break;case"WKST":F(s)?u=new _(s).toString():u=s.toString();break;case"BYWEEKDAY":i="BYDAY",u=ba(s).map(function(m){return m instanceof _?m:I(m)?new _(m[0],m[1]):new _(m)}).toString();break;case"DTSTART":r=Ba(s,t.tzid);break;case"UNTIL":u=ot(s,!t.tzid);break;default:if(I(s)){for(var c=[],d=0;d<s.length;d++)c[d]=String(s[d]);u=c.toString()}else u=String(s)}u&&e.push([i,u])}}var f=e.map(function(m){var v=m[0],b=m[1];return"".concat(v,"=").concat(b.toString())}).join(";"),l="";return f!==""&&(l="RRULE:".concat(f)),[r,l].filter(function(m){return!!m}).join(`
`)}function Ba(t,e){return t?"DTSTART"+new _e(new Date(t),e).toString():""}function ja(t,e){return Array.isArray(t)?!Array.isArray(e)||t.length!==e.length?!1:t.every(function(r,n){return r.getTime()===e[n].getTime()}):t instanceof Date?e instanceof Date&&t.getTime()===e.getTime():t===e}var Va=function(){function t(){this.all=!1,this.before=[],this.after=[],this.between=[]}return t.prototype._cacheAdd=function(e,r,n){r&&(r=r instanceof Date?tt(r):cr(r)),e==="all"?this.all=r:(n._value=r,this[e].push(n))},t.prototype._cacheGet=function(e,r){var n=!1,o=r?Object.keys(r):[],a=function(d){for(var f=0;f<o.length;f++){var l=o[f];if(!ja(r[l],d[l]))return!0}return!1},i=this[e];if(e==="all")n=this.all;else if(I(i))for(var s=0;s<i.length;s++){var u=i[s];if(!(o.length&&a(u))){n=u._value;break}}if(!n&&this.all){for(var c=new ie(e,r),s=0;s<this.all.length&&c.accept(this.all[s]);s++);n=c.getValue(),this._cacheAdd(e,n,r)}return I(n)?cr(n):n instanceof Date?tt(n):n},t}(),Wa=p(p(p(p(p(p(p(p(p(p(p(p(p([],T(1,31),!0),T(2,28),!0),T(3,31),!0),T(4,30),!0),T(5,31),!0),T(6,30),!0),T(7,31),!0),T(8,31),!0),T(9,30),!0),T(10,31),!0),T(11,30),!0),T(12,31),!0),T(1,7),!0),Ha=p(p(p(p(p(p(p(p(p(p(p(p(p([],T(1,31),!0),T(2,29),!0),T(3,31),!0),T(4,30),!0),T(5,31),!0),T(6,30),!0),T(7,31),!0),T(8,31),!0),T(9,30),!0),T(10,31),!0),T(11,30),!0),T(12,31),!0),T(1,7),!0),$a=j(1,29),qa=j(1,30),G=j(1,31),R=j(1,32),Ga=p(p(p(p(p(p(p(p(p(p(p(p(p([],R,!0),qa,!0),R,!0),G,!0),R,!0),G,!0),R,!0),R,!0),G,!0),R,!0),G,!0),R,!0),R.slice(0,7),!0),Za=p(p(p(p(p(p(p(p(p(p(p(p(p([],R,!0),$a,!0),R,!0),G,!0),R,!0),G,!0),R,!0),R,!0),G,!0),R,!0),G,!0),R,!0),R.slice(0,7),!0),Ja=j(-28,0),Qa=j(-29,0),Z=j(-30,0),P=j(-31,0),Xa=p(p(p(p(p(p(p(p(p(p(p(p(p([],P,!0),Qa,!0),P,!0),Z,!0),P,!0),Z,!0),P,!0),P,!0),Z,!0),P,!0),Z,!0),P,!0),P.slice(0,7),!0),es=p(p(p(p(p(p(p(p(p(p(p(p(p([],P,!0),Ja,!0),P,!0),Z,!0),P,!0),Z,!0),P,!0),P,!0),Z,!0),P,!0),Z,!0),P,!0),P.slice(0,7),!0),ts=[0,31,60,91,121,152,182,213,244,274,305,335,366],rs=[0,31,59,90,120,151,181,212,243,273,304,334,365],mr=function(){for(var t=[],e=0;e<55;e++)t=t.concat(j(7));return t}();function ns(t,e){var r=Q(t,1,1),n=ve(t)?366:365,o=ve(t+1)?366:365,a=et(r),i=ae(r),s=M(M({yearlen:n,nextyearlen:o,yearordinal:a,yearweekday:i},os(t)),{wnomask:null});if(B(e.byweekno))return s;s.wnomask=T(0,n+7);var u,c,d=u=K(7-i+e.wkst,7);d>=4?(d=0,c=s.yearlen+K(i-e.wkst,7)):c=n-d;for(var f=Math.floor(c/7),l=K(c,7),m=Math.floor(f+l/4),v=0;v<e.byweekno.length;v++){var b=e.byweekno[v];if(b<0&&(b+=m+1),b>0&&b<=m){var h=void 0;b>1?(h=d+(b-1)*7,d!==u&&(h-=7-u)):h=d;for(var S=0;S<7&&(s.wnomask[h]=1,h++,s.wdaymask[h]!==e.wkst);S++);}}if(A(e.byweekno,1)){var h=d+m*7;if(d!==u&&(h-=7-u),h<n)for(var v=0;v<7&&(s.wnomask[h]=1,h+=1,s.wdaymask[h]!==e.wkst);v++);}if(d){var N=void 0;if(A(e.byweekno,-1))N=-1;else{var L=ae(Q(t-1,1,1)),ue=K(7-L.valueOf()+e.wkst,7),Ne=ve(t-1)?366:365,J=void 0;ue>=4?(ue=0,J=Ne+K(L-e.wkst,7)):J=n-d,N=Math.floor(52+K(J,7)/4)}if(A(e.byweekno,N))for(var h=0;h<d;h++)s.wnomask[h]=1}return s}function os(t){var e=ve(t)?366:365,r=Q(t,1,1),n=ae(r);return e===365?{mmask:Wa,mdaymask:Za,nmdaymask:es,wdaymask:mr.slice(n),mrange:rs}:{mmask:Ha,mdaymask:Ga,nmdaymask:Xa,wdaymask:mr.slice(n),mrange:ts}}function is(t,e,r,n,o,a){var i={lastyear:t,lastmonth:e,nwdaymask:[]},s=[];if(a.freq===g.YEARLY)if(B(a.bymonth))s=[[0,r]];else for(var u=0;u<a.bymonth.length;u++)e=a.bymonth[u],s.push(n.slice(e-1,e+1));else a.freq===g.MONTHLY&&(s=[n.slice(e-1,e+1)]);if(B(s))return i;i.nwdaymask=T(0,r);for(var u=0;u<s.length;u++)for(var c=s[u],d=c[0],f=c[1]-1,l=0;l<a.bynweekday.length;l++){var m=void 0,v=a.bynweekday[l],b=v[0],h=v[1];h<0?(m=f+(h+1)*7,m-=K(o[m]-b,7)):(m=d+(h-1)*7,m+=K(7-o[m]+b,7)),d<=m&&m<=f&&(i.nwdaymask[m]=1)}return i}function as(t,e){e===void 0&&(e=0);var r=t%19,n=Math.floor(t/100),o=t%100,a=Math.floor(n/4),i=n%4,s=Math.floor((n+8)/25),u=Math.floor((n-s+1)/3),c=Math.floor(19*r+n-a-u+15)%30,d=Math.floor(o/4),f=o%4,l=Math.floor(32+2*i+2*d-c-f)%7,m=Math.floor((r+11*c+22*l)/451),v=Math.floor((c+l-7*m+114)/31),b=(c+l-7*m+114)%31+1,h=Date.UTC(t,v-1,b+e),S=Date.UTC(t,0,1);return[Math.ceil((h-S)/(1e3*60*60*24))]}var ss=function(){function t(e){this.options=e}return t.prototype.rebuild=function(e,r){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=ns(e,n)),O(n.bynweekday)&&(r!==this.lastmonth||e!==this.lastyear)){var o=this.yearinfo,a=o.yearlen,i=o.mrange,s=o.wdaymask;this.monthinfo=is(e,r,a,i,s,n)}D(n.byeaster)&&(this.eastermask=as(e,n.byeaster))},Object.defineProperty(t.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),t.prototype.ydayset=function(){return[j(this.yearlen),0,this.yearlen]},t.prototype.mdayset=function(e,r){for(var n=this.mrange[r-1],o=this.mrange[r],a=T(null,this.yearlen),i=n;i<o;i++)a[i]=i;return[a,n,o]},t.prototype.wdayset=function(e,r,n){for(var o=T(null,this.yearlen+7),a=et(Q(e,r,n))-this.yearordinal,i=a,s=0;s<7&&(o[a]=a,++a,this.wdaymask[a]!==this.options.wkst);s++);return[o,i,a]},t.prototype.ddayset=function(e,r,n){var o=T(null,this.yearlen),a=et(Q(e,r,n))-this.yearordinal;return o[a]=a,[o,a,a+1]},t.prototype.htimeset=function(e,r,n,o){var a=this,i=[];return this.options.byminute.forEach(function(s){i=i.concat(a.mtimeset(e,s,n,o))}),be(i),i},t.prototype.mtimeset=function(e,r,n,o){var a=this.options.bysecond.map(function(i){return new Re(e,r,i,o)});return be(a),a},t.prototype.stimeset=function(e,r,n,o){return[new Re(e,r,n,o)]},t.prototype.getdayset=function(e){switch(e){case w.YEARLY:return this.ydayset.bind(this);case w.MONTHLY:return this.mdayset.bind(this);case w.WEEKLY:return this.wdayset.bind(this);case w.DAILY:return this.ddayset.bind(this);default:return this.ddayset.bind(this)}},t.prototype.gettimeset=function(e){switch(e){case w.HOURLY:return this.htimeset.bind(this);case w.MINUTELY:return this.mtimeset.bind(this);case w.SECONDLY:return this.stimeset.bind(this)}},t}(),us=ss;function cs(t,e,r,n,o,a){for(var i=[],s=0;s<t.length;s++){var u=void 0,c=void 0,d=t[s];d<0?(u=Math.floor(d/e.length),c=K(d,e.length)):(u=Math.floor((d-1)/e.length),c=K(d-1,e.length));for(var f=[],l=r;l<n;l++){var m=a[l];D(m)&&f.push(m)}var v=void 0;u<0?v=f.slice(u)[0]:v=f[u];var b=e[c],h=Cr(o.yearordinal+v),S=Or(h,b);A(i,S)||i.push(S)}return be(i),i}function Pr(t,e){var r=e.dtstart,n=e.freq,o=e.interval,a=e.until,i=e.bysetpos,s=e.count;if(s===0||o===0)return oe(t);var u=Ia.fromDate(r),c=new us(e);c.rebuild(u.year,u.month);for(var d=ys(c,u,e);;){var f=c.getdayset(n)(u.year,u.month,u.day),l=f[0],m=f[1],v=f[2],b=ds(l,m,v,c,e);if(O(i))for(var h=cs(i,d,m,v,c,l),S=0;S<h.length;S++){var N=h[S];if(a&&N>a)return oe(t);if(N>=r){var L=hr(N,e);if(!t.accept(L)||s&&(--s,!s))return oe(t)}}else for(var S=m;S<v;S++){var ue=l[S];if(D(ue))for(var Ne=Cr(c.yearordinal+ue),J=0;J<d.length;J++){var Fr=d[J],N=Or(Ne,Fr);if(a&&N>a)return oe(t);if(N>=r){var L=hr(N,e);if(!t.accept(L)||s&&(--s,!s))return oe(t)}}}if(e.interval===0||(u.add(e,b),u.year>xr))return oe(t);at(n)||(d=c.gettimeset(n)(u.hour,u.minute,u.second,0)),c.rebuild(u.year,u.month)}}function ls(t,e,r){var n=r.bymonth,o=r.byweekno,a=r.byweekday,i=r.byeaster,s=r.bymonthday,u=r.bynmonthday,c=r.byyearday;return O(n)&&!A(n,t.mmask[e])||O(o)&&!t.wnomask[e]||O(a)&&!A(a,t.wdaymask[e])||O(t.nwdaymask)&&!t.nwdaymask[e]||i!==null&&!A(t.eastermask,e)||(O(s)||O(u))&&!A(s,t.mdaymask[e])&&!A(u,t.nmdaymask[e])||O(c)&&(e<t.yearlen&&!A(c,e+1)&&!A(c,-t.yearlen+e)||e>=t.yearlen&&!A(c,e+1-t.yearlen)&&!A(c,-t.nextyearlen+e-t.yearlen))}function hr(t,e){return new _e(t,e.tzid).rezonedDate()}function oe(t){return t.getValue()}function ds(t,e,r,n,o){for(var a=!1,i=e;i<r;i++){var s=t[i];a=ls(n,s,o),a&&(t[s]=null)}return a}function ys(t,e,r){var n=r.freq,o=r.byhour,a=r.byminute,i=r.bysecond;return at(n)?Ua(r):n>=g.HOURLY&&O(o)&&!A(o,e.hour)||n>=g.MINUTELY&&O(a)&&!A(a,e.minute)||n>=g.SECONDLY&&O(i)&&!A(i,e.second)?[]:t.gettimeset(n)(e.hour,e.minute,e.second,e.millisecond)}var z={MO:new _(0),TU:new _(1),WE:new _(2),TH:new _(3),FR:new _(4),SA:new _(5),SU:new _(6)},st={freq:w.YEARLY,dtstart:null,interval:1,wkst:z.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},fs=Object.keys(st),g=function(){function t(e,r){e===void 0&&(e={}),r===void 0&&(r=!1),this._cache=r?null:new Va,this.origOptions=Rr(e);var n=Ya(e).parsedOptions;this.options=n}return t.parseText=function(e,r){return Mr(e,r)},t.fromText=function(e,r){return _a(e,r)},t.fromString=function(e){return new t(t.parseString(e)||void 0)},t.prototype._iter=function(e){return Pr(e,this.options)},t.prototype._cacheGet=function(e,r){return this._cache?this._cache._cacheGet(e,r):!1},t.prototype._cacheAdd=function(e,r,n){if(this._cache)return this._cache._cacheAdd(e,r,n)},t.prototype.all=function(e){if(e)return this._iter(new dr("all",{},e));var r=this._cacheGet("all");return r===!1&&(r=this._iter(new ie("all",{})),this._cacheAdd("all",r)),r},t.prototype.between=function(e,r,n,o){if(n===void 0&&(n=!1),!ge(e)||!ge(r))throw new Error("Invalid date passed in to RRule.between");var a={before:r,after:e,inc:n};if(o)return this._iter(new dr("between",a,o));var i=this._cacheGet("between",a);return i===!1&&(i=this._iter(new ie("between",a)),this._cacheAdd("between",i,a)),i},t.prototype.before=function(e,r){if(r===void 0&&(r=!1),!ge(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:r},o=this._cacheGet("before",n);return o===!1&&(o=this._iter(new ie("before",n)),this._cacheAdd("before",o,n)),o},t.prototype.after=function(e,r){if(r===void 0&&(r=!1),!ge(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:r},o=this._cacheGet("after",n);return o===!1&&(o=this._iter(new ie("after",n)),this._cacheAdd("after",o,n)),o},t.prototype.count=function(){return this.all().length},t.prototype.toString=function(){return nt(this.origOptions)},t.prototype.toText=function(e,r,n){return Na(this,e,r,n)},t.prototype.isFullyConvertibleToText=function(){return La(this)},t.prototype.clone=function(){return new t(this.origOptions)},t.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],t.YEARLY=w.YEARLY,t.MONTHLY=w.MONTHLY,t.WEEKLY=w.WEEKLY,t.DAILY=w.DAILY,t.HOURLY=w.HOURLY,t.MINUTELY=w.MINUTELY,t.SECONDLY=w.SECONDLY,t.MO=z.MO,t.TU=z.TU,t.WE=z.WE,t.TH=z.TH,t.FR=z.FR,t.SA=z.SA,t.SU=z.SU,t.parseString=rt,t.optionsToString=nt,t}();function ps(t,e,r,n,o,a){var i={},s=t.accept;function u(l,m){r.forEach(function(v){v.between(l,m,!0).forEach(function(b){i[Number(b)]=!0})})}o.forEach(function(l){var m=new _e(l,a).rezonedDate();i[Number(m)]=!0}),t.accept=function(l){var m=Number(l);return isNaN(m)?s.call(this,l):!i[m]&&(u(new Date(m-1),new Date(m+1)),!i[m])?(i[m]=!0,s.call(this,l)):!0},t.method==="between"&&(u(t.args.after,t.args.before),t.accept=function(l){var m=Number(l);return i[m]?!0:(i[m]=!0,s.call(this,l))});for(var c=0;c<n.length;c++){var d=new _e(n[c],a).rezonedDate();if(!t.accept(new Date(d.getTime())))break}e.forEach(function(l){Pr(t,l.options)});var f=t._result;switch(be(f),t.method){case"all":case"between":return f;case"before":return f.length&&f[f.length-1]||null;case"after":default:return f.length&&f[0]||null}}var gr={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function ms(t,e){var r=[],n=[],o=[],a=[],i=Pe(t),s=i.dtstart,u=i.tzid,c=Es(t,e.unfold);return c.forEach(function(d){var f;if(d){var l=bs(d),m=l.name,v=l.parms,b=l.value;switch(m.toUpperCase()){case"RRULE":if(v.length)throw new Error("unsupported RRULE parm: ".concat(v.join(",")));r.push(rt(d));break;case"RDATE":var h=(f=/RDATE(?:;TZID=([^:=]+))?/i.exec(d))!==null&&f!==void 0?f:[],S=h[1];S&&!u&&(u=S),n=n.concat(br(b,v));break;case"EXRULE":if(v.length)throw new Error("unsupported EXRULE parm: ".concat(v.join(",")));o.push(rt(b));break;case"EXDATE":a=a.concat(br(b,v));break;case"DTSTART":break;default:throw new Error("unsupported property: "+m)}}}),{dtstart:s,tzid:u,rrulevals:r,rdatevals:n,exrulevals:o,exdatevals:a}}function hs(t,e){var r=ms(t,e),n=r.rrulevals,o=r.rdatevals,a=r.exrulevals,i=r.exdatevals,s=r.dtstart,u=r.tzid,c=e.cache===!1;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||n.length>1||o.length||a.length||i.length){var d=new ut(c);return d.dtstart(s),d.tzid(u||void 0),n.forEach(function(l){d.rrule(new g(Qe(l,s,u),c))}),o.forEach(function(l){d.rdate(l)}),a.forEach(function(l){d.exrule(new g(Qe(l,s,u),c))}),i.forEach(function(l){d.exdate(l)}),e.compatible&&e.dtstart&&d.rdate(s),d}var f=n[0]||{};return new g(Qe(f,f.dtstart||e.dtstart||s,f.tzid||e.tzid||u),c)}function vr(t,e){return e===void 0&&(e={}),hs(t,gs(e))}function Qe(t,e,r){return M(M({},t),{dtstart:e,tzid:r})}function gs(t){var e=[],r=Object.keys(t),n=Object.keys(gr);if(r.forEach(function(o){A(n,o)||e.push(o)}),e.length)throw new Error("Invalid options: "+e.join(", "));return M(M({},gr),t)}function vs(t){if(t.indexOf(":")===-1)return{name:"RRULE",value:t};var e=Ea(t,":",1),r=e[0],n=e[1];return{name:r,value:n}}function bs(t){var e=vs(t),r=e.name,n=e.value,o=r.split(";");if(!o)throw new Error("empty property name");return{name:o[0].toUpperCase(),parms:o.slice(1),value:n}}function Es(t,e){if(e===void 0&&(e=!1),t=t&&t.trim(),!t)throw new Error("Invalid empty string");if(!e)return t.split(/\s/);for(var r=t.split(`
`),n=0;n<r.length;){var o=r[n]=r[n].replace(/\s+$/g,"");o?n>0&&o[0]===" "?(r[n-1]+=o.slice(1),r.splice(n,1)):n+=1:r.splice(n,1)}return r}function Ts(t){t.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function br(t,e){return Ts(e),t.split(",").map(function(r){return it(r)})}function Er(t){var e=this;return function(r){if(r!==void 0&&(e["_".concat(t)]=r),e["_".concat(t)]!==void 0)return e["_".concat(t)];for(var n=0;n<e._rrule.length;n++){var o=e._rrule[n].origOptions[t];if(o)return o}}}var ut=function(t){re(e,t);function e(r){r===void 0&&(r=!1);var n=t.call(this,{},r)||this;return n.dtstart=Er.apply(n,["dtstart"]),n.tzid=Er.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return e.prototype._iter=function(r){return ps(r,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(r){Tr(r,this._rrule)},e.prototype.exrule=function(r){Tr(r,this._exrule)},e.prototype.rdate=function(r){wr(r,this._rdate)},e.prototype.exdate=function(r){wr(r,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(r){return vr(r.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(r){return vr(r.toString())})},e.prototype.rdates=function(){return this._rdate.map(function(r){return new Date(r.getTime())})},e.prototype.exdates=function(){return this._exdate.map(function(r){return new Date(r.getTime())})},e.prototype.valueOf=function(){var r=[];return!this._rrule.length&&this._dtstart&&(r=r.concat(nt({dtstart:this._dtstart}))),this._rrule.forEach(function(n){r=r.concat(n.toString().split(`
`))}),this._exrule.forEach(function(n){r=r.concat(n.toString().split(`
`).map(function(o){return o.replace(/^RRULE:/,"EXRULE:")}).filter(function(o){return!/^DTSTART/.test(o)}))}),this._rdate.length&&r.push(Sr("RDATE",this._rdate,this.tzid())),this._exdate.length&&r.push(Sr("EXDATE",this._exdate,this.tzid())),r},e.prototype.toString=function(){return this.valueOf().join(`
`)},e.prototype.clone=function(){var r=new e(!!this._cache);return this._rrule.forEach(function(n){return r.rrule(n.clone())}),this._exrule.forEach(function(n){return r.exrule(n.clone())}),this._rdate.forEach(function(n){return r.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return r.exdate(new Date(n.getTime()))}),r},e}(g);function Tr(t,e){if(!(t instanceof g))throw new TypeError(String(t)+" is not RRule instance");A(e.map(String),String(t))||e.push(t)}function wr(t,e){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");A(e.map(Number),Number(t))||(e.push(t),be(e))}function Sr(t,e,r){var n=!r||r.toUpperCase()==="UTC",o=n?"".concat(t,":"):"".concat(t,";TZID=").concat(r,":"),a=e.map(function(i){return ot(i.valueOf(),n)}).join(",");return"".concat(o).concat(a)}var ws={"Dateline Standard Time":"Etc/GMT+12","UTC-11":"Etc/GMT+11","Hawaiian Standard Time":"Pacific/Honolulu","Alaskan Standard Time":"America/Anchorage","Pacific Standard Time (Mexico)":"America/Santa_Isabel","Pacific Standard Time":"America/Los_Angeles","US Mountain Standard Time":"America/Phoenix","Mountain Standard Time (Mexico)":"America/Chihuahua","Mountain Standard Time":"America/Denver","Central America Standard Time":"America/Guatemala","Central Standard Time":"America/Chicago","Central Standard Time (Mexico)":"America/Mexico_City","Canada Central Standard Time":"America/Regina","SA Pacific Standard Time":"America/Bogota","Eastern Standard Time":"America/New_York","US Eastern Standard Time":"America/Indiana/Indianapolis","Venezuela Standard Time":"America/Caracas","Paraguay Standard Time":"America/Asuncion","Atlantic Standard Time":"America/Halifax","Central Brazilian Standard Time":"America/Cuiaba","SA Western Standard Time":"America/La_Paz","Pacific SA Standard Time":"America/Santiago","Newfoundland Standard Time":"America/St_Johns","E. South America Standard Time":"America/Sao_Paulo","Argentina Standard Time":"America/Buenos_Aires","SA Eastern Standard Time":"America/Cayenne","Greenland Standard Time":"America/Godthab","Montevideo Standard Time":"America/Montevideo","Bahia Standard Time":"America/Bahia","Azores Standard Time":"Atlantic/Azores","Cape Verde Standard Time":"Atlantic/Cape_Verde","Morocco Standard Time":"Africa/Casablanca","GMT Standard Time":"Europe/London","Greenwich Standard Time":"Atlantic/Reykjavik","W. Europe Standard Time":"Europe/Berlin","Central Europe Standard Time":"Europe/Budapest","Romance Standard Time":"Europe/Paris","Central European Standard Time":"Europe/Warsaw","W. Central Africa Standard Time":"Africa/Lagos","Namibia Standard Time":"Africa/Windhoek","Jordan Standard Time":"Asia/Amman","GTB Standard Time":"Europe/Bucharest","Middle East Standard Time":"Asia/Beirut","Egypt Standard Time":"Africa/Cairo","Syria Standard Time":"Asia/Damascus","E. Europe Standard Time":"Europe/Chisinau","South Africa Standard Time":"Africa/Johannesburg","FLE Standard Time":"Europe/Kiev","Turkey Standard Time":"Europe/Istanbul","Israel Standard Time":"Asia/Jerusalem","Kaliningrad Standard Time":"Europe/Kaliningrad","Libya Standard Time":"Africa/Tripoli","Arabic Standard Time":"Asia/Baghdad","Arab Standard Time":"Asia/Riyadh","Belarus Standard Time":"Europe/Minsk","Russian Standard Time":"Europe/Moscow","E. Africa Standard Time":"Africa/Nairobi","Iran Standard Time":"Asia/Tehran","Arabian Standard Time":"Asia/Dubai","Azerbaijan Standard Time":"Asia/Baku","Russia Time Zone 3":"Europe/Samara","Mauritius Standard Time":"Indian/Mauritius","Georgian Standard Time":"Asia/Tbilisi","Caucasus Standard Time":"Asia/Yerevan","Afghanistan Standard Time":"Asia/Kabul","West Asia Standard Time":"Asia/Tashkent","Ekaterinburg Standard Time":"Asia/Yekaterinburg","Pakistan Standard Time":"Asia/Karachi","India Standard Time":"Asia/Kolkata","Sri Lanka Standard Time":"Asia/Colombo","Nepal Standard Time":"Asia/Kathmandu","Central Asia Standard Time":"Asia/Almaty","Bangladesh Standard Time":"Asia/Dhaka","N. Central Asia Standard Time":"Asia/Novosibirsk","Myanmar Standard Time":"Asia/Rangoon","SE Asia Standard Time":"Asia/Bangkok","North Asia Standard Time":"Asia/Krasnoyarsk","China Standard Time":"Asia/Shanghai","North Asia East Standard Time":"Asia/Irkutsk","Singapore Standard Time":"Asia/Singapore","W. Australia Standard Time":"Australia/Perth","Taipei Standard Time":"Asia/Taipei","Ulaanbaatar Standard Time":"Asia/Ulaanbaatar","Tokyo Standard Time":"Asia/Tokyo","Korea Standard Time":"Asia/Seoul","Yakutsk Standard Time":"Asia/Yakutsk","Cen. Australia Standard Time":"Australia/Adelaide","AUS Central Standard Time":"Australia/Darwin","E. Australia Standard Time":"Australia/Brisbane","AUS Eastern Standard Time":"Australia/Sydney","West Pacific Standard Time":"Pacific/Port_Moresby","Tasmania Standard Time":"Australia/Hobart","Magadan Standard Time":"Asia/Magadan","Vladivostok Standard Time":"Asia/Vladivostok","Russia Time Zone 10":"Asia/Srednekolymsk","Central Pacific Standard Time":"Pacific/Guadalcanal","Russia Time Zone 11":"Asia/Anadyr","New Zealand Standard Time":"Pacific/Auckland","Fiji Standard Time":"Pacific/Fiji","Tonga Standard Time":"Pacific/Tongatapu","Samoa Standard Time":"Pacific/Apia","Line Islands Standard Time":"Pacific/Kiritimati"};function ct(t){return!t||t==="UTC"||t==="None"?"UTC":t.includes("/")?t:ws[t]??null}function _r(t,e){let r={timeZone:"UTC",hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},n=new Intl.DateTimeFormat("en-CA",r),o=new Intl.DateTimeFormat("en-CA",{...r,timeZone:t}),a=(d,f)=>d.format(f).replace(", ","T"),i=a(n,e),s=a(o,e),u=new Date(i+"Z").getTime();return new Date(s+"Z").getTime()-u}var Nr="0.3.32",Lr="icalendar:lastSync";console.log(`[iCalendar] Plug script executing at top level (Version ${Nr})`);var Ss={frequency:"FREQ",until:"UNTIL",count:"COUNT",interval:"INTERVAL",bysecond:"BYSECOND",byminute:"BYMINUTE",byhour:"BYHOUR",byday:"BYDAY",bymonthday:"BYMONTHDAY",byyearday:"BYYEARDAY",byweekno:"BYWEEKNO",bymonth:"BYMONTH",bysetpos:"BYSETPOS",wkst:"WKST",freq:"FREQ"};function As(t){return t instanceof Date?t.toISOString().replace(/[-:]/g,"").split(".")[0]+"Z":typeof t=="object"&&t!==null&&t.date instanceof Date?t.date.toISOString().replace(/[-:]/g,"").split(".")[0]+"Z":String(t)}async function xs(t){let r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(n)).map(a=>a.toString(16).padStart(2,"0")).join("")}function Ee(t){let e=r=>String(r).padStart(2,"0");return t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+"T"+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())}function lt(t){if(t==null)return t;if(t instanceof Date)return Ee(t);if(typeof t=="object"&&"date"in t&&t.date instanceof Date)return Ee(t.date);if(typeof t=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(t))try{return Ee(new Date(t))}catch{return t}if(Array.isArray(t))return t.map(e=>lt(e));if(typeof t=="object"){let e={};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=lt(t[r]));return e}return t}async function ks(){try{let t=await Te.get("icalendar",{sources:[]});console.log("[iCalendar] Raw config retrieved:",JSON.stringify(t));let e=t.sources||[],r=t.syncWindowDays||365;if(e&&typeof e=="object"&&!Array.isArray(e)){let n=[];for(let o in e)e[o]&&typeof e[o].url=="string"&&n.push(e[o]);e=n}return{sources:e,syncWindowDays:r}}catch(t){return console.error("[iCalendar] Error in getSources:",t),{sources:[],syncWindowDays:365}}}async function Ds(t){let e=t.start;if(!e)return null;let r=null;if(e.local?.date){let s=e.local.date;r=s instanceof Date?s.toISOString():String(s)}else if(e.date){let s=e.date;r=s instanceof Date?s.toISOString():String(s)}if(!r)return null;r=r.replace(/Z$/,"");let n=e.local?.timezone||e.timezone||"UTC",o=ct(n);if(!o){console.warn(`[iCalendar] Unknown timezone: "${n}" - falling back to UTC for event "${t.summary}"`);let s=new Date(r+(r.includes("T")?"":"T00:00:00")+"Z");return isNaN(s.getTime())?null:s}let a=new Date(r+(r.includes("T")?"":"T00:00:00")+"Z");if(isNaN(a.getTime()))return null;let i=_r(o,a);return new Date(a.getTime()-i)}function Cs(t,e=365){let r=t.rrule||t.recurrenceRule;if(!r)return[t];try{let n=new ut,o="";if(typeof r=="string")o=r.replace(/^RRULE:/i,"");else if(typeof r=="object"&&r!==null)o=Object.entries(r).map(([f,l])=>`${Ss[f.toLowerCase()]||f.toUpperCase()}=${As(l)}`).join(";");else return console.warn(`[iCalendar] Invalid rrule type (${typeof r}) for event "${t.summary||"Untitled"}". Treating as non-recurring.`),[t];let a=new Date(t.start.includes("Z")?t.start:t.start+"Z");if(isNaN(a.getTime()))return console.error(`[iCalendar] Invalid start date for recurrence: ${t.start}`),[t];let i=g.parseString(o);i.dtstart=a,n.rrule(new g(i));for(let f of t.exdate||[])n.exdate(new Date(f.includes("Z")?f:f+"Z"));let s=new Date,u=new Date(s.getTime()-7*864e5),c=new Date(s.getTime()+e*864e5);return n.between(a,c,!0).filter(f=>f>=u).map(f=>{let l=Ee(f);return{...t,start:l,recurrent:!0,rrule:void 0}})}catch(n){return console.error(`[iCalendar] Error expanding recurrence for ${t.summary}:`,n),[t]}}async function Os(t,e=365){console.log(`[iCalendar] Fetching from: ${t.url}`);try{let r=await fetch(t.url);if(!r.ok)return console.error(`[iCalendar] Fetch failed for ${t.name}: ${r.status} ${r.statusText}`),[];let n=await r.text(),o=ar(void 0,n);if(!o||!o.events)return[];let a=[];for(let i of o.events){if(i.status?.toUpperCase()==="CANCELLED")continue;let s=await Ds(i);if(!s)continue;let u=Ee(s),c={...i,name:i.summary||"Untitled Event",start:u,tag:"ical-event",sourceName:t.name},d=i.start?.local?.timezone||i.start?.timezone||"UTC";d!=="UTC"&&d!=="None"&&!ct(d)&&(c.description=`(Warning: Unknown timezone "${d}") ${c.description||""}`);let f=Cs(c,e);for(let l of f){let m=`${l.start}${l.uid||l.summary||""}`;l.ref=await xs(m),a.push(lt(l))}}return a}catch(r){return console.error(`[iCalendar] Error fetching/parsing ${t.name}:`,r),[]}}async function dt(){try{let{sources:t,syncWindowDays:e}=await ks();if(t.length===0)return;await H.flashNotification("Syncing calendars...","info");let r=[];for(let n of t){let o=await Os(n,e);r.push(...o)}await we.indexObjects("$icalendar",r),await H.flashNotification(`Synced ${r.length} events`,"info")}catch(t){console.error("[iCalendar] syncCalendars failed:",t)}}async function Ir(){await de.del(Lr),await dt()}async function Yr(){if(!await H.confirm("Clear all calendar events?"))return;let t=await ye.query({prefix:["ridx","$icalendar"]}),e=[];for(let{key:r}of t)e.push(r),e.push(["idx",...r.slice(2),"$icalendar"]);e.length>0&&await ye.batchDel(e),await de.del(Lr),await H.flashNotification("Calendar index cleared","info")}async function Ur(){await H.flashNotification(`iCalendar Plug ${Nr}`,"info")}var Kr={syncCalendars:dt,forceSync:Ir,clearCache:Yr,showVersion:Ur},zr={name:"icalendar",version:"0.3.32",author:"sstent",index:"icalendar.ts",requiredPermissions:["fetch"],permissions:["fetch","http"],functions:{syncCalendars:{path:"icalendar.ts:syncCalendars",command:{name:"iCalendar: Sync",priority:-1},events:["editor:init"]},forceSync:{path:"icalendar.ts:forceSync",command:{name:"iCalendar: Force Sync",priority:-1}},clearCache:{path:"icalendar.ts:clearCache",command:{name:"iCalendar: Clear All Events",priority:-1}},showVersion:{path:"icalendar.ts:showVersion",command:{name:"iCalendar: Version",priority:-2}}},assets:{}},ic={manifest:zr,functionMapping:Kr};mt(Kr,zr,self.postMessage);export{ic as plug};
//# sourceMappingURL=icalendar.plug.js.map