/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ "use strict";var PS=Object.create;var ol=Object.defineProperty;var MS=Object.getOwnPropertyDescriptor;var RS=Object.getOwnPropertyNames;var QS=Object.getPrototypeOf,IS=Object.prototype.hasOwnProperty;var FS=(r,e,t)=>e in r?ol(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var _t=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ZS=(r,e)=>{for(var t in e)ol(r,t,{get:e[t],enumerable:!0})},xy=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of RS(e))!IS.call(r,a)&&a!==t&&ol(r,a,{get:()=>e[a],enumerable:!(n=MS(e,a))||n.enumerable});return r};var Gn=(r,e,t)=>(t=r!=null?PS(QS(r)):{},xy(e||!r||!r.__esModule?ol(t,"default",{value:r,enumerable:!0}):t,r)),qS=r=>xy(ol({},"__esModule",{value:!0}),r);var dr=(r,e,t)=>(FS(r,typeof e!="symbol"?e+"":e,t),t),jh=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var Me=(r,e,t)=>(jh(r,e,"read from private field"),t?t.call(r):e.get(r)),Tt=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},Nt=(r,e,t,n)=>(jh(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t);var qo=(r,e,t)=>(jh(r,e,"access private method"),t);var Fy=_t(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.default=void 0;var OA={sum:function(e){return e.reduce(function(t,n){return t+n})}},_A=OA;Ku.default=_A});var Ju=_t((JL,Zy)=>{function wA(r){return Object.prototype.toString.call(r).slice(8,-1)}Zy.exports=wA});var ep=_t((eB,qy)=>{function DA(r){return!!r&&typeof r=="object"&&r.constructor===Object}qy.exports=DA});var ec=_t((tB,Ly)=>{function CA(r,e){return Object.prototype.hasOwnProperty.call(r,e)}Ly.exports=CA});var Yy=_t((rB,Wy)=>{var kA=ec(),tc,Uy;function EA(){Uy=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],tc=!0;for(var r in{toString:null})tc=!1}function xA(r,e,t){var n,a=0;tc==null&&EA();for(n in r)if(By(e,r,n,t)===!1)break;if(tc)for(var i=r.constructor,o=!!i&&r===i.prototype;(n=Uy[a++])&&!((n!=="constructor"||!o&&kA(r,n))&&r[n]!==Object.prototype[n]&&By(e,r,n,t)===!1););}function By(r,e,t,n){return r.call(n,e[t],t,e)}Wy.exports=xA});var sl=_t((nB,zy)=>{var SA=ec(),AA=Yy();function $A(r,e,t){AA(r,function(n,a){if(SA(r,a))return e.call(t,r[a],a,r)})}zy.exports=$A});var jy=_t((aB,Vy)=>{var TA=sl();function NA(r,e){for(var t=0,n=arguments.length,a;++t{var MA=Ju(),RA=ep(),QA=jy();function IA(r){switch(MA(r)){case"Object":return FA(r);case"Array":return LA(r);case"RegExp":return ZA(r);case"Date":return qA(r);default:return r}}function FA(r){return RA(r)?QA({},r):r}function ZA(r){var e="";return e+=r.multiline?"m":"",e+=r.global?"g":"",e+=r.ignoreCase?"i":"",new RegExp(r.source,e)}function qA(r){return new Date(+r)}function LA(r){return r.slice()}Xy.exports=IA});var Ky=_t((oB,Hy)=>{var BA=Gy(),UA=sl(),WA=Ju(),YA=ep();function tp(r,e){switch(WA(r)){case"Object":return zA(r,e);case"Array":return VA(r,e);default:return BA(r)}}function zA(r,e){if(YA(r)){var t={};return UA(r,function(n,a){this[a]=tp(n,e)},t),t}else return e?e(r):r}function VA(r,e){for(var t=[],n=-1,a=r.length,i;++n{function jA(r,e){return r===e?r!==0||1/r===1/e:r!==r&&e!==e}Jy.exports=jA});var rp=_t((lB,eb)=>{var XA=Ju();function GA(r,e){return XA(r)===e}eb.exports=GA});var np=_t((uB,tb)=>{var HA=rp();function KA(r){return HA(r,"Object")}tb.exports=KA});var nc=_t((cB,rb)=>{var JA=rp(),e9=Array.isArray||function(r){return JA(r,"Array")};rb.exports=e9});var ab=_t((fB,nb)=>{function t9(r){return r}nb.exports=t9});var ob=_t((dB,ib)=>{function r9(r){return function(e){return e[r]}}ib.exports=r9});var ub=_t((hB,lb)=>{var n9=sl(),sb=nc();function a9(r,e){for(var t=-1,n=r.length;++t{var s9=ab(),l9=ob(),u9=ub();function c9(r,e){if(r==null)return s9;switch(typeof r){case"function":return typeof e<"u"?function(t,n,a){return r.call(e,t,n,a)}:r;case"object":return function(t){return u9(t,r)};case"string":case"number":return l9(r)}}cb.exports=c9});var db=_t((mB,fb)=>{var f9=sl(),d9=ip();function h9(r,e,t){e=d9(e,t);var n=!0;return f9(r,function(a,i){if(!e(a,i,r))return n=!1,!1}),n}fb.exports=h9});var yb=_t((gB,gb)=>{var mb=ec(),hb=db(),pb=np(),p9=rc();function m9(r){return function(e,t){return mb(this,t)&&r(e,this[t])}}function g9(r,e){return mb(this,e)}function y9(r,e,t){return t=t||p9,!pb(r)||!pb(e)?t(r,e):hb(r,m9(t),e)&&hb(e,g9,r)}gb.exports=y9});var vb=_t((yB,bb)=>{var b9=ip();function v9(r,e,t){e=b9(e,t);var n=!0;if(r==null)return n;for(var a=-1,i=r.length;++a{var O9=rc(),Ob=nc(),_9=vb();function w9(r,e,t){return t=t||O9,!Ob(r)||!Ob(e)?t(r,e):r.length!==e.length?!1:_9(r,D9(t),e)}function D9(r){return function(e,t){return t in this&&r(e,this[t])}}_b.exports=w9});var xb=_t((vB,Eb)=>{var C9=rc(),Db=np(),Cb=nc(),k9=yb(),E9=wb();function kb(r,e,t){t=t||C9;var n=Db(r)&&Db(e),a=!n&&Cb(r)&&Cb(e);if(!n&&!a)return t(r,e);function i(s,l){return kb(s,l,t)}var o=n?k9:E9;return o(r,e,i)}Eb.exports=kb});var Sb=_t((op,sp)=>{(function(r,e){typeof op=="object"&&typeof sp<"u"?sp.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis<"u"?globalThis:r||self,r.chroma=e())})(op,function(){"use strict";for(var r=function(v,x,Q){return x===void 0&&(x=0),Q===void 0&&(Q=1),vQ?Q:v},e=r,t=function(v){v._clipped=!1,v._unclipped=v.slice(0);for(var x=0;x<=3;x++)x<3?((v[x]<0||v[x]>255)&&(v._clipped=!0),v[x]=e(v[x],0,255)):x===3&&(v[x]=e(v[x],0,1));return v},n={},a=0,i=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];a=3?Array.prototype.slice.call(v):l(v[0])=="object"&&x?x.split("").filter(function(Q){return v[0][Q]!==void 0}).map(function(Q){return v[0][Q]}):v[0]},c=s,f=function(v){if(v.length<2)return null;var x=v.length-1;return c(v[x])=="string"?v[x].toLowerCase():null},d=Math.PI,h={clip_rgb:t,limit:r,type:s,unpack:u,last:f,PI:d,TWOPI:d*2,PITHIRD:d/3,DEG2RAD:d/180,RAD2DEG:180/d},p={format:{},autodetect:[]},m=h.last,O=h.clip_rgb,b=h.type,E=p,D=function(){for(var x=[],Q=arguments.length;Q--;)x[Q]=arguments[Q];var q=this;if(b(x[0])==="object"&&x[0].constructor&&x[0].constructor===this.constructor)return x[0];var H=m(x),J=!1;if(!H){J=!0,E.sorted||(E.autodetect=E.autodetect.sort(function(ke,Fe){return Fe.p-ke.p}),E.sorted=!0);for(var G=0,ne=E.autodetect;G4?v[4]:1;return J===1?[0,0,0,G]:[Q>=1?0:255*(1-Q)*(1-J),q>=1?0:255*(1-q)*(1-J),H>=1?0:255*(1-H)*(1-J),G]},j=L,X=w,fe=C,ee=p,te=h.unpack,ge=h.type,he=Z;fe.prototype.cmyk=function(){return he(this._rgb)},X.cmyk=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(fe,[null].concat(v,["cmyk"])))},ee.format.cmyk=j,ee.autodetect.push({p:2,test:function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];if(v=te(v,"cmyk"),ge(v)==="array"&&v.length===4)return"cmyk"}});var ue=h.unpack,xe=h.last,Pe=function(v){return Math.round(v*100)/100},Ye=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=ue(v,"hsla"),q=xe(v)||"lsa";return Q[0]=Pe(Q[0]||0),Q[1]=Pe(Q[1]*100)+"%",Q[2]=Pe(Q[2]*100)+"%",q==="hsla"||Q.length>3&&Q[3]<1?(Q[3]=Q.length>3?Q[3]:1,q="hsla"):Q.length=3,q+"("+Q.join(",")+")"},it=Ye,Be=h.unpack,st=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];v=Be(v,"rgba");var Q=v[0],q=v[1],H=v[2];Q/=255,q/=255,H/=255;var J=Math.min(Q,q,H),G=Math.max(Q,q,H),ne=(G+J)/2,se,ye;return G===J?(se=0,ye=Number.NaN):se=ne<.5?(G-J)/(G+J):(G-J)/(2-G-J),Q==G?ye=(q-H)/(G-J):q==G?ye=2+(H-Q)/(G-J):H==G&&(ye=4+(Q-q)/(G-J)),ye*=60,ye<0&&(ye+=360),v.length>3&&v[3]!==void 0?[ye,se,ne,v[3]]:[ye,se,ne]},ct=st,ft=h.unpack,It=h.last,Yt=it,zt=ct,V=Math.round,B=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=ft(v,"rgba"),q=It(v)||"rgb";return q.substr(0,3)=="hsl"?Yt(zt(Q),q):(Q[0]=V(Q[0]),Q[1]=V(Q[1]),Q[2]=V(Q[2]),(q==="rgba"||Q.length>3&&Q[3]<1)&&(Q[3]=Q.length>3?Q[3]:1,q="rgba"),q+"("+Q.slice(0,q==="rgb"?3:4).join(",")+")")},pe=B,De=h.unpack,rt=Math.round,Mt=function(){for(var v,x=[],Q=arguments.length;Q--;)x[Q]=arguments[Q];x=De(x,"hsl");var q=x[0],H=x[1],J=x[2],G,ne,se;if(H===0)G=ne=se=J*255;else{var ye=[0,0,0],ke=[0,0,0],Fe=J<.5?J*(1+H):J+H-J*H,Se=2*J-Fe,We=q/360;ye[0]=We+1/3,ye[1]=We,ye[2]=We-1/3;for(var qe=0;qe<3;qe++)ye[qe]<0&&(ye[qe]+=1),ye[qe]>1&&(ye[qe]-=1),6*ye[qe]<1?ke[qe]=Se+(Fe-Se)*6*ye[qe]:2*ye[qe]<1?ke[qe]=Fe:3*ye[qe]<2?ke[qe]=Se+(Fe-Se)*(2/3-ye[qe])*6:ke[qe]=Se;v=[rt(ke[0]*255),rt(ke[1]*255),rt(ke[2]*255)],G=v[0],ne=v[1],se=v[2]}return x.length>3?[G,ne,se,x[3]]:[G,ne,se,1]},ar=Mt,Er=ar,Kt=p,Ue=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,ze=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,Wt=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,ur=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Jt=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,cr=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,fn=Math.round,dn=function(v){v=v.toLowerCase().trim();var x;if(Kt.format.named)try{return Kt.format.named(v)}catch{}if(x=v.match(Ue)){for(var Q=x.slice(1,4),q=0;q<3;q++)Q[q]=+Q[q];return Q[3]=1,Q}if(x=v.match(ze)){for(var H=x.slice(1,5),J=0;J<4;J++)H[J]=+H[J];return H}if(x=v.match(Wt)){for(var G=x.slice(1,4),ne=0;ne<3;ne++)G[ne]=fn(G[ne]*2.55);return G[3]=1,G}if(x=v.match(ur)){for(var se=x.slice(1,5),ye=0;ye<3;ye++)se[ye]=fn(se[ye]*2.55);return se[3]=+se[3],se}if(x=v.match(Jt)){var ke=x.slice(1,4);ke[1]*=.01,ke[2]*=.01;var Fe=Er(ke);return Fe[3]=1,Fe}if(x=v.match(cr)){var Se=x.slice(1,4);Se[1]*=.01,Se[2]*=.01;var We=Er(Se);return We[3]=+x[4],We}};dn.test=function(v){return Ue.test(v)||ze.test(v)||Wt.test(v)||ur.test(v)||Jt.test(v)||cr.test(v)};var In=dn,$a=w,zn=C,Vt=p,je=h.type,fr=pe,Rr=In;zn.prototype.css=function(v){return fr(this._rgb,v)},$a.css=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(zn,[null].concat(v,["css"])))},Vt.format.css=Rr,Vt.autodetect.push({p:5,test:function(v){for(var x=[],Q=arguments.length-1;Q-- >0;)x[Q]=arguments[Q+1];if(!x.length&&je(v)==="string"&&Rr.test(v))return"css"}});var fa=C,Ii=w,xo=p,So=h.unpack;xo.format.gl=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=So(v,"rgba");return Q[0]*=255,Q[1]*=255,Q[2]*=255,Q},Ii.gl=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(fa,[null].concat(v,["gl"])))},fa.prototype.gl=function(){var v=this._rgb;return[v[0]/255,v[1]/255,v[2]/255,v[3]]};var Ao=h.unpack,tl=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=Ao(v,"rgb"),q=Q[0],H=Q[1],J=Q[2],G=Math.min(q,H,J),ne=Math.max(q,H,J),se=ne-G,ye=se*100/255,ke=G/(255-se)*100,Fe;return se===0?Fe=Number.NaN:(q===ne&&(Fe=(H-J)/se),H===ne&&(Fe=2+(J-q)/se),J===ne&&(Fe=4+(q-H)/se),Fe*=60,Fe<0&&(Fe+=360)),[Fe,ye,ke]},rl=tl,Je=h.unpack,En=Math.floor,Ta=function(){for(var v,x,Q,q,H,J,G=[],ne=arguments.length;ne--;)G[ne]=arguments[ne];G=Je(G,"hcg");var se=G[0],ye=G[1],ke=G[2],Fe,Se,We;ke=ke*255;var qe=ye*255;if(ye===0)Fe=Se=We=ke;else{se===360&&(se=0),se>360&&(se-=360),se<0&&(se+=360),se/=60;var gt=En(se),Ot=se-gt,kt=ke*(1-ye),Rt=kt+qe*(1-Ot),Qr=kt+qe*Ot,Sr=kt+qe;switch(gt){case 0:v=[Sr,Qr,kt],Fe=v[0],Se=v[1],We=v[2];break;case 1:x=[Rt,Sr,kt],Fe=x[0],Se=x[1],We=x[2];break;case 2:Q=[kt,Sr,Qr],Fe=Q[0],Se=Q[1],We=Q[2];break;case 3:q=[kt,Rt,Sr],Fe=q[0],Se=q[1],We=q[2];break;case 4:H=[Qr,kt,Sr],Fe=H[0],Se=H[1],We=H[2];break;case 5:J=[Sr,kt,Rt],Fe=J[0],Se=J[1],We=J[2];break}}return[Fe,Se,We,G.length>3?G[3]:1]},Ie=Ta,$t=h.unpack,jt=h.type,XE=w,m2=C,g2=p,GE=rl;m2.prototype.hcg=function(){return GE(this._rgb)},XE.hcg=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(m2,[null].concat(v,["hcg"])))},g2.format.hcg=Ie,g2.autodetect.push({p:1,test:function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];if(v=$t(v,"hcg"),jt(v)==="array"&&v.length===3)return"hcg"}});var HE=h.unpack,KE=h.last,Lu=Math.round,JE=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=HE(v,"rgba"),q=Q[0],H=Q[1],J=Q[2],G=Q[3],ne=KE(v)||"auto";G===void 0&&(G=1),ne==="auto"&&(ne=G<1?"rgba":"rgb"),q=Lu(q),H=Lu(H),J=Lu(J);var se=q<<16|H<<8|J,ye="000000"+se.toString(16);ye=ye.substr(ye.length-6);var ke="0"+Lu(G*255).toString(16);switch(ke=ke.substr(ke.length-2),ne.toLowerCase()){case"rgba":return"#"+ye+ke;case"argb":return"#"+ke+ye;default:return"#"+ye}},y2=JE,e4=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,t4=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,r4=function(v){if(v.match(e4)){(v.length===4||v.length===7)&&(v=v.substr(1)),v.length===3&&(v=v.split(""),v=v[0]+v[0]+v[1]+v[1]+v[2]+v[2]);var x=parseInt(v,16),Q=x>>16,q=x>>8&255,H=x&255;return[Q,q,H,1]}if(v.match(t4)){(v.length===5||v.length===9)&&(v=v.substr(1)),v.length===4&&(v=v.split(""),v=v[0]+v[0]+v[1]+v[1]+v[2]+v[2]+v[3]+v[3]);var J=parseInt(v,16),G=J>>24&255,ne=J>>16&255,se=J>>8&255,ye=Math.round((J&255)/255*100)/100;return[G,ne,se,ye]}throw new Error("unknown hex color: "+v)},b2=r4,n4=w,v2=C,a4=h.type,O2=p,i4=y2;v2.prototype.hex=function(v){return i4(this._rgb,v)},n4.hex=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(v2,[null].concat(v,["hex"])))},O2.format.hex=b2,O2.autodetect.push({p:4,test:function(v){for(var x=[],Q=arguments.length-1;Q-- >0;)x[Q]=arguments[Q+1];if(!x.length&&a4(v)==="string"&&[3,4,5,6,7,8,9].indexOf(v.length)>=0)return"hex"}});var o4=h.unpack,_2=h.TWOPI,s4=Math.min,l4=Math.sqrt,u4=Math.acos,c4=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=o4(v,"rgb"),q=Q[0],H=Q[1],J=Q[2];q/=255,H/=255,J/=255;var G,ne=s4(q,H,J),se=(q+H+J)/3,ye=se>0?1-ne/se:0;return ye===0?G=NaN:(G=(q-H+(q-J))/2,G/=l4((q-H)*(q-H)+(q-J)*(H-J)),G=u4(G),J>H&&(G=_2-G),G/=_2),[G*360,ye,se]},f4=c4,d4=h.unpack,_h=h.limit,$o=h.TWOPI,wh=h.PITHIRD,To=Math.cos,h4=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];v=d4(v,"hsi");var Q=v[0],q=v[1],H=v[2],J,G,ne;return isNaN(Q)&&(Q=0),isNaN(q)&&(q=0),Q>360&&(Q-=360),Q<0&&(Q+=360),Q/=360,Q<1/3?(ne=(1-q)/3,J=(1+q*To($o*Q)/To(wh-$o*Q))/3,G=1-(ne+J)):Q<2/3?(Q-=1/3,J=(1-q)/3,G=(1+q*To($o*Q)/To(wh-$o*Q))/3,ne=1-(J+G)):(Q-=2/3,G=(1-q)/3,ne=(1+q*To($o*Q)/To(wh-$o*Q))/3,J=1-(G+ne)),J=_h(H*J*3),G=_h(H*G*3),ne=_h(H*ne*3),[J*255,G*255,ne*255,v.length>3?v[3]:1]},p4=h4,m4=h.unpack,g4=h.type,y4=w,w2=C,D2=p,b4=f4;w2.prototype.hsi=function(){return b4(this._rgb)},y4.hsi=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(w2,[null].concat(v,["hsi"])))},D2.format.hsi=p4,D2.autodetect.push({p:2,test:function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];if(v=m4(v,"hsi"),g4(v)==="array"&&v.length===3)return"hsi"}});var v4=h.unpack,O4=h.type,_4=w,C2=C,k2=p,w4=ct;C2.prototype.hsl=function(){return w4(this._rgb)},_4.hsl=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(C2,[null].concat(v,["hsl"])))},k2.format.hsl=ar,k2.autodetect.push({p:2,test:function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];if(v=v4(v,"hsl"),O4(v)==="array"&&v.length===3)return"hsl"}});var D4=h.unpack,C4=Math.min,k4=Math.max,E4=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];v=D4(v,"rgb");var Q=v[0],q=v[1],H=v[2],J=C4(Q,q,H),G=k4(Q,q,H),ne=G-J,se,ye,ke;return ke=G/255,G===0?(se=Number.NaN,ye=0):(ye=ne/G,Q===G&&(se=(q-H)/ne),q===G&&(se=2+(H-Q)/ne),H===G&&(se=4+(Q-q)/ne),se*=60,se<0&&(se+=360)),[se,ye,ke]},x4=E4,S4=h.unpack,A4=Math.floor,$4=function(){for(var v,x,Q,q,H,J,G=[],ne=arguments.length;ne--;)G[ne]=arguments[ne];G=S4(G,"hsv");var se=G[0],ye=G[1],ke=G[2],Fe,Se,We;if(ke*=255,ye===0)Fe=Se=We=ke;else{se===360&&(se=0),se>360&&(se-=360),se<0&&(se+=360),se/=60;var qe=A4(se),gt=se-qe,Ot=ke*(1-ye),kt=ke*(1-ye*gt),Rt=ke*(1-ye*(1-gt));switch(qe){case 0:v=[ke,Rt,Ot],Fe=v[0],Se=v[1],We=v[2];break;case 1:x=[kt,ke,Ot],Fe=x[0],Se=x[1],We=x[2];break;case 2:Q=[Ot,ke,Rt],Fe=Q[0],Se=Q[1],We=Q[2];break;case 3:q=[Ot,kt,ke],Fe=q[0],Se=q[1],We=q[2];break;case 4:H=[Rt,Ot,ke],Fe=H[0],Se=H[1],We=H[2];break;case 5:J=[ke,Ot,kt],Fe=J[0],Se=J[1],We=J[2];break}}return[Fe,Se,We,G.length>3?G[3]:1]},T4=$4,N4=h.unpack,P4=h.type,M4=w,E2=C,x2=p,R4=x4;E2.prototype.hsv=function(){return R4(this._rgb)},M4.hsv=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(E2,[null].concat(v,["hsv"])))},x2.format.hsv=T4,x2.autodetect.push({p:2,test:function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];if(v=N4(v,"hsv"),P4(v)==="array"&&v.length===3)return"hsv"}});var Bu={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},No=Bu,Q4=h.unpack,S2=Math.pow,I4=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=Q4(v,"rgb"),q=Q[0],H=Q[1],J=Q[2],G=F4(q,H,J),ne=G[0],se=G[1],ye=G[2],ke=116*se-16;return[ke<0?0:ke,500*(ne-se),200*(se-ye)]},Dh=function(v){return(v/=255)<=.04045?v/12.92:S2((v+.055)/1.055,2.4)},Ch=function(v){return v>No.t3?S2(v,1/3):v/No.t2+No.t0},F4=function(v,x,Q){v=Dh(v),x=Dh(x),Q=Dh(Q);var q=Ch((.4124564*v+.3575761*x+.1804375*Q)/No.Xn),H=Ch((.2126729*v+.7151522*x+.072175*Q)/No.Yn),J=Ch((.0193339*v+.119192*x+.9503041*Q)/No.Zn);return[q,H,J]},A2=I4,Po=Bu,Z4=h.unpack,q4=Math.pow,L4=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];v=Z4(v,"lab");var Q=v[0],q=v[1],H=v[2],J,G,ne,se,ye,ke;return G=(Q+16)/116,J=isNaN(q)?G:G+q/500,ne=isNaN(H)?G:G-H/200,G=Po.Yn*Eh(G),J=Po.Xn*Eh(J),ne=Po.Zn*Eh(ne),se=kh(3.2404542*J-1.5371385*G-.4985314*ne),ye=kh(-.969266*J+1.8760108*G+.041556*ne),ke=kh(.0556434*J-.2040259*G+1.0572252*ne),[se,ye,ke,v.length>3?v[3]:1]},kh=function(v){return 255*(v<=.00304?12.92*v:1.055*q4(v,1/2.4)-.055)},Eh=function(v){return v>Po.t1?v*v*v:Po.t2*(v-Po.t0)},$2=L4,B4=h.unpack,U4=h.type,W4=w,T2=C,N2=p,Y4=A2;T2.prototype.lab=function(){return Y4(this._rgb)},W4.lab=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(T2,[null].concat(v,["lab"])))},N2.format.lab=$2,N2.autodetect.push({p:2,test:function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];if(v=B4(v,"lab"),U4(v)==="array"&&v.length===3)return"lab"}});var z4=h.unpack,V4=h.RAD2DEG,j4=Math.sqrt,X4=Math.atan2,G4=Math.round,H4=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=z4(v,"lab"),q=Q[0],H=Q[1],J=Q[2],G=j4(H*H+J*J),ne=(X4(J,H)*V4+360)%360;return G4(G*1e4)===0&&(ne=Number.NaN),[q,G,ne]},P2=H4,K4=h.unpack,J4=A2,ex=P2,tx=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=K4(v,"rgb"),q=Q[0],H=Q[1],J=Q[2],G=J4(q,H,J),ne=G[0],se=G[1],ye=G[2];return ex(ne,se,ye)},rx=tx,nx=h.unpack,ax=h.DEG2RAD,ix=Math.sin,ox=Math.cos,sx=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=nx(v,"lch"),q=Q[0],H=Q[1],J=Q[2];return isNaN(J)&&(J=0),J=J*ax,[q,ox(J)*H,ix(J)*H]},M2=sx,lx=h.unpack,ux=M2,cx=$2,fx=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];v=lx(v,"lch");var Q=v[0],q=v[1],H=v[2],J=ux(Q,q,H),G=J[0],ne=J[1],se=J[2],ye=cx(G,ne,se),ke=ye[0],Fe=ye[1],Se=ye[2];return[ke,Fe,Se,v.length>3?v[3]:1]},R2=fx,dx=h.unpack,hx=R2,px=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=dx(v,"hcl").reverse();return hx.apply(void 0,Q)},mx=px,gx=h.unpack,yx=h.type,Q2=w,Uu=C,xh=p,I2=rx;Uu.prototype.lch=function(){return I2(this._rgb)},Uu.prototype.hcl=function(){return I2(this._rgb).reverse()},Q2.lch=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(Uu,[null].concat(v,["lch"])))},Q2.hcl=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(Uu,[null].concat(v,["hcl"])))},xh.format.lch=R2,xh.format.hcl=mx,["lch","hcl"].forEach(function(v){return xh.autodetect.push({p:2,test:function(){for(var x=[],Q=arguments.length;Q--;)x[Q]=arguments[Q];if(x=gx(x,v),yx(x)==="array"&&x.length===3)return v}})});var bx={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},F2=bx,vx=C,Z2=p,Ox=h.type,nl=F2,_x=b2,wx=y2;vx.prototype.name=function(){for(var v=wx(this._rgb,"rgb"),x=0,Q=Object.keys(nl);x0;)x[Q]=arguments[Q+1];if(!x.length&&Ox(v)==="string"&&nl[v.toLowerCase()])return"named"}});var Dx=h.unpack,Cx=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=Dx(v,"rgb"),q=Q[0],H=Q[1],J=Q[2];return(q<<16)+(H<<8)+J},kx=Cx,Ex=h.type,xx=function(v){if(Ex(v)=="number"&&v>=0&&v<=16777215){var x=v>>16,Q=v>>8&255,q=v&255;return[x,Q,q,1]}throw new Error("unknown num color: "+v)},Sx=xx,Ax=w,q2=C,L2=p,$x=h.type,Tx=kx;q2.prototype.num=function(){return Tx(this._rgb)},Ax.num=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(q2,[null].concat(v,["num"])))},L2.format.num=Sx,L2.autodetect.push({p:5,test:function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];if(v.length===1&&$x(v[0])==="number"&&v[0]>=0&&v[0]<=16777215)return"num"}});var Nx=w,Sh=C,B2=p,U2=h.unpack,W2=h.type,Y2=Math.round;Sh.prototype.rgb=function(v){return v===void 0&&(v=!0),v===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Y2)},Sh.prototype.rgba=function(v){return v===void 0&&(v=!0),this._rgb.slice(0,4).map(function(x,Q){return Q<3?v===!1?x:Y2(x):x})},Nx.rgb=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(Sh,[null].concat(v,["rgb"])))},B2.format.rgb=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=U2(v,"rgba");return Q[3]===void 0&&(Q[3]=1),Q},B2.autodetect.push({p:3,test:function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];if(v=U2(v,"rgba"),W2(v)==="array"&&(v.length===3||v.length===4&&W2(v[3])=="number"&&v[3]>=0&&v[3]<=1))return"rgb"}});var Wu=Math.log,Px=function(v){var x=v/100,Q,q,H;return x<66?(Q=255,q=x<6?0:-155.25485562709179-.44596950469579133*(q=x-2)+104.49216199393888*Wu(q),H=x<20?0:-254.76935184120902+.8274096064007395*(H=x-10)+115.67994401066147*Wu(H)):(Q=351.97690566805693+.114206453784165*(Q=x-55)-40.25366309332127*Wu(Q),q=325.4494125711974+.07943456536662342*(q=x-50)-28.0852963507957*Wu(q),H=255),[Q,q,H,1]},z2=Px,Mx=z2,Rx=h.unpack,Qx=Math.round,Ix=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];for(var Q=Rx(v,"rgb"),q=Q[0],H=Q[2],J=1e3,G=4e4,ne=.4,se;G-J>ne;){se=(G+J)*.5;var ye=Mx(se);ye[2]/ye[0]>=H/q?G=se:J=se}return Qx(se)},Fx=Ix,Ah=w,Yu=C,$h=p,Zx=Fx;Yu.prototype.temp=Yu.prototype.kelvin=Yu.prototype.temperature=function(){return Zx(this._rgb)},Ah.temp=Ah.kelvin=Ah.temperature=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(Yu,[null].concat(v,["temp"])))},$h.format.temp=$h.format.kelvin=$h.format.temperature=z2;var qx=h.unpack,Th=Math.cbrt,Lx=Math.pow,Bx=Math.sign,Ux=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=qx(v,"rgb"),q=Q[0],H=Q[1],J=Q[2],G=[Nh(q/255),Nh(H/255),Nh(J/255)],ne=G[0],se=G[1],ye=G[2],ke=Th(.4122214708*ne+.5363325363*se+.0514459929*ye),Fe=Th(.2119034982*ne+.6806995451*se+.1073969566*ye),Se=Th(.0883024619*ne+.2817188376*se+.6299787005*ye);return[.2104542553*ke+.793617785*Fe-.0040720468*Se,1.9779984951*ke-2.428592205*Fe+.4505937099*Se,.0259040371*ke+.7827717662*Fe-.808675766*Se]},V2=Ux;function Nh(v){var x=Math.abs(v);return x<.04045?v/12.92:(Bx(v)||1)*Lx((x+.055)/1.055,2.4)}var Wx=h.unpack,zu=Math.pow,Yx=Math.sign,zx=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];v=Wx(v,"lab");var Q=v[0],q=v[1],H=v[2],J=zu(Q+.3963377774*q+.2158037573*H,3),G=zu(Q-.1055613458*q-.0638541728*H,3),ne=zu(Q-.0894841775*q-1.291485548*H,3);return[255*Ph(4.0767416621*J-3.3077115913*G+.2309699292*ne),255*Ph(-1.2684380046*J+2.6097574011*G-.3413193965*ne),255*Ph(-.0041960863*J-.7034186147*G+1.707614701*ne),v.length>3?v[3]:1]},j2=zx;function Ph(v){var x=Math.abs(v);return x>.0031308?(Yx(v)||1)*(1.055*zu(x,1/2.4)-.055):v*12.92}var Vx=h.unpack,jx=h.type,Xx=w,X2=C,G2=p,Gx=V2;X2.prototype.oklab=function(){return Gx(this._rgb)},Xx.oklab=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(X2,[null].concat(v,["oklab"])))},G2.format.oklab=j2,G2.autodetect.push({p:3,test:function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];if(v=Vx(v,"oklab"),jx(v)==="array"&&v.length===3)return"oklab"}});var Hx=h.unpack,Kx=V2,Jx=P2,e8=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];var Q=Hx(v,"rgb"),q=Q[0],H=Q[1],J=Q[2],G=Kx(q,H,J),ne=G[0],se=G[1],ye=G[2];return Jx(ne,se,ye)},t8=e8,r8=h.unpack,n8=M2,a8=j2,i8=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];v=r8(v,"lch");var Q=v[0],q=v[1],H=v[2],J=n8(Q,q,H),G=J[0],ne=J[1],se=J[2],ye=a8(G,ne,se),ke=ye[0],Fe=ye[1],Se=ye[2];return[ke,Fe,Se,v.length>3?v[3]:1]},o8=i8,s8=h.unpack,l8=h.type,u8=w,H2=C,K2=p,c8=t8;H2.prototype.oklch=function(){return c8(this._rgb)},u8.oklch=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];return new(Function.prototype.bind.apply(H2,[null].concat(v,["oklch"])))},K2.format.oklch=o8,K2.autodetect.push({p:3,test:function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];if(v=s8(v,"oklch"),l8(v)==="array"&&v.length===3)return"oklch"}});var J2=C,f8=h.type;J2.prototype.alpha=function(v,x){return x===void 0&&(x=!1),v!==void 0&&f8(v)==="number"?x?(this._rgb[3]=v,this):new J2([this._rgb[0],this._rgb[1],this._rgb[2],v],"rgb"):this._rgb[3]};var d8=C;d8.prototype.clipped=function(){return this._rgb._clipped||!1};var Fi=C,h8=Bu;Fi.prototype.darken=function(v){v===void 0&&(v=1);var x=this,Q=x.lab();return Q[0]-=h8.Kn*v,new Fi(Q,"lab").alpha(x.alpha(),!0)},Fi.prototype.brighten=function(v){return v===void 0&&(v=1),this.darken(-v)},Fi.prototype.darker=Fi.prototype.darken,Fi.prototype.brighter=Fi.prototype.brighten;var p8=C;p8.prototype.get=function(v){var x=v.split("."),Q=x[0],q=x[1],H=this[Q]();if(q){var J=Q.indexOf(q)-(Q.substr(0,2)==="ok"?2:0);if(J>-1)return H[J];throw new Error("unknown channel "+q+" in mode "+Q)}else return H};var Mo=C,m8=h.type,g8=Math.pow,y8=1e-7,b8=20;Mo.prototype.luminance=function(v){if(v!==void 0&&m8(v)==="number"){if(v===0)return new Mo([0,0,0,this._rgb[3]],"rgb");if(v===1)return new Mo([255,255,255,this._rgb[3]],"rgb");var x=this.luminance(),Q="rgb",q=b8,H=function(G,ne){var se=G.interpolate(ne,.5,Q),ye=se.luminance();return Math.abs(v-ye)v?H(G,se):H(se,ne)},J=(x>v?H(new Mo([0,0,0]),this):H(this,new Mo([255,255,255]))).rgb();return new Mo(J.concat([this._rgb[3]]))}return v8.apply(void 0,this._rgb.slice(0,3))};var v8=function(v,x,Q){return v=Mh(v),x=Mh(x),Q=Mh(Q),.2126*v+.7152*x+.0722*Q},Mh=function(v){return v/=255,v<=.03928?v/12.92:g8((v+.055)/1.055,2.4)},xn={},ey=C,ty=h.type,Vu=xn,ry=function(v,x,Q){Q===void 0&&(Q=.5);for(var q=[],H=arguments.length-3;H-- >0;)q[H]=arguments[H+3];var J=q[0]||"lrgb";if(!Vu[J]&&!q.length&&(J=Object.keys(Vu)[0]),!Vu[J])throw new Error("interpolation mode "+J+" is not defined");return ty(v)!=="object"&&(v=new ey(v)),ty(x)!=="object"&&(x=new ey(x)),Vu[J](v,x,Q).alpha(v.alpha()+Q*(x.alpha()-v.alpha()))},ny=C,O8=ry;ny.prototype.mix=ny.prototype.interpolate=function(v,x){x===void 0&&(x=.5);for(var Q=[],q=arguments.length-2;q-- >0;)Q[q]=arguments[q+2];return O8.apply(void 0,[this,v,x].concat(Q))};var ay=C;ay.prototype.premultiply=function(v){v===void 0&&(v=!1);var x=this._rgb,Q=x[3];return v?(this._rgb=[x[0]*Q,x[1]*Q,x[2]*Q,Q],this):new ay([x[0]*Q,x[1]*Q,x[2]*Q,Q],"rgb")};var Rh=C,_8=Bu;Rh.prototype.saturate=function(v){v===void 0&&(v=1);var x=this,Q=x.lch();return Q[1]+=_8.Kn*v,Q[1]<0&&(Q[1]=0),new Rh(Q,"lch").alpha(x.alpha(),!0)},Rh.prototype.desaturate=function(v){return v===void 0&&(v=1),this.saturate(-v)};var iy=C,oy=h.type;iy.prototype.set=function(v,x,Q){Q===void 0&&(Q=!1);var q=v.split("."),H=q[0],J=q[1],G=this[H]();if(J){var ne=H.indexOf(J)-(H.substr(0,2)==="ok"?2:0);if(ne>-1){if(oy(x)=="string")switch(x.charAt(0)){case"+":G[ne]+=+x;break;case"-":G[ne]+=+x;break;case"*":G[ne]*=+x.substr(1);break;case"/":G[ne]/=+x.substr(1);break;default:G[ne]=+x}else if(oy(x)==="number")G[ne]=x;else throw new Error("unsupported value for Color.set");var se=new iy(G,H);return Q?(this._rgb=se._rgb,this):se}throw new Error("unknown channel "+J+" in mode "+H)}else return G};var w8=C,D8=function(v,x,Q){var q=v._rgb,H=x._rgb;return new w8(q[0]+Q*(H[0]-q[0]),q[1]+Q*(H[1]-q[1]),q[2]+Q*(H[2]-q[2]),"rgb")};xn.rgb=D8;var C8=C,Qh=Math.sqrt,Ro=Math.pow,k8=function(v,x,Q){var q=v._rgb,H=q[0],J=q[1],G=q[2],ne=x._rgb,se=ne[0],ye=ne[1],ke=ne[2];return new C8(Qh(Ro(H,2)*(1-Q)+Ro(se,2)*Q),Qh(Ro(J,2)*(1-Q)+Ro(ye,2)*Q),Qh(Ro(G,2)*(1-Q)+Ro(ke,2)*Q),"rgb")};xn.lrgb=k8;var E8=C,x8=function(v,x,Q){var q=v.lab(),H=x.lab();return new E8(q[0]+Q*(H[0]-q[0]),q[1]+Q*(H[1]-q[1]),q[2]+Q*(H[2]-q[2]),"lab")};xn.lab=x8;var sy=C,Qo=function(v,x,Q,q){var H,J,G,ne;q==="hsl"?(G=v.hsl(),ne=x.hsl()):q==="hsv"?(G=v.hsv(),ne=x.hsv()):q==="hcg"?(G=v.hcg(),ne=x.hcg()):q==="hsi"?(G=v.hsi(),ne=x.hsi()):q==="lch"||q==="hcl"?(q="hcl",G=v.hcl(),ne=x.hcl()):q==="oklch"&&(G=v.oklch().reverse(),ne=x.oklch().reverse());var se,ye,ke,Fe,Se,We;(q.substr(0,1)==="h"||q==="oklch")&&(H=G,se=H[0],ke=H[1],Se=H[2],J=ne,ye=J[0],Fe=J[1],We=J[2]);var qe,gt,Ot,kt;return!isNaN(se)&&!isNaN(ye)?(ye>se&&ye-se>180?kt=ye-(se+360):ye180?kt=ye+360-se:kt=ye-se,gt=se+Q*kt):isNaN(se)?isNaN(ye)?gt=Number.NaN:(gt=ye,(Se==1||Se==0)&&q!="hsv"&&(qe=Fe)):(gt=se,(We==1||We==0)&&q!="hsv"&&(qe=ke)),qe===void 0&&(qe=ke+Q*(Fe-ke)),Ot=Se+Q*(We-Se),q==="oklch"?new sy([Ot,qe,gt],q):new sy([gt,qe,Ot],q)},S8=Qo,ly=function(v,x,Q){return S8(v,x,Q,"lch")};xn.lch=ly,xn.hcl=ly;var A8=C,$8=function(v,x,Q){var q=v.num(),H=x.num();return new A8(q+Q*(H-q),"num")};xn.num=$8;var T8=Qo,N8=function(v,x,Q){return T8(v,x,Q,"hcg")};xn.hcg=N8;var P8=Qo,M8=function(v,x,Q){return P8(v,x,Q,"hsi")};xn.hsi=M8;var R8=Qo,Q8=function(v,x,Q){return R8(v,x,Q,"hsl")};xn.hsl=Q8;var I8=Qo,F8=function(v,x,Q){return I8(v,x,Q,"hsv")};xn.hsv=F8;var Z8=C,q8=function(v,x,Q){var q=v.oklab(),H=x.oklab();return new Z8(q[0]+Q*(H[0]-q[0]),q[1]+Q*(H[1]-q[1]),q[2]+Q*(H[2]-q[2]),"oklab")};xn.oklab=q8;var L8=Qo,B8=function(v,x,Q){return L8(v,x,Q,"oklch")};xn.oklch=B8;var Ih=C,U8=h.clip_rgb,Fh=Math.pow,Zh=Math.sqrt,qh=Math.PI,uy=Math.cos,cy=Math.sin,W8=Math.atan2,Y8=function(v,x,Q){x===void 0&&(x="lrgb"),Q===void 0&&(Q=null);var q=v.length;Q||(Q=Array.from(new Array(q)).map(function(){return 1}));var H=q/Q.reduce(function(gt,Ot){return gt+Ot});if(Q.forEach(function(gt,Ot){Q[Ot]*=H}),v=v.map(function(gt){return new Ih(gt)}),x==="lrgb")return z8(v,Q);for(var J=v.shift(),G=J.get(x),ne=[],se=0,ye=0,ke=0;ke=360;)qe-=360;G[We]=qe}else G[We]=G[We]/ne[We];return Se/=q,new Ih(G,x).alpha(Se>.99999?1:Se,!0)},z8=function(v,x){for(var Q=v.length,q=[0,0,0,0],H=0;H.9999999&&(q[3]=1),new Ih(U8(q))},Vn=w,Io=h.type,V8=Math.pow,Lh=function(v){var x="rgb",Q=Vn("#ccc"),q=0,H=[0,1],J=[],G=[0,0],ne=!1,se=[],ye=!1,ke=0,Fe=1,Se=!1,We={},qe=!0,gt=1,Ot=function(Ae){if(Ae=Ae||["#fff","#000"],Ae&&Io(Ae)==="string"&&Vn.brewer&&Vn.brewer[Ae.toLowerCase()]&&(Ae=Vn.brewer[Ae.toLowerCase()]),Io(Ae)==="array"){Ae.length===1&&(Ae=[Ae[0],Ae[0]]),Ae=Ae.slice(0);for(var nt=0;nt=ne[bt];)bt++;return bt-1}return 0},Rt=function(Ae){return Ae},Qr=function(Ae){return Ae},Sr=function(Ae,nt){var bt,yt;if(nt==null&&(nt=!1),isNaN(Ae)||Ae===null)return Q;if(nt)yt=Ae;else if(ne&&ne.length>2){var Ir=kt(Ae);yt=Ir/(ne.length-2)}else Fe!==ke?yt=(Ae-ke)/(Fe-ke):yt=1;yt=Qr(yt),nt||(yt=Rt(yt)),gt!==1&&(yt=V8(yt,gt)),yt=G[0]+yt*(1-G[0]-G[1]),yt=Math.min(1,Math.max(0,yt));var Xt=Math.floor(yt*1e4);if(qe&&We[Xt])bt=We[Xt];else{if(Io(se)==="array")for(var Et=0;Et=Ft&&Et===J.length-1){bt=se[Et];break}if(yt>Ft&&yt2){var Et=Ae.map(function(Zt,Bt){return Bt/(Ae.length-1)}),Ft=Ae.map(function(Zt){return(Zt-ke)/(Fe-ke)});Ft.every(function(Zt,Bt){return Et[Bt]===Zt})||(Qr=function(Zt){if(Zt<=0||Zt>=1)return Zt;for(var Bt=0;Zt>=Ft[Bt+1];)Bt++;var Xn=(Zt-Ft[Bt])/(Ft[Bt+1]-Ft[Bt]),ri=Et[Bt]+Xn*(Et[Bt+1]-Et[Bt]);return ri})}}return H=[ke,Fe],wt},wt.mode=function(Ae){return arguments.length?(x=Ae,hn(),wt):x},wt.range=function(Ae,nt){return Ot(Ae),wt},wt.out=function(Ae){return ye=Ae,wt},wt.spread=function(Ae){return arguments.length?(q=Ae,wt):q},wt.correctLightness=function(Ae){return Ae==null&&(Ae=!0),Se=Ae,hn(),Se?Rt=function(nt){for(var bt=Sr(0,!0).lab()[0],yt=Sr(1,!0).lab()[0],Ir=bt>yt,Xt=Sr(nt,!0).lab()[0],Et=bt+(yt-bt)*nt,Ft=Xt-Et,Zt=0,Bt=1,Xn=20;Math.abs(Ft)>.01&&Xn-- >0;)(function(){return Ir&&(Ft*=-1),Ft<0?(Zt=nt,nt+=(Bt-nt)*.5):(Bt=nt,nt+=(Zt-nt)*.5),Xt=Sr(nt,!0).lab()[0],Ft=Xt-Et})();return nt}:Rt=function(nt){return nt},wt},wt.padding=function(Ae){return Ae!=null?(Io(Ae)==="number"&&(Ae=[Ae,Ae]),G=Ae,wt):G},wt.colors=function(Ae,nt){arguments.length<2&&(nt="hex");var bt=[];if(arguments.length===0)bt=se.slice(0);else if(Ae===1)bt=[wt(.5)];else if(Ae>1){var yt=H[0],Ir=H[1]-yt;bt=j8(0,Ae,!1).map(function(Bt){return wt(yt+Bt/(Ae-1)*Ir)})}else{v=[];var Xt=[];if(ne&&ne.length>2)for(var Et=1,Ft=ne.length,Zt=1<=Ft;Zt?EtFt;Zt?Et++:Et--)Xt.push((ne[Et-1]+ne[Et])*.5);else Xt=H;bt=Xt.map(function(Bt){return wt(Bt)})}return Vn[nt]&&(bt=bt.map(function(Bt){return Bt[nt]()})),bt},wt.cache=function(Ae){return Ae!=null?(qe=Ae,wt):qe},wt.gamma=function(Ae){return Ae!=null?(gt=Ae,wt):gt},wt.nodata=function(Ae){return Ae!=null?(Q=Vn(Ae),wt):Q},wt};function j8(v,x,Q){for(var q=[],H=vJ;H?G++:G--)q.push(G);return q}var al=C,X8=Lh,G8=function(v){for(var x=[1,1],Q=1;Q=5){var ye,ke,Fe;ye=v.map(function(Se){return Se.lab()}),Fe=v.length-1,ke=G8(Fe),H=function(Se){var We=1-Se,qe=[0,1,2].map(function(gt){return ye.reduce(function(Ot,kt,Rt){return Ot+ke[Rt]*Math.pow(We,Fe-Rt)*Math.pow(Se,Rt)*kt[gt]},0)});return new al(qe,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return H},K8=function(v){var x=H8(v);return x.scale=function(){return X8(x)},x},Bh=w,jn=function(v,x,Q){if(!jn[Q])throw new Error("unknown blend mode "+Q);return jn[Q](v,x)},ei=function(v){return function(x,Q){var q=Bh(Q).rgb(),H=Bh(x).rgb();return Bh.rgb(v(q,H))}},ti=function(v){return function(x,Q){var q=[];return q[0]=v(x[0],Q[0]),q[1]=v(x[1],Q[1]),q[2]=v(x[2],Q[2]),q}},J8=function(v){return v},eS=function(v,x){return v*x/255},tS=function(v,x){return v>x?x:v},rS=function(v,x){return v>x?v:x},nS=function(v,x){return 255*(1-(1-v/255)*(1-x/255))},aS=function(v,x){return x<128?2*v*x/255:255*(1-2*(1-v/255)*(1-x/255))},iS=function(v,x){return 255*(1-(1-x/255)/(v/255))},oS=function(v,x){return v===255?255:(v=255*(x/255)/(1-v/255),v>255?255:v)};jn.normal=ei(ti(J8)),jn.multiply=ei(ti(eS)),jn.screen=ei(ti(nS)),jn.overlay=ei(ti(aS)),jn.darken=ei(ti(tS)),jn.lighten=ei(ti(rS)),jn.dodge=ei(ti(oS)),jn.burn=ei(ti(iS));for(var sS=jn,Uh=h.type,lS=h.clip_rgb,uS=h.TWOPI,cS=Math.pow,fS=Math.sin,dS=Math.cos,fy=w,hS=function(v,x,Q,q,H){v===void 0&&(v=300),x===void 0&&(x=-1.5),Q===void 0&&(Q=1),q===void 0&&(q=1),H===void 0&&(H=[0,1]);var J=0,G;Uh(H)==="array"?G=H[1]-H[0]:(G=0,H=[H,H]);var ne=function(se){var ye=uS*((v+120)/360+x*se),ke=cS(H[0]+G*se,q),Fe=J!==0?Q[0]+se*J:Q,Se=Fe*ke*(1-ke)/2,We=dS(ye),qe=fS(ye),gt=ke+Se*(-.14861*We+1.78277*qe),Ot=ke+Se*(-.29227*We-.90649*qe),kt=ke+Se*(1.97294*We);return fy(lS([gt*255,Ot*255,kt*255,1]))};return ne.start=function(se){return se==null?v:(v=se,ne)},ne.rotations=function(se){return se==null?x:(x=se,ne)},ne.gamma=function(se){return se==null?q:(q=se,ne)},ne.hue=function(se){return se==null?Q:(Q=se,Uh(Q)==="array"?(J=Q[1]-Q[0],J===0&&(Q=Q[1])):J=0,ne)},ne.lightness=function(se){return se==null?H:(Uh(se)==="array"?(H=se,G=se[1]-se[0]):(H=[se,se],G=0),ne)},ne.scale=function(){return fy.scale(ne)},ne.hue(Q),ne},pS=C,mS="0123456789abcdef",gS=Math.floor,yS=Math.random,bS=function(){for(var v="#",x=0;x<6;x++)v+=mS.charAt(gS(yS()*16));return new pS(v,"hex")},Wh=s,dy=Math.log,vS=Math.pow,OS=Math.floor,_S=Math.abs,hy=function(v,x){x===void 0&&(x=null);var Q={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Wh(v)==="object"&&(v=Object.values(v)),v.forEach(function(q){x&&Wh(q)==="object"&&(q=q[x]),q!=null&&!isNaN(q)&&(Q.values.push(q),Q.sum+=q,qQ.max&&(Q.max=q),Q.count+=1)}),Q.domain=[Q.min,Q.max],Q.limits=function(q,H){return py(Q,q,H)},Q},py=function(v,x,Q){x===void 0&&(x="equal"),Q===void 0&&(Q=7),Wh(v)=="array"&&(v=hy(v));var q=v.min,H=v.max,J=v.values.sort(function(zh,Vh){return zh-Vh});if(Q===1)return[q,H];var G=[];if(x.substr(0,1)==="c"&&(G.push(q),G.push(H)),x.substr(0,1)==="e"){G.push(q);for(var ne=1;ne 0");var se=Math.LOG10E*dy(q),ye=Math.LOG10E*dy(H);G.push(q);for(var ke=1;ke200&&(Qr=!1)}for(var ni={},Fo=0;Foq?(Q+.05)/(q+.05):(q+.05)/(Q+.05)},yy=C,Na=Math.sqrt,pr=Math.pow,DS=Math.min,CS=Math.max,by=Math.atan2,vy=Math.abs,ju=Math.cos,Oy=Math.sin,kS=Math.exp,_y=Math.PI,ES=function(v,x,Q,q,H){Q===void 0&&(Q=1),q===void 0&&(q=1),H===void 0&&(H=1);var J=function(qi){return 360*qi/(2*_y)},G=function(qi){return 2*_y*qi/360};v=new yy(v),x=new yy(x);var ne=Array.from(v.lab()),se=ne[0],ye=ne[1],ke=ne[2],Fe=Array.from(x.lab()),Se=Fe[0],We=Fe[1],qe=Fe[2],gt=(se+Se)/2,Ot=Na(pr(ye,2)+pr(ke,2)),kt=Na(pr(We,2)+pr(qe,2)),Rt=(Ot+kt)/2,Qr=.5*(1-Na(pr(Rt,7)/(pr(Rt,7)+pr(25,7)))),Sr=ye*(1+Qr),hn=We*(1+Qr),wt=Na(pr(Sr,2)+pr(ke,2)),Ae=Na(pr(hn,2)+pr(qe,2)),nt=(wt+Ae)/2,bt=J(by(ke,Sr)),yt=J(by(qe,hn)),Ir=bt>=0?bt:bt+360,Xt=yt>=0?yt:yt+360,Et=vy(Ir-Xt)>180?(Ir+Xt+360)/2:(Ir+Xt)/2,Ft=1-.17*ju(G(Et-30))+.24*ju(G(2*Et))+.32*ju(G(3*Et+6))-.2*ju(G(4*Et-63)),Zt=Xt-Ir;Zt=vy(Zt)<=180?Zt:Xt<=Ir?Zt+360:Zt-360,Zt=2*Na(wt*Ae)*Oy(G(Zt)/2);var Bt=Se-se,Xn=Ae-wt,ri=1+.015*pr(gt-50,2)/Na(20+pr(gt-50,2)),ni=1+.045*nt,Fo=1+.015*nt*Ft,Zo=30*kS(-pr((Et-275)/25,2)),Pa=2*Na(pr(nt,7)/(pr(nt,7)+pr(25,7))),Zi=-Pa*Oy(2*G(Zo)),il=Na(pr(Bt/(Q*ri),2)+pr(Xn/(q*ni),2)+pr(Zt/(H*Fo),2)+Zi*(Xn/(q*ni))*(Zt/(H*Fo)));return CS(0,DS(100,il))},wy=C,xS=function(v,x,Q){Q===void 0&&(Q="lab"),v=new wy(v),x=new wy(x);var q=v.get(Q),H=x.get(Q),J=0;for(var G in q){var ne=(q[G]||0)-(H[G]||0);J+=ne*ne}return Math.sqrt(J)},SS=C,AS=function(){for(var v=[],x=arguments.length;x--;)v[x]=arguments[x];try{return new(Function.prototype.bind.apply(SS,[null].concat(v))),!0}catch{return!1}},Dy=w,Cy=Lh,$S={cool:function(){return Cy([Dy.hsl(180,1,.9),Dy.hsl(250,.7,.4)])},hot:function(){return Cy(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Xu={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Yh=0,ky=Object.keys(Xu);Yh{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.default=void 0;var lp=ic(Fy()),up=ic(Ky()),x9=ic(xb()),ac=ic(Sb());function ic(r){return r&&r.__esModule?r:{default:r}}function S9(r){if(typeof Symbol>"u"||r[Symbol.iterator]==null){if(Array.isArray(r)||(r=A9(r))){var e=0,t=function(){};return{s:t,n:function(){return e>=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(l){throw l},f:t}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n,a=!0,i=!1,o;return{s:function(){n=r[Symbol.iterator]()},n:function(){var l=n.next();return a=l.done,l},e:function(l){i=!0,o=l},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(i)throw o}}}}function A9(r,e){if(r){if(typeof r=="string")return Ab(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ab(r,e)}}function Ab(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t=t.hueMin&&a[0]<=t.hueMax&&a[1]>=t.chromaMin&&a[1]<=t.chromaMax&&a[2]>=t.lightMin&&a[2]<=t.lightMax&&o[0]>=e[0]-s&&o[0]<=e[0]+s&&o[1]>=e[1]-s&&o[1]<=e[1]+s&&o[2]>=e[2]-s&&o[2]<=e[2]+s},M9=function(e){for(var t=e.slice(0),n=[t.shift()];t.length>0;){for(var a=n[n.length-1],i=0,o=Number.MIN_SAFE_INTEGER,s=0;so&&(o=l,i=s)}n.push(t.splice(i,1)[0])}return n},R9=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=$9({},N9,{},e);if(t.count<=0)return[];t.samples=t.count));m+=p);for(var O=1;O<=t.quality;O+=1){for(var b=(0,up.default)(a),E=(0,up.default)(i),D=0;D{(function(r){var e=typeof sc=="object"&&sc,t=typeof ll=="object"&&ll&&ll.exports==e&&ll,n=typeof global=="object"&&global;(n.global===n||n.window===n)&&(r=n);var a=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,i=/[\x01-\x7F]/g,o=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,s=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,l={"\xAD":"shy","\u200C":"zwnj","\u200D":"zwj","\u200E":"lrm","\u2063":"ic","\u2062":"it","\u2061":"af","\u200F":"rlm","\u200B":"ZeroWidthSpace","\u2060":"NoBreak","\u0311":"DownBreve","\u20DB":"tdot","\u20DC":"DotDot"," ":"Tab","\n":"NewLine","\u2008":"puncsp","\u205F":"MediumSpace","\u2009":"thinsp","\u200A":"hairsp","\u2004":"emsp13","\u2002":"ensp","\u2005":"emsp14","\u2003":"emsp","\u2007":"numsp","\xA0":"nbsp","\u205F\u200A":"ThickSpace","\u203E":"oline",_:"lowbar","\u2010":"dash","\u2013":"ndash","\u2014":"mdash","\u2015":"horbar",",":"comma",";":"semi","\u204F":"bsemi",":":"colon","\u2A74":"Colone","!":"excl","\xA1":"iexcl","?":"quest","\xBF":"iquest",".":"period","\u2025":"nldr","\u2026":"mldr","\xB7":"middot","'":"apos","\u2018":"lsquo","\u2019":"rsquo","\u201A":"sbquo","\u2039":"lsaquo","\u203A":"rsaquo",'"':"quot","\u201C":"ldquo","\u201D":"rdquo","\u201E":"bdquo","\xAB":"laquo","\xBB":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","\u2308":"lceil","\u2309":"rceil","\u230A":"lfloor","\u230B":"rfloor","\u2985":"lopar","\u2986":"ropar","\u298B":"lbrke","\u298C":"rbrke","\u298D":"lbrkslu","\u298E":"rbrksld","\u298F":"lbrksld","\u2990":"rbrkslu","\u2991":"langd","\u2992":"rangd","\u2993":"lparlt","\u2994":"rpargt","\u2995":"gtlPar","\u2996":"ltrPar","\u27E6":"lobrk","\u27E7":"robrk","\u27E8":"lang","\u27E9":"rang","\u27EA":"Lang","\u27EB":"Rang","\u27EC":"loang","\u27ED":"roang","\u2772":"lbbrk","\u2773":"rbbrk","\u2016":"Vert","\xA7":"sect","\xB6":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","\u2030":"permil","\u2031":"pertenk","\u2020":"dagger","\u2021":"Dagger","\u2022":"bull","\u2043":"hybull","\u2032":"prime","\u2033":"Prime","\u2034":"tprime","\u2057":"qprime","\u2035":"bprime","\u2041":"caret","`":"grave","\xB4":"acute","\u02DC":"tilde","^":"Hat","\xAF":"macr","\u02D8":"breve","\u02D9":"dot","\xA8":"die","\u02DA":"ring","\u02DD":"dblac","\xB8":"cedil","\u02DB":"ogon","\u02C6":"circ","\u02C7":"caron","\xB0":"deg","\xA9":"copy","\xAE":"reg","\u2117":"copysr","\u2118":"wp","\u211E":"rx","\u2127":"mho","\u2129":"iiota","\u2190":"larr","\u219A":"nlarr","\u2192":"rarr","\u219B":"nrarr","\u2191":"uarr","\u2193":"darr","\u2194":"harr","\u21AE":"nharr","\u2195":"varr","\u2196":"nwarr","\u2197":"nearr","\u2198":"searr","\u2199":"swarr","\u219D":"rarrw","\u219D\u0338":"nrarrw","\u219E":"Larr","\u219F":"Uarr","\u21A0":"Rarr","\u21A1":"Darr","\u21A2":"larrtl","\u21A3":"rarrtl","\u21A4":"mapstoleft","\u21A5":"mapstoup","\u21A6":"map","\u21A7":"mapstodown","\u21A9":"larrhk","\u21AA":"rarrhk","\u21AB":"larrlp","\u21AC":"rarrlp","\u21AD":"harrw","\u21B0":"lsh","\u21B1":"rsh","\u21B2":"ldsh","\u21B3":"rdsh","\u21B5":"crarr","\u21B6":"cularr","\u21B7":"curarr","\u21BA":"olarr","\u21BB":"orarr","\u21BC":"lharu","\u21BD":"lhard","\u21BE":"uharr","\u21BF":"uharl","\u21C0":"rharu","\u21C1":"rhard","\u21C2":"dharr","\u21C3":"dharl","\u21C4":"rlarr","\u21C5":"udarr","\u21C6":"lrarr","\u21C7":"llarr","\u21C8":"uuarr","\u21C9":"rrarr","\u21CA":"ddarr","\u21CB":"lrhar","\u21CC":"rlhar","\u21D0":"lArr","\u21CD":"nlArr","\u21D1":"uArr","\u21D2":"rArr","\u21CF":"nrArr","\u21D3":"dArr","\u21D4":"iff","\u21CE":"nhArr","\u21D5":"vArr","\u21D6":"nwArr","\u21D7":"neArr","\u21D8":"seArr","\u21D9":"swArr","\u21DA":"lAarr","\u21DB":"rAarr","\u21DD":"zigrarr","\u21E4":"larrb","\u21E5":"rarrb","\u21F5":"duarr","\u21FD":"loarr","\u21FE":"roarr","\u21FF":"hoarr","\u2200":"forall","\u2201":"comp","\u2202":"part","\u2202\u0338":"npart","\u2203":"exist","\u2204":"nexist","\u2205":"empty","\u2207":"Del","\u2208":"in","\u2209":"notin","\u220B":"ni","\u220C":"notni","\u03F6":"bepsi","\u220F":"prod","\u2210":"coprod","\u2211":"sum","+":"plus","\xB1":"pm","\xF7":"div","\xD7":"times","<":"lt","\u226E":"nlt","<\u20D2":"nvlt","=":"equals","\u2260":"ne","=\u20E5":"bne","\u2A75":"Equal",">":"gt","\u226F":"ngt",">\u20D2":"nvgt","\xAC":"not","|":"vert","\xA6":"brvbar","\u2212":"minus","\u2213":"mp","\u2214":"plusdo","\u2044":"frasl","\u2216":"setmn","\u2217":"lowast","\u2218":"compfn","\u221A":"Sqrt","\u221D":"prop","\u221E":"infin","\u221F":"angrt","\u2220":"ang","\u2220\u20D2":"nang","\u2221":"angmsd","\u2222":"angsph","\u2223":"mid","\u2224":"nmid","\u2225":"par","\u2226":"npar","\u2227":"and","\u2228":"or","\u2229":"cap","\u2229\uFE00":"caps","\u222A":"cup","\u222A\uFE00":"cups","\u222B":"int","\u222C":"Int","\u222D":"tint","\u2A0C":"qint","\u222E":"oint","\u222F":"Conint","\u2230":"Cconint","\u2231":"cwint","\u2232":"cwconint","\u2233":"awconint","\u2234":"there4","\u2235":"becaus","\u2236":"ratio","\u2237":"Colon","\u2238":"minusd","\u223A":"mDDot","\u223B":"homtht","\u223C":"sim","\u2241":"nsim","\u223C\u20D2":"nvsim","\u223D":"bsim","\u223D\u0331":"race","\u223E":"ac","\u223E\u0333":"acE","\u223F":"acd","\u2240":"wr","\u2242":"esim","\u2242\u0338":"nesim","\u2243":"sime","\u2244":"nsime","\u2245":"cong","\u2247":"ncong","\u2246":"simne","\u2248":"ap","\u2249":"nap","\u224A":"ape","\u224B":"apid","\u224B\u0338":"napid","\u224C":"bcong","\u224D":"CupCap","\u226D":"NotCupCap","\u224D\u20D2":"nvap","\u224E":"bump","\u224E\u0338":"nbump","\u224F":"bumpe","\u224F\u0338":"nbumpe","\u2250":"doteq","\u2250\u0338":"nedot","\u2251":"eDot","\u2252":"efDot","\u2253":"erDot","\u2254":"colone","\u2255":"ecolon","\u2256":"ecir","\u2257":"cire","\u2259":"wedgeq","\u225A":"veeeq","\u225C":"trie","\u225F":"equest","\u2261":"equiv","\u2262":"nequiv","\u2261\u20E5":"bnequiv","\u2264":"le","\u2270":"nle","\u2264\u20D2":"nvle","\u2265":"ge","\u2271":"nge","\u2265\u20D2":"nvge","\u2266":"lE","\u2266\u0338":"nlE","\u2267":"gE","\u2267\u0338":"ngE","\u2268\uFE00":"lvnE","\u2268":"lnE","\u2269":"gnE","\u2269\uFE00":"gvnE","\u226A":"ll","\u226A\u0338":"nLtv","\u226A\u20D2":"nLt","\u226B":"gg","\u226B\u0338":"nGtv","\u226B\u20D2":"nGt","\u226C":"twixt","\u2272":"lsim","\u2274":"nlsim","\u2273":"gsim","\u2275":"ngsim","\u2276":"lg","\u2278":"ntlg","\u2277":"gl","\u2279":"ntgl","\u227A":"pr","\u2280":"npr","\u227B":"sc","\u2281":"nsc","\u227C":"prcue","\u22E0":"nprcue","\u227D":"sccue","\u22E1":"nsccue","\u227E":"prsim","\u227F":"scsim","\u227F\u0338":"NotSucceedsTilde","\u2282":"sub","\u2284":"nsub","\u2282\u20D2":"vnsub","\u2283":"sup","\u2285":"nsup","\u2283\u20D2":"vnsup","\u2286":"sube","\u2288":"nsube","\u2287":"supe","\u2289":"nsupe","\u228A\uFE00":"vsubne","\u228A":"subne","\u228B\uFE00":"vsupne","\u228B":"supne","\u228D":"cupdot","\u228E":"uplus","\u228F":"sqsub","\u228F\u0338":"NotSquareSubset","\u2290":"sqsup","\u2290\u0338":"NotSquareSuperset","\u2291":"sqsube","\u22E2":"nsqsube","\u2292":"sqsupe","\u22E3":"nsqsupe","\u2293":"sqcap","\u2293\uFE00":"sqcaps","\u2294":"sqcup","\u2294\uFE00":"sqcups","\u2295":"oplus","\u2296":"ominus","\u2297":"otimes","\u2298":"osol","\u2299":"odot","\u229A":"ocir","\u229B":"oast","\u229D":"odash","\u229E":"plusb","\u229F":"minusb","\u22A0":"timesb","\u22A1":"sdotb","\u22A2":"vdash","\u22AC":"nvdash","\u22A3":"dashv","\u22A4":"top","\u22A5":"bot","\u22A7":"models","\u22A8":"vDash","\u22AD":"nvDash","\u22A9":"Vdash","\u22AE":"nVdash","\u22AA":"Vvdash","\u22AB":"VDash","\u22AF":"nVDash","\u22B0":"prurel","\u22B2":"vltri","\u22EA":"nltri","\u22B3":"vrtri","\u22EB":"nrtri","\u22B4":"ltrie","\u22EC":"nltrie","\u22B4\u20D2":"nvltrie","\u22B5":"rtrie","\u22ED":"nrtrie","\u22B5\u20D2":"nvrtrie","\u22B6":"origof","\u22B7":"imof","\u22B8":"mumap","\u22B9":"hercon","\u22BA":"intcal","\u22BB":"veebar","\u22BD":"barvee","\u22BE":"angrtvb","\u22BF":"lrtri","\u22C0":"Wedge","\u22C1":"Vee","\u22C2":"xcap","\u22C3":"xcup","\u22C4":"diam","\u22C5":"sdot","\u22C6":"Star","\u22C7":"divonx","\u22C8":"bowtie","\u22C9":"ltimes","\u22CA":"rtimes","\u22CB":"lthree","\u22CC":"rthree","\u22CD":"bsime","\u22CE":"cuvee","\u22CF":"cuwed","\u22D0":"Sub","\u22D1":"Sup","\u22D2":"Cap","\u22D3":"Cup","\u22D4":"fork","\u22D5":"epar","\u22D6":"ltdot","\u22D7":"gtdot","\u22D8":"Ll","\u22D8\u0338":"nLl","\u22D9":"Gg","\u22D9\u0338":"nGg","\u22DA\uFE00":"lesg","\u22DA":"leg","\u22DB":"gel","\u22DB\uFE00":"gesl","\u22DE":"cuepr","\u22DF":"cuesc","\u22E6":"lnsim","\u22E7":"gnsim","\u22E8":"prnsim","\u22E9":"scnsim","\u22EE":"vellip","\u22EF":"ctdot","\u22F0":"utdot","\u22F1":"dtdot","\u22F2":"disin","\u22F3":"isinsv","\u22F4":"isins","\u22F5":"isindot","\u22F5\u0338":"notindot","\u22F6":"notinvc","\u22F7":"notinvb","\u22F9":"isinE","\u22F9\u0338":"notinE","\u22FA":"nisd","\u22FB":"xnis","\u22FC":"nis","\u22FD":"notnivc","\u22FE":"notnivb","\u2305":"barwed","\u2306":"Barwed","\u230C":"drcrop","\u230D":"dlcrop","\u230E":"urcrop","\u230F":"ulcrop","\u2310":"bnot","\u2312":"profline","\u2313":"profsurf","\u2315":"telrec","\u2316":"target","\u231C":"ulcorn","\u231D":"urcorn","\u231E":"dlcorn","\u231F":"drcorn","\u2322":"frown","\u2323":"smile","\u232D":"cylcty","\u232E":"profalar","\u2336":"topbot","\u233D":"ovbar","\u233F":"solbar","\u237C":"angzarr","\u23B0":"lmoust","\u23B1":"rmoust","\u23B4":"tbrk","\u23B5":"bbrk","\u23B6":"bbrktbrk","\u23DC":"OverParenthesis","\u23DD":"UnderParenthesis","\u23DE":"OverBrace","\u23DF":"UnderBrace","\u23E2":"trpezium","\u23E7":"elinters","\u2423":"blank","\u2500":"boxh","\u2502":"boxv","\u250C":"boxdr","\u2510":"boxdl","\u2514":"boxur","\u2518":"boxul","\u251C":"boxvr","\u2524":"boxvl","\u252C":"boxhd","\u2534":"boxhu","\u253C":"boxvh","\u2550":"boxH","\u2551":"boxV","\u2552":"boxdR","\u2553":"boxDr","\u2554":"boxDR","\u2555":"boxdL","\u2556":"boxDl","\u2557":"boxDL","\u2558":"boxuR","\u2559":"boxUr","\u255A":"boxUR","\u255B":"boxuL","\u255C":"boxUl","\u255D":"boxUL","\u255E":"boxvR","\u255F":"boxVr","\u2560":"boxVR","\u2561":"boxvL","\u2562":"boxVl","\u2563":"boxVL","\u2564":"boxHd","\u2565":"boxhD","\u2566":"boxHD","\u2567":"boxHu","\u2568":"boxhU","\u2569":"boxHU","\u256A":"boxvH","\u256B":"boxVh","\u256C":"boxVH","\u2580":"uhblk","\u2584":"lhblk","\u2588":"block","\u2591":"blk14","\u2592":"blk12","\u2593":"blk34","\u25A1":"squ","\u25AA":"squf","\u25AB":"EmptyVerySmallSquare","\u25AD":"rect","\u25AE":"marker","\u25B1":"fltns","\u25B3":"xutri","\u25B4":"utrif","\u25B5":"utri","\u25B8":"rtrif","\u25B9":"rtri","\u25BD":"xdtri","\u25BE":"dtrif","\u25BF":"dtri","\u25C2":"ltrif","\u25C3":"ltri","\u25CA":"loz","\u25CB":"cir","\u25EC":"tridot","\u25EF":"xcirc","\u25F8":"ultri","\u25F9":"urtri","\u25FA":"lltri","\u25FB":"EmptySmallSquare","\u25FC":"FilledSmallSquare","\u2605":"starf","\u2606":"star","\u260E":"phone","\u2640":"female","\u2642":"male","\u2660":"spades","\u2663":"clubs","\u2665":"hearts","\u2666":"diams","\u266A":"sung","\u2713":"check","\u2717":"cross","\u2720":"malt","\u2736":"sext","\u2758":"VerticalSeparator","\u27C8":"bsolhsub","\u27C9":"suphsol","\u27F5":"xlarr","\u27F6":"xrarr","\u27F7":"xharr","\u27F8":"xlArr","\u27F9":"xrArr","\u27FA":"xhArr","\u27FC":"xmap","\u27FF":"dzigrarr","\u2902":"nvlArr","\u2903":"nvrArr","\u2904":"nvHarr","\u2905":"Map","\u290C":"lbarr","\u290D":"rbarr","\u290E":"lBarr","\u290F":"rBarr","\u2910":"RBarr","\u2911":"DDotrahd","\u2912":"UpArrowBar","\u2913":"DownArrowBar","\u2916":"Rarrtl","\u2919":"latail","\u291A":"ratail","\u291B":"lAtail","\u291C":"rAtail","\u291D":"larrfs","\u291E":"rarrfs","\u291F":"larrbfs","\u2920":"rarrbfs","\u2923":"nwarhk","\u2924":"nearhk","\u2925":"searhk","\u2926":"swarhk","\u2927":"nwnear","\u2928":"toea","\u2929":"tosa","\u292A":"swnwar","\u2933":"rarrc","\u2933\u0338":"nrarrc","\u2935":"cudarrr","\u2936":"ldca","\u2937":"rdca","\u2938":"cudarrl","\u2939":"larrpl","\u293C":"curarrm","\u293D":"cularrp","\u2945":"rarrpl","\u2948":"harrcir","\u2949":"Uarrocir","\u294A":"lurdshar","\u294B":"ldrushar","\u294E":"LeftRightVector","\u294F":"RightUpDownVector","\u2950":"DownLeftRightVector","\u2951":"LeftUpDownVector","\u2952":"LeftVectorBar","\u2953":"RightVectorBar","\u2954":"RightUpVectorBar","\u2955":"RightDownVectorBar","\u2956":"DownLeftVectorBar","\u2957":"DownRightVectorBar","\u2958":"LeftUpVectorBar","\u2959":"LeftDownVectorBar","\u295A":"LeftTeeVector","\u295B":"RightTeeVector","\u295C":"RightUpTeeVector","\u295D":"RightDownTeeVector","\u295E":"DownLeftTeeVector","\u295F":"DownRightTeeVector","\u2960":"LeftUpTeeVector","\u2961":"LeftDownTeeVector","\u2962":"lHar","\u2963":"uHar","\u2964":"rHar","\u2965":"dHar","\u2966":"luruhar","\u2967":"ldrdhar","\u2968":"ruluhar","\u2969":"rdldhar","\u296A":"lharul","\u296B":"llhard","\u296C":"rharul","\u296D":"lrhard","\u296E":"udhar","\u296F":"duhar","\u2970":"RoundImplies","\u2971":"erarr","\u2972":"simrarr","\u2973":"larrsim","\u2974":"rarrsim","\u2975":"rarrap","\u2976":"ltlarr","\u2978":"gtrarr","\u2979":"subrarr","\u297B":"suplarr","\u297C":"lfisht","\u297D":"rfisht","\u297E":"ufisht","\u297F":"dfisht","\u299A":"vzigzag","\u299C":"vangrt","\u299D":"angrtvbd","\u29A4":"ange","\u29A5":"range","\u29A6":"dwangle","\u29A7":"uwangle","\u29A8":"angmsdaa","\u29A9":"angmsdab","\u29AA":"angmsdac","\u29AB":"angmsdad","\u29AC":"angmsdae","\u29AD":"angmsdaf","\u29AE":"angmsdag","\u29AF":"angmsdah","\u29B0":"bemptyv","\u29B1":"demptyv","\u29B2":"cemptyv","\u29B3":"raemptyv","\u29B4":"laemptyv","\u29B5":"ohbar","\u29B6":"omid","\u29B7":"opar","\u29B9":"operp","\u29BB":"olcross","\u29BC":"odsold","\u29BE":"olcir","\u29BF":"ofcir","\u29C0":"olt","\u29C1":"ogt","\u29C2":"cirscir","\u29C3":"cirE","\u29C4":"solb","\u29C5":"bsolb","\u29C9":"boxbox","\u29CD":"trisb","\u29CE":"rtriltri","\u29CF":"LeftTriangleBar","\u29CF\u0338":"NotLeftTriangleBar","\u29D0":"RightTriangleBar","\u29D0\u0338":"NotRightTriangleBar","\u29DC":"iinfin","\u29DD":"infintie","\u29DE":"nvinfin","\u29E3":"eparsl","\u29E4":"smeparsl","\u29E5":"eqvparsl","\u29EB":"lozf","\u29F4":"RuleDelayed","\u29F6":"dsol","\u2A00":"xodot","\u2A01":"xoplus","\u2A02":"xotime","\u2A04":"xuplus","\u2A06":"xsqcup","\u2A0D":"fpartint","\u2A10":"cirfnint","\u2A11":"awint","\u2A12":"rppolint","\u2A13":"scpolint","\u2A14":"npolint","\u2A15":"pointint","\u2A16":"quatint","\u2A17":"intlarhk","\u2A22":"pluscir","\u2A23":"plusacir","\u2A24":"simplus","\u2A25":"plusdu","\u2A26":"plussim","\u2A27":"plustwo","\u2A29":"mcomma","\u2A2A":"minusdu","\u2A2D":"loplus","\u2A2E":"roplus","\u2A2F":"Cross","\u2A30":"timesd","\u2A31":"timesbar","\u2A33":"smashp","\u2A34":"lotimes","\u2A35":"rotimes","\u2A36":"otimesas","\u2A37":"Otimes","\u2A38":"odiv","\u2A39":"triplus","\u2A3A":"triminus","\u2A3B":"tritime","\u2A3C":"iprod","\u2A3F":"amalg","\u2A40":"capdot","\u2A42":"ncup","\u2A43":"ncap","\u2A44":"capand","\u2A45":"cupor","\u2A46":"cupcap","\u2A47":"capcup","\u2A48":"cupbrcap","\u2A49":"capbrcup","\u2A4A":"cupcup","\u2A4B":"capcap","\u2A4C":"ccups","\u2A4D":"ccaps","\u2A50":"ccupssm","\u2A53":"And","\u2A54":"Or","\u2A55":"andand","\u2A56":"oror","\u2A57":"orslope","\u2A58":"andslope","\u2A5A":"andv","\u2A5B":"orv","\u2A5C":"andd","\u2A5D":"ord","\u2A5F":"wedbar","\u2A66":"sdote","\u2A6A":"simdot","\u2A6D":"congdot","\u2A6D\u0338":"ncongdot","\u2A6E":"easter","\u2A6F":"apacir","\u2A70":"apE","\u2A70\u0338":"napE","\u2A71":"eplus","\u2A72":"pluse","\u2A73":"Esim","\u2A77":"eDDot","\u2A78":"equivDD","\u2A79":"ltcir","\u2A7A":"gtcir","\u2A7B":"ltquest","\u2A7C":"gtquest","\u2A7D":"les","\u2A7D\u0338":"nles","\u2A7E":"ges","\u2A7E\u0338":"nges","\u2A7F":"lesdot","\u2A80":"gesdot","\u2A81":"lesdoto","\u2A82":"gesdoto","\u2A83":"lesdotor","\u2A84":"gesdotol","\u2A85":"lap","\u2A86":"gap","\u2A87":"lne","\u2A88":"gne","\u2A89":"lnap","\u2A8A":"gnap","\u2A8B":"lEg","\u2A8C":"gEl","\u2A8D":"lsime","\u2A8E":"gsime","\u2A8F":"lsimg","\u2A90":"gsiml","\u2A91":"lgE","\u2A92":"glE","\u2A93":"lesges","\u2A94":"gesles","\u2A95":"els","\u2A96":"egs","\u2A97":"elsdot","\u2A98":"egsdot","\u2A99":"el","\u2A9A":"eg","\u2A9D":"siml","\u2A9E":"simg","\u2A9F":"simlE","\u2AA0":"simgE","\u2AA1":"LessLess","\u2AA1\u0338":"NotNestedLessLess","\u2AA2":"GreaterGreater","\u2AA2\u0338":"NotNestedGreaterGreater","\u2AA4":"glj","\u2AA5":"gla","\u2AA6":"ltcc","\u2AA7":"gtcc","\u2AA8":"lescc","\u2AA9":"gescc","\u2AAA":"smt","\u2AAB":"lat","\u2AAC":"smte","\u2AAC\uFE00":"smtes","\u2AAD":"late","\u2AAD\uFE00":"lates","\u2AAE":"bumpE","\u2AAF":"pre","\u2AAF\u0338":"npre","\u2AB0":"sce","\u2AB0\u0338":"nsce","\u2AB3":"prE","\u2AB4":"scE","\u2AB5":"prnE","\u2AB6":"scnE","\u2AB7":"prap","\u2AB8":"scap","\u2AB9":"prnap","\u2ABA":"scnap","\u2ABB":"Pr","\u2ABC":"Sc","\u2ABD":"subdot","\u2ABE":"supdot","\u2ABF":"subplus","\u2AC0":"supplus","\u2AC1":"submult","\u2AC2":"supmult","\u2AC3":"subedot","\u2AC4":"supedot","\u2AC5":"subE","\u2AC5\u0338":"nsubE","\u2AC6":"supE","\u2AC6\u0338":"nsupE","\u2AC7":"subsim","\u2AC8":"supsim","\u2ACB\uFE00":"vsubnE","\u2ACB":"subnE","\u2ACC\uFE00":"vsupnE","\u2ACC":"supnE","\u2ACF":"csub","\u2AD0":"csup","\u2AD1":"csube","\u2AD2":"csupe","\u2AD3":"subsup","\u2AD4":"supsub","\u2AD5":"subsub","\u2AD6":"supsup","\u2AD7":"suphsub","\u2AD8":"supdsub","\u2AD9":"forkv","\u2ADA":"topfork","\u2ADB":"mlcp","\u2AE4":"Dashv","\u2AE6":"Vdashl","\u2AE7":"Barv","\u2AE8":"vBar","\u2AE9":"vBarv","\u2AEB":"Vbar","\u2AEC":"Not","\u2AED":"bNot","\u2AEE":"rnmid","\u2AEF":"cirmid","\u2AF0":"midcir","\u2AF1":"topcir","\u2AF2":"nhpar","\u2AF3":"parsim","\u2AFD":"parsl","\u2AFD\u20E5":"nparsl","\u266D":"flat","\u266E":"natur","\u266F":"sharp","\xA4":"curren","\xA2":"cent",$:"dollar","\xA3":"pound","\xA5":"yen","\u20AC":"euro","\xB9":"sup1","\xBD":"half","\u2153":"frac13","\xBC":"frac14","\u2155":"frac15","\u2159":"frac16","\u215B":"frac18","\xB2":"sup2","\u2154":"frac23","\u2156":"frac25","\xB3":"sup3","\xBE":"frac34","\u2157":"frac35","\u215C":"frac38","\u2158":"frac45","\u215A":"frac56","\u215D":"frac58","\u215E":"frac78","\u{1D4B6}":"ascr","\u{1D552}":"aopf","\u{1D51E}":"afr","\u{1D538}":"Aopf","\u{1D504}":"Afr","\u{1D49C}":"Ascr",\u00AA:"ordf",\u00E1:"aacute",\u00C1:"Aacute",\u00E0:"agrave",\u00C0:"Agrave",\u0103:"abreve",\u0102:"Abreve",\u00E2:"acirc",\u00C2:"Acirc",\u00E5:"aring",\u00C5:"angst",\u00E4:"auml",\u00C4:"Auml",\u00E3:"atilde",\u00C3:"Atilde",\u0105:"aogon",\u0104:"Aogon",\u0101:"amacr",\u0100:"Amacr",\u00E6:"aelig",\u00C6:"AElig","\u{1D4B7}":"bscr","\u{1D553}":"bopf","\u{1D51F}":"bfr","\u{1D539}":"Bopf",\u212C:"Bscr","\u{1D505}":"Bfr","\u{1D520}":"cfr","\u{1D4B8}":"cscr","\u{1D554}":"copf",\u212D:"Cfr","\u{1D49E}":"Cscr",\u2102:"Copf",\u0107:"cacute",\u0106:"Cacute",\u0109:"ccirc",\u0108:"Ccirc",\u010D:"ccaron",\u010C:"Ccaron",\u010B:"cdot",\u010A:"Cdot",\u00E7:"ccedil",\u00C7:"Ccedil","\u2105":"incare","\u{1D521}":"dfr","\u2146":"dd","\u{1D555}":"dopf","\u{1D4B9}":"dscr","\u{1D49F}":"Dscr","\u{1D507}":"Dfr","\u2145":"DD","\u{1D53B}":"Dopf",\u010F:"dcaron",\u010E:"Dcaron",\u0111:"dstrok",\u0110:"Dstrok",\u00F0:"eth",\u00D0:"ETH","\u2147":"ee",\u212F:"escr","\u{1D522}":"efr","\u{1D556}":"eopf",\u2130:"Escr","\u{1D508}":"Efr","\u{1D53C}":"Eopf",\u00E9:"eacute",\u00C9:"Eacute",\u00E8:"egrave",\u00C8:"Egrave",\u00EA:"ecirc",\u00CA:"Ecirc",\u011B:"ecaron",\u011A:"Ecaron",\u00EB:"euml",\u00CB:"Euml",\u0117:"edot",\u0116:"Edot",\u0119:"eogon",\u0118:"Eogon",\u0113:"emacr",\u0112:"Emacr","\u{1D523}":"ffr","\u{1D557}":"fopf","\u{1D4BB}":"fscr","\u{1D509}":"Ffr","\u{1D53D}":"Fopf",\u2131:"Fscr",\uFB00:"fflig",\uFB03:"ffilig",\uFB04:"ffllig",\uFB01:"filig",fj:"fjlig",\uFB02:"fllig",\u0192:"fnof",\u210A:"gscr","\u{1D558}":"gopf","\u{1D524}":"gfr","\u{1D4A2}":"Gscr","\u{1D53E}":"Gopf","\u{1D50A}":"Gfr",\u01F5:"gacute",\u011F:"gbreve",\u011E:"Gbreve",\u011D:"gcirc",\u011C:"Gcirc",\u0121:"gdot",\u0120:"Gdot",\u0122:"Gcedil","\u{1D525}":"hfr",\u210E:"planckh","\u{1D4BD}":"hscr","\u{1D559}":"hopf",\u210B:"Hscr",\u210C:"Hfr",\u210D:"Hopf",\u0125:"hcirc",\u0124:"Hcirc",\u210F:"hbar",\u0127:"hstrok",\u0126:"Hstrok","\u{1D55A}":"iopf","\u{1D526}":"ifr","\u{1D4BE}":"iscr","\u2148":"ii","\u{1D540}":"Iopf",\u2110:"Iscr",\u2111:"Im",\u00ED:"iacute",\u00CD:"Iacute",\u00EC:"igrave",\u00CC:"Igrave",\u00EE:"icirc",\u00CE:"Icirc",\u00EF:"iuml",\u00CF:"Iuml",\u0129:"itilde",\u0128:"Itilde",\u0130:"Idot",\u012F:"iogon",\u012E:"Iogon",\u012B:"imacr",\u012A:"Imacr",\u0133:"ijlig",\u0132:"IJlig",\u0131:"imath","\u{1D4BF}":"jscr","\u{1D55B}":"jopf","\u{1D527}":"jfr","\u{1D4A5}":"Jscr","\u{1D50D}":"Jfr","\u{1D541}":"Jopf",\u0135:"jcirc",\u0134:"Jcirc","\u0237":"jmath","\u{1D55C}":"kopf","\u{1D4C0}":"kscr","\u{1D528}":"kfr","\u{1D4A6}":"Kscr","\u{1D542}":"Kopf","\u{1D50E}":"Kfr",\u0137:"kcedil",\u0136:"Kcedil","\u{1D529}":"lfr","\u{1D4C1}":"lscr",\u2113:"ell","\u{1D55D}":"lopf",\u2112:"Lscr","\u{1D50F}":"Lfr","\u{1D543}":"Lopf",\u013A:"lacute",\u0139:"Lacute",\u013E:"lcaron",\u013D:"Lcaron",\u013C:"lcedil",\u013B:"Lcedil",\u0142:"lstrok",\u0141:"Lstrok",\u0140:"lmidot",\u013F:"Lmidot","\u{1D52A}":"mfr","\u{1D55E}":"mopf","\u{1D4C2}":"mscr","\u{1D510}":"Mfr","\u{1D544}":"Mopf",\u2133:"Mscr","\u{1D52B}":"nfr","\u{1D55F}":"nopf","\u{1D4C3}":"nscr",\u2115:"Nopf","\u{1D4A9}":"Nscr","\u{1D511}":"Nfr",\u0144:"nacute",\u0143:"Nacute",\u0148:"ncaron",\u0147:"Ncaron",\u00F1:"ntilde",\u00D1:"Ntilde",\u0146:"ncedil",\u0145:"Ncedil","\u2116":"numero",\u014B:"eng",\u014A:"ENG","\u{1D560}":"oopf","\u{1D52C}":"ofr",\u2134:"oscr","\u{1D4AA}":"Oscr","\u{1D512}":"Ofr","\u{1D546}":"Oopf",\u00BA:"ordm",\u00F3:"oacute",\u00D3:"Oacute",\u00F2:"ograve",\u00D2:"Ograve",\u00F4:"ocirc",\u00D4:"Ocirc",\u00F6:"ouml",\u00D6:"Ouml",\u0151:"odblac",\u0150:"Odblac",\u00F5:"otilde",\u00D5:"Otilde",\u00F8:"oslash",\u00D8:"Oslash",\u014D:"omacr",\u014C:"Omacr",\u0153:"oelig",\u0152:"OElig","\u{1D52D}":"pfr","\u{1D4C5}":"pscr","\u{1D561}":"popf",\u2119:"Popf","\u{1D513}":"Pfr","\u{1D4AB}":"Pscr","\u{1D562}":"qopf","\u{1D52E}":"qfr","\u{1D4C6}":"qscr","\u{1D4AC}":"Qscr","\u{1D514}":"Qfr",\u211A:"Qopf",\u0138:"kgreen","\u{1D52F}":"rfr","\u{1D563}":"ropf","\u{1D4C7}":"rscr",\u211B:"Rscr",\u211C:"Re",\u211D:"Ropf",\u0155:"racute",\u0154:"Racute",\u0159:"rcaron",\u0158:"Rcaron",\u0157:"rcedil",\u0156:"Rcedil","\u{1D564}":"sopf","\u{1D4C8}":"sscr","\u{1D530}":"sfr","\u{1D54A}":"Sopf","\u{1D516}":"Sfr","\u{1D4AE}":"Sscr","\u24C8":"oS",\u015B:"sacute",\u015A:"Sacute",\u015D:"scirc",\u015C:"Scirc",\u0161:"scaron",\u0160:"Scaron",\u015F:"scedil",\u015E:"Scedil",\u00DF:"szlig","\u{1D531}":"tfr","\u{1D4C9}":"tscr","\u{1D565}":"topf","\u{1D4AF}":"Tscr","\u{1D517}":"Tfr","\u{1D54B}":"Topf",\u0165:"tcaron",\u0164:"Tcaron",\u0163:"tcedil",\u0162:"Tcedil","\u2122":"trade",\u0167:"tstrok",\u0166:"Tstrok","\u{1D4CA}":"uscr","\u{1D566}":"uopf","\u{1D532}":"ufr","\u{1D54C}":"Uopf","\u{1D518}":"Ufr","\u{1D4B0}":"Uscr",\u00FA:"uacute",\u00DA:"Uacute",\u00F9:"ugrave",\u00D9:"Ugrave",\u016D:"ubreve",\u016C:"Ubreve",\u00FB:"ucirc",\u00DB:"Ucirc",\u016F:"uring",\u016E:"Uring",\u00FC:"uuml",\u00DC:"Uuml",\u0171:"udblac",\u0170:"Udblac",\u0169:"utilde",\u0168:"Utilde",\u0173:"uogon",\u0172:"Uogon",\u016B:"umacr",\u016A:"Umacr","\u{1D533}":"vfr","\u{1D567}":"vopf","\u{1D4CB}":"vscr","\u{1D519}":"Vfr","\u{1D54D}":"Vopf","\u{1D4B1}":"Vscr","\u{1D568}":"wopf","\u{1D4CC}":"wscr","\u{1D534}":"wfr","\u{1D4B2}":"Wscr","\u{1D54E}":"Wopf","\u{1D51A}":"Wfr",\u0175:"wcirc",\u0174:"Wcirc","\u{1D535}":"xfr","\u{1D4CD}":"xscr","\u{1D569}":"xopf","\u{1D54F}":"Xopf","\u{1D51B}":"Xfr","\u{1D4B3}":"Xscr","\u{1D536}":"yfr","\u{1D4CE}":"yscr","\u{1D56A}":"yopf","\u{1D4B4}":"Yscr","\u{1D51C}":"Yfr","\u{1D550}":"Yopf",\u00FD:"yacute",\u00DD:"Yacute",\u0177:"ycirc",\u0176:"Ycirc",\u00FF:"yuml",\u0178:"Yuml","\u{1D4CF}":"zscr","\u{1D537}":"zfr","\u{1D56B}":"zopf",\u2128:"Zfr",\u2124:"Zopf","\u{1D4B5}":"Zscr",\u017A:"zacute",\u0179:"Zacute",\u017E:"zcaron",\u017D:"Zcaron",\u017C:"zdot",\u017B:"Zdot",\u01B5:"imped",\u00FE:"thorn",\u00DE:"THORN",\u0149:"napos",\u03B1:"alpha",\u0391:"Alpha",\u03B2:"beta",\u0392:"Beta",\u03B3:"gamma",\u0393:"Gamma",\u03B4:"delta",\u0394:"Delta",\u03B5:"epsi","\u03F5":"epsiv",\u0395:"Epsilon",\u03DD:"gammad",\u03DC:"Gammad",\u03B6:"zeta",\u0396:"Zeta",\u03B7:"eta",\u0397:"Eta",\u03B8:"theta",\u03D1:"thetav",\u0398:"Theta",\u03B9:"iota",\u0399:"Iota",\u03BA:"kappa",\u03F0:"kappav",\u039A:"Kappa",\u03BB:"lambda",\u039B:"Lambda",\u03BC:"mu",\u00B5:"micro",\u039C:"Mu",\u03BD:"nu",\u039D:"Nu",\u03BE:"xi",\u039E:"Xi",\u03BF:"omicron",\u039F:"Omicron",\u03C0:"pi",\u03D6:"piv",\u03A0:"Pi",\u03C1:"rho",\u03F1:"rhov",\u03A1:"Rho",\u03C3:"sigma",\u03A3:"Sigma",\u03C2:"sigmaf",\u03C4:"tau",\u03A4:"Tau",\u03C5:"upsi",\u03A5:"Upsilon",\u03D2:"Upsi",\u03C6:"phi",\u03D5:"phiv",\u03A6:"Phi",\u03C7:"chi",\u03A7:"Chi",\u03C8:"psi",\u03A8:"Psi",\u03C9:"omega",\u03A9:"ohm",\u0430:"acy",\u0410:"Acy",\u0431:"bcy",\u0411:"Bcy",\u0432:"vcy",\u0412:"Vcy",\u0433:"gcy",\u0413:"Gcy",\u0453:"gjcy",\u0403:"GJcy",\u0434:"dcy",\u0414:"Dcy",\u0452:"djcy",\u0402:"DJcy",\u0435:"iecy",\u0415:"IEcy",\u0451:"iocy",\u0401:"IOcy",\u0454:"jukcy",\u0404:"Jukcy",\u0436:"zhcy",\u0416:"ZHcy",\u0437:"zcy",\u0417:"Zcy",\u0455:"dscy",\u0405:"DScy",\u0438:"icy",\u0418:"Icy",\u0456:"iukcy",\u0406:"Iukcy",\u0457:"yicy",\u0407:"YIcy",\u0439:"jcy",\u0419:"Jcy",\u0458:"jsercy",\u0408:"Jsercy",\u043A:"kcy",\u041A:"Kcy",\u045C:"kjcy",\u040C:"KJcy",\u043B:"lcy",\u041B:"Lcy",\u0459:"ljcy",\u0409:"LJcy",\u043C:"mcy",\u041C:"Mcy",\u043D:"ncy",\u041D:"Ncy",\u045A:"njcy",\u040A:"NJcy",\u043E:"ocy",\u041E:"Ocy",\u043F:"pcy",\u041F:"Pcy",\u0440:"rcy",\u0420:"Rcy",\u0441:"scy",\u0421:"Scy",\u0442:"tcy",\u0422:"Tcy",\u045B:"tshcy",\u040B:"TSHcy",\u0443:"ucy",\u0423:"Ucy",\u045E:"ubrcy",\u040E:"Ubrcy",\u0444:"fcy",\u0424:"Fcy",\u0445:"khcy",\u0425:"KHcy",\u0446:"tscy",\u0426:"TScy",\u0447:"chcy",\u0427:"CHcy",\u045F:"dzcy",\u040F:"DZcy",\u0448:"shcy",\u0428:"SHcy",\u0449:"shchcy",\u0429:"SHCHcy",\u044A:"hardcy",\u042A:"HARDcy",\u044B:"ycy",\u042B:"Ycy",\u044C:"softcy",\u042C:"SOFTcy",\u044D:"ecy",\u042D:"Ecy",\u044E:"yucy",\u042E:"YUcy",\u044F:"yacy",\u042F:"YAcy",\u2135:"aleph",\u2136:"beth",\u2137:"gimel",\u2138:"daleth"},u=/["&'<>`]/g,c={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},f=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,d=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,h=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g,p={aacute:"\xE1",Aacute:"\xC1",abreve:"\u0103",Abreve:"\u0102",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",acirc:"\xE2",Acirc:"\xC2",acute:"\xB4",acy:"\u0430",Acy:"\u0410",aelig:"\xE6",AElig:"\xC6",af:"\u2061",afr:"\u{1D51E}",Afr:"\u{1D504}",agrave:"\xE0",Agrave:"\xC0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",Alpha:"\u0391",amacr:"\u0101",Amacr:"\u0100",amalg:"\u2A3F",amp:"&",AMP:"&",and:"\u2227",And:"\u2A53",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",Aogon:"\u0104",aopf:"\u{1D552}",Aopf:"\u{1D538}",ap:"\u2248",apacir:"\u2A6F",ape:"\u224A",apE:"\u2A70",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",Aring:"\xC5",ascr:"\u{1D4B6}",Ascr:"\u{1D49C}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",Atilde:"\xC3",auml:"\xE4",Auml:"\xC4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",Bcy:"\u0411",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",beta:"\u03B2",Beta:"\u0392",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",Bfr:"\u{1D505}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bNot:"\u2AED",bopf:"\u{1D553}",Bopf:"\u{1D539}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250C",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252C",boxhD:"\u2565",boxHd:"\u2564",boxHD:"\u2566",boxhu:"\u2534",boxhU:"\u2568",boxHu:"\u2567",boxHU:"\u2569",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxul:"\u2518",boxuL:"\u255B",boxUl:"\u255C",boxUL:"\u255D",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255A",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253C",boxvH:"\u256A",boxVh:"\u256B",boxVH:"\u256C",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251C",boxvR:"\u255E",boxVr:"\u255F",boxVR:"\u2560",bprime:"\u2035",breve:"\u02D8",Breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",Bscr:"\u212C",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpe:"\u224F",bumpE:"\u2AAE",bumpeq:"\u224F",Bumpeq:"\u224E",cacute:"\u0107",Cacute:"\u0106",cap:"\u2229",Cap:"\u22D2",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",ccaron:"\u010D",Ccaron:"\u010C",ccedil:"\xE7",Ccedil:"\xC7",ccirc:"\u0109",Ccirc:"\u0108",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",Cdot:"\u010A",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",CenterDot:"\xB7",cfr:"\u{1D520}",Cfr:"\u212D",chcy:"\u0447",CHcy:"\u0427",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",Chi:"\u03A7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cire:"\u2257",cirE:"\u29C3",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",colone:"\u2254",Colone:"\u2A74",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",conint:"\u222E",Conint:"\u222F",ContourIntegral:"\u222E",copf:"\u{1D554}",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xA9",COPY:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",cross:"\u2717",Cross:"\u2A2F",cscr:"\u{1D4B8}",Cscr:"\u{1D49E}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",Cup:"\u22D3",cupbrcap:"\u2A48",cupcap:"\u2A46",CupCap:"\u224D",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",dArr:"\u21D3",Darr:"\u21A1",dash:"\u2010",dashv:"\u22A3",Dashv:"\u2AE4",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",Dcaron:"\u010E",dcy:"\u0434",Dcy:"\u0414",dd:"\u2146",DD:"\u2145",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",delta:"\u03B4",Delta:"\u0394",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",Dfr:"\u{1D507}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",diamond:"\u22C4",Diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",DJcy:"\u0402",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",Dopf:"\u{1D53B}",dot:"\u02D9",Dot:"\xA8",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",downarrow:"\u2193",Downarrow:"\u21D3",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",Dscr:"\u{1D49F}",dscy:"\u0455",DScy:"\u0405",dsol:"\u29F6",dstrok:"\u0111",Dstrok:"\u0110",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",DZcy:"\u040F",dzigrarr:"\u27FF",eacute:"\xE9",Eacute:"\xC9",easter:"\u2A6E",ecaron:"\u011B",Ecaron:"\u011A",ecir:"\u2256",ecirc:"\xEA",Ecirc:"\xCA",ecolon:"\u2255",ecy:"\u044D",Ecy:"\u042D",eDDot:"\u2A77",edot:"\u0117",eDot:"\u2251",Edot:"\u0116",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",Efr:"\u{1D508}",eg:"\u2A9A",egrave:"\xE8",Egrave:"\xC8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",Emacr:"\u0112",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",eng:"\u014B",ENG:"\u014A",ensp:"\u2002",eogon:"\u0119",Eogon:"\u0118",eopf:"\u{1D556}",Eopf:"\u{1D53C}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",Epsilon:"\u0395",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",escr:"\u212F",Escr:"\u2130",esdot:"\u2250",esim:"\u2242",Esim:"\u2A73",eta:"\u03B7",Eta:"\u0397",eth:"\xF0",ETH:"\xD0",euml:"\xEB",Euml:"\xCB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",Fcy:"\u0424",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",Ffr:"\u{1D509}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",Fopf:"\u{1D53D}",forall:"\u2200",ForAll:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",Fscr:"\u2131",gacute:"\u01F5",gamma:"\u03B3",Gamma:"\u0393",gammad:"\u03DD",Gammad:"\u03DC",gap:"\u2A86",gbreve:"\u011F",Gbreve:"\u011E",Gcedil:"\u0122",gcirc:"\u011D",Gcirc:"\u011C",gcy:"\u0433",Gcy:"\u0413",gdot:"\u0121",Gdot:"\u0120",ge:"\u2265",gE:"\u2267",gel:"\u22DB",gEl:"\u2A8C",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",Gfr:"\u{1D50A}",gg:"\u226B",Gg:"\u22D9",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",GJcy:"\u0403",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gnE:"\u2269",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",Gopf:"\u{1D53E}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",gscr:"\u210A",Gscr:"\u{1D4A2}",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",Gt:"\u226B",GT:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",HARDcy:"\u042A",harr:"\u2194",hArr:"\u21D4",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",hcirc:"\u0125",Hcirc:"\u0124",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",Hfr:"\u210C",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",Hopf:"\u210D",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\u{1D4BD}",Hscr:"\u210B",hslash:"\u210F",hstrok:"\u0127",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",Iacute:"\xCD",ic:"\u2063",icirc:"\xEE",Icirc:"\xCE",icy:"\u0438",Icy:"\u0418",Idot:"\u0130",iecy:"\u0435",IEcy:"\u0415",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",Ifr:"\u2111",igrave:"\xEC",Igrave:"\xCC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",IJlig:"\u0132",Im:"\u2111",imacr:"\u012B",Imacr:"\u012A",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",Int:"\u222C",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",iocy:"\u0451",IOcy:"\u0401",iogon:"\u012F",Iogon:"\u012E",iopf:"\u{1D55A}",Iopf:"\u{1D540}",iota:"\u03B9",Iota:"\u0399",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",Iscr:"\u2110",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",Itilde:"\u0128",iukcy:"\u0456",Iukcy:"\u0406",iuml:"\xEF",Iuml:"\xCF",jcirc:"\u0135",Jcirc:"\u0134",jcy:"\u0439",Jcy:"\u0419",jfr:"\u{1D527}",Jfr:"\u{1D50D}",jmath:"\u0237",jopf:"\u{1D55B}",Jopf:"\u{1D541}",jscr:"\u{1D4BF}",Jscr:"\u{1D4A5}",jsercy:"\u0458",Jsercy:"\u0408",jukcy:"\u0454",Jukcy:"\u0404",kappa:"\u03BA",Kappa:"\u039A",kappav:"\u03F0",kcedil:"\u0137",Kcedil:"\u0136",kcy:"\u043A",Kcy:"\u041A",kfr:"\u{1D528}",Kfr:"\u{1D50E}",kgreen:"\u0138",khcy:"\u0445",KHcy:"\u0425",kjcy:"\u045C",KJcy:"\u040C",kopf:"\u{1D55C}",Kopf:"\u{1D542}",kscr:"\u{1D4C0}",Kscr:"\u{1D4A6}",lAarr:"\u21DA",lacute:"\u013A",Lacute:"\u0139",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",Lambda:"\u039B",lang:"\u27E8",Lang:"\u27EA",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",larr:"\u2190",lArr:"\u21D0",Larr:"\u219E",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",lAtail:"\u291B",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lBarr:"\u290E",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",Lcaron:"\u013D",lcedil:"\u013C",Lcedil:"\u013B",lceil:"\u2308",lcub:"{",lcy:"\u043B",Lcy:"\u041B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27E8",leftarrow:"\u2190",Leftarrow:"\u21D0",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",Leftrightarrow:"\u21D4",LeftRightArrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",leg:"\u22DA",lEg:"\u2A8B",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",Lfr:"\u{1D50F}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",LJcy:"\u0409",ll:"\u226A",Ll:"\u22D8",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",Lmidot:"\u013F",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lnE:"\u2268",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",Longleftarrow:"\u27F8",LongLeftArrow:"\u27F5",longleftrightarrow:"\u27F7",Longleftrightarrow:"\u27FA",LongLeftRightArrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",Longrightarrow:"\u27F9",LongRightArrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",Lopf:"\u{1D543}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",Lscr:"\u2112",lsh:"\u21B0",Lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",Lstrok:"\u0141",lt:"<",Lt:"\u226A",LT:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",Map:"\u2905",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",Mcy:"\u041C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",mfr:"\u{1D52A}",Mfr:"\u{1D510}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",Mopf:"\u{1D544}",mp:"\u2213",mscr:"\u{1D4C2}",Mscr:"\u2133",mstpos:"\u223E",mu:"\u03BC",Mu:"\u039C",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",nacute:"\u0144",Nacute:"\u0143",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",Ncaron:"\u0147",ncedil:"\u0146",Ncedil:"\u0145",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",Ncy:"\u041D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21D7",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` `,nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",Nfr:"\u{1D511}",nge:"\u2271",ngE:"\u2267\u0338",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",ngt:"\u226F",nGt:"\u226B\u20D2",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",NJcy:"\u040A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nle:"\u2270",nlE:"\u2266\u0338",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nlt:"\u226E",nLt:"\u226A\u20D2",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",not:"\xAC",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",Nscr:"\u{1D4A9}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsube:"\u2288",nsubE:"\u2AC5\u0338",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupe:"\u2289",nsupE:"\u2AC6\u0338",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",Ntilde:"\xD1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",Nu:"\u039D",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",oacute:"\xF3",Oacute:"\xD3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",Ocirc:"\xD4",ocy:"\u043E",Ocy:"\u041E",odash:"\u229D",odblac:"\u0151",Odblac:"\u0150",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",OElig:"\u0152",ofcir:"\u29BF",ofr:"\u{1D52C}",Ofr:"\u{1D512}",ogon:"\u02DB",ograve:"\xF2",Ograve:"\xD2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",Omacr:"\u014C",omega:"\u03C9",Omega:"\u03A9",omicron:"\u03BF",Omicron:"\u039F",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",Oopf:"\u{1D546}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",or:"\u2228",Or:"\u2A54",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",oscr:"\u2134",Oscr:"\u{1D4AA}",oslash:"\xF8",Oslash:"\xD8",osol:"\u2298",otilde:"\xF5",Otilde:"\xD5",otimes:"\u2297",Otimes:"\u2A37",otimesas:"\u2A36",ouml:"\xF6",Ouml:"\xD6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",pcy:"\u043F",Pcy:"\u041F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",Pfr:"\u{1D513}",phi:"\u03C6",Phi:"\u03A6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",Pi:"\u03A0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",popf:"\u{1D561}",Popf:"\u2119",pound:"\xA3",pr:"\u227A",Pr:"\u2ABB",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prE:"\u2AB3",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",Pscr:"\u{1D4AB}",psi:"\u03C8",Psi:"\u03A8",puncsp:"\u2008",qfr:"\u{1D52E}",Qfr:"\u{1D514}",qint:"\u2A0C",qopf:"\u{1D562}",Qopf:"\u211A",qprime:"\u2057",qscr:"\u{1D4C6}",Qscr:"\u{1D4AC}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',QUOT:'"',rAarr:"\u21DB",race:"\u223D\u0331",racute:"\u0155",Racute:"\u0154",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",Rang:"\u27EB",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rArr:"\u21D2",Rarr:"\u21A0",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",Rarrtl:"\u2916",rarrw:"\u219D",ratail:"\u291A",rAtail:"\u291C",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rBarr:"\u290F",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",Rcaron:"\u0158",rcedil:"\u0157",Rcedil:"\u0156",rceil:"\u2309",rcub:"}",rcy:"\u0440",Rcy:"\u0420",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",REG:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",Rfr:"\u211C",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",Rho:"\u03A1",rhov:"\u03F1",RightAngleBracket:"\u27E9",rightarrow:"\u2192",Rightarrow:"\u21D2",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",Ropf:"\u211D",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",rscr:"\u{1D4C7}",Rscr:"\u211B",rsh:"\u21B1",Rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",Sacute:"\u015A",sbquo:"\u201A",sc:"\u227B",Sc:"\u2ABC",scap:"\u2AB8",scaron:"\u0161",Scaron:"\u0160",sccue:"\u227D",sce:"\u2AB0",scE:"\u2AB4",scedil:"\u015F",Scedil:"\u015E",scirc:"\u015D",Scirc:"\u015C",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",Scy:"\u0421",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",searr:"\u2198",seArr:"\u21D8",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",Sfr:"\u{1D516}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",SHCHcy:"\u0429",shcy:"\u0448",SHcy:"\u0428",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",sigma:"\u03C3",Sigma:"\u03A3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",SOFTcy:"\u042C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",Sopf:"\u{1D54A}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",Sscr:"\u{1D4AE}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",Star:"\u22C6",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",Sub:"\u22D0",subdot:"\u2ABD",sube:"\u2286",subE:"\u2AC5",subedot:"\u2AC3",submult:"\u2AC1",subne:"\u228A",subnE:"\u2ACB",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",Subset:"\u22D0",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",sum:"\u2211",Sum:"\u2211",sung:"\u266A",sup:"\u2283",Sup:"\u22D1",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supE:"\u2AC6",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supne:"\u228B",supnE:"\u2ACC",supplus:"\u2AC0",supset:"\u2283",Supset:"\u22D1",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21D9",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",tau:"\u03C4",Tau:"\u03A4",tbrk:"\u23B4",tcaron:"\u0165",Tcaron:"\u0164",tcedil:"\u0163",Tcedil:"\u0162",tcy:"\u0442",Tcy:"\u0422",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",Tfr:"\u{1D517}",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",theta:"\u03B8",Theta:"\u0398",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",THORN:"\xDE",tilde:"\u02DC",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",Topf:"\u{1D54B}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",Tscr:"\u{1D4AF}",tscy:"\u0446",TScy:"\u0426",tshcy:"\u045B",TSHcy:"\u040B",tstrok:"\u0167",Tstrok:"\u0166",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uacute:"\xFA",Uacute:"\xDA",uarr:"\u2191",uArr:"\u21D1",Uarr:"\u219F",Uarrocir:"\u2949",ubrcy:"\u045E",Ubrcy:"\u040E",ubreve:"\u016D",Ubreve:"\u016C",ucirc:"\xFB",Ucirc:"\xDB",ucy:"\u0443",Ucy:"\u0423",udarr:"\u21C5",udblac:"\u0171",Udblac:"\u0170",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",Ufr:"\u{1D518}",ugrave:"\xF9",Ugrave:"\xD9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",Umacr:"\u016A",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",uogon:"\u0173",Uogon:"\u0172",uopf:"\u{1D566}",Uopf:"\u{1D54C}",uparrow:"\u2191",Uparrow:"\u21D1",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",updownarrow:"\u2195",Updownarrow:"\u21D5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03C5",Upsi:"\u03D2",upsih:"\u03D2",upsilon:"\u03C5",Upsilon:"\u03A5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",Uring:"\u016E",urtri:"\u25F9",uscr:"\u{1D4CA}",Uscr:"\u{1D4B0}",utdot:"\u22F0",utilde:"\u0169",Utilde:"\u0168",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",Uuml:"\xDC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",vArr:"\u21D5",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vBar:"\u2AE8",Vbar:"\u2AEB",vBarv:"\u2AE9",vcy:"\u0432",Vcy:"\u0412",vdash:"\u22A2",vDash:"\u22A8",Vdash:"\u22A9",VDash:"\u22AB",Vdashl:"\u2AE6",vee:"\u2228",Vee:"\u22C1",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",vfr:"\u{1D533}",Vfr:"\u{1D519}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",Vopf:"\u{1D54D}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",Vscr:"\u{1D4B1}",vsubne:"\u228A\uFE00",vsubnE:"\u2ACB\uFE00",vsupne:"\u228B\uFE00",vsupnE:"\u2ACC\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",wcirc:"\u0175",Wcirc:"\u0174",wedbar:"\u2A5F",wedge:"\u2227",Wedge:"\u22C0",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",Wfr:"\u{1D51A}",wopf:"\u{1D568}",Wopf:"\u{1D54E}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",Wscr:"\u{1D4B2}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",Xfr:"\u{1D51B}",xharr:"\u27F7",xhArr:"\u27FA",xi:"\u03BE",Xi:"\u039E",xlarr:"\u27F5",xlArr:"\u27F8",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",Xopf:"\u{1D54F}",xoplus:"\u2A01",xotime:"\u2A02",xrarr:"\u27F6",xrArr:"\u27F9",xscr:"\u{1D4CD}",Xscr:"\u{1D4B3}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",Yacute:"\xDD",yacy:"\u044F",YAcy:"\u042F",ycirc:"\u0177",Ycirc:"\u0176",ycy:"\u044B",Ycy:"\u042B",yen:"\xA5",yfr:"\u{1D536}",Yfr:"\u{1D51C}",yicy:"\u0457",YIcy:"\u0407",yopf:"\u{1D56A}",Yopf:"\u{1D550}",yscr:"\u{1D4CE}",Yscr:"\u{1D4B4}",yucy:"\u044E",YUcy:"\u042E",yuml:"\xFF",Yuml:"\u0178",zacute:"\u017A",Zacute:"\u0179",zcaron:"\u017E",Zcaron:"\u017D",zcy:"\u0437",Zcy:"\u0417",zdot:"\u017C",Zdot:"\u017B",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",zeta:"\u03B6",Zeta:"\u0396",zfr:"\u{1D537}",Zfr:"\u2128",zhcy:"\u0436",ZHcy:"\u0416",zigrarr:"\u21DD",zopf:"\u{1D56B}",Zopf:"\u2124",zscr:"\u{1D4CF}",Zscr:"\u{1D4B5}",zwj:"\u200D",zwnj:"\u200C"},m={aacute:"\xE1",Aacute:"\xC1",acirc:"\xE2",Acirc:"\xC2",acute:"\xB4",aelig:"\xE6",AElig:"\xC6",agrave:"\xE0",Agrave:"\xC0",amp:"&",AMP:"&",aring:"\xE5",Aring:"\xC5",atilde:"\xE3",Atilde:"\xC3",auml:"\xE4",Auml:"\xC4",brvbar:"\xA6",ccedil:"\xE7",Ccedil:"\xC7",cedil:"\xB8",cent:"\xA2",copy:"\xA9",COPY:"\xA9",curren:"\xA4",deg:"\xB0",divide:"\xF7",eacute:"\xE9",Eacute:"\xC9",ecirc:"\xEA",Ecirc:"\xCA",egrave:"\xE8",Egrave:"\xC8",eth:"\xF0",ETH:"\xD0",euml:"\xEB",Euml:"\xCB",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE",gt:">",GT:">",iacute:"\xED",Iacute:"\xCD",icirc:"\xEE",Icirc:"\xCE",iexcl:"\xA1",igrave:"\xEC",Igrave:"\xCC",iquest:"\xBF",iuml:"\xEF",Iuml:"\xCF",laquo:"\xAB",lt:"<",LT:"<",macr:"\xAF",micro:"\xB5",middot:"\xB7",nbsp:"\xA0",not:"\xAC",ntilde:"\xF1",Ntilde:"\xD1",oacute:"\xF3",Oacute:"\xD3",ocirc:"\xF4",Ocirc:"\xD4",ograve:"\xF2",Ograve:"\xD2",ordf:"\xAA",ordm:"\xBA",oslash:"\xF8",Oslash:"\xD8",otilde:"\xF5",Otilde:"\xD5",ouml:"\xF6",Ouml:"\xD6",para:"\xB6",plusmn:"\xB1",pound:"\xA3",quot:'"',QUOT:'"',raquo:"\xBB",reg:"\xAE",REG:"\xAE",sect:"\xA7",shy:"\xAD",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",szlig:"\xDF",thorn:"\xFE",THORN:"\xDE",times:"\xD7",uacute:"\xFA",Uacute:"\xDA",ucirc:"\xFB",Ucirc:"\xDB",ugrave:"\xF9",Ugrave:"\xD9",uml:"\xA8",uuml:"\xFC",Uuml:"\xDC",yacute:"\xFD",Yacute:"\xDD",yen:"\xA5",yuml:"\xFF"},O={0:"\uFFFD",128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},b=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],E=String.fromCharCode,D={},C=D.hasOwnProperty,k=function(te,ge){return C.call(te,ge)},w=function(te,ge){for(var he=-1,ue=te.length;++he=55296&&te<=57343||te>1114111?(ge&&N("character reference outside the permissible Unicode range"),"\uFFFD"):k(O,te)?(ge&&N("disallowed character reference"),O[te]):(ge&&w(b,te)&&N("disallowed character reference"),te>65535&&(te-=65536,he+=E(te>>>10&1023|55296),te=56320|te&1023),he+=E(te),he)},M=function(te){return"&#x"+te.toString(16).toUpperCase()+";"},Z=function(te){return"&#"+te+";"},N=function(te){throw Error("Parse error: "+te)},L=function(te,ge){ge=T(ge,L.options);var he=ge.strict;he&&d.test(te)&&N("forbidden code point");var ue=ge.encodeEverything,xe=ge.useNamedReferences,Pe=ge.allowUnsafeSymbols,Ye=ge.decimal?Z:M,it=function(Be){return Ye(Be.charCodeAt(0))};return ue?(te=te.replace(i,function(Be){return xe&&k(l,Be)?"&"+l[Be]+";":it(Be)}),xe&&(te=te.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),xe&&(te=te.replace(s,function(Be){return"&"+l[Be]+";"}))):xe?(Pe||(te=te.replace(u,function(Be){return"&"+l[Be]+";"})),te=te.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),te=te.replace(s,function(Be){return"&"+l[Be]+";"})):Pe||(te=te.replace(u,it)),te.replace(a,function(Be){var st=Be.charCodeAt(0),ct=Be.charCodeAt(1),ft=(st-55296)*1024+ct-56320+65536;return Ye(ft)}).replace(o,it)};L.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var j=function(te,ge){ge=T(ge,j.options);var he=ge.strict;return he&&f.test(te)&&N("malformed character reference"),te.replace(h,function(ue,xe,Pe,Ye,it,Be,st,ct,ft){var It,Yt,zt,V,B,pe;return xe?(B=xe,p[B]):Pe?(B=Pe,pe=Ye,pe&&ge.isAttributeValue?(he&&pe=="="&&N("`&` did not start a character reference"),ue):(he&&N("named character reference was not terminated by a semicolon"),m[B]+(pe||""))):it?(zt=it,Yt=Be,he&&!Yt&&N("character reference was not terminated by a semicolon"),It=parseInt(zt,10),S(It,he)):st?(V=st,Yt=ct,he&&!Yt&&N("character reference was not terminated by a semicolon"),It=parseInt(V,16),S(It,he)):(he&&N("named character reference was not terminated by a semicolon"),ue)})};j.options={isAttributeValue:!1,strict:!1};var X=function(te){return te.replace(u,function(ge){return c[ge]})},fe={version:"1.2.0",encode:L,decode:j,escape:X,unescape:j};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd)define(function(){return fe});else if(e&&!e.nodeType)if(t)t.exports=fe;else for(var ee in fe)k(fe,ee)&&(e[ee]=fe[ee]);else r.he=fe})(sc)});var cp=_t((_B,Qb)=>{"use strict";var I9=function(e){return F9(e)&&!Z9(e)};function F9(r){return!!r&&typeof r=="object"}function Z9(r){var e=Object.prototype.toString.call(r);return e==="[object RegExp]"||e==="[object Date]"||B9(r)}var q9=typeof Symbol=="function"&&Symbol.for,L9=q9?Symbol.for("react.element"):60103;function B9(r){return r.$$typeof===L9}function U9(r){return Array.isArray(r)?[]:{}}function ul(r,e){return e.clone!==!1&&e.isMergeableObject(r)?Lo(U9(r),r,e):r}function W9(r,e,t){return r.concat(e).map(function(n){return ul(n,t)})}function Y9(r,e){if(!e.customMerge)return Lo;var t=e.customMerge(r);return typeof t=="function"?t:Lo}function z9(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(e){return Object.propertyIsEnumerable.call(r,e)}):[]}function Mb(r){return Object.keys(r).concat(z9(r))}function Rb(r,e){try{return e in r}catch{return!1}}function V9(r,e){return Rb(r,e)&&!(Object.hasOwnProperty.call(r,e)&&Object.propertyIsEnumerable.call(r,e))}function j9(r,e,t){var n={};return t.isMergeableObject(r)&&Mb(r).forEach(function(a){n[a]=ul(r[a],t)}),Mb(e).forEach(function(a){V9(r,a)||(Rb(r,a)&&t.isMergeableObject(e[a])?n[a]=Y9(a,t)(r[a],e[a],t):n[a]=ul(e[a],t))}),n}function Lo(r,e,t){t=t||{},t.arrayMerge=t.arrayMerge||W9,t.isMergeableObject=t.isMergeableObject||I9,t.cloneUnlessOtherwiseSpecified=ul;var n=Array.isArray(e),a=Array.isArray(r),i=n===a;return i?n?t.arrayMerge(r,e,t):j9(r,e,t):ul(e,t)}Lo.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,a){return Lo(n,a,t)},{})};var X9=Lo;Qb.exports=X9});var Rp=_t((mY,Pv)=>{"use strict";var Pp=Object.defineProperty,y6=Object.getOwnPropertyDescriptor,b6=Object.getOwnPropertyNames,v6=Object.prototype.hasOwnProperty,O6=(r,e)=>{for(var t in e)Pp(r,t,{get:e[t],enumerable:!0})},_6=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of b6(e))!v6.call(r,a)&&a!==t&&Pp(r,a,{get:()=>e[a],enumerable:!(n=y6(e,a))||n.enumerable});return r},w6=r=>_6(Pp({},"__esModule",{value:!0}),r),Nv={};O6(Nv,{FileInputSuggest:()=>C6,FolderInputSuggest:()=>D6,FuzzyInputSuggest:()=>Mp,setNodeIcon:()=>x6});Pv.exports=w6(Nv);var Np=require("obsidian"),Mp=class extends Np.AbstractInputSuggest{constructor(r,e,t){super(r,e.inputEl),this.items=t}getSuggestions(r){let e=(0,Np.prepareSimpleSearch)(r),t=[];for(let n of this.items){let a=e(this.getItemText(n));a&&t.push({item:n,match:a})}return t}renderSuggestion(r,e){e.addClass("mod-complex");let t=e.createDiv({cls:"suggestion-content"});if(!r?.item){t.setText("No match found"),t.parentElement?.addClass("is-selected");return}let n=t.createDiv("suggestion-title");this.renderTitle(n,r);let a=t.createDiv("suggestion-note");this.renderNote(a,r)}renderMatches(r,e,t,n){(0,Np.renderMatches)(r,e,t,n)}},$v=require("obsidian"),D6=class extends Mp{getItemText(r){return r.path}renderNote(r,e){let{item:t,match:n}=e;(0,$v.renderMatches)(r,t.path,n.matches)}renderTitle(r,e){let{item:t,match:n}=e;(0,$v.renderMatches)(r,t.name,n.matches,t.path.length-t.name.length)}},Tv=require("obsidian"),C6=class extends Mp{getItemText(r){return r.path}renderNote(r,e){let{item:t,match:n}=e;(0,Tv.renderMatches)(r,t.path,n.matches)}renderTitle(r,e){let{item:t,match:n}=e;(0,Tv.renderMatches)(r,t.name,n.matches,t.path.length-t.name.length)}},k6=require("obsidian"),E6={"has-node-icon":"helpers_has-node-icon","x-small":"helpers_x-small",small:"helpers_small",medium:"helpers_medium",large:"helpers_large","x-large":"helpers_x-large"};function x6(r,e){r.addClass(E6["has-node-icon"]),(0,k6.setIcon)(r,e)}});var Fc=_t(($l,Tl)=>{(function(r,e){if(typeof $l=="object"){var t=e();typeof Tl=="object"&&Tl&&Tl.exports&&($l=Tl.exports=t),$l.randomColor=t}else typeof define=="function"&&define.amd?define([],e):r.randomColor=e()})($l,function(){var r=null,e={};m();var t=[],n=function(k){if(k=k||{},k.seed!==void 0&&k.seed!==null&&k.seed===parseInt(k.seed,10))r=k.seed;else if(typeof k.seed=="string")r=D(k.seed);else{if(k.seed!==void 0&&k.seed!==null)throw new TypeError("The seed value must be an integer or string");r=null}var w,T,S;if(k.count!==null&&k.count!==void 0){for(var M=k.count,Z=[],N=0;NZ.length;){var L=n(k);r!==null&&(k.seed=r),Z.push(L)}return k.count=M,Z}return w=a(k),T=i(w,k),S=o(w,T,k),s([w,T,S],k)};function a(k){if(t.length>0){var w=C(k.hue),T=d(w),S=(w[1]-w[0])/t.length,M=parseInt((T-w[0])/S);t[M]===!0?M=(M+2)%t.length:t[M]=!0;var Z=(w[0]+M*S)%359,N=(w[0]+(M+1)*S)%359;return w=[Z,N],T=d(w),T<0&&(T=360+T),T}else{var w=u(k.hue);return T=d(w),T<0&&(T=360+T),T}}function i(k,w){if(w.hue==="monochrome")return 0;if(w.luminosity==="random")return d([0,100]);var T=c(k),S=T[0],M=T[1];switch(w.luminosity){case"bright":S=55;break;case"dark":S=M-10;break;case"light":M=55;break}return d([S,M])}function o(k,w,T){var S=l(k,w),M=100;switch(T.luminosity){case"dark":M=S+20;break;case"light":S=(M+S)/2;break;case"random":S=0,M=100;break}return d([S,M])}function s(k,w){switch(w.format){case"hsvArray":return k;case"hslArray":return E(k);case"hsl":var T=E(k);return"hsl("+T[0]+", "+T[1]+"%, "+T[2]+"%)";case"hsla":var S=E(k),N=w.alpha||Math.random();return"hsla("+S[0]+", "+S[1]+"%, "+S[2]+"%, "+N+")";case"rgbArray":return O(k);case"rgb":var M=O(k);return"rgb("+M.join(", ")+")";case"rgba":var Z=O(k),N=w.alpha||Math.random();return"rgba("+Z.join(", ")+", "+N+")";default:return h(k)}}function l(k,w){for(var T=f(k).lowerBounds,S=0;S=M&&w<=N){var j=(L-Z)/(N-M),X=Z-j*M;return j*w+X}}return 0}function u(k){if(typeof parseInt(k)=="number"){var w=parseInt(k);if(w<360&&w>0)return[w,w]}if(typeof k=="string"){if(e[k]){var T=e[k];if(T.hueRange)return T.hueRange}else if(k.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){var S=b(k)[0];return[S,S]}}return[0,360]}function c(k){return f(k).saturationRange}function f(k){k>=334&&k<=360&&(k-=360);for(var w in e){var T=e[w];if(T.hueRange&&k>=T.hueRange[0]&&k<=T.hueRange[1])return e[w]}return"Color not found"}function d(k){if(r===null){var w=.618033988749895,T=Math.random();return T+=w,T%=1,Math.floor(k[0]+T*(k[1]+1-k[0]))}else{var S=k[1]||1,M=k[0]||0;r=(r*9301+49297)%233280;var Z=r/233280;return Math.floor(M+Z*(S-M))}}function h(k){var w=O(k);function T(M){var Z=M.toString(16);return Z.length==1?"0"+Z:Z}var S="#"+T(w[0])+T(w[1])+T(w[2]);return S}function p(k,w,T){var S=T[0][0],M=T[T.length-1][0],Z=T[T.length-1][1],N=T[0][1];e[k]={hueRange:w,lowerBounds:T,saturationRange:[S,M],brightnessRange:[Z,N]}}function m(){p("monochrome",null,[[0,0],[100,0]]),p("red",[-26,18],[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]),p("orange",[18,46],[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]),p("yellow",[46,62],[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]),p("green",[62,178],[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]),p("blue",[178,257],[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]),p("purple",[257,282],[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]),p("pink",[282,334],[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]])}function O(k){var w=k[0];w===0&&(w=1),w===360&&(w=359),w=w/360;var T=k[1]/100,S=k[2]/100,M=Math.floor(w*6),Z=w*6-M,N=S*(1-T),L=S*(1-Z*T),j=S*(1-(1-Z)*T),X=256,fe=256,ee=256;switch(M){case 0:X=S,fe=j,ee=N;break;case 1:X=L,fe=S,ee=N;break;case 2:X=N,fe=S,ee=j;break;case 3:X=N,fe=L,ee=S;break;case 4:X=j,fe=N,ee=S;break;case 5:X=S,fe=N,ee=L;break}var te=[Math.floor(X*255),Math.floor(fe*255),Math.floor(ee*255)];return te}function b(k){k=k.replace(/^#/,""),k=k.length===3?k.replace(/(.)/g,"$1$1"):k;var w=parseInt(k.substr(0,2),16)/255,T=parseInt(k.substr(2,2),16)/255,S=parseInt(k.substr(4,2),16)/255,M=Math.max(w,T,S),Z=M-Math.min(w,T,S),N=M?Z/M:0;switch(M){case w:return[60*((T-S)/Z%6)||0,N,M];case T:return[60*((S-w)/Z+2)||0,N,M];case S:return[60*((w-T)/Z+4)||0,N,M]}}function E(k){var w=k[0],T=k[1]/100,S=k[2]/100,M=(2-T)*S;return[w,Math.round(T*S/(M<1?M:2-M)*1e4)/100,M/2*100]}function D(k){for(var w=0,T=0;T!==k.length&&!(w>=Number.MAX_SAFE_INTEGER);T++)w+=k.charCodeAt(T);return w}function C(k){if(isNaN(k)){if(typeof k=="string"){if(e[k]){var T=e[k];if(T.hueRange)return T.hueRange}else if(k.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){var S=b(k)[0];return f(S).hueRange}}}else{var w=parseInt(k);if(w<360&&w>0)return f(k).hueRange}return[0,360]}return n})});var CO=_t(DO=>{DO.entityMap={lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",times:"\xD7",divide:"\xF7",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",euro:"\u20AC",trade:"\u2122",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"}});var NO=_t(nm=>{var rm=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,kO=new RegExp("[\\-\\.0-9"+rm.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),EO=new RegExp("^"+rm.source+kO.source+"*(?::"+rm.source+kO.source+"*)?$"),Pl=0,fi=1,ss=2,Ml=3,ls=4,us=5,Rl=6,Uc=7;function cs(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,cs)}cs.prototype=new Error;cs.prototype.name=cs.name;function AO(){}AO.prototype={parse:function(r,e,t){var n=this.domBuilder;n.startDocument(),$O(e,e={}),H7(r,e,t,n,this.errorHandler),n.endDocument()}};function H7(r,e,t,n,a){function i(ee){if(ee>65535){ee-=65536;var te=55296+(ee>>10),ge=56320+(ee&1023);return String.fromCharCode(te,ge)}else return String.fromCharCode(ee)}function o(ee){var te=ee.slice(1,-1);return te in t?t[te]:te.charAt(0)==="#"?i(parseInt(te.substr(1).replace("x","0x"))):(a.error("entity not found:"+ee),ee)}function s(ee){if(ee>m){var te=r.substring(m,ee).replace(/&#?\w+;/g,o);d&&l(m),n.characters(te,0,ee-m),m=ee}}function l(ee,te){for(;ee>=c&&(te=f.exec(r));)u=te.index,c=u+te[0].length,d.lineNumber++;d.columnNumber=ee-u+1}for(var u=0,c=0,f=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,h=[{currentNSMap:e}],p={},m=0;;){try{var O=r.indexOf("<",m);if(O<0){if(!r.substr(m).match(/^\s*$/)){var b=n.doc,E=b.createTextNode(r.substr(m));b.appendChild(E),n.currentElement=E}return}switch(O>m&&s(O),r.charAt(O+1)){case"/":var N=r.indexOf(">",O+3),D=r.substring(O+2,N),C=h.pop();N<0?(D=r.substring(O+2).replace(/[\s<].*/,""),a.error("end tag name: "+D+" is not complete:"+C.tagName),N=O+1+D.length):D.match(/\sm?m=N:s(Math.max(O,m)+1)}}function xO(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function K7(r,e,t,n,a,i){function o(h,p,m){h in t.attributeNames&&i.fatalError("Attribute "+h+" redefined"),t.addValue(h,p,m)}for(var s,l,u=++e,c=Pl;;){var f=r.charAt(u);switch(f){case"=":if(c===fi)s=r.slice(e,u),c=Ml;else if(c===ss)c=Ml;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(c===Ml||c===fi)if(c===fi&&(i.warning('attribute value must after "="'),s=r.slice(e,u)),e=u+1,u=r.indexOf(f,e),u>0)l=r.slice(e,u).replace(/&#?\w+;/g,a),o(s,l,e-1),c=us;else throw new Error("attribute value no end '"+f+"' match");else if(c==ls)l=r.slice(e,u).replace(/&#?\w+;/g,a),o(s,l,e),i.warning('attribute "'+s+'" missed start quot('+f+")!!"),e=u+1,c=us;else throw new Error('attribute value must after "="');break;case"/":switch(c){case Pl:t.setTagName(r.slice(e,u));case us:case Rl:case Uc:c=Uc,t.closed=!0;case ls:case fi:case ss:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),c==Pl&&t.setTagName(r.slice(e,u)),u;case">":switch(c){case Pl:t.setTagName(r.slice(e,u));case us:case Rl:case Uc:break;case ls:case fi:l=r.slice(e,u),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case ss:c===ss&&(l=s),c==ls?(i.warning('attribute "'+l+'" missed quot(")!'),o(s,l.replace(/&#?\w+;/g,a),e)):((n[""]!=="http://www.w3.org/1999/xhtml"||!l.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),o(l,l,e));break;case Ml:throw new Error("attribute value missed!!")}return u;case"\x80":f=" ";default:if(f<=" ")switch(c){case Pl:t.setTagName(r.slice(e,u)),c=Rl;break;case fi:s=r.slice(e,u),c=ss;break;case ls:var l=r.slice(e,u).replace(/&#?\w+;/g,a);i.warning('attribute "'+l+'" missed quot(")!!'),o(s,l,e);case us:c=Rl;break}else switch(c){case ss:var d=t.tagName;(n[""]!=="http://www.w3.org/1999/xhtml"||!s.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),o(s,s,e),e=u,c=fi;break;case us:i.warning('attribute space is required"'+s+'"!!');case Rl:c=fi,e=u;break;case Ml:c=ls,e=u;break;case Uc:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function SO(r,e,t){for(var n=r.tagName,a=null,f=r.length;f--;){var i=r[f],o=i.qName,s=i.value,d=o.indexOf(":");if(d>0)var l=i.prefix=o.slice(0,d),u=o.slice(d+1),c=l==="xmlns"&&u;else u=o,l=null,c=o==="xmlns"&&"";i.localName=u,c!==!1&&(a==null&&(a={},$O(t,t={})),t[c]=a[c]=s,i.uri="http://www.w3.org/2000/xmlns/",e.startPrefixMapping(c,s))}for(var f=r.length;f--;){i=r[f];var l=i.prefix;l&&(l==="xml"&&(i.uri="http://www.w3.org/XML/1998/namespace"),l!=="xmlns"&&(i.uri=t[l||""]))}var d=n.indexOf(":");d>0?(l=r.prefix=n.slice(0,d),u=r.localName=n.slice(d+1)):(l=null,u=r.localName=n);var h=r.uri=t[l||""];if(e.startElement(h,u,n,r),r.closed){if(e.endElement(h,u,n),a)for(l in a)e.endPrefixMapping(l)}else return r.currentNSMap=t,r.localNSMap=a,!0}function J7(r,e,t,n,a){if(/^(?:script|textarea)$/i.test(t)){var i=r.indexOf("",e),o=r.substring(e+1,i);if(/[&<]/.test(o))return/^script$/i.test(t)?(a.characters(o,0,o.length),i):(o=o.replace(/&#?\w+;/g,n),a.characters(o,0,o.length),i)}return e+1}function e$(r,e,t,n){var a=n[t];return a==null&&(a=r.lastIndexOf(""),a",e+4);return i>e?(t.comment(r,e+4,i-e-4),i+3):(n.error("Unclosed comment"),-1)}else return-1;default:if(r.substr(e+3,6)=="CDATA["){var i=r.indexOf("]]>",e+9);return t.startCDATA(),t.characters(r,e+9,i-e-9),t.endCDATA(),i+3}var o=n$(r,e),s=o.length;if(s>1&&/!doctype/i.test(o[0][0])){var l=o[1][0],u=!1,c=!1;s>3&&(/^public$/i.test(o[2][0])?(u=o[3][0],c=s>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var f=o[s-1];return t.startDTD(l,u,c),t.endDTD(),f.index+f[0].length}}return-1}function r$(r,e,t){var n=r.indexOf("?>",e);if(n){var a=r.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(a){var i=a[0].length;return t.processingInstruction(a[1],a[2]),n+2}else return-1}return-1}function TO(){this.attributeNames={}}TO.prototype={setTagName:function(r){if(!EO.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},addValue:function(r,e,t){if(!EO.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t}},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function n$(r,e){var t,n=[],a=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(a.lastIndex=e,a.exec(r);t=a.exec(r);)if(n.push(t),t[1])return n}nm.XMLReader=AO;nm.ParseError=cs});var hm=_t(ql=>{function Il(r,e){for(var t in r)e[t]=r[t]}function yn(r,e){var t=r.prototype;if(!(t instanceof e)){let a=function(){};var n=a;a.prototype=e.prototype,a=new a,Il(t,a),r.prototype=t=a}t.constructor!=r&&(typeof r!="function"&&console.error("unknow Class:"+r),t.constructor=r)}var a$="http://www.w3.org/1999/xhtml",bn={},Kn=bn.ELEMENT_NODE=1,ds=bn.ATTRIBUTE_NODE=2,Wc=bn.TEXT_NODE=3,FO=bn.CDATA_SECTION_NODE=4,ZO=bn.ENTITY_REFERENCE_NODE=5,i$=bn.ENTITY_NODE=6,qO=bn.PROCESSING_INSTRUCTION_NODE=7,LO=bn.COMMENT_NODE=8,BO=bn.DOCUMENT_NODE=9,UO=bn.DOCUMENT_TYPE_NODE=10,Ba=bn.DOCUMENT_FRAGMENT_NODE=11,o$=bn.NOTATION_NODE=12,en={},Tr={},$V=en.INDEX_SIZE_ERR=(Tr[1]="Index size error",1),TV=en.DOMSTRING_SIZE_ERR=(Tr[2]="DOMString size error",2),s$=en.HIERARCHY_REQUEST_ERR=(Tr[3]="Hierarchy request error",3),NV=en.WRONG_DOCUMENT_ERR=(Tr[4]="Wrong document",4),PV=en.INVALID_CHARACTER_ERR=(Tr[5]="Invalid character",5),MV=en.NO_DATA_ALLOWED_ERR=(Tr[6]="No data allowed",6),RV=en.NO_MODIFICATION_ALLOWED_ERR=(Tr[7]="No modification allowed",7),l$=en.NOT_FOUND_ERR=(Tr[8]="Not found",8),QV=en.NOT_SUPPORTED_ERR=(Tr[9]="Not supported",9),PO=en.INUSE_ATTRIBUTE_ERR=(Tr[10]="Attribute in use",10),IV=en.INVALID_STATE_ERR=(Tr[11]="Invalid state",11),FV=en.SYNTAX_ERR=(Tr[12]="Syntax error",12),ZV=en.INVALID_MODIFICATION_ERR=(Tr[13]="Invalid modification",13),qV=en.NAMESPACE_ERR=(Tr[14]="Invalid namespace",14),LV=en.INVALID_ACCESS_ERR=(Tr[15]="Invalid access",15);function Vi(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,Tr[r]),this.message=Tr[r],Error.captureStackTrace&&Error.captureStackTrace(this,Vi);return t.code=r,e&&(this.message=this.message+": "+e),t}Vi.prototype=Error.prototype;Il(en,Vi);function di(){}di.prototype={length:0,item:function(r){return this[r]||null},toString:function(r,e){for(var t=[],n=0;n=0){for(var a=e.length-1;n0},lookupPrefix:function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var n in t)if(t[n]==r)return n}e=e.nodeType==ds?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(r){for(var e=this;e;){var t=e._nsMap;if(t&&r in t)return t[r];e=e.nodeType==ds?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(r){var e=this.lookupPrefix(r);return e==null}};function QO(r){return r=="<"&&"<"||r==">"&&">"||r=="&"&&"&"||r=='"'&&"""||"&#"+r.charCodeAt()+";"}Il(bn,tn);Il(bn,tn.prototype);function Ql(r,e){if(e(r))return!0;if(r=r.firstChild)do if(Ql(r,e))return!0;while(r=r.nextSibling)}function Fl(){}function u$(r,e,t){r&&r._inc++;var n=t.namespaceURI;n=="http://www.w3.org/2000/xmlns/"&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function zO(r,e,t,n){r&&r._inc++;var a=t.namespaceURI;a=="http://www.w3.org/2000/xmlns/"&&delete e._nsMap[t.prefix?t.localName:""]}function om(r,e,t){if(r&&r._inc){r._inc++;var n=e.childNodes;if(t)n[n.length++]=t;else{for(var a=e.firstChild,i=0;a;)n[i++]=a,a=a.nextSibling;n.length=i}}}function VO(r,e){var t=e.previousSibling,n=e.nextSibling;return t?t.nextSibling=n:r.firstChild=n,n?n.previousSibling=t:r.lastChild=t,om(r.ownerDocument,r),e}function jO(r,e,t){var n=e.parentNode;if(n&&n.removeChild(e),e.nodeType===Ba){var a=e.firstChild;if(a==null)return e;var i=e.lastChild}else a=i=e;var o=t?t.previousSibling:r.lastChild;a.previousSibling=o,i.nextSibling=t,o?o.nextSibling=a:r.firstChild=a,t==null?r.lastChild=i:t.previousSibling=i;do a.parentNode=r;while(a!==i&&(a=a.nextSibling));return om(r.ownerDocument||r,r),e.nodeType==Ba&&(e.firstChild=e.lastChild=null),e}function c$(r,e){var t=e.parentNode;if(t){var n=r.lastChild;t.removeChild(e);var n=r.lastChild}var n=r.lastChild;return e.parentNode=r,e.previousSibling=n,e.nextSibling=null,n?n.nextSibling=e:r.firstChild=e,r.lastChild=e,om(r.ownerDocument,r,e),e}Fl.prototype={nodeName:"#document",nodeType:BO,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType==Ba){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return this.documentElement==null&&r.nodeType==Kn&&(this.documentElement=r),jO(this,r,e),r.ownerDocument=this,r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),VO(this,r)},importNode:function(r,e){return JO(this,r,e)},getElementById:function(r){var e=null;return Ql(this.documentElement,function(t){if(t.nodeType==Kn&&t.getAttribute("id")==r)return e=t,!0}),e},getElementsByClassName:function(r){var e=new RegExp("(^|\\s)"+r+"(\\s|$)");return new hs(this,function(t){var n=[];return Ql(t.documentElement,function(a){a!==t&&a.nodeType==Kn&&e.test(a.getAttribute("class"))&&n.push(a)}),n})},createElement:function(r){var e=new ps;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.childNodes=new di;var t=e.attributes=new Yc;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new Vc;return r.ownerDocument=this,r.childNodes=new di,r},createTextNode:function(r){var e=new sm;return e.ownerDocument=this,e.appendData(r),e},createComment:function(r){var e=new lm;return e.ownerDocument=this,e.appendData(r),e},createCDATASection:function(r){var e=new um;return e.ownerDocument=this,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new dm;return t.ownerDocument=this,t.tagName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){var e=new zc;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},createEntityReference:function(r){var e=new fm;return e.ownerDocument=this,e.nodeName=r,e},createElementNS:function(r,e){var t=new ps,n=e.split(":"),a=t.attributes=new Yc;return t.childNodes=new di,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=r,n.length==2?(t.prefix=n[0],t.localName=n[1]):t.localName=e,a._ownerElement=t,t},createAttributeNS:function(r,e){var t=new zc,n=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=r,t.specified=!0,n.length==2?(t.prefix=n[0],t.localName=n[1]):t.localName=e,t}};yn(Fl,tn);function ps(){this._nsMap={}}ps.prototype={nodeType:Kn,hasAttribute:function(r){return this.getAttributeNode(r)!=null},getAttribute:function(r){var e=this.getAttributeNode(r);return e&&e.value||""},getAttributeNode:function(r){return this.attributes.getNamedItem(r)},setAttribute:function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},appendChild:function(r){return r.nodeType===Ba?this.insertBefore(r,null):c$(this,r)},setAttributeNode:function(r){return this.attributes.setNamedItem(r)},setAttributeNodeNS:function(r){return this.attributes.setNamedItemNS(r)},removeAttributeNode:function(r){return this.attributes.removeNamedItem(r.nodeName)},removeAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(r,e){return this.getAttributeNodeNS(r,e)!=null},getAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},setAttributeNS:function(r,e,t){var n=this.ownerDocument.createAttributeNS(r,e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},getAttributeNodeNS:function(r,e){return this.attributes.getNamedItemNS(r,e)},getElementsByTagName:function(r){return new hs(this,function(e){var t=[];return Ql(e,function(n){n!==e&&n.nodeType==Kn&&(r==="*"||n.tagName==r)&&t.push(n)}),t})},getElementsByTagNameNS:function(r,e){return new hs(this,function(t){var n=[];return Ql(t,function(a){a!==t&&a.nodeType===Kn&&(r==="*"||a.namespaceURI===r)&&(e==="*"||a.localName==e)&&n.push(a)}),n})}};Fl.prototype.getElementsByTagName=ps.prototype.getElementsByTagName;Fl.prototype.getElementsByTagNameNS=ps.prototype.getElementsByTagNameNS;yn(ps,tn);function zc(){}zc.prototype.nodeType=ds;yn(zc,tn);function Zl(){}Zl.prototype={data:"",substringData:function(r,e){return this.data.substring(r,r+e)},appendData:function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},insertData:function(r,e){this.replaceData(r,0,e)},appendChild:function(r){throw new Error(Tr[s$])},deleteData:function(r,e){this.replaceData(r,e,"")},replaceData:function(r,e,t){var n=this.data.substring(0,r),a=this.data.substring(r+e);t=n+t+a,this.nodeValue=this.data=t,this.length=t.length}};yn(Zl,tn);function sm(){}sm.prototype={nodeName:"#text",nodeType:Wc,splitText:function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};yn(sm,Zl);function lm(){}lm.prototype={nodeName:"#comment",nodeType:LO};yn(lm,Zl);function um(){}um.prototype={nodeName:"#cdata-section",nodeType:FO};yn(um,Zl);function cm(){}cm.prototype.nodeType=UO;yn(cm,tn);function XO(){}XO.prototype.nodeType=o$;yn(XO,tn);function GO(){}GO.prototype.nodeType=i$;yn(GO,tn);function fm(){}fm.prototype.nodeType=ZO;yn(fm,tn);function Vc(){}Vc.prototype.nodeName="#document-fragment";Vc.prototype.nodeType=Ba;yn(Vc,tn);function dm(){}dm.prototype.nodeType=qO;yn(dm,tn);function HO(){}HO.prototype.serializeToString=function(r,e,t){return KO.call(r,e,t)};tn.prototype.toString=KO;function KO(r,e){var t=[],n=this.nodeType==9&&this.documentElement||this,a=n.prefix,i=n.namespaceURI;if(i&&a==null){var a=n.lookupPrefix(i);if(a==null)var o=[{namespace:i,prefix:null}]}return fs(this,t,r,e,o),t.join("")}function IO(r,e,t){var n=r.prefix||"",a=r.namespaceURI;if(!n&&!a||n==="xml"&&a==="http://www.w3.org/XML/1998/namespace"||a=="http://www.w3.org/2000/xmlns/")return!1;for(var i=t.length;i--;){var o=t[i];if(o.prefix==n)return o.namespace!=a}return!0}function fs(r,e,t,n,a){if(n)if(r=n(r),r){if(typeof r=="string"){e.push(r);return}}else return;switch(r.nodeType){case Kn:a||(a=[]);var i=a.length,o=r.attributes,s=o.length,p=r.firstChild,l=r.tagName;t=a$===r.namespaceURI||t,e.push("<",l);for(var u=0;u"),t&&/^script$/i.test(l))for(;p;)p.data?e.push(p.data):fs(p,e,t,n,a),p=p.nextSibling;else for(;p;)fs(p,e,t,n,a),p=p.nextSibling;e.push("")}else e.push("/>");return;case BO:case Ba:for(var p=r.firstChild;p;)fs(p,e,t,n,a),p=p.nextSibling;return;case ds:return e.push(" ",r.name,'="',r.value.replace(/[<&"]/g,QO),'"');case Wc:return e.push(r.data.replace(/[<&]/g,QO).replace(/]]>/g,"]]>"));case FO:return e.push("");case LO:return e.push("");case UO:var m=r.publicId,O=r.systemId;if(e.push("");else if(O&&O!=".")e.push(" SYSTEM ",O,">");else{var b=r.internalSubset;b&&e.push(" [",b,"]"),e.push(">")}return;case qO:return e.push("");case ZO:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName)}}function JO(r,e,t){var n;switch(e.nodeType){case Kn:n=e.cloneNode(!1),n.ownerDocument=r;case Ba:break;case ds:t=!0;break}if(n||(n=e.cloneNode(!1)),n.ownerDocument=r,n.parentNode=null,t)for(var a=e.firstChild;a;)n.appendChild(JO(r,a,t)),a=a.nextSibling;return n}function am(r,e,t){var n=new e.constructor;for(var a in e){var i=e[a];typeof i!="object"&&i!=n[a]&&(n[a]=i)}switch(e.childNodes&&(n.childNodes=new di),n.ownerDocument=r,n.nodeType){case Kn:var o=e.attributes,s=n.attributes=new Yc,l=o.length;s._ownerElement=n;for(var u=0;u{function r_(r){this.options=r||{locator:{}}}r_.prototype.parseFromString=function(r,e){var t=this.options,n=new p$,a=t.domBuilder||new Ll,i=t.errorHandler,o=t.locator,s=t.xmlns||{},l=/\/x?html?$/.test(e),u=l?h$.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return o&&a.setDocumentLocator(o),n.errorHandler=d$(i,a,o),n.domBuilder=t.domBuilder||a,l&&(s[""]="http://www.w3.org/1999/xhtml"),s.xml=s.xml||"http://www.w3.org/XML/1998/namespace",r&&typeof r=="string"?n.parse(r,s,u):n.errorHandler.error("invalid doc source"),a.doc};function d$(r,e,t){if(!r){if(e instanceof Ll)return e;r=e}var n={},a=r instanceof Function;t=t||{};function i(o){var s=r[o];!s&&a&&(s=r.length==2?function(l){r(o,l)}:r),n[o]=s&&function(l){s("[xmldom "+o+"] "+l+pm(t))}||function(){}}return i("warning"),i("error"),i("fatalError"),n}function Ll(){this.cdata=!1}function ms(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}Ll.prototype={startDocument:function(){this.doc=new g$().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(r,e,t,n){var a=this.doc,i=a.createElementNS(r,t||e),o=n.length;jc(this,i),this.currentElement=i,this.locator&&ms(this.locator,i);for(var s=0;s=e+t||e?new java.lang.String(r,e,t)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){Ll.prototype[r]=function(){return null}});function jc(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}var h$=CO(),n_=NO(),p$=n_.XMLReader,m$=n_.ParseError,g$=Bl.DOMImplementation=hm().DOMImplementation;Bl.XMLSerializer=hm().XMLSerializer;Bl.DOMParser=r_;Bl.__DOMHandler=Ll});var Xc=_t(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.isNone=vn.isSome=vn.None=vn.Some=vn.OptionType=void 0;vn.OptionType={Some:Symbol(":some"),None:Symbol(":none")};function y$(r){return typeof r>"u"?Ul():i_(r)}vn.Some=y$;vn.None=Ul();function i_(r){return{type:vn.OptionType.Some,isSome(){return!0},isNone(){return!1},match(e){return e.some(r)},map(e){return i_(e(r))},andThen(e){return e(r)},or(e){return this},and(e){return e},unwrapOr(e){return r},unwrap(){return r}}}function Ul(){return{type:vn.OptionType.None,isSome(){return!1},isNone(){return!0},match(r){let{none:e}=r;return typeof e=="function"?e():e},map(r){return Ul()},andThen(r){return Ul()},or(r){return r},and(r){return Ul()},unwrapOr(r){if(r==null)throw new Error("Cannot call unwrapOr with a missing value.");return r},unwrap(){throw new ReferenceError("Trying to unwrap None.")}}}function b$(r){return r.isSome()}vn.isSome=b$;function v$(r){return r.isNone()}vn.isNone=v$});var o_=_t(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.isRight=On.isLeft=On.Right=On.Left=On.EitherType=void 0;var Gc=Xc();On.EitherType={Left:Symbol(":left"),Right:Symbol(":right")};function Wl(r){return{type:On.EitherType.Left,isLeft(){return!0},isRight(){return!1},left(){return(0,Gc.Some)(r)},leftAndThen(e){return e(r)},right(){return Gc.None},rightAndThen(e){return Wl(r)},unwrap(){return r},unwrapLeft(){return r},unwrapLeftOr(e){return r},unwrapLeftOrElse(e){return r},unwrapRight(){throw new ReferenceError("Cannot unwrap Right value of Either.Left")},unwrapRightOr(e){return e},unwrapRightOrElse(e){return e(r)},match(e){return e.left(r)},map(e){return Wl(e(r))},mapLeft(e){return Wl(e(r))},mapRight(e){return Wl(r)}}}On.Left=Wl;function Yl(r){return{type:On.EitherType.Right,isLeft(){return!1},isRight(){return!0},left(){return Gc.None},leftAndThen(e){return Yl(r)},right(){return(0,Gc.Some)(r)},rightAndThen(e){return e(r)},unwrap(){return r},unwrapLeft(){throw new ReferenceError("Cannot unwrap Left value of Either.Right")},unwrapLeftOr(e){return e},unwrapLeftOrElse(e){return e(r)},unwrapRight(){return r},unwrapRightOr(e){return r},unwrapRightOrElse(e){return r},match(e){return e.right(r)},map(e){return Yl(e(r))},mapLeft(e){return Yl(r)},mapRight(e){return Yl(e(r))}}}On.Right=Yl;function O$(r){return r.isLeft()}On.isLeft=O$;function _$(r){return r.isRight()}On.isRight=_$});var s_=_t(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.isErr=_n.isOk=_n.Err=_n.Ok=_n.ResultType=void 0;var Jc=Xc();_n.ResultType={Ok:Symbol(":ok"),Err:Symbol(":err")};function Hc(r){return{type:_n.ResultType.Ok,isOk(){return!0},isErr(){return!1},ok(){return(0,Jc.Some)(r)},err(){return Jc.None},unwrap(){return r},unwrapOr(e){return r},unwrapOrElse(e){return r},unwrapErr(){throw new ReferenceError("Cannot unwrap Err value of Result.Ok")},match(e){return e.ok(r)},map(e){return Hc(e(r))},mapErr(e){return Hc(r)},andThen(e){return e(r)},orElse(e){return Hc(r)}}}_n.Ok=Hc;function Kc(r){return{type:_n.ResultType.Err,isOk(){return!1},isErr(){return!0},ok(){return Jc.None},err(){return(0,Jc.Some)(r)},unwrap(){throw new ReferenceError("Cannot unwrap Ok value of Result.Err")},unwrapOr(e){return e},unwrapOrElse(e){return e(r)},unwrapErr(){return r},match(e){return e.err(r)},map(e){return Kc(r)},mapErr(e){return Kc(e(r))},andThen(e){return Kc(r)},orElse(e){return e(r)}}}_n.Err=Kc;function w$(r){return r.isOk()}_n.isOk=w$;function D$(r){return r.isErr()}_n.isErr=D$});var l_=_t(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.Ok=Ht.isOk=Ht.isErr=Ht.Err=Ht.Some=Ht.None=Ht.isSome=Ht.isNone=Ht.Right=Ht.Left=Ht.isRight=Ht.isLeft=void 0;var ef=o_();Object.defineProperty(Ht,"isLeft",{enumerable:!0,get:function(){return ef.isLeft}});Object.defineProperty(Ht,"isRight",{enumerable:!0,get:function(){return ef.isRight}});Object.defineProperty(Ht,"Left",{enumerable:!0,get:function(){return ef.Left}});Object.defineProperty(Ht,"Right",{enumerable:!0,get:function(){return ef.Right}});var tf=Xc();Object.defineProperty(Ht,"isNone",{enumerable:!0,get:function(){return tf.isNone}});Object.defineProperty(Ht,"isSome",{enumerable:!0,get:function(){return tf.isSome}});Object.defineProperty(Ht,"None",{enumerable:!0,get:function(){return tf.None}});Object.defineProperty(Ht,"Some",{enumerable:!0,get:function(){return tf.Some}});var rf=s_();Object.defineProperty(Ht,"Err",{enumerable:!0,get:function(){return rf.Err}});Object.defineProperty(Ht,"isErr",{enumerable:!0,get:function(){return rf.isErr}});Object.defineProperty(Ht,"isOk",{enumerable:!0,get:function(){return rf.isOk}});Object.defineProperty(Ht,"Ok",{enumerable:!0,get:function(){return rf.Ok}})});var jL={};ZS(jL,{MODIFIER_KEY:()=>VL,default:()=>Oh});module.exports=qS(jL);var Eo=require("obsidian");var Ke=require("obsidian");var LS=Function.prototype.toString,Xh=Object.create,BS=Object.prototype.toString,US=function(){function r(){this._keys=[],this._values=[]}return r.prototype.has=function(e){return!!~this._keys.indexOf(e)},r.prototype.get=function(e){return this._values[this._keys.indexOf(e)]},r.prototype.set=function(e,t){this._keys.push(e),this._values.push(t)},r}();function WS(){return new US}function YS(){return new WeakMap}var zS=typeof WeakMap<"u"?YS:WS;function Hh(r){if(!r)return Xh(null);var e=r.constructor;if(e===Object)return r===Object.prototype?{}:Xh(r);if(~LS.call(e).indexOf("[native code]"))try{return new e}catch{}return Xh(r)}function VS(r){var e="";return r.global&&(e+="g"),r.ignoreCase&&(e+="i"),r.multiline&&(e+="m"),r.unicode&&(e+="u"),r.sticky&&(e+="y"),e}function jS(r){return r.flags}var XS=/test/g.flags==="g"?jS:VS;function Sy(r){var e=BS.call(r);return e.substring(8,e.length-1)}function GS(r){return r[Symbol.toStringTag]||Sy(r)}var HS=typeof Symbol<"u"?GS:Sy,KS=Object.defineProperty,JS=Object.getOwnPropertyDescriptor,Ay=Object.getOwnPropertyNames,Kh=Object.getOwnPropertySymbols,$y=Object.prototype,Ty=$y.hasOwnProperty,eA=$y.propertyIsEnumerable,Ny=typeof Kh=="function";function tA(r){return Ay(r).concat(Kh(r))}var rA=Ny?tA:Ay;function Hu(r,e,t){for(var n=rA(r),a=0,i=n.length,o=void 0,s=void 0;a(a.interval??Number.MIN_VALUE)-(i.interval??Number.MIN_VALUE)),t=[];for(let a of e){if(a.interval==null)continue;let i=a.interval,o=r.offset&&!a.ignore?` (offset by ${r.offset})`:"";if(a.exclusive)i==1?t.push(`not every year${o}`):t.push(`not every ${da(i)} year${o}`);else{let s=e.indexOf(a),l=s>0&&e[s-1].exclusive;i==1?t.push(`${l?"also ":""}every year${o}`):t.push(`${l?"also ":""}every ${da(i)} year${o}`)}}let n=t.join(", but ");return n[0].toUpperCase()+n.slice(1).toLowerCase()}function da(r){let e=r%10,t=r%100;return e==1&&t!=11?r+"st":e==2&&t!=12?r+"nd":e==3&&t!=13?r+"rd":r+"th"}function G9(r){return Array.isArray(r)?r.every(e=>e==null)?"every year":r[0]===null?`every year until ${r[1]}`:r[1]===null?`every year starting ${r[0]}`:`${r[0]}-${r[1]}`:`${r}`}function H9(r,e){if(!Array.isArray(r))return`${e[r].name}`;if(r[0]==null&&r[1]==null)return"every month";let t=r[0]===null?0:r[0],n=r[1]===null?e.length-1:r[1];return`${e[t].name}-${e[n].name}`}function K9(r){return Array.isArray(r)?r[0]==null&&r[1]==null?"every day":r[0]==null&&r[1]!=null?`every day until ${r[1]}`:r[1]==null&&r[0]!=null?`every day after ${r[0]}`:r[0]==null||r[1]==null?"":`${da(r[0])}\u2014${da(r[1])}`:da(r)}function hp(r,e){switch(r.type){case U.Recurring:{let{year:t,month:n,day:a}=r.date,{months:i,years:o,useCustomYears:s}=e.static;if(s&&o?.length){for(let u of[t].flat())if(u&&(u<0||u>o.length))return`Invalid custom year (${u})`}let l=`${K9(a)} of ${H9(n,i)}, ${G9(t)}`;return l[0].toUpperCase()+l.slice(1)}case U.Range:return Fr(r.date,e,r.end);case U.Undated:return"No date";case U.Date:default:return Fr(r.date,e)}}function Fr(r,e,t,n){if(!r||r.day==null)return"";n||(n=e.dateFormat||Ra);let{day:a,month:i,year:o}=r,{months:s,years:l,useCustomYears:u}=e.static,c=`${o}`;if(u&&l?.length&&o){if(o<0||o>=l.length)return`Invalid custom year (${o})`;c=l[o-1]?.name??c}if(i!=null&&!s[i])return"Invalid date";let f=i==null?void 0:s[i].name,d=da(a);if(t&&t.day){let h=t.day,p=t.month,m=t.year,O=`${m}`;u&&l?.length&&m&&(O=l[m-1]?.name??O);let b=p==null?p:s[p].name,E=da(h);if(i!=null&&p!=null&&o!=null&&o!=m){let D=dp(e,n,c,r),C=dp(e,n,O,t);return`${D} \u2014 ${C}`}return i!=null&&p!=null&&o!=null&&p!=i?`${f} ${d} \u2014 ${b} ${E}, ${c}`:i!=null&&p!=null&&o!=null?`${f} ${d}\u2014${E}, ${c}`:i!=null&&p!=null&&p!=i?`${f} ${d} \u2014 ${b} ${E} of every year`:i!=null&&p!=null?`${f} ${d}\u2014${E} of every year`:`${d}\u2014${E} of every month`}return i!=null&&o!=null?dp(e,n,c,r):i!=null?`${f} ${d} of every year`:`${d} of every month`}function dp(r,e,t,n){let a=e.replace(/[Yy]+/g,"\u{1F0A1}").replace(/[Mm]{4,}/g,"\u{1F0A2}").replace(/[Mm]{3,}/g,"\u{1F0A3}").replace(/[Mm]{2,}/g,"\u{1F0A4}").replace(/[Mm]/g,"\u{1F0A5}").replace(/[Dd]{2,}/g,"\u{1F0A6}").replace(/[Dd]/g,"\u{1F0A7}");if(a.match(/🂢|🂣/g)&&r.static.months[n.month].type=="intercalary")if(r.static.months[n.month].length==1&&n.day==1)a=a.replace(/^🂦|🂧[ -]/g,"").replace(/[ -]🂦|🂧/g,"");else{let i=r.static.leapDays.find(o=>o.timespan==n.month);i&&lc(i,n.year)&&(a=a.replace("\u{1F0A2}",i.name??"").replace("\u{1F0A3}",qb(i.short??"",i.name??"")).replace(/^🂦|🂧[ -]/g,"").replace(/[ -]🂦|🂧/g,""))}return a.replace("\u{1F0A1}",`${t}`).replace("\u{1F0A2}",J9(n.month,r)).replace("\u{1F0A3}",e6(n.month,r)).replace("\u{1F0A4}",Li(n.month+1,r,"month")).replace("\u{1F0A5}",`${n.month+1}`).replace("\u{1F0A6}",Li(n.day,r,"day")).replace("\u{1F0A7}",`${n.day}`).trim()}function qb(r,e){return r||e.slice(0,3)}function J9(r,e){return r==null?"*":e.static.months[r]?.name??"*"}function e6(r,e){return r==null?"*":qb(e.static.months[r].short??"",e.static.months[r].name??"")}function Li(r,e,t){let n=t=="month"?e.static.padMonths:e.static.padDays;return r==null?"*":String(r).padStart(n??0,"0")}function Wo(r,e){if(r===null)return!1;let{day:t,month:n,year:a}=r;return!(t==null||n==null||t<1||t<1||t>e?.static?.months[n]?.length||!e?.static?.months[n]?.length)}function Yo(r,e){return!(r==null||!e?.static?.months?.length||r<0||r>=e?.static?.months?.length)}function zo(r,e){return!(r==null||e?.static?.useCustomYears&&(!e?.static?.years?.length||r<0||r>e?.static?.years?.length))}function Bi(r){let e=0;for(let t of r.static.months)t.interval>0&&(e+=t.length/t.interval);for(let t of r.static.leapDays)for(let n of t.interval)e+=(n.exclusive?-1:1)/n.interval;return e}function lc(r,e){return r.interval.sort((t,n)=>(t.interval??Number.MIN_VALUE)-(n.interval??Number.MIN_VALUE)).some(({interval:t,exclusive:n},a,i)=>{if(t==null)return!1;if(n&&a==0)return(e-(r.offset??0))%t!=0;if(!n)return i[a+1]&&i[a+1].exclusive?(e-(r.offset??0))%t==0&&(e-(r.offset??0))%(i[a+1].interval??0)!=0:(e-(r.offset??0))%t==0})}function ai(r){return Array.isArray(r)?Number.MIN_VALUE:r??Number.MIN_VALUE}function Uo(r,e){return ai(r)!=ai(e)}function pp(r,e){return r.sort&&e.sort?r.sort.timestamp==e.sort.timestamp?r.sort.order.localeCompare(e.sort.order):r.sort.timestamp-e.sort.timestamp:r.type!==U.Undated&&e.type===U.Undated?Number.POSITIVE_INFINITY:r.type===U.Undated&&e.type!==U.Undated?Number.NEGATIVE_INFINITY:r.type===U.Undated||e.type===U.Undated?0:fl(r.date,e.date)}function fl(r,e){return Uo(r.year,e.year)?ai(r.year)-ai(e.year):Uo(r.month,e.month)?ai(r.month)-ai(e.month):ai(r.day)-ai(e.day)}function ii(r){return r.sort((e,t)=>pp(e,t))}function Vo(r){return r.abbreviation?r.abbreviation:(r.name??"").slice(0,3)}function mp(r,e){return r.isStartingEra?e:e-r.date.year+1}function oi(r,e){if(!e||typeof e!="number"||!r.format?.length)return r.name;let t=mp(r,e);return r.format.replace("{{year}}",`${e}`).replace("{{abs_year}}",`${Math.abs(e)}`).replace("{{nth_year}}",`${da(e)}`).replace("{{abs_nth_year}}",`${da(Math.abs(e))}`).replace("{{era_year}}",`${t}`).replace("{{era_nth_year}}",`${da(t)}`).replace("{{era_name}}",`${r.name}`)}function t6(r,e){let t=Math.abs(r);if(t==1)return 0;let n=r<0?t:t-1,a=0;for(let{interval:i,offset:o}of e.filter(s=>!s.intercalary)){let s=0;for(let l=0;l!d.exclusive).map(d=>Math.floor((n+(d.ignore?0:o))/d.interval)).reduce((d,h)=>d+h,0),f=Math.floor((n+(u.ignore?0:o))/u.interval);u.exclusive?(s-=f,s+=c):(s+=f,s-=c)}a+=s}return a}function Lb(r,e,t,n,a,i,o){if(!a)return 0;if(r===1)return i;let s=r<0?-1:1;return sn(s*(gp(r,e,n)%t.length+s*i+s*(o??0)),t.length)}function gp(r,e,t,n=!1){if(r==1)return 0;let a=r>=1?r:r+1;return Math.abs(a-1)*e.filter(i=>n||i.type=="month").reduce((i,o)=>i+o.length,0)+t6(r,t)}function uc(){return Date.now()^Math.random()*4294967296}function jo(r,e,t=et.METRIC){return t===et.IMPERIAL&&e===et.METRIC?Number(((r-32)*5/9).toPrecision(2)):t===et.METRIC&&e===et.IMPERIAL?Number((r*9/5+32).toPrecision(2)):Number(r.toPrecision(2))}function jr(r,e,t=et.METRIC){return`${jo(r,e,t)}\xB0`}var Ui={DEFAULT:"DEFAULT"},yp={enabled:!1,seed:uc(),tempUnits:et.IMPERIAL,windUnits:et.IMPERIAL,primaryWindDirection:"E"},bp={seasons:[],offset:0,type:ot.PERIODIC,displayColors:!0,interpolateColors:!0,weather:at(yp)},cc={name:null,description:"",id:null,showIntercalarySeparately:!0,static:{incrementDay:!1,firstWeekDay:0,overflow:!0,weekdays:[],months:[],moons:[],displayMoons:!0,displayDayNumber:!1,leapDays:[],eras:[]},seasonal:at(bp),locations:{locations:[]},current:{year:null,month:null,day:null},events:[],categories:[],path:[],supportInlineEvents:!1,inlineEventTag:"#inline-events"},si={autoParse:!1,calendars:[],configDirectory:null,dailyNotes:!1,dateFormat:"YYYY-MM-DD",defaultCalendar:null,eventPreview:!1,exit:{saving:!1,event:!1,calendar:!1,savingEvent:!1},eventFrontmatter:!1,parseDates:!1,version:{major:null,minor:null,patch:null,beta:null},debug:!1,askedToMoveFC:!1,askedAboutSync:!1,syncBehavior:"Ask",inlineEventsTag:null,paths:[["/",Ui.DEFAULT]]};var dl=class{static import(e){let t=[];for(let n of e){let a=n.name??"Imported Calendar",i=n.static_data;if(!i)continue;let o=i.year_data;if(!o)continue;let s=Math.max(o.first_day-1,0),l=o.overflow??!0,u=o.global_week;if(!u)continue;let c=u.map(S=>({type:"day",name:S,id:Le(6),number:null})),f=o.timespans;if(!f)continue;let d=f.map(S=>({name:(0,Yb.decode)(S.name),type:S.type,length:S.length,id:Le(6),interval:S.interval,offset:S.offset})),h=d.reduce((S,M)=>M.type=="month"?S+M.length:S,0),p=[];if("leap_days"in o)for(let S of o.leap_days){let Z=(S.interval.split(",")??["1"]).map(N=>{let L=/\+/.test(N),j=/\!/.test(N),X=N.match(/(\d+)/)?.[0];return{ignore:L,exclusive:j,interval:Number(X)}});p.push({name:S.name??`Leap Day ${p.length+1}`,type:"leapday",interval:Z,timespan:S.timespan??0,intercalary:S.intercalary??!1,numbered:!S.not_numbered,after:S.day,offset:S.offset??0,id:Le(6)})}let m=[];if("moons"in i)for(let S of i.moons)m.push({name:S.name??`Moon ${m.length+1}`,cycle:Number(S.cycle)??h,offset:S.shift??0,faceColor:S.color??"#ffffff",shadowColor:S.shadow_color??"#000000",id:Le(6)});let O=[];if("eras"in i)for(let S of i.eras)O.push({id:Le(6),endsYear:S.endsYear,isEvent:!1,isStartingEra:!1,name:S.name??`Era ${O.length+1}`,description:S.description,format:S.formatting??"{{era_name}}",date:{year:S.date?.year??1,month:S.date?.timespan??0,day:S.date?.day??0},type:"era",category:null});let b={seasons:[],type:ot.PERIODIC,interpolateColors:!0,displayColors:!0,offset:0,weather:{enabled:!1,seed:1,tempUnits:et.IMPERIAL,windUnits:et.METRIC,primaryWindDirection:"E"}};if("seasons"in i){let S=i.seasons;S.global_settings.periodic_seasons||(b={seasons:[],type:ot.DATED,interpolateColors:!0,displayColors:!0,offset:0,weather:{enabled:!1,seed:1,tempUnits:et.IMPERIAL,windUnits:et.METRIC,primaryWindDirection:"E"}}),b.displayColors=S.global_settings.color_enabled;for(let M of S.data)switch(b.type){case ot.DATED:{b.seasons.push({id:Le(6),name:M.name,type:ot.DATED,kind:Dt.NONE,month:M.timespan,day:M.day,color:M.color[0],weatherOffset:56,weatherPeak:5});break}case ot.PERIODIC:{b.seasons.push({id:Le(6),name:M.name,type:ot.PERIODIC,kind:Dt.NONE,duration:M.length-(M.duration??0),peak:M.duration??0,color:M.color[0],weatherOffset:56,weatherPeak:5});break}}if("preset_order"in S.global_settings)for(let M=0;M<(S.global_settings.preset_order??[]).length;M++)switch(S.global_settings.preset_order?.[M]){case 0:{b.seasons[M].kind=Dt.WINTER;break}case 1:{b.seasons[M].kind=Dt.SPRING;break}case 2:{b.seasons[M].kind=Dt.SUMMER;break}case 3:{b.seasons[M].kind=Dt.AUTUMN;break}}}let E={firstWeekDay:s,overflow:l,weekdays:c,months:d,moons:m,leapDays:p,eras:O,displayMoons:!0,incrementDay:!1,displayDayNumber:!1},D={year:1,day:1,month:0};n.dynamic_data&&(D.year=Math.max(1,n.dynamic_data.year??D.year),D.day=n.dynamic_data.day??D.day,D.month=n.dynamic_data.timespan??D.month);let C=[],k=new Map;if("categories"in n)for(let S of n.categories){let M=S.name,Z=M?.split(" ").join("-").toLowerCase()??Le(6),N=S.event_settings.color;if(N in Ub)N=Ub[N];else{N=N.split("-").join("");let L=createEl("canvas"),j=L.getContext("2d");j.fillStyle=N,N=j.fillStyle,L.detach()}k.set(Z,{name:M,id:Z,color:N})}if(n.events&&Array.isArray(n.events)&&n.events.length)for(let S of n.events){let M={day:null,year:null,month:null};if(S.data&&S.data.date&&Array.isArray(S.data?.date)&&S.data.date.length)M.day=S.data.date[2],M.month=S.data.date[1],M.year=S.data.date[0];else if(S.data&&S.data.conditions&&Array.isArray(S.data.conditions)){let Z=S.data.conditions;try{let N=Z.find(X=>X[0]==="Year"),L=Z.find(X=>X[0]==="Month"),j=Z.find(X=>X[0]==="Day");N&&(M.year=Number(N[2][0])),L&&(M.month=Number(L[2][0])),j&&(M.day=Number(j[2][0]))}catch{}}C.push({name:S.name,description:S.description,id:`${S.id}`,note:null,type:U.Date,date:M,category:k.get(S.event_category_id)?.id??null,sort:{order:"",timestamp:0}})}let w=(0,Wb.default)({count:k.size});for(let S of k.keys()){let M=k.get(S);M.color||(M.color=w.shift().hex(),k.set(S,M))}let T=(0,zb.default)(cc,{name:a,description:null,static:E,current:D,events:C,id:Le(6),categories:Array.from(k.values()),seasonal:b});t.push(T)}return t}},Ub={"Dark-Solid":"#000000",Red:"#9b2c2c",Pink:"#880E4F",Purple:"#4A148C","Deep-Purple":"#311B92",Blue:"#0D47A1","Light-Blue":"#0288D1",Cyan:"#006064",Teal:"#004D40",Green:"#2E7D32","Light-Green":"#7CB342",Lime:"#9e9d24",Yellow:"#FFEB3B",Orange:"#FF9100","Blue-Grey":"#455A64"};var Dl=require("obsidian");var Xo=require("obsidian"),ir=class extends Xo.Modal{constructor(t){super(t);this.app=t;this.containerEl.addClass("calendarium-modal")}onOpen(){this.display()}},pn=class extends ir{constructor(){super(app);this.cancelText="Cancel";this.containerEl.addClasses(["has-buttons","cancelable"])}onOpen(){this.display(),this.buttonEl=this.modalEl.createDiv("calendarium-modal-buttons setting-item"),this.addButtons()}addButtons(){this.buttonEl.empty(),new Xo.ButtonComponent(this.buttonEl).setButtonText(this.cancelText).setCta().onClick(this.cancel.bind(this))}cancel(){this.onClose=()=>{},this.close(),this.onCancel()}onCancel(){}},fc=class extends pn{constructor(){super();this.saveText="Save";this.containerEl.addClasses(["saveable"])}addButtons(){this.buttonEl.empty(),new Xo.ButtonComponent(this.buttonEl).setButtonText(this.cancelText).onClick(this.cancel.bind(this)),new Xo.ButtonComponent(this.buttonEl).setButtonText(this.saveText).setCta().onClick(this.save.bind(this))}save(){this.close(),this.onSave()}onSave(){}};var $r=require("obsidian");var xv=Gn(cp());var Vb=require("obsidian");var hl,Qa=class extends Vb.Notice{constructor(t,n){super(t,n);Tt(this,hl,[]);this.noticeEl.addClass("calendarium-notice")}registerOnHide(t){Me(this,hl).push(t)}hide(){super.hide();for(let t of Me(this,hl))t()}};hl=new WeakMap;function I(){}var Go=r=>r;function dc(r,e){for(let t in e)r[t]=e[t];return r}function vp(r){return r()}function hc(){return Object.create(null)}function Te(r){r.forEach(vp)}function qt(r){return typeof r=="function"}function re(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function jb(r){return Object.keys(r).length===0}function be(r,...e){if(r==null){for(let n of e)n(void 0);return I}let t=r.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ne(r){let e;return be(r,t=>e=t)(),e}function ie(r,e,t){r.$$.on_destroy.push(be(e,t))}function Xr(r,e,t,n){if(r){let a=Xb(r,e,t,n);return r[0](a)}}function Xb(r,e,t,n){return r[1]&&n?dc(t.ctx.slice(),r[1](n(e))):t.ctx}function Gr(r,e,t,n){if(r[2]&&n){let a=r[2](n(t));if(e.dirty===void 0)return a;if(typeof a=="object"){let i=[],o=Math.max(e.dirty.length,a.length);for(let s=0;s32){let e=[],t=r.ctx.length/32;for(let n=0;nwindow.performance.now():()=>Date.now(),pl=Gb?r=>requestAnimationFrame(r):I;var Ho=new Set;function Hb(r){Ho.forEach(e=>{e.c(r)||(Ho.delete(e),e.f())}),Ho.size!==0&&pl(Hb)}function mc(r){let e;return Ho.size===0&&pl(Hb),{promise:new Promise(t=>{Ho.add(e={c:r,f:t})}),abort(){Ho.delete(e)}}}var ml=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;var gc=class r{constructor(e){dr(this,"_listeners","WeakMap"in ml?new WeakMap:void 0);dr(this,"_observer");dr(this,"options");this.options=e}observe(e,t){return this._listeners.set(e,t),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){return this._observer??(this._observer=new ResizeObserver(e=>{for(let t of e)r.entries.set(t.target,t),this._listeners.get(t.target)?.(t)}))}};gc.entries="WeakMap"in ml?new WeakMap:void 0;var Kb=!1;function Jb(){Kb=!0}function ev(){Kb=!1}function y(r,e){r.appendChild(e)}function we(r,e,t){let n=yc(r);if(!n.getElementById(e)){let a=_("style");a.id=e,a.textContent=t,rv(n,a)}}function yc(r){if(!r)return document;let e=r.getRootNode?r.getRootNode():r.ownerDocument;return e&&e.host?e:r.ownerDocument}function tv(r){let e=_("style");return e.textContent="/* empty */",rv(yc(r),e),e.sheet}function rv(r,e){return y(r.head||r,e),e.sheet}function $(r,e,t){r.insertBefore(e,t||null)}function A(r){r.parentNode&&r.parentNode.removeChild(r)}function tt(r,e){for(let t=0;tr.removeEventListener(e,t,n)}function g(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function Ct(r){return r===""?null:+r}function nv(r){return Array.from(r.childNodes)}function ve(r,e){e=""+e,r.data!==e&&(r.data=e)}function Re(r,e){r.value=e??""}function Pt(r,e,t,n){t==null?r.style.removeProperty(e):r.style.setProperty(e,t,n?"important":"")}function ht(r,e,t){for(let n=0;n{e[t.slot||"default"]=!0}),e}function Op(r,e){return new r(e)}var bc=new Map,vc=0;function n6(r){let e=5381,t=r.length;for(;t--;)e=(e<<5)-e^r.charCodeAt(t);return e>>>0}function a6(r,e){let t={stylesheet:tv(e),rules:{}};return bc.set(r,t),t}function yl(r,e,t,n,a,i,o,s=0){let l=16.666/n,u=`{ `;for(let O=0;O<=1;O+=l){let b=e+(t-e)*i(O);u+=O*100+`%{${o(b,1-b)}} `}let c=u+`100% {${o(t,1-t)}} }`,f=`__svelte_${n6(c)}_${s}`,d=yc(r),{stylesheet:h,rules:p}=bc.get(d)||a6(d,r);p[f]||(p[f]=!0,h.insertRule(`@keyframes ${f} ${c}`,h.cssRules.length));let m=r.style.animation||"";return r.style.animation=`${m?`${m}, `:""}${f} ${n}ms linear ${a}ms 1 both`,vc+=1,f}function Oc(r,e){let t=(r.style.animation||"").split(", "),n=t.filter(e?i=>i.indexOf(e)<0:i=>i.indexOf("__svelte")===-1),a=t.length-n.length;a&&(r.style.animation=n.join(", "),vc-=a,vc||i6())}function i6(){pl(()=>{vc||(bc.forEach(r=>{let{ownerNode:e}=r.stylesheet;e&&A(e)}),bc.clear())})}function _c(r,e,t,n){if(!e)return I;let a=r.getBoundingClientRect();if(e.left===a.left&&e.right===a.right&&e.top===a.top&&e.bottom===a.bottom)return I;let{delay:i=0,duration:o=300,easing:s=Go,start:l=pc()+i,end:u=l+o,tick:c=I,css:f}=t(r,{from:e,to:a},n),d=!0,h=!1,p;function m(){f&&(p=yl(r,0,1,o,i,s,f)),i||(h=!0)}function O(){f&&Oc(r,p),d=!1}return mc(b=>{if(!h&&b>=l&&(h=!0),h&&b>=u&&(c(1,0),O()),!d)return!1;if(h){let E=b-l,D=0+1*s(E/o);c(D,1-D)}return!0}),m(),c(0,1),O}function wc(r){let e=getComputedStyle(r);if(e.position!=="absolute"&&e.position!=="fixed"){let{width:t,height:n}=e,a=r.getBoundingClientRect();r.style.position="absolute",r.style.width=t,r.style.height=n,o6(r,a)}}function o6(r,e){let t=r.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){let n=getComputedStyle(r),a=n.transform==="none"?"":n.transform;r.style.transform=`${a} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}var li;function Ia(r){li=r}function Ko(){if(!li)throw new Error("Function called outside component initialization");return li}function Hn(r){Ko().$$.on_mount.push(r)}function bl(r){Ko().$$.on_destroy.push(r)}function Qt(){let r=Ko();return(e,t,{cancelable:n=!1}={})=>{let a=r.$$.callbacks[e];if(a){let i=gl(e,t,{cancelable:n});return a.slice().forEach(o=>{o.call(r,i)}),!i.defaultPrevented}return!0}}function Sn(r,e){return Ko().$$.context.set(r,e),e}function Ve(r){return Ko().$$.context.get(r)}function Zr(r,e){let t=r.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}var Wi=[];var Jr=[],es=[],iv=[],s6=Promise.resolve(),wp=!1;function ov(){wp||(wp=!0,s6.then(ui))}function St(r){es.push(r)}var _p=new Set,Jo=0;function ui(){if(Jo!==0)return;let r=li;do{try{for(;Jor.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),es=e}var vl;function u6(){return vl||(vl=Promise.resolve(),vl.then(()=>{vl=null})),vl}function Dp(r,e,t){r.dispatchEvent(gl(`${e?"intro":"outro"}${t}`))}var Dc=new Set,Fa;function Oe(){Fa={r:0,c:[],p:Fa}}function _e(){Fa.r||Te(Fa.c),Fa=Fa.p}function P(r,e){r&&r.i&&(Dc.delete(r),r.i(e))}function R(r,e,t,n){if(r&&r.o){if(Dc.has(r))return;Dc.add(r),Fa.c.push(()=>{Dc.delete(r),n&&(t&&r.d(1),n())}),r.o(e)}else n&&n()}var c6={duration:0};function Cp(r,e,t,n){let i=e(r,t,{direction:"both"}),o=n?0:1,s=null,l=null,u=null,c;function f(){u&&Oc(r,u)}function d(p,m){let O=p.b-o;return m*=Math.abs(O),{a:o,b:p.b,d:O,duration:m,start:p.start,end:p.start+m,group:p.group}}function h(p){let{delay:m=0,duration:O=300,easing:b=Go,tick:E=I,css:D}=i||c6,C={start:pc()+m,b:p};p||(C.group=Fa,Fa.r+=1),"inert"in r&&(p?c!==void 0&&(r.inert=c):(c=r.inert,r.inert=!0)),s||l?l=C:(D&&(f(),u=yl(r,o,p,O,m,b,D)),p&&E(0,1),s=d(C,O),St(()=>Dp(r,p,"start")),mc(k=>{if(l&&k>l.start&&(s=d(l,O),l=null,Dp(r,s.b,"start"),D&&(f(),u=yl(r,o,s.b,s.duration,0,b,i.css))),s){if(k>=s.end)E(o=s.b,1-o),Dp(r,s.b,"end"),l||(s.b?f():--s.group.r||Te(s.group.c)),s=null;else if(k>=s.start){let w=k-s.start;o=s.a+s.d*b(w/s.duration),E(o,1-o)}}return!!(s||l)}))}return{run(p){qt(i)?u6().then(()=>{i=i({direction:p?"in":"out"}),h(p)}):h(p)},end(){f(),s=l=null}}}function $e(r){return r?.length!==void 0?r:Array.from(r)}function kp(r,e){r.d(1),e.delete(r.key)}function Ep(r,e){R(r,1,1,()=>{e.delete(r.key)})}function lv(r,e){r.f(),kp(r,e)}function uv(r,e){r.f(),Ep(r,e)}function ci(r,e,t,n,a,i,o,s,l,u,c,f){let d=r.length,h=i.length,p=d,m={};for(;p--;)m[r[p].key]=p;let O=[],b=new Map,E=new Map,D=[];for(p=h;p--;){let T=f(a,i,p),S=t(T),M=o.get(S);M?n&&D.push(()=>M.p(T,e)):(M=u(S,T),M.c()),b.set(S,O[p]=M),S in m&&E.set(S,Math.abs(p-m[S]))}let C=new Set,k=new Set;function w(T){P(T,1),T.m(s,c),o.set(T.key,T),c=T.first,h--}for(;d&&h;){let T=O[h-1],S=r[d-1],M=T.key,Z=S.key;T===S?(c=T.first,d--,h--):b.has(Z)?!o.has(M)||C.has(M)?w(T):k.has(Z)?d--:E.get(M)>E.get(Z)?(k.add(M),w(T)):(C.add(Z),d--):(l(S,o),d--)}for(;d--;){let T=r[d];b.has(T.key)||l(T,o)}for(;h;)w(O[h-1]);return Te(D),O}function cv(r,e){let t={},n={},a={$$scope:1},i=r.length;for(;i--;){let o=r[i],s=e[i];if(s){for(let l in o)l in s||(n[l]=1);for(let l in s)a[l]||(t[l]=s[l],a[l]=1);r[i]=s}else for(let l in o)a[l]=1}for(let o in n)o in t||(t[o]=void 0);return t}function fv(r){return typeof r=="object"&&r!==null?r:{}}var f6=["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"],d6=new Set([...f6]);function z(r){r&&r.c()}function W(r,e,t){let{fragment:n,after_update:a}=r.$$;n&&n.m(e,t),St(()=>{let i=r.$$.on_mount.map(vp).filter(qt);r.$$.on_destroy?r.$$.on_destroy.push(...i):Te(i),r.$$.on_mount=[]}),a.forEach(St)}function Y(r,e){let t=r.$$;t.fragment!==null&&(sv(t.after_update),Te(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function p6(r,e){r.$$.dirty[0]===-1&&(Wi.push(r),ov(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<{let p=h.length?h[0]:d;return u.ctx&&a(u.ctx[f],u.ctx[f]=p)&&(!u.skip_bound&&u.bound[f]&&u.bound[f](p),c&&p6(r,f)),d}):[],u.update(),c=!0,Te(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){Jb();let f=nv(e.target);u.fragment&&u.fragment.l(f),f.forEach(A)}else u.fragment&&u.fragment.c();e.intro&&P(r.$$.fragment),W(r,e.target,e.anchor),ev(),ui()}Ia(l)}var m6;typeof HTMLElement=="function"&&(m6=class extends HTMLElement{constructor(e,t,n){super();dr(this,"$$ctor");dr(this,"$$s");dr(this,"$$c");dr(this,"$$cn",!1);dr(this,"$$d",{});dr(this,"$$r",!1);dr(this,"$$p_d",{});dr(this,"$$l",{});dr(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let a=this.$$c.$on(e,t);this.$$l_u.set(t,a)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let a=this.$$l_u.get(t);a&&(a(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(i){return()=>{let o;return{c:function(){o=_("slot"),i!=="default"&&g(o,"name",i)},m:function(u,c){$(u,o,c)},d:function(u){u&&A(o)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},n=av(this);for(let i of this.$$s)i in n&&(t[i]=[e(i)]);for(let i of this.attributes){let o=this.$$g_p(i.name);o in this.$$d||(this.$$d[o]=xp(o,i.value,this.$$p_d,"toProp"))}for(let i in this.$$p_d)!(i in this.$$d)&&this[i]!==void 0&&(this.$$d[i]=this[i],delete this[i]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$scope:{ctx:[]}}});let a=()=>{this.$$r=!0;for(let i in this.$$p_d)if(this.$$d[i]=this.$$c.$$.ctx[this.$$c.$$.props[i]],this.$$p_d[i].reflect){let o=xp(i,this.$$d[i],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,o)}this.$$r=!1};this.$$c.$$.after_update.push(a),a();for(let i in this.$$l)for(let o of this.$$l[i]){let s=this.$$c.$on(i,o);this.$$l_u.set(o,s)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=xp(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(e){return Object.keys(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function xp(r,e,t,n){let a=t[r]?.type;if(e=a==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!t[r])return e;if(n==="toAttribute")switch(a){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(a){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}var ae=class{constructor(){dr(this,"$$");dr(this,"$$set")}$destroy(){Y(this,1),this.$destroy=I}$on(e,t){if(!qt(t))return I;let n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}$set(e){this.$$set&&!jb(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var dv="4";var ts=[];function Za(r,e){return{subscribe:Ze(r,e).subscribe}}function Ze(r,e=I){let t,n=new Set;function a(s){if(re(r,s)&&(r=s,t)){let l=!ts.length;for(let u of n)u[1](),ts.push(u,r);if(l){for(let u=0;u{n.delete(u),n.size===0&&t&&(t(),t=null)}}return{set:a,update:i,subscribe:o}}function de(r,e,t){let n=!Array.isArray(r),a=n?[r]:r;if(!a.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");let i=e.length<2;return Za(t,(o,s)=>{let l=!1,u=[],c=0,f=I,d=()=>{if(c)return;f();let p=e(n?u[0]:u,o,s);i?o(p):f=qt(p)?p:I},h=a.map((p,m)=>be(p,O=>{u[m]=O,c&=~(1<{c|=1<=t.major||n.minor>=t.minor||n.patch>=t.patch||n.beta>=t.beta)}function pv(r){if(r==null)return"No saved plugin data.";if(typeof r!="object")return"Plugin data is not an object.";if(Object.keys(r)?.length==0)return"Plugin data is an empty object.";if("transitioned"in r)return"Previous plugin data was transitioned correctly.";if(!("version"in r)||typeof r.version!="object")return"No version information exists in plugin data.";let e=r.version;if("beta"in e)return 0;if(!("patch"in e)||e.patch==null)return"No patch version infromation exists in plugin data.";if(typeof e.patch=="string"){let[,,t]=e.patch.match(/(\d+)(?:\-b(\d+))?/)??[e.patch];if(isNaN(Number(t))||Number(t)<26)return"Plugin data is from a version prior to beta 26."}return 0}var Cc=require("obsidian");function vt(r,e){r.addClass("has-node-icon"),(0,Cc.setIcon)(r,e)}function kc(r,e){new Cc.ExtraButtonComponent(r).setIcon(e)}var mv="sticky-note",Ec="file-symlink",An="alert-triangle",gv="orbit",yv="arrow-big-right-dash",xc="calendarium-between-horizontal-start",Sc="calendar-days",bv="undo",vv="redo",Ov="reset";var rs="plus-with-circle";var Ar="wrench",Lt="trash",Ac="import",Ol="loader-2",Yi="check",zi="chevron-right",_v="archive-restore",Sp="sparkles",Ap="pencil-ruler",wv="download",$c="grip-vertical";var Dv="chevrons-up-down",Tc="left-arrow",Nc="right-arrow",Cv="gear",ns="cross",kv="calendar-search";var Ev="--- BEGIN DATA ---",qa,as,wl,At,ha,_l=class _l{constructor(){this.loaded=!1;Tt(this,qa,!1);Tt(this,as,!1);Tt(this,wl,!1);this.deletedCalendars=[];Tt(this,At,void 0);Tt(this,ha,void 0);this.layoutReady=!1}get app(){return this.plugin.app}get adapter(){return this.app.vault.adapter}getData(){return Me(this,At)}getCalendars(){return Me(this,At).calendars}getDefaultCalendar(){return Me(this,ha).get(Me(this,At).defaultCalendar??"")}getCalendar(e){return Me(this,ha).get(e)}get path(){return this.manifest.dir+"/"+_l.DataFile}initialize(e,t){this.plugin=e,this.manifest=t,this.app.workspace.onLayoutReady(()=>this.layoutReady=!0),this.onLayoutReadyAndSettingsLoad(async()=>{setTimeout(()=>this.checkFCSettings(),2e3)})}async onLayoutReadyAndSettingsLoad(e){this.loaded&&this.layoutReady?e():this.layoutReady?this.onSettingsLoaded(e):this.app.workspace.onLayoutReady(()=>this.onSettingsLoaded(e))}async onSettingsLoaded(e){this.loaded?e():this.plugin.registerEvent(this.app.workspace.on("calendarium-settings-loaded",()=>e()))}get syncPlugin(){return this.app.internalPlugins.getPluginById("sync")}async onExternalSettingsChange(){if(Me(this,At).syncBehavior==="Never"){console.debug("Calendarium: Ignoring external data change event due to syncBehavior being 'Never'");return}if(Me(this,At).syncBehavior==="Always"){console.debug("Calendarium: Automatically reloading data due to syncBehavior being 'Always'"),await this.loadData(!0);return}this.askToReload()}askToReload(){if(Me(this,qa))return;console.debug("Calendarium: External data change detected. Prompting for behavior."),Nt(this,qa,!0);let e=new Qa(createFragment(t=>{let n=t.createDiv("calendarium-notice");n.createEl("h4",{text:"Calendarium",cls:"calendarium-header"});let a=n.createDiv();a.createSpan({text:"Your settings have been changed externally (e.g., from sync). Would you like to reload Calendarium settings?"}),a.createEl("br"),a.createEl("br");let i=a.createDiv("calendarium-notice-buttons");new $r.ButtonComponent(i).setButtonText("Cancel").onClick(()=>{e.hide()}),new $r.ButtonComponent(i).setButtonText("Reload data").setCta().onClick(async o=>{o.stopPropagation(),a.empty();let s=a.createDiv("calendarium-migrating");(0,$r.setIcon)(s.createDiv("migrating-icon rotating"),Ol),s.createSpan({text:"Reloading data..."});let l=Date.now();await this.loadData(!0),setTimeout(()=>{s.empty(),(0,$r.setIcon)(s.createDiv("migrating-icon"),Yi),s.createSpan({text:"Calendarium data reloaded."}),setTimeout(()=>{e.hide()},1e3)},Math.max(2e3-(Date.now()-l),0))})}),0);this.plugin.registerNotice(e),e.registerOnHide(()=>{Nt(this,qa,!1),this.promptForBehavior()})}async promptForBehavior(){if(Me(this,as)||(Nt(this,as,!0),Me(this,At).askedAboutSync&&Me(this,At).syncBehavior!=="Ask"))return;Me(this,At).askedAboutSync||(Me(this,At).askedAboutSync=!0,await this.saveData(Me(this,At))),console.debug("Calendarium: Asking user how to handle external data change events in the future.");let e=new $r.Scope,t=new Qa(createFragment(n=>{let a=n.createDiv("calendarium-notice");a.createEl("h4",{text:"Calendarium",cls:"calendarium-header"});let i=a.createDiv();i.createSpan({text:"How should Calendarium reload your data in the future?"}),i.createEl("br"),i.createEl("br"),i.createSpan({text:"This behavior can be changed in settings."}),i.createEl("br");let o=i.createDiv("calendarium-notice-buttons"),s=new $r.DropdownComponent(o).addOption("Ask","Continue asking").addOption("Always","Always reload").addOption("Never","Never reload").setValue(Me(this,At).syncBehavior).onChange(async l=>{Me(this,At).syncBehavior=l,await this.saveData(Me(this,At)),t.hide()});s.selectEl.setAttr("tabindex",99),this.app.keymap.pushScope(e),s.selectEl.onClickEvent(l=>{l.stopPropagation(),l.preventDefault()})}),0);t.registerOnHide(()=>{Nt(this,as,!1),this.app.keymap.popScope(e)}),this.plugin.registerNotice(t)}get version(){let e=this.manifest.version.split("."),[t,n]=e,[,a,i]=e[2].match(/(\d+)(?:\-b(\d+))?/)??e[2];return{major:Number(t),minor:Number(n),patch:Number(a),beta:i?Number(i):null}}getDataVersion(e){let t={major:Number.MIN_VALUE,minor:Number.MIN_VALUE,patch:Number.MIN_VALUE,beta:null};if("version"in e){let n=e.version;switch(typeof n.major=="number"&&(t.major=n.major),typeof n.minor=="number"&&(t.minor=n.minor),typeof n.beta=="number"&&(t.beta=n.beta),typeof n.patch){case"number":{t.patch=n.patch;break}case"string":{let[,a,i]=n.patch.match(/(\d+)(?:\-b(\d+))?/)??[Number.MIN_VALUE,Number.MIN_VALUE];t.patch=Number(a),t.beta=Number(i);break}}}return t}isOlder(e,t){return hv(e,t)}async save(e){await this.saveData(Me(this,At)),e?.calendar&&(console.debug("Calendarium: Triggering calendar updates due to a save event effecting calendar display."),this.app.workspace.trigger("calendarium-updated")),e?.watcher&&this.plugin.watcher.start()}async saveData(e){console.debug("Calendarium: Saving data."),Nt(this,wl,!0),Nt(this,At,e),Me(this,At).version=this.version,await this.plugin.saveData(e),this.plugin.app.workspace.trigger("calendarium-settings-change"),Nt(this,wl,!1)}async loadData(e){console.debug("Calendarium: Loading data."),await this.load(),this.loaded=!0,this.app.workspace.trigger("calendarium-settings-loaded"),e&&this.app.workspace.trigger("calendarium-settings-external-load")}async load(){let e=await this.plugin.loadData()??{};console.debug("Calendarium: Checking to see if markdown settings should be migrated.");let t=await this.shouldTransitionMarkdownSettings(e);if(t!==0){console.debug("Calendarium: Markdown settings need to be migrated. Reason: "+t),await this.transitionMarkdownSettings();return}if(!e||!Object.keys(e).length){console.debug("Calendarium: No data file could be loaded. Saving default data."),await this.saveData(at(si));return}console.debug("Calendarium: Ensuring data matches the schema.");let n=e;(!n||!Object.keys(e??{}).length)&&(n=at(si)),this.updateDataToNewSchema(n)?(console.debug("Calendarium: Data was modified during loading process. Saving data."),await this.saveData(n)):Nt(this,At,n),Nt(this,ha,new Map(Me(this,At).calendars.map(i=>[i.id,i])))}async addCalendar(e,t){let n=!t||e.name!=t?.name;t==null?Me(this,At).calendars.push(e):(Me(this,At).calendars.splice(Me(this,At).calendars.indexOf(t),1,e),Me(this,ha).delete(t.id)),Me(this,At).defaultCalendar||(Me(this,At).defaultCalendar=e.id),n&&this.plugin.watcher.start(e),Me(this,ha).set(e.id,e),await this.save({calendar:!0,watcher:!0})}async removeCalendar(e){Me(this,At).calendars=Me(this,At).calendars.filter(t=>t.id!=e.id),e.id==Me(this,At).defaultCalendar&&(Me(this,At).defaultCalendar=Me(this,At).calendars[0]?.id,this.plugin.watcher.start()),this.deletedCalendars.push(e),Me(this,ha).delete(e.id),await this.save({calendar:!0})}hasCalendar(e){return Me(this,ha).has(e)}async checkFCSettings(){if(Me(this,At).askedToMoveFC||!this.app.plugins.plugins["fantasy-calendar"]||Me(this,qa))return;Nt(this,qa,!0);let e=new Qa(createFragment(t=>{let n=t.createDiv("calendarium-notice");n.createEl("h4",{text:"Calendarium",cls:"calendarium-header"});let a=n.createDiv();a.createSpan({text:"Would you like to migrate your existing Fantasy Calendar settings to Calendarium?"}),a.createEl("br"),a.createEl("br");let i=a.createDiv("calendarium-notice-buttons");new $r.ButtonComponent(i).setButtonText("Cancel").onClick(()=>{Me(this,At).askedToMoveFC=!0}),new $r.ButtonComponent(i).setButtonText("Migrate").setCta().onClick(async o=>{o.stopPropagation(),a.empty();let s=a.createDiv("calendarium-migrating");(0,$r.setIcon)(s.createDiv("migrating-icon rotating"),Ol),s.createSpan({text:"Migrating..."});let l=Date.now();await this.migrateFCData(),setTimeout(()=>{s.empty(),(0,$r.setIcon)(s.createDiv("migrating-icon"),Yi),s.createSpan({text:"Fantasy Calendar settings migrated."}),setTimeout(()=>{e.hide()},2e3)},Math.max(2e3-(Date.now()-l),0))})}),0);e.registerOnHide(()=>Nt(this,qa,!1)),this.plugin.registerNotice(e)}async migrateFCData(){console.debug("Calendarium: Migrating Fantasy Calendar plugin data.");let e;if(await this.adapter.exists(`${this.plugin.app.vault.configDir}/plugins/fantasy-calendar/_data.md`)){let n=((await this.adapter.read(`${this.plugin.app.vault.configDir}/plugins/fantasy-calendar/_data.md`)).split(Ev).pop()??"").trim();e=(0,$r.parseYaml)(n)}else e=await this.app.plugins.plugins["fantasy-calendar"].loadData();let t=(0,xv.default)(si,e??{});t.askedToMoveFC=!0;for(let n of t?.calendars??[])n.events=n.events?.filter(a=>!a.note)??[];await this.updateDataToNewSchema(t),await this.saveData(t)}get markdownPath(){return this.manifest.dir+"/"+_l.DataFile}async markdownFileExists(){return await this.adapter.exists(this.markdownPath)}async transitionMarkdownSettings(){console.debug("Calendarium: Migrating Markdown file data.");let e=null;if(await this.markdownFileExists()){let t=((await this.adapter.read(this.markdownPath)).split(Ev).pop()??"").trim();e=t&&t.length?(0,$r.parseYaml)(t):at(si)}e||(e=at(si)),await this.updateDataToNewSchema(e),await this.saveData(e)}async shouldTransitionMarkdownSettings(e){return await this.markdownFileExists()?pv(e):0}async deleteMarkdownSettings(){await this.adapter.remove(this.path)}updateDataToNewSchema(e){let t=this.updateCalendarsToNewSchema(e.calendars,e);if("autoParse"in e||(e.autoParse=!0,t=!0),!e.defaultCalendar&&e.calendars.length&&(e.defaultCalendar=e.calendars[0].id,t=!0),e.calendars.length&&!e.calendars.find(n=>n.id==e.defaultCalendar)&&(e.defaultCalendar=e.calendars[0].id,t=!0),"deletedCalendars"in e&&(delete e.deletedCalendars,t=!0),this.isOlder({major:1,minor:0,patch:0,beta:29},this.getDataVersion(e))){if(e.paths=[],e.calendars.length)for(let n of e.calendars)n.path?.length&&e.paths.push(...n.path.map(a=>[a,n.id]));for(let n=0;n0&&e.paths.slice(0,n).find(([o])=>o===a)!=null){let o=new Qa(createFragment(s=>{let l=s.createDiv("calendarium-notice");l.createEl("h4",{text:"Calendarium",cls:"calendarium-header"});let u=l.createDiv();u.createDiv({text:"You have the same event path registered to multiple calendars."}),u.createDiv({text:"Please review your event path settings."}),u.createEl("br"),u.createEl("br");let c=u.createDiv("calendarium-notice-buttons");new $r.ButtonComponent(u).setButtonText("Open settings").onClick(()=>{o.hide(),this.app.setting.openTabById(this.plugin.manifest.id)})}),0);this.plugin.registerNotice(o);break}}e.calendars.length&&(e.inlineEventsTag=e.calendars.find(n=>n.inlineEventTag!=null)?.inlineEventTag??null),t=!0}return t}updateCalendarsToNewSchema(e,t){let n=!1;for(let a of e){a.id||(a.id=`${Le(10)}`,n=!0),a.path?Array.isArray(a.path)||(a.path=[a.path],n=!0):(a.path=[],n=!0);for(let i of a.static?.months)i.interval==null&&(i.interval=1,n=!0),i.offset==null&&(i.offset=0,n=!0);for(let i of a.events)if(i.sort==null&&(i.sort={timestamp:Number.MIN_VALUE,order:""},n=!0),!i.type){if(!i.date||i.date.year==null&&i.date.month==null&&i.date.day==null){i.type=U.Undated,i.date={year:null,month:null,day:null};continue}if((i.date.year==null||i.date.month==null||i.date.day==null)&&(delete i.end,i.type=U.Recurring,i.date.year==null&&(i.date.year=[null,null]),i.date.month==null&&(i.date.month=[null,null]),i.date.day==null&&(i.date.day=[null,null])),"end"in i){if(i.end&&(i.end.year==null||i.end.month==null||i.end.day==null)){i.type=U.Date,delete i.end;continue}i.type=U.Range;continue}i.type=U.Date}a.showIntercalarySeparately==null&&(a.showIntercalarySeparately=t.showIntercalary);for(let i of a.static?.eras)"start"in i&&(i.date={...i.start},delete i.start,n=!0),"type"in i||(i.type="era",n=!0),"event"in i&&(i.isEvent=i.event,n=!0),"isStartingEra"in i||(i.isStartingEra=!1,n=!0),"restart"in i&&(delete i.restart,n=!0);"seasonal"in a||(a.seasonal=at(bp),n=!0),"weather"in a.seasonal||(a.seasonal.weather=at(yp),n=!0),"locations"in a||(a.locations={locations:[]})}return n}};qa=new WeakMap,as=new WeakMap,wl=new WeakMap,At=new WeakMap,ha=new WeakMap,_l.DataFile="_data.md";var $p=_l,Xe=new $p;window.SettingsService=Xe;async function kl(r,e,t={cta:"Yes",secondary:"No"}){return new Promise((n,a)=>{try{let i=new Cl(r,e,t);i.onClose=()=>{n(i.confirmed)},i.open()}catch{a()}})}var Cl=class extends ir{constructor(t,n,a){super(t);this.text=n;this.buttons=a;this.confirmed=!1;this.dontAsk=!1}async display(){this.contentEl.empty(),this.contentEl.addClass("confirm-modal"),this.contentEl.createEl("p",{text:this.text});let t=this.contentEl.createDiv("calendarium-confirm-buttons-container");this.buttons.dontAsk?t.createEl("a").createEl("small",{cls:"dont-ask",text:this.buttons.dontAsk}).onclick=async()=>{this.confirmed=!0,this.dontAsk=!0,this.close()}:t.createDiv();let n=t.createDiv("calendarium-confirm-buttons");new Dl.ButtonComponent(n).setButtonText(this.buttons.cta).setCta().onClick(()=>{this.confirmed=!0,this.close()}),new Dl.ButtonComponent(n).setButtonText(this.buttons.secondary).onClick(()=>{this.close()})}onOpen(){this.display()}};async function Sv(r){return new Promise((e,t)=>{try{let n=new Tp(r);n.onClose=()=>{e(n.confirmed)},n.open()}catch{t()}})}var Tp=class extends ir{constructor(t){super(t.app);this.plugin=t;this.confirmed=!1}async display(){this.contentEl.empty(),this.contentEl.addClass("confirm-modal"),this.contentEl.createEl("p",{text:"Are you sure you want to delete this calendar?"});let t=this.contentEl.createDiv("calendarium-confirm-buttons-container");t.createEl("a").createEl("small",{cls:"dont-ask",text:"Delete and don't ask again"}).onclick=async()=>{this.confirmed=!0,this.plugin.data.exit.calendar=!0,await Xe.save(),this.close()};let n=t.createDiv("calendarium-confirm-buttons");new Dl.ButtonComponent(n).setButtonText("Delete").setCta().onClick(()=>{this.confirmed=!0,this.close()}),n.createEl("a").createEl("small",{cls:"dont-ask",text:"Cancel"}).onclick=()=>{this.close()}}onOpen(){this.display()}},Pc=class extends ir{constructor(t){super(t.app);this.plugin=t;this.confirmed=!1}async display(){this.contentEl.empty(),this.contentEl.addClass("confirm-modal"),this.contentEl.createEl("p",{text:"Additional information is required to save this calendar. Any changes you may have made will be discarded if you exit now."});let t=this.contentEl.createDiv("calendarium-confirm-buttons-container");t.createEl("a").createEl("small",{cls:"dont-ask",text:"Exit and don't ask again"}).onclick=async()=>{this.confirmed=!0,this.plugin.data.exit.saving=!0,await Xe.save(),this.close()};let n=t.createDiv("calendarium-confirm-buttons");new Dl.ButtonComponent(n).setButtonText("Exit").setCta().onClick(()=>{this.confirmed=!0,this.close()}),n.createEl("a").createEl("small",{cls:"dont-ask",text:"Keep editing"}).onclick=()=>{this.close()}}onOpen(){this.display()}};var La="NONE";function El(r){return(r.length+"").length}function xl(r){return(r.reduce((e,t)=>e>t.length?e:t.length,0)+"").length}function g6(r,e){let t=Ze(e),{subscribe:n,set:a,update:i}=t,o=Ze([]),s=0,l=!1,u=de([o],([V])=>s>0&&V.length),c=()=>o.update(V=>(s>0&&V.length>0&&(s--,l=!0,i(B=>V[s])),V)),f=de([o],([V])=>V.length>0&&so.update(V=>(V.length>0&&sV[s])),V));n(V=>o.update(B=>{if(l)return l=!1,B;if(s>0)for(let pe=0;pe<=s;pe++)B.shift();return s=0,B.unshift(at(V)),B}));let h=de(t,V=>V.static),p=de(t,V=>V.current),{subscribe:m}=h,O=V=>i(B=>(B.static=V,B.static.padMonths=El(B.static.months),B.static.padDays=xl(B.static.months),B)),b=de(h,V=>V.months),E=de(h,V=>V.weekdays),D=de(h,V=>V.years),C=de(h,V=>V.useCustomYears),k=de(h,V=>V.moons),w=de(h,V=>V.displayMoons),T=de(h,V=>V.leapDays),S=de(h,V=>V.eras),M=de(t,V=>V.seasonal.seasons),Z=de(t,V=>V.seasonal.offset),N=de(t,V=>V.seasonal.displayColors),L=de(t,V=>V.seasonal.interpolateColors),j=de(t,V=>V.seasonal.type),X=de(t,V=>V.seasonal.weather),fe=de(X,V=>V.enabled),ee=de(X,V=>V.seed),te=de(X,V=>V.tempUnits),ge=de(X,V=>V.windUnits),he=de(t,V=>V.locations.locations),ue=de(t,V=>V.locations.defaultLocation),xe=de(t,V=>V.events),Pe=de(t,V=>V.categories),Ye=de(h,V=>V.months?.length>0&&V.months?.every(B=>(B.name?.length??0)>0)&&V.months?.every(B=>B.length>0)),it=de(h,V=>V.weekdays?.length>0&&V.weekdays?.every(B=>B.name?.length)&&V.firstWeekDay<(V.weekdays?.length??1/0)),Be=de(h,V=>!V.useCustomYears||V.useCustomYears&&V.years!=null&&V.years.length>0&&V.years.every(B=>B.name?.length)),st=de(t,V=>V.name?.length>0),ct=de([t,p],([V,B])=>Wo(B,V)),ft=de([t,p],([V,B])=>Yo(B.month,V)),It=de([t,p],([V,B])=>zo(B.year,V)),Yt=de([ct,ft,It],([V,B,pe])=>V&&B&&pe),zt=de([Yt,st,Ye,it,Be],([V,B,pe,De,rt])=>V&&B&&pe&&De&&rt);return{subscribe:n,set:a,update:i,currentStore:{subscribe:p.subscribe,set:V=>{i(B=>(B.current={...V},B))},update:V=>i(B=>(B.current={...V},B))},valid:zt,validDate:Yt,validDay:ct,validMonth:ft,validMonths:Ye,validWeekdays:it,validYear:It,validYears:Be,validName:st,setProperty(V,B){return i(pe=>(pe[V]=B,pe))},setCurrentDate:V=>i(B=>(B.current={...V},B)),staticStore:{subscribe:m,set:O,setProperty(V,B){return i(pe=>(pe.static[V]=B,pe))}},weekdayStore:{subscribe:E.subscribe,add:V=>i(B=>(B.static.weekdays.push(V??{type:"day",name:null,id:Le(6)}),B)),update:(V,B)=>i(pe=>(pe.static.weekdays.splice(pe.static.weekdays.findIndex(De=>De.id==V),1,B),pe)),delete:V=>i(B=>(B.static.weekdays=B.static.weekdays.filter(pe=>pe.id!=V),B)),set:V=>i(B=>(B.static.weekdays=[...V],B))},monthStore:{subscribe:b.subscribe,add:V=>i(B=>(B.static.months.push({type:"month",name:V??"",length:0,id:Le(6),interval:1,offset:0}),B.static.padMonths=El(B.static.months),B.static.padDays=xl(B.static.months),B)),update:(V,B)=>i(pe=>(pe.static.months.splice(pe.static.months.findIndex(De=>De.id==V),1,B),pe.static.padMonths=El(pe.static.months),pe.static.padDays=xl(pe.static.months),pe)),delete:V=>i(B=>(B.static.months=B.static.months.filter(pe=>pe.id!=V),B.static.padMonths=El(B.static.months),B.static.padDays=xl(B.static.months),B)),set:V=>i(B=>(B.static.months=[...V],B.static.padMonths=El(B.static.months),B.static.padDays=xl(B.static.months),B))},yearStore:{customYears:C,subscribe:D.subscribe,add:V=>i(B=>(B.static.years||(B.static.years=[]),B.static.years.push({type:"year",name:V??"",id:Le(6)}),B)),update:(V,B)=>i(pe=>(pe.static.years||(pe.static.years=[]),pe.static.years.splice(pe.static.years.findIndex(De=>De.id==V),1,B),pe)),delete:V=>i(B=>(B.static.years||(B.static.years=[]),B.static.years=B.static.years.filter(pe=>pe.id!=V),B)),set:V=>i(B=>(B.static.years=[...V],B))},eventStore:{subscribe:xe.subscribe,sortedStore:de(xe,V=>ii(V)),set:V=>i(B=>(B.events=[...V],B)),add:V=>i(B=>(B.events.push({...V}),B)),update:(V,B)=>i(pe=>{let De=pe.events.findIndex(rt=>rt.id===V);return pe.events.splice(De,1,{...B}),pe}),delete:V=>i(B=>(B.events=B.events.filter(pe=>pe.id!==V),B))},categoryStore:{subscribe:Pe.subscribe,set:V=>i(B=>(B.categories=[...V],B)),add:V=>i(B=>(B.categories.push({...V}),B)),update:(V,B)=>i(pe=>{let De=pe.categories.findIndex(rt=>rt.id===V);return pe.categories.splice(De,1,{...B}),pe}),delete:V=>i(B=>(B.categories=B.categories.filter(pe=>pe.id!==V),B))},displaySeasonalColors:{subscribe:N.subscribe,set:V=>{i(B=>(B.seasonal.displayColors=V,B))}},interpolateColors:{subscribe:L.subscribe,set:V=>{i(B=>(B.seasonal.interpolateColors=V,B))}},seasonOffset:{subscribe:Z.subscribe,set:V=>{i(B=>(B.seasonal.offset=V,B))}},seasonType:{subscribe:j.subscribe,set:V=>{i(B=>(B.seasonal.type=V,B.seasonal.type===ot.DATED?B.seasonal.seasons=B.seasonal.seasons.map((pe,De)=>({id:pe.id,name:pe.name,color:pe.color,type:ot.DATED,kind:Dt.NONE,month:0,day:1+De,weatherOffset:pe.weatherOffset,weatherPeak:pe.weatherOffset*.1})):B.seasonal.seasons=B.seasonal.seasons.map(pe=>({id:pe.id,name:pe.name,color:pe.color,type:ot.PERIODIC,kind:Dt.NONE,duration:Bi(B)/B.seasonal.seasons.length,peak:0,weatherOffset:pe.weatherOffset,weatherPeak:pe.weatherOffset*.1})),B))}},seasonStore:{subscribe:M.subscribe,set:V=>i(B=>(B.seasonal.seasons=[...V],B)),add:V=>i(B=>(B.seasonal.seasons.push({...V}),B.seasonal.type===ot.DATED&&B.seasonal.seasons.sort((pe,De)=>Uo(pe.month,De.month)?pe.month-De.month:pe.day-De.day),B)),update:(V,B)=>i(pe=>{let De=pe.seasonal.seasons.findIndex(rt=>rt.id===V);return De<0?pe.seasonal.seasons.push({...B}):pe.seasonal.seasons.splice(De,1,{...B}),pe.seasonal.type===ot.DATED&&pe.seasonal.seasons.sort((rt,Mt)=>Uo(rt.month,Mt.month)?rt.month-Mt.month:rt.day-Mt.day),pe}),delete:V=>i(B=>(B.seasonal.seasons=B.seasonal.seasons.filter(pe=>pe.id!==V),B.seasonal.type===ot.DATED&&B.seasonal.seasons.sort((pe,De)=>Uo(pe.month,De.month)?pe.month-De.month:pe.day-De.day),B))},weatherStore:{subscribe:X.subscribe,enabled:{subscribe:fe.subscribe,set:V=>i(B=>(B.seasonal.weather.enabled=V,B))},seed:{subscribe:ee.subscribe,set:V=>i(B=>(B.seasonal.weather.seed=V,B))},tempUnitsStore:{subscribe:te.subscribe,set:V=>i(B=>(B.seasonal.weather.tempUnits=V,B))},windUnitsStore:{subscribe:ge.subscribe,set:V=>i(B=>(B.seasonal.weather.windUnits=V,B))}},locationStore:{subscribe:he.subscribe,set:V=>i(B=>(B.locations.locations=[...V],B)),add:V=>i(B=>(B.locations.locations.push({...at(V)}),B)),update:(V,B)=>i(pe=>{let De=pe.locations.locations.findIndex(rt=>rt.id===V);return De<0?pe.locations.locations.push({...at(B)}):pe.locations.locations.splice(De,1,{...at(B)}),pe}),delete:V=>i(B=>(B.locations.locations=B.locations.locations.filter(pe=>pe.id!==V),B.locations.defaultLocation==V&&(B.locations.defaultLocation=La),B)),defaultLocationStore:{subscribe:ue.subscribe,set:V=>i(B=>(B.locations.defaultLocation=V,B))}},displayMoons:{subscribe:w.subscribe,set:V=>{i(B=>(B.static.displayMoons=V,B))}},moonStore:{subscribe:k.subscribe,set:V=>i(B=>(B.static.moons=[...V],B)),add:V=>i(B=>(B.static.moons.push({...V}),B)),update:(V,B)=>i(pe=>{let De=pe.static.moons.findIndex(rt=>rt.id===V);return De<0?pe.static.moons.push({...B}):pe.static.moons.splice(De,1,{...B}),pe}),delete:V=>i(B=>(B.static.moons=B.static.moons.filter(pe=>pe.id!==V),B))},leapDayDisabled:de(b,V=>V.filter(B=>B.name?.length).length==0),eraStore:{subscribe:S.subscribe,set:V=>i(B=>(B.static.eras=[...V],B)),add:V=>i(B=>(B.static.eras.push(at(V)),B)),update:(V,B)=>i(pe=>{let De=pe.static.eras.findIndex(rt=>rt.id===V);return pe.static.eras.splice(De,1,at(B)),pe}),delete:V=>i(B=>(B.static.eras=B.static.eras.filter(pe=>pe.id!==V),B))},leapDayStore:{subscribe:T.subscribe,set:V=>i(B=>(B.static.leapDays=[...V],B)),add:V=>i(B=>(B.static.leapDays.push({...V}),B)),update:(V,B)=>i(pe=>{let De=pe.static.leapDays.findIndex(rt=>rt.id===V);return pe.static.leapDays.splice(De,1,{...B}),pe}),delete:V=>i(B=>(B.static.leapDays=B.static.leapDays.filter(pe=>pe.id!==V),B))},canRedo:u,redo:c,canUndo:f,undo:d}}var Sl=g6;var Av=require("obsidian");var Mc=class extends fc{constructor(t){super();this.calendars=t;this.permanentlyDelete=[];this.saveText="Restore"}async display(){this.contentEl.empty(),this.item||(this.item=[]),this.titleEl.setText("Restore calendars");for(let t of this.calendars.filter(n=>!this.permanentlyDelete.includes(n.id)))new Av.Setting(this.contentEl).setName(t.name).addToggle(n=>{n.setValue(!1).onChange(a=>{a?this.item.push(t):this.item.remove(t)})}).addExtraButton(n=>{n.setIcon(Lt).onClick(()=>{this.permanentlyDelete.push(t.id),this.display()})})}};var Y3=Gn(Rp());var Al=require("obsidian");var Mv=[{name:"Gregorian Calendar",description:"A calendar for the real world.",path:[],supportInlineEvents:!1,inlineEventTag:"inline-events",showIntercalarySeparately:!0,static:{displayDayNumber:!1,incrementDay:!0,displayMoons:!0,firstWeekDay:1,overflow:!0,weekdays:[{type:"day",name:"Sunday",id:"ID_19ea684b4a08"},{type:"day",name:"Monday",id:"ID_2928b90ab949"},{type:"day",name:"Tuesday",id:"ID_0ad9a8f9e95b"},{type:"day",name:"Wednesday",id:"ID_195a4b290bc9"},{type:"day",name:"Thursday",id:"ID_abe8c89b0999"},{type:"day",name:"Friday",id:"ID_2b5b8a79fa4a"},{type:"day",name:"Saturday",id:"ID_1a78cb79c8cb"}],months:[{name:"January",type:"month",length:31,interval:1,offset:0,id:"ID_e9997a780b3a"},{name:"February",type:"month",length:28,interval:1,offset:0,id:"ID_b8c9ebeb0b89"},{name:"March",type:"month",length:31,interval:1,offset:0,id:"ID_b83bda2b9be8"},{name:"April",type:"month",length:30,interval:1,offset:0,id:"ID_29baea7b28ab"},{name:"May",type:"month",length:31,interval:1,offset:0,id:"ID_6a3899fad909"},{name:"June",type:"month",length:30,interval:1,offset:0,id:"ID_384aeb1afa8a"},{name:"July",type:"month",length:31,interval:1,offset:0,id:"ID_48b8cba87b8a"},{name:"August",type:"month",length:31,interval:1,offset:0,id:"ID_fa0b1a6bab8a"},{name:"September",type:"month",length:30,interval:1,offset:0,id:"ID_da880b8af849"},{name:"October",type:"month",length:31,interval:1,offset:0,id:"ID_babba8186968"},{name:"November",type:"month",length:30,interval:1,offset:0,id:"ID_da582bfaf9b9"},{name:"December",type:"month",length:31,interval:1,offset:0,id:"ID_ba1bab4a3a28"}],moons:[{name:"Moon",cycle:29.530588853,offset:9.24953,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_a9ab186b1819"}],leapDays:[{name:"Leap Day",type:"leapday",interval:[{ignore:!1,exclusive:!1,interval:400},{ignore:!1,exclusive:!0,interval:100},{ignore:!1,exclusive:!1,interval:4}],offset:0,timespan:1,intercalary:!1,id:"ID_b91ad86a887a"}],eras:[{name:"Before Christ",format:"{{era_name}}",id:"ID_9a2978c92baa",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!0,date:{year:1,month:0,day:1}},{name:"Anno Domini",format:"{{era_name}}",date:{year:1,month:0,day:1},id:"ID_a8db38899a2b",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!1}],offset:0,padDays:2,padMonths:2},seasonal:{seasons:[{id:"STANDARD_WINTER",name:"Winter",color:"#ADD8E6",kind:"Winter",type:"Periodic",duration:91.310625,weatherOffset:56,weatherPeak:5},{id:"STANDARD_SPRING",name:"Spring",kind:"Spring",color:"#90EE90",type:"Periodic",duration:91.310625,weatherOffset:56,weatherPeak:5},{id:"STANDARD_SUMMER",name:"Summer",kind:"Summer",color:"#FFFF00",type:"Periodic",duration:91.310625,weatherOffset:56,weatherPeak:5},{id:"STANDARD_AUTUMN",name:"Autumn",kind:"Autumn",color:"#DAA520",type:"Periodic",duration:91.310625,weatherOffset:56,weatherPeak:5}],offset:-12.5,type:"Periodic",displayColors:!0,interpolateColors:!0,weather:{enabled:!1,seed:1,tempUnits:et.IMPERIAL,windUnits:et.METRIC,primaryWindDirection:"E"}},locations:{locations:[]},current:{year:null,day:null,month:null},events:[{name:"Summer Solstice",description:"At the summer solstice, the Sun travels the longest path through the sky, and that day therefore has the most daylight.",id:"824599",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Winter Solstice",description:"The winter solstice marks the shortest day and longest night of the year, when the sun is at its lowest arc in the sky.",id:"824600",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Spring Equinox",description:"The equinox marks the day and the night is equally as long.",id:"824601",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Autumn Equinox",description:"The equinox marks the day and the night is equally as long.",id:"824602",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Christmas",description:"Christmas is a Christian holiday celebrating the birth of Christ. Due to a combination of marketability and long lasting traditions it is popular even among many non-Christians, especially in countries that have a strong Christian tradition.",id:"824603",note:null,date:{day:25,month:11,year:[null,null]},type:U.Recurring,category:"christian-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Paschal Full Moon",description:"The first full moon after march 21st, which is considered the fixed date for the spring equinox.",id:"824604",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:"christian-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Easter",description:"Easter is considered the most important feast for Christians, celebrating the resurrection of Christ. It is classed as a moveable feast occurring on the first full moon after the spring equinox, which is considered to be fixed at March 21st for the sake of computing the date.",id:"824605",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:"christian-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Easter Monday",description:"The Monday following the Easter Sunday is often considered part of the Easter Celebration and is a day off in many countries with a strong Christian tradition.",id:"824606",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:"christian-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Good Friday",description:"Good Friday is the Friday preceding Easter. It comemmorates the crucifixion of Christ according to the Bible.",id:"824607",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:"christian-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Pentecost",description:"Celebrated exactly 50 days after Easter, Pentecost is the celebration of the Holy Spirit appearing before the Apostles as described in the Bible.",id:"824608",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:"christian-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"New Year's Day",description:"New Year's Day marks the date of a new year on the Gregorian Calendar. It dates when the clock strikes midnight and is often celebrated with fireworks, champagne and kissing.",id:"824609",note:null,date:{day:1,year:[null,null],month:0},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Valentine's Day",description:"Valentine's day is a celebration of love and romance that is popular across the world. Many more cynically minded people mostly consider it an attempt to monetize the expectation of romantic gestures on the holiday through gift cards, flowers, chocolate and dates.",id:"824610",note:null,date:{day:14,year:[null,null],month:1},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Halloween",description:'Halloween is holiday popular in the US, Canada and Ireland that has gradually been adopted by more and more countries. It is often celebrated by people dressing up, usually as something scary. Children will often go from door to door shouting "trick or treat" in the hopes of receiving candy, while adults tend to go to parties.',id:"824611",note:null,date:{day:31,year:[null,null],month:9},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Introduction of the Gregorian Calendar",description:"On this day in 1582 the Gregorian calendar was officially introduced, following Thursday October 4th on the Julian Calendar",id:"824614",note:null,type:U.Date,date:{day:15,year:1582,month:9},category:"historical-events",sort:{timestamp:Number.MIN_VALUE,order:""}}],id:null,categories:[{name:"Natural Events",id:"natural-events",color:"#2E7D32"},{name:"Christian Holidays",id:"christian-holidays",color:"#9b2c2c"},{name:"Secular Holidays",id:"secular-holidays",color:"#0D47A1"},{name:"Historical Events",id:"historical-events",color:"#455A64"},{name:"Miscellaneous Events",id:"miscellaneous-events",color:"#0288D1"}]},{name:"Calendar of Greyhawk",description:"Create the calendar of Oerth",path:[],supportInlineEvents:!1,inlineEventTag:"inline-events",showIntercalarySeparately:!0,static:{displayDayNumber:!1,incrementDay:!1,displayMoons:!0,firstWeekDay:0,overflow:!1,padDays:2,padMonths:2,weekdays:[{type:"day",name:"Starday",id:"ID_a8e979984938"},{type:"day",name:"Sunday",id:"ID_1b68bb78ca1b"},{type:"day",name:"Moonday",id:"ID_c8b86aea0998"},{type:"day",name:"Godsday",id:"ID_b8097a18e95b"},{type:"day",name:"Waterday",id:"ID_1918c99949ca"},{type:"day",name:"Earthday",id:"ID_fa295a1bab89"},{type:"day",name:"Freeday",id:"ID_6a485ada3ae8"}],months:[{name:"Needfest",type:"month",length:7,interval:1,offset:0,id:"ID_b8a9e9da8a48"},{name:"Fireseek",type:"month",length:28,interval:1,offset:0,id:"ID_39b90bd8189a"},{name:"Readying",type:"month",length:28,interval:1,offset:0,id:"ID_48a9081ad839"},{name:"Coldeven",type:"month",length:28,interval:1,offset:0,id:"ID_5a7b6beadb68"},{name:"Growfest",type:"month",length:7,interval:1,offset:0,id:"ID_48c8d82b1908"},{name:"Planting",type:"month",length:28,interval:1,offset:0,id:"ID_081a793a49da"},{name:"Flocktime",type:"month",length:28,interval:1,offset:0,id:"ID_eb68a89a0a2a"},{name:"Wealsun",type:"month",length:28,interval:1,offset:0,id:"ID_9b3a098ae908"},{name:"Richfest",type:"month",length:7,interval:1,offset:0,id:"ID_f99b4b3a08b8"},{name:"Reaping",type:"month",length:28,interval:1,offset:0,id:"ID_ebe9eb68ea39"},{name:"Goodmonth",type:"month",length:28,interval:1,offset:0,id:"ID_fb3b6af9895b"},{name:"Harvester",type:"month",length:28,interval:1,offset:0,id:"ID_395bcb399b8a"},{name:"Brewfest",type:"month",length:7,interval:1,offset:0,id:"ID_e8b908181afa"},{name:"Patchwall",type:"month",length:28,interval:1,offset:0,id:"ID_cbda3b399969"},{name:"Ready'reat",type:"month",length:28,interval:1,offset:0,id:"ID_592a2a690bf8"},{name:"Sunsebb",type:"month",length:28,interval:1,offset:0,id:"ID_39e8faf8e9b8"}],moons:[{name:"Luna",cycle:28,offset:3,faceColor:"#ffffff",shadowColor:"#292b4a",id:"ID_f8997b39b8b8"},{name:"Celene",cycle:91,offset:46,faceColor:"#ffffff",shadowColor:"#292b4a",id:"ID_7afbb9b88be8"}],leapDays:[],eras:[{name:"Common Year",format:"{{era_name}}",date:{year:1,month:0,day:1},id:"ID_db994869db7b",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!1}]},seasonal:{seasons:[],offset:0,type:"Periodic",displayColors:!0,interpolateColors:!0,weather:{enabled:!1,seed:1,tempUnits:et.IMPERIAL,windUnits:et.METRIC,primaryWindDirection:"E"}},locations:{locations:[]},current:{year:591,day:1,month:0},events:[{name:"Winter Solstice",description:"The winter solstice marks the shortest day and longest night of the year, when the sun is at its lowest arc in the sky.",id:"824573",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Spring Equinox",description:`The 4th of Growfest is the first day of Low Summer in Oerth's Calendar. This is the point where the sun crosses Oerth's equator. Holidays celebrated on this date include Saint Cuthbert's Day, the Feast of Edoira, the Spring Feast, and Raxivort's Orgy. This is also the day on which the priests of Tlaloc ritually sacrifice and eat the flesh of human children or babies in their patron's honor. Worshippers of Rillifane Rallathil celebrate the Budding on this day, a joyful celebration of new life celebrated through dance and song in oak groves in the heart of the forest. A ritual hunt of a noble heart is held on this day, after which the venison is eaten in celebration of Rillifane's bounty. Also celebrated on this date is the Sanctification of Renewal, a sacred holiday to the followers of Garyx.`,id:"824574",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Summer Solstice",description:" At the summer solstice, the Sun travels the longest path through the sky, and that day therefore has the most daylight.",id:"824575",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Autumn Equinox",description:"The 4th of Brewfest is the Autumnal Equinox, when the sun crosses the equator from north to south. This date is the official end of high summer and the beginning of autumn on the Greyhawk Calendar. This date is holy to Wenta and is sometimes regarded as an unofficial holy day of Velnius. Among the xvarts, it also marks the celebration of Raxivort's Orgy. The worshippers of Rillifane Rallathil celebrate the Transformation on this day, a time of dancing and spiritual rebirth marking the beginning of autumn and the promise that spring will come again.",id:"824576",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Great Moons Glory",description:"The night of Great Moon's Glory on Readying 11th, when Luna is full but Celene is new. It is holy to Celestian, and a time when offerings are left to Atroa to beg her to come early and to Telchur to request that he peacefully leave. Druids of the Old Faith are known to also hold this night as auspicious, but few outside their circles know the details.",id:"824577",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Dark Night",description:`Dark Night, also called Black Night, Star Night, and the Night of Hopeful Dawn, is observed on Goodmonth 11. It is a holy night for the church of Celestian because the stars are so easy to observe without the light of one of the moons getting in the way. It is also a holy night for the church of Rao, who refer to it as the Night of Hopeful Judgment. They believe that Rao chooses this time to separate the sinful from the righteous in the afterworld. There is also a prophecy in the Raoan holy text, the Book of Incarum, that claims that Rao will cleanse the world of evil on this night, sometime in the future. The priesthood of Kurell consider it holy, too, calling it Kurell's Night, requiring the faithful to undertake special missions on this night to prove their cleverness and skill. Kurell smiles particularly on acts of theft or vengeance performed on his holy night, blessing those who do so successfully. Donations to Kurell's church are encouraged afterwards, for Kurell may take vengeance against those who do not properly thank him for his aid. Most other people regard Dark Night as a time of ill omen, fearing it as much as the night of the Blood Moon Festival. Bonfires are burned from dusk till dawn, particularly in small villages and in Elmshire and Narwell. Orc and goblin religions view it as an excellent night for raiding settlements. Certain evil cults perform kidnappings, murders, and vile rites during this period. On the other hand, lycanthropic activity is at its lowest. Iggwilv and Tuerny attempted to summon a demonic army to Luna on this night in 585 CY.`,id:"824578",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Agelong",description:`Agelong, observed on the 4th of Richfest (the Summer Solstice), is the celebration of the legendary creation of the elves. According to myth, after Corellon Larethian spilled his blood during the battle with Gruumsh, the rest of the Seldarine gathered this sacred blood and mingled it with the tears shed during the same battle by Sehanine Moonbow. The Seldarine then infused these divine fluids into vessels they had created to be the bodies of the elven race. This day is, among the elves, mostly an excuse to go orc-hunting. Elven warriors cut themselves with daggers carved from volcanic glass to remind themselves of Corellon's own wound from Gruumsh's spear, then strive to slaughter as many orcs as possible during the night.`,id:"824579",note:null,date:{day:4,year:[null,null],month:8},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Blood Moon Festival",description:`The Blood Moon Festival is celebrated on Coldeven 11, the night when Luna is full just before the Spring Equinox. On this night, curses are said to be twice as powerful and the forces of evil are at their strongest. Fiends roam the lands, and human sacrifice is common. This night is held especially sacred by cultists of Nerull, but worshipers of Kurell also mark this night as especially auspicious for acts of vengeance. Goodly folk superstitiously guard their homes with horseshoes, holy water, bottles of milk, and iron filings. Demonic forces sent by Iuz destroyed the leadership of the Horned Society during the Blood Moon Festival of 583 CY. It's possible that this is also the night the elves celebrate as Faerieluck.`,id:"824580",note:null,date:{day:11,year:[null,null],month:3},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Breadgiving Day",description:`Celebrated on on the Winter Solstice (Needfest 4), Breadgiving Day, is a day of charity observed in the Free City of Greyhawk by the faiths of Pelor, Rao, and Saint Cuthbert. This was not originally a religious holiday as such. It is a new practice that began after the Greyhawk Wars to feed the refugees that flooded the city during that time. Since of Old City who line up by the hundreds along the Processional from the Black Gate. The booths are worked by low-ranking priests from all three religions, with armed priests of St. Cuthbert providing security. A smaller event is held simultaneously below Wharfgate in Greyhawk City's Shacktown. The clergies of Heironeous, Pholtus, and Trithereon do not participate, but they compete with one another to perform good deeds the whole week of Needfest. The rivalries between Trithereon and Pholtus, Trithereon and Heironeous, and Pholtus and St. Cuthbert are such that the faiths sometimes fall into arguments and even blows if their "good deeds" conflict with each other. Greyhawk's rowdy citizens often cheer and place bets on the outcomes of these quarrels. The priests of Pelor hold a morning ceremony on this day with a sermon, singing, and music.`,id:"824581",note:null,date:{day:4,year:[null,null],month:0},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Brewfest",description:`Also called Drunken Days or the Feast of Brewers, Brewfest, the fourth festival week of Oerth's calendar, is a rowdy period unsurprisingly claimed as a holy time by the churches of Olidammara and Wenta. The Free City of Greyhawk does not celebrate the entire week, but Brewfest 1 and Brewfest 7 are both set aside as public holidays. In Elmshire, the week is spent in restful, carefree music, drinking, and dancing. In Hardby it is spent with fistfights, riots, and ensuing hangovers. In Narwell it is celebrated with ale-brewing contests, horse races, beatings, and robbery. In Safeton it is celebrated with nervous violence and nightly orc hunts. The week is also sacred to the Old Faith. The elves call this week Fallrite, and use it to contemplate the spirits of their ancestors, the passage to the afterworld, and the fragility of life. They believe other races make merry during Brewfest because they are "hiding" to avoid facing death's reality. In contrast, the olvenfolk strive to fulfill the most important of their duties and reach the most crucial of their decisions during this time of year. The elven kings and queens traditionally judge capital cases during Fallrite.`,id:"824582",note:null,date:{day:4,year:[null,null],month:12},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Faerieluck",description:"Faerieluck is a holiday celebrated by the elves in early spring, when the power of Faerie runs high and they celebrate with their fey cousins: the sprites, buckawns, pixies, nymphs and so forth. The point of the festival is to remind the elves of their ancient kinship with these creatures. The day is spent playing practical jokes, engaging in battles of wit, and general merriment.",id:"824583",note:null,date:{day:11,year:[null,null],month:2},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Feast of Edoira",description:`The Feast of Edoira is a holiday celebrated in the Domain of Greyhawk on Growfest 4, during the Spring Equinox. It is named after Edoira, a priest of Rao who centuries ago established the Edoiran Compact, a pact by which many of the lawful good-aligned faiths and people of the Domain could agree to cooperate. The Compact was later extended to non-lawful good and neutral faiths. Edoira was never deified but was revered by many good faiths in the Domain. The holiday was marked by religious services on Godsday of Growfest led by the clerics of the good faiths who partook of the Compact, and secular festivals by the ordinary citizenry. Observance of the holiday has declined over the years, though the clergies of Rao and Pelor still hold their traditional interfaith services, with occasional participation by the priesthoods of Heironeous and Mayaheine. Since the end of the Greyhawk Wars most of the Domain's outlying communities no longer observe the holiday. Only one church in Safeton still does so.`,id:"824584",note:null,date:{day:4,year:[null,null],month:4},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Desportium of Magic",description:`The highlight of Growfest is the Desportium of Magic. During this day torchlight only, no magic illumination is supposed to be used. Wizards and Sorcerers then perform feats of illusion and magic trying to outdo one another with their displays. Usually there is a panel of judges to decide, in the larger cities there is usually a limit of 5-person teams competing. Each performance during the Desportium of Magic uses a long established theme, that of an attack on the town by various monsters and Dark Elves, repelled by brave warriors and spellcasters. The displays, made up of any number of spells cast without the use of magic devices, cannot actually cause any harm to property or people, but must be as wonderful, striking, detailed, and lifelike as possible. This motif is based on actual attacks through the years from the Uttermost War to the most recent Great Slave Raids. The idea is to make the attackers as dreadful as possible and the defenders as heroic as possible, secondary is to make sure that people will always remember the terror of the Uttermost War. In large cities like the CSIO and CSWE and Tarantis, these performances last all night and are amazing to watch. In smaller villages without spellcasters, puppet plays are often done in its stead.`,id:"824585",note:null,date:{day:7,year:[null,null],month:4},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Holy Day of Pelor",description:`The Holy Day of Pelor, also known as Giving Day and Midsummer's Day, is celebrated on the Summer Solstice. Because Pelor is widely loved by the commoners, this day is set aside as a day of rest in the Free City of Greyhawk. Only essential work is done on this day. Many merchants close their shops on Giving Day as well out of respect for the Sun Father and his teachings. Gambling houses are closed, but not hostelries, for Giving Day is a day of feasting and goodwill, a time for enjoying the fruits of the Oerth. Public services are held from dawn until noon by Pelor's priests, outdoors if the weather permits (which if almost always does, as the clerics use weather-controlling magic for maximum sunlight). Even Greyhawk City's large temple of Pelor is not big enough to hold the throngs who come to celebrate on this day, so throngs of the faithful fill the temple grounds in the Garden Quarter, spilling out from the Millstream to the Nobles' Wall, and to the road leading toward Greyhawk's Grand Theater. Many come, of course, for the free meal the priests provide after the service. The Pelorian priests are well aware of this, but believe that for the needy, a full stomach must come before wisdom and learning. Members of Greyhawk's Guild of Thieves and Beggar's Union, many of whom remember Midsummer's Day fondly from their orphaned childhoods, both protect priests of Pelor on this day, and woe onto those who attempt to test them on this matter. Priests of Pelor, bedecked in yellow and gold, parade about the streets, demanding donations for their charitable works, freely using guilt to squeeze more from stingy purses. Free healings are given out, particularly to children. Most Greyhawkers wear at least one item of yellow cloth on this day out of respect. Some crusading Pelorians crusade against evil lycanthropes on this night, since both Celene and Luna are full.`,id:"824586",note:null,date:{day:4,year:[null,null],month:8},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Holy Day of Serenity",description:"The Holy Day of Serenity, on Reaping 10, is celebrated in Veluna as a holy day of Rao, though it's actually the anniversary of Veluna's secession from Furyondy in 476 CY. It is celebrated with religious singing and worship.",id:"824587",note:null,date:{day:10,year:[null,null],month:9},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}}],id:null,categories:[{name:"Natural Events",id:"natural-events",color:"#2E7D32"},{name:"Religious Holidays",id:"religious-holidays",color:"#FFEB3B"},{name:"Secular Holidays",id:"secular-holidays",color:"#0D47A1"},{name:"Magical Events",id:"magical-events",color:"#311B92"},{name:"Miscellaneous Events",id:"miscellaneous-events",color:"#0288D1"}]},{name:"Calendar of Golarion",description:"Calendar for the world of Pathfinder.",path:[],supportInlineEvents:!1,inlineEventTag:"inline-events",showIntercalarySeparately:!0,static:{displayDayNumber:!1,firstWeekDay:0,incrementDay:!1,displayMoons:!0,overflow:!0,padDays:2,padMonths:2,weekdays:[{type:"day",name:"Moonday",id:"ID_db8af8f85b8a"},{type:"day",name:"Toilday",id:"ID_f87a094b2849"},{type:"day",name:"Wealday",id:"ID_2a5bb88b3ae8"},{type:"day",name:"Oathday",id:"ID_c93a0be8981b"},{type:"day",name:"Fireday",id:"ID_2b7b59794a0b"},{type:"day",name:"Starday",id:"ID_baaa6a89ca1b"},{type:"day",name:"Sunday",id:"ID_f9baca088b28"}],months:[{name:"Abadius",type:"month",length:31,interval:1,offset:0,id:"ID_dad9da89f818"},{name:"Calistril",type:"month",length:28,interval:1,offset:0,id:"ID_980a88cb9b68"},{name:"Pharast",type:"month",length:31,interval:1,offset:0,id:"ID_a9c96ac80908"},{name:"Gozran",type:"month",length:30,interval:1,offset:0,id:"ID_a99a697b9abb"},{name:"Desnus",type:"month",length:31,interval:1,offset:0,id:"ID_8bcad9a8f84a"},{name:"Sarenith",type:"month",length:30,interval:1,offset:0,id:"ID_484a49a998db"},{name:"Erastus",type:"month",length:31,interval:1,offset:0,id:"ID_9a48e9b96938"},{name:"Arodus",type:"month",length:31,interval:1,offset:0,id:"ID_bbe99b2afaea"},{name:"Rova",type:"month",length:30,interval:1,offset:0,id:"ID_ba39fbe8c8b8"},{name:"Lamashan",type:"month",length:31,interval:1,offset:0,id:"ID_69d93ba9dba8"},{name:"Neth",type:"month",length:30,interval:1,offset:0,id:"ID_4ad8fb79eb6a"},{name:"Kuthona",type:"month",length:31,interval:1,offset:0,id:"ID_9a3a8b388939"}],moons:[{name:"Somal",cycle:29.5,offset:9.5,faceColor:"#ffffff",shadowColor:"#292b4a",id:"ID_b87ab959cac9"}],leapDays:[{name:"Leap Day",type:"leapday",interval:[{ignore:!1,exclusive:!1,interval:8}],offset:0,timespan:1,intercalary:!1,id:"ID_88c8da3b8b2b"}],eras:[{name:"Age of Serpents",format:"{{era_name}}",date:{year:4720,month:8,day:15},id:"ID_eb4af87babaa",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!1},{name:"Age of Darkness",format:"{{era_name}}",date:{year:-5300,month:0,day:1},id:"ID_58e99a8b9b9a",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!1},{name:"Age of Anguish",format:"{{era_name}}",date:{year:-4500,month:8,day:1},id:"ID_3af84ada898a",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!1},{name:"Age of Destiny",format:"{{era_name}}",date:{year:-3500,month:8,day:1},id:"ID_abc87ad9fbfb",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!1},{name:"Age of Enthronement",format:"{{era_name}}",date:{year:1,month:8,day:1},id:"ID_19197be9dac8",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!1},{name:"Age of Lost Omens",format:"{{era_name}}",date:{year:4606,month:8,day:1},id:"ID_7b585b5bd9ea",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!1}]},seasonal:{seasons:[],offset:0,type:"Periodic",displayColors:!0,interpolateColors:!0,weather:{enabled:!1,seed:1,tempUnits:et.IMPERIAL,windUnits:et.METRIC,primaryWindDirection:"E"}},locations:{locations:[]},current:{year:4720,day:15,month:0},events:[{name:"Summer Solstice",description:"At the summer solstice, the Sun travels the longest path through the sky, and that day therefore has the most daylight.",id:"824492",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Winter Solstice",description:"The winter solstice marks the shortest day and longest night of the year, when the sun is at its lowest arc in the sky.",id:"824493",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Spring Equinox",description:"The equinox marks the day and the night is equally as long.",id:"824494",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Autumn Equinox",description:"The equinox marks the day and the night is equally as long.",id:"824495",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Eternal Kiss",description:`Zon-Kuthon Culminating on the first new moon of the new year, the Eternal Kiss is an 11 day ceremony honoring Zon-Kuthon. On the final day, a living sacrifice is made to the Dark Prince, after the victim is pampered and pleasured for the ten days prior. The sacrifice can either be an enemy or a great devotee of the church, and is kept alive for as long as possible during the torture using magic. This holiday often involves fortune-telling as a part of the torture, using the victim's entrails or their cries of pain to determine the Midnight Lord's will. Occasionally it is believed that the sacrifice will prophesy with the voice of Zon-Kuthon himself.`,id:"824496",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Longnight",description:"Longnight is a holiday celebrated on the full moon in the winter month of Abadius. During the festival, revelers stay up all night to greet the dawn to defy the long winter months. It is even celebrated in Irrisen, where there are no natural seasons.",id:"824497",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Foundation Day",description:`Absalom, Milani Foundation Day is a civil holiday celebrated on the New Year (1 Abadius) in Absalom to commemorate the city's founding by the god Aroden in 1 AR.`,id:"824498",note:null,date:{day:1,year:[null,null],month:0},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Pjallarane Day",description:`Irrisen Pjallarane Day is an ancient holiday in Irrisen celebrated on 1 Abadius (New Year's Day). Every 100 years, Baba Yaga returns to Golarion to remove her daughter from the throne of Irrisen, and put another daughter on the throne instead. In 3713 AR the third Queen of Irrisen, Pjallarane, and her children chose to resist. Baba Yaga ruthlessly crushed the rebellion in a single day, which is now celebrated as a holiday. The festival includes feasting and the burning of effigies of tar and straw. This is a reminder of the fate of Pjallarane's followers, who were burned alive as a warning to all those who would oppose Baba Yaga.`,id:"824499",note:null,date:{day:1,year:[null,null],month:0},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Vault Day",description:`Abadar Vault Day is a holiday held on 6 Abadius in honor of Abadar, Master of the First Vault.`,id:"824500",note:null,date:{day:6,year:[null,null],month:0},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Ruby Prince's Birthday",description:`Osirion The Ruby Prince's Birthday is a national holiday in Osirion in honor of the birthday of Khemet III, the Ruby Prince. It is celebrated annually on the 20 Abadius.`,id:"824501",note:null,date:{day:20,year:[null,null],month:0},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Merrymead",description:`Druma, Cayden Cailean A holiday occurring on 2 Calistril, Merrymead was dateed in Druma and is supposed to be a time to share of the last of the previous year's mead with the rest of the community. In current times, most people just use it as an excuse to drink excessively. The poor travel from bar to bar drinking whatever alcohol they can afford, while the wealthy will set aside specific vintages for this day. A known consequence of this day are 'mead riots' that happen when there are more celebrants than there is alcohol to serve them. This leads to a violent, destructive group of people in a crowded bar. If this is a common occurrence for particular cities, they may reinforce their guard force for the inevitably eventful night.`,id:"824502",note:null,date:{day:2,year:[null,null],month:1},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"King Eodred II's Birthday",description:`Korvosa King Eodred II's Birthday was a local holiday in the Varisian city-state of Korvosa and was celebrated on 16 Calistril. It commemorated the birthday of its former ruler, King Eodred Arabasti II, who decreed that on the day, scantily clad women would dance and serve free wine to celebrants.`,id:"824503",note:null,date:{day:16,year:[null,null],month:1},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Loyalty Day",description:`Cheliax, Asmodeus Loyalty Day is a holiday in the nation of Cheliax commemorating the date on Calistril 19, 4640 AR when House Thrune signed the Treaty of Egorian, declaring it the victor in the Chelish Civil War and ruler of the empire. Because of House Thrune's well-known ties to the infernal, this holiday is also observed by the Church of Asmodeus who consider it a feast day. The church along with local governments provide a free meal to all citizens to remind them of the benefits House Thrune provides them with.`,id:"824504",note:null,date:{day:19,year:[null,null],month:1},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Fateless Day",description:`Mahathallah Followers of Mahathallah mark each leap day as Fateless Day, when the River of Souls temporarily stops and souls can escape Pharasma's judgment. They perform many sacrificial and suicidal rituals on Fateless Day.`,id:"824505",note:null,date:{day:29,year:[null,null],month:1},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Golemwalk Parade",description:`Magnimar, Varisia The Golemwalk Parade is a parade of golems created by amateurs hoping to win a monetary grant, or even a job, from the Golemworks in Magnimar. At the end of the parade along the Avenue of Honors, the constructs are judged.`,id:"824506",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Day of Bones",description:`Pharasma Priests and worshipers of the Lady of Graves parade the bodies of the recently dead on this holiday, holding free burials afterwards.`,id:"824507",note:null,date:{day:5,year:[null,null],month:2},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Sable Company Founding Day",description:`Korvosa Sable Company Founding Day is a holiday marking the founding of the Sable Company of the Varisian city-state of Korvosa. Celebrated on 6 Pharast, the day is marked by somber military parades that generally preclude the consumption of alcohol, a staple on most other holidays.`,id:"824508",note:null,date:{day:6,year:[null,null],month:2},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Night of Tears",description:`Solku The Night of Tears held annually on 7 Pharast in the Katapeshi town of Solku. It is a solemn vigil commemorating those lost in the Battle of Red Hail in 4701 AR.`,id:"824509",note:null,date:{day:7,year:[null,null],month:2},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Kaliashahrim",description:`Qadira Kaliashahrim is a national holiday celebrated on Pharast 13 in Qadira that celebrates the Padishah Emperor of distant Katheer, and Qadira's loyalty to him.`,id:"824510",note:null,date:{day:13,year:[null,null],month:2},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Conquest Day",description:`Nex Every year, on the 26th of Pharast, Elder Architect Oblosk \u2014 oldest member of Nex's Council of Three and Nine \u2014 ascends to the highest balconies of the Bandeshar in Quantium. In a voice made thunderous by the platform's magic, the wizened pech councilman spends the hours from dusk to just past noon enumerating the atrocities committed by the necromancers of Geb upon the people of Nex, culminating with the disappearance of the archwizard Nex himself. At the conclusion of this record of national wounds, the country's eleven other council members join Oblosk in renewing their yearly vow to neither forget nor forgive the Gebbites' atrocities and to again swear in their lost ruler's name to endlessly wage war against their ancient enemies. On this day, known as Conquest Day, all the people of Nex are expected to share in their leaders' oaths, to celebrate the shared patriotism of their wondrous nation, and to remember the sacrifices of heroes past. This also makes it a day for many Nexian wizards to reveal deadly new spells, gigantic constructs, and audacious arcane masterworks\u2014which many creators promise to be the doom of their foes. Even throughout the rest of the Inner Sea region, many crusaders, rebels, and zealots observe Conquest Day as a day to renew blood oaths, launch long-planned battles, and finally take revenge. It is a day for words of honor, a day for battle cries, and a day where glory most favors the bold.`,id:"824511",note:null,date:{day:26,year:[null,null],month:2},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Days of Wrath",description:`Asmodeus, Cheliax The Days of Wrath, or Dies Irae, are a holiday celebrated on both solstices and equinoxes in the nation of Cheliax and wherever Asmodeus is worshiped. They are primarily a national holiday and not truly a religious one, but the two are often confused due to Cheliax's current political climate. Various contests and blood sports are held on these days, promoting those elites who can clearly demonstrate their superiority over others. Some believe that these competitions are watched and judged by devils themselves. In the parts of the world where the Prince of Darkness is not openly venerated, these holidays take on a different tone: they are used to settle old grievances and also to end contracts. In these days, bloodsports are organized into cities' stadiums. Slaves and servants of any master may choose to enter the arena for one-on-one bloody battles to the death. Free men and women of all classes are free to enter the arena as well. The entrants fight in rounds until at last one stands alone. The winner is granted freedom from slavery or servitude, erasure of all debts, and a purse of gold. The winter solstice sees the culmination of the Dies Irae, with all the winners of the three previous bouts summoned to Egorian to fight to the death for the amusement of the nobles. The winner is given a title of baronet and a plot of land.`,id:"824512",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Firstbloom",description:`Gozreh Firstbloom is a holiday celebrating the first planting of the agricultural season, and generally associated with the weather god Gozreh. It falls on the vernal equinox. Many farming communities see it as the beginning of the year, even though conventional calendars begin two months earlier. Despite weariness after a full day planting, many farming communities hold celebrations come the night: feasting, dancing and courtship feature showing the cycle of nature.`,id:"824513",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"First Cut",description:`Falcon's Hollow The First Cut celebration in Falcon's Hollow used to mark the date of the work in the woods each spring. Now, however, it is a meaningless ramshackle ceremony as Thuldrin Kreed forces the lumber crews to work through even during the coldest months in the winter. Still, First Cut brings people out to celebrate the date of the spring.`,id:"824514",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Currentseve",description:`Gozreh On this religious holiday, all who travel on the water make offerings to Gozreh in the hopes of safe passage for the coming year.`,id:"824515",note:null,date:{day:7,year:[null,null],month:3},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Taxfest",description:`Abadar No one enjoys paying taxes but the collection of fair taxes is considered an integral part of the maintenance of society, and is therefore holy to the god Abadar. Every year on the 15th of Gozran, priests of the church of Abadar spend the day walking city streets, doing what they can to make the bitter pill of annual taxes a bit easier to swallow. The Business of the Day From dawn to dusk, clerics of Abadar attend the tax collectors of sizeable communities as the tax wagons roll from door to door. The church officials monitor these activities to make sure that the process is conducted respectfully and justly, and that citizens know that the process is monitored. More than just aiding in the yearly errand, the faithful personally thank every citizen for contributing to the improvement of their city, extol the public works funded by their contributions, and foretell the grandeur of civic projects to come. The disenfranchised and destitute they attempt to comfort as best they can, quoting from their god's dogma on work and worthiness, but this is not a day for discounts or deferrals. The citizens are able to voice their concerns and ideas as to where the monies levied should best be applied. Citizens are free to speak their mind on any issue here without fear of repercussion. The Celebrations of the Day At dusk, the Abadarans host several celebrations in parks, plazas, and other communal areas about the city, organizing donations and contributions from local vendors to feed and entertain all-comers. Having already preached to most of the city over the course of the day, the clerics perform only a brief opening ceremony, dedicating the feast to Abadar, the city, and its great people. These celebrations are often quite distinct from neighbourhood to neighbourhood and are almost always divided along economic boundaries. The festivities involving the wealthiest citizens usually happen on the steps of city hall or other grand civic buildings and feature the best music and food, but often little more than polite card and guessing games. These galas usually wrap up by midnight. For the common folk, the parks and marketplaces take on a carnival atmosphere, with simple but good food, local ales, performances by talented citizens, and games of chance going on well into the night. A prevailing superstition through these festivals is that, during the celebration, it is lucky to kiss\u2014or in some regions, pinch\u2014a cleric of Abadar, leading to many a rosy-cheeked cleric. Even the city's poor are given reason to celebrate, as the local temple of Abadar hosts a cheery but unabashedly religious gathering on its steps, feeding all comers, doling out a hearty ration of wine, singing hymns of the faith, and providing tokens for a second wine ration for any who return to attend a service within the month. For a holiday that revolves around paying taxes, this Abadaran festival is not as reviled as one might expect.`,id:"824516",note:null,date:{day:15,year:[null,null],month:3},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Wrights of Augustana",description:`Andoran, Brigh This local festival in the Andoran port city of Augustana is held to honor and celebrate the local shipbuilding industry as well as the navy. The mathematics and engineering required for the building of the ships is praised by Brigh's faithful.`,id:"824517",note:null,date:{day:16,year:[null,null],month:3},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Gala of Sails",description:`Absalom One of two local festivals where kite-battlers compete.`,id:"824518",note:null,date:{day:27,year:[null,null],month:3},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Remembrance Moon",description:`Iomedae, Lastwall, Ustalav A national holiday to commemorate those who died in the Shining Crusade against the Whispering Tyrant. Although not strictly a religious holiday, Iomedae's name is heavily invoked, due to her many military accomplishments during the war.`,id:"824519",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Angel Day",description:`Magnimar, Varisia Angel Day is a local Magnimarian holiday celebrated on 31 Desnus. The annual celebration marks the founding of the city, and its founders' flight from Korvosa. It also honors the presence and popular worship of the empyreal lords, which predates the city by centuries. During the festival, nearly all local businesses shut their doors and the citizens take part in countless feasts, masquerade balls dressed as angels, and the burning of devil effigies meant to symbolize infernally-influenced Korvosa.`,id:"824520",note:null,date:{day:31,year:[null,null],month:4},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Old-Mage Day",description:"Holiday celebrating Old-Mage Jatembe, the father of Garundi magic.",id:"824521",note:null,date:{day:13,year:[null,null],month:4},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Multiple Events",description:`Festival of the Ruling Sun Shizuru Celebrates the longest day. Founder's FollyUlar Kel Adventurers and children follow a hallucinatory red stripe along zigzagging paths, amusing residents. Harvest Bounty Festival Segada Marking the beginning of the harvest season, this festival involves sporting tournaments, dancing, storytelling, and feasts. Celebrants give thanks and eliminate grudges. Longwalk Grandmother Spider, Nurvatchta; southern hemisphere winter solstice Celebrates the escape of Nurvatchta's anadi people from bondage, in part thanks to Grandmother Spider lengthening their cover of darkness in their escape. Ritual of Stardust Desna Festival held in the evening and through the night, where Desna's faithful sing songs and throw sand and powdered gems into bonfires. Runefeast Magrim Day marking the day dwarves learnt the first runes and the proper way to pray. Sunwrought FestivalSarenrae, Brigh Day commemorating the defeat of Rovagug by Sarenrae, celebrated with the flying of kites, fireworks, and gift giving.`,id:"824522",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Burning Blades",description:`Sarenrae The holy, month-long festival ends on this day, featuring dances with flaming blades.`,id:"824523",note:null,date:{day:10,year:[null,null],month:5},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Liberty Day",description:`Andoran, Milani Holiday celebrating Andoran's independence. Milanites celebrate that very little violence occurred.`,id:"824524",note:null,date:{day:3,year:[null,null],month:5},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Talon Tag",description:`Andoran The Eagle Knights perform aerial displays in Almas on this day.`,id:"824525",note:null,date:{day:21,year:[null,null],month:5},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Riverwind Festival",description:`Korvosa An early summer holiday that honors a cooling shift in the winds, celebrated with much drinking.`,id:"824526",note:null,date:{day:22,year:[null,null],month:5},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Inheritor's Ascendance ",description:`Iomedae Inheritor's Ascendance, originally called 'Herald's Day', honours the day that Iomedae was chosen by the god Aroden to become his herald (thus replacing Arazni), thus boosting her power beyond that of a fledgling goddess. This holiday was renamed after the demise of Aroden.`,id:"824527",note:null,date:{day:1,year:[null,null],month:7},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"First Crusader Day",description:`Mendev Holiday in celebration of the continuing crusade against the demons of the Worldwound.`,id:"824528",note:null,date:{day:6,year:[null,null],month:7},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Day of Silenced Whispers",description:`Ustalav The Day of Silenced Whispers is an Ustalavic holiday celebrated every 9 Arodus marking the defeat of the Whispering Tyrant in 3827 AR by the coalition forces of the Shining Crusade and the liberation of the country after centuries of undead domination.`,id:"824529",note:null,date:{day:9,year:[null,null],month:7},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Founding Day",description:`Ilsurian, Varisia Festival celebrating the founding by Ilsur of the town of Ilsurian in 4631 AR.`,id:"824530",note:null,date:{day:10,year:[null,null],month:7},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Armasse",description:`Aroden, Iomedae, Milani The raucous, week-long festival known as Armasse is held each year beginning on 16 Arodus. The celebration \u2014 once dedicated to the god Aroden \u2014 is still important to the faithful of Iomedae, who use it to train commoners in combat, ordain apprentice clergy, pick squires for knights, and teach military history, hoping to prevent the mistakes of the past from being repeated. Among those not dedicated to the Inheritor the holiday has lost most of its religious significance since Aroden's death, tending now only toward wild partying, a fact that has precluded the diabolist authorities of Cheliax from prohibiting Armasse outright. Nevertheless, in places where the church of Asmodeus is openly allowed, it hosts special activities for its parishioners during the same week in an effort to counter the influence of the holiday. The city of Corentyn is especially known for its extravagant Armasse festivities.`,id:"824531",note:null,date:{day:16,year:[null,null],month:7},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Saint Alika's Birthday",description:`Korvosa Quiet holiday honoring the birth of Saint Alika the Martyr.`,id:"824532",note:null,date:{day:31,year:[null,null],month:7},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Archerfeast",description:`Erastil Archer's Day or Archerfeast is a holiday of the god Erastil held annually on the 3rd of Erastus. Despite the holiday's origins in the worship of Erastil, common country folk from the Lands of the Linnorm Kings to Taldor celebrate the height of summer with a day set aside for establishing new relationships, enjoying current camaraderie, and celebrating the gifts of the gods. Archery competitions are held frequently in which the men test their skill with the bow through progressively harder trials. The exact form of competition is different from place to place, and the winner is awarded a rack of elk horns and a quiver of blessed arrows. He is also given the title of "Protector", which he holds until the next year. While the festival's traditions emphasize contests of marksmanship, most have expanded to exhibit talents of all types, from baking and storytelling to racing and mock combat. Aside from encouraging a fair-like atmosphere, many of the displays and competitions serve one of two secondary purposes: either as a way for merchants to show off their superior livestock and wares, or (more popularly) as a way for eligible men and women to show off to each other. While the day's events at most Archerfeast fairs are filled with games, food, and crafts, the night brings dancing, drinking, pranks, and the crowning of the princes and princesses of spring and summer for the two single youths and two single adults who fared best in the day's events. The festivities continue late into the evening, but end promptly at midnight, so that in true Erastilian fashion the next day's responsibilities are not overly impeded. For those not of Erastil's flock, however, private parties, drinking, and trysting carry on long into the next morning.`,id:"824533",note:null,date:{day:3,year:[null,null],month:6},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Founding Festival",description:`Korvosa Founding Festival is a local Korvosan celebration marking the establishment of the city in 4407 AR. Held annually on 14 Erastus, the festival is a chance for the citizens to let off some steam, drink copiously, and watch magical light shows late into the night.`,id:"824534",note:null,date:{day:14,year:[null,null],month:6},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Burning Night",description:`Razmiran Items or people who have transgressed against the god-king of Razmiran are burned on this day.`,id:"824535",note:null,date:{day:17,year:[null,null],month:6},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Kianidi Festival",description:`Garundi The Kianidi Festival is a week long event held annually between 15 and 21 Erastus by Garundi people everywhere. The Garundi have a powerful belief in belonging to a specific location in this world, with clans or tribes sometimes traveling for years in search of their true home. In these travels each individual will collect small mementos of the places she or he has visited in order to remember them and maintain a spiritual connection. During the Kianidi, a tribe will gather and display these mementos to the group. The best ones are chosen and made part of the clan or tribal history, something which Garundi feel is a great honor.`,id:"824536",note:null,date:{day:15,year:[null,null],month:6},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Harvest Moon",description:null,id:"824537",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Multiple Events",description:`Festival of Night's Return Nidal Celebrated throughout Nidal, this holiday involves the burning of effigies and self-flagellation. Swallowtail Festival Desna Holiday celebrated with storytelling, feasting, and the release of butterflies. Waning Light Festival Segada Also called Blessing of the Sun and Night of Spirits, participants bid farewell to the long days of sunshine with feasting, dancing, and music.`,id:"824538",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Signing Day",description:`Andoran, Cheliax, Galt, Isger Signing Day is a Chelish holiday, dating back to the height of the empire. Observed on the second Oathday of Rova, this is the day on which new laws in the empire took effect. The significance of this day expanded over many years until imperial marriages, significant business arrangements and oaths of fealty were all conducted on this day. Originally, the holiday began as a celebration of the mutual-defense pact between Cheliax, Isger, Galt and Andoran when the united nations threw off the shackles of Taldor, declaring themselves independent from the empire. Observances of the holiday vary, but often include firework displays, feats of strength, and public debates to showcase speaking and rhetorical skills. As Cheliax degenerated to civil war and diabolism after 4606 AR, blood pacts and infernal contracts also began to be signed on this day. As a result of Cheliax's new affiliation, Andoran and Galt began to distance themselves from Cheliax and the original interpretation of the holiday. In Andoran it continues to be the day that most national laws take effect as well as being a traditional day of marriage, and the date on which new Steel Falcons are inducted.`,id:"824539",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Crabfest",description:`Korvosa Crabfest is a Korvosan holiday held on the first Wealday of Rova. It celebrates the return of the crabs from the cooler waters of the Jeggare River to their winter habitat in Conqueror's Bay, and is marked by crab boil feasts held throughout the city and its surrounding communities.`,id:"824540",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Feast of Szurpade",description:`Irrisen This "celebration of plenty" festival mocks the traditional harvest festivals celebrated in the region before Baba Yaga and her eternal winter descended upon the land.`,id:"824541",note:null,date:{day:26,year:[null,null],month:8},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Day of Sundering",description:`Ydersius Once many holidays were celebrated by the faith of Ydersius, but today only this date has much significance.`,id:"824542",note:null,date:{day:29,year:[null,null],month:8},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Admani Upastuti",description:`Jalmeri Admani Upastuti is a Jalmeri holiday celebrated on the first full moon of Lamashan that marks the founding of Jalmeray as a Vudran colony.`,id:"824543",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Ascendance Day",description:`Iomedae Ascendance Day is an Iomedaean holiday, held on the 6th of Lamashan. The day marks the anniversary of the day Iomedae took the Test of the Starstone in the autumn of 3832 AR and ascended to godhood. Celebration The day is a joyous celebration for the faithful, with singing, pledging of friendships, and forgiving of old grudges. To many, the Test of the Starstone represents the greatest of all challenges, yet for Iomedae it was one of three storied promotions in her rise from Aroden's herald to a goddess in her own right. On the 6th of Lamashan, the Inheritor's faithful observe the heroism of Iomedae's life before her moment of ascension and celebrate the anniversary of the apotheosis itself. The celebration takes place in several stages. Early in the day, troupes of performers\u2014as often passionate amateurs as professionals\u2014stage morality plays featuring the Eleven Acts of Iomedae, the heroic near-miracles and sacrifices she made leading up to her trials in the Starstone Cathedral. Scripts vary by region, city, and even neighborhood, but despite differences in setting, performance medium, and word choice, the themes and morals are all the same. As the day continues, the priests organize jousts and mock battles, allowing anyone to participate so long as she can demonstrate enough skill to not be a risk to herself or others. The winners of these contests then face tests of mental acuity such as solving riddles, deciphering philosophical quandaries, and answering questions of honor and justice. Those who prove themselves in both contests are awarded a white cloak\u2014representing the Inheritor at peace\u2014styled after Iomedae's own red garment to wear for the rest of the celebration. Feasting and singing follow the competitions, mirroring the jubilation that followed Iomedae's ascension. This is occasion for making pledges of friendship and forgiving enemies, and priests circulate about the crowd offering the Inheritor's blessing to those who do and providing a moment's counsel or mediation for those who need an extra nudge. The celebration typically ends before midnight, and the following day the priests and previous day's champions gather up the blunted swords from the mock battles, sharpen them, and distribute them among the church's armory and those of like-minded organizations so that all may remain vigilant against evil and prepared to strike it down.`,id:"824544",note:null,date:{day:6,year:[null,null],month:9},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Bastion Day",description:`Solku Bastion Day is a two-day festival held annually on 19 and 20 Lamashan in the Katapeshi town of Solku honoring the founding of the town, when it is traditional to host a stranger from one noon until the next.`,id:"824545",note:null,type:U.Date,date:{day:19,year:4712,month:9},category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Jestercap",description:`Andoran, Druma, Taldor Jestercap occurs at the end of the month of Lamashan, traditionally on the 27th (although a few regions have taken to moving the exact day around slightly so it always falls on the last Starday of the month, allowing people who wish to celebrate in excess to have the following day of rest to recover). History While Jestercap has been embraced with excited open arms by the gnome communities of the Inner Sea region, its original genesis is said to have been in one of Taldor's coastal cities not long after King Aspex the Even-Tongued broke from the nation, significantly weakening Taldor's power and beginning that nation's long decline. The holiday was originally intended to distract the distraught Taldan populace with a night of revelry and comedic entertainment, but the antics of jesters were simply not enough. Over the course of the first few years, Jestercap evolved from a holiday of observation to a holiday of participation. Today, the holiday is a time where anyone can pull pranks or jokes or japes on companions, on neighbors, and (most typically) on rivals, with the understanding that provided no lasting harm is done, any humiliations inflicted before midnight are to be taken in stride. Of course, come morning the day after, there are inevitably jokes that went too far, and grudges and feuds borne from Jestercap antics have a way of lingering for months to follow. In Religion Followers of Chaldira Zuzaristan, a halfling deity of mischief, treat Jestercap as a holy day and their pranks \u2014 often elaborate and extravagant in nature and plotted for months in advance \u2014 as displays of their faith.`,id:"824546",note:null,date:{day:27,year:[null,null],month:9},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Feast of the Survivors",description:`Zon-Kuthon, Nidal A harvest festival signifying the centuries of Nidalese ancestors protected by Zon-Kuthon. The ceremonial tables are made of human bones of community members from past generations.`,id:"824547",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Kraken Carnival",description:`Absalom The second of two local festivals where kite-battlers compete.`,id:"824548",note:null,date:{day:15,year:[null,null],month:9},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Independence Day",description:`Galt Marks the beginning of the Red Revolution.`,id:"824549",note:null,date:{day:5,year:[null,null],month:10},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Seven Veils",description:`Sivanah The holiday known as Seven Veils, which takes place on the 23rd of Neth in most realms of the Inner Sea region, is a celebration of the region's diversity \u2014 a time when social boundaries break down even further in a day-long event filled with dancing, feasting, and courting. The evening traditionally closes out with the Seven Veil masquerade, a ball wherein the participants wear disguises that hide their race or gender (often using minor magical trinkets and spells) or disguise these features as entirely new characteristics. At the end of the ball, the participants remove their disguises to their partners, often with unpredictable and sometimes delightfully awkward results. Traditionalists and conservative minds often find the Seven Veils masquerades to be scandalous or off-putting, yet they remain particularly popular in most of the larger cities of the land. Historians note that the original "Dance of the Seven Veils" has a much different genesis than one promoting diversity \u2014 the mysterious cult of Sivanah, goddess of illusions, mystery, and reflections, is generally cited as the source of this festival, and indeed, worshippers of the goddess (herself known as the Seventh Veil) count the 23rd of Neth as one of their most sacred of days. What rituals the church of Sivanah performs on this date, however, are unknown to outsiders, for the cult enjoys its secrets. This secrecy has, unsurprisingly, given rise to all manner of sinister rumour, yet when Seven Veils rolls around each year, its eager participants are quick to set aside rumour in preference for the night's fun and games.`,id:"824550",note:null,date:{day:23,year:[null,null],month:10},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Abjurant Day",description:`Nethys Abjurant Day occurs on 8 Neth and is known as a day of cooperation between neighbors to shore up mutual defenses and train allies in magic. Potential apprentices are often tested on the day.`,id:"824551",note:null,date:{day:8,year:[null,null],month:10},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Great Fire Remembrance",description:`Korvosa Great Fire Remembrance is a holiday celebrated on each 13 Neth in the Varisian city of Korvosa. It commemorates the Great Fire of 4429 AR, which devastated the then still fledgling Chelish colony of Fort Korvosa. On this somber day, most of the city shuts down and people generally remain at home. It has become tradition not to light any fires (not even cooking fires) on Great Fire Remembrance.`,id:"824552",note:null,date:{day:13,year:[null,null],month:10},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Even-Tongued Day",description:`Cheliax, Asmodeus, Milani Observed on 14 of Neth, Even-Tongued Day was once a day of joy and celebration in Cheliax, but has become instead one of mourning. Originally, the date marked the conquest of Aspex the Even-Tongued, who brought the nations of Galt, Andoran and Isger under Chelish control. Since the death of Aroden and the loss of these nations, the holiday instead marks the loss of territory and glory once held by Cheliax. Oaths are sometimes made, typically to Asmodeus, and rarely of a pleasant nature (such as the reclaiming of the lost empire and vengeance against treacherous former allies). Citizens wear black on this day, public speaking is forbidden, and old feuds and vendettas are rekindled.`,id:"824553",note:null,date:{day:14,year:[null,null],month:10},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Evoking Day",description:`Nethys A holy day to followers of Nethys, Evoking Day is full of vibrant explosions, skillful wielding of spells, and much dancing. Evoking Day is observed on the 18th of Neth, and while this holiday is mostly celebrated in Garund, temples dedicated to Nethys host celebrations throughout the Inner Sea region. Traditional celebrations of Evoking Day have changed over the thousands of years since its first incarnation, but to this day every occurrence of Evoking Day still features a grand meal shared by celebrants during the afternoon and a wondrous exhibition of brilliant and explosive magic once the sun sets. These days, such colorful magical displays are augmented with fireworks of a dozen different colors and patterns. In temples of Nethys dedicated to revering evocation magic, priests and prominent arcanists participate in spell duels where each contestant stands on a raised platform and takes turns trying to incapacitate her opponent. The magic wielded in theses duels favors the flashy over the dangerous, but clerics of Nethys are on hand to treat any injuries. These duels gather large crowds eager to lend their applause to their favorite contestant. It is also during this festival when wizards who worship Nethys open their spellbooks to others who share their craft. Wizards normally guard their spellbooks with their lives and covet the eldritch information therein, but on Evoking Day these wizards meet with one another prior to the afternoon feast to share their spells just as they prepare to share a grand meal. Though Evoking Day is primarily a day of grand magic, those with no spellcasting talent still flock to local temples of Nethys to partake in the shared feast and flashy evening displays of magic and fireworks. Between the meal and into the night, celebrants wear black-and-white robes and perform joyous dances meant to give thanks to the wonders Nethys brought to humankind. These dances are grand affairs involving dozens of dancers all spinning and clapping to the accompanying music as their black-and-white robes fan out around them with each spin. As night descends and the fireworks and magical displays begin, the dancing rises to a climax erupting in shouts and calls to Nethys with each thunderous boom.`,id:"824554",note:null,date:{day:18,year:[null,null],month:10},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Baptism of Ice",description:`Irrisen In the Irriseni Baptism of Ice, an annual fertility festival held from the 24th to the 30th of Neth, locals parade all children born during the year through the town in fine clothes. In most towns, the festival ends with a symbolic sacrifice of a child to the cold. However, in Whitethrone and Irrisen's provincial capitals, a peasant child is killed through exposure.`,id:"824555",note:null,date:{day:24,year:[null,null],month:10},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Transmutatum",description:`Nethys Transmutatum is one of the three major holidays of the church of Nethys, on 28th of Neth. It is a day of reflection and self-improvement. Many followers of Nethys begin research and crafting projects on this day.`,id:"824556",note:null,date:{day:28,year:[null,null],month:10},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Winter Week",description:"Traditional feast; time for courting and spending time with friends.",id:"824557",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"The Shadowchaining",description:`Zon-Kuthon, Nidal Commemorating the Midnight Lord's gift of shadow animals.`,id:"824558",note:null,date:{day:1,year:[null,null],month:11},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Pseudodragon Festival",description:`Korvosa Korvosa's Pseudodragon Festival, a holiday celebrated annually on 7 Kuthona, marks the winter migration of wild pseudodragons from the Mindspin Mountains to Conqueror's Bay, which inspires the creatures already in the city\u2014even those domesticated\u2014to play with their wild kin in the skies over the city. Locals mark the day with a joyous inebriation.`,id:"824559",note:null,date:{day:7,year:[null,null],month:11},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Ascension Day",description:`Cayden Cailean Much like the god to whom it is dedicated, the Caydenite holiday of Ascension Day is generally celebrated in a very informal style. Occurring annually on 11 Kuthona, it commemorates the day Cayden Cailean passed the Test of the Starstone and ascended to godhood in 2765 AR. In all likelihood, the 11th of Kuthona is not the exact date on which it actually happened, but since the god was dead drunk when it happened, it will probably be never known.`,id:"824560",note:null,date:{day:11,year:[null,null],month:11},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Winterbloom",description:`Naderi Holiday celebrating Naderi's ascension. Celebrations are typically understated but include readings of The Lay of Arden and Lysena.`,id:"824561",note:null,date:{day:15,year:[null,null],month:11},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Final Day",description:`Groetus Cultists of Groetus perform an hour's silence at dusk on the last day of the year and seek guidance from their god about the End Time.`,id:"824562",note:null,date:{day:31,year:[null,null],month:11},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Night of the Pale",description:`Not all of Golarion's holidays and festivals are times of rejoicing and delight. Holidays worshiped by dark and sinister cults and religions tend to be hidden affairs, their rituals and ceremonies involving cruelties and vile practices that send shivers of fear through gentler society. Scholars suspect that the Night of the Pale\u2014a holiday that traditionally takes place on the last day of the year, the 31st of Kuthona\u2014has links to several sinister religions, but today no one church has specific association with the event. Nonetheless, the Night of the Pale is an event that many look forward to all year, whether in fear or excitement. On the Night of the Pale, it is said that the ghosts of those who died during the previous year manifest upon the world and come to visit the homes they lived in during life. Although some might think that the chance of seeing even the shade of a dearly departed one might be a blessing, the Night of the Pale is not a time for tearful reunions, for these ghosts, tradition says, do not return out of love for those they left behind but out of darker compulsions. Lingering jealousy, unfinished arguments, or the simmering need for revenge are said to be what compels the dead to return to torment the living on the Night of the Pale. The evening of this night in many communities is celebrated by a morbid feast, the food prepared with themes revolving around graveyards, the dead, and other spooky traditions. This feast, on one level, helps the celebrants to make light of their fears while sharing good company with similarly nervous neighbors, but at another level is believed to placate vengeful spirits as toasts are raised to the memories of the recently departed. These feasts include retellings of favorite memories of the departed, in hopes of reminding the approaching ghosts of brighter and kinder memories than those that compel them to return. The feast always ends at least an hour before midnight in order to give participants time to return home, decorate doors and windows with salt and other trinkets taken from the feasting table (salted bread baked into crook-like shapes are a favorite, as these can be hung from doorknobs and eaves) to ward off evil spirits, and hide in their bedrooms until dawn. Brave youths and adventurers often deliberately stay out after midnight, either to dare the ghosts to challenge them or simply for the thrill of bucking tradition. Every Night of the Pale, it seems, there are disappearances among those who stay out after midnight, although whether these vanishings are the result of dissatisfied locals taking the opportunity to run away from home, murderers or wild animals or other mundane dangers, or the vengeful spirits carrying off their victims depends upon the circumstances. The morning after a Night of the Pale is also the first day of the new year\u2014a time that many celebrate more as a relief for surviving the night before than in anticipation of what the new year might bring, although regional preferences for how this day is celebrated vary enough that no single tradition holds over the other. Save, of course, the lingering fears of what dread spirits might come knocking upon warded doors one year away...`,id:"824563",note:null,date:{day:31,year:[null,null],month:11},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Turning Day",description:`Alseta The changing of the year is celebrated with the forgiveness of old debts and grudges, and embracing new opportunities.`,id:"824564",note:null,date:{day:31,year:[null,null],month:11},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Ritual of Stardust",description:`Desna The Ritual of Stardust is one of the few formal religious holidays in honor of the goddess Desna. It is held on both the summer and winter solstices. Followers of the Song of Spheres gather at dusk and light enormous bonfires and hold feasts, watching the sparks and embers float out into the darkening sky. After it is fully dark, the celebrants chant and sing songs as they watch the fires burn low. When only embers remain, sand mixed with ground star gems (either star rubies, star sapphires, or rose quartz) is thrown on them or into the air downwind. At this point it is common to make proclamations of love and friendship and of promised journeys to come. The twinkling of the sand is thought to mirror the night sky and demonstrate Desna's witnessing of these pronouncements.`,id:"824565",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Planting Week",description:`Erastil This holy week to the god Erastil is a time of heavy work in the fields for farmers.`,id:"824566",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Ascendance Night",description:`Norgorber Day marking the apotheosis of the Reaper of Reputation.`,id:"824567",note:null,date:{day:2,year:[null,null],month:4},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Azvadeva Dejal",description:`Gruhastha Celebration of the revelation of the Azvadeva Pujila, with gifts of books, celebrations of knowledge, blessing of animals, and a vegetarian feast.`,id:"824568",note:null,date:{day:3,year:[null,null],month:4},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Goblin Flea Market",description:`Andoran A market day that focuses on unusual crafts and offers games to children who dress up for the occasion.`,id:"824569",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Breaching Festival",description:`Korvosa Yearly festival in which contestants try to break through the magical wards protecting the Academae.`,id:"824570",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Silverglazer Sunday",description:`Andoran Silverglazer Sunday is a two-part Andoren national festival that is held on the last Sunday of Arodus and the first Sunday of Rova every year. Celebrants spend the two Sundays fishing, holding swimming competitions, and making enormous puppets.`,id:"824571",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Batul al-Alim",description:`Qadira Batul al-Alim is a holiday celebrated on the last Oathday of Calistril in Qadira. It commemorates the birthday of the popular romantic poet of the same name.`,id:"824572",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}}],id:null,categories:[{name:"Natural Events",id:"natural-events",color:"#2E7D32"},{name:"Religious Holidays",id:"religious-holidays",color:"#9b2c2c"},{name:"Secular Holidays",id:"secular-holidays",color:"#0D47A1"},{name:"Historical Events",id:"historical-events",color:"#455A64"},{name:"Miscellaneous Events",id:"miscellaneous-events",color:"#0288D1"}]},{name:"Calendar of Galifar",description:"Calendar of the world of Eberron.",path:[],supportInlineEvents:!1,inlineEventTag:"inline-events",showIntercalarySeparately:!0,static:{displayDayNumber:!1,firstWeekDay:0,incrementDay:!1,displayMoons:!0,overflow:!1,padDays:2,padMonths:2,weekdays:[{type:"day",name:"Sul",id:"ID_598a7bd9b8b9"},{type:"day",name:"Mol",id:"ID_69088ac8f818"},{type:"day",name:"Zol",id:"ID_a8c85a98f8fa"},{type:"day",name:"Wir",id:"ID_fa4b687aaba9"},{type:"day",name:"Zor",id:"ID_58e9a82a6bc8"},{type:"day",name:"Far",id:"ID_9a18cb889ada"},{type:"day",name:"Sar",id:"ID_3b9bfa38c979"}],months:[{name:"Zarantyr",type:"month",length:28,interval:1,offset:0,id:"ID_7a8afb09aa6a"},{name:"Olarune",type:"month",length:28,interval:1,offset:0,id:"ID_386b188b2a89"},{name:"Therendor",type:"month",length:28,interval:1,offset:0,id:"ID_599a0ad859c8"},{name:"Eyre",type:"month",length:28,interval:1,offset:0,id:"ID_98a95869e90b"},{name:"Dravago",type:"month",length:28,interval:1,offset:0,id:"ID_eb5a194bcbf8"},{name:"Nymm",type:"month",length:28,interval:1,offset:0,id:"ID_bb596aa9ca5b"},{name:"Lharvion",type:"month",length:28,interval:1,offset:0,id:"ID_fb1bb9dabb88"},{name:"Barrakas",type:"month",length:28,interval:1,offset:0,id:"ID_8bcb19c8f90a"},{name:"Rhaan",type:"month",length:28,interval:1,offset:0,id:"ID_0a09eb5b7b9b"},{name:"Sypheros",type:"month",length:28,interval:1,offset:0,id:"ID_3b98ab1a29e8"},{name:"Aryth",type:"month",length:28,interval:1,offset:0,id:"ID_899b59faaba9"},{name:"Vult",type:"month",length:28,interval:1,offset:0,id:"ID_8a286b78aac9"}],moons:[{name:"Nymm",cycle:28,offset:-14,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_a8b88988a94a"},{name:"Sypheros",cycle:35,offset:-11,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_5ba80b4b096a"},{name:"Therendor",cycle:42,offset:21,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_c999085a499b"},{name:"Rhaan",cycle:49,offset:9,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_39f91ab8a85a"},{name:"Olarune",cycle:56,offset:27,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_2ada8b99788b"},{name:"Eyre",cycle:63,offset:10,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_49285b79d988"},{name:"Vult",cycle:70,offset:6,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_eaebb94a9acb"},{name:"Zarantyr",cycle:77,offset:31,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_98d86aabcbb9"},{name:"Aryth",cycle:84,offset:41,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_d989b809d97b"},{name:"Dravago",cycle:91,offset:31,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_1a293959eaab"},{name:"Lharvion",cycle:98,offset:34,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_cbf919491a5b"},{name:"Barrakas",cycle:105,offset:-11,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_4a1a2a6b589b"}],leapDays:[],eras:[]},seasonal:{seasons:[],offset:0,type:"Periodic",displayColors:!0,interpolateColors:!0,weather:{enabled:!1,seed:1,tempUnits:et.IMPERIAL,windUnits:et.METRIC,primaryWindDirection:"E"}},locations:{locations:[]},current:{year:998,day:1,month:0},events:[{name:"The Tain Gala - Sharn",description:"The Tain Gala is a notable event held on the first Far of each month in Sharn.",id:"824461",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Revelation Day - Blood of Vol",description:"Meditation ceremony for Seekers (also called Ascension Day).",id:"824462",note:null,date:{day:13,year:[null,null],month:0},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Winter Solstice",description:"The longest night of the year.",id:"824463",note:null,date:{day:14,year:[null,null],month:0},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Rebirth Eve - The Silver Flame",description:"The Purified new year; a night for spiritual vigil and guarding against evil. ",id:"824464",note:null,date:{day:14,year:[null,null],month:0},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Crystalfall - Sharn",description:"A day of remembrance; Ice sculptures are created (and destroyed) to commemorate the destruction of the Glass Tower on 9 Olarune in 918 by abjurers. ",id:"824465",note:null,type:U.Date,date:{day:9,year:998,month:1},category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Bright Souls' Day - The Silver Flame",description:"On this day each year, the Purified celebrate the lives and sacrifice of all followers of the Flame who died while fighting evil and protecting the faithful. ",id:"824466",note:null,date:{day:18,year:[null,null],month:1},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"The Day of Mourning - Sharn",description:"In commemoration of the destruction of the nation of Cyre, those who survived gather to remember the loss of their kingdom on this date in the year 994. ",id:"824467",note:null,type:U.Date,date:{day:20,year:995,month:1},category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Tirasday - The Silver Flame",description:"On this day, the Silver Flame work, give gifts, and partake in joyous celebration out of thankfulness for the new planting season and the birth of Tira Miron - the Voice of the Silver Flame.",id:"824468",note:null,date:{day:5,year:[null,null],month:2},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Sun's Blessing - The Sovereign Host",description:"The Sovereign Host enjoys this festival of peace, and of setting aside differences, in the name of Dol Arrah.",id:"824469",note:null,date:{day:15,year:[null,null],month:2},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Initiation Day - The Silver Flame",description:"Seminary graduations and breaking grounds for new churches are common on this day as the Silver Flame recalls their declarations of independent faith and the construction of their first cathedral on this special day each year. ",id:"824470",note:null,date:{day:11,year:[null,null],month:3},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Baker's Night - The Silver Flame",description:"An old and misunderstood, yet immensely popular, holiday wherein followers of the Silver Flame gather to share pastries and treats created by bakers within their fold. ",id:"824471",note:null,date:{day:6,year:[null,null],month:4},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Aureon's Crown - Sharn and The Sovereign Host",description:`The Sovereign Host celebrate knowledge on this day with lectures and sermons.Secular institutions hold graduation and commencement ceremonies on this date, as do the monastic schools of the Silver Flame.In Sharn this has become a common secular holiday, wherein even non-devout members of the Five Nations attend lectures and sermons held by the priests of Aureon on philosophical, historical, and a range of other topics - including discussions on the nature of the gods. `,id:"824472",note:null,date:{day:26,year:[null,null],month:4},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Promisetide - The Silver Flame",description:"A controversial holiday outside of the Silver Flame faith, on this day the Purified honor the Silver Flame for the promise of paradise. They also honor (without worship) the Sovereign Host for having created the world, before stepping aside to allow the Flame its rightful place as the last god of Eberron.\xA0 ",id:"824473",note:null,date:{day:28,year:[null,null],month:4},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Brightblade - Sharn and The Sovereign Host",description:`This Sovereign Host festival, dedicated to Dol Dorn, is marked by gladiatorial and athletic contests. In Sharn, festival celebrations occur throughout the temple districts with events culminating in a combined contest of champions at the Cornerstone Arena. `,id:"824474",note:null,date:{day:12,year:[null,null],month:5},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"First Dawn - The Silver Flame",description:"On this day in 914, the Church of the Silver Flame officially assumed control of the government of Thrane. On each anniversary, the Purified give thanks for their just rule, while also honoring the memory of King Thalin, whose death paved the way for their governance.",id:"824475",note:null,type:U.Date,date:{day:21,year:915,month:5},category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Silvertide - The Silver Flame",description:"Commemoration of both the couatl sacrifice and the entry, thousands of years ago, of the Silver Flame into Eberron mark this highest of holy days. The vast majority of Purified spend this day in prayer and observance.\xA0 ",id:"824476",note:null,date:{day:14,year:[null,null],month:6},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"The Race of Eight Winds - Sharn",description:`Legend tells of King Galifar II's fascination with aerial scouts and cavalry. The evolution of this annual contest took centuries, but has given Sharn an exotic and well anticipated event involving beasts and their riders in a symbiotic quest for glory* over a course that finds them weaving through the spires of the city. *the winner also receives 500gp and a land grant located elsewhere in Breland.`,id:"824477",note:null,type:U.Date,date:{day:21,year:201,month:6},category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"The Hunt - Sharn and The Sovereign Host",description:`The Sovereign Host celebrate Balinor with communal hunts of dangerous creatures. In Sharn, a dangerous beast*, whose transport to the city was arranged by the priests of Balinor, is released into the Depths of the Lower-City. Open to any who would participate (and pay an entry fee in the form of a 5gp donation), the victor must return with the beast's head to receive a 500gp purse, local fame, and the blessing of Balinor. *often a singular beast, it can be several - which then requires the victor to return with the most skins. `,id:"824478",note:null,date:{day:4,year:[null,null],month:7},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Victory Day - The Silver Flame",description:"Commemorating the conclusion of the lycanthropic purge (832 YK - 880 YK), on Victory Day the adult faithful of the Silver Flame attend sermons on triumph, defeat, and the somewhat questionable methods utilized by the templars during the purge - while the children of the faithful act out great battles with toy swords. ",id:"824479",note:null,type:U.Date,date:{day:9,year:881,month:7},category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Fathen's Fall - Sharn",description:"Honoring the memory of Fathen, a great hero of the Silver Crusade (832 YK - 880 YK), who, in the last days of the purge, was torn apart by wererats on the streets of North Market. Faithful gather on this day at the Shrine of Fathen the Martyr to listen to a sermon from the priest of High Hope. This holiday is often uncomfortable and tense for shifter communities in Sharn. ",id:"824480",note:null,type:U.Date,date:{day:25,year:881,month:7},category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Boldrei's Feast - Sharn and The Sovereign Host",description:`A feast of community in the name of Boldrei, extravagant parties are often held on this holiday and it has also become the traditional day for elections. In Sharn, a great feast is held at the Pavilion of the Host with goods and services donated\xA0 from local merchants, as well as House Ghallanda. Many grand parties, some quite astonishing in their opulence, are hosted by the wealthiest members of varying districts - often in competition with one another for social standing. `,id:"824481",note:null,date:{day:9,year:[null,null],month:8},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"The Ascension - Sharn",description:"Each year on The Ascension, followers reaffirm their faith and give thanks as well as attend blessing ceremonies at temples throughout the city - the grandest of which occurs at the Cathedral of the Cleansing Flame. All of this is to honor the sacrifice of Tira Miron, the Voice of the Flame, without which there would be no Church of the Silver Flame. Contributions to their community on this day are a high priority for the faithful.",id:"824482",note:null,date:{day:1,year:[null,null],month:9},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Wildnight - Sharn",description:"With the The Fury (the Sovereign of Passion and Madness) reaching the height of her power on this night, people find it difficult to control or restrain their impulses - once the sun sets, public revelry in the streets climbs to joyous or, all too often, dangerous levels, calming only as the sun rises on the following morning. ",id:"824483",note:null,date:{day:18,year:[null,null],month:9},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Saint Voltros's Day - The Silver Flame",description:"Though one of the least high holy days, it is marked by brief prayers and church services in the honor of the birth of Saint Voltros - the first paladin called to only serve the Silver Flame.",id:"824484",note:null,date:{day:25,year:[null,null],month:9},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Thronehold - Sharn",description:"On this day in 996, the Treaty of Thronehold was signed, formally ending the Last War. Annual celebratory feasts are held throughout the Five Nations to mark this auspicious and long-awaited event. ",id:"824485",note:null,type:U.Date,date:{day:11,year:997,month:10},category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Rampartide - The Silver Flame",description:"In accordance with scripture, on this day the Purified steel themselves against wickedness, both without and within, through repentance and fasting. Children, elderly, and the sick are required only to give up their favorite foods for the day. ",id:"824486",note:null,date:{day:24,year:[null,null],month:10},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Long Shadows - Sharn",description:"As dark magic dominates over these three days of the Long Shadows, the myth of Sovereign Lord Aureon's stolen shadow is forefront in the minds of the people. Most will spend these days indoors huddled around the warmth of a fire, but those few who worship the dark deity use this time to prey upon the weak and the foolish. ",id:"824487",note:null,date:{day:26,year:[null,null],month:11},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Khybersef - The Silver Flame",description:`Originally called Khyber's Eve, the Purified spend the night in intense prayer and spiritual vigilance against the, according to scripture, "thinning of the bonds that hold the demon lords in Khyber" between now (the beginning of winter) and the solstice. Quests and crusades often begin on Khybersef. `,id:"824488",note:null,date:{day:27,year:[null,null],month:11},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Spring Equinox",description:"The spring equinox is when the day and the night are equally as long, and are getting longer.",id:"824489",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Summer Solstice",description:" At the summer solstice, the Sun travels the longest path through the sky, and that day therefore has the most daylight.",id:"824490",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Autumn Equinox",description:"The autumn equinox is when the day and the night are equally as long, and are getting shorter.",id:"824491",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}}],id:null,categories:[]},{name:"Barovian Calendar",description:"Calendar of the realm of Barovia, home of Strahd.",path:[],supportInlineEvents:!1,inlineEventTag:"inline-events",showIntercalarySeparately:!0,static:{displayDayNumber:!1,firstWeekDay:0,incrementDay:!1,displayMoons:!0,overflow:!0,padDays:2,padMonths:2,weekdays:[{type:"day",name:"Monday",id:"ID_6a183b08c8eb"},{type:"day",name:"Tuesday",id:"ID_892b7b7a5ae9"},{type:"day",name:"Wednesday",id:"ID_6bb98899ba68"},{type:"day",name:"Thursday",id:"ID_4a7b683aea19"},{type:"day",name:"Friday",id:"ID_78690a099b89"},{type:"day",name:"Saturday",id:"ID_ba5b09ba5a89"},{type:"day",name:"Sunday",id:"ID_29b90acaead9"}],months:[{name:"1st Moon",type:"month",length:31,interval:1,offset:0,id:"ID_7b4978ab581a"},{name:"2nd Moon",type:"month",length:28,interval:1,offset:0,id:"ID_cb99fbb9395b"},{name:"3rd Moon",type:"month",length:31,interval:1,offset:0,id:"ID_79881a89cb18"},{name:"4th Moon",type:"month",length:30,interval:1,offset:0,id:"ID_5b9a8a397908"},{name:"5th Moon",type:"month",length:31,interval:1,offset:0,id:"ID_f8399ab80818"},{name:"6th Moon",type:"month",length:30,interval:1,offset:0,id:"ID_3ac84a7bc869"},{name:"7th Moon",type:"month",length:31,interval:1,offset:0,id:"ID_e98bc86bc809"},{name:"8th Moon",type:"month",length:31,interval:1,offset:0,id:"ID_89ea78ca5988"},{name:"9th Moon",type:"month",length:30,interval:1,offset:0,id:"ID_798a3b990a4b"},{name:"10th Moon",type:"month",length:31,interval:1,offset:0,id:"ID_3a9999e8eb59"},{name:"11th Moon",type:"month",length:30,interval:1,offset:0,id:"ID_db39383b990a"},{name:"12th Moon",type:"month",length:31,interval:1,offset:0,id:"ID_1bfa3b180a48"}],moons:[{name:"Moon",cycle:29.530588853,offset:10.24953,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_e98b3a8ab8da"}],leapDays:[{name:"Leap Day",type:"leapday",interval:[{ignore:!1,exclusive:!1,interval:400},{ignore:!1,exclusive:!0,interval:100},{ignore:!1,exclusive:!1,interval:4}],offset:0,timespan:1,intercalary:!1,id:"ID_6a28dbb81a48"}],eras:[{name:"Before Christ",format:"{{era_name}}",id:"ID_897bba588a98",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!0,date:{year:0,day:0,month:0}},{name:"Anno Domini",format:"{{era_name}}",date:{year:1,month:0,day:1},id:"ID_185ab9b8b95a",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!1}]},seasonal:{seasons:[],offset:0,type:"Periodic",displayColors:!0,interpolateColors:!0,weather:{enabled:!1,seed:1,tempUnits:et.IMPERIAL,windUnits:et.METRIC,primaryWindDirection:"E"}},locations:{locations:[]},current:{year:735,day:1,month:0},events:[{name:"Winter Solstice",description:"The Winter Solstice is the day of the year with the least time between sunrise and sunset. Many western cultures consider it the official date of winter.",id:"824455",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:"natural-event",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Summer Solstice",description:`The Summer Solstice is the day of the year with the most time between sunrise and sunset. Many western cultures consider it the official date of summer.`,id:"824456",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:"natural-event",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Spring Equinox",description:`The Spring Equinox, also called the Vernal Equinox, is the day between the winter and summer solstices where the day is the exact same length as the night. Many western cultures consider it the official date of Spring. `,id:"824457",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:"natural-event",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Autumnal Equinox",description:`The Autumnal Equinox, also called the Fall Equinox, is the midpoint between the summer and winter solstices, where the day is the exact same length as the night. Many western cultures consider it the official date of Autumn. `,id:"824458",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"New Year's Day",description:"New Year's day marks the date of a new year.",id:"824459",note:null,date:{day:1,year:[null,null],month:0},type:U.Recurring,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Paschal Full Moon",description:"The first full moon after march 21st, which is considered the fixed date for the spring equinox.",id:"824460",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:"natural-event",sort:{timestamp:Number.MIN_VALUE,order:""}}],id:null,categories:[{name:"Natural Event",id:"natural-event",color:"#9e9d24"}]},{name:"Exandrian Calendar",description:"Calendar of the world of Wildemount.",path:[],supportInlineEvents:!1,inlineEventTag:"inline-events",showIntercalarySeparately:!0,static:{displayDayNumber:!1,firstWeekDay:2,incrementDay:!1,displayMoons:!0,overflow:!0,padDays:2,padMonths:2,weekdays:[{type:"day",name:"Miresen",id:"ID_3b38aaa81bca"},{type:"day",name:"Grissen",id:"ID_da6b19882baa"},{type:"day",name:"Whelsen",id:"ID_a9cae8f88b98"},{type:"day",name:"Conthsen",id:"ID_e87859eb5aaa"},{type:"day",name:"Folsen",id:"ID_59180abbea8a"},{type:"day",name:"Yulisen",id:"ID_98082bd8d8ca"},{type:"day",name:"Da'leysen",id:"ID_da4ba92b299a"}],months:[{name:"Horisal",type:"month",length:29,interval:1,offset:0,id:"ID_e89a4ab9995b"},{name:"Misuthar",type:"month",length:30,interval:1,offset:0,id:"ID_18b8894bab7b"},{name:"Dualahei",type:"month",length:30,interval:1,offset:0,id:"ID_0a9b29f8f8db"},{name:"Thunsheer",type:"month",length:31,interval:1,offset:0,id:"ID_6a8a8a5bea5b"},{name:"Unndilar",type:"month",length:28,interval:1,offset:0,id:"ID_b8295bdbcafa"},{name:"Brussendar",type:"month",length:31,interval:1,offset:0,id:"ID_c92a489bb909"},{name:"Sydenstar",type:"month",length:32,interval:1,offset:0,id:"ID_7b48bb1b0a4a"},{name:"Fessuran",type:"month",length:29,interval:1,offset:0,id:"ID_289858c97849"},{name:"Quen'pillar",type:"month",length:27,interval:1,offset:0,id:"ID_f8abd9a86aa9"},{name:"Cuersaar",type:"month",length:29,interval:1,offset:0,id:"ID_7aba59fa2b69"},{name:"Duscar",type:"month",length:32,interval:1,offset:0,id:"ID_5819f86b99cb"}],moons:[{name:"Catha",cycle:33,offset:7,faceColor:"#ffffff",shadowColor:"#292b4a",id:"ID_0ab929092b5b"},{name:"Ruidus",cycle:328,offset:80,faceColor:"#ff6161",shadowColor:"#1f1f1f",id:"ID_b9783ac818e9"}],leapDays:[],eras:[{name:"The Founding",format:"{{era_name}}",id:"ID_cb9baaabab7a",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!0,date:{year:0,day:0,month:0}},{name:"Age of Arcanum",format:"{{era_name}}",date:{year:-1500,month:0,day:1},id:"ID_499b3ae8c868",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!1},{name:"The Calamity",format:"{{era_name}}",date:{year:-665,month:0,day:1},id:"ID_7ac8c9590999",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!1},{name:"Post-Divergence",format:"{{era_name}}",date:{year:1,month:0,day:1},id:"ID_58aad97ac84b",endsYear:!1,isEvent:!1,type:"era",category:null,isStartingEra:!1}]},seasonal:{seasons:[],offset:0,type:"Periodic",displayColors:!0,interpolateColors:!0,weather:{enabled:!1,seed:1,tempUnits:et.IMPERIAL,windUnits:et.METRIC,primaryWindDirection:"E"}},locations:{locations:[]},current:{day:1,month:0,year:836},events:[{name:"Spring Equinox",description:"The spring equinox is when the day and the night are equally as long, and are getting longer.",id:"824430",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Summer Solstice",description:" At the summer solstice, the Sun travels the longest path through the sky, and that day therefore has the most daylight.",id:"824431",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Autumn Equinox",description:"The autumn equinox is when the day and the night are equally as long, and are getting shorter.",id:"824432",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Winter Solstice",description:"The winter solstice marks the shortest day and longest night of the year, when the sun is at its lowest arc in the sky.",id:"824433",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:null,sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"New Dawn",description:`The first day of the new year is also the holy day of the Changebringer, as the old year gives way to a new path. In Tal'Dorei, Emon celebrates New Dawn with a grand midnight feast, which commonly features a short play celebrating the changes witnessed in the past year. On the Menagerie Coast, people celebrate by having a feast on the shore at dusk to watch the sunset. They feast and discuss their hopes for the new year until the sun rises.`,id:"824434",note:null,date:{day:1,year:[null,null],month:0},type:U.Recurring,category:"religious-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Hillsgold",description:"This holiday is up to the calendar owner to decide what it is for! :)",id:"824435",note:null,date:{day:27,year:[null,null],month:0},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Day of Challenging",description:`The holy day of the Stormlord is one of the most raucous holidays in Emon. Thousands of spectators attend the annual Godsbrawl, which is held in the fighting ring within the Temple of the Stormlord. The people root for their deity's favored champion, and there is a fierce (yet friendly) rivalry between the Champion of the Stormlord and the Champion of the Platinum Dragon. The winner earns the title of "Supreme Champion" for an entire year. The Day of Challenging is one of the most raucous holidays in Port Damali, and thousands of spectators attend the annual Godsbrawl held in the Temple of\xA0Kord to root for their favored deity's champion, particularly the chosen champions of the Storm Lord and the\xA0All-Hammer.\xA0`,id:"824436",note:null,date:{day:7,year:[null,null],month:1},type:U.Recurring,category:"religious-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Renewal Festival",description:"Spring begins early in the month of Dualahei, officially dateing on the 13th with the Renewal Festival.",id:"824437",note:null,date:{day:13,year:[null,null],month:2},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Wild's Grandeur",description:`Though the Archeart is the god of spring, the peak of the spring season is the holy day of the Wildmother. The people in the southern wilds of Tal'Dorei celebrate the Wildmother's strength by journeying to a place of great natural beauty. This could be the top of a mountainous waterfall, the center of a desert, or even an old and peaceful city park (such as Azalea Street Park in Emon). Though Emon rarely celebrates Wild's Grandeur, the few who do will plant trees in observance of the holiday. The people of the Menagerie Coast set aside this day to sail for no reason other than the pleasure of observing the natural beauty of their surroundings. Those who still partake in elements of Ki'Nau culture take this day to appreciate the fruits and foods granted by the sea, leaving offerings of delicacies and small handmade crafts at temporary altars of twisted roots and grasses.`,id:"824438",note:null,date:{day:20,year:[null,null],month:2},type:U.Recurring,category:"religious-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Harvest's Rise",description:"This holiday is up to the calendar owner to decide what it is for! :)",id:"824439",note:null,date:{day:11,year:[null,null],month:3},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Merryfrond's Day",description:"This holiday is up to the calendar owner to decide what it is for! :)",id:"824440",note:null,date:{day:31,year:[null,null],month:3},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Deep Solace",description:`Moradin's holy day is Deep Solace, which is celebrated on the eighteenth day of the fifth month. Especially devout followers of the All-Hammer spend the day in isolation, meditating on the meaning of family and how they may be better mothers, fathers, siblings, and children. The dwarven communities across Exandria, such as the ones in Grimgolir and Kraghammer, celebrate with a full day of feasting and drinking.\xA0`,id:"824441",note:null,date:{day:18,year:[null,null],month:4},type:U.Recurring,category:"religious-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Zenith",description:"Summer begins in the middle of Unndilar, officially dateing at noon on the 26th day known as the Zenith.",id:"824442",note:null,date:{day:26,year:[null,null],month:4},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Artisan's Faire",description:"This holiday is up to the calendar owner to decide what it is for! :)",id:"824443",note:null,date:{day:15,year:[null,null],month:5},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Elvendawn",description:`Corellon's holy day is called Elvendawn, or Midsummer. It is celebrated on the twentieth day of the sixth month, and commemorates the elves' first emergence from the Feywild. In Syngorn, the Elves open small doorways into the Feywild and celebrate alongside the wild fey with uncharacteristic vigor. Though the Dwendalian Empire doesn't promote the worship of the Arch Heart, the elves of Bysaes Tyl quietly celebrate in private by opening small doors to the Feywild and having a little more wine than usual.\xA0`,id:"824444",note:null,date:{day:20,year:[null,null],month:5},type:U.Recurring,category:"religious-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Highsummer",description:`The holy day of the Dawnfather is the peak of the summer season. Emon celebrates with an entire week of gift-giving and feasting, ending at midnight on the 21st of Sydenstar (the anniversary of the Battle of the Umbra Hills, where Zan Tal'Dorei dethroned Trist Drassig). Whitestone (where the Dawnfather is the city's patron god) celebrates with gift-giving and a festival of lights around the Sun Tree. Due to the Briarwood occupation, money is thin, so most Whitestone folk choose to recount the small things they are thankful for, rather than buy gifts. While other parts of Exandria feast, the Dwendalian Empire uses this day as an opportunity to enlist more soldiers in its army. The military holds great feasts and hands out toy soldiers and other propaganda, encouraging people to enlist and help fight against the evil that threatens the king.\xA0`,id:"824445",note:null,date:{day:7,year:[null,null],month:6},type:U.Recurring,category:"religious-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Morn of Largesse",description:"This holiday is up to the calendar owner to decide what it is for! :)",id:"824446",note:null,date:{day:14,year:[null,null],month:6},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Harvest's Close",description:"Autumn begins on the 3rd of Fessuran\xA0and is typically celebrated with feasting in rural regions and with carnivals in the cities.\xA0",id:"824447",note:null,date:{day:3,year:[null,null],month:7},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"The Hazel Festival",description:"This holiday is up to the calendar owner to decide what it is for! :)",id:"824448",note:null,date:{day:12,year:[null,null],month:8},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Civilization's Dawn",description:`The Law Bearer's holy day is Civilization's Dawn, which is celebrated on the autumnal equinox, usually the twenty-second day of the ninth month. Emon celebrates with a great bonfire in the square of each neighborhood, around which each community dances and gives gifts. In the Dwendalian Empire, people celebrate by having feasts in honor of the laws of the Dwendal bloodline. One seat at every table is left open for the king, who eats in spirit with the people he rules.\xA0`,id:"824449",note:null,date:{day:22,year:[null,null],month:8},type:U.Recurring,category:"religious-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Night of Ascension",description:`The Raven Queen's holy day is called the Night of Ascension, celebrating her apotheosis. The actual date of the her rise to divinity is unclear, but the Night of Ascension is celebrated on the thirteenth day of the tenth month. Though most in Emon see this celebration of the dead as unnerving and macabre, the followers of the Matron of Ravens believe that the honored dead would prefer to be venerated with cheer, not misery. What was once a night of cheery celebration of the dead in the Dwendalian Empire has recently become an occasion to burn effigies and decry the Kryn Dynasty for their unnatural relationship with death.`,id:"824450",note:null,date:{day:13,year:[null,null],month:9},type:U.Recurring,category:"religious-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Zan's Cup",description:"This holiday is up to the calendar owner to decide what it is for! :)",id:"824451",note:null,date:{day:21,year:[null,null],month:9},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Barren Eve",description:"Winter begins on the 2nd day of Duscar, the Barren Eve, which is a nighttime celebration and remembrance of those who fell in battle.",id:"824452",note:null,date:{day:2,year:[null,null],month:10},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Embertide",description:"Bahamut's holy day is called Embertide,\xA0and is celebrated on the fifth day of Duscar. This is a day\xA0of remembrance, solemnity, and respect for those who\xA0have fallen in the defense of others.",id:"824453",note:null,date:{day:5,year:[null,null],month:10},type:U.Recurring,category:"religious-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Winter's Crest",description:`This day celebrates the freedom of Tal'Dorei from Errevon the Rimelord. It is the peak of the winter season, so devout followers of the Matron of Ravens (as the goddess of winter) consider it to be one of her holy days. However, in most of the land, people see Winter's Crest as a secular holiday, often celebrated with omnipresent music in public areas, lavish gift-giving to relatives and loved ones, and the cutting and decorating of trees placed indoors. The Sun Tree in Whitestone is often decorated with lights and other baubles for Winter's Crest.`,id:"824454",note:null,date:{day:20,year:[null,null],month:10},type:U.Recurring,category:"secular-holidays",sort:{timestamp:Number.MIN_VALUE,order:""}}],id:null,categories:[{name:"Religious Holidays",id:"religious-holidays",color:"#0D47A1"},{name:"Secular Holidays",id:"secular-holidays",color:"#4A148C"}]},{name:"Calendar of Harptos",description:"Calendar of Faer\xFBn of the Forgotten Realms.",path:[],supportInlineEvents:!1,inlineEventTag:"inline-events",showIntercalarySeparately:!0,dateFormat:"YYYY-MMM-DD",static:{displayDayNumber:!1,firstWeekDay:0,incrementDay:!1,displayMoons:!0,overflow:!1,padDays:2,padMonths:2,weekdays:[{type:"day",name:"I",id:"ID_9999882bb94a"},{type:"day",name:"II",id:"ID_8a0b4b79d888"},{type:"day",name:"III",id:"ID_da483aca8bf9"},{type:"day",name:"IV",id:"ID_a8fbea39cac8"},{type:"day",name:"V",id:"ID_9b19d9787b0b"},{type:"day",name:"VI",id:"ID_382a590a8a28"},{type:"day",name:"VII",id:"ID_fbca0ab80afb"},{type:"day",name:"VIII",id:"ID_ca093bca5ad9"},{type:"day",name:"IX",id:"ID_d95b39098bf8"},{type:"day",name:"X",id:"ID_389bfb5858db"}],months:[{name:"Hammer (Deepwinter)",short:"Hammer",subtitle:"Deepwinter",type:"month",length:30,interval:1,offset:0,id:"ID_cbeb4b190b6a"},{name:"Midwinter",short:"Midwinter",type:"intercalary",length:1,interval:1,offset:0,id:"ID_89bad9089b7b"},{name:"Alturiak (The Claw of Winter)",short:"Alturiak",subtitle:"The Claw of Winter",type:"month",length:30,interval:1,offset:0,id:"ID_6a08a8aacb7b"},{name:"Ches (The Claw of the Sunsets)",short:"Ches",subtitle:"The Claw of the Sunsets",type:"month",length:30,interval:1,offset:0,id:"ID_db2a7bf97afa"},{name:"Tarsakh (The Claw of Storms)",short:"Tarsakh",subtitle:"The Claw of Storms",type:"month",length:30,interval:1,offset:0,id:"ID_6b48982b0bda"},{name:"Greengrass",short:"Greengrass",type:"intercalary",length:1,interval:1,offset:0,id:"ID_08790af92809"},{name:"Mirtul (The Melting)",short:"Mirtul",subtitle:"The Melting",type:"month",length:30,interval:1,offset:0,id:"ID_b91b39f95a28"},{name:"Kythorn (The Time of Flowers)",short:"Kythorn",subtitle:"The Time of Flowers",type:"month",length:30,interval:1,offset:0,id:"ID_f8e9585a2bf8"},{name:"Flamerule (Summertide)",short:"Flamerule",subtitle:"Summertide",type:"month",length:30,interval:1,offset:0,id:"ID_fa895bdb38e9"},{name:"Midsummer",short:"Midsummer",type:"intercalary",length:1,interval:1,offset:0,id:"ID_a9181b5a683a"},{name:"Eleasis (Highsun)",short:"Eleasis",subtitle:"Highsun",type:"month",length:30,interval:1,offset:0,id:"ID_1b1b1b287b0a"},{name:"Eleint (The Fading)",short:"Eleint",subtitle:"The Fading",type:"month",length:30,interval:1,offset:0,id:"ID_1aca5918993a"},{name:"Highharvestide",short:"Highharvestide",type:"intercalary",length:1,interval:1,offset:0,id:"ID_a94a183b4b88"},{name:"Marpenoth (Leaffall)",short:"Marpenoth",subtitle:"Leaffall",type:"month",length:30,interval:1,offset:0,id:"ID_58d97969eb79"},{name:"Uktar (The Rotting)",short:"Uktar",subtitle:"The Rotting",type:"month",length:30,interval:1,offset:0,id:"ID_4b090b787b18"},{name:"The Feast of the Moon",short:"FeastOfTheMoon",type:"intercalary",length:1,interval:1,offset:0,id:"ID_1b0ae8dbdb4a"},{name:"Nightal (The Drawing Down)",short:"Nightal",subtitle:"The Drawing Down",type:"month",length:30,interval:1,offset:0,id:"ID_abb82afab80a"}],moons:[{name:"Sel\xFAne",cycle:30.4375,offset:13.9,faceColor:"#ffffff",shadowColor:"#000000",id:"ID_48ea2a69a888"}],leapDays:[{name:"Shieldmeet",short:"Shieldmeet",type:"leapday",interval:[{ignore:!1,exclusive:!1,interval:4}],offset:0,timespan:9,intercalary:!1,id:"ID_5b08faa88ada"}],eras:[]},seasonal:{seasons:[],offset:0,type:"Periodic",displayColors:!0,interpolateColors:!0,weather:{enabled:!1,seed:1,tempUnits:et.IMPERIAL,windUnits:et.METRIC,primaryWindDirection:"E"}},locations:{locations:[]},current:{year:1491,day:1,month:0},events:[{name:"Winter Solstice",description:null,id:"824588",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:"natural-events",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Vernal Equinox",description:null,id:"824589",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:"natural-events",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Summer Solstice",description:null,id:"824590",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:"natural-events",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Autumnal Equinox",description:null,id:"824591",note:null,date:{day:null,year:null,month:null},type:U.Undated,category:"natural-events",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Shieldmeet",description:`Shieldmeet was the equivalent of a leap year day in the Calendar of Harptos, occurring once every four years, adding a day after the festival of Midsummer and before Eleasis 1. Traditionally the day was used for fairs, bazaars, musical and theatrical performances, and tournaments of skill and magical ability. Nobles usually held court to hear the petitions of their people and to make or renew trade pacts, alliances, and agreements. Shieldmeet was known as Cinnaelos'Cor (also seen as Cinnaeloscor), "the Day of Corellon's Peace" in elvish and marked the end of an aeloulaev and the beginning of a new one in the elven Aryselmalyn calendar.`,id:"824592",note:null,date:{day:2,year:[null,null],month:9},type:U.Recurring,category:"festivals",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Feast of the Moon",description:`The Feast of the Moon, or Moonfest, was an annual festival in the Calendar of Harptos, occurring between the final night of Uktar and the first day of Nightal. It was the last great festival of the calendar year. The day traditionally marked the onset of winter. It was also a time to celebrate and honor the ancestors and the respected dead. On this day, folk blessed their ancestors' graves and performed the Ritual of Remembrance. People also gathered to tell stories of the deeds of their ancestors and of the gods until deep into the night, until they merged and became legend. This was a time to hear of past heroes, great treasures, and lost cities. In Faer\xC3\u0192\xC2\xBBn, battles were typically fought between harvest-time and the coming of winter. This meant that most of the fighting usually occurred in the month of Uktar. The timing of the Feast of the Moon\xC3\xA2\xE2\u201A\xAC\xE2\u20ACafter recently slain soldiers had joined the ranks of the dead\xC3\xA2\xE2\u201A\xAC\xE2\u20ACwas thus practical, if sadly ironic. The Heralds of Faer\xC3\u0192\xC2\xBBn had a number of special duties on the Feast of the Moon. Prime among these was to perform the Bloodsong ceremony, at which a Herald publicly recited the genealogies of each noble family in the area. In this way, the Heralds reaffirmed a noble family's traditional authority and status, as well as the respect accorded to them. Priests of a number of deities of various pantheons held rites, ceremonies, and festivals on the Feast of the Moon. Many, though not all, focused on remembering the dead in one way or another.`,id:"824593",note:null,date:{day:1,year:[null,null],month:15},type:U.Recurring,category:"festivals",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Highharvesttide",description:`Highharvestide was an annual festival in the Calendar of Harptos, taking place between 30 Eleint and 1 Marpenoth. It was traditionally a feast to celebrate the harvest and the abundance of food, but also the time when those wishing to travel left on their journeys before winter set in. Preparations for the feast dateed as early as a tenday before, while preparing, cooking, and preserving the harvest for the cold winter months. Traditions varied from community to community, but examples of festive activity included food-related contests; races and challenges of skill and strength; receiving homemade sweets from the local clergy; and priests blessing larders, wine cellars, grain bins, and food preserves. This day was often an important anniversary to various governments. Often, taxes and tithes came due, rulers held "open courts" to hear the concerns of their citizens, oaths were publicly renewed, troops received marching orders to new duty stations, and guilds met to confer on prices and rate changes for goods and services. According to tradition, dwarves only drank water and elves drank only dew on this day. However, these traditions began to fade in the 14th and 15th century DR. It was said that children born on this day were favored by Tymora to have lifelong good luck but be smitten with wanderlust. Another legend was that human females born on this day had control over their reproductive system (i.e., got pregnant only when they wanted to) by force of will alone, and that they could instantly sense when they had been poisoned, either by ingestion or being bitten by a venomous creature for example.`,id:"824594",note:null,date:{day:1,year:[null,null],month:12},type:U.Recurring,category:"festivals",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Greengrass",description:"Greengrass was a festival to welcome in the first day of spring in the Calendar of Harptos. It occured annually on a special day between Tarsakh 30 and Mirtul 1. Traditionally, the wealthier people brought out flowers to give to the less wealthy, who either wore them or spread them on the ground to encourage the deities to usher in the summer.",id:"824595",note:null,date:{day:1,year:[null,null],month:5},type:U.Recurring,category:"festivals",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Midwinter",description:`Midwinter (also known as Deadwinter Day) was a festival to mark the midpoint of winter in the Calendar of Harptos. It occured on a special day between Hammer 30 and Alturiak 1. Amongst nobles and monarchs it was known as Midwinter and was traditionally used to make or renew alliances, although the common people called it Deadwinter Day, a reference to the cold and hard times that remained before the spring. On Midwinter Day the Red Fellowship of the Deity known as the Red Knight observes the Retreat. This solemn ceremony consists of an assembly wherein the clergy discuss the previous year's campaigns. Strategies are discussed, battles analyzed, and the accumulated lore integrated into the church's teachings. The holiest day of the year for the Church of Shevarash is Midwinter Night, during which the Dark Court Slaughter is remembered. Inductions into the ranks of the clergy occur at this time. Each new cleric screams vows of vengeance into the night air and swears neither to laugh nor smile until the Spider Queen and her followers are no more.`,id:"824596",note:null,date:{day:1,year:[null,null],month:1},type:U.Recurring,category:"festivals",sort:{timestamp:Number.MIN_VALUE,order:""}},{name:"Midsummer",description:"Midsummer was a festival that celebrated love and music through feast. It occurred between Flamerule 30 and Eleasis 1 on the Calendar of Harptos. It was a time when love advanced, and it was said the deities themselves took a hand to ensure good weather. If bad weather was experienced on this night it was considered an extremely bad omen. Shieldmeet occurred the day after Midsummer on leap years.",id:"824597",note:null,date:{day:1,year:[null,null],month:9},type:U.Recurring,category:"festivals",sort:{timestamp:Number.MIN_VALUE,order:""}}],id:null,categories:[{name:"Natural Events",id:"natural-events",color:"#2E7D32"},{name:"Festivals",id:"festivals",color:"#9b2c2c"}]}];var Rc=class extends ir{async onOpen(){await this.display()}async display(){this.containerEl.addClass("calendarium-choose-preset"),this.contentEl.empty(),this.contentEl.createEl("h3",{text:"Choose a Preset Calendar"});let e=this.contentEl.createDiv("calendarium-preset-container");for(let n of Mv){let a=new Al.ButtonComponent(e).onClick(()=>{this.preset=n,this.display()});this.preset==n&&a.setCta(),a.buttonEl.createDiv({cls:"setting-item-name",text:n.name??""}),a.buttonEl.createDiv({cls:"setting-item-description",text:n.description??""})}let t=this.contentEl.createDiv("calendarium-confirm-buttons");new Al.ButtonComponent(t).setButtonText("Apply").onClick(()=>{this.saved=!0,this.preset=at(this.preset),this.preset.id=Le(6),this.close()}).setCta(),new Al.ExtraButtonComponent(t).setIcon(ns).onClick(()=>{this.close()})}};function Qc(r,e){return new Promise(t=>{let n=new Rc(r.app);n.onClose=()=>{n.saved||t();let a={day:n.preset.current.day,month:n.preset.current.month,year:n.preset.current.year};if(n.preset?.name=="Gregorian Calendar"){let i=new Date;a.year=i.getFullYear(),a.month=i.getMonth(),a.day=i.getDate()}t({...at(n.preset),id:Le(8),name:e?.length?e:n.preset.name,current:{...a}})},n.open()})}typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(dv);var Sm=require("obsidian");var Iv=require("obsidian");function Rv(r){let e=[];if(r.name?.length||e.push("A calendar must have a name."),(!Wo(r.current,r)||!Yo(r.current.month,r)||!zo(r.current.year,r))&&e.push("Specified current date is not valid."),!r.static.weekdays?.length)e.push("A calendar must have at least 1 weekday.");else{if(!r.static.weekdays?.every(t=>t.name?.length)){let t=r.static.weekdays?.filter(n=>!n.name?.length).length;t==1?e.push(`${t} weekday does not have a name.`):e.push(`${t} weekdays do not have names.`)}r.static.firstWeekDay>=(r.static.weekdays?.length??1/0)&&e.push(`Invalid first weekday selection: ${r.static.weekdays[r.static.firstWeekDay]}`)}if(!r.static.months?.length)e.push("A calendar must have at least 1 month.");else{if(!r.static.months?.every(t=>t.name?.length)){let t=r.static.months?.filter(n=>!n.name?.length).length;t==1?e.push(`${t} month does not have a name.`):e.push(`${t} months do not have names.`)}if(!r.static.months?.every(t=>t.length>0)){let t=r.static.months?.filter(n=>!(n.length>0)).length;t==1?e.push(`${t} month does not have a length.`):e.push(`${t} months do not have lengths.`)}}if(r.static.useCustomYears){if(!r.static.years?.length)e.push("Use Custom Years is on but no years have been created.");else if(!r.static.years.every(t=>t.name?.length)){let t=r.static.years.filter(n=>!n.name?.length).length;t==1?e.push(`${t} year does not have a name.`):e.push(`${t} years do not have names.`)}}return e.join(` `)}function Qp(r,e){if(r===null)return!1;let{day:t,month:n,year:a}=r;if(t==null||n==null||t<1)return!1;if(t==null)return"No day specified";if(e?.current?.month==null)return"No month selected";if(t<1||t>e?.static?.months[n]?.length||!e?.static?.months[n]?.length)return"Day does not exist in selected month"}function Ip(r,e){if(r==null)return"No month specified";if(!e?.static?.months?.length)return"No months exist";if(r<0||r>=e?.static?.months?.length)return"Selected month does not exist"}function Fp(r,e){if(r==null)return"No year specified";if(e?.static?.useCustomYears){if(!e?.static?.years?.length)return"No custom years exist";if(r<0||r>=e?.static?.years?.length)return"Year does not exist in custom years"}}function S6(r){we(r,"svelte-1b44fe3",".title.svelte-1b44fe3.svelte-1b44fe3{display:flex;align-items:center;justify-content:space-between}.creator-title.svelte-1b44fe3 h3.svelte-1b44fe3{margin-top:0}.creator-title.svelte-1b44fe3 .can-save{color:var(--background-modifier-success)}.creator-title.vertical-tab-nav-item.svelte-1b44fe3.svelte-1b44fe3:hover{background-color:initial}")}function Qv(r){let e,t,n,a;return{c(){e=_("div"),g(e,"class","check")},m(i,o){$(i,e,o),n||(a=me(t=r[3].call(null,e,r[0])),n=!0)},p(i,o){t&&qt(t.update)&&o&1&&t.update.call(null,i[0])},d(i){i&&A(e),n=!1,a()}}}function A6(r){let e,t,n,a,i=r[0],o=Qv(r);return{c(){e=_("div"),t=_("h3"),n=le(`Calendar Creator `),a=_("div"),o.c(),g(a,"class","creator-check"),g(t,"class","title svelte-1b44fe3"),g(e,"class","creator-title vertical-tab-nav-item svelte-1b44fe3")},m(s,l){$(s,e,l),y(e,t),y(t,n),y(t,a),o.m(a,null)},p(s,[l]){l&1&&re(i,i=s[0])?(o.d(1),o=Qv(s),o.c(),o.m(a,null)):o.p(s,l)},i:I,o:I,d(s){s&&A(e),o.d(s)}}}function $6(r,e,t){let n,a,i=Ve("store");ie(r,i,l=>t(4,n=l));let{valid:o}=i;return ie(r,o,l=>t(0,a=l)),[a,i,o,(l,u)=>{let c=l.createSpan("save");u&&c.addClass("can-save"),c.setAttr("aria-label",u?"All good! Exit to save.":Rv(n)),(0,Iv.setIcon)(c,u?Yi:An)}]}var Zp=class extends ae{constructor(e){super(),oe(this,e,$6,A6,re,{},S6)}},is=Zp;function T6(r){we(r,"svelte-mhm5f8",".creator-history.svelte-mhm5f8{display:flex;padding:var(--size-2-3)}")}function N6(r){let e,t,n,a,i,o,s,l;return{c(){e=_("div"),t=_("div"),a=F(),i=_("div"),g(t,"class","clickable-icon setting-editor-extra-setting-button"),Ee(t,"is-disabled",!r[1]),g(i,"class","clickable-icon setting-editor-extra-setting-button"),Ee(i,"is-disabled",!r[0]),g(e,"class","creator-history svelte-mhm5f8")},m(u,c){$(u,e,c),y(e,t),y(e,a),y(e,i),s||(l=[me(n=vt.call(null,t,bv)),ce(t,"click",r[4]),me(o=vt.call(null,i,vv)),ce(i,"click",r[5])],s=!0)},p(u,[c]){c&2&&Ee(t,"is-disabled",!u[1]),c&1&&Ee(i,"is-disabled",!u[0])},i:I,o:I,d(u){u&&A(e),s=!1,Te(l)}}}function P6(r,e,t){let n,a,i=Ve("store"),{undo:o,redo:s,canRedo:l,canUndo:u}=i;return ie(r,l,d=>t(0,n=d)),ie(r,u,d=>t(1,a=d)),[n,a,l,u,()=>{a&&o()},()=>{n&&s()}]}var qp=class extends ae{constructor(e){super(),oe(this,e,P6,N6,re,{},T6)}},Ic=qp;var os=require("obsidian");var zv=Gn(Fc());var qc=require("obsidian");function M6(r){we(r,"svelte-1se2jsg",".warning-label.svelte-1se2jsg{color:var(--text-error)}")}function R6(r){let e,t,n;return{c(){e=_("div"),t=_("div"),n=le(r[0]),g(t,"class","setting-item-description warning-label svelte-1se2jsg"),g(e,"class","warning-label-container")},m(a,i){$(a,e,i),y(e,t),y(t,n)},p(a,[i]){i&1&&ve(n,a[0])},i:I,o:I,d(a){a&&A(e)}}}function Q6(r,e,t){let{label:n}=e;return r.$$set=a=>{"label"in a&&t(0,n=a.label)},[n]}var Lp=class extends ae{constructor(e){super(),oe(this,e,Q6,R6,re,{label:0},M6)}},Zc=Lp;function I6(r){we(r,"svelte-81y1df",".add-button.svelte-81y1df.svelte-81y1df{display:flex;align-items:center}.add-new.svelte-81y1df.svelte-81y1df{gap:0.5rem}.add-new.setting-item.svelte-81y1df input.svelte-81y1df{margin-right:initial}")}function F6(r){let e,t;return{c(){e=_("span"),t=le(r[0]),g(e,"class","setting-item-name")},m(n,a){$(n,e,a),y(e,t)},p(n,a){a&1&&ve(t,n[0])},d(n){n&&A(e)}}}function Z6(r){let e,t,n;return{c(){e=_("input"),g(e,"type","text"),g(e,"spellcheck","false"),g(e,"placeholder",r[0]),g(e,"class","svelte-81y1df")},m(a,i){$(a,e,i),Re(e,r[4]),t||(n=[ce(e,"input",r[11]),ce(e,"keyup",r[12])],t=!0)},p(a,i){i&1&&g(e,"placeholder",a[0]),i&16&&e.value!==a[4]&&Re(e,a[4])},d(a){a&&A(e),t=!1,Te(n)}}}function Fv(r){let e,t;return e=new Zc({props:{label:r[2]}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a&4&&(i.label=n[2]),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function q6(r){let e,t,n,a,i,o,s,l,u;function c(p,m){return p[1]?Z6:F6}let f=c(r,-1),d=f(r),h=r[2]&&Fv(r);return{c(){e=_("div"),d.c(),t=F(),n=_("div"),i=F(),h&&h.c(),o=He(),g(n,"class","add-button svelte-81y1df"),g(e,"class","add-new setting-item svelte-81y1df")},m(p,m){$(p,e,m),d.m(e,null),y(e,t),y(e,n),$(p,i,m),h&&h.m(p,m),$(p,o,m),s=!0,l||(u=me(a=r[7].call(null,n)),l=!0)},p(p,[m]){f===(f=c(p,m))&&d?d.p(p,m):(d.d(1),d=f(p),d&&(d.c(),d.m(e,t))),p[2]?h?(h.p(p,m),m&4&&P(h,1)):(h=Fv(p),h.c(),P(h,1),h.m(o.parentNode,o)):h&&(Oe(),R(h,1,1,()=>{h=null}),_e())},i(p){s||(P(h),s=!0)},o(p){R(h),s=!1},d(p){p&&(A(e),A(i),A(o)),d.d(),h&&h.d(p),l=!1,u()}}}function L6(r,e,t){let n,a,i=Qt(),{disabled:o=Za(!1)}=e,{placeholder:s="Add new"}=e,{isInput:l=!0}=e,{label:u=null}=e,c=Ze("");ie(r,c,b=>t(4,n=b));let f=l?de([c,o],([b,E])=>E||b.length<=0):Za(!1);ie(r,f,b=>t(3,a=b));let d,h=b=>{t(10,d=(l?new qc.ExtraButtonComponent(b):new qc.ButtonComponent(b)).setIcon(rs).onClick(()=>{a||p()}))},p=()=>{i("add",n),Ce(c,n="",n)};function m(){n=this.value,c.set(n)}let O=b=>{a||b.key==="Enter"&&p()};return r.$$set=b=>{"disabled"in b&&t(9,o=b.disabled),"placeholder"in b&&t(0,s=b.placeholder),"isInput"in b&&t(1,l=b.isInput),"label"in b&&t(2,u=b.label)},r.$$.update=()=>{r.$$.dirty&1032&&d&&d.setDisabled(a)},[s,l,u,a,n,c,f,h,p,o,d,m,O]}var Bp=class extends ae{constructor(e){super(),oe(this,e,L6,q6,re,{disabled:9,placeholder:0,isInput:1,label:2},I6)}},mr=Bp;function B6(r){we(r,"svelte-1o5puim",".no-existing-items.svelte-1o5puim.svelte-1o5puim{width:100%}.no-existing-items.svelte-1o5puim span.svelte-1o5puim{width:100%;text-align:center;color:var(--text-faint)}")}function U6(r){let e,t,n;return{c(){e=_("div"),t=_("span"),n=le(r[0]),g(t,"class","svelte-1o5puim"),g(e,"class","no-existing-items setting-item svelte-1o5puim")},m(a,i){$(a,e,i),y(e,t),y(t,n)},p(a,[i]){i&1&&ve(n,a[0])},i:I,o:I,d(a){a&&A(e)}}}function W6(r,e,t){let{message:n}=e;return r.$$set=a=>{"message"in a&&t(0,n=a.message)},[n]}var Up=class extends ae{constructor(e){super(),oe(this,e,W6,U6,re,{message:0},B6)}},gr=Up;var Uv=require("obsidian");function Y6(r){we(r,"svelte-1my4lf",'.always-open.svelte-1my4lf.svelte-1my4lf{pointer-events:none}.creator-settings-container.svelte-1my4lf.svelte-1my4lf{pointer-events:initial}.calendarium-nested-settings.svelte-1my4lf.svelte-1my4lf{position:relative}.calendarium-nested-summary.svelte-1my4lf.svelte-1my4lf{outline:none;list-style:none !important;list-style-type:none !important;min-height:1rem;border-top-left-radius:0.1rem;border-top-right-radius:0.1rem;cursor:pointer;background-color:var(--creator-background-color);margin-right:0;display:flex;justify-content:space-between}.right-side.svelte-1my4lf.svelte-1my4lf{display:flex;align-items:center;gap:1rem}summary.svelte-1my4lf.svelte-1my4lf::-webkit-details-marker,summary.svelte-1my4lf.svelte-1my4lf::marker{display:none !important}.always-open.svelte-1my4lf .handle.svelte-1my4lf{display:none}.collapser.svelte-1my4lf.svelte-1my4lf{display:flex;flex-flow:column;justify-content:flex-start;align-items:flex-end;content:""}.handle.svelte-1my4lf.svelte-1my4lf{transform:rotate(0deg);transition:transform 0.25s;display:flex}details[open].svelte-1my4lf .handle.svelte-1my4lf{transform:rotate(90deg)}.creator-settings-container.svelte-1my4lf.svelte-1my4lf{padding:0.75em var(--size-4-3)}.calendarium-nested-settings.svelte-1my4lf.svelte-1my4lf{border-top:0px}')}var z6=r=>({}),Zv=r=>({class:"context"});function qv(r){let e,t=r[9].context,n=Xr(t,r,r[8],Zv);return{c(){n&&n.c()},m(a,i){n&&n.m(a,i),e=!0},p(a,i){n&&n.p&&(!e||i&256)&&Hr(n,t,a,a[8],e?Gr(t,a[8],i,z6):Kr(a[8]),Zv)},i(a){e||(P(n,a),e=!0)},o(a){R(n,a),e=!1},d(a){n&&n.d(a)}}}function Lv(r){let e,t,n,a;return{c(){e=_("div"),g(e,"class","x-small")},m(i,o){$(i,e,o),n||(a=me(t=vt.call(null,e,An)),n=!0)},d(i){i&&A(e),n=!1,a()}}}function Bv(r){let e,t;return e=new Zc({props:{label:r[4]}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a&16&&(i.label=n[4]),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function V6(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p,m,O,b,E,D,C,k,w,T,S,M=r[0]&&qv(r),Z=r[3]&&Lv(r),N=r[3]&&r[4]&&Bv(r),L=r[9].default,j=Xr(L,r,r[8],null);return{c(){e=_("details"),t=_("summary"),n=_("div"),a=_("div"),i=_("div"),o=le(r[1]),s=F(),l=_("div"),u=le(r[2]),c=F(),f=_("div"),M&&M.c(),d=F(),h=_("div"),p=_("div"),Z&&Z.c(),m=F(),O=_("div"),E=F(),N&&N.c(),D=F(),C=_("div"),j&&j.c(),g(i,"class","setting-item-name"),g(l,"class","setting-item-description"),g(a,"class","setting-item-info"),g(n,"class","setting-item setting-item-heading"),g(O,"class","handle svelte-1my4lf"),g(p,"class","warning-container"),g(h,"class","collapser svelte-1my4lf"),g(f,"class","right-side svelte-1my4lf"),g(t,"class","calendarium-nested-summary svelte-1my4lf"),g(C,"class","creator-settings-container svelte-1my4lf"),g(e,"class","creator calendarium-nested-settings setting-item svelte-1my4lf"),Ee(e,"always-open",r[5])},m(X,fe){$(X,e,fe),y(e,t),y(t,n),y(n,a),y(a,i),y(i,o),y(a,s),y(a,l),y(l,u),y(t,c),y(t,f),M&&M.m(f,null),y(f,d),y(f,h),y(h,p),Z&&Z.m(p,null),y(p,m),y(p,O),y(h,E),N&&N.m(h,null),y(e,D),y(e,C),j&&j.m(C,null),e.open=r[0],w=!0,T||(S=[me(b=r[7].call(null,O)),ce(t,"keyup",j6),ce(e,"toggle",r[10]),me(k=r[6].call(null,e))],T=!0)},p(X,[fe]){(!w||fe&2)&&ve(o,X[1]),(!w||fe&4)&&ve(u,X[2]),X[0]?M?(M.p(X,fe),fe&1&&P(M,1)):(M=qv(X),M.c(),P(M,1),M.m(f,d)):M&&(Oe(),R(M,1,1,()=>{M=null}),_e()),X[3]?Z||(Z=Lv(X),Z.c(),Z.m(p,m)):Z&&(Z.d(1),Z=null),X[3]&&X[4]?N?(N.p(X,fe),fe&24&&P(N,1)):(N=Bv(X),N.c(),P(N,1),N.m(h,null)):N&&(Oe(),R(N,1,1,()=>{N=null}),_e()),j&&j.p&&(!w||fe&256)&&Hr(j,L,X,X[8],w?Gr(L,X[8],fe,null):Kr(X[8]),null),fe&1&&(e.open=X[0]),(!w||fe&32)&&Ee(e,"always-open",X[5])},i(X){w||(P(M),P(N),P(j,X),w=!0)},o(X){R(M),R(N),R(j,X),w=!1},d(X){X&&A(e),M&&M.d(),Z&&Z.d(),N&&N.d(),j&&j.d(X),T=!1,Te(S)}}}var j6=r=>r.preventDefault();function X6(r,e,t){let{$$slots:n={},$$scope:a}=e,{open:i=!0}=e,{name:o}=e,{desc:s=""}=e,{warn:l=!1}=e,{label:u=null}=e,{alwaysOpen:c=!1}=e,f=p=>{i&&p.setAttr("open","open")},d=p=>{(0,Uv.setIcon)(p,zi)};function h(){i=this.open,t(0,i)}return r.$$set=p=>{"open"in p&&t(0,i=p.open),"name"in p&&t(1,o=p.name),"desc"in p&&t(2,s=p.desc),"warn"in p&&t(3,l=p.warn),"label"in p&&t(4,u=p.label),"alwaysOpen"in p&&t(5,c=p.alwaysOpen),"$$scope"in p&&t(8,a=p.$$scope)},[i,o,s,l,u,c,f,d,a,n,h]}var Wp=class extends ae{constructor(e){super(),oe(this,e,X6,V6,re,{open:0,name:1,desc:2,warn:3,label:4,alwaysOpen:5},Y6)}},xt=Wp;function G6(r){we(r,"svelte-1ok7o99",".category.svelte-1ok7o99{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:0.5rem;padding-top:0.75rem}")}function Wv(r,e,t){let n=r.slice();return n[10]=e[t],n}function H6(r){let e,t=$e(r[0]),n=[];for(let a=0;a{s[f]=null}),_e(),t=s[e],t?t.p(u,c):(t=s[e]=o[e](u),t.c()),P(t,1),t.m(n.parentNode,n))},i(u){i||(P(t),P(a.$$.fragment,u),i=!0)},o(u){R(t),R(a.$$.fragment,u),i=!1},d(u){u&&A(n),s[e].d(u),Y(a,u)}}}function e7(r){let e,t;return e=new xt({props:{name:"Categories",open:os.Platform.isDesktop,desc:`${r[1].length} categor${r[1].length!=1?"ies":"y"}`,$$slots:{default:[J6]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&2&&(i.desc=`${n[1].length} categor${n[1].length!=1?"ies":"y"}`),a&8193&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function t7(r,e,t){let n,a,i,o=Ve("store");ie(r,o,h=>t(7,a=h));let{categoryStore:s}=o;ie(r,s,h=>t(1,i=h));let l=(h,p)=>{new os.TextComponent(h).setValue(p.name).setPlaceholder("Name").onChange(O=>{p.name=O,s.update(p.id,p)}).inputEl.setAttr("style","width: 100%;")},u=(h,p)=>{new os.ExtraButtonComponent(h).setIcon(Lt).onClick(()=>{s.delete(p.id)})},c=(h,p)=>{let{target:m}=h;m instanceof HTMLInputElement&&(p.color=m.value,s.update(p.id,p))},f=(h,p)=>c(p,h),d=h=>s.add({id:Le(6),color:(0,zv.default)(),name:h.detail});return r.$$.update=()=>{r.$$.dirty&128&&t(0,n=a.categories)},[n,i,o,s,l,u,c,a,f,d]}var Yp=class extends ae{constructor(e){super(),oe(this,e,t7,e7,re,{},G6)}},Vv=Yp;var mn=require("obsidian");function r7(r){we(r,"svelte-1ldxqlp",".dot.svelte-1ldxqlp{display:inline-block;height:0.875em;width:0.875em;margin:0 1px}")}function n7(r){let e,t;return{c(){e=or("svg"),t=or("circle"),g(t,"stroke",r[0]),g(t,"fill",r[0]),g(t,"cx","3"),g(t,"cy","3"),g(t,"r","2"),g(e,"class","dot svelte-1ldxqlp"),g(e,"viewBox","0 0 6 6"),g(e,"xmlns","http://www.w3.org/2000/svg"),g(e,"aria-label",r[1])},m(n,a){$(n,e,a),y(e,t)},p(n,[a]){a&1&&g(t,"stroke",n[0]),a&1&&g(t,"fill",n[0]),a&2&&g(e,"aria-label",n[1])},i:I,o:I,d(n){n&&A(e)}}}function a7(r,e,t){let{color:n}=e,{label:a}=e;return r.$$set=i=>{"color"in i&&t(0,n=i.color),"label"in i&&t(1,a=i.label)},[n,a]}var zp=class extends ae{constructor(e){super(),oe(this,e,a7,n7,re,{color:0,label:1},r7)}},jv=zp;function i7(r){we(r,"svelte-t8uf71",".event.svelte-t8uf71.svelte-t8uf71{display:grid;grid-template-columns:1fr auto;align-items:center;justify-content:space-between;gap:1rem;margin-top:0.5rem;width:100%;margin:0}.event-info.svelte-t8uf71.svelte-t8uf71{width:100%}.icons.svelte-t8uf71.svelte-t8uf71{display:flex;align-self:flex-start;justify-self:flex-end;align-items:center}.event.svelte-t8uf71 .icon.svelte-t8uf71{align-items:center}.date.svelte-t8uf71.svelte-t8uf71{display:flex;justify-content:flex-start;gap:0.25rem}.clamp.svelte-t8uf71.svelte-t8uf71{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;word-break:keep-all;overflow:hidden;width:calc(var(--event-max-width) * 0.75)}.event-name.svelte-t8uf71.svelte-t8uf71{display:flex;align-items:center;gap:0.25rem}")}function Xv(r){let e,t;return e=new jv({props:{color:r[1].color,label:r[1].name}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a&2&&(i.color=n[1].color),a&2&&(i.label=n[1].name),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function o7(r){let e,t,n,a,i,o,s,l;return{c(){e=_("div"),t=_("div"),a=F(),i=_("div"),g(t,"class","icon svelte-t8uf71"),g(i,"class","icon svelte-t8uf71"),g(e,"class","icons svelte-t8uf71")},m(u,c){$(u,e,c),y(e,t),y(e,a),y(e,i),s||(l=[me(n=r[8].call(null,t)),ce(t,"click",r[16]),me(o=r[7].call(null,i)),ce(i,"click",r[17])],s=!0)},p:I,d(u){u&&A(e),s=!1,Te(l)}}}function s7(r){let e,t,n,a,i;return{c(){e=_("div"),t=_("div"),g(t,"class","icon svelte-t8uf71"),g(e,"class","icons svelte-t8uf71")},m(o,s){$(o,e,s),y(e,t),a||(i=[me(n=r[9].call(null,t)),ce(t,"click",r[15])],a=!0)},p:I,d(o){o&&A(e),a=!1,Te(i)}}}function l7(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p,m=r[1]!=null&&Xv(r);function O(D,C){return D[0]?s7:o7}let b=O(r,-1),E=b(r);return{c(){e=_("div"),t=_("div"),n=_("span"),m&&m.c(),a=F(),i=_("div"),o=F(),s=_("div"),l=_("span"),u=_("em"),c=le(r[2]),f=F(),d=_("span"),h=F(),E.c(),g(n,"class","setting-item-name event-name svelte-t8uf71"),g(l,"class","date svelte-t8uf71"),g(d,"class","clamp svelte-t8uf71"),g(s,"class","setting-item-description"),g(t,"class","event-info svelte-t8uf71"),g(e,"class","event svelte-t8uf71")},m(D,C){$(D,e,C),y(e,t),y(t,n),m&&m.m(n,null),y(n,a),y(n,i),r[13](i),y(t,o),y(t,s),y(s,l),y(l,u),y(u,c),y(s,f),y(s,d),r[14](d),y(e,h),E.m(e,null),p=!0},p(D,[C]){D[1]!=null?m?(m.p(D,C),C&2&&P(m,1)):(m=Xv(D),m.c(),P(m,1),m.m(n,a)):m&&(Oe(),R(m,1,1,()=>{m=null}),_e()),(!p||C&4)&&ve(c,D[2]),b===(b=O(D,C))&&E?E.p(D,C):(E.d(1),E=b(D),E&&(E.c(),E.m(e,null)))},i(D){p||(P(m),p=!0)},o(D){R(m),p=!1},d(D){D&&A(e),m&&m.d(),r[13](null),r[14](null),E.d()}}}function u7(r,e,t){let n,a=I,i=()=>(a(),a=be(O,S=>t(12,n=S)),O);r.$$.on_destroy.push(()=>a());let o=Qt(),s=S=>{new mn.ExtraButtonComponent(S).setIcon(Lt).setTooltip("Delete").extraSettingsEl.setAttr("style","margin-left: 0;")},l=S=>{new mn.ExtraButtonComponent(S).setIcon(Ar).setTooltip("Edit")},u=S=>{new mn.ExtraButtonComponent(S).setIcon(Ec).setTooltip("Open note")},c=Ve("plugin");function f(){if(d.note){let S=d.note.endsWith(".md")?d.note:`${d.note}.md`,M=c.app.vault.getAbstractFileByPath(S);M&&M instanceof mn.TFile&&(c.app.workspace.getLeaf().openFile(M),c.app.setting.close())}}let{event:d}=e,{file:h}=e,{category:p}=e,{date:m}=e,{nameFilter:O}=e;i();let b,E;function D(S){Jr[S?"unshift":"push"](()=>{b=S,t(4,b)})}function C(S){Jr[S?"unshift":"push"](()=>{E=S,t(5,E)})}let k=()=>f(),w=()=>o("edit"),T=()=>o("delete");return r.$$set=S=>{"event"in S&&t(11,d=S.event),"file"in S&&t(0,h=S.file),"category"in S&&t(1,p=S.category),"date"in S&&t(2,m=S.date),"nameFilter"in S&&i(t(3,O=S.nameFilter))},r.$$.update=()=>{if(r.$$.dirty&6192&&b&&E)if(!d.name)(0,mn.setIcon)(b.createDiv(),An),b.createSpan({text:"(no name)"});else if(n.length){let S=(0,mn.prepareSimpleSearch)(n)(d.name);if(S?(b.empty(),(0,mn.renderMatches)(b,d.name,S.matches)):b.setText(d.name),d.description){let M=(0,mn.prepareSimpleSearch)(n)(d.description);M?(E.empty(),(0,mn.renderMatches)(E,d.description,M.matches)):E.setText(d.description??"")}}else b.setText(d.name),E.setText(d.description??"")},[h,p,m,O,b,E,o,s,l,u,f,d,n,D,C,k,w,T]}var Vp=class extends ae{constructor(e){super(),oe(this,e,u7,l7,re,{event:11,file:0,category:1,date:2,nameFilter:3},i7)}},Gv=Vp;var ji=require("obsidian");var Nl=require("obsidian");var Hv=require("obsidian"),gn=class extends Hv.Menu{constructor(e){super(),e.register(()=>super.close())}};function c7(r){we(r,"svelte-1nkwchr",".pagination.svelte-1nkwchr.svelte-1nkwchr{display:flex;justify-content:space-between;align-items:center;gap:1rem;width:100%}.paginated-container.svelte-1nkwchr.svelte-1nkwchr{display:flex;align-items:center;gap:1rem}.paginated.svelte-1nkwchr.svelte-1nkwchr{display:flex;align-items:center;gap:1rem}.clickable-icon.active.svelte-1nkwchr.svelte-1nkwchr{background-color:var(--background-modifier-hover)}.slicer.svelte-1nkwchr.svelte-1nkwchr{display:flex;align-items:center;gap:0.5rem}.slicer.svelte-1nkwchr .per.svelte-1nkwchr{color:var(--text-muted);font-size:var(--font-smallest)}")}function Kv(r,e,t){let n=r.slice();return n[17]=e[t],n}function f7(r){let e,t=r[17]+"",n,a,i,o;function s(){return r[14](r[17])}return{c(){e=_("span"),n=le(t),a=F(),g(e,"class","clickable-icon svelte-1nkwchr"),Ee(e,"active",r[17]==r[3])},m(l,u){$(l,e,u),y(e,n),y(e,a),i||(o=ce(e,"click",s),i=!0)},p(l,u){r=l,u&16&&t!==(t=r[17]+"")&&ve(n,t),u&24&&Ee(e,"active",r[17]==r[3])},d(l){l&&A(e),i=!1,o()}}}function d7(r){let e,t,n;return{c(){e=_("span"),e.textContent="..."},m(a,i){$(a,e,i),t||(n=ce(e,"click",r[13]),t=!0)},p:I,d(a){a&&A(e),t=!1,n()}}}function Jv(r){let e;function t(i,o){return i[17]==null?d7:f7}let n=t(r,-1),a=n(r);return{c(){a.c(),e=He()},m(i,o){a.m(i,o),$(i,e,o)},p(i,o){n===(n=t(i,o))&&a?a.p(i,o):(a.d(1),a=n(i),a&&(a.c(),a.m(e.parentNode,e)))},d(i){i&&A(e),a.d(i)}}}function h7(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p,m,O,b,E=$e(r[4]),D=[];for(let C=0;C(o(),o=be(O,Z=>t(3,i=Z)),O),l,u=I,c=()=>(u(),u=be(b,Z=>t(12,l=Z)),b),f,d=I,h=()=>(d(),d=be(m,Z=>t(15,f=Z)),m);r.$$.on_destroy.push(()=>o()),r.$$.on_destroy.push(()=>u()),r.$$.on_destroy.push(()=>d());let p=Ve("plugin"),{slice:m}=e;h();let{page:O}=e;s();let{pages:b}=e;c();let E=Z=>{new Nl.DropdownComponent(Z).addOptions({10:"10",25:"25",50:"50",100:"100",200:"200"}).setValue(`${f}`).onChange(N=>Ce(m,f=Number(N),f))},D,C=Z=>{t(9,D=new Nl.ExtraButtonComponent(Z).setIcon("chevron-left").setDisabled(i==1).onClick(()=>{Ce(O,i=i-1,i)}))},k,w=Z=>{t(10,k=new Nl.ExtraButtonComponent(Z).setIcon("chevron-right").setDisabled(i==l).onClick(()=>{Ce(O,i=Math.min(i+1,l),i)}))},T=Z=>{let N=new gn(p);for(let L of n)N.addItem(j=>{j.setTitle(`${L}`).onClick(()=>{Ce(O,i=L,i)})});N.showAtMouseEvent(Z)},S=Z=>T(Z),M=Z=>Ce(O,i=Z??0,i);return r.$$set=Z=>{"slice"in Z&&h(t(0,m=Z.slice)),"page"in Z&&s(t(1,O=Z.page)),"pages"in Z&&c(t(2,b=Z.pages))},r.$$.update=()=>{r.$$.dirty&4096&&t(11,n=[...Array(l).keys()].map(Z=>Z+1)),r.$$.dirty&5640&&k&&D&&(k.setDisabled(i==l),D.setDisabled(i==1)),r.$$.dirty&6152&&t(4,a=n.reduce((Z,N)=>(N==1||i==1&&(N==2||N==3)||N==l||i==l&&(N==l-1||N==l-2)||N==i-1||N==i||N==i+1?Z.push(N):Z.length>=1&&Z[Z.length-1]!=null&&Z.push(null),Z),[]))},[m,O,b,i,a,E,C,w,T,D,k,n,l,S,M]}var jp=class extends ae{constructor(e){super(),oe(this,e,p7,h7,re,{slice:0,page:1,pages:2},c7)}},eO=jp;var Lc=require("obsidian");function m7(r){we(r,"svelte-1xutc2s",".search.svelte-1xutc2s,.search.svelte-1xutc2s input{width:100%}")}function g7(r){let e,t,n,a;return{c(){e=_("div"),g(e,"class","search svelte-1xutc2s")},m(i,o){$(i,e,o),n||(a=me(t=r[1].call(null,e)),n=!0)},p:I,i:I,o:I,d(i){i&&A(e),n=!1,a()}}}function y7(r,e,t){let n,a=I,i=()=>(a(),a=be(o,u=>t(3,n=u)),o);r.$$.on_destroy.push(()=>a());let{filter:o}=e;i();let{placeholder:s}=e,l=u=>{let c=new Lc.SearchComponent(u).setPlaceholder(s).onChange((0,Lc.debounce)(f=>{Ce(o,n=f,n)},10));o.subscribe(f=>{(!f||!f.length)&&c.setValue("")}),c.inputEl.onClickEvent(f=>{f.preventDefault()}),c.clearButtonEl.onClickEvent(f=>{f.preventDefault()})};return r.$$set=u=>{"filter"in u&&i(t(0,o=u.filter)),"placeholder"in u&&t(2,s=u.placeholder)},[o,l,s]}var Xp=class extends ae{constructor(e){super(),oe(this,e,y7,g7,re,{filter:0,placeholder:2},m7)}},tO=Xp;var Bc=require("obsidian");var b7=r=>({}),rO=r=>({}),v7=r=>({}),nO=r=>({}),O7=r=>({}),aO=r=>({});function _7(r){let e,t,n,a,i,o,s,l=r[1].name,u=Xr(l,r,r[0],aO),c=r[1].desc,f=Xr(c,r,r[0],nO),d=r[1].control,h=Xr(d,r,r[0],rO);return{c(){e=_("div"),t=_("span"),u&&u.c(),n=F(),a=_("div"),f&&f.c(),i=F(),o=_("div"),h&&h.c(),g(t,"class","setting-item-name"),g(a,"class","setting-item-description"),g(e,"class","setting-item-info"),g(o,"class","setting-item-control")},m(p,m){$(p,e,m),y(e,t),u&&u.m(t,null),y(e,n),y(e,a),f&&f.m(a,null),$(p,i,m),$(p,o,m),h&&h.m(o,null),s=!0},p(p,[m]){u&&u.p&&(!s||m&1)&&Hr(u,l,p,p[0],s?Gr(l,p[0],m,O7):Kr(p[0]),aO),f&&f.p&&(!s||m&1)&&Hr(f,c,p,p[0],s?Gr(c,p[0],m,v7):Kr(p[0]),nO),h&&h.p&&(!s||m&1)&&Hr(h,d,p,p[0],s?Gr(d,p[0],m,b7):Kr(p[0]),rO)},i(p){s||(P(u,p),P(f,p),P(h,p),s=!0)},o(p){R(u,p),R(f,p),R(h,p),s=!1},d(p){p&&(A(e),A(i),A(o)),u&&u.d(p),f&&f.d(p),h&&h.d(p)}}}function w7(r,e,t){let{$$slots:n={},$$scope:a}=e;return r.$$set=i=>{"$$scope"in i&&t(0,a=i.$$scope)},[a,n]}var Gp=class extends ae{constructor(e){super(),oe(this,e,w7,_7,re,{})}},lt=Gp;var iO=require("obsidian");function D7(r){we(r,"svelte-1v9emsw",".recurring.svelte-1v9emsw.svelte-1v9emsw{display:flex;align-items:center;gap:0.25rem}.recurring.svelte-1v9emsw input.svelte-1v9emsw{width:100%}")}function C7(r){let e,t,n,a,i,o,s,l,u,c,f,d;return{c(){e=_("input"),t=F(),n=_("div"),a=_("div"),o=F(),s=_("input"),l=F(),u=_("div"),g(e,"type","number"),g(e,"spellcheck","false"),g(e,"placeholder",r[2]),g(s,"type","number"),g(s,"spellcheck","false"),g(s,"placeholder",r[2]),g(s,"class","svelte-1v9emsw"),g(n,"class","recurring svelte-1v9emsw")},m(h,p){$(h,e,p),Re(e,r[3][0]),$(h,t,p),$(h,n,p),y(n,a),y(n,o),y(n,s),Re(s,r[3][1]),y(n,l),y(n,u),f||(d=[ce(e,"input",r[6]),me(i=vt.call(null,a,"corner-down-right")),ce(s,"input",r[7]),me(c=r[5].call(null,u)),ce(u,"click",r[8])],f=!0)},p(h,[p]){p&4&&g(e,"placeholder",h[2]),p&8&&Ct(e.value)!==h[3][0]&&Re(e,h[3][0]),p&4&&g(s,"placeholder",h[2]),p&8&&Ct(s.value)!==h[3][1]&&Re(s,h[3][1])},i:I,o:I,d(h){h&&(A(e),A(t),A(n)),f=!1,Te(d)}}}function k7(r,e,t){let n,a=I,i=()=>(a(),a=be(o,p=>t(4,n=p)),o);r.$$.on_destroy.push(()=>a());let{event:o}=e;i();let{field:s}=e,{placeholder:l}=e,u=n.date[s],c=p=>{new iO.ExtraButtonComponent(p).setIcon(Lt).setTooltip("Make recurring")};function f(){u[0]=Ct(this.value),t(3,u)}function d(){u[1]=Ct(this.value),t(3,u)}let h=()=>{Ce(o,n.date[s]=u[0],n)};return r.$$set=p=>{"event"in p&&i(t(0,o=p.event)),"field"in p&&t(1,s=p.field),"placeholder"in p&&t(2,l=p.placeholder)},[o,s,l,u,n,c,f,d,h]}var Hp=class extends ae{constructor(e){super(),oe(this,e,k7,C7,re,{event:0,field:1,placeholder:2},D7)}},Kp=Hp;var cO=require("obsidian");function E7(r){we(r,"svelte-18iyc6k",".recurring.svelte-18iyc6k{display:flex;align-items:center;gap:0.25rem}.dropdown.svelte-18iyc6k{width:100%}")}function oO(r,e,t){let n=r.slice();return n[9]=e[t],n[11]=t,n}function sO(r,e,t){let n=r.slice();return n[9]=e[t],n[11]=t,n}function lO(r){let e,t=r[9]+"",n,a;return{c(){e=_("option"),n=le(t),e.__value=a=r[11],Re(e,e.__value)},m(i,o){$(i,e,o),y(e,n)},p(i,o){o&2&&t!==(t=i[9]+"")&&ve(n,t)},d(i){i&&A(e)}}}function uO(r){let e,t=r[9]+"",n,a;return{c(){e=_("option"),n=le(t),e.__value=a=r[11],Re(e,e.__value)},m(i,o){$(i,e,o),y(e,n)},p(i,o){o&2&&t!==(t=i[9]+"")&&ve(n,t)},d(i){i&&A(e)}}}function x7(r){let e,t,n,a,i,o,s,l,u,c,f,d,h=$e([...r[1]]),p=[];for(let b=0;br[6].call(e)),g(s,"class","dropdown svelte-18iyc6k"),r[2][1]===void 0&&St(()=>r[7].call(s)),g(n,"class","recurring svelte-18iyc6k")},m(b,E){$(b,e,E);for(let D=0;D(a(),a=be(o,p=>t(3,n=p)),o);r.$$.on_destroy.push(()=>a());let{event:o}=e;i();let{field:s}=e,{items:l}=e,u=n.date[s],c=p=>{new cO.ExtraButtonComponent(p).setIcon(Lt).setTooltip("Make recurring")};function f(){u[0]=Gt(this),t(2,u)}function d(){u[1]=Gt(this),t(2,u)}let h=()=>{Ce(o,n.date.month=u[0],n)};return r.$$set=p=>{"event"in p&&i(t(0,o=p.event)),"field"in p&&t(5,s=p.field),"items"in p&&t(1,l=p.items)},[o,l,u,n,c,s,f,d,h]}var Jp=class extends ae{constructor(e){super(),oe(this,e,S7,x7,re,{event:0,field:5,items:1},E7)}},em=Jp;function A7(r){we(r,"svelte-1hemaau",".calendarium-date-field-container.calendarium-date-field-container.svelte-1hemaau.svelte-1hemaau{display:grid;grid-template-columns:repeat(3, minmax(0, 1fr));align-items:flex-start;gap:0.5rem;border:0;max-width:100%}input[type='number'].svelte-1hemaau.svelte-1hemaau{width:100%}.calendarium-date-field.svelte-1hemaau.svelte-1hemaau{display:flex;flex-flow:column;gap:0.5rem;margin:0}.recurring.svelte-1hemaau.svelte-1hemaau{display:flex;align-items:center;gap:0.25rem}.ranged-event.svelte-1hemaau.svelte-1hemaau{display:flex;align-items:center;gap:0.5rem;color:var(--text-muted);font-style:italic}.calendarium-date-field.svelte-1hemaau input.svelte-1hemaau,.calendarium-date-field.svelte-1hemaau select.svelte-1hemaau{width:100%}.setting-item.svelte-1hemaau.svelte-1hemaau{border:0;padding-top:0}.warning.svelte-1hemaau.svelte-1hemaau{border-color:var(--text-error)}")}function fO(r,e,t){let n=r.slice();return n[42]=e[t],n[44]=t,n}function dO(r,e,t){let n=r.slice();return n[42]=e[t],n[44]=t,n}function hO(r,e,t){let n=r.slice();return n[46]=e[t],n[44]=t,n}function $7(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p,m,O,b,E,D,C,k,w,T,S;t=new lt({props:{$$slots:{control:[P7],name:[N7]},$$scope:{ctx:r}}});let M=[Q7,R7,M7],Z=[];function N(he,ue){return!he[12]||he[6]?0:he[8]?1:2}l=N(r,[-1,-1]),u=Z[l]=M[l](r);let L=[q7,Z7],j=[];function X(he,ue){return!he[13]||he[6]?0:1}p=X(r,[-1,-1]),m=j[p]=L[p](r);let fe=[B7,L7],ee=[];function te(he,ue){return!he[14]||he[6]?0:1}C=te(r,[-1,-1]),k=ee[C]=fe[C](r);let ge=!r[5]&&vO(r);return{c(){e=_("div"),z(t.$$.fragment),n=F(),a=_("div"),i=_("div"),o=_("span"),o.textContent="Year",s=F(),u.c(),c=F(),f=_("div"),d=_("span"),d.textContent="Month",h=F(),m.c(),O=F(),b=_("div"),E=_("span"),E.textContent="Day",D=F(),k.c(),w=F(),ge&&ge.c(),T=He(),g(e,"class","setting-item setting-item-heading svelte-1hemaau"),g(i,"class","calendarium-date-field svelte-1hemaau"),g(f,"class","calendarium-date-field svelte-1hemaau"),g(b,"class","calendarium-date-field svelte-1hemaau"),g(a,"class","setting-item calendarium-date-field-container svelte-1hemaau")},m(he,ue){$(he,e,ue),W(t,e,null),$(he,n,ue),$(he,a,ue),y(a,i),y(i,o),y(i,s),Z[l].m(i,null),y(a,c),y(a,f),y(f,d),y(f,h),j[p].m(f,null),y(a,O),y(a,b),y(b,E),y(b,D),ee[C].m(b,null),$(he,w,ue),ge&&ge.m(he,ue),$(he,T,ue),S=!0},p(he,ue){let xe={};ue[0]&3136|ue[1]&131072&&(xe.$$scope={dirty:ue,ctx:he}),t.$set(xe);let Pe=l;l=N(he,ue),l===Pe?Z[l].p(he,ue):(Oe(),R(Z[Pe],1,1,()=>{Z[Pe]=null}),_e(),u=Z[l],u?u.p(he,ue):(u=Z[l]=M[l](he),u.c()),P(u,1),u.m(i,null));let Ye=p;p=X(he,ue),p===Ye?j[p].p(he,ue):(Oe(),R(j[Ye],1,1,()=>{j[Ye]=null}),_e(),m=j[p],m?m.p(he,ue):(m=j[p]=L[p](he),m.c()),P(m,1),m.m(f,null));let it=C;C=te(he,ue),C===it?ee[C].p(he,ue):(Oe(),R(ee[it],1,1,()=>{ee[it]=null}),_e(),k=ee[C],k?k.p(he,ue):(k=ee[C]=fe[C](he),k.c()),P(k,1),k.m(b,null)),he[5]?ge&&(Oe(),R(ge,1,1,()=>{ge=null}),_e()):ge?(ge.p(he,ue),ue[0]&32&&P(ge,1)):(ge=vO(he),ge.c(),P(ge,1),ge.m(T.parentNode,T))},i(he){S||(P(t.$$.fragment,he),P(u),P(m),P(k),P(ge),S=!0)},o(he){R(t.$$.fragment,he),R(u),R(m),R(k),R(ge),S=!1},d(he){he&&(A(e),A(n),A(a),A(w),A(T)),Y(t),Z[l].d(),j[p].d(),ee[C].d(),ge&&ge.d(he)}}}function T7(r){let e,t,n;return t=new lt({props:{$$slots:{name:[j7]},$$scope:{ctx:r}}}),{c(){e=_("div"),z(t.$$.fragment),g(e,"class","setting-item svelte-1hemaau")},m(a,i){$(a,e,i),W(t,e,null),n=!0},p(a,i){let o={};i[0]&1040|i[1]&131072&&(o.$$scope={dirty:i,ctx:a}),t.$set(o)},i(a){n||(P(t.$$.fragment,a),n=!0)},o(a){R(t.$$.fragment,a),n=!1},d(a){a&&A(e),Y(t)}}}function N7(r){let e,t=r[6]?"Start":"Event",n,a;return{c(){e=_("div"),n=le(t),a=le(" date"),g(e,"slot","name")},m(i,o){$(i,e,o),y(e,n),y(e,a)},p(i,o){o[0]&64&&t!==(t=i[6]?"Start":"Event")&&ve(n,t)},d(i){i&&A(e)}}}function P7(r){let e,t,n,a;return{c(){e=_("div"),g(e,"slot","control")},m(i,o){$(i,e,o),n||(a=[me(t=r[23].call(null,e)),ce(e,"click",r[28])],n=!0)},p:I,d(i){i&&A(e),n=!1,Te(a)}}}function M7(r){let e,t;return e=new Kp({props:{event:r[0],field:"year",placeholder:"Year"}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a[0]&1&&(i.event=n[0]),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function R7(r){let e,t;return e=new em({props:{event:r[0],field:"year",items:(r[4].static.years??[]).map(_O)}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a[0]&1&&(i.event=n[0]),a[0]&16&&(i.items=(n[4].static.years??[]).map(_O)),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Q7(r){let e,t;function n(s,l){return s[8]?F7:I7}let a=n(r,[-1,-1]),i=a(r),o=!r[6]&&mO(r);return{c(){e=_("div"),i.c(),t=F(),o&&o.c(),g(e,"class","recurring svelte-1hemaau")},m(s,l){$(s,e,l),i.m(e,null),y(e,t),o&&o.m(e,null)},p(s,l){a===(a=n(s,l))&&i?i.p(s,l):(i.d(1),i=a(s),i&&(i.c(),i.m(e,t))),s[6]?o&&(o.d(1),o=null):o?o.p(s,l):(o=mO(s),o.c(),o.m(e,null))},i:I,o:I,d(s){s&&A(e),i.d(),o&&o.d()}}}function I7(r){let e,t,n;return{c(){e=_("input"),g(e,"type","number"),g(e,"spellcheck","false"),g(e,"placeholder","Year"),g(e,"class","svelte-1hemaau"),Ee(e,"warning",r[3].year==null)},m(a,i){$(a,e,i),Re(e,r[10].date.year),t||(n=ce(e,"input",r[30]),t=!0)},p(a,i){i[0]&1024&&Ct(e.value)!==a[10].date.year&&Re(e,a[10].date.year),i[0]&8&&Ee(e,"warning",a[3].year==null)},d(a){a&&A(e),t=!1,n()}}}function F7(r){let e,t,n,a=$e([...r[4].static.years??[]]),i=[];for(let o=0;or[29].call(e))},m(o,s){$(o,e,s);for(let l=0;lr[32].call(t)),g(e,"class","recurring svelte-1hemaau")},m(u,c){$(u,e,c),y(e,t);for(let f=0;f{o[c]=null}),_e(),t=o[e],t?t.p(l,u):(t=o[e]=i[e](l),t.c()),P(t,1),t.m(n.parentNode,n))},i(l){a||(P(t),a=!0)},o(l){R(t),a=!1},d(l){l&&A(n),o[e].d(l)}}}function U7(r){let e,t,n;return t=new lt({props:{$$slots:{name:[Y7]},$$scope:{ctx:r}}}),{c(){e=_("div"),z(t.$$.fragment),g(e,"class","setting-item svelte-1hemaau")},m(a,i){$(a,e,i),W(t,e,null),n=!0},p(a,i){let o={};i[0]&3200|i[1]&131072&&(o.$$scope={dirty:i,ctx:a}),t.$set(o)},i(a){n||(P(t.$$.fragment,a),n=!0)},o(a){R(t.$$.fragment,a),n=!1},d(a){a&&A(e),Y(t)}}}function W7(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p,m,O,b,E,D,C,k;t=new lt({props:{$$slots:{control:[V7],name:[z7]},$$scope:{ctx:r}}});let w=$e([...r[2]]),T=[];for(let S=0;Sr[38].call(h)),g(c,"class","calendarium-date-field svelte-1hemaau"),g(E,"type","number"),g(E,"spellcheck","false"),g(E,"placeholder","Day"),g(E,"class","svelte-1hemaau"),Ee(E,"warning",r[11].day==null),g(m,"class","calendarium-date-field svelte-1hemaau"),g(a,"class","setting-item calendarium-date-field-container svelte-1hemaau")},m(S,M){$(S,e,M),W(t,e,null),$(S,n,M),$(S,a,M),y(a,i),y(i,o),y(i,s),y(i,l),Re(l,r[11].year),y(a,u),y(a,c),y(c,f),y(c,d),y(c,h);for(let Z=0;Z{o[c]=null}),_e(),t=o[e],t?t.p(l,u):(t=o[e]=i[e](l),t.c()),P(t,1),t.m(n.parentNode,n))},i(l){a||(P(t),a=!0)},o(l){R(t),a=!1},d(l){l&&A(n),o[e].d(l)}}}var _O=r=>r.name??"";function G7(r,e,t){let n,a,i,o,s,l=I,u=()=>(l(),l=be(w,De=>t(10,s=De)),w),c,f=I,d=()=>(f(),f=be(T,De=>t(4,c=De)),T),h,p,m,O,b=I,E=()=>(b(),b=be(n,De=>t(26,O=De)),n),D,C,k;r.$$.on_destroy.push(()=>l()),r.$$.on_destroy.push(()=>f()),r.$$.on_destroy.push(()=>b());let{event:w}=e;u();let{store:T}=e;d();let S=de(w,De=>De.date);ie(r,S,De=>t(3,o=De));let M=Ze(s.type===U.Range?s.end:null);ie(r,M,De=>t(11,m=De)),M.subscribe(De=>{s.type===U.Range&&De!==null&&Ce(w,s.end=De,s)});let{yearCalculator:Z}=T,N=new Set,L=de(S,De=>Array.isArray(De.year));ie(r,L,De=>t(12,D=De));let j=de(S,De=>Array.isArray(De.month));ie(r,j,De=>t(13,C=De));let X=de(S,De=>Array.isArray(De.day));ie(r,X,De=>t(14,k=De));let fe=de([L,j,X],([De,rt,Mt])=>De||rt||Mt);ie(r,fe,De=>t(5,h=De)),fe.subscribe(De=>{De?(Ce(M,m=null,m),Ce(w,s.type=U.Recurring,s)):Ce(w,s.type=U.Date,s)});let ee=de(M,De=>De!=null);ie(r,ee,De=>t(6,p=De));let te=De=>{new Bc.ExtraButtonComponent(De).setIcon("repeat").setTooltip("Make recurring")},ge=De=>{new Bc.ExtraButtonComponent(De).setIcon(Lt).setTooltip("Make recurring")},he=De=>{new Bc.ExtraButtonComponent(De).setIcon("calendar-range")},ue=De=>{Ce(w,s.date[De]=[o[De],null],s)},xe=()=>{Ce(w,s.date={...c.current},s),Ce(w,s.type=U.Date,s)},Pe=()=>{Ce(w,s.date={year:null,month:null,day:null},s),m&&Ce(M,m=null,m),Ce(w,s.type=U.Undated,s)};function Ye(){s.date.year=Gt(this),w.set(s)}function it(){s.date.year=Ct(this.value),w.set(s)}let Be=()=>ue("year");function st(){s.date.month=Gt(this),w.set(s)}let ct=()=>ue("month");function ft(){s.date.day=Ct(this.value),w.set(s)}let It=()=>ue("day"),Yt=()=>{Ce(M,m=null,m),Ce(w,s.type=U.Date,s)};function zt(){m.year=Ct(this.value),M.set(m)}function V(){m.month=Gt(this),M.set(m)}function B(){m.day=Ct(this.value),M.set(m)}let pe=()=>{Ce(M,m={...i},m),Ce(w,s.type=U.Range,s)};return r.$$set=De=>{"event"in De&&u(t(0,w=De.event)),"store"in De&&d(t(1,T=De.store))},r.$$.update=()=>{if(r.$$.dirty[0]&2&&E(t(9,n=T.staticStore.staticConfiguration)),r.$$.dirty[0]&67108864&&t(8,a=O.useCustomYears),r.$$.dirty[0]&8&&t(7,i=o),r.$$.dirty[0]&104&&(p?Ce(w,s.type=U.Range,s):h?Ce(w,s.type=U.Recurring,s):o.year==null&&o.month==null&&o.day==null?Ce(w,s.type=U.Undated,s):Ce(w,s.type=U.Date,s)),r.$$.dirty[0]&28){let De=[o.year].flat();if(De.every(rt=>rt==null))t(2,N=new Set(c.static.months.map(rt=>rt.name)));else{t(2,N=new Set);for(let rt=0;rt/g,gs,nf,ys=class{constructor(e,t){Tt(this,gs);this.category=null;this.calendar=e,this.useFilenameForEvents=t,this.formatString=Ra,this.formatDigest=this.formatString.toUpperCase().replace(/[^\w]/g,"").replace(/Y+/g,"Y").replace(/M+/g,"M").replace(/D+/g,"D")}parseFrontmatterEvent(e,t,n){if(!e)return;let a="fc-date"in e?"fc-date":"fc-start",i=e[a]??(this.useFilenameForEvents?t.basename:null);if(!i)return;let o=this.parseEvent({dateString:i,eventName:e["fc-display-name"]??t.basename,eventDesc:e["fc-description"],eventImage:e["fc-img"],categoryString:e?.["fc-category"]??this.category?.id??null,endDateString:e["fc-end"]},t);o&&n(o)}parseInlineEvents(e,t,n,a){let i=new u_.DOMParser;for(let o of e.matchAll(C$)){let s=i.parseFromString(o[0],"text/html"),l={dataset:{date:s.documentElement.getAttribute("data-date"),end:s.documentElement.getAttribute("data-end"),title:s.documentElement.getAttribute("data-name"),class:s.documentElement.getAttribute("data-category"),img:s.documentElement.getAttribute("data-img"),calendar:s.documentElement.getAttribute("data-calendar")},content:s.documentElement.textContent};if(l.dataset.date)if(l.dataset.calendar&&l.dataset.calendar!=this.calendar.name)a(l.dataset.calendar,l);else{let u=this.parseEvent({dateString:l.dataset.date,eventName:l.dataset.title,eventDesc:l.content,eventImage:l.dataset.img,endDateString:l.dataset.end,categoryString:l.dataset.class},t);u&&n(u)}}}resolveDates(e,t){let n;return Array.isArray(e.day)||Array.isArray(e.month)||Array.isArray(e.year)?n={type:U.Recurring,date:e}:e.year===null||e.month===null||e.day===null?(e.year===null&&(e.year=[null,null]),e.month===null&&(e.month=[null,null]),e.day===null&&(e.day=[null,null]),n={type:U.Recurring,date:e}):t?(Array.isArray(t.day)||Array.isArray(t.month)||Array.isArray(t.year),n={type:U.Range,date:e,end:t}):n={type:U.Date,date:e},n}parseEvent({dateString:e,eventName:t,eventDesc:n,eventImage:a,endDateString:i,categoryString:o},s){if(!e)return null;let l=this.parseDate(e,s);if(!l)return null;let u;o&&(u=this.calendar.categories.find(h=>h?.name==o||h?.id==o),u||(u={id:Le(6),color:(0,c_.default)(),name:o},this.onNewCategory?.(u),this.calendar.categories.push(u)));let c=i?this.parseDate(i,s):null,f=this.resolveDates(l,c);return{id:Le(6),name:t??s.basename,description:n,sort:this.parsedToTimestamp(l),note:s.path,category:(u??this.category)?.id??null,img:a,...f}}parseFileForDates(e,t){if(!e)return null;let n="fc-date"in e?"fc-date":"fc-start",a=e[n]??(this.useFilenameForEvents?t.basename:null);if(!a)return null;let i=this.parseCalDateString(a,t);if(!i)return null;let o=e["fc-end"]?this.parseDate(e["fc-end"],t):null;return this.resolveDates(i,o)}parseFilenameDate(e){return this.parseDate(e.basename,e)}parseDate(e,t){return typeof e=="string"?this.parseCalDateString(e,t):this.dateFromSegments({year:e.year||"*",month:e.month||"*",day:e.day||"*",order:e.order},t)}parseCalDateString(e,t){let n=e.split(/(?!^)[-–—](?![^[]*])/);return this.formatDigest!="YMD"&&n.length<3?(zl(`Must specify all three segments in ${this.formatString} order`,null,t,e),null):this.dateFromSegments({year:n[this.formatDigest.indexOf("Y")]||null,month:n[this.formatDigest.indexOf("M")]||null,day:n[this.formatDigest.indexOf("D")]||null,order:n[3]?n[3]:""},t,e)}resolveMonth(e,t){if(e===null)return 0;if(typeof e=="number"&&!Number.isNaN(e))return sn(e-1,this.calendar.static.months.length);if(Number.isNaN(e)){let n=this.calendar.static.months.find(a=>a.name?.startsWith(t)||a.short?.startsWith(t));if(n)return this.calendar.static.months.indexOf(n);{let a=this.calendar.static.leapDays.find(i=>i.name&&i.name.startsWith(t));if(a)return a.timespan}}return 0}resolveDay(e,t,n,a){if(typeof e=="number"&&e<1)return(0,Ua.Ok)(1);if(typeof e=="number"){for(let o of[t].flat())if(o)for(let s of[n].flat()){let l=this.daysForMonth(o,s);if(e>l)return(0,Ua.Err)(`Day '${a.day}' is incorrect for month '${a.month}', which has ${l} day(s)`)}return(0,Ua.Ok)(e)}let i=this.calendar.static.leapDays.find(o=>o.name&&o.name.startsWith(a.month));if(i){for(let o of[t].flat())if(o)for(let s of[n].flat()){if(e=this.findLeapDay(i,o,s),e==null)return(0,Ua.Err)(`Leap day '${a.day}' isn't valid for year '${a.year}'`);if(a.year!=="*")return(0,Ua.Ok)(e)}}return e==null?(0,Ua.Ok)(1):(0,Ua.Ok)(e)}dateFromSegments(e,t,n){let a=af(e.year),i=af(e.month),o=af(e.day);if(e.year==="*")a=[null,null];else if(!e.year||[a].flat().some(s=>Number.isNaN(s)))return zl(`Must specify a valid year: ${a}`,e,t,n),null;if(e.month==="*"?i=[null,null]:Array.isArray(i)?i=i.map(s=>this.resolveMonth(s,e.month)):i=this.resolveMonth(i,e.month),e.day==="*")o=[null,null];else if(Array.isArray(o)){let s=o.map(u=>this.resolveDay(u,i,a,e)),l=[];for(let u of s){if(u.isErr())return zl(u.unwrapErr(),e,t,n),null;l.push(u.unwrap())}o=[...l]}else{let s=this.resolveDay(o,i,a,e);if(s.isErr())return zl(s.unwrapErr(),e,t,n),null;o=s.unwrap()}return{year:a,month:i,day:o,order:e.order||""}}generateTimeStamp(e){let t=Array.isArray(e.year)?[e.year].flat().map(i=>`${i??"*"}`):[`${e.year??"*"}`],n=[e.month].flat().map(i=>Li(i,this.calendar,"month")),a=[e.day].flat().map(i=>Li(i,this.calendar,"day"));return`${qo(this,gs,nf).call(this,t)}-${qo(this,gs,nf).call(this,n)}-${qo(this,gs,nf).call(this,a)}`}parsedToTimestamp(e){if([e.year].flat().every(n=>n==null)||[e.month].flat().every(n=>n==null)||[e.day].flat().every(n=>n==null))return{timestamp:Number.MIN_VALUE,order:e.order?e.order:this.generateTimeStamp(e)};let t;return Array.isArray(e.year)?t=e.year[0]??Number.MIN_VALUE:t=e.year??Number.MIN_VALUE,{timestamp:+`${t}${Li([e.month].flat()[0],this.calendar,"month")}${Li([e.day].flat()[0],this.calendar,"day")}`,order:e.order||""}}timestampForCalEvent(e,t){return!t&&e.sort?e.sort:this.parsedToTimestamp({...e.date,order:t?.order||""})}findLeapDay(e,t,n){let a=this.calendar.static.months[t],i=this.calendar.static.leapDays.filter(s=>s.timespan==t&&!s.intercalary||s.intercalary&&s.numbered);return n&&!lc(e,n)?null:a.length+i.indexOf(e)+1}daysForMonth(e,t){let n=this.calendar.static.months[e],a=this.calendar.static.leapDays.filter(i=>i.timespan==e&&!i.intercalary||i.intercalary&&i.numbered);if(t){let i=a.filter(o=>lc(o,t)).length;return n.length+i}return n.length+a.length}};gs=new WeakSet,nf=function(e){return(e.length>1?"[":"")+e.join("-")+(e.length>1?"]":"")};function af(r){if(r==null||r==="*")return null;if(typeof r=="number")return r;if(typeof r=="string"&&/\[.+?\]/.test(r)){let e=r.slice(1,-1).split("-").map(t=>af(t)).sort((t,n)=>typeof t=="number"&&typeof n=="number"?t-n:0);return e.length===1?e[0]:e.length>2?[e[0],e.pop()]:e}return parseInt(r)}function k$(r){we(r,"svelte-pzftle",".setting-item.svelte-pzftle{border:0}.desc.svelte-pzftle{resize:vertical;width:100%}.warning.svelte-pzftle{border-color:var(--text-error)}")}function f_(r,e,t){let n=r.slice();return n[11]=e[t],n}function E$(r){let e;return{c(){e=_("div"),e.textContent="Event name",g(e,"slot","name")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function x$(r){let e,t,n;return{c(){e=_("input"),g(e,"type","text"),g(e,"slot","control"),g(e,"class","svelte-pzftle"),Ee(e,"warning",!r[3].name||r[3].name?.length==0)},m(a,i){$(a,e,i),Re(e,r[3].name),t||(n=ce(e,"input",r[6]),t=!0)},p(a,i){i&12&&e.value!==a[3].name&&Re(e,a[3].name),i&8&&Ee(e,"warning",!a[3].name||a[3].name?.length==0)},d(a){a&&A(e),t=!1,n()}}}function S$(r){let e;return{c(){e=_("div"),e.textContent="Note",g(e,"slot","name")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function A$(r){let e;return{c(){e=_("div"),e.textContent="Link the event to a note",g(e,"slot","desc")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function $$(r){let e,t,n,a;return{c(){e=_("div"),g(e,"slot","control")},m(i,o){$(i,e,o),n||(a=me(t=r[4].call(null,e)),n=!0)},p:I,d(i){i&&A(e),n=!1,a()}}}function T$(r){let e;return{c(){e=_("div"),e.textContent="Event description",g(e,"slot","name")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function d_(r){let e,t,n;return t=new lt({props:{$$slots:{control:[P$],name:[N$]},$$scope:{ctx:r}}}),{c(){e=_("div"),z(t.$$.fragment),g(e,"class","setting-item svelte-pzftle")},m(a,i){$(a,e,i),W(t,e,null),n=!0},p(a,i){let o={};i&16396&&(o.$$scope={dirty:i,ctx:a}),t.$set(o)},i(a){n||(P(t.$$.fragment,a),n=!0)},o(a){R(t.$$.fragment,a),n=!1},d(a){a&&A(e),Y(t)}}}function N$(r){let e;return{c(){e=_("div"),e.textContent="Event category",g(e,"slot","name")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function h_(r){let e,t=r[11].name+"",n,a,i;return{c(){e=_("option"),n=le(t),e.__value=a=r[11].id,Re(e,e.__value),e.selected=i=(r[3].category??r[2].categories[0].id)===r[11].id},m(o,s){$(o,e,s),y(e,n)},p(o,s){s&4&&t!==(t=o[11].name+"")&&ve(n,t),s&4&&a!==(a=o[11].id)&&(e.__value=a,Re(e,e.__value)),s&12&&i!==(i=(o[3].category??o[2].categories[0].id)===o[11].id)&&(e.selected=i)},d(o){o&&A(e)}}}function P$(r){let e,t,n,a=$e(r[2].categories),i=[];for(let o=0;or[8].call(e))},m(o,s){$(o,e,s);for(let l=0;l{O=null}),_e())},i(b){h||(P(t.$$.fragment,b),P(i.$$.fragment,b),P(l.$$.fragment,b),P(O),h=!0)},o(b){R(t.$$.fragment,b),R(i.$$.fragment,b),R(l.$$.fragment,b),R(O),h=!1},d(b){b&&(A(e),A(n),A(a),A(o),A(s),A(u),A(c),A(f),A(d)),Y(t),Y(i),Y(l),O&&O.d(b),p=!1,m()}}}function R$(r,e,t){let n,a=I,i=()=>(a(),a=be(f,E=>t(2,n=E)),f),o,s=I,l=()=>(s(),s=be(u,E=>t(3,o=E)),u);r.$$.on_destroy.push(()=>a()),r.$$.on_destroy.push(()=>s());let{event:u}=e;l();let{plugin:c}=e,{store:f}=e;i();let d=new ys(n,Xe.getData().parseDates),h=E=>{let D=new of.TextComponent(E).setValue(o.note??""),C=c.app.vault.getFiles();if(D.setPlaceholder("Path"),o.note){let[w,T]=o.note.split(/[#^]/),S=c.app.metadataCache.getFirstLinkpathDest(w,"");S&&S instanceof of.TFile&&D.setValue(`${S.basename}${T?"#":""}${T||""}`)}new p_.FileInputSuggest(c.app,D,[...C]).onSelect(async w=>{w.item&&(Ce(u,o.note=w.item.path,o),D.setValue(w.item.basename),p(w.item))})},p=async E=>{Ce(u,o.name=E.basename,o);let D=c.app.metadataCache.getFileCache(E),{frontmatter:C}=D??{};if(C){"fc-display-name"in C&&Ce(u,o.name=C["fc-display-name"],o);let k=d.parseFileForDates(C,{path:E.path,basename:E.basename});k&&(Ce(u,o.type=k.type,o),Ce(u,o.date={...k.date},o),"end"in k&&o.type===U.Range&&Ce(u,o.end={...k.end},o)),"fc-category"in C&&(n.categories.find(w=>w.name===C["fc-category"])||n.categories.push({name:C["fc-category"],color:"#808080",id:Le(6)}),Ce(u,o.category=n.categories.find(w=>w.name===C["fc-category"])?.id??null,o))}};function m(){o.name=this.value,u.set(o)}function O(){o.description=this.value,u.set(o)}function b(){o.category=Gt(this),u.set(o)}return r.$$set=E=>{"event"in E&&l(t(0,u=E.event)),"plugin"in E&&t(5,c=E.plugin),"store"in E&&i(t(1,f=E.store))},[u,f,n,o,h,c,m,O,b]}var mm=class extends ae{constructor(e){super(),oe(this,e,R$,M$,re,{event:0,plugin:5,store:1},k$)}},m_=mm;var g_=require("obsidian");function Q$(r){let e,t,n,a,i;return{c(){e=_("div"),t=_("div"),g(e,"slot","control")},m(o,s){$(o,e,s),y(e,t),a||(i=me(n=r[3].call(null,t)),a=!0)},p:I,d(o){o&&A(e),a=!1,i()}}}function I$(r){let e,t,n,a,i,o,s;return e=new m_({props:{event:r[2],plugin:r[1],store:r[0]}}),n=new wO({props:{event:r[2],store:r[0]}}),o=new lt({props:{$$slots:{control:[Q$]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment),t=F(),z(n.$$.fragment),a=F(),i=_("div"),z(o.$$.fragment),g(i,"class","setting-item")},m(l,u){W(e,l,u),$(l,t,u),W(n,l,u),$(l,a,u),$(l,i,u),W(o,i,null),s=!0},p(l,[u]){let c={};u&2&&(c.plugin=l[1]),u&1&&(c.store=l[0]),e.$set(c);let f={};u&1&&(f.store=l[0]),n.$set(f);let d={};u&64&&(d.$$scope={dirty:u,ctx:l}),o.$set(d)},i(l){s||(P(e.$$.fragment,l),P(n.$$.fragment,l),P(o.$$.fragment,l),s=!0)},o(l){R(e.$$.fragment,l),R(n.$$.fragment,l),R(o.$$.fragment,l),s=!1},d(l){l&&(A(t),A(a),A(i)),Y(e,l),Y(n,l),Y(o)}}}function F$(r,e,t){let{event:n}=e,{store:a}=e,{plugin:i}=e,o=Ze(n);o.subscribe(u=>t(4,n={...u}));let s=Qt(),l=u=>{new g_.ButtonComponent(u).setButtonText("Cancel").onClick(()=>s("cancel"))};return r.$$set=u=>{"event"in u&&t(4,n=u.event),"store"in u&&t(0,a=u.store),"plugin"in u&&t(1,i=u.plugin)},[a,i,o,l,n]}var gm=class extends ae{constructor(e){super(),oe(this,e,F$,I$,re,{event:4,store:0,plugin:1})}},y_=gm;var Vl=class extends ir{constructor(t,n,a,i){super(n.app);this.calendar=t;this.plugin=n;this.saved=!0;this.event={name:"",description:null,date:{month:this.calendar.current.month,day:this.calendar.current.day,year:this.calendar.current.year},id:Le(6),note:null,category:null,sort:{timestamp:Number.MIN_VALUE,order:""},type:U.Date};a&&(this.event=at(a),this.editing=!0),i&&(this.event.date=at(i)),this.containerEl.addClass("calendarium-create-event"),n.register(()=>this.close())}async display(){this.contentEl.empty(),this.titleEl.setText(this.editing?"Edit event":"New event"),this.$UI=new y_({target:this.contentEl,props:{event:this.event,store:this.plugin.getStoreByCalendar(this.calendar),plugin:this.plugin}}),this.$UI.$on("cancel",()=>{this.saved=!1,this.close()})}async onOpen(){await this.display()}onClose(){this.$UI?.$destroy()}async checkCanExit(){return this.isValidEvent()||Xe.getData().exit.savingEvent?!0:new Promise(t=>{let n=new Cl(this.plugin.app,"This event requires additional information to save. Exiting now will discard changes.",{cta:"Exit",secondary:"Cancel",dontAsk:"Exit and don't ask again"});n.onClose=async()=>{n.dontAsk&&(Xe.getData().exit.savingEvent=!0,await Xe.save()),t(n.confirmed)},n.open()})}isValidEvent(){return!(!this.event.name||this.event.type!=U.Undated&&(this.event.date.year==null||this.event.date.month==null||this.event.date.day==null)||this.event.type===U.Range&&(this.event.end==null||this.event.end.year==null||this.event.end.month==null||this.event.end.day==null))}async close(){await this.checkCanExit()&&(this.saved=this.isValidEvent(),super.close())}};async function sf(r,e,t,n){let a=new Vl(e,r,n,t);a.onClose=async()=>{if(!a.saved)return;let i=r.getStoreByCalendar(e);if(i){if(n){let o=e.events.findIndex(s=>s.id===a.event.id);e.events.splice(o,1,a.event)}else e.events.push(a.event);i.eventStore.insertEvents(a.event),await Xe.save({calendar:!0})}},a.open()}function Z$(r){we(r,"svelte-167jho9",".filters-container.svelte-167jho9{width:100%;display:flex;justify-content:space-between;align-items:center;gap:0.5rem}.existing-items.svelte-167jho9{flex-flow:column;gap:1rem}.context.svelte-167jho9{display:flex;align-items:center;gap:0.5rem}")}function b_(r,e,t){let n=r.slice();return n[24]=e[t],n}function v_(r){let e,t,n,a;return t=new gr({props:{message:"Create a new event to see it here."}}),{c(){e=_("div"),z(t.$$.fragment),n=F(),g(e,"class","setting-item")},m(i,o){$(i,e,o),W(t,e,null),y(e,n),a=!0},p:I,i(i){a||(P(t.$$.fragment,i),a=!0)},o(i){R(t.$$.fragment,i),a=!1},d(i){i&&A(e),Y(t)}}}function O_(r,e){let t,n,a;function i(){return e[18](e[24])}function o(){return e[19](e[24])}return n=new Gv({props:{event:e[24],file:e[6].contains(e[24]),category:e[14](e[24].category),date:hp(e[24],e[0]),nameFilter:e[5]}}),n.$on("edit",i),n.$on("delete",o),{key:r,first:null,c(){t=He(),z(n.$$.fragment),this.first=t},m(s,l){$(s,t,l),W(n,s,l),a=!0},p(s,l){e=s;let u={};l&8&&(u.event=e[24]),l&8&&(u.file=e[6].contains(e[24])),l&8&&(u.category=e[14](e[24].category)),l&9&&(u.date=hp(e[24],e[0])),n.$set(u)},i(s){a||(P(n.$$.fragment,s),a=!0)},o(s){R(n.$$.fragment,s),a=!1},d(s){s&&A(t),Y(n,s)}}}function q$(r){let e,t=[],n=new Map,a,i,o,s,l=$e(r[3]),u=f=>f[24].id;for(let f=0;f{c=null}),_e()):(c=v_(f),c.c(),P(c,1),c.m(e,null)))},i(f){if(!s){for(let d=0;dt(0,n=N));let l=Ve("plugin"),u=Ve("original"),{eventStore:c}=s,f=Ze(""),h=l.getStore(u??"")?.eventStore.getFileEvents()??[],p=de(c,N=>ii([...h,...N]));ie(r,p,N=>t(2,i=N));let m=Ze(50),O=Ze(1),b=de([p,f],([N,L])=>{let j=[];for(let X of N){let fe=!0;if(L.length){if(!X.name)continue;(0,ji.prepareSimpleSearch)(L)(X.name)?fe=!0:fe=!1,X.description?.length&&((0,ji.prepareSimpleSearch)(L)(X.description)?fe=!0:fe=!1)}fe&&j.push(X)}return j});ie(r,b,N=>t(1,a=N));let E=de([m,b],([N,L])=>Math.ceil(L.length/N)),D=de([b,m,O],([N,L,j])=>N.slice((j-1)*L,j*L));ie(r,D,N=>t(3,o=N));let C=N=>{c.delete(N.id)},k=N=>n.categories.find(({id:L})=>L==N),w=N=>{let L=new Vl(n,l,N);L.onClose=()=>{L.saved&&(L.editing&&N?c.update(N.id,{...L.event}):c.add({...L.event}))},L.open()};return[n,a,i,o,s,f,h,p,m,O,b,E,D,C,k,w,N=>{new ji.ExtraButtonComponent(N).setIcon(rs).extraSettingsEl.onClickEvent(L=>L.preventDefault())},()=>w(),N=>w(N),N=>C(N)]}var ym=class extends ae{constructor(e){super(),oe(this,e,U$,B$,re,{},Z$)}},__=ym;function W$(r){let e,t,n,a;return e=new Vv({}),n=new __({}),{c(){z(e.$$.fragment),t=F(),z(n.$$.fragment)},m(i,o){W(e,i,o),$(i,t,o),W(n,i,o),a=!0},p:I,i(i){a||(P(e.$$.fragment,i),P(n.$$.fragment,i),a=!0)},o(i){R(e.$$.fragment,i),R(n.$$.fragment,i),a=!1},d(i){i&&A(t),Y(e,i),Y(n,i)}}}var bm=class extends ae{constructor(e){super(),oe(this,e,null,W$,re,{})}},bs=bm;function Y$(r){we(r,"svelte-1c6hvr3",".info.svelte-1c6hvr3{display:flex;justify-content:space-between;margin-right:0}.text-area-component.svelte-1c6hvr3{display:flex;flex-flow:column nowrap;align-items:flex-start;gap:0.5rem;width:100%}textarea.svelte-1c6hvr3{width:100%}")}var z$=r=>({}),w_=r=>({});function V$(r){let e,t,n,a,i,o,s,l,u,c,f=r[6].control,d=Xr(f,r,r[5],w_);return{c(){e=_("div"),t=_("div"),n=_("label"),a=le(r[1]),i=F(),d&&d.c(),o=F(),s=_("textarea"),g(t,"class","info svelte-1c6hvr3"),g(s,"spellcheck","false"),g(s,"placeholder",r[2]),g(s,"class","svelte-1c6hvr3"),g(e,"class","text-area-component setting-item svelte-1c6hvr3"),Ee(e,"cls",r[3])},m(h,p){$(h,e,p),y(e,t),y(t,n),y(n,a),y(t,i),d&&d.m(t,null),y(e,o),y(e,s),Re(s,r[0]),l=!0,u||(c=[ce(s,"input",r[7]),ce(s,"blur",r[8])],u=!0)},p(h,[p]){(!l||p&2)&&ve(a,h[1]),d&&d.p&&(!l||p&32)&&Hr(d,f,h,h[5],l?Gr(f,h[5],p,z$):Kr(h[5]),w_),(!l||p&4)&&g(s,"placeholder",h[2]),p&1&&Re(s,h[0]),(!l||p&8)&&Ee(e,"cls",h[3])},i(h){l||(P(d,h),l=!0)},o(h){R(d,h),l=!1},d(h){h&&A(e),d&&d.d(h),u=!1,Te(c)}}}function j$(r,e,t){let{$$slots:n={},$$scope:a}=e,i=Qt(),{value:o}=e,{name:s}=e,{placeholder:l=s}=e,{cls:u=""}=e;function c(){o=this.value,t(0,o)}let f=()=>i("blur",o);return r.$$set=d=>{"value"in d&&t(0,o=d.value),"name"in d&&t(1,s=d.name),"placeholder"in d&&t(2,l=d.placeholder),"cls"in d&&t(3,u=d.cls),"$$scope"in d&&t(5,a=d.$$scope)},[o,s,l,u,i,a,n,c,f]}var vm=class extends ae{constructor(e){super(),oe(this,e,j$,V$,re,{value:0,name:1,placeholder:2,cls:3},Y$)}},lf=vm;function X$(r){we(r,"svelte-9iftg2","input.warn.svelte-9iftg2{border-color:var(--text-error)}")}var G$=r=>({}),D_=r=>({});function C_(r){let e;function t(i,o){return typeof i[4]=="string"?K$:H$}let n=t(r,-1),a=n(r);return{c(){a.c(),e=He()},m(i,o){a.m(i,o),$(i,e,o)},p(i,o){n===(n=t(i,o))&&a?a.p(i,o):(a.d(1),a=n(i),a&&(a.c(),a.m(e.parentNode,e)))},d(i){i&&A(e),a.d(i)}}}function H$(r){let e,t,n,a;return{c(){e=_("div"),g(e,"class","setting-item-description")},m(i,o){$(i,e,o),n||(a=me(t=r[7].call(null,e)),n=!0)},p:I,d(i){i&&A(e),n=!1,a()}}}function K$(r){let e,t;return{c(){e=_("div"),t=le(r[4]),g(e,"class","setting-item-description")},m(n,a){$(n,e,a),y(e,t)},p(n,a){a&16&&ve(t,n[4])},d(n){n&&A(e)}}}function J$(r){let e,t,n;return{c(){e=_("input"),g(e,"type","number"),g(e,"spellcheck","false"),g(e,"placeholder",r[5]),g(e,"class","svelte-9iftg2"),Ee(e,"warn",r[2])},m(a,i){$(a,e,i),Re(e,r[0]),t||(n=[ce(e,"input",r[13]),ce(e,"input",r[14]),ce(e,"blur",r[15])],t=!0)},p(a,i){i&32&&g(e,"placeholder",a[5]),i&1&&Ct(e.value)!==a[0]&&Re(e,a[0]),i&4&&Ee(e,"warn",a[2])},d(a){a&&A(e),t=!1,Te(n)}}}function eT(r){let e,t,n;return{c(){e=_("input"),g(e,"type","text"),g(e,"spellcheck","false"),g(e,"placeholder",r[5]),g(e,"class","svelte-9iftg2"),Ee(e,"warn",r[2])},m(a,i){$(a,e,i),Re(e,r[0]),t||(n=[ce(e,"input",r[10]),ce(e,"input",r[11]),ce(e,"blur",r[12])],t=!0)},p(a,i){i&32&&g(e,"placeholder",a[5]),i&1&&e.value!==a[0]&&Re(e,a[0]),i&4&&Ee(e,"warn",a[2])},d(a){a&&A(e),t=!1,Te(n)}}}function tT(r){let e;function t(i,o){if(i[3]=="text")return eT;if(i[3]=="number")return J$}let n=t(r,-1),a=n&&n(r);return{c(){a&&a.c(),e=He()},m(i,o){a&&a.m(i,o),$(i,e,o)},p(i,o){n===(n=t(i,o))&&a?a.p(i,o):(a&&a.d(1),a=n&&n(i),a&&(a.c(),a.m(e.parentNode,e)))},d(i){i&&A(e),a&&a.d(i)}}}function rT(r){let e,t,n,a,i,o,s,l,u,c,f=r[4]&&C_(r),d=r[9].default,h=Xr(d,r,r[8],null),p=h||tT(r),m=r[9].additional,O=Xr(m,r,r[8],D_);return{c(){e=_("div"),t=_("div"),n=_("div"),a=le(r[1]),i=F(),f&&f.c(),o=F(),s=_("div"),l=_("div"),p&&p.c(),u=F(),O&&O.c(),g(n,"class","setting-item-name"),g(t,"class","setting-item-info"),g(l,"class","warning-container"),g(s,"class","setting-item-control"),g(e,"class","setting-item")},m(b,E){$(b,e,E),y(e,t),y(t,n),y(n,a),y(t,i),f&&f.m(t,null),y(e,o),y(e,s),y(s,l),p&&p.m(l,null),y(l,u),O&&O.m(l,null),c=!0},p(b,[E]){(!c||E&2)&&ve(a,b[1]),b[4]?f?f.p(b,E):(f=C_(b),f.c(),f.m(t,null)):f&&(f.d(1),f=null),h?h.p&&(!c||E&256)&&Hr(h,d,b,b[8],c?Gr(d,b[8],E,null):Kr(b[8]),null):p&&p.p&&(!c||E&45)&&p.p(b,c?E:-1),O&&O.p&&(!c||E&256)&&Hr(O,m,b,b[8],c?Gr(m,b[8],E,G$):Kr(b[8]),D_)},i(b){c||(P(p,b),P(O,b),c=!0)},o(b){R(p,b),R(O,b),c=!1},d(b){b&&A(e),f&&f.d(),p&&p.d(b),O&&O.d(b)}}}function nT(r,e,t){let{$$slots:n={},$$scope:a}=e,{value:i}=e,{name:o}=e,{warn:s=!1}=e,{type:l="text"}=e,{desc:u=null}=e,{placeholder:c=o}=e,f=Qt(),d=D=>{D.append(u.cloneNode(!0))};function h(){i=this.value,t(0,i)}let p=()=>f("change",i),m=()=>{f("blur",i)};function O(){i=Ct(this.value),t(0,i)}let b=()=>f("change",i),E=()=>{f("blur",i)};return r.$$set=D=>{"value"in D&&t(0,i=D.value),"name"in D&&t(1,o=D.name),"warn"in D&&t(2,s=D.warn),"type"in D&&t(3,l=D.type),"desc"in D&&t(4,u=D.desc),"placeholder"in D&&t(5,c=D.placeholder),"$$scope"in D&&t(8,a=D.$$scope)},[i,o,s,l,u,c,f,d,a,n,h,p,m,O,b,E]}var Om=class extends ae{constructor(e){super(),oe(this,e,nT,rT,re,{value:0,name:1,warn:2,type:3,desc:4,placeholder:5},X$)}},ln=Om;function k_(r){let e;function t(i,o){return typeof i[1]=="string"?iT:aT}let n=t(r,-1),a=n(r);return{c(){a.c(),e=He()},m(i,o){a.m(i,o),$(i,e,o)},p(i,o){n===(n=t(i,o))&&a?a.p(i,o):(a.d(1),a=n(i),a&&(a.c(),a.m(e.parentNode,e)))},d(i){i&&A(e),a.d(i)}}}function aT(r){let e,t,n,a;return{c(){e=_("div"),g(e,"class","setting-item-description")},m(i,o){$(i,e,o),n||(a=me(t=r[4].call(null,e)),n=!0)},p:I,d(i){i&&A(e),n=!1,a()}}}function iT(r){let e,t;return{c(){e=_("div"),t=le(r[1]),g(e,"class","setting-item-description")},m(n,a){$(n,e,a),y(e,t)},p(n,a){a&2&&ve(t,n[1])},d(n){n&&A(e)}}}function oT(r){let e,t,n,a,i,o,s,l,u,c,f=r[1]&&k_(r);return{c(){e=_("div"),t=_("div"),n=_("div"),a=le(r[0]),i=F(),f&&f.c(),o=F(),s=_("div"),l=_("div"),g(n,"class","setting-item-name"),g(t,"class","setting-item-info"),g(l,"class","checkbox-container"),Ee(l,"is-disabled",r[3]),Ee(l,"is-enabled",r[2]),g(s,"class","setting-item-control"),g(e,"class","setting-item mod-toggle")},m(d,h){$(d,e,h),y(e,t),y(t,n),y(n,a),y(t,i),f&&f.m(t,null),y(e,o),y(e,s),y(s,l),u||(c=ce(l,"click",r[6]),u=!0)},p(d,[h]){h&1&&ve(a,d[0]),d[1]?f?f.p(d,h):(f=k_(d),f.c(),f.m(t,null)):f&&(f.d(1),f=null),h&8&&Ee(l,"is-disabled",d[3]),h&4&&Ee(l,"is-enabled",d[2])},i:I,o:I,d(d){d&&A(e),f&&f.d(),u=!1,c()}}}function sT(r,e,t){let{name:n}=e,{desc:a=""}=e,{value:i}=e,{disabled:o=!1}=e,s=c=>{c.append(a)},l=Qt(),u=c=>{o||l("click",c)};return r.$$set=c=>{"name"in c&&t(0,n=c.name),"desc"in c&&t(1,a=c.desc),"value"in c&&t(2,i=c.value),"disabled"in c&&t(3,o=c.disabled)},[n,a,i,o,s,l,u]}var _m=class extends ae{constructor(e){super(),oe(this,e,sT,oT,re,{name:0,desc:1,value:2,disabled:3})}},er=_m;function lT(r){we(r,"svelte-1tpb1e4",".calendarium-info.svelte-1tpb1e4 .calendarium-description{display:flex;flex-flow:column;align-items:flex-start}.calendarium-info.svelte-1tpb1e4 .calendarium-description textarea{width:100%}")}function E_(r){let e,t;return e=new ln({props:{name:"Name",warn:!r[1],desc:r[1]?"":"The calendar must have a name",value:r[0].name}}),e.$on("blur",r[5]),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a&2&&(i.warn=!n[1]),a&2&&(i.desc=n[1]?"":"The calendar must have a name"),a&1&&(i.value=n[0].name),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function uT(r){let e,t=r[0].name,n,a,i,o,s,l,u,c,f,d,h,p=E_(r);return a=new lf({props:{name:"Description",value:r[0].description??""}}),a.$on("blur",r[6]),o=new er({props:{name:"Display day number",desc:"Display day of year in Day View",value:r[2]}}),o.$on("click",r[7]),l=new ln({props:{name:"Display date format",desc:r[4](),value:r[0].dateFormat??Ra}}),l.$on("blur",r[8]),c=new er({props:{name:"Support inline events",desc:"",value:r[0].supportInlineEvents??!1}}),c.$on("click",r[9]),d=new ln({props:{name:"Tag for inline events",desc:"Only notes with this tag will be scanned for inline events",value:r[0].inlineEventTag??""}}),d.$on("blur",r[10]),{c(){e=_("div"),p.c(),n=F(),z(a.$$.fragment),i=F(),z(o.$$.fragment),s=F(),z(l.$$.fragment),u=F(),z(c.$$.fragment),f=F(),z(d.$$.fragment),g(e,"class","calendarium-info svelte-1tpb1e4")},m(m,O){$(m,e,O),p.m(e,null),y(e,n),W(a,e,null),y(e,i),W(o,e,null),y(e,s),W(l,e,null),y(e,u),W(c,e,null),y(e,f),W(d,e,null),h=!0},p(m,O){O&1&&re(t,t=m[0].name)?(Oe(),R(p,1,1,I),_e(),p=E_(m),p.c(),P(p,1),p.m(e,n)):p.p(m,O);let b={};O&1&&(b.value=m[0].description??""),a.$set(b);let E={};O&4&&(E.value=m[2]),o.$set(E);let D={};O&1&&(D.value=m[0].dateFormat??Ra),l.$set(D);let C={};O&1&&(C.value=m[0].supportInlineEvents??!1),c.$set(C);let k={};O&1&&(k.value=m[0].inlineEventTag??""),d.$set(k)},i(m){h||(P(p),P(a.$$.fragment,m),P(o.$$.fragment,m),P(l.$$.fragment,m),P(c.$$.fragment,m),P(d.$$.fragment,m),h=!0)},o(m){R(p),R(a.$$.fragment,m),R(o.$$.fragment,m),R(l.$$.fragment,m),R(c.$$.fragment,m),R(d.$$.fragment,m),h=!1},d(m){m&&A(e),p.d(m),Y(a),Y(o),Y(l),Y(c),Y(d)}}}function cT(r){let e,t;return e=new xt({props:{name:"Basic info",warn:!r[1],label:"The calendar must have a name",alwaysOpen:!0,$$slots:{default:[uT]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&2&&(i.warn=!n[1]),a&2055&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function fT(r,e,t){let n,a,i,o=Ve("store");ie(r,o,p=>t(0,i=p)),i.inlineEventTag||Ce(o,i.inlineEventTag=si.inlineEventsTag,i);let s=()=>createFragment(p=>{p.createSpan({text:"Event dates will be displayed using this format."}),p.createEl("br"),p.createSpan({text:"Information on how the format works can be seen "}),p.createEl("a",{href:"https://plugins.javalent.com/calendarium/create-calendar#Date+Format",text:"here"}),p.createSpan({text:"."})}),l=p=>{p.detail!==i.name&&Ce(o,i.name=p.detail,i)},u=p=>{p.detail!==i.description&&Ce(o,i.description=p.detail,i)},c=()=>{Ce(o,i.static.displayDayNumber=!i.static.displayDayNumber,i)},f=p=>{p.detail!==i.dateFormat&&Ce(o,i.dateFormat=p.detail,i)},d=()=>{Ce(o,i.supportInlineEvents=!i.supportInlineEvents,i)},h=p=>{p.detail!==i.inlineEventTag&&Ce(o,i.inlineEventTag=p.detail,i)};return r.$$.update=()=>{r.$$.dirty&1&&t(2,n=i.static.displayDayNumber),r.$$.dirty&1&&t(1,a=i.name!=null&&i.name.length)},[i,a,n,o,s,l,u,c,f,d,h]}var wm=class extends ae{constructor(e){super(),oe(this,e,fT,cT,re,{},lT)}},jl=wm;function dT(r){we(r,"svelte-t8lh77",'.calendarium-date-field-container.calendarium-date-field-container.svelte-t8lh77.svelte-t8lh77{display:flex;align-items:flex-start;flex-direction:row;gap:1rem;border:0}.calendarium-date-field.svelte-t8lh77.svelte-t8lh77{display:grid;grid-auto-rows:auto 1fr;flex:1 1 0;gap:0.5rem;margin:0}.calendarium-date-field.svelte-t8lh77 .setting-item-description.svelte-t8lh77{padding-top:0}.calendarium-date-field.svelte-t8lh77 .invalid.svelte-t8lh77{border:1px solid var(--text-error)}.warning-container.svelte-t8lh77.svelte-t8lh77{position:relative;display:flex;flex-flow:column nowrap;align-items:flex-start;gap:0.25rem}select.svelte-t8lh77.svelte-t8lh77{width:100%}input[type="number"].svelte-t8lh77.svelte-t8lh77{width:100%}')}function x_(r,e,t){let n=r.slice();return n[22]=e[t],n[24]=t,n}function S_(r,e,t){let n=r.slice();return n[25]=e[t],n[24]=t,n}function A_(r){let e,t=!r[2]&&$_(r);return{c(){e=_("div"),t&&t.c(),g(e,"class","setting-item-description svelte-t8lh77")},m(n,a){$(n,e,a),t&&t.m(e,null)},p(n,a){n[2]?t&&(t.d(1),t=null):t?t.p(n,a):(t=$_(n),t.c(),t.m(e,null))},d(n){n&&A(e),t&&t.d()}}}function $_(r){let e=Qp(r[3],r[4])+"",t;return{c(){t=le(e)},m(n,a){$(n,t,a)},p(n,a){a&24&&e!==(e=Qp(n[3],n[4])+"")&&ve(t,e)},d(n){n&&A(t)}}}function T_(r){let e,t=r[25].name+"",n,a;return{c(){e=_("option"),n=le(t),e.__value=a=r[24],Re(e,e.__value)},m(i,o){$(i,e,o),y(e,n)},p(i,o){o&64&&t!==(t=i[25].name+"")&&ve(n,t)},d(i){i&&A(e)}}}function N_(r){let e,t=!r[5]&&P_(r);return{c(){e=_("div"),t&&t.c(),g(e,"class","setting-item-description svelte-t8lh77")},m(n,a){$(n,e,a),t&&t.m(e,null)},p(n,a){n[5]?t&&(t.d(1),t=null):t?t.p(n,a):(t=P_(n),t.c(),t.m(e,null))},d(n){n&&A(e),t&&t.d()}}}function P_(r){let e=Ip(r[3].month,r[4])+"",t;return{c(){t=le(e)},m(n,a){$(n,t,a)},p(n,a){a&24&&e!==(e=Ip(n[3].month,n[4])+"")&&ve(t,e)},d(n){n&&A(t)}}}function M_(r){let e,t,n,a,i;function o(c,f){return c[4].static.useCustomYears?pT:hT}let s=o(r,-1),l=s(r),u=!r[7]&&Q_(r);return{c(){e=_("div"),t=_("label"),t.textContent="Year",n=F(),a=_("div"),l.c(),i=F(),u&&u.c(),g(t,"for",""),g(a,"class","warning-container svelte-t8lh77"),g(e,"class","calendarium-date-field svelte-t8lh77")},m(c,f){$(c,e,f),y(e,t),y(e,n),y(e,a),l.m(a,null),y(a,i),u&&u.m(a,null)},p(c,f){s===(s=o(c,f))&&l?l.p(c,f):(l.d(1),l=s(c),l&&(l.c(),l.m(a,i))),c[7]?u&&(u.d(1),u=null):u?u.p(c,f):(u=Q_(c),u.c(),u.m(a,null))},d(c){c&&A(e),l.d(),u&&u.d()}}}function hT(r){let e,t,n;return{c(){e=_("input"),g(e,"type","number"),g(e,"spellcheck","false"),g(e,"placeholder","Year"),g(e,"class","svelte-t8lh77"),Ee(e,"invalid",!r[7])},m(a,i){$(a,e,i),Re(e,r[3].year),t||(n=ce(e,"input",r[19]),t=!0)},p(a,i){i&8&&Ct(e.value)!==a[3].year&&Re(e,a[3].year),i&128&&Ee(e,"invalid",!a[7])},d(a){a&&A(e),t=!1,n()}}}function pT(r){let e,t=[],n=new Map,a,i,o=$e(r[8]?.filter(Z_)??[]),s=l=>l[22].id;for(let l=0;lr[18].call(e)),Ee(e,"invalid",!r[7])},m(l,u){$(l,e,u);for(let c=0;cr[17].call(h)),Ee(h,"invalid",!r[5]),g(d,"class","warning-container svelte-t8lh77"),g(u,"class","calendarium-date-field svelte-t8lh77"),g(e,"class","setting-item calendarium-date-field-container svelte-t8lh77")},m(T,S){$(T,e,S),y(e,t),y(t,n),y(t,a),y(t,i),y(i,o),Re(o,r[3].day),y(i,s),E&&E.m(i,null),y(e,l),y(e,u),y(u,c),y(u,f),y(u,d),y(d,h);for(let M=0;Mr.name,Z_=r=>r&&r.name;function gT(r,e,t){let n,a,i=I,o=()=>(i(),i=be(d,N=>t(3,a=N)),d),s,l,u,c,f;r.$$.on_destroy.push(()=>i());let{date:d}=e;o();let{enableYear:h=!0}=e,{store:p=null}=e,m=p??Ve("store");ie(r,m,N=>t(4,s=N));let{monthStore:O,yearStore:b}=m;ie(r,O,N=>t(6,u=N)),ie(r,b,N=>t(8,f=N));let E=de([m,d],([N,L])=>Wo(L,N));ie(r,E,N=>t(2,n=N));let D=de([m,d],([N,L])=>Yo(L.month,N));ie(r,D,N=>t(5,l=N));let C=de([m,d],([N,L])=>zo(L.year,N));ie(r,C,N=>t(7,c=N));let k=Qt();de([E,D,C],([N,L,j])=>N&&L&&j).subscribe(N=>{k("valid",N)}),d.subscribe(N=>k("date",N));function T(){a.day=Ct(this.value),d.set(a)}function S(){a.month=Gt(this),d.set(a)}function M(){a.year=Gt(this),d.set(a)}function Z(){a.year=Ct(this.value),d.set(a)}return r.$$set=N=>{"date"in N&&o(t(0,d=N.date)),"enableYear"in N&&t(1,h=N.enableYear),"store"in N&&t(15,p=N.store)},[d,h,n,a,s,l,u,c,f,m,O,b,E,D,C,p,T,S,M,Z]}var Dm=class extends ae{constructor(e){super(),oe(this,e,gT,mT,re,{date:0,enableYear:1,store:15},dT)}},Wa=Dm;function yT(r){let e,t;return e=new Wa({props:{date:r[4]}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p:I,i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function bT(r){let e,t;return e=new xt({props:{name:"Current date",warn:!r[0],label:"Invalid current date specified",desc:r[1],$$slots:{default:[yT]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&1&&(i.warn=!n[0]),a&2&&(i.desc=n[1]),a&128&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function vT(r,e,t){let n,a,i,o,s=Ve("store");ie(r,s,c=>t(5,a=c));let{validDate:l,currentStore:u}=s;return ie(r,l,c=>t(0,o=c)),ie(r,u,c=>t(6,i=c)),r.$$.update=()=>{r.$$.dirty&97&&t(1,n=o?Fr(i,a):"Invalid date")},[o,n,s,l,u,a,i]}var Cm=class extends ae{constructor(e){super(),oe(this,e,vT,bT,re,{})}},Xl=Cm;function OT(r){we(r,"svelte-1yozc3g",".vertical-tab-nav-item.svelte-1yozc3g.svelte-1yozc3g{display:flex;align-items:center;justify-content:space-between}.calendarium-warning.svelte-1yozc3g.svelte-1yozc3g{color:var(--interactive-accent)}.is-active.svelte-1yozc3g .calendarium-warning.svelte-1yozc3g{color:var(--text-on-accent)}.section.svelte-1yozc3g.svelte-1yozc3g{display:flex;align-items:center;gap:0.25rem}")}function q_(r,e,t){let n=r.slice();return n[17]=e[t],n}function L_(r){let e,t,n,a;return{c(){e=_("div"),g(e,"class","calendarium-warning x-small svelte-1yozc3g")},m(i,o){$(i,e,o),n||(a=me(t=vt.call(null,e,An)),n=!0)},d(i){i&&A(e),n=!1,a()}}}function B_(r){let e,t,n,a,i,o=r[17]+"",s,l,u=!r[2](r[17]),c,f,d,h=u&&L_(r);function p(){return r[15](r[17])}return{c(){e=_("div"),t=_("div"),n=_("div"),i=F(),s=le(o),l=F(),h&&h.c(),c=F(),g(t,"class","section svelte-1yozc3g"),g(e,"class","vertical-tab-nav-item svelte-1yozc3g"),Ee(e,"is-active",r[3]===r[17])},m(m,O){$(m,e,O),y(e,t),y(t,n),y(t,i),y(t,s),y(e,l),h&&h.m(e,null),y(e,c),f||(d=[me(a=vt.call(null,n,r[4](r[17]))),ce(e,"click",p)],f=!0)},p(m,O){r=m,a&&qt(a.update)&&O&1&&a.update.call(null,r[4](r[17])),O&1&&o!==(o=r[17]+"")&&ve(s,o),O&5&&(u=!r[2](r[17])),u?h||(h=L_(r),h.c(),h.m(e,c)):h&&(h.d(1),h=null),O&9&&Ee(e,"is-active",r[3]===r[17])},d(m){m&&A(e),h&&h.d(),f=!1,Te(d)}}}function _T(r){let e,t=$e(r[0]),n=[];for(let a=0;a(c(),c=be(h,w=>t(3,u=w)),h);r.$$.on_destroy.push(()=>c());let{sections:d}=e,{selected:h}=e;f();let p=w=>{switch(w){case"General":return"badge-info";case"Dates":return"calendar";case"Celestial bodies":return"moon";case"Eras":return"calendar-range";case"Events":return"calendar-clock";case"Seasons & weather":return"sun-snow";case"Locations":return"map"}},m=Ve("store"),{validName:O,validDate:b,validMonths:E,validWeekdays:D,validYears:C}=m;ie(r,O,w=>t(14,l=w)),ie(r,b,w=>t(13,s=w)),ie(r,E,w=>t(12,o=w)),ie(r,D,w=>t(11,i=w)),ie(r,C,w=>t(10,a=w));let k=w=>Ce(h,u=w,u);return r.$$set=w=>{"sections"in w&&t(0,d=w.sections),"selected"in w&&f(t(1,h=w.selected))},r.$$.update=()=>{r.$$.dirty&31744&&t(2,n=w=>{switch(w){case"General":return l;case"Dates":return s&&o&&i&&a;default:return!0}})},[d,h,n,u,p,O,b,E,D,C,a,i,o,s,l,k]}var km=class extends ae{constructor(e){super(),oe(this,e,wT,_T,re,{sections:0,selected:1},OT)}},U_=km;var W_=require("obsidian");function DT(r){we(r,"svelte-1qpwjnu",".vertical-tab-header.svelte-1qpwjnu{display:flex;flex-flow:column nowrap}.bottom.svelte-1qpwjnu{margin-top:auto;justify-content:flex-end;display:flex}")}function CT(r){let e,t,n,a,i,o,s,l,u,c,f,d;return t=new is({}),i=new U_({props:{selected:r[1],sections:r[0]}}),{c(){e=_("div"),z(t.$$.fragment),n=F(),a=_("div"),z(i.$$.fragment),o=F(),s=_("div"),l=_("div"),g(a,"class","vertical-tab-header-group"),g(l,"class","cancel"),g(s,"class","bottom svelte-1qpwjnu"),g(e,"class","vertical-tab-header svelte-1qpwjnu")},m(h,p){$(h,e,p),W(t,e,null),y(e,n),y(e,a),W(i,a,null),y(e,o),y(e,s),y(s,l),c=!0,f||(d=me(u=r[2].call(null,l)),f=!0)},p(h,[p]){let m={};p&2&&(m.selected=h[1]),p&1&&(m.sections=h[0]),i.$set(m)},i(h){c||(P(t.$$.fragment,h),P(i.$$.fragment,h),c=!0)},o(h){R(t.$$.fragment,h),R(i.$$.fragment,h),c=!1},d(h){h&&A(e),Y(t),Y(i),f=!1,d()}}}function kT(r,e,t){let{sections:n}=e,{selected:a}=e,i=Qt(),o=s=>{new W_.ButtonComponent(s).setButtonText("Cancel").setCta().onClick(()=>{i("cancel")})};return r.$$set=s=>{"sections"in s&&t(0,n=s.sections),"selected"in s&&t(1,a=s.selected)},[n,a,o]}var Em=class extends ae{constructor(e){super(),oe(this,e,kT,CT,re,{sections:0,selected:1},DT)}},uf=Em;function ET(r){we(r,"svelte-1hd6jo2",".calendarium-creator.svelte-1hd6jo2.svelte-1hd6jo2,.calendarium-creator.svelte-1hd6jo2 .calendarium-creator-inner.svelte-1hd6jo2,.calendarium-creator.svelte-1hd6jo2 .calendarium-creator-app.svelte-1hd6jo2{background-color:var(--creator-background-color)}.calendarium-creator-app.svelte-1hd6jo2.svelte-1hd6jo2{overflow:auto;height:100%}.vertical-tab-header.svelte-1hd6jo2.svelte-1hd6jo2{display:flex;flex-flow:column nowrap}.vertical-tab-content.svelte-1hd6jo2.svelte-1hd6jo2{padding:var(--size-4-8);padding-top:0}.bottom.svelte-1hd6jo2.svelte-1hd6jo2{margin-top:auto;justify-content:flex-end;display:flex}")}function xT(r){let e,t,n=r[0]&&Y_(r);return{c(){e=_("div"),n&&n.c(),g(e,"class","calendarium-creator svelte-1hd6jo2")},m(a,i){$(a,e,i),n&&n.m(e,null),t=!0},p(a,i){a[0]?n?i&1&&P(n,1):(n=Y_(a),n.c(),P(n,1),n.m(e,null)):n&&(Oe(),R(n,1,1,()=>{n=null}),_e())},i(a){t||(P(n),t=!0)},o(a){R(n),t=!1},d(a){a&&A(e),n&&n.d()}}}function ST(r){let e,t,n,a,i,o,s,l,u;e=new uf({props:{selected:r[2],sections:["General","Events"]}}),e.$on("cancel",r[3]),a=new Ic({});let c=r[1]=="General"&&z_(r),f=r[1]=="Events"&&V_(r);return{c(){z(e.$$.fragment),t=F(),n=_("div"),z(a.$$.fragment),i=F(),o=_("div"),c&&c.c(),s=F(),f&&f.c(),g(o,"class","vertical-tab-content svelte-1hd6jo2"),g(n,"class",l="vertical-tab-content-container "+r[1].toLowerCase()+"s svelte-1hd6jo2")},m(d,h){W(e,d,h),$(d,t,h),$(d,n,h),W(a,n,null),y(n,i),y(n,o),c&&c.m(o,null),y(o,s),f&&f.m(o,null),u=!0},p(d,h){d[1]=="General"?c?h&2&&P(c,1):(c=z_(d),c.c(),P(c,1),c.m(o,s)):c&&(Oe(),R(c,1,1,()=>{c=null}),_e()),d[1]=="Events"?f?h&2&&P(f,1):(f=V_(d),f.c(),P(f,1),f.m(o,null)):f&&(Oe(),R(f,1,1,()=>{f=null}),_e()),(!u||h&2&&l!==(l="vertical-tab-content-container "+d[1].toLowerCase()+"s svelte-1hd6jo2"))&&g(n,"class",l)},i(d){u||(P(e.$$.fragment,d),P(a.$$.fragment,d),P(c),P(f),u=!0)},o(d){R(e.$$.fragment,d),R(a.$$.fragment,d),R(c),R(f),u=!1},d(d){d&&(A(t),A(n)),Y(e,d),Y(a),c&&c.d(),f&&f.d()}}}function Y_(r){let e,t,n,a,i,o,s,l,u,c;return e=new is({}),i=new jl({}),s=new Xl({}),u=new bs({}),{c(){z(e.$$.fragment),t=F(),n=_("div"),a=_("div"),z(i.$$.fragment),o=F(),z(s.$$.fragment),l=F(),z(u.$$.fragment),g(a,"class","calendarium-creator-app svelte-1hd6jo2"),g(n,"class","inherit calendarium-creator-inner svelte-1hd6jo2")},m(f,d){W(e,f,d),$(f,t,d),$(f,n,d),y(n,a),W(i,a,null),y(a,o),W(s,a,null),y(a,l),W(u,a,null),c=!0},i(f){c||(P(e.$$.fragment,f),P(i.$$.fragment,f),P(s.$$.fragment,f),P(u.$$.fragment,f),c=!0)},o(f){R(e.$$.fragment,f),R(i.$$.fragment,f),R(s.$$.fragment,f),R(u.$$.fragment,f),c=!1},d(f){f&&(A(t),A(n)),Y(e,f),Y(i),Y(s),Y(u)}}}function z_(r){let e,t,n,a;return e=new jl({}),n=new Xl({}),{c(){z(e.$$.fragment),t=F(),z(n.$$.fragment)},m(i,o){W(e,i,o),$(i,t,o),W(n,i,o),a=!0},i(i){a||(P(e.$$.fragment,i),P(n.$$.fragment,i),a=!0)},o(i){R(e.$$.fragment,i),R(n.$$.fragment,i),a=!1},d(i){i&&A(t),Y(e,i),Y(n,i)}}}function V_(r){let e,t;return e=new bs({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function AT(r){let e,t,n,a,i=[ST,xT],o=[];function s(l,u){return Sm.Platform.isMobile?1:0}return e=s(r,-1),t=o[e]=i[e](r),{c(){t.c(),n=He()},m(l,u){o[e].m(l,u),$(l,n,u),a=!0},p(l,[u]){t.p(l,u)},i(l){a||(P(t),a=!0)},o(l){R(t),a=!1},d(l){l&&A(n),o[e].d(l)}}}function $T(r,e,t){let n,i=Sm.Platform.isMobile;Hn(()=>{t(0,i=!0)});let o=Ze("General");ie(r,o,l=>t(1,n=l));function s(l){Zr.call(this,r,l)}return[i,n,o,s]}var xm=class extends ae{constructor(e){super(),oe(this,e,$T,AT,re,{},ET)}},j_=xm;var ad=require("obsidian");var X_=require("obsidian");function TT(r){let e,t,n,a;return{c(){e=_("div")},m(i,o){$(i,e,o),n||(a=me(t=r[1].call(null,e)),n=!0)},p:I,i:I,o:I,d(i){i&&A(e),n=!1,a()}}}function NT(r,e,t){let n,a=Ve("store");ie(r,a,s=>t(2,n=s));let i=Ve("plugin");return[a,s=>{let l=s.createDiv("calendarium-apply-preset");new X_.Setting(l).setName("Apply preset").setDesc("Apply a common Calendarium as a preset.").addButton(u=>{u.setCta().setButtonText("Choose preset").onClick(async()=>{let c=await Qc(i,n.name);c&&Ce(a,n=c,n)})})}]}var Am=class extends ae{constructor(e){super(),oe(this,e,NT,TT,re,{})}},G_=Am;function PT(r){let e,t,n,a;return e=new G_({}),n=new jl({}),{c(){z(e.$$.fragment),t=F(),z(n.$$.fragment)},m(i,o){W(e,i,o),$(i,t,o),W(n,i,o),a=!0},p:I,i(i){a||(P(e.$$.fragment,i),P(n.$$.fragment,i),a=!0)},o(i){R(e.$$.fragment,i),R(n.$$.fragment,i),a=!1},d(i){i&&A(t),Y(e,i),Y(n,i)}}}var $m=class extends ae{constructor(e){super(),oe(this,e,null,PT,re,{})}},Tm=$m;var cf=require("obsidian");var ff=class extends pn{constructor(e){super(),e||(this.creating=!0),this.item=e??{type:"day",name:null,id:Le(6)},this.useAbbr=(this.item?.abbreviation?.length??0)>0,this.titleEl.setText(`${this.creating?"Create":"Modify"} weekday`)}async display(){this.contentEl.empty(),new cf.Setting(this.contentEl).setName("Name").addText(e=>{e.setValue(this.item.name??"").onChange(t=>this.item.name=t)}),new cf.Setting(this.contentEl).setName("Custom abbreviation").setDesc("By default, the first three letters of the name will be used.").addToggle(e=>{e.setValue(this.useAbbr).onChange(t=>{this.useAbbr=t,this.display()})}),this.useAbbr&&new cf.Setting(this.contentEl).setName("Abbreviation").addText(e=>{e.setValue(this.item.abbreviation??"").onChange(t=>this.item.abbreviation=t)})}};function MT(r){let e,t=r[0].name+"",n;return{c(){e=_("div"),n=le(t),g(e,"slot","name")},m(a,i){$(a,e,i),y(e,n)},p(a,i){i&1&&t!==(t=a[0].name+"")&&ve(n,t)},d(a){a&&A(e)}}}function RT(r){let e,t=Vo(r[0])+"",n;return{c(){e=_("div"),n=le(t),g(e,"slot","desc"),Pt(e,"text-transform","uppercase")},m(a,i){$(a,e,i),y(e,n)},p(a,i){i&1&&t!==(t=Vo(a[0])+"")&&ve(n,t)},d(a){a&&A(e)}}}function QT(r){let e,t;return e=new lt({props:{$$slots:{desc:[RT],name:[MT]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&3&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function IT(r,e,t){let{item:n}=e;return r.$$set=a=>{"item"in a&&t(0,n=a.item)},[n]}var Nm=class extends ae{constructor(e){super(),oe(this,e,IT,QT,re,{item:0})}},H_=Nm;var to=require("obsidian");function K_(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,n)}return t}function pf(r){for(var e=1;e=0)&&(t[a]=r[a]);return t}function ZT(r,e){if(r==null)return{};var t=FT(r,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function qT(r,e){return BT(r)||WT(r,e)||Lm(r,e)||zT()}function pi(r){return LT(r)||UT(r)||Lm(r)||YT()}function LT(r){if(Array.isArray(r))return Mm(r)}function BT(r){if(Array.isArray(r))return r}function UT(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function WT(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n=[],a=!0,i=!1,o,s;try{for(t=t.call(r);!(a=(o=t.next()).done)&&(n.push(o.value),!(e&&n.length===e));a=!0);}catch(l){i=!0,s=l}finally{try{!a&&t.return!=null&&t.return()}finally{if(i)throw s}}return n}}function Lm(r,e){if(r){if(typeof r=="string")return Mm(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Mm(r,e)}}function Mm(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(l){throw l},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){t=t.call(r)},n:function(){var l=t.next();return i=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!i&&t.return!=null&&t.return()}finally{if(o)throw s}}}}var VT="finalize",jT="consider";function _s(r,e,t){r.dispatchEvent(new CustomEvent(VT,{detail:{items:e,info:t}}))}function gi(r,e,t){r.dispatchEvent(new CustomEvent(jT,{detail:{items:e,info:t}}))}var Df="draggedEntered",ru="draggedLeft",Cf="draggedOverIndex",Bm="draggedLeftDocument",mf={LEFT_FOR_ANOTHER:"leftForAnother",OUTSIDE_OF_ANY:"outsideOfAny"};function XT(r,e,t){r.dispatchEvent(new CustomEvent(Df,{detail:{indexObj:e,draggedEl:t}}))}function GT(r,e,t){r.dispatchEvent(new CustomEvent(ru,{detail:{draggedEl:e,type:mf.LEFT_FOR_ANOTHER,theOtherDz:t}}))}function HT(r,e){r.dispatchEvent(new CustomEvent(ru,{detail:{draggedEl:e,type:mf.OUTSIDE_OF_ANY}}))}function KT(r,e,t){r.dispatchEvent(new CustomEvent(Cf,{detail:{indexObj:e,draggedEl:t}}))}function JT(r){window.dispatchEvent(new CustomEvent(Bm,{detail:{draggedEl:r}}))}var Ur={DRAG_STARTED:"dragStarted",DRAGGED_ENTERED:Df,DRAGGED_ENTERED_ANOTHER:"dragEnteredAnother",DRAGGED_OVER_INDEX:Cf,DRAGGED_LEFT:ru,DRAGGED_LEFT_ALL:"draggedLeftAll",DROPPED_INTO_ZONE:"droppedIntoZone",DROPPED_INTO_ANOTHER:"droppedIntoAnother",DROPPED_OUTSIDE_OF_ANY:"droppedOutsideOfAny",DRAG_STOPPED:"dragStopped"},Wr={POINTER:"pointer",KEYBOARD:"keyboard"},kf="isDndShadowItem",Um="data-is-dnd-shadow-item-internal",eN="data-is-dnd-shadow-item-hint",tN="id:dnd-shadow-placeholder-0000",rN="dnd-action-dragged-el",nn="id",Rm=0;function dw(){Rm++}function hw(){if(Rm===0)throw new Error("Bug! trying to decrement when there are no dropzones");Rm--}var Wm=typeof window>"u",dt=function(){};function pw(r){var e,t=r.getBoundingClientRect(),n=getComputedStyle(r),a=n.transform;if(a){var i,o,s,l;if(a.startsWith("matrix3d("))e=a.slice(9,-1).split(/, /),i=+e[0],o=+e[5],s=+e[12],l=+e[13];else if(a.startsWith("matrix("))e=a.slice(7,-1).split(/, /),i=+e[0],o=+e[3],s=+e[4],l=+e[5];else return t;var u=n.transformOrigin,c=t.x-s-(1-i)*parseFloat(u),f=t.y-l-(1-o)*parseFloat(u.slice(u.indexOf(" ")+1)),d=i?t.width/i:r.offsetWidth,h=o?t.height/o:r.offsetHeight;return{x:c,y:f,width:d,height:h,top:f,right:c+d,bottom:f+h,left:c}}else return t}function mw(r){var e=pw(r);return{top:e.top+window.scrollY,bottom:e.bottom+window.scrollY,left:e.left+window.scrollX,right:e.right+window.scrollX}}function Ym(r){var e=r.getBoundingClientRect();return{top:e.top+window.scrollY,bottom:e.bottom+window.scrollY,left:e.left+window.scrollX,right:e.right+window.scrollX}}function gw(r){return{x:(r.left+r.right)/2,y:(r.top+r.bottom)/2}}function nN(r,e){return Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2))}function zm(r,e){return r.y<=e.bottom&&r.y>=e.top&&r.x>=e.left&&r.x<=e.right}function Jl(r){return gw(Ym(r))}function J_(r,e){var t=Jl(r),n=mw(e);return zm(t,n)}function aN(r,e){var t=Jl(r),n=Jl(e);return nN(t,n)}function iN(r){var e=Ym(r);return e.right<0||e.left>document.documentElement.scrollWidth||e.bottom<0||e.top>document.documentElement.scrollHeight}function oN(r,e){var t=Ym(e);return zm(r,t)?{top:r.y-t.top,bottom:t.bottom-r.y,left:r.x-t.left,right:Math.min(t.right,document.documentElement.clientWidth)-r.x}:null}var Ki;function Vm(){dt(function(){return"resetting indexes cache"}),Ki=new Map}Vm();function sN(r){dt(function(){return"resetting indexes cache for dz"}),Ki.delete(r)}function lN(r){var e=Array.from(r.children).findIndex(function(t){return t.getAttribute(Um)});if(e>=0)return Ki.has(r)||Ki.set(r,new Map),Ki.get(r).set(e,mw(r.children[e])),e}function uN(r,e){if(!J_(r,e))return null;var t=e.children;if(t.length===0)return{index:0,isProximityBased:!0};for(var n=lN(e),a=0;ao.clientHeight&&(s.bottomo.clientWidth&&(s.right1&&arguments[1]!==void 0?arguments[1]:0;return r.parentElement?bw(r.parentElement,e+1):e-1}function cN(r,e){if(Object.keys(r).length!==Object.keys(e).length)return!1;for(var t in r)if(!{}.hasOwnProperty.call(e,t)||e[t]!==r[t])return!1;return!0}function fN(r,e){if(r.length!==e.length)return!1;for(var t=0;t2&&arguments[2]!==void 0?arguments[2]:dN,n,a,i=!1,o,s=Array.from(e).sort(function(u,c){return ew(c)-ew(u)});function l(){var u=Jl(r),c=hN(u,n);if(!c&&o&&Math.abs(o.x-u.x)0)for(var l=n?[e]:pi(e.querySelectorAll("select")),u=0;u0)for(var m=h?[e]:pi(e.querySelectorAll("canvas")),O=0;O1&&arguments[1]!==void 0?arguments[1]:function(){},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){return[]};r.forEach(function(n){var a=e(n);Object.keys(a).forEach(function(i){n.style[i]=a[i]}),t(n).forEach(function(i){return n.classList.add(i)})})}function bf(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){return[]};r.forEach(function(n){var a=e(n);Object.keys(a).forEach(function(i){n.style[i]=""}),t(n).forEach(function(i){return n.classList.contains(i)&&n.classList.remove(i)})})}function TN(r){var e=r.style.minHeight;r.style.minHeight=window.getComputedStyle(r).getPropertyValue("height");var t=r.style.minWidth;return r.style.minWidth=window.getComputedStyle(r).getPropertyValue("width"),function(){r.style.minHeight=e,r.style.minWidth=t}}var NN="--any--",PN=100,MN=20,rw=3,nw={outline:"rgba(255, 255, 102, 0.7) solid 2px"},aw="data-is-dnd-original-dragged-item",Jn,Br,$n,Ef,sr,xf,eo,qr,hi,Fn,Hi=!1,jm=!1,Xm,nu=!1,Hl=[],ra=new Map,br=new Map,Pm=new WeakMap;function RN(r,e){dt(function(){return"registering drop-zone if absent"}),ra.has(e)||ra.set(e,new Set),ra.get(e).has(r)||(ra.get(e).add(r),dw())}function iw(r,e){ra.get(e).delete(r),hw(),ra.get(e).size===0&&ra.delete(e)}function QN(){dt(function(){return"watching dragged element"}),ON();var r=ra.get(Ef),e=wf(r),t;try{for(e.s();!(t=e.n()).done;){var n=t.value;n.addEventListener(Df,Ew),n.addEventListener(ru,xw),n.addEventListener(Cf,Sw)}}catch(o){e.e(o)}finally{e.f()}window.addEventListener(Bm,ws);var a=Math.max.apply(Math,pi(Array.from(r.keys()).map(function(o){return br.get(o).dropAnimationDurationMs}))),i=a===0?MN:Math.max(a,PN);mN(Br,r,i*1.07)}function IN(){dt(function(){return"unwatching dragged element"}),_N();var r=ra.get(Ef),e=wf(r),t;try{for(e.s();!(t=e.n()).done;){var n=t.value;n.removeEventListener(Df,Ew),n.removeEventListener(ru,xw),n.removeEventListener(Cf,Sw)}}catch(a){e.e(a)}finally{e.f()}window.removeEventListener(Bm,ws),gN()}function Sf(r){return r.findIndex(function(e){return!!e[kf]})}function FN(r){var e;return pf(pf({},r),{},(e={},Os(e,kf,!0),Os(e,nn,tN),e))}function Ew(r){dt(function(){return["dragged entered",r.currentTarget,r.detail]});var e=br.get(r.currentTarget),t=e.items,n=e.dropFromOthersDisabled;if(n&&r.currentTarget!==sr){dt(function(){return"ignoring dragged entered because drop is currently disabled"});return}if(nu=!1,t=t.filter(function(c){return c[nn]!==eo[nn]}),dt(function(){return"dragged entered items ".concat(pa(t))}),sr!==r.currentTarget){var a=br.get(sr).items,i=a.filter(function(c){return!c[kf]});gi(sr,i,{trigger:Ur.DRAGGED_ENTERED_ANOTHER,id:$n[nn],source:Wr.POINTER})}var o=r.detail.indexObj,s=o.index,l=o.isProximityBased,u=l&&s===r.currentTarget.children.length-1?s+1:s;qr=r.currentTarget,t.splice(u,0,eo),gi(r.currentTarget,t,{trigger:Ur.DRAGGED_ENTERED,id:$n[nn],source:Wr.POINTER})}function xw(r){if(Hi){dt(function(){return["dragged left",r.currentTarget,r.detail]});var e=br.get(r.currentTarget),t=e.items,n=e.dropFromOthersDisabled;if(n&&r.currentTarget!==sr&&r.currentTarget!==qr){dt(function(){return"drop is currently disabled"});return}var a=Sf(t);a!==-1&&t.splice(a,1),qr=void 0;var i=r.detail,o=i.type,s=i.theOtherDz;if(o===mf.OUTSIDE_OF_ANY||o===mf.LEFT_FOR_ANOTHER&&s!==sr&&br.get(s).dropFromOthersDisabled){dt(function(){return"dragged left all, putting shadow element back in the origin dz"}),nu=!0,qr=sr;var l=br.get(sr).items;l.splice(xf,0,eo),gi(sr,l,{trigger:Ur.DRAGGED_LEFT_ALL,id:$n[nn],source:Wr.POINTER})}gi(r.currentTarget,t,{trigger:Ur.DRAGGED_LEFT,id:$n[nn],source:Wr.POINTER})}}function Sw(r){dt(function(){return["dragged is over index",r.currentTarget,r.detail]});var e=br.get(r.currentTarget),t=e.items,n=e.dropFromOthersDisabled;if(n&&r.currentTarget!==sr){dt(function(){return"drop is currently disabled"});return}nu=!1;var a=r.detail.indexObj.index,i=Sf(t);i!==-1&&t.splice(i,1),t.splice(a,0,eo),gi(r.currentTarget,t,{trigger:Ur.DRAGGED_OVER_INDEX,id:$n[nn],source:Wr.POINTER})}function vf(r){r.preventDefault();var e=r.touches?r.touches[0]:r;Fn={x:e.clientX,y:e.clientY},Br.style.transform="translate3d(".concat(Fn.x-hi.x,"px, ").concat(Fn.y-hi.y,"px, 0)")}function ws(){dt(function(){return"dropped"}),jm=!0,window.removeEventListener("mousemove",vf),window.removeEventListener("touchmove",vf),window.removeEventListener("mouseup",ws),window.removeEventListener("touchend",ws),IN(),EN(Br),qr||(dt(function(){return"element was dropped right after it left origin but before entering somewhere else"}),qr=sr),dt(function(){return["dropped in dz",qr]});var r=br.get(qr),e=r.items,t=r.type;bf(ra.get(t),function(i){return br.get(i).dropTargetStyle},function(i){return br.get(i).dropTargetClasses});var n=Sf(e);n===-1&&(qr===sr?n=xf:qr.children.length>0&&(n=qr.children.length-1)),e=e.map(function(i){return i[kf]?$n:i});function a(){Xm(),_s(qr,e,{trigger:nu?Ur.DROPPED_OUTSIDE_OF_ANY:Ur.DROPPED_INTO_ZONE,id:$n[nn],source:Wr.POINTER}),qr!==sr&&_s(sr,br.get(sr).items,{trigger:Ur.DROPPED_INTO_ANOTHER,id:$n[nn],source:Wr.POINTER}),n!==-1&&$N(qr.children[n]),LN()}n!==-1&&ZN(n,a)}function ZN(r,e){var t=pw(qr.children[r]),n={x:t.left-parseFloat(Br.style.left),y:t.top-parseFloat(Br.style.top)},a=br.get(qr),i=a.dropAnimationDurationMs,o="transform ".concat(i,"ms ease");Br.style.transition=Br.style.transition?Br.style.transition+","+o:o,Br.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),window.setTimeout(e,i)}function qN(r,e){Hl.push({dz:r,destroy:e}),window.requestAnimationFrame(function(){kw(r),document.body.appendChild(r)})}function LN(){Br.remove(),Jn.remove(),Hl.length&&(dt(function(){return["will destroy zones that were removed during drag",Hl]}),Hl.forEach(function(r){var e=r.dz,t=r.destroy;t(),e.remove()}),Hl=[]),Br=void 0,Jn=void 0,$n=void 0,Ef=void 0,sr=void 0,xf=void 0,eo=void 0,qr=void 0,hi=void 0,Fn=void 0,Hi=!1,jm=!1,Xm=void 0,nu=!1}function BN(r,e){var t=!1,n={items:void 0,type:void 0,flipDurationMs:0,dragDisabled:!1,morphDisabled:!1,dropFromOthersDisabled:!1,dropTargetStyle:nw,dropTargetClasses:[],transformDraggedElement:function(){},centreDraggedOnCursor:!1};dt(function(){return["dndzone good to go options: ".concat(pa(e),", config: ").concat(pa(n)),{node:r}]});var a=new Map;function i(){window.addEventListener("mousemove",l,{passive:!1}),window.addEventListener("touchmove",l,{passive:!1,capture:!1}),window.addEventListener("mouseup",s,{passive:!1}),window.addEventListener("touchend",s,{passive:!1})}function o(){window.removeEventListener("mousemove",l),window.removeEventListener("touchmove",l),window.removeEventListener("mouseup",s),window.removeEventListener("touchend",s)}function s(){o(),Jn=void 0,hi=void 0,Fn=void 0}function l(d){d.preventDefault();var h=d.touches?d.touches[0]:d;Fn={x:h.clientX,y:h.clientY},(Math.abs(Fn.x-hi.x)>=rw||Math.abs(Fn.y-hi.y)>=rw)&&(o(),c())}function u(d){if(d.target!==d.currentTarget&&(d.target.value!==void 0||d.target.isContentEditable)){dt(function(){return"won't initiate drag on a nested input element"});return}if(d.button){dt(function(){return"ignoring none left click button: ".concat(d.button)});return}if(Hi){dt(function(){return"cannot start a new drag before finalizing previous one"});return}d.stopPropagation();var h=d.touches?d.touches[0]:d;hi={x:h.clientX,y:h.clientY},Fn=pf({},hi),Jn=d.currentTarget,i()}function c(){dt(function(){return["drag start config: ".concat(pa(n)),Jn]}),Hi=!0;var d=a.get(Jn);xf=d,sr=Jn.parentElement;var h=sr.closest("dialog")||sr.getRootNode(),p=h.body||h,m=n.items,O=n.type,b=n.centreDraggedOnCursor;$n=m[d],Ef=O,eo=FN($n),Br=kN(Jn,b&&Fn),Jn.setAttribute(aw,!0);function E(){Br.parentElement?window.requestAnimationFrame(E):(p.appendChild(Br),Br.focus(),QN(),kw(Jn),p.appendChild(Jn))}window.requestAnimationFrame(E),hf(Array.from(ra.get(n.type)).filter(function(D){return D===sr||!br.get(D).dropFromOthersDisabled}),function(D){return br.get(D).dropTargetStyle},function(D){return br.get(D).dropTargetClasses}),m.splice(d,1,eo),Xm=TN(sr),gi(sr,m,{trigger:Ur.DRAG_STARTED,id:$n[nn],source:Wr.POINTER}),window.addEventListener("mousemove",vf,{passive:!1}),window.addEventListener("touchmove",vf,{passive:!1,capture:!1}),window.addEventListener("mouseup",ws,{passive:!1}),window.addEventListener("touchend",ws,{passive:!1})}function f(d){var h=d.items,p=h===void 0?void 0:h,m=d.flipDurationMs,O=m===void 0?0:m,b=d.type,E=b===void 0?NN:b,D=d.dragDisabled,C=D===void 0?!1:D,k=d.morphDisabled,w=k===void 0?!1:k,T=d.dropFromOthersDisabled,S=T===void 0?!1:T,M=d.dropTargetStyle,Z=M===void 0?nw:M,N=d.dropTargetClasses,L=N===void 0?[]:N,j=d.transformDraggedElement,X=j===void 0?function(){}:j,fe=d.centreDraggedOnCursor,ee=fe===void 0?!1:fe;n.dropAnimationDurationMs=O,n.type&&E!==n.type&&iw(r,n.type),n.type=E,n.items=pi(p),n.dragDisabled=C,n.morphDisabled=w,n.transformDraggedElement=X,n.centreDraggedOnCursor=ee,t&&Hi&&!jm&&(!cN(Z,n.dropTargetStyle)||!fN(L,n.dropTargetClasses))&&(bf([r],function(){return n.dropTargetStyle},function(){return L}),hf([r],function(){return Z},function(){return L})),n.dropTargetStyle=Z,n.dropTargetClasses=pi(L);function te(xe,Pe){return br.get(xe)?br.get(xe)[Pe]:n[Pe]}t&&Hi&&n.dropFromOthersDisabled!==S&&(S?bf([r],function(xe){return te(xe,"dropTargetStyle")},function(xe){return te(xe,"dropTargetClasses")}):hf([r],function(xe){return te(xe,"dropTargetStyle")},function(xe){return te(xe,"dropTargetClasses")})),n.dropFromOthersDisabled=S,br.set(r,n),RN(r,E);for(var ge=Sf(n.items),he=0;he".concat(e,"

"),t.style.display="none",t.style.position="fixed",t.style.zIndex="-5",t}function vs(r){if(!Wm){yr||Fm(),yr.innerHTML="";var e=document.createTextNode(r);yr.appendChild(e),yr.style.display="none",yr.style.display="inline"}}var VN="--any--",ow={outline:"rgba(255, 255, 102, 0.7) solid 2px"},Zn=!1,Zm,rn,Ji="",Gi,ea,mi="",Of=new WeakSet,sw=new WeakMap,lw=new WeakMap,qm=new Map,Lr=new Map,ta=new Map,_f;function jN(r,e){dt(function(){return"registering drop-zone if absent"}),ta.size===0&&(dt(function(){return"adding global keydown and click handlers"}),_f=WN(),window.addEventListener("keydown",$w),window.addEventListener("click",Tw)),ta.has(e)||ta.set(e,new Set),ta.get(e).has(r)||(ta.get(e).add(r),dw())}function uw(r,e){dt(function(){return"unregistering drop-zone"}),rn===r&&tu(),ta.get(e).delete(r),hw(),ta.get(e).size===0&&ta.delete(e),ta.size===0&&(dt(function(){return"removing global keydown and click handlers"}),window.removeEventListener("keydown",$w),window.removeEventListener("click",Tw),_f=void 0,YN())}function $w(r){if(Zn)switch(r.key){case"Escape":{tu();break}}}function Tw(){Zn&&(Of.has(document.activeElement)||(dt(function(){return"clicked outside of any draggable"}),tu()))}function XN(r){if(dt(function(){return"zone focus"}),!!Zn){var e=r.currentTarget;if(e!==rn){Ji=e.getAttribute("aria-label")||"";var t=Lr.get(rn),n=t.items,a=n.find(function(f){return f[nn]===ea}),i=n.indexOf(a),o=n.splice(i,1)[0],s=Lr.get(e),l=s.items,u=s.autoAriaDisabled;e.getBoundingClientRect().top0&&arguments[0]!==void 0?arguments[0]:!0;dt(function(){return"drop"}),Lr.get(rn).autoAriaDisabled||vs("Stopped dragging item ".concat(mi)),Of.has(document.activeElement)&&document.activeElement.blur(),r&&gi(rn,Lr.get(rn).items,{trigger:Ur.DRAG_STOPPED,id:ea,source:Wr.KEYBOARD}),bf(ta.get(Zm),function(e){return Lr.get(e).dropTargetStyle},function(e){return Lr.get(e).dropTargetClasses}),Gi=null,ea=null,mi="",Zm=null,rn=null,Ji="",Zn=!1,Nw()}function GN(r,e){var t={items:void 0,type:void 0,dragDisabled:!1,zoneTabIndex:0,zoneItemTabIndex:0,dropFromOthersDisabled:!1,dropTargetStyle:ow,dropTargetClasses:[],autoAriaDisabled:!1};function n(c,f,d){c.length<=1||c.splice(d,1,c.splice(f,1,c[d])[0])}function a(c){switch(dt(function(){return["handling key down",c.key]}),c.key){case"Enter":case" ":{if((c.target.disabled!==void 0||c.target.href||c.target.isContentEditable)&&!Of.has(c.target))return;c.preventDefault(),c.stopPropagation(),Zn?tu():i(c);break}case"ArrowDown":case"ArrowRight":{if(!Zn)return;c.preventDefault(),c.stopPropagation();var f=Lr.get(r),d=f.items,h=Array.from(r.children),p=h.indexOf(c.currentTarget);dt(function(){return["arrow down",p]}),p0&&(t.autoAriaDisabled||vs("Moved item ".concat(mi," to position ").concat(E," in the list ").concat(Ji)),n(O,E,E-1),_s(r,O,{trigger:Ur.DROPPED_INTO_ZONE,id:ea,source:Wr.KEYBOARD}));break}}}function i(c){dt(function(){return"drag start"}),s(c.currentTarget),rn=r,Zm=t.type,Zn=!0;var f=Array.from(ta.get(t.type)).filter(function(h){return h===rn||!Lr.get(h).dropFromOthersDisabled});if(hf(f,function(h){return Lr.get(h).dropTargetStyle},function(h){return Lr.get(h).dropTargetClasses}),!t.autoAriaDisabled){var d="Started dragging item ".concat(mi,". Use the arrow keys to move it within its list ").concat(Ji);f.length>1&&(d+=", or tab to another list in order to move the item into it"),vs(d)}gi(r,Lr.get(r).items,{trigger:Ur.DRAG_STARTED,id:ea,source:Wr.KEYBOARD}),Nw()}function o(c){Zn&&c.currentTarget!==Gi&&(c.stopPropagation(),tu(!1),i(c))}function s(c){var f=Lr.get(r),d=f.items,h=Array.from(r.children),p=h.indexOf(c);Gi=c,Gi.tabIndex=t.zoneItemTabIndex,ea=d[p][nn],mi=h[p].getAttribute("aria-label")||""}function l(c){var f=c.items,d=f===void 0?[]:f,h=c.type,p=h===void 0?VN:h,m=c.dragDisabled,O=m===void 0?!1:m,b=c.zoneTabIndex,E=b===void 0?0:b,D=c.zoneItemTabIndex,C=D===void 0?0:D,k=c.dropFromOthersDisabled,w=k===void 0?!1:k,T=c.dropTargetStyle,S=T===void 0?ow:T,M=c.dropTargetClasses,Z=M===void 0?[]:M,N=c.autoAriaDisabled,L=N===void 0?!1:N;t.items=pi(d),t.dragDisabled=O,t.dropFromOthersDisabled=w,t.zoneTabIndex=E,t.zoneItemTabIndex=C,t.dropTargetStyle=S,t.dropTargetClasses=Z,t.autoAriaDisabled=L,t.type&&p!==t.type&&uw(r,t.type),t.type=p,jN(r,p),L||(r.setAttribute("aria-disabled",O),r.setAttribute("role","list"),r.setAttribute("aria-describedby",O?_f.DND_ZONE_DRAG_DISABLED:_f.DND_ZONE_ACTIVE)),Lr.set(r,t),Zn?r.tabIndex=r===rn||Gi.contains(r)||t.dropFromOthersDisabled||rn&&t.type!==Lr.get(rn).type?-1:0:r.tabIndex=t.zoneTabIndex,r.addEventListener("focus",XN);for(var j=function(ee){var te=r.children[ee];Of.add(te),te.tabIndex=Zn?-1:t.zoneItemTabIndex,L||te.setAttribute("role","listitem"),te.removeEventListener("keydown",sw.get(te)),te.removeEventListener("click",lw.get(te)),O||(te.addEventListener("keydown",a),sw.set(te,a),te.addEventListener("click",o),lw.set(te,o)),Zn&&t.items[ee][nn]===ea&&(dt(function(){return["focusing on",{i:ee,focusedItemId:ea}]}),Gi=te,Gi.tabIndex=t.zoneItemTabIndex,te.focus())},X=0;X0&&console.warn("dndzone will ignore unknown options",p),!e)throw new Error("no 'items' key provided to dndzone");var m=e.find(function(O){return!{}.hasOwnProperty.call(O,nn)});if(m)throw new Error("missing '".concat(nn,"' property for item ").concat(pa(m)));if(c&&!Array.isArray(c))throw new Error("dropTargetClasses should be an array but instead it is a ".concat(Kl(c),", ").concat(pa(c)));if(s&&!fw(s))throw new Error("zoneTabIndex should be a number but instead it is a ".concat(Kl(s),", ").concat(pa(s)));if(l&&!fw(l))throw new Error("zoneItemTabIndex should be a number but instead it is a ".concat(Kl(l),", ").concat(pa(l)))}function fw(r){return!isNaN(r)&&function(e){return(e|0)===e}(parseFloat(r))}function $f(r){let e=r-1;return e*e*e+1}function Tf(r,{from:e,to:t},n={}){let a=getComputedStyle(r),i=a.transform==="none"?"":a.transform,[o,s]=a.transformOrigin.split(" ").map(parseFloat),l=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*s/t.height-(t.top+s),{delay:c=0,duration:f=h=>Math.sqrt(h)*120,easing:d=$f}=n;return{delay:c,duration:qt(f)?f(Math.sqrt(l*l+u*u)):f,easing:d,css:(h,p)=>{let m=p*l,O=p*u,b=h+p*e.width/t.width,E=h+p*e.height/t.height;return`transform: ${i} translate(${m}px, ${O}px) scale(${b}, ${E});`}}}function JN(r){we(r,"svelte-1r6y0ao",".drop-items.svelte-1r6y0ao.svelte-1r6y0ao{width:100%;margin:0.5rem 0}.drop-item-container.svelte-1r6y0ao .icon.svelte-1r6y0ao,.icons.svelte-1r6y0ao.svelte-1r6y0ao{display:flex;align-items:center}.drop-item-container.svelte-1r6y0ao.svelte-1r6y0ao{display:grid;grid-template-columns:auto 1fr auto;align-items:center;justify-content:space-between;gap:1rem;width:100%}.drop-item-container.svelte-1r6y0ao.svelte-1r6y0ao:not(:last-child){margin-bottom:0.5rem}")}function Pw(r,e,t){let n=r.slice();return n[14]=e[t],n}function Mw(r){let e,t,n;var a=r[3];function i(o,s){return{props:{item:o[14],"...args":!0}}}return a&&(t=Op(a,i(r))),{c(){e=_("div"),t&&z(t.$$.fragment),g(e,"class","drop-item"),Ee(e,"type",r[2])},m(o,s){$(o,e,s),t&&W(t,e,null),n=!0},p(o,s){if(s&8&&a!==(a=o[3])){if(t){Oe();let l=t;R(l.$$.fragment,1,0,()=>{Y(l,1)}),_e()}a?(t=Op(a,i(o,s)),z(t.$$.fragment),P(t.$$.fragment,1),W(t,e,null)):t=null}else if(a){let l={};s&1&&(l.item=o[14]),t.$set(l)}(!n||s&4)&&Ee(e,"type",o[2])},i(o){n||(t&&P(t.$$.fragment,o),n=!0)},o(o){t&&R(t.$$.fragment,o),n=!1},d(o){o&&A(e),t&&Y(t)}}}function Rw(r,e){let t,n,a,i,o,s=e[14],l,u,c,f,d,h,p,m,O,b=I,E,D,C,k=Mw(e);return{key:r,first:null,c(){t=_("div"),n=_("div"),o=F(),k.c(),l=F(),u=_("div"),c=_("div"),d=F(),h=_("div"),m=F(),g(n,"class","icon svelte-1r6y0ao"),g(n,"style",a=e[1]?"cursor: grab":"cursor: grabbing"),g(c,"class","icon svelte-1r6y0ao"),g(h,"class","icon svelte-1r6y0ao"),g(u,"class","icons svelte-1r6y0ao"),g(t,"class","drop-item-container svelte-1r6y0ao"),this.first=t},m(w,T){$(w,t,T),y(t,n),y(t,o),k.m(t,null),y(t,l),y(t,u),y(u,c),y(u,d),y(u,h),y(t,m),E=!0,D||(C=[me(i=e[4].call(null,n)),ce(n,"mousedown",e[5]),ce(n,"touchstart",e[5]),me(f=e[8].call(null,c,e[14])),me(p=e[9].call(null,h,e[14]))],D=!0)},p(w,T){e=w,(!E||T&2&&a!==(a=e[1]?"cursor: grab":"cursor: grabbing"))&&g(n,"style",a),T&1&&re(s,s=e[14])?(Oe(),R(k,1,1,I),_e(),k=Mw(e),k.c(),P(k,1),k.m(t,l)):k.p(e,T),f&&qt(f.update)&&T&1&&f.update.call(null,e[14]),p&&qt(p.update)&&T&1&&p.update.call(null,e[14])},r(){O=t.getBoundingClientRect()},f(){wc(t),b()},a(){b(),b=_c(t,O,Tf,{duration:Gm})},i(w){E||(P(k),E=!0)},o(w){R(k),E=!1},d(w){w&&A(t),k.d(w),D=!1,Te(C)}}}function eP(r){let e,t=[],n=new Map,a,i,o,s,l=$e(r[0]),u=c=>c[14].id;for(let c=0;c{(0,to.setIcon)(b,$c)},c=new to.Scope;function f(b){b.preventDefault(),s.app.keymap.pushScope(c),t(1,d=!1)}let{dragDisabled:d=!1}=e;function h(b){t(0,n=b.detail.items)}function p(b){s.app.keymap.popScope(c),o(b.detail.items)}let m=(b,E)=>{new to.ExtraButtonComponent(b).setIcon(Ar).onClick(()=>l("advanced",E))},O=(b,E)=>{new to.ExtraButtonComponent(b).setIcon(Lt).onClick(()=>l("trash",E))};return r.$$set=b=>{"items"in b&&t(0,n=b.items),"type"in b&&t(2,a=b.type),"component"in b&&t(3,i=b.component),"onDrop"in b&&t(10,o=b.onDrop),"dragDisabled"in b&&t(1,d=b.dragDisabled)},[n,d,a,i,u,f,h,p,m,O,o]}var Hm=class extends ae{constructor(e){super(),oe(this,e,tP,eP,re,{items:0,type:2,component:3,onDrop:10,dragDisabled:1},JN)}},yi=Hm;var qw=require("obsidian");function Qw(r,e,t){let n=r.slice();return n[17]=e[t],n[19]=t,n}function rP(r){let e,t;return e=new yi({props:{type:"weekday",items:r[3],onDrop:r[9],component:H_}}),e.$on("advanced",r[10]),e.$on("trash",r[11]),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a&8&&(i.items=n[3]),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function nP(r){let e,t;return e=new gr({props:{message:"Create a new weekday to see it here."}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p:I,i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Iw(r){let e,t=(r[17].name??"")+"",n,a,i,o;return{c(){e=_("option"),n=le(t),a=F(),e.disabled=i=!r[4],e.__value=o=r[19],Re(e,e.__value)},m(s,l){$(s,e,l),y(e,n),y(e,a)},p(s,l){l&2&&t!==(t=(s[17].name??"")+"")&&ve(n,t),l&16&&i!==(i=!s[4])&&(e.disabled=i)},d(s){s&&A(e)}}}function aP(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p,m,O,b,E=[nP,rP],D=[];function C(T,S){return T[1].length?1:0}e=C(r,-1),t=D[e]=E[e](r),a=new mr({props:{placeholder:"Weekday"}}),a.$on("add",r[12]),o=new er({props:{name:"Overflow weeks",desc:"Weeks will flow into the next month. Disable to reset the weekday each month.",value:r[0].overflow}}),o.$on("click",r[13]);let k=$e(r[1].filter(Fw)),w=[];for(let T=0;TFirst day
The weekday for the very first day on the calendar.
',c=F(),f=_("div"),d=_("select"),h=_("option"),h.textContent="Select a Weekday";for(let T=0;Tr[14].call(d)),g(f,"class","setting-item-control"),g(l,"class","setting-item")},m(T,S){D[e].m(T,S),$(T,n,S),W(a,T,S),$(T,i,S),W(o,T,S),$(T,s,S),$(T,l,S),y(l,u),y(l,c),y(l,f),y(f,d),y(d,h);for(let M=0;M{D[M]=null}),_e(),t=D[e],t?t.p(T,S):(t=D[e]=E[e](T),t.c()),P(t,1),t.m(n.parentNode,n));let Z={};if(S&1&&(Z.value=T[0].overflow),o.$set(Z),S&18){k=$e(T[1].filter(Fw));let N;for(N=0;Nr.name?.length,Zw=r=>r.name?.length;function oP(r,e,t){let n,a,i,o,s=Ve("store"),{staticStore:l,weekdayStore:u}=s;ie(r,l,C=>t(0,i=C)),ie(r,u,C=>t(1,o=C));let c=i.firstWeekDay,f=C=>{let k=new ff(C);k.onCancel=()=>{},k.onClose=()=>{!k.item.name||!C.id||u.update(C.id,k.item)},k.open()},d=C=>{u.delete(C.id??"")},h=C=>{u.set(C)},p=C=>f(C.detail),m=C=>d(C.detail),O=C=>{u.add({type:"day",name:C.detail,id:Le(6)})},b=()=>l.setProperty("overflow",!i.overflow);function E(){c=Gt(this),t(2,c)}let D=()=>{l.setProperty("firstWeekDay",c)};return r.$$.update=()=>{r.$$.dirty&1&&t(4,n=i.overflow),r.$$.dirty&2&&t(3,a=at(o))},[i,o,c,a,n,l,u,f,d,h,p,m,O,b,E,D]}var Km=class extends ae{constructor(e){super(),oe(this,e,oP,iP,re,{})}},Lw=Km;function sP(r){we(r,"svelte-12uae8g",".desc.svelte-12uae8g{display:flex;align-items:center;gap:0.5rem}")}function lP(r){let e,t=r[0].name+"",n;return{c(){e=_("div"),n=le(t),g(e,"slot","name")},m(a,i){$(a,e,i),y(e,n)},p(a,i){i&1&&t!==(t=a[0].name+"")&&ve(n,t)},d(a){a&&A(e)}}}function Bw(r){let e,t=r[0].interval+"",n,a,i=r[0].offset>0&&Uw(r);return{c(){e=le(", every "),n=le(t),i&&i.c(),a=le(` years`)},m(o,s){$(o,e,s),$(o,n,s),i&&i.m(o,s),$(o,a,s)},p(o,s){s&1&&t!==(t=o[0].interval+"")&&ve(n,t),o[0].offset>0?i?i.p(o,s):(i=Uw(o),i.c(),i.m(a.parentNode,a)):i&&(i.d(1),i=null)},d(o){o&&(A(e),A(n),A(a)),i&&i.d(o)}}}function Uw(r){let e,t=r[0].offset+"",n;return{c(){e=le("+"),n=le(t)},m(a,i){$(a,e,i),$(a,n,i)},p(a,i){i&1&&t!==(t=a[0].offset+"")&&ve(n,t)},d(a){a&&(A(e),A(n))}}}function uP(r){let e,t,n,a,i,o=r[0].length+"",s,l,u=r[0].length==1?"":"s",c,f,d,h=r[0].interval>1&&Bw(r);return{c(){e=_("div"),t=_("div"),a=F(),i=_("span"),s=le(o),l=le(" day"),c=le(u),h&&h.c(),g(t,"aria-label",r[2]),g(e,"slot","desc"),g(e,"class","desc svelte-12uae8g")},m(p,m){$(p,e,m),y(e,t),y(e,a),y(e,i),y(i,s),y(i,l),y(i,c),h&&h.m(i,null),f||(d=me(n=vt.call(null,t,r[1])),f=!0)},p(p,m){m&1&&o!==(o=p[0].length+"")&&ve(s,o),m&1&&u!==(u=p[0].length==1?"":"s")&&ve(c,u),p[0].interval>1?h?h.p(p,m):(h=Bw(p),h.c(),h.m(i,null)):h&&(h.d(1),h=null)},d(p){p&&A(e),h&&h.d(),f=!1,d()}}}function cP(r){let e,t;return e=new lt({props:{$$slots:{desc:[uP],name:[lP]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&17&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function fP(r,e,t){let{item:n}=e,a=Ve("store"),i=n.type=="intercalary"?xc:Sc,o=n.type=="intercalary"?"Intercalary":"Month";return r.$$set=s=>{"item"in s&&t(0,n=s.item)},[n,i,o]}var Jm=class extends ae{constructor(e){super(),oe(this,e,fP,cP,re,{item:0},sP)}},Ww=Jm;var Ds=require("obsidian");var Nf=class extends pn{constructor(e){super(),e||(this.creating=!0),this.item=e??{type:"month",length:0,name:"",id:Le(6),interval:1,offset:0},this.titleEl.setText(`${this.creating?"Create":"Modify"} month`)}async display(){this.contentEl.empty(),new Ds.Setting(this.contentEl).setName("Name").addText(e=>{e.setValue(this.item.name??"").onChange(t=>this.item.name=t)}),new Ds.Setting(this.contentEl).setName("Type").addDropdown(e=>{e.addOption("month","Month"),e.addOption("intercalary","Intercalary"),e.setValue(this.item.type).onChange(t=>{t!="month"&&t!="intercalary"||(this.item.type=t)})}),new Ds.Setting(this.contentEl).setName("Length").addText(e=>{e.setValue(this.item.length?`${this.item.length}`:"").onChange(t=>this.item.length=Number(t)),e.inputEl.type="number",e.inputEl.min="0"}),new Ds.Setting(this.contentEl).setName("Interval").addText(e=>{e.setValue(this.item.interval?`${this.item.interval}`:"").onChange(t=>this.item.interval=Number(t)),e.inputEl.type="number",e.inputEl.min="0"}),new Ds.Setting(this.contentEl).setName("Offset").addText(e=>{e.setValue(this.item.offset?`${this.item.offset}`:"").onChange(t=>this.item.offset=Number(t)),e.inputEl.type="number",e.inputEl.min="0"})}};var Yw=require("obsidian");function dP(r){let e,t;return e=new yi({props:{type:"month",component:Ww,items:r[1],onDrop:r[5]}}),e.$on("advanced",r[9]),e.$on("trash",r[10]),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a&2&&(i.items=n[1]),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function hP(r){let e,t;return e=new gr({props:{message:"Create a new month to see it here."}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p:I,i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function pP(r){let e,t,n,a,i,o,s;e=new er({props:{name:"Show intercalary months separately",desc:"Intercalary months will appear a distinct months in the calendar.",value:r[2].showIntercalarySeparately}}),e.$on("click",r[8]);let l=[hP,dP],u=[];function c(f,d){return f[0].length?1:0}return n=c(r,-1),a=u[n]=l[n](r),o=new mr({props:{placeholder:"Month"}}),o.$on("add",r[11]),{c(){z(e.$$.fragment),t=F(),a.c(),i=F(),z(o.$$.fragment)},m(f,d){W(e,f,d),$(f,t,d),u[n].m(f,d),$(f,i,d),W(o,f,d),s=!0},p(f,d){let h={};d&4&&(h.value=f[2].showIntercalarySeparately),e.$set(h);let p=n;n=c(f,d),n===p?u[n].p(f,d):(Oe(),R(u[p],1,1,()=>{u[p]=null}),_e(),a=u[n],a?a.p(f,d):(a=u[n]=l[n](f),a.c()),P(a,1),a.m(i.parentNode,i))},i(f){s||(P(e.$$.fragment,f),P(a),P(o.$$.fragment,f),s=!0)},o(f){R(e.$$.fragment,f),R(a),R(o.$$.fragment,f),s=!1},d(f){f&&(A(t),A(i)),Y(e,f),u[n].d(f),Y(o,f)}}}function mP(r){let e,t;return e=new xt({props:{name:"Months",open:Yw.Platform.isDesktop,warn:!r[0]?.length,label:"At least one month is required",desc:`${r[0].length} month${r[0].length!=1?"s":""}`,$$slots:{default:[pP]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&1&&(i.warn=!n[0]?.length),a&1&&(i.desc=`${n[0].length} month${n[0].length!=1?"s":""}`),a&4103&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function gP(r,e,t){let n,a,i,o=Ve("store");ie(r,o,m=>t(2,i=m));let{monthStore:s}=o;ie(r,s,m=>t(0,a=m));function l(m){s.set(m)}let u=m=>{let O=new Nf(m);O.onCancel=()=>{},O.onClose=()=>{!O.item.name||!m.id||s.update(m.id,O.item)},O.open()},c=m=>{s.delete(m.id??"")},f=()=>{Ce(o,i.showIntercalarySeparately=!i.showIntercalarySeparately,i)},d=m=>u(m.detail),h=m=>c(m.detail),p=m=>s.add(m.detail);return r.$$.update=()=>{r.$$.dirty&1&&t(1,n=at(a))},[a,n,i,o,s,l,u,c,f,d,h,p]}var eg=class extends ae{constructor(e){super(),oe(this,e,gP,mP,re,{})}},zw=eg;var tg=require("obsidian");function yP(r){we(r,"svelte-1k7zgfz",".leapday.svelte-1k7zgfz.svelte-1k7zgfz{display:grid;grid-template-columns:1fr auto;align-items:center;justify-content:space-between;gap:1rem;margin-top:0.5rem}.icons.svelte-1k7zgfz.svelte-1k7zgfz{display:flex;align-self:center;justify-self:flex-end;align-items:center}.desc.svelte-1k7zgfz.svelte-1k7zgfz{display:flex;align-items:flex-start;gap:0.5rem}.desc.svelte-1k7zgfz .description.svelte-1k7zgfz{display:flex;flex-flow:column}")}function bP(r){let e,t=r[0].name+"",n;return{c(){e=_("div"),n=le(t),g(e,"slot","name")},m(a,i){$(a,e,i),y(e,n)},p(a,i){i&1&&t!==(t=a[0].name+"")&&ve(n,t)},d(a){a&&A(e)}}}function vP(r){let e,t,n,a,i,o,s,l;return{c(){e=_("div"),t=_("div"),a=F(),i=_("div"),g(i,"class","description svelte-1k7zgfz"),g(e,"slot","desc"),g(e,"class","desc svelte-1k7zgfz")},m(u,c){$(u,e,c),y(e,t),y(e,a),y(e,i),s||(l=[me(n=vt.call(null,t,r[4])),me(o=r[6].call(null,i))],s=!0)},p:I,d(u){u&&A(e),s=!1,Te(l)}}}function OP(r){let e,t,n,a,i,o,s,l,u,c,f,d;return t=new lt({props:{$$slots:{desc:[vP],name:[bP]},$$scope:{ctx:r}}}),{c(){e=_("div"),z(t.$$.fragment),n=F(),a=_("div"),i=_("div"),s=F(),l=_("div"),g(i,"class","icon"),g(l,"class","icon"),g(a,"class","icons svelte-1k7zgfz"),g(e,"class","leapday svelte-1k7zgfz")},m(h,p){$(h,e,p),W(t,e,null),y(e,n),y(e,a),y(a,i),y(a,s),y(a,l),c=!0,f||(d=[me(o=r[3].call(null,i)),ce(i,"click",r[7]),me(u=r[2].call(null,l)),ce(l,"click",r[8])],f=!0)},p(h,[p]){let m={};p&1025&&(m.$$scope={dirty:p,ctx:h}),t.$set(m)},i(h){c||(P(t.$$.fragment,h),c=!0)},o(h){R(t.$$.fragment,h),c=!1},d(h){h&&A(e),Y(t),f=!1,Te(d)}}}function _P(r,e,t){let n,a=Qt(),i=h=>{new tg.ExtraButtonComponent(h).setIcon(Lt).setTooltip("Delete").extraSettingsEl.setAttr("style","margin-left: 0;")},o=h=>{new tg.ExtraButtonComponent(h).setIcon(Ar).setTooltip("Edit")},{leapday:s}=e,l=s.intercalary?xc:Sc,u=Ve("store");ie(r,u,h=>t(9,n=h));let c=h=>{let p=n.static.months[s.timespan].name;s.intercalary&&(s.after===0?p+=", before 1":p+=`, after ${s.after}`),h.createSpan({text:p??""}),h.createSpan({text:cl(s)})},f=()=>a("edit"),d=()=>a("delete");return r.$$set=h=>{"leapday"in h&&t(0,s=h.leapday)},[s,a,i,o,l,u,c,f,d]}var rg=class extends ae{constructor(e){super(),oe(this,e,_P,OP,re,{leapday:0},yP)}},Vw=rg;var Cs=require("obsidian");var au=require("obsidian");function wP(r){we(r,"svelte-n1tx0h",".intercalary-settings.svelte-n1tx0h{display:flex;justify-content:space-around}.buttons.svelte-n1tx0h{display:flex;justify-content:flex-end}")}function jw(r,e,t){let n=r.slice();return n[24]=e[t],n}function Xw(r,e,t){let n=r.slice();return n[27]=e[t],n}function Gw(r,e,t){let n=r.slice();return n[30]=e[t],n[32]=t,n}function Hw(r){let e,t=(r[30].name??"")+"",n,a,i,o;return{c(){e=_("option"),n=le(t),a=F(),e.__value=i=r[32],Re(e,e.__value),e.selected=o=r[32]==r[0].timespan},m(s,l){$(s,e,l),y(e,n),y(e,a)},p(s,l){l[0]&2&&t!==(t=(s[30].name??"")+"")&&ve(n,t),l[0]&1&&o!==(o=s[32]==s[0].timespan)&&(e.selected=o)},d(s){s&&A(e)}}}function Kw(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p,m,O,b=$e(r[3]),E=[];for(let D=0;Dr[18].call(f)),g(l,"class","after intercalary-field"),g(e,"class","setting-item intercalary-settings svelte-n1tx0h")},m(D,C){$(D,e,C),y(e,t),y(t,n),y(t,i),y(t,o),y(e,s),y(e,l),y(l,u),y(l,c),y(l,f),y(f,d),y(d,h);for(let k=0;kMonth
The leap day will be added to this month.
',o=F(),s=_("div"),l=_("select");for(let S=0;Sr[15].call(l)),g(s,"class","setting-item-control"),g(a,"class","setting-item"),g(e,"class","calendarium-nested-settings"),g(m,"class","buttons svelte-n1tx0h")},m(S,M){$(S,e,M),W(t,e,null),y(e,n),y(e,a),y(a,i),y(a,o),y(a,s),y(s,l);for(let Z=0;Z{let L=new Pf(u,c.interval.length>0,N);L.onClose=()=>{L.saved&&L.condition.interval&&(N?c.interval.splice(c.interval.indexOf(N),1,L.condition):c.interval.push(L.condition),t(0,c))},L.open()},h=N=>{let L=[`${N.interval}`];return N.exclusive&&L.push("(Exclusive)"),N.ignore&&L.push(" - Ignoring offset"),L.join(" ")},p=N=>{new au.ExtraButtonComponent(N).setIcon(Ar)},m=N=>{new au.ExtraButtonComponent(N).setIcon(Lt)},O=N=>{new au.ButtonComponent(N).setButtonText("Cancel").setCta()},b=N=>t(0,c.name=N.detail,c);function E(){c.timespan=Gt(this),t(0,c)}let D=N=>t(0,c.intercalary=!c.intercalary,c),C=()=>t(0,c.numbered=!c.numbered,c);function k(){c.after=Gt(this),t(0,c)}let w=N=>t(0,c.offset=Number(N.detail),c),T=N=>d(N),S=N=>t(0,c.interval=c.interval.filter(L=>L!=N),c),M=()=>d(),Z=()=>l("cancel");return r.$$set=N=>{"app"in N&&t(11,u=N.app),"leapDay"in N&&t(0,c=N.leapDay),"calendar"in N&&t(12,f=N.calendar)},r.$$.update=()=>{r.$$.dirty[0]&1&&t(4,n=c.intercalary),r.$$.dirty[0]&4096&&t(1,a=f.static.months),r.$$.dirty[0]&3&&t(13,i=a[c.timespan]),r.$$.dirty[0]&8192&&t(3,o=i.length?[...Array(i.length).keys()].map(N=>N+1):[]),r.$$.dirty[0]&1&&t(2,s=c.interval.sort((N,L)=>(N.interval??Number.MIN_VALUE)-(L.interval??Number.MIN_VALUE)))},[c,a,s,o,n,l,d,h,p,m,O,u,f,i,b,E,D,C,k,w,T,S,M,Z]}var ng=class extends ae{constructor(e){super(),oe(this,e,kP,CP,re,{app:11,leapDay:0,calendar:12},wP,[-1,-1])}},t5=ng;function EP(r){let e,t,n,a,i,o;return e=new ln({props:{type:"number",name:"Interval",desc:"How often the condition applies.",value:r[0].interval??0,warn:!r[0].interval}}),e.$on("blur",r[2]),n=new er({props:{disabled:!r[1],name:"Exclusive",desc:"If true, the leap day will not apply when the year meets the condition.\\n\\nRequires the leap day to have at least one non-exclusive condition.",value:r[0].exclusive??!1}}),n.$on("click",r[3]),i=new er({props:{name:"Ignore offset",desc:"The condition will ignore the leap day's offset when checking to apply.",value:r[0].ignore??!1}}),i.$on("click",r[4]),{c(){z(e.$$.fragment),t=F(),z(n.$$.fragment),a=F(),z(i.$$.fragment)},m(s,l){W(e,s,l),$(s,t,l),W(n,s,l),$(s,a,l),W(i,s,l),o=!0},p(s,[l]){let u={};l&1&&(u.value=s[0].interval??0),l&1&&(u.warn=!s[0].interval),e.$set(u);let c={};l&2&&(c.disabled=!s[1]),l&1&&(c.value=s[0].exclusive??!1),n.$set(c);let f={};l&1&&(f.value=s[0].ignore??!1),i.$set(f)},i(s){o||(P(e.$$.fragment,s),P(n.$$.fragment,s),P(i.$$.fragment,s),o=!0)},o(s){R(e.$$.fragment,s),R(n.$$.fragment,s),R(i.$$.fragment,s),o=!1},d(s){s&&(A(t),A(a)),Y(e,s),Y(n,s),Y(i,s)}}}function xP(r,e,t){let{canBeExclusive:n=!1}=e,{condition:a}=e,i=l=>t(0,a.interval=l.detail,a),o=()=>n?t(0,a.exclusive=!a.exclusive,a):null,s=()=>t(0,a.ignore=!a.ignore,a);return r.$$set=l=>{"canBeExclusive"in l&&t(1,n=l.canBeExclusive),"condition"in l&&t(0,a=l.condition)},[a,n,i,o,s]}var ag=class extends ae{constructor(e){super(),oe(this,e,xP,EP,re,{canBeExclusive:1,condition:0})}},r5=ag;var Mf=class extends ir{constructor(t,n,a){super(t);this.calendar=n;this.saved=!0;this.leapday={id:Le(6),name:"Leap Day",interval:[],intercalary:!1,timespan:0,offset:0,type:"leapday"};a&&(this.leapday={...this.leapday,...at(a)},this.editing=!0),this.containerEl.addClasses(["calendarium-create-leapday"])}async display(){this.titleEl.setText(this.editing?"Edit leap day":"New leap day"),new t5({target:this.contentEl,props:{leapDay:this.leapday,calendar:this.calendar,app:this.app}}).$on("cancel",()=>{this.saved=!1,this.close()})}async onOpen(){await this.display()}},Pf=class extends ir{constructor(t,n,a){super(t);this.app=t;this.canBeExclusive=n;this.saved=!0;this.editing=!1;this.condition={interval:0,exclusive:!1,ignore:!1};a&&(this.condition={...a},this.editing=!0)}async display(){this.containerEl.addClasses(["calendarium-nested-settings"]),this.contentEl.empty(),this.titleEl.setText("Leap day condition"),new r5({target:this.contentEl,props:{canBeExclusive:this.canBeExclusive,condition:this.condition}}),this.buttonsEl=this.contentEl.createDiv("calendarium-context-buttons setting-item"),new Cs.ButtonComponent(this.buttonsEl).setCta().setButtonText("Cancel").onClick(()=>{this.saved=!1,this.close()})}old(){new Cs.Setting(this.contentEl).setName("Interval").setDesc("How often the condition applies.").addText(t=>{t.inputEl.setAttr("type","number"),t.setValue(`${this.condition.interval}`).onChange(n=>{isNaN(Number(n))||(this.condition.interval=Number(n))})}),new Cs.Setting(this.contentEl).setName("Exclusive").setDesc(`If true, the leap day will not apply when the year meets the condition. Requires the leap day to have at least one non-exclusive condition.`).addToggle(t=>t.setDisabled(!this.canBeExclusive).setValue(this.condition.exclusive??!1).onChange(n=>this.condition.exclusive=n)),new Cs.Setting(this.contentEl).setName("Ignore offset").setDesc("The condition will ignore the leap day's offset when checking to apply.").addToggle(t=>t.setValue(this.condition.ignore??!1).onChange(n=>this.condition.ignore=n))}};var i5=require("obsidian");function n5(r,e,t){let n=r.slice();return n[12]=e[t],n}function SP(r){let e,t,n=$e(r[0]),a=[];for(let o=0;oR(a[o],1,1,()=>{a[o]=null});return{c(){e=_("div");for(let o=0;o{s[f]=null}),_e(),t=s[e],t?t.p(u,c):(t=s[e]=o[e](u),t.c()),P(t,1),t.m(n.parentNode,n));let d={};c&2&&(d.label=u[1]),a.$set(d)},i(u){i||(P(t),P(a.$$.fragment,u),i=!0)},o(u){R(t),R(a.$$.fragment,u),i=!1},d(u){u&&A(n),s[e].d(u),Y(a,u)}}}function TP(r){let e,t;return e=new xt({props:{name:"Leap days",open:i5.Platform.isDesktop,desc:`${r[0].length} leap day${r[0].length!=1?"s":""}`,$$slots:{default:[$P]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&1&&(i.desc=`${n[0].length} leap day${n[0].length!=1?"s":""}`),a&32771&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function NP(r,e,t){let n,a,i,o=Ve("store");ie(r,o,m=>t(10,n=m));let s=Ve("plugin"),{leapDayStore:l,leapDayDisabled:u}=o;ie(r,l,m=>t(0,a=m));let c=de(u,m=>m?"At least one month is required to create a Leap Day":null);ie(r,c,m=>t(1,i=m));let f=m=>{let O=new Mf(s.app,n,m);O.onClose=()=>{O.saved&&O.leapday.interval.length&&O.leapday.name&&(O.editing&&m!=null&&m.id?l.update(m.id,{...O.leapday}):l.add({...O.leapday}))},O.open()};return[a,i,o,l,u,c,f,m=>f(m),m=>l.delete(m.id??""),m=>f({name:m.detail})]}var ig=class extends ae{constructor(e){super(),oe(this,e,NP,TP,re,{})}},o5=ig;var bi=require("obsidian");function PP(r){we(r,"svelte-1c4m78g",".weekday.svelte-1c4m78g.svelte-1c4m78g{display:grid;grid-template-columns:auto 1fr auto;align-items:center;justify-content:space-between;gap:1rem}.weekday.svelte-1c4m78g .icon.svelte-1c4m78g{align-items:center}.weekday.svelte-1c4m78g.svelte-1c4m78g{margin-top:0.5rem}")}function s5(r,e,t){let n=r.slice();return n[21]=e[t],n}function l5(r){let e,t,n,a,i,o=[RP,MP],s=[];function l(u,c){return u[2]?.length?1:0}return e=l(r,-1),t=s[e]=o[e](r),a=new mr({}),a.$on("add",r[17]),{c(){t.c(),n=F(),z(a.$$.fragment)},m(u,c){s[e].m(u,c),$(u,n,c),W(a,u,c),i=!0},p(u,c){let f=e;e=l(u,c),e===f?s[e].p(u,c):(Oe(),R(s[f],1,1,()=>{s[f]=null}),_e(),t=s[e],t?t.p(u,c):(t=s[e]=o[e](u),t.c()),P(t,1),t.m(n.parentNode,n))},i(u){i||(P(t),P(a.$$.fragment,u),i=!0)},o(u){R(t),R(a.$$.fragment,u),i=!1},d(u){u&&A(n),s[e].d(u),Y(a,u)}}}function MP(r){let e,t=[],n=new Map,a,i,o,s=$e(r[2]),l=u=>u[21].id;for(let u=0;u{i=null}),_e())},i(o){a||(P(e.$$.fragment,o),P(i),a=!0)},o(o){R(e.$$.fragment,o),R(i),a=!1},d(o){o&&(A(t),A(n)),Y(e,o),i&&i.d(o)}}}function IP(r){let e,t;return e=new xt({props:{name:"Years",open:bi.Platform.isDesktop,warn:r[1]&&!r[2]?.length,label:"At least one year is required when using custom years",$$slots:{default:[QP]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&6&&(i.warn=n[1]&&!n[2]?.length),a&16777231&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}var og=300;function FP(r,e,t){let n,a,i,o,s=Ve("store"),l=Ve("plugin"),{yearStore:u,staticStore:c,currentStore:f}=s;ie(r,u,S=>t(2,i=S)),ie(r,c,S=>t(18,n=S)),ie(r,f,S=>t(3,o=S));let{customYears:d}=u;ie(r,d,S=>t(1,a=S));let h=S=>{(0,bi.setIcon)(S,$c)},p=(S,M)=>{new bi.ExtraButtonComponent(S).setIcon(Lt).onClick(()=>{let Z=i?.findIndex(N=>N.id===M.id)??0;u.delete(M.id),i?.length&&(Z>0?Ce(f,o.year=Z,o):Ce(f,o.year=1,o))})},m=(S,M)=>{new bi.TextComponent(S).setValue(M.name??"").setPlaceholder("Name").onChange(N=>{M.name=N,u.update(M.id,M)}).inputEl.setAttr("style","width: 100%;")},O=createFragment(S=>(S.createSpan({text:"Create custom years to display instead of incrementing from 1."}),S.createEl("br"),S.createSpan({text:"If on, "}),S.createEl("strong",{text:"only the years added below will be displayed."}),S)),b=async()=>{(!i?.length||a&&await kl(l.app,"The custom years you have created will be removed. Proceed?"))&&u.set([]),c.setProperty("useCustomYears",!n.useCustomYears)};function E(S){S.preventDefault(),t(0,D=!1)}let D=!1;function C(S){let{items:M,info:{source:Z,trigger:N}}=S.detail;u.set(M),Z===Wr.KEYBOARD&&N===Ur.DRAG_STOPPED&&t(0,D=!0)}function k(S){let{items:M,info:{source:Z}}=S.detail;u.set(M),Z===Wr.POINTER&&t(0,D=!0)}return[D,a,i,o,u,c,f,d,h,p,m,O,b,E,C,k,()=>b(),S=>{u.add(S.detail),i?.length===1&&Ce(f,o.year=1,o)}]}var sg=class extends ae{constructor(e){super(),oe(this,e,FP,IP,re,{},PP)}},c5=sg;var Hf=require("obsidian"),Y5=require("@codemirror/view");var B5=require("@codemirror/state"),U5=require("@codemirror/view");var Ss=require("@codemirror/commands");var ZP=0,iu=class{constructor(e,t){this.from=e,this.to=t}},Ut=class{constructor(e={}){this.id=ZP++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=qn.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};Ut.closedBy=new Ut({deserialize:r=>r.split(" ")});Ut.openedBy=new Ut({deserialize:r=>r.split(" ")});Ut.group=new Ut({deserialize:r=>r.split(" ")});Ut.isolate=new Ut({deserialize:r=>{if(r&&r!="rtl"&&r!="ltr"&&r!="auto")throw new RangeError("Invalid value for isolate: "+r);return r||"auto"}});Ut.contextHash=new Ut({perNode:!0});Ut.lookAhead=new Ut({perNode:!0});Ut.mounted=new Ut({perNode:!0});var ks=class{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Ut.mounted.id]}},qP=Object.create(null),qn=class r{constructor(e,t,n,a=0){this.name=e,this.props=t,this.id=n,this.flags=a}static define(e){let t=e.props&&e.props.length?Object.create(null):qP,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),a=new r(e.name||"",t,e.id,n);if(e.props){for(let i of e.props)if(Array.isArray(i)||(i=i(a)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[i[0].id]=i[1]}}return a}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Ut.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let a of n.split(" "))t[a]=e[n];return n=>{for(let a=n.prop(Ut.group),i=-1;i<(a?a.length:0);i++){let o=t[i<0?n.name:a[i]];if(o)return o}}}};qn.none=new qn("",Object.create(null),0,8);var If=class r{constructor(e){this.types=e;for(let t=0;t0;for(let l=this.cursor(o|wr.IncludeAnonymous);;){let u=!1;if(l.from<=i&&l.to>=a&&(!s&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;u=!0}for(;u&&n&&(s||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:pg(qn.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,a)=>new r(this.type,t,n,a,this.propValues),e.makeTree||((t,n,a)=>new r(qn.none,t,n,a)))}static build(e){return BP(e)}};wn.empty=new wn(qn.none,[],[],0);var lg=class r{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new r(this.buffer,this.index)}},vi=class r{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return qn.none}toString(){let e=[];for(let t=0;t0));l=o[l+3]);return s}slice(e,t,n){let a=this.buffer,i=new Uint16Array(t-e),o=0;for(let s=e,l=0;s=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function ou(r,e,t,n){for(var a;r.from==r.to||(t<1?r.from>=e:r.from>e)||(t>-1?r.to<=e:r.to0?s.length:-1;e!=u;e+=t){let c=s[e],f=l[e]+o.from;if(p5(a,n,f,f+c.length)){if(c instanceof vi){if(i&wr.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,t,n-f,a);if(d>-1)return new su(new cg(o,c,e,f),null,d)}else if(i&wr.IncludeAnonymous||!c.type.isAnonymous||hg(c)){let d;if(!(i&wr.IgnoreMounts)&&(d=ks.get(c))&&!d.overlay)return new r(d.tree,f,e,o);let h=new r(c,f,e,o);return i&wr.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(t<0?c.children.length-1:0,t,n,a)}}}if(i&wr.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let a;if(!(n&wr.IgnoreOverlays)&&(a=ks.get(this._tree))&&a.overlay){let i=e-this.from;for(let{from:o,to:s}of a.overlay)if((t>0?o<=i:o=i:s>i))return new r(a.tree,a.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function d5(r,e,t,n){let a=r.cursor(),i=[];if(!a.firstChild())return i;if(t!=null){for(let o=!1;!o;)if(o=a.type.is(t),!a.nextSibling())return i}for(;;){if(n!=null&&a.type.is(n))return i;if(a.type.is(e)&&i.push(a.node),!a.nextSibling())return n==null?i:[]}}function ug(r,e,t=e.length-1){for(let n=r.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}var cg=class{constructor(e,t,n,a){this.parent=e,this.buffer=t,this.index=n,this.start=a}},su=class r extends Ff{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:a}=this.context,i=a.findChild(this.index+4,a.buffer[this.index+3],e,t-this.context.start,n);return i<0?null:new r(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&wr.ExcludeBuffers)return null;let{buffer:a}=this.context,i=a.findChild(this.index+4,a.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return i<0?null:new r(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new r(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new r(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,a=this.index+4,i=n.buffer[this.index+3];if(i>a){let o=n.buffer[this.index+1];e.push(n.slice(a,i,o)),t.push(0)}return new wn(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function m5(r){if(!r.length)return null;let e=0,t=r[0];for(let i=1;it.from||o.to=e){let s=new ma(o.tree,o.overlay[0].from+i.from,-1,i);(a||(a=[n])).push(ou(s,e,t,!1))}}return a?m5(a):n}var lu=class{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof ma)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:a}=this.buffer;return this.type=t||a.set.types[a.buffer[e]],this.from=n+a.buffer[e+1],this.to=n+a.buffer[e+2],!0}yield(e){return e?e instanceof ma?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:a}=this.buffer,i=a.findChild(this.index+4,a.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&wr.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&wr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&wr.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let a=n<0?0:this.stack[n]+4;if(this.index!=a)return this.yieldBuf(t.findChild(a,this.index,-1,0,4))}else{let a=t.buffer[this.index+3];if(a<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(a)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:a}=this;if(a){if(e>0){if(this.index-1)for(let i=t+e,o=e<0?-1:n._tree.children.length;i!=o;i+=e){let s=n._tree.children[i];if(this.mode&wr.IncludeAnonymous||s instanceof vi||!s.type.isAnonymous||hg(s))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==a){if(a==this.index)return o;t=o,n=i+1;break e}a=this.stack[--i]}for(let a=n;a=0;i--){if(i<0)return ug(this.node,e,a);let o=n[t.buffer[this.stack[i]]];if(!o.isAnonymous){if(e[a]&&e[a]!=o.name)return!1;a--}}return!0}};function hg(r){return r.children.some(e=>e instanceof vi||!e.type.isAnonymous||hg(e))}function BP(r){var e;let{buffer:t,nodeSet:n,maxBufferLength:a=1024,reused:i=[],minRepeatType:o=n.types.length}=r,s=Array.isArray(t)?new lg(t,t.length):t,l=n.types,u=0,c=0;function f(k,w,T,S,M,Z){let{id:N,start:L,end:j,size:X}=s,fe=c;for(;X<0;)if(s.next(),X==-1){let ue=i[N];T.push(ue),S.push(L-k);return}else if(X==-3){u=N;return}else if(X==-4){c=N;return}else throw new RangeError(`Unrecognized record size: ${X}`);let ee=l[N],te,ge,he=L-k;if(j-L<=a&&(ge=O(s.pos-w,M))){let ue=new Uint16Array(ge.size-ge.skip),xe=s.pos-ge.size,Pe=ue.length;for(;s.pos>xe;)Pe=b(ge.start,ue,Pe);te=new vi(ue,j-ge.start,n),he=ge.start-k}else{let ue=s.pos-X;s.next();let xe=[],Pe=[],Ye=N>=o?N:-1,it=0,Be=j;for(;s.pos>ue;)Ye>=0&&s.id==Ye&&s.size>=0?(s.end<=Be-a&&(p(xe,Pe,L,it,s.end,Be,Ye,fe),it=xe.length,Be=s.end),s.next()):Z>2500?d(L,ue,xe,Pe):f(L,ue,xe,Pe,Ye,Z+1);if(Ye>=0&&it>0&&it-1&&it>0){let st=h(ee);te=pg(ee,xe,Pe,0,xe.length,0,j-L,st,st)}else te=m(ee,xe,Pe,j-L,fe-j)}T.push(te),S.push(he)}function d(k,w,T,S){let M=[],Z=0,N=-1;for(;s.pos>w;){let{id:L,start:j,end:X,size:fe}=s;if(fe>4)s.next();else{if(N>-1&&j=0;X-=3)L[fe++]=M[X],L[fe++]=M[X+1]-j,L[fe++]=M[X+2]-j,L[fe++]=fe;T.push(new vi(L,M[2]-j,n)),S.push(j-k)}}function h(k){return(w,T,S)=>{let M=0,Z=w.length-1,N,L;if(Z>=0&&(N=w[Z])instanceof wn){if(!Z&&N.type==k&&N.length==S)return N;(L=N.prop(Ut.lookAhead))&&(M=T[Z]+N.length+L)}return m(k,w,T,S,M)}}function p(k,w,T,S,M,Z,N,L){let j=[],X=[];for(;k.length>S;)j.push(k.pop()),X.push(w.pop()+T-M);k.push(m(n.types[N],j,X,Z-M,L-Z)),w.push(M-T)}function m(k,w,T,S,M=0,Z){if(u){let N=[Ut.contextHash,u];Z=Z?[N].concat(Z):[N]}if(M>25){let N=[Ut.lookAhead,M];Z=Z?[N].concat(Z):[N]}return new wn(k,w,T,S,Z)}function O(k,w){let T=s.fork(),S=0,M=0,Z=0,N=T.end-a,L={size:0,start:0,skip:0};e:for(let j=T.pos-k;T.pos>j;){let X=T.size;if(T.id==w&&X>=0){L.size=S,L.start=M,L.skip=Z,Z+=4,S+=4,T.next();continue}let fe=T.pos-X;if(X<0||fe=o?4:0,te=T.start;for(T.next();T.pos>fe;){if(T.size<0)if(T.size==-3)ee+=4;else break e;else T.id>=o&&(ee+=4);T.next()}M=te,S+=X,Z+=ee}return(w<0||S==k)&&(L.size=S,L.start=M,L.skip=Z),L.size>4?L:void 0}function b(k,w,T){let{id:S,start:M,end:Z,size:N}=s;if(s.next(),N>=0&&S4){let j=s.pos-(N-4);for(;s.pos>j;)T=b(k,w,T)}w[--T]=L,w[--T]=Z-k,w[--T]=M-k,w[--T]=S}else N==-3?u=S:N==-4&&(c=S);return T}let E=[],D=[];for(;s.pos>0;)f(r.start||0,r.bufferStart||0,E,D,-1,0);let C=(e=r.length)!==null&&e!==void 0?e:E.length?D[0]+E[0].length:0;return new wn(l[r.topID],E.reverse(),D.reverse(),C)}var h5=new WeakMap;function Qf(r,e){if(!r.isAnonymous||e instanceof vi||e.type!=r)return 1;let t=h5.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=r||!(n instanceof wn)){t=1;break}t+=Qf(r,n)}h5.set(e,t)}return t}function pg(r,e,t,n,a,i,o,s,l){let u=0;for(let p=n;p=c)break;w+=T}if(D==C+1){if(w>c){let T=p[C];h(T.children,T.positions,0,T.children.length,m[C]+E);continue}f.push(p[C])}else{let T=m[D-1]+p[D-1].length-k;f.push(pg(r,p,m,C,D,k,T,null,l))}d.push(k+E-i)}}return h(e,t,n,a,0),(s||l)(f,d,o)}var Zf=class{startParse(e,t,n){return typeof e=="string"&&(e=new dg(e)),n=n?n.length?n.map(a=>new iu(a.from,a.to)):[new iu(0,0)]:[new iu(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let a=this.startParse(e,t,n);for(;;){let i=a.advance();if(i)return i}}},dg=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};var _K=new Ut({perNode:!0});var yg=class r{constructor(e,t,n,a,i,o,s,l,u,c=0,f){this.p=e,this.stack=t,this.state=n,this.reducePos=a,this.pos=i,this.score=o,this.buffer=s,this.bufferBase=l,this.curContext=u,this.lookAhead=c,this.parent=f}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let a=e.parser.context;return new r(e,[],t,n,n,0,[],0,a?new qf(a,a.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,a=e&65535,{parser:i}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[a])===null||t===void 0)&&t.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(a,u)}storeNode(e,t,n,a=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[s-4]==0&&o.buffer[s-1]>-1){if(t==n)return;if(o.buffer[s-2]>=t){o.buffer[s-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,a);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0){let s=!1;for(let l=o;l>0&&this.buffer[l-2]>n;l-=4)if(this.buffer[l-1]>=0){s=!0;break}if(s)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,a>4&&(a-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=a}}shift(e,t,n,a){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=a,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,a,4);else{let i=e,{parser:o}=this.p;(a>this.pos||t<=o.maxNode)&&(this.pos=a,o.stateFlag(i,1)||(this.reducePos=a)),this.pushState(i,n),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,a,4)}}apply(e,t,n,a){e&65536?this.reduce(e):this.shift(e,t,n,a)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let a=this.pos;this.reducePos=this.pos=a+e.length,this.pushState(t,a),this.buffer.push(n,a,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),a=e.bufferBase+t;for(;e&&a==e.bufferBase;)e=e.parent;return new r(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,a,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new bg(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let a=[];for(let i=0,o;il&1&&s==o)||a.push(t[i],o)}t=a}let n=[];for(let a=0;a>19,a=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],a,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(a,i)=>{if(!t.includes(a))return t.push(a),e.allActions(a,o=>{if(!(o&393216))if(o&65536){let s=(o>>19)-i;if(s>1){let l=o&65535,u=this.stack.length-s*3;if(u>=0&&e.getGoto(this.stack[u],l,!1)>=0)return s<<19|65536|l}}else{let s=n(o,i+1);if(s!=null)return s}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},qf=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},bg=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let a=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=a}},vg=class r{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new r(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new r(this.stack,this.pos,this.index)}};function uu(r,e=Uint16Array){if(typeof r!="string")return r;let t=null;for(let n=0,a=0;n=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,s=!0),i+=l,s)break;i*=46}t?t[a++]=i:t=new e(i)}return t}var Es=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},g5=new Es,Og=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=g5,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,a=this.rangeIndex,i=this.pos+e;for(;in.to:i>=n.to;){if(a==this.ranges.length-1)return null;let o=this.ranges[++a];i+=o.from-n.to,n=o}return i}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,a;if(t>=0&&t=this.chunk2Pos&&ns.to&&(this.chunk2=this.chunk2.slice(0,s.to-n)),a=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),a}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=g5,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let a of this.ranges){if(a.from>=t)break;a.to>e&&(n+=this.input.read(Math.max(a.from,e),Math.min(a.to,t)))}return n}},Oi=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;_5(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};Oi.prototype.contextual=Oi.prototype.fallback=Oi.prototype.extend=!1;var xs=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?uu(e):e}token(e,t){let n=e.pos,a=0;for(;;){let i=e.next<0,o=e.resolveOffset(1,1);if(_5(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(i||a++,o==null)break;e.reset(o,e.token)}a&&(e.reset(n,e.token),e.acceptToken(this.elseToken,a))}};xs.prototype.contextual=Oi.prototype.fallback=Oi.prototype.extend=!1;var ro=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function _5(r,e,t,n,a,i){let o=0,s=1<0){let p=r[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||WP(p,e.token.value,a,i))){e.acceptToken(p);break}}let c=e.next,f=0,d=r[o+2];if(e.next<0&&d>f&&r[u+d*3-3]==65535){o=r[u+d*3-1];continue e}for(;f>1,p=u+h+(h<<1),m=r[p],O=r[p+1]||65536;if(c=O)f=h+1;else{o=r[p+2],e.advance();continue e}}break}}function y5(r,e,t){for(let n=e,a;(a=r[n])!=65535;n++)if(a==t)return n-e;return-1}function WP(r,e,t,n){let a=y5(t,n,e);return a<0||y5(t,n,r)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(r.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:r.length}}var _g=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?b5(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?b5(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(i instanceof wn){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+i.length}}},wg=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Es)}getActions(e){let t=0,n=null,{parser:a}=e.p,{tokenizers:i}=a,o=a.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,l=0;for(let u=0;uf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!c.extend&&(n=f,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new Es,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Es,{pos:n,p:a}=e;return t.start=n,t.end=Math.min(n+1,a.stream.end),t.value=n==a.stream.end?a.parser.eofTerm:0,t}updateCachedToken(e,t,n){let a=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(a,e),n),e.value>-1){let{parser:i}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(s>>1)){s&1?e.extended=s>>1:e.value=s>>1;break}}}else e.value=0,e.end=this.stream.clipPos(a+1)}putAction(e,t,n,a){for(let i=0;ie.bufferLength*4?new _g(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],a,i;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)n.push(s);else{if(this.advanceStack(s,n,e))continue;{a||(a=[],i=[]),a.push(s);let l=this.tokens.getMainToken(s);i.push(l.value,l.end)}}break}}if(!n.length){let o=a&&YP(a);if(o)return Tn&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Tn&&a&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&a){let o=this.stoppedAt!=null&&a[0].pos>this.stoppedAt?a[0]:this.runRecovery(a,i,n);if(o)return Tn&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((s,l)=>l.score-s.score);n.length>o;)n.pop();n.some(s=>s.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((s.score-u.score||s.buffer.length-u.buffer.length)>0)n.splice(l--,1);else{n.splice(o--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&a>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,c=u?e.curContext.hash:0;for(let f=this.fragments.nodeAt(a);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?i.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!u||(f.prop(Ut.contextHash)||0)==c))return e.useNode(f,d),Tn&&console.log(o+this.stackID(e)+` (via reuse of ${i.getName(f.type.id)})`),!0;if(!(f instanceof wn)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof wn&&f.positions[0]==0)f=h;else break}}let s=i.stateSlot(e.state,4);if(s>0)return e.reduce(s),Tn&&console.log(o+this.stackID(e)+` (via always-reduce ${i.getName(s&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let u=0;ua?t.push(p):n.push(p)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return v5(e,t),!0}}runRecovery(e,t,n){let a=null,i=!1;for(let o=0;o ":"";if(s.deadEnd&&(i||(i=!0,s.restart(),Tn&&console.log(c+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))))continue;let f=s.split(),d=c;for(let h=0;f.forceReduce()&&h<10&&(Tn&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,n));h++)Tn&&(d=this.stackID(f)+" -> ");for(let h of s.recoverByInsert(l))Tn&&console.log(c+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,n);this.stream.end>s.pos?(u==s.pos&&(u++,l=0),s.recoverByDelete(l,u),Tn&&console.log(c+this.stackID(s)+` (via recover-delete ${this.parser.getName(l)})`),v5(s,n)):(!a||a.scorer,Lf=class{constructor(e){this.start=e.start,this.shift=e.shift||gg,this.reduce=e.reduce||gg,this.reuse=e.reuse||gg,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},Bf=class r extends Zf{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let s=0;se.topRules[s][1]),a=[];for(let s=0;s=0)i(c,l,s[u++]);else{let f=s[u+-c];for(let d=-c;d>0;d--)i(s[u++],l,f);u++}}}this.nodeSet=new If(t.map((s,l)=>qn.define({name:l>=this.minRepeatTerm?void 0:s,id:l,props:a[l],top:n.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=uu(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let s=0;stypeof s=="number"?new Oi(o,s):s),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let a=new Dg(this,e,t,n);for(let i of this.wrappers)a=i(a,e,t,n);return a}getGoto(e,t,n=!1){let a=this.goto;if(t>=a[0])return-1;for(let i=a[t+1];;){let o=a[i++],s=o&1,l=a[i++];if(s&&n)return l;for(let u=i+(o>>1);i0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),a=n?t(n):void 0;for(let i=this.stateSlot(e,1);a==null;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Ya(this.data,i+2);else break;a=t(Ya(this.data,i+1))}return a}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=Ya(this.data,n+2);else break;if(!(this.data[n+2]&1)){let a=this.data[n+1];t.some((i,o)=>o&1&&i==a)||t.push(this.data[n],a)}}return t}configure(e){let t=Object.assign(Object.create(r.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let a=e.tokenizers.find(i=>i.from==n);return a?a.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,a)=>{let i=e.specializers.find(s=>s.from==n.external);if(!i)return n;let o=Object.assign(Object.assign({},n),{external:i.to});return t.specializers[a]=O5(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let i of e.split(" ")){let o=t.indexOf(i);o>=0&&(n[o]=!0)}let a=null;for(let i=0;in)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorer.external(t,n)<<1|e}return r.get}var zP=0,na=class r{constructor(e,t,n,a){this.name=e,this.set=t,this.base=n,this.modified=a,this.id=zP++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof r&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let a=new r(n,[],null,[]);if(a.set.push(a),t)for(let i of t.set)a.set.push(i);return a}static defineModifier(e){let t=new zf(e);return n=>n.modified.indexOf(t)>-1?n:zf.get(n.base||n,n.modified.concat(t).sort((a,i)=>a.id-i.id))}},VP=0,zf=class r{constructor(e){this.name=e,this.instances=[],this.id=VP++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(s=>s.base==e&&jP(t,s.modified));if(n)return n;let a=[],i=new na(e.name,a,e,t);for(let s of t)s.instances.push(i);let o=XP(t);for(let s of e.set)if(!s.modified.length)for(let l of o)a.push(r.get(s,l));return i}};function jP(r,e){return r.length==e.length&&r.every((t,n)=>t==e[n])}function XP(r){let e=[[]];for(let t=0;tn.length-t.length)}function C5(r){let e=Object.create(null);for(let t in r){let n=r[t];Array.isArray(n)||(n=[n]);for(let a of t.split(" "))if(a){let i=[],o=2,s=a;for(let f=0;;){if(s=="..."&&f>0&&f+3==a.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!d)throw new RangeError("Invalid path: "+a);if(i.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==a.length)break;let h=a[f++];if(f==a.length&&h=="!"){o=0;break}if(h!="/")throw new RangeError("Invalid path: "+a);s=a.slice(f)}let l=i.length-1,u=i[l];if(!u)throw new RangeError("Invalid path: "+a);let c=new fu(n,o,l>0?i.slice(0,l):null);e[u]=c.sort(e[u])}}return GP.add(e)}var GP=new Ut,fu=class{constructor(e,t,n,a){this.tags=e,this.mode=t,this.context=n,this.next=a}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=a;for(let s of i)for(let l of s.set){let u=t[l.id];if(u){o=o?o+" "+u:u;break}}return o},scope:n}}var Qe=na.define,Uf=Qe(),_i=Qe(),w5=Qe(_i),D5=Qe(_i),wi=Qe(),Wf=Qe(wi),kg=Qe(wi),ba=Qe(),no=Qe(ba),ga=Qe(),ya=Qe(),Eg=Qe(),cu=Qe(Eg),Yf=Qe(),K={comment:Uf,lineComment:Qe(Uf),blockComment:Qe(Uf),docComment:Qe(Uf),name:_i,variableName:Qe(_i),typeName:w5,tagName:Qe(w5),propertyName:D5,attributeName:Qe(D5),className:Qe(_i),labelName:Qe(_i),namespace:Qe(_i),macroName:Qe(_i),literal:wi,string:Wf,docString:Qe(Wf),character:Qe(Wf),attributeValue:Qe(Wf),number:kg,integer:Qe(kg),float:Qe(kg),bool:Qe(wi),regexp:Qe(wi),escape:Qe(wi),color:Qe(wi),url:Qe(wi),keyword:ga,self:Qe(ga),null:Qe(ga),atom:Qe(ga),unit:Qe(ga),modifier:Qe(ga),operatorKeyword:Qe(ga),controlKeyword:Qe(ga),definitionKeyword:Qe(ga),moduleKeyword:Qe(ga),operator:ya,derefOperator:Qe(ya),arithmeticOperator:Qe(ya),logicOperator:Qe(ya),bitwiseOperator:Qe(ya),compareOperator:Qe(ya),updateOperator:Qe(ya),definitionOperator:Qe(ya),typeOperator:Qe(ya),controlOperator:Qe(ya),punctuation:Eg,separator:Qe(Eg),bracket:cu,angleBracket:Qe(cu),squareBracket:Qe(cu),paren:Qe(cu),brace:Qe(cu),content:ba,heading:no,heading1:Qe(no),heading2:Qe(no),heading3:Qe(no),heading4:Qe(no),heading5:Qe(no),heading6:Qe(no),contentSeparator:Qe(ba),list:Qe(ba),quote:Qe(ba),emphasis:Qe(ba),strong:Qe(ba),link:Qe(ba),monospace:Qe(ba),strikethrough:Qe(ba),inserted:Qe(),deleted:Qe(),changed:Qe(),invalid:Qe(),meta:Yf,documentMeta:Qe(Yf),annotation:Qe(Yf),processingInstruction:Qe(Yf),definition:na.defineModifier("definition"),constant:na.defineModifier("constant"),function:na.defineModifier("function"),standard:na.defineModifier("standard"),local:na.defineModifier("local"),special:na.defineModifier("special")};for(let r in K){let e=K[r];e instanceof na&&(e.name=r)}var EK=HP([{tag:K.link,class:"tok-link"},{tag:K.heading,class:"tok-heading"},{tag:K.emphasis,class:"tok-emphasis"},{tag:K.strong,class:"tok-strong"},{tag:K.keyword,class:"tok-keyword"},{tag:K.atom,class:"tok-atom"},{tag:K.bool,class:"tok-bool"},{tag:K.url,class:"tok-url"},{tag:K.labelName,class:"tok-labelName"},{tag:K.inserted,class:"tok-inserted"},{tag:K.deleted,class:"tok-deleted"},{tag:K.literal,class:"tok-literal"},{tag:K.string,class:"tok-string"},{tag:K.number,class:"tok-number"},{tag:[K.regexp,K.escape,K.special(K.string)],class:"tok-string2"},{tag:K.variableName,class:"tok-variableName"},{tag:K.local(K.variableName),class:"tok-variableName tok-local"},{tag:K.definition(K.variableName),class:"tok-variableName tok-definition"},{tag:K.special(K.variableName),class:"tok-variableName2"},{tag:K.definition(K.propertyName),class:"tok-propertyName tok-definition"},{tag:K.typeName,class:"tok-typeName"},{tag:K.namespace,class:"tok-namespace"},{tag:K.className,class:"tok-className"},{tag:K.macroName,class:"tok-macroName"},{tag:K.propertyName,class:"tok-propertyName"},{tag:K.operator,class:"tok-operator"},{tag:K.comment,class:"tok-comment"},{tag:K.meta,class:"tok-meta"},{tag:K.invalid,class:"tok-invalid"},{tag:K.punctuation,class:"tok-punctuation"}]);var KP=312,k5=1,JP=2,eM=3,tM=4,rM=313,nM=315,aM=316,iM=5,oM=6,sM=0,Sg=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],E5=125,lM=59,Ag=47,uM=42,cM=43,fM=45,dM=60,hM=44,pM=63,mM=46,gM=new Lf({start:!1,shift(r,e){return e==iM||e==oM||e==nM?r:e==aM},strict:!1}),yM=new ro((r,e)=>{let{next:t}=r;(t==E5||t==-1||e.context)&&r.acceptToken(rM)},{contextual:!0,fallback:!0}),bM=new ro((r,e)=>{let{next:t}=r,n;Sg.indexOf(t)>-1||t==Ag&&((n=r.peek(1))==Ag||n==uM)||t!=E5&&t!=lM&&t!=-1&&!e.context&&r.acceptToken(KP)},{contextual:!0}),vM=new ro((r,e)=>{let{next:t}=r;if(t==cM||t==fM){if(r.advance(),t==r.next){r.advance();let n=!e.context&&e.canShift(k5);r.acceptToken(n?k5:JP)}}else t==pM&&r.peek(1)==mM&&(r.advance(),r.advance(),(r.next<48||r.next>57)&&r.acceptToken(eM))},{contextual:!0});function xg(r,e){return r>=65&&r<=90||r>=97&&r<=122||r==95||r>=192||!e&&r>=48&&r<=57}var OM=new ro((r,e)=>{if(r.next!=dM||!e.dialectEnabled(sM)||(r.advance(),r.next==Ag))return;let t=0;for(;Sg.indexOf(r.next)>-1;)r.advance(),t++;if(xg(r.next,!0)){for(r.advance(),t++;xg(r.next,!1);)r.advance(),t++;for(;Sg.indexOf(r.next)>-1;)r.advance(),t++;if(r.next==hM)return;for(let n=0;;n++){if(n==7){if(!xg(r.next,!0))return;break}if(r.next!="extends".charCodeAt(n))break;r.advance(),t++}}r.acceptToken(tM,-t)}),_M=C5({"get set async static":K.modifier,"for while do if else switch try catch finally return throw break continue default case":K.controlKeyword,"in of await yield void typeof delete instanceof":K.operatorKeyword,"let var const using function class extends":K.definitionKeyword,"import export from":K.moduleKeyword,"with debugger as new":K.keyword,TemplateString:K.special(K.string),super:K.atom,BooleanLiteral:K.bool,this:K.self,null:K.null,Star:K.modifier,VariableName:K.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":K.function(K.variableName),VariableDefinition:K.definition(K.variableName),Label:K.labelName,PropertyName:K.propertyName,PrivatePropertyName:K.special(K.propertyName),"CallExpression/MemberExpression/PropertyName":K.function(K.propertyName),"FunctionDeclaration/VariableDefinition":K.function(K.definition(K.variableName)),"ClassDeclaration/VariableDefinition":K.definition(K.className),PropertyDefinition:K.definition(K.propertyName),PrivatePropertyDefinition:K.definition(K.special(K.propertyName)),UpdateOp:K.updateOperator,"LineComment Hashbang":K.lineComment,BlockComment:K.blockComment,Number:K.number,String:K.string,Escape:K.escape,ArithOp:K.arithmeticOperator,LogicOp:K.logicOperator,BitOp:K.bitwiseOperator,CompareOp:K.compareOperator,RegExp:K.regexp,Equals:K.definitionOperator,Arrow:K.function(K.punctuation),": Spread":K.punctuation,"( )":K.paren,"[ ]":K.squareBracket,"{ }":K.brace,"InterpolationStart InterpolationEnd":K.special(K.brace),".":K.derefOperator,", ;":K.separator,"@":K.meta,TypeName:K.typeName,TypeDefinition:K.definition(K.typeName),"type enum interface implements namespace module declare":K.definitionKeyword,"abstract global Privacy readonly override":K.modifier,"is keyof unique infer":K.operatorKeyword,JSXAttributeValue:K.attributeValue,JSXText:K.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":K.angleBracket,"JSXIdentifier JSXNameSpacedName":K.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":K.attributeName,"JSXBuiltin/JSXIdentifier":K.standard(K.tagName)}),wM={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},DM={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},CM={__proto__:null,"<":187},x5=Bf.deserialize({version:14,states:"$@QO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ?NdO'#CiO+RO!bO'#CjO+aO#tO'#CjO+oO!0LbO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DwO0fQ^O'#EPOOQ?Mr'#EX'#EXO1PQWO'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQWO'#GpO1dQWO'#ElO1iQWO'#ElO3hQ?NdO'#JmO6[Q?NdO'#JnO6uQWO'#F[O6zQ&jO'#FsOOQ?Mr'#Fe'#FeO7VO,YO'#FeO7eQ7[O'#FzO9RQWO'#FyOOQ?Mr'#Jn'#JnOOQ?Mp'#Jm'#JmO9WQWO'#GtOOQU'#KZ'#KZO9cQWO'#IUO9hQ?MxO'#IVOOQU'#JZ'#JZOOQU'#IZ'#IZQ`Q^OOO`Q^OOO9pQMnO'#DsO9wQ^O'#D{O:OQ^O'#D}O9^QWO'#GpO:VQ7[O'#CoO:eQWO'#EkO:pQWO'#EvO:uQ7[O'#FdO;dQWO'#GpOOQO'#K['#K[O;iQWO'#K[O;wQWO'#GxO;wQWO'#GyO;wQWO'#G{O9^QWO'#HOOVQWO'#CeO>gQWO'#H_O>oQWO'#HeO>oQWO'#HgO`Q^O'#HiO>oQWO'#HkO>oQWO'#HnO>tQWO'#HtO>yQ?MyO'#HzO%[Q^O'#H|O?UQ?MyO'#IOO?aQ?MyO'#IQO9hQ?MxO'#ISO?lQ?NdO'#CiO@nQ`O'#DiQOQWOOO%[Q^O'#D}OAUQWO'#EQO:VQ7[O'#EkOAaQWO'#EkOAlQpO'#FdOOQU'#Cg'#CgOOQ?Mp'#Dn'#DnOOQ?Mp'#Jq'#JqO%[Q^O'#JqOOQO'#Jt'#JtOOQO'#Id'#IdOBlQ`O'#EdOOQ?Mp'#Ec'#EcOOQ?Mp'#Jx'#JxOChQ?NQO'#EdOCrQ`O'#ETOOQO'#Js'#JsODWQ`O'#JtOEeQ`O'#ETOCrQ`O'#EdPErO#@ItO'#CbPOOO)CDx)CDxOOOO'#I['#I[OE}O!bO,59UOOQ?Mr,59U,59UOOOO'#I]'#I]OF]O#tO,59UO%[Q^O'#D`OOOO'#I_'#I_OFkO!0LbO,59xOOQ?Mr,59x,59xOFyQ^O'#I`OG^QWO'#JoOI]QrO'#JoO+}Q^O'#JoOIdQWO,5:OOIzQWO'#EmOJXQWO'#KOOJdQWO'#J}OJdQWO'#J}OJlQWO,5;ZOJqQWO'#J|OOQ?Mv,5:Z,5:ZOJxQ^O,5:ZOLvQ?NdO,5:cOMgQWO,5:kONQQ?MxO'#J{ONXQWO'#JzO9WQWO'#JzONmQWO'#JzONuQWO,5;YONzQWO'#JzO!#PQrO'#JnOOQ?Mr'#Ci'#CiO%[Q^O'#EPO!#oQrO,5:pOOQQ'#Ju'#JuOOQO-EpOOQU'#Jc'#JcOOQU,5>q,5>qOOQU-EtQWO'#HTO9^QWO'#HVO!DgQWO'#HVO:VQ7[O'#HXO!DlQWO'#HXOOQU,5=m,5=mO!DqQWO'#HYO!ESQWO'#CoO!EXQWO,59PO!EcQWO,59PO!GhQ^O,59POOQU,59P,59PO!GxQ?MxO,59PO%[Q^O,59PO!JTQ^O'#HaOOQU'#Hb'#HbOOQU'#Hc'#HcO`Q^O,5=yO!JkQWO,5=yO`Q^O,5>PO`Q^O,5>RO!JpQWO,5>TO`Q^O,5>VO!JuQWO,5>YO!JzQ^O,5>`OOQU,5>f,5>fO%[Q^O,5>fO9hQ?MxO,5>hOOQU,5>j,5>jO# UQWO,5>jOOQU,5>l,5>lO# UQWO,5>lOOQU,5>n,5>nO# rQ`O'#D[O%[Q^O'#JqO# |Q`O'#JqO#!kQ`O'#DjO#!|Q`O'#DjO#%_Q^O'#DjO#%fQWO'#JpO#%nQWO,5:TO#%sQWO'#EqO#&RQWO'#KPO#&ZQWO,5;[O#&`Q`O'#DjO#&mQ`O'#ESOOQ?Mr,5:l,5:lO%[Q^O,5:lO#&tQWO,5:lO>tQWO,5;VO!A}Q`O,5;VO!BVQ7[O,5;VO:VQ7[O,5;VO#&|QWO,5@]O#'RQ(CYO,5:pOOQO-EzO+}Q^O,5>zOOQO,5?Q,5?QO#*ZQ^O'#I`OOQO-E<^-E<^O#*hQWO,5@ZO#*pQrO,5@ZO#*wQWO,5@iOOQ?Mr1G/j1G/jO%[Q^O,5@jO#+PQWO'#IfOOQO-EuQ?NdO1G0|O#>|Q?NdO1G0|O#AZQ07bO'#CiO#CUQ07bO1G1_O#C]Q07bO'#JnO#CpQ?NdO,5?WOOQ?Mp-EoQWO1G3oO$3VQ^O1G3qO$7ZQ^O'#HpOOQU1G3t1G3tO$7hQWO'#HvO>tQWO'#HxOOQU1G3z1G3zO$7pQ^O1G3zO9hQ?MxO1G4QOOQU1G4S1G4SOOQ?Mp'#G]'#G]O9hQ?MxO1G4UO9hQ?MxO1G4WO$;wQWO,5@]O!(oQ^O,5;]O9WQWO,5;]O>tQWO,5:UO!(oQ^O,5:UO!A}Q`O,5:UO$;|Q07bO,5:UOOQO,5;],5;]O$tQWO1G0qO!A}Q`O1G0qO!BVQ7[O1G0qOOQ?Mp1G5w1G5wO!ArQ?MxO1G0ZOOQO1G0j1G0jO%[Q^O1G0jO$=aQ?MxO1G0jO$=lQ?MxO1G0jO!A}Q`O1G0ZOCrQ`O1G0ZO$=zQ?MxO1G0jOOQO1G0Z1G0ZO$>`Q?NdO1G0jPOOO-EjQpO,5rQrO1G4fOOQO1G4l1G4lO%[Q^O,5>zO$>|QWO1G5uO$?UQWO1G6TO$?^QrO1G6UO9WQWO,5?QO$?hQ?NdO1G6RO%[Q^O1G6RO$?xQ?MxO1G6RO$@ZQWO1G6QO$@ZQWO1G6QO9WQWO1G6QO$@cQWO,5?TO9WQWO,5?TOOQO,5?T,5?TO$@wQWO,5?TO$(PQWO,5?TOOQO-E[OOQU,5>[,5>[O%[Q^O'#HqO%8mQWO'#HsOOQU,5>b,5>bO9WQWO,5>bOOQU,5>d,5>dOOQU7+)f7+)fOOQU7+)l7+)lOOQU7+)p7+)pOOQU7+)r7+)rO%8rQ`O1G5wO%9WQ07bO1G0wO%9bQWO1G0wOOQO1G/p1G/pO%9mQ07bO1G/pO>tQWO1G/pO!(oQ^O'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQWO7+&]O!A}Q`O7+&]OOQO7+%u7+%uO$>`Q?NdO7+&UOOQO7+&U7+&UO%[Q^O7+&UO%9wQ?MxO7+&UO!ArQ?MxO7+%uO!A}Q`O7+%uO%:SQ?MxO7+&UO%:bQ?NdO7++mO%[Q^O7++mO%:rQWO7++lO%:rQWO7++lOOQO1G4o1G4oO9WQWO1G4oO%:zQWO1G4oOOQQ7+%z7+%zO#&wQWO<|O%[Q^O,5>|OOQO-E<`-E<`O%FwQWO1G5xOOQ?Mr<]OOQU,5>_,5>_O&8uQWO1G3|O9WQWO7+&cO!(oQ^O7+&cOOQO7+%[7+%[O&8zQ07bO1G6UO>tQWO7+%[OOQ?Mr<tQWO<`Q?NdO<pQ?NdO,5?_O&@xQ?NdO7+'zO&CWQrO1G4hO&CbQ07bO7+&^O&EcQ07bO,5=UO&GgQ07bO,5=WO&GwQ07bO,5=UO&HXQ07bO,5=WO&HiQ07bO,59rO&JlQ07bO,5tQWO7+)hO'(OQWO<`Q?NdOAN?[OOQOAN>{AN>{O%[Q^OAN?[OOQO<`Q?NdOG24vO#&wQWOLD,nOOQULD,nLD,nO!&_Q7[OLD,nO'5TQrOLD,nO'5[Q07bO7+'xO'6}Q07bO,5?]O'8}Q07bO,5?_O':}Q07bO7+'zO'kOh%VOk+aO![']O%f+`O~O!d+cOa(WX![(WX'u(WX!Y(WX~Oa%lO![XO'u%lO~Oh%VO!i%cO~Oh%VO!i%cO(O%eO~O!d#vO#h(tO~Ob+nO%g+oO(O+kO(QTO(TUO!Z)TP~O!Y+pO`)SX~O[+tO~O`+uO~O![%}O(O%eO(P!lO`)SP~Oh%VO#]+zO~Oh%VOk+}O![$|O~O![,PO~O},RO![XO~O%k%tO~O!u,WO~Oe,]O~Ob,^O(O#nO(QTO(TUO!Z)RP~Oe%{O~O%g!QO(O&WO~P=RO[,cO`,bO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(QTO(TUO([VO(j[O(yiO~O![!eO!r!gO$V!kO(O!dO~P!EkO`,bOa%lO'u%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(O!dO(QTO(TUO([VO(j[O(yiO~Oa,hO!rwO#t!OO%i!OO%j!OO%k!OO~P!HTO!i&lO~O&Y,nO~O![,pO~O&k,rO&m,sOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(O&ha(Q&ha(T&ha([&ha(j&ha(y&ha!Z&ha&a&hab&ha&f&ha~O(O,xO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# ZO!d,}O#],|Oh(eX!Y#eX!Y(eX!Z#eX!Z(eX!d(eX!i(eX~Oh%VO!d-PO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(QTO(TUO(`!mO~OP;POQ;POSfOdkOg'XX!Y'XX~P!+hO!Y.wOg(ka~OSfO![3uO$c3vO~O!Z3zO~Os3{O~P#.aOa$lq!Y$lq'u$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9mO!V3|O~P#.aO})zO!P){O(u%POk'ea(t'ea!Y'ea#]'ea~Og'ea#}'ea~P%)nO})zO!P){Ok'ga(t'ga(u'ga!Y'ga#]'ga~Og'ga#}'ga~P%*aO(m$YO~P#.aO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/gO(OQ#>g#@V#@e#@l#BR#Ba#C|#D[#Db#Dh#Dn#Dx#EO#EU#E`#Er#ExPPPPPPPPPP#FOPPPPPPP#Fs#Iz#KZ#Kb#KjPPP$!sP$!|$%t$,^$,a$,d$-P$-S$-Z$-cP$-i$-lP$.Y$.^$/U$0d$0i$1PPP$1U$1[$1`P$1c$1g$1k$2a$2x$3a$3e$3h$3k$3q$3t$3x$3|R!|RoqOXst!Z#d%k&o&q&r&t,k,p1|2PY!vQ']-]1a5eQ%rvQ%zyQ&R|Q&g!VS'T!e-TQ'c!iS'i!r!yU*e$|*V*jQ+i%{Q+v&TQ,[&aQ-Z'[Q-e'dQ-m'jQ0R*lQ1k,]R;v;T%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%k%r&P&h&k&o&q&r&t&x'Q'_'o(P(R(X(`(t(v(z)y+R+V,h,k,p-a-i-w-}.l.s/f0a0g0v1d1t1u1w1y1|2P2R2r2x3^5b5m5}6O6R6f8R8X8h8rS#q];Q!r)Z$Z$n'U)o,|-P.}2b3u5`6]9h9y;P;S;T;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;i;v;x;y;{ < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:376,context:gM,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[_M],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(RpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(RpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Rp(U!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Rp(U!b'w0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(S#S$h&j'x0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Rp(U!b'x0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(Q':f$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(U!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Rp(U!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(U!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(RpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(RpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Rp(U!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(U!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(U!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(U!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(U!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(U!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-wM[r]||-1},{term:338,get:r=>DM[r]||-1},{term:92,get:r=>CM[r]||-1}],tokenPrec:14749});var vr=require("@codemirror/language"),kM=require("@codemirror/state"),EM=require("@codemirror/view"),$g=require("@codemirror/autocomplete");var S5=vr.LRLanguage.define({name:"javascript",parser:x5.configure({props:[vr.indentNodeProp.add({IfStatement:(0,vr.continuedIndent)({except:/^\s*({|else\b)/}),TryStatement:(0,vr.continuedIndent)({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:vr.flatIndent,SwitchBody:r=>{let e=r.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return r.baseIndent+(t?0:n?1:2)*r.unit},Block:(0,vr.delimitedIndent)({closing:"}"}),ArrowFunction:r=>r.baseIndent+r.unit,"TemplateString BlockComment":()=>null,"Statement Property":(0,vr.continuedIndent)({except:/^{/}),JSXElement(r){let e=/^\s*<\//.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},JSXEscape(r){let e=/\s*\}/.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},"JSXOpenTag JSXSelfClosingTag"(r){return r.column(r.node.from)+r.unit}}),vr.foldNodeProp.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":vr.foldInside,BlockComment(r){return{from:r.from+2,to:r.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}});var MK=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent);var Ln=require("@codemirror/language"),va=require("@codemirror/view"),Di=require("@codemirror/autocomplete"),Vf=require("@codemirror/search"),A5=require("@codemirror/lint"),$5=()=>[S5,(0,Ln.foldGutter)(),(0,va.drawSelection)(),(0,va.dropCursor)(),(0,Ln.indentOnInput)(),(0,Ln.syntaxHighlighting)(Ln.defaultHighlightStyle,{fallback:!0}),va.EditorView.lineWrapping,(0,Ln.bracketMatching)(),(0,Di.closeBrackets)(),(0,Di.autocompletion)(),(0,va.rectangularSelection)(),(0,Vf.highlightSelectionMatches)(),va.keymap.of([...Di.closeBracketsKeymap,...Ss.defaultKeymap,...Vf.searchKeymap,...Ss.historyKeymap,Ss.indentWithTab,...Ln.foldKeymap,...Di.completionKeymap,...A5.lintKeymap])].filter(r=>r);var N5=require("@codemirror/view"),jf=require("@codemirror/language");var xM="#abb2bf",SM="#7d8799",AM="#ffffff",$M="#21252b",Tg="rgba(0, 0, 0, 0.5)",TM="#292d3e",Ng="#353a42",NM="rgba(128, 203, 196, 0.2)",T5="#ffcc00",PM=N5.EditorView.theme({"&":{color:"#ffffff",backgroundColor:TM},".cm-content":{caretColor:T5},"&.cm-focused .cm-cursor":{borderLeftColor:T5},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:NM},".cm-panels":{backgroundColor:$M,color:"#ffffff"},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:Tg},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847",outline:"1px solid #515a6b"},".cm-gutters":{background:"#292d3e",color:"#676e95",border:"none"},".cm-activeLineGutter":{backgroundColor:Tg},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Ng},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Ng,borderBottomColor:Ng},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Tg,color:xM}}},{dark:!0}),MM=jf.HighlightStyle.define([{tag:K.keyword,color:"#c792ea"},{tag:K.operator,color:"#89ddff"},{tag:K.special(K.variableName),color:"#eeffff"},{tag:K.typeName,color:"#f07178"},{tag:K.atom,color:"#f78c6c"},{tag:K.number,color:"#ff5370"},{tag:K.definition(K.variableName),color:"#82aaff"},{tag:K.string,color:"#c3e88d"},{tag:K.special(K.string),color:"#f07178"},{tag:K.comment,color:SM},{tag:K.variableName,color:"#f07178"},{tag:K.tagName,color:"#ff5370"},{tag:K.bracket,color:"#a2a1a4"},{tag:K.meta,color:"#ffcb6b"},{tag:K.attributeName,color:"#c792ea"},{tag:K.propertyName,color:"#c792ea"},{tag:K.className,color:"#decb6b"},{tag:K.invalid,color:AM}]),P5=[PM,(0,jf.syntaxHighlighting)(MM)];var L5=require("@codemirror/view"),Gf=require("@codemirror/language");var M5="#2e3440",Fg="#3b4252",R5="#434c5e",Xf="#4c566a";var Q5="#e5e9f0",Ig="#eceff4",Pg="#8fbcbb",I5="#88c0d0",RM="#81a1c1",aa="#5e81ac",QM="#bf616a",As="#d08770",Mg="#ebcb8b",F5="#a3be8c",IM="#b48ead",Z5="#d30102",Zg=Ig,Rg=Zg,FM="#ffffff",Qg=Fg,ZM=Zg,q5=Fg,qg=L5.EditorView.theme({"&":{color:M5,backgroundColor:FM},".cm-content":{caretColor:q5},".cm-cursor, .cm-dropCursor":{borderLeftColor:q5},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ZM},".cm-panels":{backgroundColor:Zg,color:Xf},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:`1px solid ${Xf}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:Q5},".cm-activeLine":{backgroundColor:Rg},".cm-selectionMatch":{backgroundColor:Q5},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${Xf}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:Ig},".cm-gutters":{backgroundColor:Ig,color:M5,border:"none"},".cm-activeLineGutter":{backgroundColor:Rg},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Qg},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Qg,borderBottomColor:Qg},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Rg,color:Xf}}},{dark:!1}),qM=Gf.HighlightStyle.define([{tag:K.keyword,color:aa},{tag:[K.name,K.deleted,K.character,K.propertyName,K.macroName],color:As},{tag:[K.variableName],color:As},{tag:[K.function(K.variableName)],color:aa},{tag:[K.labelName],color:RM},{tag:[K.color,K.constant(K.name),K.standard(K.name)],color:aa},{tag:[K.definition(K.name),K.separator],color:F5},{tag:[K.brace],color:Pg},{tag:[K.annotation],color:Z5},{tag:[K.number,K.changed,K.annotation,K.modifier,K.self,K.namespace],color:I5},{tag:[K.typeName,K.className],color:Mg},{tag:[K.operator,K.operatorKeyword],color:F5},{tag:[K.tagName],color:IM},{tag:[K.squareBracket],color:QM},{tag:[K.angleBracket],color:As},{tag:[K.attributeName],color:Mg},{tag:[K.regexp],color:aa},{tag:[K.quote],color:Fg},{tag:[K.string],color:As},{tag:K.link,color:Pg,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[K.url,K.escape,K.special(K.string)],color:As},{tag:[K.meta],color:I5},{tag:[K.comment],color:R5,fontStyle:"italic"},{tag:K.strong,fontWeight:"bold",color:aa},{tag:K.emphasis,fontStyle:"italic",color:aa},{tag:K.strikethrough,textDecoration:"line-through"},{tag:K.heading,fontWeight:"bold",color:aa},{tag:K.special(K.heading1),fontWeight:"bold",color:aa},{tag:K.heading1,fontWeight:"bold",color:aa},{tag:[K.heading2,K.heading3,K.heading4],fontWeight:"bold",color:aa},{tag:[K.heading5,K.heading6],color:aa},{tag:[K.atom,K.bool,K.special(K.variableName)],color:As},{tag:[K.processingInstruction,K.inserted],color:Pg},{tag:[K.contentSeparator],color:Mg},{tag:K.invalid,color:R5,borderBottom:`1px dotted ${Z5}`}]),BK=[qg,(0,Gf.syntaxHighlighting)(qM)];function W5(r,e){let t=$5();document.body.hasClass("theme-dark")?t.push(P5):t.push(qg);let n=[...t];e&&n.push(e);let a=new U5.EditorView({state:B5.EditorState.create({doc:r.value,extensions:n})});return r.parentNode.appendChild(a.dom),r.style.display="none",r.form&&r.form.addEventListener("submit",()=>{r.value=a.state.doc.toString()}),a}function LM(r){we(r,"svelte-1ejrp3m","div.svelte-1ejrp3m .cm-editor{height:200px}")}function BM(r){let e,t,n,a,i,o,s,l;return{c(){e=_("p"),e.textContent="Use this to override what is displayed for a given day.",t=F(),n=_("p"),n.innerHTML=`Your callback will receive the day and calendar parameters and must return a string or number`,a=F(),i=_("div"),g(i,"class","svelte-1ejrp3m")},m(u,c){$(u,e,c),$(u,t,c),$(u,n,c),$(u,a,c),$(u,i,c),s||(l=me(o=r[1].call(null,i)),s=!0)},p:I,d(u){u&&(A(e),A(t),A(n),A(a),A(i)),s=!1,l()}}}function UM(r){let e,t;return e=new xt({props:{name:"Day Callback",open:Hf.Platform.isDesktop,$$slots:{default:[BM]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&32&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function WM(r,e,t){let n,a,i=Ve("store");ie(r,i,l=>t(2,a=l));let o,s=l=>{let u=new Hf.TextAreaComponent(l).setValue(n.static.dayDisplayCallback??"");o=W5(u.inputEl,Y5.EditorView.updateListener.of(c=>{c.docChanged&&(n.static.dayDisplayCallback=c.state.doc.toString())}))};return bl(()=>{o.destroy()}),r.$$.update=()=>{r.$$.dirty&4&&(n=a)},[i,s,a]}var Lg=class extends ae{constructor(e){super(),oe(this,e,WM,UM,re,{},LM)}},z5=Lg;function YM(r){let e,t,n,a,i,o,s,l,u,c,f,d;return e=new Xl({}),n=new Lw({}),i=new zw({}),s=new o5({}),u=new c5({}),f=new z5({}),{c(){z(e.$$.fragment),t=F(),z(n.$$.fragment),a=F(),z(i.$$.fragment),o=F(),z(s.$$.fragment),l=F(),z(u.$$.fragment),c=F(),z(f.$$.fragment)},m(h,p){W(e,h,p),$(h,t,p),W(n,h,p),$(h,a,p),W(i,h,p),$(h,o,p),W(s,h,p),$(h,l,p),W(u,h,p),$(h,c,p),W(f,h,p),d=!0},p:I,i(h){d||(P(e.$$.fragment,h),P(n.$$.fragment,h),P(i.$$.fragment,h),P(s.$$.fragment,h),P(u.$$.fragment,h),P(f.$$.fragment,h),d=!0)},o(h){R(e.$$.fragment,h),R(n.$$.fragment,h),R(i.$$.fragment,h),R(s.$$.fragment,h),R(u.$$.fragment,h),R(f.$$.fragment,h),d=!1},d(h){h&&(A(t),A(a),A(o),A(l),A(c)),Y(e,h),Y(n,h),Y(i,h),Y(s,h),Y(u,h),Y(f,h)}}}var Bg=class extends ae{constructor(e){super(),oe(this,e,null,YM,re,{})}},Ug=Bg;var K5=require("obsidian");var Oa=require("obsidian");function V5(r){return{name:r??"",cycle:0,offset:0,faceColor:"#fff",shadowColor:"#000",id:Le(6)}}var Kf=class extends ir{constructor(t,n,a){super(t);this.calendar=n;this.saved=!1;this.moon={name:"",cycle:0,offset:0,faceColor:"#fff",shadowColor:"#000",id:Le(6)};a&&(this.moon={...a},this.editing=!0),this.containerEl.addClass("calendarium-create-moon")}async display(){this.contentEl.empty(),this.contentEl.createEl("h3",{text:this.editing?"Edit moon":"New moon"}),this.infoEl=this.contentEl.createDiv("moon-info"),this.buildInfo(),new Oa.Setting(this.contentEl).addButton(t=>{t.setButtonText("Save").setCta().onClick(()=>{if(!this.moon.name?.length){new Oa.Notice("The moon must have a name.");return}if(!this.moon.cycle){new Oa.Notice("The moon must have a positive cycle.");return}this.saved=!0,this.close()})}).addExtraButton(t=>{t.setIcon(ns).setTooltip("Cancel").onClick(()=>this.close())})}buildInfo(){this.infoEl.empty(),new Oa.Setting(this.infoEl).setName("Name").addText(t=>{t.setValue(this.moon.name).onChange(n=>{this.moon.name=n})}),new Oa.Setting(this.infoEl).setName("Cycle").setDesc("How many days it takes for the moon to complete a full cycle.").addText(t=>{t.inputEl.setAttr("type","number"),t.setValue(`${this.moon.cycle}`).onChange(n=>{isNaN(Number(n))||(this.moon.cycle=Number(n))})}),new Oa.Setting(this.infoEl).setName("Offset").setDesc("Shift the starting moon phase by a number of days.").addText(t=>{t.inputEl.setAttr("type","number"),t.setValue(`${this.moon.offset}`).onChange(n=>{isNaN(Number(n))||(this.moon.offset=Number(n))})}),new Oa.Setting(this.infoEl).setName("Face color").addText(t=>{t.inputEl.setAttr("type","color"),t.setValue(this.moon.faceColor).onChange(n=>{this.moon.faceColor=n})}),new Oa.Setting(this.infoEl).setName("Shadow color").addText(t=>{t.inputEl.setAttr("type","color"),t.setValue(this.moon.shadowColor).onChange(n=>{this.moon.shadowColor=n})})}async onOpen(){await this.display()}};var Yg=require("obsidian");function zM(r){we(r,"svelte-1g86g3j",".moon-wrapper.svelte-1g86g3j,.moon.svelte-1g86g3j{width:min-content;height:min-content;min-width:0}.moon.svelte-1g86g3j{display:flex;align-items:center}")}function VM(r){let e,t,n,a,i,o,s,l,u;return{c(){e=_("div"),t=or("svg"),n=or("circle"),i=or("path"),s=or("circle"),g(n,"cx","16"),g(n,"cy","16"),g(n,"r","10"),g(n,"fill",a=r[0].faceColor),g(i,"class","shadow"),g(i,"fill",o=r[0].shadowColor),g(i,"d",r[3]),g(s,"cx","16"),g(s,"cy","16"),g(s,"r","10"),g(s,"fill","none"),g(s,"stroke","#000"),g(s,"stroke-width","2px"),g(t,"class","moon svelte-1g86g3j"),g(t,"id",l=r[0].id),g(t,"preserveAspectRatio","xMidYMid"),g(t,"width",r[2]),g(t,"height",r[2]),g(t,"viewBox","0 0 32 32"),g(e,"class","moon-wrapper svelte-1g86g3j"),g(e,"aria-label",u=r[1]?`${r[0].name} ${r[0].phase}`:null)},m(c,f){$(c,e,f),y(e,t),y(t,n),y(t,i),y(t,s)},p(c,[f]){f&1&&a!==(a=c[0].faceColor)&&g(n,"fill",a),f&1&&o!==(o=c[0].shadowColor)&&g(i,"fill",o),f&8&&g(i,"d",c[3]),f&1&&l!==(l=c[0].id)&&g(t,"id",l),f&4&&g(t,"width",c[2]),f&4&&g(t,"height",c[2]),f&3&&u!==(u=c[1]?`${c[0].name} ${c[0].phase}`:null)&&g(e,"aria-label",u)},i:I,o:I,d(c){c&&A(e)}}}function jM(r,e,t){let n,{moon:a}=e,{label:i=!0}=e,{size:o=28}=e;return r.$$set=s=>{"moon"in s&&t(0,a=s.moon),"label"in s&&t(1,i=s.label),"size"in s&&t(2,o=s.size)},r.$$.update=()=>{r.$$.dirty&1&&t(3,n=Fb[a.phase??"New moon"])},[a,i,o,n]}var Wg=class extends ae{constructor(e){super(),oe(this,e,jM,VM,re,{moon:0,label:1,size:2},zM)}},$s=Wg;function XM(r){we(r,"svelte-144nt9c",".moon.svelte-144nt9c{display:grid;grid-template-columns:1fr auto;align-items:center;justify-content:space-between;gap:1rem;margin-top:0.5rem}.setting-item-name.svelte-144nt9c{display:flex;align-items:center}.icons.svelte-144nt9c{display:flex;align-self:flex-start;justify-self:flex-end;align-items:center;gap:0.25rem}.icon.svelte-144nt9c{display:flex;align-items:center}.small.svelte-144nt9c{--icon-size:var(--icon-xs)}")}function j5(r){let e,t,n,a,i=r[0].offset+"",o,s,l,u;return{c(){e=_("div"),t=_("span"),a=F(),o=le(i),s=le(" days"),g(t,"class","icon small svelte-144nt9c"),g(e,"class","icons svelte-144nt9c")},m(c,f){$(c,e,f),y(e,t),y(e,a),y(e,o),y(e,s),l||(u=me(n=vt.call(null,t,yv)),l=!0)},p(c,f){f&1&&i!==(i=c[0].offset+"")&&ve(o,i)},d(c){c&&A(e),l=!1,u()}}}function GM(r){let e,t,n,a,i,o=r[0].name+"",s,l,u,c,f,d,h,p,m=r[0].cycle+"",O,b,E,D,C,k,w,T,S,M,Z,N,L;a=new $s({props:{moon:{...r[0],phase:"First quarter"},label:!1,size:20}});let j=r[0].offset&&j5(r);return{c(){e=_("div"),t=_("div"),n=_("span"),z(a.$$.fragment),i=F(),s=le(o),l=F(),u=_("div"),c=_("div"),f=_("div"),d=_("span"),p=F(),O=le(m),b=le(" days"),E=F(),j&&j.c(),D=F(),C=_("div"),k=_("div"),T=F(),S=_("div"),g(n,"class","setting-item-name svelte-144nt9c"),g(d,"class","icon small svelte-144nt9c"),g(f,"class","icons svelte-144nt9c"),g(c,"class","date"),g(u,"class","setting-item-description"),g(t,"class","moon-info"),g(k,"class","icon svelte-144nt9c"),g(S,"class","icon svelte-144nt9c"),g(C,"class","icons svelte-144nt9c"),g(e,"class","moon svelte-144nt9c")},m(X,fe){$(X,e,fe),y(e,t),y(t,n),W(a,n,null),y(n,i),y(n,s),y(t,l),y(t,u),y(u,c),y(c,f),y(f,d),y(f,p),y(f,O),y(f,b),y(c,E),j&&j.m(c,null),y(e,D),y(e,C),y(C,k),y(C,T),y(C,S),Z=!0,N||(L=[me(h=vt.call(null,d,gv)),me(w=r[2].call(null,k)),ce(k,"click",r[4]),me(M=r[1].call(null,S)),ce(S,"click",r[5])],N=!0)},p(X,[fe]){let ee={};fe&1&&(ee.moon={...X[0],phase:"First quarter"}),a.$set(ee),(!Z||fe&1)&&o!==(o=X[0].name+"")&&ve(s,o),(!Z||fe&1)&&m!==(m=X[0].cycle+"")&&ve(O,m),X[0].offset?j?j.p(X,fe):(j=j5(X),j.c(),j.m(c,null)):j&&(j.d(1),j=null)},i(X){Z||(P(a.$$.fragment,X),Z=!0)},o(X){R(a.$$.fragment,X),Z=!1},d(X){X&&A(e),Y(a),j&&j.d(),N=!1,Te(L)}}}function HM(r,e,t){let n=u=>{new Yg.ExtraButtonComponent(u).setIcon(Lt).setTooltip("Delete")},a=u=>{new Yg.ExtraButtonComponent(u).setIcon(Ar).setTooltip("Edit")},{moon:i}=e,o=Qt(),s=()=>o("edit"),l=()=>o("delete");return r.$$set=u=>{"moon"in u&&t(0,i=u.moon)},[i,n,a,o,s,l]}var zg=class extends ae{constructor(e){super(),oe(this,e,HM,GM,re,{moon:0},XM)}},X5=zg;function G5(r,e,t){let n=r.slice();return n[13]=e[t],n}function KM(r){let e,t,n=$e(r[0]),a=[];for(let o=0;oR(a[o],1,1,()=>{a[o]=null});return{c(){e=_("div");for(let o=0;o{u[p]=null}),_e(),a=u[n],a?a.p(f,d):(a=u[n]=l[n](f),a.c()),P(a,1),a.m(i.parentNode,i))},i(f){s||(P(e.$$.fragment,f),P(a),P(o.$$.fragment,f),s=!0)},o(f){R(e.$$.fragment,f),R(a),R(o.$$.fragment,f),s=!1},d(f){f&&(A(t),A(i)),Y(e,f),u[n].d(f),Y(o,f)}}}function tR(r){let e,t;return e=new xt({props:{name:"Moons",open:K5.Platform.isDesktop,desc:`${r[0].length} moon${r[0].length!=1?"s":""}`,$$slots:{default:[eR]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&1&&(i.desc=`${n[0].length} moon${n[0].length!=1?"s":""}`),a&65539&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function rR(r,e,t){let n,a,i,o=Ve("store");ie(r,o,O=>t(11,n=O));let s=Ve("plugin"),{moonStore:l,displayMoons:u}=o;ie(r,l,O=>t(0,a=O)),ie(r,u,O=>t(1,i=O));let c=O=>{l.delete(O.id)},f=O=>{let b=new Kf(s.app,n,O);b.onClose=()=>{b.saved&&(b.editing&&O?l.update(O.id,{...b.moon}):l.add({...b.moon}))},b.open()};return[a,i,o,l,u,c,f,()=>Ce(u,i=!i,i),O=>f(O),O=>c(O),O=>f(V5(O.detail))]}var Vg=class extends ae{constructor(e){super(),oe(this,e,rR,tR,re,{})}},J5=Vg;function nR(r){let e,t;return e=new J5({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p:I,i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}var jg=class extends ae{constructor(e){super(),oe(this,e,null,nR,re,{})}},Xg=jg;var Gg=require("obsidian");function aR(r){we(r,"svelte-1b1ayha",".editable-item.svelte-1b1ayha{display:grid;grid-template-columns:1fr auto;align-items:flex-start;justify-content:space-between;gap:1rem;margin-top:0.5rem}.icons.svelte-1b1ayha{display:flex;align-self:center;justify-self:flex-end;align-items:flex-start}.desc.svelte-1b1ayha{display:flex;align-items:flex-start;flex-flow:column;gap:0.5rem}")}var iR=r=>({}),e3=r=>({}),oR=r=>({}),t3=r=>({});function sR(r){let e,t,n=r[3].name,a=Xr(n,r,r[6],e3);return{c(){e=_("div"),a&&a.c(),g(e,"slot","name")},m(i,o){$(i,e,o),a&&a.m(e,null),t=!0},p(i,o){a&&a.p&&(!t||o&64)&&Hr(a,n,i,i[6],t?Gr(n,i[6],o,iR):Kr(i[6]),e3)},i(i){t||(P(a,i),t=!0)},o(i){R(a,i),t=!1},d(i){i&&A(e),a&&a.d(i)}}}function lR(r){let e,t,n=r[3].desc,a=Xr(n,r,r[6],t3);return{c(){e=_("div"),a&&a.c(),g(e,"slot","desc"),g(e,"class","desc svelte-1b1ayha")},m(i,o){$(i,e,o),a&&a.m(e,null),t=!0},p(i,o){a&&a.p&&(!t||o&64)&&Hr(a,n,i,i[6],t?Gr(n,i[6],o,oR):Kr(i[6]),t3)},i(i){t||(P(a,i),t=!0)},o(i){R(a,i),t=!1},d(i){i&&A(e),a&&a.d(i)}}}function uR(r){let e,t,n,a,i,o,s,l;return{c(){e=_("div"),t=_("div"),a=F(),i=_("div"),g(t,"class","icon"),g(i,"class","icon"),g(e,"class","icons svelte-1b1ayha"),g(e,"slot","control")},m(u,c){$(u,e,c),y(e,t),y(e,a),y(e,i),s||(l=[me(n=r[2].call(null,t)),ce(t,"click",r[4]),me(o=r[1].call(null,i)),ce(i,"click",r[5])],s=!0)},p:I,d(u){u&&A(e),s=!1,Te(l)}}}function cR(r){let e,t,n;return t=new lt({props:{$$slots:{control:[uR],desc:[lR],name:[sR]},$$scope:{ctx:r}}}),{c(){e=_("div"),z(t.$$.fragment),g(e,"class","editable-item setting-item svelte-1b1ayha")},m(a,i){$(a,e,i),W(t,e,null),n=!0},p(a,[i]){let o={};i&64&&(o.$$scope={dirty:i,ctx:a}),t.$set(o)},i(a){n||(P(t.$$.fragment,a),n=!0)},o(a){R(t.$$.fragment,a),n=!1},d(a){a&&A(e),Y(t)}}}function fR(r,e,t){let{$$slots:n={},$$scope:a}=e,i=Qt(),o=c=>{new Gg.ExtraButtonComponent(c).setIcon(Lt).setTooltip("Delete").extraSettingsEl.setAttr("style","margin-left: 0;")},s=c=>{new Gg.ExtraButtonComponent(c).setIcon(Ar).setTooltip("Edit")},l=()=>i("edit"),u=()=>i("delete");return r.$$set=c=>{"$$scope"in c&&t(6,a=c.$$scope)},[i,o,s,n,l,u,a]}var Hg=class extends ae{constructor(e){super(),oe(this,e,fR,cR,re,{},aR)}},r3=Hg;function dR(r){we(r,"svelte-1vfypyd",".desc.svelte-1vfypyd{display:flex;align-items:flex-start;flex-flow:column;gap:0.5rem}.clamp.svelte-1vfypyd{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;word-break:keep-all;overflow:hidden;width:calc(var(--event-max-width) * 0.75)}")}function hR(r){let e,t=r[0].name+"",n;return{c(){e=_("div"),n=le(t),g(e,"slot","name")},m(a,i){$(a,e,i),y(e,n)},p(a,i){i&1&&t!==(t=a[0].name+"")&&ve(n,t)},d(a){a&&A(e)}}}function pR(r){let e=Fr(r[0].date,r[1],r[0].end)+"",t;return{c(){t=le(e)},m(n,a){$(n,t,a)},p(n,a){a&3&&e!==(e=Fr(n[0].date,n[1],n[0].end)+"")&&ve(t,e)},d(n){n&&A(t)}}}function mR(r){let e;return{c(){e=le("Starting era")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function gR(r){let e,t,n,a,i=(r[0].description??"")+"",o;function s(c,f){if("isStartingEra"in c[0]&&c[0].isStartingEra)return mR;if("date"in c[0])return pR}let l=s(r,-1),u=l&&l(r);return{c(){e=_("div"),t=_("span"),u&&u.c(),n=F(),a=_("span"),o=le(i),g(a,"class","clamp svelte-1vfypyd"),g(e,"slot","desc"),g(e,"class","desc svelte-1vfypyd")},m(c,f){$(c,e,f),y(e,t),u&&u.m(t,null),y(e,n),y(e,a),y(a,o)},p(c,f){l===(l=s(c,f))&&u?u.p(c,f):(u&&u.d(1),u=l&&l(c),u&&(u.c(),u.m(t,null))),f&1&&i!==(i=(c[0].description??"")+"")&&ve(o,i)},d(c){c&&A(e),u&&u.d()}}}function yR(r){let e,t;return e=new r3({props:{$$slots:{desc:[gR],name:[hR]},$$scope:{ctx:r}}}),e.$on("delete",r[3]),e.$on("edit",r[4]),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&35&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function bR(r,e,t){let n,{era:a}=e,i=Ve("store");ie(r,i,l=>t(1,n=l));function o(l){Zr.call(this,r,l)}function s(l){Zr.call(this,r,l)}return r.$$set=l=>{"era"in l&&t(0,a=l.era)},[a,n,i,o,s]}var Kg=class extends ae{constructor(e){super(),oe(this,e,bR,yR,re,{era:0},dR)}},n3=Kg;var Nn={Era:"era",Day:"day",LeapDay:"leapday",Month:"month",IntercalaryMonth:"intercalary",Year:"year"};var Jf=require("obsidian");function Jg(r,{delay:e=0,duration:t=400,easing:n=$f,axis:a="y"}={}){let i=getComputedStyle(r),o=+i.opacity,s=a==="y"?"height":"width",l=parseFloat(i[s]),u=a==="y"?["top","bottom"]:["left","right"],c=u.map(b=>`${b[0].toUpperCase()}${b.slice(1)}`),f=parseFloat(i[`padding${c[0]}`]),d=parseFloat(i[`padding${c[1]}`]),h=parseFloat(i[`margin${c[0]}`]),p=parseFloat(i[`margin${c[1]}`]),m=parseFloat(i[`border${c[0]}Width`]),O=parseFloat(i[`border${c[1]}Width`]);return{delay:e,duration:t,easing:n,css:b=>`overflow: hidden;opacity: ${Math.min(b*20,1)*o};${s}: ${b*l}px;padding-${u[0]}: ${b*f}px;padding-${u[1]}: ${b*d}px;margin-${u[0]}: ${b*h}px;margin-${u[1]}: ${b*p}px;border-${u[0]}-width: ${b*m}px;border-${u[1]}-width: ${b*O}px;`}}function vR(r){we(r,"svelte-1k8q18g",".text-area-component.svelte-1k8q18g{display:flex;flex-flow:column nowrap;align-items:flex-start;gap:0.5rem;width:100%}.setting-item.svelte-1k8q18g{width:100%}.align-start.svelte-1k8q18g{align-items:flex-start}hr.svelte-1k8q18g{margin:0.5rem 0}textarea.svelte-1k8q18g{width:100%}.ranged-event.svelte-1k8q18g{display:flex;align-items:center;gap:0.5rem;color:var(--text-muted);font-style:italic}")}function a3(r,e,t){let n=r.slice();return n[25]=e[t],n}function i3(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p,m,O,b,E,D,C,k;return{c(){e=_("hr"),t=F(),n=_("div"),a=_("span"),a.textContent=`The display format of your era can be whatever you want, but you can also include the following options:`,i=F(),o=_("ul"),s=_("li"),s.textContent="{{ year }} - Displays the current year",l=F(),u=_("li"),u.textContent=`{{ abs_year }} - Displays the current year, but without a minus in front of it if is negative.`,c=F(),f=_("li"),f.textContent=`{{ nth_year }} - Display the year with an ordinal (1st, 2nd, etc).`,d=F(),h=_("li"),h.textContent=`{{ abs_nth_year }} - Combination of abs_year and nth_year.`,p=F(),m=_("li"),m.textContent=`{{ era_year }} - The current era year. If any eras in the past has restarted the year count, this number will be different than the year number.`,O=F(),b=_("li"),b.textContent=`{{ era_nth_year }} - Similar to nth_year, but counting only the era years.`,E=F(),D=_("li"),D.textContent=`{{ era_name }} - Inserts the current name of the era`,g(e,"class","svelte-1k8q18g"),g(n,"class","help-text")},m(w,T){$(w,e,T),$(w,t,T),$(w,n,T),y(n,a),y(n,i),y(n,o),y(o,s),y(o,l),y(o,u),y(o,c),y(o,f),y(o,d),y(o,h),y(o,p),y(o,m),y(o,O),y(o,b),y(o,E),y(o,D),k=!0},i(w){k||(w&&St(()=>{k&&(C||(C=Cp(n,Jg,{axis:"y"},!0)),C.run(1))}),k=!0)},o(w){w&&(C||(C=Cp(n,Jg,{axis:"y"},!1)),C.run(0)),k=!1},d(w){w&&(A(e),A(t),A(n)),w&&C&&C.end()}}}function OR(r){let e,t,n,a,i,o,s,l,u,c,f,d,h=oi(r[0],r[3].current.year)+"",p,m,O,b,E,D,C,k,w,T,S,M,Z;e=new ln({props:{name:"Name",value:r[0].name,desc:""}}),e.$on("change",r[14]),n=new lf({props:{name:"Description",value:r[0].description??""}}),n.$on("change",r[15]);let N=r[2]&&i3(r);return{c(){z(e.$$.fragment),t=F(),z(n.$$.fragment),a=F(),i=_("div"),o=_("div"),s=_("div"),l=_("div"),l.innerHTML="",u=F(),c=_("div"),f=_("span"),d=_("strong"),p=le(h),m=F(),O=_("br"),b=F(),N&&N.c(),E=F(),D=_("div"),k=F(),w=_("textarea"),g(l,"class","setting-item-name"),g(c,"class","setting-item-description"),g(s,"class","setting-item-info"),g(D,"class","setting-item-control"),g(o,"class","setting-item align-start svelte-1k8q18g"),g(w,"spellcheck","false"),g(w,"placeholder",T="Display format"),g(w,"class","svelte-1k8q18g"),g(i,"class","setting-item text-area-component svelte-1k8q18g")},m(L,j){W(e,L,j),$(L,t,j),W(n,L,j),$(L,a,j),$(L,i,j),y(i,o),y(o,s),y(s,l),y(s,u),y(s,c),y(c,f),y(f,d),y(d,p),y(f,m),y(c,O),y(c,b),N&&N.m(c,null),y(o,E),y(o,D),y(i,k),y(i,w),Re(w,r[0].format),S=!0,M||(Z=[me(C=r[12].call(null,D)),ce(w,"input",r[16])],M=!0)},p(L,j){let X={};j&1&&(X.value=L[0].name),e.$set(X);let fe={};j&1&&(fe.value=L[0].description??""),n.$set(fe),(!S||j&9)&&h!==(h=oi(L[0],L[3].current.year)+"")&&ve(p,h),L[2]?N?j&4&&P(N,1):(N=i3(L),N.c(),P(N,1),N.m(c,null)):N&&(Oe(),R(N,1,1,()=>{N=null}),_e()),j&9&&Re(w,L[0].format)},i(L){S||(P(e.$$.fragment,L),P(n.$$.fragment,L),P(N),S=!0)},o(L){R(e.$$.fragment,L),R(n.$$.fragment,L),R(N),S=!1},d(L){L&&(A(t),A(a),A(i)),Y(e,L),Y(n,L),N&&N.d(),M=!1,Te(Z)}}}function o3(r){let e,t,n,a,i,o,s,l,u,c,f;e=new er({props:{name:"Ends the year",value:r[0].endsYear,desc:"A new year will begin the date this era starts."}}),e.$on("click",r[18]),a=new lt({props:{$$slots:{name:[_R]},$$scope:{ctx:r}}}),o=new Wa({props:{date:Ze(r[0].date)}});let d=[DR,wR],h=[];function p(m,O){return m[0].end?1:0}return l=p(r,-1),u=h[l]=d[l](r),{c(){z(e.$$.fragment),t=F(),n=_("div"),z(a.$$.fragment),i=F(),z(o.$$.fragment),s=F(),u.c(),c=He(),g(n,"class","setting-item setting-item-heading svelte-1k8q18g")},m(m,O){W(e,m,O),$(m,t,O),$(m,n,O),W(a,n,null),$(m,i,O),W(o,m,O),$(m,s,O),h[l].m(m,O),$(m,c,O),f=!0},p(m,O){let b={};O&1&&(b.value=m[0].endsYear),e.$set(b);let E={};O&268435456&&(E.$$scope={dirty:O,ctx:m}),a.$set(E);let D={};O&1&&(D.date=Ze(m[0].date)),o.$set(D);let C=l;l=p(m,O),l===C?h[l].p(m,O):(Oe(),R(h[C],1,1,()=>{h[C]=null}),_e(),u=h[l],u?u.p(m,O):(u=h[l]=d[l](m),u.c()),P(u,1),u.m(c.parentNode,c))},i(m){f||(P(e.$$.fragment,m),P(a.$$.fragment,m),P(o.$$.fragment,m),P(u),f=!0)},o(m){R(e.$$.fragment,m),R(a.$$.fragment,m),R(o.$$.fragment,m),R(u),f=!1},d(m){m&&(A(t),A(n),A(i),A(s),A(c)),Y(e,m),Y(a),Y(o,m),h[l].d(m)}}}function _R(r){let e;return{c(){e=_("div"),e.textContent="Start date",g(e,"slot","name")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function wR(r){let e,t,n,a,i;return t=new lt({props:{$$slots:{control:[kR],name:[CR]},$$scope:{ctx:r}}}),a=new Wa({props:{date:Ze(r[0].end)}}),{c(){e=_("div"),z(t.$$.fragment),n=F(),z(a.$$.fragment),g(e,"class","setting-item setting-item-heading svelte-1k8q18g")},m(o,s){$(o,e,s),W(t,e,null),$(o,n,s),W(a,o,s),i=!0},p(o,s){let l={};s&268435520&&(l.$$scope={dirty:s,ctx:o}),t.$set(l);let u={};s&1&&(u.date=Ze(o[0].end)),a.$set(u)},i(o){i||(P(t.$$.fragment,o),P(a.$$.fragment,o),i=!0)},o(o){R(t.$$.fragment,o),R(a.$$.fragment,o),i=!1},d(o){o&&(A(e),A(n)),Y(t),Y(a,o)}}}function DR(r){let e,t,n;return t=new lt({props:{$$slots:{name:[ER]},$$scope:{ctx:r}}}),{c(){e=_("div"),z(t.$$.fragment),g(e,"class","setting-item svelte-1k8q18g")},m(a,i){$(a,e,i),W(t,e,null),n=!0},p(a,i){let o={};i&268435521&&(o.$$scope={dirty:i,ctx:a}),t.$set(o)},i(a){n||(P(t.$$.fragment,a),n=!0)},o(a){R(t.$$.fragment,a),n=!1},d(a){a&&A(e),Y(t)}}}function CR(r){let e;return{c(){e=_("div"),e.textContent="End date",g(e,"slot","name")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function kR(r){let e,t,n,a;return{c(){e=_("div"),g(e,"slot","control")},m(i,o){$(i,e,o),n||(a=[me(t=r[10].call(null,e)),ce(e,"click",r[20])],n=!0)},p:I,d(i){i&&A(e),n=!1,Te(a)}}}function ER(r){let e,t,n,a,i,o,s;return{c(){e=_("div"),t=_("span"),t.textContent="Add end date",n=F(),a=_("div"),g(e,"class","ranged-event svelte-1k8q18g"),g(e,"slot","name")},m(l,u){$(l,e,u),y(e,t),y(e,n),y(e,a),o||(s=[me(i=r[13].call(null,a)),ce(a,"click",r[19])],o=!0)},p:I,d(l){l&&A(e),o=!1,Te(s)}}}function xR(r){let e,t,n,a;e=new er({props:{name:"Starting era",disabled:r[4]!=null,value:r[0].isStartingEra,desc:r[5]}}),e.$on("click",r[17]);let i=!r[0].isStartingEra&&o3(r);return{c(){z(e.$$.fragment),t=F(),i&&i.c(),n=He()},m(o,s){W(e,o,s),$(o,t,s),i&&i.m(o,s),$(o,n,s),a=!0},p(o,s){let l={};s&16&&(l.disabled=o[4]!=null),s&1&&(l.value=o[0].isStartingEra),s&32&&(l.desc=o[5]),e.$set(l),o[0].isStartingEra?i&&(Oe(),R(i,1,1,()=>{i=null}),_e()):i?(i.p(o,s),s&1&&P(i,1)):(i=o3(o),i.c(),P(i,1),i.m(n.parentNode,n))},i(o){a||(P(e.$$.fragment,o),P(i),a=!0)},o(o){R(e.$$.fragment,o),R(i),a=!1},d(o){o&&(A(t),A(n)),Y(e,o),i&&i.d(o)}}}function s3(r){let e,t;return e=new xt({props:{name:"Event",open:!1,$$slots:{default:[$R]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a&268435465&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function l3(r){let e,t,n;return t=new lt({props:{$$slots:{control:[AR],name:[SR]},$$scope:{ctx:r}}}),{c(){e=_("div"),z(t.$$.fragment),g(e,"class","setting-item svelte-1k8q18g")},m(a,i){$(a,e,i),W(t,e,null),n=!0},p(a,i){let o={};i&268435465&&(o.$$scope={dirty:i,ctx:a}),t.$set(o)},i(a){n||(P(t.$$.fragment,a),n=!0)},o(a){R(t.$$.fragment,a),n=!1},d(a){a&&A(e),Y(t)}}}function SR(r){let e;return{c(){e=_("div"),e.textContent="Event category",g(e,"slot","name")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function u3(r){let e,t=r[25].name+"",n,a,i;return{c(){e=_("option"),n=le(t),e.__value=a=r[25].id,Re(e,e.__value),e.selected=i=r[0].category===r[25].id},m(o,s){$(o,e,s),y(e,n)},p(o,s){s&8&&t!==(t=o[25].name+"")&&ve(n,t),s&8&&a!==(a=o[25].id)&&(e.__value=a,Re(e,e.__value)),s&9&&i!==(i=o[0].category===o[25].id)&&(e.selected=i)},d(o){o&&A(e)}}}function AR(r){let e,t,n,a,i,o,s=$e(r[3].categories),l=[];for(let u=0;ur[23].call(e))},m(u,c){$(u,e,c),y(e,t),y(t,n);for(let f=0;f{i=null}),_e())},i(o){a||(P(e.$$.fragment,o),P(i),a=!0)},o(o){R(e.$$.fragment,o),R(i),a=!1},d(o){o&&(A(t),A(n)),Y(e,o),i&&i.d(o)}}}function TR(r){let e,t,n,a,i,o;e=new xt({props:{name:"Details",open:!0,$$slots:{default:[OR]},$$scope:{ctx:r}}}),n=new xt({props:{name:"Duration",open:!1,$$slots:{default:[xR]},$$scope:{ctx:r}}});let s=!r[0].isStartingEra&&s3(r);return{c(){z(e.$$.fragment),t=F(),z(n.$$.fragment),a=F(),s&&s.c(),i=He()},m(l,u){W(e,l,u),$(l,t,u),W(n,l,u),$(l,a,u),s&&s.m(l,u),$(l,i,u),o=!0},p(l,[u]){let c={};u&268435469&&(c.$$scope={dirty:u,ctx:l}),e.$set(c);let f={};u&268435569&&(f.$$scope={dirty:u,ctx:l}),n.$set(f),l[0].isStartingEra?s&&(Oe(),R(s,1,1,()=>{s=null}),_e()):s?(s.p(l,u),u&1&&P(s,1)):(s=s3(l),s.c(),P(s,1),s.m(i.parentNode,i))},i(l){o||(P(e.$$.fragment,l),P(n.$$.fragment,l),P(s),o=!0)},o(l){R(e.$$.fragment,l),R(n.$$.fragment,l),R(s),o=!1},d(l){l&&(A(t),A(a),A(i)),Y(e,l),Y(n,l),s&&s.d(l)}}}function NR(r,e,t){let n,a,i=I,o=()=>(i(),i=be(f,X=>t(3,a=X)),f),s,l,u;r.$$.on_destroy.push(()=>i());let{era:c}=e,{store:f}=e;o(),Sn("store",f);let{eraStore:d}=f,h=de(d,X=>X.find(fe=>c.id!=fe.id&&fe.isStartingEra));ie(r,h,X=>t(4,s=X));let p=de(h,X=>X?"This era can't be set to the starting era, because a starting era already exists.":"");ie(r,p,X=>t(5,l=X));let m=Ze(c.isStartingEra?null:c.end);ie(r,m,X=>t(6,u=X)),m.subscribe(X=>{c.isStartingEra||t(0,c.end=X??void 0,c)});let O=X=>{new Jf.ExtraButtonComponent(X).setIcon(Lt).setTooltip("Make recurring")},b=Ze(!1);ie(r,b,X=>t(2,n=X));let E=X=>{new Jf.ExtraButtonComponent(X).setIcon("help-circle").onClick(()=>Ce(b,n=!n,n))},D=X=>{new Jf.ExtraButtonComponent(X).setIcon("calendar-range")},C=X=>t(0,c.name=X.detail,c),k=X=>t(0,c.description=X.detail,c);function w(){c.format=this.value,t(0,c)}let T=()=>t(0,c.isStartingEra=!c.isStartingEra,c),S=()=>t(0,c.endsYear=!c.endsYear,c),M=()=>{c.isStartingEra||Ce(m,u={...c.date},u)},Z=()=>{Ce(m,u=null,u)},N=()=>t(0,c.isEvent=!c.isEvent,c),L=()=>t(0,c.category=null,c);function j(){c.category=Gt(this),t(0,c)}return r.$$set=X=>{"era"in X&&t(0,c=X.era),"store"in X&&o(t(1,f=X.store))},[c,f,n,a,s,l,u,h,p,m,O,b,E,D,C,k,w,T,S,M,Z,N,L,j]}var e0=class extends ae{constructor(e){super(),oe(this,e,NR,TR,re,{era:0,store:1},vR)}},c3=e0;var ed=class extends pn{constructor(t,n,a){super();this.plugin=t;this.store=n;this.era={id:Le(6),type:Nn.Era,name:"",description:"",format:"{{era_name}}",endsYear:!1,isEvent:!1,category:null,isStartingEra:!1,date:at(Ne(this.store.currentStore))};typeof a=="string"?this.era.name=a:this.era=at(a),this.setTitle("Edit era")}async display(){this.$ui=new c3({target:this.contentEl,props:{era:this.era,store:this.store}})}close(){this.$ui?.$destroy(),super.close()}};var td=require("obsidian");function f3(r,e,t){let n=r.slice();return n[10]=e[t],n}function PR(r){let e,t,n=$e(r[0]),a=[];for(let o=0;oR(a[o],1,1,()=>{a[o]=null});return{c(){e=_("div");for(let o=0;o{c[p]=null}),_e(),t=c[e],t?t.p(d,h):(t=c[e]=u[e](d),t.c()),P(t,1),t.m(n.parentNode,n));let m={};h&8192&&(m.$$scope={dirty:h,ctx:d}),s.$set(m)},i(d){l||(P(t),P(a.$$.fragment,d),P(s.$$.fragment,d),l=!0)},o(d){R(t),R(a.$$.fragment,d),R(s.$$.fragment,d),l=!1},d(d){d&&(A(n),A(i),A(o)),c[e].d(d),Y(a,d),Y(s)}}}function ZR(r){let e,t;return e=new xt({props:{name:"Eras",open:td.Platform.isDesktop,desc:`${r[0].length} era${r[0].length!=1?"s":""}`,$$slots:{default:[FR]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&1&&(i.desc=`${n[0].length} era${n[0].length!=1?"s":""}`),a&8193&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function qR(r,e,t){let n,a,i=Ve("store");ie(r,i,h=>t(8,n=h));let o=Ve("plugin"),{eraStore:s}=i;ie(r,s,h=>t(0,a=h));let l=h=>{let p=new ed(o,i,h);p.onClose=()=>{typeof h=="string"?s.add(p.era):s.update(h.id,p.era)},p.open()};return[a,i,s,l,h=>{new td.ToggleComponent(h).setValue(n.hideEra??!0)},h=>l(h),h=>s.delete(h.id??""),h=>l(h.detail)]}var t0=class extends ae{constructor(e){super(),oe(this,e,qR,ZR,re,{})}},h3=t0;var p3=["General","Dates","Eras","Seasons & weather","Locations","Celestial bodies","Events"];var an=require("obsidian");var n0=Gn(Fc());function LR(r){we(r,"svelte-15nhxd3",".has-decorator.svelte-15nhxd3.svelte-15nhxd3{position:relative}.has-decorator.svelte-15nhxd3 input.svelte-15nhxd3{padding-right:10px;width:5rem}.input-decorator.svelte-15nhxd3.svelte-15nhxd3{position:absolute;right:0.5rem;top:50%;transform:translateY(-50%);color:var(--text-accent)}.flex-center.svelte-15nhxd3.svelte-15nhxd3{display:flex;align-items:center;gap:0.5rem}")}function BR(r){let e,t,n,a,i,o;return{c(){e=_("div"),t=_("div"),a=le(` Temperature range`),g(e,"slot","name"),g(e,"class","flex-center svelte-15nhxd3")},m(s,l){$(s,e,l),y(e,t),y(e,a),i||(o=me(n=vt.call(null,t,"thermometer")),i=!0)},p:I,d(s){s&&A(e),i=!1,o()}}}function UR(r){let e;return{c(){e=_("div"),e.innerHTML="Set the average minimum and maximum temperatures",g(e,"slot","desc")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function WR(r){let e;return{c(){e=le("C")},m(t,n){$(t,e,n)},d(t){t&&A(e)}}}function YR(r){let e;return{c(){e=le("F")},m(t,n){$(t,e,n)},d(t){t&&A(e)}}}function zR(r){let e;return{c(){e=le("C")},m(t,n){$(t,e,n)},d(t){t&&A(e)}}}function VR(r){let e;return{c(){e=le("F")},m(t,n){$(t,e,n)},d(t){t&&A(e)}}}function jR(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p;function m(k,w){return k[0]===et.IMPERIAL?YR:WR}let O=m(r,-1),b=O(r);function E(k,w){return k[0]===et.IMPERIAL?VR:zR}let D=E(r,-1),C=D(r);return{c(){e=_("div"),t=_("div"),n=_("input"),a=F(),i=_("span"),o=le("\xB0"),b.c(),s=F(),l=_("div"),u=_("input"),c=F(),f=_("span"),d=le("\xB0"),C.c(),g(n,"type","number"),g(n,"spellcheck","false"),g(n,"placeholder","minimum"),g(n,"class","svelte-15nhxd3"),g(i,"class","input-decorator svelte-15nhxd3"),g(t,"class","has-decorator svelte-15nhxd3"),g(u,"type","number"),g(u,"spellcheck","false"),g(u,"placeholder","minimum"),g(u,"class","svelte-15nhxd3"),g(f,"class","input-decorator svelte-15nhxd3"),g(l,"class","has-decorator svelte-15nhxd3"),g(e,"slot","control"),g(e,"class","setting-item-control")},m(k,w){$(k,e,w),y(e,t),y(t,n),Re(n,r[1]),y(t,a),y(t,i),y(i,o),b.m(i,null),y(e,s),y(e,l),y(l,u),Re(u,r[2]),y(l,c),y(l,f),y(f,d),C.m(f,null),h||(p=[ce(n,"input",r[14]),ce(u,"input",r[15])],h=!0)},p(k,w){w&2&&Ct(n.value)!==k[1]&&Re(n,k[1]),O!==(O=m(k,w))&&(b.d(1),b=O(k),b&&(b.c(),b.m(i,null))),w&4&&Ct(u.value)!==k[2]&&Re(u,k[2]),D!==(D=E(k,w))&&(C.d(1),C=D(k),C&&(C.c(),C.m(f,null)))},d(k){k&&A(e),b.d(),C.d(),h=!1,Te(p)}}}function XR(r){let e,t,n,a,i,o;return{c(){e=_("div"),t=_("div"),a=le(` Precipitation chance`),g(e,"slot","name"),g(e,"class","flex-center svelte-15nhxd3")},m(s,l){$(s,e,l),y(e,t),y(e,a),i||(o=me(n=vt.call(null,t,"droplets")),i=!0)},p:I,d(s){s&&A(e),i=!1,o()}}}function GR(r){let e;return{c(){e=_("div"),e.innerHTML="Increases likelihood of precipitation occuring",g(e,"slot","desc")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function HR(r){let e,t,n,a,i,o,s;return{c(){e=_("div"),t=_("div"),n=_("input"),a=F(),i=_("span"),i.textContent="%",g(n,"type","number"),g(n,"spellcheck","false"),g(n,"min","0"),g(n,"max","100"),g(n,"class","svelte-15nhxd3"),g(i,"class","input-decorator svelte-15nhxd3"),g(t,"class","has-decorator svelte-15nhxd3"),g(e,"slot","control")},m(l,u){$(l,e,u),y(e,t),y(t,n),Re(n,r[3]),y(t,a),y(t,i),o||(s=ce(n,"input",r[16]),o=!0)},p(l,u){u&8&&Ct(n.value)!==l[3]&&Re(n,l[3])},d(l){l&&A(e),o=!1,s()}}}function KR(r){let e,t,n,a,i,o;return{c(){e=_("div"),t=_("div"),a=le(` Precipitation intensity`),g(e,"slot","name"),g(e,"class","flex-center svelte-15nhxd3")},m(s,l){$(s,e,l),y(e,t),y(e,a),i||(o=me(n=vt.call(null,t,"cloud-lightning")),i=!0)},p:I,d(s){s&&A(e),i=!1,o()}}}function JR(r){let e;return{c(){e=_("div"),e.innerHTML="How strong the precipitation is, when it occurs",g(e,"slot","desc")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function eQ(r){let e,t,n,a,i,o,s;return{c(){e=_("div"),t=_("div"),n=_("input"),a=F(),i=_("span"),i.textContent="%",g(n,"type","number"),g(n,"spellcheck","false"),g(n,"min","0"),g(n,"max","100"),g(n,"class","svelte-15nhxd3"),g(i,"class","input-decorator svelte-15nhxd3"),g(t,"class","has-decorator svelte-15nhxd3"),g(e,"slot","control")},m(l,u){$(l,e,u),y(e,t),y(t,n),Re(n,r[4]),y(t,a),y(t,i),o||(s=ce(n,"input",r[17]),o=!0)},p(l,u){u&16&&Ct(n.value)!==l[4]&&Re(n,l[4])},d(l){l&&A(e),o=!1,s()}}}function tQ(r){let e,t,n,a,i,o;return{c(){e=_("div"),t=_("div"),a=le(` Windiness`),g(e,"slot","name"),g(e,"class","flex-center svelte-15nhxd3")},m(s,l){$(s,e,l),y(e,t),y(e,a),i||(o=me(n=vt.call(null,t,"wind")),i=!0)},p:I,d(s){s&&A(e),i=!1,o()}}}function rQ(r){let e;return{c(){e=_("div"),e.innerHTML="Increases likelihood of stronger wind",g(e,"slot","desc")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function nQ(r){let e,t,n,a,i,o,s;return{c(){e=_("div"),t=_("div"),n=_("input"),a=F(),i=_("span"),i.textContent="%",g(n,"type","number"),g(n,"spellcheck","false"),g(n,"min","0"),g(n,"max","100"),g(n,"class","svelte-15nhxd3"),g(i,"class","input-decorator svelte-15nhxd3"),g(t,"class","has-decorator svelte-15nhxd3"),g(e,"slot","control")},m(l,u){$(l,e,u),y(e,t),y(t,n),Re(n,r[5]),y(t,a),y(t,i),o||(s=ce(n,"input",r[18]),o=!0)},p(l,u){u&32&&Ct(n.value)!==l[5]&&Re(n,l[5])},d(l){l&&A(e),o=!1,s()}}}function aQ(r){let e,t,n,a,i,o;return{c(){e=_("div"),t=_("div"),a=le(` Cloudiness`),g(e,"slot","name"),g(e,"class","flex-center svelte-15nhxd3")},m(s,l){$(s,e,l),y(e,t),y(e,a),i||(o=me(n=vt.call(null,t,"cloudy")),i=!0)},p:I,d(s){s&&A(e),i=!1,o()}}}function iQ(r){let e;return{c(){e=_("div"),e.innerHTML="Increases likelihood of cloud coverage",g(e,"slot","desc")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function oQ(r){let e,t,n,a,i,o,s;return{c(){e=_("div"),t=_("div"),n=_("input"),a=F(),i=_("span"),i.textContent="%",g(n,"type","number"),g(n,"spellcheck","false"),g(n,"min","0"),g(n,"max","100"),g(n,"class","svelte-15nhxd3"),g(i,"class","input-decorator svelte-15nhxd3"),g(t,"class","has-decorator svelte-15nhxd3"),g(e,"slot","control")},m(l,u){$(l,e,u),y(e,t),y(t,n),Re(n,r[6]),y(t,a),y(t,i),o||(s=ce(n,"input",r[19]),o=!0)},p(l,u){u&64&&Ct(n.value)!==l[6]&&Re(n,l[6])},d(l){l&&A(e),o=!1,s()}}}function sQ(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p,m;return t=new lt({props:{$$slots:{control:[jR],desc:[UR],name:[BR]},$$scope:{ctx:r}}}),i=new lt({props:{$$slots:{control:[HR],desc:[GR],name:[XR]},$$scope:{ctx:r}}}),l=new lt({props:{$$slots:{control:[eQ],desc:[JR],name:[KR]},$$scope:{ctx:r}}}),f=new lt({props:{$$slots:{control:[nQ],desc:[rQ],name:[tQ]},$$scope:{ctx:r}}}),p=new lt({props:{$$slots:{control:[oQ],desc:[iQ],name:[aQ]},$$scope:{ctx:r}}}),{c(){e=_("div"),z(t.$$.fragment),n=F(),a=_("div"),z(i.$$.fragment),o=F(),s=_("div"),z(l.$$.fragment),u=F(),c=_("div"),z(f.$$.fragment),d=F(),h=_("div"),z(p.$$.fragment),g(e,"class","setting-item"),g(a,"class","setting-item"),g(s,"class","setting-item"),g(c,"class","setting-item"),g(h,"class","setting-item")},m(O,b){$(O,e,b),W(t,e,null),$(O,n,b),$(O,a,b),W(i,a,null),$(O,o,b),$(O,s,b),W(l,s,null),$(O,u,b),$(O,c,b),W(f,c,null),$(O,d,b),$(O,h,b),W(p,h,null),m=!0},p(O,[b]){let E={};b&1048583&&(E.$$scope={dirty:b,ctx:O}),t.$set(E);let D={};b&1048584&&(D.$$scope={dirty:b,ctx:O}),i.$set(D);let C={};b&1048592&&(C.$$scope={dirty:b,ctx:O}),l.$set(C);let k={};b&1048608&&(k.$$scope={dirty:b,ctx:O}),f.$set(k);let w={};b&1048640&&(w.$$scope={dirty:b,ctx:O}),p.$set(w)},i(O){m||(P(t.$$.fragment,O),P(i.$$.fragment,O),P(l.$$.fragment,O),P(f.$$.fragment,O),P(p.$$.fragment,O),m=!0)},o(O){R(t.$$.fragment,O),R(i.$$.fragment,O),R(l.$$.fragment,O),R(f.$$.fragment,O),R(p.$$.fragment,O),m=!1},d(O){O&&(A(e),A(n),A(a),A(o),A(s),A(u),A(c),A(d),A(h)),Y(t),Y(i),Y(l),Y(f),Y(p)}}}function rd(r){return Number((r/100).toPrecision(2))}function lQ(r,e,t){let n,a,i,o,s,l,{units:u}=e,{data:c}=e,f=Ze(jo(c.tempRange[0],u));ie(r,f,T=>t(1,n=T)),f.subscribe(T=>{t(13,c.tempRange[0]=jo(T,et.METRIC,u),c)});let d=Ze(jo(c.tempRange[1],u));ie(r,d,T=>t(2,a=T)),d.subscribe(T=>{t(13,c.tempRange[1]=jo(T,et.METRIC,u),c)});let h=Ze(c.precipitationChance*100);ie(r,h,T=>t(3,i=T)),h.subscribe(T=>{t(13,c.precipitationChance=rd(T),c)});let p=Ze(c.precipitationIntensity*100);ie(r,p,T=>t(4,o=T)),p.subscribe(T=>{t(13,c.precipitationIntensity=rd(T),c)});let m=Ze(c.windy*100);ie(r,m,T=>t(5,s=T)),m.subscribe(T=>{t(13,c.windy=rd(T),c)});let O=Ze(c.cloudy*100);ie(r,O,T=>t(6,l=T)),O.subscribe(T=>{t(13,c.cloudy=rd(T),c)});function b(){n=Ct(this.value),f.set(n)}function E(){a=Ct(this.value),d.set(a)}function D(){i=Ct(this.value),h.set(i)}function C(){o=Ct(this.value),p.set(o)}function k(){s=Ct(this.value),m.set(s)}function w(){l=Ct(this.value),O.set(l)}return r.$$set=T=>{"units"in T&&t(0,u=T.units),"data"in T&&t(13,c=T.data)},[u,n,a,i,o,s,l,f,d,h,p,m,O,c,b,E,D,C,k,w]}var r0=class extends ae{constructor(e){super(),oe(this,e,lQ,sQ,re,{units:0,data:13},LR)}},m3=r0;function uQ(r,e){return r===ot.DATED?{id:Le(6),name:e??"",type:ot.DATED,color:(0,n0.default)(),month:0,day:1,weatherOffset:56,weatherPeak:5,kind:Dt.NONE}:{id:Le(6),name:e??"",type:ot.PERIODIC,color:(0,n0.default)(),duration:0,peak:0,weatherOffset:56,weatherPeak:5,kind:Dt.NONE}}var du=class extends pn{constructor(t,n,a,i,o){super();this.calendar=t;this.store=n;this.valid=!0;o||(this.creating=!0),this.item=o?{...o}:uQ(a,i),this.titleEl.setText(`${this.creating?"Create":"Modify"} season`)}async display(){this.contentEl.empty();let t=this.contentEl;if(this.calendar.seasonal.weather.enabled&&(new an.Setting(this.contentEl).setName("Seasonal information").setHeading().setClass("has-children"),t=this.contentEl.createDiv("setting-container")),new an.Setting(t).setName("Name").addText(n=>{n.setValue(this.item.name??"").onChange(a=>this.item.name=a)}),new an.Setting(t).setName("Color").addColorPicker(n=>{n.setValue(this.item.color??"").onChange(a=>this.item.color=a)}),this.item.type===ot.DATED){let n=new Wa({target:t.createDiv(),props:{date:Ze({month:this.item.month,day:this.item.day,year:0}),enableYear:!1,store:this.store}});n.$on("date",a=>{this.item.type===ot.DATED&&(this.item.month=a.detail.month,this.item.day=a.detail.day)}),n.$on("valid",a=>this.valid=a.detail)}if(this.item.type===ot.PERIODIC){let n=this.item;new an.Setting(t).setName("Duration").setDesc("Seasons will transition to the next season over this number of days.").addText(a=>{a.inputEl.type="number",a.setValue(`${n.duration}`).onChange(i=>{isNaN(Number(i))||(n.duration=Number(i))})}).addExtraButton(a=>a.setIcon("calculator").onClick(()=>{let i=Bi(this.calendar);for(let o of this.calendar.seasonal.seasons)o.type===ot.PERIODIC&&o.id!==this.item.id&&(i-=o.duration);n.duration=Number(i.toPrecision(10)),this.display()})),new an.Setting(t).setName("Peak duration").setDesc("Seasons will remain in effect for this number of days before beginning to transition.").addText(a=>{a.inputEl.type="number",a.setValue(`${n.peak}`).onChange(i=>{isNaN(Number(i))||(n.peak=Number(i))})})}if(this.calendar.seasonal.weather.enabled){new an.Setting(this.contentEl).setName("Weather").setHeading().setDesc(createFragment(i=>{i.createSpan({text:"The weather will be calculated using this data during this season."}),i.createEl("p",{text:"The surrounding seasons will also affect the weather, but the closer you are to the peak, the stronger the current effect is."})})).setClass("has-children");let n=this.contentEl.createDiv("setting-container");new an.Setting(n).setName("Peak weather offset").setDesc("Number of days before the 'peak' weather of the season. Typically this occurs a few months into the season.").addText(i=>i.setValue(`${this.item.weatherOffset}`).onChange(o=>this.item.weatherOffset=Number(o)).inputEl.type="number"),new an.Setting(n).setName("Peak weather duration").setDesc("How long a season's peak weather lasts.").addText(i=>i.setValue(`${this.item.weatherPeak}`).onChange(o=>this.item.weatherPeak=Number(o)).inputEl.type="number");let a=new an.Setting(n).setName("Kind").setDesc(createFragment(i=>{let o=Ma(this.item),s=this.calendar.seasonal.weather.tempUnits;if(!o){i.createSpan({text:"No weather data set"});return}let l=i.createDiv("weather-data"),u=l.createDiv("weather-icon");(0,an.setIcon)(u,"thermometer"),u.createSpan({text:`${jr(o.tempRange[0],s)}\u2013${jr(o.tempRange[1],s)}`});let c=l.createDiv("weather-icon");(0,an.setIcon)(c,"droplets"),c.createSpan({text:`${o.precipitationChance*100}%`});let f=l.createDiv("weather-icon");(0,an.setIcon)(f,"cloud-lightning"),f.createSpan({text:`${o.precipitationIntensity*100}%`});let d=l.createDiv("weather-icon");(0,an.setIcon)(d,"wind"),d.createSpan({text:`${o.windy*100}%`});let h=l.createDiv("weather-icon");(0,an.setIcon)(h,"cloudy"),h.createSpan({text:`${o.cloudy*100}%`})})).addDropdown(i=>{for(let o of Object.values(Dt))i.addOption(o,o);i.setValue(this.item.kind).onChange(o=>{let s=Ma(this.item);this.item.kind=o,this.item.kind===Dt.CUSTOM&&s&&!("weather"in this.item)&&(this.item.weather=at(s)),this.display()})});this.item.kind===Dt.CUSTOM&&a.addExtraButton(i=>i.setIcon(Ar).onClick(()=>{if(this.item.kind===Dt.CUSTOM){let o=new hu(at(this.item.weather),this.calendar.seasonal.weather.tempUnits);o.onClose=()=>{this.item.kind===Dt.CUSTOM&&(this.item.weather=at(o.item)),this.display()},o.open()}}))}}},hu=class extends pn{constructor(t,n){super();this.item=t;this.units=n}async display(){this.contentEl.empty(),new m3({target:this.contentEl,props:{data:this.item,units:this.units}})}};function cQ(r){we(r,"svelte-kf30o1",".season.svelte-kf30o1{border-left:1px solid var(--season-color);padding-left:0.5rem}.season-desc-container.svelte-kf30o1{display:flex;align-items:center;--icon-size:var(--font-ui-smaller);gap:0.25rem}.periodic.svelte-kf30o1{gap:0}")}function fQ(r){let e,t,n=r[0].name+"",a;return{c(){e=_("div"),t=_("span"),a=le(n),g(t,"class","season-name"),g(e,"slot","name")},m(i,o){$(i,e,o),y(e,t),y(t,a)},p(i,o){o&1&&n!==(n=i[0].name+"")&&ve(a,n)},d(i){i&&A(e)}}}function g3(r){let e,t,n,a;return{c(){e=_("div")},m(i,o){$(i,e,o),n||(a=me(t=vt.call(null,e,fp(r[0].kind))),n=!0)},p(i,o){t&&qt(t.update)&&o&1&&t.update.call(null,fp(i[0].kind))},d(i){i&&A(e),n=!1,a()}}}function y3(r){let e,t,n,a,i=r[0].duration+"",o,s,l,u,c=r[0].peak&&b3(r);return{c(){e=_("span"),t=_("div"),a=F(),o=le(i),s=F(),c&&c.c(),g(e,"class","season-desc-container periodic svelte-kf30o1")},m(f,d){$(f,e,d),y(e,t),y(e,a),y(e,o),y(e,s),c&&c.m(e,null),l||(u=me(n=vt.call(null,t,"hourglass")),l=!0)},p(f,d){d&1&&i!==(i=f[0].duration+"")&&ve(o,i),f[0].peak?c?c.p(f,d):(c=b3(f),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},d(f){f&&A(e),c&&c.d(),l=!1,u()}}}function b3(r){let e,t,n,a,i=r[0].peak+"",o,s,l,u;return{c(){e=le(`( `),t=_("div"),a=F(),o=le(i),s=le(")")},m(c,f){$(c,e,f),$(c,t,f),$(c,a,f),$(c,o,f),$(c,s,f),l||(u=me(n=vt.call(null,t,"mountain")),l=!0)},p(c,f){f&1&&i!==(i=c[0].peak+"")&&ve(o,i)},d(c){c&&(A(e),A(t),A(a),A(o),A(s)),l=!1,u()}}}function v3(r){let e,t=Fr({month:r[0].month,day:r[0].day,year:0},r[1],null,"MMMM D")+"",n;return{c(){e=_("span"),n=le(t)},m(a,i){$(a,e,i),y(e,n)},p(a,i){i&3&&t!==(t=Fr({month:a[0].month,day:a[0].day,year:0},a[1],null,"MMMM D")+"")&&ve(n,t)},d(a){a&&A(e)}}}function dQ(r){let e,t,n,a,i=r[0].kind&&r[0].kind!=Dt.NONE&&g3(r),o=r[0].type===ot.PERIODIC&&y3(r),s=r[0].type===ot.DATED&&v3(r);return{c(){e=_("div"),t=_("div"),i&&i.c(),n=F(),o&&o.c(),a=F(),s&&s.c(),g(t,"class","season-desc-container svelte-kf30o1"),g(e,"slot","desc")},m(l,u){$(l,e,u),y(e,t),i&&i.m(t,null),y(t,n),o&&o.m(t,null),y(t,a),s&&s.m(t,null)},p(l,u){l[0].kind&&l[0].kind!=Dt.NONE?i?i.p(l,u):(i=g3(l),i.c(),i.m(t,n)):i&&(i.d(1),i=null),l[0].type===ot.PERIODIC?o?o.p(l,u):(o=y3(l),o.c(),o.m(t,a)):o&&(o.d(1),o=null),l[0].type===ot.DATED?s?s.p(l,u):(s=v3(l),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},d(l){l&&A(e),i&&i.d(),o&&o.d(),s&&s.d()}}}function hQ(r){let e,t,n;return t=new lt({props:{$$slots:{desc:[dQ],name:[fQ]},$$scope:{ctx:r}}}),{c(){e=_("div"),z(t.$$.fragment),g(e,"class","season svelte-kf30o1"),Pt(e,"--season-color",r[0].color)},m(a,i){$(a,e,i),W(t,e,null),n=!0},p(a,[i]){let o={};i&11&&(o.$$scope={dirty:i,ctx:a}),t.$set(o),(!n||i&1)&&Pt(e,"--season-color",a[0].color)},i(a){n||(P(t.$$.fragment,a),n=!0)},o(a){R(t.$$.fragment,a),n=!1},d(a){a&&A(e),Y(t)}}}function pQ(r,e,t){let n,a=Ve("store");ie(r,a,o=>t(1,n=o));let{item:i}=e;return r.$$set=o=>{"item"in o&&t(0,i=o.item)},[i,n,a]}var a0=class extends ae{constructor(e){super(),oe(this,e,pQ,hQ,re,{item:0},cQ)}},O3=a0;var _3=require("obsidian");function mQ(r){we(r,"svelte-670qgz",".center.svelte-670qgz{display:flex;flex-flow:column;align-items:center;justify-content:center}")}function gQ(r){let e;return{c(){e=le(r[4])},m(t,n){$(t,e,n)},p(t,n){n&16&&ve(e,t[4])},d(t){t&&A(e)}}}function yQ(r){let e,t,n,a;return{c(){e=_("div"),g(e,"class","center svelte-670qgz")},m(i,o){$(i,e,o),n||(a=me(t=r[5].call(null,e)),n=!0)},p:I,d(i){i&&A(e),n=!1,a()}}}function bQ(r){let e,t,n,a,i,o,s,l,u,c,f,d;function h(O,b){if(O[3])return yQ;if(O[4])return gQ}let p=h(r,-1),m=p&&p(r);return{c(){e=_("div"),t=_("div"),n=_("div"),a=le(r[0]),i=F(),o=_("div"),s=le(r[1]),l=F(),u=_("div"),c=_("button"),m&&m.c(),g(n,"class","setting-item-name"),g(o,"class","setting-item-description"),g(t,"class","setting-item-info"),g(c,"aria-label",r[2]),g(u,"class","setting-item-control"),g(e,"class","setting-item")},m(O,b){$(O,e,b),y(e,t),y(t,n),y(n,a),y(t,i),y(t,o),y(o,s),y(e,l),y(e,u),y(u,c),m&&m.m(c,null),f||(d=ce(c,"click",r[6]),f=!0)},p(O,[b]){b&1&&ve(a,O[0]),b&2&&ve(s,O[1]),p===(p=h(O,b))&&m?m.p(O,b):(m&&m.d(1),m=p&&p(O),m&&(m.c(),m.m(c,null))),b&4&&g(c,"aria-label",O[2])},i:I,o:I,d(O){O&&A(e),m&&m.d(),f=!1,d()}}}function vQ(r,e,t){let{name:n}=e,{desc:a=""}=e,{label:i=null}=e,{icon:o=null}=e,{text:s=null}=e,l=c=>{(0,_3.setIcon)(c,o??"")};function u(c){Zr.call(this,r,c)}return r.$$set=c=>{"name"in c&&t(0,n=c.name),"desc"in c&&t(1,a=c.desc),"label"in c&&t(2,i=c.label),"icon"in c&&t(3,o=c.icon),"text"in c&&t(4,s=c.text)},[n,a,i,o,s,l,u]}var i0=class extends ae{constructor(e){super(),oe(this,e,vQ,bQ,re,{name:0,desc:1,label:2,icon:3,text:4},mQ)}},w3=i0;var E3=require("obsidian");function OQ(r){we(r,"svelte-8d528f",".existing-items.svelte-8d528f{margin-top:1rem}")}function D3(r){let e,t;return e=new er({props:{name:"Gradient seasonal colors",desc:"When seasonal colors are displayed, show a gradient between one color and the next.",value:r[5]}}),e.$on("click",r[21]),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a&32&&(i.value=n[5]),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function _Q(r){let e;return{c(){e=_("div"),e.textContent="Season type",g(e,"slot","name")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function wQ(r){let e;return{c(){e=_("div"),e.textContent="Change how the start and end dates for seasons are calculated",g(e,"slot","desc")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function DQ(r){let e,t,n=ot.DATED+"",a,i,o,s,l=ot.PERIODIC+"",u,c,f,d,h;return{c(){e=_("select"),t=_("option"),a=le(n),s=_("option"),u=le(l),t.__value=i=ot.DATED,Re(t,t.__value),t.selected=o=r[3]===ot.DATED,s.__value=c=ot.PERIODIC,Re(s,s.__value),s.selected=f=r[3]===ot.PERIODIC,g(e,"slot","control"),g(e,"class","dropdown"),r[3]===void 0&&St(()=>r[22].call(e))},m(p,m){$(p,e,m),y(e,t),y(t,a),y(e,s),y(s,u),ht(e,r[3],!0),d||(h=ce(e,"change",r[22]),d=!0)},p(p,m){m&8&&o!==(o=p[3]===ot.DATED)&&(t.selected=o),m&8&&f!==(f=p[3]===ot.PERIODIC)&&(s.selected=f),m&8&&ht(e,p[3])},d(p){p&&A(e),d=!1,h()}}}function C3(r){let e,t,n,a;return e=new ln({props:{name:"Seasonal offset",desc:"Offset the first season from the start of the year. An offset of 0 means the seasons start on 1/1/0001.",value:r[6],type:"number"}}),e.$on("change",r[23]),n=new w3({props:{name:"Distribute seasonal periods",desc:"Evenly distribute the year between your seasons, taking into account month length and leap days.",icon:"align-vertical-space-around"}}),n.$on("click",r[24]),{c(){z(e.$$.fragment),t=F(),z(n.$$.fragment)},m(i,o){W(e,i,o),$(i,t,o),W(n,i,o),a=!0},p(i,o){let s={};o&64&&(s.value=i[6]),e.$set(s)},i(i){a||(P(e.$$.fragment,i),P(n.$$.fragment,i),a=!0)},o(i){R(e.$$.fragment,i),R(n.$$.fragment,i),a=!1},d(i){i&&A(t),Y(e,i),Y(n,i)}}}function CQ(r){let e,t=r[0],n,a=k3(r);return{c(){e=_("div"),a.c(),g(e,"class","existing-items svelte-8d528f")},m(i,o){$(i,e,o),a.m(e,null),n=!0},p(i,o){o&1&&re(t,t=i[0])?(Oe(),R(a,1,1,I),_e(),a=k3(i),a.c(),P(a,1),a.m(e,null)):a.p(i,o)},i(i){n||(P(a),n=!0)},o(i){R(a),n=!1},d(i){i&&A(e),a.d(i)}}}function kQ(r){let e,t;return e=new gr({props:{message:"Create a new season to see it here."}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p:I,i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function k3(r){let e,t;return e=new yi({props:{type:"season",items:r[1],onDrop:r[25],dragDisabled:r[3]===ot.DATED,component:O3}}),e.$on("delete",r[26]),e.$on("advanced",r[27]),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a&2&&(i.items=n[1]),a&8&&(i.dragDisabled=n[3]===ot.DATED),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function EQ(r){let e,t,n,a,i,o,s,l,u,c,f,d;e=new er({props:{name:"Display seasonal colors",desc:"Show seasonal colors on the calendar. Can be changed using the calendar settings menu.",value:r[4]}}),e.$on("click",r[20]);let h=r[4]&&D3(r);i=new lt({props:{$$slots:{control:[DQ],desc:[wQ],name:[_Q]},$$scope:{ctx:r}}});let p=r[3]==ot.PERIODIC&&C3(r),m=[kQ,CQ],O=[];function b(E,D){return E[0].length?1:0}return l=b(r,-1),u=O[l]=m[l](r),f=new mr({}),f.$on("add",r[28]),{c(){z(e.$$.fragment),t=F(),h&&h.c(),n=F(),a=_("div"),z(i.$$.fragment),o=F(),p&&p.c(),s=F(),u.c(),c=F(),z(f.$$.fragment),g(a,"class","setting-item")},m(E,D){W(e,E,D),$(E,t,D),h&&h.m(E,D),$(E,n,D),$(E,a,D),W(i,a,null),$(E,o,D),p&&p.m(E,D),$(E,s,D),O[l].m(E,D),$(E,c,D),W(f,E,D),d=!0},p(E,D){let C={};D&16&&(C.value=E[4]),e.$set(C),E[4]?h?(h.p(E,D),D&16&&P(h,1)):(h=D3(E),h.c(),P(h,1),h.m(n.parentNode,n)):h&&(Oe(),R(h,1,1,()=>{h=null}),_e());let k={};D&536870920&&(k.$$scope={dirty:D,ctx:E}),i.$set(k),E[3]==ot.PERIODIC?p?(p.p(E,D),D&8&&P(p,1)):(p=C3(E),p.c(),P(p,1),p.m(s.parentNode,s)):p&&(Oe(),R(p,1,1,()=>{p=null}),_e());let w=l;l=b(E,D),l===w?O[l].p(E,D):(Oe(),R(O[w],1,1,()=>{O[w]=null}),_e(),u=O[l],u?u.p(E,D):(u=O[l]=m[l](E),u.c()),P(u,1),u.m(c.parentNode,c))},i(E){d||(P(e.$$.fragment,E),P(h),P(i.$$.fragment,E),P(p),P(u),P(f.$$.fragment,E),d=!0)},o(E){R(e.$$.fragment,E),R(h),R(i.$$.fragment,E),R(p),R(u),R(f.$$.fragment,E),d=!1},d(E){E&&(A(t),A(n),A(a),A(o),A(s),A(c)),Y(e,E),h&&h.d(E),Y(i),p&&p.d(E),O[l].d(E),Y(f,E)}}}function xQ(r){let e,t;return e=new xt({props:{name:"Seasons",open:E3.Platform.isDesktop,desc:`${r[0].length} season${r[0].length!=1?"s":""}`,warn:r[3]===ot.PERIODIC&&r[2],label:"Your seasons are not fully distributed and could drift over time.",$$slots:{default:[EQ]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&1&&(i.desc=`${n[0].length} season${n[0].length!=1?"s":""}`),a&12&&(i.warn=n[3]===ot.PERIODIC&&n[2]),a&536871035&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function SQ(r,e,t){let n,a,i,o,s,l,u,c,f,d,h=Ve("store");ie(r,h,ee=>t(19,l=ee));let{seasonStore:p,seasonOffset:m,seasonType:O,displaySeasonalColors:b,interpolateColors:E}=h;ie(r,p,ee=>t(0,s=ee)),ie(r,m,ee=>t(6,d=ee)),ie(r,O,ee=>t(3,u=ee)),ie(r,b,ee=>t(4,c=ee)),ie(r,E,ee=>t(5,f=ee));let D=ee=>{p.delete(ee.id)},C=ee=>{let te=new du(l,h,u,ee);te.onClose=()=>{te.valid&&p.add({...te.item})},te.open()},k=ee=>{let te=new du(l,h,u,ee.name,ee);te.onClose=()=>{te.valid&&p.update(ee.id,{...te.item})},te.open()};function w(){let ee=Number((Bi(l)/s.length).toPrecision(10));for(let te of s)te.duration=ee;p.set(s)}let T=()=>Ce(b,c=!c,c),S=()=>Ce(E,f=!f,f);function M(){u=Gt(this),O.set(u)}let Z=ee=>Ce(m,d=ee.detail,d),N=()=>w(),L=ee=>p.set(ee),j=ee=>D(ee.detail),X=ee=>k(ee.detail),fe=ee=>C(ee.detail);return r.$$.update=()=>{r.$$.dirty&524288&&t(18,n=Bi(l)),r.$$.dirty&1&&t(17,a=s.reduce((ee,te)=>ee+(te.duration??0),0)),r.$$.dirty&393216&&t(2,i=Math.abs(n-a)>.001),r.$$.dirty&1&&t(1,o=s)},[s,o,i,u,c,f,d,h,p,m,O,b,E,D,C,k,w,a,n,l,T,S,M,Z,N,L,j,X,fe]}var o0=class extends ae{constructor(e){super(),oe(this,e,SQ,xQ,re,{},OQ)}},x3=o0;var nd=require("obsidian");function S3(r){let e,t,n,a,i,o,s,l;return e=new ln({props:{name:"Seed",desc:createFragment(QQ),value:r[1],type:"number",$$slots:{additional:[AQ]},$$scope:{ctx:r}}}),a=new lt({props:{$$slots:{control:[TQ],name:[$Q]},$$scope:{ctx:r}}}),s=new lt({props:{$$slots:{control:[PQ],name:[NQ]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment),t=F(),n=_("div"),z(a.$$.fragment),i=F(),o=_("div"),z(s.$$.fragment),g(n,"class","setting-item"),g(o,"class","setting-item")},m(u,c){W(e,u,c),$(u,t,c),$(u,n,c),W(a,n,null),$(u,i,c),$(u,o,c),W(s,o,null),l=!0},p(u,c){let f={};c&2&&(f.value=u[1]),c&32770&&(f.$$scope={dirty:c,ctx:u}),e.$set(f);let d={};c&32772&&(d.$$scope={dirty:c,ctx:u}),a.$set(d);let h={};c&32776&&(h.$$scope={dirty:c,ctx:u}),s.$set(h)},i(u){l||(P(e.$$.fragment,u),P(a.$$.fragment,u),P(s.$$.fragment,u),l=!0)},o(u){R(e.$$.fragment,u),R(a.$$.fragment,u),R(s.$$.fragment,u),l=!1},d(u){u&&(A(t),A(n),A(i),A(o)),Y(e,u),Y(a),Y(s)}}}function AQ(r){let e,t,n,a;return{c(){e=_("div"),g(e,"slot","additional")},m(i,o){$(i,e,o),n||(a=[me(t=r[8].call(null,e)),ce(e,"click",r[10])],n=!0)},p:I,d(i){i&&A(e),n=!1,Te(a)}}}function $Q(r){let e;return{c(){e=_("div"),e.textContent="Temperature units",g(e,"slot","name")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function TQ(r){let e,t,n=et.IMPERIAL+"",a,i,o,s,l=et.METRIC+"",u,c,f,d,h;return{c(){e=_("select"),t=_("option"),a=le(n),s=_("option"),u=le(l),t.__value=i=et.IMPERIAL,Re(t,t.__value),t.selected=o=r[2]===et.IMPERIAL,s.__value=c=et.METRIC,Re(s,s.__value),s.selected=f=r[2]===et.METRIC,g(e,"slot","control"),g(e,"class","dropdown"),r[2]===void 0&&St(()=>r[11].call(e))},m(p,m){$(p,e,m),y(e,t),y(t,a),y(e,s),y(s,u),ht(e,r[2],!0),d||(h=ce(e,"change",r[11]),d=!0)},p(p,m){m&4&&o!==(o=p[2]===et.IMPERIAL)&&(t.selected=o),m&4&&f!==(f=p[2]===et.METRIC)&&(s.selected=f),m&4&&ht(e,p[2])},d(p){p&&A(e),d=!1,h()}}}function NQ(r){let e;return{c(){e=_("div"),e.textContent="Wind units",g(e,"slot","name")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function PQ(r){let e,t,n=et.IMPERIAL+"",a,i,o,s,l=et.METRIC+"",u,c,f,d,h;return{c(){e=_("select"),t=_("option"),a=le(n),s=_("option"),u=le(l),t.__value=i=et.IMPERIAL,Re(t,t.__value),t.selected=o=r[3]===et.IMPERIAL,s.__value=c=et.METRIC,Re(s,s.__value),s.selected=f=r[3]===et.METRIC,g(e,"slot","control"),g(e,"class","dropdown"),r[3]===void 0&&St(()=>r[12].call(e))},m(p,m){$(p,e,m),y(e,t),y(t,a),y(e,s),y(s,u),ht(e,r[3],!0),d||(h=ce(e,"change",r[12]),d=!0)},p(p,m){m&8&&o!==(o=p[3]===et.IMPERIAL)&&(t.selected=o),m&8&&f!==(f=p[3]===et.METRIC)&&(s.selected=f),m&8&&ht(e,p[3])},d(p){p&&A(e),d=!1,h()}}}function MQ(r){let e,t,n,a;e=new er({props:{name:"Enable weather",value:r[0]}}),e.$on("click",r[9]);let i=r[0]&&S3(r);return{c(){z(e.$$.fragment),t=F(),i&&i.c(),n=He()},m(o,s){W(e,o,s),$(o,t,s),i&&i.m(o,s),$(o,n,s),a=!0},p(o,s){let l={};s&1&&(l.value=o[0]),e.$set(l),o[0]?i?(i.p(o,s),s&1&&P(i,1)):(i=S3(o),i.c(),P(i,1),i.m(n.parentNode,n)):i&&(Oe(),R(i,1,1,()=>{i=null}),_e())},i(o){a||(P(e.$$.fragment,o),P(i),a=!0)},o(o){R(e.$$.fragment,o),R(i),a=!1},d(o){o&&(A(t),A(n)),Y(e,o),i&&i.d(o)}}}function RQ(r){let e,t;return e=new xt({props:{name:"Weather",open:nd.Platform.isDesktop,desc:r[0]?"Enabled":"Disabled",$$slots:{default:[MQ]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&1&&(i.desc=n[0]?"Enabled":"Disabled"),a&32783&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}var QQ=r=>{r.createSpan({text:"This will be used to do all weather calculations."}),r.createEl("br"),r.createSpan({text:"The same seed will return the same weather for the same calendar."})};function IQ(r,e,t){let n,a,i,o,s=Ve("store"),{weatherStore:l}=s,{enabled:u,seed:c,tempUnitsStore:f,windUnitsStore:d}=l;ie(r,u,E=>t(0,n=E)),ie(r,c,E=>t(1,a=E)),ie(r,f,E=>t(2,i=E)),ie(r,d,E=>t(3,o=E));let h=E=>{new nd.ExtraButtonComponent(E).setIcon("rotate-ccw")},p=()=>Ce(u,n=!n,n),m=()=>Ce(c,a=uc(),a);function O(){i=Gt(this),f.set(i)}function b(){o=Gt(this),d.set(o)}return[n,a,i,o,u,c,f,d,h,p,m,O,b]}var s0=class extends ae{constructor(e){super(),oe(this,e,IQ,RQ,re,{})}},A3=s0;function FQ(r){let e,t,n,a;return e=new x3({}),n=new A3({}),{c(){z(e.$$.fragment),t=F(),z(n.$$.fragment)},m(i,o){W(e,i,o),$(i,t,o),W(n,i,o),a=!0},p:I,i(i){a||(P(e.$$.fragment,i),P(n.$$.fragment,i),a=!0)},o(i){R(e.$$.fragment,i),R(n.$$.fragment,i),a=!1},d(i){i&&A(t),Y(e,i),Y(n,i)}}}var l0=class extends ae{constructor(e){super(),oe(this,e,null,FQ,re,{})}},u0=l0;var P3=require("obsidian");var _a=require("obsidian");var pu=class extends pn{constructor(t,n,a,i=!0){super();this.item=t;this.seasons=n;this.units=a;this.creating=i;this.titleEl.setText(`${this.creating?"Create":"Modify"} location`)}async display(){this.contentEl.empty(),new _a.Setting(this.contentEl).setName("Name").addText(t=>{t.setValue(this.item.name??"").onChange(n=>this.item.name=n)});for(let t of this.seasons){let n=this.contentEl.createDiv();new _a.Setting(n).setHeading().setName(t.name);let a=n.createDiv("setting-container"),i=this.item.seasons[t.id],o=new _a.Setting(a).setName("Kind").setDesc(createFragment(s=>{let l=Ma(i),u=this.units;if(!l){s.createSpan({text:"No weather data set"});return}let c=s.createDiv("weather-data"),f=c.createDiv("weather-icon");(0,_a.setIcon)(f,"thermometer"),f.createSpan({text:`${jr(l.tempRange[0],u)}\u2013${jr(l.tempRange[1],u)}`});let d=c.createDiv("weather-icon");(0,_a.setIcon)(d,"droplets"),d.createSpan({text:`${Number((l.precipitationChance*100).toPrecision(2))}%`});let h=c.createDiv("weather-icon");(0,_a.setIcon)(h,"cloud-lightning"),h.createSpan({text:`${Number((l.precipitationIntensity*100).toPrecision(2))}%`});let p=c.createDiv("weather-icon");(0,_a.setIcon)(p,"wind"),p.createSpan({text:`${Number((l.windy*100).toPrecision(2))}%`});let m=c.createDiv("weather-icon");(0,_a.setIcon)(m,"cloudy"),m.createSpan({text:`${Number((l.cloudy*100).toPrecision(2))}%`})})).addDropdown(s=>{for(let l of Object.values(Dt))s.addOption(l,l);s.setValue(i.kind).onChange(l=>{let u=Ma(i);i.kind=l,i.kind===Dt.CUSTOM&&u&&!("weather"in i)&&(i.weather=at(u)),this.display()})});i.kind===Dt.CUSTOM&&o.addExtraButton(s=>s.setIcon(Ar).onClick(()=>{if(i.kind===Dt.CUSTOM){let l=new hu(at(i.weather),this.units);l.onClose=()=>{i.kind===Dt.CUSTOM&&(i.weather=at(l.item)),this.display()},l.open()}}))}}};function ZQ(r){let e,t,n=r[0].name+"",a;return{c(){e=_("div"),t=_("span"),a=le(n),g(t,"class","season-name"),g(e,"slot","name")},m(i,o){$(i,e,o),y(e,t),y(t,a)},p(i,o){o&1&&n!==(n=i[0].name+"")&&ve(a,n)},d(i){i&&A(e)}}}function qQ(r){let e,t,n;return t=new lt({props:{$$slots:{name:[ZQ]},$$scope:{ctx:r}}}),{c(){e=_("div"),z(t.$$.fragment),g(e,"class","location")},m(a,i){$(a,e,i),W(t,e,null),n=!0},p(a,[i]){let o={};i&3&&(o.$$scope={dirty:i,ctx:a}),t.$set(o)},i(a){n||(P(t.$$.fragment,a),n=!0)},o(a){R(t.$$.fragment,a),n=!1},d(a){a&&A(e),Y(t)}}}function LQ(r,e,t){let{item:n}=e;return r.$$set=a=>{"item"in a&&t(0,n=a.item)},[n]}var c0=class extends ae{constructor(e){super(),oe(this,e,LQ,qQ,re,{item:0})}},$3=c0;function T3(r,e,t){let n=r.slice();return n[17]=e[t],n}function BQ(r){let e;return{c(){e=_("div"),e.textContent=`Locations are different regions of your world that can have their own weather settings.`,g(e,"slot","desc")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function UQ(r){let e,t,n,a,i;return t=new lt({props:{$$slots:{control:[VQ],desc:[zQ],name:[YQ]},$$scope:{ctx:r}}}),a=new yi({props:{component:$3,items:r[0],type:"location",onDrop:r[9]}}),a.$on("advanced",r[10]),a.$on("trash",r[11]),{c(){e=_("div"),z(t.$$.fragment),n=F(),z(a.$$.fragment),g(e,"class","setting-item")},m(o,s){$(o,e,s),W(t,e,null),$(o,n,s),W(a,o,s),i=!0},p(o,s){let l={};s&1048579&&(l.$$scope={dirty:s,ctx:o}),t.$set(l);let u={};s&1&&(u.items=o[0]),s&1&&(u.onDrop=o[9]),a.$set(u)},i(o){i||(P(t.$$.fragment,o),P(a.$$.fragment,o),i=!0)},o(o){R(t.$$.fragment,o),R(a.$$.fragment,o),i=!1},d(o){o&&(A(e),A(n)),Y(t),Y(a,o)}}}function WQ(r){let e,t;return e=new gr({props:{message:"Create a new location to see it here."}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p:I,i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function YQ(r){let e;return{c(){e=_("div"),e.textContent="Default location",g(e,"slot","name")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function zQ(r){let e;return{c(){e=_("div"),e.textContent="Choose a location to use by default.",g(e,"slot","desc")},m(t,n){$(t,e,n)},p:I,d(t){t&&A(e)}}}function N3(r){let e,t=r[17].name+"",n,a,i;return{c(){e=_("option"),n=le(t),e.__value=a=r[17].id,Re(e,e.__value),e.selected=i=r[17].id==r[1]},m(o,s){$(o,e,s),y(e,n)},p(o,s){s&1&&t!==(t=o[17].name+"")&&ve(n,t),s&1&&a!==(a=o[17].id)&&(e.__value=a,Re(e,e.__value)),s&3&&i!==(i=o[17].id==o[1])&&(e.selected=i)},d(o){o&&A(e)}}}function VQ(r){let e,t,n,a,i,o,s,l=$e(r[0]),u=[];for(let c=0;cr[8].call(t)),g(e,"slot","control")},m(c,f){$(c,e,f),y(e,t),y(t,n),y(n,a);for(let d=0;d{c[m]=null}),_e(),i=c[a],i?i.p(d,h):(i=c[a]=u[a](d),i.c()),P(i,1),i.m(o.parentNode,o))},i(d){l||(P(t.$$.fragment,d),P(i),P(s.$$.fragment,d),l=!0)},o(d){R(t.$$.fragment,d),R(i),R(s.$$.fragment,d),l=!1},d(d){d&&(A(e),A(n),A(o)),Y(t),c[a].d(d),Y(s,d)}}}function XQ(r){let e,t;return e=new xt({props:{name:"Locations",open:P3.Platform.isDesktop,desc:`${r[0].length} location${r[0].length!=1?"s":""}`,$$slots:{default:[jQ]},$$scope:{ctx:r}}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,[a]){let i={};a&1&&(i.desc=`${n[0].length} location${n[0].length!=1?"s":""}`),a&1048579&&(i.$$scope={dirty:a,ctx:n}),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function GQ(r,e,t){let n,a,i,o,s=Ve("store"),{locationStore:l,seasonStore:u,weatherStore:c}=s;ie(r,l,C=>t(0,i=C)),ie(r,u,C=>t(14,a=C));let f=c.tempUnitsStore;ie(r,f,C=>t(13,n=C));let d=l.defaultLocationStore;ie(r,d,C=>t(1,o=C));let h=C=>{let k=a.reduce((T,S)=>{let M;return S.kind===Dt.CUSTOM?M={weatherOffset:S.weatherOffset,weatherPeak:S.weatherPeak,kind:S.kind,weather:{...S.weather}}:M={weatherOffset:S.weatherOffset,weatherPeak:S.weatherPeak,kind:S.kind},{...T,[S.id]:M}},{}),w=new pu({name:C,id:Le(6),seasons:k},a,n);w.onClose=()=>l.add(w.item),w.open()},p=C=>{let k=new pu(at(C),a,n,!1);k.onClose=()=>l.update(C.id,k.item),k.open()};function m(){o=Gt(this),d.set(o)}return[i,o,l,u,f,d,h,p,m,C=>Ce(l,i=[...C],i),C=>p(C.detail),C=>l.delete(C.detail.id),C=>h(C.detail)]}var f0=class extends ae{constructor(e){super(),oe(this,e,GQ,XQ,re,{})}},M3=f0;function HQ(r){let e,t;return e=new M3({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p:I,i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}var d0=class extends ae{constructor(e){super(),oe(this,e,null,HQ,re,{})}},h0=d0;function KQ(r){we(r,"svelte-1gc6lzz",".calendarium-creator.svelte-1gc6lzz.svelte-1gc6lzz,.calendarium-creator.svelte-1gc6lzz .calendarium-creator-inner.svelte-1gc6lzz,.calendarium-creator.svelte-1gc6lzz .calendarium-creator-app.svelte-1gc6lzz{background-color:var(--creator-background-color)}.calendarium-creator-app.svelte-1gc6lzz.svelte-1gc6lzz{overflow:auto;height:100%}.vertical-tab-content.svelte-1gc6lzz.svelte-1gc6lzz{padding:var(--size-4-8);padding-top:0}")}function JQ(r){let e,t,n=r[2]&&R3(r);return{c(){e=_("div"),n&&n.c(),g(e,"class","calendarium-creator svelte-1gc6lzz"),Pt(e,"--creator-background-color",r[0]),Pt(e,"--top",r[1]+"px")},m(a,i){$(a,e,i),n&&n.m(e,null),t=!0},p(a,i){a[2]?n?i&4&&P(n,1):(n=R3(a),n.c(),P(n,1),n.m(e,null)):n&&(Oe(),R(n,1,1,()=>{n=null}),_e()),(!t||i&1)&&Pt(e,"--creator-background-color",a[0]),(!t||i&2)&&Pt(e,"--top",a[1]+"px")},i(a){t||(P(n),t=!0)},o(a){R(n),t=!1},d(a){a&&A(e),n&&n.d()}}}function eI(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p;e=new uf({props:{selected:r[4],sections:[...p3]}}),e.$on("cancel",r[5]),a=new Ic({});let m=r[3]=="General"&&Q3(r),O=r[3]=="Dates"&&I3(r),b=r[3]==="Eras"&&F3(r),E=r[3]==="Seasons & weather"&&Z3(r),D=r[3]==="Locations"&&q3(r),C=r[3]=="Events"&&L3(r),k=r[3]=="Celestial bodies"&&B3(r);return{c(){z(e.$$.fragment),t=F(),n=_("div"),z(a.$$.fragment),i=F(),o=_("div"),m&&m.c(),s=F(),O&&O.c(),l=F(),b&&b.c(),u=F(),E&&E.c(),c=F(),D&&D.c(),f=F(),C&&C.c(),d=F(),k&&k.c(),g(o,"class","vertical-tab-content svelte-1gc6lzz"),g(n,"class",h="vertical-tab-content-container "+r[3].toLowerCase()+" svelte-1gc6lzz")},m(w,T){W(e,w,T),$(w,t,T),$(w,n,T),W(a,n,null),y(n,i),y(n,o),m&&m.m(o,null),y(o,s),O&&O.m(o,null),y(o,l),b&&b.m(o,null),y(o,u),E&&E.m(o,null),y(o,c),D&&D.m(o,null),y(o,f),C&&C.m(o,null),y(o,d),k&&k.m(o,null),p=!0},p(w,T){w[3]=="General"?m?T&8&&P(m,1):(m=Q3(w),m.c(),P(m,1),m.m(o,s)):m&&(Oe(),R(m,1,1,()=>{m=null}),_e()),w[3]=="Dates"?O?T&8&&P(O,1):(O=I3(w),O.c(),P(O,1),O.m(o,l)):O&&(Oe(),R(O,1,1,()=>{O=null}),_e()),w[3]==="Eras"?b?T&8&&P(b,1):(b=F3(w),b.c(),P(b,1),b.m(o,u)):b&&(Oe(),R(b,1,1,()=>{b=null}),_e()),w[3]==="Seasons & weather"?E?T&8&&P(E,1):(E=Z3(w),E.c(),P(E,1),E.m(o,c)):E&&(Oe(),R(E,1,1,()=>{E=null}),_e()),w[3]==="Locations"?D?T&8&&P(D,1):(D=q3(w),D.c(),P(D,1),D.m(o,f)):D&&(Oe(),R(D,1,1,()=>{D=null}),_e()),w[3]=="Events"?C?T&8&&P(C,1):(C=L3(w),C.c(),P(C,1),C.m(o,d)):C&&(Oe(),R(C,1,1,()=>{C=null}),_e()),w[3]=="Celestial bodies"?k?T&8&&P(k,1):(k=B3(w),k.c(),P(k,1),k.m(o,null)):k&&(Oe(),R(k,1,1,()=>{k=null}),_e()),(!p||T&8&&h!==(h="vertical-tab-content-container "+w[3].toLowerCase()+" svelte-1gc6lzz"))&&g(n,"class",h)},i(w){p||(P(e.$$.fragment,w),P(a.$$.fragment,w),P(m),P(O),P(b),P(E),P(D),P(C),P(k),p=!0)},o(w){R(e.$$.fragment,w),R(a.$$.fragment,w),R(m),R(O),R(b),R(E),R(D),R(C),R(k),p=!1},d(w){w&&(A(t),A(n)),Y(e,w),Y(a),m&&m.d(),O&&O.d(),b&&b.d(),E&&E.d(),D&&D.d(),C&&C.d(),k&&k.d()}}}function R3(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p,m,O;return e=new is({}),i=new Tm({}),s=new Ug({}),u=new Xg({}),f=new u0({}),h=new h0({}),m=new bs({}),{c(){z(e.$$.fragment),t=F(),n=_("div"),a=_("div"),z(i.$$.fragment),o=F(),z(s.$$.fragment),l=F(),z(u.$$.fragment),c=F(),z(f.$$.fragment),d=F(),z(h.$$.fragment),p=F(),z(m.$$.fragment),g(a,"class","calendarium-creator-app svelte-1gc6lzz"),g(n,"class","inherit calendarium-creator-inner svelte-1gc6lzz")},m(b,E){W(e,b,E),$(b,t,E),$(b,n,E),y(n,a),W(i,a,null),y(a,o),W(s,a,null),y(a,l),W(u,a,null),y(a,c),W(f,a,null),y(a,d),W(h,a,null),y(a,p),W(m,a,null),O=!0},i(b){O||(P(e.$$.fragment,b),P(i.$$.fragment,b),P(s.$$.fragment,b),P(u.$$.fragment,b),P(f.$$.fragment,b),P(h.$$.fragment,b),P(m.$$.fragment,b),O=!0)},o(b){R(e.$$.fragment,b),R(i.$$.fragment,b),R(s.$$.fragment,b),R(u.$$.fragment,b),R(f.$$.fragment,b),R(h.$$.fragment,b),R(m.$$.fragment,b),O=!1},d(b){b&&(A(t),A(n)),Y(e,b),Y(i),Y(s),Y(u),Y(f),Y(h),Y(m)}}}function Q3(r){let e,t;return e=new Tm({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function I3(r){let e,t;return e=new Ug({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function F3(r){let e,t;return e=new h3({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Z3(r){let e,t;return e=new u0({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function q3(r){let e,t;return e=new h0({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function L3(r){let e,t;return e=new bs({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function B3(r){let e,t;return e=new Xg({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function tI(r){let e,t,n,a,i=[eI,JQ],o=[];function s(l,u){return ad.Platform.isTablet||ad.Platform.isDesktop?0:1}return e=s(r,-1),t=o[e]=i[e](r),{c(){t.c(),n=He()},m(l,u){o[e].m(l,u),$(l,n,u),a=!0},p(l,[u]){t.p(l,u)},i(l){a||(P(t),a=!0)},o(l){R(t),a=!1},d(l){l&&A(n),o[e].d(l)}}}function rI(r,e,t){let n,i=ad.Platform.isMobile;Hn(()=>{t(2,i=!0)});let o=Ze("General");ie(r,o,c=>t(3,n=c));let{color:s=null}=e,{top:l}=e;function u(c){Zr.call(this,r,c)}return r.$$set=c=>{"color"in c&&t(0,s=c.color),"top"in c&&t(1,l=c.top)},[s,l,i,n,o,u]}var p0=class extends ae{constructor(e){super(),oe(this,e,rI,tI,re,{color:0,top:1},KQ)}},U3=p0;function nI(r){let e,t;return e=new U3({props:{top:r[1],color:r[0]}}),e.$on("cancel",r[7]),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a&2&&(i.top=n[1]),a&1&&(i.color=n[0]),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function aI(r){let e,t;return e=new j_({}),e.$on("cancel",r[6]),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p:I,i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function iI(r){let e,t,n,a,i=[aI,nI],o=[];function s(l,u){return l[2]?0:1}return e=s(r,-1),t=o[e]=i[e](r),{c(){t.c(),n=He()},m(l,u){o[e].m(l,u),$(l,n,u),a=!0},p(l,[u]){let c=e;e=s(l,u),e===c?o[e].p(l,u):(Oe(),R(o[c],1,1,()=>{o[c]=null}),_e(),t=o[e],t?t.p(l,u):(t=o[e]=i[e](l),t.c()),P(t,1),t.m(n.parentNode,n))},i(l){a||(P(t),a=!0)},o(l){R(t),a=!1},d(l){l&&A(n),o[e].d(l)}}}function oI(r,e,t){let{plugin:n}=e,{color:a=null}=e,{top:i}=e,{store:o}=e,{quick:s=!1}=e,{original:l}=e;Sn("store",o),Sn("plugin",n),Sn("original",l);function u(f){Zr.call(this,r,f)}function c(f){Zr.call(this,r,f)}return r.$$set=f=>{"plugin"in f&&t(3,n=f.plugin),"color"in f&&t(0,a=f.color),"top"in f&&t(1,i=f.top),"store"in f&&t(4,o=f.store),"quick"in f&&t(2,s=f.quick),"original"in f&&t(5,l=f.original)},[a,i,s,n,o,l,u,c]}var m0=class extends ae{constructor(e){super(),oe(this,e,oI,iI,re,{plugin:3,color:0,top:1,store:4,quick:2,original:5})}},W3=m0;var Ci,mu=class extends Ke.PluginSettingTab{constructor(t){super(t.app,t);this.plugin=t;this.toggleState={calendar:!1,event:!1,advanced:!1};this.settings$=Xe;Tt(this,Ci,!0);this.allFolders=this.app.vault.getAllLoadedFiles().filter(t=>t instanceof Ke.TFolder);this.folders=[];this.plugin.registerEvent(this.app.workspace.on("calendarium-settings-external-load",()=>this.display()))}get data(){return this.settings$.getData()}async display(){this.containerEl.empty(),this.containerEl.addClass("calendarium-settings"),this.contentEl=this.containerEl.createDiv("calendarium-settings-content"),this.buildInfo(this.contentEl.createDiv("calendarium-nested-settings")),this.calendarsEl=this.contentEl.createEl("details",{cls:"calendarium-nested-settings",attr:{open:"open"}}),this.buildCalendars(),this.buildEventsManagement(this.contentEl.createEl("details",{cls:"calendarium-nested-settings",attr:{open:"open"}})),this.parsingEl=this.contentEl.createEl("details",{cls:"calendarium-nested-settings",attr:{...this.toggleState.event?{open:"open"}:{}}}),this.buildEventsParsing(this.parsingEl),this.buildAdvanced(this.contentEl.createEl("details",{cls:"calendarium-nested-settings",attr:{...this.toggleState.advanced?{open:"open"}:{}}}))}async buildInfo(t){t.empty(),await this.settings$.markdownFileExists()&&new Ke.Setting(t).setName("Load previous data file").setDesc(createFragment(n=>{n.createSpan({text:"A file from a previous version of Calendarium was detected on your system."}),n.createEl("br"),n.createEl("br"),n.createSpan({text:"This will overwrite your existing data file."})})).addButton(n=>{n.setIcon(Ac).onClick(async()=>{await kl(app,"This will overwrite your settings. Are you sure?",{cta:"Import",secondary:"Cancel"})&&(await this.settings$.transitionMarkdownSettings(),await this.display())})}).addExtraButton(n=>{n.setIcon(Lt).onClick(async()=>{await kl(app,"This will permanently delete the old data file. Are you sure?")&&await this.settings$.deleteMarkdownSettings()})})}async buildCalendars(){this.calendarsEl.empty();let t=this.calendarsEl.createEl("summary");this.calendarsEl.ontoggle=async()=>{this.toggleState.calendar=this.calendarsEl.open},new Ke.Setting(t).setHeading().setName("Calendar management"),(0,Ke.setIcon)(t.createDiv("collapser").createDiv("handle"),zi),new Ke.Setting(this.calendarsEl).setName("Default calendar").setDesc("Views will open to this calendar by default.").addDropdown(n=>{n.addOption("none","None");for(let a of this.data.calendars)n.addOption(a.id,a.name);n.setValue(this.data.defaultCalendar??"none"),n.onChange(async a=>{if(a==="none"){this.data.defaultCalendar=null,await this.settings$.save({calendar:!0,watcher:!0});return}this.data.defaultCalendar=a,await this.settings$.save({calendar:!0,watcher:!0}),this.buildPaths()})}),new Ke.Setting(this.calendarsEl).setName("Import from Fantasy Calendar").setDesc(createFragment(n=>{n.createSpan({text:"Import calendar from the "}),n.createEl("a",{href:"https://app.fantasy-calendar.com",text:"Fantasy Calendar website",cls:"external-link"})})).addButton(n=>{let a=createEl("input",{attr:{type:"file",name:"merge",accept:".json",multiple:!0,style:"display: none;"}});a.onchange=async()=>{let{files:i}=a;if(i?.length){try{let o=[];for(let l of Array.from(i))o.push(JSON.parse(await l.text()));let s=dl.import(o);for(let l of s)await this.settings$.addCalendar(l);this.display()}catch(o){new Ke.Notice(`There was an error while importing the calendar${i.length==1?"":"s"}.`),console.error(o)}a.value=""}},n.setIcon(Ac),n.buttonEl.addClass("calendar-file-upload"),n.buttonEl.appendChild(a),n.onClick(()=>a.click())}),this.settings$.deletedCalendars?.length&&new Ke.Setting(this.calendarsEl).setName("Restore deleted calendars").addButton(n=>{n.setTooltip("Restore").setIcon(_v),n.buttonEl.setCssStyles({position:"relative"}),n.buttonEl.createDiv({cls:"calendarium-deleted-badge"}).createSpan().setText(`${this.settings$.deletedCalendars.length}`),n.onClick(()=>{let i=new Mc(this.settings$.deletedCalendars);i.onSave=async()=>{if(i.item?.length){for(let o of i.item)this.settings$.deletedCalendars.remove(o),await this.settings$.addCalendar(o);this.display()}i.permanentlyDelete.length&&(this.settings$.deletedCalendars=this.settings$.deletedCalendars.filter(o=>!i.permanentlyDelete.includes(o.id)),await this.settings$.save(),this.display())},i.open()})}),new Ke.Setting(this.calendarsEl).setName("Create new calendar").addButton(n=>{n.onClick(async()=>{let a=await Qc(this.plugin);if(!a)return;let i=await this.launchCalendarCreator(a,!0);i&&(await this.settings$.addCalendar(i),this.display())}),n.buttonEl.setAttr("style","gap: 0.25rem;"),(0,Ke.setIcon)(n.buttonEl,Sp),n.buttonEl.createSpan().setText("Quick")}).addButton(n=>{n.onClick(async()=>{let a=await this.launchCalendarCreator();a&&(await this.settings$.addCalendar(a),this.display())}),n.buttonEl.setAttr("style","gap: 0.25rem;"),(0,Ke.setIcon)(n.buttonEl,Ap),n.buttonEl.createSpan().setText("Full")}).addButton(n=>{n.buttonEl.setAttr("style","gap: 0.25rem;"),(0,Ke.setIcon)(n.buttonEl,Ac),n.buttonEl.createSpan().setText("Import");let a=createEl("input",{attr:{type:"file",name:"import-calendars",accept:".json",multiple:!0,style:"display: none;"}});a.onchange=async()=>{try{let{files:i}=a;if(!i?.length)return;let o=Array.from(i),s=new WeakMap,l,u=new Qa(createFragment(f=>{let d=f.createDiv("calendarium-notice");d.createEl("h4",{text:"Calendarium",cls:"calendarium-header"}),l=d.createDiv({text:"Importing calendars..."});let h=d.createEl("p","calendarium-file-status-container");for(let p of o){let m=h.createDiv({cls:"calendarium-file-status"});m.createDiv({text:p.name}),s.set(p,m)}}),0),c=0;for(let f of o){let h=s.get(f).createDiv("migrating-icon rotating");(0,Ke.setIcon)(h,Ol);try{let p=JSON.parse(await f.text());this.settings$.updateCalendarsToNewSchema([p],Xe.getData());let m=Sl(this.plugin,p);h.removeClass("rotating"),Ne(m.valid)?(p.id=Le(8),await this.settings$.addCalendar(p),h.removeClass("loading"),h.addClass("successful"),(0,Ke.setIcon)(h,"check"),c++):(h.addClass("error"),(0,Ke.setIcon)(h,"cross"))}catch(p){console.error(p),h.removeClass("rotating"),h.addClass("error"),(0,Ke.setIcon)(h,"cross")}}l.setText(`${c} calendar${c==1?"":"s"} imported.`),setTimeout(()=>{u.hide()},3e3)}catch{}this.display()},n.buttonEl.appendChild(a),n.onClick(()=>a.click())}),this.existingEl=this.calendarsEl.createDiv("existing-calendars"),this.showCalendars()}showCalendars(){if(this.existingEl.empty(),!this.data.calendars.length){this.existingEl.createSpan({cls:"no-calendars",text:"No calendars created! Create a calendar to see it here."});return}for(let t of this.data.calendars)new Ke.Setting(this.existingEl).setName(t.name).setDesc(t.description??"").addExtraButton(n=>{n.setIcon(Sp).setTooltip("Open quick creator").onClick(async()=>{let a=await this.launchCalendarCreator(t,!0);a&&(await this.settings$.addCalendar(a,t),this.display())})}).addExtraButton(n=>{n.setIcon(Ap).setTooltip("Open custom creator").onClick(async()=>{let a=await this.launchCalendarCreator(t);a&&(await this.settings$.addCalendar(a,t),this.display())})}).addExtraButton(n=>{n.setIcon(wv).setTooltip("Export this calendar").onClick(async()=>{let a=createEl("a"),i=new Blob([JSON.stringify(t)],{type:"json"}),o=URL.createObjectURL(i);a.href=o,a.download=`${t.name}.json`,a.click(),URL.revokeObjectURL(o)})}).addExtraButton(n=>{n.setIcon(Lt).onClick(async()=>{!this.data.exit.calendar&&!await Sv(this.plugin)||(await this.settings$.removeCalendar(t),this.display())})})}buildEventsManagement(t){t.empty();let n=t.createEl("summary");t.ontoggle=async()=>{this.toggleState.event=t.open},new Ke.Setting(n).setHeading().setName("Events management"),(0,Ke.setIcon)(n.createDiv("collapser").createDiv("handle"),zi);let a=this.app.internalPlugins.getPluginById("page-preview")?._loaded;new Ke.Setting(t).setName("Display event previews").setDesc(createFragment(i=>{i.createDiv({text:"Use the core Page Preview plugin to display event notes when hovered."}),a||i.createDiv({cls:"mod-warning",text:"The Page Preview plugin is required to modify this setting."})})).addToggle(i=>{i.setDisabled(!a).setValue(a&&this.data.eventPreview).onChange(async o=>{this.data.eventPreview=o,await this.settings$.save()})}),new Ke.Setting(t).setName("Parse note titles for event dates").addToggle(i=>{i.setValue(this.data.parseDates).onChange(async o=>{this.data.parseDates=o,await this.settings$.save({calendar:!0,watcher:!0})})})}buildEventsParsing(t){t.empty();let n=t.createEl("summary");t.ontoggle=async()=>{this.toggleState.event=t.open},new Ke.Setting(n).setHeading().setName("Events parsing"),(0,Ke.setIcon)(n.createDiv("collapser").createDiv("handle"),zi),new Ke.Setting(t).setDesc(createFragment(a=>{let i=a.createDiv("explanation");i.createDiv().createSpan({text:"Calendarium will find events defined in your notes. Events discovered in this way will only be added to one calendar."}),i.createEl("br"),i.createDiv().createSpan({text:"Use the following settings to match events found in a folder to a specific calendar. The most specific path (the most nested folder) will be used."})})),new Ke.Setting(t).setName("Enable event parsing").setDesc(createFragment(a=>{a.createSpan({text:"Parse the vault for Calendarium events."})})).addToggle(a=>{a.setValue(this.data.autoParse).onChange(async i=>{this.data.autoParse=i,i||this.plugin.flushFileEvents(),await this.settings$.save({calendar:!0,watcher:!0})})}),new Ke.Setting(t).setName("Inline events tag").setDesc(createFragment(a=>{a.createSpan({text:"Add this tag to your notes to tell Calendarium to scan them for inline "}),a.createEl("code",{text:""}),a.createSpan({text:" events."})})).addText(a=>{a.setValue(this.data.inlineEventsTag??"").onChange(async i=>{!i||!i.length?this.data.inlineEventsTag=null:this.data.inlineEventsTag=i.replace(/$#/,"")}),a.inputEl.onblur=async()=>{await this.settings$.save({calendar:!0,watcher:!0})}}),new Ke.Setting(t).setName("Event paths").setDesc("Calendarium can be restricted to look at certain paths in your vault for events. You can add specific paths here and associate default calendars to those paths. If no calendar is selected, Calendarium will add the event to your default calendar, if any."),this.pathsEl=t.createDiv("calendarium-event-paths"),this.buildPaths()}showPaths(){this.parsingEl.setAttr("open","open"),this.pathsEl.scrollIntoView()}buildPaths(){if(Me(this,Ci)&&(this.folders=this.allFolders.filter(f=>!this.data.paths.find(([d])=>f.path===d)),this.data.paths.sort((f,d)=>f[0].localeCompare(d[0])),Nt(this,Ci,!1)),this.pathsEl.empty(),!this.data.calendars.length){this.pathsEl.createSpan({cls:"no-calendars",text:"No calendars created! Create a calendar to use this feature."});return}let n=this.pathsEl.createDiv("existing-calendars has-table").createDiv("paths-table");for(let f of["","Path","Default Calendar",""])n.createEl("th",{text:f,cls:"paths-table-header"});for(let f=0;f{!i.path||!i.calendar||(this.data.paths.push([i.path,i.calendar]),Nt(this,Ci,!0),this.buildPaths(),await this.settings$.save({calendar:!0,watcher:!0}))});this.buildPathInput(s,c,o,f=>{i.path=f}),this.buildPathDropdown(l,Ui.DEFAULT,f=>{i.calendar=f})}buildStaticPath(t,n){t.empty();let[a,i]=this.data.paths[n],o=i===Ui.DEFAULT?this.settings$.getDefaultCalendar():this.settings$.getCalendar(i),s=n>0&&this.data.paths.slice(0,n).find(([f])=>f===a)!=null,l=t.createDiv("icon");s?(t.addClass("conflict"),(0,Ke.setIcon)(l.createDiv({cls:"icon",attr:{"aria-tooltip":"This path is registered to multiple calendars"}}),An)):t.removeClass("conflict"),t.createDiv({text:a,cls:"path"});let u=t.createDiv({cls:"calendar"});i===Ui.DEFAULT?(u.addClass("default-calendar"),u.createDiv({text:"Default calendar"}),u.createSpan({cls:"default-display",attr:{style:"font-size: var(--font-smallest);"},text:`${this.settings$.getDefaultCalendar()?.name}`})):o?u.setText(o.name):(u.addClass("mod-warning"),u.setText("Calendar could not be found"));let c=t.createDiv("actions");new Ke.ExtraButtonComponent(c).setIcon(Ar).onClick(()=>{this.buildEditPath(t,n,a,i)}),new Ke.ExtraButtonComponent(c).setIcon(Lt).onClick(async()=>{this.data.paths.splice(n,1),await this.settings$.save({calendar:!0,watcher:!0}),Nt(this,Ci,!0),this.buildPaths()})}buildEditPath(t,n,a,i){t.empty();let o=a,s=t.createDiv("icon"),l=t.createDiv("path"),u=t.createDiv("calendar"),c=t.createDiv("actions"),f=new Ke.ExtraButtonComponent(c).setIcon(Yi).onClick(async()=>{this.data.paths.splice(n,1,[a,i]),await this.settings$.save({calendar:!0,watcher:!0}),a!==o?(Nt(this,Ci,!0),this.buildPaths()):this.buildStaticPath(t,n)});this.buildPathInput(l,f,s,d=>{a=d},a),this.buildPathDropdown(u,i,d=>{i=d}),new Ke.ExtraButtonComponent(c).setIcon(ns).onClick(()=>{this.buildStaticPath(t,n)})}buildPathDropdown(t,n,a){let i=new Ke.DropdownComponent(t);i.addOption(Ui.DEFAULT,"Default calendar");for(let o of this.data.calendars)i.addOption(o.id,o.name);i.setValue(n).onChange(o=>a(o))}buildPathInput(t,n,a,i,o="Folder"){let s=c=>{if(!c||!c.length||this.data.paths.find(([f])=>c==f))return n.setDisabled(!0),(0,Ke.setIcon)(a,An),!1;n.setDisabled(!1),a.empty(),i((0,Ke.normalizePath)(c))},l=new Ke.TextComponent(t).setPlaceholder(o).onChange(c=>{s(c)}),u=new Y3.FolderInputSuggest(this.app,l,[...this.folders]);u.onSelect(async c=>{u.close(),u.setValue(c.item.path),s(c.item.path)})}buildAdvanced(t){t.empty();let n=t.createEl("summary");t.ontoggle=async()=>{this.toggleState.advanced=t.open},new Ke.Setting(n).setHeading().setName("Advanced"),(0,Ke.setIcon)(n.createDiv("collapser").createDiv("handle"),zi),new Ke.Setting(t).setName(`Reset "Don't ask again" prompts`).setDesc(`All confirmations set to "Don't Ask Again" will be reset.`).addButton(a=>{a.setIcon(Ov).onClick(async()=>{this.data.exit={saving:!1,event:!1,calendar:!1,savingEvent:!1},await this.settings$.save()})}),new Ke.Setting(t).setName("Settings sync behavior").setDesc("Control how the plugin reloads data when a sync is detected.").addDropdown(a=>{a.addOption("Ask","Continue asking").addOption("Always","Always reload").addOption("Never","Never reload").setValue(this.data.syncBehavior).onChange(async i=>{this.data.syncBehavior=i,await this.settings$.save()})}),new Ke.Setting(t).setName("Show event debug messages").setDesc(createFragment(a=>{a.createSpan({text:"The plugin will show debug messages when events are added, deleted or updated by the file watcher."})})).addToggle(a=>{a.setValue(this.data.debug).onChange(async i=>{this.data.debug=i,await this.settings$.save()})})}launchCalendarCreator(t=cc,n=!1){let a=at(t),i=t.id;return a.id=`${Le(10)}`,a.name||(a.name=""),new Promise((o,s)=>{try{this.modal=new g0(this.plugin,a,n,i),this.modal.onClose=()=>{this.modal&&(this.modal.saved&&(t=at(this.modal.calendar),i&&(t.id=i),o({...t,id:t.id??Le(8),name:t.name??"New Calendar",current:{day:t.current.day??1,month:t.current.month??0,year:t.current.year??1}})),this.modal=null,o())},this.modal.open()}catch{s()}})}hide(){this.modal?.forceClose(),this.modal=null}};Ci=new WeakMap;var g0=class extends ir{constructor(t,n,a=!1,i=null){super(t.app);this.plugin=t;this.quick=a;this.original=i;this.saved=!1;this.modalEl.addClass("calendarium-creator"),this.modalEl.addClasses(["mod-sidebar-layout","mod-settings"]),this.contentEl.addClass("vertical-tabs-container"),this.calendar=at(n),this.store=Sl(this.plugin,this.calendar),this.scope.register([Ke.Platform.isMacOS?"Meta":"Ctrl"],"z",()=>{Ne(this.store.canUndo)&&this.store.undo()}),this.scope.register([Ke.Platform.isMacOS?"Meta":"Ctrl"],"y",()=>{Ne(this.store.canRedo)&&this.store.redo()})}async checkCanExit(){return Ne(this.store.valid)||Xe.getData().exit.saving?!0:new Promise(t=>{let n=new Pc(this.plugin);n.onClose=()=>{t(n.confirmed)},n.open()})}async forceClose(){this.saved=!1,super.close()}async close(){await this.checkCanExit()&&(this.saved=Ne(this.store.valid),this.calendar=Ne(this.store),super.close())}async display(){this.$app=new W3({target:this.contentEl,props:{store:this.store,plugin:this.plugin,top:0,quick:this.quick,original:this.original}}),this.$app.$on("cancel",()=>{this.saved=!1,super.close()})}};var vo=require("obsidian");var Zd=require("obsidian");function Pn(r,e){Sn(r,e)}function ut(r){return Ve(r)}var id=class{constructor(e,t,n){this.month=e;this.year=t;this.staticStore=n;this.index=de([this.year.months],([e])=>e.indexOf(this.month));this.weekdays=de([this.staticStore.weekdays],([e])=>this.month.type=="intercalary"?e:this.month.week??e);this.daysBefore=de([this.index,this.year.leapDays,this.year.months],([e,t,n])=>n.slice(0,e).filter(a=>a.type=="month").reduce((a,i)=>a+i.length,0)+t.filter(a=>!a.intercalary&&a.timespann.slice(0,e).reduce((a,i)=>a+i.length,0)+t.filter(a=>a.timespan!a.overflow||this.month.type==="intercalary"?0:sn(t%n.length+e,n.length));this.leapDays=de([this.year.leapDays,this.index],([e,t])=>e.filter(n=>n.timespan==t));this.days=de(this.leapDays,e=>this.month.length+e.length);this.eras=de(this.year.eras,e=>{let t=[],n=Ne(this.index);for(let a=0;asn(t%n.length+e+a-1,n.length));this.daysAsWeeks=de([this.weekdays,this.days,this.firstDay,this.leapDays,this.staticStore.staticData,this.eras,this.staticStore.eras],([e,t,n,a,i,o,s])=>{let l=[],u=0,c=0;for(;u=0;h--){let p=s[h];if(p.isStartingEra)break;if(p.endsYear&&p.date.year===this.year.year-1){f=!1;break}}let d=l.length===0?[...Array(n).keys()].reverse().map(h=>f?{type:"day",number:-1*h,name:null,id:Le(3)}:null):[];for(;d.lengthm.after&&m.after==u-1);if(h){let m={...h,number:u};if(!h.intercalary)d.push(m);else{for(let O=0;O0&&d.lengthnull)),d=[],u===t)break}}else d.push({type:"day",number:u,name:null,id:Le(3)});if(u>=t&&(this.month.type=="intercalary"||!i.overflow))break;let p=o.find(m=>m.endsYear&&m.date.year===this.year.year&&m.date.month===Ne(this.index));if(p&&p.date.day===u)return l.push(d),l}l.push(d)}return l});this.weeks=de([this.daysAsWeeks],([e])=>e.length);this.firstWeekNumber=de([this.daysBeforeAll,this.weekdays,this.year.firstDay],([e,t,n])=>Math.floor((e+n)/t.length))}get name(){return this.month.name}};var od=class{constructor(e){this.staticStore=e;this.cache=new Map}getYearFromCache(e){return this.cache.has(e)||this.cache.set(e,new y0(e,this.staticStore)),this.cache.get(e)}daysBefore(e){let t=this.getYearFromCache(e.year),n=Ne(t.daysBefore),a=t.getMonthFromCache(e.month);return n+Ne(a.daysBefore)+e.day-1}daysBetween(e,t){let n=this.daysBefore(e),a=this.daysBefore(t);return Math.max(n,a)-Math.min(n,a)}},y0=class{constructor(e,t){this.year=e;this.staticStore=t;this.monthCache=new Map;this.eras=de(this.staticStore.eras,e=>{let t=[];for(let n=e.length-1;n>=0;n--){let a=e[n];if(a.isStartingEra)t.length||t.push(a);else if(a.date.year<=this.year){if(a.end&&a.end.year{let n=t.find(a=>a.endsYear&&a.date.year===this.year);return n&&(e=e.slice(0,n.date.month+1)),e.filter(a=>!a.interval||(this.year-(a.offset??0))%a.interval==0)});this.daysBefore=de([this.months,this.staticStore.leapDays],([e,t])=>gp(this.year,e,t));this.firstDay=de([this.staticStore.staticConfiguration,this.staticStore.months,this.staticStore.weekdays,this.staticStore.leapDays,this.staticStore.eras],([e,t,n,a,i])=>{let o=this.year;for(let s=i.length-1;s>=0;s--){let l=i[s];if(l.isStartingEra)break;l.endsYear&&(l.date.year>=this.year||(o=this.year-l.date.year))}return Lb(o,t,n,a,e.overflow,e.firstWeekDay,e.offset)});this.display=de([this.staticStore.years,this.staticStore.staticConfiguration],([e,t])=>t.useCustomYears?e[this.year].name:this.year);this.leapDays=de([this.staticStore.leapDays],([e])=>e.filter(t=>t.interval.sort((n,a)=>n.interval-a.interval).some(({interval:n,exclusive:a},i,o)=>{if(!n)return!1;if(a&&i==0)return(this.year-(t.offset??0))%n!=0;if(!a)return o[i+1]&&o[i+1].exclusive?(this.year-(t.offset??0))%n==0&&(this.year-(t.offset??0))%o[i+1].interval!=0:(this.year-(t.offset??0))%n==0})))}getMonthFromCache(e){let t=this.monthCache.get(e)??new id(Ne(this.months)[e],this,this.staticStore);return this.monthCache.has(e)||this.monthCache.set(e,t),t}};var sd=class{constructor(e){this.toConsider=e;this.dirty=Ze(!0);this.entities=de([this.toConsider,this.dirty],([e])=>(this.dirty.set(!1),this.update(e)))}},ld=class extends sd{},wa=class extends ld{constructor(t,n){super(n);this.year=t;this.cache=new Map}},Da=class extends ld{constructor(t,n,a){super(a);this.month=t;this.year=n;this.cache=new Map}},Ca=class extends sd{constructor(t,n,a,i){super(i);this.day=t;this.month=n;this.year=a}getDate(){return{day:this.day,month:this.month,year:this.year}}},ka=class{constructor(e){this.entities=e;this.cache=new Map}invalidate(e){if(e.year==null||!this.cache.has(e.year))return;let t=this.cache.get(e.year);if(t.dirty.set(!0),e.month==null||!t.cache.has(e.month))return;let n=t.cache.get(e.month);if(n.dirty.set(!0),e.day==null||!n.cache.has(e.day))return;n.cache.get(e.day).dirty.set(!0)}getItemsOrRecalculate(e){let{day:t,month:n,year:a}=e;this.cache.has(a)||this.cache.set(a,this.getYearCache(a));let i=this.cache.get(a),o=Ne(i.dirty);i.cache.has(n)||i.cache.set(n,this.getMonthCache(n,a));let s=i.cache.get(n),l=Ne(s.dirty);o&&!l&&s.dirty.set(!0),s.cache.has(t)||s.cache.set(t,this.getDayCache(t,n,a));let u=s.cache.get(t);return l&&!Ne(u.dirty)&&u.dirty.set(!0),u.entities}};var b0=class extends wa{update(e){return e}},v0=class extends Da{update(e){return e}},O0=class extends Ca{constructor(t,n,a,i,o){super(t,n,a,i);this.yearCalculator=o}update(t){let n=[],a=this.yearCalculator.daysBefore(this.getDate());for(let i of t??[]){let{offset:o,cycle:s}=i,l=24,u=(a-o)/s,f=(u-Math.floor(u))*l%l,d=Zb[l];n.push({...i,phase:d[sn(Math.round(f),d.length)]})}return n}},ud=class extends ka{constructor(t,n){super(t);this.yearCalculator=n}getYearCache(t){return this.cache.has(t)?this.cache.get(t):new b0(t,this.entities)}getMonthCache(t,n){let a=this.getYearCache(n);return a.cache.has(t)?a.cache.get(t):new v0(t,n,a.entities)}getDayCache(t,n,a){let i=this.getMonthCache(n,a);return i.cache.has(t)?i.cache.get(t):new O0(t,n,a,i.entities,this.yearCalculator)}};var _0=class extends wa{update(e){return(e??[])?.filter(t=>{switch(t.type){case U.Undated:break;case U.Recurring:{let n={...t.date};if(n.year===null)return!0;if(Array.isArray(n.year)){let a=n.year[0]??this.year,i=n.year[1]??this.year;return a<=this.year&&i>=this.year}else return n.year===this.year}case U.Range:{let n={...t.date},a={...t.end};if(n.year==this.year||n.year==null)return!0;if(n.year>this.year)return!1;if(n.year<=this.year&&a.year>=this.year)return!0;break}case U.Date:default:{let n={...t.date};if(n.year==this.year||n.year==null)return!0;break}}return!1})}},w0=class extends Da{update(e){return(e??[])?.filter(t=>{switch(t.type){case U.Undated:break;case U.Recurring:{let n={...t.date};if(n.year){if(Array.isArray(n.year)){let a=n.year[0]??this.year,i=n.year[1]??this.year;if(a>this.year||i=this.month}else return n.month===this.month}case U.Range:{let n={...t.date},a={...t.end};return n.year==this.year&&n.month==this.month?!0:n.year>this.year||n.year==this.year&&n.month>this.month?!1:n.yearthis.year||n.year==this.year&&n.month<=this.month&&a.year>this.year||n.year==this.year&&n.month<=this.month&&a.month>=this.month||n.year=this.month}case U.Date:default:{let n={...t.date};if(n.month==null||(n.year==this.year||n.year==null)&&n.month==this.month)return!0;if(n.year!=null&&n.year>this.year||n.year==this.year&&n.month>this.month)return!1;break}}return!1})}},D0=class extends Ca{get date(){return{day:this.day,month:this.month,year:this.year}}isBefore(e){let t=this.normalize(e);return t.yearthis.year||t.month>this.month&&t.year===this.year||t.day>=this.day&&t.month===this.month&&t.year===this.year}isEqual(e){let t=this.normalize(e);return t.year==this.year&&t.month==this.month&&t.day==this.day}normalize(e){let t={...e};return t.day==null&&(t.day=this.date.day),t.month==null&&(t.month=this.date.month),t.year==null&&(t.year=this.date.year),t}isUndefined(e){return e.day===null&&e.month===null&&e.year===null}update(e){return(e??[])?.filter(t=>{switch(t.type){case U.Undated:break;case U.Recurring:{let n={...t.date};if(n.day==null)return!0;if(Array.isArray(n.day)){let a=n.day[0]??this.month,i=n.day[1]??this.month;if(a<=this.day&&i>=this.day)return!0}else if(n.day===this.day)return!0;return!1}case U.Range:{if(this.isUndefined(t.date))return!1;if(this.isEqual(t.date))return!0;if(t.end&&this.isBefore(t.date)&&this.isAfter(t.end))return!0;break}case U.Date:default:{if(this.isUndefined(t.date))return!1;if(this.isEqual(t.date))return!0;break}}return!1})}},cd=class extends ka{getYearCache(e){return this.cache.has(e)?this.cache.get(e):new _0(e,this.entities)}getMonthCache(e,t){let n=this.getYearCache(t);return n.cache.has(e)?n.cache.get(e):new w0(e,t,n.entities)}getDayCache(e,t,n){let a=this.getMonthCache(t,n);return a.cache.has(e)?a.cache.get(e):new D0(e,t,n,a.entities)}invalidate(e){let t=[];if(e.year==null)for(let i of this.cache.values())i.dirty.set(!0),t.push(i);else if(Array.isArray(e.year)){for(let i of[...this.cache.keys()])if(i>=(e.year[0]??Number.MIN_SAFE_INTEGER)&&i<=(e.year[1]??Number.MAX_SAFE_INTEGER)){let o=this.cache.get(i);o.dirty.set(!0),t.push(o)}}else if(this.cache.has(e.year)){let i=this.cache.get(e.year);i.dirty.set(!0),t.push(i)}if(!t.length)return;let n=[];for(let i of t)if(e.month==null)for(let o of i.cache.values())o.dirty.set(!0),n.push(o);else if(Array.isArray(e.month)){for(let o of[...i.cache.keys()])if(o>=(e.month[0]??Number.MIN_SAFE_INTEGER)&&o<=(e.month[1]??Number.MAX_SAFE_INTEGER)){let s=i.cache.get(o);s.dirty.set(!0),n.push(s)}}else if(i.cache.has(e.month)){let o=i.cache.get(e.month);o.dirty.set(!0),n.push(o)}if(!n.length)return;let a=[];for(let i of n)if(e.day==null)for(let o of i.cache.values())o.dirty.set(!0),a.push(o);else if(Array.isArray(e.day)){for(let o of[...i.cache.keys()])if(o>=(e.day[0]??Number.MIN_SAFE_INTEGER)&&o<=(e.day[1]??Number.MAX_SAFE_INTEGER)){let s=i.cache.get(o);s.dirty.set(!0),a.push(s)}}else if(i.cache.has(e.day)){let o=i.cache.get(e.day);o.dirty.set(!0),a.push(o)}}};var ia,ki,za,Va,fd=class{constructor(e){this.calendar=e;Tt(this,ia,void 0);Tt(this,ki,new Map);Tt(this,za,new Set);Tt(this,Va,void 0);Nt(this,ia,Ze(new Map((e.events??[]).map(t=>[t.id,t])))),Nt(this,Va,new cd(de(Me(this,ia),t=>[...t.values()])))}getEvents(){return[...Ne(Me(this,ia)).values()]}getFileEvents(){return[...Ne(Me(this,ia)).values()].filter(e=>this.isFileEvent(e.id))}getEventsForDate(e){return Me(this,Va).getItemsOrRecalculate(e)}insertEvents(...e){Me(this,ia).update(t=>{for(let n of e)n.type!==U.Undated&&(t.set(n.id,n),Me(this,Va).invalidate(n.date));return t})}removeEvents(...e){Me(this,ia).update(t=>{for(let n of e)n.type!==U.Undated&&(t.delete(n.id),Me(this,Va).invalidate(n.date));return t})}insertEventsFromFile(e,...t){if(e){Me(this,ki).set(e,[...Me(this,ki).get(e)??[],...t.map(n=>n.id)]);for(let n of t)Me(this,za).add(n.id);this.insertEvents(...t)}}removeEventsFromFile(e){let t=Me(this,ki).get(e)??[];t.length&&Me(this,ia).update(n=>{for(let a of t){if(!n.has(a))continue;let i={...n.get(a)};i.type!==U.Undated&&(n.delete(a),Me(this,Va).invalidate(i.date),Me(this,za).delete(a))}return Me(this,ki).delete(e),n})}removeAllFileEvents(){Me(this,ia).update(e=>{for(let t of Me(this,za)){if(!e.has(t))continue;let n={...e.get(t)};n.type!==U.Undated&&(e.delete(t),Me(this,Va).invalidate(n.date),Me(this,za).delete(t))}return Nt(this,ki,new Map),Nt(this,za,new Set),e})}isFileEvent(e){return Me(this,za).has(e)}isRemovable(e){return!this.isFileEvent(e)}};ia=new WeakMap,ki=new WeakMap,za=new WeakMap,Va=new WeakMap;function rr(r,e){let t=r.length;Array.isArray(r[0])||(r=[r]),Array.isArray(e[0])||(e=e.map(o=>[o]));let n=e[0].length,a=e[0].map((o,s)=>e.map(l=>l[s])),i=r.map(o=>a.map(s=>{let l=0;if(!Array.isArray(o)){for(let u of s)l+=o*u;return l}for(let u=0;uo[0]):i}function _u(r){return Ei(r)==="string"}function Ei(r){return(Object.prototype.toString.call(r).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function _d(r,{precision:e,unit:t}){return xi(r)?"none":UD(r,e)+(t??"")}function xi(r){return Number.isNaN(r)||r instanceof Number&&r?.none}function Or(r){return xi(r)?0:r}function UD(r,e){if(r===0)return 0;let t=~~r,n=0;t&&e&&(n=~~Math.log10(Math.abs(t))+1);let a=10**(e-n);return Math.floor(r*a+.5)/a}var sI={deg:1,grad:.9,rad:180/Math.PI,turn:360};function WD(r){if(!r)return;r=r.trim();let e=/^([a-z]+)\((.+?)\)$/i,t=/^-?[\d.]+$/,n=/%|deg|g?rad|turn$/,a=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g,i=r.match(e);if(i){let o=[];return i[2].replace(a,(s,l)=>{let u=l.match(n),c=l;if(u){let f=u[0],d=c.slice(0,-f.length);f==="%"?(c=new Number(d/100),c.type=""):(c=new Number(d*sI[f]),c.type="",c.unit=f)}else t.test(c)?(c=new Number(c),c.type=""):c==="none"&&(c=new Number(NaN),c.none=!0);s.startsWith("/")&&(c=c instanceof Number?c:new Number(c),c.alpha=!0),typeof c=="object"&&c instanceof Number&&(c.raw=l),o.push(c)}),{name:i[1].toLowerCase(),rawName:i[1],rawArgs:i[2],args:o}}}function YD(r){return r[r.length-1]}function bu(r,e,t){return isNaN(r)?e:isNaN(e)?r:r+(e-r)*t}function zD(r,e,t){return(t-r)/(e-r)}function U0(r,e,t){return bu(e[0],e[1],zD(r[0],r[1],t))}function VD(r){return r.map(e=>e.split("|").map(t=>{t=t.trim();let n=t.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(n){let a=new String(n[1]);return a.range=[+n[2],+n[3]],a}return t}))}function jD(r,e,t){return Math.max(Math.min(t,e),r)}function kd(r,e){return Math.sign(r)===Math.sign(e)?r:-r}function Ea(r,e){return kd(Math.abs(r)**e,r)}function W0(r,e){return e===0?0:r/e}function XD(r,e,t=0,n=r.length){for(;t>1;r[a]","",""]);function z3(r,e,t,n){return Object.entries(r.coords).map(([i,o],s)=>{let l=e.coordGrammar[s],u=n[s],c=u?.type,f;if(u.none?f=l.find(p=>uI.has(p)):f=l.find(p=>p==c),!f){let p=o.name||i;throw new TypeError(`${c??u.raw} not allowed for ${p} in ${t}()`)}let d=f.range;c===""&&(d||(d=[0,1]));let h=o.range||o.refRange;return d&&h&&(n[s]=U0(d,h,n[s])),f})}function GD(r,{meta:e}={}){let t={str:String(r)?.trim()};if(Si.run("parse-start",t),t.color)return t.color;if(t.parsed=WD(t.str),t.parsed){let n=t.parsed.name;if(n==="color"){let a=t.parsed.args.shift(),i=a.startsWith("--")?a.substring(2):`--${a}`,o=[a,i],s=t.parsed.rawArgs.indexOf("/")>0?t.parsed.args.pop():1;for(let c of Ge.all){let f=c.getFormat("color");if(f&&(o.includes(f.id)||f.ids?.filter(d=>o.includes(d)).length)){let d=Object.keys(c.coords).map((p,m)=>t.parsed.args[m]||0),h;return f.coordGrammar&&(h=z3(c,f,"color",d)),e&&Object.assign(e,{formatId:"color",types:h}),f.id.startsWith("--")&&!a.startsWith("--")&&Qn.warn(`${c.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${f.id}) instead of color(${a}).`),a.startsWith("--")&&!f.id.startsWith("--")&&Qn.warn(`${c.name} is a standard space and supported in the CSS spec. Use color(${f.id}) instead of prefixed color(${a}).`),{spaceId:c.id,coords:d,alpha:s}}}let l="",u=a in Ge.registry?a:i;if(u in Ge.registry){let c=Ge.registry[u].formats?.color?.id;c&&(l=`Did you mean color(${c})?`)}throw new TypeError(`Cannot parse color(${a}). `+(l||"Missing a plugin?"))}else for(let a of Ge.all){let i=a.getFormat(n);if(i&&i.type==="function"){let o=1;(i.lastAlpha||YD(t.parsed.args).alpha)&&(o=t.parsed.args.pop());let s=t.parsed.args,l;return i.coordGrammar&&(l=z3(a,i,n,s)),e&&Object.assign(e,{formatId:i.name,types:l}),{spaceId:a.id,coords:s,alpha:o}}}}else for(let n of Ge.all)for(let a in n.formats){let i=n.formats[a];if(i.type!=="custom"||i.test&&!i.test(t.str))continue;let o=i.parse(t.str);if(o)return o.alpha??(o.alpha=1),e&&(e.formatId=a),o}throw new TypeError(`Could not parse ${r} as a color. Missing a plugin?`)}function pt(r){if(Array.isArray(r))return r.map(pt);if(!r)throw new TypeError("Empty color reference");_u(r)&&(r=GD(r));let e=r.space||r.spaceId;return e instanceof Ge||(r.space=Ge.get(e)),r.alpha===void 0&&(r.alpha=1),r}var cI=75e-6,Dn=class Dn{constructor(e){this.id=e.id,this.name=e.name,this.base=e.base?Dn.get(e.base):null,this.aliases=e.aliases,this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);let t=e.coords??this.base.coords;for(let a in t)"name"in t[a]||(t[a].name=a);this.coords=t;let n=e.white??this.base.white??"D65";this.white=R0(n),this.formats=e.formats??{};for(let a in this.formats){let i=this.formats[a];i.type||(i.type="function"),i.name||(i.name=a)}this.formats.color?.id||(this.formats.color={...this.formats.color??{},id:e.cssId||this.id}),e.gamutSpace?this.gamutSpace=e.gamutSpace==="self"?this:Dn.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(a,i)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:fI(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),Si.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=cI}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let n=Object.values(this.coords);return e.every((a,i)=>{let o=n[i];if(o.type!=="angle"&&o.range){if(Number.isNaN(a))return!0;let[s,l]=o.range;return(s===void 0||a>=s-t)&&(l===void 0||a<=l+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!("range"in e))}get cssId(){return this.formats?.color?.id||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type==="angle")return!0;return!1}getFormat(e){if(typeof e=="object")return e=V3(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=V3(t,this),t):null}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(e,t){if(arguments.length===1){let s=pt(e);[e,t]=[s.space,s.coords]}if(e=Dn.get(e),this.equals(e))return t;t=t.map(s=>Number.isNaN(s)?0:s);let n=this.path,a=e.path,i,o;for(let s=0;so;s--)t=n[s].toBase(t);for(let s=o+1;s=0){let l=Object.entries(a.coords)[i];if(l)return{space:a,id:l[0],index:i,...l[1]}}a=Dn.get(a);let o=i.toLowerCase(),s=0;for(let l in a.coords){let u=a.coords[l];if(l.toLowerCase()===o||u.name?.toLowerCase()===o)return{space:a,id:l,index:s,...u};s++}throw new TypeError(`No "${i}" coordinate found in ${a.name}. Its coordinates are: ${Object.keys(a.coords).join(", ")}`)}};dr(Dn,"registry",{}),dr(Dn,"DEFAULT_FORMAT",{type:"functions",name:"color"});var Ge=Dn;function fI(r){let e=[r];for(let t=r;t=t.base;)e.push(t);return e}function V3(r,{coords:e}={}){if(r.coords&&!r.coordGrammar){r.type||(r.type="function"),r.name||(r.name="color"),r.coordGrammar=VD(r.coords);let t=Object.entries(e).map(([n,a],i)=>{let o=r.coordGrammar[i][0],s=a.range||a.refRange,l=o.range,u="";return o==""?(l=[0,100],u="%"):o==""&&(u="deg"),{fromRange:s,toRange:l,suffix:u}});r.serializeCoords=(n,a)=>n.map((i,o)=>{let{fromRange:s,toRange:l,suffix:u}=t[o];return s&&l&&(i=U0(s,l,i)),i=_d(i,{precision:a,unit:u}),i})}return r}var Yr=new Ge({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]}),on=class extends Ge{constructor(e){e.coords||(e.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),e.base||(e.base=Yr),e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??(e.toBase=t=>{let n=rr(e.toXYZ_M,t);return this.white!==this.base.white&&(n=wd(this.white,this.base.white,n)),n}),e.fromBase??(e.fromBase=t=>(t=wd(this.base.white,this.white,t),rr(e.fromXYZ_M,t)))),e.referred??(e.referred="display"),super(e)}};function wu(r,e){return r=pt(r),!e||r.space.equals(e)?r.coords.slice():(e=Ge.get(e),e.from(r))}function Mn(r,e){r=pt(r);let{space:t,index:n}=Ge.resolveCoord(e,r.space);return wu(r,t)[n]}function Y0(r,e,t){return r=pt(r),e=Ge.get(e),r.coords=e.to(r.space,t),r}Y0.returns="color";function ja(r,e,t){if(r=pt(r),arguments.length===2&&Ei(arguments[1])==="object"){let n=arguments[1];for(let a in n)ja(r,a,n[a])}else{typeof t=="function"&&(t=t(Mn(r,e)));let{space:n,index:a}=Ge.resolveCoord(e,r.space),i=wu(r,n);i[a]=t,Y0(r,n,i)}return r}ja.returns="color";var z0=new Ge({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Yr,fromBase:r=>wd(Yr.white,"D50",r),toBase:r=>wd("D50",Yr.white,r)}),dI=216/24389,j3=24/116,dd=24389/27,C0=un.D50,Rn=new Ge({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:C0,base:z0,fromBase(r){let t=r.map((n,a)=>n/C0[a]).map(n=>n>dI?Math.cbrt(n):(dd*n+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(r){let e=[];return e[1]=(r[0]+16)/116,e[0]=r[1]/500+e[1],e[2]=e[1]-r[2]/200,[e[0]>j3?Math.pow(e[0],3):(116*e[0]-16)/dd,r[0]>8?Math.pow((r[0]+16)/116,3):r[0]/dd,e[2]>j3?Math.pow(e[2],3):(116*e[2]-16)/dd].map((n,a)=>n*C0[a])},formats:{lab:{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});function xa(r){return(r%360+360)%360}function hI(r,e){if(r==="raw")return e;let[t,n]=e.map(xa),a=n-t;return r==="increasing"?a<0&&(n+=360):r==="decreasing"?a>0&&(t+=360):r==="longer"?-1800?t+=360:n+=360):r==="shorter"&&(a>180?t+=360:a<-180&&(n+=360)),[t,n]}var vu=new Ge({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Rn,fromBase(r){let[e,t,n]=r,a,i=.02;return Math.abs(t) | "," | "," | "]}}}),X3=25**7,Dd=Math.PI,G3=180/Dd,Ts=Dd/180;function H3(r){let e=r*r;return e*e*e*r}function HD(r,e,{kL:t=1,kC:n=1,kH:a=1}={}){[r,e]=pt([r,e]);let[i,o,s]=Rn.from(r),l=vu.from(Rn,[i,o,s])[1],[u,c,f]=Rn.from(e),d=vu.from(Rn,[u,c,f])[1];l<0&&(l=0),d<0&&(d=0);let h=(l+d)/2,p=H3(h),m=.5*(1-Math.sqrt(p/(p+X3))),O=(1+m)*o,b=(1+m)*c,E=Math.sqrt(O**2+s**2),D=Math.sqrt(b**2+f**2),C=O===0&&s===0?0:Math.atan2(s,O),k=b===0&&f===0?0:Math.atan2(f,b);C<0&&(C+=2*Dd),k<0&&(k+=2*Dd),C*=G3,k*=G3;let w=u-i,T=D-E,S=k-C,M=C+k,Z=Math.abs(S),N;E*D===0?N=0:Z<=180?N=S:S>180?N=S-360:S<-180?N=S+360:Qn.warn("the unthinkable has happened");let L=2*Math.sqrt(D*E)*Math.sin(N*Ts/2),j=(i+u)/2,X=(E+D)/2,fe=H3(X),ee;E*D===0?ee=M:Z<=180?ee=M/2:M<360?ee=(M+360)/2:ee=(M-360)/2;let te=(j-50)**2,ge=1+.015*te/Math.sqrt(20+te),he=1+.045*X,ue=1;ue-=.17*Math.cos((ee-30)*Ts),ue+=.24*Math.cos(2*ee*Ts),ue+=.32*Math.cos((3*ee+6)*Ts),ue-=.2*Math.cos((4*ee-63)*Ts);let xe=1+.015*X*ue,Pe=30*Math.exp(-1*((ee-275)/25)**2),Ye=2*Math.sqrt(fe/(fe+X3)),it=-1*Math.sin(2*Pe*Ts)*Ye,Be=(w/(t*ge))**2;return Be+=(T/(n*he))**2,Be+=(L/(a*xe))**2,Be+=it*(T/(n*he))*(L/(a*xe)),Math.sqrt(Be)}var pI=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],mI=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],gI=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],yI=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],Rs=new Ge({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Yr,fromBase(r){let t=rr(pI,r).map(n=>Math.cbrt(n));return rr(gI,t)},toBase(r){let t=rr(yI,r).map(n=>n**3);return rr(mI,t)},formats:{oklab:{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});function Q0(r,e){[r,e]=pt([r,e]);let[t,n,a]=Rs.from(r),[i,o,s]=Rs.from(e),l=t-i,u=n-o,c=a-s;return Math.sqrt(l**2+u**2+c**2)}var bI=75e-6;function io(r,e,{epsilon:t=bI}={}){r=pt(r),e||(e=r.space),e=Ge.get(e);let n=r.coords;return e!==r.space&&(n=e.from(r)),e.inGamut(n,{epsilon:t})}function Qs(r){return{space:r.space,coords:r.coords.slice(),alpha:r.alpha}}function KD(r,e,t="lab"){t=Ge.get(t);let n=t.from(r),a=t.from(e);return Math.sqrt(n.reduce((i,o,s)=>{let l=a[s];return isNaN(o)||isNaN(l)?i:i+(l-o)**2},0))}function vI(r,e){return KD(r,e,"lab")}var OI=Math.PI,K3=OI/180;function _I(r,e,{l:t=2,c:n=1}={}){[r,e]=pt([r,e]);let[a,i,o]=Rn.from(r),[,s,l]=vu.from(Rn,[a,i,o]),[u,c,f]=Rn.from(e),d=vu.from(Rn,[u,c,f])[1];s<0&&(s=0),d<0&&(d=0);let h=a-u,p=s-d,m=i-c,O=o-f,b=m**2+O**2-p**2,E=.511;a>=16&&(E=.040975*a/(1+.01765*a));let D=.0638*s/(1+.0131*s)+.638,C;Number.isNaN(l)&&(l=0),l>=164&&l<=345?C=.56+Math.abs(.2*Math.cos((l+168)*K3)):C=.36+Math.abs(.4*Math.cos((l+35)*K3));let k=Math.pow(s,4),w=Math.sqrt(k/(k+1900)),T=D*(w*C+1-w),S=(h/(t*E))**2;return S+=(p/(n*D))**2,S+=b/T**2,Math.sqrt(S)}var J3=203,V0=new Ge({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:Yr,fromBase(r){return r.map(e=>Math.max(e*J3,0))},toBase(r){return r.map(e=>Math.max(e/J3,0))}}),hd=1.15,pd=.66,eD=2610/2**14,wI=2**14/2610,tD=3424/2**12,rD=2413/2**7,nD=2392/2**7,DI=1.7*2523/2**5,aD=2**5/(1.7*2523),md=-.56,k0=16295499532821565e-27,CI=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],kI=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],EI=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],xI=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],JD=new Ge({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:V0,fromBase(r){let[e,t,n]=r,a=hd*e-(hd-1)*n,i=pd*t-(pd-1)*e,s=rr(CI,[a,i,n]).map(function(d){let h=tD+rD*(d/1e4)**eD,p=1+nD*(d/1e4)**eD;return(h/p)**DI}),[l,u,c]=rr(EI,s);return[(1+md)*l/(1+md*l)-k0,u,c]},toBase(r){let[e,t,n]=r,a=(e+k0)/(1+md-md*(e+k0)),o=rr(xI,[a,t,n]).map(function(d){let h=tD-d**aD,p=nD*d**aD-rD;return 1e4*(h/p)**wI}),[s,l,u]=rr(kI,o),c=(s+(hd-1)*u)/hd,f=(l+(pd-1)*c)/pd;return[c,f,u]},formats:{color:{coords:[" | "," | [-1,1]"," | [-1,1]"]}}}),I0=new Ge({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:JD,fromBase(r){let[e,t,n]=r,a,i=2e-4;return Math.abs(t){let a=Ea(e*Math.abs(n)*.01,nC);return 400*kd(a,n)/(a+27.13)})}function UI(r,e){let t=100/e*27.13**sD;return r.map(n=>{let a=Math.abs(n);return kd(t*Ea(a/(400-a),sD),n)})}function WI(r){let e=xa(r);e<=ao.h[0]&&(e+=360);let t=XD(ao.h,e)-1,[n,a]=ao.h.slice(t,t+2),[i,o]=ao.e.slice(t,t+2),s=ao.H[t],l=(e-n)/i;return s+100*l/(l+(a-e)/o)}function YI(r){let e=(r%400+400)%400,t=Math.floor(.01*e);e=e%100;let[n,a]=ao.h.slice(t,t+2),[i,o]=ao.e.slice(t,t+2);return xa((e*(o*n-i*a)-100*n*o)/(e*(o-i)-100*o))}function oC(r,e,t,n,a){let i={};i.discounting=a,i.refWhite=r,i.surround=n;let o=r.map(m=>m*100);i.la=e,i.yb=t;let s=o[1],l=rr(aC,o);n=LI[i.surround];let u=n[0];i.c=n[1],i.nc=n[2];let f=(1/(5*i.la+1))**4;i.fl=f*i.la+.1*(1-f)*(1-f)*Math.cbrt(5*i.la),i.flRoot=i.fl**.25,i.n=i.yb/s,i.z=1.48+Math.sqrt(i.n),i.nbb=.725*i.n**-.2,i.ncb=i.nbb;let d=a?1:Math.max(Math.min(u*(1-1/3.6*Math.exp((-i.la-42)/92)),1),0);i.dRgb=l.map(m=>bu(1,s/m,d)),i.dRgbInv=i.dRgb.map(m=>1/m);let h=l.map((m,O)=>m*i.dRgb[O]),p=iC(h,i.fl);return i.aW=i.nbb*(2*p[0]+p[1]+.05*p[2]),i}var uD=oC(FI,64/Math.PI*.2,20,"average",!1);function Z0(r,e){if(!(r.J!==void 0^r.Q!==void 0))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(r.C!==void 0^r.M!==void 0^r.s!==void 0))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(r.h!==void 0^r.H!==void 0))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(r.J===0||r.Q===0)return[0,0,0];let t=0;r.h!==void 0?t=xa(r.h)*lD:t=YI(r.H)*lD;let n=Math.cos(t),a=Math.sin(t),i=0;r.J!==void 0?i=Ea(r.J,1/2)*.1:r.Q!==void 0&&(i=.25*e.c*r.Q/((e.aW+4)*e.flRoot));let o=0;r.C!==void 0?o=r.C/i:r.M!==void 0?o=r.M/e.flRoot/i:r.s!==void 0&&(o=4e-4*r.s**2*(e.aW+4)/e.c);let s=Ea(o*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),l=.25*(Math.cos(t+2)+3.8),u=e.aW*Ea(i,2/e.c/e.z),c=5e4/13*e.nc*e.ncb*l,f=u/e.nbb,d=23*(f+.305)*W0(s,23*c+s*(11*n+108*a)),h=d*n,p=d*a,m=UI(rr(qI,[f,h,p]).map(O=>O*1/1403),e.fl);return rr(ZI,m.map((O,b)=>O*e.dRgbInv[b])).map(O=>O/100)}function sC(r,e){let t=r.map(D=>D*100),n=iC(rr(aC,t).map((D,C)=>D*e.dRgb[C]),e.fl),a=n[0]+(-12*n[1]+n[2])/11,i=(n[0]+n[1]-2*n[2])/9,o=(Math.atan2(i,a)%E0+E0)%E0,s=.25*(Math.cos(o+2)+3.8),l=5e4/13*e.nc*e.ncb*W0(s*Math.sqrt(a**2+i**2),n[0]+n[1]+1.05*n[2]+.305),u=Ea(l,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),c=e.nbb*(2*n[0]+n[1]+.05*n[2]),f=Ea(c/e.aW,.5*e.c*e.z),d=100*Ea(f,2),h=4/e.c*f*(e.aW+4)*e.flRoot,p=u*f,m=p*e.flRoot,O=xa(o*BI),b=WI(O),E=50*Ea(e.c*u/(e.aW+4),1/2);return{J:d,C:p,h:O,s:E,Q:h,M:m,H:b}}var zI=new Ge({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Yr,fromBase(r){let e=sC(r,uD);return[e.J,e.M,e.h]},toBase(r){return Z0({J:r[0],M:r[1],h:r[2]},uD)}}),VI=un.D65,jI=216/24389,lC=24389/27;function XI(r){return 116*(r>jI?Math.cbrt(r):(lC*r+16)/116)-16}function q0(r){return r>8?Math.pow((r+16)/116,3):r/lC}function GI(r,e){let[t,n,a]=r,i=[],o=0;if(a===0)return[0,0,0];let s=q0(a);a>0?o=.00379058511492914*a**2+.608983189401032*a+.9155088574762233:o=9514440756550361e-21*a**2+.08693057439788597*a-21.928975842194614;let l=2e-12,u=15,c=0,f=1/0;for(;c<=u;){i=Z0({J:o,C:n,h:t},e);let d=Math.abs(i[1]-s);if(d | "," | "," | "]}}}),KI=Math.PI/180,cD=[1,.007,.0228];function fD(r){r[1]<0&&(r=Ou.fromBase(Ou.toBase(r)));let e=Math.log(Math.max(1+cD[2]*r[1]*j0.flRoot,1))/cD[2],t=r[0]*KI,n=e*Math.cos(t),a=e*Math.sin(t);return[r[2],n,a]}function JI(r,e){[r,e]=pt([r,e]);let[t,n,a]=fD(Ou.from(r)),[i,o,s]=fD(Ou.from(e));return Math.sqrt((t-i)**2+(n-o)**2+(a-s)**2)}var Is={deltaE76:vI,deltaECMC:_I,deltaE2000:HD,deltaEJz:SI,deltaEITP:II,deltaEOK:Q0,deltaEHCT:JI};function eF(r){let e=r?Math.floor(Math.log10(Math.abs(r))):0;return Math.max(parseFloat(`1e${e-2}`),1e-6)}var dD={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function Ai(r,{method:e=Qn.gamut_mapping,space:t=void 0,deltaEMethod:n="",jnd:a=2,blackWhiteClamp:i={}}={}){if(r=pt(r),_u(arguments[1])?t=arguments[1]:t||(t=r.space),t=Ge.get(t),io(r,t,{epsilon:0}))return r;let o;if(e==="css")o=tF(r,{space:t});else{if(e!=="clip"&&!io(r,t)){Object.prototype.hasOwnProperty.call(dD,e)&&({method:e,jnd:a,deltaEMethod:n,blackWhiteClamp:i}=dD[e]);let s=HD;if(n!==""){for(let u in Is)if("deltae"+n.toLowerCase()===u.toLowerCase()){s=Is[u];break}}let l=Ai(tr(r,t),{method:"clip",space:t});if(s(r,l)>a){if(Object.keys(i).length===3){let E=Ge.resolveCoord(i.channel),D=Mn(tr(r,E.space),E.id);if(xi(D)&&(D=0),D>=i.max)return tr({space:"xyz-d65",coords:un.D65},r.space);if(D<=i.min)return tr({space:"xyz-d65",coords:[0,0,0]},r.space)}let u=Ge.resolveCoord(e),c=u.space,f=u.id,d=tr(r,c);d.coords.forEach((E,D)=>{xi(E)&&(d.coords[D]=0)});let p=(u.range||u.refRange)[0],m=eF(a),O=p,b=Mn(d,f);for(;b-O>m;){let E=Qs(d);E=Ai(E,{space:t,method:"clip"}),s(d,E)-al.range||[]);o.coords=o.coords.map((l,u)=>{let[c,f]=s[u];return c!==void 0&&(l=Math.max(c,l)),f!==void 0&&(l=Math.min(l,f)),l})}}return t!==r.space&&(o=tr(o,r.space)),r.coords=o.coords,r}Ai.returns="color";var hD={WHITE:{space:Rs,coords:[1,0,0]},BLACK:{space:Rs,coords:[0,0,0]}};function tF(r,{space:e}={}){r=pt(r),e||(e=r.space),e=Ge.get(e);let a=Ge.get("oklch");if(e.isUnbounded)return tr(r,e);let i=tr(r,a),o=i.coords[0];if(o>=1){let p=tr(hD.WHITE,e);return p.alpha=r.alpha,tr(p,e)}if(o<=0){let p=tr(hD.BLACK,e);return p.alpha=r.alpha,tr(p,e)}if(io(i,e,{epsilon:0}))return tr(i,e);function s(p){let m=tr(p,e),O=Object.values(e.coords);return m.coords=m.coords.map((b,E)=>{if("range"in O[E]){let[D,C]=O[E].range;return jD(D,b,C)}return b}),m}let l=0,u=i.coords[1],c=!0,f=Qs(i),d=s(f),h=Q0(d,f);if(h<.02)return d;for(;u-l>1e-4;){let p=(l+u)/2;if(f.coords[1]=p,c&&io(f,e,{epsilon:0}))l=p;else if(d=s(f),h=Q0(d,f),h<.02){if(.02-h<1e-4)break;c=!1,l=p}else u=p}return d}function tr(r,e,{inGamut:t}={}){r=pt(r),e=Ge.get(e);let n=e.from(r),a={space:e,coords:n,alpha:r.alpha};return t&&(a=Ai(a,t===!0?void 0:t)),a}tr.returns="color";function yu(r,{precision:e=Qn.precision,format:t="default",inGamut:n=!0,...a}={}){let i;r=pt(r);let o=t;t=r.space.getFormat(t)??r.space.getFormat("default")??Ge.DEFAULT_FORMAT;let s=r.coords.slice();if(n||(n=t.toGamut),n&&!io(r)&&(s=Ai(Qs(r),n===!0?void 0:n).coords),t.type==="custom")if(a.precision=e,t.serialize)i=t.serialize(s,r.alpha,a);else throw new TypeError(`format ${o} can only be used to parse colors, not for serialization`);else{let l=t.name||"color";t.serializeCoords?s=t.serializeCoords(s,e):e!==null&&(s=s.map(d=>_d(d,{precision:e})));let u=[...s];if(l==="color"){let d=t.id||t.ids?.[0]||r.space.id;u.unshift(d)}let c=r.alpha;e!==null&&(c=_d(c,{precision:e}));let f=r.alpha>=1||t.noAlpha?"":`${t.commas?",":" /"} ${c}`;i=`${l}(${u.join(t.commas?", ":" ")}${f})`}return i}var rF=[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],nF=[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]],Ed=new on({id:"rec2020-linear",cssId:"--rec2020-linear",name:"Linear REC.2020",white:"D65",toXYZ_M:rF,fromXYZ_M:nF}),gd=1.09929682680944,pD=.018053968510807,uC=new on({id:"rec2020",name:"REC.2020",base:Ed,toBase(r){return r.map(function(e){return e=pD?gd*Math.pow(e,.45)-(gd-1):4.5*e})}}),aF=[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],iF=[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]],cC=new on({id:"p3-linear",cssId:"--display-p3-linear",name:"Linear P3",white:"D65",toXYZ_M:aF,fromXYZ_M:iF}),oF=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],Dr=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],fC=new on({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:oF,fromXYZ_M:Dr}),mD={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]},gD=Array(3).fill(" | [0, 255]"),yD=Array(3).fill("[0, 255]"),Fs=new on({id:"srgb",name:"sRGB",base:fC,fromBase:r=>r.map(e=>{let t=e<0?-1:1,n=e*t;return n>.0031308?t*(1.055*n**(1/2.4)-.055):12.92*e}),toBase:r=>r.map(e=>{let t=e<0?-1:1,n=e*t;return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4}),formats:{rgb:{coords:gD},rgb_number:{name:"rgb",commas:!0,coords:yD,noAlpha:!0},color:{},rgba:{coords:gD,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:yD},hex:{type:"custom",toGamut:!0,test:r=>/^#([a-f0-9]{3,4}){1,2}$/i.test(r),parse(r){r.length<=5&&(r=r.replace(/[a-f0-9]/gi,"$&$&"));let e=[];return r.replace(/[a-f0-9]{2}/gi,t=>{e.push(parseInt(t,16)/255)}),{spaceId:"srgb",coords:e.slice(0,3),alpha:e.slice(3)[0]}},serialize:(r,e,{collapse:t=!0}={})=>{e<1&&r.push(e),r=r.map(i=>Math.round(i*255));let n=t&&r.every(i=>i%17===0);return"#"+r.map(i=>n?(i/17).toString(16):i.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:r=>/^[a-z]+$/i.test(r),parse(r){r=r.toLowerCase();let e={spaceId:"srgb",coords:null,alpha:1};if(r==="transparent"?(e.coords=mD.black,e.alpha=0):e.coords=mD[r],e.coords)return e}}}}),dC=new on({id:"p3",cssId:"display-p3",name:"P3",base:cC,fromBase:Fs.fromBase,toBase:Fs.toBase});Qn.display_space=Fs;var sF;if(typeof CSS<"u"&&CSS.supports)for(let r of[Rn,uC,dC]){let e=r.getMinCoords(),n=yu({space:r,coords:e,alpha:1});if(CSS.supports("color",n)){Qn.display_space=r;break}}function lF(r,{space:e=Qn.display_space,...t}={}){let n=yu(r,t);if(typeof CSS>"u"||CSS.supports("color",n)||!Qn.display_space)n=new String(n),n.color=r;else{let a=r;if((r.coords.some(xi)||xi(r.alpha))&&!(sF??(sF=CSS.supports("color","hsl(none 50% 50%)")))&&(a=Qs(r),a.coords=a.coords.map(Or),a.alpha=Or(a.alpha),n=yu(a,t),CSS.supports("color",n)))return n=new String(n),n.color=a,n;a=tr(a,e),n=new String(yu(a,t)),n.color=a}return n}function uF(r,e){return r=pt(r),e=pt(e),r.space===e.space&&r.alpha===e.alpha&&r.coords.every((t,n)=>t===e.coords[n])}function $i(r){return Mn(r,[Yr,"y"])}function hC(r,e){ja(r,[Yr,"y"],e)}function cF(r){Object.defineProperty(r.prototype,"luminance",{get(){return $i(this)},set(e){hC(this,e)}})}var fF=Object.freeze({__proto__:null,getLuminance:$i,register:cF,setLuminance:hC});function dF(r,e){r=pt(r),e=pt(e);let t=Math.max($i(r),0),n=Math.max($i(e),0);return n>t&&([t,n]=[n,t]),(t+.05)/(n+.05)}var hF=.56,pF=.57,mF=.62,gF=.65,bD=.022,yF=1.414,bF=.1,vF=5e-4,OF=1.14,vD=.027,_F=1.14;function OD(r){return r>=bD?r:r+(bD-r)**yF}function Ns(r){let e=r<0?-1:1,t=Math.abs(r);return e*Math.pow(t,2.4)}function wF(r,e){e=pt(e),r=pt(r);let t,n,a,i,o,s;e=tr(e,"srgb"),[i,o,s]=e.coords;let l=Ns(i)*.2126729+Ns(o)*.7151522+Ns(s)*.072175;r=tr(r,"srgb"),[i,o,s]=r.coords;let u=Ns(i)*.2126729+Ns(o)*.7151522+Ns(s)*.072175,c=OD(l),f=OD(u),d=f>c;return Math.abs(f-c)0?a=n-vD:a=n+vD,a*100}function DF(r,e){r=pt(r),e=pt(e);let t=Math.max($i(r),0),n=Math.max($i(e),0);n>t&&([t,n]=[n,t]);let a=t+n;return a===0?0:(t-n)/a}var CF=5e4;function kF(r,e){r=pt(r),e=pt(e);let t=Math.max($i(r),0),n=Math.max($i(e),0);return n>t&&([t,n]=[n,t]),n===0?CF:(t-n)/n}function EF(r,e){r=pt(r),e=pt(e);let t=Mn(r,[Rn,"l"]),n=Mn(e,[Rn,"l"]);return Math.abs(t-n)}var xF=216/24389,_D=24/116,yd=24389/27,x0=un.D65,L0=new Ge({id:"lab-d65",name:"Lab D65",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:x0,base:Yr,fromBase(r){let t=r.map((n,a)=>n/x0[a]).map(n=>n>xF?Math.cbrt(n):(yd*n+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(r){let e=[];return e[1]=(r[0]+16)/116,e[0]=r[1]/500+e[1],e[2]=e[1]-r[2]/200,[e[0]>_D?Math.pow(e[0],3):(116*e[0]-16)/yd,r[0]>8?Math.pow((r[0]+16)/116,3):r[0]/yd,e[2]>_D?Math.pow(e[2],3):(116*e[2]-16)/yd].map((n,a)=>n*x0[a])},formats:{"lab-d65":{coords:[" | "," | [-1,1]"," | [-1,1]"]}}}),S0=Math.pow(5,.5)*.5+.5;function SF(r,e){r=pt(r),e=pt(e);let t=Mn(r,[L0,"l"]),n=Mn(e,[L0,"l"]),a=Math.abs(Math.pow(t,S0)-Math.pow(n,S0)),i=Math.pow(a,1/S0)*Math.SQRT2-40;return i<7.5?0:i}var Od=Object.freeze({__proto__:null,contrastAPCA:wF,contrastDeltaPhi:SF,contrastLstar:EF,contrastMichelson:DF,contrastWCAG21:dF,contrastWeber:kF});function AF(r,e,t={}){_u(t)&&(t={algorithm:t});let{algorithm:n,...a}=t;if(!n){let i=Object.keys(Od).map(o=>o.replace(/^contrast/,"")).join(", ");throw new TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${i}`)}r=pt(r),e=pt(e);for(let i in Od)if("contrast"+n.toLowerCase()===i.toLowerCase())return Od[i](r,e,a);throw new TypeError(`Unknown contrast algorithm: ${n}`)}function xd(r){let[e,t,n]=wu(r,Yr),a=e+15*t+3*n;return[4*e/a,9*t/a]}function pC(r){let[e,t,n]=wu(r,Yr),a=e+t+n;return[e/a,t/a]}function $F(r){Object.defineProperty(r.prototype,"uv",{get(){return xd(this)}}),Object.defineProperty(r.prototype,"xy",{get(){return pC(this)}})}var TF=Object.freeze({__proto__:null,register:$F,uv:xd,xy:pC});function gu(r,e,t={}){_u(t)&&(t={method:t});let{method:n=Qn.deltaE,...a}=t;for(let i in Is)if("deltae"+n.toLowerCase()===i.toLowerCase())return Is[i](r,e,a);throw new TypeError(`Unknown deltaE method: ${n}`)}function NF(r,e=.25){let n=[Ge.get("oklch","lch"),"l"];return ja(r,n,a=>a*(1+e))}function PF(r,e=.25){let n=[Ge.get("oklch","lch"),"l"];return ja(r,n,a=>a*(1-e))}var MF=Object.freeze({__proto__:null,darken:PF,lighten:NF});function mC(r,e,t=.5,n={}){return[r,e]=[pt(r),pt(e)],Ei(t)==="object"&&([t,n]=[.5,t]),Du(r,e,n)(t)}function gC(r,e,t={}){let n;X0(r)&&([n,t]=[r,e],[r,e]=n.rangeArgs.colors);let{maxDeltaE:a,deltaEMethod:i,steps:o=2,maxSteps:s=1e3,...l}=t;n||([r,e]=[pt(r),pt(e)],n=Du(r,e,l));let u=gu(r,e),c=a>0?Math.max(o,Math.ceil(u/a)+1):o,f=[];if(s!==void 0&&(c=Math.min(c,s)),c===1)f=[{p:.5,color:n(.5)}];else{let d=1/(c-1);f=Array.from({length:c},(h,p)=>{let m=p*d;return{p:m,color:n(m)}})}if(a>0){let d=f.reduce((h,p,m)=>{if(m===0)return 0;let O=gu(p.color,f[m-1].color,i);return Math.max(h,O)},0);for(;d>a;){d=0;for(let h=1;hd.color),f}function Du(r,e,t={}){if(X0(r)){let[l,u]=[r,e];return Du(...l.rangeArgs.colors,{...l.rangeArgs.options,...u})}let{space:n,outputSpace:a,progression:i,premultiplied:o}=t;r=pt(r),e=pt(e),r=Qs(r),e=Qs(e);let s={colors:[r,e],options:t};if(n?n=Ge.get(n):n=Ge.registry[Qn.interpolationSpace]||r.space,a=a?Ge.get(a):n,r=tr(r,n),e=tr(e,n),r=Ai(r),e=Ai(e),n.coords.h&&n.coords.h.type==="angle"){let l=t.hue=t.hue||"shorter",u=[n,"h"],[c,f]=[Mn(r,u),Mn(e,u)];isNaN(c)&&!isNaN(f)?c=f:isNaN(f)&&!isNaN(c)&&(f=c),[c,f]=hI(l,[c,f]),ja(r,u,c),ja(e,u,f)}return o&&(r.coords=r.coords.map(l=>l*r.alpha),e.coords=e.coords.map(l=>l*e.alpha)),Object.assign(l=>{l=i?i(l):l;let u=r.coords.map((d,h)=>{let p=e.coords[h];return bu(d,p,l)}),c=bu(r.alpha,e.alpha,l),f={space:n,coords:u,alpha:c};return o&&(f.coords=f.coords.map(d=>d/c)),a!==n&&(f=tr(f,a)),f},{rangeArgs:s})}function X0(r){return Ei(r)==="function"&&!!r.rangeArgs}Qn.interpolationSpace="lab";function RF(r){r.defineFunction("mix",mC,{returns:"color"}),r.defineFunction("range",Du,{returns:"function"}),r.defineFunction("steps",gC,{returns:"array"})}var QF=Object.freeze({__proto__:null,isRange:X0,mix:mC,range:Du,register:RF,steps:gC}),yC=new Ge({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:Fs,fromBase:r=>{let e=Math.max(...r),t=Math.min(...r),[n,a,i]=r,[o,s,l]=[NaN,0,(t+e)/2],u=e-t;if(u!==0){switch(s=l===0||l===1?0:(e-l)/Math.min(l,1-l),e){case n:o=(a-i)/u+(a=360&&(o-=360),[o,s*100,l*100]},toBase:r=>{let[e,t,n]=r;e=e%360,e<0&&(e+=360),t/=100,n/=100;function a(i){let o=(i+e/30)%12,s=t*Math.min(n,1-n);return n-s*Math.max(-1,Math.min(o-3,9-o,1))}return[a(0),a(8),a(4)]},formats:{hsl:{coords:[" | ","",""]},hsla:{coords:[" | ","",""],commas:!0,lastAlpha:!0}}}),bC=new Ge({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:yC,fromBase(r){let[e,t,n]=r;t/=100,n/=100;let a=n+t*Math.min(n,1-n);return[e,a===0?0:200*(1-n/a),100*a]},toBase(r){let[e,t,n]=r;t/=100,n/=100;let a=n*(1-t/2);return[e,a===0||a===1?0:(n-a)/Math.min(a,1-a)*100,a*100]},formats:{color:{id:"--hsv",coords:[" | "," | "," | "]}}}),IF=new Ge({id:"hwb",name:"HWB",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},w:{range:[0,100],name:"Whiteness"},b:{range:[0,100],name:"Blackness"}},base:bC,fromBase(r){let[e,t,n]=r;return[e,n*(100-t)/100,100-n]},toBase(r){let[e,t,n]=r;t/=100,n/=100;let a=t+n;if(a>=1){let s=t/a;return[e,0,s*100]}let i=1-n,o=i===0?0:1-t/i;return[e,o*100,i*100]},formats:{hwb:{coords:[" | "," | "," | "]}}}),FF=[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],ZF=[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]],vC=new on({id:"a98rgb-linear",cssId:"--a98-rgb-linear",name:"Linear Adobe\xAE 98 RGB compatible",white:"D65",toXYZ_M:FF,fromXYZ_M:ZF}),qF=new on({id:"a98rgb",cssId:"a98-rgb",name:"Adobe\xAE 98 RGB compatible",base:vC,toBase:r=>r.map(e=>Math.pow(Math.abs(e),563/256)*Math.sign(e)),fromBase:r=>r.map(e=>Math.pow(Math.abs(e),256/563)*Math.sign(e))}),LF=[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],BF=[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]],OC=new on({id:"prophoto-linear",cssId:"--prophoto-rgb-linear",name:"Linear ProPhoto",white:"D50",base:z0,toXYZ_M:LF,fromXYZ_M:BF}),UF=1/512,WF=16/512,YF=new on({id:"prophoto",cssId:"prophoto-rgb",name:"ProPhoto",base:OC,toBase(r){return r.map(e=>ee>=UF?e**(1/1.8):16*e)}}),zF=new Ge({id:"oklch",name:"Oklch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:Rs,fromBase(r){let[e,t,n]=r,a,i=2e-4;return Math.abs(t) | "," | [0,1]"," | "]}}}),_C=un.D65,VF=216/24389,wD=24389/27,[DD,CD]=xd({space:Yr,coords:_C}),wC=new Ge({id:"luv",name:"Luv",coords:{l:{refRange:[0,100],name:"Lightness"},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:_C,base:Yr,fromBase(r){let e=[Or(r[0]),Or(r[1]),Or(r[2])],t=e[1],[n,a]=xd({space:Yr,coords:e});if(!Number.isFinite(n)||!Number.isFinite(a))return[0,0,0];let i=t<=VF?wD*t:116*Math.cbrt(t)-16;return[i,13*i*(n-DD),13*i*(a-CD)]},toBase(r){let[e,t,n]=r;if(e===0||xi(e))return[0,0,0];t=Or(t),n=Or(n);let a=t/(13*e)+DD,i=n/(13*e)+CD,o=e<=8?e/wD:Math.pow((e+16)/116,3);return[o*(9*a/(4*i)),o,o*((12-3*a-20*i)/(4*i))]},formats:{color:{id:"--luv",coords:[" | "," | [-1,1]"," | [-1,1]"]}}}),G0=new Ge({id:"lchuv",name:"LChuv",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,220],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:wC,fromBase(r){let[e,t,n]=r,a,i=.02;return Math.abs(t) | "," | "," | "]}}}),jF=216/24389,XF=24389/27,kD=Dr[0][0],ED=Dr[0][1],A0=Dr[0][2],xD=Dr[1][0],SD=Dr[1][1],$0=Dr[1][2],AD=Dr[2][0],$D=Dr[2][1],T0=Dr[2][2];function Ps(r,e,t){let n=e/(Math.sin(t)-r*Math.cos(t));return n<0?1/0:n}function Cd(r){let e=Math.pow(r+16,3)/1560896,t=e>jF?e:r/XF,n=t*(284517*kD-94839*A0),a=t*(838422*A0+769860*ED+731718*kD),i=t*(632260*A0-126452*ED),o=t*(284517*xD-94839*$0),s=t*(838422*$0+769860*SD+731718*xD),l=t*(632260*$0-126452*SD),u=t*(284517*AD-94839*T0),c=t*(838422*T0+769860*$D+731718*AD),f=t*(632260*T0-126452*$D);return{r0s:n/i,r0i:a*r/i,r1s:n/(i+126452),r1i:(a-769860)*r/(i+126452),g0s:o/l,g0i:s*r/l,g1s:o/(l+126452),g1i:(s-769860)*r/(l+126452),b0s:u/f,b0i:c*r/f,b1s:u/(f+126452),b1i:(c-769860)*r/(f+126452)}}function TD(r,e){let t=e/360*Math.PI*2,n=Ps(r.r0s,r.r0i,t),a=Ps(r.r1s,r.r1i,t),i=Ps(r.g0s,r.g0i,t),o=Ps(r.g1s,r.g1i,t),s=Ps(r.b0s,r.b0i,t),l=Ps(r.b1s,r.b1i,t);return Math.min(n,a,i,o,s,l)}var GF=new Ge({id:"hsluv",name:"HSLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:G0,gamutSpace:Fs,fromBase(r){let[e,t,n]=[Or(r[0]),Or(r[1]),Or(r[2])],a;if(e>99.9999999)a=0,e=100;else if(e<1e-8)a=0,e=0;else{let i=Cd(e),o=TD(i,n);a=t/o*100}return[n,a,e]},toBase(r){let[e,t,n]=[Or(r[0]),Or(r[1]),Or(r[2])],a;if(n>99.9999999)n=100,a=0;else if(n<1e-8)n=0,a=0;else{let i=Cd(n);a=TD(i,e)/100*t}return[n,a,e]},formats:{color:{id:"--hsluv",coords:[" | "," | "," | "]}}});Dr[0][0];Dr[0][1];Dr[0][2];Dr[1][0];Dr[1][1];Dr[1][2];Dr[2][0];Dr[2][1];Dr[2][2];function Ms(r,e){return Math.abs(e)/Math.sqrt(Math.pow(r,2)+1)}function ND(r){let e=Ms(r.r0s,r.r0i),t=Ms(r.r1s,r.r1i),n=Ms(r.g0s,r.g0i),a=Ms(r.g1s,r.g1i),i=Ms(r.b0s,r.b0i),o=Ms(r.b1s,r.b1i);return Math.min(e,t,n,a,i,o)}var HF=new Ge({id:"hpluv",name:"HPLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:G0,gamutSpace:"self",fromBase(r){let[e,t,n]=[Or(r[0]),Or(r[1]),Or(r[2])],a;if(e>99.9999999)a=0,e=100;else if(e<1e-8)a=0,e=0;else{let i=Cd(e),o=ND(i);a=t/o*100}return[n,a,e]},toBase(r){let[e,t,n]=[Or(r[0]),Or(r[1]),Or(r[2])],a;if(n>99.9999999)n=100,a=0;else if(n<1e-8)n=0,a=0;else{let i=Cd(n);a=ND(i)/100*t}return[n,a,e]},formats:{color:{id:"--hpluv",coords:[" | "," | "," | "]}}}),PD=203,MD=2610/2**14,KF=2**14/2610,JF=2523/2**5,RD=2**5/2523,QD=3424/2**12,ID=2413/2**7,FD=2392/2**7,eZ=new on({id:"rec2100pq",cssId:"rec2100-pq",name:"REC.2100-PQ",base:Ed,toBase(r){return r.map(function(e){return(Math.max(e**RD-QD,0)/(ID-FD*e**RD))**KF*1e4/PD})},fromBase(r){return r.map(function(e){let t=Math.max(e*PD/1e4,0),n=QD+ID*t**MD,a=1+FD*t**MD;return(n/a)**JF})}}),ZD=.17883277,qD=.28466892,LD=.55991073,N0=3.7743,tZ=new on({id:"rec2100hlg",cssId:"rec2100-hlg",name:"REC.2100-HLG",referred:"scene",base:Ed,toBase(r){return r.map(function(e){return e<=.5?e**2/3*N0:(Math.exp((e-LD)/ZD)+qD)/12*N0})},fromBase(r){return r.map(function(e){return e/=N0,e<=1/12?Math.sqrt(3*e):ZD*Math.log(12*e-qD)+LD})}}),DC={};Si.add("chromatic-adaptation-start",r=>{r.options.method&&(r.M=CC(r.W1,r.W2,r.options.method))});Si.add("chromatic-adaptation-end",r=>{r.M||(r.M=CC(r.W1,r.W2,r.options.method))});function Sd({id:r,toCone_M:e,fromCone_M:t}){DC[r]=arguments[0]}function CC(r,e,t="Bradford"){let n=DC[t],[a,i,o]=rr(n.toCone_M,r),[s,l,u]=rr(n.toCone_M,e),c=[[s/a,0,0],[0,l/i,0],[0,0,u/o]],f=rr(c,n.toCone_M);return rr(n.fromCone_M,f)}Sd({id:"von Kries",toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]});Sd({id:"Bradford",toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]});Sd({id:"CAT02",toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]});Sd({id:"CAT16",toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]});Object.assign(un,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]});un.ACES=[.32168/.33767,1,(1-.32168-.33767)/.33767];var rZ=[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],nZ=[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]],kC=new on({id:"acescg",cssId:"--acescg",name:"ACEScg",coords:{r:{range:[0,65504],name:"Red"},g:{range:[0,65504],name:"Green"},b:{range:[0,65504],name:"Blue"}},referred:"scene",white:un.ACES,toXYZ_M:rZ,fromXYZ_M:nZ}),bd=2**-16,P0=-.35828683,vd=(Math.log2(65504)+9.72)/17.52,aZ=new on({id:"acescc",cssId:"--acescc",name:"ACEScc",coords:{r:{range:[P0,vd],name:"Red"},g:{range:[P0,vd],name:"Green"},b:{range:[P0,vd],name:"Blue"}},referred:"scene",base:kC,toBase(r){let e=-.3013698630136986;return r.map(function(t){return t<=e?(2**(t*17.52-9.72)-bd)*2:t1||i===void 0?1:i<0?0:i;for(let o=0;othis.get(o),set:s=>this.set(o,s)})}get spaceId(){return this.space.id}clone(){return new r(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...e){let t=lF(this,...e);return t.color=new r(t.color),t}static get(e,...t){return e instanceof r?e:new r(e,...t)}static defineFunction(e,t,n=t){let{instance:a=!0,returns:i}=n,o=function(...s){let l=t(...s);if(i==="color")l=r.get(l);else if(i==="function"){let u=l;l=function(...c){let f=u(...c);return r.get(f)},Object.assign(l,u)}else i==="array"&&(l=l.map(u=>r.get(u)));return l};e in r||(r[e]=o),a&&(r.prototype[e]=function(...s){return o(this,...s)})}static defineFunctions(e){for(let t in e)r.defineFunction(t,e[t],e[t])}static extend(e){if(e.register)e.register(r);else for(let t in e)r.defineFunction(t,e[t])}};zr.defineFunctions({get:Mn,getAll:wu,set:ja,setAll:Y0,to:tr,equals:uF,inGamut:io,toGamut:Ai,distance:KD,toString:yu});Object.assign(zr,{util:lI,hooks:Si,WHITES:un,Space:Ge,spaces:Ge.registry,parse:GD,defaults:Qn});for(let r of Object.keys(BD))Ge.register(BD[r]);for(let r in Ge.registry)B0(r,Ge.registry[r]);Si.add("colorspace-init-end",r=>{B0(r.id,r),r.aliases?.forEach(e=>{B0(e,r)})});function B0(r,e){let t=r.replace(/-/g,"_");Object.defineProperty(zr.prototype,t,{get(){let n=this.getAll(r);return typeof Proxy>"u"?n:new Proxy(n,{has:(a,i)=>{try{return Ge.resolveCoord([e,i]),!0}catch{}return Reflect.has(a,i)},get:(a,i,o)=>{if(i&&typeof i!="symbol"&&!(i in a)){let{index:s}=Ge.resolveCoord([e,i]);if(s>=0)return a[s]}return Reflect.get(a,i,o)},set:(a,i,o,s)=>{if(i&&typeof i!="symbol"&&!(i in a)||i>=0){let{index:l}=Ge.resolveCoord([e,i]);if(l>=0)return a[l]=o,this.setAll(r,a),!0}return Reflect.set(a,i,o,s)}})},set(n){this.setAll(r,n)},configurable:!0,enumerable:!0})}zr.extend(Is);zr.extend({deltaE:gu});Object.assign(zr,{deltaEMethods:Is});zr.extend(MF);zr.extend({contrast:AF});zr.extend(TF);zr.extend(fF);zr.extend(QF);zr.extend(Od);var H0=class extends wa{update(e){return e}},K0=class extends Da{update(e){return e}},J0=class extends Ca{constructor(t,n,a,i,o){super(t,n,a,i);this.yearCalculator=o}update(t){if(!t.length)return[];let n=Ne(this.yearCalculator.staticStore.seasonal),a=this.yearCalculator.daysBefore(this.getDate());switch(n.type){case ot.DATED:{let i=t,o=i.length-1,s=i[o],l=this.year,u=this.yearCalculator.daysBefore({month:s.month,day:s.day,year:l}),c=this.yearCalculator.daysBefore({month:s.month,day:s.day,year:l+1});for(;au+c.duration+(c.peak??0),0),s=(a-n.offset)%o,l=[...i,i[0]];for(let u=0;un)}getYearCache(t){return this.cache.has(t)?this.cache.get(t):new H0(t,this.entities)}getMonthCache(t,n){let a=this.getYearCache(n);return a.cache.has(t)?a.cache.get(t):new K0(t,n,a.entities)}getDayCache(t,n,a){let i=this.getMonthCache(n,a);return i.cache.has(t)?i.cache.get(t):new J0(t,n,a,i.entities,this.yearCalculator)}getPreviousSeason(t){return de([this.entities,t],([n,a])=>{let i=n.findIndex(o=>o.id===a.id);return n[sn(i-1,n.length)]})}getNextSeason(t){return de([this.entities,t],([n,a])=>{let i=n.findIndex(o=>o.id===a.id);return n[sn(i+1,n.length)]})}};var iZ=214013,oZ=2531011,sZ=4294967295,lZ=(1<<31)-1,e1=function(r){return r*iZ+oZ&sZ},t1=function(r){return(r&lZ)>>16},dae=function(){function r(e){this.seed=e}return r.prototype.clone=function(){return new r(this.seed)},r.prototype.next=function(){var e=new r(this.seed),t=e.unsafeNext();return[t,e]},r.prototype.unsafeNext=function(){var e=e1(this.seed),t=t1(e),n=e1(e),a=t1(n);this.seed=e1(n);var i=t1(this.seed),o=i+(a+(t<<15)<<15);return o|0},r}();var pae=function(){function r(e,t){this.states=e,this.index=t}return r.twist=function(e){for(var t=e.slice(),n=0;n!==r.N-r.M;++n){var a=(t[n]&r.MASK_UPPER)+(t[n+1]&r.MASK_LOWER);t[n]=t[n+r.M]^a>>>1^-(a&1)&r.A}for(var n=r.N-r.M;n!==r.N-1;++n){var i=(t[n]&r.MASK_UPPER)+(t[n+1]&r.MASK_LOWER);t[n]=t[n+r.M-r.N]^i>>>1^-(i&1)&r.A}var o=(t[r.N-1]&r.MASK_UPPER)+(t[0]&r.MASK_LOWER);return t[r.N-1]=t[r.M-1]^o>>>1^-(o&1)&r.A,t},r.seeded=function(e){var t=Array(r.N);t[0]=e;for(var n=1;n!==r.N;++n){var a=t[n-1]^t[n-1]>>>30;t[n]=Math.imul(r.F,a)+n|0}return t},r.from=function(e){return new r(r.twist(r.seeded(e)),0)},r.prototype.clone=function(){return new r(this.states,this.index)},r.prototype.next=function(){var e=new r(this.states,this.index),t=e.unsafeNext();return[t,e]},r.prototype.unsafeNext=function(){var e=this.states[this.index];return e^=this.states[this.index]>>>r.U,e^=e<>>r.L,++this.index>=r.N&&(this.states=r.twist(this.states),this.index=0),e},r.N=624,r.M=397,r.R=31,r.A=2567483615,r.F=1812433253,r.U=11,r.S=7,r.B=2636928640,r.T=15,r.C=4022730752,r.L=18,r.MASK_LOWER=Math.pow(2,r.R)-1,r.MASK_UPPER=Math.pow(2,r.R),r}();var gae=function(){function r(e,t,n,a){this.s01=e,this.s00=t,this.s11=n,this.s10=a}return r.prototype.clone=function(){return new r(this.s01,this.s00,this.s11,this.s10)},r.prototype.next=function(){var e=new r(this.s01,this.s00,this.s11,this.s10),t=e.unsafeNext();return[t,e]},r.prototype.unsafeNext=function(){var e=this.s00^this.s00<<23,t=this.s01^(this.s01<<23|this.s00>>>9),n=e^this.s10^(e>>>18|t<<14)^(this.s10>>>5|this.s11<<27),a=t^this.s11^t>>>18^this.s11>>>5,i=this.s00+this.s10|0;return this.s01=this.s11,this.s00=this.s10,this.s11=a,this.s10=n,i},r.prototype.jump=function(){var e=new r(this.s01,this.s00,this.s11,this.s10);return e.unsafeJump(),e},r.prototype.unsafeJump=function(){for(var e=0,t=0,n=0,a=0,i=[1667051007,2321340297,1548169110,304075285],o=0;o!==4;++o)for(var s=1;s;s<<=1)i[o]&s&&(e^=this.s01,t^=this.s00,n^=this.s11,a^=this.s10),this.unsafeNext();this.s01=e,this.s00=t,this.s11=n,this.s10=a},r}();var uZ=function(){function r(e,t,n,a){this.s01=e,this.s00=t,this.s11=n,this.s10=a}return r.prototype.clone=function(){return new r(this.s01,this.s00,this.s11,this.s10)},r.prototype.next=function(){var e=new r(this.s01,this.s00,this.s11,this.s10),t=e.unsafeNext();return[t,e]},r.prototype.unsafeNext=function(){var e=this.s00+this.s10|0,t=this.s10^this.s00,n=this.s11^this.s01,a=this.s00,i=this.s01;return this.s00=a<<24^i>>>8^t^t<<16,this.s01=i<<24^a>>>8^n^(n<<16|t>>>16),this.s10=n<<5^t>>>27,this.s11=t<<5^n>>>27,e},r.prototype.jump=function(){var e=new r(this.s01,this.s00,this.s11,this.s10);return e.unsafeJump(),e},r.prototype.unsafeJump=function(){for(var e=0,t=0,n=0,a=0,i=[3639956645,3750757012,1261568508,386426335],o=0;o!==4;++o)for(var s=1;s;s<<=1)i[o]&s&&(e^=this.s01,t^=this.s00,n^=this.s11,a^=this.s10),this.unsafeNext();this.s01=e,this.s00=t,this.s11=n,this.s10=a},r}(),r1=function(r){return new uZ(-1,~r,r|0,0)};var qae=Number.MAX_SAFE_INTEGER;var n1=class extends wa{update(e){return e}},a1=class extends Da{update(e){return e}},i1=class extends Ca{constructor(e,t,n,a){super(e,t,n,a)}update(e){let t=[];for(let n of e)n.date&&fl(n.date,this.getDate())&&t.push(n);return t}},$d=class extends ka{constructor(t,n,a){super(t);this.seasonCache=n;this.yearCalculator=a}getYearCache(t){return this.cache.has(t)?this.cache.get(t):new n1(t,this.entities)}getMonthCache(t,n){let a=this.getYearCache(n);return a.cache.has(t)?a.cache.get(t):new a1(t,n,a.entities)}getDayCache(t,n,a){let i=this.getMonthCache(n,a);return i.cache.has(t)?i.cache.get(t):new i1(t,n,a,i.entities)}};var Td=class Td{static pick(e){return{index:e,strength:Td.Strength[e]}}};Td.Strength=["Clear sky","A few clouds","Mostly cloudy","Gray, slightly overcast","Gray, highly overcast","Dark storm clouds"];var Ti=Td,Bn=class Bn{static pick(e,t){let n=t<0?Bn.Snow:Bn.Rain;for(let[a,i]of Bn.Chance.entries())if(e1);return n+a*s*Math.sqrt(-2*Math.log(o)/o)}}return t.source=r,t}(Zs);var EC=23283064365386963e-26;function Nd(r=Math.random()){let e=(0<=r&&r<1?r/EC:Math.abs(r))|0;return()=>(e=1664525*e+1013904223|0,EC*(e>>>0))}var so,qs,ku,Md,Eu,Pd=class{constructor(e,t,n){this.seasonalData=e;this.seasonCache=t;this.yearCalculator=n;Tt(this,so,void 0);Tt(this,qs,void 0);Tt(this,ku,void 0);Tt(this,Md,void 0);Tt(this,Eu,void 0);Nt(this,so,de(e,a=>a.weather)),Nt(this,Eu,de(Me(this,so),a=>a.enabled)),Nt(this,qs,de(Me(this,so),a=>a.seed)),Nt(this,Md,de(Me(this,qs),a=>r1(a))),Nt(this,ku,new $d(Za([]),this.seasonCache,this.yearCalculator))}getWeatherForDate(e,t){return de([Me(this,Eu),Me(this,ku).getItemsOrRecalculate(e),Me(this,so),Me(this,qs),t??Za(null)],([n,a,i,o,s])=>{if(!n)return null;if(a.length)return a[0];let l=this.generateWeather(e,i,o,s);return l||null})}generateWeather(e,t,n,a){let i=this.seasonCache.getSeasonForDate(e),{from:o,to:s,effect:l}=this.getSeasonalWeatherEffect(e,i,a),u=this.getInterpolatedWeatherData(o,s,l);if(!u)return null;let c=this.yearCalculator.daysBefore(e)+e.day,f=new Xa(c*n),d=f.normal(u.tempRange[0],4),h=f.normal(u.tempRange[1],4);if(d>h){let w=d;d=h,h=w}let p=f.normal((d+h)/2,4),m=Cu.NONE,O=Ti.pick(0);f.chance(u.precipitationChance,1)?(m=Cu.pick(f.normal(u.precipitationIntensity*100,25)/100,p),O=Ti.pick(f.randomInt(m.index,Ti.Strength.length-1))):f.chance(u.cloudy,1)&&(O=Ti.pick(f.randomInt(1,Ti.Strength.length-2)));let b=f.normal(u.windy*100,3)/100,E=b+b*oo.Multiplier[m.index],D=oo.Directions.indexOf(t.primaryWindDirection??"E"),C=oo.pick(E,sn(D+f.normalInt(0,2),oo.Directions.length));return{temperature:{actual:p,low:d,high:h},precipitation:m,clouds:O,wind:C}}getInterpolatedWeatherData(e,t,n){let a=Ma(e);if(!a)return null;let i=Ma(t)??a,o=[Xa.cerp(a.tempRange[0],i.tempRange[0],n),Xa.cerp(a.tempRange[1],i.tempRange[1],n)],s=Xa.cerp(a.precipitationChance,i.precipitationChance,n),l=Xa.cerp(a.precipitationIntensity,i.precipitationIntensity,n),u=Xa.cerp(a.cloudy,i.cloudy,n),c=Xa.cerp(a.windy,i.windy,n);return{tempRange:o,precipitationChance:s,precipitationIntensity:l,cloudy:u,windy:c}}getSeasonalWeatherEffect(e,t,n){let a=Ne(t),i,o,s=1;if(a.daysPassed>=a.weatherOffset&&a.daysPassed<=a.weatherOffset+a.weatherPeak)i=o=a;else if(a.daysPassede.month?e.year-1:e.year,month:u.month,day:u.day};c=this.yearCalculator.daysBefore(d)-(u.weatherOffset+u.weatherPeak)}i=u,o=a,s=1-(a.weatherOffset-a.daysPassed)/(a.weatherOffset+c)}else{let l=this.seasonCache.getNextSeason(t),u=Ne(l);s=1-(a.daysPassed-(a.weatherOffset+a.weatherPeak))/(a.daysPassed+a.daysRemaining-a.weatherOffset+u.weatherOffset),i=u,o=a}return n&&(i.id in n.seasons&&(i=n.seasons[i.id]),o.id in n.seasons&&(o=n.seasons[o.id])),{from:i,to:o,effect:s}}};so=new WeakMap,qs=new WeakMap,ku=new WeakMap,Md=new WeakMap,Eu=new WeakMap;var Xa=class{constructor(e){this.lcg=Nd(e)}normal(e,t){return l1.source(this.lcg)(e,t)()}normalInt(e,t){return Math.floor(this.normal(e,t))}random(e=0,t=1){return o1.source(this.lcg)(e,t)()}randomInt(e=0,t=100){return s1.source(this.lcg)(e,t)()}chance(e,t){let n=this.normal(e,t),a=this.random();return n>a}static cerp(e,t,n){let a=(1-Math.cos(n*Math.PI))/2;return e*(1-a)+t*a}};function xC(r,e){let t=Ze(r),{set:n,update:a,subscribe:i}=t,o=yZ(t),s=de(t,D=>D.locations),l=de(s,D=>D.locations),u=de(t,D=>D.current),c=new fd(r),f=de(t,D=>D.categories),d=new od(o),h=de(o.moons,D=>D.map(C=>({...C,phase:void 0}))),p=new ud(h,d),m=new Ad(o.seasons,d),O=new Pd(o.seasonal,m,d),b=new Map,E=D=>{if(b.has(D))return b.get(D);let C=gZ(t,o,r,d);return b.set(D,C),C};return{getStoreState:D=>({calendar:r.id,ephemeral:E(D).getEphemeralState()}),set:n,update:a,subscribe:i,current:u,currentDisplay:de([u,t],([D,C])=>Fr(D,C)),getDaysBeforeDate:D=>d.daysBefore(D),getYearStoreForDate:D=>d.getYearFromCache(D.year),getMonthStoreForDate:D=>d.getYearFromCache(D.year).getMonthFromCache(D.month),setCurrentDate:D=>{t.update(C=>(C.current={...D},C)),Xe.save({calendar:!0})},updateCalendar:D=>a(C=>D),eventStore:c,flushFileEvents(){this.eventStore.removeAllFileEvents()},getEventsForDate:D=>{let C=c.getEventsForDate(D),k=d.getYearFromCache(D.year).getMonthFromCache(D.month).eras;return de([C,k],([w,T])=>[...w,...T.filter(S=>S.isEvent&&S.date.day===D.day)])},moonCache:p,seasonCache:m,weatherStore:O,locationStore:l,categories:f,staticStore:o,getEphemeralStore:E,yearCalculator:d,hasCategory:D=>Ne(f).find(C=>C.id===D)!=null,addCategory:D=>{a(C=>(C.categories.push(D),C))},getNextDay(D){return lo(D,d,Ne(o.staticData))},getOffsetDate(D,C){let k=Ne(o.staticData);for(let w=0;wk.locations.locations.find(w=>w.id===C)??null),b=de([O],([C])=>C?.name??"No location"),E=1;return f.subscribe(C=>E=C),{ephemeralStore:de([f,s,o,l,u,c,a,i,d,h,p,m],([C,k,w,T,S,M,Z,N,L,j,X,fe])=>({viewState:C,displayDayNumber:k,displayMoons:w,displayWeeks:T,hideEra:S,displayAbsoluteYear:M,displaySeasonColors:L,interpolateColors:j,displaying:Z,viewing:N,displayWeather:X,location:fe})),initializeFromState:C=>{f.set(C.viewState),s.set(C.displayDayNumber),o.set(C.displayMoons),l.set(C.displayWeeks),u.set(C.hideEra),c.set(C.displayAbsoluteYear),h.set(C.interpolateColors),d.set(C.displaySeasonColors),p.set(C.displayWeather);let k=Ne(e.staticData);k.useCustomYears&&(C.displaying.year<0||C.displaying.year>(k.years?.length??0)-1)&&(C.displaying.year=0),a.set(C.displaying),i.set(C.viewing),C.location&&m.set(C.location)},getEphemeralState:()=>({viewing:Ne(i),viewState:Ne(f),displaying:Ne(a),displayDayNumber:Ne(s),displaySeasonColors:Ne(d),interpolateColors:Ne(h),hideEra:Ne(u),displayAbsoluteYear:Ne(c),displayMoons:Ne(o),displayWeeks:Ne(l),displayWeather:Ne(p),location:Ne(m)}),displayMoons:o,displayDayNumber:s,displayWeeks:l,hideEra:u,displayAbsoluteYear:c,displaySeasonColors:d,interpolateColors:h,displayWeather:p,viewState:f,location:m,currentLocation:O,currentLocationName:b,displaying:a,goToToday:()=>a.set({...t.current}),displayDate:C=>{C||(C=t.current),a.set({...C})},displayingDisplay:de([a,r],([C,k])=>Fr(C,k)),displayingMonth:de([a],([C])=>n.getYearFromCache(C.year).getMonthFromCache(C.month)),displayingYear:de([a,e.years,e.staticConfiguration],([C,k,w])=>w.useCustomYears?k[C.year]?.name:C.year),getPreviousMonth:(C,k)=>{let w=n.getYearFromCache(k);return C==0?Ne(e.staticConfiguration).useCustomYears&&k>0&&(k=k-1||-1,w=n.getYearFromCache(k),C=Ne(w.months).length-1):C=C-1,w.getMonthFromCache(C)},goToPrevious:()=>a.update(C=>{switch(E){case 0:let k=(C.year-1||-1)===t.current.year?t.current.month:0;return{...C,month:k,year:C.year-1||-1};case 2:{let w={...C},T=n.getYearFromCache(w.year),S=T.getMonthFromCache(w.month),M=Ne(S.daysAsWeeks),Z=M.findIndex(N=>N.find(L=>L&&L.number==C.day));if(Z<1){w=Qd(w,n,Ne(e.staticData)),T=n.getYearFromCache(w.year),S=T.getMonthFromCache(w.month),M=Ne(S.daysAsWeeks),Z=M.length;let N=Ne(S.days);for(;!M[Z-1].every(L=>L&&L.number<=N);)Z--,Z<1&&(w=Qd(w,n,Ne(e.staticData)),T=n.getYearFromCache(w.year),S=T.getMonthFromCache(w.month),M=Ne(S.daysAsWeeks),N=Ne(S.days),Z=M.length)}return w.day=M[Z-1][0].number,w}case 1:return Qd(C,n,Ne(e.staticData));case 3:return lo(C,n,Ne(e.staticData))}}),getNextMonth:(C,k)=>{let w=n.getYearFromCache(k),T=Ne(w.months);if(C==T.length-1){let S=Ne(e.staticData);(!S.useCustomYears||k<(S.years?.length??0))&&(w=n.getYearFromCache(k+1||1),C=0)}else C=C+1;return w.getMonthFromCache(C)},goToNext:()=>a.update(C=>{switch(E){case 0:let k=(C.year+1||1)===t.current.year?t.current.month:0;return{...C,month:k,year:C.year+1||1};case 2:{let w={...C},T=n.getYearFromCache(w.year),S=T.getMonthFromCache(w.month),M=Ne(S.daysAsWeeks),Z=M.findIndex(L=>L.find(j=>j&&j.number==C.day)),N=Ne(S.days);if(Z+1>=M.length||M[Z].some(L=>L&&L.number>=N))for(w=Rd(w,n,Ne(e.staticData)),T=n.getYearFromCache(w.year),S=T.getMonthFromCache(w.month),M=Ne(S.daysAsWeeks),Z=M.findIndex(L=>L.every(j=>j&&j.number>0))-1,N=Ne(S.days);M[Z+1].some(L=>L&&L.number>N);)Z++,Z+1>=M.length&&(w=Rd(w,n,Ne(e.staticData)),T=n.getYearFromCache(w.year),S=T.getMonthFromCache(w.month),M=Ne(S.daysAsWeeks),N=Ne(S.days),Z=0);return w.day=M[Z+1][0].number,w}case 1:return Rd(C,n,Ne(e.staticData));case 3:return lo(C,n,Ne(e.staticData))}}),viewing:i,goToPreviousDay:()=>i.update(C=>C&&Id(C,n,Ne(e.staticData))),goToNextDay:()=>i.update(C=>C&&lo(C,n,Ne(e.staticData)))}}function yZ(r){let e=de(r,h=>h.static),t=de(e,h=>h.leapDays),n=de(e,h=>h.months),a=de(e,h=>h.moons),i=de(e,h=>h.weekdays),o=de(e,h=>h.years??[]),s=de(e,h=>(h.eras??[]).sort((p,m)=>p.isStartingEra?Number.NEGATIVE_INFINITY:m.isStartingEra?Number.POSITIVE_INFINITY:fl(p.date,m.date))),l=de(r,h=>h.seasonal),u=de(r,h=>h.seasonal.seasons),c=de(r,h=>h.seasonal.weather);function f(){return Ne(n).reduce((h,p)=>h+p.length,0)}let d=de(e,h=>({firstWeekDay:h.firstWeekDay,overflow:h.overflow,offset:h.offset,incrementDay:h.incrementDay,useCustomYears:h.useCustomYears,dayDisplayCallback:h.dayDisplayCallback}));return{getDaysInAYear:f,staticData:e,leapDays:t,months:n,moons:a,staticConfiguration:d,weekdays:i,years:o,eras:s,seasonal:l,seasons:u,store:r,weather:c}}function Rd(r,e,t){let n={...r},a=e.getYearFromCache(r.year),i=Ne(a.months);return n.month==i.length-1?(!t.useCustomYears||n.year<(t.years?.length||0)-1)&&(n.month=0,n.year=n.year+1||1):n.month++,n}function Qd(r,e,t){let n={...r};if(n.month==0){if(!t.useCustomYears||n.year-1>-1){n.year=t.useCustomYears?n.year-1:n.year-1||-1;let a=e.getYearFromCache(n.year),i=Ne(a.months);n.month=i.length-1}}else n.month--;return n}function lo(r,e,t){let n={...r},a=Ne(e.getYearFromCache(n.year).getMonthFromCache(n.month).days);return n.day+1>a?(n=Rd(r,e,t),n.day=1):n.day++,n}function Id(r,e,t){let n={...r};return n.day-1<=0?(n=Qd(r,e,t),n.day=Ne(e.getYearFromCache(n.year).getMonthFromCache(n.month).days)):n.day--,n}function bZ(r){let e,t,n,a,i,o,s,l,u;return e=new Wa({props:{date:r[3]}}),e.$on("valid",r[8]),{c(){z(e.$$.fragment),t=F(),n=_("div"),a=_("button"),i=le("Go"),a.disabled=o=!r[1],g(a,"class","mod-cta"),g(n,"class","calendarium-modal-buttons setting-item")},m(c,f){W(e,c,f),$(c,t,f),$(c,n,f),y(n,a),y(a,i),s=!0,l||(u=ce(a,"click",r[9]),l=!0)},p(c,[f]){(!s||f&2&&o!==(o=!c[1]))&&(a.disabled=o)},i(c){s||(P(e.$$.fragment,c),s=!0)},o(c){R(e.$$.fragment,c),s=!1},d(c){c&&(A(t),A(n)),Y(e,c),l=!1,u()}}}function vZ(r,e,t){let n,a,i,o=I,s=()=>(o(),o=be(u,D=>t(11,i=D)),u),l;r.$$.on_destroy.push(()=>o());let{store:u}=e;s();let{ephemeralStore:c}=e,{plugin:f}=e,{displaying:d}=c;ie(r,d,D=>t(12,l=D));let h=Ze(l);ie(r,h,D=>t(10,n=D)),Sn("store",Sl(f,i));let p=Ze(!0);ie(r,p,D=>t(1,a=D));let m=Qt(),O=()=>{a&&(c.displayDate(n),m("close"))},b=D=>Ce(p,a=D.detail,a),E=()=>{O()};return r.$$set=D=>{"store"in D&&s(t(0,u=D.store)),"ephemeralStore"in D&&t(6,c=D.ephemeralStore),"plugin"in D&&t(7,f=D.plugin)},[u,a,d,h,p,O,c,f,b,E]}var u1=class extends ae{constructor(e){super(),oe(this,e,vZ,bZ,re,{store:0,ephemeralStore:6,plugin:7})}},SC=u1;var hoe=require("obsidian"),Fd=class extends ir{constructor(t,n,a){super(t.app);this.plugin=t;this.store=n;this.ephemeralStore=a;this.containerEl.addClasses(["has-buttons","cancelable"])}async display(){this.setTitle("Go to date"),this.$ui=new SC({target:this.contentEl,props:{store:this.store,plugin:this.plugin,ephemeralStore:this.ephemeralStore}}),this.$ui.$on("close",()=>this.close())}close(){this.$ui?.$destroy(),super.close()}};function OZ(r){we(r,"svelte-14ltz8p",".calendarium-nav-container.svelte-14ltz8p{display:flex;flex-flow:column;gap:0.5rem}.view-state-switcher.svelte-14ltz8p{cursor:pointer;border-radius:4px;display:flex;justify-content:space-between;margin:0 0.5rem}.view-state.svelte-14ltz8p:first-of-type{margin-left:0}.view-state.svelte-14ltz8p:last-of-type{margin-right:0}.view-state.svelte-14ltz8p{margin:0 4px;flex-grow:1;text-align:center;border-radius:4px}.view-state.svelte-14ltz8p:not(.active):hover{background-color:var(--interactive-hover);color:var(--text-on-accent)}.view-state.active.svelte-14ltz8p{background-color:var(--interactive-accent);color:var(--text-on-accent)}.calendarium-nav.nav.nav.svelte-14ltz8p{margin:0;display:flex;flex-flow:row nowrap;justify-content:space-between;align-items:stretch}.year.svelte-14ltz8p,.era.svelte-14ltz8p{color:var(--text-accent)}.container.svelte-14ltz8p{display:flex;align-items:center;gap:0.25rem}.calendarium-title.svelte-14ltz8p{margin:0;line-height:1.25}.calendarium-right-nav.svelte-14ltz8p{display:flex;justify-content:center;align-items:flex-start}.calendar-clickable.svelte-14ltz8p{align-items:center;cursor:pointer;display:flex;justify-content:center}.title-container.svelte-14ltz8p{display:flex;flex-flow:column nowrap;align-items:flex-start}.reset-button.svelte-14ltz8p{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}.arrow.svelte-14ltz8p{--icon-size:16px}")}function AC(r){let e,t=r[14].name+"",n;return{c(){e=_("span"),n=le(t),g(e,"class","calendarium-month month")},m(a,i){$(a,e,i),y(e,n)},p(a,i){i[0]&16384&&t!==(t=a[14].name+"")&&ve(n,t)},d(a){a&&A(e)}}}function $C(r){let e,t=oi(r[16][0],r[17])+"",n;return{c(){e=_("span"),n=le(t),g(e,"class","era svelte-14ltz8p")},m(a,i){$(a,e,i),y(e,n)},p(a,i){i[0]&196608&&t!==(t=oi(a[16][0],a[17])+"")&&ve(n,t)},d(a){a&&A(e)}}}function _Z(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p,m,O,b,E,D,C,k,w,T,S,M,Z,N,L,j,X,fe,ee,te,ge=r[13]!=0&&AC(r),he=r[16].length&&!r[12]&&$C(r);return{c(){e=_("div"),t=_("div"),n=_("span"),n.textContent="Week",a=F(),i=_("span"),i.textContent="Month",o=F(),s=_("span"),s.textContent="Year",l=F(),u=_("div"),c=_("div"),f=_("h3"),ge&&ge.c(),d=F(),h=_("span"),p=le(r[15]),m=F(),O=_("div"),he&&he.c(),b=F(),E=_("div"),D=_("div"),C=_("div"),w=F(),T=_("div"),S=_("span"),S.textContent="Today",Z=F(),N=_("div"),j=F(),X=_("div"),g(n,"class","view-state svelte-14ltz8p"),Ee(n,"active",r[13]==2),g(i,"class","view-state svelte-14ltz8p"),Ee(i,"active",r[13]==1),g(s,"class","view-state svelte-14ltz8p"),Ee(s,"active",r[13]==0),g(t,"class","view-state-switcher svelte-14ltz8p"),g(h,"class","calendarium-year year svelte-14ltz8p"),g(f,"class","calendarium-title title svelte-14ltz8p"),g(O,"class","eras eras-container"),g(c,"class","title-container svelte-14ltz8p"),g(C,"class","arrow calendar-clickable svelte-14ltz8p"),g(T,"class","reset-button calendar-clickable svelte-14ltz8p"),g(T,"aria-label",M="Today is "+r[18]),g(N,"class","arrow right calendar-clickable svelte-14ltz8p"),g(X,"class","calendar-clickable svelte-14ltz8p"),g(X,"aria-label","Calendar settings"),g(D,"class","container svelte-14ltz8p"),g(E,"class","right-nav calendarium-right-nav svelte-14ltz8p"),g(u,"class","calendarium-nav nav svelte-14ltz8p"),g(e,"class","calendarium-nav-container svelte-14ltz8p")},m(ue,xe){$(ue,e,xe),y(e,t),y(t,n),y(t,a),y(t,i),y(t,o),y(t,s),y(e,l),y(e,u),y(u,c),y(c,f),ge&&ge.m(f,null),y(f,d),y(f,h),y(h,p),y(c,m),y(c,O),he&&he.m(O,null),y(u,b),y(u,E),y(E,D),y(D,C),y(D,w),y(D,T),y(T,S),y(D,Z),y(D,N),y(D,j),y(D,X),ee||(te=[ce(n,"click",r[36]),ce(i,"click",r[37]),ce(s,"click",r[38]),me(k=r[28].call(null,C)),ce(C,"click",r[39]),ce(T,"click",r[40]),me(L=r[29].call(null,N)),ce(N,"click",r[41]),me(fe=r[30].call(null,X)),ce(X,"click",r[42])],ee=!0)},p(ue,xe){xe[0]&8192&&Ee(n,"active",ue[13]==2),xe[0]&8192&&Ee(i,"active",ue[13]==1),xe[0]&8192&&Ee(s,"active",ue[13]==0),ue[13]!=0?ge?ge.p(ue,xe):(ge=AC(ue),ge.c(),ge.m(f,d)):ge&&(ge.d(1),ge=null),xe[0]&32768&&ve(p,ue[15]),ue[16].length&&!ue[12]?he?he.p(ue,xe):(he=$C(ue),he.c(),he.m(O,null)):he&&(he.d(1),he=null),xe[0]&262144&&M!==(M="Today is "+ue[18])&&g(T,"aria-label",M)},i:I,o:I,d(ue){ue&&A(e),ge&&ge.d(),he&&he.d(),ee=!1,Te(te)}}}function wZ(r,e,t){let n,a,i,o,s,l,u,c,f,d,h,p,m,O,b,E=I,D=()=>(E(),E=be(d,Ie=>t(44,b=Ie)),d),C,k=I,w=()=>(k(),k=be(f,Ie=>t(45,C=Ie)),f),T,S=I,M=()=>(S(),S=be(c,Ie=>t(46,T=Ie)),c),Z,N=I,L=()=>(N(),N=be(o,Ie=>t(47,Z=Ie)),o),j,X=I,fe=()=>(X(),X=be(u,Ie=>t(48,j=Ie)),u),ee,te,ge=I,he=()=>(ge(),ge=be(l,Ie=>t(49,te=Ie)),l),ue,xe=I,Pe=()=>(xe(),xe=be(s,Ie=>t(50,ue=Ie)),s),Ye,it,Be,st=I,ct=()=>(st(),st=be(h,Ie=>t(34,Be=Ie)),h),ft,It=I,Yt=()=>(It(),It=be(a,Ie=>t(35,ft=Ie)),a),zt,V,B,pe,De=I,rt=()=>(De(),De=be(m,Ie=>t(15,pe=Ie)),m),Mt,ar=I,Er=()=>(ar(),ar=be(p,Ie=>t(16,Mt=Ie)),p),Kt,Ue;r.$$.on_destroy.push(()=>E()),r.$$.on_destroy.push(()=>k()),r.$$.on_destroy.push(()=>S()),r.$$.on_destroy.push(()=>N()),r.$$.on_destroy.push(()=>X()),r.$$.on_destroy.push(()=>ge()),r.$$.on_destroy.push(()=>xe()),r.$$.on_destroy.push(()=>st()),r.$$.on_destroy.push(()=>It()),r.$$.on_destroy.push(()=>De()),r.$$.on_destroy.push(()=>ar());let ze=ut("store");ie(r,ze,Ie=>t(52,zt=Ie));let Wt=ut("ephemeralStore");ie(r,Wt,Ie=>t(2,Ye=Ie));let ur=ut("plugin"),Jt=zt,{displaying:cr,displayingMonth:fn,displayingYear:dn,hideEra:In}=Ye;ie(r,cr,Ie=>t(33,O=Ie)),ie(r,fn,Ie=>t(14,B=Ie)),ie(r,dn,Ie=>t(17,Kt=Ie)),ie(r,In,Ie=>t(12,ee=Ie));let{currentDisplay:$a,yearCalculator:zn}=Jt;ie(r,$a,Ie=>t(18,Ue=Ie));let Vt=ut("monthInFrame");ie(r,Vt,Ie=>t(51,it=Ie));let je=Ye.viewState;ie(r,je,Ie=>t(13,V=Ie)),je.subscribe(Ie=>{Ie===0?Ce(Vt,it=O.month,it):Ce(Vt,it=null,it)});let fr=Ie=>{new Zd.ExtraButtonComponent(Ie).setIcon(Tc)},Rr=Ie=>{new Zd.ExtraButtonComponent(Ie).setIcon(Nc)},fa=Ie=>{new Zd.ExtraButtonComponent(Ie).setIcon(Cv)},Ii=Ie=>{let $t=new gn(ur);$t.setNoIcon(),$t.addItem(jt=>{jt.setTitle("Go to day").onClick(()=>{new Fd(ur,Jt,Ye).open()})}),$t.addSeparator(),$t.addItem(jt=>{jt.setTitle("Show week numbers").onClick(async()=>{Ce(s,ue=!ue,ue)}),jt.setChecked(ue)}),$t.addItem(jt=>{jt.setTitle("Show day number").onClick(async()=>{Ce(l,te=!te,te)}).setChecked(te)}),$t.addSeparator(),$t.addItem(jt=>{jt.setTitle("Show era").onClick(async()=>{Ce(In,ee=!ee,ee)}).setChecked(!ee)}),$t.addItem(jt=>{jt.setTitle(`Show ${j?"era":"absolute"} year`).onClick(async()=>{Ce(u,j=!j,j)})}),$t.addSeparator(),$t.addItem(jt=>{jt.setTitle("Show moons").onClick(()=>{Ce(o,Z=!Z,Z)}).setChecked(Z)}),$t.addSeparator(),$t.addItem(jt=>{jt.setTitle("Show season colors").onClick(()=>{Ce(c,T=!T,T)}).setChecked(T)}),T&&$t.addItem(jt=>{jt.setTitle("Gradient season colors").onClick(()=>{Ce(f,C=!C,C)}).setChecked(C)}),i&&($t.addSeparator(),$t.addItem(jt=>{jt.setTitle("Display weather").onClick(()=>{Ce(d,b=!b,b)}).setChecked(b)})),$t.showAtMouseEvent(Ie)};function xo(Ie){isNaN(Number(Ie.textContent))||Ce(cr,O.year=Number(Ie.textContent),O)}let So=()=>Ce(je,V=2,V),Ao=()=>Ce(je,V=1,V),tl=()=>Ce(je,V=0,V),rl=()=>Ye.goToPrevious(),Je=()=>Ye.displayDate(null),En=Ie=>Ye.goToNext(),Ta=Ie=>Ii(Ie);return r.$$.update=()=>{r.$$.dirty[1]&2&&Yt(t(11,a=n.weather)),r.$$.dirty[1]&16&&(i=ft.enabled),r.$$.dirty[0]&4&&L(t(10,o=Ye.displayMoons)),r.$$.dirty[0]&4&&Pe(t(9,s=Ye.displayWeeks)),r.$$.dirty[0]&4&&he(t(8,l=Ye.displayDayNumber)),r.$$.dirty[0]&4&&fe(t(0,u=Ye.displayAbsoluteYear)),r.$$.dirty[0]&4&&M(t(7,c=Ye.displaySeasonColors)),r.$$.dirty[0]&4&&w(t(6,f=Ye.interpolateColors)),r.$$.dirty[0]&4&&D(t(5,d=Ye.displayWeather)),r.$$.dirty[1]&12&&Er(t(1,p=zn.getYearFromCache(O.year).getMonthFromCache(Be).eras)),r.$$.dirty[0]&3&&rt(t(3,m=de([p,dn,u],([Ie,$t,jt])=>jt||typeof $t!="number"||!Ie?.length?$t:mp(Ie[0],$t))))},t(32,n=Jt.staticStore),ct(t(4,h=de([Vt,je,cr],([Ie,$t,jt])=>$t==0&&Ie!=null?Ie:jt.month))),[u,p,Ye,m,h,d,f,c,l,s,o,a,ee,V,B,pe,Mt,Kt,Ue,ze,Wt,cr,fn,dn,In,$a,Vt,je,fr,Rr,fa,Ii,n,O,Be,ft,So,Ao,tl,rl,Je,En,Ta]}var c1=class extends ae{constructor(e){super(),oe(this,e,wZ,_Z,re,{},OZ,[-1,-1])}},TC=c1;function DZ(r){we(r,"svelte-1utoly",".weekday-container.svelte-1utoly{display:grid;grid-template-columns:repeat(var(--calendar-columns), 1fr);text-align:center}.week-number.svelte-1utoly{border-right:1px solid var(--blockquote-border-color);margin-right:0.25rem}.weekday.svelte-1utoly{background-color:var(--color-background-heading);color:var(--color-text-heading);font-size:0.6em;letter-spacing:1px;padding:4px;text-transform:uppercase}")}function NC(r,e,t){let n=r.slice();return n[13]=e[t],n}function PC(r){let e;return{c(){e=_("div"),e.innerHTML="W",g(e,"class","weekday week-number calendarium svelte-1utoly")},m(t,n){$(t,e,n)},d(t){t&&A(e)}}}function MC(r){let e,t=Vo(r[13])+"",n,a;return{c(){e=_("div"),n=le(t),a=F(),g(e,"class","weekday calendarium svelte-1utoly")},m(i,o){$(i,e,o),y(e,n),y(e,a)},p(i,o){o&8&&t!==(t=Vo(i[13])+"")&&ve(n,t)},d(i){i&&A(e)}}}function CZ(r){let e,t,n=r[2]&&PC(r),a=$e(r[3]),i=[];for(let o=0;o(f(),f=be(n,C=>t(2,c=C)),n),h,p=I,m=()=>(p(),p=be(s,C=>t(3,h=C)),s);r.$$.on_destroy.push(()=>f()),r.$$.on_destroy.push(()=>p());let{year:O}=e,{month:b}=e,E=ut("store");ie(r,E,C=>t(11,l=C));let D=ut("ephemeralStore");return ie(r,D,C=>t(12,u=C)),r.$$set=C=>{"year"in C&&t(6,O=C.year),"month"in C&&t(7,b=C.month)},r.$$.update=()=>{r.$$.dirty&4096&&d(t(1,n=u.displayWeeks)),r.$$.dirty&2048&&t(10,a=l),r.$$.dirty&1024&&t(9,i=a.yearCalculator),r.$$.dirty&704&&t(8,o=i.getYearFromCache(O).getMonthFromCache(b)),r.$$.dirty&256&&m(t(0,s=o.weekdays))},[s,n,c,h,E,D,O,b,o,i,a,l,u]}var d1=class extends ae{constructor(e){super(),oe(this,e,kZ,CZ,re,{year:6,month:7},DZ)}},qd=d1;function EZ(r){we(r,"svelte-etwpu",".dot.svelte-etwpu{display:inline-block;min-height:6px;min-width:6px;height:6px;width:6px}.active.svelte-etwpu{color:var(--text-on-accent)}")}function xZ(r){let e,t,n,a;return{c(){e=or("svg"),t=or("circle"),g(t,"stroke",n=r[2]??"currentColor"),g(t,"fill",a=r[2]??"currentColor"),g(t,"cx","3"),g(t,"cy","3"),g(t,"r","2"),g(e,"class","dot svelte-etwpu"),g(e,"viewBox","0 0 6 6"),g(e,"xmlns","http://www.w3.org/2000/svg"),Ee(e,"filled",r[0]),Ee(e,"active",r[1])},m(i,o){$(i,e,o),y(e,t)},p(i,[o]){o&4&&n!==(n=i[2]??"currentColor")&&g(t,"stroke",n),o&4&&a!==(a=i[2]??"currentColor")&&g(t,"fill",a),o&1&&Ee(e,"filled",i[0]),o&2&&Ee(e,"active",i[1])},i:I,o:I,d(i){i&&A(e)}}}function SZ(r,e,t){let{isFilled:n=!0}=e,{isActive:a=!1}=e,{color:i}=e;return r.$$set=o=>{"isFilled"in o&&t(0,n=o.isFilled),"isActive"in o&&t(1,a=o.isActive),"color"in o&&t(2,i=o.color)},[n,a,i]}var h1=class extends ae{constructor(e){super(),oe(this,e,SZ,xZ,re,{isFilled:0,isActive:1,color:2},EZ)}},RC=h1;function AZ(r){we(r,"svelte-1200li",".dots-container.svelte-1200li{width:100%}.dot-container.svelte-1200li{display:flex;flex-flow:row nowrap;gap:2px;margin:auto;line-height:6px;min-height:6px}.centered.svelte-1200li{justify-content:center;align-items:center}.overflow.svelte-1200li{color:var(--text-muted);font-size:xx-small;display:flex;justify-content:flex-end;line-height:1.25}")}function QC(r,e,t){let n=r.slice();return n[7]=e[t],n}function IC(r){let e,t;return e=new RC({props:{color:r[4](r[7])}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a&1&&(i.color=n[4](n[7])),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function FC(r){let e;return{c(){e=_("div"),e.innerHTML="+",g(e,"class","overflow svelte-1200li")},m(t,n){$(t,e,n)},d(t){t&&A(e)}}}function $Z(r){let e,t,n,a,i=$e(r[0].slice(0,2)),o=[];for(let u=0;uR(o[u],1,1,()=>{o[u]=null}),l=r[1]>0&&FC(r);return{c(){e=_("div"),t=_("div");for(let u=0;u0?l||(l=FC(u),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},i(u){if(!a){for(let c=0;ct(6,i=c));let{categories:l}=i;ie(r,l,c=>t(5,a=c));let u=c=>a.find(f=>f.id==c.category)?.color;return r.$$set=c=>{"events"in c&&t(0,o=c.events)},r.$$.update=()=>{r.$$.dirty&1&&t(1,n=Math.max(o.length-2,0))},[o,n,s,l,u]}var p1=class extends ae{constructor(e){super(),oe(this,e,TZ,$Z,re,{events:0},AZ)}},ZC=p1;var Zk=require("obsidian");var xu=require("obsidian");var qC=require("obsidian");var Ld=class extends ir{constructor(t,n){super(n.app);this.event=t;this.plugin=n;this.containerEl.addClass("fantasy-calendar-view-event")}async display(){this.contentEl.empty(),this.contentEl.createEl("h4",{text:this.event.name}),await qC.MarkdownRenderer.render(this.app,this.event.description??"",this.contentEl,this.event.note??"",this.plugin)}async onOpen(){await this.display()}};function LC(r){return r.type===Nn.Era}function NZ(r){we(r,"svelte-xwl5nv",".flag.svelte-xwl5nv.svelte-xwl5nv{cursor:pointer;position:relative;padding-left:0.125rem;text-align:left;width:100%;background-color:var(--hex-alpha);border-left:2px solid var(--color)}.flag-content.svelte-xwl5nv.svelte-xwl5nv{display:flex;gap:0.25rem;align-items:flex-start;justify-content:space-between}.day-view.svelte-xwl5nv .flag-content.svelte-xwl5nv{justify-content:space-between}.no-name.svelte-xwl5nv.svelte-xwl5nv{display:flex;align-items:center;gap:0.25rem}.clamp.svelte-xwl5nv.svelte-xwl5nv{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:keep-all;overflow:hidden;text-overflow:ellipsis}.note.svelte-xwl5nv.svelte-xwl5nv{display:flex;align-self:center}.multi.svelte-xwl5nv.svelte-xwl5nv{flex-shrink:0;overflow:visible;width:unset}.multi.svelte-xwl5nv .clamp.svelte-xwl5nv{-webkit-line-clamp:1;overflow:visible}.multi.start.svelte-xwl5nv.svelte-xwl5nv{margin-left:0}.multi.end.svelte-xwl5nv.svelte-xwl5nv{margin-right:0}.multi.first.svelte-xwl5nv.svelte-xwl5nv{overflow:visible;white-space:nowrap}.multi.svelte-xwl5nv.svelte-xwl5nv:not(.first){color:transparent;overflow:hidden}.multi.svelte-xwl5nv.svelte-xwl5nv:not(.start){border:0;margin-left:-6px}.multi.svelte-xwl5nv.svelte-xwl5nv:not(.end){margin-right:-6px}.start.svelte-xwl5nv>.flag-content.svelte-xwl5nv{justify-content:flex-start;gap:1em}")}function PZ(r){let e,t=r[11](r[1])+"",n;return{c(){e=_("span"),n=le(t),g(e,"class","svelte-xwl5nv"),Ee(e,"clamp",!r[2]),Ee(e,"day-view",r[2])},m(a,i){$(a,e,i),y(e,n)},p(a,i){i&2&&t!==(t=a[11](a[1])+"")&&ve(n,t),i&4&&Ee(e,"clamp",!a[2]),i&4&&Ee(e,"day-view",a[2])},d(a){a&&A(e)}}}function MZ(r){let e,t,n,a,i,o,s;return{c(){e=_("div"),t=_("div"),a=F(),i=_("span"),i.textContent="(no name)",g(e,"class","no-name svelte-xwl5nv")},m(l,u){$(l,e,u),y(e,t),y(e,a),y(e,i),o||(s=me(n=vt.call(null,t,An)),o=!0)},p:I,d(l){l&&A(e),o=!1,s()}}}function BC(r){let e,t,n,a;return{c(){e=_("div"),g(e,"class","note svelte-xwl5nv")},m(i,o){$(i,e,o),n||(a=me(t=r[8].call(null,e)),n=!0)},d(i){i&&A(e),n=!1,a()}}}function UC(r){let e,t,n,a;return{c(){e=_("div"),g(e,"class","era")},m(i,o){$(i,e,o),n||(a=me(t=vt.call(null,e,"calendar-range")),n=!0)},d(i){i&&A(e),n=!1,a()}}}function RZ(r){let e,t,n,a,i,o,s;function l(h,p){return h[1].name?PZ:MZ}let u=l(r,-1),c=u(r),f=r[1].note&&BC(r),d=r[1].type==="era"&&UC(r);return{c(){e=_("div"),t=_("div"),c.c(),n=F(),f&&f.c(),a=F(),d&&d.c(),g(t,"class","flag-content svelte-xwl5nv"),g(e,"class","flag svelte-xwl5nv"),g(e,"aria-label",i=r[2]?null:r[1].name),Pt(e,"--hex-alpha",r[3]+"40"),Pt(e,"--color",r[3]),Ee(e,"multi",QZ),Ee(e,"start",IZ),Ee(e,"end",FZ),Ee(e,"first",ZZ),Ee(e,"day-view",r[2])},m(h,p){$(h,e,p),y(e,t),c.m(t,null),y(t,n),f&&f.m(t,null),y(t,a),d&&d.m(t,null),r[14](e),o||(s=[ce(e,"click",r[15]),ce(e,"mouseover",r[16]),ce(e,"focus",qZ),ce(e,"contextmenu",r[10])],o=!0)},p(h,[p]){u===(u=l(h,p))&&c?c.p(h,p):(c.d(1),c=u(h),c&&(c.c(),c.m(t,n))),h[1].note?f||(f=BC(h),f.c(),f.m(t,a)):f&&(f.d(1),f=null),h[1].type==="era"?d||(d=UC(h),d.c(),d.m(t,null)):d&&(d.d(1),d=null),p&6&&i!==(i=h[2]?null:h[1].name)&&g(e,"aria-label",i),p&8&&Pt(e,"--hex-alpha",h[3]+"40"),p&8&&Pt(e,"--color",h[3]),p&4&&Ee(e,"day-view",h[2])},i:I,o:I,d(h){h&&A(e),c.d(),f&&f.d(),d&&d.d(),r[14](null),o=!1,Te(s)}}}var QZ=!1,IZ=!1,FZ=!1,ZZ=!1,qZ=()=>{};function LZ(r,e,t){let n,a,i,o,s,l=I,u=()=>(l(),l=be(n,N=>t(18,s=N)),n),c,f,d=I,h=()=>(d(),d=be(a,N=>t(13,f=N)),a);r.$$.on_destroy.push(()=>l()),r.$$.on_destroy.push(()=>d());let p=Qt(),{event:m}=e,{dayView:O=!1}=e,b=ut("plugin"),E=ut("store");ie(r,E,N=>t(12,c=N));let D=N=>{o?(0,xu.setIcon)(N,mv):(0,xu.setIcon)(N,Ec)},C=N=>{if(m.note){let L=m.note.endsWith(".md")?m.note:`${m.note}.md`,j=b.app.vault.getAbstractFileByPath(L);j&&j instanceof xu.TFile&&b.app.workspace.getLeaf().openFile(j)}else new Ld(m,b).open()},{flag:k=null}=e,w=N=>{if(N.stopPropagation(),!Bo(m))return;let L=new gn(b);o&&(L.addItem(j=>j.setTitle("Edit event").onClick(()=>{Bo(m)&&sf(b,s,m.date,m)})),L.addItem(j=>j.setTitle("Delete event").onClick(async()=>{Bo(m)&&(c.eventStore.removeEvents(m),Ce(n,s.events=s.events.filter(X=>X.id!=m.id),s),await Xe.save({calendar:!0}))}))),L.showAtMouseEvent(N)},T=N=>LC(N)&&!N.isStartingEra?oi(N,N.date.year):N.name;function S(N){Jr[N?"unshift":"push"](()=>{k=N,t(0,k)})}let M=N=>{N.stopPropagation(),C(N)},Z=N=>p("event-mouseover",{target:N.target,event:m});return r.$$set=N=>{"event"in N&&t(1,m=N.event),"dayView"in N&&t(2,O=N.dayView),"flag"in N&&t(0,k=N.flag)},r.$$.update=()=>{r.$$.dirty&4096&&u(t(5,n=c)),r.$$.dirty&4096&&h(t(4,a=c.categories)),r.$$.dirty&8194&&t(3,i=f?.find(N=>N.id==m.category)?.color??Ib),r.$$.dirty&4098&&(o=c.eventStore.isRemovable(m.id))},[k,m,O,i,a,n,p,E,D,C,w,T,c,f,S,M,Z]}var m1=class extends ae{constructor(e){super(),oe(this,e,LZ,RZ,re,{event:1,dayView:2,flag:0},NZ)}get event(){return this.$$.ctx[1]}set event(e){this.$$set({event:e}),ui()}get dayView(){return this.$$.ctx[2]}set dayView(e){this.$$set({dayView:e}),ui()}get flag(){return this.$$.ctx[0]}set flag(e){this.$$set({flag:e}),ui()}},WC=m1;function BZ(r){we(r,"svelte-1ejzoy4",".flag-container.svelte-1ejzoy4{height:100%;display:flex;flex-flow:column nowrap;gap:0.25rem;overflow:auto}.full.svelte-1ejzoy4{overflow:hidden}.overflow.svelte-1ejzoy4{color:var(--text-muted);justify-self:flex-end;display:flex;justify-content:flex-end;width:100%}")}function YC(r){let e,t,n;return{c(){e=_("span"),t=le("+"),n=le(r[2])},m(a,i){$(a,e,i),y(e,t),y(e,n)},p(a,i){i&4&&ve(n,a[2])},d(a){a&&A(e)}}}function UZ(r){let e,t,n,a=r[2]>0&&YC(r);return{c(){e=_("div"),t=F(),n=_("div"),a&&a.c(),g(e,"class","flag-container svelte-1ejzoy4"),Ee(e,"full",!r[0]),g(n,"class","overflow svelte-1ejzoy4")},m(i,o){$(i,e,o),r[5](e),$(i,t,o),$(i,n,o),a&&a.m(n,null)},p(i,[o]){o&1&&Ee(e,"full",!i[0]),i[2]>0?a?a.p(i,o):(a=YC(i),a.c(),a.m(n,null)):a&&(a.d(1),a=null)},i:I,o:I,d(i){i&&(A(e),A(t),A(n)),r[5](null),a&&a.d()}}}function WZ(r,e,t){let{events:n=[]}=e,{dayView:a=!1}=e,i,o,s=0,l=0,u=()=>{if(n.length&&o){if(!a&&(i==null||Math.floor(i)==Math.floor(l)))return;l=i,o.empty(),t(2,s=0);let d=i;for(let h of n)if(new WC({target:o,props:{event:h,dayView:a}}),!a){if(d=i-Array.from(o.children).reduce((p,m)=>m.getBoundingClientRect().height+p,0),d<0&&i!=0){o.lastElementChild?.detach(),t(2,s=n.length-n.indexOf(h));break}else if(d==0){t(2,s=n.length-n.indexOf(h)-1);break}}}},c=new ResizeObserver(d=>{t(4,i=d[0].contentRect?.height),t(1,o=d[0]?.target)});Hn(()=>{c.observe(o)});function f(d){Jr[d?"unshift":"push"](()=>{o=d,t(1,o)})}return r.$$set=d=>{"events"in d&&t(3,n=d.events),"dayView"in d&&t(0,a=d.dayView)},r.$$.update=()=>{r.$$.dirty&8&&t(3,n=ii([...n])),r.$$.dirty&27&&(a||i!=null&&o)&&n&&u()},[a,o,s,n,i,f]}var g1=class extends ae{constructor(e){super(),oe(this,e,WZ,UZ,re,{events:3,dayView:0},BZ)}},Bd=g1;var xk=require("obsidian");var Nr={Calendarium:"CALENDARIUM",Agenda:"CALENDARIUM_AGENDA"};var lr="top",Cr="bottom",_r="right",hr="left",Ud="auto",Ni=[lr,Cr,_r,hr],Ga="start",uo="end",zC="clippingParents",Wd="viewport",Ls="popper",VC="reference",y1=Ni.reduce(function(r,e){return r.concat([e+"-"+Ga,e+"-"+uo])},[]),Yd=[].concat(Ni,[Ud]).reduce(function(r,e){return r.concat([e,e+"-"+Ga,e+"-"+uo])},[]),YZ="beforeRead",zZ="read",VZ="afterRead",jZ="beforeMain",XZ="main",GZ="afterMain",HZ="beforeWrite",KZ="write",JZ="afterWrite",jC=[YZ,zZ,VZ,jZ,XZ,GZ,HZ,KZ,JZ];function Pr(r){return r?(r.nodeName||"").toLowerCase():null}function nr(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var e=r.ownerDocument;return e&&e.defaultView||window}return r}function Un(r){var e=nr(r).Element;return r instanceof e||r instanceof Element}function kr(r){var e=nr(r).HTMLElement;return r instanceof e||r instanceof HTMLElement}function Bs(r){if(typeof ShadowRoot>"u")return!1;var e=nr(r).ShadowRoot;return r instanceof e||r instanceof ShadowRoot}function eq(r){var e=r.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},a=e.attributes[t]||{},i=e.elements[t];!kr(i)||!Pr(i)||(Object.assign(i.style,n),Object.keys(a).forEach(function(o){var s=a[o];s===!1?i.removeAttribute(o):i.setAttribute(o,s===!0?"":s)}))})}function tq(r){var e=r.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(n){var a=e.elements[n],i=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:t[n]),s=o.reduce(function(l,u){return l[u]="",l},{});!kr(a)||!Pr(a)||(Object.assign(a.style,s),Object.keys(i).forEach(function(l){a.removeAttribute(l)}))})}}var XC={name:"applyStyles",enabled:!0,phase:"write",fn:eq,effect:tq,requires:["computeStyles"]};function Mr(r){return r.split("-")[0]}var sa=Math.max,co=Math.min,Ha=Math.round;function Us(){var r=navigator.userAgentData;return r!=null&&r.brands&&Array.isArray(r.brands)?r.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Su(){return!/^((?!chrome|android).)*safari/i.test(Us())}function Wn(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var n=r.getBoundingClientRect(),a=1,i=1;e&&kr(r)&&(a=r.offsetWidth>0&&Ha(n.width)/r.offsetWidth||1,i=r.offsetHeight>0&&Ha(n.height)/r.offsetHeight||1);var o=Un(r)?nr(r):window,s=o.visualViewport,l=!Su()&&t,u=(n.left+(l&&s?s.offsetLeft:0))/a,c=(n.top+(l&&s?s.offsetTop:0))/i,f=n.width/a,d=n.height/i;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function fo(r){var e=Wn(r),t=r.offsetWidth,n=r.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:r.offsetLeft,y:r.offsetTop,width:t,height:n}}function Au(r,e){var t=e.getRootNode&&e.getRootNode();if(r.contains(e))return!0;if(t&&Bs(t)){var n=e;do{if(n&&r.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function cn(r){return nr(r).getComputedStyle(r)}function b1(r){return["table","td","th"].indexOf(Pr(r))>=0}function Vr(r){return((Un(r)?r.ownerDocument:r.document)||window.document).documentElement}function Ka(r){return Pr(r)==="html"?r:r.assignedSlot||r.parentNode||(Bs(r)?r.host:null)||Vr(r)}function GC(r){return!kr(r)||cn(r).position==="fixed"?null:r.offsetParent}function rq(r){var e=/firefox/i.test(Us()),t=/Trident/i.test(Us());if(t&&kr(r)){var n=cn(r);if(n.position==="fixed")return null}var a=Ka(r);for(Bs(a)&&(a=a.host);kr(a)&&["html","body"].indexOf(Pr(a))<0;){var i=cn(a);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return a;a=a.parentNode}return null}function la(r){for(var e=nr(r),t=GC(r);t&&b1(t)&&cn(t).position==="static";)t=GC(t);return t&&(Pr(t)==="html"||Pr(t)==="body"&&cn(t).position==="static")?e:t||rq(r)||e}function ho(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function po(r,e,t){return sa(r,co(e,t))}function HC(r,e,t){var n=po(r,e,t);return n>t?t:n}function $u(){return{top:0,right:0,bottom:0,left:0}}function Tu(r){return Object.assign({},$u(),r)}function Nu(r,e){return e.reduce(function(t,n){return t[n]=r,t},{})}var nq=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Tu(typeof e!="number"?e:Nu(e,Ni))};function aq(r){var e,t=r.state,n=r.name,a=r.options,i=t.elements.arrow,o=t.modifiersData.popperOffsets,s=Mr(t.placement),l=ho(s),u=[hr,_r].indexOf(s)>=0,c=u?"height":"width";if(!(!i||!o)){var f=nq(a.padding,t),d=fo(i),h=l==="y"?lr:hr,p=l==="y"?Cr:_r,m=t.rects.reference[c]+t.rects.reference[l]-o[l]-t.rects.popper[c],O=o[l]-t.rects.reference[l],b=la(i),E=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,D=m/2-O/2,C=f[h],k=E-d[c]-f[p],w=E/2-d[c]/2+D,T=po(C,w,k),S=l;t.modifiersData[n]=(e={},e[S]=T,e.centerOffset=T-w,e)}}function iq(r){var e=r.state,t=r.options,n=t.element,a=n===void 0?"[data-popper-arrow]":n;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||Au(e.elements.popper,a)&&(e.elements.arrow=a))}var KC={name:"arrow",enabled:!0,phase:"main",fn:aq,effect:iq,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Yn(r){return r.split("-")[1]}var oq={top:"auto",right:"auto",bottom:"auto",left:"auto"};function sq(r,e){var t=r.x,n=r.y,a=e.devicePixelRatio||1;return{x:Ha(t*a)/a||0,y:Ha(n*a)/a||0}}function JC(r){var e,t=r.popper,n=r.popperRect,a=r.placement,i=r.variation,o=r.offsets,s=r.position,l=r.gpuAcceleration,u=r.adaptive,c=r.roundOffsets,f=r.isFixed,d=o.x,h=d===void 0?0:d,p=o.y,m=p===void 0?0:p,O=typeof c=="function"?c({x:h,y:m}):{x:h,y:m};h=O.x,m=O.y;var b=o.hasOwnProperty("x"),E=o.hasOwnProperty("y"),D=hr,C=lr,k=window;if(u){var w=la(t),T="clientHeight",S="clientWidth";if(w===nr(t)&&(w=Vr(t),cn(w).position!=="static"&&s==="absolute"&&(T="scrollHeight",S="scrollWidth")),w=w,a===lr||(a===hr||a===_r)&&i===uo){C=Cr;var M=f&&w===k&&k.visualViewport?k.visualViewport.height:w[T];m-=M-n.height,m*=l?1:-1}if(a===hr||(a===lr||a===Cr)&&i===uo){D=_r;var Z=f&&w===k&&k.visualViewport?k.visualViewport.width:w[S];h-=Z-n.width,h*=l?1:-1}}var N=Object.assign({position:s},u&&oq),L=c===!0?sq({x:h,y:m},nr(t)):{x:h,y:m};if(h=L.x,m=L.y,l){var j;return Object.assign({},N,(j={},j[C]=E?"0":"",j[D]=b?"0":"",j.transform=(k.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",j))}return Object.assign({},N,(e={},e[C]=E?m+"px":"",e[D]=b?h+"px":"",e.transform="",e))}function lq(r){var e=r.state,t=r.options,n=t.gpuAcceleration,a=n===void 0?!0:n,i=t.adaptive,o=i===void 0?!0:i,s=t.roundOffsets,l=s===void 0?!0:s,u={placement:Mr(e.placement),variation:Yn(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,JC(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,JC(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var ek={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:lq,data:{}};var zd={passive:!0};function uq(r){var e=r.state,t=r.instance,n=r.options,a=n.scroll,i=a===void 0?!0:a,o=n.resize,s=o===void 0?!0:o,l=nr(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(c){c.addEventListener("scroll",t.update,zd)}),s&&l.addEventListener("resize",t.update,zd),function(){i&&u.forEach(function(c){c.removeEventListener("scroll",t.update,zd)}),s&&l.removeEventListener("resize",t.update,zd)}}var tk={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:uq,data:{}};var cq={left:"right",right:"left",bottom:"top",top:"bottom"};function Ws(r){return r.replace(/left|right|bottom|top/g,function(e){return cq[e]})}var fq={start:"end",end:"start"};function Vd(r){return r.replace(/start|end/g,function(e){return fq[e]})}function mo(r){var e=nr(r),t=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:t,scrollTop:n}}function go(r){return Wn(Vr(r)).left+mo(r).scrollLeft}function v1(r,e){var t=nr(r),n=Vr(r),a=t.visualViewport,i=n.clientWidth,o=n.clientHeight,s=0,l=0;if(a){i=a.width,o=a.height;var u=Su();(u||!u&&e==="fixed")&&(s=a.offsetLeft,l=a.offsetTop)}return{width:i,height:o,x:s+go(r),y:l}}function O1(r){var e,t=Vr(r),n=mo(r),a=(e=r.ownerDocument)==null?void 0:e.body,i=sa(t.scrollWidth,t.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),o=sa(t.scrollHeight,t.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),s=-n.scrollLeft+go(r),l=-n.scrollTop;return cn(a||t).direction==="rtl"&&(s+=sa(t.clientWidth,a?a.clientWidth:0)-i),{width:i,height:o,x:s,y:l}}function yo(r){var e=cn(r),t=e.overflow,n=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+a+n)}function jd(r){return["html","body","#document"].indexOf(Pr(r))>=0?r.ownerDocument.body:kr(r)&&yo(r)?r:jd(Ka(r))}function Pi(r,e){var t;e===void 0&&(e=[]);var n=jd(r),a=n===((t=r.ownerDocument)==null?void 0:t.body),i=nr(n),o=a?[i].concat(i.visualViewport||[],yo(n)?n:[]):n,s=e.concat(o);return a?s:s.concat(Pi(Ka(o)))}function Ys(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function dq(r,e){var t=Wn(r,!1,e==="fixed");return t.top=t.top+r.clientTop,t.left=t.left+r.clientLeft,t.bottom=t.top+r.clientHeight,t.right=t.left+r.clientWidth,t.width=r.clientWidth,t.height=r.clientHeight,t.x=t.left,t.y=t.top,t}function rk(r,e,t){return e===Wd?Ys(v1(r,t)):Un(e)?dq(e,t):Ys(O1(Vr(r)))}function hq(r){var e=Pi(Ka(r)),t=["absolute","fixed"].indexOf(cn(r).position)>=0,n=t&&kr(r)?la(r):r;return Un(n)?e.filter(function(a){return Un(a)&&Au(a,n)&&Pr(a)!=="body"}):[]}function _1(r,e,t,n){var a=e==="clippingParents"?hq(r):[].concat(e),i=[].concat(a,[t]),o=i[0],s=i.reduce(function(l,u){var c=rk(r,u,n);return l.top=sa(c.top,l.top),l.right=co(c.right,l.right),l.bottom=co(c.bottom,l.bottom),l.left=sa(c.left,l.left),l},rk(r,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Pu(r){var e=r.reference,t=r.element,n=r.placement,a=n?Mr(n):null,i=n?Yn(n):null,o=e.x+e.width/2-t.width/2,s=e.y+e.height/2-t.height/2,l;switch(a){case lr:l={x:o,y:e.y-t.height};break;case Cr:l={x:o,y:e.y+e.height};break;case _r:l={x:e.x+e.width,y:s};break;case hr:l={x:e.x-t.width,y:s};break;default:l={x:e.x,y:e.y}}var u=a?ho(a):null;if(u!=null){var c=u==="y"?"height":"width";switch(i){case Ga:l[u]=l[u]-(e[c]/2-t[c]/2);break;case uo:l[u]=l[u]+(e[c]/2-t[c]/2);break;default:}}return l}function ua(r,e){e===void 0&&(e={});var t=e,n=t.placement,a=n===void 0?r.placement:n,i=t.strategy,o=i===void 0?r.strategy:i,s=t.boundary,l=s===void 0?zC:s,u=t.rootBoundary,c=u===void 0?Wd:u,f=t.elementContext,d=f===void 0?Ls:f,h=t.altBoundary,p=h===void 0?!1:h,m=t.padding,O=m===void 0?0:m,b=Tu(typeof O!="number"?O:Nu(O,Ni)),E=d===Ls?VC:Ls,D=r.rects.popper,C=r.elements[p?E:d],k=_1(Un(C)?C:C.contextElement||Vr(r.elements.popper),l,c,o),w=Wn(r.elements.reference),T=Pu({reference:w,element:D,strategy:"absolute",placement:a}),S=Ys(Object.assign({},D,T)),M=d===Ls?S:w,Z={top:k.top-M.top+b.top,bottom:M.bottom-k.bottom+b.bottom,left:k.left-M.left+b.left,right:M.right-k.right+b.right},N=r.modifiersData.offset;if(d===Ls&&N){var L=N[a];Object.keys(Z).forEach(function(j){var X=[_r,Cr].indexOf(j)>=0?1:-1,fe=[lr,Cr].indexOf(j)>=0?"y":"x";Z[j]+=L[fe]*X})}return Z}function w1(r,e){e===void 0&&(e={});var t=e,n=t.placement,a=t.boundary,i=t.rootBoundary,o=t.padding,s=t.flipVariations,l=t.allowedAutoPlacements,u=l===void 0?Yd:l,c=Yn(n),f=c?s?y1:y1.filter(function(p){return Yn(p)===c}):Ni,d=f.filter(function(p){return u.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,m){return p[m]=ua(r,{placement:m,boundary:a,rootBoundary:i,padding:o})[Mr(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function pq(r){if(Mr(r)===Ud)return[];var e=Ws(r);return[Vd(r),e,Vd(e)]}function mq(r){var e=r.state,t=r.options,n=r.name;if(!e.modifiersData[n]._skip){for(var a=t.mainAxis,i=a===void 0?!0:a,o=t.altAxis,s=o===void 0?!0:o,l=t.fallbackPlacements,u=t.padding,c=t.boundary,f=t.rootBoundary,d=t.altBoundary,h=t.flipVariations,p=h===void 0?!0:h,m=t.allowedAutoPlacements,O=e.options.placement,b=Mr(O),E=b===O,D=l||(E||!p?[Ws(O)]:pq(O)),C=[O].concat(D).reduce(function(it,Be){return it.concat(Mr(Be)===Ud?w1(e,{placement:Be,boundary:c,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:m}):Be)},[]),k=e.rects.reference,w=e.rects.popper,T=new Map,S=!0,M=C[0],Z=0;Z=0,fe=X?"width":"height",ee=ua(e,{placement:N,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),te=X?j?_r:hr:j?Cr:lr;k[fe]>w[fe]&&(te=Ws(te));var ge=Ws(te),he=[];if(i&&he.push(ee[L]<=0),s&&he.push(ee[te]<=0,ee[ge]<=0),he.every(function(it){return it})){M=N,S=!1;break}T.set(N,he)}if(S)for(var ue=p?3:1,xe=function(Be){var st=C.find(function(ct){var ft=T.get(ct);if(ft)return ft.slice(0,Be).every(function(It){return It})});if(st)return M=st,"break"},Pe=ue;Pe>0;Pe--){var Ye=xe(Pe);if(Ye==="break")break}e.placement!==M&&(e.modifiersData[n]._skip=!0,e.placement=M,e.reset=!0)}}var nk={name:"flip",enabled:!0,phase:"main",fn:mq,requiresIfExists:["offset"],data:{_skip:!1}};function ak(r,e,t){return t===void 0&&(t={x:0,y:0}),{top:r.top-e.height-t.y,right:r.right-e.width+t.x,bottom:r.bottom-e.height+t.y,left:r.left-e.width-t.x}}function ik(r){return[lr,_r,Cr,hr].some(function(e){return r[e]>=0})}function gq(r){var e=r.state,t=r.name,n=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,o=ua(e,{elementContext:"reference"}),s=ua(e,{altBoundary:!0}),l=ak(o,n),u=ak(s,a,i),c=ik(l),f=ik(u);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}var ok={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:gq};function yq(r,e,t){var n=Mr(r),a=[hr,lr].indexOf(n)>=0?-1:1,i=typeof t=="function"?t(Object.assign({},e,{placement:r})):t,o=i[0],s=i[1];return o=o||0,s=(s||0)*a,[hr,_r].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}function bq(r){var e=r.state,t=r.options,n=r.name,a=t.offset,i=a===void 0?[0,0]:a,o=Yd.reduce(function(c,f){return c[f]=yq(f,e.rects,i),c},{}),s=o[e.placement],l=s.x,u=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=o}var sk={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:bq};function vq(r){var e=r.state,t=r.name;e.modifiersData[t]=Pu({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var lk={name:"popperOffsets",enabled:!0,phase:"read",fn:vq,data:{}};function D1(r){return r==="x"?"y":"x"}function Oq(r){var e=r.state,t=r.options,n=r.name,a=t.mainAxis,i=a===void 0?!0:a,o=t.altAxis,s=o===void 0?!1:o,l=t.boundary,u=t.rootBoundary,c=t.altBoundary,f=t.padding,d=t.tether,h=d===void 0?!0:d,p=t.tetherOffset,m=p===void 0?0:p,O=ua(e,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),b=Mr(e.placement),E=Yn(e.placement),D=!E,C=ho(b),k=D1(C),w=e.modifiersData.popperOffsets,T=e.rects.reference,S=e.rects.popper,M=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,Z=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),N=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(w){if(i){var j,X=C==="y"?lr:hr,fe=C==="y"?Cr:_r,ee=C==="y"?"height":"width",te=w[C],ge=te+O[X],he=te-O[fe],ue=h?-S[ee]/2:0,xe=E===Ga?T[ee]:S[ee],Pe=E===Ga?-S[ee]:-T[ee],Ye=e.elements.arrow,it=h&&Ye?fo(Ye):{width:0,height:0},Be=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:$u(),st=Be[X],ct=Be[fe],ft=po(0,T[ee],it[ee]),It=D?T[ee]/2-ue-ft-st-Z.mainAxis:xe-ft-st-Z.mainAxis,Yt=D?-T[ee]/2+ue+ft+ct+Z.mainAxis:Pe+ft+ct+Z.mainAxis,zt=e.elements.arrow&&la(e.elements.arrow),V=zt?C==="y"?zt.clientTop||0:zt.clientLeft||0:0,B=(j=N?.[C])!=null?j:0,pe=te+It-B-V,De=te+Yt-B,rt=po(h?co(ge,pe):ge,te,h?sa(he,De):he);w[C]=rt,L[C]=rt-te}if(s){var Mt,ar=C==="x"?lr:hr,Er=C==="x"?Cr:_r,Kt=w[k],Ue=k==="y"?"height":"width",ze=Kt+O[ar],Wt=Kt-O[Er],ur=[lr,hr].indexOf(b)!==-1,Jt=(Mt=N?.[k])!=null?Mt:0,cr=ur?ze:Kt-T[Ue]-S[Ue]-Jt+Z.altAxis,fn=ur?Kt+T[Ue]+S[Ue]-Jt-Z.altAxis:Wt,dn=h&&ur?HC(cr,Kt,fn):po(h?cr:ze,Kt,h?fn:Wt);w[k]=dn,L[k]=dn-Kt}e.modifiersData[n]=L}}var uk={name:"preventOverflow",enabled:!0,phase:"main",fn:Oq,requiresIfExists:["offset"]};function C1(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function k1(r){return r===nr(r)||!kr(r)?mo(r):C1(r)}function _q(r){var e=r.getBoundingClientRect(),t=Ha(e.width)/r.offsetWidth||1,n=Ha(e.height)/r.offsetHeight||1;return t!==1||n!==1}function E1(r,e,t){t===void 0&&(t=!1);var n=kr(e),a=kr(e)&&_q(e),i=Vr(e),o=Wn(r,a,t),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!t)&&((Pr(e)!=="body"||yo(i))&&(s=k1(e)),kr(e)?(l=Wn(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):i&&(l.x=go(i))),{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function wq(r){var e=new Map,t=new Set,n=[];r.forEach(function(i){e.set(i.name,i)});function a(i){t.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(s){if(!t.has(s)){var l=e.get(s);l&&a(l)}}),n.push(i)}return r.forEach(function(i){t.has(i.name)||a(i)}),n}function x1(r){var e=wq(r);return jC.reduce(function(t,n){return t.concat(e.filter(function(a){return a.phase===n}))},[])}function S1(r){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(r())})})),e}}function A1(r){var e=r.reduce(function(t,n){var a=t[n.name];return t[n.name]=a?Object.assign({},a,n,{options:Object.assign({},a.options,n.options),data:Object.assign({},a.data,n.data)}):n,t},{});return Object.keys(e).map(function(t){return e[t]})}var ck={placement:"bottom",modifiers:[],strategy:"absolute"};function fk(){for(var r=arguments.length,e=new Array(r),t=0;t{t!==void 0&&n!==void 0&&(e=$1(t,n,a))},o=()=>{e!==null&&(e.destroy(),e=null)},s=c=>"subscribe"in c?(l(c),{}):(t=c,i(),{destroy(){o()}}),l=c=>{let f=c.subscribe(d=>{t===void 0?(t=d,i()):(Object.assign(t,d),e?.update())});bl(f)};return[s,(c,f)=>(n=c,a={...r,...f},i(),{update(d){a={...r,...d},e?.setOptions(a)},destroy(){o()}}),()=>e]}function Cq(r){we(r,"svelte-adqg7o",".weather.svelte-adqg7o{display:flex;gap:0.25rem;justify-content:center}.temperature.svelte-adqg7o{display:flex;align-items:center;gap:0.25rem}.actual.svelte-adqg7o{font-size:larger}.tooltip.svelte-adqg7o{left:unset;top:unset;bottom:unset;right:unset;transform:unset;animation:unset;display:flex;flex-flow:column;justify-content:flex-start;width:max-content}.weather-line.svelte-adqg7o{display:flex;align-items:center;flex-wrap:nowrap;gap:0.25rem}")}function pk(r){let e,t,n,a=jr(r[4].temperature.actual,r[5])+"",i,o,s=r[6],l,u,c,f,d,h=mk(r),p=r[0]&&gk(r);return{c(){e=_("div"),t=_("div"),n=_("div"),i=le(a),o=F(),h.c(),u=F(),p&&p.c(),c=He(),g(n,"class","actual svelte-adqg7o"),g(t,"class","temperature svelte-adqg7o"),g(e,"class","weather svelte-adqg7o")},m(m,O){$(m,e,O),y(e,t),y(t,n),y(n,i),y(e,o),h.m(e,null),$(m,u,O),p&&p.m(m,O),$(m,c,O),f||(d=[me(l=r[8].call(null,e)),ce(e,"mouseenter",r[14]),ce(e,"mouseleave",r[15])],f=!0)},p(m,O){O&48&&a!==(a=jr(m[4].temperature.actual,m[5])+"")&&ve(i,a),O&64&&re(s,s=m[6])?(h.d(1),h=mk(m),h.c(),h.m(e,null)):h.p(m,O),m[0]?p?p.p(m,O):(p=gk(m),p.c(),p.m(c.parentNode,c)):p&&(p.d(1),p=null)},d(m){m&&(A(e),A(u),A(c)),h.d(m),p&&p.d(m),f=!1,Te(d)}}}function mk(r){let e,t,n,a;return{c(){e=_("div"),g(e,"class","icon")},m(i,o){$(i,e,o),n||(a=me(t=vt.call(null,e,r[6])),n=!0)},p(i,o){t&&qt(t.update)&&o&64&&t.update.call(null,i[6])},d(i){i&&A(e),n=!1,a()}}}function gk(r){let e,t,n,a,i,o,s=jr(r[4].temperature.low,r[5])+"",l,u,c=jr(r[4].temperature.high,r[5])+"",f,d,h,p,m,O,b,E=r[4].precipitation.strength+"",D,C,k,w,T,S,M,Z=r[4].wind.strength+"",N,L,j=r[4].wind.direction+"",X,fe,ee,te,ge,he,ue,xe,Pe=r[4].clouds.strength+"",Ye,it,Be,st;return{c(){e=_("div"),t=_("div"),n=_("div"),i=F(),o=_("span"),l=le(s),u=le(" to "),f=le(c),d=F(),h=_("div"),p=_("div"),O=F(),b=_("span"),D=le(E),C=F(),k=_("div"),w=_("div"),S=F(),M=_("span"),N=le(Z),L=le(" ("),X=le(j),fe=le(")"),ee=F(),te=_("div"),ge=_("div"),ue=F(),xe=_("span"),Ye=le(Pe),g(o,"class","weather-information"),g(t,"class","weather-line temperature svelte-adqg7o"),g(h,"class","weather-line precipitation svelte-adqg7o"),g(k,"class","weather-line wind svelte-adqg7o"),g(te,"class","weather-line clouds svelte-adqg7o"),g(e,"class","tooltip weather-tooltip svelte-adqg7o")},m(ct,ft){$(ct,e,ft),y(e,t),y(t,n),y(t,i),y(t,o),y(o,l),y(o,u),y(o,f),y(e,d),y(e,h),y(h,p),y(h,O),y(h,b),y(b,D),y(e,C),y(e,k),y(k,w),y(k,S),y(k,M),y(M,N),y(M,L),y(M,X),y(M,fe),y(e,ee),y(e,te),y(te,ge),y(te,ue),y(te,xe),y(xe,Ye),Be||(st=[me(a=vt.call(null,n,"thermometer")),me(m=vt.call(null,p,"cloud-drizzle")),me(T=vt.call(null,w,"wind")),me(he=vt.call(null,ge,"cloudy")),me(it=r[9].call(null,e,r[10]))],Be=!0)},p(ct,ft){ft&48&&s!==(s=jr(ct[4].temperature.low,ct[5])+"")&&ve(l,s),ft&48&&c!==(c=jr(ct[4].temperature.high,ct[5])+"")&&ve(f,c),ft&16&&E!==(E=ct[4].precipitation.strength+"")&&ve(D,E),ft&16&&Z!==(Z=ct[4].wind.strength+"")&&ve(N,Z),ft&16&&j!==(j=ct[4].wind.direction+"")&&ve(X,j),ft&16&&Pe!==(Pe=ct[4].clouds.strength+"")&&ve(Ye,Pe)},d(ct){ct&&A(e),Be=!1,Te(st)}}}function kq(r){let e,t=r[4]&&pk(r);return{c(){t&&t.c(),e=He()},m(n,a){t&&t.m(n,a),$(n,e,a)},p(n,[a]){n[4]?t?t.p(n,a):(t=pk(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:I,o:I,d(n){n&&A(e),t&&t.d(n)}}}function Eq(r,e,t){let n,a,i,o,s,l=I,u=()=>(l(),l=be(b,M=>t(4,s=M)),b),c,f=I,d=()=>(f(),f=be(a,M=>t(5,c=M)),a),h,p=I,m=()=>(p(),p=be(i,M=>t(6,h=M)),i);r.$$.on_destroy.push(()=>l()),r.$$.on_destroy.push(()=>f()),r.$$.on_destroy.push(()=>p());let O=ut("store");ie(r,O,M=>t(13,o=M));let{weather:b}=e;u();var E;(function(M){M.SUNNY="sun-medium",M.PARTLY_CLOUDY="cloud-sun",M.MOSTLY_CLOUDY="cloud",M.CLOUDY="cloudy",M.LIGHT_RAIN="cloud-drizzle",M.RAIN="cloud-rain",M.HEAVY_RAIN="cloud-rain-wind",M.SNOW="cloud-snow",M.HEAVY_SNOW="snowflake",M.STORM="cloud-lightning",M.WINDY="wind",M.TORNADO="tornado"})(E||(E={}));let[D,C]=hk({placement:"top",strategy:"absolute"}),k={modifiers:[{name:"offset",options:{offset:[0,8]}}]},{showTooltip:w=!1}=e,T=()=>t(0,w=!0),S=()=>t(0,w=!1);return r.$$set=M=>{"weather"in M&&u(t(1,b=M.weather)),"showTooltip"in M&&t(0,w=M.showTooltip)},r.$$.update=()=>{r.$$.dirty&8192&&t(12,n=o.staticStore),r.$$.dirty&4096&&d(t(3,a=de(n.seasonal,M=>M.weather.tempUnits))),r.$$.dirty&2050&&m(t(2,i=de(b,M=>{if(!M)return E.SUNNY;if(M.precipitation.index===0)return M.clouds.index>0?M.clouds.index===1?E.PARTLY_CLOUDY:M.clouds.index===2?E.MOSTLY_CLOUDY:E.CLOUDY:M.wind.index>5?E.WINDY:E.SUNNY;if(M.precipitation.index>0){let Z=M.precipitation.index;return M.temperature.actual<0&&Z<=3?E.SNOW:M.temperature.actual<0?E.HEAVY_SNOW:M.clouds.strength==="Dark storm clouds"&&Z>=5?E.STORM:Z<=2?E.LIGHT_RAIN:Z<=4?E.RAIN:E.HEAVY_RAIN}return E.SUNNY})))},[w,b,i,a,s,c,h,O,D,C,k,E,n,o,T,S]}var T1=class extends ae{constructor(e){super(),oe(this,e,Eq,kq,re,{weather:1,showTooltip:0},Cq)}},Xd=T1;function xq(r){we(r,"svelte-83czsl",".day-view.svelte-83czsl{padding:5px 15px;display:flex;flex-flow:column nowrap;gap:0.5rem;min-height:300px}.nav.svelte-83czsl{display:flex;justify-content:space-between;align-items:center}.date.svelte-83czsl{--icon-size:var(--icon-s);display:flex;justify-content:space-between;align-items:center;gap:0.25rem}.title-container.svelte-83czsl{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center}.title.svelte-83czsl{margin:0}.day-number.svelte-83czsl{font-size:x-small}.moon-container.svelte-83czsl{display:flex;align-items:center;justify-content:center}")}function yk(r,e,t){let n=r.slice();return n[35]=e[t],n}function bk(r){let e,t,n,a;return{c(){e=_("div"),t=_("em"),n=le("Day "),a=le(r[8]),g(e,"class","day-number svelte-83czsl")},m(i,o){$(i,e,o),y(e,t),y(t,n),y(t,a)},p(i,o){o[0]&256&&ve(a,i[8])},d(i){i&&A(e)}}}function vk(r){let e,t;return e=new Xd({props:{weather:r[2]}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a[0]&4&&(i.weather=n[2]),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Ok(r){let e,t,n=$e(r[18]),a=[];for(let o=0;oR(a[o],1,1,()=>{a[o]=null});return{c(){e=_("div");for(let o=0;o{n=null}),_e())},i(a){t||(P(n),t=!0)},o(a){R(n),t=!1},d(a){a&&A(e),n&&n.d(a)}}}function Sq(r){let e,t,n,a,i,o,s,l,u,c,f,d,h,p,m,O,b,E,D,C,k,w,T,S=r[19],M,Z,N,L=r[14]&&bk(r),j=r[15]&&r[16]&&vk(r),X=r[17]&&Ok(r),fe=Dk(r);return{c(){e=_("div"),t=_("div"),n=_("div"),a=_("div"),o=F(),s=_("div"),l=_("div"),c=F(),f=_("div"),d=_("h5"),h=_("span"),p=le(r[10]),m=F(),L&&L.c(),O=F(),b=_("div"),D=F(),C=_("div"),j&&j.c(),k=F(),w=_("div"),X&&X.c(),T=F(),fe.c(),g(a,"aria-label","Reveal on Calendar"),Pt(n,"flex","1"),g(l,"class","arrow"),g(l,"aria-label","Previous"),g(h,"class","current"),g(d,"class","calendarium-title title svelte-83czsl"),g(f,"class","title-container svelte-83czsl"),g(b,"class","arrow"),g(b,"aria-label","Next"),g(s,"class","date svelte-83czsl"),Pt(C,"flex","1"),g(t,"class","nav svelte-83czsl"),g(w,"class","context"),g(e,"class","day-view svelte-83czsl")},m(ee,te){$(ee,e,te),y(e,t),y(t,n),y(n,a),y(t,o),y(t,s),y(s,l),y(s,c),y(s,f),y(f,d),y(d,h),y(h,p),y(f,m),L&&L.m(f,null),y(s,O),y(s,b),y(t,D),y(t,C),j&&j.m(C,null),y(e,k),y(e,w),X&&X.m(w,null),y(e,T),fe.m(e,null),M=!0,Z||(N=[me(i=kc.call(null,a,kv)),ce(a,"click",r[28]),me(u=kc.call(null,l,Tc)),ce(l,"click",r[29]),me(E=kc.call(null,b,Nc)),ce(b,"click",r[30])],Z=!0)},p(ee,te){(!M||te[0]&1024)&&ve(p,ee[10]),ee[14]?L?L.p(ee,te):(L=bk(ee),L.c(),L.m(f,null)):L&&(L.d(1),L=null),ee[15]&&ee[16]?j?(j.p(ee,te),te[0]&98304&&P(j,1)):(j=vk(ee),j.c(),P(j,1),j.m(C,null)):j&&(Oe(),R(j,1,1,()=>{j=null}),_e()),ee[17]?X?(X.p(ee,te),te[0]&131072&&P(X,1)):(X=Ok(ee),X.c(),P(X,1),X.m(w,null)):X&&(Oe(),R(X,1,1,()=>{X=null}),_e()),te[0]&524288&&re(S,S=ee[19])?(Oe(),R(fe,1,1,I),_e(),fe=Dk(ee),fe.c(),P(fe,1),fe.m(e,null)):fe.p(ee,te)},i(ee){M||(P(j),P(X),P(fe),M=!0)},o(ee){R(j),R(X),R(fe),M=!1},d(ee){ee&&A(e),L&&L.d(),j&&j.d(),X&&X.d(),fe.d(ee),Z=!1,Te(N)}}}function Aq(r,e,t){let n,a,i,o,s,l,u,c,f,d,h,p,m,O,b,E,D,C=I,k=()=>(C(),C=be(o,ze=>t(1,D=ze)),o),w,T,S=I,M=()=>(S(),S=be(c,ze=>t(25,T=ze)),c),Z,N=I,L=()=>(N(),N=be(n,ze=>t(26,Z=ze)),n),j,X=I,fe=()=>(X(),X=be(i,ze=>t(27,j=ze)),i),ee,te=I,ge=()=>(te(),te=be(p,ze=>t(14,ee=ze)),p),he,ue=I,xe=()=>(ue(),ue=be(E,ze=>t(15,he=ze)),E),Pe,Ye=I,it=()=>(Ye(),Ye=be(O,ze=>t(16,Pe=ze)),O),Be,st=I,ct=()=>(st(),st=be(m,ze=>t(17,Be=ze)),m),ft,It=I,Yt=()=>(It(),It=be(h,ze=>t(18,ft=ze)),h),zt,V=I,B=()=>(V(),V=be(d,ze=>t(19,zt=ze)),d);r.$$.on_destroy.push(()=>C()),r.$$.on_destroy.push(()=>S()),r.$$.on_destroy.push(()=>N()),r.$$.on_destroy.push(()=>X()),r.$$.on_destroy.push(()=>te()),r.$$.on_destroy.push(()=>ue()),r.$$.on_destroy.push(()=>Ye()),r.$$.on_destroy.push(()=>st()),r.$$.on_destroy.push(()=>It()),r.$$.on_destroy.push(()=>V());let pe=ut("store");ie(r,pe,ze=>t(24,w=ze));let De=ut("parent"),rt=()=>{a.displayDate(D)},Mt=()=>{a.goToPreviousDay()},ar=()=>{a.goToNextDay()};function Er(ze){Zr.call(this,r,ze)}function Kt(ze){Zr.call(this,r,ze)}function Ue(ze){Zr.call(this,r,ze)}return r.$$.update=()=>{r.$$.dirty[0]&16777216&&L(t(13,n=w)),r.$$.dirty[0]&16777216&&t(0,a=w.getEphemeralStore(De)),r.$$.dirty[0]&1&&fe(t(12,i=a.viewing)),r.$$.dirty[0]&150994944&&(j||Ce(i,j={...Ne(w.current)},j)),r.$$.dirty[0]&1&&k(t(11,o=de([a.viewing],([ze])=>ze))),r.$$.dirty[0]&67108866&&t(10,s=Fr(D,Z)),r.$$.dirty[0]&16777216&&t(23,l=w.yearCalculator),r.$$.dirty[0]&8388610&&t(22,u=l.getYearFromCache(D.year).getMonthFromCache(D.month)),r.$$.dirty[0]&4194304&&M(t(9,c=u.daysBefore)),r.$$.dirty[0]&33554434&&t(8,f=T+D.day),r.$$.dirty[0]&16777218&&B(t(7,d=w.getEventsForDate(D))),r.$$.dirty[0]&16777218&&Yt(t(6,h=w.moonCache.getItemsOrRecalculate(D))),r.$$.dirty[0]&1&&ge(t(5,p=a.displayDayNumber)),r.$$.dirty[0]&1&&ct(t(4,m=a.displayMoons)),r.$$.dirty[0]&1&&it(t(3,O=a.displayWeather)),r.$$.dirty[0]&1&&t(21,b=a.currentLocation),r.$$.dirty[0]&18874370&&xe(t(2,E=w.weatherStore.getWeatherForDate(D,b)))},[a,D,E,O,m,p,h,d,f,c,s,o,i,n,ee,he,Pe,Be,ft,zt,pe,b,u,l,w,T,Z,j,rt,Mt,ar,Er,Kt,Ue]}var N1=class extends ae{constructor(e){super(),oe(this,e,Aq,Sq,re,{},xq,[-1,-1])}},Ck=N1;function $q(r){let e=r[0],t,n,a=kk(r);return{c(){a.c(),t=He()},m(i,o){a.m(i,o),$(i,t,o),n=!0},p(i,o){o&1&&re(e,e=i[0])?(Oe(),R(a,1,1,I),_e(),a=kk(i),a.c(),P(a,1),a.m(t.parentNode,t)):a.p(i,o)},i(i){n||(P(a),n=!0)},o(i){R(a),n=!1},d(i){i&&A(t),a.d(i)}}}function Tq(r){let e;return{c(){e=_("p"),e.textContent="Could not find linked calendar."},m(t,n){$(t,e,n)},p:I,i:I,o:I,d(t){t&&A(e)}}}function kk(r){let e,t;return e=new Ck({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p:I,i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Nq(r){let e,t,n,a,i=[Tq,$q],o=[];function s(l,u){return l[0]?1:0}return e=s(r,-1),t=o[e]=i[e](r),{c(){t.c(),n=He()},m(l,u){o[e].m(l,u),$(l,n,u),a=!0},p(l,[u]){let c=e;e=s(l,u),e===c?o[e].p(l,u):(Oe(),R(o[c],1,1,()=>{o[c]=null}),_e(),t=o[e],t?t.p(l,u):(t=o[e]=i[e](l),t.c()),P(t,1),t.m(n.parentNode,n))},i(l){a||(P(t),a=!0)},o(l){R(t),a=!1},d(l){l&&A(n),o[e].d(l)}}}function Pq(r,e,t){let{store:n}=e,{plugin:a}=e,{parent:i}=e;return Pn("plugin",a),Pn("parent",i),r.$$set=o=>{"store"in o&&t(0,n=o.store),"plugin"in o&&t(1,a=o.plugin),"parent"in o&&t(2,i=o.parent)},r.$$.update=()=>{r.$$.dirty&1&&n&&Pn("store",Ze(n))},[n,a,i]}var P1=class extends ae{constructor(e){super(),oe(this,e,Pq,Nq,re,{store:0,plugin:1,parent:2})}},Ek=P1;var Mu=class extends xk.ItemView{constructor(t,n){super(t);this.leaf=t;this.plugin=n;this.navigation=!1;this.id=Le(12)}async onOpen(){this.registerEvent(this.plugin.app.workspace.on("calendarium:view-parent:change-calendar",({parent:t,calendar:n})=>{t===this.parent&&this.setStore(n)})),this.plugin.registerEvent(this.app.workspace.on("calendarium-updated",()=>{this.plugin.hasCalendar(this.calendar)||(this.calendar=this.plugin.defaultCalendar?.id),this.store=this.plugin.getStore(this.calendar),this.ui.$set({store:this.store})}))}async setState(t,n){t.id&&(this.id=t.id),this.parent=t.parent,this.plugin.onLayoutReadyAndSettingsLoad(()=>{if(this.setStore(t.calendar),!t.userInitiated){let a=this.plugin.app.workspace.getLeavesOfType(Nr.Calendarium);for(let i of a)i.view instanceof bo&&i.view.id===this.parent&&(i.view.child=this.id)}}),super.setState(t,n)}setStore(t){this.calendar=t;let n=this.plugin.getStore(t);n&&(this.store=n,this.ui?this.ui.$set({store:this.store}):this.ui=new Ek({target:this.contentEl,props:{store:this.store,plugin:this.plugin,parent:this.parent}}))}getState(){return{calendar:this.calendar,id:this.id,parent:this.parent}}display(){}getViewType(){return Nr.Agenda}getDisplayText(){return"Agenda"}getIcon(){return Nr.Agenda}async onClose(){this.ui?.$destroy(),super.onClose(),this.store?.getEphemeralStore(this.parent).viewing.set(null)}};async function Sk(r){if(!r.child){let e=r.plugin.app.workspace.getRightLeaf(!0);if(!e||(await e.setViewState({type:Nr.Agenda,state:{calendar:r.calendar,parent:r.id,userInitiated:!0}}),!(e.view instanceof Mu)))return;e.view.parent=r.id,r.child=e.view.id,r.addChild(e.view),r.register(()=>{e.detach()}),e.view.register(()=>r.child=null)}}function Mq(r){we(r,"svelte-l8ie9l",".moons.svelte-l8ie9l{display:inline-flex;overflow-y:scroll}")}function Ak(r,e,t){let n=r.slice();return n[5]=e[t],n}function $k(r){let e,t,n=$e(r[0]),a=[];for(let o=0;oR(a[o],1,1,()=>{a[o]=null});return{c(){for(let o=0;o{l=null}),_e()),(!s||c&2)&&Ee(e,"full",!u[1])},i(u){s||(P(l),s=!0)},o(u){R(l),s=!1},d(u){u&&A(e),l&&l.d(),r[3](null)}}}function Qq(r,e,t){let{moons:n=[]}=e,{dayView:a=!1}=e,i,o;function s(l){Jr[l?"unshift":"push"](()=>{o=l,t(2,o)})}return r.$$set=l=>{"moons"in l&&t(0,n=l.moons),"dayView"in l&&t(1,a=l.dayView)},[n,a,o,s]}var M1=class extends ae{constructor(e){super(),oe(this,e,Qq,Rq,re,{moons:0,dayView:1},Mq)}},Nk=M1;function Iq(r){we(r,"svelte-1gh3owl",`.day.svelte-1gh3owl.svelte-1gh3owl{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;display:flex;flex-flow:column nowrap;margin:2px}.opened.svelte-1gh3owl.svelte-1gh3owl{border:2px solid var(--background-modifier-border);padding:2px}.season.svelte-1gh3owl .day-inner.svelte-1gh3owl{padding-top:2px;border-top:1px solid var(--seasonal-color)}.full.svelte-1gh3owl .day-number.svelte-1gh3owl{font-size:larger}.full.svelte-1gh3owl .split.svelte-1gh3owl{display:flex;justify-content:space-between;padding:0.25rem}.full.svelte-1gh3owl .day-number.svelte-1gh3owl:only-child{margin:0 auto}.intercalary.svelte-1gh3owl.svelte-1gh3owl{grid-column:span var(--calendar-columns);display:flex;justify-content:center;align-items:center;border-top:1px solid var(--background-modifier-border);border-bottom:1px solid var(--background-modifier-border);color:var(--text-accent)}.day.svelte-1gh3owl.svelte-1gh3owl:hover{background-color:var(--interactive-hover)}.adjacent-month.svelte-1gh3owl.svelte-1gh3owl{opacity:0.25}.today.svelte-1gh3owl .day-number.svelte-1gh3owl{color:var(--text-accent);font-weight:var(--bold-weight)}`)}function Fq(r){let e,t,n,a,i,o,s=r[20],l,u,c,f,d,h=r[0].type===Nn.LeapDay&&r[0].intercalary&&r[0].name?.length&&Pk(r),p=(r[0].type===Nn.Day||r[0].numbered)&&Mk(r),m=r[4]&&r[25]&&r[26]&&Rk(r),O=Fk(r);return{c(){e=_("div"),t=_("div"),n=_("div"),h&&h.c(),a=F(),p&&p.c(),i=F(),m&&m.c(),o=F(),O.c(),g(n,"class","split svelte-1gh3owl"),g(t,"class","day-inner svelte-1gh3owl"),g(e,"class","day svelte-1gh3owl"),g(e,"aria-label",l=r[20].length>0?`${r[20].length} event${r[20].length==1?"":"s"}`:""),g(e,"style",u=r[22]&&r[23].length?`--seasonal-color: ${r[24]?r[23][0].lerp:r[23][0].color}`:""),Ee(e,"leapday",r[0].type==Nn.LeapDay),Ee(e,"intercalary",r[0].type==Nn.LeapDay&&r[0].intercalary),Ee(e,"adjacent-month",r[1]),Ee(e,"opened",r[5]),Ee(e,"today",r[6]),Ee(e,"full",r[4]),Ee(e,"season",r[22]&&r[23].length)},m(b,E){$(b,e,E),y(e,t),y(t,n),h&&h.m(n,null),y(n,a),p&&p.m(n,null),y(n,i),m&&m.m(n,null),y(t,o),O.m(t,null),c=!0,f||(d=[ce(e,"click",r[44]),ce(e,"contextmenu",r[45])],f=!0)},p(b,E){b[0].type===Nn.LeapDay&&b[0].intercalary&&b[0].name?.length?h?h.p(b,E):(h=Pk(b),h.c(),h.m(n,a)):h&&(h.d(1),h=null),b[0].type===Nn.Day||b[0].numbered?p?p.p(b,E):(p=Mk(b),p.c(),p.m(n,i)):p&&(p.d(1),p=null),b[4]&&b[25]&&b[26]?m?(m.p(b,E),E[0]&100663312&&P(m,1)):(m=Rk(b),m.c(),P(m,1),m.m(n,null)):m&&(Oe(),R(m,1,1,()=>{m=null}),_e()),E[0]&1048576&&re(s,s=b[20])?(Oe(),R(O,1,1,I),_e(),O=Fk(b),O.c(),P(O,1),O.m(t,null)):O.p(b,E),(!c||E[0]&1048576&&l!==(l=b[20].length>0?`${b[20].length} event${b[20].length==1?"":"s"}`:""))&&g(e,"aria-label",l),(!c||E[0]&29360128&&u!==(u=b[22]&&b[23].length?`--seasonal-color: ${b[24]?b[23][0].lerp:b[23][0].color}`:""))&&g(e,"style",u),(!c||E[0]&1)&&Ee(e,"leapday",b[0].type==Nn.LeapDay),(!c||E[0]&1)&&Ee(e,"intercalary",b[0].type==Nn.LeapDay&&b[0].intercalary),(!c||E[0]&2)&&Ee(e,"adjacent-month",b[1]),(!c||E[0]&32)&&Ee(e,"opened",b[5]),(!c||E[0]&64)&&Ee(e,"today",b[6]),(!c||E[0]&16)&&Ee(e,"full",b[4]),(!c||E[0]&12582912)&&Ee(e,"season",b[22]&&b[23].length)},i(b){c||(P(m),P(O),c=!0)},o(b){R(m),R(O),c=!1},d(b){b&&A(e),h&&h.d(),p&&p.d(),m&&m.d(),O.d(b),f=!1,Te(d)}}}function Zq(r){let e;return{c(){e=_("div")},m(t,n){$(t,e,n)},p:I,i:I,o:I,d(t){t&&A(e)}}}function Pk(r){let e=r[0].name+"",t;return{c(){t=le(e)},m(n,a){$(n,t,a)},p(n,a){a[0]&1&&e!==(e=n[0].name+"")&&ve(t,e)},d(n){n&&A(t)}}}function Mk(r){let e,t;return{c(){e=_("span"),t=le(r[2]),g(e,"class","day-number svelte-1gh3owl")},m(n,a){$(n,e,a),y(e,t)},p(n,a){a[0]&4&&ve(t,n[2])},d(n){n&&A(e)}}}function Rk(r){let e,t;return e=new Xd({props:{weather:r[7]}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a[0]&128&&(i.weather=n[7]),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function qq(r){let e,t;return e=new ZC({props:{events:r[20]}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a[0]&1048576&&(i.events=n[20]),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Lq(r){let e,t=r[20],n,a,i=r[27]&&Qk(r),o=Ik(r);return{c(){i&&i.c(),e=F(),o.c(),n=He()},m(s,l){i&&i.m(s,l),$(s,e,l),o.m(s,l),$(s,n,l),a=!0},p(s,l){s[27]?i?(i.p(s,l),l[0]&134217728&&P(i,1)):(i=Qk(s),i.c(),P(i,1),i.m(e.parentNode,e)):i&&(Oe(),R(i,1,1,()=>{i=null}),_e()),l[0]&1048576&&re(t,t=s[20])?(Oe(),R(o,1,1,I),_e(),o=Ik(s),o.c(),P(o,1),o.m(n.parentNode,n)):o.p(s,l)},i(s){a||(P(i),P(o),a=!0)},o(s){R(i),R(o),a=!1},d(s){s&&(A(e),A(n)),i&&i.d(s),o.d(s)}}}function Qk(r){let e,t;return e=new Nk({props:{moons:r[28]}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a[0]&268435456&&(i.moons=n[28]),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Ik(r){let e,t;return e=new Bd({props:{events:r[20]}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a[0]&1048576&&(i.events=n[20]),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Fk(r){let e,t,n,a,i=[Lq,qq],o=[];function s(l,u){return l[4]&&l[21]!=0?0:1}return e=s(r,[-1,-1]),t=o[e]=i[e](r),{c(){t.c(),n=He()},m(l,u){o[e].m(l,u),$(l,n,u),a=!0},p(l,u){let c=e;e=s(l,u),e===c?o[e].p(l,u):(Oe(),R(o[c],1,1,()=>{o[c]=null}),_e(),t=o[e],t?t.p(l,u):(t=o[e]=i[e](l),t.c()),P(t,1),t.m(n.parentNode,n))},i(l){a||(P(t),a=!0)},o(l){R(t),a=!1},d(l){l&&A(n),o[e].d(l)}}}function Bq(r){let e,t,n,a,i=[Zq,Fq],o=[];function s(l,u){return l[21]==0&&l[1]?0:1}return e=s(r,[-1,-1]),t=o[e]=i[e](r),{c(){t.c(),n=He()},m(l,u){o[e].m(l,u),$(l,n,u),a=!0},p(l,u){let c=e;e=s(l,u),e===c?o[e].p(l,u):(Oe(),R(o[c],1,1,()=>{o[c]=null}),_e(),t=o[e],t?t.p(l,u):(t=o[e]=i[e](l),t.c()),P(t,1),t.m(n.parentNode,n))},i(l){a||(P(t),a=!0)},o(l){R(t),a=!1},d(l){l&&A(n),o[e].d(l)}}}function Uq(r,e,t){let n,a,i,o,s,l,u,c,f,d,h,p,m,O,b,E,D,C,k,w,T=I,S=()=>(T(),T=be(i,Je=>t(37,w=Je)),i),M,Z=I,N=()=>(Z(),Z=be(l,Je=>t(38,M=Je)),l),L,j=I,X=()=>(j(),j=be(c,Je=>t(20,L=Je)),c),fe,ee=I,te=()=>(ee(),ee=be(n,Je=>t(39,fe=Je)),n),ge,he,ue=I,xe=()=>(ue(),ue=be(a,Je=>t(41,he=Je)),a),Pe,Ye=I,it=()=>(Ye(),Ye=be(s,Je=>t(42,Pe=Je)),s),Be,st,ct,ft=I,It=()=>(ft(),ft=be(u,Je=>t(21,ct=Je)),u),Yt,zt=I,V=()=>(zt(),zt=be(p,Je=>t(22,Yt=Je)),p),B,pe=I,De=()=>(pe(),pe=be(h,Je=>t(23,B=Je)),h),rt,Mt=I,ar=()=>(Mt(),Mt=be(m,Je=>t(24,rt=Je)),m),Er,Kt=I,Ue=()=>(Kt(),Kt=be(E,Je=>t(25,Er=Je)),E),ze,Wt=I,ur=()=>(Wt(),Wt=be(O,Je=>t(26,ze=Je)),O),Jt,cr=I,fn=()=>(cr(),cr=be(f,Je=>t(27,Jt=Je)),f),dn,In=I,$a=()=>(In(),In=be(d,Je=>t(28,dn=Je)),d);r.$$.on_destroy.push(()=>T()),r.$$.on_destroy.push(()=>Z()),r.$$.on_destroy.push(()=>j()),r.$$.on_destroy.push(()=>ee()),r.$$.on_destroy.push(()=>ue()),r.$$.on_destroy.push(()=>Ye()),r.$$.on_destroy.push(()=>ft()),r.$$.on_destroy.push(()=>zt()),r.$$.on_destroy.push(()=>pe()),r.$$.on_destroy.push(()=>Mt()),r.$$.on_destroy.push(()=>Kt()),r.$$.on_destroy.push(()=>Wt()),r.$$.on_destroy.push(()=>cr()),r.$$.on_destroy.push(()=>In());let{month:zn}=e,{day:Vt}=e,{adjacent:je}=e,fr=ut("plugin"),Rr=ut("store");ie(r,Rr,Je=>t(40,ge=Je));let fa=ut("view"),Ii=ut("ephemeralStore");ie(r,Ii,Je=>t(43,st=Je));let xo=ut("full");ie(r,xo,Je=>t(4,Be=Je));let So=Je=>{let En=new gn(fr);En.setNoIcon(),xo||En.addItem(Ie=>{Ie.setTitle("Open day view").onClick(()=>{Ce(l,M={day:Vt.number,month:w,year:o.year},M)})}),En.addItem(Ie=>{Ie.setTitle("Set as Today").onClick(async()=>{ge.setCurrentDate({day:Vt.number,month:w,year:o.year})})}),En.addItem(Ie=>Ie.setTitle("New event").onClick(()=>{sf(fr,fe,{day:Vt.number,month:w,year:o.year})}));let Ta=[];for(let Ie of L){if(!Bo(Ie)||!Ie.note)continue;let $t=fr.app.vault.getAbstractFileByPath(Ie.note);$t&&$t instanceof Zk.TFile&&Ta.push({event:Ie,file:$t})}if(Ta.length){En.addSeparator();for(let{event:Ie,file:$t}of Ta)En.addItem(jt=>jt.setTitle(`Open ${Ie.name}`).onClick(()=>{fr.app.workspace.getLeaf().openFile($t)}))}En.showAtMouseEvent(Je)},Ao=()=>{Ce(l,M={day:Vt.number,month:w,year:o.year},M),Sk(fa)},tl=()=>Ao(),rl=Je=>{So(Je)};return r.$$set=Je=>{"month"in Je&&t(34,zn=Je.month),"day"in Je&&t(0,Vt=Je.day),"adjacent"in Je&&t(1,je=Je.adjacent)},r.$$.update=()=>{if(r.$$.dirty[1]&512&&te(t(3,n=ge)),r.$$.dirty[0]&8&&xe(t(19,a=n.staticStore.staticConfiguration)),r.$$.dirty[1]&8&&S(t(18,i=zn.index)),r.$$.dirty[1]&8&&t(35,o=zn.year),r.$$.dirty[1]&512&&it(t(17,s=ge.current)),r.$$.dirty[1]&4096&&N(t(16,l=st.viewing)),r.$$.dirty[1]&4096&&It(t(15,u=st.viewState)),r.$$.dirty[0]&1|r.$$.dirty[1]&592&&X(t(14,c=ge.getEventsForDate({day:Vt.number,month:w,year:o.year}))),r.$$.dirty[1]&4096&&fn(t(13,f=st.displayMoons)),r.$$.dirty[0]&1|r.$$.dirty[1]&592&&$a(t(12,d=ge.moonCache.getItemsOrRecalculate({day:Vt.number,month:w,year:o.year}))),r.$$.dirty[0]&1|r.$$.dirty[1]&592&&De(t(11,h=ge.seasonCache.getItemsOrRecalculate({day:Vt.number,month:w,year:o.year}))),r.$$.dirty[1]&4096&&V(t(10,p=st.displaySeasonColors)),r.$$.dirty[1]&4096&&ar(t(9,m=st.interpolateColors)),r.$$.dirty[1]&4096&&ur(t(8,O=st.displayWeather)),r.$$.dirty[1]&4096&&t(36,b=st.currentLocation),r.$$.dirty[0]&17|r.$$.dirty[1]&624&&Ue(t(7,E=Be?ge.weatherStore.getWeatherForDate({day:Vt.number,month:w,year:o.year},b):Za(null))),r.$$.dirty[0]&3|r.$$.dirty[1]&2128&&t(6,D=!je&&Pe.day==Vt.number&&Pe.month==w&&Pe.year==o.year),r.$$.dirty[0]&3|r.$$.dirty[1]&208&&t(5,C=!je&&M&&M.day==Vt.number&&M.month==w&&M.year==o.year),r.$$.dirty[0]&1&&t(2,k=`${Vt.number}`),r.$$.dirty[0]&5|r.$$.dirty[1]&1280&&he.dayDisplayCallback){try{let Je=document.body.createEl("iframe"),En=Je.contentWindow.Function,Ta=new En("day","calendar",he.dayDisplayCallback);t(2,k=Ta.call(void 0,Vt,fe)??k),document.body.removeChild(Je)}catch(Je){console.error(Je)}(k==null||typeof k!="number"&&typeof k!="string")&&t(2,k=`${Vt.number}`)}},[Vt,je,k,n,Be,C,D,E,O,m,p,h,d,f,c,u,l,s,i,a,L,ct,Yt,B,rt,Er,ze,Jt,dn,Rr,Ii,xo,So,Ao,zn,o,b,w,M,fe,ge,he,Pe,st,tl,rl]}var R1=class extends ae{constructor(e){super(),oe(this,e,Uq,Bq,re,{month:34,day:0,adjacent:1},Iq,[-1,-1])}},qk=R1;function Wq(r){we(r,"svelte-q3ourf",".week.svelte-q3ourf{display:grid;grid-template-columns:repeat(var(--calendar-columns), minmax(0, 1fr));text-align:center}.week-number.svelte-q3ourf{border-right:1px solid var(--blockquote-border-color);background-color:transparent;padding-bottom:6px;margin-right:0.25rem;color:var(--text-muted);font-size:0.65em;display:flex;align-items:center;justify-content:center}")}function Lk(r,e,t){let n=r.slice();return n[18]=e[t],n}function Bk(r){let e,t;return{c(){e=_("span"),t=le(r[1]),g(e,"class","week-number svelte-q3ourf")},m(n,a){$(n,e,a),y(e,t)},p(n,a){a&2&&ve(t,n[1])},d(n){n&&A(e)}}}function Yq(r){let e;return{c(){e=_("div")},m(t,n){$(t,e,n)},p:I,i:I,o:I,d(t){t&&A(e)}}}function zq(r){let e,t,n=[r[7](r[18])],a={};for(let i=0;i{o[c]=null}),_e(),t=o[e],t?t.p(l,u):(t=o[e]=i[e](l),t.c()),P(t,1),t.m(n.parentNode,n))},i(l){a||(P(t),a=!0)},o(l){R(t),a=!1},d(l){l&&A(n),o[e].d(l)}}}function Vq(r){let e,t,n,a=r[4]&&Bk(r),i=$e(r[0]),o=[];for(let l=0;lR(o[l],1,1,()=>{o[l]=null});return{c(){e=_("div"),a&&a.c(),t=F();for(let l=0;l(f(),f=be(s,M=>t(17,c=M)),s),h,p,m,O=I,b=()=>(O(),O=be(i,M=>t(4,m=M)),i);r.$$.on_destroy.push(()=>f()),r.$$.on_destroy.push(()=>O());let{year:E}=e,{month:D}=e,{dayArray:C}=e,{weekNumber:k}=e,w=ut("store");ie(r,w,M=>t(14,p=M));let T=ut("ephemeralStore");ie(r,T,M=>t(13,h=M));let S=M=>M.number<=0?{month:l,day:{...M,number:Ne(l.days)+M.number},adjacent:!0}:M.number>c?{month:u,day:{...M,number:M.number-c},adjacent:!0}:{month:o,day:M,adjacent:!1};return r.$$set=M=>{"year"in M&&t(8,E=M.year),"month"in M&&t(9,D=M.month),"dayArray"in M&&t(0,C=M.dayArray),"weekNumber"in M&&t(1,k=M.weekNumber)},r.$$.update=()=>{r.$$.dirty&16384&&t(12,n=p),r.$$.dirty&4096&&t(11,a=n.yearCalculator),r.$$.dirty&8192&&b(t(3,i=h.displayWeeks)),r.$$.dirty&2816&&t(10,o=a.getYearFromCache(E).getMonthFromCache(D)),r.$$.dirty&1024&&d(t(2,s=o.days)),r.$$.dirty&8960&&(l=h.getPreviousMonth(D,E)),r.$$.dirty&8960&&(u=h.getNextMonth(D,E))},[C,k,s,i,m,w,T,S,E,D,o,a,n,h,p]}var Q1=class extends ae{constructor(e){super(),oe(this,e,jq,Vq,re,{year:8,month:9,dayArray:0,weekNumber:1},Wq)}},Gd=Q1;function Xq(r){we(r,"svelte-14cmh0y",`.month-container.svelte-14cmh0y.svelte-14cmh0y{height:min-content}.month-container.full.svelte-14cmh0y.svelte-14cmh0y{height:100%;display:flex;flex-flow:column nowrap}.month-header.svelte-14cmh0y.svelte-14cmh0y{margin:0}.month.svelte-14cmh0y.svelte-14cmh0y{width:100%;display:grid;grid-template-rows:repeat( var(--calendar-row-count), var(--calendar-row-size) )}.full.svelte-14cmh0y .month.svelte-14cmh0y{height:100%}`)}function Wk(r,e,t){let n=r.slice();return n[23]=e[t],n[25]=t,n}function Yk(r){let e,t=r[2].name+"",n;return{c(){e=_("h4"),n=le(t),g(e,"class","calendarium month-header svelte-14cmh0y")},m(a,i){$(a,e,i),y(e,n)},p(a,i){i&4&&t!==(t=a[2].name+"")&&ve(n,t)},d(a){a&&A(e)}}}function zk(r){let e,t;return e=new Gd({props:{month:r[1],year:r[0],dayArray:r[23],weekNumber:r[15]+r[25]+1}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a&2&&(i.month=n[1]),a&1&&(i.year=n[0]),a&16384&&(i.dayArray=n[23]),a&32768&&(i.weekNumber=n[15]+n[25]+1),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Gq(r){let e,t,n,a,i,o,s=r[9]==0&&Yk(r);n=new qd({props:{year:r[0],month:r[1]}});let l=$e(r[14]),u=[];for(let f=0;fR(u[f],1,1,()=>{u[f]=null});return{c(){s&&s.c(),e=F(),t=_("div"),z(n.$$.fragment),a=F(),i=_("div");for(let f=0;f(m(),m=be(o,Pe=>t(9,p=Pe)),o),b,E,D=I,C=()=>(D(),D=be(l,Pe=>t(11,E=Pe)),l),k,w=I,T=()=>(w(),w=be(i,Pe=>t(12,k=Pe)),i),S,M=I,Z=()=>(M(),M=be(u,Pe=>t(13,S=Pe)),u),N,L=I,j=()=>(L(),L=be(c,Pe=>t(14,N=Pe)),c),X,fe=I,ee=()=>(fe(),fe=be(f,Pe=>t(15,X=Pe)),f);r.$$.on_destroy.push(()=>m()),r.$$.on_destroy.push(()=>D()),r.$$.on_destroy.push(()=>w()),r.$$.on_destroy.push(()=>M()),r.$$.on_destroy.push(()=>L()),r.$$.on_destroy.push(()=>fe());let{year:te}=e,{month:ge}=e,he=ut("store");ie(r,he,Pe=>t(22,h=Pe));let ue=ut("ephemeralStore");ie(r,ue,Pe=>t(21,d=Pe));let xe=ut("full");return ie(r,xe,Pe=>t(10,b=Pe)),r.$$set=Pe=>{"year"in Pe&&t(0,te=Pe.year),"month"in Pe&&t(1,ge=Pe.month)},r.$$.update=()=>{r.$$.dirty&4194304&&t(20,n=h),r.$$.dirty&1048576&&t(19,a=n.yearCalculator),r.$$.dirty&2097152&&T(t(8,i=d.displayWeeks)),r.$$.dirty&2097152&&O(t(7,o=d.viewState)),r.$$.dirty&524291&&t(2,s=a.getYearFromCache(te).getMonthFromCache(ge)),r.$$.dirty&4&&C(t(6,{weekdays:l,weeks:u}=s,l,Z(t(5,u)))),r.$$.dirty&4&&j(t(4,c=s.daysAsWeeks)),r.$$.dirty&4&&ee(t(3,f=s.firstWeekNumber))},[te,ge,s,f,c,u,l,o,i,p,b,E,k,S,N,X,he,ue,xe,a,n,d,h]}var I1=class extends ae{constructor(e){super(),oe(this,e,Hq,Gq,re,{year:0,month:1},Xq)}},Hd=I1;var eE=require("obsidian");var{Boolean:Kq}=ml;function Jq(r){we(r,"svelte-18xdt4e",".year-container.svelte-18xdt4e{height:100%;position:relative;display:flex;flex-direction:column;overflow:auto}.year.svelte-18xdt4e{display:grid;grid-template-columns:1fr;gap:1rem;overflow:auto;flex:1}.year.full.svelte-18xdt4e{grid-template-columns:repeat(auto-fit, minmax(250px, 1fr))}")}function Vk(r,e,t){let n=r.slice();return n[27]=e[t],n[28]=e,n[29]=t,n}function jk(r){let e,t,n,a,i,o=r[29],s;t=new Hd({props:{year:r[0].year,month:r[29]}});let l=()=>r[19](e,o),u=()=>r[19](null,o);return{c(){e=_("div"),z(t.$$.fragment),n=F(),g(e,"class","month-container calendarium"),g(e,"id",a=r[12](r[27].name)),g(e,"data-index",i=r[29])},m(c,f){$(c,e,f),W(t,e,null),y(e,n),l(),s=!0},p(c,f){r=c;let d={};f&1&&(d.year=r[0].year),t.$set(d),(!s||f&128&&a!==(a=r[12](r[27].name)))&&g(e,"id",a),o!==r[29]&&(u(),o=r[29],l())},i(c){s||(P(t.$$.fragment,c),s=!0)},o(c){R(t.$$.fragment,c),s=!1},d(c){c&&A(e),Y(t),u()}}}function eL(r){let e,t,n,a,i,o,s=$e(r[7]),l=[];for(let c=0;cR(l[c],1,1,()=>{l[c]=null});return{c(){e=_("div"),t=_("div");for(let c=0;c(d(),d=be(o,ue=>t(23,f=ue)),o),p,m=I,O=()=>(m(),m=be(i,ue=>t(0,p=ue)),i),b,E,D,C,k=I,w=()=>(k(),k=be(l,ue=>t(7,C=ue)),l);r.$$.on_destroy.push(()=>d()),r.$$.on_destroy.push(()=>m()),r.$$.on_destroy.push(()=>k());let T,S=ut("store");ie(r,S,ue=>t(18,E=ue));let M=ut("ephemeralStore");ie(r,M,ue=>t(17,b=ue));let Z=ut("full");ie(r,Z,ue=>t(6,D=ue));let N=[],L=ue=>{let xe=ue.querySelector(`#${X(f.name)}`);xe&&xe.scrollIntoView(!0)},j=new Map,X=ue=>ue?(j.has(ue)||j.set(ue,`ID_${Le(5)}_${ue.replace(/^[^a-z]+|[^\w:.-]+/gi,"")}`),j.get(ue)):"",fe=ut("monthInFrame");ie(r,fe,ue=>t(22,c=ue));let ee=new IntersectionObserver(([ue])=>{if(!te){te=!0;return}ue.boundingClientRect.top<0&&ue.target instanceof HTMLElement&&Ce(fe,c=Number(ue.target.dataset.index)+1,c)}),te=!1;Hn(()=>{for(let ue of u)ee.observe(ue)});function ge(ue,xe){Jr[ue?"unshift":"push"](()=>{u[xe]=ue,t(2,u),t(24,N)})}function he(ue){Jr[ue?"unshift":"push"](()=>{T=ue,t(1,T)})}return r.$$.update=()=>{r.$$.dirty&262144&&t(16,n=E),r.$$.dirty&65536&&t(15,a=n.yearCalculator),r.$$.dirty&131072&&O(t(5,i=b.displaying)),r.$$.dirty&131072&&h(t(4,o=b.displayingMonth)),r.$$.dirty&32769&&t(14,s=a.getYearFromCache(p.year)),r.$$.dirty&16384&&w(t(3,l=s.months))},t(2,u=N.filter(Boolean)),[p,T,u,l,o,i,D,C,S,M,Z,L,X,fe,s,a,n,b,E,ge,he]}var F1=class extends ae{constructor(e){super(),oe(this,e,tL,eL,re,{},Jq)}},Xk=F1;function rL(r){we(r,"svelte-5stvq",".calendar-container.svelte-5stvq{overflow:hidden;display:flex;flex-flow:column;height:100%;gap:0.5rem}.calendar.svelte-5stvq{overflow:auto;height:100%}.top-container.svelte-5stvq{display:flex;flex-flow:column}.name-container.svelte-5stvq{display:flex;align-items:center;gap:0.75rem}.calendar-name.svelte-5stvq{margin:0}.location-container.svelte-5stvq{display:flex;align-items:center;gap:0.25rem;--icon-size:var(--icon-xs)}")}function Gk(r){let e,t,n,a;return{c(){e=_("div")},m(i,o){$(i,e,o),n||(a=[me(t=r[28].call(null,e)),ce(e,"click",r[37])],n=!0)},p:I,d(i){i&&A(e),n=!1,Te(a)}}}function Hk(r){let e,t,n,a,i,o,s,l;return{c(){e=_("div"),t=_("small"),n=le(r[22]),a=F(),i=_("div"),g(t,"class","location-name"),g(e,"class","location-container svelte-5stvq")},m(u,c){$(u,e,c),y(e,t),y(t,n),y(e,a),y(e,i),s||(l=[me(o=r[28].call(null,i)),ce(i,"click",r[38])],s=!0)},p(u,c){c[0]&4194304&&ve(n,u[22])},d(u){u&&A(e),s=!1,Te(l)}}}function nL(r){let e,t,n,a;return e=new qd({props:{year:r[1].year,month:r[1].month}}),n=new Gd({props:{year:r[1].year,month:r[1].month,dayArray:r[3],weekNumber:r[2]}}),{c(){z(e.$$.fragment),t=F(),z(n.$$.fragment)},m(i,o){W(e,i,o),$(i,t,o),W(n,i,o),a=!0},p(i,o){let s={};o[0]&2&&(s.year=i[1].year),o[0]&2&&(s.month=i[1].month),e.$set(s);let l={};o[0]&2&&(l.year=i[1].year),o[0]&2&&(l.month=i[1].month),o[0]&8&&(l.dayArray=i[3]),o[0]&4&&(l.weekNumber=i[2]),n.$set(l)},i(i){a||(P(e.$$.fragment,i),P(n.$$.fragment,i),a=!0)},o(i){R(e.$$.fragment,i),R(n.$$.fragment,i),a=!1},d(i){i&&A(t),Y(e,i),Y(n,i)}}}function aL(r){let e=r[1],t,n,a=Kk(r);return{c(){a.c(),t=He()},m(i,o){a.m(i,o),$(i,t,o),n=!0},p(i,o){o[0]&2&&re(e,e=i[1])?(Oe(),R(a,1,1,I),_e(),a=Kk(i),a.c(),P(a,1),a.m(t.parentNode,t)):a.p(i,o)},i(i){n||(P(a),n=!0)},o(i){R(a),n=!1},d(i){i&&A(t),a.d(i)}}}function iL(r){let e,t;return e=new Xk({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p:I,i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Kk(r){let e,t;return e=new Hd({props:{year:r[1].year,month:r[1].month}}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p(n,a){let i={};a[0]&2&&(i.year=n[1].year),a[0]&2&&(i.month=n[1].month),e.$set(i)},i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function Jk(r){let e,t,n,a,i=r[16].name+"",o,s,l,u,c,f,d,h,p,m,O=r[17].length>1&&Gk(r),b=r[15].length&&Hk(r);c=new TC({});let E=[iL,aL,nL],D=[];function C(k,w){return k[23]==0?0:k[23]==1?1:k[23]==2?2:-1}return~(h=C(r,[-1,-1]))&&(p=D[h]=E[h](r)),{c(){e=_("div"),t=_("div"),n=_("div"),a=_("h3"),o=le(i),s=F(),O&&O.c(),l=F(),b&&b.c(),u=F(),z(c.$$.fragment),f=F(),d=_("div"),p&&p.c(),g(a,"class","calendar-name svelte-5stvq"),g(n,"class","name-container svelte-5stvq"),g(t,"class","top-container svelte-5stvq"),g(d,"class","calendar svelte-5stvq"),g(e,"class","calendar-container svelte-5stvq"),Pt(e,"--calendar-columns",r[18].length+(r[19]?1:0)),Pt(e,"--calendar-row-size",r[20]?`${1/r[21]*100}%`:"1fr"),Pt(e,"--calendar-row-count",r[21])},m(k,w){$(k,e,w),y(e,t),y(t,n),y(n,a),y(a,o),y(n,s),O&&O.m(n,null),y(t,l),b&&b.m(t,null),y(e,u),W(c,e,null),y(e,f),y(e,d),~h&&D[h].m(d,null),m=!0},p(k,w){(!m||w[0]&65536)&&i!==(i=k[16].name+"")&&ve(o,i),k[17].length>1?O?O.p(k,w):(O=Gk(k),O.c(),O.m(n,null)):O&&(O.d(1),O=null),k[15].length?b?b.p(k,w):(b=Hk(k),b.c(),b.m(t,null)):b&&(b.d(1),b=null);let T=h;h=C(k,w),h===T?~h&&D[h].p(k,w):(p&&(Oe(),R(D[T],1,1,()=>{D[T]=null}),_e()),~h?(p=D[h],p?p.p(k,w):(p=D[h]=E[h](k),p.c()),P(p,1),p.m(d,null)):p=null),(!m||w[0]&786432)&&Pt(e,"--calendar-columns",k[18].length+(k[19]?1:0)),(!m||w[0]&3145728)&&Pt(e,"--calendar-row-size",k[20]?`${1/k[21]*100}%`:"1fr"),(!m||w[0]&2097152)&&Pt(e,"--calendar-row-count",k[21])},i(k){m||(P(c.$$.fragment,k),P(p),m=!0)},o(k){R(c.$$.fragment,k),R(p),m=!1},d(k){k&&A(e),O&&O.d(),b&&b.d(),Y(c),~h&&D[h].d()}}}function oL(r){let e=r[16],t,n,a=Jk(r);return{c(){a.c(),t=He()},m(i,o){a.m(i,o),$(i,t,o),n=!0},p(i,o){o[0]&65536&&re(e,e=i[16])?(Oe(),R(a,1,1,I),_e(),a=Jk(i),a.c(),P(a,1),a.m(t.parentNode,t)):a.p(i,o)},i(i){n||(P(a),n=!0)},o(i){R(a),n=!1},d(i){i&&A(t),a.d(i)}}}function sL(r,e,t){let n,a,i,o,s,l,u,c,f,d,h,p,m,O,b,E,D=I,C=()=>(D(),D=be(f,je=>t(32,E=je)),f),k,w=I,T=()=>(w(),w=be(a,je=>t(1,k=je)),a),S,M=I,Z=()=>(M(),M=be(c,je=>t(33,S=je)),c),N,L=I,j=()=>(L(),L=be(l,je=>t(39,N=je)),l),X,fe=I,ee=()=>(fe(),fe=be(u,je=>t(15,X=je)),u),te,ge=I,he=()=>(ge(),ge=be(n,je=>t(16,te=je)),n),ue,xe,Pe,Ye=I,it=()=>(Ye(),Ye=be(o,je=>t(35,Pe=je)),o),Be,st,ct=I,ft=()=>(ct(),ct=be(d,je=>t(18,st=je)),d),It,Yt=I,zt=()=>(Yt(),Yt=be(i,je=>t(19,It=je)),i),V,B,pe=I,De=()=>(pe(),pe=be(h,je=>t(21,B=je)),h),rt,Mt=I,ar=()=>(Mt(),Mt=be(s,je=>t(22,rt=je)),s),Er,Kt=I,Ue=()=>(Kt(),Kt=be(p,je=>t(23,Er=je)),p);r.$$.on_destroy.push(()=>D()),r.$$.on_destroy.push(()=>w()),r.$$.on_destroy.push(()=>M()),r.$$.on_destroy.push(()=>L()),r.$$.on_destroy.push(()=>fe()),r.$$.on_destroy.push(()=>ge()),r.$$.on_destroy.push(()=>Ye()),r.$$.on_destroy.push(()=>ct()),r.$$.on_destroy.push(()=>Yt()),r.$$.on_destroy.push(()=>pe()),r.$$.on_destroy.push(()=>Mt()),r.$$.on_destroy.push(()=>Kt());let ze=ut("store");ie(r,ze,je=>t(36,Be=je));let Wt=ut("ephemeralStore");ie(r,Wt,je=>t(34,xe=je));let ur=ut("view"),Jt=ut("full");ie(r,Jt,je=>t(20,V=je));let cr=ut("plugin"),fn=Ze(Xe.getCalendars());ie(r,fn,je=>t(17,ue=je)),Sn("monthInFrame",Ze(null)),cr.app.workspace.on("calendarium-updated",()=>Ce(fn,ue=Xe.getCalendars(),ue));let dn=je=>{new eE.ExtraButtonComponent(je).setIcon(Dv)},In=je=>{let fr=new gn(cr);for(let Rr of Xe.getCalendars())fr.addItem(fa=>fa.setTitle(Rr.name).onClick(()=>{ur.switchCalendar(Rr.id)}).setChecked(Rr.id==te.id));fr.showAtMouseEvent(je)},$a=je=>{let fr=new gn(cr);fr.addItem(Rr=>Rr.setTitle("None").setChecked(N===La).onClick(()=>l.set(La)));for(let Rr of X)fr.addItem(fa=>{fa.setTitle(Rr.name).onClick(()=>{l.set(Rr.id)}).setChecked(N==Rr.id)});fr.showAtMouseEvent(je)},zn=je=>In(je),Vt=je=>$a(je);return r.$$.update=()=>{r.$$.dirty[1]&32&&he(t(0,n=Be)),r.$$.dirty[1]&8&&T(t(14,a=xe.displaying)),r.$$.dirty[1]&8&&zt(t(13,i=xe.displayWeeks)),r.$$.dirty[1]&8&&it(t(12,o=xe.displayingMonth)),r.$$.dirty[1]&8&&ar(t(11,s=xe.currentLocationName)),r.$$.dirty[1]&8&&j(t(4,l=xe.location)),r.$$.dirty[0]&1&&ee(t(10,u=n.locationStore)),r.$$.dirty[1]&16&&Z(t(9,c=Pe.daysAsWeeks)),r.$$.dirty[1]&16&&C(t(8,f=Pe.firstWeekNumber)),r.$$.dirty[1]&16&&ft(t(7,d=Pe.weekdays)),r.$$.dirty[1]&16&&De(t(6,h=Pe.weeks)),r.$$.dirty[1]&8&&Ue(t(5,p=xe.viewState)),r.$$.dirty[1]&8&&t(31,m=xe.ephemeralStore),r.$$.dirty[1]&1&&m.subscribe(()=>cr.app.workspace.requestSaveLayout()),r.$$.dirty[0]&2|r.$$.dirty[1]&4&&t(3,O=S?.find(je=>je.find(fr=>fr&&fr.number==k.day))??[]),r.$$.dirty[0]&2|r.$$.dirty[1]&6&&t(2,b=S?.findIndex(je=>je.find(fr=>fr&&fr.number==k.day))+E+1)},[n,k,b,O,l,p,h,d,f,c,u,s,o,i,a,X,te,ue,st,It,V,B,rt,Er,ze,Wt,Jt,fn,dn,In,$a,m,E,S,xe,Pe,Be,zn,Vt]}var Z1=class extends ae{constructor(e){super(),oe(this,e,sL,oL,re,{},rL,[-1,-1])}},tE=Z1;function lL(r){we(r,"svelte-srfyn6",".calendar-container.svelte-srfyn6{padding:0 8px 20px 8px;background:inherit;display:flex;flex-flow:column;overflow:auto;height:100%}")}function uL(r){let e,t=r[0],n,a=rE(r);return{c(){e=_("div"),a.c(),g(e,"class","calendar-container calendarium svelte-srfyn6")},m(i,o){$(i,e,o),a.m(e,null),n=!0},p(i,o){o&1&&re(t,t=i[0])?(Oe(),R(a,1,1,I),_e(),a=rE(i),a.c(),P(a,1),a.m(e,null)):a.p(i,o)},i(i){n||(P(a),n=!0)},o(i){R(a),n=!1},d(i){i&&A(e),a.d(i)}}}function cL(r){let e;return{c(){e=_("p"),e.textContent="No calendars created! Create one in settings to get started."},m(t,n){$(t,e,n)},p:I,i:I,o:I,d(t){t&&A(e)}}}function rE(r){let e,t;return e=new tE({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p:I,i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function fL(r){let e,t,n,a,i=[cL,uL],o=[];function s(l,u){return l[0]?1:0}return e=s(r,-1),t=o[e]=i[e](r),{c(){t.c(),n=He()},m(l,u){o[e].m(l,u),$(l,n,u),a=!0},p(l,[u]){let c=e;e=s(l,u),e===c?o[e].p(l,u):(Oe(),R(o[c],1,1,()=>{o[c]=null}),_e(),t=o[e],t?t.p(l,u):(t=o[e]=i[e](l),t.c()),P(t,1),t.m(n.parentNode,n))},i(l){a||(P(t),a=!0)},o(l){R(t),a=!1},d(l){l&&A(n),o[e].d(l)}}}function dL(r,e,t){let n,{store:a}=e,{plugin:i}=e,{view:o}=e,{full:s}=e;Pn("plugin",i),Pn("view",o);let l=Ze(s);return ie(r,l,u=>t(5,n=u)),Pn("full",l),r.$$set=u=>{"store"in u&&t(0,a=u.store),"plugin"in u&&t(2,i=u.plugin),"view"in u&&t(3,o=u.view),"full"in u&&t(4,s=u.full)},r.$$.update=()=>{r.$$.dirty&16&&Ce(l,n=s,n),r.$$.dirty&9&&a&&(Pn("store",Ze(a)),Pn("ephemeralStore",Ze(a.getEphemeralStore(o.id))))},[a,l,i,o,s]}var q1=class extends ae{constructor(e){super(),oe(this,e,dL,fL,re,{store:0,plugin:2,view:3,full:4},lL)}},Kd=q1;(0,vo.addIcon)(Nr.Calendarium,'');(0,vo.addIcon)(Nr.Agenda,'');var bo=class extends vo.ItemView{constructor(t,n){super(t);this.leaf=t;this.plugin=n;this.id=Le(12)}get full(){let t=this.app.workspace.rootSplit;return this.leaf.getRoot()===t}async display(){this.calendar||(this.calendar=this.plugin.defaultCalendar?.id),this.store=this.plugin.getStore(this.calendar),this.store,this.ui=new Kd({target:this.contentEl,props:{view:this,plugin:this.plugin,store:this.store,full:this.full}}),this.plugin.registerEvent(this.app.workspace.on("layout-change",()=>this.ui.$set({full:this.full}))),this.plugin.registerEvent(this.app.workspace.on("calendarium-updated",()=>{this.plugin.hasCalendar(this.calendar)||(this.calendar=this.plugin.defaultCalendar?.id),this.store=this.plugin.getStore(this.calendar),this.ui.$set({store:this.store})}))}switchCalendar(t){let n=this.plugin.getStore(t);if(!n)throw new vo.Notice("There was an issue opening that calendar."),new Error("Could not find a calendar by that name");this.store=n,this.calendar=t,this.ui.$set({store:this.store}),this.plugin.app.workspace.requestSaveLayout(),this.plugin.app.workspace.trigger("calendarium:view-parent:change-calendar",{parent:this.id,calendar:t})}async setState(t,n){t&&Object.keys(t).length&&(this.store=this.plugin.getStore(t.calendar),this.calendar=t.calendar,this.id=t.id,this.store&&this.store.getEphemeralStore(this.id).initializeFromState(t.ephemeral)),this.ui||this.plugin.onSettingsLoaded(()=>this.display()),this.id||(this.id=Le(12)),super.setState(t,n)}getState(){let t=this.store?.getStoreState(this.id);if(!t)return;let n={...t,id:this.id};return this.child&&(n.child=this.child),n}getViewType(){return Nr.Calendarium}getDisplayText(){return"Calendarium"}getIcon(){return Nr.Calendarium}};var Cn=require("obsidian");function L1(r){let e=new Blob([r],{type:"text/javascript"}),t=URL.createObjectURL(e),n=new Worker(t,{name:"Calendarium File Watcher"});return URL.revokeObjectURL(t),n}function B1(){return L1(`var on=Object.create;var Ve=Object.defineProperty,un=Object.defineProperties,ln=Object.getOwnPropertyDescriptor,cn=Object.getOwnPropertyDescriptors,fn=Object.getOwnPropertyNames,ct=Object.getOwnPropertySymbols,pn=Object.getPrototypeOf,pt=Object.prototype.hasOwnProperty,mn=Object.prototype.propertyIsEnumerable;var ft=(t,e,n)=>e in t?Ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ye=(t,e)=>{for(var n in e||(e={}))pt.call(e,n)&&ft(t,n,e[n]);if(ct)for(var n of ct(e))mn.call(e,n)&&ft(t,n,e[n]);return t},mt=(t,e)=>un(t,cn(e));var Z=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var gn=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of fn(e))!pt.call(t,a)&&a!==n&&Ve(t,a,{get:()=>e[a],enumerable:!(r=ln(e,a))||r.enumerable});return t};var je=(t,e,n)=>(n=t!=null?on(pn(t)):{},gn(e||!t||!t.__esModule?Ve(n,"default",{value:t,enumerable:!0}):n,t));var hn=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var gt=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)};var Se=(t,e,n)=>(hn(t,e,"access private method"),n);var vt=Z(dt=>{dt.entityMap={lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\\xC0",Aacute:"\\xC1",Acirc:"\\xC2",Atilde:"\\xC3",Auml:"\\xC4",Aring:"\\xC5",AElig:"\\xC6",Ccedil:"\\xC7",Egrave:"\\xC8",Eacute:"\\xC9",Ecirc:"\\xCA",Euml:"\\xCB",Igrave:"\\xCC",Iacute:"\\xCD",Icirc:"\\xCE",Iuml:"\\xCF",ETH:"\\xD0",Ntilde:"\\xD1",Ograve:"\\xD2",Oacute:"\\xD3",Ocirc:"\\xD4",Otilde:"\\xD5",Ouml:"\\xD6",Oslash:"\\xD8",Ugrave:"\\xD9",Uacute:"\\xDA",Ucirc:"\\xDB",Uuml:"\\xDC",Yacute:"\\xDD",THORN:"\\xDE",szlig:"\\xDF",agrave:"\\xE0",aacute:"\\xE1",acirc:"\\xE2",atilde:"\\xE3",auml:"\\xE4",aring:"\\xE5",aelig:"\\xE6",ccedil:"\\xE7",egrave:"\\xE8",eacute:"\\xE9",ecirc:"\\xEA",euml:"\\xEB",igrave:"\\xEC",iacute:"\\xED",icirc:"\\xEE",iuml:"\\xEF",eth:"\\xF0",ntilde:"\\xF1",ograve:"\\xF2",oacute:"\\xF3",ocirc:"\\xF4",otilde:"\\xF5",ouml:"\\xF6",oslash:"\\xF8",ugrave:"\\xF9",uacute:"\\xFA",ucirc:"\\xFB",uuml:"\\xFC",yacute:"\\xFD",thorn:"\\xFE",yuml:"\\xFF",nbsp:"\\xA0",iexcl:"\\xA1",cent:"\\xA2",pound:"\\xA3",curren:"\\xA4",yen:"\\xA5",brvbar:"\\xA6",sect:"\\xA7",uml:"\\xA8",copy:"\\xA9",ordf:"\\xAA",laquo:"\\xAB",not:"\\xAC",shy:"\\xAD\\xAD",reg:"\\xAE",macr:"\\xAF",deg:"\\xB0",plusmn:"\\xB1",sup2:"\\xB2",sup3:"\\xB3",acute:"\\xB4",micro:"\\xB5",para:"\\xB6",middot:"\\xB7",cedil:"\\xB8",sup1:"\\xB9",ordm:"\\xBA",raquo:"\\xBB",frac14:"\\xBC",frac12:"\\xBD",frac34:"\\xBE",iquest:"\\xBF",times:"\\xD7",divide:"\\xF7",forall:"\\u2200",part:"\\u2202",exist:"\\u2203",empty:"\\u2205",nabla:"\\u2207",isin:"\\u2208",notin:"\\u2209",ni:"\\u220B",prod:"\\u220F",sum:"\\u2211",minus:"\\u2212",lowast:"\\u2217",radic:"\\u221A",prop:"\\u221D",infin:"\\u221E",ang:"\\u2220",and:"\\u2227",or:"\\u2228",cap:"\\u2229",cup:"\\u222A",int:"\\u222B",there4:"\\u2234",sim:"\\u223C",cong:"\\u2245",asymp:"\\u2248",ne:"\\u2260",equiv:"\\u2261",le:"\\u2264",ge:"\\u2265",sub:"\\u2282",sup:"\\u2283",nsub:"\\u2284",sube:"\\u2286",supe:"\\u2287",oplus:"\\u2295",otimes:"\\u2297",perp:"\\u22A5",sdot:"\\u22C5",Alpha:"\\u0391",Beta:"\\u0392",Gamma:"\\u0393",Delta:"\\u0394",Epsilon:"\\u0395",Zeta:"\\u0396",Eta:"\\u0397",Theta:"\\u0398",Iota:"\\u0399",Kappa:"\\u039A",Lambda:"\\u039B",Mu:"\\u039C",Nu:"\\u039D",Xi:"\\u039E",Omicron:"\\u039F",Pi:"\\u03A0",Rho:"\\u03A1",Sigma:"\\u03A3",Tau:"\\u03A4",Upsilon:"\\u03A5",Phi:"\\u03A6",Chi:"\\u03A7",Psi:"\\u03A8",Omega:"\\u03A9",alpha:"\\u03B1",beta:"\\u03B2",gamma:"\\u03B3",delta:"\\u03B4",epsilon:"\\u03B5",zeta:"\\u03B6",eta:"\\u03B7",theta:"\\u03B8",iota:"\\u03B9",kappa:"\\u03BA",lambda:"\\u03BB",mu:"\\u03BC",nu:"\\u03BD",xi:"\\u03BE",omicron:"\\u03BF",pi:"\\u03C0",rho:"\\u03C1",sigmaf:"\\u03C2",sigma:"\\u03C3",tau:"\\u03C4",upsilon:"\\u03C5",phi:"\\u03C6",chi:"\\u03C7",psi:"\\u03C8",omega:"\\u03C9",thetasym:"\\u03D1",upsih:"\\u03D2",piv:"\\u03D6",OElig:"\\u0152",oelig:"\\u0153",Scaron:"\\u0160",scaron:"\\u0161",Yuml:"\\u0178",fnof:"\\u0192",circ:"\\u02C6",tilde:"\\u02DC",ensp:"\\u2002",emsp:"\\u2003",thinsp:"\\u2009",zwnj:"\\u200C",zwj:"\\u200D",lrm:"\\u200E",rlm:"\\u200F",ndash:"\\u2013",mdash:"\\u2014",lsquo:"\\u2018",rsquo:"\\u2019",sbquo:"\\u201A",ldquo:"\\u201C",rdquo:"\\u201D",bdquo:"\\u201E",dagger:"\\u2020",Dagger:"\\u2021",bull:"\\u2022",hellip:"\\u2026",permil:"\\u2030",prime:"\\u2032",Prime:"\\u2033",lsaquo:"\\u2039",rsaquo:"\\u203A",oline:"\\u203E",euro:"\\u20AC",trade:"\\u2122",larr:"\\u2190",uarr:"\\u2191",rarr:"\\u2192",darr:"\\u2193",harr:"\\u2194",crarr:"\\u21B5",lceil:"\\u2308",rceil:"\\u2309",lfloor:"\\u230A",rfloor:"\\u230B",loz:"\\u25CA",spades:"\\u2660",clubs:"\\u2663",hearts:"\\u2665",diams:"\\u2666"}});var Tt=Z(Ke=>{var ze=/[A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/,yt=new RegExp("[\\\\-\\\\.0-9"+ze.source.slice(1,-1)+"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]"),Et=new RegExp("^"+ze.source+yt.source+"*(?::"+ze.source+yt.source+"*)?$"),ce=0,H=1,J=2,fe=3,ee=4,te=5,pe=6,Me=7;function ne(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,ne)}ne.prototype=new Error;ne.prototype.name=ne.name;function Nt(){}Nt.prototype={parse:function(t,e,n){var r=this.domBuilder;r.startDocument(),Ct(e,e={}),dn(t,e,n,r,this.errorHandler),r.endDocument()}};function dn(t,e,n,r,a){function i(C){if(C>65535){C-=65536;var O=55296+(C>>10),sn=56320+(C&1023);return String.fromCharCode(O,sn)}else return String.fromCharCode(C)}function s(C){var O=C.slice(1,-1);return O in n?n[O]:O.charAt(0)==="#"?i(parseInt(O.substr(1).replace("x","0x"))):(a.error("entity not found:"+C),C)}function u(C){if(C>S){var O=t.substring(S,C).replace(/&#?\\w+;/g,s);E&&l(S),r.characters(O,0,C-S),S=C}}function l(C,O){for(;C>=m&&(O=d.exec(t));)c=O.index,m=c+O[0].length,E.lineNumber++;E.columnNumber=C-c+1}for(var c=0,m=0,d=/.*(?:\\r\\n?|\\n)|.*$/g,E=r.locator,T=[{currentNSMap:e}],D={},S=0;;){try{var b=t.indexOf("<",S);if(b<0){if(!t.substr(S).match(/^\\s*$/)){var j=r.doc,K=j.createTextNode(t.substr(S));j.appendChild(K),r.currentElement=K}return}switch(b>S&&u(b),t.charAt(b+1)){case"/":var v=t.indexOf(">",b+3),R=t.substring(b+2,v),k=T.pop();v<0?(R=t.substring(b+2).replace(/[\\s<].*/,""),a.error("end tag name: "+R+" is not complete:"+k.tagName),v=b+1+R.length):R.match(/\\sS?S=v:u(Math.max(b,S)+1)}}function bt(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function vn(t,e,n,r,a,i){function s(T,D,S){T in n.attributeNames&&i.fatalError("Attribute "+T+" redefined"),n.addValue(T,D,S)}for(var u,l,c=++e,m=ce;;){var d=t.charAt(c);switch(d){case"=":if(m===H)u=t.slice(e,c),m=fe;else if(m===J)m=fe;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(m===fe||m===H)if(m===H&&(i.warning('attribute value must after "="'),u=t.slice(e,c)),e=c+1,c=t.indexOf(d,e),c>0)l=t.slice(e,c).replace(/&#?\\w+;/g,a),s(u,l,e-1),m=te;else throw new Error("attribute value no end '"+d+"' match");else if(m==ee)l=t.slice(e,c).replace(/&#?\\w+;/g,a),s(u,l,e),i.warning('attribute "'+u+'" missed start quot('+d+")!!"),e=c+1,m=te;else throw new Error('attribute value must after "="');break;case"/":switch(m){case ce:n.setTagName(t.slice(e,c));case te:case pe:case Me:m=Me,n.closed=!0;case ee:case H:case J:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),m==ce&&n.setTagName(t.slice(e,c)),c;case">":switch(m){case ce:n.setTagName(t.slice(e,c));case te:case pe:case Me:break;case ee:case H:l=t.slice(e,c),l.slice(-1)==="/"&&(n.closed=!0,l=l.slice(0,-1));case J:m===J&&(l=u),m==ee?(i.warning('attribute "'+l+'" missed quot(")!'),s(u,l.replace(/&#?\\w+;/g,a),e)):((r[""]!=="http://www.w3.org/1999/xhtml"||!l.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),s(l,l,e));break;case fe:throw new Error("attribute value missed!!")}return c;case"\\x80":d=" ";default:if(d<=" ")switch(m){case ce:n.setTagName(t.slice(e,c)),m=pe;break;case H:u=t.slice(e,c),m=J;break;case ee:var l=t.slice(e,c).replace(/&#?\\w+;/g,a);i.warning('attribute "'+l+'" missed quot(")!!'),s(u,l,e);case te:m=pe;break}else switch(m){case J:var E=n.tagName;(r[""]!=="http://www.w3.org/1999/xhtml"||!u.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+u+'" missed value!! "'+u+'" instead2!!'),s(u,u,e),e=c,m=H;break;case te:i.warning('attribute space is required"'+u+'"!!');case pe:m=H,e=c;break;case fe:m=ee,e=c;break;case Me:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function Dt(t,e,n){for(var r=t.tagName,a=null,d=t.length;d--;){var i=t[d],s=i.qName,u=i.value,E=s.indexOf(":");if(E>0)var l=i.prefix=s.slice(0,E),c=s.slice(E+1),m=l==="xmlns"&&c;else c=s,l=null,m=s==="xmlns"&&"";i.localName=c,m!==!1&&(a==null&&(a={},Ct(n,n={})),n[m]=a[m]=u,i.uri="http://www.w3.org/2000/xmlns/",e.startPrefixMapping(m,u))}for(var d=t.length;d--;){i=t[d];var l=i.prefix;l&&(l==="xml"&&(i.uri="http://www.w3.org/XML/1998/namespace"),l!=="xmlns"&&(i.uri=n[l||""]))}var E=r.indexOf(":");E>0?(l=t.prefix=r.slice(0,E),c=t.localName=r.slice(E+1)):(l=null,c=t.localName=r);var T=t.uri=n[l||""];if(e.startElement(T,c,r,t),t.closed){if(e.endElement(T,c,r),a)for(l in a)e.endPrefixMapping(l)}else return t.currentNSMap=n,t.localNSMap=a,!0}function yn(t,e,n,r,a){if(/^(?:script|textarea)$/i.test(n)){var i=t.indexOf("",e),s=t.substring(e+1,i);if(/[&<]/.test(s))return/^script$/i.test(n)?(a.characters(s,0,s.length),i):(s=s.replace(/&#?\\w+;/g,r),a.characters(s,0,s.length),i)}return e+1}function En(t,e,n,r){var a=r[n];return a==null&&(a=t.lastIndexOf(""),a",e+4);return i>e?(n.comment(t,e+4,i-e-4),i+3):(r.error("Unclosed comment"),-1)}else return-1;default:if(t.substr(e+3,6)=="CDATA["){var i=t.indexOf("]]>",e+9);return n.startCDATA(),n.characters(t,e+9,i-e-9),n.endCDATA(),i+3}var s=Nn(t,e),u=s.length;if(u>1&&/!doctype/i.test(s[0][0])){var l=s[1][0],c=!1,m=!1;u>3&&(/^public$/i.test(s[2][0])?(c=s[3][0],m=u>4&&s[4][0]):/^system$/i.test(s[2][0])&&(m=s[3][0]));var d=s[u-1];return n.startDTD(l,c,m),n.endDTD(),d.index+d[0].length}}return-1}function Dn(t,e,n){var r=t.indexOf("?>",e);if(r){var a=t.substring(e,r).match(/^<\\?(\\S*)\\s*([\\s\\S]*?)\\s*$/);if(a){var i=a[0].length;return n.processingInstruction(a[1],a[2]),r+2}else return-1}return-1}function wt(){this.attributeNames={}}wt.prototype={setTagName:function(t){if(!Et.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,n){if(!Et.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:n}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}};function Nn(t,e){var n,r=[],a=/'[^']+'|"[^"]+"|[^\\s<>\\/=]+=?|(\\/?\\s*>|<)/g;for(a.lastIndex=e,a.exec(t);n=a.exec(t);)if(r.push(n),n[1])return r}Ke.XMLReader=Nt;Ke.ParseError=ne});var ot=Z(ve=>{function ge(t,e){for(var n in t)e[n]=t[n]}function I(t,e){var n=t.prototype;if(!(n instanceof e)){let a=function(){};var r=a;a.prototype=e.prototype,a=new a,ge(n,a),t.prototype=n=a}n.constructor!=t&&(typeof t!="function"&&console.error("unknow Class:"+t),n.constructor=t)}var Cn="http://www.w3.org/1999/xhtml",L={},P=L.ELEMENT_NODE=1,ae=L.ATTRIBUTE_NODE=2,xe=L.TEXT_NODE=3,Rt=L.CDATA_SECTION_NODE=4,Ot=L.ENTITY_REFERENCE_NODE=5,wn=L.ENTITY_NODE=6,It=L.PROCESSING_INSTRUCTION_NODE=7,Lt=L.COMMENT_NODE=8,Ft=L.DOCUMENT_NODE=9,$t=L.DOCUMENT_TYPE_NODE=10,V=L.DOCUMENT_FRAGMENT_NODE=11,Tn=L.NOTATION_NODE=12,x={},M={},rr=x.INDEX_SIZE_ERR=(M[1]="Index size error",1),ar=x.DOMSTRING_SIZE_ERR=(M[2]="DOMString size error",2),Sn=x.HIERARCHY_REQUEST_ERR=(M[3]="Hierarchy request error",3),ir=x.WRONG_DOCUMENT_ERR=(M[4]="Wrong document",4),sr=x.INVALID_CHARACTER_ERR=(M[5]="Invalid character",5),or=x.NO_DATA_ALLOWED_ERR=(M[6]="No data allowed",6),ur=x.NO_MODIFICATION_ALLOWED_ERR=(M[7]="No modification allowed",7),Mn=x.NOT_FOUND_ERR=(M[8]="Not found",8),lr=x.NOT_SUPPORTED_ERR=(M[9]="Not supported",9),St=x.INUSE_ATTRIBUTE_ERR=(M[10]="Attribute in use",10),cr=x.INVALID_STATE_ERR=(M[11]="Invalid state",11),fr=x.SYNTAX_ERR=(M[12]="Syntax error",12),pr=x.INVALID_MODIFICATION_ERR=(M[13]="Invalid modification",13),mr=x.NAMESPACE_ERR=(M[14]="Invalid namespace",14),gr=x.INVALID_ACCESS_ERR=(M[15]="Invalid access",15);function z(t,e){if(e instanceof Error)var n=e;else n=this,Error.call(this,M[t]),this.message=M[t],Error.captureStackTrace&&Error.captureStackTrace(this,z);return n.code=t,e&&(this.message=this.message+": "+e),n}z.prototype=Error.prototype;ge(x,z);function X(){}X.prototype={length:0,item:function(t){return this[t]||null},toString:function(t,e){for(var n=[],r=0;r=0){for(var a=e.length-1;r0},lookupPrefix:function(t){for(var e=this;e;){var n=e._nsMap;if(n){for(var r in n)if(n[r]==t)return r}e=e.nodeType==ae?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var n=e._nsMap;if(n&&t in n)return n[t];e=e.nodeType==ae?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return e==null}};function At(t){return t=="<"&&"<"||t==">"&&">"||t=="&"&&"&"||t=='"'&&"""||"&#"+t.charCodeAt()+";"}ge(L,A);ge(L,A.prototype);function me(t,e){if(e(t))return!0;if(t=t.firstChild)do if(me(t,e))return!0;while(t=t.nextSibling)}function he(){}function xn(t,e,n){t&&t._inc++;var r=n.namespaceURI;r=="http://www.w3.org/2000/xmlns/"&&(e._nsMap[n.prefix?n.localName:""]=n.value)}function kt(t,e,n,r){t&&t._inc++;var a=n.namespaceURI;a=="http://www.w3.org/2000/xmlns/"&&delete e._nsMap[n.prefix?n.localName:""]}function et(t,e,n){if(t&&t._inc){t._inc++;var r=e.childNodes;if(n)r[r.length++]=n;else{for(var a=e.firstChild,i=0;a;)r[i++]=a,a=a.nextSibling;r.length=i}}}function Pt(t,e){var n=e.previousSibling,r=e.nextSibling;return n?n.nextSibling=r:t.firstChild=r,r?r.previousSibling=n:t.lastChild=n,et(t.ownerDocument,t),e}function qt(t,e,n){var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===V){var a=e.firstChild;if(a==null)return e;var i=e.lastChild}else a=i=e;var s=n?n.previousSibling:t.lastChild;a.previousSibling=s,i.nextSibling=n,s?s.nextSibling=a:t.firstChild=a,n==null?t.lastChild=i:n.previousSibling=i;do a.parentNode=t;while(a!==i&&(a=a.nextSibling));return et(t.ownerDocument||t,t),e.nodeType==V&&(e.firstChild=e.lastChild=null),e}function An(t,e){var n=e.parentNode;if(n){var r=t.lastChild;n.removeChild(e);var r=t.lastChild}var r=t.lastChild;return e.parentNode=t,e.previousSibling=r,e.nextSibling=null,r?r.nextSibling=e:t.firstChild=e,t.lastChild=e,et(t.ownerDocument,t,e),e}he.prototype={nodeName:"#document",nodeType:Ft,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==V){for(var n=t.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,e),n=r}return t}return this.documentElement==null&&t.nodeType==P&&(this.documentElement=t),qt(this,t,e),t.ownerDocument=this,t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),Pt(this,t)},importNode:function(t,e){return jt(this,t,e)},getElementById:function(t){var e=null;return me(this.documentElement,function(n){if(n.nodeType==P&&n.getAttribute("id")==t)return e=n,!0}),e},getElementsByClassName:function(t){var e=new RegExp("(^|\\\\s)"+t+"(\\\\s|$)");return new ie(this,function(n){var r=[];return me(n.documentElement,function(a){a!==n&&a.nodeType==P&&e.test(a.getAttribute("class"))&&r.push(a)}),r})},createElement:function(t){var e=new se;e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.childNodes=new X;var n=e.attributes=new Ae;return n._ownerElement=e,e},createDocumentFragment:function(){var t=new Re;return t.ownerDocument=this,t.childNodes=new X,t},createTextNode:function(t){var e=new tt;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new nt;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new rt;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var n=new st;return n.ownerDocument=this,n.tagName=n.target=t,n.nodeValue=n.data=e,n},createAttribute:function(t){var e=new _e;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new it;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var n=new se,r=e.split(":"),a=n.attributes=new Ae;return n.childNodes=new X,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=e,a._ownerElement=n,n},createAttributeNS:function(t,e){var n=new _e,r=e.split(":");return n.ownerDocument=this,n.nodeName=e,n.name=e,n.namespaceURI=t,n.specified=!0,r.length==2?(n.prefix=r[0],n.localName=r[1]):n.localName=e,n}};I(he,A);function se(){this._nsMap={}}se.prototype={nodeType:P,hasAttribute:function(t){return this.getAttributeNode(t)!=null},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var n=this.ownerDocument.createAttribute(t);n.value=n.nodeValue=""+e,this.setAttributeNode(n)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===V?this.insertBefore(t,null):An(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);n&&this.removeAttributeNode(n)},hasAttributeNS:function(t,e){return this.getAttributeNodeNS(t,e)!=null},getAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);return n&&n.value||""},setAttributeNS:function(t,e,n){var r=this.ownerDocument.createAttributeNS(t,e);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new ie(this,function(e){var n=[];return me(e,function(r){r!==e&&r.nodeType==P&&(t==="*"||r.tagName==t)&&n.push(r)}),n})},getElementsByTagNameNS:function(t,e){return new ie(this,function(n){var r=[];return me(n,function(a){a!==n&&a.nodeType===P&&(t==="*"||a.namespaceURI===t)&&(e==="*"||a.localName==e)&&r.push(a)}),r})}};he.prototype.getElementsByTagName=se.prototype.getElementsByTagName;he.prototype.getElementsByTagNameNS=se.prototype.getElementsByTagNameNS;I(se,A);function _e(){}_e.prototype.nodeType=ae;I(_e,A);function de(){}de.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(M[Sn])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,n){var r=this.data.substring(0,t),a=this.data.substring(t+e);n=r+n+a,this.nodeValue=this.data=n,this.length=n.length}};I(de,A);function tt(){}tt.prototype={nodeName:"#text",nodeType:xe,splitText:function(t){var e=this.data,n=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}};I(tt,de);function nt(){}nt.prototype={nodeName:"#comment",nodeType:Lt};I(nt,de);function rt(){}rt.prototype={nodeName:"#cdata-section",nodeType:Rt};I(rt,de);function at(){}at.prototype.nodeType=$t;I(at,A);function Bt(){}Bt.prototype.nodeType=Tn;I(Bt,A);function Zt(){}Zt.prototype.nodeType=wn;I(Zt,A);function it(){}it.prototype.nodeType=Ot;I(it,A);function Re(){}Re.prototype.nodeName="#document-fragment";Re.prototype.nodeType=V;I(Re,A);function st(){}st.prototype.nodeType=It;I(st,A);function Vt(){}Vt.prototype.serializeToString=function(t,e,n){return Yt.call(t,e,n)};A.prototype.toString=Yt;function Yt(t,e){var n=[],r=this.nodeType==9&&this.documentElement||this,a=r.prefix,i=r.namespaceURI;if(i&&a==null){var a=r.lookupPrefix(i);if(a==null)var s=[{namespace:i,prefix:null}]}return re(this,n,t,e,s),n.join("")}function _t(t,e,n){var r=t.prefix||"",a=t.namespaceURI;if(!r&&!a||r==="xml"&&a==="http://www.w3.org/XML/1998/namespace"||a=="http://www.w3.org/2000/xmlns/")return!1;for(var i=n.length;i--;){var s=n[i];if(s.prefix==r)return s.namespace!=a}return!0}function re(t,e,n,r,a){if(r)if(t=r(t),t){if(typeof t=="string"){e.push(t);return}}else return;switch(t.nodeType){case P:a||(a=[]);var i=a.length,s=t.attributes,u=s.length,D=t.firstChild,l=t.tagName;n=Cn===t.namespaceURI||n,e.push("<",l);for(var c=0;c"),n&&/^script$/i.test(l))for(;D;)D.data?e.push(D.data):re(D,e,n,r,a),D=D.nextSibling;else for(;D;)re(D,e,n,r,a),D=D.nextSibling;e.push("")}else e.push("/>");return;case Ft:case V:for(var D=t.firstChild;D;)re(D,e,n,r,a),D=D.nextSibling;return;case ae:return e.push(" ",t.name,'="',t.value.replace(/[<&"]/g,At),'"');case xe:return e.push(t.data.replace(/[<&]/g,At).replace(/]]>/g,"]]>"));case Rt:return e.push("");case Lt:return e.push("");case $t:var S=t.publicId,b=t.systemId;if(e.push("");else if(b&&b!=".")e.push(" SYSTEM ",b,">");else{var j=t.internalSubset;j&&e.push(" [",j,"]"),e.push(">")}return;case It:return e.push("");case Ot:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function jt(t,e,n){var r;switch(e.nodeType){case P:r=e.cloneNode(!1),r.ownerDocument=t;case V:break;case ae:n=!0;break}if(r||(r=e.cloneNode(!1)),r.ownerDocument=t,r.parentNode=null,n)for(var a=e.firstChild;a;)r.appendChild(jt(t,a,n)),a=a.nextSibling;return r}function Qe(t,e,n){var r=new e.constructor;for(var a in e){var i=e[a];typeof i!="object"&&i!=r[a]&&(r[a]=i)}switch(e.childNodes&&(r.childNodes=new X),r.ownerDocument=t,r.nodeType){case P:var s=e.attributes,u=r.attributes=new Ae,l=s.length;u._ownerElement=r;for(var c=0;c{function Xt(t){this.options=t||{locator:{}}}Xt.prototype.parseFromString=function(t,e){var n=this.options,r=new In,a=n.domBuilder||new ye,i=n.errorHandler,s=n.locator,u=n.xmlns||{},l=/\\/x?html?$/.test(e),c=l?On.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return s&&a.setDocumentLocator(s),r.errorHandler=Rn(i,a,s),r.domBuilder=n.domBuilder||a,l&&(u[""]="http://www.w3.org/1999/xhtml"),u.xml=u.xml||"http://www.w3.org/XML/1998/namespace",t&&typeof t=="string"?r.parse(t,u,c):r.errorHandler.error("invalid doc source"),a.doc};function Rn(t,e,n){if(!t){if(e instanceof ye)return e;t=e}var r={},a=t instanceof Function;n=n||{};function i(s){var u=t[s];!u&&a&&(u=t.length==2?function(l){t(s,l)}:t),r[s]=u&&function(l){u("[xmldom "+s+"] "+l+ut(n))}||function(){}}return i("warning"),i("error"),i("fatalError"),r}function ye(){this.cdata=!1}function oe(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}ye.prototype={startDocument:function(){this.doc=new Fn().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,n,r){var a=this.doc,i=a.createElementNS(t,n||e),s=r.length;Oe(this,i),this.currentElement=i,this.locator&&oe(this.locator,i);for(var u=0;u=e+n||e?new java.lang.String(t,e,n)+"":t}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\\w+/g,function(t){ye.prototype[t]=function(){return null}});function Oe(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}var On=vt(),zt=Tt(),In=zt.XMLReader,Ln=zt.ParseError,Fn=Ee.DOMImplementation=ot().DOMImplementation;Ee.XMLSerializer=ot().XMLSerializer;Ee.DOMParser=Xt;Ee.__DOMHandler=ye});var Ie=Z(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.isNone=F.isSome=F.None=F.Some=F.OptionType=void 0;F.OptionType={Some:Symbol(":some"),None:Symbol(":none")};function $n(t){return typeof t=="undefined"?be():Qt(t)}F.Some=$n;F.None=be();function Qt(t){return{type:F.OptionType.Some,isSome(){return!0},isNone(){return!1},match(e){return e.some(t)},map(e){return Qt(e(t))},andThen(e){return e(t)},or(e){return this},and(e){return e},unwrapOr(e){return t},unwrap(){return t}}}function be(){return{type:F.OptionType.None,isSome(){return!1},isNone(){return!0},match(t){let{none:e}=t;return typeof e=="function"?e():e},map(t){return be()},andThen(t){return be()},or(t){return t},and(t){return be()},unwrapOr(t){if(t==null)throw new Error("Cannot call unwrapOr with a missing value.");return t},unwrap(){throw new ReferenceError("Trying to unwrap None.")}}}function Wn(t){return t.isSome()}F.isSome=Wn;function Un(t){return t.isNone()}F.isNone=Un});var Jt=Z($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.isRight=$.isLeft=$.Right=$.Left=$.EitherType=void 0;var Le=Ie();$.EitherType={Left:Symbol(":left"),Right:Symbol(":right")};function De(t){return{type:$.EitherType.Left,isLeft(){return!0},isRight(){return!1},left(){return(0,Le.Some)(t)},leftAndThen(e){return e(t)},right(){return Le.None},rightAndThen(e){return De(t)},unwrap(){return t},unwrapLeft(){return t},unwrapLeftOr(e){return t},unwrapLeftOrElse(e){return t},unwrapRight(){throw new ReferenceError("Cannot unwrap Right value of Either.Left")},unwrapRightOr(e){return e},unwrapRightOrElse(e){return e(t)},match(e){return e.left(t)},map(e){return De(e(t))},mapLeft(e){return De(e(t))},mapRight(e){return De(t)}}}$.Left=De;function Ne(t){return{type:$.EitherType.Right,isLeft(){return!1},isRight(){return!0},left(){return Le.None},leftAndThen(e){return Ne(t)},right(){return(0,Le.Some)(t)},rightAndThen(e){return e(t)},unwrap(){return t},unwrapLeft(){throw new ReferenceError("Cannot unwrap Left value of Either.Right")},unwrapLeftOr(e){return e},unwrapLeftOrElse(e){return e(t)},unwrapRight(){return t},unwrapRightOr(e){return t},unwrapRightOrElse(e){return t},match(e){return e.right(t)},map(e){return Ne(e(t))},mapLeft(e){return Ne(t)},mapRight(e){return Ne(e(t))}}}$.Right=Ne;function kn(t){return t.isLeft()}$.isLeft=kn;function Pn(t){return t.isRight()}$.isRight=Pn});var en=Z(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.isErr=W.isOk=W.Err=W.Ok=W.ResultType=void 0;var We=Ie();W.ResultType={Ok:Symbol(":ok"),Err:Symbol(":err")};function Fe(t){return{type:W.ResultType.Ok,isOk(){return!0},isErr(){return!1},ok(){return(0,We.Some)(t)},err(){return We.None},unwrap(){return t},unwrapOr(e){return t},unwrapOrElse(e){return t},unwrapErr(){throw new ReferenceError("Cannot unwrap Err value of Result.Ok")},match(e){return e.ok(t)},map(e){return Fe(e(t))},mapErr(e){return Fe(t)},andThen(e){return e(t)},orElse(e){return Fe(t)}}}W.Ok=Fe;function $e(t){return{type:W.ResultType.Err,isOk(){return!1},isErr(){return!0},ok(){return We.None},err(){return(0,We.Some)(t)},unwrap(){throw new ReferenceError("Cannot unwrap Ok value of Result.Err")},unwrapOr(e){return e},unwrapOrElse(e){return e(t)},unwrapErr(){return t},match(e){return e.err(t)},map(e){return $e(t)},mapErr(e){return $e(e(t))},andThen(e){return $e(t)},orElse(e){return e(t)}}}W.Err=$e;function qn(t){return t.isOk()}W.isOk=qn;function Bn(t){return t.isErr()}W.isErr=Bn});var tn=Z(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.Ok=w.isOk=w.isErr=w.Err=w.Some=w.None=w.isSome=w.isNone=w.Right=w.Left=w.isRight=w.isLeft=void 0;var Ue=Jt();Object.defineProperty(w,"isLeft",{enumerable:!0,get:function(){return Ue.isLeft}});Object.defineProperty(w,"isRight",{enumerable:!0,get:function(){return Ue.isRight}});Object.defineProperty(w,"Left",{enumerable:!0,get:function(){return Ue.Left}});Object.defineProperty(w,"Right",{enumerable:!0,get:function(){return Ue.Right}});var ke=Ie();Object.defineProperty(w,"isNone",{enumerable:!0,get:function(){return ke.isNone}});Object.defineProperty(w,"isSome",{enumerable:!0,get:function(){return ke.isSome}});Object.defineProperty(w,"None",{enumerable:!0,get:function(){return ke.None}});Object.defineProperty(w,"Some",{enumerable:!0,get:function(){return ke.Some}});var Pe=en();Object.defineProperty(w,"Err",{enumerable:!0,get:function(){return Pe.Err}});Object.defineProperty(w,"isErr",{enumerable:!0,get:function(){return Pe.isErr}});Object.defineProperty(w,"isOk",{enumerable:!0,get:function(){return Pe.isOk}});Object.defineProperty(w,"Ok",{enumerable:!0,get:function(){return Pe.Ok}})});var nn=Z((Ce,we)=>{(function(t,e){if(typeof Ce=="object"){var n=e();typeof we=="object"&&we&&we.exports&&(Ce=we.exports=n),Ce.randomColor=n}else typeof define=="function"&&define.amd?define([],e):t.randomColor=e()})(Ce,function(){var t=null,e={};S();var n=[],r=function(o){if(o=o||{},o.seed!==void 0&&o.seed!==null&&o.seed===parseInt(o.seed,10))t=o.seed;else if(typeof o.seed=="string")t=R(o.seed);else{if(o.seed!==void 0&&o.seed!==null)throw new TypeError("The seed value must be an integer or string");t=null}var p,f,h;if(o.count!==null&&o.count!==void 0){for(var g=o.count,N=[],v=0;vN.length;){var q=r(o);t!==null&&(o.seed=t),N.push(q)}return o.count=g,N}return p=a(o),f=i(p,o),h=s(p,f,o),u([p,f,h],o)};function a(o){if(n.length>0){var p=k(o.hue),f=E(p),h=(p[1]-p[0])/n.length,g=parseInt((f-p[0])/h);n[g]===!0?g=(g+2)%n.length:n[g]=!0;var N=(p[0]+g*h)%359,v=(p[0]+(g+1)*h)%359;return p=[N,v],f=E(p),f<0&&(f=360+f),f}else{var p=c(o.hue);return f=E(p),f<0&&(f=360+f),f}}function i(o,p){if(p.hue==="monochrome")return 0;if(p.luminosity==="random")return E([0,100]);var f=m(o),h=f[0],g=f[1];switch(p.luminosity){case"bright":h=55;break;case"dark":h=g-10;break;case"light":g=55;break}return E([h,g])}function s(o,p,f){var h=l(o,p),g=100;switch(f.luminosity){case"dark":g=h+20;break;case"light":h=(g+h)/2;break;case"random":h=0,g=100;break}return E([h,g])}function u(o,p){switch(p.format){case"hsvArray":return o;case"hslArray":return K(o);case"hsl":var f=K(o);return"hsl("+f[0]+", "+f[1]+"%, "+f[2]+"%)";case"hsla":var h=K(o),v=p.alpha||Math.random();return"hsla("+h[0]+", "+h[1]+"%, "+h[2]+"%, "+v+")";case"rgbArray":return b(o);case"rgb":var g=b(o);return"rgb("+g.join(", ")+")";case"rgba":var N=b(o),v=p.alpha||Math.random();return"rgba("+N.join(", ")+", "+v+")";default:return T(o)}}function l(o,p){for(var f=d(o).lowerBounds,h=0;h=g&&p<=v){var G=(q-N)/(v-g),U=N-G*g;return G*p+U}}return 0}function c(o){if(typeof parseInt(o)=="number"){var p=parseInt(o);if(p<360&&p>0)return[p,p]}if(typeof o=="string"){if(e[o]){var f=e[o];if(f.hueRange)return f.hueRange}else if(o.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){var h=j(o)[0];return[h,h]}}return[0,360]}function m(o){return d(o).saturationRange}function d(o){o>=334&&o<=360&&(o-=360);for(var p in e){var f=e[p];if(f.hueRange&&o>=f.hueRange[0]&&o<=f.hueRange[1])return e[p]}return"Color not found"}function E(o){if(t===null){var p=.618033988749895,f=Math.random();return f+=p,f%=1,Math.floor(o[0]+f*(o[1]+1-o[0]))}else{var h=o[1]||1,g=o[0]||0;t=(t*9301+49297)%233280;var N=t/233280;return Math.floor(g+N*(h-g))}}function T(o){var p=b(o);function f(g){var N=g.toString(16);return N.length==1?"0"+N:N}var h="#"+f(p[0])+f(p[1])+f(p[2]);return h}function D(o,p,f){var h=f[0][0],g=f[f.length-1][0],N=f[f.length-1][1],v=f[0][1];e[o]={hueRange:p,lowerBounds:f,saturationRange:[h,g],brightnessRange:[N,v]}}function S(){D("monochrome",null,[[0,0],[100,0]]),D("red",[-26,18],[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]),D("orange",[18,46],[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]),D("yellow",[46,62],[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]),D("green",[62,178],[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]),D("blue",[178,257],[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]),D("purple",[257,282],[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]),D("pink",[282,334],[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]])}function b(o){var p=o[0];p===0&&(p=1),p===360&&(p=359),p=p/360;var f=o[1]/100,h=o[2]/100,g=Math.floor(p*6),N=p*6-g,v=h*(1-f),q=h*(1-N*f),G=h*(1-(1-N)*f),U=256,B=256,C=256;switch(g){case 0:U=h,B=G,C=v;break;case 1:U=q,B=h,C=v;break;case 2:U=v,B=h,C=G;break;case 3:U=v,B=q,C=h;break;case 4:U=G,B=v,C=h;break;case 5:U=h,B=v,C=q;break}var O=[Math.floor(U*255),Math.floor(B*255),Math.floor(C*255)];return O}function j(o){o=o.replace(/^#/,""),o=o.length===3?o.replace(/(.)/g,"$1$1"):o;var p=parseInt(o.substr(0,2),16)/255,f=parseInt(o.substr(2,2),16)/255,h=parseInt(o.substr(4,2),16)/255,g=Math.max(p,f,h),N=g-Math.min(p,f,h),v=g?N/g:0;switch(g){case p:return[60*((f-h)/N%6)||0,v,g];case f:return[60*((h-p)/N+2)||0,v,g];case h:return[60*((p-f)/N+4)||0,v,g]}}function K(o){var p=o[0],f=o[1]/100,h=o[2]/100,g=(2-f)*h;return[p,Math.round(f*h/(g<1?g:2-g)*1e4)/100,g/2*100]}function R(o){for(var p=0,f=0;f!==o.length&&!(p>=Number.MAX_SAFE_INTEGER);f++)p+=o.charCodeAt(f);return p}function k(o){if(isNaN(o)){if(typeof o=="string"){if(e[o]){var f=e[o];if(f.hueRange)return f.hueRange}else if(o.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){var h=j(o)[0];return d(h).hueRange}}}else{var p=parseInt(o);if(p<360&&p>0)return d(o).hueRange}return[0,360]}return r})});var Ge="YYYY-MM-DD";var y=["M6.5,16a9.5,9.5 0 1,0 19,0a9.5,9.5 0 1,0 -19,0","M19.79,6C22.25,7.2,25,9.92,25,16s-2.75,8.8-5.21,10a10.59,10.59,0,0,1-3.79.71A10.72,10.72,0,0,1,16,5.28,10.59,10.59,0,0,1,19.79,6Z","M19.43,5.86C21.79,7,24.5,9.7,24.5,16s-2.71,9-5.07,10.14a10.55,10.55,0,0,1-3.43.58A10.72,10.72,0,0,1,16,5.28,10.55,10.55,0,0,1,19.43,5.86Z","M17.87,5.46C20.23,6.34,24,8.88,24,16.17c0,6.85-3.33,9.36-5.69,10.29a11,11,0,0,1-2.31.26A10.72,10.72,0,0,1,16,5.28,10.49,10.49,0,0,1,17.87,5.46Z","M17.79,5.45C20,6.3,23.5,8.77,23.5,15.88c0,7.37-3.75,9.87-5.95,10.71a9.92,9.92,0,0,1-1.55.13A10.72,10.72,0,0,1,16,5.28,10.54,10.54,0,0,1,17.79,5.45Z","M17.35,5.38c1.9.79,5.15,3.25,5.15,10.72,0,7.25-3.06,9.68-5,10.5a10.87,10.87,0,0,1-1.52.12A10.72,10.72,0,0,1,16,5.28,10.1,10.1,0,0,1,17.35,5.38Z","M17.05,5.34c1.6.75,4.45,3.17,4.45,10.79,0,7.39-2.68,9.76-4.3,10.52a11.9,11.9,0,0,1-1.2.07A10.72,10.72,0,0,1,16,5.28,9,9,0,0,1,17.05,5.34Z","M16.85,5.33c1.3.74,3.65,3.12,3.65,10.67s-2.35,9.93-3.65,10.67c-.28,0-.56,0-.85,0A10.72,10.72,0,0,1,16,5.28,7.92,7.92,0,0,1,16.85,5.33Z","M16.46,5.31c.95.78,3,3.34,3,10.69s-2.09,9.91-3,10.69l-.46,0A10.72,10.72,0,0,1,16,5.28Z","M16.29,5.3c.65.8,2.21,3.48,2.21,10.78S17,25.91,16.3,26.7l-.3,0A10.72,10.72,0,0,1,16,5.28Z","M16.13,5.29c.37.89,1.37,3.92,1.37,10.79s-1,9.76-1.36,10.63H16A10.72,10.72,0,0,1,16,5.28Z","M16,5.29A85.5,85.5,0,0,1,16.5,16,85.5,85.5,0,0,1,16,26.71h0A10.72,10.72,0,0,1,16,5.28Z","M16,26.72A10.72,10.72,0,0,1,16,5.28Z","M15.5,16A85.59,85.59,0,0,0,16,26.72,10.72,10.72,0,0,1,16,5.28,85.59,85.59,0,0,0,15.5,16Z","M14.5,16.08c0,6.84,1,9.77,1.36,10.63a10.71,10.71,0,0,1,0-21.42C15.5,6.17,14.5,9.2,14.5,16.08Z","M15.7,26.7a10.7,10.7,0,0,1,0-21.4c-.65.8-2.21,3.47-2.21,10.78S15,25.92,15.7,26.7Z","M15.55,26.7a10.71,10.71,0,0,1,0-21.4c-1,.78-3.05,3.34-3.05,10.7S14.6,25.92,15.55,26.7Z","M15.16,26.68a10.71,10.71,0,0,1,0-21.36C13.85,6.06,11.5,8.43,11.5,16S13.85,25.94,15.16,26.68Z","M14.81,26.65A10.72,10.72,0,0,1,15,5.33c-1.59.76-4.45,3.17-4.45,10.8C10.5,23.53,13.19,25.9,14.81,26.65Z","M14.49,26.6a10.71,10.71,0,0,1,.17-21.23c-1.9.8-5.16,3.24-5.16,10.73C9.5,23.37,12.57,25.79,14.49,26.6Z","M14.46,26.6a10.71,10.71,0,0,1-.24-21.16C12,6.29,8.5,8.76,8.5,15.88,8.5,23.26,12.27,25.76,14.46,26.6Z","M13.72,26.47a10.71,10.71,0,0,1,.43-21C11.78,6.33,8,8.87,8,16.17,8,23,11.35,25.55,13.72,26.47Z","M12.6,26.19a10.73,10.73,0,0,1,0-20.35C10.23,7,7.5,9.67,7.5,16s2.73,9,5.1,10.16Z","M12.23,26a10.7,10.7,0,0,1,0-20C9.77,7.19,7,9.9,7,16S9.77,24.81,12.23,26Z",null,"M19.77,26C22.23,24.81,25,22.1,25,16S22.23,7.19,19.77,6a10.7,10.7,0,0,1,0,20Z","M19.4,26.16C21.77,25,24.5,22.33,24.5,16S21.77,7,19.4,5.84a10.71,10.71,0,0,1,0,20.32Z","M18.28,26.47C20.65,25.55,24,23,24,16.17c0-7.3-3.78-9.84-6.15-10.72a10.71,10.71,0,0,1,.43,21Z","M17.54,26.6c2.19-.84,6-3.34,6-10.72,0-7.12-3.5-9.59-5.72-10.44a10.71,10.71,0,0,1-.24,21.16Z","M17.51,26.6c1.92-.81,5-3.23,5-10.5,0-7.49-3.26-9.93-5.16-10.73a10.71,10.71,0,0,1,.17,21.23Z","M17.19,26.65c1.62-.75,4.31-3.12,4.31-10.52,0-7.63-2.86-10-4.45-10.8a10.72,10.72,0,0,1,.14,21.32Z","M16.84,26.68c1.31-.74,3.66-3.11,3.66-10.68S18.15,6.06,16.84,5.32a10.71,10.71,0,0,1,0,21.36Z","M16.45,26.7c.95-.78,3.05-3.34,3.05-10.7S17.4,6.08,16.45,5.3a10.71,10.71,0,0,1,0,21.4Z","M16.3,26.7c.67-.78,2.2-3.37,2.2-10.62S16.94,6.1,16.29,5.3a10.7,10.7,0,0,1,0,21.4Z","M16.14,26.71c.37-.86,1.36-3.79,1.36-10.63s-1-9.91-1.37-10.79a10.71,10.71,0,0,1,0,21.42Z","M16,26.72A85.59,85.59,0,0,0,16.5,16,85.59,85.59,0,0,0,16,5.28a10.72,10.72,0,0,1,0,21.44Z","M16,26.72V5.28a10.72,10.72,0,0,1,0,21.44Z","M16,26.72h0A85.59,85.59,0,0,1,15.5,16,85.59,85.59,0,0,1,16,5.28h0a10.72,10.72,0,0,1,0,21.44Z","M16,26.72h-.14c-.37-.86-1.36-3.79-1.36-10.63s1-9.91,1.37-10.79H16a10.72,10.72,0,0,1,0,21.44Z","M16,26.72l-.3,0c-.67-.78-2.2-3.37-2.2-10.62s1.56-10,2.21-10.78l.29,0a10.72,10.72,0,0,1,0,21.44Z","M16,26.72l-.45,0c-1-.78-3.05-3.34-3.05-10.7s2.1-9.92,3.05-10.7l.45,0a10.72,10.72,0,0,1,0,21.44Z","M16,26.72c-.28,0-.56,0-.84,0C13.85,25.94,11.5,23.57,11.5,16s2.35-9.94,3.66-10.68c.28,0,.56,0,.84,0a10.72,10.72,0,0,1,0,21.44Z","M16,26.72a11.7,11.7,0,0,1-1.19-.07c-1.62-.75-4.31-3.12-4.31-10.52,0-7.63,2.86-10,4.45-10.8.35,0,.7,0,1.05,0a10.72,10.72,0,0,1,0,21.44Z","M16,26.72a10.85,10.85,0,0,1-1.51-.12c-1.92-.81-5-3.23-5-10.5,0-7.49,3.26-9.93,5.16-10.73A11.9,11.9,0,0,1,16,5.28a10.72,10.72,0,0,1,0,21.44Z","M16,26.72a11.16,11.16,0,0,1-1.54-.12c-2.19-.84-6-3.34-6-10.72,0-7.12,3.5-9.59,5.72-10.44A10.43,10.43,0,0,1,16,5.28a10.72,10.72,0,0,1,0,21.44Z","M16,26.72a10.69,10.69,0,0,1-2.28-.25C11.35,25.55,8,23,8,16.17c0-7.3,3.78-9.84,6.15-10.72A11.26,11.26,0,0,1,16,5.28a10.72,10.72,0,0,1,0,21.44Z","M16,26.72a10.63,10.63,0,0,1-3.4-.56C10.23,25,7.5,22.33,7.5,16s2.73-9,5.1-10.16A10.72,10.72,0,1,1,16,26.72Z","M16,26.72a10.52,10.52,0,0,1-3.77-.7C9.77,24.81,7,22.1,7,16S9.77,7.19,12.23,6A10.52,10.52,0,0,1,16,5.28a10.72,10.72,0,0,1,0,21.44Z"],jn={"New moon":y[0],"New moon fading":y[1],"New moon faded":y[2],"Waxing crescent rising":y[3],"Waxing crescent risen":y[4],"Waxing crescent":y[6],"Waxing crescent fading":y[7],"Waxing crescent faded":y[8],"First quarter rising":y[9],"First quarter risen":y[10],"First quarter":y[12],"First quarter fading":y[13],"First quarter faded":y[14],"Waxing gibbous rising":y[15],"Waxing gibbous risen":y[16],"Waxing gibbous":y[18],"Waxing gibbous fading":y[19],"Waxing gibbous faded":y[20],"Full moon rising":y[21],"Full moon risen":y[22],"Full moon":y[24],"Full moon fading":y[25],"Full moon faded":y[26],"Waning gibbous rising":y[27],"Waning gibbous risen":y[28],"Waning gibbous":y[30],"Waning gibbous fading":y[31],"Waning gibbous faded":y[32],"Last quarter rising":y[33],"Last quarter risen":y[34],"Last quarter":y[36],"Last quarter fading":y[37],"Last quarter faded":y[38],"Waning crescent rising":y[39],"Waning crescent risen":y[40],"Waning crescent":y[42],"Waning crescent fading":y[43],"Waning crescent faded":y[44],"New moon rising":y[45],"New moon risen":y[46]};var Q={Date:"Date",Range:"Range",Recurring:"Recurring",Undated:"Undated"};function ht(t,e){return(t%e+e)%e}function He(t){return"ID_xyxyxyxyxyxy".replace(/[xy]/g,function(e){let n=Math.random()*16|0;return(e=="x"?n:n&3|8).toString(16)})}function le(t,e,n){let r=n=="month"?e.static.padMonths:e.static.padDays;return t==null?"*":String(t).padStart(r!=null?r:0,"0")}function Xe(t,e){return t.interval.sort((n,r)=>{var a,i;return((a=n.interval)!=null?a:Number.MIN_VALUE)-((i=r.interval)!=null?i:Number.MIN_VALUE)}).some(({interval:n,exclusive:r},a,i)=>{var s,u,l,c,m;if(n==null)return!1;if(r&&a==0)return(e-((s=t.offset)!=null?s:0))%n!=0;if(!r)return i[a+1]&&i[a+1].exclusive?(e-((u=t.offset)!=null?u:0))%n==0&&(e-((l=t.offset)!=null?l:0))%((c=i[a+1].interval)!=null?c:0)!=0:(e-((m=t.offset)!=null?m:0))%n==0})}var rn=je(Kt()),Y=je(tn());var an=je(nn());function Te(t,e,n,r){console.error("Calendarium: %s. From '%s', date value: %o",t,n.path,r||e)}var Zn=/<(span|div)[\\s\\S]*?<\\/(span|div)>/g,ue,qe,Ze=class{constructor(e,n){gt(this,ue);this.category=null;this.calendar=e,this.useFilenameForEvents=n,this.formatString=Ge,this.formatDigest=this.formatString.toUpperCase().replace(/[^\\w]/g,"").replace(/Y+/g,"Y").replace(/M+/g,"M").replace(/D+/g,"D")}parseFrontmatterEvent(e,n,r){var u,l,c,m,d;if(!e)return;let a="fc-date"in e?"fc-date":"fc-start",i=(u=e[a])!=null?u:this.useFilenameForEvents?n.basename:null;if(!i)return;let s=this.parseEvent({dateString:i,eventName:(l=e["fc-display-name"])!=null?l:n.basename,eventDesc:e["fc-description"],eventImage:e["fc-img"],categoryString:(d=(m=e==null?void 0:e["fc-category"])!=null?m:(c=this.category)==null?void 0:c.id)!=null?d:null,endDateString:e["fc-end"]},n);s&&r(s)}parseInlineEvents(e,n,r,a){let i=new rn.DOMParser;for(let s of e.matchAll(Zn)){let u=i.parseFromString(s[0],"text/html"),l={dataset:{date:u.documentElement.getAttribute("data-date"),end:u.documentElement.getAttribute("data-end"),title:u.documentElement.getAttribute("data-name"),class:u.documentElement.getAttribute("data-category"),img:u.documentElement.getAttribute("data-img"),calendar:u.documentElement.getAttribute("data-calendar")},content:u.documentElement.textContent};if(l.dataset.date)if(l.dataset.calendar&&l.dataset.calendar!=this.calendar.name)a(l.dataset.calendar,l);else{let c=this.parseEvent({dateString:l.dataset.date,eventName:l.dataset.title,eventDesc:l.content,eventImage:l.dataset.img,endDateString:l.dataset.end,categoryString:l.dataset.class},n);c&&r(c)}}}resolveDates(e,n){let r;return Array.isArray(e.day)||Array.isArray(e.month)||Array.isArray(e.year)?r={type:Q.Recurring,date:e}:e.year===null||e.month===null||e.day===null?(e.year===null&&(e.year=[null,null]),e.month===null&&(e.month=[null,null]),e.day===null&&(e.day=[null,null]),r={type:Q.Recurring,date:e}):n?(Array.isArray(n.day)||Array.isArray(n.month)||Array.isArray(n.year),r={type:Q.Range,date:e,end:n}):r={type:Q.Date,date:e},r}parseEvent({dateString:e,eventName:n,eventDesc:r,eventImage:a,endDateString:i,categoryString:s},u){var T,D,S;if(!e)return null;let l=this.parseDate(e,u);if(!l)return null;let c;s&&(c=this.calendar.categories.find(b=>(b==null?void 0:b.name)==s||(b==null?void 0:b.id)==s),c||(c={id:He(6),color:(0,an.default)(),name:s},(T=this.onNewCategory)==null||T.call(this,c),this.calendar.categories.push(c)));let m=i?this.parseDate(i,u):null,d=this.resolveDates(l,m);return Ye({id:He(6),name:n!=null?n:u.basename,description:r,sort:this.parsedToTimestamp(l),note:u.path,category:(S=(D=c!=null?c:this.category)==null?void 0:D.id)!=null?S:null,img:a},d)}parseFileForDates(e,n){var u;if(!e)return null;let r="fc-date"in e?"fc-date":"fc-start",a=(u=e[r])!=null?u:this.useFilenameForEvents?n.basename:null;if(!a)return null;let i=this.parseCalDateString(a,n);if(!i)return null;let s=e["fc-end"]?this.parseDate(e["fc-end"],n):null;return this.resolveDates(i,s)}parseFilenameDate(e){return this.parseDate(e.basename,e)}parseDate(e,n){return typeof e=="string"?this.parseCalDateString(e,n):this.dateFromSegments({year:e.year||"*",month:e.month||"*",day:e.day||"*",order:e.order},n)}parseCalDateString(e,n){let r=e.split(/(?!^)[-\u2013\u2014](?![^[]*])/);return this.formatDigest!="YMD"&&r.length<3?(Te(\`Must specify all three segments in \${this.formatString} order\`,null,n,e),null):this.dateFromSegments({year:r[this.formatDigest.indexOf("Y")]||null,month:r[this.formatDigest.indexOf("M")]||null,day:r[this.formatDigest.indexOf("D")]||null,order:r[3]?r[3]:""},n,e)}resolveMonth(e,n){if(e===null)return 0;if(typeof e=="number"&&!Number.isNaN(e))return ht(e-1,this.calendar.static.months.length);if(Number.isNaN(e)){let r=this.calendar.static.months.find(a=>{var i,s;return((i=a.name)==null?void 0:i.startsWith(n))||((s=a.short)==null?void 0:s.startsWith(n))});if(r)return this.calendar.static.months.indexOf(r);{let a=this.calendar.static.leapDays.find(i=>i.name&&i.name.startsWith(n));if(a)return a.timespan}}return 0}resolveDay(e,n,r,a){if(typeof e=="number"&&e<1)return(0,Y.Ok)(1);if(typeof e=="number"){for(let s of[n].flat())if(s)for(let u of[r].flat()){let l=this.daysForMonth(s,u);if(e>l)return(0,Y.Err)(\`Day '\${a.day}' is incorrect for month '\${a.month}', which has \${l} day(s)\`)}return(0,Y.Ok)(e)}let i=this.calendar.static.leapDays.find(s=>s.name&&s.name.startsWith(a.month));if(i){for(let s of[n].flat())if(s)for(let u of[r].flat()){if(e=this.findLeapDay(i,s,u),e==null)return(0,Y.Err)(\`Leap day '\${a.day}' isn't valid for year '\${a.year}'\`);if(a.year!=="*")return(0,Y.Ok)(e)}}return e==null?(0,Y.Ok)(1):(0,Y.Ok)(e)}dateFromSegments(e,n,r){let a=Be(e.year),i=Be(e.month),s=Be(e.day);if(e.year==="*")a=[null,null];else if(!e.year||[a].flat().some(u=>Number.isNaN(u)))return Te(\`Must specify a valid year: \${a}\`,e,n,r),null;if(e.month==="*"?i=[null,null]:Array.isArray(i)?i=i.map(u=>this.resolveMonth(u,e.month)):i=this.resolveMonth(i,e.month),e.day==="*")s=[null,null];else if(Array.isArray(s)){let u=s.map(c=>this.resolveDay(c,i,a,e)),l=[];for(let c of u){if(c.isErr())return Te(c.unwrapErr(),e,n,r),null;l.push(c.unwrap())}s=[...l]}else{let u=this.resolveDay(s,i,a,e);if(u.isErr())return Te(u.unwrapErr(),e,n,r),null;s=u.unwrap()}return{year:a,month:i,day:s,order:e.order||""}}generateTimeStamp(e){var i;let n=Array.isArray(e.year)?[e.year].flat().map(s=>\`\${s!=null?s:"*"}\`):[\`\${(i=e.year)!=null?i:"*"}\`],r=[e.month].flat().map(s=>le(s,this.calendar,"month")),a=[e.day].flat().map(s=>le(s,this.calendar,"day"));return\`\${Se(this,ue,qe).call(this,n)}-\${Se(this,ue,qe).call(this,r)}-\${Se(this,ue,qe).call(this,a)}\`}parsedToTimestamp(e){var r,a;if([e.year].flat().every(i=>i==null)||[e.month].flat().every(i=>i==null)||[e.day].flat().every(i=>i==null))return{timestamp:Number.MIN_VALUE,order:e.order?e.order:this.generateTimeStamp(e)};let n;return Array.isArray(e.year)?n=(r=e.year[0])!=null?r:Number.MIN_VALUE:n=(a=e.year)!=null?a:Number.MIN_VALUE,{timestamp:+\`\${n}\${le([e.month].flat()[0],this.calendar,"month")}\${le([e.day].flat()[0],this.calendar,"day")}\`,order:e.order||""}}timestampForCalEvent(e,n){return!n&&e.sort?e.sort:this.parsedToTimestamp(mt(Ye({},e.date),{order:(n==null?void 0:n.order)||""}))}findLeapDay(e,n,r){let a=this.calendar.static.months[n],i=this.calendar.static.leapDays.filter(u=>u.timespan==n&&!u.intercalary||u.intercalary&&u.numbered);return r&&!Xe(e,r)?null:a.length+i.indexOf(e)+1}daysForMonth(e,n){let r=this.calendar.static.months[e],a=this.calendar.static.leapDays.filter(i=>i.timespan==e&&!i.intercalary||i.intercalary&&i.numbered);if(n){let i=a.filter(s=>Xe(s,n)).length;return r.length+i}return r.length+a.length}};ue=new WeakSet,qe=function(e){return(e.length>1?"[":"")+e.join("-")+(e.length>1?"]":"")};function Be(t){if(t==null||t==="*")return null;if(typeof t=="number")return t;if(typeof t=="string"&&/\\[.+?\\]/.test(t)){let e=t.slice(1,-1).split("-").map(n=>Be(n)).sort((n,r)=>typeof n=="number"&&typeof r=="number"?n-r:0);return e.length===1?e[0]:e.length>2?[e[0],e.pop()]:e}return parseInt(t)}var _=self;function Vn(t,e){return t.some(n=>n&&(e.includes(n)||e.includes(\`#\${n}\`)))}var lt=class{constructor(){this.queue=[];this.parsing=!1;this.parseTitle=!1;this.eventHelpers=new Map;this.inlineEventsTag=null;_.addEventListener("message",e=>{if(e.data.type=="options"){let{defaultCalendar:n,format:r,parseTitle:a,debug:i,inlineEventsTag:s,paths:u}=e.data;this.defaultCalendar=n,this.format=r,this.parseTitle=a,this.inlineEventsTag=s,this.debug=i,this.paths=u.sort((l,c)=>l[0].localeCompare(c[0])),this.debug&&console.debug("Received options message",this.defaultCalendar,this.inlineEventsTag,this.paths)}}),_.addEventListener("message",e=>{if(e.data.type=="calendars"){let{calendars:n}=e.data;this.calendars=[...n]}}),_.addEventListener("message",e=>{e.data.type=="queue"&&(this.add(...e.data.paths),this.debug&&console.debug(\`Received queue message for \${e.data.paths.length} paths\`))})}add(...e){this.debug&&console.debug(\`Adding \${e.length} paths to queue\`),this.queue.push(...e),this.parsing||this.parse()}async parse(){for(this.parsing=!0;this.queue.length;){let e=this.queue.shift();if(!e)break;let n=await this.getFileData(e);if(!n||!e.endsWith(".md")||!n.data)continue;let{data:r,cache:a,allTags:i,file:s}=n;this.debug&&console.debug(\`Parsing \${e} for calendar events (\${this.queue.length} to go)\`),setTimeout(()=>{this.parseFileForEvents(r,a,i,s)},0)}this.parsing=!1,this.debug&&console.info("Parsing complete"),_.postMessage({type:"save"})}async getFileData(e){return new Promise(n=>{_.addEventListener("message",r=>{var a;((a=r.data)==null?void 0:a.type)=="file"&&n(r.data)}),_.postMessage({path:e,type:"get"})})}async getFileDataOld(e){let n=this;return new Promise(r=>{function a(i){if(i.data.type=="queue"){_.removeEventListener("message",a),r();return}if(i.data.type!="file"||i.data.path!=e)return;_.removeEventListener("message",a);let{data:s,cache:u,allTags:l,file:c}=i.data;s&&(e.endsWith(".md")&&(n.debug&&console.debug(\`Parsing \${e} for calendar events (\${n.queue.length} to go)\`),n.parseFileForEvents(s,u,l,c)),r())}setTimeout(()=>r(),500),_.addEventListener("message",a),_.postMessage({path:e,type:"get"})})}removeEventsFromFile(e){for(let n of this.calendars)_.postMessage({path:e,id:n.id,type:"delete"})}parseFileForEvents(e,n,r,a){var c;let{frontmatter:i}=n!=null?n:{};this.removeEventsFromFile(a.path);let s=this.createEventHandler(i,a);if(!s)return;let u=0,l=0;s.parseFrontmatterEvent(i,a,m=>{_.postMessage({type:"update",id:s.calendar.id,index:-1,event:m,original:void 0}),u++}),Vn([this.inlineEventsTag,(c=s.calendar.inlineEventTag)!=null?c:null],r)&&s.parseInlineEvents(e,a,m=>{_.postMessage({type:"update",id:s.calendar.id,index:-1,event:m,original:void 0}),l++},(m,d)=>{let E=this.getHelperByName(m);if(!E)return;let T=E.parseEvent({dateString:d.dataset.date,eventName:d.dataset.title,eventDesc:d.content,eventImage:d.dataset.img,endDateString:d.dataset.end,categoryString:d.dataset.class},a);T&&(this.debug&&console.info("Found inline event registered to a different calendar."),_.postMessage({type:"update",id:E.calendar.id,index:-1,event:T,original:void 0}))}),this.debug&&u+l>0&&console.info(\`\${u} frontmatter and \${l} inline event operations completed on \${s.calendar.name} for \${a.basename}\`)}createEventHandler(e,n){if(!(e!=null&&e["fc-ignore"])){let r=e==null?void 0:e["fc-calendar"];if(!r||!r.length){let a=this.paths.find(i=>n.path.startsWith(i[0]));a&&(r=a[1])}if((!r||!r.length)&&(r=this.defaultCalendar),r=r==null?void 0:r.trim().toLowerCase(),r)return this.getHelperByName(r);this.debug&&console.info(\`Skipping file \${n.basename} (no calendar; \${r})\`)}return null}getHelperByName(e){let n=this.eventHelpers.get(e);if(n)return n;{let r=this.calendars.find(a=>e.toLowerCase()==a.name.toLowerCase()||e.toLowerCase()==a.id.toLowerCase());if(this.debug&&console.info("Finding calendar for",e,r),r){this.debug&&console.info("creating event helper for calendar",r),n=new Ze(r,this.parseTitle);let a=n.calendar.id;return n.onNewCategory=i=>{_.postMessage({type:"category",id:a,category:i})},this.eventHelpers.set(e,n),n}this.debug&&console.info("No calendar found for",e)}return null}};new lt; `)}var Jd=class extends Cn.Component{constructor(t){super();this.plugin=t;this.queue=new Set;this.paths=new Set;this.worker=new B1}get metadataCache(){return this.plugin.app.metadataCache}get vault(){return this.plugin.app.vault}onload(){this.plugin.addCommand({id:"rescan-events",name:"Rescan events",callback:()=>{Xe.getData().debug&&console.info("Beginning full rescan for calendar events"),this.start()}}),this.registerEvent(this.plugin.app.workspace.on("calendarium-updated",()=>{this.worker.postMessage({type:"calendars",calendars:Xe.getCalendars()})})),this.registerEvent(this.plugin.app.workspace.on("calendarium-settings-change",()=>{this.worker.postMessage({type:"options",parseTitle:Xe.getData().parseDates,format:this.plugin.format,defaultCalendar:this.plugin.defaultCalendar?.name,paths:Xe.getData().paths,debug:Xe.getData().debug,inlineEventsTag:Xe.getData().inlineEventsTag})})),this.registerEvent(this.metadataCache.on("changed",t=>{this.queue.has(t.path)||this.parseFiles(t)})),this.registerEvent(this.vault.on("rename",async(t,n)=>{if(Xe.getCalendars().length&&t instanceof Cn.TFile){for(let a of Xe.getCalendars()){let i=this.plugin.getStoreByCalendar(a);i&&i.eventStore.removeEventsFromFile(n)}this.worker.postMessage({type:"calendars",calendars:Xe.getCalendars()}),this.pathContainsFile(t.path)&&this.parseFiles(t)}})),this.registerEvent(this.vault.on("delete",async t=>{if(!(t instanceof Cn.TFile))return;let n=!1;for(let a of Xe.getCalendars()){let i=this.plugin.getStoreByCalendar(a);i&&(i.eventStore.removeEventsFromFile(t.path),n=!0)}n&&await Xe.save({calendar:!0})})),this.worker.postMessage({type:"calendars",calendars:Xe.getCalendars()}),this.worker.postMessage({type:"options",parseTitle:Xe.getData().parseDates,format:this.plugin.format,defaultCalendar:this.plugin.defaultCalendar?.name,inlineEventsTag:Xe.getData().inlineEventsTag,paths:Xe.getData().paths,debug:Xe.getData().debug}),this.worker.addEventListener("message",async t=>{if(t.data.type=="get"){let{path:n}=t.data;this.queue.delete(n);let a=this.plugin.app.vault.getAbstractFileByPath(n);if(a instanceof Cn.TFile){let i=this.metadataCache.getFileCache(a)??{},o=(0,Cn.getAllTags)(i),s=await this.vault.cachedRead(a);this.worker.postMessage({type:"file",path:n,cache:i,file:{path:a.path,basename:a.basename},allTags:o??[],data:s})}else if(a instanceof Cn.TFolder){this.worker.postMessage({type:"file",path:n});for(let i of a.children)this.parseFiles(i)}}}),this.worker.addEventListener("message",async t=>{if(t.data.type=="update"){let{id:n,index:a,event:i,original:o}=t.data,s=Xe.getCalendars().find(u=>u.id==n);if(!s)return;let l=this.plugin.getStore(s.id);if(!l)return;Xe.getData().debug&&(a==-1?console.debug(`Adding '${i.name}' to ${s.name}`):console.debug(`Updating '${i.name}' in calendar ${s.name}`)),l.eventStore.insertEventsFromFile(i.note,i)}}),this.worker.addEventListener("message",async t=>{if(t.data.type=="category"){let{id:n,category:a}=t.data,i=Xe.getCalendars().find(s=>s.id==n);if(!i)return;let o=this.plugin.getStore(i.id);if(!o||o.hasCategory(a.id))return;o.addCategory(a),await Xe.save({calendar:!0})}}),this.worker.addEventListener("message",async t=>{if(t.data.type=="delete"){let{id:n,path:a}=t.data;if(!a)return;let i=Xe.getCalendars().find(s=>s.id==n);if(!i)return;Xe.getData().debug&&console.debug(`Removing events for ${a} from ${i.name}`);let o=this.plugin.getStore(i.id);if(!o)return;o.eventStore.removeEventsFromFile(a)}}),this.worker.addEventListener("message",async t=>{t.data.type=="save"&&Xe.getData().debug&&console.debug("Received save event from file watcher")}),this.plugin.app.workspace.onLayoutReady(()=>{this.start()})}pathContainsFile(t){let n=Xe.getData().paths;if(!n.length||n.some(a=>a[0]==="/"))return!0;for(let a of n)if(t.startsWith(a[0]))return!0;return!1}start(t){if(!Xe.getData().autoParse)return;let n=t?[t]:Xe.getCalendars();if(!n.length)return;let a=[];for(let[i]of Xe.getData().paths){let o=this.vault.getAbstractFileByPath(i);if(!o||!(o instanceof Cn.TFolder))return;a.push(o)}a.length&&(Xe.getData().debug&&(t?console.info(`Starting rescan for ${t.name}`):(console.info(`Starting rescan for ${n.length} calendars`),console.info(`Looking at ${a.length} paths`))),this.parseFiles(...a))}getFiles(t){let n=[];return(t instanceof Cn.TFolder||t instanceof Cn.TFile&&t.extension==="md")&&n.push(t.path),n}parseFiles(...t){let n=new Set;for(let a of t)for(let i of this.getFiles(a))n.add(i);this.startParsing([...n])}startParsing(t){for(let n of t)this.queue.add(n);this.worker.postMessage({type:"queue",paths:t})}onunload(){this.worker.terminate()}};var Ja,Oo,Ru,eh=class{constructor(e,t){Tt(this,Ja,void 0);Tt(this,Oo,void 0);Tt(this,Ru,void 0);Nt(this,Ja,e),Nt(this,Oo,t),Nt(this,Ru,new ys(t,!1))}getStore(){return Me(this,Ja)}getObject(){return at(Me(this,Oo))}parseDate(e){return Me(this,Ru).parseCalDateString(e,{path:"",basename:"api-call"})}getDate(e,t,n){return{day:e,month:t,year:n}}getCurrentDate(){return Ne(Me(this,Ja).current)}getEvents(){return Me(this,Ja).eventStore.getEvents()}getEventsOnDay(e){return Ne(Me(this,Ja).eventStore.getEventsForDate(e))}sortEvents(e){return ii(e)}compareEvents(e,t){return pp(e,t)}toDisplayDate(e,t,n){return Fr(e,Me(this,Oo),t,n)}getSeasons(){return at(Me(this,Oo).seasonal.seasons)}getSeasonForDate(e){return at(Ne(Me(this,Ja).seasonCache.getItemsOrRecalculate(e)).shift())}};Ja=new WeakMap,Oo=new WeakMap,Ru=new WeakMap;var rh,nE,zs,th=class{constructor(e){this.plugin=e;Tt(this,rh);Tt(this,zs,new WeakMap)}onSettingsLoaded(e){this.plugin.onSettingsLoaded(e)}getCalendars(){return Xe.getCalendars().map(e=>e.name)}getAPI(e){let t=Xe.getCalendars().find(i=>e?i.name==e:i.id==Xe.getData().defaultCalendar);if(!t)throw new ReferenceError("No calendar store by that name exists.");let n=qo(this,rh,nE).call(this,t),a=Me(this,zs).get(t)??new eh(n,t);return Me(this,zs).has(t)||Me(this,zs).set(t,a),a}translate(e,t,n){if(e.year==null||e.month==null||e.day==null)throw new Error("In order for an date to be translated, it must be fully defined.");let a=t.getStore(),i=n.getStore(),o=a.getDaysBeforeDate(e),s={year:Math.floor(o/i.staticStore.getDaysInAYear()),month:0,day:1},l=i.getDaysBeforeDate(s);if(l===o)return s;let u=l>o?-1:1,c=!1;function f(d,h,p){return p===1?dh}for(let d of["year","month"]){let h=i.getDaysBeforeDate(s);for(;f(h,o,u)&&(h=i.getDaysBeforeDate({...s,[d]:s[d]+u}),c||(c=!0),!(h>o));)s[d]=s[d]+u}return s.day=o-i.getDaysBeforeDate(s)+1,s}};rh=new WeakSet,nE=function(e){let t=null;if(typeof e=="string"?t=this.plugin.getStore(Xe.getCalendars().find(n=>n.name==e)?.id??""):t=this.plugin.getStoreByCalendar(e),!t)throw new ReferenceError("No calendar by that name exists.");return t},zs=new WeakMap;var jE=require("obsidian");var Vs=require("obsidian");var nh=class extends Vs.MarkdownRenderChild{constructor(t,n,a){super(a);this.plugin=t;this.source=n;this.getViewType=()=>Nr.Calendarium;this.id=Le(12)}switchCalendar(t){let n=this.plugin.getStore(t);if(!n)throw new Vs.Notice("There was an issue opening that calendar."),new Error("Could not find a calendar by that name");this.store=n,this.calendar=t,this.ui.$set({store:this.store}),this.plugin.app.workspace.requestSaveLayout(),this.plugin.app.workspace.trigger("calendarium:view-parent:change-calendar",{parent:this.id,calendar:t})}onload(){let n=((0,Vs.parseYaml)(this.source??"")??{}).calendar??this.plugin.defaultCalendar.name,a=this.plugin.calendars.find(o=>o.name===n);a||(a=this.plugin.defaultCalendar);let i=this.plugin.getStore(a.id);if(!i){this.containerEl.replaceWith(createEl("code",{text:"No calendar by that name was found."}));return}this.store=i,this.calendar=a.id,this.ui=new Kd({target:this.containerEl,props:{store:this.store,view:this,plugin:this.plugin,full:!1}}),this.plugin.register(()=>{this.ui?.$destroy();let o=createEl("pre");o.createEl("code",{text:"Calendarium has been unloaded. Re-enable the plugin to render your calendars."}),this.containerEl.replaceWith(o)})}};var aE=require("obsidian"),ah=class extends aE.EditorSuggest{constructor(t){super(t.app);this.plugin=t}getSuggestions(t){return this.plugin.calendars.map(n=>n.name).filter(n=>n.toLowerCase().contains(t.query.toLowerCase()))}renderSuggestion(t,n){n.createSpan({text:t})}selectSuggestion(t,n){if(!this.context)return;let a=this.context.editor.getLine(this.context.end.line).slice(this.context.end.ch),[i,o]=a.match(/^(\] ?)/)??[];this.context.editor.replaceRange(`${t} `,this.context.start,{...this.context.end,ch:this.context.start.ch+this.context.query.length+(o?.length??0)},"calendarium"),this.context.editor.setCursor(this.context.start.line,this.context.start.ch+t.length),this.close()}onTrigger(t,n,a){let i=n.getRange({line:0,ch:0},t);if(i.indexOf("```calendarium\n")===-1)return null;let o=i.split(` `).reverse(),s=!1;for(let h of o){if(/^```$/.test(h))return null;if(/^```calendarium/.test(h)){s=!0;break}}if(!s)return null;let l=n.getLine(t.line);if(!/^calendar:/m.test(l.slice(0,t.ch)))return null;let u=l.match(/^calendar:(.+)\n?/);if(!u)return null;let[c,f]=u;return this.plugin.calendars.map(h=>h.name).find(h=>h.toLowerCase()==f?.toLowerCase())?null:{end:t,start:{ch:10,line:t.line},query:f}}};var Ks=require("obsidian");function _o(r,e){return r==null||e==null?NaN:re?1:r>=e?0:NaN}function U1(r,e){return r==null||e==null?NaN:er?1:e>=r?0:NaN}function ih(r){let e,t,n;r.length!==2?(e=_o,t=(s,l)=>_o(r(s),l),n=(s,l)=>r(s)-l):(e=r===_o||r===U1?r:hL,t=r,n=r);function a(s,l,u=0,c=s.length){if(u>>1;t(s[f],l)<0?u=f+1:c=f}while(u>>1;t(s[f],l)<=0?u=f+1:c=f}while(uu&&n(s[f-1],l)>-n(s[f],l)?f-1:f}return{left:a,center:o,right:i}}function hL(){return 0}function W1(r){return r===null?NaN:+r}var iE=ih(_o),oE=iE.right,pL=iE.left,mL=ih(W1).center,Y1=oE;var gL=Math.sqrt(50),yL=Math.sqrt(10),bL=Math.sqrt(2);function oh(r,e,t){let n=(e-r)/Math.max(0,t),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=gL?10:i>=yL?5:i>=bL?2:1,s,l,u;return a<0?(u=Math.pow(10,-a)/o,s=Math.round(r*u),l=Math.round(e*u),s/ue&&--l,u=-u):(u=Math.pow(10,a)*o,s=Math.round(r/u),l=Math.round(e/u),s*ue&&--l),l0))return[];if(r===e)return[r];let n=e=a))return[];let s=i-a+1,l=new Array(s);if(n)if(o<0)for(let u=0;u>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?uh(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?uh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=OL.exec(r))?new kn(e[1],e[2],e[3],1):(e=_L.exec(r))?new kn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=wL.exec(r))?uh(e[1],e[2],e[3],e[4]):(e=DL.exec(r))?uh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=CL.exec(r))?pE(e[1],e[2]/100,e[3]/100,1):(e=kL.exec(r))?pE(e[1],e[2]/100,e[3]/100,e[4]):lE.hasOwnProperty(r)?fE(lE[r]):r==="transparent"?new kn(NaN,NaN,NaN,0):null}function fE(r){return new kn(r>>16&255,r>>8&255,r&255,1)}function uh(r,e,t,n){return n<=0&&(r=e=t=NaN),new kn(r,e,t,n)}function SL(r){return r instanceof Zu||(r=Mi(r)),r?(r=r.rgb(),new kn(r.r,r.g,r.b,r.opacity)):new kn}function Xs(r,e,t,n){return arguments.length===1?SL(r):new kn(r,e,t,n??1)}function kn(r,e,t,n){this.r=+r,this.g=+e,this.b=+t,this.opacity=+n}lh(kn,Xs,V1(Zu,{brighter(r){return r=r==null?fh:Math.pow(fh,r),new kn(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?Iu:Math.pow(Iu,r),new kn(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new kn(Do(this.r),Do(this.g),Do(this.b),dh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:dE,formatHex:dE,formatHex8:AL,formatRgb:hE,toString:hE}));function dE(){return`#${wo(this.r)}${wo(this.g)}${wo(this.b)}`}function AL(){return`#${wo(this.r)}${wo(this.g)}${wo(this.b)}${wo((isNaN(this.opacity)?1:this.opacity)*255)}`}function hE(){let r=dh(this.opacity);return`${r===1?"rgb(":"rgba("}${Do(this.r)}, ${Do(this.g)}, ${Do(this.b)}${r===1?")":`, ${r})`}`}function dh(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function Do(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function wo(r){return r=Do(r),(r<16?"0":"")+r.toString(16)}function pE(r,e,t,n){return n<=0?r=e=t=NaN:t<=0||t>=1?r=e=NaN:e<=0&&(r=NaN),new ca(r,e,t,n)}function gE(r){if(r instanceof ca)return new ca(r.h,r.s,r.l,r.opacity);if(r instanceof Zu||(r=Mi(r)),!r)return new ca;if(r instanceof ca)return r;r=r.rgb();var e=r.r/255,t=r.g/255,n=r.b/255,a=Math.min(e,t,n),i=Math.max(e,t,n),o=NaN,s=i-a,l=(i+a)/2;return s?(e===i?o=(t-n)/s+(t0&&l<1?0:o,new ca(o,s,l,r.opacity)}function yE(r,e,t,n){return arguments.length===1?gE(r):new ca(r,e,t,n??1)}function ca(r,e,t,n){this.h=+r,this.s=+e,this.l=+t,this.opacity=+n}lh(ca,yE,V1(Zu,{brighter(r){return r=r==null?fh:Math.pow(fh,r),new ca(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?Iu:Math.pow(Iu,r),new ca(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,e=isNaN(r)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,a=2*t-n;return new kn(j1(r>=240?r-240:r+120,a,n),j1(r,a,n),j1(r<120?r+240:r-120,a,n),this.opacity)},clamp(){return new ca(mE(this.h),ch(this.s),ch(this.l),dh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let r=dh(this.opacity);return`${r===1?"hsl(":"hsla("}${mE(this.h)}, ${ch(this.s)*100}%, ${ch(this.l)*100}%${r===1?")":`, ${r})`}`}}));function mE(r){return r=(r||0)%360,r<0?r+360:r}function ch(r){return Math.max(0,Math.min(1,r||0))}function j1(r,e,t){return(r<60?e+(t-e)*r/60:r<180?t:r<240?e+(t-e)*(240-r)/60:e)*255}function X1(r,e,t,n,a){var i=r*r,o=i*r;return((1-3*r+3*i-o)*e+(4-6*i+3*o)*t+(1+3*r+3*i-3*o)*n+o*a)/6}function bE(r){var e=r.length-1;return function(t){var n=t<=0?t=0:t>=1?(t=1,e-1):Math.floor(t*e),a=r[n],i=r[n+1],o=n>0?r[n-1]:2*a-i,s=n()=>r;function $L(r,e){return function(t){return r+t*e}}function TL(r,e,t){return r=Math.pow(r,t),e=Math.pow(e,t)-r,t=1/t,function(n){return Math.pow(r+n*e,t)}}function OE(r){return(r=+r)==1?hh:function(e,t){return t-e?TL(e,t,r):qu(isNaN(e)?t:e)}}function hh(r,e){var t=e-r;return t?$L(r,t):qu(isNaN(r)?e:r)}var G1=function r(e){var t=OE(e);function n(a,i){var o=t((a=Xs(a)).r,(i=Xs(i)).r),s=t(a.g,i.g),l=t(a.b,i.b),u=hh(a.opacity,i.opacity);return function(c){return a.r=o(c),a.g=s(c),a.b=l(c),a.opacity=u(c),a+""}}return n.gamma=r,n}(1);function _E(r){return function(e){var t=e.length,n=new Array(t),a=new Array(t),i=new Array(t),o,s;for(o=0;ot&&(i=e.slice(t,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(a=a[0])?s[o]?s[o]+=a:s[++o]=a:(s[++o]=null,l.push({i:o,x:Ri(n,a)})),t=H1.lastIndex;return te&&(t=r,r=e,e=t),function(n){return Math.max(r,Math.min(e,n))}}function RL(r,e,t){var n=r[0],a=r[1],i=e[0],o=e[1];return a2?QL:RL,l=u=null,f}function f(d){return d==null||isNaN(d=+d)?i:(l||(l=s(r.map(n),e,t)))(n(o(d)))}return f.invert=function(d){return o(a((u||(u=s(e,r.map(n),Ri)))(d)))},f.domain=function(d){return arguments.length?(r=Array.from(d,t2),c()):r.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),c()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),t=J1,c()},f.clamp=function(d){return arguments.length?(o=d?!0:Gs,c()):o!==Gs},f.interpolate=function(d){return arguments.length?(t=d,c()):t},f.unknown=function(d){return arguments.length?(i=d,f):i},function(d,h){return n=d,a=h,c()}}function n2(){return IL()(Gs,Gs)}function $E(r){return Math.abs(r=Math.round(r))>=1e21?r.toLocaleString("en").replace(/,/g,""):r.toString(10)}function ko(r,e){if((t=(r=e?r.toExponential(e-1):r.toExponential()).indexOf("e"))<0)return null;var t,n=r.slice(0,t);return[n.length>1?n[0]+n.slice(2):n,+r.slice(t+1)]}function Aa(r){return r=ko(Math.abs(r)),r?r[1]:NaN}function TE(r,e){return function(t,n){for(var a=t.length,i=[],o=0,s=r[0],l=0;a>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),i.push(t.substring(a-=s,a+s)),!((l+=s+1)>n));)s=r[o=(o+1)%r.length];return i.reverse().join(e)}}function NE(r){return function(e){return e.replace(/[0-9]/g,function(t){return r[+t]})}}var FL=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Qi(r){if(!(e=FL.exec(r)))throw new Error("invalid format: "+r);var e;return new ph({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Qi.prototype=ph.prototype;function ph(r){this.fill=r.fill===void 0?" ":r.fill+"",this.align=r.align===void 0?">":r.align+"",this.sign=r.sign===void 0?"-":r.sign+"",this.symbol=r.symbol===void 0?"":r.symbol+"",this.zero=!!r.zero,this.width=r.width===void 0?void 0:+r.width,this.comma=!!r.comma,this.precision=r.precision===void 0?void 0:+r.precision,this.trim=!!r.trim,this.type=r.type===void 0?"":r.type+""}ph.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function PE(r){e:for(var e=r.length,t=1,n=-1,a;t0&&(n=0);break}return n>0?r.slice(0,n)+r.slice(a+1):r}var a2;function ME(r,e){var t=ko(r,e);if(!t)return r+"";var n=t[0],a=t[1],i=a-(a2=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+ko(r,Math.max(0,e+i-1))[0]}function i2(r,e){var t=ko(r,e);if(!t)return r+"";var n=t[0],a=t[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}var o2={"%":(r,e)=>(r*100).toFixed(e),b:r=>Math.round(r).toString(2),c:r=>r+"",d:$E,e:(r,e)=>r.toExponential(e),f:(r,e)=>r.toFixed(e),g:(r,e)=>r.toPrecision(e),o:r=>Math.round(r).toString(8),p:(r,e)=>i2(r*100,e),r:i2,s:ME,X:r=>Math.round(r).toString(16).toUpperCase(),x:r=>Math.round(r).toString(16)};function s2(r){return r}var RE=Array.prototype.map,QE=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function IE(r){var e=r.grouping===void 0||r.thousands===void 0?s2:TE(RE.call(r.grouping,Number),r.thousands+""),t=r.currency===void 0?"":r.currency[0]+"",n=r.currency===void 0?"":r.currency[1]+"",a=r.decimal===void 0?".":r.decimal+"",i=r.numerals===void 0?s2:NE(RE.call(r.numerals,String)),o=r.percent===void 0?"%":r.percent+"",s=r.minus===void 0?"\u2212":r.minus+"",l=r.nan===void 0?"NaN":r.nan+"";function u(f){f=Qi(f);var d=f.fill,h=f.align,p=f.sign,m=f.symbol,O=f.zero,b=f.width,E=f.comma,D=f.precision,C=f.trim,k=f.type;k==="n"?(E=!0,k="g"):o2[k]||(D===void 0&&(D=12),C=!0,k="g"),(O||d==="0"&&h==="=")&&(O=!0,d="0",h="=");var w=m==="$"?t:m==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():"",T=m==="$"?n:/[%p]/.test(k)?o:"",S=o2[k],M=/[defgprs%]/.test(k);D=D===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,D)):Math.max(0,Math.min(20,D));function Z(N){var L=w,j=T,X,fe,ee;if(k==="c")j=S(N)+j,N="";else{N=+N;var te=N<0||1/N<0;if(N=isNaN(N)?l:S(Math.abs(N),D),C&&(N=PE(N)),te&&+N==0&&p!=="+"&&(te=!1),L=(te?p==="("?p:s:p==="-"||p==="("?"":p)+L,j=(k==="s"?QE[8+a2/3]:"")+j+(te&&p==="("?")":""),M){for(X=-1,fe=N.length;++Xee||ee>57){j=(ee===46?a+N.slice(X+1):N.slice(X))+j,N=N.slice(0,X);break}}}E&&!O&&(N=e(N,1/0));var ge=L.length+N.length+j.length,he=ge>1)+L+N+j+he.slice(ge);break;default:N=he+L+N+j;break}return i(N)}return Z.toString=function(){return f+""},Z}function c(f,d){var h=u((f=Qi(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Aa(d)/3)))*3,m=Math.pow(10,-p),O=QE[8+p/3];return function(b){return h(m*b)+O}}return{format:u,formatPrefix:c}}var mh,gh,yh;l2({thousands:",",grouping:[3],currency:["$",""]});function l2(r){return mh=IE(r),gh=mh.format,yh=mh.formatPrefix,mh}function u2(r){return Math.max(0,-Aa(Math.abs(r)))}function c2(r,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Aa(e)/3)))*3-Aa(Math.abs(r)))}function f2(r,e){return r=Math.abs(r),e=Math.abs(e)-r,Math.max(0,Aa(e)-Aa(r))+1}function d2(r,e,t,n){var a=z1(r,e,t),i;switch(n=Qi(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(r),Math.abs(e));return n.precision==null&&!isNaN(i=c2(a,o))&&(n.precision=i),yh(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=f2(a,Math.max(Math.abs(r),Math.abs(e))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=u2(a))&&(n.precision=i-(n.type==="%")*2);break}}return gh(n)}function ZL(r){var e=r.domain;return r.ticks=function(t){var n=e();return sh(n[0],n[n.length-1],t??10)},r.tickFormat=function(t,n){var a=e();return d2(a[0],a[a.length-1],t??10,n)},r.nice=function(t){t==null&&(t=10);var n=e(),a=0,i=n.length-1,o=n[a],s=n[i],l,u,c=10;for(s0;){if(u=Qu(o,s,t),u===l)return n[a]=o,n[i]=s,e(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return r},r}function Hs(){var r=n2();return r.copy=function(){return AE(r,Hs())},sE.apply(r,arguments),ZL(r)}function qL(r){we(r,"svelte-csb8us","svg.svelte-csb8us.svelte-csb8us{width:100%;height:400px;float:left}circle.svelte-csb8us.svelte-csb8us{fill:orange;fill-opacity:0.6;stroke:rgba(0, 0, 0, 0.5)}.tick.svelte-csb8us line.svelte-csb8us{stroke:#ddd;stroke-dasharray:2}text.svelte-csb8us.svelte-csb8us{font-size:12px;fill:#999}.x-axis.svelte-csb8us text.svelte-csb8us{text-anchor:middle}.y-axis.svelte-csb8us text.svelte-csb8us{text-anchor:end}")}function FE(r,e,t){let n=r.slice();return n[36]=e[t],n[38]=t,n}function ZE(r,e,t){let n=r.slice();return n[39]=e[t],n[38]=t,n}function qE(r,e,t){let n=r.slice();return n[39]=e[t],n}function LE(r){let e,t,n,a,i,o=r[39].name+"",s,l,u;return{c(){e=or("g"),t=or("line"),i=or("text"),s=le(o),g(t,"x1",n=r[22].left),g(t,"x2",a=r[12]-r[22].right),g(t,"class","svelte-csb8us"),g(i,"x",l=r[22].left-2),g(i,"y","+4"),g(i,"class","svelte-csb8us"),g(e,"class","tick svelte-csb8us"),g(e,"transform",u="translate(0, "+r[11](r[39].pos)+")"),g(e,"stroke","#ddd")},m(c,f){$(c,e,f),y(e,t),y(e,i),y(i,s)},p(c,f){f[0]&4096&&a!==(a=c[12]-c[22].right)&&g(t,"x2",a),f[0]&1024&&o!==(o=c[39].name+"")&&ve(s,o),f[0]&3072&&u!==(u="translate(0, "+c[11](c[39].pos)+")")&&g(e,"transform",u)},d(c){c&&A(e)}}}function BE(r){let e,t,n,a,i,o,s=r[39].name+"",l,u,c;return{c(){e=or("g"),t=or("line"),o=or("text"),l=le(s),g(t,"y1",n=r[11](r[15])),g(t,"y2",a=r[11](r[16])),g(t,"stroke-dasharray",i=r[38]!==0?2:0),g(t,"class","svelte-csb8us"),g(o,"y",u=r[17]-r[22].bottom+35),g(o,"text-anchor","middle"),g(o,"class","svelte-csb8us"),g(e,"class","tick svelte-csb8us"),g(e,"transform",c="translate("+r[14](r[39].pos)+",0)"),g(e,"stroke","#ddd")},m(f,d){$(f,e,d),y(e,t),y(e,o),y(o,l)},p(f,d){d[0]&34816&&n!==(n=f[11](f[15]))&&g(t,"y1",n),d[0]&67584&&a!==(a=f[11](f[16]))&&g(t,"y2",a),d[0]&8192&&s!==(s=f[39].name+"")&&ve(l,s),d[0]&131072&&u!==(u=f[17]-f[22].bottom+35)&&g(o,"y",u),d[0]&24576&&c!==(c="translate("+f[14](f[39].pos)+",0)")&&g(e,"transform",c)},d(f){f&&A(e)}}}function UE(r){let e,t,n;return{c(){e=or("circle"),g(e,"cx",t=r[14](r[38])),g(e,"cy",n=r[11](r[36])),g(e,"r","5"),g(e,"class","svelte-csb8us")},m(a,i){$(a,e,i)},p(a,i){i[0]&16384&&t!==(t=a[14](a[38]))&&g(e,"cx",t),i[0]&264192&&n!==(n=a[11](a[36]))&&g(e,"cy",n)},d(a){a&&A(e)}}}function WE(r){let e,t=r[36]&&UE(r);return{c(){t&&t.c(),e=He()},m(n,a){t&&t.m(n,a),$(n,e,a)},p(n,a){n[36]?t?t.p(n,a):(t=UE(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(n){n&&A(e),t&&t.d(n)}}}function LL(r){let e,t,n,a,i,o=$e(r[10]),s=[];for(let d=0;d(k(),k=be(d,Ue=>t(31,C=Ue)),d),T,S=I,M=()=>(S(),S=be(i,Ue=>t(32,T=Ue)),i),Z,N,L=I,j=()=>(L(),L=be(D,Ue=>t(10,N=Ue)),D),X,fe=I,ee=()=>(fe(),fe=be(b,Ue=>t(11,X=Ue)),b),te,ge,he=I,ue=()=>(he(),he=be(E,Ue=>t(13,ge=Ue)),E),xe,Pe=I,Ye=()=>(Pe(),Pe=be(O,Ue=>t(14,xe=Ue)),O),it,Be=I,st=()=>(Be(),Be=be(m,Ue=>t(15,it=Ue)),m),ct,ft=I,It=()=>(ft(),ft=be(p,Ue=>t(16,ct=Ue)),p),Yt,zt,V=I,B=()=>(V(),V=be(h,Ue=>t(18,zt=Ue)),h);r.$$.on_destroy.push(()=>k()),r.$$.on_destroy.push(()=>S()),r.$$.on_destroy.push(()=>L()),r.$$.on_destroy.push(()=>fe()),r.$$.on_destroy.push(()=>he()),r.$$.on_destroy.push(()=>Pe()),r.$$.on_destroy.push(()=>Be()),r.$$.on_destroy.push(()=>ft()),r.$$.on_destroy.push(()=>V());let pe=ut("store");ie(r,pe,Ue=>t(33,Z=Ue));let De,rt=Ze(750);ie(r,rt,Ue=>t(12,te=Ue));let Mt=Ze(200);ie(r,Mt,Ue=>t(17,Yt=Ue));let ar={top:20,right:40,bottom:40,left:25};Hn(Er);function Er(){let{width:Ue,height:ze}=De.getBoundingClientRect();rt.set(Ue),Mt.set(ze)}function Kt(Ue){Jr[Ue?"unshift":"push"](()=>{De=Ue,t(3,De)})}return r.$$.update=()=>{r.$$.dirty[1]&4&&t(25,{weatherStore:n,yearCalculator:a,current:i,staticStore:o}=Z,n,(t(30,a),t(33,Z)),M(t(9,i)),(t(27,o),t(33,Z))),r.$$.dirty[0]&1073741824|r.$$.dirty[1]&2&&t(23,s=a.getYearFromCache(T.year)),r.$$.dirty[0]&1073741824|r.$$.dirty[1]&2&&t(28,l=a.getYearFromCache(T.year+1).daysBefore),r.$$.dirty[0]&8388608&&t(29,u=s.daysBefore),r.$$.dirty[1]&2&&t(26,c={year:T.year,day:1,month:0}),r.$$.dirty[0]&805306368&&t(24,f=de([u,l],([Ue,ze])=>[...Array(ze-Ue).keys()])),r.$$.dirty[0]&134217728&&w(t(8,d=de(o.seasonal,Ue=>Ue.weather.tempUnits))),r.$$.dirty[0]&117440512&&B(t(2,h=de([pe,f],([Ue,ze])=>{let Wt=[];for(let ur of ze){let Jt=Ue.getOffsetDate(c,ur),cr=Ne(n.getWeatherForDate(Jt));Wt.push(cr?.temperature.actual??null)}return Wt}))),r.$$.dirty[0]&4&&It(t(1,p=de(h,Ue=>Math.max(...Ue.filter(ze=>ze!=null))))),r.$$.dirty[0]&4&&st(t(0,m=de(h,Ue=>Math.min(...Ue.filter(ze=>ze!=null))))),r.$$.dirty[0]&4&&Ye(t(7,O=de([rt,h],([Ue,ze])=>Hs().domain([0,ze.length]).range([ar.left,Ue-ar.right])))),r.$$.dirty[0]&3&&ee(t(6,b=de([Mt,p,m],([Ue,ze,Wt])=>Hs().domain([Wt*.75,ze*1.25]).range([Ue-ar.bottom,ar.top])))),r.$$.dirty[0]&25165824&&ue(t(5,E=de([s.months,f],([Ue,ze])=>{let Wt=[],ur=0;for(let Jt of Ue)Wt.push({name:Jt.name.slice(0,3),pos:ur}),ur+=Jt.length;return Wt.push({name:`${s.year+1}`,pos:ze.length}),Wt}))),r.$$.dirty[0]&3|r.$$.dirty[1]&1&&j(t(4,D=de([p,m],([Ue,ze])=>{let Wt=[],ur=Ue-ze;for(let Jt=0;Jt<7;Jt++)Wt.push({name:`${jr(Ue-Jt*(ur/7),C)}`,pos:Ue-Jt*ur/7});return Wt.push({name:`${jr(ze,C)}`,pos:ze}),Wt})))},[m,p,h,De,D,E,b,O,d,i,N,X,te,ge,xe,it,ct,Yt,zt,pe,rt,Mt,ar,s,f,n,c,o,l,u,a,C,T,Z,Kt]}var h2=class extends ae{constructor(e){super(),oe(this,e,BL,LL,re,{},qL,[-1,-1])}},YE=h2;function UL(r){let e,t=r[0],n,a=zE(r);return{c(){e=_("div"),a.c(),g(e,"class","calendar-container calendarium")},m(i,o){$(i,e,o),a.m(e,null),n=!0},p(i,o){o&1&&re(t,t=i[0])?(Oe(),R(a,1,1,I),_e(),a=zE(i),a.c(),P(a,1),a.m(e,null)):a.p(i,o)},i(i){n||(P(a),n=!0)},o(i){R(a),n=!1},d(i){i&&A(e),a.d(i)}}}function WL(r){let e;return{c(){e=_("p"),e.textContent="No calendars created! Create one in settings to get started."},m(t,n){$(t,e,n)},p:I,i:I,o:I,d(t){t&&A(e)}}}function zE(r){let e,t;return e=new YE({}),{c(){z(e.$$.fragment)},m(n,a){W(e,n,a),t=!0},p:I,i(n){t||(P(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){Y(e,n)}}}function YL(r){let e,t,n,a,i=[WL,UL],o=[];function s(l,u){return l[0]?1:0}return e=s(r,-1),t=o[e]=i[e](r),{c(){t.c(),n=He()},m(l,u){o[e].m(l,u),$(l,n,u),a=!0},p(l,[u]){let c=e;e=s(l,u),e===c?o[e].p(l,u):(Oe(),R(o[c],1,1,()=>{o[c]=null}),_e(),t=o[e],t?t.p(l,u):(t=o[e]=i[e](l),t.c()),P(t,1),t.m(n.parentNode,n))},i(l){a||(P(t),a=!0)},o(l){R(t),a=!1},d(l){l&&A(n),o[e].d(l)}}}function zL(r,e,t){let{store:n}=e,{view:a}=e;return r.$$set=i=>{"store"in i&&t(0,n=i.store),"view"in i&&t(1,a=i.view)},r.$$.update=()=>{r.$$.dirty&3&&n&&(Pn("store",Ze(n)),Pn("ephemeralStore",Ze(n.getEphemeralStore(a.id))))},[n,a]}var p2=class extends ae{constructor(e){super(),oe(this,e,zL,YL,re,{store:0,view:1})}},VE=p2;var bh=class extends Ks.MarkdownRenderChild{constructor(t,n,a){super(a);this.plugin=t;this.source=n;this.getViewType=()=>Js.WEATHER;this.id=Le(12)}switchCalendar(t){let n=this.plugin.getStore(t);if(!n)throw new Ks.Notice("There was an issue opening that calendar."),new Error("Could not find a calendar by that name");this.store=n,this.calendar=t,this.ui.$set({store:this.store}),this.plugin.app.workspace.requestSaveLayout(),this.plugin.app.workspace.trigger("calendarium:view-parent:change-calendar",{parent:this.id,calendar:t})}onload(){let n=((0,Ks.parseYaml)(this.source??"")??{}).calendar??this.plugin.defaultCalendar.name,a=this.plugin.calendars.find(o=>o.name===n);a||(a=this.plugin.defaultCalendar);let i=this.plugin.getStore(a.id);if(!i){this.containerEl.replaceWith(createEl("code",{text:"No calendar by that name was found."}));return}this.store=i,this.calendar=a.id,this.ui=new VE({target:this.containerEl,props:{store:this.store,view:this}}),this.plugin.register(()=>{this.ui?.$destroy();let o=createEl("pre");o.createEl("code",{text:"Calendarium has been unloaded. Re-enable the plugin to render your calendars."}),this.containerEl.replaceWith(o)})}};var Js={CALENDAR:"calendarium",WEATHER:"calendarium-weather"},vh=class extends jE.Component{constructor(t){super();this.plugin=t}onload(){this.plugin.registerMarkdownCodeBlockProcessor(Js.CALENDAR,(t,n,a)=>{this.postProcess(Js.CALENDAR,t,n,a)}),this.plugin.registerMarkdownCodeBlockProcessor(Js.WEATHER,(t,n,a)=>{this.postProcess(Js.WEATHER,t,n,a)}),this.plugin.registerEditorSuggest(new ah(this.plugin))}postProcess(t,n,a,i){let o;switch(t){case"calendarium":{o=new nh(this.plugin,n,a);break}case"calendarium-weather":{o=new bh(this.plugin,n,a);break}}i.addChild(o)}};var VL=Eo.Platform.isMacOS?"Meta":"Control",el,Oh=class extends Eo.Plugin{constructor(){super(...arguments);Tt(this,el,[]);this.api=new th(this);this.settings$=Xe;this.stores=new WeakMap}registerNotice(t){t.registerOnHide(()=>{Me(this,el).remove(t)}),Me(this,el).push(t)}get configDir(){return this.manifest.dir??this.app.vault.configDir+"/plugins/calendarium"}get data(){return this.settings$.getData()}get calendars(){return this.settings$.getCalendars()}onSettingsLoaded(t){this.settings$.onSettingsLoaded(t)}onLayoutReadyAndSettingsLoad(t){this.settings$.onLayoutReadyAndSettingsLoad(t)}async saveSettings(){await this.settings$.save()}hasCalendar(t){return this.settings$.hasCalendar(t)}get defaultCalendar(){return this.data.calendars?.find(t=>t.id==this.data.defaultCalendar)??this.data.calendars?.[0]??null}async saveData(t){await super.saveData(t)}async onExternalSettingsChange(){this.settings$.onExternalSettingsChange()}getStoreByCalendar(t){return this.stores.has(t)||this.stores.set(t,xC(t,this)),this.stores.get(t)}getStore(t){if(!t)return null;let n=this.data.calendars.find(a=>a.id==t);return n?this.getStoreByCalendar(n):null}flushFileEvents(){for(let t of this.calendars)this.stores.get(t)?.flushFileEvents()}get canUseDailyNotes(){return this.dailyNotes._loaded}get dailyNotes(){return this.app.internalPlugins.getPluginById("daily-notes")}get format(){return(this.data.dailyNotes&&this.canUseDailyNotes?this.dailyNotes.instance.options.format:this.data.dateFormat)??Ra}async onload(){console.log("Loading Calendarium v"+this.manifest.version),Xe.initialize(this,this.manifest),await this.settings$.loadData(),(0,Eo.addIcon)("calendarium-between-horizontal-start",''),this.watcher=new Jd(this),(window.Calendarium=this.api)&&this.register(()=>delete window.Calendarium),this.registerView(Nr.Calendarium,t=>new bo(t,this)),this.registerView(Nr.Agenda,t=>new Mu(t,this)),new vh(this).load(),this.app.workspace.onLayoutReady(async()=>{this.addCommands(),this.addRibbonIcon(Nr.Calendarium,"Open Calendarium",t=>{this.addCalendarView({full:t.getModifierState(Eo.Platform.isMacOS?"Meta":"Control")})})}),this.settings$.onLayoutReadyAndSettingsLoad(()=>{this.watcher.load(),this.addSettingTab(new mu(this))}),this.app.workspace.trigger("parse-style-settings")}async onunload(){console.log("Unloading Calendarium v"+this.manifest.version),this.watcher?.unload();for(let t of Me(this,el))t?.hide()}addCommands(){this.addCommand({id:"open-calendarium",name:"Open calendar",callback:()=>{this.addCalendarView()}}),this.addCommand({id:"insert-calendarium-current-date",name:"Insert Current Date",editorCallback:t=>{this.insertCurrentDate(this.settings$.getDefaultCalendar(),t,this.api)}}),this.addCommand({id:"advance-calendarium-current-date",name:"Set Current Date to Next",callback:()=>{let t=this.settings$.getDefaultCalendar();if(!t)return;let n=this.getStoreByCalendar(t);this.changeDay(t,n,lo)}}),this.addCommand({id:"previous-calendarium-current-date",name:"Set Current Date to Previous",callback:()=>{let t=this.settings$.getDefaultCalendar();if(!t)return;let n=this.getStoreByCalendar(t);this.changeDay(t,n,Id)}})}addCalendarView(t={}){t?.startup&&this.app.workspace.getLeavesOfType(Nr.Calendarium)?.length||this.getLeaf(t?.full??!1)}getLeaf(t){let n=t?this.app.workspace.getLeaf(!0):this.app.workspace.getRightLeaf(!1);return n?.setViewState({type:Nr.Calendarium}),n&&this.app.workspace.revealLeaf(n),n}insertCurrentDate(t,n,a){if(!t)return;let i=t.current,s=a.getAPI(t.name).toDisplayDate(i,null,t.dateFormat),l=n.getCursor();n.replaceRange(s,l),l.ch+=s.length,n.setCursor(l)}changeDay(t,n,a){let i=t.current,o=a(i,n.yearCalculator,Ne(n.staticStore.staticData));n.setCurrentDate(o)}};el=new WeakMap; /*! Bundled license information: chroma-js/chroma.js: (** * chroma.js - JavaScript library for color conversions * * Copyright (c) 2011-2019, Gregor Aisch * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name Gregor Aisch may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * ------------------------------------------------------- * * chroma.js includes colors from colorbrewer2.org, which are released under * the following license: * * Copyright (c) 2002 Cynthia Brewer, Mark Harrower, * and The Pennsylvania State University. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. * * ------------------------------------------------------ * * Named colors are taken from X11 Color Names. * http://www.w3.org/TR/css3-color/#svg-color * * @preserve *) he/he.js: (*! https://mths.be/he v1.2.0 by @mathias | MIT license *) */ /* nosourcemap */