Files
obsidian-workflow-template/.obsidian/plugins/google-calendar/main.js
Mathis Gauthey f366d5b7b6 Initial commit
2023-08-05 19:14:53 +01:00

204 lines
518 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var aM=Object.create;var za=Object.defineProperty,lM=Object.defineProperties,uM=Object.getOwnPropertyDescriptor,fM=Object.getOwnPropertyDescriptors,cM=Object.getOwnPropertyNames,f_=Object.getOwnPropertySymbols,dM=Object.getPrototypeOf,c_=Object.prototype.hasOwnProperty,pM=Object.prototype.propertyIsEnumerable;var d_=(t,e,n)=>e in t?za(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,zn=(t,e)=>{for(var n in e||(e={}))c_.call(e,n)&&d_(t,n,e[n]);if(f_)for(var n of f_(e))pM.call(e,n)&&d_(t,n,e[n]);return t},Ps=(t,e)=>lM(t,fM(e)),p_=t=>za(t,"__esModule",{value:!0});var B4=typeof require!="undefined"?require:t=>{throw new Error('Dynamic require of "'+t+'" is not supported')};var Oi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hM=(t,e)=>{p_(t);for(var n in e)za(t,n,{get:e[n],enumerable:!0})},mM=(t,e,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of cM(e))!c_.call(t,r)&&r!=="default"&&za(t,r,{get:()=>e[r],enumerable:!(n=uM(e,r))||n.enumerable});return t},Oe=t=>mM(p_(za(t!=null?aM(dM(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var te=(t,e,n)=>new Promise((r,i)=>{var o=f=>{try{u(n.next(f))}catch(c){i(c)}},a=f=>{try{u(n.throw(f))}catch(c){i(c)}},u=f=>f.done?r(f.value):Promise.resolve(f.value).then(o,a);u((n=n.apply(t,e)).next())});var Bu=Oi(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});var Xt=require("obsidian"),Ep="YYYY-MM-DD",Tp="gggg-[W]ww",$_="YYYY-MM",e1="YYYY-[Q]Q",t1="YYYY";function el(t){var n,r;let e=window.app.plugins.getPlugin("periodic-notes");return e&&((r=(n=e.settings)==null?void 0:n[t])==null?void 0:r.enabled)}function tl(){var t,e,n,r;try{let{internalPlugins:i,plugins:o}=window.app;if(el("daily")){let{format:c,folder:p,template:h}=((e=(t=o.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:e.daily)||{};return{format:c||Ep,folder:(p==null?void 0:p.trim())||"",template:(h==null?void 0:h.trim())||""}}let{folder:a,format:u,template:f}=((r=(n=i.getPluginById("daily-notes"))==null?void 0:n.instance)==null?void 0:r.options)||{};return{format:u||Ep,folder:(a==null?void 0:a.trim())||"",template:(f==null?void 0:f.trim())||""}}catch(i){console.info("No custom daily note settings found!",i)}}function nl(){var t,e,n,r,i,o,a;try{let u=window.app.plugins,f=(t=u.getPlugin("calendar"))==null?void 0:t.options,c=(n=(e=u.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:n.weekly;if(el("weekly"))return{format:c.format||Tp,folder:((r=c.folder)==null?void 0:r.trim())||"",template:((i=c.template)==null?void 0:i.trim())||""};let p=f||{};return{format:p.weeklyNoteFormat||Tp,folder:((o=p.weeklyNoteFolder)==null?void 0:o.trim())||"",template:((a=p.weeklyNoteTemplate)==null?void 0:a.trim())||""}}catch(u){console.info("No custom weekly note settings found!",u)}}function rl(){var e,n,r,i;let t=window.app.plugins;try{let o=el("monthly")&&((n=(e=t.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:n.monthly)||{};return{format:o.format||$_,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom monthly note settings found!",o)}}function il(){var e,n,r,i;let t=window.app.plugins;try{let o=el("quarterly")&&((n=(e=t.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:n.quarterly)||{};return{format:o.format||e1,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom quarterly note settings found!",o)}}function ol(){var e,n,r,i;let t=window.app.plugins;try{let o=el("yearly")&&((n=(e=t.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:n.yearly)||{};return{format:o.format||t1,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((i=o.template)==null?void 0:i.trim())||""}}catch(o){console.info("No custom yearly note settings found!",o)}}function n1(...t){let e=[];for(let r=0,i=t.length;r<i;r++)e=e.concat(t[r].split("/"));let n=[];for(let r=0,i=e.length;r<i;r++){let o=e[r];!o||o==="."||n.push(o)}return e[0]===""&&n.unshift(""),n.join("/")}function eA(t){let e=t.substring(t.lastIndexOf("/")+1);return e.lastIndexOf(".")!=-1&&(e=e.substring(0,e.lastIndexOf("."))),e}function tA(t){return te(this,null,function*(){let e=t.replace(/\\/g,"/").split("/");if(e.pop(),e.length){let n=n1(...e);window.app.vault.getAbstractFileByPath(n)||(yield window.app.vault.createFolder(n))}})}function sl(t,e){return te(this,null,function*(){e.endsWith(".md")||(e+=".md");let n=Xt.normalizePath(n1(t,e));return yield tA(n),n})}function Ys(t){return te(this,null,function*(){let{metadataCache:e,vault:n}=window.app,r=Xt.normalizePath(t);if(r==="/")return Promise.resolve(["",null]);try{let i=e.getFirstLinkpathDest(r,""),o=yield n.cachedRead(i),a=window.app.foldManager.load(i);return[o,a]}catch(i){return console.error(`Failed to read the daily note template '${r}'`,i),new Xt.Notice("Failed to read the daily note template"),["",null]}})}function Ur(t,e="day"){let n=t.clone().startOf(e).format();return`${e}-${n}`}function r1(t){return t.replace(/\[[^\]]*\]/g,"")}function nA(t,e){if(e==="week"){let n=r1(t);return/w{1,2}/i.test(n)&&(/M{1,4}/.test(n)||/D{1,4}/.test(n))}return!1}function Ws(t,e){return i1(t.basename,e)}function rA(t,e){return i1(eA(t),e)}function i1(t,e){let r={day:tl,week:nl,month:rl,quarter:il,year:ol}[e]().format.split("/").pop(),i=window.moment(t,r,!0);if(!i.isValid())return null;if(nA(r,e)&&e==="week"){let o=r1(r);if(/w{1,2}/i.test(o))return window.moment(t,r.replace(/M{1,4}/g,"").replace(/D{1,4}/g,""),!1)}return i}var o1=class extends Error{};function s1(t){return te(this,null,function*(){let e=window.app,{vault:n}=e,r=window.moment,{template:i,format:o,folder:a}=tl(),[u,f]=yield Ys(i),c=t.format(o),p=yield sl(a,c);try{let h=yield n.create(p,u.replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,r().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c).replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(m,_,v,b,E,y)=>{let O=r(),D=t.clone().set({hour:O.get("hour"),minute:O.get("minute"),second:O.get("second")});return v&&D.add(parseInt(b,10),E),y?D.format(y.substring(1).trim()):D.format(o)}).replace(/{{\s*yesterday\s*}}/gi,t.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,t.clone().add(1,"d").format(o)));return e.foldManager.save(h,f),h}catch(h){console.error(`Failed to create file: '${p}'`,h),new Xt.Notice("Unable to create new file.")}})}function iA(t,e){var n;return(n=e[Ur(t,"day")])!=null?n:null}function oA(){let{vault:t}=window.app,{folder:e}=tl(),n=t.getAbstractFileByPath(Xt.normalizePath(e));if(!n)throw new o1("Failed to find daily notes folder");let r={};return Xt.Vault.recurseChildren(n,i=>{if(i instanceof Xt.TFile){let o=Ws(i,"day");if(o){let a=Ur(o,"day");r[a]=i}}}),r}var a1=class extends Error{};function sA(){let{moment:t}=window,e=t.localeData()._week.dow,n=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;e;)n.push(n.shift()),e--;return n}function aA(t){return sA().indexOf(t.toLowerCase())}function l1(t){return te(this,null,function*(){let{vault:e}=window.app,{template:n,format:r,folder:i}=nl(),[o,a]=yield Ys(n),u=t.format(r),f=yield sl(i,u);try{let c=yield e.create(f,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,h,m,_,v,b)=>{let E=window.moment(),y=t.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return m&&y.add(parseInt(_,10),v),b?y.format(b.substring(1).trim()):y.format(r)}).replace(/{{\s*title\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(p,h,m)=>{let _=aA(h);return t.weekday(_).format(m.trim())}));return window.app.foldManager.save(c,a),c}catch(c){console.error(`Failed to create file: '${f}'`,c),new Xt.Notice("Unable to create new file.")}})}function lA(t,e){var n;return(n=e[Ur(t,"week")])!=null?n:null}function uA(){let t={};if(!p1())return t;let{vault:e}=window.app,{folder:n}=nl(),r=e.getAbstractFileByPath(Xt.normalizePath(n));if(!r)throw new a1("Failed to find weekly notes folder");return Xt.Vault.recurseChildren(r,i=>{if(i instanceof Xt.TFile){let o=Ws(i,"week");if(o){let a=Ur(o,"week");t[a]=i}}}),t}var u1=class extends Error{};function f1(t){return te(this,null,function*(){let{vault:e}=window.app,{template:n,format:r,folder:i}=rl(),[o,a]=yield Ys(n),u=t.format(r),f=yield sl(i,u);try{let c=yield e.create(f,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,h,m,_,v,b)=>{let E=window.moment(),y=t.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return m&&y.add(parseInt(_,10),v),b?y.format(b.substring(1).trim()):y.format(r)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(c,a),c}catch(c){console.error(`Failed to create file: '${f}'`,c),new Xt.Notice("Unable to create new file.")}})}function fA(t,e){var n;return(n=e[Ur(t,"month")])!=null?n:null}function cA(){let t={};if(!h1())return t;let{vault:e}=window.app,{folder:n}=rl(),r=e.getAbstractFileByPath(Xt.normalizePath(n));if(!r)throw new u1("Failed to find monthly notes folder");return Xt.Vault.recurseChildren(r,i=>{if(i instanceof Xt.TFile){let o=Ws(i,"month");if(o){let a=Ur(o,"month");t[a]=i}}}),t}var c1=class extends Error{};function dA(t){return te(this,null,function*(){let{vault:e}=window.app,{template:n,format:r,folder:i}=il(),[o,a]=yield Ys(n),u=t.format(r),f=yield sl(i,u);try{let c=yield e.create(f,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,h,m,_,v,b)=>{let E=window.moment(),y=t.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return m&&y.add(parseInt(_,10),v),b?y.format(b.substring(1).trim()):y.format(r)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(c,a),c}catch(c){console.error(`Failed to create file: '${f}'`,c),new Xt.Notice("Unable to create new file.")}})}function pA(t,e){var n;return(n=e[Ur(t,"quarter")])!=null?n:null}function hA(){let t={};if(!m1())return t;let{vault:e}=window.app,{folder:n}=il(),r=e.getAbstractFileByPath(Xt.normalizePath(n));if(!r)throw new c1("Failed to find quarterly notes folder");return Xt.Vault.recurseChildren(r,i=>{if(i instanceof Xt.TFile){let o=Ws(i,"quarter");if(o){let a=Ur(o,"quarter");t[a]=i}}}),t}var d1=class extends Error{};function mA(t){return te(this,null,function*(){let{vault:e}=window.app,{template:n,format:r,folder:i}=ol(),[o,a]=yield Ys(n),u=t.format(r),f=yield sl(i,u);try{let c=yield e.create(f,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,h,m,_,v,b)=>{let E=window.moment(),y=t.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return m&&y.add(parseInt(_,10),v),b?y.format(b.substring(1).trim()):y.format(r)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(c,a),c}catch(c){console.error(`Failed to create file: '${f}'`,c),new Xt.Notice("Unable to create new file.")}})}function gA(t,e){var n;return(n=e[Ur(t,"year")])!=null?n:null}function _A(){let t={};if(!g1())return t;let{vault:e}=window.app,{folder:n}=ol(),r=e.getAbstractFileByPath(Xt.normalizePath(n));if(!r)throw new d1("Failed to find yearly notes folder");return Xt.Vault.recurseChildren(r,i=>{if(i instanceof Xt.TFile){let o=Ws(i,"year");if(o){let a=Ur(o,"year");t[a]=i}}}),t}function vA(){var r,i;let{app:t}=window,e=t.internalPlugins.plugins["daily-notes"];if(e&&e.enabled)return!0;let n=t.plugins.getPlugin("periodic-notes");return n&&((i=(r=n.settings)==null?void 0:r.daily)==null?void 0:i.enabled)}function p1(){var n,r;let{app:t}=window;if(t.plugins.getPlugin("calendar"))return!0;let e=t.plugins.getPlugin("periodic-notes");return e&&((r=(n=e.settings)==null?void 0:n.weekly)==null?void 0:r.enabled)}function h1(){var n,r;let{app:t}=window,e=t.plugins.getPlugin("periodic-notes");return e&&((r=(n=e.settings)==null?void 0:n.monthly)==null?void 0:r.enabled)}function m1(){var n,r;let{app:t}=window,e=t.plugins.getPlugin("periodic-notes");return e&&((r=(n=e.settings)==null?void 0:n.quarterly)==null?void 0:r.enabled)}function g1(){var n,r;let{app:t}=window,e=t.plugins.getPlugin("periodic-notes");return e&&((r=(n=e.settings)==null?void 0:n.yearly)==null?void 0:r.enabled)}function yA(t){return{day:tl,week:nl,month:rl,quarter:il,year:ol}[t]()}function wA(t,e){return{day:s1,month:f1,week:l1}[t](e)}ot.DEFAULT_DAILY_NOTE_FORMAT=Ep;ot.DEFAULT_MONTHLY_NOTE_FORMAT=$_;ot.DEFAULT_QUARTERLY_NOTE_FORMAT=e1;ot.DEFAULT_WEEKLY_NOTE_FORMAT=Tp;ot.DEFAULT_YEARLY_NOTE_FORMAT=t1;ot.appHasDailyNotesPluginLoaded=vA;ot.appHasMonthlyNotesPluginLoaded=h1;ot.appHasQuarterlyNotesPluginLoaded=m1;ot.appHasWeeklyNotesPluginLoaded=p1;ot.appHasYearlyNotesPluginLoaded=g1;ot.createDailyNote=s1;ot.createMonthlyNote=f1;ot.createPeriodicNote=wA;ot.createQuarterlyNote=dA;ot.createWeeklyNote=l1;ot.createYearlyNote=mA;ot.getAllDailyNotes=oA;ot.getAllMonthlyNotes=cA;ot.getAllQuarterlyNotes=hA;ot.getAllWeeklyNotes=uA;ot.getAllYearlyNotes=_A;ot.getDailyNote=iA;ot.getDailyNoteSettings=tl;ot.getDateFromFile=Ws;ot.getDateFromPath=rA;ot.getDateUID=Ur;ot.getMonthlyNote=fA;ot.getMonthlyNoteSettings=rl;ot.getPeriodicNoteSettings=yA;ot.getQuarterlyNote=pA;ot.getQuarterlyNoteSettings=il;ot.getTemplateInfo=Ys;ot.getWeeklyNote=lA;ot.getWeeklyNoteSettings=nl;ot.getYearlyNote=gA;ot.getYearlyNoteSettings=ol});var Ri=Oi((js,al)=>{(function(){var t,e="4.17.21",n=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",o="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",c=1,p=2,h=4,m=1,_=2,v=1,b=2,E=4,y=8,O=16,D=32,F=64,P=128,L=256,R=512,M=30,H="...",le=800,V=16,X=1,K=2,ce=3,S=1/0,Q=9007199254740991,j=17976931348623157e292,U=0/0,J=4294967295,re=J-1,Y=J>>>1,z=[["ary",P],["bind",v],["bindKey",b],["curry",y],["curryRight",O],["flip",R],["partial",D],["partialRight",F],["rearg",L]],ee="[object Arguments]",_e="[object Array]",Ce="[object AsyncFunction]",Fe="[object Boolean]",je="[object Date]",pt="[object DOMException]",ht="[object Error]",ge="[object Function]",Ee="[object GeneratorFunction]",vt="[object Map]",Ht="[object Number]",mr="[object Null]",rt="[object Object]",Ue="[object Promise]",Vn="[object Proxy]",tr="[object RegExp]",_n="[object Set]",vn="[object String]",Yn="[object Symbol]",Gt="[object Undefined]",Wn="[object WeakMap]",Cn="[object WeakSet]",yn="[object ArrayBuffer]",jn="[object DataView]",Kn="[object Float32Array]",Zn="[object Float64Array]",Hi="[object Int8Array]",ei="[object Int16Array]",Oo="[object Int32Array]",Mo="[object Uint8Array]",ne="[object Uint8ClampedArray]",De="[object Uint16Array]",bt="[object Uint32Array]",St=/\b__p \+= '';/g,nr=/\b(__p \+=) '' \+/g,_i=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ps=/&(?:amp|lt|gt|quot|#39);/g,hs=/[&<>"']/g,Tc=RegExp(ps.source),Sc=RegExp(hs.source),Cc=/<%-([\s\S]+?)%>/g,Dc=/<%([\s\S]+?)%>/g,Wl=/<%=([\s\S]+?)%>/g,Oc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mc=/^\w*$/,Ac=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sa=/[\\^$.*+?()[\]{}|]/g,Pc=RegExp(Sa.source),Ca=/^\s+/,Nc=/\s/,xc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ic=/\{\n\/\* \[wrapped with (.+)\] \*/,Rc=/,? & /,Lc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Fc=/[()=,{}\[\]\/\s]/,Yc=/\\(\\)?/g,Wc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,jl=/\w*$/,jc=/^[-+]0x[0-9a-f]+$/i,Bc=/^0b[01]+$/i,Gc=/^\[object .+?Constructor\]$/,Uc=/^0o[0-7]+$/i,zc=/^(?:0|[1-9]\d*)$/,Hc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ms=/($^)/,qc=/['\n\r\u2028\u2029\\]/g,gs="\\ud800-\\udfff",Vc="\\u0300-\\u036f",Kc="\\ufe20-\\ufe2f",Zc="\\u20d0-\\u20ff",Bl=Vc+Kc+Zc,Gl="\\u2700-\\u27bf",Ul="a-z\\xdf-\\xf6\\xf8-\\xff",Xc="\\xac\\xb1\\xd7\\xf7",Jc="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zl="\\u2000-\\u206f",x=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Be="A-Z\\xc0-\\xd6\\xd8-\\xde",Dt="\\ufe0e\\ufe0f",kt=Xc+Jc+zl+x,Ir="['\u2019]",Da="["+gs+"]",Ao="["+kt+"]",ti="["+Bl+"]",Oa="\\d+",Hl="["+Gl+"]",_s="["+Ul+"]",vi="[^"+gs+kt+Oa+Gl+Ul+Be+"]",Po="\\ud83c[\\udffb-\\udfff]",uE="(?:"+ti+"|"+Po+")",Zh="[^"+gs+"]",Qc="(?:\\ud83c[\\udde6-\\uddff]){2}",$c="[\\ud800-\\udbff][\\udc00-\\udfff]",vs="["+Be+"]",Xh="\\u200d",Jh="(?:"+_s+"|"+vi+")",fE="(?:"+vs+"|"+vi+")",Qh="(?:"+Ir+"(?:d|ll|m|re|s|t|ve))?",$h="(?:"+Ir+"(?:D|LL|M|RE|S|T|VE))?",em=uE+"?",tm="["+Dt+"]?",cE="(?:"+Xh+"(?:"+[Zh,Qc,$c].join("|")+")"+tm+em+")*",dE="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pE="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",nm=tm+em+cE,hE="(?:"+[Hl,Qc,$c].join("|")+")"+nm,mE="(?:"+[Zh+ti+"?",ti,Qc,$c,Da].join("|")+")",gE=RegExp(Ir,"g"),_E=RegExp(ti,"g"),ed=RegExp(Po+"(?="+Po+")|"+mE+nm,"g"),vE=RegExp([vs+"?"+_s+"+"+Qh+"(?="+[Ao,vs,"$"].join("|")+")",fE+"+"+$h+"(?="+[Ao,vs+Jh,"$"].join("|")+")",vs+"?"+Jh+"+"+Qh,vs+"+"+$h,pE,dE,Oa,hE].join("|"),"g"),yE=RegExp("["+Xh+gs+Bl+Dt+"]"),wE=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,bE=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],kE=-1,Ut={};Ut[Kn]=Ut[Zn]=Ut[Hi]=Ut[ei]=Ut[Oo]=Ut[Mo]=Ut[ne]=Ut[De]=Ut[bt]=!0,Ut[ee]=Ut[_e]=Ut[yn]=Ut[Fe]=Ut[jn]=Ut[je]=Ut[ht]=Ut[ge]=Ut[vt]=Ut[Ht]=Ut[rt]=Ut[tr]=Ut[_n]=Ut[vn]=Ut[Wn]=!1;var jt={};jt[ee]=jt[_e]=jt[yn]=jt[jn]=jt[Fe]=jt[je]=jt[Kn]=jt[Zn]=jt[Hi]=jt[ei]=jt[Oo]=jt[vt]=jt[Ht]=jt[rt]=jt[tr]=jt[_n]=jt[vn]=jt[Yn]=jt[Mo]=jt[ne]=jt[De]=jt[bt]=!0,jt[ht]=jt[ge]=jt[Wn]=!1;var EE={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},TE={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},SE={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},CE={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},DE=parseFloat,OE=parseInt,rm=typeof global=="object"&&global&&global.Object===Object&&global,ME=typeof self=="object"&&self&&self.Object===Object&&self,wn=rm||ME||Function("return this")(),td=typeof js=="object"&&js&&!js.nodeType&&js,No=td&&typeof al=="object"&&al&&!al.nodeType&&al,im=No&&No.exports===td,nd=im&&rm.process,gr=function(){try{var q=No&&No.require&&No.require("util").types;return q||nd&&nd.binding&&nd.binding("util")}catch(ae){}}(),om=gr&&gr.isArrayBuffer,sm=gr&&gr.isDate,am=gr&&gr.isMap,lm=gr&&gr.isRegExp,um=gr&&gr.isSet,fm=gr&&gr.isTypedArray;function rr(q,ae,ie){switch(ie.length){case 0:return q.call(ae);case 1:return q.call(ae,ie[0]);case 2:return q.call(ae,ie[0],ie[1]);case 3:return q.call(ae,ie[0],ie[1],ie[2])}return q.apply(ae,ie)}function AE(q,ae,ie,be){for(var He=-1,Ct=q==null?0:q.length;++He<Ct;){var cn=q[He];ae(be,cn,ie(cn),q)}return be}function _r(q,ae){for(var ie=-1,be=q==null?0:q.length;++ie<be&&ae(q[ie],ie,q)!==!1;);return q}function PE(q,ae){for(var ie=q==null?0:q.length;ie--&&ae(q[ie],ie,q)!==!1;);return q}function cm(q,ae){for(var ie=-1,be=q==null?0:q.length;++ie<be;)if(!ae(q[ie],ie,q))return!1;return!0}function qi(q,ae){for(var ie=-1,be=q==null?0:q.length,He=0,Ct=[];++ie<be;){var cn=q[ie];ae(cn,ie,q)&&(Ct[He++]=cn)}return Ct}function ql(q,ae){var ie=q==null?0:q.length;return!!ie&&ys(q,ae,0)>-1}function rd(q,ae,ie){for(var be=-1,He=q==null?0:q.length;++be<He;)if(ie(ae,q[be]))return!0;return!1}function qt(q,ae){for(var ie=-1,be=q==null?0:q.length,He=Array(be);++ie<be;)He[ie]=ae(q[ie],ie,q);return He}function Vi(q,ae){for(var ie=-1,be=ae.length,He=q.length;++ie<be;)q[He+ie]=ae[ie];return q}function id(q,ae,ie,be){var He=-1,Ct=q==null?0:q.length;for(be&&Ct&&(ie=q[++He]);++He<Ct;)ie=ae(ie,q[He],He,q);return ie}function NE(q,ae,ie,be){var He=q==null?0:q.length;for(be&&He&&(ie=q[--He]);He--;)ie=ae(ie,q[He],He,q);return ie}function od(q,ae){for(var ie=-1,be=q==null?0:q.length;++ie<be;)if(ae(q[ie],ie,q))return!0;return!1}var xE=sd("length");function IE(q){return q.split("")}function RE(q){return q.match(Lc)||[]}function dm(q,ae,ie){var be;return ie(q,function(He,Ct,cn){if(ae(He,Ct,cn))return be=Ct,!1}),be}function Vl(q,ae,ie,be){for(var He=q.length,Ct=ie+(be?1:-1);be?Ct--:++Ct<He;)if(ae(q[Ct],Ct,q))return Ct;return-1}function ys(q,ae,ie){return ae===ae?VE(q,ae,ie):Vl(q,pm,ie)}function LE(q,ae,ie,be){for(var He=ie-1,Ct=q.length;++He<Ct;)if(be(q[He],ae))return He;return-1}function pm(q){return q!==q}function hm(q,ae){var ie=q==null?0:q.length;return ie?ld(q,ae)/ie:U}function sd(q){return function(ae){return ae==null?t:ae[q]}}function ad(q){return function(ae){return q==null?t:q[ae]}}function mm(q,ae,ie,be,He){return He(q,function(Ct,cn,Rt){ie=be?(be=!1,Ct):ae(ie,Ct,cn,Rt)}),ie}function FE(q,ae){var ie=q.length;for(q.sort(ae);ie--;)q[ie]=q[ie].value;return q}function ld(q,ae){for(var ie,be=-1,He=q.length;++be<He;){var Ct=ae(q[be]);Ct!==t&&(ie=ie===t?Ct:ie+Ct)}return ie}function ud(q,ae){for(var ie=-1,be=Array(q);++ie<q;)be[ie]=ae(ie);return be}function YE(q,ae){return qt(ae,function(ie){return[ie,q[ie]]})}function gm(q){return q&&q.slice(0,wm(q)+1).replace(Ca,"")}function ir(q){return function(ae){return q(ae)}}function fd(q,ae){return qt(ae,function(ie){return q[ie]})}function Ma(q,ae){return q.has(ae)}function _m(q,ae){for(var ie=-1,be=q.length;++ie<be&&ys(ae,q[ie],0)>-1;);return ie}function vm(q,ae){for(var ie=q.length;ie--&&ys(ae,q[ie],0)>-1;);return ie}function WE(q,ae){for(var ie=q.length,be=0;ie--;)q[ie]===ae&&++be;return be}var jE=ad(EE),BE=ad(TE);function GE(q){return"\\"+CE[q]}function UE(q,ae){return q==null?t:q[ae]}function ws(q){return yE.test(q)}function zE(q){return wE.test(q)}function HE(q){for(var ae,ie=[];!(ae=q.next()).done;)ie.push(ae.value);return ie}function cd(q){var ae=-1,ie=Array(q.size);return q.forEach(function(be,He){ie[++ae]=[He,be]}),ie}function ym(q,ae){return function(ie){return q(ae(ie))}}function Ki(q,ae){for(var ie=-1,be=q.length,He=0,Ct=[];++ie<be;){var cn=q[ie];(cn===ae||cn===f)&&(q[ie]=f,Ct[He++]=ie)}return Ct}function Kl(q){var ae=-1,ie=Array(q.size);return q.forEach(function(be){ie[++ae]=be}),ie}function qE(q){var ae=-1,ie=Array(q.size);return q.forEach(function(be){ie[++ae]=[be,be]}),ie}function VE(q,ae,ie){for(var be=ie-1,He=q.length;++be<He;)if(q[be]===ae)return be;return-1}function KE(q,ae,ie){for(var be=ie+1;be--;)if(q[be]===ae)return be;return be}function bs(q){return ws(q)?XE(q):xE(q)}function Rr(q){return ws(q)?JE(q):IE(q)}function wm(q){for(var ae=q.length;ae--&&Nc.test(q.charAt(ae)););return ae}var ZE=ad(SE);function XE(q){for(var ae=ed.lastIndex=0;ed.test(q);)++ae;return ae}function JE(q){return q.match(ed)||[]}function QE(q){return q.match(vE)||[]}var $E=function q(ae){ae=ae==null?wn:Zi.defaults(wn.Object(),ae,Zi.pick(wn,bE));var ie=ae.Array,be=ae.Date,He=ae.Error,Ct=ae.Function,cn=ae.Math,Rt=ae.Object,dd=ae.RegExp,eT=ae.String,vr=ae.TypeError,Zl=ie.prototype,tT=Ct.prototype,ks=Rt.prototype,Xl=ae["__core-js_shared__"],Jl=tT.toString,Nt=ks.hasOwnProperty,nT=0,bm=function(){var s=/[^.]+$/.exec(Xl&&Xl.keys&&Xl.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Ql=ks.toString,rT=Jl.call(Rt),iT=wn._,oT=dd("^"+Jl.call(Nt).replace(Sa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$l=im?ae.Buffer:t,Xi=ae.Symbol,eu=ae.Uint8Array,km=$l?$l.allocUnsafe:t,tu=ym(Rt.getPrototypeOf,Rt),Em=Rt.create,Tm=ks.propertyIsEnumerable,nu=Zl.splice,Sm=Xi?Xi.isConcatSpreadable:t,Aa=Xi?Xi.iterator:t,xo=Xi?Xi.toStringTag:t,ru=function(){try{var s=Yo(Rt,"defineProperty");return s({},"",{}),s}catch(l){}}(),sT=ae.clearTimeout!==wn.clearTimeout&&ae.clearTimeout,aT=be&&be.now!==wn.Date.now&&be.now,lT=ae.setTimeout!==wn.setTimeout&&ae.setTimeout,iu=cn.ceil,ou=cn.floor,pd=Rt.getOwnPropertySymbols,uT=$l?$l.isBuffer:t,Cm=ae.isFinite,fT=Zl.join,cT=ym(Rt.keys,Rt),dn=cn.max,xn=cn.min,dT=be.now,pT=ae.parseInt,Dm=cn.random,hT=Zl.reverse,hd=Yo(ae,"DataView"),Pa=Yo(ae,"Map"),md=Yo(ae,"Promise"),Es=Yo(ae,"Set"),Na=Yo(ae,"WeakMap"),xa=Yo(Rt,"create"),su=Na&&new Na,Ts={},mT=Wo(hd),gT=Wo(Pa),_T=Wo(md),vT=Wo(Es),yT=Wo(Na),au=Xi?Xi.prototype:t,Ia=au?au.valueOf:t,Om=au?au.toString:t;function T(s){if(Jt(s)&&!Ve(s)&&!(s instanceof ft)){if(s instanceof yr)return s;if(Nt.call(s,"__wrapped__"))return Mg(s)}return new yr(s)}var Ss=function(){function s(){}return function(l){if(!Kt(l))return{};if(Em)return Em(l);s.prototype=l;var d=new s;return s.prototype=t,d}}();function lu(){}function yr(s,l){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}T.templateSettings={escape:Cc,evaluate:Dc,interpolate:Wl,variable:"",imports:{_:T}},T.prototype=lu.prototype,T.prototype.constructor=T,yr.prototype=Ss(lu.prototype),yr.prototype.constructor=yr;function ft(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=J,this.__views__=[]}function wT(){var s=new ft(this.__wrapped__);return s.__actions__=Xn(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=Xn(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=Xn(this.__views__),s}function bT(){if(this.__filtered__){var s=new ft(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function kT(){var s=this.__wrapped__.value(),l=this.__dir__,d=Ve(s),g=l<0,w=d?s.length:0,C=I2(0,w,this.__views__),I=C.start,W=C.end,Z=W-I,ue=g?W:I-1,fe=this.__iteratees__,pe=fe.length,ve=0,Te=xn(Z,this.__takeCount__);if(!d||!g&&w==Z&&Te==Z)return Qm(s,this.__actions__);var Ie=[];e:for(;Z--&&ve<Te;){ue+=l;for(var $e=-1,Re=s[ue];++$e<pe;){var lt=fe[$e],mt=lt.iteratee,ar=lt.type,Un=mt(Re);if(ar==K)Re=Un;else if(!Un){if(ar==X)continue e;break e}}Ie[ve++]=Re}return Ie}ft.prototype=Ss(lu.prototype),ft.prototype.constructor=ft;function Io(s){var l=-1,d=s==null?0:s.length;for(this.clear();++l<d;){var g=s[l];this.set(g[0],g[1])}}function ET(){this.__data__=xa?xa(null):{},this.size=0}function TT(s){var l=this.has(s)&&delete this.__data__[s];return this.size-=l?1:0,l}function ST(s){var l=this.__data__;if(xa){var d=l[s];return d===a?t:d}return Nt.call(l,s)?l[s]:t}function CT(s){var l=this.__data__;return xa?l[s]!==t:Nt.call(l,s)}function DT(s,l){var d=this.__data__;return this.size+=this.has(s)?0:1,d[s]=xa&&l===t?a:l,this}Io.prototype.clear=ET,Io.prototype.delete=TT,Io.prototype.get=ST,Io.prototype.has=CT,Io.prototype.set=DT;function yi(s){var l=-1,d=s==null?0:s.length;for(this.clear();++l<d;){var g=s[l];this.set(g[0],g[1])}}function OT(){this.__data__=[],this.size=0}function MT(s){var l=this.__data__,d=uu(l,s);if(d<0)return!1;var g=l.length-1;return d==g?l.pop():nu.call(l,d,1),--this.size,!0}function AT(s){var l=this.__data__,d=uu(l,s);return d<0?t:l[d][1]}function PT(s){return uu(this.__data__,s)>-1}function NT(s,l){var d=this.__data__,g=uu(d,s);return g<0?(++this.size,d.push([s,l])):d[g][1]=l,this}yi.prototype.clear=OT,yi.prototype.delete=MT,yi.prototype.get=AT,yi.prototype.has=PT,yi.prototype.set=NT;function wi(s){var l=-1,d=s==null?0:s.length;for(this.clear();++l<d;){var g=s[l];this.set(g[0],g[1])}}function xT(){this.size=0,this.__data__={hash:new Io,map:new(Pa||yi),string:new Io}}function IT(s){var l=bu(this,s).delete(s);return this.size-=l?1:0,l}function RT(s){return bu(this,s).get(s)}function LT(s){return bu(this,s).has(s)}function FT(s,l){var d=bu(this,s),g=d.size;return d.set(s,l),this.size+=d.size==g?0:1,this}wi.prototype.clear=xT,wi.prototype.delete=IT,wi.prototype.get=RT,wi.prototype.has=LT,wi.prototype.set=FT;function Ro(s){var l=-1,d=s==null?0:s.length;for(this.__data__=new wi;++l<d;)this.add(s[l])}function YT(s){return this.__data__.set(s,a),this}function WT(s){return this.__data__.has(s)}Ro.prototype.add=Ro.prototype.push=YT,Ro.prototype.has=WT;function Lr(s){var l=this.__data__=new yi(s);this.size=l.size}function jT(){this.__data__=new yi,this.size=0}function BT(s){var l=this.__data__,d=l.delete(s);return this.size=l.size,d}function GT(s){return this.__data__.get(s)}function UT(s){return this.__data__.has(s)}function zT(s,l){var d=this.__data__;if(d instanceof yi){var g=d.__data__;if(!Pa||g.length<n-1)return g.push([s,l]),this.size=++d.size,this;d=this.__data__=new wi(g)}return d.set(s,l),this.size=d.size,this}Lr.prototype.clear=jT,Lr.prototype.delete=BT,Lr.prototype.get=GT,Lr.prototype.has=UT,Lr.prototype.set=zT;function Mm(s,l){var d=Ve(s),g=!d&&jo(s),w=!d&&!g&&to(s),C=!d&&!g&&!w&&Ms(s),I=d||g||w||C,W=I?ud(s.length,eT):[],Z=W.length;for(var ue in s)(l||Nt.call(s,ue))&&!(I&&(ue=="length"||w&&(ue=="offset"||ue=="parent")||C&&(ue=="buffer"||ue=="byteLength"||ue=="byteOffset")||Ti(ue,Z)))&&W.push(ue);return W}function Am(s){var l=s.length;return l?s[Cd(0,l-1)]:t}function HT(s,l){return ku(Xn(s),Lo(l,0,s.length))}function qT(s){return ku(Xn(s))}function gd(s,l,d){(d!==t&&!Fr(s[l],d)||d===t&&!(l in s))&&bi(s,l,d)}function Ra(s,l,d){var g=s[l];(!(Nt.call(s,l)&&Fr(g,d))||d===t&&!(l in s))&&bi(s,l,d)}function uu(s,l){for(var d=s.length;d--;)if(Fr(s[d][0],l))return d;return-1}function VT(s,l,d,g){return Ji(s,function(w,C,I){l(g,w,d(w),I)}),g}function Pm(s,l){return s&&ri(l,bn(l),s)}function KT(s,l){return s&&ri(l,Qn(l),s)}function bi(s,l,d){l=="__proto__"&&ru?ru(s,l,{configurable:!0,enumerable:!0,value:d,writable:!0}):s[l]=d}function _d(s,l){for(var d=-1,g=l.length,w=ie(g),C=s==null;++d<g;)w[d]=C?t:Jd(s,l[d]);return w}function Lo(s,l,d){return s===s&&(d!==t&&(s=s<=d?s:d),l!==t&&(s=s>=l?s:l)),s}function wr(s,l,d,g,w,C){var I,W=l&c,Z=l&p,ue=l&h;if(d&&(I=w?d(s,g,w,C):d(s)),I!==t)return I;if(!Kt(s))return s;var fe=Ve(s);if(fe){if(I=L2(s),!W)return Xn(s,I)}else{var pe=In(s),ve=pe==ge||pe==Ee;if(to(s))return tg(s,W);if(pe==rt||pe==ee||ve&&!w){if(I=Z||ve?{}:wg(s),!W)return Z?S2(s,KT(I,s)):T2(s,Pm(I,s))}else{if(!jt[pe])return w?s:{};I=F2(s,pe,W)}}C||(C=new Lr);var Te=C.get(s);if(Te)return Te;C.set(s,I),Zg(s)?s.forEach(function(Re){I.add(wr(Re,l,d,Re,s,C))}):Vg(s)&&s.forEach(function(Re,lt){I.set(lt,wr(Re,l,d,lt,s,C))});var Ie=ue?Z?Fd:Ld:Z?Qn:bn,$e=fe?t:Ie(s);return _r($e||s,function(Re,lt){$e&&(lt=Re,Re=s[lt]),Ra(I,lt,wr(Re,l,d,lt,s,C))}),I}function ZT(s){var l=bn(s);return function(d){return Nm(d,s,l)}}function Nm(s,l,d){var g=d.length;if(s==null)return!g;for(s=Rt(s);g--;){var w=d[g],C=l[w],I=s[w];if(I===t&&!(w in s)||!C(I))return!1}return!0}function xm(s,l,d){if(typeof s!="function")throw new vr(i);return Ga(function(){s.apply(t,d)},l)}function La(s,l,d,g){var w=-1,C=ql,I=!0,W=s.length,Z=[],ue=l.length;if(!W)return Z;d&&(l=qt(l,ir(d))),g?(C=rd,I=!1):l.length>=n&&(C=Ma,I=!1,l=new Ro(l));e:for(;++w<W;){var fe=s[w],pe=d==null?fe:d(fe);if(fe=g||fe!==0?fe:0,I&&pe===pe){for(var ve=ue;ve--;)if(l[ve]===pe)continue e;Z.push(fe)}else C(l,pe,g)||Z.push(fe)}return Z}var Ji=sg(ni),Im=sg(yd,!0);function XT(s,l){var d=!0;return Ji(s,function(g,w,C){return d=!!l(g,w,C),d}),d}function fu(s,l,d){for(var g=-1,w=s.length;++g<w;){var C=s[g],I=l(C);if(I!=null&&(W===t?I===I&&!sr(I):d(I,W)))var W=I,Z=C}return Z}function JT(s,l,d,g){var w=s.length;for(d=Xe(d),d<0&&(d=-d>w?0:w+d),g=g===t||g>w?w:Xe(g),g<0&&(g+=w),g=d>g?0:Jg(g);d<g;)s[d++]=l;return s}function Rm(s,l){var d=[];return Ji(s,function(g,w,C){l(g,w,C)&&d.push(g)}),d}function Dn(s,l,d,g,w){var C=-1,I=s.length;for(d||(d=W2),w||(w=[]);++C<I;){var W=s[C];l>0&&d(W)?l>1?Dn(W,l-1,d,g,w):Vi(w,W):g||(w[w.length]=W)}return w}var vd=ag(),Lm=ag(!0);function ni(s,l){return s&&vd(s,l,bn)}function yd(s,l){return s&&Lm(s,l,bn)}function cu(s,l){return qi(l,function(d){return Si(s[d])})}function Fo(s,l){l=$i(l,s);for(var d=0,g=l.length;s!=null&&d<g;)s=s[ii(l[d++])];return d&&d==g?s:t}function Fm(s,l,d){var g=l(s);return Ve(s)?g:Vi(g,d(s))}function Bn(s){return s==null?s===t?Gt:mr:xo&&xo in Rt(s)?x2(s):q2(s)}function wd(s,l){return s>l}function QT(s,l){return s!=null&&Nt.call(s,l)}function $T(s,l){return s!=null&&l in Rt(s)}function e2(s,l,d){return s>=xn(l,d)&&s<dn(l,d)}function bd(s,l,d){for(var g=d?rd:ql,w=s[0].length,C=s.length,I=C,W=ie(C),Z=1/0,ue=[];I--;){var fe=s[I];I&&l&&(fe=qt(fe,ir(l))),Z=xn(fe.length,Z),W[I]=!d&&(l||w>=120&&fe.length>=120)?new Ro(I&&fe):t}fe=s[0];var pe=-1,ve=W[0];e:for(;++pe<w&&ue.length<Z;){var Te=fe[pe],Ie=l?l(Te):Te;if(Te=d||Te!==0?Te:0,!(ve?Ma(ve,Ie):g(ue,Ie,d))){for(I=C;--I;){var $e=W[I];if(!($e?Ma($e,Ie):g(s[I],Ie,d)))continue e}ve&&ve.push(Ie),ue.push(Te)}}return ue}function t2(s,l,d,g){return ni(s,function(w,C,I){l(g,d(w),C,I)}),g}function Fa(s,l,d){l=$i(l,s),s=Tg(s,l);var g=s==null?s:s[ii(kr(l))];return g==null?t:rr(g,s,d)}function Ym(s){return Jt(s)&&Bn(s)==ee}function n2(s){return Jt(s)&&Bn(s)==yn}function r2(s){return Jt(s)&&Bn(s)==je}function Ya(s,l,d,g,w){return s===l?!0:s==null||l==null||!Jt(s)&&!Jt(l)?s!==s&&l!==l:i2(s,l,d,g,Ya,w)}function i2(s,l,d,g,w,C){var I=Ve(s),W=Ve(l),Z=I?_e:In(s),ue=W?_e:In(l);Z=Z==ee?rt:Z,ue=ue==ee?rt:ue;var fe=Z==rt,pe=ue==rt,ve=Z==ue;if(ve&&to(s)){if(!to(l))return!1;I=!0,fe=!1}if(ve&&!fe)return C||(C=new Lr),I||Ms(s)?_g(s,l,d,g,w,C):P2(s,l,Z,d,g,w,C);if(!(d&m)){var Te=fe&&Nt.call(s,"__wrapped__"),Ie=pe&&Nt.call(l,"__wrapped__");if(Te||Ie){var $e=Te?s.value():s,Re=Ie?l.value():l;return C||(C=new Lr),w($e,Re,d,g,C)}}return ve?(C||(C=new Lr),N2(s,l,d,g,w,C)):!1}function o2(s){return Jt(s)&&In(s)==vt}function kd(s,l,d,g){var w=d.length,C=w,I=!g;if(s==null)return!C;for(s=Rt(s);w--;){var W=d[w];if(I&&W[2]?W[1]!==s[W[0]]:!(W[0]in s))return!1}for(;++w<C;){W=d[w];var Z=W[0],ue=s[Z],fe=W[1];if(I&&W[2]){if(ue===t&&!(Z in s))return!1}else{var pe=new Lr;if(g)var ve=g(ue,fe,Z,s,l,pe);if(!(ve===t?Ya(fe,ue,m|_,g,pe):ve))return!1}}return!0}function Wm(s){if(!Kt(s)||B2(s))return!1;var l=Si(s)?oT:Gc;return l.test(Wo(s))}function s2(s){return Jt(s)&&Bn(s)==tr}function a2(s){return Jt(s)&&In(s)==_n}function l2(s){return Jt(s)&&Ou(s.length)&&!!Ut[Bn(s)]}function jm(s){return typeof s=="function"?s:s==null?$n:typeof s=="object"?Ve(s)?Um(s[0],s[1]):Gm(s):l_(s)}function Ed(s){if(!Ba(s))return cT(s);var l=[];for(var d in Rt(s))Nt.call(s,d)&&d!="constructor"&&l.push(d);return l}function u2(s){if(!Kt(s))return H2(s);var l=Ba(s),d=[];for(var g in s)g=="constructor"&&(l||!Nt.call(s,g))||d.push(g);return d}function Td(s,l){return s<l}function Bm(s,l){var d=-1,g=Jn(s)?ie(s.length):[];return Ji(s,function(w,C,I){g[++d]=l(w,C,I)}),g}function Gm(s){var l=Wd(s);return l.length==1&&l[0][2]?kg(l[0][0],l[0][1]):function(d){return d===s||kd(d,s,l)}}function Um(s,l){return Bd(s)&&bg(l)?kg(ii(s),l):function(d){var g=Jd(d,s);return g===t&&g===l?Qd(d,s):Ya(l,g,m|_)}}function du(s,l,d,g,w){s!==l&&vd(l,function(C,I){if(w||(w=new Lr),Kt(C))f2(s,l,I,d,du,g,w);else{var W=g?g(Ud(s,I),C,I+"",s,l,w):t;W===t&&(W=C),gd(s,I,W)}},Qn)}function f2(s,l,d,g,w,C,I){var W=Ud(s,d),Z=Ud(l,d),ue=I.get(Z);if(ue){gd(s,d,ue);return}var fe=C?C(W,Z,d+"",s,l,I):t,pe=fe===t;if(pe){var ve=Ve(Z),Te=!ve&&to(Z),Ie=!ve&&!Te&&Ms(Z);fe=Z,ve||Te||Ie?Ve(W)?fe=W:tn(W)?fe=Xn(W):Te?(pe=!1,fe=tg(Z,!0)):Ie?(pe=!1,fe=ng(Z,!0)):fe=[]:Ua(Z)||jo(Z)?(fe=W,jo(W)?fe=Qg(W):(!Kt(W)||Si(W))&&(fe=wg(Z))):pe=!1}pe&&(I.set(Z,fe),w(fe,Z,g,C,I),I.delete(Z)),gd(s,d,fe)}function zm(s,l){var d=s.length;if(!!d)return l+=l<0?d:0,Ti(l,d)?s[l]:t}function Hm(s,l,d){l.length?l=qt(l,function(C){return Ve(C)?function(I){return Fo(I,C.length===1?C[0]:C)}:C}):l=[$n];var g=-1;l=qt(l,ir(Pe()));var w=Bm(s,function(C,I,W){var Z=qt(l,function(ue){return ue(C)});return{criteria:Z,index:++g,value:C}});return FE(w,function(C,I){return E2(C,I,d)})}function c2(s,l){return qm(s,l,function(d,g){return Qd(s,g)})}function qm(s,l,d){for(var g=-1,w=l.length,C={};++g<w;){var I=l[g],W=Fo(s,I);d(W,I)&&Wa(C,$i(I,s),W)}return C}function d2(s){return function(l){return Fo(l,s)}}function Sd(s,l,d,g){var w=g?LE:ys,C=-1,I=l.length,W=s;for(s===l&&(l=Xn(l)),d&&(W=qt(s,ir(d)));++C<I;)for(var Z=0,ue=l[C],fe=d?d(ue):ue;(Z=w(W,fe,Z,g))>-1;)W!==s&&nu.call(W,Z,1),nu.call(s,Z,1);return s}function Vm(s,l){for(var d=s?l.length:0,g=d-1;d--;){var w=l[d];if(d==g||w!==C){var C=w;Ti(w)?nu.call(s,w,1):Md(s,w)}}return s}function Cd(s,l){return s+ou(Dm()*(l-s+1))}function p2(s,l,d,g){for(var w=-1,C=dn(iu((l-s)/(d||1)),0),I=ie(C);C--;)I[g?C:++w]=s,s+=d;return I}function Dd(s,l){var d="";if(!s||l<1||l>Q)return d;do l%2&&(d+=s),l=ou(l/2),l&&(s+=s);while(l);return d}function it(s,l){return zd(Eg(s,l,$n),s+"")}function h2(s){return Am(As(s))}function m2(s,l){var d=As(s);return ku(d,Lo(l,0,d.length))}function Wa(s,l,d,g){if(!Kt(s))return s;l=$i(l,s);for(var w=-1,C=l.length,I=C-1,W=s;W!=null&&++w<C;){var Z=ii(l[w]),ue=d;if(Z==="__proto__"||Z==="constructor"||Z==="prototype")return s;if(w!=I){var fe=W[Z];ue=g?g(fe,Z,W):t,ue===t&&(ue=Kt(fe)?fe:Ti(l[w+1])?[]:{})}Ra(W,Z,ue),W=W[Z]}return s}var Km=su?function(s,l){return su.set(s,l),s}:$n,g2=ru?function(s,l){return ru(s,"toString",{configurable:!0,enumerable:!1,value:ep(l),writable:!0})}:$n;function _2(s){return ku(As(s))}function br(s,l,d){var g=-1,w=s.length;l<0&&(l=-l>w?0:w+l),d=d>w?w:d,d<0&&(d+=w),w=l>d?0:d-l>>>0,l>>>=0;for(var C=ie(w);++g<w;)C[g]=s[g+l];return C}function v2(s,l){var d;return Ji(s,function(g,w,C){return d=l(g,w,C),!d}),!!d}function pu(s,l,d){var g=0,w=s==null?g:s.length;if(typeof l=="number"&&l===l&&w<=Y){for(;g<w;){var C=g+w>>>1,I=s[C];I!==null&&!sr(I)&&(d?I<=l:I<l)?g=C+1:w=C}return w}return Od(s,l,$n,d)}function Od(s,l,d,g){var w=0,C=s==null?0:s.length;if(C===0)return 0;l=d(l);for(var I=l!==l,W=l===null,Z=sr(l),ue=l===t;w<C;){var fe=ou((w+C)/2),pe=d(s[fe]),ve=pe!==t,Te=pe===null,Ie=pe===pe,$e=sr(pe);if(I)var Re=g||Ie;else ue?Re=Ie&&(g||ve):W?Re=Ie&&ve&&(g||!Te):Z?Re=Ie&&ve&&!Te&&(g||!$e):Te||$e?Re=!1:Re=g?pe<=l:pe<l;Re?w=fe+1:C=fe}return xn(C,re)}function Zm(s,l){for(var d=-1,g=s.length,w=0,C=[];++d<g;){var I=s[d],W=l?l(I):I;if(!d||!Fr(W,Z)){var Z=W;C[w++]=I===0?0:I}}return C}function Xm(s){return typeof s=="number"?s:sr(s)?U:+s}function or(s){if(typeof s=="string")return s;if(Ve(s))return qt(s,or)+"";if(sr(s))return Om?Om.call(s):"";var l=s+"";return l=="0"&&1/s==-S?"-0":l}function Qi(s,l,d){var g=-1,w=ql,C=s.length,I=!0,W=[],Z=W;if(d)I=!1,w=rd;else if(C>=n){var ue=l?null:M2(s);if(ue)return Kl(ue);I=!1,w=Ma,Z=new Ro}else Z=l?[]:W;e:for(;++g<C;){var fe=s[g],pe=l?l(fe):fe;if(fe=d||fe!==0?fe:0,I&&pe===pe){for(var ve=Z.length;ve--;)if(Z[ve]===pe)continue e;l&&Z.push(pe),W.push(fe)}else w(Z,pe,d)||(Z!==W&&Z.push(pe),W.push(fe))}return W}function Md(s,l){return l=$i(l,s),s=Tg(s,l),s==null||delete s[ii(kr(l))]}function Jm(s,l,d,g){return Wa(s,l,d(Fo(s,l)),g)}function hu(s,l,d,g){for(var w=s.length,C=g?w:-1;(g?C--:++C<w)&&l(s[C],C,s););return d?br(s,g?0:C,g?C+1:w):br(s,g?C+1:0,g?w:C)}function Qm(s,l){var d=s;return d instanceof ft&&(d=d.value()),id(l,function(g,w){return w.func.apply(w.thisArg,Vi([g],w.args))},d)}function Ad(s,l,d){var g=s.length;if(g<2)return g?Qi(s[0]):[];for(var w=-1,C=ie(g);++w<g;)for(var I=s[w],W=-1;++W<g;)W!=w&&(C[w]=La(C[w]||I,s[W],l,d));return Qi(Dn(C,1),l,d)}function $m(s,l,d){for(var g=-1,w=s.length,C=l.length,I={};++g<w;){var W=g<C?l[g]:t;d(I,s[g],W)}return I}function Pd(s){return tn(s)?s:[]}function Nd(s){return typeof s=="function"?s:$n}function $i(s,l){return Ve(s)?s:Bd(s,l)?[s]:Og(Ot(s))}var y2=it;function eo(s,l,d){var g=s.length;return d=d===t?g:d,!l&&d>=g?s:br(s,l,d)}var eg=sT||function(s){return wn.clearTimeout(s)};function tg(s,l){if(l)return s.slice();var d=s.length,g=km?km(d):new s.constructor(d);return s.copy(g),g}function xd(s){var l=new s.constructor(s.byteLength);return new eu(l).set(new eu(s)),l}function w2(s,l){var d=l?xd(s.buffer):s.buffer;return new s.constructor(d,s.byteOffset,s.byteLength)}function b2(s){var l=new s.constructor(s.source,jl.exec(s));return l.lastIndex=s.lastIndex,l}function k2(s){return Ia?Rt(Ia.call(s)):{}}function ng(s,l){var d=l?xd(s.buffer):s.buffer;return new s.constructor(d,s.byteOffset,s.length)}function rg(s,l){if(s!==l){var d=s!==t,g=s===null,w=s===s,C=sr(s),I=l!==t,W=l===null,Z=l===l,ue=sr(l);if(!W&&!ue&&!C&&s>l||C&&I&&Z&&!W&&!ue||g&&I&&Z||!d&&Z||!w)return 1;if(!g&&!C&&!ue&&s<l||ue&&d&&w&&!g&&!C||W&&d&&w||!I&&w||!Z)return-1}return 0}function E2(s,l,d){for(var g=-1,w=s.criteria,C=l.criteria,I=w.length,W=d.length;++g<I;){var Z=rg(w[g],C[g]);if(Z){if(g>=W)return Z;var ue=d[g];return Z*(ue=="desc"?-1:1)}}return s.index-l.index}function ig(s,l,d,g){for(var w=-1,C=s.length,I=d.length,W=-1,Z=l.length,ue=dn(C-I,0),fe=ie(Z+ue),pe=!g;++W<Z;)fe[W]=l[W];for(;++w<I;)(pe||w<C)&&(fe[d[w]]=s[w]);for(;ue--;)fe[W++]=s[w++];return fe}function og(s,l,d,g){for(var w=-1,C=s.length,I=-1,W=d.length,Z=-1,ue=l.length,fe=dn(C-W,0),pe=ie(fe+ue),ve=!g;++w<fe;)pe[w]=s[w];for(var Te=w;++Z<ue;)pe[Te+Z]=l[Z];for(;++I<W;)(ve||w<C)&&(pe[Te+d[I]]=s[w++]);return pe}function Xn(s,l){var d=-1,g=s.length;for(l||(l=ie(g));++d<g;)l[d]=s[d];return l}function ri(s,l,d,g){var w=!d;d||(d={});for(var C=-1,I=l.length;++C<I;){var W=l[C],Z=g?g(d[W],s[W],W,d,s):t;Z===t&&(Z=s[W]),w?bi(d,W,Z):Ra(d,W,Z)}return d}function T2(s,l){return ri(s,jd(s),l)}function S2(s,l){return ri(s,vg(s),l)}function mu(s,l){return function(d,g){var w=Ve(d)?AE:VT,C=l?l():{};return w(d,s,Pe(g,2),C)}}function Cs(s){return it(function(l,d){var g=-1,w=d.length,C=w>1?d[w-1]:t,I=w>2?d[2]:t;for(C=s.length>3&&typeof C=="function"?(w--,C):t,I&&Gn(d[0],d[1],I)&&(C=w<3?t:C,w=1),l=Rt(l);++g<w;){var W=d[g];W&&s(l,W,g,C)}return l})}function sg(s,l){return function(d,g){if(d==null)return d;if(!Jn(d))return s(d,g);for(var w=d.length,C=l?w:-1,I=Rt(d);(l?C--:++C<w)&&g(I[C],C,I)!==!1;);return d}}function ag(s){return function(l,d,g){for(var w=-1,C=Rt(l),I=g(l),W=I.length;W--;){var Z=I[s?W:++w];if(d(C[Z],Z,C)===!1)break}return l}}function C2(s,l,d){var g=l&v,w=ja(s);function C(){var I=this&&this!==wn&&this instanceof C?w:s;return I.apply(g?d:this,arguments)}return C}function lg(s){return function(l){l=Ot(l);var d=ws(l)?Rr(l):t,g=d?d[0]:l.charAt(0),w=d?eo(d,1).join(""):l.slice(1);return g[s]()+w}}function Ds(s){return function(l){return id(s_(o_(l).replace(gE,"")),s,"")}}function ja(s){return function(){var l=arguments;switch(l.length){case 0:return new s;case 1:return new s(l[0]);case 2:return new s(l[0],l[1]);case 3:return new s(l[0],l[1],l[2]);case 4:return new s(l[0],l[1],l[2],l[3]);case 5:return new s(l[0],l[1],l[2],l[3],l[4]);case 6:return new s(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new s(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var d=Ss(s.prototype),g=s.apply(d,l);return Kt(g)?g:d}}function D2(s,l,d){var g=ja(s);function w(){for(var C=arguments.length,I=ie(C),W=C,Z=Os(w);W--;)I[W]=arguments[W];var ue=C<3&&I[0]!==Z&&I[C-1]!==Z?[]:Ki(I,Z);if(C-=ue.length,C<d)return pg(s,l,gu,w.placeholder,t,I,ue,t,t,d-C);var fe=this&&this!==wn&&this instanceof w?g:s;return rr(fe,this,I)}return w}function ug(s){return function(l,d,g){var w=Rt(l);if(!Jn(l)){var C=Pe(d,3);l=bn(l),d=function(W){return C(w[W],W,w)}}var I=s(l,d,g);return I>-1?w[C?l[I]:I]:t}}function fg(s){return Ei(function(l){var d=l.length,g=d,w=yr.prototype.thru;for(s&&l.reverse();g--;){var C=l[g];if(typeof C!="function")throw new vr(i);if(w&&!I&&wu(C)=="wrapper")var I=new yr([],!0)}for(g=I?g:d;++g<d;){C=l[g];var W=wu(C),Z=W=="wrapper"?Yd(C):t;Z&&Gd(Z[0])&&Z[1]==(P|y|D|L)&&!Z[4].length&&Z[9]==1?I=I[wu(Z[0])].apply(I,Z[3]):I=C.length==1&&Gd(C)?I[W]():I.thru(C)}return function(){var ue=arguments,fe=ue[0];if(I&&ue.length==1&&Ve(fe))return I.plant(fe).value();for(var pe=0,ve=d?l[pe].apply(this,ue):fe;++pe<d;)ve=l[pe].call(this,ve);return ve}})}function gu(s,l,d,g,w,C,I,W,Z,ue){var fe=l&P,pe=l&v,ve=l&b,Te=l&(y|O),Ie=l&R,$e=ve?t:ja(s);function Re(){for(var lt=arguments.length,mt=ie(lt),ar=lt;ar--;)mt[ar]=arguments[ar];if(Te)var Un=Os(Re),lr=WE(mt,Un);if(g&&(mt=ig(mt,g,w,Te)),C&&(mt=og(mt,C,I,Te)),lt-=lr,Te&&lt<ue){var nn=Ki(mt,Un);return pg(s,l,gu,Re.placeholder,d,mt,nn,W,Z,ue-lt)}var Yr=pe?d:this,Di=ve?Yr[s]:s;return lt=mt.length,W?mt=V2(mt,W):Ie&&lt>1&&mt.reverse(),fe&&Z<lt&&(mt.length=Z),this&&this!==wn&&this instanceof Re&&(Di=$e||ja(Di)),Di.apply(Yr,mt)}return Re}function cg(s,l){return function(d,g){return t2(d,s,l(g),{})}}function _u(s,l){return function(d,g){var w;if(d===t&&g===t)return l;if(d!==t&&(w=d),g!==t){if(w===t)return g;typeof d=="string"||typeof g=="string"?(d=or(d),g=or(g)):(d=Xm(d),g=Xm(g)),w=s(d,g)}return w}}function Id(s){return Ei(function(l){return l=qt(l,ir(Pe())),it(function(d){var g=this;return s(l,function(w){return rr(w,g,d)})})})}function vu(s,l){l=l===t?" ":or(l);var d=l.length;if(d<2)return d?Dd(l,s):l;var g=Dd(l,iu(s/bs(l)));return ws(l)?eo(Rr(g),0,s).join(""):g.slice(0,s)}function O2(s,l,d,g){var w=l&v,C=ja(s);function I(){for(var W=-1,Z=arguments.length,ue=-1,fe=g.length,pe=ie(fe+Z),ve=this&&this!==wn&&this instanceof I?C:s;++ue<fe;)pe[ue]=g[ue];for(;Z--;)pe[ue++]=arguments[++W];return rr(ve,w?d:this,pe)}return I}function dg(s){return function(l,d,g){return g&&typeof g!="number"&&Gn(l,d,g)&&(d=g=t),l=Ci(l),d===t?(d=l,l=0):d=Ci(d),g=g===t?l<d?1:-1:Ci(g),p2(l,d,g,s)}}function yu(s){return function(l,d){return typeof l=="string"&&typeof d=="string"||(l=Er(l),d=Er(d)),s(l,d)}}function pg(s,l,d,g,w,C,I,W,Z,ue){var fe=l&y,pe=fe?I:t,ve=fe?t:I,Te=fe?C:t,Ie=fe?t:C;l|=fe?D:F,l&=~(fe?F:D),l&E||(l&=~(v|b));var $e=[s,l,w,Te,pe,Ie,ve,W,Z,ue],Re=d.apply(t,$e);return Gd(s)&&Sg(Re,$e),Re.placeholder=g,Cg(Re,s,l)}function Rd(s){var l=cn[s];return function(d,g){if(d=Er(d),g=g==null?0:xn(Xe(g),292),g&&Cm(d)){var w=(Ot(d)+"e").split("e"),C=l(w[0]+"e"+(+w[1]+g));return w=(Ot(C)+"e").split("e"),+(w[0]+"e"+(+w[1]-g))}return l(d)}}var M2=Es&&1/Kl(new Es([,-0]))[1]==S?function(s){return new Es(s)}:rp;function hg(s){return function(l){var d=In(l);return d==vt?cd(l):d==_n?qE(l):YE(l,s(l))}}function ki(s,l,d,g,w,C,I,W){var Z=l&b;if(!Z&&typeof s!="function")throw new vr(i);var ue=g?g.length:0;if(ue||(l&=~(D|F),g=w=t),I=I===t?I:dn(Xe(I),0),W=W===t?W:Xe(W),ue-=w?w.length:0,l&F){var fe=g,pe=w;g=w=t}var ve=Z?t:Yd(s),Te=[s,l,d,g,w,fe,pe,C,I,W];if(ve&&z2(Te,ve),s=Te[0],l=Te[1],d=Te[2],g=Te[3],w=Te[4],W=Te[9]=Te[9]===t?Z?0:s.length:dn(Te[9]-ue,0),!W&&l&(y|O)&&(l&=~(y|O)),!l||l==v)var Ie=C2(s,l,d);else l==y||l==O?Ie=D2(s,l,W):(l==D||l==(v|D))&&!w.length?Ie=O2(s,l,d,g):Ie=gu.apply(t,Te);var $e=ve?Km:Sg;return Cg($e(Ie,Te),s,l)}function mg(s,l,d,g){return s===t||Fr(s,ks[d])&&!Nt.call(g,d)?l:s}function gg(s,l,d,g,w,C){return Kt(s)&&Kt(l)&&(C.set(l,s),du(s,l,t,gg,C),C.delete(l)),s}function A2(s){return Ua(s)?t:s}function _g(s,l,d,g,w,C){var I=d&m,W=s.length,Z=l.length;if(W!=Z&&!(I&&Z>W))return!1;var ue=C.get(s),fe=C.get(l);if(ue&&fe)return ue==l&&fe==s;var pe=-1,ve=!0,Te=d&_?new Ro:t;for(C.set(s,l),C.set(l,s);++pe<W;){var Ie=s[pe],$e=l[pe];if(g)var Re=I?g($e,Ie,pe,l,s,C):g(Ie,$e,pe,s,l,C);if(Re!==t){if(Re)continue;ve=!1;break}if(Te){if(!od(l,function(lt,mt){if(!Ma(Te,mt)&&(Ie===lt||w(Ie,lt,d,g,C)))return Te.push(mt)})){ve=!1;break}}else if(!(Ie===$e||w(Ie,$e,d,g,C))){ve=!1;break}}return C.delete(s),C.delete(l),ve}function P2(s,l,d,g,w,C,I){switch(d){case jn:if(s.byteLength!=l.byteLength||s.byteOffset!=l.byteOffset)return!1;s=s.buffer,l=l.buffer;case yn:return!(s.byteLength!=l.byteLength||!C(new eu(s),new eu(l)));case Fe:case je:case Ht:return Fr(+s,+l);case ht:return s.name==l.name&&s.message==l.message;case tr:case vn:return s==l+"";case vt:var W=cd;case _n:var Z=g&m;if(W||(W=Kl),s.size!=l.size&&!Z)return!1;var ue=I.get(s);if(ue)return ue==l;g|=_,I.set(s,l);var fe=_g(W(s),W(l),g,w,C,I);return I.delete(s),fe;case Yn:if(Ia)return Ia.call(s)==Ia.call(l)}return!1}function N2(s,l,d,g,w,C){var I=d&m,W=Ld(s),Z=W.length,ue=Ld(l),fe=ue.length;if(Z!=fe&&!I)return!1;for(var pe=Z;pe--;){var ve=W[pe];if(!(I?ve in l:Nt.call(l,ve)))return!1}var Te=C.get(s),Ie=C.get(l);if(Te&&Ie)return Te==l&&Ie==s;var $e=!0;C.set(s,l),C.set(l,s);for(var Re=I;++pe<Z;){ve=W[pe];var lt=s[ve],mt=l[ve];if(g)var ar=I?g(mt,lt,ve,l,s,C):g(lt,mt,ve,s,l,C);if(!(ar===t?lt===mt||w(lt,mt,d,g,C):ar)){$e=!1;break}Re||(Re=ve=="constructor")}if($e&&!Re){var Un=s.constructor,lr=l.constructor;Un!=lr&&"constructor"in s&&"constructor"in l&&!(typeof Un=="function"&&Un instanceof Un&&typeof lr=="function"&&lr instanceof lr)&&($e=!1)}return C.delete(s),C.delete(l),$e}function Ei(s){return zd(Eg(s,t,Ng),s+"")}function Ld(s){return Fm(s,bn,jd)}function Fd(s){return Fm(s,Qn,vg)}var Yd=su?function(s){return su.get(s)}:rp;function wu(s){for(var l=s.name+"",d=Ts[l],g=Nt.call(Ts,l)?d.length:0;g--;){var w=d[g],C=w.func;if(C==null||C==s)return w.name}return l}function Os(s){var l=Nt.call(T,"placeholder")?T:s;return l.placeholder}function Pe(){var s=T.iteratee||tp;return s=s===tp?jm:s,arguments.length?s(arguments[0],arguments[1]):s}function bu(s,l){var d=s.__data__;return j2(l)?d[typeof l=="string"?"string":"hash"]:d.map}function Wd(s){for(var l=bn(s),d=l.length;d--;){var g=l[d],w=s[g];l[d]=[g,w,bg(w)]}return l}function Yo(s,l){var d=UE(s,l);return Wm(d)?d:t}function x2(s){var l=Nt.call(s,xo),d=s[xo];try{s[xo]=t;var g=!0}catch(C){}var w=Ql.call(s);return g&&(l?s[xo]=d:delete s[xo]),w}var jd=pd?function(s){return s==null?[]:(s=Rt(s),qi(pd(s),function(l){return Tm.call(s,l)}))}:ip,vg=pd?function(s){for(var l=[];s;)Vi(l,jd(s)),s=tu(s);return l}:ip,In=Bn;(hd&&In(new hd(new ArrayBuffer(1)))!=jn||Pa&&In(new Pa)!=vt||md&&In(md.resolve())!=Ue||Es&&In(new Es)!=_n||Na&&In(new Na)!=Wn)&&(In=function(s){var l=Bn(s),d=l==rt?s.constructor:t,g=d?Wo(d):"";if(g)switch(g){case mT:return jn;case gT:return vt;case _T:return Ue;case vT:return _n;case yT:return Wn}return l});function I2(s,l,d){for(var g=-1,w=d.length;++g<w;){var C=d[g],I=C.size;switch(C.type){case"drop":s+=I;break;case"dropRight":l-=I;break;case"take":l=xn(l,s+I);break;case"takeRight":s=dn(s,l-I);break}}return{start:s,end:l}}function R2(s){var l=s.match(Ic);return l?l[1].split(Rc):[]}function yg(s,l,d){l=$i(l,s);for(var g=-1,w=l.length,C=!1;++g<w;){var I=ii(l[g]);if(!(C=s!=null&&d(s,I)))break;s=s[I]}return C||++g!=w?C:(w=s==null?0:s.length,!!w&&Ou(w)&&Ti(I,w)&&(Ve(s)||jo(s)))}function L2(s){var l=s.length,d=new s.constructor(l);return l&&typeof s[0]=="string"&&Nt.call(s,"index")&&(d.index=s.index,d.input=s.input),d}function wg(s){return typeof s.constructor=="function"&&!Ba(s)?Ss(tu(s)):{}}function F2(s,l,d){var g=s.constructor;switch(l){case yn:return xd(s);case Fe:case je:return new g(+s);case jn:return w2(s,d);case Kn:case Zn:case Hi:case ei:case Oo:case Mo:case ne:case De:case bt:return ng(s,d);case vt:return new g;case Ht:case vn:return new g(s);case tr:return b2(s);case _n:return new g;case Yn:return k2(s)}}function Y2(s,l){var d=l.length;if(!d)return s;var g=d-1;return l[g]=(d>1?"& ":"")+l[g],l=l.join(d>2?", ":" "),s.replace(xc,`{
/* [wrapped with `+l+`] */
`)}function W2(s){return Ve(s)||jo(s)||!!(Sm&&s&&s[Sm])}function Ti(s,l){var d=typeof s;return l=l==null?Q:l,!!l&&(d=="number"||d!="symbol"&&zc.test(s))&&s>-1&&s%1==0&&s<l}function Gn(s,l,d){if(!Kt(d))return!1;var g=typeof l;return(g=="number"?Jn(d)&&Ti(l,d.length):g=="string"&&l in d)?Fr(d[l],s):!1}function Bd(s,l){if(Ve(s))return!1;var d=typeof s;return d=="number"||d=="symbol"||d=="boolean"||s==null||sr(s)?!0:Mc.test(s)||!Oc.test(s)||l!=null&&s in Rt(l)}function j2(s){var l=typeof s;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?s!=="__proto__":s===null}function Gd(s){var l=wu(s),d=T[l];if(typeof d!="function"||!(l in ft.prototype))return!1;if(s===d)return!0;var g=Yd(d);return!!g&&s===g[0]}function B2(s){return!!bm&&bm in s}var G2=Xl?Si:op;function Ba(s){var l=s&&s.constructor,d=typeof l=="function"&&l.prototype||ks;return s===d}function bg(s){return s===s&&!Kt(s)}function kg(s,l){return function(d){return d==null?!1:d[s]===l&&(l!==t||s in Rt(d))}}function U2(s){var l=Cu(s,function(g){return d.size===u&&d.clear(),g}),d=l.cache;return l}function z2(s,l){var d=s[1],g=l[1],w=d|g,C=w<(v|b|P),I=g==P&&d==y||g==P&&d==L&&s[7].length<=l[8]||g==(P|L)&&l[7].length<=l[8]&&d==y;if(!(C||I))return s;g&v&&(s[2]=l[2],w|=d&v?0:E);var W=l[3];if(W){var Z=s[3];s[3]=Z?ig(Z,W,l[4]):W,s[4]=Z?Ki(s[3],f):l[4]}return W=l[5],W&&(Z=s[5],s[5]=Z?og(Z,W,l[6]):W,s[6]=Z?Ki(s[5],f):l[6]),W=l[7],W&&(s[7]=W),g&P&&(s[8]=s[8]==null?l[8]:xn(s[8],l[8])),s[9]==null&&(s[9]=l[9]),s[0]=l[0],s[1]=w,s}function H2(s){var l=[];if(s!=null)for(var d in Rt(s))l.push(d);return l}function q2(s){return Ql.call(s)}function Eg(s,l,d){return l=dn(l===t?s.length-1:l,0),function(){for(var g=arguments,w=-1,C=dn(g.length-l,0),I=ie(C);++w<C;)I[w]=g[l+w];w=-1;for(var W=ie(l+1);++w<l;)W[w]=g[w];return W[l]=d(I),rr(s,this,W)}}function Tg(s,l){return l.length<2?s:Fo(s,br(l,0,-1))}function V2(s,l){for(var d=s.length,g=xn(l.length,d),w=Xn(s);g--;){var C=l[g];s[g]=Ti(C,d)?w[C]:t}return s}function Ud(s,l){if(!(l==="constructor"&&typeof s[l]=="function")&&l!="__proto__")return s[l]}var Sg=Dg(Km),Ga=lT||function(s,l){return wn.setTimeout(s,l)},zd=Dg(g2);function Cg(s,l,d){var g=l+"";return zd(s,Y2(g,K2(R2(g),d)))}function Dg(s){var l=0,d=0;return function(){var g=dT(),w=V-(g-d);if(d=g,w>0){if(++l>=le)return arguments[0]}else l=0;return s.apply(t,arguments)}}function ku(s,l){var d=-1,g=s.length,w=g-1;for(l=l===t?g:l;++d<l;){var C=Cd(d,w),I=s[C];s[C]=s[d],s[d]=I}return s.length=l,s}var Og=U2(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace(Ac,function(d,g,w,C){l.push(w?C.replace(Yc,"$1"):g||d)}),l});function ii(s){if(typeof s=="string"||sr(s))return s;var l=s+"";return l=="0"&&1/s==-S?"-0":l}function Wo(s){if(s!=null){try{return Jl.call(s)}catch(l){}try{return s+""}catch(l){}}return""}function K2(s,l){return _r(z,function(d){var g="_."+d[0];l&d[1]&&!ql(s,g)&&s.push(g)}),s.sort()}function Mg(s){if(s instanceof ft)return s.clone();var l=new yr(s.__wrapped__,s.__chain__);return l.__actions__=Xn(s.__actions__),l.__index__=s.__index__,l.__values__=s.__values__,l}function Z2(s,l,d){(d?Gn(s,l,d):l===t)?l=1:l=dn(Xe(l),0);var g=s==null?0:s.length;if(!g||l<1)return[];for(var w=0,C=0,I=ie(iu(g/l));w<g;)I[C++]=br(s,w,w+=l);return I}function X2(s){for(var l=-1,d=s==null?0:s.length,g=0,w=[];++l<d;){var C=s[l];C&&(w[g++]=C)}return w}function J2(){var s=arguments.length;if(!s)return[];for(var l=ie(s-1),d=arguments[0],g=s;g--;)l[g-1]=arguments[g];return Vi(Ve(d)?Xn(d):[d],Dn(l,1))}var Q2=it(function(s,l){return tn(s)?La(s,Dn(l,1,tn,!0)):[]}),$2=it(function(s,l){var d=kr(l);return tn(d)&&(d=t),tn(s)?La(s,Dn(l,1,tn,!0),Pe(d,2)):[]}),eS=it(function(s,l){var d=kr(l);return tn(d)&&(d=t),tn(s)?La(s,Dn(l,1,tn,!0),t,d):[]});function tS(s,l,d){var g=s==null?0:s.length;return g?(l=d||l===t?1:Xe(l),br(s,l<0?0:l,g)):[]}function nS(s,l,d){var g=s==null?0:s.length;return g?(l=d||l===t?1:Xe(l),l=g-l,br(s,0,l<0?0:l)):[]}function rS(s,l){return s&&s.length?hu(s,Pe(l,3),!0,!0):[]}function iS(s,l){return s&&s.length?hu(s,Pe(l,3),!0):[]}function oS(s,l,d,g){var w=s==null?0:s.length;return w?(d&&typeof d!="number"&&Gn(s,l,d)&&(d=0,g=w),JT(s,l,d,g)):[]}function Ag(s,l,d){var g=s==null?0:s.length;if(!g)return-1;var w=d==null?0:Xe(d);return w<0&&(w=dn(g+w,0)),Vl(s,Pe(l,3),w)}function Pg(s,l,d){var g=s==null?0:s.length;if(!g)return-1;var w=g-1;return d!==t&&(w=Xe(d),w=d<0?dn(g+w,0):xn(w,g-1)),Vl(s,Pe(l,3),w,!0)}function Ng(s){var l=s==null?0:s.length;return l?Dn(s,1):[]}function sS(s){var l=s==null?0:s.length;return l?Dn(s,S):[]}function aS(s,l){var d=s==null?0:s.length;return d?(l=l===t?1:Xe(l),Dn(s,l)):[]}function lS(s){for(var l=-1,d=s==null?0:s.length,g={};++l<d;){var w=s[l];g[w[0]]=w[1]}return g}function xg(s){return s&&s.length?s[0]:t}function uS(s,l,d){var g=s==null?0:s.length;if(!g)return-1;var w=d==null?0:Xe(d);return w<0&&(w=dn(g+w,0)),ys(s,l,w)}function fS(s){var l=s==null?0:s.length;return l?br(s,0,-1):[]}var cS=it(function(s){var l=qt(s,Pd);return l.length&&l[0]===s[0]?bd(l):[]}),dS=it(function(s){var l=kr(s),d=qt(s,Pd);return l===kr(d)?l=t:d.pop(),d.length&&d[0]===s[0]?bd(d,Pe(l,2)):[]}),pS=it(function(s){var l=kr(s),d=qt(s,Pd);return l=typeof l=="function"?l:t,l&&d.pop(),d.length&&d[0]===s[0]?bd(d,t,l):[]});function hS(s,l){return s==null?"":fT.call(s,l)}function kr(s){var l=s==null?0:s.length;return l?s[l-1]:t}function mS(s,l,d){var g=s==null?0:s.length;if(!g)return-1;var w=g;return d!==t&&(w=Xe(d),w=w<0?dn(g+w,0):xn(w,g-1)),l===l?KE(s,l,w):Vl(s,pm,w,!0)}function gS(s,l){return s&&s.length?zm(s,Xe(l)):t}var _S=it(Ig);function Ig(s,l){return s&&s.length&&l&&l.length?Sd(s,l):s}function vS(s,l,d){return s&&s.length&&l&&l.length?Sd(s,l,Pe(d,2)):s}function yS(s,l,d){return s&&s.length&&l&&l.length?Sd(s,l,t,d):s}var wS=Ei(function(s,l){var d=s==null?0:s.length,g=_d(s,l);return Vm(s,qt(l,function(w){return Ti(w,d)?+w:w}).sort(rg)),g});function bS(s,l){var d=[];if(!(s&&s.length))return d;var g=-1,w=[],C=s.length;for(l=Pe(l,3);++g<C;){var I=s[g];l(I,g,s)&&(d.push(I),w.push(g))}return Vm(s,w),d}function Hd(s){return s==null?s:hT.call(s)}function kS(s,l,d){var g=s==null?0:s.length;return g?(d&&typeof d!="number"&&Gn(s,l,d)?(l=0,d=g):(l=l==null?0:Xe(l),d=d===t?g:Xe(d)),br(s,l,d)):[]}function ES(s,l){return pu(s,l)}function TS(s,l,d){return Od(s,l,Pe(d,2))}function SS(s,l){var d=s==null?0:s.length;if(d){var g=pu(s,l);if(g<d&&Fr(s[g],l))return g}return-1}function CS(s,l){return pu(s,l,!0)}function DS(s,l,d){return Od(s,l,Pe(d,2),!0)}function OS(s,l){var d=s==null?0:s.length;if(d){var g=pu(s,l,!0)-1;if(Fr(s[g],l))return g}return-1}function MS(s){return s&&s.length?Zm(s):[]}function AS(s,l){return s&&s.length?Zm(s,Pe(l,2)):[]}function PS(s){var l=s==null?0:s.length;return l?br(s,1,l):[]}function NS(s,l,d){return s&&s.length?(l=d||l===t?1:Xe(l),br(s,0,l<0?0:l)):[]}function xS(s,l,d){var g=s==null?0:s.length;return g?(l=d||l===t?1:Xe(l),l=g-l,br(s,l<0?0:l,g)):[]}function IS(s,l){return s&&s.length?hu(s,Pe(l,3),!1,!0):[]}function RS(s,l){return s&&s.length?hu(s,Pe(l,3)):[]}var LS=it(function(s){return Qi(Dn(s,1,tn,!0))}),FS=it(function(s){var l=kr(s);return tn(l)&&(l=t),Qi(Dn(s,1,tn,!0),Pe(l,2))}),YS=it(function(s){var l=kr(s);return l=typeof l=="function"?l:t,Qi(Dn(s,1,tn,!0),t,l)});function WS(s){return s&&s.length?Qi(s):[]}function jS(s,l){return s&&s.length?Qi(s,Pe(l,2)):[]}function BS(s,l){return l=typeof l=="function"?l:t,s&&s.length?Qi(s,t,l):[]}function qd(s){if(!(s&&s.length))return[];var l=0;return s=qi(s,function(d){if(tn(d))return l=dn(d.length,l),!0}),ud(l,function(d){return qt(s,sd(d))})}function Rg(s,l){if(!(s&&s.length))return[];var d=qd(s);return l==null?d:qt(d,function(g){return rr(l,t,g)})}var GS=it(function(s,l){return tn(s)?La(s,l):[]}),US=it(function(s){return Ad(qi(s,tn))}),zS=it(function(s){var l=kr(s);return tn(l)&&(l=t),Ad(qi(s,tn),Pe(l,2))}),HS=it(function(s){var l=kr(s);return l=typeof l=="function"?l:t,Ad(qi(s,tn),t,l)}),qS=it(qd);function VS(s,l){return $m(s||[],l||[],Ra)}function KS(s,l){return $m(s||[],l||[],Wa)}var ZS=it(function(s){var l=s.length,d=l>1?s[l-1]:t;return d=typeof d=="function"?(s.pop(),d):t,Rg(s,d)});function Lg(s){var l=T(s);return l.__chain__=!0,l}function XS(s,l){return l(s),s}function Eu(s,l){return l(s)}var JS=Ei(function(s){var l=s.length,d=l?s[0]:0,g=this.__wrapped__,w=function(C){return _d(C,s)};return l>1||this.__actions__.length||!(g instanceof ft)||!Ti(d)?this.thru(w):(g=g.slice(d,+d+(l?1:0)),g.__actions__.push({func:Eu,args:[w],thisArg:t}),new yr(g,this.__chain__).thru(function(C){return l&&!C.length&&C.push(t),C}))});function QS(){return Lg(this)}function $S(){return new yr(this.value(),this.__chain__)}function eC(){this.__values__===t&&(this.__values__=Xg(this.value()));var s=this.__index__>=this.__values__.length,l=s?t:this.__values__[this.__index__++];return{done:s,value:l}}function tC(){return this}function nC(s){for(var l,d=this;d instanceof lu;){var g=Mg(d);g.__index__=0,g.__values__=t,l?w.__wrapped__=g:l=g;var w=g;d=d.__wrapped__}return w.__wrapped__=s,l}function rC(){var s=this.__wrapped__;if(s instanceof ft){var l=s;return this.__actions__.length&&(l=new ft(this)),l=l.reverse(),l.__actions__.push({func:Eu,args:[Hd],thisArg:t}),new yr(l,this.__chain__)}return this.thru(Hd)}function iC(){return Qm(this.__wrapped__,this.__actions__)}var oC=mu(function(s,l,d){Nt.call(s,d)?++s[d]:bi(s,d,1)});function sC(s,l,d){var g=Ve(s)?cm:XT;return d&&Gn(s,l,d)&&(l=t),g(s,Pe(l,3))}function aC(s,l){var d=Ve(s)?qi:Rm;return d(s,Pe(l,3))}var lC=ug(Ag),uC=ug(Pg);function fC(s,l){return Dn(Tu(s,l),1)}function cC(s,l){return Dn(Tu(s,l),S)}function dC(s,l,d){return d=d===t?1:Xe(d),Dn(Tu(s,l),d)}function Fg(s,l){var d=Ve(s)?_r:Ji;return d(s,Pe(l,3))}function Yg(s,l){var d=Ve(s)?PE:Im;return d(s,Pe(l,3))}var pC=mu(function(s,l,d){Nt.call(s,d)?s[d].push(l):bi(s,d,[l])});function hC(s,l,d,g){s=Jn(s)?s:As(s),d=d&&!g?Xe(d):0;var w=s.length;return d<0&&(d=dn(w+d,0)),Mu(s)?d<=w&&s.indexOf(l,d)>-1:!!w&&ys(s,l,d)>-1}var mC=it(function(s,l,d){var g=-1,w=typeof l=="function",C=Jn(s)?ie(s.length):[];return Ji(s,function(I){C[++g]=w?rr(l,I,d):Fa(I,l,d)}),C}),gC=mu(function(s,l,d){bi(s,d,l)});function Tu(s,l){var d=Ve(s)?qt:Bm;return d(s,Pe(l,3))}function _C(s,l,d,g){return s==null?[]:(Ve(l)||(l=l==null?[]:[l]),d=g?t:d,Ve(d)||(d=d==null?[]:[d]),Hm(s,l,d))}var vC=mu(function(s,l,d){s[d?0:1].push(l)},function(){return[[],[]]});function yC(s,l,d){var g=Ve(s)?id:mm,w=arguments.length<3;return g(s,Pe(l,4),d,w,Ji)}function wC(s,l,d){var g=Ve(s)?NE:mm,w=arguments.length<3;return g(s,Pe(l,4),d,w,Im)}function bC(s,l){var d=Ve(s)?qi:Rm;return d(s,Du(Pe(l,3)))}function kC(s){var l=Ve(s)?Am:h2;return l(s)}function EC(s,l,d){(d?Gn(s,l,d):l===t)?l=1:l=Xe(l);var g=Ve(s)?HT:m2;return g(s,l)}function TC(s){var l=Ve(s)?qT:_2;return l(s)}function SC(s){if(s==null)return 0;if(Jn(s))return Mu(s)?bs(s):s.length;var l=In(s);return l==vt||l==_n?s.size:Ed(s).length}function CC(s,l,d){var g=Ve(s)?od:v2;return d&&Gn(s,l,d)&&(l=t),g(s,Pe(l,3))}var DC=it(function(s,l){if(s==null)return[];var d=l.length;return d>1&&Gn(s,l[0],l[1])?l=[]:d>2&&Gn(l[0],l[1],l[2])&&(l=[l[0]]),Hm(s,Dn(l,1),[])}),Su=aT||function(){return wn.Date.now()};function OC(s,l){if(typeof l!="function")throw new vr(i);return s=Xe(s),function(){if(--s<1)return l.apply(this,arguments)}}function Wg(s,l,d){return l=d?t:l,l=s&&l==null?s.length:l,ki(s,P,t,t,t,t,l)}function jg(s,l){var d;if(typeof l!="function")throw new vr(i);return s=Xe(s),function(){return--s>0&&(d=l.apply(this,arguments)),s<=1&&(l=t),d}}var Vd=it(function(s,l,d){var g=v;if(d.length){var w=Ki(d,Os(Vd));g|=D}return ki(s,g,l,d,w)}),Bg=it(function(s,l,d){var g=v|b;if(d.length){var w=Ki(d,Os(Bg));g|=D}return ki(l,g,s,d,w)});function Gg(s,l,d){l=d?t:l;var g=ki(s,y,t,t,t,t,t,l);return g.placeholder=Gg.placeholder,g}function Ug(s,l,d){l=d?t:l;var g=ki(s,O,t,t,t,t,t,l);return g.placeholder=Ug.placeholder,g}function zg(s,l,d){var g,w,C,I,W,Z,ue=0,fe=!1,pe=!1,ve=!0;if(typeof s!="function")throw new vr(i);l=Er(l)||0,Kt(d)&&(fe=!!d.leading,pe="maxWait"in d,C=pe?dn(Er(d.maxWait)||0,l):C,ve="trailing"in d?!!d.trailing:ve);function Te(nn){var Yr=g,Di=w;return g=w=t,ue=nn,I=s.apply(Di,Yr),I}function Ie(nn){return ue=nn,W=Ga(lt,l),fe?Te(nn):I}function $e(nn){var Yr=nn-Z,Di=nn-ue,u_=l-Yr;return pe?xn(u_,C-Di):u_}function Re(nn){var Yr=nn-Z,Di=nn-ue;return Z===t||Yr>=l||Yr<0||pe&&Di>=C}function lt(){var nn=Su();if(Re(nn))return mt(nn);W=Ga(lt,$e(nn))}function mt(nn){return W=t,ve&&g?Te(nn):(g=w=t,I)}function ar(){W!==t&&eg(W),ue=0,g=Z=w=W=t}function Un(){return W===t?I:mt(Su())}function lr(){var nn=Su(),Yr=Re(nn);if(g=arguments,w=this,Z=nn,Yr){if(W===t)return Ie(Z);if(pe)return eg(W),W=Ga(lt,l),Te(Z)}return W===t&&(W=Ga(lt,l)),I}return lr.cancel=ar,lr.flush=Un,lr}var MC=it(function(s,l){return xm(s,1,l)}),AC=it(function(s,l,d){return xm(s,Er(l)||0,d)});function PC(s){return ki(s,R)}function Cu(s,l){if(typeof s!="function"||l!=null&&typeof l!="function")throw new vr(i);var d=function(){var g=arguments,w=l?l.apply(this,g):g[0],C=d.cache;if(C.has(w))return C.get(w);var I=s.apply(this,g);return d.cache=C.set(w,I)||C,I};return d.cache=new(Cu.Cache||wi),d}Cu.Cache=wi;function Du(s){if(typeof s!="function")throw new vr(i);return function(){var l=arguments;switch(l.length){case 0:return!s.call(this);case 1:return!s.call(this,l[0]);case 2:return!s.call(this,l[0],l[1]);case 3:return!s.call(this,l[0],l[1],l[2])}return!s.apply(this,l)}}function NC(s){return jg(2,s)}var xC=y2(function(s,l){l=l.length==1&&Ve(l[0])?qt(l[0],ir(Pe())):qt(Dn(l,1),ir(Pe()));var d=l.length;return it(function(g){for(var w=-1,C=xn(g.length,d);++w<C;)g[w]=l[w].call(this,g[w]);return rr(s,this,g)})}),Kd=it(function(s,l){var d=Ki(l,Os(Kd));return ki(s,D,t,l,d)}),Hg=it(function(s,l){var d=Ki(l,Os(Hg));return ki(s,F,t,l,d)}),IC=Ei(function(s,l){return ki(s,L,t,t,t,l)});function RC(s,l){if(typeof s!="function")throw new vr(i);return l=l===t?l:Xe(l),it(s,l)}function LC(s,l){if(typeof s!="function")throw new vr(i);return l=l==null?0:dn(Xe(l),0),it(function(d){var g=d[l],w=eo(d,0,l);return g&&Vi(w,g),rr(s,this,w)})}function FC(s,l,d){var g=!0,w=!0;if(typeof s!="function")throw new vr(i);return Kt(d)&&(g="leading"in d?!!d.leading:g,w="trailing"in d?!!d.trailing:w),zg(s,l,{leading:g,maxWait:l,trailing:w})}function YC(s){return Wg(s,1)}function WC(s,l){return Kd(Nd(l),s)}function jC(){if(!arguments.length)return[];var s=arguments[0];return Ve(s)?s:[s]}function BC(s){return wr(s,h)}function GC(s,l){return l=typeof l=="function"?l:t,wr(s,h,l)}function UC(s){return wr(s,c|h)}function zC(s,l){return l=typeof l=="function"?l:t,wr(s,c|h,l)}function HC(s,l){return l==null||Nm(s,l,bn(l))}function Fr(s,l){return s===l||s!==s&&l!==l}var qC=yu(wd),VC=yu(function(s,l){return s>=l}),jo=Ym(function(){return arguments}())?Ym:function(s){return Jt(s)&&Nt.call(s,"callee")&&!Tm.call(s,"callee")},Ve=ie.isArray,KC=om?ir(om):n2;function Jn(s){return s!=null&&Ou(s.length)&&!Si(s)}function tn(s){return Jt(s)&&Jn(s)}function ZC(s){return s===!0||s===!1||Jt(s)&&Bn(s)==Fe}var to=uT||op,XC=sm?ir(sm):r2;function JC(s){return Jt(s)&&s.nodeType===1&&!Ua(s)}function QC(s){if(s==null)return!0;if(Jn(s)&&(Ve(s)||typeof s=="string"||typeof s.splice=="function"||to(s)||Ms(s)||jo(s)))return!s.length;var l=In(s);if(l==vt||l==_n)return!s.size;if(Ba(s))return!Ed(s).length;for(var d in s)if(Nt.call(s,d))return!1;return!0}function $C(s,l){return Ya(s,l)}function eD(s,l,d){d=typeof d=="function"?d:t;var g=d?d(s,l):t;return g===t?Ya(s,l,t,d):!!g}function Zd(s){if(!Jt(s))return!1;var l=Bn(s);return l==ht||l==pt||typeof s.message=="string"&&typeof s.name=="string"&&!Ua(s)}function tD(s){return typeof s=="number"&&Cm(s)}function Si(s){if(!Kt(s))return!1;var l=Bn(s);return l==ge||l==Ee||l==Ce||l==Vn}function qg(s){return typeof s=="number"&&s==Xe(s)}function Ou(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Q}function Kt(s){var l=typeof s;return s!=null&&(l=="object"||l=="function")}function Jt(s){return s!=null&&typeof s=="object"}var Vg=am?ir(am):o2;function nD(s,l){return s===l||kd(s,l,Wd(l))}function rD(s,l,d){return d=typeof d=="function"?d:t,kd(s,l,Wd(l),d)}function iD(s){return Kg(s)&&s!=+s}function oD(s){if(G2(s))throw new He(r);return Wm(s)}function sD(s){return s===null}function aD(s){return s==null}function Kg(s){return typeof s=="number"||Jt(s)&&Bn(s)==Ht}function Ua(s){if(!Jt(s)||Bn(s)!=rt)return!1;var l=tu(s);if(l===null)return!0;var d=Nt.call(l,"constructor")&&l.constructor;return typeof d=="function"&&d instanceof d&&Jl.call(d)==rT}var Xd=lm?ir(lm):s2;function lD(s){return qg(s)&&s>=-Q&&s<=Q}var Zg=um?ir(um):a2;function Mu(s){return typeof s=="string"||!Ve(s)&&Jt(s)&&Bn(s)==vn}function sr(s){return typeof s=="symbol"||Jt(s)&&Bn(s)==Yn}var Ms=fm?ir(fm):l2;function uD(s){return s===t}function fD(s){return Jt(s)&&In(s)==Wn}function cD(s){return Jt(s)&&Bn(s)==Cn}var dD=yu(Td),pD=yu(function(s,l){return s<=l});function Xg(s){if(!s)return[];if(Jn(s))return Mu(s)?Rr(s):Xn(s);if(Aa&&s[Aa])return HE(s[Aa]());var l=In(s),d=l==vt?cd:l==_n?Kl:As;return d(s)}function Ci(s){if(!s)return s===0?s:0;if(s=Er(s),s===S||s===-S){var l=s<0?-1:1;return l*j}return s===s?s:0}function Xe(s){var l=Ci(s),d=l%1;return l===l?d?l-d:l:0}function Jg(s){return s?Lo(Xe(s),0,J):0}function Er(s){if(typeof s=="number")return s;if(sr(s))return U;if(Kt(s)){var l=typeof s.valueOf=="function"?s.valueOf():s;s=Kt(l)?l+"":l}if(typeof s!="string")return s===0?s:+s;s=gm(s);var d=Bc.test(s);return d||Uc.test(s)?OE(s.slice(2),d?2:8):jc.test(s)?U:+s}function Qg(s){return ri(s,Qn(s))}function hD(s){return s?Lo(Xe(s),-Q,Q):s===0?s:0}function Ot(s){return s==null?"":or(s)}var mD=Cs(function(s,l){if(Ba(l)||Jn(l)){ri(l,bn(l),s);return}for(var d in l)Nt.call(l,d)&&Ra(s,d,l[d])}),$g=Cs(function(s,l){ri(l,Qn(l),s)}),Au=Cs(function(s,l,d,g){ri(l,Qn(l),s,g)}),gD=Cs(function(s,l,d,g){ri(l,bn(l),s,g)}),_D=Ei(_d);function vD(s,l){var d=Ss(s);return l==null?d:Pm(d,l)}var yD=it(function(s,l){s=Rt(s);var d=-1,g=l.length,w=g>2?l[2]:t;for(w&&Gn(l[0],l[1],w)&&(g=1);++d<g;)for(var C=l[d],I=Qn(C),W=-1,Z=I.length;++W<Z;){var ue=I[W],fe=s[ue];(fe===t||Fr(fe,ks[ue])&&!Nt.call(s,ue))&&(s[ue]=C[ue])}return s}),wD=it(function(s){return s.push(t,gg),rr(e_,t,s)});function bD(s,l){return dm(s,Pe(l,3),ni)}function kD(s,l){return dm(s,Pe(l,3),yd)}function ED(s,l){return s==null?s:vd(s,Pe(l,3),Qn)}function TD(s,l){return s==null?s:Lm(s,Pe(l,3),Qn)}function SD(s,l){return s&&ni(s,Pe(l,3))}function CD(s,l){return s&&yd(s,Pe(l,3))}function DD(s){return s==null?[]:cu(s,bn(s))}function OD(s){return s==null?[]:cu(s,Qn(s))}function Jd(s,l,d){var g=s==null?t:Fo(s,l);return g===t?d:g}function MD(s,l){return s!=null&&yg(s,l,QT)}function Qd(s,l){return s!=null&&yg(s,l,$T)}var AD=cg(function(s,l,d){l!=null&&typeof l.toString!="function"&&(l=Ql.call(l)),s[l]=d},ep($n)),PD=cg(function(s,l,d){l!=null&&typeof l.toString!="function"&&(l=Ql.call(l)),Nt.call(s,l)?s[l].push(d):s[l]=[d]},Pe),ND=it(Fa);function bn(s){return Jn(s)?Mm(s):Ed(s)}function Qn(s){return Jn(s)?Mm(s,!0):u2(s)}function xD(s,l){var d={};return l=Pe(l,3),ni(s,function(g,w,C){bi(d,l(g,w,C),g)}),d}function ID(s,l){var d={};return l=Pe(l,3),ni(s,function(g,w,C){bi(d,w,l(g,w,C))}),d}var RD=Cs(function(s,l,d){du(s,l,d)}),e_=Cs(function(s,l,d,g){du(s,l,d,g)}),LD=Ei(function(s,l){var d={};if(s==null)return d;var g=!1;l=qt(l,function(C){return C=$i(C,s),g||(g=C.length>1),C}),ri(s,Fd(s),d),g&&(d=wr(d,c|p|h,A2));for(var w=l.length;w--;)Md(d,l[w]);return d});function FD(s,l){return t_(s,Du(Pe(l)))}var YD=Ei(function(s,l){return s==null?{}:c2(s,l)});function t_(s,l){if(s==null)return{};var d=qt(Fd(s),function(g){return[g]});return l=Pe(l),qm(s,d,function(g,w){return l(g,w[0])})}function WD(s,l,d){l=$i(l,s);var g=-1,w=l.length;for(w||(w=1,s=t);++g<w;){var C=s==null?t:s[ii(l[g])];C===t&&(g=w,C=d),s=Si(C)?C.call(s):C}return s}function jD(s,l,d){return s==null?s:Wa(s,l,d)}function BD(s,l,d,g){return g=typeof g=="function"?g:t,s==null?s:Wa(s,l,d,g)}var n_=hg(bn),r_=hg(Qn);function GD(s,l,d){var g=Ve(s),w=g||to(s)||Ms(s);if(l=Pe(l,4),d==null){var C=s&&s.constructor;w?d=g?new C:[]:Kt(s)?d=Si(C)?Ss(tu(s)):{}:d={}}return(w?_r:ni)(s,function(I,W,Z){return l(d,I,W,Z)}),d}function UD(s,l){return s==null?!0:Md(s,l)}function zD(s,l,d){return s==null?s:Jm(s,l,Nd(d))}function HD(s,l,d,g){return g=typeof g=="function"?g:t,s==null?s:Jm(s,l,Nd(d),g)}function As(s){return s==null?[]:fd(s,bn(s))}function qD(s){return s==null?[]:fd(s,Qn(s))}function VD(s,l,d){return d===t&&(d=l,l=t),d!==t&&(d=Er(d),d=d===d?d:0),l!==t&&(l=Er(l),l=l===l?l:0),Lo(Er(s),l,d)}function KD(s,l,d){return l=Ci(l),d===t?(d=l,l=0):d=Ci(d),s=Er(s),e2(s,l,d)}function ZD(s,l,d){if(d&&typeof d!="boolean"&&Gn(s,l,d)&&(l=d=t),d===t&&(typeof l=="boolean"?(d=l,l=t):typeof s=="boolean"&&(d=s,s=t)),s===t&&l===t?(s=0,l=1):(s=Ci(s),l===t?(l=s,s=0):l=Ci(l)),s>l){var g=s;s=l,l=g}if(d||s%1||l%1){var w=Dm();return xn(s+w*(l-s+DE("1e-"+((w+"").length-1))),l)}return Cd(s,l)}var XD=Ds(function(s,l,d){return l=l.toLowerCase(),s+(d?i_(l):l)});function i_(s){return $d(Ot(s).toLowerCase())}function o_(s){return s=Ot(s),s&&s.replace(Hc,jE).replace(_E,"")}function JD(s,l,d){s=Ot(s),l=or(l);var g=s.length;d=d===t?g:Lo(Xe(d),0,g);var w=d;return d-=l.length,d>=0&&s.slice(d,w)==l}function QD(s){return s=Ot(s),s&&Sc.test(s)?s.replace(hs,BE):s}function $D(s){return s=Ot(s),s&&Pc.test(s)?s.replace(Sa,"\\$&"):s}var eO=Ds(function(s,l,d){return s+(d?"-":"")+l.toLowerCase()}),tO=Ds(function(s,l,d){return s+(d?" ":"")+l.toLowerCase()}),nO=lg("toLowerCase");function rO(s,l,d){s=Ot(s),l=Xe(l);var g=l?bs(s):0;if(!l||g>=l)return s;var w=(l-g)/2;return vu(ou(w),d)+s+vu(iu(w),d)}function iO(s,l,d){s=Ot(s),l=Xe(l);var g=l?bs(s):0;return l&&g<l?s+vu(l-g,d):s}function oO(s,l,d){s=Ot(s),l=Xe(l);var g=l?bs(s):0;return l&&g<l?vu(l-g,d)+s:s}function sO(s,l,d){return d||l==null?l=0:l&&(l=+l),pT(Ot(s).replace(Ca,""),l||0)}function aO(s,l,d){return(d?Gn(s,l,d):l===t)?l=1:l=Xe(l),Dd(Ot(s),l)}function lO(){var s=arguments,l=Ot(s[0]);return s.length<3?l:l.replace(s[1],s[2])}var uO=Ds(function(s,l,d){return s+(d?"_":"")+l.toLowerCase()});function fO(s,l,d){return d&&typeof d!="number"&&Gn(s,l,d)&&(l=d=t),d=d===t?J:d>>>0,d?(s=Ot(s),s&&(typeof l=="string"||l!=null&&!Xd(l))&&(l=or(l),!l&&ws(s))?eo(Rr(s),0,d):s.split(l,d)):[]}var cO=Ds(function(s,l,d){return s+(d?" ":"")+$d(l)});function dO(s,l,d){return s=Ot(s),d=d==null?0:Lo(Xe(d),0,s.length),l=or(l),s.slice(d,d+l.length)==l}function pO(s,l,d){var g=T.templateSettings;d&&Gn(s,l,d)&&(l=t),s=Ot(s),l=Au({},l,g,mg);var w=Au({},l.imports,g.imports,mg),C=bn(w),I=fd(w,C),W,Z,ue=0,fe=l.interpolate||ms,pe="__p += '",ve=dd((l.escape||ms).source+"|"+fe.source+"|"+(fe===Wl?Wc:ms).source+"|"+(l.evaluate||ms).source+"|$","g"),Te="//# sourceURL="+(Nt.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++kE+"]")+`
`;s.replace(ve,function(Re,lt,mt,ar,Un,lr){return mt||(mt=ar),pe+=s.slice(ue,lr).replace(qc,GE),lt&&(W=!0,pe+=`' +
__e(`+lt+`) +
'`),Un&&(Z=!0,pe+=`';
`+Un+`;
__p += '`),mt&&(pe+=`' +
((__t = (`+mt+`)) == null ? '' : __t) +
'`),ue=lr+Re.length,Re}),pe+=`';
`;var Ie=Nt.call(l,"variable")&&l.variable;if(!Ie)pe=`with (obj) {
`+pe+`
}
`;else if(Fc.test(Ie))throw new He(o);pe=(Z?pe.replace(St,""):pe).replace(nr,"$1").replace(_i,"$1;"),pe="function("+(Ie||"obj")+`) {
`+(Ie?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(W?", __e = _.escape":"")+(Z?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+pe+`return __p
}`;var $e=a_(function(){return Ct(C,Te+"return "+pe).apply(t,I)});if($e.source=pe,Zd($e))throw $e;return $e}function hO(s){return Ot(s).toLowerCase()}function mO(s){return Ot(s).toUpperCase()}function gO(s,l,d){if(s=Ot(s),s&&(d||l===t))return gm(s);if(!s||!(l=or(l)))return s;var g=Rr(s),w=Rr(l),C=_m(g,w),I=vm(g,w)+1;return eo(g,C,I).join("")}function _O(s,l,d){if(s=Ot(s),s&&(d||l===t))return s.slice(0,wm(s)+1);if(!s||!(l=or(l)))return s;var g=Rr(s),w=vm(g,Rr(l))+1;return eo(g,0,w).join("")}function vO(s,l,d){if(s=Ot(s),s&&(d||l===t))return s.replace(Ca,"");if(!s||!(l=or(l)))return s;var g=Rr(s),w=_m(g,Rr(l));return eo(g,w).join("")}function yO(s,l){var d=M,g=H;if(Kt(l)){var w="separator"in l?l.separator:w;d="length"in l?Xe(l.length):d,g="omission"in l?or(l.omission):g}s=Ot(s);var C=s.length;if(ws(s)){var I=Rr(s);C=I.length}if(d>=C)return s;var W=d-bs(g);if(W<1)return g;var Z=I?eo(I,0,W).join(""):s.slice(0,W);if(w===t)return Z+g;if(I&&(W+=Z.length-W),Xd(w)){if(s.slice(W).search(w)){var ue,fe=Z;for(w.global||(w=dd(w.source,Ot(jl.exec(w))+"g")),w.lastIndex=0;ue=w.exec(fe);)var pe=ue.index;Z=Z.slice(0,pe===t?W:pe)}}else if(s.indexOf(or(w),W)!=W){var ve=Z.lastIndexOf(w);ve>-1&&(Z=Z.slice(0,ve))}return Z+g}function wO(s){return s=Ot(s),s&&Tc.test(s)?s.replace(ps,ZE):s}var bO=Ds(function(s,l,d){return s+(d?" ":"")+l.toUpperCase()}),$d=lg("toUpperCase");function s_(s,l,d){return s=Ot(s),l=d?t:l,l===t?zE(s)?QE(s):RE(s):s.match(l)||[]}var a_=it(function(s,l){try{return rr(s,t,l)}catch(d){return Zd(d)?d:new He(d)}}),kO=Ei(function(s,l){return _r(l,function(d){d=ii(d),bi(s,d,Vd(s[d],s))}),s});function EO(s){var l=s==null?0:s.length,d=Pe();return s=l?qt(s,function(g){if(typeof g[1]!="function")throw new vr(i);return[d(g[0]),g[1]]}):[],it(function(g){for(var w=-1;++w<l;){var C=s[w];if(rr(C[0],this,g))return rr(C[1],this,g)}})}function TO(s){return ZT(wr(s,c))}function ep(s){return function(){return s}}function SO(s,l){return s==null||s!==s?l:s}var CO=fg(),DO=fg(!0);function $n(s){return s}function tp(s){return jm(typeof s=="function"?s:wr(s,c))}function OO(s){return Gm(wr(s,c))}function MO(s,l){return Um(s,wr(l,c))}var AO=it(function(s,l){return function(d){return Fa(d,s,l)}}),PO=it(function(s,l){return function(d){return Fa(s,d,l)}});function np(s,l,d){var g=bn(l),w=cu(l,g);d==null&&!(Kt(l)&&(w.length||!g.length))&&(d=l,l=s,s=this,w=cu(l,bn(l)));var C=!(Kt(d)&&"chain"in d)||!!d.chain,I=Si(s);return _r(w,function(W){var Z=l[W];s[W]=Z,I&&(s.prototype[W]=function(){var ue=this.__chain__;if(C||ue){var fe=s(this.__wrapped__),pe=fe.__actions__=Xn(this.__actions__);return pe.push({func:Z,args:arguments,thisArg:s}),fe.__chain__=ue,fe}return Z.apply(s,Vi([this.value()],arguments))})}),s}function NO(){return wn._===this&&(wn._=iT),this}function rp(){}function xO(s){return s=Xe(s),it(function(l){return zm(l,s)})}var IO=Id(qt),RO=Id(cm),LO=Id(od);function l_(s){return Bd(s)?sd(ii(s)):d2(s)}function FO(s){return function(l){return s==null?t:Fo(s,l)}}var YO=dg(),WO=dg(!0);function ip(){return[]}function op(){return!1}function jO(){return{}}function BO(){return""}function GO(){return!0}function UO(s,l){if(s=Xe(s),s<1||s>Q)return[];var d=J,g=xn(s,J);l=Pe(l),s-=J;for(var w=ud(g,l);++d<s;)l(d);return w}function zO(s){return Ve(s)?qt(s,ii):sr(s)?[s]:Xn(Og(Ot(s)))}function HO(s){var l=++nT;return Ot(s)+l}var qO=_u(function(s,l){return s+l},0),VO=Rd("ceil"),KO=_u(function(s,l){return s/l},1),ZO=Rd("floor");function XO(s){return s&&s.length?fu(s,$n,wd):t}function JO(s,l){return s&&s.length?fu(s,Pe(l,2),wd):t}function QO(s){return hm(s,$n)}function $O(s,l){return hm(s,Pe(l,2))}function eM(s){return s&&s.length?fu(s,$n,Td):t}function tM(s,l){return s&&s.length?fu(s,Pe(l,2),Td):t}var nM=_u(function(s,l){return s*l},1),rM=Rd("round"),iM=_u(function(s,l){return s-l},0);function oM(s){return s&&s.length?ld(s,$n):0}function sM(s,l){return s&&s.length?ld(s,Pe(l,2)):0}return T.after=OC,T.ary=Wg,T.assign=mD,T.assignIn=$g,T.assignInWith=Au,T.assignWith=gD,T.at=_D,T.before=jg,T.bind=Vd,T.bindAll=kO,T.bindKey=Bg,T.castArray=jC,T.chain=Lg,T.chunk=Z2,T.compact=X2,T.concat=J2,T.cond=EO,T.conforms=TO,T.constant=ep,T.countBy=oC,T.create=vD,T.curry=Gg,T.curryRight=Ug,T.debounce=zg,T.defaults=yD,T.defaultsDeep=wD,T.defer=MC,T.delay=AC,T.difference=Q2,T.differenceBy=$2,T.differenceWith=eS,T.drop=tS,T.dropRight=nS,T.dropRightWhile=rS,T.dropWhile=iS,T.fill=oS,T.filter=aC,T.flatMap=fC,T.flatMapDeep=cC,T.flatMapDepth=dC,T.flatten=Ng,T.flattenDeep=sS,T.flattenDepth=aS,T.flip=PC,T.flow=CO,T.flowRight=DO,T.fromPairs=lS,T.functions=DD,T.functionsIn=OD,T.groupBy=pC,T.initial=fS,T.intersection=cS,T.intersectionBy=dS,T.intersectionWith=pS,T.invert=AD,T.invertBy=PD,T.invokeMap=mC,T.iteratee=tp,T.keyBy=gC,T.keys=bn,T.keysIn=Qn,T.map=Tu,T.mapKeys=xD,T.mapValues=ID,T.matches=OO,T.matchesProperty=MO,T.memoize=Cu,T.merge=RD,T.mergeWith=e_,T.method=AO,T.methodOf=PO,T.mixin=np,T.negate=Du,T.nthArg=xO,T.omit=LD,T.omitBy=FD,T.once=NC,T.orderBy=_C,T.over=IO,T.overArgs=xC,T.overEvery=RO,T.overSome=LO,T.partial=Kd,T.partialRight=Hg,T.partition=vC,T.pick=YD,T.pickBy=t_,T.property=l_,T.propertyOf=FO,T.pull=_S,T.pullAll=Ig,T.pullAllBy=vS,T.pullAllWith=yS,T.pullAt=wS,T.range=YO,T.rangeRight=WO,T.rearg=IC,T.reject=bC,T.remove=bS,T.rest=RC,T.reverse=Hd,T.sampleSize=EC,T.set=jD,T.setWith=BD,T.shuffle=TC,T.slice=kS,T.sortBy=DC,T.sortedUniq=MS,T.sortedUniqBy=AS,T.split=fO,T.spread=LC,T.tail=PS,T.take=NS,T.takeRight=xS,T.takeRightWhile=IS,T.takeWhile=RS,T.tap=XS,T.throttle=FC,T.thru=Eu,T.toArray=Xg,T.toPairs=n_,T.toPairsIn=r_,T.toPath=zO,T.toPlainObject=Qg,T.transform=GD,T.unary=YC,T.union=LS,T.unionBy=FS,T.unionWith=YS,T.uniq=WS,T.uniqBy=jS,T.uniqWith=BS,T.unset=UD,T.unzip=qd,T.unzipWith=Rg,T.update=zD,T.updateWith=HD,T.values=As,T.valuesIn=qD,T.without=GS,T.words=s_,T.wrap=WC,T.xor=US,T.xorBy=zS,T.xorWith=HS,T.zip=qS,T.zipObject=VS,T.zipObjectDeep=KS,T.zipWith=ZS,T.entries=n_,T.entriesIn=r_,T.extend=$g,T.extendWith=Au,np(T,T),T.add=qO,T.attempt=a_,T.camelCase=XD,T.capitalize=i_,T.ceil=VO,T.clamp=VD,T.clone=BC,T.cloneDeep=UC,T.cloneDeepWith=zC,T.cloneWith=GC,T.conformsTo=HC,T.deburr=o_,T.defaultTo=SO,T.divide=KO,T.endsWith=JD,T.eq=Fr,T.escape=QD,T.escapeRegExp=$D,T.every=sC,T.find=lC,T.findIndex=Ag,T.findKey=bD,T.findLast=uC,T.findLastIndex=Pg,T.findLastKey=kD,T.floor=ZO,T.forEach=Fg,T.forEachRight=Yg,T.forIn=ED,T.forInRight=TD,T.forOwn=SD,T.forOwnRight=CD,T.get=Jd,T.gt=qC,T.gte=VC,T.has=MD,T.hasIn=Qd,T.head=xg,T.identity=$n,T.includes=hC,T.indexOf=uS,T.inRange=KD,T.invoke=ND,T.isArguments=jo,T.isArray=Ve,T.isArrayBuffer=KC,T.isArrayLike=Jn,T.isArrayLikeObject=tn,T.isBoolean=ZC,T.isBuffer=to,T.isDate=XC,T.isElement=JC,T.isEmpty=QC,T.isEqual=$C,T.isEqualWith=eD,T.isError=Zd,T.isFinite=tD,T.isFunction=Si,T.isInteger=qg,T.isLength=Ou,T.isMap=Vg,T.isMatch=nD,T.isMatchWith=rD,T.isNaN=iD,T.isNative=oD,T.isNil=aD,T.isNull=sD,T.isNumber=Kg,T.isObject=Kt,T.isObjectLike=Jt,T.isPlainObject=Ua,T.isRegExp=Xd,T.isSafeInteger=lD,T.isSet=Zg,T.isString=Mu,T.isSymbol=sr,T.isTypedArray=Ms,T.isUndefined=uD,T.isWeakMap=fD,T.isWeakSet=cD,T.join=hS,T.kebabCase=eO,T.last=kr,T.lastIndexOf=mS,T.lowerCase=tO,T.lowerFirst=nO,T.lt=dD,T.lte=pD,T.max=XO,T.maxBy=JO,T.mean=QO,T.meanBy=$O,T.min=eM,T.minBy=tM,T.stubArray=ip,T.stubFalse=op,T.stubObject=jO,T.stubString=BO,T.stubTrue=GO,T.multiply=nM,T.nth=gS,T.noConflict=NO,T.noop=rp,T.now=Su,T.pad=rO,T.padEnd=iO,T.padStart=oO,T.parseInt=sO,T.random=ZD,T.reduce=yC,T.reduceRight=wC,T.repeat=aO,T.replace=lO,T.result=WD,T.round=rM,T.runInContext=q,T.sample=kC,T.size=SC,T.snakeCase=uO,T.some=CC,T.sortedIndex=ES,T.sortedIndexBy=TS,T.sortedIndexOf=SS,T.sortedLastIndex=CS,T.sortedLastIndexBy=DS,T.sortedLastIndexOf=OS,T.startCase=cO,T.startsWith=dO,T.subtract=iM,T.sum=oM,T.sumBy=sM,T.template=pO,T.times=UO,T.toFinite=Ci,T.toInteger=Xe,T.toLength=Jg,T.toLower=hO,T.toNumber=Er,T.toSafeInteger=hD,T.toString=Ot,T.toUpper=mO,T.trim=gO,T.trimEnd=_O,T.trimStart=vO,T.truncate=yO,T.unescape=wO,T.uniqueId=HO,T.upperCase=bO,T.upperFirst=$d,T.each=Fg,T.eachRight=Yg,T.first=xg,np(T,function(){var s={};return ni(T,function(l,d){Nt.call(T.prototype,d)||(s[d]=l)}),s}(),{chain:!1}),T.VERSION=e,_r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){T[s].placeholder=T}),_r(["drop","take"],function(s,l){ft.prototype[s]=function(d){d=d===t?1:dn(Xe(d),0);var g=this.__filtered__&&!l?new ft(this):this.clone();return g.__filtered__?g.__takeCount__=xn(d,g.__takeCount__):g.__views__.push({size:xn(d,J),type:s+(g.__dir__<0?"Right":"")}),g},ft.prototype[s+"Right"]=function(d){return this.reverse()[s](d).reverse()}}),_r(["filter","map","takeWhile"],function(s,l){var d=l+1,g=d==X||d==ce;ft.prototype[s]=function(w){var C=this.clone();return C.__iteratees__.push({iteratee:Pe(w,3),type:d}),C.__filtered__=C.__filtered__||g,C}}),_r(["head","last"],function(s,l){var d="take"+(l?"Right":"");ft.prototype[s]=function(){return this[d](1).value()[0]}}),_r(["initial","tail"],function(s,l){var d="drop"+(l?"":"Right");ft.prototype[s]=function(){return this.__filtered__?new ft(this):this[d](1)}}),ft.prototype.compact=function(){return this.filter($n)},ft.prototype.find=function(s){return this.filter(s).head()},ft.prototype.findLast=function(s){return this.reverse().find(s)},ft.prototype.invokeMap=it(function(s,l){return typeof s=="function"?new ft(this):this.map(function(d){return Fa(d,s,l)})}),ft.prototype.reject=function(s){return this.filter(Du(Pe(s)))},ft.prototype.slice=function(s,l){s=Xe(s);var d=this;return d.__filtered__&&(s>0||l<0)?new ft(d):(s<0?d=d.takeRight(-s):s&&(d=d.drop(s)),l!==t&&(l=Xe(l),d=l<0?d.dropRight(-l):d.take(l-s)),d)},ft.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},ft.prototype.toArray=function(){return this.take(J)},ni(ft.prototype,function(s,l){var d=/^(?:filter|find|map|reject)|While$/.test(l),g=/^(?:head|last)$/.test(l),w=T[g?"take"+(l=="last"?"Right":""):l],C=g||/^find/.test(l);!w||(T.prototype[l]=function(){var I=this.__wrapped__,W=g?[1]:arguments,Z=I instanceof ft,ue=W[0],fe=Z||Ve(I),pe=function(lt){var mt=w.apply(T,Vi([lt],W));return g&&ve?mt[0]:mt};fe&&d&&typeof ue=="function"&&ue.length!=1&&(Z=fe=!1);var ve=this.__chain__,Te=!!this.__actions__.length,Ie=C&&!ve,$e=Z&&!Te;if(!C&&fe){I=$e?I:new ft(this);var Re=s.apply(I,W);return Re.__actions__.push({func:Eu,args:[pe],thisArg:t}),new yr(Re,ve)}return Ie&&$e?s.apply(this,W):(Re=this.thru(pe),Ie?g?Re.value()[0]:Re.value():Re)})}),_r(["pop","push","shift","sort","splice","unshift"],function(s){var l=Zl[s],d=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",g=/^(?:pop|shift)$/.test(s);T.prototype[s]=function(){var w=arguments;if(g&&!this.__chain__){var C=this.value();return l.apply(Ve(C)?C:[],w)}return this[d](function(I){return l.apply(Ve(I)?I:[],w)})}}),ni(ft.prototype,function(s,l){var d=T[l];if(d){var g=d.name+"";Nt.call(Ts,g)||(Ts[g]=[]),Ts[g].push({name:l,func:d})}}),Ts[gu(t,b).name]=[{name:"wrapper",func:t}],ft.prototype.clone=wT,ft.prototype.reverse=bT,ft.prototype.value=kT,T.prototype.at=JS,T.prototype.chain=QS,T.prototype.commit=$S,T.prototype.next=eC,T.prototype.plant=nC,T.prototype.reverse=rC,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=iC,T.prototype.first=T.prototype.head,Aa&&(T.prototype[Aa]=tC),T},Zi=$E();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(wn._=Zi,define(function(){return Zi})):No?((No.exports=Zi)._=Zi,td._=Zi):wn._=Zi}).call(js)});var Up=Oi((W5,lf)=>{var j1,B1,G1,U1,z1,H1,q1,V1,K1,sf,Gp,Z1,X1,J1,Xs,Q1,$1,e0,t0,n0,r0,i0,o0,af;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){t(n(e,n(r)))}):typeof lf=="object"&&typeof lf.exports=="object"?t(n(e,n(lf.exports))):t(n(e));function n(r,i){return r!==e&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(o,a){return r[o]=i?i(o,a):a}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])};j1=function(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(r,i);function o(){this.constructor=r}r.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)},B1=Object.assign||function(r){for(var i,o=1,a=arguments.length;o<a;o++){i=arguments[o];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(r[u]=i[u])}return r},G1=function(r,i){var o={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&i.indexOf(a)<0&&(o[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,a=Object.getOwnPropertySymbols(r);u<a.length;u++)i.indexOf(a[u])<0&&Object.prototype.propertyIsEnumerable.call(r,a[u])&&(o[a[u]]=r[a[u]]);return o},U1=function(r,i,o,a){var u=arguments.length,f=u<3?i:a===null?a=Object.getOwnPropertyDescriptor(i,o):a,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(r,i,o,a);else for(var p=r.length-1;p>=0;p--)(c=r[p])&&(f=(u<3?c(f):u>3?c(i,o,f):c(i,o))||f);return u>3&&f&&Object.defineProperty(i,o,f),f},z1=function(r,i){return function(o,a){i(o,a,r)}},H1=function(r,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,i)},q1=function(r,i,o,a){function u(f){return f instanceof o?f:new o(function(c){c(f)})}return new(o||(o=Promise))(function(f,c){function p(_){try{m(a.next(_))}catch(v){c(v)}}function h(_){try{m(a.throw(_))}catch(v){c(v)}}function m(_){_.done?f(_.value):u(_.value).then(p,h)}m((a=a.apply(r,i||[])).next())})},V1=function(r,i){var o={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},a,u,f,c;return c={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function p(m){return function(_){return h([m,_])}}function h(m){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,u&&(f=m[0]&2?u.return:m[0]?u.throw||((f=u.return)&&f.call(u),0):u.next)&&!(f=f.call(u,m[1])).done)return f;switch(u=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return o.label++,{value:m[1],done:!1};case 5:o.label++,u=m[1],m=[0];continue;case 7:m=o.ops.pop(),o.trys.pop();continue;default:if(f=o.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){o=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){o.label=m[1];break}if(m[0]===6&&o.label<f[1]){o.label=f[1],f=m;break}if(f&&o.label<f[2]){o.label=f[2],o.ops.push(m);break}f[2]&&o.ops.pop(),o.trys.pop();continue}m=i.call(r,o)}catch(_){m=[6,_],u=0}finally{a=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},K1=function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&af(i,r,o)},af=Object.create?function(r,i,o,a){a===void 0&&(a=o),Object.defineProperty(r,a,{enumerable:!0,get:function(){return i[o]}})}:function(r,i,o,a){a===void 0&&(a=o),r[a]=i[o]},sf=function(r){var i=typeof Symbol=="function"&&Symbol.iterator,o=i&&r[i],a=0;if(o)return o.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&a>=r.length&&(r=void 0),{value:r&&r[a++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},Gp=function(r,i){var o=typeof Symbol=="function"&&r[Symbol.iterator];if(!o)return r;var a=o.call(r),u,f=[],c;try{for(;(i===void 0||i-- >0)&&!(u=a.next()).done;)f.push(u.value)}catch(p){c={error:p}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(c)throw c.error}}return f},Z1=function(){for(var r=[],i=0;i<arguments.length;i++)r=r.concat(Gp(arguments[i]));return r},X1=function(){for(var r=0,i=0,o=arguments.length;i<o;i++)r+=arguments[i].length;for(var a=Array(r),u=0,i=0;i<o;i++)for(var f=arguments[i],c=0,p=f.length;c<p;c++,u++)a[u]=f[c];return a},J1=function(r,i){for(var o=0,a=i.length,u=r.length;o<a;o++,u++)r[u]=i[o];return r},Xs=function(r){return this instanceof Xs?(this.v=r,this):new Xs(r)},Q1=function(r,i,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(r,i||[]),u,f=[];return u={},c("next"),c("throw"),c("return"),u[Symbol.asyncIterator]=function(){return this},u;function c(b){a[b]&&(u[b]=function(E){return new Promise(function(y,O){f.push([b,E,y,O])>1||p(b,E)})})}function p(b,E){try{h(a[b](E))}catch(y){v(f[0][3],y)}}function h(b){b.value instanceof Xs?Promise.resolve(b.value.v).then(m,_):v(f[0][2],b)}function m(b){p("next",b)}function _(b){p("throw",b)}function v(b,E){b(E),f.shift(),f.length&&p(f[0][0],f[0][1])}},$1=function(r){var i,o;return i={},a("next"),a("throw",function(u){throw u}),a("return"),i[Symbol.iterator]=function(){return this},i;function a(u,f){i[u]=r[u]?function(c){return(o=!o)?{value:Xs(r[u](c)),done:u==="return"}:f?f(c):c}:f}},e0=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],o;return i?i.call(r):(r=typeof sf=="function"?sf(r):r[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(f){o[f]=r[f]&&function(c){return new Promise(function(p,h){c=r[f](c),u(p,h,c.done,c.value)})}}function u(f,c,p,h){Promise.resolve(h).then(function(m){f({value:m,done:p})},c)}},t0=function(r,i){return Object.defineProperty?Object.defineProperty(r,"raw",{value:i}):r.raw=i,r};var n=Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:!0,value:i})}:function(r,i){r.default=i};n0=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)o!=="default"&&Object.prototype.hasOwnProperty.call(r,o)&&af(i,r,o);return n(i,r),i},r0=function(r){return r&&r.__esModule?r:{default:r}},i0=function(r,i,o,a){if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?r!==i||!a:!i.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?a:o==="a"?a.call(r):a?a.value:i.get(r)},o0=function(r,i,o,a,u){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!u)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?r!==i||!u:!i.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?u.call(r,o):u?u.value=o:i.set(r,o),o},t("__extends",j1),t("__assign",B1),t("__rest",G1),t("__decorate",U1),t("__param",z1),t("__metadata",H1),t("__awaiter",q1),t("__generator",V1),t("__exportStar",K1),t("__createBinding",af),t("__values",sf),t("__read",Gp),t("__spread",Z1),t("__spreadArrays",X1),t("__spreadArray",J1),t("__await",Xs),t("__asyncGenerator",Q1),t("__asyncDelegator",$1),t("__asyncValues",e0),t("__makeTemplateObject",t0),t("__importStar",n0),t("__importDefault",r0),t("__classPrivateFieldGet",i0),t("__classPrivateFieldSet",o0)})});var P0=Oi((JF,hf)=>{var c0,d0,p0,h0,m0,g0,_0,v0,y0,pf,Kp,w0,b0,Qs,k0,E0,T0,S0,C0,D0,O0,M0,A0;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){t(n(e,n(r)))}):typeof hf=="object"&&typeof hf.exports=="object"?t(n(e,n(hf.exports))):t(n(e));function n(r,i){return r!==e&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(o,a){return r[o]=i?i(o,a):a}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])};c0=function(n,r){e(n,r);function i(){this.constructor=n}n.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)},d0=Object.assign||function(n){for(var r,i=1,o=arguments.length;i<o;i++){r=arguments[i];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])}return n},p0=function(n,r){var i={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&r.indexOf(o)<0&&(i[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(n);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(n,o[a])&&(i[o[a]]=n[o[a]]);return i},h0=function(n,r,i,o){var a=arguments.length,u=a<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,i):o,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,r,i,o);else for(var c=n.length-1;c>=0;c--)(f=n[c])&&(u=(a<3?f(u):a>3?f(r,i,u):f(r,i))||u);return a>3&&u&&Object.defineProperty(r,i,u),u},m0=function(n,r){return function(i,o){r(i,o,n)}},g0=function(n,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,r)},_0=function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(f){f(u)})}return new(i||(i=Promise))(function(u,f){function c(m){try{h(o.next(m))}catch(_){f(_)}}function p(m){try{h(o.throw(m))}catch(_){f(_)}}function h(m){m.done?u(m.value):a(m.value).then(c,p)}h((o=o.apply(n,r||[])).next())})},v0=function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,f;return f={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function c(h){return function(m){return p([h,m])}}function p(h){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=h[0]&2?a.return:h[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,h[1])).done)return u;switch(a=0,u&&(h=[h[0]&2,u.value]),h[0]){case 0:case 1:u=h;break;case 4:return i.label++,{value:h[1],done:!1};case 5:i.label++,a=h[1],h=[0];continue;case 7:h=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(h[0]===6||h[0]===2)){i=0;continue}if(h[0]===3&&(!u||h[1]>u[0]&&h[1]<u[3])){i.label=h[1];break}if(h[0]===6&&i.label<u[1]){i.label=u[1],u=h;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(h);break}u[2]&&i.ops.pop(),i.trys.pop();continue}h=r.call(n,i)}catch(m){h=[6,m],a=0}finally{o=u=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},A0=function(n,r,i,o){o===void 0&&(o=i),n[o]=r[i]},y0=function(n,r){for(var i in n)i!=="default"&&!r.hasOwnProperty(i)&&(r[i]=n[i])},pf=function(n){var r=typeof Symbol=="function"&&Symbol.iterator,i=r&&n[r],o=0;if(i)return i.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&o>=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")},Kp=function(n,r){var i=typeof Symbol=="function"&&n[Symbol.iterator];if(!i)return n;var o=i.call(n),a,u=[],f;try{for(;(r===void 0||r-- >0)&&!(a=o.next()).done;)u.push(a.value)}catch(c){f={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(f)throw f.error}}return u},w0=function(){for(var n=[],r=0;r<arguments.length;r++)n=n.concat(Kp(arguments[r]));return n},b0=function(){for(var n=0,r=0,i=arguments.length;r<i;r++)n+=arguments[r].length;for(var o=Array(n),a=0,r=0;r<i;r++)for(var u=arguments[r],f=0,c=u.length;f<c;f++,a++)o[a]=u[f];return o},Qs=function(n){return this instanceof Qs?(this.v=n,this):new Qs(n)},k0=function(n,r,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(n,r||[]),a,u=[];return a={},f("next"),f("throw"),f("return"),a[Symbol.asyncIterator]=function(){return this},a;function f(v){o[v]&&(a[v]=function(b){return new Promise(function(E,y){u.push([v,b,E,y])>1||c(v,b)})})}function c(v,b){try{p(o[v](b))}catch(E){_(u[0][3],E)}}function p(v){v.value instanceof Qs?Promise.resolve(v.value.v).then(h,m):_(u[0][2],v)}function h(v){c("next",v)}function m(v){c("throw",v)}function _(v,b){v(b),u.shift(),u.length&&c(u[0][0],u[0][1])}},E0=function(n){var r,i;return r={},o("next"),o("throw",function(a){throw a}),o("return"),r[Symbol.iterator]=function(){return this},r;function o(a,u){r[a]=n[a]?function(f){return(i=!i)?{value:Qs(n[a](f)),done:a==="return"}:u?u(f):f}:u}},T0=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n[Symbol.asyncIterator],i;return r?r.call(n):(n=typeof pf=="function"?pf(n):n[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(u){i[u]=n[u]&&function(f){return new Promise(function(c,p){f=n[u](f),a(c,p,f.done,f.value)})}}function a(u,f,c,p){Promise.resolve(p).then(function(h){u({value:h,done:c})},f)}},S0=function(n,r){return Object.defineProperty?Object.defineProperty(n,"raw",{value:r}):n.raw=r,n},C0=function(n){if(n&&n.__esModule)return n;var r={};if(n!=null)for(var i in n)Object.hasOwnProperty.call(n,i)&&(r[i]=n[i]);return r.default=n,r},D0=function(n){return n&&n.__esModule?n:{default:n}},O0=function(n,r){if(!r.has(n))throw new TypeError("attempted to get private field on non-instance");return r.get(n)},M0=function(n,r,i){if(!r.has(n))throw new TypeError("attempted to set private field on non-instance");return r.set(n,i),i},t("__extends",c0),t("__assign",d0),t("__rest",p0),t("__decorate",h0),t("__param",m0),t("__metadata",g0),t("__awaiter",_0),t("__generator",v0),t("__exportStar",y0),t("__createBinding",A0),t("__values",pf),t("__read",Kp),t("__spread",w0),t("__spreadArrays",b0),t("__await",Qs),t("__asyncGenerator",k0),t("__asyncDelegator",E0),t("__asyncValues",T0),t("__makeTemplateObject",S0),t("__importStar",C0),t("__importDefault",D0),t("__classPrivateFieldGet",O0),t("__classPrivateFieldSet",M0)})});var ho=Oi((ih,oh)=>{(function(t,e){typeof ih=="object"&&typeof oh!="undefined"?oh.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis!="undefined"?globalThis:t||self).dayjs=e()})(ih,function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",o="minute",a="hour",u="day",f="week",c="month",p="quarter",h="year",m="date",_="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|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,E={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(V){var X=["th","st","nd","rd"],K=V%100;return"["+V+(X[(K-20)%10]||X[K]||X[0])+"]"}},y=function(V,X,K){var ce=String(V);return!ce||ce.length>=X?V:""+Array(X+1-ce.length).join(K)+V},O={s:y,z:function(V){var X=-V.utcOffset(),K=Math.abs(X),ce=Math.floor(K/60),S=K%60;return(X<=0?"+":"-")+y(ce,2,"0")+":"+y(S,2,"0")},m:function V(X,K){if(X.date()<K.date())return-V(K,X);var ce=12*(K.year()-X.year())+(K.month()-X.month()),S=X.clone().add(ce,c),Q=K-S<0,j=X.clone().add(ce+(Q?-1:1),c);return+(-(ce+(K-S)/(Q?S-j:j-S))||0)},a:function(V){return V<0?Math.ceil(V)||0:Math.floor(V)},p:function(V){return{M:c,y:h,w:f,d:u,D:m,h:a,m:o,s:i,ms:r,Q:p}[V]||String(V||"").toLowerCase().replace(/s$/,"")},u:function(V){return V===void 0}},D="en",F={};F[D]=E;var P=function(V){return V instanceof H},L=function V(X,K,ce){var S;if(!X)return D;if(typeof X=="string"){var Q=X.toLowerCase();F[Q]&&(S=Q),K&&(F[Q]=K,S=Q);var j=X.split("-");if(!S&&j.length>1)return V(j[0])}else{var U=X.name;F[U]=X,S=U}return!ce&&S&&(D=S),S||!ce&&D},R=function(V,X){if(P(V))return V.clone();var K=typeof X=="object"?X:{};return K.date=V,K.args=arguments,new H(K)},M=O;M.l=L,M.i=P,M.w=function(V,X){return R(V,{locale:X.$L,utc:X.$u,x:X.$x,$offset:X.$offset})};var H=function(){function V(K){this.$L=L(K.locale,null,!0),this.parse(K)}var X=V.prototype;return X.parse=function(K){this.$d=function(ce){var S=ce.date,Q=ce.utc;if(S===null)return new Date(NaN);if(M.u(S))return new Date;if(S instanceof Date)return new Date(S);if(typeof S=="string"&&!/Z$/i.test(S)){var j=S.match(v);if(j){var U=j[2]-1||0,J=(j[7]||"0").substring(0,3);return Q?new Date(Date.UTC(j[1],U,j[3]||1,j[4]||0,j[5]||0,j[6]||0,J)):new Date(j[1],U,j[3]||1,j[4]||0,j[5]||0,j[6]||0,J)}}return new Date(S)}(K),this.$x=K.x||{},this.init()},X.init=function(){var K=this.$d;this.$y=K.getFullYear(),this.$M=K.getMonth(),this.$D=K.getDate(),this.$W=K.getDay(),this.$H=K.getHours(),this.$m=K.getMinutes(),this.$s=K.getSeconds(),this.$ms=K.getMilliseconds()},X.$utils=function(){return M},X.isValid=function(){return this.$d.toString()!==_},X.isSame=function(K,ce){var S=R(K);return this.startOf(ce)<=S&&S<=this.endOf(ce)},X.isAfter=function(K,ce){return R(K)<this.startOf(ce)},X.isBefore=function(K,ce){return this.endOf(ce)<R(K)},X.$g=function(K,ce,S){return M.u(K)?this[ce]:this.set(S,K)},X.unix=function(){return Math.floor(this.valueOf()/1e3)},X.valueOf=function(){return this.$d.getTime()},X.startOf=function(K,ce){var S=this,Q=!!M.u(ce)||ce,j=M.p(K),U=function(Fe,je){var pt=M.w(S.$u?Date.UTC(S.$y,je,Fe):new Date(S.$y,je,Fe),S);return Q?pt:pt.endOf(u)},J=function(Fe,je){return M.w(S.toDate()[Fe].apply(S.toDate("s"),(Q?[0,0,0,0]:[23,59,59,999]).slice(je)),S)},re=this.$W,Y=this.$M,z=this.$D,ee="set"+(this.$u?"UTC":"");switch(j){case h:return Q?U(1,0):U(31,11);case c:return Q?U(1,Y):U(0,Y+1);case f:var _e=this.$locale().weekStart||0,Ce=(re<_e?re+7:re)-_e;return U(Q?z-Ce:z+(6-Ce),Y);case u:case m:return J(ee+"Hours",0);case a:return J(ee+"Minutes",1);case o:return J(ee+"Seconds",2);case i:return J(ee+"Milliseconds",3);default:return this.clone()}},X.endOf=function(K){return this.startOf(K,!1)},X.$set=function(K,ce){var S,Q=M.p(K),j="set"+(this.$u?"UTC":""),U=(S={},S[u]=j+"Date",S[m]=j+"Date",S[c]=j+"Month",S[h]=j+"FullYear",S[a]=j+"Hours",S[o]=j+"Minutes",S[i]=j+"Seconds",S[r]=j+"Milliseconds",S)[Q],J=Q===u?this.$D+(ce-this.$W):ce;if(Q===c||Q===h){var re=this.clone().set(m,1);re.$d[U](J),re.init(),this.$d=re.set(m,Math.min(this.$D,re.daysInMonth())).$d}else U&&this.$d[U](J);return this.init(),this},X.set=function(K,ce){return this.clone().$set(K,ce)},X.get=function(K){return this[M.p(K)]()},X.add=function(K,ce){var S,Q=this;K=Number(K);var j=M.p(ce),U=function(Y){var z=R(Q);return M.w(z.date(z.date()+Math.round(Y*K)),Q)};if(j===c)return this.set(c,this.$M+K);if(j===h)return this.set(h,this.$y+K);if(j===u)return U(1);if(j===f)return U(7);var J=(S={},S[o]=e,S[a]=n,S[i]=t,S)[j]||1,re=this.$d.getTime()+K*J;return M.w(re,this)},X.subtract=function(K,ce){return this.add(-1*K,ce)},X.format=function(K){var ce=this,S=this.$locale();if(!this.isValid())return S.invalidDate||_;var Q=K||"YYYY-MM-DDTHH:mm:ssZ",j=M.z(this),U=this.$H,J=this.$m,re=this.$M,Y=S.weekdays,z=S.months,ee=function(je,pt,ht,ge){return je&&(je[pt]||je(ce,Q))||ht[pt].slice(0,ge)},_e=function(je){return M.s(U%12||12,je,"0")},Ce=S.meridiem||function(je,pt,ht){var ge=je<12?"AM":"PM";return ht?ge.toLowerCase():ge},Fe={YY:String(this.$y).slice(-2),YYYY:this.$y,M:re+1,MM:M.s(re+1,2,"0"),MMM:ee(S.monthsShort,re,z,3),MMMM:ee(z,re),D:this.$D,DD:M.s(this.$D,2,"0"),d:String(this.$W),dd:ee(S.weekdaysMin,this.$W,Y,2),ddd:ee(S.weekdaysShort,this.$W,Y,3),dddd:Y[this.$W],H:String(U),HH:M.s(U,2,"0"),h:_e(1),hh:_e(2),a:Ce(U,J,!0),A:Ce(U,J,!1),m:String(J),mm:M.s(J,2,"0"),s:String(this.$s),ss:M.s(this.$s,2,"0"),SSS:M.s(this.$ms,3,"0"),Z:j};return Q.replace(b,function(je,pt){return pt||Fe[je]||j.replace(":","")})},X.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},X.diff=function(K,ce,S){var Q,j=M.p(ce),U=R(K),J=(U.utcOffset()-this.utcOffset())*e,re=this-U,Y=M.m(this,U);return Y=(Q={},Q[h]=Y/12,Q[c]=Y,Q[p]=Y/3,Q[f]=(re-J)/6048e5,Q[u]=(re-J)/864e5,Q[a]=re/n,Q[o]=re/e,Q[i]=re/t,Q)[j]||re,S?Y:M.a(Y)},X.daysInMonth=function(){return this.endOf(c).$D},X.$locale=function(){return F[this.$L]},X.locale=function(K,ce){if(!K)return this.$L;var S=this.clone(),Q=L(K,ce,!0);return Q&&(S.$L=Q),S},X.clone=function(){return M.w(this.$d,this)},X.toDate=function(){return new Date(this.valueOf())},X.toJSON=function(){return this.isValid()?this.toISOString():null},X.toISOString=function(){return this.$d.toISOString()},X.toString=function(){return this.$d.toUTCString()},V}(),le=H.prototype;return R.prototype=le,[["$ms",r],["$s",i],["$m",o],["$H",a],["$W",u],["$M",c],["$y",h],["$D",m]].forEach(function(V){le[V[1]]=function(X){return this.$g(X,V[0],V[1])}}),R.extend=function(V,X){return V.$i||(V(X,H,R),V.$i=!0),R},R.locale=L,R.isDayjs=P,R.unix=function(V){return R(1e3*V)},R.en=F[D],R.Ls=F,R.p={},R})});var Iv=Oi((fh,ch)=>{(function(t,e){typeof fh=="object"&&typeof ch!="undefined"?ch.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis!="undefined"?globalThis:t||self).dayjs_plugin_quarterOfYear=e()})(fh,function(){"use strict";var t="month",e="quarter";return function(n,r){var i=r.prototype;i.quarter=function(u){return this.$utils().u(u)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(u-1))};var o=i.add;i.add=function(u,f){return u=Number(u),this.$utils().p(f)===e?this.add(3*u,t):o.bind(this)(u,f)};var a=i.startOf;i.startOf=function(u,f){var c=this.$utils(),p=!!c.u(f)||f;if(c.p(u)===e){var h=this.quarter()-1;return p?this.month(3*h).startOf(t).startOf("day"):this.month(3*h+2).endOf(t).endOf("day")}return a.bind(this)(u,f)}}})});var yb=Oi(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.isDate=Eo.isComparable=Eo.isIterable=void 0;Eo.isIterable=t=>!(t==null||t[Symbol.iterator]==null);Eo.isComparable=t=>{let e=Object.prototype.toString,n=t;return n.compare!=null&&e.call(n.compare).endsWith("Function]")};Eo.isDate=t=>Object.prototype.toString.call(t).endsWith("Date]")});var bb=Oi(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0})});var kb=Oi(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});var PN=Up(),Fh=yb(),NN=(t,e)=>t-e,xN=(t,e)=>Number(t-e),IN=(t,e)=>t.localeCompare(e),RN=(t,e)=>t.getTime()-e.getTime(),wa={number:NN,string:IN,Date:RN,bigInt:xN,none:()=>0},LN=t=>{if(typeof t=="number")return wa.number;if(typeof t=="string")return wa.string;if(typeof t=="bigint")return wa.bigInt;if(Fh.isDate(t))return wa.Date;if(Fh.isComparable(t))return(e,n)=>e.compare(n);throw new Error("Cannot sort keys in this map. You have to specify compareFn if the type of key in this map is not number, string, or Date.")},fs=class extends Map{constructor(e,n){super();this.specifiedCompareFn=!1,this.isCompareFn=r=>typeof r=="function",this.compareFn=wa.none,this.sortedKeys=[],Fh.isIterable(e)&&this._constructor(e,n),this.isCompareFn(e)&&this._constructor(null,e),e==null&&this._constructor(null,n)}get comparator(){return this.compareFn}compare(e,n){return Math.sign(this.compareFn(e,n))}_constructor(e,n){if(this.compareFn=n==null?wa.none:n,this.specifiedCompareFn=n!=null,e!=null)for(let r of e)this.set(...r)}static fromMap(e,n){let r=new fs(n);return r.setAll(e),r}duplicate(){return fs.fromMap(this,this.compareFn)}toMap(){let e=new Map,n=Array.from(super.entries());return n.sort((r,i)=>this.compareFn(r[0],i[0])),n.forEach(([r,i])=>{e.set(r,i)}),e}reverseKeys(){return[...this.sortedKeys].reverse().values()}get(e){let n=this.sortedKeys.find(r=>this.comparator(r,e)===0);if(n!=null)return super.get(n)}set(e,n){this.sortedKeys.length===0&&!this.specifiedCompareFn&&(this.compareFn=LN(e),this.specifiedCompareFn=!0);let r=this.sortedKeys.find(i=>this.compareFn(i,e)===0);return r==null?(this.sortedKeys.push(e),super.set(e,n)):super.set(r,n),this.sortedKeys.sort(this.compareFn),this}setAll(e){return e.forEach((n,r)=>{this.set(r,n)}),this}delete(e){return super.delete(e)?(this.sortedKeys=this.sortedKeys.filter(n=>this.compare(n,e)!==0),!0):!1}clear(){super.clear(),this.sortedKeys=[]}keys(){return this.sortedKeys.values()}values(){return this.sortedKeys.map(e=>super.get(e)).values()}entries(){return this.toMap().entries()}firstEntry(){let e=this.firstKey();if(e==null)return;let n=this.get(e);return n===void 0?void 0:[e,n]}firstKey(){return this.sortedKeys[0]}lastEntry(){let e=this.lastKey();if(e==null)return;let n=this.get(e);return n===void 0?void 0:[e,n]}lastKey(){return[...this.sortedKeys].reverse()[0]}shiftEntry(){let e=this.firstEntry();if(e!=null)return this.delete(e[0]),e}popEntry(){let e=this.lastEntry();if(e!=null)return this.delete(e[0]),e}floorEntry(e){let n=this.floorKey(e);if(n!=null){let r=this.get(n);return r===void 0?void 0:[n,r]}}floorKey(e){return this.sortedKeys.filter(r=>this.compare(r,e)<=0).reverse()[0]}ceilingEntry(e){let n=this.ceilingKey(e);if(n!=null){let r=this.get(n);return r===void 0?void 0:[n,r]}}ceilingKey(e){return this.sortedKeys.filter(r=>this.compare(r,e)>=0)[0]}lowerEntry(e){let n=this.lowerKey(e);if(n!=null){let r=this.get(n);return r===void 0?void 0:[n,r]}}lowerKey(e){return this.sortedKeys.filter(r=>this.compare(r,e)<0).reverse()[0]}higherEntry(e){let n=this.higherKey(e);if(n!=null){let r=this.get(n);return r===void 0?void 0:[n,r]}}higherKey(e){return this.sortedKeys.filter(r=>this.compare(r,e)>0)[0]}splitLower(e,n=!0){let r=Array.from(this.entries()).filter(i=>{let o=this.compare(i[0],e)<0;return n?o||this.compare(i[0],e)===0:o});return new fs(r,this.compareFn)}splitHigher(e,n=!0){let r=Array.from(this.entries()).filter(i=>{let o=this.compare(i[0],e)>0;return n?o||this.compare(i[0],e)===0:o});return new fs(r,this.compareFn)}forEach(e,n){Array.from(this.entries()).forEach(([r,i])=>{e(i,r,this)},n)}};dc.default=fs;PN.__exportStar(bb(),dc)});hM(exports,{default:()=>ye});var Do=Oe(require("obsidian"));var sp=Oe(require("obsidian")),Pu=new Map;function Ke(t,e=!1){let n=window.moment();Pu.has(t)?(Pu.get(t).isBefore(n)||e)&&(new sp.Notice(t),Pu.set(t,n.add(1,"minute"))):(console.log(`[Google Calendar] ${t}`),new sp.Notice(t),Pu.set(t,n.add(0,"minute")))}var gt=Oe(require("obsidian"));var Nu=()=>{var t;return(t=window.localStorage.getItem("googleCalendarAccessToken"))!=null?t:""},Ns=()=>{var t;return(t=window.localStorage.getItem("googleCalendarRefreshToken"))!=null?t:""},xu=()=>{var e;let t=(e=window.localStorage.getItem("googleCalendarExpirationTime"))!=null?e:"0";return parseInt(t,10)},Mi=t=>{window.localStorage.setItem("googleCalendarAccessToken",t)},no=t=>{t!="undefined"&&window.localStorage.setItem("googleCalendarRefreshToken",t)},Ai=t=>{isNaN(t)||window.localStorage.setItem("googleCalendarExpirationTime",t+"")};var ro=Oe(require("obsidian"));var ap=42813,h_=`http://127.0.0.1:${ap}/callback`,m_="https://google-auth-obsidian-redirect.vercel.app/callback",Iu="783376961232-v90b17gr1mj1s2mnmdauvkp77u6htpke.apps.googleusercontent.com",Z4=window.moment().subtract(100,"seconds"),Lt={server:null,verifier:null,challenge:null,state:null};function g_(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}function __(){return te(this,null,function*(){let t=new Uint32Array(56);return yield window.crypto.getRandomValues(t),Array.from(t,e=>("0"+e.toString(16)).substr(-2)).join("")})}function v_(t){return te(this,null,function*(){let e=new TextEncoder().encode(t),n=yield window.crypto.subtle.digest("SHA-256",e);return btoa(String.fromCharCode(...new Uint8Array(n))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")})}function gM(){if(!(!Nu()||Nu()=="")&&!!xu()&&!isNaN(xu())&&!(xu()<+new Date))return Nu()}var _M=t=>te(void 0,null,function*(){var i,o;let e=t.settings.useCustomClient,n={grant_type:"refresh_token",client_id:e?(i=t.settings.googleClientId)==null?void 0:i.trim():Iu,client_secret:e?(o=t.settings.googleClientSecret)==null?void 0:o.trim():null,refresh_token:Ns()},{json:r}=yield(0,ro.requestUrl)({method:"POST",url:e?"https://oauth2.googleapis.com/token":`${t.settings.googleOAuthServer}/api/google/refresh`,headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r){Ke("Error while refreshing authentication");return}return Mi(r.access_token),Ai(+new Date+r.expires_in*1e3),r.access_token}),vM=(t,e,n,r)=>te(void 0,null,function*(){return(yield(0,ro.requestUrl)({method:"POST",url:`${t.settings.googleOAuthServer}/api/google/token`,headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Iu,code_verifier:n,code:r,state:e})})).json}),y_=(t,e,n,r,i)=>te(void 0,null,function*(){var u,f;let o=`https://oauth2.googleapis.com/token?grant_type=authorization_code&client_id=${(u=t.settings.googleClientId)==null?void 0:u.trim()}&client_secret=${(f=t.settings.googleClientSecret)==null?void 0:f.trim()}&code_verifier=${n}&code=${r}&state=${e}&redirect_uri=${i?m_:h_}`;return(yield fetch(o,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}})).json()});function w_(t){return te(this,null,function*(){if(!Ft())return;let e=gM();if(e||(e=yield _M(t)),!!e)return e})}function b_(){return te(this,null,function*(){let t=ye.getInstance(),n=t.settings.useCustomClient?t.settings.googleClientId:Iu;Lt.state||(Lt.state=g_(),Lt.verifier=yield __(),Lt.challenge=yield v_(Lt.verifier));let r=`https://accounts.google.com/o/oauth2/v2/auth?client_id=${n}&response_type=code&redirect_uri=${m_}&prompt=consent&access_type=offline&state=${Lt.state}&code_challenge=${Lt.challenge}&code_challenge_method=S256&scope=email%20profile%20https://www.googleapis.com/auth/calendar`;window.open(r)})}function k_(t,e){return te(this,null,function*(){let n=ye.getInstance();if(e!==Lt.state)return;let r=yield y_(ye.getInstance(),e,Lt.verifier,t,!0);(r==null?void 0:r.refresh_token)&&(no(r.refresh_token),Mi(r.access_token),Ai(+new Date+r.expires_in*1e3),new ro.Notice("Login successful!"),n.settingsTab.display()),Lt={server:null,verifier:null,challenge:null,state:null}})}function E_(){return te(this,null,function*(){let t=ye.getInstance(),e=t.settings.useCustomClient,n=e?t.settings.googleClientId:Iu;if(!ro.Platform.isDesktop){new ro.Notice("Can't use this OAuth method on this device");return}if(!T_())return;Lt.state||(Lt.state=g_(),Lt.verifier=yield __(),Lt.challenge=yield v_(Lt.verifier));let r=`https://accounts.google.com/o/oauth2/v2/auth?client_id=${n}&response_type=code&redirect_uri=${h_}&prompt=consent&access_type=offline&state=${Lt.state}&code_challenge=${Lt.challenge}&code_challenge_method=S256&scope=email%20profile%20https://www.googleapis.com/auth/calendar`;if(Lt.server){window.open(r);return}let i=require("http"),o=require("url");Lt.server=i.createServer((a,u)=>te(this,null,function*(){try{if(a.url.indexOf("/callback")<0)return;let f=new o.URL(a.url,`http://127.0.0.1:${ap}`).searchParams,c=f.get("code");if(f.get("state")!==Lt.state)return;let h;e?h=yield y_(t,Lt.state,Lt.verifier,c,!1):h=yield vM(t,Lt.state,Lt.verifier,c),(h==null?void 0:h.refresh_token)&&(no(h.refresh_token),Mi(h.access_token),Ai(+new Date+h.expires_in*1e3)),console.info("Tokens acquired."),u.end("Authentication successful! Please return to obsidian."),Lt.server.close(()=>{console.log("Server closed")}),t.settingsTab.display()}catch(f){console.log("Auth failed"),Lt.server.close(()=>{console.log("Server closed")})}Lt={server:null,verifier:null,challenge:null,state:null}})).listen(ap,()=>te(this,null,function*(){window.open(r)}))})}var Mt=class extends Error{constructor(e,n,r,i){super(e);Object.setPrototypeOf(this,Mt.prototype),this.request=n,this.status=r,this.response=i}sayHello(){return"hello "+this.message}};var S_=Oe(require("obsidian")),Tr=(t,e,n,r=!1)=>te(void 0,null,function*(){let i=ye.getInstance(),o={"Content-Type":"application/json"};if(r==!1){let u=yield w_(i);if(!u)throw new Mt("Error Google API request",{method:e,url:t,body:n},401,{error:"Missing Auth Token"});o.Authorization="Bearer "+u}if(i.settings.debugMode){console.log(`New Request ${e}:${t}`);let u=zn({},o);u.Authorization&&(u.Authorization=u.Authorization.substring(0,15)+"..."),console.log({body:n,headers:u});let f;try{f=yield fetch(t,{method:e,body:n?JSON.stringify(n):null,headers:o})}catch(c){throw f?new Mt("Error Google API request",{method:e,url:t,body:n},f.status,yield f.json()):new Mt("Error Google API request",{method:e,url:t,body:n},500,{error:"Unknown Error"})}if(f.status>=300)throw new Mt("Error Google API request",{method:e,url:t,body:n},f.status,yield f.json());return e.toLowerCase()=="delete"?{status:"success"}:yield f.json()}let a;try{a=yield(0,S_.requestUrl)({method:e,url:t,body:n?JSON.stringify(n):null,headers:o,throw:!1})}catch(u){throw a?new Mt("Error Google API request",{method:e,url:t,body:n},a.status,yield a.json()):new Mt("Error Google API request",{method:e,url:t,body:n},500,{error:"Unknown Error"})}if(a.status>=300)throw new Mt("Error Google API request",{method:e,url:t,body:n},a.status,a.json);return e.toLowerCase()=="delete"?{status:"success"}:yield a.json});var lp=[];function C_(t,e){return e.filter(r=>!t.settings.calendarBlackList.some(i=>i[0]==r.id))}function Pi(){return te(this,null,function*(){if(!Ft())throw new Mt("Not logged in",null,401,{error:"Not logged in"});let t=ye.getInstance();if(lp.length)return C_(t,lp);let e=yield Tr("https://www.googleapis.com/calendar/v3/users/me/calendarList","GET",null);return lp=e.items,C_(t,e.items)})}function Sr(){return te(this,null,function*(){try{return yield Pi()}catch(t){switch(t.status){case 401:break;case 999:Ke(t.message);break;default:Ke("Could not list Google Calendars."),console.error("[GoogleCalendar]",t);break}return[]}})}var Gr=Oe(require("obsidian"));var K_=Oe(require("obsidian"));var Qt="top",pn="bottom",an="right",rn="left",Ru="auto",io=[Qt,pn,an,rn],Ni="start",Bo="end",D_="clippingParents",Lu="viewport",xs="popper",O_="reference",up=io.reduce(function(t,e){return t.concat([e+"-"+Ni,e+"-"+Bo])},[]),Fu=[].concat(io,[Ru]).reduce(function(t,e){return t.concat([e,e+"-"+Ni,e+"-"+Bo])},[]),yM="beforeRead",wM="read",bM="afterRead",kM="beforeMain",EM="main",TM="afterMain",SM="beforeWrite",CM="write",DM="afterWrite",M_=[yM,wM,bM,kM,EM,TM,SM,CM,DM];function kn(t){return t?(t.nodeName||"").toLowerCase():null}function Zt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Cr(t){var e=Zt(t).Element;return t instanceof e||t instanceof Element}function hn(t){var e=Zt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Is(t){if(typeof ShadowRoot=="undefined")return!1;var e=Zt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function OM(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!hn(o)||!kn(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var u=i[a];u===!1?o.removeAttribute(a):o.setAttribute(a,u===!0?"":u)}))})}function MM(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),u=a.reduce(function(f,c){return f[c]="",f},{});!hn(i)||!kn(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(f){i.removeAttribute(f)}))})}}var A_={name:"applyStyles",enabled:!0,phase:"write",fn:OM,effect:MM,requires:["computeStyles"]};function En(t){return t.split("-")[0]}var Wr=Math.max,Go=Math.min,xi=Math.round;function Rs(){var t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ha(){return!/^((?!chrome|android).)*safari/i.test(Rs())}function Dr(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&hn(t)&&(i=t.offsetWidth>0&&xi(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&xi(r.height)/t.offsetHeight||1);var a=Cr(t)?Zt(t):window,u=a.visualViewport,f=!Ha()&&n,c=(r.left+(f&&u?u.offsetLeft:0))/i,p=(r.top+(f&&u?u.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:p,right:c+h,bottom:p+m,left:c,x:c,y:p}}function Uo(t){var e=Dr(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function qa(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Is(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Hn(t){return Zt(t).getComputedStyle(t)}function fp(t){return["table","td","th"].indexOf(kn(t))>=0}function On(t){return((Cr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ii(t){return kn(t)==="html"?t:t.assignedSlot||t.parentNode||(Is(t)?t.host:null)||On(t)}function P_(t){return!hn(t)||Hn(t).position==="fixed"?null:t.offsetParent}function AM(t){var e=/firefox/i.test(Rs()),n=/Trident/i.test(Rs());if(n&&hn(t)){var r=Hn(t);if(r.position==="fixed")return null}var i=Ii(t);for(Is(i)&&(i=i.host);hn(i)&&["html","body"].indexOf(kn(i))<0;){var o=Hn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function jr(t){for(var e=Zt(t),n=P_(t);n&&fp(n)&&Hn(n).position==="static";)n=P_(n);return n&&(kn(n)==="html"||kn(n)==="body"&&Hn(n).position==="static")?e:n||AM(t)||e}function zo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ho(t,e,n){return Wr(t,Go(e,n))}function N_(t,e,n){var r=Ho(t,e,n);return r>n?n:r}function Va(){return{top:0,right:0,bottom:0,left:0}}function Ka(t){return Object.assign({},Va(),t)}function Za(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var PM=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Ka(typeof e!="number"?e:Za(e,io))};function NM(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=En(n.placement),f=zo(u),c=[rn,an].indexOf(u)>=0,p=c?"height":"width";if(!(!o||!a)){var h=PM(i.padding,n),m=Uo(o),_=f==="y"?Qt:rn,v=f==="y"?pn:an,b=n.rects.reference[p]+n.rects.reference[f]-a[f]-n.rects.popper[p],E=a[f]-n.rects.reference[f],y=jr(o),O=y?f==="y"?y.clientHeight||0:y.clientWidth||0:0,D=b/2-E/2,F=h[_],P=O-m[p]-h[v],L=O/2-m[p]/2+D,R=Ho(F,L,P),M=f;n.modifiersData[r]=(e={},e[M]=R,e.centerOffset=R-L,e)}}function xM(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||!qa(e.elements.popper,i)||(e.elements.arrow=i))}var x_={name:"arrow",enabled:!0,phase:"main",fn:NM,effect:xM,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Or(t){return t.split("-")[1]}var IM={top:"auto",right:"auto",bottom:"auto",left:"auto"};function RM(t){var e=t.x,n=t.y,r=window,i=r.devicePixelRatio||1;return{x:xi(e*i)/i||0,y:xi(n*i)/i||0}}function I_(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,a=t.offsets,u=t.position,f=t.gpuAcceleration,c=t.adaptive,p=t.roundOffsets,h=t.isFixed,m=a.x,_=m===void 0?0:m,v=a.y,b=v===void 0?0:v,E=typeof p=="function"?p({x:_,y:b}):{x:_,y:b};_=E.x,b=E.y;var y=a.hasOwnProperty("x"),O=a.hasOwnProperty("y"),D=rn,F=Qt,P=window;if(c){var L=jr(n),R="clientHeight",M="clientWidth";if(L===Zt(n)&&(L=On(n),Hn(L).position!=="static"&&u==="absolute"&&(R="scrollHeight",M="scrollWidth")),L=L,i===Qt||(i===rn||i===an)&&o===Bo){F=pn;var H=h&&L===P&&P.visualViewport?P.visualViewport.height:L[R];b-=H-r.height,b*=f?1:-1}if(i===rn||(i===Qt||i===pn)&&o===Bo){D=an;var le=h&&L===P&&P.visualViewport?P.visualViewport.width:L[M];_-=le-r.width,_*=f?1:-1}}var V=Object.assign({position:u},c&&IM),X=p===!0?RM({x:_,y:b}):{x:_,y:b};if(_=X.x,b=X.y,f){var K;return Object.assign({},V,(K={},K[F]=O?"0":"",K[D]=y?"0":"",K.transform=(P.devicePixelRatio||1)<=1?"translate("+_+"px, "+b+"px)":"translate3d("+_+"px, "+b+"px, 0)",K))}return Object.assign({},V,(e={},e[F]=O?b+"px":"",e[D]=y?_+"px":"",e.transform="",e))}function LM(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,u=n.roundOffsets,f=u===void 0?!0:u;if(!1)var c;var p={placement:En(e.placement),variation:Or(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,I_(Object.assign({},p,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:f})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,I_(Object.assign({},p,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var R_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:LM,data:{}};var Yu={passive:!0};function FM(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,u=a===void 0?!0:a,f=Zt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(p){p.addEventListener("scroll",n.update,Yu)}),u&&f.addEventListener("resize",n.update,Yu),function(){o&&c.forEach(function(p){p.removeEventListener("scroll",n.update,Yu)}),u&&f.removeEventListener("resize",n.update,Yu)}}var L_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:FM,data:{}};var YM={left:"right",right:"left",bottom:"top",top:"bottom"};function Ls(t){return t.replace(/left|right|bottom|top/g,function(e){return YM[e]})}var WM={start:"end",end:"start"};function Wu(t){return t.replace(/start|end/g,function(e){return WM[e]})}function qo(t){var e=Zt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Vo(t){return Dr(On(t)).left+qo(t).scrollLeft}function cp(t,e){var n=Zt(t),r=On(t),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,f=0;if(i){o=i.width,a=i.height;var c=Ha();(c||!c&&e==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}return{width:o,height:a,x:u+Vo(t),y:f}}function dp(t){var e,n=On(t),r=qo(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Wr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Wr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+Vo(t),f=-r.scrollTop;return Hn(i||n).direction==="rtl"&&(u+=Wr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:f}}function Ko(t){var e=Hn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function ju(t){return["html","body","#document"].indexOf(kn(t))>=0?t.ownerDocument.body:hn(t)&&Ko(t)?t:ju(Ii(t))}function oo(t,e){var n;e===void 0&&(e=[]);var r=ju(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Zt(r),a=i?[o].concat(o.visualViewport||[],Ko(r)?r:[]):r,u=e.concat(a);return i?u:u.concat(oo(Ii(a)))}function Fs(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function jM(t,e){var n=Dr(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function F_(t,e,n){return e===Lu?Fs(cp(t,n)):Cr(e)?jM(e,n):Fs(dp(On(t)))}function BM(t){var e=oo(Ii(t)),n=["absolute","fixed"].indexOf(Hn(t).position)>=0,r=n&&hn(t)?jr(t):t;return Cr(r)?e.filter(function(i){return Cr(i)&&qa(i,r)&&kn(i)!=="body"}):[]}function pp(t,e,n,r){var i=e==="clippingParents"?BM(t):[].concat(e),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(f,c){var p=F_(t,c,r);return f.top=Wr(p.top,f.top),f.right=Go(p.right,f.right),f.bottom=Go(p.bottom,f.bottom),f.left=Wr(p.left,f.left),f},F_(t,a,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function Xa(t){var e=t.reference,n=t.element,r=t.placement,i=r?En(r):null,o=r?Or(r):null,a=e.x+e.width/2-n.width/2,u=e.y+e.height/2-n.height/2,f;switch(i){case Qt:f={x:a,y:e.y-n.height};break;case pn:f={x:a,y:e.y+e.height};break;case an:f={x:e.x+e.width,y:u};break;case rn:f={x:e.x-n.width,y:u};break;default:f={x:e.x,y:e.y}}var c=i?zo(i):null;if(c!=null){var p=c==="y"?"height":"width";switch(o){case Ni:f[c]=f[c]-(e[p]/2-n[p]/2);break;case Bo:f[c]=f[c]+(e[p]/2-n[p]/2);break;default:}}return f}function Br(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,a=o===void 0?t.strategy:o,u=n.boundary,f=u===void 0?D_:u,c=n.rootBoundary,p=c===void 0?Lu:c,h=n.elementContext,m=h===void 0?xs:h,_=n.altBoundary,v=_===void 0?!1:_,b=n.padding,E=b===void 0?0:b,y=Ka(typeof E!="number"?E:Za(E,io)),O=m===xs?O_:xs,D=t.rects.popper,F=t.elements[v?O:m],P=pp(Cr(F)?F:F.contextElement||On(t.elements.popper),f,p,a),L=Dr(t.elements.reference),R=Xa({reference:L,element:D,strategy:"absolute",placement:i}),M=Fs(Object.assign({},D,R)),H=m===xs?M:L,le={top:P.top-H.top+y.top,bottom:H.bottom-P.bottom+y.bottom,left:P.left-H.left+y.left,right:H.right-P.right+y.right},V=t.modifiersData.offset;if(m===xs&&V){var X=V[i];Object.keys(le).forEach(function(K){var ce=[an,pn].indexOf(K)>=0?1:-1,S=[Qt,pn].indexOf(K)>=0?"y":"x";le[K]+=X[S]*ce})}return le}function hp(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,u=n.flipVariations,f=n.allowedAutoPlacements,c=f===void 0?Fu:f,p=Or(r),h=p?u?up:up.filter(function(v){return Or(v)===p}):io,m=h.filter(function(v){return c.indexOf(v)>=0});m.length===0&&(m=h);var _=m.reduce(function(v,b){return v[b]=Br(t,{placement:b,boundary:i,rootBoundary:o,padding:a})[En(b)],v},{});return Object.keys(_).sort(function(v,b){return _[v]-_[b]})}function GM(t){if(En(t)===Ru)return[];var e=Ls(t);return[Wu(t),e,Wu(e)]}function UM(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!0:a,f=n.fallbackPlacements,c=n.padding,p=n.boundary,h=n.rootBoundary,m=n.altBoundary,_=n.flipVariations,v=_===void 0?!0:_,b=n.allowedAutoPlacements,E=e.options.placement,y=En(E),O=y===E,D=f||(O||!v?[Ls(E)]:GM(E)),F=[E].concat(D).reduce(function(_e,Ce){return _e.concat(En(Ce)===Ru?hp(e,{placement:Ce,boundary:p,rootBoundary:h,padding:c,flipVariations:v,allowedAutoPlacements:b}):Ce)},[]),P=e.rects.reference,L=e.rects.popper,R=new Map,M=!0,H=F[0],le=0;le<F.length;le++){var V=F[le],X=En(V),K=Or(V)===Ni,ce=[Qt,pn].indexOf(X)>=0,S=ce?"width":"height",Q=Br(e,{placement:V,boundary:p,rootBoundary:h,altBoundary:m,padding:c}),j=ce?K?an:rn:K?pn:Qt;P[S]>L[S]&&(j=Ls(j));var U=Ls(j),J=[];if(o&&J.push(Q[X]<=0),u&&J.push(Q[j]<=0,Q[U]<=0),J.every(function(_e){return _e})){H=V,M=!1;break}R.set(V,J)}if(M)for(var re=v?3:1,Y=function(Ce){var Fe=F.find(function(je){var pt=R.get(je);if(pt)return pt.slice(0,Ce).every(function(ht){return ht})});if(Fe)return H=Fe,"break"},z=re;z>0;z--){var ee=Y(z);if(ee==="break")break}e.placement!==H&&(e.modifiersData[r]._skip=!0,e.placement=H,e.reset=!0)}}var Y_={name:"flip",enabled:!0,phase:"main",fn:UM,requiresIfExists:["offset"],data:{_skip:!1}};function W_(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function j_(t){return[Qt,an,pn,rn].some(function(e){return t[e]>=0})}function zM(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=Br(e,{elementContext:"reference"}),u=Br(e,{altBoundary:!0}),f=W_(a,r),c=W_(u,i,o),p=j_(f),h=j_(c);e.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":h})}var B_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zM};function HM(t,e,n){var r=En(t),i=[rn,Qt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,a=o[0],u=o[1];return a=a||0,u=(u||0)*i,[rn,an].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function qM(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,a=Fu.reduce(function(p,h){return p[h]=HM(h,e.rects,o),p},{}),u=a[e.placement],f=u.x,c=u.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=f,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=a}var G_={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qM};function VM(t){var e=t.state,n=t.name;e.modifiersData[n]=Xa({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var U_={name:"popperOffsets",enabled:!0,phase:"read",fn:VM,data:{}};function mp(t){return t==="x"?"y":"x"}function KM(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!1:a,f=n.boundary,c=n.rootBoundary,p=n.altBoundary,h=n.padding,m=n.tether,_=m===void 0?!0:m,v=n.tetherOffset,b=v===void 0?0:v,E=Br(e,{boundary:f,rootBoundary:c,padding:h,altBoundary:p}),y=En(e.placement),O=Or(e.placement),D=!O,F=zo(y),P=mp(F),L=e.modifiersData.popperOffsets,R=e.rects.reference,M=e.rects.popper,H=typeof b=="function"?b(Object.assign({},e.rects,{placement:e.placement})):b,le=typeof H=="number"?{mainAxis:H,altAxis:H}:Object.assign({mainAxis:0,altAxis:0},H),V=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,X={x:0,y:0};if(!!L){if(o){var K,ce=F==="y"?Qt:rn,S=F==="y"?pn:an,Q=F==="y"?"height":"width",j=L[F],U=j+E[ce],J=j-E[S],re=_?-M[Q]/2:0,Y=O===Ni?R[Q]:M[Q],z=O===Ni?-M[Q]:-R[Q],ee=e.elements.arrow,_e=_&&ee?Uo(ee):{width:0,height:0},Ce=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Va(),Fe=Ce[ce],je=Ce[S],pt=Ho(0,R[Q],_e[Q]),ht=D?R[Q]/2-re-pt-Fe-le.mainAxis:Y-pt-Fe-le.mainAxis,ge=D?-R[Q]/2+re+pt+je+le.mainAxis:z+pt+je+le.mainAxis,Ee=e.elements.arrow&&jr(e.elements.arrow),vt=Ee?F==="y"?Ee.clientTop||0:Ee.clientLeft||0:0,Ht=(K=V==null?void 0:V[F])!=null?K:0,mr=j+ht-Ht-vt,rt=j+ge-Ht,Ue=Ho(_?Go(U,mr):U,j,_?Wr(J,rt):J);L[F]=Ue,X[F]=Ue-j}if(u){var Vn,tr=F==="x"?Qt:rn,_n=F==="x"?pn:an,vn=L[P],Yn=P==="y"?"height":"width",Gt=vn+E[tr],Wn=vn-E[_n],Cn=[Qt,rn].indexOf(y)!==-1,yn=(Vn=V==null?void 0:V[P])!=null?Vn:0,jn=Cn?Gt:vn-R[Yn]-M[Yn]-yn+le.altAxis,Kn=Cn?vn+R[Yn]+M[Yn]-yn-le.altAxis:Wn,Zn=_&&Cn?N_(jn,vn,Kn):Ho(_?jn:Gt,vn,_?Kn:Wn);L[P]=Zn,X[P]=Zn-vn}e.modifiersData[r]=X}}var z_={name:"preventOverflow",enabled:!0,phase:"main",fn:KM,requiresIfExists:["offset"]};function gp(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function _p(t){return t===Zt(t)||!hn(t)?qo(t):gp(t)}function ZM(t){var e=t.getBoundingClientRect(),n=xi(e.width)/t.offsetWidth||1,r=xi(e.height)/t.offsetHeight||1;return n!==1||r!==1}function vp(t,e,n){n===void 0&&(n=!1);var r=hn(e),i=hn(e)&&ZM(e),o=On(e),a=Dr(t,i,n),u={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(r||!r&&!n)&&((kn(e)!=="body"||Ko(o))&&(u=_p(e)),hn(e)?(f=Dr(e,!0),f.x+=e.clientLeft,f.y+=e.clientTop):o&&(f.x=Vo(o))),{x:a.left+u.scrollLeft-f.x,y:a.top+u.scrollTop-f.y,width:a.width,height:a.height}}function XM(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(u){if(!n.has(u)){var f=e.get(u);f&&i(f)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function yp(t){var e=XM(t);return M_.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function wp(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function bp(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var H_={placement:"bottom",modifiers:[],strategy:"absolute"};function q_(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function V_(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?H_:i;return function(u,f,c){c===void 0&&(c=o);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},H_,o),modifiersData:{},elements:{reference:u,popper:f},attributes:{},styles:{}},h=[],m=!1,_={state:p,setOptions:function(y){var O=typeof y=="function"?y(p.options):y;b(),p.options=Object.assign({},o,p.options,O),p.scrollParents={reference:Cr(u)?oo(u):u.contextElement?oo(u.contextElement):[],popper:oo(f)};var D=yp(bp([].concat(r,p.options.modifiers)));if(p.orderedModifiers=D.filter(function(V){return V.enabled}),!1){var F;if(getBasePlacement(p.options.placement)===auto)var P;var L,R,M,H,le}return v(),_.update()},forceUpdate:function(){if(!m){var y=p.elements,O=y.reference,D=y.popper;if(!!q_(O,D)){p.rects={reference:vp(O,jr(D),p.options.strategy==="fixed"),popper:Uo(D)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(V){return p.modifiersData[V.name]=Object.assign({},V.data)});for(var F=0,P=0;P<p.orderedModifiers.length;P++){if(p.reset===!0){p.reset=!1,P=-1;continue}var L=p.orderedModifiers[P],R=L.fn,M=L.options,H=M===void 0?{}:M,le=L.name;typeof R=="function"&&(p=R({state:p,options:H,name:le,instance:_})||p)}}}},update:wp(function(){return new Promise(function(E){_.forceUpdate(),E(p)})}),destroy:function(){b(),m=!0}};if(!q_(u,f))return _;_.setOptions(c).then(function(E){!m&&c.onFirstUpdate&&c.onFirstUpdate(E)});function v(){p.orderedModifiers.forEach(function(E){var y=E.name,O=E.options,D=O===void 0?{}:O,F=E.effect;if(typeof F=="function"){var P=F({state:p,name:y,instance:_,options:D}),L=function(){};h.push(P||L)}})}function b(){h.forEach(function(E){return E()}),h=[]}return _}}var JM=[L_,U_,R_,A_,G_,Y_,z_,x_,B_],kp=V_({defaultModifiers:JM});var QM=(t,e)=>(t%e+e)%e,Z_=class{constructor(e,n,r){this.owner=e,this.containerEl=n,n.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),n.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),r.register([],"ArrowUp",i=>{if(!i.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),r.register([],"ArrowDown",i=>{if(!i.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),r.register([],"Enter",i=>{if(!i.isComposing)return this.useSelectedItem(i),!1})}onSuggestionClick(e,n){e.preventDefault();let r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1),this.useSelectedItem(e)}onSuggestionMouseover(e,n){let r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1)}setSuggestions(e){this.containerEl.empty();let n=[];e.forEach(r=>{let i=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(r,i),n.push(i)}),this.values=e,this.suggestions=n,this.setSelectedItem(0,!1)}useSelectedItem(e){let n=this.values[this.selectedItem];n&&this.owner.selectSuggestion(n,e)}setSelectedItem(e,n){let r=QM(e,this.suggestions.length),i=this.suggestions[this.selectedItem],o=this.suggestions[r];i==null||i.removeClass("is-selected"),o==null||o.addClass("is-selected"),this.selectedItem=r,n&&o.scrollIntoView(!1)}},Ja=class{constructor(e){this.inputEl=e,this.scope=new K_.Scope,this.suggestEl=createDiv("suggestion-container");let n=this.suggestEl.createDiv("suggestion");this.suggest=new Z_(this,n,this.scope),this.scope.register([],"Escape",this.close.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",r=>{r.preventDefault()})}onInputChanged(){let e=this.inputEl.value,n=this.getSuggestions(e);if(!n){this.close();return}n.length>0?(this.suggest.setSuggestions(n),this.open(app.dom.appContainerEl,this.inputEl)):this.close()}open(e,n){app.keymap.pushScope(this.scope),e.appendChild(this.suggestEl),this.popper=kp(n,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:r,instance:i})=>{let o=`${r.rects.reference.width}px`;r.styles.popper.width!==o&&(r.styles.popper.width=o,i.update())},phase:"beforeWrite",requires:["computeStyles"]}]})}close(){app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}};function $M(t){t=(0,Gr.normalizePath)(t);let e=app.vault.getAbstractFileByPath(t);return!e||!(e instanceof Gr.TFolder)?null:e}function X_(t){let e=$M(t),n=[];return Gr.Vault.recurseChildren(e,r=>{r instanceof Gr.TFile&&n.push(r)}),n.sort((r,i)=>r.basename.localeCompare(i.basename)),n}var J_;(function(n){n[n.TemplateFiles=0]="TemplateFiles",n[n.ScriptFiles=1]="ScriptFiles"})(J_||(J_={}));var Qa=class extends Ja{constructor(e,n){super(e);this.inputEl=e;this.plugin=n}getSuggestions(e){var a,u,f,c,p,h,m;let n=[];if(this.plugin.templaterPlugin){let _=(0,Gr.normalizePath)((f=(u=(a=this.plugin)==null?void 0:a.templaterPlugin)==null?void 0:u.settings)==null?void 0:f.templates_folder),v=X_(_);n=[...n,...v]}if(this.plugin.coreTemplatePlugin){let _=(0,Gr.normalizePath)((m=(h=(p=(c=this.plugin)==null?void 0:c.coreTemplatePlugin)==null?void 0:p.instance)==null?void 0:h.options)==null?void 0:m.folder),v=X_(_);n=[...n,...v]}if(!n)return[];let r=new Set(n),i=[],o=e.toLowerCase();return r.forEach(_=>{_ instanceof Gr.TFile&&_.extension==="md"&&_.path.toLowerCase().contains(o)&&i.push(_)}),i}renderSuggestion(e,n){n.setText(e.path)}selectSuggestion(e){this.inputEl.value=e.path,this.inputEl.trigger("input"),this.close()}};var Q_=Oe(require("obsidian"));var $a=class extends Ja{getSuggestions(e){let n=app.vault.getAllLoadedFiles(),r=[],i=e.toLowerCase();return n.forEach(o=>{o instanceof Q_.TFolder&&o.path.toLowerCase().contains(i)&&r.push(o)}),r}renderSuggestion(e,n){n.setText(e.path)}selectSuggestion(e){this.inputEl.value=e.path,this.inputEl.trigger("input"),this.close()}};var Mr=Oe(Bu()),Sp=Oe(Ri()),Gu={},Cp={},Bs=t=>te(void 0,null,function*(){if(!app.workspace.layoutReady||!t.settings.activateDailyNoteAddon)return;let e={};try{e=(0,Mr.getAllDailyNotes)()}catch(n){console.log("Daily note folder not set. Deactivated Show Daily notes setting."),t.settings.activateDailyNoteAddon=!1,t.saveSettings()}Sp.default.isEqual(Gu,e)==!1&&(Gu=e)}),so=t=>te(void 0,null,function*(){if(!app.workspace.layoutReady||!t.settings.activateDailyNoteAddon||!t.settings.useWeeklyNotes)return;let e={};try{e=(0,Mr.getAllWeeklyNotes)()}catch(n){console.log("Daily note folder not set. Deactivated Show Daily notes setting."),t.settings.activateDailyNoteAddon=!1,t.saveSettings()}Sp.default.isEqual(Cp,e)==!1&&(Cp=e)}),Uu=()=>Gu,Zo=t=>(0,Mr.getDailyNote)(t,Gu);var ll=t=>(0,Mr.getWeeklyNote)(t,Cp),_1=t=>te(void 0,null,function*(){var e,n,r,i;if(!t.type||t.type==="daily"){let o=Zo((e=t.date)!=null?e:window.moment());return o||(o=yield(0,Mr.createDailyNote)((n=t.date)!=null?n:window.moment()),Bs(ye.getInstance()),o)}if(t.type==="weekly"){let o=ll((r=t.date)!=null?r:window.moment());return o||(o=yield(0,Mr.createWeeklyNote)((i=t.date)!=null?i:window.moment()),so(ye.getInstance()),o)}}),Li=t=>te(void 0,null,function*(){var r,i;let e=yield _1(t);yield app.workspace.getLeaf((r=t.openInNewTab)!=null?r:!1,(i=t.openToRight)!=null?i:"horizontal").openFile(e,{active:!0})}),Dp=t=>te(void 0,null,function*(){let e=yield _1(t);yield app.workspace.openPopoutLeaf().openFile(e,{active:!0})});var v1=Oe(require("obsidian")),Op=class extends v1.Modal{constructor(e){super(e)}onOpen(){let{contentEl:e}=this;e.createEl("h1",{text:"Google Calendar Alert"}),e.createEl("p",{text:"The public client is full and will not work. Please activate `Use own authentication client` again. Press the link below to find out how to create a own client."}),e.createEl("a",{text:"Tutorial",href:"https://yukigasai.github.io/obsidian-google-calendar/#/Basics/Installation"})}onClose(){let{contentEl:e}=this;e.empty()}};var Mp=class extends gt.PluginSettingTab{constructor(e,n){super(e,n);this.plugin=n}display(){let{containerEl:e}=this,n=Ns();e.empty(),e.createEl("h2",{text:"Settings for Google Calendar"}),e.createEl("h4",{text:"Please restart Obsidian to let changes take effect"});let r=document.createDocumentFragment();r.append("Use own authentication client",r.createEl("br"),"Check the ",r.createEl("a",{href:"https://yukigasai.github.io/obsidian-google-calendar/#/Basics/Installation",text:"documentation"})," to find out how to create a own client."),new gt.Setting(e).setName("Use own authentication client").setDesc(r).addToggle(o=>o.setValue(this.plugin.settings.useCustomClient).onChange(a=>te(this,null,function*(){no(""),Mi(""),Ai(0),a===!1&&new Op(app).open(),this.plugin.settings.useCustomClient=a,yield this.plugin.saveSettings(),this.display()}))),this.plugin.settings.useCustomClient?(new gt.Setting(e).setName("ClientId").setDesc("Google client id").setClass("SubSettings").addText(o=>o.setPlaceholder("Enter your client id").setValue(this.plugin.settings.googleClientId).onChange(a=>te(this,null,function*(){this.plugin.settings.googleClientId=a.trim(),yield this.plugin.saveSettings()}))),new gt.Setting(e).setName("ClientSecret").setDesc("Google client secret").setClass("SubSettings").addText(o=>o.setPlaceholder("Enter your client secret").setValue(this.plugin.settings.googleClientSecret).onChange(a=>te(this,null,function*(){this.plugin.settings.googleClientSecret=a.trim(),yield this.plugin.saveSettings()})))):new gt.Setting(e).setName("Server url").setDesc("The url to the server where the oauth takes place").setClass("SubSettings").addText(o=>{o.setValue(this.plugin.settings.googleOAuthServer).onChange(a=>te(this,null,function*(){this.plugin.settings.googleOAuthServer=a.trim(),yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Login with google").addButton(o=>{o.setButtonText(n?"Logout":"Login").onClick(()=>{n?(no(""),Mi(""),Ai(0),this.hide(),this.display()):gt.Platform.isMobileApp?this.plugin.settings.useCustomClient?b_():window.open(`${this.plugin.settings.googleOAuthServer}/api/google`):E_()})}),new gt.Setting(e).setName("Refresh Interval").setDesc("Time in seconds between refresh request from google server").addSlider(o=>{o.setValue(this.plugin.settings.refreshInterval),o.setLimits(this.plugin.settings.useCustomClient?10:60,360,1),o.setDynamicTooltip(),o.onChange(a=>te(this,null,function*(){a<60&&!this.plugin.settings.useCustomClient||(this.plugin.settings.refreshInterval=a,yield this.plugin.saveSettings())}))}),new gt.Setting(e).setName("Use event Notification").setDesc("Will send notification when an event starts").addToggle(o=>{o.setValue(this.plugin.settings.useNotification),o.onChange(a=>te(this,null,function*(){this.plugin.settings.useNotification=a,yield this.plugin.saveSettings(),this.hide(),this.display()}))}),new gt.Setting(e).setName("Show daily notes").setDesc("Will display daily notes and allow to open and create daily notes").addToggle(o=>{o.setValue(this.plugin.settings.activateDailyNoteAddon),o.onChange(a=>te(this,null,function*(){this.plugin.settings.activateDailyNoteAddon=a,yield this.plugin.saveSettings(),this.hide(),this.display()}))}),this.plugin.settings.activateDailyNoteAddon&&(new gt.Setting(e).setName("Use Weekly Notes").setDesc("Will show week numbers with weekly note dots").setClass("SubSettings").addToggle(o=>{o.setValue(this.plugin.settings.useWeeklyNotes),o.onChange(a=>te(this,null,function*(){this.plugin.settings.useWeeklyNotes=a,a&&so(this.plugin),yield this.plugin.saveSettings(),this.hide(),this.display()}))}),new gt.Setting(e).setName("Daily dot color").setDesc("Color for daily note dots in month view").setClass("SubSettings").addText(o=>{o.inputEl.type="color",o.setValue(this.plugin.settings.dailyNoteDotColor),o.onChange(a=>te(this,null,function*(){this.plugin.settings.dailyNoteDotColor=a,yield this.plugin.saveSettings()}))})),new gt.Setting(e).setName("Enable @ Annotations").setDesc("Will help you to easily link events from you calendar in your notes").addToggle(o=>{o.setValue(this.plugin.settings.atAnnotationEnabled),o.onChange(a=>te(this,null,function*(){this.plugin.settings.atAnnotationEnabled=a,yield this.plugin.saveSettings(),this.hide(),this.display()}))}),this.plugin.settings.atAnnotationEnabled&&new gt.Setting(e).setName("@ Annotation date format").setDesc("SWitch between mm/dd/yyyy and dd/mm/yyyy").setClass("SubSettings").addDropdown(o=>{o.addOption("mm/dd/yyyy","mm/dd/yyyy"),o.addOption("dd/mm/yyyy","dd/mm/yyyy"),o.setValue(this.plugin.settings.usDateFormat?"mm/dd/yyyy":"dd/mm/yyyy"),o.onChange(a=>te(this,null,function*(){a=="mm/dd/yyyy"?this.plugin.settings.usDateFormat=!0:this.plugin.settings.usDateFormat=!1,yield this.plugin.saveSettings(),this.hide(),this.display()}))}),new gt.Setting(e).setName("Auto create Event Notes").setDesc("Will create new notes from a event if the description contains :obsidian:").addToggle(o=>{o.setValue(this.plugin.settings.autoCreateEventNotes),o.onChange(a=>te(this,null,function*(){this.plugin.settings.autoCreateEventNotes=a,yield this.plugin.saveSettings(),this.hide(),this.display()}))}),new gt.Setting(e).setName("Auto create Event Notes Marker").setDesc("Specify the marker that will be used to find events to create notes. Keep empty to create a note for all events.").setClass("SubSettings").addText(o=>{o.setValue(this.plugin.settings.autoCreateEventNotesMarker),o.onChange(a=>te(this,null,function*(){this.plugin.settings.autoCreateEventNotesMarker=a,yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Keep auto created Notes open").setDesc("When creating a new note should it stay open for direct editing").setClass("SubSettings").addToggle(o=>{o.setValue(this.plugin.settings.autoCreateEventKeepOpen),o.onChange(a=>te(this,null,function*(){this.plugin.settings.autoCreateEventKeepOpen=a,yield this.plugin.saveSettings(),this.hide(),this.display()}))}),new gt.Setting(e).setName("Import Start Offset").setDesc("Days in the past from events to import").setClass("SubSettings").addSlider(o=>{o.setValue(this.plugin.settings.importStartOffset),o.setLimits(0,7,1),o.setDynamicTooltip(),o.onChange(a=>te(this,null,function*(){o.showTooltip(),this.plugin.settings.importStartOffset=a,yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Import End Offset").setDesc("Days in the future from events to import").setClass("SubSettings").addSlider(o=>{o.setValue(this.plugin.settings.importEndOffset),o.setLimits(0,7,1),o.setDynamicTooltip(),o.onChange(a=>te(this,null,function*(){this.plugin.settings.importEndOffset=a,yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Event Note Prefix").setDesc("Optional prefix for event notes to improve performance").setClass("SubSettings").addText(o=>{o.setValue(this.plugin.settings.optionalNotePrefix),o.onChange(a=>te(this,null,function*(){this.plugin.settings.optionalNotePrefix=a,yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Event Note Name Format").setDesc("Define how the event note name should look like").setClass("SubSettings").addText(o=>{o.setValue(this.plugin.settings.eventNoteNameFormat),o.onChange(a=>te(this,null,function*(){this.plugin.settings.eventNoteNameFormat=a,yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Debug Mode").setDesc("Enable if something is not working").addToggle(o=>{o.setValue(this.plugin.settings.debugMode),o.onChange(a=>te(this,null,function*(){this.plugin.settings.debugMode=a,yield this.plugin.saveSettings()}))}),new gt.Setting(e).setName("Use defaults for note creation").setDesc("If active creating notes will be faster but less flexible").addToggle(o=>{o.setValue(this.plugin.settings.useDefaultTemplate),o.onChange(a=>te(this,null,function*(){this.plugin.settings.useDefaultTemplate=a,yield this.plugin.saveSettings(),this.display()}))}),this.plugin.settings.useDefaultTemplate&&(new gt.Setting(e).setName("Default Template").setDesc("Template to use at note creation").setClass("SubSettings").addSearch(o=>{new Qa(o.inputEl,this.plugin),o.setPlaceholder("Template").setValue(this.plugin.settings.defaultTemplate).onChange(a=>te(this,null,function*(){this.plugin.settings.defaultTemplate=a,yield this.plugin.saveSettings()})),o.containerEl.addClass("templater_search")}),new gt.Setting(e).setName("Default Folder").setDesc("Folder to save notes to after creation").setClass("SubSettings").addSearch(o=>{new $a(o.inputEl),o.setPlaceholder("Example: folder1/folder2").setValue(this.plugin.settings.defaultFolder).onChange(a=>te(this,null,function*(){this.plugin.settings.defaultFolder=a,yield this.plugin.saveSettings()})),o.containerEl.addClass("templater_search")}));let i=this.plugin.settings.insertTemplates;if(i.length&&(new gt.Setting(e).setName("Saved Templates"),i.forEach(o=>{let a=new gt.Setting(e).setClass("SubSettings").setName(o.name).addButton(u=>{u.setButtonText("Remove"),u.onClick(()=>te(this,null,function*(){this.plugin.settings.insertTemplates.remove(o),a.settingEl.remove(),yield this.plugin.saveSettings(),this.hide(),this.display()}))})})),Ft()){new gt.Setting(e).setName("Default Calendar").addDropdown(a=>te(this,null,function*(){a.addOption("Default","Select a calendar"),(yield Sr()).forEach(f=>{a.addOption(f.id,f.summary)}),a.setValue(this.plugin.settings.defaultCalendar),a.onChange(f=>te(this,null,function*(){this.plugin.settings.defaultCalendar=f,yield this.plugin.saveSettings()}))})),e.createEl("h3","Calendar Blacklist");let o=this.plugin.settings.calendarBlackList;new gt.Setting(e).setName("Add Item to BlackList").addDropdown(a=>te(this,null,function*(){a.addOption("Default","Select Option to add"),(yield Sr()).forEach(f=>{a.addOption(f.id+"_=_"+f.summary,f.summary)}),a.onChange(f=>te(this,null,function*(){let[c,p]=f.split("_=_");o.contains([c,p])||(this.plugin.settings.calendarBlackList=[...o,[c,p]],yield this.plugin.saveSettings());let h=new gt.Setting(e).setClass("SubSettings").setName(p).addButton(m=>{m.setButtonText("Remove"),m.onClick(()=>te(this,null,function*(){this.plugin.settings.calendarBlackList.remove([c,p]),h.settingEl.remove(),yield this.plugin.saveSettings()}))})}))})),o.forEach(a=>{let u=new gt.Setting(e).setClass("SubSettings").setName(a[1]).addButton(f=>{f.setButtonText("Remove"),f.onClick(()=>te(this,null,function*(){this.plugin.settings.calendarBlackList.remove(a),u.settingEl.remove(),yield this.plugin.saveSettings()}))})})}}};function T_(){let t=ye.getInstance();return t.settings.useCustomClient&&(t.settings.googleClientId==""||t.settings.googleClientSecret=="")?(Ke("Google Calendar missing settings"),!1):!0}function Ft(){return!Ns()||Ns()==""?(Ke("Google Calendar missing settings or not logged in"),!1):!0}var Ov=Oe(require("obsidian"));var Pp=Oe(Ri());var y1={"1":{hex:"#ac725e",name:"0"},"2":{hex:"#d06b64",name:"0"},"3":{hex:"#f83a22",name:"0"},"4":{hex:"#fa573c",name:"0"},"5":{hex:"#ff7537",name:"0"},"6":{hex:"#ffad46",name:"0"},"7":{hex:"#42d692",name:"0"},"8":{hex:"#16a765",name:"0"},"9":{hex:"#7bd148",name:"0"},"10":{hex:"#b3dc6c",name:"0"},"11":{hex:"#fbe983",name:"0"},"12":{hex:"#fad165",name:"0"},"13":{hex:"#92e1c0",name:"0"},"14":{hex:"#9fe1e7",name:"0"},"15":{hex:"#9fc6e7",name:"0"},"16":{hex:"#4986e7",name:"0"},"17":{hex:"#9a9cff",name:"0"},"18":{hex:"#b99aff",name:"0"},"19":{hex:"#c2c2c2",name:"0"},"20":{hex:"#cabdbf",name:"0"},"21":{hex:"#cca6ac",name:"0"},"22":{hex:"#f691b2",name:"0"},"23":{hex:"#cd74e6",name:"0"},"24":{hex:"#a47ae2",name:"0"}},zu={"1":{hex:"#a4bdfc",name:"Lavender"},"2":{hex:"#7ae7bf",name:"Sage"},"3":{hex:"#dbadff",name:"Grape"},"4":{hex:"#ff887c",name:"Flamingo"},"5":{hex:"#fbd75b",name:"Banana"},"6":{hex:"#ffb878",name:"Tangerine"},"7":{hex:"#46d6db",name:"Peacock"},"8":{hex:"#e1e1e1",name:"Graphite"},"9":{hex:"#5484ed",name:"Blueberry"},"10":{hex:"#51b749",name:"Basil"},"11":{hex:"#dc2127",name:"Tomato"}},Ap=[...new Set([...Object.values(zu).map(t=>t.name),...Object.values(y1).map(t=>t.name)])],ul=[...Object.values(zu).map(t=>t.name)];function Fi(t){return t.colorId?zu[t.colorId].hex:t.parent.colorId?y1[t.parent.colorId].hex:"#a4bdfc"}function fl(t){return t.colorId?zu[t.colorId].name:t.parent.colorId?"NOT IMPLEMENTED":"NO COLOR"}var Hu=new Map;function zr(){Hu.clear()}function Np(){return te(this,arguments,function*({startDate:t,endDate:e,exclude:n,include:r}={}){let i=ye.getInstance();t||(t=window.moment()),t=t.startOf("day"),e||(e=t.clone()),e=e.endOf("day");let o=yield Pi(),[a,u]=(r!=null?r:[]).reduce(([h,m],_)=>Ap.includes(_)?[h,[...m,_]]:[[...h,_],m],[[],[]]),[f,c]=(n!=null?n:[]).reduce(([h,m],_)=>Ap.includes(_)?[h,[...m,_]]:[[...h,_],m],[[],[]]);a.length?o=o.filter(h=>a.contains(h.id)||a.contains(h.summary)):f.length&&(o=o.filter(h=>!(f.contains(h.id)||f.contains(h.summary))));let p=[];for(let h=0;h<o.length;h++){let m=yield TA(i,o[h],t,e,u,c);p=[...p,...m]}return p=Pp.default.orderBy(p,[h=>{var m;return new Date((m=h.start.date)!=null?m:h.start.dateTime)}],"asc"),p})}function Yt(){return te(this,arguments,function*(t={}){try{return yield Np(t)}catch(e){if(!(e instanceof Mt))return[];switch(e.status){case 401:break;case 999:Ke(e.message);break;default:Ke("Google Events could not be loaded."),console.error("[GoogleCalendar]",e);break}return[]}})}function bA(t,e,n){return te(this,null,function*(){if(!Ft())throw new Mt("Not logged in",null,401,{error:"Not logged in"});let r,i=2500,o=[];do{let a=`https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(t.id)}/events?`;a+=`maxResults=${i}`,a+="&futureevents=true",a+="&singleEvents=true",a+="&orderby=starttime",a+="&sortorder=ascending",a+=`&timeMin=${e}`,a+=`&timeMax=${n}`,r&&r.nextPageToken&&(a+=`&pageToken=${r.nextPageToken}`),r=yield Tr(a,"GET",null);let u=r.items.filter(f=>(f.parent=t,f.status!="cancelled"));o=[...o,...u]}while(r.items.length==i&&r.nextPageToken);return o})}function kA(t,e,n){let r=[];return t.forEach(i=>{if(!i.start.dateTime||!i.end.dateTime)return;let o=window.moment(i.end.dateTime),a=window.moment(i.start.dateTime);if(a.isSame(o,"day"))return;let u=[],f=o.endOf("day").diff(a.startOf("day"),"days")+1,c=i.summary,p=1;do i.summary=`${c} (Day ${p}/${f})`,i.eventType="multiDay",u=[...u,structuredClone(i)],p++,a=a.add(1,"days"),i.start.dateTime=a.format("YYYY-MM-DD HH:mm");while(!a.isAfter(o,"day"));u=u.filter(h=>{let m=window.moment(h.start.dateTime);return!(e&&m.isBefore(e,"day")||n&&m.isSameOrAfter(n,"day"))}),i.eventType="delete",r=[...r,...u]}),t=[...t,...r],t}function EA(t,e,n,r){let i=n.clone(),o=[];for(;i<=r;){let a=JSON.stringify({day:i.format("YYYY-MM-DD"),calendar:e.id});if(!Hu.has(a))return null;!t.settings.useCustomClient&&t.settings.refreshInterval<60&&(t.settings.refreshInterval=60);let{events:u,updated:f}=Hu.get(a);if(f.clone().add(t.settings.refreshInterval,"second").isBefore(window.moment()))return null;o=[...o,...u],i.add(1,"day")}return o}function TA(a,u,f,c){return te(this,arguments,function*(t,e,n,r,i=[],o=[]){let p=EA(t,e,n,r);if(p)return p.filter(v=>i.length>0?i.includes(fl(v)):o.length>0?!o.includes(fl(v)):!0);let h=yield bA(e,n.toISOString(),r.toISOString());h=kA(h,n,r);let m=Pp.default.groupBy(h,v=>{var E;return window.moment((E=v.start.dateTime)!=null?E:v.start.date).format("YYYY-MM-DD")}),_=n.clone();for(;_<=r;){let v=_.format("YYYY-MM-DD"),b=JSON.stringify({day:v,calendar:e.id});Hu.set(b,{events:m[v]||[],updated:window.moment()}),_.add(1,"day")}return h.filter(v=>v.eventType==="delete"?!1:i.length>0?i.includes(fl(v)):o.length>0?!o.includes(fl(v)):!0)})}var Cv=Oe(require("obsidian"));var Sv=Oe(require("obsidian"));function me(){}var Gs=t=>t;function mn(t,e){for(let n in e)t[n]=e[n];return t}function xp(t){return t()}function w1(){return Object.create(null)}function We(t){t.forEach(xp)}function $t(t){return typeof t=="function"}function Ge(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}var qu;function Xo(t,e){return qu||(qu=document.createElement("a")),qu.href=e,t===qu.href}function b1(t){return Object.keys(t).length===0}function Vu(t,...e){if(t==null)return me;let n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Ku(t,e,n){t.$$.on_destroy.push(Vu(e,n))}function Hr(t,e,n,r){if(t){let i=k1(t,e,n,r);return t[0](i)}}function k1(t,e,n,r){return t[1]&&r?mn(n.ctx.slice(),t[1](r(e))):n.ctx}function qr(t,e,n,r){if(t[2]&&r){let i=t[2](r(n));if(e.dirty===void 0)return i;if(typeof i=="object"){let o=[],a=Math.max(e.dirty.length,i.length);for(let u=0;u<a;u+=1)o[u]=e.dirty[u]|i[u];return o}return e.dirty|i}return e.dirty}function Vr(t,e,n,r,i,o){if(i){let a=k1(e,n,r,o);t.p(a,i)}}function Kr(t){if(t.ctx.length>32){let e=[],n=t.ctx.length/32;for(let r=0;r<n;r++)e[r]=-1;return e}return-1}function Zr(t){let e={};for(let n in t)n[0]!=="$"&&(e[n]=t[n]);return e}function en(t){return t==null?"":t}var E1=typeof window!="undefined",Us=E1?()=>window.performance.now():()=>Date.now(),Ip=E1?t=>requestAnimationFrame(t):me;var zs=new Set;function T1(t){zs.forEach(e=>{e.c(t)||(zs.delete(e),e.f())}),zs.size!==0&&Ip(T1)}function cl(t){let e;return zs.size===0&&Ip(T1),{promise:new Promise(n=>{zs.add(e={c:t,f:n})}),abort(){zs.delete(e)}}}var S1=!1;function SA(){S1=!0}function CA(){S1=!1}function A(t,e){t.appendChild(e)}function Et(t,e,n){let r=Rp(t);if(!r.getElementById(e)){let i=N("style");i.id=e,i.textContent=n,C1(r,i)}}function Rp(t){if(!t)return document;let e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function DA(t){let e=N("style");return C1(Rp(t),e),e.sheet}function C1(t,e){return A(t.head||t,e),e.sheet}function G(t,e,n){t.insertBefore(e,n||null)}function B(t){t.parentNode&&t.parentNode.removeChild(t)}function At(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function N(t){return document.createElement(t)}function Xr(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Me(t){return document.createTextNode(t)}function $(){return Me(" ")}function zt(){return Me("")}function oe(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function oi(t){return function(e){return e.preventDefault(),t.call(this,e)}}function si(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function D1(t){return function(e){e.target===this&&t.call(this,e)}}function k(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function ai(t,e){for(let n in e)k(t,n,e[n])}function OA(t){return Array.from(t.childNodes)}function Ye(t,e){e=""+e,t.data!==e&&(t.data=e)}function er(t,e){t.value=e==null?"":e}function he(t,e,n,r){n===null?t.style.removeProperty(e):t.style.setProperty(e,n,r?"important":"")}function li(t,e,n){for(let r=0;r<t.options.length;r+=1){let i=t.options[r];if(i.__value===e){i.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function Hs(t){let e=t.querySelector(":checked");return e&&e.__value}var Zu;function MA(){if(Zu===void 0){Zu=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(t){Zu=!0}}return Zu}function O1(t,e){getComputedStyle(t).position==="static"&&(t.style.position="relative");let r=N("iframe");r.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),r.setAttribute("aria-hidden","true"),r.tabIndex=-1;let i=MA(),o;return i?(r.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",o=oe(window,"message",a=>{a.source===r.contentWindow&&e()})):(r.src="about:blank",r.onload=()=>{o=oe(r.contentWindow,"resize",e),e()}),A(t,r),()=>{(i||o&&r.contentWindow)&&o(),B(r)}}function we(t,e,n){t.classList[n?"add":"remove"](e)}function M1(t,e,{bubbles:n=!1,cancelable:r=!1}={}){let i=document.createEvent("CustomEvent");return i.initCustomEvent(t,n,r,e),i}var Xu=class{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,r=null){this.e||(this.is_svg?this.e=Xr(n.nodeName):this.e=N(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(e)),this.i(r)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let n=0;n<this.n.length;n+=1)G(this.t,this.n[n],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(B)}};var Ju=new Map,Qu=0;function AA(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function PA(t,e){let n={stylesheet:DA(e),rules:{}};return Ju.set(t,n),n}function Lp(t,e,n,r,i,o,a,u=0){let f=16.666/r,c=`{
`;for(let E=0;E<=1;E+=f){let y=e+(n-e)*o(E);c+=E*100+`%{${a(y,1-y)}}
`}let p=c+`100% {${a(n,1-n)}}
}`,h=`__svelte_${AA(p)}_${u}`,m=Rp(t),{stylesheet:_,rules:v}=Ju.get(m)||PA(m,t);v[h]||(v[h]=!0,_.insertRule(`@keyframes ${h} ${p}`,_.cssRules.length));let b=t.style.animation||"";return t.style.animation=`${b?`${b}, `:""}${h} ${r}ms linear ${i}ms 1 both`,Qu+=1,h}function $u(t,e){let n=(t.style.animation||"").split(", "),r=n.filter(e?o=>o.indexOf(e)<0:o=>o.indexOf("__svelte")===-1),i=n.length-r.length;i&&(t.style.animation=r.join(", "),Qu-=i,Qu||NA())}function NA(){Ip(()=>{Qu||(Ju.forEach(t=>{let{ownerNode:e}=t.stylesheet;e&&B(e)}),Ju.clear())})}function A1(t,e,n,r){if(!e)return me;let i=t.getBoundingClientRect();if(e.left===i.left&&e.right===i.right&&e.top===i.top&&e.bottom===i.bottom)return me;let{delay:o=0,duration:a=300,easing:u=Gs,start:f=Us()+o,end:c=f+a,tick:p=me,css:h}=n(t,{from:e,to:i},r),m=!0,_=!1,v;function b(){h&&(v=Lp(t,0,1,a,o,u,h)),o||(_=!0)}function E(){h&&$u(t,v),m=!1}return cl(y=>{if(!_&&y>=f&&(_=!0),_&&y>=c&&(p(1,0),E()),!m)return!1;if(_){let O=y-f,D=0+1*u(O/a);p(D,1-D)}return!0}),b(),p(0,1),E}function P1(t){let e=getComputedStyle(t);if(e.position!=="absolute"&&e.position!=="fixed"){let{width:n,height:r}=e,i=t.getBoundingClientRect();t.style.position="absolute",t.style.width=n,t.style.height=r,xA(t,i)}}function xA(t,e){let n=t.getBoundingClientRect();if(e.left!==n.left||e.top!==n.top){let r=getComputedStyle(t),i=r.transform==="none"?"":r.transform;t.style.transform=`${i} translate(${e.left-n.left}px, ${e.top-n.top}px)`}}var dl;function pl(t){dl=t}function Fp(){if(!dl)throw new Error("Function called outside component initialization");return dl}function Yi(t){Fp().$$.on_mount.push(t)}function Jo(t){Fp().$$.on_destroy.push(t)}function hl(){let t=Fp();return(e,n,{cancelable:r=!1}={})=>{let i=t.$$.callbacks[e];if(i){let o=M1(e,n,{cancelable:r});return i.slice().forEach(a=>{a.call(t,o)}),!o.defaultPrevented}return!0}}function Mn(t,e){let n=t.$$.callbacks[e.type];n&&n.slice().forEach(r=>r.call(this,e))}var qs=[];var Ne=[],Vs=[],Yp=[],N1=Promise.resolve(),Wp=!1;function x1(){Wp||(Wp=!0,N1.then(I1))}function ef(){return x1(),N1}function ln(t){Vs.push(t)}function et(t){Yp.push(t)}var jp=new Set,Ks=0;function I1(){if(Ks!==0)return;let t=dl;do{try{for(;Ks<qs.length;){let e=qs[Ks];Ks++,pl(e),IA(e.$$)}}catch(e){throw qs.length=0,Ks=0,e}for(pl(null),qs.length=0,Ks=0;Ne.length;)Ne.pop()();for(let e=0;e<Vs.length;e+=1){let n=Vs[e];jp.has(n)||(jp.add(n),n())}Vs.length=0}while(qs.length);for(;Yp.length;)Yp.pop()();Wp=!1,jp.clear(),pl(t)}function IA(t){if(t.fragment!==null){t.update(),We(t.before_update);let e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(ln)}}function RA(t){let e=[],n=[];Vs.forEach(r=>t.indexOf(r)===-1?e.push(r):n.push(r)),n.forEach(r=>r()),Vs=e}var ml;function R1(){return ml||(ml=Promise.resolve(),ml.then(()=>{ml=null})),ml}function tf(t,e,n){t.dispatchEvent(M1(`${e?"intro":"outro"}${n}`))}var nf=new Set,ao;function Je(){ao={r:0,c:[],p:ao}}function Qe(){ao.r||We(ao.c),ao=ao.p}function se(t,e){t&&t.i&&(nf.delete(t),t.i(e))}function de(t,e,n,r){if(t&&t.o){if(nf.has(t))return;nf.add(t),ao.c.push(()=>{nf.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}var L1={duration:0};function rf(t,e,n){let r={direction:"in"},i=e(t,n,r),o=!1,a,u,f=0;function c(){a&&$u(t,a)}function p(){let{delay:m=0,duration:_=300,easing:v=Gs,tick:b=me,css:E}=i||L1;E&&(a=Lp(t,0,1,_,m,v,E,f++)),b(0,1);let y=Us()+m,O=y+_;u&&u.abort(),o=!0,ln(()=>tf(t,!0,"start")),u=cl(D=>{if(o){if(D>=O)return b(1,0),tf(t,!0,"end"),c(),o=!1;if(D>=y){let F=v((D-y)/_);b(F,1-F)}}return o})}let h=!1;return{start(){h||(h=!0,$u(t),$t(i)?(i=i(r),R1().then(p)):p())},invalidate(){h=!1},end(){o&&(c(),o=!1)}}}function F1(t,e,n){let r={direction:"out"},i=e(t,n,r),o=!0,a,u=ao;u.r+=1;function f(){let{delay:c=0,duration:p=300,easing:h=Gs,tick:m=me,css:_}=i||L1;_&&(a=Lp(t,1,0,p,c,h,_));let v=Us()+c,b=v+p;ln(()=>tf(t,!1,"start")),cl(E=>{if(o){if(E>=b)return m(0,1),tf(t,!1,"end"),--u.r||We(u.c),!1;if(E>=v){let y=h((E-v)/p);m(1-y,y)}}return o})}return $t(i)?R1().then(()=>{i=i(r),f()}):f(),{end(c){c&&i.tick&&i.tick(1,0),o&&(a&&$u(t,a),o=!1)}}}var of=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function Y1(t,e){t.d(1),e.delete(t.key)}function Bp(t,e){de(t,1,1,()=>{e.delete(t.key)})}function W1(t,e){t.f(),Bp(t,e)}function Zs(t,e,n,r,i,o,a,u,f,c,p,h){let m=t.length,_=o.length,v=m,b={};for(;v--;)b[t[v].key]=v;let E=[],y=new Map,O=new Map,D=[];for(v=_;v--;){let R=h(i,o,v),M=n(R),H=a.get(M);H?r&&D.push(()=>H.p(R,e)):(H=c(M,R),H.c()),y.set(M,E[v]=H),M in b&&O.set(M,Math.abs(v-b[M]))}let F=new Set,P=new Set;function L(R){se(R,1),R.m(u,p),a.set(R.key,R),p=R.first,_--}for(;m&&_;){let R=E[_-1],M=t[m-1],H=R.key,le=M.key;R===M?(p=R.first,m--,_--):y.has(le)?!a.has(H)||F.has(H)?L(R):P.has(le)?m--:O.get(H)>O.get(le)?(P.add(H),L(R)):(F.add(le),m--):(f(M,a),m--)}for(;m--;){let R=t[m];y.has(R.key)||f(R,a)}for(;_;)L(E[_-1]);return We(D),E}function lo(t,e){let n={},r={},i={$$scope:1},o=t.length;for(;o--;){let a=t[o],u=e[o];if(u){for(let f in a)f in u||(r[f]=1);for(let f in u)i[f]||(n[f]=u[f],i[f]=1);t[o]=u}else for(let f in a)i[f]=1}for(let a in r)a in n||(n[a]=void 0);return n}var LA=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],F5=new Set([...LA]);function tt(t,e,n){let r=t.$$.props[e];r!==void 0&&(t.$$.bound[r]=n,n(t.$$.ctx[r]))}function ct(t){t&&t.c()}function ut(t,e,n,r){let{fragment:i,after_update:o}=t.$$;i&&i.m(e,n),r||ln(()=>{let a=t.$$.on_mount.map(xp).filter($t);t.$$.on_destroy?t.$$.on_destroy.push(...a):We(a),t.$$.on_mount=[]}),o.forEach(ln)}function st(t,e){let n=t.$$;n.fragment!==null&&(RA(n.after_update),We(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function FA(t,e){t.$$.dirty[0]===-1&&(qs.push(t),x1(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function qe(t,e,n,r,i,o,a,u=[-1]){let f=dl;pl(t);let c=t.$$={fragment:null,ctx:[],props:o,update:me,not_equal:i,bound:w1(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(f?f.$$.context:[])),callbacks:w1(),dirty:u,skip_bound:!1,root:e.target||f.$$.root};a&&a(c.root);let p=!1;if(c.ctx=n?n(t,e.props||{},(h,m,..._)=>{let v=_.length?_[0]:m;return c.ctx&&i(c.ctx[h],c.ctx[h]=v)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](v),p&&FA(t,h)),m}):[],c.update(),p=!0,We(c.before_update),c.fragment=r?r(c.ctx):!1,e.target){if(e.hydrate){SA();let h=OA(e.target);c.fragment&&c.fragment.l(h),h.forEach(B)}else c.fragment&&c.fragment.c();e.intro&&se(t.$$.fragment),ut(t,e.target,e.anchor,e.customElement),CA(),I1()}pl(f)}var YA;typeof HTMLElement=="function"&&(YA=class extends HTMLElement{constructor(){super();this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(xp).filter($t);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){We(this.$$.on_disconnect)}$destroy(){st(this,1),this.$destroy=me}$on(t,e){if(!$t(e))return me;let n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{let r=n.indexOf(e);r!==-1&&n.splice(r,1)}}$set(t){this.$$set&&!b1(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var ze=class{$destroy(){st(this,1),this.$destroy=me}$on(e,n){if(!$t(n))return me;let r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{let i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(e){this.$$set&&!b1(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var s0=Oe(Up()),{__extends:j5,__assign:B5,__rest:G5,__decorate:U5,__param:z5,__metadata:H5,__awaiter:Tt,__generator:q5,__exportStar:V5,__createBinding:K5,__values:Z5,__read:X5,__spread:J5,__spreadArrays:Q5,__spreadArray:$5,__await:eF,__asyncGenerator:tF,__asyncDelegator:nF,__asyncValues:rF,__makeTemplateObject:iF,__importStar:oF,__importDefault:sF,__classPrivateFieldGet:aF,__classPrivateFieldSet:lF}=s0.default;function zp(t,e=!1){return te(this,null,function*(){var a,u,f;let n=ye.getInstance();if(!Ft())throw new Mt("Not logged in",null,401,{error:"Not logged in"});let r=(a=t.parent)==null?void 0:a.id;if(r||(r=(u=n.settings.defaultCalendar)!=null?u:""),r==="")throw new Mt("Could not delete Google Event because no default calendar selected in Settings",null,999,{error:"No calendar set"});let i=(f=t.recurringEventId)!=null?f:t.id;return!e&&t.recurringEventId&&(i=t.id),yield Tr(`https://www.googleapis.com/calendar/v3/calendars/${r}/events/${i}`,"DELETE",null)})}function uf(t,e=!1){return te(this,null,function*(){try{let n=yield zp(t,e);return Ke(`Google Event ${t.summary} deleted.`),n}catch(n){if(!(n instanceof Mt))return!1;switch(n.status){case 401:break;case 999:Ke(n.message);break;default:Ke(`Google Event ${t.summary} could not be deleted.`),console.error("[GoogleCalendar]",n);break}return!1}})}function Hp(t,e){return te(this,null,function*(){if(!Ft())throw new Mt("Not logged in",null,401,{error:"Not logged in"});let n=yield Tr(`https://www.googleapis.com/calendar/v3/calendars/${e}/events/${t}`,"GET",null);return n.parent=(yield Pi()).find(r=>r.id===e),n})}function uo(t,e){return te(this,null,function*(){try{return yield Hp(t,e)}catch(n){if(!(n instanceof Mt))return null;switch(n.status){case 401:break;case 999:Ke(n.message);break;default:Ke("Could not get Google Event."),console.error("[GoogleCalendar]",n);break}return null}})}function Js(t,e=!1){return te(this,null,function*(){var o;let n=ye.getInstance();if(!Ft())throw new Mt("Not logged in",null,401,{error:"Not logged in"});if(e&&t.recurringEventId){let a=yield uo(t.recurringEventId,t.parent.id);t=zn(zn({},a),t),t.start.dateTime?(t.start.dateTime=window.moment(t.start.dateTime).date(window.moment(a.start.dateTime).date()).format(),t.end.dateTime=window.moment(t.end.dateTime).date(window.moment(a.end.dateTime).date()).format()):(t.start.date=window.moment(a.start.date).format("YYYY-MM-DD"),t.end.date=window.moment(a.end.date).format("YYYY-MM-DD")),t.id=a.id,t.recurrence=a.recurrence,t.id=a.id,delete t.recurringEventId,delete t.originalStartTime}let r="";if(((o=t==null?void 0:t.parent)==null?void 0:o.id)?(r=t.parent.id,t.start.timeZone=t.parent.timeZone,t.end.timeZone=t.parent.timeZone,delete t.parent):r=n.settings.defaultCalendar,r==="")throw new Mt("Could not create Google Event because no default calendar selected in Settings",null,999,{error:"No calendar set"});return yield Tr(`https://www.googleapis.com/calendar/v3/calendars/${r}/events/${t.id}`,"PUT",t)})}function a0(t){return window.moment(t).format("YYYY-MM-DD")}function l0(t){return window.moment(t).format()}function qp(t){return te(this,null,function*(){var i;let e=ye.getInstance();if(t.start.date?(t.start.date=a0(t.start.date),t.end.date=a0(t.end.date)):(t.start.dateTime=l0(t.start.dateTime),t.end.dateTime=l0(t.end.dateTime)),!Ft())throw new Mt("Not logged in",null,401,{error:"Not logged in"});let n="";if(((i=t==null?void 0:t.parent)==null?void 0:i.id)?(n=t.parent.id,t.start.timeZone=t.parent.timeZone,t.end.timeZone=t.parent.timeZone,delete t.parent):n=e.settings.defaultCalendar,n==="")throw new Mt("Could not create Google Event because no default calendar selected in Settings",null,999,{error:"No calendar set"});return yield Tr(`https://www.googleapis.com/calendar/v3/calendars/${n}/events?conferenceDataVersion=1`,"POST",t)})}function ff(t){return te(this,null,function*(){try{let e=yield qp(t);return Ke(`Google Event ${t.summary} created.`),e}catch(e){if(!(e instanceof Mt))return null;switch(e.status){case 401:break;case 999:Ke(e.message);break;default:Ke(`Google Event ${t.summary} could not be created.`),console.error("[GoogleCalendar]",e);break}return null}})}var cf=["MO","TU","WE","TH","FR","SA","SU"],un=function(){function t(e,n){if(n===0)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=n}return t.fromStr=function(e){return new t(cf.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=cf[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}();var Bt=function(t){return t!=null},ur=function(t){return typeof t=="number"},Vp=function(t){return cf.indexOf(t)>=0},An=Array.isArray,Ar=function(t,e){e===void 0&&(e=t),arguments.length===1&&(e=t,t=0);for(var n=[],r=t;r<e;r++)n.push(r);return n};var dt=function(t,e){var n=0,r=[];if(An(t))for(;n<e;n++)r[n]=[].concat(t);else for(;n<e;n++)r[n]=t;return r},u0=function(t){return An(t)?t:[t]};function Qo(t,e,n){n===void 0&&(n=" ");var r=String(t);return e=e>>0,r.length>e?String(r):(e=e-r.length,e>n.length&&(n+=dt(n,e/n.length)),n.slice(0,e)+String(r))}var f0=function(t,e,n){var r=t.split(e);return n?r.slice(0,n).concat([r.slice(n).join(e)]):r},Rn=function(t,e){var n=t%e;return n*e<0?n+e:n},df=function(t,e){return{div:Math.floor(t/e),mod:Rn(t,e)}},fr=function(t){return!Bt(t)||t.length===0},on=function(t){return!fr(t)},_t=function(t,e){return on(t)&&t.indexOf(e)!==-1};var fo;(function(t){t.MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],t.ONE_DAY=1e3*60*60*24,t.MAXYEAR=9999,t.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),t.PY_WEEKDAYS=[6,0,1,2,3,4,5],t.getYearDay=function(e){var n=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return Math.ceil((n.valueOf()-new Date(e.getUTCFullYear(),0,1).valueOf())/t.ONE_DAY)+1},t.isLeapYear=function(e){return e%4==0&&e%100!=0||e%400==0},t.isDate=function(e){return e instanceof Date},t.isValidDate=function(e){return t.isDate(e)&&!isNaN(e.getTime())},t.tzOffset=function(e){return e.getTimezoneOffset()*60*1e3},t.daysBetween=function(e,n){var r=e.getTime()-t.tzOffset(e),i=n.getTime()-t.tzOffset(n),o=r-i;return Math.round(o/t.ONE_DAY)},t.toOrdinal=function(e){return t.daysBetween(e,t.ORDINAL_BASE)},t.fromOrdinal=function(e){return new Date(t.ORDINAL_BASE.getTime()+e*t.ONE_DAY)},t.getMonthDays=function(e){var n=e.getUTCMonth();return n===1&&t.isLeapYear(e.getUTCFullYear())?29:t.MONTH_DAYS[n]},t.getWeekday=function(e){return t.PY_WEEKDAYS[e.getUTCDay()]},t.monthRange=function(e,n){var r=new Date(Date.UTC(e,n,1));return[t.getWeekday(r),t.getMonthDays(r)]},t.combine=function(e,n){return n=n||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()))},t.clone=function(e){var n=new Date(e.getTime());return n},t.cloneDates=function(e){for(var n=[],r=0;r<e.length;r++)n.push(t.clone(e[r]));return n},t.sort=function(e){e.sort(function(n,r){return n.getTime()-r.getTime()})},t.timeToUntilString=function(e,n){n===void 0&&(n=!0);var r=new Date(e);return[Qo(r.getUTCFullYear().toString(),4,"0"),Qo(r.getUTCMonth()+1,2,"0"),Qo(r.getUTCDate(),2,"0"),"T",Qo(r.getUTCHours(),2,"0"),Qo(r.getUTCMinutes(),2,"0"),Qo(r.getUTCSeconds(),2,"0"),n?"Z":""].join("")},t.untilStringToDate=function(e){var n=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/,r=n.exec(e);if(!r)throw new Error("Invalid UNTIL value: "+e);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))}})(fo||(fo={}));var Le=fo;var WA=function(){function t(e,n){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=n,e==="between"?(this.maxDate=n.inc?n.before:new Date(n.before.getTime()-1),this.minDate=n.inc?n.after:new Date(n.after.getTime()+1)):e==="before"?this.maxDate=n.inc?n.dt:new Date(n.dt.getTime()-1):e==="after"&&(this.minDate=n.inc?n.dt:new Date(n.dt.getTime()+1))}return t.prototype.accept=function(e){++this.total;var n=this.minDate&&e<this.minDate,r=this.maxDate&&e>this.maxDate;if(this.method==="between"){if(n)return!0;if(r)return!1}else if(this.method==="before"){if(r)return!1}else if(this.method==="after")return n?!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}(),Wi=WA;var N0=Oe(P0()),{__extends:$s,__assign:qn,__rest:QF,__decorate:$F,__param:e8,__metadata:t8,__awaiter:n8,__generator:r8,__exportStar:i8,__createBinding:o8,__values:s8,__read:a8,__spread:l8,__spreadArrays:$o,__await:u8,__asyncGenerator:f8,__asyncDelegator:c8,__asyncValues:d8,__makeTemplateObject:p8,__importStar:h8,__importDefault:m8,__classPrivateFieldGet:g8,__classPrivateFieldSet:_8}=N0.default;var jA=function(t){$s(e,t);function e(n,r,i){var o=t.call(this,n,r)||this;return o.iterator=i,o}return e.prototype.add=function(n){return this.iterator(n,this._result.length)?(this._result.push(n),!0):!1},e}(Wi),Zp=jA;var BA={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}},es=BA;var x0=function(t,e){return t.indexOf(e)!==-1},GA=function(t){return t.toString()},UA=function(t,e,n){return e+" "+n+", "+t},zA=function(){function t(e,n,r,i){if(n===void 0&&(n=GA),r===void 0&&(r=es),i===void 0&&(i=UA),this.text=[],this.language=r||es,this.gettext=n,this.dateFormatter=i,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var o=[].concat(this.options.bymonthday),a=[].concat(this.options.bynmonthday);o.sort(function(p,h){return p-h}),a.sort(function(p,h){return h-p}),this.bymonthday=o.concat(a),this.bymonthday.length||(this.bymonthday=null)}if(Bt(this.origOptions.byweekday)){var u=An(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],f=String(u);this.byweekday={allWeeks:u.filter(function(p){return!p.n}),someWeeks:u.filter(function(p){return Boolean(p.n)}),isWeekdays:f.indexOf("MO")!==-1&&f.indexOf("TU")!==-1&&f.indexOf("WE")!==-1&&f.indexOf("TH")!==-1&&f.indexOf("FR")!==-1&&f.indexOf("SA")===-1&&f.indexOf("SU")===-1,isEveryDay:f.indexOf("MO")!==-1&&f.indexOf("TU")!==-1&&f.indexOf("WE")!==-1&&f.indexOf("TH")!==-1&&f.indexOf("FR")!==-1&&f.indexOf("SA")!==-1&&f.indexOf("SU")!==-1};var c=function(p,h){return p.weekday-h.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 n=!0;if(!(e.options.freq in t.IMPLEMENTED)||e.origOptions.until&&e.origOptions.count)return!1;for(var r in e.origOptions){if(x0(["dtstart","wkst","freq"],r))return!0;if(!x0(t.IMPLEMENTED[e.options.freq],r))return!1}return n},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[Se.FREQUENCIES[this.options.freq]](),this.options.until){this.add(e("until"));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.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())},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 n,r,i=this.gettext;if(e===-1)return i("last");switch(r=Math.abs(e),r){case 1:case 21:case 31:n=r+i("st");break;case 2:case 22:n=r+i("nd");break;case 3:case 23:n=r+i("rd");break;default:n=r+i("th")}return e<0?n+" "+i("last"):n},t.prototype.monthtext=function(e){return this.language.monthNames[e-1]},t.prototype.weekdaytext=function(e){var n=ur(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[n]},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,n,r,i){i===void 0&&(i=","),An(e)||(e=[e]);var o=function(f,c,p){for(var h="",m=0;m<f.length;m++)m!==0&&(m===f.length-1?h+=" "+p+" ":h+=c+" "),h+=f[m];return h};n=n||function(f){return f.toString()};var a=this,u=function(f){return n&&n.call(a,f)};return r?o(e.map(u),i,r):e.map(u).join(i+" ")},t}(),ui=zA;var HA=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,n,r=this;this.symbol=null,this.value=null;do{if(this.done)return!1;var i=void 0;e=null;for(var o in this.rules){i=this.rules[o];var a=i.exec(r.text);a&&(e===null||a[0].length>e[0].length)&&(e=a,n=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(n==="SKIP");return this.symbol=n,this.value=e,!0},t.prototype.accept=function(e){if(this.symbol===e){if(this.value){var n=this.value;return this.nextSymbol(),n}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 gl(t,e){e===void 0&&(e=es);var n={},r=new HA(e.tokens);if(!r.start(t))return null;return i(),n;function i(){r.expect("every");var m=r.acceptNumber();if(m&&(n.interval=parseInt(m[0],10)),r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=Se.DAILY,r.nextSymbol()&&(a(),h());break;case"weekday(s)":n.freq=Se.WEEKLY,n.byweekday=[Se.MO,Se.TU,Se.WE,Se.TH,Se.FR],r.nextSymbol(),h();break;case"week(s)":n.freq=Se.WEEKLY,r.nextSymbol()&&(o(),h());break;case"hour(s)":n.freq=Se.HOURLY,r.nextSymbol()&&(o(),h());break;case"minute(s)":n.freq=Se.MINUTELY,r.nextSymbol()&&(o(),h());break;case"month(s)":n.freq=Se.MONTHLY,r.nextSymbol()&&(o(),h());break;case"year(s)":n.freq=Se.YEARLY,r.nextSymbol()&&(o(),h());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=Se.WEEKLY;var _=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[Se[_]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var v=f();if(!v)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(Se[v]),r.nextSymbol()}p(),h();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(n.freq=Se.YEARLY,n.bymonth=[u()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var b=u();if(!b)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(b),r.nextSymbol()}o(),h();break;default:throw new Error("Unknown symbol")}}function o(){var m=r.accept("on"),_=r.accept("the");if(!!(m||_))do{var v=c(),b=f(),E=u();if(v)b?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Se[b].nth(v))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(v),r.accept("day(s)"));else if(b)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(Se[b]);else if(r.symbol==="weekday(s)")r.nextSymbol(),n.byweekday||(n.byweekday=[Se.MO,Se.TU,Se.WE,Se.TH,Se.FR]);else if(r.symbol==="week(s)"){r.nextSymbol();var y=r.acceptNumber();if(!y)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(y[0],10)];r.accept("comma");){if(y=r.acceptNumber(),!y)throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(y[0],10))}}else if(E)r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(E);else return}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function a(){var m=r.accept("at");if(!!m)do{var _=r.acceptNumber();if(!_)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(_[0],10)];r.accept("comma");){if(_=r.acceptNumber(),!_)throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(_[0],10))}}while(r.accept("comma")||r.accept("at"))}function u(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function f(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function c(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var m=parseInt(r.value[1],10);if(m<-366||m>366)throw new Error("Nth out of range: "+m);return r.nextSymbol(),r.accept("last")?-m:m;default:return!1}}function p(){r.accept("on"),r.accept("the");var m=c();if(!!m)for(n.bymonthday=[m],r.nextSymbol();r.accept("comma");){if(m=c(),!m)throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(m),r.nextSymbol()}}function h(){if(r.symbol==="until"){var m=Date.parse(r.text);if(!m)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(m)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}var at;(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"})(at||(at={}));function _l(t){return t<at.HOURLY}var I0=function(t,e){return e===void 0&&(e=es),new Se(gl(t,e)||void 0)},ea=["count","until","interval","byweekday","bymonthday","bymonth"];ui.IMPLEMENTED=[];ui.IMPLEMENTED[at.HOURLY]=ea;ui.IMPLEMENTED[at.MINUTELY]=ea;ui.IMPLEMENTED[at.DAILY]=["byhour"].concat(ea);ui.IMPLEMENTED[at.WEEKLY]=ea;ui.IMPLEMENTED[at.MONTHLY]=ea;ui.IMPLEMENTED[at.YEARLY]=["byweekno","byyearday"].concat(ea);var R0=function(t,e,n,r){return new ui(t,e,n,r).toString()},L0=ui.isFullyConvertible;var ta=function(){function t(e,n,r,i){this.hour=e,this.minute=n,this.second=r,this.millisecond=i||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}();var F0=function(t){$s(e,t);function e(n,r,i,o,a,u,f){var c=t.call(this,o,a,u,f)||this;return c.year=n,c.month=r,c.day=i,c}return e.fromDate=function(n){return new this(n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.valueOf()%1e3)},e.prototype.getWeekday=function(){return fo.getWeekday(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(n){this.year+=n},e.prototype.addMonths=function(n){if(this.month+=n,this.month>12){var r=Math.floor(this.month/12),i=Rn(this.month,12);this.month=i,this.year+=r,this.month===0&&(this.month=12,--this.year)}},e.prototype.addWeekly=function(n,r){r>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-r))+n*7:this.day+=-(this.getWeekday()-r)+n*7,this.fixDay()},e.prototype.addDaily=function(n){this.day+=n,this.fixDay()},e.prototype.addHours=function(n,r,i){for(r&&(this.hour+=Math.floor((23-this.hour)/n)*n);;){this.hour+=n;var o=df(this.hour,24),a=o.div,u=o.mod;if(a&&(this.hour=u,this.addDaily(a)),fr(i)||_t(i,this.hour))break}},e.prototype.addMinutes=function(n,r,i,o){for(r&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/n)*n);;){this.minute+=n;var a=df(this.minute,60),u=a.div,f=a.mod;if(u&&(this.minute=f,this.addHours(u,!1,i)),(fr(i)||_t(i,this.hour))&&(fr(o)||_t(o,this.minute)))break}},e.prototype.addSeconds=function(n,r,i,o,a){for(r&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/n)*n);;){this.second+=n;var u=df(this.second,60),f=u.div,c=u.mod;if(f&&(this.second=c,this.addMinutes(f,!1,i,o)),(fr(i)||_t(i,this.hour))&&(fr(o)||_t(o,this.minute))&&(fr(a)||_t(a,this.second)))break}},e.prototype.fixDay=function(){if(!(this.day<=28)){var n=fo.monthRange(this.year,this.month-1)[1];if(!(this.day<=n))for(;this.day>n;){if(this.day-=n,++this.month,this.month===13&&(this.month=1,++this.year,this.year>fo.MAXYEAR))return;n=fo.monthRange(this.year,this.month-1)[1]}}},e.prototype.add=function(n,r){var i=n.freq,o=n.interval,a=n.wkst,u=n.byhour,f=n.byminute,c=n.bysecond;switch(i){case at.YEARLY:return this.addYears(o);case at.MONTHLY:return this.addMonths(o);case at.WEEKLY:return this.addWeekly(o,a);case at.DAILY:return this.addDaily(o);case at.HOURLY:return this.addHours(o,r,u);case at.MINUTELY:return this.addMinutes(o,r,u,f);case at.SECONDLY:return this.addSeconds(o,r,u,f,c)}},e}(ta);function Xp(t){for(var e=[],n=Object.keys(t),r=0,i=n;r<i.length;r++){var o=i[r];_t(j0,o)||e.push(o),Le.isDate(t[o])&&!Le.isValidDate(t[o])&&e.push(o)}if(e.length)throw new Error("Invalid options: "+e.join(", "));return qn({},t)}function Y0(t){var e=qn(qn({},vl),Xp(t));if(Bt(e.byeaster)&&(e.freq=Se.YEARLY),!(Bt(e.freq)&&Se.FREQUENCIES[e.freq]))throw new Error("Invalid frequency: "+e.freq+" "+t.freq);if(e.dtstart||(e.dtstart=new Date(new Date().setMilliseconds(0))),Bt(e.wkst)?ur(e.wkst)||(e.wkst=e.wkst.weekday):e.wkst=Se.MO.weekday,Bt(e.bysetpos)){ur(e.bysetpos)&&(e.bysetpos=[e.bysetpos]);for(var n=0;n<e.bysetpos.length;n++){var r=e.bysetpos[n];if(r===0||!(r>=-366&&r<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(e.byweekno)||on(e.byweekno)||on(e.byyearday)||Boolean(e.bymonthday)||on(e.bymonthday)||Bt(e.byweekday)||Bt(e.byeaster)))switch(e.freq){case Se.YEARLY:e.bymonth||(e.bymonth=e.dtstart.getUTCMonth()+1),e.bymonthday=e.dtstart.getUTCDate();break;case Se.MONTHLY:e.bymonthday=e.dtstart.getUTCDate();break;case Se.WEEKLY:e.byweekday=[Le.getWeekday(e.dtstart)];break}if(Bt(e.bymonth)&&!An(e.bymonth)&&(e.bymonth=[e.bymonth]),Bt(e.byyearday)&&!An(e.byyearday)&&ur(e.byyearday)&&(e.byyearday=[e.byyearday]),!Bt(e.bymonthday))e.bymonthday=[],e.bynmonthday=[];else if(An(e.bymonthday)){for(var i=[],o=[],n=0;n<e.bymonthday.length;n++){var r=e.bymonthday[n];r>0?i.push(r):r<0&&o.push(r)}e.bymonthday=i,e.bynmonthday=o}else e.bymonthday<0?(e.bynmonthday=[e.bymonthday],e.bymonthday=[]):(e.bynmonthday=[],e.bymonthday=[e.bymonthday]);if(Bt(e.byweekno)&&!An(e.byweekno)&&(e.byweekno=[e.byweekno]),!Bt(e.byweekday))e.bynweekday=null;else if(ur(e.byweekday))e.byweekday=[e.byweekday],e.bynweekday=null;else if(Vp(e.byweekday))e.byweekday=[un.fromStr(e.byweekday).weekday],e.bynweekday=null;else if(e.byweekday instanceof un)!e.byweekday.n||e.freq>Se.MONTHLY?(e.byweekday=[e.byweekday.weekday],e.bynweekday=null):(e.bynweekday=[[e.byweekday.weekday,e.byweekday.n]],e.byweekday=null);else{for(var a=[],u=[],n=0;n<e.byweekday.length;n++){var f=e.byweekday[n];if(ur(f)){a.push(f);continue}else if(Vp(f)){a.push(un.fromStr(f).weekday);continue}!f.n||e.freq>Se.MONTHLY?a.push(f.weekday):u.push([f.weekday,f.n])}e.byweekday=on(a)?a:null,e.bynweekday=on(u)?u:null}return Bt(e.byhour)?ur(e.byhour)&&(e.byhour=[e.byhour]):e.byhour=e.freq<Se.HOURLY?[e.dtstart.getUTCHours()]:null,Bt(e.byminute)?ur(e.byminute)&&(e.byminute=[e.byminute]):e.byminute=e.freq<Se.MINUTELY?[e.dtstart.getUTCMinutes()]:null,Bt(e.bysecond)?ur(e.bysecond)&&(e.bysecond=[e.bysecond]):e.bysecond=e.freq<Se.SECONDLY?[e.dtstart.getUTCSeconds()]:null,{parsedOptions:e}}function W0(t){var e=t.dtstart.getTime()%1e3;if(!_l(t.freq))return[];var n=[];return t.byhour.forEach(function(r){t.byminute.forEach(function(i){t.bysecond.forEach(function(o){n.push(new ta(r,i,o,e))})})}),n}function yl(t){var e=t.split(`
`).map(qA).filter(function(n){return n!==null});return qn(qn({},e[0]),e[1])}function wl(t){var e={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(t);if(!n)return e;var r=n[0],i=n[1],o=n[2];return i&&(e.tzid=i),e.dtstart=Le.untilStringToDate(o),e}function qA(t){if(t=t.replace(/^\s+|\s+$/,""),!t.length)return null;var e=/^([A-Z]+?)[:;]/.exec(t.toUpperCase());if(!e)return B0(t);var n=e[0],r=e[1];switch(r.toUpperCase()){case"RRULE":case"EXRULE":return B0(t);case"DTSTART":return wl(t);default:throw new Error("Unsupported RFC prop "+r+" in "+t)}}function B0(t){var e=t.replace(/^RRULE:/i,""),n=wl(e),r=t.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return r.forEach(function(i){var o=i.split("="),a=o[0],u=o[1];switch(a.toUpperCase()){case"FREQ":n.freq=at[u.toUpperCase()];break;case"WKST":n.wkst=Pr[u.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var f=VA(u),c=a.toLowerCase();n[c]=f;break;case"BYWEEKDAY":case"BYDAY":n.byweekday=KA(u);break;case"DTSTART":case"TZID":var p=wl(t);n.tzid=p.tzid,n.dtstart=p.dtstart;break;case"UNTIL":n.until=Le.untilStringToDate(u);break;case"BYEASTER":n.byeaster=Number(u);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),n}function VA(t){if(t.indexOf(",")!==-1){var e=t.split(",");return e.map(G0)}return G0(t)}function G0(t){return/^[+-]?\d+$/.test(t)?Number(t):t}function KA(t){var e=t.split(",");return e.map(function(n){if(n.length===2)return Pr[n];var r=n.match(/^([+-]?\d{1,2})([A-Z]{2})$/),i=Number(r[1]),o=r[2],a=Pr[o].weekday;return new un(a,i)})}var ts=function(){function t(e,n){this.date=e,this.tzid=n}return Object.defineProperty(t.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!0,configurable:!0}),t.prototype.toString=function(){var e=Le.timeToUntilString(this.date.getTime(),this.isUTC);return this.isUTC?":"+e:";TZID="+this.tzid+":"+e},t.prototype.getTime=function(){return this.date.getTime()},t.prototype.rezonedDate=function(){var e;if(this.isUTC)return this.date;var n=Intl.DateTimeFormat().resolvedOptions().timeZone,r=new Date(this.date.toLocaleString(void 0,{timeZone:n})),i=new Date(this.date.toLocaleString(void 0,{timeZone:(e=this.tzid,e!=null?e:"UTC")})),o=i.getTime()-r.getTime();return new Date(this.date.getTime()-o)},t}();function bl(t){for(var e=[],n="",r=Object.keys(t),i=Object.keys(vl),o=0;o<r.length;o++)if(r[o]!=="tzid"&&!!_t(i,r[o])){var a=r[o].toUpperCase(),u=t[r[o]],f="";if(!(!Bt(u)||An(u)&&!u.length)){switch(a){case"FREQ":f=Se.FREQUENCIES[t.freq];break;case"WKST":ur(u)?f=new un(u).toString():f=u.toString();break;case"BYWEEKDAY":a="BYDAY",f=u0(u).map(function(_){return _ instanceof un?_:An(_)?new un(_[0],_[1]):new un(_)}).toString();break;case"DTSTART":n=ZA(u,t.tzid);break;case"UNTIL":f=Le.timeToUntilString(u,!t.tzid);break;default:if(An(u)){for(var c=[],p=0;p<u.length;p++)c[p]=String(u[p]);f=c.toString()}else f=String(u)}f&&e.push([a,f])}}var h=e.map(function(_){var v=_[0],b=_[1];return v+"="+b.toString()}).join(";"),m="";return h!==""&&(m="RRULE:"+h),[n,m].filter(function(_){return!!_}).join(`
`)}function ZA(t,e){return t?"DTSTART"+new ts(new Date(t),e).toString():""}function XA(t,e){return Array.isArray(t)?!Array.isArray(e)||t.length!==e.length?!1:t.every(function(n,r){return n.getTime()===e[r].getTime()}):t instanceof Date?e instanceof Date&&t.getTime()===e.getTime():t===e}var U0=function(){function t(){this.all=!1,this.before=[],this.after=[],this.between=[]}return t.prototype._cacheAdd=function(e,n,r){n&&(n=n instanceof Date?Le.clone(n):Le.cloneDates(n)),e==="all"?this.all=n:(r._value=n,this[e].push(r))},t.prototype._cacheGet=function(e,n){var r=!1,i=n?Object.keys(n):[],o=function(p){for(var h=0;h<i.length;h++){var m=i[h];if(!XA(n[m],p[m]))return!0}return!1},a=this[e];if(e==="all")r=this.all;else if(An(a))for(var u=0;u<a.length;u++){var f=a[u];if(!(i.length&&o(f))){r=f._value;break}}if(!r&&this.all){for(var c=new Wi(e,n),u=0;u<this.all.length&&c.accept(this.all[u]);u++);r=c.getValue(),this._cacheAdd(e,r,n)}return An(r)?Le.cloneDates(r):r instanceof Date?Le.clone(r):r},t}();var z0=$o(dt(1,31),dt(2,28),dt(3,31),dt(4,30),dt(5,31),dt(6,30),dt(7,31),dt(8,31),dt(9,30),dt(10,31),dt(11,30),dt(12,31),dt(1,7)),H0=$o(dt(1,31),dt(2,29),dt(3,31),dt(4,30),dt(5,31),dt(6,30),dt(7,31),dt(8,31),dt(9,30),dt(10,31),dt(11,30),dt(12,31),dt(1,7)),JA=Ar(1,29),QA=Ar(1,30),co=Ar(1,31),Ln=Ar(1,32),q0=$o(Ln,QA,Ln,co,Ln,co,Ln,Ln,co,Ln,co,Ln,Ln.slice(0,7)),V0=$o(Ln,JA,Ln,co,Ln,co,Ln,Ln,co,Ln,co,Ln,Ln.slice(0,7)),$A=Ar(-28,0),e3=Ar(-29,0),po=Ar(-30,0),Fn=Ar(-31,0),K0=$o(Fn,e3,Fn,po,Fn,po,Fn,Fn,po,Fn,po,Fn,Fn.slice(0,7)),Z0=$o(Fn,$A,Fn,po,Fn,po,Fn,Fn,po,Fn,po,Fn,Fn.slice(0,7)),X0=[0,31,60,91,121,152,182,213,244,274,305,335,366],J0=[0,31,59,90,120,151,181,212,243,273,304,334,365],Jp=function(){for(var t=[],e=0;e<55;e++)t=t.concat(Ar(7));return t}();function Q0(t,e){var n=new Date(Date.UTC(t,0,1)),r=Le.isLeapYear(t)?366:365,i=Le.isLeapYear(t+1)?366:365,o=Le.toOrdinal(n),a=Le.getWeekday(n),u=qn(qn({yearlen:r,nextyearlen:i,yearordinal:o,yearweekday:a},t3(t)),{wnomask:null});if(fr(e.byweekno))return u;u.wnomask=dt(0,r+7);var f,c,p=f=Rn(7-a+e.wkst,7);p>=4?(p=0,c=u.yearlen+Rn(a-e.wkst,7)):c=r-p;for(var h=Math.floor(c/7),m=Rn(c,7),_=Math.floor(h+m/4),v=0;v<e.byweekno.length;v++){var b=e.byweekno[v];if(b<0&&(b+=_+1),b>0&&b<=_){var E=void 0;b>1?(E=p+(b-1)*7,p!==f&&(E-=7-f)):E=p;for(var y=0;y<7&&(u.wnomask[E]=1,E++,u.wdaymask[E]!==e.wkst);y++);}}if(_t(e.byweekno,1)){var E=p+_*7;if(p!==f&&(E-=7-f),E<r)for(var v=0;v<7&&(u.wnomask[E]=1,E+=1,u.wdaymask[E]!==e.wkst);v++);}if(p){var O=void 0;if(_t(e.byweekno,-1))O=-1;else{var D=Le.getWeekday(new Date(Date.UTC(t-1,0,1))),F=Rn(7-D.valueOf()+e.wkst,7),P=Le.isLeapYear(t-1)?366:365,L=void 0;F>=4?(F=0,L=P+Rn(D-e.wkst,7)):L=r-p,O=Math.floor(52+Rn(L,7)/4)}if(_t(e.byweekno,O))for(var E=0;E<p;E++)u.wnomask[E]=1}return u}function t3(t){var e=Le.isLeapYear(t)?366:365,n=new Date(Date.UTC(t,0,1)),r=Le.getWeekday(n);return e===365?{mmask:z0,mdaymask:V0,nmdaymask:Z0,wdaymask:Jp.slice(r),mrange:J0}:{mmask:H0,mdaymask:q0,nmdaymask:K0,wdaymask:Jp.slice(r),mrange:X0}}function $0(t,e,n,r,i,o){var a={lastyear:t,lastmonth:e,nwdaymask:[]},u=[];if(o.freq===Se.YEARLY)if(fr(o.bymonth))u=[[0,n]];else for(var f=0;f<o.bymonth.length;f++)e=o.bymonth[f],u.push(r.slice(e-1,e+1));else o.freq===Se.MONTHLY&&(u=[r.slice(e-1,e+1)]);if(fr(u))return a;a.nwdaymask=dt(0,n);for(var f=0;f<u.length;f++)for(var c=u[f],p=c[0],h=c[1]-1,m=0;m<o.bynweekday.length;m++){var _=void 0,v=o.bynweekday[m],b=v[0],E=v[1];E<0?(_=h+(E+1)*7,_-=Rn(i[_]-b,7)):(_=p+(E-1)*7,_+=Rn(7-i[_]+b,7)),p<=_&&_<=h&&(a.nwdaymask[_]=1)}return a}function ev(t,e){e===void 0&&(e=0);var n=t%19,r=Math.floor(t/100),i=t%100,o=Math.floor(r/4),a=r%4,u=Math.floor((r+8)/25),f=Math.floor((r-u+1)/3),c=Math.floor(19*n+r-o-f+15)%30,p=Math.floor(i/4),h=i%4,m=Math.floor(32+2*a+2*p-c-h)%7,_=Math.floor((n+11*c+22*m)/451),v=Math.floor((c+m-7*_+114)/31),b=(c+m-7*_+114)%31+1,E=Date.UTC(t,v-1,b+e),y=Date.UTC(t,0,1);return[Math.ceil((E-y)/(1e3*60*60*24))]}var n3=function(){function t(e){this.options=e}return t.prototype.rebuild=function(e,n){var r=this.options;if(e!==this.lastyear&&(this.yearinfo=Q0(e,r)),on(r.bynweekday)&&(n!==this.lastmonth||e!==this.lastyear)){var i=this.yearinfo,o=i.yearlen,a=i.mrange,u=i.wdaymask;this.monthinfo=$0(e,n,o,a,u,r)}Bt(r.byeaster)&&(this.eastermask=ev(e,r.byeaster))},Object.defineProperty(t.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!0,configurable:!0}),t.prototype.ydayset=function(){return[Ar(this.yearlen),0,this.yearlen]},t.prototype.mdayset=function(e,n,r){for(var i=this.mrange[n-1],o=this.mrange[n],a=dt(null,this.yearlen),u=i;u<o;u++)a[u]=u;return[a,i,o]},t.prototype.wdayset=function(e,n,r){for(var i=dt(null,this.yearlen+7),o=Le.toOrdinal(new Date(Date.UTC(e,n-1,r)))-this.yearordinal,a=o,u=0;u<7&&(i[o]=o,++o,this.wdaymask[o]!==this.options.wkst);u++);return[i,a,o]},t.prototype.ddayset=function(e,n,r){var i=dt(null,this.yearlen),o=Le.toOrdinal(new Date(Date.UTC(e,n-1,r)))-this.yearordinal;return i[o]=o,[i,o,o+1]},t.prototype.htimeset=function(e,n,r,i){var o=this,a=[];return this.options.byminute.forEach(function(u){a=a.concat(o.mtimeset(e,u,r,i))}),Le.sort(a),a},t.prototype.mtimeset=function(e,n,r,i){var o=this.options.bysecond.map(function(a){return new ta(e,n,a,i)});return Le.sort(o),o},t.prototype.stimeset=function(e,n,r,i){return[new ta(e,n,r,i)]},t.prototype.getdayset=function(e){switch(e){case at.YEARLY:return this.ydayset.bind(this);case at.MONTHLY:return this.mdayset.bind(this);case at.WEEKLY:return this.wdayset.bind(this);case at.DAILY:return this.ddayset.bind(this);default:return this.ddayset.bind(this)}},t.prototype.gettimeset=function(e){switch(e){case at.HOURLY:return this.htimeset.bind(this);case at.MINUTELY:return this.mtimeset.bind(this);case at.SECONDLY:return this.stimeset.bind(this)}},t}(),tv=n3;function nv(t,e,n,r,i,o){for(var a=[],u=0;u<t.length;u++){var f=void 0,c=void 0,p=t[u];p<0?(f=Math.floor(p/e.length),c=Rn(p,e.length)):(f=Math.floor((p-1)/e.length),c=Rn(p-1,e.length));for(var h=[],m=n;m<r;m++){var _=o[m];!Bt(_)||h.push(_)}var v=void 0;f<0?v=h.slice(f)[0]:v=h[f];var b=e[c],E=Le.fromOrdinal(i.yearordinal+v),y=Le.combine(E,b);_t(a,y)||a.push(y)}return Le.sort(a),a}function mf(t,e){var n=e.dtstart,r=e.freq,i=e.interval,o=e.until,a=e.bysetpos,u=e.count;if(u===0||i===0)return ji(t);var f=F0.fromDate(n),c=new tv(e);c.rebuild(f.year,f.month);for(var p=o3(c,f,e);;){var h=c.getdayset(r)(f.year,f.month,f.day),m=h[0],_=h[1],v=h[2],b=i3(m,_,v,c,e);if(on(a))for(var E=nv(a,p,_,v,c,m),y=0;y<E.length;y++){var O=E[y];if(o&&O>o)return ji(t);if(O>=n){var D=rv(O,e);if(!t.accept(D)||u&&(--u,!u))return ji(t)}}else for(var y=_;y<v;y++){var F=m[y];if(!!Bt(F))for(var P=Le.fromOrdinal(c.yearordinal+F),L=0;L<p.length;L++){var R=p[L],O=Le.combine(P,R);if(o&&O>o)return ji(t);if(O>=n){var D=rv(O,e);if(!t.accept(D)||u&&(--u,!u))return ji(t)}}}if(e.interval===0||(f.add(e,b),f.year>Le.MAXYEAR))return ji(t);_l(r)||(p=c.gettimeset(r)(f.hour,f.minute,f.second,0)),c.rebuild(f.year,f.month)}}function r3(t,e,n){var r=n.bymonth,i=n.byweekno,o=n.byweekday,a=n.byeaster,u=n.bymonthday,f=n.bynmonthday,c=n.byyearday;return on(r)&&!_t(r,t.mmask[e])||on(i)&&!t.wnomask[e]||on(o)&&!_t(o,t.wdaymask[e])||on(t.nwdaymask)&&!t.nwdaymask[e]||a!==null&&!_t(t.eastermask,e)||(on(u)||on(f))&&!_t(u,t.mdaymask[e])&&!_t(f,t.nmdaymask[e])||on(c)&&(e<t.yearlen&&!_t(c,e+1)&&!_t(c,-t.yearlen+e)||e>=t.yearlen&&!_t(c,e+1-t.yearlen)&&!_t(c,-t.nextyearlen+e-t.yearlen))}function rv(t,e){return new ts(t,e.tzid).rezonedDate()}function ji(t){return t.getValue()}function i3(t,e,n,r,i){for(var o=!1,a=e;a<n;a++){var u=t[a];o=r3(r,u,i),o&&(t[u]=null)}return o}function o3(t,e,n){var r=n.freq,i=n.byhour,o=n.byminute,a=n.bysecond;return _l(r)?W0(n):r>=Se.HOURLY&&on(i)&&!_t(i,e.hour)||r>=Se.MINUTELY&&on(o)&&!_t(o,e.minute)||r>=Se.SECONDLY&&on(a)&&!_t(a,e.second)?[]:t.gettimeset(r)(e.hour,e.minute,e.second,e.millisecond)}var Pr={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)},vl={freq:at.YEARLY,dtstart:null,interval:1,wkst:Pr.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},j0=Object.keys(vl),Se=function(){function t(e,n){e===void 0&&(e={}),n===void 0&&(n=!1),this._cache=n?null:new U0,this.origOptions=Xp(e);var r=Y0(e).parsedOptions;this.options=r}return t.parseText=function(e,n){return gl(e,n)},t.fromText=function(e,n){return I0(e,n)},t.fromString=function(e){return new t(t.parseString(e)||void 0)},t.prototype._iter=function(e){return mf(e,this.options)},t.prototype._cacheGet=function(e,n){return this._cache?this._cache._cacheGet(e,n):!1},t.prototype._cacheAdd=function(e,n,r){if(!!this._cache)return this._cache._cacheAdd(e,n,r)},t.prototype.all=function(e){if(e)return this._iter(new Zp("all",{},e));var n=this._cacheGet("all");return n===!1&&(n=this._iter(new Wi("all",{})),this._cacheAdd("all",n)),n},t.prototype.between=function(e,n,r,i){if(r===void 0&&(r=!1),!Le.isValidDate(e)||!Le.isValidDate(n))throw new Error("Invalid date passed in to RRule.between");var o={before:n,after:e,inc:r};if(i)return this._iter(new Zp("between",o,i));var a=this._cacheGet("between",o);return a===!1&&(a=this._iter(new Wi("between",o)),this._cacheAdd("between",a,o)),a},t.prototype.before=function(e,n){if(n===void 0&&(n=!1),!Le.isValidDate(e))throw new Error("Invalid date passed in to RRule.before");var r={dt:e,inc:n},i=this._cacheGet("before",r);return i===!1&&(i=this._iter(new Wi("before",r)),this._cacheAdd("before",i,r)),i},t.prototype.after=function(e,n){if(n===void 0&&(n=!1),!Le.isValidDate(e))throw new Error("Invalid date passed in to RRule.after");var r={dt:e,inc:n},i=this._cacheGet("after",r);return i===!1&&(i=this._iter(new Wi("after",r)),this._cacheAdd("after",i,r)),i},t.prototype.count=function(){return this.all().length},t.prototype.toString=function(){return bl(this.origOptions)},t.prototype.toText=function(e,n,r){return R0(this,e,n,r)},t.prototype.isFullyConvertibleToText=function(){return L0(this)},t.prototype.clone=function(){return new t(this.origOptions)},t.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],t.YEARLY=at.YEARLY,t.MONTHLY=at.MONTHLY,t.WEEKLY=at.WEEKLY,t.DAILY=at.DAILY,t.HOURLY=at.HOURLY,t.MINUTELY=at.MINUTELY,t.SECONDLY=at.SECONDLY,t.MO=Pr.MO,t.TU=Pr.TU,t.WE=Pr.WE,t.TH=Pr.TH,t.FR=Pr.FR,t.SA=Pr.SA,t.SU=Pr.SU,t.parseString=yl,t.optionsToString=bl,t}();function iv(t,e,n,r,i,o){var a={},u=t.accept;function f(m,_){n.forEach(function(v){v.between(m,_,!0).forEach(function(b){a[Number(b)]=!0})})}i.forEach(function(m){var _=new ts(m,o).rezonedDate();a[Number(_)]=!0}),t.accept=function(m){var _=Number(m);return isNaN(_)?u.call(this,m):!a[_]&&(f(new Date(_-1),new Date(_+1)),!a[_])?(a[_]=!0,u.call(this,m)):!0},t.method==="between"&&(f(t.args.after,t.args.before),t.accept=function(m){var _=Number(m);return a[_]?!0:(a[_]=!0,u.call(this,m))});for(var c=0;c<r.length;c++){var p=new ts(r[c],o).rezonedDate();if(!t.accept(new Date(p.getTime())))break}e.forEach(function(m){mf(t,m.options)});var h=t._result;switch(Le.sort(h),t.method){case"all":case"between":return h;case"before":return h.length&&h[h.length-1]||null;case"after":default:return h.length&&h[0]||null}}var ov={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function s3(t,e){var n=[],r=[],i=[],o=[],a=wl(t),u=a.dtstart,f=a.tzid,c=c3(t,e.unfold);return c.forEach(function(p){if(!!p){var h=f3(p),m=h.name,_=h.parms,v=h.value;switch(m.toUpperCase()){case"RRULE":if(_.length)throw new Error("unsupported RRULE parm: "+_.join(","));n.push(yl(p));break;case"RDATE":var b=/RDATE(?:;TZID=([^:=]+))?/i.exec(p),E=b[0],y=b[1];y&&!f&&(f=y),r=r.concat(sv(v,_));break;case"EXRULE":if(_.length)throw new Error("unsupported EXRULE parm: "+_.join(","));i.push(yl(v));break;case"EXDATE":o=o.concat(sv(v,_));break;case"DTSTART":break;default:throw new Error("unsupported property: "+m)}}}),{dtstart:u,tzid:f,rrulevals:n,rdatevals:r,exrulevals:i,exdatevals:o}}function a3(t,e){var n=s3(t,e),r=n.rrulevals,i=n.rdatevals,o=n.exrulevals,a=n.exdatevals,u=n.dtstart,f=n.tzid,c=e.cache===!1;if(e.compatible&&(e.forceset=!0,e.unfold=!0),e.forceset||r.length>1||i.length||o.length||a.length){var p=new ns(c);return p.dtstart(u),p.tzid(f||void 0),r.forEach(function(m){p.rrule(new Se(Qp(m,u,f),c))}),i.forEach(function(m){p.rdate(m)}),o.forEach(function(m){p.exrule(new Se(Qp(m,u,f),c))}),a.forEach(function(m){p.exdate(m)}),e.compatible&&e.dtstart&&p.rdate(u),p}var h=r[0]||{};return new Se(Qp(h,h.dtstart||e.dtstart||u,h.tzid||e.tzid||f),c)}function na(t,e){return e===void 0&&(e={}),a3(t,l3(e))}function Qp(t,e,n){return qn(qn({},t),{dtstart:e,tzid:n})}function l3(t){var e=[],n=Object.keys(t),r=Object.keys(ov);if(n.forEach(function(i){_t(r,i)||e.push(i)}),e.length)throw new Error("Invalid options: "+e.join(", "));return qn(qn({},ov),t)}function u3(t){if(t.indexOf(":")===-1)return{name:"RRULE",value:t};var e=f0(t,":",1),n=e[0],r=e[1];return{name:n,value:r}}function f3(t){var e=u3(t),n=e.name,r=e.value,i=n.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:r}}function c3(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 n=t.split(`
`),r=0;r<n.length;){var i=n[r]=n[r].replace(/\s+$/g,"");i?r>0&&i[0]===" "?(n[r-1]+=i.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}function d3(t){t.forEach(function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)})}function sv(t,e){return d3(e),t.split(",").map(function(n){return Le.untilStringToDate(n)})}function av(t){var e=this;return function(n){if(n!==void 0&&(e["_"+t]=n),e["_"+t]!==void 0)return e["_"+t];for(var r=0;r<e._rrule.length;r++){var i=e._rrule[r].origOptions[t];if(i)return i}}}var ns=function(t){$s(e,t);function e(n){n===void 0&&(n=!1);var r=t.call(this,{},n)||this;return r.dtstart=av.apply(r,["dtstart"]),r.tzid=av.apply(r,["tzid"]),r._rrule=[],r._rdate=[],r._exrule=[],r._exdate=[],r}return e.prototype._iter=function(n){return iv(n,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},e.prototype.rrule=function(n){lv(n,this._rrule)},e.prototype.exrule=function(n){lv(n,this._exrule)},e.prototype.rdate=function(n){uv(n,this._rdate)},e.prototype.exdate=function(n){uv(n,this._exdate)},e.prototype.rrules=function(){return this._rrule.map(function(n){return na(n.toString())})},e.prototype.exrules=function(){return this._exrule.map(function(n){return na(n.toString())})},e.prototype.rdates=function(){return this._rdate.map(function(n){return new Date(n.getTime())})},e.prototype.exdates=function(){return this._exdate.map(function(n){return new Date(n.getTime())})},e.prototype.valueOf=function(){var n=[];return!this._rrule.length&&this._dtstart&&(n=n.concat(bl({dtstart:this._dtstart}))),this._rrule.forEach(function(r){n=n.concat(r.toString().split(`
`))}),this._exrule.forEach(function(r){n=n.concat(r.toString().split(`
`).map(function(i){return i.replace(/^RRULE:/,"EXRULE:")}).filter(function(i){return!/^DTSTART/.test(i)}))}),this._rdate.length&&n.push(fv("RDATE",this._rdate,this.tzid())),this._exdate.length&&n.push(fv("EXDATE",this._exdate,this.tzid())),n},e.prototype.toString=function(){return this.valueOf().join(`
`)},e.prototype.clone=function(){var n=new e(!!this._cache);return this._rrule.forEach(function(r){return n.rrule(r.clone())}),this._exrule.forEach(function(r){return n.exrule(r.clone())}),this._rdate.forEach(function(r){return n.rdate(new Date(r.getTime()))}),this._exdate.forEach(function(r){return n.exdate(new Date(r.getTime()))}),n},e}(Se);function lv(t,e){if(!(t instanceof Se))throw new TypeError(String(t)+" is not RRule instance");_t(e.map(String),String(t))||e.push(t)}function uv(t,e){if(!(t instanceof Date))throw new TypeError(String(t)+" is not Date instance");_t(e.map(Number),Number(t))||(e.push(t),Le.sort(e))}function fv(t,e,n){var r=!n||n.toUpperCase()==="UTC",i=r?t+":":t+";TZID="+n+":",o=e.map(function(a){return Le.timeToUntilString(a.valueOf(),r)}).join(",");return""+i+o}var cv=Se;var _v=Oe(Ri());var sa=Oe(require("obsidian"));var rs=Oe(require("obsidian"));var gf=Oe(Ri());function kl(t){return t.getHours()/24+t.getMinutes()/(60*24)}function dv(t,e){if(t.start.date||(t==null?void 0:t.eventType)=="multiDay")return 0;let n=kl(new Date(t.start.dateTime));return e*n}function pv(t,e){if(t.start.date||(t==null?void 0:t.eventType)=="multiDay")return 25;let n=kl(new Date(t.start.dateTime)),r=kl(new Date(t.end.dateTime));return e*(r-n)}function ra(t,e){return t/24*e}function ia(t,e){return t-t/24*e}var hv=()=>app.vault.config.theme?app.vault.config.theme=="obsidian"?"dark":"light":"dark",$p=t=>t?t.trim().replace("<","lt").replace(">","gt").replace('"',"''").replace("\\","-").replace("/","-").replace(":","-").replace("|","-").replace("*","").replace("?",""):"",mv=(t,e)=>t.reduce(([n,r,i],o)=>{let a=app.metadataCache.getFileCache(o).frontmatter;return(a==null?void 0:a["event-id"])===e?[[...n,o],r,i]:(a==null?void 0:a["event-id"])?[n,r,[...i,o]]:[n,[...r,o],i]},[[],[],[]]),p3=t=>{let e=app.vault.getFiles().filter(i=>i.basename==$p(t.summary)),[n,r]=mv(e,t.id);return{event:t,file:n[0]||r[0]||null,match:n.length>0?"id":"title"}};var h3=(t,e)=>{let n=app.vault.getFiles().filter(o=>o.basename.startsWith(e.settings.optionalNotePrefix)),[r,i]=mv(n,t.id);return{event:t,file:r[0]||i[0]||null,match:r.length>0?"id":"title"}},oa=(t,e)=>{let n=p3(t);return n.match=="id"&&n.file?n:h3(t,e)};var eh=t=>te(void 0,null,function*(){var a,u;if(!t.settings.autoCreateEventNotes||!Ft())return;let e=Math.abs(t.settings.importStartOffset),n=Math.abs(t.settings.importEndOffset),r=window.moment().local().subtract(e,"day"),i=window.moment().local().add(n,"day"),o=yield Yt({startDate:r,endDate:i});for(let f=0;f<o.length;f++)if(t.settings.autoCreateEventNotesMarker==="")yield cr(o[f],t.settings.defaultFolder,t.settings.defaultTemplate,!0);else{let c=new RegExp(`:([^:]*-)?${t.settings.autoCreateEventNotesMarker}-?([^:]*)?:`),p=(u=(a=o[f].description)==null?void 0:a.match(c))!=null?u:[];p.length==3&&(yield cr(o[f],p[1],p[2],!0))}}),gv=(t,e,n)=>{var a,u,f,c;let r=(u=(a=n==null?void 0:n.start)==null?void 0:a.offset)!=null?u:0,i=(c=(f=n==null?void 0:n.end)==null?void 0:f.offset)!=null?c:0,o=e.substring(r,i);return o.contains("event-id:")||(o.contains("---")?o=o.replace("---",`---
event-id: ${t.id}`):o=`---
event-id: ${t.id}
---
`,e=e.substring(0,r)+o+e.substring(i)),e},m3=(t,e)=>{let n=/{{gEvent\.([^}>]*)}}/gm,r,i=[];do r=n.exec(e),i.push(r);while(r);return i.forEach(o=>{if(o){let a="";if(o[1]=="attendees"){let u=gf.default.get(t,o[1],"");for(let f=0;f<u.length;f++)u[f].displayName?a+=`- [[@${u[f].displayName}]]
`:a+=`- [[@${u[f].email}]]
`}else if(o[1]=="attachments"){let u=gf.default.get(t,o[1],"");for(let f=0;f<u.length;f++)u[f].title?a+=`- [${u[f].title}](${u[f].fileUrl})
`:a+=`- [${u[f].fileUrl}](${u[f].fileUrl})
`}else a=gf.default.get(t,o[1],"");a===Object(a)&&(a=JSON.stringify(a)),e=e.replace(o[0],a!=null?a:"")}}),e};function th(t,e,n){var r,i,o,a,u;return n=n.replace("{{prefix}}",t.settings.optionalNotePrefix),n=n.replace("{{date}}",window.moment().format("YYYY-MM-DD")),n=n.replace("{{date-year}}",window.moment().format("YYYY")),n=n.replace("{{date-month}}",window.moment().format("MM")),n=n.replace("{{date-day}}",window.moment().format("DD")),n=n.replace("{date-hour}}",window.moment().format("hh")),n=n.replace("{date-hour24}}",window.moment().format("HH")),n=n.replace("{date-minute}}",window.moment().format("mm")),n=n.replace("{{event-date}}",window.moment((r=e.start.date)!=null?r:e.start.dateTime).format("YYYY-MM-DD")),n=n.replace("{{event-year}}",window.moment((i=e.start.date)!=null?i:e.start.dateTime).format("YYYY")),n=n.replace("{{event-month}}",window.moment((o=e.start.date)!=null?o:e.start.dateTime).format("MM")),n=n.replace("{{event-day}}",window.moment((a=e.start.date)!=null?a:e.start.dateTime).format("DD")),n=n.replace("{{event-title}}",(u=e.summary)!=null?u:"event-title"),n=n.replace("{{event-start-hour}}",e.start.dateTime?window.moment(e.start.dateTime).format("hh"):"00"),n=n.replace("{{event-start-hour24}}",e.start.dateTime?window.moment(e.start.dateTime).format("HH"):"00"),n=n.replace("{{event-start-minute}}",e.start.dateTime?window.moment(e.start.dateTime).format("mm"):"00"),n=n.replace("{{event-end-hour}}",e.end.dateTime?window.moment(e.end.dateTime).format("hh"):"00"),n=n.replace("{{event-end-hour24}}",e.end.dateTime?window.moment(e.end.dateTime).format("HH"):"00"),n=n.replace("{{event-end-minute}}",e.end.dateTime?window.moment(e.end.dateTime).format("mm"):"00"),n}function g3(t,e,n){return te(this,null,function*(){let{adapter:r}=app.vault;n?(n.endsWith("-")&&(n=n.slice(0,-1)),n="/"+n.split(/[/\\]/).join("/"),(yield r.exists(n))||(yield r.mkdir(n))):n=app.fileManager.getNewFileParent("").path;let i=th(t,e,t.settings.eventNoteNameFormat),o=th(t,e,$p(i));return(0,rs.normalizePath)(`${n}/${o}.md`)})}function _3(t,e,n){return te(this,null,function*(){let{vault:r}=app,{adapter:i}=r;if(yield i.exists(e)){let o=r.getAbstractFileByPath(e);return n||(Ke(`EventNote ${t.summary} already exists.`),new fi(t,a=>o=a).open()),o}})}var cr=(t,e,n,r=!1)=>te(void 0,null,function*(){let i=ye.getInstance(),{vault:o}=app,{adapter:a}=o;e&&(e=th(i,t,e));let u=yield g3(i,t,e),f=yield _3(t,u,r);if(f)return f;let c;try{c=yield o.create(u,""),Ke(`EventNote ${t.summary} created.`)}catch(m){return null}if(!i.coreTemplatePlugin&&!i.templaterPlugin||!n){let m=gv(t,"",null);yield a.write(u,m);let _=o.getAbstractFileByPath(u);return(i.settings.autoCreateEventKeepOpen||!r)&&(yield app.workspace.getLeaf(!0).openFile(_)),_}n.match(/.*\.md/)||(n=n+".md");let p=yield app.workspace.getLeaf(!0);return yield p.setViewState({type:"MarkdownView"}),yield app.workspace.setActiveLeaf(p,!1,!0),yield p.openFile(c,{state:{mode:"source"},active:!0}),i.templaterPlugin&&i.coreTemplatePlugin?(yield h(!0))||(yield h(!1))||Ke("Template not compatible"):i.templaterPlugin?(yield h(!0))||Ke("Template not compatible"):i.coreTemplatePlugin&&((yield h(!1))||Ke("Template not compatible")),!i.settings.autoCreateEventKeepOpen&&r&&p.detach(),o.getAbstractFileByPath(u);function h(m){return te(this,null,function*(){var F,P,L,R,M,H;let _;m?_=(0,rs.normalizePath)((P=(F=i==null?void 0:i.templaterPlugin)==null?void 0:F.settings)==null?void 0:P.templates_folder):_=(0,rs.normalizePath)((M=(R=(L=i==null?void 0:i.coreTemplatePlugin)==null?void 0:L.instance)==null?void 0:R.options)==null?void 0:M.folder);let v;if((yield a.exists(n))?v=n:(v=`${_}/${n}`,_==="/"&&(v=n)),!(yield a.exists(v)))return Ke(`Template: ${n} doesn't exit.`),!1;let b=o.getAbstractFileByPath(v);if(!(b instanceof rs.TFile))return!1;let E=yield o.cachedRead(b),y=gv(t,E,(H=app.metadataCache.getFileCache(b).frontmatter)==null?void 0:H.position);if(y=m3(t,y),m&&y.contains("{{")&&y.contains("}}"))return!1;if(!m&&y.contains("<%")&&y.contains("%>"))return!1;let O=b.path+".tmp";yield a.write(O,y);let D=app.vault.getAbstractFileByPath(O);if(!(D instanceof rs.TFile))return!1;try{return m?yield i.templaterPlugin.templater.append_template_to_active_file(D):yield i.coreTemplatePlugin.instance.insertTemplate(D),a.remove(O),!0}catch(le){return a.remove(O),!1}})}});var fi=class extends sa.Modal{constructor(e,n){super(window.app);this.template=null;this.folder=null;this.plugin=ye.getInstance();this.event=e,this.onSubmit=n}onOpen(){let{contentEl:e}=this;e.createEl("h1",{text:"You can now select a template to use"}),new sa.Setting(e).setName("Template").addSearch(n=>{new Qa(n.inputEl,this.plugin),n.setPlaceholder("Template").setValue("").onChange(r=>this.template=r),n.containerEl.addClass("templater_search")}),new sa.Setting(e).setName("Folder").addSearch(n=>{new $a(n.inputEl),n.setPlaceholder("Example: folder1/folder2").setValue(app.vault.config.newFileFolderPath).onChange(r=>this.folder=r),n.containerEl.addClass("templater_search")}),new sa.Setting(e).setName("").addButton(n=>{n.setButtonText("Create Note"),n.onClick(()=>te(this,null,function*(){let r=yield cr(this.event,this.folder,this.template);this.onSubmit(r),this.close()}))})}onClose(){let{contentEl:e}=this;e.empty()}};function v3(t){Et(t,"svelte-47446l",".buttonRow.svelte-47446l.svelte-47446l{display:flex;flex-direction:row;align-items:center;justify-content:space-around;padding:5px}.summaryInput.svelte-47446l.svelte-47446l{border:none;border-bottom:2px solid;border-radius:0px;height:40px;font-size:35px;text-align:center}label.svelte-47446l.svelte-47446l{margin-top:5px}.googleFullDayContainer.svelte-47446l.svelte-47446l{margin-top:10px;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.googleEventButtonContainer.svelte-47446l.svelte-47446l{margin-top:10px;display:flex;flex-direction:column;justify-content:space-around}.googleEventButtonContainer.svelte-47446l button.svelte-47446l{width:40%}")}function vv(t,e,n){let r=t.slice();return r[31]=e[n],r}function y3(t){let e,n,r,i,o,a,u=t[3],f=[];for(let c=0;c<u.length;c+=1)f[c]=yv(vv(t,u,c));return{c(){var c;e=N("label"),e.textContent="Calendar",n=$(),r=N("select");for(let p=0;p<f.length;p+=1)f[p].c();k(e,"for","calendar"),k(e,"class","svelte-47446l"),k(r,"name","calendar"),k(r,"class","dropdown"),r.disabled=i=((c=t[0])==null?void 0:c.id)!==void 0},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p);for(let h=0;h<f.length;h+=1)f[h]&&f[h].m(r,null);o||(a=oe(r,"change",t[12]),o=!0)},p(c,p){var h;if(p[0]&9){u=c[3];let m;for(m=0;m<u.length;m+=1){let _=vv(c,u,m);f[m]?f[m].p(_,p):(f[m]=yv(_),f[m].c(),f[m].m(r,null))}for(;m<f.length;m+=1)f[m].d(1);f.length=u.length}p[0]&1&&i!==(i=((h=c[0])==null?void 0:h.id)!==void 0)&&(r.disabled=i)},d(c){c&&B(e),c&&B(n),c&&B(r),At(f,c),o=!1,a()}}}function w3(t){let e;return{c(){e=N("span"),e.textContent="Loading"},m(n,r){G(n,e,r)},p:me,d(n){n&&B(e)}}}function yv(t){let e,n=t[31].summary+"",r,i,o,a;return{c(){var u,f;e=N("option"),r=Me(n),k(e,"id",i=t[31].id),e.__value=o=t[31].id,e.value=e.__value,e.selected=a=t[31].id==((f=(u=t[0])==null?void 0:u.parent)==null?void 0:f.id)},m(u,f){G(u,e,f),A(e,r)},p(u,f){var c,p;f[0]&8&&n!==(n=u[31].summary+"")&&Ye(r,n),f[0]&8&&i!==(i=u[31].id)&&k(e,"id",i),f[0]&8&&o!==(o=u[31].id)&&(e.__value=o,e.value=e.__value),f[0]&9&&a!==(a=u[31].id==((p=(c=u[0])==null?void 0:c.parent)==null?void 0:p.id))&&(e.selected=a)},d(u){u&&B(e)}}}function b3(t){let e,n,r,i,o,a,u,f,c,p;return{c(){e=N("label"),e.textContent="Start Date",n=$(),r=N("input"),i=$(),o=N("label"),o.textContent="End Date",a=$(),u=N("input"),k(e,"for","eventStartDate"),k(e,"class","svelte-47446l"),k(r,"type","datetime-local"),k(r,"name","eventStartDate"),k(o,"for","eventEndDate"),k(o,"class","svelte-47446l"),k(u,"type","datetime-local"),k(u,"name","eventEndDate"),k(u,"min",f=window.moment(t[1]).format("YYYY-MM-DDThh:mm"))},m(h,m){G(h,e,m),G(h,n,m),G(h,r,m),er(r,t[1]),G(h,i,m),G(h,o,m),G(h,a,m),G(h,u,m),er(u,t[2]),c||(p=[oe(r,"input",t[25]),oe(u,"input",t[26])],c=!0)},p(h,m){m[0]&2&&er(r,h[1]),m[0]&2&&f!==(f=window.moment(h[1]).format("YYYY-MM-DDThh:mm"))&&k(u,"min",f),m[0]&4&&er(u,h[2])},d(h){h&&B(e),h&&B(n),h&&B(r),h&&B(i),h&&B(o),h&&B(a),h&&B(u),c=!1,We(p)}}}function k3(t){let e,n,r,i,o;return{c(){e=N("label"),e.textContent="Date",n=$(),r=N("input"),k(e,"for","eventDate"),k(e,"class","svelte-47446l"),k(r,"type","date"),k(r,"name","eventDate")},m(a,u){G(a,e,u),G(a,n,u),G(a,r,u),er(r,t[7]),i||(o=oe(r,"input",t[24]),i=!0)},p(a,u){u[0]&128&&er(r,a[7])},d(a){a&&B(e),a&&B(n),a&&B(r),i=!1,o()}}}function E3(t){let e,n,r,i;return{c(){e=N("div"),n=N("button"),n.textContent="Create",k(n,"class","svelte-47446l"),k(e,"class","buttonRow svelte-47446l")},m(o,a){G(o,e,a),A(e,n),r||(i=oe(n,"click",t[13]),r=!0)},p:me,d(o){o&&B(e),r=!1,i()}}}function T3(t){let e,n,r,i,o,a,u,f,c,p,h;function m(D,F){return D[8]!=""?C3:S3}let _=m(t,[-1,-1]),v=_(t);function b(D,F){return D[9].file?O3:D3}let E=b(t,[-1,-1]),y=E(t),O=t[8]!=""&&bv(t);return{c(){e=N("div"),v.c(),n=$(),y.c(),r=$(),i=N("div"),o=N("button"),o.textContent="Update",a=$(),u=N("button"),u.textContent="Delete",f=$(),O&&O.c(),c=zt(),k(e,"class","buttonRow svelte-47446l"),k(o,"class","svelte-47446l"),k(u,"class","svelte-47446l"),k(i,"class","buttonRow svelte-47446l")},m(D,F){G(D,e,F),v.m(e,null),A(e,n),y.m(e,null),G(D,r,F),G(D,i,F),A(i,o),A(i,a),A(i,u),G(D,f,F),O&&O.m(D,F),G(D,c,F),p||(h=[oe(o,"click",t[16]),oe(u,"click",t[14])],p=!0)},p(D,F){_===(_=m(D,F))&&v?v.p(D,F):(v.d(1),v=_(D),v&&(v.c(),v.m(e,n))),E===(E=b(D,F))&&y?y.p(D,F):(y.d(1),y=E(D),y&&(y.c(),y.m(e,null))),D[8]!=""?O?O.p(D,F):(O=bv(D),O.c(),O.m(c.parentNode,c)):O&&(O.d(1),O=null)},d(D){D&&B(e),v.d(),y.d(),D&&B(r),D&&B(i),D&&B(f),O&&O.d(D),D&&B(c),p=!1,We(h)}}}function S3(t){let e,n,r;return{c(){e=N("button"),e.textContent="Show Single Event",k(e,"class","svelte-47446l")},m(i,o){G(i,e,o),n||(r=oe(e,"click",t[20]),n=!0)},p:me,d(i){i&&B(e),n=!1,r()}}}function C3(t){let e,n,r;return{c(){e=N("button"),e.textContent="Show Recurring Event",k(e,"class","svelte-47446l")},m(i,o){G(i,e,o),n||(r=oe(e,"click",t[20]),n=!0)},p:me,d(i){i&&B(e),n=!1,r()}}}function D3(t){let e,n,r;return{c(){e=N("button"),e.textContent="Create Event Note",k(e,"class","svelte-47446l")},m(i,o){G(i,e,o),n||(r=oe(e,"click",t[19]),n=!0)},p:me,d(i){i&&B(e),n=!1,r()}}}function O3(t){let e,n,r,i,o=t[9].match=="title"&&wv(t);return{c(){o&&o.c(),e=$(),n=N("button"),n.textContent="Open Event Note",k(n,"class","svelte-47446l")},m(a,u){o&&o.m(a,u),G(a,e,u),G(a,n,u),r||(i=oe(n,"click",t[18]),r=!0)},p(a,u){a[9].match=="title"?o?o.p(a,u):(o=wv(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(a){o&&o.d(a),a&&B(e),a&&B(n),r=!1,i()}}}function wv(t){let e,n,r;return{c(){e=N("button"),e.textContent="Create Event Note for this date",k(e,"class","svelte-47446l")},m(i,o){G(i,e,o),n||(r=oe(e,"click",t[19]),n=!0)},p:me,d(i){i&&B(e),n=!1,r()}}}function bv(t){let e,n,r,i,o,a;return{c(){e=N("div"),n=N("button"),n.textContent="Update All",r=$(),i=N("button"),i.textContent="Delete All",k(n,"class","svelte-47446l"),k(i,"class","svelte-47446l"),k(e,"class","buttonRow svelte-47446l")},m(u,f){G(u,e,f),A(e,n),A(e,r),A(e,i),o||(a=[oe(n,"click",t[17]),oe(i,"click",t[15])],o=!0)},p:me,d(u){u&&B(e),o=!1,We(a)}}}function M3(t){let e,n,r,i,o,a,u,f,c,p,h,m,_,v,b,E,y,O,D,F,P,L,R,M,H,le,V,X;function K(z,ee){return z[4]?w3:y3}let ce=K(t,[-1,-1]),S=ce(t);function Q(z,ee){return z[5]?k3:b3}let j=Q(t,[-1,-1]),U=j(t);function J(z,ee){return z[0].id?T3:E3}let re=J(t,[-1,-1]),Y=re(t);return{c(){e=N("div"),n=N("input"),r=$(),i=N("label"),i.textContent="Description",o=$(),a=N("textarea"),f=$(),S.c(),c=$(),p=N("div"),h=N("label"),h.textContent="Full Day",m=$(),_=N("input"),v=$(),U.c(),b=$(),E=N("label"),E.textContent="Reoccurring",y=$(),O=N("input"),F=$(),P=N("div"),L=N("label"),L.textContent="Show me as Busy?",R=$(),M=N("input"),H=$(),le=N("div"),Y.c(),k(n,"class","summaryInput svelte-47446l"),k(n,"name","summary"),k(n,"type","text"),k(n,"placeholder","Summary"),k(i,"for","description"),k(i,"class","svelte-47446l"),k(a,"name","description"),a.value=u=t[10](),k(h,"for","fullDay"),k(h,"class","svelte-47446l"),k(_,"type","checkbox"),k(_,"name","fullDay"),k(p,"class","googleFullDayContainer svelte-47446l"),k(E,"for","reoccurring"),k(E,"class","svelte-47446l"),k(O,"type","text"),k(O,"name","Reoccurring"),O.disabled=D=t[0].id!=null,k(L,"for","isBusy"),k(L,"class","svelte-47446l"),k(M,"type","checkbox"),k(M,"name","isBusy"),k(P,"class","googleFullDayContainer svelte-47446l"),k(le,"class","googleEventButtonContainer svelte-47446l"),k(e,"class","googleEventDetails")},m(z,ee){G(z,e,ee),A(e,n),er(n,t[0].summary),A(e,r),A(e,i),A(e,o),A(e,a),A(e,f),S.m(e,null),A(e,c),A(e,p),A(p,h),A(p,m),A(p,_),_.checked=t[5],A(e,v),U.m(e,null),A(e,b),A(e,E),A(e,y),A(e,O),er(O,t[8]),A(e,F),A(e,P),A(P,L),A(P,R),A(P,M),M.checked=t[6],A(e,H),A(e,le),Y.m(le,null),V||(X=[oe(n,"input",t[22]),oe(a,"change",t[11]),oe(_,"change",t[23]),oe(O,"input",t[27]),oe(M,"change",t[28])],V=!0)},p(z,ee){ee[0]&1&&n.value!==z[0].summary&&er(n,z[0].summary),ce===(ce=K(z,ee))&&S?S.p(z,ee):(S.d(1),S=ce(z),S&&(S.c(),S.m(e,c))),ee[0]&32&&(_.checked=z[5]),j===(j=Q(z,ee))&&U?U.p(z,ee):(U.d(1),U=j(z),U&&(U.c(),U.m(e,b))),ee[0]&1&&D!==(D=z[0].id!=null)&&(O.disabled=D),ee[0]&256&&O.value!==z[8]&&er(O,z[8]),ee[0]&64&&(M.checked=z[6]),re===(re=J(z,ee))&&Y?Y.p(z,ee):(Y.d(1),Y=re(z),Y&&(Y.c(),Y.m(le,null)))},i:me,o:me,d(z){z&&B(e),S.d(),U.d(),Y.d(),V=!1,We(X)}}}function kv(){let t=15,e=1e3*60*t;return window.moment(new Date(Math.round(new Date().getTime()/e)*e))}function A3(t,e,n){let{event:r}=e,{closeFunction:i}=e,o,a=!0,u,f,c=ye.getInstance(),p,h,m,_="",v=oa(r,c);function b(U){let J=_v.default.cloneDeep(U);return u?(J.start.date=window.moment(m).format("YYYY-MM-DD"),J.end.date=window.moment(m).format("YYYY-MM-DD"),delete J.start.dateTime,delete J.end.dateTime):(J.start.dateTime=window.moment(p).format(),J.end.dateTime=window.moment(h).format(),delete J.start.date,delete J.end.date),f?J.transparency="opaque":J.transparency="transparent",J}Yi(()=>Tt(void 0,void 0,void 0,function*(){var U,J,re,Y,z;if(n(5,u=((U=r==null?void 0:r.start)===null||U===void 0?void 0:U.dateTime)==null&&((J=r==null?void 0:r.start)===null||J===void 0?void 0:J.date)!==void 0),(r==null?void 0:r.transparency)?n(6,f=(r==null?void 0:r.transparency)=="opaque"):n(6,f=!0),n(3,o=yield Sr()),n(4,a=!1),r.id==null){n(0,r.summary=(re=r.summary)!==null&&re!==void 0?re:"",r),n(0,r.description=(Y=r.description)!==null&&Y!==void 0?Y:"",r),n(0,r.parent=o.find(_e=>_e.id===c.settings.defaultCalendar),r),r.parent||n(0,r.parent=o[o.length-1],r),n(8,_="");let ee=kv();n(1,p=ee.format("YYYY-MM-DDTHH:mm")),n(2,h=ee.add(1,"hour").format("YYYY-MM-DDTHH:mm")),n(7,m=ee.format("YYYY-MM-DD")),r.start.date&&n(7,m=window.moment(r.start.date).format("YYYY-MM-DD")),r.start.dateTime&&r.end.dateTime&&(n(1,p=window.moment(r.start.dateTime).format("YYYY-MM-DDTHH:mm")),n(2,h=window.moment(r.end.dateTime).format("YYYY-MM-DDTHH:mm")))}else{let ee=yield uo((z=r.recurringEventId)!==null&&z!==void 0?z:r.id,r.parent.id);if(ee==null?void 0:ee.recurrence){let _e=na(ee.recurrence[0]);n(8,_=_e.toText())}else n(8,_="");if(u){let _e=kv();n(1,p=_e.format("YYYY-MM-DDTHH:mm")),n(2,h=_e.add(1,"hour").format("YYYY-MM-DDTHH:mm")),n(7,m=window.moment(r.start.date).format("YYYY-MM-DD"))}else n(1,p=window.moment(r.start.dateTime).format("YYYY-MM-DDTHH:mm")),n(2,h=window.moment(r.end.dateTime).format("YYYY-MM-DDTHH:mm")),n(7,m=window.moment().format("YYYY-MM-DD"))}}));let E=()=>r.description?r.description.replace(/<\/?[^>]+(>|$)/g,""):"",y=U=>{U.target instanceof HTMLTextAreaElement&&n(0,r.description=U.target.value,r)},O=U=>{let J=U.target;if(J instanceof HTMLSelectElement){let re=J.value;n(0,r.parent.id=re,r)}},D=()=>Tt(void 0,void 0,void 0,function*(){if(_&&_!="")try{let J=Se.fromText(_),re=new ns;re.rrule(J);let Y=re.valueOf();if(_&&Y[0]==""){Ke("Event not created. Error in recurrence text.",!0);return}n(0,r.recurrence=Y,r)}catch(J){Ke("Event not created. Error in recurrence text.",!0);return}let U=yield ff(b(r));(U==null?void 0:U.id)&&i()}),F=U=>Tt(void 0,void 0,void 0,function*(){let J=!1;r.recurringEventId?J=yield uf(r):J=yield uf(r),J&&i()}),P=()=>Tt(void 0,void 0,void 0,function*(){(yield uf(b(r),!0))&&i()}),L=()=>Tt(void 0,void 0,void 0,function*(){let U=b(r),J;U.recurringEventId?J=yield Js(U):J=yield Js(U),J.id&&i()}),R=()=>Tt(void 0,void 0,void 0,function*(){(yield Js(b(r),!0)).id&&i()}),M=()=>Tt(void 0,void 0,void 0,function*(){app.workspace.getLeaf(!0).openFile(v.file),i()}),H=()=>Tt(void 0,void 0,void 0,function*(){c.settings.useDefaultTemplate&&c.settings.defaultFolder&&c.settings.defaultFolder?cr(r,c.settings.defaultFolder,c.settings.defaultTemplate):new fi(r,U=>n(9,v.file=U,v)).open()}),le=()=>{window.open(r.htmlLink)};function V(){r.summary=this.value,n(0,r)}function X(){u=this.checked,n(5,u)}function K(){m=this.value,n(7,m)}function ce(){p=this.value,n(1,p)}function S(){h=this.value,n(2,h),n(1,p)}function Q(){_=this.value,n(8,_)}function j(){f=this.checked,n(6,f)}return t.$$set=U=>{"event"in U&&n(0,r=U.event),"closeFunction"in U&&n(21,i=U.closeFunction)},t.$$.update=()=>{if(t.$$.dirty[0]&6){e:{let U=window.moment(p);window.moment(h).isBefore(U)&&n(2,h=U.add(1,"hour").format("YYYY-MM-DDTHH:mm"))}}},[r,p,h,o,a,u,f,m,_,v,E,y,O,D,F,P,L,R,M,H,le,i,V,X,K,ce,S,Q,j]}var Ev=class extends ze{constructor(e){super();qe(this,e,A3,M3,Ge,{event:0,closeFunction:21},v3,[-1,-1])}},Tv=Ev;var Nr=class extends Sv.Modal{constructor(e,n){super(ye.getInstance().app);this.selectedEvent=e,n&&(this.closeFunction=n)}onOpen(){return te(this,null,function*(){let{contentEl:e}=this;new Tv({target:e,props:{event:this.selectedEvent,closeFunction:()=>{this.closeFunction&&this.closeFunction(),this.close()}}})})}onClose(){let{contentEl:e}=this;e.empty()}};var Dv=Oe(Bu());var dr=class extends Cv.FuzzySuggestModal{constructor(e,n,r=window.moment(),i=!1,o){super(window.app);this.plugin=ye.getInstance();this.eventList=[...e],this.modalSelectMode=n,this.setPlaceholder(`${r.format("MM/DD/YYYY")} Arrow left/right to switch day`),this.emptyStateText="No events found enter to create a new one",this.eventsChanged=i,this.currentDate=r.clone(),o&&(this.closeFunction=o),this.inputEl.addEventListener("keydown",a=>te(this,null,function*(){let u=!1;!this.getSuggestions(this.inputEl.value).length&&a.key=="Enter"&&new Nr({summary:this.inputEl.value,start:{date:r.format()},end:{}},()=>{this.eventsChanged=!0,this.close()}).open(),a.key=="ArrowRight"?(a.ctrlKey?this.currentDate=this.currentDate.add(1,"month"):a.shiftKey?this.currentDate=this.currentDate.add(1,"week"):this.currentDate=this.currentDate.add(1,"day"),u=!0):a.key=="ArrowLeft"&&(a.ctrlKey?this.currentDate=this.currentDate.subtract(1,"month"):a.shiftKey?this.currentDate=this.currentDate.subtract(1,"week"):this.currentDate=this.currentDate.subtract(1,"day"),u=!0),u&&(this.setPlaceholder("Loading"),this.eventList=yield Yt({startDate:this.currentDate}),this.inputEl.dispatchEvent(new Event("input")),this.setPlaceholder(`${this.currentDate.format("MM/DD/YYYY")} Arrow left and right to switch day`))}))}getItems(){return this.plugin.settings.activateDailyNoteAddon?[{id:"xxx",start:null,end:null},...this.eventList]:this.eventList}getItemText(e){return e.id=="xxx"?Zo(this.currentDate)?"Open daily note":"Create daily note":e.start.date?`${e.start.date} | ${e.summary} `:`${window.moment(e.start.dateTime).format("YYYY-MM-DD HH:mm")} | ${e.summary} `}onChooseItem(e){return te(this,null,function*(){if(e.id=="xxx"){let n=Zo(this.currentDate);n||(n=yield(0,Dv.createDailyNote)(this.currentDate)),yield app.workspace.getLeaf(!1).openFile(n,{active:!0});return}this.modalSelectMode=="details"?(this.open(),new Nr(e,()=>this.eventsChanged=!0).open()):this.modalSelectMode=="createNote"&&(this.plugin.settings.useDefaultTemplate?cr(e,this.plugin.settings.defaultFolder,this.plugin.settings.defaultTemplate):new fi(e,()=>{}).open())})}onClose(){this.closeFunction&&this.eventsChanged&&this.closeFunction()}};var nh=class extends Ov.FuzzySuggestModal{constructor(e){super(ye.getInstance().app);this.calendarList=e,this.setPlaceholder("Select a calendar to view it")}getItems(){return this.calendarList}getItemText(e){return`${e.summary} `}onChooseItem(e){return te(this,null,function*(){let n=yield Yt({include:[e.id]});new dr(n,"details").open()})}};function rh(t,e){let n=e.replace(/\((?!\?)/g,"(?:");return`${t}${n}\\s{0,5}(?:,?\\s{0,5}${n}){0,10}`}function P3(t){let e;return t instanceof Array?e=[...t]:t instanceof Map?e=Array.from(t.keys()):e=Object.keys(t),e}function Pn(t){return`(?:${P3(t).sort((n,r)=>r.length-n.length).join("|").replace(/\./g,"\\.")})`}var Mv=Oe(ho());function _f(t){return t<100&&(t>50?t=t+1900:t=t+2e3),t}function mo(t,e,n){let r=(0,Mv.default)(t),i=r;i=i.month(n-1),i=i.date(e),i=i.year(r.year());let o=i.add(1,"y"),a=i.add(-1,"y");return Math.abs(o.diff(r))<Math.abs(i.diff(r))?i=o:Math.abs(a.diff(r))<Math.abs(i.diff(r))&&(i=a),i.year()}var sh={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},ah={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},xr=Ps(zn({},ah),{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}),lh={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},uh={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},Av={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"},El=zn({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"},Av),Pv=`(?:${Pn(lh)}|[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)?)`;function N3(t){let e=t.toLowerCase();return lh[e]!==void 0?lh[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)}var aa=`(?:${Pn(uh)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function la(t){let e=t.toLowerCase();return uh[e]!==void 0?uh[e]:(e=e.replace(/(?:st|nd|rd|th)$/i,""),parseInt(e))}var ua="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9])";function fa(t){if(/BE/i.test(t))return t=t.replace(/BE/i,""),parseInt(t)-543;if(/BCE?/i.test(t))return t=t.replace(/BCE?/i,""),-parseInt(t);if(/(AD|CE)/i.test(t))return t=t.replace(/(AD|CE)/i,""),parseInt(t);let e=parseInt(t);return _f(e)}var Nv=`(${Pv})\\s{0,3}(${Pn(El)})`,xv=new RegExp(Nv,"i"),x3=`(${Pv})\\s{0,3}(${Pn(Av)})`,Bi=rh("(?:(?:about|around)\\s{0,3})?",Nv),go=rh("(?:(?:about|around)\\s{0,3})?",x3);function ci(t){let e={},n=t,r=xv.exec(n);for(;r;)I3(e,r),n=n.substring(r[0].length).trim(),r=xv.exec(n);return e}function I3(t,e){let n=N3(e[1]),r=El[e[2].toLowerCase()];t[r]=n}var Fv=Oe(Iv()),Tl=Oe(ho());function Rv(t,e){e=e.add(1,"day"),is(t,e),ca(t,e)}function Jr(t,e){t.assign("day",e.date()),t.assign("month",e.month()+1),t.assign("year",e.year())}function vf(t,e){t.assign("hour",e.hour()),t.assign("minute",e.minute()),t.assign("second",e.second()),t.assign("millisecond",e.millisecond()),t.get("hour")<12?t.assign("meridiem",yt.AM):t.assign("meridiem",yt.PM)}function is(t,e){t.imply("day",e.date()),t.imply("month",e.month()+1),t.imply("year",e.year())}function ca(t,e){t.imply("hour",e.hour()),t.imply("minute",e.minute()),t.imply("second",e.second()),t.imply("millisecond",e.millisecond())}var dh=Oe(ho());var R3={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:2*60,timezoneOffsetNonDst:60,dstStart:t=>Lv(t,pr.MARCH,fn.SUNDAY,2),dstEnd:t=>Lv(t,pr.OCTOBER,fn.SUNDAY,3)},CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CT:{timezoneOffsetDuringDst:-5*60,timezoneOffsetNonDst:-6*60,dstStart:t=>_o(t,pr.MARCH,fn.SUNDAY,2,2),dstEnd:t=>_o(t,pr.NOVEMBER,fn.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:-4*60,timezoneOffsetNonDst:-5*60,dstStart:t=>_o(t,pr.MARCH,fn.SUNDAY,2,2),dstEnd:t=>_o(t,pr.NOVEMBER,fn.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:-6*60,timezoneOffsetNonDst:-7*60,dstStart:t=>_o(t,pr.MARCH,fn.SUNDAY,2,2),dstEnd:t=>_o(t,pr.NOVEMBER,fn.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:-7*60,timezoneOffsetNonDst:-8*60,dstStart:t=>_o(t,pr.MARCH,fn.SUNDAY,2,2),dstEnd:t=>_o(t,pr.NOVEMBER,fn.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 _o(t,e,n,r,i=0){let o=0,a=0;for(;a<r;)o++,new Date(t,e-1,o).getDay()===n&&a++;return new Date(t,e-1,o,i)}function Lv(t,e,n,r=0){let i=n===0?7:n,o=new Date(t,e-1+1,1,12),a=o.getDay()===0?7:o.getDay(),u;return a===i?u=7:a<i?u=7+a-i:u=a-i,o.setDate(o.getDate()-u),new Date(t,e-1,o.getDate(),r)}function yf(t,e,n={}){var i;if(t==null)return null;if(typeof t=="number")return t;let r=(i=n[t])!=null?i:R3[t];return r==null?null:typeof r=="number"?r:e==null?null:(0,dh.default)(e).isAfter(r.dstStart(e.getFullYear()))&&!(0,dh.default)(e).isAfter(r.dstEnd(e.getFullYear()))?r.timezoneOffsetDuringDst:r.timezoneOffsetNonDst}Tl.default.extend(Fv.default);var Sl=class{constructor(e){var n;e=e!=null?e:new Date,e instanceof Date?this.instant=e:(this.instant=(n=e.instant)!=null?n:new Date,this.timezoneOffset=yf(e.timezone,this.instant))}getDateWithAdjustedTimezone(){return new Date(this.instant.getTime()+this.getSystemTimezoneAdjustmentMinute(this.instant)*6e4)}getSystemTimezoneAdjustmentMinute(e,n){var o;(!e||e.getTime()<0)&&(e=new Date);let r=-e.getTimezoneOffset(),i=(o=n!=null?n:this.timezoneOffset)!=null?o:r;return r-i}},wt=class{constructor(e,n){if(this.reference=e,this.knownValues={},this.impliedValues={},n)for(let i in n)this.knownValues[i]=n[i];let r=(0,Tl.default)(e.instant);this.imply("day",r.date()),this.imply("month",r.month()+1),this.imply("year",r.year()),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,n){return e in this.knownValues?this:(this.impliedValues[e]=n,this)}assign(e,n){return this.knownValues[e]=n,delete this.impliedValues[e],this}delete(e){delete this.knownValues[e],delete this.impliedValues[e]}clone(){let e=new wt(this.reference);e.knownValues={},e.impliedValues={};for(let n in this.knownValues)e.knownValues[n]=this.knownValues[n];for(let n in this.impliedValues)e.impliedValues[n]=this.impliedValues[n];return e}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}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 {knownValues: ${JSON.stringify(this.knownValues)}, impliedValues: ${JSON.stringify(this.impliedValues)}}, reference: ${JSON.stringify(this.reference)}]`}dayjs(){return(0,Tl.default)(this.date())}date(){let e=this.dateWithoutTimezoneAdjustment(),n=this.reference.getSystemTimezoneAdjustmentMinute(e,this.get("timezoneOffset"));return new Date(e.getTime()+n*6e4)}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,n){let r=(0,Tl.default)(e.instant);for(let o in n)r=r.add(n[o],o);let i=new wt(e);return n.hour||n.minute||n.second?(vf(i,r),Jr(i,r),e.timezoneOffset!==null&&i.assign("timezoneOffset",-e.instant.getTimezoneOffset())):(ca(i,r),e.timezoneOffset!==null&&i.imply("timezoneOffset",-e.instant.getTimezoneOffset()),n.d?(i.assign("day",r.date()),i.assign("month",r.month()+1),i.assign("year",r.year())):(n.week&&i.imply("weekday",r.day()),i.imply("day",r.date()),n.month?(i.assign("month",r.month()+1),i.assign("year",r.year())):(i.imply("month",r.month()+1),n.year?i.assign("year",r.year()):i.imply("year",r.year())))),i}},vo=class{constructor(e,n,r,i,o){this.reference=e,this.refDate=e.instant,this.index=n,this.text=r,this.start=i||new wt(e),this.end=o}clone(){let e=new vo(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()}toString(){return`[ParsingResult {index: ${this.index}, text: '${this.text}', ...}]`}};var xt=class{constructor(){this.cachedInnerPattern=null,this.cachedPattern=null}patternLeftBoundary(){return"(\\W|^)"}pattern(e){let n=this.innerPattern(e);return n==this.cachedInnerPattern?this.cachedPattern:(this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${n.source}`,n.flags),this.cachedInnerPattern=n,this.cachedPattern)}extract(e,n){var i;let r=(i=n[1])!=null?i:"";n.index=n.index+r.length,n[0]=n[0].substring(r.length);for(let o=2;o<n.length;o++)n[o-1]=n[o];return this.innerExtract(e,n)}};var L3=new RegExp(`(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Bi})(?=\\W|$)`,"i"),F3=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Bi})(?=\\W|$)`,"i"),Y3=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${go})(?=\\W|$)`,"i"),wf=class extends xt{constructor(e){super();this.strictMode=e}innerPattern(e){return this.strictMode?Y3:e.option.forwardDate?L3:F3}innerExtract(e,n){let r=ci(n[1]);return wt.createRelativeFromReference(e.reference,r)}};var W3=new RegExp(`(?:on\\s{0,3})?(${aa})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)?\\s{0,3}(${aa}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${Pn(xr)})(?:(?:-|/|,?\\s{0,3})(${ua}(?![^\\s]\\d)))?(?=\\W|$)`,"i"),Yv=1,Wv=2,j3=3,jv=4,bf=class extends xt{innerPattern(){return W3}innerExtract(e,n){let r=e.createParsingResult(n.index,n[0]),i=xr[n[j3].toLowerCase()],o=la(n[Yv]);if(o>31)return n.index=n.index+n[Yv].length,null;if(r.start.assign("month",i),r.start.assign("day",o),n[jv]){let a=fa(n[jv]);r.start.assign("year",a)}else{let a=mo(e.refDate,o,i);r.start.imply("year",a)}if(n[Wv]){let a=la(n[Wv]);r.end=r.start.clone(),r.end.assign("day",a)}return r}};var B3=new RegExp(`(${Pn(xr)})(?:-|/|\\s*,?\\s*)(${aa})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${aa})\\s*)?(?:(?:-|/|\\s*,?\\s*)(${ua}))?(?=\\W|$)(?!\\:\\d)`,"i"),G3=1,U3=2,Bv=3,Gv=4,kf=class extends xt{innerPattern(){return B3}innerExtract(e,n){let r=xr[n[G3].toLowerCase()],i=la(n[U3]);if(i>31)return null;let o=e.createParsingComponents({day:i,month:r});if(n[Gv]){let f=fa(n[Gv]);o.assign("year",f)}else{let f=mo(e.refDate,i,r);o.imply("year",f)}if(!n[Bv])return o;let a=la(n[Bv]),u=e.createParsingResult(n.index,n[0]);return u.start=o,u.end=o.clone(),u.end.assign("day",a),u}};var z3=new RegExp(`((?:in)\\s*)?(${Pn(xr)})\\s*(?:[,-]?\\s*(${ua})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),H3=1,q3=2,Uv=3,Ef=class extends xt{innerPattern(){return z3}innerExtract(e,n){let r=n[q3].toLowerCase();if(n[0].length<=3&&!ah[r])return null;let i=e.createParsingResult(n.index+(n[H3]||"").length,n.index+n[0].length);i.start.imply("day",1);let o=xr[r];if(i.start.assign("month",o),n[Uv]){let a=fa(n[Uv]);i.start.assign("year",a)}else{let a=mo(e.refDate,1,o);i.start.imply("year",a)}return i}};var V3=new RegExp(`([0-9]{4})[\\.\\/\\s](?:(${Pn(xr)})|([0-9]{1,2}))[\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),K3=1,Z3=2,zv=3,X3=4,Tf=class extends xt{innerPattern(){return V3}innerExtract(e,n){let r=n[zv]?parseInt(n[zv]):xr[n[Z3].toLowerCase()];if(r<1||r>12)return null;let i=parseInt(n[K3]);return{day:parseInt(n[X3]),month:r,year:i}}};var J3=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),Q3=1,$3=2,Sf=class extends xt{innerPattern(){return J3}innerExtract(e,n){let r=parseInt(n[$3]),i=parseInt(n[Q3]);return e.createParsingComponents().imply("day",1).assign("month",i).assign("year",r)}};function e6(t,e,n,r){return new RegExp(`${t}${e}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${n}`,r)}function t6(t,e){return new RegExp(`^(${t})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${e}`,"i")}var Hv=2,da=3,Cf=4,Df=5,Cl=6,ph=class{constructor(e=!1){this.cachedPrimaryPrefix=null,this.cachedPrimarySuffix=null,this.cachedPrimaryTimePattern=null,this.cachedFollowingPhase=null,this.cachedFollowingSuffix=null,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,n){let r=this.extractPrimaryTimeComponents(e,n);if(!r)return n.index+=n[0].length,null;let i=n.index+n[1].length,o=n[0].substring(n[1].length),a=e.createParsingResult(i,o,r);n.index+=n[0].length;let u=e.text.substring(n.index),c=this.getFollowingTimePatternThroughCache().exec(u);return o.match(/^\d{3,4}/)&&c&&c[0].match(/^\s*([+-])\s*\d{2,4}$/)?null:!c||c[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(a):(a.end=this.extractFollowingTimeComponents(e,c,a),a.end&&(a.text+=c[0]),this.checkAndReturnWithFollowingPattern(a))}extractPrimaryTimeComponents(e,n,r=!1){let i=e.createParsingComponents(),o=0,a=null,u=parseInt(n[Hv]);if(u>100){if(this.strictMode||n[da]!=null)return null;o=u%100,u=Math.floor(u/100)}if(u>24)return null;if(n[da]!=null){if(n[da].length==1&&!n[Cl])return null;o=parseInt(n[da])}if(o>=60)return null;if(u>12&&(a=yt.PM),n[Cl]!=null){if(u>12)return null;let f=n[Cl][0].toLowerCase();f=="a"&&(a=yt.AM,u==12&&(u=0)),f=="p"&&(a=yt.PM,u!=12&&(u+=12))}if(i.assign("hour",u),i.assign("minute",o),a!==null?i.assign("meridiem",a):u<12?i.imply("meridiem",yt.AM):i.imply("meridiem",yt.PM),n[Df]!=null){let f=parseInt(n[Df].substring(0,3));if(f>=1e3)return null;i.assign("millisecond",f)}if(n[Cf]!=null){let f=parseInt(n[Cf]);if(f>=60)return null;i.assign("second",f)}return i}extractFollowingTimeComponents(e,n,r){let i=e.createParsingComponents();if(n[Df]!=null){let f=parseInt(n[Df].substring(0,3));if(f>=1e3)return null;i.assign("millisecond",f)}if(n[Cf]!=null){let f=parseInt(n[Cf]);if(f>=60)return null;i.assign("second",f)}let o=parseInt(n[Hv]),a=0,u=-1;if(n[da]!=null?a=parseInt(n[da]):o>100&&(a=o%100,o=Math.floor(o/100)),a>=60||o>24)return null;if(o>=12&&(u=yt.PM),n[Cl]!=null){if(o>12)return null;let f=n[Cl][0].toLowerCase();f=="a"&&(u=yt.AM,o==12&&(o=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),f=="p"&&(u=yt.PM,o!=12&&(o+=12)),r.start.isCertain("meridiem")||(u==yt.AM?(r.start.imply("meridiem",yt.AM),r.start.get("hour")==12&&r.start.assign("hour",0)):(r.start.imply("meridiem",yt.PM),r.start.get("hour")!=12&&r.start.assign("hour",r.start.get("hour")+12)))}return i.assign("hour",o),i.assign("minute",a),u>=0?i.assign("meridiem",u):r.start.isCertain("meridiem")&&r.start.get("hour")>12?r.start.get("hour")-12>o?i.imply("meridiem",yt.AM):o<=12&&(i.assign("hour",o+12),i.assign("meridiem",yt.PM)):o>12?i.imply("meridiem",yt.PM):o<=12&&i.imply("meridiem",yt.AM),i.date().getTime()<r.start.date().getTime()&&i.imply("day",i.get("day")+1),i}checkAndReturnWithoutFollowingPattern(e){if(e.text.match(/^\d$/)||e.text.match(/^\d\d\d+$/)||e.text.match(/\d[apAP]$/))return null;let n=e.text.match(/[^\d:.](\d[\d.]+)$/);if(n){let r=n[1];if(this.strictMode||r.includes(".")&&!r.match(/\d(\.\d{2})+$/)||parseInt(r)>24)return null}return e}checkAndReturnWithFollowingPattern(e){if(e.text.match(/^\d+-\d+$/))return null;let n=e.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(n){if(this.strictMode)return null;let r=n[1],i=n[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;let o=parseInt(i),a=parseInt(r);if(o>24||a>24)return null}return e}getPrimaryTimePatternThroughCache(){let e=this.primaryPrefix(),n=this.primarySuffix();return this.cachedPrimaryPrefix===e&&this.cachedPrimarySuffix===n?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=e6(this.primaryPatternLeftBoundary(),e,n,this.patternFlags()),this.cachedPrimaryPrefix=e,this.cachedPrimarySuffix=n,this.cachedPrimaryTimePattern)}getFollowingTimePatternThroughCache(){let e=this.followingPhase(),n=this.followingSuffix();return this.cachedFollowingPhase===e&&this.cachedFollowingSuffix===n?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=t6(e,n),this.cachedFollowingPhase=e,this.cachedFollowingSuffix=n,this.cachedFollowingTimePatten)}};var Of=class extends ph{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,n){let r=super.extractPrimaryTimeComponents(e,n);if(r){if(n[0].endsWith("night")){let i=r.get("hour");i>=6&&i<12?(r.assign("hour",r.get("hour")+12),r.assign("meridiem",yt.PM)):i<6&&r.assign("meridiem",yt.AM)}if(n[0].endsWith("afternoon")){r.assign("meridiem",yt.PM);let i=r.get("hour");i>=0&&i<=6&&r.assign("hour",r.get("hour")+12)}n[0].endsWith("morning")&&(r.assign("meridiem",yt.AM),r.get("hour")<12&&r.assign("hour",r.get("hour")))}return r}};function pa(t){let e={};for(let n in t)e[n]=-t[n];return e}function qv(t,e){let n=t.clone(),r=t.dayjs();for(let i in e)r=r.add(e[i],i);return("day"in e||"d"in e||"week"in e||"month"in e||"year"in e)&&(n.imply("day",r.date()),n.imply("month",r.month()+1),n.imply("year",r.year())),("second"in e||"minute"in e||"hour"in e)&&(n.imply("second",r.second()),n.imply("minute",r.minute()),n.imply("hour",r.hour())),n}var n6=new RegExp(`(${Bi})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),r6=new RegExp(`(${go})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),Mf=class extends xt{constructor(e){super();this.strictMode=e}innerPattern(){return this.strictMode?r6:n6}innerExtract(e,n){let r=ci(n[1]),i=pa(r);return wt.createRelativeFromReference(e.reference,i)}};var i6=new RegExp(`(${Bi})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),o6=new RegExp("("+go+")(later|from now)(?=(?:\\W|$))","i"),s6=1,Af=class extends xt{constructor(e){super();this.strictMode=e}innerPattern(){return this.strictMode?o6:i6}innerExtract(e,n){let r=ci(n[s6]);return wt.createRelativeFromReference(e.reference,r)}};var hh=class{refine(e,n){return n.filter(r=>this.isValid(e,r))}},Gi=class{refine(e,n){if(n.length<2)return n;let r=[],i=n[0],o=null;for(let a=1;a<n.length;a++){o=n[a];let u=e.text.substring(i.index+i.text.length,o.index);if(!this.shouldMergeResults(u,i,o,e))r.push(i),i=o;else{let f=i,c=o,p=this.mergeResults(u,f,c,e);e.debug(()=>{console.log(`${this.constructor.name} merged ${f} and ${c} into ${p}`)}),i=p}}return i!=null&&r.push(i),r}};var Pf=class extends Gi{shouldMergeResults(e,n,r){return!n.end&&!r.end&&e.match(this.patternBetween())!=null}mergeResults(e,n,r){if(!n.start.isOnlyWeekdayComponent()&&!r.start.isOnlyWeekdayComponent()&&(r.start.getCertainComponents().forEach(o=>{n.start.isCertain(o)||n.start.imply(o,r.start.get(o))}),n.start.getCertainComponents().forEach(o=>{r.start.isCertain(o)||r.start.imply(o,n.start.get(o))})),n.start.date().getTime()>r.start.date().getTime()){let o=n.start.dayjs(),a=r.start.dayjs();r.start.isOnlyWeekdayComponent()&&a.add(7,"days").isAfter(o)?(a=a.add(7,"days"),r.start.imply("day",a.date()),r.start.imply("month",a.month()+1),r.start.imply("year",a.year())):n.start.isOnlyWeekdayComponent()&&o.add(-7,"days").isBefore(a)?(o=o.add(-7,"days"),n.start.imply("day",o.date()),n.start.imply("month",o.month()+1),n.start.imply("year",o.year())):r.start.isDateWithUnknownYear()&&a.add(1,"years").isAfter(o)?(a=a.add(1,"years"),r.start.imply("year",a.year())):n.start.isDateWithUnknownYear()&&o.add(-1,"years").isBefore(a)?(o=o.add(-1,"years"),n.start.imply("year",o.year())):[r,n]=[n,r]}let i=n.clone();return i.start=n.start,i.end=r.start,i.index=Math.min(n.index,r.index),n.index<r.index?i.text=n.text+e+r.text:i.text=r.text+e+n.text,i}};var Nf=class extends Pf{patternBetween(){return/^\s*(to|-||until|through|till)\s*$/i}};function mh(t,e){let n=t.clone(),r=t.start,i=e.start;if(n.start=Vv(r,i),t.end!=null||e.end!=null){let o=t.end==null?t.start:t.end,a=e.end==null?e.start:e.end,u=Vv(o,a);if(t.end==null&&u.date().getTime()<n.start.date().getTime()){let f=u.dayjs().add(1,"day");u.isCertain("day")?Jr(u,f):is(u,f)}n.end=u}return n}function Vv(t,e){let n=t.clone();return e.isCertain("hour")?(n.assign("hour",e.get("hour")),n.assign("minute",e.get("minute")),e.isCertain("second")?(n.assign("second",e.get("second")),e.isCertain("millisecond")?n.assign("millisecond",e.get("millisecond")):n.imply("millisecond",e.get("millisecond"))):(n.imply("second",e.get("second")),n.imply("millisecond",e.get("millisecond")))):(n.imply("hour",e.get("hour")),n.imply("minute",e.get("minute")),n.imply("second",e.get("second")),n.imply("millisecond",e.get("millisecond"))),e.isCertain("timezoneOffset")&&n.assign("timezoneOffset",e.get("timezoneOffset")),e.isCertain("meridiem")?n.assign("meridiem",e.get("meridiem")):e.get("meridiem")!=null&&n.get("meridiem")==null&&n.imply("meridiem",e.get("meridiem")),n.get("meridiem")==yt.PM&&n.get("hour")<12&&(e.isCertain("hour")?n.assign("hour",n.get("hour")+12):n.imply("hour",n.get("hour")+12)),n}var xf=class extends Gi{shouldMergeResults(e,n,r){return(n.start.isOnlyDate()&&r.start.isOnlyTime()||r.start.isOnlyDate()&&n.start.isOnlyTime())&&e.match(this.patternBetween())!=null}mergeResults(e,n,r){let i=n.start.isOnlyDate()?mh(n,r):mh(r,n);return i.index=n.index,i.text=n.text+e+r.text,i}};var If=class extends xf{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-)?\\s*$")}};var a6=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),Rf=class{constructor(e){this.timezoneOverrides=e}refine(e,n){var i;let r=(i=e.option.timezones)!=null?i:{};return n.forEach(o=>{var _,v;let a=e.text.substring(o.index+o.text.length),u=a6.exec(a);if(!u)return;let f=u[1].toUpperCase(),c=(v=(_=o.start.date())!=null?_:o.refDate)!=null?v:new Date,p=zn(zn({},this.timezoneOverrides),r),h=yf(f,c,p);if(h==null)return;e.debug(()=>{console.log(`Extracting timezone: '${f}' into: ${h} for: ${o.start}`)});let m=o.start.get("timezoneOffset");m!==null&&h!=m&&(o.start.isCertain("timezoneOffset")||f!=u[1])||o.start.isOnlyDate()&&f!=u[1]||(o.text+=u[0],o.start.isCertain("timezoneOffset")||o.start.assign("timezoneOffset",h),o.end!=null&&!o.end.isCertain("timezoneOffset")&&o.end.assign("timezoneOffset",h))}),n}};var l6=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),u6=1,f6=2,c6=3,Lf=class{refine(e,n){return n.forEach(function(r){if(r.start.isCertain("timezoneOffset"))return;let i=e.text.substring(r.index+r.text.length),o=l6.exec(i);if(!o)return;e.debug(()=>{console.log(`Extracting timezone: '${o[0]}' into : ${r}`)});let a=parseInt(o[f6]),u=parseInt(o[c6]||"0"),f=a*60+u;f>14*60||(o[u6]==="-"&&(f=-f),r.end!=null&&r.end.assign("timezoneOffset",f),r.start.assign("timezoneOffset",f),r.text+=o[0])}),n}};var Dl=class{refine(e,n){if(n.length<2)return n;let r=[],i=n[0];for(let o=1;o<n.length;o++){let a=n[o];a.index<i.index+i.text.length?a.text.length>i.text.length&&(i=a):(r.push(i),i=a)}return i!=null&&r.push(i),r}};var Kv=Oe(ho());var Ff=class{refine(e,n){return e.option.forwardDate&&n.forEach(function(r){let i=(0,Kv.default)(e.refDate);if(r.start.isOnlyTime()&&i.isAfter(r.start.dayjs())&&(i=i.add(1,"day"),is(r.start,i),r.end&&r.end.isOnlyTime()&&(is(r.end,i),r.start.dayjs().isAfter(r.end.dayjs())&&(i=i.add(1,"day"),is(r.end,i)))),r.start.isOnlyWeekdayComponent()&&i.isAfter(r.start.dayjs())&&(i.day()>=r.start.get("weekday")?i=i.day(r.start.get("weekday")+7):i=i.day(r.start.get("weekday")),r.start.imply("day",i.date()),r.start.imply("month",i.month()+1),r.start.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${r} (${r.start})`)}),r.end&&r.end.isOnlyWeekdayComponent()&&(i.day()>r.end.get("weekday")?i=i.day(r.end.get("weekday")+7):i=i.day(r.end.get("weekday")),r.end.imply("day",i.date()),r.end.imply("month",i.month()+1),r.end.imply("year",i.year()),e.debug(()=>{console.log(`Forward weekly adjusted for ${r} (${r.end})`)}))),r.start.isDateWithUnknownYear()&&i.isAfter(r.start.dayjs()))for(let o=0;o<3&&i.isAfter(r.start.dayjs());o++)r.start.imply("year",r.start.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${r} (${r.start})`)}),r.end&&!r.end.isCertain("year")&&(r.end.imply("year",r.end.get("year")+1),e.debug(()=>{console.log(`Forward yearly adjusted for ${r} (${r.end})`)}))}),n}};var Yf=class extends hh{constructor(e){super();this.strictMode=e}isValid(e,n){return n.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(e.debug(()=>{console.log(`Removing unlikely result '${n.text}'`)}),!1):n.start.isValidDate()?n.end&&!n.end.isValidDate()?(e.debug(()=>{console.log(`Removing invalid result: ${n} (${n.end})`)}),!1):this.strictMode?this.isStrictModeValid(e,n):!0:(e.debug(()=>{console.log(`Removing invalid result: ${n} (${n.start})`)}),!1)}isStrictModeValid(e,n){return n.start.isOnlyWeekdayComponent()?(e.debug(()=>{console.log(`(Strict) Removing weekday only component: ${n} (${n.end})`)}),!1):n.start.isOnlyTime()&&(!n.start.isCertain("hour")||!n.start.isCertain("minute"))?(e.debug(()=>{console.log(`(Strict) Removing uncertain time component: ${n} (${n.end})`)}),!1):!0}};var d6=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"),p6=1,h6=2,m6=3,Zv=4,g6=5,Xv=6,Jv=7,Qv=8,$v=9,Wf=class extends xt{innerPattern(){return d6}innerExtract(e,n){let r={};if(r.year=parseInt(n[p6]),r.month=parseInt(n[h6]),r.day=parseInt(n[m6]),n[Zv]!=null)if(r.hour=parseInt(n[Zv]),r.minute=parseInt(n[g6]),n[Xv]!=null&&(r.second=parseInt(n[Xv])),n[Jv]!=null&&(r.millisecond=parseInt(n[Jv])),n[Qv]==null)r.timezoneOffset=0;else{let i=parseInt(n[Qv]),o=0;n[$v]!=null&&(o=parseInt(n[$v]));let a=i*60;a<0?a-=o:a+=o,r.timezoneOffset=a}return r}};var jf=class extends Gi{mergeResults(e,n,r){let i=r.clone();return i.index=n.index,i.text=n.text+e+i.text,i.start.assign("weekday",n.start.get("weekday")),i.end&&i.end.assign("weekday",n.start.get("weekday")),i}shouldMergeResults(e,n,r){return n.start.isOnlyWeekdayComponent()&&!n.start.isCertain("hour")&&r.start.isCertain("day")&&e.match(/^,?\s*$/)!=null}};function ey(t,e=!1){return t.parsers.unshift(new Wf),t.refiners.unshift(new jf),t.refiners.unshift(new Lf),t.refiners.unshift(new Dl),t.refiners.push(new Rf),t.refiners.push(new Dl),t.refiners.push(new Ff),t.refiners.push(new Yf(e)),t}var dy=Oe(ho());var ha=Oe(ho());function ty(t){let e=(0,ha.default)(t.instant),n=new wt(t,{});return Jr(n,e),vf(n,e),t.timezoneOffset!==null&&n.assign("timezoneOffset",e.utcOffset()),n}function ny(t){let e=(0,ha.default)(t.instant),n=new wt(t,{});return Jr(n,e),ca(n,e),n}function ry(t){return _6(t,1)}function _6(t,e){return oy(t,-e)}function iy(t){return oy(t,1)}function oy(t,e){let n=(0,ha.default)(t.instant),r=new wt(t,{});return n=n.add(e,"day"),Jr(r,n),ca(r,n),r}function sy(t,e=22){let n=(0,ha.default)(t.instant),r=new wt(t,{});return r.imply("hour",e),r.imply("meridiem",yt.PM),Jr(r,n),r}function ay(t,e=20){let n=new wt(t,{});return n.imply("meridiem",yt.PM),n.imply("hour",e),n}function ly(t){let e=new wt(t,{}),n=(0,ha.default)(t.instant);return n.hour()>2&&Rv(e,n),e.assign("hour",0),e.imply("minute",0),e.imply("second",0),e.imply("millisecond",0),e}function uy(t,e=6){let n=new wt(t,{});return n.imply("meridiem",yt.AM),n.imply("hour",e),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n}function fy(t,e=15){let n=new wt(t,{});return n.imply("meridiem",yt.PM),n.imply("hour",e),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n}function cy(t){let e=new wt(t,{});return e.imply("meridiem",yt.AM),e.imply("hour",12),e.imply("minute",0),e.imply("second",0),e.imply("millisecond",0),e}var v6=/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,Bf=class extends xt{innerPattern(e){return v6}innerExtract(e,n){let r=(0,dy.default)(e.refDate),i=n[0].toLowerCase(),o=e.createParsingComponents();switch(i){case"now":return ty(e.reference);case"today":return ny(e.reference);case"yesterday":return ry(e.reference);case"tomorrow":case"tmr":case"tmrw":return iy(e.reference);case"tonight":return sy(e.reference);default:i.match(/last\s*night/)&&(r.hour()>6&&(r=r.add(-1,"day")),Jr(o,r),o.imply("hour",0));break}return o}};var y6=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i,Gf=class extends xt{innerPattern(){return y6}innerExtract(e,n){switch(n[1].toLowerCase()){case"afternoon":return fy(e.reference);case"evening":case"night":return ay(e.reference);case"midnight":return ly(e.reference);case"morning":return uy(e.reference);case"noon":case"midday":return cy(e.reference)}return null}};function py(t,e,n){let r=t.getDateWithAdjustedTimezone(),i=w6(r,e,n),o=new wt(t);return o=qv(o,{day:i}),o.assign("weekday",e),o}function w6(t,e,n){let r=t.getDay();switch(n){case"this":return Uf(t,e);case"last":return hy(t,e);case"next":return r==fn.SUNDAY?e==fn.SUNDAY?7:e:r==fn.SATURDAY?e==fn.SATURDAY?7:e==fn.SUNDAY?8:1+e:e<r&&e!=fn.SUNDAY?Uf(t,e):Uf(t,e)+7}return b6(t,e)}function b6(t,e){let n=hy(t,e),r=Uf(t,e);return r<-n?r:n}function Uf(t,e){let n=t.getDay(),r=e-n;return r<0&&(r+=7),r}function hy(t,e){let n=t.getDay(),r=e-n;return r>=0&&(r-=7),r}var k6=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${Pn(sh)})(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),E6=1,T6=2,S6=3,zf=class extends xt{innerPattern(){return k6}innerExtract(e,n){let r=n[T6].toLowerCase(),i=sh[r],o=n[E6],a=n[S6],u=o||a;u=u||"",u=u.toLowerCase();let f=null;return u=="last"||u=="past"?f="last":u=="next"?f="next":u=="this"&&(f="this"),py(e.reference,i,f)}};var my=Oe(ho());var C6=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${Pn(El)})(?=\\s*)(?=\\W|$)`,"i"),D6=1,O6=2,Hf=class extends xt{innerPattern(){return C6}innerExtract(e,n){let r=n[D6].toLowerCase(),i=n[O6].toLowerCase(),o=El[i];if(r=="next"||r.startsWith("after")){let f={};return f[o]=1,wt.createRelativeFromReference(e.reference,f)}if(r=="last"||r=="past"){let f={};return f[o]=-1,wt.createRelativeFromReference(e.reference,f)}let a=e.createParsingComponents(),u=(0,my.default)(e.reference.instant);return i.match(/week/i)?(u=u.add(-u.get("d"),"d"),a.imply("day",u.date()),a.imply("month",u.month()+1),a.imply("year",u.year())):i.match(/month/i)?(u=u.add(-u.date()+1,"d"),a.imply("day",u.date()),a.assign("year",u.year()),a.assign("month",u.month()+1)):i.match(/year/i)&&(u=u.add(-u.date()+1,"d"),u=u.add(-u.month(),"month"),a.imply("day",u.date()),a.imply("month",u.month()+1),a.assign("year",u.year())),a}};var yo=class{constructor(e){e=e||gh(),this.parsers=[...e.parsers],this.refiners=[...e.refiners]}clone(){return new yo({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(e,n,r){let i=this.parse(e,n,r);return i.length>0?i[0].start.date():null}parse(e,n,r){let i=new gy(e,n,r),o=[];return this.parsers.forEach(a=>{let u=yo.executeParser(i,a);o=o.concat(u)}),o.sort((a,u)=>a.index-u.index),this.refiners.forEach(function(a){o=a.refine(i,o)}),o}static executeParser(e,n){let r=[],i=n.pattern(e),o=e.text,a=e.text,u=i.exec(a);for(;u;){let f=u.index+o.length-a.length;u.index=f;let c=n.extract(e,u);if(!c){a=o.substring(u.index+1),u=i.exec(a);continue}let p=null;c instanceof vo?p=c:c instanceof wt?(p=e.createParsingResult(u.index,u[0]),p.start=c):p=e.createParsingResult(u.index,u[0],c),e.debug(()=>console.log(`${n.constructor.name} extracted result ${p}`)),r.push(p),a=o.substring(f+p.text.length),u=i.exec(a)}return r}},gy=class{constructor(e,n,r){this.text=e,this.reference=new Sl(n),this.option=r!=null?r:{},this.refDate=this.reference.instant}createParsingComponents(e){return e instanceof wt?e:new wt(this.reference,e)}createParsingResult(e,n,r,i){let o=typeof n=="string"?n:this.text.substring(e,n),a=r?this.createParsingComponents(r):null,u=i?this.createParsingComponents(i):null;return new vo(this.reference,e,o,a,u)}debug(e){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(e):this.option.debug.debug(e))}};var M6=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"),qf=1,A6=5,_y=2,vy=3,_h=4,Vf=class{constructor(e){this.groupNumberMonth=e?vy:_y,this.groupNumberDay=e?_y:vy}pattern(){return M6}extract(e,n){if(n[qf].length==0&&n.index>0&&n.index<e.text.length){let f=e.text[n.index-1];if(f>="0"&&f<="9")return}let r=n.index+n[qf].length,i=n[0].substr(n[qf].length,n[0].length-n[qf].length-n[A6].length);if(i.match(/^\d\.\d$/)||i.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!n[_h]&&n[0].indexOf("/")<0)return;let o=e.createParsingResult(r,i),a=parseInt(n[this.groupNumberMonth]),u=parseInt(n[this.groupNumberDay]);if((a<1||a>12)&&a>12)if(u>=1&&u<=12&&a<=31)[u,a]=[a,u];else return null;if(u<1||u>31)return null;if(o.start.assign("day",u),o.start.assign("month",a),n[_h]){let f=parseInt(n[_h]),c=_f(f);o.start.assign("year",c)}else{let f=mo(e.refDate,u,a);o.start.imply("year",f)}return o}};var P6=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Bi})(?=\\W|$)`,"i"),N6=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${go})(?=\\W|$)`,"i"),Kf=class extends xt{constructor(e=!0){super();this.allowAbbreviations=e}innerPattern(){return this.allowAbbreviations?P6:N6}innerExtract(e,n){let r=n[1].toLowerCase(),i=ci(n[2]);switch(r){case"last":case"past":case"-":i=pa(i);break}return wt.createRelativeFromReference(e.reference,i)}};function yy(t){return t.text.match(/\s+(before|from)$/i)!=null}function x6(t){return t.text.match(/\s+(after|since)$/i)!=null}var Zf=class extends Gi{patternBetween(){return/^\s*$/i}shouldMergeResults(e,n,r){return!e.match(this.patternBetween())||!yy(n)&&!x6(n)?!1:!!r.start.get("day")&&!!r.start.get("month")&&!!r.start.get("year")}mergeResults(e,n,r){let i=ci(n.text);yy(n)&&(i=pa(i));let o=wt.createRelativeFromReference(new Sl(r.start.date()),i);return new vo(r.reference,n.index,`${n.text}${e}${r.text}`,o)}};var I6=new yo(gh(!1)),fB=new yo(vh(!0,!1)),cB=new yo(vh(!1,!0));function gh(t=!1){let e=vh(!1,t);return e.parsers.unshift(new Bf),e.parsers.unshift(new Gf),e.parsers.unshift(new Ef),e.parsers.unshift(new Hf),e.parsers.unshift(new Kf),e}function vh(t=!0,e=!1){return ey({parsers:[new Vf(e),new wf(t),new bf,new kf,new zf,new Tf,new Sf,new Of(t),new Mf(t),new Af(t)],refiners:[new Zf,new If,new Nf]},t)}var yt;(function(t){t[t.AM=0]="AM",t[t.PM=1]="PM"})(yt||(yt={}));var fn;(function(t){t[t.SUNDAY=0]="SUNDAY",t[t.MONDAY=1]="MONDAY",t[t.TUESDAY=2]="TUESDAY",t[t.WEDNESDAY=3]="WEDNESDAY",t[t.THURSDAY=4]="THURSDAY",t[t.FRIDAY=5]="FRIDAY",t[t.SATURDAY=6]="SATURDAY"})(fn||(fn={}));var pr;(function(t){t[t.JANUARY=1]="JANUARY",t[t.FEBRUARY=2]="FEBRUARY",t[t.MARCH=3]="MARCH",t[t.APRIL=4]="APRIL",t[t.MAY=5]="MAY",t[t.JUNE=6]="JUNE",t[t.JULY=7]="JULY",t[t.AUGUST=8]="AUGUST",t[t.SEPTEMBER=9]="SEPTEMBER",t[t.OCTOBER=10]="OCTOBER",t[t.NOVEMBER=11]="NOVEMBER",t[t.DECEMBER=12]="DECEMBER"})(pr||(pr={}));var R6=I6;function wy(t,e,n){return R6.parseDate(t,e,n)}var vc=Oe(require("obsidian"));function L6(t){Et(t,"svelte-66wdl1","div.svelte-66wdl1{display:inline-block;vertical-align:middle;margin:0 3pt;border-width:calc(1em / 5);border-style:solid;border-radius:50%;animation:var(--duration) infinite svelte-66wdl1-rotate}@keyframes svelte-66wdl1-rotate{100%{transform:rotate(360deg)}}")}function F6(t){let e,n=`${t[0]} transparent ${t[0]}
${t[0]}`;return{c(){e=N("div"),he(e,"--duration",t[1]),k(e,"class","svelte-66wdl1"),he(e,"border-color",n),he(e,"width",t[2]),he(e,"height",t[2])},m(r,i){G(r,e,i)},p(r,[i]){i&2&&he(e,"--duration",r[1]);let o=i&2;(o||i&3&&n!==(n=`${r[0]} transparent ${r[0]}
${r[0]}`))&&he(e,"border-color",n),(o||i&6)&&he(e,"width",r[2]),(o||i&6)&&he(e,"height",r[2])},i:me,o:me,d(r){r&&B(e)}}}function Y6(t,e,n){let{color:r="cornflowerblue"}=e,{duration:i="1.5s"}=e,{size:o="1em"}=e;return t.$$set=a=>{"color"in a&&n(0,r=a.color),"duration"in a&&n(1,i=a.duration),"size"in a&&n(2,o=a.size)},[r,i,o]}var by=class extends ze{constructor(e){super();qe(this,e,Y6,F6,Ge,{color:0,duration:1,size:2},L6)}},yh=by;function Xf(t){let e=t-1;return e*e*e+1}function Jf(t){return--t*t*t*t*t+1}function W6(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Qf(t){var{fallback:e}=t,n=W6(t,["fallback"]);let r=new Map,i=new Map;function o(u,f,c){let{delay:p=0,duration:h=R=>Math.sqrt(R)*30,easing:m=Xf}=mn(mn({},n),c),_=u.getBoundingClientRect(),v=f.getBoundingClientRect(),b=_.left-v.left,E=_.top-v.top,y=_.width/v.width,O=_.height/v.height,D=Math.sqrt(b*b+E*E),F=getComputedStyle(f),P=F.transform==="none"?"":F.transform,L=+F.opacity;return{delay:p,duration:$t(h)?h(D):h,easing:m,css:(R,M)=>`
opacity: ${R*L};
transform-origin: top left;
transform: ${P} translate(${M*b}px,${M*E}px) scale(${R+(1-R)*y}, ${R+(1-R)*O});
`}}function a(u,f,c){return(p,h)=>(u.set(h.key,p),()=>{if(f.has(h.key)){let m=f.get(h.key);return f.delete(h.key),o(m,p,h)}return u.delete(h.key),e&&e(p,h,c)})}return[a(i,r,!1),a(r,i,!0)]}function ky(t,{from:e,to:n},r={}){let i=getComputedStyle(t),o=i.transform==="none"?"":i.transform,[a,u]=i.transformOrigin.split(" ").map(parseFloat),f=e.left+e.width*a/n.width-(n.left+a),c=e.top+e.height*u/n.height-(n.top+u),{delay:p=0,duration:h=_=>Math.sqrt(_)*120,easing:m=Xf}=r;return{delay:p,duration:$t(h)?h(Math.sqrt(f*f+c*c)):h,easing:m,css:(_,v)=>{let b=v*f,E=v*c,y=_+v*e.width/n.width,O=_+v*e.height/n.height;return`transform: ${o} translate(${b}px, ${E}px) scale(${y}, ${O});`}}}function j6(t){let e,n,r=[t[0],{fill:"currentColor"},{viewBox:"0 0 16 16"}],i={};for(let o=0;o<r.length;o+=1)i=mn(i,r[o]);return{c(){e=Xr("svg"),n=Xr("path"),k(n,"d","M3.646 9.146a.5.5 0 0 1 .708 0L8 12.793l3.646-3.647a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 0-.708zm0-2.292a.5.5 0 0 0 .708 0L8 3.207l3.646 3.647a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 0 0 0 .708z"),ai(e,i)},m(o,a){G(o,e,a),A(e,n)},p(o,[a]){ai(e,i=lo(r,[a&1&&o[0],{fill:"currentColor"},{viewBox:"0 0 16 16"}]))},i:me,o:me,d(o){o&&B(e)}}}function B6(t,e,n){return t.$$set=r=>{n(0,e=mn(mn({},e),Zr(r)))},e=Zr(e),[e]}var Ey=class extends ze{constructor(e){super();qe(this,e,B6,j6,Ge,{})}},wh=Ey;function G6(t){let e,n,r=[t[0],{viewBox:"0 0 24 24"},{fill:"currentColor"}],i={};for(let o=0;o<r.length;o+=1)i=mn(i,r[o]);return{c(){e=Xr("svg"),n=Xr("path"),k(n,"d","M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59L7.11 5.7A.996.996 0 1 0 5.7 7.11L10.59 12L5.7 16.89a.996.996 0 1 0 1.41 1.41L12 13.41l4.89 4.89a.996.996 0 1 0 1.41-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"),ai(e,i)},m(o,a){G(o,e,a),A(e,n)},p(o,[a]){ai(e,i=lo(r,[a&1&&o[0],{viewBox:"0 0 24 24"},{fill:"currentColor"}]))},i:me,o:me,d(o){o&&B(e)}}}function U6(t,e,n){return t.$$set=r=>{n(0,e=mn(mn({},e),Zr(r)))},e=Zr(e),[e]}var Ty=class extends ze{constructor(e){super();qe(this,e,U6,G6,Ge,{})}},$f=Ty;function z6(t){let e,n,r=[t[0],{viewBox:"0 0 24 24"},{fill:"currentColor"}],i={};for(let o=0;o<r.length;o+=1)i=mn(i,r[o]);return{c(){e=Xr("svg"),n=Xr("path"),k(n,"d","M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10Zm-4.906-3.68L18.32 7.094A8 8 0 0 1 7.094 18.32ZM5.68 16.906A8 8 0 0 1 16.906 5.68L5.68 16.906Z"),ai(e,i)},m(o,a){G(o,e,a),A(e,n)},p(o,[a]){ai(e,i=lo(r,[a&1&&o[0],{viewBox:"0 0 24 24"},{fill:"currentColor"}]))},i:me,o:me,d(o){o&&B(e)}}}function H6(t,e,n){return t.$$set=r=>{n(0,e=mn(mn({},e),Zr(r)))},e=Zr(e),[e]}var Sy=class extends ze{constructor(e){super();qe(this,e,H6,z6,Ge,{})}},bh=Sy;var{Boolean:q6}=of;function V6(t){Et(t,"svelte-1h68wu3",".svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect){position:relative;align-items:center;display:flex;cursor:text;box-sizing:border-box;border:var(--sms-border, 1pt solid lightgray);border-radius:var(--sms-border-radius, 3pt);background:var(--sms-bg);width:var(--sms-width);max-width:var(--sms-max-width);padding:var(--sms-padding, 0 3pt);color:var(--sms-text-color);font-size:var(--sms-font-size, inherit);min-height:var(--sms-min-height, 22pt);margin:var(--sms-margin)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect.open){z-index:var(--sms-open-z-index, 4)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect:focus-within){border:var(--sms-focus-border, 1pt solid var(--sms-active-color, cornflowerblue))}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect.disabled){background:var(--sms-disabled-bg, lightgray);cursor:not-allowed}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.selected){display:flex;flex:1;padding:0;margin:0;flex-wrap:wrap}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.selected > li){align-items:center;border-radius:3pt;display:flex;margin:2pt;line-height:normal;transition:0.3s;white-space:nowrap;background:var(--sms-selected-bg, rgba(0, 0, 0, 0.15));padding:var(--sms-selected-li-padding, 1pt 5pt);color:var(--sms-selected-text-color, var(--sms-text-color))}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.selected > li[draggable='true']){cursor:grab}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.selected > li.active){background:var(--sms-li-active-bg, var(--sms-active-color, rgba(0, 0, 0, 0.15)))}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect button){border-radius:50%;display:flex;transition:0.2s;color:inherit;background:transparent;border:none;cursor:pointer;outline:none;padding:0;margin:0 0 0 3pt}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect button.remove-all){margin:0 3pt}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(ul.selected > li button:hover, button.remove-all:hover, button:focus){color:var(--sms-remove-btn-hover-color, lightskyblue);background:var(--sms-remove-btn-hover-bg, rgba(0, 0, 0, 0.2))}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect input){margin:auto 0;padding:0}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.selected > input){border:none;outline:none;background:none;flex:1;min-width:2em;color:var(--sms-text-color);font-size:inherit;cursor:inherit;border-radius:0}div.multiselect.svelte-1h68wu3>ul.selected.svelte-1h68wu3>input.svelte-1h68wu3::placeholder{padding-left:5pt;color:var(--sms-placeholder-color);opacity:var(--sms-placeholder-opacity)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > input.form-control){width:2em;position:absolute;background:transparent;border:none;outline:none;z-index:-1;opacity:0;pointer-events:none}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options){list-style:none;top:100%;left:0;width:100%;position:absolute;overflow:auto;transition:all 0.2s;box-sizing:border-box;background:var(--sms-options-bg, white);max-height:var(--sms-options-max-height, 50vh);overscroll-behavior:var(--sms-options-overscroll, none);box-shadow:var(--sms-options-shadow, 0 0 14pt -8pt black);border:var(--sms-options-border);border-width:var(--sms-options-border-width);border-radius:var(--sms-options-border-radius, 1ex);padding:var(--sms-options-padding);margin:var(--sms-options-margin, inherit)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options.hidden){visibility:hidden;opacity:0;transform:translateY(50px)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options > li){padding:3pt 2ex;cursor:pointer;scroll-margin:var(--sms-options-scroll-margin, 100px)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options span){padding:3pt 2ex}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options > li.selected){background:var(--sms-li-selected-bg);color:var(--sms-li-selected-color)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options > li.active){background:var(--sms-li-active-bg, var(--sms-active-color, rgba(0, 0, 0, 0.15)))}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(div.multiselect > ul.options > li.disabled){cursor:not-allowed;background:var(--sms-li-disabled-bg, #f5f5f6);color:var(--sms-li-disabled-text, #b8b8b8)}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3:where(span.max-select-msg){padding:0 3pt}.svelte-1h68wu3.svelte-1h68wu3.svelte-1h68wu3::highlight(search-results){color:var(--sms-highlight-color, orange);background:var(--sms-highlight-bg);text-decoration:var(--sms-highlight-text-decoration);text-decoration-color:var(--sms-highlight-text-decoration-color)}")}function Cy(t,e,n){let r=t.slice();r[111]=e[n],r[118]=n;let i=r[111]instanceof Object?r[111]:{label:r[111]};r[112]=i.label,r[41]=i.disabled!==void 0?i.disabled:null,r[113]=i.title!==void 0?i.title:null,r[114]=i.selectedTitle!==void 0?i.selectedTitle:null,r[115]=i.disabledTitle!==void 0?i.disabledTitle:r[13];let o=r[0]===r[118];return r[116]=o,r}var K6=t=>({option:t[0]&2}),Dy=t=>({option:t[111],idx:t[118]}),Z6=t=>({}),Oy=t=>({}),X6=t=>({}),My=t=>({}),J6=t=>({}),Ay=t=>({});function Py(t,e,n){let r=t.slice();return r[111]=e[n],r[118]=n,r}var Q6=t=>({}),Ny=t=>({}),$6=t=>({option:t[0]&16,idx:t[0]&16}),xy=t=>({option:t[111],idx:t[118]}),eP=t=>({open:t[0]&256}),Iy=t=>({open:t[8]});function tP(t){let e,n;return e=new wh({props:{width:"15px",style:"min-width: 1em; padding: 0 1pt; cursor: pointer;"}}),{c(){ct(e.$$.fragment)},m(r,i){ut(e,r,i),n=!0},p:me,i(r){n||(se(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){st(e,r)}}}function nP(t){let e=t[48](t[111])+"",n;return{c(){n=Me(e)},m(r,i){G(r,n,i)},p(r,i){i[0]&16&&e!==(e=r[48](r[111])+"")&&Ye(n,e)},d(r){r&&B(n)}}}function rP(t){let e,n=t[48](t[111])+"",r;return{c(){e=new Xu(!1),r=zt(),e.a=r},m(i,o){e.m(n,i,o),G(i,r,o)},p(i,o){o[0]&16&&n!==(n=i[48](i[111])+"")&&e.p(n)},d(i){i&&B(r),i&&e.d()}}}function iP(t){let e;function n(o,a){return o[31]?rP:nP}let r=n(t,[-1,-1,-1,-1]),i=r(t);return{c(){i.c(),e=zt()},m(o,a){i.m(o,a),G(o,e,a)},p(o,a){r===(r=n(o,a))&&i?i.p(o,a):(i.d(1),i=r(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&B(e)}}}function Ry(t){let e,n,r,i,o,a=t[69]["remove-icon"],u=Hr(a,t,t[108],Ny),f=u||oP(t);function c(){return t[89](t[111])}function p(){return t[90](t[111])}return{c(){e=N("button"),f&&f.c(),k(e,"type","button"),k(e,"title",n=""+(t[35]+" "+t[48](t[111]))),k(e,"class","remove svelte-1h68wu3")},m(h,m){G(h,e,m),f&&f.m(e,null),r=!0,i||(o=[oe(e,"mouseup",si(c)),oe(e,"keydown",function(){$t(t[54](p))&&t[54](p).apply(this,arguments)})],i=!0)},p(h,m){t=h,u&&u.p&&(!r||m[3]&32768)&&Vr(u,a,t,t[108],r?qr(a,t[108],m,Q6):Kr(t[108]),Ny),(!r||m[0]&16|m[1]&16&&n!==(n=""+(t[35]+" "+t[48](t[111]))))&&k(e,"title",n)},i(h){r||(se(f,h),r=!0)},o(h){de(f,h),r=!1},d(h){h&&B(e),f&&f.d(h),i=!1,We(o)}}}function oP(t){let e,n;return e=new $f({props:{width:"15px"}}),{c(){ct(e.$$.fragment)},m(r,i){ut(e,r,i),n=!0},p:me,i(r){n||(se(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){st(e,r)}}}function Ly(t,e){let n,r,i,o,a,u=me,f,c,p,h=e[69].selected,m=Hr(h,e,e[108],xy),_=m||iP(e),v=!e[41]&&(e[36]===null||e[4].length>e[36])&&Ry(e);function b(){return e[91](e[118])}return{key:t,first:null,c(){n=N("li"),_&&_.c(),r=$(),v&&v.c(),k(n,"class",i=""+(en(e[23])+" svelte-1h68wu3")),k(n,"draggable",o=e[38]&&!e[41]&&e[4].length>1),we(n,"active",e[45]===e[118]),this.first=n},m(E,y){G(E,n,y),_&&_.m(n,null),A(n,r),v&&v.m(n,null),f=!0,c||(p=[oe(n,"dragstart",function(){$t(e[57](e[118]))&&e[57](e[118]).apply(this,arguments)}),oe(n,"drop",oi(function(){$t(e[56](e[118]))&&e[56](e[118]).apply(this,arguments)})),oe(n,"dragenter",b),oe(n,"dragover",oi(e[85]))],c=!0)},p(E,y){e=E,m?m.p&&(!f||y[0]&16|y[3]&32768)&&Vr(m,h,e,e[108],f?qr(h,e[108],y,$6):Kr(e[108]),xy):_&&_.p&&(!f||y[0]&16|y[1]&1)&&_.p(e,f?y:[-1,-1,-1,-1]),!e[41]&&(e[36]===null||e[4].length>e[36])?v?(v.p(e,y),y[0]&16|y[1]&1056&&se(v,1)):(v=Ry(e),v.c(),se(v,1),v.m(n,null)):v&&(Je(),de(v,1,1,()=>{v=null}),Qe()),(!f||y[0]&8388608&&i!==(i=""+(en(e[23])+" svelte-1h68wu3")))&&k(n,"class",i),(!f||y[0]&16|y[1]&1152&&o!==(o=e[38]&&!e[41]&&e[4].length>1))&&k(n,"draggable",o),(!f||y[0]&8388624|y[1]&16384)&&we(n,"active",e[45]===e[118])},r(){a=n.getBoundingClientRect()},f(){P1(n),u()},a(){u(),u=A1(n,a,ky,{duration:100})},i(E){f||(se(_,E),se(v),f=!0)},o(E){de(_,E),de(v),f=!1},d(E){E&&B(n),_&&_.d(E),v&&v.d(),c=!1,We(p)}}}function Fy(t){let e,n=t[69].spinner,r=Hr(n,t,t[108],Ay),i=r||sP(t);return{c(){i&&i.c()},m(o,a){i&&i.m(o,a),e=!0},p(o,a){r&&r.p&&(!e||a[3]&32768)&&Vr(r,n,o,o[108],e?qr(n,o[108],a,J6):Kr(o[108]),Ay)},i(o){e||(se(i,o),e=!0)},o(o){de(i,o),e=!1},d(o){i&&i.d(o)}}}function sP(t){let e,n;return e=new yh({}),{c(){ct(e.$$.fragment)},m(r,i){ut(e,r,i),n=!0},i(r){n||(se(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){st(e,r)}}}function aP(t){let e,n,r,i=t[25]&&(t[25]>1||t[26])&&Yy(t),o=t[25]!==1&&t[4].length>1&&Wy(t);return{c(){i&&i.c(),e=$(),o&&o.c(),n=zt()},m(a,u){i&&i.m(a,u),G(a,e,u),o&&o.m(a,u),G(a,n,u),r=!0},p(a,u){a[25]&&(a[25]>1||a[26])?i?(i.p(a,u),u[0]&100663296&&se(i,1)):(i=Yy(a),i.c(),se(i,1),i.m(e.parentNode,e)):i&&(Je(),de(i,1,1,()=>{i=null}),Qe()),a[25]!==1&&a[4].length>1?o?(o.p(a,u),u[0]&33554448&&se(o,1)):(o=Wy(a),o.c(),se(o,1),o.m(n.parentNode,n)):o&&(Je(),de(o,1,1,()=>{o=null}),Qe())},i(a){r||(se(i),se(o),r=!0)},o(a){de(i),de(o),r=!1},d(a){i&&i.d(a),a&&B(e),o&&o.d(a),a&&B(n)}}}function lP(t){let e,n=t[69]["disabled-icon"],r=Hr(n,t,t[108],My),i=r||cP(t);return{c(){i&&i.c()},m(o,a){i&&i.m(o,a),e=!0},p(o,a){r&&r.p&&(!e||a[3]&32768)&&Vr(r,n,o,o[108],e?qr(n,o[108],a,X6):Kr(o[108]),My)},i(o){e||(se(i,o),e=!0)},o(o){de(i,o),e=!1},d(o){i&&i.d(o)}}}function Yy(t){let e,n,r;function i(a){t[94](a)}let o={angle:20,$$slots:{default:[uP]},$$scope:{ctx:t}};return t[42]!==void 0&&(o.wiggle=t[42]),e=new kh({props:o}),Ne.push(()=>tt(e,"wiggle",i)),{c(){ct(e.$$.fragment)},m(a,u){ut(e,a,u),r=!0},p(a,u){let f={};u[0]&234881040|u[3]&32768&&(f.$$scope={dirty:u,ctx:a}),!n&&u[1]&2048&&(n=!0,f.wiggle=a[42],et(()=>n=!1)),e.$set(f)},i(a){r||(se(e.$$.fragment,a),r=!0)},o(a){de(e.$$.fragment,a),r=!1},d(a){st(e,a)}}}function uP(t){var o;let e,n=((o=t[26])==null?void 0:o.call(t,t[4].length,t[25]))+"",r,i;return{c(){e=N("span"),r=Me(n),k(e,"class",i="max-select-msg "+t[27]+" svelte-1h68wu3")},m(a,u){G(a,e,u),A(e,r)},p(a,u){var f;u[0]&100663312&&n!==(n=((f=a[26])==null?void 0:f.call(a,a[4].length,a[25]))+"")&&Ye(r,n),u[0]&134217728&&i!==(i="max-select-msg "+a[27]+" svelte-1h68wu3")&&k(e,"class",i)},d(a){a&&B(e)}}}function Wy(t){let e,n,r,i,o=t[69]["remove-icon"],a=Hr(o,t,t[108],Oy),u=a||fP(t);return{c(){e=N("button"),u&&u.c(),k(e,"type","button"),k(e,"class","remove remove-all svelte-1h68wu3"),k(e,"title",t[34])},m(f,c){G(f,e,c),u&&u.m(e,null),n=!0,r||(i=[oe(e,"mouseup",si(t[53])),oe(e,"keydown",t[54](t[53]))],r=!0)},p(f,c){a&&a.p&&(!n||c[3]&32768)&&Vr(a,o,f,f[108],n?qr(o,f[108],c,Z6):Kr(f[108]),Oy),(!n||c[1]&8)&&k(e,"title",f[34])},i(f){n||(se(u,f),n=!0)},o(f){de(u,f),n=!1},d(f){f&&B(e),u&&u.d(f),r=!1,We(i)}}}function fP(t){let e,n;return e=new $f({props:{width:"15px"}}),{c(){ct(e.$$.fragment)},m(r,i){ut(e,r,i),n=!0},p:me,i(r){n||(se(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){st(e,r)}}}function cP(t){let e,n;return e=new bh({props:{width:"14pt",style:"margin: 0 2pt;","data-name":"disabled-icon"}}),{c(){ct(e.$$.fragment)},m(r,i){ut(e,r,i),n=!0},p:me,i(r){n||(se(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){st(e,r)}}}function jy(t){let e,n,r,i=t[1],o=[];for(let f=0;f<i.length;f+=1)o[f]=Gy(Cy(t,i,f));let a=f=>de(o[f],1,1,()=>{o[f]=null}),u=null;return i.length||(u=By(t)),{c(){e=N("ul");for(let f=0;f<o.length;f+=1)o[f].c();u&&u.c(),k(e,"class",n="options "+t[39]+" svelte-1h68wu3"),we(e,"hidden",!t[8])},m(f,c){G(f,e,c);for(let p=0;p<o.length;p+=1)o[p]&&o[p].m(e,null);u&&u.m(e,null),t[106](e),r=!0},p(f,c){if(c[0]&543394843|c[1]&462849|c[3]&32768){i=f[1];let p;for(p=0;p<i.length;p+=1){let h=Cy(f,i,p);o[p]?(o[p].p(h,c),se(o[p],1)):(o[p]=Gy(h),o[p].c(),se(o[p],1),o[p].m(e,null))}for(Je(),p=i.length;p<o.length;p+=1)a(p);Qe(),!i.length&&u?u.p(f,c):i.length?u&&(u.d(1),u=null):(u=By(f),u.c(),u.m(e,null))}(!r||c[1]&256&&n!==(n="options "+f[39]+" svelte-1h68wu3"))&&k(e,"class",n),(!r||c[0]&256|c[1]&256)&&we(e,"hidden",!f[8])},i(f){if(!r){for(let c=0;c<i.length;c+=1)se(o[c]);r=!0}},o(f){o=o.filter(q6);for(let c=0;c<o.length;c+=1)de(o[c]);r=!1},d(f){f&&B(e),At(o,f),u&&u.d(),t[106](null)}}}function By(t){let e;function n(o,a){return o[11]&&o[3]?pP:dP}let r=n(t,[-1,-1,-1,-1]),i=r(t);return{c(){i.c(),e=zt()},m(o,a){i.m(o,a),G(o,e,a)},p(o,a){r===(r=n(o,a))&&i?i.p(o,a):(i.d(1),i=r(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&B(e)}}}function dP(t){let e,n;return{c(){e=N("span"),n=Me(t[29]),k(e,"class","svelte-1h68wu3")},m(r,i){G(r,e,i),A(e,n)},p(r,i){i[0]&536870912&&Ye(n,r[29])},d(r){r&&B(e)}}}function pP(t){let e,n=(!t[17]&&t[4].some(t[100])?t[16]:t[10])+"",r,i,o,a;return{c(){e=N("li"),r=Me(n),i=$(),k(e,"title",t[10]),k(e,"class","svelte-1h68wu3"),we(e,"active",t[43])},m(u,f){G(u,e,f),A(e,r),A(e,i),o||(a=[oe(e,"mousedown",si(t[71])),oe(e,"mouseup",si(t[101])),oe(e,"mouseover",t[102]),oe(e,"focus",t[103]),oe(e,"mouseout",t[104]),oe(e,"blur",t[105])],o=!0)},p(u,f){f[0]&230424&&n!==(n=(!u[17]&&u[4].some(u[100])?u[16]:u[10])+"")&&Ye(r,n),f[0]&1024&&k(e,"title",u[10]),f[1]&4096&&we(e,"active",u[43])},d(u){u&&B(e),o=!1,We(a)}}}function hP(t){let e=t[48](t[111])+"",n;return{c(){n=Me(e)},m(r,i){G(r,n,i)},p(r,i){i[0]&2&&e!==(e=r[48](r[111])+"")&&Ye(n,e)},d(r){r&&B(n)}}}function mP(t){let e,n=t[48](t[111])+"",r;return{c(){e=new Xu(!1),r=zt(),e.a=r},m(i,o){e.m(n,i,o),G(i,r,o)},p(i,o){o[0]&2&&n!==(n=i[48](i[111])+"")&&e.p(n)},d(i){i&&B(r),i&&e.d()}}}function gP(t){let e;function n(o,a){return o[31]?mP:hP}let r=n(t,[-1,-1,-1,-1]),i=r(t);return{c(){i.c(),e=zt()},m(o,a){i.m(o,a),G(o,e,a)},p(o,a){r===(r=n(o,a))&&i?i.p(o,a):(i.d(1),i=r(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&B(e)}}}function Gy(t){let e,n,r,i,o,a,u,f=t[69].option,c=Hr(f,t,t[108],Dy),p=c||gP(t);function h(...v){return t[95](t[41],t[112],...v)}function m(){return t[96](t[41],t[118])}function _(){return t[97](t[41],t[118])}return{c(){e=N("li"),p&&p.c(),n=$(),k(e,"title",r=t[41]?t[115]:t[47](t[112])&&t[114]||t[113]),k(e,"class",i=""+(t[22]+" "+(t[116]?t[21]:"")+" svelte-1h68wu3")),we(e,"selected",t[47](t[112])),we(e,"active",t[116]),we(e,"disabled",t[41])},m(v,b){G(v,e,b),p&&p.m(e,null),A(e,n),o=!0,a||(u=[oe(e,"mousedown",si(t[70])),oe(e,"mouseup",si(h)),oe(e,"mouseover",m),oe(e,"focus",_),oe(e,"mouseout",t[98]),oe(e,"blur",t[99])],a=!0)},p(v,b){t=v,c?c.p&&(!o||b[0]&2|b[3]&32768)&&Vr(c,f,t,t[108],o?qr(f,t[108],b,K6):Kr(t[108]),Dy):p&&p.p&&(!o||b[0]&2|b[1]&1)&&p.p(t,o?b:[-1,-1,-1,-1]),(!o||b[0]&2|b[1]&65536&&r!==(r=t[41]?t[115]:t[47](t[112])&&t[114]||t[113]))&&k(e,"title",r),(!o||b[0]&6291457&&i!==(i=""+(t[22]+" "+(t[116]?t[21]:"")+" svelte-1h68wu3")))&&k(e,"class",i),(!o||b[0]&6291459|b[1]&65536)&&we(e,"selected",t[47](t[112])),(!o||b[0]&6291457)&&we(e,"active",t[116]),(!o||b[0]&6291459)&&we(e,"disabled",t[41])},i(v){o||(se(p,v),o=!0)},o(v){de(p,v),o=!1},d(v){v&&B(e),p&&p.d(v),a=!1,We(u)}}}function _P(t){var re;let e,n,r,i,o,a,u,f=[],c=new Map,p,h,m,_,v,b,E,y,O,D,F,P,L,R,M,H;ln(t[86]);let le=t[69]["expand-icon"],V=Hr(le,t,t[108],Iy),X=V||tP(t),K=t[4],ce=Y=>Y[48](Y[111]);for(let Y=0;Y<K.length;Y+=1){let z=Py(t,K,Y),ee=ce(z);c.set(ee,f[Y]=Ly(ee,z))}let S=t[24]&&Fy(t),Q=[lP,aP],j=[];function U(Y,z){return Y[41]?0:Y[4].length>0?1:-1}~(O=U(t,[-1,-1,-1,-1]))&&(D=j[O]=Q[O](t));let J=(t[3]&&t[29]||((re=t[2])==null?void 0:re.length)>0)&&jy(t);return{c(){e=N("div"),n=N("input"),o=$(),X&&X.c(),a=$(),u=N("ul");for(let Y=0;Y<f.length;Y+=1)f[Y].c();p=$(),h=N("input"),E=$(),S&&S.c(),y=$(),D&&D.c(),F=$(),J&&J.c(),k(n,"name",t[28]),n.required=r=Boolean(t[37]),n.value=i=t[4].length>=t[37]?JSON.stringify(t[4]):null,k(n,"tabindex","-1"),k(n,"aria-hidden","true"),k(n,"aria-label","ignore this, used only to prevent form submission if select is required but empty"),k(n,"class","form-control svelte-1h68wu3"),k(h,"class",m=""+(en(t[19])+" svelte-1h68wu3")),k(h,"id",t[18]),h.disabled=t[41],k(h,"autocomplete",t[12]),k(h,"inputmode",t[20]),k(h,"pattern",t[32]),k(h,"placeholder",_=t[4].length==0?t[33]:null),k(h,"aria-invalid",v=t[7]?"true":null),k(h,"ondrop","return false"),k(u,"class",b="selected "+t[40]+" svelte-1h68wu3"),k(u,"aria-label","selected options"),k(e,"class",P="multiselect "+t[30]+" svelte-1h68wu3"),k(e,"title",L=t[41]?t[14]:null),k(e,"data-id",t[18]),we(e,"disabled",t[41]),we(e,"single",t[25]===1),we(e,"open",t[8]),we(e,"invalid",t[7])},m(Y,z){G(Y,e,z),A(e,n),t[87](n),A(e,o),X&&X.m(e,null),A(e,a),A(e,u);for(let ee=0;ee<f.length;ee+=1)f[ee]&&f[ee].m(u,null);A(u,p),A(u,h),t[92](h),er(h,t[3]),A(e,E),S&&S.m(e,null),A(e,y),~O&&j[O].m(e,null),A(e,F),J&&J.m(e,null),t[107](e),R=!0,M||(H=[oe(window,"click",t[55]),oe(window,"touchstart",t[55]),oe(window,"resize",t[86]),oe(n,"invalid",t[88]),oe(h,"input",t[93]),oe(h,"mouseup",D1(si(t[51]))),oe(h,"keydown",si(t[52])),oe(h,"focus",t[72]),oe(h,"focus",t[51]),oe(h,"input",t[58]),oe(h,"blur",t[73]),oe(h,"change",t[74]),oe(h,"click",t[75]),oe(h,"keydown",t[76]),oe(h,"keyup",t[77]),oe(h,"mousedown",t[78]),oe(h,"mouseenter",t[79]),oe(h,"mouseleave",t[80]),oe(h,"touchcancel",t[81]),oe(h,"touchend",t[82]),oe(h,"touchmove",t[83]),oe(h,"touchstart",t[84]),oe(e,"mouseup",si(t[51]))],M=!0)},p(Y,z){var _e;if((!R||z[0]&268435456)&&k(n,"name",Y[28]),(!R||z[1]&64&&r!==(r=Boolean(Y[37])))&&(n.required=r),(!R||z[0]&16|z[1]&64&&i!==(i=Y[4].length>=Y[37]?JSON.stringify(Y[4]):null)&&n.value!==i)&&(n.value=i),V&&V.p&&(!R||z[0]&256|z[3]&32768)&&Vr(V,le,Y,Y[108],R?qr(le,Y[108],z,eP):Kr(Y[108]),Iy),z[0]&8388624|z[1]&109724849|z[3]&32768){K=Y[4],Je();for(let Ce=0;Ce<f.length;Ce+=1)f[Ce].r();f=Zs(f,z,ce,1,Y,K,c,u,W1,Ly,p,Py);for(let Ce=0;Ce<f.length;Ce+=1)f[Ce].a();Qe()}(!R||z[0]&524288&&m!==(m=""+(en(Y[19])+" svelte-1h68wu3")))&&k(h,"class",m),(!R||z[0]&262144)&&k(h,"id",Y[18]),(!R||z[1]&1024)&&(h.disabled=Y[41]),(!R||z[0]&4096)&&k(h,"autocomplete",Y[12]),(!R||z[0]&1048576)&&k(h,"inputmode",Y[20]),(!R||z[1]&2)&&k(h,"pattern",Y[32]),(!R||z[0]&16|z[1]&4&&_!==(_=Y[4].length==0?Y[33]:null))&&k(h,"placeholder",_),(!R||z[0]&128&&v!==(v=Y[7]?"true":null))&&k(h,"aria-invalid",v),z[0]&8&&h.value!==Y[3]&&er(h,Y[3]),(!R||z[1]&512&&b!==(b="selected "+Y[40]+" svelte-1h68wu3"))&&k(u,"class",b),Y[24]?S?(S.p(Y,z),z[0]&16777216&&se(S,1)):(S=Fy(Y),S.c(),se(S,1),S.m(e,y)):S&&(Je(),de(S,1,1,()=>{S=null}),Qe());let ee=O;O=U(Y,z),O===ee?~O&&j[O].p(Y,z):(D&&(Je(),de(j[ee],1,1,()=>{j[ee]=null}),Qe()),~O?(D=j[O],D?D.p(Y,z):(D=j[O]=Q[O](Y),D.c()),se(D,1),D.m(e,F)):D=null),Y[3]&&Y[29]||((_e=Y[2])==null?void 0:_e.length)>0?J?(J.p(Y,z),z[0]&536870924&&se(J,1)):(J=jy(Y),J.c(),se(J,1),J.m(e,null)):J&&(Je(),de(J,1,1,()=>{J=null}),Qe()),(!R||z[0]&1073741824&&P!==(P="multiselect "+Y[30]+" svelte-1h68wu3"))&&k(e,"class",P),(!R||z[0]&16384|z[1]&1024&&L!==(L=Y[41]?Y[14]:null))&&k(e,"title",L),(!R||z[0]&262144)&&k(e,"data-id",Y[18]),(!R||z[0]&1073741824|z[1]&1024)&&we(e,"disabled",Y[41]),(!R||z[0]&1107296256)&&we(e,"single",Y[25]===1),(!R||z[0]&1073742080)&&we(e,"open",Y[8]),(!R||z[0]&1073741952)&&we(e,"invalid",Y[7])},i(Y){if(!R){se(X,Y);for(let z=0;z<K.length;z+=1)se(f[z]);se(S),se(D),se(J),R=!0}},o(Y){de(X,Y);for(let z=0;z<f.length;z+=1)de(f[z]);de(S),de(D),de(J),R=!1},d(Y){Y&&B(e),t[87](null),X&&X.d(Y);for(let z=0;z<f.length;z+=1)f[z].d();t[92](null),S&&S.d(),~O&&j[O].d(),J&&J.d(),t[107](null),M=!1,We(H)}}}function vP(t,e,n){var zl;let r,{$$slots:i={},$$scope:o}=e,{activeIndex:a=null}=e,{activeOption:u=null}=e,{createOptionMsg:f="Create this option..."}=e,{allowUserOptions:c=!1}=e,{allowEmpty:p=!1}=e,{autocomplete:h="off"}=e,{autoScroll:m=!0}=e,{breakpoint:_=800}=e,{defaultDisabledTitle:v="This option is disabled"}=e,{disabled:b=!1}=e,{disabledInputTitle:E="This input is disabled"}=e,{duplicateFunc:y=(x,Be)=>`${Gt(x)}`.toLowerCase()===`${Gt(Be)}`.toLowerCase()}=e,{duplicateOptionMsg:O="This option is already selected"}=e,{duplicates:D=!1}=e,{filterFunc:F=(x,Be)=>Be?`${Gt(x)}`.toLowerCase().includes(Be.toLowerCase()):!0}=e,{focusInputOnSelect:P="desktop"}=e,{form_input:L=null}=e,{highlightMatches:R=!0}=e,{id:M=null}=e,{input:H=null}=e,{inputClass:le=""}=e,{inputmode:V=null}=e,{invalid:X=!1}=e,{liActiveOptionClass:K=""}=e,{liOptionClass:ce=""}=e,{liSelectedClass:S=""}=e,{loading:Q=!1}=e,{matchingOptions:j=[]}=e,{maxSelect:U=null}=e,{maxSelectMsg:J=(x,Be)=>Be>1?`${x}/${Be}`:""}=e,{maxSelectMsgClass:re=""}=e,{name:Y=null}=e,{noMatchingOptionsMsg:z="No matching options"}=e,{open:ee=!1}=e,{options:_e}=e,{outerDiv:Ce=null}=e,{outerDivClass:Fe=""}=e,{parseLabelsAsHtml:je=!1}=e,{pattern:pt=null}=e,{placeholder:ht=null}=e,{removeAllTitle:ge="Remove all"}=e,{removeBtnTitle:Ee="Remove"}=e,{minSelect:vt=null}=e,{required:Ht=!1}=e,{resetFilterOnAdd:mr=!0}=e,{searchText:rt=""}=e,{selected:Ue=(zl=_e==null?void 0:_e.filter(x=>x instanceof Object&&(x==null?void 0:x.preselected)).slice(0,U!=null?U:void 0))!=null?zl:[]}=e,{sortSelected:Vn=!1}=e,{selectedOptionsDraggable:tr=!Vn}=e,{ulOptionsClass:_n=""}=e,{ulSelectedClass:vn=""}=e,{value:Yn=null}=e,Gt=x=>x instanceof Object?(x.label===void 0&&console.error(`MultiSelect option ${JSON.stringify(x)} is an object but has no label key`),x.label):x,Wn=!1;(_e==null?void 0:_e.length)>0||(c||Q||b||p?_e=[]:console.error("MultiSelect received no options")),U!==null&&U<1&&console.error(`MultiSelect's maxSelect must be null or positive integer, got ${U}`),Array.isArray(Ue)||console.error(`MultiSelect's selected prop should always be an array, got ${Ue}`),U&&typeof Ht=="number"&&Ht>U&&console.error(`MultiSelect maxSelect=${U} < required=${Ht}, makes it impossible for users to submit a valid form`),je&&c&&console.warn("Don't combine parseLabelsAsHtml and allowUserOptions. It's susceptible to XSS attacks!"),Vn&&tr&&console.warn("MultiSelect's sortSelected and selectedOptionsDraggable should not be combined as any user re-orderings of selected options will be undone by sortSelected on component re-renders.");let Cn=hl(),yn=!1,jn;if(a!==null&&!j[a])throw`Run time error, activeIndex=${a} is out of bounds, matchingOptions.length=${j.length}`;function Kn(x,Be){U&&U>1&&Ue.length>=U&&n(42,Wn=!0),!isNaN(Number(x))&&typeof Ue.map(Gt)[0]=="number"&&(x=Number(x));let Dt=Ue.some(kt=>y(kt,x));if((U===null||U===1||Ue.length<U)&&(D||!Dt)){let kt=_e.find(Ir=>Gt(Ir)===x);if(!kt&&[!0,"append"].includes(c)&&rt.length>0&&(typeof _e[0]=="object"?kt={label:rt}:(["number","undefined"].includes(typeof _e[0])&&!isNaN(Number(rt))?kt=Number(rt):kt=rt,Cn("create",{option:kt})),c==="append"&&n(2,_e=[..._e,kt])),kt===void 0)throw`Run time error, option with label ${x} not found in options list`;if(mr&&n(3,rt=""),["",void 0,null].includes(kt)){console.error(`MultiSelect: encountered missing option with label ${x} (or option is poorly labeled)`);return}U===1?n(4,Ue=[kt]):(n(4,Ue=[...Ue,kt]),Vn===!0?n(4,Ue=Ue.sort((Ir,Da)=>{let[Ao,ti]=[Gt(Ir),Gt(Da)];return`${Ao}`.localeCompare(`${ti}`)})):typeof Vn=="function"&&n(4,Ue=Ue.sort(Vn))),Ue.length===U?ei(Be):(P===!0||P==="desktop"&&jn>_)&&(H==null||H.focus()),Cn("add",{option:kt}),Cn("change",{option:kt,type:"add"}),n(7,X=!1),L==null||L.setCustomValidity("")}}function Zn(x){if(Ue.length===0)return;let Be=Ue.find(Dt=>Gt(Dt)===x);if(Be===void 0&&c&&(Be=typeof _e[0]=="object"?{label:x}:x),Be===void 0)return console.error(`Multiselect can't remove selected option ${x}, not found in selected list`);n(4,Ue=Ue.filter(Dt=>Gt(Dt)!==x)),n(7,X=!1),L==null||L.setCustomValidity(""),Cn("remove",{option:Be}),Cn("change",{option:Be,type:"remove"})}function Hi(x){b||(n(8,ee=!0),x instanceof FocusEvent||H==null||H.focus(),Cn("open",{event:x}))}function ei(x){n(8,ee=!1),H==null||H.blur(),n(0,a=null),Cn("close",{event:x})}function Oo(x){return te(this,null,function*(){var Be;if(x.key==="Escape"||x.key==="Tab")ei(x),n(3,rt="");else if(x.key==="Enter")if(x.preventDefault(),u){let Dt=Gt(u);Ue.map(Gt).includes(Dt)?Zn(Dt):Kn(Dt,x),n(3,rt="")}else c&&rt.length>0?Kn(rt,x):Hi(x);else if(["ArrowDown","ArrowUp"].includes(x.key)){if(a===null&&j.length>0){n(0,a=0);return}else if(c&&!j.length&&rt.length>0){n(43,yn=!yn);return}else if(a===null)return;x.preventDefault();let Dt=x.key==="ArrowUp"?-1:1;if(n(0,a=(a+Dt)%j.length),a<0&&n(0,a=j.length-1),m){yield ef();let kt=document.querySelector("ul.options > li.active");kt&&((Be=kt.scrollIntoViewIfNeeded)==null||Be.call(kt))}}else x.key==="Backspace"&&Ue.length>0&&!rt?Zn(Ue.map(Gt).at(-1)):j.length>0&&n(0,a=0)})}function Mo(){n(4,Ue=[]),n(3,rt=""),Cn("removeAll",{options:Ue}),Cn("change",{options:Ue,type:"removeAll"})}let ne=x=>Be=>{["Enter","Space"].includes(Be.code)&&(Be.preventDefault(),x())};function De(x){Ce&&!Ce.contains(x.target)&&ei(x)}let bt=null,St=x=>Be=>{if(!Be.dataTransfer)return;Be.dataTransfer.dropEffect="move";let Dt=parseInt(Be.dataTransfer.getData("text/plain")),kt=[...Ue];Dt<x?(kt.splice(x+1,0,kt[Dt]),kt.splice(Dt,1)):(kt.splice(x,0,kt[Dt]),kt.splice(Dt+1,1)),n(4,Ue=kt),n(45,bt=null)},nr=x=>Be=>{!Be.dataTransfer||(Be.dataTransfer.effectAllowed="move",Be.dataTransfer.dropEffect="move",Be.dataTransfer.setData("text/plain",`${x}`))},_i;function ps(x){var Ao;if(!R||typeof CSS=="undefined"||!CSS.highlights)return;CSS.highlights.clear();let Be=(Ao=x==null?void 0:x.target)==null?void 0:Ao.value.trim().toLowerCase();if(!Be)return;let Dt=document.createTreeWalker(_i,NodeFilter.SHOW_TEXT),kt=[],Ir=Dt.nextNode();for(;Ir;)kt.push(Ir),Ir=Dt.nextNode();let Da=kt.map(ti=>{let Oa=ti.textContent.toLowerCase(),Hl=[],_s=0;for(;_s<Oa.length;){let vi=Oa.indexOf(Be,_s);if(vi===-1)break;Hl.push(vi),_s=vi+Be.length}return Hl.map(vi=>{let Po=new Range;return Po.setStart(ti,vi),Po.setEnd(ti,vi+Be.length),Po})});CSS.highlights.set("search-results",new Highlight(...Da.flat()))}function hs(x){Mn.call(this,t,x)}function Tc(x){Mn.call(this,t,x)}function Sc(x){Mn.call(this,t,x)}function Cc(x){Mn.call(this,t,x)}function Dc(x){Mn.call(this,t,x)}function Wl(x){Mn.call(this,t,x)}function Oc(x){Mn.call(this,t,x)}function Mc(x){Mn.call(this,t,x)}function Ac(x){Mn.call(this,t,x)}function Sa(x){Mn.call(this,t,x)}function Pc(x){Mn.call(this,t,x)}function Ca(x){Mn.call(this,t,x)}function Nc(x){Mn.call(this,t,x)}function xc(x){Mn.call(this,t,x)}function Ic(x){Mn.call(this,t,x)}function Rc(x){Mn.call(this,t,x)}function Lc(){n(44,jn=window.innerWidth)}function Fc(x){Ne[x?"unshift":"push"](()=>{L=x,n(5,L)})}let Yc=()=>{n(7,X=!0);let x;U&&U>1&&Ht>1?x=`Please select between ${Ht} and ${U} options`:Ht>1?x=`Please select at least ${Ht} options`:x="Please select an option",L==null||L.setCustomValidity(x)},Wc=x=>Zn(Gt(x)),jl=x=>Zn(Gt(x)),jc=x=>n(45,bt=x);function Bc(x){Ne[x?"unshift":"push"](()=>{H=x,n(6,H)})}function Gc(){rt=this.value,n(3,rt)}function Uc(x){Wn=x,n(42,Wn)}let zc=(x,Be,Dt)=>{x||Kn(Be,Dt)},Hc=(x,Be)=>{x||n(0,a=Be)},ms=(x,Be)=>{x||n(0,a=Be)},qc=()=>n(0,a=null),gs=()=>n(0,a=null),Vc=x=>y(x,rt),Kc=x=>Kn(rt,x),Zc=()=>n(43,yn=!0),Bl=()=>n(43,yn=!0),Gl=()=>n(43,yn=!1),Ul=()=>n(43,yn=!1);function Xc(x){Ne[x?"unshift":"push"](()=>{_i=x,n(46,_i)})}function Jc(x){Ne[x?"unshift":"push"](()=>{Ce=x,n(9,Ce)})}return t.$$set=x=>{"activeIndex"in x&&n(0,a=x.activeIndex),"activeOption"in x&&n(59,u=x.activeOption),"createOptionMsg"in x&&n(10,f=x.createOptionMsg),"allowUserOptions"in x&&n(11,c=x.allowUserOptions),"allowEmpty"in x&&n(61,p=x.allowEmpty),"autocomplete"in x&&n(12,h=x.autocomplete),"autoScroll"in x&&n(62,m=x.autoScroll),"breakpoint"in x&&n(63,_=x.breakpoint),"defaultDisabledTitle"in x&&n(13,v=x.defaultDisabledTitle),"disabled"in x&&n(41,b=x.disabled),"disabledInputTitle"in x&&n(14,E=x.disabledInputTitle),"duplicateFunc"in x&&n(15,y=x.duplicateFunc),"duplicateOptionMsg"in x&&n(16,O=x.duplicateOptionMsg),"duplicates"in x&&n(17,D=x.duplicates),"filterFunc"in x&&n(64,F=x.filterFunc),"focusInputOnSelect"in x&&n(65,P=x.focusInputOnSelect),"form_input"in x&&n(5,L=x.form_input),"highlightMatches"in x&&n(66,R=x.highlightMatches),"id"in x&&n(18,M=x.id),"input"in x&&n(6,H=x.input),"inputClass"in x&&n(19,le=x.inputClass),"inputmode"in x&&n(20,V=x.inputmode),"invalid"in x&&n(7,X=x.invalid),"liActiveOptionClass"in x&&n(21,K=x.liActiveOptionClass),"liOptionClass"in x&&n(22,ce=x.liOptionClass),"liSelectedClass"in x&&n(23,S=x.liSelectedClass),"loading"in x&&n(24,Q=x.loading),"matchingOptions"in x&&n(1,j=x.matchingOptions),"maxSelect"in x&&n(25,U=x.maxSelect),"maxSelectMsg"in x&&n(26,J=x.maxSelectMsg),"maxSelectMsgClass"in x&&n(27,re=x.maxSelectMsgClass),"name"in x&&n(28,Y=x.name),"noMatchingOptionsMsg"in x&&n(29,z=x.noMatchingOptionsMsg),"open"in x&&n(8,ee=x.open),"options"in x&&n(2,_e=x.options),"outerDiv"in x&&n(9,Ce=x.outerDiv),"outerDivClass"in x&&n(30,Fe=x.outerDivClass),"parseLabelsAsHtml"in x&&n(31,je=x.parseLabelsAsHtml),"pattern"in x&&n(32,pt=x.pattern),"placeholder"in x&&n(33,ht=x.placeholder),"removeAllTitle"in x&&n(34,ge=x.removeAllTitle),"removeBtnTitle"in x&&n(35,Ee=x.removeBtnTitle),"minSelect"in x&&n(36,vt=x.minSelect),"required"in x&&n(37,Ht=x.required),"resetFilterOnAdd"in x&&n(67,mr=x.resetFilterOnAdd),"searchText"in x&&n(3,rt=x.searchText),"selected"in x&&n(4,Ue=x.selected),"sortSelected"in x&&n(68,Vn=x.sortSelected),"selectedOptionsDraggable"in x&&n(38,tr=x.selectedOptionsDraggable),"ulOptionsClass"in x&&n(39,_n=x.ulOptionsClass),"ulSelectedClass"in x&&n(40,vn=x.ulSelectedClass),"value"in x&&n(60,Yn=x.value),"$$scope"in x&&n(108,o=x.$$scope)},t.$$.update=()=>{var x,Be;if(t.$$.dirty[0]&33554448){e:n(60,Yn=U===1?(x=Ue[0])!=null?x:null:Ue)}if(t.$$.dirty[0]&28|t.$$.dirty[2]&4){e:n(1,j=_e.filter(Dt=>F(Dt,rt)&&!Ue.map(Gt).includes(Gt(Dt))))}if(t.$$.dirty[0]&3){e:n(59,u=(Be=j[a!=null?a:-1])!=null?Be:null)}if(t.$$.dirty[0]&16){e:n(47,r=Dt=>Ue.map(Gt).includes(Dt))}},[a,j,_e,rt,Ue,L,H,X,ee,Ce,f,c,h,v,E,y,O,D,M,le,V,K,ce,S,Q,U,J,re,Y,z,Fe,je,pt,ht,ge,Ee,vt,Ht,tr,_n,vn,b,Wn,yn,jn,bt,_i,r,Gt,Kn,Zn,Hi,Oo,Mo,ne,De,St,nr,ps,u,Yn,p,m,_,F,P,R,mr,Vn,i,hs,Tc,Sc,Cc,Dc,Wl,Oc,Mc,Ac,Sa,Pc,Ca,Nc,xc,Ic,Rc,Lc,Fc,Yc,Wc,jl,jc,Bc,Gc,Uc,zc,Hc,ms,qc,gs,Vc,Kc,Zc,Bl,Gl,Ul,Xc,Jc,o]}var Uy=class extends ze{constructor(e){super();qe(this,e,vP,_P,Ge,{activeIndex:0,activeOption:59,createOptionMsg:10,allowUserOptions:11,allowEmpty:61,autocomplete:12,autoScroll:62,breakpoint:63,defaultDisabledTitle:13,disabled:41,disabledInputTitle:14,duplicateFunc:15,duplicateOptionMsg:16,duplicates:17,filterFunc:64,focusInputOnSelect:65,form_input:5,highlightMatches:66,id:18,input:6,inputClass:19,inputmode:20,invalid:7,liActiveOptionClass:21,liOptionClass:22,liSelectedClass:23,loading:24,matchingOptions:1,maxSelect:25,maxSelectMsg:26,maxSelectMsgClass:27,name:28,noMatchingOptionsMsg:29,open:8,options:2,outerDiv:9,outerDivClass:30,parseLabelsAsHtml:31,pattern:32,placeholder:33,removeAllTitle:34,removeBtnTitle:35,minSelect:36,required:37,resetFilterOnAdd:67,searchText:3,selected:4,sortSelected:68,selectedOptionsDraggable:38,ulOptionsClass:39,ulSelectedClass:40,value:60},V6,[-1,-1,-1,-1])}},ma=Uy;var ga=[];function zy(t,e){return{subscribe:Eh(t,e).subscribe}}function Eh(t,e=me){let n,r=new Set;function i(u){if(Ge(t,u)&&(t=u,n)){let f=!ga.length;for(let c of r)c[1](),ga.push(c,t);if(f){for(let c=0;c<ga.length;c+=2)ga[c][0](ga[c+1]);ga.length=0}}}function o(u){i(u(t))}function a(u,f=me){let c=[u,f];return r.add(c),r.size===1&&(n=e(i)||me),u(t),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:o,subscribe:a}}function Hy(t){return Object.prototype.toString.call(t)==="[object Date]"}function Th(t,e,n,r){if(typeof n=="number"||Hy(n)){let i=r-n,o=(n-e)/(t.dt||1/60),a=t.opts.stiffness*i,u=t.opts.damping*o,f=(a-u)*t.inv_mass,c=(o+f)*t.dt;return Math.abs(c)<t.opts.precision&&Math.abs(i)<t.opts.precision?r:(t.settled=!1,Hy(n)?new Date(n.getTime()+c):n+c)}else{if(Array.isArray(n))return n.map((i,o)=>Th(t,e[o],n[o],r[o]));if(typeof n=="object"){let i={};for(let o in n)i[o]=Th(t,e[o],n[o],r[o]);return i}else throw new Error(`Cannot spring ${typeof n} values`)}}function ec(t,e={}){let n=Eh(t),{stiffness:r=.15,damping:i=.8,precision:o=.01}=e,a,u,f,c=t,p=t,h=1,m=0,_=!1;function v(E,y={}){p=E;let O=f={};if(t==null||y.hard||b.stiffness>=1&&b.damping>=1)return _=!0,a=Us(),c=E,n.set(t=p),Promise.resolve();if(y.soft){let D=y.soft===!0?.5:+y.soft;m=1/(D*60),h=0}return u||(a=Us(),_=!1,u=cl(D=>{if(_)return _=!1,u=null,!1;h=Math.min(h+m,1);let F={inv_mass:h,opts:b,settled:!0,dt:(D-a)*60/1e3},P=Th(F,c,t,p);return a=D,c=t,n.set(t=P),F.settled&&(u=null),!F.settled})),new Promise(D=>{u.promise.then(()=>{O===f&&D()})})}let b={set:v,update:(E,y)=>v(E(p,t),y),subscribe:n.subscribe,stiffness:r,damping:i,precision:o};return b}function yP(t){let e,n=`rotate(${t[0].angle}deg) scale(${t[0].scale}) translate(${t[0].dx}px,
${t[0].dy}px)`,r,i=t[11].default,o=Hr(i,t,t[10],null);return{c(){e=N("span"),o&&o.c(),he(e,"transform",n)},m(a,u){G(a,e,u),o&&o.m(e,null),r=!0},p(a,[u]){o&&o.p&&(!r||u&1024)&&Vr(o,i,a,a[10],r?qr(i,a[10],u,null):Kr(a[10]),null),u&1&&n!==(n=`rotate(${a[0].angle}deg) scale(${a[0].scale}) translate(${a[0].dx}px,
${a[0].dy}px)`)&&he(e,"transform",n)},i(a){r||(se(o,a),r=!0)},o(a){de(o,a),r=!1},d(a){a&&B(e),o&&o.d(a)}}}function wP(t,e,n){let r,{$$slots:i={},$$scope:o}=e,{wiggle:a=!1}=e,{angle:u=0}=e,{scale:f=1}=e,{dx:c=0}=e,{dy:p=0}=e,{duration:h=200}=e,{stiffness:m=.05}=e,{damping:_=.1}=e,v={angle:0,scale:1,dx:0,dy:0},b=ec(v,{stiffness:m,damping:_});return Ku(t,b,E=>n(0,r=E)),t.$$set=E=>{"wiggle"in E&&n(2,a=E.wiggle),"angle"in E&&n(3,u=E.angle),"scale"in E&&n(4,f=E.scale),"dx"in E&&n(5,c=E.dx),"dy"in E&&n(6,p=E.dy),"duration"in E&&n(7,h=E.duration),"stiffness"in E&&n(8,m=E.stiffness),"damping"in E&&n(9,_=E.damping),"$$scope"in E&&n(10,o=E.$$scope)},t.$$.update=()=>{if(t.$$.dirty&132){e:a&&setTimeout(()=>n(2,a=!1),h)}if(t.$$.dirty&124){e:b.set(a?{scale:f,angle:u,dx:c,dy:p}:v)}},[r,b,a,u,f,c,p,h,m,_,o,i]}var qy=class extends ze{constructor(e){super();qe(this,e,wP,yP,Ge,{wiggle:2,angle:3,scale:4,dx:5,dy:6,duration:7,stiffness:8,damping:9})}},kh=qy;function bP(t=!0){let e=this,n=new IntersectionObserver(function([r]){let i=r.intersectionRatio;if(i<1){let o=i<=0&&t?"center":"nearest";e.scrollIntoView({block:o,inline:o})}this.disconnect()});return n.observe(this),n}var Vy;typeof Element!="undefined"&&!((Vy=Element.prototype)==null?void 0:Vy.scrollIntoViewIfNeeded)&&typeof IntersectionObserver!="undefined"&&(Element.prototype.scrollIntoViewIfNeeded=bP);function kP(t){Et(t,"svelte-1hozll4",'.switch.svelte-1hozll4.svelte-1hozll4{position:relative;display:inline-block;width:60px;height:34px}.switch.svelte-1hozll4 input.svelte-1hozll4{opacity:0;width:0;height:0}.slider.svelte-1hozll4.svelte-1hozll4{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#99a2a2;-webkit-transition:0.4s;transition:0.4s;border-radius:34px}.slider.svelte-1hozll4.svelte-1hozll4:before{position:absolute;content:"";height:26px;width:26px;left:4px;bottom:4px;background-color:#d7dada;-webkit-transition:0.4s;transition:0.4s;border-radius:50%}input.svelte-1hozll4:checked+.slider.svelte-1hozll4{background-color:#2a4f4f}input.svelte-1hozll4:checked+.slider.svelte-1hozll4{box-shadow:0 0 1px #2a4f4f}input.svelte-1hozll4:checked+.slider.svelte-1hozll4:before{-webkit-transform:translateX(26px);-ms-transform:translateX(26px);transform:translateX(26px)}')}function EP(t){let e,n,r,i,o,a;return{c(){e=N("label"),n=N("input"),r=$(),i=N("span"),k(n,"type","checkbox"),k(n,"class","svelte-1hozll4"),k(i,"class","slider svelte-1hozll4"),k(e,"class","switch svelte-1hozll4")},m(u,f){G(u,e,f),A(e,n),n.checked=t[0],A(e,r),A(e,i),o||(a=oe(n,"change",t[1]),o=!0)},p(u,[f]){f&1&&(n.checked=u[0])},i:me,o:me,d(u){u&&B(e),o=!1,a()}}}function TP(t,e,n){let{checked:r=!1}=e;function i(){r=this.checked,n(0,r)}return t.$$set=o=>{"checked"in o&&n(0,r=o.checked)},[r,i]}var Ky=class extends ze{constructor(e){super();qe(this,e,TP,EP,Ge,{checked:0},kP)}},Sh=Ky;function SP(t){Et(t,"svelte-19a3n3k",".rangeSlider{--pip:var(--range-pip, lightslategray);--pip-text:var(--range-pip-text, var(--pip));--pip-active:var(--range-pip-active, darkslategrey);--pip-active-text:var(--range-pip-active-text, var(--pip-active));--pip-hover:var(--range-pip-hover, darkslategrey);--pip-hover-text:var(--range-pip-hover-text, var(--pip-hover));--pip-in-range:var(--range-pip-in-range, var(--pip-active));--pip-in-range-text:var(--range-pip-in-range-text, var(--pip-active-text))}.rangePips{position:absolute;height:1em;left:0;right:0;bottom:-1em}.rangePips.vertical{height:auto;width:1em;left:100%;right:auto;top:0;bottom:0}.rangePips .pip{height:0.4em;position:absolute;top:0.25em;width:1px;white-space:nowrap}.rangePips.vertical .pip{height:1px;width:0.4em;left:0.25em;top:auto;bottom:auto}.rangePips .pipVal{position:absolute;top:0.4em;transform:translate(-50%, 25%)}.rangePips.vertical .pipVal{position:absolute;top:0;left:0.4em;transform:translate(25%, -50%)}.rangePips .pip{transition:all 0.15s ease}.rangePips .pipVal{transition:all 0.15s ease, font-weight 0s linear}.rangePips .pip{color:lightslategray;color:var(--pip-text);background-color:lightslategray;background-color:var(--pip)}.rangePips .pip.selected{color:darkslategrey;color:var(--pip-active-text);background-color:darkslategrey;background-color:var(--pip-active)}.rangePips.hoverable:not(.disabled) .pip:hover{color:darkslategrey;color:var(--pip-hover-text);background-color:darkslategrey;background-color:var(--pip-hover)}.rangePips .pip.in-range{color:darkslategrey;color:var(--pip-in-range-text);background-color:darkslategrey;background-color:var(--pip-in-range)}.rangePips .pip.selected{height:0.75em}.rangePips.vertical .pip.selected{height:1px;width:0.75em}.rangePips .pip.selected .pipVal{font-weight:bold;top:0.75em}.rangePips.vertical .pip.selected .pipVal{top:0;left:0.75em}.rangePips.hoverable:not(.disabled) .pip:not(.selected):hover{transition:none}.rangePips.hoverable:not(.disabled) .pip:not(.selected):hover .pipVal{transition:none;font-weight:bold}")}function Zy(t,e,n){let r=t.slice();return r[28]=e[n],r[30]=n,r}function Xy(t){let e,n,r,i,o=(t[6]==="label"||t[7]==="label")&&Jy(t);return{c(){e=N("span"),o&&o.c(),k(e,"class","pip first"),k(e,"style",n=""+(t[14]+": 0%;")),we(e,"selected",t[18](t[0])),we(e,"in-range",t[17](t[0]))},m(a,u){G(a,e,u),o&&o.m(e,null),r||(i=[oe(e,"click",function(){$t(t[21](t[0]))&&t[21](t[0]).apply(this,arguments)}),oe(e,"touchend",oi(function(){$t(t[21](t[0]))&&t[21](t[0]).apply(this,arguments)}))],r=!0)},p(a,u){t=a,t[6]==="label"||t[7]==="label"?o?o.p(t,u):(o=Jy(t),o.c(),o.m(e,null)):o&&(o.d(1),o=null),u&16384&&n!==(n=""+(t[14]+": 0%;"))&&k(e,"style",n),u&262145&&we(e,"selected",t[18](t[0])),u&131073&&we(e,"in-range",t[17](t[0]))},d(a){a&&B(e),o&&o.d(),r=!1,We(i)}}}function Jy(t){let e,n=t[12](t[16](t[0]),0,0)+"",r,i=t[10]&&Qy(t),o=t[11]&&$y(t);return{c(){e=N("span"),i&&i.c(),r=Me(n),o&&o.c(),k(e,"class","pipVal")},m(a,u){G(a,e,u),i&&i.m(e,null),A(e,r),o&&o.m(e,null)},p(a,u){a[10]?i?i.p(a,u):(i=Qy(a),i.c(),i.m(e,r)):i&&(i.d(1),i=null),u&69633&&n!==(n=a[12](a[16](a[0]),0,0)+"")&&Ye(r,n),a[11]?o?o.p(a,u):(o=$y(a),o.c(),o.m(e,null)):o&&(o.d(1),o=null)},d(a){a&&B(e),i&&i.d(),o&&o.d()}}}function Qy(t){let e,n;return{c(){e=N("span"),n=Me(t[10]),k(e,"class","pipVal-prefix")},m(r,i){G(r,e,i),A(e,n)},p(r,i){i&1024&&Ye(n,r[10])},d(r){r&&B(e)}}}function $y(t){let e,n;return{c(){e=N("span"),n=Me(t[11]),k(e,"class","pipVal-suffix")},m(r,i){G(r,e,i),A(e,n)},p(r,i){i&2048&&Ye(n,r[11])},d(r){r&&B(e)}}}function ew(t){let e,n=Array(t[20]+1),r=[];for(let i=0;i<n.length;i+=1)r[i]=ow(Zy(t,n,i));return{c(){for(let i=0;i<r.length;i+=1)r[i].c();e=zt()},m(i,o){for(let a=0;a<r.length;a+=1)r[a]&&r[a].m(i,o);G(i,e,o)},p(i,o){if(o&4120131){n=Array(i[20]+1);let a;for(a=0;a<n.length;a+=1){let u=Zy(i,n,a);r[a]?r[a].p(u,o):(r[a]=ow(u),r[a].c(),r[a].m(e.parentNode,e))}for(;a<r.length;a+=1)r[a].d(1);r.length=n.length}},d(i){At(r,i),i&&B(e)}}}function tw(t){let e,n,r,i,o,a=(t[6]==="label"||t[9]==="label")&&nw(t);return{c(){e=N("span"),a&&a.c(),n=$(),k(e,"class","pip"),k(e,"style",r=""+(t[14]+": "+t[15](t[19](t[30]))+"%;")),we(e,"selected",t[18](t[19](t[30]))),we(e,"in-range",t[17](t[19](t[30])))},m(u,f){G(u,e,f),a&&a.m(e,null),A(e,n),i||(o=[oe(e,"click",function(){$t(t[21](t[19](t[30])))&&t[21](t[19](t[30])).apply(this,arguments)}),oe(e,"touchend",oi(function(){$t(t[21](t[19](t[30])))&&t[21](t[19](t[30])).apply(this,arguments)}))],i=!0)},p(u,f){t=u,t[6]==="label"||t[9]==="label"?a?a.p(t,f):(a=nw(t),a.c(),a.m(e,n)):a&&(a.d(1),a=null),f&573440&&r!==(r=""+(t[14]+": "+t[15](t[19](t[30]))+"%;"))&&k(e,"style",r),f&786432&&we(e,"selected",t[18](t[19](t[30]))),f&655360&&we(e,"in-range",t[17](t[19](t[30])))},d(u){u&&B(e),a&&a.d(),i=!1,We(o)}}}function nw(t){let e,n=t[12](t[19](t[30]),t[30],t[15](t[19](t[30])))+"",r,i=t[10]&&rw(t),o=t[11]&&iw(t);return{c(){e=N("span"),i&&i.c(),r=Me(n),o&&o.c(),k(e,"class","pipVal")},m(a,u){G(a,e,u),i&&i.m(e,null),A(e,r),o&&o.m(e,null)},p(a,u){a[10]?i?i.p(a,u):(i=rw(a),i.c(),i.m(e,r)):i&&(i.d(1),i=null),u&561152&&n!==(n=a[12](a[19](a[30]),a[30],a[15](a[19](a[30])))+"")&&Ye(r,n),a[11]?o?o.p(a,u):(o=iw(a),o.c(),o.m(e,null)):o&&(o.d(1),o=null)},d(a){a&&B(e),i&&i.d(),o&&o.d()}}}function rw(t){let e,n;return{c(){e=N("span"),n=Me(t[10]),k(e,"class","pipVal-prefix")},m(r,i){G(r,e,i),A(e,n)},p(r,i){i&1024&&Ye(n,r[10])},d(r){r&&B(e)}}}function iw(t){let e,n;return{c(){e=N("span"),n=Me(t[11]),k(e,"class","pipVal-suffix")},m(r,i){G(r,e,i),A(e,n)},p(r,i){i&2048&&Ye(n,r[11])},d(r){r&&B(e)}}}function ow(t){let e=t[19](t[30])!==t[0]&&t[19](t[30])!==t[1],n,r=e&&tw(t);return{c(){r&&r.c(),n=zt()},m(i,o){r&&r.m(i,o),G(i,n,o)},p(i,o){o&524291&&(e=i[19](i[30])!==i[0]&&i[19](i[30])!==i[1]),e?r?r.p(i,o):(r=tw(i),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},d(i){r&&r.d(i),i&&B(n)}}}function sw(t){let e,n,r,i,o=(t[6]==="label"||t[8]==="label")&&aw(t);return{c(){e=N("span"),o&&o.c(),k(e,"class","pip last"),k(e,"style",n=""+(t[14]+": 100%;")),we(e,"selected",t[18](t[1])),we(e,"in-range",t[17](t[1]))},m(a,u){G(a,e,u),o&&o.m(e,null),r||(i=[oe(e,"click",function(){$t(t[21](t[1]))&&t[21](t[1]).apply(this,arguments)}),oe(e,"touchend",oi(function(){$t(t[21](t[1]))&&t[21](t[1]).apply(this,arguments)}))],r=!0)},p(a,u){t=a,t[6]==="label"||t[8]==="label"?o?o.p(t,u):(o=aw(t),o.c(),o.m(e,null)):o&&(o.d(1),o=null),u&16384&&n!==(n=""+(t[14]+": 100%;"))&&k(e,"style",n),u&262146&&we(e,"selected",t[18](t[1])),u&131074&&we(e,"in-range",t[17](t[1]))},d(a){a&&B(e),o&&o.d(),r=!1,We(i)}}}function aw(t){let e,n=t[12](t[16](t[1]),t[20],100)+"",r,i=t[10]&&lw(t),o=t[11]&&uw(t);return{c(){e=N("span"),i&&i.c(),r=Me(n),o&&o.c(),k(e,"class","pipVal")},m(a,u){G(a,e,u),i&&i.m(e,null),A(e,r),o&&o.m(e,null)},p(a,u){a[10]?i?i.p(a,u):(i=lw(a),i.c(),i.m(e,r)):i&&(i.d(1),i=null),u&1118210&&n!==(n=a[12](a[16](a[1]),a[20],100)+"")&&Ye(r,n),a[11]?o?o.p(a,u):(o=uw(a),o.c(),o.m(e,null)):o&&(o.d(1),o=null)},d(a){a&&B(e),i&&i.d(),o&&o.d()}}}function lw(t){let e,n;return{c(){e=N("span"),n=Me(t[10]),k(e,"class","pipVal-prefix")},m(r,i){G(r,e,i),A(e,n)},p(r,i){i&1024&&Ye(n,r[10])},d(r){r&&B(e)}}}function uw(t){let e,n;return{c(){e=N("span"),n=Me(t[11]),k(e,"class","pipVal-suffix")},m(r,i){G(r,e,i),A(e,n)},p(r,i){i&2048&&Ye(n,r[11])},d(r){r&&B(e)}}}function CP(t){let e,n,r,i=(t[6]&&t[7]!==!1||t[7])&&Xy(t),o=(t[6]&&t[9]!==!1||t[9])&&ew(t),a=(t[6]&&t[8]!==!1||t[8])&&sw(t);return{c(){e=N("div"),i&&i.c(),n=$(),o&&o.c(),r=$(),a&&a.c(),k(e,"class","rangePips"),we(e,"disabled",t[5]),we(e,"hoverable",t[4]),we(e,"vertical",t[2]),we(e,"reversed",t[3]),we(e,"focus",t[13])},m(u,f){G(u,e,f),i&&i.m(e,null),A(e,n),o&&o.m(e,null),A(e,r),a&&a.m(e,null)},p(u,[f]){u[6]&&u[7]!==!1||u[7]?i?i.p(u,f):(i=Xy(u),i.c(),i.m(e,n)):i&&(i.d(1),i=null),u[6]&&u[9]!==!1||u[9]?o?o.p(u,f):(o=ew(u),o.c(),o.m(e,r)):o&&(o.d(1),o=null),u[6]&&u[8]!==!1||u[8]?a?a.p(u,f):(a=sw(u),a.c(),a.m(e,null)):a&&(a.d(1),a=null),f&32&&we(e,"disabled",u[5]),f&16&&we(e,"hoverable",u[4]),f&4&&we(e,"vertical",u[2]),f&8&&we(e,"reversed",u[3]),f&8192&&we(e,"focus",u[13])},i:me,o:me,d(u){u&&B(e),i&&i.d(),o&&o.d(),a&&a.d()}}}function DP(t,e,n){let r,i,o,a,u,{range:f=!1}=e,{min:c=0}=e,{max:p=100}=e,{step:h=1}=e,{values:m=[(p+c)/2]}=e,{vertical:_=!1}=e,{reversed:v=!1}=e,{hoverable:b=!0}=e,{disabled:E=!1}=e,{pipstep:y=void 0}=e,{all:O=!0}=e,{first:D=void 0}=e,{last:F=void 0}=e,{rest:P=void 0}=e,{prefix:L=""}=e,{suffix:R=""}=e,{formatter:M=(S,Q)=>S}=e,{focus:H=void 0}=e,{orientationStart:le=void 0}=e,{percentOf:V=void 0}=e,{moveHandle:X=void 0}=e,{fixFloat:K=void 0}=e;function ce(S){E||X(void 0,S)}return t.$$set=S=>{"range"in S&&n(22,f=S.range),"min"in S&&n(0,c=S.min),"max"in S&&n(1,p=S.max),"step"in S&&n(23,h=S.step),"values"in S&&n(24,m=S.values),"vertical"in S&&n(2,_=S.vertical),"reversed"in S&&n(3,v=S.reversed),"hoverable"in S&&n(4,b=S.hoverable),"disabled"in S&&n(5,E=S.disabled),"pipstep"in S&&n(25,y=S.pipstep),"all"in S&&n(6,O=S.all),"first"in S&&n(7,D=S.first),"last"in S&&n(8,F=S.last),"rest"in S&&n(9,P=S.rest),"prefix"in S&&n(10,L=S.prefix),"suffix"in S&&n(11,R=S.suffix),"formatter"in S&&n(12,M=S.formatter),"focus"in S&&n(13,H=S.focus),"orientationStart"in S&&n(14,le=S.orientationStart),"percentOf"in S&&n(15,V=S.percentOf),"moveHandle"in S&&n(26,X=S.moveHandle),"fixFloat"in S&&n(16,K=S.fixFloat)},t.$$.update=()=>{if(t.$$.dirty&41943047){e:n(27,r=y||((p-c)/h>=(_?50:100)?(p-c)/(_?10:20):1))}if(t.$$.dirty&142606339){e:n(20,i=parseInt((p-c)/(h*r),10))}if(t.$$.dirty&142671873){e:n(19,o=function(S){return K(c+S*h*r)})}if(t.$$.dirty&16842752){e:n(18,a=function(S){return m.some(Q=>K(Q)===K(S))})}if(t.$$.dirty&20971520){e:n(17,u=function(S){if(f==="min")return m[0]>S;if(f==="max")return m[0]<S;if(f)return m[0]<S&&m[1]>S})}},[c,p,_,v,b,E,O,D,F,P,L,R,M,H,le,V,K,u,a,o,i,ce,f,h,m,y,X,r]}var fw=class extends ze{constructor(e){super();qe(this,e,DP,CP,Ge,{range:22,min:0,max:1,step:23,values:24,vertical:2,reversed:3,hoverable:4,disabled:5,pipstep:25,all:6,first:7,last:8,rest:9,prefix:10,suffix:11,formatter:12,focus:13,orientationStart:14,percentOf:15,moveHandle:26,fixFloat:16},SP)}},cw=fw;function OP(t){Et(t,"svelte-1wc6jll",'.rangeSlider{--slider:var(--range-slider, #d7dada);--handle-inactive:var(--range-handle-inactive, #99a2a2);--handle:var(--range-handle, #838de7);--handle-focus:var(--range-handle-focus, #4a40d4);--handle-border:var(--range-handle-border, var(--handle));--range-inactive:var(--range-range-inactive, var(--handle-inactive));--range:var(--range-range, var(--handle-focus));--float-inactive:var(--range-float-inactive, var(--handle-inactive));--float:var(--range-float, var(--handle-focus));--float-text:var(--range-float-text, white)}.rangeSlider{position:relative;border-radius:100px;height:0.5em;margin:1em;transition:opacity 0.2s ease;user-select:none}.rangeSlider *{user-select:none}.rangeSlider.pips{margin-bottom:1.8em}.rangeSlider.pip-labels{margin-bottom:2.8em}.rangeSlider.vertical{display:inline-block;border-radius:100px;width:0.5em;min-height:200px}.rangeSlider.vertical.pips{margin-right:1.8em;margin-bottom:1em}.rangeSlider.vertical.pip-labels{margin-right:2.8em;margin-bottom:1em}.rangeSlider .rangeHandle{position:absolute;display:block;height:1.4em;width:1.4em;top:0.25em;bottom:auto;transform:translateY(-50%) translateX(-50%);outline-offset:2px;outline:2px solid transparent;border-radius:100px;z-index:2}.rangeSlider.reversed .rangeHandle{transform:translateY(-50%) translateX(50%)}.rangeSlider.vertical .rangeHandle{left:0.25em;top:auto;transform:translateY(50%) translateX(-50%)}.rangeSlider.vertical.reversed .rangeHandle{transform:translateY(-50%) translateX(-50%)}.rangeSlider .rangeNub,.rangeSlider .rangeHandle:before{position:absolute;left:0;top:0;display:block;border-radius:10em;height:100%;width:100%;transition:box-shadow 0.2s ease}.rangeSlider .rangeHandle:before{content:"";left:1px;top:1px;bottom:1px;right:1px;height:auto;width:auto;box-shadow:0 0 0 0px var(--handle-border);opacity:0}.rangeSlider.hoverable:not(.disabled) .rangeHandle:hover:before{box-shadow:0 0 0 8px var(--handle-border);opacity:0.2}.rangeSlider.hoverable:not(.disabled) .rangeHandle.press:before,.rangeSlider.hoverable:not(.disabled) .rangeHandle.press:hover:before{box-shadow:0 0 0 12px var(--handle-border);opacity:0.4}.rangeSlider.range .rangeNub{border-radius:10em 10em 10em 1.6em}.rangeSlider.range.min .rangeNub{border-radius:10em 1.6em 10em 10em}.rangeSlider.range .rangeHandle:nth-of-type(1) .rangeNub{transform:rotate(-135deg)}.rangeSlider.range .rangeHandle:nth-of-type(2) .rangeNub{transform:rotate(45deg)}.rangeSlider.range.reversed .rangeHandle:nth-of-type(1) .rangeNub{transform:rotate(45deg)}.rangeSlider.range.reversed .rangeHandle:nth-of-type(2) .rangeNub{transform:rotate(-135deg)}.rangeSlider.range.vertical .rangeHandle:nth-of-type(1) .rangeNub{transform:rotate(135deg)}.rangeSlider.range.vertical .rangeHandle:nth-of-type(2) .rangeNub{transform:rotate(-45deg)}.rangeSlider.range.vertical.reversed .rangeHandle:nth-of-type(1) .rangeNub{transform:rotate(-45deg)}.rangeSlider.range.vertical.reversed .rangeHandle:nth-of-type(2) .rangeNub{transform:rotate(135deg)}.rangeSlider .rangeFloat{display:block;position:absolute;left:50%;top:-0.5em;transform:translate(-50%, -100%);font-size:1em;text-align:center;opacity:0;pointer-events:none;white-space:nowrap;transition:all 0.2s ease;font-size:0.9em;padding:0.2em 0.4em;border-radius:0.2em}.rangeSlider .rangeHandle.active .rangeFloat,.rangeSlider.hoverable .rangeHandle:hover .rangeFloat{opacity:1;top:-0.2em;transform:translate(-50%, -100%)}.rangeSlider .rangeHandle.active:focus-visible .rangeFloat{top:-0.35em}.rangeSlider .rangeBar{position:absolute;display:block;transition:background 0.2s ease;border-radius:1em;height:0.5em;top:0;user-select:none;z-index:1}.rangeSlider.vertical .rangeBar{width:0.5em;height:auto}.rangeSlider{background-color:#d7dada;background-color:var(--slider)}.rangeSlider .rangeBar{background-color:#99a2a2;background-color:var(--range-inactive)}.rangeSlider.focus .rangeBar{background-color:#838de7;background-color:var(--range)}.rangeSlider .rangeNub{background-color:#99a2a2;background-color:var(--handle-inactive)}.rangeSlider.focus .rangeNub{background-color:#838de7;background-color:var(--handle)}.rangeSlider .rangeHandle.active .rangeNub{background-color:#4a40d4;background-color:var(--handle-focus)}.rangeSlider .rangeFloat{color:white;color:var(--float-text);background-color:#99a2a2;background-color:var(--float-inactive)}.rangeSlider.focus .rangeFloat{background-color:#4a40d4;background-color:var(--float)}.rangeSlider.disabled{opacity:0.5}.rangeSlider.disabled .rangeNub{background-color:#d7dada;background-color:var(--slider)}.rangeSlider .rangeHandle:focus{outline:none}.rangeSlider .rangeHandle:focus-visible{outline:2px solid #334}@supports not selector(:focus-visible){.rangeSlider .rangeHandle:focus{outline:1px solid #334;outline-offset:1px}}')}function dw(t,e,n){let r=t.slice();return r[64]=e[n],r[66]=n,r}function pw(t){let e,n=t[21](t[64],t[66],t[23](t[64]))+"",r,i=t[18]&&hw(t),o=t[19]&&mw(t);return{c(){e=N("span"),i&&i.c(),r=Me(n),o&&o.c(),k(e,"class","rangeFloat")},m(a,u){G(a,e,u),i&&i.m(e,null),A(e,r),o&&o.m(e,null)},p(a,u){a[18]?i?i.p(a,u):(i=hw(a),i.c(),i.m(e,r)):i&&(i.d(1),i=null),u[0]&10485761&&n!==(n=a[21](a[64],a[66],a[23](a[64]))+"")&&Ye(r,n),a[19]?o?o.p(a,u):(o=mw(a),o.c(),o.m(e,null)):o&&(o.d(1),o=null)},d(a){a&&B(e),i&&i.d(),o&&o.d()}}}function hw(t){let e,n;return{c(){e=N("span"),n=Me(t[18]),k(e,"class","rangeFloat-prefix")},m(r,i){G(r,e,i),A(e,n)},p(r,i){i[0]&262144&&Ye(n,r[18])},d(r){r&&B(e)}}}function mw(t){let e,n;return{c(){e=N("span"),n=Me(t[19]),k(e,"class","rangeFloat-suffix")},m(r,i){G(r,e,i),A(e,n)},p(r,i){i[0]&524288&&Ye(n,r[19])},d(r){r&&B(e)}}}function gw(t){let e,n,r,i,o,a,u,f,c,p,h,m,_,v=t[7]&&pw(t);return{c(){e=N("span"),n=N("span"),r=$(),v&&v.c(),k(n,"class","rangeNub"),k(e,"role","slider"),k(e,"class","rangeHandle"),k(e,"data-handle",i=t[66]),k(e,"style",o=""+(t[28]+": "+t[29][t[66]]+"%; z-index: "+(t[26]===t[66]?3:2)+";")),k(e,"aria-valuemin",a=t[2]===!0&&t[66]===1?t[0][0]:t[3]),k(e,"aria-valuemax",u=t[2]===!0&&t[66]===0?t[0][1]:t[4]),k(e,"aria-valuenow",f=t[64]),k(e,"aria-valuetext",c=""+(t[18]+t[21](t[64],t[66],t[23](t[64]))+t[19])),k(e,"aria-orientation",p=t[6]?"vertical":"horizontal"),k(e,"aria-disabled",t[10]),k(e,"disabled",t[10]),k(e,"tabindex",h=t[10]?-1:0),we(e,"active",t[24]&&t[26]===t[66]),we(e,"press",t[25]&&t[26]===t[66])},m(b,E){G(b,e,E),A(e,n),A(e,r),v&&v.m(e,null),m||(_=[oe(e,"blur",t[34]),oe(e,"focus",t[35]),oe(e,"keydown",t[36])],m=!0)},p(b,E){b[7]?v?v.p(b,E):(v=pw(b),v.c(),v.m(e,null)):v&&(v.d(1),v=null),E[0]&872415232&&o!==(o=""+(b[28]+": "+b[29][b[66]]+"%; z-index: "+(b[26]===b[66]?3:2)+";"))&&k(e,"style",o),E[0]&13&&a!==(a=b[2]===!0&&b[66]===1?b[0][0]:b[3])&&k(e,"aria-valuemin",a),E[0]&21&&u!==(u=b[2]===!0&&b[66]===0?b[0][1]:b[4])&&k(e,"aria-valuemax",u),E[0]&1&&f!==(f=b[64])&&k(e,"aria-valuenow",f),E[0]&11272193&&c!==(c=""+(b[18]+b[21](b[64],b[66],b[23](b[64]))+b[19]))&&k(e,"aria-valuetext",c),E[0]&64&&p!==(p=b[6]?"vertical":"horizontal")&&k(e,"aria-orientation",p),E[0]&1024&&k(e,"aria-disabled",b[10]),E[0]&1024&&k(e,"disabled",b[10]),E[0]&1024&&h!==(h=b[10]?-1:0)&&k(e,"tabindex",h),E[0]&83886080&&we(e,"active",b[24]&&b[26]===b[66]),E[0]&100663296&&we(e,"press",b[25]&&b[26]===b[66])},d(b){b&&B(e),v&&v.d(),m=!1,We(_)}}}function _w(t){let e,n;return{c(){e=N("span"),k(e,"class","rangeBar"),k(e,"style",n=""+(t[28]+": "+t[32](t[29])+"%; "+t[27]+": "+t[33](t[29])+"%;"))},m(r,i){G(r,e,i)},p(r,i){i[0]&939524096&&n!==(n=""+(r[28]+": "+r[32](r[29])+"%; "+r[27]+": "+r[33](r[29])+"%;"))&&k(e,"style",n)},d(r){r&&B(e)}}}function vw(t){let e,n;return e=new cw({props:{values:t[0],min:t[3],max:t[4],step:t[5],range:t[2],vertical:t[6],reversed:t[8],orientationStart:t[28],hoverable:t[9],disabled:t[10],all:t[13],first:t[14],last:t[15],rest:t[16],pipstep:t[12],prefix:t[18],suffix:t[19],formatter:t[20],focus:t[24],percentOf:t[23],moveHandle:t[31],fixFloat:t[30]}}),{c(){ct(e.$$.fragment)},m(r,i){ut(e,r,i),n=!0},p(r,i){let o={};i[0]&1&&(o.values=r[0]),i[0]&8&&(o.min=r[3]),i[0]&16&&(o.max=r[4]),i[0]&32&&(o.step=r[5]),i[0]&4&&(o.range=r[2]),i[0]&64&&(o.vertical=r[6]),i[0]&256&&(o.reversed=r[8]),i[0]&268435456&&(o.orientationStart=r[28]),i[0]&512&&(o.hoverable=r[9]),i[0]&1024&&(o.disabled=r[10]),i[0]&8192&&(o.all=r[13]),i[0]&16384&&(o.first=r[14]),i[0]&32768&&(o.last=r[15]),i[0]&65536&&(o.rest=r[16]),i[0]&4096&&(o.pipstep=r[12]),i[0]&262144&&(o.prefix=r[18]),i[0]&524288&&(o.suffix=r[19]),i[0]&1048576&&(o.formatter=r[20]),i[0]&16777216&&(o.focus=r[24]),i[0]&8388608&&(o.percentOf=r[23]),e.$set(o)},i(r){n||(se(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){st(e,r)}}}function MP(t){let e,n,r,i,o,a,u=t[0],f=[];for(let h=0;h<u.length;h+=1)f[h]=gw(dw(t,u,h));let c=t[2]&&_w(t),p=t[11]&&vw(t);return{c(){e=N("div");for(let h=0;h<f.length;h+=1)f[h].c();n=$(),c&&c.c(),r=$(),p&&p.c(),k(e,"id",t[17]),k(e,"class","rangeSlider"),we(e,"range",t[2]),we(e,"disabled",t[10]),we(e,"hoverable",t[9]),we(e,"vertical",t[6]),we(e,"reversed",t[8]),we(e,"focus",t[24]),we(e,"min",t[2]==="min"),we(e,"max",t[2]==="max"),we(e,"pips",t[11]),we(e,"pip-labels",t[13]==="label"||t[14]==="label"||t[15]==="label"||t[16]==="label")},m(h,m){G(h,e,m);for(let _=0;_<f.length;_+=1)f[_]&&f[_].m(e,null);A(e,n),c&&c.m(e,null),A(e,r),p&&p.m(e,null),t[50](e),i=!0,o||(a=[oe(window,"mousedown",t[39]),oe(window,"touchstart",t[39]),oe(window,"mousemove",t[40]),oe(window,"touchmove",t[40]),oe(window,"mouseup",t[41]),oe(window,"touchend",t[42]),oe(window,"keydown",t[43]),oe(e,"mousedown",t[37]),oe(e,"mouseup",t[38]),oe(e,"touchstart",oi(t[37])),oe(e,"touchend",oi(t[38]))],o=!0)},p(h,m){if(m[0]&934020317|m[1]&56){u=h[0];let _;for(_=0;_<u.length;_+=1){let v=dw(h,u,_);f[_]?f[_].p(v,m):(f[_]=gw(v),f[_].c(),f[_].m(e,n))}for(;_<f.length;_+=1)f[_].d(1);f.length=u.length}h[2]?c?c.p(h,m):(c=_w(h),c.c(),c.m(e,r)):c&&(c.d(1),c=null),h[11]?p?(p.p(h,m),m[0]&2048&&se(p,1)):(p=vw(h),p.c(),se(p,1),p.m(e,null)):p&&(Je(),de(p,1,1,()=>{p=null}),Qe()),(!i||m[0]&131072)&&k(e,"id",h[17]),(!i||m[0]&4)&&we(e,"range",h[2]),(!i||m[0]&1024)&&we(e,"disabled",h[10]),(!i||m[0]&512)&&we(e,"hoverable",h[9]),(!i||m[0]&64)&&we(e,"vertical",h[6]),(!i||m[0]&256)&&we(e,"reversed",h[8]),(!i||m[0]&16777216)&&we(e,"focus",h[24]),(!i||m[0]&4)&&we(e,"min",h[2]==="min"),(!i||m[0]&4)&&we(e,"max",h[2]==="max"),(!i||m[0]&2048)&&we(e,"pips",h[11]),(!i||m[0]&122880)&&we(e,"pip-labels",h[13]==="label"||h[14]==="label"||h[15]==="label"||h[16]==="label")},i(h){i||(se(p),i=!0)},o(h){de(p),i=!1},d(h){h&&B(e),At(f,h),c&&c.d(),p&&p.d(),t[50](null),o=!1,We(a)}}}function yw(t){if(!t)return-1;for(var e=0;t=t.previousElementSibling;)e++;return e}function Ch(t){return t.type.includes("touch")?t.touches[0]:t}function AP(t,e,n){let r,i,o,a,u,f,c=me,p=()=>(c(),c=Vu(ht,ne=>n(29,f=ne)),ht);t.$$.on_destroy.push(()=>c());let{slider:h=void 0}=e,{range:m=!1}=e,{pushy:_=!1}=e,{min:v=0}=e,{max:b=100}=e,{step:E=1}=e,{values:y=[(b+v)/2]}=e,{vertical:O=!1}=e,{float:D=!1}=e,{reversed:F=!1}=e,{hoverable:P=!0}=e,{disabled:L=!1}=e,{pips:R=!1}=e,{pipstep:M=void 0}=e,{all:H=void 0}=e,{first:le=void 0}=e,{last:V=void 0}=e,{rest:X=void 0}=e,{id:K=void 0}=e,{prefix:ce=""}=e,{suffix:S=""}=e,{formatter:Q=(ne,De,bt)=>ne}=e,{handleFormatter:j=Q}=e,{precision:U=2}=e,{springValues:J={stiffness:.15,damping:.4}}=e,re=hl(),Y=0,z=!1,ee=!1,_e=!1,Ce=!1,Fe=y.length-1,je,pt,ht,ge=ne=>parseFloat(ne.toFixed(U));function Ee(ne){let De=h.querySelectorAll(".handle"),bt=Array.prototype.includes.call(De,ne),St=Array.prototype.some.call(De,nr=>nr.contains(ne));return bt||St}function vt(ne){return m==="min"||m==="max"?ne.slice(0,1):m?ne.slice(0,2):ne}function Ht(){return h.getBoundingClientRect()}function mr(ne){let De=Ht(),bt=0,St=0,nr=0;O?(bt=ne.clientY-De.top,St=bt/De.height*100,St=F?St:100-St):(bt=ne.clientX-De.left,St=bt/De.width*100,St=F?100-St:St),nr=(b-v)/100*St+v;let _i;return m===!0&&y[0]===y[1]?nr>y[1]?1:0:(_i=y.indexOf([...y].sort((ps,hs)=>Math.abs(nr-ps)-Math.abs(nr-hs))[0]),_i)}function rt(ne){let De=Ht(),bt=0,St=0,nr=0;O?(bt=ne.clientY-De.top,St=bt/De.height*100,St=F?St:100-St):(bt=ne.clientX-De.left,St=bt/De.width*100,St=F?100-St:St),nr=(b-v)/100*St+v,Ue(Fe,nr)}function Ue(ne,De){return De=o(De),typeof ne=="undefined"&&(ne=Fe),m&&(ne===0&&De>y[1]?_?n(0,y[1]=De,y):De=y[1]:ne===1&&De<y[0]&&(_?n(0,y[0]=De,y):De=y[0])),y[ne]!==De&&n(0,y[ne]=De,y),pt!==De&&(Oo(),pt=De),De}function Vn(ne){return m==="min"?0:ne[0]}function tr(ne){return m==="max"?0:m==="min"?100-ne[0]:100-ne[1]}function _n(ne){Ce&&(n(24,z=!1),ee=!1,n(25,_e=!1))}function vn(ne){L||(n(26,Fe=yw(ne.target)),n(24,z=!0))}function Yn(ne){if(!L){let De=yw(ne.target),bt=ne.ctrlKey||ne.metaKey||ne.shiftKey?E*10:E,St=!1;switch(ne.key){case"PageDown":bt*=10;case"ArrowRight":case"ArrowUp":Ue(De,y[De]+bt),St=!0;break;case"PageUp":bt*=10;case"ArrowLeft":case"ArrowDown":Ue(De,y[De]-bt),St=!0;break;case"Home":Ue(De,v),St=!0;break;case"End":Ue(De,b),St=!0;break}St&&(ne.preventDefault(),ne.stopPropagation())}}function Gt(ne){if(!L){let De=ne.target,bt=Ch(ne);n(24,z=!0),ee=!0,n(25,_e=!0),n(26,Fe=mr(bt)),je=pt=o(y[Fe]),Hi(),ne.type==="touchstart"&&!De.matches(".pipVal")&&rt(bt)}}function Wn(ne){ne.type==="touchend"&&ei(),n(25,_e=!1)}function Cn(ne){Ce=!1,z&&ne.target!==h&&!h.contains(ne.target)&&n(24,z=!1)}function yn(ne){L||ee&&rt(Ch(ne))}function jn(ne){if(!L){let De=ne.target;ee&&((De===h||h.contains(De))&&(n(24,z=!0),!Ee(De)&&!De.matches(".pipVal")&&rt(Ch(ne))),ei())}ee=!1,n(25,_e=!1)}function Kn(ne){ee=!1,n(25,_e=!1)}function Zn(ne){L||(ne.target===h||h.contains(ne.target))&&(Ce=!0)}function Hi(){!L&&re("start",{activeHandle:Fe,value:je,values:y.map(ne=>o(ne))})}function ei(){!L&&re("stop",{activeHandle:Fe,startValue:je,value:y[Fe],values:y.map(ne=>o(ne))})}function Oo(){!L&&re("change",{activeHandle:Fe,startValue:je,previousValue:typeof pt=="undefined"?je:pt,value:y[Fe],values:y.map(ne=>o(ne))})}function Mo(ne){Ne[ne?"unshift":"push"](()=>{h=ne,n(1,h)})}return t.$$set=ne=>{"slider"in ne&&n(1,h=ne.slider),"range"in ne&&n(2,m=ne.range),"pushy"in ne&&n(44,_=ne.pushy),"min"in ne&&n(3,v=ne.min),"max"in ne&&n(4,b=ne.max),"step"in ne&&n(5,E=ne.step),"values"in ne&&n(0,y=ne.values),"vertical"in ne&&n(6,O=ne.vertical),"float"in ne&&n(7,D=ne.float),"reversed"in ne&&n(8,F=ne.reversed),"hoverable"in ne&&n(9,P=ne.hoverable),"disabled"in ne&&n(10,L=ne.disabled),"pips"in ne&&n(11,R=ne.pips),"pipstep"in ne&&n(12,M=ne.pipstep),"all"in ne&&n(13,H=ne.all),"first"in ne&&n(14,le=ne.first),"last"in ne&&n(15,V=ne.last),"rest"in ne&&n(16,X=ne.rest),"id"in ne&&n(17,K=ne.id),"prefix"in ne&&n(18,ce=ne.prefix),"suffix"in ne&&n(19,S=ne.suffix),"formatter"in ne&&n(20,Q=ne.formatter),"handleFormatter"in ne&&n(21,j=ne.handleFormatter),"precision"in ne&&n(45,U=ne.precision),"springValues"in ne&&n(46,J=ne.springValues)},t.$$.update=()=>{if(t.$$.dirty[0]&24){e:n(49,i=function(ne){return ne<=v?v:ne>=b?b:ne})}if(t.$$.dirty[0]&56|t.$$.dirty[1]&262144){e:n(48,o=function(ne){if(ne<=v)return ge(v);if(ne>=b)return ge(b);let De=(ne-v)%E,bt=ne-De;return Math.abs(De)*2>=E&&(bt+=De>0?E:-E),bt=i(bt),ge(bt)})}if(t.$$.dirty[0]&24){e:n(23,r=function(ne){let De=(ne-v)/(b-v)*100;return isNaN(De)||De<=0?0:De>=100?100:ge(De)})}if(t.$$.dirty[0]&12582937|t.$$.dirty[1]&229376){e:Array.isArray(y)||(n(0,y=[(b+v)/2]),console.error("'values' prop should be an Array (https://github.com/simeydotme/svelte-range-slider-pips#slider-props)")),n(0,y=vt(y.map(ne=>o(ne)))),Y!==y.length?p(n(22,ht=ec(y.map(ne=>r(ne)),J))):ht.set(y.map(ne=>r(ne))),n(47,Y=y.length)}if(t.$$.dirty[0]&320){e:n(28,a=O?F?"top":"bottom":F?"right":"left")}if(t.$$.dirty[0]&320){e:n(27,u=O?F?"bottom":"top":F?"left":"right")}},[y,h,m,v,b,E,O,D,F,P,L,R,M,H,le,V,X,K,ce,S,Q,j,ht,r,z,_e,Fe,u,a,f,ge,Ue,Vn,tr,_n,vn,Yn,Gt,Wn,Cn,yn,jn,Kn,Zn,_,U,J,Y,o,i,Mo]}var ww=class extends ze{constructor(e){super();qe(this,e,AP,MP,Ge,{slider:1,range:2,pushy:44,min:3,max:4,step:5,values:0,vertical:6,float:7,reversed:8,hoverable:9,disabled:10,pips:11,pipstep:12,all:13,first:14,last:15,rest:16,id:17,prefix:18,suffix:19,formatter:20,handleFormatter:21,precision:45,springValues:46},OP,[-1,-1,-1])}},_a=ww;var bw=Oe(require("obsidian"));function PP(t){Et(t,"svelte-1665e1",`.settingsContainerOpen.svelte-1665e1{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:5px;border-radius:10px;padding:10px;width:auto;margin-bottom:10px;box-shadow:-5px 5px 3px 3px #161616}.settingsWrapper.svelte-1665e1{display:grid;gap:10px;grid-template-columns:1fr auto}label.svelte-1665e1{display:flex;align-items:center;height:30px;min-width:80px}.rangeSettings.svelte-1665e1{width:300px}.setting.svelte-1665e1{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:5px}.copyButton.svelte-1665e1{filter:saturate(0)
}`)}function kw(t){var Fe,je,pt,ht;let e,n,r,i,o,a,u,f,c=["day","week","year","schedule"].includes(t[0].type),p,h=["day","week","schedule"].includes(t[0].type),m,_=["day","week","schedule"].includes(t[0].type),v,b=["week","schedule"].includes(t[0].type),E,y=["day","week","month","year","schedule","web"].includes(t[0].type),O,D=["year"].includes(t[0].type),F,P,L,R=["web"].includes(t[0].type),M,H=["web"].includes(t[0].type),le,V=["web"].includes(t[0].type),X,K,ce,S=c&&Ew(t),Q=h&&Tw(t),j=_&&Sw(t),U=b&&Cw(t),J=y&&Dw(t),re=D&&Ow(t),Y=t[6]!==void 0&&(((Fe=t[7])==null?void 0:Fe.length)===0||((je=t[6])==null?void 0:je.length)>0)&&Mw(t),z=t[7]!==void 0&&(((pt=t[6])==null?void 0:pt.length)===0||((ht=t[7])==null?void 0:ht.length)>0)&&Aw(t),ee=R&&Pw(t),_e=H&&Nw(t),Ce=V&&xw(t);return{c(){e=N("div"),n=N("label"),n.textContent="Copy to Codeblock",r=$(),i=N("div"),o=N("button"),o.textContent="\u{1F4CB}",a=$(),u=N("button"),u.textContent="x",f=$(),S&&S.c(),p=$(),Q&&Q.c(),m=$(),j&&j.c(),v=$(),U&&U.c(),E=$(),J&&J.c(),O=$(),re&&re.c(),F=$(),Y&&Y.c(),P=$(),z&&z.c(),L=$(),ee&&ee.c(),M=$(),_e&&_e.c(),le=$(),Ce&&Ce.c(),k(n,"for","hourRange"),k(n,"class","svelte-1665e1"),k(o,"class","copyButton svelte-1665e1"),k(i,"class","setting svelte-1665e1"),k(e,"class","settingsWrapper svelte-1665e1")},m(ge,Ee){G(ge,e,Ee),A(e,n),A(e,r),A(e,i),A(i,o),A(i,a),A(i,u),A(e,f),S&&S.m(e,null),A(e,p),Q&&Q.m(e,null),A(e,m),j&&j.m(e,null),A(e,v),U&&U.m(e,null),A(e,E),J&&J.m(e,null),A(e,O),re&&re.m(e,null),A(e,F),Y&&Y.m(e,null),A(e,P),z&&z.m(e,null),A(e,L),ee&&ee.m(e,null),A(e,M),_e&&_e.m(e,null),A(e,le),Ce&&Ce.m(e,null),X=!0,K||(ce=[oe(o,"click",t[14]),oe(u,"click",t[15])],K=!0)},p(ge,Ee){var vt,Ht,mr,rt;Ee&1&&(c=["day","week","year","schedule"].includes(ge[0].type)),c?S?(S.p(ge,Ee),Ee&1&&se(S,1)):(S=Ew(ge),S.c(),se(S,1),S.m(e,p)):S&&(Je(),de(S,1,1,()=>{S=null}),Qe()),Ee&1&&(h=["day","week","schedule"].includes(ge[0].type)),h?Q?(Q.p(ge,Ee),Ee&1&&se(Q,1)):(Q=Tw(ge),Q.c(),se(Q,1),Q.m(e,m)):Q&&(Je(),de(Q,1,1,()=>{Q=null}),Qe()),Ee&1&&(_=["day","week","schedule"].includes(ge[0].type)),_?j?(j.p(ge,Ee),Ee&1&&se(j,1)):(j=Sw(ge),j.c(),se(j,1),j.m(e,v)):j&&(Je(),de(j,1,1,()=>{j=null}),Qe()),Ee&1&&(b=["week","schedule"].includes(ge[0].type)),b?U?(U.p(ge,Ee),Ee&1&&se(U,1)):(U=Cw(ge),U.c(),se(U,1),U.m(e,E)):U&&(Je(),de(U,1,1,()=>{U=null}),Qe()),Ee&1&&(y=["day","week","month","year","schedule","web"].includes(ge[0].type)),y?J?(J.p(ge,Ee),Ee&1&&se(J,1)):(J=Dw(ge),J.c(),se(J,1),J.m(e,O)):J&&(Je(),de(J,1,1,()=>{J=null}),Qe()),Ee&1&&(D=["year"].includes(ge[0].type)),D?re?(re.p(ge,Ee),Ee&1&&se(re,1)):(re=Ow(ge),re.c(),se(re,1),re.m(e,F)):re&&(Je(),de(re,1,1,()=>{re=null}),Qe()),ge[6]!==void 0&&(((vt=ge[7])==null?void 0:vt.length)===0||((Ht=ge[6])==null?void 0:Ht.length)>0)?Y?(Y.p(ge,Ee),Ee&192&&se(Y,1)):(Y=Mw(ge),Y.c(),se(Y,1),Y.m(e,P)):Y&&(Je(),de(Y,1,1,()=>{Y=null}),Qe()),ge[7]!==void 0&&(((mr=ge[6])==null?void 0:mr.length)===0||((rt=ge[7])==null?void 0:rt.length)>0)?z?(z.p(ge,Ee),Ee&192&&se(z,1)):(z=Aw(ge),z.c(),se(z,1),z.m(e,L)):z&&(Je(),de(z,1,1,()=>{z=null}),Qe()),Ee&1&&(R=["web"].includes(ge[0].type)),R?ee?ee.p(ge,Ee):(ee=Pw(ge),ee.c(),ee.m(e,M)):ee&&(ee.d(1),ee=null),Ee&1&&(H=["web"].includes(ge[0].type)),H?_e?_e.p(ge,Ee):(_e=Nw(ge),_e.c(),_e.m(e,le)):_e&&(_e.d(1),_e=null),Ee&1&&(V=["web"].includes(ge[0].type)),V?Ce?Ce.p(ge,Ee):(Ce=xw(ge),Ce.c(),Ce.m(e,null)):Ce&&(Ce.d(1),Ce=null)},i(ge){X||(se(S),se(Q),se(j),se(U),se(J),se(re),se(Y),se(z),X=!0)},o(ge){de(S),de(Q),de(j),de(U),de(J),de(re),de(Y),de(z),X=!1},d(ge){ge&&B(e),S&&S.d(),Q&&Q.d(),j&&j.d(),U&&U.d(),J&&J.d(),re&&re.d(),Y&&Y.d(),z&&z.d(),ee&&ee.d(),_e&&_e.d(),Ce&&Ce.d(),K=!1,We(ce)}}}function Ew(t){let e,n,r,i,o,a;function u(c){t[17](c)}let f={};return t[4]!==void 0&&(f.checked=t[4]),i=new Sh({props:f}),Ne.push(()=>tt(i,"checked",u)),{c(){e=N("label"),e.textContent="Navigation",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","navigation"),k(e,"class","svelte-1665e1"),k(r,"class","setting svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};!o&&p&16&&(o=!0,h.checked=c[4],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Tw(t){let e,n,r,i,o,a;function u(c){t[18](c)}let f={};return t[11]!==void 0&&(f.checked=t[11]),i=new Sh({props:f}),Ne.push(()=>tt(i,"checked",u)),{c(){e=N("label"),e.textContent="Show All Day",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","allDay"),k(e,"class","svelte-1665e1"),k(r,"class","setting svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};!o&&p&2048&&(o=!0,h.checked=c[11],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Sw(t){let e,n,r,i,o,a;function u(c){t[19](c)}let f={pipstep:4,range:!0,min:0,max:24,step:1,all:"label",pips:!0,float:!0};return t[3]!==void 0&&(f.values=t[3]),i=new _a({props:f}),Ne.push(()=>tt(i,"values",u)),{c(){e=N("label"),e.textContent="Hour Range",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","hourRange"),k(e,"class","svelte-1665e1"),k(r,"class","setting rangeSettings svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};!o&&p&8&&(o=!0,h.values=c[3],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Cw(t){let e,n,r,i,o,a;function u(c){t[20](c)}let f={pipstep:5,min:0,max:15,step:1,all:"label",pips:!0,float:!0};return t[5]!==void 0&&(f.values=t[5]),i=new _a({props:f}),Ne.push(()=>tt(i,"values",u)),{c(){e=N("label"),e.textContent="Timespan",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","timespan"),k(e,"class","svelte-1665e1"),k(r,"class","setting rangeSettings svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};!o&&p&32&&(o=!0,h.values=c[5],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Dw(t){let e,n,r,i,o,a;function u(c){t[21](c)}let f={pipstep:5,min:-15,max:15,step:1,all:"label",pips:!0,float:!0};return t[10]!==void 0&&(f.values=t[10]),i=new _a({props:f}),Ne.push(()=>tt(i,"values",u)),{c(){e=N("label"),e.textContent="Offset",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","offset"),k(e,"class","svelte-1665e1"),k(r,"class","setting rangeSettings svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};!o&&p&1024&&(o=!0,h.values=c[10],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Ow(t){let e,n,r,i,o,a;function u(c){t[22](c)}let f={pipstep:5,min:5,max:30,step:1,all:"label",pips:!0,float:!0};return t[12]!==void 0&&(f.values=t[12]),i=new _a({props:f}),Ne.push(()=>tt(i,"values",u)),{c(){e=N("label"),e.textContent="Size",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","size"),k(e,"class","svelte-1665e1"),k(r,"class","setting rangeSettings svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};!o&&p&4096&&(o=!0,h.values=c[12],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Mw(t){let e,n,r,i,o,a;function u(c){t[23](c)}let f={options:[...t[13],...ul]};return t[6]!==void 0&&(f.selected=t[6]),i=new ma({props:f}),Ne.push(()=>tt(i,"selected",u)),{c(){e=N("label"),e.textContent="Include",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","include"),k(e,"class","svelte-1665e1"),k(r,"class","setting svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};p&8192&&(h.options=[...c[13],...ul]),!o&&p&64&&(o=!0,h.selected=c[6],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Aw(t){let e,n,r,i,o,a;function u(c){t[24](c)}let f={options:[...t[13],...ul]};return t[7]!==void 0&&(f.selected=t[7]),i=new ma({props:f}),Ne.push(()=>tt(i,"selected",u)),{c(){e=N("label"),e.textContent="Exclude",n=$(),r=N("div"),ct(i.$$.fragment),k(e,"for","exclude"),k(e,"class","svelte-1665e1"),k(r,"class","setting svelte-1665e1")},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),ut(i,r,null),a=!0},p(c,p){let h={};p&8192&&(h.options=[...c[13],...ul]),!o&&p&128&&(o=!0,h.selected=c[7],et(()=>o=!1)),i.$set(h)},i(c){a||(se(i.$$.fragment,c),a=!0)},o(c){de(i.$$.fragment,c),a=!1},d(c){c&&B(e),c&&B(n),c&&B(r),st(i)}}}function Pw(t){let e,n,r,i,o,a,u,f,c;return{c(){e=N("label"),e.textContent="Default view",n=$(),r=N("select"),i=N("option"),i.textContent="Day",o=N("option"),o.textContent="Week",a=N("option"),a.textContent="Month",u=N("option"),u.textContent="Agenda",k(e,"for","defaultView<"),k(e,"class","svelte-1665e1"),i.__value="day",i.value=i.__value,o.__value="week",o.value=o.__value,a.__value="month",a.value=a.__value,u.__value="agenda",u.value=u.__value,k(r,"name","view"),t[8]===void 0&&ln(()=>t[25].call(r))},m(p,h){G(p,e,h),G(p,n,h),G(p,r,h),A(r,i),A(r,o),A(r,a),A(r,u),li(r,t[8],!0),f||(c=oe(r,"change",t[25]),f=!0)},p(p,h){h&256&&li(r,p[8])},d(p){p&&B(e),p&&B(n),p&&B(r),f=!1,c()}}}function Nw(t){let e,n,r,i,o,a,u,f;return{c(){e=N("label"),e.textContent="Color theme",n=$(),r=N("select"),i=N("option"),i.textContent="Auto",o=N("option"),o.textContent="Light",a=N("option"),a.textContent="Dark",k(e,"for","ColorTheme"),k(e,"class","svelte-1665e1"),i.__value="auto",i.value=i.__value,o.__value="light",o.value=o.__value,a.__value="dark",a.value=a.__value,k(r,"name","theme"),t[9]===void 0&&ln(()=>t[26].call(r))},m(c,p){G(c,e,p),G(c,n,p),G(c,r,p),A(r,i),A(r,o),A(r,a),li(r,t[9],!0),u||(f=oe(r,"change",t[26]),u=!0)},p(c,p){p&512&&li(r,c[9])},d(c){c&&B(e),c&&B(n),c&&B(r),u=!1,f()}}}function xw(t){let e,n,r;return{c(){e=N("button"),e.textContent="Open Login"},m(i,o){G(i,e,o),n||(r=oe(e,"click",t[27]),n=!0)},p:me,d(i){i&&B(e),n=!1,r()}}}function NP(t){let e,n,r,i=t[1]&&kw(t);return{c(){e=N("div"),i&&i.c(),k(e,"class",n=""+(en(t[1]?"settingsContainerOpen":"")+" svelte-1665e1"))},m(o,a){G(o,e,a),i&&i.m(e,null),r=!0},p(o,[a]){o[1]?i?(i.p(o,a),a&2&&se(i,1)):(i=kw(o),i.c(),se(i,1),i.m(e,null)):i&&(Je(),de(i,1,1,()=>{i=null}),Qe()),(!r||a&2&&n!==(n=""+(en(o[1]?"settingsContainerOpen":"")+" svelte-1665e1")))&&k(e,"class",n)},i(o){r||(se(i),r=!0)},o(o){de(i),r=!1},d(o){o&&B(e),i&&i.d()}}}function xP(t,e,n){let{codeBlockOptions:r}=e,{showSettings:i=!1}=e,{webViewUrl:o=""}=e,a=[],u=ye.getInstance();Yi(()=>Tt(void 0,void 0,void 0,function*(){n(13,a=yield Pi()),n(13,a=a.map(S=>S.summary))}));let f=r.hourRange,c=r.navigation,p=[r.timespan],h=r.include,m=r.exclude,_=r.view,v=r.theme,b=[r.offset],E=r.showAllDay,y=[r.size],O=()=>{let S=u.settings.viewSettings[r.type];delete S.width,delete S.height,S.type==="day"&&delete S.timespan;let j=`\`\`\`gEvent
${(0,bw.stringifyYaml)(u.settings.viewSettings[r.type])}
\`\`\``;navigator.clipboard.writeText(j)},D=()=>{n(1,i=!1)};function F(S){c=S,n(4,c)}function P(S){E=S,n(11,E)}function L(S){f=S,n(3,f)}function R(S){p=S,n(5,p)}function M(S){b=S,n(10,b)}function H(S){y=S,n(12,y)}function le(S){h=S,n(6,h)}function V(S){m=S,n(7,m)}function X(){_=Hs(this),n(8,_)}function K(){v=Hs(this),n(9,v)}let ce=()=>n(2,o="https://accounts.google.com");return t.$$set=S=>{"codeBlockOptions"in S&&n(0,r=S.codeBlockOptions),"showSettings"in S&&n(1,i=S.showSettings),"webViewUrl"in S&&n(2,o=S.webViewUrl)},t.$$.update=()=>{if(t.$$.dirty&73721){e:n(0,r.hourRange=f,r),n(0,r.navigation=c,r),n(0,r.timespan=p[0],r),n(0,r.include=h,r),n(0,r.exclude=m,r),n(0,r.view=_,r),n(0,r.theme=v,r),n(0,r.offset=b[0],r),n(0,r.size=y[0],r),n(0,r.showAllDay=E,r),n(16,u.settings.viewSettings[r.type]=Object.assign(Object.assign({},u.settings.viewSettings[r.type]),{hourRange:f,navigation:c,timespan:p[0],include:h,exclude:m,view:_,theme:v,offset:b[0],showAllDay:E,size:y[0]}),u),u.saveSettings()}},[r,i,o,f,c,p,h,m,_,v,b,E,y,a,O,D,u,F,P,L,R,M,H,le,V,X,K,ce]}var Iw=class extends ze{constructor(e){super();qe(this,e,xP,NP,Ge,{codeBlockOptions:0,showSettings:1,webViewUrl:2},PP)}},di=Iw;function IP(t){Et(t,"svelte-1ficnkj",".fullSize.svelte-1ficnkj,.content.svelte-1ficnkj,.box.svelte-1ficnkj{width:100%;height:100%;overflow:scoll !important}")}function Rw(t){let e,n,r,i,o;function a(p){t[5](p)}function u(p){t[6](p)}function f(p){t[7](p)}let c={};return t[0]!==void 0&&(c.codeBlockOptions=t[0]),t[1]!==void 0&&(c.showSettings=t[1]),t[3]!==void 0&&(c.webViewUrl=t[3]),e=new di({props:c}),Ne.push(()=>tt(e,"codeBlockOptions",a)),Ne.push(()=>tt(e,"showSettings",u)),Ne.push(()=>tt(e,"webViewUrl",f)),{c(){ct(e.$$.fragment)},m(p,h){ut(e,p,h),o=!0},p(p,h){let m={};!n&&h&1&&(n=!0,m.codeBlockOptions=p[0],et(()=>n=!1)),!r&&h&2&&(r=!0,m.showSettings=p[1],et(()=>r=!1)),!i&&h&8&&(i=!0,m.webViewUrl=p[3],et(()=>i=!1)),e.$set(m)},i(p){o||(se(e.$$.fragment,p),o=!0)},o(p){de(e.$$.fragment,p),o=!1},d(p){st(e,p)}}}function RP(t){let e,n,r=`${t[0].width}px`,i=`${t[0].height}px`;return{c(){e=N("webview"),Xo(e.src,n=t[3])||k(e,"src",n),k(e,"allowpopups",""),he(e,"width",r),he(e,"height",i)},m(o,a){G(o,e,a),t[10](e)},p(o,a){a&8&&!Xo(e.src,n=o[3])&&k(e,"src",n),a&1&&r!==(r=`${o[0].width}px`)&&he(e,"width",r),a&1&&i!==(i=`${o[0].height}px`)&&he(e,"height",i)},d(o){o&&B(e),t[10](null)}}}function LP(t){let e,n,r=`${t[0].height}px`;return{c(){e=N("webview"),Xo(e.src,n=t[3])||k(e,"src",n),k(e,"allowpopups",""),he(e,"height",r)},m(i,o){G(i,e,o),t[9](e)},p(i,o){o&8&&!Xo(e.src,n=i[3])&&k(e,"src",n),o&1&&r!==(r=`${i[0].height}px`)&&he(e,"height",r)},d(i){i&&B(e),t[9](null)}}}function FP(t){let e,n;return{c(){e=N("webview"),Xo(e.src,n=t[3])||k(e,"src",n),k(e,"allowpopups",""),k(e,"class","fullSize svelte-1ficnkj")},m(r,i){G(r,e,i),t[8](e)},p(r,i){i&8&&!Xo(e.src,n=r[3])&&k(e,"src",n)},d(r){r&&B(e),t[8](null)}}}function YP(t){let e,n,r,i,o=t[2]&&Rw(t);function a(c,p){return c[0].width==-1?FP:c[0].width?RP:LP}let u=a(t,-1),f=u(t);return{c(){e=N("div"),o&&o.c(),n=$(),r=N("div"),f.c(),k(r,"class","content svelte-1ficnkj"),k(e,"class","box svelte-1ficnkj")},m(c,p){G(c,e,p),o&&o.m(e,null),A(e,n),A(e,r),f.m(r,null),i=!0},p(c,[p]){c[2]?o?(o.p(c,p),p&4&&se(o,1)):(o=Rw(c),o.c(),se(o,1),o.m(e,n)):o&&(Je(),de(o,1,1,()=>{o=null}),Qe()),u===(u=a(c,p))&&f?f.p(c,p):(f.d(1),f=u(c),f&&(f.c(),f.m(r,null)))},i(c){i||(se(o),i=!0)},o(c){de(o),i=!1},d(c){c&&B(e),o&&o.d(),f.d()}}}function WP(t,e,n){let{codeBlockOptions:r}=e,{isObsidianView:i=!1}=e,{showSettings:o=!1}=e,a,u,f;r.height||(r.height=500);let c=y=>{if(a)return a;if(!f.isValid())return`https://calendar.google.com/calendar/u/0/r/${y}/`;let O=f.format("yyyy/M/D");return`https://calendar.google.com/calendar/u/0/r/${y}/${O}`};function p(y){if(u)if(y=="dark"||y=="auto"&&hv()=="dark"){try{u.removeEventListener("dom-ready",O=>{u.executeJavaScript(`
const menu = document.querySelectorAll('[aria-label][aria-expanded]')[0]
if(menu.getAttribute("aria-expanded") == "true"){
menu.click();
}
`),u.insertCSS("html { filter: hue-rotate(180deg)invert(100)contrast(93%) !important; }")})}catch(O){}try{u.removeEventListener("dom-ready",O=>{u.executeJavaScript(`
const menu = document.querySelectorAll('[aria-label][aria-expanded]')[0]
if(menu.getAttribute("aria-expanded") == "true"){
menu.click();
}
`)})}catch(O){}u.addEventListener("dom-ready",O=>{u.executeJavaScript(`
const menu = document.querySelectorAll('[aria-label][aria-expanded]')[0]
if(menu.getAttribute("aria-expanded") == "true"){
menu.click();
}
`),u.insertCSS("html { filter: hue-rotate(180deg)invert(100)contrast(93%) !important; }")})}else u.addEventListener("dom-ready",O=>{u.executeJavaScript(`
const menu = document.querySelectorAll('[aria-label][aria-expanded]')[0]
if(menu.getAttribute("aria-expanded") == "true"){
menu.click();
}
`)})}function h(y){r=y,n(0,r)}function m(y){o=y,n(1,o)}function _(y){a=y,n(3,a),n(0,r)}function v(y){Ne[y?"unshift":"push"](()=>{u=y,n(4,u)})}function b(y){Ne[y?"unshift":"push"](()=>{u=y,n(4,u)})}function E(y){Ne[y?"unshift":"push"](()=>{u=y,n(4,u)})}return t.$$set=y=>{"codeBlockOptions"in y&&n(0,r=y.codeBlockOptions),"isObsidianView"in y&&n(2,i=y.isObsidianView),"showSettings"in y&&n(1,o=y.showSettings)},t.$$.update=()=>{if(t.$$.dirty&1){e:f=r.date?window.moment(r.date).add(r.offset,"day"):window.moment().add(r.offset,"day"),n(3,a=c(r.view)),p(r.theme)}},[r,o,i,a,u,h,m,_,v,b,E]}var Lw=class extends ze{constructor(e){super();qe(this,e,WP,YP,Ge,{codeBlockOptions:0,isObsidianView:2,showSettings:1},IP)}},tc=Lw;var GG=Oe(require("obsidian"));function Tn(){}function Ol(t,e){for(let n in e)t[n]=e[n];return t}function jP(t){return t&&typeof t=="object"&&typeof t.then=="function"}function Fw(t){return t()}function Yw(){return Object.create(null)}function wo(t){t.forEach(Fw)}function pi(t){return typeof t=="function"}function Dh(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function nc(t,e){return t!=t?e==e:t!==e}function BP(t){return Object.keys(t).length===0}function Ww(t,e,n,r){if(t){let i=jw(t,e,n,r);return t[0](i)}}function jw(t,e,n,r){return t[1]&&r?Ol(n.ctx.slice(),t[1](r(e))):n.ctx}function GP(t,e,n,r){if(t[2]&&r){let i=t[2](r(n));if(e.dirty===void 0)return i;if(typeof i=="object"){let o=[],a=Math.max(e.dirty.length,i.length);for(let u=0;u<a;u+=1)o[u]=e.dirty[u]|i[u];return o}return e.dirty|i}return e.dirty}function Bw(t,e,n,r,i,o,a){let u=GP(e,r,i,o);if(u){let f=jw(e,n,r,a);t.p(f,u)}}function va(t){return t==null?"":t}function nt(t,e){t.appendChild(e)}function Sn(t,e,n){t.insertBefore(e,n||null)}function gn(t){t.parentNode.removeChild(t)}function rc(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function Pt(t){return document.createElement(t)}function ya(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function os(t){return document.createTextNode(t)}function hr(){return os(" ")}function ic(){return os("")}function Ui(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function Ze(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Gw(t,e){let n=Object.getOwnPropertyDescriptors(t.__proto__);for(let r in e)e[r]==null?t.removeAttribute(r):r==="style"?t.style.cssText=e[r]:r==="__value"?t.value=t[r]=e[r]:n[r]&&n[r].set?t[r]=e[r]:Ze(t,r,e[r])}function UP(t){return Array.from(t.childNodes)}function Ml(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function sn(t,e,n){t.classList[n?"add":"remove"](e)}var oc;function bo(t){oc=t}function zP(){if(!oc)throw new Error("Function called outside component initialization");return oc}var Al=[],Uw=[],sc=[],zw=[],HP=Promise.resolve(),Oh=!1;function qP(){Oh||(Oh=!0,HP.then(Nh))}function Mh(t){sc.push(t)}var Ah=!1,Ph=new Set;function Nh(){if(!Ah){Ah=!0;do{for(let t=0;t<Al.length;t+=1){let e=Al[t];bo(e),VP(e.$$)}for(bo(null),Al.length=0;Uw.length;)Uw.pop()();for(let t=0;t<sc.length;t+=1){let e=sc[t];Ph.has(e)||(Ph.add(e),e())}sc.length=0}while(Al.length);for(;zw.length;)zw.pop()();Oh=!1,Ah=!1,Ph.clear()}}function VP(t){if(t.fragment!==null){t.update(),wo(t.before_update);let e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Mh)}}var ac=new Set,ss;function as(){ss={r:0,c:[],p:ss}}function ls(){ss.r||wo(ss.c),ss=ss.p}function It(t,e){t&&t.i&&(ac.delete(t),t.i(e))}function Vt(t,e,n,r){if(t&&t.o){if(ac.has(t))return;ac.add(t),ss.c.push(()=>{ac.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}}function Hw(t,e){let n=e.token={};function r(i,o,a,u){if(e.token!==n)return;e.resolved=u;let f=e.ctx;a!==void 0&&(f=f.slice(),f[a]=u);let c=i&&(e.current=i)(f),p=!1;e.block&&(e.blocks?e.blocks.forEach((h,m)=>{m!==o&&h&&(as(),Vt(h,1,1,()=>{e.blocks[m]===h&&(e.blocks[m]=null)}),ls())}):e.block.d(1),c.c(),It(c,1),c.m(e.mount(),e.anchor),p=!0),e.block=c,e.blocks&&(e.blocks[o]=c),p&&Nh()}if(jP(t)){let i=zP();if(t.then(o=>{bo(i),r(e.then,1,e.value,o),bo(null)},o=>{if(bo(i),r(e.catch,2,e.error,o),bo(null),!e.hasCatch)throw o}),e.current!==e.pending)return r(e.pending,0),!0}else{if(e.current!==e.then)return r(e.then,1,e.value,t),!0;e.resolved=t}}function qw(t,e){Vt(t,1,1,()=>{e.delete(t.key)})}function Vw(t,e,n,r,i,o,a,u,f,c,p,h){let m=t.length,_=o.length,v=m,b={};for(;v--;)b[t[v].key]=v;let E=[],y=new Map,O=new Map;for(v=_;v--;){let L=h(i,o,v),R=n(L),M=a.get(R);M?r&&M.p(L,e):(M=c(R,L),M.c()),y.set(R,E[v]=M),R in b&&O.set(R,Math.abs(v-b[R]))}let D=new Set,F=new Set;function P(L){It(L,1),L.m(u,p),a.set(L.key,L),p=L.first,_--}for(;m&&_;){let L=E[_-1],R=t[m-1],M=L.key,H=R.key;L===R?(p=L.first,m--,_--):y.has(H)?!a.has(M)||D.has(M)?P(L):F.has(H)?m--:O.get(M)>O.get(H)?(F.add(M),P(L)):(D.add(H),m--):(f(R,a),m--)}for(;m--;){let L=t[m];y.has(L.key)||f(L,a)}for(;_;)P(E[_-1]);return E}function lc(t,e){let n={},r={},i={$$scope:1},o=t.length;for(;o--;){let a=t[o],u=e[o];if(u){for(let f in a)f in u||(r[f]=1);for(let f in u)i[f]||(n[f]=u[f],i[f]=1);t[o]=u}else for(let f in a)i[f]=1}for(let a in r)a in n||(n[a]=void 0);return n}function xh(t){return typeof t=="object"&&t!==null?t:{}}function zi(t){t&&t.c()}function hi(t,e,n,r){let{fragment:i,on_mount:o,on_destroy:a,after_update:u}=t.$$;i&&i.m(e,n),r||Mh(()=>{let f=o.map(Fw).filter(pi);a?a.push(...f):wo(f),t.$$.on_mount=[]}),u.forEach(Mh)}function mi(t,e){let n=t.$$;n.fragment!==null&&(wo(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function KP(t,e){t.$$.dirty[0]===-1&&(Al.push(t),qP(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function us(t,e,n,r,i,o,a=[-1]){let u=oc;bo(t);let f=t.$$={fragment:null,ctx:null,props:o,update:Tn,not_equal:i,bound:Yw(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(u?u.$$.context:[]),callbacks:Yw(),dirty:a,skip_bound:!1},c=!1;if(f.ctx=n?n(t,e.props||{},(p,h,...m)=>{let _=m.length?m[0]:h;return f.ctx&&i(f.ctx[p],f.ctx[p]=_)&&(!f.skip_bound&&f.bound[p]&&f.bound[p](_),c&&KP(t,p)),h}):[],f.update(),c=!0,wo(f.before_update),f.fragment=r?r(f.ctx):!1,e.target){if(e.hydrate){let p=UP(e.target);f.fragment&&f.fragment.l(p),p.forEach(gn)}else f.fragment&&f.fragment.c();e.intro&&It(t.$$.fragment),hi(t,e.target,e.anchor,e.customElement),Nh()}bo(u)}var ko=class{$destroy(){mi(this,1),this.$destroy=Tn}$on(e,n){let r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{let i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(e){this.$$set&&!BP(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};function ZP(t,e="day"){let n=t.clone().startOf(e).format();return`${e}-${n}`}var uc=ZP;function XP(){var t=Pt("style");t.id="svelte-1widvzq-style",t.textContent=".dot.svelte-1widvzq,.hollow.svelte-1widvzq{display:inline-block;height:6px;width:6px;margin:0 1px}.filled.svelte-1widvzq{fill:var(--color-dot)}.active.filled.svelte-1widvzq{fill:var(--text-on-accent)}.hollow.svelte-1widvzq{fill:none;stroke:var(--color-dot)}.active.hollow.svelte-1widvzq{fill:none;stroke:var(--text-on-accent)}",nt(document.head,t)}function JP(t){let e,n,r;return{c(){e=ya("svg"),n=ya("circle"),Ze(n,"cx","3"),Ze(n,"cy","3"),Ze(n,"r","2"),Ze(e,"class",r=""+(va(`hollow ${t[0]}`)+" svelte-1widvzq")),Ze(e,"viewBox","0 0 6 6"),Ze(e,"xmlns","http://www.w3.org/2000/svg"),sn(e,"active",t[2])},m(i,o){Sn(i,e,o),nt(e,n)},p(i,o){o&1&&r!==(r=""+(va(`hollow ${i[0]}`)+" svelte-1widvzq"))&&Ze(e,"class",r),o&5&&sn(e,"active",i[2])},d(i){i&&gn(e)}}}function QP(t){let e,n,r;return{c(){e=ya("svg"),n=ya("circle"),Ze(n,"cx","3"),Ze(n,"cy","3"),Ze(n,"r","2"),Ze(e,"class",r=""+(va(`dot filled ${t[0]}`)+" svelte-1widvzq")),Ze(e,"viewBox","0 0 6 6"),Ze(e,"xmlns","http://www.w3.org/2000/svg"),sn(e,"active",t[2])},m(i,o){Sn(i,e,o),nt(e,n)},p(i,o){o&1&&r!==(r=""+(va(`dot filled ${i[0]}`)+" svelte-1widvzq"))&&Ze(e,"class",r),o&5&&sn(e,"active",i[2])},d(i){i&&gn(e)}}}function $P(t){let e;function n(o,a){return o[1]?QP:JP}let r=n(t),i=r(t);return{c(){i.c(),e=ic()},m(o,a){i.m(o,a),Sn(o,e,a)},p(o,[a]){r===(r=n(o))&&i?i.p(o,a):(i.d(1),i=r(o),i&&(i.c(),i.m(e.parentNode,e)))},i:Tn,o:Tn,d(o){i.d(o),o&&gn(e)}}}function eN(t,e,n){let{className:r=""}=e,{isFilled:i}=e,{isActive:o}=e;return t.$$set=a=>{"className"in a&&n(0,r=a.className),"isFilled"in a&&n(1,i=a.isFilled),"isActive"in a&&n(2,o=a.isActive)},[r,i,o]}var Ih=class extends ko{constructor(e){super();document.getElementById("svelte-1widvzq-style")||XP(),us(this,e,eN,$P,Dh,{className:0,isFilled:1,isActive:2})}},tN=t=>({}),Kw=t=>({metadata:null}),nN=t=>({metadata:t&1}),Zw=t=>({metadata:t[3]});function rN(t){let e,n=t[2].default,r=Ww(n,t,t[1],Kw);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&o&2&&Bw(r,n,i,i[1],o,tN,Kw)},i(i){e||(It(r,i),e=!0)},o(i){Vt(r,i),e=!1},d(i){r&&r.d(i)}}}function iN(t){let e,n,r,i={ctx:t,current:null,token:null,hasCatch:!1,pending:aN,then:sN,catch:oN,value:3,blocks:[,,,]};return Hw(n=t[0],i),{c(){e=ic(),i.block.c()},m(o,a){Sn(o,e,a),i.block.m(o,i.anchor=a),i.mount=()=>e.parentNode,i.anchor=e,r=!0},p(o,a){if(t=o,i.ctx=t,!(a&1&&n!==(n=t[0])&&Hw(n,i))){let u=t.slice();u[3]=i.resolved,i.block.p(u,a)}},i(o){r||(It(i.block),r=!0)},o(o){for(let a=0;a<3;a+=1){let u=i.blocks[a];Vt(u)}r=!1},d(o){o&&gn(e),i.block.d(o),i.token=null,i=null}}}function oN(t){return{c:Tn,m:Tn,p:Tn,i:Tn,o:Tn,d:Tn}}function sN(t){let e,n=t[2].default,r=Ww(n,t,t[1],Zw);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&o&3&&Bw(r,n,i,i[1],o,nN,Zw)},i(i){e||(It(r,i),e=!0)},o(i){Vt(r,i),e=!1},d(i){r&&r.d(i)}}}function aN(t){return{c:Tn,m:Tn,p:Tn,i:Tn,o:Tn,d:Tn}}function lN(t){let e,n,r,i,o=[iN,rN],a=[];function u(f,c){return f[0]?0:1}return e=u(t),n=a[e]=o[e](t),{c(){n.c(),r=ic()},m(f,c){a[e].m(f,c),Sn(f,r,c),i=!0},p(f,[c]){let p=e;e=u(f),e===p?a[e].p(f,c):(as(),Vt(a[p],1,1,()=>{a[p]=null}),ls(),n=a[e],n?n.p(f,c):(n=a[e]=o[e](f),n.c()),It(n,1),n.m(r.parentNode,r))},i(f){i||(It(n),i=!0)},o(f){Vt(n),i=!1},d(f){a[e].d(f),f&&gn(r)}}}function uN(t,e,n){let{$$slots:r={},$$scope:i}=e,{metadata:o}=e;return t.$$set=a=>{"metadata"in a&&n(0,o=a.metadata),"$$scope"in a&&n(1,i=a.$$scope)},[o,i,r]}var Rh=class extends ko{constructor(e){super();us(this,e,uN,lN,nc,{metadata:0})}};function fN(){return navigator.appVersion.indexOf("Mac")!==-1}function fc(t){return fN()?t.metaKey:t.ctrlKey}function cN(...t){return window.moment.weekdaysShort(!0)}function Xw(t){return t.isoWeekday()===6||t.isoWeekday()===7}function dN(t){return t[0].weekday(0)}function pN(t,...e){let n=window.moment().locale(),r=[],i,o=t.clone().locale(n).date(1),a=o.weekday(),u=o.clone().subtract(a,"days");for(let f=0;f<42;f++)f%7==0&&(i={days:[],weekNum:u.week()},r.push(i)),i.days.push(u),u=u.clone().add(1,"days");return r}function hN(){var t=Pt("style");t.id="svelte-q3wqg9-style",t.textContent=".day.svelte-q3wqg9{background-color:var(--color-background-day);border-radius:4px;color:var(--color-text-day);cursor:pointer;font-size:0.8em;height:100%;padding:4px;position:relative;text-align:center;transition:background-color 0.1s ease-in, color 0.1s ease-in;vertical-align:baseline}.day.svelte-q3wqg9:hover{background-color:var(--interactive-hover)}.day.active.svelte-q3wqg9:hover{background-color:var(--interactive-accent-hover)}.adjacent-month.svelte-q3wqg9{opacity:0.25}.today.svelte-q3wqg9{color:var(--color-text-today)}.day.svelte-q3wqg9:active,.active.svelte-q3wqg9,.active.today.svelte-q3wqg9{color:var(--text-on-accent);background-color:var(--interactive-accent)}.dot-container.svelte-q3wqg9{display:flex;flex-wrap:wrap;justify-content:center;line-height:6px;min-height:6px}",nt(document.head,t)}function Jw(t,e,n){let r=t.slice();return r[11]=e[n],r}function Qw(t){let e,n,r=[t[11]],i={};for(let o=0;o<r.length;o+=1)i=Ol(i,r[o]);return e=new Ih({props:i}),{c(){zi(e.$$.fragment)},m(o,a){hi(e,o,a),n=!0},p(o,a){let u=a&128?lc(r,[xh(o[11])]):{};e.$set(u)},i(o){n||(It(e.$$.fragment,o),n=!0)},o(o){Vt(e.$$.fragment,o),n=!1},d(o){mi(e,o)}}}function mN(t){let e,n=t[0].format("D")+"",r,i,o,a,u,f,c,p=t[7].dots,h=[];for(let b=0;b<p.length;b+=1)h[b]=Qw(Jw(t,p,b));let m=b=>Vt(h[b],1,1,()=>{h[b]=null}),_=[{class:a=`day ${t[7].classes.join(" ")}`},t[7].dataAttributes||{}],v={};for(let b=0;b<_.length;b+=1)v=Ol(v,_[b]);return{c(){e=Pt("div"),r=os(n),i=hr(),o=Pt("div");for(let b=0;b<h.length;b+=1)h[b].c();Ze(o,"class","dot-container svelte-q3wqg9"),Gw(e,v),sn(e,"active",t[6]===uc(t[0],"day")),sn(e,"adjacent-month",!t[0].isSame(t[5],"month")),sn(e,"today",t[0].isSame(t[4],"day")),sn(e,"svelte-q3wqg9",!0)},m(b,E){Sn(b,e,E),nt(e,r),nt(e,i),nt(e,o);for(let y=0;y<h.length;y+=1)h[y].m(o,null);u=!0,f||(c=[Ui(e,"click",function(){pi(t[2]&&t[8])&&(t[2]&&t[8]).apply(this,arguments)}),Ui(e,"contextmenu",function(){pi(t[3]&&t[9])&&(t[3]&&t[9]).apply(this,arguments)}),Ui(e,"pointerover",function(){pi(t[1]&&t[10])&&(t[1]&&t[10]).apply(this,arguments)})],f=!0)},p(b,E){if(t=b,(!u||E&1)&&n!==(n=t[0].format("D")+"")&&Ml(r,n),E&128){p=t[7].dots;let y;for(y=0;y<p.length;y+=1){let O=Jw(t,p,y);h[y]?(h[y].p(O,E),It(h[y],1)):(h[y]=Qw(O),h[y].c(),It(h[y],1),h[y].m(o,null))}for(as(),y=p.length;y<h.length;y+=1)m(y);ls()}Gw(e,v=lc(_,[(!u||E&128&&a!==(a=`day ${t[7].classes.join(" ")}`))&&{class:a},E&128&&(t[7].dataAttributes||{})])),sn(e,"active",t[6]===uc(t[0],"day")),sn(e,"adjacent-month",!t[0].isSame(t[5],"month")),sn(e,"today",t[0].isSame(t[4],"day")),sn(e,"svelte-q3wqg9",!0)},i(b){if(!u){for(let E=0;E<p.length;E+=1)It(h[E]);u=!0}},o(b){h=h.filter(Boolean);for(let E=0;E<h.length;E+=1)Vt(h[E]);u=!1},d(b){b&&gn(e),rc(h,b),f=!1,wo(c)}}}function gN(t){let e,n,r;return n=new Rh({props:{metadata:t[7],$$slots:{default:[mN,({metadata:i})=>({7:i}),({metadata:i})=>i?128:0]},$$scope:{ctx:t}}}),{c(){e=Pt("td"),zi(n.$$.fragment)},m(i,o){Sn(i,e,o),hi(n,e,null),r=!0},p(i,[o]){let a={};o&128&&(a.metadata=i[7]),o&16639&&(a.$$scope={dirty:o,ctx:i}),n.$set(a)},i(i){r||(It(n.$$.fragment,i),r=!0)},o(i){Vt(n.$$.fragment,i),r=!1},d(i){i&&gn(e),mi(n)}}}function _N(t,e,n){let{date:r}=e,{metadata:i}=e,{onHover:o}=e,{onClick:a}=e,{onContextMenu:u}=e,{today:f}=e,{displayedMonth:c=null}=e,{selectedId:p=null}=e,h=v=>a(r,fc(v)),m=v=>u(r,v),_=v=>o(r,v.target,fc(v));return t.$$set=v=>{"date"in v&&n(0,r=v.date),"metadata"in v&&n(7,i=v.metadata),"onHover"in v&&n(1,o=v.onHover),"onClick"in v&&n(2,a=v.onClick),"onContextMenu"in v&&n(3,u=v.onContextMenu),"today"in v&&n(4,f=v.today),"displayedMonth"in v&&n(5,c=v.displayedMonth),"selectedId"in v&&n(6,p=v.selectedId)},[r,o,a,u,f,c,p,i,h,m,_]}var $w=class extends ko{constructor(e){super();document.getElementById("svelte-q3wqg9-style")||hN(),us(this,e,_N,gN,nc,{date:0,metadata:7,onHover:1,onClick:2,onContextMenu:3,today:4,displayedMonth:5,selectedId:6})}};function vN(){var t=Pt("style");t.id="svelte-156w7na-style",t.textContent=".arrow.svelte-156w7na.svelte-156w7na{align-items:center;cursor:pointer;display:flex;justify-content:center;width:24px}.arrow.is-mobile.svelte-156w7na.svelte-156w7na{width:32px}.right.svelte-156w7na.svelte-156w7na{transform:rotate(180deg)}.arrow.svelte-156w7na svg.svelte-156w7na{color:var(--color-arrow);height:16px;width:16px}",nt(document.head,t)}function yN(t){let e,n,r,i,o;return{c(){e=Pt("div"),n=ya("svg"),r=ya("path"),Ze(r,"fill","currentColor"),Ze(r,"d","M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"),Ze(n,"focusable","false"),Ze(n,"role","img"),Ze(n,"xmlns","http://www.w3.org/2000/svg"),Ze(n,"viewBox","0 0 320 512"),Ze(n,"class","svelte-156w7na"),Ze(e,"class","arrow svelte-156w7na"),Ze(e,"aria-label",t[1]),sn(e,"is-mobile",t[3]),sn(e,"right",t[2]==="right")},m(a,u){Sn(a,e,u),nt(e,n),nt(n,r),i||(o=Ui(e,"click",function(){pi(t[0])&&t[0].apply(this,arguments)}),i=!0)},p(a,[u]){t=a,u&2&&Ze(e,"aria-label",t[1]),u&4&&sn(e,"right",t[2]==="right")},i:Tn,o:Tn,d(a){a&&gn(e),i=!1,o()}}}function wN(t,e,n){let{onClick:r}=e,{tooltip:i}=e,{direction:o}=e,a=window.app.isMobile;return t.$$set=u=>{"onClick"in u&&n(0,r=u.onClick),"tooltip"in u&&n(1,i=u.tooltip),"direction"in u&&n(2,o=u.direction)},[r,i,o,a]}var Lh=class extends ko{constructor(e){super();document.getElementById("svelte-156w7na-style")||vN(),us(this,e,wN,yN,Dh,{onClick:0,tooltip:1,direction:2})}};function bN(){var t=Pt("style");t.id="svelte-1vwr9dd-style",t.textContent=".nav.svelte-1vwr9dd.svelte-1vwr9dd{align-items:center;display:flex;margin:0.6em 0 1em;padding:0 8px;width:100%}.nav.is-mobile.svelte-1vwr9dd.svelte-1vwr9dd{padding:0}.title.svelte-1vwr9dd.svelte-1vwr9dd{color:var(--color-text-title);font-size:1.5em;margin:0}.is-mobile.svelte-1vwr9dd .title.svelte-1vwr9dd{font-size:1.3em}.month.svelte-1vwr9dd.svelte-1vwr9dd{font-weight:500;text-transform:capitalize}.year.svelte-1vwr9dd.svelte-1vwr9dd{color:var(--interactive-accent)}.right-nav.svelte-1vwr9dd.svelte-1vwr9dd{display:flex;justify-content:center;margin-left:auto}.reset-button.svelte-1vwr9dd.svelte-1vwr9dd{cursor:pointer;border-radius:4px;color:var(--text-muted);font-size:0.7em;font-weight:600;letter-spacing:1px;margin:0 4px;padding:0px 4px;text-transform:uppercase}.is-mobile.svelte-1vwr9dd .reset-button.svelte-1vwr9dd{display:none}",nt(document.head,t)}function kN(t){let e,n,r,i=t[0].format("MMM")+"",o,a,u,f=t[0].format("YYYY")+"",c,p,h,m,_,v,b,E,y,O,D;return m=new Lh({props:{direction:"left",onClick:t[3],tooltip:"Previous Month"}}),E=new Lh({props:{direction:"right",onClick:t[2],tooltip:"Next Month"}}),{c(){e=Pt("div"),n=Pt("h3"),r=Pt("span"),o=os(i),a=hr(),u=Pt("span"),c=os(f),p=hr(),h=Pt("div"),zi(m.$$.fragment),_=hr(),v=Pt("div"),v.textContent=`${t[4]}`,b=hr(),zi(E.$$.fragment),Ze(r,"class","month svelte-1vwr9dd"),Ze(u,"class","year svelte-1vwr9dd"),Ze(n,"class","title svelte-1vwr9dd"),Ze(v,"class","reset-button svelte-1vwr9dd"),Ze(h,"class","right-nav svelte-1vwr9dd"),Ze(e,"class","nav svelte-1vwr9dd"),sn(e,"is-mobile",t[5])},m(F,P){Sn(F,e,P),nt(e,n),nt(n,r),nt(r,o),nt(n,a),nt(n,u),nt(u,c),nt(e,p),nt(e,h),hi(m,h,null),nt(h,_),nt(h,v),nt(h,b),hi(E,h,null),y=!0,O||(D=[Ui(n,"click",function(){pi(t[1])&&t[1].apply(this,arguments)}),Ui(v,"click",function(){pi(t[1])&&t[1].apply(this,arguments)})],O=!0)},p(F,[P]){t=F,(!y||P&1)&&i!==(i=t[0].format("MMM")+"")&&Ml(o,i),(!y||P&1)&&f!==(f=t[0].format("YYYY")+"")&&Ml(c,f);let L={};P&8&&(L.onClick=t[3]),m.$set(L);let R={};P&4&&(R.onClick=t[2]),E.$set(R)},i(F){y||(It(m.$$.fragment,F),It(E.$$.fragment,F),y=!0)},o(F){Vt(m.$$.fragment,F),Vt(E.$$.fragment,F),y=!1},d(F){F&&gn(e),mi(m),mi(E),O=!1,wo(D)}}}function EN(t,e,n){let{displayedMonth:r}=e,{today:i}=e,{resetDisplayedMonth:o}=e,{incrementDisplayedMonth:a}=e,{decrementDisplayedMonth:u}=e,f=i.calendar().split(/\d|\s/)[0],c=window.app.isMobile;return t.$$set=p=>{"displayedMonth"in p&&n(0,r=p.displayedMonth),"today"in p&&n(6,i=p.today),"resetDisplayedMonth"in p&&n(1,o=p.resetDisplayedMonth),"incrementDisplayedMonth"in p&&n(2,a=p.incrementDisplayedMonth),"decrementDisplayedMonth"in p&&n(3,u=p.decrementDisplayedMonth)},[r,o,a,u,f,c,i]}var eb=class extends ko{constructor(e){super();document.getElementById("svelte-1vwr9dd-style")||bN(),us(this,e,EN,kN,Dh,{displayedMonth:0,today:6,resetDisplayedMonth:1,incrementDisplayedMonth:2,decrementDisplayedMonth:3})}};function TN(){var t=Pt("style");t.id="svelte-egt0yd-style",t.textContent="td.svelte-egt0yd{border-right:1px solid var(--background-modifier-border)}.week-num.svelte-egt0yd{background-color:var(--color-background-weeknum);border-radius:4px;color:var(--color-text-weeknum);cursor:pointer;font-size:0.65em;height:100%;padding:4px;text-align:center;transition:background-color 0.1s ease-in, color 0.1s ease-in;vertical-align:baseline}.week-num.svelte-egt0yd:hover{background-color:var(--interactive-hover)}.week-num.active.svelte-egt0yd:hover{background-color:var(--interactive-accent-hover)}.active.svelte-egt0yd{color:var(--text-on-accent);background-color:var(--interactive-accent)}.dot-container.svelte-egt0yd{display:flex;flex-wrap:wrap;justify-content:center;line-height:6px;min-height:6px}",nt(document.head,t)}function tb(t,e,n){let r=t.slice();return r[11]=e[n],r}function nb(t){let e,n,r=[t[11]],i={};for(let o=0;o<r.length;o+=1)i=Ol(i,r[o]);return e=new Ih({props:i}),{c(){zi(e.$$.fragment)},m(o,a){hi(e,o,a),n=!0},p(o,a){let u=a&64?lc(r,[xh(o[11])]):{};e.$set(u)},i(o){n||(It(e.$$.fragment,o),n=!0)},o(o){Vt(e.$$.fragment,o),n=!1},d(o){mi(e,o)}}}function SN(t){let e,n,r,i,o,a,u,f,c=t[6].dots,p=[];for(let m=0;m<c.length;m+=1)p[m]=nb(tb(t,c,m));let h=m=>Vt(p[m],1,1,()=>{p[m]=null});return{c(){e=Pt("div"),n=os(t[0]),r=hr(),i=Pt("div");for(let m=0;m<p.length;m+=1)p[m].c();Ze(i,"class","dot-container svelte-egt0yd"),Ze(e,"class",o=""+(va(`week-num ${t[6].classes.join(" ")}`)+" svelte-egt0yd")),sn(e,"active",t[5]===uc(t[1][0],"week"))},m(m,_){Sn(m,e,_),nt(e,n),nt(e,r),nt(e,i);for(let v=0;v<p.length;v+=1)p[v].m(i,null);a=!0,u||(f=[Ui(e,"click",function(){pi(t[3]&&t[8])&&(t[3]&&t[8]).apply(this,arguments)}),Ui(e,"contextmenu",function(){pi(t[4]&&t[9])&&(t[4]&&t[9]).apply(this,arguments)}),Ui(e,"pointerover",function(){pi(t[2]&&t[10])&&(t[2]&&t[10]).apply(this,arguments)})],u=!0)},p(m,_){if(t=m,(!a||_&1)&&Ml(n,t[0]),_&64){c=t[6].dots;let v;for(v=0;v<c.length;v+=1){let b=tb(t,c,v);p[v]?(p[v].p(b,_),It(p[v],1)):(p[v]=nb(b),p[v].c(),It(p[v],1),p[v].m(i,null))}for(as(),v=c.length;v<p.length;v+=1)h(v);ls()}(!a||_&64&&o!==(o=""+(va(`week-num ${t[6].classes.join(" ")}`)+" svelte-egt0yd")))&&Ze(e,"class",o),_&98&&sn(e,"active",t[5]===uc(t[1][0],"week"))},i(m){if(!a){for(let _=0;_<c.length;_+=1)It(p[_]);a=!0}},o(m){p=p.filter(Boolean);for(let _=0;_<p.length;_+=1)Vt(p[_]);a=!1},d(m){m&&gn(e),rc(p,m),u=!1,wo(f)}}}function CN(t){let e,n,r;return n=new Rh({props:{metadata:t[6],$$slots:{default:[SN,({metadata:i})=>({6:i}),({metadata:i})=>i?64:0]},$$scope:{ctx:t}}}),{c(){e=Pt("td"),zi(n.$$.fragment),Ze(e,"class","svelte-egt0yd")},m(i,o){Sn(i,e,o),hi(n,e,null),r=!0},p(i,[o]){let a={};o&64&&(a.metadata=i[6]),o&16639&&(a.$$scope={dirty:o,ctx:i}),n.$set(a)},i(i){r||(It(n.$$.fragment,i),r=!0)},o(i){Vt(n.$$.fragment,i),r=!1},d(i){i&&gn(e),mi(n)}}}function DN(t,e,n){let{weekNum:r}=e,{days:i}=e,{metadata:o}=e,{onHover:a}=e,{onClick:u}=e,{onContextMenu:f}=e,{selectedId:c=null}=e,p,h=v=>u(p,fc(v)),m=v=>f(i[0],v),_=v=>a(p,v.target,fc(v));return t.$$set=v=>{"weekNum"in v&&n(0,r=v.weekNum),"days"in v&&n(1,i=v.days),"metadata"in v&&n(6,o=v.metadata),"onHover"in v&&n(2,a=v.onHover),"onClick"in v&&n(3,u=v.onClick),"onContextMenu"in v&&n(4,f=v.onContextMenu),"selectedId"in v&&n(5,c=v.selectedId)},t.$$.update=()=>{t.$$.dirty&2&&n(7,p=dN(i))},[r,i,a,u,f,c,o,p,h,m,_]}var rb=class extends ko{constructor(e){super();document.getElementById("svelte-egt0yd-style")||TN(),us(this,e,DN,CN,nc,{weekNum:0,days:1,metadata:6,onHover:2,onClick:3,onContextMenu:4,selectedId:5})}};function ib(t){return te(this,null,function*(){let e={dots:[],classes:[],dataAttributes:{}};return(yield Promise.all(t)).reduce((r,i)=>({classes:[...r.classes,...i.classes||[]],dataAttributes:Object.assign(r.dataAttributes,i.dataAttributes),dots:[...r.dots,...i.dots||[]]}),e)})}function ob(t,e,...n){return ib(t.map(r=>r.getDailyMetadata(e)))}function sb(t,e,...n){return ib(t.map(r=>r.getWeeklyMetadata(e)))}function ON(){var t=Pt("style");t.id="svelte-pcimu8-style",t.textContent=".container.svelte-pcimu8{--color-background-heading:transparent;--color-background-day:transparent;--color-background-weeknum:transparent;--color-background-weekend:transparent;--color-dot:var(--text-muted);--color-arrow:var(--text-muted);--color-button:var(--text-muted);--color-text-title:var(--text-normal);--color-text-heading:var(--text-muted);--color-text-day:var(--text-normal);--color-text-today:var(--interactive-accent);--color-text-weeknum:var(--text-muted)}.container.svelte-pcimu8{padding:0 8px}.container.is-mobile.svelte-pcimu8{padding:0}th.svelte-pcimu8{text-align:center}.weekend.svelte-pcimu8{background-color:var(--color-background-weekend)}.calendar.svelte-pcimu8{border-collapse:collapse;width:100%}th.svelte-pcimu8{background-color:var(--color-background-heading);color:var(--color-text-heading);font-size:0.6em;letter-spacing:1px;padding:4px;text-transform:uppercase}",nt(document.head,t)}function ab(t,e,n){let r=t.slice();return r[18]=e[n],r}function lb(t,e,n){let r=t.slice();return r[21]=e[n],r}function ub(t,e,n){let r=t.slice();return r[24]=e[n],r}function fb(t,e,n){let r=t.slice();return r[27]=e[n],r}function cb(t){let e;return{c(){e=Pt("col")},m(n,r){Sn(n,e,r)},d(n){n&&gn(e)}}}function db(t){let e;return{c(){e=Pt("col"),Ze(e,"class","svelte-pcimu8"),sn(e,"weekend",Xw(t[27]))},m(n,r){Sn(n,e,r)},p(n,r){r&16384&&sn(e,"weekend",Xw(n[27]))},d(n){n&&gn(e)}}}function pb(t){let e;return{c(){e=Pt("th"),e.textContent="W",Ze(e,"class","svelte-pcimu8")},m(n,r){Sn(n,e,r)},d(n){n&&gn(e)}}}function hb(t){let e,n=t[24]+"",r;return{c(){e=Pt("th"),r=os(n),Ze(e,"class","svelte-pcimu8")},m(i,o){Sn(i,e,o),nt(e,r)},p(i,o){o&32768&&n!==(n=i[24]+"")&&Ml(r,n)},d(i){i&&gn(e)}}}function mb(t){let e,n,r=[t[18],{metadata:sb(t[8],t[18].days[0],t[10])},{onClick:t[7]},{onContextMenu:t[5]},{onHover:t[3]},{selectedId:t[9]}],i={};for(let o=0;o<r.length;o+=1)i=Ol(i,r[o]);return e=new rb({props:i}),{c(){zi(e.$$.fragment)},m(o,a){hi(e,o,a),n=!0},p(o,a){let u=a&18344?lc(r,[a&16384&&xh(o[18]),a&17664&&{metadata:sb(o[8],o[18].days[0],o[10])},a&128&&{onClick:o[7]},a&32&&{onContextMenu:o[5]},a&8&&{onHover:o[3]},a&512&&{selectedId:o[9]}]):{};e.$set(u)},i(o){n||(It(e.$$.fragment,o),n=!0)},o(o){Vt(e.$$.fragment,o),n=!1},d(o){mi(e,o)}}}function gb(t,e){let n,r,i;return r=new $w({props:{date:e[21],today:e[10],displayedMonth:e[0],onClick:e[6],onContextMenu:e[4],onHover:e[2],metadata:ob(e[8],e[21],e[10]),selectedId:e[9]}}),{key:t,first:null,c(){n=ic(),zi(r.$$.fragment),this.first=n},m(o,a){Sn(o,n,a),hi(r,o,a),i=!0},p(o,a){e=o;let u={};a&16384&&(u.date=e[21]),a&1024&&(u.today=e[10]),a&1&&(u.displayedMonth=e[0]),a&64&&(u.onClick=e[6]),a&16&&(u.onContextMenu=e[4]),a&4&&(u.onHover=e[2]),a&17664&&(u.metadata=ob(e[8],e[21],e[10])),a&512&&(u.selectedId=e[9]),r.$set(u)},i(o){i||(It(r.$$.fragment,o),i=!0)},o(o){Vt(r.$$.fragment,o),i=!1},d(o){o&&gn(n),mi(r,o)}}}function _b(t,e){let n,r,i=[],o=new Map,a,u,f=e[1]&&mb(e),c=e[18].days,p=h=>h[21].format();for(let h=0;h<c.length;h+=1){let m=lb(e,c,h),_=p(m);o.set(_,i[h]=gb(_,m))}return{key:t,first:null,c(){n=Pt("tr"),f&&f.c(),r=hr();for(let h=0;h<i.length;h+=1)i[h].c();a=hr(),this.first=n},m(h,m){Sn(h,n,m),f&&f.m(n,null),nt(n,r);for(let _=0;_<i.length;_+=1)i[_].m(n,null);nt(n,a),u=!0},p(h,m){e=h,e[1]?f?(f.p(e,m),m&2&&It(f,1)):(f=mb(e),f.c(),It(f,1),f.m(n,r)):f&&(as(),Vt(f,1,1,()=>{f=null}),ls()),m&18261&&(c=e[18].days,as(),i=Vw(i,m,p,1,e,c,o,n,qw,gb,a,lb),ls())},i(h){if(!u){It(f);for(let m=0;m<c.length;m+=1)It(i[m]);u=!0}},o(h){Vt(f);for(let m=0;m<i.length;m+=1)Vt(i[m]);u=!1},d(h){h&&gn(n),f&&f.d();for(let m=0;m<i.length;m+=1)i[m].d()}}}function MN(t){let e,n,r,i,o,a,u,f,c,p,h,m,_=[],v=new Map,b;n=new eb({props:{today:t[10],displayedMonth:t[0],incrementDisplayedMonth:t[11],decrementDisplayedMonth:t[12],resetDisplayedMonth:t[13]}});let E=t[1]&&cb(),y=t[14][1].days,O=[];for(let M=0;M<y.length;M+=1)O[M]=db(fb(t,y,M));let D=t[1]&&pb(),F=t[15],P=[];for(let M=0;M<F.length;M+=1)P[M]=hb(ub(t,F,M));let L=t[14],R=M=>M[18].weekNum;for(let M=0;M<L.length;M+=1){let H=ab(t,L,M),le=R(H);v.set(le,_[M]=_b(le,H))}return{c(){e=Pt("div"),zi(n.$$.fragment),r=hr(),i=Pt("table"),o=Pt("colgroup"),E&&E.c(),a=hr();for(let M=0;M<O.length;M+=1)O[M].c();u=hr(),f=Pt("thead"),c=Pt("tr"),D&&D.c(),p=hr();for(let M=0;M<P.length;M+=1)P[M].c();h=hr(),m=Pt("tbody");for(let M=0;M<_.length;M+=1)_[M].c();Ze(i,"class","calendar svelte-pcimu8"),Ze(e,"id","calendar-container"),Ze(e,"class","container svelte-pcimu8"),sn(e,"is-mobile",t[16])},m(M,H){Sn(M,e,H),hi(n,e,null),nt(e,r),nt(e,i),nt(i,o),E&&E.m(o,null),nt(o,a);for(let le=0;le<O.length;le+=1)O[le].m(o,null);nt(i,u),nt(i,f),nt(f,c),D&&D.m(c,null),nt(c,p);for(let le=0;le<P.length;le+=1)P[le].m(c,null);nt(i,h),nt(i,m);for(let le=0;le<_.length;le+=1)_[le].m(m,null);b=!0},p(M,[H]){let le={};if(H&1024&&(le.today=M[10]),H&1&&(le.displayedMonth=M[0]),n.$set(le),M[1]?E||(E=cb(),E.c(),E.m(o,a)):E&&(E.d(1),E=null),H&16384){y=M[14][1].days;let V;for(V=0;V<y.length;V+=1){let X=fb(M,y,V);O[V]?O[V].p(X,H):(O[V]=db(X),O[V].c(),O[V].m(o,null))}for(;V<O.length;V+=1)O[V].d(1);O.length=y.length}if(M[1]?D||(D=pb(),D.c(),D.m(c,p)):D&&(D.d(1),D=null),H&32768){F=M[15];let V;for(V=0;V<F.length;V+=1){let X=ub(M,F,V);P[V]?P[V].p(X,H):(P[V]=hb(X),P[V].c(),P[V].m(c,null))}for(;V<P.length;V+=1)P[V].d(1);P.length=F.length}H&18431&&(L=M[14],as(),_=Vw(_,H,R,1,M,L,v,m,qw,_b,null,ab),ls())},i(M){if(!b){It(n.$$.fragment,M);for(let H=0;H<L.length;H+=1)It(_[H]);b=!0}},o(M){Vt(n.$$.fragment,M);for(let H=0;H<_.length;H+=1)Vt(_[H]);b=!1},d(M){M&&gn(e),mi(n),E&&E.d(),rc(O,M),D&&D.d(),rc(P,M);for(let H=0;H<_.length;H+=1)_[H].d()}}}function AN(t,e,n){let{localeData:r}=e,{showWeekNums:i=!1}=e,{onHoverDay:o}=e,{onHoverWeek:a}=e,{onContextMenuDay:u}=e,{onContextMenuWeek:f}=e,{onClickDay:c}=e,{onClickWeek:p}=e,{sources:h=[]}=e,{selectedId:m}=e,{today:_=window.moment()}=e,{displayedMonth:v=_}=e,b,E,y=window.app.isMobile;function O(){n(0,v=v.clone().add(1,"month"))}function D(){n(0,v=v.clone().subtract(1,"month"))}function F(){n(0,v=_.clone())}return t.$$set=P=>{"localeData"in P&&n(17,r=P.localeData),"showWeekNums"in P&&n(1,i=P.showWeekNums),"onHoverDay"in P&&n(2,o=P.onHoverDay),"onHoverWeek"in P&&n(3,a=P.onHoverWeek),"onContextMenuDay"in P&&n(4,u=P.onContextMenuDay),"onContextMenuWeek"in P&&n(5,f=P.onContextMenuWeek),"onClickDay"in P&&n(6,c=P.onClickDay),"onClickWeek"in P&&n(7,p=P.onClickWeek),"sources"in P&&n(8,h=P.sources),"selectedId"in P&&n(9,m=P.selectedId),"today"in P&&n(10,_=P.today),"displayedMonth"in P&&n(0,v=P.displayedMonth)},t.$$.update=()=>{t.$$.dirty&131073&&n(14,b=pN(v,r)),t.$$.dirty&132096&&n(15,E=cN(_,r))},[v,i,o,a,u,f,c,p,h,m,_,O,D,F,b,E,y,r]}var cc=class extends ko{constructor(e){super();document.getElementById("svelte-pcimu8-style")||ON(),us(this,e,AN,MN,nc,{localeData:17,showWeekNums:1,onHoverDay:2,onHoverWeek:3,onContextMenuDay:4,onContextMenuWeek:5,onClickDay:6,onClickWeek:7,sources:8,selectedId:9,today:10,displayedMonth:0,incrementDisplayedMonth:11,decrementDisplayedMonth:12,resetDisplayedMonth:13})}get incrementDisplayedMonth(){return this.$$.ctx[11]}get decrementDisplayedMonth(){return this.$$.ctx[12]}get resetDisplayedMonth(){return this.$$.ctx[13]}};var mc=Oe(Ri());var sk=Oe(Bu()),xl=Oe(require("obsidian"));var Xb=Oe(require("obsidian"));function vb(){return zy(null,t=>{let e=()=>t(new Date);e();let n=setInterval(e,1e3*60);return()=>clearInterval(n)})}var Eb=Oe(kb());function FN(t){Et(t,"svelte-19ut8a9",".googleCalendarEvent.svelte-19ut8a9{display:flex;padding:0 10px 10px;position:absolute;cursor:pointer;width:150px;border-radius:5px;color:black;font-size:small;box-shadow:3px 2px 8px 4px rgba(0, 0, 0, 0.36);overflow:hidden}.gcal-timeline-container.svelte-19ut8a9{display:flex;gap:5px}.gcal-hour-line.svelte-19ut8a9::after{content:'';position:absolute;width:100%;border-bottom:1px solid grey}.gcal-timeline.svelte-19ut8a9,.hourText.svelte-19ut8a9{overflow:hidden}.gcal-time-display.svelte-19ut8a9{position:absolute;width:95%;height:3px;background:red;overflow:visible;z-index:1}.gcal-timeline.svelte-19ut8a9{position:relative;display:flex;flex-direction:row;padding-top:5px;flex-shrink:1000;min-height:0;overflow:hidden}")}function Tb(t,e,n){let r=t.slice();return r[16]=e[n],r[18]=n,r}function Sb(t,e,n){let r=t.slice();return r[19]=e[n],r[18]=n,r}function Cb(t){let e,n,r=`${t[0]/24}px`;return{c(){e=N("div"),k(e,"class",n=""+(en(t[8]>3?"gcal-hour-line gcal-hour-line-large":"gcal-hour-line")+" svelte-19ut8a9")),he(e,"height",r)},m(i,o){G(i,e,o)},p(i,o){o&1&&r!==(r=`${i[0]/24}px`)&&he(e,"height",r)},d(i){i&&B(e)}}}function Db(t){let e,n=`${t[7](t[6])}px`;return{c(){e=N("div"),k(e,"class","gcal-time-display svelte-19ut8a9"),he(e,"top",n)},m(r,i){G(r,e,i)},p(r,i){i&64&&n!==(n=`${r[7](r[6])}px`)&&he(e,"top",n)},d(r){r&&B(e)}}}function Ob(t,e){let n,r,i=e[16].event.summary+"",o,a,u,f,c,p,h=`${e[16].y}px`,m=`${e[16].x}%`,_=`${e[16].width}%`,v=`${e[16].height}px`,b,E;function y(...D){return e[12](e[16],...D)}function O(...D){return e[13](e[16],...D)}return{key:t,first:null,c(){n=N("div"),r=N("span"),o=Me(i),u=$(),k(r,"class",a="googleCalendarName googleCalendarName_Calendar_Color_"+e[16].event.parent.colorId+" googleCalendarName_Event_Color_"+e[16].event.parent.colorId+" googleCalendarName_Id_"+e[16].event.parent.id+" svelte-19ut8a9"),k(n,"class",f="googleCalendarEvent googleCalendarEvent_Calendar_Color_"+e[16].event.parent.colorId+" googleCalendarEvent_Event_Color_"+e[16].event.parent.colorId+" googleCalendarEvent_Id_"+e[16].event.parent.id+" svelte-19ut8a9"),k(n,"id",c=e[16].event.id),he(n,"top",h),he(n,"left",m),he(n,"width",_),he(n,"height",v),he(n,"background",Fi(e[16].event)),this.first=n},m(D,F){G(D,n,F),A(n,r),A(r,o),A(n,u),b||(E=[oe(n,"click",y),oe(n,"keypress",O)],b=!0)},p(D,F){e=D,F&4&&i!==(i=e[16].event.summary+"")&&Ye(o,i),F&4&&a!==(a="googleCalendarName googleCalendarName_Calendar_Color_"+e[16].event.parent.colorId+" googleCalendarName_Event_Color_"+e[16].event.parent.colorId+" googleCalendarName_Id_"+e[16].event.parent.id+" svelte-19ut8a9")&&k(r,"class",a),F&4&&f!==(f="googleCalendarEvent googleCalendarEvent_Calendar_Color_"+e[16].event.parent.colorId+" googleCalendarEvent_Event_Color_"+e[16].event.parent.colorId+" googleCalendarEvent_Id_"+e[16].event.parent.id+" svelte-19ut8a9")&&k(n,"class",f),F&4&&c!==(c=e[16].event.id)&&k(n,"id",c),F&4&&h!==(h=`${e[16].y}px`)&&he(n,"top",h),F&4&&m!==(m=`${e[16].x}%`)&&he(n,"left",m),F&4&&_!==(_=`${e[16].width}%`)&&he(n,"width",_),F&4&&v!==(v=`${e[16].height}px`)&&he(n,"height",v),F&4&&he(n,"background",Fi(e[16].event))},i(D){p||ln(()=>{p=rf(n,e[11],{key:e[18]}),p.start()})},o:me,d(D){D&&B(n),b=!1,We(E)}}}function YN(t){let e,n,r,i,o=window.moment().isSame(t[3],"day"),a,u=[],f=new Map,c=`${t[0]}px`,p=`${t[1]}px`,h=` -${ra(t[0],t[4][0])}px 0px -${ia(t[0],t[4][1])}px 0px`,m={length:24},_=[];for(let y=0;y<m.length;y+=1)_[y]=Cb(Sb(t,m,y));let v=o&&Db(t),b=t[10](t[2]),E=y=>y[18];for(let y=0;y<b.length;y+=1){let O=Tb(t,b,y),D=E(O);f.set(D,u[y]=Ob(D,O))}return{c(){e=N("div"),n=N("div"),r=N("div");for(let y=0;y<_.length;y+=1)_[y].c();i=$(),v&&v.c(),a=$();for(let y=0;y<u.length;y+=1)u[y].c();k(r,"class","gcal-hour-line-container"),k(n,"class","gcal-timeline-container svelte-19ut8a9"),k(e,"class","gcal-timeline svelte-19ut8a9"),he(e,"height",c),he(e,"width",p),he(e,"max-width","100%"),he(e,"margin",h)},m(y,O){G(y,e,O),A(e,n),A(n,r);for(let D=0;D<_.length;D+=1)_[D]&&_[D].m(r,null);A(e,i),v&&v.m(e,null),A(e,a);for(let D=0;D<u.length;D+=1)u[D]&&u[D].m(e,null)},p(y,[O]){if(O&257){m={length:24};let D;for(D=0;D<m.length;D+=1){let F=Sb(y,m,D);_[D]?_[D].p(F,O):(_[D]=Cb(F),_[D].c(),_[D].m(r,null))}for(;D<_.length;D+=1)_[D].d(1);_.length=m.length}O&8&&(o=window.moment().isSame(y[3],"day")),o?v?v.p(y,O):(v=Db(y),v.c(),v.m(e,a)):v&&(v.d(1),v=null),O&1060&&(b=y[10](y[2]),u=Zs(u,O,E,1,y,b,f,e,Y1,Ob,null,Tb)),O&1&&c!==(c=`${y[0]}px`)&&he(e,"height",c),O&2&&p!==(p=`${y[1]}px`)&&he(e,"width",p),O&17&&h!==(h=` -${ra(y[0],y[4][0])}px 0px -${ia(y[0],y[4][1])}px 0px`)&&he(e,"margin",h)},i(y){for(let O=0;O<b.length;O+=1)se(u[O])},o:me,d(y){y&&B(e),At(_,y),v&&v.d();for(let O=0;O<u.length;O+=1)u[O].d()}}}function WN(t,e,n){let r,{height:i=700}=e,{width:o=300}=e,{events:a}=e,{day:u}=e,{hourRange:f}=e,{goToEvent:c}=e,p=D=>{let F=kl(D);return Math.floor(i*F)},m=ye.getInstance().settings.timelineHourFormat,_=vb();Ku(t,_,D=>n(6,r=D));let v=D=>{let F=[],P=new Eb.default;D.forEach(M=>{let H=M.start.date||M.start.dateTime;P.has(H)?P.get(H).push(M):P.set(H,[M])});let L=0,R=null;for(let M of P.values()){if(M[0].start.dateTime){let H=window.moment(M[0].start.dateTime);R&&H.isBefore(R,"minutes")?L++:L=0,R=window.moment(M[0].end.dateTime)}M.forEach((H,le)=>{let V=L*5,X=(100-V)/M.length;F=[...F,{event:H,x:V+X*le,y:dv(H,i),width:X,height:pv(H,i),fullDay:H.start.date!=null}]})}return F},[b,E]=Qf({duration:D=>Math.sqrt(D*200),fallback(D,F){let P=getComputedStyle(D),L=P.transform==="none"?"":P.transform;return{duration:600,easing:Jf,css:R=>`
transform: ${L} scale(${R});
opacity: ${R}
`}}}),y=(D,F)=>c(D.event,F),O=(D,F)=>c(D.event,F);return t.$$set=D=>{"height"in D&&n(0,i=D.height),"width"in D&&n(1,o=D.width),"events"in D&&n(2,a=D.events),"day"in D&&n(3,u=D.day),"hourRange"in D&&n(4,f=D.hourRange),"goToEvent"in D&&n(5,c=D.goToEvent)},[i,o,a,u,f,c,r,p,m,_,v,E,y,O]}var Mb=class extends ze{constructor(e){super();qe(this,e,WN,YN,Ge,{height:0,width:1,events:2,day:3,hourRange:4,goToEvent:5},FN)}},Ab=Mb;function jN(t){Et(t,"svelte-1uh2awq",'.gcal-hour-text-container.svelte-1uh2awq{display:flex;flex-direction:column;min-height:0;overflow:hidden}.gcal-hour-text.svelte-1uh2awq{font-family:"consolas";display:block}')}function Pb(t,e,n){let r=t.slice();return r[6]=e[n],r[8]=n,r}function Nb(t){let e,n=t[4](t[8],t[2])+"",r,i=`${t[0]/24}px`,o=`${t[0]/50}px`,a,u;return{c(){e=N("span"),r=Me(n),k(e,"class","gcal-hour-text svelte-1uh2awq"),he(e,"height",i),he(e,"font-size",o)},m(f,c){G(f,e,c),A(e,r),a||(u=[oe(e,"click",t[3]),oe(e,"keypress",t[3])],a=!0)},p(f,c){c&4&&n!==(n=f[4](f[8],f[2])+"")&&Ye(r,n),c&1&&i!==(i=`${f[0]/24}px`)&&he(e,"height",i),c&1&&o!==(o=`${f[0]/50}px`)&&he(e,"font-size",o)},d(f){f&&B(e),a=!1,We(u)}}}function BN(t){let e,n=` -${ra(t[0],t[1][0])}px 0px -${ia(t[0],t[1][1])}px 0px`,r={length:24},i=[];for(let o=0;o<r.length;o+=1)i[o]=Nb(Pb(t,r,o));return{c(){e=N("div");for(let o=0;o<i.length;o+=1)i[o].c();k(e,"class","gcal-hour-text-container svelte-1uh2awq"),he(e,"margin",n)},m(o,a){G(o,e,a);for(let u=0;u<i.length;u+=1)i[u]&&i[u].m(e,null)},p(o,[a]){if(a&29){r={length:24};let u;for(u=0;u<r.length;u+=1){let f=Pb(o,r,u);i[u]?i[u].p(f,a):(i[u]=Nb(f),i[u].c(),i[u].m(e,null))}for(;u<i.length;u+=1)i[u].d(1);i.length=r.length}a&3&&n!==(n=` -${ra(o[0],o[1][0])}px 0px -${ia(o[0],o[1][1])}px 0px`)&&he(e,"margin",n)},i:me,o:me,d(o){o&&B(e),At(i,o)}}}function GN(t,e,n){let r=ye.getInstance(),i=r.settings.timelineHourFormat,{height:o=700}=e,{hourRange:a=[0,24]}=e,u=()=>{n(2,i+=1),i>5&&n(2,i=0),r.settings.timelineHourFormat=i,r.saveSettings()},f=(c,p)=>{let h=window.moment(`${c}:00:00`,"H:mm:ss");switch(p){case 0:return h.format("H");case 1:return h.format("HH");case 2:return h.format("h");case 3:return h.format("hh");case 4:return h.format("h A");case 5:return h.format("hh A")}};return t.$$set=c=>{"height"in c&&n(0,o=c.height),"hourRange"in c&&n(1,a=c.hourRange)},[o,a,i,u,f]}var xb=class extends ze{constructor(e){super();qe(this,e,GN,BN,Ge,{height:0,hourRange:1},jN)}},Ib=xb;function UN(t){Et(t,"svelte-oeb4qr",".gcal-date-container.svelte-oeb4qr{margin-bottom:10px}.gcal-date-dayofweek.svelte-oeb4qr,.gcal-date-main.svelte-oeb4qr{margin:0px}.gcal-nav-container.svelte-oeb4qr{margin-bottom:1em}")}function zN(t){let e,n,r,i=t[0].format("dddd")+"",o,a,u,f=t[0].format("MMMM DD, YYYY")+"",c,p,h,m,_,v,b,E,y=(window.moment().isSame(t[1],"day")?"Today":"Start")+"",O,D,F,P,L,R,M,H,le;return{c(){e=N("div"),n=N("div"),r=N("h3"),o=Me(i),a=$(),u=N("h1"),c=Me(f),p=$(),h=N("div"),m=N("button"),m.textContent="<<",_=$(),v=N("button"),v.textContent="<",b=$(),E=N("button"),O=Me(y),D=$(),F=N("button"),F.textContent=">",P=$(),L=N("button"),L.textContent=">>",R=$(),M=N("button"),M.textContent="+",k(r,"class","gcal-date-dayofweek svelte-oeb4qr"),k(u,"class","gcal-date-main svelte-oeb4qr"),k(m,"class","gcal-nav-button"),k(m,"aria-label","Back 1 week"),k(v,"class","gcal-nav-button"),k(v,"aria-label","Back 1 day"),k(E,"class","gcal-nav-button"),k(E,"aria-label","Jump to today"),k(F,"class","gcal-nav-button"),k(F,"aria-label","Forward 1 day"),k(L,"class","gcal-nav-button"),k(L,"aria-label","Forward 1 week"),k(M,"class","gcal-new-event-button"),k(M,"aria-label","Create Event"),k(h,"class","gcal-nav-container svelte-oeb4qr"),k(n,"class","gcal-date-container svelte-oeb4qr"),k(e,"class","gcal-title-container")},m(V,X){G(V,e,X),A(e,n),A(n,r),A(r,o),A(n,a),A(n,u),A(u,c),A(n,p),A(n,h),A(h,m),A(h,_),A(h,v),A(h,b),A(h,E),A(E,O),A(h,D),A(h,F),A(h,P),A(h,L),A(h,R),A(h,M),H||(le=[oe(m,"click",t[2]),oe(v,"click",t[3]),oe(E,"click",t[4]),oe(F,"click",t[6]),oe(L,"click",t[5]),oe(M,"click",t[7])],H=!0)},p(V,[X]){X&1&&i!==(i=V[0].format("dddd")+"")&&Ye(o,i),X&1&&f!==(f=V[0].format("MMMM DD, YYYY")+"")&&Ye(c,f),X&2&&y!==(y=(window.moment().isSame(V[1],"day")?"Today":"Start")+"")&&Ye(O,y)},i:me,o:me,d(V){V&&B(e),H=!1,We(le)}}}function HN(t,e,n){let{date:r}=e,{startDate:i}=e,{dateOffset:o}=e,a=()=>n(8,o-=7),u=()=>n(8,o-=1),f=()=>n(8,o=0),c=()=>n(8,o+=7),p=()=>n(8,o+=1),h=m=>{new Nr({start:{},end:{}},()=>{zr(),n(0,r)}).open()};return t.$$set=m=>{"date"in m&&n(0,r=m.date),"startDate"in m&&n(1,i=m.startDate),"dateOffset"in m&&n(8,o=m.dateOffset)},[r,i,a,u,f,c,p,h,o]}var Rb=class extends ze{constructor(e){super();qe(this,e,HN,zN,Ge,{date:0,startDate:1,dateOffset:8},UN)}},pc=Rb;function qN(t){Et(t,"svelte-7dzwom",".googleCalendarEvent.svelte-7dzwom{display:flex;padding:0 10px 10px;cursor:pointer;border-radius:5px;color:black;font-size:small;box-shadow:3px 2px 8px 4px rgba(0,0,0,0.36);overflow:hidden}.eventContainer.svelte-7dzwom{grid-row:1 ;display:flex;flex-direction:column;gap:5px}.googleCalendarEvent_AllDay.svelte-7dzwom{border-radius:5px;width:100%;height:23px}")}function Lb(t,e,n){let r=t.slice();return r[5]=e[n],r}function Fb(t){let e,n,r=t[5].summary+"",i,o,a,u,f,c,p;function h(..._){return t[3](t[5],..._)}function m(..._){return t[4](t[5],..._)}return{c(){e=N("div"),n=N("span"),i=Me(r),a=$(),k(n,"class",o="googleCalendarName googleCalendarName_Calendar_Color_"+t[5].parent.colorId+" googleCalendarName_Event_Color_"+t[5].parent.colorId+" googleCalendarName_Id_"+t[5].parent.id+" googleCalendarName_AllDay svelte-7dzwom"),k(e,"class",u="googleCalendarEvent googleCalendarEvent_Calendar_Color_"+t[5].parent.colorId+" googleCalendarEvent_Event_Color_"+t[5].parent.colorId+" googleCalendarEvent_Id_"+t[5].parent.id+" googleCalendarEvent_AllDay svelte-7dzwom"),k(e,"id",f=t[5].id),he(e,"background",Fi(t[5])),he(e,"width",t[2]>0?t[2]+"px":"100%")},m(_,v){G(_,e,v),A(e,n),A(n,i),A(e,a),c||(p=[oe(e,"click",h),oe(e,"keypress",m)],c=!0)},p(_,v){t=_,v&1&&r!==(r=t[5].summary+"")&&Ye(i,r),v&1&&o!==(o="googleCalendarName googleCalendarName_Calendar_Color_"+t[5].parent.colorId+" googleCalendarName_Event_Color_"+t[5].parent.colorId+" googleCalendarName_Id_"+t[5].parent.id+" googleCalendarName_AllDay svelte-7dzwom")&&k(n,"class",o),v&1&&u!==(u="googleCalendarEvent googleCalendarEvent_Calendar_Color_"+t[5].parent.colorId+" googleCalendarEvent_Event_Color_"+t[5].parent.colorId+" googleCalendarEvent_Id_"+t[5].parent.id+" googleCalendarEvent_AllDay svelte-7dzwom")&&k(e,"class",u),v&1&&f!==(f=t[5].id)&&k(e,"id",f),v&1&&he(e,"background",Fi(t[5])),v&4&&he(e,"width",t[2]>0?t[2]+"px":"100%")},d(_){_&&B(e),c=!1,We(p)}}}function VN(t){let e,n=t[0],r=[];for(let i=0;i<n.length;i+=1)r[i]=Fb(Lb(t,n,i));return{c(){e=N("div");for(let i=0;i<r.length;i+=1)r[i].c();k(e,"class","eventContainer svelte-7dzwom")},m(i,o){G(i,e,o);for(let a=0;a<r.length;a+=1)r[a]&&r[a].m(e,null)},p(i,[o]){if(o&7){n=i[0];let a;for(a=0;a<n.length;a+=1){let u=Lb(i,n,a);r[a]?r[a].p(u,o):(r[a]=Fb(u),r[a].c(),r[a].m(e,null))}for(;a<r.length;a+=1)r[a].d(1);r.length=n.length}},i:me,o:me,d(i){i&&B(e),At(r,i)}}}function KN(t,e,n){let{events:r}=e,{goToEvent:i}=e,{width:o=0}=e,a=(f,c)=>i(f,c),u=(f,c)=>i(f,c);return t.$$set=f=>{"events"in f&&n(0,r=f.events),"goToEvent"in f&&n(1,i=f.goToEvent),"width"in f&&n(2,o=f.width)},[r,i,o,a,u]}var Yb=class extends ze{constructor(e){super();qe(this,e,KN,VN,Ge,{events:0,goToEvent:1,width:2},qN)}},Wb=Yb;function ZN(t){Et(t,"svelte-12s6vs0",".gcal-stop-overflow.svelte-12s6vs0.svelte-12s6vs0{overflow:hidden;min-width:0;min-height:0}.gcal-week-container.svelte-12s6vs0.svelte-12s6vs0{position:relative;display:inline-grid;gap:1em;grid-auto-flow:row;overflow:hidden}.gcal-week-container.svelte-12s6vs0>.svelte-12s6vs0{min-width:0px;min-height:0px}.gcal-day-container.svelte-12s6vs0.svelte-12s6vs0{width:100%;display:grid;justify-content:center;align-items:center}.gcal-day.svelte-12s6vs0.svelte-12s6vs0,.gcal-dayofweek.svelte-12s6vs0.svelte-12s6vs0{display:flex;align-items:center;justify-content:center;font-size:medium}.gcal-day.svelte-12s6vs0.svelte-12s6vs0{font-weight:700;font-size:x-large}")}function jb(t,e,n){let r=t.slice();return r[20]=e[n],r[22]=n,r}function Bb(t,e,n){let r=t.slice();return r[20]=e[n],r[22]=n,r}function Gb(t,e,n){let r=t.slice();return r[20]=e[n],r[22]=n,r}function Ub(t){let e,n,r,i;function o(f){t[10](f)}function a(f){t[11](f)}let u={};return t[0]!==void 0&&(u.codeBlockOptions=t[0]),t[1]!==void 0&&(u.showSettings=t[1]),e=new di({props:u}),Ne.push(()=>tt(e,"codeBlockOptions",o)),Ne.push(()=>tt(e,"showSettings",a)),{c(){ct(e.$$.fragment)},m(f,c){ut(e,f,c),i=!0},p(f,c){let p={};!n&&c&1&&(n=!0,p.codeBlockOptions=f[0],et(()=>n=!1)),!r&&c&2&&(r=!0,p.showSettings=f[1],et(()=>r=!1)),e.$set(p)},i(f){i||(se(e.$$.fragment,f),i=!0)},o(f){de(e.$$.fragment,f),i=!1},d(f){st(e,f)}}}function zb(t){let e,n,r,i,o;function a(p){t[12](p)}function u(p){t[13](p)}function f(p){t[14](p)}let c={};return t[4]!==void 0&&(c.dateOffset=t[4]),t[5]!==void 0&&(c.date=t[5]),t[3]!==void 0&&(c.startDate=t[3]),e=new pc({props:c}),Ne.push(()=>tt(e,"dateOffset",a)),Ne.push(()=>tt(e,"date",u)),Ne.push(()=>tt(e,"startDate",f)),{c(){ct(e.$$.fragment)},m(p,h){ut(e,p,h),o=!0},p(p,h){let m={};!n&&h&16&&(n=!0,m.dateOffset=p[4],et(()=>n=!1)),!r&&h&32&&(r=!0,m.date=p[5],et(()=>r=!1)),!i&&h&8&&(i=!0,m.startDate=p[3],et(()=>i=!1)),e.$set(m)},i(p){o||(se(e.$$.fragment,p),o=!0)},o(p){de(e.$$.fragment,p),o=!1},d(p){st(e,p)}}}function XN(t){let e,n,r;return{c(){e=N("div"),n=$(),r=N("div"),k(e,"class","gcal-stop-overflow svelte-12s6vs0"),k(r,"class","gcal-stop-overflow svelte-12s6vs0")},m(i,o){G(i,e,o),G(i,n,o),G(i,r,o)},p:me,d(i){i&&B(e),i&&B(n),i&&B(r)}}}function JN(t){let e,n,r,i=t[8](t[5]),o=[];for(let a=0;a<i.length;a+=1)o[a]=Hb(Gb(t,i,a));return{c(){e=N("div"),n=$();for(let a=0;a<o.length;a+=1)o[a].c();r=zt(),k(e,"class","gcal-stop-overflow svelte-12s6vs0")},m(a,u){G(a,e,u),G(a,n,u);for(let f=0;f<o.length;f+=1)o[f]&&o[f].m(a,u);G(a,r,u)},p(a,u){if(u&288){i=a[8](a[5]);let f;for(f=0;f<i.length;f+=1){let c=Gb(a,i,f);o[f]?o[f].p(c,u):(o[f]=Hb(c),o[f].c(),o[f].m(r.parentNode,r))}for(;f<o.length;f+=1)o[f].d(1);o.length=i.length}},d(a){a&&B(e),a&&B(n),At(o,a),a&&B(r)}}}function Hb(t){let e,n,r=t[20].format("ddd")+"",i,o,a,u=t[20].format("D")+"",f,c;return{c(){e=N("div"),n=N("span"),i=Me(r),o=$(),a=N("span"),f=Me(u),c=$(),k(n,"class","gcal-dayofweek svelte-12s6vs0"),k(a,"class","gcal-day svelte-12s6vs0"),k(e,"class","gcal-day-container svelte-12s6vs0")},m(p,h){G(p,e,h),A(e,n),A(n,i),A(e,o),A(e,a),A(a,f),A(e,c)},p(p,h){h&32&&r!==(r=p[20].format("ddd")+"")&&Ye(i,r),h&32&&u!==(u=p[20].format("D")+"")&&Ye(f,u)},d(p){p&&B(e)}}}function qb(t){let e,n,r,i,o=t[8](t[5]),a=[];for(let f=0;f<o.length;f+=1)a[f]=Vb(Bb(t,o,f));let u=f=>de(a[f],1,1,()=>{a[f]=null});return{c(){e=N("div"),n=$();for(let f=0;f<a.length;f+=1)a[f].c();r=zt(),k(e,"class","gcal-stop-overflow svelte-12s6vs0")},m(f,c){G(f,e,c),G(f,n,c);for(let p=0;p<a.length;p+=1)a[p]&&a[p].m(f,c);G(f,r,c),i=!0},p(f,c){if(c&480){o=f[8](f[5]);let p;for(p=0;p<o.length;p+=1){let h=Bb(f,o,p);a[p]?(a[p].p(h,c),se(a[p],1)):(a[p]=Vb(h),a[p].c(),se(a[p],1),a[p].m(r.parentNode,r))}for(Je(),p=o.length;p<a.length;p+=1)u(p);Qe()}},i(f){if(!i){for(let c=0;c<o.length;c+=1)se(a[c]);i=!0}},o(f){a=a.filter(Boolean);for(let c=0;c<a.length;c+=1)de(a[c]);i=!1},d(f){f&&B(e),f&&B(n),At(a,f),f&&B(r)}}}function Vb(t){let e,n,r,i;function o(...a){return t[15](t[20],...a)}return n=new Wb({props:{goToEvent:t[7],events:t[6].filter(o)}}),{c(){e=N("div"),ct(n.$$.fragment),r=$(),k(e,"class","gcal-stop-overflow svelte-12s6vs0")},m(a,u){G(a,e,u),ut(n,e,null),A(e,r),i=!0},p(a,u){t=a;let f={};u&96&&(f.events=t[6].filter(o)),n.$set(f)},i(a){i||(se(n.$$.fragment,a),i=!0)},o(a){de(n.$$.fragment,a),i=!1},d(a){a&&B(e),st(n)}}}function Kb(t){let e,n,r,i;function o(...a){return t[16](t[20],...a)}return n=new Ab({props:{events:t[6].filter(o),day:t[20],hourRange:t[0].hourRange,goToEvent:t[7]}}),{c(){e=N("div"),ct(n.$$.fragment),r=$(),k(e,"class","gcal-stop-overflow svelte-12s6vs0")},m(a,u){G(a,e,u),ut(n,e,null),A(e,r),i=!0},p(a,u){t=a;let f={};u&96&&(f.events=t[6].filter(o)),u&32&&(f.day=t[20]),u&1&&(f.hourRange=t[0].hourRange),n.$set(f)},i(a){i||(se(n.$$.fragment,a),i=!0)},o(a){de(n.$$.fragment,a),i=!1},d(a){a&&B(e),st(n)}}}function QN(t){let e,n,r,i,o,a,u,f,c,p=`auto repeat(${t[0].timespan},
minmax(0, 1fr))`,h,m=t[2]&&Ub(t),_=t[0].navigation&&t[5]&&zb(t);function v(P,L){return P[0].timespan>1?JN:XN}let b=v(t,-1),E=b(t),y=t[0].showAllDay&&qb(t);f=new Ib({props:{hourRange:t[0].hourRange}});let O=t[8](t[5]),D=[];for(let P=0;P<O.length;P+=1)D[P]=Kb(jb(t,O,P));let F=P=>de(D[P],1,1,()=>{D[P]=null});return{c(){m&&m.c(),e=$(),n=N("div"),_&&_.c(),r=$(),i=N("div"),E.c(),o=$(),y&&y.c(),a=$(),u=N("div"),ct(f.$$.fragment),c=$();for(let P=0;P<D.length;P+=1)D[P].c();k(u,"class","gcal-stop-overflow svelte-12s6vs0"),k(i,"class","gcal-week-container svelte-12s6vs0"),he(i,"grid-template-columns",p),he(n,"padding-left","10px")},m(P,L){m&&m.m(P,L),G(P,e,L),G(P,n,L),_&&_.m(n,null),A(n,r),A(n,i),E.m(i,null),A(i,o),y&&y.m(i,null),A(i,a),A(i,u),ut(f,u,null),A(i,c);for(let R=0;R<D.length;R+=1)D[R]&&D[R].m(i,null);h=!0},p(P,[L]){P[2]?m?(m.p(P,L),L&4&&se(m,1)):(m=Ub(P),m.c(),se(m,1),m.m(e.parentNode,e)):m&&(Je(),de(m,1,1,()=>{m=null}),Qe()),P[0].navigation&&P[5]?_?(_.p(P,L),L&33&&se(_,1)):(_=zb(P),_.c(),se(_,1),_.m(n,r)):_&&(Je(),de(_,1,1,()=>{_=null}),Qe()),b===(b=v(P,L))&&E?E.p(P,L):(E.d(1),E=b(P),E&&(E.c(),E.m(i,o))),P[0].showAllDay?y?(y.p(P,L),L&1&&se(y,1)):(y=qb(P),y.c(),se(y,1),y.m(i,a)):y&&(Je(),de(y,1,1,()=>{y=null}),Qe());let R={};if(L&1&&(R.hourRange=P[0].hourRange),f.$set(R),L&481){O=P[8](P[5]);let M;for(M=0;M<O.length;M+=1){let H=jb(P,O,M);D[M]?(D[M].p(H,L),se(D[M],1)):(D[M]=Kb(H),D[M].c(),se(D[M],1),D[M].m(i,null))}for(Je(),M=O.length;M<D.length;M+=1)F(M);Qe()}L&1&&p!==(p=`auto repeat(${P[0].timespan},
minmax(0, 1fr))`)&&he(i,"grid-template-columns",p)},i(P){if(!h){se(m),se(_),se(y),se(f.$$.fragment,P);for(let L=0;L<O.length;L+=1)se(D[L]);h=!0}},o(P){de(m),de(_),de(y),de(f.$$.fragment,P),D=D.filter(Boolean);for(let L=0;L<D.length;L+=1)de(D[L]);h=!1},d(P){m&&m.d(P),P&&B(e),P&&B(n),_&&_.d(),E.d(),y&&y.d(),st(f),At(D,P)}}}function $N(t,e,n){let{codeBlockOptions:r}=e,{isObsidianView:i=!1}=e,{showSettings:o=!1}=e,a=r.date?window.moment(r.date):window.moment(),u=0,f,c=!1,p=[],h,m=R=>Tt(void 0,void 0,void 0,function*(){if(!(R==null?void 0:R.isValid())){c=!1;return}let M=yield Yt({startDate:R,endDate:R.clone().add(r.timespan,"days"),include:r.include,exclude:r.exclude});JSON.stringify(M)!=JSON.stringify(p)&&n(6,p=M)}),_=R=>Tt(void 0,void 0,void 0,function*(){c||(c=!0,yield m(R),c=!1)}),v=(R,M)=>{M.shiftKey?window.open(R.htmlLink):new Nr(R,()=>{zr(),_(f)}).open()},b=R=>{let M=[];for(let H=0;H<r.timespan;H++)M=[...M,R.clone().add(H,"days")];return M};Jo(()=>{clearInterval(h)});function E(R){r=R,n(0,r)}function y(R){o=R,n(1,o)}function O(R){u=R,n(4,u)}function D(R){f=R,n(5,f),n(0,r),n(3,a),n(4,u),n(9,h)}function F(R){a=R,n(3,a),n(0,r),n(4,u),n(9,h),n(5,f)}let P=(R,M)=>M.start.date&&window.moment(M.start.date).isSame(R,"day"),L=(R,M)=>M.start.dateTime&&window.moment(M.start.dateTime).isSame(R,"day");return t.$$set=R=>{"codeBlockOptions"in R&&n(0,r=R.codeBlockOptions),"isObsidianView"in R&&n(2,i=R.isObsidianView),"showSettings"in R&&n(1,o=R.showSettings)},t.$$.update=()=>{if(t.$$.dirty&569){e:n(3,a=r.date?window.moment(r.date).add(r.offset,"days"):window.moment().add(r.offset,"days")),n(5,f=r.navigation?a.clone().local().add(u,"days"):a),h&&clearInterval(h),n(9,h=setInterval(()=>_(f),5e3)),_(f)}},[r,o,i,a,u,f,p,v,b,h,E,y,O,D,F,P,L]}var Zb=class extends ze{constructor(e){super();qe(this,e,$N,QN,Ge,{codeBlockOptions:0,isObsidianView:2,showSettings:1},ZN)}},cs=Zb;var ds="google-calendar-view-day",Pl=class extends Xb.ItemView{constructor(e,n=window.moment()){super(e);this.showSettings=!1;this.setDate=e=>{this.startDate=e,this.onClose(),this.onOpen()};this.startDate=n}getViewType(){return ds}getDisplayText(){return"Timeline View"}getIcon(){return"calendar-with-checkmark"}onPaneMenu(e,n){super.onPaneMenu(e,n),this.showSettings=this.timeline.$$.ctx[1],e.addItem(r=>{r.setTitle("Refresh"),r.setIcon("sync"),r.onClick(()=>{this.onClose(),this.onOpen()})}).addSeparator().addItem(r=>{r.setTitle(this.showSettings?"Hide Settings":"Settings"),r.setIcon("gear"),r.onClick(()=>{this.showSettings=!this.showSettings,this.timeline.$set({showSettings:this.showSettings})})})}onOpen(){return te(this,null,function*(){let n=ye.getInstance().settings.viewSettings.day;n.timespan=1,this.timeline=new cs({target:this.contentEl,props:{codeBlockOptions:n,isObsidianView:!0,showSettings:this.showSettings}})})}onClose(){return te(this,null,function*(){this.timeline.$destroy()})}};var ik=Oe(require("obsidian"));function e4(t){Et(t,"svelte-tlsedz",`.gcal-schedule-day-container.svelte-tlsedz{display:flex;flex-direction:row;align-items:flex-start;border-bottom:1px solid gray;margin:2px 0px;padding:2px 0px;width:100%
}.gcal-schedule-date-display.svelte-tlsedz{display:flex;flex-direction:row;align-items:center;gap:5px;padding:0px}.gcal-schedule-day-circle.svelte-tlsedz{border-radius:50%;-moz-border-radius:50%;-webkit-border-radius:50%;display:inline-block;border:solid 1px gray;min-height:40px;min-width:40px;width:50px;height:50px;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center}.today.svelte-tlsedz{color:white;background:#4285f4;text-decoration:none}.gcal-schedule-month-text.svelte-tlsedz{font-size:small}.gcal-schedule-day-number.svelte-tlsedz{font-size:large;font-weight:700}.gcal-schedule-day-text.svelte-tlsedz{font-size:medium}.gcal-schedule-event-container.svelte-tlsedz{display:flex;flex-direction:column;overflow:hidden;width:100%}.gcal-schedule-event.svelte-tlsedz{display:flex;padding:5px;border-radius:10px;cursor:pointer}.gcal-schedule-event.svelte-tlsedz:hover{background-color:rgba(128, 128, 128, 0.129)}.gcal-schedule-event-info.svelte-tlsedz{display:flex;align-items:center}.gcal-schedule-circle-container-recurring.svelte-tlsedz,.gcal-schedule-circle-container.svelte-tlsedz{position:relative;display:flex;min-width:30px;height:30px;align-items:center;justify-content:center}.gcal-schedule-circle-container-recurring.svelte-tlsedz::after{content:"\u21BA";position:absolute;width:30px;height:30px;text-align:center;line-height:30px;font-size:30px;color:rgb(164, 164, 164);top:1.5px;white-space:nowrap}.gcal-schedule-event-circle.svelte-tlsedz{width:10px;min-width:10px;height:10px;border-radius:50%}.gcal-schedule-time-container.svelte-tlsedz{min-width:150px;padding-right:1em}.gcal-schedule-event-title-container.svelte-tlsedz{display:flex;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.gcal-schedule-event-title.svelte-tlsedz{font-size:medium;font-weight:400;overflow:hidden;text-overflow:ellipsis}.breakLine.svelte-tlsedz{flex-direction:column;margin-bottom:10px}`)}function Jb(t,e,n){let r=t.slice();return r[30]=e[n][0],r[9]=e[n][1],r}function Qb(t,e,n){let r=t.slice();return r[33]=e[n],r}function $b(t){let e,n,r,i;function o(f){t[16](f)}function a(f){t[17](f)}let u={};return t[0]!==void 0&&(u.codeBlockOptions=t[0]),t[1]!==void 0&&(u.showSettings=t[1]),e=new di({props:u}),Ne.push(()=>tt(e,"codeBlockOptions",o)),Ne.push(()=>tt(e,"showSettings",a)),{c(){ct(e.$$.fragment)},m(f,c){ut(e,f,c),i=!0},p(f,c){let p={};!n&&c[0]&1&&(n=!0,p.codeBlockOptions=f[0],et(()=>n=!1)),!r&&c[0]&2&&(r=!0,p.showSettings=f[1],et(()=>r=!1)),e.$set(p)},i(f){i||(se(e.$$.fragment,f),i=!0)},o(f){de(e.$$.fragment,f),i=!1},d(f){st(e,f)}}}function ek(t){let e,n,r,i,o;function a(p){t[18](p)}function u(p){t[19](p)}function f(p){t[20](p)}let c={};return t[4]!==void 0&&(c.dateOffset=t[4]),t[5]!==void 0&&(c.date=t[5]),t[3]!==void 0&&(c.startDate=t[3]),e=new pc({props:c}),Ne.push(()=>tt(e,"dateOffset",a)),Ne.push(()=>tt(e,"date",u)),Ne.push(()=>tt(e,"startDate",f)),{c(){ct(e.$$.fragment)},m(p,h){ut(e,p,h),o=!0},p(p,h){let m={};!n&&h[0]&16&&(n=!0,m.dateOffset=p[4],et(()=>n=!1)),!r&&h[0]&32&&(r=!0,m.date=p[5],et(()=>r=!1)),!i&&h[0]&8&&(i=!0,m.startDate=p[3],et(()=>i=!1)),e.$set(m)},i(p){o||(se(e.$$.fragment,p),o=!0)},o(p){de(e.$$.fragment,p),o=!1},d(p){st(e,p)}}}function tk(t){let e,n,r,i,o,a,u,f,c=t[10](t[33],t[7])+"",p,h,m,_,v=t[33].summary+"",b,E,y,O,D;function F(...L){return t[23](t[33],...L)}function P(...L){return t[24](t[33],...L)}return{c(){e=N("div"),n=N("div"),r=N("div"),i=N("div"),a=$(),u=N("div"),f=N("span"),p=Me(c),h=$(),m=N("div"),_=N("span"),b=Me(v),E=$(),k(i,"class","gcal-schedule-event-circle svelte-tlsedz"),he(i,"background",Fi(t[33])),k(r,"class",o=""+(en(t[33].recurringEventId?"gcal-schedule-circle-container-recurring":"gcal-schedule-circle-container")+" svelte-tlsedz")),k(u,"class","gcal-schedule-time-container svelte-tlsedz"),k(n,"class","gcal-schedule-event-info svelte-tlsedz"),k(_,"class","gcal-schedule-event-title svelte-tlsedz"),k(m,"class","gcal-schedule-event-title-container svelte-tlsedz"),k(e,"class",y=""+(en(t[8]<200?"gcal-schedule-event breakLine":"gcal-schedule-event")+" svelte-tlsedz"))},m(L,R){G(L,e,R),A(e,n),A(n,r),A(r,i),A(n,a),A(n,u),A(u,f),A(f,p),A(e,h),A(e,m),A(m,_),A(_,b),A(e,E),O||(D=[oe(e,"click",F),oe(e,"keypress",P)],O=!0)},p(L,R){t=L,R[0]&64&&he(i,"background",Fi(t[33])),R[0]&64&&o!==(o=""+(en(t[33].recurringEventId?"gcal-schedule-circle-container-recurring":"gcal-schedule-circle-container")+" svelte-tlsedz"))&&k(r,"class",o),R[0]&192&&c!==(c=t[10](t[33],t[7])+"")&&Ye(p,c),R[0]&64&&v!==(v=t[33].summary+"")&&Ye(b,v),R[0]&256&&y!==(y=""+(en(t[8]<200?"gcal-schedule-event breakLine":"gcal-schedule-event")+" svelte-tlsedz"))&&k(e,"class",y)},d(L){L&&B(e),O=!1,We(D)}}}function nk(t){let e,n,r,i,o=t[30].slice(3,6)+"",a,u,f,c=t[30].slice(0,2)+"",p,h,m,_,v=t[30].slice(7)+"",b,E,y,O,D,F,P;function L(){return t[21](t[9])}function R(){return t[22](t[9])}let M=t[9],H=[];for(let le=0;le<M.length;le+=1)H[le]=tk(Qb(t,M,le));return{c(){e=N("div"),n=N("div"),r=N("div"),i=N("span"),a=Me(o),u=$(),f=N("span"),p=Me(c),m=$(),_=N("span"),b=Me(v),E=$(),y=N("div");for(let le=0;le<H.length;le+=1)H[le].c();O=$(),k(i,"class","gcal-schedule-month-text svelte-tlsedz"),k(f,"class","gcal-schedule-day-number svelte-tlsedz"),k(r,"class",h=""+(en(t[13](t[9][0])?"gcal-schedule-day-circle today":"gcal-schedule-day-circle")+" svelte-tlsedz")),he(r,"display","flex"),he(r,"flex-direction","column"),k(_,"class","gcal-schedule-day-text svelte-tlsedz"),k(n,"class","gcal-schedule-date-display svelte-tlsedz"),k(y,"class","gcal-schedule-event-container svelte-tlsedz"),k(e,"class",D=""+(en(t[8]<550?"gcal-schedule-day-container breakLine":"gcal-schedule-day-container")+" svelte-tlsedz"))},m(le,V){G(le,e,V),A(e,n),A(n,r),A(r,i),A(i,a),A(r,u),A(r,f),A(f,p),A(n,m),A(n,_),A(_,b),A(e,E),A(e,y);for(let X=0;X<H.length;X+=1)H[X]&&H[X].m(y,null);A(e,O),F||(P=[oe(r,"click",L),oe(r,"keypress",R),oe(_,"click",t[14]),oe(_,"keypress",t[14])],F=!0)},p(le,V){if(t=le,V[0]&64&&o!==(o=t[30].slice(3,6)+"")&&Ye(a,o),V[0]&64&&c!==(c=t[30].slice(0,2)+"")&&Ye(p,c),V[0]&64&&h!==(h=""+(en(t[13](t[9][0])?"gcal-schedule-day-circle today":"gcal-schedule-day-circle")+" svelte-tlsedz"))&&k(r,"class",h),V[0]&64&&v!==(v=t[30].slice(7)+"")&&Ye(b,v),V[0]&3520){M=t[9];let X;for(X=0;X<M.length;X+=1){let K=Qb(t,M,X);H[X]?H[X].p(K,V):(H[X]=tk(K),H[X].c(),H[X].m(y,null))}for(;X<H.length;X+=1)H[X].d(1);H.length=M.length}V[0]&256&&D!==(D=""+(en(t[8]<550?"gcal-schedule-day-container breakLine":"gcal-schedule-day-container")+" svelte-tlsedz"))&&k(e,"class",D)},d(le){le&&B(e),At(H,le),F=!1,We(P)}}}function t4(t){let e,n,r,i,o,a=t[2]&&$b(t),u=t[0].navigation&&t[5]&&ek(t),f=[...t[6]],c=[];for(let p=0;p<f.length;p+=1)c[p]=nk(Jb(t,f,p));return{c(){a&&a.c(),e=$(),n=N("div"),u&&u.c(),r=$();for(let p=0;p<c.length;p+=1)c[p].c();k(n,"class","gcal-schedule-container"),ln(()=>t[25].call(n))},m(p,h){a&&a.m(p,h),G(p,e,h),G(p,n,h),u&&u.m(n,null),A(n,r);for(let m=0;m<c.length;m+=1)c[m]&&c[m].m(n,null);i=O1(n,t[25].bind(n)),o=!0},p(p,h){if(p[2]?a?(a.p(p,h),h[0]&4&&se(a,1)):(a=$b(p),a.c(),se(a,1),a.m(e.parentNode,e)):a&&(Je(),de(a,1,1,()=>{a=null}),Qe()),p[0].navigation&&p[5]?u?(u.p(p,h),h[0]&33&&se(u,1)):(u=ek(p),u.c(),se(u,1),u.m(n,r)):u&&(Je(),de(u,1,1,()=>{u=null}),Qe()),h[0]&32192){f=[...p[6]];let m;for(m=0;m<f.length;m+=1){let _=Jb(p,f,m);c[m]?c[m].p(_,h):(c[m]=nk(_),c[m].c(),c[m].m(n,null))}for(;m<c.length;m+=1)c[m].d(1);c.length=f.length}},i(p){o||(se(a),se(u),o=!0)},o(p){de(a),de(u),o=!1},d(p){a&&a.d(p),p&&B(e),p&&B(n),u&&u.d(),At(c,p),i()}}}function n4(t,e,n){let{codeBlockOptions:r}=e,{isObsidianView:i=!1}=e,{showSettings:o=!1}=e,a=ye.getInstance(),u=r.date?window.moment(r.date):window.moment(),f=0,c,p=!1,h=[],m,_=new Map,v=a.settings.timelineHourFormat,b,E=j=>Tt(void 0,void 0,void 0,function*(){if(p)return;if(!(j==null?void 0:j.isValid())){p=!1;return}n(7,v=a.settings.timelineHourFormat);let U=yield Yt({startDate:j,endDate:j.clone().add(r.timespan-1,"day"),include:r.include,exclude:r.exclude});if(U=U.filter(J=>{if(J.start.date)return r.showAllDay;let re=window.moment(J.start.dateTime),Y=window.moment(J.end.dateTime),z=re.minutes()>0?re.hour()+1:re.hour(),ee=Y.minutes()>0?Y.hour()+1:Y.hour();return z>=r.hourRange[0]&&z<=r.hourRange[1]||ee>=r.hourRange[0]&&ee<=r.hourRange[1]||z<r.hourRange[0]&&ee>r.hourRange[1]}),JSON.stringify(U)==JSON.stringify(h)){p=!1;return}_.clear(),n(9,h=U),h.forEach(J=>{let re=J.start.date?window.moment(J.start.date).format("DD MMM, ddd"):window.moment(J.start.dateTime).format("DD MMM, ddd");_.has(re)?_.get(re).push(J):_.set(re,[J])}),n(6,_)}),y=(j,U)=>{switch(U){case 0:return j.format("H:mm");case 1:return j.format("HH:mm");case 2:return j.format("h:mm");case 3:return j.format("hh:mm");case 4:return j.format("h:mm A");case 5:return j.format("hh:mm A")}},O=(j,U)=>{if(j.start.date)return"All day";{let J=y(window.moment(j.start.dateTime),U),re=y(window.moment(j.end.dateTime),U);return`${J}-${re}`}},D=(j,U)=>{U.shiftKey?window.open(j.htmlLink):new Nr(j,()=>{zr(),E(c)}).open()},F=j=>Tt(void 0,void 0,void 0,function*(){let U=window.moment(j.start.date||j.start.dateTime),J=yield Yt({startDate:U});new dr(J,"details",U,!1,()=>{zr(),E(c)}).open()}),P=j=>{let U=window.moment(j.start.date||j.start.dateTime);return window.moment().local().isSame(U,"day")};Jo(()=>{clearInterval(m)});let L=()=>{n(7,v+=1),v>5&&n(7,v=0),a.settings.timelineHourFormat=v,a.saveSettings()};function R(j){r=j,n(0,r)}function M(j){o=j,n(1,o)}function H(j){f=j,n(4,f)}function le(j){c=j,n(5,c),n(0,r),n(3,u),n(4,f),n(15,m)}function V(j){u=j,n(3,u),n(0,r),n(4,f),n(15,m),n(5,c)}let X=j=>F(j[0]),K=j=>F(j[0]),ce=(j,U)=>D(j,U),S=(j,U)=>D(j,U);function Q(){b=this.clientWidth,n(8,b)}return t.$$set=j=>{"codeBlockOptions"in j&&n(0,r=j.codeBlockOptions),"isObsidianView"in j&&n(2,i=j.isObsidianView),"showSettings"in j&&n(1,o=j.showSettings)},t.$$.update=()=>{if(t.$$.dirty[0]&32825){e:n(3,u=r.date?window.moment(r.date).add(r.offset,"days"):window.moment().add(r.offset,"days")),n(5,c=r.navigation?u.clone().local().add(f,"days"):u),m&&clearInterval(m),n(15,m=setInterval(()=>E(c),5e3)),E(c)}},[r,o,i,u,f,c,_,v,b,h,O,D,F,P,L,m,R,M,H,le,V,X,K,ce,S,Q]}var rk=class extends ze{constructor(e){super();qe(this,e,n4,t4,Ge,{codeBlockOptions:0,isObsidianView:2,showSettings:1},e4,[-1,-1])}},hc=rk;var To="google-calendar-view-schedule",ba=class extends ik.ItemView{constructor(e,n=window.moment()){super(e);this.showSettings=!1;this.setDate=e=>{this.startDate=e,this.onClose(),this.onOpen()};this.startDate=n}getViewType(){return To}getDisplayText(){return"Schedule View"}getIcon(){return"calendar-with-checkmark"}onPaneMenu(e,n){super.onPaneMenu(e,n),this.showSettings=this.calendar.$$.ctx[1],e.addItem(r=>{r.setTitle("Refresh"),r.setIcon("sync"),r.onClick(()=>{this.onClose(),this.onOpen()})}).addSeparator().addItem(r=>{r.setTitle(this.showSettings?"Hide Settings":"Settings"),r.setIcon("gear"),r.onClick(()=>{this.showSettings=!this.showSettings,this.calendar.$set({showSettings:this.showSettings})})})}onOpen(){return te(this,null,function*(){let n=ye.getInstance().settings.viewSettings.schedule;this.calendar=new hc({target:this.contentEl,props:{codeBlockOptions:n,isObsidianView:!0,showSettings:this.showSettings}})})}onClose(){return te(this,null,function*(){this.calendar.$destroy()})}};var ok=Oe(require("obsidian"));var So="google-calendar-view-week",Nl=class extends ok.ItemView{constructor(e,n=window.moment()){super(e);this.showSettings=!1;this.setDate=e=>{this.startDate=e,this.onClose(),this.onOpen()};this.startDate=n}getViewType(){return So}getDisplayText(){return"Week View"}getIcon(){return"calendar-with-checkmark"}onPaneMenu(e,n){super.onPaneMenu(e,n),this.showSettings=this.calendar.$$.ctx[1],e.addItem(r=>{r.setTitle("Refresh"),r.setIcon("sync"),r.onClick(()=>{this.onClose(),this.onOpen()})}).addSeparator().addItem(r=>{r.setTitle(this.showSettings?"Hide Settings":"Settings"),r.setIcon("gear"),r.onClick(()=>{this.showSettings=!this.showSettings,this.calendar.$set({showSettings:this.showSettings})})})}onOpen(){return te(this,null,function*(){let n=ye.getInstance().settings.viewSettings.week;this.calendar=new cs({target:this.contentEl,props:{codeBlockOptions:n,isObsidianView:!0,showSettings:this.showSettings}})})}onClose(){return te(this,null,function*(){this.calendar.$destroy()})}};function ak(t){let e,n,r,i;function o(f){t[14](f)}function a(f){t[15](f)}let u={};return t[0]!==void 0&&(u.codeBlockOptions=t[0]),t[1]!==void 0&&(u.showSettings=t[1]),e=new di({props:u}),Ne.push(()=>tt(e,"codeBlockOptions",o)),Ne.push(()=>tt(e,"showSettings",a)),{c(){ct(e.$$.fragment)},m(f,c){ut(e,f,c),i=!0},p(f,c){let p={};!n&&c&1&&(n=!0,p.codeBlockOptions=f[0],et(()=>n=!1)),!r&&c&2&&(r=!0,p.showSettings=f[1],et(()=>r=!1)),e.$set(p)},i(f){i||(se(e.$$.fragment,f),i=!0)},o(f){de(e.$$.fragment,f),i=!1},d(f){st(e,f)}}}function r4(t){let e,n,r,i=`${t[0].width}px`,o=`${t[0].height}px`,a,u=[s4,o4],f=[];function c(p,h){return p[4]?0:1}return n=c(t,-1),r=f[n]=u[n](t),{c(){e=N("div"),r.c(),k(e,"class","gcal-calendar-container"),he(e,"width",i),he(e,"height",o)},m(p,h){G(p,e,h),f[n].m(e,null),a=!0},p(p,h){let m=n;n=c(p,h),n===m?f[n].p(p,h):(Je(),de(f[m],1,1,()=>{f[m]=null}),Qe(),r=f[n],r?r.p(p,h):(r=f[n]=u[n](p),r.c()),se(r,1),r.m(e,null)),h&1&&i!==(i=`${p[0].width}px`)&&he(e,"width",i),h&1&&o!==(o=`${p[0].height}px`)&&he(e,"height",o)},i(p){a||(se(r),a=!0)},o(p){de(r),a=!1},d(p){p&&B(e),f[n].d()}}}function i4(t){let e,n,r,i,o=[l4,a4],a=[];function u(f,c){return f[4]?0:1}return n=u(t,-1),r=a[n]=o[n](t),{c(){e=N("div"),r.c(),k(e,"class","gcal-calendar-container")},m(f,c){G(f,e,c),a[n].m(e,null),i=!0},p(f,c){let p=n;n=u(f,c),n===p?a[n].p(f,c):(Je(),de(a[p],1,1,()=>{a[p]=null}),Qe(),r=a[n],r?r.p(f,c):(r=a[n]=o[n](f),r.c()),se(r,1),r.m(e,null))},i(f){i||(se(r),i=!0)},o(f){de(r),i=!1},d(f){f&&B(e),a[n].d()}}}function o4(t){let e,n,r,i,o,a;function u(h){t[19](h)}function f(h){t[20](h)}function c(h){t[21](h)}let p={showWeekNums:!1,onClickDay:t[8]};return t[5]!==void 0&&(p.sources=t[5]),t[3]!==void 0&&(p.displayedMonth=t[3]),t[6]!==void 0&&(p.today=t[6]),n=new cc({props:p}),Ne.push(()=>tt(n,"sources",u)),Ne.push(()=>tt(n,"displayedMonth",f)),Ne.push(()=>tt(n,"today",c)),{c(){e=N("div"),ct(n.$$.fragment),he(e,"--theme-color",t[7].settings.dailyNoteDotColor)},m(h,m){G(h,e,m),ut(n,e,null),a=!0},p(h,m){let _={};!r&&m&32&&(r=!0,_.sources=h[5],et(()=>r=!1)),!i&&m&8&&(i=!0,_.displayedMonth=h[3],et(()=>i=!1)),!o&&m&64&&(o=!0,_.today=h[6],et(()=>o=!1)),n.$set(_),(!a||m&128)&&he(e,"--theme-color",h[7].settings.dailyNoteDotColor)},i(h){a||(se(n.$$.fragment,h),a=!0)},o(h){de(n.$$.fragment,h),a=!1},d(h){h&&B(e),st(n)}}}function s4(t){let e;return{c(){e=N("p"),e.textContent="Loading..."},m(n,r){G(n,e,r)},p:me,i:me,o:me,d(n){n&&B(e)}}}function a4(t){let e,n,r,i,o,a;function u(h){t[16](h)}function f(h){t[17](h)}function c(h){t[18](h)}let p={showWeekNums:t[7].settings.useWeeklyNotes,onClickDay:t[8],onClickWeek:t[9],onContextMenuDay:t[10],onContextMenuWeek:t[11]};return t[5]!==void 0&&(p.sources=t[5]),t[3]!==void 0&&(p.displayedMonth=t[3]),t[6]!==void 0&&(p.today=t[6]),n=new cc({props:p}),Ne.push(()=>tt(n,"sources",u)),Ne.push(()=>tt(n,"displayedMonth",f)),Ne.push(()=>tt(n,"today",c)),{c(){e=N("div"),ct(n.$$.fragment),he(e,"--daily-dot-color",t[7].settings.dailyNoteDotColor)},m(h,m){G(h,e,m),ut(n,e,null),a=!0},p(h,m){let _={};m&128&&(_.showWeekNums=h[7].settings.useWeeklyNotes),!r&&m&32&&(r=!0,_.sources=h[5],et(()=>r=!1)),!i&&m&8&&(i=!0,_.displayedMonth=h[3],et(()=>i=!1)),!o&&m&64&&(o=!0,_.today=h[6],et(()=>o=!1)),n.$set(_),(!a||m&128)&&he(e,"--daily-dot-color",h[7].settings.dailyNoteDotColor)},i(h){a||(se(n.$$.fragment,h),a=!0)},o(h){de(n.$$.fragment,h),a=!1},d(h){h&&B(e),st(n)}}}function l4(t){let e;return{c(){e=N("p"),e.textContent="Loading..."},m(n,r){G(n,e,r)},p:me,i:me,o:me,d(n){n&&B(e)}}}function u4(t){let e,n,r,i,o,a=t[2]&&ak(t),u=[i4,r4],f=[];function c(p,h){return!p[0].width||!p[0].height?0:1}return n=c(t,-1),r=f[n]=u[n](t),{c(){a&&a.c(),e=$(),r.c(),i=zt()},m(p,h){a&&a.m(p,h),G(p,e,h),f[n].m(p,h),G(p,i,h),o=!0},p(p,[h]){p[2]?a?(a.p(p,h),h&4&&se(a,1)):(a=ak(p),a.c(),se(a,1),a.m(e.parentNode,e)):a&&(Je(),de(a,1,1,()=>{a=null}),Qe());let m=n;n=c(p,h),n===m?f[n].p(p,h):(Je(),de(f[m],1,1,()=>{f[m]=null}),Qe(),r=f[n],r?r.p(p,h):(r=f[n]=u[n](p),r.c()),se(r,1),r.m(i.parentNode,i))},i(p){o||(se(a),se(r),o=!0)},o(p){de(a),de(r),o=!1},d(p){a&&a.d(p),p&&B(e),f[n].d(p),p&&B(i)}}}function f4(t,e,n){let{codeBlockOptions:r}=e,{isObsidianView:i=!1}=e,{showSettings:o=!1}=e,a,u=Uu(),f,c,p,h=!0,m,_=window.moment(),v=ye.getInstance();function b(S){return Tt(this,void 0,void 0,function*(){n(7,v);let Q=S.clone().startOf("month").subtract(6,"days"),j=S.clone().endOf("month").add(12,"days"),U=yield Yt({startDate:Q,endDate:j,include:r.include,exclude:r.exclude});if(mc.default.isEqual(U,p)&&mc.default.isEqual(u,Uu()))return;u=Uu();let J=mc.default.groupBy(U,Y=>{var z;return window.moment((z=Y.start.date)!==null&&z!==void 0?z:Y.start.dateTime).startOf("day").format()});p=U;let re={getWeeklyMetadata:Y=>Tt(this,void 0,void 0,function*(){let z=[];return v.settings.activateDailyNoteAddon&&v.settings.useWeeklyNotes&&ll(Y)&&(z=[{isFilled:!0,className:"googleCalendarDailyDot",color:"default"}]),{dataAttributes:{amount:z.length+""},dots:z}}),getDailyMetadata:Y=>Tt(this,void 0,void 0,function*(){let z=[];v.settings.activateDailyNoteAddon&&Zo(Y)&&(z=[{isFilled:!0,className:"googleCalendarDailyDot",color:"default"}]);let ee=J[Y.startOf("day").format()];return ee?(z=[...z,...Array(ee.length).fill({isFilled:!0,className:"googleCalendarDot",color:"default"})],{dataAttributes:{amount:ee.length+""},dots:z}):{dataAttributes:{amount:z.length+""},dots:z}})};n(4,h=!1),n(5,m=null),n(5,m=[re])})}let E=(S,Q)=>S.filter(j=>j.start.date?window.moment(j.start.date).isSame(Q,"day"):window.moment(j.start.dateTime).isSame(Q,"day")),y=(S,Q)=>{new dr(E(p,S),"details",S,!1,()=>{zr(),n(3,a)}).open()},O=(S,Q)=>Tt(void 0,void 0,void 0,function*(){let j=ll(S);j||(j=yield(0,sk.createWeeklyNote)(S)),yield app.workspace.getLeaf(!1).openFile(j,{active:!0})}),D=(S,Q,j)=>Q.ctrlKey?(Li({date:S,openInNewTab:!0,type:j}),!1):Q.shiftKey?(Li({date:S,openInNewTab:!1,type:j}),!1):Q.altKey&&xl.Platform.isDesktop?(Dp({date:S,type:j}),!1):!0,F=(S,Q)=>{let j=Q==="daily"?Zo(S):ll(S),U=Q.charAt(0).toUpperCase()+Q.slice(1),J=new xl.Menu;return j?(J.addItem(re=>{re.setTitle(`Open ${U} Note`),re.setIcon("file"),re.onClick(()=>{Li({date:S,openInNewTab:!1,type:Q})})}),J.addItem(re=>{re.setTitle(`Open ${U} Note Split Right`),re.setIcon("vertical-split"),re.onClick(()=>{Li({date:S,openInNewTab:!0,openToRight:"horizontal",type:Q})})}),J.addItem(re=>{re.setTitle(`Open ${U} Note Split Down`),re.setIcon("horizontal-split"),re.onClick(()=>{Li({date:S,openInNewTab:!0,openToRight:"vertical",type:Q})})}),xl.Platform.isDesktop&&J.addItem(re=>{re.setTitle(`Open ${U} Note in new Window`),re.setIcon("fullscreen"),re.onClick(()=>{Dp({date:S,type:Q})})})):(J.addItem(re=>{re.setTitle(`Create ${U} Note`),re.setIcon("create-new"),re.onClick(()=>{Li({date:S,openInNewTab:!1,type:Q})})}),J.addItem(re=>{re.setTitle(`Create ${U} Note Split Right`),re.setIcon("vertical-split"),re.onClick(()=>{Li({date:S,openInNewTab:!0,openToRight:"horizontal",type:Q})})}),J.addItem(re=>{re.setTitle(`Create ${U} Note Split Down`),re.setIcon("horizontal-split"),re.onClick(()=>{Li({date:S,openInNewTab:!0,openToRight:"vertical",type:Q})})})),Q==="daily"?(J.addSeparator(),J.addItem(re=>{re.setTitle("Open Timeline View"),re.setIcon("calendar"),re.onClick(()=>Tt(void 0,void 0,void 0,function*(){let Y=yield v.initView(ds);Y.view instanceof Pl&&Y.view.setDate(S)}))}),J.addItem(re=>{re.setTitle("Open Schedule View"),re.setIcon("bullet-list"),re.onClick(()=>Tt(void 0,void 0,void 0,function*(){let Y=yield v.initView(To);Y.view instanceof ba&&Y.view.setDate(S)}))})):(J.addSeparator(),J.addItem(re=>{re.setTitle("Open Weekly View"),re.setIcon("calendar"),re.onClick(()=>Tt(void 0,void 0,void 0,function*(){let Y=yield v.initView(So);Y.view instanceof Nl&&Y.view.setDate(S)}))}),J.addItem(re=>{re.setTitle("Open Schedule View"),re.setIcon("bullet-list"),re.onClick(()=>Tt(void 0,void 0,void 0,function*(){let Y=yield v.initView(To);Y.view instanceof ba&&Y.view.setDate(S)}))})),J},P=(S,Q)=>(D(S,Q,"daily")&&F(S,"daily").showAtPosition({x:Q.clientX,y:Q.clientY}),!0),L=(S,Q)=>(D(S,Q,"weekly")&&F(S,"weekly").showAtPosition({x:Q.clientX,y:Q.clientY}),!0);Yi(()=>{n(3,a=r.date?window.moment(r.date).add(r.offset,"month"):window.moment().add(r.offset,"month"))}),Jo(()=>{clearInterval(f),clearInterval(c)});function R(S){r=S,n(0,r)}function M(S){o=S,n(1,o)}function H(S){m=S,n(5,m)}function le(S){a=S,n(3,a)}function V(S){_=S,n(6,_),n(3,a),n(12,f),n(13,c)}function X(S){m=S,n(5,m)}function K(S){a=S,n(3,a)}function ce(S){_=S,n(6,_),n(3,a),n(12,f),n(13,c)}return t.$$set=S=>{"codeBlockOptions"in S&&n(0,r=S.codeBlockOptions),"isObsidianView"in S&&n(2,i=S.isObsidianView),"showSettings"in S&&n(1,o=S.showSettings)},t.$$.update=()=>{if(t.$$.dirty&12296){e:a&&(f&&clearInterval(f),n(12,f=setInterval(()=>b(a),1e3)),c&&clearInterval(c),n(13,c=setInterval(()=>n(6,_=window.moment()),6e4)),b(a))}},[r,o,i,a,h,m,_,v,y,O,P,L,f,c,R,M,H,le,V,X,K,ce]}var lk=class extends ze{constructor(e){super();qe(this,e,f4,u4,Ge,{codeBlockOptions:0,isObsidianView:2,showSettings:1})}},gc=lk;var{Map:c4}=of;function d4(t){Et(t,"svelte-f5i6ri",".yearNav.svelte-f5i6ri{margin-bottom:10px}.yearContainer.svelte-f5i6ri{overflow-x:scroll;width:fit-content}.monthLabelContainer.svelte-f5i6ri{display:flex;flex-direction:row;justify-content:space-between}.dayContainer.svelte-f5i6ri{display:grid;grid-template-rows:repeat(7, minmax(0, 1fr));gap:2px 2px;grid-auto-flow:column dense;overflow-x:scroll;cursor:pointer}.square.svelte-f5i6ri{display:inline-flex;align-items:center;justify-content:center;min-width:0;min-height:0;display:inline-block;border-radius:2px}.square.svelte-f5i6ri:hover{filter:drop-shadow(0 0 5px #00e1ff)}.fistDayOfMonth.svelte-f5i6ri{outline:2px solid #ff000080}.weekDayName.svelte-f5i6ri{display:flex;grid-row:span 2;line-height:1;justify-self:flex-end}")}function uk(t,e,n){let r=t.slice();return r[26]=e[n][0],r[6]=e[n][1],r[28]=n,r}function fk(t,e,n){let r=t.slice();return r[29]=e[n],r[28]=n,r}function ck(t,e,n){let r=t.slice();return r[31]=e[n],r[28]=n,r}function dk(t){let e,n,r,i;function o(f){t[13](f)}function a(f){t[14](f)}let u={};return t[0]!==void 0&&(u.codeBlockOptions=t[0]),t[1]!==void 0&&(u.showSettings=t[1]),e=new di({props:u}),Ne.push(()=>tt(e,"codeBlockOptions",o)),Ne.push(()=>tt(e,"showSettings",a)),{c(){ct(e.$$.fragment)},m(f,c){ut(e,f,c),i=!0},p(f,c){let p={};!n&&c[0]&1&&(n=!0,p.codeBlockOptions=f[0],et(()=>n=!1)),!r&&c[0]&2&&(r=!0,p.showSettings=f[1],et(()=>r=!1)),e.$set(p)},i(f){i||(se(e.$$.fragment,f),i=!0)},o(f){de(e.$$.fragment,f),i=!1},d(f){st(e,f)}}}function pk(t){let e,n,r,i,o,a,u,f;return{c(){e=N("div"),n=N("button"),n.textContent="<",r=$(),i=N("button"),i.textContent="START",o=$(),a=N("button"),a.textContent=">",k(n,"class","yearNavButton"),k(i,"class","yearNavButton"),k(a,"class","yearNavButton"),k(e,"class","yearNav svelte-f5i6ri")},m(c,p){G(c,e,p),A(e,n),A(e,r),A(e,i),A(e,o),A(e,a),u||(f=[oe(n,"click",t[15]),oe(i,"click",t[16]),oe(a,"click",t[17])],u=!0)},p:me,d(c){c&&B(e),u=!1,We(f)}}}function hk(t){let e,n=t[31]+"",r,i=`${t[0].size}px`;return{c(){e=N("span"),r=Me(n),k(e,"class","monthLabel"),he(e,"font-size",i)},m(o,a){G(o,e,a),A(e,r)},p(o,a){a[0]&1&&i!==(i=`${o[0].size}px`)&&he(e,"font-size",i)},d(o){o&&B(e)}}}function mk(t){let e,n=Array.from({length:7-window.moment(t[26]).day()}),r=[];for(let i=0;i<n.length;i+=1)r[i]=gk(fk(t,n,i));return{c(){for(let i=0;i<r.length;i+=1)r[i].c();e=zt()},m(i,o){for(let a=0;a<r.length;a+=1)r[a]&&r[a].m(i,o);G(i,e,o)},p(i,o){if(o[0]&33){n=Array.from({length:7-window.moment(i[26]).day()});let a;for(a=0;a<n.length;a+=1){let u=fk(i,n,a);r[a]?r[a].p(u,o):(r[a]=gk(u),r[a].c(),r[a].m(e.parentNode,e))}for(;a<r.length;a+=1)r[a].d(1);r.length=n.length}},d(i){At(r,i),i&&B(e)}}}function gk(t){let e,n=`${t[0].size}px`,r=`${t[0].size}px`;return{c(){e=N("div"),k(e,"class","square svelte-f5i6ri"),he(e,"width",n),he(e,"height",r)},m(i,o){G(i,e,o)},p(i,o){o[0]&1&&n!==(n=`${i[0].size}px`)&&he(e,"width",n),o[0]&1&&r!==(r=`${i[0].size}px`)&&he(e,"height",r)},d(i){i&&B(e)}}}function _k(t,e){let n,r=e[28]==0&&window.moment(e[26]).day()!=0,i,o,a,u,f,c,p=`${e[0].size}px`,h=`${e[0].size}px`,m,_,v,b=r&&mk(e);function E(){return e[18](e[26])}function y(){return e[19](e[26])}return{key:t,first:null,c(){n=zt(),b&&b.c(),i=$(),o=N("div"),k(o,"class",a=""+(en(vk(e[26])?"square fistDayOfMonth":"square")+" svelte-f5i6ri")),k(o,"title",u=e[26]),he(o,"background-color",e[9](e[6].length.toString())),he(o,"width",p),he(o,"height",h),this.first=n},m(O,D){G(O,n,D),b&&b.m(O,D),G(O,i,D),G(O,o,D),m=!0,_||(v=[oe(o,"click",E),oe(o,"keypress",y)],_=!0)},p(O,D){e=O,D[0]&32&&(r=e[28]==0&&window.moment(e[26]).day()!=0),r?b?b.p(e,D):(b=mk(e),b.c(),b.m(i.parentNode,i)):b&&(b.d(1),b=null),(!m||D[0]&32&&a!==(a=""+(en(vk(e[26])?"square fistDayOfMonth":"square")+" svelte-f5i6ri")))&&k(o,"class",a),(!m||D[0]&32&&u!==(u=e[26]))&&k(o,"title",u),D[0]&32&&he(o,"background-color",e[9](e[6].length.toString())),D[0]&1&&p!==(p=`${e[0].size}px`)&&he(o,"width",p),D[0]&1&&h!==(h=`${e[0].size}px`)&&he(o,"height",h)},i(O){m||(ln(()=>{!m||(c&&c.end(1),f=rf(o,e[8],{key:e[28]}),f.start())}),m=!0)},o(O){f&&f.invalidate(),c=F1(o,e[7],{key:e[28]}),m=!1},d(O){O&&B(n),b&&b.d(O),O&&B(i),O&&B(o),O&&c&&c.end(),_=!1,We(v)}}}function p4(t){let e,n,r,i,o,a,u=window.moment(t[4]).year()+"",f,c=`${t[0].size}px`,p,h,m,_=`${t[0].size}px`,v,b,E,y,O,D=`${t[0].size}px`,F,P,L=`${t[0].size}px`,R,M,H=`${t[0].size}px`,le,V=[],X=new c4,K,ce,S=t[2]&&dk(t),Q=t[0].navigation&&pk(t),j=t[11],U=[];for(let Y=0;Y<j.length;Y+=1)U[Y]=hk(ck(t,j,Y));let J=[...t[5]],re=Y=>Y[28];for(let Y=0;Y<J.length;Y+=1){let z=uk(t,J,Y),ee=re(z);X.set(ee,V[Y]=_k(ee,z))}return{c(){e=N("div"),S&&S.c(),n=$(),Q&&Q.c(),r=$(),i=N("div"),o=N("div"),a=N("span"),f=Me(u),p=$();for(let Y=0;Y<U.length;Y+=1)U[Y].c();h=$(),m=N("span"),v=$(),b=N("div"),E=N("div"),y=$(),O=N("span"),O.textContent="MON",F=$(),P=N("span"),P.textContent="WED",R=$(),M=N("span"),M.textContent="FRI",le=$();for(let Y=0;Y<V.length;Y+=1)V[Y].c();k(a,"class","monthLabel"),he(a,"font-size",c),k(m,"class","monthLabel"),he(m,"font-size",_),k(o,"class","monthLabelContainer svelte-f5i6ri"),k(O,"class","weekDayName svelte-f5i6ri"),he(O,"font-size",D),k(P,"class","weekDayName svelte-f5i6ri"),he(P,"font-size",L),k(M,"class","weekDayName svelte-f5i6ri"),he(M,"font-size",H),k(b,"class","dayContainer svelte-f5i6ri"),k(b,"title",K=t[5].size.toString()),k(i,"class","yearContainer svelte-f5i6ri"),he(e,"overflow","scroll visible")},m(Y,z){G(Y,e,z),S&&S.m(e,null),A(e,n),Q&&Q.m(e,null),A(e,r),A(e,i),A(i,o),A(o,a),A(a,f),A(o,p);for(let ee=0;ee<U.length;ee+=1)U[ee]&&U[ee].m(o,null);A(o,h),A(o,m),A(i,v),A(i,b),A(b,E),A(b,y),A(b,O),A(b,F),A(b,P),A(b,R),A(b,M),A(b,le);for(let ee=0;ee<V.length;ee+=1)V[ee]&&V[ee].m(b,null);ce=!0},p(Y,z){if(Y[2]?S?(S.p(Y,z),z[0]&4&&se(S,1)):(S=dk(Y),S.c(),se(S,1),S.m(e,n)):S&&(Je(),de(S,1,1,()=>{S=null}),Qe()),Y[0].navigation?Q?Q.p(Y,z):(Q=pk(Y),Q.c(),Q.m(e,r)):Q&&(Q.d(1),Q=null),(!ce||z[0]&16)&&u!==(u=window.moment(Y[4]).year()+"")&&Ye(f,u),z[0]&1&&c!==(c=`${Y[0].size}px`)&&he(a,"font-size",c),z[0]&2049){j=Y[11];let ee;for(ee=0;ee<j.length;ee+=1){let _e=ck(Y,j,ee);U[ee]?U[ee].p(_e,z):(U[ee]=hk(_e),U[ee].c(),U[ee].m(o,h))}for(;ee<U.length;ee+=1)U[ee].d(1);U.length=j.length}z[0]&1&&_!==(_=`${Y[0].size}px`)&&he(m,"font-size",_),z[0]&1&&D!==(D=`${Y[0].size}px`)&&he(O,"font-size",D),z[0]&1&&L!==(L=`${Y[0].size}px`)&&he(P,"font-size",L),z[0]&1&&H!==(H=`${Y[0].size}px`)&&he(M,"font-size",H),z[0]&1569&&(J=[...Y[5]],Je(),V=Zs(V,z,re,1,Y,J,X,b,Bp,_k,null,uk),Qe()),(!ce||z[0]&32&&K!==(K=Y[5].size.toString()))&&k(b,"title",K)},i(Y){if(!ce){se(S);for(let z=0;z<J.length;z+=1)se(V[z]);ce=!0}},o(Y){de(S);for(let z=0;z<V.length;z+=1)de(V[z]);ce=!1},d(Y){Y&&B(e),S&&S.d(),Q&&Q.d(),At(U,Y);for(let z=0;z<V.length;z+=1)V[z].d()}}}function vk(t){return t.split("-")[2]==="01"}function h4(t,e,n){let{codeBlockOptions:r}=e,{isObsidianView:i=!1}=e,{showSettings:o=!1}=e,a=r.date?window.moment(r.date):window.moment(),u=0,f,c=!1,p=[],h=new Map,m=0,[_,v]=Qf({duration:K=>Math.sqrt(K*200),fallback(K,ce){let S=getComputedStyle(K),Q=S.transform==="none"?"":S.transform;return{duration:600,easing:Jf,css:j=>`
transform: ${Q} scale(${j});
opacity: ${j}
`}}}),b=K=>Tt(void 0,void 0,void 0,function*(){if(!(K==null?void 0:K.isValid())){c=!1;return}let ce=yield Yt({startDate:K.clone().startOf("year"),endDate:K.clone().endOf("year"),include:r.include,exclude:r.exclude});console.log("newEvents",ce),JSON.stringify(ce)!=JSON.stringify(p)&&n(6,p=ce)}),E=K=>Tt(void 0,void 0,void 0,function*(){c||(c=!0,y(K),yield b(K),O(p),n(5,h),m=Array.from(h.values()).reduce((ce,S)=>Math.max(ce,S.length),0),c=!1)}),y=K=>{h.clear();let ce=window.moment(K).startOf("year"),S=window.moment(K).endOf("year");for(;ce.isSameOrBefore(S);)h.set(ce.format("YYYY-MM-DD"),[]),ce.add(1,"days")},O=K=>{K.forEach(ce=>{let Q=window.moment(ce.start.dateTime||ce.start.date).format("YYYY-MM-DD");h.has(Q)?h.get(Q).push(ce):h.set(Q,[ce])})};function D(K){let ce=0,S=m;if(K==0)return"rgb(22, 27, 34)";if(K==S)return"rgb(57, 211, 83)";let Q=(K-ce)/(S-ce),j=[{percent:0,color:{r:22,g:27,b:34}},{percent:.25,color:{r:14,g:68,b:41}},{percent:.5,color:{r:0,g:109,b:50}},{percent:.75,color:{r:38,g:166,b:65}},{percent:1,color:{r:57,g:211,b:83}}],U=null,J=null;for(let je=j.length-1;je>=0;je--){if(Q>=j[je].percent){U=je;break}J=je}U===null&&(U=J);let re=j[U].color,Y=j[J].color,z=j[U].percent-j[J].percent,ee=(Q-j[J].percent)/z,_e=Math.floor(re.r*(1-ee)+Y.r*ee),Ce=Math.floor(re.g*(1-ee)+Y.g*ee),Fe=Math.floor(re.b*(1-ee)+Y.b*ee);return`rgb(${_e}, ${Ce}, ${Fe})`}let F=K=>{new dr(h.get(K),"details",window.moment(K),!1,()=>{}).open()},P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function L(K){r=K,n(0,r)}function R(K){o=K,n(1,o)}let M=()=>n(3,u--,u),H=()=>n(3,u=0),le=()=>n(3,u++,u),V=K=>F(K),X=K=>F(K);return t.$$set=K=>{"codeBlockOptions"in K&&n(0,r=K.codeBlockOptions),"isObsidianView"in K&&n(2,i=K.isObsidianView),"showSettings"in K&&n(1,o=K.showSettings)},t.$$.update=()=>{if(t.$$.dirty[0]&4121){e:n(12,a=r.date?window.moment(r.date).add(r.offset,"years"):window.moment().add(r.offset,"years")),n(4,f=r.navigation?a.clone().local().add(u,"years"):a),E(f)}},[r,o,i,u,f,h,p,_,v,D,F,P,a,L,R,M,H,le,V,X]}var yk=class extends ze{constructor(e){super();qe(this,e,h4,p4,Ge,{codeBlockOptions:0,isObsidianView:2,showSettings:1},d4,[-1,-1])}},_c=yk;var wk=Oe(require("obsidian")),Co=class extends wk.MarkdownRenderChild{constructor(e,n,r){super(n);this.a=e,this.b=r}load(){this.comp=new this.a({target:this.containerEl,props:this.b})}unload(){this.comp.$destroy()}};function bk(t,e,n){return te(this,null,function*(){var a,u,f,c,p,h,m,_,v,b,E;e.style.padding="10px";let i=(a=(0,vc.parseYaml)(t))!=null?a:{};i.type=(u=i.type)!=null?u:"day",i.date=(f=i.date)!=null?f:"today",i.exclude=(c=i.exclude)!=null?c:[],i.include=(p=i.include)!=null?p:[],i.hourRange=(h=i.hourRange)!=null?h:[0,24],i.timespan=(m=i.timespan)!=null?m:7,i.offset=(_=i.offset)!=null?_:0,i.navigation=(v=i.navigation)!=null?v:!1,i.showAllDay=(b=i.showAllDay)!=null?b:!0,i.size=(E=i.size)!=null?E:10,i.dayOffset&&(i.offset=i.dayOffset);let o=["YYYY-MM-DD","YYYY.MM.DD","YYYY/MM/DD","MM-DD-YYYY","MM.DD.YYYY","MM/DD/YYYY","DD-MM-YYYY","DD.MM.YYYY","DD/MM/YYYY"];if(!window.moment(i.date,o,!0).isValid()){let y=wy(i.date);if(y==null||!window.moment(y).isValid())return;i.date=window.moment(y).format("YYYY-MM-DD")}i.type=="web"?vc.Platform.isDesktopApp&&n.addChild(new Co(tc,e,{codeBlockOptions:i})):i.type=="day"?(i.timespan=1,n.addChild(new Co(cs,e,{codeBlockOptions:i}))):i.type=="month"?n.addChild(new Co(gc,e,{codeBlockOptions:i})):i.type=="schedule"?n.addChild(new Co(hc,e,{codeBlockOptions:i})):i.type=="week"?n.addChild(new Co(cs,e,{codeBlockOptions:i})):i.type=="year"&&n.addChild(new Co(_c,e,{codeBlockOptions:i}))})}var kk=Oe(require("obsidian"));var Il="google-calendar-view-month",Yh=class extends kk.ItemView{constructor(e){super(e);this.showSettings=!1}getViewType(){return Il}getDisplayText(){return"Calendar Month View"}getIcon(){return"calendar-with-checkmark"}onPaneMenu(e,n){super.onPaneMenu(e,n),this.showSettings=this.calendar.$$.ctx[1],e.addItem(r=>{r.setTitle("Refresh"),r.setIcon("sync"),r.onClick(()=>{this.onClose(),this.onOpen()})}).addSeparator().addItem(r=>{r.setTitle(this.showSettings?"Hide Settings":"Settings"),r.setIcon("gear"),r.onClick(()=>{this.showSettings=!this.showSettings,this.calendar.$set({showSettings:this.showSettings})})})}onOpen(){return te(this,null,function*(){let n=ye.getInstance().settings.viewSettings.month;this.calendar=new gc({target:this.contentEl,props:{codeBlockOptions:n,isObsidianView:!0,showSettings:this.showSettings}})})}onClose(){return te(this,null,function*(){this.calendar.$destroy()})}};var Ek=Oe(require("obsidian"));var Rl="google-calendar-view-year",Wh=class extends Ek.ItemView{constructor(e){super(e);this.showSettings=!1}getViewType(){return Rl}getDisplayText(){return"Calendar Year View"}onPaneMenu(e,n){super.onPaneMenu(e,n),this.showSettings=this.calendar.$$.ctx[1],e.addItem(r=>{r.setTitle("Refresh"),r.setIcon("sync"),r.onClick(()=>{this.onClose(),this.onOpen()})}).addSeparator().addItem(r=>{r.setTitle(this.showSettings?"Hide Settings":"Settings"),r.setIcon("gear"),r.onClick(()=>{this.showSettings=!this.showSettings,this.calendar.$set({showSettings:this.showSettings})})})}getIcon(){return"calendar-with-checkmark"}onOpen(){return te(this,null,function*(){let e=ye.getInstance(),n=e.settings.viewSettings.year;n||(e.settings.viewSettings.year={type:"year",exclude:[],include:[],offset:0,navigation:!1,size:15},e.saveSettings(),n=e.settings.viewSettings.year),this.calendar=new _c({target:this.contentEl,props:{codeBlockOptions:n,isObsidianView:!0,showSettings:this.showSettings}})})}onClose(){return te(this,null,function*(){this.calendar.$destroy()})}};var Tk=Oe(require("obsidian"));var ka="google-calendar-view-web",jh=class extends Tk.ItemView{constructor(e){super(e);this.showSettings=!1}getViewType(){return ka}getDisplayText(){return"Calendar Web View"}onPaneMenu(e,n){super.onPaneMenu(e,n),this.showSettings=this.calendar.$$.ctx[1],e.addItem(r=>{r.setTitle("Refresh"),r.setIcon("sync"),r.onClick(()=>{this.onClose(),this.onOpen()})}).addSeparator().addItem(r=>{r.setTitle(this.showSettings?"Hide Settings":"Settings"),r.setIcon("gear"),r.onClick(()=>{this.showSettings=!this.showSettings,this.calendar.$set({showSettings:this.showSettings})})})}getIcon(){return"calendar-with-checkmark"}onOpen(){return te(this,null,function*(){let n=ye.getInstance().settings.viewSettings.web;n.width=-1,this.calendar=new tc({target:this.contentEl,props:{codeBlockOptions:n,isObsidianView:!0,showSettings:this.showSettings}})})}onClose(){return te(this,null,function*(){this.calendar.$destroy()})}};var Sk=Oe(require("obsidian")),Bh=class extends Sk.FuzzySuggestModal{constructor(e,n,r,i,o){super(ye.getInstance().app);this.eventList=e,this.setPlaceholder("Select an event to insert"),this.editor=n,this.start=r,this.end=i,this.word=o}getItems(){return this.eventList}getItemText(e){return`${e.summary} `}onChooseItem(e){return te(this,null,function*(){let n=`[${e.summary}](${e.htmlLink}&cal=${e.parent.id})`;this.editor.replaceRange(n,this.start,this.end,this.word)})}};function Ck(t,e){e.settings.atAnnotationEnabled!=!1&&(Ll("@today",t,e)||Ll("@tomorrow",t,e)||Ll("@yesterday",t,e)||Ll("@REGEX",t,e)||Ll("@YYYY-MM-DD",t,e))}function Ll(t,e,n){var u;let r=e.getCursor(),i=e.getCursor(),o="",a=window.moment();if(t==="@REGEX"){let f=e.getLine(r.line);if(f.length>2e3)return!1;let c=(u=f.match(/.*@([+,-])(\d+) /))!=null?u:[];if(c.length!=3||e.getCursor().ch!=c.index+c[0].length)return!1;if(i=Ps(zn({},r),{ch:r.ch-c[1].length-c[2].length-1}),i.ch<0)return;o=e.getRange(i,r),c[1]=="+"?a=window.moment().add(c[2],"day"):a=window.moment().subtract(c[2],"day")}else if(t==="@YYYY-MM-DD"){if(i=Ps(zn({},r),{ch:r.ch-t.length}),o=e.getRange(i,r),!o.startsWith("@")||o.length!="@YYYY-MM-DD".length)return!1;let f=["YYYY-MM-DD","YYYY/MM/DD","YYYY.MM.DD","YYYY MM DD","MM-DD-YYYY","MM/DD/YYYY","MM.DD.YYYY","MM DD YYYY","DD-MM-YYYY","DD/MM/YYYY","DD.MM.YYYY","DD MM YYYY"],c=["DD-MM-YYYY","DD/MM/YYYY","DD.MM.YYYY","DD MM YYYY","YYYY-MM-DD","YYYY/MM/DD","YYYY.MM.DD","YYYY MM DD","MM-DD-YYYY","MM/DD/YYYY","MM.DD.YYYY","MM DD YYYY"],p=window.moment(o.substring(1),n.settings.usDateFormat?f:c,!0);if(p.isValid())a=p;else return!1}else{if(i=Ps(zn({},r),{ch:r.ch-t.length}),i.ch<0||e.getRange(i,r)!=t)return!1;switch(t){case"@today":a=window.moment();break;case"@tomorrow":a=window.moment().add(1,"day");break;case"@yesterday":a=window.moment().add(-1,"day");break;default:return!1}}return Yt({startDate:a}).then(f=>{new Bh(f,e,i,r,o).open()}),!0}var Dk=Oe(Ri());function m4(t){return te(this,null,function*(){let e=/\[.*]\(https:\/\/www\.google\.com\/calendar\/event\?eid=(.*)&cal=(.*)\)/g,n,r=[];do n=e.exec(t),n&&r.push(n);while(n);return r.length?yield Promise.all(r.map(o=>te(this,null,function*(){if(o){let a=atob(o[1]).split(" ")[0];return yield uo(a,o[2])}}))):[]})}function Ok(t){return te(this,null,function*(){let e=t.getCursor(),n=t.getValue(),r=/{{gEvent(\d?).(.*)}} /g,i,o=[];do i=r.exec(n),i&&o.push(i);while(i);if(!o.length)return;let a=yield m4(n);!a.length||o.forEach(u=>te(this,null,function*(){let f=u[1]?parseInt(u[1]):0,c=t.getCursor();if(c.ch-=3,t.getRange(c,t.getCursor())!="}} ")return!1;let p=Dk.default.get(a[f],u[2],"");p===Object(p)&&(p=JSON.stringify(p)),n=n.replace(u[0],p!=null?p:""),t.setValue(n),e.ch+=p.length-u[0].length,t.setCursor(e)}))})}var Mk=Oe(require("obsidian"));var Ea=[".anyoneCanAddSelf",".attachments",".attachments[0]",".attachments[0]fileId",".attachments[0]fileUrl",".attachments[0]iconLink",".attachments[0]mimeType",".attachments[0]title",".attendees",".attendeesOmitted",".attendees[0]",".attendees[0].additionalGuests",".attendees[0].comment",".attendees[0].displayName",".attendees[0].email",".attendees[0].id",".attendees[0].optional",".attendees[0].organizer",".attendees[0].resource",".attendees[0].responseStatus",".attendees[0].self",".colorId",".conferenceData",".conferenceData.conferenceId",".conferenceData.conferenceSolution",".conferenceData.conferenceSolution.iconUri",".conferenceData.conferenceSolution.key",".conferenceData.conferenceSolution.key.type",".conferenceData.conferenceSolution.name",".conferenceData.createRequest",".conferenceData.createRequest.conferenceSolutionKey",".conferenceData.createRequest.conferenceSolutionKey.type",".conferenceData.createRequest.requestId",".conferenceData.createRequest.status",".conferenceData.createRequest.status.statusCode",".conferenceData.entryPoints",".conferenceData.entryPoints[0]",".conferenceData.entryPoints[0].accessCode",".conferenceData.entryPoints[0].entryPointType",".conferenceData.entryPoints[0].label",".conferenceData.entryPoints[0].meetingCode",".conferenceData.entryPoints[0].passcode",".conferenceData.entryPoints[0].password",".conferenceData.entryPoints[0].pin",".conferenceData.entryPoints[0].uri",".conferenceData.notes",".conferenceData.signature",".created",".creator",".creator.displayName",".creator.email",".creator.id",".creator.self",".description",".end",".end.date",".end.dateTime",".end.timeZone",".endTimeUnspecified",".etag",".eventType",".extendedProperties",".extendedProperties.private",".extendedProperties.shared",".gadget",".gadget.display",".gadget.height",".gadget.iconLink",".gadget.link",".gadget.preferences",".gadget.title",".gadget.type",".gadget.width",".guestsCanInviteOthers",".guestsCanModify",".guestsCanSeeOtherGuests",".hangoutLink",".htmlLink",".iCalUID",".id",".kind",".location",".locked",".organizer",".organizer.displayName",".organizer.email",".organizer.id",".organizer.self",".originalStartTime",".originalStartTime.date",".originalStartTime.dateTime",".originalStartTime.timeZone",".privateCopy",".parent",".parent.kind",".parent.id",".parent.summary",".parent.description",".parent.location",".parent.timeZone",".parent.conferenceProperties",".parent.conferenceProperties.allowedConferenceSolutionTypes",".recurrence",".recurrence[0]",".recurringEventId",".reminders",".reminders.overrides",".reminders.overrides[0]",".reminders.overrides[0].method",".reminders.overrides[0].minutes",".reminders.useDefault",".sequence",".source",".source.title",".source.url",".start",".start.date",".start.dateTime",".start.timeZone",".status",".summary",".transparency",".updated",".visibility"];var Gh=class extends Mk.EditorSuggest{constructor(e){super(e)}onTrigger(e,n){let i=n.getLine(e.line).substring(0,e.ch).match(/{{gEvent(\d)?(\S+$)/);if(i){let o="{{gEvent".length;return i[1]&&o++,{end:e,start:{ch:i.index+o,line:e.line},query:i[2]}}}getSuggestions(e){return Ea.filter(n=>e.query===n.substring(0,e.query.length))}renderSuggestion(e,n){n.createEl("span",{text:e,cls:"suggestionText"})}selectSuggestion(e){if(!this.context)return;let{editor:n}=this.context;if(n.replaceRange(e,this.context.start,this.context.end),Ea.filter(i=>i.startsWith(`${e}.`)).length==0){let i=n.getCursor(),o=structuredClone(i);o.ch+=2,(n.getLine(o.line).length<o.ch||n.getRange(i,o)!="}}")&&n.replaceRange("}}",i),n.setCursor(o)}}};var zk=Oe(require("obsidian"));var Fl=Oe(require("obsidian")),Uh=class extends Fl.Modal{constructor(e,n){super(e);this.onSubmit=n}onOpen(){let{contentEl:e}=this;e.createEl("h1",{text:"Enter a name for the template"}),new Fl.Setting(e).setName("Name").addText(n=>n.onChange(r=>{this.result=r})),new Fl.Setting(e).addButton(n=>n.setButtonText("Save").setCta().onClick(()=>{this.close(),this.onSubmit(this.result)}))}onClose(){let{contentEl:e}=this;e.empty()}};function g4(t){Et(t,"svelte-6isfqn",".optionContainer.svelte-6isfqn{display:flex;flex-direction:column}.header.svelte-6isfqn{display:grid;grid-template-columns:[first] 30% auto [last] 30%}.center.svelte-6isfqn{text-align:center}.settingsContainer.svelte-6isfqn{display:flex;flex-direction:row;flex:1 1;gap:20px}.optionItem.svelte-6isfqn{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.input.svelte-6isfqn,.eventList.svelte-6isfqn,.optionList.svelte-6isfqn,.calendarList.svelte-6isfqn{width:100%;display:flex;flex-direction:column}.eventList.svelte-6isfqn,.optionList.svelte-6isfqn,.calendarList.svelte-6isfqn{padding-left:16px}button.svelte-6isfqn{align-self:center}")}function Ak(t,e,n){let r=t.slice();return r[21]=e[n],r}function Pk(t,e,n){let r=t.slice();return r[21]=e[n],r}function Nk(t,e,n){let r=t.slice();return r[26]=e[n],r[27]=e,r[28]=n,r}function xk(t,e,n){let r=t.slice();return r[29]=e[n],r[30]=e,r[31]=n,r}function Ik(t,e,n){let r=t.slice();return r[32]=e[n],r}function Rk(t){let e,n=t[0].settings.insertTemplates,r=[];for(let i=0;i<n.length;i+=1)r[i]=Lk(Ik(t,n,i));return{c(){for(let i=0;i<r.length;i+=1)r[i].c();e=zt()},m(i,o){for(let a=0;a<r.length;a+=1)r[a]&&r[a].m(i,o);G(i,e,o)},p(i,o){if(o[0]&1){n=i[0].settings.insertTemplates;let a;for(a=0;a<n.length;a+=1){let u=Ik(i,n,a);r[a]?r[a].p(u,o):(r[a]=Lk(u),r[a].c(),r[a].m(e.parentNode,e))}for(;a<r.length;a+=1)r[a].d(1);r.length=n.length}},d(i){At(r,i),i&&B(e)}}}function Lk(t){let e,n=t[32].name+"",r,i;return{c(){e=N("option"),r=Me(n),e.__value=i=t[32].name,e.value=e.__value},m(o,a){G(o,e,a),A(e,r)},p(o,a){a[0]&1&&n!==(n=o[32].name+"")&&Ye(r,n),a[0]&1&&i!==(i=o[32].name)&&(e.__value=i,e.value=e.__value)},d(o){o&&B(e)}}}function _4(t){let e;return{c(){e=N("span"),e.textContent="Loading..."},m(n,r){G(n,e,r)},p:me,d(n){n&&B(e)}}}function v4(t){let e,n=t[4],r=[];for(let i=0;i<n.length;i+=1)r[i]=Fk(xk(t,n,i));return{c(){for(let i=0;i<r.length;i+=1)r[i].c();e=zt()},m(i,o){for(let a=0;a<r.length;a+=1)r[a]&&r[a].m(i,o);G(i,e,o)},p(i,o){if(o[0]&144){n=i[4];let a;for(a=0;a<n.length;a+=1){let u=xk(i,n,a);r[a]?r[a].p(u,o):(r[a]=Fk(u),r[a].c(),r[a].m(e.parentNode,e))}for(;a<r.length;a+=1)r[a].d(1);r.length=n.length}},d(i){At(r,i),i&&B(e)}}}function Fk(t){let e,n,r=t[29][0].summary+"",i,o,a,u,f,c,p,h;function m(){t[17].call(u,t[30],t[31])}return{c(){e=N("div"),n=N("label"),i=Me(r),a=$(),u=N("input"),c=$(),k(n,"for",o=t[29][0].id),k(u,"type","checkbox"),k(u,"id",f=t[29][0].id),k(e,"class","optionItem svelte-6isfqn")},m(_,v){G(_,e,v),A(e,n),A(n,i),A(e,a),A(e,u),u.checked=t[29][1],A(e,c),p||(h=[oe(u,"change",m),oe(u,"change",t[7])],p=!0)},p(_,v){t=_,v[0]&16&&r!==(r=t[29][0].summary+"")&&Ye(i,r),v[0]&16&&o!==(o=t[29][0].id)&&k(n,"for",o),v[0]&16&&f!==(f=t[29][0].id)&&k(u,"id",f),v[0]&16&&(u.checked=t[29][1])},d(_){_&&B(e),p=!1,We(h)}}}function y4(t){let e;return{c(){e=N("span"),e.textContent="Loading..."},m(n,r){G(n,e,r)},p:me,d(n){n&&B(e)}}}function w4(t){let e,n=t[3],r=[];for(let i=0;i<n.length;i+=1)r[i]=Yk(Nk(t,n,i));return{c(){for(let i=0;i<r.length;i+=1)r[i].c();e=zt()},m(i,o){for(let a=0;a<r.length;a+=1)r[a]&&r[a].m(i,o);G(i,e,o)},p(i,o){if(o[0]&8){n=i[3];let a;for(a=0;a<n.length;a+=1){let u=Nk(i,n,a);r[a]?r[a].p(u,o):(r[a]=Yk(u),r[a].c(),r[a].m(e.parentNode,e))}for(;a<r.length;a+=1)r[a].d(1);r.length=n.length}},d(i){At(r,i),i&&B(e)}}}function Yk(t){let e,n,r=t[26][0].summary+"",i,o,a,u,f,c,p,h;function m(){t[18].call(u,t[27],t[28])}return{c(){e=N("div"),n=N("label"),i=Me(r),a=$(),u=N("input"),c=$(),k(n,"for",o=t[26][0].id),k(u,"type","checkbox"),k(u,"id",f=t[26][0].id),k(e,"class","optionItem svelte-6isfqn")},m(_,v){G(_,e,v),A(e,n),A(n,i),A(e,a),A(e,u),u.checked=t[26][1],A(e,c),p||(h=oe(u,"change",m),p=!0)},p(_,v){t=_,v[0]&8&&r!==(r=t[26][0].summary+"")&&Ye(i,r),v[0]&8&&o!==(o=t[26][0].id)&&k(n,"for",o),v[0]&8&&f!==(f=t[26][0].id)&&k(u,"id",f),v[0]&8&&(u.checked=t[26][1])},d(_){_&&B(e),p=!1,h()}}}function Wk(t){let e,n,r,i,o,a,u,f=Ea,c=[];for(let m=0;m<f.length;m+=1)c[m]=jk(Pk(t,f,m));let p=t[5],h=[];for(let m=0;m<p.length;m+=1)h[m]=Bk(Ak(t,p,m));return{c(){e=N("h4"),e.textContent="Table structure",n=$(),r=N("select");for(let m=0;m<c.length;m+=1)c[m].c();i=$(),o=N("div");for(let m=0;m<h.length;m+=1)h[m].c();k(r,"name","tableOptions"),k(r,"class","dropdown"),k(o,"class","optionList svelte-6isfqn")},m(m,_){G(m,e,_),G(m,n,_),G(m,r,_);for(let v=0;v<c.length;v+=1)c[v]&&c[v].m(r,null);G(m,i,_),G(m,o,_);for(let v=0;v<h.length;v+=1)h[v]&&h[v].m(o,null);a||(u=oe(r,"change",t[8]),a=!0)},p(m,_){if(_&0){f=Ea;let v;for(v=0;v<f.length;v+=1){let b=Pk(m,f,v);c[v]?c[v].p(b,_):(c[v]=jk(b),c[v].c(),c[v].m(r,null))}for(;v<c.length;v+=1)c[v].d(1);c.length=f.length}if(_[0]&544){p=m[5];let v;for(v=0;v<p.length;v+=1){let b=Ak(m,p,v);h[v]?h[v].p(b,_):(h[v]=Bk(b),h[v].c(),h[v].m(o,null))}for(;v<h.length;v+=1)h[v].d(1);h.length=p.length}},d(m){m&&B(e),m&&B(n),m&&B(r),At(c,m),m&&B(i),m&&B(o),At(h,m),a=!1,u()}}}function jk(t){let e,n=t[21]+"",r,i;return{c(){e=N("option"),r=Me(n),e.__value=i=t[21],e.value=e.__value},m(o,a){G(o,e,a),A(e,r)},p:me,d(o){o&&B(e)}}}function Bk(t){let e,n,r=t[21]+"",i,o,a,u,f,c,p;function h(){return t[19](t[21])}return{c(){e=N("div"),n=N("span"),i=Me(r),o=$(),a=N("input"),f=$(),k(a,"type","checkbox"),k(a,"id",u=t[21]),a.checked=!0,k(e,"class","optionItem svelte-6isfqn")},m(m,_){G(m,e,_),A(e,n),A(n,i),A(e,o),A(e,a),A(e,f),c||(p=oe(a,"click",h),c=!0)},p(m,_){t=m,_[0]&32&&r!==(r=t[21]+"")&&Ye(i,r),_[0]&32&&u!==(u=t[21])&&k(a,"id",u)},d(m){m&&B(e),c=!1,p()}}}function b4(t){let e,n,r,i,o,a,u,f,c,p,h,m,_,v,b,E,y,O,D,F,P,L,R,M,H,le,V,X,K,ce,S,Q,j,U,J,re,Y,z,ee=t[0].settings.insertTemplates.length&&Rk(t);function _e(Ee,vt){return Ee[4]?v4:_4}let Ce=_e(t,[-1,-1]),Fe=Ce(t);function je(Ee,vt){return Ee[3]?w4:y4}let pt=je(t,[-1,-1]),ht=pt(t),ge=t[2]=="table"&&Wk(t);return{c(){e=N("div"),n=N("div"),r=N("select"),i=N("option"),i.textContent="None",ee&&ee.c(),o=$(),a=N("h1"),a.textContent="Insert Options",u=$(),f=N("button"),f.textContent="Save as template",c=$(),p=N("hr"),h=$(),m=N("div"),_=N("div"),v=N("label"),v.textContent="Insert type",b=$(),E=N("select"),y=N("option"),y.textContent="Bullet",D=N("option"),D.textContent="Table",F=$(),P=N("div"),L=N("label"),L.textContent="Insert date",R=$(),M=N("input"),le=$(),V=N("h4"),V.textContent="Calendars",X=$(),K=N("div"),Fe.c(),ce=$(),S=N("h4"),S.textContent="Events",Q=$(),j=N("div"),ht.c(),U=$(),ge&&ge.c(),J=$(),re=N("button"),re.textContent="Insert",i.__value="None",i.value=i.__value,k(r,"class","dropdown left"),t[1]===void 0&&ln(()=>t[15].call(r)),k(a,"class","center svelte-6isfqn"),k(f,"class","right svelte-6isfqn"),k(n,"class","header svelte-6isfqn"),k(v,"for","insertType"),y.selected=O=!0,y.__value="bullet",y.value=y.__value,D.__value="table",D.value=D.__value,k(E,"class","dropdown"),t[2]===void 0&&ln(()=>t[16].call(E)),k(_,"class","input svelte-6isfqn"),k(L,"for","date"),k(M,"type","date"),k(M,"name","date"),k(M,"id","date"),M.value=H=window.moment().format("YYYY-MM-DD"),k(P,"class","input svelte-6isfqn"),k(m,"class","settingsContainer svelte-6isfqn"),k(K,"class","calendarList svelte-6isfqn"),k(j,"class","eventList svelte-6isfqn"),k(re,"class","svelte-6isfqn"),k(e,"class","optionContainer svelte-6isfqn")},m(Ee,vt){G(Ee,e,vt),A(e,n),A(n,r),A(r,i),ee&&ee.m(r,null),li(r,t[1],!0),A(n,o),A(n,a),A(n,u),A(n,f),A(e,c),A(e,p),A(e,h),A(e,m),A(m,_),A(_,v),A(_,b),A(_,E),A(E,y),A(E,D),li(E,t[2],!0),A(m,F),A(m,P),A(P,L),A(P,R),A(P,M),A(e,le),A(e,V),A(e,X),A(e,K),Fe.m(K,null),A(e,ce),A(e,S),A(e,Q),A(e,j),ht.m(j,null),A(e,U),ge&&ge.m(e,null),A(e,J),A(e,re),Y||(z=[oe(r,"change",t[15]),oe(r,"change",t[12]),oe(f,"click",t[11]),oe(E,"change",t[16]),oe(M,"change",t[10]),oe(re,"click",t[6])],Y=!0)},p(Ee,vt){Ee[0].settings.insertTemplates.length?ee?ee.p(Ee,vt):(ee=Rk(Ee),ee.c(),ee.m(r,null)):ee&&(ee.d(1),ee=null),vt[0]&3&&li(r,Ee[1]),vt[0]&4&&li(E,Ee[2]),Ce===(Ce=_e(Ee,vt))&&Fe?Fe.p(Ee,vt):(Fe.d(1),Fe=Ce(Ee),Fe&&(Fe.c(),Fe.m(K,null))),pt===(pt=je(Ee,vt))&&ht?ht.p(Ee,vt):(ht.d(1),ht=pt(Ee),ht&&(ht.c(),ht.m(j,null))),Ee[2]=="table"?ge?ge.p(Ee,vt):(ge=Wk(Ee),ge.c(),ge.m(e,J)):ge&&(ge.d(1),ge=null)},i:me,o:me,d(Ee){Ee&&B(e),ee&&ee.d(),Fe.d(),ht.d(),ge&&ge.d(),Y=!1,We(z)}}}function k4(t,e,n){let{onSubmit:r}=e,{insertEventsModal:i}=e,o=ye.getInstance(),a,u,f,c,p=[".summary",".description"];Yi(()=>Tt(void 0,void 0,void 0,function*(){let M=yield Sr();n(4,c=M.map(le=>[le,!0]));let H=yield Yt();n(3,f=H.map(le=>[le,!0]))}));let h=()=>{let M=f.filter(H=>H[1]).map(H=>H[0]);r(u,M,p,i)},m=M=>{f.forEach(H=>{H[0].parent.id==M.target.id&&(H[1]=M.target.checked)}),n(3,f)},_=M=>{let H=M.target.value;H=="on"&&(H=M.target.id),p.contains(H)?p.remove(H):p.push(H),n(5,p)},v=M=>{p.contains(M)&&p.remove(M),n(5,p)},b=M=>Tt(void 0,void 0,void 0,function*(){let H=yield Sr();n(4,c=H.map(V=>[V,!0]));let le=yield Yt({startDate:window.moment(M.target.value).local()});n(3,f=le.map(V=>[V,!0])),n(3,f)}),E=()=>c.filter(M=>M[1]).map(M=>M[0].id),y=()=>{new Uh(app,M=>{let H={name:M,insertType:u,tableOptions:p,calendarList:E()};n(0,o.settings.insertTemplates=[...o.settings.insertTemplates,H],o),o.saveSettings(),Ke("Added template")}).open()},O=M=>{let H=M.target.value;if(H=="None")return;let V=o.settings.insertTemplates.find(X=>X.name==H);!V||(n(2,u=V.insertType),n(5,p=V.tableOptions),c.forEach(X=>X[1]=V.calendarList.contains(X[0].id)),f.forEach(X=>X[1]=V.calendarList.contains(X[0].parent.id)),n(4,c),n(3,f))};function D(){a=Hs(this),n(1,a),n(0,o)}function F(){u=Hs(this),n(2,u)}function P(M,H){M[H][1]=this.checked,n(4,c)}function L(M,H){M[H][1]=this.checked,n(3,f)}let R=M=>v(M);return t.$$set=M=>{"onSubmit"in M&&n(13,r=M.onSubmit),"insertEventsModal"in M&&n(14,i=M.insertEventsModal)},[o,a,u,f,c,p,h,m,_,v,b,y,O,r,i,D,F,P,L,R]}var Gk=class extends ze{constructor(e){super();qe(this,e,k4,b4,Ge,{onSubmit:13,insertEventsModal:14},g4,[-1,-1])}},Uk=Gk;var Hk=Oe(Ri()),zh=class extends zk.Modal{constructor(e){super(ye.getInstance().app);this.editor=e}onOpen(){return te(this,null,function*(){let{contentEl:e}=this;new Uk({target:e,props:{onSubmit:this.onSubmit,insertEventsModal:this}})})}onClose(){let{contentEl:e}=this;e.empty()}onSubmit(e,n,r,i){let o="",a="",u="";e=="bullet"?(n.forEach(f=>{u+=`
- ${`[${f.summary}](${f.htmlLink}&cal=${f.parent.id})`}`}),i.editor.replaceRange(u,i.editor.getCursor())):e=="table"&&(r.forEach(f=>{f=f.split(".").join(" ").toLocaleUpperCase(),o+=`| ${f} `,a+="| --- "}),o+=`|
`,a+=`|
`,n.forEach(f=>{r.forEach(c=>{let p=Hk.default.get(f,c.substring(1),"");c==".summary"&&(p=`[${p}](${f.htmlLink}&cal=${f.parent.id})`),c.startsWith(".start")&&!c.contains("timeZone")&&(p=(f.start.date?window.moment(f.start.date):window.moment(f.start.dateTime)).format("YYYY-MM-DD HH:mm")),c.startsWith(".end")&&!c.contains("timeZone")&&(p=(f.start.date?window.moment(f.end.date):window.moment(f.end.dateTime)).format("YYYY-MM-DD HH:mm")),u+=`| ${p} `}),u+=`|
`}),i.editor.replaceRange(o+a+u,i.editor.getCursor())),i.close()}};var Hh=class{constructor(){}make(){return{getCalendars:()=>Pi(),getEvent:(e,n)=>Hp(e,n),getEvents:e=>Np(e),createEvent:e=>qp(e),deleteEvent:(e,n=!1)=>zp(e,n),updateEvent:(e,n=!1)=>Js(e,n),createEventNote:(e,n,r)=>cr(e,n,r)}}};var Kh=Oe(require("obsidian"));var Yl=Oe(Ri());function qk(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}var Ta=qk();function E4(t){Ta=t}var Vk=/[&<>"']/,T4=new RegExp(Vk.source,"g"),Kk=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,S4=new RegExp(Kk.source,"g"),C4={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Zk=t=>C4[t];function Nn(t,e){if(e){if(Vk.test(t))return t.replace(T4,Zk)}else if(Kk.test(t))return t.replace(S4,Zk);return t}var D4=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Xk(t){return t.replace(D4,(e,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}var O4=/(^|[^\[])\^/g;function Wt(t,e){t=typeof t=="string"?t:t.source,e=e||"";let n={replace:(r,i)=>(i=i.source||i,i=i.replace(O4,"$1"),t=t.replace(r,i),n),getRegex:()=>new RegExp(t,e)};return n}var M4=/[^\w:]/g,A4=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Jk(t,e,n){if(t){let r;try{r=decodeURIComponent(Xk(n)).replace(M4,"").toLowerCase()}catch(i){return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}e&&!A4.test(n)&&(n=I4(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(r){return null}return n}var yc={},P4=/^[^:]+:\/*[^/]*$/,N4=/^([^:]+:)[\s\S]*$/,x4=/^([^:]+:\/*[^/]*)[\s\S]*$/;function I4(t,e){yc[" "+t]||(P4.test(t)?yc[" "+t]=t+"/":yc[" "+t]=bc(t,"/",!0)),t=yc[" "+t];let n=t.indexOf(":")===-1;return e.substring(0,2)==="//"?n?e:t.replace(N4,"$1")+e:e.charAt(0)==="/"?n?e:t.replace(x4,"$1")+e:t+e}var wc={exec:function(){}};function Qr(t){let e=1,n,r;for(;e<arguments.length;e++){n=arguments[e];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}function Qk(t,e){let n=t.replace(/\|/g,(o,a,u)=>{let f=!1,c=a;for(;--c>=0&&u[c]==="\\";)f=!f;return f?"|":" |"}),r=n.split(/ \|/),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function bc(t,e,n){let r=t.length;if(r===0)return"";let i=0;for(;i<r;){let o=t.charAt(r-i-1);if(o===e&&!n)i++;else if(o!==e&&n)i++;else break}return t.slice(0,r-i)}function R4(t,e){if(t.indexOf(e[1])===-1)return-1;let n=t.length,r=0,i=0;for(;i<n;i++)if(t[i]==="\\")i++;else if(t[i]===e[0])r++;else if(t[i]===e[1]&&(r--,r<0))return i;return-1}function $k(t){t&&t.sanitize&&!t.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function eE(t,e){if(e<1)return"";let n="";for(;e>1;)e&1&&(n+=t),e>>=1,t+=t;return n+t}function tE(t,e,n,r){let i=e.href,o=e.title?Nn(e.title):null,a=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){r.state.inLink=!0;let u={type:"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,u}return{type:"image",raw:n,href:i,title:o,text:Nn(a)}}function L4(t,e){let n=t.match(/^(\s+)(?:```)/);if(n===null)return e;let r=n[1];return e.split(`
`).map(i=>{let o=i.match(/^\s+/);if(o===null)return i;let[a]=o;return a.length>=r.length?i.slice(r.length):i}).join(`
`)}var kc=class{constructor(e){this.options=e||Ta}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:bc(r,`
`)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],i=L4(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(/#$/.test(r)){let i=bc(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:n[0]}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;let o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(e){let n=this.rules.block.list.exec(e);if(n){let r,i,o,a,u,f,c,p,h,m,_,v,b=n[1].trim(),E=b.length>1,y={type:"list",raw:"",ordered:E,start:E?+b.slice(0,-1):"",loose:!1,items:[]};b=E?`\\d{1,9}\\${b.slice(-1)}`:`\\${b}`,this.options.pedantic&&(b=E?b:"[*+-]");let O=new RegExp(`^( {0,3}${b})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(v=!1,!(!(n=O.exec(e))||this.rules.block.hr.test(e)));){if(r=n[0],e=e.substring(r.length),p=n[2].split(`
`,1)[0],h=e.split(`
`,1)[0],this.options.pedantic?(a=2,_=p.trimLeft()):(a=n[2].search(/[^ ]/),a=a>4?1:a,_=p.slice(a),a+=n[1].length),f=!1,!p&&/^ *$/.test(h)&&(r+=h+`
`,e=e.substring(h.length+1),v=!0),!v){let F=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`),P=new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),L=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),R=new RegExp(`^ {0,${Math.min(3,a-1)}}#`);for(;e&&(m=e.split(`
`,1)[0],p=m,this.options.pedantic&&(p=p.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(L.test(p)||R.test(p)||F.test(p)||P.test(e)));){if(p.search(/[^ ]/)>=a||!p.trim())_+=`
`+p.slice(a);else if(!f)_+=`
`+p;else break;!f&&!p.trim()&&(f=!0),r+=m+`
`,e=e.substring(m.length+1)}}y.loose||(c?y.loose=!0:/\n *\n *$/.test(r)&&(c=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(_),i&&(o=i[0]!=="[ ] ",_=_.replace(/^\[[ xX]\] +/,""))),y.items.push({type:"list_item",raw:r,task:!!i,checked:o,loose:!1,text:_}),y.raw+=r}y.items[y.items.length-1].raw=r.trimRight(),y.items[y.items.length-1].text=_.trimRight(),y.raw=y.raw.trimRight();let D=y.items.length;for(u=0;u<D;u++)if(this.lexer.state.top=!1,y.items[u].tokens=this.lexer.blockTokens(y.items[u].text,[]),!y.loose){let F=y.items[u].tokens.filter(L=>L.type==="space"),P=F.length>0&&F.some(L=>/\n.*\n/.test(L.raw));y.loose=P}if(y.loose)for(u=0;u<D;u++)y.items[u].loose=!0;return y}}html(e){let n=this.rules.block.html.exec(e);if(n){let r={type:"html",raw:n[0],pre:!this.options.sanitizer&&(n[1]==="pre"||n[1]==="script"||n[1]==="style"),text:n[0]};if(this.options.sanitize){let i=this.options.sanitizer?this.options.sanitizer(n[0]):Nn(n[0]);r.type="paragraph",r.text=i,r.tokens=this.lexer.inline(i)}return r}}def(e){let n=this.rules.block.def.exec(e);if(n){let r=n[1].toLowerCase().replace(/\s+/g," "),i=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:i,title:o}}}table(e){let n=this.rules.block.table.exec(e);if(n){let r={type:"table",header:Qk(n[1]).map(i=>({text:i})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(r.header.length===r.align.length){r.raw=n[0];let i=r.align.length,o,a,u,f;for(o=0;o<i;o++)/^ *-+: *$/.test(r.align[o])?r.align[o]="right":/^ *:-+: *$/.test(r.align[o])?r.align[o]="center":/^ *:-+ *$/.test(r.align[o])?r.align[o]="left":r.align[o]=null;for(i=r.rows.length,o=0;o<i;o++)r.rows[o]=Qk(r.rows[o],r.header.length).map(c=>({text:c}));for(i=r.header.length,a=0;a<i;a++)r.header[a].tokens=this.lexer.inline(r.header[a].text);for(i=r.rows.length,a=0;a<i;a++)for(f=r.rows[a],u=0;u<f.length;u++)f[u].tokens=this.lexer.inline(f[u].text);return r}}}lheading(e){let n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){let n=this.rules.block.paragraph.exec(e);if(n){let r=n[1].charAt(n[1].length-1)===`
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:Nn(n[1])}}tag(e){let n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):Nn(n[0]):n[0]}}link(e){let n=this.rules.inline.link.exec(e);if(n){let r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;let a=bc(r.slice(0,-1),"\\");if((r.length-a.length)%2==0)return}else{let a=R4(n[2],"()");if(a>-1){let f=(n[0].indexOf("!")===0?5:4)+n[1].length+a;n[2]=n[2].substring(0,a),n[0]=n[0].substring(0,f).trim(),n[3]=""}}let i=n[2],o="";if(this.options.pedantic){let a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);a&&(i=a[1],o=a[3])}else o=n[3]?n[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(r)?i=i.slice(1):i=i.slice(1,-1)),tE(n,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(e,n){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let i=(r[2]||r[1]).replace(/\s+/g," ");if(i=n[i.toLowerCase()],!i){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return tE(r,i,r[0],this.lexer)}}emStrong(e,n,r=""){let i=this.rules.inline.emStrong.lDelim.exec(e);if(!i||i[3]&&r.match(/[\p{L}\p{N}]/u))return;let o=i[1]||i[2]||"";if(!o||o&&(r===""||this.rules.inline.punctuation.exec(r))){let a=i[0].length-1,u,f,c=a,p=0,h=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,n=n.slice(-1*e.length+a);(i=h.exec(n))!=null;){if(u=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!u)continue;if(f=u.length,i[3]||i[4]){c+=f;continue}else if((i[5]||i[6])&&a%3&&!((a+f)%3)){p+=f;continue}if(c-=f,c>0)continue;f=Math.min(f,f+c+p);let m=e.slice(0,a+i.index+(i[0].length-u.length)+f);if(Math.min(a,f)%2){let v=m.slice(1,-1);return{type:"em",raw:m,text:v,tokens:this.lexer.inlineTokens(v)}}let _=m.slice(2,-2);return{type:"strong",raw:m,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let r=n[2].replace(/\n/g," "),i=/[^ ]/.test(r),o=/^ /.test(r)&&/ $/.test(r);return i&&o&&(r=r.substring(1,r.length-1)),r=Nn(r,!0),{type:"codespan",raw:n[0],text:r}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){let n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e,n){let r=this.rules.inline.autolink.exec(e);if(r){let i,o;return r[2]==="@"?(i=Nn(this.options.mangle?n(r[1]):r[1]),o="mailto:"+i):(i=Nn(r[1]),o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(e,n){let r;if(r=this.rules.inline.url.exec(e)){let i,o;if(r[2]==="@")i=Nn(this.options.mangle?n(r[0]):r[0]),o="mailto:"+i;else{let a;do a=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(a!==r[0]);i=Nn(r[0]),r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e,n){let r=this.rules.inline.text.exec(e);if(r){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):Nn(r[0]):r[0]:i=Nn(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}}}},Ae={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:wc,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ae._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;Ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;Ae.def=Wt(Ae.def).replace("label",Ae._label).replace("title",Ae._title).getRegex();Ae.bullet=/(?:[*+-]|\d{1,9}[.)])/;Ae.listItemStart=Wt(/^( *)(bull) */).replace("bull",Ae.bullet).getRegex();Ae.list=Wt(Ae.list).replace(/bull/g,Ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ae.def.source+")").getRegex();Ae._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";Ae._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;Ae.html=Wt(Ae.html,"i").replace("comment",Ae._comment).replace("tag",Ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();Ae.paragraph=Wt(Ae._paragraph).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ae._tag).getRegex();Ae.blockquote=Wt(Ae.blockquote).replace("paragraph",Ae.paragraph).getRegex();Ae.normal=Qr({},Ae);Ae.gfm=Qr({},Ae.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});Ae.gfm.table=Wt(Ae.gfm.table).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ae._tag).getRegex();Ae.gfm.paragraph=Wt(Ae._paragraph).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Ae.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ae._tag).getRegex();Ae.pedantic=Qr({},Ae.normal,{html:Wt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wc,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Wt(Ae.normal._paragraph).replace("hr",Ae.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ke={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:wc,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:wc,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};ke._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";ke.punctuation=Wt(ke.punctuation).replace(/punctuation/g,ke._punctuation).getRegex();ke.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;ke.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;ke._comment=Wt(Ae._comment).replace("(?:-->|$)","-->").getRegex();ke.emStrong.lDelim=Wt(ke.emStrong.lDelim).replace(/punct/g,ke._punctuation).getRegex();ke.emStrong.rDelimAst=Wt(ke.emStrong.rDelimAst,"g").replace(/punct/g,ke._punctuation).getRegex();ke.emStrong.rDelimUnd=Wt(ke.emStrong.rDelimUnd,"g").replace(/punct/g,ke._punctuation).getRegex();ke._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;ke._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;ke._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;ke.autolink=Wt(ke.autolink).replace("scheme",ke._scheme).replace("email",ke._email).getRegex();ke._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;ke.tag=Wt(ke.tag).replace("comment",ke._comment).replace("attribute",ke._attribute).getRegex();ke._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;ke._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;ke._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;ke.link=Wt(ke.link).replace("label",ke._label).replace("href",ke._href).replace("title",ke._title).getRegex();ke.reflink=Wt(ke.reflink).replace("label",ke._label).replace("ref",Ae._label).getRegex();ke.nolink=Wt(ke.nolink).replace("ref",Ae._label).getRegex();ke.reflinkSearch=Wt(ke.reflinkSearch,"g").replace("reflink",ke.reflink).replace("nolink",ke.nolink).getRegex();ke.normal=Qr({},ke);ke.pedantic=Qr({},ke.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Wt(/^!?\[(label)\]\((.*?)\)/).replace("label",ke._label).getRegex(),reflink:Wt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ke._label).getRegex()});ke.gfm=Qr({},ke.normal,{escape:Wt(ke.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/});ke.gfm.url=Wt(ke.gfm.url,"i").replace("email",ke.gfm._extended_email).getRegex();ke.breaks=Qr({},ke.gfm,{br:Wt(ke.br).replace("{2,}","*").getRegex(),text:Wt(ke.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function F4(t){return t.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function nE(t){let e="",n,r,i=t.length;for(n=0;n<i;n++)r=t.charCodeAt(n),Math.random()>.5&&(r="x"+r.toString(16)),e+="&#"+r+";";return e}var gi=class{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ta,this.options.tokenizer=this.options.tokenizer||new kc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={block:Ae.normal,inline:ke.normal};this.options.pedantic?(n.block=Ae.pedantic,n.inline=ke.pedantic):this.options.gfm&&(n.block=Ae.gfm,this.options.breaks?n.inline=ke.breaks:n.inline=ke.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ae,inline:ke}}static lex(e,n){return new gi(n).lex(e)}static lexInline(e,n){return new gi(n).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
`),this.blockTokens(e,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(e,n=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(u,f,c)=>f+" ".repeat(c.length));let r,i,o,a;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(u=>(r=u.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=`
`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+r.raw,i.text+=`
`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+r.raw,i.text+=`
`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let u=1/0,f=e.slice(1),c;this.options.extensions.startBlock.forEach(function(p){c=p.call({lexer:this},f),typeof c=="number"&&c>=0&&(u=Math.min(u,c))}),u<1/0&&u>=0&&(o=e.substring(0,u+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){i=n[n.length-1],a&&i.type==="paragraph"?(i.raw+=`
`+r.raw,i.text+=`
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r),a=o.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=`
`+r.raw,i.text+=`
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let r,i,o,a=e,u,f,c;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(u=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)p.includes(u[0].slice(u[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,u.index)+"["+eE("a",u[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(u=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,u.index)+"["+eE("a",u[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(u=this.tokenizer.rules.inline.escapedEmSt.exec(a))!=null;)a=a.slice(0,u.index+u[0].length-2)+"++"+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(f||(c=""),f=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(p=>(r=p.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(e,a,c)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(e,nE)){e=e.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e,nE))){e=e.substring(r.raw.length),n.push(r);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let p=1/0,h=e.slice(1),m;this.options.extensions.startInline.forEach(function(_){m=_.call({lexer:this},h),typeof m=="number"&&m>=0&&(p=Math.min(p,m))}),p<1/0&&p>=0&&(o=e.substring(0,p+1))}if(r=this.tokenizer.inlineText(o,F4)){e=e.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(c=r.raw.slice(-1)),f=!0,i=n[n.length-1],i&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},Ec=class{constructor(e){this.options=e||Ta}code(e,n,r){let i=(n||"").match(/\S*/)[0];if(this.options.highlight){let o=this.options.highlight(e,i);o!=null&&o!==e&&(r=!0,e=o)}return e=e.replace(/\n$/,"")+`
`,i?'<pre><code class="'+this.options.langPrefix+Nn(i)+'">'+(r?e:Nn(e,!0))+`</code></pre>
`:"<pre><code>"+(r?e:Nn(e,!0))+`</code></pre>
`}blockquote(e){return`<blockquote>
${e}</blockquote>
`}html(e){return e}heading(e,n,r,i){if(this.options.headerIds){let o=this.options.headerPrefix+i.slug(r);return`<h${n} id="${o}">${e}</h${n}>
`}return`<h${n}>${e}</h${n}>
`}hr(){return this.options.xhtml?`<hr/>
`:`<hr>
`}list(e,n,r){let i=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+i+o+`>
`+e+"</"+i+`>
`}listitem(e){return`<li>${e}</li>
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>
`}table(e,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+n+`</table>
`}tablerow(e){return`<tr>
${e}</tr>
`}tablecell(e,n){let r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`</${r}>
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,n,r){if(e=Jk(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let i='<a href="'+e+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(e,n,r){if(e=Jk(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let i=`<img src="${e}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=this.options.xhtml?"/>":">",i}text(e){return e}},qh=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,n,r){return""+r}image(e,n,r){return""+r}br(){return""}},Vh=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,n){let r=e,i=0;if(this.seen.hasOwnProperty(r)){i=this.seen[e];do i++,r=e+"-"+i;while(this.seen.hasOwnProperty(r))}return n||(this.seen[e]=i,this.seen[r]=0),r}slug(e,n={}){let r=this.serialize(e);return this.getNextSafeSlug(r,n.dryrun)}},$r=class{constructor(e){this.options=e||Ta,this.options.renderer=this.options.renderer||new Ec,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qh,this.slugger=new Vh}static parse(e,n){return new $r(n).parse(e)}static parseInline(e,n){return new $r(n).parseInline(e)}parse(e,n=!0){let r="",i,o,a,u,f,c,p,h,m,_,v,b,E,y,O,D,F,P,L,R=e.length;for(i=0;i<R;i++){if(_=e[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[_.type]&&(L=this.options.extensions.renderers[_.type].call({parser:this},_),L!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(_.type))){r+=L||"";continue}switch(_.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{r+=this.renderer.heading(this.parseInline(_.tokens),_.depth,Xk(this.parseInline(_.tokens,this.textRenderer)),this.slugger);continue}case"code":{r+=this.renderer.code(_.text,_.lang,_.escaped);continue}case"table":{for(h="",p="",u=_.header.length,o=0;o<u;o++)p+=this.renderer.tablecell(this.parseInline(_.header[o].tokens),{header:!0,align:_.align[o]});for(h+=this.renderer.tablerow(p),m="",u=_.rows.length,o=0;o<u;o++){for(c=_.rows[o],p="",f=c.length,a=0;a<f;a++)p+=this.renderer.tablecell(this.parseInline(c[a].tokens),{header:!1,align:_.align[a]});m+=this.renderer.tablerow(p)}r+=this.renderer.table(h,m);continue}case"blockquote":{m=this.parse(_.tokens),r+=this.renderer.blockquote(m);continue}case"list":{for(v=_.ordered,b=_.start,E=_.loose,u=_.items.length,m="",o=0;o<u;o++)O=_.items[o],D=O.checked,F=O.task,y="",O.task&&(P=this.renderer.checkbox(D),E?O.tokens.length>0&&O.tokens[0].type==="paragraph"?(O.tokens[0].text=P+" "+O.tokens[0].text,O.tokens[0].tokens&&O.tokens[0].tokens.length>0&&O.tokens[0].tokens[0].type==="text"&&(O.tokens[0].tokens[0].text=P+" "+O.tokens[0].tokens[0].text)):O.tokens.unshift({type:"text",text:P}):y+=P),y+=this.parse(O.tokens,E),m+=this.renderer.listitem(y,F,D);r+=this.renderer.list(m,v,b);continue}case"html":{r+=this.renderer.html(_.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(_.tokens));continue}case"text":{for(m=_.tokens?this.parseInline(_.tokens):_.text;i+1<R&&e[i+1].type==="text";)_=e[++i],m+=`
`+(_.tokens?this.parseInline(_.tokens):_.text);r+=n?this.renderer.paragraph(m):m;continue}default:{let M='Token with "'+_.type+'" type was not found.';if(this.options.silent){console.error(M);return}else throw new Error(M)}}}return r}parseInline(e,n){n=n||this.renderer;let r="",i,o,a,u=e.length;for(i=0;i<u;i++){if(o=e[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(a=this.options.extensions.renderers[o.type].call({parser:this},o),a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type))){r+=a||"";continue}switch(o.type){case"escape":{r+=n.text(o.text);break}case"html":{r+=n.html(o.text);break}case"link":{r+=n.link(o.href,o.title,this.parseInline(o.tokens,n));break}case"image":{r+=n.image(o.href,o.title,o.text);break}case"strong":{r+=n.strong(this.parseInline(o.tokens,n));break}case"em":{r+=n.em(this.parseInline(o.tokens,n));break}case"codespan":{r+=n.codespan(o.text);break}case"br":{r+=n.br();break}case"del":{r+=n.del(this.parseInline(o.tokens,n));break}case"text":{r+=n.text(o.text);break}default:{let f='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(f);return}else throw new Error(f)}}}return r}};function xe(t,e,n){if(typeof t=="undefined"||t===null)throw new Error("marked(): input parameter is undefined or null");if(typeof t!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");if(typeof e=="function"&&(n=e,e=null),e=Qr({},xe.defaults,e||{}),$k(e),n){let i=e.highlight,o;try{o=gi.lex(t,e)}catch(f){return n(f)}let a=function(f){let c;if(!f)try{e.walkTokens&&xe.walkTokens(o,e.walkTokens),c=$r.parse(o,e)}catch(p){f=p}return e.highlight=i,f?n(f):n(null,c)};if(!i||i.length<3||(delete e.highlight,!o.length))return a();let u=0;xe.walkTokens(o,function(f){f.type==="code"&&(u++,setTimeout(()=>{i(f.text,f.lang,function(c,p){if(c)return a(c);p!=null&&p!==f.text&&(f.text=p,f.escaped=!0),u--,u===0&&a()})},0))}),u===0&&a();return}function r(i){if(i.message+=`
Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An error occurred:</p><pre>"+Nn(i.message+"",!0)+"</pre>";throw i}try{let i=gi.lex(t,e);if(e.walkTokens){if(e.async)return Promise.all(xe.walkTokens(i,e.walkTokens)).then(()=>$r.parse(i,e)).catch(r);xe.walkTokens(i,e.walkTokens)}return $r.parse(i,e)}catch(i){r(i)}}xe.options=xe.setOptions=function(t){return Qr(xe.defaults,t),E4(xe.defaults),xe};xe.getDefaults=qk;xe.defaults=Ta;xe.use=function(...t){let e=xe.defaults.extensions||{renderers:{},childTokens:{}};t.forEach(n=>{let r=Qr({},n);if(r.async=xe.defaults.async||r.async,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){let o=e.renderers[i.name];o?e.renderers[i.name]=function(...a){let u=i.renderer.apply(this,a);return u===!1&&(u=o.apply(this,a)),u}:e.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[i.level]?e[i.level].unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),r.extensions=e),n.renderer){let i=xe.defaults.renderer||new Ec;for(let o in n.renderer){let a=i[o];i[o]=(...u)=>{let f=n.renderer[o].apply(i,u);return f===!1&&(f=a.apply(i,u)),f}}r.renderer=i}if(n.tokenizer){let i=xe.defaults.tokenizer||new kc;for(let o in n.tokenizer){let a=i[o];i[o]=(...u)=>{let f=n.tokenizer[o].apply(i,u);return f===!1&&(f=a.apply(i,u)),f}}r.tokenizer=i}if(n.walkTokens){let i=xe.defaults.walkTokens;r.walkTokens=function(o){let a=[];return a.push(n.walkTokens.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}xe.setOptions(r)})};xe.walkTokens=function(t,e){let n=[];for(let r of t)switch(n=n.concat(e.call(xe,r)),r.type){case"table":{for(let i of r.header)n=n.concat(xe.walkTokens(i.tokens,e));for(let i of r.rows)for(let o of i)n=n.concat(xe.walkTokens(o.tokens,e));break}case"list":{n=n.concat(xe.walkTokens(r.items,e));break}default:xe.defaults.extensions&&xe.defaults.extensions.childTokens&&xe.defaults.extensions.childTokens[r.type]?xe.defaults.extensions.childTokens[r.type].forEach(function(i){n=n.concat(xe.walkTokens(r[i],e))}):r.tokens&&(n=n.concat(xe.walkTokens(r.tokens,e)))}return n};xe.parseInline=function(t,e){if(typeof t=="undefined"||t===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof t!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");e=Qr({},xe.defaults,e||{}),$k(e);try{let n=gi.lexInline(t,e);return e.walkTokens&&xe.walkTokens(n,e.walkTokens),$r.parseInline(n,e)}catch(n){if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An error occurred:</p><pre>"+Nn(n.message+"",!0)+"</pre>";throw n}};xe.Parser=$r;xe.parser=$r.parse;xe.Renderer=Ec;xe.TextRenderer=qh;xe.Lexer=gi;xe.lexer=gi.lex;xe.Tokenizer=kc;xe.Slugger=Vh;xe.parse=xe;var NH=xe.options,xH=xe.setOptions,IH=xe.use,RH=xe.walkTokens,LH=xe.parseInline;var FH=$r.parse,YH=gi.lex;var rE=(t,e,n)=>{if(t<0&&(t=e.length+t),!(t>=e.length&&t>=0))return t+1<e.length?n.substring(e[t].position.start.offset,e[t+1].position.start.offset-1):n.substring(e[t].position.start.offset,n.length)},iE=t=>te(void 0,null,function*(){var h,m,_,v,b,E;let e=ye.getInstance(),n=yield app.vault.adapter.read((0,Kh.normalizePath)(t.file.path)),r=(m=Yl.default.cloneDeep((h=app==null?void 0:app.metadataCache)==null?void 0:h.getFileCache(t.file).frontmatter))!=null?m:{},i=/\[([^[]*)::([^[]*)\]/gm,o,a=[];do o=i.exec(n),a.push(o);while(o);if(a.forEach(y=>{y&&Yl.default.set(r,y[1].trim(),y[2].trim())}),!r){Ke("No frontmatter found in note",!0);return}let u=Y4(r);for(let[y,O]of Object.entries(u)){let D=Yl.default.get(r,y,null);D&&Yl.default.set(r,O,D)}let f=yield Sr(),c=r.position;delete r.position;let p=f.find(y=>{var O,D;return y.id==((O=r.calendar)!=null?O:e.settings.defaultCalendar)||y.summary==((D=r.calendar)!=null?D:e.settings.defaultCalendar)});if(!p){Ke("Event not created. Calendar not defined. Set a default calendar in the settings or set the field calendar");return}if(r.parent=p,r.summary||(r.summary=t.file.basename),r.description){if(typeof r.description=="string"){if(((_=r.description)==null?void 0:_.toLowerCase())=="header"&&(r.description="",((v=app==null?void 0:app.metadataCache)==null?void 0:v.getFileCache(t.file).headings).forEach(O=>{r.description+=`<h${O.level}>${O.heading}</h${O.level}>`})),((b=r.description)==null?void 0:b.toLowerCase())=="file"){let y=xe.parse(n.substring(c.end.offset));r.description=y}}else if(typeof r.description=="object"){let y=(E=app==null?void 0:app.metadataCache)==null?void 0:E.getFileCache(t.file).headings,O=r.description.map(F=>{if(typeof F=="number"){let P=rE(F,y,n);return P||-1}else if(typeof F=="object"){if(F.length!=2)return-1;let[P,L]=F;if(P<0&&(P=y.length+P),L<0&&(L=y.length+L),P>=y.length||L>=y.length||P<0||L<0||P>L)return-1;let R="";for(let M=P;M<=L;M++){let H=rE(M,y,n);if(!H)return-1;R+=H+`
`}return R}});if(O.contains(-1)){Ke("Event not created.A Header in the header list is out of range",!0);return}let D=xe.parse(O.join(`
`));r.description=D}}if(!r.start&&!r.startTime&&(r.start={date:window.moment()}),!r.end&&!r.endTime&&(r.end=r.start),r.start.date?(r.start.date=window.moment(r.start.date).format("YYYY-MM-DD"),r.end.date=window.moment(r.end.date).format("YYYY-MM-DD")):(r.start.dateTime=window.moment(r.start.dateTime).format(),r.end.dateTime=window.moment(r.end.dateTime).format()),r.recurrence)try{let y=cv.fromText(r.recurrence),O=new ns;O.rrule(y),r.recurrence=O.valueOf()}catch(y){Ke("Event not created. Error in recurrence text.",!0);return}return r}),Y4=t=>{var n;let e=new Map;if(typeof t.mapping=="string"){t.mapping.endsWith(".md")||(t.mapping+=".md");let r=(0,Kh.normalizePath)(t.mapping),i=app.vault.getAbstractFileByPath(r);if(!i)return Ke(`Mapping Error, file "${r}" not found.`),e;if(t=(n=app==null?void 0:app.metadataCache)==null?void 0:n.getFileCache(i).frontmatter,!t)return Ke(`Mapping Error, file "${r}" does not contain frontmatter.`),e}return t.mapping?t.mapping:e};var oE=Oe(require("obsidian"));var sE=t=>te(void 0,null,function*(){var f,c;if(oE.Platform.isMobile)return;let e=ye.getInstance(),{remote:n}=require("electron"),{file:r}=oa(t,e),i=r?"Open Note":"Create Note",o=(f=t.summary)!=null?f:"Event started",a=(c=t.description)!=null?c:"",u;process.platform==="win32"?u=new n.Notification({toastXml:`
<toast
content="Open Note"
arguments="obsidian://googleOpenNote?event=${t.id}::${t.parent.id}"
activationType="protocol"
>
<visual>
<binding template="ToastGeneric">
<text>Google event now</text>
<text>Title: ${o}</text>
<text>Description: ${a}</text>
</binding>
</visual>
<actions>
<action
content="${i}"
arguments="obsidian://googleOpenNote?event=${t.id}::${t.parent.id}"
activationType="protocol"/>
<action activationType="background" content="Dismiss" arguments="dismiss"/>
</actions>
</toast>`}):process.platform==="darwin"&&(u=new n.Notification({title:o,body:a,actions:[{type:"button",text:i},{type:"button",text:"Dismiss"}]}),u.on("action",(p,h)=>{h===0&&window.open(`obsidian://googleOpenNote?event=${t.id}::${t.parent.id}`)})),u.show()});var aE=Oe(require("obsidian"));var W4=(...e)=>te(void 0,[...e],function*(t={}){return(yield Yt(t)).map(i=>{var f;if(!((f=i.description)==null?void 0:f.includes("~obsidianTask~")))return null;let o=i.description.replace(/<br>/g,`
`).replace(/<\/?[^>]+(>|$)/g,""),a=(0,aE.parseYaml)(o);return{event:i,current:a.current||0,steps:a.steps||0,goal:a.goal||0,done:a.done||!1}}).filter(i=>i!==null)}),lE=()=>te(void 0,null,function*(){return yield W4()});var j4={googleClientId:"",googleClientSecret:"",googleRefreshToken:"",useCustomClient:!0,googleOAuthServer:"https://obsidian-google-calendar.vercel.app",refreshInterval:10,useNotification:!1,showNotice:!0,autoCreateEventNotes:!0,autoCreateEventNotesMarker:"obsidian",autoCreateEventKeepOpen:!1,importStartOffset:1,importEndOffset:1,optionalNotePrefix:"",eventNoteNameFormat:"{{prefix}}{{event-title}}",defaultCalendar:"",calendarBlackList:[],insertTemplates:[],useDefaultTemplate:!1,defaultTemplate:"",defaultFolder:app.vault.config.newFileFolderPath,activateDailyNoteAddon:!1,dailyNoteDotColor:"#6aa1d8",useWeeklyNotes:!1,debugMode:!1,timelineHourFormat:0,atAnnotationEnabled:!0,usDateFormat:!0,viewSettings:{day:{type:"day",exclude:[],include:[],hourRange:[0,24],offset:0,timespan:1,showAllDay:!0,navigation:!0},week:{type:"week",exclude:[],include:[],hourRange:[0,24],offset:0,timespan:7,showAllDay:!0,navigation:!0},schedule:{type:"schedule",exclude:[],include:[],hourRange:[0,24],offset:0,timespan:7,showAllDay:!0,navigation:!0},month:{type:"month",exclude:[],include:[],offset:0},year:{type:"year",exclude:[],include:[],offset:0,size:15},web:{type:"web",theme:"auto",view:"day",offset:0}}},ye=class extends Do.Plugin{constructor(){super(...arguments);this.events=[];this.initView=e=>te(this,null,function*(){this.app.workspace.getLeavesOfType(e).length===0&&(Do.Platform.isMobile||e===ka||e===So?yield this.app.workspace.getLeaf(!0).setViewState({type:e}):yield this.app.workspace.getRightLeaf(!1).setViewState({type:e}));let n=this.app.workspace.getLeavesOfType(e).first();return this.app.workspace.revealLeaf(n),n});this.onLayoutReady=()=>te(this,null,function*(){var r;Bs(this),so(this);let e=(r=this.app.internalPlugins)==null?void 0:r.plugins.templates;e&&e.enabled&&(this.coreTemplatePlugin=e);let n=this.app.plugins.plugins["templater-obsidian"];n&&n._loaded&&(this.templaterPlugin=n),yield eh(this)})}static getInstance(){return ye.instance}onload(){return te(this,null,function*(){if(ye.instance=this,this.api=new Hh().make(),yield this.loadSettings(),this.app.workspace.onLayoutReady(this.onLayoutReady),this.events.push(this.app.vault.on("create",()=>{Bs(this),so(this)})),this.events.push(this.app.vault.on("delete",()=>{Bs(this),so(this)})),this.events.push(this.app.vault.on("rename",()=>{Bs(this),so(this)})),this.events.forEach(e=>{this.registerEvent(e)}),this.settings.useNotification){let e=window.setInterval(()=>te(this,null,function*(){let n=yield Yt(),r=window.moment();n.filter(o=>o.start.date?!1:window.moment(o.start.dateTime).isSame(r,"minute")).forEach(o=>{sE(o)})}),1e3*60);this.registerInterval(e)}this.registerMarkdownCodeBlockProcessor("gEvent",(e,n,r)=>bk(e,n,r)),this.registerEditorSuggest(new Gh(this.app)),this.registerView(ds,e=>new Pl(e)),this.registerView(So,e=>new Nl(e)),this.registerView(Il,e=>new Yh(e)),this.registerView(Rl,e=>new Wh(e)),this.registerView(ka,e=>new jh(e)),this.registerView(To,e=>new ba(e)),this.registerEvent(this.app.workspace.on("editor-change",e=>{Ck(e,this),Ok(e)})),this.addCommand({id:"open-google-calendar-timline-view",name:"Open gCal Timeline View",callback:()=>this.initView(ds)}),this.addCommand({id:"open-google-calendar-week-view",name:"Open gCal week view",callback:()=>this.initView(So)}),this.addCommand({id:"open-google-calendar-month-view",name:"Open gCal month view",callback:()=>this.initView(Il)}),this.addCommand({id:"open-google-calendar-year-view",name:"Open gCal year view",callback:()=>this.initView(Rl)}),this.addCommand({id:"open-google-calendar-web-view",name:"Open gCal Web View",callback:()=>this.initView(ka)}),this.addCommand({id:"open-google-calendar-schedule-view",name:"Open gCal Schedule View",callback:()=>this.initView(To)}),this.addCommand({id:"create-google-calendar-event",name:"Create gCal Event",checkCallback:e=>{let n=Ft();if(e)return n;!n||new Nr({start:{},end:{}},()=>{zr()}).open()}}),this.addCommand({id:"list-google-calendars",name:"List Google Calendars",checkCallback:e=>{let n=Ft();if(e)return n;!n||Sr().then(r=>{new nh(r).open()})}}),this.addCommand({id:"list-google-events",name:"List gCal Events",checkCallback:e=>{let n=Ft();if(e)return n;!n||Yt().then(r=>{new dr(r,"details").open()})}}),this.addCommand({id:"google-calendar-trigger-auto-import",name:"gCal Trigger Auto Import",checkCallback:e=>{let n=Ft();if(e)return n;!n||eh(this)}}),this.addCommand({id:"google-calendar-create-event-note",name:"Create Event Note",checkCallback:e=>{let n=Ft();if(e)return n;!n||Yt().then(r=>{new dr(r,"createNote").open()})}}),this.addCommand({id:"google-calendar-get-todays-tasks",name:"Get Today's gCal Tasks",checkCallback:e=>{let n=Ft();if(e)return n;!n||lE().then(r=>{console.log(r)})}}),this.addCommand({id:"google-calendar-create-event-note-current-event",name:"Create Event Note for Current gCal Event",checkCallback:e=>{let n=Ft();if(e)return n;!n||Yt().then(r=>{let i=r.filter(o=>{if(o.start.date)return!1;let a=window.moment(o.start.dateTime),u=window.moment(o.end.dateTime),f=window.moment();return!(f.isBefore(a)||f.isAfter(u))});i.length==0&&(i=r.filter(o=>{if(o.start.date)return!1;let a=window.moment(o.start.dateTime).subtract(1,"hour"),u=window.moment(o.end.dateTime),f=window.moment();return!(f.isBefore(a)||f.isAfter(u))})),i.length==0&&(i=r.filter(o=>!!o.start.date)),i.length==1?this.settings.useDefaultTemplate&&this.settings.defaultFolder&&this.settings.defaultFolder?cr(i[0],this.settings.defaultFolder,this.settings.defaultTemplate):new fi(i[0],()=>{}).open():new dr(i,"createNote").open()})}}),this.addCommand({id:"insert-google-event-codeblock",name:"Insert gCal Event CodeBlock",editorCallback:e=>{e.replaceRange("```gEvent\ndate: "+window.moment().format("YYYY-MM-DD")+"\ntype: day\n```",e.getCursor())}}),this.addCommand({id:"insert-google-event-template",name:"Insert gCal Event Template",editorCallback:e=>{e.replaceRange("{{gEvent.}}",e.getCursor());let n=e.getCursor();n.ch+="{{gEvent.".length,e.setCursor(n)}}),this.addCommand({id:"insert-google-events",name:"Insert gCal Events",editorCheckCallback:(e,n)=>{let r=Ft();if(e)return r;!r||new zh(n).open()}}),this.addCommand({id:"create-google-calendar-event-from-frontmatter ",name:"Create gCal Event From Frontmatter",editorCheckCallback:(e,n,r)=>{let i=Ft();if(e)return i;!i||!r.file||iE(r).then(o=>{!o||ff(o)})}}),this.settingsTab=new Mp(this.app,this),this.addSettingTab(this.settingsTab),this.registerObsidianProtocolHandler("googleLogin",e=>te(this,null,function*(){if(!Do.Platform.isDesktop&&e.code){k_(e.code,e.state);return}Do.Platform.isMobile&&e.at&&(Mi(e.at),no(e.rt),Ai(+new Date+36e5),new Do.Notice("Login successful!"),this.settingsTab.display())})),this.registerObsidianProtocolHandler("googleOpenNote",e=>te(this,null,function*(){if(!e.event)return;let[n,r]=e.event.split("::"),i=yield uo(n,r),{file:o}=oa(i,this);o?app.workspace.getLeaf(!0).openFile(o):this.settings.useDefaultTemplate&&this.settings.defaultFolder&&this.settings.defaultFolder?cr(i,this.settings.defaultFolder,this.settings.defaultTemplate):new fi(i,a=>o=a).open()}))})}onunload(){this.app.workspace.detachLeavesOfType(ds),this.app.workspace.detachLeavesOfType(So),this.app.workspace.detachLeavesOfType(Il),this.app.workspace.detachLeavesOfType(Rl),this.app.workspace.detachLeavesOfType(ka),this.app.workspace.detachLeavesOfType(To);for(let e in this.events)this.app.vault.offref(e);this.events=[]}loadSettings(){return te(this,null,function*(){this.settings=Object.assign({},j4,yield this.loadData())})}saveSettings(){return te(this,null,function*(){yield this.saveData(this.settings)})}};
/*!
* rrule.js - Library for working with recurrence rules for calendar dates.
* https://github.com/jakubroztocil/rrule
*
* Copyright 2010, Jakub Roztocil and Lars Schoning
* Licenced under the BSD licence.
* https://github.com/jakubroztocil/rrule/blob/master/LICENCE
*
* Based on:
* python-dateutil - Extensions to the standard Python datetime module.
* Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net>
* Copyright (c) 2012 - Tomi Pieviläinen <tomi.pievilainen@iki.fi>
* https://github.com/jakubroztocil/rrule/blob/master/LICENCE
*
*/
/*!
* rrule.js - Library for working with recurrence rules for calendar dates.
* https://github.com/jakubroztocil/rrule
*
* Copyright 2010, Jakub Roztocil and Lars Schoning
* Licenced under the BSD licence.
* https://github.com/jakubroztocil/rrule/blob/master/LICENCE
*
*/
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/